aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorDmitry Torokhov <dtor_core@ameritech.net>2006-04-02 00:08:05 -0500
committerDmitry Torokhov <dtor_core@ameritech.net>2006-04-02 00:08:05 -0500
commit95d465fd750897ab32462a6702fbfe1b122cbbc0 (patch)
tree65c38b2f11c51bb6932e44dd6c92f15b0091abfe /arch
parent642fde17dceceb56c7ba2762733ac688666ae657 (diff)
parent683aa4012f53b2ada0f430487e05d37b0d94e90a (diff)
Manual merge with Linus.
Conflicts: arch/powerpc/kernel/setup-common.c drivers/input/keyboard/hil_kbd.c drivers/input/mouse/hil_ptr.c
Diffstat (limited to 'arch')
-rw-r--r--arch/alpha/Kconfig8
-rw-r--r--arch/alpha/kernel/alpha_ksyms.c2
-rw-r--r--arch/alpha/kernel/core_marvel.c2
-rw-r--r--arch/alpha/kernel/osf_sys.c1
-rw-r--r--arch/alpha/kernel/setup.c14
-rw-r--r--arch/alpha/kernel/time.c3
-rw-r--r--arch/alpha/lib/ev6-memchr.S2
-rw-r--r--arch/alpha/lib/fpreg.c8
-rw-r--r--arch/alpha/mm/init.c2
-rw-r--r--arch/alpha/mm/numa.c4
-rw-r--r--arch/arm/Kconfig44
-rw-r--r--arch/arm/Kconfig-nommu44
-rw-r--r--arch/arm/Makefile17
-rw-r--r--arch/arm/boot/Makefile5
-rw-r--r--arch/arm/boot/bootp/Makefile5
-rw-r--r--arch/arm/boot/compressed/Makefile4
-rw-r--r--arch/arm/boot/compressed/head.S188
-rw-r--r--arch/arm/boot/compressed/ice-dcc.S17
-rw-r--r--arch/arm/boot/compressed/misc.c41
-rw-r--r--arch/arm/common/Makefile1
-rw-r--r--arch/arm/common/dmabounce.c2
-rw-r--r--arch/arm/common/locomo.c72
-rw-r--r--arch/arm/common/rtctime.c108
-rw-r--r--arch/arm/common/sa1111.c48
-rw-r--r--arch/arm/common/scoop.c6
-rw-r--r--arch/arm/common/sharpsl_pm.c10
-rw-r--r--arch/arm/common/uengine.c (renamed from arch/arm/mach-ixp2000/uengine.c)2
-rw-r--r--arch/arm/common/vic.c49
-rw-r--r--arch/arm/configs/ep93xx_defconfig (renamed from arch/arm/configs/enp2611_defconfig)553
-rw-r--r--arch/arm/configs/ixdp2401_defconfig976
-rw-r--r--arch/arm/configs/ixdp2801_defconfig976
-rw-r--r--arch/arm/configs/ixp2000_defconfig (renamed from arch/arm/configs/ixdp2400_defconfig)61
-rw-r--r--arch/arm/configs/ixp23xx_defconfig (renamed from arch/arm/configs/ixdp2800_defconfig)399
-rw-r--r--arch/arm/configs/s3c2410_defconfig147
-rw-r--r--arch/arm/kernel/apm.c4
-rw-r--r--arch/arm/kernel/bios32.c4
-rw-r--r--arch/arm/kernel/compat.c2
-rw-r--r--arch/arm/kernel/compat.h13
-rw-r--r--arch/arm/kernel/debug.S1
-rw-r--r--arch/arm/kernel/ecard.c4
-rw-r--r--arch/arm/kernel/entry-armv.S4
-rw-r--r--arch/arm/kernel/entry-header.S18
-rw-r--r--arch/arm/kernel/head-common.S217
-rw-r--r--arch/arm/kernel/head-nommu.S83
-rw-r--r--arch/arm/kernel/head.S215
-rw-r--r--arch/arm/kernel/irq.c11
-rw-r--r--arch/arm/kernel/process.c4
-rw-r--r--arch/arm/kernel/ptrace.c2
-rw-r--r--arch/arm/kernel/setup.c9
-rw-r--r--arch/arm/kernel/signal.h2
-rw-r--r--arch/arm/kernel/smp.c3
-rw-r--r--arch/arm/kernel/sys_arm.c5
-rw-r--r--arch/arm/kernel/traps.c11
-rw-r--r--arch/arm/lib/Makefile2
-rw-r--r--arch/arm/lib/backtrace.S2
-rw-r--r--arch/arm/lib/copy_template.S2
-rw-r--r--arch/arm/lib/delay.S20
-rw-r--r--arch/arm/lib/io-acorn.S1
-rw-r--r--arch/arm/mach-at91rm9200/clock.c85
-rw-r--r--arch/arm/mach-at91rm9200/gpio.c4
-rw-r--r--arch/arm/mach-at91rm9200/time.c4
-rw-r--r--arch/arm/mach-ep93xx/Kconfig21
-rw-r--r--arch/arm/mach-ep93xx/Makefile10
-rw-r--r--arch/arm/mach-ep93xx/Makefile.boot2
-rw-r--r--arch/arm/mach-ep93xx/core.c442
-rw-r--r--arch/arm/mach-ep93xx/gesbc9312.c40
-rw-r--r--arch/arm/mach-ep93xx/ts72xx.c118
-rw-r--r--arch/arm/mach-footbridge/dc21285.c4
-rw-r--r--arch/arm/mach-footbridge/time.c17
-rw-r--r--arch/arm/mach-integrator/core.c46
-rw-r--r--arch/arm/mach-integrator/impd1.c7
-rw-r--r--arch/arm/mach-integrator/integrator_ap.c4
-rw-r--r--arch/arm/mach-integrator/time.c16
-rw-r--r--arch/arm/mach-iop3xx/iop331-setup.c4
-rw-r--r--arch/arm/mach-iop3xx/iq31244-pci.c4
-rw-r--r--arch/arm/mach-iop3xx/iq80321-pci.c4
-rw-r--r--arch/arm/mach-iop3xx/iq80331-pci.c4
-rw-r--r--arch/arm/mach-iop3xx/iq80332-pci.c4
-rw-r--r--arch/arm/mach-ixp2000/Kconfig9
-rw-r--r--arch/arm/mach-ixp2000/Makefile2
-rw-r--r--arch/arm/mach-ixp2000/core.c13
-rw-r--r--arch/arm/mach-ixp2000/ixdp2x01.c98
-rw-r--r--arch/arm/mach-ixp23xx/Kconfig25
-rw-r--r--arch/arm/mach-ixp23xx/Makefile11
-rw-r--r--arch/arm/mach-ixp23xx/Makefile.boot2
-rw-r--r--arch/arm/mach-ixp23xx/core.c431
-rw-r--r--arch/arm/mach-ixp23xx/espresso.c69
-rw-r--r--arch/arm/mach-ixp23xx/ixdp2351.c325
-rw-r--r--arch/arm/mach-ixp23xx/pci.c275
-rw-r--r--arch/arm/mach-ixp23xx/roadrunner.c164
-rw-r--r--arch/arm/mach-ixp4xx/common-pci.c3
-rw-r--r--arch/arm/mach-ixp4xx/common.c5
-rw-r--r--arch/arm/mach-lh7a40x/common.h1
-rw-r--r--arch/arm/mach-lh7a40x/irq-kev7a400.c1
-rw-r--r--arch/arm/mach-lh7a40x/irq-lh7a400.c2
-rw-r--r--arch/arm/mach-lh7a40x/irq-lh7a404.c3
-rw-r--r--arch/arm/mach-lh7a40x/irq-lpd7a40x.c1
-rw-r--r--arch/arm/mach-omap1/board-netstar.c2
-rw-r--r--arch/arm/mach-omap1/board-voiceblue.c2
-rw-r--r--arch/arm/mach-omap2/serial.c2
-rw-r--r--arch/arm/mach-pxa/Kconfig5
-rw-r--r--arch/arm/mach-pxa/Makefile3
-rw-r--r--arch/arm/mach-pxa/clock.c124
-rw-r--r--arch/arm/mach-pxa/corgi.c12
-rw-r--r--arch/arm/mach-pxa/generic.c6
-rw-r--r--arch/arm/mach-pxa/leds-mainstone.c6
-rw-r--r--arch/arm/mach-pxa/lpd270.c393
-rw-r--r--arch/arm/mach-pxa/mainstone.c4
-rw-r--r--arch/arm/mach-pxa/poodle.c1
-rw-r--r--arch/arm/mach-pxa/spitz.c14
-rw-r--r--arch/arm/mach-pxa/tosa.c10
-rw-r--r--arch/arm/mach-realview/core.c28
-rw-r--r--arch/arm/mach-s3c2410/Kconfig7
-rw-r--r--arch/arm/mach-s3c2410/Makefile1
-rw-r--r--arch/arm/mach-s3c2410/clock.c178
-rw-r--r--arch/arm/mach-s3c2410/clock.h8
-rw-r--r--arch/arm/mach-s3c2410/cpu.c2
-rw-r--r--arch/arm/mach-s3c2410/devs.c12
-rw-r--r--arch/arm/mach-s3c2410/mach-osiris.c294
-rw-r--r--arch/arm/mach-s3c2410/s3c2440-clock.c89
-rw-r--r--arch/arm/mach-s3c2410/time.c8
-rw-r--r--arch/arm/mach-sa1100/Kconfig2
-rw-r--r--arch/arm/mach-sa1100/Makefile2
-rw-r--r--arch/arm/mach-sa1100/assabet.c1
-rw-r--r--arch/arm/mach-sa1100/clock.c132
-rw-r--r--arch/arm/mach-sa1100/collie.c30
-rw-r--r--arch/arm/mach-sa1100/collie_pm.c278
-rw-r--r--arch/arm/mach-sa1100/cpu-sa1100.c2
-rw-r--r--arch/arm/mach-sa1100/generic.c6
-rw-r--r--arch/arm/mach-versatile/core.c2
-rw-r--r--arch/arm/mm/Kconfig29
-rw-r--r--arch/arm/mm/Makefile2
-rw-r--r--arch/arm/mm/consistent.c4
-rw-r--r--arch/arm/mm/copypage-xsc3.S97
-rw-r--r--arch/arm/mm/init.c3
-rw-r--r--arch/arm/mm/ioremap.c1
-rw-r--r--arch/arm/mm/mm-armv.c3
-rw-r--r--arch/arm/mm/proc-arm1020.S2
-rw-r--r--arch/arm/mm/proc-arm1020e.S2
-rw-r--r--arch/arm/mm/proc-arm1022.S1
-rw-r--r--arch/arm/mm/proc-arm1026.S1
-rw-r--r--arch/arm/mm/proc-arm6_7.S1
-rw-r--r--arch/arm/mm/proc-arm720.S2
-rw-r--r--arch/arm/mm/proc-arm920.S2
-rw-r--r--arch/arm/mm/proc-arm922.S2
-rw-r--r--arch/arm/mm/proc-arm925.S2
-rw-r--r--arch/arm/mm/proc-arm926.S2
-rw-r--r--arch/arm/mm/proc-sa110.S1
-rw-r--r--arch/arm/mm/proc-sa1100.S1
-rw-r--r--arch/arm/mm/proc-v6.S17
-rw-r--r--arch/arm/mm/proc-xsc3.S499
-rw-r--r--arch/arm/mm/proc-xscale.S2
-rw-r--r--arch/arm/oprofile/common.c34
-rw-r--r--arch/arm/oprofile/op_counter.h2
-rw-r--r--arch/arm/vfp/entry.S2
-rw-r--r--arch/arm/vfp/vfphw.S4
-rw-r--r--arch/arm26/Kconfig4
-rw-r--r--arch/arm26/Makefile7
-rw-r--r--arch/arm26/boot/Makefile5
-rw-r--r--arch/arm26/kernel/armksyms.c2
-rw-r--r--arch/arm26/kernel/traps.c12
-rw-r--r--arch/arm26/mm/init.c9
-rw-r--r--arch/cris/Kconfig8
-rw-r--r--arch/cris/arch-v32/drivers/cryptocop.c2
-rw-r--r--arch/cris/kernel/irq.c10
-rw-r--r--arch/cris/kernel/process.c3
-rw-r--r--arch/cris/kernel/setup.c5
-rw-r--r--arch/cris/mm/init.c2
-rw-r--r--arch/frv/Kconfig4
-rw-r--r--arch/frv/kernel/frv_ksyms.c3
-rw-r--r--arch/frv/kernel/gdb-stub.c2
-rw-r--r--arch/frv/kernel/irq.c10
-rw-r--r--arch/frv/mm/dma-alloc.c4
-rw-r--r--arch/frv/mm/init.c6
-rw-r--r--arch/frv/mm/mmu-context.c6
-rw-r--r--arch/h8300/Kconfig8
-rw-r--r--arch/h8300/kernel/h8300_ksyms.c3
-rw-r--r--arch/h8300/kernel/process.c4
-rw-r--r--arch/h8300/mm/init.c4
-rw-r--r--arch/i386/Kconfig39
-rw-r--r--arch/i386/Kconfig.debug13
-rw-r--r--arch/i386/Makefile14
-rw-r--r--arch/i386/Makefile.cpu4
-rw-r--r--arch/i386/boot/Makefile36
-rw-r--r--arch/i386/boot/edd.S2
-rw-r--r--arch/i386/boot/video.S2
-rw-r--r--arch/i386/defconfig1172
-rw-r--r--arch/i386/kernel/Makefile2
-rw-r--r--arch/i386/kernel/acpi/boot.c8
-rw-r--r--arch/i386/kernel/alternative.c321
-rw-r--r--arch/i386/kernel/apic.c29
-rw-r--r--arch/i386/kernel/apm.c2
-rw-r--r--arch/i386/kernel/cpu/centaur.c1
-rw-r--r--arch/i386/kernel/cpu/common.c57
-rw-r--r--arch/i386/kernel/cpu/cpufreq/Kconfig24
-rw-r--r--arch/i386/kernel/cpu/cpufreq/cpufreq-nforce2.c64
-rw-r--r--arch/i386/kernel/cpu/cpufreq/elanfreq.c109
-rw-r--r--arch/i386/kernel/cpu/cpufreq/gx-suspmod.c183
-rw-r--r--arch/i386/kernel/cpu/cpufreq/longhaul.h4
-rw-r--r--arch/i386/kernel/cpu/cpufreq/p4-clockmod.c26
-rw-r--r--arch/i386/kernel/cpu/cpufreq/powernow-k6.c16
-rw-r--r--arch/i386/kernel/cpu/cpufreq/powernow-k7.c10
-rw-r--r--arch/i386/kernel/cpu/cpufreq/powernow-k8.c57
-rw-r--r--arch/i386/kernel/cpu/cpufreq/powernow-k8.h8
-rw-r--r--arch/i386/kernel/cpu/cpufreq/speedstep-centrino.c4
-rw-r--r--arch/i386/kernel/cpu/cpufreq/speedstep-lib.c42
-rw-r--r--arch/i386/kernel/cpu/cpufreq/speedstep-lib.h20
-rw-r--r--arch/i386/kernel/cpu/cpufreq/speedstep-smi.c53
-rw-r--r--arch/i386/kernel/cpu/intel.c12
-rw-r--r--arch/i386/kernel/cpu/intel_cacheinfo.c81
-rw-r--r--arch/i386/kernel/cpu/mcheck/mce.c4
-rw-r--r--arch/i386/kernel/cpu/mtrr/main.c13
-rw-r--r--arch/i386/kernel/cpu/proc.c4
-rw-r--r--arch/i386/kernel/crash.c2
-rw-r--r--arch/i386/kernel/dmi_scan.c123
-rw-r--r--arch/i386/kernel/efi.c27
-rw-r--r--arch/i386/kernel/entry.S4
-rw-r--r--arch/i386/kernel/head.S5
-rw-r--r--arch/i386/kernel/io_apic.c27
-rw-r--r--arch/i386/kernel/kprobes.c257
-rw-r--r--arch/i386/kernel/microcode.c28
-rw-r--r--arch/i386/kernel/module.c32
-rw-r--r--arch/i386/kernel/mpparse.c7
-rw-r--r--arch/i386/kernel/nmi.c11
-rw-r--r--arch/i386/kernel/process.c11
-rw-r--r--arch/i386/kernel/ptrace.c4
-rw-r--r--arch/i386/kernel/semaphore.c8
-rw-r--r--arch/i386/kernel/setup.c149
-rw-r--r--arch/i386/kernel/signal.c7
-rw-r--r--arch/i386/kernel/smp.c28
-rw-r--r--arch/i386/kernel/smpboot.c50
-rw-r--r--arch/i386/kernel/sys_i386.c25
-rw-r--r--arch/i386/kernel/syscall_table.S4
-rw-r--r--arch/i386/kernel/timers/timer_hpet.c2
-rw-r--r--arch/i386/kernel/timers/timer_pm.c104
-rw-r--r--arch/i386/kernel/timers/timer_tsc.c2
-rw-r--r--arch/i386/kernel/topology.c9
-rw-r--r--arch/i386/kernel/traps.c91
-rw-r--r--arch/i386/kernel/vm86.c12
-rw-r--r--arch/i386/kernel/vmlinux.lds.S23
-rw-r--r--arch/i386/kernel/vsyscall-sigreturn.S2
-rw-r--r--arch/i386/kernel/vsyscall-sysenter.S3
-rw-r--r--arch/i386/mach-es7000/es7000.h5
-rw-r--r--arch/i386/mach-es7000/es7000plat.c6
-rw-r--r--arch/i386/mach-visws/reboot.c1
-rw-r--r--arch/i386/mach-voyager/voyager_smp.c2
-rw-r--r--arch/i386/mm/discontig.c12
-rw-r--r--arch/i386/mm/fault.c210
-rw-r--r--arch/i386/mm/hugetlbpage.c12
-rw-r--r--arch/i386/mm/init.c47
-rw-r--r--arch/i386/mm/pageattr.c20
-rw-r--r--arch/i386/mm/pgtable.c2
-rw-r--r--arch/i386/oprofile/nmi_int.c7
-rw-r--r--arch/i386/pci/Makefile2
-rw-r--r--arch/i386/pci/common.c32
-rw-r--r--arch/i386/pci/direct.c15
-rw-r--r--arch/i386/pci/init.c25
-rw-r--r--arch/i386/pci/mmconfig.c11
-rw-r--r--arch/i386/pci/pcbios.c4
-rw-r--r--arch/i386/pci/pci.h3
-rw-r--r--arch/ia64/Kconfig36
-rw-r--r--arch/ia64/Makefile5
-rw-r--r--arch/ia64/configs/gensparse_defconfig1
-rw-r--r--arch/ia64/configs/sn2_defconfig1
-rw-r--r--arch/ia64/configs/tiger_defconfig2
-rw-r--r--arch/ia64/defconfig1
-rw-r--r--arch/ia64/dig/setup.c5
-rw-r--r--arch/ia64/hp/sim/simserial.c7
-rw-r--r--arch/ia64/ia32/ia32priv.h4
-rw-r--r--arch/ia64/ia32/sys_ia32.c89
-rw-r--r--arch/ia64/kernel/Makefile3
-rw-r--r--arch/ia64/kernel/acpi.c55
-rw-r--r--arch/ia64/kernel/efi.c62
-rw-r--r--arch/ia64/kernel/entry.S15
-rw-r--r--arch/ia64/kernel/gate.lds.S1
-rw-r--r--arch/ia64/kernel/iosapic.c271
-rw-r--r--arch/ia64/kernel/irq.c13
-rw-r--r--arch/ia64/kernel/ivt.S1
-rw-r--r--arch/ia64/kernel/kprobes.c51
-rw-r--r--arch/ia64/kernel/machvec.c19
-rw-r--r--arch/ia64/kernel/mca.c197
-rw-r--r--arch/ia64/kernel/mca_drv.c22
-rw-r--r--arch/ia64/kernel/mca_drv.h7
-rw-r--r--arch/ia64/kernel/mca_drv_asm.S13
-rw-r--r--arch/ia64/kernel/numa.c2
-rw-r--r--arch/ia64/kernel/palinfo.c8
-rw-r--r--arch/ia64/kernel/patch.c8
-rw-r--r--arch/ia64/kernel/perfmon.c5
-rw-r--r--arch/ia64/kernel/process.c8
-rw-r--r--arch/ia64/kernel/ptrace.c10
-rw-r--r--arch/ia64/kernel/setup.c71
-rw-r--r--arch/ia64/kernel/signal.c101
-rw-r--r--arch/ia64/kernel/smpboot.c221
-rw-r--r--arch/ia64/kernel/time.c11
-rw-r--r--arch/ia64/kernel/topology.c369
-rw-r--r--arch/ia64/kernel/traps.c6
-rw-r--r--arch/ia64/kernel/vmlinux.lds.S54
-rw-r--r--arch/ia64/lib/Makefile2
-rw-r--r--arch/ia64/lib/bitop.c88
-rw-r--r--arch/ia64/mm/Makefile2
-rw-r--r--arch/ia64/mm/contig.c12
-rw-r--r--arch/ia64/mm/discontig.c44
-rw-r--r--arch/ia64/mm/hugetlbpage.c12
-rw-r--r--arch/ia64/mm/init.c32
-rw-r--r--arch/ia64/mm/ioremap.c43
-rw-r--r--arch/ia64/mm/tlb.c12
-rw-r--r--arch/ia64/sn/kernel/Makefile3
-rw-r--r--arch/ia64/sn/kernel/bte.c2
-rw-r--r--arch/ia64/sn/kernel/io_init.c29
-rw-r--r--arch/ia64/sn/kernel/irq.c21
-rw-r--r--arch/ia64/sn/kernel/pio_phys.S71
-rw-r--r--arch/ia64/sn/kernel/setup.c11
-rw-r--r--arch/ia64/sn/kernel/sn2/sn2_smp.c21
-rw-r--r--arch/ia64/sn/kernel/sn2/sn_hwperf.c8
-rw-r--r--arch/ia64/sn/kernel/sn2/sn_proc_fs.c39
-rw-r--r--arch/ia64/sn/kernel/tiocx.c10
-rw-r--r--arch/ia64/sn/kernel/xpc_channel.c102
-rw-r--r--arch/ia64/sn/kernel/xpc_main.c1
-rw-r--r--arch/ia64/sn/kernel/xpc_partition.c28
-rw-r--r--arch/ia64/sn/pci/pcibr/pcibr_provider.c17
-rw-r--r--arch/ia64/sn/pci/tioca_provider.c2
-rw-r--r--arch/ia64/sn/pci/tioce_provider.c326
-rw-r--r--arch/m32r/Kconfig8
-rw-r--r--arch/m32r/Kconfig.debug2
-rw-r--r--arch/m32r/Makefile5
-rw-r--r--arch/m32r/kernel/irq.c10
-rw-r--r--arch/m32r/kernel/setup.c1
-rw-r--r--arch/m32r/mm/discontig.c7
-rw-r--r--arch/m32r/mm/init.c7
-rw-r--r--arch/m68k/Kconfig4
-rw-r--r--arch/m68k/bvme6000/config.c2
-rw-r--r--arch/m68k/bvme6000/rtc.c4
-rw-r--r--arch/m68k/kernel/m68k_ksyms.c1
-rw-r--r--arch/m68k/kernel/process.c2
-rw-r--r--arch/m68k/mm/init.c2
-rw-r--r--arch/m68k/mm/memory.c2
-rw-r--r--arch/m68k/mm/motorola.c2
-rw-r--r--arch/m68k/mvme16x/rtc.c4
-rw-r--r--arch/m68knommu/Kconfig8
-rw-r--r--arch/m68knommu/kernel/m68k_ksyms.c3
-rw-r--r--arch/m68knommu/kernel/process.c2
-rw-r--r--arch/m68knommu/kernel/vmlinux.lds.S10
-rw-r--r--arch/m68knommu/mm/init.c4
-rw-r--r--arch/mips/Kconfig14
-rw-r--r--arch/mips/Makefile236
-rw-r--r--arch/mips/arc/memory.c2
-rw-r--r--arch/mips/arc/misc.c19
-rw-r--r--arch/mips/au1000/common/cputable.c2
-rw-r--r--arch/mips/au1000/common/dbdma.c4
-rw-r--r--arch/mips/au1000/common/dma.c2
-rw-r--r--arch/mips/au1000/common/platform.c8
-rw-r--r--arch/mips/au1000/common/reset.c10
-rw-r--r--arch/mips/au1000/common/setup.c4
-rw-r--r--arch/mips/au1000/common/time.c2
-rw-r--r--arch/mips/cobalt/Kconfig7
-rw-r--r--arch/mips/cobalt/Makefile2
-rw-r--r--arch/mips/cobalt/console.c43
-rw-r--r--arch/mips/cobalt/setup.c13
-rw-r--r--arch/mips/configs/atlas_defconfig101
-rw-r--r--arch/mips/configs/bigsur_defconfig37
-rw-r--r--arch/mips/configs/capcella_defconfig54
-rw-r--r--arch/mips/configs/cobalt_defconfig78
-rw-r--r--arch/mips/configs/db1000_defconfig52
-rw-r--r--arch/mips/configs/db1100_defconfig52
-rw-r--r--arch/mips/configs/db1200_defconfig51
-rw-r--r--arch/mips/configs/db1500_defconfig99
-rw-r--r--arch/mips/configs/db1550_defconfig56
-rw-r--r--arch/mips/configs/ddb5476_defconfig35
-rw-r--r--arch/mips/configs/ddb5477_defconfig34
-rw-r--r--arch/mips/configs/decstation_defconfig33
-rw-r--r--arch/mips/configs/e55_defconfig50
-rw-r--r--arch/mips/configs/ev64120_defconfig34
-rw-r--r--arch/mips/configs/ev96100_defconfig30
-rw-r--r--arch/mips/configs/ip22_defconfig80
-rw-r--r--arch/mips/configs/ip27_defconfig42
-rw-r--r--arch/mips/configs/ip32_defconfig46
-rw-r--r--arch/mips/configs/it8172_defconfig32
-rw-r--r--arch/mips/configs/ivr_defconfig34
-rw-r--r--arch/mips/configs/jaguar-atx_defconfig26
-rw-r--r--arch/mips/configs/jmr3927_defconfig35
-rw-r--r--arch/mips/configs/lasat200_defconfig35
-rw-r--r--arch/mips/configs/malta_defconfig95
-rw-r--r--arch/mips/configs/mipssim_defconfig31
-rw-r--r--arch/mips/configs/mpc30x_defconfig53
-rw-r--r--arch/mips/configs/ocelot_3_defconfig64
-rw-r--r--arch/mips/configs/ocelot_c_defconfig35
-rw-r--r--arch/mips/configs/ocelot_defconfig30
-rw-r--r--arch/mips/configs/ocelot_g_defconfig35
-rw-r--r--arch/mips/configs/pb1100_defconfig52
-rw-r--r--arch/mips/configs/pb1500_defconfig56
-rw-r--r--arch/mips/configs/pb1550_defconfig56
-rw-r--r--arch/mips/configs/pnx8550-jbs_defconfig48
-rw-r--r--arch/mips/configs/pnx8550-v2pci_defconfig68
-rw-r--r--arch/mips/configs/qemu_defconfig16
-rw-r--r--arch/mips/configs/rbhma4500_defconfig58
-rw-r--r--arch/mips/configs/rm200_defconfig103
-rw-r--r--arch/mips/configs/sb1250-swarm_defconfig37
-rw-r--r--arch/mips/configs/sead_defconfig22
-rw-r--r--arch/mips/configs/tb0226_defconfig68
-rw-r--r--arch/mips/configs/tb0229_defconfig56
-rw-r--r--arch/mips/configs/tb0287_defconfig1105
-rw-r--r--arch/mips/configs/workpad_defconfig50
-rw-r--r--arch/mips/configs/yosemite_defconfig29
-rw-r--r--arch/mips/ddb5xxx/common/rtc_ds1386.c4
-rw-r--r--arch/mips/dec/prom/memory.c4
-rw-r--r--arch/mips/dec/time.c51
-rw-r--r--arch/mips/defconfig80
-rw-r--r--arch/mips/ite-boards/generic/time.c4
-rw-r--r--arch/mips/ite-boards/ivr/init.c3
-rw-r--r--arch/mips/ite-boards/qed-4n-s01b/init.c3
-rw-r--r--arch/mips/jazz/int-handler.S12
-rw-r--r--arch/mips/jmr3927/common/rtc_ds1742.c4
-rw-r--r--arch/mips/kernel/cpu-probe.c6
-rw-r--r--arch/mips/kernel/gdb-low.S2
-rw-r--r--arch/mips/kernel/irixsig.c4
-rw-r--r--arch/mips/kernel/irq.c10
-rw-r--r--arch/mips/kernel/linux32.c252
-rw-r--r--arch/mips/kernel/proc.c1
-rw-r--r--arch/mips/kernel/process.c17
-rw-r--r--arch/mips/kernel/scall64-n32.S2
-rw-r--r--arch/mips/kernel/scall64-o32.S2
-rw-r--r--arch/mips/kernel/setup.c20
-rw-r--r--arch/mips/kernel/signal-common.h10
-rw-r--r--arch/mips/kernel/signal.c6
-rw-r--r--arch/mips/kernel/signal32.c46
-rw-r--r--arch/mips/kernel/signal_n32.c5
-rw-r--r--arch/mips/kernel/smp.c4
-rw-r--r--arch/mips/kernel/syscall.c7
-rw-r--r--arch/mips/kernel/sysirix.c22
-rw-r--r--arch/mips/kernel/time.c28
-rw-r--r--arch/mips/kernel/traps.c2
-rw-r--r--arch/mips/lasat/image/romscript.normal5
-rw-r--r--arch/mips/lasat/setup.c7
-rw-r--r--arch/mips/lasat/sysctl.c63
-rw-r--r--arch/mips/mips-boards/atlas/atlas_setup.c2
-rw-r--r--arch/mips/mips-boards/generic/memory.c9
-rw-r--r--arch/mips/mips-boards/generic/mipsIRQ.S2
-rw-r--r--arch/mips/mips-boards/malta/malta_setup.c2
-rw-r--r--arch/mips/mips-boards/sim/sim_IRQ.c2
-rw-r--r--arch/mips/mips-boards/sim/sim_irq.S2
-rw-r--r--arch/mips/mips-boards/sim/sim_mem.c9
-rw-r--r--arch/mips/mips-boards/sim/sim_smp.c2
-rw-r--r--arch/mips/mm/Makefile2
-rw-r--r--arch/mips/mm/c-r3k.c18
-rw-r--r--arch/mips/mm/c-r4k.c14
-rw-r--r--arch/mips/mm/c-tx39.c1
-rw-r--r--arch/mips/mm/dma-ip32.c6
-rw-r--r--arch/mips/mm/init.c15
-rw-r--r--arch/mips/mm/pg-r4k.c10
-rw-r--r--arch/mips/mm/sc-rm7k.c25
-rw-r--r--arch/mips/mm/tlb-andes.c259
-rw-r--r--arch/mips/mm/tlb-r4k.c5
-rw-r--r--arch/mips/mm/tlbex.c13
-rw-r--r--arch/mips/momentum/jaguar_atx/reset.c2
-rw-r--r--arch/mips/momentum/jaguar_atx/setup.c6
-rw-r--r--arch/mips/momentum/ocelot_3/reset.c2
-rw-r--r--arch/mips/momentum/ocelot_3/setup.c38
-rw-r--r--arch/mips/momentum/ocelot_c/reset.c2
-rw-r--r--arch/mips/momentum/ocelot_c/setup.c4
-rw-r--r--arch/mips/pci/fixup-vr4133.c2
-rw-r--r--arch/mips/pci/ops-ddb5477.c4
-rw-r--r--arch/mips/pci/ops-tx4938.c16
-rw-r--r--arch/mips/pci/pci-bcm1480.c2
-rw-r--r--arch/mips/pci/pci-bcm1480ht.c2
-rw-r--r--arch/mips/pci/pci-ip27.c12
-rw-r--r--arch/mips/philips/pnx8550/common/int.c2
-rw-r--r--arch/mips/pmc-sierra/yosemite/setup.c4
-rw-r--r--arch/mips/qemu/Makefile2
-rw-r--r--arch/mips/qemu/q-smp.c48
-rw-r--r--arch/mips/sgi-ip22/ip22-reset.c2
-rw-r--r--arch/mips/sgi-ip22/ip22-time.c4
-rw-r--r--arch/mips/sgi-ip27/ip27-irq.c5
-rw-r--r--arch/mips/sgi-ip27/ip27-memory.c9
-rw-r--r--arch/mips/sgi-ip32/ip32-reset.c2
-rw-r--r--arch/mips/sgi-ip32/ip32-setup.c6
-rw-r--r--arch/mips/sibyte/sb1250/time.c77
-rw-r--r--arch/mips/sibyte/swarm/setup.c15
-rw-r--r--arch/mips/sni/setup.c4
-rw-r--r--arch/mips/tx4927/toshiba_rbtx4927/toshiba_rbtx4927_prom.c4
-rw-r--r--arch/mips/tx4927/toshiba_rbtx4927/toshiba_rbtx4927_setup.c4
-rw-r--r--arch/mips/tx4938/common/rtc_rx5c348.c16
-rw-r--r--arch/mips/tx4938/toshiba_rbtx4938/setup.c2
-rw-r--r--arch/mips/vr41xx/common/bcu.c6
-rw-r--r--arch/parisc/Kconfig14
-rw-r--r--arch/parisc/configs/712_defconfig160
-rw-r--r--arch/parisc/configs/a500_defconfig4
-rw-r--r--arch/parisc/configs/b180_defconfig12
-rw-r--r--arch/parisc/configs/c3000_defconfig252
-rw-r--r--arch/parisc/defconfig165
-rw-r--r--arch/parisc/kernel/cache.c6
-rw-r--r--arch/parisc/kernel/entry.S45
-rw-r--r--arch/parisc/kernel/pacache.S4
-rw-r--r--arch/parisc/kernel/parisc_ksyms.c19
-rw-r--r--arch/parisc/kernel/pdc_chassis.c8
-rw-r--r--arch/parisc/kernel/perf.c2
-rw-r--r--arch/parisc/kernel/process.c5
-rw-r--r--arch/parisc/kernel/smp.c25
-rw-r--r--arch/parisc/kernel/sys_parisc32.c58
-rw-r--r--arch/parisc/kernel/syscall_table.S4
-rw-r--r--arch/parisc/lib/iomap.c4
-rw-r--r--arch/parisc/mm/init.c11
-rw-r--r--arch/parisc/mm/ioremap.c54
-rw-r--r--arch/powerpc/Kconfig48
-rw-r--r--arch/powerpc/Kconfig.debug5
-rw-r--r--arch/powerpc/Makefile11
-rw-r--r--arch/powerpc/boot/crt0.S5
-rw-r--r--arch/powerpc/boot/install.sh2
-rw-r--r--arch/powerpc/boot/main.c4
-rw-r--r--arch/powerpc/configs/cell_defconfig177
-rw-r--r--arch/powerpc/configs/iseries_defconfig96
-rw-r--r--arch/powerpc/configs/maple_defconfig50
-rw-r--r--arch/powerpc/configs/mpc834x_sys_defconfig32
-rw-r--r--arch/powerpc/configs/mpc8540_ads_defconfig728
-rw-r--r--arch/powerpc/configs/pmac32_defconfig77
-rw-r--r--arch/powerpc/configs/ppc64_defconfig2
-rw-r--r--arch/powerpc/kernel/Makefile11
-rw-r--r--arch/powerpc/kernel/asm-offsets.c5
-rw-r--r--arch/powerpc/kernel/cpu_setup_6xx.S (renamed from arch/ppc/kernel/cpu_setup_6xx.S)0
-rw-r--r--arch/powerpc/kernel/cputable.c12
-rw-r--r--arch/powerpc/kernel/crash_dump.c4
-rw-r--r--arch/powerpc/kernel/entry_32.S8
-rw-r--r--arch/powerpc/kernel/entry_64.S17
-rw-r--r--arch/powerpc/kernel/firmware.c29
-rw-r--r--arch/powerpc/kernel/head_44x.S2
-rw-r--r--arch/powerpc/kernel/head_64.S43
-rw-r--r--arch/powerpc/kernel/head_8xx.S2
-rw-r--r--arch/powerpc/kernel/head_booke.h363
-rw-r--r--arch/powerpc/kernel/head_fsl_booke.S6
-rw-r--r--arch/powerpc/kernel/idle.c (renamed from arch/powerpc/kernel/idle_64.c)79
-rw-r--r--arch/powerpc/kernel/idle_6xx.S18
-rw-r--r--arch/powerpc/kernel/idle_power4.S38
-rw-r--r--arch/powerpc/kernel/iomap.c2
-rw-r--r--arch/powerpc/kernel/iommu.c1
-rw-r--r--arch/powerpc/kernel/irq.c39
-rw-r--r--arch/powerpc/kernel/kprobes.c71
-rw-r--r--arch/powerpc/kernel/l2cr_6xx.S (renamed from arch/ppc/kernel/l2cr.S)0
-rw-r--r--arch/powerpc/kernel/legacy_serial.c42
-rw-r--r--arch/powerpc/kernel/lparcfg.c4
-rw-r--r--arch/powerpc/kernel/module_32.c (renamed from arch/ppc/kernel/module.c)0
-rw-r--r--arch/powerpc/kernel/nvram_64.c7
-rw-r--r--arch/powerpc/kernel/of_device.c5
-rw-r--r--arch/powerpc/kernel/paca.c21
-rw-r--r--arch/powerpc/kernel/pci_32.c4
-rw-r--r--arch/powerpc/kernel/pci_64.c6
-rw-r--r--arch/powerpc/kernel/pci_iommu.c1
-rw-r--r--arch/powerpc/kernel/perfmon_fsl_booke.c (renamed from arch/ppc/kernel/perfmon_fsl_booke.c)0
-rw-r--r--arch/powerpc/kernel/ppc_ksyms.c11
-rw-r--r--arch/powerpc/kernel/proc_ppc64.c3
-rw-r--r--arch/powerpc/kernel/process.c23
-rw-r--r--arch/powerpc/kernel/prom.c158
-rw-r--r--arch/powerpc/kernel/prom_init.c68
-rw-r--r--arch/powerpc/kernel/ptrace-common.h2
-rw-r--r--arch/powerpc/kernel/rtas-proc.c3
-rw-r--r--arch/powerpc/kernel/rtas-rtc.c2
-rw-r--r--arch/powerpc/kernel/rtas.c8
-rw-r--r--arch/powerpc/kernel/rtas_pci.c26
-rw-r--r--arch/powerpc/kernel/setup-common.c75
-rw-r--r--arch/powerpc/kernel/setup_32.c78
-rw-r--r--arch/powerpc/kernel/setup_64.c83
-rw-r--r--arch/powerpc/kernel/signal_32.c1
-rw-r--r--arch/powerpc/kernel/signal_64.c5
-rw-r--r--arch/powerpc/kernel/smp.c6
-rw-r--r--arch/powerpc/kernel/swsusp_32.S (renamed from arch/ppc/kernel/swsusp.S)0
-rw-r--r--arch/powerpc/kernel/sys_ppc32.c73
-rw-r--r--arch/powerpc/kernel/syscalls.c1
-rw-r--r--arch/powerpc/kernel/sysfs.c12
-rw-r--r--arch/powerpc/kernel/tau_6xx.c (renamed from arch/ppc/kernel/temp.c)0
-rw-r--r--arch/powerpc/kernel/time.c291
-rw-r--r--arch/powerpc/kernel/traps.c51
-rw-r--r--arch/powerpc/kernel/vdso.c11
-rw-r--r--arch/powerpc/kernel/vdso32/sigtramp.S2
-rw-r--r--arch/powerpc/kernel/vdso64/sigtramp.S2
-rw-r--r--arch/powerpc/kernel/vmlinux.lds.S381
-rw-r--r--arch/powerpc/lib/copypage_64.S2
-rw-r--r--arch/powerpc/lib/copyuser_64.S2
-rw-r--r--arch/powerpc/lib/e2a.c14
-rw-r--r--arch/powerpc/lib/memcpy_64.S2
-rw-r--r--arch/powerpc/lib/rheap.c2
-rw-r--r--arch/powerpc/lib/sstep.c2
-rw-r--r--arch/powerpc/lib/strcase.c4
-rw-r--r--arch/powerpc/math-emu/Makefile (renamed from arch/ppc/math-emu/Makefile)0
-rw-r--r--arch/powerpc/math-emu/double.h (renamed from arch/ppc/math-emu/double.h)0
-rw-r--r--arch/powerpc/math-emu/fabs.c (renamed from arch/ppc/math-emu/fabs.c)0
-rw-r--r--arch/powerpc/math-emu/fadd.c (renamed from arch/ppc/math-emu/fadd.c)0
-rw-r--r--arch/powerpc/math-emu/fadds.c (renamed from arch/ppc/math-emu/fadds.c)0
-rw-r--r--arch/powerpc/math-emu/fcmpo.c (renamed from arch/ppc/math-emu/fcmpo.c)0
-rw-r--r--arch/powerpc/math-emu/fcmpu.c (renamed from arch/ppc/math-emu/fcmpu.c)0
-rw-r--r--arch/powerpc/math-emu/fctiw.c (renamed from arch/ppc/math-emu/fctiw.c)0
-rw-r--r--arch/powerpc/math-emu/fctiwz.c (renamed from arch/ppc/math-emu/fctiwz.c)0
-rw-r--r--arch/powerpc/math-emu/fdiv.c (renamed from arch/ppc/math-emu/fdiv.c)0
-rw-r--r--arch/powerpc/math-emu/fdivs.c (renamed from arch/ppc/math-emu/fdivs.c)0
-rw-r--r--arch/powerpc/math-emu/fmadd.c (renamed from arch/ppc/math-emu/fmadd.c)0
-rw-r--r--arch/powerpc/math-emu/fmadds.c (renamed from arch/ppc/math-emu/fmadds.c)0
-rw-r--r--arch/powerpc/math-emu/fmr.c (renamed from arch/ppc/math-emu/fmr.c)0
-rw-r--r--arch/powerpc/math-emu/fmsub.c (renamed from arch/ppc/math-emu/fmsub.c)0
-rw-r--r--arch/powerpc/math-emu/fmsubs.c (renamed from arch/ppc/math-emu/fmsubs.c)0
-rw-r--r--arch/powerpc/math-emu/fmul.c (renamed from arch/ppc/math-emu/fmul.c)0
-rw-r--r--arch/powerpc/math-emu/fmuls.c (renamed from arch/ppc/math-emu/fmuls.c)0
-rw-r--r--arch/powerpc/math-emu/fnabs.c (renamed from arch/ppc/math-emu/fnabs.c)0
-rw-r--r--arch/powerpc/math-emu/fneg.c (renamed from arch/ppc/math-emu/fneg.c)0
-rw-r--r--arch/powerpc/math-emu/fnmadd.c (renamed from arch/ppc/math-emu/fnmadd.c)0
-rw-r--r--arch/powerpc/math-emu/fnmadds.c (renamed from arch/ppc/math-emu/fnmadds.c)0
-rw-r--r--arch/powerpc/math-emu/fnmsub.c (renamed from arch/ppc/math-emu/fnmsub.c)0
-rw-r--r--arch/powerpc/math-emu/fnmsubs.c (renamed from arch/ppc/math-emu/fnmsubs.c)0
-rw-r--r--arch/powerpc/math-emu/fres.c (renamed from arch/ppc/math-emu/fres.c)0
-rw-r--r--arch/powerpc/math-emu/frsp.c (renamed from arch/ppc/math-emu/frsp.c)0
-rw-r--r--arch/powerpc/math-emu/frsqrte.c (renamed from arch/ppc/math-emu/frsqrte.c)0
-rw-r--r--arch/powerpc/math-emu/fsel.c (renamed from arch/ppc/math-emu/fsel.c)0
-rw-r--r--arch/powerpc/math-emu/fsqrt.c (renamed from arch/ppc/math-emu/fsqrt.c)0
-rw-r--r--arch/powerpc/math-emu/fsqrts.c (renamed from arch/ppc/math-emu/fsqrts.c)0
-rw-r--r--arch/powerpc/math-emu/fsub.c (renamed from arch/ppc/math-emu/fsub.c)0
-rw-r--r--arch/powerpc/math-emu/fsubs.c (renamed from arch/ppc/math-emu/fsubs.c)0
-rw-r--r--arch/powerpc/math-emu/lfd.c (renamed from arch/ppc/math-emu/lfd.c)0
-rw-r--r--arch/powerpc/math-emu/lfs.c (renamed from arch/ppc/math-emu/lfs.c)0
-rw-r--r--arch/powerpc/math-emu/math.c (renamed from arch/ppc/math-emu/math.c)2
-rw-r--r--arch/powerpc/math-emu/mcrfs.c (renamed from arch/ppc/math-emu/mcrfs.c)0
-rw-r--r--arch/powerpc/math-emu/mffs.c (renamed from arch/ppc/math-emu/mffs.c)0
-rw-r--r--arch/powerpc/math-emu/mtfsb0.c (renamed from arch/ppc/math-emu/mtfsb0.c)0
-rw-r--r--arch/powerpc/math-emu/mtfsb1.c (renamed from arch/ppc/math-emu/mtfsb1.c)0
-rw-r--r--arch/powerpc/math-emu/mtfsf.c (renamed from arch/ppc/math-emu/mtfsf.c)0
-rw-r--r--arch/powerpc/math-emu/mtfsfi.c (renamed from arch/ppc/math-emu/mtfsfi.c)0
-rw-r--r--arch/powerpc/math-emu/op-1.h (renamed from arch/ppc/math-emu/op-1.h)0
-rw-r--r--arch/powerpc/math-emu/op-2.h (renamed from arch/ppc/math-emu/op-2.h)0
-rw-r--r--arch/powerpc/math-emu/op-4.h (renamed from arch/ppc/math-emu/op-4.h)0
-rw-r--r--arch/powerpc/math-emu/op-common.h (renamed from arch/ppc/math-emu/op-common.h)0
-rw-r--r--arch/powerpc/math-emu/sfp-machine.h (renamed from arch/ppc/math-emu/sfp-machine.h)0
-rw-r--r--arch/powerpc/math-emu/single.h (renamed from arch/ppc/math-emu/single.h)0
-rw-r--r--arch/powerpc/math-emu/soft-fp.h (renamed from arch/ppc/math-emu/soft-fp.h)0
-rw-r--r--arch/powerpc/math-emu/stfd.c (renamed from arch/ppc/math-emu/stfd.c)0
-rw-r--r--arch/powerpc/math-emu/stfiwx.c (renamed from arch/ppc/math-emu/stfiwx.c)0
-rw-r--r--arch/powerpc/math-emu/stfs.c (renamed from arch/ppc/math-emu/stfs.c)0
-rw-r--r--arch/powerpc/math-emu/types.c (renamed from arch/ppc/math-emu/types.c)0
-rw-r--r--arch/powerpc/math-emu/udivmodti4.c (renamed from arch/ppc/math-emu/udivmodti4.c)0
-rw-r--r--arch/powerpc/mm/fault.c32
-rw-r--r--arch/powerpc/mm/hash_low_32.S2
-rw-r--r--arch/powerpc/mm/hash_utils_64.c39
-rw-r--r--arch/powerpc/mm/hugetlbpage.c15
-rw-r--r--arch/powerpc/mm/imalloc.c18
-rw-r--r--arch/powerpc/mm/init_32.c4
-rw-r--r--arch/powerpc/mm/init_64.c52
-rw-r--r--arch/powerpc/mm/lmb.c16
-rw-r--r--arch/powerpc/mm/mem.c15
-rw-r--r--arch/powerpc/mm/mmap.c2
-rw-r--r--arch/powerpc/mm/numa.c162
-rw-r--r--arch/powerpc/mm/pgtable_32.c11
-rw-r--r--arch/powerpc/mm/slb_low.S2
-rw-r--r--arch/powerpc/mm/stab.c6
-rw-r--r--arch/powerpc/mm/tlb_64.c2
-rw-r--r--arch/powerpc/oprofile/Makefile2
-rw-r--r--arch/powerpc/oprofile/backtrace.c126
-rw-r--r--arch/powerpc/oprofile/common.c9
-rw-r--r--arch/powerpc/oprofile/op_model_7450.c4
-rw-r--r--arch/powerpc/oprofile/op_model_fsl_booke.c4
-rw-r--r--arch/powerpc/oprofile/op_model_power4.c46
-rw-r--r--arch/powerpc/oprofile/op_model_rs64.c5
-rw-r--r--arch/powerpc/platforms/83xx/Makefile4
-rw-r--r--arch/powerpc/platforms/83xx/misc.c55
-rw-r--r--arch/powerpc/platforms/83xx/mpc834x_sys.c89
-rw-r--r--arch/powerpc/platforms/83xx/mpc834x_sys.h2
-rw-r--r--arch/powerpc/platforms/83xx/mpc83xx.h5
-rw-r--r--arch/powerpc/platforms/83xx/pci.c21
-rw-r--r--arch/powerpc/platforms/85xx/Kconfig75
-rw-r--r--arch/powerpc/platforms/85xx/Makefile6
-rw-r--r--arch/powerpc/platforms/85xx/misc.c31
-rw-r--r--arch/powerpc/platforms/85xx/mpc8540_ads.h36
-rw-r--r--arch/powerpc/platforms/85xx/mpc85xx.h18
-rw-r--r--arch/powerpc/platforms/85xx/mpc85xx_ads.c244
-rw-r--r--arch/powerpc/platforms/85xx/pci.c96
-rw-r--r--arch/powerpc/platforms/Makefile2
-rw-r--r--arch/powerpc/platforms/cell/Kconfig5
-rw-r--r--arch/powerpc/platforms/cell/Makefile10
-rw-r--r--arch/powerpc/platforms/cell/interrupt.c133
-rw-r--r--arch/powerpc/platforms/cell/interrupt.h2
-rw-r--r--arch/powerpc/platforms/cell/iommu.c16
-rw-r--r--arch/powerpc/platforms/cell/pervasive.c4
-rw-r--r--arch/powerpc/platforms/cell/setup.c13
-rw-r--r--arch/powerpc/platforms/cell/spider-pic.c108
-rw-r--r--arch/powerpc/platforms/cell/spu_base.c39
-rw-r--r--arch/powerpc/platforms/cell/spu_callbacks.c345
-rw-r--r--arch/powerpc/platforms/cell/spufs/backing_ops.c47
-rw-r--r--arch/powerpc/platforms/cell/spufs/context.c24
-rw-r--r--arch/powerpc/platforms/cell/spufs/file.c523
-rw-r--r--arch/powerpc/platforms/cell/spufs/hw_ops.c57
-rw-r--r--arch/powerpc/platforms/cell/spufs/inode.c8
-rw-r--r--arch/powerpc/platforms/cell/spufs/run.c91
-rw-r--r--arch/powerpc/platforms/cell/spufs/sched.c2
-rw-r--r--arch/powerpc/platforms/cell/spufs/spufs.h28
-rw-r--r--arch/powerpc/platforms/cell/spufs/switch.c3
-rw-r--r--arch/powerpc/platforms/chrp/chrp.h2
-rw-r--r--arch/powerpc/platforms/chrp/pegasos_eth.c2
-rw-r--r--arch/powerpc/platforms/chrp/setup.c79
-rw-r--r--arch/powerpc/platforms/chrp/time.c24
-rw-r--r--arch/powerpc/platforms/iseries/mf.c112
-rw-r--r--arch/powerpc/platforms/iseries/setup.c79
-rw-r--r--arch/powerpc/platforms/maple/setup.c10
-rw-r--r--arch/powerpc/platforms/maple/time.c26
-rw-r--r--arch/powerpc/platforms/powermac/bootx_init.c6
-rw-r--r--arch/powerpc/platforms/powermac/cpufreq_32.c2
-rw-r--r--arch/powerpc/platforms/powermac/cpufreq_64.c7
-rw-r--r--arch/powerpc/platforms/powermac/feature.c13
-rw-r--r--arch/powerpc/platforms/powermac/low_i2c.c3
-rw-r--r--arch/powerpc/platforms/powermac/nvram.c16
-rw-r--r--arch/powerpc/platforms/powermac/pci.c5
-rw-r--r--arch/powerpc/platforms/powermac/pfunc_base.c2
-rw-r--r--arch/powerpc/platforms/powermac/setup.c86
-rw-r--r--arch/powerpc/platforms/powermac/smp.c4
-rw-r--r--arch/powerpc/platforms/powermac/time.c4
-rw-r--r--arch/powerpc/platforms/powermac/udbg_scc.c2
-rw-r--r--arch/powerpc/platforms/pseries/Kconfig2
-rw-r--r--arch/powerpc/platforms/pseries/Makefile3
-rw-r--r--arch/powerpc/platforms/pseries/eeh.c2
-rw-r--r--arch/powerpc/platforms/pseries/eeh_driver.c16
-rw-r--r--arch/powerpc/platforms/pseries/firmware.c103
-rw-r--r--arch/powerpc/platforms/pseries/firmware.h17
-rw-r--r--arch/powerpc/platforms/pseries/hvCall.S2
-rw-r--r--arch/powerpc/platforms/pseries/hvconsole.c5
-rw-r--r--arch/powerpc/platforms/pseries/iommu.c4
-rw-r--r--arch/powerpc/platforms/pseries/pci.c4
-rw-r--r--arch/powerpc/platforms/pseries/pci_dlpar.c39
-rw-r--r--arch/powerpc/platforms/pseries/ras.c2
-rw-r--r--arch/powerpc/platforms/pseries/reconfig.c15
-rw-r--r--arch/powerpc/platforms/pseries/rtasd.c3
-rw-r--r--arch/powerpc/platforms/pseries/setup.c292
-rw-r--r--arch/powerpc/platforms/pseries/smp.c2
-rw-r--r--arch/powerpc/platforms/pseries/xics.c7
-rw-r--r--arch/powerpc/sysdev/dart_iommu.c2
-rw-r--r--arch/powerpc/sysdev/dcr.S2
-rw-r--r--arch/powerpc/sysdev/fsl_soc.c292
-rw-r--r--arch/powerpc/sysdev/ipic.h2
-rw-r--r--arch/powerpc/xmon/xmon.c30
-rw-r--r--arch/ppc/4xx_io/serial_sicc.c5
-rw-r--r--arch/ppc/8xx_io/commproc.c6
-rw-r--r--arch/ppc/8xx_io/cs4218_tdm.c10
-rw-r--r--arch/ppc/Kconfig144
-rw-r--r--arch/ppc/Kconfig.debug9
-rw-r--r--arch/ppc/Makefile8
-rw-r--r--arch/ppc/amiga/amiints.c2
-rw-r--r--arch/ppc/amiga/bootinfo.c2
-rw-r--r--arch/ppc/amiga/cia.c2
-rw-r--r--arch/ppc/amiga/config.c2
-rw-r--r--arch/ppc/amiga/ints.c2
-rw-r--r--arch/ppc/boot/Makefile12
-rw-r--r--arch/ppc/boot/common/Makefile3
-rw-r--r--arch/ppc/boot/common/bootinfo.c2
-rw-r--r--arch/ppc/boot/common/misc-common.c2
-rw-r--r--arch/ppc/boot/common/ns16550.c3
-rw-r--r--arch/ppc/boot/common/serial_stub.c2
-rw-r--r--arch/ppc/boot/common/util.S2
-rw-r--r--arch/ppc/boot/include/mpc10x.h2
-rw-r--r--arch/ppc/boot/openfirmware/Makefile106
-rw-r--r--arch/ppc/boot/openfirmware/chrpmain.c101
-rw-r--r--arch/ppc/boot/openfirmware/common.c146
-rw-r--r--arch/ppc/boot/openfirmware/dummy.c4
-rw-r--r--arch/ppc/boot/openfirmware/misc.S67
-rw-r--r--arch/ppc/boot/openfirmware/start.c172
-rw-r--r--arch/ppc/boot/simple/Makefile1
-rw-r--r--arch/ppc/boot/simple/cpc700_memory.c2
-rw-r--r--arch/ppc/boot/simple/embed_config.c7
-rw-r--r--arch/ppc/boot/simple/head.S9
-rw-r--r--arch/ppc/boot/simple/misc-chestnut.c2
-rw-r--r--arch/ppc/boot/simple/misc-cpci690.c2
-rw-r--r--arch/ppc/boot/simple/misc-ev64260.c2
-rw-r--r--arch/ppc/boot/simple/misc-ev64360.c1
-rw-r--r--arch/ppc/boot/simple/misc-katana.c2
-rw-r--r--arch/ppc/boot/simple/misc-mv64x60.c2
-rw-r--r--arch/ppc/boot/simple/misc-prep.c2
-rw-r--r--arch/ppc/boot/simple/misc-radstone_ppc7d.c2
-rw-r--r--arch/ppc/boot/simple/misc-spruce.c2
-rw-r--r--arch/ppc/boot/simple/misc.c2
-rw-r--r--arch/ppc/boot/simple/mpc10x_memory.c6
-rw-r--r--arch/ppc/boot/simple/mpc52xx_tty.c2
-rw-r--r--arch/ppc/boot/simple/mv64x60_tty.c2
-rw-r--r--arch/ppc/boot/simple/openbios.c2
-rw-r--r--arch/ppc/boot/simple/relocate.S4
-rw-r--r--arch/ppc/boot/utils/addnote.c175
-rw-r--r--arch/ppc/boot/utils/hack-coff.c84
-rw-r--r--arch/ppc/boot/utils/mkbugboot.c2
-rw-r--r--arch/ppc/boot/utils/mknote.c44
-rw-r--r--arch/ppc/configs/ibmchrp_defconfig875
-rw-r--r--arch/ppc/configs/ml300_defconfig739
-rw-r--r--arch/ppc/configs/ml403_defconfig740
-rw-r--r--arch/ppc/configs/pmac_defconfig1591
-rw-r--r--arch/ppc/configs/power3_defconfig1035
-rw-r--r--arch/ppc/configs/prep_defconfig (renamed from arch/ppc/configs/common_defconfig)0
-rw-r--r--arch/ppc/kernel/Makefile28
-rw-r--r--arch/ppc/kernel/dma-mapping.c4
-rw-r--r--arch/ppc/kernel/entry.S60
-rw-r--r--arch/ppc/kernel/head.S183
-rw-r--r--arch/ppc/kernel/head_44x.S2
-rw-r--r--arch/ppc/kernel/head_8xx.S2
-rw-r--r--arch/ppc/kernel/head_fsl_booke.S6
-rw-r--r--arch/ppc/kernel/idle.c112
-rw-r--r--arch/ppc/kernel/idle_6xx.S233
-rw-r--r--arch/ppc/kernel/idle_power4.S91
-rw-r--r--arch/ppc/kernel/pci.c396
-rw-r--r--arch/ppc/kernel/ppc_htab.c10
-rw-r--r--arch/ppc/kernel/ppc_ksyms.c26
-rw-r--r--arch/ppc/kernel/setup.c264
-rw-r--r--arch/ppc/kernel/smp-tbsync.c3
-rw-r--r--arch/ppc/kernel/smp.c2
-rw-r--r--arch/ppc/kernel/traps.c2
-rw-r--r--arch/ppc/lib/rheap.c2
-rw-r--r--arch/ppc/lib/strcase.c3
-rw-r--r--arch/ppc/mm/44x_mmu.c4
-rw-r--r--arch/ppc/mm/fault.c32
-rw-r--r--arch/ppc/mm/hashtable.S36
-rw-r--r--arch/ppc/mm/init.c19
-rw-r--r--arch/ppc/mm/mmu_context.c2
-rw-r--r--arch/ppc/mm/pgtable.c8
-rw-r--r--arch/ppc/mm/ppc_mmu.c28
-rw-r--r--arch/ppc/platforms/4xx/Kconfig23
-rw-r--r--arch/ppc/platforms/4xx/Makefile4
-rw-r--r--arch/ppc/platforms/4xx/bamboo.c2
-rw-r--r--arch/ppc/platforms/4xx/bamboo.h2
-rw-r--r--arch/ppc/platforms/4xx/bubinga.h2
-rw-r--r--arch/ppc/platforms/4xx/cpci405.c2
-rw-r--r--arch/ppc/platforms/4xx/ebony.c2
-rw-r--r--arch/ppc/platforms/4xx/ebony.h2
-rw-r--r--arch/ppc/platforms/4xx/ep405.c2
-rw-r--r--arch/ppc/platforms/4xx/ep405.h2
-rw-r--r--arch/ppc/platforms/4xx/ibm405ep.c2
-rw-r--r--arch/ppc/platforms/4xx/ibm405ep.h2
-rw-r--r--arch/ppc/platforms/4xx/ibm405gp.h2
-rw-r--r--arch/ppc/platforms/4xx/ibm405gpr.c2
-rw-r--r--arch/ppc/platforms/4xx/ibm405gpr.h2
-rw-r--r--arch/ppc/platforms/4xx/ibm440ep.c2
-rw-r--r--arch/ppc/platforms/4xx/ibm440ep.h2
-rw-r--r--arch/ppc/platforms/4xx/ibm440gp.c2
-rw-r--r--arch/ppc/platforms/4xx/ibm440gp.h2
-rw-r--r--arch/ppc/platforms/4xx/ibm440gx.c2
-rw-r--r--arch/ppc/platforms/4xx/ibm440gx.h2
-rw-r--r--arch/ppc/platforms/4xx/ibm440sp.c2
-rw-r--r--arch/ppc/platforms/4xx/ibm440sp.h2
-rw-r--r--arch/ppc/platforms/4xx/ibmnp405h.c2
-rw-r--r--arch/ppc/platforms/4xx/ibmnp405h.h2
-rw-r--r--arch/ppc/platforms/4xx/ibmstb4.c2
-rw-r--r--arch/ppc/platforms/4xx/ibmstb4.h2
-rw-r--r--arch/ppc/platforms/4xx/ibmstbx25.c2
-rw-r--r--arch/ppc/platforms/4xx/ibmstbx25.h2
-rw-r--r--arch/ppc/platforms/4xx/luan.c2
-rw-r--r--arch/ppc/platforms/4xx/luan.h2
-rw-r--r--arch/ppc/platforms/4xx/ocotea.c2
-rw-r--r--arch/ppc/platforms/4xx/ocotea.h2
-rw-r--r--arch/ppc/platforms/4xx/ppc440spe.c2
-rw-r--r--arch/ppc/platforms/4xx/ppc440spe.h2
-rw-r--r--arch/ppc/platforms/4xx/redwood5.c2
-rw-r--r--arch/ppc/platforms/4xx/redwood5.h2
-rw-r--r--arch/ppc/platforms/4xx/redwood6.c2
-rw-r--r--arch/ppc/platforms/4xx/redwood6.h2
-rw-r--r--arch/ppc/platforms/4xx/sycamore.c2
-rw-r--r--arch/ppc/platforms/4xx/sycamore.h2
-rw-r--r--arch/ppc/platforms/4xx/virtex-ii_pro.c60
-rw-r--r--arch/ppc/platforms/4xx/virtex-ii_pro.h99
-rw-r--r--arch/ppc/platforms/4xx/virtex.c56
-rw-r--r--arch/ppc/platforms/4xx/virtex.h35
-rw-r--r--arch/ppc/platforms/4xx/walnut.c2
-rw-r--r--arch/ppc/platforms/4xx/walnut.h2
-rw-r--r--arch/ppc/platforms/4xx/xilinx_ml300.c76
-rw-r--r--arch/ppc/platforms/4xx/xilinx_ml300.h6
-rw-r--r--arch/ppc/platforms/4xx/xilinx_ml403.c177
-rw-r--r--arch/ppc/platforms/4xx/xilinx_ml403.h49
-rw-r--r--arch/ppc/platforms/4xx/xparameters/xparameters.h37
-rw-r--r--arch/ppc/platforms/4xx/xparameters/xparameters_ml403.h243
-rw-r--r--arch/ppc/platforms/4xx/yucca.c2
-rw-r--r--arch/ppc/platforms/4xx/yucca.h2
-rw-r--r--arch/ppc/platforms/83xx/mpc834x_sys.c2
-rw-r--r--arch/ppc/platforms/83xx/mpc834x_sys.h4
-rw-r--r--arch/ppc/platforms/85xx/mpc8540_ads.c2
-rw-r--r--arch/ppc/platforms/85xx/mpc8540_ads.h2
-rw-r--r--arch/ppc/platforms/85xx/mpc8555_cds.h2
-rw-r--r--arch/ppc/platforms/85xx/mpc8560_ads.c2
-rw-r--r--arch/ppc/platforms/85xx/mpc8560_ads.h2
-rw-r--r--arch/ppc/platforms/85xx/mpc85xx_ads_common.c2
-rw-r--r--arch/ppc/platforms/85xx/mpc85xx_ads_common.h2
-rw-r--r--arch/ppc/platforms/85xx/mpc85xx_cds_common.c2
-rw-r--r--arch/ppc/platforms/85xx/mpc85xx_cds_common.h2
-rw-r--r--arch/ppc/platforms/85xx/sbc8560.c2
-rw-r--r--arch/ppc/platforms/85xx/sbc8560.h2
-rw-r--r--arch/ppc/platforms/85xx/sbc85xx.c2
-rw-r--r--arch/ppc/platforms/85xx/sbc85xx.h2
-rw-r--r--arch/ppc/platforms/85xx/stx_gp3.c2
-rw-r--r--arch/ppc/platforms/85xx/stx_gp3.h2
-rw-r--r--arch/ppc/platforms/85xx/tqm85xx.c2
-rw-r--r--arch/ppc/platforms/85xx/tqm85xx.h2
-rw-r--r--arch/ppc/platforms/Makefile15
-rw-r--r--arch/ppc/platforms/apus_setup.c2
-rw-r--r--arch/ppc/platforms/chestnut.c2
-rw-r--r--arch/ppc/platforms/chestnut.h2
-rw-r--r--arch/ppc/platforms/chrp_nvram.c83
-rw-r--r--arch/ppc/platforms/chrp_pci.c309
-rw-r--r--arch/ppc/platforms/chrp_pegasos_eth.c213
-rw-r--r--arch/ppc/platforms/chrp_setup.c671
-rw-r--r--arch/ppc/platforms/chrp_smp.c99
-rw-r--r--arch/ppc/platforms/chrp_time.c253
-rw-r--r--arch/ppc/platforms/cpci690.c4
-rw-r--r--arch/ppc/platforms/cpci690.h2
-rw-r--r--arch/ppc/platforms/ev64260.c4
-rw-r--r--arch/ppc/platforms/ev64260.h2
-rw-r--r--arch/ppc/platforms/ev64360.c4
-rw-r--r--arch/ppc/platforms/ev64360.h2
-rw-r--r--arch/ppc/platforms/fads.h2
-rw-r--r--arch/ppc/platforms/gemini.h3
-rw-r--r--arch/ppc/platforms/gemini_prom.S2
-rw-r--r--arch/ppc/platforms/gemini_setup.c2
-rw-r--r--arch/ppc/platforms/hdpu.c10
-rw-r--r--arch/ppc/platforms/hdpu.h2
-rw-r--r--arch/ppc/platforms/katana.c7
-rw-r--r--arch/ppc/platforms/katana.h2
-rw-r--r--arch/ppc/platforms/lite5200.c73
-rw-r--r--arch/ppc/platforms/lite5200.h2
-rw-r--r--arch/ppc/platforms/lopec.c2
-rw-r--r--arch/ppc/platforms/mpc8272ads_setup.c236
-rw-r--r--arch/ppc/platforms/mpc866ads_setup.c273
-rw-r--r--arch/ppc/platforms/mpc885ads_setup.c389
-rw-r--r--arch/ppc/platforms/mvme5100.c2
-rw-r--r--arch/ppc/platforms/pal4.h2
-rw-r--r--arch/ppc/platforms/pal4_pci.c2
-rw-r--r--arch/ppc/platforms/pal4_serial.h2
-rw-r--r--arch/ppc/platforms/pal4_setup.c2
-rw-r--r--arch/ppc/platforms/powerpmc250.c2
-rw-r--r--arch/ppc/platforms/pplus.c2
-rw-r--r--arch/ppc/platforms/pplus.h2
-rw-r--r--arch/ppc/platforms/pq2ads.c2
-rw-r--r--arch/ppc/platforms/pq2ads.h4
-rw-r--r--arch/ppc/platforms/pq2ads_pd.h114
-rw-r--r--arch/ppc/platforms/prep_setup.c16
-rw-r--r--arch/ppc/platforms/prpmc750.c2
-rw-r--r--arch/ppc/platforms/prpmc800.c2
-rw-r--r--arch/ppc/platforms/radstone_ppc7d.c7
-rw-r--r--arch/ppc/platforms/radstone_ppc7d.h2
-rw-r--r--arch/ppc/platforms/sandpoint.c2
-rw-r--r--arch/ppc/platforms/sandpoint.h2
-rw-r--r--arch/ppc/platforms/sbc82xx.c2
-rw-r--r--arch/ppc/platforms/spruce.c2
-rw-r--r--arch/ppc/platforms/tqm8260_setup.c2
-rw-r--r--arch/ppc/syslib/Makefile6
-rw-r--r--arch/ppc/syslib/cpc700.h2
-rw-r--r--arch/ppc/syslib/cpc700_pic.c2
-rw-r--r--arch/ppc/syslib/cpc710.h2
-rw-r--r--arch/ppc/syslib/gen550.h2
-rw-r--r--arch/ppc/syslib/gen550_dbg.c2
-rw-r--r--arch/ppc/syslib/gen550_kgdb.c2
-rw-r--r--arch/ppc/syslib/gt64260_pic.c2
-rw-r--r--arch/ppc/syslib/harrier.c2
-rw-r--r--arch/ppc/syslib/hawk_common.c2
-rw-r--r--arch/ppc/syslib/ibm440gp_common.c2
-rw-r--r--arch/ppc/syslib/ibm440gp_common.h2
-rw-r--r--arch/ppc/syslib/ibm440gx_common.c2
-rw-r--r--arch/ppc/syslib/ibm440gx_common.h2
-rw-r--r--arch/ppc/syslib/ibm440sp_common.c2
-rw-r--r--arch/ppc/syslib/ibm440sp_common.h2
-rw-r--r--arch/ppc/syslib/ibm44x_common.c2
-rw-r--r--arch/ppc/syslib/ibm44x_common.h2
-rw-r--r--arch/ppc/syslib/m8260_pci_erratum9.c2
-rw-r--r--arch/ppc/syslib/m8260_setup.c2
-rw-r--r--arch/ppc/syslib/m8xx_setup.c65
-rw-r--r--arch/ppc/syslib/m8xx_wdt.c3
-rw-r--r--arch/ppc/syslib/mpc10x_common.c2
-rw-r--r--arch/ppc/syslib/mpc52xx_devices.c2
-rw-r--r--arch/ppc/syslib/mpc52xx_pci.c5
-rw-r--r--arch/ppc/syslib/mpc52xx_pci.h2
-rw-r--r--arch/ppc/syslib/mpc52xx_pic.c2
-rw-r--r--arch/ppc/syslib/mpc52xx_setup.c50
-rw-r--r--arch/ppc/syslib/mpc52xx_sys.c2
-rw-r--r--arch/ppc/syslib/mpc83xx_devices.c2
-rw-r--r--arch/ppc/syslib/mpc83xx_sys.c2
-rw-r--r--arch/ppc/syslib/mpc85xx_devices.c2
-rw-r--r--arch/ppc/syslib/mpc85xx_sys.c2
-rw-r--r--arch/ppc/syslib/mpc8xx_devices.c2
-rw-r--r--arch/ppc/syslib/mpc8xx_sys.c2
-rw-r--r--arch/ppc/syslib/mv64360_pic.c2
-rw-r--r--arch/ppc/syslib/mv64x60.c2
-rw-r--r--arch/ppc/syslib/mv64x60_dbg.c2
-rw-r--r--arch/ppc/syslib/mv64x60_win.c2
-rw-r--r--arch/ppc/syslib/ocp.c3
-rw-r--r--arch/ppc/syslib/open_pic.c4
-rw-r--r--arch/ppc/syslib/open_pic2.c2
-rw-r--r--arch/ppc/syslib/open_pic_defs.h2
-rw-r--r--arch/ppc/syslib/pci_auto.c2
-rw-r--r--arch/ppc/syslib/ppc4xx_dma.c2
-rw-r--r--arch/ppc/syslib/ppc4xx_pic.c2
-rw-r--r--arch/ppc/syslib/ppc4xx_pm.c47
-rw-r--r--arch/ppc/syslib/ppc4xx_sgdma.c2
-rw-r--r--arch/ppc/syslib/ppc83xx_setup.c2
-rw-r--r--arch/ppc/syslib/ppc83xx_setup.h2
-rw-r--r--arch/ppc/syslib/ppc85xx_common.c2
-rw-r--r--arch/ppc/syslib/ppc85xx_common.h2
-rw-r--r--arch/ppc/syslib/ppc85xx_setup.c4
-rw-r--r--arch/ppc/syslib/ppc85xx_setup.h2
-rw-r--r--arch/ppc/syslib/ppc_sys.c179
-rw-r--r--arch/ppc/syslib/pq2_devices.c2
-rw-r--r--arch/ppc/syslib/pq2_sys.c2
-rw-r--r--arch/ppc/syslib/prep_nvram.c2
-rw-r--r--arch/ppc/syslib/prom.c1429
-rw-r--r--arch/ppc/syslib/prom_init.c1011
-rw-r--r--arch/ppc/syslib/todc_time.c2
-rw-r--r--arch/ppc/syslib/xilinx_pic.c4
-rw-r--r--arch/ppc/xmon/start.c2
-rw-r--r--arch/s390/Kconfig6
-rw-r--r--arch/s390/appldata/appldata_base.c3
-rw-r--r--arch/s390/crypto/crypt_s390_query.c2
-rw-r--r--arch/s390/kernel/compat_linux.c74
-rw-r--r--arch/s390/kernel/compat_wrapper.S8
-rw-r--r--arch/s390/kernel/debug.c11
-rw-r--r--arch/s390/kernel/process.c13
-rw-r--r--arch/s390/kernel/setup.c108
-rw-r--r--arch/s390/kernel/smp.c12
-rw-r--r--arch/s390/kernel/syscalls.S2
-rw-r--r--arch/s390/mm/cmm.c6
-rw-r--r--arch/s390/mm/init.c4
-rw-r--r--arch/sh/Kconfig8
-rw-r--r--arch/sh/Makefile2
-rw-r--r--arch/sh/boards/mpc1211/rtc.c50
-rw-r--r--arch/sh/boards/sh03/rtc.c13
-rw-r--r--arch/sh/kernel/cpu/init.c2
-rw-r--r--arch/sh/kernel/cpu/rtc.c10
-rw-r--r--arch/sh/kernel/irq.c5
-rw-r--r--arch/sh/kernel/process.c1
-rw-r--r--arch/sh/kernel/setup.c10
-rw-r--r--arch/sh/mm/consistent.c3
-rw-r--r--arch/sh/mm/hugetlbpage.c12
-rw-r--r--arch/sh/mm/init.c4
-rw-r--r--arch/sh64/Kconfig8
-rw-r--r--arch/sh64/kernel/irq.c5
-rw-r--r--arch/sh64/kernel/setup.c1
-rw-r--r--arch/sh64/kernel/time.c9
-rw-r--r--arch/sh64/mm/hugetlbpage.c12
-rw-r--r--arch/sh64/mm/init.c4
-rw-r--r--arch/sparc/Kconfig9
-rw-r--r--arch/sparc/kernel/ioport.c40
-rw-r--r--arch/sparc/kernel/irq.c71
-rw-r--r--arch/sparc/kernel/smp.c108
-rw-r--r--arch/sparc/kernel/sparc_ksyms.c4
-rw-r--r--arch/sparc/kernel/sun4d_irq.c10
-rw-r--r--arch/sparc/kernel/sun4d_smp.c22
-rw-r--r--arch/sparc/kernel/sun4m_smp.c189
-rw-r--r--arch/sparc/mm/generic.c1
-rw-r--r--arch/sparc/mm/init.c6
-rw-r--r--arch/sparc/mm/loadmmu.c2
-rw-r--r--arch/sparc/mm/srmmu.c15
-rw-r--r--arch/sparc/mm/sun4c.c15
-rw-r--r--arch/sparc64/Kconfig30
-rw-r--r--arch/sparc64/Kconfig.debug2
-rw-r--r--arch/sparc64/defconfig60
-rw-r--r--arch/sparc64/kernel/Makefile8
-rw-r--r--arch/sparc64/kernel/binfmt_aout32.c14
-rw-r--r--arch/sparc64/kernel/binfmt_elf32.c4
-rw-r--r--arch/sparc64/kernel/cpu.c7
-rw-r--r--arch/sparc64/kernel/devices.c189
-rw-r--r--arch/sparc64/kernel/dtlb_backend.S170
-rw-r--r--arch/sparc64/kernel/dtlb_base.S109
-rw-r--r--arch/sparc64/kernel/dtlb_miss.S39
-rw-r--r--arch/sparc64/kernel/ebus.c3
-rw-r--r--arch/sparc64/kernel/entry.S331
-rw-r--r--arch/sparc64/kernel/etrap.S170
-rw-r--r--arch/sparc64/kernel/head.S254
-rw-r--r--arch/sparc64/kernel/irq.c345
-rw-r--r--arch/sparc64/kernel/itlb_base.S79
-rw-r--r--arch/sparc64/kernel/itlb_miss.S39
-rw-r--r--arch/sparc64/kernel/kprobes.c69
-rw-r--r--arch/sparc64/kernel/ktlb.S363
-rw-r--r--arch/sparc64/kernel/pci.c15
-rw-r--r--arch/sparc64/kernel/pci_common.c301
-rw-r--r--arch/sparc64/kernel/pci_iommu.c36
-rw-r--r--arch/sparc64/kernel/pci_psycho.c23
-rw-r--r--arch/sparc64/kernel/pci_sabre.c23
-rw-r--r--arch/sparc64/kernel/pci_schizo.c24
-rw-r--r--arch/sparc64/kernel/pci_sun4v.c1147
-rw-r--r--arch/sparc64/kernel/pci_sun4v.h31
-rw-r--r--arch/sparc64/kernel/pci_sun4v_asm.S95
-rw-r--r--arch/sparc64/kernel/process.c133
-rw-r--r--arch/sparc64/kernel/ptrace.c3
-rw-r--r--arch/sparc64/kernel/rtrap.S115
-rw-r--r--arch/sparc64/kernel/sbus.c10
-rw-r--r--arch/sparc64/kernel/setup.c409
-rw-r--r--arch/sparc64/kernel/smp.c453
-rw-r--r--arch/sparc64/kernel/sparc64_ksyms.c41
-rw-r--r--arch/sparc64/kernel/sun4v_ivec.S334
-rw-r--r--arch/sparc64/kernel/sun4v_tlb_miss.S426
-rw-r--r--arch/sparc64/kernel/sys_sparc.c297
-rw-r--r--arch/sparc64/kernel/sys_sparc32.c83
-rw-r--r--arch/sparc64/kernel/systbls.S2
-rw-r--r--arch/sparc64/kernel/time.c389
-rw-r--r--arch/sparc64/kernel/trampoline.S238
-rw-r--r--arch/sparc64/kernel/traps.c439
-rw-r--r--arch/sparc64/kernel/tsb.S552
-rw-r--r--arch/sparc64/kernel/ttable.S63
-rw-r--r--arch/sparc64/kernel/unaligned.c45
-rw-r--r--arch/sparc64/kernel/us2e_cpufreq.c11
-rw-r--r--arch/sparc64/kernel/us3_cpufreq.c11
-rw-r--r--arch/sparc64/kernel/visemul.c894
-rw-r--r--arch/sparc64/kernel/vmlinux.lds.S16
-rw-r--r--arch/sparc64/kernel/winfixup.S480
-rw-r--r--arch/sparc64/lib/Makefile4
-rw-r--r--arch/sparc64/lib/NGbzero.S163
-rw-r--r--arch/sparc64/lib/NGcopy_from_user.S37
-rw-r--r--arch/sparc64/lib/NGcopy_to_user.S40
-rw-r--r--arch/sparc64/lib/NGmemcpy.S368
-rw-r--r--arch/sparc64/lib/NGpage.S96
-rw-r--r--arch/sparc64/lib/NGpatch.S33
-rw-r--r--arch/sparc64/lib/U3patch.S3
-rw-r--r--arch/sparc64/lib/bzero.S18
-rw-r--r--arch/sparc64/lib/clear_page.S12
-rw-r--r--arch/sparc64/lib/copy_page.S7
-rw-r--r--arch/sparc64/lib/delay.c19
-rw-r--r--arch/sparc64/lib/find_bit.c127
-rw-r--r--arch/sparc64/lib/xor.S300
-rw-r--r--arch/sparc64/math-emu/math.c24
-rw-r--r--arch/sparc64/mm/Makefile2
-rw-r--r--arch/sparc64/mm/fault.c24
-rw-r--r--arch/sparc64/mm/generic.c41
-rw-r--r--arch/sparc64/mm/hugetlbpage.c219
-rw-r--r--arch/sparc64/mm/init.c1452
-rw-r--r--arch/sparc64/mm/tlb.c64
-rw-r--r--arch/sparc64/mm/tsb.c500
-rw-r--r--arch/sparc64/mm/ultra.S374
-rw-r--r--arch/sparc64/prom/cif.S211
-rw-r--r--arch/sparc64/prom/console.c6
-rw-r--r--arch/sparc64/prom/init.c60
-rw-r--r--arch/sparc64/prom/misc.c44
-rw-r--r--arch/sparc64/prom/p1275.c11
-rw-r--r--arch/sparc64/prom/tree.c9
-rw-r--r--arch/sparc64/solaris/misc.c4
-rw-r--r--arch/um/Kconfig3
-rw-r--r--arch/um/Kconfig.i3865
-rw-r--r--arch/um/Kconfig.x86_645
-rw-r--r--arch/um/Makefile14
-rw-r--r--arch/um/Makefile-x86_642
-rw-r--r--arch/um/drivers/daemon_kern.c13
-rw-r--r--arch/um/drivers/harddog_kern.c8
-rw-r--r--arch/um/drivers/hostaudio_kern.c10
-rw-r--r--arch/um/drivers/mcast_kern.c13
-rw-r--r--arch/um/drivers/mconsole_kern.c143
-rw-r--r--arch/um/drivers/pcap_kern.c13
-rw-r--r--arch/um/drivers/slip_kern.c13
-rw-r--r--arch/um/drivers/slirp_kern.c15
-rw-r--r--arch/um/drivers/ubd_kern.c78
-rw-r--r--arch/um/include/irq_user.h15
-rw-r--r--arch/um/include/kern.h2
-rw-r--r--arch/um/include/kern_util.h6
-rw-r--r--arch/um/include/line.h18
-rw-r--r--arch/um/include/mem_user.h1
-rw-r--r--arch/um/include/misc_constants.h6
-rw-r--r--arch/um/include/os.h46
-rw-r--r--arch/um/include/sigio.h3
-rw-r--r--arch/um/include/skas/mode-skas.h1
-rw-r--r--arch/um/include/skas/skas.h1
-rw-r--r--arch/um/include/sysdep-i386/checksum.h5
-rw-r--r--arch/um/include/sysdep-i386/ptrace.h5
-rw-r--r--arch/um/include/sysdep-i386/tls.h32
-rw-r--r--arch/um/include/sysdep-x86_64/tls.h29
-rw-r--r--arch/um/include/user_util.h6
-rw-r--r--arch/um/kernel/Makefile9
-rw-r--r--arch/um/kernel/exec_kern.c18
-rw-r--r--arch/um/kernel/irq.c294
-rw-r--r--arch/um/kernel/irq_user.c412
-rw-r--r--arch/um/kernel/mem.c6
-rw-r--r--arch/um/kernel/physmem.c5
-rw-r--r--arch/um/kernel/process_kern.c26
-rw-r--r--arch/um/kernel/ptrace.c44
-rw-r--r--arch/um/kernel/sigio_kern.c10
-rw-r--r--arch/um/kernel/skas/process_kern.c11
-rw-r--r--arch/um/kernel/smp.c15
-rw-r--r--arch/um/kernel/syscall_kern.c4
-rw-r--r--arch/um/kernel/trap_kern.c8
-rw-r--r--arch/um/kernel/tt/process_kern.c10
-rw-r--r--arch/um/kernel/um_arch.c24
-rw-r--r--arch/um/os-Linux/Makefile16
-rw-r--r--arch/um/os-Linux/drivers/ethertap_kern.c13
-rw-r--r--arch/um/os-Linux/drivers/tuntap_kern.c13
-rw-r--r--arch/um/os-Linux/irq.c162
-rw-r--r--arch/um/os-Linux/mem.c27
-rw-r--r--arch/um/os-Linux/process.c44
-rw-r--r--arch/um/os-Linux/sigio.c (renamed from arch/um/kernel/sigio_user.c)233
-rw-r--r--arch/um/os-Linux/start_up.c146
-rw-r--r--arch/um/os-Linux/sys-i386/Makefile2
-rw-r--r--arch/um/os-Linux/sys-i386/tls.c33
-rw-r--r--arch/um/os-Linux/tls.c76
-rw-r--r--arch/um/os-Linux/tt.c10
-rw-r--r--arch/um/os-Linux/tty_log.c (renamed from arch/um/kernel/tty_log.c)18
-rw-r--r--arch/um/os-Linux/umid.c33
-rw-r--r--arch/um/scripts/Makefile.rules26
-rw-r--r--arch/um/scripts/Makefile.unmap22
-rw-r--r--arch/um/sys-i386/Makefile23
-rw-r--r--arch/um/sys-i386/ptrace.c60
-rw-r--r--arch/um/sys-i386/ptrace_user.c10
-rw-r--r--arch/um/sys-i386/signal.c107
-rw-r--r--arch/um/sys-i386/sys_call_table.S2
-rw-r--r--arch/um/sys-i386/syscalls.c16
-rw-r--r--arch/um/sys-i386/tls.c384
-rw-r--r--arch/um/sys-i386/user-offsets.c10
-rw-r--r--arch/um/sys-x86_64/Makefile34
-rw-r--r--arch/um/sys-x86_64/ptrace.c22
-rw-r--r--arch/um/sys-x86_64/signal.c56
-rw-r--r--arch/um/sys-x86_64/tls.c14
-rw-r--r--arch/um/sys-x86_64/user-offsets.c6
-rw-r--r--arch/v850/Kconfig6
-rw-r--r--arch/v850/kernel/process.c2
-rw-r--r--arch/v850/kernel/vmlinux.lds.S8
-rw-r--r--arch/x86_64/Kconfig57
-rw-r--r--arch/x86_64/Makefile21
-rw-r--r--arch/x86_64/boot/Makefile36
-rw-r--r--arch/x86_64/crypto/aes.c7
-rw-r--r--arch/x86_64/defconfig34
-rw-r--r--arch/x86_64/ia32/ia32_binfmt.c2
-rw-r--r--arch/x86_64/ia32/ia32entry.S4
-rw-r--r--arch/x86_64/ia32/sys_ia32.c93
-rw-r--r--arch/x86_64/ia32/vsyscall-sigreturn.S23
-rw-r--r--arch/x86_64/kernel/aperture.c4
-rw-r--r--arch/x86_64/kernel/apic.c34
-rw-r--r--arch/x86_64/kernel/early_printk.c118
-rw-r--r--arch/x86_64/kernel/entry.S31
-rw-r--r--arch/x86_64/kernel/functionlist1286
-rw-r--r--arch/x86_64/kernel/head.S26
-rw-r--r--arch/x86_64/kernel/io_apic.c10
-rw-r--r--arch/x86_64/kernel/irq.c21
-rw-r--r--arch/x86_64/kernel/kprobes.c69
-rw-r--r--arch/x86_64/kernel/mce.c7
-rw-r--r--arch/x86_64/kernel/mpparse.c19
-rw-r--r--arch/x86_64/kernel/nmi.c5
-rw-r--r--arch/x86_64/kernel/pci-dma.c3
-rw-r--r--arch/x86_64/kernel/pci-gart.c11
-rw-r--r--arch/x86_64/kernel/pmtimer.c5
-rw-r--r--arch/x86_64/kernel/process.c37
-rw-r--r--arch/x86_64/kernel/ptrace.c6
-rw-r--r--arch/x86_64/kernel/setup.c90
-rw-r--r--arch/x86_64/kernel/setup64.c22
-rw-r--r--arch/x86_64/kernel/signal.c4
-rw-r--r--arch/x86_64/kernel/smp.c6
-rw-r--r--arch/x86_64/kernel/smpboot.c26
-rw-r--r--arch/x86_64/kernel/time.c170
-rw-r--r--arch/x86_64/kernel/traps.c41
-rw-r--r--arch/x86_64/kernel/vmlinux.lds.S6
-rw-r--r--arch/x86_64/kernel/x8664_ksyms.c7
-rw-r--r--arch/x86_64/lib/thunk.S1
-rw-r--r--arch/x86_64/mm/fault.c81
-rw-r--r--arch/x86_64/mm/init.c44
-rw-r--r--arch/x86_64/mm/k8topology.c2
-rw-r--r--arch/x86_64/mm/numa.c39
-rw-r--r--arch/x86_64/mm/pageattr.c63
-rw-r--r--arch/x86_64/mm/srat.c8
-rw-r--r--arch/x86_64/pci/Makefile3
-rw-r--r--arch/x86_64/pci/mmconfig.c18
-rw-r--r--arch/xtensa/Kconfig8
-rw-r--r--arch/xtensa/kernel/irq.c15
-rw-r--r--arch/xtensa/kernel/xtensa_ksyms.c2
-rw-r--r--arch/xtensa/mm/init.c2
-rw-r--r--arch/xtensa/mm/pgtable.c24
-rw-r--r--arch/xtensa/platform-iss/console.c4
-rw-r--r--arch/xtensa/platform-iss/setup.c2
1250 files changed, 36633 insertions, 27491 deletions
diff --git a/arch/alpha/Kconfig b/arch/alpha/Kconfig
index eedf41bf7057..9bef61b30367 100644
--- a/arch/alpha/Kconfig
+++ b/arch/alpha/Kconfig
@@ -25,6 +25,10 @@ config RWSEM_XCHGADD_ALGORITHM
25 bool 25 bool
26 default y 26 default y
27 27
28config GENERIC_FIND_NEXT_BIT
29 bool
30 default y
31
28config GENERIC_CALIBRATE_DELAY 32config GENERIC_CALIBRATE_DELAY
29 bool 33 bool
30 default y 34 default y
@@ -447,6 +451,10 @@ config ALPHA_IRONGATE
447 depends on ALPHA_NAUTILUS 451 depends on ALPHA_NAUTILUS
448 default y 452 default y
449 453
454config GENERIC_HWEIGHT
455 bool
456 default y if !ALPHA_EV6 && !ALPHA_EV67
457
450config ALPHA_AVANTI 458config ALPHA_AVANTI
451 bool 459 bool
452 depends on ALPHA_XL || ALPHA_AVANTI_CH 460 depends on ALPHA_XL || ALPHA_AVANTI_CH
diff --git a/arch/alpha/kernel/alpha_ksyms.c b/arch/alpha/kernel/alpha_ksyms.c
index 1898ea79d0e2..9d6186d50245 100644
--- a/arch/alpha/kernel/alpha_ksyms.c
+++ b/arch/alpha/kernel/alpha_ksyms.c
@@ -216,8 +216,6 @@ EXPORT_SYMBOL(memcpy);
216EXPORT_SYMBOL(memset); 216EXPORT_SYMBOL(memset);
217EXPORT_SYMBOL(memchr); 217EXPORT_SYMBOL(memchr);
218 218
219EXPORT_SYMBOL(get_wchan);
220
221#ifdef CONFIG_ALPHA_IRONGATE 219#ifdef CONFIG_ALPHA_IRONGATE
222EXPORT_SYMBOL(irongate_ioremap); 220EXPORT_SYMBOL(irongate_ioremap);
223EXPORT_SYMBOL(irongate_iounmap); 221EXPORT_SYMBOL(irongate_iounmap);
diff --git a/arch/alpha/kernel/core_marvel.c b/arch/alpha/kernel/core_marvel.c
index 44866cb26a80..7f6a98455e74 100644
--- a/arch/alpha/kernel/core_marvel.c
+++ b/arch/alpha/kernel/core_marvel.c
@@ -435,7 +435,7 @@ marvel_specify_io7(char *str)
435 str = pchar; 435 str = pchar;
436 } while(*str); 436 } while(*str);
437 437
438 return 0; 438 return 1;
439} 439}
440__setup("io7=", marvel_specify_io7); 440__setup("io7=", marvel_specify_io7);
441 441
diff --git a/arch/alpha/kernel/osf_sys.c b/arch/alpha/kernel/osf_sys.c
index 7fb14f42a125..31afe3d91ac6 100644
--- a/arch/alpha/kernel/osf_sys.c
+++ b/arch/alpha/kernel/osf_sys.c
@@ -821,7 +821,6 @@ osf_setsysinfo(unsigned long op, void __user *buffer, unsigned long nbytes,
821 affects all sorts of things, like timeval and itimerval. */ 821 affects all sorts of things, like timeval and itimerval. */
822 822
823extern struct timezone sys_tz; 823extern struct timezone sys_tz;
824extern int do_adjtimex(struct timex *);
825 824
826struct timeval32 825struct timeval32
827{ 826{
diff --git a/arch/alpha/kernel/setup.c b/arch/alpha/kernel/setup.c
index fa3f1a354b3f..a15e18a00258 100644
--- a/arch/alpha/kernel/setup.c
+++ b/arch/alpha/kernel/setup.c
@@ -35,6 +35,7 @@
35#include <linux/root_dev.h> 35#include <linux/root_dev.h>
36#include <linux/initrd.h> 36#include <linux/initrd.h>
37#include <linux/eisa.h> 37#include <linux/eisa.h>
38#include <linux/pfn.h>
38#ifdef CONFIG_MAGIC_SYSRQ 39#ifdef CONFIG_MAGIC_SYSRQ
39#include <linux/sysrq.h> 40#include <linux/sysrq.h>
40#include <linux/reboot.h> 41#include <linux/reboot.h>
@@ -43,7 +44,7 @@
43#include <asm/setup.h> 44#include <asm/setup.h>
44#include <asm/io.h> 45#include <asm/io.h>
45 46
46extern struct notifier_block *panic_notifier_list; 47extern struct atomic_notifier_head panic_notifier_list;
47static int alpha_panic_event(struct notifier_block *, unsigned long, void *); 48static int alpha_panic_event(struct notifier_block *, unsigned long, void *);
48static struct notifier_block alpha_panic_block = { 49static struct notifier_block alpha_panic_block = {
49 alpha_panic_event, 50 alpha_panic_event,
@@ -242,9 +243,6 @@ reserve_std_resources(void)
242 request_resource(io, standard_io_resources+i); 243 request_resource(io, standard_io_resources+i);
243} 244}
244 245
245#define PFN_UP(x) (((x) + PAGE_SIZE-1) >> PAGE_SHIFT)
246#define PFN_DOWN(x) ((x) >> PAGE_SHIFT)
247#define PFN_PHYS(x) ((x) << PAGE_SHIFT)
248#define PFN_MAX PFN_DOWN(0x80000000) 246#define PFN_MAX PFN_DOWN(0x80000000)
249#define for_each_mem_cluster(memdesc, cluster, i) \ 247#define for_each_mem_cluster(memdesc, cluster, i) \
250 for ((cluster) = (memdesc)->cluster, (i) = 0; \ 248 for ((cluster) = (memdesc)->cluster, (i) = 0; \
@@ -473,11 +471,6 @@ page_is_ram(unsigned long pfn)
473 return 0; 471 return 0;
474} 472}
475 473
476#undef PFN_UP
477#undef PFN_DOWN
478#undef PFN_PHYS
479#undef PFN_MAX
480
481void __init 474void __init
482setup_arch(char **cmdline_p) 475setup_arch(char **cmdline_p)
483{ 476{
@@ -508,7 +501,8 @@ setup_arch(char **cmdline_p)
508 } 501 }
509 502
510 /* Register a call for panic conditions. */ 503 /* Register a call for panic conditions. */
511 notifier_chain_register(&panic_notifier_list, &alpha_panic_block); 504 atomic_notifier_chain_register(&panic_notifier_list,
505 &alpha_panic_block);
512 506
513#ifdef CONFIG_ALPHA_GENERIC 507#ifdef CONFIG_ALPHA_GENERIC
514 /* Assume that we've booted from SRM if we haven't booted from MILO. 508 /* Assume that we've booted from SRM if we haven't booted from MILO.
diff --git a/arch/alpha/kernel/time.c b/arch/alpha/kernel/time.c
index 6b2921be1909..3859749810b4 100644
--- a/arch/alpha/kernel/time.c
+++ b/arch/alpha/kernel/time.c
@@ -314,10 +314,11 @@ time_init(void)
314 if (!est_cycle_freq) 314 if (!est_cycle_freq)
315 est_cycle_freq = validate_cc_value(calibrate_cc_with_pit()); 315 est_cycle_freq = validate_cc_value(calibrate_cc_with_pit());
316 316
317 cc1 = rpcc_after_update_in_progress(); 317 cc1 = rpcc();
318 318
319 /* Calibrate CPU clock -- attempt #2. */ 319 /* Calibrate CPU clock -- attempt #2. */
320 if (!est_cycle_freq) { 320 if (!est_cycle_freq) {
321 cc1 = rpcc_after_update_in_progress();
321 cc2 = rpcc_after_update_in_progress(); 322 cc2 = rpcc_after_update_in_progress();
322 est_cycle_freq = validate_cc_value(cc2 - cc1); 323 est_cycle_freq = validate_cc_value(cc2 - cc1);
323 cc1 = cc2; 324 cc1 = cc2;
diff --git a/arch/alpha/lib/ev6-memchr.S b/arch/alpha/lib/ev6-memchr.S
index a8e843dbcc23..1a5f71b9d8b1 100644
--- a/arch/alpha/lib/ev6-memchr.S
+++ b/arch/alpha/lib/ev6-memchr.S
@@ -84,7 +84,7 @@ $last_quad:
84 beq $2, $not_found # U : U L U L 84 beq $2, $not_found # U : U L U L
85 85
86$found_it: 86$found_it:
87#if defined(__alpha_fix__) && defined(__alpha_cix__) 87#ifdef CONFIG_ALPHA_EV67
88 /* 88 /*
89 * Since we are guaranteed to have set one of the bits, we don't 89 * Since we are guaranteed to have set one of the bits, we don't
90 * have to worry about coming back with a 0x40 out of cttz... 90 * have to worry about coming back with a 0x40 out of cttz...
diff --git a/arch/alpha/lib/fpreg.c b/arch/alpha/lib/fpreg.c
index 97c4d9d7a4d5..05017ba34c3c 100644
--- a/arch/alpha/lib/fpreg.c
+++ b/arch/alpha/lib/fpreg.c
@@ -4,7 +4,7 @@
4 * (C) Copyright 1998 Linus Torvalds 4 * (C) Copyright 1998 Linus Torvalds
5 */ 5 */
6 6
7#if defined(__alpha_cix__) || defined(__alpha_fix__) 7#if defined(CONFIG_ALPHA_EV6) || defined(CONFIG_ALPHA_EV67)
8#define STT(reg,val) asm volatile ("ftoit $f"#reg",%0" : "=r"(val)); 8#define STT(reg,val) asm volatile ("ftoit $f"#reg",%0" : "=r"(val));
9#else 9#else
10#define STT(reg,val) asm volatile ("stt $f"#reg",%0" : "=m"(val)); 10#define STT(reg,val) asm volatile ("stt $f"#reg",%0" : "=m"(val));
@@ -53,7 +53,7 @@ alpha_read_fp_reg (unsigned long reg)
53 return val; 53 return val;
54} 54}
55 55
56#if defined(__alpha_cix__) || defined(__alpha_fix__) 56#if defined(CONFIG_ALPHA_EV6) || defined(CONFIG_ALPHA_EV67)
57#define LDT(reg,val) asm volatile ("itoft %0,$f"#reg : : "r"(val)); 57#define LDT(reg,val) asm volatile ("itoft %0,$f"#reg : : "r"(val));
58#else 58#else
59#define LDT(reg,val) asm volatile ("ldt $f"#reg",%0" : : "m"(val)); 59#define LDT(reg,val) asm volatile ("ldt $f"#reg",%0" : : "m"(val));
@@ -98,7 +98,7 @@ alpha_write_fp_reg (unsigned long reg, unsigned long val)
98 } 98 }
99} 99}
100 100
101#if defined(__alpha_cix__) || defined(__alpha_fix__) 101#if defined(CONFIG_ALPHA_EV6) || defined(CONFIG_ALPHA_EV67)
102#define STS(reg,val) asm volatile ("ftois $f"#reg",%0" : "=r"(val)); 102#define STS(reg,val) asm volatile ("ftois $f"#reg",%0" : "=r"(val));
103#else 103#else
104#define STS(reg,val) asm volatile ("sts $f"#reg",%0" : "=m"(val)); 104#define STS(reg,val) asm volatile ("sts $f"#reg",%0" : "=m"(val));
@@ -147,7 +147,7 @@ alpha_read_fp_reg_s (unsigned long reg)
147 return val; 147 return val;
148} 148}
149 149
150#if defined(__alpha_cix__) || defined(__alpha_fix__) 150#if defined(CONFIG_ALPHA_EV6) || defined(CONFIG_ALPHA_EV67)
151#define LDS(reg,val) asm volatile ("itofs %0,$f"#reg : : "r"(val)); 151#define LDS(reg,val) asm volatile ("itofs %0,$f"#reg : : "r"(val));
152#else 152#else
153#define LDS(reg,val) asm volatile ("lds $f"#reg",%0" : : "m"(val)); 153#define LDS(reg,val) asm volatile ("lds $f"#reg",%0" : : "m"(val));
diff --git a/arch/alpha/mm/init.c b/arch/alpha/mm/init.c
index 486d7945583d..544ac5dc09eb 100644
--- a/arch/alpha/mm/init.c
+++ b/arch/alpha/mm/init.c
@@ -357,7 +357,7 @@ free_reserved_mem(void *start, void *end)
357 void *__start = start; 357 void *__start = start;
358 for (; __start < end; __start += PAGE_SIZE) { 358 for (; __start < end; __start += PAGE_SIZE) {
359 ClearPageReserved(virt_to_page(__start)); 359 ClearPageReserved(virt_to_page(__start));
360 set_page_count(virt_to_page(__start), 1); 360 init_page_count(virt_to_page(__start));
361 free_page((long)__start); 361 free_page((long)__start);
362 totalram_pages++; 362 totalram_pages++;
363 } 363 }
diff --git a/arch/alpha/mm/numa.c b/arch/alpha/mm/numa.c
index 6d5251254f68..bf6b65c81bef 100644
--- a/arch/alpha/mm/numa.c
+++ b/arch/alpha/mm/numa.c
@@ -13,6 +13,7 @@
13#include <linux/bootmem.h> 13#include <linux/bootmem.h>
14#include <linux/swap.h> 14#include <linux/swap.h>
15#include <linux/initrd.h> 15#include <linux/initrd.h>
16#include <linux/pfn.h>
16 17
17#include <asm/hwrpb.h> 18#include <asm/hwrpb.h>
18#include <asm/pgalloc.h> 19#include <asm/pgalloc.h>
@@ -27,9 +28,6 @@ bootmem_data_t node_bdata[MAX_NUMNODES];
27#define DBGDCONT(args...) 28#define DBGDCONT(args...)
28#endif 29#endif
29 30
30#define PFN_UP(x) (((x) + PAGE_SIZE-1) >> PAGE_SHIFT)
31#define PFN_DOWN(x) ((x) >> PAGE_SHIFT)
32#define PFN_PHYS(x) ((x) << PAGE_SHIFT)
33#define for_each_mem_cluster(memdesc, cluster, i) \ 31#define for_each_mem_cluster(memdesc, cluster, i) \
34 for ((cluster) = (memdesc)->cluster, (i) = 0; \ 32 for ((cluster) = (memdesc)->cluster, (i) = 0; \
35 (i) < (memdesc)->numclusters; (i)++, (cluster)++) 33 (i) < (memdesc)->numclusters; (i)++, (cluster)++)
diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index 32ba00bd0a2f..dc5a9332c915 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -8,6 +8,7 @@ mainmenu "Linux Kernel Configuration"
8config ARM 8config ARM
9 bool 9 bool
10 default y 10 default y
11 select RTC_LIB
11 help 12 help
12 The ARM series is a line of low-power-consumption RISC chip designs 13 The ARM series is a line of low-power-consumption RISC chip designs
13 licensed by ARM Ltd and targeted at embedded applications and 14 licensed by ARM Ltd and targeted at embedded applications and
@@ -53,6 +54,10 @@ config RWSEM_GENERIC_SPINLOCK
53config RWSEM_XCHGADD_ALGORITHM 54config RWSEM_XCHGADD_ALGORITHM
54 bool 55 bool
55 56
57config GENERIC_HWEIGHT
58 bool
59 default y
60
56config GENERIC_CALIBRATE_DELAY 61config GENERIC_CALIBRATE_DELAY
57 bool 62 bool
58 default y 63 default y
@@ -72,6 +77,14 @@ config FIQ
72config ARCH_MTD_XIP 77config ARCH_MTD_XIP
73 bool 78 bool
74 79
80config VECTORS_BASE
81 hex
82 default 0xffff0000 if MMU
83 default DRAM_BASE if REMAP_VECTORS_TO_RAM
84 default 0x00000000
85 help
86 The base address of exception vectors.
87
75source "init/Kconfig" 88source "init/Kconfig"
76 89
77menu "System Type" 90menu "System Type"
@@ -108,6 +121,13 @@ config ARCH_EBSA110
108 Ethernet interface, two PCMCIA sockets, two serial ports and a 121 Ethernet interface, two PCMCIA sockets, two serial ports and a
109 parallel port. 122 parallel port.
110 123
124config ARCH_EP93XX
125 bool "EP93xx-based"
126 select ARM_AMBA
127 select ARM_VIC
128 help
129 This enables support for the Cirrus EP93xx series of CPUs.
130
111config ARCH_FOOTBRIDGE 131config ARCH_FOOTBRIDGE
112 bool "FootBridge" 132 bool "FootBridge"
113 select FOOTBRIDGE 133 select FOOTBRIDGE
@@ -141,6 +161,12 @@ config ARCH_IXP2000
141 help 161 help
142 Support for Intel's IXP2400/2800 (XScale) family of processors. 162 Support for Intel's IXP2400/2800 (XScale) family of processors.
143 163
164config ARCH_IXP23XX
165 bool "IXP23XX-based"
166 select PCI
167 help
168 Support for Intel's IXP23xx (XScale) family of processors.
169
144config ARCH_L7200 170config ARCH_L7200
145 bool "LinkUp-L7200" 171 bool "LinkUp-L7200"
146 select FIQ 172 select FIQ
@@ -250,6 +276,8 @@ endchoice
250 276
251source "arch/arm/mach-clps711x/Kconfig" 277source "arch/arm/mach-clps711x/Kconfig"
252 278
279source "arch/arm/mach-ep93xx/Kconfig"
280
253source "arch/arm/mach-footbridge/Kconfig" 281source "arch/arm/mach-footbridge/Kconfig"
254 282
255source "arch/arm/mach-integrator/Kconfig" 283source "arch/arm/mach-integrator/Kconfig"
@@ -260,6 +288,8 @@ source "arch/arm/mach-ixp4xx/Kconfig"
260 288
261source "arch/arm/mach-ixp2000/Kconfig" 289source "arch/arm/mach-ixp2000/Kconfig"
262 290
291source "arch/arm/mach-ixp23xx/Kconfig"
292
263source "arch/arm/mach-pxa/Kconfig" 293source "arch/arm/mach-pxa/Kconfig"
264 294
265source "arch/arm/mach-sa1100/Kconfig" 295source "arch/arm/mach-sa1100/Kconfig"
@@ -434,6 +464,13 @@ config NO_IDLE_HZ
434 Currently at least OMAP, PXA2xx and SA11x0 platforms are known 464 Currently at least OMAP, PXA2xx and SA11x0 platforms are known
435 to have accurate timekeeping with dynamic tick. 465 to have accurate timekeeping with dynamic tick.
436 466
467config HZ
468 int
469 default 128 if ARCH_L7200
470 default 200 if ARCH_EBSA110 || ARCH_S3C2410
471 default OMAP_32K_TIMER_HZ if ARCH_OMAP && OMAP_32K_TIMER
472 default 100
473
437config AEABI 474config AEABI
438 bool "Use the ARM EABI to compile the kernel" 475 bool "Use the ARM EABI to compile the kernel"
439 help 476 help
@@ -771,7 +808,8 @@ source "drivers/acorn/block/Kconfig"
771 808
772if PCMCIA || ARCH_CLPS7500 || ARCH_IOP3XX || ARCH_IXP4XX \ 809if PCMCIA || ARCH_CLPS7500 || ARCH_IOP3XX || ARCH_IXP4XX \
773 || ARCH_L7200 || ARCH_LH7A40X || ARCH_PXA || ARCH_RPC \ 810 || ARCH_L7200 || ARCH_LH7A40X || ARCH_PXA || ARCH_RPC \
774 || ARCH_S3C2410 || ARCH_SA1100 || ARCH_SHARK || FOOTBRIDGE 811 || ARCH_S3C2410 || ARCH_SA1100 || ARCH_SHARK || FOOTBRIDGE \
812 || ARCH_IXP23XX
775source "drivers/ide/Kconfig" 813source "drivers/ide/Kconfig"
776endif 814endif
777 815
@@ -809,6 +847,8 @@ source "drivers/misc/Kconfig"
809 847
810source "drivers/mfd/Kconfig" 848source "drivers/mfd/Kconfig"
811 849
850source "drivers/leds/Kconfig"
851
812source "drivers/media/Kconfig" 852source "drivers/media/Kconfig"
813 853
814source "drivers/video/Kconfig" 854source "drivers/video/Kconfig"
@@ -819,6 +859,8 @@ source "drivers/usb/Kconfig"
819 859
820source "drivers/mmc/Kconfig" 860source "drivers/mmc/Kconfig"
821 861
862source "drivers/rtc/Kconfig"
863
822endmenu 864endmenu
823 865
824source "fs/Kconfig" 866source "fs/Kconfig"
diff --git a/arch/arm/Kconfig-nommu b/arch/arm/Kconfig-nommu
new file mode 100644
index 000000000000..e1574be2ded6
--- /dev/null
+++ b/arch/arm/Kconfig-nommu
@@ -0,0 +1,44 @@
1#
2# Kconfig for uClinux(non-paged MM) depend configurations
3# Hyok S. Choi <hyok.choi@samsung.com>
4#
5
6config SET_MEM_PARAM
7 bool "Set flash/sdram size and base addr"
8 help
9 Say Y to manually set the base addresses and sizes.
10 otherwise, the default values are assigned.
11
12config DRAM_BASE
13 hex '(S)DRAM Base Address' if SET_MEM_PARAM
14 default 0x00800000
15
16config DRAM_SIZE
17 hex '(S)DRAM SIZE' if SET_MEM_PARAM
18 default 0x00800000
19
20config FLASH_MEM_BASE
21 hex 'FLASH Base Address' if SET_MEM_PARAM
22 default 0x00400000
23
24config FLASH_SIZE
25 hex 'FLASH Size' if SET_MEM_PARAM
26 default 0x00400000
27
28config REMAP_VECTORS_TO_RAM
29 bool 'Install vectors to the begining of RAM' if DRAM_BASE
30 depends on DRAM_BASE
31 help
32 The kernel needs to change the hardware exception vectors.
33 In nommu mode, the hardware exception vectors are normally
34 placed at address 0x00000000. However, this region may be
35 occupied by read-only memory depending on H/W design.
36
37 If the region contains read-write memory, say 'n' here.
38
39 If your CPU provides a remap facility which allows the exception
40 vectors to be mapped to writable memory, say 'n' here.
41
42 Otherwise, say 'y' here. In this case, the kernel will require
43 external support to redirect the hardware exception vectors to
44 the writable versions located at DRAM_BASE.
diff --git a/arch/arm/Makefile b/arch/arm/Makefile
index fbfc14a56b96..95a96275f88a 100644
--- a/arch/arm/Makefile
+++ b/arch/arm/Makefile
@@ -1,6 +1,9 @@
1# 1#
2# arch/arm/Makefile 2# arch/arm/Makefile
3# 3#
4# This file is included by the global makefile so that you can add your own
5# architecture-specific flags and dependencies.
6#
4# This file is subject to the terms and conditions of the GNU General Public 7# This file is subject to the terms and conditions of the GNU General Public
5# License. See the file "COPYING" in the main directory of this archive 8# License. See the file "COPYING" in the main directory of this archive
6# for more details. 9# for more details.
@@ -17,6 +20,11 @@ GZFLAGS :=-9
17# Select a platform tht is kept up-to-date 20# Select a platform tht is kept up-to-date
18KBUILD_DEFCONFIG := versatile_defconfig 21KBUILD_DEFCONFIG := versatile_defconfig
19 22
23# defines filename extension depending memory manement type.
24ifeq ($(CONFIG_MMU),)
25MMUEXT := -nommu
26endif
27
20ifeq ($(CONFIG_FRAME_POINTER),y) 28ifeq ($(CONFIG_FRAME_POINTER),y)
21CFLAGS +=-fno-omit-frame-pointer -mapcs -mno-sched-prolog 29CFLAGS +=-fno-omit-frame-pointer -mapcs -mno-sched-prolog
22endif 30endif
@@ -54,6 +62,7 @@ tune-$(CONFIG_CPU_ARM926T) :=-mtune=arm9tdmi
54tune-$(CONFIG_CPU_SA110) :=-mtune=strongarm110 62tune-$(CONFIG_CPU_SA110) :=-mtune=strongarm110
55tune-$(CONFIG_CPU_SA1100) :=-mtune=strongarm1100 63tune-$(CONFIG_CPU_SA1100) :=-mtune=strongarm1100
56tune-$(CONFIG_CPU_XSCALE) :=$(call cc-option,-mtune=xscale,-mtune=strongarm110) -Wa,-mcpu=xscale 64tune-$(CONFIG_CPU_XSCALE) :=$(call cc-option,-mtune=xscale,-mtune=strongarm110) -Wa,-mcpu=xscale
65tune-$(CONFIG_CPU_XSC3) :=$(call cc-option,-mtune=xscale,-mtune=strongarm110) -Wa,-mcpu=xscale
57tune-$(CONFIG_CPU_V6) :=$(call cc-option,-mtune=arm1136j-s,-mtune=strongarm) 66tune-$(CONFIG_CPU_V6) :=$(call cc-option,-mtune=arm1136j-s,-mtune=strongarm)
58 67
59ifeq ($(CONFIG_AEABI),y) 68ifeq ($(CONFIG_AEABI),y)
@@ -69,7 +78,7 @@ AFLAGS +=$(CFLAGS_ABI) $(arch-y) $(tune-y) -msoft-float
69CHECKFLAGS += -D__arm__ 78CHECKFLAGS += -D__arm__
70 79
71#Default value 80#Default value
72head-y := arch/arm/kernel/head.o arch/arm/kernel/init_task.o 81head-y := arch/arm/kernel/head$(MMUEXT).o arch/arm/kernel/init_task.o
73textofs-y := 0x00008000 82textofs-y := 0x00008000
74 83
75 machine-$(CONFIG_ARCH_RPC) := rpc 84 machine-$(CONFIG_ARCH_RPC) := rpc
@@ -94,6 +103,7 @@ endif
94 machine-$(CONFIG_ARCH_IOP3XX) := iop3xx 103 machine-$(CONFIG_ARCH_IOP3XX) := iop3xx
95 machine-$(CONFIG_ARCH_IXP4XX) := ixp4xx 104 machine-$(CONFIG_ARCH_IXP4XX) := ixp4xx
96 machine-$(CONFIG_ARCH_IXP2000) := ixp2000 105 machine-$(CONFIG_ARCH_IXP2000) := ixp2000
106 machine-$(CONFIG_ARCH_IXP23XX) := ixp23xx
97 machine-$(CONFIG_ARCH_OMAP1) := omap1 107 machine-$(CONFIG_ARCH_OMAP1) := omap1
98 machine-$(CONFIG_ARCH_OMAP2) := omap2 108 machine-$(CONFIG_ARCH_OMAP2) := omap2
99 incdir-$(CONFIG_ARCH_OMAP) := omap 109 incdir-$(CONFIG_ARCH_OMAP) := omap
@@ -105,6 +115,7 @@ endif
105 machine-$(CONFIG_ARCH_AAEC2000) := aaec2000 115 machine-$(CONFIG_ARCH_AAEC2000) := aaec2000
106 machine-$(CONFIG_ARCH_REALVIEW) := realview 116 machine-$(CONFIG_ARCH_REALVIEW) := realview
107 machine-$(CONFIG_ARCH_AT91RM9200) := at91rm9200 117 machine-$(CONFIG_ARCH_AT91RM9200) := at91rm9200
118 machine-$(CONFIG_ARCH_EP93XX) := ep93xx
108 119
109ifeq ($(CONFIG_ARCH_EBSA110),y) 120ifeq ($(CONFIG_ARCH_EBSA110),y)
110# This is what happens if you forget the IOCS16 line. 121# This is what happens if you forget the IOCS16 line.
@@ -127,7 +138,7 @@ else
127MACHINE := 138MACHINE :=
128endif 139endif
129 140
130export TEXT_OFFSET GZFLAGS 141export TEXT_OFFSET GZFLAGS MMUEXT
131 142
132# Do we have FASTFPE? 143# Do we have FASTFPE?
133FASTFPE :=arch/arm/fastfpe 144FASTFPE :=arch/arm/fastfpe
@@ -176,7 +187,7 @@ endif
176 187
177archprepare: maketools 188archprepare: maketools
178 189
179.PHONY: maketools FORCE 190PHONY += maketools FORCE
180maketools: include/linux/version.h include/asm-arm/.arch FORCE 191maketools: include/linux/version.h include/asm-arm/.arch FORCE
181 $(Q)$(MAKE) $(build)=arch/arm/tools include/asm-arm/mach-types.h 192 $(Q)$(MAKE) $(build)=arch/arm/tools include/asm-arm/mach-types.h
182 193
diff --git a/arch/arm/boot/Makefile b/arch/arm/boot/Makefile
index a174d63395ea..ec9c400c7f82 100644
--- a/arch/arm/boot/Makefile
+++ b/arch/arm/boot/Makefile
@@ -1,6 +1,9 @@
1# 1#
2# arch/arm/boot/Makefile 2# arch/arm/boot/Makefile
3# 3#
4# This file is included by the global makefile so that you can add your own
5# architecture-specific flags and dependencies.
6#
4# This file is subject to the terms and conditions of the GNU General Public 7# This file is subject to the terms and conditions of the GNU General Public
5# License. See the file "COPYING" in the main directory of this archive 8# License. See the file "COPYING" in the main directory of this archive
6# for more details. 9# for more details.
@@ -73,7 +76,7 @@ $(obj)/bootpImage: $(obj)/bootp/bootp FORCE
73 $(call if_changed,objcopy) 76 $(call if_changed,objcopy)
74 @echo ' Kernel: $@ is ready' 77 @echo ' Kernel: $@ is ready'
75 78
76.PHONY: initrd FORCE 79PHONY += initrd FORCE
77initrd: 80initrd:
78 @test "$(INITRD_PHYS)" != "" || \ 81 @test "$(INITRD_PHYS)" != "" || \
79 (echo This machine does not support INITRD; exit -1) 82 (echo This machine does not support INITRD; exit -1)
diff --git a/arch/arm/boot/bootp/Makefile b/arch/arm/boot/bootp/Makefile
index 8e8879b6b3d7..c394e305447c 100644
--- a/arch/arm/boot/bootp/Makefile
+++ b/arch/arm/boot/bootp/Makefile
@@ -1,6 +1,9 @@
1# 1#
2# linux/arch/arm/boot/bootp/Makefile 2# linux/arch/arm/boot/bootp/Makefile
3# 3#
4# This file is included by the global makefile so that you can add your own
5# architecture-specific flags and dependencies.
6#
4 7
5LDFLAGS_bootp :=-p --no-undefined -X \ 8LDFLAGS_bootp :=-p --no-undefined -X \
6 --defsym initrd_phys=$(INITRD_PHYS) \ 9 --defsym initrd_phys=$(INITRD_PHYS) \
@@ -21,4 +24,4 @@ $(obj)/kernel.o: arch/arm/boot/zImage FORCE
21 24
22$(obj)/initrd.o: $(INITRD) FORCE 25$(obj)/initrd.o: $(INITRD) FORCE
23 26
24.PHONY: $(INITRD) FORCE 27PHONY += $(INITRD) FORCE
diff --git a/arch/arm/boot/compressed/Makefile b/arch/arm/boot/compressed/Makefile
index 35ffe0f4ece7..2adc1527e0eb 100644
--- a/arch/arm/boot/compressed/Makefile
+++ b/arch/arm/boot/compressed/Makefile
@@ -50,10 +50,6 @@ ifeq ($(CONFIG_ARCH_AT91RM9200),y)
50OBJS += head-at91rm9200.o 50OBJS += head-at91rm9200.o
51endif 51endif
52 52
53ifeq ($(CONFIG_DEBUG_ICEDCC),y)
54OBJS += ice-dcc.o
55endif
56
57ifeq ($(CONFIG_CPU_BIG_ENDIAN),y) 53ifeq ($(CONFIG_CPU_BIG_ENDIAN),y)
58OBJS += big-endian.o 54OBJS += big-endian.o
59endif 55endif
diff --git a/arch/arm/boot/compressed/head.S b/arch/arm/boot/compressed/head.S
index db3389d8e027..b56f5e691d65 100644
--- a/arch/arm/boot/compressed/head.S
+++ b/arch/arm/boot/compressed/head.S
@@ -2,6 +2,7 @@
2 * linux/arch/arm/boot/compressed/head.S 2 * linux/arch/arm/boot/compressed/head.S
3 * 3 *
4 * Copyright (C) 1996-2002 Russell King 4 * Copyright (C) 1996-2002 Russell King
5 * Copyright (C) 2004 Hyok S. Choi (MPU support)
5 * 6 *
6 * This program is free software; you can redistribute it and/or modify 7 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as 8 * it under the terms of the GNU General Public License version 2 as
@@ -320,6 +321,62 @@ params: ldr r0, =params_phys
320cache_on: mov r3, #8 @ cache_on function 321cache_on: mov r3, #8 @ cache_on function
321 b call_cache_fn 322 b call_cache_fn
322 323
324/*
325 * Initialize the highest priority protection region, PR7
326 * to cover all 32bit address and cacheable and bufferable.
327 */
328__armv4_mpu_cache_on:
329 mov r0, #0x3f @ 4G, the whole
330 mcr p15, 0, r0, c6, c7, 0 @ PR7 Area Setting
331 mcr p15, 0, r0, c6, c7, 1
332
333 mov r0, #0x80 @ PR7
334 mcr p15, 0, r0, c2, c0, 0 @ D-cache on
335 mcr p15, 0, r0, c2, c0, 1 @ I-cache on
336 mcr p15, 0, r0, c3, c0, 0 @ write-buffer on
337
338 mov r0, #0xc000
339 mcr p15, 0, r0, c5, c0, 1 @ I-access permission
340 mcr p15, 0, r0, c5, c0, 0 @ D-access permission
341
342 mov r0, #0
343 mcr p15, 0, r0, c7, c10, 4 @ drain write buffer
344 mcr p15, 0, r0, c7, c5, 0 @ flush(inval) I-Cache
345 mcr p15, 0, r0, c7, c6, 0 @ flush(inval) D-Cache
346 mrc p15, 0, r0, c1, c0, 0 @ read control reg
347 @ ...I .... ..D. WC.M
348 orr r0, r0, #0x002d @ .... .... ..1. 11.1
349 orr r0, r0, #0x1000 @ ...1 .... .... ....
350
351 mcr p15, 0, r0, c1, c0, 0 @ write control reg
352
353 mov r0, #0
354 mcr p15, 0, r0, c7, c5, 0 @ flush(inval) I-Cache
355 mcr p15, 0, r0, c7, c6, 0 @ flush(inval) D-Cache
356 mov pc, lr
357
358__armv3_mpu_cache_on:
359 mov r0, #0x3f @ 4G, the whole
360 mcr p15, 0, r0, c6, c7, 0 @ PR7 Area Setting
361
362 mov r0, #0x80 @ PR7
363 mcr p15, 0, r0, c2, c0, 0 @ cache on
364 mcr p15, 0, r0, c3, c0, 0 @ write-buffer on
365
366 mov r0, #0xc000
367 mcr p15, 0, r0, c5, c0, 0 @ access permission
368
369 mov r0, #0
370 mcr p15, 0, r0, c7, c0, 0 @ invalidate whole cache v3
371 mrc p15, 0, r0, c1, c0, 0 @ read control reg
372 @ .... .... .... WC.M
373 orr r0, r0, #0x000d @ .... .... .... 11.1
374 mov r0, #0
375 mcr p15, 0, r0, c1, c0, 0 @ write control reg
376
377 mcr p15, 0, r0, c7, c0, 0 @ invalidate whole cache v3
378 mov pc, lr
379
323__setup_mmu: sub r3, r4, #16384 @ Page directory size 380__setup_mmu: sub r3, r4, #16384 @ Page directory size
324 bic r3, r3, #0xff @ Align the pointer 381 bic r3, r3, #0xff @ Align the pointer
325 bic r3, r3, #0x3f00 382 bic r3, r3, #0x3f00
@@ -358,7 +415,7 @@ __setup_mmu: sub r3, r4, #16384 @ Page directory size
358 str r1, [r0] 415 str r1, [r0]
359 mov pc, lr 416 mov pc, lr
360 417
361__armv4_cache_on: 418__armv4_mmu_cache_on:
362 mov r12, lr 419 mov r12, lr
363 bl __setup_mmu 420 bl __setup_mmu
364 mov r0, #0 421 mov r0, #0
@@ -367,24 +424,24 @@ __armv4_cache_on:
367 mrc p15, 0, r0, c1, c0, 0 @ read control reg 424 mrc p15, 0, r0, c1, c0, 0 @ read control reg
368 orr r0, r0, #0x5000 @ I-cache enable, RR cache replacement 425 orr r0, r0, #0x5000 @ I-cache enable, RR cache replacement
369 orr r0, r0, #0x0030 426 orr r0, r0, #0x0030
370 bl __common_cache_on 427 bl __common_mmu_cache_on
371 mov r0, #0 428 mov r0, #0
372 mcr p15, 0, r0, c8, c7, 0 @ flush I,D TLBs 429 mcr p15, 0, r0, c8, c7, 0 @ flush I,D TLBs
373 mov pc, r12 430 mov pc, r12
374 431
375__arm6_cache_on: 432__arm6_mmu_cache_on:
376 mov r12, lr 433 mov r12, lr
377 bl __setup_mmu 434 bl __setup_mmu
378 mov r0, #0 435 mov r0, #0
379 mcr p15, 0, r0, c7, c0, 0 @ invalidate whole cache v3 436 mcr p15, 0, r0, c7, c0, 0 @ invalidate whole cache v3
380 mcr p15, 0, r0, c5, c0, 0 @ invalidate whole TLB v3 437 mcr p15, 0, r0, c5, c0, 0 @ invalidate whole TLB v3
381 mov r0, #0x30 438 mov r0, #0x30
382 bl __common_cache_on 439 bl __common_mmu_cache_on
383 mov r0, #0 440 mov r0, #0
384 mcr p15, 0, r0, c5, c0, 0 @ invalidate whole TLB v3 441 mcr p15, 0, r0, c5, c0, 0 @ invalidate whole TLB v3
385 mov pc, r12 442 mov pc, r12
386 443
387__common_cache_on: 444__common_mmu_cache_on:
388#ifndef DEBUG 445#ifndef DEBUG
389 orr r0, r0, #0x000d @ Write buffer, mmu 446 orr r0, r0, #0x000d @ Write buffer, mmu
390#endif 447#endif
@@ -471,12 +528,12 @@ call_cache_fn: adr r12, proc_types
471proc_types: 528proc_types:
472 .word 0x41560600 @ ARM6/610 529 .word 0x41560600 @ ARM6/610
473 .word 0xffffffe0 530 .word 0xffffffe0
474 b __arm6_cache_off @ works, but slow 531 b __arm6_mmu_cache_off @ works, but slow
475 b __arm6_cache_off 532 b __arm6_mmu_cache_off
476 mov pc, lr 533 mov pc, lr
477@ b __arm6_cache_on @ untested 534@ b __arm6_mmu_cache_on @ untested
478@ b __arm6_cache_off 535@ b __arm6_mmu_cache_off
479@ b __armv3_cache_flush 536@ b __armv3_mmu_cache_flush
480 537
481 .word 0x00000000 @ old ARM ID 538 .word 0x00000000 @ old ARM ID
482 .word 0x0000f000 539 .word 0x0000f000
@@ -486,16 +543,28 @@ proc_types:
486 543
487 .word 0x41007000 @ ARM7/710 544 .word 0x41007000 @ ARM7/710
488 .word 0xfff8fe00 545 .word 0xfff8fe00
489 b __arm7_cache_off 546 b __arm7_mmu_cache_off
490 b __arm7_cache_off 547 b __arm7_mmu_cache_off
491 mov pc, lr 548 mov pc, lr
492 549
493 .word 0x41807200 @ ARM720T (writethrough) 550 .word 0x41807200 @ ARM720T (writethrough)
494 .word 0xffffff00 551 .word 0xffffff00
495 b __armv4_cache_on 552 b __armv4_mmu_cache_on
496 b __armv4_cache_off 553 b __armv4_mmu_cache_off
497 mov pc, lr 554 mov pc, lr
498 555
556 .word 0x41007400 @ ARM74x
557 .word 0xff00ff00
558 b __armv3_mpu_cache_on
559 b __armv3_mpu_cache_off
560 b __armv3_mpu_cache_flush
561
562 .word 0x41009400 @ ARM94x
563 .word 0xff00ff00
564 b __armv4_mpu_cache_on
565 b __armv4_mpu_cache_off
566 b __armv4_mpu_cache_flush
567
499 .word 0x00007000 @ ARM7 IDs 568 .word 0x00007000 @ ARM7 IDs
500 .word 0x0000f000 569 .word 0x0000f000
501 mov pc, lr 570 mov pc, lr
@@ -506,41 +575,41 @@ proc_types:
506 575
507 .word 0x4401a100 @ sa110 / sa1100 576 .word 0x4401a100 @ sa110 / sa1100
508 .word 0xffffffe0 577 .word 0xffffffe0
509 b __armv4_cache_on 578 b __armv4_mmu_cache_on
510 b __armv4_cache_off 579 b __armv4_mmu_cache_off
511 b __armv4_cache_flush 580 b __armv4_mmu_cache_flush
512 581
513 .word 0x6901b110 @ sa1110 582 .word 0x6901b110 @ sa1110
514 .word 0xfffffff0 583 .word 0xfffffff0
515 b __armv4_cache_on 584 b __armv4_mmu_cache_on
516 b __armv4_cache_off 585 b __armv4_mmu_cache_off
517 b __armv4_cache_flush 586 b __armv4_mmu_cache_flush
518 587
519 @ These match on the architecture ID 588 @ These match on the architecture ID
520 589
521 .word 0x00020000 @ ARMv4T 590 .word 0x00020000 @ ARMv4T
522 .word 0x000f0000 591 .word 0x000f0000
523 b __armv4_cache_on 592 b __armv4_mmu_cache_on
524 b __armv4_cache_off 593 b __armv4_mmu_cache_off
525 b __armv4_cache_flush 594 b __armv4_mmu_cache_flush
526 595
527 .word 0x00050000 @ ARMv5TE 596 .word 0x00050000 @ ARMv5TE
528 .word 0x000f0000 597 .word 0x000f0000
529 b __armv4_cache_on 598 b __armv4_mmu_cache_on
530 b __armv4_cache_off 599 b __armv4_mmu_cache_off
531 b __armv4_cache_flush 600 b __armv4_mmu_cache_flush
532 601
533 .word 0x00060000 @ ARMv5TEJ 602 .word 0x00060000 @ ARMv5TEJ
534 .word 0x000f0000 603 .word 0x000f0000
535 b __armv4_cache_on 604 b __armv4_mmu_cache_on
536 b __armv4_cache_off 605 b __armv4_mmu_cache_off
537 b __armv4_cache_flush 606 b __armv4_mmu_cache_flush
538 607
539 .word 0x00070000 @ ARMv6 608 .word 0x00070000 @ ARMv6
540 .word 0x000f0000 609 .word 0x000f0000
541 b __armv4_cache_on 610 b __armv4_mmu_cache_on
542 b __armv4_cache_off 611 b __armv4_mmu_cache_off
543 b __armv6_cache_flush 612 b __armv6_mmu_cache_flush
544 613
545 .word 0 @ unrecognised type 614 .word 0 @ unrecognised type
546 .word 0 615 .word 0
@@ -562,7 +631,25 @@ proc_types:
562cache_off: mov r3, #12 @ cache_off function 631cache_off: mov r3, #12 @ cache_off function
563 b call_cache_fn 632 b call_cache_fn
564 633
565__armv4_cache_off: 634__armv4_mpu_cache_off:
635 mrc p15, 0, r0, c1, c0
636 bic r0, r0, #0x000d
637 mcr p15, 0, r0, c1, c0 @ turn MPU and cache off
638 mov r0, #0
639 mcr p15, 0, r0, c7, c10, 4 @ drain write buffer
640 mcr p15, 0, r0, c7, c6, 0 @ flush D-Cache
641 mcr p15, 0, r0, c7, c5, 0 @ flush I-Cache
642 mov pc, lr
643
644__armv3_mpu_cache_off:
645 mrc p15, 0, r0, c1, c0
646 bic r0, r0, #0x000d
647 mcr p15, 0, r0, c1, c0, 0 @ turn MPU and cache off
648 mov r0, #0
649 mcr p15, 0, r0, c7, c0, 0 @ invalidate whole cache v3
650 mov pc, lr
651
652__armv4_mmu_cache_off:
566 mrc p15, 0, r0, c1, c0 653 mrc p15, 0, r0, c1, c0
567 bic r0, r0, #0x000d 654 bic r0, r0, #0x000d
568 mcr p15, 0, r0, c1, c0 @ turn MMU and cache off 655 mcr p15, 0, r0, c1, c0 @ turn MMU and cache off
@@ -571,15 +658,15 @@ __armv4_cache_off:
571 mcr p15, 0, r0, c8, c7 @ invalidate whole TLB v4 658 mcr p15, 0, r0, c8, c7 @ invalidate whole TLB v4
572 mov pc, lr 659 mov pc, lr
573 660
574__arm6_cache_off: 661__arm6_mmu_cache_off:
575 mov r0, #0x00000030 @ ARM6 control reg. 662 mov r0, #0x00000030 @ ARM6 control reg.
576 b __armv3_cache_off 663 b __armv3_mmu_cache_off
577 664
578__arm7_cache_off: 665__arm7_mmu_cache_off:
579 mov r0, #0x00000070 @ ARM7 control reg. 666 mov r0, #0x00000070 @ ARM7 control reg.
580 b __armv3_cache_off 667 b __armv3_mmu_cache_off
581 668
582__armv3_cache_off: 669__armv3_mmu_cache_off:
583 mcr p15, 0, r0, c1, c0, 0 @ turn MMU and cache off 670 mcr p15, 0, r0, c1, c0, 0 @ turn MMU and cache off
584 mov r0, #0 671 mov r0, #0
585 mcr p15, 0, r0, c7, c0, 0 @ invalidate whole cache v3 672 mcr p15, 0, r0, c7, c0, 0 @ invalidate whole cache v3
@@ -601,7 +688,25 @@ cache_clean_flush:
601 mov r3, #16 688 mov r3, #16
602 b call_cache_fn 689 b call_cache_fn
603 690
604__armv6_cache_flush: 691__armv4_mpu_cache_flush:
692 mov r2, #1
693 mov r3, #0
694 mcr p15, 0, ip, c7, c6, 0 @ invalidate D cache
695 mov r1, #7 << 5 @ 8 segments
6961: orr r3, r1, #63 << 26 @ 64 entries
6972: mcr p15, 0, r3, c7, c14, 2 @ clean & invalidate D index
698 subs r3, r3, #1 << 26
699 bcs 2b @ entries 63 to 0
700 subs r1, r1, #1 << 5
701 bcs 1b @ segments 7 to 0
702
703 teq r2, #0
704 mcrne p15, 0, ip, c7, c5, 0 @ invalidate I cache
705 mcr p15, 0, ip, c7, c10, 4 @ drain WB
706 mov pc, lr
707
708
709__armv6_mmu_cache_flush:
605 mov r1, #0 710 mov r1, #0
606 mcr p15, 0, r1, c7, c14, 0 @ clean+invalidate D 711 mcr p15, 0, r1, c7, c14, 0 @ clean+invalidate D
607 mcr p15, 0, r1, c7, c5, 0 @ invalidate I+BTB 712 mcr p15, 0, r1, c7, c5, 0 @ invalidate I+BTB
@@ -609,7 +714,7 @@ __armv6_cache_flush:
609 mcr p15, 0, r1, c7, c10, 4 @ drain WB 714 mcr p15, 0, r1, c7, c10, 4 @ drain WB
610 mov pc, lr 715 mov pc, lr
611 716
612__armv4_cache_flush: 717__armv4_mmu_cache_flush:
613 mov r2, #64*1024 @ default: 32K dcache size (*2) 718 mov r2, #64*1024 @ default: 32K dcache size (*2)
614 mov r11, #32 @ default: 32 byte line size 719 mov r11, #32 @ default: 32 byte line size
615 mrc p15, 0, r3, c0, c0, 1 @ read cache type 720 mrc p15, 0, r3, c0, c0, 1 @ read cache type
@@ -637,7 +742,8 @@ no_cache_id:
637 mcr p15, 0, r1, c7, c10, 4 @ drain WB 742 mcr p15, 0, r1, c7, c10, 4 @ drain WB
638 mov pc, lr 743 mov pc, lr
639 744
640__armv3_cache_flush: 745__armv3_mmu_cache_flush:
746__armv3_mpu_cache_flush:
641 mov r1, #0 747 mov r1, #0
642 mcr p15, 0, r0, c7, c0, 0 @ invalidate whole cache v3 748 mcr p15, 0, r0, c7, c0, 0 @ invalidate whole cache v3
643 mov pc, lr 749 mov pc, lr
diff --git a/arch/arm/boot/compressed/ice-dcc.S b/arch/arm/boot/compressed/ice-dcc.S
deleted file mode 100644
index 104377a199bb..000000000000
--- a/arch/arm/boot/compressed/ice-dcc.S
+++ /dev/null
@@ -1,17 +0,0 @@
1
2
3 .text
4
5 .global icedcc_putc
6
7icedcc_putc:
8 mov r2, #0x4000000
91:
10 subs r2, r2, #1
11 movlt pc, r14
12 mrc p14, 0, r1, c0, c0, 0
13 tst r1, #2
14 bne 1b
15
16 mcr p14, 0, r0, c1, c0, 0
17 mov pc, r14
diff --git a/arch/arm/boot/compressed/misc.c b/arch/arm/boot/compressed/misc.c
index 5ab94584baee..0af3772efcb7 100644
--- a/arch/arm/boot/compressed/misc.c
+++ b/arch/arm/boot/compressed/misc.c
@@ -20,24 +20,45 @@ unsigned int __machine_arch_type;
20 20
21#include <linux/string.h> 21#include <linux/string.h>
22 22
23#include <asm/arch/uncompress.h>
24
25#ifdef STANDALONE_DEBUG 23#ifdef STANDALONE_DEBUG
26#define putstr printf 24#define putstr printf
27#endif 25#else
26
27static void putstr(const char *ptr);
28
29#include <linux/compiler.h>
30#include <asm/arch/uncompress.h>
28 31
29#ifdef CONFIG_DEBUG_ICEDCC 32#ifdef CONFIG_DEBUG_ICEDCC
30#define putstr icedcc_putstr 33static void icedcc_putc(int ch)
31#define putc icedcc_putc 34{
35 int status, i = 0x4000000;
32 36
33extern void icedcc_putc(int ch); 37 do {
38 if (--i < 0)
39 return;
34 40
35static void 41 asm("mrc p14, 0, %0, c0, c0, 0" : "=r" (status));
36icedcc_putstr(const char *ptr) 42 } while (status & 2);
43
44 asm("mcr p15, 0, %0, c1, c0, 0" : : "r" (ch));
45}
46
47#define putc(ch) icedcc_putc(ch)
48#define flush() do { } while (0)
49#endif
50
51static void putstr(const char *ptr)
37{ 52{
38 for (; *ptr != '\0'; ptr++) { 53 char c;
39 icedcc_putc(*ptr); 54
55 while ((c = *ptr++) != '\0') {
56 if (c == '\n')
57 putc('\r');
58 putc(c);
40 } 59 }
60
61 flush();
41} 62}
42 63
43#endif 64#endif
diff --git a/arch/arm/common/Makefile b/arch/arm/common/Makefile
index c81a2ff6b5be..847e3e6356c6 100644
--- a/arch/arm/common/Makefile
+++ b/arch/arm/common/Makefile
@@ -15,3 +15,4 @@ obj-$(CONFIG_SHARP_LOCOMO) += locomo.o
15obj-$(CONFIG_SHARP_PARAM) += sharpsl_param.o 15obj-$(CONFIG_SHARP_PARAM) += sharpsl_param.o
16obj-$(CONFIG_SHARPSL_PM) += sharpsl_pm.o 16obj-$(CONFIG_SHARPSL_PM) += sharpsl_pm.o
17obj-$(CONFIG_SHARP_SCOOP) += scoop.o 17obj-$(CONFIG_SHARP_SCOOP) += scoop.o
18obj-$(CONFIG_ARCH_IXP2000) += uengine.o
diff --git a/arch/arm/common/dmabounce.c b/arch/arm/common/dmabounce.c
index ad6c89a555bb..7971d0dc6892 100644
--- a/arch/arm/common/dmabounce.c
+++ b/arch/arm/common/dmabounce.c
@@ -5,7 +5,7 @@
5 * limited DMA windows. These functions utilize bounce buffers to 5 * limited DMA windows. These functions utilize bounce buffers to
6 * copy data to/from buffers located outside the DMA region. This 6 * copy data to/from buffers located outside the DMA region. This
7 * only works for systems in which DMA memory is at the bottom of 7 * only works for systems in which DMA memory is at the bottom of
8 * RAM and the remainder of memory is at the top an the DMA memory 8 * RAM, the remainder of memory is at the top and the DMA memory
9 * can be marked as ZONE_DMA. Anything beyond that such as discontigous 9 * can be marked as ZONE_DMA. Anything beyond that such as discontigous
10 * DMA windows will require custom implementations that reserve memory 10 * DMA windows will require custom implementations that reserve memory
11 * areas at early bootup. 11 * areas at early bootup.
diff --git a/arch/arm/common/locomo.c b/arch/arm/common/locomo.c
index 159ad7ed7a40..a7dc1370695b 100644
--- a/arch/arm/common/locomo.c
+++ b/arch/arm/common/locomo.c
@@ -60,7 +60,7 @@ struct locomo {
60 unsigned long phys; 60 unsigned long phys;
61 unsigned int irq; 61 unsigned int irq;
62 spinlock_t lock; 62 spinlock_t lock;
63 void *base; 63 void __iomem *base;
64}; 64};
65 65
66struct locomo_dev_info { 66struct locomo_dev_info {
@@ -162,7 +162,7 @@ static void locomo_handler(unsigned int irq, struct irqdesc *desc,
162{ 162{
163 int req, i; 163 int req, i;
164 struct irqdesc *d; 164 struct irqdesc *d;
165 void *mapbase = get_irq_chipdata(irq); 165 void __iomem *mapbase = get_irq_chipdata(irq);
166 166
167 /* Acknowledge the parent IRQ */ 167 /* Acknowledge the parent IRQ */
168 desc->chip->ack(irq); 168 desc->chip->ack(irq);
@@ -189,7 +189,7 @@ static void locomo_ack_irq(unsigned int irq)
189 189
190static void locomo_mask_irq(unsigned int irq) 190static void locomo_mask_irq(unsigned int irq)
191{ 191{
192 void *mapbase = get_irq_chipdata(irq); 192 void __iomem *mapbase = get_irq_chipdata(irq);
193 unsigned int r; 193 unsigned int r;
194 r = locomo_readl(mapbase + LOCOMO_ICR); 194 r = locomo_readl(mapbase + LOCOMO_ICR);
195 r &= ~(0x0010 << (irq - LOCOMO_IRQ_START)); 195 r &= ~(0x0010 << (irq - LOCOMO_IRQ_START));
@@ -198,7 +198,7 @@ static void locomo_mask_irq(unsigned int irq)
198 198
199static void locomo_unmask_irq(unsigned int irq) 199static void locomo_unmask_irq(unsigned int irq)
200{ 200{
201 void *mapbase = get_irq_chipdata(irq); 201 void __iomem *mapbase = get_irq_chipdata(irq);
202 unsigned int r; 202 unsigned int r;
203 r = locomo_readl(mapbase + LOCOMO_ICR); 203 r = locomo_readl(mapbase + LOCOMO_ICR);
204 r |= (0x0010 << (irq - LOCOMO_IRQ_START)); 204 r |= (0x0010 << (irq - LOCOMO_IRQ_START));
@@ -215,7 +215,7 @@ static void locomo_key_handler(unsigned int irq, struct irqdesc *desc,
215 struct pt_regs *regs) 215 struct pt_regs *regs)
216{ 216{
217 struct irqdesc *d; 217 struct irqdesc *d;
218 void *mapbase = get_irq_chipdata(irq); 218 void __iomem *mapbase = get_irq_chipdata(irq);
219 219
220 if (locomo_readl(mapbase + LOCOMO_KEYBOARD + LOCOMO_KIC) & 0x0001) { 220 if (locomo_readl(mapbase + LOCOMO_KEYBOARD + LOCOMO_KIC) & 0x0001) {
221 d = irq_desc + LOCOMO_IRQ_KEY_START; 221 d = irq_desc + LOCOMO_IRQ_KEY_START;
@@ -225,7 +225,7 @@ static void locomo_key_handler(unsigned int irq, struct irqdesc *desc,
225 225
226static void locomo_key_ack_irq(unsigned int irq) 226static void locomo_key_ack_irq(unsigned int irq)
227{ 227{
228 void *mapbase = get_irq_chipdata(irq); 228 void __iomem *mapbase = get_irq_chipdata(irq);
229 unsigned int r; 229 unsigned int r;
230 r = locomo_readl(mapbase + LOCOMO_KEYBOARD + LOCOMO_KIC); 230 r = locomo_readl(mapbase + LOCOMO_KEYBOARD + LOCOMO_KIC);
231 r &= ~(0x0100 << (irq - LOCOMO_IRQ_KEY_START)); 231 r &= ~(0x0100 << (irq - LOCOMO_IRQ_KEY_START));
@@ -234,7 +234,7 @@ static void locomo_key_ack_irq(unsigned int irq)
234 234
235static void locomo_key_mask_irq(unsigned int irq) 235static void locomo_key_mask_irq(unsigned int irq)
236{ 236{
237 void *mapbase = get_irq_chipdata(irq); 237 void __iomem *mapbase = get_irq_chipdata(irq);
238 unsigned int r; 238 unsigned int r;
239 r = locomo_readl(mapbase + LOCOMO_KEYBOARD + LOCOMO_KIC); 239 r = locomo_readl(mapbase + LOCOMO_KEYBOARD + LOCOMO_KIC);
240 r &= ~(0x0010 << (irq - LOCOMO_IRQ_KEY_START)); 240 r &= ~(0x0010 << (irq - LOCOMO_IRQ_KEY_START));
@@ -243,7 +243,7 @@ static void locomo_key_mask_irq(unsigned int irq)
243 243
244static void locomo_key_unmask_irq(unsigned int irq) 244static void locomo_key_unmask_irq(unsigned int irq)
245{ 245{
246 void *mapbase = get_irq_chipdata(irq); 246 void __iomem *mapbase = get_irq_chipdata(irq);
247 unsigned int r; 247 unsigned int r;
248 r = locomo_readl(mapbase + LOCOMO_KEYBOARD + LOCOMO_KIC); 248 r = locomo_readl(mapbase + LOCOMO_KEYBOARD + LOCOMO_KIC);
249 r |= (0x0010 << (irq - LOCOMO_IRQ_KEY_START)); 249 r |= (0x0010 << (irq - LOCOMO_IRQ_KEY_START));
@@ -261,7 +261,7 @@ static void locomo_gpio_handler(unsigned int irq, struct irqdesc *desc,
261{ 261{
262 int req, i; 262 int req, i;
263 struct irqdesc *d; 263 struct irqdesc *d;
264 void *mapbase = get_irq_chipdata(irq); 264 void __iomem *mapbase = get_irq_chipdata(irq);
265 265
266 req = locomo_readl(mapbase + LOCOMO_GIR) & 266 req = locomo_readl(mapbase + LOCOMO_GIR) &
267 locomo_readl(mapbase + LOCOMO_GPD) & 267 locomo_readl(mapbase + LOCOMO_GPD) &
@@ -280,7 +280,7 @@ static void locomo_gpio_handler(unsigned int irq, struct irqdesc *desc,
280 280
281static void locomo_gpio_ack_irq(unsigned int irq) 281static void locomo_gpio_ack_irq(unsigned int irq)
282{ 282{
283 void *mapbase = get_irq_chipdata(irq); 283 void __iomem *mapbase = get_irq_chipdata(irq);
284 unsigned int r; 284 unsigned int r;
285 r = locomo_readl(mapbase + LOCOMO_GWE); 285 r = locomo_readl(mapbase + LOCOMO_GWE);
286 r |= (0x0001 << (irq - LOCOMO_IRQ_GPIO_START)); 286 r |= (0x0001 << (irq - LOCOMO_IRQ_GPIO_START));
@@ -297,7 +297,7 @@ static void locomo_gpio_ack_irq(unsigned int irq)
297 297
298static void locomo_gpio_mask_irq(unsigned int irq) 298static void locomo_gpio_mask_irq(unsigned int irq)
299{ 299{
300 void *mapbase = get_irq_chipdata(irq); 300 void __iomem *mapbase = get_irq_chipdata(irq);
301 unsigned int r; 301 unsigned int r;
302 r = locomo_readl(mapbase + LOCOMO_GIE); 302 r = locomo_readl(mapbase + LOCOMO_GIE);
303 r &= ~(0x0001 << (irq - LOCOMO_IRQ_GPIO_START)); 303 r &= ~(0x0001 << (irq - LOCOMO_IRQ_GPIO_START));
@@ -306,7 +306,7 @@ static void locomo_gpio_mask_irq(unsigned int irq)
306 306
307static void locomo_gpio_unmask_irq(unsigned int irq) 307static void locomo_gpio_unmask_irq(unsigned int irq)
308{ 308{
309 void *mapbase = get_irq_chipdata(irq); 309 void __iomem *mapbase = get_irq_chipdata(irq);
310 unsigned int r; 310 unsigned int r;
311 r = locomo_readl(mapbase + LOCOMO_GIE); 311 r = locomo_readl(mapbase + LOCOMO_GIE);
312 r |= (0x0001 << (irq - LOCOMO_IRQ_GPIO_START)); 312 r |= (0x0001 << (irq - LOCOMO_IRQ_GPIO_START));
@@ -323,7 +323,7 @@ static void locomo_lt_handler(unsigned int irq, struct irqdesc *desc,
323 struct pt_regs *regs) 323 struct pt_regs *regs)
324{ 324{
325 struct irqdesc *d; 325 struct irqdesc *d;
326 void *mapbase = get_irq_chipdata(irq); 326 void __iomem *mapbase = get_irq_chipdata(irq);
327 327
328 if (locomo_readl(mapbase + LOCOMO_LTINT) & 0x0001) { 328 if (locomo_readl(mapbase + LOCOMO_LTINT) & 0x0001) {
329 d = irq_desc + LOCOMO_IRQ_LT_START; 329 d = irq_desc + LOCOMO_IRQ_LT_START;
@@ -333,7 +333,7 @@ static void locomo_lt_handler(unsigned int irq, struct irqdesc *desc,
333 333
334static void locomo_lt_ack_irq(unsigned int irq) 334static void locomo_lt_ack_irq(unsigned int irq)
335{ 335{
336 void *mapbase = get_irq_chipdata(irq); 336 void __iomem *mapbase = get_irq_chipdata(irq);
337 unsigned int r; 337 unsigned int r;
338 r = locomo_readl(mapbase + LOCOMO_LTINT); 338 r = locomo_readl(mapbase + LOCOMO_LTINT);
339 r &= ~(0x0100 << (irq - LOCOMO_IRQ_LT_START)); 339 r &= ~(0x0100 << (irq - LOCOMO_IRQ_LT_START));
@@ -342,7 +342,7 @@ static void locomo_lt_ack_irq(unsigned int irq)
342 342
343static void locomo_lt_mask_irq(unsigned int irq) 343static void locomo_lt_mask_irq(unsigned int irq)
344{ 344{
345 void *mapbase = get_irq_chipdata(irq); 345 void __iomem *mapbase = get_irq_chipdata(irq);
346 unsigned int r; 346 unsigned int r;
347 r = locomo_readl(mapbase + LOCOMO_LTINT); 347 r = locomo_readl(mapbase + LOCOMO_LTINT);
348 r &= ~(0x0010 << (irq - LOCOMO_IRQ_LT_START)); 348 r &= ~(0x0010 << (irq - LOCOMO_IRQ_LT_START));
@@ -351,7 +351,7 @@ static void locomo_lt_mask_irq(unsigned int irq)
351 351
352static void locomo_lt_unmask_irq(unsigned int irq) 352static void locomo_lt_unmask_irq(unsigned int irq)
353{ 353{
354 void *mapbase = get_irq_chipdata(irq); 354 void __iomem *mapbase = get_irq_chipdata(irq);
355 unsigned int r; 355 unsigned int r;
356 r = locomo_readl(mapbase + LOCOMO_LTINT); 356 r = locomo_readl(mapbase + LOCOMO_LTINT);
357 r |= (0x0010 << (irq - LOCOMO_IRQ_LT_START)); 357 r |= (0x0010 << (irq - LOCOMO_IRQ_LT_START));
@@ -369,7 +369,7 @@ static void locomo_spi_handler(unsigned int irq, struct irqdesc *desc,
369{ 369{
370 int req, i; 370 int req, i;
371 struct irqdesc *d; 371 struct irqdesc *d;
372 void *mapbase = get_irq_chipdata(irq); 372 void __iomem *mapbase = get_irq_chipdata(irq);
373 373
374 req = locomo_readl(mapbase + LOCOMO_SPIIR) & 0x000F; 374 req = locomo_readl(mapbase + LOCOMO_SPIIR) & 0x000F;
375 if (req) { 375 if (req) {
@@ -386,7 +386,7 @@ static void locomo_spi_handler(unsigned int irq, struct irqdesc *desc,
386 386
387static void locomo_spi_ack_irq(unsigned int irq) 387static void locomo_spi_ack_irq(unsigned int irq)
388{ 388{
389 void *mapbase = get_irq_chipdata(irq); 389 void __iomem *mapbase = get_irq_chipdata(irq);
390 unsigned int r; 390 unsigned int r;
391 r = locomo_readl(mapbase + LOCOMO_SPIWE); 391 r = locomo_readl(mapbase + LOCOMO_SPIWE);
392 r |= (0x0001 << (irq - LOCOMO_IRQ_SPI_START)); 392 r |= (0x0001 << (irq - LOCOMO_IRQ_SPI_START));
@@ -403,7 +403,7 @@ static void locomo_spi_ack_irq(unsigned int irq)
403 403
404static void locomo_spi_mask_irq(unsigned int irq) 404static void locomo_spi_mask_irq(unsigned int irq)
405{ 405{
406 void *mapbase = get_irq_chipdata(irq); 406 void __iomem *mapbase = get_irq_chipdata(irq);
407 unsigned int r; 407 unsigned int r;
408 r = locomo_readl(mapbase + LOCOMO_SPIIE); 408 r = locomo_readl(mapbase + LOCOMO_SPIIE);
409 r &= ~(0x0001 << (irq - LOCOMO_IRQ_SPI_START)); 409 r &= ~(0x0001 << (irq - LOCOMO_IRQ_SPI_START));
@@ -412,7 +412,7 @@ static void locomo_spi_mask_irq(unsigned int irq)
412 412
413static void locomo_spi_unmask_irq(unsigned int irq) 413static void locomo_spi_unmask_irq(unsigned int irq)
414{ 414{
415 void *mapbase = get_irq_chipdata(irq); 415 void __iomem *mapbase = get_irq_chipdata(irq);
416 unsigned int r; 416 unsigned int r;
417 r = locomo_readl(mapbase + LOCOMO_SPIIE); 417 r = locomo_readl(mapbase + LOCOMO_SPIIE);
418 r |= (0x0001 << (irq - LOCOMO_IRQ_SPI_START)); 418 r |= (0x0001 << (irq - LOCOMO_IRQ_SPI_START));
@@ -428,7 +428,7 @@ static struct irqchip locomo_spi_chip = {
428static void locomo_setup_irq(struct locomo *lchip) 428static void locomo_setup_irq(struct locomo *lchip)
429{ 429{
430 int irq; 430 int irq;
431 void *irqbase = lchip->base; 431 void __iomem *irqbase = lchip->base;
432 432
433 /* 433 /*
434 * Install handler for IRQ_LOCOMO_HW. 434 * Install handler for IRQ_LOCOMO_HW.
@@ -501,12 +501,11 @@ locomo_init_one_child(struct locomo *lchip, struct locomo_dev_info *info)
501 struct locomo_dev *dev; 501 struct locomo_dev *dev;
502 int ret; 502 int ret;
503 503
504 dev = kmalloc(sizeof(struct locomo_dev), GFP_KERNEL); 504 dev = kzalloc(sizeof(struct locomo_dev), GFP_KERNEL);
505 if (!dev) { 505 if (!dev) {
506 ret = -ENOMEM; 506 ret = -ENOMEM;
507 goto out; 507 goto out;
508 } 508 }
509 memset(dev, 0, sizeof(struct locomo_dev));
510 509
511 strncpy(dev->dev.bus_id,info->name,sizeof(dev->dev.bus_id)); 510 strncpy(dev->dev.bus_id,info->name,sizeof(dev->dev.bus_id));
512 /* 511 /*
@@ -629,6 +628,22 @@ static int locomo_resume(struct platform_device *dev)
629} 628}
630#endif 629#endif
631 630
631
632#define LCM_ALC_EN 0x8000
633
634void frontlight_set(struct locomo *lchip, int duty, int vr, int bpwf)
635{
636 unsigned long flags;
637
638 spin_lock_irqsave(&lchip->lock, flags);
639 locomo_writel(bpwf, lchip->base + LOCOMO_FRONTLIGHT + LOCOMO_ALS);
640 udelay(100);
641 locomo_writel(duty, lchip->base + LOCOMO_FRONTLIGHT + LOCOMO_ALD);
642 locomo_writel(bpwf | LCM_ALC_EN, lchip->base + LOCOMO_FRONTLIGHT + LOCOMO_ALS);
643 spin_unlock_irqrestore(&lchip->lock, flags);
644}
645
646
632/** 647/**
633 * locomo_probe - probe for a single LoCoMo chip. 648 * locomo_probe - probe for a single LoCoMo chip.
634 * @phys_addr: physical address of device. 649 * @phys_addr: physical address of device.
@@ -648,12 +663,10 @@ __locomo_probe(struct device *me, struct resource *mem, int irq)
648 unsigned long r; 663 unsigned long r;
649 int i, ret = -ENODEV; 664 int i, ret = -ENODEV;
650 665
651 lchip = kmalloc(sizeof(struct locomo), GFP_KERNEL); 666 lchip = kzalloc(sizeof(struct locomo), GFP_KERNEL);
652 if (!lchip) 667 if (!lchip)
653 return -ENOMEM; 668 return -ENOMEM;
654 669
655 memset(lchip, 0, sizeof(struct locomo));
656
657 spin_lock_init(&lchip->lock); 670 spin_lock_init(&lchip->lock);
658 671
659 lchip->dev = me; 672 lchip->dev = me;
@@ -688,6 +701,11 @@ __locomo_probe(struct device *me, struct resource *mem, int irq)
688 /* FrontLight */ 701 /* FrontLight */
689 locomo_writel(0, lchip->base + LOCOMO_FRONTLIGHT + LOCOMO_ALS); 702 locomo_writel(0, lchip->base + LOCOMO_FRONTLIGHT + LOCOMO_ALS);
690 locomo_writel(0, lchip->base + LOCOMO_FRONTLIGHT + LOCOMO_ALD); 703 locomo_writel(0, lchip->base + LOCOMO_FRONTLIGHT + LOCOMO_ALD);
704
705 /* Same constants can be used for collie and poodle
706 (depending on CONFIG options in original sharp code)? */
707 frontlight_set(lchip, 163, 0, 148);
708
691 /* Longtime timer */ 709 /* Longtime timer */
692 locomo_writel(0, lchip->base + LOCOMO_LTINT); 710 locomo_writel(0, lchip->base + LOCOMO_LTINT);
693 /* SPI */ 711 /* SPI */
@@ -767,6 +785,8 @@ static int locomo_probe(struct platform_device *dev)
767 if (!mem) 785 if (!mem)
768 return -EINVAL; 786 return -EINVAL;
769 irq = platform_get_irq(dev, 0); 787 irq = platform_get_irq(dev, 0);
788 if (irq < 0)
789 return -ENXIO;
770 790
771 return __locomo_probe(&dev->dev, mem, irq); 791 return __locomo_probe(&dev->dev, mem, irq);
772} 792}
diff --git a/arch/arm/common/rtctime.c b/arch/arm/common/rtctime.c
index e851d86c212c..35c9a64ac14c 100644
--- a/arch/arm/common/rtctime.c
+++ b/arch/arm/common/rtctime.c
@@ -20,6 +20,7 @@
20#include <linux/capability.h> 20#include <linux/capability.h>
21#include <linux/device.h> 21#include <linux/device.h>
22#include <linux/mutex.h> 22#include <linux/mutex.h>
23#include <linux/rtc.h>
23 24
24#include <asm/rtc.h> 25#include <asm/rtc.h>
25#include <asm/semaphore.h> 26#include <asm/semaphore.h>
@@ -42,89 +43,6 @@ static struct rtc_ops *rtc_ops;
42 43
43#define rtc_epoch 1900UL 44#define rtc_epoch 1900UL
44 45
45static const unsigned char days_in_month[] = {
46 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31
47};
48
49#define LEAPS_THRU_END_OF(y) ((y)/4 - (y)/100 + (y)/400)
50#define LEAP_YEAR(year) ((!(year % 4) && (year % 100)) || !(year % 400))
51
52static int month_days(unsigned int month, unsigned int year)
53{
54 return days_in_month[month] + (LEAP_YEAR(year) && month == 1);
55}
56
57/*
58 * Convert seconds since 01-01-1970 00:00:00 to Gregorian date.
59 */
60void rtc_time_to_tm(unsigned long time, struct rtc_time *tm)
61{
62 int days, month, year;
63
64 days = time / 86400;
65 time -= days * 86400;
66
67 tm->tm_wday = (days + 4) % 7;
68
69 year = 1970 + days / 365;
70 days -= (year - 1970) * 365
71 + LEAPS_THRU_END_OF(year - 1)
72 - LEAPS_THRU_END_OF(1970 - 1);
73 if (days < 0) {
74 year -= 1;
75 days += 365 + LEAP_YEAR(year);
76 }
77 tm->tm_year = year - 1900;
78 tm->tm_yday = days + 1;
79
80 for (month = 0; month < 11; month++) {
81 int newdays;
82
83 newdays = days - month_days(month, year);
84 if (newdays < 0)
85 break;
86 days = newdays;
87 }
88 tm->tm_mon = month;
89 tm->tm_mday = days + 1;
90
91 tm->tm_hour = time / 3600;
92 time -= tm->tm_hour * 3600;
93 tm->tm_min = time / 60;
94 tm->tm_sec = time - tm->tm_min * 60;
95}
96EXPORT_SYMBOL(rtc_time_to_tm);
97
98/*
99 * Does the rtc_time represent a valid date/time?
100 */
101int rtc_valid_tm(struct rtc_time *tm)
102{
103 if (tm->tm_year < 70 ||
104 tm->tm_mon >= 12 ||
105 tm->tm_mday < 1 ||
106 tm->tm_mday > month_days(tm->tm_mon, tm->tm_year + 1900) ||
107 tm->tm_hour >= 24 ||
108 tm->tm_min >= 60 ||
109 tm->tm_sec >= 60)
110 return -EINVAL;
111
112 return 0;
113}
114EXPORT_SYMBOL(rtc_valid_tm);
115
116/*
117 * Convert Gregorian date to seconds since 01-01-1970 00:00:00.
118 */
119int rtc_tm_to_time(struct rtc_time *tm, unsigned long *time)
120{
121 *time = mktime(tm->tm_year + 1900, tm->tm_mon + 1, tm->tm_mday,
122 tm->tm_hour, tm->tm_min, tm->tm_sec);
123
124 return 0;
125}
126EXPORT_SYMBOL(rtc_tm_to_time);
127
128/* 46/*
129 * Calculate the next alarm time given the requested alarm time mask 47 * Calculate the next alarm time given the requested alarm time mask
130 * and the current time. 48 * and the current time.
@@ -151,13 +69,13 @@ void rtc_next_alarm_time(struct rtc_time *next, struct rtc_time *now, struct rtc
151 } 69 }
152} 70}
153 71
154static inline int rtc_read_time(struct rtc_ops *ops, struct rtc_time *tm) 72static inline int rtc_arm_read_time(struct rtc_ops *ops, struct rtc_time *tm)
155{ 73{
156 memset(tm, 0, sizeof(struct rtc_time)); 74 memset(tm, 0, sizeof(struct rtc_time));
157 return ops->read_time(tm); 75 return ops->read_time(tm);
158} 76}
159 77
160static inline int rtc_set_time(struct rtc_ops *ops, struct rtc_time *tm) 78static inline int rtc_arm_set_time(struct rtc_ops *ops, struct rtc_time *tm)
161{ 79{
162 int ret; 80 int ret;
163 81
@@ -168,7 +86,7 @@ static inline int rtc_set_time(struct rtc_ops *ops, struct rtc_time *tm)
168 return ret; 86 return ret;
169} 87}
170 88
171static inline int rtc_read_alarm(struct rtc_ops *ops, struct rtc_wkalrm *alrm) 89static inline int rtc_arm_read_alarm(struct rtc_ops *ops, struct rtc_wkalrm *alrm)
172{ 90{
173 int ret = -EINVAL; 91 int ret = -EINVAL;
174 if (ops->read_alarm) { 92 if (ops->read_alarm) {
@@ -178,7 +96,7 @@ static inline int rtc_read_alarm(struct rtc_ops *ops, struct rtc_wkalrm *alrm)
178 return ret; 96 return ret;
179} 97}
180 98
181static inline int rtc_set_alarm(struct rtc_ops *ops, struct rtc_wkalrm *alrm) 99static inline int rtc_arm_set_alarm(struct rtc_ops *ops, struct rtc_wkalrm *alrm)
182{ 100{
183 int ret = -EINVAL; 101 int ret = -EINVAL;
184 if (ops->set_alarm) 102 if (ops->set_alarm)
@@ -266,7 +184,7 @@ static int rtc_ioctl(struct inode *inode, struct file *file, unsigned int cmd,
266 184
267 switch (cmd) { 185 switch (cmd) {
268 case RTC_ALM_READ: 186 case RTC_ALM_READ:
269 ret = rtc_read_alarm(ops, &alrm); 187 ret = rtc_arm_read_alarm(ops, &alrm);
270 if (ret) 188 if (ret)
271 break; 189 break;
272 ret = copy_to_user(uarg, &alrm.time, sizeof(tm)); 190 ret = copy_to_user(uarg, &alrm.time, sizeof(tm));
@@ -288,11 +206,11 @@ static int rtc_ioctl(struct inode *inode, struct file *file, unsigned int cmd,
288 alrm.time.tm_wday = -1; 206 alrm.time.tm_wday = -1;
289 alrm.time.tm_yday = -1; 207 alrm.time.tm_yday = -1;
290 alrm.time.tm_isdst = -1; 208 alrm.time.tm_isdst = -1;
291 ret = rtc_set_alarm(ops, &alrm); 209 ret = rtc_arm_set_alarm(ops, &alrm);
292 break; 210 break;
293 211
294 case RTC_RD_TIME: 212 case RTC_RD_TIME:
295 ret = rtc_read_time(ops, &tm); 213 ret = rtc_arm_read_time(ops, &tm);
296 if (ret) 214 if (ret)
297 break; 215 break;
298 ret = copy_to_user(uarg, &tm, sizeof(tm)); 216 ret = copy_to_user(uarg, &tm, sizeof(tm));
@@ -310,7 +228,7 @@ static int rtc_ioctl(struct inode *inode, struct file *file, unsigned int cmd,
310 ret = -EFAULT; 228 ret = -EFAULT;
311 break; 229 break;
312 } 230 }
313 ret = rtc_set_time(ops, &tm); 231 ret = rtc_arm_set_time(ops, &tm);
314 break; 232 break;
315 233
316 case RTC_EPOCH_SET: 234 case RTC_EPOCH_SET:
@@ -341,11 +259,11 @@ static int rtc_ioctl(struct inode *inode, struct file *file, unsigned int cmd,
341 ret = -EFAULT; 259 ret = -EFAULT;
342 break; 260 break;
343 } 261 }
344 ret = rtc_set_alarm(ops, &alrm); 262 ret = rtc_arm_set_alarm(ops, &alrm);
345 break; 263 break;
346 264
347 case RTC_WKALM_RD: 265 case RTC_WKALM_RD:
348 ret = rtc_read_alarm(ops, &alrm); 266 ret = rtc_arm_read_alarm(ops, &alrm);
349 if (ret) 267 if (ret)
350 break; 268 break;
351 ret = copy_to_user(uarg, &alrm, sizeof(alrm)); 269 ret = copy_to_user(uarg, &alrm, sizeof(alrm));
@@ -435,7 +353,7 @@ static int rtc_read_proc(char *page, char **start, off_t off, int count, int *eo
435 struct rtc_time tm; 353 struct rtc_time tm;
436 char *p = page; 354 char *p = page;
437 355
438 if (rtc_read_time(ops, &tm) == 0) { 356 if (rtc_arm_read_time(ops, &tm) == 0) {
439 p += sprintf(p, 357 p += sprintf(p,
440 "rtc_time\t: %02d:%02d:%02d\n" 358 "rtc_time\t: %02d:%02d:%02d\n"
441 "rtc_date\t: %04d-%02d-%02d\n" 359 "rtc_date\t: %04d-%02d-%02d\n"
@@ -445,7 +363,7 @@ static int rtc_read_proc(char *page, char **start, off_t off, int count, int *eo
445 rtc_epoch); 363 rtc_epoch);
446 } 364 }
447 365
448 if (rtc_read_alarm(ops, &alrm) == 0) { 366 if (rtc_arm_read_alarm(ops, &alrm) == 0) {
449 p += sprintf(p, "alrm_time\t: "); 367 p += sprintf(p, "alrm_time\t: ");
450 if ((unsigned int)alrm.time.tm_hour <= 24) 368 if ((unsigned int)alrm.time.tm_hour <= 24)
451 p += sprintf(p, "%02d:", alrm.time.tm_hour); 369 p += sprintf(p, "%02d:", alrm.time.tm_hour);
diff --git a/arch/arm/common/sa1111.c b/arch/arm/common/sa1111.c
index 1475089f9b42..3f68db84e5e6 100644
--- a/arch/arm/common/sa1111.c
+++ b/arch/arm/common/sa1111.c
@@ -26,6 +26,7 @@
26#include <linux/slab.h> 26#include <linux/slab.h>
27#include <linux/spinlock.h> 27#include <linux/spinlock.h>
28#include <linux/dma-mapping.h> 28#include <linux/dma-mapping.h>
29#include <linux/clk.h>
29 30
30#include <asm/hardware.h> 31#include <asm/hardware.h>
31#include <asm/mach-types.h> 32#include <asm/mach-types.h>
@@ -36,10 +37,6 @@
36 37
37#include <asm/hardware/sa1111.h> 38#include <asm/hardware/sa1111.h>
38 39
39#ifdef CONFIG_ARCH_PXA
40#include <asm/arch/pxa-regs.h>
41#endif
42
43extern void __init sa1110_mb_enable(void); 40extern void __init sa1110_mb_enable(void);
44 41
45/* 42/*
@@ -51,6 +48,7 @@ extern void __init sa1110_mb_enable(void);
51 */ 48 */
52struct sa1111 { 49struct sa1111 {
53 struct device *dev; 50 struct device *dev;
51 struct clk *clk;
54 unsigned long phys; 52 unsigned long phys;
55 int irq; 53 int irq;
56 spinlock_t lock; 54 spinlock_t lock;
@@ -451,19 +449,7 @@ static void sa1111_wake(struct sa1111 *sachip)
451 449
452 spin_lock_irqsave(&sachip->lock, flags); 450 spin_lock_irqsave(&sachip->lock, flags);
453 451
454#ifdef CONFIG_ARCH_SA1100 452 clk_enable(sachip->clk);
455 /*
456 * First, set up the 3.6864MHz clock on GPIO 27 for the SA-1111:
457 * (SA-1110 Developer's Manual, section 9.1.2.1)
458 */
459 GAFR |= GPIO_32_768kHz;
460 GPDR |= GPIO_32_768kHz;
461 TUCR = TUCR_3_6864MHz;
462#elif CONFIG_ARCH_PXA
463 pxa_gpio_mode(GPIO11_3_6MHz_MD);
464#else
465#error missing clock setup
466#endif
467 453
468 /* 454 /*
469 * Turn VCO on, and disable PLL Bypass. 455 * Turn VCO on, and disable PLL Bypass.
@@ -555,12 +541,11 @@ sa1111_init_one_child(struct sa1111 *sachip, struct resource *parent,
555 struct sa1111_dev *dev; 541 struct sa1111_dev *dev;
556 int ret; 542 int ret;
557 543
558 dev = kmalloc(sizeof(struct sa1111_dev), GFP_KERNEL); 544 dev = kzalloc(sizeof(struct sa1111_dev), GFP_KERNEL);
559 if (!dev) { 545 if (!dev) {
560 ret = -ENOMEM; 546 ret = -ENOMEM;
561 goto out; 547 goto out;
562 } 548 }
563 memset(dev, 0, sizeof(struct sa1111_dev));
564 549
565 snprintf(dev->dev.bus_id, sizeof(dev->dev.bus_id), 550 snprintf(dev->dev.bus_id, sizeof(dev->dev.bus_id),
566 "%4.4lx", info->offset); 551 "%4.4lx", info->offset);
@@ -635,11 +620,15 @@ __sa1111_probe(struct device *me, struct resource *mem, int irq)
635 unsigned int has_devs, val; 620 unsigned int has_devs, val;
636 int i, ret = -ENODEV; 621 int i, ret = -ENODEV;
637 622
638 sachip = kmalloc(sizeof(struct sa1111), GFP_KERNEL); 623 sachip = kzalloc(sizeof(struct sa1111), GFP_KERNEL);
639 if (!sachip) 624 if (!sachip)
640 return -ENOMEM; 625 return -ENOMEM;
641 626
642 memset(sachip, 0, sizeof(struct sa1111)); 627 sachip->clk = clk_get(me, "GPIO27_CLK");
628 if (!sachip->clk) {
629 ret = PTR_ERR(sachip->clk);
630 goto err_free;
631 }
643 632
644 spin_lock_init(&sachip->lock); 633 spin_lock_init(&sachip->lock);
645 634
@@ -656,7 +645,7 @@ __sa1111_probe(struct device *me, struct resource *mem, int irq)
656 sachip->base = ioremap(mem->start, PAGE_SIZE * 2); 645 sachip->base = ioremap(mem->start, PAGE_SIZE * 2);
657 if (!sachip->base) { 646 if (!sachip->base) {
658 ret = -ENOMEM; 647 ret = -ENOMEM;
659 goto out; 648 goto err_clkput;
660 } 649 }
661 650
662 /* 651 /*
@@ -666,7 +655,7 @@ __sa1111_probe(struct device *me, struct resource *mem, int irq)
666 if ((id & SKID_ID_MASK) != SKID_SA1111_ID) { 655 if ((id & SKID_ID_MASK) != SKID_SA1111_ID) {
667 printk(KERN_DEBUG "SA1111 not detected: ID = %08lx\n", id); 656 printk(KERN_DEBUG "SA1111 not detected: ID = %08lx\n", id);
668 ret = -ENODEV; 657 ret = -ENODEV;
669 goto unmap; 658 goto err_unmap;
670 } 659 }
671 660
672 printk(KERN_INFO "SA1111 Microprocessor Companion Chip: " 661 printk(KERN_INFO "SA1111 Microprocessor Companion Chip: "
@@ -726,9 +715,11 @@ __sa1111_probe(struct device *me, struct resource *mem, int irq)
726 715
727 return 0; 716 return 0;
728 717
729 unmap: 718 err_unmap:
730 iounmap(sachip->base); 719 iounmap(sachip->base);
731 out: 720 err_clkput:
721 clk_put(sachip->clk);
722 err_free:
732 kfree(sachip); 723 kfree(sachip);
733 return ret; 724 return ret;
734} 725}
@@ -751,6 +742,8 @@ static void __sa1111_remove(struct sa1111 *sachip)
751 sa1111_writel(0, irqbase + SA1111_WAKEEN0); 742 sa1111_writel(0, irqbase + SA1111_WAKEEN0);
752 sa1111_writel(0, irqbase + SA1111_WAKEEN1); 743 sa1111_writel(0, irqbase + SA1111_WAKEEN1);
753 744
745 clk_disable(sachip->clk);
746
754 if (sachip->irq != NO_IRQ) { 747 if (sachip->irq != NO_IRQ) {
755 set_irq_chained_handler(sachip->irq, NULL); 748 set_irq_chained_handler(sachip->irq, NULL);
756 set_irq_data(sachip->irq, NULL); 749 set_irq_data(sachip->irq, NULL);
@@ -759,6 +752,7 @@ static void __sa1111_remove(struct sa1111 *sachip)
759 } 752 }
760 753
761 iounmap(sachip->base); 754 iounmap(sachip->base);
755 clk_put(sachip->clk);
762 kfree(sachip); 756 kfree(sachip);
763} 757}
764 758
@@ -857,6 +851,8 @@ static int sa1111_suspend(struct platform_device *dev, pm_message_t state)
857 sa1111_writel(0, sachip->base + SA1111_SKPWM0); 851 sa1111_writel(0, sachip->base + SA1111_SKPWM0);
858 sa1111_writel(0, sachip->base + SA1111_SKPWM1); 852 sa1111_writel(0, sachip->base + SA1111_SKPWM1);
859 853
854 clk_disable(sachip->clk);
855
860 spin_unlock_irqrestore(&sachip->lock, flags); 856 spin_unlock_irqrestore(&sachip->lock, flags);
861 857
862 return 0; 858 return 0;
@@ -943,6 +939,8 @@ static int sa1111_probe(struct platform_device *pdev)
943 if (!mem) 939 if (!mem)
944 return -EINVAL; 940 return -EINVAL;
945 irq = platform_get_irq(pdev, 0); 941 irq = platform_get_irq(pdev, 0);
942 if (irq < 0)
943 return -ENXIO;
946 944
947 return __sa1111_probe(&pdev->dev, mem, irq); 945 return __sa1111_probe(&pdev->dev, mem, irq);
948} 946}
diff --git a/arch/arm/common/scoop.c b/arch/arm/common/scoop.c
index a2dfe0b0f1ec..5e830f444c6c 100644
--- a/arch/arm/common/scoop.c
+++ b/arch/arm/common/scoop.c
@@ -132,12 +132,10 @@ int __init scoop_probe(struct platform_device *pdev)
132 if (!mem) 132 if (!mem)
133 return -EINVAL; 133 return -EINVAL;
134 134
135 devptr = kmalloc(sizeof(struct scoop_dev), GFP_KERNEL); 135 devptr = kzalloc(sizeof(struct scoop_dev), GFP_KERNEL);
136
137 if (!devptr) 136 if (!devptr)
138 return -ENOMEM; 137 return -ENOMEM;
139 138
140 memset(devptr, 0, sizeof(struct scoop_dev));
141 spin_lock_init(&devptr->scoop_lock); 139 spin_lock_init(&devptr->scoop_lock);
142 140
143 inf = pdev->dev.platform_data; 141 inf = pdev->dev.platform_data;
diff --git a/arch/arm/common/sharpsl_pm.c b/arch/arm/common/sharpsl_pm.c
index 978d32e82d39..3cd8c9ee4510 100644
--- a/arch/arm/common/sharpsl_pm.c
+++ b/arch/arm/common/sharpsl_pm.c
@@ -22,6 +22,7 @@
22#include <linux/delay.h> 22#include <linux/delay.h>
23#include <linux/interrupt.h> 23#include <linux/interrupt.h>
24#include <linux/platform_device.h> 24#include <linux/platform_device.h>
25#include <linux/leds.h>
25 26
26#include <asm/hardware.h> 27#include <asm/hardware.h>
27#include <asm/mach-types.h> 28#include <asm/mach-types.h>
@@ -75,6 +76,7 @@ static void sharpsl_battery_thread(void *private_);
75struct sharpsl_pm_status sharpsl_pm; 76struct sharpsl_pm_status sharpsl_pm;
76DECLARE_WORK(toggle_charger, sharpsl_charge_toggle, NULL); 77DECLARE_WORK(toggle_charger, sharpsl_charge_toggle, NULL);
77DECLARE_WORK(sharpsl_bat, sharpsl_battery_thread, NULL); 78DECLARE_WORK(sharpsl_bat, sharpsl_battery_thread, NULL);
79DEFINE_LED_TRIGGER(sharpsl_charge_led_trigger);
78 80
79 81
80static int get_percentage(int voltage) 82static int get_percentage(int voltage)
@@ -190,10 +192,10 @@ void sharpsl_pm_led(int val)
190 dev_err(sharpsl_pm.dev, "Charging Error!\n"); 192 dev_err(sharpsl_pm.dev, "Charging Error!\n");
191 } else if (val == SHARPSL_LED_ON) { 193 } else if (val == SHARPSL_LED_ON) {
192 dev_dbg(sharpsl_pm.dev, "Charge LED On\n"); 194 dev_dbg(sharpsl_pm.dev, "Charge LED On\n");
193 195 led_trigger_event(sharpsl_charge_led_trigger, LED_FULL);
194 } else { 196 } else {
195 dev_dbg(sharpsl_pm.dev, "Charge LED Off\n"); 197 dev_dbg(sharpsl_pm.dev, "Charge LED Off\n");
196 198 led_trigger_event(sharpsl_charge_led_trigger, LED_OFF);
197 } 199 }
198} 200}
199 201
@@ -786,6 +788,8 @@ static int __init sharpsl_pm_probe(struct platform_device *pdev)
786 init_timer(&sharpsl_pm.chrg_full_timer); 788 init_timer(&sharpsl_pm.chrg_full_timer);
787 sharpsl_pm.chrg_full_timer.function = sharpsl_chrg_full_timer; 789 sharpsl_pm.chrg_full_timer.function = sharpsl_chrg_full_timer;
788 790
791 led_trigger_register_simple("sharpsl-charge", &sharpsl_charge_led_trigger);
792
789 sharpsl_pm.machinfo->init(); 793 sharpsl_pm.machinfo->init();
790 794
791 device_create_file(&pdev->dev, &dev_attr_battery_percentage); 795 device_create_file(&pdev->dev, &dev_attr_battery_percentage);
@@ -807,6 +811,8 @@ static int sharpsl_pm_remove(struct platform_device *pdev)
807 device_remove_file(&pdev->dev, &dev_attr_battery_percentage); 811 device_remove_file(&pdev->dev, &dev_attr_battery_percentage);
808 device_remove_file(&pdev->dev, &dev_attr_battery_voltage); 812 device_remove_file(&pdev->dev, &dev_attr_battery_voltage);
809 813
814 led_trigger_unregister_simple(sharpsl_charge_led_trigger);
815
810 sharpsl_pm.machinfo->exit(); 816 sharpsl_pm.machinfo->exit();
811 817
812 del_timer_sync(&sharpsl_pm.chrg_full_timer); 818 del_timer_sync(&sharpsl_pm.chrg_full_timer);
diff --git a/arch/arm/mach-ixp2000/uengine.c b/arch/arm/common/uengine.c
index ec4e007a22ef..a1310b71004e 100644
--- a/arch/arm/mach-ixp2000/uengine.c
+++ b/arch/arm/common/uengine.c
@@ -19,7 +19,7 @@
19#include <linux/string.h> 19#include <linux/string.h>
20#include <asm/hardware.h> 20#include <asm/hardware.h>
21#include <asm/arch/ixp2000-regs.h> 21#include <asm/arch/ixp2000-regs.h>
22#include <asm/arch/uengine.h> 22#include <asm/hardware/uengine.h>
23#include <asm/io.h> 23#include <asm/io.h>
24 24
25#define USTORE_ADDRESS 0x000 25#define USTORE_ADDRESS 0x000
diff --git a/arch/arm/common/vic.c b/arch/arm/common/vic.c
index a45ed1687a59..a19bc4a6196d 100644
--- a/arch/arm/common/vic.c
+++ b/arch/arm/common/vic.c
@@ -22,22 +22,21 @@
22#include <linux/list.h> 22#include <linux/list.h>
23 23
24#include <asm/io.h> 24#include <asm/io.h>
25#include <asm/irq.h>
26#include <asm/mach/irq.h> 25#include <asm/mach/irq.h>
27#include <asm/hardware/vic.h> 26#include <asm/hardware/vic.h>
28 27
29static void __iomem *vic_base;
30
31static void vic_mask_irq(unsigned int irq) 28static void vic_mask_irq(unsigned int irq)
32{ 29{
33 irq -= IRQ_VIC_START; 30 void __iomem *base = get_irq_chipdata(irq);
34 writel(1 << irq, vic_base + VIC_INT_ENABLE_CLEAR); 31 irq &= 31;
32 writel(1 << irq, base + VIC_INT_ENABLE_CLEAR);
35} 33}
36 34
37static void vic_unmask_irq(unsigned int irq) 35static void vic_unmask_irq(unsigned int irq)
38{ 36{
39 irq -= IRQ_VIC_START; 37 void __iomem *base = get_irq_chipdata(irq);
40 writel(1 << irq, vic_base + VIC_INT_ENABLE); 38 irq &= 31;
39 writel(1 << irq, base + VIC_INT_ENABLE);
41} 40}
42 41
43static struct irqchip vic_chip = { 42static struct irqchip vic_chip = {
@@ -46,43 +45,49 @@ static struct irqchip vic_chip = {
46 .unmask = vic_unmask_irq, 45 .unmask = vic_unmask_irq,
47}; 46};
48 47
49void __init vic_init(void __iomem *base, u32 vic_sources) 48/**
49 * vic_init - initialise a vectored interrupt controller
50 * @base: iomem base address
51 * @irq_start: starting interrupt number, must be muliple of 32
52 * @vic_sources: bitmask of interrupt sources to allow
53 */
54void __init vic_init(void __iomem *base, unsigned int irq_start,
55 u32 vic_sources)
50{ 56{
51 unsigned int i; 57 unsigned int i;
52 58
53 vic_base = base;
54
55 /* Disable all interrupts initially. */ 59 /* Disable all interrupts initially. */
56 60
57 writel(0, vic_base + VIC_INT_SELECT); 61 writel(0, base + VIC_INT_SELECT);
58 writel(0, vic_base + VIC_INT_ENABLE); 62 writel(0, base + VIC_INT_ENABLE);
59 writel(~0, vic_base + VIC_INT_ENABLE_CLEAR); 63 writel(~0, base + VIC_INT_ENABLE_CLEAR);
60 writel(0, vic_base + VIC_IRQ_STATUS); 64 writel(0, base + VIC_IRQ_STATUS);
61 writel(0, vic_base + VIC_ITCR); 65 writel(0, base + VIC_ITCR);
62 writel(~0, vic_base + VIC_INT_SOFT_CLEAR); 66 writel(~0, base + VIC_INT_SOFT_CLEAR);
63 67
64 /* 68 /*
65 * Make sure we clear all existing interrupts 69 * Make sure we clear all existing interrupts
66 */ 70 */
67 writel(0, vic_base + VIC_VECT_ADDR); 71 writel(0, base + VIC_VECT_ADDR);
68 for (i = 0; i < 19; i++) { 72 for (i = 0; i < 19; i++) {
69 unsigned int value; 73 unsigned int value;
70 74
71 value = readl(vic_base + VIC_VECT_ADDR); 75 value = readl(base + VIC_VECT_ADDR);
72 writel(value, vic_base + VIC_VECT_ADDR); 76 writel(value, base + VIC_VECT_ADDR);
73 } 77 }
74 78
75 for (i = 0; i < 16; i++) { 79 for (i = 0; i < 16; i++) {
76 void __iomem *reg = vic_base + VIC_VECT_CNTL0 + (i * 4); 80 void __iomem *reg = base + VIC_VECT_CNTL0 + (i * 4);
77 writel(VIC_VECT_CNTL_ENABLE | i, reg); 81 writel(VIC_VECT_CNTL_ENABLE | i, reg);
78 } 82 }
79 83
80 writel(32, vic_base + VIC_DEF_VECT_ADDR); 84 writel(32, base + VIC_DEF_VECT_ADDR);
81 85
82 for (i = 0; i < 32; i++) { 86 for (i = 0; i < 32; i++) {
83 unsigned int irq = IRQ_VIC_START + i; 87 unsigned int irq = irq_start + i;
84 88
85 set_irq_chip(irq, &vic_chip); 89 set_irq_chip(irq, &vic_chip);
90 set_irq_chipdata(irq, base);
86 91
87 if (vic_sources & (1 << i)) { 92 if (vic_sources & (1 << i)) {
88 set_irq_handler(irq, do_level_IRQ); 93 set_irq_handler(irq, do_level_IRQ);
diff --git a/arch/arm/configs/enp2611_defconfig b/arch/arm/configs/ep93xx_defconfig
index 5fdaf3ce9d56..8dcc8e8ec813 100644
--- a/arch/arm/configs/enp2611_defconfig
+++ b/arch/arm/configs/ep93xx_defconfig
@@ -1,11 +1,10 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.14-git13 3# Linux kernel version: 2.6.16
4# Thu Nov 10 15:12:48 2005 4# Mon Mar 20 14:54:51 2006
5# 5#
6CONFIG_ARM=y 6CONFIG_ARM=y
7CONFIG_MMU=y 7CONFIG_MMU=y
8CONFIG_UID16=y
9CONFIG_RWSEM_GENERIC_SPINLOCK=y 8CONFIG_RWSEM_GENERIC_SPINLOCK=y
10CONFIG_GENERIC_CALIBRATE_DELAY=y 9CONFIG_GENERIC_CALIBRATE_DELAY=y
11 10
@@ -13,7 +12,6 @@ CONFIG_GENERIC_CALIBRATE_DELAY=y
13# Code maturity level options 12# Code maturity level options
14# 13#
15CONFIG_EXPERIMENTAL=y 14CONFIG_EXPERIMENTAL=y
16CONFIG_CLEAN_COMPILE=y
17CONFIG_BROKEN_ON_SMP=y 15CONFIG_BROKEN_ON_SMP=y
18CONFIG_INIT_ENV_ARG_LIMIT=32 16CONFIG_INIT_ENV_ARG_LIMIT=32
19 17
@@ -25,38 +23,42 @@ CONFIG_LOCALVERSION_AUTO=y
25CONFIG_SWAP=y 23CONFIG_SWAP=y
26CONFIG_SYSVIPC=y 24CONFIG_SYSVIPC=y
27# CONFIG_POSIX_MQUEUE is not set 25# CONFIG_POSIX_MQUEUE is not set
28CONFIG_BSD_PROCESS_ACCT=y 26# CONFIG_BSD_PROCESS_ACCT is not set
29# CONFIG_BSD_PROCESS_ACCT_V3 is not set
30CONFIG_SYSCTL=y 27CONFIG_SYSCTL=y
31# CONFIG_AUDIT is not set 28# CONFIG_AUDIT is not set
32# CONFIG_HOTPLUG is not set 29CONFIG_IKCONFIG=y
33CONFIG_KOBJECT_UEVENT=y 30CONFIG_IKCONFIG_PROC=y
34# CONFIG_IKCONFIG is not set
35CONFIG_INITRAMFS_SOURCE="" 31CONFIG_INITRAMFS_SOURCE=""
32CONFIG_UID16=y
33CONFIG_CC_OPTIMIZE_FOR_SIZE=y
36CONFIG_EMBEDDED=y 34CONFIG_EMBEDDED=y
37CONFIG_KALLSYMS=y 35CONFIG_KALLSYMS=y
38# CONFIG_KALLSYMS_ALL is not set 36# CONFIG_KALLSYMS_ALL is not set
39# CONFIG_KALLSYMS_EXTRA_PASS is not set 37# CONFIG_KALLSYMS_EXTRA_PASS is not set
38CONFIG_HOTPLUG=y
40CONFIG_PRINTK=y 39CONFIG_PRINTK=y
41CONFIG_BUG=y 40CONFIG_BUG=y
41CONFIG_ELF_CORE=y
42CONFIG_BASE_FULL=y 42CONFIG_BASE_FULL=y
43CONFIG_FUTEX=y 43CONFIG_FUTEX=y
44CONFIG_EPOLL=y 44CONFIG_EPOLL=y
45CONFIG_CC_OPTIMIZE_FOR_SIZE=y
46CONFIG_SHMEM=y 45CONFIG_SHMEM=y
47CONFIG_CC_ALIGN_FUNCTIONS=0 46CONFIG_CC_ALIGN_FUNCTIONS=0
48CONFIG_CC_ALIGN_LABELS=0 47CONFIG_CC_ALIGN_LABELS=0
49CONFIG_CC_ALIGN_LOOPS=0 48CONFIG_CC_ALIGN_LOOPS=0
50CONFIG_CC_ALIGN_JUMPS=0 49CONFIG_CC_ALIGN_JUMPS=0
50CONFIG_SLAB=y
51# CONFIG_TINY_SHMEM is not set 51# CONFIG_TINY_SHMEM is not set
52CONFIG_BASE_SMALL=0 52CONFIG_BASE_SMALL=0
53# CONFIG_SLOB is not set
54CONFIG_OBSOLETE_INTERMODULE=y
53 55
54# 56#
55# Loadable module support 57# Loadable module support
56# 58#
57CONFIG_MODULES=y 59CONFIG_MODULES=y
58CONFIG_MODULE_UNLOAD=y 60CONFIG_MODULE_UNLOAD=y
59# CONFIG_MODULE_FORCE_UNLOAD is not set 61CONFIG_MODULE_FORCE_UNLOAD=y
60CONFIG_OBSOLETE_MODPARM=y 62CONFIG_OBSOLETE_MODPARM=y
61# CONFIG_MODVERSIONS is not set 63# CONFIG_MODVERSIONS is not set
62# CONFIG_MODULE_SRCVERSION_ALL is not set 64# CONFIG_MODULE_SRCVERSION_ALL is not set
@@ -70,14 +72,14 @@ CONFIG_KMOD=y
70# IO Schedulers 72# IO Schedulers
71# 73#
72CONFIG_IOSCHED_NOOP=y 74CONFIG_IOSCHED_NOOP=y
73CONFIG_IOSCHED_AS=y 75# CONFIG_IOSCHED_AS is not set
74CONFIG_IOSCHED_DEADLINE=y 76CONFIG_IOSCHED_DEADLINE=y
75CONFIG_IOSCHED_CFQ=y 77# CONFIG_IOSCHED_CFQ is not set
76CONFIG_DEFAULT_AS=y 78# CONFIG_DEFAULT_AS is not set
77# CONFIG_DEFAULT_DEADLINE is not set 79CONFIG_DEFAULT_DEADLINE=y
78# CONFIG_DEFAULT_CFQ is not set 80# CONFIG_DEFAULT_CFQ is not set
79# CONFIG_DEFAULT_NOOP is not set 81# CONFIG_DEFAULT_NOOP is not set
80CONFIG_DEFAULT_IOSCHED="anticipatory" 82CONFIG_DEFAULT_IOSCHED="deadline"
81 83
82# 84#
83# System Type 85# System Type
@@ -86,11 +88,12 @@ CONFIG_DEFAULT_IOSCHED="anticipatory"
86# CONFIG_ARCH_CLPS711X is not set 88# CONFIG_ARCH_CLPS711X is not set
87# CONFIG_ARCH_CO285 is not set 89# CONFIG_ARCH_CO285 is not set
88# CONFIG_ARCH_EBSA110 is not set 90# CONFIG_ARCH_EBSA110 is not set
91CONFIG_ARCH_EP93XX=y
89# CONFIG_ARCH_FOOTBRIDGE is not set 92# CONFIG_ARCH_FOOTBRIDGE is not set
90# CONFIG_ARCH_INTEGRATOR is not set 93# CONFIG_ARCH_INTEGRATOR is not set
91# CONFIG_ARCH_IOP3XX is not set 94# CONFIG_ARCH_IOP3XX is not set
92# CONFIG_ARCH_IXP4XX is not set 95# CONFIG_ARCH_IXP4XX is not set
93CONFIG_ARCH_IXP2000=y 96# CONFIG_ARCH_IXP2000 is not set
94# CONFIG_ARCH_L7200 is not set 97# CONFIG_ARCH_L7200 is not set
95# CONFIG_ARCH_PXA is not set 98# CONFIG_ARCH_PXA is not set
96# CONFIG_ARCH_RPC is not set 99# CONFIG_ARCH_RPC is not set
@@ -104,46 +107,44 @@ CONFIG_ARCH_IXP2000=y
104# CONFIG_ARCH_IMX is not set 107# CONFIG_ARCH_IMX is not set
105# CONFIG_ARCH_H720X is not set 108# CONFIG_ARCH_H720X is not set
106# CONFIG_ARCH_AAEC2000 is not set 109# CONFIG_ARCH_AAEC2000 is not set
107CONFIG_ARCH_SUPPORTS_BIG_ENDIAN=y 110# CONFIG_ARCH_AT91RM9200 is not set
108 111
109# 112#
110# Intel IXP2400/2800 Implementation Options 113# Cirrus EP93xx Implementation Options
111# 114#
115CONFIG_CRUNCH=y
112 116
113# 117#
114# IXP2400/2800 Platforms 118# EP93xx Platforms
115# 119#
116CONFIG_ARCH_ENP2611=y 120CONFIG_MACH_GESBC9312=y
117# CONFIG_ARCH_IXDP2400 is not set 121CONFIG_MACH_TS72XX=y
118# CONFIG_ARCH_IXDP2800 is not set
119# CONFIG_ARCH_IXDP2401 is not set
120# CONFIG_ARCH_IXDP2801 is not set
121# CONFIG_IXP2000_SUPPORT_BROKEN_PCI_IO is not set
122 122
123# 123#
124# Processor Type 124# Processor Type
125# 125#
126CONFIG_CPU_32=y 126CONFIG_CPU_32=y
127CONFIG_CPU_XSCALE=y 127CONFIG_CPU_ARM920T=y
128CONFIG_CPU_32v5=y 128CONFIG_CPU_32v4=y
129CONFIG_CPU_ABRT_EV5T=y 129CONFIG_CPU_ABRT_EV4T=y
130CONFIG_CPU_CACHE_V4WT=y
130CONFIG_CPU_CACHE_VIVT=y 131CONFIG_CPU_CACHE_VIVT=y
132CONFIG_CPU_COPY_V4WB=y
131CONFIG_CPU_TLB_V4WBI=y 133CONFIG_CPU_TLB_V4WBI=y
132 134
133# 135#
134# Processor Features 136# Processor Features
135# 137#
136# CONFIG_ARM_THUMB is not set 138CONFIG_ARM_THUMB=y
137CONFIG_CPU_BIG_ENDIAN=y 139# CONFIG_CPU_ICACHE_DISABLE is not set
138CONFIG_XSCALE_PMU=y 140# CONFIG_CPU_DCACHE_DISABLE is not set
141# CONFIG_CPU_DCACHE_WRITETHROUGH is not set
142CONFIG_ARM_VIC=y
139 143
140# 144#
141# Bus support 145# Bus support
142# 146#
143CONFIG_ISA_DMA_API=y 147CONFIG_ARM_AMBA=y
144CONFIG_PCI=y
145CONFIG_PCI_LEGACY_PROC=y
146# CONFIG_PCI_DEBUG is not set
147 148
148# 149#
149# PCCARD (PCMCIA/CardBus) support 150# PCCARD (PCMCIA/CardBus) support
@@ -155,6 +156,8 @@ CONFIG_PCI_LEGACY_PROC=y
155# 156#
156# CONFIG_PREEMPT is not set 157# CONFIG_PREEMPT is not set
157# CONFIG_NO_IDLE_HZ is not set 158# CONFIG_NO_IDLE_HZ is not set
159CONFIG_HZ=100
160# CONFIG_AEABI is not set
158# CONFIG_ARCH_DISCONTIGMEM_ENABLE is not set 161# CONFIG_ARCH_DISCONTIGMEM_ENABLE is not set
159CONFIG_SELECT_MEMORY_MODEL=y 162CONFIG_SELECT_MEMORY_MODEL=y
160CONFIG_FLATMEM_MANUAL=y 163CONFIG_FLATMEM_MANUAL=y
@@ -171,7 +174,7 @@ CONFIG_ALIGNMENT_TRAP=y
171# 174#
172CONFIG_ZBOOT_ROM_TEXT=0x0 175CONFIG_ZBOOT_ROM_TEXT=0x0
173CONFIG_ZBOOT_ROM_BSS=0x0 176CONFIG_ZBOOT_ROM_BSS=0x0
174CONFIG_CMDLINE="console=ttyS0,57600 root=/dev/nfs ip=bootp mem=64M@0x0" 177CONFIG_CMDLINE="console=ttyAM0,115200 root=/dev/nfs ip=bootp"
175# CONFIG_XIP_KERNEL is not set 178# CONFIG_XIP_KERNEL is not set
176 179
177# 180#
@@ -197,6 +200,7 @@ CONFIG_BINFMT_ELF=y
197# Power management options 200# Power management options
198# 201#
199# CONFIG_PM is not set 202# CONFIG_PM is not set
203# CONFIG_APM is not set
200 204
201# 205#
202# Networking 206# Networking
@@ -206,10 +210,13 @@ CONFIG_NET=y
206# 210#
207# Networking options 211# Networking options
208# 212#
213# CONFIG_NETDEBUG is not set
209CONFIG_PACKET=y 214CONFIG_PACKET=y
210CONFIG_PACKET_MMAP=y 215CONFIG_PACKET_MMAP=y
211CONFIG_UNIX=y 216CONFIG_UNIX=y
212# CONFIG_NET_KEY is not set 217CONFIG_XFRM=y
218# CONFIG_XFRM_USER is not set
219CONFIG_NET_KEY=y
213CONFIG_INET=y 220CONFIG_INET=y
214# CONFIG_IP_MULTICAST is not set 221# CONFIG_IP_MULTICAST is not set
215# CONFIG_IP_ADVANCED_ROUTER is not set 222# CONFIG_IP_ADVANCED_ROUTER is not set
@@ -242,6 +249,11 @@ CONFIG_TCP_CONG_BIC=y
242# SCTP Configuration (EXPERIMENTAL) 249# SCTP Configuration (EXPERIMENTAL)
243# 250#
244# CONFIG_IP_SCTP is not set 251# CONFIG_IP_SCTP is not set
252
253#
254# TIPC Configuration (EXPERIMENTAL)
255#
256# CONFIG_TIPC is not set
245# CONFIG_ATM is not set 257# CONFIG_ATM is not set
246# CONFIG_BRIDGE is not set 258# CONFIG_BRIDGE is not set
247# CONFIG_VLAN_8021Q is not set 259# CONFIG_VLAN_8021Q is not set
@@ -259,7 +271,6 @@ CONFIG_TCP_CONG_BIC=y
259# QoS and/or fair queueing 271# QoS and/or fair queueing
260# 272#
261# CONFIG_NET_SCHED is not set 273# CONFIG_NET_SCHED is not set
262# CONFIG_NET_CLS_ROUTE is not set
263 274
264# 275#
265# Network testing 276# Network testing
@@ -278,21 +289,26 @@ CONFIG_TCP_CONG_BIC=y
278# Generic Driver Options 289# Generic Driver Options
279# 290#
280CONFIG_STANDALONE=y 291CONFIG_STANDALONE=y
281# CONFIG_PREVENT_FIRMWARE_BUILD is not set 292CONFIG_PREVENT_FIRMWARE_BUILD=y
282# CONFIG_FW_LOADER is not set 293# CONFIG_FW_LOADER is not set
283# CONFIG_DEBUG_DRIVER is not set 294# CONFIG_DEBUG_DRIVER is not set
284 295
285# 296#
297# Connector - unified userspace <-> kernelspace linker
298#
299# CONFIG_CONNECTOR is not set
300
301#
286# Memory Technology Devices (MTD) 302# Memory Technology Devices (MTD)
287# 303#
288CONFIG_MTD=y 304CONFIG_MTD=y
289# CONFIG_MTD_DEBUG is not set 305# CONFIG_MTD_DEBUG is not set
290# CONFIG_MTD_CONCAT is not set 306CONFIG_MTD_CONCAT=y
291CONFIG_MTD_PARTITIONS=y 307CONFIG_MTD_PARTITIONS=y
292CONFIG_MTD_REDBOOT_PARTS=y 308CONFIG_MTD_REDBOOT_PARTS=y
293CONFIG_MTD_REDBOOT_DIRECTORY_BLOCK=-1 309CONFIG_MTD_REDBOOT_DIRECTORY_BLOCK=-1
294CONFIG_MTD_REDBOOT_PARTS_UNALLOCATED=y 310# CONFIG_MTD_REDBOOT_PARTS_UNALLOCATED is not set
295CONFIG_MTD_REDBOOT_PARTS_READONLY=y 311# CONFIG_MTD_REDBOOT_PARTS_READONLY is not set
296# CONFIG_MTD_CMDLINE_PARTS is not set 312# CONFIG_MTD_CMDLINE_PARTS is not set
297# CONFIG_MTD_AFS_PARTS is not set 313# CONFIG_MTD_AFS_PARTS is not set
298 314
@@ -312,7 +328,11 @@ CONFIG_MTD_BLOCK=y
312CONFIG_MTD_CFI=y 328CONFIG_MTD_CFI=y
313# CONFIG_MTD_JEDECPROBE is not set 329# CONFIG_MTD_JEDECPROBE is not set
314CONFIG_MTD_GEN_PROBE=y 330CONFIG_MTD_GEN_PROBE=y
315# CONFIG_MTD_CFI_ADV_OPTIONS is not set 331CONFIG_MTD_CFI_ADV_OPTIONS=y
332CONFIG_MTD_CFI_NOSWAP=y
333# CONFIG_MTD_CFI_BE_BYTE_SWAP is not set
334# CONFIG_MTD_CFI_LE_BYTE_SWAP is not set
335# CONFIG_MTD_CFI_GEOMETRY is not set
316CONFIG_MTD_MAP_BANK_WIDTH_1=y 336CONFIG_MTD_MAP_BANK_WIDTH_1=y
317CONFIG_MTD_MAP_BANK_WIDTH_2=y 337CONFIG_MTD_MAP_BANK_WIDTH_2=y
318CONFIG_MTD_MAP_BANK_WIDTH_4=y 338CONFIG_MTD_MAP_BANK_WIDTH_4=y
@@ -323,29 +343,31 @@ CONFIG_MTD_CFI_I1=y
323CONFIG_MTD_CFI_I2=y 343CONFIG_MTD_CFI_I2=y
324# CONFIG_MTD_CFI_I4 is not set 344# CONFIG_MTD_CFI_I4 is not set
325# CONFIG_MTD_CFI_I8 is not set 345# CONFIG_MTD_CFI_I8 is not set
346# CONFIG_MTD_OTP is not set
326CONFIG_MTD_CFI_INTELEXT=y 347CONFIG_MTD_CFI_INTELEXT=y
327# CONFIG_MTD_CFI_AMDSTD is not set 348CONFIG_MTD_CFI_AMDSTD=y
328# CONFIG_MTD_CFI_STAA is not set 349CONFIG_MTD_CFI_AMDSTD_RETRY=0
350CONFIG_MTD_CFI_STAA=y
329CONFIG_MTD_CFI_UTIL=y 351CONFIG_MTD_CFI_UTIL=y
330# CONFIG_MTD_RAM is not set 352# CONFIG_MTD_RAM is not set
331# CONFIG_MTD_ROM is not set 353CONFIG_MTD_ROM=y
332# CONFIG_MTD_ABSENT is not set 354# CONFIG_MTD_ABSENT is not set
333# CONFIG_MTD_XIP is not set 355# CONFIG_MTD_OBSOLETE_CHIPS is not set
334 356
335# 357#
336# Mapping drivers for chip access 358# Mapping drivers for chip access
337# 359#
338CONFIG_MTD_COMPLEX_MAPPINGS=y 360# CONFIG_MTD_COMPLEX_MAPPINGS is not set
339# CONFIG_MTD_PHYSMAP is not set 361CONFIG_MTD_PHYSMAP=y
362CONFIG_MTD_PHYSMAP_START=0x0
363CONFIG_MTD_PHYSMAP_LEN=0x0
364CONFIG_MTD_PHYSMAP_BANKWIDTH=1
340# CONFIG_MTD_ARM_INTEGRATOR is not set 365# CONFIG_MTD_ARM_INTEGRATOR is not set
341CONFIG_MTD_IXP2000=y
342# CONFIG_MTD_PCI is not set
343# CONFIG_MTD_PLATRAM is not set 366# CONFIG_MTD_PLATRAM is not set
344 367
345# 368#
346# Self-contained MTD device drivers 369# Self-contained MTD device drivers
347# 370#
348# CONFIG_MTD_PMC551 is not set
349# CONFIG_MTD_SLRAM is not set 371# CONFIG_MTD_SLRAM is not set
350# CONFIG_MTD_PHRAM is not set 372# CONFIG_MTD_PHRAM is not set
351# CONFIG_MTD_MTDRAM is not set 373# CONFIG_MTD_MTDRAM is not set
@@ -362,7 +384,11 @@ CONFIG_MTD_IXP2000=y
362# 384#
363# NAND Flash Device Drivers 385# NAND Flash Device Drivers
364# 386#
365# CONFIG_MTD_NAND is not set 387CONFIG_MTD_NAND=y
388CONFIG_MTD_NAND_VERIFY_WRITE=y
389CONFIG_MTD_NAND_IDS=y
390# CONFIG_MTD_NAND_DISKONCHIP is not set
391# CONFIG_MTD_NAND_NANDSIM is not set
366 392
367# 393#
368# OneNAND Flash Device Drivers 394# OneNAND Flash Device Drivers
@@ -381,19 +407,12 @@ CONFIG_MTD_IXP2000=y
381# 407#
382# Block devices 408# Block devices
383# 409#
384# CONFIG_BLK_CPQ_DA is not set
385# CONFIG_BLK_CPQ_CISS_DA is not set
386# CONFIG_BLK_DEV_DAC960 is not set
387# CONFIG_BLK_DEV_UMEM is not set
388# CONFIG_BLK_DEV_COW_COMMON is not set 410# CONFIG_BLK_DEV_COW_COMMON is not set
389CONFIG_BLK_DEV_LOOP=y 411# CONFIG_BLK_DEV_LOOP is not set
390# CONFIG_BLK_DEV_CRYPTOLOOP is not set
391# CONFIG_BLK_DEV_NBD is not set 412# CONFIG_BLK_DEV_NBD is not set
392# CONFIG_BLK_DEV_SX8 is not set 413# CONFIG_BLK_DEV_UB is not set
393CONFIG_BLK_DEV_RAM=y 414# CONFIG_BLK_DEV_RAM is not set
394CONFIG_BLK_DEV_RAM_COUNT=16 415CONFIG_BLK_DEV_RAM_COUNT=16
395CONFIG_BLK_DEV_RAM_SIZE=8192
396CONFIG_BLK_DEV_INITRD=y
397# CONFIG_CDROM_PKTCDVD is not set 416# CONFIG_CDROM_PKTCDVD is not set
398# CONFIG_ATA_OVER_ETH is not set 417# CONFIG_ATA_OVER_ETH is not set
399 418
@@ -401,7 +420,40 @@ CONFIG_BLK_DEV_INITRD=y
401# SCSI device support 420# SCSI device support
402# 421#
403# CONFIG_RAID_ATTRS is not set 422# CONFIG_RAID_ATTRS is not set
404# CONFIG_SCSI is not set 423CONFIG_SCSI=y
424# CONFIG_SCSI_PROC_FS is not set
425
426#
427# SCSI support type (disk, tape, CD-ROM)
428#
429CONFIG_BLK_DEV_SD=y
430# CONFIG_CHR_DEV_ST is not set
431# CONFIG_CHR_DEV_OSST is not set
432# CONFIG_BLK_DEV_SR is not set
433# CONFIG_CHR_DEV_SG is not set
434# CONFIG_CHR_DEV_SCH is not set
435
436#
437# Some SCSI devices (e.g. CD jukebox) support multiple LUNs
438#
439# CONFIG_SCSI_MULTI_LUN is not set
440# CONFIG_SCSI_CONSTANTS is not set
441# CONFIG_SCSI_LOGGING is not set
442
443#
444# SCSI Transport Attributes
445#
446# CONFIG_SCSI_SPI_ATTRS is not set
447# CONFIG_SCSI_FC_ATTRS is not set
448# CONFIG_SCSI_ISCSI_ATTRS is not set
449# CONFIG_SCSI_SAS_ATTRS is not set
450
451#
452# SCSI low-level drivers
453#
454# CONFIG_ISCSI_TCP is not set
455# CONFIG_SCSI_SATA is not set
456# CONFIG_SCSI_DEBUG is not set
405 457
406# 458#
407# Multi-device support (RAID and LVM) 459# Multi-device support (RAID and LVM)
@@ -416,28 +468,21 @@ CONFIG_BLK_DEV_INITRD=y
416# 468#
417# IEEE 1394 (FireWire) support 469# IEEE 1394 (FireWire) support
418# 470#
419# CONFIG_IEEE1394 is not set
420 471
421# 472#
422# I2O device support 473# I2O device support
423# 474#
424# CONFIG_I2O is not set
425 475
426# 476#
427# Network device support 477# Network device support
428# 478#
429CONFIG_NETDEVICES=y 479CONFIG_NETDEVICES=y
430CONFIG_DUMMY=y 480# CONFIG_DUMMY is not set
431# CONFIG_BONDING is not set 481# CONFIG_BONDING is not set
432# CONFIG_EQUALIZER is not set 482# CONFIG_EQUALIZER is not set
433# CONFIG_TUN is not set 483# CONFIG_TUN is not set
434 484
435# 485#
436# ARCnet devices
437#
438# CONFIG_ARCNET is not set
439
440#
441# PHY device support 486# PHY device support
442# 487#
443# CONFIG_PHYLIB is not set 488# CONFIG_PHYLIB is not set
@@ -447,66 +492,20 @@ CONFIG_DUMMY=y
447# 492#
448CONFIG_NET_ETHERNET=y 493CONFIG_NET_ETHERNET=y
449CONFIG_MII=y 494CONFIG_MII=y
450# CONFIG_HAPPYMEAL is not set
451# CONFIG_SUNGEM is not set
452# CONFIG_CASSINI is not set
453# CONFIG_NET_VENDOR_3COM is not set
454# CONFIG_SMC91X is not set 495# CONFIG_SMC91X is not set
455# CONFIG_DM9000 is not set 496# CONFIG_DM9000 is not set
456 497
457# 498#
458# Tulip family network device support
459#
460# CONFIG_NET_TULIP is not set
461# CONFIG_HP100 is not set
462CONFIG_NET_PCI=y
463# CONFIG_PCNET32 is not set
464# CONFIG_AMD8111_ETH is not set
465# CONFIG_ADAPTEC_STARFIRE is not set
466# CONFIG_B44 is not set
467# CONFIG_FORCEDETH is not set
468# CONFIG_DGRS is not set
469CONFIG_EEPRO100=y
470# CONFIG_E100 is not set
471# CONFIG_FEALNX is not set
472# CONFIG_NATSEMI is not set
473# CONFIG_NE2K_PCI is not set
474# CONFIG_8139CP is not set
475# CONFIG_8139TOO is not set
476# CONFIG_SIS900 is not set
477# CONFIG_EPIC100 is not set
478# CONFIG_SUNDANCE is not set
479# CONFIG_TLAN is not set
480# CONFIG_VIA_RHINE is not set
481
482#
483# Ethernet (1000 Mbit) 499# Ethernet (1000 Mbit)
484# 500#
485# CONFIG_ACENIC is not set
486# CONFIG_DL2K is not set
487# CONFIG_E1000 is not set
488# CONFIG_NS83820 is not set
489# CONFIG_HAMACHI is not set
490# CONFIG_YELLOWFIN is not set
491# CONFIG_R8169 is not set
492# CONFIG_SIS190 is not set
493# CONFIG_SKGE is not set
494# CONFIG_SK98LIN is not set
495# CONFIG_VIA_VELOCITY is not set
496# CONFIG_TIGON3 is not set
497# CONFIG_BNX2 is not set
498 501
499# 502#
500# Ethernet (10000 Mbit) 503# Ethernet (10000 Mbit)
501# 504#
502# CONFIG_CHELSIO_T1 is not set
503# CONFIG_IXGB is not set
504# CONFIG_S2IO is not set
505 505
506# 506#
507# Token Ring devices 507# Token Ring devices
508# 508#
509# CONFIG_TR is not set
510 509
511# 510#
512# Wireless LAN (non-hamradio) 511# Wireless LAN (non-hamradio)
@@ -516,29 +515,7 @@ CONFIG_EEPRO100=y
516# 515#
517# Wan interfaces 516# Wan interfaces
518# 517#
519CONFIG_WAN=y 518# CONFIG_WAN is not set
520# CONFIG_DSCC4 is not set
521# CONFIG_LANMEDIA is not set
522# CONFIG_SYNCLINK_SYNCPPP is not set
523CONFIG_HDLC=y
524CONFIG_HDLC_RAW=y
525# CONFIG_HDLC_RAW_ETH is not set
526CONFIG_HDLC_CISCO=y
527CONFIG_HDLC_FR=y
528CONFIG_HDLC_PPP=y
529
530#
531# X.25/LAPB support is disabled
532#
533# CONFIG_PCI200SYN is not set
534# CONFIG_WANXL is not set
535# CONFIG_PC300 is not set
536# CONFIG_FARSYNC is not set
537CONFIG_DLCI=y
538CONFIG_DLCI_COUNT=24
539CONFIG_DLCI_MAX=8
540# CONFIG_FDDI is not set
541# CONFIG_HIPPI is not set
542# CONFIG_PPP is not set 519# CONFIG_PPP is not set
543# CONFIG_SLIP is not set 520# CONFIG_SLIP is not set
544# CONFIG_SHAPER is not set 521# CONFIG_SHAPER is not set
@@ -554,28 +531,7 @@ CONFIG_DLCI_MAX=8
554# 531#
555# Input device support 532# Input device support
556# 533#
557CONFIG_INPUT=y 534# CONFIG_INPUT is not set
558
559#
560# Userland interfaces
561#
562CONFIG_INPUT_MOUSEDEV=y
563CONFIG_INPUT_MOUSEDEV_PSAUX=y
564CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024
565CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768
566# CONFIG_INPUT_JOYDEV is not set
567# CONFIG_INPUT_TSDEV is not set
568# CONFIG_INPUT_EVDEV is not set
569# CONFIG_INPUT_EVBUG is not set
570
571#
572# Input Device Drivers
573#
574# CONFIG_INPUT_KEYBOARD is not set
575# CONFIG_INPUT_MOUSE is not set
576# CONFIG_INPUT_JOYSTICK is not set
577# CONFIG_INPUT_TOUCHSCREEN is not set
578# CONFIG_INPUT_MISC is not set
579 535
580# 536#
581# Hardware I/O ports 537# Hardware I/O ports
@@ -592,20 +548,18 @@ CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768
592# 548#
593# Serial drivers 549# Serial drivers
594# 550#
595CONFIG_SERIAL_8250=y 551# CONFIG_SERIAL_8250 is not set
596CONFIG_SERIAL_8250_CONSOLE=y
597CONFIG_SERIAL_8250_NR_UARTS=2
598# CONFIG_SERIAL_8250_EXTENDED is not set
599 552
600# 553#
601# Non-8250 serial port support 554# Non-8250 serial port support
602# 555#
556CONFIG_SERIAL_AMBA_PL010=y
557CONFIG_SERIAL_AMBA_PL010_CONSOLE=y
558# CONFIG_SERIAL_AMBA_PL011 is not set
603CONFIG_SERIAL_CORE=y 559CONFIG_SERIAL_CORE=y
604CONFIG_SERIAL_CORE_CONSOLE=y 560CONFIG_SERIAL_CORE_CONSOLE=y
605# CONFIG_SERIAL_JSM is not set
606CONFIG_UNIX98_PTYS=y 561CONFIG_UNIX98_PTYS=y
607CONFIG_LEGACY_PTYS=y 562# CONFIG_LEGACY_PTYS is not set
608CONFIG_LEGACY_PTY_COUNT=256
609 563
610# 564#
611# IPMI 565# IPMI
@@ -622,23 +576,19 @@ CONFIG_WATCHDOG=y
622# Watchdog Device Drivers 576# Watchdog Device Drivers
623# 577#
624# CONFIG_SOFT_WATCHDOG is not set 578# CONFIG_SOFT_WATCHDOG is not set
625CONFIG_IXP2000_WATCHDOG=y
626 579
627# 580#
628# PCI-based Watchdog Cards 581# USB-based Watchdog Cards
629# 582#
630# CONFIG_PCIPCWATCHDOG is not set 583# CONFIG_USBPCWATCHDOG is not set
631# CONFIG_WDTPCI is not set
632# CONFIG_NVRAM is not set 584# CONFIG_NVRAM is not set
633# CONFIG_RTC is not set 585# CONFIG_RTC is not set
634# CONFIG_DTLK is not set 586# CONFIG_DTLK is not set
635# CONFIG_R3964 is not set 587# CONFIG_R3964 is not set
636# CONFIG_APPLICOM is not set
637 588
638# 589#
639# Ftape, the floppy tape device driver 590# Ftape, the floppy tape device driver
640# 591#
641# CONFIG_DRM is not set
642# CONFIG_RAW_DRIVER is not set 592# CONFIG_RAW_DRIVER is not set
643 593
644# 594#
@@ -663,27 +613,8 @@ CONFIG_I2C_ALGOBIT=y
663# 613#
664# I2C Hardware Bus support 614# I2C Hardware Bus support
665# 615#
666# CONFIG_I2C_ALI1535 is not set
667# CONFIG_I2C_ALI1563 is not set
668# CONFIG_I2C_ALI15X3 is not set
669# CONFIG_I2C_AMD756 is not set
670# CONFIG_I2C_AMD8111 is not set
671# CONFIG_I2C_I801 is not set
672# CONFIG_I2C_I810 is not set
673# CONFIG_I2C_PIIX4 is not set
674CONFIG_I2C_IXP2000=y
675# CONFIG_I2C_NFORCE2 is not set
676# CONFIG_I2C_PARPORT_LIGHT is not set 616# CONFIG_I2C_PARPORT_LIGHT is not set
677# CONFIG_I2C_PROSAVAGE is not set
678# CONFIG_I2C_SAVAGE4 is not set
679# CONFIG_SCx200_ACB is not set
680# CONFIG_I2C_SIS5595 is not set
681# CONFIG_I2C_SIS630 is not set
682# CONFIG_I2C_SIS96X is not set
683# CONFIG_I2C_STUB is not set 617# CONFIG_I2C_STUB is not set
684# CONFIG_I2C_VIA is not set
685# CONFIG_I2C_VIAPRO is not set
686# CONFIG_I2C_VOODOO3 is not set
687# CONFIG_I2C_PCA_ISA is not set 618# CONFIG_I2C_PCA_ISA is not set
688 619
689# 620#
@@ -691,17 +622,28 @@ CONFIG_I2C_IXP2000=y
691# 622#
692# CONFIG_SENSORS_DS1337 is not set 623# CONFIG_SENSORS_DS1337 is not set
693# CONFIG_SENSORS_DS1374 is not set 624# CONFIG_SENSORS_DS1374 is not set
694CONFIG_SENSORS_EEPROM=y 625# CONFIG_SENSORS_EEPROM is not set
695# CONFIG_SENSORS_PCF8574 is not set 626# CONFIG_SENSORS_PCF8574 is not set
696# CONFIG_SENSORS_PCA9539 is not set 627# CONFIG_SENSORS_PCA9539 is not set
697# CONFIG_SENSORS_PCF8591 is not set 628# CONFIG_SENSORS_PCF8591 is not set
698# CONFIG_SENSORS_RTC8564 is not set 629# CONFIG_SENSORS_RTC8564 is not set
699# CONFIG_SENSORS_MAX6875 is not set 630# CONFIG_SENSORS_MAX6875 is not set
700# CONFIG_RTC_X1205_I2C is not set 631# CONFIG_RTC_X1205_I2C is not set
701# CONFIG_I2C_DEBUG_CORE is not set 632CONFIG_I2C_DEBUG_CORE=y
702# CONFIG_I2C_DEBUG_ALGO is not set 633CONFIG_I2C_DEBUG_ALGO=y
703# CONFIG_I2C_DEBUG_BUS is not set 634CONFIG_I2C_DEBUG_BUS=y
704# CONFIG_I2C_DEBUG_CHIP is not set 635CONFIG_I2C_DEBUG_CHIP=y
636
637#
638# SPI support
639#
640# CONFIG_SPI is not set
641# CONFIG_SPI_MASTER is not set
642
643#
644# Dallas's 1-wire bus
645#
646# CONFIG_W1 is not set
705 647
706# 648#
707# Hardware Monitoring support 649# Hardware Monitoring support
@@ -716,6 +658,7 @@ CONFIG_HWMON=y
716# CONFIG_SENSORS_ASB100 is not set 658# CONFIG_SENSORS_ASB100 is not set
717# CONFIG_SENSORS_ATXP1 is not set 659# CONFIG_SENSORS_ATXP1 is not set
718# CONFIG_SENSORS_DS1621 is not set 660# CONFIG_SENSORS_DS1621 is not set
661# CONFIG_SENSORS_F71805F is not set
719# CONFIG_SENSORS_FSCHER is not set 662# CONFIG_SENSORS_FSCHER is not set
720# CONFIG_SENSORS_FSCPOS is not set 663# CONFIG_SENSORS_FSCPOS is not set
721# CONFIG_SENSORS_GL518SM is not set 664# CONFIG_SENSORS_GL518SM is not set
@@ -733,10 +676,8 @@ CONFIG_HWMON=y
733# CONFIG_SENSORS_LM92 is not set 676# CONFIG_SENSORS_LM92 is not set
734# CONFIG_SENSORS_MAX1619 is not set 677# CONFIG_SENSORS_MAX1619 is not set
735# CONFIG_SENSORS_PC87360 is not set 678# CONFIG_SENSORS_PC87360 is not set
736# CONFIG_SENSORS_SIS5595 is not set
737# CONFIG_SENSORS_SMSC47M1 is not set 679# CONFIG_SENSORS_SMSC47M1 is not set
738# CONFIG_SENSORS_SMSC47B397 is not set 680# CONFIG_SENSORS_SMSC47B397 is not set
739# CONFIG_SENSORS_VIA686A is not set
740# CONFIG_SENSORS_W83781D is not set 681# CONFIG_SENSORS_W83781D is not set
741# CONFIG_SENSORS_W83792D is not set 682# CONFIG_SENSORS_W83792D is not set
742# CONFIG_SENSORS_W83L785TS is not set 683# CONFIG_SENSORS_W83L785TS is not set
@@ -776,14 +717,144 @@ CONFIG_HWMON=y
776# USB support 717# USB support
777# 718#
778CONFIG_USB_ARCH_HAS_HCD=y 719CONFIG_USB_ARCH_HAS_HCD=y
779CONFIG_USB_ARCH_HAS_OHCI=y 720# CONFIG_USB_ARCH_HAS_OHCI is not set
780# CONFIG_USB is not set 721CONFIG_USB=y
722CONFIG_USB_DEBUG=y
723
724#
725# Miscellaneous USB options
726#
727CONFIG_USB_DEVICEFS=y
728# CONFIG_USB_BANDWIDTH is not set
729CONFIG_USB_DYNAMIC_MINORS=y
730# CONFIG_USB_OTG is not set
731
732#
733# USB Host Controller Drivers
734#
735# CONFIG_USB_ISP116X_HCD is not set
736# CONFIG_USB_SL811_HCD is not set
737
738#
739# USB Device Class drivers
740#
741# CONFIG_USB_ACM is not set
742# CONFIG_USB_PRINTER is not set
781 743
782# 744#
783# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support' 745# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support'
784# 746#
785 747
786# 748#
749# may also be needed; see USB_STORAGE Help for more information
750#
751CONFIG_USB_STORAGE=y
752# CONFIG_USB_STORAGE_DEBUG is not set
753# CONFIG_USB_STORAGE_DATAFAB is not set
754# CONFIG_USB_STORAGE_FREECOM is not set
755# CONFIG_USB_STORAGE_DPCM is not set
756# CONFIG_USB_STORAGE_USBAT is not set
757# CONFIG_USB_STORAGE_SDDR09 is not set
758# CONFIG_USB_STORAGE_SDDR55 is not set
759# CONFIG_USB_STORAGE_JUMPSHOT is not set
760# CONFIG_USB_STORAGE_ALAUDA is not set
761# CONFIG_USB_LIBUSUAL is not set
762
763#
764# USB Input Devices
765#
766# CONFIG_USB_HID is not set
767
768#
769# USB HID Boot Protocol drivers
770#
771
772#
773# USB Imaging devices
774#
775# CONFIG_USB_MDC800 is not set
776# CONFIG_USB_MICROTEK is not set
777
778#
779# USB Multimedia devices
780#
781# CONFIG_USB_DABUSB is not set
782
783#
784# Video4Linux support is needed for USB Multimedia device support
785#
786
787#
788# USB Network Adapters
789#
790# CONFIG_USB_CATC is not set
791# CONFIG_USB_KAWETH is not set
792# CONFIG_USB_PEGASUS is not set
793CONFIG_USB_RTL8150=y
794# CONFIG_USB_USBNET is not set
795# CONFIG_USB_MON is not set
796
797#
798# USB port drivers
799#
800
801#
802# USB Serial Converter support
803#
804CONFIG_USB_SERIAL=y
805CONFIG_USB_SERIAL_CONSOLE=y
806# CONFIG_USB_SERIAL_GENERIC is not set
807# CONFIG_USB_SERIAL_AIRPRIME is not set
808# CONFIG_USB_SERIAL_ANYDATA is not set
809# CONFIG_USB_SERIAL_BELKIN is not set
810# CONFIG_USB_SERIAL_WHITEHEAT is not set
811# CONFIG_USB_SERIAL_DIGI_ACCELEPORT is not set
812# CONFIG_USB_SERIAL_CP2101 is not set
813# CONFIG_USB_SERIAL_CYPRESS_M8 is not set
814# CONFIG_USB_SERIAL_EMPEG is not set
815# CONFIG_USB_SERIAL_FTDI_SIO is not set
816# CONFIG_USB_SERIAL_VISOR is not set
817# CONFIG_USB_SERIAL_IPAQ is not set
818# CONFIG_USB_SERIAL_IR is not set
819# CONFIG_USB_SERIAL_EDGEPORT is not set
820# CONFIG_USB_SERIAL_EDGEPORT_TI is not set
821# CONFIG_USB_SERIAL_GARMIN is not set
822# CONFIG_USB_SERIAL_IPW is not set
823# CONFIG_USB_SERIAL_KEYSPAN_PDA is not set
824# CONFIG_USB_SERIAL_KEYSPAN is not set
825# CONFIG_USB_SERIAL_KLSI is not set
826# CONFIG_USB_SERIAL_KOBIL_SCT is not set
827# CONFIG_USB_SERIAL_MCT_U232 is not set
828CONFIG_USB_SERIAL_PL2303=y
829# CONFIG_USB_SERIAL_HP4X is not set
830# CONFIG_USB_SERIAL_SAFE is not set
831# CONFIG_USB_SERIAL_TI is not set
832# CONFIG_USB_SERIAL_CYBERJACK is not set
833# CONFIG_USB_SERIAL_XIRCOM is not set
834# CONFIG_USB_SERIAL_OMNINET is not set
835
836#
837# USB Miscellaneous drivers
838#
839# CONFIG_USB_EMI62 is not set
840# CONFIG_USB_EMI26 is not set
841# CONFIG_USB_AUERSWALD is not set
842# CONFIG_USB_RIO500 is not set
843# CONFIG_USB_LEGOTOWER is not set
844# CONFIG_USB_LCD is not set
845# CONFIG_USB_LED is not set
846# CONFIG_USB_CYTHERM is not set
847# CONFIG_USB_PHIDGETKIT is not set
848# CONFIG_USB_PHIDGETSERVO is not set
849# CONFIG_USB_IDMOUSE is not set
850# CONFIG_USB_LD is not set
851# CONFIG_USB_TEST is not set
852
853#
854# USB DSL modem support
855#
856
857#
787# USB Gadget Support 858# USB Gadget Support
788# 859#
789# CONFIG_USB_GADGET is not set 860# CONFIG_USB_GADGET is not set
@@ -797,21 +868,17 @@ CONFIG_USB_ARCH_HAS_OHCI=y
797# File systems 868# File systems
798# 869#
799CONFIG_EXT2_FS=y 870CONFIG_EXT2_FS=y
800CONFIG_EXT2_FS_XATTR=y 871# CONFIG_EXT2_FS_XATTR is not set
801CONFIG_EXT2_FS_POSIX_ACL=y
802# CONFIG_EXT2_FS_SECURITY is not set
803# CONFIG_EXT2_FS_XIP is not set 872# CONFIG_EXT2_FS_XIP is not set
804CONFIG_EXT3_FS=y 873CONFIG_EXT3_FS=y
805CONFIG_EXT3_FS_XATTR=y 874# CONFIG_EXT3_FS_XATTR is not set
806CONFIG_EXT3_FS_POSIX_ACL=y
807# CONFIG_EXT3_FS_SECURITY is not set
808CONFIG_JBD=y 875CONFIG_JBD=y
809# CONFIG_JBD_DEBUG is not set 876# CONFIG_JBD_DEBUG is not set
810CONFIG_FS_MBCACHE=y
811# CONFIG_REISERFS_FS is not set 877# CONFIG_REISERFS_FS is not set
812# CONFIG_JFS_FS is not set 878# CONFIG_JFS_FS is not set
813CONFIG_FS_POSIX_ACL=y 879# CONFIG_FS_POSIX_ACL is not set
814# CONFIG_XFS_FS is not set 880# CONFIG_XFS_FS is not set
881# CONFIG_OCFS2_FS is not set
815# CONFIG_MINIX_FS is not set 882# CONFIG_MINIX_FS is not set
816# CONFIG_ROMFS_FS is not set 883# CONFIG_ROMFS_FS is not set
817CONFIG_INOTIFY=y 884CONFIG_INOTIFY=y
@@ -830,8 +897,11 @@ CONFIG_DNOTIFY=y
830# 897#
831# DOS/FAT/NT Filesystems 898# DOS/FAT/NT Filesystems
832# 899#
900CONFIG_FAT_FS=y
833# CONFIG_MSDOS_FS is not set 901# CONFIG_MSDOS_FS is not set
834# CONFIG_VFAT_FS is not set 902CONFIG_VFAT_FS=y
903CONFIG_FAT_DEFAULT_CODEPAGE=437
904CONFIG_FAT_DEFAULT_IOCHARSET="iso8859-1"
835# CONFIG_NTFS_FS is not set 905# CONFIG_NTFS_FS is not set
836 906
837# 907#
@@ -843,6 +913,7 @@ CONFIG_TMPFS=y
843# CONFIG_HUGETLB_PAGE is not set 913# CONFIG_HUGETLB_PAGE is not set
844CONFIG_RAMFS=y 914CONFIG_RAMFS=y
845# CONFIG_RELAYFS_FS is not set 915# CONFIG_RELAYFS_FS is not set
916# CONFIG_CONFIGFS_FS is not set
846 917
847# 918#
848# Miscellaneous filesystems 919# Miscellaneous filesystems
@@ -911,12 +982,52 @@ CONFIG_MSDOS_PARTITION=y
911# CONFIG_SGI_PARTITION is not set 982# CONFIG_SGI_PARTITION is not set
912# CONFIG_ULTRIX_PARTITION is not set 983# CONFIG_ULTRIX_PARTITION is not set
913# CONFIG_SUN_PARTITION is not set 984# CONFIG_SUN_PARTITION is not set
985# CONFIG_KARMA_PARTITION is not set
914# CONFIG_EFI_PARTITION is not set 986# CONFIG_EFI_PARTITION is not set
915 987
916# 988#
917# Native Language Support 989# Native Language Support
918# 990#
919# CONFIG_NLS is not set 991CONFIG_NLS=y
992CONFIG_NLS_DEFAULT="iso8859-1"
993CONFIG_NLS_CODEPAGE_437=y
994# CONFIG_NLS_CODEPAGE_737 is not set
995# CONFIG_NLS_CODEPAGE_775 is not set
996# CONFIG_NLS_CODEPAGE_850 is not set
997# CONFIG_NLS_CODEPAGE_852 is not set
998# CONFIG_NLS_CODEPAGE_855 is not set
999# CONFIG_NLS_CODEPAGE_857 is not set
1000# CONFIG_NLS_CODEPAGE_860 is not set
1001# CONFIG_NLS_CODEPAGE_861 is not set
1002# CONFIG_NLS_CODEPAGE_862 is not set
1003# CONFIG_NLS_CODEPAGE_863 is not set
1004# CONFIG_NLS_CODEPAGE_864 is not set
1005# CONFIG_NLS_CODEPAGE_865 is not set
1006# CONFIG_NLS_CODEPAGE_866 is not set
1007# CONFIG_NLS_CODEPAGE_869 is not set
1008# CONFIG_NLS_CODEPAGE_936 is not set
1009# CONFIG_NLS_CODEPAGE_950 is not set
1010# CONFIG_NLS_CODEPAGE_932 is not set
1011# CONFIG_NLS_CODEPAGE_949 is not set
1012# CONFIG_NLS_CODEPAGE_874 is not set
1013# CONFIG_NLS_ISO8859_8 is not set
1014# CONFIG_NLS_CODEPAGE_1250 is not set
1015# CONFIG_NLS_CODEPAGE_1251 is not set
1016# CONFIG_NLS_ASCII is not set
1017CONFIG_NLS_ISO8859_1=y
1018# CONFIG_NLS_ISO8859_2 is not set
1019# CONFIG_NLS_ISO8859_3 is not set
1020# CONFIG_NLS_ISO8859_4 is not set
1021# CONFIG_NLS_ISO8859_5 is not set
1022# CONFIG_NLS_ISO8859_6 is not set
1023# CONFIG_NLS_ISO8859_7 is not set
1024# CONFIG_NLS_ISO8859_9 is not set
1025# CONFIG_NLS_ISO8859_13 is not set
1026# CONFIG_NLS_ISO8859_14 is not set
1027# CONFIG_NLS_ISO8859_15 is not set
1028# CONFIG_NLS_KOI8_R is not set
1029# CONFIG_NLS_KOI8_U is not set
1030# CONFIG_NLS_UTF8 is not set
920 1031
921# 1032#
922# Profiling support 1033# Profiling support
@@ -927,13 +1038,14 @@ CONFIG_MSDOS_PARTITION=y
927# Kernel hacking 1038# Kernel hacking
928# 1039#
929# CONFIG_PRINTK_TIME is not set 1040# CONFIG_PRINTK_TIME is not set
930CONFIG_DEBUG_KERNEL=y
931CONFIG_MAGIC_SYSRQ=y 1041CONFIG_MAGIC_SYSRQ=y
1042CONFIG_DEBUG_KERNEL=y
932CONFIG_LOG_BUF_SHIFT=14 1043CONFIG_LOG_BUF_SHIFT=14
933CONFIG_DETECT_SOFTLOCKUP=y 1044CONFIG_DETECT_SOFTLOCKUP=y
934# CONFIG_SCHEDSTATS is not set 1045# CONFIG_SCHEDSTATS is not set
935# CONFIG_DEBUG_SLAB is not set 1046CONFIG_DEBUG_SLAB=y
936# CONFIG_DEBUG_SPINLOCK is not set 1047CONFIG_DEBUG_MUTEXES=y
1048CONFIG_DEBUG_SPINLOCK=y
937# CONFIG_DEBUG_SPINLOCK_SLEEP is not set 1049# CONFIG_DEBUG_SPINLOCK_SLEEP is not set
938# CONFIG_DEBUG_KOBJECT is not set 1050# CONFIG_DEBUG_KOBJECT is not set
939CONFIG_DEBUG_BUGVERBOSE=y 1051CONFIG_DEBUG_BUGVERBOSE=y
@@ -941,9 +1053,10 @@ CONFIG_DEBUG_BUGVERBOSE=y
941# CONFIG_DEBUG_FS is not set 1053# CONFIG_DEBUG_FS is not set
942# CONFIG_DEBUG_VM is not set 1054# CONFIG_DEBUG_VM is not set
943CONFIG_FRAME_POINTER=y 1055CONFIG_FRAME_POINTER=y
1056CONFIG_FORCED_INLINING=y
944# CONFIG_RCU_TORTURE_TEST is not set 1057# CONFIG_RCU_TORTURE_TEST is not set
945CONFIG_DEBUG_USER=y 1058CONFIG_DEBUG_USER=y
946# CONFIG_DEBUG_WAITQ is not set 1059CONFIG_DEBUG_WAITQ=y
947CONFIG_DEBUG_ERRORS=y 1060CONFIG_DEBUG_ERRORS=y
948CONFIG_DEBUG_LL=y 1061CONFIG_DEBUG_LL=y
949# CONFIG_DEBUG_ICEDCC is not set 1062# CONFIG_DEBUG_ICEDCC is not set
@@ -969,6 +1082,6 @@ CONFIG_DEBUG_LL=y
969# CONFIG_CRC_CCITT is not set 1082# CONFIG_CRC_CCITT is not set
970# CONFIG_CRC16 is not set 1083# CONFIG_CRC16 is not set
971CONFIG_CRC32=y 1084CONFIG_CRC32=y
972# CONFIG_LIBCRC32C is not set 1085CONFIG_LIBCRC32C=y
973CONFIG_ZLIB_INFLATE=y 1086CONFIG_ZLIB_INFLATE=y
974CONFIG_ZLIB_DEFLATE=y 1087CONFIG_ZLIB_DEFLATE=y
diff --git a/arch/arm/configs/ixdp2401_defconfig b/arch/arm/configs/ixdp2401_defconfig
deleted file mode 100644
index 60d66e82c51f..000000000000
--- a/arch/arm/configs/ixdp2401_defconfig
+++ /dev/null
@@ -1,976 +0,0 @@
1#
2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.14-git13
4# Thu Nov 10 15:14:50 2005
5#
6CONFIG_ARM=y
7CONFIG_MMU=y
8CONFIG_UID16=y
9CONFIG_RWSEM_GENERIC_SPINLOCK=y
10CONFIG_GENERIC_CALIBRATE_DELAY=y
11
12#
13# Code maturity level options
14#
15CONFIG_EXPERIMENTAL=y
16CONFIG_CLEAN_COMPILE=y
17CONFIG_BROKEN_ON_SMP=y
18CONFIG_INIT_ENV_ARG_LIMIT=32
19
20#
21# General setup
22#
23CONFIG_LOCALVERSION=""
24CONFIG_LOCALVERSION_AUTO=y
25CONFIG_SWAP=y
26CONFIG_SYSVIPC=y
27# CONFIG_POSIX_MQUEUE is not set
28CONFIG_BSD_PROCESS_ACCT=y
29# CONFIG_BSD_PROCESS_ACCT_V3 is not set
30CONFIG_SYSCTL=y
31# CONFIG_AUDIT is not set
32# CONFIG_HOTPLUG is not set
33CONFIG_KOBJECT_UEVENT=y
34# CONFIG_IKCONFIG is not set
35CONFIG_INITRAMFS_SOURCE=""
36CONFIG_EMBEDDED=y
37CONFIG_KALLSYMS=y
38# CONFIG_KALLSYMS_ALL is not set
39# CONFIG_KALLSYMS_EXTRA_PASS is not set
40CONFIG_PRINTK=y
41CONFIG_BUG=y
42CONFIG_BASE_FULL=y
43CONFIG_FUTEX=y
44CONFIG_EPOLL=y
45CONFIG_CC_OPTIMIZE_FOR_SIZE=y
46CONFIG_SHMEM=y
47CONFIG_CC_ALIGN_FUNCTIONS=0
48CONFIG_CC_ALIGN_LABELS=0
49CONFIG_CC_ALIGN_LOOPS=0
50CONFIG_CC_ALIGN_JUMPS=0
51# CONFIG_TINY_SHMEM is not set
52CONFIG_BASE_SMALL=0
53
54#
55# Loadable module support
56#
57CONFIG_MODULES=y
58CONFIG_MODULE_UNLOAD=y
59# CONFIG_MODULE_FORCE_UNLOAD is not set
60CONFIG_OBSOLETE_MODPARM=y
61# CONFIG_MODVERSIONS is not set
62# CONFIG_MODULE_SRCVERSION_ALL is not set
63CONFIG_KMOD=y
64
65#
66# Block layer
67#
68
69#
70# IO Schedulers
71#
72CONFIG_IOSCHED_NOOP=y
73CONFIG_IOSCHED_AS=y
74CONFIG_IOSCHED_DEADLINE=y
75CONFIG_IOSCHED_CFQ=y
76CONFIG_DEFAULT_AS=y
77# CONFIG_DEFAULT_DEADLINE is not set
78# CONFIG_DEFAULT_CFQ is not set
79# CONFIG_DEFAULT_NOOP is not set
80CONFIG_DEFAULT_IOSCHED="anticipatory"
81
82#
83# System Type
84#
85# CONFIG_ARCH_CLPS7500 is not set
86# CONFIG_ARCH_CLPS711X is not set
87# CONFIG_ARCH_CO285 is not set
88# CONFIG_ARCH_EBSA110 is not set
89# CONFIG_ARCH_FOOTBRIDGE is not set
90# CONFIG_ARCH_INTEGRATOR is not set
91# CONFIG_ARCH_IOP3XX is not set
92# CONFIG_ARCH_IXP4XX is not set
93CONFIG_ARCH_IXP2000=y
94# CONFIG_ARCH_L7200 is not set
95# CONFIG_ARCH_PXA is not set
96# CONFIG_ARCH_RPC is not set
97# CONFIG_ARCH_SA1100 is not set
98# CONFIG_ARCH_S3C2410 is not set
99# CONFIG_ARCH_SHARK is not set
100# CONFIG_ARCH_LH7A40X is not set
101# CONFIG_ARCH_OMAP is not set
102# CONFIG_ARCH_VERSATILE is not set
103# CONFIG_ARCH_REALVIEW is not set
104# CONFIG_ARCH_IMX is not set
105# CONFIG_ARCH_H720X is not set
106# CONFIG_ARCH_AAEC2000 is not set
107CONFIG_ARCH_SUPPORTS_BIG_ENDIAN=y
108
109#
110# Intel IXP2400/2800 Implementation Options
111#
112
113#
114# IXP2400/2800 Platforms
115#
116# CONFIG_ARCH_ENP2611 is not set
117# CONFIG_ARCH_IXDP2400 is not set
118# CONFIG_ARCH_IXDP2800 is not set
119CONFIG_ARCH_IXDP2401=y
120# CONFIG_ARCH_IXDP2801 is not set
121CONFIG_ARCH_IXDP2X01=y
122# CONFIG_IXP2000_SUPPORT_BROKEN_PCI_IO is not set
123
124#
125# Processor Type
126#
127CONFIG_CPU_32=y
128CONFIG_CPU_XSCALE=y
129CONFIG_CPU_32v5=y
130CONFIG_CPU_ABRT_EV5T=y
131CONFIG_CPU_CACHE_VIVT=y
132CONFIG_CPU_TLB_V4WBI=y
133
134#
135# Processor Features
136#
137# CONFIG_ARM_THUMB is not set
138CONFIG_CPU_BIG_ENDIAN=y
139CONFIG_XSCALE_PMU=y
140
141#
142# Bus support
143#
144CONFIG_ISA_DMA_API=y
145CONFIG_PCI=y
146CONFIG_PCI_LEGACY_PROC=y
147# CONFIG_PCI_DEBUG is not set
148
149#
150# PCCARD (PCMCIA/CardBus) support
151#
152# CONFIG_PCCARD is not set
153
154#
155# Kernel Features
156#
157# CONFIG_PREEMPT is not set
158# CONFIG_NO_IDLE_HZ is not set
159# CONFIG_ARCH_DISCONTIGMEM_ENABLE is not set
160CONFIG_SELECT_MEMORY_MODEL=y
161CONFIG_FLATMEM_MANUAL=y
162# CONFIG_DISCONTIGMEM_MANUAL is not set
163# CONFIG_SPARSEMEM_MANUAL is not set
164CONFIG_FLATMEM=y
165CONFIG_FLAT_NODE_MEM_MAP=y
166# CONFIG_SPARSEMEM_STATIC is not set
167CONFIG_SPLIT_PTLOCK_CPUS=4096
168CONFIG_ALIGNMENT_TRAP=y
169
170#
171# Boot options
172#
173CONFIG_ZBOOT_ROM_TEXT=0x0
174CONFIG_ZBOOT_ROM_BSS=0x0
175CONFIG_CMDLINE="console=ttyS0,115200 root=/dev/nfs ip=bootp mem=64M@0x0"
176# CONFIG_XIP_KERNEL is not set
177
178#
179# Floating point emulation
180#
181
182#
183# At least one emulation must be selected
184#
185CONFIG_FPE_NWFPE=y
186CONFIG_FPE_NWFPE_XP=y
187# CONFIG_FPE_FASTFPE is not set
188
189#
190# Userspace binary formats
191#
192CONFIG_BINFMT_ELF=y
193# CONFIG_BINFMT_AOUT is not set
194# CONFIG_BINFMT_MISC is not set
195# CONFIG_ARTHUR is not set
196
197#
198# Power management options
199#
200# CONFIG_PM is not set
201
202#
203# Networking
204#
205CONFIG_NET=y
206
207#
208# Networking options
209#
210CONFIG_PACKET=y
211CONFIG_PACKET_MMAP=y
212CONFIG_UNIX=y
213# CONFIG_NET_KEY is not set
214CONFIG_INET=y
215# CONFIG_IP_MULTICAST is not set
216# CONFIG_IP_ADVANCED_ROUTER is not set
217CONFIG_IP_FIB_HASH=y
218CONFIG_IP_PNP=y
219CONFIG_IP_PNP_DHCP=y
220CONFIG_IP_PNP_BOOTP=y
221# CONFIG_IP_PNP_RARP is not set
222# CONFIG_NET_IPIP is not set
223# CONFIG_NET_IPGRE is not set
224# CONFIG_ARPD is not set
225CONFIG_SYN_COOKIES=y
226# CONFIG_INET_AH is not set
227# CONFIG_INET_ESP is not set
228# CONFIG_INET_IPCOMP is not set
229# CONFIG_INET_TUNNEL is not set
230CONFIG_INET_DIAG=y
231CONFIG_INET_TCP_DIAG=y
232# CONFIG_TCP_CONG_ADVANCED is not set
233CONFIG_TCP_CONG_BIC=y
234# CONFIG_IPV6 is not set
235# CONFIG_NETFILTER is not set
236
237#
238# DCCP Configuration (EXPERIMENTAL)
239#
240# CONFIG_IP_DCCP is not set
241
242#
243# SCTP Configuration (EXPERIMENTAL)
244#
245# CONFIG_IP_SCTP is not set
246# CONFIG_ATM is not set
247# CONFIG_BRIDGE is not set
248# CONFIG_VLAN_8021Q is not set
249# CONFIG_DECNET is not set
250# CONFIG_LLC2 is not set
251# CONFIG_IPX is not set
252# CONFIG_ATALK is not set
253# CONFIG_X25 is not set
254# CONFIG_LAPB is not set
255# CONFIG_NET_DIVERT is not set
256# CONFIG_ECONET is not set
257# CONFIG_WAN_ROUTER is not set
258
259#
260# QoS and/or fair queueing
261#
262# CONFIG_NET_SCHED is not set
263# CONFIG_NET_CLS_ROUTE is not set
264
265#
266# Network testing
267#
268# CONFIG_NET_PKTGEN is not set
269# CONFIG_HAMRADIO is not set
270# CONFIG_IRDA is not set
271# CONFIG_BT is not set
272# CONFIG_IEEE80211 is not set
273
274#
275# Device Drivers
276#
277
278#
279# Generic Driver Options
280#
281CONFIG_STANDALONE=y
282# CONFIG_PREVENT_FIRMWARE_BUILD is not set
283# CONFIG_FW_LOADER is not set
284# CONFIG_DEBUG_DRIVER is not set
285
286#
287# Memory Technology Devices (MTD)
288#
289CONFIG_MTD=y
290# CONFIG_MTD_DEBUG is not set
291# CONFIG_MTD_CONCAT is not set
292CONFIG_MTD_PARTITIONS=y
293CONFIG_MTD_REDBOOT_PARTS=y
294CONFIG_MTD_REDBOOT_DIRECTORY_BLOCK=-1
295CONFIG_MTD_REDBOOT_PARTS_UNALLOCATED=y
296CONFIG_MTD_REDBOOT_PARTS_READONLY=y
297# CONFIG_MTD_CMDLINE_PARTS is not set
298# CONFIG_MTD_AFS_PARTS is not set
299
300#
301# User Modules And Translation Layers
302#
303CONFIG_MTD_CHAR=y
304CONFIG_MTD_BLOCK=y
305# CONFIG_FTL is not set
306# CONFIG_NFTL is not set
307# CONFIG_INFTL is not set
308# CONFIG_RFD_FTL is not set
309
310#
311# RAM/ROM/Flash chip drivers
312#
313CONFIG_MTD_CFI=y
314# CONFIG_MTD_JEDECPROBE is not set
315CONFIG_MTD_GEN_PROBE=y
316# CONFIG_MTD_CFI_ADV_OPTIONS is not set
317CONFIG_MTD_MAP_BANK_WIDTH_1=y
318CONFIG_MTD_MAP_BANK_WIDTH_2=y
319CONFIG_MTD_MAP_BANK_WIDTH_4=y
320# CONFIG_MTD_MAP_BANK_WIDTH_8 is not set
321# CONFIG_MTD_MAP_BANK_WIDTH_16 is not set
322# CONFIG_MTD_MAP_BANK_WIDTH_32 is not set
323CONFIG_MTD_CFI_I1=y
324CONFIG_MTD_CFI_I2=y
325# CONFIG_MTD_CFI_I4 is not set
326# CONFIG_MTD_CFI_I8 is not set
327CONFIG_MTD_CFI_INTELEXT=y
328# CONFIG_MTD_CFI_AMDSTD is not set
329# CONFIG_MTD_CFI_STAA is not set
330CONFIG_MTD_CFI_UTIL=y
331# CONFIG_MTD_RAM is not set
332# CONFIG_MTD_ROM is not set
333# CONFIG_MTD_ABSENT is not set
334# CONFIG_MTD_XIP is not set
335
336#
337# Mapping drivers for chip access
338#
339CONFIG_MTD_COMPLEX_MAPPINGS=y
340# CONFIG_MTD_PHYSMAP is not set
341# CONFIG_MTD_ARM_INTEGRATOR is not set
342CONFIG_MTD_IXP2000=y
343# CONFIG_MTD_PCI is not set
344# CONFIG_MTD_PLATRAM is not set
345
346#
347# Self-contained MTD device drivers
348#
349# CONFIG_MTD_PMC551 is not set
350# CONFIG_MTD_SLRAM is not set
351# CONFIG_MTD_PHRAM is not set
352# CONFIG_MTD_MTDRAM is not set
353# CONFIG_MTD_BLKMTD is not set
354# CONFIG_MTD_BLOCK2MTD is not set
355
356#
357# Disk-On-Chip Device Drivers
358#
359# CONFIG_MTD_DOC2000 is not set
360# CONFIG_MTD_DOC2001 is not set
361# CONFIG_MTD_DOC2001PLUS is not set
362
363#
364# NAND Flash Device Drivers
365#
366# CONFIG_MTD_NAND is not set
367
368#
369# OneNAND Flash Device Drivers
370#
371# CONFIG_MTD_ONENAND is not set
372
373#
374# Parallel port support
375#
376# CONFIG_PARPORT is not set
377
378#
379# Plug and Play support
380#
381
382#
383# Block devices
384#
385# CONFIG_BLK_CPQ_DA is not set
386# CONFIG_BLK_CPQ_CISS_DA is not set
387# CONFIG_BLK_DEV_DAC960 is not set
388# CONFIG_BLK_DEV_UMEM is not set
389# CONFIG_BLK_DEV_COW_COMMON is not set
390CONFIG_BLK_DEV_LOOP=y
391# CONFIG_BLK_DEV_CRYPTOLOOP is not set
392# CONFIG_BLK_DEV_NBD is not set
393# CONFIG_BLK_DEV_SX8 is not set
394CONFIG_BLK_DEV_RAM=y
395CONFIG_BLK_DEV_RAM_COUNT=16
396CONFIG_BLK_DEV_RAM_SIZE=8192
397CONFIG_BLK_DEV_INITRD=y
398# CONFIG_CDROM_PKTCDVD is not set
399# CONFIG_ATA_OVER_ETH is not set
400
401#
402# SCSI device support
403#
404# CONFIG_RAID_ATTRS is not set
405# CONFIG_SCSI is not set
406
407#
408# Multi-device support (RAID and LVM)
409#
410# CONFIG_MD is not set
411
412#
413# Fusion MPT device support
414#
415# CONFIG_FUSION is not set
416
417#
418# IEEE 1394 (FireWire) support
419#
420# CONFIG_IEEE1394 is not set
421
422#
423# I2O device support
424#
425# CONFIG_I2O is not set
426
427#
428# Network device support
429#
430CONFIG_NETDEVICES=y
431CONFIG_DUMMY=y
432# CONFIG_BONDING is not set
433# CONFIG_EQUALIZER is not set
434# CONFIG_TUN is not set
435
436#
437# ARCnet devices
438#
439# CONFIG_ARCNET is not set
440
441#
442# PHY device support
443#
444# CONFIG_PHYLIB is not set
445
446#
447# Ethernet (10 or 100Mbit)
448#
449CONFIG_NET_ETHERNET=y
450CONFIG_MII=y
451# CONFIG_HAPPYMEAL is not set
452# CONFIG_SUNGEM is not set
453# CONFIG_CASSINI is not set
454# CONFIG_NET_VENDOR_3COM is not set
455# CONFIG_SMC91X is not set
456# CONFIG_DM9000 is not set
457
458#
459# Tulip family network device support
460#
461# CONFIG_NET_TULIP is not set
462# CONFIG_HP100 is not set
463CONFIG_NET_PCI=y
464# CONFIG_PCNET32 is not set
465# CONFIG_AMD8111_ETH is not set
466# CONFIG_ADAPTEC_STARFIRE is not set
467# CONFIG_B44 is not set
468# CONFIG_FORCEDETH is not set
469CONFIG_CS89x0=y
470# CONFIG_DGRS is not set
471CONFIG_EEPRO100=y
472# CONFIG_E100 is not set
473# CONFIG_FEALNX is not set
474# CONFIG_NATSEMI is not set
475# CONFIG_NE2K_PCI is not set
476# CONFIG_8139CP is not set
477# CONFIG_8139TOO is not set
478# CONFIG_SIS900 is not set
479# CONFIG_EPIC100 is not set
480# CONFIG_SUNDANCE is not set
481# CONFIG_TLAN is not set
482# CONFIG_VIA_RHINE is not set
483
484#
485# Ethernet (1000 Mbit)
486#
487# CONFIG_ACENIC is not set
488# CONFIG_DL2K is not set
489# CONFIG_E1000 is not set
490# CONFIG_NS83820 is not set
491# CONFIG_HAMACHI is not set
492# CONFIG_YELLOWFIN is not set
493# CONFIG_R8169 is not set
494# CONFIG_SIS190 is not set
495# CONFIG_SKGE is not set
496# CONFIG_SK98LIN is not set
497# CONFIG_VIA_VELOCITY is not set
498# CONFIG_TIGON3 is not set
499# CONFIG_BNX2 is not set
500
501#
502# Ethernet (10000 Mbit)
503#
504# CONFIG_CHELSIO_T1 is not set
505# CONFIG_IXGB is not set
506# CONFIG_S2IO is not set
507
508#
509# Token Ring devices
510#
511# CONFIG_TR is not set
512
513#
514# Wireless LAN (non-hamradio)
515#
516# CONFIG_NET_RADIO is not set
517
518#
519# Wan interfaces
520#
521CONFIG_WAN=y
522# CONFIG_DSCC4 is not set
523# CONFIG_LANMEDIA is not set
524# CONFIG_SYNCLINK_SYNCPPP is not set
525CONFIG_HDLC=y
526CONFIG_HDLC_RAW=y
527# CONFIG_HDLC_RAW_ETH is not set
528CONFIG_HDLC_CISCO=y
529CONFIG_HDLC_FR=y
530CONFIG_HDLC_PPP=y
531
532#
533# X.25/LAPB support is disabled
534#
535# CONFIG_PCI200SYN is not set
536# CONFIG_WANXL is not set
537# CONFIG_PC300 is not set
538# CONFIG_FARSYNC is not set
539CONFIG_DLCI=y
540CONFIG_DLCI_COUNT=24
541CONFIG_DLCI_MAX=8
542# CONFIG_FDDI is not set
543# CONFIG_HIPPI is not set
544# CONFIG_PPP is not set
545# CONFIG_SLIP is not set
546# CONFIG_SHAPER is not set
547# CONFIG_NETCONSOLE is not set
548# CONFIG_NETPOLL is not set
549# CONFIG_NET_POLL_CONTROLLER is not set
550
551#
552# ISDN subsystem
553#
554# CONFIG_ISDN is not set
555
556#
557# Input device support
558#
559CONFIG_INPUT=y
560
561#
562# Userland interfaces
563#
564CONFIG_INPUT_MOUSEDEV=y
565CONFIG_INPUT_MOUSEDEV_PSAUX=y
566CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024
567CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768
568# CONFIG_INPUT_JOYDEV is not set
569# CONFIG_INPUT_TSDEV is not set
570# CONFIG_INPUT_EVDEV is not set
571# CONFIG_INPUT_EVBUG is not set
572
573#
574# Input Device Drivers
575#
576# CONFIG_INPUT_KEYBOARD is not set
577# CONFIG_INPUT_MOUSE is not set
578# CONFIG_INPUT_JOYSTICK is not set
579# CONFIG_INPUT_TOUCHSCREEN is not set
580# CONFIG_INPUT_MISC is not set
581
582#
583# Hardware I/O ports
584#
585# CONFIG_SERIO is not set
586# CONFIG_GAMEPORT is not set
587
588#
589# Character devices
590#
591# CONFIG_VT is not set
592# CONFIG_SERIAL_NONSTANDARD is not set
593
594#
595# Serial drivers
596#
597CONFIG_SERIAL_8250=y
598CONFIG_SERIAL_8250_CONSOLE=y
599CONFIG_SERIAL_8250_NR_UARTS=3
600# CONFIG_SERIAL_8250_EXTENDED is not set
601
602#
603# Non-8250 serial port support
604#
605CONFIG_SERIAL_CORE=y
606CONFIG_SERIAL_CORE_CONSOLE=y
607# CONFIG_SERIAL_JSM is not set
608CONFIG_UNIX98_PTYS=y
609CONFIG_LEGACY_PTYS=y
610CONFIG_LEGACY_PTY_COUNT=256
611
612#
613# IPMI
614#
615# CONFIG_IPMI_HANDLER is not set
616
617#
618# Watchdog Cards
619#
620CONFIG_WATCHDOG=y
621# CONFIG_WATCHDOG_NOWAYOUT is not set
622
623#
624# Watchdog Device Drivers
625#
626# CONFIG_SOFT_WATCHDOG is not set
627CONFIG_IXP2000_WATCHDOG=y
628
629#
630# PCI-based Watchdog Cards
631#
632# CONFIG_PCIPCWATCHDOG is not set
633# CONFIG_WDTPCI is not set
634# CONFIG_NVRAM is not set
635# CONFIG_RTC is not set
636# CONFIG_DTLK is not set
637# CONFIG_R3964 is not set
638# CONFIG_APPLICOM is not set
639
640#
641# Ftape, the floppy tape device driver
642#
643# CONFIG_DRM is not set
644# CONFIG_RAW_DRIVER is not set
645
646#
647# TPM devices
648#
649# CONFIG_TCG_TPM is not set
650# CONFIG_TELCLOCK is not set
651
652#
653# I2C support
654#
655CONFIG_I2C=y
656CONFIG_I2C_CHARDEV=y
657
658#
659# I2C Algorithms
660#
661CONFIG_I2C_ALGOBIT=y
662# CONFIG_I2C_ALGOPCF is not set
663# CONFIG_I2C_ALGOPCA is not set
664
665#
666# I2C Hardware Bus support
667#
668# CONFIG_I2C_ALI1535 is not set
669# CONFIG_I2C_ALI1563 is not set
670# CONFIG_I2C_ALI15X3 is not set
671# CONFIG_I2C_AMD756 is not set
672# CONFIG_I2C_AMD8111 is not set
673# CONFIG_I2C_I801 is not set
674# CONFIG_I2C_I810 is not set
675# CONFIG_I2C_PIIX4 is not set
676CONFIG_I2C_IXP2000=y
677# CONFIG_I2C_NFORCE2 is not set
678# CONFIG_I2C_PARPORT_LIGHT is not set
679# CONFIG_I2C_PROSAVAGE is not set
680# CONFIG_I2C_SAVAGE4 is not set
681# CONFIG_SCx200_ACB is not set
682# CONFIG_I2C_SIS5595 is not set
683# CONFIG_I2C_SIS630 is not set
684# CONFIG_I2C_SIS96X is not set
685# CONFIG_I2C_STUB is not set
686# CONFIG_I2C_VIA is not set
687# CONFIG_I2C_VIAPRO is not set
688# CONFIG_I2C_VOODOO3 is not set
689# CONFIG_I2C_PCA_ISA is not set
690
691#
692# Miscellaneous I2C Chip support
693#
694# CONFIG_SENSORS_DS1337 is not set
695# CONFIG_SENSORS_DS1374 is not set
696CONFIG_SENSORS_EEPROM=y
697# CONFIG_SENSORS_PCF8574 is not set
698# CONFIG_SENSORS_PCA9539 is not set
699# CONFIG_SENSORS_PCF8591 is not set
700# CONFIG_SENSORS_RTC8564 is not set
701# CONFIG_SENSORS_MAX6875 is not set
702# CONFIG_RTC_X1205_I2C is not set
703# CONFIG_I2C_DEBUG_CORE is not set
704# CONFIG_I2C_DEBUG_ALGO is not set
705# CONFIG_I2C_DEBUG_BUS is not set
706# CONFIG_I2C_DEBUG_CHIP is not set
707
708#
709# Hardware Monitoring support
710#
711CONFIG_HWMON=y
712# CONFIG_HWMON_VID is not set
713# CONFIG_SENSORS_ADM1021 is not set
714# CONFIG_SENSORS_ADM1025 is not set
715# CONFIG_SENSORS_ADM1026 is not set
716# CONFIG_SENSORS_ADM1031 is not set
717# CONFIG_SENSORS_ADM9240 is not set
718# CONFIG_SENSORS_ASB100 is not set
719# CONFIG_SENSORS_ATXP1 is not set
720# CONFIG_SENSORS_DS1621 is not set
721# CONFIG_SENSORS_FSCHER is not set
722# CONFIG_SENSORS_FSCPOS is not set
723# CONFIG_SENSORS_GL518SM is not set
724# CONFIG_SENSORS_GL520SM is not set
725# CONFIG_SENSORS_IT87 is not set
726# CONFIG_SENSORS_LM63 is not set
727# CONFIG_SENSORS_LM75 is not set
728# CONFIG_SENSORS_LM77 is not set
729# CONFIG_SENSORS_LM78 is not set
730# CONFIG_SENSORS_LM80 is not set
731# CONFIG_SENSORS_LM83 is not set
732# CONFIG_SENSORS_LM85 is not set
733# CONFIG_SENSORS_LM87 is not set
734# CONFIG_SENSORS_LM90 is not set
735# CONFIG_SENSORS_LM92 is not set
736# CONFIG_SENSORS_MAX1619 is not set
737# CONFIG_SENSORS_PC87360 is not set
738# CONFIG_SENSORS_SIS5595 is not set
739# CONFIG_SENSORS_SMSC47M1 is not set
740# CONFIG_SENSORS_SMSC47B397 is not set
741# CONFIG_SENSORS_VIA686A is not set
742# CONFIG_SENSORS_W83781D is not set
743# CONFIG_SENSORS_W83792D is not set
744# CONFIG_SENSORS_W83L785TS is not set
745# CONFIG_SENSORS_W83627HF is not set
746# CONFIG_SENSORS_W83627EHF is not set
747# CONFIG_HWMON_DEBUG_CHIP is not set
748
749#
750# Misc devices
751#
752
753#
754# Multimedia Capabilities Port drivers
755#
756
757#
758# Multimedia devices
759#
760# CONFIG_VIDEO_DEV is not set
761
762#
763# Digital Video Broadcasting Devices
764#
765# CONFIG_DVB is not set
766
767#
768# Graphics support
769#
770# CONFIG_FB is not set
771
772#
773# Sound
774#
775# CONFIG_SOUND is not set
776
777#
778# USB support
779#
780CONFIG_USB_ARCH_HAS_HCD=y
781CONFIG_USB_ARCH_HAS_OHCI=y
782# CONFIG_USB is not set
783
784#
785# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support'
786#
787
788#
789# USB Gadget Support
790#
791# CONFIG_USB_GADGET is not set
792
793#
794# MMC/SD Card support
795#
796# CONFIG_MMC is not set
797
798#
799# File systems
800#
801CONFIG_EXT2_FS=y
802CONFIG_EXT2_FS_XATTR=y
803CONFIG_EXT2_FS_POSIX_ACL=y
804# CONFIG_EXT2_FS_SECURITY is not set
805# CONFIG_EXT2_FS_XIP is not set
806CONFIG_EXT3_FS=y
807CONFIG_EXT3_FS_XATTR=y
808CONFIG_EXT3_FS_POSIX_ACL=y
809# CONFIG_EXT3_FS_SECURITY is not set
810CONFIG_JBD=y
811# CONFIG_JBD_DEBUG is not set
812CONFIG_FS_MBCACHE=y
813# CONFIG_REISERFS_FS is not set
814# CONFIG_JFS_FS is not set
815CONFIG_FS_POSIX_ACL=y
816# CONFIG_XFS_FS is not set
817# CONFIG_MINIX_FS is not set
818# CONFIG_ROMFS_FS is not set
819CONFIG_INOTIFY=y
820# CONFIG_QUOTA is not set
821CONFIG_DNOTIFY=y
822# CONFIG_AUTOFS_FS is not set
823# CONFIG_AUTOFS4_FS is not set
824# CONFIG_FUSE_FS is not set
825
826#
827# CD-ROM/DVD Filesystems
828#
829# CONFIG_ISO9660_FS is not set
830# CONFIG_UDF_FS is not set
831
832#
833# DOS/FAT/NT Filesystems
834#
835# CONFIG_MSDOS_FS is not set
836# CONFIG_VFAT_FS is not set
837# CONFIG_NTFS_FS is not set
838
839#
840# Pseudo filesystems
841#
842CONFIG_PROC_FS=y
843CONFIG_SYSFS=y
844CONFIG_TMPFS=y
845# CONFIG_HUGETLB_PAGE is not set
846CONFIG_RAMFS=y
847# CONFIG_RELAYFS_FS is not set
848
849#
850# Miscellaneous filesystems
851#
852# CONFIG_ADFS_FS is not set
853# CONFIG_AFFS_FS is not set
854# CONFIG_HFS_FS is not set
855# CONFIG_HFSPLUS_FS is not set
856# CONFIG_BEFS_FS is not set
857# CONFIG_BFS_FS is not set
858# CONFIG_EFS_FS is not set
859# CONFIG_JFFS_FS is not set
860CONFIG_JFFS2_FS=y
861CONFIG_JFFS2_FS_DEBUG=0
862CONFIG_JFFS2_FS_WRITEBUFFER=y
863# CONFIG_JFFS2_SUMMARY is not set
864# CONFIG_JFFS2_COMPRESSION_OPTIONS is not set
865CONFIG_JFFS2_ZLIB=y
866CONFIG_JFFS2_RTIME=y
867# CONFIG_JFFS2_RUBIN is not set
868# CONFIG_CRAMFS is not set
869# CONFIG_VXFS_FS is not set
870# CONFIG_HPFS_FS is not set
871# CONFIG_QNX4FS_FS is not set
872# CONFIG_SYSV_FS is not set
873# CONFIG_UFS_FS is not set
874
875#
876# Network File Systems
877#
878CONFIG_NFS_FS=y
879CONFIG_NFS_V3=y
880# CONFIG_NFS_V3_ACL is not set
881# CONFIG_NFS_V4 is not set
882# CONFIG_NFS_DIRECTIO is not set
883# CONFIG_NFSD is not set
884CONFIG_ROOT_NFS=y
885CONFIG_LOCKD=y
886CONFIG_LOCKD_V4=y
887CONFIG_NFS_COMMON=y
888CONFIG_SUNRPC=y
889# CONFIG_RPCSEC_GSS_KRB5 is not set
890# CONFIG_RPCSEC_GSS_SPKM3 is not set
891# CONFIG_SMB_FS is not set
892# CONFIG_CIFS is not set
893# CONFIG_NCP_FS is not set
894# CONFIG_CODA_FS is not set
895# CONFIG_AFS_FS is not set
896# CONFIG_9P_FS is not set
897
898#
899# Partition Types
900#
901CONFIG_PARTITION_ADVANCED=y
902# CONFIG_ACORN_PARTITION is not set
903# CONFIG_OSF_PARTITION is not set
904# CONFIG_AMIGA_PARTITION is not set
905# CONFIG_ATARI_PARTITION is not set
906# CONFIG_MAC_PARTITION is not set
907CONFIG_MSDOS_PARTITION=y
908# CONFIG_BSD_DISKLABEL is not set
909# CONFIG_MINIX_SUBPARTITION is not set
910# CONFIG_SOLARIS_X86_PARTITION is not set
911# CONFIG_UNIXWARE_DISKLABEL is not set
912# CONFIG_LDM_PARTITION is not set
913# CONFIG_SGI_PARTITION is not set
914# CONFIG_ULTRIX_PARTITION is not set
915# CONFIG_SUN_PARTITION is not set
916# CONFIG_EFI_PARTITION is not set
917
918#
919# Native Language Support
920#
921# CONFIG_NLS is not set
922
923#
924# Profiling support
925#
926# CONFIG_PROFILING is not set
927
928#
929# Kernel hacking
930#
931# CONFIG_PRINTK_TIME is not set
932CONFIG_DEBUG_KERNEL=y
933CONFIG_MAGIC_SYSRQ=y
934CONFIG_LOG_BUF_SHIFT=14
935CONFIG_DETECT_SOFTLOCKUP=y
936# CONFIG_SCHEDSTATS is not set
937# CONFIG_DEBUG_SLAB is not set
938# CONFIG_DEBUG_SPINLOCK is not set
939# CONFIG_DEBUG_SPINLOCK_SLEEP is not set
940# CONFIG_DEBUG_KOBJECT is not set
941CONFIG_DEBUG_BUGVERBOSE=y
942# CONFIG_DEBUG_INFO is not set
943# CONFIG_DEBUG_FS is not set
944# CONFIG_DEBUG_VM is not set
945CONFIG_FRAME_POINTER=y
946# CONFIG_RCU_TORTURE_TEST is not set
947CONFIG_DEBUG_USER=y
948# CONFIG_DEBUG_WAITQ is not set
949CONFIG_DEBUG_ERRORS=y
950CONFIG_DEBUG_LL=y
951# CONFIG_DEBUG_ICEDCC is not set
952
953#
954# Security options
955#
956# CONFIG_KEYS is not set
957# CONFIG_SECURITY is not set
958
959#
960# Cryptographic options
961#
962# CONFIG_CRYPTO is not set
963
964#
965# Hardware crypto devices
966#
967
968#
969# Library routines
970#
971# CONFIG_CRC_CCITT is not set
972# CONFIG_CRC16 is not set
973CONFIG_CRC32=y
974# CONFIG_LIBCRC32C is not set
975CONFIG_ZLIB_INFLATE=y
976CONFIG_ZLIB_DEFLATE=y
diff --git a/arch/arm/configs/ixdp2801_defconfig b/arch/arm/configs/ixdp2801_defconfig
deleted file mode 100644
index f54f3dcc5b33..000000000000
--- a/arch/arm/configs/ixdp2801_defconfig
+++ /dev/null
@@ -1,976 +0,0 @@
1#
2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.14-git13
4# Thu Nov 10 15:15:03 2005
5#
6CONFIG_ARM=y
7CONFIG_MMU=y
8CONFIG_UID16=y
9CONFIG_RWSEM_GENERIC_SPINLOCK=y
10CONFIG_GENERIC_CALIBRATE_DELAY=y
11
12#
13# Code maturity level options
14#
15CONFIG_EXPERIMENTAL=y
16CONFIG_CLEAN_COMPILE=y
17CONFIG_BROKEN_ON_SMP=y
18CONFIG_INIT_ENV_ARG_LIMIT=32
19
20#
21# General setup
22#
23CONFIG_LOCALVERSION=""
24CONFIG_LOCALVERSION_AUTO=y
25CONFIG_SWAP=y
26CONFIG_SYSVIPC=y
27# CONFIG_POSIX_MQUEUE is not set
28CONFIG_BSD_PROCESS_ACCT=y
29# CONFIG_BSD_PROCESS_ACCT_V3 is not set
30CONFIG_SYSCTL=y
31# CONFIG_AUDIT is not set
32# CONFIG_HOTPLUG is not set
33CONFIG_KOBJECT_UEVENT=y
34# CONFIG_IKCONFIG is not set
35CONFIG_INITRAMFS_SOURCE=""
36CONFIG_EMBEDDED=y
37CONFIG_KALLSYMS=y
38# CONFIG_KALLSYMS_ALL is not set
39# CONFIG_KALLSYMS_EXTRA_PASS is not set
40CONFIG_PRINTK=y
41CONFIG_BUG=y
42CONFIG_BASE_FULL=y
43CONFIG_FUTEX=y
44CONFIG_EPOLL=y
45CONFIG_CC_OPTIMIZE_FOR_SIZE=y
46CONFIG_SHMEM=y
47CONFIG_CC_ALIGN_FUNCTIONS=0
48CONFIG_CC_ALIGN_LABELS=0
49CONFIG_CC_ALIGN_LOOPS=0
50CONFIG_CC_ALIGN_JUMPS=0
51# CONFIG_TINY_SHMEM is not set
52CONFIG_BASE_SMALL=0
53
54#
55# Loadable module support
56#
57CONFIG_MODULES=y
58CONFIG_MODULE_UNLOAD=y
59# CONFIG_MODULE_FORCE_UNLOAD is not set
60CONFIG_OBSOLETE_MODPARM=y
61# CONFIG_MODVERSIONS is not set
62# CONFIG_MODULE_SRCVERSION_ALL is not set
63CONFIG_KMOD=y
64
65#
66# Block layer
67#
68
69#
70# IO Schedulers
71#
72CONFIG_IOSCHED_NOOP=y
73CONFIG_IOSCHED_AS=y
74CONFIG_IOSCHED_DEADLINE=y
75CONFIG_IOSCHED_CFQ=y
76CONFIG_DEFAULT_AS=y
77# CONFIG_DEFAULT_DEADLINE is not set
78# CONFIG_DEFAULT_CFQ is not set
79# CONFIG_DEFAULT_NOOP is not set
80CONFIG_DEFAULT_IOSCHED="anticipatory"
81
82#
83# System Type
84#
85# CONFIG_ARCH_CLPS7500 is not set
86# CONFIG_ARCH_CLPS711X is not set
87# CONFIG_ARCH_CO285 is not set
88# CONFIG_ARCH_EBSA110 is not set
89# CONFIG_ARCH_FOOTBRIDGE is not set
90# CONFIG_ARCH_INTEGRATOR is not set
91# CONFIG_ARCH_IOP3XX is not set
92# CONFIG_ARCH_IXP4XX is not set
93CONFIG_ARCH_IXP2000=y
94# CONFIG_ARCH_L7200 is not set
95# CONFIG_ARCH_PXA is not set
96# CONFIG_ARCH_RPC is not set
97# CONFIG_ARCH_SA1100 is not set
98# CONFIG_ARCH_S3C2410 is not set
99# CONFIG_ARCH_SHARK is not set
100# CONFIG_ARCH_LH7A40X is not set
101# CONFIG_ARCH_OMAP is not set
102# CONFIG_ARCH_VERSATILE is not set
103# CONFIG_ARCH_REALVIEW is not set
104# CONFIG_ARCH_IMX is not set
105# CONFIG_ARCH_H720X is not set
106# CONFIG_ARCH_AAEC2000 is not set
107CONFIG_ARCH_SUPPORTS_BIG_ENDIAN=y
108
109#
110# Intel IXP2400/2800 Implementation Options
111#
112
113#
114# IXP2400/2800 Platforms
115#
116# CONFIG_ARCH_ENP2611 is not set
117# CONFIG_ARCH_IXDP2400 is not set
118# CONFIG_ARCH_IXDP2800 is not set
119# CONFIG_ARCH_IXDP2401 is not set
120CONFIG_ARCH_IXDP2801=y
121CONFIG_ARCH_IXDP2X01=y
122# CONFIG_IXP2000_SUPPORT_BROKEN_PCI_IO is not set
123
124#
125# Processor Type
126#
127CONFIG_CPU_32=y
128CONFIG_CPU_XSCALE=y
129CONFIG_CPU_32v5=y
130CONFIG_CPU_ABRT_EV5T=y
131CONFIG_CPU_CACHE_VIVT=y
132CONFIG_CPU_TLB_V4WBI=y
133
134#
135# Processor Features
136#
137# CONFIG_ARM_THUMB is not set
138CONFIG_CPU_BIG_ENDIAN=y
139CONFIG_XSCALE_PMU=y
140
141#
142# Bus support
143#
144CONFIG_ISA_DMA_API=y
145CONFIG_PCI=y
146CONFIG_PCI_LEGACY_PROC=y
147# CONFIG_PCI_DEBUG is not set
148
149#
150# PCCARD (PCMCIA/CardBus) support
151#
152# CONFIG_PCCARD is not set
153
154#
155# Kernel Features
156#
157# CONFIG_PREEMPT is not set
158# CONFIG_NO_IDLE_HZ is not set
159# CONFIG_ARCH_DISCONTIGMEM_ENABLE is not set
160CONFIG_SELECT_MEMORY_MODEL=y
161CONFIG_FLATMEM_MANUAL=y
162# CONFIG_DISCONTIGMEM_MANUAL is not set
163# CONFIG_SPARSEMEM_MANUAL is not set
164CONFIG_FLATMEM=y
165CONFIG_FLAT_NODE_MEM_MAP=y
166# CONFIG_SPARSEMEM_STATIC is not set
167CONFIG_SPLIT_PTLOCK_CPUS=4096
168CONFIG_ALIGNMENT_TRAP=y
169
170#
171# Boot options
172#
173CONFIG_ZBOOT_ROM_TEXT=0x0
174CONFIG_ZBOOT_ROM_BSS=0x0
175CONFIG_CMDLINE="console=ttyS0,115200 root=/dev/nfs ip=bootp mem=64M@0x0"
176# CONFIG_XIP_KERNEL is not set
177
178#
179# Floating point emulation
180#
181
182#
183# At least one emulation must be selected
184#
185CONFIG_FPE_NWFPE=y
186CONFIG_FPE_NWFPE_XP=y
187# CONFIG_FPE_FASTFPE is not set
188
189#
190# Userspace binary formats
191#
192CONFIG_BINFMT_ELF=y
193# CONFIG_BINFMT_AOUT is not set
194# CONFIG_BINFMT_MISC is not set
195# CONFIG_ARTHUR is not set
196
197#
198# Power management options
199#
200# CONFIG_PM is not set
201
202#
203# Networking
204#
205CONFIG_NET=y
206
207#
208# Networking options
209#
210CONFIG_PACKET=y
211CONFIG_PACKET_MMAP=y
212CONFIG_UNIX=y
213# CONFIG_NET_KEY is not set
214CONFIG_INET=y
215# CONFIG_IP_MULTICAST is not set
216# CONFIG_IP_ADVANCED_ROUTER is not set
217CONFIG_IP_FIB_HASH=y
218CONFIG_IP_PNP=y
219CONFIG_IP_PNP_DHCP=y
220CONFIG_IP_PNP_BOOTP=y
221# CONFIG_IP_PNP_RARP is not set
222# CONFIG_NET_IPIP is not set
223# CONFIG_NET_IPGRE is not set
224# CONFIG_ARPD is not set
225CONFIG_SYN_COOKIES=y
226# CONFIG_INET_AH is not set
227# CONFIG_INET_ESP is not set
228# CONFIG_INET_IPCOMP is not set
229# CONFIG_INET_TUNNEL is not set
230CONFIG_INET_DIAG=y
231CONFIG_INET_TCP_DIAG=y
232# CONFIG_TCP_CONG_ADVANCED is not set
233CONFIG_TCP_CONG_BIC=y
234# CONFIG_IPV6 is not set
235# CONFIG_NETFILTER is not set
236
237#
238# DCCP Configuration (EXPERIMENTAL)
239#
240# CONFIG_IP_DCCP is not set
241
242#
243# SCTP Configuration (EXPERIMENTAL)
244#
245# CONFIG_IP_SCTP is not set
246# CONFIG_ATM is not set
247# CONFIG_BRIDGE is not set
248# CONFIG_VLAN_8021Q is not set
249# CONFIG_DECNET is not set
250# CONFIG_LLC2 is not set
251# CONFIG_IPX is not set
252# CONFIG_ATALK is not set
253# CONFIG_X25 is not set
254# CONFIG_LAPB is not set
255# CONFIG_NET_DIVERT is not set
256# CONFIG_ECONET is not set
257# CONFIG_WAN_ROUTER is not set
258
259#
260# QoS and/or fair queueing
261#
262# CONFIG_NET_SCHED is not set
263# CONFIG_NET_CLS_ROUTE is not set
264
265#
266# Network testing
267#
268# CONFIG_NET_PKTGEN is not set
269# CONFIG_HAMRADIO is not set
270# CONFIG_IRDA is not set
271# CONFIG_BT is not set
272# CONFIG_IEEE80211 is not set
273
274#
275# Device Drivers
276#
277
278#
279# Generic Driver Options
280#
281CONFIG_STANDALONE=y
282# CONFIG_PREVENT_FIRMWARE_BUILD is not set
283# CONFIG_FW_LOADER is not set
284# CONFIG_DEBUG_DRIVER is not set
285
286#
287# Memory Technology Devices (MTD)
288#
289CONFIG_MTD=y
290# CONFIG_MTD_DEBUG is not set
291# CONFIG_MTD_CONCAT is not set
292CONFIG_MTD_PARTITIONS=y
293CONFIG_MTD_REDBOOT_PARTS=y
294CONFIG_MTD_REDBOOT_DIRECTORY_BLOCK=-1
295CONFIG_MTD_REDBOOT_PARTS_UNALLOCATED=y
296CONFIG_MTD_REDBOOT_PARTS_READONLY=y
297# CONFIG_MTD_CMDLINE_PARTS is not set
298# CONFIG_MTD_AFS_PARTS is not set
299
300#
301# User Modules And Translation Layers
302#
303CONFIG_MTD_CHAR=y
304CONFIG_MTD_BLOCK=y
305# CONFIG_FTL is not set
306# CONFIG_NFTL is not set
307# CONFIG_INFTL is not set
308# CONFIG_RFD_FTL is not set
309
310#
311# RAM/ROM/Flash chip drivers
312#
313CONFIG_MTD_CFI=y
314# CONFIG_MTD_JEDECPROBE is not set
315CONFIG_MTD_GEN_PROBE=y
316# CONFIG_MTD_CFI_ADV_OPTIONS is not set
317CONFIG_MTD_MAP_BANK_WIDTH_1=y
318CONFIG_MTD_MAP_BANK_WIDTH_2=y
319CONFIG_MTD_MAP_BANK_WIDTH_4=y
320# CONFIG_MTD_MAP_BANK_WIDTH_8 is not set
321# CONFIG_MTD_MAP_BANK_WIDTH_16 is not set
322# CONFIG_MTD_MAP_BANK_WIDTH_32 is not set
323CONFIG_MTD_CFI_I1=y
324CONFIG_MTD_CFI_I2=y
325# CONFIG_MTD_CFI_I4 is not set
326# CONFIG_MTD_CFI_I8 is not set
327CONFIG_MTD_CFI_INTELEXT=y
328# CONFIG_MTD_CFI_AMDSTD is not set
329# CONFIG_MTD_CFI_STAA is not set
330CONFIG_MTD_CFI_UTIL=y
331# CONFIG_MTD_RAM is not set
332# CONFIG_MTD_ROM is not set
333# CONFIG_MTD_ABSENT is not set
334# CONFIG_MTD_XIP is not set
335
336#
337# Mapping drivers for chip access
338#
339CONFIG_MTD_COMPLEX_MAPPINGS=y
340# CONFIG_MTD_PHYSMAP is not set
341# CONFIG_MTD_ARM_INTEGRATOR is not set
342CONFIG_MTD_IXP2000=y
343# CONFIG_MTD_PCI is not set
344# CONFIG_MTD_PLATRAM is not set
345
346#
347# Self-contained MTD device drivers
348#
349# CONFIG_MTD_PMC551 is not set
350# CONFIG_MTD_SLRAM is not set
351# CONFIG_MTD_PHRAM is not set
352# CONFIG_MTD_MTDRAM is not set
353# CONFIG_MTD_BLKMTD is not set
354# CONFIG_MTD_BLOCK2MTD is not set
355
356#
357# Disk-On-Chip Device Drivers
358#
359# CONFIG_MTD_DOC2000 is not set
360# CONFIG_MTD_DOC2001 is not set
361# CONFIG_MTD_DOC2001PLUS is not set
362
363#
364# NAND Flash Device Drivers
365#
366# CONFIG_MTD_NAND is not set
367
368#
369# OneNAND Flash Device Drivers
370#
371# CONFIG_MTD_ONENAND is not set
372
373#
374# Parallel port support
375#
376# CONFIG_PARPORT is not set
377
378#
379# Plug and Play support
380#
381
382#
383# Block devices
384#
385# CONFIG_BLK_CPQ_DA is not set
386# CONFIG_BLK_CPQ_CISS_DA is not set
387# CONFIG_BLK_DEV_DAC960 is not set
388# CONFIG_BLK_DEV_UMEM is not set
389# CONFIG_BLK_DEV_COW_COMMON is not set
390CONFIG_BLK_DEV_LOOP=y
391# CONFIG_BLK_DEV_CRYPTOLOOP is not set
392# CONFIG_BLK_DEV_NBD is not set
393# CONFIG_BLK_DEV_SX8 is not set
394CONFIG_BLK_DEV_RAM=y
395CONFIG_BLK_DEV_RAM_COUNT=16
396CONFIG_BLK_DEV_RAM_SIZE=8192
397CONFIG_BLK_DEV_INITRD=y
398# CONFIG_CDROM_PKTCDVD is not set
399# CONFIG_ATA_OVER_ETH is not set
400
401#
402# SCSI device support
403#
404# CONFIG_RAID_ATTRS is not set
405# CONFIG_SCSI is not set
406
407#
408# Multi-device support (RAID and LVM)
409#
410# CONFIG_MD is not set
411
412#
413# Fusion MPT device support
414#
415# CONFIG_FUSION is not set
416
417#
418# IEEE 1394 (FireWire) support
419#
420# CONFIG_IEEE1394 is not set
421
422#
423# I2O device support
424#
425# CONFIG_I2O is not set
426
427#
428# Network device support
429#
430CONFIG_NETDEVICES=y
431CONFIG_DUMMY=y
432# CONFIG_BONDING is not set
433# CONFIG_EQUALIZER is not set
434# CONFIG_TUN is not set
435
436#
437# ARCnet devices
438#
439# CONFIG_ARCNET is not set
440
441#
442# PHY device support
443#
444# CONFIG_PHYLIB is not set
445
446#
447# Ethernet (10 or 100Mbit)
448#
449CONFIG_NET_ETHERNET=y
450CONFIG_MII=y
451# CONFIG_HAPPYMEAL is not set
452# CONFIG_SUNGEM is not set
453# CONFIG_CASSINI is not set
454# CONFIG_NET_VENDOR_3COM is not set
455# CONFIG_SMC91X is not set
456# CONFIG_DM9000 is not set
457
458#
459# Tulip family network device support
460#
461# CONFIG_NET_TULIP is not set
462# CONFIG_HP100 is not set
463CONFIG_NET_PCI=y
464# CONFIG_PCNET32 is not set
465# CONFIG_AMD8111_ETH is not set
466# CONFIG_ADAPTEC_STARFIRE is not set
467# CONFIG_B44 is not set
468# CONFIG_FORCEDETH is not set
469CONFIG_CS89x0=y
470# CONFIG_DGRS is not set
471CONFIG_EEPRO100=y
472# CONFIG_E100 is not set
473# CONFIG_FEALNX is not set
474# CONFIG_NATSEMI is not set
475# CONFIG_NE2K_PCI is not set
476# CONFIG_8139CP is not set
477# CONFIG_8139TOO is not set
478# CONFIG_SIS900 is not set
479# CONFIG_EPIC100 is not set
480# CONFIG_SUNDANCE is not set
481# CONFIG_TLAN is not set
482# CONFIG_VIA_RHINE is not set
483
484#
485# Ethernet (1000 Mbit)
486#
487# CONFIG_ACENIC is not set
488# CONFIG_DL2K is not set
489# CONFIG_E1000 is not set
490# CONFIG_NS83820 is not set
491# CONFIG_HAMACHI is not set
492# CONFIG_YELLOWFIN is not set
493# CONFIG_R8169 is not set
494# CONFIG_SIS190 is not set
495# CONFIG_SKGE is not set
496# CONFIG_SK98LIN is not set
497# CONFIG_VIA_VELOCITY is not set
498# CONFIG_TIGON3 is not set
499# CONFIG_BNX2 is not set
500
501#
502# Ethernet (10000 Mbit)
503#
504# CONFIG_CHELSIO_T1 is not set
505# CONFIG_IXGB is not set
506# CONFIG_S2IO is not set
507
508#
509# Token Ring devices
510#
511# CONFIG_TR is not set
512
513#
514# Wireless LAN (non-hamradio)
515#
516# CONFIG_NET_RADIO is not set
517
518#
519# Wan interfaces
520#
521CONFIG_WAN=y
522# CONFIG_DSCC4 is not set
523# CONFIG_LANMEDIA is not set
524# CONFIG_SYNCLINK_SYNCPPP is not set
525CONFIG_HDLC=y
526CONFIG_HDLC_RAW=y
527# CONFIG_HDLC_RAW_ETH is not set
528CONFIG_HDLC_CISCO=y
529CONFIG_HDLC_FR=y
530CONFIG_HDLC_PPP=y
531
532#
533# X.25/LAPB support is disabled
534#
535# CONFIG_PCI200SYN is not set
536# CONFIG_WANXL is not set
537# CONFIG_PC300 is not set
538# CONFIG_FARSYNC is not set
539CONFIG_DLCI=y
540CONFIG_DLCI_COUNT=24
541CONFIG_DLCI_MAX=8
542# CONFIG_FDDI is not set
543# CONFIG_HIPPI is not set
544# CONFIG_PPP is not set
545# CONFIG_SLIP is not set
546# CONFIG_SHAPER is not set
547# CONFIG_NETCONSOLE is not set
548# CONFIG_NETPOLL is not set
549# CONFIG_NET_POLL_CONTROLLER is not set
550
551#
552# ISDN subsystem
553#
554# CONFIG_ISDN is not set
555
556#
557# Input device support
558#
559CONFIG_INPUT=y
560
561#
562# Userland interfaces
563#
564CONFIG_INPUT_MOUSEDEV=y
565CONFIG_INPUT_MOUSEDEV_PSAUX=y
566CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024
567CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768
568# CONFIG_INPUT_JOYDEV is not set
569# CONFIG_INPUT_TSDEV is not set
570# CONFIG_INPUT_EVDEV is not set
571# CONFIG_INPUT_EVBUG is not set
572
573#
574# Input Device Drivers
575#
576# CONFIG_INPUT_KEYBOARD is not set
577# CONFIG_INPUT_MOUSE is not set
578# CONFIG_INPUT_JOYSTICK is not set
579# CONFIG_INPUT_TOUCHSCREEN is not set
580# CONFIG_INPUT_MISC is not set
581
582#
583# Hardware I/O ports
584#
585# CONFIG_SERIO is not set
586# CONFIG_GAMEPORT is not set
587
588#
589# Character devices
590#
591# CONFIG_VT is not set
592# CONFIG_SERIAL_NONSTANDARD is not set
593
594#
595# Serial drivers
596#
597CONFIG_SERIAL_8250=y
598CONFIG_SERIAL_8250_CONSOLE=y
599CONFIG_SERIAL_8250_NR_UARTS=3
600# CONFIG_SERIAL_8250_EXTENDED is not set
601
602#
603# Non-8250 serial port support
604#
605CONFIG_SERIAL_CORE=y
606CONFIG_SERIAL_CORE_CONSOLE=y
607# CONFIG_SERIAL_JSM is not set
608CONFIG_UNIX98_PTYS=y
609CONFIG_LEGACY_PTYS=y
610CONFIG_LEGACY_PTY_COUNT=256
611
612#
613# IPMI
614#
615# CONFIG_IPMI_HANDLER is not set
616
617#
618# Watchdog Cards
619#
620CONFIG_WATCHDOG=y
621# CONFIG_WATCHDOG_NOWAYOUT is not set
622
623#
624# Watchdog Device Drivers
625#
626# CONFIG_SOFT_WATCHDOG is not set
627CONFIG_IXP2000_WATCHDOG=y
628
629#
630# PCI-based Watchdog Cards
631#
632# CONFIG_PCIPCWATCHDOG is not set
633# CONFIG_WDTPCI is not set
634# CONFIG_NVRAM is not set
635# CONFIG_RTC is not set
636# CONFIG_DTLK is not set
637# CONFIG_R3964 is not set
638# CONFIG_APPLICOM is not set
639
640#
641# Ftape, the floppy tape device driver
642#
643# CONFIG_DRM is not set
644# CONFIG_RAW_DRIVER is not set
645
646#
647# TPM devices
648#
649# CONFIG_TCG_TPM is not set
650# CONFIG_TELCLOCK is not set
651
652#
653# I2C support
654#
655CONFIG_I2C=y
656CONFIG_I2C_CHARDEV=y
657
658#
659# I2C Algorithms
660#
661CONFIG_I2C_ALGOBIT=y
662# CONFIG_I2C_ALGOPCF is not set
663# CONFIG_I2C_ALGOPCA is not set
664
665#
666# I2C Hardware Bus support
667#
668# CONFIG_I2C_ALI1535 is not set
669# CONFIG_I2C_ALI1563 is not set
670# CONFIG_I2C_ALI15X3 is not set
671# CONFIG_I2C_AMD756 is not set
672# CONFIG_I2C_AMD8111 is not set
673# CONFIG_I2C_I801 is not set
674# CONFIG_I2C_I810 is not set
675# CONFIG_I2C_PIIX4 is not set
676CONFIG_I2C_IXP2000=y
677# CONFIG_I2C_NFORCE2 is not set
678# CONFIG_I2C_PARPORT_LIGHT is not set
679# CONFIG_I2C_PROSAVAGE is not set
680# CONFIG_I2C_SAVAGE4 is not set
681# CONFIG_SCx200_ACB is not set
682# CONFIG_I2C_SIS5595 is not set
683# CONFIG_I2C_SIS630 is not set
684# CONFIG_I2C_SIS96X is not set
685# CONFIG_I2C_STUB is not set
686# CONFIG_I2C_VIA is not set
687# CONFIG_I2C_VIAPRO is not set
688# CONFIG_I2C_VOODOO3 is not set
689# CONFIG_I2C_PCA_ISA is not set
690
691#
692# Miscellaneous I2C Chip support
693#
694# CONFIG_SENSORS_DS1337 is not set
695# CONFIG_SENSORS_DS1374 is not set
696CONFIG_SENSORS_EEPROM=y
697# CONFIG_SENSORS_PCF8574 is not set
698# CONFIG_SENSORS_PCA9539 is not set
699# CONFIG_SENSORS_PCF8591 is not set
700# CONFIG_SENSORS_RTC8564 is not set
701# CONFIG_SENSORS_MAX6875 is not set
702# CONFIG_RTC_X1205_I2C is not set
703# CONFIG_I2C_DEBUG_CORE is not set
704# CONFIG_I2C_DEBUG_ALGO is not set
705# CONFIG_I2C_DEBUG_BUS is not set
706# CONFIG_I2C_DEBUG_CHIP is not set
707
708#
709# Hardware Monitoring support
710#
711CONFIG_HWMON=y
712# CONFIG_HWMON_VID is not set
713# CONFIG_SENSORS_ADM1021 is not set
714# CONFIG_SENSORS_ADM1025 is not set
715# CONFIG_SENSORS_ADM1026 is not set
716# CONFIG_SENSORS_ADM1031 is not set
717# CONFIG_SENSORS_ADM9240 is not set
718# CONFIG_SENSORS_ASB100 is not set
719# CONFIG_SENSORS_ATXP1 is not set
720# CONFIG_SENSORS_DS1621 is not set
721# CONFIG_SENSORS_FSCHER is not set
722# CONFIG_SENSORS_FSCPOS is not set
723# CONFIG_SENSORS_GL518SM is not set
724# CONFIG_SENSORS_GL520SM is not set
725# CONFIG_SENSORS_IT87 is not set
726# CONFIG_SENSORS_LM63 is not set
727# CONFIG_SENSORS_LM75 is not set
728# CONFIG_SENSORS_LM77 is not set
729# CONFIG_SENSORS_LM78 is not set
730# CONFIG_SENSORS_LM80 is not set
731# CONFIG_SENSORS_LM83 is not set
732# CONFIG_SENSORS_LM85 is not set
733# CONFIG_SENSORS_LM87 is not set
734# CONFIG_SENSORS_LM90 is not set
735# CONFIG_SENSORS_LM92 is not set
736# CONFIG_SENSORS_MAX1619 is not set
737# CONFIG_SENSORS_PC87360 is not set
738# CONFIG_SENSORS_SIS5595 is not set
739# CONFIG_SENSORS_SMSC47M1 is not set
740# CONFIG_SENSORS_SMSC47B397 is not set
741# CONFIG_SENSORS_VIA686A is not set
742# CONFIG_SENSORS_W83781D is not set
743# CONFIG_SENSORS_W83792D is not set
744# CONFIG_SENSORS_W83L785TS is not set
745# CONFIG_SENSORS_W83627HF is not set
746# CONFIG_SENSORS_W83627EHF is not set
747# CONFIG_HWMON_DEBUG_CHIP is not set
748
749#
750# Misc devices
751#
752
753#
754# Multimedia Capabilities Port drivers
755#
756
757#
758# Multimedia devices
759#
760# CONFIG_VIDEO_DEV is not set
761
762#
763# Digital Video Broadcasting Devices
764#
765# CONFIG_DVB is not set
766
767#
768# Graphics support
769#
770# CONFIG_FB is not set
771
772#
773# Sound
774#
775# CONFIG_SOUND is not set
776
777#
778# USB support
779#
780CONFIG_USB_ARCH_HAS_HCD=y
781CONFIG_USB_ARCH_HAS_OHCI=y
782# CONFIG_USB is not set
783
784#
785# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support'
786#
787
788#
789# USB Gadget Support
790#
791# CONFIG_USB_GADGET is not set
792
793#
794# MMC/SD Card support
795#
796# CONFIG_MMC is not set
797
798#
799# File systems
800#
801CONFIG_EXT2_FS=y
802CONFIG_EXT2_FS_XATTR=y
803CONFIG_EXT2_FS_POSIX_ACL=y
804# CONFIG_EXT2_FS_SECURITY is not set
805# CONFIG_EXT2_FS_XIP is not set
806CONFIG_EXT3_FS=y
807CONFIG_EXT3_FS_XATTR=y
808CONFIG_EXT3_FS_POSIX_ACL=y
809# CONFIG_EXT3_FS_SECURITY is not set
810CONFIG_JBD=y
811# CONFIG_JBD_DEBUG is not set
812CONFIG_FS_MBCACHE=y
813# CONFIG_REISERFS_FS is not set
814# CONFIG_JFS_FS is not set
815CONFIG_FS_POSIX_ACL=y
816# CONFIG_XFS_FS is not set
817# CONFIG_MINIX_FS is not set
818# CONFIG_ROMFS_FS is not set
819CONFIG_INOTIFY=y
820# CONFIG_QUOTA is not set
821CONFIG_DNOTIFY=y
822# CONFIG_AUTOFS_FS is not set
823# CONFIG_AUTOFS4_FS is not set
824# CONFIG_FUSE_FS is not set
825
826#
827# CD-ROM/DVD Filesystems
828#
829# CONFIG_ISO9660_FS is not set
830# CONFIG_UDF_FS is not set
831
832#
833# DOS/FAT/NT Filesystems
834#
835# CONFIG_MSDOS_FS is not set
836# CONFIG_VFAT_FS is not set
837# CONFIG_NTFS_FS is not set
838
839#
840# Pseudo filesystems
841#
842CONFIG_PROC_FS=y
843CONFIG_SYSFS=y
844CONFIG_TMPFS=y
845# CONFIG_HUGETLB_PAGE is not set
846CONFIG_RAMFS=y
847# CONFIG_RELAYFS_FS is not set
848
849#
850# Miscellaneous filesystems
851#
852# CONFIG_ADFS_FS is not set
853# CONFIG_AFFS_FS is not set
854# CONFIG_HFS_FS is not set
855# CONFIG_HFSPLUS_FS is not set
856# CONFIG_BEFS_FS is not set
857# CONFIG_BFS_FS is not set
858# CONFIG_EFS_FS is not set
859# CONFIG_JFFS_FS is not set
860CONFIG_JFFS2_FS=y
861CONFIG_JFFS2_FS_DEBUG=0
862CONFIG_JFFS2_FS_WRITEBUFFER=y
863# CONFIG_JFFS2_SUMMARY is not set
864# CONFIG_JFFS2_COMPRESSION_OPTIONS is not set
865CONFIG_JFFS2_ZLIB=y
866CONFIG_JFFS2_RTIME=y
867# CONFIG_JFFS2_RUBIN is not set
868# CONFIG_CRAMFS is not set
869# CONFIG_VXFS_FS is not set
870# CONFIG_HPFS_FS is not set
871# CONFIG_QNX4FS_FS is not set
872# CONFIG_SYSV_FS is not set
873# CONFIG_UFS_FS is not set
874
875#
876# Network File Systems
877#
878CONFIG_NFS_FS=y
879CONFIG_NFS_V3=y
880# CONFIG_NFS_V3_ACL is not set
881# CONFIG_NFS_V4 is not set
882# CONFIG_NFS_DIRECTIO is not set
883# CONFIG_NFSD is not set
884CONFIG_ROOT_NFS=y
885CONFIG_LOCKD=y
886CONFIG_LOCKD_V4=y
887CONFIG_NFS_COMMON=y
888CONFIG_SUNRPC=y
889# CONFIG_RPCSEC_GSS_KRB5 is not set
890# CONFIG_RPCSEC_GSS_SPKM3 is not set
891# CONFIG_SMB_FS is not set
892# CONFIG_CIFS is not set
893# CONFIG_NCP_FS is not set
894# CONFIG_CODA_FS is not set
895# CONFIG_AFS_FS is not set
896# CONFIG_9P_FS is not set
897
898#
899# Partition Types
900#
901CONFIG_PARTITION_ADVANCED=y
902# CONFIG_ACORN_PARTITION is not set
903# CONFIG_OSF_PARTITION is not set
904# CONFIG_AMIGA_PARTITION is not set
905# CONFIG_ATARI_PARTITION is not set
906# CONFIG_MAC_PARTITION is not set
907CONFIG_MSDOS_PARTITION=y
908# CONFIG_BSD_DISKLABEL is not set
909# CONFIG_MINIX_SUBPARTITION is not set
910# CONFIG_SOLARIS_X86_PARTITION is not set
911# CONFIG_UNIXWARE_DISKLABEL is not set
912# CONFIG_LDM_PARTITION is not set
913# CONFIG_SGI_PARTITION is not set
914# CONFIG_ULTRIX_PARTITION is not set
915# CONFIG_SUN_PARTITION is not set
916# CONFIG_EFI_PARTITION is not set
917
918#
919# Native Language Support
920#
921# CONFIG_NLS is not set
922
923#
924# Profiling support
925#
926# CONFIG_PROFILING is not set
927
928#
929# Kernel hacking
930#
931# CONFIG_PRINTK_TIME is not set
932CONFIG_DEBUG_KERNEL=y
933CONFIG_MAGIC_SYSRQ=y
934CONFIG_LOG_BUF_SHIFT=14
935CONFIG_DETECT_SOFTLOCKUP=y
936# CONFIG_SCHEDSTATS is not set
937# CONFIG_DEBUG_SLAB is not set
938# CONFIG_DEBUG_SPINLOCK is not set
939# CONFIG_DEBUG_SPINLOCK_SLEEP is not set
940# CONFIG_DEBUG_KOBJECT is not set
941CONFIG_DEBUG_BUGVERBOSE=y
942# CONFIG_DEBUG_INFO is not set
943# CONFIG_DEBUG_FS is not set
944# CONFIG_DEBUG_VM is not set
945CONFIG_FRAME_POINTER=y
946# CONFIG_RCU_TORTURE_TEST is not set
947CONFIG_DEBUG_USER=y
948# CONFIG_DEBUG_WAITQ is not set
949CONFIG_DEBUG_ERRORS=y
950CONFIG_DEBUG_LL=y
951# CONFIG_DEBUG_ICEDCC is not set
952
953#
954# Security options
955#
956# CONFIG_KEYS is not set
957# CONFIG_SECURITY is not set
958
959#
960# Cryptographic options
961#
962# CONFIG_CRYPTO is not set
963
964#
965# Hardware crypto devices
966#
967
968#
969# Library routines
970#
971# CONFIG_CRC_CCITT is not set
972# CONFIG_CRC16 is not set
973CONFIG_CRC32=y
974# CONFIG_LIBCRC32C is not set
975CONFIG_ZLIB_INFLATE=y
976CONFIG_ZLIB_DEFLATE=y
diff --git a/arch/arm/configs/ixdp2400_defconfig b/arch/arm/configs/ixp2000_defconfig
index c67fc449a11f..7b02ca04c3ee 100644
--- a/arch/arm/configs/ixdp2400_defconfig
+++ b/arch/arm/configs/ixp2000_defconfig
@@ -1,11 +1,10 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.14-git13 3# Linux kernel version: 2.6.16-rc2
4# Thu Nov 10 15:14:13 2005 4# Wed Feb 8 04:49:11 2006
5# 5#
6CONFIG_ARM=y 6CONFIG_ARM=y
7CONFIG_MMU=y 7CONFIG_MMU=y
8CONFIG_UID16=y
9CONFIG_RWSEM_GENERIC_SPINLOCK=y 8CONFIG_RWSEM_GENERIC_SPINLOCK=y
10CONFIG_GENERIC_CALIBRATE_DELAY=y 9CONFIG_GENERIC_CALIBRATE_DELAY=y
11 10
@@ -29,27 +28,31 @@ CONFIG_BSD_PROCESS_ACCT=y
29# CONFIG_BSD_PROCESS_ACCT_V3 is not set 28# CONFIG_BSD_PROCESS_ACCT_V3 is not set
30CONFIG_SYSCTL=y 29CONFIG_SYSCTL=y
31# CONFIG_AUDIT is not set 30# CONFIG_AUDIT is not set
32# CONFIG_HOTPLUG is not set
33CONFIG_KOBJECT_UEVENT=y
34# CONFIG_IKCONFIG is not set 31# CONFIG_IKCONFIG is not set
35CONFIG_INITRAMFS_SOURCE="" 32CONFIG_INITRAMFS_SOURCE=""
33CONFIG_UID16=y
34CONFIG_CC_OPTIMIZE_FOR_SIZE=y
36CONFIG_EMBEDDED=y 35CONFIG_EMBEDDED=y
37CONFIG_KALLSYMS=y 36CONFIG_KALLSYMS=y
38# CONFIG_KALLSYMS_ALL is not set 37# CONFIG_KALLSYMS_ALL is not set
39# CONFIG_KALLSYMS_EXTRA_PASS is not set 38# CONFIG_KALLSYMS_EXTRA_PASS is not set
39# CONFIG_HOTPLUG is not set
40CONFIG_PRINTK=y 40CONFIG_PRINTK=y
41CONFIG_BUG=y 41CONFIG_BUG=y
42CONFIG_ELF_CORE=y
42CONFIG_BASE_FULL=y 43CONFIG_BASE_FULL=y
43CONFIG_FUTEX=y 44CONFIG_FUTEX=y
44CONFIG_EPOLL=y 45CONFIG_EPOLL=y
45CONFIG_CC_OPTIMIZE_FOR_SIZE=y
46CONFIG_SHMEM=y 46CONFIG_SHMEM=y
47CONFIG_CC_ALIGN_FUNCTIONS=0 47CONFIG_CC_ALIGN_FUNCTIONS=0
48CONFIG_CC_ALIGN_LABELS=0 48CONFIG_CC_ALIGN_LABELS=0
49CONFIG_CC_ALIGN_LOOPS=0 49CONFIG_CC_ALIGN_LOOPS=0
50CONFIG_CC_ALIGN_JUMPS=0 50CONFIG_CC_ALIGN_JUMPS=0
51CONFIG_SLAB=y
51# CONFIG_TINY_SHMEM is not set 52# CONFIG_TINY_SHMEM is not set
52CONFIG_BASE_SMALL=0 53CONFIG_BASE_SMALL=0
54# CONFIG_SLOB is not set
55CONFIG_OBSOLETE_INTERMODULE=y
53 56
54# 57#
55# Loadable module support 58# Loadable module support
@@ -104,6 +107,7 @@ CONFIG_ARCH_IXP2000=y
104# CONFIG_ARCH_IMX is not set 107# CONFIG_ARCH_IMX is not set
105# CONFIG_ARCH_H720X is not set 108# CONFIG_ARCH_H720X is not set
106# CONFIG_ARCH_AAEC2000 is not set 109# CONFIG_ARCH_AAEC2000 is not set
110# CONFIG_ARCH_AT91RM9200 is not set
107CONFIG_ARCH_SUPPORTS_BIG_ENDIAN=y 111CONFIG_ARCH_SUPPORTS_BIG_ENDIAN=y
108 112
109# 113#
@@ -113,12 +117,13 @@ CONFIG_ARCH_SUPPORTS_BIG_ENDIAN=y
113# 117#
114# IXP2400/2800 Platforms 118# IXP2400/2800 Platforms
115# 119#
116# CONFIG_ARCH_ENP2611 is not set 120CONFIG_ARCH_ENP2611=y
117CONFIG_ARCH_IXDP2400=y 121CONFIG_ARCH_IXDP2400=y
118# CONFIG_ARCH_IXDP2800 is not set 122CONFIG_ARCH_IXDP2800=y
119CONFIG_ARCH_IXDP2X00=y 123CONFIG_ARCH_IXDP2X00=y
120# CONFIG_ARCH_IXDP2401 is not set 124CONFIG_ARCH_IXDP2401=y
121# CONFIG_ARCH_IXDP2801 is not set 125CONFIG_ARCH_IXDP2801=y
126CONFIG_ARCH_IXDP2X01=y
122# CONFIG_IXP2000_SUPPORT_BROKEN_PCI_IO is not set 127# CONFIG_IXP2000_SUPPORT_BROKEN_PCI_IO is not set
123 128
124# 129#
@@ -141,7 +146,6 @@ CONFIG_XSCALE_PMU=y
141# 146#
142# Bus support 147# Bus support
143# 148#
144CONFIG_ISA_DMA_API=y
145CONFIG_PCI=y 149CONFIG_PCI=y
146CONFIG_PCI_LEGACY_PROC=y 150CONFIG_PCI_LEGACY_PROC=y
147# CONFIG_PCI_DEBUG is not set 151# CONFIG_PCI_DEBUG is not set
@@ -156,6 +160,7 @@ CONFIG_PCI_LEGACY_PROC=y
156# 160#
157# CONFIG_PREEMPT is not set 161# CONFIG_PREEMPT is not set
158# CONFIG_NO_IDLE_HZ is not set 162# CONFIG_NO_IDLE_HZ is not set
163# CONFIG_AEABI is not set
159# CONFIG_ARCH_DISCONTIGMEM_ENABLE is not set 164# CONFIG_ARCH_DISCONTIGMEM_ENABLE is not set
160CONFIG_SELECT_MEMORY_MODEL=y 165CONFIG_SELECT_MEMORY_MODEL=y
161CONFIG_FLATMEM_MANUAL=y 166CONFIG_FLATMEM_MANUAL=y
@@ -198,6 +203,7 @@ CONFIG_BINFMT_ELF=y
198# Power management options 203# Power management options
199# 204#
200# CONFIG_PM is not set 205# CONFIG_PM is not set
206# CONFIG_APM is not set
201 207
202# 208#
203# Networking 209# Networking
@@ -243,6 +249,11 @@ CONFIG_TCP_CONG_BIC=y
243# SCTP Configuration (EXPERIMENTAL) 249# SCTP Configuration (EXPERIMENTAL)
244# 250#
245# CONFIG_IP_SCTP is not set 251# CONFIG_IP_SCTP is not set
252
253#
254# TIPC Configuration (EXPERIMENTAL)
255#
256# CONFIG_TIPC is not set
246# CONFIG_ATM is not set 257# CONFIG_ATM is not set
247# CONFIG_BRIDGE is not set 258# CONFIG_BRIDGE is not set
248# CONFIG_VLAN_8021Q is not set 259# CONFIG_VLAN_8021Q is not set
@@ -260,7 +271,6 @@ CONFIG_TCP_CONG_BIC=y
260# QoS and/or fair queueing 271# QoS and/or fair queueing
261# 272#
262# CONFIG_NET_SCHED is not set 273# CONFIG_NET_SCHED is not set
263# CONFIG_NET_CLS_ROUTE is not set
264 274
265# 275#
266# Network testing 276# Network testing
@@ -284,6 +294,11 @@ CONFIG_STANDALONE=y
284# CONFIG_DEBUG_DRIVER is not set 294# CONFIG_DEBUG_DRIVER is not set
285 295
286# 296#
297# Connector - unified userspace <-> kernelspace linker
298#
299# CONFIG_CONNECTOR is not set
300
301#
287# Memory Technology Devices (MTD) 302# Memory Technology Devices (MTD)
288# 303#
289CONFIG_MTD=y 304CONFIG_MTD=y
@@ -331,6 +346,7 @@ CONFIG_MTD_CFI_UTIL=y
331# CONFIG_MTD_RAM is not set 346# CONFIG_MTD_RAM is not set
332# CONFIG_MTD_ROM is not set 347# CONFIG_MTD_ROM is not set
333# CONFIG_MTD_ABSENT is not set 348# CONFIG_MTD_ABSENT is not set
349# CONFIG_MTD_OBSOLETE_CHIPS is not set
334# CONFIG_MTD_XIP is not set 350# CONFIG_MTD_XIP is not set
335 351
336# 352#
@@ -466,6 +482,7 @@ CONFIG_NET_PCI=y
466# CONFIG_ADAPTEC_STARFIRE is not set 482# CONFIG_ADAPTEC_STARFIRE is not set
467# CONFIG_B44 is not set 483# CONFIG_B44 is not set
468# CONFIG_FORCEDETH is not set 484# CONFIG_FORCEDETH is not set
485CONFIG_CS89x0=y
469# CONFIG_DGRS is not set 486# CONFIG_DGRS is not set
470CONFIG_EEPRO100=y 487CONFIG_EEPRO100=y
471# CONFIG_E100 is not set 488# CONFIG_E100 is not set
@@ -486,12 +503,14 @@ CONFIG_EEPRO100=y
486# CONFIG_ACENIC is not set 503# CONFIG_ACENIC is not set
487# CONFIG_DL2K is not set 504# CONFIG_DL2K is not set
488# CONFIG_E1000 is not set 505# CONFIG_E1000 is not set
506CONFIG_ENP2611_MSF_NET=y
489# CONFIG_NS83820 is not set 507# CONFIG_NS83820 is not set
490# CONFIG_HAMACHI is not set 508# CONFIG_HAMACHI is not set
491# CONFIG_YELLOWFIN is not set 509# CONFIG_YELLOWFIN is not set
492# CONFIG_R8169 is not set 510# CONFIG_R8169 is not set
493# CONFIG_SIS190 is not set 511# CONFIG_SIS190 is not set
494# CONFIG_SKGE is not set 512# CONFIG_SKGE is not set
513# CONFIG_SKY2 is not set
495# CONFIG_SK98LIN is not set 514# CONFIG_SK98LIN is not set
496# CONFIG_VIA_VELOCITY is not set 515# CONFIG_VIA_VELOCITY is not set
497# CONFIG_TIGON3 is not set 516# CONFIG_TIGON3 is not set
@@ -595,7 +614,8 @@ CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768
595# 614#
596CONFIG_SERIAL_8250=y 615CONFIG_SERIAL_8250=y
597CONFIG_SERIAL_8250_CONSOLE=y 616CONFIG_SERIAL_8250_CONSOLE=y
598CONFIG_SERIAL_8250_NR_UARTS=1 617CONFIG_SERIAL_8250_NR_UARTS=3
618CONFIG_SERIAL_8250_RUNTIME_UARTS=4
599# CONFIG_SERIAL_8250_EXTENDED is not set 619# CONFIG_SERIAL_8250_EXTENDED is not set
600 620
601# 621#
@@ -603,7 +623,6 @@ CONFIG_SERIAL_8250_NR_UARTS=1
603# 623#
604CONFIG_SERIAL_CORE=y 624CONFIG_SERIAL_CORE=y
605CONFIG_SERIAL_CORE_CONSOLE=y 625CONFIG_SERIAL_CORE_CONSOLE=y
606# CONFIG_SERIAL_JSM is not set
607CONFIG_UNIX98_PTYS=y 626CONFIG_UNIX98_PTYS=y
608CONFIG_LEGACY_PTYS=y 627CONFIG_LEGACY_PTYS=y
609CONFIG_LEGACY_PTY_COUNT=256 628CONFIG_LEGACY_PTY_COUNT=256
@@ -705,6 +724,12 @@ CONFIG_SENSORS_EEPROM=y
705# CONFIG_I2C_DEBUG_CHIP is not set 724# CONFIG_I2C_DEBUG_CHIP is not set
706 725
707# 726#
727# SPI support
728#
729# CONFIG_SPI is not set
730# CONFIG_SPI_MASTER is not set
731
732#
708# Hardware Monitoring support 733# Hardware Monitoring support
709# 734#
710CONFIG_HWMON=y 735CONFIG_HWMON=y
@@ -738,6 +763,7 @@ CONFIG_HWMON=y
738# CONFIG_SENSORS_SMSC47M1 is not set 763# CONFIG_SENSORS_SMSC47M1 is not set
739# CONFIG_SENSORS_SMSC47B397 is not set 764# CONFIG_SENSORS_SMSC47B397 is not set
740# CONFIG_SENSORS_VIA686A is not set 765# CONFIG_SENSORS_VIA686A is not set
766# CONFIG_SENSORS_VT8231 is not set
741# CONFIG_SENSORS_W83781D is not set 767# CONFIG_SENSORS_W83781D is not set
742# CONFIG_SENSORS_W83792D is not set 768# CONFIG_SENSORS_W83792D is not set
743# CONFIG_SENSORS_W83L785TS is not set 769# CONFIG_SENSORS_W83L785TS is not set
@@ -813,6 +839,7 @@ CONFIG_FS_MBCACHE=y
813# CONFIG_JFS_FS is not set 839# CONFIG_JFS_FS is not set
814CONFIG_FS_POSIX_ACL=y 840CONFIG_FS_POSIX_ACL=y
815# CONFIG_XFS_FS is not set 841# CONFIG_XFS_FS is not set
842# CONFIG_OCFS2_FS is not set
816# CONFIG_MINIX_FS is not set 843# CONFIG_MINIX_FS is not set
817# CONFIG_ROMFS_FS is not set 844# CONFIG_ROMFS_FS is not set
818CONFIG_INOTIFY=y 845CONFIG_INOTIFY=y
@@ -844,6 +871,7 @@ CONFIG_TMPFS=y
844# CONFIG_HUGETLB_PAGE is not set 871# CONFIG_HUGETLB_PAGE is not set
845CONFIG_RAMFS=y 872CONFIG_RAMFS=y
846# CONFIG_RELAYFS_FS is not set 873# CONFIG_RELAYFS_FS is not set
874# CONFIG_CONFIGFS_FS is not set
847 875
848# 876#
849# Miscellaneous filesystems 877# Miscellaneous filesystems
@@ -912,6 +940,7 @@ CONFIG_MSDOS_PARTITION=y
912# CONFIG_SGI_PARTITION is not set 940# CONFIG_SGI_PARTITION is not set
913# CONFIG_ULTRIX_PARTITION is not set 941# CONFIG_ULTRIX_PARTITION is not set
914# CONFIG_SUN_PARTITION is not set 942# CONFIG_SUN_PARTITION is not set
943# CONFIG_KARMA_PARTITION is not set
915# CONFIG_EFI_PARTITION is not set 944# CONFIG_EFI_PARTITION is not set
916 945
917# 946#
@@ -928,12 +957,13 @@ CONFIG_MSDOS_PARTITION=y
928# Kernel hacking 957# Kernel hacking
929# 958#
930# CONFIG_PRINTK_TIME is not set 959# CONFIG_PRINTK_TIME is not set
931CONFIG_DEBUG_KERNEL=y
932CONFIG_MAGIC_SYSRQ=y 960CONFIG_MAGIC_SYSRQ=y
961CONFIG_DEBUG_KERNEL=y
933CONFIG_LOG_BUF_SHIFT=14 962CONFIG_LOG_BUF_SHIFT=14
934CONFIG_DETECT_SOFTLOCKUP=y 963CONFIG_DETECT_SOFTLOCKUP=y
935# CONFIG_SCHEDSTATS is not set 964# CONFIG_SCHEDSTATS is not set
936# CONFIG_DEBUG_SLAB is not set 965# CONFIG_DEBUG_SLAB is not set
966CONFIG_DEBUG_MUTEXES=y
937# CONFIG_DEBUG_SPINLOCK is not set 967# CONFIG_DEBUG_SPINLOCK is not set
938# CONFIG_DEBUG_SPINLOCK_SLEEP is not set 968# CONFIG_DEBUG_SPINLOCK_SLEEP is not set
939# CONFIG_DEBUG_KOBJECT is not set 969# CONFIG_DEBUG_KOBJECT is not set
@@ -942,6 +972,7 @@ CONFIG_DEBUG_BUGVERBOSE=y
942# CONFIG_DEBUG_FS is not set 972# CONFIG_DEBUG_FS is not set
943# CONFIG_DEBUG_VM is not set 973# CONFIG_DEBUG_VM is not set
944CONFIG_FRAME_POINTER=y 974CONFIG_FRAME_POINTER=y
975CONFIG_FORCED_INLINING=y
945# CONFIG_RCU_TORTURE_TEST is not set 976# CONFIG_RCU_TORTURE_TEST is not set
946CONFIG_DEBUG_USER=y 977CONFIG_DEBUG_USER=y
947# CONFIG_DEBUG_WAITQ is not set 978# CONFIG_DEBUG_WAITQ is not set
diff --git a/arch/arm/configs/ixdp2800_defconfig b/arch/arm/configs/ixp23xx_defconfig
index 4248123815e9..1a2751e9ab05 100644
--- a/arch/arm/configs/ixdp2800_defconfig
+++ b/arch/arm/configs/ixp23xx_defconfig
@@ -1,11 +1,10 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.14-git13 3# Linux kernel version: 2.6.16
4# Thu Nov 10 15:14:56 2005 4# Tue Mar 21 03:27:20 2006
5# 5#
6CONFIG_ARM=y 6CONFIG_ARM=y
7CONFIG_MMU=y 7CONFIG_MMU=y
8CONFIG_UID16=y
9CONFIG_RWSEM_GENERIC_SPINLOCK=y 8CONFIG_RWSEM_GENERIC_SPINLOCK=y
10CONFIG_GENERIC_CALIBRATE_DELAY=y 9CONFIG_GENERIC_CALIBRATE_DELAY=y
11 10
@@ -13,7 +12,6 @@ CONFIG_GENERIC_CALIBRATE_DELAY=y
13# Code maturity level options 12# Code maturity level options
14# 13#
15CONFIG_EXPERIMENTAL=y 14CONFIG_EXPERIMENTAL=y
16CONFIG_CLEAN_COMPILE=y
17CONFIG_BROKEN_ON_SMP=y 15CONFIG_BROKEN_ON_SMP=y
18CONFIG_INIT_ENV_ARG_LIMIT=32 16CONFIG_INIT_ENV_ARG_LIMIT=32
19 17
@@ -29,27 +27,31 @@ CONFIG_BSD_PROCESS_ACCT=y
29# CONFIG_BSD_PROCESS_ACCT_V3 is not set 27# CONFIG_BSD_PROCESS_ACCT_V3 is not set
30CONFIG_SYSCTL=y 28CONFIG_SYSCTL=y
31# CONFIG_AUDIT is not set 29# CONFIG_AUDIT is not set
32# CONFIG_HOTPLUG is not set
33CONFIG_KOBJECT_UEVENT=y
34# CONFIG_IKCONFIG is not set 30# CONFIG_IKCONFIG is not set
35CONFIG_INITRAMFS_SOURCE="" 31CONFIG_INITRAMFS_SOURCE=""
32CONFIG_UID16=y
33CONFIG_CC_OPTIMIZE_FOR_SIZE=y
36CONFIG_EMBEDDED=y 34CONFIG_EMBEDDED=y
37CONFIG_KALLSYMS=y 35CONFIG_KALLSYMS=y
38# CONFIG_KALLSYMS_ALL is not set 36# CONFIG_KALLSYMS_ALL is not set
39# CONFIG_KALLSYMS_EXTRA_PASS is not set 37# CONFIG_KALLSYMS_EXTRA_PASS is not set
38CONFIG_HOTPLUG=y
40CONFIG_PRINTK=y 39CONFIG_PRINTK=y
41CONFIG_BUG=y 40CONFIG_BUG=y
41CONFIG_ELF_CORE=y
42CONFIG_BASE_FULL=y 42CONFIG_BASE_FULL=y
43CONFIG_FUTEX=y 43CONFIG_FUTEX=y
44CONFIG_EPOLL=y 44CONFIG_EPOLL=y
45CONFIG_CC_OPTIMIZE_FOR_SIZE=y
46CONFIG_SHMEM=y 45CONFIG_SHMEM=y
47CONFIG_CC_ALIGN_FUNCTIONS=0 46CONFIG_CC_ALIGN_FUNCTIONS=0
48CONFIG_CC_ALIGN_LABELS=0 47CONFIG_CC_ALIGN_LABELS=0
49CONFIG_CC_ALIGN_LOOPS=0 48CONFIG_CC_ALIGN_LOOPS=0
50CONFIG_CC_ALIGN_JUMPS=0 49CONFIG_CC_ALIGN_JUMPS=0
50CONFIG_SLAB=y
51# CONFIG_TINY_SHMEM is not set 51# CONFIG_TINY_SHMEM is not set
52CONFIG_BASE_SMALL=0 52CONFIG_BASE_SMALL=0
53# CONFIG_SLOB is not set
54CONFIG_OBSOLETE_INTERMODULE=y
53 55
54# 56#
55# Loadable module support 57# Loadable module support
@@ -86,11 +88,13 @@ CONFIG_DEFAULT_IOSCHED="anticipatory"
86# CONFIG_ARCH_CLPS711X is not set 88# CONFIG_ARCH_CLPS711X is not set
87# CONFIG_ARCH_CO285 is not set 89# CONFIG_ARCH_CO285 is not set
88# CONFIG_ARCH_EBSA110 is not set 90# CONFIG_ARCH_EBSA110 is not set
91# CONFIG_ARCH_EP93XX is not set
89# CONFIG_ARCH_FOOTBRIDGE is not set 92# CONFIG_ARCH_FOOTBRIDGE is not set
90# CONFIG_ARCH_INTEGRATOR is not set 93# CONFIG_ARCH_INTEGRATOR is not set
91# CONFIG_ARCH_IOP3XX is not set 94# CONFIG_ARCH_IOP3XX is not set
92# CONFIG_ARCH_IXP4XX is not set 95# CONFIG_ARCH_IXP4XX is not set
93CONFIG_ARCH_IXP2000=y 96# CONFIG_ARCH_IXP2000 is not set
97CONFIG_ARCH_IXP23XX=y
94# CONFIG_ARCH_L7200 is not set 98# CONFIG_ARCH_L7200 is not set
95# CONFIG_ARCH_PXA is not set 99# CONFIG_ARCH_PXA is not set
96# CONFIG_ARCH_RPC is not set 100# CONFIG_ARCH_RPC is not set
@@ -104,44 +108,40 @@ CONFIG_ARCH_IXP2000=y
104# CONFIG_ARCH_IMX is not set 108# CONFIG_ARCH_IMX is not set
105# CONFIG_ARCH_H720X is not set 109# CONFIG_ARCH_H720X is not set
106# CONFIG_ARCH_AAEC2000 is not set 110# CONFIG_ARCH_AAEC2000 is not set
111# CONFIG_ARCH_AT91RM9200 is not set
107CONFIG_ARCH_SUPPORTS_BIG_ENDIAN=y 112CONFIG_ARCH_SUPPORTS_BIG_ENDIAN=y
108 113
109# 114#
110# Intel IXP2400/2800 Implementation Options 115# Intel IXP23xx Implementation Options
111# 116#
112 117
113# 118#
114# IXP2400/2800 Platforms 119# IXP23xx Platforms
115# 120#
116# CONFIG_ARCH_ENP2611 is not set 121CONFIG_MACH_ESPRESSO=y
117# CONFIG_ARCH_IXDP2400 is not set 122CONFIG_MACH_IXDP2351=y
118CONFIG_ARCH_IXDP2800=y 123CONFIG_MACH_ROADRUNNER=y
119CONFIG_ARCH_IXDP2X00=y
120# CONFIG_ARCH_IXDP2401 is not set
121# CONFIG_ARCH_IXDP2801 is not set
122# CONFIG_IXP2000_SUPPORT_BROKEN_PCI_IO is not set
123 124
124# 125#
125# Processor Type 126# Processor Type
126# 127#
127CONFIG_CPU_32=y 128CONFIG_CPU_32=y
128CONFIG_CPU_XSCALE=y 129CONFIG_CPU_XSC3=y
129CONFIG_CPU_32v5=y 130CONFIG_CPU_32v5=y
130CONFIG_CPU_ABRT_EV5T=y 131CONFIG_CPU_ABRT_EV5T=y
131CONFIG_CPU_CACHE_VIVT=y 132CONFIG_CPU_CACHE_VIVT=y
132CONFIG_CPU_TLB_V4WBI=y 133CONFIG_CPU_TLB_V4WBI=y
134CONFIG_IO_36=y
133 135
134# 136#
135# Processor Features 137# Processor Features
136# 138#
137# CONFIG_ARM_THUMB is not set 139# CONFIG_ARM_THUMB is not set
138CONFIG_CPU_BIG_ENDIAN=y 140CONFIG_CPU_BIG_ENDIAN=y
139CONFIG_XSCALE_PMU=y
140 141
141# 142#
142# Bus support 143# Bus support
143# 144#
144CONFIG_ISA_DMA_API=y
145CONFIG_PCI=y 145CONFIG_PCI=y
146CONFIG_PCI_LEGACY_PROC=y 146CONFIG_PCI_LEGACY_PROC=y
147# CONFIG_PCI_DEBUG is not set 147# CONFIG_PCI_DEBUG is not set
@@ -156,6 +156,8 @@ CONFIG_PCI_LEGACY_PROC=y
156# 156#
157# CONFIG_PREEMPT is not set 157# CONFIG_PREEMPT is not set
158# CONFIG_NO_IDLE_HZ is not set 158# CONFIG_NO_IDLE_HZ is not set
159CONFIG_HZ=100
160# CONFIG_AEABI is not set
159# CONFIG_ARCH_DISCONTIGMEM_ENABLE is not set 161# CONFIG_ARCH_DISCONTIGMEM_ENABLE is not set
160CONFIG_SELECT_MEMORY_MODEL=y 162CONFIG_SELECT_MEMORY_MODEL=y
161CONFIG_FLATMEM_MANUAL=y 163CONFIG_FLATMEM_MANUAL=y
@@ -172,7 +174,7 @@ CONFIG_ALIGNMENT_TRAP=y
172# 174#
173CONFIG_ZBOOT_ROM_TEXT=0x0 175CONFIG_ZBOOT_ROM_TEXT=0x0
174CONFIG_ZBOOT_ROM_BSS=0x0 176CONFIG_ZBOOT_ROM_BSS=0x0
175CONFIG_CMDLINE="console=ttyS0,9600 root=/dev/nfs ip=bootp mem=64M@0x0" 177CONFIG_CMDLINE="console=ttyS0,115200 root=/dev/nfs ip=bootp"
176# CONFIG_XIP_KERNEL is not set 178# CONFIG_XIP_KERNEL is not set
177 179
178# 180#
@@ -198,6 +200,7 @@ CONFIG_BINFMT_ELF=y
198# Power management options 200# Power management options
199# 201#
200# CONFIG_PM is not set 202# CONFIG_PM is not set
203# CONFIG_APM is not set
201 204
202# 205#
203# Networking 206# Networking
@@ -207,6 +210,7 @@ CONFIG_NET=y
207# 210#
208# Networking options 211# Networking options
209# 212#
213# CONFIG_NETDEBUG is not set
210CONFIG_PACKET=y 214CONFIG_PACKET=y
211CONFIG_PACKET_MMAP=y 215CONFIG_PACKET_MMAP=y
212CONFIG_UNIX=y 216CONFIG_UNIX=y
@@ -243,6 +247,11 @@ CONFIG_TCP_CONG_BIC=y
243# SCTP Configuration (EXPERIMENTAL) 247# SCTP Configuration (EXPERIMENTAL)
244# 248#
245# CONFIG_IP_SCTP is not set 249# CONFIG_IP_SCTP is not set
250
251#
252# TIPC Configuration (EXPERIMENTAL)
253#
254# CONFIG_TIPC is not set
246# CONFIG_ATM is not set 255# CONFIG_ATM is not set
247# CONFIG_BRIDGE is not set 256# CONFIG_BRIDGE is not set
248# CONFIG_VLAN_8021Q is not set 257# CONFIG_VLAN_8021Q is not set
@@ -260,7 +269,6 @@ CONFIG_TCP_CONG_BIC=y
260# QoS and/or fair queueing 269# QoS and/or fair queueing
261# 270#
262# CONFIG_NET_SCHED is not set 271# CONFIG_NET_SCHED is not set
263# CONFIG_NET_CLS_ROUTE is not set
264 272
265# 273#
266# Network testing 274# Network testing
@@ -284,6 +292,11 @@ CONFIG_STANDALONE=y
284# CONFIG_DEBUG_DRIVER is not set 292# CONFIG_DEBUG_DRIVER is not set
285 293
286# 294#
295# Connector - unified userspace <-> kernelspace linker
296#
297# CONFIG_CONNECTOR is not set
298
299#
287# Memory Technology Devices (MTD) 300# Memory Technology Devices (MTD)
288# 301#
289CONFIG_MTD=y 302CONFIG_MTD=y
@@ -331,15 +344,17 @@ CONFIG_MTD_CFI_UTIL=y
331# CONFIG_MTD_RAM is not set 344# CONFIG_MTD_RAM is not set
332# CONFIG_MTD_ROM is not set 345# CONFIG_MTD_ROM is not set
333# CONFIG_MTD_ABSENT is not set 346# CONFIG_MTD_ABSENT is not set
334# CONFIG_MTD_XIP is not set 347# CONFIG_MTD_OBSOLETE_CHIPS is not set
335 348
336# 349#
337# Mapping drivers for chip access 350# Mapping drivers for chip access
338# 351#
339CONFIG_MTD_COMPLEX_MAPPINGS=y 352CONFIG_MTD_COMPLEX_MAPPINGS=y
340# CONFIG_MTD_PHYSMAP is not set 353CONFIG_MTD_PHYSMAP=y
354CONFIG_MTD_PHYSMAP_START=0x0
355CONFIG_MTD_PHYSMAP_LEN=0x0
356CONFIG_MTD_PHYSMAP_BANKWIDTH=1
341# CONFIG_MTD_ARM_INTEGRATOR is not set 357# CONFIG_MTD_ARM_INTEGRATOR is not set
342CONFIG_MTD_IXP2000=y
343# CONFIG_MTD_PCI is not set 358# CONFIG_MTD_PCI is not set
344# CONFIG_MTD_PLATRAM is not set 359# CONFIG_MTD_PLATRAM is not set
345 360
@@ -391,6 +406,7 @@ CONFIG_BLK_DEV_LOOP=y
391# CONFIG_BLK_DEV_CRYPTOLOOP is not set 406# CONFIG_BLK_DEV_CRYPTOLOOP is not set
392# CONFIG_BLK_DEV_NBD is not set 407# CONFIG_BLK_DEV_NBD is not set
393# CONFIG_BLK_DEV_SX8 is not set 408# CONFIG_BLK_DEV_SX8 is not set
409# CONFIG_BLK_DEV_UB is not set
394CONFIG_BLK_DEV_RAM=y 410CONFIG_BLK_DEV_RAM=y
395CONFIG_BLK_DEV_RAM_COUNT=16 411CONFIG_BLK_DEV_RAM_COUNT=16
396CONFIG_BLK_DEV_RAM_SIZE=8192 412CONFIG_BLK_DEV_RAM_SIZE=8192
@@ -399,10 +415,126 @@ CONFIG_BLK_DEV_INITRD=y
399# CONFIG_ATA_OVER_ETH is not set 415# CONFIG_ATA_OVER_ETH is not set
400 416
401# 417#
418# ATA/ATAPI/MFM/RLL support
419#
420CONFIG_IDE=y
421CONFIG_BLK_DEV_IDE=y
422
423#
424# Please see Documentation/ide.txt for help/info on IDE drives
425#
426# CONFIG_BLK_DEV_IDE_SATA is not set
427CONFIG_BLK_DEV_IDEDISK=y
428# CONFIG_IDEDISK_MULTI_MODE is not set
429# CONFIG_BLK_DEV_IDECD is not set
430# CONFIG_BLK_DEV_IDETAPE is not set
431# CONFIG_BLK_DEV_IDEFLOPPY is not set
432# CONFIG_BLK_DEV_IDESCSI is not set
433# CONFIG_IDE_TASK_IOCTL is not set
434
435#
436# IDE chipset support/bugfixes
437#
438CONFIG_IDE_GENERIC=y
439CONFIG_BLK_DEV_IDEPCI=y
440# CONFIG_IDEPCI_SHARE_IRQ is not set
441# CONFIG_BLK_DEV_OFFBOARD is not set
442# CONFIG_BLK_DEV_GENERIC is not set
443# CONFIG_BLK_DEV_OPTI621 is not set
444# CONFIG_BLK_DEV_SL82C105 is not set
445CONFIG_BLK_DEV_IDEDMA_PCI=y
446# CONFIG_BLK_DEV_IDEDMA_FORCED is not set
447# CONFIG_IDEDMA_PCI_AUTO is not set
448# CONFIG_BLK_DEV_AEC62XX is not set
449# CONFIG_BLK_DEV_ALI15X3 is not set
450# CONFIG_BLK_DEV_AMD74XX is not set
451# CONFIG_BLK_DEV_CMD64X is not set
452# CONFIG_BLK_DEV_TRIFLEX is not set
453# CONFIG_BLK_DEV_CY82C693 is not set
454# CONFIG_BLK_DEV_CS5520 is not set
455# CONFIG_BLK_DEV_CS5530 is not set
456# CONFIG_BLK_DEV_HPT34X is not set
457# CONFIG_BLK_DEV_HPT366 is not set
458# CONFIG_BLK_DEV_SC1200 is not set
459# CONFIG_BLK_DEV_PIIX is not set
460# CONFIG_BLK_DEV_IT821X is not set
461# CONFIG_BLK_DEV_NS87415 is not set
462# CONFIG_BLK_DEV_PDC202XX_OLD is not set
463# CONFIG_BLK_DEV_PDC202XX_NEW is not set
464# CONFIG_BLK_DEV_SVWKS is not set
465CONFIG_BLK_DEV_SIIMAGE=y
466# CONFIG_BLK_DEV_SLC90E66 is not set
467# CONFIG_BLK_DEV_TRM290 is not set
468# CONFIG_BLK_DEV_VIA82CXXX is not set
469# CONFIG_IDE_ARM is not set
470CONFIG_BLK_DEV_IDEDMA=y
471# CONFIG_IDEDMA_IVB is not set
472# CONFIG_IDEDMA_AUTO is not set
473# CONFIG_BLK_DEV_HD is not set
474
475#
402# SCSI device support 476# SCSI device support
403# 477#
404# CONFIG_RAID_ATTRS is not set 478# CONFIG_RAID_ATTRS is not set
405# CONFIG_SCSI is not set 479CONFIG_SCSI=y
480CONFIG_SCSI_PROC_FS=y
481
482#
483# SCSI support type (disk, tape, CD-ROM)
484#
485CONFIG_BLK_DEV_SD=y
486# CONFIG_CHR_DEV_ST is not set
487# CONFIG_CHR_DEV_OSST is not set
488# CONFIG_BLK_DEV_SR is not set
489# CONFIG_CHR_DEV_SG is not set
490# CONFIG_CHR_DEV_SCH is not set
491
492#
493# Some SCSI devices (e.g. CD jukebox) support multiple LUNs
494#
495# CONFIG_SCSI_MULTI_LUN is not set
496# CONFIG_SCSI_CONSTANTS is not set
497# CONFIG_SCSI_LOGGING is not set
498
499#
500# SCSI Transport Attributes
501#
502# CONFIG_SCSI_SPI_ATTRS is not set
503# CONFIG_SCSI_FC_ATTRS is not set
504# CONFIG_SCSI_ISCSI_ATTRS is not set
505# CONFIG_SCSI_SAS_ATTRS is not set
506
507#
508# SCSI low-level drivers
509#
510# CONFIG_ISCSI_TCP is not set
511# CONFIG_BLK_DEV_3W_XXXX_RAID is not set
512# CONFIG_SCSI_3W_9XXX is not set
513# CONFIG_SCSI_ACARD is not set
514# CONFIG_SCSI_AACRAID is not set
515# CONFIG_SCSI_AIC7XXX is not set
516# CONFIG_SCSI_AIC7XXX_OLD is not set
517# CONFIG_SCSI_AIC79XX is not set
518# CONFIG_SCSI_DPT_I2O is not set
519# CONFIG_MEGARAID_NEWGEN is not set
520# CONFIG_MEGARAID_LEGACY is not set
521# CONFIG_MEGARAID_SAS is not set
522# CONFIG_SCSI_SATA is not set
523# CONFIG_SCSI_DMX3191D is not set
524# CONFIG_SCSI_FUTURE_DOMAIN is not set
525# CONFIG_SCSI_IPS is not set
526# CONFIG_SCSI_INITIO is not set
527# CONFIG_SCSI_INIA100 is not set
528# CONFIG_SCSI_SYM53C8XX_2 is not set
529# CONFIG_SCSI_IPR is not set
530# CONFIG_SCSI_QLOGIC_FC is not set
531# CONFIG_SCSI_QLOGIC_1280 is not set
532# CONFIG_SCSI_QLA_FC is not set
533# CONFIG_SCSI_LPFC is not set
534# CONFIG_SCSI_DC395x is not set
535# CONFIG_SCSI_DC390T is not set
536# CONFIG_SCSI_NSP32 is not set
537# CONFIG_SCSI_DEBUG is not set
406 538
407# 539#
408# Multi-device support (RAID and LVM) 540# Multi-device support (RAID and LVM)
@@ -413,6 +545,9 @@ CONFIG_BLK_DEV_INITRD=y
413# Fusion MPT device support 545# Fusion MPT device support
414# 546#
415# CONFIG_FUSION is not set 547# CONFIG_FUSION is not set
548# CONFIG_FUSION_SPI is not set
549# CONFIG_FUSION_FC is not set
550# CONFIG_FUSION_SAS is not set
416 551
417# 552#
418# IEEE 1394 (FireWire) support 553# IEEE 1394 (FireWire) support
@@ -466,9 +601,10 @@ CONFIG_NET_PCI=y
466# CONFIG_ADAPTEC_STARFIRE is not set 601# CONFIG_ADAPTEC_STARFIRE is not set
467# CONFIG_B44 is not set 602# CONFIG_B44 is not set
468# CONFIG_FORCEDETH is not set 603# CONFIG_FORCEDETH is not set
604# CONFIG_CS89x0 is not set
469# CONFIG_DGRS is not set 605# CONFIG_DGRS is not set
470CONFIG_EEPRO100=y 606# CONFIG_EEPRO100 is not set
471# CONFIG_E100 is not set 607CONFIG_E100=y
472# CONFIG_FEALNX is not set 608# CONFIG_FEALNX is not set
473# CONFIG_NATSEMI is not set 609# CONFIG_NATSEMI is not set
474# CONFIG_NE2K_PCI is not set 610# CONFIG_NE2K_PCI is not set
@@ -485,13 +621,16 @@ CONFIG_EEPRO100=y
485# 621#
486# CONFIG_ACENIC is not set 622# CONFIG_ACENIC is not set
487# CONFIG_DL2K is not set 623# CONFIG_DL2K is not set
488# CONFIG_E1000 is not set 624CONFIG_E1000=y
625CONFIG_E1000_NAPI=y
626# CONFIG_E1000_DISABLE_PACKET_SPLIT is not set
489# CONFIG_NS83820 is not set 627# CONFIG_NS83820 is not set
490# CONFIG_HAMACHI is not set 628# CONFIG_HAMACHI is not set
491# CONFIG_YELLOWFIN is not set 629# CONFIG_YELLOWFIN is not set
492# CONFIG_R8169 is not set 630# CONFIG_R8169 is not set
493# CONFIG_SIS190 is not set 631# CONFIG_SIS190 is not set
494# CONFIG_SKGE is not set 632# CONFIG_SKGE is not set
633# CONFIG_SKY2 is not set
495# CONFIG_SK98LIN is not set 634# CONFIG_SK98LIN is not set
496# CONFIG_VIA_VELOCITY is not set 635# CONFIG_VIA_VELOCITY is not set
497# CONFIG_TIGON3 is not set 636# CONFIG_TIGON3 is not set
@@ -542,6 +681,7 @@ CONFIG_DLCI_MAX=8
542# CONFIG_HIPPI is not set 681# CONFIG_HIPPI is not set
543# CONFIG_PPP is not set 682# CONFIG_PPP is not set
544# CONFIG_SLIP is not set 683# CONFIG_SLIP is not set
684# CONFIG_NET_FC is not set
545# CONFIG_SHAPER is not set 685# CONFIG_SHAPER is not set
546# CONFIG_NETCONSOLE is not set 686# CONFIG_NETCONSOLE is not set
547# CONFIG_NETPOLL is not set 687# CONFIG_NETPOLL is not set
@@ -595,7 +735,8 @@ CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768
595# 735#
596CONFIG_SERIAL_8250=y 736CONFIG_SERIAL_8250=y
597CONFIG_SERIAL_8250_CONSOLE=y 737CONFIG_SERIAL_8250_CONSOLE=y
598CONFIG_SERIAL_8250_NR_UARTS=1 738CONFIG_SERIAL_8250_NR_UARTS=4
739CONFIG_SERIAL_8250_RUNTIME_UARTS=4
599# CONFIG_SERIAL_8250_EXTENDED is not set 740# CONFIG_SERIAL_8250_EXTENDED is not set
600 741
601# 742#
@@ -623,13 +764,17 @@ CONFIG_WATCHDOG=y
623# Watchdog Device Drivers 764# Watchdog Device Drivers
624# 765#
625# CONFIG_SOFT_WATCHDOG is not set 766# CONFIG_SOFT_WATCHDOG is not set
626CONFIG_IXP2000_WATCHDOG=y
627 767
628# 768#
629# PCI-based Watchdog Cards 769# PCI-based Watchdog Cards
630# 770#
631# CONFIG_PCIPCWATCHDOG is not set 771# CONFIG_PCIPCWATCHDOG is not set
632# CONFIG_WDTPCI is not set 772# CONFIG_WDTPCI is not set
773
774#
775# USB-based Watchdog Cards
776#
777# CONFIG_USBPCWATCHDOG is not set
633# CONFIG_NVRAM is not set 778# CONFIG_NVRAM is not set
634# CONFIG_RTC is not set 779# CONFIG_RTC is not set
635# CONFIG_DTLK is not set 780# CONFIG_DTLK is not set
@@ -672,7 +817,6 @@ CONFIG_I2C_ALGOBIT=y
672# CONFIG_I2C_I801 is not set 817# CONFIG_I2C_I801 is not set
673# CONFIG_I2C_I810 is not set 818# CONFIG_I2C_I810 is not set
674# CONFIG_I2C_PIIX4 is not set 819# CONFIG_I2C_PIIX4 is not set
675CONFIG_I2C_IXP2000=y
676# CONFIG_I2C_NFORCE2 is not set 820# CONFIG_I2C_NFORCE2 is not set
677# CONFIG_I2C_PARPORT_LIGHT is not set 821# CONFIG_I2C_PARPORT_LIGHT is not set
678# CONFIG_I2C_PROSAVAGE is not set 822# CONFIG_I2C_PROSAVAGE is not set
@@ -705,6 +849,17 @@ CONFIG_SENSORS_EEPROM=y
705# CONFIG_I2C_DEBUG_CHIP is not set 849# CONFIG_I2C_DEBUG_CHIP is not set
706 850
707# 851#
852# SPI support
853#
854# CONFIG_SPI is not set
855# CONFIG_SPI_MASTER is not set
856
857#
858# Dallas's 1-wire bus
859#
860# CONFIG_W1 is not set
861
862#
708# Hardware Monitoring support 863# Hardware Monitoring support
709# 864#
710CONFIG_HWMON=y 865CONFIG_HWMON=y
@@ -717,6 +872,7 @@ CONFIG_HWMON=y
717# CONFIG_SENSORS_ASB100 is not set 872# CONFIG_SENSORS_ASB100 is not set
718# CONFIG_SENSORS_ATXP1 is not set 873# CONFIG_SENSORS_ATXP1 is not set
719# CONFIG_SENSORS_DS1621 is not set 874# CONFIG_SENSORS_DS1621 is not set
875# CONFIG_SENSORS_F71805F is not set
720# CONFIG_SENSORS_FSCHER is not set 876# CONFIG_SENSORS_FSCHER is not set
721# CONFIG_SENSORS_FSCPOS is not set 877# CONFIG_SENSORS_FSCPOS is not set
722# CONFIG_SENSORS_GL518SM is not set 878# CONFIG_SENSORS_GL518SM is not set
@@ -738,6 +894,7 @@ CONFIG_HWMON=y
738# CONFIG_SENSORS_SMSC47M1 is not set 894# CONFIG_SENSORS_SMSC47M1 is not set
739# CONFIG_SENSORS_SMSC47B397 is not set 895# CONFIG_SENSORS_SMSC47B397 is not set
740# CONFIG_SENSORS_VIA686A is not set 896# CONFIG_SENSORS_VIA686A is not set
897# CONFIG_SENSORS_VT8231 is not set
741# CONFIG_SENSORS_W83781D is not set 898# CONFIG_SENSORS_W83781D is not set
742# CONFIG_SENSORS_W83792D is not set 899# CONFIG_SENSORS_W83792D is not set
743# CONFIG_SENSORS_W83L785TS is not set 900# CONFIG_SENSORS_W83L785TS is not set
@@ -778,13 +935,137 @@ CONFIG_HWMON=y
778# 935#
779CONFIG_USB_ARCH_HAS_HCD=y 936CONFIG_USB_ARCH_HAS_HCD=y
780CONFIG_USB_ARCH_HAS_OHCI=y 937CONFIG_USB_ARCH_HAS_OHCI=y
781# CONFIG_USB is not set 938CONFIG_USB=y
939# CONFIG_USB_DEBUG is not set
940
941#
942# Miscellaneous USB options
943#
944# CONFIG_USB_DEVICEFS is not set
945# CONFIG_USB_BANDWIDTH is not set
946# CONFIG_USB_DYNAMIC_MINORS is not set
947# CONFIG_USB_OTG is not set
948
949#
950# USB Host Controller Drivers
951#
952CONFIG_USB_EHCI_HCD=y
953# CONFIG_USB_EHCI_SPLIT_ISO is not set
954# CONFIG_USB_EHCI_ROOT_HUB_TT is not set
955# CONFIG_USB_ISP116X_HCD is not set
956CONFIG_USB_OHCI_HCD=y
957# CONFIG_USB_OHCI_BIG_ENDIAN is not set
958CONFIG_USB_OHCI_LITTLE_ENDIAN=y
959CONFIG_USB_UHCI_HCD=y
960# CONFIG_USB_SL811_HCD is not set
961
962#
963# USB Device Class drivers
964#
965# CONFIG_USB_ACM is not set
966# CONFIG_USB_PRINTER is not set
782 967
783# 968#
784# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support' 969# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support'
785# 970#
786 971
787# 972#
973# may also be needed; see USB_STORAGE Help for more information
974#
975CONFIG_USB_STORAGE=y
976# CONFIG_USB_STORAGE_DEBUG is not set
977# CONFIG_USB_STORAGE_DATAFAB is not set
978# CONFIG_USB_STORAGE_FREECOM is not set
979# CONFIG_USB_STORAGE_ISD200 is not set
980# CONFIG_USB_STORAGE_DPCM is not set
981# CONFIG_USB_STORAGE_USBAT is not set
982# CONFIG_USB_STORAGE_SDDR09 is not set
983# CONFIG_USB_STORAGE_SDDR55 is not set
984# CONFIG_USB_STORAGE_JUMPSHOT is not set
985# CONFIG_USB_STORAGE_ALAUDA is not set
986# CONFIG_USB_LIBUSUAL is not set
987
988#
989# USB Input Devices
990#
991# CONFIG_USB_HID is not set
992
993#
994# USB HID Boot Protocol drivers
995#
996# CONFIG_USB_KBD is not set
997# CONFIG_USB_MOUSE is not set
998# CONFIG_USB_AIPTEK is not set
999# CONFIG_USB_WACOM is not set
1000# CONFIG_USB_ACECAD is not set
1001# CONFIG_USB_KBTAB is not set
1002# CONFIG_USB_POWERMATE is not set
1003# CONFIG_USB_MTOUCH is not set
1004# CONFIG_USB_ITMTOUCH is not set
1005# CONFIG_USB_EGALAX is not set
1006# CONFIG_USB_YEALINK is not set
1007# CONFIG_USB_XPAD is not set
1008# CONFIG_USB_ATI_REMOTE is not set
1009# CONFIG_USB_ATI_REMOTE2 is not set
1010# CONFIG_USB_KEYSPAN_REMOTE is not set
1011# CONFIG_USB_APPLETOUCH is not set
1012
1013#
1014# USB Imaging devices
1015#
1016# CONFIG_USB_MDC800 is not set
1017# CONFIG_USB_MICROTEK is not set
1018
1019#
1020# USB Multimedia devices
1021#
1022# CONFIG_USB_DABUSB is not set
1023
1024#
1025# Video4Linux support is needed for USB Multimedia device support
1026#
1027
1028#
1029# USB Network Adapters
1030#
1031# CONFIG_USB_CATC is not set
1032# CONFIG_USB_KAWETH is not set
1033# CONFIG_USB_PEGASUS is not set
1034# CONFIG_USB_RTL8150 is not set
1035# CONFIG_USB_USBNET is not set
1036CONFIG_USB_MON=y
1037
1038#
1039# USB port drivers
1040#
1041
1042#
1043# USB Serial Converter support
1044#
1045# CONFIG_USB_SERIAL is not set
1046
1047#
1048# USB Miscellaneous drivers
1049#
1050# CONFIG_USB_EMI62 is not set
1051# CONFIG_USB_EMI26 is not set
1052# CONFIG_USB_AUERSWALD is not set
1053# CONFIG_USB_RIO500 is not set
1054# CONFIG_USB_LEGOTOWER is not set
1055# CONFIG_USB_LCD is not set
1056# CONFIG_USB_LED is not set
1057# CONFIG_USB_CYTHERM is not set
1058# CONFIG_USB_PHIDGETKIT is not set
1059# CONFIG_USB_PHIDGETSERVO is not set
1060# CONFIG_USB_IDMOUSE is not set
1061# CONFIG_USB_SISUSBVGA is not set
1062# CONFIG_USB_LD is not set
1063
1064#
1065# USB DSL modem support
1066#
1067
1068#
788# USB Gadget Support 1069# USB Gadget Support
789# 1070#
790# CONFIG_USB_GADGET is not set 1071# CONFIG_USB_GADGET is not set
@@ -813,6 +1094,7 @@ CONFIG_FS_MBCACHE=y
813# CONFIG_JFS_FS is not set 1094# CONFIG_JFS_FS is not set
814CONFIG_FS_POSIX_ACL=y 1095CONFIG_FS_POSIX_ACL=y
815# CONFIG_XFS_FS is not set 1096# CONFIG_XFS_FS is not set
1097# CONFIG_OCFS2_FS is not set
816# CONFIG_MINIX_FS is not set 1098# CONFIG_MINIX_FS is not set
817# CONFIG_ROMFS_FS is not set 1099# CONFIG_ROMFS_FS is not set
818CONFIG_INOTIFY=y 1100CONFIG_INOTIFY=y
@@ -831,8 +1113,10 @@ CONFIG_DNOTIFY=y
831# 1113#
832# DOS/FAT/NT Filesystems 1114# DOS/FAT/NT Filesystems
833# 1115#
834# CONFIG_MSDOS_FS is not set 1116CONFIG_FAT_FS=y
1117CONFIG_MSDOS_FS=y
835# CONFIG_VFAT_FS is not set 1118# CONFIG_VFAT_FS is not set
1119CONFIG_FAT_DEFAULT_CODEPAGE=437
836# CONFIG_NTFS_FS is not set 1120# CONFIG_NTFS_FS is not set
837 1121
838# 1122#
@@ -844,6 +1128,7 @@ CONFIG_TMPFS=y
844# CONFIG_HUGETLB_PAGE is not set 1128# CONFIG_HUGETLB_PAGE is not set
845CONFIG_RAMFS=y 1129CONFIG_RAMFS=y
846# CONFIG_RELAYFS_FS is not set 1130# CONFIG_RELAYFS_FS is not set
1131# CONFIG_CONFIGFS_FS is not set
847 1132
848# 1133#
849# Miscellaneous filesystems 1134# Miscellaneous filesystems
@@ -912,12 +1197,52 @@ CONFIG_MSDOS_PARTITION=y
912# CONFIG_SGI_PARTITION is not set 1197# CONFIG_SGI_PARTITION is not set
913# CONFIG_ULTRIX_PARTITION is not set 1198# CONFIG_ULTRIX_PARTITION is not set
914# CONFIG_SUN_PARTITION is not set 1199# CONFIG_SUN_PARTITION is not set
1200# CONFIG_KARMA_PARTITION is not set
915# CONFIG_EFI_PARTITION is not set 1201# CONFIG_EFI_PARTITION is not set
916 1202
917# 1203#
918# Native Language Support 1204# Native Language Support
919# 1205#
920# CONFIG_NLS is not set 1206CONFIG_NLS=y
1207CONFIG_NLS_DEFAULT="iso8859-1"
1208CONFIG_NLS_CODEPAGE_437=y
1209# CONFIG_NLS_CODEPAGE_737 is not set
1210# CONFIG_NLS_CODEPAGE_775 is not set
1211# CONFIG_NLS_CODEPAGE_850 is not set
1212# CONFIG_NLS_CODEPAGE_852 is not set
1213# CONFIG_NLS_CODEPAGE_855 is not set
1214# CONFIG_NLS_CODEPAGE_857 is not set
1215# CONFIG_NLS_CODEPAGE_860 is not set
1216# CONFIG_NLS_CODEPAGE_861 is not set
1217# CONFIG_NLS_CODEPAGE_862 is not set
1218# CONFIG_NLS_CODEPAGE_863 is not set
1219# CONFIG_NLS_CODEPAGE_864 is not set
1220# CONFIG_NLS_CODEPAGE_865 is not set
1221# CONFIG_NLS_CODEPAGE_866 is not set
1222# CONFIG_NLS_CODEPAGE_869 is not set
1223# CONFIG_NLS_CODEPAGE_936 is not set
1224# CONFIG_NLS_CODEPAGE_950 is not set
1225# CONFIG_NLS_CODEPAGE_932 is not set
1226# CONFIG_NLS_CODEPAGE_949 is not set
1227# CONFIG_NLS_CODEPAGE_874 is not set
1228# CONFIG_NLS_ISO8859_8 is not set
1229# CONFIG_NLS_CODEPAGE_1250 is not set
1230# CONFIG_NLS_CODEPAGE_1251 is not set
1231# CONFIG_NLS_ASCII is not set
1232# CONFIG_NLS_ISO8859_1 is not set
1233# CONFIG_NLS_ISO8859_2 is not set
1234# CONFIG_NLS_ISO8859_3 is not set
1235# CONFIG_NLS_ISO8859_4 is not set
1236# CONFIG_NLS_ISO8859_5 is not set
1237# CONFIG_NLS_ISO8859_6 is not set
1238# CONFIG_NLS_ISO8859_7 is not set
1239# CONFIG_NLS_ISO8859_9 is not set
1240# CONFIG_NLS_ISO8859_13 is not set
1241# CONFIG_NLS_ISO8859_14 is not set
1242# CONFIG_NLS_ISO8859_15 is not set
1243# CONFIG_NLS_KOI8_R is not set
1244# CONFIG_NLS_KOI8_U is not set
1245# CONFIG_NLS_UTF8 is not set
921 1246
922# 1247#
923# Profiling support 1248# Profiling support
@@ -928,12 +1253,13 @@ CONFIG_MSDOS_PARTITION=y
928# Kernel hacking 1253# Kernel hacking
929# 1254#
930# CONFIG_PRINTK_TIME is not set 1255# CONFIG_PRINTK_TIME is not set
931CONFIG_DEBUG_KERNEL=y
932CONFIG_MAGIC_SYSRQ=y 1256CONFIG_MAGIC_SYSRQ=y
1257CONFIG_DEBUG_KERNEL=y
933CONFIG_LOG_BUF_SHIFT=14 1258CONFIG_LOG_BUF_SHIFT=14
934CONFIG_DETECT_SOFTLOCKUP=y 1259CONFIG_DETECT_SOFTLOCKUP=y
935# CONFIG_SCHEDSTATS is not set 1260# CONFIG_SCHEDSTATS is not set
936# CONFIG_DEBUG_SLAB is not set 1261# CONFIG_DEBUG_SLAB is not set
1262CONFIG_DEBUG_MUTEXES=y
937# CONFIG_DEBUG_SPINLOCK is not set 1263# CONFIG_DEBUG_SPINLOCK is not set
938# CONFIG_DEBUG_SPINLOCK_SLEEP is not set 1264# CONFIG_DEBUG_SPINLOCK_SLEEP is not set
939# CONFIG_DEBUG_KOBJECT is not set 1265# CONFIG_DEBUG_KOBJECT is not set
@@ -942,6 +1268,7 @@ CONFIG_DEBUG_BUGVERBOSE=y
942# CONFIG_DEBUG_FS is not set 1268# CONFIG_DEBUG_FS is not set
943# CONFIG_DEBUG_VM is not set 1269# CONFIG_DEBUG_VM is not set
944CONFIG_FRAME_POINTER=y 1270CONFIG_FRAME_POINTER=y
1271CONFIG_FORCED_INLINING=y
945# CONFIG_RCU_TORTURE_TEST is not set 1272# CONFIG_RCU_TORTURE_TEST is not set
946CONFIG_DEBUG_USER=y 1273CONFIG_DEBUG_USER=y
947# CONFIG_DEBUG_WAITQ is not set 1274# CONFIG_DEBUG_WAITQ is not set
diff --git a/arch/arm/configs/s3c2410_defconfig b/arch/arm/configs/s3c2410_defconfig
index 6695b07cf1ba..3cec29d56c8e 100644
--- a/arch/arm/configs/s3c2410_defconfig
+++ b/arch/arm/configs/s3c2410_defconfig
@@ -1,7 +1,7 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.16-rc2 3# Linux kernel version: 2.6.16
4# Mon Feb 6 11:17:23 2006 4# Mon Mar 20 20:36:02 2006
5# 5#
6CONFIG_ARM=y 6CONFIG_ARM=y
7CONFIG_MMU=y 7CONFIG_MMU=y
@@ -12,7 +12,6 @@ CONFIG_GENERIC_CALIBRATE_DELAY=y
12# Code maturity level options 12# Code maturity level options
13# 13#
14CONFIG_EXPERIMENTAL=y 14CONFIG_EXPERIMENTAL=y
15CONFIG_CLEAN_COMPILE=y
16CONFIG_BROKEN_ON_SMP=y 15CONFIG_BROKEN_ON_SMP=y
17CONFIG_INIT_ENV_ARG_LIMIT=32 16CONFIG_INIT_ENV_ARG_LIMIT=32
18 17
@@ -87,6 +86,7 @@ CONFIG_DEFAULT_IOSCHED="anticipatory"
87# CONFIG_ARCH_CLPS711X is not set 86# CONFIG_ARCH_CLPS711X is not set
88# CONFIG_ARCH_CO285 is not set 87# CONFIG_ARCH_CO285 is not set
89# CONFIG_ARCH_EBSA110 is not set 88# CONFIG_ARCH_EBSA110 is not set
89# CONFIG_ARCH_EP93XX is not set
90# CONFIG_ARCH_FOOTBRIDGE is not set 90# CONFIG_ARCH_FOOTBRIDGE is not set
91# CONFIG_ARCH_INTEGRATOR is not set 91# CONFIG_ARCH_INTEGRATOR is not set
92# CONFIG_ARCH_IOP3XX is not set 92# CONFIG_ARCH_IOP3XX is not set
@@ -111,6 +111,7 @@ CONFIG_ARCH_S3C2410=y
111# S3C24XX Implementations 111# S3C24XX Implementations
112# 112#
113CONFIG_MACH_ANUBIS=y 113CONFIG_MACH_ANUBIS=y
114CONFIG_MACH_OSIRIS=y
114CONFIG_ARCH_BAST=y 115CONFIG_ARCH_BAST=y
115CONFIG_BAST_PC104_IRQ=y 116CONFIG_BAST_PC104_IRQ=y
116CONFIG_ARCH_H1940=y 117CONFIG_ARCH_H1940=y
@@ -175,6 +176,7 @@ CONFIG_ISA=y
175# 176#
176# CONFIG_PREEMPT is not set 177# CONFIG_PREEMPT is not set
177# CONFIG_NO_IDLE_HZ is not set 178# CONFIG_NO_IDLE_HZ is not set
179CONFIG_HZ=200
178# CONFIG_AEABI is not set 180# CONFIG_AEABI is not set
179# CONFIG_ARCH_DISCONTIGMEM_ENABLE is not set 181# CONFIG_ARCH_DISCONTIGMEM_ENABLE is not set
180CONFIG_SELECT_MEMORY_MODEL=y 182CONFIG_SELECT_MEMORY_MODEL=y
@@ -230,6 +232,7 @@ CONFIG_NET=y
230# 232#
231# Networking options 233# Networking options
232# 234#
235# CONFIG_NETDEBUG is not set
233# CONFIG_PACKET is not set 236# CONFIG_PACKET is not set
234CONFIG_UNIX=y 237CONFIG_UNIX=y
235# CONFIG_NET_KEY is not set 238# CONFIG_NET_KEY is not set
@@ -364,7 +367,6 @@ CONFIG_MTD_CFI_UTIL=y
364CONFIG_MTD_ROM=y 367CONFIG_MTD_ROM=y
365# CONFIG_MTD_ABSENT is not set 368# CONFIG_MTD_ABSENT is not set
366# CONFIG_MTD_OBSOLETE_CHIPS is not set 369# CONFIG_MTD_OBSOLETE_CHIPS is not set
367# CONFIG_MTD_XIP is not set
368 370
369# 371#
370# Mapping drivers for chip access 372# Mapping drivers for chip access
@@ -431,6 +433,7 @@ CONFIG_PARPORT_1284=y
431CONFIG_BLK_DEV_LOOP=y 433CONFIG_BLK_DEV_LOOP=y
432# CONFIG_BLK_DEV_CRYPTOLOOP is not set 434# CONFIG_BLK_DEV_CRYPTOLOOP is not set
433CONFIG_BLK_DEV_NBD=m 435CONFIG_BLK_DEV_NBD=m
436# CONFIG_BLK_DEV_UB is not set
434CONFIG_BLK_DEV_RAM=y 437CONFIG_BLK_DEV_RAM=y
435CONFIG_BLK_DEV_RAM_COUNT=16 438CONFIG_BLK_DEV_RAM_COUNT=16
436CONFIG_BLK_DEV_RAM_SIZE=4096 439CONFIG_BLK_DEV_RAM_SIZE=4096
@@ -623,7 +626,6 @@ CONFIG_SERIAL_NONSTANDARD=y
623# CONFIG_MOXA_SMARTIO is not set 626# CONFIG_MOXA_SMARTIO is not set
624# CONFIG_ISI is not set 627# CONFIG_ISI is not set
625# CONFIG_SYNCLINKMP is not set 628# CONFIG_SYNCLINKMP is not set
626# CONFIG_SYNCLINK_GT is not set
627# CONFIG_N_HDLC is not set 629# CONFIG_N_HDLC is not set
628# CONFIG_RISCOM8 is not set 630# CONFIG_RISCOM8 is not set
629# CONFIG_SPECIALIX is not set 631# CONFIG_SPECIALIX is not set
@@ -686,6 +688,11 @@ CONFIG_S3C2410_WATCHDOG=y
686# CONFIG_PCWATCHDOG is not set 688# CONFIG_PCWATCHDOG is not set
687# CONFIG_MIXCOMWD is not set 689# CONFIG_MIXCOMWD is not set
688# CONFIG_WDT is not set 690# CONFIG_WDT is not set
691
692#
693# USB-based Watchdog Cards
694#
695# CONFIG_USBPCWATCHDOG is not set
689# CONFIG_NVRAM is not set 696# CONFIG_NVRAM is not set
690# CONFIG_RTC is not set 697# CONFIG_RTC is not set
691CONFIG_S3C2410_RTC=y 698CONFIG_S3C2410_RTC=y
@@ -751,6 +758,11 @@ CONFIG_SENSORS_EEPROM=m
751# CONFIG_SPI_MASTER is not set 758# CONFIG_SPI_MASTER is not set
752 759
753# 760#
761# Dallas's 1-wire bus
762#
763# CONFIG_W1 is not set
764
765#
754# Hardware Monitoring support 766# Hardware Monitoring support
755# 767#
756CONFIG_HWMON=y 768CONFIG_HWMON=y
@@ -763,6 +775,7 @@ CONFIG_HWMON_VID=m
763# CONFIG_SENSORS_ASB100 is not set 775# CONFIG_SENSORS_ASB100 is not set
764# CONFIG_SENSORS_ATXP1 is not set 776# CONFIG_SENSORS_ATXP1 is not set
765# CONFIG_SENSORS_DS1621 is not set 777# CONFIG_SENSORS_DS1621 is not set
778# CONFIG_SENSORS_F71805F is not set
766# CONFIG_SENSORS_FSCHER is not set 779# CONFIG_SENSORS_FSCHER is not set
767# CONFIG_SENSORS_FSCPOS is not set 780# CONFIG_SENSORS_FSCPOS is not set
768# CONFIG_SENSORS_GL518SM is not set 781# CONFIG_SENSORS_GL518SM is not set
@@ -850,16 +863,138 @@ CONFIG_FONT_8x16=y
850# 863#
851CONFIG_USB_ARCH_HAS_HCD=y 864CONFIG_USB_ARCH_HAS_HCD=y
852CONFIG_USB_ARCH_HAS_OHCI=y 865CONFIG_USB_ARCH_HAS_OHCI=y
853# CONFIG_USB is not set 866CONFIG_USB=y
867# CONFIG_USB_DEBUG is not set
868
869#
870# Miscellaneous USB options
871#
872CONFIG_USB_DEVICEFS=y
873# CONFIG_USB_BANDWIDTH is not set
874# CONFIG_USB_DYNAMIC_MINORS is not set
875# CONFIG_USB_SUSPEND is not set
876# CONFIG_USB_OTG is not set
877
878#
879# USB Host Controller Drivers
880#
881# CONFIG_USB_ISP116X_HCD is not set
882CONFIG_USB_OHCI_HCD=y
883# CONFIG_USB_OHCI_BIG_ENDIAN is not set
884CONFIG_USB_OHCI_LITTLE_ENDIAN=y
885# CONFIG_USB_SL811_HCD is not set
886
887#
888# USB Device Class drivers
889#
890# CONFIG_USB_ACM is not set
891# CONFIG_USB_PRINTER is not set
854 892
855# 893#
856# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support' 894# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support'
857# 895#
858 896
859# 897#
898# may also be needed; see USB_STORAGE Help for more information
899#
900# CONFIG_USB_STORAGE is not set
901# CONFIG_USB_LIBUSUAL is not set
902
903#
904# USB Input Devices
905#
906# CONFIG_USB_HID is not set
907
908#
909# USB HID Boot Protocol drivers
910#
911# CONFIG_USB_KBD is not set
912# CONFIG_USB_MOUSE is not set
913# CONFIG_USB_AIPTEK is not set
914# CONFIG_USB_WACOM is not set
915# CONFIG_USB_ACECAD is not set
916# CONFIG_USB_KBTAB is not set
917# CONFIG_USB_POWERMATE is not set
918# CONFIG_USB_MTOUCH is not set
919# CONFIG_USB_ITMTOUCH is not set
920# CONFIG_USB_EGALAX is not set
921# CONFIG_USB_YEALINK is not set
922# CONFIG_USB_XPAD is not set
923# CONFIG_USB_ATI_REMOTE is not set
924# CONFIG_USB_ATI_REMOTE2 is not set
925# CONFIG_USB_KEYSPAN_REMOTE is not set
926# CONFIG_USB_APPLETOUCH is not set
927
928#
929# USB Imaging devices
930#
931# CONFIG_USB_MDC800 is not set
932
933#
934# USB Multimedia devices
935#
936# CONFIG_USB_DABUSB is not set
937
938#
939# Video4Linux support is needed for USB Multimedia device support
940#
941
942#
943# USB Network Adapters
944#
945# CONFIG_USB_CATC is not set
946# CONFIG_USB_KAWETH is not set
947# CONFIG_USB_PEGASUS is not set
948# CONFIG_USB_RTL8150 is not set
949# CONFIG_USB_USBNET is not set
950CONFIG_USB_MON=y
951
952#
953# USB port drivers
954#
955# CONFIG_USB_USS720 is not set
956
957#
958# USB Serial Converter support
959#
960# CONFIG_USB_SERIAL is not set
961
962#
963# USB Miscellaneous drivers
964#
965# CONFIG_USB_EMI62 is not set
966# CONFIG_USB_EMI26 is not set
967# CONFIG_USB_AUERSWALD is not set
968# CONFIG_USB_RIO500 is not set
969# CONFIG_USB_LEGOTOWER is not set
970# CONFIG_USB_LCD is not set
971# CONFIG_USB_LED is not set
972# CONFIG_USB_CYTHERM is not set
973# CONFIG_USB_PHIDGETKIT is not set
974# CONFIG_USB_PHIDGETSERVO is not set
975# CONFIG_USB_IDMOUSE is not set
976# CONFIG_USB_LD is not set
977# CONFIG_USB_TEST is not set
978
979#
980# USB DSL modem support
981#
982
983#
860# USB Gadget Support 984# USB Gadget Support
861# 985#
862# CONFIG_USB_GADGET is not set 986# CONFIG_USB_GADGET is not set
987# CONFIG_USB_GADGET_NET2280 is not set
988# CONFIG_USB_GADGET_PXA2XX is not set
989# CONFIG_USB_GADGET_GOKU is not set
990# CONFIG_USB_GADGET_LH7A40X is not set
991# CONFIG_USB_GADGET_OMAP is not set
992# CONFIG_USB_GADGET_DUMMY_HCD is not set
993# CONFIG_USB_ZERO is not set
994# CONFIG_USB_ETH is not set
995# CONFIG_USB_GADGETFS is not set
996# CONFIG_USB_FILE_STORAGE is not set
997# CONFIG_USB_G_SERIAL is not set
863 998
864# 999#
865# MMC/SD Card support 1000# MMC/SD Card support
diff --git a/arch/arm/kernel/apm.c b/arch/arm/kernel/apm.c
index 766b6c05c6db..2bed290fec76 100644
--- a/arch/arm/kernel/apm.c
+++ b/arch/arm/kernel/apm.c
@@ -357,10 +357,8 @@ static int apm_open(struct inode * inode, struct file * filp)
357{ 357{
358 struct apm_user *as; 358 struct apm_user *as;
359 359
360 as = (struct apm_user *)kmalloc(sizeof(*as), GFP_KERNEL); 360 as = (struct apm_user *)kzalloc(sizeof(*as), GFP_KERNEL);
361 if (as) { 361 if (as) {
362 memset(as, 0, sizeof(*as));
363
364 /* 362 /*
365 * XXX - this is a tiny bit broken, when we consider BSD 363 * XXX - this is a tiny bit broken, when we consider BSD
366 * process accounting. If the device is opened by root, we 364 * process accounting. If the device is opened by root, we
diff --git a/arch/arm/kernel/bios32.c b/arch/arm/kernel/bios32.c
index c4923fac8dff..de606dfa8db9 100644
--- a/arch/arm/kernel/bios32.c
+++ b/arch/arm/kernel/bios32.c
@@ -540,12 +540,10 @@ static void __init pcibios_init_hw(struct hw_pci *hw)
540 int nr, busnr; 540 int nr, busnr;
541 541
542 for (nr = busnr = 0; nr < hw->nr_controllers; nr++) { 542 for (nr = busnr = 0; nr < hw->nr_controllers; nr++) {
543 sys = kmalloc(sizeof(struct pci_sys_data), GFP_KERNEL); 543 sys = kzalloc(sizeof(struct pci_sys_data), GFP_KERNEL);
544 if (!sys) 544 if (!sys)
545 panic("PCI: unable to allocate sys data!"); 545 panic("PCI: unable to allocate sys data!");
546 546
547 memset(sys, 0, sizeof(struct pci_sys_data));
548
549 sys->hw = hw; 547 sys->hw = hw;
550 sys->busnr = busnr; 548 sys->busnr = busnr;
551 sys->swizzle = hw->swizzle; 549 sys->swizzle = hw->swizzle;
diff --git a/arch/arm/kernel/compat.c b/arch/arm/kernel/compat.c
index 7195add42e74..60cfa7f3226c 100644
--- a/arch/arm/kernel/compat.c
+++ b/arch/arm/kernel/compat.c
@@ -27,6 +27,8 @@
27 27
28#include <asm/mach/arch.h> 28#include <asm/mach/arch.h>
29 29
30#include "compat.h"
31
30/* 32/*
31 * Usage: 33 * Usage:
32 * - do not go blindly adding fields, add them at the end 34 * - do not go blindly adding fields, add them at the end
diff --git a/arch/arm/kernel/compat.h b/arch/arm/kernel/compat.h
new file mode 100644
index 000000000000..27e61a68bd1c
--- /dev/null
+++ b/arch/arm/kernel/compat.h
@@ -0,0 +1,13 @@
1/*
2 * linux/arch/arm/kernel/compat.h
3 *
4 * Copyright (C) 2001 Russell King
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
9*/
10
11extern void convert_to_tag_list(struct tag *tags);
12
13extern void squash_mem_tags(struct tag *tag);
diff --git a/arch/arm/kernel/debug.S b/arch/arm/kernel/debug.S
index caaa919ab47a..da280bae3d07 100644
--- a/arch/arm/kernel/debug.S
+++ b/arch/arm/kernel/debug.S
@@ -11,7 +11,6 @@
11 */ 11 */
12#include <linux/config.h> 12#include <linux/config.h>
13#include <linux/linkage.h> 13#include <linux/linkage.h>
14#include <asm/hardware.h>
15 14
16 .text 15 .text
17 16
diff --git a/arch/arm/kernel/ecard.c b/arch/arm/kernel/ecard.c
index 74ea29c3205e..00aa225e8d95 100644
--- a/arch/arm/kernel/ecard.c
+++ b/arch/arm/kernel/ecard.c
@@ -807,14 +807,12 @@ static struct expansion_card *__init ecard_alloc_card(int type, int slot)
807 unsigned long base; 807 unsigned long base;
808 int i; 808 int i;
809 809
810 ec = kmalloc(sizeof(ecard_t), GFP_KERNEL); 810 ec = kzalloc(sizeof(ecard_t), GFP_KERNEL);
811 if (!ec) { 811 if (!ec) {
812 ec = ERR_PTR(-ENOMEM); 812 ec = ERR_PTR(-ENOMEM);
813 goto nomem; 813 goto nomem;
814 } 814 }
815 815
816 memset(ec, 0, sizeof(ecard_t));
817
818 ec->slot_no = slot; 816 ec->slot_no = slot;
819 ec->type = type; 817 ec->type = type;
820 ec->irq = NO_IRQ; 818 ec->irq = NO_IRQ;
diff --git a/arch/arm/kernel/entry-armv.S b/arch/arm/kernel/entry-armv.S
index ec48d70c6d8b..ab8e600c18c8 100644
--- a/arch/arm/kernel/entry-armv.S
+++ b/arch/arm/kernel/entry-armv.S
@@ -484,7 +484,6 @@ call_fpe:
484 movcss r7, r5, lsr #(TIF_USING_IWMMXT + 1) 484 movcss r7, r5, lsr #(TIF_USING_IWMMXT + 1)
485 bcs iwmmxt_task_enable 485 bcs iwmmxt_task_enable
486#endif 486#endif
487 enable_irq
488 add pc, pc, r8, lsr #6 487 add pc, pc, r8, lsr #6
489 mov r0, r0 488 mov r0, r0
490 489
@@ -511,6 +510,7 @@ call_fpe:
511 mov pc, lr @ CP#15 (Control) 510 mov pc, lr @ CP#15 (Control)
512 511
513do_fpe: 512do_fpe:
513 enable_irq
514 ldr r4, .LCfp 514 ldr r4, .LCfp
515 add r10, r10, #TI_FPSTATE @ r10 = workspace 515 add r10, r10, #TI_FPSTATE @ r10 = workspace
516 ldr pc, [r4] @ Call FP module USR entry point 516 ldr pc, [r4] @ Call FP module USR entry point
@@ -666,7 +666,7 @@ __kuser_helper_start:
666 * 666 *
667 * #define __kernel_dmb() \ 667 * #define __kernel_dmb() \
668 * asm volatile ( "mov r0, #0xffff0fff; mov lr, pc; sub pc, r0, #95" \ 668 * asm volatile ( "mov r0, #0xffff0fff; mov lr, pc; sub pc, r0, #95" \
669 * : : : "lr","cc" ) 669 * : : : "r0", "lr","cc" )
670 */ 670 */
671 671
672__kuser_memory_barrier: @ 0xffff0fa0 672__kuser_memory_barrier: @ 0xffff0fa0
diff --git a/arch/arm/kernel/entry-header.S b/arch/arm/kernel/entry-header.S
index 55c99cdab7d6..f1c2fd5b63e4 100644
--- a/arch/arm/kernel/entry-header.S
+++ b/arch/arm/kernel/entry-header.S
@@ -37,24 +37,6 @@
37#endif 37#endif
38 .endm 38 .endm
39 39
40#if __LINUX_ARM_ARCH__ >= 6
41 .macro disable_irq
42 cpsid i
43 .endm
44
45 .macro enable_irq
46 cpsie i
47 .endm
48#else
49 .macro disable_irq
50 msr cpsr_c, #PSR_I_BIT | SVC_MODE
51 .endm
52
53 .macro enable_irq
54 msr cpsr_c, #SVC_MODE
55 .endm
56#endif
57
58 .macro get_thread_info, rd 40 .macro get_thread_info, rd
59 mov \rd, sp, lsr #13 41 mov \rd, sp, lsr #13
60 mov \rd, \rd, lsl #13 42 mov \rd, \rd, lsl #13
diff --git a/arch/arm/kernel/head-common.S b/arch/arm/kernel/head-common.S
new file mode 100644
index 000000000000..a52da0ddb43d
--- /dev/null
+++ b/arch/arm/kernel/head-common.S
@@ -0,0 +1,217 @@
1/*
2 * linux/arch/arm/kernel/head-common.S
3 *
4 * Copyright (C) 1994-2002 Russell King
5 * Copyright (c) 2003 ARM Limited
6 * All Rights Reserved
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2 as
10 * published by the Free Software Foundation.
11 *
12 */
13
14 .type __switch_data, %object
15__switch_data:
16 .long __mmap_switched
17 .long __data_loc @ r4
18 .long __data_start @ r5
19 .long __bss_start @ r6
20 .long _end @ r7
21 .long processor_id @ r4
22 .long __machine_arch_type @ r5
23 .long cr_alignment @ r6
24 .long init_thread_union + THREAD_START_SP @ sp
25
26/*
27 * The following fragment of code is executed with the MMU on in MMU mode,
28 * and uses absolute addresses; this is not position independent.
29 *
30 * r0 = cp#15 control register
31 * r1 = machine ID
32 * r9 = processor ID
33 */
34 .type __mmap_switched, %function
35__mmap_switched:
36 adr r3, __switch_data + 4
37
38 ldmia r3!, {r4, r5, r6, r7}
39 cmp r4, r5 @ Copy data segment if needed
401: cmpne r5, r6
41 ldrne fp, [r4], #4
42 strne fp, [r5], #4
43 bne 1b
44
45 mov fp, #0 @ Clear BSS (and zero fp)
461: cmp r6, r7
47 strcc fp, [r6],#4
48 bcc 1b
49
50 ldmia r3, {r4, r5, r6, sp}
51 str r9, [r4] @ Save processor ID
52 str r1, [r5] @ Save machine type
53 bic r4, r0, #CR_A @ Clear 'A' bit
54 stmia r6, {r0, r4} @ Save control register values
55 b start_kernel
56
57/*
58 * Exception handling. Something went wrong and we can't proceed. We
59 * ought to tell the user, but since we don't have any guarantee that
60 * we're even running on the right architecture, we do virtually nothing.
61 *
62 * If CONFIG_DEBUG_LL is set we try to print out something about the error
63 * and hope for the best (useful if bootloader fails to pass a proper
64 * machine ID for example).
65 */
66
67 .type __error_p, %function
68__error_p:
69#ifdef CONFIG_DEBUG_LL
70 adr r0, str_p1
71 bl printascii
72 b __error
73str_p1: .asciz "\nError: unrecognized/unsupported processor variant.\n"
74 .align
75#endif
76
77 .type __error_a, %function
78__error_a:
79#ifdef CONFIG_DEBUG_LL
80 mov r4, r1 @ preserve machine ID
81 adr r0, str_a1
82 bl printascii
83 mov r0, r4
84 bl printhex8
85 adr r0, str_a2
86 bl printascii
87 adr r3, 3f
88 ldmia r3, {r4, r5, r6} @ get machine desc list
89 sub r4, r3, r4 @ get offset between virt&phys
90 add r5, r5, r4 @ convert virt addresses to
91 add r6, r6, r4 @ physical address space
921: ldr r0, [r5, #MACHINFO_TYPE] @ get machine type
93 bl printhex8
94 mov r0, #'\t'
95 bl printch
96 ldr r0, [r5, #MACHINFO_NAME] @ get machine name
97 add r0, r0, r4
98 bl printascii
99 mov r0, #'\n'
100 bl printch
101 add r5, r5, #SIZEOF_MACHINE_DESC @ next machine_desc
102 cmp r5, r6
103 blo 1b
104 adr r0, str_a3
105 bl printascii
106 b __error
107str_a1: .asciz "\nError: unrecognized/unsupported machine ID (r1 = 0x"
108str_a2: .asciz ").\n\nAvailable machine support:\n\nID (hex)\tNAME\n"
109str_a3: .asciz "\nPlease check your kernel config and/or bootloader.\n"
110 .align
111#endif
112
113 .type __error, %function
114__error:
115#ifdef CONFIG_ARCH_RPC
116/*
117 * Turn the screen red on a error - RiscPC only.
118 */
119 mov r0, #0x02000000
120 mov r3, #0x11
121 orr r3, r3, r3, lsl #8
122 orr r3, r3, r3, lsl #16
123 str r3, [r0], #4
124 str r3, [r0], #4
125 str r3, [r0], #4
126 str r3, [r0], #4
127#endif
1281: mov r0, r0
129 b 1b
130
131
132/*
133 * Read processor ID register (CP#15, CR0), and look up in the linker-built
134 * supported processor list. Note that we can't use the absolute addresses
135 * for the __proc_info lists since we aren't running with the MMU on
136 * (and therefore, we are not in the correct address space). We have to
137 * calculate the offset.
138 *
139 * r9 = cpuid
140 * Returns:
141 * r3, r4, r6 corrupted
142 * r5 = proc_info pointer in physical address space
143 * r9 = cpuid (preserved)
144 */
145 .type __lookup_processor_type, %function
146__lookup_processor_type:
147 adr r3, 3f
148 ldmda r3, {r5 - r7}
149 sub r3, r3, r7 @ get offset between virt&phys
150 add r5, r5, r3 @ convert virt addresses to
151 add r6, r6, r3 @ physical address space
1521: ldmia r5, {r3, r4} @ value, mask
153 and r4, r4, r9 @ mask wanted bits
154 teq r3, r4
155 beq 2f
156 add r5, r5, #PROC_INFO_SZ @ sizeof(proc_info_list)
157 cmp r5, r6
158 blo 1b
159 mov r5, #0 @ unknown processor
1602: mov pc, lr
161
162/*
163 * This provides a C-API version of the above function.
164 */
165ENTRY(lookup_processor_type)
166 stmfd sp!, {r4 - r7, r9, lr}
167 mov r9, r0
168 bl __lookup_processor_type
169 mov r0, r5
170 ldmfd sp!, {r4 - r7, r9, pc}
171
172/*
173 * Look in include/asm-arm/procinfo.h and arch/arm/kernel/arch.[ch] for
174 * more information about the __proc_info and __arch_info structures.
175 */
176 .long __proc_info_begin
177 .long __proc_info_end
1783: .long .
179 .long __arch_info_begin
180 .long __arch_info_end
181
182/*
183 * Lookup machine architecture in the linker-build list of architectures.
184 * Note that we can't use the absolute addresses for the __arch_info
185 * lists since we aren't running with the MMU on (and therefore, we are
186 * not in the correct address space). We have to calculate the offset.
187 *
188 * r1 = machine architecture number
189 * Returns:
190 * r3, r4, r6 corrupted
191 * r5 = mach_info pointer in physical address space
192 */
193 .type __lookup_machine_type, %function
194__lookup_machine_type:
195 adr r3, 3b
196 ldmia r3, {r4, r5, r6}
197 sub r3, r3, r4 @ get offset between virt&phys
198 add r5, r5, r3 @ convert virt addresses to
199 add r6, r6, r3 @ physical address space
2001: ldr r3, [r5, #MACHINFO_TYPE] @ get machine type
201 teq r3, r1 @ matches loader number?
202 beq 2f @ found
203 add r5, r5, #SIZEOF_MACHINE_DESC @ next machine_desc
204 cmp r5, r6
205 blo 1b
206 mov r5, #0 @ unknown machine
2072: mov pc, lr
208
209/*
210 * This provides a C-API version of the above function.
211 */
212ENTRY(lookup_machine_type)
213 stmfd sp!, {r4 - r6, lr}
214 mov r1, r0
215 bl __lookup_machine_type
216 mov r0, r5
217 ldmfd sp!, {r4 - r6, pc}
diff --git a/arch/arm/kernel/head-nommu.S b/arch/arm/kernel/head-nommu.S
new file mode 100644
index 000000000000..b093ab8738b5
--- /dev/null
+++ b/arch/arm/kernel/head-nommu.S
@@ -0,0 +1,83 @@
1/*
2 * linux/arch/arm/kernel/head-nommu.S
3 *
4 * Copyright (C) 1994-2002 Russell King
5 * Copyright (C) 2003-2006 Hyok S. Choi
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License version 2 as
9 * published by the Free Software Foundation.
10 *
11 * Common kernel startup code (non-paged MM)
12 * for 32-bit CPUs which has a process ID register(CP15).
13 *
14 */
15#include <linux/config.h>
16#include <linux/linkage.h>
17#include <linux/init.h>
18
19#include <asm/assembler.h>
20#include <asm/mach-types.h>
21#include <asm/procinfo.h>
22#include <asm/ptrace.h>
23#include <asm/constants.h>
24#include <asm/system.h>
25
26#define PROCINFO_INITFUNC 12
27
28/*
29 * Kernel startup entry point.
30 * ---------------------------
31 *
32 * This is normally called from the decompressor code. The requirements
33 * are: MMU = off, D-cache = off, I-cache = dont care, r0 = 0,
34 * r1 = machine nr.
35 *
36 * See linux/arch/arm/tools/mach-types for the complete list of machine
37 * numbers for r1.
38 *
39 */
40 __INIT
41 .type stext, %function
42ENTRY(stext)
43 msr cpsr_c, #PSR_F_BIT | PSR_I_BIT | MODE_SVC @ ensure svc mode
44 @ and irqs disabled
45 mrc p15, 0, r9, c0, c0 @ get processor id
46 bl __lookup_processor_type @ r5=procinfo r9=cpuid
47 movs r10, r5 @ invalid processor (r5=0)?
48 beq __error_p @ yes, error 'p'
49 bl __lookup_machine_type @ r5=machinfo
50 movs r8, r5 @ invalid machine (r5=0)?
51 beq __error_a @ yes, error 'a'
52
53 ldr r13, __switch_data @ address to jump to after
54 @ the initialization is done
55 adr lr, __after_proc_init @ return (PIC) address
56 add pc, r10, #PROCINFO_INITFUNC
57
58/*
59 * Set the Control Register and Read the process ID.
60 */
61 .type __after_proc_init, %function
62__after_proc_init:
63 mrc p15, 0, r0, c1, c0, 0 @ read control reg
64#ifdef CONFIG_ALIGNMENT_TRAP
65 orr r0, r0, #CR_A
66#else
67 bic r0, r0, #CR_A
68#endif
69#ifdef CONFIG_CPU_DCACHE_DISABLE
70 bic r0, r0, #CR_C
71#endif
72#ifdef CONFIG_CPU_BPREDICT_DISABLE
73 bic r0, r0, #CR_Z
74#endif
75#ifdef CONFIG_CPU_ICACHE_DISABLE
76 bic r0, r0, #CR_I
77#endif
78 mcr p15, 0, r0, c1, c0, 0 @ write control reg
79
80 mov pc, r13 @ clear the BSS and jump
81 @ to start_kernel
82
83#include "head-common.S"
diff --git a/arch/arm/kernel/head.S b/arch/arm/kernel/head.S
index 1aca1775b28f..04b66a9328ef 100644
--- a/arch/arm/kernel/head.S
+++ b/arch/arm/kernel/head.S
@@ -28,10 +28,9 @@
28#define PROCINFO_INITFUNC 12 28#define PROCINFO_INITFUNC 12
29 29
30#define MACHINFO_TYPE 0 30#define MACHINFO_TYPE 0
31#define MACHINFO_PHYSRAM 4 31#define MACHINFO_PHYSIO 4
32#define MACHINFO_PHYSIO 8 32#define MACHINFO_PGOFFIO 8
33#define MACHINFO_PGOFFIO 12 33#define MACHINFO_NAME 12
34#define MACHINFO_NAME 16
35 34
36#define KERNEL_RAM_ADDR (PAGE_OFFSET + TEXT_OFFSET) 35#define KERNEL_RAM_ADDR (PAGE_OFFSET + TEXT_OFFSET)
37 36
@@ -82,6 +81,7 @@
82ENTRY(stext) 81ENTRY(stext)
83 msr cpsr_c, #PSR_F_BIT | PSR_I_BIT | MODE_SVC @ ensure svc mode 82 msr cpsr_c, #PSR_F_BIT | PSR_I_BIT | MODE_SVC @ ensure svc mode
84 @ and irqs disabled 83 @ and irqs disabled
84 mrc p15, 0, r9, c0, c0 @ get processor id
85 bl __lookup_processor_type @ r5=procinfo r9=cpuid 85 bl __lookup_processor_type @ r5=procinfo r9=cpuid
86 movs r10, r5 @ invalid processor (r5=0)? 86 movs r10, r5 @ invalid processor (r5=0)?
87 beq __error_p @ yes, error 'p' 87 beq __error_p @ yes, error 'p'
@@ -102,49 +102,6 @@ ENTRY(stext)
102 adr lr, __enable_mmu @ return (PIC) address 102 adr lr, __enable_mmu @ return (PIC) address
103 add pc, r10, #PROCINFO_INITFUNC 103 add pc, r10, #PROCINFO_INITFUNC
104 104
105 .type __switch_data, %object
106__switch_data:
107 .long __mmap_switched
108 .long __data_loc @ r4
109 .long __data_start @ r5
110 .long __bss_start @ r6
111 .long _end @ r7
112 .long processor_id @ r4
113 .long __machine_arch_type @ r5
114 .long cr_alignment @ r6
115 .long init_thread_union + THREAD_START_SP @ sp
116
117/*
118 * The following fragment of code is executed with the MMU on, and uses
119 * absolute addresses; this is not position independent.
120 *
121 * r0 = cp#15 control register
122 * r1 = machine ID
123 * r9 = processor ID
124 */
125 .type __mmap_switched, %function
126__mmap_switched:
127 adr r3, __switch_data + 4
128
129 ldmia r3!, {r4, r5, r6, r7}
130 cmp r4, r5 @ Copy data segment if needed
1311: cmpne r5, r6
132 ldrne fp, [r4], #4
133 strne fp, [r5], #4
134 bne 1b
135
136 mov fp, #0 @ Clear BSS (and zero fp)
1371: cmp r6, r7
138 strcc fp, [r6],#4
139 bcc 1b
140
141 ldmia r3, {r4, r5, r6, sp}
142 str r9, [r4] @ Save processor ID
143 str r1, [r5] @ Save machine type
144 bic r4, r0, #CR_A @ Clear 'A' bit
145 stmia r6, {r0, r4} @ Save control register values
146 b start_kernel
147
148#if defined(CONFIG_SMP) 105#if defined(CONFIG_SMP)
149 .type secondary_startup, #function 106 .type secondary_startup, #function
150ENTRY(secondary_startup) 107ENTRY(secondary_startup)
@@ -156,6 +113,7 @@ ENTRY(secondary_startup)
156 * as it has already been validated by the primary processor. 113 * as it has already been validated by the primary processor.
157 */ 114 */
158 msr cpsr_c, #PSR_F_BIT | PSR_I_BIT | MODE_SVC 115 msr cpsr_c, #PSR_F_BIT | PSR_I_BIT | MODE_SVC
116 mrc p15, 0, r9, c0, c0 @ get processor id
159 bl __lookup_processor_type 117 bl __lookup_processor_type
160 movs r10, r5 @ invalid processor? 118 movs r10, r5 @ invalid processor?
161 moveq r0, #'p' @ yes, error 'p' 119 moveq r0, #'p' @ yes, error 'p'
@@ -366,165 +324,4 @@ __create_page_tables:
366 mov pc, lr 324 mov pc, lr
367 .ltorg 325 .ltorg
368 326
369 327#include "head-common.S"
370
371/*
372 * Exception handling. Something went wrong and we can't proceed. We
373 * ought to tell the user, but since we don't have any guarantee that
374 * we're even running on the right architecture, we do virtually nothing.
375 *
376 * If CONFIG_DEBUG_LL is set we try to print out something about the error
377 * and hope for the best (useful if bootloader fails to pass a proper
378 * machine ID for example).
379 */
380
381 .type __error_p, %function
382__error_p:
383#ifdef CONFIG_DEBUG_LL
384 adr r0, str_p1
385 bl printascii
386 b __error
387str_p1: .asciz "\nError: unrecognized/unsupported processor variant.\n"
388 .align
389#endif
390
391 .type __error_a, %function
392__error_a:
393#ifdef CONFIG_DEBUG_LL
394 mov r4, r1 @ preserve machine ID
395 adr r0, str_a1
396 bl printascii
397 mov r0, r4
398 bl printhex8
399 adr r0, str_a2
400 bl printascii
401 adr r3, 3f
402 ldmia r3, {r4, r5, r6} @ get machine desc list
403 sub r4, r3, r4 @ get offset between virt&phys
404 add r5, r5, r4 @ convert virt addresses to
405 add r6, r6, r4 @ physical address space
4061: ldr r0, [r5, #MACHINFO_TYPE] @ get machine type
407 bl printhex8
408 mov r0, #'\t'
409 bl printch
410 ldr r0, [r5, #MACHINFO_NAME] @ get machine name
411 add r0, r0, r4
412 bl printascii
413 mov r0, #'\n'
414 bl printch
415 add r5, r5, #SIZEOF_MACHINE_DESC @ next machine_desc
416 cmp r5, r6
417 blo 1b
418 adr r0, str_a3
419 bl printascii
420 b __error
421str_a1: .asciz "\nError: unrecognized/unsupported machine ID (r1 = 0x"
422str_a2: .asciz ").\n\nAvailable machine support:\n\nID (hex)\tNAME\n"
423str_a3: .asciz "\nPlease check your kernel config and/or bootloader.\n"
424 .align
425#endif
426
427 .type __error, %function
428__error:
429#ifdef CONFIG_ARCH_RPC
430/*
431 * Turn the screen red on a error - RiscPC only.
432 */
433 mov r0, #0x02000000
434 mov r3, #0x11
435 orr r3, r3, r3, lsl #8
436 orr r3, r3, r3, lsl #16
437 str r3, [r0], #4
438 str r3, [r0], #4
439 str r3, [r0], #4
440 str r3, [r0], #4
441#endif
4421: mov r0, r0
443 b 1b
444
445
446/*
447 * Read processor ID register (CP#15, CR0), and look up in the linker-built
448 * supported processor list. Note that we can't use the absolute addresses
449 * for the __proc_info lists since we aren't running with the MMU on
450 * (and therefore, we are not in the correct address space). We have to
451 * calculate the offset.
452 *
453 * Returns:
454 * r3, r4, r6 corrupted
455 * r5 = proc_info pointer in physical address space
456 * r9 = cpuid
457 */
458 .type __lookup_processor_type, %function
459__lookup_processor_type:
460 adr r3, 3f
461 ldmda r3, {r5, r6, r9}
462 sub r3, r3, r9 @ get offset between virt&phys
463 add r5, r5, r3 @ convert virt addresses to
464 add r6, r6, r3 @ physical address space
465 mrc p15, 0, r9, c0, c0 @ get processor id
4661: ldmia r5, {r3, r4} @ value, mask
467 and r4, r4, r9 @ mask wanted bits
468 teq r3, r4
469 beq 2f
470 add r5, r5, #PROC_INFO_SZ @ sizeof(proc_info_list)
471 cmp r5, r6
472 blo 1b
473 mov r5, #0 @ unknown processor
4742: mov pc, lr
475
476/*
477 * This provides a C-API version of the above function.
478 */
479ENTRY(lookup_processor_type)
480 stmfd sp!, {r4 - r6, r9, lr}
481 bl __lookup_processor_type
482 mov r0, r5
483 ldmfd sp!, {r4 - r6, r9, pc}
484
485/*
486 * Look in include/asm-arm/procinfo.h and arch/arm/kernel/arch.[ch] for
487 * more information about the __proc_info and __arch_info structures.
488 */
489 .long __proc_info_begin
490 .long __proc_info_end
4913: .long .
492 .long __arch_info_begin
493 .long __arch_info_end
494
495/*
496 * Lookup machine architecture in the linker-build list of architectures.
497 * Note that we can't use the absolute addresses for the __arch_info
498 * lists since we aren't running with the MMU on (and therefore, we are
499 * not in the correct address space). We have to calculate the offset.
500 *
501 * r1 = machine architecture number
502 * Returns:
503 * r3, r4, r6 corrupted
504 * r5 = mach_info pointer in physical address space
505 */
506 .type __lookup_machine_type, %function
507__lookup_machine_type:
508 adr r3, 3b
509 ldmia r3, {r4, r5, r6}
510 sub r3, r3, r4 @ get offset between virt&phys
511 add r5, r5, r3 @ convert virt addresses to
512 add r6, r6, r3 @ physical address space
5131: ldr r3, [r5, #MACHINFO_TYPE] @ get machine type
514 teq r3, r1 @ matches loader number?
515 beq 2f @ found
516 add r5, r5, #SIZEOF_MACHINE_DESC @ next machine_desc
517 cmp r5, r6
518 blo 1b
519 mov r5, #0 @ unknown machine
5202: mov pc, lr
521
522/*
523 * This provides a C-API version of the above function.
524 */
525ENTRY(lookup_machine_type)
526 stmfd sp!, {r4 - r6, lr}
527 mov r1, r0
528 bl __lookup_machine_type
529 mov r0, r5
530 ldmfd sp!, {r4 - r6, pc}
diff --git a/arch/arm/kernel/irq.c b/arch/arm/kernel/irq.c
index 1d50d2b98f55..2d5896b36181 100644
--- a/arch/arm/kernel/irq.c
+++ b/arch/arm/kernel/irq.c
@@ -305,14 +305,19 @@ report_bad_irq(unsigned int irq, struct pt_regs *regs, struct irqdesc *desc, int
305 static int count = 100; 305 static int count = 100;
306 struct irqaction *action; 306 struct irqaction *action;
307 307
308 if (!count || noirqdebug) 308 if (noirqdebug)
309 return; 309 return;
310 310
311 count--;
312
313 if (ret != IRQ_HANDLED && ret != IRQ_NONE) { 311 if (ret != IRQ_HANDLED && ret != IRQ_NONE) {
312 if (!count)
313 return;
314 count--;
314 printk("irq%u: bogus retval mask %x\n", irq, ret); 315 printk("irq%u: bogus retval mask %x\n", irq, ret);
315 } else { 316 } else {
317 desc->irqs_unhandled++;
318 if (desc->irqs_unhandled <= 99900)
319 return;
320 desc->irqs_unhandled = 0;
316 printk("irq%u: nobody cared\n", irq); 321 printk("irq%u: nobody cared\n", irq);
317 } 322 }
318 show_regs(regs); 323 show_regs(regs);
diff --git a/arch/arm/kernel/process.c b/arch/arm/kernel/process.c
index 4b4e4cf79c80..1ff75cee4b0d 100644
--- a/arch/arm/kernel/process.c
+++ b/arch/arm/kernel/process.c
@@ -27,6 +27,7 @@
27#include <linux/kallsyms.h> 27#include <linux/kallsyms.h>
28#include <linux/init.h> 28#include <linux/init.h>
29#include <linux/cpu.h> 29#include <linux/cpu.h>
30#include <linux/elfcore.h>
30 31
31#include <asm/leds.h> 32#include <asm/leds.h>
32#include <asm/processor.h> 33#include <asm/processor.h>
@@ -83,7 +84,7 @@ EXPORT_SYMBOL(pm_power_off);
83 * This is our default idle handler. We need to disable 84 * This is our default idle handler. We need to disable
84 * interrupts here to ensure we don't miss a wakeup call. 85 * interrupts here to ensure we don't miss a wakeup call.
85 */ 86 */
86void default_idle(void) 87static void default_idle(void)
87{ 88{
88 if (hlt_counter) 89 if (hlt_counter)
89 cpu_relax(); 90 cpu_relax();
@@ -473,4 +474,3 @@ unsigned long get_wchan(struct task_struct *p)
473 } while (count ++ < 16); 474 } while (count ++ < 16);
474 return 0; 475 return 0;
475} 476}
476EXPORT_SYMBOL(get_wchan);
diff --git a/arch/arm/kernel/ptrace.c b/arch/arm/kernel/ptrace.c
index bc9e2f8ae326..a1d1b2906e8d 100644
--- a/arch/arm/kernel/ptrace.c
+++ b/arch/arm/kernel/ptrace.c
@@ -628,7 +628,7 @@ static int ptrace_setwmmxregs(struct task_struct *tsk, void __user *ufp)
628 if (!test_ti_thread_flag(thread, TIF_USING_IWMMXT)) 628 if (!test_ti_thread_flag(thread, TIF_USING_IWMMXT))
629 return -EACCES; 629 return -EACCES;
630 iwmmxt_task_release(thread); /* force a reload */ 630 iwmmxt_task_release(thread); /* force a reload */
631 return copy_from_user(&thead->fpstate.iwmmxt, ufp, IWMMXT_SIZE) 631 return copy_from_user(&thread->fpstate.iwmmxt, ufp, IWMMXT_SIZE)
632 ? -EFAULT : 0; 632 ? -EFAULT : 0;
633} 633}
634 634
diff --git a/arch/arm/kernel/setup.c b/arch/arm/kernel/setup.c
index 68273b4dc882..b7cd280bfd63 100644
--- a/arch/arm/kernel/setup.c
+++ b/arch/arm/kernel/setup.c
@@ -37,6 +37,8 @@
37#include <asm/mach/irq.h> 37#include <asm/mach/irq.h>
38#include <asm/mach/time.h> 38#include <asm/mach/time.h>
39 39
40#include "compat.h"
41
40#ifndef MEM_SIZE 42#ifndef MEM_SIZE
41#define MEM_SIZE (16*1024*1024) 43#define MEM_SIZE (16*1024*1024)
42#endif 44#endif
@@ -53,10 +55,7 @@ static int __init fpe_setup(char *line)
53__setup("fpe=", fpe_setup); 55__setup("fpe=", fpe_setup);
54#endif 56#endif
55 57
56extern unsigned int mem_fclk_21285;
57extern void paging_init(struct meminfo *, struct machine_desc *desc); 58extern void paging_init(struct meminfo *, struct machine_desc *desc);
58extern void convert_to_tag_list(struct tag *tags);
59extern void squash_mem_tags(struct tag *tag);
60extern void reboot_setup(char *str); 59extern void reboot_setup(char *str);
61extern int root_mountflags; 60extern int root_mountflags;
62extern void _stext, _text, _etext, __data_start, _edata, _end; 61extern void _stext, _text, _etext, __data_start, _edata, _end;
@@ -279,7 +278,7 @@ int cpu_architecture(void)
279 * These functions re-use the assembly code in head.S, which 278 * These functions re-use the assembly code in head.S, which
280 * already provide the required functionality. 279 * already provide the required functionality.
281 */ 280 */
282extern struct proc_info_list *lookup_processor_type(void); 281extern struct proc_info_list *lookup_processor_type(unsigned int);
283extern struct machine_desc *lookup_machine_type(unsigned int); 282extern struct machine_desc *lookup_machine_type(unsigned int);
284 283
285static void __init setup_processor(void) 284static void __init setup_processor(void)
@@ -291,7 +290,7 @@ static void __init setup_processor(void)
291 * types. The linker builds this table for us from the 290 * types. The linker builds this table for us from the
292 * entries in arch/arm/mm/proc-*.S 291 * entries in arch/arm/mm/proc-*.S
293 */ 292 */
294 list = lookup_processor_type(); 293 list = lookup_processor_type(processor_id);
295 if (!list) { 294 if (!list) {
296 printk("CPU configuration botched (ID %08x), unable " 295 printk("CPU configuration botched (ID %08x), unable "
297 "to continue.\n", processor_id); 296 "to continue.\n", processor_id);
diff --git a/arch/arm/kernel/signal.h b/arch/arm/kernel/signal.h
index 9991049c522d..27beece15502 100644
--- a/arch/arm/kernel/signal.h
+++ b/arch/arm/kernel/signal.h
@@ -7,6 +7,6 @@
7 * it under the terms of the GNU General Public License version 2 as 7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation. 8 * published by the Free Software Foundation.
9 */ 9 */
10#define KERN_SIGRETURN_CODE 0xffff0500 10#define KERN_SIGRETURN_CODE (CONFIG_VECTORS_BASE + 0x00000500)
11 11
12extern const unsigned long sigreturn_codes[7]; 12extern const unsigned long sigreturn_codes[7];
diff --git a/arch/arm/kernel/smp.c b/arch/arm/kernel/smp.c
index 02aa300c4633..1370d726dc10 100644
--- a/arch/arm/kernel/smp.c
+++ b/arch/arm/kernel/smp.c
@@ -337,9 +337,6 @@ void __init smp_prepare_boot_cpu(void)
337 unsigned int cpu = smp_processor_id(); 337 unsigned int cpu = smp_processor_id();
338 338
339 per_cpu(cpu_data, cpu).idle = current; 339 per_cpu(cpu_data, cpu).idle = current;
340
341 cpu_set(cpu, cpu_present_map);
342 cpu_set(cpu, cpu_online_map);
343} 340}
344 341
345static void send_ipi_message(cpumask_t callmap, enum ipi_msg_type msg) 342static void send_ipi_message(cpumask_t callmap, enum ipi_msg_type msg)
diff --git a/arch/arm/kernel/sys_arm.c b/arch/arm/kernel/sys_arm.c
index a491de2d9024..8170af471439 100644
--- a/arch/arm/kernel/sys_arm.c
+++ b/arch/arm/kernel/sys_arm.c
@@ -234,7 +234,12 @@ asmlinkage int sys_ipc(uint call, int first, int second, int third,
234 */ 234 */
235asmlinkage int sys_fork(struct pt_regs *regs) 235asmlinkage int sys_fork(struct pt_regs *regs)
236{ 236{
237#ifdef CONFIG_MMU
237 return do_fork(SIGCHLD, regs->ARM_sp, regs, 0, NULL, NULL); 238 return do_fork(SIGCHLD, regs->ARM_sp, regs, 0, NULL, NULL);
239#else
240 /* can not support in nommu mode */
241 return(-EINVAL);
242#endif
238} 243}
239 244
240/* Clone a task - this clones the calling program thread. 245/* Clone a task - this clones the calling program thread.
diff --git a/arch/arm/kernel/traps.c b/arch/arm/kernel/traps.c
index 03924bcc6129..35230a060108 100644
--- a/arch/arm/kernel/traps.c
+++ b/arch/arm/kernel/traps.c
@@ -506,7 +506,7 @@ asmlinkage int arm_syscall(int no, struct pt_regs *regs)
506 if (!pmd_present(*pmd)) 506 if (!pmd_present(*pmd))
507 goto bad_access; 507 goto bad_access;
508 pte = pte_offset_map_lock(mm, pmd, addr, &ptl); 508 pte = pte_offset_map_lock(mm, pmd, addr, &ptl);
509 if (!pte_present(*pte) || !pte_write(*pte)) { 509 if (!pte_present(*pte) || !pte_dirty(*pte)) {
510 pte_unmap_unlock(pte, ptl); 510 pte_unmap_unlock(pte, ptl);
511 goto bad_access; 511 goto bad_access;
512 } 512 }
@@ -688,6 +688,7 @@ EXPORT_SYMBOL(abort);
688 688
689void __init trap_init(void) 689void __init trap_init(void)
690{ 690{
691 unsigned long vectors = CONFIG_VECTORS_BASE;
691 extern char __stubs_start[], __stubs_end[]; 692 extern char __stubs_start[], __stubs_end[];
692 extern char __vectors_start[], __vectors_end[]; 693 extern char __vectors_start[], __vectors_end[];
693 extern char __kuser_helper_start[], __kuser_helper_end[]; 694 extern char __kuser_helper_start[], __kuser_helper_end[];
@@ -698,9 +699,9 @@ void __init trap_init(void)
698 * into the vector page, mapped at 0xffff0000, and ensure these 699 * into the vector page, mapped at 0xffff0000, and ensure these
699 * are visible to the instruction stream. 700 * are visible to the instruction stream.
700 */ 701 */
701 memcpy((void *)0xffff0000, __vectors_start, __vectors_end - __vectors_start); 702 memcpy((void *)vectors, __vectors_start, __vectors_end - __vectors_start);
702 memcpy((void *)0xffff0200, __stubs_start, __stubs_end - __stubs_start); 703 memcpy((void *)vectors + 0x200, __stubs_start, __stubs_end - __stubs_start);
703 memcpy((void *)0xffff1000 - kuser_sz, __kuser_helper_start, kuser_sz); 704 memcpy((void *)vectors + 0x1000 - kuser_sz, __kuser_helper_start, kuser_sz);
704 705
705 /* 706 /*
706 * Copy signal return handlers into the vector page, and 707 * Copy signal return handlers into the vector page, and
@@ -709,6 +710,6 @@ void __init trap_init(void)
709 memcpy((void *)KERN_SIGRETURN_CODE, sigreturn_codes, 710 memcpy((void *)KERN_SIGRETURN_CODE, sigreturn_codes,
710 sizeof(sigreturn_codes)); 711 sizeof(sigreturn_codes));
711 712
712 flush_icache_range(0xffff0000, 0xffff0000 + PAGE_SIZE); 713 flush_icache_range(vectors, vectors + PAGE_SIZE);
713 modify_domain(DOMAIN_USER, DOMAIN_CLIENT); 714 modify_domain(DOMAIN_USER, DOMAIN_CLIENT);
714} 715}
diff --git a/arch/arm/lib/Makefile b/arch/arm/lib/Makefile
index 391f3ab3ff32..7b726b627ea5 100644
--- a/arch/arm/lib/Makefile
+++ b/arch/arm/lib/Makefile
@@ -18,7 +18,7 @@ lib-y := backtrace.o changebit.o csumipv6.o csumpartial.o \
18 18
19# the code in uaccess.S is not preemption safe and 19# the code in uaccess.S is not preemption safe and
20# probably faster on ARMv3 only 20# probably faster on ARMv3 only
21ifeq ($CONFIG_PREEMPT,y) 21ifeq ($(CONFIG_PREEMPT),y)
22 lib-y += copy_from_user.o copy_to_user.o 22 lib-y += copy_from_user.o copy_to_user.o
23else 23else
24ifneq ($(CONFIG_CPU_32v3),y) 24ifneq ($(CONFIG_CPU_32v3),y)
diff --git a/arch/arm/lib/backtrace.S b/arch/arm/lib/backtrace.S
index 68a21c0f3f52..3bdc8c6949c5 100644
--- a/arch/arm/lib/backtrace.S
+++ b/arch/arm/lib/backtrace.S
@@ -29,7 +29,7 @@ ENTRY(__backtrace)
29 29
30ENTRY(c_backtrace) 30ENTRY(c_backtrace)
31 31
32#ifndef CONFIG_FRAME_POINTER 32#if !defined(CONFIG_FRAME_POINTER) || !defined(CONFIG_PRINTK)
33 mov pc, lr 33 mov pc, lr
34#else 34#else
35 35
diff --git a/arch/arm/lib/copy_template.S b/arch/arm/lib/copy_template.S
index 838e435e4922..cab355c0c1f7 100644
--- a/arch/arm/lib/copy_template.S
+++ b/arch/arm/lib/copy_template.S
@@ -236,7 +236,7 @@
236 236
237 237
238/* 238/*
239 * Abort preanble and completion macros. 239 * Abort preamble and completion macros.
240 * If a fixup handler is required then those macros must surround it. 240 * If a fixup handler is required then those macros must surround it.
241 * It is assumed that the fixup code will handle the private part of 241 * It is assumed that the fixup code will handle the private part of
242 * the exit macro. 242 * the exit macro.
diff --git a/arch/arm/lib/delay.S b/arch/arm/lib/delay.S
index b3fb475b4120..9183b06c0e2f 100644
--- a/arch/arm/lib/delay.S
+++ b/arch/arm/lib/delay.S
@@ -9,28 +9,32 @@
9 */ 9 */
10#include <linux/linkage.h> 10#include <linux/linkage.h>
11#include <asm/assembler.h> 11#include <asm/assembler.h>
12#include <asm/param.h>
12 .text 13 .text
13 14
14.LC0: .word loops_per_jiffy 15.LC0: .word loops_per_jiffy
16.LC1: .word (2199023*HZ)>>11
15 17
16/* 18/*
17 * 0 <= r0 <= 2000 19 * r0 <= 2000
20 * lpj <= 0x01ffffff (max. 3355 bogomips)
21 * HZ <= 1000
18 */ 22 */
23
19ENTRY(__udelay) 24ENTRY(__udelay)
20 mov r2, #0x6800 25 ldr r2, .LC1
21 orr r2, r2, #0x00db
22 mul r0, r2, r0 26 mul r0, r2, r0
23ENTRY(__const_udelay) @ 0 <= r0 <= 0x01ffffff 27ENTRY(__const_udelay) @ 0 <= r0 <= 0x7fffff06
24 ldr r2, .LC0 28 ldr r2, .LC0
25 ldr r2, [r2] @ max = 0x0fffffff 29 ldr r2, [r2] @ max = 0x01ffffff
26 mov r0, r0, lsr #11 @ max = 0x00003fff 30 mov r0, r0, lsr #14 @ max = 0x0001ffff
27 mov r2, r2, lsr #11 @ max = 0x0003ffff 31 mov r2, r2, lsr #10 @ max = 0x00007fff
28 mul r0, r2, r0 @ max = 2^32-1 32 mul r0, r2, r0 @ max = 2^32-1
29 movs r0, r0, lsr #6 33 movs r0, r0, lsr #6
30 RETINSTR(moveq,pc,lr) 34 RETINSTR(moveq,pc,lr)
31 35
32/* 36/*
33 * loops = (r0 * 0x10c6 * 100 * loops_per_jiffy) / 2^32 37 * loops = r0 * HZ * loops_per_jiffy / 1000000
34 * 38 *
35 * Oh, if only we had a cycle counter... 39 * Oh, if only we had a cycle counter...
36 */ 40 */
diff --git a/arch/arm/lib/io-acorn.S b/arch/arm/lib/io-acorn.S
index b153523631c3..1b197ea7aab3 100644
--- a/arch/arm/lib/io-acorn.S
+++ b/arch/arm/lib/io-acorn.S
@@ -12,7 +12,6 @@
12 */ 12 */
13#include <linux/linkage.h> 13#include <linux/linkage.h>
14#include <asm/assembler.h> 14#include <asm/assembler.h>
15#include <asm/hardware.h>
16 15
17 .text 16 .text
18 .align 17 .align
diff --git a/arch/arm/mach-at91rm9200/clock.c b/arch/arm/mach-at91rm9200/clock.c
index ec8195a2a3cc..8b95467c6d61 100644
--- a/arch/arm/mach-at91rm9200/clock.c
+++ b/arch/arm/mach-at91rm9200/clock.c
@@ -201,6 +201,54 @@ static struct clk ohci_clk = {
201 .pmc_mask = 1 << AT91_ID_UHP, 201 .pmc_mask = 1 << AT91_ID_UHP,
202 .mode = pmc_periph_mode, 202 .mode = pmc_periph_mode,
203}; 203};
204static struct clk ether_clk = {
205 .name = "ether_clk",
206 .parent = &mck,
207 .pmc_mask = 1 << AT91_ID_EMAC,
208 .mode = pmc_periph_mode,
209};
210static struct clk mmc_clk = {
211 .name = "mci_clk",
212 .parent = &mck,
213 .pmc_mask = 1 << AT91_ID_MCI,
214 .mode = pmc_periph_mode,
215};
216static struct clk twi_clk = {
217 .name = "twi_clk",
218 .parent = &mck,
219 .pmc_mask = 1 << AT91_ID_TWI,
220 .mode = pmc_periph_mode,
221};
222static struct clk usart0_clk = {
223 .name = "usart0_clk",
224 .parent = &mck,
225 .pmc_mask = 1 << AT91_ID_US0,
226 .mode = pmc_periph_mode,
227};
228static struct clk usart1_clk = {
229 .name = "usart1_clk",
230 .parent = &mck,
231 .pmc_mask = 1 << AT91_ID_US1,
232 .mode = pmc_periph_mode,
233};
234static struct clk usart2_clk = {
235 .name = "usart2_clk",
236 .parent = &mck,
237 .pmc_mask = 1 << AT91_ID_US2,
238 .mode = pmc_periph_mode,
239};
240static struct clk usart3_clk = {
241 .name = "usart3_clk",
242 .parent = &mck,
243 .pmc_mask = 1 << AT91_ID_US3,
244 .mode = pmc_periph_mode,
245};
246static struct clk spi_clk = {
247 .name = "spi0_clk",
248 .parent = &mck,
249 .pmc_mask = 1 << AT91_ID_SPI,
250 .mode = pmc_periph_mode,
251};
204 252
205static struct clk *const clock_list[] = { 253static struct clk *const clock_list[] = {
206 /* four primary clocks -- MUST BE FIRST! */ 254 /* four primary clocks -- MUST BE FIRST! */
@@ -223,15 +271,18 @@ static struct clk *const clock_list[] = {
223 271
224 /* MCK and peripherals */ 272 /* MCK and peripherals */
225 &mck, 273 &mck,
226 // usart0..usart3 274 &usart0_clk,
227 // mmc 275 &usart1_clk,
276 &usart2_clk,
277 &usart3_clk,
278 &mmc_clk,
228 &udc_clk, 279 &udc_clk,
229 // i2c 280 &twi_clk,
230 // spi 281 &spi_clk,
231 // ssc0..ssc2 282 // ssc0..ssc2
232 // tc0..tc5 283 // tc0..tc5
233 &ohci_clk, 284 &ohci_clk,
234 // ether 285 &ether_clk,
235}; 286};
236 287
237 288
@@ -360,7 +411,7 @@ int clk_set_rate(struct clk *clk, unsigned long rate)
360 u32 pckr; 411 u32 pckr;
361 412
362 pckr = at91_sys_read(AT91_PMC_PCKR(clk->id)); 413 pckr = at91_sys_read(AT91_PMC_PCKR(clk->id));
363 pckr &= 0x03; 414 pckr &= AT91_PMC_CSS_PLLB; /* clock selection */
364 pckr |= prescale << 2; 415 pckr |= prescale << 2;
365 at91_sys_write(AT91_PMC_PCKR(clk->id), pckr); 416 at91_sys_write(AT91_PMC_PCKR(clk->id), pckr);
366 clk->rate_hz = actual; 417 clk->rate_hz = actual;
@@ -440,7 +491,7 @@ static int at91_clk_show(struct seq_file *s, void *unused)
440 else 491 else
441 state = ""; 492 state = "";
442 493
443 seq_printf(s, "%-10s users=%d %-3s %9ld Hz %s\n", 494 seq_printf(s, "%-10s users=%2d %-3s %9ld Hz %s\n",
444 clk->name, clk->users, state, clk_get_rate(clk), 495 clk->name, clk->users, state, clk_get_rate(clk),
445 clk->parent ? clk->parent->name : ""); 496 clk->parent ? clk->parent->name : "");
446 } 497 }
@@ -483,11 +534,18 @@ static u32 __init at91_pll_rate(struct clk *pll, u32 freq, u32 reg)
483 freq *= mul + 1; 534 freq *= mul + 1;
484 } else 535 } else
485 freq = 0; 536 freq = 0;
486 if (pll == &pllb && (reg & (1 << 28))) 537
487 freq /= 2;
488 return freq; 538 return freq;
489} 539}
490 540
541static u32 __init at91_usb_rate(struct clk *pll, u32 freq, u32 reg)
542{
543 if (pll == &pllb && (reg & AT91_PMC_USB96M))
544 return freq / 2;
545 else
546 return freq;
547}
548
491static unsigned __init at91_pll_calc(unsigned main_freq, unsigned out_freq) 549static unsigned __init at91_pll_calc(unsigned main_freq, unsigned out_freq)
492{ 550{
493 unsigned i, div = 0, mul = 0, diff = 1 << 30; 551 unsigned i, div = 0, mul = 0, diff = 1 << 30;
@@ -550,8 +608,8 @@ int __init at91_clock_init(unsigned long main_clock)
550 if (!main_clock) { 608 if (!main_clock) {
551 do { 609 do {
552 tmp = at91_sys_read(AT91_CKGR_MCFR); 610 tmp = at91_sys_read(AT91_CKGR_MCFR);
553 } while (!(tmp & 0x10000)); 611 } while (!(tmp & AT91_PMC_MAINRDY));
554 main_clock = (tmp & 0xffff) * (AT91_SLOW_CLOCK / 16); 612 main_clock = (tmp & AT91_PMC_MAINF) * (AT91_SLOW_CLOCK / 16);
555 } 613 }
556 main_clk.rate_hz = main_clock; 614 main_clk.rate_hz = main_clock;
557 615
@@ -566,13 +624,16 @@ int __init at91_clock_init(unsigned long main_clock)
566 * 624 *
567 * REVISIT: assumes MCK doesn't derive from PLLB! 625 * REVISIT: assumes MCK doesn't derive from PLLB!
568 */ 626 */
569 at91_pllb_usb_init = at91_pll_calc(main_clock, 48000000 * 2) | 0x10000000; 627 at91_pllb_usb_init = at91_pll_calc(main_clock, 48000000 * 2) | AT91_PMC_USB96M;
570 pllb.rate_hz = at91_pll_rate(&pllb, main_clock, at91_pllb_usb_init); 628 pllb.rate_hz = at91_pll_rate(&pllb, main_clock, at91_pllb_usb_init);
571 at91_sys_write(AT91_PMC_PCDR, (1 << AT91_ID_UHP) | (1 << AT91_ID_UDP)); 629 at91_sys_write(AT91_PMC_PCDR, (1 << AT91_ID_UHP) | (1 << AT91_ID_UDP));
572 at91_sys_write(AT91_PMC_SCDR, AT91_PMC_UHP | AT91_PMC_UDP); 630 at91_sys_write(AT91_PMC_SCDR, AT91_PMC_UHP | AT91_PMC_UDP);
573 at91_sys_write(AT91_CKGR_PLLBR, 0); 631 at91_sys_write(AT91_CKGR_PLLBR, 0);
574 at91_sys_write(AT91_PMC_SCER, AT91_PMC_MCKUDP); 632 at91_sys_write(AT91_PMC_SCER, AT91_PMC_MCKUDP);
575 633
634 udpck.rate_hz = at91_usb_rate(&pllb, pllb.rate_hz, at91_pllb_usb_init);
635 uhpck.rate_hz = at91_usb_rate(&pllb, pllb.rate_hz, at91_pllb_usb_init);
636
576 /* 637 /*
577 * MCK and CPU derive from one of those primary clocks. 638 * MCK and CPU derive from one of those primary clocks.
578 * For now, assume this parentage won't change. 639 * For now, assume this parentage won't change.
diff --git a/arch/arm/mach-at91rm9200/gpio.c b/arch/arm/mach-at91rm9200/gpio.c
index 0e396feec468..5ab46274e1a3 100644
--- a/arch/arm/mach-at91rm9200/gpio.c
+++ b/arch/arm/mach-at91rm9200/gpio.c
@@ -261,7 +261,7 @@ static void gpio_irq_handler(unsigned irq, struct irqdesc *desc, struct pt_regs
261 void __iomem *pio; 261 void __iomem *pio;
262 u32 isr; 262 u32 isr;
263 263
264 pio = (void __force __iomem *) desc->chipdata; 264 pio = desc->base;
265 265
266 /* temporarily mask (level sensitive) parent IRQ */ 266 /* temporarily mask (level sensitive) parent IRQ */
267 desc->chip->ack(irq); 267 desc->chip->ack(irq);
@@ -312,7 +312,7 @@ void __init at91_gpio_irq_setup(unsigned banks)
312 __raw_writel(~0, controller + PIO_IDR); 312 __raw_writel(~0, controller + PIO_IDR);
313 313
314 set_irq_data(id, (void *) pin); 314 set_irq_data(id, (void *) pin);
315 set_irq_chipdata(id, (void __force *) controller); 315 set_irq_chipdata(id, controller);
316 316
317 for (i = 0; i < 32; i++, pin++) { 317 for (i = 0; i < 32; i++, pin++) {
318 set_irq_chip(pin, &gpio_irqchip); 318 set_irq_chip(pin, &gpio_irqchip);
diff --git a/arch/arm/mach-at91rm9200/time.c b/arch/arm/mach-at91rm9200/time.c
index 1b6dd2deeb22..7ffcf443b99f 100644
--- a/arch/arm/mach-at91rm9200/time.c
+++ b/arch/arm/mach-at91rm9200/time.c
@@ -71,11 +71,11 @@ static irqreturn_t at91rm9200_timer_interrupt(int irq, void *dev_id, struct pt_r
71 if (at91_sys_read(AT91_ST_SR) & AT91_ST_PITS) { /* This is a shared interrupt */ 71 if (at91_sys_read(AT91_ST_SR) & AT91_ST_PITS) { /* This is a shared interrupt */
72 write_seqlock(&xtime_lock); 72 write_seqlock(&xtime_lock);
73 73
74 do { 74 while (((read_CRTR() - at91_sys_read(AT91_ST_RTAR)) & AT91_ST_ALMV) >= LATCH) {
75 timer_tick(regs); 75 timer_tick(regs);
76 rtar = (at91_sys_read(AT91_ST_RTAR) + LATCH) & AT91_ST_ALMV; 76 rtar = (at91_sys_read(AT91_ST_RTAR) + LATCH) & AT91_ST_ALMV;
77 at91_sys_write(AT91_ST_RTAR, rtar); 77 at91_sys_write(AT91_ST_RTAR, rtar);
78 } while (((read_CRTR() - at91_sys_read(AT91_ST_RTAR)) & AT91_ST_ALMV) >= LATCH); 78 }
79 79
80 write_sequnlock(&xtime_lock); 80 write_sequnlock(&xtime_lock);
81 81
diff --git a/arch/arm/mach-ep93xx/Kconfig b/arch/arm/mach-ep93xx/Kconfig
new file mode 100644
index 000000000000..cec5a21ca4e3
--- /dev/null
+++ b/arch/arm/mach-ep93xx/Kconfig
@@ -0,0 +1,21 @@
1if ARCH_EP93XX
2
3menu "Cirrus EP93xx Implementation Options"
4
5comment "EP93xx Platforms"
6
7config MACH_GESBC9312
8 bool "Support Glomation GESBC-9312-sx"
9 help
10 Say 'Y' here if you want your kernel to support the Glomation
11 GESBC-9312-sx board.
12
13config MACH_TS72XX
14 bool "Support Technologic Systems TS-72xx SBC"
15 help
16 Say 'Y' here if you want your kernel to support the
17 Technologic Systems TS-72xx board.
18
19endmenu
20
21endif
diff --git a/arch/arm/mach-ep93xx/Makefile b/arch/arm/mach-ep93xx/Makefile
new file mode 100644
index 000000000000..5393af989e94
--- /dev/null
+++ b/arch/arm/mach-ep93xx/Makefile
@@ -0,0 +1,10 @@
1#
2# Makefile for the linux kernel.
3#
4obj-y := core.o
5obj-m :=
6obj-n :=
7obj- :=
8
9obj-$(CONFIG_MACH_GESBC9312) += gesbc9312.o
10obj-$(CONFIG_MACH_TS72XX) += ts72xx.o
diff --git a/arch/arm/mach-ep93xx/Makefile.boot b/arch/arm/mach-ep93xx/Makefile.boot
new file mode 100644
index 000000000000..d5561ad15bad
--- /dev/null
+++ b/arch/arm/mach-ep93xx/Makefile.boot
@@ -0,0 +1,2 @@
1 zreladdr-y := 0x00008000
2params_phys-y := 0x00000100
diff --git a/arch/arm/mach-ep93xx/core.c b/arch/arm/mach-ep93xx/core.c
new file mode 100644
index 000000000000..2d892e4daa07
--- /dev/null
+++ b/arch/arm/mach-ep93xx/core.c
@@ -0,0 +1,442 @@
1/*
2 * arch/arm/mach-ep93xx/core.c
3 * Core routines for Cirrus EP93xx chips.
4 *
5 * Copyright (C) 2006 Lennert Buytenhek <buytenh@wantstofly.org>
6 *
7 * Thanks go to Michael Burian and Ray Lehtiniemi for their key
8 * role in the ep93xx linux community.
9 *
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License as published by
12 * the Free Software Foundation; either version 2 of the License, or (at
13 * your option) any later version.
14 */
15
16#include <linux/config.h>
17#include <linux/kernel.h>
18#include <linux/init.h>
19#include <linux/spinlock.h>
20#include <linux/sched.h>
21#include <linux/interrupt.h>
22#include <linux/serial.h>
23#include <linux/tty.h>
24#include <linux/bitops.h>
25#include <linux/serial.h>
26#include <linux/serial_8250.h>
27#include <linux/serial_core.h>
28#include <linux/device.h>
29#include <linux/mm.h>
30#include <linux/time.h>
31#include <linux/timex.h>
32#include <linux/delay.h>
33#include <linux/termios.h>
34#include <linux/amba/bus.h>
35#include <linux/amba/serial.h>
36
37#include <asm/types.h>
38#include <asm/setup.h>
39#include <asm/memory.h>
40#include <asm/hardware.h>
41#include <asm/irq.h>
42#include <asm/system.h>
43#include <asm/tlbflush.h>
44#include <asm/pgtable.h>
45#include <asm/io.h>
46
47#include <asm/mach/map.h>
48#include <asm/mach/time.h>
49#include <asm/mach/irq.h>
50#include <asm/arch/gpio.h>
51
52#include <asm/hardware/vic.h>
53
54
55/*************************************************************************
56 * Static I/O mappings that are needed for all EP93xx platforms
57 *************************************************************************/
58static struct map_desc ep93xx_io_desc[] __initdata = {
59 {
60 .virtual = EP93XX_AHB_VIRT_BASE,
61 .pfn = __phys_to_pfn(EP93XX_AHB_PHYS_BASE),
62 .length = EP93XX_AHB_SIZE,
63 .type = MT_DEVICE,
64 }, {
65 .virtual = EP93XX_APB_VIRT_BASE,
66 .pfn = __phys_to_pfn(EP93XX_APB_PHYS_BASE),
67 .length = EP93XX_APB_SIZE,
68 .type = MT_DEVICE,
69 },
70};
71
72void __init ep93xx_map_io(void)
73{
74 iotable_init(ep93xx_io_desc, ARRAY_SIZE(ep93xx_io_desc));
75}
76
77
78/*************************************************************************
79 * Timer handling for EP93xx
80 *************************************************************************
81 * The ep93xx has four internal timers. Timers 1, 2 (both 16 bit) and
82 * 3 (32 bit) count down at 508 kHz, are self-reloading, and can generate
83 * an interrupt on underflow. Timer 4 (40 bit) counts down at 983.04 kHz,
84 * is free-running, and can't generate interrupts.
85 *
86 * The 508 kHz timers are ideal for use for the timer interrupt, as the
87 * most common values of HZ divide 508 kHz nicely. We pick one of the 16
88 * bit timers (timer 1) since we don't need more than 16 bits of reload
89 * value as long as HZ >= 8.
90 *
91 * The higher clock rate of timer 4 makes it a better choice than the
92 * other timers for use in gettimeoffset(), while the fact that it can't
93 * generate interrupts means we don't have to worry about not being able
94 * to use this timer for something else. We also use timer 4 for keeping
95 * track of lost jiffies.
96 */
97static unsigned int last_jiffy_time;
98
99#define TIMER4_TICKS_PER_JIFFY ((CLOCK_TICK_RATE + (HZ/2)) / HZ)
100
101static int ep93xx_timer_interrupt(int irq, void *dev_id, struct pt_regs *regs)
102{
103 write_seqlock(&xtime_lock);
104
105 __raw_writel(1, EP93XX_TIMER1_CLEAR);
106 while (__raw_readl(EP93XX_TIMER4_VALUE_LOW) - last_jiffy_time
107 >= TIMER4_TICKS_PER_JIFFY) {
108 last_jiffy_time += TIMER4_TICKS_PER_JIFFY;
109 timer_tick(regs);
110 }
111
112 write_sequnlock(&xtime_lock);
113
114 return IRQ_HANDLED;
115}
116
117static struct irqaction ep93xx_timer_irq = {
118 .name = "ep93xx timer",
119 .flags = SA_INTERRUPT | SA_TIMER,
120 .handler = ep93xx_timer_interrupt,
121};
122
123static void __init ep93xx_timer_init(void)
124{
125 /* Enable periodic HZ timer. */
126 __raw_writel(0x48, EP93XX_TIMER1_CONTROL);
127 __raw_writel((508000 / HZ) - 1, EP93XX_TIMER1_LOAD);
128 __raw_writel(0xc8, EP93XX_TIMER1_CONTROL);
129
130 /* Enable lost jiffy timer. */
131 __raw_writel(0x100, EP93XX_TIMER4_VALUE_HIGH);
132
133 setup_irq(IRQ_EP93XX_TIMER1, &ep93xx_timer_irq);
134}
135
136static unsigned long ep93xx_gettimeoffset(void)
137{
138 int offset;
139
140 offset = __raw_readl(EP93XX_TIMER4_VALUE_LOW) - last_jiffy_time;
141
142 /* Calculate (1000000 / 983040) * offset. */
143 return offset + (53 * offset / 3072);
144}
145
146struct sys_timer ep93xx_timer = {
147 .init = ep93xx_timer_init,
148 .offset = ep93xx_gettimeoffset,
149};
150
151
152/*************************************************************************
153 * GPIO handling for EP93xx
154 *************************************************************************/
155static unsigned char gpio_int_enable[2];
156static unsigned char gpio_int_type1[2];
157static unsigned char gpio_int_type2[2];
158
159static void update_gpio_ab_int_params(int port)
160{
161 if (port == 0) {
162 __raw_writeb(0, EP93XX_GPIO_A_INT_ENABLE);
163 __raw_writeb(gpio_int_type2[0], EP93XX_GPIO_A_INT_TYPE2);
164 __raw_writeb(gpio_int_type1[0], EP93XX_GPIO_A_INT_TYPE1);
165 __raw_writeb(gpio_int_enable[0], EP93XX_GPIO_A_INT_ENABLE);
166 } else if (port == 1) {
167 __raw_writeb(0, EP93XX_GPIO_B_INT_ENABLE);
168 __raw_writeb(gpio_int_type2[1], EP93XX_GPIO_B_INT_TYPE2);
169 __raw_writeb(gpio_int_type1[1], EP93XX_GPIO_B_INT_TYPE1);
170 __raw_writeb(gpio_int_enable[1], EP93XX_GPIO_B_INT_ENABLE);
171 }
172}
173
174
175static unsigned char data_register_offset[8] = {
176 0x00, 0x04, 0x08, 0x0c, 0x20, 0x30, 0x38, 0x40,
177};
178
179static unsigned char data_direction_register_offset[8] = {
180 0x10, 0x14, 0x18, 0x1c, 0x24, 0x34, 0x3c, 0x44,
181};
182
183void gpio_line_config(int line, int direction)
184{
185 unsigned int data_direction_register;
186 unsigned long flags;
187 unsigned char v;
188
189 data_direction_register =
190 EP93XX_GPIO_REG(data_direction_register_offset[line >> 3]);
191
192 local_irq_save(flags);
193 if (direction == GPIO_OUT) {
194 if (line >= 0 && line < 16) {
195 gpio_int_enable[line >> 3] &= ~(1 << (line & 7));
196 update_gpio_ab_int_params(line >> 3);
197 }
198
199 v = __raw_readb(data_direction_register);
200 v |= 1 << (line & 7);
201 __raw_writeb(v, data_direction_register);
202 } else if (direction == GPIO_IN) {
203 v = __raw_readb(data_direction_register);
204 v &= ~(1 << (line & 7));
205 __raw_writeb(v, data_direction_register);
206 }
207 local_irq_restore(flags);
208}
209EXPORT_SYMBOL(gpio_line_config);
210
211int gpio_line_get(int line)
212{
213 unsigned int data_register;
214
215 data_register = EP93XX_GPIO_REG(data_register_offset[line >> 3]);
216
217 return !!(__raw_readb(data_register) & (1 << (line & 7)));
218}
219EXPORT_SYMBOL(gpio_line_get);
220
221void gpio_line_set(int line, int value)
222{
223 unsigned int data_register;
224 unsigned long flags;
225 unsigned char v;
226
227 data_register = EP93XX_GPIO_REG(data_register_offset[line >> 3]);
228
229 local_irq_save(flags);
230 if (value == EP93XX_GPIO_HIGH) {
231 v = __raw_readb(data_register);
232 v |= 1 << (line & 7);
233 __raw_writeb(v, data_register);
234 } else if (value == EP93XX_GPIO_LOW) {
235 v = __raw_readb(data_register);
236 v &= ~(1 << (line & 7));
237 __raw_writeb(v, data_register);
238 }
239 local_irq_restore(flags);
240}
241EXPORT_SYMBOL(gpio_line_set);
242
243
244/*************************************************************************
245 * EP93xx IRQ handling
246 *************************************************************************/
247static void ep93xx_gpio_ab_irq_handler(unsigned int irq,
248 struct irqdesc *desc, struct pt_regs *regs)
249{
250 unsigned char status;
251 int i;
252
253 status = __raw_readb(EP93XX_GPIO_A_INT_STATUS);
254 for (i = 0; i < 8; i++) {
255 if (status & (1 << i)) {
256 desc = irq_desc + IRQ_EP93XX_GPIO(0) + i;
257 desc_handle_irq(IRQ_EP93XX_GPIO(0) + i, desc, regs);
258 }
259 }
260
261 status = __raw_readb(EP93XX_GPIO_B_INT_STATUS);
262 for (i = 0; i < 8; i++) {
263 if (status & (1 << i)) {
264 desc = irq_desc + IRQ_EP93XX_GPIO(8) + i;
265 desc_handle_irq(IRQ_EP93XX_GPIO(8) + i, desc, regs);
266 }
267 }
268}
269
270static void ep93xx_gpio_ab_irq_mask_ack(unsigned int irq)
271{
272 int line = irq - IRQ_EP93XX_GPIO(0);
273 int port = line >> 3;
274
275 gpio_int_enable[port] &= ~(1 << (line & 7));
276 update_gpio_ab_int_params(port);
277
278 if (line >> 3) {
279 __raw_writel(1 << (line & 7), EP93XX_GPIO_B_INT_ACK);
280 } else {
281 __raw_writel(1 << (line & 7), EP93XX_GPIO_A_INT_ACK);
282 }
283}
284
285static void ep93xx_gpio_ab_irq_mask(unsigned int irq)
286{
287 int line = irq - IRQ_EP93XX_GPIO(0);
288 int port = line >> 3;
289
290 gpio_int_enable[port] &= ~(1 << (line & 7));
291 update_gpio_ab_int_params(port);
292}
293
294static void ep93xx_gpio_ab_irq_unmask(unsigned int irq)
295{
296 int line = irq - IRQ_EP93XX_GPIO(0);
297 int port = line >> 3;
298
299 gpio_int_enable[port] |= 1 << (line & 7);
300 update_gpio_ab_int_params(port);
301}
302
303
304/*
305 * gpio_int_type1 controls whether the interrupt is level (0) or
306 * edge (1) triggered, while gpio_int_type2 controls whether it
307 * triggers on low/falling (0) or high/rising (1).
308 */
309static int ep93xx_gpio_ab_irq_type(unsigned int irq, unsigned int type)
310{
311 int port;
312 int line;
313
314 line = irq - IRQ_EP93XX_GPIO(0);
315 gpio_line_config(line, GPIO_IN);
316
317 port = line >> 3;
318 line &= 7;
319
320 if (type & IRQT_RISING) {
321 gpio_int_type1[port] |= 1 << line;
322 gpio_int_type2[port] |= 1 << line;
323 } else if (type & IRQT_FALLING) {
324 gpio_int_type1[port] |= 1 << line;
325 gpio_int_type2[port] &= ~(1 << line);
326 } else if (type & IRQT_HIGH) {
327 gpio_int_type1[port] &= ~(1 << line);
328 gpio_int_type2[port] |= 1 << line;
329 } else if (type & IRQT_LOW) {
330 gpio_int_type1[port] &= ~(1 << line);
331 gpio_int_type2[port] &= ~(1 << line);
332 }
333 update_gpio_ab_int_params(port);
334
335 return 0;
336}
337
338static struct irqchip ep93xx_gpio_ab_irq_chip = {
339 .ack = ep93xx_gpio_ab_irq_mask_ack,
340 .mask = ep93xx_gpio_ab_irq_mask,
341 .unmask = ep93xx_gpio_ab_irq_unmask,
342 .set_type = ep93xx_gpio_ab_irq_type,
343};
344
345
346void __init ep93xx_init_irq(void)
347{
348 int irq;
349
350 vic_init((void *)EP93XX_VIC1_BASE, 0, EP93XX_VIC1_VALID_IRQ_MASK);
351 vic_init((void *)EP93XX_VIC2_BASE, 32, EP93XX_VIC2_VALID_IRQ_MASK);
352
353 for (irq = IRQ_EP93XX_GPIO(0) ; irq <= IRQ_EP93XX_GPIO(15); irq++) {
354 set_irq_chip(irq, &ep93xx_gpio_ab_irq_chip);
355 set_irq_handler(irq, do_level_IRQ);
356 set_irq_flags(irq, IRQF_VALID);
357 }
358 set_irq_chained_handler(IRQ_EP93XX_GPIO_AB, ep93xx_gpio_ab_irq_handler);
359}
360
361
362/*************************************************************************
363 * EP93xx peripheral handling
364 *************************************************************************/
365#define EP93XX_UART_MCR_OFFSET (0x0100)
366
367static void ep93xx_uart_set_mctrl(struct amba_device *dev,
368 void __iomem *base, unsigned int mctrl)
369{
370 unsigned int mcr;
371
372 mcr = 0;
373 if (!(mctrl & TIOCM_RTS))
374 mcr |= 2;
375 if (!(mctrl & TIOCM_DTR))
376 mcr |= 1;
377
378 __raw_writel(mcr, base + EP93XX_UART_MCR_OFFSET);
379}
380
381static struct amba_pl010_data ep93xx_uart_data = {
382 .set_mctrl = ep93xx_uart_set_mctrl,
383};
384
385static struct amba_device uart1_device = {
386 .dev = {
387 .bus_id = "apb:uart1",
388 .platform_data = &ep93xx_uart_data,
389 },
390 .res = {
391 .start = EP93XX_UART1_PHYS_BASE,
392 .end = EP93XX_UART1_PHYS_BASE + 0x0fff,
393 .flags = IORESOURCE_MEM,
394 },
395 .irq = { IRQ_EP93XX_UART1, NO_IRQ },
396 .periphid = 0x00041010,
397};
398
399static struct amba_device uart2_device = {
400 .dev = {
401 .bus_id = "apb:uart2",
402 .platform_data = &ep93xx_uart_data,
403 },
404 .res = {
405 .start = EP93XX_UART2_PHYS_BASE,
406 .end = EP93XX_UART2_PHYS_BASE + 0x0fff,
407 .flags = IORESOURCE_MEM,
408 },
409 .irq = { IRQ_EP93XX_UART2, NO_IRQ },
410 .periphid = 0x00041010,
411};
412
413static struct amba_device uart3_device = {
414 .dev = {
415 .bus_id = "apb:uart3",
416 .platform_data = &ep93xx_uart_data,
417 },
418 .res = {
419 .start = EP93XX_UART3_PHYS_BASE,
420 .end = EP93XX_UART3_PHYS_BASE + 0x0fff,
421 .flags = IORESOURCE_MEM,
422 },
423 .irq = { IRQ_EP93XX_UART3, NO_IRQ },
424 .periphid = 0x00041010,
425};
426
427void __init ep93xx_init_devices(void)
428{
429 unsigned int v;
430
431 /*
432 * Disallow access to MaverickCrunch initially.
433 */
434 v = __raw_readl(EP93XX_SYSCON_DEVICE_CONFIG);
435 v &= ~EP93XX_SYSCON_DEVICE_CONFIG_CRUNCH_ENABLE;
436 __raw_writel(0xaa, EP93XX_SYSCON_SWLOCK);
437 __raw_writel(v, EP93XX_SYSCON_DEVICE_CONFIG);
438
439 amba_device_register(&uart1_device, &iomem_resource);
440 amba_device_register(&uart2_device, &iomem_resource);
441 amba_device_register(&uart3_device, &iomem_resource);
442}
diff --git a/arch/arm/mach-ep93xx/gesbc9312.c b/arch/arm/mach-ep93xx/gesbc9312.c
new file mode 100644
index 000000000000..d18fcb1a2f1b
--- /dev/null
+++ b/arch/arm/mach-ep93xx/gesbc9312.c
@@ -0,0 +1,40 @@
1/*
2 * arch/arm/mach-ep93xx/gesbc9312.c
3 * Glomation GESBC-9312-sx support.
4 *
5 * Copyright (C) 2006 Lennert Buytenhek <buytenh@wantstofly.org>
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or (at
10 * your option) any later version.
11 */
12
13#include <linux/config.h>
14#include <linux/kernel.h>
15#include <linux/init.h>
16#include <linux/mm.h>
17#include <linux/sched.h>
18#include <linux/interrupt.h>
19#include <linux/mtd/physmap.h>
20#include <asm/io.h>
21#include <asm/hardware.h>
22#include <asm/mach-types.h>
23#include <asm/mach/arch.h>
24
25static void __init gesbc9312_init_machine(void)
26{
27 ep93xx_init_devices();
28 physmap_configure(0x60000000, 0x00800000, 4, NULL);
29}
30
31MACHINE_START(GESBC9312, "Glomation GESBC-9312-sx")
32 /* Maintainer: Lennert Buytenhek <buytenh@wantstofly.org> */
33 .phys_io = EP93XX_APB_PHYS_BASE,
34 .io_pg_offst = ((EP93XX_APB_VIRT_BASE) >> 18) & 0xfffc,
35 .boot_params = 0x00000100,
36 .map_io = ep93xx_map_io,
37 .init_irq = ep93xx_init_irq,
38 .timer = &ep93xx_timer,
39 .init_machine = gesbc9312_init_machine,
40MACHINE_END
diff --git a/arch/arm/mach-ep93xx/ts72xx.c b/arch/arm/mach-ep93xx/ts72xx.c
new file mode 100644
index 000000000000..777e75daa8a5
--- /dev/null
+++ b/arch/arm/mach-ep93xx/ts72xx.c
@@ -0,0 +1,118 @@
1/*
2 * arch/arm/mach-ep93xx/ts72xx.c
3 * Technologic Systems TS72xx SBC support.
4 *
5 * Copyright (C) 2006 Lennert Buytenhek <buytenh@wantstofly.org>
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or (at
10 * your option) any later version.
11 */
12
13#include <linux/config.h>
14#include <linux/kernel.h>
15#include <linux/init.h>
16#include <linux/mm.h>
17#include <linux/sched.h>
18#include <linux/interrupt.h>
19#include <linux/mtd/physmap.h>
20#include <asm/io.h>
21#include <asm/hardware.h>
22#include <asm/mach-types.h>
23#include <asm/mach/arch.h>
24#include <asm/mach/map.h>
25
26static struct map_desc ts72xx_io_desc[] __initdata = {
27 {
28 .virtual = TS72XX_MODEL_VIRT_BASE,
29 .pfn = __phys_to_pfn(TS72XX_MODEL_PHYS_BASE),
30 .length = TS72XX_MODEL_SIZE,
31 .type = MT_DEVICE,
32 }, {
33 .virtual = TS72XX_OPTIONS_VIRT_BASE,
34 .pfn = __phys_to_pfn(TS72XX_OPTIONS_PHYS_BASE),
35 .length = TS72XX_OPTIONS_SIZE,
36 .type = MT_DEVICE,
37 }, {
38 .virtual = TS72XX_OPTIONS2_VIRT_BASE,
39 .pfn = __phys_to_pfn(TS72XX_OPTIONS2_PHYS_BASE),
40 .length = TS72XX_OPTIONS2_SIZE,
41 .type = MT_DEVICE,
42 }
43};
44
45static struct map_desc ts72xx_nand_io_desc[] __initdata = {
46 {
47 .virtual = TS72XX_NAND_DATA_VIRT_BASE,
48 .pfn = __phys_to_pfn(TS72XX_NAND1_DATA_PHYS_BASE),
49 .length = TS72XX_NAND_DATA_SIZE,
50 .type = MT_DEVICE,
51 }, {
52 .virtual = TS72XX_NAND_CONTROL_VIRT_BASE,
53 .pfn = __phys_to_pfn(TS72XX_NAND1_CONTROL_PHYS_BASE),
54 .length = TS72XX_NAND_CONTROL_SIZE,
55 .type = MT_DEVICE,
56 }, {
57 .virtual = TS72XX_NAND_BUSY_VIRT_BASE,
58 .pfn = __phys_to_pfn(TS72XX_NAND1_BUSY_PHYS_BASE),
59 .length = TS72XX_NAND_BUSY_SIZE,
60 .type = MT_DEVICE,
61 }
62};
63
64static struct map_desc ts72xx_alternate_nand_io_desc[] __initdata = {
65 {
66 .virtual = TS72XX_NAND_DATA_VIRT_BASE,
67 .pfn = __phys_to_pfn(TS72XX_NAND2_DATA_PHYS_BASE),
68 .length = TS72XX_NAND_DATA_SIZE,
69 .type = MT_DEVICE,
70 }, {
71 .virtual = TS72XX_NAND_CONTROL_VIRT_BASE,
72 .pfn = __phys_to_pfn(TS72XX_NAND2_CONTROL_PHYS_BASE),
73 .length = TS72XX_NAND_CONTROL_SIZE,
74 .type = MT_DEVICE,
75 }, {
76 .virtual = TS72XX_NAND_BUSY_VIRT_BASE,
77 .pfn = __phys_to_pfn(TS72XX_NAND2_BUSY_PHYS_BASE),
78 .length = TS72XX_NAND_BUSY_SIZE,
79 .type = MT_DEVICE,
80 }
81};
82
83static void __init ts72xx_map_io(void)
84{
85 ep93xx_map_io();
86 iotable_init(ts72xx_io_desc, ARRAY_SIZE(ts72xx_io_desc));
87
88 /*
89 * The TS-7200 has NOR flash, the other models have NAND flash.
90 */
91 if (!board_is_ts7200()) {
92 if (is_ts9420_installed()) {
93 iotable_init(ts72xx_alternate_nand_io_desc,
94 ARRAY_SIZE(ts72xx_alternate_nand_io_desc));
95 } else {
96 iotable_init(ts72xx_nand_io_desc,
97 ARRAY_SIZE(ts72xx_nand_io_desc));
98 }
99 }
100}
101
102static void __init ts72xx_init_machine(void)
103{
104 ep93xx_init_devices();
105 if (board_is_ts7200())
106 physmap_configure(TS72XX_NOR_PHYS_BASE, 0x01000000, 1, NULL);
107}
108
109MACHINE_START(TS72XX, "Technologic Systems TS-72xx SBC")
110 /* Maintainer: Lennert Buytenhek <buytenh@wantstofly.org> */
111 .phys_io = EP93XX_APB_PHYS_BASE,
112 .io_pg_offst = ((EP93XX_APB_VIRT_BASE) >> 18) & 0xfffc,
113 .boot_params = 0x00000100,
114 .map_io = ts72xx_map_io,
115 .init_irq = ep93xx_init_irq,
116 .timer = &ep93xx_timer,
117 .init_machine = ts72xx_init_machine,
118MACHINE_END
diff --git a/arch/arm/mach-footbridge/dc21285.c b/arch/arm/mach-footbridge/dc21285.c
index e79884eea1f7..5dace2597838 100644
--- a/arch/arm/mach-footbridge/dc21285.c
+++ b/arch/arm/mach-footbridge/dc21285.c
@@ -255,14 +255,12 @@ int __init dc21285_setup(int nr, struct pci_sys_data *sys)
255 if (nr || !footbridge_cfn_mode()) 255 if (nr || !footbridge_cfn_mode())
256 return 0; 256 return 0;
257 257
258 res = kmalloc(sizeof(struct resource) * 2, GFP_KERNEL); 258 res = kzalloc(sizeof(struct resource) * 2, GFP_KERNEL);
259 if (!res) { 259 if (!res) {
260 printk("out of memory for root bus resources"); 260 printk("out of memory for root bus resources");
261 return 0; 261 return 0;
262 } 262 }
263 263
264 memset(res, 0, sizeof(struct resource) * 2);
265
266 res[0].flags = IORESOURCE_MEM; 264 res[0].flags = IORESOURCE_MEM;
267 res[0].name = "Footbridge non-prefetch"; 265 res[0].name = "Footbridge non-prefetch";
268 res[1].flags = IORESOURCE_MEM | IORESOURCE_PREFETCH; 266 res[1].flags = IORESOURCE_MEM | IORESOURCE_PREFETCH;
diff --git a/arch/arm/mach-footbridge/time.c b/arch/arm/mach-footbridge/time.c
index 2c64a0b0502e..5d02e95dede3 100644
--- a/arch/arm/mach-footbridge/time.c
+++ b/arch/arm/mach-footbridge/time.c
@@ -34,27 +34,12 @@ static int rtc_base;
34static unsigned long __init get_isa_cmos_time(void) 34static unsigned long __init get_isa_cmos_time(void)
35{ 35{
36 unsigned int year, mon, day, hour, min, sec; 36 unsigned int year, mon, day, hour, min, sec;
37 int i;
38 37
39 // check to see if the RTC makes sense..... 38 // check to see if the RTC makes sense.....
40 if ((CMOS_READ(RTC_VALID) & RTC_VRT) == 0) 39 if ((CMOS_READ(RTC_VALID) & RTC_VRT) == 0)
41 return mktime(1970, 1, 1, 0, 0, 0); 40 return mktime(1970, 1, 1, 0, 0, 0);
42 41
43 /* The Linux interpretation of the CMOS clock register contents: 42 do {
44 * When the Update-In-Progress (UIP) flag goes from 1 to 0, the
45 * RTC registers show the second which has precisely just started.
46 * Let's hope other operating systems interpret the RTC the same way.
47 */
48 /* read RTC exactly on falling edge of update flag */
49 for (i = 0 ; i < 1000000 ; i++) /* may take up to 1 second... */
50 if (CMOS_READ(RTC_FREQ_SELECT) & RTC_UIP)
51 break;
52
53 for (i = 0 ; i < 1000000 ; i++) /* must try at least 2.228 ms */
54 if (!(CMOS_READ(RTC_FREQ_SELECT) & RTC_UIP))
55 break;
56
57 do { /* Isn't this overkill ? UIP above should guarantee consistency */
58 sec = CMOS_READ(RTC_SECONDS); 43 sec = CMOS_READ(RTC_SECONDS);
59 min = CMOS_READ(RTC_MINUTES); 44 min = CMOS_READ(RTC_MINUTES);
60 hour = CMOS_READ(RTC_HOURS); 45 hour = CMOS_READ(RTC_HOURS);
diff --git a/arch/arm/mach-integrator/core.c b/arch/arm/mach-integrator/core.c
index 20071a2767cc..576a5e979c00 100644
--- a/arch/arm/mach-integrator/core.c
+++ b/arch/arm/mach-integrator/core.c
@@ -15,7 +15,9 @@
15#include <linux/interrupt.h> 15#include <linux/interrupt.h>
16#include <linux/sched.h> 16#include <linux/sched.h>
17#include <linux/smp.h> 17#include <linux/smp.h>
18#include <linux/termios.h>
18#include <linux/amba/bus.h> 19#include <linux/amba/bus.h>
20#include <linux/amba/serial.h>
19 21
20#include <asm/hardware.h> 22#include <asm/hardware.h>
21#include <asm/irq.h> 23#include <asm/irq.h>
@@ -28,6 +30,8 @@
28 30
29#include "common.h" 31#include "common.h"
30 32
33static struct amba_pl010_data integrator_uart_data;
34
31static struct amba_device rtc_device = { 35static struct amba_device rtc_device = {
32 .dev = { 36 .dev = {
33 .bus_id = "mb:15", 37 .bus_id = "mb:15",
@@ -44,6 +48,7 @@ static struct amba_device rtc_device = {
44static struct amba_device uart0_device = { 48static struct amba_device uart0_device = {
45 .dev = { 49 .dev = {
46 .bus_id = "mb:16", 50 .bus_id = "mb:16",
51 .platform_data = &integrator_uart_data,
47 }, 52 },
48 .res = { 53 .res = {
49 .start = INTEGRATOR_UART0_BASE, 54 .start = INTEGRATOR_UART0_BASE,
@@ -57,6 +62,7 @@ static struct amba_device uart0_device = {
57static struct amba_device uart1_device = { 62static struct amba_device uart1_device = {
58 .dev = { 63 .dev = {
59 .bus_id = "mb:17", 64 .bus_id = "mb:17",
65 .platform_data = &integrator_uart_data,
60 }, 66 },
61 .res = { 67 .res = {
62 .start = INTEGRATOR_UART1_BASE, 68 .start = INTEGRATOR_UART1_BASE,
@@ -115,6 +121,46 @@ static int __init integrator_init(void)
115 121
116arch_initcall(integrator_init); 122arch_initcall(integrator_init);
117 123
124/*
125 * On the Integrator platform, the port RTS and DTR are provided by
126 * bits in the following SC_CTRLS register bits:
127 * RTS DTR
128 * UART0 7 6
129 * UART1 5 4
130 */
131#define SC_CTRLC (IO_ADDRESS(INTEGRATOR_SC_BASE) + INTEGRATOR_SC_CTRLC_OFFSET)
132#define SC_CTRLS (IO_ADDRESS(INTEGRATOR_SC_BASE) + INTEGRATOR_SC_CTRLS_OFFSET)
133
134static void integrator_uart_set_mctrl(struct amba_device *dev, void __iomem *base, unsigned int mctrl)
135{
136 unsigned int ctrls = 0, ctrlc = 0, rts_mask, dtr_mask;
137
138 if (dev == &uart0_device) {
139 rts_mask = 1 << 4;
140 dtr_mask = 1 << 5;
141 } else {
142 rts_mask = 1 << 6;
143 dtr_mask = 1 << 7;
144 }
145
146 if (mctrl & TIOCM_RTS)
147 ctrlc |= rts_mask;
148 else
149 ctrls |= rts_mask;
150
151 if (mctrl & TIOCM_DTR)
152 ctrlc |= dtr_mask;
153 else
154 ctrls |= dtr_mask;
155
156 __raw_writel(ctrls, SC_CTRLS);
157 __raw_writel(ctrlc, SC_CTRLC);
158}
159
160static struct amba_pl010_data integrator_uart_data = {
161 .set_mctrl = integrator_uart_set_mctrl,
162};
163
118#define CM_CTRL IO_ADDRESS(INTEGRATOR_HDR_BASE) + INTEGRATOR_HDR_CTRL_OFFSET 164#define CM_CTRL IO_ADDRESS(INTEGRATOR_HDR_BASE) + INTEGRATOR_HDR_CTRL_OFFSET
119 165
120static DEFINE_SPINLOCK(cm_lock); 166static DEFINE_SPINLOCK(cm_lock);
diff --git a/arch/arm/mach-integrator/impd1.c b/arch/arm/mach-integrator/impd1.c
index a85d471c5bfa..92d79fb39311 100644
--- a/arch/arm/mach-integrator/impd1.c
+++ b/arch/arm/mach-integrator/impd1.c
@@ -355,12 +355,11 @@ static int impd1_probe(struct lm_device *dev)
355 if (!request_mem_region(dev->resource.start, SZ_4K, "LM registers")) 355 if (!request_mem_region(dev->resource.start, SZ_4K, "LM registers"))
356 return -EBUSY; 356 return -EBUSY;
357 357
358 impd1 = kmalloc(sizeof(struct impd1_module), GFP_KERNEL); 358 impd1 = kzalloc(sizeof(struct impd1_module), GFP_KERNEL);
359 if (!impd1) { 359 if (!impd1) {
360 ret = -ENOMEM; 360 ret = -ENOMEM;
361 goto release_lm; 361 goto release_lm;
362 } 362 }
363 memset(impd1, 0, sizeof(struct impd1_module));
364 363
365 impd1->base = ioremap(dev->resource.start, SZ_4K); 364 impd1->base = ioremap(dev->resource.start, SZ_4K);
366 if (!impd1->base) { 365 if (!impd1->base) {
@@ -389,12 +388,10 @@ static int impd1_probe(struct lm_device *dev)
389 388
390 pc_base = dev->resource.start + idev->offset; 389 pc_base = dev->resource.start + idev->offset;
391 390
392 d = kmalloc(sizeof(struct amba_device), GFP_KERNEL); 391 d = kzalloc(sizeof(struct amba_device), GFP_KERNEL);
393 if (!d) 392 if (!d)
394 continue; 393 continue;
395 394
396 memset(d, 0, sizeof(struct amba_device));
397
398 snprintf(d->dev.bus_id, sizeof(d->dev.bus_id), 395 snprintf(d->dev.bus_id, sizeof(d->dev.bus_id),
399 "lm%x:%5.5lx", dev->id, idev->offset >> 12); 396 "lm%x:%5.5lx", dev->id, idev->offset >> 12);
400 397
diff --git a/arch/arm/mach-integrator/integrator_ap.c b/arch/arm/mach-integrator/integrator_ap.c
index d8d3c2a5a97e..6d65c96ebfd2 100644
--- a/arch/arm/mach-integrator/integrator_ap.c
+++ b/arch/arm/mach-integrator/integrator_ap.c
@@ -319,12 +319,10 @@ static void __init ap_init(void)
319 if ((sc_dec & (16 << i)) == 0) 319 if ((sc_dec & (16 << i)) == 0)
320 continue; 320 continue;
321 321
322 lmdev = kmalloc(sizeof(struct lm_device), GFP_KERNEL); 322 lmdev = kzalloc(sizeof(struct lm_device), GFP_KERNEL);
323 if (!lmdev) 323 if (!lmdev)
324 continue; 324 continue;
325 325
326 memset(lmdev, 0, sizeof(struct lm_device));
327
328 lmdev->resource.start = 0xc0000000 + 0x10000000 * i; 326 lmdev->resource.start = 0xc0000000 + 0x10000000 * i;
329 lmdev->resource.end = lmdev->resource.start + 0x0fffffff; 327 lmdev->resource.end = lmdev->resource.start + 0x0fffffff;
330 lmdev->resource.flags = IORESOURCE_MEM; 328 lmdev->resource.flags = IORESOURCE_MEM;
diff --git a/arch/arm/mach-integrator/time.c b/arch/arm/mach-integrator/time.c
index 3c22c16b38bf..bc07f52a6fd7 100644
--- a/arch/arm/mach-integrator/time.c
+++ b/arch/arm/mach-integrator/time.c
@@ -40,13 +40,13 @@ static int integrator_set_rtc(void)
40 return 1; 40 return 1;
41} 41}
42 42
43static int rtc_read_alarm(struct rtc_wkalrm *alrm) 43static int integrator_rtc_read_alarm(struct rtc_wkalrm *alrm)
44{ 44{
45 rtc_time_to_tm(readl(rtc_base + RTC_MR), &alrm->time); 45 rtc_time_to_tm(readl(rtc_base + RTC_MR), &alrm->time);
46 return 0; 46 return 0;
47} 47}
48 48
49static inline int rtc_set_alarm(struct rtc_wkalrm *alrm) 49static inline int integrator_rtc_set_alarm(struct rtc_wkalrm *alrm)
50{ 50{
51 unsigned long time; 51 unsigned long time;
52 int ret; 52 int ret;
@@ -62,7 +62,7 @@ static inline int rtc_set_alarm(struct rtc_wkalrm *alrm)
62 return ret; 62 return ret;
63} 63}
64 64
65static int rtc_read_time(struct rtc_time *tm) 65static int integrator_rtc_read_time(struct rtc_time *tm)
66{ 66{
67 rtc_time_to_tm(readl(rtc_base + RTC_DR), tm); 67 rtc_time_to_tm(readl(rtc_base + RTC_DR), tm);
68 return 0; 68 return 0;
@@ -76,7 +76,7 @@ static int rtc_read_time(struct rtc_time *tm)
76 * edge of the 1Hz clock, we must write the time one second 76 * edge of the 1Hz clock, we must write the time one second
77 * in advance. 77 * in advance.
78 */ 78 */
79static inline int rtc_set_time(struct rtc_time *tm) 79static inline int integrator_rtc_set_time(struct rtc_time *tm)
80{ 80{
81 unsigned long time; 81 unsigned long time;
82 int ret; 82 int ret;
@@ -90,10 +90,10 @@ static inline int rtc_set_time(struct rtc_time *tm)
90 90
91static struct rtc_ops rtc_ops = { 91static struct rtc_ops rtc_ops = {
92 .owner = THIS_MODULE, 92 .owner = THIS_MODULE,
93 .read_time = rtc_read_time, 93 .read_time = integrator_rtc_read_time,
94 .set_time = rtc_set_time, 94 .set_time = integrator_rtc_set_time,
95 .read_alarm = rtc_read_alarm, 95 .read_alarm = integrator_rtc_read_alarm,
96 .set_alarm = rtc_set_alarm, 96 .set_alarm = integrator_rtc_set_alarm,
97}; 97};
98 98
99static irqreturn_t arm_rtc_interrupt(int irq, void *dev_id, 99static irqreturn_t arm_rtc_interrupt(int irq, void *dev_id,
diff --git a/arch/arm/mach-iop3xx/iop331-setup.c b/arch/arm/mach-iop3xx/iop331-setup.c
index 2d6abe5be14d..7b7b6eea3846 100644
--- a/arch/arm/mach-iop3xx/iop331-setup.c
+++ b/arch/arm/mach-iop3xx/iop331-setup.c
@@ -103,7 +103,7 @@ static struct plat_serial8250_port iop33x_uart1_data[] = {
103 103
104static struct platform_device iop33x_uart0 = { 104static struct platform_device iop33x_uart0 = {
105 .name = "serial8250", 105 .name = "serial8250",
106 .id = 0, 106 .id = PLAT8250_DEV_PLATFORM,
107 .dev.platform_data = iop33x_uart0_data, 107 .dev.platform_data = iop33x_uart0_data,
108 .num_resources = 2, 108 .num_resources = 2,
109 .resource = iop33x_uart0_resources, 109 .resource = iop33x_uart0_resources,
@@ -111,7 +111,7 @@ static struct platform_device iop33x_uart0 = {
111 111
112static struct platform_device iop33x_uart1 = { 112static struct platform_device iop33x_uart1 = {
113 .name = "serial8250", 113 .name = "serial8250",
114 .id = 1, 114 .id = PLAT8250_DEV_PLATFORM1,
115 .dev.platform_data = iop33x_uart1_data, 115 .dev.platform_data = iop33x_uart1_data,
116 .num_resources = 2, 116 .num_resources = 2,
117 .resource = iop33x_uart1_resources, 117 .resource = iop33x_uart1_resources,
diff --git a/arch/arm/mach-iop3xx/iq31244-pci.c b/arch/arm/mach-iop3xx/iq31244-pci.c
index c6a973ba8fc6..f3c6413fa5bd 100644
--- a/arch/arm/mach-iop3xx/iq31244-pci.c
+++ b/arch/arm/mach-iop3xx/iq31244-pci.c
@@ -74,12 +74,10 @@ static int iq31244_setup(int nr, struct pci_sys_data *sys)
74 if(nr != 0) 74 if(nr != 0)
75 return 0; 75 return 0;
76 76
77 res = kmalloc(sizeof(struct resource) * 2, GFP_KERNEL); 77 res = kzalloc(sizeof(struct resource) * 2, GFP_KERNEL);
78 if (!res) 78 if (!res)
79 panic("PCI: unable to alloc resources"); 79 panic("PCI: unable to alloc resources");
80 80
81 memset(res, 0, sizeof(struct resource) * 2);
82
83 res[0].start = IOP321_PCI_LOWER_IO_VA; 81 res[0].start = IOP321_PCI_LOWER_IO_VA;
84 res[0].end = IOP321_PCI_UPPER_IO_VA; 82 res[0].end = IOP321_PCI_UPPER_IO_VA;
85 res[0].name = "IQ31244 PCI I/O Space"; 83 res[0].name = "IQ31244 PCI I/O Space";
diff --git a/arch/arm/mach-iop3xx/iq80321-pci.c b/arch/arm/mach-iop3xx/iq80321-pci.c
index 802f6d091b75..d9758d3f6e7f 100644
--- a/arch/arm/mach-iop3xx/iq80321-pci.c
+++ b/arch/arm/mach-iop3xx/iq80321-pci.c
@@ -68,12 +68,10 @@ static int iq80321_setup(int nr, struct pci_sys_data *sys)
68 if(nr != 0) 68 if(nr != 0)
69 return 0; 69 return 0;
70 70
71 res = kmalloc(sizeof(struct resource) * 2, GFP_KERNEL); 71 res = kzalloc(sizeof(struct resource) * 2, GFP_KERNEL);
72 if (!res) 72 if (!res)
73 panic("PCI: unable to alloc resources"); 73 panic("PCI: unable to alloc resources");
74 74
75 memset(res, 0, sizeof(struct resource) * 2);
76
77 res[0].start = IOP321_PCI_LOWER_IO_VA; 75 res[0].start = IOP321_PCI_LOWER_IO_VA;
78 res[0].end = IOP321_PCI_UPPER_IO_VA; 76 res[0].end = IOP321_PCI_UPPER_IO_VA;
79 res[0].name = "IQ80321 PCI I/O Space"; 77 res[0].name = "IQ80321 PCI I/O Space";
diff --git a/arch/arm/mach-iop3xx/iq80331-pci.c b/arch/arm/mach-iop3xx/iq80331-pci.c
index 654e450a1311..40d861002492 100644
--- a/arch/arm/mach-iop3xx/iq80331-pci.c
+++ b/arch/arm/mach-iop3xx/iq80331-pci.c
@@ -64,12 +64,10 @@ static int iq80331_setup(int nr, struct pci_sys_data *sys)
64 if(nr != 0) 64 if(nr != 0)
65 return 0; 65 return 0;
66 66
67 res = kmalloc(sizeof(struct resource) * 2, GFP_KERNEL); 67 res = kzalloc(sizeof(struct resource) * 2, GFP_KERNEL);
68 if (!res) 68 if (!res)
69 panic("PCI: unable to alloc resources"); 69 panic("PCI: unable to alloc resources");
70 70
71 memset(res, 0, sizeof(struct resource) * 2);
72
73 res[0].start = IOP331_PCI_LOWER_IO_VA; 71 res[0].start = IOP331_PCI_LOWER_IO_VA;
74 res[0].end = IOP331_PCI_UPPER_IO_VA; 72 res[0].end = IOP331_PCI_UPPER_IO_VA;
75 res[0].name = "IQ80331 PCI I/O Space"; 73 res[0].name = "IQ80331 PCI I/O Space";
diff --git a/arch/arm/mach-iop3xx/iq80332-pci.c b/arch/arm/mach-iop3xx/iq80332-pci.c
index 65951ffe4631..afc0676318e4 100644
--- a/arch/arm/mach-iop3xx/iq80332-pci.c
+++ b/arch/arm/mach-iop3xx/iq80332-pci.c
@@ -70,12 +70,10 @@ static int iq80332_setup(int nr, struct pci_sys_data *sys)
70 if(nr != 0) 70 if(nr != 0)
71 return 0; 71 return 0;
72 72
73 res = kmalloc(sizeof(struct resource) * 2, GFP_KERNEL); 73 res = kzalloc(sizeof(struct resource) * 2, GFP_KERNEL);
74 if (!res) 74 if (!res)
75 panic("PCI: unable to alloc resources"); 75 panic("PCI: unable to alloc resources");
76 76
77 memset(res, 0, sizeof(struct resource) * 2);
78
79 res[0].start = IOP331_PCI_LOWER_IO_VA; 77 res[0].start = IOP331_PCI_LOWER_IO_VA;
80 res[0].end = IOP331_PCI_UPPER_IO_VA; 78 res[0].end = IOP331_PCI_UPPER_IO_VA;
81 res[0].name = "IQ80332 PCI I/O Space"; 79 res[0].name = "IQ80332 PCI I/O Space";
diff --git a/arch/arm/mach-ixp2000/Kconfig b/arch/arm/mach-ixp2000/Kconfig
index ecb58d83478e..86f53f8ccbf5 100644
--- a/arch/arm/mach-ixp2000/Kconfig
+++ b/arch/arm/mach-ixp2000/Kconfig
@@ -43,12 +43,17 @@ config ARCH_IXDP2401
43 this platform, see <file:Documentation/arm/IXP2000>. 43 this platform, see <file:Documentation/arm/IXP2000>.
44 44
45config ARCH_IXDP2801 45config ARCH_IXDP2801
46 bool "Support Intel IXDP2801" 46 bool "Support Intel IXDP2801 and IXDP28x5"
47 help 47 help
48 Say 'Y' here if you want your kernel to support the Intel 48 Say 'Y' here if you want your kernel to support the Intel
49 IXDP2801 reference platform. For more information on 49 IXDP2801/2805/2855 reference platforms. For more information on
50 this platform, see <file:Documentation/arm/IXP2000>. 50 this platform, see <file:Documentation/arm/IXP2000>.
51 51
52config MACH_IXDP28X5
53 bool
54 depends on ARCH_IXDP2801
55 default y
56
52config ARCH_IXDP2X01 57config ARCH_IXDP2X01
53 bool 58 bool
54 depends on ARCH_IXDP2401 || ARCH_IXDP2801 59 depends on ARCH_IXDP2401 || ARCH_IXDP2801
diff --git a/arch/arm/mach-ixp2000/Makefile b/arch/arm/mach-ixp2000/Makefile
index 9621aeb61f46..1e6139d42a92 100644
--- a/arch/arm/mach-ixp2000/Makefile
+++ b/arch/arm/mach-ixp2000/Makefile
@@ -1,7 +1,7 @@
1# 1#
2# Makefile for the linux kernel. 2# Makefile for the linux kernel.
3# 3#
4obj-y := core.o pci.o uengine.o 4obj-y := core.o pci.o
5obj-m := 5obj-m :=
6obj-n := 6obj-n :=
7obj- := 7obj- :=
diff --git a/arch/arm/mach-ixp2000/core.c b/arch/arm/mach-ixp2000/core.c
index cfd5bef3190b..6e8d504aca55 100644
--- a/arch/arm/mach-ixp2000/core.c
+++ b/arch/arm/mach-ixp2000/core.c
@@ -288,8 +288,6 @@ void gpio_line_config(int line, int direction)
288 288
289 local_irq_save(flags); 289 local_irq_save(flags);
290 if (direction == GPIO_OUT) { 290 if (direction == GPIO_OUT) {
291 irq_desc[line + IRQ_IXP2000_GPIO0].valid = 0;
292
293 /* if it's an output, it ain't an interrupt anymore */ 291 /* if it's an output, it ain't an interrupt anymore */
294 GPIO_IRQ_falling_edge &= ~(1 << line); 292 GPIO_IRQ_falling_edge &= ~(1 << line);
295 GPIO_IRQ_rising_edge &= ~(1 << line); 293 GPIO_IRQ_rising_edge &= ~(1 << line);
@@ -351,11 +349,6 @@ static int ixp2000_GPIO_irq_type(unsigned int irq, unsigned int type)
351 GPIO_IRQ_level_high &= ~(1 << line); 349 GPIO_IRQ_level_high &= ~(1 << line);
352 update_gpio_int_csrs(); 350 update_gpio_int_csrs();
353 351
354 /*
355 * Finally, mark the corresponding IRQ as valid.
356 */
357 irq_desc[irq].valid = 1;
358
359 return 0; 352 return 0;
360} 353}
361 354
@@ -506,14 +499,10 @@ void __init ixp2000_init_irq(void)
506 } 499 }
507 set_irq_chained_handler(IRQ_IXP2000_ERRSUM, ixp2000_err_irq_handler); 500 set_irq_chained_handler(IRQ_IXP2000_ERRSUM, ixp2000_err_irq_handler);
508 501
509 /*
510 * GPIO IRQs are invalid until someone sets the interrupt mode
511 * by calling set_irq_type().
512 */
513 for (irq = IRQ_IXP2000_GPIO0; irq <= IRQ_IXP2000_GPIO7; irq++) { 502 for (irq = IRQ_IXP2000_GPIO0; irq <= IRQ_IXP2000_GPIO7; irq++) {
514 set_irq_chip(irq, &ixp2000_GPIO_irq_chip); 503 set_irq_chip(irq, &ixp2000_GPIO_irq_chip);
515 set_irq_handler(irq, do_level_IRQ); 504 set_irq_handler(irq, do_level_IRQ);
516 set_irq_flags(irq, 0); 505 set_irq_flags(irq, IRQF_VALID);
517 } 506 }
518 set_irq_chained_handler(IRQ_IXP2000_GPIO, ixp2000_GPIO_irq_handler); 507 set_irq_chained_handler(IRQ_IXP2000_GPIO, ixp2000_GPIO_irq_handler);
519 508
diff --git a/arch/arm/mach-ixp2000/ixdp2x01.c b/arch/arm/mach-ixp2000/ixdp2x01.c
index 150519fb38ec..66915282a463 100644
--- a/arch/arm/mach-ixp2000/ixdp2x01.c
+++ b/arch/arm/mach-ixp2000/ixdp2x01.c
@@ -30,6 +30,7 @@
30#include <linux/tty.h> 30#include <linux/tty.h>
31#include <linux/serial_core.h> 31#include <linux/serial_core.h>
32#include <linux/platform_device.h> 32#include <linux/platform_device.h>
33#include <linux/serial_8250.h>
33 34
34#include <asm/io.h> 35#include <asm/io.h>
35#include <asm/irq.h> 36#include <asm/irq.h>
@@ -132,7 +133,7 @@ void __init ixdp2x01_init_irq(void)
132 133
133 134
134/************************************************************************* 135/*************************************************************************
135 * IXDP2x01 memory map and serial ports 136 * IXDP2x01 memory map
136 *************************************************************************/ 137 *************************************************************************/
137static struct map_desc ixdp2x01_io_desc __initdata = { 138static struct map_desc ixdp2x01_io_desc __initdata = {
138 .virtual = IXDP2X01_VIRT_CPLD_BASE, 139 .virtual = IXDP2X01_VIRT_CPLD_BASE,
@@ -141,40 +142,78 @@ static struct map_desc ixdp2x01_io_desc __initdata = {
141 .type = MT_DEVICE 142 .type = MT_DEVICE
142}; 143};
143 144
144static struct uart_port ixdp2x01_serial_ports[2] = { 145static void __init ixdp2x01_map_io(void)
146{
147 ixp2000_map_io();
148 iotable_init(&ixdp2x01_io_desc, 1);
149}
150
151
152/*************************************************************************
153 * IXDP2x01 serial ports
154 *************************************************************************/
155static struct plat_serial8250_port ixdp2x01_serial_port1[] = {
145 { 156 {
146 .membase = (char *)(IXDP2X01_UART1_VIRT_BASE),
147 .mapbase = (unsigned long)IXDP2X01_UART1_PHYS_BASE, 157 .mapbase = (unsigned long)IXDP2X01_UART1_PHYS_BASE,
158 .membase = (char *)IXDP2X01_UART1_VIRT_BASE,
148 .irq = IRQ_IXDP2X01_UART1, 159 .irq = IRQ_IXDP2X01_UART1,
149 .flags = UPF_SKIP_TEST, 160 .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST,
150 .iotype = UPIO_MEM32, 161 .iotype = UPIO_MEM32,
151 .regshift = 2, 162 .regshift = 2,
152 .uartclk = IXDP2X01_UART_CLK, 163 .uartclk = IXDP2X01_UART_CLK,
153 .line = 1, 164 },
154 .type = PORT_16550A, 165 { }
155 .fifosize = 16 166};
156 }, { 167
157 .membase = (char *)(IXDP2X01_UART2_VIRT_BASE), 168static struct resource ixdp2x01_uart_resource1 = {
169 .start = IXDP2X01_UART1_PHYS_BASE,
170 .end = IXDP2X01_UART1_PHYS_BASE + 0xffff,
171 .flags = IORESOURCE_MEM,
172};
173
174static struct platform_device ixdp2x01_serial_device1 = {
175 .name = "serial8250",
176 .id = PLAT8250_DEV_PLATFORM1,
177 .dev = {
178 .platform_data = ixdp2x01_serial_port1,
179 },
180 .num_resources = 1,
181 .resource = &ixdp2x01_uart_resource1,
182};
183
184static struct plat_serial8250_port ixdp2x01_serial_port2[] = {
185 {
158 .mapbase = (unsigned long)IXDP2X01_UART2_PHYS_BASE, 186 .mapbase = (unsigned long)IXDP2X01_UART2_PHYS_BASE,
187 .membase = (char *)IXDP2X01_UART2_VIRT_BASE,
159 .irq = IRQ_IXDP2X01_UART2, 188 .irq = IRQ_IXDP2X01_UART2,
160 .flags = UPF_SKIP_TEST, 189 .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST,
161 .iotype = UPIO_MEM32, 190 .iotype = UPIO_MEM32,
162 .regshift = 2, 191 .regshift = 2,
163 .uartclk = IXDP2X01_UART_CLK, 192 .uartclk = IXDP2X01_UART_CLK,
164 .line = 2,
165 .type = PORT_16550A,
166 .fifosize = 16
167 }, 193 },
194 { }
168}; 195};
169 196
170static void __init ixdp2x01_map_io(void) 197static struct resource ixdp2x01_uart_resource2 = {
171{ 198 .start = IXDP2X01_UART2_PHYS_BASE,
172 ixp2000_map_io(); 199 .end = IXDP2X01_UART2_PHYS_BASE + 0xffff,
200 .flags = IORESOURCE_MEM,
201};
173 202
174 iotable_init(&ixdp2x01_io_desc, 1); 203static struct platform_device ixdp2x01_serial_device2 = {
204 .name = "serial8250",
205 .id = PLAT8250_DEV_PLATFORM2,
206 .dev = {
207 .platform_data = ixdp2x01_serial_port2,
208 },
209 .num_resources = 1,
210 .resource = &ixdp2x01_uart_resource2,
211};
175 212
176 early_serial_setup(&ixdp2x01_serial_ports[0]); 213static void ixdp2x01_uart_init(void)
177 early_serial_setup(&ixdp2x01_serial_ports[1]); 214{
215 platform_device_register(&ixdp2x01_serial_device1);
216 platform_device_register(&ixdp2x01_serial_device2);
178} 217}
179 218
180 219
@@ -284,7 +323,7 @@ static int ixdp2x01_pci_setup(int nr, struct pci_sys_data *sys)
284{ 323{
285 sys->mem_offset = 0xe0000000; 324 sys->mem_offset = 0xe0000000;
286 325
287 if (machine_is_ixdp2801()) 326 if (machine_is_ixdp2801() || machine_is_ixdp28x5())
288 sys->mem_offset -= ((*IXP2000_PCI_ADDR_EXT & 0xE000) << 16); 327 sys->mem_offset -= ((*IXP2000_PCI_ADDR_EXT & 0xE000) << 16);
289 328
290 return ixp2000_pci_setup(nr, sys); 329 return ixp2000_pci_setup(nr, sys);
@@ -300,7 +339,8 @@ struct hw_pci ixdp2x01_pci __initdata = {
300 339
301int __init ixdp2x01_pci_init(void) 340int __init ixdp2x01_pci_init(void)
302{ 341{
303 if (machine_is_ixdp2401() || machine_is_ixdp2801()) 342 if (machine_is_ixdp2401() || machine_is_ixdp2801() ||\
343 machine_is_ixdp28x5())
304 pci_common_init(&ixdp2x01_pci); 344 pci_common_init(&ixdp2x01_pci);
305 345
306 return 0; 346 return 0;
@@ -373,6 +413,7 @@ static void __init ixdp2x01_init_machine(void)
373 413
374 platform_add_devices(ixdp2x01_devices, ARRAY_SIZE(ixdp2x01_devices)); 414 platform_add_devices(ixdp2x01_devices, ARRAY_SIZE(ixdp2x01_devices));
375 ixp2000_uart_init(); 415 ixp2000_uart_init();
416 ixdp2x01_uart_init();
376} 417}
377 418
378 419
@@ -400,6 +441,21 @@ MACHINE_START(IXDP2801, "Intel IXDP2801 Development Platform")
400 .timer = &ixdp2x01_timer, 441 .timer = &ixdp2x01_timer,
401 .init_machine = ixdp2x01_init_machine, 442 .init_machine = ixdp2x01_init_machine,
402MACHINE_END 443MACHINE_END
444
445/*
446 * IXDP28x5 is basically an IXDP2801 with a different CPU but Intel
447 * changed the machine ID in the bootloader
448 */
449MACHINE_START(IXDP28X5, "Intel IXDP2805/2855 Development Platform")
450 /* Maintainer: MontaVista Software, Inc. */
451 .phys_io = IXP2000_UART_PHYS_BASE,
452 .io_pg_offst = ((IXP2000_UART_VIRT_BASE) >> 18) & 0xfffc,
453 .boot_params = 0x00000100,
454 .map_io = ixdp2x01_map_io,
455 .init_irq = ixdp2x01_init_irq,
456 .timer = &ixdp2x01_timer,
457 .init_machine = ixdp2x01_init_machine,
458MACHINE_END
403#endif 459#endif
404 460
405 461
diff --git a/arch/arm/mach-ixp23xx/Kconfig b/arch/arm/mach-ixp23xx/Kconfig
new file mode 100644
index 000000000000..982670ec3866
--- /dev/null
+++ b/arch/arm/mach-ixp23xx/Kconfig
@@ -0,0 +1,25 @@
1if ARCH_IXP23XX
2
3config ARCH_SUPPORTS_BIG_ENDIAN
4 bool
5 default y
6
7menu "Intel IXP23xx Implementation Options"
8
9comment "IXP23xx Platforms"
10
11config MACH_ESPRESSO
12 bool "Support IP Fabrics Double Espresso platform"
13 help
14
15config MACH_IXDP2351
16 bool "Support Intel IXDP2351 platform"
17 help
18
19config MACH_ROADRUNNER
20 bool "Support ADI RoadRunner platform"
21 help
22
23endmenu
24
25endif
diff --git a/arch/arm/mach-ixp23xx/Makefile b/arch/arm/mach-ixp23xx/Makefile
new file mode 100644
index 000000000000..288b371b6d03
--- /dev/null
+++ b/arch/arm/mach-ixp23xx/Makefile
@@ -0,0 +1,11 @@
1#
2# Makefile for the linux kernel.
3#
4obj-y := core.o pci.o
5obj-m :=
6obj-n :=
7obj- :=
8
9obj-$(CONFIG_MACH_ESPRESSO) += espresso.o
10obj-$(CONFIG_MACH_IXDP2351) += ixdp2351.o
11obj-$(CONFIG_MACH_ROADRUNNER) += roadrunner.o
diff --git a/arch/arm/mach-ixp23xx/Makefile.boot b/arch/arm/mach-ixp23xx/Makefile.boot
new file mode 100644
index 000000000000..d5561ad15bad
--- /dev/null
+++ b/arch/arm/mach-ixp23xx/Makefile.boot
@@ -0,0 +1,2 @@
1 zreladdr-y := 0x00008000
2params_phys-y := 0x00000100
diff --git a/arch/arm/mach-ixp23xx/core.c b/arch/arm/mach-ixp23xx/core.c
new file mode 100644
index 000000000000..092ee12ced42
--- /dev/null
+++ b/arch/arm/mach-ixp23xx/core.c
@@ -0,0 +1,431 @@
1/*
2 * arch/arm/mach-ixp23xx/core.c
3 *
4 * Core routines for IXP23xx chips
5 *
6 * Author: Deepak Saxena <dsaxena@plexity.net>
7 *
8 * Copyright 2005 (c) MontaVista Software, Inc.
9 *
10 * Based on 2.4 code Copyright 2004 (c) Intel Corporation
11 *
12 * This file is licensed under the terms of the GNU General Public
13 * License version 2. This program is licensed "as is" without any
14 * warranty of any kind, whether express or implied.
15 */
16
17#include <linux/config.h>
18#include <linux/kernel.h>
19#include <linux/init.h>
20#include <linux/spinlock.h>
21#include <linux/sched.h>
22#include <linux/interrupt.h>
23#include <linux/serial.h>
24#include <linux/tty.h>
25#include <linux/bitops.h>
26#include <linux/serial.h>
27#include <linux/serial_8250.h>
28#include <linux/serial_core.h>
29#include <linux/device.h>
30#include <linux/mm.h>
31#include <linux/time.h>
32#include <linux/timex.h>
33
34#include <asm/types.h>
35#include <asm/setup.h>
36#include <asm/memory.h>
37#include <asm/hardware.h>
38#include <asm/mach-types.h>
39#include <asm/irq.h>
40#include <asm/system.h>
41#include <asm/tlbflush.h>
42#include <asm/pgtable.h>
43
44#include <asm/mach/map.h>
45#include <asm/mach/time.h>
46#include <asm/mach/irq.h>
47#include <asm/mach/arch.h>
48
49
50/*************************************************************************
51 * Chip specific mappings shared by all IXP23xx systems
52 *************************************************************************/
53static struct map_desc ixp23xx_io_desc[] __initdata = {
54 { /* XSI-CPP CSRs */
55 .virtual = IXP23XX_XSI2CPP_CSR_VIRT,
56 .pfn = __phys_to_pfn(IXP23XX_XSI2CPP_CSR_PHYS),
57 .length = IXP23XX_XSI2CPP_CSR_SIZE,
58 .type = MT_DEVICE,
59 }, { /* Expansion Bus Config */
60 .virtual = IXP23XX_EXP_CFG_VIRT,
61 .pfn = __phys_to_pfn(IXP23XX_EXP_CFG_PHYS),
62 .length = IXP23XX_EXP_CFG_SIZE,
63 .type = MT_DEVICE,
64 }, { /* UART, Interrupt ctrl, GPIO, timers, NPEs, MACS,.... */
65 .virtual = IXP23XX_PERIPHERAL_VIRT,
66 .pfn = __phys_to_pfn(IXP23XX_PERIPHERAL_PHYS),
67 .length = IXP23XX_PERIPHERAL_SIZE,
68 .type = MT_DEVICE,
69 }, { /* CAP CSRs */
70 .virtual = IXP23XX_CAP_CSR_VIRT,
71 .pfn = __phys_to_pfn(IXP23XX_CAP_CSR_PHYS),
72 .length = IXP23XX_CAP_CSR_SIZE,
73 .type = MT_DEVICE,
74 }, { /* MSF CSRs */
75 .virtual = IXP23XX_MSF_CSR_VIRT,
76 .pfn = __phys_to_pfn(IXP23XX_MSF_CSR_PHYS),
77 .length = IXP23XX_MSF_CSR_SIZE,
78 .type = MT_DEVICE,
79 }, { /* PCI I/O Space */
80 .virtual = IXP23XX_PCI_IO_VIRT,
81 .pfn = __phys_to_pfn(IXP23XX_PCI_IO_PHYS),
82 .length = IXP23XX_PCI_IO_SIZE,
83 .type = MT_DEVICE,
84 }, { /* PCI Config Space */
85 .virtual = IXP23XX_PCI_CFG_VIRT,
86 .pfn = __phys_to_pfn(IXP23XX_PCI_CFG_PHYS),
87 .length = IXP23XX_PCI_CFG_SIZE,
88 .type = MT_DEVICE,
89 }, { /* PCI local CFG CSRs */
90 .virtual = IXP23XX_PCI_CREG_VIRT,
91 .pfn = __phys_to_pfn(IXP23XX_PCI_CREG_PHYS),
92 .length = IXP23XX_PCI_CREG_SIZE,
93 .type = MT_DEVICE,
94 }, { /* PCI MEM Space */
95 .virtual = IXP23XX_PCI_MEM_VIRT,
96 .pfn = __phys_to_pfn(IXP23XX_PCI_MEM_PHYS),
97 .length = IXP23XX_PCI_MEM_SIZE,
98 .type = MT_DEVICE,
99 }
100};
101
102void __init ixp23xx_map_io(void)
103{
104 iotable_init(ixp23xx_io_desc, ARRAY_SIZE(ixp23xx_io_desc));
105}
106
107
108/***************************************************************************
109 * IXP23xx Interrupt Handling
110 ***************************************************************************/
111enum ixp23xx_irq_type {
112 IXP23XX_IRQ_LEVEL, IXP23XX_IRQ_EDGE
113};
114
115static void ixp23xx_config_irq(unsigned int, enum ixp23xx_irq_type);
116
117static int ixp23xx_irq_set_type(unsigned int irq, unsigned int type)
118{
119 int line = irq - IRQ_IXP23XX_GPIO6 + 6;
120 u32 int_style;
121 enum ixp23xx_irq_type irq_type;
122 volatile u32 *int_reg;
123
124 /*
125 * Only GPIOs 6-15 are wired to interrupts on IXP23xx
126 */
127 if (line < 6 || line > 15)
128 return -EINVAL;
129
130 switch (type) {
131 case IRQT_BOTHEDGE:
132 int_style = IXP23XX_GPIO_STYLE_TRANSITIONAL;
133 irq_type = IXP23XX_IRQ_EDGE;
134 break;
135 case IRQT_RISING:
136 int_style = IXP23XX_GPIO_STYLE_RISING_EDGE;
137 irq_type = IXP23XX_IRQ_EDGE;
138 break;
139 case IRQT_FALLING:
140 int_style = IXP23XX_GPIO_STYLE_FALLING_EDGE;
141 irq_type = IXP23XX_IRQ_EDGE;
142 break;
143 case IRQT_HIGH:
144 int_style = IXP23XX_GPIO_STYLE_ACTIVE_HIGH;
145 irq_type = IXP23XX_IRQ_LEVEL;
146 break;
147 case IRQT_LOW:
148 int_style = IXP23XX_GPIO_STYLE_ACTIVE_LOW;
149 irq_type = IXP23XX_IRQ_LEVEL;
150 break;
151 default:
152 return -EINVAL;
153 }
154
155 ixp23xx_config_irq(irq, irq_type);
156
157 if (line >= 8) { /* pins 8-15 */
158 line -= 8;
159 int_reg = (volatile u32 *)IXP23XX_GPIO_GPIT2R;
160 } else { /* pins 0-7 */
161 int_reg = (volatile u32 *)IXP23XX_GPIO_GPIT1R;
162 }
163
164 /*
165 * Clear pending interrupts
166 */
167 *IXP23XX_GPIO_GPISR = (1 << line);
168
169 /* Clear the style for the appropriate pin */
170 *int_reg &= ~(IXP23XX_GPIO_STYLE_MASK <<
171 (line * IXP23XX_GPIO_STYLE_SIZE));
172
173 /* Set the new style */
174 *int_reg |= (int_style << (line * IXP23XX_GPIO_STYLE_SIZE));
175
176 return 0;
177}
178
179static void ixp23xx_irq_mask(unsigned int irq)
180{
181 volatile unsigned long *intr_reg = IXP23XX_INTR_EN1 + (irq / 32);
182
183 *intr_reg &= ~(1 << (irq % 32));
184}
185
186static void ixp23xx_irq_ack(unsigned int irq)
187{
188 int line = irq - IRQ_IXP23XX_GPIO6 + 6;
189
190 if ((line < 6) || (line > 15))
191 return;
192
193 *IXP23XX_GPIO_GPISR = (1 << line);
194}
195
196/*
197 * Level triggered interrupts on GPIO lines can only be cleared when the
198 * interrupt condition disappears.
199 */
200static void ixp23xx_irq_level_unmask(unsigned int irq)
201{
202 volatile unsigned long *intr_reg = IXP23XX_INTR_EN1 + (irq / 32);
203
204 ixp23xx_irq_ack(irq);
205
206 *intr_reg |= (1 << (irq % 32));
207}
208
209static void ixp23xx_irq_edge_unmask(unsigned int irq)
210{
211 volatile unsigned long *intr_reg = IXP23XX_INTR_EN1 + (irq / 32);
212
213 *intr_reg |= (1 << (irq % 32));
214}
215
216static struct irqchip ixp23xx_irq_level_chip = {
217 .ack = ixp23xx_irq_mask,
218 .mask = ixp23xx_irq_mask,
219 .unmask = ixp23xx_irq_level_unmask,
220 .set_type = ixp23xx_irq_set_type
221};
222
223static struct irqchip ixp23xx_irq_edge_chip = {
224 .ack = ixp23xx_irq_ack,
225 .mask = ixp23xx_irq_mask,
226 .unmask = ixp23xx_irq_edge_unmask,
227 .set_type = ixp23xx_irq_set_type
228};
229
230static void ixp23xx_pci_irq_mask(unsigned int irq)
231{
232 *IXP23XX_PCI_XSCALE_INT_ENABLE &= ~(1 << (IRQ_IXP23XX_INTA + 27 - irq));
233}
234
235static void ixp23xx_pci_irq_unmask(unsigned int irq)
236{
237 *IXP23XX_PCI_XSCALE_INT_ENABLE |= (1 << (IRQ_IXP23XX_INTA + 27 - irq));
238}
239
240/*
241 * TODO: Should this just be done at ASM level?
242 */
243static void pci_handler(unsigned int irq, struct irqdesc *desc, struct pt_regs *regs)
244{
245 u32 pci_interrupt;
246 unsigned int irqno;
247 struct irqdesc *int_desc;
248
249 pci_interrupt = *IXP23XX_PCI_XSCALE_INT_STATUS;
250
251 desc->chip->ack(irq);
252
253 /* See which PCI_INTA, or PCI_INTB interrupted */
254 if (pci_interrupt & (1 << 26)) {
255 irqno = IRQ_IXP23XX_INTB;
256 } else if (pci_interrupt & (1 << 27)) {
257 irqno = IRQ_IXP23XX_INTA;
258 } else {
259 BUG();
260 }
261
262 int_desc = irq_desc + irqno;
263 int_desc->handle(irqno, int_desc, regs);
264
265 desc->chip->unmask(irq);
266}
267
268static struct irqchip ixp23xx_pci_irq_chip = {
269 .ack = ixp23xx_pci_irq_mask,
270 .mask = ixp23xx_pci_irq_mask,
271 .unmask = ixp23xx_pci_irq_unmask
272};
273
274static void ixp23xx_config_irq(unsigned int irq, enum ixp23xx_irq_type type)
275{
276 switch (type) {
277 case IXP23XX_IRQ_LEVEL:
278 set_irq_chip(irq, &ixp23xx_irq_level_chip);
279 set_irq_handler(irq, do_level_IRQ);
280 break;
281 case IXP23XX_IRQ_EDGE:
282 set_irq_chip(irq, &ixp23xx_irq_edge_chip);
283 set_irq_handler(irq, do_edge_IRQ);
284 break;
285 }
286 set_irq_flags(irq, IRQF_VALID);
287}
288
289void __init ixp23xx_init_irq(void)
290{
291 int irq;
292
293 /* Route everything to IRQ */
294 *IXP23XX_INTR_SEL1 = 0x0;
295 *IXP23XX_INTR_SEL2 = 0x0;
296 *IXP23XX_INTR_SEL3 = 0x0;
297 *IXP23XX_INTR_SEL4 = 0x0;
298
299 /* Mask all sources */
300 *IXP23XX_INTR_EN1 = 0x0;
301 *IXP23XX_INTR_EN2 = 0x0;
302 *IXP23XX_INTR_EN3 = 0x0;
303 *IXP23XX_INTR_EN4 = 0x0;
304
305 /*
306 * Configure all IRQs for level-sensitive operation
307 */
308 for (irq = 0; irq <= NUM_IXP23XX_RAW_IRQS; irq++) {
309 ixp23xx_config_irq(irq, IXP23XX_IRQ_LEVEL);
310 }
311
312 for (irq = IRQ_IXP23XX_INTA; irq <= IRQ_IXP23XX_INTB; irq++) {
313 set_irq_chip(irq, &ixp23xx_pci_irq_chip);
314 set_irq_handler(irq, do_level_IRQ);
315 set_irq_flags(irq, IRQF_VALID);
316 }
317
318 set_irq_chained_handler(IRQ_IXP23XX_PCI_INT_RPH, pci_handler);
319}
320
321
322/*************************************************************************
323 * Timer-tick functions for IXP23xx
324 *************************************************************************/
325#define CLOCK_TICKS_PER_USEC CLOCK_TICK_RATE / (USEC_PER_SEC)
326
327static unsigned long next_jiffy_time;
328
329static unsigned long
330ixp23xx_gettimeoffset(void)
331{
332 unsigned long elapsed;
333
334 elapsed = *IXP23XX_TIMER_CONT - (next_jiffy_time - LATCH);
335
336 return elapsed / CLOCK_TICKS_PER_USEC;
337}
338
339static irqreturn_t
340ixp23xx_timer_interrupt(int irq, void *dev_id, struct pt_regs *regs)
341{
342 /* Clear Pending Interrupt by writing '1' to it */
343 *IXP23XX_TIMER_STATUS = IXP23XX_TIMER1_INT_PEND;
344 while ((*IXP23XX_TIMER_CONT - next_jiffy_time) > LATCH) {
345 timer_tick(regs);
346 next_jiffy_time += LATCH;
347 }
348
349 return IRQ_HANDLED;
350}
351
352static struct irqaction ixp23xx_timer_irq = {
353 .name = "IXP23xx Timer Tick",
354 .handler = ixp23xx_timer_interrupt,
355 .flags = SA_INTERRUPT | SA_TIMER,
356};
357
358void __init ixp23xx_init_timer(void)
359{
360 /* Clear Pending Interrupt by writing '1' to it */
361 *IXP23XX_TIMER_STATUS = IXP23XX_TIMER1_INT_PEND;
362
363 /* Setup the Timer counter value */
364 *IXP23XX_TIMER1_RELOAD =
365 (LATCH & ~IXP23XX_TIMER_RELOAD_MASK) | IXP23XX_TIMER_ENABLE;
366
367 *IXP23XX_TIMER_CONT = 0;
368 next_jiffy_time = LATCH;
369
370 /* Connect the interrupt handler and enable the interrupt */
371 setup_irq(IRQ_IXP23XX_TIMER1, &ixp23xx_timer_irq);
372}
373
374struct sys_timer ixp23xx_timer = {
375 .init = ixp23xx_init_timer,
376 .offset = ixp23xx_gettimeoffset,
377};
378
379
380/*************************************************************************
381 * IXP23xx Platform Initializaion
382 *************************************************************************/
383static struct resource ixp23xx_uart_resources[] = {
384 {
385 .start = IXP23XX_UART1_PHYS,
386 .end = IXP23XX_UART1_PHYS + 0x0fff,
387 .flags = IORESOURCE_MEM
388 }, {
389 .start = IXP23XX_UART2_PHYS,
390 .end = IXP23XX_UART2_PHYS + 0x0fff,
391 .flags = IORESOURCE_MEM
392 }
393};
394
395static struct plat_serial8250_port ixp23xx_uart_data[] = {
396 {
397 .mapbase = IXP23XX_UART1_PHYS,
398 .membase = (char *)(IXP23XX_UART1_VIRT + 3),
399 .irq = IRQ_IXP23XX_UART1,
400 .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST,
401 .iotype = UPIO_MEM,
402 .regshift = 2,
403 .uartclk = IXP23XX_UART_XTAL,
404 }, {
405 .mapbase = IXP23XX_UART2_PHYS,
406 .membase = (char *)(IXP23XX_UART2_VIRT + 3),
407 .irq = IRQ_IXP23XX_UART2,
408 .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST,
409 .iotype = UPIO_MEM,
410 .regshift = 2,
411 .uartclk = IXP23XX_UART_XTAL,
412 },
413 { },
414};
415
416static struct platform_device ixp23xx_uart = {
417 .name = "serial8250",
418 .id = 0,
419 .dev.platform_data = ixp23xx_uart_data,
420 .num_resources = 2,
421 .resource = ixp23xx_uart_resources,
422};
423
424static struct platform_device *ixp23xx_devices[] __initdata = {
425 &ixp23xx_uart,
426};
427
428void __init ixp23xx_sys_init(void)
429{
430 platform_add_devices(ixp23xx_devices, ARRAY_SIZE(ixp23xx_devices));
431}
diff --git a/arch/arm/mach-ixp23xx/espresso.c b/arch/arm/mach-ixp23xx/espresso.c
new file mode 100644
index 000000000000..2327c9790416
--- /dev/null
+++ b/arch/arm/mach-ixp23xx/espresso.c
@@ -0,0 +1,69 @@
1/*
2 * arch/arm/mach-ixp23xx/espresso.c
3 *
4 * Double Espresso-specific routines
5 *
6 * Author: Lennert Buytenhek <buytenh@wantstofly.org>
7 *
8 * This file is licensed under the terms of the GNU General Public
9 * License version 2. This program is licensed "as is" without any
10 * warranty of any kind, whether express or implied.
11 */
12
13#include <linux/config.h>
14#include <linux/kernel.h>
15#include <linux/init.h>
16#include <linux/spinlock.h>
17#include <linux/sched.h>
18#include <linux/interrupt.h>
19#include <linux/serial.h>
20#include <linux/tty.h>
21#include <linux/bitops.h>
22#include <linux/ioport.h>
23#include <linux/serial.h>
24#include <linux/serial_8250.h>
25#include <linux/serial_core.h>
26#include <linux/device.h>
27#include <linux/mm.h>
28#include <linux/pci.h>
29#include <linux/mtd/physmap.h>
30
31#include <asm/types.h>
32#include <asm/setup.h>
33#include <asm/memory.h>
34#include <asm/hardware.h>
35#include <asm/mach-types.h>
36#include <asm/irq.h>
37#include <asm/system.h>
38#include <asm/tlbflush.h>
39#include <asm/pgtable.h>
40
41#include <asm/mach/map.h>
42#include <asm/mach/irq.h>
43#include <asm/mach/arch.h>
44#include <asm/mach/irq.h>
45#include <asm/mach/pci.h>
46
47static void __init espresso_init(void)
48{
49 physmap_configure(0x90000000, 0x02000000, 2, NULL);
50
51 /*
52 * Mark flash as writeable.
53 */
54 IXP23XX_EXP_CS0[0] |= IXP23XX_FLASH_WRITABLE;
55 IXP23XX_EXP_CS0[1] |= IXP23XX_FLASH_WRITABLE;
56
57 ixp23xx_sys_init();
58}
59
60MACHINE_START(ESPRESSO, "IP Fabrics Double Espresso")
61 /* Maintainer: Lennert Buytenhek */
62 .phys_io = IXP23XX_PERIPHERAL_PHYS,
63 .io_pg_offst = ((IXP23XX_PERIPHERAL_VIRT >> 18)) & 0xfffc,
64 .map_io = ixp23xx_map_io,
65 .init_irq = ixp23xx_init_irq,
66 .timer = &ixp23xx_timer,
67 .boot_params = 0x00000100,
68 .init_machine = espresso_init,
69MACHINE_END
diff --git a/arch/arm/mach-ixp23xx/ixdp2351.c b/arch/arm/mach-ixp23xx/ixdp2351.c
new file mode 100644
index 000000000000..00146c35daac
--- /dev/null
+++ b/arch/arm/mach-ixp23xx/ixdp2351.c
@@ -0,0 +1,325 @@
1/*
2 * arch/arm/mach-ixp23xx/ixdp2351.c
3 *
4 * IXDP2351 board-specific routines
5 *
6 * Author: Deepak Saxena <dsaxena@plexity.net>
7 *
8 * Copyright 2005 (c) MontaVista Software, Inc.
9 *
10 * Based on 2.4 code Copyright 2004 (c) Intel Corporation
11 *
12 * This file is licensed under the terms of the GNU General Public
13 * License version 2. This program is licensed "as is" without any
14 * warranty of any kind, whether express or implied.
15 */
16
17#include <linux/config.h>
18#include <linux/kernel.h>
19#include <linux/init.h>
20#include <linux/spinlock.h>
21#include <linux/sched.h>
22#include <linux/interrupt.h>
23#include <linux/serial.h>
24#include <linux/tty.h>
25#include <linux/bitops.h>
26#include <linux/ioport.h>
27#include <linux/serial.h>
28#include <linux/serial_8250.h>
29#include <linux/serial_core.h>
30#include <linux/device.h>
31#include <linux/mm.h>
32#include <linux/pci.h>
33#include <linux/mtd/physmap.h>
34
35#include <asm/types.h>
36#include <asm/setup.h>
37#include <asm/memory.h>
38#include <asm/hardware.h>
39#include <asm/mach-types.h>
40#include <asm/irq.h>
41#include <asm/system.h>
42#include <asm/tlbflush.h>
43#include <asm/pgtable.h>
44
45#include <asm/mach/map.h>
46#include <asm/mach/irq.h>
47#include <asm/mach/arch.h>
48#include <asm/mach/irq.h>
49#include <asm/mach/pci.h>
50
51/*
52 * IXDP2351 Interrupt Handling
53 */
54static void ixdp2351_inta_mask(unsigned int irq)
55{
56 *IXDP2351_CPLD_INTA_MASK_SET_REG = IXDP2351_INTA_IRQ_MASK(irq);
57}
58
59static void ixdp2351_inta_unmask(unsigned int irq)
60{
61 *IXDP2351_CPLD_INTA_MASK_CLR_REG = IXDP2351_INTA_IRQ_MASK(irq);
62}
63
64static void ixdp2351_inta_handler(unsigned int irq, struct irqdesc *desc, struct pt_regs *regs)
65{
66 u16 ex_interrupt =
67 *IXDP2351_CPLD_INTA_STAT_REG & IXDP2351_INTA_IRQ_VALID;
68 int i;
69
70 desc->chip->mask(irq);
71
72 for (i = 0; i < IXDP2351_INTA_IRQ_NUM; i++) {
73 if (ex_interrupt & (1 << i)) {
74 struct irqdesc *cpld_desc;
75 int cpld_irq =
76 IXP23XX_MACH_IRQ(IXDP2351_INTA_IRQ_BASE + i);
77 cpld_desc = irq_desc + cpld_irq;
78 cpld_desc->handle(cpld_irq, cpld_desc, regs);
79 }
80 }
81
82 desc->chip->unmask(irq);
83}
84
85static struct irqchip ixdp2351_inta_chip = {
86 .ack = ixdp2351_inta_mask,
87 .mask = ixdp2351_inta_mask,
88 .unmask = ixdp2351_inta_unmask
89};
90
91static void ixdp2351_intb_mask(unsigned int irq)
92{
93 *IXDP2351_CPLD_INTB_MASK_SET_REG = IXDP2351_INTB_IRQ_MASK(irq);
94}
95
96static void ixdp2351_intb_unmask(unsigned int irq)
97{
98 *IXDP2351_CPLD_INTB_MASK_CLR_REG = IXDP2351_INTB_IRQ_MASK(irq);
99}
100
101static void ixdp2351_intb_handler(unsigned int irq, struct irqdesc *desc, struct pt_regs *regs)
102{
103 u16 ex_interrupt =
104 *IXDP2351_CPLD_INTB_STAT_REG & IXDP2351_INTB_IRQ_VALID;
105 int i;
106
107 desc->chip->ack(irq);
108
109 for (i = 0; i < IXDP2351_INTB_IRQ_NUM; i++) {
110 if (ex_interrupt & (1 << i)) {
111 struct irqdesc *cpld_desc;
112 int cpld_irq =
113 IXP23XX_MACH_IRQ(IXDP2351_INTB_IRQ_BASE + i);
114 cpld_desc = irq_desc + cpld_irq;
115 cpld_desc->handle(cpld_irq, cpld_desc, regs);
116 }
117 }
118
119 desc->chip->unmask(irq);
120}
121
122static struct irqchip ixdp2351_intb_chip = {
123 .ack = ixdp2351_intb_mask,
124 .mask = ixdp2351_intb_mask,
125 .unmask = ixdp2351_intb_unmask
126};
127
128void ixdp2351_init_irq(void)
129{
130 int irq;
131
132 /* Mask all interrupts from CPLD, disable simulation */
133 *IXDP2351_CPLD_INTA_MASK_SET_REG = (u16) -1;
134 *IXDP2351_CPLD_INTB_MASK_SET_REG = (u16) -1;
135 *IXDP2351_CPLD_INTA_SIM_REG = 0;
136 *IXDP2351_CPLD_INTB_SIM_REG = 0;
137
138 ixp23xx_init_irq();
139
140 for (irq = IXP23XX_MACH_IRQ(IXDP2351_INTA_IRQ_BASE);
141 irq <
142 IXP23XX_MACH_IRQ(IXDP2351_INTA_IRQ_BASE + IXDP2351_INTA_IRQ_NUM);
143 irq++) {
144 if (IXDP2351_INTA_IRQ_MASK(irq) & IXDP2351_INTA_IRQ_VALID) {
145 set_irq_flags(irq, IRQF_VALID);
146 set_irq_handler(irq, do_level_IRQ);
147 set_irq_chip(irq, &ixdp2351_inta_chip);
148 }
149 }
150
151 for (irq = IXP23XX_MACH_IRQ(IXDP2351_INTB_IRQ_BASE);
152 irq <
153 IXP23XX_MACH_IRQ(IXDP2351_INTB_IRQ_BASE + IXDP2351_INTB_IRQ_NUM);
154 irq++) {
155 if (IXDP2351_INTB_IRQ_MASK(irq) & IXDP2351_INTB_IRQ_VALID) {
156 set_irq_flags(irq, IRQF_VALID);
157 set_irq_handler(irq, do_level_IRQ);
158 set_irq_chip(irq, &ixdp2351_intb_chip);
159 }
160 }
161
162 set_irq_chained_handler(IRQ_IXP23XX_INTA, &ixdp2351_inta_handler);
163 set_irq_chained_handler(IRQ_IXP23XX_INTB, &ixdp2351_intb_handler);
164}
165
166/*
167 * IXDP2351 PCI
168 */
169
170/*
171 * This board does not do normal PCI IRQ routing, or any
172 * sort of swizzling, so we just need to check where on the
173 * bus the device is and figure out what CPLD pin it is
174 * being routed to.
175 */
176#define DEVPIN(dev, pin) ((pin) | ((dev) << 3))
177
178static int __init ixdp2351_map_irq(struct pci_dev *dev, u8 slot, u8 pin)
179{
180 u8 bus = dev->bus->number;
181 u32 devpin = DEVPIN(PCI_SLOT(dev->devfn), pin);
182 struct pci_bus *tmp_bus = dev->bus;
183
184 /* Primary bus, no interrupts here */
185 if (!bus)
186 return -1;
187
188 /* Lookup first leaf in bus tree */
189 while ((tmp_bus->parent != NULL) && (tmp_bus->parent->parent != NULL))
190 tmp_bus = tmp_bus->parent;
191
192 /* Select between known bridges */
193 switch (tmp_bus->self->devfn | (tmp_bus->self->bus->number << 8)) {
194 /* Device is located after first bridge */
195 case 0x0008:
196 if (tmp_bus == dev->bus) {
197 /* Device is located directy after first bridge */
198 switch (devpin) {
199 /* Onboard 82546 */
200 case DEVPIN(1, 1): /* Onboard 82546 ch 0 */
201 return IRQ_IXDP2351_INTA_82546;
202 case DEVPIN(1, 2): /* Onboard 82546 ch 1 */
203 return IRQ_IXDP2351_INTB_82546;
204 /* PMC SLOT */
205 case DEVPIN(0, 1): /* PMCP INTA# */
206 case DEVPIN(2, 4): /* PMCS INTD# */
207 return IRQ_IXDP2351_SPCI_PMC_INTA;
208 case DEVPIN(0, 2): /* PMCP INTB# */
209 case DEVPIN(2, 1): /* PMCS INTA# */
210 return IRQ_IXDP2351_SPCI_PMC_INTB;
211 case DEVPIN(0, 3): /* PMCP INTC# */
212 case DEVPIN(2, 2): /* PMCS INTB# */
213 return IRQ_IXDP2351_SPCI_PMC_INTC;
214 case DEVPIN(0, 4): /* PMCP INTD# */
215 case DEVPIN(2, 3): /* PMCS INTC# */
216 return IRQ_IXDP2351_SPCI_PMC_INTD;
217 }
218 } else {
219 /* Device is located indirectly after first bridge */
220 /* Not supported now */
221 return -1;
222 }
223 break;
224 case 0x0010:
225 if (tmp_bus == dev->bus) {
226 /* Device is located directy after second bridge */
227 /* Secondary bus of second bridge */
228 switch (devpin) {
229 case DEVPIN(0, 1): /* DB#0 */
230 case DEVPIN(0, 2):
231 case DEVPIN(0, 3):
232 case DEVPIN(0, 4):
233 return IRQ_IXDP2351_SPCI_DB_0;
234 case DEVPIN(1, 1): /* DB#1 */
235 case DEVPIN(1, 2):
236 case DEVPIN(1, 3):
237 case DEVPIN(1, 4):
238 return IRQ_IXDP2351_SPCI_DB_1;
239 case DEVPIN(2, 1): /* FIC1 */
240 case DEVPIN(2, 2):
241 case DEVPIN(2, 3):
242 case DEVPIN(2, 4):
243 case DEVPIN(3, 1): /* FIC2 */
244 case DEVPIN(3, 2):
245 case DEVPIN(3, 3):
246 case DEVPIN(3, 4):
247 return IRQ_IXDP2351_SPCI_FIC;
248 }
249 } else {
250 /* Device is located indirectly after second bridge */
251 /* Not supported now */
252 return -1;
253 }
254 break;
255 }
256
257 return -1;
258}
259
260struct hw_pci ixdp2351_pci __initdata = {
261 .nr_controllers = 1,
262 .preinit = ixp23xx_pci_preinit,
263 .setup = ixp23xx_pci_setup,
264 .scan = ixp23xx_pci_scan_bus,
265 .map_irq = ixdp2351_map_irq,
266};
267
268int __init ixdp2351_pci_init(void)
269{
270 if (machine_is_ixdp2351())
271 pci_common_init(&ixdp2351_pci);
272
273 return 0;
274}
275
276subsys_initcall(ixdp2351_pci_init);
277
278/*
279 * IXDP2351 Static Mapped I/O
280 */
281static struct map_desc ixdp2351_io_desc[] __initdata = {
282 {
283 .virtual = IXDP2351_NP_VIRT_BASE,
284 .pfn = __phys_to_pfn((u64)IXDP2351_NP_PHYS_BASE),
285 .length = IXDP2351_NP_PHYS_SIZE,
286 .type = MT_DEVICE
287 }, {
288 .virtual = IXDP2351_BB_BASE_VIRT,
289 .pfn = __phys_to_pfn((u64)IXDP2351_BB_BASE_PHYS),
290 .length = IXDP2351_BB_SIZE,
291 .type = MT_DEVICE
292 }
293};
294
295static void __init ixdp2351_map_io(void)
296{
297 ixp23xx_map_io();
298 iotable_init(ixdp2351_io_desc, ARRAY_SIZE(ixdp2351_io_desc));
299}
300
301static void __init ixdp2351_init(void)
302{
303 physmap_configure(0x90000000, 0x04000000, 1, NULL);
304
305 /*
306 * Mark flash as writeable
307 */
308 IXP23XX_EXP_CS0[0] |= IXP23XX_FLASH_WRITABLE;
309 IXP23XX_EXP_CS0[1] |= IXP23XX_FLASH_WRITABLE;
310 IXP23XX_EXP_CS0[2] |= IXP23XX_FLASH_WRITABLE;
311 IXP23XX_EXP_CS0[3] |= IXP23XX_FLASH_WRITABLE;
312
313 ixp23xx_sys_init();
314}
315
316MACHINE_START(IXDP2351, "Intel IXDP2351 Development Platform")
317 /* Maintainer: MontaVista Software, Inc. */
318 .phys_io = IXP23XX_PERIPHERAL_PHYS,
319 .io_pg_offst = ((IXP23XX_PERIPHERAL_VIRT >> 18)) & 0xfffc,
320 .map_io = ixdp2351_map_io,
321 .init_irq = ixdp2351_init_irq,
322 .timer = &ixp23xx_timer,
323 .boot_params = 0x00000100,
324 .init_machine = ixdp2351_init,
325MACHINE_END
diff --git a/arch/arm/mach-ixp23xx/pci.c b/arch/arm/mach-ixp23xx/pci.c
new file mode 100644
index 000000000000..5330ad78c1bb
--- /dev/null
+++ b/arch/arm/mach-ixp23xx/pci.c
@@ -0,0 +1,275 @@
1/*
2 * arch/arm/mach-ixp23xx/pci.c
3 *
4 * PCI routines for IXP23XX based systems
5 *
6 * Copyright (c) 2005 MontaVista Software, Inc.
7 *
8 * based on original code:
9 *
10 * Author: Naeem Afzal <naeem.m.afzal@intel.com>
11 * Copyright 2002-2005 Intel Corp.
12 *
13 * This program is free software; you can redistribute it and/or modify it
14 * under the terms of the GNU General Public License as published by the
15 * Free Software Foundation; either version 2 of the License, or (at your
16 * option) any later version.
17 */
18
19#include <linux/config.h>
20#include <linux/sched.h>
21#include <linux/kernel.h>
22#include <linux/pci.h>
23#include <linux/interrupt.h>
24#include <linux/mm.h>
25#include <linux/init.h>
26#include <linux/ioport.h>
27#include <linux/slab.h>
28#include <linux/delay.h>
29
30#include <asm/io.h>
31#include <asm/irq.h>
32#include <asm/sizes.h>
33#include <asm/system.h>
34#include <asm/mach/pci.h>
35#include <asm/mach-types.h>
36#include <asm/hardware.h>
37
38extern int (*external_fault) (unsigned long, struct pt_regs *);
39
40static int pci_master_aborts = 0;
41
42#ifdef DEBUG
43#define DBG(x...) printk(x)
44#else
45#define DBG(x...)
46#endif
47
48int clear_master_aborts(void);
49
50static u32
51*ixp23xx_pci_config_addr(unsigned int bus_nr, unsigned int devfn, int where)
52{
53 u32 *paddress;
54
55 /*
56 * Must be dword aligned
57 */
58 where &= ~3;
59
60 /*
61 * For top bus, generate type 0, else type 1
62 */
63 if (!bus_nr) {
64 if (PCI_SLOT(devfn) >= 8)
65 return 0;
66
67 paddress = (u32 *) (IXP23XX_PCI_CFG0_VIRT
68 | (1 << (PCI_SLOT(devfn) + 16))
69 | (PCI_FUNC(devfn) << 8) | where);
70 } else {
71 paddress = (u32 *) (IXP23XX_PCI_CFG1_VIRT
72 | (bus_nr << 16)
73 | (PCI_SLOT(devfn) << 11)
74 | (PCI_FUNC(devfn) << 8) | where);
75 }
76
77 return paddress;
78}
79
80/*
81 * Mask table, bits to mask for quantity of size 1, 2 or 4 bytes.
82 * 0 and 3 are not valid indexes...
83 */
84static u32 bytemask[] = {
85 /*0*/ 0,
86 /*1*/ 0xff,
87 /*2*/ 0xffff,
88 /*3*/ 0,
89 /*4*/ 0xffffffff,
90};
91
92static int ixp23xx_pci_read_config(struct pci_bus *bus, unsigned int devfn,
93 int where, int size, u32 *value)
94{
95 u32 n;
96 u32 *addr;
97
98 n = where % 4;
99
100 DBG("In config_read(%d) %d from dev %d:%d:%d\n", size, where,
101 bus->number, PCI_SLOT(devfn), PCI_FUNC(devfn));
102
103 addr = ixp23xx_pci_config_addr(bus->number, devfn, where);
104 if (!addr)
105 return PCIBIOS_DEVICE_NOT_FOUND;
106
107 pci_master_aborts = 0;
108 *value = (*addr >> (8*n)) & bytemask[size];
109 if (pci_master_aborts) {
110 pci_master_aborts = 0;
111 *value = 0xffffffff;
112 return PCIBIOS_DEVICE_NOT_FOUND;
113 }
114
115 return PCIBIOS_SUCCESSFUL;
116}
117
118/*
119 * We don't do error checking on the address for writes.
120 * It's assumed that the user checked for the device existing first
121 * by doing a read first.
122 */
123static int ixp23xx_pci_write_config(struct pci_bus *bus, unsigned int devfn,
124 int where, int size, u32 value)
125{
126 u32 mask;
127 u32 *addr;
128 u32 temp;
129
130 mask = ~(bytemask[size] << ((where % 0x4) * 8));
131 addr = ixp23xx_pci_config_addr(bus->number, devfn, where);
132 if (!addr)
133 return PCIBIOS_DEVICE_NOT_FOUND;
134 temp = (u32) (value) << ((where % 0x4) * 8);
135 *addr = (*addr & mask) | temp;
136
137 clear_master_aborts();
138
139 return PCIBIOS_SUCCESSFUL;
140}
141
142struct pci_ops ixp23xx_pci_ops = {
143 .read = ixp23xx_pci_read_config,
144 .write = ixp23xx_pci_write_config,
145};
146
147struct pci_bus *ixp23xx_pci_scan_bus(int nr, struct pci_sys_data *sysdata)
148{
149 return pci_scan_bus(sysdata->busnr, &ixp23xx_pci_ops, sysdata);
150}
151
152int ixp23xx_pci_abort_handler(unsigned long addr, unsigned int fsr, struct pt_regs *regs)
153{
154 volatile unsigned long temp;
155 unsigned long flags;
156
157 pci_master_aborts = 1;
158
159 local_irq_save(flags);
160 temp = *IXP23XX_PCI_CONTROL;
161
162 /*
163 * master abort and cmd tgt err
164 */
165 if (temp & ((1 << 8) | (1 << 5)))
166 *IXP23XX_PCI_CONTROL = temp;
167
168 temp = *IXP23XX_PCI_CMDSTAT;
169
170 if (temp & (1 << 29))
171 *IXP23XX_PCI_CMDSTAT = temp;
172 local_irq_restore(flags);
173
174 /*
175 * If it was an imprecise abort, then we need to correct the
176 * return address to be _after_ the instruction.
177 */
178 if (fsr & (1 << 10))
179 regs->ARM_pc += 4;
180
181 return 0;
182}
183
184int clear_master_aborts(void)
185{
186 volatile u32 temp;
187
188 temp = *IXP23XX_PCI_CONTROL;
189
190 /*
191 * master abort and cmd tgt err
192 */
193 if (temp & ((1 << 8) | (1 << 5)))
194 *IXP23XX_PCI_CONTROL = temp;
195
196 temp = *IXP23XX_PCI_CMDSTAT;
197
198 if (temp & (1 << 29))
199 *IXP23XX_PCI_CMDSTAT = temp;
200
201 return 0;
202}
203
204void __init ixp23xx_pci_preinit(void)
205{
206#ifdef __ARMEB__
207 *IXP23XX_PCI_CONTROL |= 0x20000; /* set I/O swapping */
208#endif
209 /*
210 * ADDR_31 needs to be clear for PCI memory access to CPP memory
211 */
212 *IXP23XX_CPP2XSI_CURR_XFER_REG3 &= ~IXP23XX_CPP2XSI_ADDR_31;
213 *IXP23XX_CPP2XSI_CURR_XFER_REG3 |= IXP23XX_CPP2XSI_PSH_OFF;
214
215 /*
216 * Select correct memory for PCI inbound transactions
217 */
218 if (ixp23xx_cpp_boot()) {
219 *IXP23XX_PCI_CPP_ADDR_BITS &= ~(1 << 1);
220 } else {
221 *IXP23XX_PCI_CPP_ADDR_BITS |= (1 << 1);
222 }
223
224 hook_fault_code(16+6, ixp23xx_pci_abort_handler, SIGBUS,
225 "PCI config cycle to non-existent device");
226
227 *IXP23XX_PCI_ADDR_EXT = 0x0000e000;
228}
229
230/*
231 * Prevent PCI layer from seeing the inbound host-bridge resources
232 */
233static void __devinit pci_fixup_ixp23xx(struct pci_dev *dev)
234{
235 int i;
236
237 dev->class &= 0xff;
238 dev->class |= PCI_CLASS_BRIDGE_HOST << 8;
239 for (i = 0; i < PCI_NUM_RESOURCES; i++) {
240 dev->resource[i].start = 0;
241 dev->resource[i].end = 0;
242 dev->resource[i].flags = 0;
243 }
244}
245DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, 0x9002, pci_fixup_ixp23xx);
246
247/*
248 * IXP2300 systems often have large resource requirements, so we just
249 * use our own resource space.
250 */
251static struct resource ixp23xx_pci_mem_space = {
252 .start = IXP23XX_PCI_MEM_START,
253 .end = IXP23XX_PCI_MEM_START + IXP23XX_PCI_MEM_SIZE - 1,
254 .flags = IORESOURCE_MEM,
255 .name = "PCI Mem Space"
256};
257
258static struct resource ixp23xx_pci_io_space = {
259 .start = 0x00000100,
260 .end = 0x01ffffff,
261 .flags = IORESOURCE_IO,
262 .name = "PCI I/O Space"
263};
264
265int ixp23xx_pci_setup(int nr, struct pci_sys_data *sys)
266{
267 if (nr >= 1)
268 return 0;
269
270 sys->resource[0] = &ixp23xx_pci_io_space;
271 sys->resource[1] = &ixp23xx_pci_mem_space;
272 sys->resource[2] = NULL;
273
274 return 1;
275}
diff --git a/arch/arm/mach-ixp23xx/roadrunner.c b/arch/arm/mach-ixp23xx/roadrunner.c
new file mode 100644
index 000000000000..43c14e740794
--- /dev/null
+++ b/arch/arm/mach-ixp23xx/roadrunner.c
@@ -0,0 +1,164 @@
1/*
2 * arch/arm/mach-ixp23xx/roadrunner.c
3 *
4 * RoadRunner board-specific routines
5 *
6 * Author: Deepak Saxena <dsaxena@plexity.net>
7 *
8 * Copyright 2005 (c) MontaVista Software, Inc.
9 *
10 * Based on 2.4 code Copyright 2005 (c) ADI Engineering Corporation
11 *
12 * This file is licensed under the terms of the GNU General Public
13 * License version 2. This program is licensed "as is" without any
14 * warranty of any kind, whether express or implied.
15 */
16
17#include <linux/config.h>
18#include <linux/kernel.h>
19#include <linux/init.h>
20#include <linux/spinlock.h>
21#include <linux/sched.h>
22#include <linux/interrupt.h>
23#include <linux/serial.h>
24#include <linux/tty.h>
25#include <linux/bitops.h>
26#include <linux/ioport.h>
27#include <linux/serial.h>
28#include <linux/serial_8250.h>
29#include <linux/serial_core.h>
30#include <linux/device.h>
31#include <linux/mm.h>
32#include <linux/pci.h>
33#include <linux/mtd/physmap.h>
34
35#include <asm/types.h>
36#include <asm/setup.h>
37#include <asm/memory.h>
38#include <asm/hardware.h>
39#include <asm/mach-types.h>
40#include <asm/irq.h>
41#include <asm/system.h>
42#include <asm/tlbflush.h>
43#include <asm/pgtable.h>
44
45#include <asm/mach/map.h>
46#include <asm/mach/irq.h>
47#include <asm/mach/arch.h>
48#include <asm/mach/irq.h>
49#include <asm/mach/pci.h>
50
51/*
52 * Interrupt mapping
53 */
54#define INTA IRQ_ROADRUNNER_PCI_INTA
55#define INTB IRQ_ROADRUNNER_PCI_INTB
56#define INTC IRQ_ROADRUNNER_PCI_INTC
57#define INTD IRQ_ROADRUNNER_PCI_INTD
58
59#define INTC_PIN IXP23XX_GPIO_PIN_11
60#define INTD_PIN IXP23XX_GPIO_PIN_12
61
62static int __init roadrunner_map_irq(struct pci_dev *dev, u8 idsel, u8 pin)
63{
64 static int pci_card_slot_irq[] = {INTB, INTC, INTD, INTA};
65 static int pmc_card_slot_irq[] = {INTA, INTB, INTC, INTD};
66 static int usb_irq[] = {INTB, INTC, INTD, -1};
67 static int mini_pci_1_irq[] = {INTB, INTC, -1, -1};
68 static int mini_pci_2_irq[] = {INTC, INTD, -1, -1};
69
70 switch(dev->bus->number) {
71 case 0:
72 switch(dev->devfn) {
73 case 0x0: // PCI-PCI bridge
74 break;
75 case 0x8: // PCI Card Slot
76 return pci_card_slot_irq[pin - 1];
77 case 0x10: // PMC Slot
78 return pmc_card_slot_irq[pin - 1];
79 case 0x18: // PMC Slot Secondary Agent
80 break;
81 case 0x20: // IXP Processor
82 break;
83 default:
84 return NO_IRQ;
85 }
86 break;
87
88 case 1:
89 switch(dev->devfn) {
90 case 0x0: // IDE Controller
91 return (pin == 1) ? INTC : -1;
92 case 0x8: // USB fun 0
93 case 0x9: // USB fun 1
94 case 0xa: // USB fun 2
95 return usb_irq[pin - 1];
96 case 0x10: // Mini PCI 1
97 return mini_pci_1_irq[pin-1];
98 case 0x18: // Mini PCI 2
99 return mini_pci_2_irq[pin-1];
100 case 0x20: // MEM slot
101 return (pin == 1) ? INTA : -1;
102 default:
103 return NO_IRQ;
104 }
105 break;
106
107 default:
108 return NO_IRQ;
109 }
110
111 return NO_IRQ;
112}
113
114static void roadrunner_pci_preinit(void)
115{
116 set_irq_type(IRQ_ROADRUNNER_PCI_INTC, IRQT_LOW);
117 set_irq_type(IRQ_ROADRUNNER_PCI_INTD, IRQT_LOW);
118
119 ixp23xx_pci_preinit();
120}
121
122static struct hw_pci roadrunner_pci __initdata = {
123 .nr_controllers = 1,
124 .preinit = roadrunner_pci_preinit,
125 .setup = ixp23xx_pci_setup,
126 .scan = ixp23xx_pci_scan_bus,
127 .map_irq = roadrunner_map_irq,
128};
129
130static int __init roadrunner_pci_init(void)
131{
132 if (machine_is_roadrunner())
133 pci_common_init(&roadrunner_pci);
134
135 return 0;
136};
137
138subsys_initcall(roadrunner_pci_init);
139
140static void __init roadrunner_init(void)
141{
142 physmap_configure(0x90000000, 0x04000000, 2, NULL);
143
144 /*
145 * Mark flash as writeable
146 */
147 IXP23XX_EXP_CS0[0] |= IXP23XX_FLASH_WRITABLE;
148 IXP23XX_EXP_CS0[1] |= IXP23XX_FLASH_WRITABLE;
149 IXP23XX_EXP_CS0[2] |= IXP23XX_FLASH_WRITABLE;
150 IXP23XX_EXP_CS0[3] |= IXP23XX_FLASH_WRITABLE;
151
152 ixp23xx_sys_init();
153}
154
155MACHINE_START(ROADRUNNER, "ADI Engineering RoadRunner Development Platform")
156 /* Maintainer: Deepak Saxena */
157 .phys_io = IXP23XX_PERIPHERAL_PHYS,
158 .io_pg_offst = ((IXP23XX_PERIPHERAL_VIRT >> 18)) & 0xfffc,
159 .map_io = ixp23xx_map_io,
160 .init_irq = ixp23xx_init_irq,
161 .timer = &ixp23xx_timer,
162 .boot_params = 0x00000100,
163 .init_machine = roadrunner_init,
164MACHINE_END
diff --git a/arch/arm/mach-ixp4xx/common-pci.c b/arch/arm/mach-ixp4xx/common-pci.c
index 6e3462ed5306..2d40fe1145f0 100644
--- a/arch/arm/mach-ixp4xx/common-pci.c
+++ b/arch/arm/mach-ixp4xx/common-pci.c
@@ -463,7 +463,7 @@ int ixp4xx_setup(int nr, struct pci_sys_data *sys)
463 if (nr >= 1) 463 if (nr >= 1)
464 return 0; 464 return 0;
465 465
466 res = kmalloc(sizeof(*res) * 2, GFP_KERNEL); 466 res = kzalloc(sizeof(*res) * 2, GFP_KERNEL);
467 if (res == NULL) { 467 if (res == NULL) {
468 /* 468 /*
469 * If we're out of memory this early, something is wrong, 469 * If we're out of memory this early, something is wrong,
@@ -471,7 +471,6 @@ int ixp4xx_setup(int nr, struct pci_sys_data *sys)
471 */ 471 */
472 panic("PCI: unable to allocate resources?\n"); 472 panic("PCI: unable to allocate resources?\n");
473 } 473 }
474 memset(res, 0, sizeof(*res) * 2);
475 474
476 local_write_config(PCI_COMMAND, 2, PCI_COMMAND_MASTER | PCI_COMMAND_MEMORY); 475 local_write_config(PCI_COMMAND, 2, PCI_COMMAND_MASTER | PCI_COMMAND_MEMORY);
477 476
diff --git a/arch/arm/mach-ixp4xx/common.c b/arch/arm/mach-ixp4xx/common.c
index fbadf3021b9e..a0888e160e3b 100644
--- a/arch/arm/mach-ixp4xx/common.c
+++ b/arch/arm/mach-ixp4xx/common.c
@@ -91,7 +91,7 @@ static void ixp4xx_config_irq(unsigned irq, enum ixp4xx_irq_type type);
91/* 91/*
92 * IRQ -> GPIO mapping table 92 * IRQ -> GPIO mapping table
93 */ 93 */
94static int irq2gpio[32] = { 94static char irq2gpio[32] = {
95 -1, -1, -1, -1, -1, -1, 0, 1, 95 -1, -1, -1, -1, -1, -1, 0, 1,
96 -1, -1, -1, -1, -1, -1, -1, -1, 96 -1, -1, -1, -1, -1, -1, -1, -1,
97 -1, -1, -1, 2, 3, 4, 5, 6, 97 -1, -1, -1, 2, 3, 4, 5, 6,
@@ -153,6 +153,9 @@ static int ixp4xx_set_irq_type(unsigned int irq, unsigned int type)
153 /* Set the new style */ 153 /* Set the new style */
154 *int_reg |= (int_style << (line * IXP4XX_GPIO_STYLE_SIZE)); 154 *int_reg |= (int_style << (line * IXP4XX_GPIO_STYLE_SIZE));
155 155
156 /* Configure the line as an input */
157 gpio_line_config(line, IXP4XX_GPIO_IN);
158
156 return 0; 159 return 0;
157} 160}
158 161
diff --git a/arch/arm/mach-lh7a40x/common.h b/arch/arm/mach-lh7a40x/common.h
index 578a52461fdb..ea8de7e3ab1b 100644
--- a/arch/arm/mach-lh7a40x/common.h
+++ b/arch/arm/mach-lh7a40x/common.h
@@ -12,5 +12,6 @@ extern struct sys_timer lh7a40x_timer;
12 12
13extern void lh7a400_init_irq (void); 13extern void lh7a400_init_irq (void);
14extern void lh7a404_init_irq (void); 14extern void lh7a404_init_irq (void);
15extern void lh7a40x_init_board_irq (void);
15 16
16#define IRQ_DISPATCH(irq) desc_handle_irq((irq),(irq_desc + irq), regs) 17#define IRQ_DISPATCH(irq) desc_handle_irq((irq),(irq_desc + irq), regs)
diff --git a/arch/arm/mach-lh7a40x/irq-kev7a400.c b/arch/arm/mach-lh7a40x/irq-kev7a400.c
index 691bb09232a5..8535764d89ca 100644
--- a/arch/arm/mach-lh7a40x/irq-kev7a400.c
+++ b/arch/arm/mach-lh7a40x/irq-kev7a400.c
@@ -16,6 +16,7 @@
16#include <asm/mach/hardware.h> 16#include <asm/mach/hardware.h>
17#include <asm/mach/irqs.h> 17#include <asm/mach/irqs.h>
18 18
19#include "common.h"
19 20
20 /* KEV7a400 CPLD IRQ handling */ 21 /* KEV7a400 CPLD IRQ handling */
21 22
diff --git a/arch/arm/mach-lh7a40x/irq-lh7a400.c b/arch/arm/mach-lh7a40x/irq-lh7a400.c
index f334d81c2cd8..f9fdefef6d6f 100644
--- a/arch/arm/mach-lh7a40x/irq-lh7a400.c
+++ b/arch/arm/mach-lh7a40x/irq-lh7a400.c
@@ -16,9 +16,9 @@
16#include <asm/hardware.h> 16#include <asm/hardware.h>
17#include <asm/irq.h> 17#include <asm/irq.h>
18#include <asm/mach/irq.h> 18#include <asm/mach/irq.h>
19#include <asm/arch/irq.h>
20#include <asm/arch/irqs.h> 19#include <asm/arch/irqs.h>
21 20
21#include "common.h"
22 22
23 /* CPU IRQ handling */ 23 /* CPU IRQ handling */
24 24
diff --git a/arch/arm/mach-lh7a40x/irq-lh7a404.c b/arch/arm/mach-lh7a40x/irq-lh7a404.c
index 122fadabc97d..e902e3d87da4 100644
--- a/arch/arm/mach-lh7a40x/irq-lh7a404.c
+++ b/arch/arm/mach-lh7a40x/irq-lh7a404.c
@@ -16,9 +16,10 @@
16#include <asm/hardware.h> 16#include <asm/hardware.h>
17#include <asm/irq.h> 17#include <asm/irq.h>
18#include <asm/mach/irq.h> 18#include <asm/mach/irq.h>
19#include <asm/arch/irq.h>
20#include <asm/arch/irqs.h> 19#include <asm/arch/irqs.h>
21 20
21#include "common.h"
22
22#define USE_PRIORITIES 23#define USE_PRIORITIES
23 24
24/* See Documentation/arm/Sharp-LH/VectoredInterruptController for more 25/* See Documentation/arm/Sharp-LH/VectoredInterruptController for more
diff --git a/arch/arm/mach-lh7a40x/irq-lpd7a40x.c b/arch/arm/mach-lh7a40x/irq-lpd7a40x.c
index 6262d449120c..dcb4e17b9419 100644
--- a/arch/arm/mach-lh7a40x/irq-lpd7a40x.c
+++ b/arch/arm/mach-lh7a40x/irq-lpd7a40x.c
@@ -19,6 +19,7 @@
19#include <asm/mach/irq.h> 19#include <asm/mach/irq.h>
20#include <asm/arch/irqs.h> 20#include <asm/arch/irqs.h>
21 21
22#include "common.h"
22 23
23static void lh7a40x_ack_cpld_irq (u32 irq) 24static void lh7a40x_ack_cpld_irq (u32 irq)
24{ 25{
diff --git a/arch/arm/mach-omap1/board-netstar.c b/arch/arm/mach-omap1/board-netstar.c
index 60d5f8a3339c..7520e602d7a2 100644
--- a/arch/arm/mach-omap1/board-netstar.c
+++ b/arch/arm/mach-omap1/board-netstar.c
@@ -141,7 +141,7 @@ static int __init netstar_late_init(void)
141 /* TODO: Setup front panel switch here */ 141 /* TODO: Setup front panel switch here */
142 142
143 /* Setup panic notifier */ 143 /* Setup panic notifier */
144 notifier_chain_register(&panic_notifier_list, &panic_block); 144 atomic_notifier_chain_register(&panic_notifier_list, &panic_block);
145 145
146 return 0; 146 return 0;
147} 147}
diff --git a/arch/arm/mach-omap1/board-voiceblue.c b/arch/arm/mach-omap1/board-voiceblue.c
index bfd5fdd1a875..52e4a9d69642 100644
--- a/arch/arm/mach-omap1/board-voiceblue.c
+++ b/arch/arm/mach-omap1/board-voiceblue.c
@@ -235,7 +235,7 @@ static struct notifier_block panic_block = {
235static int __init voiceblue_setup(void) 235static int __init voiceblue_setup(void)
236{ 236{
237 /* Setup panic notifier */ 237 /* Setup panic notifier */
238 notifier_chain_register(&panic_notifier_list, &panic_block); 238 atomic_notifier_chain_register(&panic_notifier_list, &panic_block);
239 239
240 return 0; 240 return 0;
241} 241}
diff --git a/arch/arm/mach-omap2/serial.c b/arch/arm/mach-omap2/serial.c
index 24dd374224af..0884bc7c23b7 100644
--- a/arch/arm/mach-omap2/serial.c
+++ b/arch/arm/mach-omap2/serial.c
@@ -167,7 +167,7 @@ void __init omap_serial_init()
167 167
168static struct platform_device serial_device = { 168static struct platform_device serial_device = {
169 .name = "serial8250", 169 .name = "serial8250",
170 .id = 0, 170 .id = PLAT8250_DEV_PLATFORM,
171 .dev = { 171 .dev = {
172 .platform_data = serial_platform_data, 172 .platform_data = serial_platform_data,
173 }, 173 },
diff --git a/arch/arm/mach-pxa/Kconfig b/arch/arm/mach-pxa/Kconfig
index c1d77f5b3823..0104fd142e70 100644
--- a/arch/arm/mach-pxa/Kconfig
+++ b/arch/arm/mach-pxa/Kconfig
@@ -10,6 +10,11 @@ config ARCH_LUBBOCK
10 select PXA25x 10 select PXA25x
11 select SA1111 11 select SA1111
12 12
13config MACH_LOGICPD_PXA270
14 bool "LogicPD PXA270 Card Engine Development Platform"
15 select PXA27x
16 select IWMMXT
17
13config MACH_MAINSTONE 18config MACH_MAINSTONE
14 bool "Intel HCDDBBVA0 Development Platform" 19 bool "Intel HCDDBBVA0 Development Platform"
15 select PXA27x 20 select PXA27x
diff --git a/arch/arm/mach-pxa/Makefile b/arch/arm/mach-pxa/Makefile
index 32526a0a6f86..4e8a983e2b83 100644
--- a/arch/arm/mach-pxa/Makefile
+++ b/arch/arm/mach-pxa/Makefile
@@ -3,12 +3,13 @@
3# 3#
4 4
5# Common support (must be linked before board specific support) 5# Common support (must be linked before board specific support)
6obj-y += generic.o irq.o dma.o time.o 6obj-y += clock.o generic.o irq.o dma.o time.o
7obj-$(CONFIG_PXA25x) += pxa25x.o 7obj-$(CONFIG_PXA25x) += pxa25x.o
8obj-$(CONFIG_PXA27x) += pxa27x.o 8obj-$(CONFIG_PXA27x) += pxa27x.o
9 9
10# Specific board support 10# Specific board support
11obj-$(CONFIG_ARCH_LUBBOCK) += lubbock.o 11obj-$(CONFIG_ARCH_LUBBOCK) += lubbock.o
12obj-$(CONFIG_MACH_LOGICPD_PXA270) += lpd270.o
12obj-$(CONFIG_MACH_MAINSTONE) += mainstone.o 13obj-$(CONFIG_MACH_MAINSTONE) += mainstone.o
13obj-$(CONFIG_ARCH_PXA_IDP) += idp.o 14obj-$(CONFIG_ARCH_PXA_IDP) += idp.o
14obj-$(CONFIG_PXA_SHARP_C7xx) += corgi.o corgi_ssp.o corgi_lcd.o sharpsl_pm.o corgi_pm.o 15obj-$(CONFIG_PXA_SHARP_C7xx) += corgi.o corgi_ssp.o corgi_lcd.o sharpsl_pm.o corgi_pm.o
diff --git a/arch/arm/mach-pxa/clock.c b/arch/arm/mach-pxa/clock.c
new file mode 100644
index 000000000000..8f7c90a0593b
--- /dev/null
+++ b/arch/arm/mach-pxa/clock.c
@@ -0,0 +1,124 @@
1/*
2 * linux/arch/arm/mach-sa1100/clock.c
3 */
4#include <linux/module.h>
5#include <linux/kernel.h>
6#include <linux/list.h>
7#include <linux/errno.h>
8#include <linux/err.h>
9#include <linux/string.h>
10#include <linux/clk.h>
11#include <linux/spinlock.h>
12
13#include <asm/arch/pxa-regs.h>
14#include <asm/hardware.h>
15#include <asm/semaphore.h>
16
17struct clk {
18 struct list_head node;
19 unsigned long rate;
20 struct module *owner;
21 const char *name;
22 unsigned int enabled;
23 void (*enable)(void);
24 void (*disable)(void);
25};
26
27static LIST_HEAD(clocks);
28static DECLARE_MUTEX(clocks_sem);
29static DEFINE_SPINLOCK(clocks_lock);
30
31struct clk *clk_get(struct device *dev, const char *id)
32{
33 struct clk *p, *clk = ERR_PTR(-ENOENT);
34
35 down(&clocks_sem);
36 list_for_each_entry(p, &clocks, node) {
37 if (strcmp(id, p->name) == 0 && try_module_get(p->owner)) {
38 clk = p;
39 break;
40 }
41 }
42 up(&clocks_sem);
43
44 return clk;
45}
46EXPORT_SYMBOL(clk_get);
47
48void clk_put(struct clk *clk)
49{
50 module_put(clk->owner);
51}
52EXPORT_SYMBOL(clk_put);
53
54int clk_enable(struct clk *clk)
55{
56 unsigned long flags;
57
58 spin_lock_irqsave(&clocks_lock, flags);
59 if (clk->enabled++ == 0)
60 clk->enable();
61 spin_unlock_irqrestore(&clocks_lock, flags);
62 return 0;
63}
64EXPORT_SYMBOL(clk_enable);
65
66void clk_disable(struct clk *clk)
67{
68 unsigned long flags;
69
70 WARN_ON(clk->enabled == 0);
71
72 spin_lock_irqsave(&clocks_lock, flags);
73 if (--clk->enabled == 0)
74 clk->disable();
75 spin_unlock_irqrestore(&clocks_lock, flags);
76}
77EXPORT_SYMBOL(clk_disable);
78
79unsigned long clk_get_rate(struct clk *clk)
80{
81 return clk->rate;
82}
83EXPORT_SYMBOL(clk_get_rate);
84
85
86static void clk_gpio27_enable(void)
87{
88 pxa_gpio_mode(GPIO11_3_6MHz_MD);
89}
90
91static void clk_gpio27_disable(void)
92{
93}
94
95static struct clk clk_gpio27 = {
96 .name = "GPIO27_CLK",
97 .rate = 3686400,
98 .enable = clk_gpio27_enable,
99 .disable = clk_gpio27_disable,
100};
101
102int clk_register(struct clk *clk)
103{
104 down(&clocks_sem);
105 list_add(&clk->node, &clocks);
106 up(&clocks_sem);
107 return 0;
108}
109EXPORT_SYMBOL(clk_register);
110
111void clk_unregister(struct clk *clk)
112{
113 down(&clocks_sem);
114 list_del(&clk->node);
115 up(&clocks_sem);
116}
117EXPORT_SYMBOL(clk_unregister);
118
119static int __init clk_init(void)
120{
121 clk_register(&clk_gpio27);
122 return 0;
123}
124arch_initcall(clk_init);
diff --git a/arch/arm/mach-pxa/corgi.c b/arch/arm/mach-pxa/corgi.c
index 7ffd2de8f2f3..d6d726036361 100644
--- a/arch/arm/mach-pxa/corgi.c
+++ b/arch/arm/mach-pxa/corgi.c
@@ -32,7 +32,6 @@
32#include <asm/mach/irq.h> 32#include <asm/mach/irq.h>
33 33
34#include <asm/arch/pxa-regs.h> 34#include <asm/arch/pxa-regs.h>
35#include <asm/arch/irq.h>
36#include <asm/arch/irda.h> 35#include <asm/arch/irda.h>
37#include <asm/arch/mmc.h> 36#include <asm/arch/mmc.h>
38#include <asm/arch/udc.h> 37#include <asm/arch/udc.h>
@@ -142,6 +141,8 @@ struct corgissp_machinfo corgi_ssp_machinfo = {
142 */ 141 */
143static struct corgibl_machinfo corgi_bl_machinfo = { 142static struct corgibl_machinfo corgi_bl_machinfo = {
144 .max_intensity = 0x2f, 143 .max_intensity = 0x2f,
144 .default_intensity = 0x1f,
145 .limit_mask = 0x0b,
145 .set_bl_intensity = corgi_bl_set_intensity, 146 .set_bl_intensity = corgi_bl_set_intensity,
146}; 147};
147 148
@@ -165,6 +166,14 @@ static struct platform_device corgikbd_device = {
165 166
166 167
167/* 168/*
169 * Corgi LEDs
170 */
171static struct platform_device corgiled_device = {
172 .name = "corgi-led",
173 .id = -1,
174};
175
176/*
168 * Corgi Touch Screen Device 177 * Corgi Touch Screen Device
169 */ 178 */
170static struct resource corgits_resources[] = { 179static struct resource corgits_resources[] = {
@@ -298,6 +307,7 @@ static struct platform_device *devices[] __initdata = {
298 &corgikbd_device, 307 &corgikbd_device,
299 &corgibl_device, 308 &corgibl_device,
300 &corgits_device, 309 &corgits_device,
310 &corgiled_device,
301}; 311};
302 312
303static void __init corgi_init(void) 313static void __init corgi_init(void)
diff --git a/arch/arm/mach-pxa/generic.c b/arch/arm/mach-pxa/generic.c
index 9b48a90aefce..5efa84749f37 100644
--- a/arch/arm/mach-pxa/generic.c
+++ b/arch/arm/mach-pxa/generic.c
@@ -319,6 +319,11 @@ void __init pxa_set_ficp_info(struct pxaficp_platform_data *info)
319 pxaficp_device.dev.platform_data = info; 319 pxaficp_device.dev.platform_data = info;
320} 320}
321 321
322static struct platform_device pxartc_device = {
323 .name = "sa1100-rtc",
324 .id = -1,
325};
326
322static struct platform_device *devices[] __initdata = { 327static struct platform_device *devices[] __initdata = {
323 &pxamci_device, 328 &pxamci_device,
324 &udc_device, 329 &udc_device,
@@ -329,6 +334,7 @@ static struct platform_device *devices[] __initdata = {
329 &pxaficp_device, 334 &pxaficp_device,
330 &i2c_device, 335 &i2c_device,
331 &i2s_device, 336 &i2s_device,
337 &pxartc_device,
332}; 338};
333 339
334static int __init pxa_init(void) 340static int __init pxa_init(void)
diff --git a/arch/arm/mach-pxa/leds-mainstone.c b/arch/arm/mach-pxa/leds-mainstone.c
index bbd3f87a9fc2..c06d3d7a8dd4 100644
--- a/arch/arm/mach-pxa/leds-mainstone.c
+++ b/arch/arm/mach-pxa/leds-mainstone.c
@@ -85,7 +85,7 @@ void mainstone_leds_event(led_event_t evt)
85 break; 85 break;
86 86
87 case led_green_on: 87 case led_green_on:
88 hw_led_state |= D21;; 88 hw_led_state |= D21;
89 break; 89 break;
90 90
91 case led_green_off: 91 case led_green_off:
@@ -93,7 +93,7 @@ void mainstone_leds_event(led_event_t evt)
93 break; 93 break;
94 94
95 case led_amber_on: 95 case led_amber_on:
96 hw_led_state |= D22;; 96 hw_led_state |= D22;
97 break; 97 break;
98 98
99 case led_amber_off: 99 case led_amber_off:
@@ -101,7 +101,7 @@ void mainstone_leds_event(led_event_t evt)
101 break; 101 break;
102 102
103 case led_red_on: 103 case led_red_on:
104 hw_led_state |= D23;; 104 hw_led_state |= D23;
105 break; 105 break;
106 106
107 case led_red_off: 107 case led_red_off:
diff --git a/arch/arm/mach-pxa/lpd270.c b/arch/arm/mach-pxa/lpd270.c
new file mode 100644
index 000000000000..ec0f43a102c7
--- /dev/null
+++ b/arch/arm/mach-pxa/lpd270.c
@@ -0,0 +1,393 @@
1/*
2 * linux/arch/arm/mach-pxa/lpd270.c
3 *
4 * Support for the LogicPD PXA270 Card Engine.
5 * Derived from the mainstone code, which carries these notices:
6 *
7 * Author: Nicolas Pitre
8 * Created: Nov 05, 2002
9 * Copyright: MontaVista Software Inc.
10 *
11 * This program is free software; you can redistribute it and/or modify
12 * it under the terms of the GNU General Public License version 2 as
13 * published by the Free Software Foundation.
14 */
15
16#include <linux/init.h>
17#include <linux/platform_device.h>
18#include <linux/sysdev.h>
19#include <linux/interrupt.h>
20#include <linux/sched.h>
21#include <linux/bitops.h>
22#include <linux/fb.h>
23#include <linux/ioport.h>
24#include <linux/mtd/mtd.h>
25#include <linux/mtd/partitions.h>
26
27#include <asm/types.h>
28#include <asm/setup.h>
29#include <asm/memory.h>
30#include <asm/mach-types.h>
31#include <asm/hardware.h>
32#include <asm/irq.h>
33#include <asm/sizes.h>
34
35#include <asm/mach/arch.h>
36#include <asm/mach/map.h>
37#include <asm/mach/irq.h>
38#include <asm/mach/flash.h>
39
40#include <asm/arch/pxa-regs.h>
41#include <asm/arch/lpd270.h>
42#include <asm/arch/audio.h>
43#include <asm/arch/pxafb.h>
44#include <asm/arch/mmc.h>
45#include <asm/arch/irda.h>
46#include <asm/arch/ohci.h>
47
48#include "generic.h"
49
50
51static unsigned int lpd270_irq_enabled;
52
53static void lpd270_mask_irq(unsigned int irq)
54{
55 int lpd270_irq = irq - LPD270_IRQ(0);
56
57 __raw_writew(~(1 << lpd270_irq), LPD270_INT_STATUS);
58
59 lpd270_irq_enabled &= ~(1 << lpd270_irq);
60 __raw_writew(lpd270_irq_enabled, LPD270_INT_MASK);
61}
62
63static void lpd270_unmask_irq(unsigned int irq)
64{
65 int lpd270_irq = irq - LPD270_IRQ(0);
66
67 lpd270_irq_enabled |= 1 << lpd270_irq;
68 __raw_writew(lpd270_irq_enabled, LPD270_INT_MASK);
69}
70
71static struct irqchip lpd270_irq_chip = {
72 .ack = lpd270_mask_irq,
73 .mask = lpd270_mask_irq,
74 .unmask = lpd270_unmask_irq,
75};
76
77static void lpd270_irq_handler(unsigned int irq, struct irqdesc *desc,
78 struct pt_regs *regs)
79{
80 unsigned long pending;
81
82 pending = __raw_readw(LPD270_INT_STATUS) & lpd270_irq_enabled;
83 do {
84 GEDR(0) = GPIO_bit(0); /* clear useless edge notification */
85 if (likely(pending)) {
86 irq = LPD270_IRQ(0) + __ffs(pending);
87 desc = irq_desc + irq;
88 desc_handle_irq(irq, desc, regs);
89
90 pending = __raw_readw(LPD270_INT_STATUS) &
91 lpd270_irq_enabled;
92 }
93 } while (pending);
94}
95
96static void __init lpd270_init_irq(void)
97{
98 int irq;
99
100 pxa_init_irq();
101
102 __raw_writew(0, LPD270_INT_MASK);
103 __raw_writew(0, LPD270_INT_STATUS);
104
105 /* setup extra LogicPD PXA270 irqs */
106 for (irq = LPD270_IRQ(2); irq <= LPD270_IRQ(4); irq++) {
107 set_irq_chip(irq, &lpd270_irq_chip);
108 set_irq_handler(irq, do_level_IRQ);
109 set_irq_flags(irq, IRQF_VALID | IRQF_PROBE);
110 }
111 set_irq_chained_handler(IRQ_GPIO(0), lpd270_irq_handler);
112 set_irq_type(IRQ_GPIO(0), IRQT_FALLING);
113}
114
115
116#ifdef CONFIG_PM
117static int lpd270_irq_resume(struct sys_device *dev)
118{
119 __raw_writew(lpd270_irq_enabled, LPD270_INT_MASK);
120 return 0;
121}
122
123static struct sysdev_class lpd270_irq_sysclass = {
124 set_kset_name("cpld_irq"),
125 .resume = lpd270_irq_resume,
126};
127
128static struct sys_device lpd270_irq_device = {
129 .cls = &lpd270_irq_sysclass,
130};
131
132static int __init lpd270_irq_device_init(void)
133{
134 int ret = sysdev_class_register(&lpd270_irq_sysclass);
135 if (ret == 0)
136 ret = sysdev_register(&lpd270_irq_device);
137 return ret;
138}
139
140device_initcall(lpd270_irq_device_init);
141#endif
142
143
144static struct resource smc91x_resources[] = {
145 [0] = {
146 .start = LPD270_ETH_PHYS,
147 .end = (LPD270_ETH_PHYS + 0xfffff),
148 .flags = IORESOURCE_MEM,
149 },
150 [1] = {
151 .start = LPD270_ETHERNET_IRQ,
152 .end = LPD270_ETHERNET_IRQ,
153 .flags = IORESOURCE_IRQ,
154 },
155};
156
157static struct platform_device smc91x_device = {
158 .name = "smc91x",
159 .id = 0,
160 .num_resources = ARRAY_SIZE(smc91x_resources),
161 .resource = smc91x_resources,
162};
163
164static struct platform_device lpd270_audio_device = {
165 .name = "pxa2xx-ac97",
166 .id = -1,
167};
168
169static struct resource lpd270_flash_resources[] = {
170 [0] = {
171 .start = PXA_CS0_PHYS,
172 .end = PXA_CS0_PHYS + SZ_64M - 1,
173 .flags = IORESOURCE_MEM,
174 },
175 [1] = {
176 .start = PXA_CS1_PHYS,
177 .end = PXA_CS1_PHYS + SZ_64M - 1,
178 .flags = IORESOURCE_MEM,
179 },
180};
181
182static struct mtd_partition lpd270_flash0_partitions[] = {
183 {
184 .name = "Bootloader",
185 .size = 0x00040000,
186 .offset = 0,
187 .mask_flags = MTD_WRITEABLE /* force read-only */
188 }, {
189 .name = "Kernel",
190 .size = 0x00400000,
191 .offset = 0x00040000,
192 }, {
193 .name = "Filesystem",
194 .size = MTDPART_SIZ_FULL,
195 .offset = 0x00440000
196 },
197};
198
199static struct flash_platform_data lpd270_flash_data[2] = {
200 {
201 .name = "processor-flash",
202 .map_name = "cfi_probe",
203 .parts = lpd270_flash0_partitions,
204 .nr_parts = ARRAY_SIZE(lpd270_flash0_partitions),
205 }, {
206 .name = "mainboard-flash",
207 .map_name = "cfi_probe",
208 .parts = NULL,
209 .nr_parts = 0,
210 }
211};
212
213static struct platform_device lpd270_flash_device[2] = {
214 {
215 .name = "pxa2xx-flash",
216 .id = 0,
217 .dev = {
218 .platform_data = &lpd270_flash_data[0],
219 },
220 .resource = &lpd270_flash_resources[0],
221 .num_resources = 1,
222 }, {
223 .name = "pxa2xx-flash",
224 .id = 1,
225 .dev = {
226 .platform_data = &lpd270_flash_data[1],
227 },
228 .resource = &lpd270_flash_resources[1],
229 .num_resources = 1,
230 },
231};
232
233static void lpd270_backlight_power(int on)
234{
235 if (on) {
236 pxa_gpio_mode(GPIO16_PWM0_MD);
237 pxa_set_cken(CKEN0_PWM0, 1);
238 PWM_CTRL0 = 0;
239 PWM_PWDUTY0 = 0x3ff;
240 PWM_PERVAL0 = 0x3ff;
241 } else {
242 PWM_CTRL0 = 0;
243 PWM_PWDUTY0 = 0x0;
244 PWM_PERVAL0 = 0x3FF;
245 pxa_set_cken(CKEN0_PWM0, 0);
246 }
247}
248
249/* 5.7" TFT QVGA (LoLo display number 1) */
250static struct pxafb_mach_info sharp_lq057q3dc02 __initdata = {
251 .pixclock = 100000,
252 .xres = 240,
253 .yres = 320,
254 .bpp = 16,
255 .hsync_len = 64,
256 .left_margin = 0x27,
257 .right_margin = 0x09,
258 .vsync_len = 0x04,
259 .upper_margin = 0x08,
260 .lower_margin = 0x14,
261 .sync = 0,
262 .lccr0 = 0x07800080,
263 .lccr3 = 0x04400007,
264 .pxafb_backlight_power = lpd270_backlight_power,
265};
266
267/* 6.4" TFT VGA (LoLo display number 5) */
268static struct pxafb_mach_info sharp_lq64d343 __initdata = {
269 .pixclock = 20000,
270 .xres = 640,
271 .yres = 480,
272 .bpp = 16,
273 .hsync_len = 49,
274 .left_margin = 0x89,
275 .right_margin = 0x19,
276 .vsync_len = 18,
277 .upper_margin = 0x22,
278 .lower_margin = 0,
279 .sync = FB_SYNC_HOR_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT,
280 .lccr0 = 0x07800080,
281 .lccr3 = 0x04400001,
282 .pxafb_backlight_power = lpd270_backlight_power,
283};
284
285/* 3.5" TFT QVGA (LoLo display number 8) */
286static struct pxafb_mach_info sharp_lq035q7db02_20 __initdata = {
287 .pixclock = 100000,
288 .xres = 240,
289 .yres = 320,
290 .bpp = 16,
291 .hsync_len = 0x34,
292 .left_margin = 0x09,
293 .right_margin = 0x09,
294 .vsync_len = 0x08,
295 .upper_margin = 0x05,
296 .lower_margin = 0x14,
297 .sync = 0,
298 .lccr0 = 0x07800080,
299 .lccr3 = 0x04400007,
300 .pxafb_backlight_power = lpd270_backlight_power,
301};
302
303static struct platform_device *platform_devices[] __initdata = {
304 &smc91x_device,
305 &lpd270_audio_device,
306 &lpd270_flash_device[0],
307 &lpd270_flash_device[1],
308};
309
310static int lpd270_ohci_init(struct device *dev)
311{
312 /* setup Port1 GPIO pin. */
313 pxa_gpio_mode(88 | GPIO_ALT_FN_1_IN); /* USBHPWR1 */
314 pxa_gpio_mode(89 | GPIO_ALT_FN_2_OUT); /* USBHPEN1 */
315
316 /* Set the Power Control Polarity Low and Power Sense
317 Polarity Low to active low. */
318 UHCHR = (UHCHR | UHCHR_PCPL | UHCHR_PSPL) &
319 ~(UHCHR_SSEP1 | UHCHR_SSEP2 | UHCHR_SSEP3 | UHCHR_SSE);
320
321 return 0;
322}
323
324static struct pxaohci_platform_data lpd270_ohci_platform_data = {
325 .port_mode = PMM_PERPORT_MODE,
326 .init = lpd270_ohci_init,
327};
328
329static void __init lpd270_init(void)
330{
331 lpd270_flash_data[0].width = (BOOT_DEF & 1) ? 2 : 4;
332 lpd270_flash_data[1].width = 4;
333
334 /*
335 * System bus arbiter setting:
336 * - Core_Park
337 * - LCD_wt:DMA_wt:CORE_Wt = 2:3:4
338 */
339 ARB_CNTRL = ARB_CORE_PARK | 0x234;
340
341 /*
342 * On LogicPD PXA270, we route AC97_SYSCLK via GPIO45.
343 */
344 pxa_gpio_mode(GPIO45_SYSCLK_AC97_MD);
345
346 platform_add_devices(platform_devices, ARRAY_SIZE(platform_devices));
347
348 // set_pxa_fb_info(&sharp_lq057q3dc02);
349 set_pxa_fb_info(&sharp_lq64d343);
350 // set_pxa_fb_info(&sharp_lq035q7db02_20);
351
352 pxa_set_ohci_info(&lpd270_ohci_platform_data);
353}
354
355
356static struct map_desc lpd270_io_desc[] __initdata = {
357 {
358 .virtual = LPD270_CPLD_VIRT,
359 .pfn = __phys_to_pfn(LPD270_CPLD_PHYS),
360 .length = LPD270_CPLD_SIZE,
361 .type = MT_DEVICE,
362 },
363};
364
365static void __init lpd270_map_io(void)
366{
367 pxa_map_io();
368 iotable_init(lpd270_io_desc, ARRAY_SIZE(lpd270_io_desc));
369
370 /* initialize sleep mode regs (wake-up sources, etc) */
371 PGSR0 = 0x00008800;
372 PGSR1 = 0x00000002;
373 PGSR2 = 0x0001FC00;
374 PGSR3 = 0x00001F81;
375 PWER = 0xC0000002;
376 PRER = 0x00000002;
377 PFER = 0x00000002;
378
379 /* for use I SRAM as framebuffer. */
380 PSLR |= 0x00000F04;
381 PCFR = 0x00000066;
382}
383
384MACHINE_START(LOGICPD_PXA270, "LogicPD PXA270 Card Engine")
385 /* Maintainer: Peter Barada */
386 .phys_io = 0x40000000,
387 .io_pg_offst = (io_p2v(0x40000000) >> 18) & 0xfffc,
388 .boot_params = 0xa0000100,
389 .map_io = lpd270_map_io,
390 .init_irq = lpd270_init_irq,
391 .timer = &pxa_timer,
392 .init_machine = lpd270_init,
393MACHINE_END
diff --git a/arch/arm/mach-pxa/mainstone.c b/arch/arm/mach-pxa/mainstone.c
index d5bda60209ec..98356f810007 100644
--- a/arch/arm/mach-pxa/mainstone.c
+++ b/arch/arm/mach-pxa/mainstone.c
@@ -157,14 +157,14 @@ static struct platform_device smc91x_device = {
157 .resource = smc91x_resources, 157 .resource = smc91x_resources,
158}; 158};
159 159
160static int mst_audio_startup(snd_pcm_substream_t *substream, void *priv) 160static int mst_audio_startup(struct snd_pcm_substream *substream, void *priv)
161{ 161{
162 if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) 162 if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK)
163 MST_MSCWR2 &= ~MST_MSCWR2_AC97_SPKROFF; 163 MST_MSCWR2 &= ~MST_MSCWR2_AC97_SPKROFF;
164 return 0; 164 return 0;
165} 165}
166 166
167static void mst_audio_shutdown(snd_pcm_substream_t *substream, void *priv) 167static void mst_audio_shutdown(struct snd_pcm_substream *substream, void *priv)
168{ 168{
169 if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) 169 if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK)
170 MST_MSCWR2 |= MST_MSCWR2_AC97_SPKROFF; 170 MST_MSCWR2 |= MST_MSCWR2_AC97_SPKROFF;
diff --git a/arch/arm/mach-pxa/poodle.c b/arch/arm/mach-pxa/poodle.c
index 911e6ff5a9bd..b45560a8f6c4 100644
--- a/arch/arm/mach-pxa/poodle.c
+++ b/arch/arm/mach-pxa/poodle.c
@@ -29,7 +29,6 @@
29#include <asm/mach/irq.h> 29#include <asm/mach/irq.h>
30 30
31#include <asm/arch/pxa-regs.h> 31#include <asm/arch/pxa-regs.h>
32#include <asm/arch/irq.h>
33#include <asm/arch/mmc.h> 32#include <asm/arch/mmc.h>
34#include <asm/arch/udc.h> 33#include <asm/arch/udc.h>
35#include <asm/arch/irda.h> 34#include <asm/arch/irda.h>
diff --git a/arch/arm/mach-pxa/spitz.c b/arch/arm/mach-pxa/spitz.c
index c094d99ebf56..19b372df544a 100644
--- a/arch/arm/mach-pxa/spitz.c
+++ b/arch/arm/mach-pxa/spitz.c
@@ -33,7 +33,6 @@
33#include <asm/mach/irq.h> 33#include <asm/mach/irq.h>
34 34
35#include <asm/arch/pxa-regs.h> 35#include <asm/arch/pxa-regs.h>
36#include <asm/arch/irq.h>
37#include <asm/arch/irda.h> 36#include <asm/arch/irda.h>
38#include <asm/arch/mmc.h> 37#include <asm/arch/mmc.h>
39#include <asm/arch/ohci.h> 38#include <asm/arch/ohci.h>
@@ -221,6 +220,8 @@ struct corgissp_machinfo spitz_ssp_machinfo = {
221 * Spitz Backlight Device 220 * Spitz Backlight Device
222 */ 221 */
223static struct corgibl_machinfo spitz_bl_machinfo = { 222static struct corgibl_machinfo spitz_bl_machinfo = {
223 .default_intensity = 0x1f,
224 .limit_mask = 0x0b,
224 .max_intensity = 0x2f, 225 .max_intensity = 0x2f,
225}; 226};
226 227
@@ -243,6 +244,14 @@ static struct platform_device spitzkbd_device = {
243 244
244 245
245/* 246/*
247 * Spitz LEDs
248 */
249static struct platform_device spitzled_device = {
250 .name = "spitz-led",
251 .id = -1,
252};
253
254/*
246 * Spitz Touch Screen Device 255 * Spitz Touch Screen Device
247 */ 256 */
248static struct resource spitzts_resources[] = { 257static struct resource spitzts_resources[] = {
@@ -419,6 +428,7 @@ static struct platform_device *devices[] __initdata = {
419 &spitzkbd_device, 428 &spitzkbd_device,
420 &spitzts_device, 429 &spitzts_device,
421 &spitzbl_device, 430 &spitzbl_device,
431 &spitzled_device,
422}; 432};
423 433
424static void __init common_init(void) 434static void __init common_init(void)
@@ -468,6 +478,8 @@ struct platform_device akitaioexp_device = {
468 .id = -1, 478 .id = -1,
469}; 479};
470 480
481EXPORT_SYMBOL_GPL(akitaioexp_device);
482
471static void __init akita_init(void) 483static void __init akita_init(void)
472{ 484{
473 spitz_ficp_platform_data.transceiver_mode = akita_irda_transceiver_mode; 485 spitz_ficp_platform_data.transceiver_mode = akita_irda_transceiver_mode;
diff --git a/arch/arm/mach-pxa/tosa.c b/arch/arm/mach-pxa/tosa.c
index d168286ed470..76c0e7f0a219 100644
--- a/arch/arm/mach-pxa/tosa.c
+++ b/arch/arm/mach-pxa/tosa.c
@@ -34,7 +34,6 @@
34#include <asm/mach/irq.h> 34#include <asm/mach/irq.h>
35 35
36#include <asm/arch/pxa-regs.h> 36#include <asm/arch/pxa-regs.h>
37#include <asm/arch/irq.h>
38#include <asm/arch/tosa.h> 37#include <asm/arch/tosa.h>
39 38
40#include <asm/hardware/scoop.h> 39#include <asm/hardware/scoop.h>
@@ -252,10 +251,19 @@ static struct platform_device tosakbd_device = {
252 .id = -1, 251 .id = -1,
253}; 252};
254 253
254/*
255 * Tosa LEDs
256 */
257static struct platform_device tosaled_device = {
258 .name = "tosa-led",
259 .id = -1,
260};
261
255static struct platform_device *devices[] __initdata = { 262static struct platform_device *devices[] __initdata = {
256 &tosascoop_device, 263 &tosascoop_device,
257 &tosascoop_jc_device, 264 &tosascoop_jc_device,
258 &tosakbd_device, 265 &tosakbd_device,
266 &tosaled_device,
259}; 267};
260 268
261static void __init tosa_init(void) 269static void __init tosa_init(void)
diff --git a/arch/arm/mach-realview/core.c b/arch/arm/mach-realview/core.c
index 4303d988c4bf..d13270c5d7cd 100644
--- a/arch/arm/mach-realview/core.c
+++ b/arch/arm/mach-realview/core.c
@@ -202,11 +202,6 @@ struct clk realview_clcd_clk = {
202/* 202/*
203 * CLCD support. 203 * CLCD support.
204 */ 204 */
205#define SYS_CLCD_MODE_MASK (3 << 0)
206#define SYS_CLCD_MODE_888 (0 << 0)
207#define SYS_CLCD_MODE_5551 (1 << 0)
208#define SYS_CLCD_MODE_565_RLSB (2 << 0)
209#define SYS_CLCD_MODE_565_BLSB (3 << 0)
210#define SYS_CLCD_NLCDIOON (1 << 2) 205#define SYS_CLCD_NLCDIOON (1 << 2)
211#define SYS_CLCD_VDDPOSSWITCH (1 << 3) 206#define SYS_CLCD_VDDPOSSWITCH (1 << 3)
212#define SYS_CLCD_PWR3V5SWITCH (1 << 4) 207#define SYS_CLCD_PWR3V5SWITCH (1 << 4)
@@ -360,29 +355,10 @@ static void realview_clcd_enable(struct clcd_fb *fb)
360 void __iomem *sys_clcd = __io_address(REALVIEW_SYS_BASE) + REALVIEW_SYS_CLCD_OFFSET; 355 void __iomem *sys_clcd = __io_address(REALVIEW_SYS_BASE) + REALVIEW_SYS_CLCD_OFFSET;
361 u32 val; 356 u32 val;
362 357
363 val = readl(sys_clcd);
364 val &= ~SYS_CLCD_MODE_MASK;
365
366 switch (fb->fb.var.green.length) {
367 case 5:
368 val |= SYS_CLCD_MODE_5551;
369 break;
370 case 6:
371 val |= SYS_CLCD_MODE_565_RLSB;
372 break;
373 case 8:
374 val |= SYS_CLCD_MODE_888;
375 break;
376 }
377
378 /*
379 * Set the MUX
380 */
381 writel(val, sys_clcd);
382
383 /* 358 /*
384 * And now enable the PSUs 359 * Enable the PSUs
385 */ 360 */
361 val = readl(sys_clcd);
386 val |= SYS_CLCD_NLCDIOON | SYS_CLCD_PWR3V5SWITCH; 362 val |= SYS_CLCD_NLCDIOON | SYS_CLCD_PWR3V5SWITCH;
387 writel(val, sys_clcd); 363 writel(val, sys_clcd);
388} 364}
diff --git a/arch/arm/mach-s3c2410/Kconfig b/arch/arm/mach-s3c2410/Kconfig
index 0b9d7ca49ec1..ed07c4149d82 100644
--- a/arch/arm/mach-s3c2410/Kconfig
+++ b/arch/arm/mach-s3c2410/Kconfig
@@ -9,6 +9,13 @@ config MACH_ANUBIS
9 Say Y gere if you are using the Simtec Electronics ANUBIS 9 Say Y gere if you are using the Simtec Electronics ANUBIS
10 development system 10 development system
11 11
12config MACH_OSIRIS
13 bool "Simtec IM2440D20 (OSIRIS) module"
14 select CPU_S3C2440
15 help
16 Say Y here if you are using the Simtec IM2440D20 module, also
17 known as the Osiris.
18
12config ARCH_BAST 19config ARCH_BAST
13 bool "Simtec Electronics BAST (EB2410ITX)" 20 bool "Simtec Electronics BAST (EB2410ITX)"
14 select CPU_S3C2410 21 select CPU_S3C2410
diff --git a/arch/arm/mach-s3c2410/Makefile b/arch/arm/mach-s3c2410/Makefile
index 1217bf00309c..1b3b476e5637 100644
--- a/arch/arm/mach-s3c2410/Makefile
+++ b/arch/arm/mach-s3c2410/Makefile
@@ -38,6 +38,7 @@ obj-$(CONFIG_BAST_PC104_IRQ) += bast-irq.o
38# machine specific support 38# machine specific support
39 39
40obj-$(CONFIG_MACH_ANUBIS) += mach-anubis.o 40obj-$(CONFIG_MACH_ANUBIS) += mach-anubis.o
41obj-$(CONFIG_MACH_OSIRIS) += mach-osiris.o
41obj-$(CONFIG_ARCH_BAST) += mach-bast.o usb-simtec.o 42obj-$(CONFIG_ARCH_BAST) += mach-bast.o usb-simtec.o
42obj-$(CONFIG_ARCH_H1940) += mach-h1940.o 43obj-$(CONFIG_ARCH_H1940) += mach-h1940.o
43obj-$(CONFIG_MACH_N30) += mach-n30.o 44obj-$(CONFIG_MACH_N30) += mach-n30.o
diff --git a/arch/arm/mach-s3c2410/clock.c b/arch/arm/mach-s3c2410/clock.c
index 08489efdaf06..fec02c92f95f 100644
--- a/arch/arm/mach-s3c2410/clock.c
+++ b/arch/arm/mach-s3c2410/clock.c
@@ -38,12 +38,14 @@
38#include <linux/ioport.h> 38#include <linux/ioport.h>
39#include <linux/clk.h> 39#include <linux/clk.h>
40#include <linux/mutex.h> 40#include <linux/mutex.h>
41#include <linux/delay.h>
41 42
42#include <asm/hardware.h> 43#include <asm/hardware.h>
43#include <asm/irq.h> 44#include <asm/irq.h>
44#include <asm/io.h> 45#include <asm/io.h>
45 46
46#include <asm/arch/regs-clock.h> 47#include <asm/arch/regs-clock.h>
48#include <asm/arch/regs-gpio.h>
47 49
48#include "clock.h" 50#include "clock.h"
49#include "cpu.h" 51#include "cpu.h"
@@ -51,7 +53,8 @@
51/* clock information */ 53/* clock information */
52 54
53static LIST_HEAD(clocks); 55static LIST_HEAD(clocks);
54static DEFINE_MUTEX(clocks_mutex); 56
57DEFINE_MUTEX(clocks_mutex);
55 58
56/* old functions */ 59/* old functions */
57 60
@@ -178,12 +181,24 @@ unsigned long clk_get_rate(struct clk *clk)
178 181
179long clk_round_rate(struct clk *clk, unsigned long rate) 182long clk_round_rate(struct clk *clk, unsigned long rate)
180{ 183{
184 if (!IS_ERR(clk) && clk->round_rate)
185 return (clk->round_rate)(clk, rate);
186
181 return rate; 187 return rate;
182} 188}
183 189
184int clk_set_rate(struct clk *clk, unsigned long rate) 190int clk_set_rate(struct clk *clk, unsigned long rate)
185{ 191{
186 return -EINVAL; 192 int ret;
193
194 if (IS_ERR(clk))
195 return -EINVAL;
196
197 mutex_lock(&clocks_mutex);
198 ret = (clk->set_rate)(clk, rate);
199 mutex_unlock(&clocks_mutex);
200
201 return ret;
187} 202}
188 203
189struct clk *clk_get_parent(struct clk *clk) 204struct clk *clk_get_parent(struct clk *clk)
@@ -191,6 +206,23 @@ struct clk *clk_get_parent(struct clk *clk)
191 return clk->parent; 206 return clk->parent;
192} 207}
193 208
209int clk_set_parent(struct clk *clk, struct clk *parent)
210{
211 int ret = 0;
212
213 if (IS_ERR(clk))
214 return -EINVAL;
215
216 mutex_lock(&clocks_mutex);
217
218 if (clk->set_parent)
219 ret = (clk->set_parent)(clk, parent);
220
221 mutex_unlock(&clocks_mutex);
222
223 return ret;
224}
225
194EXPORT_SYMBOL(clk_get); 226EXPORT_SYMBOL(clk_get);
195EXPORT_SYMBOL(clk_put); 227EXPORT_SYMBOL(clk_put);
196EXPORT_SYMBOL(clk_enable); 228EXPORT_SYMBOL(clk_enable);
@@ -199,6 +231,29 @@ EXPORT_SYMBOL(clk_get_rate);
199EXPORT_SYMBOL(clk_round_rate); 231EXPORT_SYMBOL(clk_round_rate);
200EXPORT_SYMBOL(clk_set_rate); 232EXPORT_SYMBOL(clk_set_rate);
201EXPORT_SYMBOL(clk_get_parent); 233EXPORT_SYMBOL(clk_get_parent);
234EXPORT_SYMBOL(clk_set_parent);
235
236/* base clock enable */
237
238static int s3c24xx_upll_enable(struct clk *clk, int enable)
239{
240 unsigned long clkslow = __raw_readl(S3C2410_CLKSLOW);
241 unsigned long orig = clkslow;
242
243 if (enable)
244 clkslow &= ~S3C2410_CLKSLOW_UCLK_OFF;
245 else
246 clkslow |= S3C2410_CLKSLOW_UCLK_OFF;
247
248 __raw_writel(clkslow, S3C2410_CLKSLOW);
249
250 /* if we started the UPLL, then allow to settle */
251
252 if (enable && !(orig & S3C2410_CLKSLOW_UCLK_OFF))
253 udelay(200);
254
255 return 0;
256}
202 257
203/* base clocks */ 258/* base clocks */
204 259
@@ -210,6 +265,14 @@ static struct clk clk_xtal = {
210 .ctrlbit = 0, 265 .ctrlbit = 0,
211}; 266};
212 267
268static struct clk clk_upll = {
269 .name = "upll",
270 .id = -1,
271 .parent = NULL,
272 .enable = s3c24xx_upll_enable,
273 .ctrlbit = 0,
274};
275
213static struct clk clk_f = { 276static struct clk clk_f = {
214 .name = "fclk", 277 .name = "fclk",
215 .id = -1, 278 .id = -1,
@@ -234,26 +297,124 @@ static struct clk clk_p = {
234 .ctrlbit = 0, 297 .ctrlbit = 0,
235}; 298};
236 299
300struct clk clk_usb_bus = {
301 .name = "usb-bus",
302 .id = -1,
303 .rate = 0,
304 .parent = &clk_upll,
305};
306
237/* clocks that could be registered by external code */ 307/* clocks that could be registered by external code */
238 308
309static int s3c24xx_dclk_enable(struct clk *clk, int enable)
310{
311 unsigned long dclkcon = __raw_readl(S3C2410_DCLKCON);
312
313 if (enable)
314 dclkcon |= clk->ctrlbit;
315 else
316 dclkcon &= ~clk->ctrlbit;
317
318 __raw_writel(dclkcon, S3C2410_DCLKCON);
319
320 return 0;
321}
322
323static int s3c24xx_dclk_setparent(struct clk *clk, struct clk *parent)
324{
325 unsigned long dclkcon;
326 unsigned int uclk;
327
328 if (parent == &clk_upll)
329 uclk = 1;
330 else if (parent == &clk_p)
331 uclk = 0;
332 else
333 return -EINVAL;
334
335 clk->parent = parent;
336
337 dclkcon = __raw_readl(S3C2410_DCLKCON);
338
339 if (clk->ctrlbit == S3C2410_DCLKCON_DCLK0EN) {
340 if (uclk)
341 dclkcon |= S3C2410_DCLKCON_DCLK0_UCLK;
342 else
343 dclkcon &= ~S3C2410_DCLKCON_DCLK0_UCLK;
344 } else {
345 if (uclk)
346 dclkcon |= S3C2410_DCLKCON_DCLK1_UCLK;
347 else
348 dclkcon &= ~S3C2410_DCLKCON_DCLK1_UCLK;
349 }
350
351 __raw_writel(dclkcon, S3C2410_DCLKCON);
352
353 return 0;
354}
355
356
357static int s3c24xx_clkout_setparent(struct clk *clk, struct clk *parent)
358{
359 unsigned long mask;
360 unsigned long source;
361
362 /* calculate the MISCCR setting for the clock */
363
364 if (parent == &clk_xtal)
365 source = S3C2410_MISCCR_CLK0_MPLL;
366 else if (parent == &clk_upll)
367 source = S3C2410_MISCCR_CLK0_UPLL;
368 else if (parent == &clk_f)
369 source = S3C2410_MISCCR_CLK0_FCLK;
370 else if (parent == &clk_p)
371 source = S3C2410_MISCCR_CLK0_PCLK;
372 else if (clk == &s3c24xx_clkout0 && parent == &s3c24xx_dclk0)
373 source = S3C2410_MISCCR_CLK0_DCLK0;
374 else if (clk == &s3c24xx_clkout1 && parent == &s3c24xx_dclk1)
375 source = S3C2410_MISCCR_CLK0_DCLK0;
376 else
377 return -EINVAL;
378
379 if (clk == &s3c24xx_dclk0)
380 mask = S3C2410_MISCCR_CLK0_MASK;
381 else {
382 source <<= 4;
383 mask = S3C2410_MISCCR_CLK1_MASK;
384 }
385
386 s3c2410_modify_misccr(mask, source);
387 return 0;
388}
389
390/* external clock definitions */
391
239struct clk s3c24xx_dclk0 = { 392struct clk s3c24xx_dclk0 = {
240 .name = "dclk0", 393 .name = "dclk0",
241 .id = -1, 394 .id = -1,
395 .ctrlbit = S3C2410_DCLKCON_DCLK0EN,
396 .enable = s3c24xx_dclk_enable,
397 .set_parent = s3c24xx_dclk_setparent,
242}; 398};
243 399
244struct clk s3c24xx_dclk1 = { 400struct clk s3c24xx_dclk1 = {
245 .name = "dclk1", 401 .name = "dclk1",
246 .id = -1, 402 .id = -1,
403 .ctrlbit = S3C2410_DCLKCON_DCLK0EN,
404 .enable = s3c24xx_dclk_enable,
405 .set_parent = s3c24xx_dclk_setparent,
247}; 406};
248 407
249struct clk s3c24xx_clkout0 = { 408struct clk s3c24xx_clkout0 = {
250 .name = "clkout0", 409 .name = "clkout0",
251 .id = -1, 410 .id = -1,
411 .set_parent = s3c24xx_clkout_setparent,
252}; 412};
253 413
254struct clk s3c24xx_clkout1 = { 414struct clk s3c24xx_clkout1 = {
255 .name = "clkout1", 415 .name = "clkout1",
256 .id = -1, 416 .id = -1,
417 .set_parent = s3c24xx_clkout_setparent,
257}; 418};
258 419
259struct clk s3c24xx_uclk = { 420struct clk s3c24xx_uclk = {
@@ -262,7 +423,7 @@ struct clk s3c24xx_uclk = {
262}; 423};
263 424
264 425
265/* clock definitions */ 426/* standard clock definitions */
266 427
267static struct clk init_clocks[] = { 428static struct clk init_clocks[] = {
268 { 429 {
@@ -374,7 +535,7 @@ int s3c24xx_register_clock(struct clk *clk)
374 535
375 /* if this is a standard clock, set the usage state */ 536 /* if this is a standard clock, set the usage state */
376 537
377 if (clk->ctrlbit) { 538 if (clk->ctrlbit && clk->enable == s3c24xx_clkcon_enable) {
378 unsigned long clkcon = __raw_readl(S3C2410_CLKCON); 539 unsigned long clkcon = __raw_readl(S3C2410_CLKCON);
379 540
380 clk->usage = (clkcon & clk->ctrlbit) ? 1 : 0; 541 clk->usage = (clkcon & clk->ctrlbit) ? 1 : 0;
@@ -396,6 +557,7 @@ int __init s3c24xx_setup_clocks(unsigned long xtal,
396 unsigned long hclk, 557 unsigned long hclk,
397 unsigned long pclk) 558 unsigned long pclk)
398{ 559{
560 unsigned long upllcon = __raw_readl(S3C2410_UPLLCON);
399 unsigned long clkslow = __raw_readl(S3C2410_CLKSLOW); 561 unsigned long clkslow = __raw_readl(S3C2410_CLKSLOW);
400 struct clk *clkp = init_clocks; 562 struct clk *clkp = init_clocks;
401 int ptr; 563 int ptr;
@@ -406,6 +568,7 @@ int __init s3c24xx_setup_clocks(unsigned long xtal,
406 /* initialise the main system clocks */ 568 /* initialise the main system clocks */
407 569
408 clk_xtal.rate = xtal; 570 clk_xtal.rate = xtal;
571 clk_upll.rate = s3c2410_get_pll(upllcon, xtal);
409 572
410 clk_h.rate = hclk; 573 clk_h.rate = hclk;
411 clk_p.rate = pclk; 574 clk_p.rate = pclk;
@@ -439,6 +602,9 @@ int __init s3c24xx_setup_clocks(unsigned long xtal,
439 if (s3c24xx_register_clock(&clk_xtal) < 0) 602 if (s3c24xx_register_clock(&clk_xtal) < 0)
440 printk(KERN_ERR "failed to register master xtal\n"); 603 printk(KERN_ERR "failed to register master xtal\n");
441 604
605 if (s3c24xx_register_clock(&clk_upll) < 0)
606 printk(KERN_ERR "failed to register upll clock\n");
607
442 if (s3c24xx_register_clock(&clk_f) < 0) 608 if (s3c24xx_register_clock(&clk_f) < 0)
443 printk(KERN_ERR "failed to register cpu fclk\n"); 609 printk(KERN_ERR "failed to register cpu fclk\n");
444 610
@@ -448,6 +614,10 @@ int __init s3c24xx_setup_clocks(unsigned long xtal,
448 if (s3c24xx_register_clock(&clk_p) < 0) 614 if (s3c24xx_register_clock(&clk_p) < 0)
449 printk(KERN_ERR "failed to register cpu pclk\n"); 615 printk(KERN_ERR "failed to register cpu pclk\n");
450 616
617
618 if (s3c24xx_register_clock(&clk_usb_bus) < 0)
619 printk(KERN_ERR "failed to register usb bus clock\n");
620
451 /* register clocks from clock array */ 621 /* register clocks from clock array */
452 622
453 for (ptr = 0; ptr < ARRAY_SIZE(init_clocks); ptr++, clkp++) { 623 for (ptr = 0; ptr < ARRAY_SIZE(init_clocks); ptr++, clkp++) {
diff --git a/arch/arm/mach-s3c2410/clock.h b/arch/arm/mach-s3c2410/clock.h
index eb5c95d1e7f2..01bb458bf8eb 100644
--- a/arch/arm/mach-s3c2410/clock.h
+++ b/arch/arm/mach-s3c2410/clock.h
@@ -19,7 +19,11 @@ struct clk {
19 int usage; 19 int usage;
20 unsigned long rate; 20 unsigned long rate;
21 unsigned long ctrlbit; 21 unsigned long ctrlbit;
22
22 int (*enable)(struct clk *, int enable); 23 int (*enable)(struct clk *, int enable);
24 int (*set_rate)(struct clk *c, unsigned long rate);
25 unsigned long (*round_rate)(struct clk *c, unsigned long rate);
26 int (*set_parent)(struct clk *c, struct clk *parent);
23}; 27};
24 28
25/* other clocks which may be registered by board support */ 29/* other clocks which may be registered by board support */
@@ -30,11 +34,15 @@ extern struct clk s3c24xx_clkout0;
30extern struct clk s3c24xx_clkout1; 34extern struct clk s3c24xx_clkout1;
31extern struct clk s3c24xx_uclk; 35extern struct clk s3c24xx_uclk;
32 36
37extern struct clk clk_usb_bus;
38
33/* exports for arch/arm/mach-s3c2410 39/* exports for arch/arm/mach-s3c2410
34 * 40 *
35 * Please DO NOT use these outside of arch/arm/mach-s3c2410 41 * Please DO NOT use these outside of arch/arm/mach-s3c2410
36*/ 42*/
37 43
44extern struct mutex clocks_mutex;
45
38extern int s3c24xx_clkcon_enable(struct clk *clk, int enable); 46extern int s3c24xx_clkcon_enable(struct clk *clk, int enable);
39extern int s3c24xx_register_clock(struct clk *clk); 47extern int s3c24xx_register_clock(struct clk *clk);
40 48
diff --git a/arch/arm/mach-s3c2410/cpu.c b/arch/arm/mach-s3c2410/cpu.c
index 00a379334b60..70c34fcf7858 100644
--- a/arch/arm/mach-s3c2410/cpu.c
+++ b/arch/arm/mach-s3c2410/cpu.c
@@ -146,7 +146,7 @@ void s3c24xx_set_board(struct s3c24xx_board *b)
146 board = b; 146 board = b;
147 147
148 if (b->clocks_count != 0) { 148 if (b->clocks_count != 0) {
149 struct clk **ptr = b->clocks;; 149 struct clk **ptr = b->clocks;
150 150
151 for (i = b->clocks_count; i > 0; i--, ptr++) 151 for (i = b->clocks_count; i > 0; i--, ptr++)
152 s3c24xx_register_clock(*ptr); 152 s3c24xx_register_clock(*ptr);
diff --git a/arch/arm/mach-s3c2410/devs.c b/arch/arm/mach-s3c2410/devs.c
index 0a47d38789a5..ca09ba516e4c 100644
--- a/arch/arm/mach-s3c2410/devs.c
+++ b/arch/arm/mach-s3c2410/devs.c
@@ -334,11 +334,17 @@ static struct resource s3c_spi0_resource[] = {
334 334
335}; 335};
336 336
337static u64 s3c_device_spi0_dmamask = 0xffffffffUL;
338
337struct platform_device s3c_device_spi0 = { 339struct platform_device s3c_device_spi0 = {
338 .name = "s3c2410-spi", 340 .name = "s3c2410-spi",
339 .id = 0, 341 .id = 0,
340 .num_resources = ARRAY_SIZE(s3c_spi0_resource), 342 .num_resources = ARRAY_SIZE(s3c_spi0_resource),
341 .resource = s3c_spi0_resource, 343 .resource = s3c_spi0_resource,
344 .dev = {
345 .dma_mask = &s3c_device_spi0_dmamask,
346 .coherent_dma_mask = 0xffffffffUL
347 }
342}; 348};
343 349
344EXPORT_SYMBOL(s3c_device_spi0); 350EXPORT_SYMBOL(s3c_device_spi0);
@@ -359,11 +365,17 @@ static struct resource s3c_spi1_resource[] = {
359 365
360}; 366};
361 367
368static u64 s3c_device_spi1_dmamask = 0xffffffffUL;
369
362struct platform_device s3c_device_spi1 = { 370struct platform_device s3c_device_spi1 = {
363 .name = "s3c2410-spi", 371 .name = "s3c2410-spi",
364 .id = 1, 372 .id = 1,
365 .num_resources = ARRAY_SIZE(s3c_spi1_resource), 373 .num_resources = ARRAY_SIZE(s3c_spi1_resource),
366 .resource = s3c_spi1_resource, 374 .resource = s3c_spi1_resource,
375 .dev = {
376 .dma_mask = &s3c_device_spi1_dmamask,
377 .coherent_dma_mask = 0xffffffffUL
378 }
367}; 379};
368 380
369EXPORT_SYMBOL(s3c_device_spi1); 381EXPORT_SYMBOL(s3c_device_spi1);
diff --git a/arch/arm/mach-s3c2410/mach-osiris.c b/arch/arm/mach-s3c2410/mach-osiris.c
new file mode 100644
index 000000000000..ae0787557751
--- /dev/null
+++ b/arch/arm/mach-s3c2410/mach-osiris.c
@@ -0,0 +1,294 @@
1/* linux/arch/arm/mach-s3c2410/mach-osiris.c
2 *
3 * Copyright (c) 2005 Simtec Electronics
4 * http://armlinux.simtec.co.uk/
5 * Ben Dooks <ben@simtec.co.uk>
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License version 2 as
9 * published by the Free Software Foundation.
10*/
11
12#include <linux/kernel.h>
13#include <linux/types.h>
14#include <linux/interrupt.h>
15#include <linux/list.h>
16#include <linux/timer.h>
17#include <linux/init.h>
18#include <linux/device.h>
19
20#include <asm/mach/arch.h>
21#include <asm/mach/map.h>
22#include <asm/mach/irq.h>
23
24#include <asm/arch/osiris-map.h>
25#include <asm/arch/osiris-cpld.h>
26
27#include <asm/hardware.h>
28#include <asm/io.h>
29#include <asm/irq.h>
30#include <asm/mach-types.h>
31
32#include <asm/arch/regs-serial.h>
33#include <asm/arch/regs-gpio.h>
34#include <asm/arch/regs-mem.h>
35#include <asm/arch/regs-lcd.h>
36#include <asm/arch/nand.h>
37
38#include <linux/mtd/mtd.h>
39#include <linux/mtd/nand.h>
40#include <linux/mtd/nand_ecc.h>
41#include <linux/mtd/partitions.h>
42
43#include "clock.h"
44#include "devs.h"
45#include "cpu.h"
46
47/* onboard perihpheral map */
48
49static struct map_desc osiris_iodesc[] __initdata = {
50 /* ISA IO areas (may be over-written later) */
51
52 {
53 .virtual = (u32)S3C24XX_VA_ISA_BYTE,
54 .pfn = __phys_to_pfn(S3C2410_CS5),
55 .length = SZ_16M,
56 .type = MT_DEVICE,
57 }, {
58 .virtual = (u32)S3C24XX_VA_ISA_WORD,
59 .pfn = __phys_to_pfn(S3C2410_CS5),
60 .length = SZ_16M,
61 .type = MT_DEVICE,
62 },
63
64 /* CPLD control registers */
65
66 {
67 .virtual = (u32)OSIRIS_VA_CTRL1,
68 .pfn = __phys_to_pfn(OSIRIS_PA_CTRL1),
69 .length = SZ_16K,
70 .type = MT_DEVICE
71 }, {
72 .virtual = (u32)OSIRIS_VA_CTRL2,
73 .pfn = __phys_to_pfn(OSIRIS_PA_CTRL2),
74 .length = SZ_16K,
75 .type = MT_DEVICE
76 },
77};
78
79#define UCON S3C2410_UCON_DEFAULT | S3C2410_UCON_UCLK
80#define ULCON S3C2410_LCON_CS8 | S3C2410_LCON_PNONE | S3C2410_LCON_STOPB
81#define UFCON S3C2410_UFCON_RXTRIG8 | S3C2410_UFCON_FIFOMODE
82
83static struct s3c24xx_uart_clksrc osiris_serial_clocks[] = {
84 [0] = {
85 .name = "uclk",
86 .divisor = 1,
87 .min_baud = 0,
88 .max_baud = 0,
89 },
90 [1] = {
91 .name = "pclk",
92 .divisor = 1,
93 .min_baud = 0,
94 .max_baud = 0.
95 }
96};
97
98
99static struct s3c2410_uartcfg osiris_uartcfgs[] = {
100 [0] = {
101 .hwport = 0,
102 .flags = 0,
103 .ucon = UCON,
104 .ulcon = ULCON,
105 .ufcon = UFCON,
106 .clocks = osiris_serial_clocks,
107 .clocks_size = ARRAY_SIZE(osiris_serial_clocks)
108 },
109 [1] = {
110 .hwport = 2,
111 .flags = 0,
112 .ucon = UCON,
113 .ulcon = ULCON,
114 .ufcon = UFCON,
115 .clocks = osiris_serial_clocks,
116 .clocks_size = ARRAY_SIZE(osiris_serial_clocks)
117 },
118};
119
120/* NAND Flash on Osiris board */
121
122static int external_map[] = { 2 };
123static int chip0_map[] = { 0 };
124static int chip1_map[] = { 1 };
125
126static struct mtd_partition osiris_default_nand_part[] = {
127 [0] = {
128 .name = "Boot Agent",
129 .size = SZ_16K,
130 .offset = 0
131 },
132 [1] = {
133 .name = "/boot",
134 .size = SZ_4M - SZ_16K,
135 .offset = SZ_16K,
136 },
137 [2] = {
138 .name = "user1",
139 .offset = SZ_4M,
140 .size = SZ_32M - SZ_4M,
141 },
142 [3] = {
143 .name = "user2",
144 .offset = SZ_32M,
145 .size = MTDPART_SIZ_FULL,
146 }
147};
148
149/* the Osiris has 3 selectable slots for nand-flash, the two
150 * on-board chip areas, as well as the external slot.
151 *
152 * Note, there is no current hot-plug support for the External
153 * socket.
154*/
155
156static struct s3c2410_nand_set osiris_nand_sets[] = {
157 [1] = {
158 .name = "External",
159 .nr_chips = 1,
160 .nr_map = external_map,
161 .nr_partitions = ARRAY_SIZE(osiris_default_nand_part),
162 .partitions = osiris_default_nand_part
163 },
164 [0] = {
165 .name = "chip0",
166 .nr_chips = 1,
167 .nr_map = chip0_map,
168 .nr_partitions = ARRAY_SIZE(osiris_default_nand_part),
169 .partitions = osiris_default_nand_part
170 },
171 [2] = {
172 .name = "chip1",
173 .nr_chips = 1,
174 .nr_map = chip1_map,
175 .nr_partitions = ARRAY_SIZE(osiris_default_nand_part),
176 .partitions = osiris_default_nand_part
177 },
178};
179
180static void osiris_nand_select(struct s3c2410_nand_set *set, int slot)
181{
182 unsigned int tmp;
183
184 slot = set->nr_map[slot] & 3;
185
186 pr_debug("osiris_nand: selecting slot %d (set %p,%p)\n",
187 slot, set, set->nr_map);
188
189 tmp = __raw_readb(OSIRIS_VA_CTRL1);
190 tmp &= ~OSIRIS_CTRL1_NANDSEL;
191 tmp |= slot;
192
193 pr_debug("osiris_nand: ctrl1 now %02x\n", tmp);
194
195 __raw_writeb(tmp, OSIRIS_VA_CTRL1);
196}
197
198static struct s3c2410_platform_nand osiris_nand_info = {
199 .tacls = 25,
200 .twrph0 = 60,
201 .twrph1 = 60,
202 .nr_sets = ARRAY_SIZE(osiris_nand_sets),
203 .sets = osiris_nand_sets,
204 .select_chip = osiris_nand_select,
205};
206
207/* PCMCIA control and configuration */
208
209static struct resource osiris_pcmcia_resource[] = {
210 [0] = {
211 .start = 0x0f000000,
212 .end = 0x0f100000,
213 .flags = IORESOURCE_MEM,
214 },
215 [1] = {
216 .start = 0x0c000000,
217 .end = 0x0c100000,
218 .flags = IORESOURCE_MEM,
219 }
220};
221
222static struct platform_device osiris_pcmcia = {
223 .name = "osiris-pcmcia",
224 .id = -1,
225 .num_resources = ARRAY_SIZE(osiris_pcmcia_resource),
226 .resource = osiris_pcmcia_resource,
227};
228
229/* Standard Osiris devices */
230
231static struct platform_device *osiris_devices[] __initdata = {
232 &s3c_device_i2c,
233 &s3c_device_nand,
234 &osiris_pcmcia,
235};
236
237static struct clk *osiris_clocks[] = {
238 &s3c24xx_dclk0,
239 &s3c24xx_dclk1,
240 &s3c24xx_clkout0,
241 &s3c24xx_clkout1,
242 &s3c24xx_uclk,
243};
244
245static struct s3c24xx_board osiris_board __initdata = {
246 .devices = osiris_devices,
247 .devices_count = ARRAY_SIZE(osiris_devices),
248 .clocks = osiris_clocks,
249 .clocks_count = ARRAY_SIZE(osiris_clocks)
250};
251
252static void __init osiris_map_io(void)
253{
254 unsigned long flags;
255
256 /* initialise the clocks */
257
258 s3c24xx_dclk0.parent = NULL;
259 s3c24xx_dclk0.rate = 12*1000*1000;
260
261 s3c24xx_dclk1.parent = NULL;
262 s3c24xx_dclk1.rate = 24*1000*1000;
263
264 s3c24xx_clkout0.parent = &s3c24xx_dclk0;
265 s3c24xx_clkout1.parent = &s3c24xx_dclk1;
266
267 s3c24xx_uclk.parent = &s3c24xx_clkout1;
268
269 s3c_device_nand.dev.platform_data = &osiris_nand_info;
270
271 s3c24xx_init_io(osiris_iodesc, ARRAY_SIZE(osiris_iodesc));
272 s3c24xx_init_clocks(0);
273 s3c24xx_init_uarts(osiris_uartcfgs, ARRAY_SIZE(osiris_uartcfgs));
274 s3c24xx_set_board(&osiris_board);
275
276 /* fix bus configuration (nBE settings wrong on ABLE pre v2.20) */
277
278 local_irq_save(flags);
279 __raw_writel(__raw_readl(S3C2410_BWSCON) | S3C2410_BWSCON_ST1 | S3C2410_BWSCON_ST2 | S3C2410_BWSCON_ST3 | S3C2410_BWSCON_ST4 | S3C2410_BWSCON_ST5, S3C2410_BWSCON);
280 local_irq_restore(flags);
281
282 /* write-protect line to the NAND */
283 s3c2410_gpio_setpin(S3C2410_GPA0, 1);
284}
285
286MACHINE_START(OSIRIS, "Simtec-OSIRIS")
287 /* Maintainer: Ben Dooks <ben@simtec.co.uk> */
288 .phys_io = S3C2410_PA_UART,
289 .io_pg_offst = (((u32)S3C24XX_VA_UART) >> 18) & 0xfffc,
290 .boot_params = S3C2410_SDRAM_PA + 0x100,
291 .map_io = osiris_map_io,
292 .init_irq = s3c24xx_init_irq,
293 .timer = &s3c24xx_timer,
294MACHINE_END
diff --git a/arch/arm/mach-s3c2410/s3c2440-clock.c b/arch/arm/mach-s3c2410/s3c2440-clock.c
index b557a2be8a01..57a15974d4b5 100644
--- a/arch/arm/mach-s3c2410/s3c2440-clock.c
+++ b/arch/arm/mach-s3c2410/s3c2440-clock.c
@@ -31,6 +31,7 @@
31#include <linux/sysdev.h> 31#include <linux/sysdev.h>
32#include <linux/interrupt.h> 32#include <linux/interrupt.h>
33#include <linux/ioport.h> 33#include <linux/ioport.h>
34#include <linux/mutex.h>
34#include <linux/clk.h> 35#include <linux/clk.h>
35 36
36#include <asm/hardware.h> 37#include <asm/hardware.h>
@@ -45,10 +46,47 @@
45 46
46/* S3C2440 extended clock support */ 47/* S3C2440 extended clock support */
47 48
48static struct clk s3c2440_clk_upll = { 49static unsigned long s3c2440_camif_upll_round(struct clk *clk,
49 .name = "upll", 50 unsigned long rate)
50 .id = -1, 51{
51}; 52 unsigned long parent_rate = clk_get_rate(clk->parent);
53 int div;
54
55 if (rate > parent_rate)
56 return parent_rate;
57
58 /* note, we remove the +/- 1 calculations for the divisor */
59
60 div = (parent_rate / rate) / 2;
61
62 if (div < 1)
63 div = 1;
64 else if (div > 16)
65 div = 16;
66
67 return parent_rate / (div * 2);
68}
69
70static int s3c2440_camif_upll_setrate(struct clk *clk, unsigned long rate)
71{
72 unsigned long parent_rate = clk_get_rate(clk->parent);
73 unsigned long camdivn = __raw_readl(S3C2440_CAMDIVN);
74
75 rate = s3c2440_camif_upll_round(clk, rate);
76
77 camdivn &= ~(S3C2440_CAMDIVN_CAMCLK_SEL | S3C2440_CAMDIVN_CAMCLK_MASK);
78
79 if (rate != parent_rate) {
80 camdivn |= S3C2440_CAMDIVN_CAMCLK_SEL;
81 camdivn |= (((parent_rate / rate) / 2) - 1);
82 }
83
84 __raw_writel(camdivn, S3C2440_CAMDIVN);
85
86 return 0;
87}
88
89/* Extra S3C2440 clocks */
52 90
53static struct clk s3c2440_clk_cam = { 91static struct clk s3c2440_clk_cam = {
54 .name = "camif", 92 .name = "camif",
@@ -57,6 +95,13 @@ static struct clk s3c2440_clk_cam = {
57 .ctrlbit = S3C2440_CLKCON_CAMERA, 95 .ctrlbit = S3C2440_CLKCON_CAMERA,
58}; 96};
59 97
98static struct clk s3c2440_clk_cam_upll = {
99 .name = "camif-upll",
100 .id = -1,
101 .set_rate = s3c2440_camif_upll_setrate,
102 .round_rate = s3c2440_camif_upll_round,
103};
104
60static struct clk s3c2440_clk_ac97 = { 105static struct clk s3c2440_clk_ac97 = {
61 .name = "ac97", 106 .name = "ac97",
62 .id = -1, 107 .id = -1,
@@ -66,38 +111,46 @@ static struct clk s3c2440_clk_ac97 = {
66 111
67static int s3c2440_clk_add(struct sys_device *sysdev) 112static int s3c2440_clk_add(struct sys_device *sysdev)
68{ 113{
69 unsigned long upllcon = __raw_readl(S3C2410_UPLLCON);
70 unsigned long camdivn = __raw_readl(S3C2440_CAMDIVN); 114 unsigned long camdivn = __raw_readl(S3C2440_CAMDIVN);
115 unsigned long clkdivn;
71 struct clk *clk_h; 116 struct clk *clk_h;
72 struct clk *clk_p; 117 struct clk *clk_p;
73 struct clk *clk_xtal; 118 struct clk *clk_upll;
74
75 clk_xtal = clk_get(NULL, "xtal");
76 if (IS_ERR(clk_xtal)) {
77 printk(KERN_ERR "S3C2440: Failed to get clk_xtal\n");
78 return -EINVAL;
79 }
80
81 s3c2440_clk_upll.rate = s3c2410_get_pll(upllcon, clk_xtal->rate);
82 119
83 printk("S3C2440: Clock Support, UPLL %ld.%03ld MHz, DVS %s\n", 120 printk("S3C2440: Clock Support, DVS %s\n",
84 print_mhz(s3c2440_clk_upll.rate),
85 (camdivn & S3C2440_CAMDIVN_DVSEN) ? "on" : "off"); 121 (camdivn & S3C2440_CAMDIVN_DVSEN) ? "on" : "off");
86 122
87 clk_p = clk_get(NULL, "pclk"); 123 clk_p = clk_get(NULL, "pclk");
88 clk_h = clk_get(NULL, "hclk"); 124 clk_h = clk_get(NULL, "hclk");
125 clk_upll = clk_get(NULL, "upll");
89 126
90 if (IS_ERR(clk_p) || IS_ERR(clk_h)) { 127 if (IS_ERR(clk_p) || IS_ERR(clk_h) || IS_ERR(clk_upll)) {
91 printk(KERN_ERR "S3C2440: Failed to get parent clocks\n"); 128 printk(KERN_ERR "S3C2440: Failed to get parent clocks\n");
92 return -EINVAL; 129 return -EINVAL;
93 } 130 }
94 131
132 /* check rate of UPLL, and if it is near 96MHz, then change
133 * to using half the UPLL rate for the system */
134
135 if (clk_get_rate(clk_upll) > (94 * MHZ)) {
136 clk_usb_bus.rate = clk_get_rate(clk_upll) / 2;
137
138 mutex_lock(&clocks_mutex);
139
140 clkdivn = __raw_readl(S3C2410_CLKDIVN);
141 clkdivn |= S3C2440_CLKDIVN_UCLK;
142 __raw_writel(camdivn, S3C2410_CLKDIVN);
143
144 mutex_unlock(&clocks_mutex);
145 }
146
95 s3c2440_clk_cam.parent = clk_h; 147 s3c2440_clk_cam.parent = clk_h;
96 s3c2440_clk_ac97.parent = clk_p; 148 s3c2440_clk_ac97.parent = clk_p;
149 s3c2440_clk_cam_upll.parent = clk_upll;
97 150
98 s3c24xx_register_clock(&s3c2440_clk_ac97); 151 s3c24xx_register_clock(&s3c2440_clk_ac97);
99 s3c24xx_register_clock(&s3c2440_clk_cam); 152 s3c24xx_register_clock(&s3c2440_clk_cam);
100 s3c24xx_register_clock(&s3c2440_clk_upll); 153 s3c24xx_register_clock(&s3c2440_clk_cam_upll);
101 154
102 clk_disable(&s3c2440_clk_ac97); 155 clk_disable(&s3c2440_clk_ac97);
103 clk_disable(&s3c2440_clk_cam); 156 clk_disable(&s3c2440_clk_cam);
diff --git a/arch/arm/mach-s3c2410/time.c b/arch/arm/mach-s3c2410/time.c
index 10a2976aefdd..9d7b799ea4a4 100644
--- a/arch/arm/mach-s3c2410/time.c
+++ b/arch/arm/mach-s3c2410/time.c
@@ -142,6 +142,12 @@ static struct irqaction s3c2410_timer_irq = {
142 .handler = s3c2410_timer_interrupt, 142 .handler = s3c2410_timer_interrupt,
143}; 143};
144 144
145#define use_tclk1_12() ( \
146 machine_is_bast() || \
147 machine_is_vr1000() || \
148 machine_is_anubis() || \
149 machine_is_osiris() )
150
145/* 151/*
146 * Set up timer interrupt, and return the current time in seconds. 152 * Set up timer interrupt, and return the current time in seconds.
147 * 153 *
@@ -165,7 +171,7 @@ static void s3c2410_timer_setup (void)
165 171
166 /* configure the system for whichever machine is in use */ 172 /* configure the system for whichever machine is in use */
167 173
168 if (machine_is_bast() || machine_is_vr1000() || machine_is_anubis()) { 174 if (use_tclk1_12()) {
169 /* timer is at 12MHz, scaler is 1 */ 175 /* timer is at 12MHz, scaler is 1 */
170 timer_usec_ticks = timer_mask_usec_ticks(1, 12000000); 176 timer_usec_ticks = timer_mask_usec_ticks(1, 12000000);
171 tcnt = 12000000 / HZ; 177 tcnt = 12000000 / HZ;
diff --git a/arch/arm/mach-sa1100/Kconfig b/arch/arm/mach-sa1100/Kconfig
index 6923316b3d0d..cd67ab1b217b 100644
--- a/arch/arm/mach-sa1100/Kconfig
+++ b/arch/arm/mach-sa1100/Kconfig
@@ -111,7 +111,7 @@ config SA1100_LART
111 bool "LART" 111 bool "LART"
112 help 112 help
113 Say Y here if you are using the Linux Advanced Radio Terminal 113 Say Y here if you are using the Linux Advanced Radio Terminal
114 (also known as the LART). See <http://www.lart.tudelft.nl/> for 114 (also known as the LART). See <http://www.lartmaker.nl/> for
115 information on the LART. 115 information on the LART.
116 116
117config SA1100_PLEB 117config SA1100_PLEB
diff --git a/arch/arm/mach-sa1100/Makefile b/arch/arm/mach-sa1100/Makefile
index e4a4a3e8aa8f..e27f15042a22 100644
--- a/arch/arm/mach-sa1100/Makefile
+++ b/arch/arm/mach-sa1100/Makefile
@@ -3,7 +3,7 @@
3# 3#
4 4
5# Common support 5# Common support
6obj-y := generic.o irq.o dma.o time.o 6obj-y := clock.o generic.o irq.o dma.o time.o #nmi-oopser.o
7obj-m := 7obj-m :=
8obj-n := 8obj-n :=
9obj- := 9obj- :=
diff --git a/arch/arm/mach-sa1100/assabet.c b/arch/arm/mach-sa1100/assabet.c
index a599bb0d4ab8..c58f12ba7a93 100644
--- a/arch/arm/mach-sa1100/assabet.c
+++ b/arch/arm/mach-sa1100/assabet.c
@@ -26,6 +26,7 @@
26#include <asm/irq.h> 26#include <asm/irq.h>
27#include <asm/setup.h> 27#include <asm/setup.h>
28#include <asm/page.h> 28#include <asm/page.h>
29#include <asm/pgtable-hwdef.h>
29#include <asm/pgtable.h> 30#include <asm/pgtable.h>
30#include <asm/tlbflush.h> 31#include <asm/tlbflush.h>
31 32
diff --git a/arch/arm/mach-sa1100/clock.c b/arch/arm/mach-sa1100/clock.c
new file mode 100644
index 000000000000..b1e8fd766c1a
--- /dev/null
+++ b/arch/arm/mach-sa1100/clock.c
@@ -0,0 +1,132 @@
1/*
2 * linux/arch/arm/mach-sa1100/clock.c
3 */
4#include <linux/module.h>
5#include <linux/kernel.h>
6#include <linux/list.h>
7#include <linux/errno.h>
8#include <linux/err.h>
9#include <linux/string.h>
10#include <linux/clk.h>
11#include <linux/spinlock.h>
12
13#include <asm/hardware.h>
14#include <asm/semaphore.h>
15
16struct clk {
17 struct list_head node;
18 unsigned long rate;
19 struct module *owner;
20 const char *name;
21 unsigned int enabled;
22 void (*enable)(void);
23 void (*disable)(void);
24};
25
26static LIST_HEAD(clocks);
27static DECLARE_MUTEX(clocks_sem);
28static DEFINE_SPINLOCK(clocks_lock);
29
30struct clk *clk_get(struct device *dev, const char *id)
31{
32 struct clk *p, *clk = ERR_PTR(-ENOENT);
33
34 down(&clocks_sem);
35 list_for_each_entry(p, &clocks, node) {
36 if (strcmp(id, p->name) == 0 && try_module_get(p->owner)) {
37 clk = p;
38 break;
39 }
40 }
41 up(&clocks_sem);
42
43 return clk;
44}
45EXPORT_SYMBOL(clk_get);
46
47void clk_put(struct clk *clk)
48{
49 module_put(clk->owner);
50}
51EXPORT_SYMBOL(clk_put);
52
53int clk_enable(struct clk *clk)
54{
55 unsigned long flags;
56
57 spin_lock_irqsave(&clocks_lock, flags);
58 if (clk->enabled++ == 0)
59 clk->enable();
60 spin_unlock_irqrestore(&clocks_lock, flags);
61 return 0;
62}
63EXPORT_SYMBOL(clk_enable);
64
65void clk_disable(struct clk *clk)
66{
67 unsigned long flags;
68
69 WARN_ON(clk->enabled == 0);
70
71 spin_lock_irqsave(&clocks_lock, flags);
72 if (--clk->enabled == 0)
73 clk->disable();
74 spin_unlock_irqrestore(&clocks_lock, flags);
75}
76EXPORT_SYMBOL(clk_disable);
77
78unsigned long clk_get_rate(struct clk *clk)
79{
80 return clk->rate;
81}
82EXPORT_SYMBOL(clk_get_rate);
83
84
85static void clk_gpio27_enable(void)
86{
87 /*
88 * First, set up the 3.6864MHz clock on GPIO 27 for the SA-1111:
89 * (SA-1110 Developer's Manual, section 9.1.2.1)
90 */
91 GAFR |= GPIO_32_768kHz;
92 GPDR |= GPIO_32_768kHz;
93 TUCR = TUCR_3_6864MHz;
94}
95
96static void clk_gpio27_disable(void)
97{
98 TUCR = 0;
99 GPDR &= ~GPIO_32_768kHz;
100 GAFR &= ~GPIO_32_768kHz;
101}
102
103static struct clk clk_gpio27 = {
104 .name = "GPIO27_CLK",
105 .rate = 3686400,
106 .enable = clk_gpio27_enable,
107 .disable = clk_gpio27_disable,
108};
109
110int clk_register(struct clk *clk)
111{
112 down(&clocks_sem);
113 list_add(&clk->node, &clocks);
114 up(&clocks_sem);
115 return 0;
116}
117EXPORT_SYMBOL(clk_register);
118
119void clk_unregister(struct clk *clk)
120{
121 down(&clocks_sem);
122 list_del(&clk->node);
123 up(&clocks_sem);
124}
125EXPORT_SYMBOL(clk_unregister);
126
127static int __init clk_init(void)
128{
129 clk_register(&clk_gpio27);
130 return 0;
131}
132arch_initcall(clk_init);
diff --git a/arch/arm/mach-sa1100/collie.c b/arch/arm/mach-sa1100/collie.c
index 6888816a1935..102454082474 100644
--- a/arch/arm/mach-sa1100/collie.c
+++ b/arch/arm/mach-sa1100/collie.c
@@ -40,6 +40,7 @@
40#include <asm/hardware/scoop.h> 40#include <asm/hardware/scoop.h>
41#include <asm/mach/sharpsl_param.h> 41#include <asm/mach/sharpsl_param.h>
42#include <asm/hardware/locomo.h> 42#include <asm/hardware/locomo.h>
43#include <asm/arch/mcp.h>
43 44
44#include "generic.h" 45#include "generic.h"
45 46
@@ -66,6 +67,32 @@ struct platform_device colliescoop_device = {
66 .resource = collie_scoop_resources, 67 .resource = collie_scoop_resources,
67}; 68};
68 69
70static struct scoop_pcmcia_dev collie_pcmcia_scoop[] = {
71{
72 .dev = &colliescoop_device.dev,
73 .irq = COLLIE_IRQ_GPIO_CF_IRQ,
74 .cd_irq = COLLIE_IRQ_GPIO_CF_CD,
75 .cd_irq_str = "PCMCIA0 CD",
76},
77};
78
79static struct scoop_pcmcia_config collie_pcmcia_config = {
80 .devs = &collie_pcmcia_scoop[0],
81 .num_devs = 1,
82};
83
84
85static struct mcp_plat_data collie_mcp_data = {
86 .mccr0 = MCCR0_ADM,
87 .sclk_rate = 11981000,
88};
89
90
91static struct sa1100_port_fns collie_port_fns __initdata = {
92 .set_mctrl = collie_uart_set_mctrl,
93 .get_mctrl = collie_uart_get_mctrl,
94};
95
69 96
70static struct resource locomo_resources[] = { 97static struct resource locomo_resources[] = {
71 [0] = { 98 [0] = {
@@ -159,6 +186,8 @@ static void __init collie_init(void)
159 GPDR |= GPIO_32_768kHz; 186 GPDR |= GPIO_32_768kHz;
160 TUCR = TUCR_32_768kHz; 187 TUCR = TUCR_32_768kHz;
161 188
189 platform_scoop_config = &collie_pcmcia_config;
190
162 ret = platform_add_devices(devices, ARRAY_SIZE(devices)); 191 ret = platform_add_devices(devices, ARRAY_SIZE(devices));
163 if (ret) { 192 if (ret) {
164 printk(KERN_WARNING "collie: Unable to register LoCoMo device\n"); 193 printk(KERN_WARNING "collie: Unable to register LoCoMo device\n");
@@ -166,6 +195,7 @@ static void __init collie_init(void)
166 195
167 sa11x0_set_flash_data(&collie_flash_data, collie_flash_resources, 196 sa11x0_set_flash_data(&collie_flash_data, collie_flash_resources,
168 ARRAY_SIZE(collie_flash_resources)); 197 ARRAY_SIZE(collie_flash_resources));
198 sa11x0_set_mcp_data(&collie_mcp_data);
169 199
170 sharpsl_save_param(); 200 sharpsl_save_param();
171} 201}
diff --git a/arch/arm/mach-sa1100/collie_pm.c b/arch/arm/mach-sa1100/collie_pm.c
new file mode 100644
index 000000000000..696d7d29c8a5
--- /dev/null
+++ b/arch/arm/mach-sa1100/collie_pm.c
@@ -0,0 +1,278 @@
1/*
2 * Based on spitz_pm.c and sharp code.
3 *
4 * Copyright (C) 2001 SHARP
5 * Copyright 2005 Pavel Machek <pavel@suse.cz>
6 *
7 * Distribute under GPLv2.
8 *
9 * Li-ion batteries are angry beasts, and they like to explode. This driver is not finished,
10 * and sometimes charges them when it should not. If it makes angry lithium to come your way...
11 * ...well, you have been warned.
12 */
13
14#include <linux/module.h>
15#include <linux/stat.h>
16#include <linux/init.h>
17#include <linux/kernel.h>
18#include <linux/delay.h>
19#include <linux/interrupt.h>
20#include <linux/device.h>
21#include <linux/platform_device.h>
22
23#include <asm/irq.h>
24#include <asm/mach-types.h>
25#include <asm/hardware.h>
26#include <asm/hardware/scoop.h>
27#include <asm/dma.h>
28#include <asm/arch/collie.h>
29#include <asm/mach/sharpsl_param.h>
30#include <asm/hardware/sharpsl_pm.h>
31
32#include "../drivers/mfd/ucb1x00.h"
33
34static struct ucb1x00 *ucb;
35static int ad_revise;
36
37#define ADCtoPower(x) ((330 * x * 2) / 1024)
38
39static void collie_charger_init(void)
40{
41 int err;
42
43 if (sharpsl_param.adadj != -1) {
44 ad_revise = sharpsl_param.adadj;
45 }
46
47 /* Register interrupt handler. */
48 if ((err = request_irq(COLLIE_IRQ_GPIO_AC_IN, sharpsl_ac_isr, SA_INTERRUPT,
49 "ACIN", sharpsl_ac_isr))) {
50 printk("Could not get irq %d.\n", COLLIE_IRQ_GPIO_AC_IN);
51 return;
52 }
53 if ((err = request_irq(COLLIE_IRQ_GPIO_CO, sharpsl_chrg_full_isr, SA_INTERRUPT,
54 "CO", sharpsl_chrg_full_isr))) {
55 free_irq(COLLIE_IRQ_GPIO_AC_IN, sharpsl_ac_isr);
56 printk("Could not get irq %d.\n", COLLIE_IRQ_GPIO_CO);
57 return;
58 }
59
60 ucb1x00_io_set_dir(ucb, 0, COLLIE_TC35143_GPIO_MBAT_ON | COLLIE_TC35143_GPIO_TMP_ON |
61 COLLIE_TC35143_GPIO_BBAT_ON);
62 return;
63}
64
65static void collie_measure_temp(int on)
66{
67 if (on)
68 ucb1x00_io_write(ucb, COLLIE_TC35143_GPIO_TMP_ON, 0);
69 else
70 ucb1x00_io_write(ucb, 0, COLLIE_TC35143_GPIO_TMP_ON);
71}
72
73static void collie_charge(int on)
74{
75 if (on) {
76 printk("Should start charger\n");
77 } else {
78 printk("Should stop charger\n");
79 }
80#ifdef I_AM_SURE
81
82 /* Zaurus seems to contain LTC1731 ; it should know when to
83 * stop charging itself, so setting charge on should be
84 * relatively harmless (as long as it is not done too often).
85 */
86#define CF_BUF_CTRL_BASE 0xF0800000
87#define SCOOP_REG(adr) (*(volatile unsigned short*)(CF_BUF_CTRL_BASE+(adr)))
88#define SCOOP_REG_GPWR SCOOP_REG(SCOOP_GPWR)
89
90 if (on) {
91 set_scoop_gpio(&colliescoop_device.dev, COLLIE_SCP_CHARGE_ON);
92 } else {
93 reset_scoop_gpio(&colliescoop_device.dev, COLLIE_SCP_CHARGE_ON);
94 }
95#endif
96}
97
98static void collie_discharge(int on)
99{
100}
101
102static void collie_discharge1(int on)
103{
104}
105
106static void collie_presuspend(void)
107{
108}
109
110static void collie_postsuspend(void)
111{
112}
113
114static int collie_should_wakeup(unsigned int resume_on_alarm)
115{
116 return 0;
117}
118
119static unsigned long collie_charger_wakeup(void)
120{
121 return 0;
122}
123
124int collie_read_backup_battery(void)
125{
126 int voltage;
127
128 ucb1x00_adc_enable(ucb);
129
130 /* Gives 75..130 */
131 ucb1x00_io_write(ucb, COLLIE_TC35143_GPIO_BBAT_ON, 0);
132 voltage = ucb1x00_adc_read(ucb, UCB_ADC_INP_AD1, UCB_SYNC);
133
134 ucb1x00_io_write(ucb, 0, COLLIE_TC35143_GPIO_BBAT_ON);
135 ucb1x00_adc_disable(ucb);
136
137 printk("Backup battery = %d(%d)\n", ADCtoPower(voltage), voltage);
138
139 return ADCtoPower(voltage);
140}
141
142int collie_read_main_battery(void)
143{
144 int voltage, voltage_rev, voltage_volts;
145
146 ucb1x00_adc_enable(ucb);
147 ucb1x00_io_write(ucb, 0, COLLIE_TC35143_GPIO_BBAT_ON);
148 ucb1x00_io_write(ucb, COLLIE_TC35143_GPIO_MBAT_ON, 0);
149 /* gives values 160..255 with battery removed... and
150 145..255 with battery inserted. (on AC), goes as low as
151 80 on DC. */
152 voltage = ucb1x00_adc_read(ucb, UCB_ADC_INP_AD1, UCB_SYNC);
153
154 ucb1x00_io_write(ucb, 0, COLLIE_TC35143_GPIO_MBAT_ON);
155 ucb1x00_adc_disable(ucb);
156
157 voltage_rev = voltage + ((ad_revise * voltage) / 652);
158 voltage_volts = ADCtoPower(voltage_rev);
159
160 printk("Main battery = %d(%d)\n", voltage_volts, voltage);
161
162 if (voltage != -1)
163 return voltage_volts;
164 else
165 return voltage;
166}
167
168int collie_read_temp(void)
169{
170 int voltage;
171
172 /* According to Sharp, temp must be > 973, main battery must be < 465,
173 FIXME: sharpsl_pm.c has both conditions negated? FIXME: values
174 are way out of range? */
175
176 ucb1x00_adc_enable(ucb);
177 ucb1x00_io_write(ucb, COLLIE_TC35143_GPIO_TMP_ON, 0);
178 /* >1010 = battery removed, 460 = 22C ?, higer = lower temp ? */
179 voltage = ucb1x00_adc_read(ucb, UCB_ADC_INP_AD0, UCB_SYNC);
180 ucb1x00_io_write(ucb, 0, COLLIE_TC35143_GPIO_TMP_ON);
181 ucb1x00_adc_disable(ucb);
182
183 printk("Battery temp = %d\n", voltage);
184 return voltage;
185}
186
187static unsigned long read_devdata(int which)
188{
189 switch (which) {
190 case SHARPSL_BATT_VOLT:
191 return collie_read_main_battery();
192 case SHARPSL_BATT_TEMP:
193 return collie_read_temp();
194 case SHARPSL_ACIN_VOLT:
195 return 0x1;
196 case SHARPSL_STATUS_ACIN: {
197 int ret = GPLR & COLLIE_GPIO_AC_IN;
198 printk("AC status = %d\n", ret);
199 return ret;
200 }
201 case SHARPSL_STATUS_FATAL: {
202 int ret = GPLR & COLLIE_GPIO_MAIN_BAT_LOW;
203 printk("Fatal bat = %d\n", ret);
204 return ret;
205 }
206 default:
207 return ~0;
208 }
209}
210
211struct battery_thresh collie_battery_levels[] = {
212 { 368, 100},
213 { 358, 25},
214 { 356, 5},
215 { 0, 0},
216};
217
218struct sharpsl_charger_machinfo collie_pm_machinfo = {
219 .init = collie_charger_init,
220 .read_devdata = read_devdata,
221 .discharge = collie_discharge,
222 .discharge1 = collie_discharge1,
223 .charge = collie_charge,
224 .measure_temp = collie_measure_temp,
225 .presuspend = collie_presuspend,
226 .postsuspend = collie_postsuspend,
227 .charger_wakeup = collie_charger_wakeup,
228 .should_wakeup = collie_should_wakeup,
229 .bat_levels = 3,
230 .bat_levels_noac = collie_battery_levels,
231 .bat_levels_acin = collie_battery_levels,
232 .status_high_acin = 368,
233 .status_low_acin = 358,
234 .status_high_noac = 368,
235 .status_low_noac = 358,
236};
237
238static int __init collie_pm_ucb_add(struct ucb1x00_dev *pdev)
239{
240 sharpsl_pm.machinfo = &collie_pm_machinfo;
241 ucb = pdev->ucb;
242 return 0;
243}
244
245static struct ucb1x00_driver collie_pm_ucb_driver = {
246 .add = collie_pm_ucb_add,
247};
248
249static struct platform_device *collie_pm_device;
250
251static int __init collie_pm_init(void)
252{
253 int ret;
254
255 collie_pm_device = platform_device_alloc("sharpsl-pm", -1);
256 if (!collie_pm_device)
257 return -ENOMEM;
258
259 collie_pm_device->dev.platform_data = &collie_pm_machinfo;
260 ret = platform_device_add(collie_pm_device);
261
262 if (ret)
263 platform_device_put(collie_pm_device);
264
265 if (!ret)
266 ret = ucb1x00_register_driver(&collie_pm_ucb_driver);
267
268 return ret;
269}
270
271static void __exit collie_pm_exit(void)
272{
273 ucb1x00_unregister_driver(&collie_pm_ucb_driver);
274 platform_device_unregister(collie_pm_device);
275}
276
277module_init(collie_pm_init);
278module_exit(collie_pm_exit);
diff --git a/arch/arm/mach-sa1100/cpu-sa1100.c b/arch/arm/mach-sa1100/cpu-sa1100.c
index 6435b2e48ffa..d68630b74d78 100644
--- a/arch/arm/mach-sa1100/cpu-sa1100.c
+++ b/arch/arm/mach-sa1100/cpu-sa1100.c
@@ -11,7 +11,7 @@
11 * linux-2.4.5-rmk1 11 * linux-2.4.5-rmk1
12 * 12 *
13 * This software has been developed while working on the LART 13 * This software has been developed while working on the LART
14 * computing board (http://www.lart.tudelft.nl/), which is 14 * computing board (http://www.lartmaker.nl/), which is
15 * sponsored by the Mobile Multi-media Communications 15 * sponsored by the Mobile Multi-media Communications
16 * (http://www.mmc.tudelft.nl/) and Ubiquitous Communications 16 * (http://www.mmc.tudelft.nl/) and Ubiquitous Communications
17 * (http://www.ubicom.tudelft.nl/) projects. 17 * (http://www.ubicom.tudelft.nl/) projects.
diff --git a/arch/arm/mach-sa1100/generic.c b/arch/arm/mach-sa1100/generic.c
index 2abdc419e984..9ea71551fc04 100644
--- a/arch/arm/mach-sa1100/generic.c
+++ b/arch/arm/mach-sa1100/generic.c
@@ -324,6 +324,11 @@ void sa11x0_set_irda_data(struct irda_platform_data *irda)
324 sa11x0ir_device.dev.platform_data = irda; 324 sa11x0ir_device.dev.platform_data = irda;
325} 325}
326 326
327static struct platform_device sa11x0rtc_device = {
328 .name = "sa1100-rtc",
329 .id = -1,
330};
331
327static struct platform_device *sa11x0_devices[] __initdata = { 332static struct platform_device *sa11x0_devices[] __initdata = {
328 &sa11x0udc_device, 333 &sa11x0udc_device,
329 &sa11x0uart1_device, 334 &sa11x0uart1_device,
@@ -333,6 +338,7 @@ static struct platform_device *sa11x0_devices[] __initdata = {
333 &sa11x0pcmcia_device, 338 &sa11x0pcmcia_device,
334 &sa11x0fb_device, 339 &sa11x0fb_device,
335 &sa11x0mtd_device, 340 &sa11x0mtd_device,
341 &sa11x0rtc_device,
336}; 342};
337 343
338static int __init sa1100_init(void) 344static int __init sa1100_init(void)
diff --git a/arch/arm/mach-versatile/core.c b/arch/arm/mach-versatile/core.c
index 9ebbe808b41d..799697d32dec 100644
--- a/arch/arm/mach-versatile/core.c
+++ b/arch/arm/mach-versatile/core.c
@@ -112,7 +112,7 @@ void __init versatile_init_irq(void)
112{ 112{
113 unsigned int i; 113 unsigned int i;
114 114
115 vic_init(VA_VIC_BASE, ~(1 << 31)); 115 vic_init(VA_VIC_BASE, IRQ_VIC_START, ~(1 << 31));
116 116
117 set_irq_handler(IRQ_VICSOURCE31, sic_handle_irq); 117 set_irq_handler(IRQ_VICSOURCE31, sic_handle_irq);
118 enable_irq(IRQ_VICSOURCE31); 118 enable_irq(IRQ_VICSOURCE31);
diff --git a/arch/arm/mm/Kconfig b/arch/arm/mm/Kconfig
index 3b79d0e23455..c55b739e10ba 100644
--- a/arch/arm/mm/Kconfig
+++ b/arch/arm/mm/Kconfig
@@ -62,7 +62,7 @@ config CPU_ARM720T
62# ARM920T 62# ARM920T
63config CPU_ARM920T 63config CPU_ARM920T
64 bool "Support ARM920T processor" if !ARCH_S3C2410 64 bool "Support ARM920T processor" if !ARCH_S3C2410
65 depends on ARCH_INTEGRATOR || ARCH_S3C2410 || ARCH_IMX || ARCH_AAEC2000 || ARCH_AT91RM9200 65 depends on ARCH_EP93XX || ARCH_INTEGRATOR || ARCH_S3C2410 || ARCH_IMX || ARCH_AAEC2000 || ARCH_AT91RM9200
66 default y if ARCH_S3C2410 || ARCH_AT91RM9200 66 default y if ARCH_S3C2410 || ARCH_AT91RM9200
67 select CPU_32v4 67 select CPU_32v4
68 select CPU_ABRT_EV4T 68 select CPU_ABRT_EV4T
@@ -239,6 +239,17 @@ config CPU_XSCALE
239 select CPU_CACHE_VIVT 239 select CPU_CACHE_VIVT
240 select CPU_TLB_V4WBI 240 select CPU_TLB_V4WBI
241 241
242# XScale Core Version 3
243config CPU_XSC3
244 bool
245 depends on ARCH_IXP23XX
246 default y
247 select CPU_32v5
248 select CPU_ABRT_EV5T
249 select CPU_CACHE_VIVT
250 select CPU_TLB_V4WBI
251 select IO_36
252
242# ARMv6 253# ARMv6
243config CPU_V6 254config CPU_V6
244 bool "Support ARM V6 processor" 255 bool "Support ARM V6 processor"
@@ -266,12 +277,18 @@ config CPU_32v6K
266# This defines the compiler instruction set which depends on the machine type. 277# This defines the compiler instruction set which depends on the machine type.
267config CPU_32v3 278config CPU_32v3
268 bool 279 bool
280 select TLS_REG_EMUL if SMP
281 select NEEDS_SYSCALL_FOR_CMPXCHG if SMP
269 282
270config CPU_32v4 283config CPU_32v4
271 bool 284 bool
285 select TLS_REG_EMUL if SMP
286 select NEEDS_SYSCALL_FOR_CMPXCHG if SMP
272 287
273config CPU_32v5 288config CPU_32v5
274 bool 289 bool
290 select TLS_REG_EMUL if SMP
291 select NEEDS_SYSCALL_FOR_CMPXCHG if SMP
275 292
276config CPU_32v6 293config CPU_32v6
277 bool 294 bool
@@ -355,11 +372,17 @@ config CPU_TLB_V4WBI
355config CPU_TLB_V6 372config CPU_TLB_V6
356 bool 373 bool
357 374
375#
376# CPU supports 36-bit I/O
377#
378config IO_36
379 bool
380
358comment "Processor Features" 381comment "Processor Features"
359 382
360config ARM_THUMB 383config ARM_THUMB
361 bool "Support Thumb user binaries" 384 bool "Support Thumb user binaries"
362 depends on CPU_ARM720T || CPU_ARM920T || CPU_ARM922T || CPU_ARM925T || CPU_ARM926T || CPU_ARM1020 || CPU_ARM1020E || CPU_ARM1022 || CPU_ARM1026 || CPU_XSCALE || CPU_V6 385 depends on CPU_ARM720T || CPU_ARM920T || CPU_ARM922T || CPU_ARM925T || CPU_ARM926T || CPU_ARM1020 || CPU_ARM1020E || CPU_ARM1022 || CPU_ARM1026 || CPU_XSCALE || CPU_XSC3 || CPU_V6
363 default y 386 default y
364 help 387 help
365 Say Y if you want to include kernel support for running user space 388 Say Y if you want to include kernel support for running user space
@@ -417,7 +440,6 @@ config CPU_BPREDICT_DISABLE
417 440
418config TLS_REG_EMUL 441config TLS_REG_EMUL
419 bool 442 bool
420 default y if SMP && (CPU_32v5 || CPU_32v4 || CPU_32v3)
421 help 443 help
422 An SMP system using a pre-ARMv6 processor (there are apparently 444 An SMP system using a pre-ARMv6 processor (there are apparently
423 a few prototypes like that in existence) and therefore access to 445 a few prototypes like that in existence) and therefore access to
@@ -436,7 +458,6 @@ config HAS_TLS_REG
436 458
437config NEEDS_SYSCALL_FOR_CMPXCHG 459config NEEDS_SYSCALL_FOR_CMPXCHG
438 bool 460 bool
439 default y if SMP && (CPU_32v5 || CPU_32v4 || CPU_32v3)
440 help 461 help
441 SMP on a pre-ARMv6 processor? Well OK then. 462 SMP on a pre-ARMv6 processor? Well OK then.
442 Forget about fast user space cmpxchg support. 463 Forget about fast user space cmpxchg support.
diff --git a/arch/arm/mm/Makefile b/arch/arm/mm/Makefile
index ffe73ba2bf17..07a538505784 100644
--- a/arch/arm/mm/Makefile
+++ b/arch/arm/mm/Makefile
@@ -30,6 +30,7 @@ obj-$(CONFIG_CPU_COPY_V4WB) += copypage-v4wb.o
30obj-$(CONFIG_CPU_COPY_V6) += copypage-v6.o mmu.o 30obj-$(CONFIG_CPU_COPY_V6) += copypage-v6.o mmu.o
31obj-$(CONFIG_CPU_SA1100) += copypage-v4mc.o 31obj-$(CONFIG_CPU_SA1100) += copypage-v4mc.o
32obj-$(CONFIG_CPU_XSCALE) += copypage-xscale.o 32obj-$(CONFIG_CPU_XSCALE) += copypage-xscale.o
33obj-$(CONFIG_CPU_XSC3) += copypage-xsc3.o
33 34
34obj-$(CONFIG_CPU_TLB_V3) += tlb-v3.o 35obj-$(CONFIG_CPU_TLB_V3) += tlb-v3.o
35obj-$(CONFIG_CPU_TLB_V4WT) += tlb-v4.o 36obj-$(CONFIG_CPU_TLB_V4WT) += tlb-v4.o
@@ -51,4 +52,5 @@ obj-$(CONFIG_CPU_ARM1026) += proc-arm1026.o
51obj-$(CONFIG_CPU_SA110) += proc-sa110.o 52obj-$(CONFIG_CPU_SA110) += proc-sa110.o
52obj-$(CONFIG_CPU_SA1100) += proc-sa1100.o 53obj-$(CONFIG_CPU_SA1100) += proc-sa1100.o
53obj-$(CONFIG_CPU_XSCALE) += proc-xscale.o 54obj-$(CONFIG_CPU_XSCALE) += proc-xscale.o
55obj-$(CONFIG_CPU_XSC3) += proc-xsc3.o
54obj-$(CONFIG_CPU_V6) += proc-v6.o 56obj-$(CONFIG_CPU_V6) += proc-v6.o
diff --git a/arch/arm/mm/consistent.c b/arch/arm/mm/consistent.c
index c2ee18d2075e..8a1bfcd50087 100644
--- a/arch/arm/mm/consistent.c
+++ b/arch/arm/mm/consistent.c
@@ -223,6 +223,8 @@ __dma_alloc(struct device *dev, size_t size, dma_addr_t *handle, gfp_t gfp,
223 pte = consistent_pte[idx] + off; 223 pte = consistent_pte[idx] + off;
224 c->vm_pages = page; 224 c->vm_pages = page;
225 225
226 split_page(page, order);
227
226 /* 228 /*
227 * Set the "dma handle" 229 * Set the "dma handle"
228 */ 230 */
@@ -231,7 +233,6 @@ __dma_alloc(struct device *dev, size_t size, dma_addr_t *handle, gfp_t gfp,
231 do { 233 do {
232 BUG_ON(!pte_none(*pte)); 234 BUG_ON(!pte_none(*pte));
233 235
234 set_page_count(page, 1);
235 /* 236 /*
236 * x86 does not mark the pages reserved... 237 * x86 does not mark the pages reserved...
237 */ 238 */
@@ -250,7 +251,6 @@ __dma_alloc(struct device *dev, size_t size, dma_addr_t *handle, gfp_t gfp,
250 * Free the otherwise unused pages. 251 * Free the otherwise unused pages.
251 */ 252 */
252 while (page < end) { 253 while (page < end) {
253 set_page_count(page, 1);
254 __free_page(page); 254 __free_page(page);
255 page++; 255 page++;
256 } 256 }
diff --git a/arch/arm/mm/copypage-xsc3.S b/arch/arm/mm/copypage-xsc3.S
new file mode 100644
index 000000000000..9a2cb4332b4c
--- /dev/null
+++ b/arch/arm/mm/copypage-xsc3.S
@@ -0,0 +1,97 @@
1/*
2 * linux/arch/arm/lib/copypage-xsc3.S
3 *
4 * Copyright (C) 2004 Intel Corp.
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
9 *
10 * Adapted for 3rd gen XScale core, no more mini-dcache
11 * Author: Matt Gilbert (matthew.m.gilbert@intel.com)
12 */
13
14#include <linux/linkage.h>
15#include <linux/init.h>
16#include <asm/asm-offsets.h>
17
18/*
19 * General note:
20 * We don't really want write-allocate cache behaviour for these functions
21 * since that will just eat through 8K of the cache.
22 */
23
24 .text
25 .align 5
26/*
27 * XSC3 optimised copy_user_page
28 * r0 = destination
29 * r1 = source
30 * r2 = virtual user address of ultimate destination page
31 *
32 * The source page may have some clean entries in the cache already, but we
33 * can safely ignore them - break_cow() will flush them out of the cache
34 * if we eventually end up using our copied page.
35 *
36 */
37ENTRY(xsc3_mc_copy_user_page)
38 stmfd sp!, {r4, r5, lr}
39 mov lr, #PAGE_SZ/64-1
40
41 pld [r1, #0]
42 pld [r1, #32]
431: pld [r1, #64]
44 pld [r1, #96]
45
462: ldrd r2, [r1], #8
47 mov ip, r0
48 ldrd r4, [r1], #8
49 mcr p15, 0, ip, c7, c6, 1 @ invalidate
50 strd r2, [r0], #8
51 ldrd r2, [r1], #8
52 strd r4, [r0], #8
53 ldrd r4, [r1], #8
54 strd r2, [r0], #8
55 strd r4, [r0], #8
56 ldrd r2, [r1], #8
57 mov ip, r0
58 ldrd r4, [r1], #8
59 mcr p15, 0, ip, c7, c6, 1 @ invalidate
60 strd r2, [r0], #8
61 ldrd r2, [r1], #8
62 subs lr, lr, #1
63 strd r4, [r0], #8
64 ldrd r4, [r1], #8
65 strd r2, [r0], #8
66 strd r4, [r0], #8
67 bgt 1b
68 beq 2b
69
70 ldmfd sp!, {r4, r5, pc}
71
72 .align 5
73/*
74 * XScale optimised clear_user_page
75 * r0 = destination
76 * r1 = virtual user address of ultimate destination page
77 */
78ENTRY(xsc3_mc_clear_user_page)
79 mov r1, #PAGE_SZ/32
80 mov r2, #0
81 mov r3, #0
821: mcr p15, 0, r0, c7, c6, 1 @ invalidate line
83 strd r2, [r0], #8
84 strd r2, [r0], #8
85 strd r2, [r0], #8
86 strd r2, [r0], #8
87 subs r1, r1, #1
88 bne 1b
89 mov pc, lr
90
91 __INITDATA
92
93 .type xsc3_mc_user_fns, #object
94ENTRY(xsc3_mc_user_fns)
95 .long xsc3_mc_clear_user_page
96 .long xsc3_mc_copy_user_page
97 .size xsc3_mc_user_fns, . - xsc3_mc_user_fns
diff --git a/arch/arm/mm/init.c b/arch/arm/mm/init.c
index 8b276ee38acf..88279124317a 100644
--- a/arch/arm/mm/init.c
+++ b/arch/arm/mm/init.c
@@ -19,7 +19,6 @@
19#include <linux/initrd.h> 19#include <linux/initrd.h>
20 20
21#include <asm/mach-types.h> 21#include <asm/mach-types.h>
22#include <asm/hardware.h>
23#include <asm/setup.h> 22#include <asm/setup.h>
24#include <asm/tlb.h> 23#include <asm/tlb.h>
25 24
@@ -531,7 +530,7 @@ static inline void free_area(unsigned long addr, unsigned long end, char *s)
531 for (; addr < end; addr += PAGE_SIZE) { 530 for (; addr < end; addr += PAGE_SIZE) {
532 struct page *page = virt_to_page(addr); 531 struct page *page = virt_to_page(addr);
533 ClearPageReserved(page); 532 ClearPageReserved(page);
534 set_page_count(page, 1); 533 init_page_count(page);
535 free_page(addr); 534 free_page(addr);
536 totalram_pages++; 535 totalram_pages++;
537 } 536 }
diff --git a/arch/arm/mm/ioremap.c b/arch/arm/mm/ioremap.c
index da9b35974118..25e0ca3e598c 100644
--- a/arch/arm/mm/ioremap.c
+++ b/arch/arm/mm/ioremap.c
@@ -26,7 +26,6 @@
26#include <linux/vmalloc.h> 26#include <linux/vmalloc.h>
27 27
28#include <asm/cacheflush.h> 28#include <asm/cacheflush.h>
29#include <asm/hardware.h>
30#include <asm/io.h> 29#include <asm/io.h>
31#include <asm/tlbflush.h> 30#include <asm/tlbflush.h>
32 31
diff --git a/arch/arm/mm/mm-armv.c b/arch/arm/mm/mm-armv.c
index ef8d30a185a9..5e5d05bcad50 100644
--- a/arch/arm/mm/mm-armv.c
+++ b/arch/arm/mm/mm-armv.c
@@ -557,7 +557,8 @@ void __init create_mapping(struct map_desc *md)
557 * supersections are only allocated for domain 0 regardless 557 * supersections are only allocated for domain 0 regardless
558 * of the actual domain assignments in use. 558 * of the actual domain assignments in use.
559 */ 559 */
560 if (cpu_architecture() >= CPU_ARCH_ARMv6 && domain == 0) { 560 if ((cpu_architecture() >= CPU_ARCH_ARMv6 || cpu_is_xsc3())
561 && domain == 0) {
561 /* 562 /*
562 * Align to supersection boundary if !high pages. 563 * Align to supersection boundary if !high pages.
563 * High pages have already been checked for proper 564 * High pages have already been checked for proper
diff --git a/arch/arm/mm/proc-arm1020.S b/arch/arm/mm/proc-arm1020.S
index 82ec954e45b6..959588884fa5 100644
--- a/arch/arm/mm/proc-arm1020.S
+++ b/arch/arm/mm/proc-arm1020.S
@@ -29,10 +29,10 @@
29#include <linux/init.h> 29#include <linux/init.h>
30#include <asm/assembler.h> 30#include <asm/assembler.h>
31#include <asm/asm-offsets.h> 31#include <asm/asm-offsets.h>
32#include <asm/pgtable-hwdef.h>
32#include <asm/pgtable.h> 33#include <asm/pgtable.h>
33#include <asm/procinfo.h> 34#include <asm/procinfo.h>
34#include <asm/ptrace.h> 35#include <asm/ptrace.h>
35#include <asm/hardware.h>
36 36
37/* 37/*
38 * This is the maximum size of an area which will be invalidated 38 * This is the maximum size of an area which will be invalidated
diff --git a/arch/arm/mm/proc-arm1020e.S b/arch/arm/mm/proc-arm1020e.S
index 7375fe930f72..be6d081ff2b7 100644
--- a/arch/arm/mm/proc-arm1020e.S
+++ b/arch/arm/mm/proc-arm1020e.S
@@ -29,10 +29,10 @@
29#include <linux/init.h> 29#include <linux/init.h>
30#include <asm/assembler.h> 30#include <asm/assembler.h>
31#include <asm/asm-offsets.h> 31#include <asm/asm-offsets.h>
32#include <asm/pgtable-hwdef.h>
32#include <asm/pgtable.h> 33#include <asm/pgtable.h>
33#include <asm/procinfo.h> 34#include <asm/procinfo.h>
34#include <asm/ptrace.h> 35#include <asm/ptrace.h>
35#include <asm/hardware.h>
36 36
37/* 37/*
38 * This is the maximum size of an area which will be invalidated 38 * This is the maximum size of an area which will be invalidated
diff --git a/arch/arm/mm/proc-arm1022.S b/arch/arm/mm/proc-arm1022.S
index 6ca639094d6f..f778545d57a2 100644
--- a/arch/arm/mm/proc-arm1022.S
+++ b/arch/arm/mm/proc-arm1022.S
@@ -18,6 +18,7 @@
18#include <linux/init.h> 18#include <linux/init.h>
19#include <asm/assembler.h> 19#include <asm/assembler.h>
20#include <asm/asm-offsets.h> 20#include <asm/asm-offsets.h>
21#include <asm/pgtable-hwdef.h>
21#include <asm/pgtable.h> 22#include <asm/pgtable.h>
22#include <asm/procinfo.h> 23#include <asm/procinfo.h>
23#include <asm/ptrace.h> 24#include <asm/ptrace.h>
diff --git a/arch/arm/mm/proc-arm1026.S b/arch/arm/mm/proc-arm1026.S
index 10317e4f55d2..148c111fde73 100644
--- a/arch/arm/mm/proc-arm1026.S
+++ b/arch/arm/mm/proc-arm1026.S
@@ -18,6 +18,7 @@
18#include <linux/init.h> 18#include <linux/init.h>
19#include <asm/assembler.h> 19#include <asm/assembler.h>
20#include <asm/asm-offsets.h> 20#include <asm/asm-offsets.h>
21#include <asm/pgtable-hwdef.h>
21#include <asm/pgtable.h> 22#include <asm/pgtable.h>
22#include <asm/procinfo.h> 23#include <asm/procinfo.h>
23#include <asm/ptrace.h> 24#include <asm/ptrace.h>
diff --git a/arch/arm/mm/proc-arm6_7.S b/arch/arm/mm/proc-arm6_7.S
index 8e7e1e70ab05..540359b475d0 100644
--- a/arch/arm/mm/proc-arm6_7.S
+++ b/arch/arm/mm/proc-arm6_7.S
@@ -14,6 +14,7 @@
14#include <linux/init.h> 14#include <linux/init.h>
15#include <asm/assembler.h> 15#include <asm/assembler.h>
16#include <asm/asm-offsets.h> 16#include <asm/asm-offsets.h>
17#include <asm/pgtable-hwdef.h>
17#include <asm/pgtable.h> 18#include <asm/pgtable.h>
18#include <asm/procinfo.h> 19#include <asm/procinfo.h>
19#include <asm/ptrace.h> 20#include <asm/ptrace.h>
diff --git a/arch/arm/mm/proc-arm720.S b/arch/arm/mm/proc-arm720.S
index a13e0184d343..26f00ee2ad9a 100644
--- a/arch/arm/mm/proc-arm720.S
+++ b/arch/arm/mm/proc-arm720.S
@@ -34,10 +34,10 @@
34#include <linux/init.h> 34#include <linux/init.h>
35#include <asm/assembler.h> 35#include <asm/assembler.h>
36#include <asm/asm-offsets.h> 36#include <asm/asm-offsets.h>
37#include <asm/pgtable-hwdef.h>
37#include <asm/pgtable.h> 38#include <asm/pgtable.h>
38#include <asm/procinfo.h> 39#include <asm/procinfo.h>
39#include <asm/ptrace.h> 40#include <asm/ptrace.h>
40#include <asm/hardware.h>
41 41
42/* 42/*
43 * Function: arm720_proc_init (void) 43 * Function: arm720_proc_init (void)
diff --git a/arch/arm/mm/proc-arm920.S b/arch/arm/mm/proc-arm920.S
index d16513899999..a17f79e0199c 100644
--- a/arch/arm/mm/proc-arm920.S
+++ b/arch/arm/mm/proc-arm920.S
@@ -28,9 +28,9 @@
28#include <linux/config.h> 28#include <linux/config.h>
29#include <linux/init.h> 29#include <linux/init.h>
30#include <asm/assembler.h> 30#include <asm/assembler.h>
31#include <asm/pgtable-hwdef.h>
31#include <asm/pgtable.h> 32#include <asm/pgtable.h>
32#include <asm/procinfo.h> 33#include <asm/procinfo.h>
33#include <asm/hardware.h>
34#include <asm/page.h> 34#include <asm/page.h>
35#include <asm/ptrace.h> 35#include <asm/ptrace.h>
36#include "proc-macros.S" 36#include "proc-macros.S"
diff --git a/arch/arm/mm/proc-arm922.S b/arch/arm/mm/proc-arm922.S
index 23b8ed97f4e3..bbde4a024a48 100644
--- a/arch/arm/mm/proc-arm922.S
+++ b/arch/arm/mm/proc-arm922.S
@@ -29,9 +29,9 @@
29#include <linux/config.h> 29#include <linux/config.h>
30#include <linux/init.h> 30#include <linux/init.h>
31#include <asm/assembler.h> 31#include <asm/assembler.h>
32#include <asm/pgtable-hwdef.h>
32#include <asm/pgtable.h> 33#include <asm/pgtable.h>
33#include <asm/procinfo.h> 34#include <asm/procinfo.h>
34#include <asm/hardware.h>
35#include <asm/page.h> 35#include <asm/page.h>
36#include <asm/ptrace.h> 36#include <asm/ptrace.h>
37#include "proc-macros.S" 37#include "proc-macros.S"
diff --git a/arch/arm/mm/proc-arm925.S b/arch/arm/mm/proc-arm925.S
index ee95c52db513..224ce226a01b 100644
--- a/arch/arm/mm/proc-arm925.S
+++ b/arch/arm/mm/proc-arm925.S
@@ -51,9 +51,9 @@
51#include <linux/config.h> 51#include <linux/config.h>
52#include <linux/init.h> 52#include <linux/init.h>
53#include <asm/assembler.h> 53#include <asm/assembler.h>
54#include <asm/pgtable-hwdef.h>
54#include <asm/pgtable.h> 55#include <asm/pgtable.h>
55#include <asm/procinfo.h> 56#include <asm/procinfo.h>
56#include <asm/hardware.h>
57#include <asm/page.h> 57#include <asm/page.h>
58#include <asm/ptrace.h> 58#include <asm/ptrace.h>
59#include "proc-macros.S" 59#include "proc-macros.S"
diff --git a/arch/arm/mm/proc-arm926.S b/arch/arm/mm/proc-arm926.S
index 7d042dc20c47..4e2a087cf388 100644
--- a/arch/arm/mm/proc-arm926.S
+++ b/arch/arm/mm/proc-arm926.S
@@ -28,9 +28,9 @@
28#include <linux/config.h> 28#include <linux/config.h>
29#include <linux/init.h> 29#include <linux/init.h>
30#include <asm/assembler.h> 30#include <asm/assembler.h>
31#include <asm/pgtable-hwdef.h>
31#include <asm/pgtable.h> 32#include <asm/pgtable.h>
32#include <asm/procinfo.h> 33#include <asm/procinfo.h>
33#include <asm/hardware.h>
34#include <asm/page.h> 34#include <asm/page.h>
35#include <asm/ptrace.h> 35#include <asm/ptrace.h>
36#include "proc-macros.S" 36#include "proc-macros.S"
diff --git a/arch/arm/mm/proc-sa110.S b/arch/arm/mm/proc-sa110.S
index bd330c4075a1..c916a6cae404 100644
--- a/arch/arm/mm/proc-sa110.S
+++ b/arch/arm/mm/proc-sa110.S
@@ -18,6 +18,7 @@
18#include <asm/asm-offsets.h> 18#include <asm/asm-offsets.h>
19#include <asm/procinfo.h> 19#include <asm/procinfo.h>
20#include <asm/hardware.h> 20#include <asm/hardware.h>
21#include <asm/pgtable-hwdef.h>
21#include <asm/pgtable.h> 22#include <asm/pgtable.h>
22#include <asm/ptrace.h> 23#include <asm/ptrace.h>
23 24
diff --git a/arch/arm/mm/proc-sa1100.S b/arch/arm/mm/proc-sa1100.S
index 91b89124c0d7..41f21f2dd8ff 100644
--- a/arch/arm/mm/proc-sa1100.S
+++ b/arch/arm/mm/proc-sa1100.S
@@ -23,6 +23,7 @@
23#include <asm/asm-offsets.h> 23#include <asm/asm-offsets.h>
24#include <asm/procinfo.h> 24#include <asm/procinfo.h>
25#include <asm/hardware.h> 25#include <asm/hardware.h>
26#include <asm/pgtable-hwdef.h>
26#include <asm/pgtable.h> 27#include <asm/pgtable.h>
27 28
28/* 29/*
diff --git a/arch/arm/mm/proc-v6.S b/arch/arm/mm/proc-v6.S
index 92f3ca31b7b9..ee6f15298735 100644
--- a/arch/arm/mm/proc-v6.S
+++ b/arch/arm/mm/proc-v6.S
@@ -14,12 +14,21 @@
14#include <asm/asm-offsets.h> 14#include <asm/asm-offsets.h>
15#include <asm/hardware/arm_scu.h> 15#include <asm/hardware/arm_scu.h>
16#include <asm/procinfo.h> 16#include <asm/procinfo.h>
17#include <asm/pgtable-hwdef.h>
17#include <asm/pgtable.h> 18#include <asm/pgtable.h>
18 19
19#include "proc-macros.S" 20#include "proc-macros.S"
20 21
21#define D_CACHE_LINE_SIZE 32 22#define D_CACHE_LINE_SIZE 32
22 23
24#define TTB_C (1 << 0)
25#define TTB_S (1 << 1)
26#define TTB_IMP (1 << 2)
27#define TTB_RGN_NC (0 << 3)
28#define TTB_RGN_WBWA (1 << 3)
29#define TTB_RGN_WT (2 << 3)
30#define TTB_RGN_WB (3 << 3)
31
23 .macro cpsie, flags 32 .macro cpsie, flags
24 .ifc \flags, f 33 .ifc \flags, f
25 .long 0xf1080040 34 .long 0xf1080040
@@ -114,7 +123,7 @@ ENTRY(cpu_v6_switch_mm)
114 mov r2, #0 123 mov r2, #0
115 ldr r1, [r1, #MM_CONTEXT_ID] @ get mm->context.id 124 ldr r1, [r1, #MM_CONTEXT_ID] @ get mm->context.id
116#ifdef CONFIG_SMP 125#ifdef CONFIG_SMP
117 orr r0, r0, #2 @ set shared pgtable 126 orr r0, r0, #TTB_RGN_WBWA|TTB_S @ mark PTWs shared, outer cacheable
118#endif 127#endif
119 mcr p15, 0, r2, c7, c5, 6 @ flush BTAC/BTB 128 mcr p15, 0, r2, c7, c5, 6 @ flush BTAC/BTB
120 mcr p15, 0, r2, c7, c10, 4 @ drain write buffer 129 mcr p15, 0, r2, c7, c10, 4 @ drain write buffer
@@ -160,8 +169,8 @@ ENTRY(cpu_v6_set_pte)
160 tst r1, #L_PTE_YOUNG 169 tst r1, #L_PTE_YOUNG
161 biceq r2, r2, #PTE_EXT_APX | PTE_EXT_AP_MASK 170 biceq r2, r2, #PTE_EXT_APX | PTE_EXT_AP_MASK
162 171
163@ tst r1, #L_PTE_EXEC 172 tst r1, #L_PTE_EXEC
164@ orreq r2, r2, #PTE_EXT_XN 173 orreq r2, r2, #PTE_EXT_XN
165 174
166 tst r1, #L_PTE_PRESENT 175 tst r1, #L_PTE_PRESENT
167 moveq r2, #0 176 moveq r2, #0
@@ -220,7 +229,7 @@ __v6_setup:
220 mcr p15, 0, r0, c8, c7, 0 @ invalidate I + D TLBs 229 mcr p15, 0, r0, c8, c7, 0 @ invalidate I + D TLBs
221 mcr p15, 0, r0, c2, c0, 2 @ TTB control register 230 mcr p15, 0, r0, c2, c0, 2 @ TTB control register
222#ifdef CONFIG_SMP 231#ifdef CONFIG_SMP
223 orr r4, r4, #2 @ set shared pgtable 232 orr r4, r4, #TTB_RGN_WBWA|TTB_S @ mark PTWs shared, outer cacheable
224#endif 233#endif
225 mcr p15, 0, r4, c2, c0, 1 @ load TTB1 234 mcr p15, 0, r4, c2, c0, 1 @ load TTB1
226#ifdef CONFIG_VFP 235#ifdef CONFIG_VFP
diff --git a/arch/arm/mm/proc-xsc3.S b/arch/arm/mm/proc-xsc3.S
new file mode 100644
index 000000000000..b9dfce57c272
--- /dev/null
+++ b/arch/arm/mm/proc-xsc3.S
@@ -0,0 +1,499 @@
1/*
2 * linux/arch/arm/mm/proc-xsc3.S
3 *
4 * Original Author: Matthew Gilbert
5 * Current Maintainer: Deepak Saxena <dsaxena@plexity.net>
6 *
7 * Copyright 2004 (C) Intel Corp.
8 * Copyright 2005 (c) MontaVista Software, Inc.
9 *
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License version 2 as
12 * published by the Free Software Foundation.
13 *
14 * MMU functions for the Intel XScale3 Core (XSC3). The XSC3 core is an
15 * extension to Intel's original XScale core that adds the following
16 * features:
17 *
18 * - ARMv6 Supersections
19 * - Low Locality Reference pages (replaces mini-cache)
20 * - 36-bit addressing
21 * - L2 cache
22 * - Cache-coherency if chipset supports it
23 *
24 * Based on orignal XScale code by Nicolas Pitre
25 */
26
27#include <linux/linkage.h>
28#include <linux/init.h>
29#include <asm/assembler.h>
30#include <asm/procinfo.h>
31#include <asm/hardware.h>
32#include <asm/pgtable.h>
33#include <asm/pgtable-hwdef.h>
34#include <asm/page.h>
35#include <asm/ptrace.h>
36#include "proc-macros.S"
37
38/*
39 * This is the maximum size of an area which will be flushed. If the
40 * area is larger than this, then we flush the whole cache.
41 */
42#define MAX_AREA_SIZE 32768
43
44/*
45 * The cache line size of the I and D cache.
46 */
47#define CACHELINESIZE 32
48
49/*
50 * The size of the data cache.
51 */
52#define CACHESIZE 32768
53
54/*
55 * Run with L2 enabled.
56 */
57#define L2_CACHE_ENABLE 1
58
59/*
60 * Enable the Branch Target Buffer (can cause crashes, see erratum #42.)
61 */
62#define BTB_ENABLE 0
63
64/*
65 * This macro is used to wait for a CP15 write and is needed
66 * when we have to ensure that the last operation to the co-pro
67 * was completed before continuing with operation.
68 */
69 .macro cpwait_ret, lr, rd
70 mrc p15, 0, \rd, c2, c0, 0 @ arbitrary read of cp15
71 sub pc, \lr, \rd, LSR #32 @ wait for completion and
72 @ flush instruction pipeline
73 .endm
74
75/*
76 * This macro cleans & invalidates the entire xsc3 dcache by set & way.
77 */
78
79 .macro clean_d_cache rd, rs
80 mov \rd, #0x1f00
81 orr \rd, \rd, #0x00e0
821: mcr p15, 0, \rd, c7, c14, 2 @ clean/inv set/way
83 adds \rd, \rd, #0x40000000
84 bcc 1b
85 subs \rd, \rd, #0x20
86 bpl 1b
87 .endm
88
89 .text
90
91/*
92 * cpu_xsc3_proc_init()
93 *
94 * Nothing too exciting at the moment
95 */
96ENTRY(cpu_xsc3_proc_init)
97 mov pc, lr
98
99/*
100 * cpu_xsc3_proc_fin()
101 */
102ENTRY(cpu_xsc3_proc_fin)
103 str lr, [sp, #-4]!
104 mov r0, #PSR_F_BIT|PSR_I_BIT|SVC_MODE
105 msr cpsr_c, r0
106 bl xsc3_flush_kern_cache_all @ clean caches
107 mrc p15, 0, r0, c1, c0, 0 @ ctrl register
108 bic r0, r0, #0x1800 @ ...IZ...........
109 bic r0, r0, #0x0006 @ .............CA.
110 mcr p15, 0, r0, c1, c0, 0 @ disable caches
111 ldr pc, [sp], #4
112
113/*
114 * cpu_xsc3_reset(loc)
115 *
116 * Perform a soft reset of the system. Put the CPU into the
117 * same state as it would be if it had been reset, and branch
118 * to what would be the reset vector.
119 *
120 * loc: location to jump to for soft reset
121 */
122 .align 5
123ENTRY(cpu_xsc3_reset)
124 mov r1, #PSR_F_BIT|PSR_I_BIT|SVC_MODE
125 msr cpsr_c, r1 @ reset CPSR
126 mrc p15, 0, r1, c1, c0, 0 @ ctrl register
127 bic r1, r1, #0x0086 @ ........B....CA.
128 bic r1, r1, #0x3900 @ ..VIZ..S........
129 mcr p15, 0, r1, c1, c0, 0 @ ctrl register
130 mcr p15, 0, ip, c7, c7, 0 @ invalidate I,D caches & BTB
131 bic r1, r1, #0x0001 @ ...............M
132 mcr p15, 0, r1, c1, c0, 0 @ ctrl register
133 @ CAUTION: MMU turned off from this point. We count on the pipeline
134 @ already containing those two last instructions to survive.
135 mcr p15, 0, ip, c8, c7, 0 @ invalidate I & D TLBs
136 mov pc, r0
137
138/*
139 * cpu_xsc3_do_idle()
140 *
141 * Cause the processor to idle
142 *
143 * For now we do nothing but go to idle mode for every case
144 *
145 * XScale supports clock switching, but using idle mode support
146 * allows external hardware to react to system state changes.
147
148 MMG: Come back to this one.
149 */
150 .align 5
151
152ENTRY(cpu_xsc3_do_idle)
153 mov r0, #1
154 mcr p14, 0, r0, c7, c0, 0 @ Go to IDLE
155 mov pc, lr
156
157/* ================================= CACHE ================================ */
158
159/*
160 * flush_user_cache_all()
161 *
162 * Invalidate all cache entries in a particular address
163 * space.
164 */
165ENTRY(xsc3_flush_user_cache_all)
166 /* FALLTHROUGH */
167
168/*
169 * flush_kern_cache_all()
170 *
171 * Clean and invalidate the entire cache.
172 */
173ENTRY(xsc3_flush_kern_cache_all)
174 mov r2, #VM_EXEC
175 mov ip, #0
176__flush_whole_cache:
177 clean_d_cache r0, r1
178 tst r2, #VM_EXEC
179 mcrne p15, 0, ip, c7, c5, 0 @ Invalidate I cache & BTB
180 mcrne p15, 0, ip, c7, c10, 4 @ Drain Write Buffer
181 mcrne p15, 0, ip, c7, c5, 4 @ Prefetch Flush
182 mov pc, lr
183
184/*
185 * flush_user_cache_range(start, end, vm_flags)
186 *
187 * Invalidate a range of cache entries in the specified
188 * address space.
189 *
190 * - start - start address (may not be aligned)
191 * - end - end address (exclusive, may not be aligned)
192 * - vma - vma_area_struct describing address space
193 */
194 .align 5
195ENTRY(xsc3_flush_user_cache_range)
196 mov ip, #0
197 sub r3, r1, r0 @ calculate total size
198 cmp r3, #MAX_AREA_SIZE
199 bhs __flush_whole_cache
200
2011: tst r2, #VM_EXEC
202 mcrne p15, 0, r0, c7, c5, 1 @ Invalidate I cache line
203 mcr p15, 0, r0, c7, c14, 1 @ Clean/invalidate D cache line
204 add r0, r0, #CACHELINESIZE
205 cmp r0, r1
206 blo 1b
207 tst r2, #VM_EXEC
208 mcrne p15, 0, ip, c7, c5, 6 @ Invalidate BTB
209 mcrne p15, 0, ip, c7, c10, 4 @ Drain Write Buffer
210 mcrne p15, 0, ip, c7, c5, 4 @ Prefetch Flush
211 mov pc, lr
212
213/*
214 * coherent_kern_range(start, end)
215 *
216 * Ensure coherency between the Icache and the Dcache in the
217 * region described by start. If you have non-snooping
218 * Harvard caches, you need to implement this function.
219 *
220 * - start - virtual start address
221 * - end - virtual end address
222 *
223 * Note: single I-cache line invalidation isn't used here since
224 * it also trashes the mini I-cache used by JTAG debuggers.
225 */
226ENTRY(xsc3_coherent_kern_range)
227/* FALLTHROUGH */
228ENTRY(xsc3_coherent_user_range)
229 bic r0, r0, #CACHELINESIZE - 1
2301: mcr p15, 0, r0, c7, c10, 1 @ clean D entry
231 add r0, r0, #CACHELINESIZE
232 cmp r0, r1
233 blo 1b
234 mov r0, #0
235 mcr p15, 0, r0, c7, c5, 0 @ Invalidate I cache & BTB
236 mcr p15, 0, r0, c7, c10, 4 @ Drain Write Buffer
237 mcr p15, 0, r0, c7, c5, 4 @ Prefetch Flush
238 mov pc, lr
239
240/*
241 * flush_kern_dcache_page(void *page)
242 *
243 * Ensure no D cache aliasing occurs, either with itself or
244 * the I cache
245 *
246 * - addr - page aligned address
247 */
248ENTRY(xsc3_flush_kern_dcache_page)
249 add r1, r0, #PAGE_SZ
2501: mcr p15, 0, r0, c7, c14, 1 @ Clean/Invalidate D Cache line
251 add r0, r0, #CACHELINESIZE
252 cmp r0, r1
253 blo 1b
254 mov r0, #0
255 mcr p15, 0, r0, c7, c5, 0 @ Invalidate I cache & BTB
256 mcr p15, 0, r0, c7, c10, 4 @ Drain Write Buffer
257 mcr p15, 0, r0, c7, c5, 4 @ Prefetch Flush
258 mov pc, lr
259
260/*
261 * dma_inv_range(start, end)
262 *
263 * Invalidate (discard) the specified virtual address range.
264 * May not write back any entries. If 'start' or 'end'
265 * are not cache line aligned, those lines must be written
266 * back.
267 *
268 * - start - virtual start address
269 * - end - virtual end address
270 */
271ENTRY(xsc3_dma_inv_range)
272 tst r0, #CACHELINESIZE - 1
273 bic r0, r0, #CACHELINESIZE - 1
274 mcrne p15, 0, r0, c7, c10, 1 @ clean L1 D entry
275 mcrne p15, 1, r0, c7, c11, 1 @ clean L2 D entry
276 tst r1, #CACHELINESIZE - 1
277 mcrne p15, 0, r1, c7, c10, 1 @ clean L1 D entry
278 mcrne p15, 1, r1, c7, c11, 1 @ clean L2 D entry
2791: mcr p15, 0, r0, c7, c6, 1 @ invalidate L1 D entry
280 mcr p15, 1, r0, c7, c7, 1 @ Invalidate L2 D cache line
281 add r0, r0, #CACHELINESIZE
282 cmp r0, r1
283 blo 1b
284 mcr p15, 0, r0, c7, c10, 4 @ Drain Write Buffer
285 mov pc, lr
286
287/*
288 * dma_clean_range(start, end)
289 *
290 * Clean the specified virtual address range.
291 *
292 * - start - virtual start address
293 * - end - virtual end address
294 */
295ENTRY(xsc3_dma_clean_range)
296 bic r0, r0, #CACHELINESIZE - 1
2971: mcr p15, 0, r0, c7, c10, 1 @ clean L1 D entry
298 mcr p15, 1, r0, c7, c11, 1 @ clean L2 D entry
299 add r0, r0, #CACHELINESIZE
300 cmp r0, r1
301 blo 1b
302 mcr p15, 0, r0, c7, c10, 4 @ Drain Write Buffer
303 mov pc, lr
304
305/*
306 * dma_flush_range(start, end)
307 *
308 * Clean and invalidate the specified virtual address range.
309 *
310 * - start - virtual start address
311 * - end - virtual end address
312 */
313ENTRY(xsc3_dma_flush_range)
314 bic r0, r0, #CACHELINESIZE - 1
3151: mcr p15, 0, r0, c7, c14, 1 @ Clean/invalidate L1 D cache line
316 mcr p15, 1, r0, c7, c11, 1 @ Clean L2 D cache line
317 mcr p15, 1, r0, c7, c7, 1 @ Invalidate L2 D cache line
318 add r0, r0, #CACHELINESIZE
319 cmp r0, r1
320 blo 1b
321 mcr p15, 0, r0, c7, c10, 4 @ Drain Write Buffer
322 mov pc, lr
323
324ENTRY(xsc3_cache_fns)
325 .long xsc3_flush_kern_cache_all
326 .long xsc3_flush_user_cache_all
327 .long xsc3_flush_user_cache_range
328 .long xsc3_coherent_kern_range
329 .long xsc3_coherent_user_range
330 .long xsc3_flush_kern_dcache_page
331 .long xsc3_dma_inv_range
332 .long xsc3_dma_clean_range
333 .long xsc3_dma_flush_range
334
335ENTRY(cpu_xsc3_dcache_clean_area)
3361: mcr p15, 0, r0, c7, c10, 1 @ clean D entry
337 add r0, r0, #CACHELINESIZE
338 subs r1, r1, #CACHELINESIZE
339 bhi 1b
340 mov pc, lr
341
342/* =============================== PageTable ============================== */
343
344/*
345 * cpu_xsc3_switch_mm(pgd)
346 *
347 * Set the translation base pointer to be as described by pgd.
348 *
349 * pgd: new page tables
350 */
351 .align 5
352ENTRY(cpu_xsc3_switch_mm)
353 clean_d_cache r1, r2
354 mcr p15, 0, ip, c7, c5, 0 @ Invalidate I cache & BTB
355 mcr p15, 0, ip, c7, c10, 4 @ Drain Write Buffer
356 mcr p15, 0, ip, c7, c5, 4 @ Prefetch Flush
357#ifdef L2_CACHE_ENABLE
358 orr r0, r0, #0x18 @ cache the page table in L2
359#endif
360 mcr p15, 0, r0, c2, c0, 0 @ load page table pointer
361 mcr p15, 0, ip, c8, c7, 0 @ invalidate I & D TLBs
362 cpwait_ret lr, ip
363
364/*
365 * cpu_xsc3_set_pte(ptep, pte)
366 *
367 * Set a PTE and flush it out
368 *
369 */
370 .align 5
371ENTRY(cpu_xsc3_set_pte)
372 str r1, [r0], #-2048 @ linux version
373
374 bic r2, r1, #0xff0
375 orr r2, r2, #PTE_TYPE_EXT @ extended page
376
377 eor r3, r1, #L_PTE_PRESENT | L_PTE_YOUNG | L_PTE_WRITE | L_PTE_DIRTY
378
379 tst r3, #L_PTE_USER @ User?
380 orrne r2, r2, #PTE_EXT_AP_URO_SRW @ yes -> user r/o, system r/w
381
382 tst r3, #L_PTE_WRITE | L_PTE_DIRTY @ Write and Dirty?
383 orreq r2, r2, #PTE_EXT_AP_UNO_SRW @ yes -> user n/a, system r/w
384 @ combined with user -> user r/w
385
386#if L2_CACHE_ENABLE
387 @ If its cacheable it needs to be in L2 also.
388 eor ip, r1, #L_PTE_CACHEABLE
389 tst ip, #L_PTE_CACHEABLE
390 orreq r2, r2, #PTE_EXT_TEX(0x5)
391#endif
392
393 tst r3, #L_PTE_PRESENT | L_PTE_YOUNG @ Present and Young?
394 movne r2, #0 @ no -> fault
395
396 str r2, [r0] @ hardware version
397 mov ip, #0
398 mcr p15, 0, r0, c7, c10, 1 @ Clean D cache line mcr
399 mcr p15, 0, ip, c7, c10, 4 @ Drain Write Buffer
400 mov pc, lr
401
402 .ltorg
403
404 .align
405
406 __INIT
407
408 .type __xsc3_setup, #function
409__xsc3_setup:
410 mov r0, #PSR_F_BIT|PSR_I_BIT|SVC_MODE
411 msr cpsr_c, r0
412 mcr p15, 0, ip, c7, c7, 0 @ invalidate I, D caches & BTB
413 mcr p15, 0, ip, c7, c10, 4 @ Drain Write Buffer
414 mcr p15, 0, ip, c7, c5, 4 @ Prefetch Flush
415 mcr p15, 0, ip, c8, c7, 0 @ invalidate I, D TLBs
416#if L2_CACHE_ENABLE
417 orr r4, r4, #0x18 @ cache the page table in L2
418#endif
419 mcr p15, 0, r4, c2, c0, 0 @ load page table pointer
420 mov r0, #1 @ Allow access to CP0 and CP13
421 orr r0, r0, #1 << 13 @ Its undefined whether this
422 mcr p15, 0, r0, c15, c1, 0 @ affects USR or SVC modes
423 mrc p15, 0, r0, c1, c0, 1 @ get auxiliary control reg
424 and r0, r0, #2 @ preserve bit P bit setting
425#if L2_CACHE_ENABLE
426 orr r0, r0, #(1 << 10) @ enable L2 for LLR cache
427#endif
428 mcr p15, 0, r0, c1, c0, 1 @ set auxiliary control reg
429 mrc p15, 0, r0, c1, c0, 0 @ get control register
430 bic r0, r0, #0x0200 @ .... ..R. .... ....
431 bic r0, r0, #0x0002 @ .... .... .... ..A.
432 orr r0, r0, #0x0005 @ .... .... .... .C.M
433#if BTB_ENABLE
434 orr r0, r0, #0x3900 @ ..VI Z..S .... ....
435#else
436 orr r0, r0, #0x3100 @ ..VI ...S .... ....
437#endif
438#if L2_CACHE_ENABLE
439 orr r0, r0, #0x4000000 @ L2 enable
440#endif
441 mov pc, lr
442
443 .size __xsc3_setup, . - __xsc3_setup
444
445 __INITDATA
446
447/*
448 * Purpose : Function pointers used to access above functions - all calls
449 * come through these
450 */
451
452 .type xsc3_processor_functions, #object
453ENTRY(xsc3_processor_functions)
454 .word v5t_early_abort
455 .word cpu_xsc3_proc_init
456 .word cpu_xsc3_proc_fin
457 .word cpu_xsc3_reset
458 .word cpu_xsc3_do_idle
459 .word cpu_xsc3_dcache_clean_area
460 .word cpu_xsc3_switch_mm
461 .word cpu_xsc3_set_pte
462 .size xsc3_processor_functions, . - xsc3_processor_functions
463
464 .section ".rodata"
465
466 .type cpu_arch_name, #object
467cpu_arch_name:
468 .asciz "armv5te"
469 .size cpu_arch_name, . - cpu_arch_name
470
471 .type cpu_elf_name, #object
472cpu_elf_name:
473 .asciz "v5"
474 .size cpu_elf_name, . - cpu_elf_name
475
476 .type cpu_xsc3_name, #object
477cpu_xsc3_name:
478 .asciz "XScale-Core3"
479 .size cpu_xsc3_name, . - cpu_xsc3_name
480
481 .align
482
483 .section ".proc.info.init", #alloc, #execinstr
484
485 .type __xsc3_proc_info,#object
486__xsc3_proc_info:
487 .long 0x69056000
488 .long 0xffffe000
489 .long 0x00000c0e
490 b __xsc3_setup
491 .long cpu_arch_name
492 .long cpu_elf_name
493 .long HWCAP_SWP|HWCAP_HALF|HWCAP_THUMB|HWCAP_FAST_MULT|HWCAP_EDSP
494 .long cpu_xsc3_name
495 .long xsc3_processor_functions
496 .long v4wbi_tlb_fns
497 .long xsc3_mc_user_fns
498 .long xsc3_cache_fns
499 .size __xsc3_proc_info, . - __xsc3_proc_info
diff --git a/arch/arm/mm/proc-xscale.S b/arch/arm/mm/proc-xscale.S
index 2d3823ec3153..29bcc4dd6517 100644
--- a/arch/arm/mm/proc-xscale.S
+++ b/arch/arm/mm/proc-xscale.S
@@ -24,8 +24,8 @@
24#include <linux/init.h> 24#include <linux/init.h>
25#include <asm/assembler.h> 25#include <asm/assembler.h>
26#include <asm/procinfo.h> 26#include <asm/procinfo.h>
27#include <asm/hardware.h>
28#include <asm/pgtable.h> 27#include <asm/pgtable.h>
28#include <asm/pgtable-hwdef.h>
29#include <asm/page.h> 29#include <asm/page.h>
30#include <asm/ptrace.h> 30#include <asm/ptrace.h>
31#include "proc-macros.S" 31#include "proc-macros.S"
diff --git a/arch/arm/oprofile/common.c b/arch/arm/oprofile/common.c
index 6f8bc1f0e6a1..6f833358cd06 100644
--- a/arch/arm/oprofile/common.c
+++ b/arch/arm/oprofile/common.c
@@ -10,17 +10,18 @@
10#include <linux/init.h> 10#include <linux/init.h>
11#include <linux/oprofile.h> 11#include <linux/oprofile.h>
12#include <linux/errno.h> 12#include <linux/errno.h>
13#include <linux/slab.h>
13#include <linux/sysdev.h> 14#include <linux/sysdev.h>
14#include <asm/semaphore.h> 15#include <linux/mutex.h>
15 16
16#include "op_counter.h" 17#include "op_counter.h"
17#include "op_arm_model.h" 18#include "op_arm_model.h"
18 19
19static struct op_arm_model_spec *op_arm_model; 20static struct op_arm_model_spec *op_arm_model;
20static int op_arm_enabled; 21static int op_arm_enabled;
21static struct semaphore op_arm_sem; 22static DEFINE_MUTEX(op_arm_mutex);
22 23
23struct op_counter_config counter_config[OP_MAX_COUNTER]; 24struct op_counter_config *counter_config;
24 25
25static int op_arm_create_files(struct super_block *sb, struct dentry *root) 26static int op_arm_create_files(struct super_block *sb, struct dentry *root)
26{ 27{
@@ -28,7 +29,7 @@ static int op_arm_create_files(struct super_block *sb, struct dentry *root)
28 29
29 for (i = 0; i < op_arm_model->num_counters; i++) { 30 for (i = 0; i < op_arm_model->num_counters; i++) {
30 struct dentry *dir; 31 struct dentry *dir;
31 char buf[2]; 32 char buf[4];
32 33
33 snprintf(buf, sizeof buf, "%d", i); 34 snprintf(buf, sizeof buf, "%d", i);
34 dir = oprofilefs_mkdir(sb, root, buf); 35 dir = oprofilefs_mkdir(sb, root, buf);
@@ -57,40 +58,40 @@ static int op_arm_start(void)
57{ 58{
58 int ret = -EBUSY; 59 int ret = -EBUSY;
59 60
60 down(&op_arm_sem); 61 mutex_lock(&op_arm_mutex);
61 if (!op_arm_enabled) { 62 if (!op_arm_enabled) {
62 ret = op_arm_model->start(); 63 ret = op_arm_model->start();
63 op_arm_enabled = !ret; 64 op_arm_enabled = !ret;
64 } 65 }
65 up(&op_arm_sem); 66 mutex_unlock(&op_arm_mutex);
66 return ret; 67 return ret;
67} 68}
68 69
69static void op_arm_stop(void) 70static void op_arm_stop(void)
70{ 71{
71 down(&op_arm_sem); 72 mutex_lock(&op_arm_mutex);
72 if (op_arm_enabled) 73 if (op_arm_enabled)
73 op_arm_model->stop(); 74 op_arm_model->stop();
74 op_arm_enabled = 0; 75 op_arm_enabled = 0;
75 up(&op_arm_sem); 76 mutex_unlock(&op_arm_mutex);
76} 77}
77 78
78#ifdef CONFIG_PM 79#ifdef CONFIG_PM
79static int op_arm_suspend(struct sys_device *dev, pm_message_t state) 80static int op_arm_suspend(struct sys_device *dev, pm_message_t state)
80{ 81{
81 down(&op_arm_sem); 82 mutex_lock(&op_arm_mutex);
82 if (op_arm_enabled) 83 if (op_arm_enabled)
83 op_arm_model->stop(); 84 op_arm_model->stop();
84 up(&op_arm_sem); 85 mutex_unlock(&op_arm_mutex);
85 return 0; 86 return 0;
86} 87}
87 88
88static int op_arm_resume(struct sys_device *dev) 89static int op_arm_resume(struct sys_device *dev)
89{ 90{
90 down(&op_arm_sem); 91 mutex_lock(&op_arm_mutex);
91 if (op_arm_enabled && op_arm_model->start()) 92 if (op_arm_enabled && op_arm_model->start())
92 op_arm_enabled = 0; 93 op_arm_enabled = 0;
93 up(&op_arm_sem); 94 mutex_unlock(&op_arm_mutex);
94 return 0; 95 return 0;
95} 96}
96 97
@@ -135,12 +136,15 @@ int __init oprofile_arch_init(struct oprofile_operations *ops)
135#endif 136#endif
136 137
137 if (spec) { 138 if (spec) {
138 init_MUTEX(&op_arm_sem);
139
140 ret = spec->init(); 139 ret = spec->init();
141 if (ret < 0) 140 if (ret < 0)
142 return ret; 141 return ret;
143 142
143 counter_config = kcalloc(spec->num_counters, sizeof(struct op_counter_config),
144 GFP_KERNEL);
145 if (!counter_config)
146 return -ENOMEM;
147
144 op_arm_model = spec; 148 op_arm_model = spec;
145 init_driverfs(); 149 init_driverfs();
146 ops->create_files = op_arm_create_files; 150 ops->create_files = op_arm_create_files;
@@ -162,5 +166,5 @@ void oprofile_arch_exit(void)
162 exit_driverfs(); 166 exit_driverfs();
163 op_arm_model = NULL; 167 op_arm_model = NULL;
164 } 168 }
169 kfree(counter_config);
165} 170}
166
diff --git a/arch/arm/oprofile/op_counter.h b/arch/arm/oprofile/op_counter.h
index 153c1d467f24..8c5351d751cf 100644
--- a/arch/arm/oprofile/op_counter.h
+++ b/arch/arm/oprofile/op_counter.h
@@ -24,6 +24,6 @@ struct op_counter_config {
24 unsigned long user; 24 unsigned long user;
25}; 25};
26 26
27extern struct op_counter_config counter_config[]; 27extern struct op_counter_config *counter_config;
28 28
29#endif /* OP_COUNTER_H */ 29#endif /* OP_COUNTER_H */
diff --git a/arch/arm/vfp/entry.S b/arch/arm/vfp/entry.S
index 6f17187ab32a..7b595547c1c8 100644
--- a/arch/arm/vfp/entry.S
+++ b/arch/arm/vfp/entry.S
@@ -18,10 +18,12 @@
18#include <linux/linkage.h> 18#include <linux/linkage.h>
19#include <linux/init.h> 19#include <linux/init.h>
20#include <asm/asm-offsets.h> 20#include <asm/asm-offsets.h>
21#include <asm/assembler.h>
21#include <asm/vfpmacros.h> 22#include <asm/vfpmacros.h>
22 23
23 .globl do_vfp 24 .globl do_vfp
24do_vfp: 25do_vfp:
26 enable_irq
25 ldr r4, .LCvfp 27 ldr r4, .LCvfp
26 add r10, r10, #TI_VFPSTATE @ r10 = workspace 28 add r10, r10, #TI_VFPSTATE @ r10 = workspace
27 ldr pc, [r4] @ call VFP entry point 29 ldr pc, [r4] @ call VFP entry point
diff --git a/arch/arm/vfp/vfphw.S b/arch/arm/vfp/vfphw.S
index de4ca1223c58..b7ed57e00cd4 100644
--- a/arch/arm/vfp/vfphw.S
+++ b/arch/arm/vfp/vfphw.S
@@ -102,7 +102,6 @@ vfp_support_entry:
102 VFPFMRX r8, FPINST2, NE @ FPINST2 if needed - avoids reading 102 VFPFMRX r8, FPINST2, NE @ FPINST2 if needed - avoids reading
103 @ nonexistant reg on rev0 103 @ nonexistant reg on rev0
104 VFPFSTMIA r4 @ save the working registers 104 VFPFSTMIA r4 @ save the working registers
105 add r4, r4, #8*16+4
106 stmia r4, {r1, r5, r6, r8} @ save FPEXC, FPSCR, FPINST, FPINST2 105 stmia r4, {r1, r5, r6, r8} @ save FPEXC, FPSCR, FPINST, FPINST2
107 @ and point r4 at the word at the 106 @ and point r4 at the word at the
108 @ start of the register dump 107 @ start of the register dump
@@ -111,10 +110,9 @@ no_old_VFP_process:
111 DBGSTR1 "load state %p", r10 110 DBGSTR1 "load state %p", r10
112 str r10, [r3] @ update the last_VFP_context pointer 111 str r10, [r3] @ update the last_VFP_context pointer
113 @ Load the saved state back into the VFP 112 @ Load the saved state back into the VFP
114 add r4, r10, #8*16+4
115 ldmia r4, {r1, r5, r6, r8} @ load FPEXC, FPSCR, FPINST, FPINST2
116 VFPFLDMIA r10 @ reload the working registers while 113 VFPFLDMIA r10 @ reload the working registers while
117 @ FPEXC is in a safe state 114 @ FPEXC is in a safe state
115 ldmia r10, {r1, r5, r6, r8} @ load FPEXC, FPSCR, FPINST, FPINST2
118 tst r1, #FPEXC_FPV2 @ is there an FPINST2 to write? 116 tst r1, #FPEXC_FPV2 @ is there an FPINST2 to write?
119 VFPFMXR FPINST2, r8, NE @ FPINST2 if needed - avoids writing 117 VFPFMXR FPINST2, r8, NE @ FPINST2 if needed - avoids writing
120 @ nonexistant reg on rev0 118 @ nonexistant reg on rev0
diff --git a/arch/arm26/Kconfig b/arch/arm26/Kconfig
index dee23d87fc5a..cf4ebf4c274d 100644
--- a/arch/arm26/Kconfig
+++ b/arch/arm26/Kconfig
@@ -41,6 +41,10 @@ config RWSEM_GENERIC_SPINLOCK
41config RWSEM_XCHGADD_ALGORITHM 41config RWSEM_XCHGADD_ALGORITHM
42 bool 42 bool
43 43
44config GENERIC_HWEIGHT
45 bool
46 default y
47
44config GENERIC_CALIBRATE_DELAY 48config GENERIC_CALIBRATE_DELAY
45 bool 49 bool
46 default y 50 default y
diff --git a/arch/arm26/Makefile b/arch/arm26/Makefile
index 844a9e46886e..fe91eda98a94 100644
--- a/arch/arm26/Makefile
+++ b/arch/arm26/Makefile
@@ -1,6 +1,9 @@
1# 1#
2# arch/arm26/Makefile 2# arch/arm26/Makefile
3# 3#
4# This file is included by the global makefile so that you can add your own
5# architecture-specific flags and dependencies.
6#
4# This file is subject to the terms and conditions of the GNU General Public 7# This file is subject to the terms and conditions of the GNU General Public
5# License. See the file "COPYING" in the main directory of this archive 8# License. See the file "COPYING" in the main directory of this archive
6# for more details. 9# for more details.
@@ -49,9 +52,9 @@ all: zImage
49 52
50boot := arch/arm26/boot 53boot := arch/arm26/boot
51 54
52.PHONY: maketools FORCE 55PHONY += maketools FORCE
53maketools: FORCE 56maketools: FORCE
54 57
55 58
56# Convert bzImage to zImage 59# Convert bzImage to zImage
57bzImage: vmlinux 60bzImage: vmlinux
diff --git a/arch/arm26/boot/Makefile b/arch/arm26/boot/Makefile
index b5c2277654d4..68acb7b0d47f 100644
--- a/arch/arm26/boot/Makefile
+++ b/arch/arm26/boot/Makefile
@@ -1,6 +1,9 @@
1# 1#
2# arch/arm26/boot/Makefile 2# arch/arm26/boot/Makefile
3# 3#
4# This file is included by the global makefile so that you can add your own
5# architecture-specific flags and dependencies.
6#
4# This file is subject to the terms and conditions of the GNU General Public 7# This file is subject to the terms and conditions of the GNU General Public
5# License. See the file "COPYING" in the main directory of this archive 8# License. See the file "COPYING" in the main directory of this archive
6# for more details. 9# for more details.
@@ -60,7 +63,7 @@ $(obj)/xipImage: vmlinux FORCE
60 @echo ' Kernel: $@ is ready' 63 @echo ' Kernel: $@ is ready'
61endif 64endif
62 65
63.PHONY: initrd 66PHONY += initrd
64initrd: 67initrd:
65 @test "$(INITRD_PHYS)" != "" || \ 68 @test "$(INITRD_PHYS)" != "" || \
66 (echo This machine does not support INITRD; exit -1) 69 (echo This machine does not support INITRD; exit -1)
diff --git a/arch/arm26/kernel/armksyms.c b/arch/arm26/kernel/armksyms.c
index 811a6376c624..a6a1b3373444 100644
--- a/arch/arm26/kernel/armksyms.c
+++ b/arch/arm26/kernel/armksyms.c
@@ -212,8 +212,6 @@ EXPORT_SYMBOL(sys_open);
212EXPORT_SYMBOL(sys_exit); 212EXPORT_SYMBOL(sys_exit);
213EXPORT_SYMBOL(sys_wait4); 213EXPORT_SYMBOL(sys_wait4);
214 214
215EXPORT_SYMBOL(get_wchan);
216
217#ifdef CONFIG_PREEMPT 215#ifdef CONFIG_PREEMPT
218EXPORT_SYMBOL(kernel_flag); 216EXPORT_SYMBOL(kernel_flag);
219#endif 217#endif
diff --git a/arch/arm26/kernel/traps.c b/arch/arm26/kernel/traps.c
index 5847ea5d7747..a79de041b50e 100644
--- a/arch/arm26/kernel/traps.c
+++ b/arch/arm26/kernel/traps.c
@@ -34,7 +34,7 @@
34#include <asm/system.h> 34#include <asm/system.h>
35#include <asm/uaccess.h> 35#include <asm/uaccess.h>
36#include <asm/unistd.h> 36#include <asm/unistd.h>
37#include <asm/semaphore.h> 37#include <linux/mutex.h>
38 38
39#include "ptrace.h" 39#include "ptrace.h"
40 40
@@ -207,19 +207,19 @@ void die_if_kernel(const char *str, struct pt_regs *regs, int err)
207 die(str, regs, err); 207 die(str, regs, err);
208} 208}
209 209
210static DECLARE_MUTEX(undef_sem); 210static DEFINE_MUTEX(undef_mutex);
211static int (*undef_hook)(struct pt_regs *); 211static int (*undef_hook)(struct pt_regs *);
212 212
213int request_undef_hook(int (*fn)(struct pt_regs *)) 213int request_undef_hook(int (*fn)(struct pt_regs *))
214{ 214{
215 int ret = -EBUSY; 215 int ret = -EBUSY;
216 216
217 down(&undef_sem); 217 mutex_lock(&undef_mutex);
218 if (undef_hook == NULL) { 218 if (undef_hook == NULL) {
219 undef_hook = fn; 219 undef_hook = fn;
220 ret = 0; 220 ret = 0;
221 } 221 }
222 up(&undef_sem); 222 mutex_unlock(&undef_mutex);
223 223
224 return ret; 224 return ret;
225} 225}
@@ -228,12 +228,12 @@ int release_undef_hook(int (*fn)(struct pt_regs *))
228{ 228{
229 int ret = -EINVAL; 229 int ret = -EINVAL;
230 230
231 down(&undef_sem); 231 mutex_lock(&undef_mutex);
232 if (undef_hook == fn) { 232 if (undef_hook == fn) {
233 undef_hook = NULL; 233 undef_hook = NULL;
234 ret = 0; 234 ret = 0;
235 } 235 }
236 up(&undef_sem); 236 mutex_unlock(&undef_mutex);
237 237
238 return ret; 238 return ret;
239} 239}
diff --git a/arch/arm26/mm/init.c b/arch/arm26/mm/init.c
index 1f09a9d0fb83..7da8a5205678 100644
--- a/arch/arm26/mm/init.c
+++ b/arch/arm26/mm/init.c
@@ -23,6 +23,7 @@
23#include <linux/initrd.h> 23#include <linux/initrd.h>
24#include <linux/bootmem.h> 24#include <linux/bootmem.h>
25#include <linux/blkdev.h> 25#include <linux/blkdev.h>
26#include <linux/pfn.h>
26 27
27#include <asm/segment.h> 28#include <asm/segment.h>
28#include <asm/mach-types.h> 29#include <asm/mach-types.h>
@@ -101,12 +102,6 @@ struct node_info {
101 int bootmap_pages; 102 int bootmap_pages;
102}; 103};
103 104
104#define PFN_DOWN(x) ((x) >> PAGE_SHIFT)
105#define PFN_UP(x) (PAGE_ALIGN(x) >> PAGE_SHIFT)
106#define PFN_SIZE(x) ((x) >> PAGE_SHIFT)
107#define PFN_RANGE(s,e) PFN_SIZE(PAGE_ALIGN((unsigned long)(e)) - \
108 (((unsigned long)(s)) & PAGE_MASK))
109
110/* 105/*
111 * FIXME: We really want to avoid allocating the bootmap bitmap 106 * FIXME: We really want to avoid allocating the bootmap bitmap
112 * over the top of the initrd. Hopefully, this is located towards 107 * over the top of the initrd. Hopefully, this is located towards
@@ -324,7 +319,7 @@ static inline void free_area(unsigned long addr, unsigned long end, char *s)
324 for (; addr < end; addr += PAGE_SIZE) { 319 for (; addr < end; addr += PAGE_SIZE) {
325 struct page *page = virt_to_page(addr); 320 struct page *page = virt_to_page(addr);
326 ClearPageReserved(page); 321 ClearPageReserved(page);
327 set_page_count(page, 1); 322 init_page_count(page);
328 free_page(addr); 323 free_page(addr);
329 totalram_pages++; 324 totalram_pages++;
330 } 325 }
diff --git a/arch/cris/Kconfig b/arch/cris/Kconfig
index b83261949737..856b665020e7 100644
--- a/arch/cris/Kconfig
+++ b/arch/cris/Kconfig
@@ -16,6 +16,14 @@ config RWSEM_GENERIC_SPINLOCK
16config RWSEM_XCHGADD_ALGORITHM 16config RWSEM_XCHGADD_ALGORITHM
17 bool 17 bool
18 18
19config GENERIC_FIND_NEXT_BIT
20 bool
21 default y
22
23config GENERIC_HWEIGHT
24 bool
25 default y
26
19config GENERIC_CALIBRATE_DELAY 27config GENERIC_CALIBRATE_DELAY
20 bool 28 bool
21 default y 29 default y
diff --git a/arch/cris/arch-v32/drivers/cryptocop.c b/arch/cris/arch-v32/drivers/cryptocop.c
index 501fa52d8d3a..c59ee28a35f4 100644
--- a/arch/cris/arch-v32/drivers/cryptocop.c
+++ b/arch/cris/arch-v32/drivers/cryptocop.c
@@ -2944,7 +2944,7 @@ static int cryptocop_ioctl_process(struct inode *inode, struct file *filp, unsig
2944 int spdl_err; 2944 int spdl_err;
2945 /* Mark output pages dirty. */ 2945 /* Mark output pages dirty. */
2946 spdl_err = set_page_dirty_lock(outpages[i]); 2946 spdl_err = set_page_dirty_lock(outpages[i]);
2947 DEBUG(if (spdl_err)printk("cryptocop_ioctl_process: set_page_dirty_lock returned %d\n", spdl_err)); 2947 DEBUG(if (spdl_err < 0)printk("cryptocop_ioctl_process: set_page_dirty_lock returned %d\n", spdl_err));
2948 } 2948 }
2949 for (i = 0; i < nooutpages; i++){ 2949 for (i = 0; i < nooutpages; i++){
2950 put_page(outpages[i]); 2950 put_page(outpages[i]);
diff --git a/arch/cris/kernel/irq.c b/arch/cris/kernel/irq.c
index 30deaf1b728a..b504def3e346 100644
--- a/arch/cris/kernel/irq.c
+++ b/arch/cris/kernel/irq.c
@@ -52,9 +52,8 @@ int show_interrupts(struct seq_file *p, void *v)
52 52
53 if (i == 0) { 53 if (i == 0) {
54 seq_printf(p, " "); 54 seq_printf(p, " ");
55 for (j=0; j<NR_CPUS; j++) 55 for_each_online_cpu(j)
56 if (cpu_online(j)) 56 seq_printf(p, "CPU%d ",j);
57 seq_printf(p, "CPU%d ",j);
58 seq_putc(p, '\n'); 57 seq_putc(p, '\n');
59 } 58 }
60 59
@@ -67,9 +66,8 @@ int show_interrupts(struct seq_file *p, void *v)
67#ifndef CONFIG_SMP 66#ifndef CONFIG_SMP
68 seq_printf(p, "%10u ", kstat_irqs(i)); 67 seq_printf(p, "%10u ", kstat_irqs(i));
69#else 68#else
70 for (j = 0; j < NR_CPUS; j++) 69 for_each_online_cpu(j)
71 if (cpu_online(j)) 70 seq_printf(p, "%10u ", kstat_cpu(j).irqs[i]);
72 seq_printf(p, "%10u ", kstat_cpu(j).irqs[i]);
73#endif 71#endif
74 seq_printf(p, " %14s", irq_desc[i].handler->typename); 72 seq_printf(p, " %14s", irq_desc[i].handler->typename);
75 seq_printf(p, " %s", action->name); 73 seq_printf(p, " %s", action->name);
diff --git a/arch/cris/kernel/process.c b/arch/cris/kernel/process.c
index 4ab3e87115b6..123451c44154 100644
--- a/arch/cris/kernel/process.c
+++ b/arch/cris/kernel/process.c
@@ -116,6 +116,7 @@
116#include <asm/pgtable.h> 116#include <asm/pgtable.h>
117#include <asm/uaccess.h> 117#include <asm/uaccess.h>
118#include <asm/irq.h> 118#include <asm/irq.h>
119#include <asm/system.h>
119#include <linux/module.h> 120#include <linux/module.h>
120#include <linux/spinlock.h> 121#include <linux/spinlock.h>
121#include <linux/fs_struct.h> 122#include <linux/fs_struct.h>
@@ -194,8 +195,6 @@ EXPORT_SYMBOL(enable_hlt);
194 */ 195 */
195void (*pm_idle)(void); 196void (*pm_idle)(void);
196 197
197extern void default_idle(void);
198
199/* 198/*
200 * The idle thread. There's no useful work to be 199 * The idle thread. There's no useful work to be
201 * done, so just try to conserve power and have a 200 * done, so just try to conserve power and have a
diff --git a/arch/cris/kernel/setup.c b/arch/cris/kernel/setup.c
index 1ba57efff60d..619a6eefd893 100644
--- a/arch/cris/kernel/setup.c
+++ b/arch/cris/kernel/setup.c
@@ -18,6 +18,7 @@
18#include <linux/seq_file.h> 18#include <linux/seq_file.h>
19#include <linux/tty.h> 19#include <linux/tty.h>
20#include <linux/utsname.h> 20#include <linux/utsname.h>
21#include <linux/pfn.h>
21 22
22#include <asm/setup.h> 23#include <asm/setup.h>
23 24
@@ -88,10 +89,6 @@ setup_arch(char **cmdline_p)
88 init_mm.end_data = (unsigned long) &_edata; 89 init_mm.end_data = (unsigned long) &_edata;
89 init_mm.brk = (unsigned long) &_end; 90 init_mm.brk = (unsigned long) &_end;
90 91
91#define PFN_UP(x) (((x) + PAGE_SIZE-1) >> PAGE_SHIFT)
92#define PFN_DOWN(x) ((x) >> PAGE_SHIFT)
93#define PFN_PHYS(x) ((x) << PAGE_SHIFT)
94
95 /* min_low_pfn points to the start of DRAM, start_pfn points 92 /* min_low_pfn points to the start of DRAM, start_pfn points
96 * to the first DRAM pages after the kernel, and max_low_pfn 93 * to the first DRAM pages after the kernel, and max_low_pfn
97 * to the end of DRAM. 94 * to the end of DRAM.
diff --git a/arch/cris/mm/init.c b/arch/cris/mm/init.c
index 31a0018b525a..b7842ff213a6 100644
--- a/arch/cris/mm/init.c
+++ b/arch/cris/mm/init.c
@@ -216,7 +216,7 @@ free_initmem(void)
216 addr = (unsigned long)(&__init_begin); 216 addr = (unsigned long)(&__init_begin);
217 for (; addr < (unsigned long)(&__init_end); addr += PAGE_SIZE) { 217 for (; addr < (unsigned long)(&__init_end); addr += PAGE_SIZE) {
218 ClearPageReserved(virt_to_page(addr)); 218 ClearPageReserved(virt_to_page(addr));
219 set_page_count(virt_to_page(addr), 1); 219 init_page_count(virt_to_page(addr));
220 free_page(addr); 220 free_page(addr);
221 totalram_pages++; 221 totalram_pages++;
222 } 222 }
diff --git a/arch/frv/Kconfig b/arch/frv/Kconfig
index e08383712370..95a3892b8d1b 100644
--- a/arch/frv/Kconfig
+++ b/arch/frv/Kconfig
@@ -17,6 +17,10 @@ config GENERIC_FIND_NEXT_BIT
17 bool 17 bool
18 default y 18 default y
19 19
20config GENERIC_HWEIGHT
21 bool
22 default y
23
20config GENERIC_CALIBRATE_DELAY 24config GENERIC_CALIBRATE_DELAY
21 bool 25 bool
22 default n 26 default n
diff --git a/arch/frv/kernel/frv_ksyms.c b/arch/frv/kernel/frv_ksyms.c
index 0f1c6cbc4f50..07c8ffa0dd39 100644
--- a/arch/frv/kernel/frv_ksyms.c
+++ b/arch/frv/kernel/frv_ksyms.c
@@ -27,6 +27,7 @@ EXPORT_SYMBOL(__ioremap);
27EXPORT_SYMBOL(iounmap); 27EXPORT_SYMBOL(iounmap);
28 28
29EXPORT_SYMBOL(strnlen); 29EXPORT_SYMBOL(strnlen);
30EXPORT_SYMBOL(strpbrk);
30EXPORT_SYMBOL(strrchr); 31EXPORT_SYMBOL(strrchr);
31EXPORT_SYMBOL(strstr); 32EXPORT_SYMBOL(strstr);
32EXPORT_SYMBOL(strchr); 33EXPORT_SYMBOL(strchr);
@@ -78,8 +79,6 @@ EXPORT_SYMBOL(memmove);
78EXPORT_SYMBOL(__outsl_ns); 79EXPORT_SYMBOL(__outsl_ns);
79EXPORT_SYMBOL(__insl_ns); 80EXPORT_SYMBOL(__insl_ns);
80 81
81EXPORT_SYMBOL(get_wchan);
82
83#ifdef CONFIG_FRV_OUTOFLINE_ATOMIC_OPS 82#ifdef CONFIG_FRV_OUTOFLINE_ATOMIC_OPS
84EXPORT_SYMBOL(atomic_test_and_ANDNOT_mask); 83EXPORT_SYMBOL(atomic_test_and_ANDNOT_mask);
85EXPORT_SYMBOL(atomic_test_and_OR_mask); 84EXPORT_SYMBOL(atomic_test_and_OR_mask);
diff --git a/arch/frv/kernel/gdb-stub.c b/arch/frv/kernel/gdb-stub.c
index 8f860d9c4947..508601fad079 100644
--- a/arch/frv/kernel/gdb-stub.c
+++ b/arch/frv/kernel/gdb-stub.c
@@ -1406,7 +1406,7 @@ void gdbstub(int sigval)
1406 __debug_frame->psr |= PSR_S; 1406 __debug_frame->psr |= PSR_S;
1407 __debug_regs->brr = (__debug_frame->tbr & TBR_TT) << 12; 1407 __debug_regs->brr = (__debug_frame->tbr & TBR_TT) << 12;
1408 __debug_regs->brr |= BRR_EB; 1408 __debug_regs->brr |= BRR_EB;
1409 sigval = SIGXCPU;; 1409 sigval = SIGXCPU;
1410 } 1410 }
1411 1411
1412 LEDS(0x5002); 1412 LEDS(0x5002);
diff --git a/arch/frv/kernel/irq.c b/arch/frv/kernel/irq.c
index 27ab4c30aac6..11fa326a8f62 100644
--- a/arch/frv/kernel/irq.c
+++ b/arch/frv/kernel/irq.c
@@ -75,9 +75,8 @@ int show_interrupts(struct seq_file *p, void *v)
75 switch (i) { 75 switch (i) {
76 case 0: 76 case 0:
77 seq_printf(p, " "); 77 seq_printf(p, " ");
78 for (j = 0; j < NR_CPUS; j++) 78 for_each_online_cpu(j)
79 if (cpu_online(j)) 79 seq_printf(p, "CPU%d ",j);
80 seq_printf(p, "CPU%d ",j);
81 80
82 seq_putc(p, '\n'); 81 seq_putc(p, '\n');
83 break; 82 break;
@@ -100,9 +99,8 @@ int show_interrupts(struct seq_file *p, void *v)
100#ifndef CONFIG_SMP 99#ifndef CONFIG_SMP
101 seq_printf(p, "%10u ", kstat_irqs(i)); 100 seq_printf(p, "%10u ", kstat_irqs(i));
102#else 101#else
103 for (j = 0; j < NR_CPUS; j++) 102 for_each_online_cpu(j)
104 if (cpu_online(j)) 103 seq_printf(p, "%10u ", kstat_cpu(j).irqs[i - 1]);
105 seq_printf(p, "%10u ", kstat_cpu(j).irqs[i - 1]);
106#endif 104#endif
107 105
108 level = group->sources[ix]->level - frv_irq_levels; 106 level = group->sources[ix]->level - frv_irq_levels;
diff --git a/arch/frv/mm/dma-alloc.c b/arch/frv/mm/dma-alloc.c
index 342823aad758..636b2f8b5d98 100644
--- a/arch/frv/mm/dma-alloc.c
+++ b/arch/frv/mm/dma-alloc.c
@@ -115,9 +115,7 @@ void *consistent_alloc(gfp_t gfp, size_t size, dma_addr_t *dma_handle)
115 */ 115 */
116 if (order > 0) { 116 if (order > 0) {
117 struct page *rpage = virt_to_page(page); 117 struct page *rpage = virt_to_page(page);
118 118 split_page(rpage, order);
119 for (i = 1; i < (1 << order); i++)
120 set_page_count(rpage + i, 1);
121 } 119 }
122 120
123 err = 0; 121 err = 0;
diff --git a/arch/frv/mm/init.c b/arch/frv/mm/init.c
index 765088ea8a50..8899aa1a4f06 100644
--- a/arch/frv/mm/init.c
+++ b/arch/frv/mm/init.c
@@ -169,7 +169,7 @@ void __init mem_init(void)
169 struct page *page = &mem_map[pfn]; 169 struct page *page = &mem_map[pfn];
170 170
171 ClearPageReserved(page); 171 ClearPageReserved(page);
172 set_page_count(page, 1); 172 init_page_count(page);
173 __free_page(page); 173 __free_page(page);
174 totalram_pages++; 174 totalram_pages++;
175 } 175 }
@@ -210,7 +210,7 @@ void __init free_initmem(void)
210 /* next to check that the page we free is not a partial page */ 210 /* next to check that the page we free is not a partial page */
211 for (addr = start; addr < end; addr += PAGE_SIZE) { 211 for (addr = start; addr < end; addr += PAGE_SIZE) {
212 ClearPageReserved(virt_to_page(addr)); 212 ClearPageReserved(virt_to_page(addr));
213 set_page_count(virt_to_page(addr), 1); 213 init_page_count(virt_to_page(addr));
214 free_page(addr); 214 free_page(addr);
215 totalram_pages++; 215 totalram_pages++;
216 } 216 }
@@ -230,7 +230,7 @@ void __init free_initrd_mem(unsigned long start, unsigned long end)
230 int pages = 0; 230 int pages = 0;
231 for (; start < end; start += PAGE_SIZE) { 231 for (; start < end; start += PAGE_SIZE) {
232 ClearPageReserved(virt_to_page(start)); 232 ClearPageReserved(virt_to_page(start));
233 set_page_count(virt_to_page(start), 1); 233 init_page_count(virt_to_page(start));
234 free_page(start); 234 free_page(start);
235 totalram_pages++; 235 totalram_pages++;
236 pages++; 236 pages++;
diff --git a/arch/frv/mm/mmu-context.c b/arch/frv/mm/mmu-context.c
index f2c6866fc88b..1530a4111e6d 100644
--- a/arch/frv/mm/mmu-context.c
+++ b/arch/frv/mm/mmu-context.c
@@ -54,9 +54,9 @@ static unsigned get_cxn(mm_context_t *ctx)
54 /* find the first unallocated context number 54 /* find the first unallocated context number
55 * - 0 is reserved for the kernel 55 * - 0 is reserved for the kernel
56 */ 56 */
57 cxn = find_next_zero_bit(&cxn_bitmap, NR_CXN, 1); 57 cxn = find_next_zero_bit(cxn_bitmap, NR_CXN, 1);
58 if (cxn < NR_CXN) { 58 if (cxn < NR_CXN) {
59 set_bit(cxn, &cxn_bitmap); 59 set_bit(cxn, cxn_bitmap);
60 } 60 }
61 else { 61 else {
62 /* none remaining - need to steal someone else's cxn */ 62 /* none remaining - need to steal someone else's cxn */
@@ -138,7 +138,7 @@ void destroy_context(struct mm_struct *mm)
138 cxn_pinned = -1; 138 cxn_pinned = -1;
139 139
140 list_del_init(&ctx->id_link); 140 list_del_init(&ctx->id_link);
141 clear_bit(ctx->id, &cxn_bitmap); 141 clear_bit(ctx->id, cxn_bitmap);
142 __flush_tlb_mm(ctx->id); 142 __flush_tlb_mm(ctx->id);
143 ctx->id = 0; 143 ctx->id = 0;
144 } 144 }
diff --git a/arch/h8300/Kconfig b/arch/h8300/Kconfig
index 98308b018a35..cabf0bfffc53 100644
--- a/arch/h8300/Kconfig
+++ b/arch/h8300/Kconfig
@@ -29,6 +29,14 @@ config RWSEM_XCHGADD_ALGORITHM
29 bool 29 bool
30 default n 30 default n
31 31
32config GENERIC_FIND_NEXT_BIT
33 bool
34 default y
35
36config GENERIC_HWEIGHT
37 bool
38 default y
39
32config GENERIC_CALIBRATE_DELAY 40config GENERIC_CALIBRATE_DELAY
33 bool 41 bool
34 default y 42 default y
diff --git a/arch/h8300/kernel/h8300_ksyms.c b/arch/h8300/kernel/h8300_ksyms.c
index 5cc76efaf7aa..b6cd78c972bb 100644
--- a/arch/h8300/kernel/h8300_ksyms.c
+++ b/arch/h8300/kernel/h8300_ksyms.c
@@ -25,6 +25,7 @@ extern char h8300_debug_device[];
25/* platform dependent support */ 25/* platform dependent support */
26 26
27EXPORT_SYMBOL(strnlen); 27EXPORT_SYMBOL(strnlen);
28EXPORT_SYMBOL(strpbrk);
28EXPORT_SYMBOL(strrchr); 29EXPORT_SYMBOL(strrchr);
29EXPORT_SYMBOL(strstr); 30EXPORT_SYMBOL(strstr);
30EXPORT_SYMBOL(strchr); 31EXPORT_SYMBOL(strchr);
@@ -54,8 +55,6 @@ EXPORT_SYMBOL(memcmp);
54EXPORT_SYMBOL(memscan); 55EXPORT_SYMBOL(memscan);
55EXPORT_SYMBOL(memmove); 56EXPORT_SYMBOL(memmove);
56 57
57EXPORT_SYMBOL(get_wchan);
58
59/* 58/*
60 * libgcc functions - functions that are used internally by the 59 * libgcc functions - functions that are used internally by the
61 * compiler... (prototypes are not correct though, but that 60 * compiler... (prototypes are not correct though, but that
diff --git a/arch/h8300/kernel/process.c b/arch/h8300/kernel/process.c
index dd344f112cfe..16ccddc69c2b 100644
--- a/arch/h8300/kernel/process.c
+++ b/arch/h8300/kernel/process.c
@@ -54,7 +54,7 @@ asmlinkage void ret_from_fork(void);
54 * The idle loop on an H8/300.. 54 * The idle loop on an H8/300..
55 */ 55 */
56#if !defined(CONFIG_H8300H_SIM) && !defined(CONFIG_H8S_SIM) 56#if !defined(CONFIG_H8300H_SIM) && !defined(CONFIG_H8S_SIM)
57void default_idle(void) 57static void default_idle(void)
58{ 58{
59 local_irq_disable(); 59 local_irq_disable();
60 if (!need_resched()) { 60 if (!need_resched()) {
@@ -65,7 +65,7 @@ void default_idle(void)
65 local_irq_enable(); 65 local_irq_enable();
66} 66}
67#else 67#else
68void default_idle(void) 68static void default_idle(void)
69{ 69{
70 cpu_relax(); 70 cpu_relax();
71} 71}
diff --git a/arch/h8300/mm/init.c b/arch/h8300/mm/init.c
index 1e0929ddc8c4..09efc4b1f038 100644
--- a/arch/h8300/mm/init.c
+++ b/arch/h8300/mm/init.c
@@ -196,7 +196,7 @@ void free_initrd_mem(unsigned long start, unsigned long end)
196 int pages = 0; 196 int pages = 0;
197 for (; start < end; start += PAGE_SIZE) { 197 for (; start < end; start += PAGE_SIZE) {
198 ClearPageReserved(virt_to_page(start)); 198 ClearPageReserved(virt_to_page(start));
199 set_page_count(virt_to_page(start), 1); 199 init_page_count(virt_to_page(start));
200 free_page(start); 200 free_page(start);
201 totalram_pages++; 201 totalram_pages++;
202 pages++; 202 pages++;
@@ -219,7 +219,7 @@ free_initmem()
219 /* next to check that the page we free is not a partial page */ 219 /* next to check that the page we free is not a partial page */
220 for (; addr + PAGE_SIZE < (unsigned long)(&__init_end); addr +=PAGE_SIZE) { 220 for (; addr + PAGE_SIZE < (unsigned long)(&__init_end); addr +=PAGE_SIZE) {
221 ClearPageReserved(virt_to_page(addr)); 221 ClearPageReserved(virt_to_page(addr));
222 set_page_count(virt_to_page(addr), 1); 222 init_page_count(virt_to_page(addr));
223 free_page(addr); 223 free_page(addr);
224 totalram_pages++; 224 totalram_pages++;
225 } 225 }
diff --git a/arch/i386/Kconfig b/arch/i386/Kconfig
index 5b1a7d46d1d9..f17bd1d2707e 100644
--- a/arch/i386/Kconfig
+++ b/arch/i386/Kconfig
@@ -37,6 +37,10 @@ config GENERIC_IOMAP
37 bool 37 bool
38 default y 38 default y
39 39
40config GENERIC_HWEIGHT
41 bool
42 default y
43
40config ARCH_MAY_HAVE_PC_FDC 44config ARCH_MAY_HAVE_PC_FDC
41 bool 45 bool
42 default y 46 default y
@@ -80,6 +84,7 @@ config X86_VOYAGER
80 84
81config X86_NUMAQ 85config X86_NUMAQ
82 bool "NUMAQ (IBM/Sequent)" 86 bool "NUMAQ (IBM/Sequent)"
87 select SMP
83 select NUMA 88 select NUMA
84 help 89 help
85 This option is used for getting Linux to run on a (IBM/Sequent) NUMA 90 This option is used for getting Linux to run on a (IBM/Sequent) NUMA
@@ -226,6 +231,15 @@ config SCHED_SMT
226 cost of slightly increased overhead in some places. If unsure say 231 cost of slightly increased overhead in some places. If unsure say
227 N here. 232 N here.
228 233
234config SCHED_MC
235 bool "Multi-core scheduler support"
236 depends on SMP
237 default y
238 help
239 Multi-core scheduler support improves the CPU scheduler's decision
240 making when dealing with multi-core CPU chips at a cost of slightly
241 increased overhead in some places. If unsure say N here.
242
229source "kernel/Kconfig.preempt" 243source "kernel/Kconfig.preempt"
230 244
231config X86_UP_APIC 245config X86_UP_APIC
@@ -400,6 +414,7 @@ choice
400 414
401config NOHIGHMEM 415config NOHIGHMEM
402 bool "off" 416 bool "off"
417 depends on !X86_NUMAQ
403 ---help--- 418 ---help---
404 Linux can use up to 64 Gigabytes of physical memory on x86 systems. 419 Linux can use up to 64 Gigabytes of physical memory on x86 systems.
405 However, the address space of 32-bit x86 processors is only 4 420 However, the address space of 32-bit x86 processors is only 4
@@ -436,6 +451,7 @@ config NOHIGHMEM
436 451
437config HIGHMEM4G 452config HIGHMEM4G
438 bool "4GB" 453 bool "4GB"
454 depends on !X86_NUMAQ
439 help 455 help
440 Select this if you have a 32-bit processor and between 1 and 4 456 Select this if you have a 32-bit processor and between 1 and 4
441 gigabytes of physical RAM. 457 gigabytes of physical RAM.
@@ -503,10 +519,6 @@ config NUMA
503 default n if X86_PC 519 default n if X86_PC
504 default y if (X86_NUMAQ || X86_SUMMIT) 520 default y if (X86_NUMAQ || X86_SUMMIT)
505 521
506# Need comments to help the hapless user trying to turn on NUMA support
507comment "NUMA (NUMA-Q) requires SMP, 64GB highmem support"
508 depends on X86_NUMAQ && (!HIGHMEM64G || !SMP)
509
510comment "NUMA (Summit) requires SMP, 64GB highmem support, ACPI" 522comment "NUMA (Summit) requires SMP, 64GB highmem support, ACPI"
511 depends on X86_SUMMIT && (!HIGHMEM64G || !ACPI) 523 depends on X86_SUMMIT && (!HIGHMEM64G || !ACPI)
512 524
@@ -660,13 +672,18 @@ config BOOT_IOREMAP
660 default y 672 default y
661 673
662config REGPARM 674config REGPARM
663 bool "Use register arguments (EXPERIMENTAL)" 675 bool "Use register arguments"
664 depends on EXPERIMENTAL 676 default y
665 default n
666 help 677 help
667 Compile the kernel with -mregparm=3. This uses a different ABI 678 Compile the kernel with -mregparm=3. This instructs gcc to use
668 and passes the first three arguments of a function call in registers. 679 a more efficient function call ABI which passes the first three
669 This will probably break binary only modules. 680 arguments of a function call via registers, which results in denser
681 and faster code.
682
683 If this option is disabled, then the default ABI of passing
684 arguments via the stack is used.
685
686 If unsure, say Y.
670 687
671config SECCOMP 688config SECCOMP
672 bool "Enable seccomp to safely compute untrusted bytecode" 689 bool "Enable seccomp to safely compute untrusted bytecode"
@@ -733,7 +750,7 @@ config PHYSICAL_START
733 750
734config HOTPLUG_CPU 751config HOTPLUG_CPU
735 bool "Support for hot-pluggable CPUs (EXPERIMENTAL)" 752 bool "Support for hot-pluggable CPUs (EXPERIMENTAL)"
736 depends on SMP && HOTPLUG && EXPERIMENTAL && !X86_VOYAGER 753 depends on SMP && HOTPLUG && EXPERIMENTAL && !X86_VOYAGER && !X86_PC
737 ---help--- 754 ---help---
738 Say Y here to experiment with turning CPUs off and on. CPUs 755 Say Y here to experiment with turning CPUs off and on. CPUs
739 can be controlled through /sys/devices/system/cpu. 756 can be controlled through /sys/devices/system/cpu.
diff --git a/arch/i386/Kconfig.debug b/arch/i386/Kconfig.debug
index bf32ecc9ad04..6e97df6979e8 100644
--- a/arch/i386/Kconfig.debug
+++ b/arch/i386/Kconfig.debug
@@ -31,12 +31,21 @@ config DEBUG_STACK_USAGE
31 31
32 This option will slow down process creation somewhat. 32 This option will slow down process creation somewhat.
33 33
34config STACK_BACKTRACE_COLS
35 int "Stack backtraces per line" if DEBUG_KERNEL
36 range 1 3
37 default 2
38 help
39 Selects how many stack backtrace entries per line to display.
40
41 This can save screen space when displaying traces.
42
34comment "Page alloc debug is incompatible with Software Suspend on i386" 43comment "Page alloc debug is incompatible with Software Suspend on i386"
35 depends on DEBUG_KERNEL && SOFTWARE_SUSPEND 44 depends on DEBUG_KERNEL && SOFTWARE_SUSPEND
36 45
37config DEBUG_PAGEALLOC 46config DEBUG_PAGEALLOC
38 bool "Page alloc debugging" 47 bool "Debug page memory allocations"
39 depends on DEBUG_KERNEL && !SOFTWARE_SUSPEND 48 depends on DEBUG_KERNEL && !SOFTWARE_SUSPEND && !HUGETLBFS
40 help 49 help
41 Unmap pages from the kernel linear mapping after free_pages(). 50 Unmap pages from the kernel linear mapping after free_pages().
42 This results in a large slowdown, but helps to find certain types 51 This results in a large slowdown, but helps to find certain types
diff --git a/arch/i386/Makefile b/arch/i386/Makefile
index 36bef6543ac1..3e4adb1e2244 100644
--- a/arch/i386/Makefile
+++ b/arch/i386/Makefile
@@ -39,6 +39,9 @@ include $(srctree)/arch/i386/Makefile.cpu
39 39
40cflags-$(CONFIG_REGPARM) += -mregparm=3 40cflags-$(CONFIG_REGPARM) += -mregparm=3
41 41
42# temporary until string.h is fixed
43cflags-y += -ffreestanding
44
42# Disable unit-at-a-time mode on pre-gcc-4.0 compilers, it makes gcc use 45# Disable unit-at-a-time mode on pre-gcc-4.0 compilers, it makes gcc use
43# a lot more stack due to the lack of sharing of stacklots: 46# a lot more stack due to the lack of sharing of stacklots:
44CFLAGS += $(shell if [ $(call cc-version) -lt 0400 ] ; then echo $(call cc-option,-fno-unit-at-a-time); fi ;) 47CFLAGS += $(shell if [ $(call cc-version) -lt 0400 ] ; then echo $(call cc-option,-fno-unit-at-a-time); fi ;)
@@ -99,8 +102,8 @@ AFLAGS += $(mflags-y)
99 102
100boot := arch/i386/boot 103boot := arch/i386/boot
101 104
102.PHONY: zImage bzImage compressed zlilo bzlilo \ 105PHONY += zImage bzImage compressed zlilo bzlilo \
103 zdisk bzdisk fdimage fdimage144 fdimage288 install 106 zdisk bzdisk fdimage fdimage144 fdimage288 isoimage install
104 107
105all: bzImage 108all: bzImage
106 109
@@ -119,7 +122,7 @@ zlilo bzlilo: vmlinux
119zdisk bzdisk: vmlinux 122zdisk bzdisk: vmlinux
120 $(Q)$(MAKE) $(build)=$(boot) BOOTIMAGE=$(KBUILD_IMAGE) zdisk 123 $(Q)$(MAKE) $(build)=$(boot) BOOTIMAGE=$(KBUILD_IMAGE) zdisk
121 124
122fdimage fdimage144 fdimage288: vmlinux 125fdimage fdimage144 fdimage288 isoimage: vmlinux
123 $(Q)$(MAKE) $(build)=$(boot) BOOTIMAGE=$(KBUILD_IMAGE) $@ 126 $(Q)$(MAKE) $(build)=$(boot) BOOTIMAGE=$(KBUILD_IMAGE) $@
124 127
125install: 128install:
@@ -136,6 +139,9 @@ define archhelp
136 echo ' install to $$(INSTALL_PATH) and run lilo' 139 echo ' install to $$(INSTALL_PATH) and run lilo'
137 echo ' bzdisk - Create a boot floppy in /dev/fd0' 140 echo ' bzdisk - Create a boot floppy in /dev/fd0'
138 echo ' fdimage - Create a boot floppy image' 141 echo ' fdimage - Create a boot floppy image'
142 echo ' isoimage - Create a boot CD-ROM image'
139endef 143endef
140 144
141CLEAN_FILES += arch/$(ARCH)/boot/fdimage arch/$(ARCH)/boot/mtools.conf 145CLEAN_FILES += arch/$(ARCH)/boot/fdimage \
146 arch/$(ARCH)/boot/image.iso \
147 arch/$(ARCH)/boot/mtools.conf
diff --git a/arch/i386/Makefile.cpu b/arch/i386/Makefile.cpu
index dcd936ef45db..a11befba26d5 100644
--- a/arch/i386/Makefile.cpu
+++ b/arch/i386/Makefile.cpu
@@ -39,3 +39,7 @@ cflags-$(CONFIG_X86_ELAN) += -march=i486
39# Geode GX1 support 39# Geode GX1 support
40cflags-$(CONFIG_MGEODEGX1) += -march=pentium-mmx 40cflags-$(CONFIG_MGEODEGX1) += -march=pentium-mmx
41 41
42# add at the end to overwrite eventual tuning options from earlier
43# cpu entries
44cflags-$(CONFIG_X86_GENERIC) += $(call tune,generic)
45
diff --git a/arch/i386/boot/Makefile b/arch/i386/boot/Makefile
index f136752563b1..33e55476381b 100644
--- a/arch/i386/boot/Makefile
+++ b/arch/i386/boot/Makefile
@@ -62,8 +62,12 @@ $(obj)/setup $(obj)/bootsect: %: %.o FORCE
62$(obj)/compressed/vmlinux: FORCE 62$(obj)/compressed/vmlinux: FORCE
63 $(Q)$(MAKE) $(build)=$(obj)/compressed IMAGE_OFFSET=$(IMAGE_OFFSET) $@ 63 $(Q)$(MAKE) $(build)=$(obj)/compressed IMAGE_OFFSET=$(IMAGE_OFFSET) $@
64 64
65# Set this if you want to pass append arguments to the zdisk/fdimage kernel 65# Set this if you want to pass append arguments to the zdisk/fdimage/isoimage kernel
66FDARGS = 66FDARGS =
67# Set this if you want an initrd included with the zdisk/fdimage/isoimage kernel
68FDINITRD =
69
70image_cmdline = default linux $(FDARGS) $(if $(FDINITRD),initrd=initrd.img,)
67 71
68$(obj)/mtools.conf: $(src)/mtools.conf.in 72$(obj)/mtools.conf: $(src)/mtools.conf.in
69 sed -e 's|@OBJ@|$(obj)|g' < $< > $@ 73 sed -e 's|@OBJ@|$(obj)|g' < $< > $@
@@ -72,8 +76,11 @@ $(obj)/mtools.conf: $(src)/mtools.conf.in
72zdisk: $(BOOTIMAGE) $(obj)/mtools.conf 76zdisk: $(BOOTIMAGE) $(obj)/mtools.conf
73 MTOOLSRC=$(obj)/mtools.conf mformat a: ; sync 77 MTOOLSRC=$(obj)/mtools.conf mformat a: ; sync
74 syslinux /dev/fd0 ; sync 78 syslinux /dev/fd0 ; sync
75 echo 'default linux $(FDARGS)' | \ 79 echo '$(image_cmdline)' | \
76 MTOOLSRC=$(src)/mtools.conf mcopy - a:syslinux.cfg 80 MTOOLSRC=$(src)/mtools.conf mcopy - a:syslinux.cfg
81 if [ -f '$(FDINITRD)' ] ; then \
82 MTOOLSRC=$(obj)/mtools.conf mcopy '$(FDINITRD)' a:initrd.img ; \
83 fi
77 MTOOLSRC=$(obj)/mtools.conf mcopy $(BOOTIMAGE) a:linux ; sync 84 MTOOLSRC=$(obj)/mtools.conf mcopy $(BOOTIMAGE) a:linux ; sync
78 85
79# These require being root or having syslinux 2.02 or higher installed 86# These require being root or having syslinux 2.02 or higher installed
@@ -81,18 +88,39 @@ fdimage fdimage144: $(BOOTIMAGE) $(obj)/mtools.conf
81 dd if=/dev/zero of=$(obj)/fdimage bs=1024 count=1440 88 dd if=/dev/zero of=$(obj)/fdimage bs=1024 count=1440
82 MTOOLSRC=$(obj)/mtools.conf mformat v: ; sync 89 MTOOLSRC=$(obj)/mtools.conf mformat v: ; sync
83 syslinux $(obj)/fdimage ; sync 90 syslinux $(obj)/fdimage ; sync
84 echo 'default linux $(FDARGS)' | \ 91 echo '$(image_cmdline)' | \
85 MTOOLSRC=$(obj)/mtools.conf mcopy - v:syslinux.cfg 92 MTOOLSRC=$(obj)/mtools.conf mcopy - v:syslinux.cfg
93 if [ -f '$(FDINITRD)' ] ; then \
94 MTOOLSRC=$(obj)/mtools.conf mcopy '$(FDINITRD)' v:initrd.img ; \
95 fi
86 MTOOLSRC=$(obj)/mtools.conf mcopy $(BOOTIMAGE) v:linux ; sync 96 MTOOLSRC=$(obj)/mtools.conf mcopy $(BOOTIMAGE) v:linux ; sync
87 97
88fdimage288: $(BOOTIMAGE) $(obj)/mtools.conf 98fdimage288: $(BOOTIMAGE) $(obj)/mtools.conf
89 dd if=/dev/zero of=$(obj)/fdimage bs=1024 count=2880 99 dd if=/dev/zero of=$(obj)/fdimage bs=1024 count=2880
90 MTOOLSRC=$(obj)/mtools.conf mformat w: ; sync 100 MTOOLSRC=$(obj)/mtools.conf mformat w: ; sync
91 syslinux $(obj)/fdimage ; sync 101 syslinux $(obj)/fdimage ; sync
92 echo 'default linux $(FDARGS)' | \ 102 echo '$(image_cmdline)' | \
93 MTOOLSRC=$(obj)/mtools.conf mcopy - w:syslinux.cfg 103 MTOOLSRC=$(obj)/mtools.conf mcopy - w:syslinux.cfg
104 if [ -f '$(FDINITRD)' ] ; then \
105 MTOOLSRC=$(obj)/mtools.conf mcopy '$(FDINITRD)' w:initrd.img ; \
106 fi
94 MTOOLSRC=$(obj)/mtools.conf mcopy $(BOOTIMAGE) w:linux ; sync 107 MTOOLSRC=$(obj)/mtools.conf mcopy $(BOOTIMAGE) w:linux ; sync
95 108
109isoimage: $(BOOTIMAGE)
110 -rm -rf $(obj)/isoimage
111 mkdir $(obj)/isoimage
112 cp `echo /usr/lib*/syslinux/isolinux.bin | awk '{ print $1; }'` \
113 $(obj)/isoimage
114 cp $(BOOTIMAGE) $(obj)/isoimage/linux
115 echo '$(image_cmdline)' > $(obj)/isoimage/isolinux.cfg
116 if [ -f '$(FDINITRD)' ] ; then \
117 cp '$(FDINITRD)' $(obj)/isoimage/initrd.img ; \
118 fi
119 mkisofs -J -r -o $(obj)/image.iso -b isolinux.bin -c boot.cat \
120 -no-emul-boot -boot-load-size 4 -boot-info-table \
121 $(obj)/isoimage
122 rm -rf $(obj)/isoimage
123
96zlilo: $(BOOTIMAGE) 124zlilo: $(BOOTIMAGE)
97 if [ -f $(INSTALL_PATH)/vmlinuz ]; then mv $(INSTALL_PATH)/vmlinuz $(INSTALL_PATH)/vmlinuz.old; fi 125 if [ -f $(INSTALL_PATH)/vmlinuz ]; then mv $(INSTALL_PATH)/vmlinuz $(INSTALL_PATH)/vmlinuz.old; fi
98 if [ -f $(INSTALL_PATH)/System.map ]; then mv $(INSTALL_PATH)/System.map $(INSTALL_PATH)/System.old; fi 126 if [ -f $(INSTALL_PATH)/System.map ]; then mv $(INSTALL_PATH)/System.map $(INSTALL_PATH)/System.old; fi
diff --git a/arch/i386/boot/edd.S b/arch/i386/boot/edd.S
index d8d69f2b911d..4b84ea216f2b 100644
--- a/arch/i386/boot/edd.S
+++ b/arch/i386/boot/edd.S
@@ -76,6 +76,8 @@ edd_mbr_sig_read:
76 popw %es 76 popw %es
77 popw %bx 77 popw %bx
78 jc edd_mbr_sig_done # on failure, we're done. 78 jc edd_mbr_sig_done # on failure, we're done.
79 cmpb $0, %ah # some BIOSes do not set CF
80 jne edd_mbr_sig_done # on failure, we're done.
79 movl (EDDBUF+EDD_MBR_SIG_OFFSET), %eax # read sig out of the MBR 81 movl (EDDBUF+EDD_MBR_SIG_OFFSET), %eax # read sig out of the MBR
80 movl %eax, (%bx) # store success 82 movl %eax, (%bx) # store success
81 incb (EDD_MBR_SIG_NR_BUF) # note that we stored something 83 incb (EDD_MBR_SIG_NR_BUF) # note that we stored something
diff --git a/arch/i386/boot/video.S b/arch/i386/boot/video.S
index 2ac40c8244c4..0000a2674537 100644
--- a/arch/i386/boot/video.S
+++ b/arch/i386/boot/video.S
@@ -1924,6 +1924,7 @@ skip10: movb %ah, %al
1924 ret 1924 ret
1925 1925
1926store_edid: 1926store_edid:
1927#ifdef CONFIG_FB_FIRMWARE_EDID
1927 pushw %es # just save all registers 1928 pushw %es # just save all registers
1928 pushw %ax 1929 pushw %ax
1929 pushw %bx 1930 pushw %bx
@@ -1954,6 +1955,7 @@ store_edid:
1954 popw %bx 1955 popw %bx
1955 popw %ax 1956 popw %ax
1956 popw %es 1957 popw %es
1958#endif
1957 ret 1959 ret
1958 1960
1959# VIDEO_SELECT-only variables 1961# VIDEO_SELECT-only variables
diff --git a/arch/i386/defconfig b/arch/i386/defconfig
index 3cbe6e9cb9fc..1629c3ac9bee 100644
--- a/arch/i386/defconfig
+++ b/arch/i386/defconfig
@@ -1,49 +1,87 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# 3#
4CONFIG_X86_32=y
5CONFIG_SEMAPHORE_SLEEPERS=y
4CONFIG_X86=y 6CONFIG_X86=y
5CONFIG_MMU=y 7CONFIG_MMU=y
6CONFIG_UID16=y
7CONFIG_GENERIC_ISA_DMA=y 8CONFIG_GENERIC_ISA_DMA=y
9CONFIG_GENERIC_IOMAP=y
10CONFIG_ARCH_MAY_HAVE_PC_FDC=y
11CONFIG_DMI=y
8 12
9# 13#
10# Code maturity level options 14# Code maturity level options
11# 15#
12CONFIG_EXPERIMENTAL=y 16CONFIG_EXPERIMENTAL=y
13CONFIG_CLEAN_COMPILE=y 17CONFIG_BROKEN_ON_SMP=y
14CONFIG_STANDALONE=y 18CONFIG_INIT_ENV_ARG_LIMIT=32
15 19
16# 20#
17# General setup 21# General setup
18# 22#
23CONFIG_LOCALVERSION=""
24# CONFIG_LOCALVERSION_AUTO is not set
19CONFIG_SWAP=y 25CONFIG_SWAP=y
20CONFIG_SYSVIPC=y 26CONFIG_SYSVIPC=y
21CONFIG_POSIX_MQUEUE=y 27# CONFIG_POSIX_MQUEUE is not set
22# CONFIG_BSD_PROCESS_ACCT is not set 28# CONFIG_BSD_PROCESS_ACCT is not set
23CONFIG_SYSCTL=y 29CONFIG_SYSCTL=y
24CONFIG_AUDIT=y 30# CONFIG_AUDIT is not set
25CONFIG_AUDITSYSCALL=y 31CONFIG_IKCONFIG=y
26CONFIG_LOG_BUF_SHIFT=15 32CONFIG_IKCONFIG_PROC=y
27CONFIG_HOTPLUG=y 33CONFIG_INITRAMFS_SOURCE=""
28# CONFIG_IKCONFIG is not set 34CONFIG_UID16=y
35CONFIG_VM86=y
36CONFIG_CC_OPTIMIZE_FOR_SIZE=y
29# CONFIG_EMBEDDED is not set 37# CONFIG_EMBEDDED is not set
30CONFIG_KALLSYMS=y 38CONFIG_KALLSYMS=y
39# CONFIG_KALLSYMS_EXTRA_PASS is not set
40CONFIG_HOTPLUG=y
41CONFIG_PRINTK=y
42CONFIG_BUG=y
43CONFIG_ELF_CORE=y
44CONFIG_BASE_FULL=y
31CONFIG_FUTEX=y 45CONFIG_FUTEX=y
32CONFIG_EPOLL=y 46CONFIG_EPOLL=y
33CONFIG_IOSCHED_NOOP=y 47CONFIG_SHMEM=y
34CONFIG_IOSCHED_AS=y 48CONFIG_CC_ALIGN_FUNCTIONS=0
35CONFIG_IOSCHED_DEADLINE=y 49CONFIG_CC_ALIGN_LABELS=0
36CONFIG_IOSCHED_CFQ=y 50CONFIG_CC_ALIGN_LOOPS=0
37# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set 51CONFIG_CC_ALIGN_JUMPS=0
52CONFIG_SLAB=y
53# CONFIG_TINY_SHMEM is not set
54CONFIG_BASE_SMALL=0
55# CONFIG_SLOB is not set
38 56
39# 57#
40# Loadable module support 58# Loadable module support
41# 59#
42CONFIG_MODULES=y 60CONFIG_MODULES=y
43# CONFIG_MODULE_UNLOAD is not set 61CONFIG_MODULE_UNLOAD=y
62CONFIG_MODULE_FORCE_UNLOAD=y
44CONFIG_OBSOLETE_MODPARM=y 63CONFIG_OBSOLETE_MODPARM=y
45# CONFIG_MODVERSIONS is not set 64# CONFIG_MODVERSIONS is not set
46CONFIG_KMOD=y 65# CONFIG_MODULE_SRCVERSION_ALL is not set
66# CONFIG_KMOD is not set
67
68#
69# Block layer
70#
71# CONFIG_LBD is not set
72
73#
74# IO Schedulers
75#
76CONFIG_IOSCHED_NOOP=y
77# CONFIG_IOSCHED_AS is not set
78# CONFIG_IOSCHED_DEADLINE is not set
79CONFIG_IOSCHED_CFQ=y
80# CONFIG_DEFAULT_AS is not set
81# CONFIG_DEFAULT_DEADLINE is not set
82CONFIG_DEFAULT_CFQ=y
83# CONFIG_DEFAULT_NOOP is not set
84CONFIG_DEFAULT_IOSCHED="cfq"
47 85
48# 86#
49# Processor type and features 87# Processor type and features
@@ -66,43 +104,50 @@ CONFIG_X86_PC=y
66# CONFIG_MPENTIUMII is not set 104# CONFIG_MPENTIUMII is not set
67# CONFIG_MPENTIUMIII is not set 105# CONFIG_MPENTIUMIII is not set
68# CONFIG_MPENTIUMM is not set 106# CONFIG_MPENTIUMM is not set
69CONFIG_MPENTIUM4=y 107# CONFIG_MPENTIUM4 is not set
70# CONFIG_MK6 is not set 108# CONFIG_MK6 is not set
71# CONFIG_MK7 is not set 109CONFIG_MK7=y
72# CONFIG_MK8 is not set 110# CONFIG_MK8 is not set
73# CONFIG_MCRUSOE is not set 111# CONFIG_MCRUSOE is not set
74# CONFIG_MEFFICEON is not set 112# CONFIG_MEFFICEON is not set
75# CONFIG_MWINCHIPC6 is not set 113# CONFIG_MWINCHIPC6 is not set
76# CONFIG_MWINCHIP2 is not set 114# CONFIG_MWINCHIP2 is not set
77# CONFIG_MWINCHIP3D is not set 115# CONFIG_MWINCHIP3D is not set
116# CONFIG_MGEODEGX1 is not set
117# CONFIG_MGEODE_LX is not set
78# CONFIG_MCYRIXIII is not set 118# CONFIG_MCYRIXIII is not set
79# CONFIG_MVIAC3_2 is not set 119# CONFIG_MVIAC3_2 is not set
80# CONFIG_X86_GENERIC is not set 120# CONFIG_X86_GENERIC is not set
81CONFIG_X86_CMPXCHG=y 121CONFIG_X86_CMPXCHG=y
82CONFIG_X86_XADD=y 122CONFIG_X86_XADD=y
83CONFIG_X86_L1_CACHE_SHIFT=7 123CONFIG_X86_L1_CACHE_SHIFT=6
84CONFIG_RWSEM_XCHGADD_ALGORITHM=y 124CONFIG_RWSEM_XCHGADD_ALGORITHM=y
125CONFIG_GENERIC_CALIBRATE_DELAY=y
85CONFIG_X86_WP_WORKS_OK=y 126CONFIG_X86_WP_WORKS_OK=y
86CONFIG_X86_INVLPG=y 127CONFIG_X86_INVLPG=y
87CONFIG_X86_BSWAP=y 128CONFIG_X86_BSWAP=y
88CONFIG_X86_POPAD_OK=y 129CONFIG_X86_POPAD_OK=y
130CONFIG_X86_CMPXCHG64=y
89CONFIG_X86_GOOD_APIC=y 131CONFIG_X86_GOOD_APIC=y
90CONFIG_X86_INTEL_USERCOPY=y 132CONFIG_X86_INTEL_USERCOPY=y
91CONFIG_X86_USE_PPRO_CHECKSUM=y 133CONFIG_X86_USE_PPRO_CHECKSUM=y
134CONFIG_X86_USE_3DNOW=y
135CONFIG_X86_TSC=y
92# CONFIG_HPET_TIMER is not set 136# CONFIG_HPET_TIMER is not set
93# CONFIG_HPET_EMULATE_RTC is not set 137# CONFIG_SMP is not set
94CONFIG_SMP=y 138CONFIG_PREEMPT_NONE=y
95CONFIG_NR_CPUS=8 139# CONFIG_PREEMPT_VOLUNTARY is not set
96CONFIG_SCHED_SMT=y 140# CONFIG_PREEMPT is not set
97CONFIG_PREEMPT=y 141CONFIG_X86_UP_APIC=y
142CONFIG_X86_UP_IOAPIC=y
98CONFIG_X86_LOCAL_APIC=y 143CONFIG_X86_LOCAL_APIC=y
99CONFIG_X86_IO_APIC=y 144CONFIG_X86_IO_APIC=y
100CONFIG_X86_TSC=y
101CONFIG_X86_MCE=y 145CONFIG_X86_MCE=y
102CONFIG_X86_MCE_NONFATAL=y 146CONFIG_X86_MCE_NONFATAL=y
103CONFIG_X86_MCE_P4THERMAL=y 147# CONFIG_X86_MCE_P4THERMAL is not set
104# CONFIG_TOSHIBA is not set 148# CONFIG_TOSHIBA is not set
105# CONFIG_I8K is not set 149# CONFIG_I8K is not set
150# CONFIG_X86_REBOOTFIXUPS is not set
106# CONFIG_MICROCODE is not set 151# CONFIG_MICROCODE is not set
107# CONFIG_X86_MSR is not set 152# CONFIG_X86_MSR is not set
108# CONFIG_X86_CPUID is not set 153# CONFIG_X86_CPUID is not set
@@ -111,41 +156,71 @@ CONFIG_X86_MCE_P4THERMAL=y
111# Firmware Drivers 156# Firmware Drivers
112# 157#
113# CONFIG_EDD is not set 158# CONFIG_EDD is not set
159# CONFIG_DELL_RBU is not set
160# CONFIG_DCDBAS is not set
114CONFIG_NOHIGHMEM=y 161CONFIG_NOHIGHMEM=y
115# CONFIG_HIGHMEM4G is not set 162# CONFIG_HIGHMEM4G is not set
116# CONFIG_HIGHMEM64G is not set 163# CONFIG_HIGHMEM64G is not set
164CONFIG_VMSPLIT_3G=y
165# CONFIG_VMSPLIT_3G_OPT is not set
166# CONFIG_VMSPLIT_2G is not set
167# CONFIG_VMSPLIT_1G is not set
168CONFIG_PAGE_OFFSET=0xC0000000
169CONFIG_ARCH_FLATMEM_ENABLE=y
170CONFIG_ARCH_SPARSEMEM_ENABLE=y
171CONFIG_ARCH_SELECT_MEMORY_MODEL=y
172CONFIG_SELECT_MEMORY_MODEL=y
173CONFIG_FLATMEM_MANUAL=y
174# CONFIG_DISCONTIGMEM_MANUAL is not set
175# CONFIG_SPARSEMEM_MANUAL is not set
176CONFIG_FLATMEM=y
177CONFIG_FLAT_NODE_MEM_MAP=y
178CONFIG_SPARSEMEM_STATIC=y
179CONFIG_SPLIT_PTLOCK_CPUS=4
117# CONFIG_MATH_EMULATION is not set 180# CONFIG_MATH_EMULATION is not set
118CONFIG_MTRR=y 181CONFIG_MTRR=y
119# CONFIG_EFI is not set 182# CONFIG_EFI is not set
120CONFIG_IRQBALANCE=y 183CONFIG_REGPARM=y
121CONFIG_HAVE_DEC_LOCK=y 184# CONFIG_SECCOMP is not set
122# CONFIG_REGPARM is not set 185CONFIG_HZ_100=y
186# CONFIG_HZ_250 is not set
187# CONFIG_HZ_1000 is not set
188CONFIG_HZ=100
189# CONFIG_KEXEC is not set
190CONFIG_PHYSICAL_START=0x100000
191CONFIG_DOUBLEFAULT=y
123 192
124# 193#
125# Power management options (ACPI, APM) 194# Power management options (ACPI, APM)
126# 195#
127CONFIG_PM=y 196CONFIG_PM=y
197# CONFIG_PM_LEGACY is not set
198# CONFIG_PM_DEBUG is not set
128CONFIG_SOFTWARE_SUSPEND=y 199CONFIG_SOFTWARE_SUSPEND=y
200CONFIG_PM_STD_PARTITION="/dev/hda2"
129 201
130# 202#
131# ACPI (Advanced Configuration and Power Interface) Support 203# ACPI (Advanced Configuration and Power Interface) Support
132# 204#
133CONFIG_ACPI=y 205CONFIG_ACPI=y
134CONFIG_ACPI_SLEEP=y 206# CONFIG_ACPI_SLEEP is not set
135CONFIG_ACPI_SLEEP_PROC_FS=y 207# CONFIG_ACPI_AC is not set
136CONFIG_ACPI_AC=y 208# CONFIG_ACPI_BATTERY is not set
137CONFIG_ACPI_BATTERY=y 209# CONFIG_ACPI_BUTTON is not set
138CONFIG_ACPI_BUTTON=y 210# CONFIG_ACPI_VIDEO is not set
139CONFIG_ACPI_FAN=y 211# CONFIG_ACPI_HOTKEY is not set
140CONFIG_ACPI_PROCESSOR=y 212# CONFIG_ACPI_FAN is not set
141CONFIG_ACPI_THERMAL=y 213# CONFIG_ACPI_PROCESSOR is not set
142# CONFIG_ACPI_ASUS is not set 214# CONFIG_ACPI_ASUS is not set
215# CONFIG_ACPI_IBM is not set
143# CONFIG_ACPI_TOSHIBA is not set 216# CONFIG_ACPI_TOSHIBA is not set
217CONFIG_ACPI_BLACKLIST_YEAR=0
144# CONFIG_ACPI_DEBUG is not set 218# CONFIG_ACPI_DEBUG is not set
145CONFIG_ACPI_EC=y 219CONFIG_ACPI_EC=y
146CONFIG_ACPI_POWER=y 220CONFIG_ACPI_POWER=y
147CONFIG_ACPI_SYSTEM=y 221CONFIG_ACPI_SYSTEM=y
148# CONFIG_X86_PM_TIMER is not set 222# CONFIG_X86_PM_TIMER is not set
223# CONFIG_ACPI_CONTAINER is not set
149 224
150# 225#
151# APM (Advanced Power Management) BIOS Support 226# APM (Advanced Power Management) BIOS Support
@@ -168,19 +243,18 @@ CONFIG_PCI_GOANY=y
168CONFIG_PCI_BIOS=y 243CONFIG_PCI_BIOS=y
169CONFIG_PCI_DIRECT=y 244CONFIG_PCI_DIRECT=y
170CONFIG_PCI_MMCONFIG=y 245CONFIG_PCI_MMCONFIG=y
171# CONFIG_PCI_USE_VECTOR is not set 246# CONFIG_PCIEPORTBUS is not set
172CONFIG_PCI_LEGACY_PROC=y 247# CONFIG_PCI_MSI is not set
173CONFIG_PCI_NAMES=y 248# CONFIG_PCI_LEGACY_PROC is not set
174CONFIG_ISA=y 249CONFIG_ISA_DMA_API=y
175# CONFIG_EISA is not set 250# CONFIG_ISA is not set
176# CONFIG_MCA is not set 251# CONFIG_MCA is not set
177# CONFIG_SCx200 is not set 252# CONFIG_SCx200 is not set
178 253
179# 254#
180# PCMCIA/CardBus support 255# PCCARD (PCMCIA/CardBus) support
181# 256#
182# CONFIG_PCMCIA is not set 257# CONFIG_PCCARD is not set
183CONFIG_PCMCIA_PROBE=y
184 258
185# 259#
186# PCI Hotplug Support 260# PCI Hotplug Support
@@ -191,8 +265,147 @@ CONFIG_PCMCIA_PROBE=y
191# Executable file formats 265# Executable file formats
192# 266#
193CONFIG_BINFMT_ELF=y 267CONFIG_BINFMT_ELF=y
194CONFIG_BINFMT_AOUT=y 268# CONFIG_BINFMT_AOUT is not set
195CONFIG_BINFMT_MISC=y 269# CONFIG_BINFMT_MISC is not set
270
271#
272# Networking
273#
274CONFIG_NET=y
275
276#
277# Networking options
278#
279# CONFIG_NETDEBUG is not set
280CONFIG_PACKET=y
281CONFIG_PACKET_MMAP=y
282CONFIG_UNIX=y
283# CONFIG_NET_KEY is not set
284CONFIG_INET=y
285# CONFIG_IP_MULTICAST is not set
286# CONFIG_IP_ADVANCED_ROUTER is not set
287CONFIG_IP_FIB_HASH=y
288# CONFIG_IP_PNP is not set
289# CONFIG_NET_IPIP is not set
290# CONFIG_NET_IPGRE is not set
291# CONFIG_ARPD is not set
292# CONFIG_SYN_COOKIES is not set
293# CONFIG_INET_AH is not set
294# CONFIG_INET_ESP is not set
295# CONFIG_INET_IPCOMP is not set
296# CONFIG_INET_TUNNEL is not set
297# CONFIG_INET_DIAG is not set
298# CONFIG_TCP_CONG_ADVANCED is not set
299CONFIG_TCP_CONG_BIC=y
300
301#
302# IP: Virtual Server Configuration
303#
304# CONFIG_IP_VS is not set
305# CONFIG_IPV6 is not set
306CONFIG_NETFILTER=y
307# CONFIG_NETFILTER_DEBUG is not set
308
309#
310# Core Netfilter Configuration
311#
312# CONFIG_NETFILTER_NETLINK is not set
313CONFIG_NETFILTER_XTABLES=y
314# CONFIG_NETFILTER_XT_TARGET_CLASSIFY is not set
315# CONFIG_NETFILTER_XT_TARGET_MARK is not set
316# CONFIG_NETFILTER_XT_TARGET_NFQUEUE is not set
317# CONFIG_NETFILTER_XT_MATCH_COMMENT is not set
318# CONFIG_NETFILTER_XT_MATCH_CONNTRACK is not set
319# CONFIG_NETFILTER_XT_MATCH_DCCP is not set
320# CONFIG_NETFILTER_XT_MATCH_HELPER is not set
321# CONFIG_NETFILTER_XT_MATCH_LENGTH is not set
322CONFIG_NETFILTER_XT_MATCH_LIMIT=y
323CONFIG_NETFILTER_XT_MATCH_MAC=y
324# CONFIG_NETFILTER_XT_MATCH_MARK is not set
325# CONFIG_NETFILTER_XT_MATCH_PKTTYPE is not set
326# CONFIG_NETFILTER_XT_MATCH_REALM is not set
327# CONFIG_NETFILTER_XT_MATCH_SCTP is not set
328CONFIG_NETFILTER_XT_MATCH_STATE=y
329# CONFIG_NETFILTER_XT_MATCH_STRING is not set
330# CONFIG_NETFILTER_XT_MATCH_TCPMSS is not set
331
332#
333# IP: Netfilter Configuration
334#
335CONFIG_IP_NF_CONNTRACK=y
336# CONFIG_IP_NF_CT_ACCT is not set
337# CONFIG_IP_NF_CONNTRACK_MARK is not set
338# CONFIG_IP_NF_CONNTRACK_EVENTS is not set
339# CONFIG_IP_NF_CT_PROTO_SCTP is not set
340CONFIG_IP_NF_FTP=y
341# CONFIG_IP_NF_IRC is not set
342# CONFIG_IP_NF_NETBIOS_NS is not set
343# CONFIG_IP_NF_TFTP is not set
344# CONFIG_IP_NF_AMANDA is not set
345# CONFIG_IP_NF_PPTP is not set
346# CONFIG_IP_NF_QUEUE is not set
347CONFIG_IP_NF_IPTABLES=y
348# CONFIG_IP_NF_MATCH_IPRANGE is not set
349# CONFIG_IP_NF_MATCH_MULTIPORT is not set
350# CONFIG_IP_NF_MATCH_TOS is not set
351# CONFIG_IP_NF_MATCH_RECENT is not set
352# CONFIG_IP_NF_MATCH_ECN is not set
353# CONFIG_IP_NF_MATCH_DSCP is not set
354# CONFIG_IP_NF_MATCH_AH_ESP is not set
355# CONFIG_IP_NF_MATCH_TTL is not set
356# CONFIG_IP_NF_MATCH_OWNER is not set
357# CONFIG_IP_NF_MATCH_ADDRTYPE is not set
358# CONFIG_IP_NF_MATCH_HASHLIMIT is not set
359CONFIG_IP_NF_FILTER=y
360# CONFIG_IP_NF_TARGET_REJECT is not set
361CONFIG_IP_NF_TARGET_LOG=y
362# CONFIG_IP_NF_TARGET_ULOG is not set
363# CONFIG_IP_NF_TARGET_TCPMSS is not set
364# CONFIG_IP_NF_NAT is not set
365# CONFIG_IP_NF_MANGLE is not set
366# CONFIG_IP_NF_RAW is not set
367# CONFIG_IP_NF_ARPTABLES is not set
368
369#
370# DCCP Configuration (EXPERIMENTAL)
371#
372# CONFIG_IP_DCCP is not set
373
374#
375# SCTP Configuration (EXPERIMENTAL)
376#
377# CONFIG_IP_SCTP is not set
378
379#
380# TIPC Configuration (EXPERIMENTAL)
381#
382# CONFIG_TIPC is not set
383# CONFIG_ATM is not set
384# CONFIG_BRIDGE is not set
385# CONFIG_VLAN_8021Q is not set
386# CONFIG_DECNET is not set
387# CONFIG_LLC2 is not set
388# CONFIG_IPX is not set
389# CONFIG_ATALK is not set
390# CONFIG_X25 is not set
391# CONFIG_LAPB is not set
392# CONFIG_NET_DIVERT is not set
393# CONFIG_ECONET is not set
394# CONFIG_WAN_ROUTER is not set
395
396#
397# QoS and/or fair queueing
398#
399# CONFIG_NET_SCHED is not set
400
401#
402# Network testing
403#
404# CONFIG_NET_PKTGEN is not set
405# CONFIG_HAMRADIO is not set
406# CONFIG_IRDA is not set
407# CONFIG_BT is not set
408# CONFIG_IEEE80211 is not set
196 409
197# 410#
198# Device Drivers 411# Device Drivers
@@ -201,7 +414,14 @@ CONFIG_BINFMT_MISC=y
201# 414#
202# Generic Driver Options 415# Generic Driver Options
203# 416#
204CONFIG_FW_LOADER=m 417CONFIG_STANDALONE=y
418CONFIG_PREVENT_FIRMWARE_BUILD=y
419# CONFIG_FW_LOADER is not set
420
421#
422# Connector - unified userspace <-> kernelspace linker
423#
424# CONFIG_CONNECTOR is not set
205 425
206# 426#
207# Memory Technology Devices (MTD) 427# Memory Technology Devices (MTD)
@@ -213,40 +433,36 @@ CONFIG_FW_LOADER=m
213# 433#
214CONFIG_PARPORT=y 434CONFIG_PARPORT=y
215CONFIG_PARPORT_PC=y 435CONFIG_PARPORT_PC=y
216CONFIG_PARPORT_PC_CML1=y
217# CONFIG_PARPORT_SERIAL is not set 436# CONFIG_PARPORT_SERIAL is not set
218# CONFIG_PARPORT_PC_FIFO is not set 437# CONFIG_PARPORT_PC_FIFO is not set
219# CONFIG_PARPORT_PC_SUPERIO is not set 438# CONFIG_PARPORT_PC_SUPERIO is not set
220# CONFIG_PARPORT_OTHER is not set 439# CONFIG_PARPORT_GSC is not set
221# CONFIG_PARPORT_1284 is not set 440CONFIG_PARPORT_1284=y
222 441
223# 442#
224# Plug and Play support 443# Plug and Play support
225# 444#
226CONFIG_PNP=y 445# CONFIG_PNP is not set
227# CONFIG_PNP_DEBUG is not set
228
229#
230# Protocols
231#
232# CONFIG_ISAPNP is not set
233# CONFIG_PNPBIOS is not set
234 446
235# 447#
236# Block devices 448# Block devices
237# 449#
238CONFIG_BLK_DEV_FD=y 450# CONFIG_BLK_DEV_FD is not set
239# CONFIG_BLK_DEV_XD is not set
240# CONFIG_PARIDE is not set 451# CONFIG_PARIDE is not set
241# CONFIG_BLK_CPQ_DA is not set 452# CONFIG_BLK_CPQ_DA is not set
242# CONFIG_BLK_CPQ_CISS_DA is not set 453# CONFIG_BLK_CPQ_CISS_DA is not set
243# CONFIG_BLK_DEV_DAC960 is not set 454# CONFIG_BLK_DEV_DAC960 is not set
244# CONFIG_BLK_DEV_UMEM is not set 455# CONFIG_BLK_DEV_UMEM is not set
245# CONFIG_BLK_DEV_LOOP is not set 456# CONFIG_BLK_DEV_COW_COMMON is not set
457CONFIG_BLK_DEV_LOOP=y
458# CONFIG_BLK_DEV_CRYPTOLOOP is not set
246# CONFIG_BLK_DEV_NBD is not set 459# CONFIG_BLK_DEV_NBD is not set
247# CONFIG_BLK_DEV_CARMEL is not set 460# CONFIG_BLK_DEV_SX8 is not set
461# CONFIG_BLK_DEV_UB is not set
248# CONFIG_BLK_DEV_RAM is not set 462# CONFIG_BLK_DEV_RAM is not set
249CONFIG_LBD=y 463CONFIG_BLK_DEV_RAM_COUNT=16
464# CONFIG_CDROM_PKTCDVD is not set
465# CONFIG_ATA_OVER_ETH is not set
250 466
251# 467#
252# ATA/ATAPI/MFM/RLL support 468# ATA/ATAPI/MFM/RLL support
@@ -257,34 +473,31 @@ CONFIG_BLK_DEV_IDE=y
257# 473#
258# Please see Documentation/ide.txt for help/info on IDE drives 474# Please see Documentation/ide.txt for help/info on IDE drives
259# 475#
476# CONFIG_BLK_DEV_IDE_SATA is not set
260# CONFIG_BLK_DEV_HD_IDE is not set 477# CONFIG_BLK_DEV_HD_IDE is not set
261CONFIG_BLK_DEV_IDEDISK=y 478CONFIG_BLK_DEV_IDEDISK=y
262CONFIG_IDEDISK_MULTI_MODE=y 479# CONFIG_IDEDISK_MULTI_MODE is not set
263CONFIG_BLK_DEV_IDECD=y 480CONFIG_BLK_DEV_IDECD=y
264# CONFIG_BLK_DEV_IDETAPE is not set 481# CONFIG_BLK_DEV_IDETAPE is not set
265# CONFIG_BLK_DEV_IDEFLOPPY is not set 482# CONFIG_BLK_DEV_IDEFLOPPY is not set
266# CONFIG_BLK_DEV_IDESCSI is not set 483# CONFIG_BLK_DEV_IDESCSI is not set
267# CONFIG_IDE_TASK_IOCTL is not set 484# CONFIG_IDE_TASK_IOCTL is not set
268CONFIG_IDE_TASKFILE_IO=y
269 485
270# 486#
271# IDE chipset support/bugfixes 487# IDE chipset support/bugfixes
272# 488#
273CONFIG_IDE_GENERIC=y 489# CONFIG_IDE_GENERIC is not set
274CONFIG_BLK_DEV_CMD640=y 490# CONFIG_BLK_DEV_CMD640 is not set
275# CONFIG_BLK_DEV_CMD640_ENHANCED is not set
276# CONFIG_BLK_DEV_IDEPNP is not set
277CONFIG_BLK_DEV_IDEPCI=y 491CONFIG_BLK_DEV_IDEPCI=y
278CONFIG_IDEPCI_SHARE_IRQ=y 492CONFIG_IDEPCI_SHARE_IRQ=y
279# CONFIG_BLK_DEV_OFFBOARD is not set 493# CONFIG_BLK_DEV_OFFBOARD is not set
280CONFIG_BLK_DEV_GENERIC=y 494# CONFIG_BLK_DEV_GENERIC is not set
281# CONFIG_BLK_DEV_OPTI621 is not set 495# CONFIG_BLK_DEV_OPTI621 is not set
282CONFIG_BLK_DEV_RZ1000=y 496# CONFIG_BLK_DEV_RZ1000 is not set
283CONFIG_BLK_DEV_IDEDMA_PCI=y 497CONFIG_BLK_DEV_IDEDMA_PCI=y
284# CONFIG_BLK_DEV_IDEDMA_FORCED is not set 498# CONFIG_BLK_DEV_IDEDMA_FORCED is not set
285CONFIG_IDEDMA_PCI_AUTO=y 499CONFIG_IDEDMA_PCI_AUTO=y
286# CONFIG_IDEDMA_ONLYDISK is not set 500# CONFIG_IDEDMA_ONLYDISK is not set
287CONFIG_BLK_DEV_ADMA=y
288# CONFIG_BLK_DEV_AEC62XX is not set 501# CONFIG_BLK_DEV_AEC62XX is not set
289# CONFIG_BLK_DEV_ALI15X3 is not set 502# CONFIG_BLK_DEV_ALI15X3 is not set
290# CONFIG_BLK_DEV_AMD74XX is not set 503# CONFIG_BLK_DEV_AMD74XX is not set
@@ -294,10 +507,12 @@ CONFIG_BLK_DEV_ADMA=y
294# CONFIG_BLK_DEV_CY82C693 is not set 507# CONFIG_BLK_DEV_CY82C693 is not set
295# CONFIG_BLK_DEV_CS5520 is not set 508# CONFIG_BLK_DEV_CS5520 is not set
296# CONFIG_BLK_DEV_CS5530 is not set 509# CONFIG_BLK_DEV_CS5530 is not set
510# CONFIG_BLK_DEV_CS5535 is not set
297# CONFIG_BLK_DEV_HPT34X is not set 511# CONFIG_BLK_DEV_HPT34X is not set
298# CONFIG_BLK_DEV_HPT366 is not set 512# CONFIG_BLK_DEV_HPT366 is not set
299# CONFIG_BLK_DEV_SC1200 is not set 513# CONFIG_BLK_DEV_SC1200 is not set
300CONFIG_BLK_DEV_PIIX=y 514# CONFIG_BLK_DEV_PIIX is not set
515# CONFIG_BLK_DEV_IT821X is not set
301# CONFIG_BLK_DEV_NS87415 is not set 516# CONFIG_BLK_DEV_NS87415 is not set
302# CONFIG_BLK_DEV_PDC202XX_OLD is not set 517# CONFIG_BLK_DEV_PDC202XX_OLD is not set
303# CONFIG_BLK_DEV_PDC202XX_NEW is not set 518# CONFIG_BLK_DEV_PDC202XX_NEW is not set
@@ -306,9 +521,8 @@ CONFIG_BLK_DEV_PIIX=y
306# CONFIG_BLK_DEV_SIS5513 is not set 521# CONFIG_BLK_DEV_SIS5513 is not set
307# CONFIG_BLK_DEV_SLC90E66 is not set 522# CONFIG_BLK_DEV_SLC90E66 is not set
308# CONFIG_BLK_DEV_TRM290 is not set 523# CONFIG_BLK_DEV_TRM290 is not set
309# CONFIG_BLK_DEV_VIA82CXXX is not set 524CONFIG_BLK_DEV_VIA82CXXX=y
310# CONFIG_IDE_ARM is not set 525# CONFIG_IDE_ARM is not set
311# CONFIG_IDE_CHIPSETS is not set
312CONFIG_BLK_DEV_IDEDMA=y 526CONFIG_BLK_DEV_IDEDMA=y
313# CONFIG_IDEDMA_IVB is not set 527# CONFIG_IDEDMA_IVB is not set
314CONFIG_IDEDMA_AUTO=y 528CONFIG_IDEDMA_AUTO=y
@@ -317,8 +531,9 @@ CONFIG_IDEDMA_AUTO=y
317# 531#
318# SCSI device support 532# SCSI device support
319# 533#
534# CONFIG_RAID_ATTRS is not set
320CONFIG_SCSI=y 535CONFIG_SCSI=y
321CONFIG_SCSI_PROC_FS=y 536# CONFIG_SCSI_PROC_FS is not set
322 537
323# 538#
324# SCSI support type (disk, tape, CD-ROM) 539# SCSI support type (disk, tape, CD-ROM)
@@ -327,7 +542,8 @@ CONFIG_BLK_DEV_SD=y
327# CONFIG_CHR_DEV_ST is not set 542# CONFIG_CHR_DEV_ST is not set
328# CONFIG_CHR_DEV_OSST is not set 543# CONFIG_CHR_DEV_OSST is not set
329# CONFIG_BLK_DEV_SR is not set 544# CONFIG_BLK_DEV_SR is not set
330CONFIG_CHR_DEV_SG=y 545# CONFIG_CHR_DEV_SG is not set
546# CONFIG_CHR_DEV_SCH is not set
331 547
332# 548#
333# Some SCSI devices (e.g. CD jukebox) support multiple LUNs 549# Some SCSI devices (e.g. CD jukebox) support multiple LUNs
@@ -341,79 +557,47 @@ CONFIG_CHR_DEV_SG=y
341# 557#
342# CONFIG_SCSI_SPI_ATTRS is not set 558# CONFIG_SCSI_SPI_ATTRS is not set
343# CONFIG_SCSI_FC_ATTRS is not set 559# CONFIG_SCSI_FC_ATTRS is not set
560# CONFIG_SCSI_ISCSI_ATTRS is not set
561# CONFIG_SCSI_SAS_ATTRS is not set
344 562
345# 563#
346# SCSI low-level drivers 564# SCSI low-level drivers
347# 565#
566# CONFIG_ISCSI_TCP is not set
348# CONFIG_BLK_DEV_3W_XXXX_RAID is not set 567# CONFIG_BLK_DEV_3W_XXXX_RAID is not set
349# CONFIG_SCSI_7000FASST is not set 568# CONFIG_SCSI_3W_9XXX is not set
350# CONFIG_SCSI_ACARD is not set 569# CONFIG_SCSI_ACARD is not set
351# CONFIG_SCSI_AHA152X is not set
352# CONFIG_SCSI_AHA1542 is not set
353# CONFIG_SCSI_AACRAID is not set 570# CONFIG_SCSI_AACRAID is not set
354# CONFIG_SCSI_AIC7XXX is not set 571# CONFIG_SCSI_AIC7XXX is not set
355# CONFIG_SCSI_AIC7XXX_OLD is not set 572# CONFIG_SCSI_AIC7XXX_OLD is not set
356# CONFIG_SCSI_AIC79XX is not set 573# CONFIG_SCSI_AIC79XX is not set
357CONFIG_SCSI_DPT_I2O=m 574# CONFIG_SCSI_DPT_I2O is not set
358# CONFIG_SCSI_ADVANSYS is not set 575# CONFIG_MEGARAID_NEWGEN is not set
359# CONFIG_SCSI_IN2000 is not set 576# CONFIG_MEGARAID_LEGACY is not set
360# CONFIG_SCSI_MEGARAID is not set 577# CONFIG_MEGARAID_SAS is not set
361CONFIG_SCSI_SATA=y 578# CONFIG_SCSI_SATA is not set
362# CONFIG_SCSI_SATA_SVW is not set
363CONFIG_SCSI_ATA_PIIX=y
364# CONFIG_SCSI_SATA_PROMISE is not set
365CONFIG_SCSI_SATA_SX4=m
366# CONFIG_SCSI_SATA_SIL is not set
367CONFIG_SCSI_SATA_SIS=m
368# CONFIG_SCSI_SATA_VIA is not set
369# CONFIG_SCSI_SATA_VITESSE is not set
370# CONFIG_SCSI_BUSLOGIC is not set 579# CONFIG_SCSI_BUSLOGIC is not set
371# CONFIG_SCSI_CPQFCTS is not set
372# CONFIG_SCSI_DMX3191D is not set 580# CONFIG_SCSI_DMX3191D is not set
373# CONFIG_SCSI_DTC3280 is not set
374# CONFIG_SCSI_EATA is not set 581# CONFIG_SCSI_EATA is not set
375# CONFIG_SCSI_EATA_PIO is not set
376# CONFIG_SCSI_FUTURE_DOMAIN is not set 582# CONFIG_SCSI_FUTURE_DOMAIN is not set
377# CONFIG_SCSI_GDTH is not set 583# CONFIG_SCSI_GDTH is not set
378# CONFIG_SCSI_GENERIC_NCR5380 is not set
379# CONFIG_SCSI_GENERIC_NCR5380_MMIO is not set
380# CONFIG_SCSI_IPS is not set 584# CONFIG_SCSI_IPS is not set
585# CONFIG_SCSI_INITIO is not set
381# CONFIG_SCSI_INIA100 is not set 586# CONFIG_SCSI_INIA100 is not set
382# CONFIG_SCSI_PPA is not set 587# CONFIG_SCSI_PPA is not set
383# CONFIG_SCSI_IMM is not set 588# CONFIG_SCSI_IMM is not set
384# CONFIG_SCSI_NCR53C406A is not set
385# CONFIG_SCSI_SYM53C8XX_2 is not set 589# CONFIG_SCSI_SYM53C8XX_2 is not set
386CONFIG_SCSI_IPR=m 590# CONFIG_SCSI_IPR is not set
387# CONFIG_SCSI_IPR_TRACE is not set
388# CONFIG_SCSI_IPR_DUMP is not set
389# CONFIG_SCSI_PAS16 is not set
390# CONFIG_SCSI_PSI240I is not set
391# CONFIG_SCSI_QLOGIC_FAS is not set
392# CONFIG_SCSI_QLOGIC_ISP is not set
393# CONFIG_SCSI_QLOGIC_FC is not set 591# CONFIG_SCSI_QLOGIC_FC is not set
394# CONFIG_SCSI_QLOGIC_1280 is not set 592# CONFIG_SCSI_QLOGIC_1280 is not set
395CONFIG_SCSI_QLA2XXX=y 593# CONFIG_SCSI_QLA_FC is not set
396# CONFIG_SCSI_QLA21XX is not set 594# CONFIG_SCSI_LPFC is not set
397# CONFIG_SCSI_QLA22XX is not set
398# CONFIG_SCSI_QLA2300 is not set
399# CONFIG_SCSI_QLA2322 is not set
400# CONFIG_SCSI_QLA6312 is not set
401# CONFIG_SCSI_QLA6322 is not set
402# CONFIG_SCSI_SYM53C416 is not set
403# CONFIG_SCSI_DC395x is not set 595# CONFIG_SCSI_DC395x is not set
404# CONFIG_SCSI_DC390T is not set 596# CONFIG_SCSI_DC390T is not set
405# CONFIG_SCSI_T128 is not set
406# CONFIG_SCSI_U14_34F is not set
407# CONFIG_SCSI_ULTRASTOR is not set
408# CONFIG_SCSI_NSP32 is not set 597# CONFIG_SCSI_NSP32 is not set
409# CONFIG_SCSI_DEBUG is not set 598# CONFIG_SCSI_DEBUG is not set
410 599
411# 600#
412# Old CD-ROM drivers (not SCSI, not IDE)
413#
414# CONFIG_CD_NO_IDESCSI is not set
415
416#
417# Multi-device support (RAID and LVM) 601# Multi-device support (RAID and LVM)
418# 602#
419# CONFIG_MD is not set 603# CONFIG_MD is not set
@@ -422,37 +606,14 @@ CONFIG_SCSI_QLA2XXX=y
422# Fusion MPT device support 606# Fusion MPT device support
423# 607#
424# CONFIG_FUSION is not set 608# CONFIG_FUSION is not set
609# CONFIG_FUSION_SPI is not set
610# CONFIG_FUSION_FC is not set
611# CONFIG_FUSION_SAS is not set
425 612
426# 613#
427# IEEE 1394 (FireWire) support 614# IEEE 1394 (FireWire) support
428# 615#
429CONFIG_IEEE1394=y 616# CONFIG_IEEE1394 is not set
430
431#
432# Subsystem Options
433#
434# CONFIG_IEEE1394_VERBOSEDEBUG is not set
435# CONFIG_IEEE1394_OUI_DB is not set
436# CONFIG_IEEE1394_EXTRA_CONFIG_ROMS is not set
437
438#
439# Device Drivers
440#
441
442#
443# Texas Instruments PCILynx requires I2C
444#
445CONFIG_IEEE1394_OHCI1394=y
446
447#
448# Protocol Drivers
449#
450# CONFIG_IEEE1394_VIDEO1394 is not set
451# CONFIG_IEEE1394_SBP2 is not set
452# CONFIG_IEEE1394_ETH1394 is not set
453# CONFIG_IEEE1394_DV1394 is not set
454CONFIG_IEEE1394_RAWIO=y
455# CONFIG_IEEE1394_CMP is not set
456 617
457# 618#
458# I2O device support 619# I2O device support
@@ -460,130 +621,13 @@ CONFIG_IEEE1394_RAWIO=y
460# CONFIG_I2O is not set 621# CONFIG_I2O is not set
461 622
462# 623#
463# Networking support 624# Network device support
464#
465CONFIG_NET=y
466
467#
468# Networking options
469#
470CONFIG_PACKET=y
471# CONFIG_PACKET_MMAP is not set
472# CONFIG_NETLINK_DEV is not set
473CONFIG_UNIX=y
474# CONFIG_NET_KEY is not set
475CONFIG_INET=y
476CONFIG_IP_MULTICAST=y
477# CONFIG_IP_ADVANCED_ROUTER is not set
478# CONFIG_IP_PNP is not set
479# CONFIG_NET_IPIP is not set
480# CONFIG_NET_IPGRE is not set
481# CONFIG_IP_MROUTE is not set
482# CONFIG_ARPD is not set
483# CONFIG_SYN_COOKIES is not set
484# CONFIG_INET_AH is not set
485# CONFIG_INET_ESP is not set
486# CONFIG_INET_IPCOMP is not set
487
488#
489# IP: Virtual Server Configuration
490#
491# CONFIG_IP_VS is not set
492# CONFIG_IPV6 is not set
493CONFIG_NETFILTER=y
494# CONFIG_NETFILTER_DEBUG is not set
495
496#
497# IP: Netfilter Configuration
498# 625#
499CONFIG_IP_NF_CONNTRACK=y
500# CONFIG_IP_NF_FTP is not set
501# CONFIG_IP_NF_IRC is not set
502# CONFIG_IP_NF_TFTP is not set
503# CONFIG_IP_NF_AMANDA is not set
504CONFIG_IP_NF_QUEUE=y
505CONFIG_IP_NF_IPTABLES=y
506CONFIG_IP_NF_MATCH_LIMIT=y
507CONFIG_IP_NF_MATCH_IPRANGE=y
508CONFIG_IP_NF_MATCH_MAC=y
509CONFIG_IP_NF_MATCH_PKTTYPE=y
510CONFIG_IP_NF_MATCH_MARK=y
511CONFIG_IP_NF_MATCH_MULTIPORT=y
512CONFIG_IP_NF_MATCH_TOS=y
513CONFIG_IP_NF_MATCH_RECENT=y
514CONFIG_IP_NF_MATCH_ECN=y
515CONFIG_IP_NF_MATCH_DSCP=y
516CONFIG_IP_NF_MATCH_AH_ESP=y
517CONFIG_IP_NF_MATCH_LENGTH=y
518CONFIG_IP_NF_MATCH_TTL=y
519CONFIG_IP_NF_MATCH_TCPMSS=y
520CONFIG_IP_NF_MATCH_HELPER=y
521CONFIG_IP_NF_MATCH_STATE=y
522CONFIG_IP_NF_MATCH_CONNTRACK=y
523CONFIG_IP_NF_MATCH_OWNER=y
524CONFIG_IP_NF_FILTER=y
525CONFIG_IP_NF_TARGET_REJECT=y
526CONFIG_IP_NF_NAT=y
527CONFIG_IP_NF_NAT_NEEDED=y
528CONFIG_IP_NF_TARGET_MASQUERADE=y
529CONFIG_IP_NF_TARGET_REDIRECT=y
530CONFIG_IP_NF_TARGET_NETMAP=y
531CONFIG_IP_NF_TARGET_SAME=y
532# CONFIG_IP_NF_NAT_SNMP_BASIC is not set
533CONFIG_IP_NF_MANGLE=y
534CONFIG_IP_NF_TARGET_TOS=y
535CONFIG_IP_NF_TARGET_ECN=y
536CONFIG_IP_NF_TARGET_DSCP=y
537CONFIG_IP_NF_TARGET_MARK=y
538CONFIG_IP_NF_TARGET_CLASSIFY=y
539CONFIG_IP_NF_TARGET_LOG=y
540CONFIG_IP_NF_TARGET_ULOG=y
541CONFIG_IP_NF_TARGET_TCPMSS=y
542CONFIG_IP_NF_ARPTABLES=y
543CONFIG_IP_NF_ARPFILTER=y
544CONFIG_IP_NF_ARP_MANGLE=y
545CONFIG_IP_NF_TARGET_NOTRACK=m
546CONFIG_IP_NF_RAW=m
547
548#
549# SCTP Configuration (EXPERIMENTAL)
550#
551# CONFIG_IP_SCTP is not set
552# CONFIG_ATM is not set
553# CONFIG_BRIDGE is not set
554# CONFIG_VLAN_8021Q is not set
555# CONFIG_DECNET is not set
556# CONFIG_LLC2 is not set
557# CONFIG_IPX is not set
558# CONFIG_ATALK is not set
559# CONFIG_X25 is not set
560# CONFIG_LAPB is not set
561# CONFIG_NET_DIVERT is not set
562# CONFIG_ECONET is not set
563# CONFIG_WAN_ROUTER is not set
564# CONFIG_NET_FASTROUTE is not set
565# CONFIG_NET_HW_FLOWCONTROL is not set
566
567#
568# QoS and/or fair queueing
569#
570# CONFIG_NET_SCHED is not set
571
572#
573# Network testing
574#
575# CONFIG_NET_PKTGEN is not set
576# CONFIG_NETPOLL is not set
577# CONFIG_NET_POLL_CONTROLLER is not set
578# CONFIG_HAMRADIO is not set
579# CONFIG_IRDA is not set
580# CONFIG_BT is not set
581CONFIG_NETDEVICES=y 626CONFIG_NETDEVICES=y
582CONFIG_DUMMY=m 627# CONFIG_DUMMY is not set
583# CONFIG_BONDING is not set 628# CONFIG_BONDING is not set
584# CONFIG_EQUALIZER is not set 629# CONFIG_EQUALIZER is not set
585# CONFIG_TUN is not set 630# CONFIG_TUN is not set
586# CONFIG_NET_SB1000 is not set
587 631
588# 632#
589# ARCnet devices 633# ARCnet devices
@@ -591,46 +635,39 @@ CONFIG_DUMMY=m
591# CONFIG_ARCNET is not set 635# CONFIG_ARCNET is not set
592 636
593# 637#
638# PHY device support
639#
640# CONFIG_PHYLIB is not set
641
642#
594# Ethernet (10 or 100Mbit) 643# Ethernet (10 or 100Mbit)
595# 644#
596CONFIG_NET_ETHERNET=y 645CONFIG_NET_ETHERNET=y
597CONFIG_MII=y 646CONFIG_MII=y
598# CONFIG_HAPPYMEAL is not set 647# CONFIG_HAPPYMEAL is not set
599# CONFIG_SUNGEM is not set 648# CONFIG_SUNGEM is not set
649# CONFIG_CASSINI is not set
600# CONFIG_NET_VENDOR_3COM is not set 650# CONFIG_NET_VENDOR_3COM is not set
601# CONFIG_LANCE is not set
602# CONFIG_NET_VENDOR_SMC is not set
603# CONFIG_NET_VENDOR_RACAL is not set
604 651
605# 652#
606# Tulip family network device support 653# Tulip family network device support
607# 654#
608# CONFIG_NET_TULIP is not set 655# CONFIG_NET_TULIP is not set
609# CONFIG_AT1700 is not set
610# CONFIG_DEPCA is not set
611# CONFIG_HP100 is not set 656# CONFIG_HP100 is not set
612# CONFIG_NET_ISA is not set
613CONFIG_NET_PCI=y 657CONFIG_NET_PCI=y
614# CONFIG_PCNET32 is not set 658# CONFIG_PCNET32 is not set
615# CONFIG_AMD8111_ETH is not set 659# CONFIG_AMD8111_ETH is not set
616# CONFIG_ADAPTEC_STARFIRE is not set 660# CONFIG_ADAPTEC_STARFIRE is not set
617# CONFIG_AC3200 is not set
618# CONFIG_APRICOT is not set
619# CONFIG_B44 is not set 661# CONFIG_B44 is not set
620# CONFIG_FORCEDETH is not set 662# CONFIG_FORCEDETH is not set
621# CONFIG_CS89x0 is not set
622# CONFIG_DGRS is not set 663# CONFIG_DGRS is not set
623# CONFIG_EEPRO100 is not set 664# CONFIG_EEPRO100 is not set
624# CONFIG_E100 is not set 665CONFIG_E100=y
625# CONFIG_FEALNX is not set 666# CONFIG_FEALNX is not set
626# CONFIG_NATSEMI is not set 667# CONFIG_NATSEMI is not set
627# CONFIG_NE2K_PCI is not set 668# CONFIG_NE2K_PCI is not set
628# CONFIG_8139CP is not set 669# CONFIG_8139CP is not set
629CONFIG_8139TOO=y 670# CONFIG_8139TOO is not set
630CONFIG_8139TOO_PIO=y
631# CONFIG_8139TOO_TUNE_TWISTER is not set
632# CONFIG_8139TOO_8129 is not set
633# CONFIG_8139_OLD_RX_RESET is not set
634# CONFIG_SIS900 is not set 671# CONFIG_SIS900 is not set
635# CONFIG_EPIC100 is not set 672# CONFIG_EPIC100 is not set
636# CONFIG_SUNDANCE is not set 673# CONFIG_SUNDANCE is not set
@@ -644,21 +681,24 @@ CONFIG_8139TOO_PIO=y
644# CONFIG_ACENIC is not set 681# CONFIG_ACENIC is not set
645# CONFIG_DL2K is not set 682# CONFIG_DL2K is not set
646# CONFIG_E1000 is not set 683# CONFIG_E1000 is not set
647# CONFIG_E1000_NAPI is not set
648# CONFIG_E1000_DISABLE_PACKET_SPLIT is not set
649# CONFIG_NS83820 is not set 684# CONFIG_NS83820 is not set
650# CONFIG_HAMACHI is not set 685# CONFIG_HAMACHI is not set
651# CONFIG_YELLOWFIN is not set 686# CONFIG_YELLOWFIN is not set
652# CONFIG_R8169 is not set 687# CONFIG_R8169 is not set
688# CONFIG_SIS190 is not set
689# CONFIG_SKGE is not set
690# CONFIG_SKY2 is not set
653# CONFIG_SK98LIN is not set 691# CONFIG_SK98LIN is not set
692# CONFIG_VIA_VELOCITY is not set
654# CONFIG_TIGON3 is not set 693# CONFIG_TIGON3 is not set
694# CONFIG_BNX2 is not set
655 695
656# 696#
657# Ethernet (10000 Mbit) 697# Ethernet (10000 Mbit)
658# 698#
699# CONFIG_CHELSIO_T1 is not set
659# CONFIG_IXGB is not set 700# CONFIG_IXGB is not set
660CONFIG_S2IO=m 701# CONFIG_S2IO is not set
661# CONFIG_S2IO_NAPI is not set
662 702
663# 703#
664# Token Ring devices 704# Token Ring devices
@@ -682,6 +722,8 @@ CONFIG_S2IO=m
682# CONFIG_NET_FC is not set 722# CONFIG_NET_FC is not set
683# CONFIG_SHAPER is not set 723# CONFIG_SHAPER is not set
684# CONFIG_NETCONSOLE is not set 724# CONFIG_NETCONSOLE is not set
725# CONFIG_NETPOLL is not set
726# CONFIG_NET_POLL_CONTROLLER is not set
685 727
686# 728#
687# ISDN subsystem 729# ISDN subsystem
@@ -703,26 +745,14 @@ CONFIG_INPUT=y
703# 745#
704CONFIG_INPUT_MOUSEDEV=y 746CONFIG_INPUT_MOUSEDEV=y
705CONFIG_INPUT_MOUSEDEV_PSAUX=y 747CONFIG_INPUT_MOUSEDEV_PSAUX=y
706CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024 748CONFIG_INPUT_MOUSEDEV_SCREEN_X=1280
707CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768 749CONFIG_INPUT_MOUSEDEV_SCREEN_Y=1024
708# CONFIG_INPUT_JOYDEV is not set 750# CONFIG_INPUT_JOYDEV is not set
709# CONFIG_INPUT_TSDEV is not set 751# CONFIG_INPUT_TSDEV is not set
710# CONFIG_INPUT_EVDEV is not set 752CONFIG_INPUT_EVDEV=y
711# CONFIG_INPUT_EVBUG is not set 753# CONFIG_INPUT_EVBUG is not set
712 754
713# 755#
714# Input I/O drivers
715#
716# CONFIG_GAMEPORT is not set
717CONFIG_SOUND_GAMEPORT=y
718CONFIG_SERIO=y
719CONFIG_SERIO_I8042=y
720# CONFIG_SERIO_SERPORT is not set
721# CONFIG_SERIO_CT82C710 is not set
722# CONFIG_SERIO_PARKBD is not set
723# CONFIG_SERIO_PCIPS2 is not set
724
725#
726# Input Device Drivers 756# Input Device Drivers
727# 757#
728CONFIG_INPUT_KEYBOARD=y 758CONFIG_INPUT_KEYBOARD=y
@@ -734,15 +764,25 @@ CONFIG_KEYBOARD_ATKBD=y
734CONFIG_INPUT_MOUSE=y 764CONFIG_INPUT_MOUSE=y
735CONFIG_MOUSE_PS2=y 765CONFIG_MOUSE_PS2=y
736# CONFIG_MOUSE_SERIAL is not set 766# CONFIG_MOUSE_SERIAL is not set
737# CONFIG_MOUSE_INPORT is not set
738# CONFIG_MOUSE_LOGIBM is not set
739# CONFIG_MOUSE_PC110PAD is not set
740# CONFIG_MOUSE_VSXXXAA is not set 767# CONFIG_MOUSE_VSXXXAA is not set
741# CONFIG_INPUT_JOYSTICK is not set 768# CONFIG_INPUT_JOYSTICK is not set
742# CONFIG_INPUT_TOUCHSCREEN is not set 769# CONFIG_INPUT_TOUCHSCREEN is not set
743# CONFIG_INPUT_MISC is not set 770# CONFIG_INPUT_MISC is not set
744 771
745# 772#
773# Hardware I/O ports
774#
775CONFIG_SERIO=y
776CONFIG_SERIO_I8042=y
777# CONFIG_SERIO_SERPORT is not set
778# CONFIG_SERIO_CT82C710 is not set
779# CONFIG_SERIO_PARKBD is not set
780# CONFIG_SERIO_PCIPS2 is not set
781CONFIG_SERIO_LIBPS2=y
782# CONFIG_SERIO_RAW is not set
783# CONFIG_GAMEPORT is not set
784
785#
746# Character devices 786# Character devices
747# 787#
748CONFIG_VT=y 788CONFIG_VT=y
@@ -757,12 +797,14 @@ CONFIG_SERIAL_8250=y
757# CONFIG_SERIAL_8250_CONSOLE is not set 797# CONFIG_SERIAL_8250_CONSOLE is not set
758# CONFIG_SERIAL_8250_ACPI is not set 798# CONFIG_SERIAL_8250_ACPI is not set
759CONFIG_SERIAL_8250_NR_UARTS=4 799CONFIG_SERIAL_8250_NR_UARTS=4
800CONFIG_SERIAL_8250_RUNTIME_UARTS=4
760# CONFIG_SERIAL_8250_EXTENDED is not set 801# CONFIG_SERIAL_8250_EXTENDED is not set
761 802
762# 803#
763# Non-8250 serial port support 804# Non-8250 serial port support
764# 805#
765CONFIG_SERIAL_CORE=y 806CONFIG_SERIAL_CORE=y
807# CONFIG_SERIAL_JSM is not set
766CONFIG_UNIX98_PTYS=y 808CONFIG_UNIX98_PTYS=y
767CONFIG_LEGACY_PTYS=y 809CONFIG_LEGACY_PTYS=y
768CONFIG_LEGACY_PTY_COUNT=256 810CONFIG_LEGACY_PTY_COUNT=256
@@ -770,7 +812,6 @@ CONFIG_PRINTER=y
770# CONFIG_LP_CONSOLE is not set 812# CONFIG_LP_CONSOLE is not set
771# CONFIG_PPDEV is not set 813# CONFIG_PPDEV is not set
772# CONFIG_TIPAR is not set 814# CONFIG_TIPAR is not set
773# CONFIG_QIC02_TAPE is not set
774 815
775# 816#
776# IPMI 817# IPMI
@@ -782,9 +823,8 @@ CONFIG_PRINTER=y
782# 823#
783# CONFIG_WATCHDOG is not set 824# CONFIG_WATCHDOG is not set
784# CONFIG_HW_RANDOM is not set 825# CONFIG_HW_RANDOM is not set
785# CONFIG_NVRAM is not set 826CONFIG_NVRAM=y
786# CONFIG_RTC is not set 827CONFIG_RTC=y
787# CONFIG_GEN_RTC is not set
788# CONFIG_DTLK is not set 828# CONFIG_DTLK is not set
789# CONFIG_R3964 is not set 829# CONFIG_R3964 is not set
790# CONFIG_APPLICOM is not set 830# CONFIG_APPLICOM is not set
@@ -793,34 +833,149 @@ CONFIG_PRINTER=y
793# 833#
794# Ftape, the floppy tape device driver 834# Ftape, the floppy tape device driver
795# 835#
836# CONFIG_FTAPE is not set
796CONFIG_AGP=y 837CONFIG_AGP=y
797# CONFIG_AGP_ALI is not set 838# CONFIG_AGP_ALI is not set
798# CONFIG_AGP_ATI is not set 839# CONFIG_AGP_ATI is not set
799# CONFIG_AGP_AMD is not set 840# CONFIG_AGP_AMD is not set
800# CONFIG_AGP_AMD64 is not set 841# CONFIG_AGP_AMD64 is not set
801CONFIG_AGP_INTEL=y 842# CONFIG_AGP_INTEL is not set
802# CONFIG_AGP_NVIDIA is not set 843# CONFIG_AGP_NVIDIA is not set
803# CONFIG_AGP_SIS is not set 844# CONFIG_AGP_SIS is not set
804# CONFIG_AGP_SWORKS is not set 845# CONFIG_AGP_SWORKS is not set
805# CONFIG_AGP_VIA is not set 846CONFIG_AGP_VIA=y
806# CONFIG_AGP_EFFICEON is not set 847# CONFIG_AGP_EFFICEON is not set
807CONFIG_DRM=y 848CONFIG_DRM=y
808# CONFIG_DRM_TDFX is not set 849# CONFIG_DRM_TDFX is not set
809# CONFIG_DRM_GAMMA is not set
810# CONFIG_DRM_R128 is not set 850# CONFIG_DRM_R128 is not set
811# CONFIG_DRM_RADEON is not set 851CONFIG_DRM_RADEON=y
812# CONFIG_DRM_I810 is not set
813CONFIG_DRM_I830=y
814# CONFIG_DRM_MGA is not set 852# CONFIG_DRM_MGA is not set
815# CONFIG_DRM_SIS is not set 853# CONFIG_DRM_SIS is not set
854# CONFIG_DRM_VIA is not set
855# CONFIG_DRM_SAVAGE is not set
816# CONFIG_MWAVE is not set 856# CONFIG_MWAVE is not set
857# CONFIG_CS5535_GPIO is not set
817# CONFIG_RAW_DRIVER is not set 858# CONFIG_RAW_DRIVER is not set
859# CONFIG_HPET is not set
818# CONFIG_HANGCHECK_TIMER is not set 860# CONFIG_HANGCHECK_TIMER is not set
819 861
820# 862#
863# TPM devices
864#
865# CONFIG_TCG_TPM is not set
866# CONFIG_TELCLOCK is not set
867
868#
821# I2C support 869# I2C support
822# 870#
823# CONFIG_I2C is not set 871CONFIG_I2C=y
872CONFIG_I2C_CHARDEV=y
873
874#
875# I2C Algorithms
876#
877CONFIG_I2C_ALGOBIT=y
878# CONFIG_I2C_ALGOPCF is not set
879# CONFIG_I2C_ALGOPCA is not set
880
881#
882# I2C Hardware Bus support
883#
884# CONFIG_I2C_ALI1535 is not set
885# CONFIG_I2C_ALI1563 is not set
886# CONFIG_I2C_ALI15X3 is not set
887# CONFIG_I2C_AMD756 is not set
888# CONFIG_I2C_AMD8111 is not set
889# CONFIG_I2C_I801 is not set
890# CONFIG_I2C_I810 is not set
891# CONFIG_I2C_PIIX4 is not set
892CONFIG_I2C_ISA=y
893# CONFIG_I2C_NFORCE2 is not set
894# CONFIG_I2C_PARPORT is not set
895# CONFIG_I2C_PARPORT_LIGHT is not set
896# CONFIG_I2C_PROSAVAGE is not set
897# CONFIG_I2C_SAVAGE4 is not set
898# CONFIG_SCx200_ACB is not set
899# CONFIG_I2C_SIS5595 is not set
900# CONFIG_I2C_SIS630 is not set
901# CONFIG_I2C_SIS96X is not set
902# CONFIG_I2C_STUB is not set
903# CONFIG_I2C_VIA is not set
904CONFIG_I2C_VIAPRO=y
905# CONFIG_I2C_VOODOO3 is not set
906# CONFIG_I2C_PCA_ISA is not set
907
908#
909# Miscellaneous I2C Chip support
910#
911# CONFIG_SENSORS_DS1337 is not set
912# CONFIG_SENSORS_DS1374 is not set
913# CONFIG_SENSORS_EEPROM is not set
914# CONFIG_SENSORS_PCF8574 is not set
915# CONFIG_SENSORS_PCA9539 is not set
916# CONFIG_SENSORS_PCF8591 is not set
917# CONFIG_SENSORS_RTC8564 is not set
918# CONFIG_SENSORS_MAX6875 is not set
919# CONFIG_RTC_X1205_I2C is not set
920# CONFIG_I2C_DEBUG_CORE is not set
921# CONFIG_I2C_DEBUG_ALGO is not set
922# CONFIG_I2C_DEBUG_BUS is not set
923# CONFIG_I2C_DEBUG_CHIP is not set
924
925#
926# SPI support
927#
928# CONFIG_SPI is not set
929# CONFIG_SPI_MASTER is not set
930
931#
932# Dallas's 1-wire bus
933#
934# CONFIG_W1 is not set
935
936#
937# Hardware Monitoring support
938#
939CONFIG_HWMON=y
940CONFIG_HWMON_VID=y
941# CONFIG_SENSORS_ADM1021 is not set
942# CONFIG_SENSORS_ADM1025 is not set
943# CONFIG_SENSORS_ADM1026 is not set
944# CONFIG_SENSORS_ADM1031 is not set
945# CONFIG_SENSORS_ADM9240 is not set
946# CONFIG_SENSORS_ASB100 is not set
947# CONFIG_SENSORS_ATXP1 is not set
948# CONFIG_SENSORS_DS1621 is not set
949# CONFIG_SENSORS_F71805F is not set
950# CONFIG_SENSORS_FSCHER is not set
951# CONFIG_SENSORS_FSCPOS is not set
952# CONFIG_SENSORS_GL518SM is not set
953# CONFIG_SENSORS_GL520SM is not set
954CONFIG_SENSORS_IT87=y
955# CONFIG_SENSORS_LM63 is not set
956# CONFIG_SENSORS_LM75 is not set
957# CONFIG_SENSORS_LM77 is not set
958# CONFIG_SENSORS_LM78 is not set
959# CONFIG_SENSORS_LM80 is not set
960# CONFIG_SENSORS_LM83 is not set
961# CONFIG_SENSORS_LM85 is not set
962# CONFIG_SENSORS_LM87 is not set
963# CONFIG_SENSORS_LM90 is not set
964# CONFIG_SENSORS_LM92 is not set
965# CONFIG_SENSORS_MAX1619 is not set
966# CONFIG_SENSORS_PC87360 is not set
967# CONFIG_SENSORS_SIS5595 is not set
968# CONFIG_SENSORS_SMSC47M1 is not set
969# CONFIG_SENSORS_SMSC47B397 is not set
970# CONFIG_SENSORS_VIA686A is not set
971# CONFIG_SENSORS_VT8231 is not set
972# CONFIG_SENSORS_W83781D is not set
973# CONFIG_SENSORS_W83792D is not set
974# CONFIG_SENSORS_W83L785TS is not set
975# CONFIG_SENSORS_W83627HF is not set
976# CONFIG_SENSORS_W83627EHF is not set
977# CONFIG_SENSORS_HDAPS is not set
978# CONFIG_HWMON_DEBUG_CHIP is not set
824 979
825# 980#
826# Misc devices 981# Misc devices
@@ -828,27 +983,118 @@ CONFIG_DRM_I830=y
828# CONFIG_IBM_ASM is not set 983# CONFIG_IBM_ASM is not set
829 984
830# 985#
986# Multimedia Capabilities Port drivers
987#
988
989#
831# Multimedia devices 990# Multimedia devices
832# 991#
833# CONFIG_VIDEO_DEV is not set 992CONFIG_VIDEO_DEV=y
993
994#
995# Video For Linux
996#
997
998#
999# Video Adapters
1000#
1001# CONFIG_VIDEO_ADV_DEBUG is not set
1002# CONFIG_VIDEO_BT848 is not set
1003# CONFIG_VIDEO_BWQCAM is not set
1004# CONFIG_VIDEO_CQCAM is not set
1005# CONFIG_VIDEO_W9966 is not set
1006# CONFIG_VIDEO_CPIA is not set
1007# CONFIG_VIDEO_SAA5246A is not set
1008# CONFIG_VIDEO_SAA5249 is not set
1009# CONFIG_TUNER_3036 is not set
1010# CONFIG_VIDEO_STRADIS is not set
1011# CONFIG_VIDEO_ZORAN is not set
1012CONFIG_VIDEO_SAA7134=y
1013# CONFIG_VIDEO_SAA7134_ALSA is not set
1014# CONFIG_VIDEO_MXB is not set
1015# CONFIG_VIDEO_DPC is not set
1016# CONFIG_VIDEO_HEXIUM_ORION is not set
1017# CONFIG_VIDEO_HEXIUM_GEMINI is not set
1018# CONFIG_VIDEO_CX88 is not set
1019# CONFIG_VIDEO_EM28XX is not set
1020# CONFIG_VIDEO_OVCAMCHIP is not set
1021# CONFIG_VIDEO_AUDIO_DECODER is not set
1022# CONFIG_VIDEO_DECODER is not set
1023
1024#
1025# Radio Adapters
1026#
1027# CONFIG_RADIO_GEMTEK_PCI is not set
1028# CONFIG_RADIO_MAXIRADIO is not set
1029# CONFIG_RADIO_MAESTRO is not set
834 1030
835# 1031#
836# Digital Video Broadcasting Devices 1032# Digital Video Broadcasting Devices
837# 1033#
838# CONFIG_DVB is not set 1034# CONFIG_DVB is not set
1035CONFIG_VIDEO_TUNER=y
1036CONFIG_VIDEO_BUF=y
1037CONFIG_VIDEO_IR=y
839 1038
840# 1039#
841# Graphics support 1040# Graphics support
842# 1041#
843# CONFIG_FB is not set 1042CONFIG_FB=y
844# CONFIG_VIDEO_SELECT is not set 1043CONFIG_FB_CFB_FILLRECT=y
1044CONFIG_FB_CFB_COPYAREA=y
1045CONFIG_FB_CFB_IMAGEBLIT=y
1046# CONFIG_FB_MACMODES is not set
1047CONFIG_FB_MODE_HELPERS=y
1048# CONFIG_FB_TILEBLITTING is not set
1049# CONFIG_FB_CIRRUS is not set
1050# CONFIG_FB_PM2 is not set
1051# CONFIG_FB_CYBER2000 is not set
1052# CONFIG_FB_ARC is not set
1053# CONFIG_FB_ASILIANT is not set
1054# CONFIG_FB_IMSTT is not set
1055# CONFIG_FB_VGA16 is not set
1056# CONFIG_FB_VESA is not set
1057CONFIG_VIDEO_SELECT=y
1058# CONFIG_FB_HGA is not set
1059# CONFIG_FB_S1D13XXX is not set
1060# CONFIG_FB_NVIDIA is not set
1061# CONFIG_FB_RIVA is not set
1062# CONFIG_FB_I810 is not set
1063# CONFIG_FB_INTEL is not set
1064# CONFIG_FB_MATROX is not set
1065# CONFIG_FB_RADEON_OLD is not set
1066CONFIG_FB_RADEON=y
1067CONFIG_FB_RADEON_I2C=y
1068# CONFIG_FB_RADEON_DEBUG is not set
1069# CONFIG_FB_ATY128 is not set
1070# CONFIG_FB_ATY is not set
1071# CONFIG_FB_SAVAGE is not set
1072# CONFIG_FB_SIS is not set
1073# CONFIG_FB_NEOMAGIC is not set
1074# CONFIG_FB_KYRO is not set
1075# CONFIG_FB_3DFX is not set
1076# CONFIG_FB_VOODOO1 is not set
1077# CONFIG_FB_CYBLA is not set
1078# CONFIG_FB_TRIDENT is not set
1079# CONFIG_FB_GEODE is not set
1080# CONFIG_FB_VIRTUAL is not set
845 1081
846# 1082#
847# Console display driver support 1083# Console display driver support
848# 1084#
849CONFIG_VGA_CONSOLE=y 1085CONFIG_VGA_CONSOLE=y
850# CONFIG_MDA_CONSOLE is not set
851CONFIG_DUMMY_CONSOLE=y 1086CONFIG_DUMMY_CONSOLE=y
1087CONFIG_FRAMEBUFFER_CONSOLE=y
1088# CONFIG_FRAMEBUFFER_CONSOLE_ROTATION is not set
1089# CONFIG_FONTS is not set
1090CONFIG_FONT_8x8=y
1091CONFIG_FONT_8x16=y
1092
1093#
1094# Logo configuration
1095#
1096# CONFIG_LOGO is not set
1097# CONFIG_BACKLIGHT_LCD_SUPPORT is not set
852 1098
853# 1099#
854# Sound 1100# Sound
@@ -864,10 +1110,13 @@ CONFIG_SND_PCM=y
864CONFIG_SND_RAWMIDI=y 1110CONFIG_SND_RAWMIDI=y
865CONFIG_SND_SEQUENCER=y 1111CONFIG_SND_SEQUENCER=y
866# CONFIG_SND_SEQ_DUMMY is not set 1112# CONFIG_SND_SEQ_DUMMY is not set
867CONFIG_SND_OSSEMUL=y 1113# CONFIG_SND_MIXER_OSS is not set
868CONFIG_SND_MIXER_OSS=y 1114# CONFIG_SND_PCM_OSS is not set
869CONFIG_SND_PCM_OSS=y 1115# CONFIG_SND_SEQUENCER_OSS is not set
870CONFIG_SND_SEQUENCER_OSS=y 1116CONFIG_SND_RTCTIMER=y
1117CONFIG_SND_SEQ_RTCTIMER_DEFAULT=y
1118# CONFIG_SND_DYNAMIC_MINORS is not set
1119# CONFIG_SND_SUPPORT_OLD_API is not set
871# CONFIG_SND_VERBOSE_PRINTK is not set 1120# CONFIG_SND_VERBOSE_PRINTK is not set
872# CONFIG_SND_DEBUG is not set 1121# CONFIG_SND_DEBUG is not set
873 1122
@@ -875,6 +1124,8 @@ CONFIG_SND_SEQUENCER_OSS=y
875# Generic devices 1124# Generic devices
876# 1125#
877CONFIG_SND_MPU401_UART=y 1126CONFIG_SND_MPU401_UART=y
1127CONFIG_SND_AC97_CODEC=y
1128CONFIG_SND_AC97_BUS=y
878# CONFIG_SND_DUMMY is not set 1129# CONFIG_SND_DUMMY is not set
879# CONFIG_SND_VIRMIDI is not set 1130# CONFIG_SND_VIRMIDI is not set
880# CONFIG_SND_MTPAV is not set 1131# CONFIG_SND_MTPAV is not set
@@ -882,74 +1133,57 @@ CONFIG_SND_MPU401_UART=y
882# CONFIG_SND_MPU401 is not set 1133# CONFIG_SND_MPU401 is not set
883 1134
884# 1135#
885# ISA devices
886#
887# CONFIG_SND_AD1848 is not set
888# CONFIG_SND_CS4231 is not set
889# CONFIG_SND_CS4232 is not set
890# CONFIG_SND_CS4236 is not set
891# CONFIG_SND_ES1688 is not set
892# CONFIG_SND_ES18XX is not set
893# CONFIG_SND_GUSCLASSIC is not set
894# CONFIG_SND_GUSEXTREME is not set
895# CONFIG_SND_GUSMAX is not set
896# CONFIG_SND_INTERWAVE is not set
897# CONFIG_SND_INTERWAVE_STB is not set
898# CONFIG_SND_OPTI92X_AD1848 is not set
899# CONFIG_SND_OPTI92X_CS4231 is not set
900# CONFIG_SND_OPTI93X is not set
901# CONFIG_SND_SB8 is not set
902# CONFIG_SND_SB16 is not set
903# CONFIG_SND_SBAWE is not set
904# CONFIG_SND_WAVEFRONT is not set
905# CONFIG_SND_CMI8330 is not set
906# CONFIG_SND_OPL3SA2 is not set
907# CONFIG_SND_SGALAXY is not set
908# CONFIG_SND_SSCAPE is not set
909
910#
911# PCI devices 1136# PCI devices
912# 1137#
913CONFIG_SND_AC97_CODEC=y 1138# CONFIG_SND_AD1889 is not set
1139# CONFIG_SND_ALS4000 is not set
914# CONFIG_SND_ALI5451 is not set 1140# CONFIG_SND_ALI5451 is not set
915# CONFIG_SND_ATIIXP is not set 1141# CONFIG_SND_ATIIXP is not set
1142# CONFIG_SND_ATIIXP_MODEM is not set
916# CONFIG_SND_AU8810 is not set 1143# CONFIG_SND_AU8810 is not set
917# CONFIG_SND_AU8820 is not set 1144# CONFIG_SND_AU8820 is not set
918# CONFIG_SND_AU8830 is not set 1145# CONFIG_SND_AU8830 is not set
919# CONFIG_SND_AZT3328 is not set 1146# CONFIG_SND_AZT3328 is not set
920# CONFIG_SND_BT87X is not set 1147# CONFIG_SND_BT87X is not set
921# CONFIG_SND_CS46XX is not set 1148# CONFIG_SND_CA0106 is not set
1149# CONFIG_SND_CMIPCI is not set
922# CONFIG_SND_CS4281 is not set 1150# CONFIG_SND_CS4281 is not set
1151# CONFIG_SND_CS46XX is not set
1152# CONFIG_SND_CS5535AUDIO is not set
923# CONFIG_SND_EMU10K1 is not set 1153# CONFIG_SND_EMU10K1 is not set
924# CONFIG_SND_KORG1212 is not set 1154# CONFIG_SND_EMU10K1X is not set
925# CONFIG_SND_MIXART is not set
926# CONFIG_SND_NM256 is not set
927# CONFIG_SND_RME32 is not set
928# CONFIG_SND_RME96 is not set
929# CONFIG_SND_RME9652 is not set
930# CONFIG_SND_HDSP is not set
931# CONFIG_SND_TRIDENT is not set
932# CONFIG_SND_YMFPCI is not set
933# CONFIG_SND_ALS4000 is not set
934# CONFIG_SND_CMIPCI is not set
935# CONFIG_SND_ENS1370 is not set 1155# CONFIG_SND_ENS1370 is not set
936# CONFIG_SND_ENS1371 is not set 1156# CONFIG_SND_ENS1371 is not set
937# CONFIG_SND_ES1938 is not set 1157# CONFIG_SND_ES1938 is not set
938# CONFIG_SND_ES1968 is not set 1158# CONFIG_SND_ES1968 is not set
939# CONFIG_SND_MAESTRO3 is not set
940# CONFIG_SND_FM801 is not set 1159# CONFIG_SND_FM801 is not set
1160# CONFIG_SND_HDA_INTEL is not set
1161# CONFIG_SND_HDSP is not set
1162# CONFIG_SND_HDSPM is not set
941# CONFIG_SND_ICE1712 is not set 1163# CONFIG_SND_ICE1712 is not set
942# CONFIG_SND_ICE1724 is not set 1164# CONFIG_SND_ICE1724 is not set
943CONFIG_SND_INTEL8X0=y 1165# CONFIG_SND_INTEL8X0 is not set
944# CONFIG_SND_INTEL8X0M is not set 1166# CONFIG_SND_INTEL8X0M is not set
1167# CONFIG_SND_KORG1212 is not set
1168# CONFIG_SND_MAESTRO3 is not set
1169# CONFIG_SND_MIXART is not set
1170# CONFIG_SND_NM256 is not set
1171# CONFIG_SND_PCXHR is not set
1172# CONFIG_SND_RME32 is not set
1173# CONFIG_SND_RME96 is not set
1174# CONFIG_SND_RME9652 is not set
945# CONFIG_SND_SONICVIBES is not set 1175# CONFIG_SND_SONICVIBES is not set
946# CONFIG_SND_VIA82XX is not set 1176# CONFIG_SND_TRIDENT is not set
1177CONFIG_SND_VIA82XX=y
1178# CONFIG_SND_VIA82XX_MODEM is not set
947# CONFIG_SND_VX222 is not set 1179# CONFIG_SND_VX222 is not set
1180# CONFIG_SND_YMFPCI is not set
948 1181
949# 1182#
950# ALSA USB devices 1183# USB devices
951# 1184#
952# CONFIG_SND_USB_AUDIO is not set 1185# CONFIG_SND_USB_AUDIO is not set
1186# CONFIG_SND_USB_USX2Y is not set
953 1187
954# 1188#
955# Open Sound System 1189# Open Sound System
@@ -959,6 +1193,8 @@ CONFIG_SND_INTEL8X0=y
959# 1193#
960# USB support 1194# USB support
961# 1195#
1196CONFIG_USB_ARCH_HAS_HCD=y
1197CONFIG_USB_ARCH_HAS_OHCI=y
962CONFIG_USB=y 1198CONFIG_USB=y
963# CONFIG_USB_DEBUG is not set 1199# CONFIG_USB_DEBUG is not set
964 1200
@@ -968,6 +1204,8 @@ CONFIG_USB=y
968CONFIG_USB_DEVICEFS=y 1204CONFIG_USB_DEVICEFS=y
969# CONFIG_USB_BANDWIDTH is not set 1205# CONFIG_USB_BANDWIDTH is not set
970# CONFIG_USB_DYNAMIC_MINORS is not set 1206# CONFIG_USB_DYNAMIC_MINORS is not set
1207# CONFIG_USB_SUSPEND is not set
1208# CONFIG_USB_OTG is not set
971 1209
972# 1210#
973# USB Host Controller Drivers 1211# USB Host Controller Drivers
@@ -975,68 +1213,93 @@ CONFIG_USB_DEVICEFS=y
975CONFIG_USB_EHCI_HCD=y 1213CONFIG_USB_EHCI_HCD=y
976# CONFIG_USB_EHCI_SPLIT_ISO is not set 1214# CONFIG_USB_EHCI_SPLIT_ISO is not set
977# CONFIG_USB_EHCI_ROOT_HUB_TT is not set 1215# CONFIG_USB_EHCI_ROOT_HUB_TT is not set
1216# CONFIG_USB_ISP116X_HCD is not set
978# CONFIG_USB_OHCI_HCD is not set 1217# CONFIG_USB_OHCI_HCD is not set
979CONFIG_USB_UHCI_HCD=y 1218CONFIG_USB_UHCI_HCD=y
1219# CONFIG_USB_SL811_HCD is not set
980 1220
981# 1221#
982# USB Device Class drivers 1222# USB Device Class drivers
983# 1223#
984# CONFIG_USB_AUDIO is not set 1224# CONFIG_OBSOLETE_OSS_USB_DRIVER is not set
985# CONFIG_USB_BLUETOOTH_TTY is not set
986# CONFIG_USB_MIDI is not set
987# CONFIG_USB_ACM is not set 1225# CONFIG_USB_ACM is not set
988CONFIG_USB_PRINTER=y 1226# CONFIG_USB_PRINTER is not set
1227
1228#
1229# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support'
1230#
1231
1232#
1233# may also be needed; see USB_STORAGE Help for more information
1234#
989CONFIG_USB_STORAGE=y 1235CONFIG_USB_STORAGE=y
990# CONFIG_USB_STORAGE_DEBUG is not set 1236# CONFIG_USB_STORAGE_DEBUG is not set
991# CONFIG_USB_STORAGE_DATAFAB is not set 1237# CONFIG_USB_STORAGE_DATAFAB is not set
992# CONFIG_USB_STORAGE_FREECOM is not set 1238# CONFIG_USB_STORAGE_FREECOM is not set
993# CONFIG_USB_STORAGE_ISD200 is not set 1239# CONFIG_USB_STORAGE_ISD200 is not set
994# CONFIG_USB_STORAGE_DPCM is not set 1240# CONFIG_USB_STORAGE_DPCM is not set
995# CONFIG_USB_STORAGE_HP8200e is not set 1241# CONFIG_USB_STORAGE_USBAT is not set
996# CONFIG_USB_STORAGE_SDDR09 is not set 1242# CONFIG_USB_STORAGE_SDDR09 is not set
997# CONFIG_USB_STORAGE_SDDR55 is not set 1243# CONFIG_USB_STORAGE_SDDR55 is not set
998# CONFIG_USB_STORAGE_JUMPSHOT is not set 1244# CONFIG_USB_STORAGE_JUMPSHOT is not set
1245# CONFIG_USB_STORAGE_ALAUDA is not set
1246# CONFIG_USB_LIBUSUAL is not set
999 1247
1000# 1248#
1001# USB Human Interface Devices (HID) 1249# USB Input Devices
1250#
1251# CONFIG_USB_HID is not set
1252
1002# 1253#
1003CONFIG_USB_HID=y 1254# USB HID Boot Protocol drivers
1004CONFIG_USB_HIDINPUT=y 1255#
1005# CONFIG_HID_FF is not set 1256# CONFIG_USB_KBD is not set
1006# CONFIG_USB_HIDDEV is not set 1257# CONFIG_USB_MOUSE is not set
1007# CONFIG_USB_AIPTEK is not set 1258# CONFIG_USB_AIPTEK is not set
1008# CONFIG_USB_WACOM is not set 1259# CONFIG_USB_WACOM is not set
1260# CONFIG_USB_ACECAD is not set
1009# CONFIG_USB_KBTAB is not set 1261# CONFIG_USB_KBTAB is not set
1010# CONFIG_USB_POWERMATE is not set 1262# CONFIG_USB_POWERMATE is not set
1011# CONFIG_USB_MTOUCH is not set 1263# CONFIG_USB_MTOUCH is not set
1012CONFIG_USB_EGALAX=m 1264# CONFIG_USB_ITMTOUCH is not set
1265# CONFIG_USB_EGALAX is not set
1266# CONFIG_USB_YEALINK is not set
1013# CONFIG_USB_XPAD is not set 1267# CONFIG_USB_XPAD is not set
1014# CONFIG_USB_ATI_REMOTE is not set 1268# CONFIG_USB_ATI_REMOTE is not set
1269# CONFIG_USB_ATI_REMOTE2 is not set
1270# CONFIG_USB_KEYSPAN_REMOTE is not set
1271# CONFIG_USB_APPLETOUCH is not set
1015 1272
1016# 1273#
1017# USB Imaging devices 1274# USB Imaging devices
1018# 1275#
1019# CONFIG_USB_MDC800 is not set 1276# CONFIG_USB_MDC800 is not set
1020# CONFIG_USB_MICROTEK is not set 1277# CONFIG_USB_MICROTEK is not set
1021# CONFIG_USB_HPUSBSCSI is not set
1022 1278
1023# 1279#
1024# USB Multimedia devices 1280# USB Multimedia devices
1025# 1281#
1026# CONFIG_USB_DABUSB is not set 1282# CONFIG_USB_DABUSB is not set
1283# CONFIG_USB_VICAM is not set
1284# CONFIG_USB_DSBR is not set
1285# CONFIG_USB_ET61X251 is not set
1286# CONFIG_USB_IBMCAM is not set
1287# CONFIG_USB_KONICAWC is not set
1288# CONFIG_USB_OV511 is not set
1289# CONFIG_USB_SE401 is not set
1290# CONFIG_USB_SN9C102 is not set
1291# CONFIG_USB_STV680 is not set
1292# CONFIG_USB_PWC is not set
1027 1293
1028# 1294#
1029# Video4Linux support is needed for USB Multimedia device support 1295# USB Network Adapters
1030#
1031
1032#
1033# USB Network adaptors
1034# 1296#
1035# CONFIG_USB_CATC is not set 1297# CONFIG_USB_CATC is not set
1036# CONFIG_USB_KAWETH is not set 1298# CONFIG_USB_KAWETH is not set
1037# CONFIG_USB_PEGASUS is not set 1299# CONFIG_USB_PEGASUS is not set
1038# CONFIG_USB_RTL8150 is not set 1300# CONFIG_USB_RTL8150 is not set
1039# CONFIG_USB_USBNET is not set 1301# CONFIG_USB_USBNET is not set
1302# CONFIG_USB_MON is not set
1040 1303
1041# 1304#
1042# USB port drivers 1305# USB port drivers
@@ -1053,56 +1316,85 @@ CONFIG_USB_EGALAX=m
1053# 1316#
1054# CONFIG_USB_EMI62 is not set 1317# CONFIG_USB_EMI62 is not set
1055# CONFIG_USB_EMI26 is not set 1318# CONFIG_USB_EMI26 is not set
1056# CONFIG_USB_TIGL is not set
1057# CONFIG_USB_AUERSWALD is not set 1319# CONFIG_USB_AUERSWALD is not set
1058# CONFIG_USB_RIO500 is not set 1320# CONFIG_USB_RIO500 is not set
1059# CONFIG_USB_LEGOTOWER is not set 1321# CONFIG_USB_LEGOTOWER is not set
1060# CONFIG_USB_LCD is not set 1322# CONFIG_USB_LCD is not set
1061# CONFIG_USB_LED is not set 1323# CONFIG_USB_LED is not set
1062CONFIG_USB_CYTHERM=m 1324# CONFIG_USB_CYTHERM is not set
1063CONFIG_USB_PHIDGETSERVO=m 1325# CONFIG_USB_PHIDGETKIT is not set
1326# CONFIG_USB_PHIDGETSERVO is not set
1327# CONFIG_USB_IDMOUSE is not set
1328# CONFIG_USB_SISUSBVGA is not set
1329# CONFIG_USB_LD is not set
1064# CONFIG_USB_TEST is not set 1330# CONFIG_USB_TEST is not set
1065 1331
1066# 1332#
1333# USB DSL modem support
1334#
1335
1336#
1067# USB Gadget Support 1337# USB Gadget Support
1068# 1338#
1069# CONFIG_USB_GADGET is not set 1339# CONFIG_USB_GADGET is not set
1070 1340
1071# 1341#
1342# MMC/SD Card support
1343#
1344# CONFIG_MMC is not set
1345
1346#
1347# InfiniBand support
1348#
1349# CONFIG_INFINIBAND is not set
1350
1351#
1352# SN Devices
1353#
1354
1355#
1356# EDAC - error detection and reporting (RAS)
1357#
1358# CONFIG_EDAC is not set
1359
1360#
1072# File systems 1361# File systems
1073# 1362#
1074CONFIG_EXT2_FS=y 1363CONFIG_EXT2_FS=y
1075# CONFIG_EXT2_FS_XATTR is not set 1364# CONFIG_EXT2_FS_XATTR is not set
1076CONFIG_EXT3_FS=y 1365# CONFIG_EXT2_FS_XIP is not set
1077CONFIG_EXT3_FS_XATTR=y 1366# CONFIG_EXT3_FS is not set
1078# CONFIG_EXT3_FS_POSIX_ACL is not set
1079# CONFIG_EXT3_FS_SECURITY is not set
1080CONFIG_JBD=y
1081# CONFIG_JBD_DEBUG is not set
1082CONFIG_FS_MBCACHE=y
1083# CONFIG_REISERFS_FS is not set 1367# CONFIG_REISERFS_FS is not set
1084# CONFIG_JFS_FS is not set 1368# CONFIG_JFS_FS is not set
1369# CONFIG_FS_POSIX_ACL is not set
1085# CONFIG_XFS_FS is not set 1370# CONFIG_XFS_FS is not set
1371# CONFIG_OCFS2_FS is not set
1086# CONFIG_MINIX_FS is not set 1372# CONFIG_MINIX_FS is not set
1087# CONFIG_ROMFS_FS is not set 1373# CONFIG_ROMFS_FS is not set
1374# CONFIG_INOTIFY is not set
1088# CONFIG_QUOTA is not set 1375# CONFIG_QUOTA is not set
1376CONFIG_DNOTIFY=y
1089# CONFIG_AUTOFS_FS is not set 1377# CONFIG_AUTOFS_FS is not set
1090CONFIG_AUTOFS4_FS=y 1378# CONFIG_AUTOFS4_FS is not set
1379# CONFIG_FUSE_FS is not set
1091 1380
1092# 1381#
1093# CD-ROM/DVD Filesystems 1382# CD-ROM/DVD Filesystems
1094# 1383#
1095CONFIG_ISO9660_FS=y 1384CONFIG_ISO9660_FS=y
1096CONFIG_JOLIET=y 1385CONFIG_JOLIET=y
1097# CONFIG_ZISOFS is not set 1386CONFIG_ZISOFS=y
1098CONFIG_UDF_FS=y 1387CONFIG_ZISOFS_FS=y
1388# CONFIG_UDF_FS is not set
1099 1389
1100# 1390#
1101# DOS/FAT/NT Filesystems 1391# DOS/FAT/NT Filesystems
1102# 1392#
1103CONFIG_FAT_FS=y 1393CONFIG_FAT_FS=y
1104CONFIG_MSDOS_FS=y 1394# CONFIG_MSDOS_FS is not set
1105CONFIG_VFAT_FS=y 1395CONFIG_VFAT_FS=y
1396CONFIG_FAT_DEFAULT_CODEPAGE=850
1397CONFIG_FAT_DEFAULT_IOCHARSET="iso8859-1"
1106# CONFIG_NTFS_FS is not set 1398# CONFIG_NTFS_FS is not set
1107 1399
1108# 1400#
@@ -1111,12 +1403,12 @@ CONFIG_VFAT_FS=y
1111CONFIG_PROC_FS=y 1403CONFIG_PROC_FS=y
1112CONFIG_PROC_KCORE=y 1404CONFIG_PROC_KCORE=y
1113CONFIG_SYSFS=y 1405CONFIG_SYSFS=y
1114# CONFIG_DEVFS_FS is not set
1115# CONFIG_DEVPTS_FS_XATTR is not set
1116CONFIG_TMPFS=y 1406CONFIG_TMPFS=y
1117# CONFIG_HUGETLBFS is not set 1407# CONFIG_HUGETLBFS is not set
1118# CONFIG_HUGETLB_PAGE is not set 1408# CONFIG_HUGETLB_PAGE is not set
1119CONFIG_RAMFS=y 1409CONFIG_RAMFS=y
1410# CONFIG_RELAYFS_FS is not set
1411# CONFIG_CONFIGFS_FS is not set
1120 1412
1121# 1413#
1122# Miscellaneous filesystems 1414# Miscellaneous filesystems
@@ -1138,38 +1430,48 @@ CONFIG_RAMFS=y
1138# 1430#
1139# Network File Systems 1431# Network File Systems
1140# 1432#
1141CONFIG_NFS_FS=y 1433# CONFIG_NFS_FS is not set
1142# CONFIG_NFS_V3 is not set 1434# CONFIG_NFSD is not set
1143# CONFIG_NFS_V4 is not set
1144# CONFIG_NFS_DIRECTIO is not set
1145CONFIG_NFSD=y
1146# CONFIG_NFSD_V3 is not set
1147CONFIG_NFSD_TCP=y
1148CONFIG_LOCKD=y
1149CONFIG_EXPORTFS=y
1150CONFIG_SUNRPC=y
1151# CONFIG_RPCSEC_GSS_KRB5 is not set
1152# CONFIG_SMB_FS is not set 1435# CONFIG_SMB_FS is not set
1153# CONFIG_CIFS is not set 1436CONFIG_CIFS=y
1437# CONFIG_CIFS_STATS is not set
1438# CONFIG_CIFS_XATTR is not set
1439# CONFIG_CIFS_EXPERIMENTAL is not set
1154# CONFIG_NCP_FS is not set 1440# CONFIG_NCP_FS is not set
1155# CONFIG_CODA_FS is not set 1441# CONFIG_CODA_FS is not set
1156# CONFIG_AFS_FS is not set 1442# CONFIG_AFS_FS is not set
1443# CONFIG_9P_FS is not set
1157 1444
1158# 1445#
1159# Partition Types 1446# Partition Types
1160# 1447#
1161# CONFIG_PARTITION_ADVANCED is not set 1448CONFIG_PARTITION_ADVANCED=y
1449# CONFIG_ACORN_PARTITION is not set
1450# CONFIG_OSF_PARTITION is not set
1451# CONFIG_AMIGA_PARTITION is not set
1452# CONFIG_ATARI_PARTITION is not set
1453# CONFIG_MAC_PARTITION is not set
1162CONFIG_MSDOS_PARTITION=y 1454CONFIG_MSDOS_PARTITION=y
1455# CONFIG_BSD_DISKLABEL is not set
1456# CONFIG_MINIX_SUBPARTITION is not set
1457# CONFIG_SOLARIS_X86_PARTITION is not set
1458# CONFIG_UNIXWARE_DISKLABEL is not set
1459# CONFIG_LDM_PARTITION is not set
1460# CONFIG_SGI_PARTITION is not set
1461# CONFIG_ULTRIX_PARTITION is not set
1462# CONFIG_SUN_PARTITION is not set
1463# CONFIG_KARMA_PARTITION is not set
1464# CONFIG_EFI_PARTITION is not set
1163 1465
1164# 1466#
1165# Native Language Support 1467# Native Language Support
1166# 1468#
1167CONFIG_NLS=y 1469CONFIG_NLS=y
1168CONFIG_NLS_DEFAULT="iso8859-1" 1470CONFIG_NLS_DEFAULT="iso8859-15"
1169CONFIG_NLS_CODEPAGE_437=y 1471# CONFIG_NLS_CODEPAGE_437 is not set
1170# CONFIG_NLS_CODEPAGE_737 is not set 1472# CONFIG_NLS_CODEPAGE_737 is not set
1171# CONFIG_NLS_CODEPAGE_775 is not set 1473# CONFIG_NLS_CODEPAGE_775 is not set
1172# CONFIG_NLS_CODEPAGE_850 is not set 1474CONFIG_NLS_CODEPAGE_850=y
1173# CONFIG_NLS_CODEPAGE_852 is not set 1475# CONFIG_NLS_CODEPAGE_852 is not set
1174# CONFIG_NLS_CODEPAGE_855 is not set 1476# CONFIG_NLS_CODEPAGE_855 is not set
1175# CONFIG_NLS_CODEPAGE_857 is not set 1477# CONFIG_NLS_CODEPAGE_857 is not set
@@ -1189,6 +1491,7 @@ CONFIG_NLS_CODEPAGE_437=y
1189# CONFIG_NLS_ISO8859_8 is not set 1491# CONFIG_NLS_ISO8859_8 is not set
1190# CONFIG_NLS_CODEPAGE_1250 is not set 1492# CONFIG_NLS_CODEPAGE_1250 is not set
1191# CONFIG_NLS_CODEPAGE_1251 is not set 1493# CONFIG_NLS_CODEPAGE_1251 is not set
1494# CONFIG_NLS_ASCII is not set
1192CONFIG_NLS_ISO8859_1=y 1495CONFIG_NLS_ISO8859_1=y
1193# CONFIG_NLS_ISO8859_2 is not set 1496# CONFIG_NLS_ISO8859_2 is not set
1194# CONFIG_NLS_ISO8859_3 is not set 1497# CONFIG_NLS_ISO8859_3 is not set
@@ -1199,31 +1502,33 @@ CONFIG_NLS_ISO8859_1=y
1199# CONFIG_NLS_ISO8859_9 is not set 1502# CONFIG_NLS_ISO8859_9 is not set
1200# CONFIG_NLS_ISO8859_13 is not set 1503# CONFIG_NLS_ISO8859_13 is not set
1201# CONFIG_NLS_ISO8859_14 is not set 1504# CONFIG_NLS_ISO8859_14 is not set
1202# CONFIG_NLS_ISO8859_15 is not set 1505CONFIG_NLS_ISO8859_15=y
1203# CONFIG_NLS_KOI8_R is not set 1506# CONFIG_NLS_KOI8_R is not set
1204# CONFIG_NLS_KOI8_U is not set 1507# CONFIG_NLS_KOI8_U is not set
1205# CONFIG_NLS_UTF8 is not set 1508CONFIG_NLS_UTF8=y
1206 1509
1207# 1510#
1208# Profiling support 1511# Instrumentation Support
1209# 1512#
1210CONFIG_PROFILING=y 1513# CONFIG_PROFILING is not set
1211CONFIG_OPROFILE=y 1514# CONFIG_KPROBES is not set
1212 1515
1213# 1516#
1214# Kernel hacking 1517# Kernel hacking
1215# 1518#
1519# CONFIG_PRINTK_TIME is not set
1520CONFIG_MAGIC_SYSRQ=y
1216# CONFIG_DEBUG_KERNEL is not set 1521# CONFIG_DEBUG_KERNEL is not set
1522CONFIG_LOG_BUF_SHIFT=14
1523CONFIG_DEBUG_BUGVERBOSE=y
1217CONFIG_EARLY_PRINTK=y 1524CONFIG_EARLY_PRINTK=y
1218CONFIG_DEBUG_SPINLOCK_SLEEP=y
1219# CONFIG_FRAME_POINTER is not set
1220CONFIG_4KSTACKS=y
1221CONFIG_X86_FIND_SMP_CONFIG=y 1525CONFIG_X86_FIND_SMP_CONFIG=y
1222CONFIG_X86_MPPARSE=y 1526CONFIG_X86_MPPARSE=y
1223 1527
1224# 1528#
1225# Security options 1529# Security options
1226# 1530#
1531# CONFIG_KEYS is not set
1227# CONFIG_SECURITY is not set 1532# CONFIG_SECURITY is not set
1228 1533
1229# 1534#
@@ -1232,13 +1537,18 @@ CONFIG_X86_MPPARSE=y
1232# CONFIG_CRYPTO is not set 1537# CONFIG_CRYPTO is not set
1233 1538
1234# 1539#
1540# Hardware crypto devices
1541#
1542
1543#
1235# Library routines 1544# Library routines
1236# 1545#
1546# CONFIG_CRC_CCITT is not set
1547# CONFIG_CRC16 is not set
1237CONFIG_CRC32=y 1548CONFIG_CRC32=y
1238CONFIG_LIBCRC32C=m 1549# CONFIG_LIBCRC32C is not set
1239CONFIG_X86_SMP=y 1550CONFIG_ZLIB_INFLATE=y
1240CONFIG_X86_HT=y 1551CONFIG_GENERIC_HARDIRQS=y
1552CONFIG_GENERIC_IRQ_PROBE=y
1241CONFIG_X86_BIOS_REBOOT=y 1553CONFIG_X86_BIOS_REBOOT=y
1242CONFIG_X86_TRAMPOLINE=y 1554CONFIG_KTIME_SCALAR=y
1243CONFIG_X86_STD_RESOURCES=y
1244CONFIG_PC=y
diff --git a/arch/i386/kernel/Makefile b/arch/i386/kernel/Makefile
index 65656c033d70..5b9ed21216cf 100644
--- a/arch/i386/kernel/Makefile
+++ b/arch/i386/kernel/Makefile
@@ -7,7 +7,7 @@ extra-y := head.o init_task.o vmlinux.lds
7obj-y := process.o semaphore.o signal.o entry.o traps.o irq.o \ 7obj-y := process.o semaphore.o signal.o entry.o traps.o irq.o \
8 ptrace.o time.o ioport.o ldt.o setup.o i8259.o sys_i386.o \ 8 ptrace.o time.o ioport.o ldt.o setup.o i8259.o sys_i386.o \
9 pci-dma.o i386_ksyms.o i387.o dmi_scan.o bootflag.o \ 9 pci-dma.o i386_ksyms.o i387.o dmi_scan.o bootflag.o \
10 quirks.o i8237.o topology.o 10 quirks.o i8237.o topology.o alternative.o
11 11
12obj-y += cpu/ 12obj-y += cpu/
13obj-y += timers/ 13obj-y += timers/
diff --git a/arch/i386/kernel/acpi/boot.c b/arch/i386/kernel/acpi/boot.c
index f1a21945963d..033066176b3e 100644
--- a/arch/i386/kernel/acpi/boot.c
+++ b/arch/i386/kernel/acpi/boot.c
@@ -668,10 +668,10 @@ unsigned long __init acpi_find_rsdp(void)
668 unsigned long rsdp_phys = 0; 668 unsigned long rsdp_phys = 0;
669 669
670 if (efi_enabled) { 670 if (efi_enabled) {
671 if (efi.acpi20) 671 if (efi.acpi20 != EFI_INVALID_TABLE_ADDR)
672 return __pa(efi.acpi20); 672 return efi.acpi20;
673 else if (efi.acpi) 673 else if (efi.acpi != EFI_INVALID_TABLE_ADDR)
674 return __pa(efi.acpi); 674 return efi.acpi;
675 } 675 }
676 /* 676 /*
677 * Scan memory looking for the RSDP signature. First search EBDA (low 677 * Scan memory looking for the RSDP signature. First search EBDA (low
diff --git a/arch/i386/kernel/alternative.c b/arch/i386/kernel/alternative.c
new file mode 100644
index 000000000000..5cbd6f99fb2a
--- /dev/null
+++ b/arch/i386/kernel/alternative.c
@@ -0,0 +1,321 @@
1#include <linux/module.h>
2#include <linux/spinlock.h>
3#include <linux/list.h>
4#include <asm/alternative.h>
5#include <asm/sections.h>
6
7#define DEBUG 0
8#if DEBUG
9# define DPRINTK(fmt, args...) printk(fmt, args)
10#else
11# define DPRINTK(fmt, args...)
12#endif
13
14/* Use inline assembly to define this because the nops are defined
15 as inline assembly strings in the include files and we cannot
16 get them easily into strings. */
17asm("\t.data\nintelnops: "
18 GENERIC_NOP1 GENERIC_NOP2 GENERIC_NOP3 GENERIC_NOP4 GENERIC_NOP5 GENERIC_NOP6
19 GENERIC_NOP7 GENERIC_NOP8);
20asm("\t.data\nk8nops: "
21 K8_NOP1 K8_NOP2 K8_NOP3 K8_NOP4 K8_NOP5 K8_NOP6
22 K8_NOP7 K8_NOP8);
23asm("\t.data\nk7nops: "
24 K7_NOP1 K7_NOP2 K7_NOP3 K7_NOP4 K7_NOP5 K7_NOP6
25 K7_NOP7 K7_NOP8);
26
27extern unsigned char intelnops[], k8nops[], k7nops[];
28static unsigned char *intel_nops[ASM_NOP_MAX+1] = {
29 NULL,
30 intelnops,
31 intelnops + 1,
32 intelnops + 1 + 2,
33 intelnops + 1 + 2 + 3,
34 intelnops + 1 + 2 + 3 + 4,
35 intelnops + 1 + 2 + 3 + 4 + 5,
36 intelnops + 1 + 2 + 3 + 4 + 5 + 6,
37 intelnops + 1 + 2 + 3 + 4 + 5 + 6 + 7,
38};
39static unsigned char *k8_nops[ASM_NOP_MAX+1] = {
40 NULL,
41 k8nops,
42 k8nops + 1,
43 k8nops + 1 + 2,
44 k8nops + 1 + 2 + 3,
45 k8nops + 1 + 2 + 3 + 4,
46 k8nops + 1 + 2 + 3 + 4 + 5,
47 k8nops + 1 + 2 + 3 + 4 + 5 + 6,
48 k8nops + 1 + 2 + 3 + 4 + 5 + 6 + 7,
49};
50static unsigned char *k7_nops[ASM_NOP_MAX+1] = {
51 NULL,
52 k7nops,
53 k7nops + 1,
54 k7nops + 1 + 2,
55 k7nops + 1 + 2 + 3,
56 k7nops + 1 + 2 + 3 + 4,
57 k7nops + 1 + 2 + 3 + 4 + 5,
58 k7nops + 1 + 2 + 3 + 4 + 5 + 6,
59 k7nops + 1 + 2 + 3 + 4 + 5 + 6 + 7,
60};
61static struct nop {
62 int cpuid;
63 unsigned char **noptable;
64} noptypes[] = {
65 { X86_FEATURE_K8, k8_nops },
66 { X86_FEATURE_K7, k7_nops },
67 { -1, NULL }
68};
69
70
71extern struct alt_instr __alt_instructions[], __alt_instructions_end[];
72extern struct alt_instr __smp_alt_instructions[], __smp_alt_instructions_end[];
73extern u8 *__smp_locks[], *__smp_locks_end[];
74
75extern u8 __smp_alt_begin[], __smp_alt_end[];
76
77
78static unsigned char** find_nop_table(void)
79{
80 unsigned char **noptable = intel_nops;
81 int i;
82
83 for (i = 0; noptypes[i].cpuid >= 0; i++) {
84 if (boot_cpu_has(noptypes[i].cpuid)) {
85 noptable = noptypes[i].noptable;
86 break;
87 }
88 }
89 return noptable;
90}
91
92/* Replace instructions with better alternatives for this CPU type.
93 This runs before SMP is initialized to avoid SMP problems with
94 self modifying code. This implies that assymetric systems where
95 APs have less capabilities than the boot processor are not handled.
96 Tough. Make sure you disable such features by hand. */
97
98void apply_alternatives(struct alt_instr *start, struct alt_instr *end)
99{
100 unsigned char **noptable = find_nop_table();
101 struct alt_instr *a;
102 int diff, i, k;
103
104 DPRINTK("%s: alt table %p -> %p\n", __FUNCTION__, start, end);
105 for (a = start; a < end; a++) {
106 BUG_ON(a->replacementlen > a->instrlen);
107 if (!boot_cpu_has(a->cpuid))
108 continue;
109 memcpy(a->instr, a->replacement, a->replacementlen);
110 diff = a->instrlen - a->replacementlen;
111 /* Pad the rest with nops */
112 for (i = a->replacementlen; diff > 0; diff -= k, i += k) {
113 k = diff;
114 if (k > ASM_NOP_MAX)
115 k = ASM_NOP_MAX;
116 memcpy(a->instr + i, noptable[k], k);
117 }
118 }
119}
120
121static void alternatives_smp_save(struct alt_instr *start, struct alt_instr *end)
122{
123 struct alt_instr *a;
124
125 DPRINTK("%s: alt table %p-%p\n", __FUNCTION__, start, end);
126 for (a = start; a < end; a++) {
127 memcpy(a->replacement + a->replacementlen,
128 a->instr,
129 a->instrlen);
130 }
131}
132
133static void alternatives_smp_apply(struct alt_instr *start, struct alt_instr *end)
134{
135 struct alt_instr *a;
136
137 for (a = start; a < end; a++) {
138 memcpy(a->instr,
139 a->replacement + a->replacementlen,
140 a->instrlen);
141 }
142}
143
144static void alternatives_smp_lock(u8 **start, u8 **end, u8 *text, u8 *text_end)
145{
146 u8 **ptr;
147
148 for (ptr = start; ptr < end; ptr++) {
149 if (*ptr < text)
150 continue;
151 if (*ptr > text_end)
152 continue;
153 **ptr = 0xf0; /* lock prefix */
154 };
155}
156
157static void alternatives_smp_unlock(u8 **start, u8 **end, u8 *text, u8 *text_end)
158{
159 unsigned char **noptable = find_nop_table();
160 u8 **ptr;
161
162 for (ptr = start; ptr < end; ptr++) {
163 if (*ptr < text)
164 continue;
165 if (*ptr > text_end)
166 continue;
167 **ptr = noptable[1][0];
168 };
169}
170
171struct smp_alt_module {
172 /* what is this ??? */
173 struct module *mod;
174 char *name;
175
176 /* ptrs to lock prefixes */
177 u8 **locks;
178 u8 **locks_end;
179
180 /* .text segment, needed to avoid patching init code ;) */
181 u8 *text;
182 u8 *text_end;
183
184 struct list_head next;
185};
186static LIST_HEAD(smp_alt_modules);
187static DEFINE_SPINLOCK(smp_alt);
188
189static int smp_alt_once = 0;
190static int __init bootonly(char *str)
191{
192 smp_alt_once = 1;
193 return 1;
194}
195__setup("smp-alt-boot", bootonly);
196
197void alternatives_smp_module_add(struct module *mod, char *name,
198 void *locks, void *locks_end,
199 void *text, void *text_end)
200{
201 struct smp_alt_module *smp;
202 unsigned long flags;
203
204 if (smp_alt_once) {
205 if (boot_cpu_has(X86_FEATURE_UP))
206 alternatives_smp_unlock(locks, locks_end,
207 text, text_end);
208 return;
209 }
210
211 smp = kzalloc(sizeof(*smp), GFP_KERNEL);
212 if (NULL == smp)
213 return; /* we'll run the (safe but slow) SMP code then ... */
214
215 smp->mod = mod;
216 smp->name = name;
217 smp->locks = locks;
218 smp->locks_end = locks_end;
219 smp->text = text;
220 smp->text_end = text_end;
221 DPRINTK("%s: locks %p -> %p, text %p -> %p, name %s\n",
222 __FUNCTION__, smp->locks, smp->locks_end,
223 smp->text, smp->text_end, smp->name);
224
225 spin_lock_irqsave(&smp_alt, flags);
226 list_add_tail(&smp->next, &smp_alt_modules);
227 if (boot_cpu_has(X86_FEATURE_UP))
228 alternatives_smp_unlock(smp->locks, smp->locks_end,
229 smp->text, smp->text_end);
230 spin_unlock_irqrestore(&smp_alt, flags);
231}
232
233void alternatives_smp_module_del(struct module *mod)
234{
235 struct smp_alt_module *item;
236 unsigned long flags;
237
238 if (smp_alt_once)
239 return;
240
241 spin_lock_irqsave(&smp_alt, flags);
242 list_for_each_entry(item, &smp_alt_modules, next) {
243 if (mod != item->mod)
244 continue;
245 list_del(&item->next);
246 spin_unlock_irqrestore(&smp_alt, flags);
247 DPRINTK("%s: %s\n", __FUNCTION__, item->name);
248 kfree(item);
249 return;
250 }
251 spin_unlock_irqrestore(&smp_alt, flags);
252}
253
254void alternatives_smp_switch(int smp)
255{
256 struct smp_alt_module *mod;
257 unsigned long flags;
258
259 if (smp_alt_once)
260 return;
261 BUG_ON(!smp && (num_online_cpus() > 1));
262
263 spin_lock_irqsave(&smp_alt, flags);
264 if (smp) {
265 printk(KERN_INFO "SMP alternatives: switching to SMP code\n");
266 clear_bit(X86_FEATURE_UP, boot_cpu_data.x86_capability);
267 clear_bit(X86_FEATURE_UP, cpu_data[0].x86_capability);
268 alternatives_smp_apply(__smp_alt_instructions,
269 __smp_alt_instructions_end);
270 list_for_each_entry(mod, &smp_alt_modules, next)
271 alternatives_smp_lock(mod->locks, mod->locks_end,
272 mod->text, mod->text_end);
273 } else {
274 printk(KERN_INFO "SMP alternatives: switching to UP code\n");
275 set_bit(X86_FEATURE_UP, boot_cpu_data.x86_capability);
276 set_bit(X86_FEATURE_UP, cpu_data[0].x86_capability);
277 apply_alternatives(__smp_alt_instructions,
278 __smp_alt_instructions_end);
279 list_for_each_entry(mod, &smp_alt_modules, next)
280 alternatives_smp_unlock(mod->locks, mod->locks_end,
281 mod->text, mod->text_end);
282 }
283 spin_unlock_irqrestore(&smp_alt, flags);
284}
285
286void __init alternative_instructions(void)
287{
288 apply_alternatives(__alt_instructions, __alt_instructions_end);
289
290 /* switch to patch-once-at-boottime-only mode and free the
291 * tables in case we know the number of CPUs will never ever
292 * change */
293#ifdef CONFIG_HOTPLUG_CPU
294 if (num_possible_cpus() < 2)
295 smp_alt_once = 1;
296#else
297 smp_alt_once = 1;
298#endif
299
300 if (smp_alt_once) {
301 if (1 == num_possible_cpus()) {
302 printk(KERN_INFO "SMP alternatives: switching to UP code\n");
303 set_bit(X86_FEATURE_UP, boot_cpu_data.x86_capability);
304 set_bit(X86_FEATURE_UP, cpu_data[0].x86_capability);
305 apply_alternatives(__smp_alt_instructions,
306 __smp_alt_instructions_end);
307 alternatives_smp_unlock(__smp_locks, __smp_locks_end,
308 _text, _etext);
309 }
310 free_init_pages("SMP alternatives",
311 (unsigned long)__smp_alt_begin,
312 (unsigned long)__smp_alt_end);
313 } else {
314 alternatives_smp_save(__smp_alt_instructions,
315 __smp_alt_instructions_end);
316 alternatives_smp_module_add(NULL, "core kernel",
317 __smp_locks, __smp_locks_end,
318 _text, _etext);
319 alternatives_smp_switch(0);
320 }
321}
diff --git a/arch/i386/kernel/apic.c b/arch/i386/kernel/apic.c
index f39e09ef64ec..6273bf74c203 100644
--- a/arch/i386/kernel/apic.c
+++ b/arch/i386/kernel/apic.c
@@ -38,6 +38,7 @@
38#include <asm/i8253.h> 38#include <asm/i8253.h>
39 39
40#include <mach_apic.h> 40#include <mach_apic.h>
41#include <mach_apicdef.h>
41#include <mach_ipi.h> 42#include <mach_ipi.h>
42 43
43#include "io_ports.h" 44#include "io_ports.h"
@@ -414,6 +415,7 @@ void __init init_bsp_APIC(void)
414void __devinit setup_local_APIC(void) 415void __devinit setup_local_APIC(void)
415{ 416{
416 unsigned long oldvalue, value, ver, maxlvt; 417 unsigned long oldvalue, value, ver, maxlvt;
418 int i, j;
417 419
418 /* Pound the ESR really hard over the head with a big hammer - mbligh */ 420 /* Pound the ESR really hard over the head with a big hammer - mbligh */
419 if (esr_disable) { 421 if (esr_disable) {
@@ -451,6 +453,25 @@ void __devinit setup_local_APIC(void)
451 apic_write_around(APIC_TASKPRI, value); 453 apic_write_around(APIC_TASKPRI, value);
452 454
453 /* 455 /*
456 * After a crash, we no longer service the interrupts and a pending
457 * interrupt from previous kernel might still have ISR bit set.
458 *
459 * Most probably by now CPU has serviced that pending interrupt and
460 * it might not have done the ack_APIC_irq() because it thought,
461 * interrupt came from i8259 as ExtInt. LAPIC did not get EOI so it
462 * does not clear the ISR bit and cpu thinks it has already serivced
463 * the interrupt. Hence a vector might get locked. It was noticed
464 * for timer irq (vector 0x31). Issue an extra EOI to clear ISR.
465 */
466 for (i = APIC_ISR_NR - 1; i >= 0; i--) {
467 value = apic_read(APIC_ISR + i*0x10);
468 for (j = 31; j >= 0; j--) {
469 if (value & (1<<j))
470 ack_APIC_irq();
471 }
472 }
473
474 /*
454 * Now that we are all set up, enable the APIC 475 * Now that we are all set up, enable the APIC
455 */ 476 */
456 value = apic_read(APIC_SPIV); 477 value = apic_read(APIC_SPIV);
@@ -570,16 +591,18 @@ void __devinit setup_local_APIC(void)
570 */ 591 */
571void lapic_shutdown(void) 592void lapic_shutdown(void)
572{ 593{
594 unsigned long flags;
595
573 if (!cpu_has_apic) 596 if (!cpu_has_apic)
574 return; 597 return;
575 598
576 local_irq_disable(); 599 local_irq_save(flags);
577 clear_local_APIC(); 600 clear_local_APIC();
578 601
579 if (enabled_via_apicbase) 602 if (enabled_via_apicbase)
580 disable_local_APIC(); 603 disable_local_APIC();
581 604
582 local_irq_enable(); 605 local_irq_restore(flags);
583} 606}
584 607
585#ifdef CONFIG_PM 608#ifdef CONFIG_PM
@@ -729,7 +752,7 @@ static int __init apic_set_verbosity(char *str)
729 printk(KERN_WARNING "APIC Verbosity level %s not recognised" 752 printk(KERN_WARNING "APIC Verbosity level %s not recognised"
730 " use apic=verbose or apic=debug\n", str); 753 " use apic=verbose or apic=debug\n", str);
731 754
732 return 0; 755 return 1;
733} 756}
734 757
735__setup("apic=", apic_set_verbosity); 758__setup("apic=", apic_set_verbosity);
diff --git a/arch/i386/kernel/apm.c b/arch/i386/kernel/apm.c
index 05312a8abb8b..da30a374dd4e 100644
--- a/arch/i386/kernel/apm.c
+++ b/arch/i386/kernel/apm.c
@@ -824,8 +824,6 @@ static void apm_do_busy(void)
824 824
825static void (*original_pm_idle)(void); 825static void (*original_pm_idle)(void);
826 826
827extern void default_idle(void);
828
829/** 827/**
830 * apm_cpu_idle - cpu idling for APM capable Linux 828 * apm_cpu_idle - cpu idling for APM capable Linux
831 * 829 *
diff --git a/arch/i386/kernel/cpu/centaur.c b/arch/i386/kernel/cpu/centaur.c
index f52669ecb93f..bd75629dd262 100644
--- a/arch/i386/kernel/cpu/centaur.c
+++ b/arch/i386/kernel/cpu/centaur.c
@@ -4,6 +4,7 @@
4#include <asm/processor.h> 4#include <asm/processor.h>
5#include <asm/msr.h> 5#include <asm/msr.h>
6#include <asm/e820.h> 6#include <asm/e820.h>
7#include <asm/mtrr.h>
7#include "cpu.h" 8#include "cpu.h"
8 9
9#ifdef CONFIG_X86_OOSTORE 10#ifdef CONFIG_X86_OOSTORE
diff --git a/arch/i386/kernel/cpu/common.c b/arch/i386/kernel/cpu/common.c
index e6bd095ae108..a06a49075f10 100644
--- a/arch/i386/kernel/cpu/common.c
+++ b/arch/i386/kernel/cpu/common.c
@@ -25,9 +25,10 @@ EXPORT_PER_CPU_SYMBOL(cpu_gdt_descr);
25DEFINE_PER_CPU(unsigned char, cpu_16bit_stack[CPU_16BIT_STACK_SIZE]); 25DEFINE_PER_CPU(unsigned char, cpu_16bit_stack[CPU_16BIT_STACK_SIZE]);
26EXPORT_PER_CPU_SYMBOL(cpu_16bit_stack); 26EXPORT_PER_CPU_SYMBOL(cpu_16bit_stack);
27 27
28static int cachesize_override __devinitdata = -1; 28static int cachesize_override __cpuinitdata = -1;
29static int disable_x86_fxsr __devinitdata = 0; 29static int disable_x86_fxsr __cpuinitdata;
30static int disable_x86_serial_nr __devinitdata = 1; 30static int disable_x86_serial_nr __cpuinitdata = 1;
31static int disable_x86_sep __cpuinitdata;
31 32
32struct cpu_dev * cpu_devs[X86_VENDOR_NUM] = {}; 33struct cpu_dev * cpu_devs[X86_VENDOR_NUM] = {};
33 34
@@ -59,7 +60,7 @@ static int __init cachesize_setup(char *str)
59} 60}
60__setup("cachesize=", cachesize_setup); 61__setup("cachesize=", cachesize_setup);
61 62
62int __devinit get_model_name(struct cpuinfo_x86 *c) 63int __cpuinit get_model_name(struct cpuinfo_x86 *c)
63{ 64{
64 unsigned int *v; 65 unsigned int *v;
65 char *p, *q; 66 char *p, *q;
@@ -89,7 +90,7 @@ int __devinit get_model_name(struct cpuinfo_x86 *c)
89} 90}
90 91
91 92
92void __devinit display_cacheinfo(struct cpuinfo_x86 *c) 93void __cpuinit display_cacheinfo(struct cpuinfo_x86 *c)
93{ 94{
94 unsigned int n, dummy, ecx, edx, l2size; 95 unsigned int n, dummy, ecx, edx, l2size;
95 96
@@ -130,7 +131,7 @@ void __devinit display_cacheinfo(struct cpuinfo_x86 *c)
130/* in particular, if CPUID levels 0x80000002..4 are supported, this isn't used */ 131/* in particular, if CPUID levels 0x80000002..4 are supported, this isn't used */
131 132
132/* Look up CPU names by table lookup. */ 133/* Look up CPU names by table lookup. */
133static char __devinit *table_lookup_model(struct cpuinfo_x86 *c) 134static char __cpuinit *table_lookup_model(struct cpuinfo_x86 *c)
134{ 135{
135 struct cpu_model_info *info; 136 struct cpu_model_info *info;
136 137
@@ -151,7 +152,7 @@ static char __devinit *table_lookup_model(struct cpuinfo_x86 *c)
151} 152}
152 153
153 154
154static void __devinit get_cpu_vendor(struct cpuinfo_x86 *c, int early) 155static void __cpuinit get_cpu_vendor(struct cpuinfo_x86 *c, int early)
155{ 156{
156 char *v = c->x86_vendor_id; 157 char *v = c->x86_vendor_id;
157 int i; 158 int i;
@@ -187,6 +188,14 @@ static int __init x86_fxsr_setup(char * s)
187__setup("nofxsr", x86_fxsr_setup); 188__setup("nofxsr", x86_fxsr_setup);
188 189
189 190
191static int __init x86_sep_setup(char * s)
192{
193 disable_x86_sep = 1;
194 return 1;
195}
196__setup("nosep", x86_sep_setup);
197
198
190/* Standard macro to see if a specific flag is changeable */ 199/* Standard macro to see if a specific flag is changeable */
191static inline int flag_is_changeable_p(u32 flag) 200static inline int flag_is_changeable_p(u32 flag)
192{ 201{
@@ -210,7 +219,7 @@ static inline int flag_is_changeable_p(u32 flag)
210 219
211 220
212/* Probe for the CPUID instruction */ 221/* Probe for the CPUID instruction */
213static int __devinit have_cpuid_p(void) 222static int __cpuinit have_cpuid_p(void)
214{ 223{
215 return flag_is_changeable_p(X86_EFLAGS_ID); 224 return flag_is_changeable_p(X86_EFLAGS_ID);
216} 225}
@@ -254,10 +263,10 @@ static void __init early_cpu_detect(void)
254 } 263 }
255} 264}
256 265
257void __devinit generic_identify(struct cpuinfo_x86 * c) 266void __cpuinit generic_identify(struct cpuinfo_x86 * c)
258{ 267{
259 u32 tfms, xlvl; 268 u32 tfms, xlvl;
260 int junk; 269 int ebx;
261 270
262 if (have_cpuid_p()) { 271 if (have_cpuid_p()) {
263 /* Get vendor name */ 272 /* Get vendor name */
@@ -273,7 +282,7 @@ void __devinit generic_identify(struct cpuinfo_x86 * c)
273 /* Intel-defined flags: level 0x00000001 */ 282 /* Intel-defined flags: level 0x00000001 */
274 if ( c->cpuid_level >= 0x00000001 ) { 283 if ( c->cpuid_level >= 0x00000001 ) {
275 u32 capability, excap; 284 u32 capability, excap;
276 cpuid(0x00000001, &tfms, &junk, &excap, &capability); 285 cpuid(0x00000001, &tfms, &ebx, &excap, &capability);
277 c->x86_capability[0] = capability; 286 c->x86_capability[0] = capability;
278 c->x86_capability[4] = excap; 287 c->x86_capability[4] = excap;
279 c->x86 = (tfms >> 8) & 15; 288 c->x86 = (tfms >> 8) & 15;
@@ -283,6 +292,11 @@ void __devinit generic_identify(struct cpuinfo_x86 * c)
283 if (c->x86 >= 0x6) 292 if (c->x86 >= 0x6)
284 c->x86_model += ((tfms >> 16) & 0xF) << 4; 293 c->x86_model += ((tfms >> 16) & 0xF) << 4;
285 c->x86_mask = tfms & 15; 294 c->x86_mask = tfms & 15;
295#ifdef CONFIG_SMP
296 c->apicid = phys_pkg_id((ebx >> 24) & 0xFF, 0);
297#else
298 c->apicid = (ebx >> 24) & 0xFF;
299#endif
286 } else { 300 } else {
287 /* Have CPUID level 0 only - unheard of */ 301 /* Have CPUID level 0 only - unheard of */
288 c->x86 = 4; 302 c->x86 = 4;
@@ -307,7 +321,7 @@ void __devinit generic_identify(struct cpuinfo_x86 * c)
307#endif 321#endif
308} 322}
309 323
310static void __devinit squash_the_stupid_serial_number(struct cpuinfo_x86 *c) 324static void __cpuinit squash_the_stupid_serial_number(struct cpuinfo_x86 *c)
311{ 325{
312 if (cpu_has(c, X86_FEATURE_PN) && disable_x86_serial_nr ) { 326 if (cpu_has(c, X86_FEATURE_PN) && disable_x86_serial_nr ) {
313 /* Disable processor serial number */ 327 /* Disable processor serial number */
@@ -335,7 +349,7 @@ __setup("serialnumber", x86_serial_nr_setup);
335/* 349/*
336 * This does the hard work of actually picking apart the CPU stuff... 350 * This does the hard work of actually picking apart the CPU stuff...
337 */ 351 */
338void __devinit identify_cpu(struct cpuinfo_x86 *c) 352void __cpuinit identify_cpu(struct cpuinfo_x86 *c)
339{ 353{
340 int i; 354 int i;
341 355
@@ -405,6 +419,10 @@ void __devinit identify_cpu(struct cpuinfo_x86 *c)
405 clear_bit(X86_FEATURE_XMM, c->x86_capability); 419 clear_bit(X86_FEATURE_XMM, c->x86_capability);
406 } 420 }
407 421
422 /* SEP disabled? */
423 if (disable_x86_sep)
424 clear_bit(X86_FEATURE_SEP, c->x86_capability);
425
408 if (disable_pse) 426 if (disable_pse)
409 clear_bit(X86_FEATURE_PSE, c->x86_capability); 427 clear_bit(X86_FEATURE_PSE, c->x86_capability);
410 428
@@ -417,7 +435,7 @@ void __devinit identify_cpu(struct cpuinfo_x86 *c)
417 else 435 else
418 /* Last resort... */ 436 /* Last resort... */
419 sprintf(c->x86_model_id, "%02x/%02x", 437 sprintf(c->x86_model_id, "%02x/%02x",
420 c->x86_vendor, c->x86_model); 438 c->x86, c->x86_model);
421 } 439 }
422 440
423 /* Now the feature flags better reflect actual CPU features! */ 441 /* Now the feature flags better reflect actual CPU features! */
@@ -453,7 +471,7 @@ void __devinit identify_cpu(struct cpuinfo_x86 *c)
453} 471}
454 472
455#ifdef CONFIG_X86_HT 473#ifdef CONFIG_X86_HT
456void __devinit detect_ht(struct cpuinfo_x86 *c) 474void __cpuinit detect_ht(struct cpuinfo_x86 *c)
457{ 475{
458 u32 eax, ebx, ecx, edx; 476 u32 eax, ebx, ecx, edx;
459 int index_msb, core_bits; 477 int index_msb, core_bits;
@@ -461,7 +479,6 @@ void __devinit detect_ht(struct cpuinfo_x86 *c)
461 479
462 cpuid(1, &eax, &ebx, &ecx, &edx); 480 cpuid(1, &eax, &ebx, &ecx, &edx);
463 481
464 c->apicid = phys_pkg_id((ebx >> 24) & 0xFF, 0);
465 482
466 if (!cpu_has(c, X86_FEATURE_HT) || cpu_has(c, X86_FEATURE_CMP_LEGACY)) 483 if (!cpu_has(c, X86_FEATURE_HT) || cpu_has(c, X86_FEATURE_CMP_LEGACY))
467 return; 484 return;
@@ -500,7 +517,7 @@ void __devinit detect_ht(struct cpuinfo_x86 *c)
500} 517}
501#endif 518#endif
502 519
503void __devinit print_cpu_info(struct cpuinfo_x86 *c) 520void __cpuinit print_cpu_info(struct cpuinfo_x86 *c)
504{ 521{
505 char *vendor = NULL; 522 char *vendor = NULL;
506 523
@@ -523,7 +540,7 @@ void __devinit print_cpu_info(struct cpuinfo_x86 *c)
523 printk("\n"); 540 printk("\n");
524} 541}
525 542
526cpumask_t cpu_initialized __devinitdata = CPU_MASK_NONE; 543cpumask_t cpu_initialized __cpuinitdata = CPU_MASK_NONE;
527 544
528/* This is hacky. :) 545/* This is hacky. :)
529 * We're emulating future behavior. 546 * We're emulating future behavior.
@@ -570,7 +587,7 @@ void __init early_cpu_init(void)
570 * and IDT. We reload them nevertheless, this function acts as a 587 * and IDT. We reload them nevertheless, this function acts as a
571 * 'CPU state barrier', nothing should get across. 588 * 'CPU state barrier', nothing should get across.
572 */ 589 */
573void __devinit cpu_init(void) 590void __cpuinit cpu_init(void)
574{ 591{
575 int cpu = smp_processor_id(); 592 int cpu = smp_processor_id();
576 struct tss_struct * t = &per_cpu(init_tss, cpu); 593 struct tss_struct * t = &per_cpu(init_tss, cpu);
@@ -670,7 +687,7 @@ void __devinit cpu_init(void)
670} 687}
671 688
672#ifdef CONFIG_HOTPLUG_CPU 689#ifdef CONFIG_HOTPLUG_CPU
673void __devinit cpu_uninit(void) 690void __cpuinit cpu_uninit(void)
674{ 691{
675 int cpu = raw_smp_processor_id(); 692 int cpu = raw_smp_processor_id();
676 cpu_clear(cpu, cpu_initialized); 693 cpu_clear(cpu, cpu_initialized);
diff --git a/arch/i386/kernel/cpu/cpufreq/Kconfig b/arch/i386/kernel/cpu/cpufreq/Kconfig
index 26892d2099b0..e44a4c6a4fe5 100644
--- a/arch/i386/kernel/cpu/cpufreq/Kconfig
+++ b/arch/i386/kernel/cpu/cpufreq/Kconfig
@@ -96,7 +96,6 @@ config X86_POWERNOW_K8_ACPI
96 96
97config X86_GX_SUSPMOD 97config X86_GX_SUSPMOD
98 tristate "Cyrix MediaGX/NatSemi Geode Suspend Modulation" 98 tristate "Cyrix MediaGX/NatSemi Geode Suspend Modulation"
99 depends on PCI
100 help 99 help
101 This add the CPUFreq driver for NatSemi Geode processors which 100 This add the CPUFreq driver for NatSemi Geode processors which
102 support suspend modulation. 101 support suspend modulation.
@@ -115,9 +114,9 @@ config X86_SPEEDSTEP_CENTRINO
115 you also need to say Y to "Use ACPI tables to decode..." below 114 you also need to say Y to "Use ACPI tables to decode..." below
116 [which might imply enabling ACPI] if you want to use this driver 115 [which might imply enabling ACPI] if you want to use this driver
117 on non-Banias CPUs. 116 on non-Banias CPUs.
118 117
119 For details, take a look at <file:Documentation/cpu-freq/>. 118 For details, take a look at <file:Documentation/cpu-freq/>.
120 119
121 If in doubt, say N. 120 If in doubt, say N.
122 121
123config X86_SPEEDSTEP_CENTRINO_ACPI 122config X86_SPEEDSTEP_CENTRINO_ACPI
@@ -148,7 +147,7 @@ config X86_SPEEDSTEP_ICH
148 help 147 help
149 This adds the CPUFreq driver for certain mobile Intel Pentium III 148 This adds the CPUFreq driver for certain mobile Intel Pentium III
150 (Coppermine), all mobile Intel Pentium III-M (Tualatin) and all 149 (Coppermine), all mobile Intel Pentium III-M (Tualatin) and all
151 mobile Intel Pentium 4 P4-M on systems which have an Intel ICH2, 150 mobile Intel Pentium 4 P4-M on systems which have an Intel ICH2,
152 ICH3 or ICH4 southbridge. 151 ICH3 or ICH4 southbridge.
153 152
154 For details, take a look at <file:Documentation/cpu-freq/>. 153 For details, take a look at <file:Documentation/cpu-freq/>.
@@ -161,7 +160,7 @@ config X86_SPEEDSTEP_SMI
161 depends on EXPERIMENTAL 160 depends on EXPERIMENTAL
162 help 161 help
163 This adds the CPUFreq driver for certain mobile Intel Pentium III 162 This adds the CPUFreq driver for certain mobile Intel Pentium III
164 (Coppermine), all mobile Intel Pentium III-M (Tualatin) 163 (Coppermine), all mobile Intel Pentium III-M (Tualatin)
165 on systems which have an Intel 440BX/ZX/MX southbridge. 164 on systems which have an Intel 440BX/ZX/MX southbridge.
166 165
167 For details, take a look at <file:Documentation/cpu-freq/>. 166 For details, take a look at <file:Documentation/cpu-freq/>.
@@ -203,9 +202,10 @@ config X86_LONGRUN
203config X86_LONGHAUL 202config X86_LONGHAUL
204 tristate "VIA Cyrix III Longhaul" 203 tristate "VIA Cyrix III Longhaul"
205 select CPU_FREQ_TABLE 204 select CPU_FREQ_TABLE
205 depends on BROKEN
206 help 206 help
207 This adds the CPUFreq driver for VIA Samuel/CyrixIII, 207 This adds the CPUFreq driver for VIA Samuel/CyrixIII,
208 VIA Cyrix Samuel/C3, VIA Cyrix Ezra and VIA Cyrix Ezra-T 208 VIA Cyrix Samuel/C3, VIA Cyrix Ezra and VIA Cyrix Ezra-T
209 processors. 209 processors.
210 210
211 For details, take a look at <file:Documentation/cpu-freq/>. 211 For details, take a look at <file:Documentation/cpu-freq/>.
@@ -215,11 +215,11 @@ config X86_LONGHAUL
215comment "shared options" 215comment "shared options"
216 216
217config X86_ACPI_CPUFREQ_PROC_INTF 217config X86_ACPI_CPUFREQ_PROC_INTF
218 bool "/proc/acpi/processor/../performance interface (deprecated)" 218 bool "/proc/acpi/processor/../performance interface (deprecated)"
219 depends on PROC_FS 219 depends on PROC_FS
220 depends on X86_ACPI_CPUFREQ || X86_SPEEDSTEP_CENTRINO_ACPI || X86_POWERNOW_K7_ACPI || X86_POWERNOW_K8_ACPI 220 depends on X86_ACPI_CPUFREQ || X86_SPEEDSTEP_CENTRINO_ACPI || X86_POWERNOW_K7_ACPI || X86_POWERNOW_K8_ACPI
221 help 221 help
222 This enables the deprecated /proc/acpi/processor/../performance 222 This enables the deprecated /proc/acpi/processor/../performance
223 interface. While it is helpful for debugging, the generic, 223 interface. While it is helpful for debugging, the generic,
224 cross-architecture cpufreq interfaces should be used. 224 cross-architecture cpufreq interfaces should be used.
225 225
@@ -233,9 +233,9 @@ config X86_SPEEDSTEP_RELAXED_CAP_CHECK
233 bool "Relaxed speedstep capability checks" 233 bool "Relaxed speedstep capability checks"
234 depends on (X86_SPEEDSTEP_SMI || X86_SPEEDSTEP_ICH) 234 depends on (X86_SPEEDSTEP_SMI || X86_SPEEDSTEP_ICH)
235 help 235 help
236 Don't perform all checks for a speedstep capable system which would 236 Don't perform all checks for a speedstep capable system which would
237 normally be done. Some ancient or strange systems, though speedstep 237 normally be done. Some ancient or strange systems, though speedstep
238 capable, don't always indicate that they are speedstep capable. This 238 capable, don't always indicate that they are speedstep capable. This
239 option lets the probing code bypass some of those checks if the 239 option lets the probing code bypass some of those checks if the
240 parameter "relaxed_check=1" is passed to the module. 240 parameter "relaxed_check=1" is passed to the module.
241 241
diff --git a/arch/i386/kernel/cpu/cpufreq/cpufreq-nforce2.c b/arch/i386/kernel/cpu/cpufreq/cpufreq-nforce2.c
index 2b62dee35c6c..f275e0d4aee5 100644
--- a/arch/i386/kernel/cpu/cpufreq/cpufreq-nforce2.c
+++ b/arch/i386/kernel/cpu/cpufreq/cpufreq-nforce2.c
@@ -39,7 +39,7 @@ static struct pci_dev *nforce2_chipset_dev;
39static int fid = 0; 39static int fid = 0;
40 40
41/* min_fsb, max_fsb: 41/* min_fsb, max_fsb:
42 * minimum and maximum FSB (= FSB at boot time) 42 * minimum and maximum FSB (= FSB at boot time)
43 */ 43 */
44static int min_fsb = 0; 44static int min_fsb = 0;
45static int max_fsb = 0; 45static int max_fsb = 0;
@@ -57,10 +57,10 @@ MODULE_PARM_DESC(min_fsb,
57 57
58#define dprintk(msg...) cpufreq_debug_printk(CPUFREQ_DEBUG_DRIVER, "cpufreq-nforce2", msg) 58#define dprintk(msg...) cpufreq_debug_printk(CPUFREQ_DEBUG_DRIVER, "cpufreq-nforce2", msg)
59 59
60/* 60/**
61 * nforce2_calc_fsb - calculate FSB 61 * nforce2_calc_fsb - calculate FSB
62 * @pll: PLL value 62 * @pll: PLL value
63 * 63 *
64 * Calculates FSB from PLL value 64 * Calculates FSB from PLL value
65 */ 65 */
66static int nforce2_calc_fsb(int pll) 66static int nforce2_calc_fsb(int pll)
@@ -76,10 +76,10 @@ static int nforce2_calc_fsb(int pll)
76 return 0; 76 return 0;
77} 77}
78 78
79/* 79/**
80 * nforce2_calc_pll - calculate PLL value 80 * nforce2_calc_pll - calculate PLL value
81 * @fsb: FSB 81 * @fsb: FSB
82 * 82 *
83 * Calculate PLL value for given FSB 83 * Calculate PLL value for given FSB
84 */ 84 */
85static int nforce2_calc_pll(unsigned int fsb) 85static int nforce2_calc_pll(unsigned int fsb)
@@ -106,10 +106,10 @@ static int nforce2_calc_pll(unsigned int fsb)
106 return NFORCE2_PLL(mul, div); 106 return NFORCE2_PLL(mul, div);
107} 107}
108 108
109/* 109/**
110 * nforce2_write_pll - write PLL value to chipset 110 * nforce2_write_pll - write PLL value to chipset
111 * @pll: PLL value 111 * @pll: PLL value
112 * 112 *
113 * Writes new FSB PLL value to chipset 113 * Writes new FSB PLL value to chipset
114 */ 114 */
115static void nforce2_write_pll(int pll) 115static void nforce2_write_pll(int pll)
@@ -121,15 +121,13 @@ static void nforce2_write_pll(int pll)
121 pci_write_config_dword(nforce2_chipset_dev, NFORCE2_PLLADR, temp); 121 pci_write_config_dword(nforce2_chipset_dev, NFORCE2_PLLADR, temp);
122 122
123 /* Now write the value in all 64 registers */ 123 /* Now write the value in all 64 registers */
124 for (temp = 0; temp <= 0x3f; temp++) { 124 for (temp = 0; temp <= 0x3f; temp++)
125 pci_write_config_dword(nforce2_chipset_dev, 125 pci_write_config_dword(nforce2_chipset_dev, NFORCE2_PLLREG, pll);
126 NFORCE2_PLLREG, pll);
127 }
128 126
129 return; 127 return;
130} 128}
131 129
132/* 130/**
133 * nforce2_fsb_read - Read FSB 131 * nforce2_fsb_read - Read FSB
134 * 132 *
135 * Read FSB from chipset 133 * Read FSB from chipset
@@ -140,39 +138,32 @@ static unsigned int nforce2_fsb_read(int bootfsb)
140 struct pci_dev *nforce2_sub5; 138 struct pci_dev *nforce2_sub5;
141 u32 fsb, temp = 0; 139 u32 fsb, temp = 0;
142 140
143
144 /* Get chipset boot FSB from subdevice 5 (FSB at boot-time) */ 141 /* Get chipset boot FSB from subdevice 5 (FSB at boot-time) */
145 nforce2_sub5 = pci_get_subsys(PCI_VENDOR_ID_NVIDIA, 142 nforce2_sub5 = pci_get_subsys(PCI_VENDOR_ID_NVIDIA,
146 0x01EF, 143 0x01EF,PCI_ANY_ID,PCI_ANY_ID,NULL);
147 PCI_ANY_ID,
148 PCI_ANY_ID,
149 NULL);
150
151 if (!nforce2_sub5) 144 if (!nforce2_sub5)
152 return 0; 145 return 0;
153 146
154 pci_read_config_dword(nforce2_sub5, NFORCE2_BOOTFSB, &fsb); 147 pci_read_config_dword(nforce2_sub5, NFORCE2_BOOTFSB, &fsb);
155 fsb /= 1000000; 148 fsb /= 1000000;
156 149
157 /* Check if PLL register is already set */ 150 /* Check if PLL register is already set */
158 pci_read_config_byte(nforce2_chipset_dev, 151 pci_read_config_byte(nforce2_chipset_dev,NFORCE2_PLLENABLE, (u8 *)&temp);
159 NFORCE2_PLLENABLE, (u8 *)&temp); 152
160
161 if(bootfsb || !temp) 153 if(bootfsb || !temp)
162 return fsb; 154 return fsb;
163 155
164 /* Use PLL register FSB value */ 156 /* Use PLL register FSB value */
165 pci_read_config_dword(nforce2_chipset_dev, 157 pci_read_config_dword(nforce2_chipset_dev,NFORCE2_PLLREG, &temp);
166 NFORCE2_PLLREG, &temp);
167 fsb = nforce2_calc_fsb(temp); 158 fsb = nforce2_calc_fsb(temp);
168 159
169 return fsb; 160 return fsb;
170} 161}
171 162
172/* 163/**
173 * nforce2_set_fsb - set new FSB 164 * nforce2_set_fsb - set new FSB
174 * @fsb: New FSB 165 * @fsb: New FSB
175 * 166 *
176 * Sets new FSB 167 * Sets new FSB
177 */ 168 */
178static int nforce2_set_fsb(unsigned int fsb) 169static int nforce2_set_fsb(unsigned int fsb)
@@ -186,7 +177,7 @@ static int nforce2_set_fsb(unsigned int fsb)
186 printk(KERN_ERR "cpufreq: FSB %d is out of range!\n", fsb); 177 printk(KERN_ERR "cpufreq: FSB %d is out of range!\n", fsb);
187 return -EINVAL; 178 return -EINVAL;
188 } 179 }
189 180
190 tfsb = nforce2_fsb_read(0); 181 tfsb = nforce2_fsb_read(0);
191 if (!tfsb) { 182 if (!tfsb) {
192 printk(KERN_ERR "cpufreq: Error while reading the FSB\n"); 183 printk(KERN_ERR "cpufreq: Error while reading the FSB\n");
@@ -194,8 +185,7 @@ static int nforce2_set_fsb(unsigned int fsb)
194 } 185 }
195 186
196 /* First write? Then set actual value */ 187 /* First write? Then set actual value */
197 pci_read_config_byte(nforce2_chipset_dev, 188 pci_read_config_byte(nforce2_chipset_dev,NFORCE2_PLLENABLE, (u8 *)&temp);
198 NFORCE2_PLLENABLE, (u8 *)&temp);
199 if (!temp) { 189 if (!temp) {
200 pll = nforce2_calc_pll(tfsb); 190 pll = nforce2_calc_pll(tfsb);
201 191
@@ -223,7 +213,7 @@ static int nforce2_set_fsb(unsigned int fsb)
223 /* Calculate the PLL reg. value */ 213 /* Calculate the PLL reg. value */
224 if ((pll = nforce2_calc_pll(tfsb)) == -1) 214 if ((pll = nforce2_calc_pll(tfsb)) == -1)
225 return -EINVAL; 215 return -EINVAL;
226 216
227 nforce2_write_pll(pll); 217 nforce2_write_pll(pll);
228#ifdef NFORCE2_DELAY 218#ifdef NFORCE2_DELAY
229 mdelay(NFORCE2_DELAY); 219 mdelay(NFORCE2_DELAY);
@@ -239,7 +229,7 @@ static int nforce2_set_fsb(unsigned int fsb)
239/** 229/**
240 * nforce2_get - get the CPU frequency 230 * nforce2_get - get the CPU frequency
241 * @cpu: CPU number 231 * @cpu: CPU number
242 * 232 *
243 * Returns the CPU frequency 233 * Returns the CPU frequency
244 */ 234 */
245static unsigned int nforce2_get(unsigned int cpu) 235static unsigned int nforce2_get(unsigned int cpu)
@@ -354,10 +344,10 @@ static int nforce2_cpu_init(struct cpufreq_policy *policy)
354 344
355 printk(KERN_INFO "cpufreq: FSB currently at %i MHz, FID %d.%d\n", fsb, 345 printk(KERN_INFO "cpufreq: FSB currently at %i MHz, FID %d.%d\n", fsb,
356 fid / 10, fid % 10); 346 fid / 10, fid % 10);
357 347
358 /* Set maximum FSB to FSB at boot time */ 348 /* Set maximum FSB to FSB at boot time */
359 max_fsb = nforce2_fsb_read(1); 349 max_fsb = nforce2_fsb_read(1);
360 350
361 if(!max_fsb) 351 if(!max_fsb)
362 return -EIO; 352 return -EIO;
363 353
@@ -398,17 +388,15 @@ static struct cpufreq_driver nforce2_driver = {
398 * nforce2_detect_chipset - detect the Southbridge which contains FSB PLL logic 388 * nforce2_detect_chipset - detect the Southbridge which contains FSB PLL logic
399 * 389 *
400 * Detects nForce2 A2 and C1 stepping 390 * Detects nForce2 A2 and C1 stepping
401 * 391 *
402 */ 392 */
403static unsigned int nforce2_detect_chipset(void) 393static unsigned int nforce2_detect_chipset(void)
404{ 394{
405 u8 revision; 395 u8 revision;
406 396
407 nforce2_chipset_dev = pci_get_subsys(PCI_VENDOR_ID_NVIDIA, 397 nforce2_chipset_dev = pci_get_subsys(PCI_VENDOR_ID_NVIDIA,
408 PCI_DEVICE_ID_NVIDIA_NFORCE2, 398 PCI_DEVICE_ID_NVIDIA_NFORCE2,
409 PCI_ANY_ID, 399 PCI_ANY_ID, PCI_ANY_ID, NULL);
410 PCI_ANY_ID,
411 NULL);
412 400
413 if (nforce2_chipset_dev == NULL) 401 if (nforce2_chipset_dev == NULL)
414 return -ENODEV; 402 return -ENODEV;
diff --git a/arch/i386/kernel/cpu/cpufreq/elanfreq.c b/arch/i386/kernel/cpu/cpufreq/elanfreq.c
index 3f7caa4ae6d6..f317276afa7a 100644
--- a/arch/i386/kernel/cpu/cpufreq/elanfreq.c
+++ b/arch/i386/kernel/cpu/cpufreq/elanfreq.c
@@ -1,16 +1,16 @@
1/* 1/*
2 * elanfreq: cpufreq driver for the AMD ELAN family 2 * elanfreq: cpufreq driver for the AMD ELAN family
3 * 3 *
4 * (c) Copyright 2002 Robert Schwebel <r.schwebel@pengutronix.de> 4 * (c) Copyright 2002 Robert Schwebel <r.schwebel@pengutronix.de>
5 * 5 *
6 * Parts of this code are (c) Sven Geggus <sven@geggus.net> 6 * Parts of this code are (c) Sven Geggus <sven@geggus.net>
7 * 7 *
8 * All Rights Reserved. 8 * All Rights Reserved.
9 * 9 *
10 * This program is free software; you can redistribute it and/or 10 * This program is free software; you can redistribute it and/or
11 * modify it under the terms of the GNU General Public License 11 * modify it under the terms of the GNU General Public License
12 * as published by the Free Software Foundation; either version 12 * as published by the Free Software Foundation; either version
13 * 2 of the License, or (at your option) any later version. 13 * 2 of the License, or (at your option) any later version.
14 * 14 *
15 * 2002-02-13: - initial revision for 2.4.18-pre9 by Robert Schwebel 15 * 2002-02-13: - initial revision for 2.4.18-pre9 by Robert Schwebel
16 * 16 *
@@ -28,7 +28,7 @@
28#include <asm/timex.h> 28#include <asm/timex.h>
29#include <asm/io.h> 29#include <asm/io.h>
30 30
31#define REG_CSCIR 0x22 /* Chip Setup and Control Index Register */ 31#define REG_CSCIR 0x22 /* Chip Setup and Control Index Register */
32#define REG_CSCDR 0x23 /* Chip Setup and Control Data Register */ 32#define REG_CSCDR 0x23 /* Chip Setup and Control Data Register */
33 33
34/* Module parameter */ 34/* Module parameter */
@@ -41,7 +41,7 @@ struct s_elan_multiplier {
41}; 41};
42 42
43/* 43/*
44 * It is important that the frequencies 44 * It is important that the frequencies
45 * are listed in ascending order here! 45 * are listed in ascending order here!
46 */ 46 */
47struct s_elan_multiplier elan_multiplier[] = { 47struct s_elan_multiplier elan_multiplier[] = {
@@ -72,78 +72,79 @@ static struct cpufreq_frequency_table elanfreq_table[] = {
72 * elanfreq_get_cpu_frequency: determine current cpu speed 72 * elanfreq_get_cpu_frequency: determine current cpu speed
73 * 73 *
74 * Finds out at which frequency the CPU of the Elan SOC runs 74 * Finds out at which frequency the CPU of the Elan SOC runs
75 * at the moment. Frequencies from 1 to 33 MHz are generated 75 * at the moment. Frequencies from 1 to 33 MHz are generated
76 * the normal way, 66 and 99 MHz are called "Hyperspeed Mode" 76 * the normal way, 66 and 99 MHz are called "Hyperspeed Mode"
77 * and have the rest of the chip running with 33 MHz. 77 * and have the rest of the chip running with 33 MHz.
78 */ 78 */
79 79
80static unsigned int elanfreq_get_cpu_frequency(unsigned int cpu) 80static unsigned int elanfreq_get_cpu_frequency(unsigned int cpu)
81{ 81{
82 u8 clockspeed_reg; /* Clock Speed Register */ 82 u8 clockspeed_reg; /* Clock Speed Register */
83 83
84 local_irq_disable(); 84 local_irq_disable();
85 outb_p(0x80,REG_CSCIR); 85 outb_p(0x80,REG_CSCIR);
86 clockspeed_reg = inb_p(REG_CSCDR); 86 clockspeed_reg = inb_p(REG_CSCDR);
87 local_irq_enable(); 87 local_irq_enable();
88 88
89 if ((clockspeed_reg & 0xE0) == 0xE0) { return 0; } 89 if ((clockspeed_reg & 0xE0) == 0xE0)
90 return 0;
90 91
91 /* Are we in CPU clock multiplied mode (66/99 MHz)? */ 92 /* Are we in CPU clock multiplied mode (66/99 MHz)? */
92 if ((clockspeed_reg & 0xE0) == 0xC0) { 93 if ((clockspeed_reg & 0xE0) == 0xC0) {
93 if ((clockspeed_reg & 0x01) == 0) { 94 if ((clockspeed_reg & 0x01) == 0)
94 return 66000; 95 return 66000;
95 } else { 96 else
96 return 99000; 97 return 99000;
97 } 98 }
98 }
99 99
100 /* 33 MHz is not 32 MHz... */ 100 /* 33 MHz is not 32 MHz... */
101 if ((clockspeed_reg & 0xE0)==0xA0) 101 if ((clockspeed_reg & 0xE0)==0xA0)
102 return 33000; 102 return 33000;
103 103
104 return ((1<<((clockspeed_reg & 0xE0) >> 5)) * 1000); 104 return ((1<<((clockspeed_reg & 0xE0) >> 5)) * 1000);
105} 105}
106 106
107 107
108/** 108/**
109 * elanfreq_set_cpu_frequency: Change the CPU core frequency 109 * elanfreq_set_cpu_frequency: Change the CPU core frequency
110 * @cpu: cpu number 110 * @cpu: cpu number
111 * @freq: frequency in kHz 111 * @freq: frequency in kHz
112 * 112 *
113 * This function takes a frequency value and changes the CPU frequency 113 * This function takes a frequency value and changes the CPU frequency
114 * according to this. Note that the frequency has to be checked by 114 * according to this. Note that the frequency has to be checked by
115 * elanfreq_validatespeed() for correctness! 115 * elanfreq_validatespeed() for correctness!
116 * 116 *
117 * There is no return value. 117 * There is no return value.
118 */ 118 */
119 119
120static void elanfreq_set_cpu_state (unsigned int state) { 120static void elanfreq_set_cpu_state (unsigned int state)
121 121{
122 struct cpufreq_freqs freqs; 122 struct cpufreq_freqs freqs;
123 123
124 freqs.old = elanfreq_get_cpu_frequency(0); 124 freqs.old = elanfreq_get_cpu_frequency(0);
125 freqs.new = elan_multiplier[state].clock; 125 freqs.new = elan_multiplier[state].clock;
126 freqs.cpu = 0; /* elanfreq.c is UP only driver */ 126 freqs.cpu = 0; /* elanfreq.c is UP only driver */
127 127
128 cpufreq_notify_transition(&freqs, CPUFREQ_PRECHANGE); 128 cpufreq_notify_transition(&freqs, CPUFREQ_PRECHANGE);
129 129
130 printk(KERN_INFO "elanfreq: attempting to set frequency to %i kHz\n",elan_multiplier[state].clock); 130 printk(KERN_INFO "elanfreq: attempting to set frequency to %i kHz\n",
131 elan_multiplier[state].clock);
131 132
132 133
133 /* 134 /*
134 * Access to the Elan's internal registers is indexed via 135 * Access to the Elan's internal registers is indexed via
135 * 0x22: Chip Setup & Control Register Index Register (CSCI) 136 * 0x22: Chip Setup & Control Register Index Register (CSCI)
136 * 0x23: Chip Setup & Control Register Data Register (CSCD) 137 * 0x23: Chip Setup & Control Register Data Register (CSCD)
137 * 138 *
138 */ 139 */
139 140
140 /* 141 /*
141 * 0x40 is the Power Management Unit's Force Mode Register. 142 * 0x40 is the Power Management Unit's Force Mode Register.
142 * Bit 6 enables Hyperspeed Mode (66/100 MHz core frequency) 143 * Bit 6 enables Hyperspeed Mode (66/100 MHz core frequency)
143 */ 144 */
144 145
145 local_irq_disable(); 146 local_irq_disable();
146 outb_p(0x40,REG_CSCIR); /* Disable hyperspeed mode */ 147 outb_p(0x40,REG_CSCIR); /* Disable hyperspeed mode */
147 outb_p(0x00,REG_CSCDR); 148 outb_p(0x00,REG_CSCDR);
148 local_irq_enable(); /* wait till internal pipelines and */ 149 local_irq_enable(); /* wait till internal pipelines and */
149 udelay(1000); /* buffers have cleaned up */ 150 udelay(1000); /* buffers have cleaned up */
@@ -166,10 +167,10 @@ static void elanfreq_set_cpu_state (unsigned int state) {
166 167
167/** 168/**
168 * elanfreq_validatespeed: test if frequency range is valid 169 * elanfreq_validatespeed: test if frequency range is valid
169 * @policy: the policy to validate 170 * @policy: the policy to validate
170 * 171 *
171 * This function checks if a given frequency range in kHz is valid 172 * This function checks if a given frequency range in kHz is valid
172 * for the hardware supported by the driver. 173 * for the hardware supported by the driver.
173 */ 174 */
174 175
175static int elanfreq_verify (struct cpufreq_policy *policy) 176static int elanfreq_verify (struct cpufreq_policy *policy)
@@ -177,11 +178,11 @@ static int elanfreq_verify (struct cpufreq_policy *policy)
177 return cpufreq_frequency_table_verify(policy, &elanfreq_table[0]); 178 return cpufreq_frequency_table_verify(policy, &elanfreq_table[0]);
178} 179}
179 180
180static int elanfreq_target (struct cpufreq_policy *policy, 181static int elanfreq_target (struct cpufreq_policy *policy,
181 unsigned int target_freq, 182 unsigned int target_freq,
182 unsigned int relation) 183 unsigned int relation)
183{ 184{
184 unsigned int newstate = 0; 185 unsigned int newstate = 0;
185 186
186 if (cpufreq_frequency_table_target(policy, &elanfreq_table[0], target_freq, relation, &newstate)) 187 if (cpufreq_frequency_table_target(policy, &elanfreq_table[0], target_freq, relation, &newstate))
187 return -EINVAL; 188 return -EINVAL;
@@ -212,7 +213,7 @@ static int elanfreq_cpu_init(struct cpufreq_policy *policy)
212 max_freq = elanfreq_get_cpu_frequency(0); 213 max_freq = elanfreq_get_cpu_frequency(0);
213 214
214 /* table init */ 215 /* table init */
215 for (i=0; (elanfreq_table[i].frequency != CPUFREQ_TABLE_END); i++) { 216 for (i=0; (elanfreq_table[i].frequency != CPUFREQ_TABLE_END); i++) {
216 if (elanfreq_table[i].frequency > max_freq) 217 if (elanfreq_table[i].frequency > max_freq)
217 elanfreq_table[i].frequency = CPUFREQ_ENTRY_INVALID; 218 elanfreq_table[i].frequency = CPUFREQ_ENTRY_INVALID;
218 } 219 }
@@ -226,8 +227,7 @@ static int elanfreq_cpu_init(struct cpufreq_policy *policy)
226 if (result) 227 if (result)
227 return (result); 228 return (result);
228 229
229 cpufreq_frequency_table_get_attr(elanfreq_table, policy->cpu); 230 cpufreq_frequency_table_get_attr(elanfreq_table, policy->cpu);
230
231 return 0; 231 return 0;
232} 232}
233 233
@@ -268,9 +268,9 @@ static struct freq_attr* elanfreq_attr[] = {
268 268
269 269
270static struct cpufreq_driver elanfreq_driver = { 270static struct cpufreq_driver elanfreq_driver = {
271 .get = elanfreq_get_cpu_frequency, 271 .get = elanfreq_get_cpu_frequency,
272 .verify = elanfreq_verify, 272 .verify = elanfreq_verify,
273 .target = elanfreq_target, 273 .target = elanfreq_target,
274 .init = elanfreq_cpu_init, 274 .init = elanfreq_cpu_init,
275 .exit = elanfreq_cpu_exit, 275 .exit = elanfreq_cpu_exit,
276 .name = "elanfreq", 276 .name = "elanfreq",
@@ -279,23 +279,21 @@ static struct cpufreq_driver elanfreq_driver = {
279}; 279};
280 280
281 281
282static int __init elanfreq_init(void) 282static int __init elanfreq_init(void)
283{ 283{
284 struct cpuinfo_x86 *c = cpu_data; 284 struct cpuinfo_x86 *c = cpu_data;
285 285
286 /* Test if we have the right hardware */ 286 /* Test if we have the right hardware */
287 if ((c->x86_vendor != X86_VENDOR_AMD) || 287 if ((c->x86_vendor != X86_VENDOR_AMD) ||
288 (c->x86 != 4) || (c->x86_model!=10)) 288 (c->x86 != 4) || (c->x86_model!=10)) {
289 {
290 printk(KERN_INFO "elanfreq: error: no Elan processor found!\n"); 289 printk(KERN_INFO "elanfreq: error: no Elan processor found!\n");
291 return -ENODEV; 290 return -ENODEV;
292 } 291 }
293
294 return cpufreq_register_driver(&elanfreq_driver); 292 return cpufreq_register_driver(&elanfreq_driver);
295} 293}
296 294
297 295
298static void __exit elanfreq_exit(void) 296static void __exit elanfreq_exit(void)
299{ 297{
300 cpufreq_unregister_driver(&elanfreq_driver); 298 cpufreq_unregister_driver(&elanfreq_driver);
301} 299}
@@ -309,4 +307,3 @@ MODULE_DESCRIPTION("cpufreq driver for AMD's Elan CPUs");
309 307
310module_init(elanfreq_init); 308module_init(elanfreq_init);
311module_exit(elanfreq_exit); 309module_exit(elanfreq_exit);
312
diff --git a/arch/i386/kernel/cpu/cpufreq/gx-suspmod.c b/arch/i386/kernel/cpu/cpufreq/gx-suspmod.c
index e86ea486c311..92afa3bc84f1 100644
--- a/arch/i386/kernel/cpu/cpufreq/gx-suspmod.c
+++ b/arch/i386/kernel/cpu/cpufreq/gx-suspmod.c
@@ -6,12 +6,12 @@
6 * 6 *
7 * This program is free software; you can redistribute it and/or 7 * This program is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU General Public License 8 * modify it under the terms of the GNU General Public License
9 * version 2 as published by the Free Software Foundation 9 * version 2 as published by the Free Software Foundation
10 * 10 *
11 * The author(s) of this software shall not be held liable for damages 11 * The author(s) of this software shall not be held liable for damages
12 * of any nature resulting due to the use of this software. This 12 * of any nature resulting due to the use of this software. This
13 * software is provided AS-IS with no warranties. 13 * software is provided AS-IS with no warranties.
14 * 14 *
15 * Theoritical note: 15 * Theoritical note:
16 * 16 *
17 * (see Geode(tm) CS5530 manual (rev.4.1) page.56) 17 * (see Geode(tm) CS5530 manual (rev.4.1) page.56)
@@ -21,18 +21,18 @@
21 * 21 *
22 * Suspend Modulation works by asserting and de-asserting the SUSP# pin 22 * Suspend Modulation works by asserting and de-asserting the SUSP# pin
23 * to CPU(GX1/GXLV) for configurable durations. When asserting SUSP# 23 * to CPU(GX1/GXLV) for configurable durations. When asserting SUSP#
24 * the CPU enters an idle state. GX1 stops its core clock when SUSP# is 24 * the CPU enters an idle state. GX1 stops its core clock when SUSP# is
25 * asserted then power consumption is reduced. 25 * asserted then power consumption is reduced.
26 * 26 *
27 * Suspend Modulation's OFF/ON duration are configurable 27 * Suspend Modulation's OFF/ON duration are configurable
28 * with 'Suspend Modulation OFF Count Register' 28 * with 'Suspend Modulation OFF Count Register'
29 * and 'Suspend Modulation ON Count Register'. 29 * and 'Suspend Modulation ON Count Register'.
30 * These registers are 8bit counters that represent the number of 30 * These registers are 8bit counters that represent the number of
31 * 32us intervals which the SUSP# pin is asserted(ON)/de-asserted(OFF) 31 * 32us intervals which the SUSP# pin is asserted(ON)/de-asserted(OFF)
32 * to the processor. 32 * to the processor.
33 * 33 *
34 * These counters define a ratio which is the effective frequency 34 * These counters define a ratio which is the effective frequency
35 * of operation of the system. 35 * of operation of the system.
36 * 36 *
37 * OFF Count 37 * OFF Count
38 * F_eff = Fgx * ---------------------- 38 * F_eff = Fgx * ----------------------
@@ -40,24 +40,24 @@
40 * 40 *
41 * 0 <= On Count, Off Count <= 255 41 * 0 <= On Count, Off Count <= 255
42 * 42 *
43 * From these limits, we can get register values 43 * From these limits, we can get register values
44 * 44 *
45 * off_duration + on_duration <= MAX_DURATION 45 * off_duration + on_duration <= MAX_DURATION
46 * on_duration = off_duration * (stock_freq - freq) / freq 46 * on_duration = off_duration * (stock_freq - freq) / freq
47 * 47 *
48 * off_duration = (freq * DURATION) / stock_freq 48 * off_duration = (freq * DURATION) / stock_freq
49 * on_duration = DURATION - off_duration 49 * on_duration = DURATION - off_duration
50 * 50 *
51 * 51 *
52 *--------------------------------------------------------------------------- 52 *---------------------------------------------------------------------------
53 * 53 *
54 * ChangeLog: 54 * ChangeLog:
55 * Dec. 12, 2003 Hiroshi Miura <miura@da-cha.org> 55 * Dec. 12, 2003 Hiroshi Miura <miura@da-cha.org>
56 * - fix on/off register mistake 56 * - fix on/off register mistake
57 * - fix cpu_khz calc when it stops cpu modulation. 57 * - fix cpu_khz calc when it stops cpu modulation.
58 * 58 *
59 * Dec. 11, 2002 Hiroshi Miura <miura@da-cha.org> 59 * Dec. 11, 2002 Hiroshi Miura <miura@da-cha.org>
60 * - rewrite for Cyrix MediaGX Cx5510/5520 and 60 * - rewrite for Cyrix MediaGX Cx5510/5520 and
61 * NatSemi Geode Cs5530(A). 61 * NatSemi Geode Cs5530(A).
62 * 62 *
63 * Jul. ??, 2002 Zwane Mwaikambo <zwane@commfireservices.com> 63 * Jul. ??, 2002 Zwane Mwaikambo <zwane@commfireservices.com>
@@ -74,40 +74,40 @@
74 ************************************************************************/ 74 ************************************************************************/
75 75
76#include <linux/kernel.h> 76#include <linux/kernel.h>
77#include <linux/module.h> 77#include <linux/module.h>
78#include <linux/init.h> 78#include <linux/init.h>
79#include <linux/smp.h> 79#include <linux/smp.h>
80#include <linux/cpufreq.h> 80#include <linux/cpufreq.h>
81#include <linux/pci.h> 81#include <linux/pci.h>
82#include <asm/processor.h> 82#include <asm/processor.h>
83#include <asm/errno.h> 83#include <asm/errno.h>
84 84
85/* PCI config registers, all at F0 */ 85/* PCI config registers, all at F0 */
86#define PCI_PMER1 0x80 /* power management enable register 1 */ 86#define PCI_PMER1 0x80 /* power management enable register 1 */
87#define PCI_PMER2 0x81 /* power management enable register 2 */ 87#define PCI_PMER2 0x81 /* power management enable register 2 */
88#define PCI_PMER3 0x82 /* power management enable register 3 */ 88#define PCI_PMER3 0x82 /* power management enable register 3 */
89#define PCI_IRQTC 0x8c /* irq speedup timer counter register:typical 2 to 4ms */ 89#define PCI_IRQTC 0x8c /* irq speedup timer counter register:typical 2 to 4ms */
90#define PCI_VIDTC 0x8d /* video speedup timer counter register: typical 50 to 100ms */ 90#define PCI_VIDTC 0x8d /* video speedup timer counter register: typical 50 to 100ms */
91#define PCI_MODOFF 0x94 /* suspend modulation OFF counter register, 1 = 32us */ 91#define PCI_MODOFF 0x94 /* suspend modulation OFF counter register, 1 = 32us */
92#define PCI_MODON 0x95 /* suspend modulation ON counter register */ 92#define PCI_MODON 0x95 /* suspend modulation ON counter register */
93#define PCI_SUSCFG 0x96 /* suspend configuration register */ 93#define PCI_SUSCFG 0x96 /* suspend configuration register */
94 94
95/* PMER1 bits */ 95/* PMER1 bits */
96#define GPM (1<<0) /* global power management */ 96#define GPM (1<<0) /* global power management */
97#define GIT (1<<1) /* globally enable PM device idle timers */ 97#define GIT (1<<1) /* globally enable PM device idle timers */
98#define GTR (1<<2) /* globally enable IO traps */ 98#define GTR (1<<2) /* globally enable IO traps */
99#define IRQ_SPDUP (1<<3) /* disable clock throttle during interrupt handling */ 99#define IRQ_SPDUP (1<<3) /* disable clock throttle during interrupt handling */
100#define VID_SPDUP (1<<4) /* disable clock throttle during vga video handling */ 100#define VID_SPDUP (1<<4) /* disable clock throttle during vga video handling */
101 101
102/* SUSCFG bits */ 102/* SUSCFG bits */
103#define SUSMOD (1<<0) /* enable/disable suspend modulation */ 103#define SUSMOD (1<<0) /* enable/disable suspend modulation */
104/* the belows support only with cs5530 (after rev.1.2)/cs5530A */ 104/* the belows support only with cs5530 (after rev.1.2)/cs5530A */
105#define SMISPDUP (1<<1) /* select how SMI re-enable suspend modulation: */ 105#define SMISPDUP (1<<1) /* select how SMI re-enable suspend modulation: */
106 /* IRQTC timer or read SMI speedup disable reg.(F1BAR[08-09h]) */ 106 /* IRQTC timer or read SMI speedup disable reg.(F1BAR[08-09h]) */
107#define SUSCFG (1<<2) /* enable powering down a GXLV processor. "Special 3Volt Suspend" mode */ 107#define SUSCFG (1<<2) /* enable powering down a GXLV processor. "Special 3Volt Suspend" mode */
108/* the belows support only with cs5530A */ 108/* the belows support only with cs5530A */
109#define PWRSVE_ISA (1<<3) /* stop ISA clock */ 109#define PWRSVE_ISA (1<<3) /* stop ISA clock */
110#define PWRSVE (1<<4) /* active idle */ 110#define PWRSVE (1<<4) /* active idle */
111 111
112struct gxfreq_params { 112struct gxfreq_params {
113 u8 on_duration; 113 u8 on_duration;
@@ -128,7 +128,7 @@ module_param (pci_busclk, int, 0444);
128 128
129/* maximum duration for which the cpu may be suspended 129/* maximum duration for which the cpu may be suspended
130 * (32us * MAX_DURATION). If no parameter is given, this defaults 130 * (32us * MAX_DURATION). If no parameter is given, this defaults
131 * to 255. 131 * to 255.
132 * Note that this leads to a maximum of 8 ms(!) where the CPU clock 132 * Note that this leads to a maximum of 8 ms(!) where the CPU clock
133 * is suspended -- processing power is just 0.39% of what it used to be, 133 * is suspended -- processing power is just 0.39% of what it used to be,
134 * though. 781.25 kHz(!) for a 200 MHz processor -- wow. */ 134 * though. 781.25 kHz(!) for a 200 MHz processor -- wow. */
@@ -144,17 +144,17 @@ module_param (max_duration, int, 0444);
144#define dprintk(msg...) cpufreq_debug_printk(CPUFREQ_DEBUG_DRIVER, "gx-suspmod", msg) 144#define dprintk(msg...) cpufreq_debug_printk(CPUFREQ_DEBUG_DRIVER, "gx-suspmod", msg)
145 145
146/** 146/**
147 * we can detect a core multipiler from dir0_lsb 147 * we can detect a core multipiler from dir0_lsb
148 * from GX1 datasheet p.56, 148 * from GX1 datasheet p.56,
149 * MULT[3:0]: 149 * MULT[3:0]:
150 * 0000 = SYSCLK multiplied by 4 (test only) 150 * 0000 = SYSCLK multiplied by 4 (test only)
151 * 0001 = SYSCLK multiplied by 10 151 * 0001 = SYSCLK multiplied by 10
152 * 0010 = SYSCLK multiplied by 4 152 * 0010 = SYSCLK multiplied by 4
153 * 0011 = SYSCLK multiplied by 6 153 * 0011 = SYSCLK multiplied by 6
154 * 0100 = SYSCLK multiplied by 9 154 * 0100 = SYSCLK multiplied by 9
155 * 0101 = SYSCLK multiplied by 5 155 * 0101 = SYSCLK multiplied by 5
156 * 0110 = SYSCLK multiplied by 7 156 * 0110 = SYSCLK multiplied by 7
157 * 0111 = SYSCLK multiplied by 8 157 * 0111 = SYSCLK multiplied by 8
158 * of 33.3MHz 158 * of 33.3MHz
159 **/ 159 **/
160static int gx_freq_mult[16] = { 160static int gx_freq_mult[16] = {
@@ -164,17 +164,17 @@ static int gx_freq_mult[16] = {
164 164
165 165
166/**************************************************************** 166/****************************************************************
167 * Low Level chipset interface * 167 * Low Level chipset interface *
168 ****************************************************************/ 168 ****************************************************************/
169static struct pci_device_id gx_chipset_tbl[] __initdata = { 169static struct pci_device_id gx_chipset_tbl[] __initdata = {
170 { PCI_VENDOR_ID_CYRIX, PCI_DEVICE_ID_CYRIX_5530_LEGACY, PCI_ANY_ID, PCI_ANY_ID }, 170 { PCI_VENDOR_ID_CYRIX, PCI_DEVICE_ID_CYRIX_5530_LEGACY, PCI_ANY_ID, PCI_ANY_ID },
171 { PCI_VENDOR_ID_CYRIX, PCI_DEVICE_ID_CYRIX_5520, PCI_ANY_ID, PCI_ANY_ID }, 171 { PCI_VENDOR_ID_CYRIX, PCI_DEVICE_ID_CYRIX_5520, PCI_ANY_ID, PCI_ANY_ID },
172 { PCI_VENDOR_ID_CYRIX, PCI_DEVICE_ID_CYRIX_5510, PCI_ANY_ID, PCI_ANY_ID }, 172 { PCI_VENDOR_ID_CYRIX, PCI_DEVICE_ID_CYRIX_5510, PCI_ANY_ID, PCI_ANY_ID },
173 { 0, }, 173 { 0, },
174}; 174};
175 175
176/** 176/**
177 * gx_detect_chipset: 177 * gx_detect_chipset:
178 * 178 *
179 **/ 179 **/
180static __init struct pci_dev *gx_detect_chipset(void) 180static __init struct pci_dev *gx_detect_chipset(void)
@@ -182,17 +182,16 @@ static __init struct pci_dev *gx_detect_chipset(void)
182 struct pci_dev *gx_pci = NULL; 182 struct pci_dev *gx_pci = NULL;
183 183
184 /* check if CPU is a MediaGX or a Geode. */ 184 /* check if CPU is a MediaGX or a Geode. */
185 if ((current_cpu_data.x86_vendor != X86_VENDOR_NSC) && 185 if ((current_cpu_data.x86_vendor != X86_VENDOR_NSC) &&
186 (current_cpu_data.x86_vendor != X86_VENDOR_CYRIX)) { 186 (current_cpu_data.x86_vendor != X86_VENDOR_CYRIX)) {
187 dprintk("error: no MediaGX/Geode processor found!\n"); 187 dprintk("error: no MediaGX/Geode processor found!\n");
188 return NULL; 188 return NULL;
189 } 189 }
190 190
191 /* detect which companion chip is used */ 191 /* detect which companion chip is used */
192 while ((gx_pci = pci_get_device(PCI_ANY_ID, PCI_ANY_ID, gx_pci)) != NULL) { 192 while ((gx_pci = pci_get_device(PCI_ANY_ID, PCI_ANY_ID, gx_pci)) != NULL) {
193 if ((pci_match_id(gx_chipset_tbl, gx_pci)) != NULL) { 193 if ((pci_match_id(gx_chipset_tbl, gx_pci)) != NULL)
194 return gx_pci; 194 return gx_pci;
195 }
196 } 195 }
197 196
198 dprintk("error: no supported chipset found!\n"); 197 dprintk("error: no supported chipset found!\n");
@@ -200,24 +199,24 @@ static __init struct pci_dev *gx_detect_chipset(void)
200} 199}
201 200
202/** 201/**
203 * gx_get_cpuspeed: 202 * gx_get_cpuspeed:
204 * 203 *
205 * Finds out at which efficient frequency the Cyrix MediaGX/NatSemi Geode CPU runs. 204 * Finds out at which efficient frequency the Cyrix MediaGX/NatSemi Geode CPU runs.
206 */ 205 */
207static unsigned int gx_get_cpuspeed(unsigned int cpu) 206static unsigned int gx_get_cpuspeed(unsigned int cpu)
208{ 207{
209 if ((gx_params->pci_suscfg & SUSMOD) == 0) 208 if ((gx_params->pci_suscfg & SUSMOD) == 0)
210 return stock_freq; 209 return stock_freq;
211 210
212 return (stock_freq * gx_params->off_duration) 211 return (stock_freq * gx_params->off_duration)
213 / (gx_params->on_duration + gx_params->off_duration); 212 / (gx_params->on_duration + gx_params->off_duration);
214} 213}
215 214
216/** 215/**
217 * gx_validate_speed: 216 * gx_validate_speed:
218 * determine current cpu speed 217 * determine current cpu speed
219 * 218 *
220**/ 219 **/
221 220
222static unsigned int gx_validate_speed(unsigned int khz, u8 *on_duration, u8 *off_duration) 221static unsigned int gx_validate_speed(unsigned int khz, u8 *on_duration, u8 *off_duration)
223{ 222{
@@ -230,7 +229,7 @@ static unsigned int gx_validate_speed(unsigned int khz, u8 *on_duration, u8 *off
230 *on_duration=0; 229 *on_duration=0;
231 230
232 for (i=max_duration; i>0; i--) { 231 for (i=max_duration; i>0; i--) {
233 tmp_off = ((khz * i) / stock_freq) & 0xff; 232 tmp_off = ((khz * i) / stock_freq) & 0xff;
234 tmp_on = i - tmp_off; 233 tmp_on = i - tmp_off;
235 tmp_freq = (stock_freq * tmp_off) / i; 234 tmp_freq = (stock_freq * tmp_off) / i;
236 /* if this relation is closer to khz, use this. If it's equal, 235 /* if this relation is closer to khz, use this. If it's equal,
@@ -247,18 +246,17 @@ static unsigned int gx_validate_speed(unsigned int khz, u8 *on_duration, u8 *off
247 246
248 247
249/** 248/**
250 * gx_set_cpuspeed: 249 * gx_set_cpuspeed:
251 * set cpu speed in khz. 250 * set cpu speed in khz.
252 **/ 251 **/
253 252
254static void gx_set_cpuspeed(unsigned int khz) 253static void gx_set_cpuspeed(unsigned int khz)
255{ 254{
256 u8 suscfg, pmer1; 255 u8 suscfg, pmer1;
257 unsigned int new_khz; 256 unsigned int new_khz;
258 unsigned long flags; 257 unsigned long flags;
259 struct cpufreq_freqs freqs; 258 struct cpufreq_freqs freqs;
260 259
261
262 freqs.cpu = 0; 260 freqs.cpu = 0;
263 freqs.old = gx_get_cpuspeed(0); 261 freqs.old = gx_get_cpuspeed(0);
264 262
@@ -303,18 +301,18 @@ static void gx_set_cpuspeed(unsigned int khz)
303 pci_write_config_byte(gx_params->cs55x0, PCI_MODOFF, gx_params->off_duration); 301 pci_write_config_byte(gx_params->cs55x0, PCI_MODOFF, gx_params->off_duration);
304 pci_write_config_byte(gx_params->cs55x0, PCI_MODON, gx_params->on_duration); 302 pci_write_config_byte(gx_params->cs55x0, PCI_MODON, gx_params->on_duration);
305 303
306 pci_write_config_byte(gx_params->cs55x0, PCI_SUSCFG, suscfg); 304 pci_write_config_byte(gx_params->cs55x0, PCI_SUSCFG, suscfg);
307 pci_read_config_byte(gx_params->cs55x0, PCI_SUSCFG, &suscfg); 305 pci_read_config_byte(gx_params->cs55x0, PCI_SUSCFG, &suscfg);
308 306
309 local_irq_restore(flags); 307 local_irq_restore(flags);
310 308
311 gx_params->pci_suscfg = suscfg; 309 gx_params->pci_suscfg = suscfg;
312 310
313 cpufreq_notify_transition(&freqs, CPUFREQ_POSTCHANGE); 311 cpufreq_notify_transition(&freqs, CPUFREQ_POSTCHANGE);
314 312
315 dprintk("suspend modulation w/ duration of ON:%d us, OFF:%d us\n", 313 dprintk("suspend modulation w/ duration of ON:%d us, OFF:%d us\n",
316 gx_params->on_duration * 32, gx_params->off_duration * 32); 314 gx_params->on_duration * 32, gx_params->off_duration * 32);
317 dprintk("suspend modulation w/ clock speed: %d kHz.\n", freqs.new); 315 dprintk("suspend modulation w/ clock speed: %d kHz.\n", freqs.new);
318} 316}
319 317
320/**************************************************************** 318/****************************************************************
@@ -322,10 +320,10 @@ static void gx_set_cpuspeed(unsigned int khz)
322 ****************************************************************/ 320 ****************************************************************/
323 321
324/* 322/*
325 * cpufreq_gx_verify: test if frequency range is valid 323 * cpufreq_gx_verify: test if frequency range is valid
326 * 324 *
327 * This function checks if a given frequency range in kHz is valid 325 * This function checks if a given frequency range in kHz is valid
328 * for the hardware supported by the driver. 326 * for the hardware supported by the driver.
329 */ 327 */
330 328
331static int cpufreq_gx_verify(struct cpufreq_policy *policy) 329static int cpufreq_gx_verify(struct cpufreq_policy *policy)
@@ -333,8 +331,8 @@ static int cpufreq_gx_verify(struct cpufreq_policy *policy)
333 unsigned int tmp_freq = 0; 331 unsigned int tmp_freq = 0;
334 u8 tmp1, tmp2; 332 u8 tmp1, tmp2;
335 333
336 if (!stock_freq || !policy) 334 if (!stock_freq || !policy)
337 return -EINVAL; 335 return -EINVAL;
338 336
339 policy->cpu = 0; 337 policy->cpu = 0;
340 cpufreq_verify_within_limits(policy, (stock_freq / max_duration), stock_freq); 338 cpufreq_verify_within_limits(policy, (stock_freq / max_duration), stock_freq);
@@ -342,14 +340,14 @@ static int cpufreq_gx_verify(struct cpufreq_policy *policy)
342 /* it needs to be assured that at least one supported frequency is 340 /* it needs to be assured that at least one supported frequency is
343 * within policy->min and policy->max. If it is not, policy->max 341 * within policy->min and policy->max. If it is not, policy->max
344 * needs to be increased until one freuqency is supported. 342 * needs to be increased until one freuqency is supported.
345 * policy->min may not be decreased, though. This way we guarantee a 343 * policy->min may not be decreased, though. This way we guarantee a
346 * specific processing capacity. 344 * specific processing capacity.
347 */ 345 */
348 tmp_freq = gx_validate_speed(policy->min, &tmp1, &tmp2); 346 tmp_freq = gx_validate_speed(policy->min, &tmp1, &tmp2);
349 if (tmp_freq < policy->min) 347 if (tmp_freq < policy->min)
350 tmp_freq += stock_freq / max_duration; 348 tmp_freq += stock_freq / max_duration;
351 policy->min = tmp_freq; 349 policy->min = tmp_freq;
352 if (policy->min > policy->max) 350 if (policy->min > policy->max)
353 policy->max = tmp_freq; 351 policy->max = tmp_freq;
354 tmp_freq = gx_validate_speed(policy->max, &tmp1, &tmp2); 352 tmp_freq = gx_validate_speed(policy->max, &tmp1, &tmp2);
355 if (tmp_freq > policy->max) 353 if (tmp_freq > policy->max)
@@ -358,12 +356,12 @@ static int cpufreq_gx_verify(struct cpufreq_policy *policy)
358 if (policy->max < policy->min) 356 if (policy->max < policy->min)
359 policy->max = policy->min; 357 policy->max = policy->min;
360 cpufreq_verify_within_limits(policy, (stock_freq / max_duration), stock_freq); 358 cpufreq_verify_within_limits(policy, (stock_freq / max_duration), stock_freq);
361 359
362 return 0; 360 return 0;
363} 361}
364 362
365/* 363/*
366 * cpufreq_gx_target: 364 * cpufreq_gx_target:
367 * 365 *
368 */ 366 */
369static int cpufreq_gx_target(struct cpufreq_policy *policy, 367static int cpufreq_gx_target(struct cpufreq_policy *policy,
@@ -373,8 +371,8 @@ static int cpufreq_gx_target(struct cpufreq_policy *policy,
373 u8 tmp1, tmp2; 371 u8 tmp1, tmp2;
374 unsigned int tmp_freq; 372 unsigned int tmp_freq;
375 373
376 if (!stock_freq || !policy) 374 if (!stock_freq || !policy)
377 return -EINVAL; 375 return -EINVAL;
378 376
379 policy->cpu = 0; 377 policy->cpu = 0;
380 378
@@ -431,7 +429,7 @@ static int cpufreq_gx_cpu_init(struct cpufreq_policy *policy)
431 return 0; 429 return 0;
432} 430}
433 431
434/* 432/*
435 * cpufreq_gx_init: 433 * cpufreq_gx_init:
436 * MediaGX/Geode GX initialize cpufreq driver 434 * MediaGX/Geode GX initialize cpufreq driver
437 */ 435 */
@@ -452,7 +450,7 @@ static int __init cpufreq_gx_init(void)
452 u32 class_rev; 450 u32 class_rev;
453 451
454 /* Test if we have the right hardware */ 452 /* Test if we have the right hardware */
455 if ((gx_pci = gx_detect_chipset()) == NULL) 453 if ((gx_pci = gx_detect_chipset()) == NULL)
456 return -ENODEV; 454 return -ENODEV;
457 455
458 /* check whether module parameters are sane */ 456 /* check whether module parameters are sane */
@@ -461,10 +459,9 @@ static int __init cpufreq_gx_init(void)
461 459
462 dprintk("geode suspend modulation available.\n"); 460 dprintk("geode suspend modulation available.\n");
463 461
464 params = kmalloc(sizeof(struct gxfreq_params), GFP_KERNEL); 462 params = kzalloc(sizeof(struct gxfreq_params), GFP_KERNEL);
465 if (params == NULL) 463 if (params == NULL)
466 return -ENOMEM; 464 return -ENOMEM;
467 memset(params, 0, sizeof(struct gxfreq_params));
468 465
469 params->cs55x0 = gx_pci; 466 params->cs55x0 = gx_pci;
470 gx_params = params; 467 gx_params = params;
@@ -478,7 +475,7 @@ static int __init cpufreq_gx_init(void)
478 pci_read_config_dword(params->cs55x0, PCI_CLASS_REVISION, &class_rev); 475 pci_read_config_dword(params->cs55x0, PCI_CLASS_REVISION, &class_rev);
479 params->pci_rev = class_rev && 0xff; 476 params->pci_rev = class_rev && 0xff;
480 477
481 if ((ret = cpufreq_register_driver(&gx_suspmod_driver))) { 478 if ((ret = cpufreq_register_driver(&gx_suspmod_driver))) {
482 kfree(params); 479 kfree(params);
483 return ret; /* register error! */ 480 return ret; /* register error! */
484 } 481 }
diff --git a/arch/i386/kernel/cpu/cpufreq/longhaul.h b/arch/i386/kernel/cpu/cpufreq/longhaul.h
index 2a495c162ec7..d3a95d77ee85 100644
--- a/arch/i386/kernel/cpu/cpufreq/longhaul.h
+++ b/arch/i386/kernel/cpu/cpufreq/longhaul.h
@@ -234,7 +234,7 @@ static int __initdata ezrat_eblcr[32] = {
234 234
235/* 235/*
236 * VIA C3 Nehemiah */ 236 * VIA C3 Nehemiah */
237 237
238static int __initdata nehemiah_a_clock_ratio[32] = { 238static int __initdata nehemiah_a_clock_ratio[32] = {
239 100, /* 0000 -> 10.0x */ 239 100, /* 0000 -> 10.0x */
240 160, /* 0001 -> 16.0x */ 240 160, /* 0001 -> 16.0x */
@@ -446,7 +446,7 @@ static int __initdata nehemiah_c_eblcr[32] = {
446 /* end of table */ 446 /* end of table */
447}; 447};
448 448
449/* 449/*
450 * Voltage scales. Div/Mod by 1000 to get actual voltage. 450 * Voltage scales. Div/Mod by 1000 to get actual voltage.
451 * Which scale to use depends on the VRM type in use. 451 * Which scale to use depends on the VRM type in use.
452 */ 452 */
diff --git a/arch/i386/kernel/cpu/cpufreq/p4-clockmod.c b/arch/i386/kernel/cpu/cpufreq/p4-clockmod.c
index cc73a7ae34bc..ab6504efd801 100644
--- a/arch/i386/kernel/cpu/cpufreq/p4-clockmod.c
+++ b/arch/i386/kernel/cpu/cpufreq/p4-clockmod.c
@@ -14,7 +14,7 @@
14 * The author(s) of this software shall not be held liable for damages 14 * The author(s) of this software shall not be held liable for damages
15 * of any nature resulting due to the use of this software. This 15 * of any nature resulting due to the use of this software. This
16 * software is provided AS-IS with no warranties. 16 * software is provided AS-IS with no warranties.
17 * 17 *
18 * Date Errata Description 18 * Date Errata Description
19 * 20020525 N44, O17 12.5% or 25% DC causes lockup 19 * 20020525 N44, O17 12.5% or 25% DC causes lockup
20 * 20 *
@@ -22,7 +22,7 @@
22 22
23#include <linux/config.h> 23#include <linux/config.h>
24#include <linux/kernel.h> 24#include <linux/kernel.h>
25#include <linux/module.h> 25#include <linux/module.h>
26#include <linux/init.h> 26#include <linux/init.h>
27#include <linux/smp.h> 27#include <linux/smp.h>
28#include <linux/cpufreq.h> 28#include <linux/cpufreq.h>
@@ -30,7 +30,7 @@
30#include <linux/cpumask.h> 30#include <linux/cpumask.h>
31#include <linux/sched.h> /* current / set_cpus_allowed() */ 31#include <linux/sched.h> /* current / set_cpus_allowed() */
32 32
33#include <asm/processor.h> 33#include <asm/processor.h>
34#include <asm/msr.h> 34#include <asm/msr.h>
35#include <asm/timex.h> 35#include <asm/timex.h>
36 36
@@ -79,7 +79,7 @@ static int cpufreq_p4_setdc(unsigned int cpu, unsigned int newstate)
79 } else { 79 } else {
80 dprintk("CPU#%d setting duty cycle to %d%%\n", 80 dprintk("CPU#%d setting duty cycle to %d%%\n",
81 cpu, ((125 * newstate) / 10)); 81 cpu, ((125 * newstate) / 10));
82 /* bits 63 - 5 : reserved 82 /* bits 63 - 5 : reserved
83 * bit 4 : enable/disable 83 * bit 4 : enable/disable
84 * bits 3-1 : duty cycle 84 * bits 3-1 : duty cycle
85 * bit 0 : reserved 85 * bit 0 : reserved
@@ -132,7 +132,7 @@ static int cpufreq_p4_target(struct cpufreq_policy *policy,
132 } 132 }
133 133
134 /* run on each logical CPU, see section 13.15.3 of IA32 Intel Architecture Software 134 /* run on each logical CPU, see section 13.15.3 of IA32 Intel Architecture Software
135 * Developer's Manual, Volume 3 135 * Developer's Manual, Volume 3
136 */ 136 */
137 cpus_allowed = current->cpus_allowed; 137 cpus_allowed = current->cpus_allowed;
138 138
@@ -206,7 +206,7 @@ static unsigned int cpufreq_p4_get_frequency(struct cpuinfo_x86 *c)
206 return speedstep_get_processor_frequency(SPEEDSTEP_PROCESSOR_P4D); 206 return speedstep_get_processor_frequency(SPEEDSTEP_PROCESSOR_P4D);
207} 207}
208 208
209 209
210 210
211static int cpufreq_p4_cpu_init(struct cpufreq_policy *policy) 211static int cpufreq_p4_cpu_init(struct cpufreq_policy *policy)
212{ 212{
@@ -234,7 +234,7 @@ static int cpufreq_p4_cpu_init(struct cpufreq_policy *policy)
234 dprintk("has errata -- disabling frequencies lower than 2ghz\n"); 234 dprintk("has errata -- disabling frequencies lower than 2ghz\n");
235 break; 235 break;
236 } 236 }
237 237
238 /* get max frequency */ 238 /* get max frequency */
239 stock_freq = cpufreq_p4_get_frequency(c); 239 stock_freq = cpufreq_p4_get_frequency(c);
240 if (!stock_freq) 240 if (!stock_freq)
@@ -244,13 +244,13 @@ static int cpufreq_p4_cpu_init(struct cpufreq_policy *policy)
244 for (i=1; (p4clockmod_table[i].frequency != CPUFREQ_TABLE_END); i++) { 244 for (i=1; (p4clockmod_table[i].frequency != CPUFREQ_TABLE_END); i++) {
245 if ((i<2) && (has_N44_O17_errata[policy->cpu])) 245 if ((i<2) && (has_N44_O17_errata[policy->cpu]))
246 p4clockmod_table[i].frequency = CPUFREQ_ENTRY_INVALID; 246 p4clockmod_table[i].frequency = CPUFREQ_ENTRY_INVALID;
247 else if (has_N60_errata[policy->cpu] && p4clockmod_table[i].frequency < 2000000) 247 else if (has_N60_errata[policy->cpu] && ((stock_freq * i)/8) < 2000000)
248 p4clockmod_table[i].frequency = CPUFREQ_ENTRY_INVALID; 248 p4clockmod_table[i].frequency = CPUFREQ_ENTRY_INVALID;
249 else 249 else
250 p4clockmod_table[i].frequency = (stock_freq * i)/8; 250 p4clockmod_table[i].frequency = (stock_freq * i)/8;
251 } 251 }
252 cpufreq_frequency_table_get_attr(p4clockmod_table, policy->cpu); 252 cpufreq_frequency_table_get_attr(p4clockmod_table, policy->cpu);
253 253
254 /* cpuinfo and default policy values */ 254 /* cpuinfo and default policy values */
255 policy->governor = CPUFREQ_DEFAULT_GOVERNOR; 255 policy->governor = CPUFREQ_DEFAULT_GOVERNOR;
256 policy->cpuinfo.transition_latency = 1000000; /* assumed */ 256 policy->cpuinfo.transition_latency = 1000000; /* assumed */
@@ -262,7 +262,7 @@ static int cpufreq_p4_cpu_init(struct cpufreq_policy *policy)
262 262
263static int cpufreq_p4_cpu_exit(struct cpufreq_policy *policy) 263static int cpufreq_p4_cpu_exit(struct cpufreq_policy *policy)
264{ 264{
265 cpufreq_frequency_table_put_attr(policy->cpu); 265 cpufreq_frequency_table_put_attr(policy->cpu);
266 return 0; 266 return 0;
267} 267}
268 268
@@ -298,7 +298,7 @@ static struct freq_attr* p4clockmod_attr[] = {
298}; 298};
299 299
300static struct cpufreq_driver p4clockmod_driver = { 300static struct cpufreq_driver p4clockmod_driver = {
301 .verify = cpufreq_p4_verify, 301 .verify = cpufreq_p4_verify,
302 .target = cpufreq_p4_target, 302 .target = cpufreq_p4_target,
303 .init = cpufreq_p4_cpu_init, 303 .init = cpufreq_p4_cpu_init,
304 .exit = cpufreq_p4_cpu_exit, 304 .exit = cpufreq_p4_cpu_exit,
@@ -310,12 +310,12 @@ static struct cpufreq_driver p4clockmod_driver = {
310 310
311 311
312static int __init cpufreq_p4_init(void) 312static int __init cpufreq_p4_init(void)
313{ 313{
314 struct cpuinfo_x86 *c = cpu_data; 314 struct cpuinfo_x86 *c = cpu_data;
315 int ret; 315 int ret;
316 316
317 /* 317 /*
318 * THERM_CONTROL is architectural for IA32 now, so 318 * THERM_CONTROL is architectural for IA32 now, so
319 * we can rely on the capability checks 319 * we can rely on the capability checks
320 */ 320 */
321 if (c->x86_vendor != X86_VENDOR_INTEL) 321 if (c->x86_vendor != X86_VENDOR_INTEL)
diff --git a/arch/i386/kernel/cpu/cpufreq/powernow-k6.c b/arch/i386/kernel/cpu/cpufreq/powernow-k6.c
index 222f8cfe3c57..f89524051e4a 100644
--- a/arch/i386/kernel/cpu/cpufreq/powernow-k6.c
+++ b/arch/i386/kernel/cpu/cpufreq/powernow-k6.c
@@ -8,7 +8,7 @@
8 */ 8 */
9 9
10#include <linux/kernel.h> 10#include <linux/kernel.h>
11#include <linux/module.h> 11#include <linux/module.h>
12#include <linux/init.h> 12#include <linux/init.h>
13#include <linux/cpufreq.h> 13#include <linux/cpufreq.h>
14#include <linux/ioport.h> 14#include <linux/ioport.h>
@@ -50,7 +50,7 @@ static int powernow_k6_get_cpu_multiplier(void)
50{ 50{
51 u64 invalue = 0; 51 u64 invalue = 0;
52 u32 msrval; 52 u32 msrval;
53 53
54 msrval = POWERNOW_IOPORT + 0x1; 54 msrval = POWERNOW_IOPORT + 0x1;
55 wrmsr(MSR_K6_EPMR, msrval, 0); /* enable the PowerNow port */ 55 wrmsr(MSR_K6_EPMR, msrval, 0); /* enable the PowerNow port */
56 invalue=inl(POWERNOW_IOPORT + 0x8); 56 invalue=inl(POWERNOW_IOPORT + 0x8);
@@ -81,7 +81,7 @@ static void powernow_k6_set_state (unsigned int best_i)
81 freqs.old = busfreq * powernow_k6_get_cpu_multiplier(); 81 freqs.old = busfreq * powernow_k6_get_cpu_multiplier();
82 freqs.new = busfreq * clock_ratio[best_i].index; 82 freqs.new = busfreq * clock_ratio[best_i].index;
83 freqs.cpu = 0; /* powernow-k6.c is UP only driver */ 83 freqs.cpu = 0; /* powernow-k6.c is UP only driver */
84 84
85 cpufreq_notify_transition(&freqs, CPUFREQ_PRECHANGE); 85 cpufreq_notify_transition(&freqs, CPUFREQ_PRECHANGE);
86 86
87 /* we now need to transform best_i to the BVC format, see AMD#23446 */ 87 /* we now need to transform best_i to the BVC format, see AMD#23446 */
@@ -152,7 +152,7 @@ static int powernow_k6_cpu_init(struct cpufreq_policy *policy)
152 busfreq = cpu_khz / max_multiplier; 152 busfreq = cpu_khz / max_multiplier;
153 153
154 /* table init */ 154 /* table init */
155 for (i=0; (clock_ratio[i].frequency != CPUFREQ_TABLE_END); i++) { 155 for (i=0; (clock_ratio[i].frequency != CPUFREQ_TABLE_END); i++) {
156 if (clock_ratio[i].index > max_multiplier) 156 if (clock_ratio[i].index > max_multiplier)
157 clock_ratio[i].frequency = CPUFREQ_ENTRY_INVALID; 157 clock_ratio[i].frequency = CPUFREQ_ENTRY_INVALID;
158 else 158 else
@@ -182,7 +182,7 @@ static int powernow_k6_cpu_exit(struct cpufreq_policy *policy)
182 powernow_k6_set_state(i); 182 powernow_k6_set_state(i);
183 } 183 }
184 cpufreq_frequency_table_put_attr(policy->cpu); 184 cpufreq_frequency_table_put_attr(policy->cpu);
185 return 0; 185 return 0;
186} 186}
187 187
188static unsigned int powernow_k6_get(unsigned int cpu) 188static unsigned int powernow_k6_get(unsigned int cpu)
@@ -196,8 +196,8 @@ static struct freq_attr* powernow_k6_attr[] = {
196}; 196};
197 197
198static struct cpufreq_driver powernow_k6_driver = { 198static struct cpufreq_driver powernow_k6_driver = {
199 .verify = powernow_k6_verify, 199 .verify = powernow_k6_verify,
200 .target = powernow_k6_target, 200 .target = powernow_k6_target,
201 .init = powernow_k6_cpu_init, 201 .init = powernow_k6_cpu_init,
202 .exit = powernow_k6_cpu_exit, 202 .exit = powernow_k6_cpu_exit,
203 .get = powernow_k6_get, 203 .get = powernow_k6_get,
@@ -215,7 +215,7 @@ static struct cpufreq_driver powernow_k6_driver = {
215 * on success. 215 * on success.
216 */ 216 */
217static int __init powernow_k6_init(void) 217static int __init powernow_k6_init(void)
218{ 218{
219 struct cpuinfo_x86 *c = cpu_data; 219 struct cpuinfo_x86 *c = cpu_data;
220 220
221 if ((c->x86_vendor != X86_VENDOR_AMD) || (c->x86 != 5) || 221 if ((c->x86_vendor != X86_VENDOR_AMD) || (c->x86 != 5) ||
diff --git a/arch/i386/kernel/cpu/cpufreq/powernow-k7.c b/arch/i386/kernel/cpu/cpufreq/powernow-k7.c
index edcd626001da..2bf4237cb94e 100644
--- a/arch/i386/kernel/cpu/cpufreq/powernow-k7.c
+++ b/arch/i386/kernel/cpu/cpufreq/powernow-k7.c
@@ -199,8 +199,8 @@ static int get_ranges (unsigned char *pst)
199 powernow_table[j].index |= (vid << 8); /* upper 8 bits */ 199 powernow_table[j].index |= (vid << 8); /* upper 8 bits */
200 200
201 dprintk (" FID: 0x%x (%d.%dx [%dMHz]) " 201 dprintk (" FID: 0x%x (%d.%dx [%dMHz]) "
202 "VID: 0x%x (%d.%03dV)\n", fid, fid_codes[fid] / 10, 202 "VID: 0x%x (%d.%03dV)\n", fid, fid_codes[fid] / 10,
203 fid_codes[fid] % 10, speed/1000, vid, 203 fid_codes[fid] % 10, speed/1000, vid,
204 mobile_vid_table[vid]/1000, 204 mobile_vid_table[vid]/1000,
205 mobile_vid_table[vid]%1000); 205 mobile_vid_table[vid]%1000);
206 } 206 }
@@ -368,8 +368,8 @@ static int powernow_acpi_init(void)
368 } 368 }
369 369
370 dprintk (" FID: 0x%x (%d.%dx [%dMHz]) " 370 dprintk (" FID: 0x%x (%d.%dx [%dMHz]) "
371 "VID: 0x%x (%d.%03dV)\n", fid, fid_codes[fid] / 10, 371 "VID: 0x%x (%d.%03dV)\n", fid, fid_codes[fid] / 10,
372 fid_codes[fid] % 10, speed/1000, vid, 372 fid_codes[fid] % 10, speed/1000, vid,
373 mobile_vid_table[vid]/1000, 373 mobile_vid_table[vid]/1000,
374 mobile_vid_table[vid]%1000); 374 mobile_vid_table[vid]%1000);
375 375
@@ -460,7 +460,7 @@ static int powernow_decode_bios (int maxfid, int startvid)
460 (maxfid==pst->maxfid) && (startvid==pst->startvid)) 460 (maxfid==pst->maxfid) && (startvid==pst->startvid))
461 { 461 {
462 dprintk ("PST:%d (@%p)\n", i, pst); 462 dprintk ("PST:%d (@%p)\n", i, pst);
463 dprintk (" cpuid: 0x%x fsb: %d maxFID: 0x%x startvid: 0x%x\n", 463 dprintk (" cpuid: 0x%x fsb: %d maxFID: 0x%x startvid: 0x%x\n",
464 pst->cpuid, pst->fsbspeed, pst->maxfid, pst->startvid); 464 pst->cpuid, pst->fsbspeed, pst->maxfid, pst->startvid);
465 465
466 ret = get_ranges ((char *) pst + sizeof (struct pst_s)); 466 ret = get_ranges ((char *) pst + sizeof (struct pst_s));
diff --git a/arch/i386/kernel/cpu/cpufreq/powernow-k8.c b/arch/i386/kernel/cpu/cpufreq/powernow-k8.c
index e11a09207ec8..712a26bd4457 100644
--- a/arch/i386/kernel/cpu/cpufreq/powernow-k8.c
+++ b/arch/i386/kernel/cpu/cpufreq/powernow-k8.c
@@ -40,21 +40,22 @@
40 40
41#ifdef CONFIG_X86_POWERNOW_K8_ACPI 41#ifdef CONFIG_X86_POWERNOW_K8_ACPI
42#include <linux/acpi.h> 42#include <linux/acpi.h>
43#include <linux/mutex.h>
43#include <acpi/processor.h> 44#include <acpi/processor.h>
44#endif 45#endif
45 46
46#define PFX "powernow-k8: " 47#define PFX "powernow-k8: "
47#define BFX PFX "BIOS error: " 48#define BFX PFX "BIOS error: "
48#define VERSION "version 1.60.0" 49#define VERSION "version 1.60.1"
49#include "powernow-k8.h" 50#include "powernow-k8.h"
50 51
51/* serialize freq changes */ 52/* serialize freq changes */
52static DECLARE_MUTEX(fidvid_sem); 53static DEFINE_MUTEX(fidvid_mutex);
53 54
54static struct powernow_k8_data *powernow_data[NR_CPUS]; 55static struct powernow_k8_data *powernow_data[NR_CPUS];
55 56
56#ifndef CONFIG_SMP 57#ifndef CONFIG_SMP
57static cpumask_t cpu_core_map[1]; 58static cpumask_t cpu_core_map[1] = { CPU_MASK_ALL };
58#endif 59#endif
59 60
60/* Return a frequency in MHz, given an input fid */ 61/* Return a frequency in MHz, given an input fid */
@@ -83,11 +84,10 @@ static u32 find_millivolts_from_vid(struct powernow_k8_data *data, u32 vid)
83 */ 84 */
84static u32 convert_fid_to_vco_fid(u32 fid) 85static u32 convert_fid_to_vco_fid(u32 fid)
85{ 86{
86 if (fid < HI_FID_TABLE_BOTTOM) { 87 if (fid < HI_FID_TABLE_BOTTOM)
87 return 8 + (2 * fid); 88 return 8 + (2 * fid);
88 } else { 89 else
89 return fid; 90 return fid;
90 }
91} 91}
92 92
93/* 93/*
@@ -177,7 +177,7 @@ static int write_new_fid(struct powernow_k8_data *data, u32 fid)
177 if (i++ > 100) { 177 if (i++ > 100) {
178 printk(KERN_ERR PFX "internal error - pending bit very stuck - no further pstate changes possible\n"); 178 printk(KERN_ERR PFX "internal error - pending bit very stuck - no further pstate changes possible\n");
179 return 1; 179 return 1;
180 } 180 }
181 } while (query_current_values_with_pending_wait(data)); 181 } while (query_current_values_with_pending_wait(data));
182 182
183 count_off_irt(data); 183 count_off_irt(data);
@@ -474,8 +474,10 @@ static int check_supported_cpu(unsigned int cpu)
474 goto out; 474 goto out;
475 475
476 eax = cpuid_eax(CPUID_PROCESSOR_SIGNATURE); 476 eax = cpuid_eax(CPUID_PROCESSOR_SIGNATURE);
477 if ((eax & CPUID_XFAM) != CPUID_XFAM_K8)
478 goto out;
479
477 if (((eax & CPUID_USE_XFAM_XMOD) != CPUID_USE_XFAM_XMOD) || 480 if (((eax & CPUID_USE_XFAM_XMOD) != CPUID_USE_XFAM_XMOD) ||
478 ((eax & CPUID_XFAM) != CPUID_XFAM_K8) ||
479 ((eax & CPUID_XMOD) > CPUID_XMOD_REV_G)) { 481 ((eax & CPUID_XMOD) > CPUID_XMOD_REV_G)) {
480 printk(KERN_INFO PFX "Processor cpuid %x not supported\n", eax); 482 printk(KERN_INFO PFX "Processor cpuid %x not supported\n", eax);
481 goto out; 483 goto out;
@@ -780,9 +782,7 @@ static int powernow_k8_cpu_init_acpi(struct powernow_k8_data *data)
780 /* verify only 1 entry from the lo frequency table */ 782 /* verify only 1 entry from the lo frequency table */
781 if (fid < HI_FID_TABLE_BOTTOM) { 783 if (fid < HI_FID_TABLE_BOTTOM) {
782 if (cntlofreq) { 784 if (cntlofreq) {
783 /* if both entries are the same, ignore this 785 /* if both entries are the same, ignore this one ... */
784 * one...
785 */
786 if ((powernow_table[i].frequency != powernow_table[cntlofreq].frequency) || 786 if ((powernow_table[i].frequency != powernow_table[cntlofreq].frequency) ||
787 (powernow_table[i].index != powernow_table[cntlofreq].index)) { 787 (powernow_table[i].index != powernow_table[cntlofreq].index)) {
788 printk(KERN_ERR PFX "Too many lo freq table entries\n"); 788 printk(KERN_ERR PFX "Too many lo freq table entries\n");
@@ -854,7 +854,7 @@ static int transition_frequency(struct powernow_k8_data *data, unsigned int inde
854 dprintk("cpu %d transition to index %u\n", smp_processor_id(), index); 854 dprintk("cpu %d transition to index %u\n", smp_processor_id(), index);
855 855
856 /* fid are the lower 8 bits of the index we stored into 856 /* fid are the lower 8 bits of the index we stored into
857 * the cpufreq frequency table in find_psb_table, vid are 857 * the cpufreq frequency table in find_psb_table, vid are
858 * the upper 8 bits. 858 * the upper 8 bits.
859 */ 859 */
860 860
@@ -909,7 +909,6 @@ static int powernowk8_target(struct cpufreq_policy *pol, unsigned targfreq, unsi
909 u32 checkvid = data->currvid; 909 u32 checkvid = data->currvid;
910 unsigned int newstate; 910 unsigned int newstate;
911 int ret = -EIO; 911 int ret = -EIO;
912 int i;
913 912
914 /* only run on specific CPU from here on */ 913 /* only run on specific CPU from here on */
915 oldmask = current->cpus_allowed; 914 oldmask = current->cpus_allowed;
@@ -945,23 +944,17 @@ static int powernowk8_target(struct cpufreq_policy *pol, unsigned targfreq, unsi
945 if (cpufreq_frequency_table_target(pol, data->powernow_table, targfreq, relation, &newstate)) 944 if (cpufreq_frequency_table_target(pol, data->powernow_table, targfreq, relation, &newstate))
946 goto err_out; 945 goto err_out;
947 946
948 down(&fidvid_sem); 947 mutex_lock(&fidvid_mutex);
949 948
950 powernow_k8_acpi_pst_values(data, newstate); 949 powernow_k8_acpi_pst_values(data, newstate);
951 950
952 if (transition_frequency(data, newstate)) { 951 if (transition_frequency(data, newstate)) {
953 printk(KERN_ERR PFX "transition frequency failed\n"); 952 printk(KERN_ERR PFX "transition frequency failed\n");
954 ret = 1; 953 ret = 1;
955 up(&fidvid_sem); 954 mutex_unlock(&fidvid_mutex);
956 goto err_out; 955 goto err_out;
957 } 956 }
958 957 mutex_unlock(&fidvid_mutex);
959 /* Update all the fid/vids of our siblings */
960 for_each_cpu_mask(i, cpu_core_map[pol->cpu]) {
961 powernow_data[i]->currvid = data->currvid;
962 powernow_data[i]->currfid = data->currfid;
963 }
964 up(&fidvid_sem);
965 958
966 pol->cur = find_khz_freq_from_fid(data->currfid); 959 pol->cur = find_khz_freq_from_fid(data->currfid);
967 ret = 0; 960 ret = 0;
@@ -1048,7 +1041,7 @@ static int __cpuinit powernowk8_cpu_init(struct cpufreq_policy *pol)
1048 pol->governor = CPUFREQ_DEFAULT_GOVERNOR; 1041 pol->governor = CPUFREQ_DEFAULT_GOVERNOR;
1049 pol->cpus = cpu_core_map[pol->cpu]; 1042 pol->cpus = cpu_core_map[pol->cpu];
1050 1043
1051 /* Take a crude guess here. 1044 /* Take a crude guess here.
1052 * That guess was in microseconds, so multiply with 1000 */ 1045 * That guess was in microseconds, so multiply with 1000 */
1053 pol->cpuinfo.transition_latency = (((data->rvo + 8) * data->vstable * VST_UNITS_20US) 1046 pol->cpuinfo.transition_latency = (((data->rvo + 8) * data->vstable * VST_UNITS_20US)
1054 + (3 * (1 << data->irt) * 10)) * 1000; 1047 + (3 * (1 << data->irt) * 10)) * 1000;
@@ -1070,9 +1063,8 @@ static int __cpuinit powernowk8_cpu_init(struct cpufreq_policy *pol)
1070 printk("cpu_init done, current fid 0x%x, vid 0x%x\n", 1063 printk("cpu_init done, current fid 0x%x, vid 0x%x\n",
1071 data->currfid, data->currvid); 1064 data->currfid, data->currvid);
1072 1065
1073 for_each_cpu_mask(i, cpu_core_map[pol->cpu]) { 1066 for_each_cpu_mask(i, cpu_core_map[pol->cpu])
1074 powernow_data[i] = data; 1067 powernow_data[i] = data;
1075 }
1076 1068
1077 return 0; 1069 return 0;
1078 1070
@@ -1103,10 +1095,15 @@ static int __devexit powernowk8_cpu_exit (struct cpufreq_policy *pol)
1103 1095
1104static unsigned int powernowk8_get (unsigned int cpu) 1096static unsigned int powernowk8_get (unsigned int cpu)
1105{ 1097{
1106 struct powernow_k8_data *data = powernow_data[cpu]; 1098 struct powernow_k8_data *data;
1107 cpumask_t oldmask = current->cpus_allowed; 1099 cpumask_t oldmask = current->cpus_allowed;
1108 unsigned int khz = 0; 1100 unsigned int khz = 0;
1109 1101
1102 data = powernow_data[first_cpu(cpu_core_map[cpu])];
1103
1104 if (!data)
1105 return -EINVAL;
1106
1110 set_cpus_allowed(current, cpumask_of_cpu(cpu)); 1107 set_cpus_allowed(current, cpumask_of_cpu(cpu));
1111 if (smp_processor_id() != cpu) { 1108 if (smp_processor_id() != cpu) {
1112 printk(KERN_ERR PFX "limiting to CPU %d failed in powernowk8_get\n", cpu); 1109 printk(KERN_ERR PFX "limiting to CPU %d failed in powernowk8_get\n", cpu);
@@ -1145,16 +1142,14 @@ static int __cpuinit powernowk8_init(void)
1145{ 1142{
1146 unsigned int i, supported_cpus = 0; 1143 unsigned int i, supported_cpus = 0;
1147 1144
1148 for (i=0; i<NR_CPUS; i++) { 1145 for_each_online_cpu(i) {
1149 if (!cpu_online(i))
1150 continue;
1151 if (check_supported_cpu(i)) 1146 if (check_supported_cpu(i))
1152 supported_cpus++; 1147 supported_cpus++;
1153 } 1148 }
1154 1149
1155 if (supported_cpus == num_online_cpus()) { 1150 if (supported_cpus == num_online_cpus()) {
1156 printk(KERN_INFO PFX "Found %d AMD Athlon 64 / Opteron processors (" VERSION ")\n", 1151 printk(KERN_INFO PFX "Found %d AMD Athlon 64 / Opteron "
1157 supported_cpus); 1152 "processors (" VERSION ")\n", supported_cpus);
1158 return cpufreq_register_driver(&cpufreq_amd64_driver); 1153 return cpufreq_register_driver(&cpufreq_amd64_driver);
1159 } 1154 }
1160 1155
diff --git a/arch/i386/kernel/cpu/cpufreq/powernow-k8.h b/arch/i386/kernel/cpu/cpufreq/powernow-k8.h
index d0de37d58e9a..79a7c5c87edc 100644
--- a/arch/i386/kernel/cpu/cpufreq/powernow-k8.h
+++ b/arch/i386/kernel/cpu/cpufreq/powernow-k8.h
@@ -63,7 +63,7 @@ struct powernow_k8_data {
63#define MSR_C_LO_VID_SHIFT 8 63#define MSR_C_LO_VID_SHIFT 8
64 64
65/* Field definitions within the FID VID High Control MSR : */ 65/* Field definitions within the FID VID High Control MSR : */
66#define MSR_C_HI_STP_GNT_TO 0x000fffff 66#define MSR_C_HI_STP_GNT_TO 0x000fffff
67 67
68/* Field definitions within the FID VID Low Status MSR : */ 68/* Field definitions within the FID VID Low Status MSR : */
69#define MSR_S_LO_CHANGE_PENDING 0x80000000 /* cleared when completed */ 69#define MSR_S_LO_CHANGE_PENDING 0x80000000 /* cleared when completed */
@@ -123,7 +123,7 @@ struct powernow_k8_data {
123 * Most values of interest are enocoded in a single field of the _PSS 123 * Most values of interest are enocoded in a single field of the _PSS
124 * entries: the "control" value. 124 * entries: the "control" value.
125 */ 125 */
126 126
127#define IRT_SHIFT 30 127#define IRT_SHIFT 30
128#define RVO_SHIFT 28 128#define RVO_SHIFT 28
129#define EXT_TYPE_SHIFT 27 129#define EXT_TYPE_SHIFT 27
@@ -182,10 +182,6 @@ static int core_frequency_transition(struct powernow_k8_data *data, u32 reqfid);
182 182
183static void powernow_k8_acpi_pst_values(struct powernow_k8_data *data, unsigned int index); 183static void powernow_k8_acpi_pst_values(struct powernow_k8_data *data, unsigned int index);
184 184
185#ifndef for_each_cpu_mask
186#define for_each_cpu_mask(i,mask) for (i=0;i<1;i++)
187#endif
188
189#ifdef CONFIG_SMP 185#ifdef CONFIG_SMP
190static inline void define_siblings(int cpu, cpumask_t cpu_sharedcore_mask[]) 186static inline void define_siblings(int cpu, cpumask_t cpu_sharedcore_mask[])
191{ 187{
diff --git a/arch/i386/kernel/cpu/cpufreq/speedstep-centrino.c b/arch/i386/kernel/cpu/cpufreq/speedstep-centrino.c
index c173c0fa117a..b0ff9075708c 100644
--- a/arch/i386/kernel/cpu/cpufreq/speedstep-centrino.c
+++ b/arch/i386/kernel/cpu/cpufreq/speedstep-centrino.c
@@ -479,15 +479,13 @@ static int centrino_cpu_init(struct cpufreq_policy *policy)
479 unsigned l, h; 479 unsigned l, h;
480 int ret; 480 int ret;
481 int i; 481 int i;
482 struct cpuinfo_x86 *c = &cpu_data[policy->cpu];
483 482
484 /* Only Intel makes Enhanced Speedstep-capable CPUs */ 483 /* Only Intel makes Enhanced Speedstep-capable CPUs */
485 if (cpu->x86_vendor != X86_VENDOR_INTEL || !cpu_has(cpu, X86_FEATURE_EST)) 484 if (cpu->x86_vendor != X86_VENDOR_INTEL || !cpu_has(cpu, X86_FEATURE_EST))
486 return -ENODEV; 485 return -ENODEV;
487 486
488 if (cpu_has(c, X86_FEATURE_CONSTANT_TSC)) { 487 if (cpu_has(cpu, X86_FEATURE_CONSTANT_TSC))
489 centrino_driver.flags |= CPUFREQ_CONST_LOOPS; 488 centrino_driver.flags |= CPUFREQ_CONST_LOOPS;
490 }
491 489
492 if (centrino_cpu_init_acpi(policy)) { 490 if (centrino_cpu_init_acpi(policy)) {
493 if (policy->cpu != 0) 491 if (policy->cpu != 0)
diff --git a/arch/i386/kernel/cpu/cpufreq/speedstep-lib.c b/arch/i386/kernel/cpu/cpufreq/speedstep-lib.c
index 7c47005a1805..4f46cac155c4 100644
--- a/arch/i386/kernel/cpu/cpufreq/speedstep-lib.c
+++ b/arch/i386/kernel/cpu/cpufreq/speedstep-lib.c
@@ -9,7 +9,7 @@
9 */ 9 */
10 10
11#include <linux/kernel.h> 11#include <linux/kernel.h>
12#include <linux/module.h> 12#include <linux/module.h>
13#include <linux/moduleparam.h> 13#include <linux/moduleparam.h>
14#include <linux/init.h> 14#include <linux/init.h>
15#include <linux/cpufreq.h> 15#include <linux/cpufreq.h>
@@ -36,8 +36,8 @@ static unsigned int pentium3_get_frequency (unsigned int processor)
36 /* See table 14 of p3_ds.pdf and table 22 of 29834003.pdf */ 36 /* See table 14 of p3_ds.pdf and table 22 of 29834003.pdf */
37 struct { 37 struct {
38 unsigned int ratio; /* Frequency Multiplier (x10) */ 38 unsigned int ratio; /* Frequency Multiplier (x10) */
39 u8 bitmap; /* power on configuration bits 39 u8 bitmap; /* power on configuration bits
40 [27, 25:22] (in MSR 0x2a) */ 40 [27, 25:22] (in MSR 0x2a) */
41 } msr_decode_mult [] = { 41 } msr_decode_mult [] = {
42 { 30, 0x01 }, 42 { 30, 0x01 },
43 { 35, 0x05 }, 43 { 35, 0x05 },
@@ -58,9 +58,9 @@ static unsigned int pentium3_get_frequency (unsigned int processor)
58 58
59 /* PIII(-M) FSB settings: see table b1-b of 24547206.pdf */ 59 /* PIII(-M) FSB settings: see table b1-b of 24547206.pdf */
60 struct { 60 struct {
61 unsigned int value; /* Front Side Bus speed in MHz */ 61 unsigned int value; /* Front Side Bus speed in MHz */
62 u8 bitmap; /* power on configuration bits [18: 19] 62 u8 bitmap; /* power on configuration bits [18: 19]
63 (in MSR 0x2a) */ 63 (in MSR 0x2a) */
64 } msr_decode_fsb [] = { 64 } msr_decode_fsb [] = {
65 { 66, 0x0 }, 65 { 66, 0x0 },
66 { 100, 0x2 }, 66 { 100, 0x2 },
@@ -68,8 +68,8 @@ static unsigned int pentium3_get_frequency (unsigned int processor)
68 { 0, 0xff} 68 { 0, 0xff}
69 }; 69 };
70 70
71 u32 msr_lo, msr_tmp; 71 u32 msr_lo, msr_tmp;
72 int i = 0, j = 0; 72 int i = 0, j = 0;
73 73
74 /* read MSR 0x2a - we only need the low 32 bits */ 74 /* read MSR 0x2a - we only need the low 32 bits */
75 rdmsr(MSR_IA32_EBL_CR_POWERON, msr_lo, msr_tmp); 75 rdmsr(MSR_IA32_EBL_CR_POWERON, msr_lo, msr_tmp);
@@ -106,7 +106,7 @@ static unsigned int pentium3_get_frequency (unsigned int processor)
106 106
107static unsigned int pentiumM_get_frequency(void) 107static unsigned int pentiumM_get_frequency(void)
108{ 108{
109 u32 msr_lo, msr_tmp; 109 u32 msr_lo, msr_tmp;
110 110
111 rdmsr(MSR_IA32_EBL_CR_POWERON, msr_lo, msr_tmp); 111 rdmsr(MSR_IA32_EBL_CR_POWERON, msr_lo, msr_tmp);
112 dprintk("PM - MSR_IA32_EBL_CR_POWERON: 0x%x 0x%x\n", msr_lo, msr_tmp); 112 dprintk("PM - MSR_IA32_EBL_CR_POWERON: 0x%x 0x%x\n", msr_lo, msr_tmp);
@@ -134,7 +134,7 @@ static unsigned int pentium4_get_frequency(void)
134 134
135 dprintk("P4 - MSR_EBC_FREQUENCY_ID: 0x%x 0x%x\n", msr_lo, msr_hi); 135 dprintk("P4 - MSR_EBC_FREQUENCY_ID: 0x%x 0x%x\n", msr_lo, msr_hi);
136 136
137 /* decode the FSB: see IA-32 Intel (C) Architecture Software 137 /* decode the FSB: see IA-32 Intel (C) Architecture Software
138 * Developer's Manual, Volume 3: System Prgramming Guide, 138 * Developer's Manual, Volume 3: System Prgramming Guide,
139 * revision #12 in Table B-1: MSRs in the Pentium 4 and 139 * revision #12 in Table B-1: MSRs in the Pentium 4 and
140 * Intel Xeon Processors, on page B-4 and B-5. 140 * Intel Xeon Processors, on page B-4 and B-5.
@@ -170,7 +170,7 @@ static unsigned int pentium4_get_frequency(void)
170 return (fsb * mult); 170 return (fsb * mult);
171} 171}
172 172
173 173
174unsigned int speedstep_get_processor_frequency(unsigned int processor) 174unsigned int speedstep_get_processor_frequency(unsigned int processor)
175{ 175{
176 switch (processor) { 176 switch (processor) {
@@ -198,11 +198,11 @@ EXPORT_SYMBOL_GPL(speedstep_get_processor_frequency);
198unsigned int speedstep_detect_processor (void) 198unsigned int speedstep_detect_processor (void)
199{ 199{
200 struct cpuinfo_x86 *c = cpu_data; 200 struct cpuinfo_x86 *c = cpu_data;
201 u32 ebx, msr_lo, msr_hi; 201 u32 ebx, msr_lo, msr_hi;
202 202
203 dprintk("x86: %x, model: %x\n", c->x86, c->x86_model); 203 dprintk("x86: %x, model: %x\n", c->x86, c->x86_model);
204 204
205 if ((c->x86_vendor != X86_VENDOR_INTEL) || 205 if ((c->x86_vendor != X86_VENDOR_INTEL) ||
206 ((c->x86 != 6) && (c->x86 != 0xF))) 206 ((c->x86 != 6) && (c->x86 != 0xF)))
207 return 0; 207 return 0;
208 208
@@ -218,15 +218,15 @@ unsigned int speedstep_detect_processor (void)
218 dprintk("ebx value is %x, x86_mask is %x\n", ebx, c->x86_mask); 218 dprintk("ebx value is %x, x86_mask is %x\n", ebx, c->x86_mask);
219 219
220 switch (c->x86_mask) { 220 switch (c->x86_mask) {
221 case 4: 221 case 4:
222 /* 222 /*
223 * B-stepping [M-P4-M] 223 * B-stepping [M-P4-M]
224 * sample has ebx = 0x0f, production has 0x0e. 224 * sample has ebx = 0x0f, production has 0x0e.
225 */ 225 */
226 if ((ebx == 0x0e) || (ebx == 0x0f)) 226 if ((ebx == 0x0e) || (ebx == 0x0f))
227 return SPEEDSTEP_PROCESSOR_P4M; 227 return SPEEDSTEP_PROCESSOR_P4M;
228 break; 228 break;
229 case 7: 229 case 7:
230 /* 230 /*
231 * C-stepping [M-P4-M] 231 * C-stepping [M-P4-M]
232 * needs to have ebx=0x0e, else it's a celeron: 232 * needs to have ebx=0x0e, else it's a celeron:
@@ -253,7 +253,7 @@ unsigned int speedstep_detect_processor (void)
253 * also, M-P4M HTs have ebx=0x8, too 253 * also, M-P4M HTs have ebx=0x8, too
254 * For now, they are distinguished by the model_id string 254 * For now, they are distinguished by the model_id string
255 */ 255 */
256 if ((ebx == 0x0e) || (strstr(c->x86_model_id,"Mobile Intel(R) Pentium(R) 4") != NULL)) 256 if ((ebx == 0x0e) || (strstr(c->x86_model_id,"Mobile Intel(R) Pentium(R) 4") != NULL))
257 return SPEEDSTEP_PROCESSOR_P4M; 257 return SPEEDSTEP_PROCESSOR_P4M;
258 break; 258 break;
259 default: 259 default:
@@ -264,8 +264,7 @@ unsigned int speedstep_detect_processor (void)
264 264
265 switch (c->x86_model) { 265 switch (c->x86_model) {
266 case 0x0B: /* Intel PIII [Tualatin] */ 266 case 0x0B: /* Intel PIII [Tualatin] */
267 /* cpuid_ebx(1) is 0x04 for desktop PIII, 267 /* cpuid_ebx(1) is 0x04 for desktop PIII, 0x06 for mobile PIII-M */
268 0x06 for mobile PIII-M */
269 ebx = cpuid_ebx(0x00000001); 268 ebx = cpuid_ebx(0x00000001);
270 dprintk("ebx is %x\n", ebx); 269 dprintk("ebx is %x\n", ebx);
271 270
@@ -275,9 +274,8 @@ unsigned int speedstep_detect_processor (void)
275 return 0; 274 return 0;
276 275
277 /* So far all PIII-M processors support SpeedStep. See 276 /* So far all PIII-M processors support SpeedStep. See
278 * Intel's 24540640.pdf of June 2003 277 * Intel's 24540640.pdf of June 2003
279 */ 278 */
280
281 return SPEEDSTEP_PROCESSOR_PIII_T; 279 return SPEEDSTEP_PROCESSOR_PIII_T;
282 280
283 case 0x08: /* Intel PIII [Coppermine] */ 281 case 0x08: /* Intel PIII [Coppermine] */
@@ -399,7 +397,7 @@ unsigned int speedstep_get_freqs(unsigned int processor,
399 } 397 }
400 } 398 }
401 399
402 out: 400out:
403 local_irq_restore(flags); 401 local_irq_restore(flags);
404 return (ret); 402 return (ret);
405} 403}
diff --git a/arch/i386/kernel/cpu/cpufreq/speedstep-lib.h b/arch/i386/kernel/cpu/cpufreq/speedstep-lib.h
index 6a727fd3a77e..b735429c50b4 100644
--- a/arch/i386/kernel/cpu/cpufreq/speedstep-lib.h
+++ b/arch/i386/kernel/cpu/cpufreq/speedstep-lib.h
@@ -14,7 +14,7 @@
14 14
15#define SPEEDSTEP_PROCESSOR_PIII_C_EARLY 0x00000001 /* Coppermine core */ 15#define SPEEDSTEP_PROCESSOR_PIII_C_EARLY 0x00000001 /* Coppermine core */
16#define SPEEDSTEP_PROCESSOR_PIII_C 0x00000002 /* Coppermine core */ 16#define SPEEDSTEP_PROCESSOR_PIII_C 0x00000002 /* Coppermine core */
17#define SPEEDSTEP_PROCESSOR_PIII_T 0x00000003 /* Tualatin core */ 17#define SPEEDSTEP_PROCESSOR_PIII_T 0x00000003 /* Tualatin core */
18#define SPEEDSTEP_PROCESSOR_P4M 0x00000004 /* P4-M */ 18#define SPEEDSTEP_PROCESSOR_P4M 0x00000004 /* P4-M */
19 19
20/* the following processors are not speedstep-capable and are not auto-detected 20/* the following processors are not speedstep-capable and are not auto-detected
@@ -25,8 +25,8 @@
25 25
26/* speedstep states -- only two of them */ 26/* speedstep states -- only two of them */
27 27
28#define SPEEDSTEP_HIGH 0x00000000 28#define SPEEDSTEP_HIGH 0x00000000
29#define SPEEDSTEP_LOW 0x00000001 29#define SPEEDSTEP_LOW 0x00000001
30 30
31 31
32/* detect a speedstep-capable processor */ 32/* detect a speedstep-capable processor */
@@ -36,13 +36,13 @@ extern unsigned int speedstep_detect_processor (void);
36extern unsigned int speedstep_get_processor_frequency(unsigned int processor); 36extern unsigned int speedstep_get_processor_frequency(unsigned int processor);
37 37
38 38
39/* detect the low and high speeds of the processor. The callback 39/* detect the low and high speeds of the processor. The callback
40 * set_state"'s first argument is either SPEEDSTEP_HIGH or 40 * set_state"'s first argument is either SPEEDSTEP_HIGH or
41 * SPEEDSTEP_LOW; the second argument is zero so that no 41 * SPEEDSTEP_LOW; the second argument is zero so that no
42 * cpufreq_notify_transition calls are initiated. 42 * cpufreq_notify_transition calls are initiated.
43 */ 43 */
44extern unsigned int speedstep_get_freqs(unsigned int processor, 44extern unsigned int speedstep_get_freqs(unsigned int processor,
45 unsigned int *low_speed, 45 unsigned int *low_speed,
46 unsigned int *high_speed, 46 unsigned int *high_speed,
47 unsigned int *transition_latency, 47 unsigned int *transition_latency,
48 void (*set_state) (unsigned int state)); 48 void (*set_state) (unsigned int state));
diff --git a/arch/i386/kernel/cpu/cpufreq/speedstep-smi.c b/arch/i386/kernel/cpu/cpufreq/speedstep-smi.c
index 28cc5d524afc..c28333d53646 100644
--- a/arch/i386/kernel/cpu/cpufreq/speedstep-smi.c
+++ b/arch/i386/kernel/cpu/cpufreq/speedstep-smi.c
@@ -13,8 +13,8 @@
13 *********************************************************************/ 13 *********************************************************************/
14 14
15#include <linux/kernel.h> 15#include <linux/kernel.h>
16#include <linux/module.h> 16#include <linux/module.h>
17#include <linux/moduleparam.h> 17#include <linux/moduleparam.h>
18#include <linux/init.h> 18#include <linux/init.h>
19#include <linux/cpufreq.h> 19#include <linux/cpufreq.h>
20#include <linux/pci.h> 20#include <linux/pci.h>
@@ -28,21 +28,21 @@
28 * 28 *
29 * These parameters are got from IST-SMI BIOS call. 29 * These parameters are got from IST-SMI BIOS call.
30 * If user gives it, these are used. 30 * If user gives it, these are used.
31 * 31 *
32 */ 32 */
33static int smi_port = 0; 33static int smi_port = 0;
34static int smi_cmd = 0; 34static int smi_cmd = 0;
35static unsigned int smi_sig = 0; 35static unsigned int smi_sig = 0;
36 36
37/* info about the processor */ 37/* info about the processor */
38static unsigned int speedstep_processor = 0; 38static unsigned int speedstep_processor = 0;
39 39
40/* 40/*
41 * There are only two frequency states for each processor. Values 41 * There are only two frequency states for each processor. Values
42 * are in kHz for the time being. 42 * are in kHz for the time being.
43 */ 43 */
44static struct cpufreq_frequency_table speedstep_freqs[] = { 44static struct cpufreq_frequency_table speedstep_freqs[] = {
45 {SPEEDSTEP_HIGH, 0}, 45 {SPEEDSTEP_HIGH, 0},
46 {SPEEDSTEP_LOW, 0}, 46 {SPEEDSTEP_LOW, 0},
47 {0, CPUFREQ_TABLE_END}, 47 {0, CPUFREQ_TABLE_END},
48}; 48};
@@ -75,7 +75,9 @@ static int speedstep_smi_ownership (void)
75 __asm__ __volatile__( 75 __asm__ __volatile__(
76 "out %%al, (%%dx)\n" 76 "out %%al, (%%dx)\n"
77 : "=D" (result) 77 : "=D" (result)
78 : "a" (command), "b" (function), "c" (0), "d" (smi_port), "D" (0), "S" (magic) 78 : "a" (command), "b" (function), "c" (0), "d" (smi_port),
79 "D" (0), "S" (magic)
80 : "memory"
79 ); 81 );
80 82
81 dprintk("result is %x\n", result); 83 dprintk("result is %x\n", result);
@@ -123,7 +125,7 @@ static int speedstep_smi_get_freqs (unsigned int *low, unsigned int *high)
123 *low = low_mhz * 1000; 125 *low = low_mhz * 1000;
124 126
125 return result; 127 return result;
126} 128}
127 129
128/** 130/**
129 * speedstep_get_state - set the SpeedStep state 131 * speedstep_get_state - set the SpeedStep state
@@ -204,7 +206,7 @@ static void speedstep_set_state (unsigned int state)
204 * speedstep_target - set a new CPUFreq policy 206 * speedstep_target - set a new CPUFreq policy
205 * @policy: new policy 207 * @policy: new policy
206 * @target_freq: new freq 208 * @target_freq: new freq
207 * @relation: 209 * @relation:
208 * 210 *
209 * Sets a new CPUFreq policy/freq. 211 * Sets a new CPUFreq policy/freq.
210 */ 212 */
@@ -283,7 +285,7 @@ static int speedstep_cpu_init(struct cpufreq_policy *policy)
283 state = speedstep_get_state(); 285 state = speedstep_get_state();
284 speed = speedstep_freqs[state].frequency; 286 speed = speedstep_freqs[state].frequency;
285 287
286 dprintk("currently at %s speed setting - %i MHz\n", 288 dprintk("currently at %s speed setting - %i MHz\n",
287 (speed == speedstep_freqs[SPEEDSTEP_LOW].frequency) ? "low" : "high", 289 (speed == speedstep_freqs[SPEEDSTEP_LOW].frequency) ? "low" : "high",
288 (speed / 1000)); 290 (speed / 1000));
289 291
@@ -296,7 +298,7 @@ static int speedstep_cpu_init(struct cpufreq_policy *policy)
296 if (result) 298 if (result)
297 return (result); 299 return (result);
298 300
299 cpufreq_frequency_table_get_attr(speedstep_freqs, policy->cpu); 301 cpufreq_frequency_table_get_attr(speedstep_freqs, policy->cpu);
300 302
301 return 0; 303 return 0;
302} 304}
@@ -332,8 +334,8 @@ static struct freq_attr* speedstep_attr[] = {
332 334
333static struct cpufreq_driver speedstep_driver = { 335static struct cpufreq_driver speedstep_driver = {
334 .name = "speedstep-smi", 336 .name = "speedstep-smi",
335 .verify = speedstep_verify, 337 .verify = speedstep_verify,
336 .target = speedstep_target, 338 .target = speedstep_target,
337 .init = speedstep_cpu_init, 339 .init = speedstep_cpu_init,
338 .exit = speedstep_cpu_exit, 340 .exit = speedstep_cpu_exit,
339 .get = speedstep_get, 341 .get = speedstep_get,
@@ -370,13 +372,12 @@ static int __init speedstep_init(void)
370 return -ENODEV; 372 return -ENODEV;
371 } 373 }
372 374
373 dprintk("signature:0x%.8lx, command:0x%.8lx, event:0x%.8lx, perf_level:0x%.8lx.\n", 375 dprintk("signature:0x%.8lx, command:0x%.8lx, event:0x%.8lx, perf_level:0x%.8lx.\n",
374 ist_info.signature, ist_info.command, ist_info.event, ist_info.perf_level); 376 ist_info.signature, ist_info.command, ist_info.event, ist_info.perf_level);
375 377
376 378 /* Error if no IST-SMI BIOS or no PARM
377 /* Error if no IST-SMI BIOS or no PARM
378 sig= 'ISGE' aka 'Intel Speedstep Gate E' */ 379 sig= 'ISGE' aka 'Intel Speedstep Gate E' */
379 if ((ist_info.signature != 0x47534943) && ( 380 if ((ist_info.signature != 0x47534943) && (
380 (smi_port == 0) || (smi_cmd == 0))) 381 (smi_port == 0) || (smi_cmd == 0)))
381 return -ENODEV; 382 return -ENODEV;
382 383
@@ -386,17 +387,15 @@ static int __init speedstep_init(void)
386 smi_sig = ist_info.signature; 387 smi_sig = ist_info.signature;
387 388
388 /* setup smi_port from MODLULE_PARM or BIOS */ 389 /* setup smi_port from MODLULE_PARM or BIOS */
389 if ((smi_port > 0xff) || (smi_port < 0)) { 390 if ((smi_port > 0xff) || (smi_port < 0))
390 return -EINVAL; 391 return -EINVAL;
391 } else if (smi_port == 0) { 392 else if (smi_port == 0)
392 smi_port = ist_info.command & 0xff; 393 smi_port = ist_info.command & 0xff;
393 }
394 394
395 if ((smi_cmd > 0xff) || (smi_cmd < 0)) { 395 if ((smi_cmd > 0xff) || (smi_cmd < 0))
396 return -EINVAL; 396 return -EINVAL;
397 } else if (smi_cmd == 0) { 397 else if (smi_cmd == 0)
398 smi_cmd = (ist_info.command >> 16) & 0xff; 398 smi_cmd = (ist_info.command >> 16) & 0xff;
399 }
400 399
401 return cpufreq_register_driver(&speedstep_driver); 400 return cpufreq_register_driver(&speedstep_driver);
402} 401}
diff --git a/arch/i386/kernel/cpu/intel.c b/arch/i386/kernel/cpu/intel.c
index 8c0120186b9f..5386b29bb5a5 100644
--- a/arch/i386/kernel/cpu/intel.c
+++ b/arch/i386/kernel/cpu/intel.c
@@ -29,7 +29,7 @@ extern int trap_init_f00f_bug(void);
29struct movsl_mask movsl_mask __read_mostly; 29struct movsl_mask movsl_mask __read_mostly;
30#endif 30#endif
31 31
32void __devinit early_intel_workaround(struct cpuinfo_x86 *c) 32void __cpuinit early_intel_workaround(struct cpuinfo_x86 *c)
33{ 33{
34 if (c->x86_vendor != X86_VENDOR_INTEL) 34 if (c->x86_vendor != X86_VENDOR_INTEL)
35 return; 35 return;
@@ -44,7 +44,7 @@ void __devinit early_intel_workaround(struct cpuinfo_x86 *c)
44 * This is called before we do cpu ident work 44 * This is called before we do cpu ident work
45 */ 45 */
46 46
47int __devinit ppro_with_ram_bug(void) 47int __cpuinit ppro_with_ram_bug(void)
48{ 48{
49 /* Uses data from early_cpu_detect now */ 49 /* Uses data from early_cpu_detect now */
50 if (boot_cpu_data.x86_vendor == X86_VENDOR_INTEL && 50 if (boot_cpu_data.x86_vendor == X86_VENDOR_INTEL &&
@@ -62,7 +62,7 @@ int __devinit ppro_with_ram_bug(void)
62 * P4 Xeon errata 037 workaround. 62 * P4 Xeon errata 037 workaround.
63 * Hardware prefetcher may cause stale data to be loaded into the cache. 63 * Hardware prefetcher may cause stale data to be loaded into the cache.
64 */ 64 */
65static void __devinit Intel_errata_workarounds(struct cpuinfo_x86 *c) 65static void __cpuinit Intel_errata_workarounds(struct cpuinfo_x86 *c)
66{ 66{
67 unsigned long lo, hi; 67 unsigned long lo, hi;
68 68
@@ -81,7 +81,7 @@ static void __devinit Intel_errata_workarounds(struct cpuinfo_x86 *c)
81/* 81/*
82 * find out the number of processor cores on the die 82 * find out the number of processor cores on the die
83 */ 83 */
84static int __devinit num_cpu_cores(struct cpuinfo_x86 *c) 84static int __cpuinit num_cpu_cores(struct cpuinfo_x86 *c)
85{ 85{
86 unsigned int eax, ebx, ecx, edx; 86 unsigned int eax, ebx, ecx, edx;
87 87
@@ -96,7 +96,7 @@ static int __devinit num_cpu_cores(struct cpuinfo_x86 *c)
96 return 1; 96 return 1;
97} 97}
98 98
99static void __devinit init_intel(struct cpuinfo_x86 *c) 99static void __cpuinit init_intel(struct cpuinfo_x86 *c)
100{ 100{
101 unsigned int l2 = 0; 101 unsigned int l2 = 0;
102 char *p = NULL; 102 char *p = NULL;
@@ -205,7 +205,7 @@ static unsigned int intel_size_cache(struct cpuinfo_x86 * c, unsigned int size)
205 return size; 205 return size;
206} 206}
207 207
208static struct cpu_dev intel_cpu_dev __devinitdata = { 208static struct cpu_dev intel_cpu_dev __cpuinitdata = {
209 .c_vendor = "Intel", 209 .c_vendor = "Intel",
210 .c_ident = { "GenuineIntel" }, 210 .c_ident = { "GenuineIntel" },
211 .c_models = { 211 .c_models = {
diff --git a/arch/i386/kernel/cpu/intel_cacheinfo.c b/arch/i386/kernel/cpu/intel_cacheinfo.c
index ffe58cee0c48..9df87b03612c 100644
--- a/arch/i386/kernel/cpu/intel_cacheinfo.c
+++ b/arch/i386/kernel/cpu/intel_cacheinfo.c
@@ -173,8 +173,12 @@ unsigned int __cpuinit init_intel_cacheinfo(struct cpuinfo_x86 *c)
173 unsigned int trace = 0, l1i = 0, l1d = 0, l2 = 0, l3 = 0; /* Cache sizes */ 173 unsigned int trace = 0, l1i = 0, l1d = 0, l2 = 0, l3 = 0; /* Cache sizes */
174 unsigned int new_l1d = 0, new_l1i = 0; /* Cache sizes from cpuid(4) */ 174 unsigned int new_l1d = 0, new_l1i = 0; /* Cache sizes from cpuid(4) */
175 unsigned int new_l2 = 0, new_l3 = 0, i; /* Cache sizes from cpuid(4) */ 175 unsigned int new_l2 = 0, new_l3 = 0, i; /* Cache sizes from cpuid(4) */
176 unsigned int l2_id = 0, l3_id = 0, num_threads_sharing, index_msb;
177#ifdef CONFIG_SMP
178 unsigned int cpu = (c == &boot_cpu_data) ? 0 : (c - cpu_data);
179#endif
176 180
177 if (c->cpuid_level > 4) { 181 if (c->cpuid_level > 3) {
178 static int is_initialized; 182 static int is_initialized;
179 183
180 if (is_initialized == 0) { 184 if (is_initialized == 0) {
@@ -205,9 +209,15 @@ unsigned int __cpuinit init_intel_cacheinfo(struct cpuinfo_x86 *c)
205 break; 209 break;
206 case 2: 210 case 2:
207 new_l2 = this_leaf.size/1024; 211 new_l2 = this_leaf.size/1024;
212 num_threads_sharing = 1 + this_leaf.eax.split.num_threads_sharing;
213 index_msb = get_count_order(num_threads_sharing);
214 l2_id = c->apicid >> index_msb;
208 break; 215 break;
209 case 3: 216 case 3:
210 new_l3 = this_leaf.size/1024; 217 new_l3 = this_leaf.size/1024;
218 num_threads_sharing = 1 + this_leaf.eax.split.num_threads_sharing;
219 index_msb = get_count_order(num_threads_sharing);
220 l3_id = c->apicid >> index_msb;
211 break; 221 break;
212 default: 222 default:
213 break; 223 break;
@@ -215,11 +225,19 @@ unsigned int __cpuinit init_intel_cacheinfo(struct cpuinfo_x86 *c)
215 } 225 }
216 } 226 }
217 } 227 }
218 if (c->cpuid_level > 1) { 228 /*
229 * Don't use cpuid2 if cpuid4 is supported. For P4, we use cpuid2 for
230 * trace cache
231 */
232 if ((num_cache_leaves == 0 || c->x86 == 15) && c->cpuid_level > 1) {
219 /* supports eax=2 call */ 233 /* supports eax=2 call */
220 int i, j, n; 234 int i, j, n;
221 int regs[4]; 235 int regs[4];
222 unsigned char *dp = (unsigned char *)regs; 236 unsigned char *dp = (unsigned char *)regs;
237 int only_trace = 0;
238
239 if (num_cache_leaves != 0 && c->x86 == 15)
240 only_trace = 1;
223 241
224 /* Number of times to iterate */ 242 /* Number of times to iterate */
225 n = cpuid_eax(2) & 0xFF; 243 n = cpuid_eax(2) & 0xFF;
@@ -241,6 +259,8 @@ unsigned int __cpuinit init_intel_cacheinfo(struct cpuinfo_x86 *c)
241 while (cache_table[k].descriptor != 0) 259 while (cache_table[k].descriptor != 0)
242 { 260 {
243 if (cache_table[k].descriptor == des) { 261 if (cache_table[k].descriptor == des) {
262 if (only_trace && cache_table[k].cache_type != LVL_TRACE)
263 break;
244 switch (cache_table[k].cache_type) { 264 switch (cache_table[k].cache_type) {
245 case LVL_1_INST: 265 case LVL_1_INST:
246 l1i += cache_table[k].size; 266 l1i += cache_table[k].size;
@@ -266,34 +286,45 @@ unsigned int __cpuinit init_intel_cacheinfo(struct cpuinfo_x86 *c)
266 } 286 }
267 } 287 }
268 } 288 }
289 }
269 290
270 if (new_l1d) 291 if (new_l1d)
271 l1d = new_l1d; 292 l1d = new_l1d;
272 293
273 if (new_l1i) 294 if (new_l1i)
274 l1i = new_l1i; 295 l1i = new_l1i;
275 296
276 if (new_l2) 297 if (new_l2) {
277 l2 = new_l2; 298 l2 = new_l2;
299#ifdef CONFIG_SMP
300 cpu_llc_id[cpu] = l2_id;
301#endif
302 }
278 303
279 if (new_l3) 304 if (new_l3) {
280 l3 = new_l3; 305 l3 = new_l3;
306#ifdef CONFIG_SMP
307 cpu_llc_id[cpu] = l3_id;
308#endif
309 }
281 310
282 if ( trace ) 311 if (trace)
283 printk (KERN_INFO "CPU: Trace cache: %dK uops", trace); 312 printk (KERN_INFO "CPU: Trace cache: %dK uops", trace);
284 else if ( l1i ) 313 else if ( l1i )
285 printk (KERN_INFO "CPU: L1 I cache: %dK", l1i); 314 printk (KERN_INFO "CPU: L1 I cache: %dK", l1i);
286 if ( l1d )
287 printk(", L1 D cache: %dK\n", l1d);
288 else
289 printk("\n");
290 if ( l2 )
291 printk(KERN_INFO "CPU: L2 cache: %dK\n", l2);
292 if ( l3 )
293 printk(KERN_INFO "CPU: L3 cache: %dK\n", l3);
294 315
295 c->x86_cache_size = l3 ? l3 : (l2 ? l2 : (l1i+l1d)); 316 if (l1d)
296 } 317 printk(", L1 D cache: %dK\n", l1d);
318 else
319 printk("\n");
320
321 if (l2)
322 printk(KERN_INFO "CPU: L2 cache: %dK\n", l2);
323
324 if (l3)
325 printk(KERN_INFO "CPU: L3 cache: %dK\n", l3);
326
327 c->x86_cache_size = l3 ? l3 : (l2 ? l2 : (l1i+l1d));
297 328
298 return l2; 329 return l2;
299} 330}
@@ -330,7 +361,7 @@ static void __cpuinit cache_shared_cpu_map_setup(unsigned int cpu, int index)
330 } 361 }
331 } 362 }
332} 363}
333static void __devinit cache_remove_shared_cpu_map(unsigned int cpu, int index) 364static void __cpuinit cache_remove_shared_cpu_map(unsigned int cpu, int index)
334{ 365{
335 struct _cpuid4_info *this_leaf, *sibling_leaf; 366 struct _cpuid4_info *this_leaf, *sibling_leaf;
336 int sibling; 367 int sibling;
diff --git a/arch/i386/kernel/cpu/mcheck/mce.c b/arch/i386/kernel/cpu/mcheck/mce.c
index 6170af3c271a..afa0888f9a1e 100644
--- a/arch/i386/kernel/cpu/mcheck/mce.c
+++ b/arch/i386/kernel/cpu/mcheck/mce.c
@@ -64,13 +64,13 @@ void mcheck_init(struct cpuinfo_x86 *c)
64static int __init mcheck_disable(char *str) 64static int __init mcheck_disable(char *str)
65{ 65{
66 mce_disabled = 1; 66 mce_disabled = 1;
67 return 0; 67 return 1;
68} 68}
69 69
70static int __init mcheck_enable(char *str) 70static int __init mcheck_enable(char *str)
71{ 71{
72 mce_disabled = -1; 72 mce_disabled = -1;
73 return 0; 73 return 1;
74} 74}
75 75
76__setup("nomce", mcheck_disable); 76__setup("nomce", mcheck_disable);
diff --git a/arch/i386/kernel/cpu/mtrr/main.c b/arch/i386/kernel/cpu/mtrr/main.c
index 3b4618bed70d..fff90bda4733 100644
--- a/arch/i386/kernel/cpu/mtrr/main.c
+++ b/arch/i386/kernel/cpu/mtrr/main.c
@@ -36,6 +36,7 @@
36#include <linux/pci.h> 36#include <linux/pci.h>
37#include <linux/smp.h> 37#include <linux/smp.h>
38#include <linux/cpu.h> 38#include <linux/cpu.h>
39#include <linux/mutex.h>
39 40
40#include <asm/mtrr.h> 41#include <asm/mtrr.h>
41 42
@@ -47,7 +48,7 @@
47u32 num_var_ranges = 0; 48u32 num_var_ranges = 0;
48 49
49unsigned int *usage_table; 50unsigned int *usage_table;
50static DECLARE_MUTEX(mtrr_sem); 51static DEFINE_MUTEX(mtrr_mutex);
51 52
52u32 size_or_mask, size_and_mask; 53u32 size_or_mask, size_and_mask;
53 54
@@ -333,7 +334,7 @@ int mtrr_add_page(unsigned long base, unsigned long size,
333 /* No CPU hotplug when we change MTRR entries */ 334 /* No CPU hotplug when we change MTRR entries */
334 lock_cpu_hotplug(); 335 lock_cpu_hotplug();
335 /* Search for existing MTRR */ 336 /* Search for existing MTRR */
336 down(&mtrr_sem); 337 mutex_lock(&mtrr_mutex);
337 for (i = 0; i < num_var_ranges; ++i) { 338 for (i = 0; i < num_var_ranges; ++i) {
338 mtrr_if->get(i, &lbase, &lsize, &ltype); 339 mtrr_if->get(i, &lbase, &lsize, &ltype);
339 if (base >= lbase + lsize) 340 if (base >= lbase + lsize)
@@ -371,7 +372,7 @@ int mtrr_add_page(unsigned long base, unsigned long size,
371 printk(KERN_INFO "mtrr: no more MTRRs available\n"); 372 printk(KERN_INFO "mtrr: no more MTRRs available\n");
372 error = i; 373 error = i;
373 out: 374 out:
374 up(&mtrr_sem); 375 mutex_unlock(&mtrr_mutex);
375 unlock_cpu_hotplug(); 376 unlock_cpu_hotplug();
376 return error; 377 return error;
377} 378}
@@ -464,7 +465,7 @@ int mtrr_del_page(int reg, unsigned long base, unsigned long size)
464 max = num_var_ranges; 465 max = num_var_ranges;
465 /* No CPU hotplug when we change MTRR entries */ 466 /* No CPU hotplug when we change MTRR entries */
466 lock_cpu_hotplug(); 467 lock_cpu_hotplug();
467 down(&mtrr_sem); 468 mutex_lock(&mtrr_mutex);
468 if (reg < 0) { 469 if (reg < 0) {
469 /* Search for existing MTRR */ 470 /* Search for existing MTRR */
470 for (i = 0; i < max; ++i) { 471 for (i = 0; i < max; ++i) {
@@ -503,7 +504,7 @@ int mtrr_del_page(int reg, unsigned long base, unsigned long size)
503 set_mtrr(reg, 0, 0, 0); 504 set_mtrr(reg, 0, 0, 0);
504 error = reg; 505 error = reg;
505 out: 506 out:
506 up(&mtrr_sem); 507 mutex_unlock(&mtrr_mutex);
507 unlock_cpu_hotplug(); 508 unlock_cpu_hotplug();
508 return error; 509 return error;
509} 510}
@@ -685,7 +686,7 @@ void mtrr_ap_init(void)
685 if (!mtrr_if || !use_intel()) 686 if (!mtrr_if || !use_intel())
686 return; 687 return;
687 /* 688 /*
688 * Ideally we should hold mtrr_sem here to avoid mtrr entries changed, 689 * Ideally we should hold mtrr_mutex here to avoid mtrr entries changed,
689 * but this routine will be called in cpu boot time, holding the lock 690 * but this routine will be called in cpu boot time, holding the lock
690 * breaks it. This routine is called in two cases: 1.very earily time 691 * breaks it. This routine is called in two cases: 1.very earily time
691 * of software resume, when there absolutely isn't mtrr entry changes; 692 * of software resume, when there absolutely isn't mtrr entry changes;
diff --git a/arch/i386/kernel/cpu/proc.c b/arch/i386/kernel/cpu/proc.c
index 89a85af33d28..f94cdb7aca50 100644
--- a/arch/i386/kernel/cpu/proc.c
+++ b/arch/i386/kernel/cpu/proc.c
@@ -40,12 +40,12 @@ static int show_cpuinfo(struct seq_file *m, void *v)
40 /* Other (Linux-defined) */ 40 /* Other (Linux-defined) */
41 "cxmmx", "k6_mtrr", "cyrix_arr", "centaur_mcr", 41 "cxmmx", "k6_mtrr", "cyrix_arr", "centaur_mcr",
42 NULL, NULL, NULL, NULL, 42 NULL, NULL, NULL, NULL,
43 "constant_tsc", NULL, NULL, NULL, NULL, NULL, NULL, NULL, 43 "constant_tsc", "up", NULL, NULL, NULL, NULL, NULL, NULL,
44 NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 44 NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
45 NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 45 NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
46 46
47 /* Intel-defined (#2) */ 47 /* Intel-defined (#2) */
48 "pni", NULL, NULL, "monitor", "ds_cpl", "vmx", NULL, "est", 48 "pni", NULL, NULL, "monitor", "ds_cpl", "vmx", "smx", "est",
49 "tm2", NULL, "cid", NULL, NULL, "cx16", "xtpr", NULL, 49 "tm2", NULL, "cid", NULL, NULL, "cx16", "xtpr", NULL,
50 NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 50 NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
51 NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 51 NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
diff --git a/arch/i386/kernel/crash.c b/arch/i386/kernel/crash.c
index d49dbe8dc96b..e3c5fca0aa8a 100644
--- a/arch/i386/kernel/crash.c
+++ b/arch/i386/kernel/crash.c
@@ -105,7 +105,7 @@ static int crash_nmi_callback(struct pt_regs *regs, int cpu)
105 return 1; 105 return 1;
106 local_irq_disable(); 106 local_irq_disable();
107 107
108 if (!user_mode(regs)) { 108 if (!user_mode_vm(regs)) {
109 crash_fixup_ss_esp(&fixed_regs, regs); 109 crash_fixup_ss_esp(&fixed_regs, regs);
110 regs = &fixed_regs; 110 regs = &fixed_regs;
111 } 111 }
diff --git a/arch/i386/kernel/dmi_scan.c b/arch/i386/kernel/dmi_scan.c
index 6a93d75db431..5efceebc48dc 100644
--- a/arch/i386/kernel/dmi_scan.c
+++ b/arch/i386/kernel/dmi_scan.c
@@ -3,8 +3,10 @@
3#include <linux/init.h> 3#include <linux/init.h>
4#include <linux/module.h> 4#include <linux/module.h>
5#include <linux/dmi.h> 5#include <linux/dmi.h>
6#include <linux/efi.h>
6#include <linux/bootmem.h> 7#include <linux/bootmem.h>
7#include <linux/slab.h> 8#include <linux/slab.h>
9#include <asm/dmi.h>
8 10
9static char * __init dmi_string(struct dmi_header *dm, u8 s) 11static char * __init dmi_string(struct dmi_header *dm, u8 s)
10{ 12{
@@ -106,7 +108,7 @@ static void __init dmi_save_devices(struct dmi_header *dm)
106 struct dmi_device *dev; 108 struct dmi_device *dev;
107 109
108 for (i = 0; i < count; i++) { 110 for (i = 0; i < count; i++) {
109 char *d = ((char *) dm) + (i * 2); 111 char *d = (char *)(dm + 1) + (i * 2);
110 112
111 /* Skip disabled device */ 113 /* Skip disabled device */
112 if ((*d & 0x80) == 0) 114 if ((*d & 0x80) == 0)
@@ -184,47 +186,72 @@ static void __init dmi_decode(struct dmi_header *dm)
184 } 186 }
185} 187}
186 188
187void __init dmi_scan_machine(void) 189static int __init dmi_present(char __iomem *p)
188{ 190{
189 u8 buf[15]; 191 u8 buf[15];
190 char __iomem *p, *q; 192 memcpy_fromio(buf, p, 15);
193 if ((memcmp(buf, "_DMI_", 5) == 0) && dmi_checksum(buf)) {
194 u16 num = (buf[13] << 8) | buf[12];
195 u16 len = (buf[7] << 8) | buf[6];
196 u32 base = (buf[11] << 24) | (buf[10] << 16) |
197 (buf[9] << 8) | buf[8];
191 198
192 /* 199 /*
193 * no iounmap() for that ioremap(); it would be a no-op, but it's 200 * DMI version 0.0 means that the real version is taken from
194 * so early in setup that sucker gets confused into doing what 201 * the SMBIOS version, which we don't know at this point.
195 * it shouldn't if we actually call it. 202 */
196 */ 203 if (buf[14] != 0)
197 p = ioremap(0xF0000, 0x10000); 204 printk(KERN_INFO "DMI %d.%d present.\n",
198 if (p == NULL) 205 buf[14] >> 4, buf[14] & 0xF);
199 goto out; 206 else
200 207 printk(KERN_INFO "DMI present.\n");
201 for (q = p; q < p + 0x10000; q += 16) { 208 if (dmi_table(base,len, num, dmi_decode) == 0)
202 memcpy_fromio(buf, q, 15); 209 return 0;
203 if ((memcmp(buf, "_DMI_", 5) == 0) && dmi_checksum(buf)) { 210 }
204 u16 num = (buf[13] << 8) | buf[12]; 211 return 1;
205 u16 len = (buf[7] << 8) | buf[6]; 212}
206 u32 base = (buf[11] << 24) | (buf[10] << 16) | 213
207 (buf[9] << 8) | buf[8]; 214void __init dmi_scan_machine(void)
208 215{
209 /* 216 char __iomem *p, *q;
210 * DMI version 0.0 means that the real version is taken from 217 int rc;
211 * the SMBIOS version, which we don't know at this point. 218
212 */ 219 if (efi_enabled) {
213 if (buf[14] != 0) 220 if (efi.smbios == EFI_INVALID_TABLE_ADDR)
214 printk(KERN_INFO "DMI %d.%d present.\n", 221 goto out;
215 buf[14] >> 4, buf[14] & 0xF); 222
216 else 223 /* This is called as a core_initcall() because it isn't
217 printk(KERN_INFO "DMI present.\n"); 224 * needed during early boot. This also means we can
225 * iounmap the space when we're done with it.
226 */
227 p = dmi_ioremap(efi.smbios, 32);
228 if (p == NULL)
229 goto out;
230
231 rc = dmi_present(p + 0x10); /* offset of _DMI_ string */
232 dmi_iounmap(p, 32);
233 if (!rc)
234 return;
235 }
236 else {
237 /*
238 * no iounmap() for that ioremap(); it would be a no-op, but
239 * it's so early in setup that sucker gets confused into doing
240 * what it shouldn't if we actually call it.
241 */
242 p = dmi_ioremap(0xF0000, 0x10000);
243 if (p == NULL)
244 goto out;
218 245
219 if (dmi_table(base,len, num, dmi_decode) == 0) 246 for (q = p; q < p + 0x10000; q += 16) {
247 rc = dmi_present(q);
248 if (!rc)
220 return; 249 return;
221 } 250 }
222 } 251 }
223 252 out: printk(KERN_INFO "DMI not present or invalid.\n");
224out: printk(KERN_INFO "DMI not present or invalid.\n");
225} 253}
226 254
227
228/** 255/**
229 * dmi_check_system - check system DMI data 256 * dmi_check_system - check system DMI data
230 * @list: array of dmi_system_id structures to match against 257 * @list: array of dmi_system_id structures to match against
@@ -299,3 +326,33 @@ struct dmi_device * dmi_find_device(int type, const char *name,
299 return NULL; 326 return NULL;
300} 327}
301EXPORT_SYMBOL(dmi_find_device); 328EXPORT_SYMBOL(dmi_find_device);
329
330/**
331 * dmi_get_year - Return year of a DMI date
332 * @field: data index (like dmi_get_system_info)
333 *
334 * Returns -1 when the field doesn't exist. 0 when it is broken.
335 */
336int dmi_get_year(int field)
337{
338 int year;
339 char *s = dmi_get_system_info(field);
340
341 if (!s)
342 return -1;
343 if (*s == '\0')
344 return 0;
345 s = strrchr(s, '/');
346 if (!s)
347 return 0;
348
349 s += 1;
350 year = simple_strtoul(s, NULL, 0);
351 if (year && year < 100) { /* 2-digit year */
352 year += 1900;
353 if (year < 1996) /* no dates < spec 1.0 */
354 year += 100;
355 }
356
357 return year;
358}
diff --git a/arch/i386/kernel/efi.c b/arch/i386/kernel/efi.c
index c9cad7ba0d2d..9202b67c4b2e 100644
--- a/arch/i386/kernel/efi.c
+++ b/arch/i386/kernel/efi.c
@@ -115,7 +115,7 @@ static void efi_call_phys_epilog(void)
115 unsigned long cr4; 115 unsigned long cr4;
116 struct Xgt_desc_struct *cpu_gdt_descr = &per_cpu(cpu_gdt_descr, 0); 116 struct Xgt_desc_struct *cpu_gdt_descr = &per_cpu(cpu_gdt_descr, 0);
117 117
118 cpu_gdt_descr->address = __va(cpu_gdt_descr->address); 118 cpu_gdt_descr->address = (unsigned long)__va(cpu_gdt_descr->address);
119 load_gdt(cpu_gdt_descr); 119 load_gdt(cpu_gdt_descr);
120 120
121 cr4 = read_cr4(); 121 cr4 = read_cr4();
@@ -361,7 +361,7 @@ void __init efi_init(void)
361 */ 361 */
362 c16 = (efi_char16_t *) boot_ioremap(efi.systab->fw_vendor, 2); 362 c16 = (efi_char16_t *) boot_ioremap(efi.systab->fw_vendor, 2);
363 if (c16) { 363 if (c16) {
364 for (i = 0; i < sizeof(vendor) && *c16; ++i) 364 for (i = 0; i < (sizeof(vendor) - 1) && *c16; ++i)
365 vendor[i] = *c16++; 365 vendor[i] = *c16++;
366 vendor[i] = '\0'; 366 vendor[i] = '\0';
367 } else 367 } else
@@ -381,29 +381,38 @@ void __init efi_init(void)
381 if (config_tables == NULL) 381 if (config_tables == NULL)
382 printk(KERN_ERR PFX "Could not map EFI Configuration Table!\n"); 382 printk(KERN_ERR PFX "Could not map EFI Configuration Table!\n");
383 383
384 efi.mps = EFI_INVALID_TABLE_ADDR;
385 efi.acpi = EFI_INVALID_TABLE_ADDR;
386 efi.acpi20 = EFI_INVALID_TABLE_ADDR;
387 efi.smbios = EFI_INVALID_TABLE_ADDR;
388 efi.sal_systab = EFI_INVALID_TABLE_ADDR;
389 efi.boot_info = EFI_INVALID_TABLE_ADDR;
390 efi.hcdp = EFI_INVALID_TABLE_ADDR;
391 efi.uga = EFI_INVALID_TABLE_ADDR;
392
384 for (i = 0; i < num_config_tables; i++) { 393 for (i = 0; i < num_config_tables; i++) {
385 if (efi_guidcmp(config_tables[i].guid, MPS_TABLE_GUID) == 0) { 394 if (efi_guidcmp(config_tables[i].guid, MPS_TABLE_GUID) == 0) {
386 efi.mps = (void *)config_tables[i].table; 395 efi.mps = config_tables[i].table;
387 printk(KERN_INFO " MPS=0x%lx ", config_tables[i].table); 396 printk(KERN_INFO " MPS=0x%lx ", config_tables[i].table);
388 } else 397 } else
389 if (efi_guidcmp(config_tables[i].guid, ACPI_20_TABLE_GUID) == 0) { 398 if (efi_guidcmp(config_tables[i].guid, ACPI_20_TABLE_GUID) == 0) {
390 efi.acpi20 = __va(config_tables[i].table); 399 efi.acpi20 = config_tables[i].table;
391 printk(KERN_INFO " ACPI 2.0=0x%lx ", config_tables[i].table); 400 printk(KERN_INFO " ACPI 2.0=0x%lx ", config_tables[i].table);
392 } else 401 } else
393 if (efi_guidcmp(config_tables[i].guid, ACPI_TABLE_GUID) == 0) { 402 if (efi_guidcmp(config_tables[i].guid, ACPI_TABLE_GUID) == 0) {
394 efi.acpi = __va(config_tables[i].table); 403 efi.acpi = config_tables[i].table;
395 printk(KERN_INFO " ACPI=0x%lx ", config_tables[i].table); 404 printk(KERN_INFO " ACPI=0x%lx ", config_tables[i].table);
396 } else 405 } else
397 if (efi_guidcmp(config_tables[i].guid, SMBIOS_TABLE_GUID) == 0) { 406 if (efi_guidcmp(config_tables[i].guid, SMBIOS_TABLE_GUID) == 0) {
398 efi.smbios = (void *) config_tables[i].table; 407 efi.smbios = config_tables[i].table;
399 printk(KERN_INFO " SMBIOS=0x%lx ", config_tables[i].table); 408 printk(KERN_INFO " SMBIOS=0x%lx ", config_tables[i].table);
400 } else 409 } else
401 if (efi_guidcmp(config_tables[i].guid, HCDP_TABLE_GUID) == 0) { 410 if (efi_guidcmp(config_tables[i].guid, HCDP_TABLE_GUID) == 0) {
402 efi.hcdp = (void *)config_tables[i].table; 411 efi.hcdp = config_tables[i].table;
403 printk(KERN_INFO " HCDP=0x%lx ", config_tables[i].table); 412 printk(KERN_INFO " HCDP=0x%lx ", config_tables[i].table);
404 } else 413 } else
405 if (efi_guidcmp(config_tables[i].guid, UGA_IO_PROTOCOL_GUID) == 0) { 414 if (efi_guidcmp(config_tables[i].guid, UGA_IO_PROTOCOL_GUID) == 0) {
406 efi.uga = (void *)config_tables[i].table; 415 efi.uga = config_tables[i].table;
407 printk(KERN_INFO " UGA=0x%lx ", config_tables[i].table); 416 printk(KERN_INFO " UGA=0x%lx ", config_tables[i].table);
408 } 417 }
409 } 418 }
@@ -543,7 +552,7 @@ efi_initialize_iomem_resources(struct resource *code_resource,
543 if ((md->phys_addr + (md->num_pages << EFI_PAGE_SHIFT)) > 552 if ((md->phys_addr + (md->num_pages << EFI_PAGE_SHIFT)) >
544 0x100000000ULL) 553 0x100000000ULL)
545 continue; 554 continue;
546 res = alloc_bootmem_low(sizeof(struct resource)); 555 res = kzalloc(sizeof(struct resource), GFP_ATOMIC);
547 switch (md->type) { 556 switch (md->type) {
548 case EFI_RESERVED_TYPE: 557 case EFI_RESERVED_TYPE:
549 res->name = "Reserved Memory"; 558 res->name = "Reserved Memory";
diff --git a/arch/i386/kernel/entry.S b/arch/i386/kernel/entry.S
index 4d704724b2f5..cfc683f153b9 100644
--- a/arch/i386/kernel/entry.S
+++ b/arch/i386/kernel/entry.S
@@ -226,6 +226,10 @@ ENTRY(system_call)
226 pushl %eax # save orig_eax 226 pushl %eax # save orig_eax
227 SAVE_ALL 227 SAVE_ALL
228 GET_THREAD_INFO(%ebp) 228 GET_THREAD_INFO(%ebp)
229 testl $TF_MASK,EFLAGS(%esp)
230 jz no_singlestep
231 orl $_TIF_SINGLESTEP,TI_flags(%ebp)
232no_singlestep:
229 # system call tracing in operation / emulation 233 # system call tracing in operation / emulation
230 /* Note, _TIF_SECCOMP is bit number 8, and so it needs testw and not testb */ 234 /* Note, _TIF_SECCOMP is bit number 8, and so it needs testw and not testb */
231 testw $(_TIF_SYSCALL_EMU|_TIF_SYSCALL_TRACE|_TIF_SECCOMP|_TIF_SYSCALL_AUDIT),TI_flags(%ebp) 235 testw $(_TIF_SYSCALL_EMU|_TIF_SYSCALL_TRACE|_TIF_SECCOMP|_TIF_SYSCALL_AUDIT),TI_flags(%ebp)
diff --git a/arch/i386/kernel/head.S b/arch/i386/kernel/head.S
index e0b7c632efbc..3debc2e26542 100644
--- a/arch/i386/kernel/head.S
+++ b/arch/i386/kernel/head.S
@@ -450,7 +450,6 @@ int_msg:
450 450
451.globl boot_gdt_descr 451.globl boot_gdt_descr
452.globl idt_descr 452.globl idt_descr
453.globl cpu_gdt_descr
454 453
455 ALIGN 454 ALIGN
456# early boot GDT descriptor (must use 1:1 address mapping) 455# early boot GDT descriptor (must use 1:1 address mapping)
@@ -470,8 +469,6 @@ cpu_gdt_descr:
470 .word GDT_ENTRIES*8-1 469 .word GDT_ENTRIES*8-1
471 .long cpu_gdt_table 470 .long cpu_gdt_table
472 471
473 .fill NR_CPUS-1,8,0 # space for the other GDT descriptors
474
475/* 472/*
476 * The boot_gdt_table must mirror the equivalent in setup.S and is 473 * The boot_gdt_table must mirror the equivalent in setup.S and is
477 * used only for booting. 474 * used only for booting.
@@ -485,7 +482,7 @@ ENTRY(boot_gdt_table)
485/* 482/*
486 * The Global Descriptor Table contains 28 quadwords, per-CPU. 483 * The Global Descriptor Table contains 28 quadwords, per-CPU.
487 */ 484 */
488 .align PAGE_SIZE_asm 485 .align L1_CACHE_BYTES
489ENTRY(cpu_gdt_table) 486ENTRY(cpu_gdt_table)
490 .quad 0x0000000000000000 /* NULL descriptor */ 487 .quad 0x0000000000000000 /* NULL descriptor */
491 .quad 0x0000000000000000 /* 0x0b reserved */ 488 .quad 0x0000000000000000 /* 0x0b reserved */
diff --git a/arch/i386/kernel/io_apic.c b/arch/i386/kernel/io_apic.c
index 39d9a5fa907e..f8f132aa5472 100644
--- a/arch/i386/kernel/io_apic.c
+++ b/arch/i386/kernel/io_apic.c
@@ -351,8 +351,8 @@ static inline void rotate_irqs_among_cpus(unsigned long useful_load_threshold)
351{ 351{
352 int i, j; 352 int i, j;
353 Dprintk("Rotating IRQs among CPUs.\n"); 353 Dprintk("Rotating IRQs among CPUs.\n");
354 for (i = 0; i < NR_CPUS; i++) { 354 for_each_online_cpu(i) {
355 for (j = 0; cpu_online(i) && (j < NR_IRQS); j++) { 355 for (j = 0; j < NR_IRQS; j++) {
356 if (!irq_desc[j].action) 356 if (!irq_desc[j].action)
357 continue; 357 continue;
358 /* Is it a significant load ? */ 358 /* Is it a significant load ? */
@@ -381,7 +381,7 @@ static void do_irq_balance(void)
381 unsigned long imbalance = 0; 381 unsigned long imbalance = 0;
382 cpumask_t allowed_mask, target_cpu_mask, tmp; 382 cpumask_t allowed_mask, target_cpu_mask, tmp;
383 383
384 for (i = 0; i < NR_CPUS; i++) { 384 for_each_possible_cpu(i) {
385 int package_index; 385 int package_index;
386 CPU_IRQ(i) = 0; 386 CPU_IRQ(i) = 0;
387 if (!cpu_online(i)) 387 if (!cpu_online(i))
@@ -422,9 +422,7 @@ static void do_irq_balance(void)
422 } 422 }
423 } 423 }
424 /* Find the least loaded processor package */ 424 /* Find the least loaded processor package */
425 for (i = 0; i < NR_CPUS; i++) { 425 for_each_online_cpu(i) {
426 if (!cpu_online(i))
427 continue;
428 if (i != CPU_TO_PACKAGEINDEX(i)) 426 if (i != CPU_TO_PACKAGEINDEX(i))
429 continue; 427 continue;
430 if (min_cpu_irq > CPU_IRQ(i)) { 428 if (min_cpu_irq > CPU_IRQ(i)) {
@@ -441,9 +439,7 @@ tryanothercpu:
441 */ 439 */
442 tmp_cpu_irq = 0; 440 tmp_cpu_irq = 0;
443 tmp_loaded = -1; 441 tmp_loaded = -1;
444 for (i = 0; i < NR_CPUS; i++) { 442 for_each_online_cpu(i) {
445 if (!cpu_online(i))
446 continue;
447 if (i != CPU_TO_PACKAGEINDEX(i)) 443 if (i != CPU_TO_PACKAGEINDEX(i))
448 continue; 444 continue;
449 if (max_cpu_irq <= CPU_IRQ(i)) 445 if (max_cpu_irq <= CPU_IRQ(i))
@@ -619,9 +615,7 @@ static int __init balanced_irq_init(void)
619 if (smp_num_siblings > 1 && !cpus_empty(tmp)) 615 if (smp_num_siblings > 1 && !cpus_empty(tmp))
620 physical_balance = 1; 616 physical_balance = 1;
621 617
622 for (i = 0; i < NR_CPUS; i++) { 618 for_each_online_cpu(i) {
623 if (!cpu_online(i))
624 continue;
625 irq_cpu_data[i].irq_delta = kmalloc(sizeof(unsigned long) * NR_IRQS, GFP_KERNEL); 619 irq_cpu_data[i].irq_delta = kmalloc(sizeof(unsigned long) * NR_IRQS, GFP_KERNEL);
626 irq_cpu_data[i].last_irq = kmalloc(sizeof(unsigned long) * NR_IRQS, GFP_KERNEL); 620 irq_cpu_data[i].last_irq = kmalloc(sizeof(unsigned long) * NR_IRQS, GFP_KERNEL);
627 if (irq_cpu_data[i].irq_delta == NULL || irq_cpu_data[i].last_irq == NULL) { 621 if (irq_cpu_data[i].irq_delta == NULL || irq_cpu_data[i].last_irq == NULL) {
@@ -638,9 +632,11 @@ static int __init balanced_irq_init(void)
638 else 632 else
639 printk(KERN_ERR "balanced_irq_init: failed to spawn balanced_irq"); 633 printk(KERN_ERR "balanced_irq_init: failed to spawn balanced_irq");
640failed: 634failed:
641 for (i = 0; i < NR_CPUS; i++) { 635 for_each_possible_cpu(i) {
642 kfree(irq_cpu_data[i].irq_delta); 636 kfree(irq_cpu_data[i].irq_delta);
637 irq_cpu_data[i].irq_delta = NULL;
643 kfree(irq_cpu_data[i].last_irq); 638 kfree(irq_cpu_data[i].last_irq);
639 irq_cpu_data[i].last_irq = NULL;
644 } 640 }
645 return 0; 641 return 0;
646} 642}
@@ -648,7 +644,7 @@ failed:
648int __init irqbalance_disable(char *str) 644int __init irqbalance_disable(char *str)
649{ 645{
650 irqbalance_disabled = 1; 646 irqbalance_disabled = 1;
651 return 0; 647 return 1;
652} 648}
653 649
654__setup("noirqbalance", irqbalance_disable); 650__setup("noirqbalance", irqbalance_disable);
@@ -1761,7 +1757,8 @@ static void __init setup_ioapic_ids_from_mpc(void)
1761 * Don't check I/O APIC IDs for xAPIC systems. They have 1757 * Don't check I/O APIC IDs for xAPIC systems. They have
1762 * no meaning without the serial APIC bus. 1758 * no meaning without the serial APIC bus.
1763 */ 1759 */
1764 if (!(boot_cpu_data.x86_vendor == X86_VENDOR_INTEL && boot_cpu_data.x86 < 15)) 1760 if (!(boot_cpu_data.x86_vendor == X86_VENDOR_INTEL)
1761 || APIC_XAPIC(apic_version[boot_cpu_physical_apicid]))
1765 return; 1762 return;
1766 /* 1763 /*
1767 * This is broken; anything with a real cpu count has to 1764 * This is broken; anything with a real cpu count has to
diff --git a/arch/i386/kernel/kprobes.c b/arch/i386/kernel/kprobes.c
index 694a13997637..f19768789e8a 100644
--- a/arch/i386/kernel/kprobes.c
+++ b/arch/i386/kernel/kprobes.c
@@ -35,12 +35,56 @@
35#include <asm/cacheflush.h> 35#include <asm/cacheflush.h>
36#include <asm/kdebug.h> 36#include <asm/kdebug.h>
37#include <asm/desc.h> 37#include <asm/desc.h>
38#include <asm/uaccess.h>
38 39
39void jprobe_return_end(void); 40void jprobe_return_end(void);
40 41
41DEFINE_PER_CPU(struct kprobe *, current_kprobe) = NULL; 42DEFINE_PER_CPU(struct kprobe *, current_kprobe) = NULL;
42DEFINE_PER_CPU(struct kprobe_ctlblk, kprobe_ctlblk); 43DEFINE_PER_CPU(struct kprobe_ctlblk, kprobe_ctlblk);
43 44
45/* insert a jmp code */
46static inline void set_jmp_op(void *from, void *to)
47{
48 struct __arch_jmp_op {
49 char op;
50 long raddr;
51 } __attribute__((packed)) *jop;
52 jop = (struct __arch_jmp_op *)from;
53 jop->raddr = (long)(to) - ((long)(from) + 5);
54 jop->op = RELATIVEJUMP_INSTRUCTION;
55}
56
57/*
58 * returns non-zero if opcodes can be boosted.
59 */
60static inline int can_boost(kprobe_opcode_t opcode)
61{
62 switch (opcode & 0xf0 ) {
63 case 0x70:
64 return 0; /* can't boost conditional jump */
65 case 0x90:
66 /* can't boost call and pushf */
67 return opcode != 0x9a && opcode != 0x9c;
68 case 0xc0:
69 /* can't boost undefined opcodes and soft-interruptions */
70 return (0xc1 < opcode && opcode < 0xc6) ||
71 (0xc7 < opcode && opcode < 0xcc) || opcode == 0xcf;
72 case 0xd0:
73 /* can boost AA* and XLAT */
74 return (opcode == 0xd4 || opcode == 0xd5 || opcode == 0xd7);
75 case 0xe0:
76 /* can boost in/out and (may be) jmps */
77 return (0xe3 < opcode && opcode != 0xe8);
78 case 0xf0:
79 /* clear and set flags can be boost */
80 return (opcode == 0xf5 || (0xf7 < opcode && opcode < 0xfe));
81 default:
82 /* currently, can't boost 2 bytes opcodes */
83 return opcode != 0x0f;
84 }
85}
86
87
44/* 88/*
45 * returns non-zero if opcode modifies the interrupt flag. 89 * returns non-zero if opcode modifies the interrupt flag.
46 */ 90 */
@@ -65,6 +109,11 @@ int __kprobes arch_prepare_kprobe(struct kprobe *p)
65 109
66 memcpy(p->ainsn.insn, p->addr, MAX_INSN_SIZE * sizeof(kprobe_opcode_t)); 110 memcpy(p->ainsn.insn, p->addr, MAX_INSN_SIZE * sizeof(kprobe_opcode_t));
67 p->opcode = *p->addr; 111 p->opcode = *p->addr;
112 if (can_boost(p->opcode)) {
113 p->ainsn.boostable = 0;
114 } else {
115 p->ainsn.boostable = -1;
116 }
68 return 0; 117 return 0;
69} 118}
70 119
@@ -84,9 +133,9 @@ void __kprobes arch_disarm_kprobe(struct kprobe *p)
84 133
85void __kprobes arch_remove_kprobe(struct kprobe *p) 134void __kprobes arch_remove_kprobe(struct kprobe *p)
86{ 135{
87 down(&kprobe_mutex); 136 mutex_lock(&kprobe_mutex);
88 free_insn_slot(p->ainsn.insn); 137 free_insn_slot(p->ainsn.insn);
89 up(&kprobe_mutex); 138 mutex_unlock(&kprobe_mutex);
90} 139}
91 140
92static inline void save_previous_kprobe(struct kprobe_ctlblk *kcb) 141static inline void save_previous_kprobe(struct kprobe_ctlblk *kcb)
@@ -155,9 +204,13 @@ static int __kprobes kprobe_handler(struct pt_regs *regs)
155{ 204{
156 struct kprobe *p; 205 struct kprobe *p;
157 int ret = 0; 206 int ret = 0;
158 kprobe_opcode_t *addr = NULL; 207 kprobe_opcode_t *addr;
159 unsigned long *lp;
160 struct kprobe_ctlblk *kcb; 208 struct kprobe_ctlblk *kcb;
209#ifdef CONFIG_PREEMPT
210 unsigned pre_preempt_count = preempt_count();
211#endif /* CONFIG_PREEMPT */
212
213 addr = (kprobe_opcode_t *)(regs->eip - sizeof(kprobe_opcode_t));
161 214
162 /* 215 /*
163 * We don't want to be preempted for the entire 216 * We don't want to be preempted for the entire
@@ -166,17 +219,6 @@ static int __kprobes kprobe_handler(struct pt_regs *regs)
166 preempt_disable(); 219 preempt_disable();
167 kcb = get_kprobe_ctlblk(); 220 kcb = get_kprobe_ctlblk();
168 221
169 /* Check if the application is using LDT entry for its code segment and
170 * calculate the address by reading the base address from the LDT entry.
171 */
172 if ((regs->xcs & 4) && (current->mm)) {
173 lp = (unsigned long *) ((unsigned long)((regs->xcs >> 3) * 8)
174 + (char *) current->mm->context.ldt);
175 addr = (kprobe_opcode_t *) (get_desc_base(lp) + regs->eip -
176 sizeof(kprobe_opcode_t));
177 } else {
178 addr = (kprobe_opcode_t *)(regs->eip - sizeof(kprobe_opcode_t));
179 }
180 /* Check we're not actually recursing */ 222 /* Check we're not actually recursing */
181 if (kprobe_running()) { 223 if (kprobe_running()) {
182 p = get_kprobe(addr); 224 p = get_kprobe(addr);
@@ -252,6 +294,21 @@ static int __kprobes kprobe_handler(struct pt_regs *regs)
252 /* handler has already set things up, so skip ss setup */ 294 /* handler has already set things up, so skip ss setup */
253 return 1; 295 return 1;
254 296
297 if (p->ainsn.boostable == 1 &&
298#ifdef CONFIG_PREEMPT
299 !(pre_preempt_count) && /*
300 * This enables booster when the direct
301 * execution path aren't preempted.
302 */
303#endif /* CONFIG_PREEMPT */
304 !p->post_handler && !p->break_handler ) {
305 /* Boost up -- we can execute copied instructions directly */
306 reset_current_kprobe();
307 regs->eip = (unsigned long)p->ainsn.insn;
308 preempt_enable_no_resched();
309 return 1;
310 }
311
255ss_probe: 312ss_probe:
256 prepare_singlestep(p, regs); 313 prepare_singlestep(p, regs);
257 kcb->kprobe_status = KPROBE_HIT_SS; 314 kcb->kprobe_status = KPROBE_HIT_SS;
@@ -267,17 +324,44 @@ no_kprobe:
267 * here. When a retprobed function returns, this probe is hit and 324 * here. When a retprobed function returns, this probe is hit and
268 * trampoline_probe_handler() runs, calling the kretprobe's handler. 325 * trampoline_probe_handler() runs, calling the kretprobe's handler.
269 */ 326 */
270 void kretprobe_trampoline_holder(void) 327 void __kprobes kretprobe_trampoline_holder(void)
271 { 328 {
272 asm volatile ( ".global kretprobe_trampoline\n" 329 asm volatile ( ".global kretprobe_trampoline\n"
273 "kretprobe_trampoline: \n" 330 "kretprobe_trampoline: \n"
274 "nop\n"); 331 " pushf\n"
275 } 332 /* skip cs, eip, orig_eax, es, ds */
333 " subl $20, %esp\n"
334 " pushl %eax\n"
335 " pushl %ebp\n"
336 " pushl %edi\n"
337 " pushl %esi\n"
338 " pushl %edx\n"
339 " pushl %ecx\n"
340 " pushl %ebx\n"
341 " movl %esp, %eax\n"
342 " call trampoline_handler\n"
343 /* move eflags to cs */
344 " movl 48(%esp), %edx\n"
345 " movl %edx, 44(%esp)\n"
346 /* save true return address on eflags */
347 " movl %eax, 48(%esp)\n"
348 " popl %ebx\n"
349 " popl %ecx\n"
350 " popl %edx\n"
351 " popl %esi\n"
352 " popl %edi\n"
353 " popl %ebp\n"
354 " popl %eax\n"
355 /* skip eip, orig_eax, es, ds */
356 " addl $16, %esp\n"
357 " popf\n"
358 " ret\n");
359}
276 360
277/* 361/*
278 * Called when we hit the probe point at kretprobe_trampoline 362 * Called from kretprobe_trampoline
279 */ 363 */
280int __kprobes trampoline_probe_handler(struct kprobe *p, struct pt_regs *regs) 364fastcall void *__kprobes trampoline_handler(struct pt_regs *regs)
281{ 365{
282 struct kretprobe_instance *ri = NULL; 366 struct kretprobe_instance *ri = NULL;
283 struct hlist_head *head; 367 struct hlist_head *head;
@@ -306,8 +390,11 @@ int __kprobes trampoline_probe_handler(struct kprobe *p, struct pt_regs *regs)
306 /* another task is sharing our hash bucket */ 390 /* another task is sharing our hash bucket */
307 continue; 391 continue;
308 392
309 if (ri->rp && ri->rp->handler) 393 if (ri->rp && ri->rp->handler){
394 __get_cpu_var(current_kprobe) = &ri->rp->kp;
310 ri->rp->handler(ri, regs); 395 ri->rp->handler(ri, regs);
396 __get_cpu_var(current_kprobe) = NULL;
397 }
311 398
312 orig_ret_address = (unsigned long)ri->ret_addr; 399 orig_ret_address = (unsigned long)ri->ret_addr;
313 recycle_rp_inst(ri); 400 recycle_rp_inst(ri);
@@ -322,18 +409,10 @@ int __kprobes trampoline_probe_handler(struct kprobe *p, struct pt_regs *regs)
322 } 409 }
323 410
324 BUG_ON(!orig_ret_address || (orig_ret_address == trampoline_address)); 411 BUG_ON(!orig_ret_address || (orig_ret_address == trampoline_address));
325 regs->eip = orig_ret_address;
326 412
327 reset_current_kprobe();
328 spin_unlock_irqrestore(&kretprobe_lock, flags); 413 spin_unlock_irqrestore(&kretprobe_lock, flags);
329 preempt_enable_no_resched();
330 414
331 /* 415 return (void*)orig_ret_address;
332 * By returning a non-zero value, we are telling
333 * kprobe_handler() that we don't want the post_handler
334 * to run (and have re-enabled preemption)
335 */
336 return 1;
337} 416}
338 417
339/* 418/*
@@ -357,15 +436,17 @@ int __kprobes trampoline_probe_handler(struct kprobe *p, struct pt_regs *regs)
357 * 2) If the single-stepped instruction was a call, the return address 436 * 2) If the single-stepped instruction was a call, the return address
358 * that is atop the stack is the address following the copied instruction. 437 * that is atop the stack is the address following the copied instruction.
359 * We need to make it the address following the original instruction. 438 * We need to make it the address following the original instruction.
439 *
440 * This function also checks instruction size for preparing direct execution.
360 */ 441 */
361static void __kprobes resume_execution(struct kprobe *p, 442static void __kprobes resume_execution(struct kprobe *p,
362 struct pt_regs *regs, struct kprobe_ctlblk *kcb) 443 struct pt_regs *regs, struct kprobe_ctlblk *kcb)
363{ 444{
364 unsigned long *tos = (unsigned long *)&regs->esp; 445 unsigned long *tos = (unsigned long *)&regs->esp;
365 unsigned long next_eip = 0;
366 unsigned long copy_eip = (unsigned long)p->ainsn.insn; 446 unsigned long copy_eip = (unsigned long)p->ainsn.insn;
367 unsigned long orig_eip = (unsigned long)p->addr; 447 unsigned long orig_eip = (unsigned long)p->addr;
368 448
449 regs->eflags &= ~TF_MASK;
369 switch (p->ainsn.insn[0]) { 450 switch (p->ainsn.insn[0]) {
370 case 0x9c: /* pushfl */ 451 case 0x9c: /* pushfl */
371 *tos &= ~(TF_MASK | IF_MASK); 452 *tos &= ~(TF_MASK | IF_MASK);
@@ -375,37 +456,51 @@ static void __kprobes resume_execution(struct kprobe *p,
375 case 0xcb: 456 case 0xcb:
376 case 0xc2: 457 case 0xc2:
377 case 0xca: 458 case 0xca:
378 regs->eflags &= ~TF_MASK; 459 case 0xea: /* jmp absolute -- eip is correct */
379 /* eip is already adjusted, no more changes required*/ 460 /* eip is already adjusted, no more changes required */
380 return; 461 p->ainsn.boostable = 1;
462 goto no_change;
381 case 0xe8: /* call relative - Fix return addr */ 463 case 0xe8: /* call relative - Fix return addr */
382 *tos = orig_eip + (*tos - copy_eip); 464 *tos = orig_eip + (*tos - copy_eip);
383 break; 465 break;
384 case 0xff: 466 case 0xff:
385 if ((p->ainsn.insn[1] & 0x30) == 0x10) { 467 if ((p->ainsn.insn[1] & 0x30) == 0x10) {
386 /* call absolute, indirect */ 468 /* call absolute, indirect */
387 /* Fix return addr; eip is correct. */ 469 /*
388 next_eip = regs->eip; 470 * Fix return addr; eip is correct.
471 * But this is not boostable
472 */
389 *tos = orig_eip + (*tos - copy_eip); 473 *tos = orig_eip + (*tos - copy_eip);
474 goto no_change;
390 } else if (((p->ainsn.insn[1] & 0x31) == 0x20) || /* jmp near, absolute indirect */ 475 } else if (((p->ainsn.insn[1] & 0x31) == 0x20) || /* jmp near, absolute indirect */
391 ((p->ainsn.insn[1] & 0x31) == 0x21)) { /* jmp far, absolute indirect */ 476 ((p->ainsn.insn[1] & 0x31) == 0x21)) { /* jmp far, absolute indirect */
392 /* eip is correct. */ 477 /* eip is correct. And this is boostable */
393 next_eip = regs->eip; 478 p->ainsn.boostable = 1;
479 goto no_change;
394 } 480 }
395 break;
396 case 0xea: /* jmp absolute -- eip is correct */
397 next_eip = regs->eip;
398 break;
399 default: 481 default:
400 break; 482 break;
401 } 483 }
402 484
403 regs->eflags &= ~TF_MASK; 485 if (p->ainsn.boostable == 0) {
404 if (next_eip) { 486 if ((regs->eip > copy_eip) &&
405 regs->eip = next_eip; 487 (regs->eip - copy_eip) + 5 < MAX_INSN_SIZE) {
406 } else { 488 /*
407 regs->eip = orig_eip + (regs->eip - copy_eip); 489 * These instructions can be executed directly if it
490 * jumps back to correct address.
491 */
492 set_jmp_op((void *)regs->eip,
493 (void *)orig_eip + (regs->eip - copy_eip));
494 p->ainsn.boostable = 1;
495 } else {
496 p->ainsn.boostable = -1;
497 }
408 } 498 }
499
500 regs->eip = orig_eip + (regs->eip - copy_eip);
501
502no_change:
503 return;
409} 504}
410 505
411/* 506/*
@@ -453,15 +548,57 @@ static inline int kprobe_fault_handler(struct pt_regs *regs, int trapnr)
453 struct kprobe *cur = kprobe_running(); 548 struct kprobe *cur = kprobe_running();
454 struct kprobe_ctlblk *kcb = get_kprobe_ctlblk(); 549 struct kprobe_ctlblk *kcb = get_kprobe_ctlblk();
455 550
456 if (cur->fault_handler && cur->fault_handler(cur, regs, trapnr)) 551 switch(kcb->kprobe_status) {
457 return 1; 552 case KPROBE_HIT_SS:
458 553 case KPROBE_REENTER:
459 if (kcb->kprobe_status & KPROBE_HIT_SS) { 554 /*
460 resume_execution(cur, regs, kcb); 555 * We are here because the instruction being single
556 * stepped caused a page fault. We reset the current
557 * kprobe and the eip points back to the probe address
558 * and allow the page fault handler to continue as a
559 * normal page fault.
560 */
561 regs->eip = (unsigned long)cur->addr;
461 regs->eflags |= kcb->kprobe_old_eflags; 562 regs->eflags |= kcb->kprobe_old_eflags;
462 563 if (kcb->kprobe_status == KPROBE_REENTER)
463 reset_current_kprobe(); 564 restore_previous_kprobe(kcb);
565 else
566 reset_current_kprobe();
464 preempt_enable_no_resched(); 567 preempt_enable_no_resched();
568 break;
569 case KPROBE_HIT_ACTIVE:
570 case KPROBE_HIT_SSDONE:
571 /*
572 * We increment the nmissed count for accounting,
573 * we can also use npre/npostfault count for accouting
574 * these specific fault cases.
575 */
576 kprobes_inc_nmissed_count(cur);
577
578 /*
579 * We come here because instructions in the pre/post
580 * handler caused the page_fault, this could happen
581 * if handler tries to access user space by
582 * copy_from_user(), get_user() etc. Let the
583 * user-specified handler try to fix it first.
584 */
585 if (cur->fault_handler && cur->fault_handler(cur, regs, trapnr))
586 return 1;
587
588 /*
589 * In case the user-specified fault handler returned
590 * zero, try to fix up.
591 */
592 if (fixup_exception(regs))
593 return 1;
594
595 /*
596 * fixup_exception() could not handle it,
597 * Let do_page_fault() fix it.
598 */
599 break;
600 default:
601 break;
465 } 602 }
466 return 0; 603 return 0;
467} 604}
@@ -475,6 +612,9 @@ int __kprobes kprobe_exceptions_notify(struct notifier_block *self,
475 struct die_args *args = (struct die_args *)data; 612 struct die_args *args = (struct die_args *)data;
476 int ret = NOTIFY_DONE; 613 int ret = NOTIFY_DONE;
477 614
615 if (args->regs && user_mode(args->regs))
616 return ret;
617
478 switch (val) { 618 switch (val) {
479 case DIE_INT3: 619 case DIE_INT3:
480 if (kprobe_handler(args->regs)) 620 if (kprobe_handler(args->regs))
@@ -564,12 +704,7 @@ int __kprobes longjmp_break_handler(struct kprobe *p, struct pt_regs *regs)
564 return 0; 704 return 0;
565} 705}
566 706
567static struct kprobe trampoline_p = {
568 .addr = (kprobe_opcode_t *) &kretprobe_trampoline,
569 .pre_handler = trampoline_probe_handler
570};
571
572int __init arch_init_kprobes(void) 707int __init arch_init_kprobes(void)
573{ 708{
574 return register_kprobe(&trampoline_p); 709 return 0;
575} 710}
diff --git a/arch/i386/kernel/microcode.c b/arch/i386/kernel/microcode.c
index 5390b521aca0..e7c138f66c5a 100644
--- a/arch/i386/kernel/microcode.c
+++ b/arch/i386/kernel/microcode.c
@@ -81,6 +81,7 @@
81#include <linux/miscdevice.h> 81#include <linux/miscdevice.h>
82#include <linux/spinlock.h> 82#include <linux/spinlock.h>
83#include <linux/mm.h> 83#include <linux/mm.h>
84#include <linux/mutex.h>
84 85
85#include <asm/msr.h> 86#include <asm/msr.h>
86#include <asm/uaccess.h> 87#include <asm/uaccess.h>
@@ -114,7 +115,7 @@ MODULE_LICENSE("GPL");
114static DEFINE_SPINLOCK(microcode_update_lock); 115static DEFINE_SPINLOCK(microcode_update_lock);
115 116
116/* no concurrent ->write()s are allowed on /dev/cpu/microcode */ 117/* no concurrent ->write()s are allowed on /dev/cpu/microcode */
117static DECLARE_MUTEX(microcode_sem); 118static DEFINE_MUTEX(microcode_mutex);
118 119
119static void __user *user_buffer; /* user area microcode data buffer */ 120static void __user *user_buffer; /* user area microcode data buffer */
120static unsigned int user_buffer_size; /* it's size */ 121static unsigned int user_buffer_size; /* it's size */
@@ -202,8 +203,6 @@ static inline void mark_microcode_update (int cpu_num, microcode_header_t *mc_he
202 } else if (mc_header->rev == uci->rev) { 203 } else if (mc_header->rev == uci->rev) {
203 /* notify the caller of success on this cpu */ 204 /* notify the caller of success on this cpu */
204 uci->err = MC_SUCCESS; 205 uci->err = MC_SUCCESS;
205 printk(KERN_ERR "microcode: CPU%d already at revision"
206 " 0x%x (current=0x%x)\n", cpu_num, mc_header->rev, uci->rev);
207 goto out; 206 goto out;
208 } 207 }
209 208
@@ -369,7 +368,6 @@ static void do_update_one (void * unused)
369 struct ucode_cpu_info *uci = ucode_cpu_info + cpu_num; 368 struct ucode_cpu_info *uci = ucode_cpu_info + cpu_num;
370 369
371 if (uci->mc == NULL) { 370 if (uci->mc == NULL) {
372 printk(KERN_INFO "microcode: No new microcode data for CPU%d\n", cpu_num);
373 return; 371 return;
374 } 372 }
375 373
@@ -447,7 +445,7 @@ static ssize_t microcode_write (struct file *file, const char __user *buf, size_
447 return -EINVAL; 445 return -EINVAL;
448 } 446 }
449 447
450 down(&microcode_sem); 448 mutex_lock(&microcode_mutex);
451 449
452 user_buffer = (void __user *) buf; 450 user_buffer = (void __user *) buf;
453 user_buffer_size = (int) len; 451 user_buffer_size = (int) len;
@@ -456,31 +454,14 @@ static ssize_t microcode_write (struct file *file, const char __user *buf, size_
456 if (!ret) 454 if (!ret)
457 ret = (ssize_t)len; 455 ret = (ssize_t)len;
458 456
459 up(&microcode_sem); 457 mutex_unlock(&microcode_mutex);
460 458
461 return ret; 459 return ret;
462} 460}
463 461
464static int microcode_ioctl (struct inode *inode, struct file *file,
465 unsigned int cmd, unsigned long arg)
466{
467 switch (cmd) {
468 /*
469 * XXX: will be removed after microcode_ctl
470 * is updated to ignore failure of this ioctl()
471 */
472 case MICROCODE_IOCFREE:
473 return 0;
474 default:
475 return -EINVAL;
476 }
477 return -EINVAL;
478}
479
480static struct file_operations microcode_fops = { 462static struct file_operations microcode_fops = {
481 .owner = THIS_MODULE, 463 .owner = THIS_MODULE,
482 .write = microcode_write, 464 .write = microcode_write,
483 .ioctl = microcode_ioctl,
484 .open = microcode_open, 465 .open = microcode_open,
485}; 466};
486 467
@@ -511,7 +492,6 @@ static int __init microcode_init (void)
511static void __exit microcode_exit (void) 492static void __exit microcode_exit (void)
512{ 493{
513 misc_deregister(&microcode_dev); 494 misc_deregister(&microcode_dev);
514 printk(KERN_INFO "IA-32 Microcode Update Driver v" MICROCODE_VERSION " unregistered\n");
515} 495}
516 496
517module_init(microcode_init) 497module_init(microcode_init)
diff --git a/arch/i386/kernel/module.c b/arch/i386/kernel/module.c
index 5149c8a621f0..470cf97e7cd3 100644
--- a/arch/i386/kernel/module.c
+++ b/arch/i386/kernel/module.c
@@ -104,26 +104,38 @@ int apply_relocate_add(Elf32_Shdr *sechdrs,
104 return -ENOEXEC; 104 return -ENOEXEC;
105} 105}
106 106
107extern void apply_alternatives(void *start, void *end);
108
109int module_finalize(const Elf_Ehdr *hdr, 107int module_finalize(const Elf_Ehdr *hdr,
110 const Elf_Shdr *sechdrs, 108 const Elf_Shdr *sechdrs,
111 struct module *me) 109 struct module *me)
112{ 110{
113 const Elf_Shdr *s; 111 const Elf_Shdr *s, *text = NULL, *alt = NULL, *locks = NULL;
114 char *secstrings = (void *)hdr + sechdrs[hdr->e_shstrndx].sh_offset; 112 char *secstrings = (void *)hdr + sechdrs[hdr->e_shstrndx].sh_offset;
115 113
116 /* look for .altinstructions to patch */
117 for (s = sechdrs; s < sechdrs + hdr->e_shnum; s++) { 114 for (s = sechdrs; s < sechdrs + hdr->e_shnum; s++) {
118 void *seg; 115 if (!strcmp(".text", secstrings + s->sh_name))
119 if (strcmp(".altinstructions", secstrings + s->sh_name)) 116 text = s;
120 continue; 117 if (!strcmp(".altinstructions", secstrings + s->sh_name))
121 seg = (void *)s->sh_addr; 118 alt = s;
122 apply_alternatives(seg, seg + s->sh_size); 119 if (!strcmp(".smp_locks", secstrings + s->sh_name))
123 } 120 locks= s;
121 }
122
123 if (alt) {
124 /* patch .altinstructions */
125 void *aseg = (void *)alt->sh_addr;
126 apply_alternatives(aseg, aseg + alt->sh_size);
127 }
128 if (locks && text) {
129 void *lseg = (void *)locks->sh_addr;
130 void *tseg = (void *)text->sh_addr;
131 alternatives_smp_module_add(me, me->name,
132 lseg, lseg + locks->sh_size,
133 tseg, tseg + text->sh_size);
134 }
124 return 0; 135 return 0;
125} 136}
126 137
127void module_arch_cleanup(struct module *mod) 138void module_arch_cleanup(struct module *mod)
128{ 139{
140 alternatives_smp_module_del(mod);
129} 141}
diff --git a/arch/i386/kernel/mpparse.c b/arch/i386/kernel/mpparse.c
index e6e2f43db85e..8d8aa9d1796d 100644
--- a/arch/i386/kernel/mpparse.c
+++ b/arch/i386/kernel/mpparse.c
@@ -828,6 +828,8 @@ void __init find_smp_config (void)
828 smp_scan_config(address, 0x400); 828 smp_scan_config(address, 0x400);
829} 829}
830 830
831int es7000_plat;
832
831/* -------------------------------------------------------------------------- 833/* --------------------------------------------------------------------------
832 ACPI-based MP Configuration 834 ACPI-based MP Configuration
833 -------------------------------------------------------------------------- */ 835 -------------------------------------------------------------------------- */
@@ -935,7 +937,8 @@ void __init mp_register_ioapic (
935 mp_ioapics[idx].mpc_apicaddr = address; 937 mp_ioapics[idx].mpc_apicaddr = address;
936 938
937 set_fixmap_nocache(FIX_IO_APIC_BASE_0 + idx, address); 939 set_fixmap_nocache(FIX_IO_APIC_BASE_0 + idx, address);
938 if ((boot_cpu_data.x86_vendor == X86_VENDOR_INTEL) && (boot_cpu_data.x86 < 15)) 940 if ((boot_cpu_data.x86_vendor == X86_VENDOR_INTEL)
941 && !APIC_XAPIC(apic_version[boot_cpu_physical_apicid]))
939 tmpid = io_apic_get_unique_id(idx, id); 942 tmpid = io_apic_get_unique_id(idx, id);
940 else 943 else
941 tmpid = id; 944 tmpid = id;
@@ -1011,8 +1014,6 @@ void __init mp_override_legacy_irq (
1011 return; 1014 return;
1012} 1015}
1013 1016
1014int es7000_plat;
1015
1016void __init mp_config_acpi_legacy_irqs (void) 1017void __init mp_config_acpi_legacy_irqs (void)
1017{ 1018{
1018 struct mpc_config_intsrc intsrc; 1019 struct mpc_config_intsrc intsrc;
diff --git a/arch/i386/kernel/nmi.c b/arch/i386/kernel/nmi.c
index be87c5e2ee95..d43b498ec745 100644
--- a/arch/i386/kernel/nmi.c
+++ b/arch/i386/kernel/nmi.c
@@ -138,12 +138,12 @@ static int __init check_nmi_watchdog(void)
138 if (nmi_watchdog == NMI_LOCAL_APIC) 138 if (nmi_watchdog == NMI_LOCAL_APIC)
139 smp_call_function(nmi_cpu_busy, (void *)&endflag, 0, 0); 139 smp_call_function(nmi_cpu_busy, (void *)&endflag, 0, 0);
140 140
141 for_each_cpu(cpu) 141 for_each_possible_cpu(cpu)
142 prev_nmi_count[cpu] = per_cpu(irq_stat, cpu).__nmi_count; 142 prev_nmi_count[cpu] = per_cpu(irq_stat, cpu).__nmi_count;
143 local_irq_enable(); 143 local_irq_enable();
144 mdelay((10*1000)/nmi_hz); // wait 10 ticks 144 mdelay((10*1000)/nmi_hz); // wait 10 ticks
145 145
146 for (cpu = 0; cpu < NR_CPUS; cpu++) { 146 for_each_possible_cpu(cpu) {
147#ifdef CONFIG_SMP 147#ifdef CONFIG_SMP
148 /* Check cpu_callin_map here because that is set 148 /* Check cpu_callin_map here because that is set
149 after the timer is started. */ 149 after the timer is started. */
@@ -510,7 +510,7 @@ void touch_nmi_watchdog (void)
510 * Just reset the alert counters, (other CPUs might be 510 * Just reset the alert counters, (other CPUs might be
511 * spinning on locks we hold): 511 * spinning on locks we hold):
512 */ 512 */
513 for (i = 0; i < NR_CPUS; i++) 513 for_each_possible_cpu(i)
514 alert_counter[i] = 0; 514 alert_counter[i] = 0;
515 515
516 /* 516 /*
@@ -529,7 +529,8 @@ void nmi_watchdog_tick (struct pt_regs * regs)
529 * always switch the stack NMI-atomically, it's safe to use 529 * always switch the stack NMI-atomically, it's safe to use
530 * smp_processor_id(). 530 * smp_processor_id().
531 */ 531 */
532 int sum, cpu = smp_processor_id(); 532 unsigned int sum;
533 int cpu = smp_processor_id();
533 534
534 sum = per_cpu(irq_stat, cpu).apic_timer_irqs; 535 sum = per_cpu(irq_stat, cpu).apic_timer_irqs;
535 536
@@ -543,7 +544,7 @@ void nmi_watchdog_tick (struct pt_regs * regs)
543 /* 544 /*
544 * die_nmi will return ONLY if NOTIFY_STOP happens.. 545 * die_nmi will return ONLY if NOTIFY_STOP happens..
545 */ 546 */
546 die_nmi(regs, "NMI Watchdog detected LOCKUP"); 547 die_nmi(regs, "BUG: NMI Watchdog detected LOCKUP");
547 } else { 548 } else {
548 last_irq_sums[cpu] = sum; 549 last_irq_sums[cpu] = sum;
549 alert_counter[cpu] = 0; 550 alert_counter[cpu] = 0;
diff --git a/arch/i386/kernel/process.c b/arch/i386/kernel/process.c
index 0480454ebffa..6259afea46d1 100644
--- a/arch/i386/kernel/process.c
+++ b/arch/i386/kernel/process.c
@@ -38,7 +38,6 @@
38#include <linux/kallsyms.h> 38#include <linux/kallsyms.h>
39#include <linux/ptrace.h> 39#include <linux/ptrace.h>
40#include <linux/random.h> 40#include <linux/random.h>
41#include <linux/kprobes.h>
42 41
43#include <asm/uaccess.h> 42#include <asm/uaccess.h>
44#include <asm/pgtable.h> 43#include <asm/pgtable.h>
@@ -295,7 +294,7 @@ void show_regs(struct pt_regs * regs)
295 printk("EIP: %04x:[<%08lx>] CPU: %d\n",0xffff & regs->xcs,regs->eip, smp_processor_id()); 294 printk("EIP: %04x:[<%08lx>] CPU: %d\n",0xffff & regs->xcs,regs->eip, smp_processor_id());
296 print_symbol("EIP is at %s\n", regs->eip); 295 print_symbol("EIP is at %s\n", regs->eip);
297 296
298 if (user_mode(regs)) 297 if (user_mode_vm(regs))
299 printk(" ESP: %04x:%08lx",0xffff & regs->xss,regs->esp); 298 printk(" ESP: %04x:%08lx",0xffff & regs->xss,regs->esp);
300 printk(" EFLAGS: %08lx %s (%s %.*s)\n", 299 printk(" EFLAGS: %08lx %s (%s %.*s)\n",
301 regs->eflags, print_tainted(), system_utsname.release, 300 regs->eflags, print_tainted(), system_utsname.release,
@@ -364,13 +363,6 @@ void exit_thread(void)
364 struct task_struct *tsk = current; 363 struct task_struct *tsk = current;
365 struct thread_struct *t = &tsk->thread; 364 struct thread_struct *t = &tsk->thread;
366 365
367 /*
368 * Remove function-return probe instances associated with this task
369 * and put them back on the free list. Do not insert an exit probe for
370 * this function, it will be disabled by kprobe_flush_task if you do.
371 */
372 kprobe_flush_task(tsk);
373
374 /* The process may have allocated an io port bitmap... nuke it. */ 366 /* The process may have allocated an io port bitmap... nuke it. */
375 if (unlikely(NULL != t->io_bitmap_ptr)) { 367 if (unlikely(NULL != t->io_bitmap_ptr)) {
376 int cpu = get_cpu(); 368 int cpu = get_cpu();
@@ -789,7 +781,6 @@ unsigned long get_wchan(struct task_struct *p)
789 } while (count++ < 16); 781 } while (count++ < 16);
790 return 0; 782 return 0;
791} 783}
792EXPORT_SYMBOL(get_wchan);
793 784
794/* 785/*
795 * sys_alloc_thread_area: get a yet unused TLS descriptor index. 786 * sys_alloc_thread_area: get a yet unused TLS descriptor index.
diff --git a/arch/i386/kernel/ptrace.c b/arch/i386/kernel/ptrace.c
index 5c1fb6aada5b..506462ef36a0 100644
--- a/arch/i386/kernel/ptrace.c
+++ b/arch/i386/kernel/ptrace.c
@@ -34,10 +34,10 @@
34 34
35/* 35/*
36 * Determines which flags the user has access to [1 = access, 0 = no access]. 36 * Determines which flags the user has access to [1 = access, 0 = no access].
37 * Prohibits changing ID(21), VIP(20), VIF(19), VM(17), IOPL(12-13), IF(9). 37 * Prohibits changing ID(21), VIP(20), VIF(19), VM(17), NT(14), IOPL(12-13), IF(9).
38 * Also masks reserved bits (31-22, 15, 5, 3, 1). 38 * Also masks reserved bits (31-22, 15, 5, 3, 1).
39 */ 39 */
40#define FLAG_MASK 0x00054dd5 40#define FLAG_MASK 0x00050dd5
41 41
42/* set's the trap flag. */ 42/* set's the trap flag. */
43#define TRAP_FLAG 0x100 43#define TRAP_FLAG 0x100
diff --git a/arch/i386/kernel/semaphore.c b/arch/i386/kernel/semaphore.c
index 7455ab643943..967dc74df9ee 100644
--- a/arch/i386/kernel/semaphore.c
+++ b/arch/i386/kernel/semaphore.c
@@ -110,11 +110,11 @@ asm(
110".align 4\n" 110".align 4\n"
111".globl __write_lock_failed\n" 111".globl __write_lock_failed\n"
112"__write_lock_failed:\n\t" 112"__write_lock_failed:\n\t"
113 LOCK "addl $" RW_LOCK_BIAS_STR ",(%eax)\n" 113 LOCK_PREFIX "addl $" RW_LOCK_BIAS_STR ",(%eax)\n"
114"1: rep; nop\n\t" 114"1: rep; nop\n\t"
115 "cmpl $" RW_LOCK_BIAS_STR ",(%eax)\n\t" 115 "cmpl $" RW_LOCK_BIAS_STR ",(%eax)\n\t"
116 "jne 1b\n\t" 116 "jne 1b\n\t"
117 LOCK "subl $" RW_LOCK_BIAS_STR ",(%eax)\n\t" 117 LOCK_PREFIX "subl $" RW_LOCK_BIAS_STR ",(%eax)\n\t"
118 "jnz __write_lock_failed\n\t" 118 "jnz __write_lock_failed\n\t"
119 "ret" 119 "ret"
120); 120);
@@ -124,11 +124,11 @@ asm(
124".align 4\n" 124".align 4\n"
125".globl __read_lock_failed\n" 125".globl __read_lock_failed\n"
126"__read_lock_failed:\n\t" 126"__read_lock_failed:\n\t"
127 LOCK "incl (%eax)\n" 127 LOCK_PREFIX "incl (%eax)\n"
128"1: rep; nop\n\t" 128"1: rep; nop\n\t"
129 "cmpl $1,(%eax)\n\t" 129 "cmpl $1,(%eax)\n\t"
130 "js 1b\n\t" 130 "js 1b\n\t"
131 LOCK "decl (%eax)\n\t" 131 LOCK_PREFIX "decl (%eax)\n\t"
132 "js __read_lock_failed\n\t" 132 "js __read_lock_failed\n\t"
133 "ret" 133 "ret"
134); 134);
diff --git a/arch/i386/kernel/setup.c b/arch/i386/kernel/setup.c
index a0b407585679..eacc3f0a2ea4 100644
--- a/arch/i386/kernel/setup.c
+++ b/arch/i386/kernel/setup.c
@@ -47,6 +47,7 @@
47#include <linux/kexec.h> 47#include <linux/kexec.h>
48#include <linux/crash_dump.h> 48#include <linux/crash_dump.h>
49#include <linux/dmi.h> 49#include <linux/dmi.h>
50#include <linux/pfn.h>
50 51
51#include <video/edid.h> 52#include <video/edid.h>
52 53
@@ -1059,10 +1060,10 @@ static int __init
1059free_available_memory(unsigned long start, unsigned long end, void *arg) 1060free_available_memory(unsigned long start, unsigned long end, void *arg)
1060{ 1061{
1061 /* check max_low_pfn */ 1062 /* check max_low_pfn */
1062 if (start >= ((max_low_pfn + 1) << PAGE_SHIFT)) 1063 if (start >= (max_low_pfn << PAGE_SHIFT))
1063 return 0; 1064 return 0;
1064 if (end >= ((max_low_pfn + 1) << PAGE_SHIFT)) 1065 if (end >= (max_low_pfn << PAGE_SHIFT))
1065 end = (max_low_pfn + 1) << PAGE_SHIFT; 1066 end = max_low_pfn << PAGE_SHIFT;
1066 if (start < end) 1067 if (start < end)
1067 free_bootmem(start, end - start); 1068 free_bootmem(start, end - start);
1068 1069
@@ -1287,9 +1288,7 @@ legacy_init_iomem_resources(struct resource *code_resource, struct resource *dat
1287 probe_roms(); 1288 probe_roms();
1288 for (i = 0; i < e820.nr_map; i++) { 1289 for (i = 0; i < e820.nr_map; i++) {
1289 struct resource *res; 1290 struct resource *res;
1290 if (e820.map[i].addr + e820.map[i].size > 0x100000000ULL) 1291 res = kzalloc(sizeof(struct resource), GFP_ATOMIC);
1291 continue;
1292 res = alloc_bootmem_low(sizeof(struct resource));
1293 switch (e820.map[i].type) { 1292 switch (e820.map[i].type) {
1294 case E820_RAM: res->name = "System RAM"; break; 1293 case E820_RAM: res->name = "System RAM"; break;
1295 case E820_ACPI: res->name = "ACPI Tables"; break; 1294 case E820_ACPI: res->name = "ACPI Tables"; break;
@@ -1317,13 +1316,15 @@ legacy_init_iomem_resources(struct resource *code_resource, struct resource *dat
1317 1316
1318/* 1317/*
1319 * Request address space for all standard resources 1318 * Request address space for all standard resources
1319 *
1320 * This is called just before pcibios_assign_resources(), which is also
1321 * an fs_initcall, but is linked in later (in arch/i386/pci/i386.c).
1320 */ 1322 */
1321static void __init register_memory(void) 1323static int __init request_standard_resources(void)
1322{ 1324{
1323 unsigned long gapstart, gapsize, round; 1325 int i;
1324 unsigned long long last;
1325 int i;
1326 1326
1327 printk("Setting up standard PCI resources\n");
1327 if (efi_enabled) 1328 if (efi_enabled)
1328 efi_initialize_iomem_resources(&code_resource, &data_resource); 1329 efi_initialize_iomem_resources(&code_resource, &data_resource);
1329 else 1330 else
@@ -1335,6 +1336,16 @@ static void __init register_memory(void)
1335 /* request I/O space for devices used on all i[345]86 PCs */ 1336 /* request I/O space for devices used on all i[345]86 PCs */
1336 for (i = 0; i < STANDARD_IO_RESOURCES; i++) 1337 for (i = 0; i < STANDARD_IO_RESOURCES; i++)
1337 request_resource(&ioport_resource, &standard_io_resources[i]); 1338 request_resource(&ioport_resource, &standard_io_resources[i]);
1339 return 0;
1340}
1341
1342fs_initcall(request_standard_resources);
1343
1344static void __init register_memory(void)
1345{
1346 unsigned long gapstart, gapsize, round;
1347 unsigned long long last;
1348 int i;
1338 1349
1339 /* 1350 /*
1340 * Search for the bigest gap in the low 32 bits of the e820 1351 * Search for the bigest gap in the low 32 bits of the e820
@@ -1378,101 +1389,6 @@ static void __init register_memory(void)
1378 pci_mem_start, gapstart, gapsize); 1389 pci_mem_start, gapstart, gapsize);
1379} 1390}
1380 1391
1381/* Use inline assembly to define this because the nops are defined
1382 as inline assembly strings in the include files and we cannot
1383 get them easily into strings. */
1384asm("\t.data\nintelnops: "
1385 GENERIC_NOP1 GENERIC_NOP2 GENERIC_NOP3 GENERIC_NOP4 GENERIC_NOP5 GENERIC_NOP6
1386 GENERIC_NOP7 GENERIC_NOP8);
1387asm("\t.data\nk8nops: "
1388 K8_NOP1 K8_NOP2 K8_NOP3 K8_NOP4 K8_NOP5 K8_NOP6
1389 K8_NOP7 K8_NOP8);
1390asm("\t.data\nk7nops: "
1391 K7_NOP1 K7_NOP2 K7_NOP3 K7_NOP4 K7_NOP5 K7_NOP6
1392 K7_NOP7 K7_NOP8);
1393
1394extern unsigned char intelnops[], k8nops[], k7nops[];
1395static unsigned char *intel_nops[ASM_NOP_MAX+1] = {
1396 NULL,
1397 intelnops,
1398 intelnops + 1,
1399 intelnops + 1 + 2,
1400 intelnops + 1 + 2 + 3,
1401 intelnops + 1 + 2 + 3 + 4,
1402 intelnops + 1 + 2 + 3 + 4 + 5,
1403 intelnops + 1 + 2 + 3 + 4 + 5 + 6,
1404 intelnops + 1 + 2 + 3 + 4 + 5 + 6 + 7,
1405};
1406static unsigned char *k8_nops[ASM_NOP_MAX+1] = {
1407 NULL,
1408 k8nops,
1409 k8nops + 1,
1410 k8nops + 1 + 2,
1411 k8nops + 1 + 2 + 3,
1412 k8nops + 1 + 2 + 3 + 4,
1413 k8nops + 1 + 2 + 3 + 4 + 5,
1414 k8nops + 1 + 2 + 3 + 4 + 5 + 6,
1415 k8nops + 1 + 2 + 3 + 4 + 5 + 6 + 7,
1416};
1417static unsigned char *k7_nops[ASM_NOP_MAX+1] = {
1418 NULL,
1419 k7nops,
1420 k7nops + 1,
1421 k7nops + 1 + 2,
1422 k7nops + 1 + 2 + 3,
1423 k7nops + 1 + 2 + 3 + 4,
1424 k7nops + 1 + 2 + 3 + 4 + 5,
1425 k7nops + 1 + 2 + 3 + 4 + 5 + 6,
1426 k7nops + 1 + 2 + 3 + 4 + 5 + 6 + 7,
1427};
1428static struct nop {
1429 int cpuid;
1430 unsigned char **noptable;
1431} noptypes[] = {
1432 { X86_FEATURE_K8, k8_nops },
1433 { X86_FEATURE_K7, k7_nops },
1434 { -1, NULL }
1435};
1436
1437/* Replace instructions with better alternatives for this CPU type.
1438
1439 This runs before SMP is initialized to avoid SMP problems with
1440 self modifying code. This implies that assymetric systems where
1441 APs have less capabilities than the boot processor are not handled.
1442 Tough. Make sure you disable such features by hand. */
1443void apply_alternatives(void *start, void *end)
1444{
1445 struct alt_instr *a;
1446 int diff, i, k;
1447 unsigned char **noptable = intel_nops;
1448 for (i = 0; noptypes[i].cpuid >= 0; i++) {
1449 if (boot_cpu_has(noptypes[i].cpuid)) {
1450 noptable = noptypes[i].noptable;
1451 break;
1452 }
1453 }
1454 for (a = start; (void *)a < end; a++) {
1455 if (!boot_cpu_has(a->cpuid))
1456 continue;
1457 BUG_ON(a->replacementlen > a->instrlen);
1458 memcpy(a->instr, a->replacement, a->replacementlen);
1459 diff = a->instrlen - a->replacementlen;
1460 /* Pad the rest with nops */
1461 for (i = a->replacementlen; diff > 0; diff -= k, i += k) {
1462 k = diff;
1463 if (k > ASM_NOP_MAX)
1464 k = ASM_NOP_MAX;
1465 memcpy(a->instr + i, noptable[k], k);
1466 }
1467 }
1468}
1469
1470void __init alternative_instructions(void)
1471{
1472 extern struct alt_instr __alt_instructions[], __alt_instructions_end[];
1473 apply_alternatives(__alt_instructions, __alt_instructions_end);
1474}
1475
1476static char * __init machine_specific_memory_setup(void); 1392static char * __init machine_specific_memory_setup(void);
1477 1393
1478#ifdef CONFIG_MCA 1394#ifdef CONFIG_MCA
@@ -1555,6 +1471,16 @@ void __init setup_arch(char **cmdline_p)
1555 1471
1556 parse_cmdline_early(cmdline_p); 1472 parse_cmdline_early(cmdline_p);
1557 1473
1474#ifdef CONFIG_EARLY_PRINTK
1475 {
1476 char *s = strstr(*cmdline_p, "earlyprintk=");
1477 if (s) {
1478 setup_early_printk(strchr(s, '=') + 1);
1479 printk("early console enabled\n");
1480 }
1481 }
1482#endif
1483
1558 max_low_pfn = setup_memory(); 1484 max_low_pfn = setup_memory();
1559 1485
1560 /* 1486 /*
@@ -1579,19 +1505,6 @@ void __init setup_arch(char **cmdline_p)
1579 * NOTE: at this point the bootmem allocator is fully available. 1505 * NOTE: at this point the bootmem allocator is fully available.
1580 */ 1506 */
1581 1507
1582#ifdef CONFIG_EARLY_PRINTK
1583 {
1584 char *s = strstr(*cmdline_p, "earlyprintk=");
1585 if (s) {
1586 extern void setup_early_printk(char *);
1587
1588 setup_early_printk(strchr(s, '=') + 1);
1589 printk("early console enabled\n");
1590 }
1591 }
1592#endif
1593
1594
1595 dmi_scan_machine(); 1508 dmi_scan_machine();
1596 1509
1597#ifdef CONFIG_X86_GENERICARCH 1510#ifdef CONFIG_X86_GENERICARCH
diff --git a/arch/i386/kernel/signal.c b/arch/i386/kernel/signal.c
index 963616d364ec..5c352c3a9e7f 100644
--- a/arch/i386/kernel/signal.c
+++ b/arch/i386/kernel/signal.c
@@ -123,7 +123,8 @@ restore_sigcontext(struct pt_regs *regs, struct sigcontext __user *sc, int *peax
123 err |= __get_user(tmp, &sc->seg); \ 123 err |= __get_user(tmp, &sc->seg); \
124 loadsegment(seg,tmp); } 124 loadsegment(seg,tmp); }
125 125
126#define FIX_EFLAGS (X86_EFLAGS_AC | X86_EFLAGS_OF | X86_EFLAGS_DF | \ 126#define FIX_EFLAGS (X86_EFLAGS_AC | X86_EFLAGS_RF | \
127 X86_EFLAGS_OF | X86_EFLAGS_DF | \
127 X86_EFLAGS_TF | X86_EFLAGS_SF | X86_EFLAGS_ZF | \ 128 X86_EFLAGS_TF | X86_EFLAGS_SF | X86_EFLAGS_ZF | \
128 X86_EFLAGS_AF | X86_EFLAGS_PF | X86_EFLAGS_CF) 129 X86_EFLAGS_AF | X86_EFLAGS_PF | X86_EFLAGS_CF)
129 130
@@ -582,9 +583,6 @@ static void fastcall do_signal(struct pt_regs *regs)
582 if (!user_mode(regs)) 583 if (!user_mode(regs))
583 return; 584 return;
584 585
585 if (try_to_freeze())
586 goto no_signal;
587
588 if (test_thread_flag(TIF_RESTORE_SIGMASK)) 586 if (test_thread_flag(TIF_RESTORE_SIGMASK))
589 oldset = &current->saved_sigmask; 587 oldset = &current->saved_sigmask;
590 else 588 else
@@ -613,7 +611,6 @@ static void fastcall do_signal(struct pt_regs *regs)
613 return; 611 return;
614 } 612 }
615 613
616no_signal:
617 /* Did we come from a system call? */ 614 /* Did we come from a system call? */
618 if (regs->orig_eax >= 0) { 615 if (regs->orig_eax >= 0) {
619 /* Restart the system call - no handlers present */ 616 /* Restart the system call - no handlers present */
diff --git a/arch/i386/kernel/smp.c b/arch/i386/kernel/smp.c
index 218d725a5a1e..d134e9643a58 100644
--- a/arch/i386/kernel/smp.c
+++ b/arch/i386/kernel/smp.c
@@ -504,27 +504,23 @@ void unlock_ipi_call_lock(void)
504 spin_unlock_irq(&call_lock); 504 spin_unlock_irq(&call_lock);
505} 505}
506 506
507static struct call_data_struct * call_data; 507static struct call_data_struct *call_data;
508 508
509/* 509/**
510 * this function sends a 'generic call function' IPI to all other CPUs 510 * smp_call_function(): Run a function on all other CPUs.
511 * in the system. 511 * @func: The function to run. This must be fast and non-blocking.
512 */ 512 * @info: An arbitrary pointer to pass to the function.
513 513 * @nonatomic: currently unused.
514int smp_call_function (void (*func) (void *info), void *info, int nonatomic, 514 * @wait: If true, wait (atomically) until function has completed on other CPUs.
515 int wait) 515 *
516/* 516 * Returns 0 on success, else a negative status code. Does not return until
517 * [SUMMARY] Run a function on all other CPUs.
518 * <func> The function to run. This must be fast and non-blocking.
519 * <info> An arbitrary pointer to pass to the function.
520 * <nonatomic> currently unused.
521 * <wait> If true, wait (atomically) until function has completed on other CPUs.
522 * [RETURNS] 0 on success, else a negative status code. Does not return until
523 * remote CPUs are nearly ready to execute <<func>> or are or have executed. 517 * remote CPUs are nearly ready to execute <<func>> or are or have executed.
524 * 518 *
525 * You must not call this function with disabled interrupts or from a 519 * You must not call this function with disabled interrupts or from a
526 * hardware interrupt handler or from a bottom half handler. 520 * hardware interrupt handler or from a bottom half handler.
527 */ 521 */
522int smp_call_function (void (*func) (void *info), void *info, int nonatomic,
523 int wait)
528{ 524{
529 struct call_data_struct data; 525 struct call_data_struct data;
530 int cpus; 526 int cpus;
diff --git a/arch/i386/kernel/smpboot.c b/arch/i386/kernel/smpboot.c
index eba7f53f8b4a..a6969903f2d6 100644
--- a/arch/i386/kernel/smpboot.c
+++ b/arch/i386/kernel/smpboot.c
@@ -72,6 +72,9 @@ int phys_proc_id[NR_CPUS] __read_mostly = {[0 ... NR_CPUS-1] = BAD_APICID};
72/* Core ID of each logical CPU */ 72/* Core ID of each logical CPU */
73int cpu_core_id[NR_CPUS] __read_mostly = {[0 ... NR_CPUS-1] = BAD_APICID}; 73int cpu_core_id[NR_CPUS] __read_mostly = {[0 ... NR_CPUS-1] = BAD_APICID};
74 74
75/* Last level cache ID of each logical CPU */
76int cpu_llc_id[NR_CPUS] __cpuinitdata = {[0 ... NR_CPUS-1] = BAD_APICID};
77
75/* representing HT siblings of each logical CPU */ 78/* representing HT siblings of each logical CPU */
76cpumask_t cpu_sibling_map[NR_CPUS] __read_mostly; 79cpumask_t cpu_sibling_map[NR_CPUS] __read_mostly;
77EXPORT_SYMBOL(cpu_sibling_map); 80EXPORT_SYMBOL(cpu_sibling_map);
@@ -440,6 +443,18 @@ static void __devinit smp_callin(void)
440 443
441static int cpucount; 444static int cpucount;
442 445
446/* maps the cpu to the sched domain representing multi-core */
447cpumask_t cpu_coregroup_map(int cpu)
448{
449 struct cpuinfo_x86 *c = cpu_data + cpu;
450 /*
451 * For perf, we return last level cache shared map.
452 * TBD: when power saving sched policy is added, we will return
453 * cpu_core_map when power saving policy is enabled
454 */
455 return c->llc_shared_map;
456}
457
443/* representing cpus for which sibling maps can be computed */ 458/* representing cpus for which sibling maps can be computed */
444static cpumask_t cpu_sibling_setup_map; 459static cpumask_t cpu_sibling_setup_map;
445 460
@@ -459,12 +474,16 @@ set_cpu_sibling_map(int cpu)
459 cpu_set(cpu, cpu_sibling_map[i]); 474 cpu_set(cpu, cpu_sibling_map[i]);
460 cpu_set(i, cpu_core_map[cpu]); 475 cpu_set(i, cpu_core_map[cpu]);
461 cpu_set(cpu, cpu_core_map[i]); 476 cpu_set(cpu, cpu_core_map[i]);
477 cpu_set(i, c[cpu].llc_shared_map);
478 cpu_set(cpu, c[i].llc_shared_map);
462 } 479 }
463 } 480 }
464 } else { 481 } else {
465 cpu_set(cpu, cpu_sibling_map[cpu]); 482 cpu_set(cpu, cpu_sibling_map[cpu]);
466 } 483 }
467 484
485 cpu_set(cpu, c[cpu].llc_shared_map);
486
468 if (current_cpu_data.x86_max_cores == 1) { 487 if (current_cpu_data.x86_max_cores == 1) {
469 cpu_core_map[cpu] = cpu_sibling_map[cpu]; 488 cpu_core_map[cpu] = cpu_sibling_map[cpu];
470 c[cpu].booted_cores = 1; 489 c[cpu].booted_cores = 1;
@@ -472,6 +491,11 @@ set_cpu_sibling_map(int cpu)
472 } 491 }
473 492
474 for_each_cpu_mask(i, cpu_sibling_setup_map) { 493 for_each_cpu_mask(i, cpu_sibling_setup_map) {
494 if (cpu_llc_id[cpu] != BAD_APICID &&
495 cpu_llc_id[cpu] == cpu_llc_id[i]) {
496 cpu_set(i, c[cpu].llc_shared_map);
497 cpu_set(cpu, c[i].llc_shared_map);
498 }
475 if (phys_proc_id[cpu] == phys_proc_id[i]) { 499 if (phys_proc_id[cpu] == phys_proc_id[i]) {
476 cpu_set(i, cpu_core_map[cpu]); 500 cpu_set(i, cpu_core_map[cpu]);
477 cpu_set(cpu, cpu_core_map[i]); 501 cpu_set(cpu, cpu_core_map[i]);
@@ -899,6 +923,7 @@ static int __devinit do_boot_cpu(int apicid, int cpu)
899 unsigned short nmi_high = 0, nmi_low = 0; 923 unsigned short nmi_high = 0, nmi_low = 0;
900 924
901 ++cpucount; 925 ++cpucount;
926 alternatives_smp_switch(1);
902 927
903 /* 928 /*
904 * We can't use kernel_thread since we must avoid to 929 * We can't use kernel_thread since we must avoid to
@@ -1002,7 +1027,6 @@ void cpu_exit_clear(void)
1002 1027
1003 cpu_clear(cpu, cpu_callout_map); 1028 cpu_clear(cpu, cpu_callout_map);
1004 cpu_clear(cpu, cpu_callin_map); 1029 cpu_clear(cpu, cpu_callin_map);
1005 cpu_clear(cpu, cpu_present_map);
1006 1030
1007 cpu_clear(cpu, smp_commenced_mask); 1031 cpu_clear(cpu, smp_commenced_mask);
1008 unmap_cpu_to_logical_apicid(cpu); 1032 unmap_cpu_to_logical_apicid(cpu);
@@ -1014,21 +1038,20 @@ struct warm_boot_cpu_info {
1014 int cpu; 1038 int cpu;
1015}; 1039};
1016 1040
1017static void __devinit do_warm_boot_cpu(void *p) 1041static void __cpuinit do_warm_boot_cpu(void *p)
1018{ 1042{
1019 struct warm_boot_cpu_info *info = p; 1043 struct warm_boot_cpu_info *info = p;
1020 do_boot_cpu(info->apicid, info->cpu); 1044 do_boot_cpu(info->apicid, info->cpu);
1021 complete(info->complete); 1045 complete(info->complete);
1022} 1046}
1023 1047
1024int __devinit smp_prepare_cpu(int cpu) 1048static int __cpuinit __smp_prepare_cpu(int cpu)
1025{ 1049{
1026 DECLARE_COMPLETION(done); 1050 DECLARE_COMPLETION(done);
1027 struct warm_boot_cpu_info info; 1051 struct warm_boot_cpu_info info;
1028 struct work_struct task; 1052 struct work_struct task;
1029 int apicid, ret; 1053 int apicid, ret;
1030 1054
1031 lock_cpu_hotplug();
1032 apicid = x86_cpu_to_apicid[cpu]; 1055 apicid = x86_cpu_to_apicid[cpu];
1033 if (apicid == BAD_APICID) { 1056 if (apicid == BAD_APICID) {
1034 ret = -ENODEV; 1057 ret = -ENODEV;
@@ -1053,7 +1076,6 @@ int __devinit smp_prepare_cpu(int cpu)
1053 zap_low_mappings(); 1076 zap_low_mappings();
1054 ret = 0; 1077 ret = 0;
1055exit: 1078exit:
1056 unlock_cpu_hotplug();
1057 return ret; 1079 return ret;
1058} 1080}
1059#endif 1081#endif
@@ -1358,6 +1380,8 @@ void __cpu_die(unsigned int cpu)
1358 /* They ack this in play_dead by setting CPU_DEAD */ 1380 /* They ack this in play_dead by setting CPU_DEAD */
1359 if (per_cpu(cpu_state, cpu) == CPU_DEAD) { 1381 if (per_cpu(cpu_state, cpu) == CPU_DEAD) {
1360 printk ("CPU %d is now offline\n", cpu); 1382 printk ("CPU %d is now offline\n", cpu);
1383 if (1 == num_online_cpus())
1384 alternatives_smp_switch(0);
1361 return; 1385 return;
1362 } 1386 }
1363 msleep(100); 1387 msleep(100);
@@ -1379,6 +1403,22 @@ void __cpu_die(unsigned int cpu)
1379 1403
1380int __devinit __cpu_up(unsigned int cpu) 1404int __devinit __cpu_up(unsigned int cpu)
1381{ 1405{
1406#ifdef CONFIG_HOTPLUG_CPU
1407 int ret=0;
1408
1409 /*
1410 * We do warm boot only on cpus that had booted earlier
1411 * Otherwise cold boot is all handled from smp_boot_cpus().
1412 * cpu_callin_map is set during AP kickstart process. Its reset
1413 * when a cpu is taken offline from cpu_exit_clear().
1414 */
1415 if (!cpu_isset(cpu, cpu_callin_map))
1416 ret = __smp_prepare_cpu(cpu);
1417
1418 if (ret)
1419 return -EIO;
1420#endif
1421
1382 /* In case one didn't come up */ 1422 /* In case one didn't come up */
1383 if (!cpu_isset(cpu, cpu_callin_map)) { 1423 if (!cpu_isset(cpu, cpu_callin_map)) {
1384 printk(KERN_DEBUG "skipping cpu%d, didn't come online\n", cpu); 1424 printk(KERN_DEBUG "skipping cpu%d, didn't come online\n", cpu);
diff --git a/arch/i386/kernel/sys_i386.c b/arch/i386/kernel/sys_i386.c
index a4a61976ecb9..8fdb1fb17a5f 100644
--- a/arch/i386/kernel/sys_i386.c
+++ b/arch/i386/kernel/sys_i386.c
@@ -40,14 +40,13 @@ asmlinkage int sys_pipe(unsigned long __user * fildes)
40 return error; 40 return error;
41} 41}
42 42
43/* common code for old and new mmaps */ 43asmlinkage long sys_mmap2(unsigned long addr, unsigned long len,
44static inline long do_mmap2( 44 unsigned long prot, unsigned long flags,
45 unsigned long addr, unsigned long len, 45 unsigned long fd, unsigned long pgoff)
46 unsigned long prot, unsigned long flags,
47 unsigned long fd, unsigned long pgoff)
48{ 46{
49 int error = -EBADF; 47 int error = -EBADF;
50 struct file * file = NULL; 48 struct file *file = NULL;
49 struct mm_struct *mm = current->mm;
51 50
52 flags &= ~(MAP_EXECUTABLE | MAP_DENYWRITE); 51 flags &= ~(MAP_EXECUTABLE | MAP_DENYWRITE);
53 if (!(flags & MAP_ANONYMOUS)) { 52 if (!(flags & MAP_ANONYMOUS)) {
@@ -56,9 +55,9 @@ static inline long do_mmap2(
56 goto out; 55 goto out;
57 } 56 }
58 57
59 down_write(&current->mm->mmap_sem); 58 down_write(&mm->mmap_sem);
60 error = do_mmap_pgoff(file, addr, len, prot, flags, pgoff); 59 error = do_mmap_pgoff(file, addr, len, prot, flags, pgoff);
61 up_write(&current->mm->mmap_sem); 60 up_write(&mm->mmap_sem);
62 61
63 if (file) 62 if (file)
64 fput(file); 63 fput(file);
@@ -66,13 +65,6 @@ out:
66 return error; 65 return error;
67} 66}
68 67
69asmlinkage long sys_mmap2(unsigned long addr, unsigned long len,
70 unsigned long prot, unsigned long flags,
71 unsigned long fd, unsigned long pgoff)
72{
73 return do_mmap2(addr, len, prot, flags, fd, pgoff);
74}
75
76/* 68/*
77 * Perform the select(nd, in, out, ex, tv) and mmap() system 69 * Perform the select(nd, in, out, ex, tv) and mmap() system
78 * calls. Linux/i386 didn't use to be able to handle more than 70 * calls. Linux/i386 didn't use to be able to handle more than
@@ -101,7 +93,8 @@ asmlinkage int old_mmap(struct mmap_arg_struct __user *arg)
101 if (a.offset & ~PAGE_MASK) 93 if (a.offset & ~PAGE_MASK)
102 goto out; 94 goto out;
103 95
104 err = do_mmap2(a.addr, a.len, a.prot, a.flags, a.fd, a.offset >> PAGE_SHIFT); 96 err = sys_mmap2(a.addr, a.len, a.prot, a.flags,
97 a.fd, a.offset >> PAGE_SHIFT);
105out: 98out:
106 return err; 99 return err;
107} 100}
diff --git a/arch/i386/kernel/syscall_table.S b/arch/i386/kernel/syscall_table.S
index ac687d00a1ce..4f58b9c0efe3 100644
--- a/arch/i386/kernel/syscall_table.S
+++ b/arch/i386/kernel/syscall_table.S
@@ -310,3 +310,7 @@ ENTRY(sys_call_table)
310 .long sys_pselect6 310 .long sys_pselect6
311 .long sys_ppoll 311 .long sys_ppoll
312 .long sys_unshare /* 310 */ 312 .long sys_unshare /* 310 */
313 .long sys_set_robust_list
314 .long sys_get_robust_list
315 .long sys_splice
316 .long sys_sync_file_range
diff --git a/arch/i386/kernel/timers/timer_hpet.c b/arch/i386/kernel/timers/timer_hpet.c
index be242723c339..17a6fe7166e7 100644
--- a/arch/i386/kernel/timers/timer_hpet.c
+++ b/arch/i386/kernel/timers/timer_hpet.c
@@ -46,7 +46,7 @@ static seqlock_t monotonic_lock = SEQLOCK_UNLOCKED;
46 * 46 *
47 * -johnstul@us.ibm.com "math is hard, lets go shopping!" 47 * -johnstul@us.ibm.com "math is hard, lets go shopping!"
48 */ 48 */
49static unsigned long cyc2ns_scale; 49static unsigned long cyc2ns_scale __read_mostly;
50#define CYC2NS_SCALE_FACTOR 10 /* 2^10, carefully chosen */ 50#define CYC2NS_SCALE_FACTOR 10 /* 2^10, carefully chosen */
51 51
52static inline void set_cyc2ns_scale(unsigned long cpu_khz) 52static inline void set_cyc2ns_scale(unsigned long cpu_khz)
diff --git a/arch/i386/kernel/timers/timer_pm.c b/arch/i386/kernel/timers/timer_pm.c
index 264edaaac315..144e94a04933 100644
--- a/arch/i386/kernel/timers/timer_pm.c
+++ b/arch/i386/kernel/timers/timer_pm.c
@@ -15,6 +15,7 @@
15#include <linux/module.h> 15#include <linux/module.h>
16#include <linux/device.h> 16#include <linux/device.h>
17#include <linux/init.h> 17#include <linux/init.h>
18#include <linux/pci.h>
18#include <asm/types.h> 19#include <asm/types.h>
19#include <asm/timer.h> 20#include <asm/timer.h>
20#include <asm/smp.h> 21#include <asm/smp.h>
@@ -45,24 +46,31 @@ static seqlock_t monotonic_lock = SEQLOCK_UNLOCKED;
45 46
46#define ACPI_PM_MASK 0xFFFFFF /* limit it to 24 bits */ 47#define ACPI_PM_MASK 0xFFFFFF /* limit it to 24 bits */
47 48
49static int pmtmr_need_workaround __read_mostly = 1;
50
48/*helper function to safely read acpi pm timesource*/ 51/*helper function to safely read acpi pm timesource*/
49static inline u32 read_pmtmr(void) 52static inline u32 read_pmtmr(void)
50{ 53{
51 u32 v1=0,v2=0,v3=0; 54 if (pmtmr_need_workaround) {
52 /* It has been reported that because of various broken 55 u32 v1, v2, v3;
53 * chipsets (ICH4, PIIX4 and PIIX4E) where the ACPI PM time 56
54 * source is not latched, so you must read it multiple 57 /* It has been reported that because of various broken
55 * times to insure a safe value is read. 58 * chipsets (ICH4, PIIX4 and PIIX4E) where the ACPI PM time
56 */ 59 * source is not latched, so you must read it multiple
57 do { 60 * times to insure a safe value is read.
58 v1 = inl(pmtmr_ioport); 61 */
59 v2 = inl(pmtmr_ioport); 62 do {
60 v3 = inl(pmtmr_ioport); 63 v1 = inl(pmtmr_ioport);
61 } while ((v1 > v2 && v1 < v3) || (v2 > v3 && v2 < v1) 64 v2 = inl(pmtmr_ioport);
62 || (v3 > v1 && v3 < v2)); 65 v3 = inl(pmtmr_ioport);
63 66 } while ((v1 > v2 && v1 < v3) || (v2 > v3 && v2 < v1)
64 /* mask the output to 24 bits */ 67 || (v3 > v1 && v3 < v2));
65 return v2 & ACPI_PM_MASK; 68
69 /* mask the output to 24 bits */
70 return v2 & ACPI_PM_MASK;
71 }
72
73 return inl(pmtmr_ioport) & ACPI_PM_MASK;
66} 74}
67 75
68 76
@@ -263,6 +271,72 @@ struct init_timer_opts __initdata timer_pmtmr_init = {
263 .opts = &timer_pmtmr, 271 .opts = &timer_pmtmr,
264}; 272};
265 273
274#ifdef CONFIG_PCI
275/*
276 * PIIX4 Errata:
277 *
278 * The power management timer may return improper results when read.
279 * Although the timer value settles properly after incrementing,
280 * while incrementing there is a 3 ns window every 69.8 ns where the
281 * timer value is indeterminate (a 4.2% chance that the data will be
282 * incorrect when read). As a result, the ACPI free running count up
283 * timer specification is violated due to erroneous reads.
284 */
285static int __init pmtmr_bug_check(void)
286{
287 static struct pci_device_id gray_list[] __initdata = {
288 /* these chipsets may have bug. */
289 { PCI_DEVICE(PCI_VENDOR_ID_INTEL,
290 PCI_DEVICE_ID_INTEL_82801DB_0) },
291 { },
292 };
293 struct pci_dev *dev;
294 int pmtmr_has_bug = 0;
295 u8 rev;
296
297 if (cur_timer != &timer_pmtmr || !pmtmr_need_workaround)
298 return 0;
299
300 dev = pci_get_device(PCI_VENDOR_ID_INTEL,
301 PCI_DEVICE_ID_INTEL_82371AB_3, NULL);
302 if (dev) {
303 pci_read_config_byte(dev, PCI_REVISION_ID, &rev);
304 /* the bug has been fixed in PIIX4M */
305 if (rev < 3) {
306 printk(KERN_WARNING "* Found PM-Timer Bug on this "
307 "chipset. Due to workarounds for a bug,\n"
308 "* this time source is slow. Consider trying "
309 "other time sources (clock=)\n");
310 pmtmr_has_bug = 1;
311 }
312 pci_dev_put(dev);
313 }
314
315 if (pci_dev_present(gray_list)) {
316 printk(KERN_WARNING "* This chipset may have PM-Timer Bug. Due"
317 " to workarounds for a bug,\n"
318 "* this time source is slow. If you are sure your timer"
319 " does not have\n"
320 "* this bug, please use \"pmtmr_good\" to disable the "
321 "workaround\n");
322 pmtmr_has_bug = 1;
323 }
324
325 if (!pmtmr_has_bug)
326 pmtmr_need_workaround = 0;
327
328 return 0;
329}
330device_initcall(pmtmr_bug_check);
331#endif
332
333static int __init pmtr_good_setup(char *__str)
334{
335 pmtmr_need_workaround = 0;
336 return 1;
337}
338__setup("pmtmr_good", pmtr_good_setup);
339
266MODULE_LICENSE("GPL"); 340MODULE_LICENSE("GPL");
267MODULE_AUTHOR("Dominik Brodowski <linux@brodo.de>"); 341MODULE_AUTHOR("Dominik Brodowski <linux@brodo.de>");
268MODULE_DESCRIPTION("Power Management Timer (PMTMR) as primary timing source for x86"); 342MODULE_DESCRIPTION("Power Management Timer (PMTMR) as primary timing source for x86");
diff --git a/arch/i386/kernel/timers/timer_tsc.c b/arch/i386/kernel/timers/timer_tsc.c
index a7f5a2aceba2..5e41ee29c8cf 100644
--- a/arch/i386/kernel/timers/timer_tsc.c
+++ b/arch/i386/kernel/timers/timer_tsc.c
@@ -74,7 +74,7 @@ late_initcall(start_lost_tick_compensation);
74 * 74 *
75 * -johnstul@us.ibm.com "math is hard, lets go shopping!" 75 * -johnstul@us.ibm.com "math is hard, lets go shopping!"
76 */ 76 */
77static unsigned long cyc2ns_scale; 77static unsigned long cyc2ns_scale __read_mostly;
78#define CYC2NS_SCALE_FACTOR 10 /* 2^10, carefully chosen */ 78#define CYC2NS_SCALE_FACTOR 10 /* 2^10, carefully chosen */
79 79
80static inline void set_cyc2ns_scale(unsigned long cpu_khz) 80static inline void set_cyc2ns_scale(unsigned long cpu_khz)
diff --git a/arch/i386/kernel/topology.c b/arch/i386/kernel/topology.c
index 67a0e1baa28b..296355292c7c 100644
--- a/arch/i386/kernel/topology.c
+++ b/arch/i386/kernel/topology.c
@@ -41,6 +41,15 @@ int arch_register_cpu(int num){
41 parent = &node_devices[node].node; 41 parent = &node_devices[node].node;
42#endif /* CONFIG_NUMA */ 42#endif /* CONFIG_NUMA */
43 43
44 /*
45 * CPU0 cannot be offlined due to several
46 * restrictions and assumptions in kernel. This basically
47 * doesnt add a control file, one cannot attempt to offline
48 * BSP.
49 */
50 if (!num)
51 cpu_devices[num].cpu.no_control = 1;
52
44 return register_cpu(&cpu_devices[num].cpu, num, parent); 53 return register_cpu(&cpu_devices[num].cpu, num, parent);
45} 54}
46 55
diff --git a/arch/i386/kernel/traps.c b/arch/i386/kernel/traps.c
index b814dbdcc91e..e38527994590 100644
--- a/arch/i386/kernel/traps.c
+++ b/arch/i386/kernel/traps.c
@@ -92,32 +92,51 @@ asmlinkage void spurious_interrupt_bug(void);
92asmlinkage void machine_check(void); 92asmlinkage void machine_check(void);
93 93
94static int kstack_depth_to_print = 24; 94static int kstack_depth_to_print = 24;
95struct notifier_block *i386die_chain; 95ATOMIC_NOTIFIER_HEAD(i386die_chain);
96static DEFINE_SPINLOCK(die_notifier_lock);
97 96
98int register_die_notifier(struct notifier_block *nb) 97int register_die_notifier(struct notifier_block *nb)
99{ 98{
100 int err = 0; 99 vmalloc_sync_all();
101 unsigned long flags; 100 return atomic_notifier_chain_register(&i386die_chain, nb);
102 spin_lock_irqsave(&die_notifier_lock, flags);
103 err = notifier_chain_register(&i386die_chain, nb);
104 spin_unlock_irqrestore(&die_notifier_lock, flags);
105 return err;
106} 101}
107EXPORT_SYMBOL(register_die_notifier); 102EXPORT_SYMBOL(register_die_notifier);
108 103
104int unregister_die_notifier(struct notifier_block *nb)
105{
106 return atomic_notifier_chain_unregister(&i386die_chain, nb);
107}
108EXPORT_SYMBOL(unregister_die_notifier);
109
109static inline int valid_stack_ptr(struct thread_info *tinfo, void *p) 110static inline int valid_stack_ptr(struct thread_info *tinfo, void *p)
110{ 111{
111 return p > (void *)tinfo && 112 return p > (void *)tinfo &&
112 p < (void *)tinfo + THREAD_SIZE - 3; 113 p < (void *)tinfo + THREAD_SIZE - 3;
113} 114}
114 115
115static void print_addr_and_symbol(unsigned long addr, char *log_lvl) 116/*
117 * Print CONFIG_STACK_BACKTRACE_COLS address/symbol entries per line.
118 */
119static inline int print_addr_and_symbol(unsigned long addr, char *log_lvl,
120 int printed)
116{ 121{
117 printk(log_lvl); 122 if (!printed)
123 printk(log_lvl);
124
125#if CONFIG_STACK_BACKTRACE_COLS == 1
118 printk(" [<%08lx>] ", addr); 126 printk(" [<%08lx>] ", addr);
127#else
128 printk(" <%08lx> ", addr);
129#endif
119 print_symbol("%s", addr); 130 print_symbol("%s", addr);
120 printk("\n"); 131
132 printed = (printed + 1) % CONFIG_STACK_BACKTRACE_COLS;
133
134 if (printed)
135 printk(" ");
136 else
137 printk("\n");
138
139 return printed;
121} 140}
122 141
123static inline unsigned long print_context_stack(struct thread_info *tinfo, 142static inline unsigned long print_context_stack(struct thread_info *tinfo,
@@ -125,20 +144,24 @@ static inline unsigned long print_context_stack(struct thread_info *tinfo,
125 char *log_lvl) 144 char *log_lvl)
126{ 145{
127 unsigned long addr; 146 unsigned long addr;
147 int printed = 0; /* nr of entries already printed on current line */
128 148
129#ifdef CONFIG_FRAME_POINTER 149#ifdef CONFIG_FRAME_POINTER
130 while (valid_stack_ptr(tinfo, (void *)ebp)) { 150 while (valid_stack_ptr(tinfo, (void *)ebp)) {
131 addr = *(unsigned long *)(ebp + 4); 151 addr = *(unsigned long *)(ebp + 4);
132 print_addr_and_symbol(addr, log_lvl); 152 printed = print_addr_and_symbol(addr, log_lvl, printed);
133 ebp = *(unsigned long *)ebp; 153 ebp = *(unsigned long *)ebp;
134 } 154 }
135#else 155#else
136 while (valid_stack_ptr(tinfo, stack)) { 156 while (valid_stack_ptr(tinfo, stack)) {
137 addr = *stack++; 157 addr = *stack++;
138 if (__kernel_text_address(addr)) 158 if (__kernel_text_address(addr))
139 print_addr_and_symbol(addr, log_lvl); 159 printed = print_addr_and_symbol(addr, log_lvl, printed);
140 } 160 }
141#endif 161#endif
162 if (printed)
163 printk("\n");
164
142 return ebp; 165 return ebp;
143} 166}
144 167
@@ -166,8 +189,7 @@ static void show_trace_log_lvl(struct task_struct *task,
166 stack = (unsigned long*)context->previous_esp; 189 stack = (unsigned long*)context->previous_esp;
167 if (!stack) 190 if (!stack)
168 break; 191 break;
169 printk(log_lvl); 192 printk("%s =======================\n", log_lvl);
170 printk(" =======================\n");
171 } 193 }
172} 194}
173 195
@@ -194,21 +216,17 @@ static void show_stack_log_lvl(struct task_struct *task, unsigned long *esp,
194 for(i = 0; i < kstack_depth_to_print; i++) { 216 for(i = 0; i < kstack_depth_to_print; i++) {
195 if (kstack_end(stack)) 217 if (kstack_end(stack))
196 break; 218 break;
197 if (i && ((i % 8) == 0)) { 219 if (i && ((i % 8) == 0))
198 printk("\n"); 220 printk("\n%s ", log_lvl);
199 printk(log_lvl);
200 printk(" ");
201 }
202 printk("%08lx ", *stack++); 221 printk("%08lx ", *stack++);
203 } 222 }
204 printk("\n"); 223 printk("\n%sCall Trace:\n", log_lvl);
205 printk(log_lvl);
206 printk("Call Trace:\n");
207 show_trace_log_lvl(task, esp, log_lvl); 224 show_trace_log_lvl(task, esp, log_lvl);
208} 225}
209 226
210void show_stack(struct task_struct *task, unsigned long *esp) 227void show_stack(struct task_struct *task, unsigned long *esp)
211{ 228{
229 printk(" ");
212 show_stack_log_lvl(task, esp, ""); 230 show_stack_log_lvl(task, esp, "");
213} 231}
214 232
@@ -233,7 +251,7 @@ void show_registers(struct pt_regs *regs)
233 251
234 esp = (unsigned long) (&regs->esp); 252 esp = (unsigned long) (&regs->esp);
235 savesegment(ss, ss); 253 savesegment(ss, ss);
236 if (user_mode(regs)) { 254 if (user_mode_vm(regs)) {
237 in_kernel = 0; 255 in_kernel = 0;
238 esp = regs->esp; 256 esp = regs->esp;
239 ss = regs->xss & 0xffff; 257 ss = regs->xss & 0xffff;
@@ -333,6 +351,8 @@ void die(const char * str, struct pt_regs * regs, long err)
333 static int die_counter; 351 static int die_counter;
334 unsigned long flags; 352 unsigned long flags;
335 353
354 oops_enter();
355
336 if (die.lock_owner != raw_smp_processor_id()) { 356 if (die.lock_owner != raw_smp_processor_id()) {
337 console_verbose(); 357 console_verbose();
338 spin_lock_irqsave(&die.lock, flags); 358 spin_lock_irqsave(&die.lock, flags);
@@ -365,8 +385,12 @@ void die(const char * str, struct pt_regs * regs, long err)
365#endif 385#endif
366 if (nl) 386 if (nl)
367 printk("\n"); 387 printk("\n");
368 notify_die(DIE_OOPS, (char *)str, regs, err, 255, SIGSEGV); 388 if (notify_die(DIE_OOPS, str, regs, err,
369 show_registers(regs); 389 current->thread.trap_no, SIGSEGV) !=
390 NOTIFY_STOP)
391 show_registers(regs);
392 else
393 regs = NULL;
370 } else 394 } else
371 printk(KERN_EMERG "Recursive die() failure, output suppressed\n"); 395 printk(KERN_EMERG "Recursive die() failure, output suppressed\n");
372 396
@@ -374,6 +398,9 @@ void die(const char * str, struct pt_regs * regs, long err)
374 die.lock_owner = -1; 398 die.lock_owner = -1;
375 spin_unlock_irqrestore(&die.lock, flags); 399 spin_unlock_irqrestore(&die.lock, flags);
376 400
401 if (!regs)
402 return;
403
377 if (kexec_should_crash(current)) 404 if (kexec_should_crash(current))
378 crash_kexec(regs); 405 crash_kexec(regs);
379 406
@@ -385,6 +412,7 @@ void die(const char * str, struct pt_regs * regs, long err)
385 ssleep(5); 412 ssleep(5);
386 panic("Fatal exception"); 413 panic("Fatal exception");
387 } 414 }
415 oops_exit();
388 do_exit(SIGSEGV); 416 do_exit(SIGSEGV);
389} 417}
390 418
@@ -601,7 +629,7 @@ static DEFINE_SPINLOCK(nmi_print_lock);
601 629
602void die_nmi (struct pt_regs *regs, const char *msg) 630void die_nmi (struct pt_regs *regs, const char *msg)
603{ 631{
604 if (notify_die(DIE_NMIWATCHDOG, msg, regs, 0, 0, SIGINT) == 632 if (notify_die(DIE_NMIWATCHDOG, msg, regs, 0, 2, SIGINT) ==
605 NOTIFY_STOP) 633 NOTIFY_STOP)
606 return; 634 return;
607 635
@@ -623,7 +651,7 @@ void die_nmi (struct pt_regs *regs, const char *msg)
623 /* If we are in kernel we are probably nested up pretty bad 651 /* If we are in kernel we are probably nested up pretty bad
624 * and might aswell get out now while we still can. 652 * and might aswell get out now while we still can.
625 */ 653 */
626 if (!user_mode(regs)) { 654 if (!user_mode_vm(regs)) {
627 current->thread.trap_no = 2; 655 current->thread.trap_no = 2;
628 crash_kexec(regs); 656 crash_kexec(regs);
629 } 657 }
@@ -640,7 +668,7 @@ static void default_do_nmi(struct pt_regs * regs)
640 reason = get_nmi_reason(); 668 reason = get_nmi_reason();
641 669
642 if (!(reason & 0xc0)) { 670 if (!(reason & 0xc0)) {
643 if (notify_die(DIE_NMI_IPI, "nmi_ipi", regs, reason, 0, SIGINT) 671 if (notify_die(DIE_NMI_IPI, "nmi_ipi", regs, reason, 2, SIGINT)
644 == NOTIFY_STOP) 672 == NOTIFY_STOP)
645 return; 673 return;
646#ifdef CONFIG_X86_LOCAL_APIC 674#ifdef CONFIG_X86_LOCAL_APIC
@@ -656,7 +684,7 @@ static void default_do_nmi(struct pt_regs * regs)
656 unknown_nmi_error(reason, regs); 684 unknown_nmi_error(reason, regs);
657 return; 685 return;
658 } 686 }
659 if (notify_die(DIE_NMI, "nmi", regs, reason, 0, SIGINT) == NOTIFY_STOP) 687 if (notify_die(DIE_NMI, "nmi", regs, reason, 2, SIGINT) == NOTIFY_STOP)
660 return; 688 return;
661 if (reason & 0x80) 689 if (reason & 0x80)
662 mem_parity_error(reason, regs); 690 mem_parity_error(reason, regs);
@@ -694,6 +722,7 @@ fastcall void do_nmi(struct pt_regs * regs, long error_code)
694 722
695void set_nmi_callback(nmi_callback_t callback) 723void set_nmi_callback(nmi_callback_t callback)
696{ 724{
725 vmalloc_sync_all();
697 rcu_assign_pointer(nmi_callback, callback); 726 rcu_assign_pointer(nmi_callback, callback);
698} 727}
699EXPORT_SYMBOL_GPL(set_nmi_callback); 728EXPORT_SYMBOL_GPL(set_nmi_callback);
@@ -1164,6 +1193,6 @@ void __init trap_init(void)
1164static int __init kstack_setup(char *s) 1193static int __init kstack_setup(char *s)
1165{ 1194{
1166 kstack_depth_to_print = simple_strtoul(s, NULL, 0); 1195 kstack_depth_to_print = simple_strtoul(s, NULL, 0);
1167 return 0; 1196 return 1;
1168} 1197}
1169__setup("kstack=", kstack_setup); 1198__setup("kstack=", kstack_setup);
diff --git a/arch/i386/kernel/vm86.c b/arch/i386/kernel/vm86.c
index f51c894a7da5..aee14fafd13d 100644
--- a/arch/i386/kernel/vm86.c
+++ b/arch/i386/kernel/vm86.c
@@ -43,6 +43,7 @@
43#include <linux/smp_lock.h> 43#include <linux/smp_lock.h>
44#include <linux/highmem.h> 44#include <linux/highmem.h>
45#include <linux/ptrace.h> 45#include <linux/ptrace.h>
46#include <linux/audit.h>
46 47
47#include <asm/uaccess.h> 48#include <asm/uaccess.h>
48#include <asm/io.h> 49#include <asm/io.h>
@@ -252,6 +253,7 @@ out:
252static void do_sys_vm86(struct kernel_vm86_struct *info, struct task_struct *tsk) 253static void do_sys_vm86(struct kernel_vm86_struct *info, struct task_struct *tsk)
253{ 254{
254 struct tss_struct *tss; 255 struct tss_struct *tss;
256 long eax;
255/* 257/*
256 * make sure the vm86() system call doesn't try to do anything silly 258 * make sure the vm86() system call doesn't try to do anything silly
257 */ 259 */
@@ -305,13 +307,19 @@ static void do_sys_vm86(struct kernel_vm86_struct *info, struct task_struct *tsk
305 tsk->thread.screen_bitmap = info->screen_bitmap; 307 tsk->thread.screen_bitmap = info->screen_bitmap;
306 if (info->flags & VM86_SCREEN_BITMAP) 308 if (info->flags & VM86_SCREEN_BITMAP)
307 mark_screen_rdonly(tsk->mm); 309 mark_screen_rdonly(tsk->mm);
310 __asm__ __volatile__("xorl %eax,%eax; movl %eax,%fs; movl %eax,%gs\n\t");
311 __asm__ __volatile__("movl %%eax, %0\n" :"=r"(eax));
312
313 /*call audit_syscall_exit since we do not exit via the normal paths */
314 if (unlikely(current->audit_context))
315 audit_syscall_exit(current, AUDITSC_RESULT(eax), eax);
316
308 __asm__ __volatile__( 317 __asm__ __volatile__(
309 "xorl %%eax,%%eax; movl %%eax,%%fs; movl %%eax,%%gs\n\t"
310 "movl %0,%%esp\n\t" 318 "movl %0,%%esp\n\t"
311 "movl %1,%%ebp\n\t" 319 "movl %1,%%ebp\n\t"
312 "jmp resume_userspace" 320 "jmp resume_userspace"
313 : /* no outputs */ 321 : /* no outputs */
314 :"r" (&info->regs), "r" (task_thread_info(tsk)) : "ax"); 322 :"r" (&info->regs), "r" (task_thread_info(tsk)));
315 /* we never return here */ 323 /* we never return here */
316} 324}
317 325
diff --git a/arch/i386/kernel/vmlinux.lds.S b/arch/i386/kernel/vmlinux.lds.S
index 4710195b6b74..8831303a473f 100644
--- a/arch/i386/kernel/vmlinux.lds.S
+++ b/arch/i386/kernel/vmlinux.lds.S
@@ -7,6 +7,7 @@
7#include <asm-generic/vmlinux.lds.h> 7#include <asm-generic/vmlinux.lds.h>
8#include <asm/thread_info.h> 8#include <asm/thread_info.h>
9#include <asm/page.h> 9#include <asm/page.h>
10#include <asm/cache.h>
10 11
11OUTPUT_FORMAT("elf32-i386", "elf32-i386", "elf32-i386") 12OUTPUT_FORMAT("elf32-i386", "elf32-i386", "elf32-i386")
12OUTPUT_ARCH(i386) 13OUTPUT_ARCH(i386)
@@ -68,6 +69,26 @@ SECTIONS
68 *(.data.init_task) 69 *(.data.init_task)
69 } 70 }
70 71
72 /* might get freed after init */
73 . = ALIGN(4096);
74 __smp_alt_begin = .;
75 __smp_alt_instructions = .;
76 .smp_altinstructions : AT(ADDR(.smp_altinstructions) - LOAD_OFFSET) {
77 *(.smp_altinstructions)
78 }
79 __smp_alt_instructions_end = .;
80 . = ALIGN(4);
81 __smp_locks = .;
82 .smp_locks : AT(ADDR(.smp_locks) - LOAD_OFFSET) {
83 *(.smp_locks)
84 }
85 __smp_locks_end = .;
86 .smp_altinstr_replacement : AT(ADDR(.smp_altinstr_replacement) - LOAD_OFFSET) {
87 *(.smp_altinstr_replacement)
88 }
89 . = ALIGN(4096);
90 __smp_alt_end = .;
91
71 /* will be freed after init */ 92 /* will be freed after init */
72 . = ALIGN(4096); /* Init code and data */ 93 . = ALIGN(4096); /* Init code and data */
73 __init_begin = .; 94 __init_begin = .;
@@ -115,7 +136,7 @@ SECTIONS
115 __initramfs_start = .; 136 __initramfs_start = .;
116 .init.ramfs : AT(ADDR(.init.ramfs) - LOAD_OFFSET) { *(.init.ramfs) } 137 .init.ramfs : AT(ADDR(.init.ramfs) - LOAD_OFFSET) { *(.init.ramfs) }
117 __initramfs_end = .; 138 __initramfs_end = .;
118 . = ALIGN(32); 139 . = ALIGN(L1_CACHE_BYTES);
119 __per_cpu_start = .; 140 __per_cpu_start = .;
120 .data.percpu : AT(ADDR(.data.percpu) - LOAD_OFFSET) { *(.data.percpu) } 141 .data.percpu : AT(ADDR(.data.percpu) - LOAD_OFFSET) { *(.data.percpu) }
121 __per_cpu_end = .; 142 __per_cpu_end = .;
diff --git a/arch/i386/kernel/vsyscall-sigreturn.S b/arch/i386/kernel/vsyscall-sigreturn.S
index fadb5bc3c374..a92262f41659 100644
--- a/arch/i386/kernel/vsyscall-sigreturn.S
+++ b/arch/i386/kernel/vsyscall-sigreturn.S
@@ -44,7 +44,7 @@ __kernel_rt_sigreturn:
44.LSTARTCIEDLSI1: 44.LSTARTCIEDLSI1:
45 .long 0 /* CIE ID */ 45 .long 0 /* CIE ID */
46 .byte 1 /* Version number */ 46 .byte 1 /* Version number */
47 .string "zR" /* NUL-terminated augmentation string */ 47 .string "zRS" /* NUL-terminated augmentation string */
48 .uleb128 1 /* Code alignment factor */ 48 .uleb128 1 /* Code alignment factor */
49 .sleb128 -4 /* Data alignment factor */ 49 .sleb128 -4 /* Data alignment factor */
50 .byte 8 /* Return address register column */ 50 .byte 8 /* Return address register column */
diff --git a/arch/i386/kernel/vsyscall-sysenter.S b/arch/i386/kernel/vsyscall-sysenter.S
index 76b728159403..3b62baa6a371 100644
--- a/arch/i386/kernel/vsyscall-sysenter.S
+++ b/arch/i386/kernel/vsyscall-sysenter.S
@@ -21,6 +21,9 @@
21 * instruction clobbers %esp, the user's %esp won't even survive entry 21 * instruction clobbers %esp, the user's %esp won't even survive entry
22 * into the kernel. We store %esp in %ebp. Code in entry.S must fetch 22 * into the kernel. We store %esp in %ebp. Code in entry.S must fetch
23 * arg6 from the stack. 23 * arg6 from the stack.
24 *
25 * You can not use this vsyscall for the clone() syscall because the
26 * three dwords on the parent stack do not get copied to the child.
24 */ 27 */
25 .text 28 .text
26 .globl __kernel_vsyscall 29 .globl __kernel_vsyscall
diff --git a/arch/i386/mach-es7000/es7000.h b/arch/i386/mach-es7000/es7000.h
index f1e3204f5dec..80566ca4a80a 100644
--- a/arch/i386/mach-es7000/es7000.h
+++ b/arch/i386/mach-es7000/es7000.h
@@ -83,6 +83,7 @@ struct es7000_oem_table {
83 struct psai psai; 83 struct psai psai;
84}; 84};
85 85
86#ifdef CONFIG_ACPI
86struct acpi_table_sdt { 87struct acpi_table_sdt {
87 unsigned long pa; 88 unsigned long pa;
88 unsigned long count; 89 unsigned long count;
@@ -99,6 +100,9 @@ struct oem_table {
99 u32 OEMTableSize; 100 u32 OEMTableSize;
100}; 101};
101 102
103extern int find_unisys_acpi_oem_table(unsigned long *oem_addr);
104#endif
105
102struct mip_reg { 106struct mip_reg {
103 unsigned long long off_0; 107 unsigned long long off_0;
104 unsigned long long off_8; 108 unsigned long long off_8;
@@ -114,7 +118,6 @@ struct mip_reg {
114#define MIP_FUNC(VALUE) (VALUE & 0xff) 118#define MIP_FUNC(VALUE) (VALUE & 0xff)
115 119
116extern int parse_unisys_oem (char *oemptr); 120extern int parse_unisys_oem (char *oemptr);
117extern int find_unisys_acpi_oem_table(unsigned long *oem_addr);
118extern void setup_unisys(void); 121extern void setup_unisys(void);
119extern int es7000_start_cpu(int cpu, unsigned long eip); 122extern int es7000_start_cpu(int cpu, unsigned long eip);
120extern void es7000_sw_apic(void); 123extern void es7000_sw_apic(void);
diff --git a/arch/i386/mach-es7000/es7000plat.c b/arch/i386/mach-es7000/es7000plat.c
index a9ab0644f403..3d0fc853516d 100644
--- a/arch/i386/mach-es7000/es7000plat.c
+++ b/arch/i386/mach-es7000/es7000plat.c
@@ -51,8 +51,6 @@ struct mip_reg *host_reg;
51int mip_port; 51int mip_port;
52unsigned long mip_addr, host_addr; 52unsigned long mip_addr, host_addr;
53 53
54#if defined(CONFIG_X86_IO_APIC) && defined(CONFIG_ACPI)
55
56/* 54/*
57 * GSI override for ES7000 platforms. 55 * GSI override for ES7000 platforms.
58 */ 56 */
@@ -76,8 +74,6 @@ es7000_rename_gsi(int ioapic, int gsi)
76 return gsi; 74 return gsi;
77} 75}
78 76
79#endif /* (CONFIG_X86_IO_APIC) && (CONFIG_ACPI) */
80
81void __init 77void __init
82setup_unisys(void) 78setup_unisys(void)
83{ 79{
@@ -160,6 +156,7 @@ parse_unisys_oem (char *oemptr)
160 return es7000_plat; 156 return es7000_plat;
161} 157}
162 158
159#ifdef CONFIG_ACPI
163int __init 160int __init
164find_unisys_acpi_oem_table(unsigned long *oem_addr) 161find_unisys_acpi_oem_table(unsigned long *oem_addr)
165{ 162{
@@ -212,6 +209,7 @@ find_unisys_acpi_oem_table(unsigned long *oem_addr)
212 } 209 }
213 return -1; 210 return -1;
214} 211}
212#endif
215 213
216static void 214static void
217es7000_spin(int n) 215es7000_spin(int n)
diff --git a/arch/i386/mach-visws/reboot.c b/arch/i386/mach-visws/reboot.c
index 5d73e042ed0a..99332abfad42 100644
--- a/arch/i386/mach-visws/reboot.c
+++ b/arch/i386/mach-visws/reboot.c
@@ -1,7 +1,6 @@
1#include <linux/module.h> 1#include <linux/module.h>
2#include <linux/smp.h> 2#include <linux/smp.h>
3#include <linux/delay.h> 3#include <linux/delay.h>
4#include <linux/platform.h>
5 4
6#include <asm/io.h> 5#include <asm/io.h>
7#include "piix4.h" 6#include "piix4.h"
diff --git a/arch/i386/mach-voyager/voyager_smp.c b/arch/i386/mach-voyager/voyager_smp.c
index 8165626a5c30..70e560a1b79a 100644
--- a/arch/i386/mach-voyager/voyager_smp.c
+++ b/arch/i386/mach-voyager/voyager_smp.c
@@ -1700,7 +1700,7 @@ after_handle_vic_irq(unsigned int irq)
1700 1700
1701 printk("VOYAGER SMP: CPU%d lost interrupt %d\n", 1701 printk("VOYAGER SMP: CPU%d lost interrupt %d\n",
1702 cpu, irq); 1702 cpu, irq);
1703 for_each_cpu(real_cpu, mask) { 1703 for_each_possible_cpu(real_cpu, mask) {
1704 1704
1705 outb(VIC_CPU_MASQUERADE_ENABLE | real_cpu, 1705 outb(VIC_CPU_MASQUERADE_ENABLE | real_cpu,
1706 VIC_PROCESSOR_ID); 1706 VIC_PROCESSOR_ID);
diff --git a/arch/i386/mm/discontig.c b/arch/i386/mm/discontig.c
index c4af9638dbfa..fe6eb901326e 100644
--- a/arch/i386/mm/discontig.c
+++ b/arch/i386/mm/discontig.c
@@ -31,6 +31,7 @@
31#include <linux/nodemask.h> 31#include <linux/nodemask.h>
32#include <linux/module.h> 32#include <linux/module.h>
33#include <linux/kexec.h> 33#include <linux/kexec.h>
34#include <linux/pfn.h>
34 35
35#include <asm/e820.h> 36#include <asm/e820.h>
36#include <asm/setup.h> 37#include <asm/setup.h>
@@ -352,17 +353,6 @@ void __init zone_sizes_init(void)
352{ 353{
353 int nid; 354 int nid;
354 355
355 /*
356 * Insert nodes into pgdat_list backward so they appear in order.
357 * Clobber node 0's links and NULL out pgdat_list before starting.
358 */
359 pgdat_list = NULL;
360 for (nid = MAX_NUMNODES - 1; nid >= 0; nid--) {
361 if (!node_online(nid))
362 continue;
363 NODE_DATA(nid)->pgdat_next = pgdat_list;
364 pgdat_list = NODE_DATA(nid);
365 }
366 356
367 for_each_online_node(nid) { 357 for_each_online_node(nid) {
368 unsigned long zones_size[MAX_NR_ZONES] = {0, 0, 0}; 358 unsigned long zones_size[MAX_NR_ZONES] = {0, 0, 0};
diff --git a/arch/i386/mm/fault.c b/arch/i386/mm/fault.c
index cf572d9a3b6e..7f0fcf219a26 100644
--- a/arch/i386/mm/fault.c
+++ b/arch/i386/mm/fault.c
@@ -214,6 +214,68 @@ static noinline void force_sig_info_fault(int si_signo, int si_code,
214 214
215fastcall void do_invalid_op(struct pt_regs *, unsigned long); 215fastcall void do_invalid_op(struct pt_regs *, unsigned long);
216 216
217static inline pmd_t *vmalloc_sync_one(pgd_t *pgd, unsigned long address)
218{
219 unsigned index = pgd_index(address);
220 pgd_t *pgd_k;
221 pud_t *pud, *pud_k;
222 pmd_t *pmd, *pmd_k;
223
224 pgd += index;
225 pgd_k = init_mm.pgd + index;
226
227 if (!pgd_present(*pgd_k))
228 return NULL;
229
230 /*
231 * set_pgd(pgd, *pgd_k); here would be useless on PAE
232 * and redundant with the set_pmd() on non-PAE. As would
233 * set_pud.
234 */
235
236 pud = pud_offset(pgd, address);
237 pud_k = pud_offset(pgd_k, address);
238 if (!pud_present(*pud_k))
239 return NULL;
240
241 pmd = pmd_offset(pud, address);
242 pmd_k = pmd_offset(pud_k, address);
243 if (!pmd_present(*pmd_k))
244 return NULL;
245 if (!pmd_present(*pmd))
246 set_pmd(pmd, *pmd_k);
247 else
248 BUG_ON(pmd_page(*pmd) != pmd_page(*pmd_k));
249 return pmd_k;
250}
251
252/*
253 * Handle a fault on the vmalloc or module mapping area
254 *
255 * This assumes no large pages in there.
256 */
257static inline int vmalloc_fault(unsigned long address)
258{
259 unsigned long pgd_paddr;
260 pmd_t *pmd_k;
261 pte_t *pte_k;
262 /*
263 * Synchronize this task's top level page-table
264 * with the 'reference' page table.
265 *
266 * Do _not_ use "current" here. We might be inside
267 * an interrupt in the middle of a task switch..
268 */
269 pgd_paddr = read_cr3();
270 pmd_k = vmalloc_sync_one(__va(pgd_paddr), address);
271 if (!pmd_k)
272 return -1;
273 pte_k = pte_offset_kernel(pmd_k, address);
274 if (!pte_present(*pte_k))
275 return -1;
276 return 0;
277}
278
217/* 279/*
218 * This routine handles page faults. It determines the address, 280 * This routine handles page faults. It determines the address,
219 * and the problem, and then passes it off to one of the appropriate 281 * and the problem, and then passes it off to one of the appropriate
@@ -223,6 +285,8 @@ fastcall void do_invalid_op(struct pt_regs *, unsigned long);
223 * bit 0 == 0 means no page found, 1 means protection fault 285 * bit 0 == 0 means no page found, 1 means protection fault
224 * bit 1 == 0 means read, 1 means write 286 * bit 1 == 0 means read, 1 means write
225 * bit 2 == 0 means kernel, 1 means user-mode 287 * bit 2 == 0 means kernel, 1 means user-mode
288 * bit 3 == 1 means use of reserved bit detected
289 * bit 4 == 1 means fault was an instruction fetch
226 */ 290 */
227fastcall void __kprobes do_page_fault(struct pt_regs *regs, 291fastcall void __kprobes do_page_fault(struct pt_regs *regs,
228 unsigned long error_code) 292 unsigned long error_code)
@@ -237,13 +301,6 @@ fastcall void __kprobes do_page_fault(struct pt_regs *regs,
237 /* get the address */ 301 /* get the address */
238 address = read_cr2(); 302 address = read_cr2();
239 303
240 if (notify_die(DIE_PAGE_FAULT, "page fault", regs, error_code, 14,
241 SIGSEGV) == NOTIFY_STOP)
242 return;
243 /* It's safe to allow irq's after cr2 has been saved */
244 if (regs->eflags & (X86_EFLAGS_IF|VM_MASK))
245 local_irq_enable();
246
247 tsk = current; 304 tsk = current;
248 305
249 si_code = SEGV_MAPERR; 306 si_code = SEGV_MAPERR;
@@ -259,17 +316,29 @@ fastcall void __kprobes do_page_fault(struct pt_regs *regs,
259 * 316 *
260 * This verifies that the fault happens in kernel space 317 * This verifies that the fault happens in kernel space
261 * (error_code & 4) == 0, and that the fault was not a 318 * (error_code & 4) == 0, and that the fault was not a
262 * protection error (error_code & 1) == 0. 319 * protection error (error_code & 9) == 0.
263 */ 320 */
264 if (unlikely(address >= TASK_SIZE)) { 321 if (unlikely(address >= TASK_SIZE)) {
265 if (!(error_code & 5)) 322 if (!(error_code & 0x0000000d) && vmalloc_fault(address) >= 0)
266 goto vmalloc_fault; 323 return;
267 /* 324 if (notify_die(DIE_PAGE_FAULT, "page fault", regs, error_code, 14,
325 SIGSEGV) == NOTIFY_STOP)
326 return;
327 /*
268 * Don't take the mm semaphore here. If we fixup a prefetch 328 * Don't take the mm semaphore here. If we fixup a prefetch
269 * fault we could otherwise deadlock. 329 * fault we could otherwise deadlock.
270 */ 330 */
271 goto bad_area_nosemaphore; 331 goto bad_area_nosemaphore;
272 } 332 }
333
334 if (notify_die(DIE_PAGE_FAULT, "page fault", regs, error_code, 14,
335 SIGSEGV) == NOTIFY_STOP)
336 return;
337
338 /* It's safe to allow irq's after cr2 has been saved and the vmalloc
339 fault has been handled. */
340 if (regs->eflags & (X86_EFLAGS_IF|VM_MASK))
341 local_irq_enable();
273 342
274 mm = tsk->mm; 343 mm = tsk->mm;
275 344
@@ -440,24 +509,31 @@ no_context:
440 509
441 bust_spinlocks(1); 510 bust_spinlocks(1);
442 511
443#ifdef CONFIG_X86_PAE 512 if (oops_may_print()) {
444 if (error_code & 16) { 513 #ifdef CONFIG_X86_PAE
445 pte_t *pte = lookup_address(address); 514 if (error_code & 16) {
515 pte_t *pte = lookup_address(address);
446 516
447 if (pte && pte_present(*pte) && !pte_exec_kernel(*pte)) 517 if (pte && pte_present(*pte) && !pte_exec_kernel(*pte))
448 printk(KERN_CRIT "kernel tried to execute NX-protected page - exploit attempt? (uid: %d)\n", current->uid); 518 printk(KERN_CRIT "kernel tried to execute "
519 "NX-protected page - exploit attempt? "
520 "(uid: %d)\n", current->uid);
521 }
522 #endif
523 if (address < PAGE_SIZE)
524 printk(KERN_ALERT "BUG: unable to handle kernel NULL "
525 "pointer dereference");
526 else
527 printk(KERN_ALERT "BUG: unable to handle kernel paging"
528 " request");
529 printk(" at virtual address %08lx\n",address);
530 printk(KERN_ALERT " printing eip:\n");
531 printk("%08lx\n", regs->eip);
449 } 532 }
450#endif
451 if (address < PAGE_SIZE)
452 printk(KERN_ALERT "Unable to handle kernel NULL pointer dereference");
453 else
454 printk(KERN_ALERT "Unable to handle kernel paging request");
455 printk(" at virtual address %08lx\n",address);
456 printk(KERN_ALERT " printing eip:\n");
457 printk("%08lx\n", regs->eip);
458 page = read_cr3(); 533 page = read_cr3();
459 page = ((unsigned long *) __va(page))[address >> 22]; 534 page = ((unsigned long *) __va(page))[address >> 22];
460 printk(KERN_ALERT "*pde = %08lx\n", page); 535 if (oops_may_print())
536 printk(KERN_ALERT "*pde = %08lx\n", page);
461 /* 537 /*
462 * We must not directly access the pte in the highpte 538 * We must not directly access the pte in the highpte
463 * case, the page table might be allocated in highmem. 539 * case, the page table might be allocated in highmem.
@@ -465,7 +541,7 @@ no_context:
465 * it's allocated already. 541 * it's allocated already.
466 */ 542 */
467#ifndef CONFIG_HIGHPTE 543#ifndef CONFIG_HIGHPTE
468 if (page & 1) { 544 if ((page & 1) && oops_may_print()) {
469 page &= PAGE_MASK; 545 page &= PAGE_MASK;
470 address &= 0x003ff000; 546 address &= 0x003ff000;
471 page = ((unsigned long *) __va(page))[address >> PAGE_SHIFT]; 547 page = ((unsigned long *) __va(page))[address >> PAGE_SHIFT];
@@ -510,51 +586,41 @@ do_sigbus:
510 tsk->thread.error_code = error_code; 586 tsk->thread.error_code = error_code;
511 tsk->thread.trap_no = 14; 587 tsk->thread.trap_no = 14;
512 force_sig_info_fault(SIGBUS, BUS_ADRERR, address, tsk); 588 force_sig_info_fault(SIGBUS, BUS_ADRERR, address, tsk);
513 return; 589}
514
515vmalloc_fault:
516 {
517 /*
518 * Synchronize this task's top level page-table
519 * with the 'reference' page table.
520 *
521 * Do _not_ use "tsk" here. We might be inside
522 * an interrupt in the middle of a task switch..
523 */
524 int index = pgd_index(address);
525 unsigned long pgd_paddr;
526 pgd_t *pgd, *pgd_k;
527 pud_t *pud, *pud_k;
528 pmd_t *pmd, *pmd_k;
529 pte_t *pte_k;
530
531 pgd_paddr = read_cr3();
532 pgd = index + (pgd_t *)__va(pgd_paddr);
533 pgd_k = init_mm.pgd + index;
534
535 if (!pgd_present(*pgd_k))
536 goto no_context;
537
538 /*
539 * set_pgd(pgd, *pgd_k); here would be useless on PAE
540 * and redundant with the set_pmd() on non-PAE. As would
541 * set_pud.
542 */
543 590
544 pud = pud_offset(pgd, address); 591#ifndef CONFIG_X86_PAE
545 pud_k = pud_offset(pgd_k, address); 592void vmalloc_sync_all(void)
546 if (!pud_present(*pud_k)) 593{
547 goto no_context; 594 /*
548 595 * Note that races in the updates of insync and start aren't
549 pmd = pmd_offset(pud, address); 596 * problematic: insync can only get set bits added, and updates to
550 pmd_k = pmd_offset(pud_k, address); 597 * start are only improving performance (without affecting correctness
551 if (!pmd_present(*pmd_k)) 598 * if undone).
552 goto no_context; 599 */
553 set_pmd(pmd, *pmd_k); 600 static DECLARE_BITMAP(insync, PTRS_PER_PGD);
601 static unsigned long start = TASK_SIZE;
602 unsigned long address;
554 603
555 pte_k = pte_offset_kernel(pmd_k, address); 604 BUILD_BUG_ON(TASK_SIZE & ~PGDIR_MASK);
556 if (!pte_present(*pte_k)) 605 for (address = start; address >= TASK_SIZE; address += PGDIR_SIZE) {
557 goto no_context; 606 if (!test_bit(pgd_index(address), insync)) {
558 return; 607 unsigned long flags;
608 struct page *page;
609
610 spin_lock_irqsave(&pgd_lock, flags);
611 for (page = pgd_list; page; page =
612 (struct page *)page->index)
613 if (!vmalloc_sync_one(page_address(page),
614 address)) {
615 BUG_ON(page != pgd_list);
616 break;
617 }
618 spin_unlock_irqrestore(&pgd_lock, flags);
619 if (!page)
620 set_bit(pgd_index(address), insync);
621 }
622 if (address == start && test_bit(pgd_index(address), insync))
623 start = address + PGDIR_SIZE;
559 } 624 }
560} 625}
626#endif
diff --git a/arch/i386/mm/hugetlbpage.c b/arch/i386/mm/hugetlbpage.c
index d524127c9afc..a7d891585411 100644
--- a/arch/i386/mm/hugetlbpage.c
+++ b/arch/i386/mm/hugetlbpage.c
@@ -48,18 +48,6 @@ pte_t *huge_pte_offset(struct mm_struct *mm, unsigned long addr)
48 return (pte_t *) pmd; 48 return (pte_t *) pmd;
49} 49}
50 50
51/*
52 * This function checks for proper alignment of input addr and len parameters.
53 */
54int is_aligned_hugepage_range(unsigned long addr, unsigned long len)
55{
56 if (len & ~HPAGE_MASK)
57 return -EINVAL;
58 if (addr & ~HPAGE_MASK)
59 return -EINVAL;
60 return 0;
61}
62
63#if 0 /* This is just for testing */ 51#if 0 /* This is just for testing */
64struct page * 52struct page *
65follow_huge_addr(struct mm_struct *mm, unsigned long address, int write) 53follow_huge_addr(struct mm_struct *mm, unsigned long address, int write)
diff --git a/arch/i386/mm/init.c b/arch/i386/mm/init.c
index 2700f01994ba..9f66ac582a8b 100644
--- a/arch/i386/mm/init.c
+++ b/arch/i386/mm/init.c
@@ -270,7 +270,7 @@ static void __init permanent_kmaps_init(pgd_t *pgd_base)
270 270
271static void __meminit free_new_highpage(struct page *page) 271static void __meminit free_new_highpage(struct page *page)
272{ 272{
273 set_page_count(page, 1); 273 init_page_count(page);
274 __free_page(page); 274 __free_page(page);
275 totalhigh_pages++; 275 totalhigh_pages++;
276} 276}
@@ -720,21 +720,6 @@ static int noinline do_test_wp_bit(void)
720 return flag; 720 return flag;
721} 721}
722 722
723void free_initmem(void)
724{
725 unsigned long addr;
726
727 addr = (unsigned long)(&__init_begin);
728 for (; addr < (unsigned long)(&__init_end); addr += PAGE_SIZE) {
729 ClearPageReserved(virt_to_page(addr));
730 set_page_count(virt_to_page(addr), 1);
731 memset((void *)addr, 0xcc, PAGE_SIZE);
732 free_page(addr);
733 totalram_pages++;
734 }
735 printk (KERN_INFO "Freeing unused kernel memory: %dk freed\n", (__init_end - __init_begin) >> 10);
736}
737
738#ifdef CONFIG_DEBUG_RODATA 723#ifdef CONFIG_DEBUG_RODATA
739 724
740extern char __start_rodata, __end_rodata; 725extern char __start_rodata, __end_rodata;
@@ -758,17 +743,31 @@ void mark_rodata_ro(void)
758} 743}
759#endif 744#endif
760 745
746void free_init_pages(char *what, unsigned long begin, unsigned long end)
747{
748 unsigned long addr;
749
750 for (addr = begin; addr < end; addr += PAGE_SIZE) {
751 ClearPageReserved(virt_to_page(addr));
752 init_page_count(virt_to_page(addr));
753 memset((void *)addr, 0xcc, PAGE_SIZE);
754 free_page(addr);
755 totalram_pages++;
756 }
757 printk(KERN_INFO "Freeing %s: %ldk freed\n", what, (end - begin) >> 10);
758}
759
760void free_initmem(void)
761{
762 free_init_pages("unused kernel memory",
763 (unsigned long)(&__init_begin),
764 (unsigned long)(&__init_end));
765}
761 766
762#ifdef CONFIG_BLK_DEV_INITRD 767#ifdef CONFIG_BLK_DEV_INITRD
763void free_initrd_mem(unsigned long start, unsigned long end) 768void free_initrd_mem(unsigned long start, unsigned long end)
764{ 769{
765 if (start < end) 770 free_init_pages("initrd memory", start, end);
766 printk (KERN_INFO "Freeing initrd memory: %ldk freed\n", (end - start) >> 10);
767 for (; start < end; start += PAGE_SIZE) {
768 ClearPageReserved(virt_to_page(start));
769 set_page_count(virt_to_page(start), 1);
770 free_page(start);
771 totalram_pages++;
772 }
773} 771}
774#endif 772#endif
773
diff --git a/arch/i386/mm/pageattr.c b/arch/i386/mm/pageattr.c
index d0cadb33b54c..92c3d9f0e731 100644
--- a/arch/i386/mm/pageattr.c
+++ b/arch/i386/mm/pageattr.c
@@ -51,6 +51,13 @@ static struct page *split_large_page(unsigned long address, pgprot_t prot,
51 if (!base) 51 if (!base)
52 return NULL; 52 return NULL;
53 53
54 /*
55 * page_private is used to track the number of entries in
56 * the page table page that have non standard attributes.
57 */
58 SetPagePrivate(base);
59 page_private(base) = 0;
60
54 address = __pa(address); 61 address = __pa(address);
55 addr = address & LARGE_PAGE_MASK; 62 addr = address & LARGE_PAGE_MASK;
56 pbase = (pte_t *)page_address(base); 63 pbase = (pte_t *)page_address(base);
@@ -143,11 +150,12 @@ __change_page_attr(struct page *page, pgprot_t prot)
143 return -ENOMEM; 150 return -ENOMEM;
144 set_pmd_pte(kpte,address,mk_pte(split, ref_prot)); 151 set_pmd_pte(kpte,address,mk_pte(split, ref_prot));
145 kpte_page = split; 152 kpte_page = split;
146 } 153 }
147 get_page(kpte_page); 154 page_private(kpte_page)++;
148 } else if ((pte_val(*kpte) & _PAGE_PSE) == 0) { 155 } else if ((pte_val(*kpte) & _PAGE_PSE) == 0) {
149 set_pte_atomic(kpte, mk_pte(page, PAGE_KERNEL)); 156 set_pte_atomic(kpte, mk_pte(page, PAGE_KERNEL));
150 __put_page(kpte_page); 157 BUG_ON(page_private(kpte_page) == 0);
158 page_private(kpte_page)--;
151 } else 159 } else
152 BUG(); 160 BUG();
153 161
@@ -157,10 +165,8 @@ __change_page_attr(struct page *page, pgprot_t prot)
157 * replace it with a largepage. 165 * replace it with a largepage.
158 */ 166 */
159 if (!PageReserved(kpte_page)) { 167 if (!PageReserved(kpte_page)) {
160 /* memleak and potential failed 2M page regeneration */ 168 if (cpu_has_pse && (page_private(kpte_page) == 0)) {
161 BUG_ON(!page_count(kpte_page)); 169 ClearPagePrivate(kpte_page);
162
163 if (cpu_has_pse && (page_count(kpte_page) == 1)) {
164 list_add(&kpte_page->lru, &df_list); 170 list_add(&kpte_page->lru, &df_list);
165 revert_page(kpte_page, address); 171 revert_page(kpte_page, address);
166 } 172 }
diff --git a/arch/i386/mm/pgtable.c b/arch/i386/mm/pgtable.c
index 9db3242103be..2889567e21a1 100644
--- a/arch/i386/mm/pgtable.c
+++ b/arch/i386/mm/pgtable.c
@@ -36,7 +36,7 @@ void show_mem(void)
36 printk(KERN_INFO "Mem-info:\n"); 36 printk(KERN_INFO "Mem-info:\n");
37 show_free_areas(); 37 show_free_areas();
38 printk(KERN_INFO "Free swap: %6ldkB\n", nr_swap_pages<<(PAGE_SHIFT-10)); 38 printk(KERN_INFO "Free swap: %6ldkB\n", nr_swap_pages<<(PAGE_SHIFT-10));
39 for_each_pgdat(pgdat) { 39 for_each_online_pgdat(pgdat) {
40 pgdat_resize_lock(pgdat, &flags); 40 pgdat_resize_lock(pgdat, &flags);
41 for (i = 0; i < pgdat->node_spanned_pages; ++i) { 41 for (i = 0; i < pgdat->node_spanned_pages; ++i) {
42 page = pgdat_page_nr(pgdat, i); 42 page = pgdat_page_nr(pgdat, i);
diff --git a/arch/i386/oprofile/nmi_int.c b/arch/i386/oprofile/nmi_int.c
index 0493e8b8ec49..1a2076ce6f6a 100644
--- a/arch/i386/oprofile/nmi_int.c
+++ b/arch/i386/oprofile/nmi_int.c
@@ -122,7 +122,7 @@ static void nmi_save_registers(void * dummy)
122static void free_msrs(void) 122static void free_msrs(void)
123{ 123{
124 int i; 124 int i;
125 for (i = 0; i < NR_CPUS; ++i) { 125 for_each_possible_cpu(i) {
126 kfree(cpu_msrs[i].counters); 126 kfree(cpu_msrs[i].counters);
127 cpu_msrs[i].counters = NULL; 127 cpu_msrs[i].counters = NULL;
128 kfree(cpu_msrs[i].controls); 128 kfree(cpu_msrs[i].controls);
@@ -138,10 +138,7 @@ static int allocate_msrs(void)
138 size_t counters_size = sizeof(struct op_msr) * model->num_counters; 138 size_t counters_size = sizeof(struct op_msr) * model->num_counters;
139 139
140 int i; 140 int i;
141 for (i = 0; i < NR_CPUS; ++i) { 141 for_each_online_cpu(i) {
142 if (!cpu_online(i))
143 continue;
144
145 cpu_msrs[i].counters = kmalloc(counters_size, GFP_KERNEL); 142 cpu_msrs[i].counters = kmalloc(counters_size, GFP_KERNEL);
146 if (!cpu_msrs[i].counters) { 143 if (!cpu_msrs[i].counters) {
147 success = 0; 144 success = 0;
diff --git a/arch/i386/pci/Makefile b/arch/i386/pci/Makefile
index 5461d4d5ea1e..62ad75c57e6a 100644
--- a/arch/i386/pci/Makefile
+++ b/arch/i386/pci/Makefile
@@ -1,4 +1,4 @@
1obj-y := i386.o 1obj-y := i386.o init.o
2 2
3obj-$(CONFIG_PCI_BIOS) += pcbios.o 3obj-$(CONFIG_PCI_BIOS) += pcbios.o
4obj-$(CONFIG_PCI_MMCONFIG) += mmconfig.o direct.o 4obj-$(CONFIG_PCI_MMCONFIG) += mmconfig.o direct.o
diff --git a/arch/i386/pci/common.c b/arch/i386/pci/common.c
index f6bc48da4d2a..dbece776c5b2 100644
--- a/arch/i386/pci/common.c
+++ b/arch/i386/pci/common.c
@@ -8,6 +8,7 @@
8#include <linux/pci.h> 8#include <linux/pci.h>
9#include <linux/ioport.h> 9#include <linux/ioport.h>
10#include <linux/init.h> 10#include <linux/init.h>
11#include <linux/dmi.h>
11 12
12#include <asm/acpi.h> 13#include <asm/acpi.h>
13#include <asm/segment.h> 14#include <asm/segment.h>
@@ -120,11 +121,42 @@ void __devinit pcibios_fixup_bus(struct pci_bus *b)
120 pci_read_bridge_bases(b); 121 pci_read_bridge_bases(b);
121} 122}
122 123
124/*
125 * Enable renumbering of PCI bus# ranges to reach all PCI busses (Cardbus)
126 */
127#ifdef __i386__
128static int __devinit assign_all_busses(struct dmi_system_id *d)
129{
130 pci_probe |= PCI_ASSIGN_ALL_BUSSES;
131 printk(KERN_INFO "%s detected: enabling PCI bus# renumbering"
132 " (pci=assign-busses)\n", d->ident);
133 return 0;
134}
135#endif
136
137/*
138 * Laptops which need pci=assign-busses to see Cardbus cards
139 */
140static struct dmi_system_id __devinitdata pciprobe_dmi_table[] = {
141#ifdef __i386__
142 {
143 .callback = assign_all_busses,
144 .ident = "Samsung X20 Laptop",
145 .matches = {
146 DMI_MATCH(DMI_SYS_VENDOR, "Samsung Electronics"),
147 DMI_MATCH(DMI_PRODUCT_NAME, "SX20S"),
148 },
149 },
150#endif /* __i386__ */
151 {}
152};
123 153
124struct pci_bus * __devinit pcibios_scan_root(int busnum) 154struct pci_bus * __devinit pcibios_scan_root(int busnum)
125{ 155{
126 struct pci_bus *bus = NULL; 156 struct pci_bus *bus = NULL;
127 157
158 dmi_check_system(pciprobe_dmi_table);
159
128 while ((bus = pci_find_next_bus(bus)) != NULL) { 160 while ((bus = pci_find_next_bus(bus)) != NULL) {
129 if (bus->number == busnum) { 161 if (bus->number == busnum) {
130 /* Already scanned */ 162 /* Already scanned */
diff --git a/arch/i386/pci/direct.c b/arch/i386/pci/direct.c
index e3ac502bf2fb..99012b93bd12 100644
--- a/arch/i386/pci/direct.c
+++ b/arch/i386/pci/direct.c
@@ -245,7 +245,7 @@ static int __init pci_check_type2(void)
245 return works; 245 return works;
246} 246}
247 247
248static int __init pci_direct_init(void) 248void __init pci_direct_init(void)
249{ 249{
250 struct resource *region, *region2; 250 struct resource *region, *region2;
251 251
@@ -258,16 +258,16 @@ static int __init pci_direct_init(void)
258 if (pci_check_type1()) { 258 if (pci_check_type1()) {
259 printk(KERN_INFO "PCI: Using configuration type 1\n"); 259 printk(KERN_INFO "PCI: Using configuration type 1\n");
260 raw_pci_ops = &pci_direct_conf1; 260 raw_pci_ops = &pci_direct_conf1;
261 return 0; 261 return;
262 } 262 }
263 release_resource(region); 263 release_resource(region);
264 264
265 type2: 265 type2:
266 if ((pci_probe & PCI_PROBE_CONF2) == 0) 266 if ((pci_probe & PCI_PROBE_CONF2) == 0)
267 goto out; 267 return;
268 region = request_region(0xCF8, 4, "PCI conf2"); 268 region = request_region(0xCF8, 4, "PCI conf2");
269 if (!region) 269 if (!region)
270 goto out; 270 return;
271 region2 = request_region(0xC000, 0x1000, "PCI conf2"); 271 region2 = request_region(0xC000, 0x1000, "PCI conf2");
272 if (!region2) 272 if (!region2)
273 goto fail2; 273 goto fail2;
@@ -275,15 +275,10 @@ static int __init pci_direct_init(void)
275 if (pci_check_type2()) { 275 if (pci_check_type2()) {
276 printk(KERN_INFO "PCI: Using configuration type 2\n"); 276 printk(KERN_INFO "PCI: Using configuration type 2\n");
277 raw_pci_ops = &pci_direct_conf2; 277 raw_pci_ops = &pci_direct_conf2;
278 return 0; 278 return;
279 } 279 }
280 280
281 release_resource(region2); 281 release_resource(region2);
282 fail2: 282 fail2:
283 release_resource(region); 283 release_resource(region);
284
285 out:
286 return 0;
287} 284}
288
289arch_initcall(pci_direct_init);
diff --git a/arch/i386/pci/init.c b/arch/i386/pci/init.c
new file mode 100644
index 000000000000..f9156d3ac723
--- /dev/null
+++ b/arch/i386/pci/init.c
@@ -0,0 +1,25 @@
1#include <linux/config.h>
2#include <linux/pci.h>
3#include <linux/init.h>
4#include "pci.h"
5
6/* arch_initcall has too random ordering, so call the initializers
7 in the right sequence from here. */
8static __init int pci_access_init(void)
9{
10#ifdef CONFIG_PCI_MMCONFIG
11 pci_mmcfg_init();
12#endif
13 if (raw_pci_ops)
14 return 0;
15#ifdef CONFIG_PCI_BIOS
16 pci_pcbios_init();
17#endif
18 if (raw_pci_ops)
19 return 0;
20#ifdef CONFIG_PCI_DIRECT
21 pci_direct_init();
22#endif
23 return 0;
24}
25arch_initcall(pci_access_init);
diff --git a/arch/i386/pci/mmconfig.c b/arch/i386/pci/mmconfig.c
index 0ee8a983708c..613789071f30 100644
--- a/arch/i386/pci/mmconfig.c
+++ b/arch/i386/pci/mmconfig.c
@@ -172,25 +172,20 @@ static __init void unreachable_devices(void)
172 } 172 }
173} 173}
174 174
175static int __init pci_mmcfg_init(void) 175void __init pci_mmcfg_init(void)
176{ 176{
177 if ((pci_probe & PCI_PROBE_MMCONF) == 0) 177 if ((pci_probe & PCI_PROBE_MMCONF) == 0)
178 goto out; 178 return;
179 179
180 acpi_table_parse(ACPI_MCFG, acpi_parse_mcfg); 180 acpi_table_parse(ACPI_MCFG, acpi_parse_mcfg);
181 if ((pci_mmcfg_config_num == 0) || 181 if ((pci_mmcfg_config_num == 0) ||
182 (pci_mmcfg_config == NULL) || 182 (pci_mmcfg_config == NULL) ||
183 (pci_mmcfg_config[0].base_address == 0)) 183 (pci_mmcfg_config[0].base_address == 0))
184 goto out; 184 return;
185 185
186 printk(KERN_INFO "PCI: Using MMCONFIG\n"); 186 printk(KERN_INFO "PCI: Using MMCONFIG\n");
187 raw_pci_ops = &pci_mmcfg; 187 raw_pci_ops = &pci_mmcfg;
188 pci_probe = (pci_probe & ~PCI_PROBE_MASK) | PCI_PROBE_MMCONF; 188 pci_probe = (pci_probe & ~PCI_PROBE_MASK) | PCI_PROBE_MMCONF;
189 189
190 unreachable_devices(); 190 unreachable_devices();
191
192 out:
193 return 0;
194} 191}
195
196arch_initcall(pci_mmcfg_init);
diff --git a/arch/i386/pci/pcbios.c b/arch/i386/pci/pcbios.c
index b9d65f0bc2d1..1eec0868f4b3 100644
--- a/arch/i386/pci/pcbios.c
+++ b/arch/i386/pci/pcbios.c
@@ -476,14 +476,12 @@ int pcibios_set_irq_routing(struct pci_dev *dev, int pin, int irq)
476} 476}
477EXPORT_SYMBOL(pcibios_set_irq_routing); 477EXPORT_SYMBOL(pcibios_set_irq_routing);
478 478
479static int __init pci_pcbios_init(void) 479void __init pci_pcbios_init(void)
480{ 480{
481 if ((pci_probe & PCI_PROBE_BIOS) 481 if ((pci_probe & PCI_PROBE_BIOS)
482 && ((raw_pci_ops = pci_find_bios()))) { 482 && ((raw_pci_ops = pci_find_bios()))) {
483 pci_probe |= PCI_BIOS_SORT; 483 pci_probe |= PCI_BIOS_SORT;
484 pci_bios_present = 1; 484 pci_bios_present = 1;
485 } 485 }
486 return 0;
487} 486}
488 487
489arch_initcall(pci_pcbios_init);
diff --git a/arch/i386/pci/pci.h b/arch/i386/pci/pci.h
index f550781ec310..12035e29108b 100644
--- a/arch/i386/pci/pci.h
+++ b/arch/i386/pci/pci.h
@@ -80,4 +80,7 @@ extern int pci_conf1_write(unsigned int seg, unsigned int bus,
80extern int pci_conf1_read(unsigned int seg, unsigned int bus, 80extern int pci_conf1_read(unsigned int seg, unsigned int bus,
81 unsigned int devfn, int reg, int len, u32 *value); 81 unsigned int devfn, int reg, int len, u32 *value);
82 82
83extern void pci_direct_init(void);
84extern void pci_pcbios_init(void);
85extern void pci_mmcfg_init(void);
83 86
diff --git a/arch/ia64/Kconfig b/arch/ia64/Kconfig
index a85ea9d37f05..edffe25a477a 100644
--- a/arch/ia64/Kconfig
+++ b/arch/ia64/Kconfig
@@ -34,6 +34,10 @@ config RWSEM_XCHGADD_ALGORITHM
34 bool 34 bool
35 default y 35 default y
36 36
37config GENERIC_FIND_NEXT_BIT
38 bool
39 default y
40
37config GENERIC_CALIBRATE_DELAY 41config GENERIC_CALIBRATE_DELAY
38 bool 42 bool
39 default y 43 default y
@@ -42,6 +46,10 @@ config TIME_INTERPOLATION
42 bool 46 bool
43 default y 47 default y
44 48
49config DMI
50 bool
51 default y
52
45config EFI 53config EFI
46 bool 54 bool
47 default y 55 default y
@@ -252,6 +260,15 @@ config NR_CPUS
252 than 64 will cause the use of a CPU mask array, causing a small 260 than 64 will cause the use of a CPU mask array, causing a small
253 performance hit. 261 performance hit.
254 262
263config IA64_NR_NODES
264 int "Maximum number of NODEs (256-1024)" if (IA64_SGI_SN2 || IA64_GENERIC)
265 range 256 1024
266 depends on IA64_SGI_SN2 || IA64_GENERIC
267 default "256"
268 help
269 This option specifies the maximum number of nodes in your SSI system.
270 If in doubt, use the default.
271
255config HOTPLUG_CPU 272config HOTPLUG_CPU
256 bool "Support for hot-pluggable CPUs (EXPERIMENTAL)" 273 bool "Support for hot-pluggable CPUs (EXPERIMENTAL)"
257 depends on SMP && EXPERIMENTAL 274 depends on SMP && EXPERIMENTAL
@@ -271,6 +288,25 @@ config SCHED_SMT
271 Intel IA64 chips with MultiThreading at a cost of slightly increased 288 Intel IA64 chips with MultiThreading at a cost of slightly increased
272 overhead in some places. If unsure say N here. 289 overhead in some places. If unsure say N here.
273 290
291config PERMIT_BSP_REMOVE
292 bool "Support removal of Bootstrap Processor"
293 depends on HOTPLUG_CPU
294 default n
295 ---help---
296 Say Y here if your platform SAL will support removal of BSP with HOTPLUG_CPU
297 support.
298
299config FORCE_CPEI_RETARGET
300 bool "Force assumption that CPEI can be re-targetted"
301 depends on PERMIT_BSP_REMOVE
302 default n
303 ---help---
304 Say Y if you need to force the assumption that CPEI can be re-targetted to
305 any cpu in the system. This hint is available via ACPI 3.0 specifications.
306 Tiger4 systems are capable of re-directing CPEI to any CPU other than BSP.
307 This option it useful to enable this feature on older BIOS's as well.
308 You can also enable this by using boot command line option force_cpei=1.
309
274config PREEMPT 310config PREEMPT
275 bool "Preemptible Kernel" 311 bool "Preemptible Kernel"
276 help 312 help
diff --git a/arch/ia64/Makefile b/arch/ia64/Makefile
index f722e1a25948..80ea7506fa1a 100644
--- a/arch/ia64/Makefile
+++ b/arch/ia64/Makefile
@@ -1,6 +1,9 @@
1# 1#
2# ia64/Makefile 2# ia64/Makefile
3# 3#
4# This file is included by the global makefile so that you can add your own
5# architecture-specific flags and dependencies.
6#
4# This file is subject to the terms and conditions of the GNU General Public 7# This file is subject to the terms and conditions of the GNU General Public
5# License. See the file "COPYING" in the main directory of this archive 8# License. See the file "COPYING" in the main directory of this archive
6# for more details. 9# for more details.
@@ -62,7 +65,7 @@ drivers-$(CONFIG_OPROFILE) += arch/ia64/oprofile/
62 65
63boot := arch/ia64/hp/sim/boot 66boot := arch/ia64/hp/sim/boot
64 67
65.PHONY: boot compressed check 68PHONY += boot compressed check
66 69
67all: compressed unwcheck 70all: compressed unwcheck
68 71
diff --git a/arch/ia64/configs/gensparse_defconfig b/arch/ia64/configs/gensparse_defconfig
index 744fd2f79f61..0d29aa2066b3 100644
--- a/arch/ia64/configs/gensparse_defconfig
+++ b/arch/ia64/configs/gensparse_defconfig
@@ -116,6 +116,7 @@ CONFIG_IOSAPIC=y
116CONFIG_FORCE_MAX_ZONEORDER=17 116CONFIG_FORCE_MAX_ZONEORDER=17
117CONFIG_SMP=y 117CONFIG_SMP=y
118CONFIG_NR_CPUS=512 118CONFIG_NR_CPUS=512
119CONFIG_IA64_NR_NODES=256
119CONFIG_HOTPLUG_CPU=y 120CONFIG_HOTPLUG_CPU=y
120# CONFIG_SCHED_SMT is not set 121# CONFIG_SCHED_SMT is not set
121# CONFIG_PREEMPT is not set 122# CONFIG_PREEMPT is not set
diff --git a/arch/ia64/configs/sn2_defconfig b/arch/ia64/configs/sn2_defconfig
index 8206752161bb..a718034d68d0 100644
--- a/arch/ia64/configs/sn2_defconfig
+++ b/arch/ia64/configs/sn2_defconfig
@@ -116,6 +116,7 @@ CONFIG_IA64_SGI_SN_XP=m
116CONFIG_FORCE_MAX_ZONEORDER=17 116CONFIG_FORCE_MAX_ZONEORDER=17
117CONFIG_SMP=y 117CONFIG_SMP=y
118CONFIG_NR_CPUS=1024 118CONFIG_NR_CPUS=1024
119CONFIG_IA64_NR_NODES=256
119# CONFIG_HOTPLUG_CPU is not set 120# CONFIG_HOTPLUG_CPU is not set
120CONFIG_SCHED_SMT=y 121CONFIG_SCHED_SMT=y
121CONFIG_PREEMPT=y 122CONFIG_PREEMPT=y
diff --git a/arch/ia64/configs/tiger_defconfig b/arch/ia64/configs/tiger_defconfig
index 125568118b84..766bf4955432 100644
--- a/arch/ia64/configs/tiger_defconfig
+++ b/arch/ia64/configs/tiger_defconfig
@@ -116,6 +116,8 @@ CONFIG_FORCE_MAX_ZONEORDER=17
116CONFIG_SMP=y 116CONFIG_SMP=y
117CONFIG_NR_CPUS=4 117CONFIG_NR_CPUS=4
118CONFIG_HOTPLUG_CPU=y 118CONFIG_HOTPLUG_CPU=y
119CONFIG_PERMIT_BSP_REMOVE=y
120CONFIG_FORCE_CPEI_RETARGET=y
119# CONFIG_SCHED_SMT is not set 121# CONFIG_SCHED_SMT is not set
120# CONFIG_PREEMPT is not set 122# CONFIG_PREEMPT is not set
121CONFIG_SELECT_MEMORY_MODEL=y 123CONFIG_SELECT_MEMORY_MODEL=y
diff --git a/arch/ia64/defconfig b/arch/ia64/defconfig
index 3e767288a745..6cba55da572a 100644
--- a/arch/ia64/defconfig
+++ b/arch/ia64/defconfig
@@ -116,6 +116,7 @@ CONFIG_IOSAPIC=y
116CONFIG_FORCE_MAX_ZONEORDER=17 116CONFIG_FORCE_MAX_ZONEORDER=17
117CONFIG_SMP=y 117CONFIG_SMP=y
118CONFIG_NR_CPUS=512 118CONFIG_NR_CPUS=512
119CONFIG_IA64_NR_NODES=256
119CONFIG_HOTPLUG_CPU=y 120CONFIG_HOTPLUG_CPU=y
120# CONFIG_SCHED_SMT is not set 121# CONFIG_SCHED_SMT is not set
121# CONFIG_PREEMPT is not set 122# CONFIG_PREEMPT is not set
diff --git a/arch/ia64/dig/setup.c b/arch/ia64/dig/setup.c
index c9104bfff667..38aa9c108857 100644
--- a/arch/ia64/dig/setup.c
+++ b/arch/ia64/dig/setup.c
@@ -69,8 +69,3 @@ dig_setup (char **cmdline_p)
69 screen_info.orig_video_isVGA = 1; /* XXX fake */ 69 screen_info.orig_video_isVGA = 1; /* XXX fake */
70 screen_info.orig_video_ega_bx = 3; /* XXX fake */ 70 screen_info.orig_video_ega_bx = 3; /* XXX fake */
71} 71}
72
73void __init
74dig_irq_init (void)
75{
76}
diff --git a/arch/ia64/hp/sim/simserial.c b/arch/ia64/hp/sim/simserial.c
index 626cdc83668b..0e5c6ae50228 100644
--- a/arch/ia64/hp/sim/simserial.c
+++ b/arch/ia64/hp/sim/simserial.c
@@ -46,11 +46,6 @@
46#define KEYBOARD_INTR 3 /* must match with simulator! */ 46#define KEYBOARD_INTR 3 /* must match with simulator! */
47 47
48#define NR_PORTS 1 /* only one port for now */ 48#define NR_PORTS 1 /* only one port for now */
49#define SERIAL_INLINE 1
50
51#ifdef SERIAL_INLINE
52#define _INLINE_ inline
53#endif
54 49
55#define IRQ_T(info) ((info->flags & ASYNC_SHARE_IRQ) ? SA_SHIRQ : SA_INTERRUPT) 50#define IRQ_T(info) ((info->flags & ASYNC_SHARE_IRQ) ? SA_SHIRQ : SA_INTERRUPT)
56 51
@@ -237,7 +232,7 @@ static void rs_put_char(struct tty_struct *tty, unsigned char ch)
237 local_irq_restore(flags); 232 local_irq_restore(flags);
238} 233}
239 234
240static _INLINE_ void transmit_chars(struct async_struct *info, int *intr_done) 235static void transmit_chars(struct async_struct *info, int *intr_done)
241{ 236{
242 int count; 237 int count;
243 unsigned long flags; 238 unsigned long flags;
diff --git a/arch/ia64/ia32/ia32priv.h b/arch/ia64/ia32/ia32priv.h
index 68ceb4e690c7..ccb98ed48e58 100644
--- a/arch/ia64/ia32/ia32priv.h
+++ b/arch/ia64/ia32/ia32priv.h
@@ -29,9 +29,9 @@
29struct partial_page { 29struct partial_page {
30 struct partial_page *next; /* linked list, sorted by address */ 30 struct partial_page *next; /* linked list, sorted by address */
31 struct rb_node pp_rb; 31 struct rb_node pp_rb;
32 /* 64K is the largest "normal" page supported by ia64 ABI. So 4K*32 32 /* 64K is the largest "normal" page supported by ia64 ABI. So 4K*64
33 * should suffice.*/ 33 * should suffice.*/
34 unsigned int bitmap; 34 unsigned long bitmap;
35 unsigned int base; 35 unsigned int base;
36}; 36};
37 37
diff --git a/arch/ia64/ia32/sys_ia32.c b/arch/ia64/ia32/sys_ia32.c
index 70dba1f0e2ee..5366b3b23d09 100644
--- a/arch/ia64/ia32/sys_ia32.c
+++ b/arch/ia64/ia32/sys_ia32.c
@@ -25,7 +25,6 @@
25#include <linux/resource.h> 25#include <linux/resource.h>
26#include <linux/times.h> 26#include <linux/times.h>
27#include <linux/utsname.h> 27#include <linux/utsname.h>
28#include <linux/timex.h>
29#include <linux/smp.h> 28#include <linux/smp.h>
30#include <linux/smp_lock.h> 29#include <linux/smp_lock.h>
31#include <linux/sem.h> 30#include <linux/sem.h>
@@ -1166,19 +1165,7 @@ put_tv32 (struct compat_timeval __user *o, struct timeval *i)
1166asmlinkage unsigned long 1165asmlinkage unsigned long
1167sys32_alarm (unsigned int seconds) 1166sys32_alarm (unsigned int seconds)
1168{ 1167{
1169 struct itimerval it_new, it_old; 1168 return alarm_setitimer(seconds);
1170 unsigned int oldalarm;
1171
1172 it_new.it_interval.tv_sec = it_new.it_interval.tv_usec = 0;
1173 it_new.it_value.tv_sec = seconds;
1174 it_new.it_value.tv_usec = 0;
1175 do_setitimer(ITIMER_REAL, &it_new, &it_old);
1176 oldalarm = it_old.it_value.tv_sec;
1177 /* ehhh.. We can't return 0 if we have an alarm pending.. */
1178 /* And we'd better return too much than too little anyway */
1179 if (it_old.it_value.tv_usec)
1180 oldalarm++;
1181 return oldalarm;
1182} 1169}
1183 1170
1184/* Translations due to time_t size differences. Which affects all 1171/* Translations due to time_t size differences. Which affects all
@@ -2603,78 +2590,4 @@ sys32_setresgid(compat_gid_t rgid, compat_gid_t egid,
2603 ssgid = (sgid == (compat_gid_t)-1) ? ((gid_t)-1) : ((gid_t)sgid); 2590 ssgid = (sgid == (compat_gid_t)-1) ? ((gid_t)-1) : ((gid_t)sgid);
2604 return sys_setresgid(srgid, segid, ssgid); 2591 return sys_setresgid(srgid, segid, ssgid);
2605} 2592}
2606
2607/* Handle adjtimex compatibility. */
2608
2609struct timex32 {
2610 u32 modes;
2611 s32 offset, freq, maxerror, esterror;
2612 s32 status, constant, precision, tolerance;
2613 struct compat_timeval time;
2614 s32 tick;
2615 s32 ppsfreq, jitter, shift, stabil;
2616 s32 jitcnt, calcnt, errcnt, stbcnt;
2617 s32 :32; s32 :32; s32 :32; s32 :32;
2618 s32 :32; s32 :32; s32 :32; s32 :32;
2619 s32 :32; s32 :32; s32 :32; s32 :32;
2620};
2621
2622extern int do_adjtimex(struct timex *);
2623
2624asmlinkage long
2625sys32_adjtimex(struct timex32 *utp)
2626{
2627 struct timex txc;
2628 int ret;
2629
2630 memset(&txc, 0, sizeof(struct timex));
2631
2632 if(get_user(txc.modes, &utp->modes) ||
2633 __get_user(txc.offset, &utp->offset) ||
2634 __get_user(txc.freq, &utp->freq) ||
2635 __get_user(txc.maxerror, &utp->maxerror) ||
2636 __get_user(txc.esterror, &utp->esterror) ||
2637 __get_user(txc.status, &utp->status) ||
2638 __get_user(txc.constant, &utp->constant) ||
2639 __get_user(txc.precision, &utp->precision) ||
2640 __get_user(txc.tolerance, &utp->tolerance) ||
2641 __get_user(txc.time.tv_sec, &utp->time.tv_sec) ||
2642 __get_user(txc.time.tv_usec, &utp->time.tv_usec) ||
2643 __get_user(txc.tick, &utp->tick) ||
2644 __get_user(txc.ppsfreq, &utp->ppsfreq) ||
2645 __get_user(txc.jitter, &utp->jitter) ||
2646 __get_user(txc.shift, &utp->shift) ||
2647 __get_user(txc.stabil, &utp->stabil) ||
2648 __get_user(txc.jitcnt, &utp->jitcnt) ||
2649 __get_user(txc.calcnt, &utp->calcnt) ||
2650 __get_user(txc.errcnt, &utp->errcnt) ||
2651 __get_user(txc.stbcnt, &utp->stbcnt))
2652 return -EFAULT;
2653
2654 ret = do_adjtimex(&txc);
2655
2656 if(put_user(txc.modes, &utp->modes) ||
2657 __put_user(txc.offset, &utp->offset) ||
2658 __put_user(txc.freq, &utp->freq) ||
2659 __put_user(txc.maxerror, &utp->maxerror) ||
2660 __put_user(txc.esterror, &utp->esterror) ||
2661 __put_user(txc.status, &utp->status) ||
2662 __put_user(txc.constant, &utp->constant) ||
2663 __put_user(txc.precision, &utp->precision) ||
2664 __put_user(txc.tolerance, &utp->tolerance) ||
2665 __put_user(txc.time.tv_sec, &utp->time.tv_sec) ||
2666 __put_user(txc.time.tv_usec, &utp->time.tv_usec) ||
2667 __put_user(txc.tick, &utp->tick) ||
2668 __put_user(txc.ppsfreq, &utp->ppsfreq) ||
2669 __put_user(txc.jitter, &utp->jitter) ||
2670 __put_user(txc.shift, &utp->shift) ||
2671 __put_user(txc.stabil, &utp->stabil) ||
2672 __put_user(txc.jitcnt, &utp->jitcnt) ||
2673 __put_user(txc.calcnt, &utp->calcnt) ||
2674 __put_user(txc.errcnt, &utp->errcnt) ||
2675 __put_user(txc.stbcnt, &utp->stbcnt))
2676 ret = -EFAULT;
2677
2678 return ret;
2679}
2680#endif /* NOTYET */ 2593#endif /* NOTYET */
diff --git a/arch/ia64/kernel/Makefile b/arch/ia64/kernel/Makefile
index 09a0dbc17fb6..59e871dae742 100644
--- a/arch/ia64/kernel/Makefile
+++ b/arch/ia64/kernel/Makefile
@@ -7,7 +7,7 @@ extra-y := head.o init_task.o vmlinux.lds
7obj-y := acpi.o entry.o efi.o efi_stub.o gate-data.o fsys.o ia64_ksyms.o irq.o irq_ia64.o \ 7obj-y := acpi.o entry.o efi.o efi_stub.o gate-data.o fsys.o ia64_ksyms.o irq.o irq_ia64.o \
8 irq_lsapic.o ivt.o machvec.o pal.o patch.o process.o perfmon.o ptrace.o sal.o \ 8 irq_lsapic.o ivt.o machvec.o pal.o patch.o process.o perfmon.o ptrace.o sal.o \
9 salinfo.o semaphore.o setup.o signal.o sys_ia64.o time.o traps.o unaligned.o \ 9 salinfo.o semaphore.o setup.o signal.o sys_ia64.o time.o traps.o unaligned.o \
10 unwind.o mca.o mca_asm.o topology.o 10 unwind.o mca.o mca_asm.o topology.o dmi_scan.o
11 11
12obj-$(CONFIG_IA64_BRL_EMU) += brl_emu.o 12obj-$(CONFIG_IA64_BRL_EMU) += brl_emu.o
13obj-$(CONFIG_IA64_GENERIC) += acpi-ext.o 13obj-$(CONFIG_IA64_GENERIC) += acpi-ext.o
@@ -30,6 +30,7 @@ obj-$(CONFIG_IA64_MCA_RECOVERY) += mca_recovery.o
30obj-$(CONFIG_KPROBES) += kprobes.o jprobes.o 30obj-$(CONFIG_KPROBES) += kprobes.o jprobes.o
31obj-$(CONFIG_IA64_UNCACHED_ALLOCATOR) += uncached.o 31obj-$(CONFIG_IA64_UNCACHED_ALLOCATOR) += uncached.o
32mca_recovery-y += mca_drv.o mca_drv_asm.o 32mca_recovery-y += mca_drv.o mca_drv_asm.o
33dmi_scan-y += ../../i386/kernel/dmi_scan.o
33 34
34# The gate DSO image is built using a special linker script. 35# The gate DSO image is built using a special linker script.
35targets += gate.so gate-syms.o 36targets += gate.so gate-syms.o
diff --git a/arch/ia64/kernel/acpi.c b/arch/ia64/kernel/acpi.c
index ecd44bdc8394..58c93a30348c 100644
--- a/arch/ia64/kernel/acpi.c
+++ b/arch/ia64/kernel/acpi.c
@@ -284,19 +284,24 @@ acpi_parse_plat_int_src(acpi_table_entry_header * header,
284 return 0; 284 return 0;
285} 285}
286 286
287#ifdef CONFIG_HOTPLUG_CPU
287unsigned int can_cpei_retarget(void) 288unsigned int can_cpei_retarget(void)
288{ 289{
289 extern int cpe_vector; 290 extern int cpe_vector;
291 extern unsigned int force_cpei_retarget;
290 292
291 /* 293 /*
292 * Only if CPEI is supported and the override flag 294 * Only if CPEI is supported and the override flag
293 * is present, otherwise return that its re-targettable 295 * is present, otherwise return that its re-targettable
294 * if we are in polling mode. 296 * if we are in polling mode.
295 */ 297 */
296 if (cpe_vector > 0 && !acpi_cpei_override) 298 if (cpe_vector > 0) {
297 return 0; 299 if (acpi_cpei_override || force_cpei_retarget)
298 else 300 return 1;
299 return 1; 301 else
302 return 0;
303 }
304 return 1;
300} 305}
301 306
302unsigned int is_cpu_cpei_target(unsigned int cpu) 307unsigned int is_cpu_cpei_target(unsigned int cpu)
@@ -315,6 +320,7 @@ void set_cpei_target_cpu(unsigned int cpu)
315{ 320{
316 acpi_cpei_phys_cpuid = cpu_physical_id(cpu); 321 acpi_cpei_phys_cpuid = cpu_physical_id(cpu);
317} 322}
323#endif
318 324
319unsigned int get_cpei_target_cpu(void) 325unsigned int get_cpei_target_cpu(void)
320{ 326{
@@ -414,6 +420,26 @@ int __devinitdata pxm_to_nid_map[MAX_PXM_DOMAINS];
414int __initdata nid_to_pxm_map[MAX_NUMNODES]; 420int __initdata nid_to_pxm_map[MAX_NUMNODES];
415static struct acpi_table_slit __initdata *slit_table; 421static struct acpi_table_slit __initdata *slit_table;
416 422
423static int get_processor_proximity_domain(struct acpi_table_processor_affinity *pa)
424{
425 int pxm;
426
427 pxm = pa->proximity_domain;
428 if (ia64_platform_is("sn2"))
429 pxm += pa->reserved[0] << 8;
430 return pxm;
431}
432
433static int get_memory_proximity_domain(struct acpi_table_memory_affinity *ma)
434{
435 int pxm;
436
437 pxm = ma->proximity_domain;
438 if (ia64_platform_is("sn2"))
439 pxm += ma->reserved1[0] << 8;
440 return pxm;
441}
442
417/* 443/*
418 * ACPI 2.0 SLIT (System Locality Information Table) 444 * ACPI 2.0 SLIT (System Locality Information Table)
419 * http://devresource.hp.com/devresource/Docs/TechPapers/IA64/slit.pdf 445 * http://devresource.hp.com/devresource/Docs/TechPapers/IA64/slit.pdf
@@ -437,13 +463,20 @@ void __init acpi_numa_slit_init(struct acpi_table_slit *slit)
437void __init 463void __init
438acpi_numa_processor_affinity_init(struct acpi_table_processor_affinity *pa) 464acpi_numa_processor_affinity_init(struct acpi_table_processor_affinity *pa)
439{ 465{
466 int pxm;
467
468 if (!pa->flags.enabled)
469 return;
470
471 pxm = get_processor_proximity_domain(pa);
472
440 /* record this node in proximity bitmap */ 473 /* record this node in proximity bitmap */
441 pxm_bit_set(pa->proximity_domain); 474 pxm_bit_set(pxm);
442 475
443 node_cpuid[srat_num_cpus].phys_id = 476 node_cpuid[srat_num_cpus].phys_id =
444 (pa->apic_id << 8) | (pa->lsapic_eid); 477 (pa->apic_id << 8) | (pa->lsapic_eid);
445 /* nid should be overridden as logical node id later */ 478 /* nid should be overridden as logical node id later */
446 node_cpuid[srat_num_cpus].nid = pa->proximity_domain; 479 node_cpuid[srat_num_cpus].nid = pxm;
447 srat_num_cpus++; 480 srat_num_cpus++;
448} 481}
449 482
@@ -451,10 +484,10 @@ void __init
451acpi_numa_memory_affinity_init(struct acpi_table_memory_affinity *ma) 484acpi_numa_memory_affinity_init(struct acpi_table_memory_affinity *ma)
452{ 485{
453 unsigned long paddr, size; 486 unsigned long paddr, size;
454 u8 pxm; 487 int pxm;
455 struct node_memblk_s *p, *q, *pend; 488 struct node_memblk_s *p, *q, *pend;
456 489
457 pxm = ma->proximity_domain; 490 pxm = get_memory_proximity_domain(ma);
458 491
459 /* fill node memory chunk structure */ 492 /* fill node memory chunk structure */
460 paddr = ma->base_addr_hi; 493 paddr = ma->base_addr_hi;
@@ -618,9 +651,9 @@ unsigned long __init acpi_find_rsdp(void)
618{ 651{
619 unsigned long rsdp_phys = 0; 652 unsigned long rsdp_phys = 0;
620 653
621 if (efi.acpi20) 654 if (efi.acpi20 != EFI_INVALID_TABLE_ADDR)
622 rsdp_phys = __pa(efi.acpi20); 655 rsdp_phys = efi.acpi20;
623 else if (efi.acpi) 656 else if (efi.acpi != EFI_INVALID_TABLE_ADDR)
624 printk(KERN_WARNING PREFIX 657 printk(KERN_WARNING PREFIX
625 "v1.0/r0.71 tables no longer supported\n"); 658 "v1.0/r0.71 tables no longer supported\n");
626 return rsdp_phys; 659 return rsdp_phys;
diff --git a/arch/ia64/kernel/efi.c b/arch/ia64/kernel/efi.c
index 9990320b6f9a..12cfedce73b1 100644
--- a/arch/ia64/kernel/efi.c
+++ b/arch/ia64/kernel/efi.c
@@ -458,24 +458,33 @@ efi_init (void)
458 printk(KERN_INFO "EFI v%u.%.02u by %s:", 458 printk(KERN_INFO "EFI v%u.%.02u by %s:",
459 efi.systab->hdr.revision >> 16, efi.systab->hdr.revision & 0xffff, vendor); 459 efi.systab->hdr.revision >> 16, efi.systab->hdr.revision & 0xffff, vendor);
460 460
461 efi.mps = EFI_INVALID_TABLE_ADDR;
462 efi.acpi = EFI_INVALID_TABLE_ADDR;
463 efi.acpi20 = EFI_INVALID_TABLE_ADDR;
464 efi.smbios = EFI_INVALID_TABLE_ADDR;
465 efi.sal_systab = EFI_INVALID_TABLE_ADDR;
466 efi.boot_info = EFI_INVALID_TABLE_ADDR;
467 efi.hcdp = EFI_INVALID_TABLE_ADDR;
468 efi.uga = EFI_INVALID_TABLE_ADDR;
469
461 for (i = 0; i < (int) efi.systab->nr_tables; i++) { 470 for (i = 0; i < (int) efi.systab->nr_tables; i++) {
462 if (efi_guidcmp(config_tables[i].guid, MPS_TABLE_GUID) == 0) { 471 if (efi_guidcmp(config_tables[i].guid, MPS_TABLE_GUID) == 0) {
463 efi.mps = __va(config_tables[i].table); 472 efi.mps = config_tables[i].table;
464 printk(" MPS=0x%lx", config_tables[i].table); 473 printk(" MPS=0x%lx", config_tables[i].table);
465 } else if (efi_guidcmp(config_tables[i].guid, ACPI_20_TABLE_GUID) == 0) { 474 } else if (efi_guidcmp(config_tables[i].guid, ACPI_20_TABLE_GUID) == 0) {
466 efi.acpi20 = __va(config_tables[i].table); 475 efi.acpi20 = config_tables[i].table;
467 printk(" ACPI 2.0=0x%lx", config_tables[i].table); 476 printk(" ACPI 2.0=0x%lx", config_tables[i].table);
468 } else if (efi_guidcmp(config_tables[i].guid, ACPI_TABLE_GUID) == 0) { 477 } else if (efi_guidcmp(config_tables[i].guid, ACPI_TABLE_GUID) == 0) {
469 efi.acpi = __va(config_tables[i].table); 478 efi.acpi = config_tables[i].table;
470 printk(" ACPI=0x%lx", config_tables[i].table); 479 printk(" ACPI=0x%lx", config_tables[i].table);
471 } else if (efi_guidcmp(config_tables[i].guid, SMBIOS_TABLE_GUID) == 0) { 480 } else if (efi_guidcmp(config_tables[i].guid, SMBIOS_TABLE_GUID) == 0) {
472 efi.smbios = __va(config_tables[i].table); 481 efi.smbios = config_tables[i].table;
473 printk(" SMBIOS=0x%lx", config_tables[i].table); 482 printk(" SMBIOS=0x%lx", config_tables[i].table);
474 } else if (efi_guidcmp(config_tables[i].guid, SAL_SYSTEM_TABLE_GUID) == 0) { 483 } else if (efi_guidcmp(config_tables[i].guid, SAL_SYSTEM_TABLE_GUID) == 0) {
475 efi.sal_systab = __va(config_tables[i].table); 484 efi.sal_systab = config_tables[i].table;
476 printk(" SALsystab=0x%lx", config_tables[i].table); 485 printk(" SALsystab=0x%lx", config_tables[i].table);
477 } else if (efi_guidcmp(config_tables[i].guid, HCDP_TABLE_GUID) == 0) { 486 } else if (efi_guidcmp(config_tables[i].guid, HCDP_TABLE_GUID) == 0) {
478 efi.hcdp = __va(config_tables[i].table); 487 efi.hcdp = config_tables[i].table;
479 printk(" HCDP=0x%lx", config_tables[i].table); 488 printk(" HCDP=0x%lx", config_tables[i].table);
480 } 489 }
481 } 490 }
@@ -677,27 +686,34 @@ EXPORT_SYMBOL(efi_mem_attributes);
677/* 686/*
678 * Determines whether the memory at phys_addr supports the desired 687 * Determines whether the memory at phys_addr supports the desired
679 * attribute (WB, UC, etc). If this returns 1, the caller can safely 688 * attribute (WB, UC, etc). If this returns 1, the caller can safely
680 * access *size bytes at phys_addr with the specified attribute. 689 * access size bytes at phys_addr with the specified attribute.
681 */ 690 */
682static int 691int
683efi_mem_attribute_range (unsigned long phys_addr, unsigned long *size, u64 attr) 692efi_mem_attribute_range (unsigned long phys_addr, unsigned long size, u64 attr)
684{ 693{
694 unsigned long end = phys_addr + size;
685 efi_memory_desc_t *md = efi_memory_descriptor(phys_addr); 695 efi_memory_desc_t *md = efi_memory_descriptor(phys_addr);
686 unsigned long md_end;
687 696
688 if (!md || (md->attribute & attr) != attr) 697 /*
698 * Some firmware doesn't report MMIO regions in the EFI memory
699 * map. The Intel BigSur (a.k.a. HP i2000) has this problem.
700 * On those platforms, we have to assume UC is valid everywhere.
701 */
702 if (!md || (md->attribute & attr) != attr) {
703 if (attr == EFI_MEMORY_UC && !efi_memmap_has_mmio())
704 return 1;
689 return 0; 705 return 0;
706 }
690 707
691 do { 708 do {
692 md_end = efi_md_end(md); 709 unsigned long md_end = efi_md_end(md);
693 if (phys_addr + *size <= md_end) 710
711 if (end <= md_end)
694 return 1; 712 return 1;
695 713
696 md = efi_memory_descriptor(md_end); 714 md = efi_memory_descriptor(md_end);
697 if (!md || (md->attribute & attr) != attr) { 715 if (!md || (md->attribute & attr) != attr)
698 *size = md_end - phys_addr; 716 return 0;
699 return 1;
700 }
701 } while (md); 717 } while (md);
702 return 0; 718 return 0;
703} 719}
@@ -708,7 +724,7 @@ efi_mem_attribute_range (unsigned long phys_addr, unsigned long *size, u64 attr)
708 * control access size. 724 * control access size.
709 */ 725 */
710int 726int
711valid_phys_addr_range (unsigned long phys_addr, unsigned long *size) 727valid_phys_addr_range (unsigned long phys_addr, unsigned long size)
712{ 728{
713 return efi_mem_attribute_range(phys_addr, size, EFI_MEMORY_WB); 729 return efi_mem_attribute_range(phys_addr, size, EFI_MEMORY_WB);
714} 730}
@@ -723,7 +739,7 @@ valid_phys_addr_range (unsigned long phys_addr, unsigned long *size)
723 * because that doesn't appear in the boot-time EFI memory map. 739 * because that doesn't appear in the boot-time EFI memory map.
724 */ 740 */
725int 741int
726valid_mmap_phys_addr_range (unsigned long phys_addr, unsigned long *size) 742valid_mmap_phys_addr_range (unsigned long phys_addr, unsigned long size)
727{ 743{
728 if (efi_mem_attribute_range(phys_addr, size, EFI_MEMORY_WB)) 744 if (efi_mem_attribute_range(phys_addr, size, EFI_MEMORY_WB))
729 return 1; 745 return 1;
@@ -731,14 +747,6 @@ valid_mmap_phys_addr_range (unsigned long phys_addr, unsigned long *size)
731 if (efi_mem_attribute_range(phys_addr, size, EFI_MEMORY_UC)) 747 if (efi_mem_attribute_range(phys_addr, size, EFI_MEMORY_UC))
732 return 1; 748 return 1;
733 749
734 /*
735 * Some firmware doesn't report MMIO regions in the EFI memory map.
736 * The Intel BigSur (a.k.a. HP i2000) has this problem. In this
737 * case, we can't use the EFI memory map to validate mmap requests.
738 */
739 if (!efi_memmap_has_mmio())
740 return 1;
741
742 return 0; 750 return 0;
743} 751}
744 752
diff --git a/arch/ia64/kernel/entry.S b/arch/ia64/kernel/entry.S
index 930fdfca6ddb..750e8e7fbdc3 100644
--- a/arch/ia64/kernel/entry.S
+++ b/arch/ia64/kernel/entry.S
@@ -1102,9 +1102,6 @@ skip_rbs_switch:
1102 st8 [r2]=r8 1102 st8 [r2]=r8
1103 st8 [r3]=r10 1103 st8 [r3]=r10
1104.work_pending: 1104.work_pending:
1105 tbit.nz p6,p0=r31,TIF_SIGDELAYED // signal delayed from MCA/INIT/NMI/PMI context?
1106(p6) br.cond.sptk.few .sigdelayed
1107 ;;
1108 tbit.z p6,p0=r31,TIF_NEED_RESCHED // current_thread_info()->need_resched==0? 1105 tbit.z p6,p0=r31,TIF_NEED_RESCHED // current_thread_info()->need_resched==0?
1109(p6) br.cond.sptk.few .notify 1106(p6) br.cond.sptk.few .notify
1110#ifdef CONFIG_PREEMPT 1107#ifdef CONFIG_PREEMPT
@@ -1131,17 +1128,6 @@ skip_rbs_switch:
1131(pLvSys)br.cond.sptk.few .work_pending_syscall_end 1128(pLvSys)br.cond.sptk.few .work_pending_syscall_end
1132 br.cond.sptk.many .work_processed_kernel // don't re-check 1129 br.cond.sptk.many .work_processed_kernel // don't re-check
1133 1130
1134// There is a delayed signal that was detected in MCA/INIT/NMI/PMI context where
1135// it could not be delivered. Deliver it now. The signal might be for us and
1136// may set TIF_SIGPENDING, so redrive ia64_leave_* after processing the delayed
1137// signal.
1138
1139.sigdelayed:
1140 br.call.sptk.many rp=do_sigdelayed
1141 cmp.eq p6,p0=r0,r0 // p6 <- 1, always re-check
1142(pLvSys)br.cond.sptk.few .work_pending_syscall_end
1143 br.cond.sptk.many .work_processed_kernel // re-check
1144
1145.work_pending_syscall_end: 1131.work_pending_syscall_end:
1146 adds r2=PT(R8)+16,r12 1132 adds r2=PT(R8)+16,r12
1147 adds r3=PT(R10)+16,r12 1133 adds r3=PT(R10)+16,r12
@@ -1619,5 +1605,6 @@ sys_call_table:
1619 data8 sys_ni_syscall // reserved for pselect 1605 data8 sys_ni_syscall // reserved for pselect
1620 data8 sys_ni_syscall // 1295 reserved for ppoll 1606 data8 sys_ni_syscall // 1295 reserved for ppoll
1621 data8 sys_unshare 1607 data8 sys_unshare
1608 data8 sys_splice
1622 1609
1623 .org sys_call_table + 8*NR_syscalls // guard against failures to increase NR_syscalls 1610 .org sys_call_table + 8*NR_syscalls // guard against failures to increase NR_syscalls
diff --git a/arch/ia64/kernel/gate.lds.S b/arch/ia64/kernel/gate.lds.S
index e1e4aba9ecd0..7c99e6ec3daf 100644
--- a/arch/ia64/kernel/gate.lds.S
+++ b/arch/ia64/kernel/gate.lds.S
@@ -59,6 +59,7 @@ SECTIONS
59 *(.dynbss) 59 *(.dynbss)
60 *(.bss .bss.* .gnu.linkonce.b.*) 60 *(.bss .bss.* .gnu.linkonce.b.*)
61 *(__ex_table) 61 *(__ex_table)
62 *(__mca_table)
62 } 63 }
63} 64}
64 65
diff --git a/arch/ia64/kernel/iosapic.c b/arch/ia64/kernel/iosapic.c
index 574084f343fa..7956eb9058fc 100644
--- a/arch/ia64/kernel/iosapic.c
+++ b/arch/ia64/kernel/iosapic.c
@@ -9,54 +9,65 @@
9 * Copyright (C) 1999 VA Linux Systems 9 * Copyright (C) 1999 VA Linux Systems
10 * Copyright (C) 1999,2000 Walt Drummond <drummond@valinux.com> 10 * Copyright (C) 1999,2000 Walt Drummond <drummond@valinux.com>
11 * 11 *
12 * 00/04/19 D. Mosberger Rewritten to mirror more closely the x86 I/O APIC code. 12 * 00/04/19 D. Mosberger Rewritten to mirror more closely the x86 I/O
13 * In particular, we now have separate handlers for edge 13 * APIC code. In particular, we now have separate
14 * and level triggered interrupts. 14 * handlers for edge and level triggered
15 * 00/10/27 Asit Mallick, Goutham Rao <goutham.rao@intel.com> IRQ vector allocation 15 * interrupts.
16 * PCI to vector mapping, shared PCI interrupts. 16 * 00/10/27 Asit Mallick, Goutham Rao <goutham.rao@intel.com> IRQ vector
17 * 00/10/27 D. Mosberger Document things a bit more to make them more understandable. 17 * allocation PCI to vector mapping, shared PCI
18 * Clean up much of the old IOSAPIC cruft. 18 * interrupts.
19 * 01/07/27 J.I. Lee PCI irq routing, Platform/Legacy interrupts and fixes for 19 * 00/10/27 D. Mosberger Document things a bit more to make them more
20 * ACPI S5(SoftOff) support. 20 * understandable. Clean up much of the old
21 * IOSAPIC cruft.
22 * 01/07/27 J.I. Lee PCI irq routing, Platform/Legacy interrupts
23 * and fixes for ACPI S5(SoftOff) support.
21 * 02/01/23 J.I. Lee iosapic pgm fixes for PCI irq routing from _PRT 24 * 02/01/23 J.I. Lee iosapic pgm fixes for PCI irq routing from _PRT
22 * 02/01/07 E. Focht <efocht@ess.nec.de> Redirectable interrupt vectors in 25 * 02/01/07 E. Focht <efocht@ess.nec.de> Redirectable interrupt
23 * iosapic_set_affinity(), initializations for 26 * vectors in iosapic_set_affinity(),
24 * /proc/irq/#/smp_affinity 27 * initializations for /proc/irq/#/smp_affinity
25 * 02/04/02 P. Diefenbaugh Cleaned up ACPI PCI IRQ routing. 28 * 02/04/02 P. Diefenbaugh Cleaned up ACPI PCI IRQ routing.
26 * 02/04/18 J.I. Lee bug fix in iosapic_init_pci_irq 29 * 02/04/18 J.I. Lee bug fix in iosapic_init_pci_irq
27 * 02/04/30 J.I. Lee bug fix in find_iosapic to fix ACPI PCI IRQ to IOSAPIC mapping 30 * 02/04/30 J.I. Lee bug fix in find_iosapic to fix ACPI PCI IRQ to
28 * error 31 * IOSAPIC mapping error
29 * 02/07/29 T. Kochi Allocate interrupt vectors dynamically 32 * 02/07/29 T. Kochi Allocate interrupt vectors dynamically
30 * 02/08/04 T. Kochi Cleaned up terminology (irq, global system interrupt, vector, etc.) 33 * 02/08/04 T. Kochi Cleaned up terminology (irq, global system
31 * 02/09/20 D. Mosberger Simplified by taking advantage of ACPI's pci_irq code. 34 * interrupt, vector, etc.)
35 * 02/09/20 D. Mosberger Simplified by taking advantage of ACPI's
36 * pci_irq code.
32 * 03/02/19 B. Helgaas Make pcat_compat system-wide, not per-IOSAPIC. 37 * 03/02/19 B. Helgaas Make pcat_compat system-wide, not per-IOSAPIC.
33 * Remove iosapic_address & gsi_base from external interfaces. 38 * Remove iosapic_address & gsi_base from
34 * Rationalize __init/__devinit attributes. 39 * external interfaces. Rationalize
40 * __init/__devinit attributes.
35 * 04/12/04 Ashok Raj <ashok.raj@intel.com> Intel Corporation 2004 41 * 04/12/04 Ashok Raj <ashok.raj@intel.com> Intel Corporation 2004
36 * Updated to work with irq migration necessary for CPU Hotplug 42 * Updated to work with irq migration necessary
43 * for CPU Hotplug
37 */ 44 */
38/* 45/*
39 * Here is what the interrupt logic between a PCI device and the kernel looks like: 46 * Here is what the interrupt logic between a PCI device and the kernel looks
47 * like:
40 * 48 *
41 * (1) A PCI device raises one of the four interrupt pins (INTA, INTB, INTC, INTD). The 49 * (1) A PCI device raises one of the four interrupt pins (INTA, INTB, INTC,
42 * device is uniquely identified by its bus--, and slot-number (the function 50 * INTD). The device is uniquely identified by its bus-, and slot-number
43 * number does not matter here because all functions share the same interrupt 51 * (the function number does not matter here because all functions share
44 * lines). 52 * the same interrupt lines).
45 * 53 *
46 * (2) The motherboard routes the interrupt line to a pin on a IOSAPIC controller. 54 * (2) The motherboard routes the interrupt line to a pin on a IOSAPIC
47 * Multiple interrupt lines may have to share the same IOSAPIC pin (if they're level 55 * controller. Multiple interrupt lines may have to share the same
48 * triggered and use the same polarity). Each interrupt line has a unique Global 56 * IOSAPIC pin (if they're level triggered and use the same polarity).
49 * System Interrupt (GSI) number which can be calculated as the sum of the controller's 57 * Each interrupt line has a unique Global System Interrupt (GSI) number
50 * base GSI number and the IOSAPIC pin number to which the line connects. 58 * which can be calculated as the sum of the controller's base GSI number
59 * and the IOSAPIC pin number to which the line connects.
51 * 60 *
52 * (3) The IOSAPIC uses an internal routing table entries (RTEs) to map the IOSAPIC pin 61 * (3) The IOSAPIC uses an internal routing table entries (RTEs) to map the
53 * into the IA-64 interrupt vector. This interrupt vector is then sent to the CPU. 62 * IOSAPIC pin into the IA-64 interrupt vector. This interrupt vector is then
63 * sent to the CPU.
54 * 64 *
55 * (4) The kernel recognizes an interrupt as an IRQ. The IRQ interface is used as 65 * (4) The kernel recognizes an interrupt as an IRQ. The IRQ interface is
56 * architecture-independent interrupt handling mechanism in Linux. As an 66 * used as architecture-independent interrupt handling mechanism in Linux.
57 * IRQ is a number, we have to have IA-64 interrupt vector number <-> IRQ number 67 * As an IRQ is a number, we have to have
58 * mapping. On smaller systems, we use one-to-one mapping between IA-64 vector and 68 * IA-64 interrupt vector number <-> IRQ number mapping. On smaller
59 * IRQ. A platform can implement platform_irq_to_vector(irq) and 69 * systems, we use one-to-one mapping between IA-64 vector and IRQ. A
70 * platform can implement platform_irq_to_vector(irq) and
60 * platform_local_vector_to_irq(vector) APIs to differentiate the mapping. 71 * platform_local_vector_to_irq(vector) APIs to differentiate the mapping.
61 * Please see also include/asm-ia64/hw_irq.h for those APIs. 72 * Please see also include/asm-ia64/hw_irq.h for those APIs.
62 * 73 *
@@ -64,9 +75,9 @@
64 * 75 *
65 * PCI pin -> global system interrupt (GSI) -> IA-64 vector <-> IRQ 76 * PCI pin -> global system interrupt (GSI) -> IA-64 vector <-> IRQ
66 * 77 *
67 * Note: The term "IRQ" is loosely used everywhere in Linux kernel to describe interrupts. 78 * Note: The term "IRQ" is loosely used everywhere in Linux kernel to
68 * Now we use "IRQ" only for Linux IRQ's. ISA IRQ (isa_irq) is the only exception in this 79 * describeinterrupts. Now we use "IRQ" only for Linux IRQ's. ISA IRQ
69 * source code. 80 * (isa_irq) is the only exception in this source code.
70 */ 81 */
71#include <linux/config.h> 82#include <linux/config.h>
72 83
@@ -90,7 +101,6 @@
90#include <asm/ptrace.h> 101#include <asm/ptrace.h>
91#include <asm/system.h> 102#include <asm/system.h>
92 103
93
94#undef DEBUG_INTERRUPT_ROUTING 104#undef DEBUG_INTERRUPT_ROUTING
95 105
96#ifdef DEBUG_INTERRUPT_ROUTING 106#ifdef DEBUG_INTERRUPT_ROUTING
@@ -99,36 +109,46 @@
99#define DBG(fmt...) 109#define DBG(fmt...)
100#endif 110#endif
101 111
102#define NR_PREALLOCATE_RTE_ENTRIES (PAGE_SIZE / sizeof(struct iosapic_rte_info)) 112#define NR_PREALLOCATE_RTE_ENTRIES \
113 (PAGE_SIZE / sizeof(struct iosapic_rte_info))
103#define RTE_PREALLOCATED (1) 114#define RTE_PREALLOCATED (1)
104 115
105static DEFINE_SPINLOCK(iosapic_lock); 116static DEFINE_SPINLOCK(iosapic_lock);
106 117
107/* These tables map IA-64 vectors to the IOSAPIC pin that generates this vector. */ 118/*
119 * These tables map IA-64 vectors to the IOSAPIC pin that generates this
120 * vector.
121 */
108 122
109struct iosapic_rte_info { 123struct iosapic_rte_info {
110 struct list_head rte_list; /* node in list of RTEs sharing the same vector */ 124 struct list_head rte_list; /* node in list of RTEs sharing the
125 * same vector */
111 char __iomem *addr; /* base address of IOSAPIC */ 126 char __iomem *addr; /* base address of IOSAPIC */
112 unsigned int gsi_base; /* first GSI assigned to this IOSAPIC */ 127 unsigned int gsi_base; /* first GSI assigned to this
128 * IOSAPIC */
113 char rte_index; /* IOSAPIC RTE index */ 129 char rte_index; /* IOSAPIC RTE index */
114 int refcnt; /* reference counter */ 130 int refcnt; /* reference counter */
115 unsigned int flags; /* flags */ 131 unsigned int flags; /* flags */
116} ____cacheline_aligned; 132} ____cacheline_aligned;
117 133
118static struct iosapic_intr_info { 134static struct iosapic_intr_info {
119 struct list_head rtes; /* RTEs using this vector (empty => not an IOSAPIC interrupt) */ 135 struct list_head rtes; /* RTEs using this vector (empty =>
136 * not an IOSAPIC interrupt) */
120 int count; /* # of RTEs that shares this vector */ 137 int count; /* # of RTEs that shares this vector */
121 u32 low32; /* current value of low word of Redirection table entry */ 138 u32 low32; /* current value of low word of
139 * Redirection table entry */
122 unsigned int dest; /* destination CPU physical ID */ 140 unsigned int dest; /* destination CPU physical ID */
123 unsigned char dmode : 3; /* delivery mode (see iosapic.h) */ 141 unsigned char dmode : 3; /* delivery mode (see iosapic.h) */
124 unsigned char polarity: 1; /* interrupt polarity (see iosapic.h) */ 142 unsigned char polarity: 1; /* interrupt polarity
143 * (see iosapic.h) */
125 unsigned char trigger : 1; /* trigger mode (see iosapic.h) */ 144 unsigned char trigger : 1; /* trigger mode (see iosapic.h) */
126} iosapic_intr_info[IA64_NUM_VECTORS]; 145} iosapic_intr_info[IA64_NUM_VECTORS];
127 146
128static struct iosapic { 147static struct iosapic {
129 char __iomem *addr; /* base address of IOSAPIC */ 148 char __iomem *addr; /* base address of IOSAPIC */
130 unsigned int gsi_base; /* first GSI assigned to this IOSAPIC */ 149 unsigned int gsi_base; /* first GSI assigned to this
131 unsigned short num_rte; /* number of RTE in this IOSAPIC */ 150 * IOSAPIC */
151 unsigned short num_rte; /* # of RTEs on this IOSAPIC */
132 int rtes_inuse; /* # of RTEs in use on this IOSAPIC */ 152 int rtes_inuse; /* # of RTEs in use on this IOSAPIC */
133#ifdef CONFIG_NUMA 153#ifdef CONFIG_NUMA
134 unsigned short node; /* numa node association via pxm */ 154 unsigned short node; /* numa node association via pxm */
@@ -149,7 +169,8 @@ find_iosapic (unsigned int gsi)
149 int i; 169 int i;
150 170
151 for (i = 0; i < NR_IOSAPICS; i++) { 171 for (i = 0; i < NR_IOSAPICS; i++) {
152 if ((unsigned) (gsi - iosapic_lists[i].gsi_base) < iosapic_lists[i].num_rte) 172 if ((unsigned) (gsi - iosapic_lists[i].gsi_base) <
173 iosapic_lists[i].num_rte)
153 return i; 174 return i;
154 } 175 }
155 176
@@ -162,7 +183,8 @@ _gsi_to_vector (unsigned int gsi)
162 struct iosapic_intr_info *info; 183 struct iosapic_intr_info *info;
163 struct iosapic_rte_info *rte; 184 struct iosapic_rte_info *rte;
164 185
165 for (info = iosapic_intr_info; info < iosapic_intr_info + IA64_NUM_VECTORS; ++info) 186 for (info = iosapic_intr_info; info <
187 iosapic_intr_info + IA64_NUM_VECTORS; ++info)
166 list_for_each_entry(rte, &info->rtes, rte_list) 188 list_for_each_entry(rte, &info->rtes, rte_list)
167 if (rte->gsi_base + rte->rte_index == gsi) 189 if (rte->gsi_base + rte->rte_index == gsi)
168 return info - iosapic_intr_info; 190 return info - iosapic_intr_info;
@@ -185,8 +207,8 @@ gsi_to_irq (unsigned int gsi)
185 unsigned long flags; 207 unsigned long flags;
186 int irq; 208 int irq;
187 /* 209 /*
188 * XXX fix me: this assumes an identity mapping vetween IA-64 vector and Linux irq 210 * XXX fix me: this assumes an identity mapping between IA-64 vector
189 * numbers... 211 * and Linux irq numbers...
190 */ 212 */
191 spin_lock_irqsave(&iosapic_lock, flags); 213 spin_lock_irqsave(&iosapic_lock, flags);
192 { 214 {
@@ -197,7 +219,8 @@ gsi_to_irq (unsigned int gsi)
197 return irq; 219 return irq;
198} 220}
199 221
200static struct iosapic_rte_info *gsi_vector_to_rte(unsigned int gsi, unsigned int vec) 222static struct iosapic_rte_info *gsi_vector_to_rte(unsigned int gsi,
223 unsigned int vec)
201{ 224{
202 struct iosapic_rte_info *rte; 225 struct iosapic_rte_info *rte;
203 226
@@ -237,7 +260,9 @@ set_rte (unsigned int gsi, unsigned int vector, unsigned int dest, int mask)
237 260
238 for (irq = 0; irq < NR_IRQS; ++irq) 261 for (irq = 0; irq < NR_IRQS; ++irq)
239 if (irq_to_vector(irq) == vector) { 262 if (irq_to_vector(irq) == vector) {
240 set_irq_affinity_info(irq, (int)(dest & 0xffff), redir); 263 set_irq_affinity_info(irq,
264 (int)(dest & 0xffff),
265 redir);
241 break; 266 break;
242 } 267 }
243 } 268 }
@@ -259,7 +284,7 @@ set_rte (unsigned int gsi, unsigned int vector, unsigned int dest, int mask)
259} 284}
260 285
261static void 286static void
262nop (unsigned int vector) 287nop (unsigned int irq)
263{ 288{
264 /* do nothing... */ 289 /* do nothing... */
265} 290}
@@ -281,7 +306,8 @@ mask_irq (unsigned int irq)
281 { 306 {
282 /* set only the mask bit */ 307 /* set only the mask bit */
283 low32 = iosapic_intr_info[vec].low32 |= IOSAPIC_MASK; 308 low32 = iosapic_intr_info[vec].low32 |= IOSAPIC_MASK;
284 list_for_each_entry(rte, &iosapic_intr_info[vec].rtes, rte_list) { 309 list_for_each_entry(rte, &iosapic_intr_info[vec].rtes,
310 rte_list) {
285 addr = rte->addr; 311 addr = rte->addr;
286 rte_index = rte->rte_index; 312 rte_index = rte->rte_index;
287 iosapic_write(addr, IOSAPIC_RTE_LOW(rte_index), low32); 313 iosapic_write(addr, IOSAPIC_RTE_LOW(rte_index), low32);
@@ -306,7 +332,8 @@ unmask_irq (unsigned int irq)
306 spin_lock_irqsave(&iosapic_lock, flags); 332 spin_lock_irqsave(&iosapic_lock, flags);
307 { 333 {
308 low32 = iosapic_intr_info[vec].low32 &= ~IOSAPIC_MASK; 334 low32 = iosapic_intr_info[vec].low32 &= ~IOSAPIC_MASK;
309 list_for_each_entry(rte, &iosapic_intr_info[vec].rtes, rte_list) { 335 list_for_each_entry(rte, &iosapic_intr_info[vec].rtes,
336 rte_list) {
310 addr = rte->addr; 337 addr = rte->addr;
311 rte_index = rte->rte_index; 338 rte_index = rte->rte_index;
312 iosapic_write(addr, IOSAPIC_RTE_LOW(rte_index), low32); 339 iosapic_write(addr, IOSAPIC_RTE_LOW(rte_index), low32);
@@ -346,21 +373,25 @@ iosapic_set_affinity (unsigned int irq, cpumask_t mask)
346 373
347 spin_lock_irqsave(&iosapic_lock, flags); 374 spin_lock_irqsave(&iosapic_lock, flags);
348 { 375 {
349 low32 = iosapic_intr_info[vec].low32 & ~(7 << IOSAPIC_DELIVERY_SHIFT); 376 low32 = iosapic_intr_info[vec].low32 &
377 ~(7 << IOSAPIC_DELIVERY_SHIFT);
350 378
351 if (redir) 379 if (redir)
352 /* change delivery mode to lowest priority */ 380 /* change delivery mode to lowest priority */
353 low32 |= (IOSAPIC_LOWEST_PRIORITY << IOSAPIC_DELIVERY_SHIFT); 381 low32 |= (IOSAPIC_LOWEST_PRIORITY <<
382 IOSAPIC_DELIVERY_SHIFT);
354 else 383 else
355 /* change delivery mode to fixed */ 384 /* change delivery mode to fixed */
356 low32 |= (IOSAPIC_FIXED << IOSAPIC_DELIVERY_SHIFT); 385 low32 |= (IOSAPIC_FIXED << IOSAPIC_DELIVERY_SHIFT);
357 386
358 iosapic_intr_info[vec].low32 = low32; 387 iosapic_intr_info[vec].low32 = low32;
359 iosapic_intr_info[vec].dest = dest; 388 iosapic_intr_info[vec].dest = dest;
360 list_for_each_entry(rte, &iosapic_intr_info[vec].rtes, rte_list) { 389 list_for_each_entry(rte, &iosapic_intr_info[vec].rtes,
390 rte_list) {
361 addr = rte->addr; 391 addr = rte->addr;
362 rte_index = rte->rte_index; 392 rte_index = rte->rte_index;
363 iosapic_write(addr, IOSAPIC_RTE_HIGH(rte_index), high32); 393 iosapic_write(addr, IOSAPIC_RTE_HIGH(rte_index),
394 high32);
364 iosapic_write(addr, IOSAPIC_RTE_LOW(rte_index), low32); 395 iosapic_write(addr, IOSAPIC_RTE_LOW(rte_index), low32);
365 } 396 }
366 } 397 }
@@ -433,7 +464,8 @@ iosapic_ack_edge_irq (unsigned int irq)
433 * interrupt for real. This prevents IRQ storms from unhandled 464 * interrupt for real. This prevents IRQ storms from unhandled
434 * devices. 465 * devices.
435 */ 466 */
436 if ((idesc->status & (IRQ_PENDING|IRQ_DISABLED)) == (IRQ_PENDING|IRQ_DISABLED)) 467 if ((idesc->status & (IRQ_PENDING|IRQ_DISABLED)) ==
468 (IRQ_PENDING|IRQ_DISABLED))
437 mask_irq(irq); 469 mask_irq(irq);
438} 470}
439 471
@@ -467,7 +499,8 @@ iosapic_version (char __iomem *addr)
467 return iosapic_read(addr, IOSAPIC_VERSION); 499 return iosapic_read(addr, IOSAPIC_VERSION);
468} 500}
469 501
470static int iosapic_find_sharable_vector (unsigned long trigger, unsigned long pol) 502static int iosapic_find_sharable_vector (unsigned long trigger,
503 unsigned long pol)
471{ 504{
472 int i, vector = -1, min_count = -1; 505 int i, vector = -1, min_count = -1;
473 struct iosapic_intr_info *info; 506 struct iosapic_intr_info *info;
@@ -482,7 +515,8 @@ static int iosapic_find_sharable_vector (unsigned long trigger, unsigned long po
482 for (i = IA64_FIRST_DEVICE_VECTOR; i <= IA64_LAST_DEVICE_VECTOR; i++) { 515 for (i = IA64_FIRST_DEVICE_VECTOR; i <= IA64_LAST_DEVICE_VECTOR; i++) {
483 info = &iosapic_intr_info[i]; 516 info = &iosapic_intr_info[i];
484 if (info->trigger == trigger && info->polarity == pol && 517 if (info->trigger == trigger && info->polarity == pol &&
485 (info->dmode == IOSAPIC_FIXED || info->dmode == IOSAPIC_LOWEST_PRIORITY)) { 518 (info->dmode == IOSAPIC_FIXED || info->dmode ==
519 IOSAPIC_LOWEST_PRIORITY)) {
486 if (min_count == -1 || info->count < min_count) { 520 if (min_count == -1 || info->count < min_count) {
487 vector = i; 521 vector = i;
488 min_count = info->count; 522 min_count = info->count;
@@ -506,12 +540,15 @@ iosapic_reassign_vector (int vector)
506 new_vector = assign_irq_vector(AUTO_ASSIGN); 540 new_vector = assign_irq_vector(AUTO_ASSIGN);
507 if (new_vector < 0) 541 if (new_vector < 0)
508 panic("%s: out of interrupt vectors!\n", __FUNCTION__); 542 panic("%s: out of interrupt vectors!\n", __FUNCTION__);
509 printk(KERN_INFO "Reassigning vector %d to %d\n", vector, new_vector); 543 printk(KERN_INFO "Reassigning vector %d to %d\n",
544 vector, new_vector);
510 memcpy(&iosapic_intr_info[new_vector], &iosapic_intr_info[vector], 545 memcpy(&iosapic_intr_info[new_vector], &iosapic_intr_info[vector],
511 sizeof(struct iosapic_intr_info)); 546 sizeof(struct iosapic_intr_info));
512 INIT_LIST_HEAD(&iosapic_intr_info[new_vector].rtes); 547 INIT_LIST_HEAD(&iosapic_intr_info[new_vector].rtes);
513 list_move(iosapic_intr_info[vector].rtes.next, &iosapic_intr_info[new_vector].rtes); 548 list_move(iosapic_intr_info[vector].rtes.next,
514 memset(&iosapic_intr_info[vector], 0, sizeof(struct iosapic_intr_info)); 549 &iosapic_intr_info[new_vector].rtes);
550 memset(&iosapic_intr_info[vector], 0,
551 sizeof(struct iosapic_intr_info));
515 iosapic_intr_info[vector].low32 = IOSAPIC_MASK; 552 iosapic_intr_info[vector].low32 = IOSAPIC_MASK;
516 INIT_LIST_HEAD(&iosapic_intr_info[vector].rtes); 553 INIT_LIST_HEAD(&iosapic_intr_info[vector].rtes);
517 } 554 }
@@ -524,7 +561,8 @@ static struct iosapic_rte_info *iosapic_alloc_rte (void)
524 int preallocated = 0; 561 int preallocated = 0;
525 562
526 if (!iosapic_kmalloc_ok && list_empty(&free_rte_list)) { 563 if (!iosapic_kmalloc_ok && list_empty(&free_rte_list)) {
527 rte = alloc_bootmem(sizeof(struct iosapic_rte_info) * NR_PREALLOCATE_RTE_ENTRIES); 564 rte = alloc_bootmem(sizeof(struct iosapic_rte_info) *
565 NR_PREALLOCATE_RTE_ENTRIES);
528 if (!rte) 566 if (!rte)
529 return NULL; 567 return NULL;
530 for (i = 0; i < NR_PREALLOCATE_RTE_ENTRIES; i++, rte++) 568 for (i = 0; i < NR_PREALLOCATE_RTE_ENTRIES; i++, rte++)
@@ -532,7 +570,8 @@ static struct iosapic_rte_info *iosapic_alloc_rte (void)
532 } 570 }
533 571
534 if (!list_empty(&free_rte_list)) { 572 if (!list_empty(&free_rte_list)) {
535 rte = list_entry(free_rte_list.next, struct iosapic_rte_info, rte_list); 573 rte = list_entry(free_rte_list.next, struct iosapic_rte_info,
574 rte_list);
536 list_del(&rte->rte_list); 575 list_del(&rte->rte_list);
537 preallocated++; 576 preallocated++;
538 } else { 577 } else {
@@ -575,7 +614,8 @@ register_intr (unsigned int gsi, int vector, unsigned char delivery,
575 614
576 index = find_iosapic(gsi); 615 index = find_iosapic(gsi);
577 if (index < 0) { 616 if (index < 0) {
578 printk(KERN_WARNING "%s: No IOSAPIC for GSI %u\n", __FUNCTION__, gsi); 617 printk(KERN_WARNING "%s: No IOSAPIC for GSI %u\n",
618 __FUNCTION__, gsi);
579 return -ENODEV; 619 return -ENODEV;
580 } 620 }
581 621
@@ -586,7 +626,8 @@ register_intr (unsigned int gsi, int vector, unsigned char delivery,
586 if (!rte) { 626 if (!rte) {
587 rte = iosapic_alloc_rte(); 627 rte = iosapic_alloc_rte();
588 if (!rte) { 628 if (!rte) {
589 printk(KERN_WARNING "%s: cannot allocate memory\n", __FUNCTION__); 629 printk(KERN_WARNING "%s: cannot allocate memory\n",
630 __FUNCTION__);
590 return -ENOMEM; 631 return -ENOMEM;
591 } 632 }
592 633
@@ -602,7 +643,9 @@ register_intr (unsigned int gsi, int vector, unsigned char delivery,
602 else if (vector_is_shared(vector)) { 643 else if (vector_is_shared(vector)) {
603 struct iosapic_intr_info *info = &iosapic_intr_info[vector]; 644 struct iosapic_intr_info *info = &iosapic_intr_info[vector];
604 if (info->trigger != trigger || info->polarity != polarity) { 645 if (info->trigger != trigger || info->polarity != polarity) {
605 printk (KERN_WARNING "%s: cannot override the interrupt\n", __FUNCTION__); 646 printk (KERN_WARNING
647 "%s: cannot override the interrupt\n",
648 __FUNCTION__);
606 return -EINVAL; 649 return -EINVAL;
607 } 650 }
608 } 651 }
@@ -619,8 +662,10 @@ register_intr (unsigned int gsi, int vector, unsigned char delivery,
619 idesc = irq_descp(vector); 662 idesc = irq_descp(vector);
620 if (idesc->handler != irq_type) { 663 if (idesc->handler != irq_type) {
621 if (idesc->handler != &no_irq_type) 664 if (idesc->handler != &no_irq_type)
622 printk(KERN_WARNING "%s: changing vector %d from %s to %s\n", 665 printk(KERN_WARNING
623 __FUNCTION__, vector, idesc->handler->typename, irq_type->typename); 666 "%s: changing vector %d from %s to %s\n",
667 __FUNCTION__, vector,
668 idesc->handler->typename, irq_type->typename);
624 idesc->handler = irq_type; 669 idesc->handler = irq_type;
625 } 670 }
626 return 0; 671 return 0;
@@ -631,6 +676,7 @@ get_target_cpu (unsigned int gsi, int vector)
631{ 676{
632#ifdef CONFIG_SMP 677#ifdef CONFIG_SMP
633 static int cpu = -1; 678 static int cpu = -1;
679 extern int cpe_vector;
634 680
635 /* 681 /*
636 * In case of vector shared by multiple RTEs, all RTEs that 682 * In case of vector shared by multiple RTEs, all RTEs that
@@ -653,6 +699,11 @@ get_target_cpu (unsigned int gsi, int vector)
653 if (!cpu_online(smp_processor_id())) 699 if (!cpu_online(smp_processor_id()))
654 return cpu_physical_id(smp_processor_id()); 700 return cpu_physical_id(smp_processor_id());
655 701
702#ifdef CONFIG_ACPI
703 if (cpe_vector > 0 && vector == IA64_CPEP_VECTOR)
704 return get_cpei_target_cpu();
705#endif
706
656#ifdef CONFIG_NUMA 707#ifdef CONFIG_NUMA
657 { 708 {
658 int num_cpus, cpu_index, iosapic_index, numa_cpu, i = 0; 709 int num_cpus, cpu_index, iosapic_index, numa_cpu, i = 0;
@@ -675,7 +726,7 @@ get_target_cpu (unsigned int gsi, int vector)
675 if (!num_cpus) 726 if (!num_cpus)
676 goto skip_numa_setup; 727 goto skip_numa_setup;
677 728
678 /* Use vector assigment to distribute across cpus in node */ 729 /* Use vector assignment to distribute across cpus in node */
679 cpu_index = vector % num_cpus; 730 cpu_index = vector % num_cpus;
680 731
681 for (numa_cpu = first_cpu(cpu_mask) ; i < cpu_index ; i++) 732 for (numa_cpu = first_cpu(cpu_mask) ; i < cpu_index ; i++)
@@ -697,7 +748,7 @@ skip_numa_setup:
697 } while (!cpu_online(cpu)); 748 } while (!cpu_online(cpu));
698 749
699 return cpu_physical_id(cpu); 750 return cpu_physical_id(cpu);
700#else 751#else /* CONFIG_SMP */
701 return cpu_physical_id(smp_processor_id()); 752 return cpu_physical_id(smp_processor_id());
702#endif 753#endif
703} 754}
@@ -749,7 +800,8 @@ again:
749 if (list_empty(&iosapic_intr_info[vector].rtes)) 800 if (list_empty(&iosapic_intr_info[vector].rtes))
750 free_irq_vector(vector); 801 free_irq_vector(vector);
751 spin_unlock(&iosapic_lock); 802 spin_unlock(&iosapic_lock);
752 spin_unlock_irqrestore(&irq_descp(vector)->lock, flags); 803 spin_unlock_irqrestore(&irq_descp(vector)->lock,
804 flags);
753 goto again; 805 goto again;
754 } 806 }
755 807
@@ -758,7 +810,8 @@ again:
758 polarity, trigger); 810 polarity, trigger);
759 if (err < 0) { 811 if (err < 0) {
760 spin_unlock(&iosapic_lock); 812 spin_unlock(&iosapic_lock);
761 spin_unlock_irqrestore(&irq_descp(vector)->lock, flags); 813 spin_unlock_irqrestore(&irq_descp(vector)->lock,
814 flags);
762 return err; 815 return err;
763 } 816 }
764 817
@@ -800,7 +853,8 @@ iosapic_unregister_intr (unsigned int gsi)
800 */ 853 */
801 irq = gsi_to_irq(gsi); 854 irq = gsi_to_irq(gsi);
802 if (irq < 0) { 855 if (irq < 0) {
803 printk(KERN_ERR "iosapic_unregister_intr(%u) unbalanced\n", gsi); 856 printk(KERN_ERR "iosapic_unregister_intr(%u) unbalanced\n",
857 gsi);
804 WARN_ON(1); 858 WARN_ON(1);
805 return; 859 return;
806 } 860 }
@@ -811,7 +865,9 @@ iosapic_unregister_intr (unsigned int gsi)
811 spin_lock(&iosapic_lock); 865 spin_lock(&iosapic_lock);
812 { 866 {
813 if ((rte = gsi_vector_to_rte(gsi, vector)) == NULL) { 867 if ((rte = gsi_vector_to_rte(gsi, vector)) == NULL) {
814 printk(KERN_ERR "iosapic_unregister_intr(%u) unbalanced\n", gsi); 868 printk(KERN_ERR
869 "iosapic_unregister_intr(%u) unbalanced\n",
870 gsi);
815 WARN_ON(1); 871 WARN_ON(1);
816 goto out; 872 goto out;
817 } 873 }
@@ -821,7 +877,8 @@ iosapic_unregister_intr (unsigned int gsi)
821 877
822 /* Mask the interrupt */ 878 /* Mask the interrupt */
823 low32 = iosapic_intr_info[vector].low32 | IOSAPIC_MASK; 879 low32 = iosapic_intr_info[vector].low32 | IOSAPIC_MASK;
824 iosapic_write(rte->addr, IOSAPIC_RTE_LOW(rte->rte_index), low32); 880 iosapic_write(rte->addr, IOSAPIC_RTE_LOW(rte->rte_index),
881 low32);
825 882
826 /* Remove the rte entry from the list */ 883 /* Remove the rte entry from the list */
827 list_del(&rte->rte_list); 884 list_del(&rte->rte_list);
@@ -834,7 +891,9 @@ iosapic_unregister_intr (unsigned int gsi)
834 trigger = iosapic_intr_info[vector].trigger; 891 trigger = iosapic_intr_info[vector].trigger;
835 polarity = iosapic_intr_info[vector].polarity; 892 polarity = iosapic_intr_info[vector].polarity;
836 dest = iosapic_intr_info[vector].dest; 893 dest = iosapic_intr_info[vector].dest;
837 printk(KERN_INFO "GSI %u (%s, %s) -> CPU %d (0x%04x) vector %d unregistered\n", 894 printk(KERN_INFO
895 "GSI %u (%s, %s) -> CPU %d (0x%04x)"
896 " vector %d unregistered\n",
838 gsi, (trigger == IOSAPIC_EDGE ? "edge" : "level"), 897 gsi, (trigger == IOSAPIC_EDGE ? "edge" : "level"),
839 (polarity == IOSAPIC_POL_HIGH ? "high" : "low"), 898 (polarity == IOSAPIC_POL_HIGH ? "high" : "low"),
840 cpu_logical_id(dest), dest, vector); 899 cpu_logical_id(dest), dest, vector);
@@ -847,12 +906,15 @@ iosapic_unregister_intr (unsigned int gsi)
847 idesc->handler = &no_irq_type; 906 idesc->handler = &no_irq_type;
848 907
849 /* Clear the interrupt information */ 908 /* Clear the interrupt information */
850 memset(&iosapic_intr_info[vector], 0, sizeof(struct iosapic_intr_info)); 909 memset(&iosapic_intr_info[vector], 0,
910 sizeof(struct iosapic_intr_info));
851 iosapic_intr_info[vector].low32 |= IOSAPIC_MASK; 911 iosapic_intr_info[vector].low32 |= IOSAPIC_MASK;
852 INIT_LIST_HEAD(&iosapic_intr_info[vector].rtes); 912 INIT_LIST_HEAD(&iosapic_intr_info[vector].rtes);
853 913
854 if (idesc->action) { 914 if (idesc->action) {
855 printk(KERN_ERR "interrupt handlers still exist on IRQ %u\n", irq); 915 printk(KERN_ERR
916 "interrupt handlers still exist on"
917 "IRQ %u\n", irq);
856 WARN_ON(1); 918 WARN_ON(1);
857 } 919 }
858 920
@@ -867,7 +929,6 @@ iosapic_unregister_intr (unsigned int gsi)
867 929
868/* 930/*
869 * ACPI calls this when it finds an entry for a platform interrupt. 931 * ACPI calls this when it finds an entry for a platform interrupt.
870 * Note that the irq_base and IOSAPIC address must be set in iosapic_init().
871 */ 932 */
872int __init 933int __init
873iosapic_register_platform_intr (u32 int_type, unsigned int gsi, 934iosapic_register_platform_intr (u32 int_type, unsigned int gsi,
@@ -901,13 +962,16 @@ iosapic_register_platform_intr (u32 int_type, unsigned int gsi,
901 mask = 1; 962 mask = 1;
902 break; 963 break;
903 default: 964 default:
904 printk(KERN_ERR "iosapic_register_platform_irq(): invalid int type 0x%x\n", int_type); 965 printk(KERN_ERR "%s: invalid int type 0x%x\n", __FUNCTION__,
966 int_type);
905 return -1; 967 return -1;
906 } 968 }
907 969
908 register_intr(gsi, vector, delivery, polarity, trigger); 970 register_intr(gsi, vector, delivery, polarity, trigger);
909 971
910 printk(KERN_INFO "PLATFORM int %s (0x%x): GSI %u (%s, %s) -> CPU %d (0x%04x) vector %d\n", 972 printk(KERN_INFO
973 "PLATFORM int %s (0x%x): GSI %u (%s, %s) -> CPU %d (0x%04x)"
974 " vector %d\n",
911 int_type < ARRAY_SIZE(name) ? name[int_type] : "unknown", 975 int_type < ARRAY_SIZE(name) ? name[int_type] : "unknown",
912 int_type, gsi, (trigger == IOSAPIC_EDGE ? "edge" : "level"), 976 int_type, gsi, (trigger == IOSAPIC_EDGE ? "edge" : "level"),
913 (polarity == IOSAPIC_POL_HIGH ? "high" : "low"), 977 (polarity == IOSAPIC_POL_HIGH ? "high" : "low"),
@@ -917,10 +981,8 @@ iosapic_register_platform_intr (u32 int_type, unsigned int gsi,
917 return vector; 981 return vector;
918} 982}
919 983
920
921/* 984/*
922 * ACPI calls this when it finds an entry for a legacy ISA IRQ override. 985 * ACPI calls this when it finds an entry for a legacy ISA IRQ override.
923 * Note that the gsi_base and IOSAPIC address must be set in iosapic_init().
924 */ 986 */
925void __init 987void __init
926iosapic_override_isa_irq (unsigned int isa_irq, unsigned int gsi, 988iosapic_override_isa_irq (unsigned int isa_irq, unsigned int gsi,
@@ -949,16 +1011,19 @@ iosapic_system_init (int system_pcat_compat)
949 1011
950 for (vector = 0; vector < IA64_NUM_VECTORS; ++vector) { 1012 for (vector = 0; vector < IA64_NUM_VECTORS; ++vector) {
951 iosapic_intr_info[vector].low32 = IOSAPIC_MASK; 1013 iosapic_intr_info[vector].low32 = IOSAPIC_MASK;
952 INIT_LIST_HEAD(&iosapic_intr_info[vector].rtes); /* mark as unused */ 1014 /* mark as unused */
1015 INIT_LIST_HEAD(&iosapic_intr_info[vector].rtes);
953 } 1016 }
954 1017
955 pcat_compat = system_pcat_compat; 1018 pcat_compat = system_pcat_compat;
956 if (pcat_compat) { 1019 if (pcat_compat) {
957 /* 1020 /*
958 * Disable the compatibility mode interrupts (8259 style), needs IN/OUT support 1021 * Disable the compatibility mode interrupts (8259 style),
959 * enabled. 1022 * needs IN/OUT support enabled.
960 */ 1023 */
961 printk(KERN_INFO "%s: Disabling PC-AT compatible 8259 interrupts\n", __FUNCTION__); 1024 printk(KERN_INFO
1025 "%s: Disabling PC-AT compatible 8259 interrupts\n",
1026 __FUNCTION__);
962 outb(0xff, 0xA1); 1027 outb(0xff, 0xA1);
963 outb(0xff, 0x21); 1028 outb(0xff, 0x21);
964 } 1029 }
@@ -998,10 +1063,7 @@ iosapic_check_gsi_range (unsigned int gsi_base, unsigned int ver)
998 base = iosapic_lists[index].gsi_base; 1063 base = iosapic_lists[index].gsi_base;
999 end = base + iosapic_lists[index].num_rte - 1; 1064 end = base + iosapic_lists[index].num_rte - 1;
1000 1065
1001 if (gsi_base < base && gsi_end < base) 1066 if (gsi_end < base || end < gsi_base)
1002 continue;/* OK */
1003
1004 if (gsi_base > end && gsi_end > end)
1005 continue; /* OK */ 1067 continue; /* OK */
1006 1068
1007 return -EBUSY; 1069 return -EBUSY;
@@ -1047,12 +1109,14 @@ iosapic_init (unsigned long phys_addr, unsigned int gsi_base)
1047 1109
1048 if ((gsi_base == 0) && pcat_compat) { 1110 if ((gsi_base == 0) && pcat_compat) {
1049 /* 1111 /*
1050 * Map the legacy ISA devices into the IOSAPIC data. Some of these may 1112 * Map the legacy ISA devices into the IOSAPIC data. Some of
1051 * get reprogrammed later on with data from the ACPI Interrupt Source 1113 * these may get reprogrammed later on with data from the ACPI
1052 * Override table. 1114 * Interrupt Source Override table.
1053 */ 1115 */
1054 for (isa_irq = 0; isa_irq < 16; ++isa_irq) 1116 for (isa_irq = 0; isa_irq < 16; ++isa_irq)
1055 iosapic_override_isa_irq(isa_irq, isa_irq, IOSAPIC_POL_HIGH, IOSAPIC_EDGE); 1117 iosapic_override_isa_irq(isa_irq, isa_irq,
1118 IOSAPIC_POL_HIGH,
1119 IOSAPIC_EDGE);
1056 } 1120 }
1057 return 0; 1121 return 0;
1058} 1122}
@@ -1075,7 +1139,8 @@ iosapic_remove (unsigned int gsi_base)
1075 1139
1076 if (iosapic_lists[index].rtes_inuse) { 1140 if (iosapic_lists[index].rtes_inuse) {
1077 err = -EBUSY; 1141 err = -EBUSY;
1078 printk(KERN_WARNING "%s: IOSAPIC for GSI base %u is busy\n", 1142 printk(KERN_WARNING
1143 "%s: IOSAPIC for GSI base %u is busy\n",
1079 __FUNCTION__, gsi_base); 1144 __FUNCTION__, gsi_base);
1080 goto out; 1145 goto out;
1081 } 1146 }
diff --git a/arch/ia64/kernel/irq.c b/arch/ia64/kernel/irq.c
index d33244c32759..5ce908ef9c95 100644
--- a/arch/ia64/kernel/irq.c
+++ b/arch/ia64/kernel/irq.c
@@ -163,8 +163,19 @@ void fixup_irqs(void)
163{ 163{
164 unsigned int irq; 164 unsigned int irq;
165 extern void ia64_process_pending_intr(void); 165 extern void ia64_process_pending_intr(void);
166 extern void ia64_disable_timer(void);
167 extern volatile int time_keeper_id;
168
169 ia64_disable_timer();
170
171 /*
172 * Find a new timesync master
173 */
174 if (smp_processor_id() == time_keeper_id) {
175 time_keeper_id = first_cpu(cpu_online_map);
176 printk ("CPU %d is now promoted to time-keeper master\n", time_keeper_id);
177 }
166 178
167 ia64_set_itv(1<<16);
168 /* 179 /*
169 * Phase 1: Locate irq's bound to this cpu and 180 * Phase 1: Locate irq's bound to this cpu and
170 * relocate them for cpu removal. 181 * relocate them for cpu removal.
diff --git a/arch/ia64/kernel/ivt.S b/arch/ia64/kernel/ivt.S
index dcd906fe5749..829a43cab797 100644
--- a/arch/ia64/kernel/ivt.S
+++ b/arch/ia64/kernel/ivt.S
@@ -865,6 +865,7 @@ ENTRY(interrupt)
865 ;; 865 ;;
866 SAVE_REST 866 SAVE_REST
867 ;; 867 ;;
868 MCA_RECOVER_RANGE(interrupt)
868 alloc r14=ar.pfs,0,0,2,0 // must be first in an insn group 869 alloc r14=ar.pfs,0,0,2,0 // must be first in an insn group
869 mov out0=cr.ivr // pass cr.ivr as first arg 870 mov out0=cr.ivr // pass cr.ivr as first arg
870 add out1=16,sp // pass pointer to pt_regs as second arg 871 add out1=16,sp // pass pointer to pt_regs as second arg
diff --git a/arch/ia64/kernel/kprobes.c b/arch/ia64/kernel/kprobes.c
index 50ae8c7d453d..789881ca83d4 100644
--- a/arch/ia64/kernel/kprobes.c
+++ b/arch/ia64/kernel/kprobes.c
@@ -34,6 +34,7 @@
34#include <asm/pgtable.h> 34#include <asm/pgtable.h>
35#include <asm/kdebug.h> 35#include <asm/kdebug.h>
36#include <asm/sections.h> 36#include <asm/sections.h>
37#include <asm/uaccess.h>
37 38
38extern void jprobe_inst_return(void); 39extern void jprobe_inst_return(void);
39 40
@@ -722,13 +723,50 @@ static int __kprobes kprobes_fault_handler(struct pt_regs *regs, int trapnr)
722 struct kprobe *cur = kprobe_running(); 723 struct kprobe *cur = kprobe_running();
723 struct kprobe_ctlblk *kcb = get_kprobe_ctlblk(); 724 struct kprobe_ctlblk *kcb = get_kprobe_ctlblk();
724 725
725 if (cur->fault_handler && cur->fault_handler(cur, regs, trapnr))
726 return 1;
727 726
728 if (kcb->kprobe_status & KPROBE_HIT_SS) { 727 switch(kcb->kprobe_status) {
729 resume_execution(cur, regs); 728 case KPROBE_HIT_SS:
730 reset_current_kprobe(); 729 case KPROBE_REENTER:
730 /*
731 * We are here because the instruction being single
732 * stepped caused a page fault. We reset the current
733 * kprobe and the instruction pointer points back to
734 * the probe address and allow the page fault handler
735 * to continue as a normal page fault.
736 */
737 regs->cr_iip = ((unsigned long)cur->addr) & ~0xFULL;
738 ia64_psr(regs)->ri = ((unsigned long)cur->addr) & 0xf;
739 if (kcb->kprobe_status == KPROBE_REENTER)
740 restore_previous_kprobe(kcb);
741 else
742 reset_current_kprobe();
731 preempt_enable_no_resched(); 743 preempt_enable_no_resched();
744 break;
745 case KPROBE_HIT_ACTIVE:
746 case KPROBE_HIT_SSDONE:
747 /*
748 * We increment the nmissed count for accounting,
749 * we can also use npre/npostfault count for accouting
750 * these specific fault cases.
751 */
752 kprobes_inc_nmissed_count(cur);
753
754 /*
755 * We come here because instructions in the pre/post
756 * handler caused the page_fault, this could happen
757 * if handler tries to access user space by
758 * copy_from_user(), get_user() etc. Let the
759 * user-specified handler try to fix it first.
760 */
761 if (cur->fault_handler && cur->fault_handler(cur, regs, trapnr))
762 return 1;
763
764 /*
765 * Let ia64_do_page_fault() fix it.
766 */
767 break;
768 default:
769 break;
732 } 770 }
733 771
734 return 0; 772 return 0;
@@ -740,6 +778,9 @@ int __kprobes kprobe_exceptions_notify(struct notifier_block *self,
740 struct die_args *args = (struct die_args *)data; 778 struct die_args *args = (struct die_args *)data;
741 int ret = NOTIFY_DONE; 779 int ret = NOTIFY_DONE;
742 780
781 if (args->regs && user_mode(args->regs))
782 return ret;
783
743 switch(val) { 784 switch(val) {
744 case DIE_BREAK: 785 case DIE_BREAK:
745 /* err is break number from ia64_bad_break() */ 786 /* err is break number from ia64_bad_break() */
diff --git a/arch/ia64/kernel/machvec.c b/arch/ia64/kernel/machvec.c
index c3a04ee7f4f6..4b0b71d5aef4 100644
--- a/arch/ia64/kernel/machvec.c
+++ b/arch/ia64/kernel/machvec.c
@@ -14,7 +14,15 @@
14struct ia64_machine_vector ia64_mv; 14struct ia64_machine_vector ia64_mv;
15EXPORT_SYMBOL(ia64_mv); 15EXPORT_SYMBOL(ia64_mv);
16 16
17static struct ia64_machine_vector * 17static __initdata const char *mvec_name;
18static __init int setup_mvec(char *s)
19{
20 mvec_name = s;
21 return 0;
22}
23early_param("machvec", setup_mvec);
24
25static struct ia64_machine_vector * __init
18lookup_machvec (const char *name) 26lookup_machvec (const char *name)
19{ 27{
20 extern struct ia64_machine_vector machvec_start[]; 28 extern struct ia64_machine_vector machvec_start[];
@@ -33,10 +41,13 @@ machvec_init (const char *name)
33{ 41{
34 struct ia64_machine_vector *mv; 42 struct ia64_machine_vector *mv;
35 43
44 if (!name)
45 name = mvec_name ? mvec_name : acpi_get_sysname();
36 mv = lookup_machvec(name); 46 mv = lookup_machvec(name);
37 if (!mv) { 47 if (!mv)
38 panic("generic kernel failed to find machine vector for platform %s!", name); 48 panic("generic kernel failed to find machine vector for"
39 } 49 " platform %s!", name);
50
40 ia64_mv = *mv; 51 ia64_mv = *mv;
41 printk(KERN_INFO "booting generic kernel on platform %s\n", name); 52 printk(KERN_INFO "booting generic kernel on platform %s\n", name);
42} 53}
diff --git a/arch/ia64/kernel/mca.c b/arch/ia64/kernel/mca.c
index ee7eec9ee576..8963171788d5 100644
--- a/arch/ia64/kernel/mca.c
+++ b/arch/ia64/kernel/mca.c
@@ -69,6 +69,7 @@
69#include <linux/kernel.h> 69#include <linux/kernel.h>
70#include <linux/smp.h> 70#include <linux/smp.h>
71#include <linux/workqueue.h> 71#include <linux/workqueue.h>
72#include <linux/cpumask.h>
72 73
73#include <asm/delay.h> 74#include <asm/delay.h>
74#include <asm/kdebug.h> 75#include <asm/kdebug.h>
@@ -83,6 +84,7 @@
83#include <asm/irq.h> 84#include <asm/irq.h>
84#include <asm/hw_irq.h> 85#include <asm/hw_irq.h>
85 86
87#include "mca_drv.h"
86#include "entry.h" 88#include "entry.h"
87 89
88#if defined(IA64_MCA_DEBUG_INFO) 90#if defined(IA64_MCA_DEBUG_INFO)
@@ -133,7 +135,7 @@ static int cpe_poll_enabled = 1;
133 135
134extern void salinfo_log_wakeup(int type, u8 *buffer, u64 size, int irqsafe); 136extern void salinfo_log_wakeup(int type, u8 *buffer, u64 size, int irqsafe);
135 137
136static int mca_init; 138static int mca_init __initdata;
137 139
138 140
139static void inline 141static void inline
@@ -184,7 +186,7 @@ static ia64_state_log_t ia64_state_log[IA64_MAX_LOG_TYPES];
184 * Inputs : info_type (SAL_INFO_TYPE_{MCA,INIT,CMC,CPE}) 186 * Inputs : info_type (SAL_INFO_TYPE_{MCA,INIT,CMC,CPE})
185 * Outputs : None 187 * Outputs : None
186 */ 188 */
187static void 189static void __init
188ia64_log_init(int sal_info_type) 190ia64_log_init(int sal_info_type)
189{ 191{
190 u64 max_size = 0; 192 u64 max_size = 0;
@@ -282,13 +284,53 @@ ia64_mca_log_sal_error_record(int sal_info_type)
282} 284}
283 285
284/* 286/*
285 * platform dependent error handling 287 * search_mca_table
288 * See if the MCA surfaced in an instruction range
289 * that has been tagged as recoverable.
290 *
291 * Inputs
292 * first First address range to check
293 * last Last address range to check
294 * ip Instruction pointer, address we are looking for
295 *
296 * Return value:
297 * 1 on Success (in the table)/ 0 on Failure (not in the table)
286 */ 298 */
287#ifndef PLATFORM_MCA_HANDLERS 299int
300search_mca_table (const struct mca_table_entry *first,
301 const struct mca_table_entry *last,
302 unsigned long ip)
303{
304 const struct mca_table_entry *curr;
305 u64 curr_start, curr_end;
306
307 curr = first;
308 while (curr <= last) {
309 curr_start = (u64) &curr->start_addr + curr->start_addr;
310 curr_end = (u64) &curr->end_addr + curr->end_addr;
311
312 if ((ip >= curr_start) && (ip <= curr_end)) {
313 return 1;
314 }
315 curr++;
316 }
317 return 0;
318}
319
320/* Given an address, look for it in the mca tables. */
321int mca_recover_range(unsigned long addr)
322{
323 extern struct mca_table_entry __start___mca_table[];
324 extern struct mca_table_entry __stop___mca_table[];
325
326 return search_mca_table(__start___mca_table, __stop___mca_table-1, addr);
327}
328EXPORT_SYMBOL_GPL(mca_recover_range);
288 329
289#ifdef CONFIG_ACPI 330#ifdef CONFIG_ACPI
290 331
291int cpe_vector = -1; 332int cpe_vector = -1;
333int ia64_cpe_irq = -1;
292 334
293static irqreturn_t 335static irqreturn_t
294ia64_mca_cpe_int_handler (int cpe_irq, void *arg, struct pt_regs *ptregs) 336ia64_mca_cpe_int_handler (int cpe_irq, void *arg, struct pt_regs *ptregs)
@@ -359,7 +401,7 @@ ia64_mca_cpe_int_handler (int cpe_irq, void *arg, struct pt_regs *ptregs)
359 * Outputs 401 * Outputs
360 * None 402 * None
361 */ 403 */
362static void 404static void __init
363ia64_mca_register_cpev (int cpev) 405ia64_mca_register_cpev (int cpev)
364{ 406{
365 /* Register the CPE interrupt vector with SAL */ 407 /* Register the CPE interrupt vector with SAL */
@@ -377,8 +419,6 @@ ia64_mca_register_cpev (int cpev)
377} 419}
378#endif /* CONFIG_ACPI */ 420#endif /* CONFIG_ACPI */
379 421
380#endif /* PLATFORM_MCA_HANDLERS */
381
382/* 422/*
383 * ia64_mca_cmc_vector_setup 423 * ia64_mca_cmc_vector_setup
384 * 424 *
@@ -392,7 +432,7 @@ ia64_mca_register_cpev (int cpev)
392 * Outputs 432 * Outputs
393 * None 433 * None
394 */ 434 */
395void 435void __cpuinit
396ia64_mca_cmc_vector_setup (void) 436ia64_mca_cmc_vector_setup (void)
397{ 437{
398 cmcv_reg_t cmcv; 438 cmcv_reg_t cmcv;
@@ -630,6 +670,32 @@ copy_reg(const u64 *fr, u64 fnat, u64 *tr, u64 *tnat)
630 *tnat |= (nat << tslot); 670 *tnat |= (nat << tslot);
631} 671}
632 672
673/* Change the comm field on the MCA/INT task to include the pid that
674 * was interrupted, it makes for easier debugging. If that pid was 0
675 * (swapper or nested MCA/INIT) then use the start of the previous comm
676 * field suffixed with its cpu.
677 */
678
679static void
680ia64_mca_modify_comm(const task_t *previous_current)
681{
682 char *p, comm[sizeof(current->comm)];
683 if (previous_current->pid)
684 snprintf(comm, sizeof(comm), "%s %d",
685 current->comm, previous_current->pid);
686 else {
687 int l;
688 if ((p = strchr(previous_current->comm, ' ')))
689 l = p - previous_current->comm;
690 else
691 l = strlen(previous_current->comm);
692 snprintf(comm, sizeof(comm), "%s %*s %d",
693 current->comm, l, previous_current->comm,
694 task_thread_info(previous_current)->cpu);
695 }
696 memcpy(current->comm, comm, sizeof(current->comm));
697}
698
633/* On entry to this routine, we are running on the per cpu stack, see 699/* On entry to this routine, we are running on the per cpu stack, see
634 * mca_asm.h. The original stack has not been touched by this event. Some of 700 * mca_asm.h. The original stack has not been touched by this event. Some of
635 * the original stack's registers will be in the RBS on this stack. This stack 701 * the original stack's registers will be in the RBS on this stack. This stack
@@ -648,7 +714,7 @@ ia64_mca_modify_original_stack(struct pt_regs *regs,
648 struct ia64_sal_os_state *sos, 714 struct ia64_sal_os_state *sos,
649 const char *type) 715 const char *type)
650{ 716{
651 char *p, comm[sizeof(current->comm)]; 717 char *p;
652 ia64_va va; 718 ia64_va va;
653 extern char ia64_leave_kernel[]; /* Need asm address, not function descriptor */ 719 extern char ia64_leave_kernel[]; /* Need asm address, not function descriptor */
654 const pal_min_state_area_t *ms = sos->pal_min_state; 720 const pal_min_state_area_t *ms = sos->pal_min_state;
@@ -721,54 +787,43 @@ ia64_mca_modify_original_stack(struct pt_regs *regs,
721 /* Verify the previous stack state before we change it */ 787 /* Verify the previous stack state before we change it */
722 if (user_mode(regs)) { 788 if (user_mode(regs)) {
723 msg = "occurred in user space"; 789 msg = "occurred in user space";
724 goto no_mod; 790 /* previous_current is guaranteed to be valid when the task was
725 } 791 * in user space, so ...
726 if (r13 != sos->prev_IA64_KR_CURRENT) { 792 */
727 msg = "inconsistent previous current and r13"; 793 ia64_mca_modify_comm(previous_current);
728 goto no_mod;
729 }
730 if ((r12 - r13) >= KERNEL_STACK_SIZE) {
731 msg = "inconsistent r12 and r13";
732 goto no_mod;
733 }
734 if ((ar_bspstore - r13) >= KERNEL_STACK_SIZE) {
735 msg = "inconsistent ar.bspstore and r13";
736 goto no_mod;
737 }
738 va.p = old_bspstore;
739 if (va.f.reg < 5) {
740 msg = "old_bspstore is in the wrong region";
741 goto no_mod;
742 }
743 if ((ar_bsp - r13) >= KERNEL_STACK_SIZE) {
744 msg = "inconsistent ar.bsp and r13";
745 goto no_mod;
746 }
747 size += (ia64_rse_skip_regs(old_bspstore, slots) - old_bspstore) * 8;
748 if (ar_bspstore + size > r12) {
749 msg = "no room for blocked state";
750 goto no_mod; 794 goto no_mod;
751 } 795 }
752 796
753 /* Change the comm field on the MCA/INT task to include the pid that 797 if (!mca_recover_range(ms->pmsa_iip)) {
754 * was interrupted, it makes for easier debugging. If that pid was 0 798 if (r13 != sos->prev_IA64_KR_CURRENT) {
755 * (swapper or nested MCA/INIT) then use the start of the previous comm 799 msg = "inconsistent previous current and r13";
756 * field suffixed with its cpu. 800 goto no_mod;
757 */ 801 }
758 if (previous_current->pid) 802 if ((r12 - r13) >= KERNEL_STACK_SIZE) {
759 snprintf(comm, sizeof(comm), "%s %d", 803 msg = "inconsistent r12 and r13";
760 current->comm, previous_current->pid); 804 goto no_mod;
761 else { 805 }
762 int l; 806 if ((ar_bspstore - r13) >= KERNEL_STACK_SIZE) {
763 if ((p = strchr(previous_current->comm, ' '))) 807 msg = "inconsistent ar.bspstore and r13";
764 l = p - previous_current->comm; 808 goto no_mod;
765 else 809 }
766 l = strlen(previous_current->comm); 810 va.p = old_bspstore;
767 snprintf(comm, sizeof(comm), "%s %*s %d", 811 if (va.f.reg < 5) {
768 current->comm, l, previous_current->comm, 812 msg = "old_bspstore is in the wrong region";
769 task_thread_info(previous_current)->cpu); 813 goto no_mod;
814 }
815 if ((ar_bsp - r13) >= KERNEL_STACK_SIZE) {
816 msg = "inconsistent ar.bsp and r13";
817 goto no_mod;
818 }
819 size += (ia64_rse_skip_regs(old_bspstore, slots) - old_bspstore) * 8;
820 if (ar_bspstore + size > r12) {
821 msg = "no room for blocked state";
822 goto no_mod;
823 }
770 } 824 }
771 memcpy(current->comm, comm, sizeof(current->comm)); 825
826 ia64_mca_modify_comm(previous_current);
772 827
773 /* Make the original task look blocked. First stack a struct pt_regs, 828 /* Make the original task look blocked. First stack a struct pt_regs,
774 * describing the state at the time of interrupt. mca_asm.S built a 829 * describing the state at the time of interrupt. mca_asm.S built a
@@ -908,7 +963,7 @@ no_mod:
908static void 963static void
909ia64_wait_for_slaves(int monarch) 964ia64_wait_for_slaves(int monarch)
910{ 965{
911 int c, wait = 0; 966 int c, wait = 0, missing = 0;
912 for_each_online_cpu(c) { 967 for_each_online_cpu(c) {
913 if (c == monarch) 968 if (c == monarch)
914 continue; 969 continue;
@@ -919,15 +974,32 @@ ia64_wait_for_slaves(int monarch)
919 } 974 }
920 } 975 }
921 if (!wait) 976 if (!wait)
922 return; 977 goto all_in;
923 for_each_online_cpu(c) { 978 for_each_online_cpu(c) {
924 if (c == monarch) 979 if (c == monarch)
925 continue; 980 continue;
926 if (ia64_mc_info.imi_rendez_checkin[c] == IA64_MCA_RENDEZ_CHECKIN_NOTDONE) { 981 if (ia64_mc_info.imi_rendez_checkin[c] == IA64_MCA_RENDEZ_CHECKIN_NOTDONE) {
927 udelay(5*1000000); /* wait 5 seconds for slaves (arbitrary) */ 982 udelay(5*1000000); /* wait 5 seconds for slaves (arbitrary) */
983 if (ia64_mc_info.imi_rendez_checkin[c] == IA64_MCA_RENDEZ_CHECKIN_NOTDONE)
984 missing = 1;
928 break; 985 break;
929 } 986 }
930 } 987 }
988 if (!missing)
989 goto all_in;
990 printk(KERN_INFO "OS MCA slave did not rendezvous on cpu");
991 for_each_online_cpu(c) {
992 if (c == monarch)
993 continue;
994 if (ia64_mc_info.imi_rendez_checkin[c] == IA64_MCA_RENDEZ_CHECKIN_NOTDONE)
995 printk(" %d", c);
996 }
997 printk("\n");
998 return;
999
1000all_in:
1001 printk(KERN_INFO "All OS MCA slaves have reached rendezvous\n");
1002 return;
931} 1003}
932 1004
933/* 1005/*
@@ -953,6 +1025,10 @@ ia64_mca_handler(struct pt_regs *regs, struct switch_stack *sw,
953 task_t *previous_current; 1025 task_t *previous_current;
954 1026
955 oops_in_progress = 1; /* FIXME: make printk NMI/MCA/INIT safe */ 1027 oops_in_progress = 1; /* FIXME: make printk NMI/MCA/INIT safe */
1028 console_loglevel = 15; /* make sure printks make it to console */
1029 printk(KERN_INFO "Entered OS MCA handler. PSP=%lx cpu=%d monarch=%ld\n",
1030 sos->proc_state_param, cpu, sos->monarch);
1031
956 previous_current = ia64_mca_modify_original_stack(regs, sw, sos, "MCA"); 1032 previous_current = ia64_mca_modify_original_stack(regs, sw, sos, "MCA");
957 monarch_cpu = cpu; 1033 monarch_cpu = cpu;
958 if (notify_die(DIE_MCA_MONARCH_ENTER, "MCA", regs, 0, 0, 0) 1034 if (notify_die(DIE_MCA_MONARCH_ENTER, "MCA", regs, 0, 0, 0)
@@ -1416,7 +1492,7 @@ static struct irqaction mca_cpep_irqaction = {
1416 * format most of the fields. 1492 * format most of the fields.
1417 */ 1493 */
1418 1494
1419static void 1495static void __cpuinit
1420format_mca_init_stack(void *mca_data, unsigned long offset, 1496format_mca_init_stack(void *mca_data, unsigned long offset,
1421 const char *type, int cpu) 1497 const char *type, int cpu)
1422{ 1498{
@@ -1430,7 +1506,7 @@ format_mca_init_stack(void *mca_data, unsigned long offset,
1430 ti->cpu = cpu; 1506 ti->cpu = cpu;
1431 p->thread_info = ti; 1507 p->thread_info = ti;
1432 p->state = TASK_UNINTERRUPTIBLE; 1508 p->state = TASK_UNINTERRUPTIBLE;
1433 __set_bit(cpu, &p->cpus_allowed); 1509 cpu_set(cpu, p->cpus_allowed);
1434 INIT_LIST_HEAD(&p->tasks); 1510 INIT_LIST_HEAD(&p->tasks);
1435 p->parent = p->real_parent = p->group_leader = p; 1511 p->parent = p->real_parent = p->group_leader = p;
1436 INIT_LIST_HEAD(&p->children); 1512 INIT_LIST_HEAD(&p->children);
@@ -1440,15 +1516,17 @@ format_mca_init_stack(void *mca_data, unsigned long offset,
1440 1516
1441/* Do per-CPU MCA-related initialization. */ 1517/* Do per-CPU MCA-related initialization. */
1442 1518
1443void __devinit 1519void __cpuinit
1444ia64_mca_cpu_init(void *cpu_data) 1520ia64_mca_cpu_init(void *cpu_data)
1445{ 1521{
1446 void *pal_vaddr; 1522 void *pal_vaddr;
1523 static int first_time = 1;
1447 1524
1448 if (smp_processor_id() == 0) { 1525 if (first_time) {
1449 void *mca_data; 1526 void *mca_data;
1450 int cpu; 1527 int cpu;
1451 1528
1529 first_time = 0;
1452 mca_data = alloc_bootmem(sizeof(struct ia64_mca_cpu) 1530 mca_data = alloc_bootmem(sizeof(struct ia64_mca_cpu)
1453 * NR_CPUS + KERNEL_STACK_SIZE); 1531 * NR_CPUS + KERNEL_STACK_SIZE);
1454 mca_data = (void *)(((unsigned long)mca_data + 1532 mca_data = (void *)(((unsigned long)mca_data +
@@ -1704,6 +1782,7 @@ ia64_mca_late_init(void)
1704 desc = irq_descp(irq); 1782 desc = irq_descp(irq);
1705 desc->status |= IRQ_PER_CPU; 1783 desc->status |= IRQ_PER_CPU;
1706 setup_irq(irq, &mca_cpe_irqaction); 1784 setup_irq(irq, &mca_cpe_irqaction);
1785 ia64_cpe_irq = irq;
1707 } 1786 }
1708 ia64_mca_register_cpev(cpe_vector); 1787 ia64_mca_register_cpev(cpe_vector);
1709 IA64_MCA_DEBUG("%s: CPEI/P setup and enabled.\n", __FUNCTION__); 1788 IA64_MCA_DEBUG("%s: CPEI/P setup and enabled.\n", __FUNCTION__);
diff --git a/arch/ia64/kernel/mca_drv.c b/arch/ia64/kernel/mca_drv.c
index e883d85906db..37c88eb55873 100644
--- a/arch/ia64/kernel/mca_drv.c
+++ b/arch/ia64/kernel/mca_drv.c
@@ -6,6 +6,7 @@
6 * Copyright (C) Hidetoshi Seto (seto.hidetoshi@jp.fujitsu.com) 6 * Copyright (C) Hidetoshi Seto (seto.hidetoshi@jp.fujitsu.com)
7 * Copyright (C) 2005 Silicon Graphics, Inc 7 * Copyright (C) 2005 Silicon Graphics, Inc
8 * Copyright (C) 2005 Keith Owens <kaos@sgi.com> 8 * Copyright (C) 2005 Keith Owens <kaos@sgi.com>
9 * Copyright (C) 2006 Russ Anderson <rja@sgi.com>
9 */ 10 */
10#include <linux/config.h> 11#include <linux/config.h>
11#include <linux/types.h> 12#include <linux/types.h>
@@ -121,11 +122,12 @@ mca_page_isolate(unsigned long paddr)
121 */ 122 */
122 123
123void 124void
124mca_handler_bh(unsigned long paddr) 125mca_handler_bh(unsigned long paddr, void *iip, unsigned long ipsr)
125{ 126{
126 printk(KERN_ERR 127 printk(KERN_ERR "OS_MCA: process [cpu %d, pid: %d, uid: %d, "
127 "OS_MCA: process [pid: %d](%s) encounters MCA (paddr=%lx)\n", 128 "iip: %p, psr: 0x%lx,paddr: 0x%lx](%s) encounters MCA.\n",
128 current->pid, current->comm, paddr); 129 raw_smp_processor_id(), current->pid, current->uid,
130 iip, ipsr, paddr, current->comm);
129 131
130 spin_lock(&mca_bh_lock); 132 spin_lock(&mca_bh_lock);
131 switch (mca_page_isolate(paddr)) { 133 switch (mca_page_isolate(paddr)) {
@@ -442,21 +444,26 @@ recover_from_read_error(slidx_table_t *slidx,
442 if (!peidx_bottom(peidx) || !(peidx_bottom(peidx)->valid.minstate)) 444 if (!peidx_bottom(peidx) || !(peidx_bottom(peidx)->valid.minstate))
443 return 0; 445 return 0;
444 psr1 =(struct ia64_psr *)&(peidx_minstate_area(peidx)->pmsa_ipsr); 446 psr1 =(struct ia64_psr *)&(peidx_minstate_area(peidx)->pmsa_ipsr);
447 psr2 =(struct ia64_psr *)&(peidx_minstate_area(peidx)->pmsa_xpsr);
445 448
446 /* 449 /*
447 * Check the privilege level of interrupted context. 450 * Check the privilege level of interrupted context.
448 * If it is user-mode, then terminate affected process. 451 * If it is user-mode, then terminate affected process.
449 */ 452 */
450 if (psr1->cpl != 0) { 453
454 pmsa = sos->pal_min_state;
455 if (psr1->cpl != 0 ||
456 ((psr2->cpl != 0) && mca_recover_range(pmsa->pmsa_iip))) {
451 smei = peidx_bus_check(peidx, 0); 457 smei = peidx_bus_check(peidx, 0);
452 if (smei->valid.target_identifier) { 458 if (smei->valid.target_identifier) {
453 /* 459 /*
454 * setup for resume to bottom half of MCA, 460 * setup for resume to bottom half of MCA,
455 * "mca_handler_bhhook" 461 * "mca_handler_bhhook"
456 */ 462 */
457 pmsa = sos->pal_min_state; 463 /* pass to bhhook as argument (gr8, ...) */
458 /* pass to bhhook as 1st argument (gr8) */
459 pmsa->pmsa_gr[8-1] = smei->target_identifier; 464 pmsa->pmsa_gr[8-1] = smei->target_identifier;
465 pmsa->pmsa_gr[9-1] = pmsa->pmsa_iip;
466 pmsa->pmsa_gr[10-1] = pmsa->pmsa_ipsr;
460 /* set interrupted return address (but no use) */ 467 /* set interrupted return address (but no use) */
461 pmsa->pmsa_br0 = pmsa->pmsa_iip; 468 pmsa->pmsa_br0 = pmsa->pmsa_iip;
462 /* change resume address to bottom half */ 469 /* change resume address to bottom half */
@@ -466,6 +473,7 @@ recover_from_read_error(slidx_table_t *slidx,
466 psr2 = (struct ia64_psr *)&pmsa->pmsa_ipsr; 473 psr2 = (struct ia64_psr *)&pmsa->pmsa_ipsr;
467 psr2->cpl = 0; 474 psr2->cpl = 0;
468 psr2->ri = 0; 475 psr2->ri = 0;
476 psr2->bn = 1;
469 psr2->i = 0; 477 psr2->i = 0;
470 478
471 return 1; 479 return 1;
diff --git a/arch/ia64/kernel/mca_drv.h b/arch/ia64/kernel/mca_drv.h
index e2f6fa1e0ef6..31a2e52bb16f 100644
--- a/arch/ia64/kernel/mca_drv.h
+++ b/arch/ia64/kernel/mca_drv.h
@@ -111,3 +111,10 @@ typedef struct slidx_table {
111 slidx_foreach_entry(__pos, &((slidx)->sec)) { __count++; }\ 111 slidx_foreach_entry(__pos, &((slidx)->sec)) { __count++; }\
112 __count; }) 112 __count; })
113 113
114struct mca_table_entry {
115 int start_addr; /* location-relative starting address of MCA recoverable range */
116 int end_addr; /* location-relative ending address of MCA recoverable range */
117};
118
119extern const struct mca_table_entry *search_mca_tables (unsigned long addr);
120extern int mca_recover_range(unsigned long);
diff --git a/arch/ia64/kernel/mca_drv_asm.S b/arch/ia64/kernel/mca_drv_asm.S
index 3f298ee4d00c..e6a580d354b9 100644
--- a/arch/ia64/kernel/mca_drv_asm.S
+++ b/arch/ia64/kernel/mca_drv_asm.S
@@ -14,15 +14,12 @@
14 14
15GLOBAL_ENTRY(mca_handler_bhhook) 15GLOBAL_ENTRY(mca_handler_bhhook)
16 invala // clear RSE ? 16 invala // clear RSE ?
17 ;;
18 cover 17 cover
19 ;; 18 ;;
20 clrrrb 19 clrrrb
21 ;; 20 ;;
22 alloc r16=ar.pfs,0,2,1,0 // make a new frame 21 alloc r16=ar.pfs,0,2,3,0 // make a new frame
23 ;;
24 mov ar.rsc=0 22 mov ar.rsc=0
25 ;;
26 mov r13=IA64_KR(CURRENT) // current task pointer 23 mov r13=IA64_KR(CURRENT) // current task pointer
27 ;; 24 ;;
28 mov r2=r13 25 mov r2=r13
@@ -30,7 +27,6 @@ GLOBAL_ENTRY(mca_handler_bhhook)
30 addl r22=IA64_RBS_OFFSET,r2 27 addl r22=IA64_RBS_OFFSET,r2
31 ;; 28 ;;
32 mov ar.bspstore=r22 29 mov ar.bspstore=r22
33 ;;
34 addl sp=IA64_STK_OFFSET-IA64_PT_REGS_SIZE,r2 30 addl sp=IA64_STK_OFFSET-IA64_PT_REGS_SIZE,r2
35 ;; 31 ;;
36 adds r2=IA64_TASK_THREAD_ON_USTACK_OFFSET,r13 32 adds r2=IA64_TASK_THREAD_ON_USTACK_OFFSET,r13
@@ -40,12 +36,12 @@ GLOBAL_ENTRY(mca_handler_bhhook)
40 movl loc1=mca_handler_bh // recovery C function 36 movl loc1=mca_handler_bh // recovery C function
41 ;; 37 ;;
42 mov out0=r8 // poisoned address 38 mov out0=r8 // poisoned address
39 mov out1=r9 // iip
40 mov out2=r10 // psr
43 mov b6=loc1 41 mov b6=loc1
44 ;; 42 ;;
45 mov loc1=rp 43 mov loc1=rp
46 ;; 44 ssm psr.i | psr.ic
47 ssm psr.i
48 ;;
49 br.call.sptk.many rp=b6 // does not return ... 45 br.call.sptk.many rp=b6 // does not return ...
50 ;; 46 ;;
51 mov ar.pfs=loc0 47 mov ar.pfs=loc0
@@ -53,5 +49,4 @@ GLOBAL_ENTRY(mca_handler_bhhook)
53 ;; 49 ;;
54 mov r8=r0 50 mov r8=r0
55 br.ret.sptk.many rp 51 br.ret.sptk.many rp
56 ;;
57END(mca_handler_bhhook) 52END(mca_handler_bhhook)
diff --git a/arch/ia64/kernel/numa.c b/arch/ia64/kernel/numa.c
index a68ce6678092..0766493d4d00 100644
--- a/arch/ia64/kernel/numa.c
+++ b/arch/ia64/kernel/numa.c
@@ -25,7 +25,7 @@
25#include <asm/processor.h> 25#include <asm/processor.h>
26#include <asm/smp.h> 26#include <asm/smp.h>
27 27
28u8 cpu_to_node_map[NR_CPUS] __cacheline_aligned; 28u16 cpu_to_node_map[NR_CPUS] __cacheline_aligned;
29EXPORT_SYMBOL(cpu_to_node_map); 29EXPORT_SYMBOL(cpu_to_node_map);
30 30
31cpumask_t node_to_cpu_mask[MAX_NUMNODES] __cacheline_aligned; 31cpumask_t node_to_cpu_mask[MAX_NUMNODES] __cacheline_aligned;
diff --git a/arch/ia64/kernel/palinfo.c b/arch/ia64/kernel/palinfo.c
index 89faa603c6be..6386f63c413e 100644
--- a/arch/ia64/kernel/palinfo.c
+++ b/arch/ia64/kernel/palinfo.c
@@ -240,7 +240,7 @@ cache_info(char *page)
240 } 240 }
241 p += sprintf(p, 241 p += sprintf(p,
242 "%s Cache level %lu:\n" 242 "%s Cache level %lu:\n"
243 "\tSize : %lu bytes\n" 243 "\tSize : %u bytes\n"
244 "\tAttributes : ", 244 "\tAttributes : ",
245 cache_types[j+cci.pcci_unified], i+1, 245 cache_types[j+cci.pcci_unified], i+1,
246 cci.pcci_cache_size); 246 cci.pcci_cache_size);
@@ -648,9 +648,9 @@ frequency_info(char *page)
648 if (ia64_pal_freq_ratios(&proc, &bus, &itc) != 0) return 0; 648 if (ia64_pal_freq_ratios(&proc, &bus, &itc) != 0) return 0;
649 649
650 p += sprintf(p, 650 p += sprintf(p,
651 "Processor/Clock ratio : %ld/%ld\n" 651 "Processor/Clock ratio : %d/%d\n"
652 "Bus/Clock ratio : %ld/%ld\n" 652 "Bus/Clock ratio : %d/%d\n"
653 "ITC/Clock ratio : %ld/%ld\n", 653 "ITC/Clock ratio : %d/%d\n",
654 proc.num, proc.den, bus.num, bus.den, itc.num, itc.den); 654 proc.num, proc.den, bus.num, bus.den, itc.num, itc.den);
655 655
656 return p - page; 656 return p - page;
diff --git a/arch/ia64/kernel/patch.c b/arch/ia64/kernel/patch.c
index 6a4ac7d70b35..bc11bb096f58 100644
--- a/arch/ia64/kernel/patch.c
+++ b/arch/ia64/kernel/patch.c
@@ -115,7 +115,7 @@ ia64_patch_vtop (unsigned long start, unsigned long end)
115 ia64_srlz_i(); 115 ia64_srlz_i();
116} 116}
117 117
118void 118void __init
119ia64_patch_mckinley_e9 (unsigned long start, unsigned long end) 119ia64_patch_mckinley_e9 (unsigned long start, unsigned long end)
120{ 120{
121 static int first_time = 1; 121 static int first_time = 1;
@@ -149,7 +149,7 @@ ia64_patch_mckinley_e9 (unsigned long start, unsigned long end)
149 ia64_srlz_i(); 149 ia64_srlz_i();
150} 150}
151 151
152static void 152static void __init
153patch_fsyscall_table (unsigned long start, unsigned long end) 153patch_fsyscall_table (unsigned long start, unsigned long end)
154{ 154{
155 extern unsigned long fsyscall_table[NR_syscalls]; 155 extern unsigned long fsyscall_table[NR_syscalls];
@@ -166,7 +166,7 @@ patch_fsyscall_table (unsigned long start, unsigned long end)
166 ia64_srlz_i(); 166 ia64_srlz_i();
167} 167}
168 168
169static void 169static void __init
170patch_brl_fsys_bubble_down (unsigned long start, unsigned long end) 170patch_brl_fsys_bubble_down (unsigned long start, unsigned long end)
171{ 171{
172 extern char fsys_bubble_down[]; 172 extern char fsys_bubble_down[];
@@ -184,7 +184,7 @@ patch_brl_fsys_bubble_down (unsigned long start, unsigned long end)
184 ia64_srlz_i(); 184 ia64_srlz_i();
185} 185}
186 186
187void 187void __init
188ia64_patch_gate (void) 188ia64_patch_gate (void)
189{ 189{
190# define START(name) ((unsigned long) __start_gate_##name##_patchlist) 190# define START(name) ((unsigned long) __start_gate_##name##_patchlist)
diff --git a/arch/ia64/kernel/perfmon.c b/arch/ia64/kernel/perfmon.c
index 9c5194b385da..077f21216b65 100644
--- a/arch/ia64/kernel/perfmon.c
+++ b/arch/ia64/kernel/perfmon.c
@@ -6722,6 +6722,7 @@ __initcall(pfm_init);
6722void 6722void
6723pfm_init_percpu (void) 6723pfm_init_percpu (void)
6724{ 6724{
6725 static int first_time=1;
6725 /* 6726 /*
6726 * make sure no measurement is active 6727 * make sure no measurement is active
6727 * (may inherit programmed PMCs from EFI). 6728 * (may inherit programmed PMCs from EFI).
@@ -6734,8 +6735,10 @@ pfm_init_percpu (void)
6734 */ 6735 */
6735 pfm_unfreeze_pmu(); 6736 pfm_unfreeze_pmu();
6736 6737
6737 if (smp_processor_id() == 0) 6738 if (first_time) {
6738 register_percpu_irq(IA64_PERFMON_VECTOR, &perfmon_irqaction); 6739 register_percpu_irq(IA64_PERFMON_VECTOR, &perfmon_irqaction);
6740 first_time=0;
6741 }
6739 6742
6740 ia64_setreg(_IA64_REG_CR_PMV, IA64_PERFMON_VECTOR); 6743 ia64_setreg(_IA64_REG_CR_PMV, IA64_PERFMON_VECTOR);
6741 ia64_srlz_d(); 6744 ia64_srlz_d();
diff --git a/arch/ia64/kernel/process.c b/arch/ia64/kernel/process.c
index 309d59658e5f..355d57970ba3 100644
--- a/arch/ia64/kernel/process.c
+++ b/arch/ia64/kernel/process.c
@@ -30,7 +30,6 @@
30#include <linux/efi.h> 30#include <linux/efi.h>
31#include <linux/interrupt.h> 31#include <linux/interrupt.h>
32#include <linux/delay.h> 32#include <linux/delay.h>
33#include <linux/kprobes.h>
34 33
35#include <asm/cpu.h> 34#include <asm/cpu.h>
36#include <asm/delay.h> 35#include <asm/delay.h>
@@ -738,13 +737,6 @@ void
738exit_thread (void) 737exit_thread (void)
739{ 738{
740 739
741 /*
742 * Remove function-return probe instances associated with this task
743 * and put them back on the free list. Do not insert an exit probe for
744 * this function, it will be disabled by kprobe_flush_task if you do.
745 */
746 kprobe_flush_task(current);
747
748 ia64_drop_fpu(current); 740 ia64_drop_fpu(current);
749#ifdef CONFIG_PERFMON 741#ifdef CONFIG_PERFMON
750 /* if needed, stop monitoring and flush state to perfmon context */ 742 /* if needed, stop monitoring and flush state to perfmon context */
diff --git a/arch/ia64/kernel/ptrace.c b/arch/ia64/kernel/ptrace.c
index eaed14aac6aa..9887c8787e7a 100644
--- a/arch/ia64/kernel/ptrace.c
+++ b/arch/ia64/kernel/ptrace.c
@@ -1656,8 +1656,14 @@ syscall_trace_leave (long arg0, long arg1, long arg2, long arg3,
1656 long arg4, long arg5, long arg6, long arg7, 1656 long arg4, long arg5, long arg6, long arg7,
1657 struct pt_regs regs) 1657 struct pt_regs regs)
1658{ 1658{
1659 if (unlikely(current->audit_context)) 1659 if (unlikely(current->audit_context)) {
1660 audit_syscall_exit(current, AUDITSC_RESULT(regs.r10), regs.r8); 1660 int success = AUDITSC_RESULT(regs.r10);
1661 long result = regs.r8;
1662
1663 if (success != AUDITSC_SUCCESS)
1664 result = -result;
1665 audit_syscall_exit(current, success, result);
1666 }
1661 1667
1662 if (test_thread_flag(TIF_SYSCALL_TRACE) 1668 if (test_thread_flag(TIF_SYSCALL_TRACE)
1663 && (current->ptrace & PT_PTRACED)) 1669 && (current->ptrace & PT_PTRACED))
diff --git a/arch/ia64/kernel/setup.c b/arch/ia64/kernel/setup.c
index 3258e09278d0..e4dfda1eb7dd 100644
--- a/arch/ia64/kernel/setup.c
+++ b/arch/ia64/kernel/setup.c
@@ -37,11 +37,11 @@
37#include <linux/string.h> 37#include <linux/string.h>
38#include <linux/threads.h> 38#include <linux/threads.h>
39#include <linux/tty.h> 39#include <linux/tty.h>
40#include <linux/dmi.h>
40#include <linux/serial.h> 41#include <linux/serial.h>
41#include <linux/serial_core.h> 42#include <linux/serial_core.h>
42#include <linux/efi.h> 43#include <linux/efi.h>
43#include <linux/initrd.h> 44#include <linux/initrd.h>
44#include <linux/platform.h>
45#include <linux/pm.h> 45#include <linux/pm.h>
46#include <linux/cpufreq.h> 46#include <linux/cpufreq.h>
47 47
@@ -131,8 +131,8 @@ EXPORT_SYMBOL(ia64_max_iommu_merge_mask);
131/* 131/*
132 * We use a special marker for the end of memory and it uses the extra (+1) slot 132 * We use a special marker for the end of memory and it uses the extra (+1) slot
133 */ 133 */
134struct rsvd_region rsvd_region[IA64_MAX_RSVD_REGIONS + 1]; 134struct rsvd_region rsvd_region[IA64_MAX_RSVD_REGIONS + 1] __initdata;
135int num_rsvd_regions; 135int num_rsvd_regions __initdata;
136 136
137 137
138/* 138/*
@@ -141,7 +141,7 @@ int num_rsvd_regions;
141 * caller-specified function is called with the memory ranges that remain after filtering. 141 * caller-specified function is called with the memory ranges that remain after filtering.
142 * This routine does not assume the incoming segments are sorted. 142 * This routine does not assume the incoming segments are sorted.
143 */ 143 */
144int 144int __init
145filter_rsvd_memory (unsigned long start, unsigned long end, void *arg) 145filter_rsvd_memory (unsigned long start, unsigned long end, void *arg)
146{ 146{
147 unsigned long range_start, range_end, prev_start; 147 unsigned long range_start, range_end, prev_start;
@@ -177,7 +177,7 @@ filter_rsvd_memory (unsigned long start, unsigned long end, void *arg)
177 return 0; 177 return 0;
178} 178}
179 179
180static void 180static void __init
181sort_regions (struct rsvd_region *rsvd_region, int max) 181sort_regions (struct rsvd_region *rsvd_region, int max)
182{ 182{
183 int j; 183 int j;
@@ -218,7 +218,7 @@ __initcall(register_memory);
218 * initrd, etc. There are currently %IA64_MAX_RSVD_REGIONS defined, 218 * initrd, etc. There are currently %IA64_MAX_RSVD_REGIONS defined,
219 * see include/asm-ia64/meminit.h if you need to define more. 219 * see include/asm-ia64/meminit.h if you need to define more.
220 */ 220 */
221void 221void __init
222reserve_memory (void) 222reserve_memory (void)
223{ 223{
224 int n = 0; 224 int n = 0;
@@ -270,7 +270,7 @@ reserve_memory (void)
270 * Grab the initrd start and end from the boot parameter struct given us by 270 * Grab the initrd start and end from the boot parameter struct given us by
271 * the boot loader. 271 * the boot loader.
272 */ 272 */
273void 273void __init
274find_initrd (void) 274find_initrd (void)
275{ 275{
276#ifdef CONFIG_BLK_DEV_INITRD 276#ifdef CONFIG_BLK_DEV_INITRD
@@ -362,7 +362,7 @@ mark_bsp_online (void)
362} 362}
363 363
364#ifdef CONFIG_SMP 364#ifdef CONFIG_SMP
365static void 365static void __init
366check_for_logical_procs (void) 366check_for_logical_procs (void)
367{ 367{
368 pal_logical_to_physical_t info; 368 pal_logical_to_physical_t info;
@@ -389,6 +389,14 @@ check_for_logical_procs (void)
389} 389}
390#endif 390#endif
391 391
392static __initdata int nomca;
393static __init int setup_nomca(char *s)
394{
395 nomca = 1;
396 return 0;
397}
398early_param("nomca", setup_nomca);
399
392void __init 400void __init
393setup_arch (char **cmdline_p) 401setup_arch (char **cmdline_p)
394{ 402{
@@ -402,35 +410,15 @@ setup_arch (char **cmdline_p)
402 efi_init(); 410 efi_init();
403 io_port_init(); 411 io_port_init();
404 412
413 parse_early_param();
414
405#ifdef CONFIG_IA64_GENERIC 415#ifdef CONFIG_IA64_GENERIC
406 { 416 machvec_init(NULL);
407 const char *mvec_name = strstr (*cmdline_p, "machvec=");
408 char str[64];
409
410 if (mvec_name) {
411 const char *end;
412 size_t len;
413
414 mvec_name += 8;
415 end = strchr (mvec_name, ' ');
416 if (end)
417 len = end - mvec_name;
418 else
419 len = strlen (mvec_name);
420 len = min(len, sizeof (str) - 1);
421 strncpy (str, mvec_name, len);
422 str[len] = '\0';
423 mvec_name = str;
424 } else
425 mvec_name = acpi_get_sysname();
426 machvec_init(mvec_name);
427 }
428#endif 417#endif
429 418
430 if (early_console_setup(*cmdline_p) == 0) 419 if (early_console_setup(*cmdline_p) == 0)
431 mark_bsp_online(); 420 mark_bsp_online();
432 421
433 parse_early_param();
434#ifdef CONFIG_ACPI 422#ifdef CONFIG_ACPI
435 /* Initialize the ACPI boot-time table parser */ 423 /* Initialize the ACPI boot-time table parser */
436 acpi_table_init(); 424 acpi_table_init();
@@ -446,7 +434,7 @@ setup_arch (char **cmdline_p)
446 find_memory(); 434 find_memory();
447 435
448 /* process SAL system table: */ 436 /* process SAL system table: */
449 ia64_sal_init(efi.sal_systab); 437 ia64_sal_init(__va(efi.sal_systab));
450 438
451 ia64_setup_printk_clock(); 439 ia64_setup_printk_clock();
452 440
@@ -493,7 +481,7 @@ setup_arch (char **cmdline_p)
493#endif 481#endif
494 482
495 /* enable IA-64 Machine Check Abort Handling unless disabled */ 483 /* enable IA-64 Machine Check Abort Handling unless disabled */
496 if (!strstr(saved_command_line, "nomca")) 484 if (!nomca)
497 ia64_mca_init(); 485 ia64_mca_init();
498 486
499 platform_setup(cmdline_p); 487 platform_setup(cmdline_p);
@@ -623,7 +611,7 @@ struct seq_operations cpuinfo_op = {
623 .show = show_cpuinfo 611 .show = show_cpuinfo
624}; 612};
625 613
626void 614static void __cpuinit
627identify_cpu (struct cpuinfo_ia64 *c) 615identify_cpu (struct cpuinfo_ia64 *c)
628{ 616{
629 union { 617 union {
@@ -700,7 +688,7 @@ setup_per_cpu_areas (void)
700 * In addition, the minimum of the i-cache stride sizes is calculated for 688 * In addition, the minimum of the i-cache stride sizes is calculated for
701 * "flush_icache_range()". 689 * "flush_icache_range()".
702 */ 690 */
703static void 691static void __cpuinit
704get_max_cacheline_size (void) 692get_max_cacheline_size (void)
705{ 693{
706 unsigned long line_size, max = 1; 694 unsigned long line_size, max = 1;
@@ -763,10 +751,10 @@ get_max_cacheline_size (void)
763 * cpu_init() initializes state that is per-CPU. This function acts 751 * cpu_init() initializes state that is per-CPU. This function acts
764 * as a 'CPU state barrier', nothing should get across. 752 * as a 'CPU state barrier', nothing should get across.
765 */ 753 */
766void 754void __cpuinit
767cpu_init (void) 755cpu_init (void)
768{ 756{
769 extern void __devinit ia64_mmu_init (void *); 757 extern void __cpuinit ia64_mmu_init (void *);
770 unsigned long num_phys_stacked; 758 unsigned long num_phys_stacked;
771 pal_vm_info_2_u_t vmi; 759 pal_vm_info_2_u_t vmi;
772 unsigned int max_ctx; 760 unsigned int max_ctx;
@@ -894,9 +882,16 @@ void sched_cacheflush(void)
894 ia64_sal_cache_flush(3); 882 ia64_sal_cache_flush(3);
895} 883}
896 884
897void 885void __init
898check_bugs (void) 886check_bugs (void)
899{ 887{
900 ia64_patch_mckinley_e9((unsigned long) __start___mckinley_e9_bundles, 888 ia64_patch_mckinley_e9((unsigned long) __start___mckinley_e9_bundles,
901 (unsigned long) __end___mckinley_e9_bundles); 889 (unsigned long) __end___mckinley_e9_bundles);
902} 890}
891
892static int __init run_dmi_scan(void)
893{
894 dmi_scan_machine();
895 return 0;
896}
897core_initcall(run_dmi_scan);
diff --git a/arch/ia64/kernel/signal.c b/arch/ia64/kernel/signal.c
index 463f6bb44d07..1d7903ee2126 100644
--- a/arch/ia64/kernel/signal.c
+++ b/arch/ia64/kernel/signal.c
@@ -588,104 +588,3 @@ ia64_do_signal (sigset_t *oldset, struct sigscratch *scr, long in_syscall)
588 } 588 }
589 return 0; 589 return 0;
590} 590}
591
592/* Set a delayed signal that was detected in MCA/INIT/NMI/PMI context where it
593 * could not be delivered. It is important that the target process is not
594 * allowed to do any more work in user space. Possible cases for the target
595 * process:
596 *
597 * - It is sleeping and will wake up soon. Store the data in the current task,
598 * the signal will be sent when the current task returns from the next
599 * interrupt.
600 *
601 * - It is running in user context. Store the data in the current task, the
602 * signal will be sent when the current task returns from the next interrupt.
603 *
604 * - It is running in kernel context on this or another cpu and will return to
605 * user context. Store the data in the target task, the signal will be sent
606 * to itself when the target task returns to user space.
607 *
608 * - It is running in kernel context on this cpu and will sleep before
609 * returning to user context. Because this is also the current task, the
610 * signal will not get delivered and the task could sleep indefinitely.
611 * Store the data in the idle task for this cpu, the signal will be sent
612 * after the idle task processes its next interrupt.
613 *
614 * To cover all cases, store the data in the target task, the current task and
615 * the idle task on this cpu. Whatever happens, the signal will be delivered
616 * to the target task before it can do any useful user space work. Multiple
617 * deliveries have no unwanted side effects.
618 *
619 * Note: This code is executed in MCA/INIT/NMI/PMI context, with interrupts
620 * disabled. It must not take any locks nor use kernel structures or services
621 * that require locks.
622 */
623
624/* To ensure that we get the right pid, check its start time. To avoid extra
625 * include files in thread_info.h, convert the task start_time to unsigned long,
626 * giving us a cycle time of > 580 years.
627 */
628static inline unsigned long
629start_time_ul(const struct task_struct *t)
630{
631 return t->start_time.tv_sec * NSEC_PER_SEC + t->start_time.tv_nsec;
632}
633
634void
635set_sigdelayed(pid_t pid, int signo, int code, void __user *addr)
636{
637 struct task_struct *t;
638 unsigned long start_time = 0;
639 int i;
640
641 for (i = 1; i <= 3; ++i) {
642 switch (i) {
643 case 1:
644 t = find_task_by_pid(pid);
645 if (t)
646 start_time = start_time_ul(t);
647 break;
648 case 2:
649 t = current;
650 break;
651 default:
652 t = idle_task(smp_processor_id());
653 break;
654 }
655
656 if (!t)
657 return;
658 task_thread_info(t)->sigdelayed.signo = signo;
659 task_thread_info(t)->sigdelayed.code = code;
660 task_thread_info(t)->sigdelayed.addr = addr;
661 task_thread_info(t)->sigdelayed.start_time = start_time;
662 task_thread_info(t)->sigdelayed.pid = pid;
663 wmb();
664 set_tsk_thread_flag(t, TIF_SIGDELAYED);
665 }
666}
667
668/* Called from entry.S when it detects TIF_SIGDELAYED, a delayed signal that
669 * was detected in MCA/INIT/NMI/PMI context where it could not be delivered.
670 */
671
672void
673do_sigdelayed(void)
674{
675 struct siginfo siginfo;
676 pid_t pid;
677 struct task_struct *t;
678
679 clear_thread_flag(TIF_SIGDELAYED);
680 memset(&siginfo, 0, sizeof(siginfo));
681 siginfo.si_signo = current_thread_info()->sigdelayed.signo;
682 siginfo.si_code = current_thread_info()->sigdelayed.code;
683 siginfo.si_addr = current_thread_info()->sigdelayed.addr;
684 pid = current_thread_info()->sigdelayed.pid;
685 t = find_task_by_pid(pid);
686 if (!t)
687 return;
688 if (current_thread_info()->sigdelayed.start_time != start_time_ul(t))
689 return;
690 force_sig_info(siginfo.si_signo, &siginfo, t);
691}
diff --git a/arch/ia64/kernel/smpboot.c b/arch/ia64/kernel/smpboot.c
index b681ef34a86e..44e9547878ac 100644
--- a/arch/ia64/kernel/smpboot.c
+++ b/arch/ia64/kernel/smpboot.c
@@ -70,6 +70,12 @@
70#endif 70#endif
71 71
72#ifdef CONFIG_HOTPLUG_CPU 72#ifdef CONFIG_HOTPLUG_CPU
73#ifdef CONFIG_PERMIT_BSP_REMOVE
74#define bsp_remove_ok 1
75#else
76#define bsp_remove_ok 0
77#endif
78
73/* 79/*
74 * Store all idle threads, this can be reused instead of creating 80 * Store all idle threads, this can be reused instead of creating
75 * a new thread. Also avoids complicated thread destroy functionality 81 * a new thread. Also avoids complicated thread destroy functionality
@@ -104,7 +110,7 @@ struct sal_to_os_boot *sal_state_for_booting_cpu = &sal_boot_rendez_state[0];
104/* 110/*
105 * ITC synchronization related stuff: 111 * ITC synchronization related stuff:
106 */ 112 */
107#define MASTER 0 113#define MASTER (0)
108#define SLAVE (SMP_CACHE_BYTES/8) 114#define SLAVE (SMP_CACHE_BYTES/8)
109 115
110#define NUM_ROUNDS 64 /* magic value */ 116#define NUM_ROUNDS 64 /* magic value */
@@ -151,6 +157,27 @@ char __initdata no_int_routing;
151 157
152unsigned char smp_int_redirect; /* are INT and IPI redirectable by the chipset? */ 158unsigned char smp_int_redirect; /* are INT and IPI redirectable by the chipset? */
153 159
160#ifdef CONFIG_FORCE_CPEI_RETARGET
161#define CPEI_OVERRIDE_DEFAULT (1)
162#else
163#define CPEI_OVERRIDE_DEFAULT (0)
164#endif
165
166unsigned int force_cpei_retarget = CPEI_OVERRIDE_DEFAULT;
167
168static int __init
169cmdl_force_cpei(char *str)
170{
171 int value=0;
172
173 get_option (&str, &value);
174 force_cpei_retarget = value;
175
176 return 1;
177}
178
179__setup("force_cpei=", cmdl_force_cpei);
180
154static int __init 181static int __init
155nointroute (char *str) 182nointroute (char *str)
156{ 183{
@@ -161,6 +188,27 @@ nointroute (char *str)
161 188
162__setup("nointroute", nointroute); 189__setup("nointroute", nointroute);
163 190
191static void fix_b0_for_bsp(void)
192{
193#ifdef CONFIG_HOTPLUG_CPU
194 int cpuid;
195 static int fix_bsp_b0 = 1;
196
197 cpuid = smp_processor_id();
198
199 /*
200 * Cache the b0 value on the first AP that comes up
201 */
202 if (!(fix_bsp_b0 && cpuid))
203 return;
204
205 sal_boot_rendez_state[0].br[0] = sal_boot_rendez_state[cpuid].br[0];
206 printk ("Fixed BSP b0 value from CPU %d\n", cpuid);
207
208 fix_bsp_b0 = 0;
209#endif
210}
211
164void 212void
165sync_master (void *arg) 213sync_master (void *arg)
166{ 214{
@@ -327,8 +375,9 @@ smp_setup_percpu_timer (void)
327static void __devinit 375static void __devinit
328smp_callin (void) 376smp_callin (void)
329{ 377{
330 int cpuid, phys_id; 378 int cpuid, phys_id, itc_master;
331 extern void ia64_init_itm(void); 379 extern void ia64_init_itm(void);
380 extern volatile int time_keeper_id;
332 381
333#ifdef CONFIG_PERFMON 382#ifdef CONFIG_PERFMON
334 extern void pfm_init_percpu(void); 383 extern void pfm_init_percpu(void);
@@ -336,6 +385,7 @@ smp_callin (void)
336 385
337 cpuid = smp_processor_id(); 386 cpuid = smp_processor_id();
338 phys_id = hard_smp_processor_id(); 387 phys_id = hard_smp_processor_id();
388 itc_master = time_keeper_id;
339 389
340 if (cpu_online(cpuid)) { 390 if (cpu_online(cpuid)) {
341 printk(KERN_ERR "huh, phys CPU#0x%x, CPU#0x%x already present??\n", 391 printk(KERN_ERR "huh, phys CPU#0x%x, CPU#0x%x already present??\n",
@@ -343,6 +393,8 @@ smp_callin (void)
343 BUG(); 393 BUG();
344 } 394 }
345 395
396 fix_b0_for_bsp();
397
346 lock_ipi_calllock(); 398 lock_ipi_calllock();
347 cpu_set(cpuid, cpu_online_map); 399 cpu_set(cpuid, cpu_online_map);
348 unlock_ipi_calllock(); 400 unlock_ipi_calllock();
@@ -365,8 +417,8 @@ smp_callin (void)
365 * calls spin_unlock_bh(), which calls spin_unlock_bh(), which calls 417 * calls spin_unlock_bh(), which calls spin_unlock_bh(), which calls
366 * local_bh_enable(), which bugs out if irqs are not enabled... 418 * local_bh_enable(), which bugs out if irqs are not enabled...
367 */ 419 */
368 Dprintk("Going to syncup ITC with BP.\n"); 420 Dprintk("Going to syncup ITC with ITC Master.\n");
369 ia64_sync_itc(0); 421 ia64_sync_itc(itc_master);
370 } 422 }
371 423
372 /* 424 /*
@@ -572,32 +624,8 @@ void __devinit smp_prepare_boot_cpu(void)
572 per_cpu(cpu_state, smp_processor_id()) = CPU_ONLINE; 624 per_cpu(cpu_state, smp_processor_id()) = CPU_ONLINE;
573} 625}
574 626
575/*
576 * mt_info[] is a temporary store for all info returned by
577 * PAL_LOGICAL_TO_PHYSICAL, to be copied into cpuinfo_ia64 when the
578 * specific cpu comes.
579 */
580static struct {
581 __u32 socket_id;
582 __u16 core_id;
583 __u16 thread_id;
584 __u16 proc_fixed_addr;
585 __u8 valid;
586} mt_info[NR_CPUS] __devinitdata;
587
588#ifdef CONFIG_HOTPLUG_CPU 627#ifdef CONFIG_HOTPLUG_CPU
589static inline void 628static inline void
590remove_from_mtinfo(int cpu)
591{
592 int i;
593
594 for_each_cpu(i)
595 if (mt_info[i].valid && mt_info[i].socket_id ==
596 cpu_data(cpu)->socket_id)
597 mt_info[i].valid = 0;
598}
599
600static inline void
601clear_cpu_sibling_map(int cpu) 629clear_cpu_sibling_map(int cpu)
602{ 630{
603 int i; 631 int i;
@@ -626,15 +654,50 @@ remove_siblinginfo(int cpu)
626 654
627 /* remove it from all sibling map's */ 655 /* remove it from all sibling map's */
628 clear_cpu_sibling_map(cpu); 656 clear_cpu_sibling_map(cpu);
657}
658
659extern void fixup_irqs(void);
629 660
630 /* if this cpu is the last in the core group, remove all its info 661int migrate_platform_irqs(unsigned int cpu)
631 * from mt_info structure 662{
663 int new_cpei_cpu;
664 irq_desc_t *desc = NULL;
665 cpumask_t mask;
666 int retval = 0;
667
668 /*
669 * dont permit CPEI target to removed.
632 */ 670 */
633 if (last) 671 if (cpe_vector > 0 && is_cpu_cpei_target(cpu)) {
634 remove_from_mtinfo(cpu); 672 printk ("CPU (%d) is CPEI Target\n", cpu);
673 if (can_cpei_retarget()) {
674 /*
675 * Now re-target the CPEI to a different processor
676 */
677 new_cpei_cpu = any_online_cpu(cpu_online_map);
678 mask = cpumask_of_cpu(new_cpei_cpu);
679 set_cpei_target_cpu(new_cpei_cpu);
680 desc = irq_descp(ia64_cpe_irq);
681 /*
682 * Switch for now, immediatly, we need to do fake intr
683 * as other interrupts, but need to study CPEI behaviour with
684 * polling before making changes.
685 */
686 if (desc) {
687 desc->handler->disable(ia64_cpe_irq);
688 desc->handler->set_affinity(ia64_cpe_irq, mask);
689 desc->handler->enable(ia64_cpe_irq);
690 printk ("Re-targetting CPEI to cpu %d\n", new_cpei_cpu);
691 }
692 }
693 if (!desc) {
694 printk ("Unable to retarget CPEI, offline cpu [%d] failed\n", cpu);
695 retval = -EBUSY;
696 }
697 }
698 return retval;
635} 699}
636 700
637extern void fixup_irqs(void);
638/* must be called with cpucontrol mutex held */ 701/* must be called with cpucontrol mutex held */
639int __cpu_disable(void) 702int __cpu_disable(void)
640{ 703{
@@ -643,8 +706,17 @@ int __cpu_disable(void)
643 /* 706 /*
644 * dont permit boot processor for now 707 * dont permit boot processor for now
645 */ 708 */
646 if (cpu == 0) 709 if (cpu == 0 && !bsp_remove_ok) {
647 return -EBUSY; 710 printk ("Your platform does not support removal of BSP\n");
711 return (-EBUSY);
712 }
713
714 cpu_clear(cpu, cpu_online_map);
715
716 if (migrate_platform_irqs(cpu)) {
717 cpu_set(cpu, cpu_online_map);
718 return (-EBUSY);
719 }
648 720
649 remove_siblinginfo(cpu); 721 remove_siblinginfo(cpu);
650 cpu_clear(cpu, cpu_online_map); 722 cpu_clear(cpu, cpu_online_map);
@@ -776,40 +848,6 @@ init_smp_config(void)
776 ia64_sal_strerror(sal_ret)); 848 ia64_sal_strerror(sal_ret));
777} 849}
778 850
779static inline int __devinit
780check_for_mtinfo_index(void)
781{
782 int i;
783
784 for_each_cpu(i)
785 if (!mt_info[i].valid)
786 return i;
787
788 return -1;
789}
790
791/*
792 * Search the mt_info to find out if this socket's cid/tid information is
793 * cached or not. If the socket exists, fill in the core_id and thread_id
794 * in cpuinfo
795 */
796static int __devinit
797check_for_new_socket(__u16 logical_address, struct cpuinfo_ia64 *c)
798{
799 int i;
800 __u32 sid = c->socket_id;
801
802 for_each_cpu(i) {
803 if (mt_info[i].valid && mt_info[i].proc_fixed_addr == logical_address
804 && mt_info[i].socket_id == sid) {
805 c->core_id = mt_info[i].core_id;
806 c->thread_id = mt_info[i].thread_id;
807 return 1; /* not a new socket */
808 }
809 }
810 return 0;
811}
812
813/* 851/*
814 * identify_siblings(cpu) gets called from identify_cpu. This populates the 852 * identify_siblings(cpu) gets called from identify_cpu. This populates the
815 * information related to logical execution units in per_cpu_data structure. 853 * information related to logical execution units in per_cpu_data structure.
@@ -819,14 +857,12 @@ identify_siblings(struct cpuinfo_ia64 *c)
819{ 857{
820 s64 status; 858 s64 status;
821 u16 pltid; 859 u16 pltid;
822 u64 proc_fixed_addr;
823 int count, i;
824 pal_logical_to_physical_t info; 860 pal_logical_to_physical_t info;
825 861
826 if (smp_num_cpucores == 1 && smp_num_siblings == 1) 862 if (smp_num_cpucores == 1 && smp_num_siblings == 1)
827 return; 863 return;
828 864
829 if ((status = ia64_pal_logical_to_phys(0, &info)) != PAL_STATUS_SUCCESS) { 865 if ((status = ia64_pal_logical_to_phys(-1, &info)) != PAL_STATUS_SUCCESS) {
830 printk(KERN_ERR "ia64_pal_logical_to_phys failed with %ld\n", 866 printk(KERN_ERR "ia64_pal_logical_to_phys failed with %ld\n",
831 status); 867 status);
832 return; 868 return;
@@ -835,47 +871,12 @@ identify_siblings(struct cpuinfo_ia64 *c)
835 printk(KERN_ERR "ia64_sal_pltid failed with %ld\n", status); 871 printk(KERN_ERR "ia64_sal_pltid failed with %ld\n", status);
836 return; 872 return;
837 } 873 }
838 if ((status = ia64_pal_fixed_addr(&proc_fixed_addr)) != PAL_STATUS_SUCCESS) {
839 printk(KERN_ERR "ia64_pal_fixed_addr failed with %ld\n", status);
840 return;
841 }
842 874
843 c->socket_id = (pltid << 8) | info.overview_ppid; 875 c->socket_id = (pltid << 8) | info.overview_ppid;
844 c->cores_per_socket = info.overview_cpp; 876 c->cores_per_socket = info.overview_cpp;
845 c->threads_per_core = info.overview_tpc; 877 c->threads_per_core = info.overview_tpc;
846 count = c->num_log = info.overview_num_log; 878 c->num_log = info.overview_num_log;
847
848 /* If the thread and core id information is already cached, then
849 * we will simply update cpu_info and return. Otherwise, we will
850 * do the PAL calls and cache core and thread id's of all the siblings.
851 */
852 if (check_for_new_socket(proc_fixed_addr, c))
853 return;
854
855 for (i = 0; i < count; i++) {
856 int index;
857
858 if (i && (status = ia64_pal_logical_to_phys(i, &info))
859 != PAL_STATUS_SUCCESS) {
860 printk(KERN_ERR "ia64_pal_logical_to_phys failed"
861 " with %ld\n", status);
862 return;
863 }
864 if (info.log2_la == proc_fixed_addr) {
865 c->core_id = info.log1_cid;
866 c->thread_id = info.log1_tid;
867 }
868 879
869 index = check_for_mtinfo_index(); 880 c->core_id = info.log1_cid;
870 /* We will not do the mt_info caching optimization in this case. 881 c->thread_id = info.log1_tid;
871 */
872 if (index < 0)
873 continue;
874
875 mt_info[index].valid = 1;
876 mt_info[index].socket_id = c->socket_id;
877 mt_info[index].core_id = info.log1_cid;
878 mt_info[index].thread_id = info.log1_tid;
879 mt_info[index].proc_fixed_addr = info.log2_la;
880 }
881} 882}
diff --git a/arch/ia64/kernel/time.c b/arch/ia64/kernel/time.c
index 307d01e15b2e..49958904045b 100644
--- a/arch/ia64/kernel/time.c
+++ b/arch/ia64/kernel/time.c
@@ -32,7 +32,7 @@
32 32
33extern unsigned long wall_jiffies; 33extern unsigned long wall_jiffies;
34 34
35#define TIME_KEEPER_ID 0 /* smp_processor_id() of time-keeper */ 35volatile int time_keeper_id = 0; /* smp_processor_id() of time-keeper */
36 36
37#ifdef CONFIG_IA64_DEBUG_IRQ 37#ifdef CONFIG_IA64_DEBUG_IRQ
38 38
@@ -71,7 +71,7 @@ timer_interrupt (int irq, void *dev_id, struct pt_regs *regs)
71 71
72 new_itm += local_cpu_data->itm_delta; 72 new_itm += local_cpu_data->itm_delta;
73 73
74 if (smp_processor_id() == TIME_KEEPER_ID) { 74 if (smp_processor_id() == time_keeper_id) {
75 /* 75 /*
76 * Here we are in the timer irq handler. We have irqs locally 76 * Here we are in the timer irq handler. We have irqs locally
77 * disabled, but we don't know if the timer_bh is running on 77 * disabled, but we don't know if the timer_bh is running on
@@ -188,7 +188,7 @@ ia64_init_itm (void)
188 itc_freq = (platform_base_freq*itc_ratio.num)/itc_ratio.den; 188 itc_freq = (platform_base_freq*itc_ratio.num)/itc_ratio.den;
189 189
190 local_cpu_data->itm_delta = (itc_freq + HZ/2) / HZ; 190 local_cpu_data->itm_delta = (itc_freq + HZ/2) / HZ;
191 printk(KERN_DEBUG "CPU %d: base freq=%lu.%03luMHz, ITC ratio=%lu/%lu, " 191 printk(KERN_DEBUG "CPU %d: base freq=%lu.%03luMHz, ITC ratio=%u/%u, "
192 "ITC freq=%lu.%03luMHz", smp_processor_id(), 192 "ITC freq=%lu.%03luMHz", smp_processor_id(),
193 platform_base_freq / 1000000, (platform_base_freq / 1000) % 1000, 193 platform_base_freq / 1000000, (platform_base_freq / 1000) % 1000,
194 itc_ratio.num, itc_ratio.den, itc_freq / 1000000, (itc_freq / 1000) % 1000); 194 itc_ratio.num, itc_ratio.den, itc_freq / 1000000, (itc_freq / 1000) % 1000);
@@ -236,6 +236,11 @@ static struct irqaction timer_irqaction = {
236 .name = "timer" 236 .name = "timer"
237}; 237};
238 238
239void __devinit ia64_disable_timer(void)
240{
241 ia64_set_itv(1 << 16);
242}
243
239void __init 244void __init
240time_init (void) 245time_init (void)
241{ 246{
diff --git a/arch/ia64/kernel/topology.c b/arch/ia64/kernel/topology.c
index 6e5eea19fa67..b47476d655f1 100644
--- a/arch/ia64/kernel/topology.c
+++ b/arch/ia64/kernel/topology.c
@@ -9,6 +9,8 @@
9 * 2002/08/07 Erich Focht <efocht@ess.nec.de> 9 * 2002/08/07 Erich Focht <efocht@ess.nec.de>
10 * Populate cpu entries in sysfs for non-numa systems as well 10 * Populate cpu entries in sysfs for non-numa systems as well
11 * Intel Corporation - Ashok Raj 11 * Intel Corporation - Ashok Raj
12 * 02/27/2006 Zhang, Yanmin
13 * Populate cpu cache entries in sysfs for cpu cache info
12 */ 14 */
13 15
14#include <linux/config.h> 16#include <linux/config.h>
@@ -19,6 +21,7 @@
19#include <linux/init.h> 21#include <linux/init.h>
20#include <linux/bootmem.h> 22#include <linux/bootmem.h>
21#include <linux/nodemask.h> 23#include <linux/nodemask.h>
24#include <linux/notifier.h>
22#include <asm/mmzone.h> 25#include <asm/mmzone.h>
23#include <asm/numa.h> 26#include <asm/numa.h>
24#include <asm/cpu.h> 27#include <asm/cpu.h>
@@ -36,7 +39,7 @@ int arch_register_cpu(int num)
36 parent = &sysfs_nodes[cpu_to_node(num)]; 39 parent = &sysfs_nodes[cpu_to_node(num)];
37#endif /* CONFIG_NUMA */ 40#endif /* CONFIG_NUMA */
38 41
39#ifdef CONFIG_ACPI 42#if defined (CONFIG_ACPI) && defined (CONFIG_HOTPLUG_CPU)
40 /* 43 /*
41 * If CPEI cannot be re-targetted, and this is 44 * If CPEI cannot be re-targetted, and this is
42 * CPEI target, then dont create the control file 45 * CPEI target, then dont create the control file
@@ -101,3 +104,367 @@ out:
101} 104}
102 105
103subsys_initcall(topology_init); 106subsys_initcall(topology_init);
107
108
109/*
110 * Export cpu cache information through sysfs
111 */
112
113/*
114 * A bunch of string array to get pretty printing
115 */
116static const char *cache_types[] = {
117 "", /* not used */
118 "Instruction",
119 "Data",
120 "Unified" /* unified */
121};
122
123static const char *cache_mattrib[]={
124 "WriteThrough",
125 "WriteBack",
126 "", /* reserved */
127 "" /* reserved */
128};
129
130struct cache_info {
131 pal_cache_config_info_t cci;
132 cpumask_t shared_cpu_map;
133 int level;
134 int type;
135 struct kobject kobj;
136};
137
138struct cpu_cache_info {
139 struct cache_info *cache_leaves;
140 int num_cache_leaves;
141 struct kobject kobj;
142};
143
144static struct cpu_cache_info all_cpu_cache_info[NR_CPUS];
145#define LEAF_KOBJECT_PTR(x,y) (&all_cpu_cache_info[x].cache_leaves[y])
146
147#ifdef CONFIG_SMP
148static void cache_shared_cpu_map_setup( unsigned int cpu,
149 struct cache_info * this_leaf)
150{
151 pal_cache_shared_info_t csi;
152 int num_shared, i = 0;
153 unsigned int j;
154
155 if (cpu_data(cpu)->threads_per_core <= 1 &&
156 cpu_data(cpu)->cores_per_socket <= 1) {
157 cpu_set(cpu, this_leaf->shared_cpu_map);
158 return;
159 }
160
161 if (ia64_pal_cache_shared_info(this_leaf->level,
162 this_leaf->type,
163 0,
164 &csi) != PAL_STATUS_SUCCESS)
165 return;
166
167 num_shared = (int) csi.num_shared;
168 do {
169 for_each_cpu(j)
170 if (cpu_data(cpu)->socket_id == cpu_data(j)->socket_id
171 && cpu_data(j)->core_id == csi.log1_cid
172 && cpu_data(j)->thread_id == csi.log1_tid)
173 cpu_set(j, this_leaf->shared_cpu_map);
174
175 i++;
176 } while (i < num_shared &&
177 ia64_pal_cache_shared_info(this_leaf->level,
178 this_leaf->type,
179 i,
180 &csi) == PAL_STATUS_SUCCESS);
181}
182#else
183static void cache_shared_cpu_map_setup(unsigned int cpu,
184 struct cache_info * this_leaf)
185{
186 cpu_set(cpu, this_leaf->shared_cpu_map);
187 return;
188}
189#endif
190
191static ssize_t show_coherency_line_size(struct cache_info *this_leaf,
192 char *buf)
193{
194 return sprintf(buf, "%u\n", 1 << this_leaf->cci.pcci_line_size);
195}
196
197static ssize_t show_ways_of_associativity(struct cache_info *this_leaf,
198 char *buf)
199{
200 return sprintf(buf, "%u\n", this_leaf->cci.pcci_assoc);
201}
202
203static ssize_t show_attributes(struct cache_info *this_leaf, char *buf)
204{
205 return sprintf(buf,
206 "%s\n",
207 cache_mattrib[this_leaf->cci.pcci_cache_attr]);
208}
209
210static ssize_t show_size(struct cache_info *this_leaf, char *buf)
211{
212 return sprintf(buf, "%uK\n", this_leaf->cci.pcci_cache_size / 1024);
213}
214
215static ssize_t show_number_of_sets(struct cache_info *this_leaf, char *buf)
216{
217 unsigned number_of_sets = this_leaf->cci.pcci_cache_size;
218 number_of_sets /= this_leaf->cci.pcci_assoc;
219 number_of_sets /= 1 << this_leaf->cci.pcci_line_size;
220
221 return sprintf(buf, "%u\n", number_of_sets);
222}
223
224static ssize_t show_shared_cpu_map(struct cache_info *this_leaf, char *buf)
225{
226 ssize_t len;
227 cpumask_t shared_cpu_map;
228
229 cpus_and(shared_cpu_map, this_leaf->shared_cpu_map, cpu_online_map);
230 len = cpumask_scnprintf(buf, NR_CPUS+1, shared_cpu_map);
231 len += sprintf(buf+len, "\n");
232 return len;
233}
234
235static ssize_t show_type(struct cache_info *this_leaf, char *buf)
236{
237 int type = this_leaf->type + this_leaf->cci.pcci_unified;
238 return sprintf(buf, "%s\n", cache_types[type]);
239}
240
241static ssize_t show_level(struct cache_info *this_leaf, char *buf)
242{
243 return sprintf(buf, "%u\n", this_leaf->level);
244}
245
246struct cache_attr {
247 struct attribute attr;
248 ssize_t (*show)(struct cache_info *, char *);
249 ssize_t (*store)(struct cache_info *, const char *, size_t count);
250};
251
252#ifdef define_one_ro
253 #undef define_one_ro
254#endif
255#define define_one_ro(_name) \
256 static struct cache_attr _name = \
257__ATTR(_name, 0444, show_##_name, NULL)
258
259define_one_ro(level);
260define_one_ro(type);
261define_one_ro(coherency_line_size);
262define_one_ro(ways_of_associativity);
263define_one_ro(size);
264define_one_ro(number_of_sets);
265define_one_ro(shared_cpu_map);
266define_one_ro(attributes);
267
268static struct attribute * cache_default_attrs[] = {
269 &type.attr,
270 &level.attr,
271 &coherency_line_size.attr,
272 &ways_of_associativity.attr,
273 &attributes.attr,
274 &size.attr,
275 &number_of_sets.attr,
276 &shared_cpu_map.attr,
277 NULL
278};
279
280#define to_object(k) container_of(k, struct cache_info, kobj)
281#define to_attr(a) container_of(a, struct cache_attr, attr)
282
283static ssize_t cache_show(struct kobject * kobj, struct attribute * attr, char * buf)
284{
285 struct cache_attr *fattr = to_attr(attr);
286 struct cache_info *this_leaf = to_object(kobj);
287 ssize_t ret;
288
289 ret = fattr->show ? fattr->show(this_leaf, buf) : 0;
290 return ret;
291}
292
293static struct sysfs_ops cache_sysfs_ops = {
294 .show = cache_show
295};
296
297static struct kobj_type cache_ktype = {
298 .sysfs_ops = &cache_sysfs_ops,
299 .default_attrs = cache_default_attrs,
300};
301
302static struct kobj_type cache_ktype_percpu_entry = {
303 .sysfs_ops = &cache_sysfs_ops,
304};
305
306static void __cpuinit cpu_cache_sysfs_exit(unsigned int cpu)
307{
308 if (all_cpu_cache_info[cpu].cache_leaves) {
309 kfree(all_cpu_cache_info[cpu].cache_leaves);
310 all_cpu_cache_info[cpu].cache_leaves = NULL;
311 }
312 all_cpu_cache_info[cpu].num_cache_leaves = 0;
313 memset(&all_cpu_cache_info[cpu].kobj, 0, sizeof(struct kobject));
314
315 return;
316}
317
318static int __cpuinit cpu_cache_sysfs_init(unsigned int cpu)
319{
320 u64 i, levels, unique_caches;
321 pal_cache_config_info_t cci;
322 int j;
323 s64 status;
324 struct cache_info *this_cache;
325 int num_cache_leaves = 0;
326
327 if ((status = ia64_pal_cache_summary(&levels, &unique_caches)) != 0) {
328 printk(KERN_ERR "ia64_pal_cache_summary=%ld\n", status);
329 return -1;
330 }
331
332 this_cache=kzalloc(sizeof(struct cache_info)*unique_caches,
333 GFP_KERNEL);
334 if (this_cache == NULL)
335 return -ENOMEM;
336
337 for (i=0; i < levels; i++) {
338 for (j=2; j >0 ; j--) {
339 if ((status=ia64_pal_cache_config_info(i,j, &cci)) !=
340 PAL_STATUS_SUCCESS)
341 continue;
342
343 this_cache[num_cache_leaves].cci = cci;
344 this_cache[num_cache_leaves].level = i + 1;
345 this_cache[num_cache_leaves].type = j;
346
347 cache_shared_cpu_map_setup(cpu,
348 &this_cache[num_cache_leaves]);
349 num_cache_leaves ++;
350 }
351 }
352
353 all_cpu_cache_info[cpu].cache_leaves = this_cache;
354 all_cpu_cache_info[cpu].num_cache_leaves = num_cache_leaves;
355
356 memset(&all_cpu_cache_info[cpu].kobj, 0, sizeof(struct kobject));
357
358 return 0;
359}
360
361/* Add cache interface for CPU device */
362static int __cpuinit cache_add_dev(struct sys_device * sys_dev)
363{
364 unsigned int cpu = sys_dev->id;
365 unsigned long i, j;
366 struct cache_info *this_object;
367 int retval = 0;
368 cpumask_t oldmask;
369
370 if (all_cpu_cache_info[cpu].kobj.parent)
371 return 0;
372
373 oldmask = current->cpus_allowed;
374 retval = set_cpus_allowed(current, cpumask_of_cpu(cpu));
375 if (unlikely(retval))
376 return retval;
377
378 retval = cpu_cache_sysfs_init(cpu);
379 set_cpus_allowed(current, oldmask);
380 if (unlikely(retval < 0))
381 return retval;
382
383 all_cpu_cache_info[cpu].kobj.parent = &sys_dev->kobj;
384 kobject_set_name(&all_cpu_cache_info[cpu].kobj, "%s", "cache");
385 all_cpu_cache_info[cpu].kobj.ktype = &cache_ktype_percpu_entry;
386 retval = kobject_register(&all_cpu_cache_info[cpu].kobj);
387
388 for (i = 0; i < all_cpu_cache_info[cpu].num_cache_leaves; i++) {
389 this_object = LEAF_KOBJECT_PTR(cpu,i);
390 this_object->kobj.parent = &all_cpu_cache_info[cpu].kobj;
391 kobject_set_name(&(this_object->kobj), "index%1lu", i);
392 this_object->kobj.ktype = &cache_ktype;
393 retval = kobject_register(&(this_object->kobj));
394 if (unlikely(retval)) {
395 for (j = 0; j < i; j++) {
396 kobject_unregister(
397 &(LEAF_KOBJECT_PTR(cpu,j)->kobj));
398 }
399 kobject_unregister(&all_cpu_cache_info[cpu].kobj);
400 cpu_cache_sysfs_exit(cpu);
401 break;
402 }
403 }
404 return retval;
405}
406
407/* Remove cache interface for CPU device */
408static int __cpuinit cache_remove_dev(struct sys_device * sys_dev)
409{
410 unsigned int cpu = sys_dev->id;
411 unsigned long i;
412
413 for (i = 0; i < all_cpu_cache_info[cpu].num_cache_leaves; i++)
414 kobject_unregister(&(LEAF_KOBJECT_PTR(cpu,i)->kobj));
415
416 if (all_cpu_cache_info[cpu].kobj.parent) {
417 kobject_unregister(&all_cpu_cache_info[cpu].kobj);
418 memset(&all_cpu_cache_info[cpu].kobj,
419 0,
420 sizeof(struct kobject));
421 }
422
423 cpu_cache_sysfs_exit(cpu);
424
425 return 0;
426}
427
428/*
429 * When a cpu is hot-plugged, do a check and initiate
430 * cache kobject if necessary
431 */
432static int __cpuinit cache_cpu_callback(struct notifier_block *nfb,
433 unsigned long action, void *hcpu)
434{
435 unsigned int cpu = (unsigned long)hcpu;
436 struct sys_device *sys_dev;
437
438 sys_dev = get_cpu_sysdev(cpu);
439 switch (action) {
440 case CPU_ONLINE:
441 cache_add_dev(sys_dev);
442 break;
443 case CPU_DEAD:
444 cache_remove_dev(sys_dev);
445 break;
446 }
447 return NOTIFY_OK;
448}
449
450static struct notifier_block cache_cpu_notifier =
451{
452 .notifier_call = cache_cpu_callback
453};
454
455static int __cpuinit cache_sysfs_init(void)
456{
457 int i;
458
459 for_each_online_cpu(i) {
460 cache_cpu_callback(&cache_cpu_notifier, CPU_ONLINE,
461 (void *)(long)i);
462 }
463
464 register_cpu_notifier(&cache_cpu_notifier);
465
466 return 0;
467}
468
469device_initcall(cache_sysfs_init);
470
diff --git a/arch/ia64/kernel/traps.c b/arch/ia64/kernel/traps.c
index dabd6c32641e..7c1ddc8ac443 100644
--- a/arch/ia64/kernel/traps.c
+++ b/arch/ia64/kernel/traps.c
@@ -30,19 +30,19 @@ extern spinlock_t timerlist_lock;
30fpswa_interface_t *fpswa_interface; 30fpswa_interface_t *fpswa_interface;
31EXPORT_SYMBOL(fpswa_interface); 31EXPORT_SYMBOL(fpswa_interface);
32 32
33struct notifier_block *ia64die_chain; 33ATOMIC_NOTIFIER_HEAD(ia64die_chain);
34 34
35int 35int
36register_die_notifier(struct notifier_block *nb) 36register_die_notifier(struct notifier_block *nb)
37{ 37{
38 return notifier_chain_register(&ia64die_chain, nb); 38 return atomic_notifier_chain_register(&ia64die_chain, nb);
39} 39}
40EXPORT_SYMBOL_GPL(register_die_notifier); 40EXPORT_SYMBOL_GPL(register_die_notifier);
41 41
42int 42int
43unregister_die_notifier(struct notifier_block *nb) 43unregister_die_notifier(struct notifier_block *nb)
44{ 44{
45 return notifier_chain_unregister(&ia64die_chain, nb); 45 return atomic_notifier_chain_unregister(&ia64die_chain, nb);
46} 46}
47EXPORT_SYMBOL_GPL(unregister_die_notifier); 47EXPORT_SYMBOL_GPL(unregister_die_notifier);
48 48
diff --git a/arch/ia64/kernel/vmlinux.lds.S b/arch/ia64/kernel/vmlinux.lds.S
index 73af6267d2ef..783600fe52b2 100644
--- a/arch/ia64/kernel/vmlinux.lds.S
+++ b/arch/ia64/kernel/vmlinux.lds.S
@@ -70,34 +70,18 @@ SECTIONS
70 __stop___ex_table = .; 70 __stop___ex_table = .;
71 } 71 }
72 72
73 .data.patch.vtop : AT(ADDR(.data.patch.vtop) - LOAD_OFFSET) 73 /* MCA table */
74 { 74 . = ALIGN(16);
75 __start___vtop_patchlist = .; 75 __mca_table : AT(ADDR(__mca_table) - LOAD_OFFSET)
76 *(.data.patch.vtop)
77 __end___vtop_patchlist = .;
78 }
79
80 .data.patch.mckinley_e9 : AT(ADDR(.data.patch.mckinley_e9) - LOAD_OFFSET)
81 { 76 {
82 __start___mckinley_e9_bundles = .; 77 __start___mca_table = .;
83 *(.data.patch.mckinley_e9) 78 *(__mca_table)
84 __end___mckinley_e9_bundles = .; 79 __stop___mca_table = .;
85 } 80 }
86 81
87 /* Global data */ 82 /* Global data */
88 _data = .; 83 _data = .;
89 84
90#if defined(CONFIG_IA64_GENERIC)
91 /* Machine Vector */
92 . = ALIGN(16);
93 .machvec : AT(ADDR(.machvec) - LOAD_OFFSET)
94 {
95 machvec_start = .;
96 *(.machvec)
97 machvec_end = .;
98 }
99#endif
100
101 /* Unwind info & table: */ 85 /* Unwind info & table: */
102 . = ALIGN(8); 86 . = ALIGN(8);
103 .IA_64.unwind_info : AT(ADDR(.IA_64.unwind_info) - LOAD_OFFSET) 87 .IA_64.unwind_info : AT(ADDR(.IA_64.unwind_info) - LOAD_OFFSET)
@@ -154,6 +138,32 @@ SECTIONS
154 *(.initcall7.init) 138 *(.initcall7.init)
155 __initcall_end = .; 139 __initcall_end = .;
156 } 140 }
141
142 .data.patch.vtop : AT(ADDR(.data.patch.vtop) - LOAD_OFFSET)
143 {
144 __start___vtop_patchlist = .;
145 *(.data.patch.vtop)
146 __end___vtop_patchlist = .;
147 }
148
149 .data.patch.mckinley_e9 : AT(ADDR(.data.patch.mckinley_e9) - LOAD_OFFSET)
150 {
151 __start___mckinley_e9_bundles = .;
152 *(.data.patch.mckinley_e9)
153 __end___mckinley_e9_bundles = .;
154 }
155
156#if defined(CONFIG_IA64_GENERIC)
157 /* Machine Vector */
158 . = ALIGN(16);
159 .machvec : AT(ADDR(.machvec) - LOAD_OFFSET)
160 {
161 machvec_start = .;
162 *(.machvec)
163 machvec_end = .;
164 }
165#endif
166
157 __con_initcall_start = .; 167 __con_initcall_start = .;
158 .con_initcall.init : AT(ADDR(.con_initcall.init) - LOAD_OFFSET) 168 .con_initcall.init : AT(ADDR(.con_initcall.init) - LOAD_OFFSET)
159 { *(.con_initcall.init) } 169 { *(.con_initcall.init) }
diff --git a/arch/ia64/lib/Makefile b/arch/ia64/lib/Makefile
index ac64664a1807..d8536a2c22a9 100644
--- a/arch/ia64/lib/Makefile
+++ b/arch/ia64/lib/Makefile
@@ -6,7 +6,7 @@ obj-y := io.o
6 6
7lib-y := __divsi3.o __udivsi3.o __modsi3.o __umodsi3.o \ 7lib-y := __divsi3.o __udivsi3.o __modsi3.o __umodsi3.o \
8 __divdi3.o __udivdi3.o __moddi3.o __umoddi3.o \ 8 __divdi3.o __udivdi3.o __moddi3.o __umoddi3.o \
9 bitop.o checksum.o clear_page.o csum_partial_copy.o \ 9 checksum.o clear_page.o csum_partial_copy.o \
10 clear_user.o strncpy_from_user.o strlen_user.o strnlen_user.o \ 10 clear_user.o strncpy_from_user.o strlen_user.o strnlen_user.o \
11 flush.o ip_fast_csum.o do_csum.o \ 11 flush.o ip_fast_csum.o do_csum.o \
12 memset.o strlen.o 12 memset.o strlen.o
diff --git a/arch/ia64/lib/bitop.c b/arch/ia64/lib/bitop.c
deleted file mode 100644
index 82e299c8464e..000000000000
--- a/arch/ia64/lib/bitop.c
+++ /dev/null
@@ -1,88 +0,0 @@
1#include <linux/compiler.h>
2#include <linux/types.h>
3#include <asm/intrinsics.h>
4#include <linux/module.h>
5#include <linux/bitops.h>
6
7/*
8 * Find next zero bit in a bitmap reasonably efficiently..
9 */
10
11int __find_next_zero_bit (const void *addr, unsigned long size, unsigned long offset)
12{
13 unsigned long *p = ((unsigned long *) addr) + (offset >> 6);
14 unsigned long result = offset & ~63UL;
15 unsigned long tmp;
16
17 if (offset >= size)
18 return size;
19 size -= result;
20 offset &= 63UL;
21 if (offset) {
22 tmp = *(p++);
23 tmp |= ~0UL >> (64-offset);
24 if (size < 64)
25 goto found_first;
26 if (~tmp)
27 goto found_middle;
28 size -= 64;
29 result += 64;
30 }
31 while (size & ~63UL) {
32 if (~(tmp = *(p++)))
33 goto found_middle;
34 result += 64;
35 size -= 64;
36 }
37 if (!size)
38 return result;
39 tmp = *p;
40found_first:
41 tmp |= ~0UL << size;
42 if (tmp == ~0UL) /* any bits zero? */
43 return result + size; /* nope */
44found_middle:
45 return result + ffz(tmp);
46}
47EXPORT_SYMBOL(__find_next_zero_bit);
48
49/*
50 * Find next bit in a bitmap reasonably efficiently..
51 */
52int __find_next_bit(const void *addr, unsigned long size, unsigned long offset)
53{
54 unsigned long *p = ((unsigned long *) addr) + (offset >> 6);
55 unsigned long result = offset & ~63UL;
56 unsigned long tmp;
57
58 if (offset >= size)
59 return size;
60 size -= result;
61 offset &= 63UL;
62 if (offset) {
63 tmp = *(p++);
64 tmp &= ~0UL << offset;
65 if (size < 64)
66 goto found_first;
67 if (tmp)
68 goto found_middle;
69 size -= 64;
70 result += 64;
71 }
72 while (size & ~63UL) {
73 if ((tmp = *(p++)))
74 goto found_middle;
75 result += 64;
76 size -= 64;
77 }
78 if (!size)
79 return result;
80 tmp = *p;
81 found_first:
82 tmp &= ~0UL >> (64-size);
83 if (tmp == 0UL) /* Are any bits set? */
84 return result + size; /* Nope. */
85 found_middle:
86 return result + __ffs(tmp);
87}
88EXPORT_SYMBOL(__find_next_bit);
diff --git a/arch/ia64/mm/Makefile b/arch/ia64/mm/Makefile
index d78d20f0a0f0..bb0a01a81878 100644
--- a/arch/ia64/mm/Makefile
+++ b/arch/ia64/mm/Makefile
@@ -2,7 +2,7 @@
2# Makefile for the ia64-specific parts of the memory manager. 2# Makefile for the ia64-specific parts of the memory manager.
3# 3#
4 4
5obj-y := init.o fault.o tlb.o extable.o 5obj-y := init.o fault.o tlb.o extable.o ioremap.o
6 6
7obj-$(CONFIG_HUGETLB_PAGE) += hugetlbpage.o 7obj-$(CONFIG_HUGETLB_PAGE) += hugetlbpage.o
8obj-$(CONFIG_NUMA) += numa.o 8obj-$(CONFIG_NUMA) += numa.o
diff --git a/arch/ia64/mm/contig.c b/arch/ia64/mm/contig.c
index acaaec4e4681..84fd1c14c8a9 100644
--- a/arch/ia64/mm/contig.c
+++ b/arch/ia64/mm/contig.c
@@ -97,7 +97,7 @@ find_max_pfn (unsigned long start, unsigned long end, void *arg)
97 * Find a place to put the bootmap and return its starting address in 97 * Find a place to put the bootmap and return its starting address in
98 * bootmap_start. This address must be page-aligned. 98 * bootmap_start. This address must be page-aligned.
99 */ 99 */
100int 100static int __init
101find_bootmap_location (unsigned long start, unsigned long end, void *arg) 101find_bootmap_location (unsigned long start, unsigned long end, void *arg)
102{ 102{
103 unsigned long needed = *(unsigned long *)arg; 103 unsigned long needed = *(unsigned long *)arg;
@@ -141,7 +141,7 @@ find_bootmap_location (unsigned long start, unsigned long end, void *arg)
141 * Walk the EFI memory map and find usable memory for the system, taking 141 * Walk the EFI memory map and find usable memory for the system, taking
142 * into account reserved areas. 142 * into account reserved areas.
143 */ 143 */
144void 144void __init
145find_memory (void) 145find_memory (void)
146{ 146{
147 unsigned long bootmap_size; 147 unsigned long bootmap_size;
@@ -176,18 +176,20 @@ find_memory (void)
176 * 176 *
177 * Allocate and setup per-cpu data areas. 177 * Allocate and setup per-cpu data areas.
178 */ 178 */
179void * 179void * __cpuinit
180per_cpu_init (void) 180per_cpu_init (void)
181{ 181{
182 void *cpu_data; 182 void *cpu_data;
183 int cpu; 183 int cpu;
184 static int first_time=1;
184 185
185 /* 186 /*
186 * get_free_pages() cannot be used before cpu_init() done. BSP 187 * get_free_pages() cannot be used before cpu_init() done. BSP
187 * allocates "NR_CPUS" pages for all CPUs to avoid that AP calls 188 * allocates "NR_CPUS" pages for all CPUs to avoid that AP calls
188 * get_zeroed_page(). 189 * get_zeroed_page().
189 */ 190 */
190 if (smp_processor_id() == 0) { 191 if (first_time) {
192 first_time=0;
191 cpu_data = __alloc_bootmem(PERCPU_PAGE_SIZE * NR_CPUS, 193 cpu_data = __alloc_bootmem(PERCPU_PAGE_SIZE * NR_CPUS,
192 PERCPU_PAGE_SIZE, __pa(MAX_DMA_ADDRESS)); 194 PERCPU_PAGE_SIZE, __pa(MAX_DMA_ADDRESS));
193 for (cpu = 0; cpu < NR_CPUS; cpu++) { 195 for (cpu = 0; cpu < NR_CPUS; cpu++) {
@@ -226,7 +228,7 @@ count_dma_pages (u64 start, u64 end, void *arg)
226 * Set up the page tables. 228 * Set up the page tables.
227 */ 229 */
228 230
229void 231void __init
230paging_init (void) 232paging_init (void)
231{ 233{
232 unsigned long max_dma; 234 unsigned long max_dma;
diff --git a/arch/ia64/mm/discontig.c b/arch/ia64/mm/discontig.c
index c87d6d1d5813..ec9eeb89975d 100644
--- a/arch/ia64/mm/discontig.c
+++ b/arch/ia64/mm/discontig.c
@@ -379,31 +379,6 @@ static void __init *memory_less_node_alloc(int nid, unsigned long pernodesize)
379} 379}
380 380
381/** 381/**
382 * pgdat_insert - insert the pgdat into global pgdat_list
383 * @pgdat: the pgdat for a node.
384 */
385static void __init pgdat_insert(pg_data_t *pgdat)
386{
387 pg_data_t *prev = NULL, *next;
388
389 for_each_pgdat(next)
390 if (pgdat->node_id < next->node_id)
391 break;
392 else
393 prev = next;
394
395 if (prev) {
396 prev->pgdat_next = pgdat;
397 pgdat->pgdat_next = next;
398 } else {
399 pgdat->pgdat_next = pgdat_list;
400 pgdat_list = pgdat;
401 }
402
403 return;
404}
405
406/**
407 * memory_less_nodes - allocate and initialize CPU only nodes pernode 382 * memory_less_nodes - allocate and initialize CPU only nodes pernode
408 * information. 383 * information.
409 */ 384 */
@@ -525,15 +500,20 @@ void __init find_memory(void)
525 * find_pernode_space() does most of this already, we just need to set 500 * find_pernode_space() does most of this already, we just need to set
526 * local_per_cpu_offset 501 * local_per_cpu_offset
527 */ 502 */
528void *per_cpu_init(void) 503void __cpuinit *per_cpu_init(void)
529{ 504{
530 int cpu; 505 int cpu;
506 static int first_time = 1;
507
531 508
532 if (smp_processor_id() != 0) 509 if (smp_processor_id() != 0)
533 return __per_cpu_start + __per_cpu_offset[smp_processor_id()]; 510 return __per_cpu_start + __per_cpu_offset[smp_processor_id()];
534 511
535 for (cpu = 0; cpu < NR_CPUS; cpu++) 512 if (first_time) {
536 per_cpu(local_per_cpu_offset, cpu) = __per_cpu_offset[cpu]; 513 first_time = 0;
514 for (cpu = 0; cpu < NR_CPUS; cpu++)
515 per_cpu(local_per_cpu_offset, cpu) = __per_cpu_offset[cpu];
516 }
537 517
538 return __per_cpu_start + __per_cpu_offset[smp_processor_id()]; 518 return __per_cpu_start + __per_cpu_offset[smp_processor_id()];
539} 519}
@@ -555,7 +535,7 @@ void show_mem(void)
555 printk("Mem-info:\n"); 535 printk("Mem-info:\n");
556 show_free_areas(); 536 show_free_areas();
557 printk("Free swap: %6ldkB\n", nr_swap_pages<<(PAGE_SHIFT-10)); 537 printk("Free swap: %6ldkB\n", nr_swap_pages<<(PAGE_SHIFT-10));
558 for_each_pgdat(pgdat) { 538 for_each_online_pgdat(pgdat) {
559 unsigned long present; 539 unsigned long present;
560 unsigned long flags; 540 unsigned long flags;
561 int shared = 0, cached = 0, reserved = 0; 541 int shared = 0, cached = 0, reserved = 0;
@@ -740,11 +720,5 @@ void __init paging_init(void)
740 pfn_offset, zholes_size); 720 pfn_offset, zholes_size);
741 } 721 }
742 722
743 /*
744 * Make memory less nodes become a member of the known nodes.
745 */
746 for_each_node_mask(node, memory_less_mask)
747 pgdat_insert(mem_data[node].pgdat);
748
749 zero_page_memmap_ptr = virt_to_page(ia64_imva(empty_zero_page)); 723 zero_page_memmap_ptr = virt_to_page(ia64_imva(empty_zero_page));
750} 724}
diff --git a/arch/ia64/mm/hugetlbpage.c b/arch/ia64/mm/hugetlbpage.c
index 2d13889d0a99..8d506710fdbd 100644
--- a/arch/ia64/mm/hugetlbpage.c
+++ b/arch/ia64/mm/hugetlbpage.c
@@ -68,9 +68,10 @@ huge_pte_offset (struct mm_struct *mm, unsigned long addr)
68#define mk_pte_huge(entry) { pte_val(entry) |= _PAGE_P; } 68#define mk_pte_huge(entry) { pte_val(entry) |= _PAGE_P; }
69 69
70/* 70/*
71 * This function checks for proper alignment of input addr and len parameters. 71 * Don't actually need to do any preparation, but need to make sure
72 * the address is in the right region.
72 */ 73 */
73int is_aligned_hugepage_range(unsigned long addr, unsigned long len) 74int prepare_hugepage_range(unsigned long addr, unsigned long len)
74{ 75{
75 if (len & ~HPAGE_MASK) 76 if (len & ~HPAGE_MASK)
76 return -EINVAL; 77 return -EINVAL;
@@ -112,8 +113,7 @@ void hugetlb_free_pgd_range(struct mmu_gather **tlb,
112 unsigned long floor, unsigned long ceiling) 113 unsigned long floor, unsigned long ceiling)
113{ 114{
114 /* 115 /*
115 * This is called only when is_hugepage_only_range(addr,), 116 * This is called to free hugetlb page tables.
116 * and it follows that is_hugepage_only_range(end,) also.
117 * 117 *
118 * The offset of these addresses from the base of the hugetlb 118 * The offset of these addresses from the base of the hugetlb
119 * region must be scaled down by HPAGE_SIZE/PAGE_SIZE so that 119 * region must be scaled down by HPAGE_SIZE/PAGE_SIZE so that
@@ -125,9 +125,9 @@ void hugetlb_free_pgd_range(struct mmu_gather **tlb,
125 125
126 addr = htlbpage_to_page(addr); 126 addr = htlbpage_to_page(addr);
127 end = htlbpage_to_page(end); 127 end = htlbpage_to_page(end);
128 if (is_hugepage_only_range(tlb->mm, floor, HPAGE_SIZE)) 128 if (REGION_NUMBER(floor) == RGN_HPAGE)
129 floor = htlbpage_to_page(floor); 129 floor = htlbpage_to_page(floor);
130 if (is_hugepage_only_range(tlb->mm, ceiling, HPAGE_SIZE)) 130 if (REGION_NUMBER(ceiling) == RGN_HPAGE)
131 ceiling = htlbpage_to_page(ceiling); 131 ceiling = htlbpage_to_page(ceiling);
132 132
133 free_pgd_range(tlb, addr, end, floor, ceiling); 133 free_pgd_range(tlb, addr, end, floor, ceiling);
diff --git a/arch/ia64/mm/init.c b/arch/ia64/mm/init.c
index b38b6d213c15..cafa8776a53d 100644
--- a/arch/ia64/mm/init.c
+++ b/arch/ia64/mm/init.c
@@ -109,6 +109,7 @@ lazy_mmu_prot_update (pte_t pte)
109{ 109{
110 unsigned long addr; 110 unsigned long addr;
111 struct page *page; 111 struct page *page;
112 unsigned long order;
112 113
113 if (!pte_exec(pte)) 114 if (!pte_exec(pte))
114 return; /* not an executable page... */ 115 return; /* not an executable page... */
@@ -119,7 +120,12 @@ lazy_mmu_prot_update (pte_t pte)
119 if (test_bit(PG_arch_1, &page->flags)) 120 if (test_bit(PG_arch_1, &page->flags))
120 return; /* i-cache is already coherent with d-cache */ 121 return; /* i-cache is already coherent with d-cache */
121 122
122 flush_icache_range(addr, addr + PAGE_SIZE); 123 if (PageCompound(page)) {
124 order = (unsigned long) (page[1].lru.prev);
125 flush_icache_range(addr, addr + (1UL << order << PAGE_SHIFT));
126 }
127 else
128 flush_icache_range(addr, addr + PAGE_SIZE);
123 set_bit(PG_arch_1, &page->flags); /* mark page as clean */ 129 set_bit(PG_arch_1, &page->flags); /* mark page as clean */
124} 130}
125 131
@@ -197,7 +203,7 @@ free_initmem (void)
197 eaddr = (unsigned long) ia64_imva(__init_end); 203 eaddr = (unsigned long) ia64_imva(__init_end);
198 while (addr < eaddr) { 204 while (addr < eaddr) {
199 ClearPageReserved(virt_to_page(addr)); 205 ClearPageReserved(virt_to_page(addr));
200 set_page_count(virt_to_page(addr), 1); 206 init_page_count(virt_to_page(addr));
201 free_page(addr); 207 free_page(addr);
202 ++totalram_pages; 208 ++totalram_pages;
203 addr += PAGE_SIZE; 209 addr += PAGE_SIZE;
@@ -206,7 +212,7 @@ free_initmem (void)
206 (__init_end - __init_begin) >> 10); 212 (__init_end - __init_begin) >> 10);
207} 213}
208 214
209void 215void __init
210free_initrd_mem (unsigned long start, unsigned long end) 216free_initrd_mem (unsigned long start, unsigned long end)
211{ 217{
212 struct page *page; 218 struct page *page;
@@ -252,7 +258,7 @@ free_initrd_mem (unsigned long start, unsigned long end)
252 continue; 258 continue;
253 page = virt_to_page(start); 259 page = virt_to_page(start);
254 ClearPageReserved(page); 260 ClearPageReserved(page);
255 set_page_count(page, 1); 261 init_page_count(page);
256 free_page(start); 262 free_page(start);
257 ++totalram_pages; 263 ++totalram_pages;
258 } 264 }
@@ -261,7 +267,7 @@ free_initrd_mem (unsigned long start, unsigned long end)
261/* 267/*
262 * This installs a clean page in the kernel's page table. 268 * This installs a clean page in the kernel's page table.
263 */ 269 */
264struct page * 270static struct page * __init
265put_kernel_page (struct page *page, unsigned long address, pgprot_t pgprot) 271put_kernel_page (struct page *page, unsigned long address, pgprot_t pgprot)
266{ 272{
267 pgd_t *pgd; 273 pgd_t *pgd;
@@ -294,7 +300,7 @@ put_kernel_page (struct page *page, unsigned long address, pgprot_t pgprot)
294 return page; 300 return page;
295} 301}
296 302
297static void 303static void __init
298setup_gate (void) 304setup_gate (void)
299{ 305{
300 struct page *page; 306 struct page *page;
@@ -411,7 +417,7 @@ ia64_mmu_init (void *my_cpu_data)
411 417
412#ifdef CONFIG_VIRTUAL_MEM_MAP 418#ifdef CONFIG_VIRTUAL_MEM_MAP
413 419
414int 420int __init
415create_mem_map_page_table (u64 start, u64 end, void *arg) 421create_mem_map_page_table (u64 start, u64 end, void *arg)
416{ 422{
417 unsigned long address, start_page, end_page; 423 unsigned long address, start_page, end_page;
@@ -519,7 +525,7 @@ ia64_pfn_valid (unsigned long pfn)
519} 525}
520EXPORT_SYMBOL(ia64_pfn_valid); 526EXPORT_SYMBOL(ia64_pfn_valid);
521 527
522int 528int __init
523find_largest_hole (u64 start, u64 end, void *arg) 529find_largest_hole (u64 start, u64 end, void *arg)
524{ 530{
525 u64 *max_gap = arg; 531 u64 *max_gap = arg;
@@ -535,7 +541,7 @@ find_largest_hole (u64 start, u64 end, void *arg)
535} 541}
536#endif /* CONFIG_VIRTUAL_MEM_MAP */ 542#endif /* CONFIG_VIRTUAL_MEM_MAP */
537 543
538static int 544static int __init
539count_reserved_pages (u64 start, u64 end, void *arg) 545count_reserved_pages (u64 start, u64 end, void *arg)
540{ 546{
541 unsigned long num_reserved = 0; 547 unsigned long num_reserved = 0;
@@ -556,7 +562,7 @@ count_reserved_pages (u64 start, u64 end, void *arg)
556 * purposes. 562 * purposes.
557 */ 563 */
558 564
559static int nolwsys; 565static int nolwsys __initdata;
560 566
561static int __init 567static int __init
562nolwsys_setup (char *s) 568nolwsys_setup (char *s)
@@ -567,7 +573,7 @@ nolwsys_setup (char *s)
567 573
568__setup("nolwsys", nolwsys_setup); 574__setup("nolwsys", nolwsys_setup);
569 575
570void 576void __init
571mem_init (void) 577mem_init (void)
572{ 578{
573 long reserved_pages, codesize, datasize, initsize; 579 long reserved_pages, codesize, datasize, initsize;
@@ -600,7 +606,7 @@ mem_init (void)
600 kclist_add(&kcore_vmem, (void *)VMALLOC_START, VMALLOC_END-VMALLOC_START); 606 kclist_add(&kcore_vmem, (void *)VMALLOC_START, VMALLOC_END-VMALLOC_START);
601 kclist_add(&kcore_kernel, _stext, _end - _stext); 607 kclist_add(&kcore_kernel, _stext, _end - _stext);
602 608
603 for_each_pgdat(pgdat) 609 for_each_online_pgdat(pgdat)
604 if (pgdat->bdata->node_bootmem_map) 610 if (pgdat->bdata->node_bootmem_map)
605 totalram_pages += free_all_bootmem_node(pgdat); 611 totalram_pages += free_all_bootmem_node(pgdat);
606 612
@@ -640,7 +646,7 @@ mem_init (void)
640void online_page(struct page *page) 646void online_page(struct page *page)
641{ 647{
642 ClearPageReserved(page); 648 ClearPageReserved(page);
643 set_page_count(page, 1); 649 init_page_count(page);
644 __free_page(page); 650 __free_page(page);
645 totalram_pages++; 651 totalram_pages++;
646 num_physpages++; 652 num_physpages++;
diff --git a/arch/ia64/mm/ioremap.c b/arch/ia64/mm/ioremap.c
new file mode 100644
index 000000000000..643ccc6960ce
--- /dev/null
+++ b/arch/ia64/mm/ioremap.c
@@ -0,0 +1,43 @@
1/*
2 * (c) Copyright 2006 Hewlett-Packard Development Company, L.P.
3 * Bjorn Helgaas <bjorn.helgaas@hp.com>
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License version 2 as
7 * published by the Free Software Foundation.
8 */
9
10#include <linux/compiler.h>
11#include <linux/module.h>
12#include <linux/efi.h>
13#include <asm/io.h>
14
15static inline void __iomem *
16__ioremap (unsigned long offset, unsigned long size)
17{
18 return (void __iomem *) (__IA64_UNCACHED_OFFSET | offset);
19}
20
21void __iomem *
22ioremap (unsigned long offset, unsigned long size)
23{
24 if (efi_mem_attribute_range(offset, size, EFI_MEMORY_WB))
25 return phys_to_virt(offset);
26
27 if (efi_mem_attribute_range(offset, size, EFI_MEMORY_UC))
28 return __ioremap(offset, size);
29
30 /*
31 * Someday this should check ACPI resources so we
32 * can do the right thing for hot-plugged regions.
33 */
34 return __ioremap(offset, size);
35}
36EXPORT_SYMBOL(ioremap);
37
38void __iomem *
39ioremap_nocache (unsigned long offset, unsigned long size)
40{
41 return __ioremap(offset, size);
42}
43EXPORT_SYMBOL(ioremap_nocache);
diff --git a/arch/ia64/mm/tlb.c b/arch/ia64/mm/tlb.c
index 6a4eec9113e8..4dbbca0b5e9c 100644
--- a/arch/ia64/mm/tlb.c
+++ b/arch/ia64/mm/tlb.c
@@ -156,17 +156,19 @@ flush_tlb_range (struct vm_area_struct *vma, unsigned long start,
156 nbits = purge.max_bits; 156 nbits = purge.max_bits;
157 start &= ~((1UL << nbits) - 1); 157 start &= ~((1UL << nbits) - 1);
158 158
159# ifdef CONFIG_SMP
160 platform_global_tlb_purge(mm, start, end, nbits);
161# else
162 preempt_disable(); 159 preempt_disable();
160#ifdef CONFIG_SMP
161 if (mm != current->active_mm || cpus_weight(mm->cpu_vm_mask) != 1) {
162 platform_global_tlb_purge(mm, start, end, nbits);
163 preempt_enable();
164 return;
165 }
166#endif
163 do { 167 do {
164 ia64_ptcl(start, (nbits<<2)); 168 ia64_ptcl(start, (nbits<<2));
165 start += (1UL << nbits); 169 start += (1UL << nbits);
166 } while (start < end); 170 } while (start < end);
167 preempt_enable(); 171 preempt_enable();
168# endif
169
170 ia64_srlz_i(); /* srlz.i implies srlz.d */ 172 ia64_srlz_i(); /* srlz.i implies srlz.d */
171} 173}
172EXPORT_SYMBOL(flush_tlb_range); 174EXPORT_SYMBOL(flush_tlb_range);
diff --git a/arch/ia64/sn/kernel/Makefile b/arch/ia64/sn/kernel/Makefile
index 3e9b4eea7418..ab9c48c88012 100644
--- a/arch/ia64/sn/kernel/Makefile
+++ b/arch/ia64/sn/kernel/Makefile
@@ -10,7 +10,8 @@
10CPPFLAGS += -I$(srctree)/arch/ia64/sn/include 10CPPFLAGS += -I$(srctree)/arch/ia64/sn/include
11 11
12obj-y += setup.o bte.o bte_error.o irq.o mca.o idle.o \ 12obj-y += setup.o bte.o bte_error.o irq.o mca.o idle.o \
13 huberror.o io_init.o iomv.o klconflib.o sn2/ 13 huberror.o io_init.o iomv.o klconflib.o pio_phys.o \
14 sn2/
14obj-$(CONFIG_IA64_GENERIC) += machvec.o 15obj-$(CONFIG_IA64_GENERIC) += machvec.o
15obj-$(CONFIG_SGI_TIOCX) += tiocx.o 16obj-$(CONFIG_SGI_TIOCX) += tiocx.o
16obj-$(CONFIG_IA64_SGI_SN_XP) += xp.o 17obj-$(CONFIG_IA64_SGI_SN_XP) += xp.o
diff --git a/arch/ia64/sn/kernel/bte.c b/arch/ia64/sn/kernel/bte.c
index 1f11db470d90..e952ef4f6d91 100644
--- a/arch/ia64/sn/kernel/bte.c
+++ b/arch/ia64/sn/kernel/bte.c
@@ -36,7 +36,7 @@ static struct bteinfo_s *bte_if_on_node(nasid_t nasid, int interface)
36 nodepda_t *tmp_nodepda; 36 nodepda_t *tmp_nodepda;
37 37
38 if (nasid_to_cnodeid(nasid) == -1) 38 if (nasid_to_cnodeid(nasid) == -1)
39 return (struct bteinfo_s *)NULL;; 39 return (struct bteinfo_s *)NULL;
40 40
41 tmp_nodepda = NODEPDA(nasid_to_cnodeid(nasid)); 41 tmp_nodepda = NODEPDA(nasid_to_cnodeid(nasid));
42 return &tmp_nodepda->bte_if[interface]; 42 return &tmp_nodepda->bte_if[interface];
diff --git a/arch/ia64/sn/kernel/io_init.c b/arch/ia64/sn/kernel/io_init.c
index dfb3f2902379..5101ac462643 100644
--- a/arch/ia64/sn/kernel/io_init.c
+++ b/arch/ia64/sn/kernel/io_init.c
@@ -13,6 +13,8 @@
13#include <asm/sn/sn_feature_sets.h> 13#include <asm/sn/sn_feature_sets.h>
14#include <asm/sn/geo.h> 14#include <asm/sn/geo.h>
15#include <asm/sn/io.h> 15#include <asm/sn/io.h>
16#include <asm/sn/l1.h>
17#include <asm/sn/module.h>
16#include <asm/sn/pcibr_provider.h> 18#include <asm/sn/pcibr_provider.h>
17#include <asm/sn/pcibus_provider_defs.h> 19#include <asm/sn/pcibus_provider_defs.h>
18#include <asm/sn/pcidev.h> 20#include <asm/sn/pcidev.h>
@@ -710,9 +712,36 @@ cnodeid_get_geoid(cnodeid_t cnode)
710 return hubdev->hdi_geoid; 712 return hubdev->hdi_geoid;
711} 713}
712 714
715void sn_generate_path(struct pci_bus *pci_bus, char *address)
716{
717 nasid_t nasid;
718 cnodeid_t cnode;
719 geoid_t geoid;
720 moduleid_t moduleid;
721 u16 bricktype;
722
723 nasid = NASID_GET(SN_PCIBUS_BUSSOFT(pci_bus)->bs_base);
724 cnode = nasid_to_cnodeid(nasid);
725 geoid = cnodeid_get_geoid(cnode);
726 moduleid = geo_module(geoid);
727
728 sprintf(address, "module_%c%c%c%c%.2d",
729 '0'+RACK_GET_CLASS(MODULE_GET_RACK(moduleid)),
730 '0'+RACK_GET_GROUP(MODULE_GET_RACK(moduleid)),
731 '0'+RACK_GET_NUM(MODULE_GET_RACK(moduleid)),
732 MODULE_GET_BTCHAR(moduleid), MODULE_GET_BPOS(moduleid));
733
734 /* Tollhouse requires slot id to be displayed */
735 bricktype = MODULE_GET_BTYPE(moduleid);
736 if ((bricktype == L1_BRICKTYPE_191010) ||
737 (bricktype == L1_BRICKTYPE_1932))
738 sprintf(address, "%s^%d", address, geo_slot(geoid));
739}
740
713subsys_initcall(sn_pci_init); 741subsys_initcall(sn_pci_init);
714EXPORT_SYMBOL(sn_pci_fixup_slot); 742EXPORT_SYMBOL(sn_pci_fixup_slot);
715EXPORT_SYMBOL(sn_pci_unfixup_slot); 743EXPORT_SYMBOL(sn_pci_unfixup_slot);
716EXPORT_SYMBOL(sn_pci_controller_fixup); 744EXPORT_SYMBOL(sn_pci_controller_fixup);
717EXPORT_SYMBOL(sn_bus_store_sysdata); 745EXPORT_SYMBOL(sn_bus_store_sysdata);
718EXPORT_SYMBOL(sn_bus_free_sysdata); 746EXPORT_SYMBOL(sn_bus_free_sysdata);
747EXPORT_SYMBOL(sn_generate_path);
diff --git a/arch/ia64/sn/kernel/irq.c b/arch/ia64/sn/kernel/irq.c
index c373113d073a..c265e02f5036 100644
--- a/arch/ia64/sn/kernel/irq.c
+++ b/arch/ia64/sn/kernel/irq.c
@@ -350,9 +350,6 @@ static void force_interrupt(int irq)
350static void sn_check_intr(int irq, struct sn_irq_info *sn_irq_info) 350static void sn_check_intr(int irq, struct sn_irq_info *sn_irq_info)
351{ 351{
352 u64 regval; 352 u64 regval;
353 int irr_reg_num;
354 int irr_bit;
355 u64 irr_reg;
356 struct pcidev_info *pcidev_info; 353 struct pcidev_info *pcidev_info;
357 struct pcibus_info *pcibus_info; 354 struct pcibus_info *pcibus_info;
358 355
@@ -373,23 +370,7 @@ static void sn_check_intr(int irq, struct sn_irq_info *sn_irq_info)
373 pdi_pcibus_info; 370 pdi_pcibus_info;
374 regval = pcireg_intr_status_get(pcibus_info); 371 regval = pcireg_intr_status_get(pcibus_info);
375 372
376 irr_reg_num = irq_to_vector(irq) / 64; 373 if (!ia64_get_irr(irq_to_vector(irq))) {
377 irr_bit = irq_to_vector(irq) % 64;
378 switch (irr_reg_num) {
379 case 0:
380 irr_reg = ia64_getreg(_IA64_REG_CR_IRR0);
381 break;
382 case 1:
383 irr_reg = ia64_getreg(_IA64_REG_CR_IRR1);
384 break;
385 case 2:
386 irr_reg = ia64_getreg(_IA64_REG_CR_IRR2);
387 break;
388 case 3:
389 irr_reg = ia64_getreg(_IA64_REG_CR_IRR3);
390 break;
391 }
392 if (!test_bit(irr_bit, &irr_reg)) {
393 if (!test_bit(irq, pda->sn_in_service_ivecs)) { 374 if (!test_bit(irq, pda->sn_in_service_ivecs)) {
394 regval &= 0xff; 375 regval &= 0xff;
395 if (sn_irq_info->irq_int_bit & regval & 376 if (sn_irq_info->irq_int_bit & regval &
diff --git a/arch/ia64/sn/kernel/pio_phys.S b/arch/ia64/sn/kernel/pio_phys.S
new file mode 100644
index 000000000000..3c7d48d6ecb8
--- /dev/null
+++ b/arch/ia64/sn/kernel/pio_phys.S
@@ -0,0 +1,71 @@
1/*
2 * This file is subject to the terms and conditions of the GNU General Public
3 * License. See the file "COPYING" in the main directory of this archive
4 * for more details.
5 *
6 * Copyright (C) 2000-2005 Silicon Graphics, Inc. All rights reserved.
7 *
8 * This file contains macros used to access MMR registers via
9 * uncached physical addresses.
10 * pio_phys_read_mmr - read an MMR
11 * pio_phys_write_mmr - write an MMR
12 * pio_atomic_phys_write_mmrs - atomically write 1 or 2 MMRs with psr.ic=0
13 * Second MMR will be skipped if address is NULL
14 *
15 * Addresses passed to these routines should be uncached physical addresses
16 * ie., 0x80000....
17 */
18
19
20
21#include <asm/asmmacro.h>
22#include <asm/page.h>
23
24GLOBAL_ENTRY(pio_phys_read_mmr)
25 .prologue
26 .regstk 1,0,0,0
27 .body
28 mov r2=psr
29 rsm psr.i | psr.dt
30 ;;
31 srlz.d
32 ld8.acq r8=[r32]
33 ;;
34 mov psr.l=r2;;
35 srlz.d
36 br.ret.sptk.many rp
37END(pio_phys_read_mmr)
38
39GLOBAL_ENTRY(pio_phys_write_mmr)
40 .prologue
41 .regstk 2,0,0,0
42 .body
43 mov r2=psr
44 rsm psr.i | psr.dt
45 ;;
46 srlz.d
47 st8.rel [r32]=r33
48 ;;
49 mov psr.l=r2;;
50 srlz.d
51 br.ret.sptk.many rp
52END(pio_phys_write_mmr)
53
54GLOBAL_ENTRY(pio_atomic_phys_write_mmrs)
55 .prologue
56 .regstk 4,0,0,0
57 .body
58 mov r2=psr
59 cmp.ne p9,p0=r34,r0;
60 rsm psr.i | psr.dt | psr.ic
61 ;;
62 srlz.d
63 st8.rel [r32]=r33
64(p9) st8.rel [r34]=r35
65 ;;
66 mov psr.l=r2;;
67 srlz.d
68 br.ret.sptk.many rp
69END(pio_atomic_phys_write_mmrs)
70
71
diff --git a/arch/ia64/sn/kernel/setup.c b/arch/ia64/sn/kernel/setup.c
index 5b84836c2171..30988dfbddff 100644
--- a/arch/ia64/sn/kernel/setup.c
+++ b/arch/ia64/sn/kernel/setup.c
@@ -3,7 +3,7 @@
3 * License. See the file "COPYING" in the main directory of this archive 3 * License. See the file "COPYING" in the main directory of this archive
4 * for more details. 4 * for more details.
5 * 5 *
6 * Copyright (C) 1999,2001-2005 Silicon Graphics, Inc. All rights reserved. 6 * Copyright (C) 1999,2001-2006 Silicon Graphics, Inc. All rights reserved.
7 */ 7 */
8 8
9#include <linux/config.h> 9#include <linux/config.h>
@@ -327,10 +327,11 @@ sn_scan_pcdp(void)
327 struct pcdp_interface_pci if_pci; 327 struct pcdp_interface_pci if_pci;
328 extern struct efi efi; 328 extern struct efi efi;
329 329
330 pcdp = efi.hcdp; 330 if (efi.hcdp == EFI_INVALID_TABLE_ADDR)
331 if (! pcdp)
332 return; /* no hcdp/pcdp table */ 331 return; /* no hcdp/pcdp table */
333 332
333 pcdp = __va(efi.hcdp);
334
334 if (pcdp->rev < 3) 335 if (pcdp->rev < 3)
335 return; /* only support PCDP (rev >= 3) */ 336 return; /* only support PCDP (rev >= 3) */
336 337
@@ -498,6 +499,7 @@ void __init sn_setup(char **cmdline_p)
498 * for sn. 499 * for sn.
499 */ 500 */
500 pm_power_off = ia64_sn_power_down; 501 pm_power_off = ia64_sn_power_down;
502 current->thread.flags |= IA64_THREAD_MIGRATION;
501} 503}
502 504
503/** 505/**
@@ -660,7 +662,8 @@ void __init sn_cpu_init(void)
660 SH2_PIO_WRITE_STATUS_1, SH2_PIO_WRITE_STATUS_3}; 662 SH2_PIO_WRITE_STATUS_1, SH2_PIO_WRITE_STATUS_3};
661 u64 *pio; 663 u64 *pio;
662 pio = is_shub1() ? pio1 : pio2; 664 pio = is_shub1() ? pio1 : pio2;
663 pda->pio_write_status_addr = (volatile unsigned long *) LOCAL_MMR_ADDR(pio[slice]); 665 pda->pio_write_status_addr =
666 (volatile unsigned long *)GLOBAL_MMR_ADDR(nasid, pio[slice]);
664 pda->pio_write_status_val = is_shub1() ? SH_PIO_WRITE_STATUS_PENDING_WRITE_COUNT_MASK : 0; 667 pda->pio_write_status_val = is_shub1() ? SH_PIO_WRITE_STATUS_PENDING_WRITE_COUNT_MASK : 0;
665 } 668 }
666 669
diff --git a/arch/ia64/sn/kernel/sn2/sn2_smp.c b/arch/ia64/sn/kernel/sn2/sn2_smp.c
index b2e1e746b47f..d9d306c79f2d 100644
--- a/arch/ia64/sn/kernel/sn2/sn2_smp.c
+++ b/arch/ia64/sn/kernel/sn2/sn2_smp.c
@@ -93,6 +93,27 @@ static inline unsigned long wait_piowc(void)
93 return (ws & SH_PIO_WRITE_STATUS_WRITE_DEADLOCK_MASK) != 0; 93 return (ws & SH_PIO_WRITE_STATUS_WRITE_DEADLOCK_MASK) != 0;
94} 94}
95 95
96/**
97 * sn_migrate - SN-specific task migration actions
98 * @task: Task being migrated to new CPU
99 *
100 * SN2 PIO writes from separate CPUs are not guaranteed to arrive in order.
101 * Context switching user threads which have memory-mapped MMIO may cause
102 * PIOs to issue from seperate CPUs, thus the PIO writes must be drained
103 * from the previous CPU's Shub before execution resumes on the new CPU.
104 */
105void sn_migrate(struct task_struct *task)
106{
107 pda_t *last_pda = pdacpu(task_thread_info(task)->last_cpu);
108 volatile unsigned long *adr = last_pda->pio_write_status_addr;
109 unsigned long val = last_pda->pio_write_status_val;
110
111 /* Drain PIO writes from old CPU's Shub */
112 while (unlikely((*adr & SH_PIO_WRITE_STATUS_PENDING_WRITE_COUNT_MASK)
113 != val))
114 cpu_relax();
115}
116
96void sn_tlb_migrate_finish(struct mm_struct *mm) 117void sn_tlb_migrate_finish(struct mm_struct *mm)
97{ 118{
98 /* flush_tlb_mm is inefficient if more than 1 users of mm */ 119 /* flush_tlb_mm is inefficient if more than 1 users of mm */
diff --git a/arch/ia64/sn/kernel/sn2/sn_hwperf.c b/arch/ia64/sn/kernel/sn2/sn_hwperf.c
index 70db21f3df21..d917afa30b27 100644
--- a/arch/ia64/sn/kernel/sn2/sn_hwperf.c
+++ b/arch/ia64/sn/kernel/sn2/sn_hwperf.c
@@ -110,7 +110,11 @@ static int sn_hwperf_geoid_to_cnode(char *location)
110 if (sn_hwperf_location_to_bpos(location, &rack, &bay, &slot, &slab)) 110 if (sn_hwperf_location_to_bpos(location, &rack, &bay, &slot, &slab))
111 return -1; 111 return -1;
112 112
113 for_each_node(cnode) { 113 /*
114 * FIXME: replace with cleaner for_each_XXX macro which addresses
115 * both compute and IO nodes once ACPI3.0 is available.
116 */
117 for (cnode = 0; cnode < num_cnodes; cnode++) {
114 geoid = cnodeid_get_geoid(cnode); 118 geoid = cnodeid_get_geoid(cnode);
115 module_id = geo_module(geoid); 119 module_id = geo_module(geoid);
116 this_rack = MODULE_GET_RACK(module_id); 120 this_rack = MODULE_GET_RACK(module_id);
@@ -605,7 +609,7 @@ static int sn_hwperf_op_cpu(struct sn_hwperf_op_info *op_info)
605 op_info->a->arg &= SN_HWPERF_ARG_OBJID_MASK; 609 op_info->a->arg &= SN_HWPERF_ARG_OBJID_MASK;
606 610
607 if (cpu != SN_HWPERF_ARG_ANY_CPU) { 611 if (cpu != SN_HWPERF_ARG_ANY_CPU) {
608 if (cpu >= num_online_cpus() || !cpu_online(cpu)) { 612 if (cpu >= NR_CPUS || !cpu_online(cpu)) {
609 r = -EINVAL; 613 r = -EINVAL;
610 goto out; 614 goto out;
611 } 615 }
diff --git a/arch/ia64/sn/kernel/sn2/sn_proc_fs.c b/arch/ia64/sn/kernel/sn2/sn_proc_fs.c
index c686d9c12f7b..5100261310f7 100644
--- a/arch/ia64/sn/kernel/sn2/sn_proc_fs.c
+++ b/arch/ia64/sn/kernel/sn2/sn_proc_fs.c
@@ -93,19 +93,22 @@ static int coherence_id_open(struct inode *inode, struct file *file)
93static struct proc_dir_entry 93static struct proc_dir_entry
94*sn_procfs_create_entry(const char *name, struct proc_dir_entry *parent, 94*sn_procfs_create_entry(const char *name, struct proc_dir_entry *parent,
95 int (*openfunc)(struct inode *, struct file *), 95 int (*openfunc)(struct inode *, struct file *),
96 int (*releasefunc)(struct inode *, struct file *)) 96 int (*releasefunc)(struct inode *, struct file *),
97 ssize_t (*write) (struct file *, const char __user *, size_t, loff_t *))
97{ 98{
98 struct proc_dir_entry *e = create_proc_entry(name, 0444, parent); 99 struct proc_dir_entry *e = create_proc_entry(name, 0444, parent);
99 100
100 if (e) { 101 if (e) {
101 e->proc_fops = (struct file_operations *)kmalloc( 102 struct file_operations *f;
102 sizeof(struct file_operations), GFP_KERNEL); 103
103 if (e->proc_fops) { 104 f = kzalloc(sizeof(*f), GFP_KERNEL);
104 memset(e->proc_fops, 0, sizeof(struct file_operations)); 105 if (f) {
105 e->proc_fops->open = openfunc; 106 f->open = openfunc;
106 e->proc_fops->read = seq_read; 107 f->read = seq_read;
107 e->proc_fops->llseek = seq_lseek; 108 f->llseek = seq_lseek;
108 e->proc_fops->release = releasefunc; 109 f->release = releasefunc;
110 f->write = write;
111 e->proc_fops = f;
109 } 112 }
110 } 113 }
111 114
@@ -119,31 +122,29 @@ extern int sn_topology_release(struct inode *, struct file *);
119void register_sn_procfs(void) 122void register_sn_procfs(void)
120{ 123{
121 static struct proc_dir_entry *sgi_proc_dir = NULL; 124 static struct proc_dir_entry *sgi_proc_dir = NULL;
122 struct proc_dir_entry *e;
123 125
124 BUG_ON(sgi_proc_dir != NULL); 126 BUG_ON(sgi_proc_dir != NULL);
125 if (!(sgi_proc_dir = proc_mkdir("sgi_sn", NULL))) 127 if (!(sgi_proc_dir = proc_mkdir("sgi_sn", NULL)))
126 return; 128 return;
127 129
128 sn_procfs_create_entry("partition_id", sgi_proc_dir, 130 sn_procfs_create_entry("partition_id", sgi_proc_dir,
129 partition_id_open, single_release); 131 partition_id_open, single_release, NULL);
130 132
131 sn_procfs_create_entry("system_serial_number", sgi_proc_dir, 133 sn_procfs_create_entry("system_serial_number", sgi_proc_dir,
132 system_serial_number_open, single_release); 134 system_serial_number_open, single_release, NULL);
133 135
134 sn_procfs_create_entry("licenseID", sgi_proc_dir, 136 sn_procfs_create_entry("licenseID", sgi_proc_dir,
135 licenseID_open, single_release); 137 licenseID_open, single_release, NULL);
136 138
137 e = sn_procfs_create_entry("sn_force_interrupt", sgi_proc_dir, 139 sn_procfs_create_entry("sn_force_interrupt", sgi_proc_dir,
138 sn_force_interrupt_open, single_release); 140 sn_force_interrupt_open, single_release,
139 if (e) 141 sn_force_interrupt_write_proc);
140 e->proc_fops->write = sn_force_interrupt_write_proc;
141 142
142 sn_procfs_create_entry("coherence_id", sgi_proc_dir, 143 sn_procfs_create_entry("coherence_id", sgi_proc_dir,
143 coherence_id_open, single_release); 144 coherence_id_open, single_release, NULL);
144 145
145 sn_procfs_create_entry("sn_topology", sgi_proc_dir, 146 sn_procfs_create_entry("sn_topology", sgi_proc_dir,
146 sn_topology_open, sn_topology_release); 147 sn_topology_open, sn_topology_release, NULL);
147} 148}
148 149
149#endif /* CONFIG_PROC_FS */ 150#endif /* CONFIG_PROC_FS */
diff --git a/arch/ia64/sn/kernel/tiocx.c b/arch/ia64/sn/kernel/tiocx.c
index 99cb28e74295..feaf1a6e8101 100644
--- a/arch/ia64/sn/kernel/tiocx.c
+++ b/arch/ia64/sn/kernel/tiocx.c
@@ -369,9 +369,15 @@ static void tio_corelet_reset(nasid_t nasid, int corelet)
369 369
370static int is_fpga_tio(int nasid, int *bt) 370static int is_fpga_tio(int nasid, int *bt)
371{ 371{
372 int ioboard_type; 372 u16 ioboard_type;
373 s64 rc;
373 374
374 ioboard_type = ia64_sn_sysctl_ioboard_get(nasid); 375 rc = ia64_sn_sysctl_ioboard_get(nasid, &ioboard_type);
376 if (rc) {
377 printk(KERN_WARNING "ia64_sn_sysctl_ioboard_get failed: %ld\n",
378 rc);
379 return 0;
380 }
375 381
376 switch (ioboard_type) { 382 switch (ioboard_type) {
377 case L1_BRICKTYPE_SA: 383 case L1_BRICKTYPE_SA:
diff --git a/arch/ia64/sn/kernel/xpc_channel.c b/arch/ia64/sn/kernel/xpc_channel.c
index cdf6856ce089..d0abddd9ffe6 100644
--- a/arch/ia64/sn/kernel/xpc_channel.c
+++ b/arch/ia64/sn/kernel/xpc_channel.c
@@ -21,7 +21,6 @@
21#include <linux/sched.h> 21#include <linux/sched.h>
22#include <linux/cache.h> 22#include <linux/cache.h>
23#include <linux/interrupt.h> 23#include <linux/interrupt.h>
24#include <linux/slab.h>
25#include <linux/mutex.h> 24#include <linux/mutex.h>
26#include <linux/completion.h> 25#include <linux/completion.h>
27#include <asm/sn/bte.h> 26#include <asm/sn/bte.h>
@@ -30,6 +29,31 @@
30 29
31 30
32/* 31/*
32 * Guarantee that the kzalloc'd memory is cacheline aligned.
33 */
34static void *
35xpc_kzalloc_cacheline_aligned(size_t size, gfp_t flags, void **base)
36{
37 /* see if kzalloc will give us cachline aligned memory by default */
38 *base = kzalloc(size, flags);
39 if (*base == NULL) {
40 return NULL;
41 }
42 if ((u64) *base == L1_CACHE_ALIGN((u64) *base)) {
43 return *base;
44 }
45 kfree(*base);
46
47 /* nope, we'll have to do it ourselves */
48 *base = kzalloc(size + L1_CACHE_BYTES, flags);
49 if (*base == NULL) {
50 return NULL;
51 }
52 return (void *) L1_CACHE_ALIGN((u64) *base);
53}
54
55
56/*
33 * Set up the initial values for the XPartition Communication channels. 57 * Set up the initial values for the XPartition Communication channels.
34 */ 58 */
35static void 59static void
@@ -93,20 +117,19 @@ xpc_setup_infrastructure(struct xpc_partition *part)
93 * Allocate all of the channel structures as a contiguous chunk of 117 * Allocate all of the channel structures as a contiguous chunk of
94 * memory. 118 * memory.
95 */ 119 */
96 part->channels = kmalloc(sizeof(struct xpc_channel) * XPC_NCHANNELS, 120 part->channels = kzalloc(sizeof(struct xpc_channel) * XPC_NCHANNELS,
97 GFP_KERNEL); 121 GFP_KERNEL);
98 if (part->channels == NULL) { 122 if (part->channels == NULL) {
99 dev_err(xpc_chan, "can't get memory for channels\n"); 123 dev_err(xpc_chan, "can't get memory for channels\n");
100 return xpcNoMemory; 124 return xpcNoMemory;
101 } 125 }
102 memset(part->channels, 0, sizeof(struct xpc_channel) * XPC_NCHANNELS);
103 126
104 part->nchannels = XPC_NCHANNELS; 127 part->nchannels = XPC_NCHANNELS;
105 128
106 129
107 /* allocate all the required GET/PUT values */ 130 /* allocate all the required GET/PUT values */
108 131
109 part->local_GPs = xpc_kmalloc_cacheline_aligned(XPC_GP_SIZE, 132 part->local_GPs = xpc_kzalloc_cacheline_aligned(XPC_GP_SIZE,
110 GFP_KERNEL, &part->local_GPs_base); 133 GFP_KERNEL, &part->local_GPs_base);
111 if (part->local_GPs == NULL) { 134 if (part->local_GPs == NULL) {
112 kfree(part->channels); 135 kfree(part->channels);
@@ -115,55 +138,51 @@ xpc_setup_infrastructure(struct xpc_partition *part)
115 "values\n"); 138 "values\n");
116 return xpcNoMemory; 139 return xpcNoMemory;
117 } 140 }
118 memset(part->local_GPs, 0, XPC_GP_SIZE);
119 141
120 part->remote_GPs = xpc_kmalloc_cacheline_aligned(XPC_GP_SIZE, 142 part->remote_GPs = xpc_kzalloc_cacheline_aligned(XPC_GP_SIZE,
121 GFP_KERNEL, &part->remote_GPs_base); 143 GFP_KERNEL, &part->remote_GPs_base);
122 if (part->remote_GPs == NULL) { 144 if (part->remote_GPs == NULL) {
123 kfree(part->channels);
124 part->channels = NULL;
125 kfree(part->local_GPs_base);
126 part->local_GPs = NULL;
127 dev_err(xpc_chan, "can't get memory for remote get/put " 145 dev_err(xpc_chan, "can't get memory for remote get/put "
128 "values\n"); 146 "values\n");
147 kfree(part->local_GPs_base);
148 part->local_GPs = NULL;
149 kfree(part->channels);
150 part->channels = NULL;
129 return xpcNoMemory; 151 return xpcNoMemory;
130 } 152 }
131 memset(part->remote_GPs, 0, XPC_GP_SIZE);
132 153
133 154
134 /* allocate all the required open and close args */ 155 /* allocate all the required open and close args */
135 156
136 part->local_openclose_args = xpc_kmalloc_cacheline_aligned( 157 part->local_openclose_args = xpc_kzalloc_cacheline_aligned(
137 XPC_OPENCLOSE_ARGS_SIZE, GFP_KERNEL, 158 XPC_OPENCLOSE_ARGS_SIZE, GFP_KERNEL,
138 &part->local_openclose_args_base); 159 &part->local_openclose_args_base);
139 if (part->local_openclose_args == NULL) { 160 if (part->local_openclose_args == NULL) {
140 kfree(part->channels); 161 dev_err(xpc_chan, "can't get memory for local connect args\n");
141 part->channels = NULL;
142 kfree(part->local_GPs_base);
143 part->local_GPs = NULL;
144 kfree(part->remote_GPs_base); 162 kfree(part->remote_GPs_base);
145 part->remote_GPs = NULL; 163 part->remote_GPs = NULL;
146 dev_err(xpc_chan, "can't get memory for local connect args\n"); 164 kfree(part->local_GPs_base);
165 part->local_GPs = NULL;
166 kfree(part->channels);
167 part->channels = NULL;
147 return xpcNoMemory; 168 return xpcNoMemory;
148 } 169 }
149 memset(part->local_openclose_args, 0, XPC_OPENCLOSE_ARGS_SIZE);
150 170
151 part->remote_openclose_args = xpc_kmalloc_cacheline_aligned( 171 part->remote_openclose_args = xpc_kzalloc_cacheline_aligned(
152 XPC_OPENCLOSE_ARGS_SIZE, GFP_KERNEL, 172 XPC_OPENCLOSE_ARGS_SIZE, GFP_KERNEL,
153 &part->remote_openclose_args_base); 173 &part->remote_openclose_args_base);
154 if (part->remote_openclose_args == NULL) { 174 if (part->remote_openclose_args == NULL) {
155 kfree(part->channels); 175 dev_err(xpc_chan, "can't get memory for remote connect args\n");
156 part->channels = NULL;
157 kfree(part->local_GPs_base);
158 part->local_GPs = NULL;
159 kfree(part->remote_GPs_base);
160 part->remote_GPs = NULL;
161 kfree(part->local_openclose_args_base); 176 kfree(part->local_openclose_args_base);
162 part->local_openclose_args = NULL; 177 part->local_openclose_args = NULL;
163 dev_err(xpc_chan, "can't get memory for remote connect args\n"); 178 kfree(part->remote_GPs_base);
179 part->remote_GPs = NULL;
180 kfree(part->local_GPs_base);
181 part->local_GPs = NULL;
182 kfree(part->channels);
183 part->channels = NULL;
164 return xpcNoMemory; 184 return xpcNoMemory;
165 } 185 }
166 memset(part->remote_openclose_args, 0, XPC_OPENCLOSE_ARGS_SIZE);
167 186
168 187
169 xpc_initialize_channels(part, partid); 188 xpc_initialize_channels(part, partid);
@@ -186,18 +205,18 @@ xpc_setup_infrastructure(struct xpc_partition *part)
186 ret = request_irq(SGI_XPC_NOTIFY, xpc_notify_IRQ_handler, SA_SHIRQ, 205 ret = request_irq(SGI_XPC_NOTIFY, xpc_notify_IRQ_handler, SA_SHIRQ,
187 part->IPI_owner, (void *) (u64) partid); 206 part->IPI_owner, (void *) (u64) partid);
188 if (ret != 0) { 207 if (ret != 0) {
189 kfree(part->channels);
190 part->channels = NULL;
191 kfree(part->local_GPs_base);
192 part->local_GPs = NULL;
193 kfree(part->remote_GPs_base);
194 part->remote_GPs = NULL;
195 kfree(part->local_openclose_args_base);
196 part->local_openclose_args = NULL;
197 kfree(part->remote_openclose_args_base);
198 part->remote_openclose_args = NULL;
199 dev_err(xpc_chan, "can't register NOTIFY IRQ handler, " 208 dev_err(xpc_chan, "can't register NOTIFY IRQ handler, "
200 "errno=%d\n", -ret); 209 "errno=%d\n", -ret);
210 kfree(part->remote_openclose_args_base);
211 part->remote_openclose_args = NULL;
212 kfree(part->local_openclose_args_base);
213 part->local_openclose_args = NULL;
214 kfree(part->remote_GPs_base);
215 part->remote_GPs = NULL;
216 kfree(part->local_GPs_base);
217 part->local_GPs = NULL;
218 kfree(part->channels);
219 part->channels = NULL;
201 return xpcLackOfResources; 220 return xpcLackOfResources;
202 } 221 }
203 222
@@ -446,22 +465,20 @@ xpc_allocate_local_msgqueue(struct xpc_channel *ch)
446 for (nentries = ch->local_nentries; nentries > 0; nentries--) { 465 for (nentries = ch->local_nentries; nentries > 0; nentries--) {
447 466
448 nbytes = nentries * ch->msg_size; 467 nbytes = nentries * ch->msg_size;
449 ch->local_msgqueue = xpc_kmalloc_cacheline_aligned(nbytes, 468 ch->local_msgqueue = xpc_kzalloc_cacheline_aligned(nbytes,
450 GFP_KERNEL, 469 GFP_KERNEL,
451 &ch->local_msgqueue_base); 470 &ch->local_msgqueue_base);
452 if (ch->local_msgqueue == NULL) { 471 if (ch->local_msgqueue == NULL) {
453 continue; 472 continue;
454 } 473 }
455 memset(ch->local_msgqueue, 0, nbytes);
456 474
457 nbytes = nentries * sizeof(struct xpc_notify); 475 nbytes = nentries * sizeof(struct xpc_notify);
458 ch->notify_queue = kmalloc(nbytes, GFP_KERNEL); 476 ch->notify_queue = kzalloc(nbytes, GFP_KERNEL);
459 if (ch->notify_queue == NULL) { 477 if (ch->notify_queue == NULL) {
460 kfree(ch->local_msgqueue_base); 478 kfree(ch->local_msgqueue_base);
461 ch->local_msgqueue = NULL; 479 ch->local_msgqueue = NULL;
462 continue; 480 continue;
463 } 481 }
464 memset(ch->notify_queue, 0, nbytes);
465 482
466 spin_lock_irqsave(&ch->lock, irq_flags); 483 spin_lock_irqsave(&ch->lock, irq_flags);
467 if (nentries < ch->local_nentries) { 484 if (nentries < ch->local_nentries) {
@@ -501,13 +518,12 @@ xpc_allocate_remote_msgqueue(struct xpc_channel *ch)
501 for (nentries = ch->remote_nentries; nentries > 0; nentries--) { 518 for (nentries = ch->remote_nentries; nentries > 0; nentries--) {
502 519
503 nbytes = nentries * ch->msg_size; 520 nbytes = nentries * ch->msg_size;
504 ch->remote_msgqueue = xpc_kmalloc_cacheline_aligned(nbytes, 521 ch->remote_msgqueue = xpc_kzalloc_cacheline_aligned(nbytes,
505 GFP_KERNEL, 522 GFP_KERNEL,
506 &ch->remote_msgqueue_base); 523 &ch->remote_msgqueue_base);
507 if (ch->remote_msgqueue == NULL) { 524 if (ch->remote_msgqueue == NULL) {
508 continue; 525 continue;
509 } 526 }
510 memset(ch->remote_msgqueue, 0, nbytes);
511 527
512 spin_lock_irqsave(&ch->lock, irq_flags); 528 spin_lock_irqsave(&ch->lock, irq_flags);
513 if (nentries < ch->remote_nentries) { 529 if (nentries < ch->remote_nentries) {
diff --git a/arch/ia64/sn/kernel/xpc_main.c b/arch/ia64/sn/kernel/xpc_main.c
index 8cbf16432570..99b123a6421a 100644
--- a/arch/ia64/sn/kernel/xpc_main.c
+++ b/arch/ia64/sn/kernel/xpc_main.c
@@ -52,7 +52,6 @@
52#include <linux/syscalls.h> 52#include <linux/syscalls.h>
53#include <linux/cache.h> 53#include <linux/cache.h>
54#include <linux/interrupt.h> 54#include <linux/interrupt.h>
55#include <linux/slab.h>
56#include <linux/delay.h> 55#include <linux/delay.h>
57#include <linux/reboot.h> 56#include <linux/reboot.h>
58#include <linux/completion.h> 57#include <linux/completion.h>
diff --git a/arch/ia64/sn/kernel/xpc_partition.c b/arch/ia64/sn/kernel/xpc_partition.c
index 88a730e6cfdb..94211429fd0c 100644
--- a/arch/ia64/sn/kernel/xpc_partition.c
+++ b/arch/ia64/sn/kernel/xpc_partition.c
@@ -81,6 +81,31 @@ char ____cacheline_aligned xpc_remote_copy_buffer[XPC_RP_HEADER_SIZE +
81 81
82 82
83/* 83/*
84 * Guarantee that the kmalloc'd memory is cacheline aligned.
85 */
86static void *
87xpc_kmalloc_cacheline_aligned(size_t size, gfp_t flags, void **base)
88{
89 /* see if kmalloc will give us cachline aligned memory by default */
90 *base = kmalloc(size, flags);
91 if (*base == NULL) {
92 return NULL;
93 }
94 if ((u64) *base == L1_CACHE_ALIGN((u64) *base)) {
95 return *base;
96 }
97 kfree(*base);
98
99 /* nope, we'll have to do it ourselves */
100 *base = kmalloc(size + L1_CACHE_BYTES, flags);
101 if (*base == NULL) {
102 return NULL;
103 }
104 return (void *) L1_CACHE_ALIGN((u64) *base);
105}
106
107
108/*
84 * Given a nasid, get the physical address of the partition's reserved page 109 * Given a nasid, get the physical address of the partition's reserved page
85 * for that nasid. This function returns 0 on any error. 110 * for that nasid. This function returns 0 on any error.
86 */ 111 */
@@ -1038,13 +1063,12 @@ xpc_discovery(void)
1038 remote_vars = (struct xpc_vars *) remote_rp; 1063 remote_vars = (struct xpc_vars *) remote_rp;
1039 1064
1040 1065
1041 discovered_nasids = kmalloc(sizeof(u64) * xp_nasid_mask_words, 1066 discovered_nasids = kzalloc(sizeof(u64) * xp_nasid_mask_words,
1042 GFP_KERNEL); 1067 GFP_KERNEL);
1043 if (discovered_nasids == NULL) { 1068 if (discovered_nasids == NULL) {
1044 kfree(remote_rp_base); 1069 kfree(remote_rp_base);
1045 return; 1070 return;
1046 } 1071 }
1047 memset(discovered_nasids, 0, sizeof(u64) * xp_nasid_mask_words);
1048 1072
1049 rp = (struct xpc_rsvd_page *) xpc_rsvd_page; 1073 rp = (struct xpc_rsvd_page *) xpc_rsvd_page;
1050 1074
diff --git a/arch/ia64/sn/pci/pcibr/pcibr_provider.c b/arch/ia64/sn/pci/pcibr/pcibr_provider.c
index 98f716bd92f0..ab1211ef0176 100644
--- a/arch/ia64/sn/pci/pcibr/pcibr_provider.c
+++ b/arch/ia64/sn/pci/pcibr/pcibr_provider.c
@@ -74,6 +74,22 @@ static int sal_pcibr_error_interrupt(struct pcibus_info *soft)
74 return (int)ret_stuff.v0; 74 return (int)ret_stuff.v0;
75} 75}
76 76
77u16 sn_ioboard_to_pci_bus(struct pci_bus *pci_bus)
78{
79 s64 rc;
80 u16 ioboard;
81 nasid_t nasid = NASID_GET(SN_PCIBUS_BUSSOFT(pci_bus)->bs_base);
82
83 rc = ia64_sn_sysctl_ioboard_get(nasid, &ioboard);
84 if (rc) {
85 printk(KERN_WARNING "ia64_sn_sysctl_ioboard_get failed: %ld\n",
86 rc);
87 return 0;
88 }
89
90 return ioboard;
91}
92
77/* 93/*
78 * PCI Bridge Error interrupt handler. Gets invoked whenever a PCI 94 * PCI Bridge Error interrupt handler. Gets invoked whenever a PCI
79 * bridge sends an error interrupt. 95 * bridge sends an error interrupt.
@@ -255,3 +271,4 @@ pcibr_init_provider(void)
255 271
256EXPORT_SYMBOL_GPL(sal_pcibr_slot_enable); 272EXPORT_SYMBOL_GPL(sal_pcibr_slot_enable);
257EXPORT_SYMBOL_GPL(sal_pcibr_slot_disable); 273EXPORT_SYMBOL_GPL(sal_pcibr_slot_disable);
274EXPORT_SYMBOL_GPL(sn_ioboard_to_pci_bus);
diff --git a/arch/ia64/sn/pci/tioca_provider.c b/arch/ia64/sn/pci/tioca_provider.c
index 7571a4025529..be0176912968 100644
--- a/arch/ia64/sn/pci/tioca_provider.c
+++ b/arch/ia64/sn/pci/tioca_provider.c
@@ -377,7 +377,7 @@ tioca_dma_mapped(struct pci_dev *pdev, u64 paddr, size_t req_size)
377 struct tioca_dmamap *ca_dmamap; 377 struct tioca_dmamap *ca_dmamap;
378 void *map; 378 void *map;
379 unsigned long flags; 379 unsigned long flags;
380 struct pcidev_info *pcidev_info = SN_PCIDEV_INFO(pdev);; 380 struct pcidev_info *pcidev_info = SN_PCIDEV_INFO(pdev);
381 381
382 tioca_common = (struct tioca_common *)pcidev_info->pdi_pcibus_info; 382 tioca_common = (struct tioca_common *)pcidev_info->pdi_pcibus_info;
383 tioca_kern = (struct tioca_kernel *)tioca_common->ca_kernel_private; 383 tioca_kern = (struct tioca_kernel *)tioca_common->ca_kernel_private;
diff --git a/arch/ia64/sn/pci/tioce_provider.c b/arch/ia64/sn/pci/tioce_provider.c
index e52831ed93eb..fa073cc4b565 100644
--- a/arch/ia64/sn/pci/tioce_provider.c
+++ b/arch/ia64/sn/pci/tioce_provider.c
@@ -15,6 +15,124 @@
15#include <asm/sn/pcidev.h> 15#include <asm/sn/pcidev.h>
16#include <asm/sn/pcibus_provider_defs.h> 16#include <asm/sn/pcibus_provider_defs.h>
17#include <asm/sn/tioce_provider.h> 17#include <asm/sn/tioce_provider.h>
18#include <asm/sn/sn2/sn_hwperf.h>
19
20/*
21 * 1/26/2006
22 *
23 * WAR for SGI PV 944642. For revA TIOCE, need to use the following recipe
24 * (taken from the above PV) before and after accessing tioce internal MMR's
25 * to avoid tioce lockups.
26 *
27 * The recipe as taken from the PV:
28 *
29 * if(mmr address < 0x45000) {
30 * if(mmr address == 0 or 0x80)
31 * mmr wrt or read address 0xc0
32 * else if(mmr address == 0x148 or 0x200)
33 * mmr wrt or read address 0x28
34 * else
35 * mmr wrt or read address 0x158
36 *
37 * do desired mmr access (rd or wrt)
38 *
39 * if(mmr address == 0x100)
40 * mmr wrt or read address 0x38
41 * mmr wrt or read address 0xb050
42 * } else
43 * do desired mmr access
44 *
45 * According to hw, we can use reads instead of writes to the above addres
46 *
47 * Note this WAR can only to be used for accessing internal MMR's in the
48 * TIOCE Coretalk Address Range 0x0 - 0x07ff_ffff. This includes the
49 * "Local CE Registers and Memories" and "PCI Compatible Config Space" address
50 * spaces from table 2-1 of the "CE Programmer's Reference Overview" document.
51 *
52 * All registers defined in struct tioce will meet that criteria.
53 */
54
55static void inline
56tioce_mmr_war_pre(struct tioce_kernel *kern, void *mmr_addr)
57{
58 u64 mmr_base;
59 u64 mmr_offset;
60
61 if (kern->ce_common->ce_rev != TIOCE_REV_A)
62 return;
63
64 mmr_base = kern->ce_common->ce_pcibus.bs_base;
65 mmr_offset = (u64)mmr_addr - mmr_base;
66
67 if (mmr_offset < 0x45000) {
68 u64 mmr_war_offset;
69
70 if (mmr_offset == 0 || mmr_offset == 0x80)
71 mmr_war_offset = 0xc0;
72 else if (mmr_offset == 0x148 || mmr_offset == 0x200)
73 mmr_war_offset = 0x28;
74 else
75 mmr_war_offset = 0x158;
76
77 readq_relaxed((void *)(mmr_base + mmr_war_offset));
78 }
79}
80
81static void inline
82tioce_mmr_war_post(struct tioce_kernel *kern, void *mmr_addr)
83{
84 u64 mmr_base;
85 u64 mmr_offset;
86
87 if (kern->ce_common->ce_rev != TIOCE_REV_A)
88 return;
89
90 mmr_base = kern->ce_common->ce_pcibus.bs_base;
91 mmr_offset = (u64)mmr_addr - mmr_base;
92
93 if (mmr_offset < 0x45000) {
94 if (mmr_offset == 0x100)
95 readq_relaxed((void *)(mmr_base + 0x38));
96 readq_relaxed((void *)(mmr_base + 0xb050));
97 }
98}
99
100/* load mmr contents into a variable */
101#define tioce_mmr_load(kern, mmrp, varp) do {\
102 tioce_mmr_war_pre(kern, mmrp); \
103 *(varp) = readq_relaxed(mmrp); \
104 tioce_mmr_war_post(kern, mmrp); \
105} while (0)
106
107/* store variable contents into mmr */
108#define tioce_mmr_store(kern, mmrp, varp) do {\
109 tioce_mmr_war_pre(kern, mmrp); \
110 writeq(*varp, mmrp); \
111 tioce_mmr_war_post(kern, mmrp); \
112} while (0)
113
114/* store immediate value into mmr */
115#define tioce_mmr_storei(kern, mmrp, val) do {\
116 tioce_mmr_war_pre(kern, mmrp); \
117 writeq(val, mmrp); \
118 tioce_mmr_war_post(kern, mmrp); \
119} while (0)
120
121/* set bits (immediate value) into mmr */
122#define tioce_mmr_seti(kern, mmrp, bits) do {\
123 u64 tmp; \
124 tioce_mmr_load(kern, mmrp, &tmp); \
125 tmp |= (bits); \
126 tioce_mmr_store(kern, mmrp, &tmp); \
127} while (0)
128
129/* clear bits (immediate value) into mmr */
130#define tioce_mmr_clri(kern, mmrp, bits) do { \
131 u64 tmp; \
132 tioce_mmr_load(kern, mmrp, &tmp); \
133 tmp &= ~(bits); \
134 tioce_mmr_store(kern, mmrp, &tmp); \
135} while (0)
18 136
19/** 137/**
20 * Bus address ranges for the 5 flavors of TIOCE DMA 138 * Bus address ranges for the 5 flavors of TIOCE DMA
@@ -62,9 +180,9 @@
62#define TIOCE_ATE_M40 2 180#define TIOCE_ATE_M40 2
63#define TIOCE_ATE_M40S 3 181#define TIOCE_ATE_M40S 3
64 182
65#define KB(x) ((x) << 10) 183#define KB(x) ((u64)(x) << 10)
66#define MB(x) ((x) << 20) 184#define MB(x) ((u64)(x) << 20)
67#define GB(x) ((x) << 30) 185#define GB(x) ((u64)(x) << 30)
68 186
69/** 187/**
70 * tioce_dma_d64 - create a DMA mapping using 64-bit direct mode 188 * tioce_dma_d64 - create a DMA mapping using 64-bit direct mode
@@ -151,7 +269,7 @@ tioce_alloc_map(struct tioce_kernel *ce_kern, int type, int port,
151 int last; 269 int last;
152 int entries; 270 int entries;
153 int nates; 271 int nates;
154 int pagesize; 272 u64 pagesize;
155 u64 *ate_shadow; 273 u64 *ate_shadow;
156 u64 *ate_reg; 274 u64 *ate_reg;
157 u64 addr; 275 u64 addr;
@@ -228,7 +346,7 @@ tioce_alloc_map(struct tioce_kernel *ce_kern, int type, int port,
228 346
229 ate = ATE_MAKE(addr, pagesize); 347 ate = ATE_MAKE(addr, pagesize);
230 ate_shadow[i + j] = ate; 348 ate_shadow[i + j] = ate;
231 writeq(ate, &ate_reg[i + j]); 349 tioce_mmr_storei(ce_kern, &ate_reg[i + j], ate);
232 addr += pagesize; 350 addr += pagesize;
233 } 351 }
234 352
@@ -272,7 +390,8 @@ tioce_dma_d32(struct pci_dev *pdev, u64 ct_addr)
272 u64 tmp; 390 u64 tmp;
273 391
274 ce_kern->ce_port[port].dirmap_shadow = ct_upper; 392 ce_kern->ce_port[port].dirmap_shadow = ct_upper;
275 writeq(ct_upper, &ce_mmr->ce_ure_dir_map[port]); 393 tioce_mmr_storei(ce_kern, &ce_mmr->ce_ure_dir_map[port],
394 ct_upper);
276 tmp = ce_mmr->ce_ure_dir_map[port]; 395 tmp = ce_mmr->ce_ure_dir_map[port];
277 dma_ok = 1; 396 dma_ok = 1;
278 } else 397 } else
@@ -344,7 +463,8 @@ tioce_dma_unmap(struct pci_dev *pdev, dma_addr_t bus_addr, int dir)
344 if (TIOCE_D32_ADDR(bus_addr)) { 463 if (TIOCE_D32_ADDR(bus_addr)) {
345 if (--ce_kern->ce_port[port].dirmap_refcnt == 0) { 464 if (--ce_kern->ce_port[port].dirmap_refcnt == 0) {
346 ce_kern->ce_port[port].dirmap_shadow = 0; 465 ce_kern->ce_port[port].dirmap_shadow = 0;
347 writeq(0, &ce_mmr->ce_ure_dir_map[port]); 466 tioce_mmr_storei(ce_kern, &ce_mmr->ce_ure_dir_map[port],
467 0);
348 } 468 }
349 } else { 469 } else {
350 struct tioce_dmamap *map; 470 struct tioce_dmamap *map;
@@ -365,7 +485,7 @@ tioce_dma_unmap(struct pci_dev *pdev, dma_addr_t bus_addr, int dir)
365 } else if (--map->refcnt == 0) { 485 } else if (--map->refcnt == 0) {
366 for (i = 0; i < map->ate_count; i++) { 486 for (i = 0; i < map->ate_count; i++) {
367 map->ate_shadow[i] = 0; 487 map->ate_shadow[i] = 0;
368 map->ate_hw[i] = 0; 488 tioce_mmr_storei(ce_kern, &map->ate_hw[i], 0);
369 } 489 }
370 490
371 list_del(&map->ce_dmamap_list); 491 list_del(&map->ce_dmamap_list);
@@ -486,7 +606,7 @@ tioce_do_dma_map(struct pci_dev *pdev, u64 paddr, size_t byte_count,
486 spin_unlock_irqrestore(&ce_kern->ce_lock, flags); 606 spin_unlock_irqrestore(&ce_kern->ce_lock, flags);
487 607
488dma_map_done: 608dma_map_done:
489 if (mapaddr & barrier) 609 if (mapaddr && barrier)
490 mapaddr = tioce_dma_barrier(mapaddr, 1); 610 mapaddr = tioce_dma_barrier(mapaddr, 1);
491 611
492 return mapaddr; 612 return mapaddr;
@@ -541,17 +661,61 @@ tioce_error_intr_handler(int irq, void *arg, struct pt_regs *pt)
541 soft->ce_pcibus.bs_persist_segment, 661 soft->ce_pcibus.bs_persist_segment,
542 soft->ce_pcibus.bs_persist_busnum, 0, 0, 0, 0, 0); 662 soft->ce_pcibus.bs_persist_busnum, 0, 0, 0, 0, 0);
543 663
664 if (ret_stuff.v0)
665 panic("tioce_error_intr_handler: Fatal TIOCE error");
666
544 return IRQ_HANDLED; 667 return IRQ_HANDLED;
545} 668}
546 669
547/** 670/**
671 * tioce_reserve_m32 - reserve M32 ate's for the indicated address range
672 * @tioce_kernel: TIOCE context to reserve ate's for
673 * @base: starting bus address to reserve
674 * @limit: last bus address to reserve
675 *
676 * If base/limit falls within the range of bus space mapped through the
677 * M32 space, reserve the resources corresponding to the range.
678 */
679static void
680tioce_reserve_m32(struct tioce_kernel *ce_kern, u64 base, u64 limit)
681{
682 int ate_index, last_ate, ps;
683 struct tioce *ce_mmr;
684
685 if (!TIOCE_M32_ADDR(base))
686 return;
687
688 ce_mmr = (struct tioce *)ce_kern->ce_common->ce_pcibus.bs_base;
689 ps = ce_kern->ce_ate3240_pagesize;
690 ate_index = ATE_PAGE(base, ps);
691 last_ate = ate_index + ATE_NPAGES(base, limit-base+1, ps) - 1;
692
693 if (ate_index < 64)
694 ate_index = 64;
695
696 while (ate_index <= last_ate) {
697 u64 ate;
698
699 ate = ATE_MAKE(0xdeadbeef, ps);
700 ce_kern->ce_ate3240_shadow[ate_index] = ate;
701 tioce_mmr_storei(ce_kern, &ce_mmr->ce_ure_ate3240[ate_index],
702 ate);
703 ate_index++;
704 }
705}
706
707/**
548 * tioce_kern_init - init kernel structures related to a given TIOCE 708 * tioce_kern_init - init kernel structures related to a given TIOCE
549 * @tioce_common: ptr to a cached tioce_common struct that originated in prom 709 * @tioce_common: ptr to a cached tioce_common struct that originated in prom
550 */ static struct tioce_kernel * 710 */
711static struct tioce_kernel *
551tioce_kern_init(struct tioce_common *tioce_common) 712tioce_kern_init(struct tioce_common *tioce_common)
552{ 713{
553 int i; 714 int i;
715 int ps;
716 int dev;
554 u32 tmp; 717 u32 tmp;
718 unsigned int seg, bus;
555 struct tioce *tioce_mmr; 719 struct tioce *tioce_mmr;
556 struct tioce_kernel *tioce_kern; 720 struct tioce_kernel *tioce_kern;
557 721
@@ -572,9 +736,10 @@ tioce_kern_init(struct tioce_common *tioce_common)
572 * here to use pci_read_config_xxx() so use the raw_pci_ops vector. 736 * here to use pci_read_config_xxx() so use the raw_pci_ops vector.
573 */ 737 */
574 738
575 raw_pci_ops->read(tioce_common->ce_pcibus.bs_persist_segment, 739 seg = tioce_common->ce_pcibus.bs_persist_segment;
576 tioce_common->ce_pcibus.bs_persist_busnum, 740 bus = tioce_common->ce_pcibus.bs_persist_busnum;
577 PCI_DEVFN(2, 0), PCI_SECONDARY_BUS, 1, &tmp); 741
742 raw_pci_ops->read(seg, bus, PCI_DEVFN(2, 0), PCI_SECONDARY_BUS, 1,&tmp);
578 tioce_kern->ce_port1_secondary = (u8) tmp; 743 tioce_kern->ce_port1_secondary = (u8) tmp;
579 744
580 /* 745 /*
@@ -583,18 +748,76 @@ tioce_kern_init(struct tioce_common *tioce_common)
583 */ 748 */
584 749
585 tioce_mmr = (struct tioce *)tioce_common->ce_pcibus.bs_base; 750 tioce_mmr = (struct tioce *)tioce_common->ce_pcibus.bs_base;
586 __sn_clrq_relaxed(&tioce_mmr->ce_ure_page_map, CE_URE_PAGESIZE_MASK); 751 tioce_mmr_clri(tioce_kern, &tioce_mmr->ce_ure_page_map,
587 __sn_setq_relaxed(&tioce_mmr->ce_ure_page_map, CE_URE_256K_PAGESIZE); 752 CE_URE_PAGESIZE_MASK);
588 tioce_kern->ce_ate3240_pagesize = KB(256); 753 tioce_mmr_seti(tioce_kern, &tioce_mmr->ce_ure_page_map,
754 CE_URE_256K_PAGESIZE);
755 ps = tioce_kern->ce_ate3240_pagesize = KB(256);
589 756
590 for (i = 0; i < TIOCE_NUM_M40_ATES; i++) { 757 for (i = 0; i < TIOCE_NUM_M40_ATES; i++) {
591 tioce_kern->ce_ate40_shadow[i] = 0; 758 tioce_kern->ce_ate40_shadow[i] = 0;
592 writeq(0, &tioce_mmr->ce_ure_ate40[i]); 759 tioce_mmr_storei(tioce_kern, &tioce_mmr->ce_ure_ate40[i], 0);
593 } 760 }
594 761
595 for (i = 0; i < TIOCE_NUM_M3240_ATES; i++) { 762 for (i = 0; i < TIOCE_NUM_M3240_ATES; i++) {
596 tioce_kern->ce_ate3240_shadow[i] = 0; 763 tioce_kern->ce_ate3240_shadow[i] = 0;
597 writeq(0, &tioce_mmr->ce_ure_ate3240[i]); 764 tioce_mmr_storei(tioce_kern, &tioce_mmr->ce_ure_ate3240[i], 0);
765 }
766
767 /*
768 * Reserve ATE's corresponding to reserved address ranges. These
769 * include:
770 *
771 * Memory space covered by each PPB mem base/limit register
772 * Memory space covered by each PPB prefetch base/limit register
773 *
774 * These bus ranges are for pio (downstream) traffic only, and so
775 * cannot be used for DMA.
776 */
777
778 for (dev = 1; dev <= 2; dev++) {
779 u64 base, limit;
780
781 /* mem base/limit */
782
783 raw_pci_ops->read(seg, bus, PCI_DEVFN(dev, 0),
784 PCI_MEMORY_BASE, 2, &tmp);
785 base = (u64)tmp << 16;
786
787 raw_pci_ops->read(seg, bus, PCI_DEVFN(dev, 0),
788 PCI_MEMORY_LIMIT, 2, &tmp);
789 limit = (u64)tmp << 16;
790 limit |= 0xfffffUL;
791
792 if (base < limit)
793 tioce_reserve_m32(tioce_kern, base, limit);
794
795 /*
796 * prefetch mem base/limit. The tioce ppb's have 64-bit
797 * decoders, so read the upper portions w/o checking the
798 * attributes.
799 */
800
801 raw_pci_ops->read(seg, bus, PCI_DEVFN(dev, 0),
802 PCI_PREF_MEMORY_BASE, 2, &tmp);
803 base = ((u64)tmp & PCI_PREF_RANGE_MASK) << 16;
804
805 raw_pci_ops->read(seg, bus, PCI_DEVFN(dev, 0),
806 PCI_PREF_BASE_UPPER32, 4, &tmp);
807 base |= (u64)tmp << 32;
808
809 raw_pci_ops->read(seg, bus, PCI_DEVFN(dev, 0),
810 PCI_PREF_MEMORY_LIMIT, 2, &tmp);
811
812 limit = ((u64)tmp & PCI_PREF_RANGE_MASK) << 16;
813 limit |= 0xfffffUL;
814
815 raw_pci_ops->read(seg, bus, PCI_DEVFN(dev, 0),
816 PCI_PREF_LIMIT_UPPER32, 4, &tmp);
817 limit |= (u64)tmp << 32;
818
819 if ((base < limit) && TIOCE_M32_ADDR(base))
820 tioce_reserve_m32(tioce_kern, base, limit);
598 } 821 }
599 822
600 return tioce_kern; 823 return tioce_kern;
@@ -614,6 +837,7 @@ tioce_force_interrupt(struct sn_irq_info *sn_irq_info)
614{ 837{
615 struct pcidev_info *pcidev_info; 838 struct pcidev_info *pcidev_info;
616 struct tioce_common *ce_common; 839 struct tioce_common *ce_common;
840 struct tioce_kernel *ce_kern;
617 struct tioce *ce_mmr; 841 struct tioce *ce_mmr;
618 u64 force_int_val; 842 u64 force_int_val;
619 843
@@ -629,6 +853,29 @@ tioce_force_interrupt(struct sn_irq_info *sn_irq_info)
629 853
630 ce_common = (struct tioce_common *)pcidev_info->pdi_pcibus_info; 854 ce_common = (struct tioce_common *)pcidev_info->pdi_pcibus_info;
631 ce_mmr = (struct tioce *)ce_common->ce_pcibus.bs_base; 855 ce_mmr = (struct tioce *)ce_common->ce_pcibus.bs_base;
856 ce_kern = (struct tioce_kernel *)ce_common->ce_kernel_private;
857
858 /*
859 * TIOCE Rev A workaround (PV 945826), force an interrupt by writing
860 * the TIO_INTx register directly (1/26/2006)
861 */
862 if (ce_common->ce_rev == TIOCE_REV_A) {
863 u64 int_bit_mask = (1ULL << sn_irq_info->irq_int_bit);
864 u64 status;
865
866 tioce_mmr_load(ce_kern, &ce_mmr->ce_adm_int_status, &status);
867 if (status & int_bit_mask) {
868 u64 force_irq = (1 << 8) | sn_irq_info->irq_irq;
869 u64 ctalk = sn_irq_info->irq_xtalkaddr;
870 u64 nasid, offset;
871
872 nasid = (ctalk & CTALK_NASID_MASK) >> CTALK_NASID_SHFT;
873 offset = (ctalk & CTALK_NODE_OFFSET);
874 HUB_S(TIO_IOSPACE_ADDR(nasid, offset), force_irq);
875 }
876
877 return;
878 }
632 879
633 /* 880 /*
634 * irq_int_bit is originally set up by prom, and holds the interrupt 881 * irq_int_bit is originally set up by prom, and holds the interrupt
@@ -666,7 +913,7 @@ tioce_force_interrupt(struct sn_irq_info *sn_irq_info)
666 default: 913 default:
667 return; 914 return;
668 } 915 }
669 writeq(force_int_val, &ce_mmr->ce_adm_force_int); 916 tioce_mmr_storei(ce_kern, &ce_mmr->ce_adm_force_int, force_int_val);
670} 917}
671 918
672/** 919/**
@@ -685,6 +932,7 @@ tioce_target_interrupt(struct sn_irq_info *sn_irq_info)
685{ 932{
686 struct pcidev_info *pcidev_info; 933 struct pcidev_info *pcidev_info;
687 struct tioce_common *ce_common; 934 struct tioce_common *ce_common;
935 struct tioce_kernel *ce_kern;
688 struct tioce *ce_mmr; 936 struct tioce *ce_mmr;
689 int bit; 937 int bit;
690 u64 vector; 938 u64 vector;
@@ -695,14 +943,15 @@ tioce_target_interrupt(struct sn_irq_info *sn_irq_info)
695 943
696 ce_common = (struct tioce_common *)pcidev_info->pdi_pcibus_info; 944 ce_common = (struct tioce_common *)pcidev_info->pdi_pcibus_info;
697 ce_mmr = (struct tioce *)ce_common->ce_pcibus.bs_base; 945 ce_mmr = (struct tioce *)ce_common->ce_pcibus.bs_base;
946 ce_kern = (struct tioce_kernel *)ce_common->ce_kernel_private;
698 947
699 bit = sn_irq_info->irq_int_bit; 948 bit = sn_irq_info->irq_int_bit;
700 949
701 __sn_setq_relaxed(&ce_mmr->ce_adm_int_mask, (1UL << bit)); 950 tioce_mmr_seti(ce_kern, &ce_mmr->ce_adm_int_mask, (1UL << bit));
702 vector = (u64)sn_irq_info->irq_irq << INTR_VECTOR_SHFT; 951 vector = (u64)sn_irq_info->irq_irq << INTR_VECTOR_SHFT;
703 vector |= sn_irq_info->irq_xtalkaddr; 952 vector |= sn_irq_info->irq_xtalkaddr;
704 writeq(vector, &ce_mmr->ce_adm_int_dest[bit]); 953 tioce_mmr_storei(ce_kern, &ce_mmr->ce_adm_int_dest[bit], vector);
705 __sn_clrq_relaxed(&ce_mmr->ce_adm_int_mask, (1UL << bit)); 954 tioce_mmr_clri(ce_kern, &ce_mmr->ce_adm_int_mask, (1UL << bit));
706 955
707 tioce_force_interrupt(sn_irq_info); 956 tioce_force_interrupt(sn_irq_info);
708} 957}
@@ -721,7 +970,11 @@ tioce_target_interrupt(struct sn_irq_info *sn_irq_info)
721static void * 970static void *
722tioce_bus_fixup(struct pcibus_bussoft *prom_bussoft, struct pci_controller *controller) 971tioce_bus_fixup(struct pcibus_bussoft *prom_bussoft, struct pci_controller *controller)
723{ 972{
973 int my_nasid;
974 cnodeid_t my_cnode, mem_cnode;
724 struct tioce_common *tioce_common; 975 struct tioce_common *tioce_common;
976 struct tioce_kernel *tioce_kern;
977 struct tioce *tioce_mmr;
725 978
726 /* 979 /*
727 * Allocate kernel bus soft and copy from prom. 980 * Allocate kernel bus soft and copy from prom.
@@ -734,11 +987,23 @@ tioce_bus_fixup(struct pcibus_bussoft *prom_bussoft, struct pci_controller *cont
734 memcpy(tioce_common, prom_bussoft, sizeof(struct tioce_common)); 987 memcpy(tioce_common, prom_bussoft, sizeof(struct tioce_common));
735 tioce_common->ce_pcibus.bs_base |= __IA64_UNCACHED_OFFSET; 988 tioce_common->ce_pcibus.bs_base |= __IA64_UNCACHED_OFFSET;
736 989
737 if (tioce_kern_init(tioce_common) == NULL) { 990 tioce_kern = tioce_kern_init(tioce_common);
991 if (tioce_kern == NULL) {
738 kfree(tioce_common); 992 kfree(tioce_common);
739 return NULL; 993 return NULL;
740 } 994 }
741 995
996 /*
997 * Clear out any transient errors before registering the error
998 * interrupt handler.
999 */
1000
1001 tioce_mmr = (struct tioce *)tioce_common->ce_pcibus.bs_base;
1002 tioce_mmr_seti(tioce_kern, &tioce_mmr->ce_adm_int_status_alias, ~0ULL);
1003 tioce_mmr_seti(tioce_kern, &tioce_mmr->ce_adm_error_summary_alias,
1004 ~0ULL);
1005 tioce_mmr_seti(tioce_kern, &tioce_mmr->ce_dre_comp_err_addr, ~0ULL);
1006
742 if (request_irq(SGI_PCIASIC_ERROR, 1007 if (request_irq(SGI_PCIASIC_ERROR,
743 tioce_error_intr_handler, 1008 tioce_error_intr_handler,
744 SA_SHIRQ, "TIOCE error", (void *)tioce_common)) 1009 SA_SHIRQ, "TIOCE error", (void *)tioce_common))
@@ -750,6 +1015,21 @@ tioce_bus_fixup(struct pcibus_bussoft *prom_bussoft, struct pci_controller *cont
750 tioce_common->ce_pcibus.bs_persist_segment, 1015 tioce_common->ce_pcibus.bs_persist_segment,
751 tioce_common->ce_pcibus.bs_persist_busnum); 1016 tioce_common->ce_pcibus.bs_persist_busnum);
752 1017
1018 /*
1019 * identify closest nasid for memory allocations
1020 */
1021
1022 my_nasid = NASID_GET(tioce_common->ce_pcibus.bs_base);
1023 my_cnode = nasid_to_cnodeid(my_nasid);
1024
1025 if (sn_hwperf_get_nearest_node(my_cnode, &mem_cnode, NULL) < 0) {
1026 printk(KERN_WARNING "tioce_bus_fixup: failed to find "
1027 "closest node with MEM to TIO node %d\n", my_cnode);
1028 mem_cnode = (cnodeid_t)-1; /* use any node */
1029 }
1030
1031 controller->node = mem_cnode;
1032
753 return tioce_common; 1033 return tioce_common;
754} 1034}
755 1035
diff --git a/arch/m32r/Kconfig b/arch/m32r/Kconfig
index a3dcc3fab4b7..05c864c6c2d9 100644
--- a/arch/m32r/Kconfig
+++ b/arch/m32r/Kconfig
@@ -214,6 +214,14 @@ config RWSEM_XCHGADD_ALGORITHM
214 bool 214 bool
215 default n 215 default n
216 216
217config GENERIC_FIND_NEXT_BIT
218 bool
219 default y
220
221config GENERIC_HWEIGHT
222 bool
223 default y
224
217config GENERIC_CALIBRATE_DELAY 225config GENERIC_CALIBRATE_DELAY
218 bool 226 bool
219 default y 227 default y
diff --git a/arch/m32r/Kconfig.debug b/arch/m32r/Kconfig.debug
index bbf711bab69e..2e1019ddbb22 100644
--- a/arch/m32r/Kconfig.debug
+++ b/arch/m32r/Kconfig.debug
@@ -19,7 +19,7 @@ config DEBUG_STACK_USAGE
19 This option will slow down process creation somewhat. 19 This option will slow down process creation somewhat.
20 20
21config DEBUG_PAGEALLOC 21config DEBUG_PAGEALLOC
22 bool "Page alloc debugging" 22 bool "Debug page memory allocations"
23 depends on DEBUG_KERNEL && BROKEN 23 depends on DEBUG_KERNEL && BROKEN
24 help 24 help
25 Unmap pages from the kernel linear mapping after free_pages(). 25 Unmap pages from the kernel linear mapping after free_pages().
diff --git a/arch/m32r/Makefile b/arch/m32r/Makefile
index 4b3c90ba926c..f219c47d334f 100644
--- a/arch/m32r/Makefile
+++ b/arch/m32r/Makefile
@@ -1,6 +1,9 @@
1# 1#
2# m32r/Makefile 2# m32r/Makefile
3# 3#
4# This file is included by the global makefile so that you can add your own
5# architecture-specific flags and dependencies.
6#
4 7
5LDFLAGS := 8LDFLAGS :=
6OBJCOPYFLAGS := -O binary -R .note -R .comment -S 9OBJCOPYFLAGS := -O binary -R .note -R .comment -S
@@ -39,7 +42,7 @@ drivers-$(CONFIG_OPROFILE) += arch/m32r/oprofile/
39 42
40boot := arch/m32r/boot 43boot := arch/m32r/boot
41 44
42.PHONY: zImage 45PHONY += zImage
43 46
44all: zImage 47all: zImage
45 48
diff --git a/arch/m32r/kernel/irq.c b/arch/m32r/kernel/irq.c
index 1ce63926a3c0..a4634b06f675 100644
--- a/arch/m32r/kernel/irq.c
+++ b/arch/m32r/kernel/irq.c
@@ -37,9 +37,8 @@ int show_interrupts(struct seq_file *p, void *v)
37 37
38 if (i == 0) { 38 if (i == 0) {
39 seq_printf(p, " "); 39 seq_printf(p, " ");
40 for (j=0; j<NR_CPUS; j++) 40 for_each_online_cpu(j)
41 if (cpu_online(j)) 41 seq_printf(p, "CPU%d ",j);
42 seq_printf(p, "CPU%d ",j);
43 seq_putc(p, '\n'); 42 seq_putc(p, '\n');
44 } 43 }
45 44
@@ -52,9 +51,8 @@ int show_interrupts(struct seq_file *p, void *v)
52#ifndef CONFIG_SMP 51#ifndef CONFIG_SMP
53 seq_printf(p, "%10u ", kstat_irqs(i)); 52 seq_printf(p, "%10u ", kstat_irqs(i));
54#else 53#else
55 for (j = 0; j < NR_CPUS; j++) 54 for_each_online_cpu(j)
56 if (cpu_online(j)) 55 seq_printf(p, "%10u ", kstat_cpu(j).irqs[i]);
57 seq_printf(p, "%10u ", kstat_cpu(j).irqs[i]);
58#endif 56#endif
59 seq_printf(p, " %14s", irq_desc[i].handler->typename); 57 seq_printf(p, " %14s", irq_desc[i].handler->typename);
60 seq_printf(p, " %s", action->name); 58 seq_printf(p, " %s", action->name);
diff --git a/arch/m32r/kernel/setup.c b/arch/m32r/kernel/setup.c
index d742037a7ccb..0d78942b4c76 100644
--- a/arch/m32r/kernel/setup.c
+++ b/arch/m32r/kernel/setup.c
@@ -24,6 +24,7 @@
24#include <linux/tty.h> 24#include <linux/tty.h>
25#include <linux/cpu.h> 25#include <linux/cpu.h>
26#include <linux/nodemask.h> 26#include <linux/nodemask.h>
27#include <linux/pfn.h>
27 28
28#include <asm/processor.h> 29#include <asm/processor.h>
29#include <asm/pgtable.h> 30#include <asm/pgtable.h>
diff --git a/arch/m32r/mm/discontig.c b/arch/m32r/mm/discontig.c
index 08e727955555..cf610a7c5ff0 100644
--- a/arch/m32r/mm/discontig.c
+++ b/arch/m32r/mm/discontig.c
@@ -13,6 +13,7 @@
13#include <linux/initrd.h> 13#include <linux/initrd.h>
14#include <linux/nodemask.h> 14#include <linux/nodemask.h>
15#include <linux/module.h> 15#include <linux/module.h>
16#include <linux/pfn.h>
16 17
17#include <asm/setup.h> 18#include <asm/setup.h>
18 19
@@ -137,12 +138,6 @@ unsigned long __init zone_sizes_init(void)
137 int nid, i; 138 int nid, i;
138 mem_prof_t *mp; 139 mem_prof_t *mp;
139 140
140 pgdat_list = NULL;
141 for (nid = num_online_nodes() - 1 ; nid >= 0 ; nid--) {
142 NODE_DATA(nid)->pgdat_next = pgdat_list;
143 pgdat_list = NODE_DATA(nid);
144 }
145
146 for_each_online_node(nid) { 141 for_each_online_node(nid) {
147 mp = &mem_prof[nid]; 142 mp = &mem_prof[nid];
148 for (i = 0 ; i < MAX_NR_ZONES ; i++) { 143 for (i = 0 ; i < MAX_NR_ZONES ; i++) {
diff --git a/arch/m32r/mm/init.c b/arch/m32r/mm/init.c
index 6facf15b04f3..b71348fec1f4 100644
--- a/arch/m32r/mm/init.c
+++ b/arch/m32r/mm/init.c
@@ -18,6 +18,7 @@
18#include <linux/highmem.h> 18#include <linux/highmem.h>
19#include <linux/bitops.h> 19#include <linux/bitops.h>
20#include <linux/nodemask.h> 20#include <linux/nodemask.h>
21#include <linux/pfn.h>
21#include <asm/types.h> 22#include <asm/types.h>
22#include <asm/processor.h> 23#include <asm/processor.h>
23#include <asm/page.h> 24#include <asm/page.h>
@@ -47,7 +48,7 @@ void show_mem(void)
47 printk("Mem-info:\n"); 48 printk("Mem-info:\n");
48 show_free_areas(); 49 show_free_areas();
49 printk("Free swap: %6ldkB\n",nr_swap_pages<<(PAGE_SHIFT-10)); 50 printk("Free swap: %6ldkB\n",nr_swap_pages<<(PAGE_SHIFT-10));
50 for_each_pgdat(pgdat) { 51 for_each_online_pgdat(pgdat) {
51 unsigned long flags; 52 unsigned long flags;
52 pgdat_resize_lock(pgdat, &flags); 53 pgdat_resize_lock(pgdat, &flags);
53 for (i = 0; i < pgdat->node_spanned_pages; ++i) { 54 for (i = 0; i < pgdat->node_spanned_pages; ++i) {
@@ -226,7 +227,7 @@ void free_initmem(void)
226 addr = (unsigned long)(&__init_begin); 227 addr = (unsigned long)(&__init_begin);
227 for (; addr < (unsigned long)(&__init_end); addr += PAGE_SIZE) { 228 for (; addr < (unsigned long)(&__init_end); addr += PAGE_SIZE) {
228 ClearPageReserved(virt_to_page(addr)); 229 ClearPageReserved(virt_to_page(addr));
229 set_page_count(virt_to_page(addr), 1); 230 init_page_count(virt_to_page(addr));
230 free_page(addr); 231 free_page(addr);
231 totalram_pages++; 232 totalram_pages++;
232 } 233 }
@@ -244,7 +245,7 @@ void free_initrd_mem(unsigned long start, unsigned long end)
244 unsigned long p; 245 unsigned long p;
245 for (p = start; p < end; p += PAGE_SIZE) { 246 for (p = start; p < end; p += PAGE_SIZE) {
246 ClearPageReserved(virt_to_page(p)); 247 ClearPageReserved(virt_to_page(p));
247 set_page_count(virt_to_page(p), 1); 248 init_page_count(virt_to_page(p));
248 free_page(p); 249 free_page(p);
249 totalram_pages++; 250 totalram_pages++;
250 } 251 }
diff --git a/arch/m68k/Kconfig b/arch/m68k/Kconfig
index 8849439e88dd..805b81fedf80 100644
--- a/arch/m68k/Kconfig
+++ b/arch/m68k/Kconfig
@@ -17,6 +17,10 @@ config RWSEM_GENERIC_SPINLOCK
17config RWSEM_XCHGADD_ALGORITHM 17config RWSEM_XCHGADD_ALGORITHM
18 bool 18 bool
19 19
20config GENERIC_HWEIGHT
21 bool
22 default y
23
20config GENERIC_CALIBRATE_DELAY 24config GENERIC_CALIBRATE_DELAY
21 bool 25 bool
22 default y 26 default y
diff --git a/arch/m68k/bvme6000/config.c b/arch/m68k/bvme6000/config.c
index 3ffc84f9c291..c90cb5fcc8ef 100644
--- a/arch/m68k/bvme6000/config.c
+++ b/arch/m68k/bvme6000/config.c
@@ -142,7 +142,7 @@ void __init config_bvme6000(void)
142 /* Now do the PIT configuration */ 142 /* Now do the PIT configuration */
143 143
144 pit->pgcr = 0x00; /* Unidirectional 8 bit, no handshake for now */ 144 pit->pgcr = 0x00; /* Unidirectional 8 bit, no handshake for now */
145 pit->psrr = 0x18; /* PIACK and PIRQ fucntions enabled */ 145 pit->psrr = 0x18; /* PIACK and PIRQ functions enabled */
146 pit->pacr = 0x00; /* Sub Mode 00, H2 i/p, no DMA */ 146 pit->pacr = 0x00; /* Sub Mode 00, H2 i/p, no DMA */
147 pit->padr = 0x00; /* Just to be tidy! */ 147 pit->padr = 0x00; /* Just to be tidy! */
148 pit->paddr = 0x00; /* All inputs for now (safest) */ 148 pit->paddr = 0x00; /* All inputs for now (safest) */
diff --git a/arch/m68k/bvme6000/rtc.c b/arch/m68k/bvme6000/rtc.c
index 703cbc6dc9cc..15c16b62dff5 100644
--- a/arch/m68k/bvme6000/rtc.c
+++ b/arch/m68k/bvme6000/rtc.c
@@ -18,6 +18,7 @@
18#include <linux/module.h> 18#include <linux/module.h>
19#include <linux/mc146818rtc.h> /* For struct rtc_time and ioctls, etc */ 19#include <linux/mc146818rtc.h> /* For struct rtc_time and ioctls, etc */
20#include <linux/smp_lock.h> 20#include <linux/smp_lock.h>
21#include <linux/bcd.h>
21#include <asm/bvme6000hw.h> 22#include <asm/bvme6000hw.h>
22 23
23#include <asm/io.h> 24#include <asm/io.h>
@@ -32,9 +33,6 @@
32 * ioctls. 33 * ioctls.
33 */ 34 */
34 35
35#define BCD2BIN(val) (((val)&15) + ((val)>>4)*10)
36#define BIN2BCD(val) ((((val)/10)<<4) + (val)%10)
37
38static unsigned char days_in_mo[] = 36static unsigned char days_in_mo[] =
39{0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31}; 37{0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
40 38
diff --git a/arch/m68k/kernel/m68k_ksyms.c b/arch/m68k/kernel/m68k_ksyms.c
index 3d7f2000b714..c3319514a85e 100644
--- a/arch/m68k/kernel/m68k_ksyms.c
+++ b/arch/m68k/kernel/m68k_ksyms.c
@@ -79,4 +79,3 @@ EXPORT_SYMBOL(__down_failed_interruptible);
79EXPORT_SYMBOL(__down_failed_trylock); 79EXPORT_SYMBOL(__down_failed_trylock);
80EXPORT_SYMBOL(__up_wakeup); 80EXPORT_SYMBOL(__up_wakeup);
81 81
82EXPORT_SYMBOL(get_wchan);
diff --git a/arch/m68k/kernel/process.c b/arch/m68k/kernel/process.c
index 2d8ad0727b6b..33648efb772e 100644
--- a/arch/m68k/kernel/process.c
+++ b/arch/m68k/kernel/process.c
@@ -77,7 +77,7 @@ unsigned long thread_saved_pc(struct task_struct *tsk)
77/* 77/*
78 * The idle loop on an m68k.. 78 * The idle loop on an m68k..
79 */ 79 */
80void default_idle(void) 80static void default_idle(void)
81{ 81{
82 if (!need_resched()) 82 if (!need_resched())
83#if defined(MACH_ATARI_ONLY) && !defined(CONFIG_HADES) 83#if defined(MACH_ATARI_ONLY) && !defined(CONFIG_HADES)
diff --git a/arch/m68k/mm/init.c b/arch/m68k/mm/init.c
index c45beb955943..a190e39c907a 100644
--- a/arch/m68k/mm/init.c
+++ b/arch/m68k/mm/init.c
@@ -137,7 +137,7 @@ void free_initrd_mem(unsigned long start, unsigned long end)
137 int pages = 0; 137 int pages = 0;
138 for (; start < end; start += PAGE_SIZE) { 138 for (; start < end; start += PAGE_SIZE) {
139 ClearPageReserved(virt_to_page(start)); 139 ClearPageReserved(virt_to_page(start));
140 set_page_count(virt_to_page(start), 1); 140 init_page_count(virt_to_page(start));
141 free_page(start); 141 free_page(start);
142 totalram_pages++; 142 totalram_pages++;
143 pages++; 143 pages++;
diff --git a/arch/m68k/mm/memory.c b/arch/m68k/mm/memory.c
index 559942ce0e1e..d6d582a5abb0 100644
--- a/arch/m68k/mm/memory.c
+++ b/arch/m68k/mm/memory.c
@@ -54,7 +54,7 @@ void __init init_pointer_table(unsigned long ptable)
54 54
55 /* unreserve the page so it's possible to free that page */ 55 /* unreserve the page so it's possible to free that page */
56 PD_PAGE(dp)->flags &= ~(1 << PG_reserved); 56 PD_PAGE(dp)->flags &= ~(1 << PG_reserved);
57 set_page_count(PD_PAGE(dp), 1); 57 init_page_count(PD_PAGE(dp));
58 58
59 return; 59 return;
60} 60}
diff --git a/arch/m68k/mm/motorola.c b/arch/m68k/mm/motorola.c
index d855fec26317..afb57eeafdcb 100644
--- a/arch/m68k/mm/motorola.c
+++ b/arch/m68k/mm/motorola.c
@@ -276,7 +276,7 @@ void free_initmem(void)
276 addr = (unsigned long)&__init_begin; 276 addr = (unsigned long)&__init_begin;
277 for (; addr < (unsigned long)&__init_end; addr += PAGE_SIZE) { 277 for (; addr < (unsigned long)&__init_end; addr += PAGE_SIZE) {
278 virt_to_page(addr)->flags &= ~(1 << PG_reserved); 278 virt_to_page(addr)->flags &= ~(1 << PG_reserved);
279 set_page_count(virt_to_page(addr), 1); 279 init_page_count(virt_to_page(addr));
280 free_page(addr); 280 free_page(addr);
281 totalram_pages++; 281 totalram_pages++;
282 } 282 }
diff --git a/arch/m68k/mvme16x/rtc.c b/arch/m68k/mvme16x/rtc.c
index a69fe3048edc..b0e4c084df8a 100644
--- a/arch/m68k/mvme16x/rtc.c
+++ b/arch/m68k/mvme16x/rtc.c
@@ -17,6 +17,7 @@
17#include <linux/poll.h> 17#include <linux/poll.h>
18#include <linux/mc146818rtc.h> /* For struct rtc_time and ioctls, etc */ 18#include <linux/mc146818rtc.h> /* For struct rtc_time and ioctls, etc */
19#include <linux/smp_lock.h> 19#include <linux/smp_lock.h>
20#include <linux/bcd.h>
20#include <asm/mvme16xhw.h> 21#include <asm/mvme16xhw.h>
21 22
22#include <asm/io.h> 23#include <asm/io.h>
@@ -31,9 +32,6 @@
31 * ioctls. 32 * ioctls.
32 */ 33 */
33 34
34#define BCD2BIN(val) (((val)&15) + ((val)>>4)*10)
35#define BIN2BCD(val) ((((val)/10)<<4) + (val)%10)
36
37static const unsigned char days_in_mo[] = 35static const unsigned char days_in_mo[] =
38{0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31}; 36{0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
39 37
diff --git a/arch/m68knommu/Kconfig b/arch/m68knommu/Kconfig
index e50858dbc237..3cde6822ead1 100644
--- a/arch/m68knommu/Kconfig
+++ b/arch/m68knommu/Kconfig
@@ -25,6 +25,14 @@ config RWSEM_XCHGADD_ALGORITHM
25 bool 25 bool
26 default n 26 default n
27 27
28config GENERIC_FIND_NEXT_BIT
29 bool
30 default y
31
32config GENERIC_HWEIGHT
33 bool
34 default y
35
28config GENERIC_CALIBRATE_DELAY 36config GENERIC_CALIBRATE_DELAY
29 bool 37 bool
30 default y 38 default y
diff --git a/arch/m68knommu/kernel/m68k_ksyms.c b/arch/m68knommu/kernel/m68k_ksyms.c
index eddb8d3e130a..f9b4ea16c099 100644
--- a/arch/m68knommu/kernel/m68k_ksyms.c
+++ b/arch/m68knommu/kernel/m68k_ksyms.c
@@ -26,6 +26,7 @@ EXPORT_SYMBOL(__ioremap);
26EXPORT_SYMBOL(iounmap); 26EXPORT_SYMBOL(iounmap);
27EXPORT_SYMBOL(dump_fpu); 27EXPORT_SYMBOL(dump_fpu);
28EXPORT_SYMBOL(strnlen); 28EXPORT_SYMBOL(strnlen);
29EXPORT_SYMBOL(strpbrk);
29EXPORT_SYMBOL(strrchr); 30EXPORT_SYMBOL(strrchr);
30EXPORT_SYMBOL(strstr); 31EXPORT_SYMBOL(strstr);
31EXPORT_SYMBOL(strchr); 32EXPORT_SYMBOL(strchr);
@@ -56,8 +57,6 @@ EXPORT_SYMBOL(__down_failed_interruptible);
56EXPORT_SYMBOL(__down_failed_trylock); 57EXPORT_SYMBOL(__down_failed_trylock);
57EXPORT_SYMBOL(__up_wakeup); 58EXPORT_SYMBOL(__up_wakeup);
58 59
59EXPORT_SYMBOL(get_wchan);
60
61/* 60/*
62 * libgcc functions - functions that are used internally by the 61 * libgcc functions - functions that are used internally by the
63 * compiler... (prototypes are not correct though, but that 62 * compiler... (prototypes are not correct though, but that
diff --git a/arch/m68knommu/kernel/process.c b/arch/m68knommu/kernel/process.c
index 63c117dae0c3..f861755ec88b 100644
--- a/arch/m68knommu/kernel/process.c
+++ b/arch/m68knommu/kernel/process.c
@@ -51,7 +51,7 @@ EXPORT_SYMBOL(pm_power_off);
51/* 51/*
52 * The idle loop on an m68knommu.. 52 * The idle loop on an m68knommu..
53 */ 53 */
54void default_idle(void) 54static void default_idle(void)
55{ 55{
56 local_irq_disable(); 56 local_irq_disable();
57 while (!need_resched()) { 57 while (!need_resched()) {
diff --git a/arch/m68knommu/kernel/vmlinux.lds.S b/arch/m68knommu/kernel/vmlinux.lds.S
index ac9de2661c0b..a331cc90797c 100644
--- a/arch/m68knommu/kernel/vmlinux.lds.S
+++ b/arch/m68knommu/kernel/vmlinux.lds.S
@@ -269,6 +269,11 @@ SECTIONS {
269 *(__ksymtab_gpl) 269 *(__ksymtab_gpl)
270 __stop___ksymtab_gpl = .; 270 __stop___ksymtab_gpl = .;
271 271
272 /* Kernel symbol table: GPL-future symbols */
273 __start___ksymtab_gpl_future = .;
274 *(__ksymtab_gpl_future)
275 __stop___ksymtab_gpl_future = .;
276
272 /* Kernel symbol table: Normal symbols */ 277 /* Kernel symbol table: Normal symbols */
273 __start___kcrctab = .; 278 __start___kcrctab = .;
274 *(__kcrctab) 279 *(__kcrctab)
@@ -279,6 +284,11 @@ SECTIONS {
279 *(__kcrctab_gpl) 284 *(__kcrctab_gpl)
280 __stop___kcrctab_gpl = .; 285 __stop___kcrctab_gpl = .;
281 286
287 /* Kernel symbol table: GPL-future symbols */
288 __start___kcrctab_gpl_future = .;
289 *(__kcrctab_gpl_future)
290 __stop___kcrctab_gpl_future = .;
291
282 /* Kernel symbol table: strings */ 292 /* Kernel symbol table: strings */
283 *(__ksymtab_strings) 293 *(__ksymtab_strings)
284 294
diff --git a/arch/m68knommu/mm/init.c b/arch/m68knommu/mm/init.c
index 89f0b554ffb7..d79503fe6e42 100644
--- a/arch/m68knommu/mm/init.c
+++ b/arch/m68knommu/mm/init.c
@@ -195,7 +195,7 @@ void free_initrd_mem(unsigned long start, unsigned long end)
195 int pages = 0; 195 int pages = 0;
196 for (; start < end; start += PAGE_SIZE) { 196 for (; start < end; start += PAGE_SIZE) {
197 ClearPageReserved(virt_to_page(start)); 197 ClearPageReserved(virt_to_page(start));
198 set_page_count(virt_to_page(start), 1); 198 init_page_count(virt_to_page(start));
199 free_page(start); 199 free_page(start);
200 totalram_pages++; 200 totalram_pages++;
201 pages++; 201 pages++;
@@ -218,7 +218,7 @@ free_initmem()
218 /* next to check that the page we free is not a partial page */ 218 /* next to check that the page we free is not a partial page */
219 for (; addr + PAGE_SIZE < (unsigned long)(&__init_end); addr +=PAGE_SIZE) { 219 for (; addr + PAGE_SIZE < (unsigned long)(&__init_end); addr +=PAGE_SIZE) {
220 ClearPageReserved(virt_to_page(addr)); 220 ClearPageReserved(virt_to_page(addr));
221 set_page_count(virt_to_page(addr), 1); 221 init_page_count(virt_to_page(addr));
222 free_page(addr); 222 free_page(addr);
223 totalram_pages++; 223 totalram_pages++;
224 } 224 }
diff --git a/arch/mips/Kconfig b/arch/mips/Kconfig
index 6d4333776d28..e15709ce8866 100644
--- a/arch/mips/Kconfig
+++ b/arch/mips/Kconfig
@@ -604,7 +604,7 @@ config SGI_IP32
604 If you want this kernel to run on SGI O2 workstation, say Y here. 604 If you want this kernel to run on SGI O2 workstation, say Y here.
605 605
606config SIBYTE_BIGSUR 606config SIBYTE_BIGSUR
607 bool "Support for Sibyte BigSur" 607 bool "Support for Sibyte BCM91480B-BigSur"
608 select BOOT_ELF32 608 select BOOT_ELF32
609 select DMA_COHERENT 609 select DMA_COHERENT
610 select PCI_DOMAINS 610 select PCI_DOMAINS
@@ -793,6 +793,7 @@ source "arch/mips/tx4927/Kconfig"
793source "arch/mips/tx4938/Kconfig" 793source "arch/mips/tx4938/Kconfig"
794source "arch/mips/vr41xx/Kconfig" 794source "arch/mips/vr41xx/Kconfig"
795source "arch/mips/philips/pnx8550/common/Kconfig" 795source "arch/mips/philips/pnx8550/common/Kconfig"
796source "arch/mips/cobalt/Kconfig"
796 797
797endmenu 798endmenu
798 799
@@ -803,6 +804,14 @@ config RWSEM_GENERIC_SPINLOCK
803config RWSEM_XCHGADD_ALGORITHM 804config RWSEM_XCHGADD_ALGORITHM
804 bool 805 bool
805 806
807config GENERIC_FIND_NEXT_BIT
808 bool
809 default y
810
811config GENERIC_HWEIGHT
812 bool
813 default y
814
806config GENERIC_CALIBRATE_DELAY 815config GENERIC_CALIBRATE_DELAY
807 bool 816 bool
808 default y 817 default y
@@ -1162,6 +1171,7 @@ config CPU_R4X00
1162config CPU_TX49XX 1171config CPU_TX49XX
1163 bool "R49XX" 1172 bool "R49XX"
1164 depends on SYS_HAS_CPU_TX49XX 1173 depends on SYS_HAS_CPU_TX49XX
1174 select CPU_HAS_PREFETCH
1165 select CPU_SUPPORTS_32BIT_KERNEL 1175 select CPU_SUPPORTS_32BIT_KERNEL
1166 select CPU_SUPPORTS_64BIT_KERNEL 1176 select CPU_SUPPORTS_64BIT_KERNEL
1167 1177
@@ -1584,7 +1594,7 @@ source "mm/Kconfig"
1584 1594
1585config SMP 1595config SMP
1586 bool "Multi-Processing support" 1596 bool "Multi-Processing support"
1587 depends on CPU_RM9000 || ((SIBYTE_BCM1x80 || SIBYTE_BCM1x55 || SIBYTE_SB1250) && !SIBYTE_STANDALONE) || SGI_IP27 || MIPS_MT_SMP 1597 depends on CPU_RM9000 || ((SIBYTE_BCM1x80 || SIBYTE_BCM1x55 || SIBYTE_SB1250 || QEMU) && !SIBYTE_STANDALONE) || SGI_IP27 || MIPS_MT_SMP
1588 ---help--- 1598 ---help---
1589 This enables support for systems with more than one CPU. If you have 1599 This enables support for systems with more than one CPU. If you have
1590 a system with only one CPU, like most personal computers, say N. If 1600 a system with only one CPU, like most personal computers, say N. If
diff --git a/arch/mips/Makefile b/arch/mips/Makefile
index fe9da16f3a40..9a69e0f0ab76 100644
--- a/arch/mips/Makefile
+++ b/arch/mips/Makefile
@@ -12,10 +12,6 @@
12# for "archclean" cleaning up for this architecture. 12# for "archclean" cleaning up for this architecture.
13# 13#
14 14
15as-option = $(shell if $(CC) $(CFLAGS) $(1) -Wa,-Z -c -o /dev/null \
16 -xassembler /dev/null > /dev/null 2>&1; then echo "$(1)"; \
17 else echo "$(2)"; fi ;)
18
19cflags-y := 15cflags-y :=
20 16
21# 17#
@@ -38,12 +34,10 @@ else
38endif 34endif
39 35
40ifdef CONFIG_32BIT 36ifdef CONFIG_32BIT
41gcc-abi = 32
42tool-prefix = $(32bit-tool-prefix) 37tool-prefix = $(32bit-tool-prefix)
43UTS_MACHINE := mips 38UTS_MACHINE := mips
44endif 39endif
45ifdef CONFIG_64BIT 40ifdef CONFIG_64BIT
46gcc-abi = 64
47tool-prefix = $(64bit-tool-prefix) 41tool-prefix = $(64bit-tool-prefix)
48UTS_MACHINE := mips64 42UTS_MACHINE := mips64
49endif 43endif
@@ -52,37 +46,27 @@ ifdef CONFIG_CROSSCOMPILE
52CROSS_COMPILE := $(tool-prefix) 46CROSS_COMPILE := $(tool-prefix)
53endif 47endif
54 48
55CHECKFLAGS-y += -D__linux__ -D__mips__ \ 49ifdef CONFIG_32BIT
56 -D_MIPS_SZINT=32 \ 50ld-emul = $(32bit-emul)
57 -D_ABIO32=1 \ 51vmlinux-32 = vmlinux
58 -D_ABIN32=2 \ 52vmlinux-64 = vmlinux.64
59 -D_ABI64=3 53
60CHECKFLAGS-$(CONFIG_32BIT) += -D_MIPS_SIM=_ABIO32 \ 54cflags-y += -mabi=32
61 -D_MIPS_SZLONG=32 \ 55endif
62 -D_MIPS_SZPTR=32 \
63 -D__PTRDIFF_TYPE__=int
64CHECKFLAGS-$(CONFIG_64BIT) += -m64 -D_MIPS_SIM=_ABI64 \
65 -D_MIPS_SZLONG=64 \
66 -D_MIPS_SZPTR=64 \
67 -D__PTRDIFF_TYPE__="long int"
68CHECKFLAGS-$(CONFIG_CPU_BIG_ENDIAN) += -D__MIPSEB__
69CHECKFLAGS-$(CONFIG_CPU_LITTLE_ENDIAN) += -D__MIPSEL__
70
71CHECKFLAGS = $(CHECKFLAGS-y)
72 56
73ifdef CONFIG_BUILD_ELF64 57ifdef CONFIG_64BIT
74gas-abi = 64
75ld-emul = $(64bit-emul) 58ld-emul = $(64bit-emul)
76vmlinux-32 = vmlinux.32 59vmlinux-32 = vmlinux.32
77vmlinux-64 = vmlinux 60vmlinux-64 = vmlinux
78else
79gas-abi = 32
80ld-emul = $(32bit-emul)
81vmlinux-32 = vmlinux
82vmlinux-64 = vmlinux.64
83 61
84cflags-$(CONFIG_64BIT) += $(call cc-option,-mno-explicit-relocs) 62cflags-y += -mabi=64
63ifdef CONFIG_BUILD_ELF64
64cflags-y += $(call cc-option,-mno-explicit-relocs)
65else
66cflags-y += $(call cc-option,-msym32)
85endif 67endif
68endif
69
86 70
87# 71#
88# GCC uses -G 0 -mabicalls -fpic as default. We don't want PIC in the kernel 72# GCC uses -G 0 -mabicalls -fpic as default. We don't want PIC in the kernel
@@ -105,161 +89,44 @@ MODFLAGS += -mlong-calls
105# carefully avoid to add it redundantly because gcc 3.3/3.4 complains 89# carefully avoid to add it redundantly because gcc 3.3/3.4 complains
106# when fed the toolchain default! 90# when fed the toolchain default!
107# 91#
108cflags-$(CONFIG_CPU_BIG_ENDIAN) += $(shell $(CC) -dumpmachine |grep -q 'mips.*el-.*' && echo -EB) 92cflags-$(CONFIG_CPU_BIG_ENDIAN) += $(shell $(CC) -dumpmachine |grep -q 'mips.*el-.*' && echo -EB -D__MIPSEB__)
109cflags-$(CONFIG_CPU_LITTLE_ENDIAN) += $(shell $(CC) -dumpmachine |grep -q 'mips.*el-.*' || echo -EL) 93cflags-$(CONFIG_CPU_LITTLE_ENDIAN) += $(shell $(CC) -dumpmachine |grep -q 'mips.*el-.*' || echo -EL -D__MIPSEL__)
110 94
111cflags-$(CONFIG_SB1XXX_CORELIS) += -mno-sched-prolog -fno-omit-frame-pointer 95cflags-$(CONFIG_SB1XXX_CORELIS) += $(call cc-option,-mno-sched-prolog) \
112 96 -fno-omit-frame-pointer
113#
114# Use: $(call set_gccflags,<cpu0>,<isa0>,<cpu1>,<isa1>,<isa2>)
115#
116# <cpu0>,<isa0> -- preferred CPU and ISA designations (may require
117# recent tools)
118# <cpu1>,<isa1> -- fallback CPU and ISA designations (have to work
119# with up to the oldest supported tools)
120# <isa2> -- an ISA designation used as an ABI selector for
121# gcc versions that do not support "-mabi=32"
122# (depending on the CPU type, either "mips1" or
123# "mips2")
124#
125set_gccflags = $(shell \
126while :; do \
127 cpu=$(1); isa=-$(2); \
128 for gcc_opt in -march= -mcpu=; do \
129 $(CC) $$gcc_opt$$cpu $$isa -S -o /dev/null \
130 -xc /dev/null > /dev/null 2>&1 && \
131 break 2; \
132 done; \
133 cpu=$(3); isa=-$(4); \
134 for gcc_opt in -march= -mcpu=; do \
135 $(CC) $$gcc_opt$$cpu $$isa -S -o /dev/null \
136 -xc /dev/null > /dev/null 2>&1 && \
137 break 2; \
138 done; \
139 break; \
140done; \
141gcc_abi=-mabi=$(gcc-abi); gcc_cpu=$$cpu; \
142if $(CC) $$gcc_abi -S -o /dev/null -xc /dev/null > /dev/null 2>&1; then \
143 gcc_isa=$$isa; \
144else \
145 gcc_abi=; gcc_isa=-$(5); \
146fi; \
147gas_abi=-Wa,-$(gcc-abi); gas_cpu=$$cpu; gas_isa=-Wa,$$isa; \
148while :; do \
149 for gas_opt in -Wa,-march= -Wa,-mcpu=; do \
150 $(CC) $$gas_abi $$gas_opt$$cpu $$gas_isa -Wa,-Z -c \
151 -o /dev/null -xassembler /dev/null > /dev/null 2>&1 && \
152 break 2; \
153 done; \
154 gas_abi=; gas_opt=; gas_cpu=; gas_isa=; \
155 break; \
156done; \
157if test "$(gcc-abi)" != "$(gas-abi)"; then \
158 gas_abi="-Wa,-$(gas-abi) -Wa,-mgp$(gcc-abi)"; \
159fi; \
160if test "$$gcc_opt" = -march= && test -n "$$gcc_abi"; then \
161 $(CC) $$gcc_abi $$gcc_opt$$gcc_cpu -S -o /dev/null \
162 -xc /dev/null > /dev/null 2>&1 && \
163 gcc_isa=; \
164fi; \
165echo $$gcc_abi $$gcc_opt$$gcc_cpu $$gcc_isa $$gas_abi $$gas_opt$$gas_cpu $$gas_isa)
166 97
167# 98#
168# CPU-dependent compiler/assembler options for optimization. 99# CPU-dependent compiler/assembler options for optimization.
169# 100#
170cflags-$(CONFIG_CPU_R3000) += \ 101cflags-$(CONFIG_CPU_R3000) += -march=r3000
171 $(call set_gccflags,r3000,mips1,r3000,mips1,mips1) 102cflags-$(CONFIG_CPU_TX39XX) += -march=r3900
172CHECKFLAGS-$(CONFIG_CPU_R3000) += -D_MIPS_ISA=_MIPS_ISA_MIPS1 103cflags-$(CONFIG_CPU_R6000) += -march=r6000 -Wa,--trap
173 104cflags-$(CONFIG_CPU_R4300) += -march=r4300 -Wa,--trap
174cflags-$(CONFIG_CPU_TX39XX) += \ 105cflags-$(CONFIG_CPU_VR41XX) += -march=r4100 -Wa,--trap
175 $(call set_gccflags,r3900,mips1,r3000,mips1,mips1) 106cflags-$(CONFIG_CPU_R4X00) += -march=r4600 -Wa,--trap
176CHECKFLAGS-$(CONFIG_CPU_TX39XX) += -D_MIPS_ISA=_MIPS_ISA_MIPS1 107cflags-$(CONFIG_CPU_TX49XX) += -march=r4600 -Wa,--trap
177 108cflags-$(CONFIG_CPU_MIPS32_R1) += $(call cc-option,-march=mips32,-mips2 -mtune=r4600) \
178cflags-$(CONFIG_CPU_R6000) += \ 109 -Wa,-mips32 -Wa,--trap
179 $(call set_gccflags,r6000,mips2,r6000,mips2,mips2) \ 110cflags-$(CONFIG_CPU_MIPS32_R2) += $(call cc-option,-march=mips32r2,-mips2 -mtune=r4600) \
180 -Wa,--trap 111 -Wa,-mips32r2 -Wa,--trap
181CHECKFLAGS-$(CONFIG_CPU_R6000) += -D_MIPS_ISA=_MIPS_ISA_MIPS2 112cflags-$(CONFIG_CPU_MIPS64_R1) += $(call cc-option,-march=mips64,-mips2 -mtune=r4600) \
182 113 -Wa,-mips64 -Wa,--trap
183cflags-$(CONFIG_CPU_R4300) += \ 114cflags-$(CONFIG_CPU_MIPS64_R2) += $(call cc-option,-march=mips64r2,-mips2 -mtune=r4600 ) \
184 $(call set_gccflags,r4300,mips3,r4300,mips3,mips2) \ 115 -Wa,-mips64r2 -Wa,--trap
116cflags-$(CONFIG_CPU_R5000) += -march=r5000 -Wa,--trap
117cflags-$(CONFIG_CPU_R5432) += $(call cc-options,-march=r5400,-march=r5000) \
185 -Wa,--trap 118 -Wa,--trap
186CHECKFLAGS-$(CONFIG_CPU_R4300) += -D_MIPS_ISA=_MIPS_ISA_MIPS3 119cflags-$(CONFIG_CPU_NEVADA) += $(call cc-options,-march=rm5200,-march=r5000) \
187
188cflags-$(CONFIG_CPU_VR41XX) += \
189 $(call set_gccflags,r4100,mips3,r4600,mips3,mips2) \
190 -Wa,--trap 120 -Wa,--trap
191CHECKFLAGS-$(CONFIG_CPU_VR41XX) += -D_MIPS_ISA=_MIPS_ISA_MIPS3 121cflags-$(CONFIG_CPU_RM7000) += $(call cc-option,-march=rm7000,-march=r5000) \
192
193cflags-$(CONFIG_CPU_R4X00) += \
194 $(call set_gccflags,r4600,mips3,r4600,mips3,mips2) \
195 -Wa,--trap 122 -Wa,--trap
196CHECKFLAGS-$(CONFIG_CPU_R4X00) += -D_MIPS_ISA=_MIPS_ISA_MIPS3 123cflags-$(CONFIG_CPU_RM9000) += $(call cc-option,-march=rm9000,-march=r5000) \
197
198cflags-$(CONFIG_CPU_TX49XX) += \
199 $(call set_gccflags,r4600,mips3,r4600,mips3,mips2) \
200 -Wa,--trap 124 -Wa,--trap
201CHECKFLAGS-$(CONFIG_CPU_TX49XX) += -D_MIPS_ISA=_MIPS_ISA_MIPS3 125cflags-$(CONFIG_CPU_SB1) += $(call cc-option,-march=sb1,-march=r5000) \
202
203cflags-$(CONFIG_CPU_MIPS32_R1) += \
204 $(call set_gccflags,mips32,mips32,r4600,mips3,mips2) \
205 -Wa,--trap 126 -Wa,--trap
206CHECKFLAGS-$(CONFIG_CPU_MIPS32_R1) += -D_MIPS_ISA=_MIPS_ISA_MIPS32 127cflags-$(CONFIG_CPU_R8000) += -march=r8000 -Wa,--trap
207 128cflags-$(CONFIG_CPU_R10000) += $(call cc-option,-march=r10000,-march=r8000) \
208cflags-$(CONFIG_CPU_MIPS32_R2) += \
209 $(call set_gccflags,mips32r2,mips32r2,r4600,mips3,mips2) \
210 -Wa,--trap
211CHECKFLAGS-$(CONFIG_CPU_MIPS32_R2) += -D_MIPS_ISA=_MIPS_ISA_MIPS32
212
213cflags-$(CONFIG_CPU_MIPS64_R1) += \
214 $(call set_gccflags,mips64,mips64,r4600,mips3,mips2) \
215 -Wa,--trap 129 -Wa,--trap
216CHECKFLAGS-$(CONFIG_CPU_MIPS64_R1) += -D_MIPS_ISA=_MIPS_ISA_MIPS64
217
218cflags-$(CONFIG_CPU_MIPS64_R2) += \
219 $(call set_gccflags,mips64r2,mips64r2,r4600,mips3,mips2) \
220 -Wa,--trap
221CHECKFLAGS-$(CONFIG_CPU_MIPS64_R2) += -D_MIPS_ISA=_MIPS_ISA_MIPS64
222
223cflags-$(CONFIG_CPU_R5000) += \
224 $(call set_gccflags,r5000,mips4,r5000,mips4,mips2) \
225 -Wa,--trap
226CHECKFLAGS-$(CONFIG_CPU_R5000) += -D_MIPS_ISA=_MIPS_ISA_MIPS4
227
228cflags-$(CONFIG_CPU_R5432) += \
229 $(call set_gccflags,r5400,mips4,r5000,mips4,mips2) \
230 -Wa,--trap
231CHECKFLAGS-$(CONFIG_CPU_R5432) += -D_MIPS_ISA=_MIPS_ISA_MIPS4
232
233cflags-$(CONFIG_CPU_NEVADA) += \
234 $(call set_gccflags,rm5200,mips4,r5000,mips4,mips2) \
235 -Wa,--trap
236CHECKFLAGS-$(CONFIG_CPU_NEVADA) += -D_MIPS_ISA=_MIPS_ISA_MIPS4
237
238cflags-$(CONFIG_CPU_RM7000) += \
239 $(call set_gccflags,rm7000,mips4,r5000,mips4,mips2) \
240 -Wa,--trap
241CHECKFLAGS-$(CONFIG_CPU_RM7000) += -D_MIPS_ISA=_MIPS_ISA_MIPS4
242
243cflags-$(CONFIG_CPU_RM9000) += \
244 $(call set_gccflags,rm9000,mips4,r5000,mips4,mips2) \
245 -Wa,--trap
246CHECKFLAGS-$(CONFIG_CPU_RM9000) += -D_MIPS_ISA=_MIPS_ISA_MIPS4
247
248
249cflags-$(CONFIG_CPU_SB1) += \
250 $(call set_gccflags,sb1,mips64,r5000,mips4,mips2) \
251 -Wa,--trap
252CHECKFLAGS-$(CONFIG_CPU_SB1) += -D_MIPS_ISA=_MIPS_ISA_MIPS64
253
254cflags-$(CONFIG_CPU_R8000) += \
255 $(call set_gccflags,r8000,mips4,r8000,mips4,mips2) \
256 -Wa,--trap
257CHECKFLAGS-$(CONFIG_CPU_R8000) += -D_MIPS_ISA=_MIPS_ISA_MIPS4
258
259cflags-$(CONFIG_CPU_R10000) += \
260 $(call set_gccflags,r10000,mips4,r8000,mips4,mips2) \
261 -Wa,--trap
262CHECKFLAGS-$(CONFIG_CPU_R10000) += -D_MIPS_ISA=_MIPS_ISA_MIPS4
263 130
264ifdef CONFIG_CPU_SB1 131ifdef CONFIG_CPU_SB1
265ifdef CONFIG_SB1_PASS_1_WORKAROUNDS 132ifdef CONFIG_SB1_PASS_1_WORKAROUNDS
@@ -629,7 +496,6 @@ endif
629ifdef CONFIG_SGI_IP27 496ifdef CONFIG_SGI_IP27
630core-$(CONFIG_SGI_IP27) += arch/mips/sgi-ip27/ 497core-$(CONFIG_SGI_IP27) += arch/mips/sgi-ip27/
631cflags-$(CONFIG_SGI_IP27) += -Iinclude/asm-mips/mach-ip27 498cflags-$(CONFIG_SGI_IP27) += -Iinclude/asm-mips/mach-ip27
632ifdef CONFIG_BUILD_ELF64
633ifdef CONFIG_MAPPED_KERNEL 499ifdef CONFIG_MAPPED_KERNEL
634load-$(CONFIG_SGI_IP27) += 0xc00000004001c000 500load-$(CONFIG_SGI_IP27) += 0xc00000004001c000
635OBJCOPYFLAGS := --change-addresses=0x3fffffff80000000 501OBJCOPYFLAGS := --change-addresses=0x3fffffff80000000
@@ -638,16 +504,6 @@ else
638load-$(CONFIG_SGI_IP27) += 0xa80000000001c000 504load-$(CONFIG_SGI_IP27) += 0xa80000000001c000
639OBJCOPYFLAGS := --change-addresses=0x57ffffff80000000 505OBJCOPYFLAGS := --change-addresses=0x57ffffff80000000
640endif 506endif
641else
642ifdef CONFIG_MAPPED_KERNEL
643load-$(CONFIG_SGI_IP27) += 0xffffffffc001c000
644OBJCOPYFLAGS := --change-addresses=0xc000000080000000
645dataoffset-$(CONFIG_SGI_IP27) += 0x01000000
646else
647load-$(CONFIG_SGI_IP27) += 0xffffffff8001c000
648OBJCOPYFLAGS := --change-addresses=0xa800000080000000
649endif
650endif
651endif 507endif
652 508
653# 509#
@@ -756,6 +612,12 @@ CFLAGS += $(cflags-y)
756 612
757LDFLAGS += -m $(ld-emul) 613LDFLAGS += -m $(ld-emul)
758 614
615ifdef CONFIG_MIPS
616CHECKFLAGS += $(shell $(CC) $(CFLAGS) -dM -E -xc /dev/null | \
617 egrep -vw '__GNUC_(MAJOR|MINOR|PATCHLEVEL)__' | \
618 sed -e 's/^\#define /-D/' -e 's/ /="/' -e 's/$$/"/')
619endif
620
759OBJCOPYFLAGS += --remove-section=.reginfo 621OBJCOPYFLAGS += --remove-section=.reginfo
760 622
761# 623#
diff --git a/arch/mips/arc/memory.c b/arch/mips/arc/memory.c
index 958d2eb78862..8a9ef58cc399 100644
--- a/arch/mips/arc/memory.c
+++ b/arch/mips/arc/memory.c
@@ -158,7 +158,7 @@ unsigned long __init prom_free_prom_memory(void)
158 while (addr < boot_mem_map.map[i].addr 158 while (addr < boot_mem_map.map[i].addr
159 + boot_mem_map.map[i].size) { 159 + boot_mem_map.map[i].size) {
160 ClearPageReserved(virt_to_page(__va(addr))); 160 ClearPageReserved(virt_to_page(__va(addr)));
161 set_page_count(virt_to_page(__va(addr)), 1); 161 init_page_count(virt_to_page(__va(addr)));
162 free_page((unsigned long)__va(addr)); 162 free_page((unsigned long)__va(addr));
163 addr += PAGE_SIZE; 163 addr += PAGE_SIZE;
164 freed += PAGE_SIZE; 164 freed += PAGE_SIZE;
diff --git a/arch/mips/arc/misc.c b/arch/mips/arc/misc.c
index 84867de22028..b2e10b9e9452 100644
--- a/arch/mips/arc/misc.c
+++ b/arch/mips/arc/misc.c
@@ -9,7 +9,6 @@
9 * Copyright (C) 1999 Ralf Baechle (ralf@gnu.org) 9 * Copyright (C) 1999 Ralf Baechle (ralf@gnu.org)
10 * Copyright (C) 1999 Silicon Graphics, Inc. 10 * Copyright (C) 1999 Silicon Graphics, Inc.
11 */ 11 */
12#include <linux/config.h>
13#include <linux/init.h> 12#include <linux/init.h>
14#include <linux/kernel.h> 13#include <linux/kernel.h>
15 14
@@ -20,17 +19,11 @@
20#include <asm/bootinfo.h> 19#include <asm/bootinfo.h>
21#include <asm/system.h> 20#include <asm/system.h>
22 21
23extern void *sgiwd93_host;
24extern void reset_wd33c93(void *instance);
25
26VOID 22VOID
27ArcHalt(VOID) 23ArcHalt(VOID)
28{ 24{
29 bc_disable(); 25 bc_disable();
30 local_irq_disable(); 26 local_irq_disable();
31#ifdef CONFIG_SCSI_SGIWD93
32 reset_wd33c93(sgiwd93_host);
33#endif
34 ARC_CALL0(halt); 27 ARC_CALL0(halt);
35never: goto never; 28never: goto never;
36} 29}
@@ -40,9 +33,6 @@ ArcPowerDown(VOID)
40{ 33{
41 bc_disable(); 34 bc_disable();
42 local_irq_disable(); 35 local_irq_disable();
43#ifdef CONFIG_SCSI_SGIWD93
44 reset_wd33c93(sgiwd93_host);
45#endif
46 ARC_CALL0(pdown); 36 ARC_CALL0(pdown);
47never: goto never; 37never: goto never;
48} 38}
@@ -53,9 +43,6 @@ ArcRestart(VOID)
53{ 43{
54 bc_disable(); 44 bc_disable();
55 local_irq_disable(); 45 local_irq_disable();
56#ifdef CONFIG_SCSI_SGIWD93
57 reset_wd33c93(sgiwd93_host);
58#endif
59 ARC_CALL0(restart); 46 ARC_CALL0(restart);
60never: goto never; 47never: goto never;
61} 48}
@@ -65,9 +52,6 @@ ArcReboot(VOID)
65{ 52{
66 bc_disable(); 53 bc_disable();
67 local_irq_disable(); 54 local_irq_disable();
68#ifdef CONFIG_SCSI_SGIWD93
69 reset_wd33c93(sgiwd93_host);
70#endif
71 ARC_CALL0(reboot); 55 ARC_CALL0(reboot);
72never: goto never; 56never: goto never;
73} 57}
@@ -77,9 +61,6 @@ ArcEnterInteractiveMode(VOID)
77{ 61{
78 bc_disable(); 62 bc_disable();
79 local_irq_disable(); 63 local_irq_disable();
80#ifdef CONFIG_SCSI_SGIWD93
81 reset_wd33c93(sgiwd93_host);
82#endif
83 ARC_CALL0(imode); 64 ARC_CALL0(imode);
84never: goto never; 65never: goto never;
85} 66}
diff --git a/arch/mips/au1000/common/cputable.c b/arch/mips/au1000/common/cputable.c
index 4dbde82c8215..d8df5fdb045f 100644
--- a/arch/mips/au1000/common/cputable.c
+++ b/arch/mips/au1000/common/cputable.c
@@ -38,7 +38,7 @@ struct cpu_spec cpu_specs[] = {
38 { 0xffffffff, 0x02030204, "Au1100 BE", 0, 1 }, 38 { 0xffffffff, 0x02030204, "Au1100 BE", 0, 1 },
39 { 0xffffffff, 0x03030200, "Au1550 AA", 0, 1 }, 39 { 0xffffffff, 0x03030200, "Au1550 AA", 0, 1 },
40 { 0xffffffff, 0x04030200, "Au1200 AB", 0, 0 }, 40 { 0xffffffff, 0x04030200, "Au1200 AB", 0, 0 },
41 { 0xffffffff, 0x04030201, "Au1200 AC", 0, 1 }, 41 { 0xffffffff, 0x04030201, "Au1200 AC", 1, 0 },
42 { 0x00000000, 0x00000000, "Unknown Au1xxx", 1, 0 }, 42 { 0x00000000, 0x00000000, "Unknown Au1xxx", 1, 0 },
43}; 43};
44 44
diff --git a/arch/mips/au1000/common/dbdma.c b/arch/mips/au1000/common/dbdma.c
index d00e8247d6c2..6ee090bd86c9 100644
--- a/arch/mips/au1000/common/dbdma.c
+++ b/arch/mips/au1000/common/dbdma.c
@@ -214,7 +214,7 @@ au1xxx_ddma_add_device(dbdev_tab_t *dev)
214 if ( NULL != p ) 214 if ( NULL != p )
215 { 215 {
216 memcpy(p, dev, sizeof(dbdev_tab_t)); 216 memcpy(p, dev, sizeof(dbdev_tab_t));
217 p->dev_id = DSCR_DEV2CUSTOM_ID(new_id,dev->dev_id); 217 p->dev_id = DSCR_DEV2CUSTOM_ID(new_id,dev->dev_id);
218 ret = p->dev_id; 218 ret = p->dev_id;
219 new_id++; 219 new_id++;
220#if 0 220#if 0
@@ -260,7 +260,7 @@ au1xxx_dbdma_chan_alloc(u32 srcid, u32 destid,
260 spin_lock_irqsave(&au1xxx_dbdma_spin_lock, flags); 260 spin_lock_irqsave(&au1xxx_dbdma_spin_lock, flags);
261 if (!(stp->dev_flags & DEV_FLAGS_INUSE) || 261 if (!(stp->dev_flags & DEV_FLAGS_INUSE) ||
262 (stp->dev_flags & DEV_FLAGS_ANYUSE)) { 262 (stp->dev_flags & DEV_FLAGS_ANYUSE)) {
263 /* Got source */ 263 /* Got source */
264 stp->dev_flags |= DEV_FLAGS_INUSE; 264 stp->dev_flags |= DEV_FLAGS_INUSE;
265 if (!(dtp->dev_flags & DEV_FLAGS_INUSE) || 265 if (!(dtp->dev_flags & DEV_FLAGS_INUSE) ||
266 (dtp->dev_flags & DEV_FLAGS_ANYUSE)) { 266 (dtp->dev_flags & DEV_FLAGS_ANYUSE)) {
diff --git a/arch/mips/au1000/common/dma.c b/arch/mips/au1000/common/dma.c
index 1905c6b104f2..1d82f2277517 100644
--- a/arch/mips/au1000/common/dma.c
+++ b/arch/mips/au1000/common/dma.c
@@ -174,7 +174,7 @@ int request_au1000_dma(int dev_id, const char *dev_str,
174 return -EINVAL; 174 return -EINVAL;
175#else 175#else
176 if (dev_id < 0 || dev_id >= DMA_NUM_DEV) 176 if (dev_id < 0 || dev_id >= DMA_NUM_DEV)
177 return -EINVAL; 177 return -EINVAL;
178#endif 178#endif
179 179
180 for (i = 0; i < NUM_AU1000_DMA_CHANNELS; i++) { 180 for (i = 0; i < NUM_AU1000_DMA_CHANNELS; i++) {
diff --git a/arch/mips/au1000/common/platform.c b/arch/mips/au1000/common/platform.c
index 48d3f54f88f8..32702e5fbf67 100644
--- a/arch/mips/au1000/common/platform.c
+++ b/arch/mips/au1000/common/platform.c
@@ -20,7 +20,7 @@
20static struct resource au1xxx_usb_ohci_resources[] = { 20static struct resource au1xxx_usb_ohci_resources[] = {
21 [0] = { 21 [0] = {
22 .start = USB_OHCI_BASE, 22 .start = USB_OHCI_BASE,
23 .end = USB_OHCI_BASE + USB_OHCI_LEN, 23 .end = USB_OHCI_BASE + USB_OHCI_LEN - 1,
24 .flags = IORESOURCE_MEM, 24 .flags = IORESOURCE_MEM,
25 }, 25 },
26 [1] = { 26 [1] = {
@@ -264,7 +264,7 @@ static struct resource smc91x_resources[] = {
264 264
265static struct platform_device smc91x_device = { 265static struct platform_device smc91x_device = {
266 .name = "smc91x", 266 .name = "smc91x",
267 .id = -1, 267 .id = -1,
268 .num_resources = ARRAY_SIZE(smc91x_resources), 268 .num_resources = ARRAY_SIZE(smc91x_resources),
269 .resource = smc91x_resources, 269 .resource = smc91x_resources,
270}; 270};
@@ -278,9 +278,7 @@ static struct platform_device *au1xxx_platform_devices[] __initdata = {
278 &au1100_lcd_device, 278 &au1100_lcd_device,
279#endif 279#endif
280#ifdef CONFIG_SOC_AU1200 280#ifdef CONFIG_SOC_AU1200
281#if 0 /* fixme */
282 &au1xxx_usb_ehci_device, 281 &au1xxx_usb_ehci_device,
283#endif
284 &au1xxx_usb_gdt_device, 282 &au1xxx_usb_gdt_device,
285 &au1xxx_usb_otg_device, 283 &au1xxx_usb_otg_device,
286 &au1200_lcd_device, 284 &au1200_lcd_device,
@@ -288,7 +286,7 @@ static struct platform_device *au1xxx_platform_devices[] __initdata = {
288 &au1xxx_mmc_device, 286 &au1xxx_mmc_device,
289#endif 287#endif
290#ifdef CONFIG_MIPS_DB1200 288#ifdef CONFIG_MIPS_DB1200
291 &smc91x_device, 289 &smc91x_device,
292#endif 290#endif
293}; 291};
294 292
diff --git a/arch/mips/au1000/common/reset.c b/arch/mips/au1000/common/reset.c
index 4ffccedf5967..c93af224c1b3 100644
--- a/arch/mips/au1000/common/reset.c
+++ b/arch/mips/au1000/common/reset.c
@@ -164,17 +164,20 @@ void au1000_restart(char *command)
164 164
165void au1000_halt(void) 165void au1000_halt(void)
166{ 166{
167#if defined(CONFIG_MIPS_PB1550) 167#if defined(CONFIG_MIPS_PB1550) || defined(CONFIG_MIPS_DB1550)
168 /* power off system */ 168 /* power off system */
169 printk("\n** Powering off Pb1550\n"); 169 printk("\n** Powering off...\n");
170 au_writew(au_readw(0xAF00001C) | (3<<14), 0xAF00001C); 170 au_writew(au_readw(0xAF00001C) | (3<<14), 0xAF00001C);
171 au_sync(); 171 au_sync();
172 while(1); /* should not get here */ 172 while(1); /* should not get here */
173#endif 173#else
174 printk(KERN_NOTICE "\n** You can safely turn off the power\n"); 174 printk(KERN_NOTICE "\n** You can safely turn off the power\n");
175#ifdef CONFIG_MIPS_MIRAGE 175#ifdef CONFIG_MIPS_MIRAGE
176 au_writel((1 << 26) | (1 << 10), GPIO2_OUTPUT); 176 au_writel((1 << 26) | (1 << 10), GPIO2_OUTPUT);
177#endif 177#endif
178#ifdef CONFIG_MIPS_DB1200
179 au_writew(au_readw(0xB980001C) | (1<<14), 0xB980001C);
180#endif
178#ifdef CONFIG_PM 181#ifdef CONFIG_PM
179 au_sleep(); 182 au_sleep();
180 183
@@ -187,6 +190,7 @@ void au1000_halt(void)
187 "wait\n\t" 190 "wait\n\t"
188 ".set\tmips0"); 191 ".set\tmips0");
189#endif 192#endif
193#endif /* defined(CONFIG_MIPS_PB1550) || defined(CONFIG_MIPS_DB1550) */
190} 194}
191 195
192void au1000_power_off(void) 196void au1000_power_off(void)
diff --git a/arch/mips/au1000/common/setup.c b/arch/mips/au1000/common/setup.c
index eb155c071aa6..307e98c29ddc 100644
--- a/arch/mips/au1000/common/setup.c
+++ b/arch/mips/au1000/common/setup.c
@@ -90,11 +90,11 @@ void __init plat_setup(void)
90 else { 90 else {
91 /* Clear to obtain best system bus performance */ 91 /* Clear to obtain best system bus performance */
92 clear_c0_config(1<<19); /* Clear Config[OD] */ 92 clear_c0_config(1<<19); /* Clear Config[OD] */
93 } 93 }
94 94
95 argptr = prom_getcmdline(); 95 argptr = prom_getcmdline();
96 96
97#if defined(CONFIG_SERIAL_AU1X00_CONSOLE) || defined(CONFIG_SERIAL_8250_CONSOLE) 97#ifdef CONFIG_SERIAL_8250_CONSOLE
98 if ((argptr = strstr(argptr, "console=")) == NULL) { 98 if ((argptr = strstr(argptr, "console=")) == NULL) {
99 argptr = prom_getcmdline(); 99 argptr = prom_getcmdline();
100 strcat(argptr, " console=ttyS0,115200"); 100 strcat(argptr, " console=ttyS0,115200");
diff --git a/arch/mips/au1000/common/time.c b/arch/mips/au1000/common/time.c
index 883d3f3d8c53..f85f1524b366 100644
--- a/arch/mips/au1000/common/time.c
+++ b/arch/mips/au1000/common/time.c
@@ -359,7 +359,7 @@ static unsigned long do_fast_cp0_gettimeoffset(void)
359 : "hi", "lo", GCC_REG_ACCUM); 359 : "hi", "lo", GCC_REG_ACCUM);
360 360
361 /* 361 /*
362 * Due to possible jiffies inconsistencies, we need to check 362 * Due to possible jiffies inconsistencies, we need to check
363 * the result so that we'll get a timer that is monotonic. 363 * the result so that we'll get a timer that is monotonic.
364 */ 364 */
365 if (res >= USECS_PER_JIFFY) 365 if (res >= USECS_PER_JIFFY)
diff --git a/arch/mips/cobalt/Kconfig b/arch/mips/cobalt/Kconfig
new file mode 100644
index 000000000000..7c42b088d16c
--- /dev/null
+++ b/arch/mips/cobalt/Kconfig
@@ -0,0 +1,7 @@
1config EARLY_PRINTK
2 bool "Early console support"
3 depends on MIPS_COBALT
4 help
5 Provide early console support by direct access to the
6 on board UART. The UART must have been previously
7 initialised by the boot loader.
diff --git a/arch/mips/cobalt/Makefile b/arch/mips/cobalt/Makefile
index 3b6b7579d1de..720e757b2b64 100644
--- a/arch/mips/cobalt/Makefile
+++ b/arch/mips/cobalt/Makefile
@@ -4,4 +4,6 @@
4 4
5obj-y := irq.o int-handler.o reset.o setup.o 5obj-y := irq.o int-handler.o reset.o setup.o
6 6
7obj-$(CONFIG_EARLY_PRINTK) += console.o
8
7EXTRA_AFLAGS := $(CFLAGS) 9EXTRA_AFLAGS := $(CFLAGS)
diff --git a/arch/mips/cobalt/console.c b/arch/mips/cobalt/console.c
new file mode 100644
index 000000000000..45c2d27c7564
--- /dev/null
+++ b/arch/mips/cobalt/console.c
@@ -0,0 +1,43 @@
1/*
2 * (C) P. Horton 2006
3 */
4
5#include <linux/config.h>
6#include <linux/init.h>
7#include <linux/kernel.h>
8#include <linux/console.h>
9#include <linux/serial_reg.h>
10#include <asm/addrspace.h>
11#include <asm/mach-cobalt/cobalt.h>
12
13static void putchar(int c)
14{
15 if(c == '\n')
16 putchar('\r');
17
18 while(!(COBALT_UART[UART_LSR] & UART_LSR_THRE))
19 ;
20
21 COBALT_UART[UART_TX] = c;
22}
23
24static void cons_write(struct console *c, const char *s, unsigned n)
25{
26 while(n-- && *s)
27 putchar(*s++);
28}
29
30static struct console cons_info =
31{
32 .name = "uart",
33 .write = cons_write,
34 .flags = CON_PRINTBUFFER | CON_BOOT,
35 .index = -1,
36};
37
38void __init cobalt_early_console(void)
39{
40 register_console(&cons_info);
41
42 printk("Cobalt: early console registered\n");
43}
diff --git a/arch/mips/cobalt/setup.c b/arch/mips/cobalt/setup.c
index b9713a723053..4f9ea1210023 100644
--- a/arch/mips/cobalt/setup.c
+++ b/arch/mips/cobalt/setup.c
@@ -31,6 +31,7 @@
31extern void cobalt_machine_restart(char *command); 31extern void cobalt_machine_restart(char *command);
32extern void cobalt_machine_halt(void); 32extern void cobalt_machine_halt(void);
33extern void cobalt_machine_power_off(void); 33extern void cobalt_machine_power_off(void);
34extern void cobalt_early_console(void);
34 35
35int cobalt_board_id; 36int cobalt_board_id;
36 37
@@ -109,14 +110,6 @@ void __init plat_setup(void)
109 /* I/O port resource must include UART and LCD/buttons */ 110 /* I/O port resource must include UART and LCD/buttons */
110 ioport_resource.end = 0x0fffffff; 111 ioport_resource.end = 0x0fffffff;
111 112
112 /*
113 * This is a prom style console. We just poke at the
114 * UART to make it talk.
115 * Only use this console if you really screw up and can't
116 * get to the stage of setting up a real serial console.
117 */
118 /*ns16550_setup_console();*/
119
120 /* request I/O space for devices used on all i[345]86 PCs */ 113 /* request I/O space for devices used on all i[345]86 PCs */
121 for (i = 0; i < COBALT_IO_RESOURCES; i++) 114 for (i = 0; i < COBALT_IO_RESOURCES; i++)
122 request_resource(&ioport_resource, cobalt_io_resources + i); 115 request_resource(&ioport_resource, cobalt_io_resources + i);
@@ -136,6 +129,10 @@ void __init plat_setup(void)
136#ifdef CONFIG_SERIAL_8250 129#ifdef CONFIG_SERIAL_8250
137 if (cobalt_board_id > COBALT_BRD_ID_RAQ1) { 130 if (cobalt_board_id > COBALT_BRD_ID_RAQ1) {
138 131
132#ifdef CONFIG_EARLY_PRINTK
133 cobalt_early_console();
134#endif
135
139 uart.line = 0; 136 uart.line = 0;
140 uart.type = PORT_UNKNOWN; 137 uart.type = PORT_UNKNOWN;
141 uart.uartclk = 18432000; 138 uart.uartclk = 18432000;
diff --git a/arch/mips/configs/atlas_defconfig b/arch/mips/configs/atlas_defconfig
index 89c21572a59c..9e1ae953e966 100644
--- a/arch/mips/configs/atlas_defconfig
+++ b/arch/mips/configs/atlas_defconfig
@@ -1,7 +1,7 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.15-rc2 3# Linux kernel version: 2.6.16-rc1
4# Thu Nov 24 01:05:52 2005 4# Fri Jan 27 15:39:52 2006
5# 5#
6CONFIG_MIPS=y 6CONFIG_MIPS=y
7 7
@@ -164,26 +164,28 @@ CONFIG_SYSVIPC=y
164# CONFIG_BSD_PROCESS_ACCT is not set 164# CONFIG_BSD_PROCESS_ACCT is not set
165CONFIG_SYSCTL=y 165CONFIG_SYSCTL=y
166# CONFIG_AUDIT is not set 166# CONFIG_AUDIT is not set
167CONFIG_HOTPLUG=y
168CONFIG_KOBJECT_UEVENT=y
169# CONFIG_IKCONFIG is not set 167# CONFIG_IKCONFIG is not set
170CONFIG_INITRAMFS_SOURCE="" 168CONFIG_INITRAMFS_SOURCE=""
169# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
171CONFIG_EMBEDDED=y 170CONFIG_EMBEDDED=y
172CONFIG_KALLSYMS=y 171CONFIG_KALLSYMS=y
173# CONFIG_KALLSYMS_EXTRA_PASS is not set 172# CONFIG_KALLSYMS_EXTRA_PASS is not set
173CONFIG_HOTPLUG=y
174CONFIG_PRINTK=y 174CONFIG_PRINTK=y
175CONFIG_BUG=y 175CONFIG_BUG=y
176CONFIG_ELF_CORE=y
176CONFIG_BASE_FULL=y 177CONFIG_BASE_FULL=y
177CONFIG_FUTEX=y 178CONFIG_FUTEX=y
178CONFIG_EPOLL=y 179CONFIG_EPOLL=y
179# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
180CONFIG_SHMEM=y 180CONFIG_SHMEM=y
181CONFIG_CC_ALIGN_FUNCTIONS=0 181CONFIG_CC_ALIGN_FUNCTIONS=0
182CONFIG_CC_ALIGN_LABELS=0 182CONFIG_CC_ALIGN_LABELS=0
183CONFIG_CC_ALIGN_LOOPS=0 183CONFIG_CC_ALIGN_LOOPS=0
184CONFIG_CC_ALIGN_JUMPS=0 184CONFIG_CC_ALIGN_JUMPS=0
185CONFIG_SLAB=y
185# CONFIG_TINY_SHMEM is not set 186# CONFIG_TINY_SHMEM is not set
186CONFIG_BASE_SMALL=0 187CONFIG_BASE_SMALL=0
188# CONFIG_SLOB is not set
187 189
188# 190#
189# Loadable module support 191# Loadable module support
@@ -335,6 +337,29 @@ CONFIG_BRIDGE_NETFILTER=y
335CONFIG_NETFILTER_NETLINK=m 337CONFIG_NETFILTER_NETLINK=m
336CONFIG_NETFILTER_NETLINK_QUEUE=m 338CONFIG_NETFILTER_NETLINK_QUEUE=m
337CONFIG_NETFILTER_NETLINK_LOG=m 339CONFIG_NETFILTER_NETLINK_LOG=m
340CONFIG_NETFILTER_XTABLES=m
341CONFIG_NETFILTER_XT_TARGET_CLASSIFY=m
342CONFIG_NETFILTER_XT_TARGET_CONNMARK=m
343CONFIG_NETFILTER_XT_TARGET_MARK=m
344CONFIG_NETFILTER_XT_TARGET_NFQUEUE=m
345CONFIG_NETFILTER_XT_TARGET_NOTRACK=m
346CONFIG_NETFILTER_XT_MATCH_COMMENT=m
347CONFIG_NETFILTER_XT_MATCH_CONNBYTES=m
348CONFIG_NETFILTER_XT_MATCH_CONNMARK=m
349CONFIG_NETFILTER_XT_MATCH_CONNTRACK=m
350CONFIG_NETFILTER_XT_MATCH_DCCP=m
351CONFIG_NETFILTER_XT_MATCH_HELPER=m
352CONFIG_NETFILTER_XT_MATCH_LENGTH=m
353CONFIG_NETFILTER_XT_MATCH_LIMIT=m
354CONFIG_NETFILTER_XT_MATCH_MAC=m
355CONFIG_NETFILTER_XT_MATCH_MARK=m
356CONFIG_NETFILTER_XT_MATCH_PHYSDEV=m
357CONFIG_NETFILTER_XT_MATCH_PKTTYPE=m
358CONFIG_NETFILTER_XT_MATCH_REALM=m
359CONFIG_NETFILTER_XT_MATCH_SCTP=m
360CONFIG_NETFILTER_XT_MATCH_STATE=m
361CONFIG_NETFILTER_XT_MATCH_STRING=m
362CONFIG_NETFILTER_XT_MATCH_TCPMSS=m
338 363
339# 364#
340# IP: Netfilter Configuration 365# IP: Netfilter Configuration
@@ -353,47 +378,30 @@ CONFIG_IP_NF_AMANDA=m
353CONFIG_IP_NF_PPTP=m 378CONFIG_IP_NF_PPTP=m
354CONFIG_IP_NF_QUEUE=m 379CONFIG_IP_NF_QUEUE=m
355CONFIG_IP_NF_IPTABLES=m 380CONFIG_IP_NF_IPTABLES=m
356CONFIG_IP_NF_MATCH_LIMIT=m
357CONFIG_IP_NF_MATCH_IPRANGE=m 381CONFIG_IP_NF_MATCH_IPRANGE=m
358CONFIG_IP_NF_MATCH_MAC=m
359CONFIG_IP_NF_MATCH_PKTTYPE=m
360CONFIG_IP_NF_MATCH_MARK=m
361CONFIG_IP_NF_MATCH_MULTIPORT=m 382CONFIG_IP_NF_MATCH_MULTIPORT=m
362CONFIG_IP_NF_MATCH_TOS=m 383CONFIG_IP_NF_MATCH_TOS=m
363CONFIG_IP_NF_MATCH_RECENT=m 384CONFIG_IP_NF_MATCH_RECENT=m
364CONFIG_IP_NF_MATCH_ECN=m 385CONFIG_IP_NF_MATCH_ECN=m
365CONFIG_IP_NF_MATCH_DSCP=m 386CONFIG_IP_NF_MATCH_DSCP=m
366CONFIG_IP_NF_MATCH_AH_ESP=m 387CONFIG_IP_NF_MATCH_AH_ESP=m
367CONFIG_IP_NF_MATCH_LENGTH=m
368CONFIG_IP_NF_MATCH_TTL=m 388CONFIG_IP_NF_MATCH_TTL=m
369CONFIG_IP_NF_MATCH_TCPMSS=m
370CONFIG_IP_NF_MATCH_HELPER=m
371CONFIG_IP_NF_MATCH_STATE=m
372CONFIG_IP_NF_MATCH_CONNTRACK=m
373CONFIG_IP_NF_MATCH_OWNER=m 389CONFIG_IP_NF_MATCH_OWNER=m
374CONFIG_IP_NF_MATCH_PHYSDEV=m
375CONFIG_IP_NF_MATCH_ADDRTYPE=m 390CONFIG_IP_NF_MATCH_ADDRTYPE=m
376CONFIG_IP_NF_MATCH_REALM=m
377CONFIG_IP_NF_MATCH_SCTP=m
378CONFIG_IP_NF_MATCH_DCCP=m
379CONFIG_IP_NF_MATCH_COMMENT=m
380CONFIG_IP_NF_MATCH_CONNMARK=m
381CONFIG_IP_NF_MATCH_CONNBYTES=m
382CONFIG_IP_NF_MATCH_HASHLIMIT=m 391CONFIG_IP_NF_MATCH_HASHLIMIT=m
383CONFIG_IP_NF_MATCH_STRING=m 392CONFIG_IP_NF_MATCH_POLICY=m
384CONFIG_IP_NF_FILTER=m 393CONFIG_IP_NF_FILTER=m
385CONFIG_IP_NF_TARGET_REJECT=m 394CONFIG_IP_NF_TARGET_REJECT=m
386CONFIG_IP_NF_TARGET_LOG=m 395CONFIG_IP_NF_TARGET_LOG=m
387CONFIG_IP_NF_TARGET_ULOG=m 396CONFIG_IP_NF_TARGET_ULOG=m
388CONFIG_IP_NF_TARGET_TCPMSS=m 397CONFIG_IP_NF_TARGET_TCPMSS=m
389CONFIG_IP_NF_TARGET_NFQUEUE=m
390CONFIG_IP_NF_NAT=m 398CONFIG_IP_NF_NAT=m
391CONFIG_IP_NF_NAT_NEEDED=y 399CONFIG_IP_NF_NAT_NEEDED=y
392CONFIG_IP_NF_TARGET_MASQUERADE=m 400CONFIG_IP_NF_TARGET_MASQUERADE=m
393CONFIG_IP_NF_TARGET_REDIRECT=m 401CONFIG_IP_NF_TARGET_REDIRECT=m
394CONFIG_IP_NF_TARGET_NETMAP=m 402CONFIG_IP_NF_TARGET_NETMAP=m
395CONFIG_IP_NF_TARGET_SAME=m 403CONFIG_IP_NF_TARGET_SAME=m
396CONFIG_IP_NF_NAT_SNMP_BASIC=m 404# CONFIG_IP_NF_NAT_SNMP_BASIC is not set
397CONFIG_IP_NF_NAT_IRC=m 405CONFIG_IP_NF_NAT_IRC=m
398CONFIG_IP_NF_NAT_FTP=m 406CONFIG_IP_NF_NAT_FTP=m
399CONFIG_IP_NF_NAT_TFTP=m 407CONFIG_IP_NF_NAT_TFTP=m
@@ -403,13 +411,9 @@ CONFIG_IP_NF_MANGLE=m
403CONFIG_IP_NF_TARGET_TOS=m 411CONFIG_IP_NF_TARGET_TOS=m
404CONFIG_IP_NF_TARGET_ECN=m 412CONFIG_IP_NF_TARGET_ECN=m
405CONFIG_IP_NF_TARGET_DSCP=m 413CONFIG_IP_NF_TARGET_DSCP=m
406CONFIG_IP_NF_TARGET_MARK=m
407CONFIG_IP_NF_TARGET_CLASSIFY=m
408CONFIG_IP_NF_TARGET_TTL=m 414CONFIG_IP_NF_TARGET_TTL=m
409CONFIG_IP_NF_TARGET_CONNMARK=m 415# CONFIG_IP_NF_TARGET_CLUSTERIP is not set
410CONFIG_IP_NF_TARGET_CLUSTERIP=m
411CONFIG_IP_NF_RAW=m 416CONFIG_IP_NF_RAW=m
412CONFIG_IP_NF_TARGET_NOTRACK=m
413CONFIG_IP_NF_ARPTABLES=m 417CONFIG_IP_NF_ARPTABLES=m
414CONFIG_IP_NF_ARPFILTER=m 418CONFIG_IP_NF_ARPFILTER=m
415CONFIG_IP_NF_ARP_MANGLE=m 419CONFIG_IP_NF_ARP_MANGLE=m
@@ -419,26 +423,20 @@ CONFIG_IP_NF_ARP_MANGLE=m
419# 423#
420CONFIG_IP6_NF_QUEUE=m 424CONFIG_IP6_NF_QUEUE=m
421CONFIG_IP6_NF_IPTABLES=m 425CONFIG_IP6_NF_IPTABLES=m
422CONFIG_IP6_NF_MATCH_LIMIT=m
423CONFIG_IP6_NF_MATCH_MAC=m
424CONFIG_IP6_NF_MATCH_RT=m 426CONFIG_IP6_NF_MATCH_RT=m
425CONFIG_IP6_NF_MATCH_OPTS=m 427CONFIG_IP6_NF_MATCH_OPTS=m
426CONFIG_IP6_NF_MATCH_FRAG=m 428CONFIG_IP6_NF_MATCH_FRAG=m
427CONFIG_IP6_NF_MATCH_HL=m 429CONFIG_IP6_NF_MATCH_HL=m
428CONFIG_IP6_NF_MATCH_MULTIPORT=m 430CONFIG_IP6_NF_MATCH_MULTIPORT=m
429CONFIG_IP6_NF_MATCH_OWNER=m 431CONFIG_IP6_NF_MATCH_OWNER=m
430CONFIG_IP6_NF_MATCH_MARK=m
431CONFIG_IP6_NF_MATCH_IPV6HEADER=m 432CONFIG_IP6_NF_MATCH_IPV6HEADER=m
432CONFIG_IP6_NF_MATCH_AHESP=m 433CONFIG_IP6_NF_MATCH_AHESP=m
433CONFIG_IP6_NF_MATCH_LENGTH=m
434CONFIG_IP6_NF_MATCH_EUI64=m 434CONFIG_IP6_NF_MATCH_EUI64=m
435CONFIG_IP6_NF_MATCH_PHYSDEV=m 435CONFIG_IP6_NF_MATCH_POLICY=m
436CONFIG_IP6_NF_FILTER=m 436CONFIG_IP6_NF_FILTER=m
437CONFIG_IP6_NF_TARGET_LOG=m 437CONFIG_IP6_NF_TARGET_LOG=m
438CONFIG_IP6_NF_TARGET_REJECT=m 438CONFIG_IP6_NF_TARGET_REJECT=m
439CONFIG_IP6_NF_TARGET_NFQUEUE=m
440CONFIG_IP6_NF_MANGLE=m 439CONFIG_IP6_NF_MANGLE=m
441CONFIG_IP6_NF_TARGET_MARK=m
442CONFIG_IP6_NF_TARGET_HL=m 440CONFIG_IP6_NF_TARGET_HL=m
443CONFIG_IP6_NF_RAW=m 441CONFIG_IP6_NF_RAW=m
444 442
@@ -494,6 +492,11 @@ CONFIG_IPDDP_ENCAP=y
494CONFIG_IPDDP_DECAP=y 492CONFIG_IPDDP_DECAP=y
495# CONFIG_X25 is not set 493# CONFIG_X25 is not set
496# CONFIG_LAPB is not set 494# CONFIG_LAPB is not set
495
496#
497# TIPC Configuration (EXPERIMENTAL)
498#
499# CONFIG_TIPC is not set
497CONFIG_NET_DIVERT=y 500CONFIG_NET_DIVERT=y
498# CONFIG_ECONET is not set 501# CONFIG_ECONET is not set
499# CONFIG_WAN_ROUTER is not set 502# CONFIG_WAN_ROUTER is not set
@@ -553,7 +556,6 @@ CONFIG_IEEE80211=m
553# CONFIG_IEEE80211_DEBUG is not set 556# CONFIG_IEEE80211_DEBUG is not set
554CONFIG_IEEE80211_CRYPT_WEP=m 557CONFIG_IEEE80211_CRYPT_WEP=m
555CONFIG_IEEE80211_CRYPT_CCMP=m 558CONFIG_IEEE80211_CRYPT_CCMP=m
556CONFIG_IEEE80211_CRYPT_TKIP=m
557 559
558# 560#
559# Device Drivers 561# Device Drivers
@@ -663,7 +665,7 @@ CONFIG_SCSI_LOGGING=y
663# SCSI Transport Attributes 665# SCSI Transport Attributes
664# 666#
665CONFIG_SCSI_SPI_ATTRS=y 667CONFIG_SCSI_SPI_ATTRS=y
666CONFIG_SCSI_FC_ATTRS=m 668CONFIG_SCSI_FC_ATTRS=y
667CONFIG_SCSI_ISCSI_ATTRS=m 669CONFIG_SCSI_ISCSI_ATTRS=m
668CONFIG_SCSI_SAS_ATTRS=m 670CONFIG_SCSI_SAS_ATTRS=m
669 671
@@ -696,13 +698,7 @@ CONFIG_SCSI_SYM53C8XX_MAX_TAGS=64
696# CONFIG_SCSI_IPR is not set 698# CONFIG_SCSI_IPR is not set
697# CONFIG_SCSI_QLOGIC_FC is not set 699# CONFIG_SCSI_QLOGIC_FC is not set
698# CONFIG_SCSI_QLOGIC_1280 is not set 700# CONFIG_SCSI_QLOGIC_1280 is not set
699CONFIG_SCSI_QLA2XXX=y 701# CONFIG_SCSI_QLA_FC is not set
700# CONFIG_SCSI_QLA21XX is not set
701# CONFIG_SCSI_QLA22XX is not set
702# CONFIG_SCSI_QLA2300 is not set
703# CONFIG_SCSI_QLA2322 is not set
704# CONFIG_SCSI_QLA6312 is not set
705# CONFIG_SCSI_QLA24XX is not set
706# CONFIG_SCSI_LPFC is not set 702# CONFIG_SCSI_LPFC is not set
707# CONFIG_SCSI_DC395x is not set 703# CONFIG_SCSI_DC395x is not set
708# CONFIG_SCSI_DC390T is not set 704# CONFIG_SCSI_DC390T is not set
@@ -785,6 +781,7 @@ CONFIG_MII=y
785# CONFIG_SUNGEM is not set 781# CONFIG_SUNGEM is not set
786# CONFIG_CASSINI is not set 782# CONFIG_CASSINI is not set
787# CONFIG_NET_VENDOR_3COM is not set 783# CONFIG_NET_VENDOR_3COM is not set
784# CONFIG_DM9000 is not set
788 785
789# 786#
790# Tulip family network device support 787# Tulip family network device support
@@ -824,6 +821,7 @@ CONFIG_LAN_SAA9730=y
824# CONFIG_R8169 is not set 821# CONFIG_R8169 is not set
825# CONFIG_SIS190 is not set 822# CONFIG_SIS190 is not set
826# CONFIG_SKGE is not set 823# CONFIG_SKGE is not set
824# CONFIG_SKY2 is not set
827# CONFIG_SK98LIN is not set 825# CONFIG_SK98LIN is not set
828# CONFIG_VIA_VELOCITY is not set 826# CONFIG_VIA_VELOCITY is not set
829# CONFIG_TIGON3 is not set 827# CONFIG_TIGON3 is not set
@@ -845,8 +843,6 @@ CONFIG_LAN_SAA9730=y
845# Wireless LAN (non-hamradio) 843# Wireless LAN (non-hamradio)
846# 844#
847# CONFIG_NET_RADIO is not set 845# CONFIG_NET_RADIO is not set
848# CONFIG_IPW_DEBUG is not set
849CONFIG_IPW2200=m
850 846
851# 847#
852# Wan interfaces 848# Wan interfaces
@@ -926,6 +922,7 @@ CONFIG_HW_CONSOLE=y
926CONFIG_SERIAL_8250=y 922CONFIG_SERIAL_8250=y
927CONFIG_SERIAL_8250_CONSOLE=y 923CONFIG_SERIAL_8250_CONSOLE=y
928CONFIG_SERIAL_8250_NR_UARTS=4 924CONFIG_SERIAL_8250_NR_UARTS=4
925CONFIG_SERIAL_8250_RUNTIME_UARTS=4
929# CONFIG_SERIAL_8250_EXTENDED is not set 926# CONFIG_SERIAL_8250_EXTENDED is not set
930 927
931# 928#
@@ -933,7 +930,6 @@ CONFIG_SERIAL_8250_NR_UARTS=4
933# 930#
934CONFIG_SERIAL_CORE=y 931CONFIG_SERIAL_CORE=y
935CONFIG_SERIAL_CORE_CONSOLE=y 932CONFIG_SERIAL_CORE_CONSOLE=y
936# CONFIG_SERIAL_JSM is not set
937CONFIG_UNIX98_PTYS=y 933CONFIG_UNIX98_PTYS=y
938CONFIG_LEGACY_PTYS=y 934CONFIG_LEGACY_PTYS=y
939CONFIG_LEGACY_PTY_COUNT=256 935CONFIG_LEGACY_PTY_COUNT=256
@@ -971,6 +967,12 @@ CONFIG_LEGACY_PTY_COUNT=256
971# CONFIG_I2C is not set 967# CONFIG_I2C is not set
972 968
973# 969#
970# SPI support
971#
972# CONFIG_SPI is not set
973# CONFIG_SPI_MASTER is not set
974
975#
974# Dallas's 1-wire bus 976# Dallas's 1-wire bus
975# 977#
976# CONFIG_W1 is not set 978# CONFIG_W1 is not set
@@ -1076,6 +1078,7 @@ CONFIG_XFS_QUOTA=y
1076CONFIG_XFS_SECURITY=y 1078CONFIG_XFS_SECURITY=y
1077CONFIG_XFS_POSIX_ACL=y 1079CONFIG_XFS_POSIX_ACL=y
1078# CONFIG_XFS_RT is not set 1080# CONFIG_XFS_RT is not set
1081# CONFIG_OCFS2_FS is not set
1079CONFIG_MINIX_FS=m 1082CONFIG_MINIX_FS=m
1080CONFIG_ROMFS_FS=m 1083CONFIG_ROMFS_FS=m
1081CONFIG_INOTIFY=y 1084CONFIG_INOTIFY=y
@@ -1118,6 +1121,7 @@ CONFIG_SYSFS=y
1118# CONFIG_HUGETLB_PAGE is not set 1121# CONFIG_HUGETLB_PAGE is not set
1119CONFIG_RAMFS=y 1122CONFIG_RAMFS=y
1120CONFIG_RELAYFS_FS=m 1123CONFIG_RELAYFS_FS=m
1124# CONFIG_CONFIGFS_FS is not set
1121 1125
1122# 1126#
1123# Miscellaneous filesystems 1127# Miscellaneous filesystems
@@ -1225,6 +1229,7 @@ CONFIG_NLS_UTF8=m
1225# Kernel hacking 1229# Kernel hacking
1226# 1230#
1227# CONFIG_PRINTK_TIME is not set 1231# CONFIG_PRINTK_TIME is not set
1232# CONFIG_MAGIC_SYSRQ is not set
1228# CONFIG_DEBUG_KERNEL is not set 1233# CONFIG_DEBUG_KERNEL is not set
1229CONFIG_LOG_BUF_SHIFT=14 1234CONFIG_LOG_BUF_SHIFT=14
1230CONFIG_CROSSCOMPILE=y 1235CONFIG_CROSSCOMPILE=y
diff --git a/arch/mips/configs/bigsur_defconfig b/arch/mips/configs/bigsur_defconfig
index 6fd353779813..32984100a75e 100644
--- a/arch/mips/configs/bigsur_defconfig
+++ b/arch/mips/configs/bigsur_defconfig
@@ -1,7 +1,7 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.15-rc2 3# Linux kernel version: 2.6.16-rc1
4# Thu Nov 24 01:05:54 2005 4# Fri Jan 27 15:39:53 2006
5# 5#
6CONFIG_MIPS=y 6CONFIG_MIPS=y
7 7
@@ -169,29 +169,31 @@ CONFIG_SYSVIPC=y
169# CONFIG_BSD_PROCESS_ACCT is not set 169# CONFIG_BSD_PROCESS_ACCT is not set
170CONFIG_SYSCTL=y 170CONFIG_SYSCTL=y
171# CONFIG_AUDIT is not set 171# CONFIG_AUDIT is not set
172# CONFIG_HOTPLUG is not set
173CONFIG_KOBJECT_UEVENT=y
174CONFIG_IKCONFIG=y 172CONFIG_IKCONFIG=y
175CONFIG_IKCONFIG_PROC=y 173CONFIG_IKCONFIG_PROC=y
176# CONFIG_CPUSETS is not set 174# CONFIG_CPUSETS is not set
177CONFIG_INITRAMFS_SOURCE="" 175CONFIG_INITRAMFS_SOURCE=""
176# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
178CONFIG_EMBEDDED=y 177CONFIG_EMBEDDED=y
179CONFIG_KALLSYMS=y 178CONFIG_KALLSYMS=y
180# CONFIG_KALLSYMS_ALL is not set 179# CONFIG_KALLSYMS_ALL is not set
181# CONFIG_KALLSYMS_EXTRA_PASS is not set 180# CONFIG_KALLSYMS_EXTRA_PASS is not set
181# CONFIG_HOTPLUG is not set
182CONFIG_PRINTK=y 182CONFIG_PRINTK=y
183CONFIG_BUG=y 183CONFIG_BUG=y
184CONFIG_ELF_CORE=y
184CONFIG_BASE_FULL=y 185CONFIG_BASE_FULL=y
185CONFIG_FUTEX=y 186CONFIG_FUTEX=y
186CONFIG_EPOLL=y 187CONFIG_EPOLL=y
187# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
188CONFIG_SHMEM=y 188CONFIG_SHMEM=y
189CONFIG_CC_ALIGN_FUNCTIONS=0 189CONFIG_CC_ALIGN_FUNCTIONS=0
190CONFIG_CC_ALIGN_LABELS=0 190CONFIG_CC_ALIGN_LABELS=0
191CONFIG_CC_ALIGN_LOOPS=0 191CONFIG_CC_ALIGN_LOOPS=0
192CONFIG_CC_ALIGN_JUMPS=0 192CONFIG_CC_ALIGN_JUMPS=0
193CONFIG_SLAB=y
193# CONFIG_TINY_SHMEM is not set 194# CONFIG_TINY_SHMEM is not set
194CONFIG_BASE_SMALL=0 195CONFIG_BASE_SMALL=0
196# CONFIG_SLOB is not set
195 197
196# 198#
197# Loadable module support 199# Loadable module support
@@ -247,7 +249,6 @@ CONFIG_MMU=y
247# 249#
248CONFIG_BINFMT_ELF=y 250CONFIG_BINFMT_ELF=y
249# CONFIG_BINFMT_MISC is not set 251# CONFIG_BINFMT_MISC is not set
250CONFIG_BUILD_ELF64=y
251CONFIG_MIPS32_COMPAT=y 252CONFIG_MIPS32_COMPAT=y
252CONFIG_COMPAT=y 253CONFIG_COMPAT=y
253CONFIG_MIPS32_O32=y 254CONFIG_MIPS32_O32=y
@@ -309,6 +310,11 @@ CONFIG_TCP_CONG_BIC=y
309# CONFIG_ATALK is not set 310# CONFIG_ATALK is not set
310# CONFIG_X25 is not set 311# CONFIG_X25 is not set
311# CONFIG_LAPB is not set 312# CONFIG_LAPB is not set
313
314#
315# TIPC Configuration (EXPERIMENTAL)
316#
317# CONFIG_TIPC is not set
312# CONFIG_NET_DIVERT is not set 318# CONFIG_NET_DIVERT is not set
313# CONFIG_ECONET is not set 319# CONFIG_ECONET is not set
314# CONFIG_WAN_ROUTER is not set 320# CONFIG_WAN_ROUTER is not set
@@ -457,6 +463,7 @@ CONFIG_MII=y
457# CONFIG_SUNGEM is not set 463# CONFIG_SUNGEM is not set
458# CONFIG_CASSINI is not set 464# CONFIG_CASSINI is not set
459# CONFIG_NET_VENDOR_3COM is not set 465# CONFIG_NET_VENDOR_3COM is not set
466# CONFIG_DM9000 is not set
460 467
461# 468#
462# Tulip family network device support 469# Tulip family network device support
@@ -478,6 +485,7 @@ CONFIG_MII=y
478CONFIG_NET_SB1250_MAC=y 485CONFIG_NET_SB1250_MAC=y
479# CONFIG_SIS190 is not set 486# CONFIG_SIS190 is not set
480# CONFIG_SKGE is not set 487# CONFIG_SKGE is not set
488# CONFIG_SKY2 is not set
481# CONFIG_SK98LIN is not set 489# CONFIG_SK98LIN is not set
482# CONFIG_TIGON3 is not set 490# CONFIG_TIGON3 is not set
483# CONFIG_BNX2 is not set 491# CONFIG_BNX2 is not set
@@ -543,12 +551,15 @@ CONFIG_SERIO_RAW=m
543# 551#
544# CONFIG_VT is not set 552# CONFIG_VT is not set
545CONFIG_SERIAL_NONSTANDARD=y 553CONFIG_SERIAL_NONSTANDARD=y
554# CONFIG_COMPUTONE is not set
546# CONFIG_ROCKETPORT is not set 555# CONFIG_ROCKETPORT is not set
547# CONFIG_CYCLADES is not set 556# CONFIG_CYCLADES is not set
548# CONFIG_DIGIEPCA is not set 557# CONFIG_DIGIEPCA is not set
558# CONFIG_MOXA_INTELLIO is not set
549# CONFIG_MOXA_SMARTIO is not set 559# CONFIG_MOXA_SMARTIO is not set
550# CONFIG_ISI is not set 560# CONFIG_ISI is not set
551# CONFIG_SYNCLINKMP is not set 561# CONFIG_SYNCLINKMP is not set
562# CONFIG_SYNCLINK_GT is not set
552# CONFIG_N_HDLC is not set 563# CONFIG_N_HDLC is not set
553# CONFIG_SPECIALIX is not set 564# CONFIG_SPECIALIX is not set
554# CONFIG_SX is not set 565# CONFIG_SX is not set
@@ -564,7 +575,6 @@ CONFIG_SIBYTE_SB1250_DUART_CONSOLE=y
564# 575#
565# Non-8250 serial port support 576# Non-8250 serial port support
566# 577#
567# CONFIG_SERIAL_JSM is not set
568CONFIG_UNIX98_PTYS=y 578CONFIG_UNIX98_PTYS=y
569CONFIG_LEGACY_PTYS=y 579CONFIG_LEGACY_PTYS=y
570CONFIG_LEGACY_PTY_COUNT=256 580CONFIG_LEGACY_PTY_COUNT=256
@@ -655,6 +665,12 @@ CONFIG_I2C_DEBUG_BUS=y
655CONFIG_I2C_DEBUG_CHIP=y 665CONFIG_I2C_DEBUG_CHIP=y
656 666
657# 667#
668# SPI support
669#
670# CONFIG_SPI is not set
671# CONFIG_SPI_MASTER is not set
672
673#
658# Dallas's 1-wire bus 674# Dallas's 1-wire bus
659# 675#
660# CONFIG_W1 is not set 676# CONFIG_W1 is not set
@@ -732,12 +748,12 @@ CONFIG_EXT2_FS_POSIX_ACL=y
732CONFIG_EXT2_FS_SECURITY=y 748CONFIG_EXT2_FS_SECURITY=y
733# CONFIG_EXT2_FS_XIP is not set 749# CONFIG_EXT2_FS_XIP is not set
734# CONFIG_EXT3_FS is not set 750# CONFIG_EXT3_FS is not set
735# CONFIG_JBD is not set
736CONFIG_FS_MBCACHE=y 751CONFIG_FS_MBCACHE=y
737# CONFIG_REISERFS_FS is not set 752# CONFIG_REISERFS_FS is not set
738# CONFIG_JFS_FS is not set 753# CONFIG_JFS_FS is not set
739CONFIG_FS_POSIX_ACL=y 754CONFIG_FS_POSIX_ACL=y
740# CONFIG_XFS_FS is not set 755# CONFIG_XFS_FS is not set
756# CONFIG_OCFS2_FS is not set
741# CONFIG_MINIX_FS is not set 757# CONFIG_MINIX_FS is not set
742# CONFIG_ROMFS_FS is not set 758# CONFIG_ROMFS_FS is not set
743CONFIG_INOTIFY=y 759CONFIG_INOTIFY=y
@@ -770,6 +786,7 @@ CONFIG_SYSFS=y
770# CONFIG_HUGETLB_PAGE is not set 786# CONFIG_HUGETLB_PAGE is not set
771CONFIG_RAMFS=y 787CONFIG_RAMFS=y
772# CONFIG_RELAYFS_FS is not set 788# CONFIG_RELAYFS_FS is not set
789# CONFIG_CONFIGFS_FS is not set
773 790
774# 791#
775# Miscellaneous filesystems 792# Miscellaneous filesystems
@@ -831,18 +848,20 @@ CONFIG_MSDOS_PARTITION=y
831# Kernel hacking 848# Kernel hacking
832# 849#
833CONFIG_PRINTK_TIME=y 850CONFIG_PRINTK_TIME=y
834CONFIG_DEBUG_KERNEL=y
835CONFIG_MAGIC_SYSRQ=y 851CONFIG_MAGIC_SYSRQ=y
852CONFIG_DEBUG_KERNEL=y
836CONFIG_LOG_BUF_SHIFT=16 853CONFIG_LOG_BUF_SHIFT=16
837CONFIG_DETECT_SOFTLOCKUP=y 854CONFIG_DETECT_SOFTLOCKUP=y
838# CONFIG_SCHEDSTATS is not set 855# CONFIG_SCHEDSTATS is not set
839# CONFIG_DEBUG_SLAB is not set 856# CONFIG_DEBUG_SLAB is not set
857CONFIG_DEBUG_MUTEXES=y
840# CONFIG_DEBUG_SPINLOCK is not set 858# CONFIG_DEBUG_SPINLOCK is not set
841# CONFIG_DEBUG_SPINLOCK_SLEEP is not set 859# CONFIG_DEBUG_SPINLOCK_SLEEP is not set
842# CONFIG_DEBUG_KOBJECT is not set 860# CONFIG_DEBUG_KOBJECT is not set
843# CONFIG_DEBUG_INFO is not set 861# CONFIG_DEBUG_INFO is not set
844# CONFIG_DEBUG_FS is not set 862# CONFIG_DEBUG_FS is not set
845# CONFIG_DEBUG_VM is not set 863# CONFIG_DEBUG_VM is not set
864CONFIG_FORCED_INLINING=y
846# CONFIG_RCU_TORTURE_TEST is not set 865# CONFIG_RCU_TORTURE_TEST is not set
847CONFIG_CROSSCOMPILE=y 866CONFIG_CROSSCOMPILE=y
848CONFIG_CMDLINE="" 867CONFIG_CMDLINE=""
diff --git a/arch/mips/configs/capcella_defconfig b/arch/mips/configs/capcella_defconfig
index 5261e29ccf37..6c2961affbd6 100644
--- a/arch/mips/configs/capcella_defconfig
+++ b/arch/mips/configs/capcella_defconfig
@@ -1,7 +1,7 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.15-rc2 3# Linux kernel version: 2.6.16-rc1
4# Thu Nov 24 01:05:55 2005 4# Fri Jan 27 15:39:54 2006
5# 5#
6CONFIG_MIPS=y 6CONFIG_MIPS=y
7 7
@@ -63,9 +63,9 @@ CONFIG_MACH_VR41XX=y
63# CONFIG_TOSHIBA_JMR3927 is not set 63# CONFIG_TOSHIBA_JMR3927 is not set
64# CONFIG_TOSHIBA_RBTX4927 is not set 64# CONFIG_TOSHIBA_RBTX4927 is not set
65# CONFIG_TOSHIBA_RBTX4938 is not set 65# CONFIG_TOSHIBA_RBTX4938 is not set
66# CONFIG_NEC_CMBVR4133 is not set
67# CONFIG_CASIO_E55 is not set 66# CONFIG_CASIO_E55 is not set
68# CONFIG_IBM_WORKPAD is not set 67# CONFIG_IBM_WORKPAD is not set
68# CONFIG_NEC_CMBVR4133 is not set
69# CONFIG_TANBAC_TB022X is not set 69# CONFIG_TANBAC_TB022X is not set
70# CONFIG_VICTOR_MPC30X is not set 70# CONFIG_VICTOR_MPC30X is not set
71CONFIG_ZAO_CAPCELLA=y 71CONFIG_ZAO_CAPCELLA=y
@@ -90,7 +90,7 @@ CONFIG_MIPS_L1_CACHE_SHIFT=5
90# CONFIG_CPU_MIPS64_R2 is not set 90# CONFIG_CPU_MIPS64_R2 is not set
91# CONFIG_CPU_R3000 is not set 91# CONFIG_CPU_R3000 is not set
92# CONFIG_CPU_TX39XX is not set 92# CONFIG_CPU_TX39XX is not set
93CONFIG_CPU_VR41XX=y 93# CONFIG_CPU_VR41XX is not set
94# CONFIG_CPU_R4300 is not set 94# CONFIG_CPU_R4300 is not set
95# CONFIG_CPU_R4X00 is not set 95# CONFIG_CPU_R4X00 is not set
96# CONFIG_CPU_TX49XX is not set 96# CONFIG_CPU_TX49XX is not set
@@ -103,23 +103,18 @@ CONFIG_CPU_VR41XX=y
103# CONFIG_CPU_RM7000 is not set 103# CONFIG_CPU_RM7000 is not set
104# CONFIG_CPU_RM9000 is not set 104# CONFIG_CPU_RM9000 is not set
105# CONFIG_CPU_SB1 is not set 105# CONFIG_CPU_SB1 is not set
106CONFIG_SYS_HAS_CPU_VR41XX=y
107CONFIG_SYS_SUPPORTS_32BIT_KERNEL=y
108CONFIG_SYS_SUPPORTS_64BIT_KERNEL=y
109CONFIG_CPU_SUPPORTS_32BIT_KERNEL=y
110CONFIG_CPU_SUPPORTS_64BIT_KERNEL=y
111 106
112# 107#
113# Kernel type 108# Kernel type
114# 109#
115CONFIG_32BIT=y 110# CONFIG_32BIT is not set
116# CONFIG_64BIT is not set 111# CONFIG_64BIT is not set
117CONFIG_PAGE_SIZE_4KB=y 112CONFIG_PAGE_SIZE_4KB=y
118# CONFIG_PAGE_SIZE_8KB is not set 113# CONFIG_PAGE_SIZE_8KB is not set
119# CONFIG_PAGE_SIZE_16KB is not set 114# CONFIG_PAGE_SIZE_16KB is not set
120# CONFIG_PAGE_SIZE_64KB is not set 115# CONFIG_PAGE_SIZE_64KB is not set
121# CONFIG_MIPS_MT is not set 116# CONFIG_MIPS_MT is not set
122# CONFIG_CPU_ADVANCED is not set 117CONFIG_CPU_HAS_LLSC=y
123CONFIG_CPU_HAS_SYNC=y 118CONFIG_CPU_HAS_SYNC=y
124CONFIG_GENERIC_HARDIRQS=y 119CONFIG_GENERIC_HARDIRQS=y
125CONFIG_GENERIC_IRQ_PROBE=y 120CONFIG_GENERIC_IRQ_PROBE=y
@@ -155,26 +150,28 @@ CONFIG_SYSVIPC=y
155# CONFIG_BSD_PROCESS_ACCT is not set 150# CONFIG_BSD_PROCESS_ACCT is not set
156CONFIG_SYSCTL=y 151CONFIG_SYSCTL=y
157# CONFIG_AUDIT is not set 152# CONFIG_AUDIT is not set
158CONFIG_HOTPLUG=y
159CONFIG_KOBJECT_UEVENT=y
160# CONFIG_IKCONFIG is not set 153# CONFIG_IKCONFIG is not set
161CONFIG_INITRAMFS_SOURCE="" 154CONFIG_INITRAMFS_SOURCE=""
155# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
162CONFIG_EMBEDDED=y 156CONFIG_EMBEDDED=y
163CONFIG_KALLSYMS=y 157CONFIG_KALLSYMS=y
164# CONFIG_KALLSYMS_EXTRA_PASS is not set 158# CONFIG_KALLSYMS_EXTRA_PASS is not set
159CONFIG_HOTPLUG=y
165CONFIG_PRINTK=y 160CONFIG_PRINTK=y
166CONFIG_BUG=y 161CONFIG_BUG=y
162CONFIG_ELF_CORE=y
167CONFIG_BASE_FULL=y 163CONFIG_BASE_FULL=y
168CONFIG_FUTEX=y 164CONFIG_FUTEX=y
169CONFIG_EPOLL=y 165CONFIG_EPOLL=y
170# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
171CONFIG_SHMEM=y 166CONFIG_SHMEM=y
172CONFIG_CC_ALIGN_FUNCTIONS=0 167CONFIG_CC_ALIGN_FUNCTIONS=0
173CONFIG_CC_ALIGN_LABELS=0 168CONFIG_CC_ALIGN_LABELS=0
174CONFIG_CC_ALIGN_LOOPS=0 169CONFIG_CC_ALIGN_LOOPS=0
175CONFIG_CC_ALIGN_JUMPS=0 170CONFIG_CC_ALIGN_JUMPS=0
171CONFIG_SLAB=y
176# CONFIG_TINY_SHMEM is not set 172# CONFIG_TINY_SHMEM is not set
177CONFIG_BASE_SMALL=0 173CONFIG_BASE_SMALL=0
174# CONFIG_SLOB is not set
178 175
179# 176#
180# Loadable module support 177# Loadable module support
@@ -190,7 +187,6 @@ CONFIG_KMOD=y
190# 187#
191# Block layer 188# Block layer
192# 189#
193# CONFIG_LBD is not set
194 190
195# 191#
196# IO Schedulers 192# IO Schedulers
@@ -228,7 +224,6 @@ CONFIG_MMU=y
228# 224#
229CONFIG_BINFMT_ELF=y 225CONFIG_BINFMT_ELF=y
230# CONFIG_BINFMT_MISC is not set 226# CONFIG_BINFMT_MISC is not set
231CONFIG_TRAD_SIGNALS=y
232 227
233# 228#
234# Networking 229# Networking
@@ -286,6 +281,11 @@ CONFIG_TCP_CONG_BIC=y
286# CONFIG_ATALK is not set 281# CONFIG_ATALK is not set
287# CONFIG_X25 is not set 282# CONFIG_X25 is not set
288# CONFIG_LAPB is not set 283# CONFIG_LAPB is not set
284
285#
286# TIPC Configuration (EXPERIMENTAL)
287#
288# CONFIG_TIPC is not set
289# CONFIG_NET_DIVERT is not set 289# CONFIG_NET_DIVERT is not set
290# CONFIG_ECONET is not set 290# CONFIG_ECONET is not set
291# CONFIG_WAN_ROUTER is not set 291# CONFIG_WAN_ROUTER is not set
@@ -306,7 +306,6 @@ CONFIG_IEEE80211=m
306# CONFIG_IEEE80211_DEBUG is not set 306# CONFIG_IEEE80211_DEBUG is not set
307CONFIG_IEEE80211_CRYPT_WEP=m 307CONFIG_IEEE80211_CRYPT_WEP=m
308CONFIG_IEEE80211_CRYPT_CCMP=m 308CONFIG_IEEE80211_CRYPT_CCMP=m
309CONFIG_IEEE80211_CRYPT_TKIP=m
310 309
311# 310#
312# Device Drivers 311# Device Drivers
@@ -444,6 +443,7 @@ CONFIG_MII=y
444# CONFIG_SUNGEM is not set 443# CONFIG_SUNGEM is not set
445# CONFIG_CASSINI is not set 444# CONFIG_CASSINI is not set
446# CONFIG_NET_VENDOR_3COM is not set 445# CONFIG_NET_VENDOR_3COM is not set
446# CONFIG_DM9000 is not set
447 447
448# 448#
449# Tulip family network device support 449# Tulip family network device support
@@ -487,6 +487,7 @@ CONFIG_8139TOO_PIO=y
487# CONFIG_R8169 is not set 487# CONFIG_R8169 is not set
488# CONFIG_SIS190 is not set 488# CONFIG_SIS190 is not set
489# CONFIG_SKGE is not set 489# CONFIG_SKGE is not set
490# CONFIG_SKY2 is not set
490# CONFIG_SK98LIN is not set 491# CONFIG_SK98LIN is not set
491# CONFIG_VIA_VELOCITY is not set 492# CONFIG_VIA_VELOCITY is not set
492# CONFIG_TIGON3 is not set 493# CONFIG_TIGON3 is not set
@@ -508,8 +509,6 @@ CONFIG_8139TOO_PIO=y
508# Wireless LAN (non-hamradio) 509# Wireless LAN (non-hamradio)
509# 510#
510# CONFIG_NET_RADIO is not set 511# CONFIG_NET_RADIO is not set
511# CONFIG_IPW_DEBUG is not set
512CONFIG_IPW2200=m
513 512
514# 513#
515# Wan interfaces 514# Wan interfaces
@@ -579,11 +578,6 @@ CONFIG_HW_CONSOLE=y
579# 578#
580# Non-8250 serial port support 579# Non-8250 serial port support
581# 580#
582CONFIG_SERIAL_CORE=y
583CONFIG_SERIAL_CORE_CONSOLE=y
584CONFIG_SERIAL_VR41XX=y
585CONFIG_SERIAL_VR41XX_CONSOLE=y
586# CONFIG_SERIAL_JSM is not set
587CONFIG_UNIX98_PTYS=y 581CONFIG_UNIX98_PTYS=y
588CONFIG_LEGACY_PTYS=y 582CONFIG_LEGACY_PTYS=y
589CONFIG_LEGACY_PTY_COUNT=256 583CONFIG_LEGACY_PTY_COUNT=256
@@ -599,7 +593,6 @@ CONFIG_LEGACY_PTY_COUNT=256
599# CONFIG_WATCHDOG is not set 593# CONFIG_WATCHDOG is not set
600# CONFIG_RTC is not set 594# CONFIG_RTC is not set
601# CONFIG_GEN_RTC is not set 595# CONFIG_GEN_RTC is not set
602# CONFIG_RTC_VR41XX is not set
603# CONFIG_DTLK is not set 596# CONFIG_DTLK is not set
604# CONFIG_R3964 is not set 597# CONFIG_R3964 is not set
605# CONFIG_APPLICOM is not set 598# CONFIG_APPLICOM is not set
@@ -608,7 +601,6 @@ CONFIG_LEGACY_PTY_COUNT=256
608# Ftape, the floppy tape device driver 601# Ftape, the floppy tape device driver
609# 602#
610# CONFIG_DRM is not set 603# CONFIG_DRM is not set
611CONFIG_GPIO_VR41XX=y
612# CONFIG_RAW_DRIVER is not set 604# CONFIG_RAW_DRIVER is not set
613 605
614# 606#
@@ -623,6 +615,12 @@ CONFIG_GPIO_VR41XX=y
623# CONFIG_I2C is not set 615# CONFIG_I2C is not set
624 616
625# 617#
618# SPI support
619#
620# CONFIG_SPI is not set
621# CONFIG_SPI_MASTER is not set
622
623#
626# Dallas's 1-wire bus 624# Dallas's 1-wire bus
627# 625#
628# CONFIG_W1 is not set 626# CONFIG_W1 is not set
@@ -704,11 +702,11 @@ CONFIG_EXT2_FS=y
704# CONFIG_EXT2_FS_XATTR is not set 702# CONFIG_EXT2_FS_XATTR is not set
705# CONFIG_EXT2_FS_XIP is not set 703# CONFIG_EXT2_FS_XIP is not set
706# CONFIG_EXT3_FS is not set 704# CONFIG_EXT3_FS is not set
707# CONFIG_JBD is not set
708# CONFIG_REISERFS_FS is not set 705# CONFIG_REISERFS_FS is not set
709# CONFIG_JFS_FS is not set 706# CONFIG_JFS_FS is not set
710# CONFIG_FS_POSIX_ACL is not set 707# CONFIG_FS_POSIX_ACL is not set
711# CONFIG_XFS_FS is not set 708# CONFIG_XFS_FS is not set
709# CONFIG_OCFS2_FS is not set
712# CONFIG_MINIX_FS is not set 710# CONFIG_MINIX_FS is not set
713# CONFIG_ROMFS_FS is not set 711# CONFIG_ROMFS_FS is not set
714CONFIG_INOTIFY=y 712CONFIG_INOTIFY=y
@@ -741,6 +739,7 @@ CONFIG_SYSFS=y
741# CONFIG_HUGETLB_PAGE is not set 739# CONFIG_HUGETLB_PAGE is not set
742CONFIG_RAMFS=y 740CONFIG_RAMFS=y
743CONFIG_RELAYFS_FS=m 741CONFIG_RELAYFS_FS=m
742# CONFIG_CONFIGFS_FS is not set
744 743
745# 744#
746# Miscellaneous filesystems 745# Miscellaneous filesystems
@@ -803,6 +802,7 @@ CONFIG_MSDOS_PARTITION=y
803# Kernel hacking 802# Kernel hacking
804# 803#
805# CONFIG_PRINTK_TIME is not set 804# CONFIG_PRINTK_TIME is not set
805# CONFIG_MAGIC_SYSRQ is not set
806# CONFIG_DEBUG_KERNEL is not set 806# CONFIG_DEBUG_KERNEL is not set
807CONFIG_LOG_BUF_SHIFT=14 807CONFIG_LOG_BUF_SHIFT=14
808CONFIG_CROSSCOMPILE=y 808CONFIG_CROSSCOMPILE=y
diff --git a/arch/mips/configs/cobalt_defconfig b/arch/mips/configs/cobalt_defconfig
index 1d3ee18ea8bb..8336b21d3db2 100644
--- a/arch/mips/configs/cobalt_defconfig
+++ b/arch/mips/configs/cobalt_defconfig
@@ -1,7 +1,7 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.15-rc2 3# Linux kernel version: 2.6.16-rc1
4# Thu Nov 24 01:05:57 2005 4# Fri Jan 27 15:39:55 2006
5# 5#
6CONFIG_MIPS=y 6CONFIG_MIPS=y
7 7
@@ -150,26 +150,28 @@ CONFIG_SYSVIPC=y
150# CONFIG_BSD_PROCESS_ACCT is not set 150# CONFIG_BSD_PROCESS_ACCT is not set
151CONFIG_SYSCTL=y 151CONFIG_SYSCTL=y
152# CONFIG_AUDIT is not set 152# CONFIG_AUDIT is not set
153CONFIG_HOTPLUG=y
154CONFIG_KOBJECT_UEVENT=y
155# CONFIG_IKCONFIG is not set 153# CONFIG_IKCONFIG is not set
156CONFIG_INITRAMFS_SOURCE="" 154CONFIG_INITRAMFS_SOURCE=""
155# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
157CONFIG_EMBEDDED=y 156CONFIG_EMBEDDED=y
158CONFIG_KALLSYMS=y 157CONFIG_KALLSYMS=y
159# CONFIG_KALLSYMS_EXTRA_PASS is not set 158# CONFIG_KALLSYMS_EXTRA_PASS is not set
159CONFIG_HOTPLUG=y
160CONFIG_PRINTK=y 160CONFIG_PRINTK=y
161CONFIG_BUG=y 161CONFIG_BUG=y
162CONFIG_ELF_CORE=y
162CONFIG_BASE_FULL=y 163CONFIG_BASE_FULL=y
163CONFIG_FUTEX=y 164CONFIG_FUTEX=y
164CONFIG_EPOLL=y 165CONFIG_EPOLL=y
165# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
166CONFIG_SHMEM=y 166CONFIG_SHMEM=y
167CONFIG_CC_ALIGN_FUNCTIONS=0 167CONFIG_CC_ALIGN_FUNCTIONS=0
168CONFIG_CC_ALIGN_LABELS=0 168CONFIG_CC_ALIGN_LABELS=0
169CONFIG_CC_ALIGN_LOOPS=0 169CONFIG_CC_ALIGN_LOOPS=0
170CONFIG_CC_ALIGN_JUMPS=0 170CONFIG_CC_ALIGN_JUMPS=0
171CONFIG_SLAB=y
171# CONFIG_TINY_SHMEM is not set 172# CONFIG_TINY_SHMEM is not set
172CONFIG_BASE_SMALL=0 173CONFIG_BASE_SMALL=0
174# CONFIG_SLOB is not set
173 175
174# 176#
175# Loadable module support 177# Loadable module support
@@ -271,6 +273,11 @@ CONFIG_TCP_CONG_BIC=y
271# CONFIG_ATALK is not set 273# CONFIG_ATALK is not set
272# CONFIG_X25 is not set 274# CONFIG_X25 is not set
273# CONFIG_LAPB is not set 275# CONFIG_LAPB is not set
276
277#
278# TIPC Configuration (EXPERIMENTAL)
279#
280# CONFIG_TIPC is not set
274# CONFIG_NET_DIVERT is not set 281# CONFIG_NET_DIVERT is not set
275# CONFIG_ECONET is not set 282# CONFIG_ECONET is not set
276# CONFIG_WAN_ROUTER is not set 283# CONFIG_WAN_ROUTER is not set
@@ -291,7 +298,6 @@ CONFIG_IEEE80211=y
291# CONFIG_IEEE80211_DEBUG is not set 298# CONFIG_IEEE80211_DEBUG is not set
292CONFIG_IEEE80211_CRYPT_WEP=y 299CONFIG_IEEE80211_CRYPT_WEP=y
293CONFIG_IEEE80211_CRYPT_CCMP=y 300CONFIG_IEEE80211_CRYPT_CCMP=y
294CONFIG_IEEE80211_CRYPT_TKIP=y
295 301
296# 302#
297# Device Drivers 303# Device Drivers
@@ -364,9 +370,38 @@ CONFIG_BLK_DEV_IDEDISK=y
364# IDE chipset support/bugfixes 370# IDE chipset support/bugfixes
365# 371#
366CONFIG_IDE_GENERIC=y 372CONFIG_IDE_GENERIC=y
367# CONFIG_BLK_DEV_IDEPCI is not set 373CONFIG_BLK_DEV_IDEPCI=y
374# CONFIG_IDEPCI_SHARE_IRQ is not set
375# CONFIG_BLK_DEV_OFFBOARD is not set
376# CONFIG_BLK_DEV_GENERIC is not set
377# CONFIG_BLK_DEV_OPTI621 is not set
378CONFIG_BLK_DEV_IDEDMA_PCI=y
379# CONFIG_BLK_DEV_IDEDMA_FORCED is not set
380# CONFIG_IDEDMA_PCI_AUTO is not set
381# CONFIG_BLK_DEV_AEC62XX is not set
382# CONFIG_BLK_DEV_ALI15X3 is not set
383# CONFIG_BLK_DEV_AMD74XX is not set
384# CONFIG_BLK_DEV_CMD64X is not set
385# CONFIG_BLK_DEV_TRIFLEX is not set
386# CONFIG_BLK_DEV_CY82C693 is not set
387# CONFIG_BLK_DEV_CS5520 is not set
388# CONFIG_BLK_DEV_CS5530 is not set
389# CONFIG_BLK_DEV_HPT34X is not set
390# CONFIG_BLK_DEV_HPT366 is not set
391# CONFIG_BLK_DEV_SC1200 is not set
392# CONFIG_BLK_DEV_PIIX is not set
393# CONFIG_BLK_DEV_IT821X is not set
394# CONFIG_BLK_DEV_NS87415 is not set
395# CONFIG_BLK_DEV_PDC202XX_OLD is not set
396# CONFIG_BLK_DEV_PDC202XX_NEW is not set
397# CONFIG_BLK_DEV_SVWKS is not set
398# CONFIG_BLK_DEV_SIIMAGE is not set
399# CONFIG_BLK_DEV_SLC90E66 is not set
400# CONFIG_BLK_DEV_TRM290 is not set
401CONFIG_BLK_DEV_VIA82CXXX=y
368# CONFIG_IDE_ARM is not set 402# CONFIG_IDE_ARM is not set
369# CONFIG_BLK_DEV_IDEDMA is not set 403CONFIG_BLK_DEV_IDEDMA=y
404# CONFIG_IDEDMA_IVB is not set
370# CONFIG_IDEDMA_AUTO is not set 405# CONFIG_IDEDMA_AUTO is not set
371# CONFIG_BLK_DEV_HD is not set 406# CONFIG_BLK_DEV_HD is not set
372 407
@@ -433,11 +468,21 @@ CONFIG_NET_ETHERNET=y
433# CONFIG_SUNGEM is not set 468# CONFIG_SUNGEM is not set
434# CONFIG_CASSINI is not set 469# CONFIG_CASSINI is not set
435# CONFIG_NET_VENDOR_3COM is not set 470# CONFIG_NET_VENDOR_3COM is not set
471# CONFIG_DM9000 is not set
436 472
437# 473#
438# Tulip family network device support 474# Tulip family network device support
439# 475#
440# CONFIG_NET_TULIP is not set 476CONFIG_NET_TULIP=y
477CONFIG_DE2104X=y
478CONFIG_TULIP=y
479# CONFIG_TULIP_MWI is not set
480# CONFIG_TULIP_MMIO is not set
481# CONFIG_TULIP_NAPI is not set
482# CONFIG_DE4X5 is not set
483# CONFIG_WINBOND_840 is not set
484# CONFIG_DM9102 is not set
485# CONFIG_ULI526X is not set
441# CONFIG_HP100 is not set 486# CONFIG_HP100 is not set
442# CONFIG_NET_PCI is not set 487# CONFIG_NET_PCI is not set
443 488
@@ -453,6 +498,7 @@ CONFIG_NET_ETHERNET=y
453# CONFIG_R8169 is not set 498# CONFIG_R8169 is not set
454# CONFIG_SIS190 is not set 499# CONFIG_SIS190 is not set
455# CONFIG_SKGE is not set 500# CONFIG_SKGE is not set
501# CONFIG_SKY2 is not set
456# CONFIG_SK98LIN is not set 502# CONFIG_SK98LIN is not set
457# CONFIG_TIGON3 is not set 503# CONFIG_TIGON3 is not set
458# CONFIG_BNX2 is not set 504# CONFIG_BNX2 is not set
@@ -473,8 +519,6 @@ CONFIG_NET_ETHERNET=y
473# Wireless LAN (non-hamradio) 519# Wireless LAN (non-hamradio)
474# 520#
475# CONFIG_NET_RADIO is not set 521# CONFIG_NET_RADIO is not set
476# CONFIG_IPW_DEBUG is not set
477CONFIG_IPW2200=y
478 522
479# 523#
480# Wan interfaces 524# Wan interfaces
@@ -550,6 +594,7 @@ CONFIG_HW_CONSOLE=y
550CONFIG_SERIAL_8250=y 594CONFIG_SERIAL_8250=y
551CONFIG_SERIAL_8250_CONSOLE=y 595CONFIG_SERIAL_8250_CONSOLE=y
552CONFIG_SERIAL_8250_NR_UARTS=4 596CONFIG_SERIAL_8250_NR_UARTS=4
597CONFIG_SERIAL_8250_RUNTIME_UARTS=4
553# CONFIG_SERIAL_8250_EXTENDED is not set 598# CONFIG_SERIAL_8250_EXTENDED is not set
554 599
555# 600#
@@ -557,7 +602,6 @@ CONFIG_SERIAL_8250_NR_UARTS=4
557# 602#
558CONFIG_SERIAL_CORE=y 603CONFIG_SERIAL_CORE=y
559CONFIG_SERIAL_CORE_CONSOLE=y 604CONFIG_SERIAL_CORE_CONSOLE=y
560# CONFIG_SERIAL_JSM is not set
561CONFIG_UNIX98_PTYS=y 605CONFIG_UNIX98_PTYS=y
562CONFIG_LEGACY_PTYS=y 606CONFIG_LEGACY_PTYS=y
563CONFIG_LEGACY_PTY_COUNT=256 607CONFIG_LEGACY_PTY_COUNT=256
@@ -595,6 +639,12 @@ CONFIG_COBALT_LCD=y
595# CONFIG_I2C is not set 639# CONFIG_I2C is not set
596 640
597# 641#
642# SPI support
643#
644# CONFIG_SPI is not set
645# CONFIG_SPI_MASTER is not set
646
647#
598# Dallas's 1-wire bus 648# Dallas's 1-wire bus
599# 649#
600# CONFIG_W1 is not set 650# CONFIG_W1 is not set
@@ -678,12 +728,12 @@ CONFIG_EXT2_FS_POSIX_ACL=y
678CONFIG_EXT2_FS_SECURITY=y 728CONFIG_EXT2_FS_SECURITY=y
679# CONFIG_EXT2_FS_XIP is not set 729# CONFIG_EXT2_FS_XIP is not set
680# CONFIG_EXT3_FS is not set 730# CONFIG_EXT3_FS is not set
681# CONFIG_JBD is not set
682CONFIG_FS_MBCACHE=y 731CONFIG_FS_MBCACHE=y
683# CONFIG_REISERFS_FS is not set 732# CONFIG_REISERFS_FS is not set
684# CONFIG_JFS_FS is not set 733# CONFIG_JFS_FS is not set
685CONFIG_FS_POSIX_ACL=y 734CONFIG_FS_POSIX_ACL=y
686# CONFIG_XFS_FS is not set 735# CONFIG_XFS_FS is not set
736# CONFIG_OCFS2_FS is not set
687# CONFIG_MINIX_FS is not set 737# CONFIG_MINIX_FS is not set
688# CONFIG_ROMFS_FS is not set 738# CONFIG_ROMFS_FS is not set
689CONFIG_INOTIFY=y 739CONFIG_INOTIFY=y
@@ -716,6 +766,7 @@ CONFIG_SYSFS=y
716# CONFIG_HUGETLB_PAGE is not set 766# CONFIG_HUGETLB_PAGE is not set
717CONFIG_RAMFS=y 767CONFIG_RAMFS=y
718CONFIG_RELAYFS_FS=y 768CONFIG_RELAYFS_FS=y
769# CONFIG_CONFIGFS_FS is not set
719 770
720# 771#
721# Miscellaneous filesystems 772# Miscellaneous filesystems
@@ -774,6 +825,7 @@ CONFIG_MSDOS_PARTITION=y
774# Kernel hacking 825# Kernel hacking
775# 826#
776# CONFIG_PRINTK_TIME is not set 827# CONFIG_PRINTK_TIME is not set
828# CONFIG_MAGIC_SYSRQ is not set
777# CONFIG_DEBUG_KERNEL is not set 829# CONFIG_DEBUG_KERNEL is not set
778CONFIG_LOG_BUF_SHIFT=14 830CONFIG_LOG_BUF_SHIFT=14
779CONFIG_CROSSCOMPILE=y 831CONFIG_CROSSCOMPILE=y
diff --git a/arch/mips/configs/db1000_defconfig b/arch/mips/configs/db1000_defconfig
index 18ac7926c058..7f071403c8e3 100644
--- a/arch/mips/configs/db1000_defconfig
+++ b/arch/mips/configs/db1000_defconfig
@@ -1,7 +1,7 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.15-rc2 3# Linux kernel version: 2.6.16-rc1
4# Thu Nov 24 01:05:59 2005 4# Fri Jan 27 15:39:56 2006
5# 5#
6CONFIG_MIPS=y 6CONFIG_MIPS=y
7 7
@@ -151,26 +151,29 @@ CONFIG_SYSVIPC=y
151# CONFIG_BSD_PROCESS_ACCT is not set 151# CONFIG_BSD_PROCESS_ACCT is not set
152CONFIG_SYSCTL=y 152CONFIG_SYSCTL=y
153# CONFIG_AUDIT is not set 153# CONFIG_AUDIT is not set
154CONFIG_HOTPLUG=y
155CONFIG_KOBJECT_UEVENT=y
156# CONFIG_IKCONFIG is not set 154# CONFIG_IKCONFIG is not set
157CONFIG_INITRAMFS_SOURCE="" 155CONFIG_INITRAMFS_SOURCE=""
156# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
158CONFIG_EMBEDDED=y 157CONFIG_EMBEDDED=y
159CONFIG_KALLSYMS=y 158CONFIG_KALLSYMS=y
160# CONFIG_KALLSYMS_EXTRA_PASS is not set 159# CONFIG_KALLSYMS_EXTRA_PASS is not set
160CONFIG_HOTPLUG=y
161CONFIG_PRINTK=y 161CONFIG_PRINTK=y
162CONFIG_BUG=y 162CONFIG_BUG=y
163CONFIG_ELF_CORE=y
163CONFIG_BASE_FULL=y 164CONFIG_BASE_FULL=y
164CONFIG_FUTEX=y 165CONFIG_FUTEX=y
165CONFIG_EPOLL=y 166CONFIG_EPOLL=y
166# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
167CONFIG_SHMEM=y 167CONFIG_SHMEM=y
168CONFIG_CC_ALIGN_FUNCTIONS=0 168CONFIG_CC_ALIGN_FUNCTIONS=0
169CONFIG_CC_ALIGN_LABELS=0 169CONFIG_CC_ALIGN_LABELS=0
170CONFIG_CC_ALIGN_LOOPS=0 170CONFIG_CC_ALIGN_LOOPS=0
171CONFIG_CC_ALIGN_JUMPS=0 171CONFIG_CC_ALIGN_JUMPS=0
172CONFIG_SLAB=y
172# CONFIG_TINY_SHMEM is not set 173# CONFIG_TINY_SHMEM is not set
173CONFIG_BASE_SMALL=0 174CONFIG_BASE_SMALL=0
175# CONFIG_SLOB is not set
176CONFIG_OBSOLETE_INTERMODULE=y
174 177
175# 178#
176# Loadable module support 179# Loadable module support
@@ -285,6 +288,21 @@ CONFIG_NETFILTER_NETLINK=m
285CONFIG_NETFILTER_NETLINK_QUEUE=m 288CONFIG_NETFILTER_NETLINK_QUEUE=m
286CONFIG_NETFILTER_NETLINK_LOG=m 289CONFIG_NETFILTER_NETLINK_LOG=m
287# CONFIG_NF_CONNTRACK is not set 290# CONFIG_NF_CONNTRACK is not set
291CONFIG_NETFILTER_XTABLES=m
292CONFIG_NETFILTER_XT_TARGET_CLASSIFY=m
293CONFIG_NETFILTER_XT_TARGET_MARK=m
294CONFIG_NETFILTER_XT_TARGET_NFQUEUE=m
295CONFIG_NETFILTER_XT_MATCH_COMMENT=m
296CONFIG_NETFILTER_XT_MATCH_DCCP=m
297CONFIG_NETFILTER_XT_MATCH_LENGTH=m
298CONFIG_NETFILTER_XT_MATCH_LIMIT=m
299CONFIG_NETFILTER_XT_MATCH_MAC=m
300CONFIG_NETFILTER_XT_MATCH_MARK=m
301CONFIG_NETFILTER_XT_MATCH_PKTTYPE=m
302CONFIG_NETFILTER_XT_MATCH_REALM=m
303CONFIG_NETFILTER_XT_MATCH_SCTP=m
304CONFIG_NETFILTER_XT_MATCH_STRING=m
305CONFIG_NETFILTER_XT_MATCH_TCPMSS=m
288 306
289# 307#
290# IP: Netfilter Configuration 308# IP: Netfilter Configuration
@@ -312,6 +330,11 @@ CONFIG_NETFILTER_NETLINK_LOG=m
312# CONFIG_ATALK is not set 330# CONFIG_ATALK is not set
313# CONFIG_X25 is not set 331# CONFIG_X25 is not set
314# CONFIG_LAPB is not set 332# CONFIG_LAPB is not set
333
334#
335# TIPC Configuration (EXPERIMENTAL)
336#
337# CONFIG_TIPC is not set
315# CONFIG_NET_DIVERT is not set 338# CONFIG_NET_DIVERT is not set
316# CONFIG_ECONET is not set 339# CONFIG_ECONET is not set
317# CONFIG_WAN_ROUTER is not set 340# CONFIG_WAN_ROUTER is not set
@@ -320,6 +343,7 @@ CONFIG_NETFILTER_NETLINK_LOG=m
320# QoS and/or fair queueing 343# QoS and/or fair queueing
321# 344#
322# CONFIG_NET_SCHED is not set 345# CONFIG_NET_SCHED is not set
346CONFIG_NET_CLS_ROUTE=y
323 347
324# 348#
325# Network testing 349# Network testing
@@ -332,7 +356,6 @@ CONFIG_IEEE80211=m
332# CONFIG_IEEE80211_DEBUG is not set 356# CONFIG_IEEE80211_DEBUG is not set
333CONFIG_IEEE80211_CRYPT_WEP=m 357CONFIG_IEEE80211_CRYPT_WEP=m
334CONFIG_IEEE80211_CRYPT_CCMP=m 358CONFIG_IEEE80211_CRYPT_CCMP=m
335CONFIG_IEEE80211_CRYPT_TKIP=m
336 359
337# 360#
338# Device Drivers 361# Device Drivers
@@ -395,6 +418,7 @@ CONFIG_MTD_CFI_UTIL=y
395# CONFIG_MTD_RAM is not set 418# CONFIG_MTD_RAM is not set
396# CONFIG_MTD_ROM is not set 419# CONFIG_MTD_ROM is not set
397# CONFIG_MTD_ABSENT is not set 420# CONFIG_MTD_ABSENT is not set
421# CONFIG_MTD_OBSOLETE_CHIPS is not set
398 422
399# 423#
400# Mapping drivers for chip access 424# Mapping drivers for chip access
@@ -512,6 +536,7 @@ CONFIG_NET_ETHERNET=y
512CONFIG_MII=m 536CONFIG_MII=m
513CONFIG_MIPS_AU1X00_ENET=y 537CONFIG_MIPS_AU1X00_ENET=y
514# CONFIG_SMC91X is not set 538# CONFIG_SMC91X is not set
539# CONFIG_DM9000 is not set
515 540
516# 541#
517# Ethernet (1000 Mbit) 542# Ethernet (1000 Mbit)
@@ -625,13 +650,13 @@ CONFIG_SERIAL_8250=y
625CONFIG_SERIAL_8250_CONSOLE=y 650CONFIG_SERIAL_8250_CONSOLE=y
626CONFIG_SERIAL_8250_CS=m 651CONFIG_SERIAL_8250_CS=m
627CONFIG_SERIAL_8250_NR_UARTS=4 652CONFIG_SERIAL_8250_NR_UARTS=4
653CONFIG_SERIAL_8250_RUNTIME_UARTS=4
628# CONFIG_SERIAL_8250_EXTENDED is not set 654# CONFIG_SERIAL_8250_EXTENDED is not set
629CONFIG_SERIAL_8250_AU1X00=y 655CONFIG_SERIAL_8250_AU1X00=y
630 656
631# 657#
632# Non-8250 serial port support 658# Non-8250 serial port support
633# 659#
634# CONFIG_SERIAL_AU1X00 is not set
635CONFIG_SERIAL_CORE=y 660CONFIG_SERIAL_CORE=y
636CONFIG_SERIAL_CORE_CONSOLE=y 661CONFIG_SERIAL_CORE_CONSOLE=y
637CONFIG_UNIX98_PTYS=y 662CONFIG_UNIX98_PTYS=y
@@ -676,6 +701,12 @@ CONFIG_SYNCLINK_CS=m
676# CONFIG_I2C is not set 701# CONFIG_I2C is not set
677 702
678# 703#
704# SPI support
705#
706# CONFIG_SPI is not set
707# CONFIG_SPI_MASTER is not set
708
709#
679# Dallas's 1-wire bus 710# Dallas's 1-wire bus
680# 711#
681# CONFIG_W1 is not set 712# CONFIG_W1 is not set
@@ -773,6 +804,7 @@ CONFIG_REISERFS_FS_SECURITY=y
773# CONFIG_JFS_FS is not set 804# CONFIG_JFS_FS is not set
774CONFIG_FS_POSIX_ACL=y 805CONFIG_FS_POSIX_ACL=y
775# CONFIG_XFS_FS is not set 806# CONFIG_XFS_FS is not set
807# CONFIG_OCFS2_FS is not set
776# CONFIG_MINIX_FS is not set 808# CONFIG_MINIX_FS is not set
777# CONFIG_ROMFS_FS is not set 809# CONFIG_ROMFS_FS is not set
778CONFIG_INOTIFY=y 810CONFIG_INOTIFY=y
@@ -805,6 +837,7 @@ CONFIG_TMPFS=y
805# CONFIG_HUGETLB_PAGE is not set 837# CONFIG_HUGETLB_PAGE is not set
806CONFIG_RAMFS=y 838CONFIG_RAMFS=y
807CONFIG_RELAYFS_FS=m 839CONFIG_RELAYFS_FS=m
840# CONFIG_CONFIGFS_FS is not set
808 841
809# 842#
810# Miscellaneous filesystems 843# Miscellaneous filesystems
@@ -909,6 +942,7 @@ CONFIG_NLS_DEFAULT="iso8859-1"
909# Kernel hacking 942# Kernel hacking
910# 943#
911# CONFIG_PRINTK_TIME is not set 944# CONFIG_PRINTK_TIME is not set
945# CONFIG_MAGIC_SYSRQ is not set
912# CONFIG_DEBUG_KERNEL is not set 946# CONFIG_DEBUG_KERNEL is not set
913CONFIG_LOG_BUF_SHIFT=14 947CONFIG_LOG_BUF_SHIFT=14
914CONFIG_CROSSCOMPILE=y 948CONFIG_CROSSCOMPILE=y
@@ -963,3 +997,7 @@ CONFIG_CRC32=y
963CONFIG_LIBCRC32C=m 997CONFIG_LIBCRC32C=m
964CONFIG_ZLIB_INFLATE=m 998CONFIG_ZLIB_INFLATE=m
965CONFIG_ZLIB_DEFLATE=m 999CONFIG_ZLIB_DEFLATE=m
1000CONFIG_TEXTSEARCH=y
1001CONFIG_TEXTSEARCH_KMP=m
1002CONFIG_TEXTSEARCH_BM=m
1003CONFIG_TEXTSEARCH_FSM=m
diff --git a/arch/mips/configs/db1100_defconfig b/arch/mips/configs/db1100_defconfig
index 4f55f7414c9c..98590cac1ec5 100644
--- a/arch/mips/configs/db1100_defconfig
+++ b/arch/mips/configs/db1100_defconfig
@@ -1,7 +1,7 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.15-rc2 3# Linux kernel version: 2.6.16-rc1
4# Thu Nov 24 01:06:00 2005 4# Fri Jan 27 15:39:57 2006
5# 5#
6CONFIG_MIPS=y 6CONFIG_MIPS=y
7 7
@@ -151,26 +151,29 @@ CONFIG_SYSVIPC=y
151# CONFIG_BSD_PROCESS_ACCT is not set 151# CONFIG_BSD_PROCESS_ACCT is not set
152CONFIG_SYSCTL=y 152CONFIG_SYSCTL=y
153# CONFIG_AUDIT is not set 153# CONFIG_AUDIT is not set
154CONFIG_HOTPLUG=y
155CONFIG_KOBJECT_UEVENT=y
156# CONFIG_IKCONFIG is not set 154# CONFIG_IKCONFIG is not set
157CONFIG_INITRAMFS_SOURCE="" 155CONFIG_INITRAMFS_SOURCE=""
156# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
158CONFIG_EMBEDDED=y 157CONFIG_EMBEDDED=y
159CONFIG_KALLSYMS=y 158CONFIG_KALLSYMS=y
160# CONFIG_KALLSYMS_EXTRA_PASS is not set 159# CONFIG_KALLSYMS_EXTRA_PASS is not set
160CONFIG_HOTPLUG=y
161CONFIG_PRINTK=y 161CONFIG_PRINTK=y
162CONFIG_BUG=y 162CONFIG_BUG=y
163CONFIG_ELF_CORE=y
163CONFIG_BASE_FULL=y 164CONFIG_BASE_FULL=y
164CONFIG_FUTEX=y 165CONFIG_FUTEX=y
165CONFIG_EPOLL=y 166CONFIG_EPOLL=y
166# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
167CONFIG_SHMEM=y 167CONFIG_SHMEM=y
168CONFIG_CC_ALIGN_FUNCTIONS=0 168CONFIG_CC_ALIGN_FUNCTIONS=0
169CONFIG_CC_ALIGN_LABELS=0 169CONFIG_CC_ALIGN_LABELS=0
170CONFIG_CC_ALIGN_LOOPS=0 170CONFIG_CC_ALIGN_LOOPS=0
171CONFIG_CC_ALIGN_JUMPS=0 171CONFIG_CC_ALIGN_JUMPS=0
172CONFIG_SLAB=y
172# CONFIG_TINY_SHMEM is not set 173# CONFIG_TINY_SHMEM is not set
173CONFIG_BASE_SMALL=0 174CONFIG_BASE_SMALL=0
175# CONFIG_SLOB is not set
176CONFIG_OBSOLETE_INTERMODULE=y
174 177
175# 178#
176# Loadable module support 179# Loadable module support
@@ -274,6 +277,21 @@ CONFIG_NETFILTER_NETLINK=m
274CONFIG_NETFILTER_NETLINK_QUEUE=m 277CONFIG_NETFILTER_NETLINK_QUEUE=m
275CONFIG_NETFILTER_NETLINK_LOG=m 278CONFIG_NETFILTER_NETLINK_LOG=m
276# CONFIG_NF_CONNTRACK is not set 279# CONFIG_NF_CONNTRACK is not set
280CONFIG_NETFILTER_XTABLES=m
281CONFIG_NETFILTER_XT_TARGET_CLASSIFY=m
282CONFIG_NETFILTER_XT_TARGET_MARK=m
283CONFIG_NETFILTER_XT_TARGET_NFQUEUE=m
284CONFIG_NETFILTER_XT_MATCH_COMMENT=m
285CONFIG_NETFILTER_XT_MATCH_DCCP=m
286CONFIG_NETFILTER_XT_MATCH_LENGTH=m
287CONFIG_NETFILTER_XT_MATCH_LIMIT=m
288CONFIG_NETFILTER_XT_MATCH_MAC=m
289CONFIG_NETFILTER_XT_MATCH_MARK=m
290CONFIG_NETFILTER_XT_MATCH_PKTTYPE=m
291CONFIG_NETFILTER_XT_MATCH_REALM=m
292CONFIG_NETFILTER_XT_MATCH_SCTP=m
293CONFIG_NETFILTER_XT_MATCH_STRING=m
294CONFIG_NETFILTER_XT_MATCH_TCPMSS=m
277 295
278# 296#
279# IP: Netfilter Configuration 297# IP: Netfilter Configuration
@@ -301,6 +319,11 @@ CONFIG_NETFILTER_NETLINK_LOG=m
301# CONFIG_ATALK is not set 319# CONFIG_ATALK is not set
302# CONFIG_X25 is not set 320# CONFIG_X25 is not set
303# CONFIG_LAPB is not set 321# CONFIG_LAPB is not set
322
323#
324# TIPC Configuration (EXPERIMENTAL)
325#
326# CONFIG_TIPC is not set
304# CONFIG_NET_DIVERT is not set 327# CONFIG_NET_DIVERT is not set
305# CONFIG_ECONET is not set 328# CONFIG_ECONET is not set
306# CONFIG_WAN_ROUTER is not set 329# CONFIG_WAN_ROUTER is not set
@@ -309,6 +332,7 @@ CONFIG_NETFILTER_NETLINK_LOG=m
309# QoS and/or fair queueing 332# QoS and/or fair queueing
310# 333#
311# CONFIG_NET_SCHED is not set 334# CONFIG_NET_SCHED is not set
335CONFIG_NET_CLS_ROUTE=y
312 336
313# 337#
314# Network testing 338# Network testing
@@ -321,7 +345,6 @@ CONFIG_IEEE80211=m
321# CONFIG_IEEE80211_DEBUG is not set 345# CONFIG_IEEE80211_DEBUG is not set
322CONFIG_IEEE80211_CRYPT_WEP=m 346CONFIG_IEEE80211_CRYPT_WEP=m
323CONFIG_IEEE80211_CRYPT_CCMP=m 347CONFIG_IEEE80211_CRYPT_CCMP=m
324CONFIG_IEEE80211_CRYPT_TKIP=m
325 348
326# 349#
327# Device Drivers 350# Device Drivers
@@ -384,6 +407,7 @@ CONFIG_MTD_CFI_UTIL=y
384# CONFIG_MTD_RAM is not set 407# CONFIG_MTD_RAM is not set
385# CONFIG_MTD_ROM is not set 408# CONFIG_MTD_ROM is not set
386# CONFIG_MTD_ABSENT is not set 409# CONFIG_MTD_ABSENT is not set
410# CONFIG_MTD_OBSOLETE_CHIPS is not set
387 411
388# 412#
389# Mapping drivers for chip access 413# Mapping drivers for chip access
@@ -501,6 +525,7 @@ CONFIG_NET_ETHERNET=y
501CONFIG_MII=m 525CONFIG_MII=m
502CONFIG_MIPS_AU1X00_ENET=y 526CONFIG_MIPS_AU1X00_ENET=y
503# CONFIG_SMC91X is not set 527# CONFIG_SMC91X is not set
528# CONFIG_DM9000 is not set
504 529
505# 530#
506# Ethernet (1000 Mbit) 531# Ethernet (1000 Mbit)
@@ -600,13 +625,13 @@ CONFIG_HW_CONSOLE=y
600CONFIG_SERIAL_8250=y 625CONFIG_SERIAL_8250=y
601CONFIG_SERIAL_8250_CONSOLE=y 626CONFIG_SERIAL_8250_CONSOLE=y
602CONFIG_SERIAL_8250_NR_UARTS=4 627CONFIG_SERIAL_8250_NR_UARTS=4
628CONFIG_SERIAL_8250_RUNTIME_UARTS=4
603# CONFIG_SERIAL_8250_EXTENDED is not set 629# CONFIG_SERIAL_8250_EXTENDED is not set
604CONFIG_SERIAL_8250_AU1X00=y 630CONFIG_SERIAL_8250_AU1X00=y
605 631
606# 632#
607# Non-8250 serial port support 633# Non-8250 serial port support
608# 634#
609# CONFIG_SERIAL_AU1X00 is not set
610CONFIG_SERIAL_CORE=y 635CONFIG_SERIAL_CORE=y
611CONFIG_SERIAL_CORE_CONSOLE=y 636CONFIG_SERIAL_CORE_CONSOLE=y
612CONFIG_UNIX98_PTYS=y 637CONFIG_UNIX98_PTYS=y
@@ -644,6 +669,12 @@ CONFIG_LEGACY_PTY_COUNT=256
644# CONFIG_I2C is not set 669# CONFIG_I2C is not set
645 670
646# 671#
672# SPI support
673#
674# CONFIG_SPI is not set
675# CONFIG_SPI_MASTER is not set
676
677#
647# Dallas's 1-wire bus 678# Dallas's 1-wire bus
648# 679#
649# CONFIG_W1 is not set 680# CONFIG_W1 is not set
@@ -772,6 +803,7 @@ CONFIG_REISERFS_FS_SECURITY=y
772# CONFIG_JFS_FS is not set 803# CONFIG_JFS_FS is not set
773CONFIG_FS_POSIX_ACL=y 804CONFIG_FS_POSIX_ACL=y
774# CONFIG_XFS_FS is not set 805# CONFIG_XFS_FS is not set
806# CONFIG_OCFS2_FS is not set
775# CONFIG_MINIX_FS is not set 807# CONFIG_MINIX_FS is not set
776# CONFIG_ROMFS_FS is not set 808# CONFIG_ROMFS_FS is not set
777CONFIG_INOTIFY=y 809CONFIG_INOTIFY=y
@@ -804,6 +836,7 @@ CONFIG_TMPFS=y
804# CONFIG_HUGETLB_PAGE is not set 836# CONFIG_HUGETLB_PAGE is not set
805CONFIG_RAMFS=y 837CONFIG_RAMFS=y
806CONFIG_RELAYFS_FS=m 838CONFIG_RELAYFS_FS=m
839# CONFIG_CONFIGFS_FS is not set
807 840
808# 841#
809# Miscellaneous filesystems 842# Miscellaneous filesystems
@@ -908,6 +941,7 @@ CONFIG_NLS_DEFAULT="iso8859-1"
908# Kernel hacking 941# Kernel hacking
909# 942#
910# CONFIG_PRINTK_TIME is not set 943# CONFIG_PRINTK_TIME is not set
944# CONFIG_MAGIC_SYSRQ is not set
911# CONFIG_DEBUG_KERNEL is not set 945# CONFIG_DEBUG_KERNEL is not set
912CONFIG_LOG_BUF_SHIFT=14 946CONFIG_LOG_BUF_SHIFT=14
913CONFIG_CROSSCOMPILE=y 947CONFIG_CROSSCOMPILE=y
@@ -962,3 +996,7 @@ CONFIG_CRC32=y
962CONFIG_LIBCRC32C=m 996CONFIG_LIBCRC32C=m
963CONFIG_ZLIB_INFLATE=m 997CONFIG_ZLIB_INFLATE=m
964CONFIG_ZLIB_DEFLATE=m 998CONFIG_ZLIB_DEFLATE=m
999CONFIG_TEXTSEARCH=y
1000CONFIG_TEXTSEARCH_KMP=m
1001CONFIG_TEXTSEARCH_BM=m
1002CONFIG_TEXTSEARCH_FSM=m
diff --git a/arch/mips/configs/db1200_defconfig b/arch/mips/configs/db1200_defconfig
index 0e5de7d05f23..92888472dca0 100644
--- a/arch/mips/configs/db1200_defconfig
+++ b/arch/mips/configs/db1200_defconfig
@@ -1,7 +1,7 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.15-rc2 3# Linux kernel version: 2.6.16-rc1
4# Thu Nov 24 01:06:03 2005 4# Fri Jan 27 15:39:58 2006
5# 5#
6CONFIG_MIPS=y 6CONFIG_MIPS=y
7 7
@@ -151,27 +151,30 @@ CONFIG_SYSVIPC=y
151# CONFIG_BSD_PROCESS_ACCT is not set 151# CONFIG_BSD_PROCESS_ACCT is not set
152CONFIG_SYSCTL=y 152CONFIG_SYSCTL=y
153# CONFIG_AUDIT is not set 153# CONFIG_AUDIT is not set
154CONFIG_HOTPLUG=y
155CONFIG_KOBJECT_UEVENT=y
156CONFIG_IKCONFIG=y 154CONFIG_IKCONFIG=y
157CONFIG_IKCONFIG_PROC=y 155CONFIG_IKCONFIG_PROC=y
158CONFIG_INITRAMFS_SOURCE="" 156CONFIG_INITRAMFS_SOURCE=""
157# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
159CONFIG_EMBEDDED=y 158CONFIG_EMBEDDED=y
160CONFIG_KALLSYMS=y 159CONFIG_KALLSYMS=y
161# CONFIG_KALLSYMS_EXTRA_PASS is not set 160# CONFIG_KALLSYMS_EXTRA_PASS is not set
161CONFIG_HOTPLUG=y
162CONFIG_PRINTK=y 162CONFIG_PRINTK=y
163CONFIG_BUG=y 163CONFIG_BUG=y
164CONFIG_ELF_CORE=y
164CONFIG_BASE_FULL=y 165CONFIG_BASE_FULL=y
165CONFIG_FUTEX=y 166CONFIG_FUTEX=y
166CONFIG_EPOLL=y 167CONFIG_EPOLL=y
167# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
168CONFIG_SHMEM=y 168CONFIG_SHMEM=y
169CONFIG_CC_ALIGN_FUNCTIONS=0 169CONFIG_CC_ALIGN_FUNCTIONS=0
170CONFIG_CC_ALIGN_LABELS=0 170CONFIG_CC_ALIGN_LABELS=0
171CONFIG_CC_ALIGN_LOOPS=0 171CONFIG_CC_ALIGN_LOOPS=0
172CONFIG_CC_ALIGN_JUMPS=0 172CONFIG_CC_ALIGN_JUMPS=0
173CONFIG_SLAB=y
173# CONFIG_TINY_SHMEM is not set 174# CONFIG_TINY_SHMEM is not set
174CONFIG_BASE_SMALL=0 175CONFIG_BASE_SMALL=0
176# CONFIG_SLOB is not set
177CONFIG_OBSOLETE_INTERMODULE=y
175 178
176# 179#
177# Loadable module support 180# Loadable module support
@@ -279,6 +282,21 @@ CONFIG_NETFILTER=y
279# 282#
280# CONFIG_NETFILTER_NETLINK is not set 283# CONFIG_NETFILTER_NETLINK is not set
281# CONFIG_NF_CONNTRACK is not set 284# CONFIG_NF_CONNTRACK is not set
285CONFIG_NETFILTER_XTABLES=m
286CONFIG_NETFILTER_XT_TARGET_CLASSIFY=m
287CONFIG_NETFILTER_XT_TARGET_MARK=m
288CONFIG_NETFILTER_XT_TARGET_NFQUEUE=m
289CONFIG_NETFILTER_XT_MATCH_COMMENT=m
290CONFIG_NETFILTER_XT_MATCH_DCCP=m
291CONFIG_NETFILTER_XT_MATCH_LENGTH=m
292CONFIG_NETFILTER_XT_MATCH_LIMIT=m
293CONFIG_NETFILTER_XT_MATCH_MAC=m
294CONFIG_NETFILTER_XT_MATCH_MARK=m
295CONFIG_NETFILTER_XT_MATCH_PKTTYPE=m
296CONFIG_NETFILTER_XT_MATCH_REALM=m
297CONFIG_NETFILTER_XT_MATCH_SCTP=m
298CONFIG_NETFILTER_XT_MATCH_STRING=m
299CONFIG_NETFILTER_XT_MATCH_TCPMSS=m
282 300
283# 301#
284# IP: Netfilter Configuration 302# IP: Netfilter Configuration
@@ -306,6 +324,11 @@ CONFIG_NETFILTER=y
306# CONFIG_ATALK is not set 324# CONFIG_ATALK is not set
307# CONFIG_X25 is not set 325# CONFIG_X25 is not set
308# CONFIG_LAPB is not set 326# CONFIG_LAPB is not set
327
328#
329# TIPC Configuration (EXPERIMENTAL)
330#
331# CONFIG_TIPC is not set
309# CONFIG_NET_DIVERT is not set 332# CONFIG_NET_DIVERT is not set
310# CONFIG_ECONET is not set 333# CONFIG_ECONET is not set
311# CONFIG_WAN_ROUTER is not set 334# CONFIG_WAN_ROUTER is not set
@@ -314,6 +337,7 @@ CONFIG_NETFILTER=y
314# QoS and/or fair queueing 337# QoS and/or fair queueing
315# 338#
316# CONFIG_NET_SCHED is not set 339# CONFIG_NET_SCHED is not set
340CONFIG_NET_CLS_ROUTE=y
317 341
318# 342#
319# Network testing 343# Network testing
@@ -385,6 +409,7 @@ CONFIG_MTD_CFI_UTIL=y
385# CONFIG_MTD_RAM is not set 409# CONFIG_MTD_RAM is not set
386# CONFIG_MTD_ROM is not set 410# CONFIG_MTD_ROM is not set
387# CONFIG_MTD_ABSENT is not set 411# CONFIG_MTD_ABSENT is not set
412# CONFIG_MTD_OBSOLETE_CHIPS is not set
388 413
389# 414#
390# Mapping drivers for chip access 415# Mapping drivers for chip access
@@ -568,6 +593,7 @@ CONFIG_NET_ETHERNET=y
568CONFIG_MII=m 593CONFIG_MII=m
569# CONFIG_MIPS_AU1X00_ENET is not set 594# CONFIG_MIPS_AU1X00_ENET is not set
570# CONFIG_SMC91X is not set 595# CONFIG_SMC91X is not set
596# CONFIG_DM9000 is not set
571 597
572# 598#
573# Ethernet (1000 Mbit) 599# Ethernet (1000 Mbit)
@@ -665,13 +691,13 @@ CONFIG_SERIAL_8250=y
665CONFIG_SERIAL_8250_CONSOLE=y 691CONFIG_SERIAL_8250_CONSOLE=y
666# CONFIG_SERIAL_8250_CS is not set 692# CONFIG_SERIAL_8250_CS is not set
667CONFIG_SERIAL_8250_NR_UARTS=4 693CONFIG_SERIAL_8250_NR_UARTS=4
694CONFIG_SERIAL_8250_RUNTIME_UARTS=4
668# CONFIG_SERIAL_8250_EXTENDED is not set 695# CONFIG_SERIAL_8250_EXTENDED is not set
669CONFIG_SERIAL_8250_AU1X00=y 696CONFIG_SERIAL_8250_AU1X00=y
670 697
671# 698#
672# Non-8250 serial port support 699# Non-8250 serial port support
673# 700#
674# CONFIG_SERIAL_AU1X00 is not set
675CONFIG_SERIAL_CORE=y 701CONFIG_SERIAL_CORE=y
676CONFIG_SERIAL_CORE_CONSOLE=y 702CONFIG_SERIAL_CORE_CONSOLE=y
677CONFIG_UNIX98_PTYS=y 703CONFIG_UNIX98_PTYS=y
@@ -716,6 +742,12 @@ CONFIG_LEGACY_PTY_COUNT=256
716# CONFIG_I2C is not set 742# CONFIG_I2C is not set
717 743
718# 744#
745# SPI support
746#
747# CONFIG_SPI is not set
748# CONFIG_SPI_MASTER is not set
749
750#
719# Dallas's 1-wire bus 751# Dallas's 1-wire bus
720# 752#
721# CONFIG_W1 is not set 753# CONFIG_W1 is not set
@@ -842,6 +874,7 @@ CONFIG_JFS_FS=y
842# CONFIG_JFS_STATISTICS is not set 874# CONFIG_JFS_STATISTICS is not set
843CONFIG_FS_POSIX_ACL=y 875CONFIG_FS_POSIX_ACL=y
844# CONFIG_XFS_FS is not set 876# CONFIG_XFS_FS is not set
877# CONFIG_OCFS2_FS is not set
845# CONFIG_MINIX_FS is not set 878# CONFIG_MINIX_FS is not set
846# CONFIG_ROMFS_FS is not set 879# CONFIG_ROMFS_FS is not set
847CONFIG_INOTIFY=y 880CONFIG_INOTIFY=y
@@ -881,6 +914,7 @@ CONFIG_TMPFS=y
881# CONFIG_HUGETLB_PAGE is not set 914# CONFIG_HUGETLB_PAGE is not set
882CONFIG_RAMFS=y 915CONFIG_RAMFS=y
883# CONFIG_RELAYFS_FS is not set 916# CONFIG_RELAYFS_FS is not set
917# CONFIG_CONFIGFS_FS is not set
884 918
885# 919#
886# Miscellaneous filesystems 920# Miscellaneous filesystems
@@ -990,6 +1024,7 @@ CONFIG_NLS_UTF8=m
990# Kernel hacking 1024# Kernel hacking
991# 1025#
992# CONFIG_PRINTK_TIME is not set 1026# CONFIG_PRINTK_TIME is not set
1027# CONFIG_MAGIC_SYSRQ is not set
993# CONFIG_DEBUG_KERNEL is not set 1028# CONFIG_DEBUG_KERNEL is not set
994CONFIG_LOG_BUF_SHIFT=14 1029CONFIG_LOG_BUF_SHIFT=14
995CONFIG_CROSSCOMPILE=y 1030CONFIG_CROSSCOMPILE=y
@@ -1020,3 +1055,7 @@ CONFIG_CRC32=y
1020CONFIG_LIBCRC32C=y 1055CONFIG_LIBCRC32C=y
1021CONFIG_ZLIB_INFLATE=y 1056CONFIG_ZLIB_INFLATE=y
1022CONFIG_ZLIB_DEFLATE=y 1057CONFIG_ZLIB_DEFLATE=y
1058CONFIG_TEXTSEARCH=y
1059CONFIG_TEXTSEARCH_KMP=m
1060CONFIG_TEXTSEARCH_BM=m
1061CONFIG_TEXTSEARCH_FSM=m
diff --git a/arch/mips/configs/db1500_defconfig b/arch/mips/configs/db1500_defconfig
index 86e7be8412f3..5a415b1d4af0 100644
--- a/arch/mips/configs/db1500_defconfig
+++ b/arch/mips/configs/db1500_defconfig
@@ -1,7 +1,7 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.15-rc2 3# Linux kernel version: 2.6.16-rc1
4# Thu Nov 24 01:06:05 2005 4# Fri Jan 27 15:39:59 2006
5# 5#
6CONFIG_MIPS=y 6CONFIG_MIPS=y
7 7
@@ -153,26 +153,29 @@ CONFIG_SYSVIPC=y
153# CONFIG_BSD_PROCESS_ACCT is not set 153# CONFIG_BSD_PROCESS_ACCT is not set
154CONFIG_SYSCTL=y 154CONFIG_SYSCTL=y
155# CONFIG_AUDIT is not set 155# CONFIG_AUDIT is not set
156CONFIG_HOTPLUG=y
157CONFIG_KOBJECT_UEVENT=y
158# CONFIG_IKCONFIG is not set 156# CONFIG_IKCONFIG is not set
159CONFIG_INITRAMFS_SOURCE="" 157CONFIG_INITRAMFS_SOURCE=""
158# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
160CONFIG_EMBEDDED=y 159CONFIG_EMBEDDED=y
161CONFIG_KALLSYMS=y 160CONFIG_KALLSYMS=y
162# CONFIG_KALLSYMS_EXTRA_PASS is not set 161# CONFIG_KALLSYMS_EXTRA_PASS is not set
162CONFIG_HOTPLUG=y
163CONFIG_PRINTK=y 163CONFIG_PRINTK=y
164CONFIG_BUG=y 164CONFIG_BUG=y
165CONFIG_ELF_CORE=y
165CONFIG_BASE_FULL=y 166CONFIG_BASE_FULL=y
166CONFIG_FUTEX=y 167CONFIG_FUTEX=y
167CONFIG_EPOLL=y 168CONFIG_EPOLL=y
168# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
169CONFIG_SHMEM=y 169CONFIG_SHMEM=y
170CONFIG_CC_ALIGN_FUNCTIONS=0 170CONFIG_CC_ALIGN_FUNCTIONS=0
171CONFIG_CC_ALIGN_LABELS=0 171CONFIG_CC_ALIGN_LABELS=0
172CONFIG_CC_ALIGN_LOOPS=0 172CONFIG_CC_ALIGN_LOOPS=0
173CONFIG_CC_ALIGN_JUMPS=0 173CONFIG_CC_ALIGN_JUMPS=0
174CONFIG_SLAB=y
174# CONFIG_TINY_SHMEM is not set 175# CONFIG_TINY_SHMEM is not set
175CONFIG_BASE_SMALL=0 176CONFIG_BASE_SMALL=0
177# CONFIG_SLOB is not set
178CONFIG_OBSOLETE_INTERMODULE=y
176 179
177# 180#
178# Loadable module support 181# Loadable module support
@@ -293,6 +296,21 @@ CONFIG_NETFILTER_NETLINK=m
293CONFIG_NETFILTER_NETLINK_QUEUE=m 296CONFIG_NETFILTER_NETLINK_QUEUE=m
294CONFIG_NETFILTER_NETLINK_LOG=m 297CONFIG_NETFILTER_NETLINK_LOG=m
295# CONFIG_NF_CONNTRACK is not set 298# CONFIG_NF_CONNTRACK is not set
299CONFIG_NETFILTER_XTABLES=m
300CONFIG_NETFILTER_XT_TARGET_CLASSIFY=m
301CONFIG_NETFILTER_XT_TARGET_MARK=m
302CONFIG_NETFILTER_XT_TARGET_NFQUEUE=m
303CONFIG_NETFILTER_XT_MATCH_COMMENT=m
304CONFIG_NETFILTER_XT_MATCH_DCCP=m
305CONFIG_NETFILTER_XT_MATCH_LENGTH=m
306CONFIG_NETFILTER_XT_MATCH_LIMIT=m
307CONFIG_NETFILTER_XT_MATCH_MAC=m
308CONFIG_NETFILTER_XT_MATCH_MARK=m
309CONFIG_NETFILTER_XT_MATCH_PKTTYPE=m
310CONFIG_NETFILTER_XT_MATCH_REALM=m
311CONFIG_NETFILTER_XT_MATCH_SCTP=m
312CONFIG_NETFILTER_XT_MATCH_STRING=m
313CONFIG_NETFILTER_XT_MATCH_TCPMSS=m
296 314
297# 315#
298# IP: Netfilter Configuration 316# IP: Netfilter Configuration
@@ -320,6 +338,11 @@ CONFIG_NETFILTER_NETLINK_LOG=m
320# CONFIG_ATALK is not set 338# CONFIG_ATALK is not set
321# CONFIG_X25 is not set 339# CONFIG_X25 is not set
322# CONFIG_LAPB is not set 340# CONFIG_LAPB is not set
341
342#
343# TIPC Configuration (EXPERIMENTAL)
344#
345# CONFIG_TIPC is not set
323# CONFIG_NET_DIVERT is not set 346# CONFIG_NET_DIVERT is not set
324# CONFIG_ECONET is not set 347# CONFIG_ECONET is not set
325# CONFIG_WAN_ROUTER is not set 348# CONFIG_WAN_ROUTER is not set
@@ -328,6 +351,7 @@ CONFIG_NETFILTER_NETLINK_LOG=m
328# QoS and/or fair queueing 351# QoS and/or fair queueing
329# 352#
330# CONFIG_NET_SCHED is not set 353# CONFIG_NET_SCHED is not set
354CONFIG_NET_CLS_ROUTE=y
331 355
332# 356#
333# Network testing 357# Network testing
@@ -340,7 +364,6 @@ CONFIG_IEEE80211=m
340# CONFIG_IEEE80211_DEBUG is not set 364# CONFIG_IEEE80211_DEBUG is not set
341CONFIG_IEEE80211_CRYPT_WEP=m 365CONFIG_IEEE80211_CRYPT_WEP=m
342CONFIG_IEEE80211_CRYPT_CCMP=m 366CONFIG_IEEE80211_CRYPT_CCMP=m
343CONFIG_IEEE80211_CRYPT_TKIP=m
344 367
345# 368#
346# Device Drivers 369# Device Drivers
@@ -403,6 +426,7 @@ CONFIG_MTD_CFI_UTIL=y
403# CONFIG_MTD_RAM is not set 426# CONFIG_MTD_RAM is not set
404# CONFIG_MTD_ROM is not set 427# CONFIG_MTD_ROM is not set
405# CONFIG_MTD_ABSENT is not set 428# CONFIG_MTD_ABSENT is not set
429# CONFIG_MTD_OBSOLETE_CHIPS is not set
406 430
407# 431#
408# Mapping drivers for chip access 432# Mapping drivers for chip access
@@ -561,6 +585,7 @@ CONFIG_MIPS_AU1X00_ENET=y
561# CONFIG_CASSINI is not set 585# CONFIG_CASSINI is not set
562# CONFIG_NET_VENDOR_3COM is not set 586# CONFIG_NET_VENDOR_3COM is not set
563# CONFIG_SMC91X is not set 587# CONFIG_SMC91X is not set
588# CONFIG_DM9000 is not set
564 589
565# 590#
566# Tulip family network device support 591# Tulip family network device support
@@ -581,6 +606,7 @@ CONFIG_MIPS_AU1X00_ENET=y
581# CONFIG_R8169 is not set 606# CONFIG_R8169 is not set
582# CONFIG_SIS190 is not set 607# CONFIG_SIS190 is not set
583# CONFIG_SKGE is not set 608# CONFIG_SKGE is not set
609# CONFIG_SKY2 is not set
584# CONFIG_SK98LIN is not set 610# CONFIG_SK98LIN is not set
585# CONFIG_TIGON3 is not set 611# CONFIG_TIGON3 is not set
586# CONFIG_BNX2 is not set 612# CONFIG_BNX2 is not set
@@ -601,8 +627,6 @@ CONFIG_MIPS_AU1X00_ENET=y
601# Wireless LAN (non-hamradio) 627# Wireless LAN (non-hamradio)
602# 628#
603# CONFIG_NET_RADIO is not set 629# CONFIG_NET_RADIO is not set
604# CONFIG_IPW_DEBUG is not set
605CONFIG_IPW2200=m
606 630
607# 631#
608# PCMCIA network device support 632# PCMCIA network device support
@@ -692,16 +716,15 @@ CONFIG_SERIAL_8250=y
692CONFIG_SERIAL_8250_CONSOLE=y 716CONFIG_SERIAL_8250_CONSOLE=y
693# CONFIG_SERIAL_8250_CS is not set 717# CONFIG_SERIAL_8250_CS is not set
694CONFIG_SERIAL_8250_NR_UARTS=4 718CONFIG_SERIAL_8250_NR_UARTS=4
719CONFIG_SERIAL_8250_RUNTIME_UARTS=4
695# CONFIG_SERIAL_8250_EXTENDED is not set 720# CONFIG_SERIAL_8250_EXTENDED is not set
696CONFIG_SERIAL_8250_AU1X00=y 721CONFIG_SERIAL_8250_AU1X00=y
697 722
698# 723#
699# Non-8250 serial port support 724# Non-8250 serial port support
700# 725#
701# CONFIG_SERIAL_AU1X00 is not set
702CONFIG_SERIAL_CORE=y 726CONFIG_SERIAL_CORE=y
703CONFIG_SERIAL_CORE_CONSOLE=y 727CONFIG_SERIAL_CORE_CONSOLE=y
704# CONFIG_SERIAL_JSM is not set
705CONFIG_UNIX98_PTYS=y 728CONFIG_UNIX98_PTYS=y
706CONFIG_LEGACY_PTYS=y 729CONFIG_LEGACY_PTYS=y
707CONFIG_LEGACY_PTY_COUNT=256 730CONFIG_LEGACY_PTY_COUNT=256
@@ -746,6 +769,12 @@ CONFIG_SYNCLINK_CS=m
746# CONFIG_I2C is not set 769# CONFIG_I2C is not set
747 770
748# 771#
772# SPI support
773#
774# CONFIG_SPI is not set
775# CONFIG_SPI_MASTER is not set
776
777#
749# Dallas's 1-wire bus 778# Dallas's 1-wire bus
750# 779#
751# CONFIG_W1 is not set 780# CONFIG_W1 is not set
@@ -788,8 +817,6 @@ CONFIG_SOUND=y
788# Advanced Linux Sound Architecture 817# Advanced Linux Sound Architecture
789# 818#
790CONFIG_SND=m 819CONFIG_SND=m
791CONFIG_SND_AC97_CODEC=m
792CONFIG_SND_AC97_BUS=m
793CONFIG_SND_TIMER=m 820CONFIG_SND_TIMER=m
794CONFIG_SND_PCM=m 821CONFIG_SND_PCM=m
795CONFIG_SND_RAWMIDI=m 822CONFIG_SND_RAWMIDI=m
@@ -799,13 +826,16 @@ CONFIG_SND_OSSEMUL=y
799CONFIG_SND_MIXER_OSS=m 826CONFIG_SND_MIXER_OSS=m
800CONFIG_SND_PCM_OSS=m 827CONFIG_SND_PCM_OSS=m
801CONFIG_SND_SEQUENCER_OSS=y 828CONFIG_SND_SEQUENCER_OSS=y
829# CONFIG_SND_DYNAMIC_MINORS is not set
830CONFIG_SND_SUPPORT_OLD_API=y
802# CONFIG_SND_VERBOSE_PRINTK is not set 831# CONFIG_SND_VERBOSE_PRINTK is not set
803# CONFIG_SND_DEBUG is not set 832# CONFIG_SND_DEBUG is not set
804CONFIG_SND_GENERIC_DRIVER=y
805 833
806# 834#
807# Generic devices 835# Generic devices
808# 836#
837CONFIG_SND_AC97_CODEC=m
838CONFIG_SND_AC97_BUS=m
809# CONFIG_SND_DUMMY is not set 839# CONFIG_SND_DUMMY is not set
810CONFIG_SND_VIRMIDI=m 840CONFIG_SND_VIRMIDI=m
811CONFIG_SND_MTPAV=m 841CONFIG_SND_MTPAV=m
@@ -815,6 +845,7 @@ CONFIG_SND_MTPAV=m
815# 845#
816# PCI devices 846# PCI devices
817# 847#
848# CONFIG_SND_AD1889 is not set
818# CONFIG_SND_ALI5451 is not set 849# CONFIG_SND_ALI5451 is not set
819# CONFIG_SND_ATIIXP is not set 850# CONFIG_SND_ATIIXP is not set
820# CONFIG_SND_ATIIXP_MODEM is not set 851# CONFIG_SND_ATIIXP_MODEM is not set
@@ -823,38 +854,38 @@ CONFIG_SND_MTPAV=m
823# CONFIG_SND_AU8830 is not set 854# CONFIG_SND_AU8830 is not set
824# CONFIG_SND_AZT3328 is not set 855# CONFIG_SND_AZT3328 is not set
825# CONFIG_SND_BT87X is not set 856# CONFIG_SND_BT87X is not set
826# CONFIG_SND_CS46XX is not set 857# CONFIG_SND_CA0106 is not set
858# CONFIG_SND_CMIPCI is not set
827# CONFIG_SND_CS4281 is not set 859# CONFIG_SND_CS4281 is not set
860# CONFIG_SND_CS46XX is not set
828# CONFIG_SND_EMU10K1 is not set 861# CONFIG_SND_EMU10K1 is not set
829# CONFIG_SND_EMU10K1X is not set 862# CONFIG_SND_EMU10K1X is not set
830# CONFIG_SND_CA0106 is not set
831# CONFIG_SND_KORG1212 is not set
832# CONFIG_SND_MIXART is not set
833# CONFIG_SND_NM256 is not set
834# CONFIG_SND_RME32 is not set
835# CONFIG_SND_RME96 is not set
836# CONFIG_SND_RME9652 is not set
837# CONFIG_SND_HDSP is not set
838# CONFIG_SND_HDSPM is not set
839# CONFIG_SND_TRIDENT is not set
840# CONFIG_SND_YMFPCI is not set
841# CONFIG_SND_AD1889 is not set
842# CONFIG_SND_CMIPCI is not set
843# CONFIG_SND_ENS1370 is not set 863# CONFIG_SND_ENS1370 is not set
844# CONFIG_SND_ENS1371 is not set 864# CONFIG_SND_ENS1371 is not set
845# CONFIG_SND_ES1938 is not set 865# CONFIG_SND_ES1938 is not set
846# CONFIG_SND_ES1968 is not set 866# CONFIG_SND_ES1968 is not set
847# CONFIG_SND_MAESTRO3 is not set
848# CONFIG_SND_FM801 is not set 867# CONFIG_SND_FM801 is not set
868# CONFIG_SND_HDA_INTEL is not set
869# CONFIG_SND_HDSP is not set
870# CONFIG_SND_HDSPM is not set
849# CONFIG_SND_ICE1712 is not set 871# CONFIG_SND_ICE1712 is not set
850# CONFIG_SND_ICE1724 is not set 872# CONFIG_SND_ICE1724 is not set
851# CONFIG_SND_INTEL8X0 is not set 873# CONFIG_SND_INTEL8X0 is not set
852# CONFIG_SND_INTEL8X0M is not set 874# CONFIG_SND_INTEL8X0M is not set
875# CONFIG_SND_KORG1212 is not set
876# CONFIG_SND_MAESTRO3 is not set
877# CONFIG_SND_MIXART is not set
878# CONFIG_SND_NM256 is not set
879# CONFIG_SND_PCXHR is not set
880# CONFIG_SND_RME32 is not set
881# CONFIG_SND_RME96 is not set
882# CONFIG_SND_RME9652 is not set
853# CONFIG_SND_SONICVIBES is not set 883# CONFIG_SND_SONICVIBES is not set
884# CONFIG_SND_TRIDENT is not set
854# CONFIG_SND_VIA82XX is not set 885# CONFIG_SND_VIA82XX is not set
855# CONFIG_SND_VIA82XX_MODEM is not set 886# CONFIG_SND_VIA82XX_MODEM is not set
856# CONFIG_SND_VX222 is not set 887# CONFIG_SND_VX222 is not set
857# CONFIG_SND_HDA_INTEL is not set 888# CONFIG_SND_YMFPCI is not set
858 889
859# 890#
860# ALSA MIPS devices 891# ALSA MIPS devices
@@ -939,12 +970,14 @@ CONFIG_USB_OHCI_LITTLE_ENDIAN=y
939# may also be needed; see USB_STORAGE Help for more information 970# may also be needed; see USB_STORAGE Help for more information
940# 971#
941# CONFIG_USB_STORAGE is not set 972# CONFIG_USB_STORAGE is not set
973# CONFIG_USB_LIBUSUAL is not set
942 974
943# 975#
944# USB Input Devices 976# USB Input Devices
945# 977#
946CONFIG_USB_HID=y 978CONFIG_USB_HID=y
947CONFIG_USB_HIDINPUT=y 979CONFIG_USB_HIDINPUT=y
980# CONFIG_USB_HIDINPUT_POWERBOOK is not set
948# CONFIG_HID_FF is not set 981# CONFIG_HID_FF is not set
949# CONFIG_USB_HIDDEV is not set 982# CONFIG_USB_HIDDEV is not set
950# CONFIG_USB_AIPTEK is not set 983# CONFIG_USB_AIPTEK is not set
@@ -958,6 +991,7 @@ CONFIG_USB_HIDINPUT=y
958CONFIG_USB_YEALINK=m 991CONFIG_USB_YEALINK=m
959# CONFIG_USB_XPAD is not set 992# CONFIG_USB_XPAD is not set
960# CONFIG_USB_ATI_REMOTE is not set 993# CONFIG_USB_ATI_REMOTE is not set
994# CONFIG_USB_ATI_REMOTE2 is not set
961# CONFIG_USB_KEYSPAN_REMOTE is not set 995# CONFIG_USB_KEYSPAN_REMOTE is not set
962# CONFIG_USB_APPLETOUCH is not set 996# CONFIG_USB_APPLETOUCH is not set
963 997
@@ -1057,6 +1091,7 @@ CONFIG_REISERFS_FS_SECURITY=y
1057# CONFIG_JFS_FS is not set 1091# CONFIG_JFS_FS is not set
1058CONFIG_FS_POSIX_ACL=y 1092CONFIG_FS_POSIX_ACL=y
1059# CONFIG_XFS_FS is not set 1093# CONFIG_XFS_FS is not set
1094# CONFIG_OCFS2_FS is not set
1060# CONFIG_MINIX_FS is not set 1095# CONFIG_MINIX_FS is not set
1061# CONFIG_ROMFS_FS is not set 1096# CONFIG_ROMFS_FS is not set
1062CONFIG_INOTIFY=y 1097CONFIG_INOTIFY=y
@@ -1089,6 +1124,7 @@ CONFIG_TMPFS=y
1089# CONFIG_HUGETLB_PAGE is not set 1124# CONFIG_HUGETLB_PAGE is not set
1090CONFIG_RAMFS=y 1125CONFIG_RAMFS=y
1091CONFIG_RELAYFS_FS=m 1126CONFIG_RELAYFS_FS=m
1127# CONFIG_CONFIGFS_FS is not set
1092 1128
1093# 1129#
1094# Miscellaneous filesystems 1130# Miscellaneous filesystems
@@ -1193,6 +1229,7 @@ CONFIG_NLS_DEFAULT="iso8859-1"
1193# Kernel hacking 1229# Kernel hacking
1194# 1230#
1195# CONFIG_PRINTK_TIME is not set 1231# CONFIG_PRINTK_TIME is not set
1232# CONFIG_MAGIC_SYSRQ is not set
1196# CONFIG_DEBUG_KERNEL is not set 1233# CONFIG_DEBUG_KERNEL is not set
1197CONFIG_LOG_BUF_SHIFT=14 1234CONFIG_LOG_BUF_SHIFT=14
1198CONFIG_CROSSCOMPILE=y 1235CONFIG_CROSSCOMPILE=y
@@ -1247,3 +1284,7 @@ CONFIG_CRC32=y
1247CONFIG_LIBCRC32C=m 1284CONFIG_LIBCRC32C=m
1248CONFIG_ZLIB_INFLATE=m 1285CONFIG_ZLIB_INFLATE=m
1249CONFIG_ZLIB_DEFLATE=m 1286CONFIG_ZLIB_DEFLATE=m
1287CONFIG_TEXTSEARCH=y
1288CONFIG_TEXTSEARCH_KMP=m
1289CONFIG_TEXTSEARCH_BM=m
1290CONFIG_TEXTSEARCH_FSM=m
diff --git a/arch/mips/configs/db1550_defconfig b/arch/mips/configs/db1550_defconfig
index ea5ab0ca5774..8dc1f18badfe 100644
--- a/arch/mips/configs/db1550_defconfig
+++ b/arch/mips/configs/db1550_defconfig
@@ -1,7 +1,7 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.15-rc2 3# Linux kernel version: 2.6.16-rc1
4# Thu Nov 24 01:06:07 2005 4# Fri Jan 27 15:40:00 2006
5# 5#
6CONFIG_MIPS=y 6CONFIG_MIPS=y
7 7
@@ -152,26 +152,29 @@ CONFIG_SYSVIPC=y
152# CONFIG_BSD_PROCESS_ACCT is not set 152# CONFIG_BSD_PROCESS_ACCT is not set
153CONFIG_SYSCTL=y 153CONFIG_SYSCTL=y
154# CONFIG_AUDIT is not set 154# CONFIG_AUDIT is not set
155CONFIG_HOTPLUG=y
156CONFIG_KOBJECT_UEVENT=y
157# CONFIG_IKCONFIG is not set 155# CONFIG_IKCONFIG is not set
158CONFIG_INITRAMFS_SOURCE="" 156CONFIG_INITRAMFS_SOURCE=""
157# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
159CONFIG_EMBEDDED=y 158CONFIG_EMBEDDED=y
160CONFIG_KALLSYMS=y 159CONFIG_KALLSYMS=y
161# CONFIG_KALLSYMS_EXTRA_PASS is not set 160# CONFIG_KALLSYMS_EXTRA_PASS is not set
161CONFIG_HOTPLUG=y
162CONFIG_PRINTK=y 162CONFIG_PRINTK=y
163CONFIG_BUG=y 163CONFIG_BUG=y
164CONFIG_ELF_CORE=y
164CONFIG_BASE_FULL=y 165CONFIG_BASE_FULL=y
165CONFIG_FUTEX=y 166CONFIG_FUTEX=y
166CONFIG_EPOLL=y 167CONFIG_EPOLL=y
167# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
168CONFIG_SHMEM=y 168CONFIG_SHMEM=y
169CONFIG_CC_ALIGN_FUNCTIONS=0 169CONFIG_CC_ALIGN_FUNCTIONS=0
170CONFIG_CC_ALIGN_LABELS=0 170CONFIG_CC_ALIGN_LABELS=0
171CONFIG_CC_ALIGN_LOOPS=0 171CONFIG_CC_ALIGN_LOOPS=0
172CONFIG_CC_ALIGN_JUMPS=0 172CONFIG_CC_ALIGN_JUMPS=0
173CONFIG_SLAB=y
173# CONFIG_TINY_SHMEM is not set 174# CONFIG_TINY_SHMEM is not set
174CONFIG_BASE_SMALL=0 175CONFIG_BASE_SMALL=0
176# CONFIG_SLOB is not set
177CONFIG_OBSOLETE_INTERMODULE=y
175 178
176# 179#
177# Loadable module support 180# Loadable module support
@@ -292,6 +295,21 @@ CONFIG_NETFILTER_NETLINK=m
292CONFIG_NETFILTER_NETLINK_QUEUE=m 295CONFIG_NETFILTER_NETLINK_QUEUE=m
293CONFIG_NETFILTER_NETLINK_LOG=m 296CONFIG_NETFILTER_NETLINK_LOG=m
294# CONFIG_NF_CONNTRACK is not set 297# CONFIG_NF_CONNTRACK is not set
298CONFIG_NETFILTER_XTABLES=m
299CONFIG_NETFILTER_XT_TARGET_CLASSIFY=m
300CONFIG_NETFILTER_XT_TARGET_MARK=m
301CONFIG_NETFILTER_XT_TARGET_NFQUEUE=m
302CONFIG_NETFILTER_XT_MATCH_COMMENT=m
303CONFIG_NETFILTER_XT_MATCH_DCCP=m
304CONFIG_NETFILTER_XT_MATCH_LENGTH=m
305CONFIG_NETFILTER_XT_MATCH_LIMIT=m
306CONFIG_NETFILTER_XT_MATCH_MAC=m
307CONFIG_NETFILTER_XT_MATCH_MARK=m
308CONFIG_NETFILTER_XT_MATCH_PKTTYPE=m
309CONFIG_NETFILTER_XT_MATCH_REALM=m
310CONFIG_NETFILTER_XT_MATCH_SCTP=m
311CONFIG_NETFILTER_XT_MATCH_STRING=m
312CONFIG_NETFILTER_XT_MATCH_TCPMSS=m
295 313
296# 314#
297# IP: Netfilter Configuration 315# IP: Netfilter Configuration
@@ -319,6 +337,11 @@ CONFIG_NETFILTER_NETLINK_LOG=m
319# CONFIG_ATALK is not set 337# CONFIG_ATALK is not set
320# CONFIG_X25 is not set 338# CONFIG_X25 is not set
321# CONFIG_LAPB is not set 339# CONFIG_LAPB is not set
340
341#
342# TIPC Configuration (EXPERIMENTAL)
343#
344# CONFIG_TIPC is not set
322# CONFIG_NET_DIVERT is not set 345# CONFIG_NET_DIVERT is not set
323# CONFIG_ECONET is not set 346# CONFIG_ECONET is not set
324# CONFIG_WAN_ROUTER is not set 347# CONFIG_WAN_ROUTER is not set
@@ -327,6 +350,7 @@ CONFIG_NETFILTER_NETLINK_LOG=m
327# QoS and/or fair queueing 350# QoS and/or fair queueing
328# 351#
329# CONFIG_NET_SCHED is not set 352# CONFIG_NET_SCHED is not set
353CONFIG_NET_CLS_ROUTE=y
330 354
331# 355#
332# Network testing 356# Network testing
@@ -339,7 +363,6 @@ CONFIG_IEEE80211=m
339# CONFIG_IEEE80211_DEBUG is not set 363# CONFIG_IEEE80211_DEBUG is not set
340CONFIG_IEEE80211_CRYPT_WEP=m 364CONFIG_IEEE80211_CRYPT_WEP=m
341CONFIG_IEEE80211_CRYPT_CCMP=m 365CONFIG_IEEE80211_CRYPT_CCMP=m
342CONFIG_IEEE80211_CRYPT_TKIP=m
343 366
344# 367#
345# Device Drivers 368# Device Drivers
@@ -402,6 +425,7 @@ CONFIG_MTD_CFI_UTIL=y
402# CONFIG_MTD_RAM is not set 425# CONFIG_MTD_RAM is not set
403# CONFIG_MTD_ROM is not set 426# CONFIG_MTD_ROM is not set
404# CONFIG_MTD_ABSENT is not set 427# CONFIG_MTD_ABSENT is not set
428# CONFIG_MTD_OBSOLETE_CHIPS is not set
405 429
406# 430#
407# Mapping drivers for chip access 431# Mapping drivers for chip access
@@ -593,6 +617,7 @@ CONFIG_MIPS_AU1X00_ENET=y
593# CONFIG_CASSINI is not set 617# CONFIG_CASSINI is not set
594# CONFIG_NET_VENDOR_3COM is not set 618# CONFIG_NET_VENDOR_3COM is not set
595# CONFIG_SMC91X is not set 619# CONFIG_SMC91X is not set
620# CONFIG_DM9000 is not set
596 621
597# 622#
598# Tulip family network device support 623# Tulip family network device support
@@ -613,6 +638,7 @@ CONFIG_MIPS_AU1X00_ENET=y
613# CONFIG_R8169 is not set 638# CONFIG_R8169 is not set
614# CONFIG_SIS190 is not set 639# CONFIG_SIS190 is not set
615# CONFIG_SKGE is not set 640# CONFIG_SKGE is not set
641# CONFIG_SKY2 is not set
616# CONFIG_SK98LIN is not set 642# CONFIG_SK98LIN is not set
617# CONFIG_TIGON3 is not set 643# CONFIG_TIGON3 is not set
618# CONFIG_BNX2 is not set 644# CONFIG_BNX2 is not set
@@ -633,8 +659,6 @@ CONFIG_MIPS_AU1X00_ENET=y
633# Wireless LAN (non-hamradio) 659# Wireless LAN (non-hamradio)
634# 660#
635# CONFIG_NET_RADIO is not set 661# CONFIG_NET_RADIO is not set
636# CONFIG_IPW_DEBUG is not set
637CONFIG_IPW2200=m
638 662
639# 663#
640# PCMCIA network device support 664# PCMCIA network device support
@@ -732,16 +756,15 @@ CONFIG_SERIAL_8250=y
732CONFIG_SERIAL_8250_CONSOLE=y 756CONFIG_SERIAL_8250_CONSOLE=y
733# CONFIG_SERIAL_8250_CS is not set 757# CONFIG_SERIAL_8250_CS is not set
734CONFIG_SERIAL_8250_NR_UARTS=4 758CONFIG_SERIAL_8250_NR_UARTS=4
759CONFIG_SERIAL_8250_RUNTIME_UARTS=4
735# CONFIG_SERIAL_8250_EXTENDED is not set 760# CONFIG_SERIAL_8250_EXTENDED is not set
736CONFIG_SERIAL_8250_AU1X00=y 761CONFIG_SERIAL_8250_AU1X00=y
737 762
738# 763#
739# Non-8250 serial port support 764# Non-8250 serial port support
740# 765#
741# CONFIG_SERIAL_AU1X00 is not set
742CONFIG_SERIAL_CORE=y 766CONFIG_SERIAL_CORE=y
743CONFIG_SERIAL_CORE_CONSOLE=y 767CONFIG_SERIAL_CORE_CONSOLE=y
744# CONFIG_SERIAL_JSM is not set
745CONFIG_UNIX98_PTYS=y 768CONFIG_UNIX98_PTYS=y
746CONFIG_LEGACY_PTYS=y 769CONFIG_LEGACY_PTYS=y
747CONFIG_LEGACY_PTY_COUNT=256 770CONFIG_LEGACY_PTY_COUNT=256
@@ -786,6 +809,12 @@ CONFIG_SYNCLINK_CS=m
786# CONFIG_I2C is not set 809# CONFIG_I2C is not set
787 810
788# 811#
812# SPI support
813#
814# CONFIG_SPI is not set
815# CONFIG_SPI_MASTER is not set
816
817#
789# Dallas's 1-wire bus 818# Dallas's 1-wire bus
790# 819#
791# CONFIG_W1 is not set 820# CONFIG_W1 is not set
@@ -878,6 +907,7 @@ CONFIG_REISERFS_FS_SECURITY=y
878# CONFIG_JFS_FS is not set 907# CONFIG_JFS_FS is not set
879CONFIG_FS_POSIX_ACL=y 908CONFIG_FS_POSIX_ACL=y
880# CONFIG_XFS_FS is not set 909# CONFIG_XFS_FS is not set
910# CONFIG_OCFS2_FS is not set
881# CONFIG_MINIX_FS is not set 911# CONFIG_MINIX_FS is not set
882# CONFIG_ROMFS_FS is not set 912# CONFIG_ROMFS_FS is not set
883CONFIG_INOTIFY=y 913CONFIG_INOTIFY=y
@@ -910,6 +940,7 @@ CONFIG_TMPFS=y
910# CONFIG_HUGETLB_PAGE is not set 940# CONFIG_HUGETLB_PAGE is not set
911CONFIG_RAMFS=y 941CONFIG_RAMFS=y
912CONFIG_RELAYFS_FS=m 942CONFIG_RELAYFS_FS=m
943# CONFIG_CONFIGFS_FS is not set
913 944
914# 945#
915# Miscellaneous filesystems 946# Miscellaneous filesystems
@@ -1014,6 +1045,7 @@ CONFIG_NLS_DEFAULT="iso8859-1"
1014# Kernel hacking 1045# Kernel hacking
1015# 1046#
1016# CONFIG_PRINTK_TIME is not set 1047# CONFIG_PRINTK_TIME is not set
1048# CONFIG_MAGIC_SYSRQ is not set
1017# CONFIG_DEBUG_KERNEL is not set 1049# CONFIG_DEBUG_KERNEL is not set
1018CONFIG_LOG_BUF_SHIFT=14 1050CONFIG_LOG_BUF_SHIFT=14
1019CONFIG_CROSSCOMPILE=y 1051CONFIG_CROSSCOMPILE=y
@@ -1068,3 +1100,7 @@ CONFIG_CRC32=y
1068CONFIG_LIBCRC32C=m 1100CONFIG_LIBCRC32C=m
1069CONFIG_ZLIB_INFLATE=m 1101CONFIG_ZLIB_INFLATE=m
1070CONFIG_ZLIB_DEFLATE=m 1102CONFIG_ZLIB_DEFLATE=m
1103CONFIG_TEXTSEARCH=y
1104CONFIG_TEXTSEARCH_KMP=m
1105CONFIG_TEXTSEARCH_BM=m
1106CONFIG_TEXTSEARCH_FSM=m
diff --git a/arch/mips/configs/ddb5476_defconfig b/arch/mips/configs/ddb5476_defconfig
index a81e2de6947f..8fae63e47e5e 100644
--- a/arch/mips/configs/ddb5476_defconfig
+++ b/arch/mips/configs/ddb5476_defconfig
@@ -1,7 +1,7 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.15-rc2 3# Linux kernel version: 2.6.16-rc1
4# Thu Nov 24 01:06:09 2005 4# Fri Jan 27 15:40:02 2006
5# 5#
6CONFIG_MIPS=y 6CONFIG_MIPS=y
7 7
@@ -151,26 +151,28 @@ CONFIG_SYSVIPC=y
151# CONFIG_BSD_PROCESS_ACCT is not set 151# CONFIG_BSD_PROCESS_ACCT is not set
152CONFIG_SYSCTL=y 152CONFIG_SYSCTL=y
153# CONFIG_AUDIT is not set 153# CONFIG_AUDIT is not set
154CONFIG_HOTPLUG=y
155CONFIG_KOBJECT_UEVENT=y
156# CONFIG_IKCONFIG is not set 154# CONFIG_IKCONFIG is not set
157CONFIG_INITRAMFS_SOURCE="" 155CONFIG_INITRAMFS_SOURCE=""
156# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
158CONFIG_EMBEDDED=y 157CONFIG_EMBEDDED=y
159CONFIG_KALLSYMS=y 158CONFIG_KALLSYMS=y
160# CONFIG_KALLSYMS_EXTRA_PASS is not set 159# CONFIG_KALLSYMS_EXTRA_PASS is not set
160CONFIG_HOTPLUG=y
161CONFIG_PRINTK=y 161CONFIG_PRINTK=y
162CONFIG_BUG=y 162CONFIG_BUG=y
163CONFIG_ELF_CORE=y
163CONFIG_BASE_FULL=y 164CONFIG_BASE_FULL=y
164CONFIG_FUTEX=y 165CONFIG_FUTEX=y
165CONFIG_EPOLL=y 166CONFIG_EPOLL=y
166# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
167CONFIG_SHMEM=y 167CONFIG_SHMEM=y
168CONFIG_CC_ALIGN_FUNCTIONS=0 168CONFIG_CC_ALIGN_FUNCTIONS=0
169CONFIG_CC_ALIGN_LABELS=0 169CONFIG_CC_ALIGN_LABELS=0
170CONFIG_CC_ALIGN_LOOPS=0 170CONFIG_CC_ALIGN_LOOPS=0
171CONFIG_CC_ALIGN_JUMPS=0 171CONFIG_CC_ALIGN_JUMPS=0
172CONFIG_SLAB=y
172# CONFIG_TINY_SHMEM is not set 173# CONFIG_TINY_SHMEM is not set
173CONFIG_BASE_SMALL=0 174CONFIG_BASE_SMALL=0
175# CONFIG_SLOB is not set
174 176
175# 177#
176# Loadable module support 178# Loadable module support
@@ -276,6 +278,11 @@ CONFIG_TCP_CONG_BIC=y
276# CONFIG_ATALK is not set 278# CONFIG_ATALK is not set
277# CONFIG_X25 is not set 279# CONFIG_X25 is not set
278# CONFIG_LAPB is not set 280# CONFIG_LAPB is not set
281
282#
283# TIPC Configuration (EXPERIMENTAL)
284#
285# CONFIG_TIPC is not set
279# CONFIG_NET_DIVERT is not set 286# CONFIG_NET_DIVERT is not set
280# CONFIG_ECONET is not set 287# CONFIG_ECONET is not set
281# CONFIG_WAN_ROUTER is not set 288# CONFIG_WAN_ROUTER is not set
@@ -296,7 +303,6 @@ CONFIG_IEEE80211=y
296# CONFIG_IEEE80211_DEBUG is not set 303# CONFIG_IEEE80211_DEBUG is not set
297CONFIG_IEEE80211_CRYPT_WEP=y 304CONFIG_IEEE80211_CRYPT_WEP=y
298CONFIG_IEEE80211_CRYPT_CCMP=y 305CONFIG_IEEE80211_CRYPT_CCMP=y
299CONFIG_IEEE80211_CRYPT_TKIP=y
300 306
301# 307#
302# Device Drivers 308# Device Drivers
@@ -445,6 +451,7 @@ CONFIG_NET_ETHERNET=y
445# CONFIG_CASSINI is not set 451# CONFIG_CASSINI is not set
446# CONFIG_NET_VENDOR_3COM is not set 452# CONFIG_NET_VENDOR_3COM is not set
447# CONFIG_NET_VENDOR_SMC is not set 453# CONFIG_NET_VENDOR_SMC is not set
454# CONFIG_DM9000 is not set
448# CONFIG_NET_VENDOR_RACAL is not set 455# CONFIG_NET_VENDOR_RACAL is not set
449 456
450# 457#
@@ -469,6 +476,7 @@ CONFIG_NET_ETHERNET=y
469# CONFIG_R8169 is not set 476# CONFIG_R8169 is not set
470# CONFIG_SIS190 is not set 477# CONFIG_SIS190 is not set
471# CONFIG_SKGE is not set 478# CONFIG_SKGE is not set
479# CONFIG_SKY2 is not set
472# CONFIG_SK98LIN is not set 480# CONFIG_SK98LIN is not set
473# CONFIG_TIGON3 is not set 481# CONFIG_TIGON3 is not set
474# CONFIG_BNX2 is not set 482# CONFIG_BNX2 is not set
@@ -489,8 +497,6 @@ CONFIG_NET_ETHERNET=y
489# Wireless LAN (non-hamradio) 497# Wireless LAN (non-hamradio)
490# 498#
491# CONFIG_NET_RADIO is not set 499# CONFIG_NET_RADIO is not set
492# CONFIG_IPW_DEBUG is not set
493CONFIG_IPW2200=y
494 500
495# 501#
496# Wan interfaces 502# Wan interfaces
@@ -566,6 +572,7 @@ CONFIG_HW_CONSOLE=y
566CONFIG_SERIAL_8250=y 572CONFIG_SERIAL_8250=y
567CONFIG_SERIAL_8250_CONSOLE=y 573CONFIG_SERIAL_8250_CONSOLE=y
568CONFIG_SERIAL_8250_NR_UARTS=4 574CONFIG_SERIAL_8250_NR_UARTS=4
575CONFIG_SERIAL_8250_RUNTIME_UARTS=4
569# CONFIG_SERIAL_8250_EXTENDED is not set 576# CONFIG_SERIAL_8250_EXTENDED is not set
570 577
571# 578#
@@ -573,7 +580,6 @@ CONFIG_SERIAL_8250_NR_UARTS=4
573# 580#
574CONFIG_SERIAL_CORE=y 581CONFIG_SERIAL_CORE=y
575CONFIG_SERIAL_CORE_CONSOLE=y 582CONFIG_SERIAL_CORE_CONSOLE=y
576# CONFIG_SERIAL_JSM is not set
577CONFIG_UNIX98_PTYS=y 583CONFIG_UNIX98_PTYS=y
578CONFIG_LEGACY_PTYS=y 584CONFIG_LEGACY_PTYS=y
579CONFIG_LEGACY_PTY_COUNT=256 585CONFIG_LEGACY_PTY_COUNT=256
@@ -611,6 +617,12 @@ CONFIG_LEGACY_PTY_COUNT=256
611# CONFIG_I2C is not set 617# CONFIG_I2C is not set
612 618
613# 619#
620# SPI support
621#
622# CONFIG_SPI is not set
623# CONFIG_SPI_MASTER is not set
624
625#
614# Dallas's 1-wire bus 626# Dallas's 1-wire bus
615# 627#
616# CONFIG_W1 is not set 628# CONFIG_W1 is not set
@@ -669,7 +681,6 @@ CONFIG_FB=y
669# CONFIG_FB_3DFX is not set 681# CONFIG_FB_3DFX is not set
670# CONFIG_FB_VOODOO1 is not set 682# CONFIG_FB_VOODOO1 is not set
671# CONFIG_FB_SMIVGX is not set 683# CONFIG_FB_SMIVGX is not set
672# CONFIG_FB_CYBLA is not set
673# CONFIG_FB_TRIDENT is not set 684# CONFIG_FB_TRIDENT is not set
674# CONFIG_FB_VIRTUAL is not set 685# CONFIG_FB_VIRTUAL is not set
675 686
@@ -729,11 +740,11 @@ CONFIG_EXT2_FS=y
729# CONFIG_EXT2_FS_XATTR is not set 740# CONFIG_EXT2_FS_XATTR is not set
730# CONFIG_EXT2_FS_XIP is not set 741# CONFIG_EXT2_FS_XIP is not set
731# CONFIG_EXT3_FS is not set 742# CONFIG_EXT3_FS is not set
732# CONFIG_JBD is not set
733# CONFIG_REISERFS_FS is not set 743# CONFIG_REISERFS_FS is not set
734# CONFIG_JFS_FS is not set 744# CONFIG_JFS_FS is not set
735# CONFIG_FS_POSIX_ACL is not set 745# CONFIG_FS_POSIX_ACL is not set
736# CONFIG_XFS_FS is not set 746# CONFIG_XFS_FS is not set
747# CONFIG_OCFS2_FS is not set
737# CONFIG_MINIX_FS is not set 748# CONFIG_MINIX_FS is not set
738# CONFIG_ROMFS_FS is not set 749# CONFIG_ROMFS_FS is not set
739CONFIG_INOTIFY=y 750CONFIG_INOTIFY=y
@@ -766,6 +777,7 @@ CONFIG_SYSFS=y
766# CONFIG_HUGETLB_PAGE is not set 777# CONFIG_HUGETLB_PAGE is not set
767CONFIG_RAMFS=y 778CONFIG_RAMFS=y
768CONFIG_RELAYFS_FS=y 779CONFIG_RELAYFS_FS=y
780# CONFIG_CONFIGFS_FS is not set
769 781
770# 782#
771# Miscellaneous filesystems 783# Miscellaneous filesystems
@@ -825,6 +837,7 @@ CONFIG_MSDOS_PARTITION=y
825# Kernel hacking 837# Kernel hacking
826# 838#
827# CONFIG_PRINTK_TIME is not set 839# CONFIG_PRINTK_TIME is not set
840# CONFIG_MAGIC_SYSRQ is not set
828# CONFIG_DEBUG_KERNEL is not set 841# CONFIG_DEBUG_KERNEL is not set
829CONFIG_LOG_BUF_SHIFT=14 842CONFIG_LOG_BUF_SHIFT=14
830CONFIG_CROSSCOMPILE=y 843CONFIG_CROSSCOMPILE=y
diff --git a/arch/mips/configs/ddb5477_defconfig b/arch/mips/configs/ddb5477_defconfig
index f1c27c2fb033..a0fcd44e7709 100644
--- a/arch/mips/configs/ddb5477_defconfig
+++ b/arch/mips/configs/ddb5477_defconfig
@@ -1,7 +1,7 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.15-rc2 3# Linux kernel version: 2.6.16-rc1
4# Thu Nov 24 01:06:11 2005 4# Fri Jan 27 15:40:02 2006
5# 5#
6CONFIG_MIPS=y 6CONFIG_MIPS=y
7 7
@@ -151,26 +151,28 @@ CONFIG_SYSVIPC=y
151# CONFIG_BSD_PROCESS_ACCT is not set 151# CONFIG_BSD_PROCESS_ACCT is not set
152CONFIG_SYSCTL=y 152CONFIG_SYSCTL=y
153# CONFIG_AUDIT is not set 153# CONFIG_AUDIT is not set
154CONFIG_HOTPLUG=y
155CONFIG_KOBJECT_UEVENT=y
156# CONFIG_IKCONFIG is not set 154# CONFIG_IKCONFIG is not set
157CONFIG_INITRAMFS_SOURCE="" 155CONFIG_INITRAMFS_SOURCE=""
156# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
158CONFIG_EMBEDDED=y 157CONFIG_EMBEDDED=y
159CONFIG_KALLSYMS=y 158CONFIG_KALLSYMS=y
160# CONFIG_KALLSYMS_EXTRA_PASS is not set 159# CONFIG_KALLSYMS_EXTRA_PASS is not set
160CONFIG_HOTPLUG=y
161CONFIG_PRINTK=y 161CONFIG_PRINTK=y
162CONFIG_BUG=y 162CONFIG_BUG=y
163CONFIG_ELF_CORE=y
163CONFIG_BASE_FULL=y 164CONFIG_BASE_FULL=y
164CONFIG_FUTEX=y 165CONFIG_FUTEX=y
165CONFIG_EPOLL=y 166CONFIG_EPOLL=y
166# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
167CONFIG_SHMEM=y 167CONFIG_SHMEM=y
168CONFIG_CC_ALIGN_FUNCTIONS=0 168CONFIG_CC_ALIGN_FUNCTIONS=0
169CONFIG_CC_ALIGN_LABELS=0 169CONFIG_CC_ALIGN_LABELS=0
170CONFIG_CC_ALIGN_LOOPS=0 170CONFIG_CC_ALIGN_LOOPS=0
171CONFIG_CC_ALIGN_JUMPS=0 171CONFIG_CC_ALIGN_JUMPS=0
172CONFIG_SLAB=y
172# CONFIG_TINY_SHMEM is not set 173# CONFIG_TINY_SHMEM is not set
173CONFIG_BASE_SMALL=0 174CONFIG_BASE_SMALL=0
175# CONFIG_SLOB is not set
174 176
175# 177#
176# Loadable module support 178# Loadable module support
@@ -275,6 +277,11 @@ CONFIG_TCP_CONG_BIC=y
275# CONFIG_ATALK is not set 277# CONFIG_ATALK is not set
276# CONFIG_X25 is not set 278# CONFIG_X25 is not set
277# CONFIG_LAPB is not set 279# CONFIG_LAPB is not set
280
281#
282# TIPC Configuration (EXPERIMENTAL)
283#
284# CONFIG_TIPC is not set
278# CONFIG_NET_DIVERT is not set 285# CONFIG_NET_DIVERT is not set
279# CONFIG_ECONET is not set 286# CONFIG_ECONET is not set
280# CONFIG_WAN_ROUTER is not set 287# CONFIG_WAN_ROUTER is not set
@@ -295,7 +302,6 @@ CONFIG_IEEE80211=y
295# CONFIG_IEEE80211_DEBUG is not set 302# CONFIG_IEEE80211_DEBUG is not set
296CONFIG_IEEE80211_CRYPT_WEP=y 303CONFIG_IEEE80211_CRYPT_WEP=y
297CONFIG_IEEE80211_CRYPT_CCMP=y 304CONFIG_IEEE80211_CRYPT_CCMP=y
298CONFIG_IEEE80211_CRYPT_TKIP=y
299 305
300# 306#
301# Device Drivers 307# Device Drivers
@@ -414,6 +420,7 @@ CONFIG_MII=y
414# CONFIG_SUNGEM is not set 420# CONFIG_SUNGEM is not set
415# CONFIG_CASSINI is not set 421# CONFIG_CASSINI is not set
416# CONFIG_NET_VENDOR_3COM is not set 422# CONFIG_NET_VENDOR_3COM is not set
423# CONFIG_DM9000 is not set
417 424
418# 425#
419# Tulip family network device support 426# Tulip family network device support
@@ -453,6 +460,7 @@ CONFIG_PCNET32=y
453# CONFIG_R8169 is not set 460# CONFIG_R8169 is not set
454# CONFIG_SIS190 is not set 461# CONFIG_SIS190 is not set
455# CONFIG_SKGE is not set 462# CONFIG_SKGE is not set
463# CONFIG_SKY2 is not set
456# CONFIG_SK98LIN is not set 464# CONFIG_SK98LIN is not set
457# CONFIG_VIA_VELOCITY is not set 465# CONFIG_VIA_VELOCITY is not set
458# CONFIG_TIGON3 is not set 466# CONFIG_TIGON3 is not set
@@ -474,8 +482,6 @@ CONFIG_PCNET32=y
474# Wireless LAN (non-hamradio) 482# Wireless LAN (non-hamradio)
475# 483#
476# CONFIG_NET_RADIO is not set 484# CONFIG_NET_RADIO is not set
477# CONFIG_IPW_DEBUG is not set
478CONFIG_IPW2200=y
479 485
480# 486#
481# Wan interfaces 487# Wan interfaces
@@ -551,6 +557,7 @@ CONFIG_HW_CONSOLE=y
551CONFIG_SERIAL_8250=y 557CONFIG_SERIAL_8250=y
552CONFIG_SERIAL_8250_CONSOLE=y 558CONFIG_SERIAL_8250_CONSOLE=y
553CONFIG_SERIAL_8250_NR_UARTS=4 559CONFIG_SERIAL_8250_NR_UARTS=4
560CONFIG_SERIAL_8250_RUNTIME_UARTS=4
554# CONFIG_SERIAL_8250_EXTENDED is not set 561# CONFIG_SERIAL_8250_EXTENDED is not set
555 562
556# 563#
@@ -558,7 +565,6 @@ CONFIG_SERIAL_8250_NR_UARTS=4
558# 565#
559CONFIG_SERIAL_CORE=y 566CONFIG_SERIAL_CORE=y
560CONFIG_SERIAL_CORE_CONSOLE=y 567CONFIG_SERIAL_CORE_CONSOLE=y
561# CONFIG_SERIAL_JSM is not set
562CONFIG_UNIX98_PTYS=y 568CONFIG_UNIX98_PTYS=y
563CONFIG_LEGACY_PTYS=y 569CONFIG_LEGACY_PTYS=y
564CONFIG_LEGACY_PTY_COUNT=256 570CONFIG_LEGACY_PTY_COUNT=256
@@ -596,6 +602,12 @@ CONFIG_LEGACY_PTY_COUNT=256
596# CONFIG_I2C is not set 602# CONFIG_I2C is not set
597 603
598# 604#
605# SPI support
606#
607# CONFIG_SPI is not set
608# CONFIG_SPI_MASTER is not set
609
610#
599# Dallas's 1-wire bus 611# Dallas's 1-wire bus
600# 612#
601# CONFIG_W1 is not set 613# CONFIG_W1 is not set
@@ -677,11 +689,11 @@ CONFIG_EXT2_FS=y
677# CONFIG_EXT2_FS_XATTR is not set 689# CONFIG_EXT2_FS_XATTR is not set
678# CONFIG_EXT2_FS_XIP is not set 690# CONFIG_EXT2_FS_XIP is not set
679# CONFIG_EXT3_FS is not set 691# CONFIG_EXT3_FS is not set
680# CONFIG_JBD is not set
681# CONFIG_REISERFS_FS is not set 692# CONFIG_REISERFS_FS is not set
682# CONFIG_JFS_FS is not set 693# CONFIG_JFS_FS is not set
683# CONFIG_FS_POSIX_ACL is not set 694# CONFIG_FS_POSIX_ACL is not set
684# CONFIG_XFS_FS is not set 695# CONFIG_XFS_FS is not set
696# CONFIG_OCFS2_FS is not set
685# CONFIG_MINIX_FS is not set 697# CONFIG_MINIX_FS is not set
686# CONFIG_ROMFS_FS is not set 698# CONFIG_ROMFS_FS is not set
687CONFIG_INOTIFY=y 699CONFIG_INOTIFY=y
@@ -714,6 +726,7 @@ CONFIG_SYSFS=y
714# CONFIG_HUGETLB_PAGE is not set 726# CONFIG_HUGETLB_PAGE is not set
715CONFIG_RAMFS=y 727CONFIG_RAMFS=y
716CONFIG_RELAYFS_FS=y 728CONFIG_RELAYFS_FS=y
729# CONFIG_CONFIGFS_FS is not set
717 730
718# 731#
719# Miscellaneous filesystems 732# Miscellaneous filesystems
@@ -776,6 +789,7 @@ CONFIG_MSDOS_PARTITION=y
776# Kernel hacking 789# Kernel hacking
777# 790#
778# CONFIG_PRINTK_TIME is not set 791# CONFIG_PRINTK_TIME is not set
792# CONFIG_MAGIC_SYSRQ is not set
779# CONFIG_DEBUG_KERNEL is not set 793# CONFIG_DEBUG_KERNEL is not set
780CONFIG_LOG_BUF_SHIFT=14 794CONFIG_LOG_BUF_SHIFT=14
781CONFIG_CROSSCOMPILE=y 795CONFIG_CROSSCOMPILE=y
diff --git a/arch/mips/configs/decstation_defconfig b/arch/mips/configs/decstation_defconfig
index 08a4de6ec4a6..5a181eadd437 100644
--- a/arch/mips/configs/decstation_defconfig
+++ b/arch/mips/configs/decstation_defconfig
@@ -1,7 +1,7 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.15-rc2 3# Linux kernel version: 2.6.16-rc1
4# Thu Nov 24 01:06:13 2005 4# Fri Jan 27 15:40:03 2006
5# 5#
6CONFIG_MIPS=y 6CONFIG_MIPS=y
7 7
@@ -150,27 +150,29 @@ CONFIG_SYSVIPC=y
150# CONFIG_BSD_PROCESS_ACCT is not set 150# CONFIG_BSD_PROCESS_ACCT is not set
151CONFIG_SYSCTL=y 151CONFIG_SYSCTL=y
152# CONFIG_AUDIT is not set 152# CONFIG_AUDIT is not set
153# CONFIG_HOTPLUG is not set
154CONFIG_KOBJECT_UEVENT=y
155# CONFIG_IKCONFIG is not set 153# CONFIG_IKCONFIG is not set
156CONFIG_INITRAMFS_SOURCE="" 154CONFIG_INITRAMFS_SOURCE=""
155# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
157CONFIG_EMBEDDED=y 156CONFIG_EMBEDDED=y
158CONFIG_KALLSYMS=y 157CONFIG_KALLSYMS=y
159# CONFIG_KALLSYMS_ALL is not set 158# CONFIG_KALLSYMS_ALL is not set
160# CONFIG_KALLSYMS_EXTRA_PASS is not set 159# CONFIG_KALLSYMS_EXTRA_PASS is not set
160# CONFIG_HOTPLUG is not set
161CONFIG_PRINTK=y 161CONFIG_PRINTK=y
162CONFIG_BUG=y 162CONFIG_BUG=y
163CONFIG_ELF_CORE=y
163CONFIG_BASE_FULL=y 164CONFIG_BASE_FULL=y
164CONFIG_FUTEX=y 165CONFIG_FUTEX=y
165CONFIG_EPOLL=y 166CONFIG_EPOLL=y
166# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
167CONFIG_SHMEM=y 167CONFIG_SHMEM=y
168CONFIG_CC_ALIGN_FUNCTIONS=0 168CONFIG_CC_ALIGN_FUNCTIONS=0
169CONFIG_CC_ALIGN_LABELS=0 169CONFIG_CC_ALIGN_LABELS=0
170CONFIG_CC_ALIGN_LOOPS=0 170CONFIG_CC_ALIGN_LOOPS=0
171CONFIG_CC_ALIGN_JUMPS=0 171CONFIG_CC_ALIGN_JUMPS=0
172CONFIG_SLAB=y
172# CONFIG_TINY_SHMEM is not set 173# CONFIG_TINY_SHMEM is not set
173CONFIG_BASE_SMALL=0 174CONFIG_BASE_SMALL=0
175# CONFIG_SLOB is not set
174 176
175# 177#
176# Loadable module support 178# Loadable module support
@@ -278,6 +280,11 @@ CONFIG_TCP_CONG_BIC=y
278# CONFIG_ATALK is not set 280# CONFIG_ATALK is not set
279# CONFIG_X25 is not set 281# CONFIG_X25 is not set
280# CONFIG_LAPB is not set 282# CONFIG_LAPB is not set
283
284#
285# TIPC Configuration (EXPERIMENTAL)
286#
287# CONFIG_TIPC is not set
281# CONFIG_NET_DIVERT is not set 288# CONFIG_NET_DIVERT is not set
282# CONFIG_ECONET is not set 289# CONFIG_ECONET is not set
283# CONFIG_WAN_ROUTER is not set 290# CONFIG_WAN_ROUTER is not set
@@ -298,7 +305,6 @@ CONFIG_IEEE80211=m
298# CONFIG_IEEE80211_DEBUG is not set 305# CONFIG_IEEE80211_DEBUG is not set
299CONFIG_IEEE80211_CRYPT_WEP=m 306CONFIG_IEEE80211_CRYPT_WEP=m
300CONFIG_IEEE80211_CRYPT_CCMP=m 307CONFIG_IEEE80211_CRYPT_CCMP=m
301CONFIG_IEEE80211_CRYPT_TKIP=m
302 308
303# 309#
304# Device Drivers 310# Device Drivers
@@ -436,6 +442,7 @@ CONFIG_CICADA_PHY=m
436# 442#
437CONFIG_NET_ETHERNET=y 443CONFIG_NET_ETHERNET=y
438# CONFIG_MII is not set 444# CONFIG_MII is not set
445# CONFIG_DM9000 is not set
439CONFIG_DECLANCE=y 446CONFIG_DECLANCE=y
440 447
441# 448#
@@ -539,6 +546,12 @@ CONFIG_RTC=y
539# CONFIG_I2C is not set 546# CONFIG_I2C is not set
540 547
541# 548#
549# SPI support
550#
551# CONFIG_SPI is not set
552# CONFIG_SPI_MASTER is not set
553
554#
542# Dallas's 1-wire bus 555# Dallas's 1-wire bus
543# 556#
544# CONFIG_W1 is not set 557# CONFIG_W1 is not set
@@ -636,12 +649,12 @@ CONFIG_EXT2_FS_POSIX_ACL=y
636CONFIG_EXT2_FS_SECURITY=y 649CONFIG_EXT2_FS_SECURITY=y
637# CONFIG_EXT2_FS_XIP is not set 650# CONFIG_EXT2_FS_XIP is not set
638# CONFIG_EXT3_FS is not set 651# CONFIG_EXT3_FS is not set
639# CONFIG_JBD is not set
640CONFIG_FS_MBCACHE=y 652CONFIG_FS_MBCACHE=y
641# CONFIG_REISERFS_FS is not set 653# CONFIG_REISERFS_FS is not set
642# CONFIG_JFS_FS is not set 654# CONFIG_JFS_FS is not set
643CONFIG_FS_POSIX_ACL=y 655CONFIG_FS_POSIX_ACL=y
644# CONFIG_XFS_FS is not set 656# CONFIG_XFS_FS is not set
657# CONFIG_OCFS2_FS is not set
645# CONFIG_MINIX_FS is not set 658# CONFIG_MINIX_FS is not set
646# CONFIG_ROMFS_FS is not set 659# CONFIG_ROMFS_FS is not set
647CONFIG_INOTIFY=y 660CONFIG_INOTIFY=y
@@ -674,6 +687,7 @@ CONFIG_TMPFS=y
674# CONFIG_HUGETLB_PAGE is not set 687# CONFIG_HUGETLB_PAGE is not set
675CONFIG_RAMFS=y 688CONFIG_RAMFS=y
676CONFIG_RELAYFS_FS=m 689CONFIG_RELAYFS_FS=m
690# CONFIG_CONFIGFS_FS is not set
677 691
678# 692#
679# Miscellaneous filesystems 693# Miscellaneous filesystems
@@ -734,6 +748,7 @@ CONFIG_MSDOS_PARTITION=y
734# CONFIG_SGI_PARTITION is not set 748# CONFIG_SGI_PARTITION is not set
735CONFIG_ULTRIX_PARTITION=y 749CONFIG_ULTRIX_PARTITION=y
736# CONFIG_SUN_PARTITION is not set 750# CONFIG_SUN_PARTITION is not set
751# CONFIG_KARMA_PARTITION is not set
737# CONFIG_EFI_PARTITION is not set 752# CONFIG_EFI_PARTITION is not set
738 753
739# 754#
@@ -750,18 +765,20 @@ CONFIG_ULTRIX_PARTITION=y
750# Kernel hacking 765# Kernel hacking
751# 766#
752# CONFIG_PRINTK_TIME is not set 767# CONFIG_PRINTK_TIME is not set
753CONFIG_DEBUG_KERNEL=y
754CONFIG_MAGIC_SYSRQ=y 768CONFIG_MAGIC_SYSRQ=y
769CONFIG_DEBUG_KERNEL=y
755CONFIG_LOG_BUF_SHIFT=14 770CONFIG_LOG_BUF_SHIFT=14
756CONFIG_DETECT_SOFTLOCKUP=y 771CONFIG_DETECT_SOFTLOCKUP=y
757# CONFIG_SCHEDSTATS is not set 772# CONFIG_SCHEDSTATS is not set
758# CONFIG_DEBUG_SLAB is not set 773# CONFIG_DEBUG_SLAB is not set
774CONFIG_DEBUG_MUTEXES=y
759# CONFIG_DEBUG_SPINLOCK is not set 775# CONFIG_DEBUG_SPINLOCK is not set
760# CONFIG_DEBUG_SPINLOCK_SLEEP is not set 776# CONFIG_DEBUG_SPINLOCK_SLEEP is not set
761# CONFIG_DEBUG_KOBJECT is not set 777# CONFIG_DEBUG_KOBJECT is not set
762# CONFIG_DEBUG_INFO is not set 778# CONFIG_DEBUG_INFO is not set
763# CONFIG_DEBUG_FS is not set 779# CONFIG_DEBUG_FS is not set
764# CONFIG_DEBUG_VM is not set 780# CONFIG_DEBUG_VM is not set
781CONFIG_FORCED_INLINING=y
765# CONFIG_RCU_TORTURE_TEST is not set 782# CONFIG_RCU_TORTURE_TEST is not set
766CONFIG_CROSSCOMPILE=y 783CONFIG_CROSSCOMPILE=y
767CONFIG_CMDLINE="" 784CONFIG_CMDLINE=""
diff --git a/arch/mips/configs/e55_defconfig b/arch/mips/configs/e55_defconfig
index c9070cef08b1..8fbfc06a6a2a 100644
--- a/arch/mips/configs/e55_defconfig
+++ b/arch/mips/configs/e55_defconfig
@@ -1,7 +1,7 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.15-rc2 3# Linux kernel version: 2.6.16-rc1
4# Thu Nov 24 01:06:14 2005 4# Fri Jan 27 15:40:04 2006
5# 5#
6CONFIG_MIPS=y 6CONFIG_MIPS=y
7 7
@@ -63,9 +63,9 @@ CONFIG_MACH_VR41XX=y
63# CONFIG_TOSHIBA_JMR3927 is not set 63# CONFIG_TOSHIBA_JMR3927 is not set
64# CONFIG_TOSHIBA_RBTX4927 is not set 64# CONFIG_TOSHIBA_RBTX4927 is not set
65# CONFIG_TOSHIBA_RBTX4938 is not set 65# CONFIG_TOSHIBA_RBTX4938 is not set
66# CONFIG_NEC_CMBVR4133 is not set
67CONFIG_CASIO_E55=y 66CONFIG_CASIO_E55=y
68# CONFIG_IBM_WORKPAD is not set 67# CONFIG_IBM_WORKPAD is not set
68# CONFIG_NEC_CMBVR4133 is not set
69# CONFIG_TANBAC_TB022X is not set 69# CONFIG_TANBAC_TB022X is not set
70# CONFIG_VICTOR_MPC30X is not set 70# CONFIG_VICTOR_MPC30X is not set
71# CONFIG_ZAO_CAPCELLA is not set 71# CONFIG_ZAO_CAPCELLA is not set
@@ -88,7 +88,7 @@ CONFIG_MIPS_L1_CACHE_SHIFT=5
88# CONFIG_CPU_MIPS64_R2 is not set 88# CONFIG_CPU_MIPS64_R2 is not set
89# CONFIG_CPU_R3000 is not set 89# CONFIG_CPU_R3000 is not set
90# CONFIG_CPU_TX39XX is not set 90# CONFIG_CPU_TX39XX is not set
91CONFIG_CPU_VR41XX=y 91# CONFIG_CPU_VR41XX is not set
92# CONFIG_CPU_R4300 is not set 92# CONFIG_CPU_R4300 is not set
93# CONFIG_CPU_R4X00 is not set 93# CONFIG_CPU_R4X00 is not set
94# CONFIG_CPU_TX49XX is not set 94# CONFIG_CPU_TX49XX is not set
@@ -101,23 +101,18 @@ CONFIG_CPU_VR41XX=y
101# CONFIG_CPU_RM7000 is not set 101# CONFIG_CPU_RM7000 is not set
102# CONFIG_CPU_RM9000 is not set 102# CONFIG_CPU_RM9000 is not set
103# CONFIG_CPU_SB1 is not set 103# CONFIG_CPU_SB1 is not set
104CONFIG_SYS_HAS_CPU_VR41XX=y
105CONFIG_SYS_SUPPORTS_32BIT_KERNEL=y
106CONFIG_SYS_SUPPORTS_64BIT_KERNEL=y
107CONFIG_CPU_SUPPORTS_32BIT_KERNEL=y
108CONFIG_CPU_SUPPORTS_64BIT_KERNEL=y
109 104
110# 105#
111# Kernel type 106# Kernel type
112# 107#
113CONFIG_32BIT=y 108# CONFIG_32BIT is not set
114# CONFIG_64BIT is not set 109# CONFIG_64BIT is not set
115CONFIG_PAGE_SIZE_4KB=y 110CONFIG_PAGE_SIZE_4KB=y
116# CONFIG_PAGE_SIZE_8KB is not set 111# CONFIG_PAGE_SIZE_8KB is not set
117# CONFIG_PAGE_SIZE_16KB is not set 112# CONFIG_PAGE_SIZE_16KB is not set
118# CONFIG_PAGE_SIZE_64KB is not set 113# CONFIG_PAGE_SIZE_64KB is not set
119# CONFIG_MIPS_MT is not set 114# CONFIG_MIPS_MT is not set
120# CONFIG_CPU_ADVANCED is not set 115CONFIG_CPU_HAS_LLSC=y
121CONFIG_CPU_HAS_SYNC=y 116CONFIG_CPU_HAS_SYNC=y
122CONFIG_GENERIC_HARDIRQS=y 117CONFIG_GENERIC_HARDIRQS=y
123CONFIG_GENERIC_IRQ_PROBE=y 118CONFIG_GENERIC_IRQ_PROBE=y
@@ -153,26 +148,28 @@ CONFIG_SYSVIPC=y
153# CONFIG_BSD_PROCESS_ACCT is not set 148# CONFIG_BSD_PROCESS_ACCT is not set
154CONFIG_SYSCTL=y 149CONFIG_SYSCTL=y
155# CONFIG_AUDIT is not set 150# CONFIG_AUDIT is not set
156# CONFIG_HOTPLUG is not set
157CONFIG_KOBJECT_UEVENT=y
158# CONFIG_IKCONFIG is not set 151# CONFIG_IKCONFIG is not set
159CONFIG_INITRAMFS_SOURCE="" 152CONFIG_INITRAMFS_SOURCE=""
153# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
160CONFIG_EMBEDDED=y 154CONFIG_EMBEDDED=y
161CONFIG_KALLSYMS=y 155CONFIG_KALLSYMS=y
162# CONFIG_KALLSYMS_EXTRA_PASS is not set 156# CONFIG_KALLSYMS_EXTRA_PASS is not set
157# CONFIG_HOTPLUG is not set
163CONFIG_PRINTK=y 158CONFIG_PRINTK=y
164CONFIG_BUG=y 159CONFIG_BUG=y
160CONFIG_ELF_CORE=y
165CONFIG_BASE_FULL=y 161CONFIG_BASE_FULL=y
166CONFIG_FUTEX=y 162CONFIG_FUTEX=y
167CONFIG_EPOLL=y 163CONFIG_EPOLL=y
168# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
169CONFIG_SHMEM=y 164CONFIG_SHMEM=y
170CONFIG_CC_ALIGN_FUNCTIONS=0 165CONFIG_CC_ALIGN_FUNCTIONS=0
171CONFIG_CC_ALIGN_LABELS=0 166CONFIG_CC_ALIGN_LABELS=0
172CONFIG_CC_ALIGN_LOOPS=0 167CONFIG_CC_ALIGN_LOOPS=0
173CONFIG_CC_ALIGN_JUMPS=0 168CONFIG_CC_ALIGN_JUMPS=0
169CONFIG_SLAB=y
174# CONFIG_TINY_SHMEM is not set 170# CONFIG_TINY_SHMEM is not set
175CONFIG_BASE_SMALL=0 171CONFIG_BASE_SMALL=0
172# CONFIG_SLOB is not set
176 173
177# 174#
178# Loadable module support 175# Loadable module support
@@ -188,7 +185,6 @@ CONFIG_KMOD=y
188# 185#
189# Block layer 186# Block layer
190# 187#
191# CONFIG_LBD is not set
192 188
193# 189#
194# IO Schedulers 190# IO Schedulers
@@ -223,7 +219,6 @@ CONFIG_MMU=y
223# 219#
224CONFIG_BINFMT_ELF=y 220CONFIG_BINFMT_ELF=y
225# CONFIG_BINFMT_MISC is not set 221# CONFIG_BINFMT_MISC is not set
226CONFIG_TRAD_SIGNALS=y
227 222
228# 223#
229# Networking 224# Networking
@@ -278,6 +273,11 @@ CONFIG_TCP_CONG_BIC=y
278# CONFIG_ATALK is not set 273# CONFIG_ATALK is not set
279# CONFIG_X25 is not set 274# CONFIG_X25 is not set
280# CONFIG_LAPB is not set 275# CONFIG_LAPB is not set
276
277#
278# TIPC Configuration (EXPERIMENTAL)
279#
280# CONFIG_TIPC is not set
281# CONFIG_NET_DIVERT is not set 281# CONFIG_NET_DIVERT is not set
282# CONFIG_ECONET is not set 282# CONFIG_ECONET is not set
283# CONFIG_WAN_ROUTER is not set 283# CONFIG_WAN_ROUTER is not set
@@ -298,7 +298,6 @@ CONFIG_IEEE80211=m
298# CONFIG_IEEE80211_DEBUG is not set 298# CONFIG_IEEE80211_DEBUG is not set
299CONFIG_IEEE80211_CRYPT_WEP=m 299CONFIG_IEEE80211_CRYPT_WEP=m
300CONFIG_IEEE80211_CRYPT_CCMP=m 300CONFIG_IEEE80211_CRYPT_CCMP=m
301CONFIG_IEEE80211_CRYPT_TKIP=m
302 301
303# 302#
304# Device Drivers 303# Device Drivers
@@ -433,6 +432,7 @@ CONFIG_NET_ETHERNET=y
433# CONFIG_MII is not set 432# CONFIG_MII is not set
434# CONFIG_NET_VENDOR_3COM is not set 433# CONFIG_NET_VENDOR_3COM is not set
435# CONFIG_NET_VENDOR_SMC is not set 434# CONFIG_NET_VENDOR_SMC is not set
435# CONFIG_DM9000 is not set
436# CONFIG_NET_VENDOR_RACAL is not set 436# CONFIG_NET_VENDOR_RACAL is not set
437# CONFIG_AT1700 is not set 437# CONFIG_AT1700 is not set
438# CONFIG_DEPCA is not set 438# CONFIG_DEPCA is not set
@@ -531,10 +531,6 @@ CONFIG_HW_CONSOLE=y
531# 531#
532# Non-8250 serial port support 532# Non-8250 serial port support
533# 533#
534CONFIG_SERIAL_CORE=y
535CONFIG_SERIAL_CORE_CONSOLE=y
536CONFIG_SERIAL_VR41XX=y
537CONFIG_SERIAL_VR41XX_CONSOLE=y
538CONFIG_UNIX98_PTYS=y 534CONFIG_UNIX98_PTYS=y
539CONFIG_LEGACY_PTYS=y 535CONFIG_LEGACY_PTYS=y
540CONFIG_LEGACY_PTY_COUNT=256 536CONFIG_LEGACY_PTY_COUNT=256
@@ -563,14 +559,12 @@ CONFIG_WATCHDOG=y
563# CONFIG_WDT is not set 559# CONFIG_WDT is not set
564# CONFIG_RTC is not set 560# CONFIG_RTC is not set
565# CONFIG_GEN_RTC is not set 561# CONFIG_GEN_RTC is not set
566# CONFIG_RTC_VR41XX is not set
567# CONFIG_DTLK is not set 562# CONFIG_DTLK is not set
568# CONFIG_R3964 is not set 563# CONFIG_R3964 is not set
569 564
570# 565#
571# Ftape, the floppy tape device driver 566# Ftape, the floppy tape device driver
572# 567#
573CONFIG_GPIO_VR41XX=y
574# CONFIG_RAW_DRIVER is not set 568# CONFIG_RAW_DRIVER is not set
575 569
576# 570#
@@ -585,6 +579,12 @@ CONFIG_GPIO_VR41XX=y
585# CONFIG_I2C is not set 579# CONFIG_I2C is not set
586 580
587# 581#
582# SPI support
583#
584# CONFIG_SPI is not set
585# CONFIG_SPI_MASTER is not set
586
587#
588# Dallas's 1-wire bus 588# Dallas's 1-wire bus
589# 589#
590# CONFIG_W1 is not set 590# CONFIG_W1 is not set
@@ -665,11 +665,11 @@ CONFIG_EXT2_FS=y
665# CONFIG_EXT2_FS_XATTR is not set 665# CONFIG_EXT2_FS_XATTR is not set
666# CONFIG_EXT2_FS_XIP is not set 666# CONFIG_EXT2_FS_XIP is not set
667# CONFIG_EXT3_FS is not set 667# CONFIG_EXT3_FS is not set
668# CONFIG_JBD is not set
669# CONFIG_REISERFS_FS is not set 668# CONFIG_REISERFS_FS is not set
670# CONFIG_JFS_FS is not set 669# CONFIG_JFS_FS is not set
671# CONFIG_FS_POSIX_ACL is not set 670# CONFIG_FS_POSIX_ACL is not set
672# CONFIG_XFS_FS is not set 671# CONFIG_XFS_FS is not set
672# CONFIG_OCFS2_FS is not set
673# CONFIG_MINIX_FS is not set 673# CONFIG_MINIX_FS is not set
674# CONFIG_ROMFS_FS is not set 674# CONFIG_ROMFS_FS is not set
675CONFIG_INOTIFY=y 675CONFIG_INOTIFY=y
@@ -702,6 +702,7 @@ CONFIG_SYSFS=y
702# CONFIG_HUGETLB_PAGE is not set 702# CONFIG_HUGETLB_PAGE is not set
703CONFIG_RAMFS=y 703CONFIG_RAMFS=y
704CONFIG_RELAYFS_FS=m 704CONFIG_RELAYFS_FS=m
705# CONFIG_CONFIGFS_FS is not set
705 706
706# 707#
707# Miscellaneous filesystems 708# Miscellaneous filesystems
@@ -763,6 +764,7 @@ CONFIG_MSDOS_PARTITION=y
763# Kernel hacking 764# Kernel hacking
764# 765#
765# CONFIG_PRINTK_TIME is not set 766# CONFIG_PRINTK_TIME is not set
767# CONFIG_MAGIC_SYSRQ is not set
766# CONFIG_DEBUG_KERNEL is not set 768# CONFIG_DEBUG_KERNEL is not set
767CONFIG_LOG_BUF_SHIFT=14 769CONFIG_LOG_BUF_SHIFT=14
768CONFIG_CROSSCOMPILE=y 770CONFIG_CROSSCOMPILE=y
diff --git a/arch/mips/configs/ev64120_defconfig b/arch/mips/configs/ev64120_defconfig
index aa24d85ea94d..f2d43be69007 100644
--- a/arch/mips/configs/ev64120_defconfig
+++ b/arch/mips/configs/ev64120_defconfig
@@ -1,7 +1,7 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.15-rc2 3# Linux kernel version: 2.6.16-rc1
4# Thu Nov 24 01:06:16 2005 4# Fri Jan 27 15:40:05 2006
5# 5#
6CONFIG_MIPS=y 6CONFIG_MIPS=y
7 7
@@ -153,26 +153,28 @@ CONFIG_SYSVIPC=y
153# CONFIG_BSD_PROCESS_ACCT is not set 153# CONFIG_BSD_PROCESS_ACCT is not set
154CONFIG_SYSCTL=y 154CONFIG_SYSCTL=y
155# CONFIG_AUDIT is not set 155# CONFIG_AUDIT is not set
156CONFIG_HOTPLUG=y
157CONFIG_KOBJECT_UEVENT=y
158# CONFIG_IKCONFIG is not set 156# CONFIG_IKCONFIG is not set
159CONFIG_INITRAMFS_SOURCE="" 157CONFIG_INITRAMFS_SOURCE=""
158# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
160CONFIG_EMBEDDED=y 159CONFIG_EMBEDDED=y
161CONFIG_KALLSYMS=y 160CONFIG_KALLSYMS=y
162# CONFIG_KALLSYMS_EXTRA_PASS is not set 161# CONFIG_KALLSYMS_EXTRA_PASS is not set
162CONFIG_HOTPLUG=y
163CONFIG_PRINTK=y 163CONFIG_PRINTK=y
164CONFIG_BUG=y 164CONFIG_BUG=y
165CONFIG_ELF_CORE=y
165CONFIG_BASE_FULL=y 166CONFIG_BASE_FULL=y
166CONFIG_FUTEX=y 167CONFIG_FUTEX=y
167CONFIG_EPOLL=y 168CONFIG_EPOLL=y
168# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
169CONFIG_SHMEM=y 169CONFIG_SHMEM=y
170CONFIG_CC_ALIGN_FUNCTIONS=0 170CONFIG_CC_ALIGN_FUNCTIONS=0
171CONFIG_CC_ALIGN_LABELS=0 171CONFIG_CC_ALIGN_LABELS=0
172CONFIG_CC_ALIGN_LOOPS=0 172CONFIG_CC_ALIGN_LOOPS=0
173CONFIG_CC_ALIGN_JUMPS=0 173CONFIG_CC_ALIGN_JUMPS=0
174CONFIG_SLAB=y
174# CONFIG_TINY_SHMEM is not set 175# CONFIG_TINY_SHMEM is not set
175CONFIG_BASE_SMALL=0 176CONFIG_BASE_SMALL=0
177# CONFIG_SLOB is not set
176 178
177# 179#
178# Loadable module support 180# Loadable module support
@@ -282,6 +284,11 @@ CONFIG_TCP_CONG_BIC=y
282# CONFIG_ATALK is not set 284# CONFIG_ATALK is not set
283# CONFIG_X25 is not set 285# CONFIG_X25 is not set
284# CONFIG_LAPB is not set 286# CONFIG_LAPB is not set
287
288#
289# TIPC Configuration (EXPERIMENTAL)
290#
291# CONFIG_TIPC is not set
285# CONFIG_NET_DIVERT is not set 292# CONFIG_NET_DIVERT is not set
286# CONFIG_ECONET is not set 293# CONFIG_ECONET is not set
287# CONFIG_WAN_ROUTER is not set 294# CONFIG_WAN_ROUTER is not set
@@ -302,7 +309,6 @@ CONFIG_IEEE80211=m
302# CONFIG_IEEE80211_DEBUG is not set 309# CONFIG_IEEE80211_DEBUG is not set
303CONFIG_IEEE80211_CRYPT_WEP=m 310CONFIG_IEEE80211_CRYPT_WEP=m
304CONFIG_IEEE80211_CRYPT_CCMP=m 311CONFIG_IEEE80211_CRYPT_CCMP=m
305CONFIG_IEEE80211_CRYPT_TKIP=m
306 312
307# 313#
308# Device Drivers 314# Device Drivers
@@ -420,6 +426,7 @@ CONFIG_NET_ETHERNET=y
420# CONFIG_SUNGEM is not set 426# CONFIG_SUNGEM is not set
421# CONFIG_CASSINI is not set 427# CONFIG_CASSINI is not set
422# CONFIG_NET_VENDOR_3COM is not set 428# CONFIG_NET_VENDOR_3COM is not set
429# CONFIG_DM9000 is not set
423 430
424# 431#
425# Tulip family network device support 432# Tulip family network device support
@@ -440,6 +447,7 @@ CONFIG_NET_ETHERNET=y
440# CONFIG_R8169 is not set 447# CONFIG_R8169 is not set
441# CONFIG_SIS190 is not set 448# CONFIG_SIS190 is not set
442# CONFIG_SKGE is not set 449# CONFIG_SKGE is not set
450# CONFIG_SKY2 is not set
443# CONFIG_SK98LIN is not set 451# CONFIG_SK98LIN is not set
444# CONFIG_TIGON3 is not set 452# CONFIG_TIGON3 is not set
445# CONFIG_BNX2 is not set 453# CONFIG_BNX2 is not set
@@ -460,8 +468,6 @@ CONFIG_NET_ETHERNET=y
460# Wireless LAN (non-hamradio) 468# Wireless LAN (non-hamradio)
461# 469#
462# CONFIG_NET_RADIO is not set 470# CONFIG_NET_RADIO is not set
463# CONFIG_IPW_DEBUG is not set
464CONFIG_IPW2200=m
465 471
466# 472#
467# Wan interfaces 473# Wan interfaces
@@ -545,6 +551,7 @@ CONFIG_HW_CONSOLE=y
545CONFIG_SERIAL_8250=y 551CONFIG_SERIAL_8250=y
546CONFIG_SERIAL_8250_CONSOLE=y 552CONFIG_SERIAL_8250_CONSOLE=y
547CONFIG_SERIAL_8250_NR_UARTS=4 553CONFIG_SERIAL_8250_NR_UARTS=4
554CONFIG_SERIAL_8250_RUNTIME_UARTS=4
548# CONFIG_SERIAL_8250_EXTENDED is not set 555# CONFIG_SERIAL_8250_EXTENDED is not set
549 556
550# 557#
@@ -552,7 +559,6 @@ CONFIG_SERIAL_8250_NR_UARTS=4
552# 559#
553CONFIG_SERIAL_CORE=y 560CONFIG_SERIAL_CORE=y
554CONFIG_SERIAL_CORE_CONSOLE=y 561CONFIG_SERIAL_CORE_CONSOLE=y
555# CONFIG_SERIAL_JSM is not set
556CONFIG_UNIX98_PTYS=y 562CONFIG_UNIX98_PTYS=y
557CONFIG_LEGACY_PTYS=y 563CONFIG_LEGACY_PTYS=y
558CONFIG_LEGACY_PTY_COUNT=256 564CONFIG_LEGACY_PTY_COUNT=256
@@ -590,6 +596,12 @@ CONFIG_LEGACY_PTY_COUNT=256
590# CONFIG_I2C is not set 596# CONFIG_I2C is not set
591 597
592# 598#
599# SPI support
600#
601# CONFIG_SPI is not set
602# CONFIG_SPI_MASTER is not set
603
604#
593# Dallas's 1-wire bus 605# Dallas's 1-wire bus
594# 606#
595# CONFIG_W1 is not set 607# CONFIG_W1 is not set
@@ -671,11 +683,11 @@ CONFIG_EXT2_FS=y
671# CONFIG_EXT2_FS_XATTR is not set 683# CONFIG_EXT2_FS_XATTR is not set
672# CONFIG_EXT2_FS_XIP is not set 684# CONFIG_EXT2_FS_XIP is not set
673# CONFIG_EXT3_FS is not set 685# CONFIG_EXT3_FS is not set
674# CONFIG_JBD is not set
675# CONFIG_REISERFS_FS is not set 686# CONFIG_REISERFS_FS is not set
676# CONFIG_JFS_FS is not set 687# CONFIG_JFS_FS is not set
677# CONFIG_FS_POSIX_ACL is not set 688# CONFIG_FS_POSIX_ACL is not set
678# CONFIG_XFS_FS is not set 689# CONFIG_XFS_FS is not set
690# CONFIG_OCFS2_FS is not set
679# CONFIG_MINIX_FS is not set 691# CONFIG_MINIX_FS is not set
680# CONFIG_ROMFS_FS is not set 692# CONFIG_ROMFS_FS is not set
681CONFIG_INOTIFY=y 693CONFIG_INOTIFY=y
@@ -708,6 +720,7 @@ CONFIG_SYSFS=y
708# CONFIG_HUGETLB_PAGE is not set 720# CONFIG_HUGETLB_PAGE is not set
709CONFIG_RAMFS=y 721CONFIG_RAMFS=y
710CONFIG_RELAYFS_FS=m 722CONFIG_RELAYFS_FS=m
723# CONFIG_CONFIGFS_FS is not set
711 724
712# 725#
713# Miscellaneous filesystems 726# Miscellaneous filesystems
@@ -767,6 +780,7 @@ CONFIG_MSDOS_PARTITION=y
767# Kernel hacking 780# Kernel hacking
768# 781#
769# CONFIG_PRINTK_TIME is not set 782# CONFIG_PRINTK_TIME is not set
783# CONFIG_MAGIC_SYSRQ is not set
770# CONFIG_DEBUG_KERNEL is not set 784# CONFIG_DEBUG_KERNEL is not set
771CONFIG_LOG_BUF_SHIFT=14 785CONFIG_LOG_BUF_SHIFT=14
772CONFIG_CROSSCOMPILE=y 786CONFIG_CROSSCOMPILE=y
diff --git a/arch/mips/configs/ev96100_defconfig b/arch/mips/configs/ev96100_defconfig
index eeed0e5ad260..ac5841c4b698 100644
--- a/arch/mips/configs/ev96100_defconfig
+++ b/arch/mips/configs/ev96100_defconfig
@@ -1,7 +1,7 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.15-rc2 3# Linux kernel version: 2.6.16-rc1
4# Thu Nov 24 01:06:18 2005 4# Fri Jan 27 15:40:06 2006
5# 5#
6CONFIG_MIPS=y 6CONFIG_MIPS=y
7 7
@@ -157,26 +157,28 @@ CONFIG_SYSVIPC=y
157# CONFIG_BSD_PROCESS_ACCT is not set 157# CONFIG_BSD_PROCESS_ACCT is not set
158CONFIG_SYSCTL=y 158CONFIG_SYSCTL=y
159# CONFIG_AUDIT is not set 159# CONFIG_AUDIT is not set
160# CONFIG_HOTPLUG is not set
161CONFIG_KOBJECT_UEVENT=y
162# CONFIG_IKCONFIG is not set 160# CONFIG_IKCONFIG is not set
163CONFIG_INITRAMFS_SOURCE="" 161CONFIG_INITRAMFS_SOURCE=""
162# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
164CONFIG_EMBEDDED=y 163CONFIG_EMBEDDED=y
165CONFIG_KALLSYMS=y 164CONFIG_KALLSYMS=y
166# CONFIG_KALLSYMS_EXTRA_PASS is not set 165# CONFIG_KALLSYMS_EXTRA_PASS is not set
166# CONFIG_HOTPLUG is not set
167CONFIG_PRINTK=y 167CONFIG_PRINTK=y
168CONFIG_BUG=y 168CONFIG_BUG=y
169CONFIG_ELF_CORE=y
169CONFIG_BASE_FULL=y 170CONFIG_BASE_FULL=y
170CONFIG_FUTEX=y 171CONFIG_FUTEX=y
171CONFIG_EPOLL=y 172CONFIG_EPOLL=y
172# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
173CONFIG_SHMEM=y 173CONFIG_SHMEM=y
174CONFIG_CC_ALIGN_FUNCTIONS=0 174CONFIG_CC_ALIGN_FUNCTIONS=0
175CONFIG_CC_ALIGN_LABELS=0 175CONFIG_CC_ALIGN_LABELS=0
176CONFIG_CC_ALIGN_LOOPS=0 176CONFIG_CC_ALIGN_LOOPS=0
177CONFIG_CC_ALIGN_JUMPS=0 177CONFIG_CC_ALIGN_JUMPS=0
178CONFIG_SLAB=y
178# CONFIG_TINY_SHMEM is not set 179# CONFIG_TINY_SHMEM is not set
179CONFIG_BASE_SMALL=0 180CONFIG_BASE_SMALL=0
181# CONFIG_SLOB is not set
180 182
181# 183#
182# Loadable module support 184# Loadable module support
@@ -284,6 +286,11 @@ CONFIG_TCP_CONG_BIC=y
284# CONFIG_ATALK is not set 286# CONFIG_ATALK is not set
285# CONFIG_X25 is not set 287# CONFIG_X25 is not set
286# CONFIG_LAPB is not set 288# CONFIG_LAPB is not set
289
290#
291# TIPC Configuration (EXPERIMENTAL)
292#
293# CONFIG_TIPC is not set
287# CONFIG_NET_DIVERT is not set 294# CONFIG_NET_DIVERT is not set
288# CONFIG_ECONET is not set 295# CONFIG_ECONET is not set
289# CONFIG_WAN_ROUTER is not set 296# CONFIG_WAN_ROUTER is not set
@@ -304,7 +311,6 @@ CONFIG_IEEE80211=m
304# CONFIG_IEEE80211_DEBUG is not set 311# CONFIG_IEEE80211_DEBUG is not set
305CONFIG_IEEE80211_CRYPT_WEP=m 312CONFIG_IEEE80211_CRYPT_WEP=m
306CONFIG_IEEE80211_CRYPT_CCMP=m 313CONFIG_IEEE80211_CRYPT_CCMP=m
307CONFIG_IEEE80211_CRYPT_TKIP=m
308 314
309# 315#
310# Device Drivers 316# Device Drivers
@@ -407,6 +413,7 @@ CONFIG_CICADA_PHY=m
407CONFIG_NET_ETHERNET=y 413CONFIG_NET_ETHERNET=y
408# CONFIG_MII is not set 414# CONFIG_MII is not set
409CONFIG_MIPS_GT96100ETH=y 415CONFIG_MIPS_GT96100ETH=y
416# CONFIG_DM9000 is not set
410 417
411# 418#
412# Ethernet (1000 Mbit) 419# Ethernet (1000 Mbit)
@@ -496,6 +503,7 @@ CONFIG_HW_CONSOLE=y
496CONFIG_SERIAL_8250=y 503CONFIG_SERIAL_8250=y
497CONFIG_SERIAL_8250_CONSOLE=y 504CONFIG_SERIAL_8250_CONSOLE=y
498CONFIG_SERIAL_8250_NR_UARTS=4 505CONFIG_SERIAL_8250_NR_UARTS=4
506CONFIG_SERIAL_8250_RUNTIME_UARTS=4
499# CONFIG_SERIAL_8250_EXTENDED is not set 507# CONFIG_SERIAL_8250_EXTENDED is not set
500 508
501# 509#
@@ -538,6 +546,12 @@ CONFIG_LEGACY_PTY_COUNT=256
538# CONFIG_I2C is not set 546# CONFIG_I2C is not set
539 547
540# 548#
549# SPI support
550#
551# CONFIG_SPI is not set
552# CONFIG_SPI_MASTER is not set
553
554#
541# Dallas's 1-wire bus 555# Dallas's 1-wire bus
542# 556#
543# CONFIG_W1 is not set 557# CONFIG_W1 is not set
@@ -617,11 +631,11 @@ CONFIG_EXT2_FS=y
617# CONFIG_EXT2_FS_XATTR is not set 631# CONFIG_EXT2_FS_XATTR is not set
618# CONFIG_EXT2_FS_XIP is not set 632# CONFIG_EXT2_FS_XIP is not set
619# CONFIG_EXT3_FS is not set 633# CONFIG_EXT3_FS is not set
620# CONFIG_JBD is not set
621# CONFIG_REISERFS_FS is not set 634# CONFIG_REISERFS_FS is not set
622# CONFIG_JFS_FS is not set 635# CONFIG_JFS_FS is not set
623# CONFIG_FS_POSIX_ACL is not set 636# CONFIG_FS_POSIX_ACL is not set
624# CONFIG_XFS_FS is not set 637# CONFIG_XFS_FS is not set
638# CONFIG_OCFS2_FS is not set
625# CONFIG_MINIX_FS is not set 639# CONFIG_MINIX_FS is not set
626# CONFIG_ROMFS_FS is not set 640# CONFIG_ROMFS_FS is not set
627CONFIG_INOTIFY=y 641CONFIG_INOTIFY=y
@@ -654,6 +668,7 @@ CONFIG_SYSFS=y
654# CONFIG_HUGETLB_PAGE is not set 668# CONFIG_HUGETLB_PAGE is not set
655CONFIG_RAMFS=y 669CONFIG_RAMFS=y
656CONFIG_RELAYFS_FS=m 670CONFIG_RELAYFS_FS=m
671# CONFIG_CONFIGFS_FS is not set
657 672
658# 673#
659# Miscellaneous filesystems 674# Miscellaneous filesystems
@@ -713,6 +728,7 @@ CONFIG_MSDOS_PARTITION=y
713# Kernel hacking 728# Kernel hacking
714# 729#
715# CONFIG_PRINTK_TIME is not set 730# CONFIG_PRINTK_TIME is not set
731# CONFIG_MAGIC_SYSRQ is not set
716# CONFIG_DEBUG_KERNEL is not set 732# CONFIG_DEBUG_KERNEL is not set
717CONFIG_LOG_BUF_SHIFT=14 733CONFIG_LOG_BUF_SHIFT=14
718CONFIG_CROSSCOMPILE=y 734CONFIG_CROSSCOMPILE=y
diff --git a/arch/mips/configs/ip22_defconfig b/arch/mips/configs/ip22_defconfig
index e56351abf87a..42d5cd7927cb 100644
--- a/arch/mips/configs/ip22_defconfig
+++ b/arch/mips/configs/ip22_defconfig
@@ -1,7 +1,7 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.15-rc2 3# Linux kernel version: 2.6.16-rc1
4# Thu Nov 24 01:06:20 2005 4# Fri Jan 27 15:39:51 2006
5# 5#
6CONFIG_MIPS=y 6CONFIG_MIPS=y
7 7
@@ -158,27 +158,29 @@ CONFIG_SYSVIPC=y
158# CONFIG_BSD_PROCESS_ACCT is not set 158# CONFIG_BSD_PROCESS_ACCT is not set
159CONFIG_SYSCTL=y 159CONFIG_SYSCTL=y
160# CONFIG_AUDIT is not set 160# CONFIG_AUDIT is not set
161# CONFIG_HOTPLUG is not set
162CONFIG_KOBJECT_UEVENT=y
163CONFIG_IKCONFIG=y 161CONFIG_IKCONFIG=y
164CONFIG_IKCONFIG_PROC=y 162CONFIG_IKCONFIG_PROC=y
165CONFIG_INITRAMFS_SOURCE="" 163CONFIG_INITRAMFS_SOURCE=""
164# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
166CONFIG_EMBEDDED=y 165CONFIG_EMBEDDED=y
167CONFIG_KALLSYMS=y 166CONFIG_KALLSYMS=y
168# CONFIG_KALLSYMS_EXTRA_PASS is not set 167# CONFIG_KALLSYMS_EXTRA_PASS is not set
168# CONFIG_HOTPLUG is not set
169CONFIG_PRINTK=y 169CONFIG_PRINTK=y
170CONFIG_BUG=y 170CONFIG_BUG=y
171CONFIG_ELF_CORE=y
171CONFIG_BASE_FULL=y 172CONFIG_BASE_FULL=y
172CONFIG_FUTEX=y 173CONFIG_FUTEX=y
173CONFIG_EPOLL=y 174CONFIG_EPOLL=y
174# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
175CONFIG_SHMEM=y 175CONFIG_SHMEM=y
176CONFIG_CC_ALIGN_FUNCTIONS=0 176CONFIG_CC_ALIGN_FUNCTIONS=0
177CONFIG_CC_ALIGN_LABELS=0 177CONFIG_CC_ALIGN_LABELS=0
178CONFIG_CC_ALIGN_LOOPS=0 178CONFIG_CC_ALIGN_LOOPS=0
179CONFIG_CC_ALIGN_JUMPS=0 179CONFIG_CC_ALIGN_JUMPS=0
180CONFIG_SLAB=y
180# CONFIG_TINY_SHMEM is not set 181# CONFIG_TINY_SHMEM is not set
181CONFIG_BASE_SMALL=0 182CONFIG_BASE_SMALL=0
183# CONFIG_SLOB is not set
182 184
183# 185#
184# Loadable module support 186# Loadable module support
@@ -317,6 +319,28 @@ CONFIG_NETFILTER=y
317CONFIG_NETFILTER_NETLINK=m 319CONFIG_NETFILTER_NETLINK=m
318CONFIG_NETFILTER_NETLINK_QUEUE=m 320CONFIG_NETFILTER_NETLINK_QUEUE=m
319CONFIG_NETFILTER_NETLINK_LOG=m 321CONFIG_NETFILTER_NETLINK_LOG=m
322CONFIG_NETFILTER_XTABLES=m
323CONFIG_NETFILTER_XT_TARGET_CLASSIFY=m
324CONFIG_NETFILTER_XT_TARGET_CONNMARK=m
325CONFIG_NETFILTER_XT_TARGET_MARK=m
326CONFIG_NETFILTER_XT_TARGET_NFQUEUE=m
327CONFIG_NETFILTER_XT_TARGET_NOTRACK=m
328CONFIG_NETFILTER_XT_MATCH_COMMENT=m
329CONFIG_NETFILTER_XT_MATCH_CONNBYTES=m
330CONFIG_NETFILTER_XT_MATCH_CONNMARK=m
331CONFIG_NETFILTER_XT_MATCH_CONNTRACK=m
332CONFIG_NETFILTER_XT_MATCH_DCCP=m
333CONFIG_NETFILTER_XT_MATCH_HELPER=m
334CONFIG_NETFILTER_XT_MATCH_LENGTH=m
335CONFIG_NETFILTER_XT_MATCH_LIMIT=m
336CONFIG_NETFILTER_XT_MATCH_MAC=m
337CONFIG_NETFILTER_XT_MATCH_MARK=m
338CONFIG_NETFILTER_XT_MATCH_PKTTYPE=m
339CONFIG_NETFILTER_XT_MATCH_REALM=m
340CONFIG_NETFILTER_XT_MATCH_SCTP=m
341CONFIG_NETFILTER_XT_MATCH_STATE=m
342CONFIG_NETFILTER_XT_MATCH_STRING=m
343CONFIG_NETFILTER_XT_MATCH_TCPMSS=m
320 344
321# 345#
322# IP: Netfilter Configuration 346# IP: Netfilter Configuration
@@ -335,39 +359,23 @@ CONFIG_IP_NF_AMANDA=m
335CONFIG_IP_NF_PPTP=m 359CONFIG_IP_NF_PPTP=m
336CONFIG_IP_NF_QUEUE=m 360CONFIG_IP_NF_QUEUE=m
337CONFIG_IP_NF_IPTABLES=m 361CONFIG_IP_NF_IPTABLES=m
338CONFIG_IP_NF_MATCH_LIMIT=m
339CONFIG_IP_NF_MATCH_IPRANGE=m 362CONFIG_IP_NF_MATCH_IPRANGE=m
340CONFIG_IP_NF_MATCH_MAC=m
341CONFIG_IP_NF_MATCH_PKTTYPE=m
342CONFIG_IP_NF_MATCH_MARK=m
343CONFIG_IP_NF_MATCH_MULTIPORT=m 363CONFIG_IP_NF_MATCH_MULTIPORT=m
344CONFIG_IP_NF_MATCH_TOS=m 364CONFIG_IP_NF_MATCH_TOS=m
345CONFIG_IP_NF_MATCH_RECENT=m 365CONFIG_IP_NF_MATCH_RECENT=m
346CONFIG_IP_NF_MATCH_ECN=m 366CONFIG_IP_NF_MATCH_ECN=m
347CONFIG_IP_NF_MATCH_DSCP=m 367CONFIG_IP_NF_MATCH_DSCP=m
348CONFIG_IP_NF_MATCH_AH_ESP=m 368CONFIG_IP_NF_MATCH_AH_ESP=m
349CONFIG_IP_NF_MATCH_LENGTH=m
350CONFIG_IP_NF_MATCH_TTL=m 369CONFIG_IP_NF_MATCH_TTL=m
351CONFIG_IP_NF_MATCH_TCPMSS=m
352CONFIG_IP_NF_MATCH_HELPER=m
353CONFIG_IP_NF_MATCH_STATE=m
354CONFIG_IP_NF_MATCH_CONNTRACK=m
355CONFIG_IP_NF_MATCH_OWNER=m 370CONFIG_IP_NF_MATCH_OWNER=m
356CONFIG_IP_NF_MATCH_ADDRTYPE=m 371CONFIG_IP_NF_MATCH_ADDRTYPE=m
357CONFIG_IP_NF_MATCH_REALM=m
358CONFIG_IP_NF_MATCH_SCTP=m
359CONFIG_IP_NF_MATCH_DCCP=m
360CONFIG_IP_NF_MATCH_COMMENT=m
361CONFIG_IP_NF_MATCH_CONNMARK=m
362CONFIG_IP_NF_MATCH_CONNBYTES=m
363CONFIG_IP_NF_MATCH_HASHLIMIT=m 372CONFIG_IP_NF_MATCH_HASHLIMIT=m
364CONFIG_IP_NF_MATCH_STRING=m 373CONFIG_IP_NF_MATCH_POLICY=m
365CONFIG_IP_NF_FILTER=m 374CONFIG_IP_NF_FILTER=m
366CONFIG_IP_NF_TARGET_REJECT=m 375CONFIG_IP_NF_TARGET_REJECT=m
367CONFIG_IP_NF_TARGET_LOG=m 376CONFIG_IP_NF_TARGET_LOG=m
368CONFIG_IP_NF_TARGET_ULOG=m 377CONFIG_IP_NF_TARGET_ULOG=m
369CONFIG_IP_NF_TARGET_TCPMSS=m 378CONFIG_IP_NF_TARGET_TCPMSS=m
370CONFIG_IP_NF_TARGET_NFQUEUE=m
371CONFIG_IP_NF_NAT=m 379CONFIG_IP_NF_NAT=m
372CONFIG_IP_NF_NAT_NEEDED=y 380CONFIG_IP_NF_NAT_NEEDED=y
373CONFIG_IP_NF_TARGET_MASQUERADE=m 381CONFIG_IP_NF_TARGET_MASQUERADE=m
@@ -384,13 +392,9 @@ CONFIG_IP_NF_MANGLE=m
384CONFIG_IP_NF_TARGET_TOS=m 392CONFIG_IP_NF_TARGET_TOS=m
385CONFIG_IP_NF_TARGET_ECN=m 393CONFIG_IP_NF_TARGET_ECN=m
386CONFIG_IP_NF_TARGET_DSCP=m 394CONFIG_IP_NF_TARGET_DSCP=m
387CONFIG_IP_NF_TARGET_MARK=m
388CONFIG_IP_NF_TARGET_CLASSIFY=m
389CONFIG_IP_NF_TARGET_TTL=m 395CONFIG_IP_NF_TARGET_TTL=m
390CONFIG_IP_NF_TARGET_CONNMARK=m
391CONFIG_IP_NF_TARGET_CLUSTERIP=m 396CONFIG_IP_NF_TARGET_CLUSTERIP=m
392CONFIG_IP_NF_RAW=m 397CONFIG_IP_NF_RAW=m
393CONFIG_IP_NF_TARGET_NOTRACK=m
394CONFIG_IP_NF_ARPTABLES=m 398CONFIG_IP_NF_ARPTABLES=m
395CONFIG_IP_NF_ARPFILTER=m 399CONFIG_IP_NF_ARPFILTER=m
396CONFIG_IP_NF_ARP_MANGLE=m 400CONFIG_IP_NF_ARP_MANGLE=m
@@ -400,25 +404,20 @@ CONFIG_IP_NF_ARP_MANGLE=m
400# 404#
401CONFIG_IP6_NF_QUEUE=m 405CONFIG_IP6_NF_QUEUE=m
402CONFIG_IP6_NF_IPTABLES=m 406CONFIG_IP6_NF_IPTABLES=m
403CONFIG_IP6_NF_MATCH_LIMIT=m
404CONFIG_IP6_NF_MATCH_MAC=m
405CONFIG_IP6_NF_MATCH_RT=m 407CONFIG_IP6_NF_MATCH_RT=m
406CONFIG_IP6_NF_MATCH_OPTS=m 408CONFIG_IP6_NF_MATCH_OPTS=m
407CONFIG_IP6_NF_MATCH_FRAG=m 409CONFIG_IP6_NF_MATCH_FRAG=m
408CONFIG_IP6_NF_MATCH_HL=m 410CONFIG_IP6_NF_MATCH_HL=m
409CONFIG_IP6_NF_MATCH_MULTIPORT=m 411CONFIG_IP6_NF_MATCH_MULTIPORT=m
410CONFIG_IP6_NF_MATCH_OWNER=m 412CONFIG_IP6_NF_MATCH_OWNER=m
411CONFIG_IP6_NF_MATCH_MARK=m
412CONFIG_IP6_NF_MATCH_IPV6HEADER=m 413CONFIG_IP6_NF_MATCH_IPV6HEADER=m
413CONFIG_IP6_NF_MATCH_AHESP=m 414CONFIG_IP6_NF_MATCH_AHESP=m
414CONFIG_IP6_NF_MATCH_LENGTH=m
415CONFIG_IP6_NF_MATCH_EUI64=m 415CONFIG_IP6_NF_MATCH_EUI64=m
416CONFIG_IP6_NF_MATCH_POLICY=m
416CONFIG_IP6_NF_FILTER=m 417CONFIG_IP6_NF_FILTER=m
417CONFIG_IP6_NF_TARGET_LOG=m 418CONFIG_IP6_NF_TARGET_LOG=m
418CONFIG_IP6_NF_TARGET_REJECT=m 419CONFIG_IP6_NF_TARGET_REJECT=m
419CONFIG_IP6_NF_TARGET_NFQUEUE=m
420CONFIG_IP6_NF_MANGLE=m 420CONFIG_IP6_NF_MANGLE=m
421CONFIG_IP6_NF_TARGET_MARK=m
422CONFIG_IP6_NF_TARGET_HL=m 421CONFIG_IP6_NF_TARGET_HL=m
423CONFIG_IP6_NF_RAW=m 422CONFIG_IP6_NF_RAW=m
424 423
@@ -445,6 +444,11 @@ CONFIG_SCTP_HMAC_MD5=y
445# CONFIG_ATALK is not set 444# CONFIG_ATALK is not set
446# CONFIG_X25 is not set 445# CONFIG_X25 is not set
447# CONFIG_LAPB is not set 446# CONFIG_LAPB is not set
447
448#
449# TIPC Configuration (EXPERIMENTAL)
450#
451# CONFIG_TIPC is not set
448CONFIG_NET_DIVERT=y 452CONFIG_NET_DIVERT=y
449# CONFIG_ECONET is not set 453# CONFIG_ECONET is not set
450# CONFIG_WAN_ROUTER is not set 454# CONFIG_WAN_ROUTER is not set
@@ -504,7 +508,6 @@ CONFIG_IEEE80211=m
504# CONFIG_IEEE80211_DEBUG is not set 508# CONFIG_IEEE80211_DEBUG is not set
505CONFIG_IEEE80211_CRYPT_WEP=m 509CONFIG_IEEE80211_CRYPT_WEP=m
506CONFIG_IEEE80211_CRYPT_CCMP=m 510CONFIG_IEEE80211_CRYPT_CCMP=m
507CONFIG_IEEE80211_CRYPT_TKIP=m
508 511
509# 512#
510# Device Drivers 513# Device Drivers
@@ -641,6 +644,7 @@ CONFIG_CICADA_PHY=m
641# 644#
642CONFIG_NET_ETHERNET=y 645CONFIG_NET_ETHERNET=y
643# CONFIG_MII is not set 646# CONFIG_MII is not set
647# CONFIG_DM9000 is not set
644CONFIG_SGISEEQ=y 648CONFIG_SGISEEQ=y
645 649
646# 650#
@@ -787,6 +791,12 @@ CONFIG_MAX_RAW_DEVS=256
787# CONFIG_I2C is not set 791# CONFIG_I2C is not set
788 792
789# 793#
794# SPI support
795#
796# CONFIG_SPI is not set
797# CONFIG_SPI_MASTER is not set
798
799#
790# Dallas's 1-wire bus 800# Dallas's 1-wire bus
791# 801#
792# CONFIG_W1 is not set 802# CONFIG_W1 is not set
@@ -892,6 +902,7 @@ CONFIG_XFS_QUOTA=y
892CONFIG_XFS_SECURITY=y 902CONFIG_XFS_SECURITY=y
893# CONFIG_XFS_POSIX_ACL is not set 903# CONFIG_XFS_POSIX_ACL is not set
894# CONFIG_XFS_RT is not set 904# CONFIG_XFS_RT is not set
905# CONFIG_OCFS2_FS is not set
895CONFIG_MINIX_FS=m 906CONFIG_MINIX_FS=m
896# CONFIG_ROMFS_FS is not set 907# CONFIG_ROMFS_FS is not set
897CONFIG_INOTIFY=y 908CONFIG_INOTIFY=y
@@ -934,6 +945,7 @@ CONFIG_SYSFS=y
934# CONFIG_HUGETLB_PAGE is not set 945# CONFIG_HUGETLB_PAGE is not set
935CONFIG_RAMFS=y 946CONFIG_RAMFS=y
936CONFIG_RELAYFS_FS=m 947CONFIG_RELAYFS_FS=m
948# CONFIG_CONFIGFS_FS is not set
937 949
938# 950#
939# Miscellaneous filesystems 951# Miscellaneous filesystems
@@ -1007,6 +1019,7 @@ CONFIG_MSDOS_PARTITION=y
1007CONFIG_SGI_PARTITION=y 1019CONFIG_SGI_PARTITION=y
1008# CONFIG_ULTRIX_PARTITION is not set 1020# CONFIG_ULTRIX_PARTITION is not set
1009# CONFIG_SUN_PARTITION is not set 1021# CONFIG_SUN_PARTITION is not set
1022# CONFIG_KARMA_PARTITION is not set
1010# CONFIG_EFI_PARTITION is not set 1023# CONFIG_EFI_PARTITION is not set
1011 1024
1012# 1025#
@@ -1062,6 +1075,7 @@ CONFIG_NLS_UTF8=m
1062# Kernel hacking 1075# Kernel hacking
1063# 1076#
1064# CONFIG_PRINTK_TIME is not set 1077# CONFIG_PRINTK_TIME is not set
1078# CONFIG_MAGIC_SYSRQ is not set
1065# CONFIG_DEBUG_KERNEL is not set 1079# CONFIG_DEBUG_KERNEL is not set
1066CONFIG_LOG_BUF_SHIFT=14 1080CONFIG_LOG_BUF_SHIFT=14
1067CONFIG_CROSSCOMPILE=y 1081CONFIG_CROSSCOMPILE=y
diff --git a/arch/mips/configs/ip27_defconfig b/arch/mips/configs/ip27_defconfig
index 58c22cd344d3..8c40590737e1 100644
--- a/arch/mips/configs/ip27_defconfig
+++ b/arch/mips/configs/ip27_defconfig
@@ -132,6 +132,7 @@ CONFIG_FLAT_NODE_MEM_MAP=y
132CONFIG_NEED_MULTIPLE_NODES=y 132CONFIG_NEED_MULTIPLE_NODES=y
133# CONFIG_SPARSEMEM_STATIC is not set 133# CONFIG_SPARSEMEM_STATIC is not set
134CONFIG_SPLIT_PTLOCK_CPUS=4 134CONFIG_SPLIT_PTLOCK_CPUS=4
135CONFIG_MIGRATION=y
135CONFIG_SMP=y 136CONFIG_SMP=y
136CONFIG_NR_CPUS=64 137CONFIG_NR_CPUS=64
137CONFIG_PREEMPT_NONE=y 138CONFIG_PREEMPT_NONE=y
@@ -158,28 +159,30 @@ CONFIG_POSIX_MQUEUE=y
158# CONFIG_BSD_PROCESS_ACCT is not set 159# CONFIG_BSD_PROCESS_ACCT is not set
159CONFIG_SYSCTL=y 160CONFIG_SYSCTL=y
160# CONFIG_AUDIT is not set 161# CONFIG_AUDIT is not set
161CONFIG_HOTPLUG=y
162CONFIG_KOBJECT_UEVENT=y
163CONFIG_IKCONFIG=y 162CONFIG_IKCONFIG=y
164CONFIG_IKCONFIG_PROC=y 163CONFIG_IKCONFIG_PROC=y
165CONFIG_CPUSETS=y 164CONFIG_CPUSETS=y
166CONFIG_INITRAMFS_SOURCE="" 165CONFIG_INITRAMFS_SOURCE=""
166# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
167CONFIG_EMBEDDED=y 167CONFIG_EMBEDDED=y
168CONFIG_KALLSYMS=y 168CONFIG_KALLSYMS=y
169# CONFIG_KALLSYMS_EXTRA_PASS is not set 169# CONFIG_KALLSYMS_EXTRA_PASS is not set
170CONFIG_HOTPLUG=y
170CONFIG_PRINTK=y 171CONFIG_PRINTK=y
171CONFIG_BUG=y 172CONFIG_BUG=y
173CONFIG_ELF_CORE=y
172CONFIG_BASE_FULL=y 174CONFIG_BASE_FULL=y
173CONFIG_FUTEX=y 175CONFIG_FUTEX=y
174CONFIG_EPOLL=y 176CONFIG_EPOLL=y
175# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
176CONFIG_SHMEM=y 177CONFIG_SHMEM=y
177CONFIG_CC_ALIGN_FUNCTIONS=0 178CONFIG_CC_ALIGN_FUNCTIONS=0
178CONFIG_CC_ALIGN_LABELS=0 179CONFIG_CC_ALIGN_LABELS=0
179CONFIG_CC_ALIGN_LOOPS=0 180CONFIG_CC_ALIGN_LOOPS=0
180CONFIG_CC_ALIGN_JUMPS=0 181CONFIG_CC_ALIGN_JUMPS=0
182CONFIG_SLAB=y
181# CONFIG_TINY_SHMEM is not set 183# CONFIG_TINY_SHMEM is not set
182CONFIG_BASE_SMALL=0 184CONFIG_BASE_SMALL=0
185# CONFIG_SLOB is not set
183 186
184# 187#
185# Loadable module support 188# Loadable module support
@@ -234,7 +237,6 @@ CONFIG_MMU=y
234# 237#
235CONFIG_BINFMT_ELF=y 238CONFIG_BINFMT_ELF=y
236# CONFIG_BINFMT_MISC is not set 239# CONFIG_BINFMT_MISC is not set
237CONFIG_BUILD_ELF64=y
238CONFIG_MIPS32_COMPAT=y 240CONFIG_MIPS32_COMPAT=y
239CONFIG_COMPAT=y 241CONFIG_COMPAT=y
240CONFIG_MIPS32_O32=y 242CONFIG_MIPS32_O32=y
@@ -290,6 +292,10 @@ CONFIG_TCP_CONG_BIC=y
290# 292#
291# CONFIG_IP_SCTP is not set 293# CONFIG_IP_SCTP is not set
292 294
295#
296# TIPC Configuration (EXPERIMENTAL)
297#
298# CONFIG_TIPC is not set
293# CONFIG_ATM is not set 299# CONFIG_ATM is not set
294# CONFIG_BRIDGE is not set 300# CONFIG_BRIDGE is not set
295# CONFIG_VLAN_8021Q is not set 301# CONFIG_VLAN_8021Q is not set
@@ -357,7 +363,6 @@ CONFIG_IEEE80211=m
357# CONFIG_IEEE80211_DEBUG is not set 363# CONFIG_IEEE80211_DEBUG is not set
358CONFIG_IEEE80211_CRYPT_WEP=m 364CONFIG_IEEE80211_CRYPT_WEP=m
359CONFIG_IEEE80211_CRYPT_CCMP=m 365CONFIG_IEEE80211_CRYPT_CCMP=m
360CONFIG_IEEE80211_CRYPT_TKIP=m
361 366
362# 367#
363# Device Drivers 368# Device Drivers
@@ -368,7 +373,7 @@ CONFIG_IEEE80211_CRYPT_TKIP=m
368# 373#
369CONFIG_STANDALONE=y 374CONFIG_STANDALONE=y
370CONFIG_PREVENT_FIRMWARE_BUILD=y 375CONFIG_PREVENT_FIRMWARE_BUILD=y
371CONFIG_FW_LOADER=m 376CONFIG_FW_LOADER=y
372 377
373# 378#
374# Connector - unified userspace <-> kernelspace linker 379# Connector - unified userspace <-> kernelspace linker
@@ -442,7 +447,7 @@ CONFIG_SCSI_LOGGING=y
442# SCSI Transport Attributes 447# SCSI Transport Attributes
443# 448#
444CONFIG_SCSI_SPI_ATTRS=y 449CONFIG_SCSI_SPI_ATTRS=y
445# CONFIG_SCSI_FC_ATTRS is not set 450CONFIG_SCSI_FC_ATTRS=y
446CONFIG_SCSI_ISCSI_ATTRS=m 451CONFIG_SCSI_ISCSI_ATTRS=m
447CONFIG_SCSI_SAS_ATTRS=m 452CONFIG_SCSI_SAS_ATTRS=m
448 453
@@ -470,13 +475,7 @@ CONFIG_SCSI_SAS_ATTRS=m
470# CONFIG_SCSI_IPR is not set 475# CONFIG_SCSI_IPR is not set
471# CONFIG_SCSI_QLOGIC_FC is not set 476# CONFIG_SCSI_QLOGIC_FC is not set
472CONFIG_SCSI_QLOGIC_1280=y 477CONFIG_SCSI_QLOGIC_1280=y
473CONFIG_SCSI_QLA2XXX=y 478# CONFIG_SCSI_QLA_FC is not set
474# CONFIG_SCSI_QLA21XX is not set
475# CONFIG_SCSI_QLA22XX is not set
476# CONFIG_SCSI_QLA2300 is not set
477# CONFIG_SCSI_QLA2322 is not set
478# CONFIG_SCSI_QLA6312 is not set
479# CONFIG_SCSI_QLA24XX is not set
480# CONFIG_SCSI_LPFC is not set 479# CONFIG_SCSI_LPFC is not set
481# CONFIG_SCSI_DC395x is not set 480# CONFIG_SCSI_DC395x is not set
482# CONFIG_SCSI_DC390T is not set 481# CONFIG_SCSI_DC390T is not set
@@ -561,6 +560,7 @@ CONFIG_SGI_IOC3_ETH_HW_TX_CSUM=y
561# CONFIG_SUNGEM is not set 560# CONFIG_SUNGEM is not set
562# CONFIG_CASSINI is not set 561# CONFIG_CASSINI is not set
563# CONFIG_NET_VENDOR_3COM is not set 562# CONFIG_NET_VENDOR_3COM is not set
563# CONFIG_DM9000 is not set
564 564
565# 565#
566# Tulip family network device support 566# Tulip family network device support
@@ -581,6 +581,7 @@ CONFIG_SGI_IOC3_ETH_HW_TX_CSUM=y
581# CONFIG_R8169 is not set 581# CONFIG_R8169 is not set
582# CONFIG_SIS190 is not set 582# CONFIG_SIS190 is not set
583# CONFIG_SKGE is not set 583# CONFIG_SKGE is not set
584# CONFIG_SKY2 is not set
584# CONFIG_SK98LIN is not set 585# CONFIG_SK98LIN is not set
585# CONFIG_TIGON3 is not set 586# CONFIG_TIGON3 is not set
586# CONFIG_BNX2 is not set 587# CONFIG_BNX2 is not set
@@ -601,8 +602,6 @@ CONFIG_SGI_IOC3_ETH_HW_TX_CSUM=y
601# Wireless LAN (non-hamradio) 602# Wireless LAN (non-hamradio)
602# 603#
603# CONFIG_NET_RADIO is not set 604# CONFIG_NET_RADIO is not set
604# CONFIG_IPW_DEBUG is not set
605CONFIG_IPW2200=m
606 605
607# 606#
608# Wan interfaces 607# Wan interfaces
@@ -656,6 +655,7 @@ CONFIG_SERIO_RAW=m
656CONFIG_SERIAL_8250=y 655CONFIG_SERIAL_8250=y
657CONFIG_SERIAL_8250_CONSOLE=y 656CONFIG_SERIAL_8250_CONSOLE=y
658CONFIG_SERIAL_8250_NR_UARTS=4 657CONFIG_SERIAL_8250_NR_UARTS=4
658CONFIG_SERIAL_8250_RUNTIME_UARTS=4
659CONFIG_SERIAL_8250_EXTENDED=y 659CONFIG_SERIAL_8250_EXTENDED=y
660CONFIG_SERIAL_8250_MANY_PORTS=y 660CONFIG_SERIAL_8250_MANY_PORTS=y
661CONFIG_SERIAL_8250_SHARE_IRQ=y 661CONFIG_SERIAL_8250_SHARE_IRQ=y
@@ -706,6 +706,12 @@ CONFIG_SGI_IP27_RTC=y
706# CONFIG_I2C is not set 706# CONFIG_I2C is not set
707 707
708# 708#
709# SPI support
710#
711# CONFIG_SPI is not set
712# CONFIG_SPI_MASTER is not set
713
714#
709# Dallas's 1-wire bus 715# Dallas's 1-wire bus
710# 716#
711# CONFIG_W1 is not set 717# CONFIG_W1 is not set
@@ -801,6 +807,7 @@ CONFIG_XFS_QUOTA=y
801CONFIG_XFS_SECURITY=y 807CONFIG_XFS_SECURITY=y
802CONFIG_XFS_POSIX_ACL=y 808CONFIG_XFS_POSIX_ACL=y
803# CONFIG_XFS_RT is not set 809# CONFIG_XFS_RT is not set
810# CONFIG_OCFS2_FS is not set
804# CONFIG_MINIX_FS is not set 811# CONFIG_MINIX_FS is not set
805# CONFIG_ROMFS_FS is not set 812# CONFIG_ROMFS_FS is not set
806CONFIG_INOTIFY=y 813CONFIG_INOTIFY=y
@@ -834,6 +841,7 @@ CONFIG_SYSFS=y
834# CONFIG_HUGETLB_PAGE is not set 841# CONFIG_HUGETLB_PAGE is not set
835CONFIG_RAMFS=y 842CONFIG_RAMFS=y
836CONFIG_RELAYFS_FS=m 843CONFIG_RELAYFS_FS=m
844# CONFIG_CONFIGFS_FS is not set
837 845
838# 846#
839# Miscellaneous filesystems 847# Miscellaneous filesystems
@@ -894,6 +902,7 @@ CONFIG_MSDOS_PARTITION=y
894CONFIG_SGI_PARTITION=y 902CONFIG_SGI_PARTITION=y
895# CONFIG_ULTRIX_PARTITION is not set 903# CONFIG_ULTRIX_PARTITION is not set
896# CONFIG_SUN_PARTITION is not set 904# CONFIG_SUN_PARTITION is not set
905# CONFIG_KARMA_PARTITION is not set
897# CONFIG_EFI_PARTITION is not set 906# CONFIG_EFI_PARTITION is not set
898 907
899# 908#
@@ -910,6 +919,7 @@ CONFIG_SGI_PARTITION=y
910# Kernel hacking 919# Kernel hacking
911# 920#
912# CONFIG_PRINTK_TIME is not set 921# CONFIG_PRINTK_TIME is not set
922# CONFIG_MAGIC_SYSRQ is not set
913# CONFIG_DEBUG_KERNEL is not set 923# CONFIG_DEBUG_KERNEL is not set
914CONFIG_LOG_BUF_SHIFT=15 924CONFIG_LOG_BUF_SHIFT=15
915CONFIG_CROSSCOMPILE=y 925CONFIG_CROSSCOMPILE=y
diff --git a/arch/mips/configs/ip32_defconfig b/arch/mips/configs/ip32_defconfig
index a34db6e82b27..7fdcaf51face 100644
--- a/arch/mips/configs/ip32_defconfig
+++ b/arch/mips/configs/ip32_defconfig
@@ -1,7 +1,7 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.15-rc2 3# Linux kernel version: 2.6.16-rc1
4# Thu Nov 24 01:06:24 2005 4# Fri Jan 27 15:40:09 2006
5# 5#
6CONFIG_MIPS=y 6CONFIG_MIPS=y
7 7
@@ -158,26 +158,28 @@ CONFIG_BSD_PROCESS_ACCT=y
158# CONFIG_BSD_PROCESS_ACCT_V3 is not set 158# CONFIG_BSD_PROCESS_ACCT_V3 is not set
159CONFIG_SYSCTL=y 159CONFIG_SYSCTL=y
160# CONFIG_AUDIT is not set 160# CONFIG_AUDIT is not set
161CONFIG_HOTPLUG=y
162CONFIG_KOBJECT_UEVENT=y
163# CONFIG_IKCONFIG is not set 161# CONFIG_IKCONFIG is not set
164CONFIG_INITRAMFS_SOURCE="" 162CONFIG_INITRAMFS_SOURCE=""
163# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
165CONFIG_EMBEDDED=y 164CONFIG_EMBEDDED=y
166CONFIG_KALLSYMS=y 165CONFIG_KALLSYMS=y
167# CONFIG_KALLSYMS_EXTRA_PASS is not set 166# CONFIG_KALLSYMS_EXTRA_PASS is not set
167CONFIG_HOTPLUG=y
168CONFIG_PRINTK=y 168CONFIG_PRINTK=y
169CONFIG_BUG=y 169CONFIG_BUG=y
170CONFIG_ELF_CORE=y
170CONFIG_BASE_FULL=y 171CONFIG_BASE_FULL=y
171CONFIG_FUTEX=y 172CONFIG_FUTEX=y
172CONFIG_EPOLL=y 173CONFIG_EPOLL=y
173# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
174CONFIG_SHMEM=y 174CONFIG_SHMEM=y
175CONFIG_CC_ALIGN_FUNCTIONS=0 175CONFIG_CC_ALIGN_FUNCTIONS=0
176CONFIG_CC_ALIGN_LABELS=0 176CONFIG_CC_ALIGN_LABELS=0
177CONFIG_CC_ALIGN_LOOPS=0 177CONFIG_CC_ALIGN_LOOPS=0
178CONFIG_CC_ALIGN_JUMPS=0 178CONFIG_CC_ALIGN_JUMPS=0
179CONFIG_SLAB=y
179# CONFIG_TINY_SHMEM is not set 180# CONFIG_TINY_SHMEM is not set
180CONFIG_BASE_SMALL=0 181CONFIG_BASE_SMALL=0
182# CONFIG_SLOB is not set
181 183
182# 184#
183# Loadable module support 185# Loadable module support
@@ -224,7 +226,6 @@ CONFIG_MMU=y
224# 226#
225CONFIG_BINFMT_ELF=y 227CONFIG_BINFMT_ELF=y
226CONFIG_BINFMT_MISC=y 228CONFIG_BINFMT_MISC=y
227# CONFIG_BUILD_ELF64 is not set
228CONFIG_MIPS32_COMPAT=y 229CONFIG_MIPS32_COMPAT=y
229CONFIG_COMPAT=y 230CONFIG_COMPAT=y
230CONFIG_MIPS32_O32=y 231CONFIG_MIPS32_O32=y
@@ -286,6 +287,11 @@ CONFIG_TCP_CONG_BIC=y
286# CONFIG_ATALK is not set 287# CONFIG_ATALK is not set
287# CONFIG_X25 is not set 288# CONFIG_X25 is not set
288# CONFIG_LAPB is not set 289# CONFIG_LAPB is not set
290
291#
292# TIPC Configuration (EXPERIMENTAL)
293#
294# CONFIG_TIPC is not set
289# CONFIG_NET_DIVERT is not set 295# CONFIG_NET_DIVERT is not set
290# CONFIG_ECONET is not set 296# CONFIG_ECONET is not set
291# CONFIG_WAN_ROUTER is not set 297# CONFIG_WAN_ROUTER is not set
@@ -306,7 +312,6 @@ CONFIG_IEEE80211=y
306# CONFIG_IEEE80211_DEBUG is not set 312# CONFIG_IEEE80211_DEBUG is not set
307CONFIG_IEEE80211_CRYPT_WEP=y 313CONFIG_IEEE80211_CRYPT_WEP=y
308CONFIG_IEEE80211_CRYPT_CCMP=y 314CONFIG_IEEE80211_CRYPT_CCMP=y
309CONFIG_IEEE80211_CRYPT_TKIP=y
310 315
311# 316#
312# Device Drivers 317# Device Drivers
@@ -392,7 +397,7 @@ CONFIG_SCSI_LOGGING=y
392# SCSI Transport Attributes 397# SCSI Transport Attributes
393# 398#
394CONFIG_SCSI_SPI_ATTRS=y 399CONFIG_SCSI_SPI_ATTRS=y
395# CONFIG_SCSI_FC_ATTRS is not set 400CONFIG_SCSI_FC_ATTRS=y
396# CONFIG_SCSI_ISCSI_ATTRS is not set 401# CONFIG_SCSI_ISCSI_ATTRS is not set
397CONFIG_SCSI_SAS_ATTRS=y 402CONFIG_SCSI_SAS_ATTRS=y
398 403
@@ -425,13 +430,7 @@ CONFIG_AIC7XXX_REG_PRETTY_PRINT=y
425# CONFIG_SCSI_IPR is not set 430# CONFIG_SCSI_IPR is not set
426# CONFIG_SCSI_QLOGIC_FC is not set 431# CONFIG_SCSI_QLOGIC_FC is not set
427# CONFIG_SCSI_QLOGIC_1280 is not set 432# CONFIG_SCSI_QLOGIC_1280 is not set
428CONFIG_SCSI_QLA2XXX=y 433# CONFIG_SCSI_QLA_FC is not set
429# CONFIG_SCSI_QLA21XX is not set
430# CONFIG_SCSI_QLA22XX is not set
431# CONFIG_SCSI_QLA2300 is not set
432# CONFIG_SCSI_QLA2322 is not set
433# CONFIG_SCSI_QLA6312 is not set
434# CONFIG_SCSI_QLA24XX is not set
435# CONFIG_SCSI_LPFC is not set 434# CONFIG_SCSI_LPFC is not set
436# CONFIG_SCSI_DC395x is not set 435# CONFIG_SCSI_DC395x is not set
437# CONFIG_SCSI_DC390T is not set 436# CONFIG_SCSI_DC390T is not set
@@ -498,6 +497,7 @@ CONFIG_SGI_O2MACE_ETH=y
498# CONFIG_SUNGEM is not set 497# CONFIG_SUNGEM is not set
499# CONFIG_CASSINI is not set 498# CONFIG_CASSINI is not set
500# CONFIG_NET_VENDOR_3COM is not set 499# CONFIG_NET_VENDOR_3COM is not set
500# CONFIG_DM9000 is not set
501 501
502# 502#
503# Tulip family network device support 503# Tulip family network device support
@@ -518,6 +518,7 @@ CONFIG_SGI_O2MACE_ETH=y
518# CONFIG_R8169 is not set 518# CONFIG_R8169 is not set
519# CONFIG_SIS190 is not set 519# CONFIG_SIS190 is not set
520# CONFIG_SKGE is not set 520# CONFIG_SKGE is not set
521# CONFIG_SKY2 is not set
521# CONFIG_SK98LIN is not set 522# CONFIG_SK98LIN is not set
522# CONFIG_TIGON3 is not set 523# CONFIG_TIGON3 is not set
523# CONFIG_BNX2 is not set 524# CONFIG_BNX2 is not set
@@ -538,8 +539,6 @@ CONFIG_SGI_O2MACE_ETH=y
538# Wireless LAN (non-hamradio) 539# Wireless LAN (non-hamradio)
539# 540#
540# CONFIG_NET_RADIO is not set 541# CONFIG_NET_RADIO is not set
541# CONFIG_IPW_DEBUG is not set
542CONFIG_IPW2200=y
543 542
544# 543#
545# Wan interfaces 544# Wan interfaces
@@ -617,6 +616,7 @@ CONFIG_HW_CONSOLE=y
617CONFIG_SERIAL_8250=y 616CONFIG_SERIAL_8250=y
618CONFIG_SERIAL_8250_CONSOLE=y 617CONFIG_SERIAL_8250_CONSOLE=y
619CONFIG_SERIAL_8250_NR_UARTS=4 618CONFIG_SERIAL_8250_NR_UARTS=4
619CONFIG_SERIAL_8250_RUNTIME_UARTS=4
620# CONFIG_SERIAL_8250_EXTENDED is not set 620# CONFIG_SERIAL_8250_EXTENDED is not set
621 621
622# 622#
@@ -624,7 +624,6 @@ CONFIG_SERIAL_8250_NR_UARTS=4
624# 624#
625CONFIG_SERIAL_CORE=y 625CONFIG_SERIAL_CORE=y
626CONFIG_SERIAL_CORE_CONSOLE=y 626CONFIG_SERIAL_CORE_CONSOLE=y
627# CONFIG_SERIAL_JSM is not set
628CONFIG_UNIX98_PTYS=y 627CONFIG_UNIX98_PTYS=y
629CONFIG_LEGACY_PTYS=y 628CONFIG_LEGACY_PTYS=y
630CONFIG_LEGACY_PTY_COUNT=256 629CONFIG_LEGACY_PTY_COUNT=256
@@ -662,6 +661,12 @@ CONFIG_LEGACY_PTY_COUNT=256
662# CONFIG_I2C is not set 661# CONFIG_I2C is not set
663 662
664# 663#
664# SPI support
665#
666# CONFIG_SPI is not set
667# CONFIG_SPI_MASTER is not set
668
669#
665# Dallas's 1-wire bus 670# Dallas's 1-wire bus
666# 671#
667# CONFIG_W1 is not set 672# CONFIG_W1 is not set
@@ -743,11 +748,11 @@ CONFIG_EXT2_FS=y
743# CONFIG_EXT2_FS_XATTR is not set 748# CONFIG_EXT2_FS_XATTR is not set
744# CONFIG_EXT2_FS_XIP is not set 749# CONFIG_EXT2_FS_XIP is not set
745# CONFIG_EXT3_FS is not set 750# CONFIG_EXT3_FS is not set
746# CONFIG_JBD is not set
747# CONFIG_REISERFS_FS is not set 751# CONFIG_REISERFS_FS is not set
748# CONFIG_JFS_FS is not set 752# CONFIG_JFS_FS is not set
749# CONFIG_FS_POSIX_ACL is not set 753# CONFIG_FS_POSIX_ACL is not set
750# CONFIG_XFS_FS is not set 754# CONFIG_XFS_FS is not set
755# CONFIG_OCFS2_FS is not set
751# CONFIG_MINIX_FS is not set 756# CONFIG_MINIX_FS is not set
752# CONFIG_ROMFS_FS is not set 757# CONFIG_ROMFS_FS is not set
753CONFIG_INOTIFY=y 758CONFIG_INOTIFY=y
@@ -780,6 +785,7 @@ CONFIG_TMPFS=y
780# CONFIG_HUGETLB_PAGE is not set 785# CONFIG_HUGETLB_PAGE is not set
781CONFIG_RAMFS=y 786CONFIG_RAMFS=y
782CONFIG_RELAYFS_FS=y 787CONFIG_RELAYFS_FS=y
788# CONFIG_CONFIGFS_FS is not set
783 789
784# 790#
785# Miscellaneous filesystems 791# Miscellaneous filesystems
@@ -835,6 +841,7 @@ CONFIG_PARTITION_ADVANCED=y
835CONFIG_SGI_PARTITION=y 841CONFIG_SGI_PARTITION=y
836# CONFIG_ULTRIX_PARTITION is not set 842# CONFIG_ULTRIX_PARTITION is not set
837# CONFIG_SUN_PARTITION is not set 843# CONFIG_SUN_PARTITION is not set
844# CONFIG_KARMA_PARTITION is not set
838# CONFIG_EFI_PARTITION is not set 845# CONFIG_EFI_PARTITION is not set
839 846
840# 847#
@@ -851,6 +858,7 @@ CONFIG_SGI_PARTITION=y
851# Kernel hacking 858# Kernel hacking
852# 859#
853# CONFIG_PRINTK_TIME is not set 860# CONFIG_PRINTK_TIME is not set
861# CONFIG_MAGIC_SYSRQ is not set
854# CONFIG_DEBUG_KERNEL is not set 862# CONFIG_DEBUG_KERNEL is not set
855CONFIG_LOG_BUF_SHIFT=14 863CONFIG_LOG_BUF_SHIFT=14
856CONFIG_CROSSCOMPILE=y 864CONFIG_CROSSCOMPILE=y
diff --git a/arch/mips/configs/it8172_defconfig b/arch/mips/configs/it8172_defconfig
index b5fa9639db6f..c716996d9eca 100644
--- a/arch/mips/configs/it8172_defconfig
+++ b/arch/mips/configs/it8172_defconfig
@@ -1,7 +1,7 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.15-rc2 3# Linux kernel version: 2.6.16-rc1
4# Thu Nov 24 01:06:26 2005 4# Fri Jan 27 15:40:10 2006
5# 5#
6CONFIG_MIPS=y 6CONFIG_MIPS=y
7 7
@@ -153,26 +153,29 @@ CONFIG_BSD_PROCESS_ACCT=y
153# CONFIG_BSD_PROCESS_ACCT_V3 is not set 153# CONFIG_BSD_PROCESS_ACCT_V3 is not set
154CONFIG_SYSCTL=y 154CONFIG_SYSCTL=y
155# CONFIG_AUDIT is not set 155# CONFIG_AUDIT is not set
156# CONFIG_HOTPLUG is not set
157CONFIG_KOBJECT_UEVENT=y
158# CONFIG_IKCONFIG is not set 156# CONFIG_IKCONFIG is not set
159CONFIG_INITRAMFS_SOURCE="" 157CONFIG_INITRAMFS_SOURCE=""
158# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
160CONFIG_EMBEDDED=y 159CONFIG_EMBEDDED=y
161CONFIG_KALLSYMS=y 160CONFIG_KALLSYMS=y
162# CONFIG_KALLSYMS_EXTRA_PASS is not set 161# CONFIG_KALLSYMS_EXTRA_PASS is not set
162# CONFIG_HOTPLUG is not set
163CONFIG_PRINTK=y 163CONFIG_PRINTK=y
164CONFIG_BUG=y 164CONFIG_BUG=y
165CONFIG_ELF_CORE=y
165CONFIG_BASE_FULL=y 166CONFIG_BASE_FULL=y
166CONFIG_FUTEX=y 167CONFIG_FUTEX=y
167CONFIG_EPOLL=y 168CONFIG_EPOLL=y
168# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
169CONFIG_SHMEM=y 169CONFIG_SHMEM=y
170CONFIG_CC_ALIGN_FUNCTIONS=0 170CONFIG_CC_ALIGN_FUNCTIONS=0
171CONFIG_CC_ALIGN_LABELS=0 171CONFIG_CC_ALIGN_LABELS=0
172CONFIG_CC_ALIGN_LOOPS=0 172CONFIG_CC_ALIGN_LOOPS=0
173CONFIG_CC_ALIGN_JUMPS=0 173CONFIG_CC_ALIGN_JUMPS=0
174CONFIG_SLAB=y
174# CONFIG_TINY_SHMEM is not set 175# CONFIG_TINY_SHMEM is not set
175CONFIG_BASE_SMALL=0 176CONFIG_BASE_SMALL=0
177# CONFIG_SLOB is not set
178CONFIG_OBSOLETE_INTERMODULE=y
176 179
177# 180#
178# Loadable module support 181# Loadable module support
@@ -281,6 +284,11 @@ CONFIG_TCP_CONG_BIC=y
281# CONFIG_ATALK is not set 284# CONFIG_ATALK is not set
282# CONFIG_X25 is not set 285# CONFIG_X25 is not set
283# CONFIG_LAPB is not set 286# CONFIG_LAPB is not set
287
288#
289# TIPC Configuration (EXPERIMENTAL)
290#
291# CONFIG_TIPC is not set
284# CONFIG_NET_DIVERT is not set 292# CONFIG_NET_DIVERT is not set
285# CONFIG_ECONET is not set 293# CONFIG_ECONET is not set
286# CONFIG_WAN_ROUTER is not set 294# CONFIG_WAN_ROUTER is not set
@@ -301,7 +309,6 @@ CONFIG_IEEE80211=m
301# CONFIG_IEEE80211_DEBUG is not set 309# CONFIG_IEEE80211_DEBUG is not set
302CONFIG_IEEE80211_CRYPT_WEP=m 310CONFIG_IEEE80211_CRYPT_WEP=m
303CONFIG_IEEE80211_CRYPT_CCMP=m 311CONFIG_IEEE80211_CRYPT_CCMP=m
304CONFIG_IEEE80211_CRYPT_TKIP=m
305 312
306# 313#
307# Device Drivers 314# Device Drivers
@@ -362,6 +369,7 @@ CONFIG_MTD_CFI_UTIL=y
362# CONFIG_MTD_RAM is not set 369# CONFIG_MTD_RAM is not set
363# CONFIG_MTD_ROM is not set 370# CONFIG_MTD_ROM is not set
364# CONFIG_MTD_ABSENT is not set 371# CONFIG_MTD_ABSENT is not set
372# CONFIG_MTD_OBSOLETE_CHIPS is not set
365 373
366# 374#
367# Mapping drivers for chip access 375# Mapping drivers for chip access
@@ -500,6 +508,7 @@ CONFIG_CICADA_PHY=m
500# 508#
501CONFIG_NET_ETHERNET=y 509CONFIG_NET_ETHERNET=y
502# CONFIG_MII is not set 510# CONFIG_MII is not set
511# CONFIG_DM9000 is not set
503 512
504# 513#
505# Ethernet (1000 Mbit) 514# Ethernet (1000 Mbit)
@@ -593,6 +602,7 @@ CONFIG_HW_CONSOLE=y
593CONFIG_SERIAL_8250=y 602CONFIG_SERIAL_8250=y
594CONFIG_SERIAL_8250_CONSOLE=y 603CONFIG_SERIAL_8250_CONSOLE=y
595CONFIG_SERIAL_8250_NR_UARTS=4 604CONFIG_SERIAL_8250_NR_UARTS=4
605CONFIG_SERIAL_8250_RUNTIME_UARTS=4
596# CONFIG_SERIAL_8250_EXTENDED is not set 606# CONFIG_SERIAL_8250_EXTENDED is not set
597 607
598# 608#
@@ -635,6 +645,12 @@ CONFIG_LEGACY_PTY_COUNT=256
635# CONFIG_I2C is not set 645# CONFIG_I2C is not set
636 646
637# 647#
648# SPI support
649#
650# CONFIG_SPI is not set
651# CONFIG_SPI_MASTER is not set
652
653#
638# Dallas's 1-wire bus 654# Dallas's 1-wire bus
639# 655#
640# CONFIG_W1 is not set 656# CONFIG_W1 is not set
@@ -728,11 +744,11 @@ CONFIG_EXT2_FS=y
728# CONFIG_EXT2_FS_XATTR is not set 744# CONFIG_EXT2_FS_XATTR is not set
729# CONFIG_EXT2_FS_XIP is not set 745# CONFIG_EXT2_FS_XIP is not set
730# CONFIG_EXT3_FS is not set 746# CONFIG_EXT3_FS is not set
731# CONFIG_JBD is not set
732# CONFIG_REISERFS_FS is not set 747# CONFIG_REISERFS_FS is not set
733# CONFIG_JFS_FS is not set 748# CONFIG_JFS_FS is not set
734# CONFIG_FS_POSIX_ACL is not set 749# CONFIG_FS_POSIX_ACL is not set
735# CONFIG_XFS_FS is not set 750# CONFIG_XFS_FS is not set
751# CONFIG_OCFS2_FS is not set
736# CONFIG_MINIX_FS is not set 752# CONFIG_MINIX_FS is not set
737# CONFIG_ROMFS_FS is not set 753# CONFIG_ROMFS_FS is not set
738CONFIG_INOTIFY=y 754CONFIG_INOTIFY=y
@@ -765,6 +781,7 @@ CONFIG_SYSFS=y
765# CONFIG_HUGETLB_PAGE is not set 781# CONFIG_HUGETLB_PAGE is not set
766CONFIG_RAMFS=y 782CONFIG_RAMFS=y
767CONFIG_RELAYFS_FS=m 783CONFIG_RELAYFS_FS=m
784# CONFIG_CONFIGFS_FS is not set
768 785
769# 786#
770# Miscellaneous filesystems 787# Miscellaneous filesystems
@@ -826,6 +843,7 @@ CONFIG_MSDOS_PARTITION=y
826# Kernel hacking 843# Kernel hacking
827# 844#
828# CONFIG_PRINTK_TIME is not set 845# CONFIG_PRINTK_TIME is not set
846# CONFIG_MAGIC_SYSRQ is not set
829# CONFIG_DEBUG_KERNEL is not set 847# CONFIG_DEBUG_KERNEL is not set
830CONFIG_LOG_BUF_SHIFT=14 848CONFIG_LOG_BUF_SHIFT=14
831CONFIG_CROSSCOMPILE=y 849CONFIG_CROSSCOMPILE=y
diff --git a/arch/mips/configs/ivr_defconfig b/arch/mips/configs/ivr_defconfig
index 71386938d47f..a8376d125e11 100644
--- a/arch/mips/configs/ivr_defconfig
+++ b/arch/mips/configs/ivr_defconfig
@@ -1,7 +1,7 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.15-rc2 3# Linux kernel version: 2.6.16-rc1
4# Thu Nov 24 01:06:27 2005 4# Fri Jan 27 15:40:11 2006
5# 5#
6CONFIG_MIPS=y 6CONFIG_MIPS=y
7 7
@@ -150,26 +150,28 @@ CONFIG_BSD_PROCESS_ACCT=y
150# CONFIG_BSD_PROCESS_ACCT_V3 is not set 150# CONFIG_BSD_PROCESS_ACCT_V3 is not set
151CONFIG_SYSCTL=y 151CONFIG_SYSCTL=y
152# CONFIG_AUDIT is not set 152# CONFIG_AUDIT is not set
153CONFIG_HOTPLUG=y
154CONFIG_KOBJECT_UEVENT=y
155# CONFIG_IKCONFIG is not set 153# CONFIG_IKCONFIG is not set
156CONFIG_INITRAMFS_SOURCE="" 154CONFIG_INITRAMFS_SOURCE=""
155# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
157CONFIG_EMBEDDED=y 156CONFIG_EMBEDDED=y
158CONFIG_KALLSYMS=y 157CONFIG_KALLSYMS=y
159# CONFIG_KALLSYMS_EXTRA_PASS is not set 158# CONFIG_KALLSYMS_EXTRA_PASS is not set
159CONFIG_HOTPLUG=y
160CONFIG_PRINTK=y 160CONFIG_PRINTK=y
161CONFIG_BUG=y 161CONFIG_BUG=y
162CONFIG_ELF_CORE=y
162CONFIG_BASE_FULL=y 163CONFIG_BASE_FULL=y
163CONFIG_FUTEX=y 164CONFIG_FUTEX=y
164CONFIG_EPOLL=y 165CONFIG_EPOLL=y
165# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
166CONFIG_SHMEM=y 166CONFIG_SHMEM=y
167CONFIG_CC_ALIGN_FUNCTIONS=0 167CONFIG_CC_ALIGN_FUNCTIONS=0
168CONFIG_CC_ALIGN_LABELS=0 168CONFIG_CC_ALIGN_LABELS=0
169CONFIG_CC_ALIGN_LOOPS=0 169CONFIG_CC_ALIGN_LOOPS=0
170CONFIG_CC_ALIGN_JUMPS=0 170CONFIG_CC_ALIGN_JUMPS=0
171CONFIG_SLAB=y
171# CONFIG_TINY_SHMEM is not set 172# CONFIG_TINY_SHMEM is not set
172CONFIG_BASE_SMALL=0 173CONFIG_BASE_SMALL=0
174# CONFIG_SLOB is not set
173 175
174# 176#
175# Loadable module support 177# Loadable module support
@@ -280,6 +282,11 @@ CONFIG_TCP_CONG_BIC=y
280# CONFIG_ATALK is not set 282# CONFIG_ATALK is not set
281# CONFIG_X25 is not set 283# CONFIG_X25 is not set
282# CONFIG_LAPB is not set 284# CONFIG_LAPB is not set
285
286#
287# TIPC Configuration (EXPERIMENTAL)
288#
289# CONFIG_TIPC is not set
283# CONFIG_NET_DIVERT is not set 290# CONFIG_NET_DIVERT is not set
284# CONFIG_ECONET is not set 291# CONFIG_ECONET is not set
285# CONFIG_WAN_ROUTER is not set 292# CONFIG_WAN_ROUTER is not set
@@ -300,7 +307,6 @@ CONFIG_IEEE80211=m
300# CONFIG_IEEE80211_DEBUG is not set 307# CONFIG_IEEE80211_DEBUG is not set
301CONFIG_IEEE80211_CRYPT_WEP=m 308CONFIG_IEEE80211_CRYPT_WEP=m
302CONFIG_IEEE80211_CRYPT_CCMP=m 309CONFIG_IEEE80211_CRYPT_CCMP=m
303CONFIG_IEEE80211_CRYPT_TKIP=m
304 310
305# 311#
306# Device Drivers 312# Device Drivers
@@ -440,6 +446,7 @@ CONFIG_NET_ETHERNET=y
440# CONFIG_SUNGEM is not set 446# CONFIG_SUNGEM is not set
441# CONFIG_CASSINI is not set 447# CONFIG_CASSINI is not set
442# CONFIG_NET_VENDOR_3COM is not set 448# CONFIG_NET_VENDOR_3COM is not set
449# CONFIG_DM9000 is not set
443 450
444# 451#
445# Tulip family network device support 452# Tulip family network device support
@@ -460,6 +467,7 @@ CONFIG_NET_ETHERNET=y
460# CONFIG_R8169 is not set 467# CONFIG_R8169 is not set
461# CONFIG_SIS190 is not set 468# CONFIG_SIS190 is not set
462# CONFIG_SKGE is not set 469# CONFIG_SKGE is not set
470# CONFIG_SKY2 is not set
463# CONFIG_SK98LIN is not set 471# CONFIG_SK98LIN is not set
464# CONFIG_TIGON3 is not set 472# CONFIG_TIGON3 is not set
465# CONFIG_BNX2 is not set 473# CONFIG_BNX2 is not set
@@ -480,8 +488,6 @@ CONFIG_NET_ETHERNET=y
480# Wireless LAN (non-hamradio) 488# Wireless LAN (non-hamradio)
481# 489#
482# CONFIG_NET_RADIO is not set 490# CONFIG_NET_RADIO is not set
483# CONFIG_IPW_DEBUG is not set
484CONFIG_IPW2200=m
485 491
486# 492#
487# Wan interfaces 493# Wan interfaces
@@ -560,6 +566,7 @@ CONFIG_IT8172_SCR1=y
560CONFIG_SERIAL_8250=y 566CONFIG_SERIAL_8250=y
561CONFIG_SERIAL_8250_CONSOLE=y 567CONFIG_SERIAL_8250_CONSOLE=y
562CONFIG_SERIAL_8250_NR_UARTS=4 568CONFIG_SERIAL_8250_NR_UARTS=4
569CONFIG_SERIAL_8250_RUNTIME_UARTS=4
563# CONFIG_SERIAL_8250_EXTENDED is not set 570# CONFIG_SERIAL_8250_EXTENDED is not set
564 571
565# 572#
@@ -567,7 +574,6 @@ CONFIG_SERIAL_8250_NR_UARTS=4
567# 574#
568CONFIG_SERIAL_CORE=y 575CONFIG_SERIAL_CORE=y
569CONFIG_SERIAL_CORE_CONSOLE=y 576CONFIG_SERIAL_CORE_CONSOLE=y
570# CONFIG_SERIAL_JSM is not set
571CONFIG_UNIX98_PTYS=y 577CONFIG_UNIX98_PTYS=y
572CONFIG_LEGACY_PTYS=y 578CONFIG_LEGACY_PTYS=y
573CONFIG_LEGACY_PTY_COUNT=256 579CONFIG_LEGACY_PTY_COUNT=256
@@ -604,6 +610,12 @@ CONFIG_RTC=y
604# CONFIG_I2C is not set 610# CONFIG_I2C is not set
605 611
606# 612#
613# SPI support
614#
615# CONFIG_SPI is not set
616# CONFIG_SPI_MASTER is not set
617
618#
607# Dallas's 1-wire bus 619# Dallas's 1-wire bus
608# 620#
609# CONFIG_W1 is not set 621# CONFIG_W1 is not set
@@ -685,11 +697,11 @@ CONFIG_EXT2_FS=y
685# CONFIG_EXT2_FS_XATTR is not set 697# CONFIG_EXT2_FS_XATTR is not set
686# CONFIG_EXT2_FS_XIP is not set 698# CONFIG_EXT2_FS_XIP is not set
687# CONFIG_EXT3_FS is not set 699# CONFIG_EXT3_FS is not set
688# CONFIG_JBD is not set
689# CONFIG_REISERFS_FS is not set 700# CONFIG_REISERFS_FS is not set
690# CONFIG_JFS_FS is not set 701# CONFIG_JFS_FS is not set
691# CONFIG_FS_POSIX_ACL is not set 702# CONFIG_FS_POSIX_ACL is not set
692# CONFIG_XFS_FS is not set 703# CONFIG_XFS_FS is not set
704# CONFIG_OCFS2_FS is not set
693# CONFIG_MINIX_FS is not set 705# CONFIG_MINIX_FS is not set
694# CONFIG_ROMFS_FS is not set 706# CONFIG_ROMFS_FS is not set
695CONFIG_INOTIFY=y 707CONFIG_INOTIFY=y
@@ -722,6 +734,7 @@ CONFIG_SYSFS=y
722# CONFIG_HUGETLB_PAGE is not set 734# CONFIG_HUGETLB_PAGE is not set
723CONFIG_RAMFS=y 735CONFIG_RAMFS=y
724CONFIG_RELAYFS_FS=m 736CONFIG_RELAYFS_FS=m
737# CONFIG_CONFIGFS_FS is not set
725 738
726# 739#
727# Miscellaneous filesystems 740# Miscellaneous filesystems
@@ -781,6 +794,7 @@ CONFIG_MSDOS_PARTITION=y
781# Kernel hacking 794# Kernel hacking
782# 795#
783# CONFIG_PRINTK_TIME is not set 796# CONFIG_PRINTK_TIME is not set
797# CONFIG_MAGIC_SYSRQ is not set
784# CONFIG_DEBUG_KERNEL is not set 798# CONFIG_DEBUG_KERNEL is not set
785CONFIG_LOG_BUF_SHIFT=14 799CONFIG_LOG_BUF_SHIFT=14
786CONFIG_CROSSCOMPILE=y 800CONFIG_CROSSCOMPILE=y
diff --git a/arch/mips/configs/jaguar-atx_defconfig b/arch/mips/configs/jaguar-atx_defconfig
index 14fb46886708..316015379dbc 100644
--- a/arch/mips/configs/jaguar-atx_defconfig
+++ b/arch/mips/configs/jaguar-atx_defconfig
@@ -1,7 +1,7 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.15-rc2 3# Linux kernel version: 2.6.16-rc1
4# Thu Nov 24 01:06:29 2005 4# Fri Jan 27 15:40:12 2006
5# 5#
6CONFIG_MIPS=y 6CONFIG_MIPS=y
7 7
@@ -158,27 +158,28 @@ CONFIG_SYSVIPC=y
158# CONFIG_BSD_PROCESS_ACCT is not set 158# CONFIG_BSD_PROCESS_ACCT is not set
159CONFIG_SYSCTL=y 159CONFIG_SYSCTL=y
160# CONFIG_AUDIT is not set 160# CONFIG_AUDIT is not set
161CONFIG_HOTPLUG=y
162CONFIG_KOBJECT_UEVENT=y
163CONFIG_IKCONFIG=y 161CONFIG_IKCONFIG=y
164CONFIG_IKCONFIG_PROC=y 162CONFIG_IKCONFIG_PROC=y
165CONFIG_INITRAMFS_SOURCE="" 163CONFIG_INITRAMFS_SOURCE=""
166CONFIG_EMBEDDED=y 164CONFIG_EMBEDDED=y
167CONFIG_KALLSYMS=y 165CONFIG_KALLSYMS=y
168# CONFIG_KALLSYMS_EXTRA_PASS is not set 166# CONFIG_KALLSYMS_EXTRA_PASS is not set
167CONFIG_HOTPLUG=y
169CONFIG_PRINTK=y 168CONFIG_PRINTK=y
170CONFIG_BUG=y 169CONFIG_BUG=y
170CONFIG_ELF_CORE=y
171CONFIG_BASE_FULL=y 171CONFIG_BASE_FULL=y
172CONFIG_FUTEX=y 172CONFIG_FUTEX=y
173CONFIG_EPOLL=y 173CONFIG_EPOLL=y
174# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
175CONFIG_SHMEM=y 174CONFIG_SHMEM=y
176CONFIG_CC_ALIGN_FUNCTIONS=0 175CONFIG_CC_ALIGN_FUNCTIONS=0
177CONFIG_CC_ALIGN_LABELS=0 176CONFIG_CC_ALIGN_LABELS=0
178CONFIG_CC_ALIGN_LOOPS=0 177CONFIG_CC_ALIGN_LOOPS=0
179CONFIG_CC_ALIGN_JUMPS=0 178CONFIG_CC_ALIGN_JUMPS=0
179CONFIG_SLAB=y
180# CONFIG_TINY_SHMEM is not set 180# CONFIG_TINY_SHMEM is not set
181CONFIG_BASE_SMALL=0 181CONFIG_BASE_SMALL=0
182# CONFIG_SLOB is not set
182 183
183# 184#
184# Loadable module support 185# Loadable module support
@@ -186,6 +187,7 @@ CONFIG_BASE_SMALL=0
186CONFIG_MODULES=y 187CONFIG_MODULES=y
187CONFIG_MODULE_UNLOAD=y 188CONFIG_MODULE_UNLOAD=y
188CONFIG_OBSOLETE_MODPARM=y 189CONFIG_OBSOLETE_MODPARM=y
190# CONFIG_MODVERSIONS is not set
189CONFIG_MODULE_SRCVERSION_ALL=y 191CONFIG_MODULE_SRCVERSION_ALL=y
190CONFIG_KMOD=y 192CONFIG_KMOD=y
191 193
@@ -294,7 +296,6 @@ CONFIG_IEEE80211=m
294# CONFIG_IEEE80211_DEBUG is not set 296# CONFIG_IEEE80211_DEBUG is not set
295CONFIG_IEEE80211_CRYPT_WEP=m 297CONFIG_IEEE80211_CRYPT_WEP=m
296CONFIG_IEEE80211_CRYPT_CCMP=m 298CONFIG_IEEE80211_CRYPT_CCMP=m
297CONFIG_IEEE80211_CRYPT_TKIP=m
298 299
299# 300#
300# Device Drivers 301# Device Drivers
@@ -411,6 +412,7 @@ CONFIG_MII=y
411# CONFIG_SUNGEM is not set 412# CONFIG_SUNGEM is not set
412# CONFIG_CASSINI is not set 413# CONFIG_CASSINI is not set
413# CONFIG_NET_VENDOR_3COM is not set 414# CONFIG_NET_VENDOR_3COM is not set
415# CONFIG_DM9000 is not set
414 416
415# 417#
416# Tulip family network device support 418# Tulip family network device support
@@ -469,8 +471,6 @@ CONFIG_MV643XX_ETH_2=y
469# Wireless LAN (non-hamradio) 471# Wireless LAN (non-hamradio)
470# 472#
471# CONFIG_NET_RADIO is not set 473# CONFIG_NET_RADIO is not set
472# CONFIG_IPW_DEBUG is not set
473CONFIG_IPW2200=m
474 474
475# 475#
476# Wan interfaces 476# Wan interfaces
@@ -515,6 +515,7 @@ CONFIG_IPW2200=m
515CONFIG_SERIAL_8250=y 515CONFIG_SERIAL_8250=y
516CONFIG_SERIAL_8250_CONSOLE=y 516CONFIG_SERIAL_8250_CONSOLE=y
517CONFIG_SERIAL_8250_NR_UARTS=4 517CONFIG_SERIAL_8250_NR_UARTS=4
518CONFIG_SERIAL_8250_RUNTIME_UARTS=4
518# CONFIG_SERIAL_8250_EXTENDED is not set 519# CONFIG_SERIAL_8250_EXTENDED is not set
519 520
520# 521#
@@ -522,7 +523,6 @@ CONFIG_SERIAL_8250_NR_UARTS=4
522# 523#
523CONFIG_SERIAL_CORE=y 524CONFIG_SERIAL_CORE=y
524CONFIG_SERIAL_CORE_CONSOLE=y 525CONFIG_SERIAL_CORE_CONSOLE=y
525# CONFIG_SERIAL_JSM is not set
526CONFIG_UNIX98_PTYS=y 526CONFIG_UNIX98_PTYS=y
527CONFIG_LEGACY_PTYS=y 527CONFIG_LEGACY_PTYS=y
528CONFIG_LEGACY_PTY_COUNT=256 528CONFIG_LEGACY_PTY_COUNT=256
@@ -558,6 +558,12 @@ CONFIG_LEGACY_PTY_COUNT=256
558# CONFIG_I2C is not set 558# CONFIG_I2C is not set
559 559
560# 560#
561# SPI support
562#
563# CONFIG_SPI is not set
564# CONFIG_SPI_MASTER is not set
565
566#
561# Dallas's 1-wire bus 567# Dallas's 1-wire bus
562# 568#
563# CONFIG_W1 is not set 569# CONFIG_W1 is not set
@@ -631,7 +637,6 @@ CONFIG_USB_ARCH_HAS_OHCI=y
631# 637#
632# CONFIG_EXT2_FS is not set 638# CONFIG_EXT2_FS is not set
633# CONFIG_EXT3_FS is not set 639# CONFIG_EXT3_FS is not set
634# CONFIG_JBD is not set
635# CONFIG_REISERFS_FS is not set 640# CONFIG_REISERFS_FS is not set
636# CONFIG_JFS_FS is not set 641# CONFIG_JFS_FS is not set
637# CONFIG_FS_POSIX_ACL is not set 642# CONFIG_FS_POSIX_ACL is not set
@@ -710,6 +715,7 @@ CONFIG_MSDOS_PARTITION=y
710# Kernel hacking 715# Kernel hacking
711# 716#
712# CONFIG_PRINTK_TIME is not set 717# CONFIG_PRINTK_TIME is not set
718# CONFIG_MAGIC_SYSRQ is not set
713# CONFIG_DEBUG_KERNEL is not set 719# CONFIG_DEBUG_KERNEL is not set
714CONFIG_LOG_BUF_SHIFT=14 720CONFIG_LOG_BUF_SHIFT=14
715CONFIG_CROSSCOMPILE=y 721CONFIG_CROSSCOMPILE=y
diff --git a/arch/mips/configs/jmr3927_defconfig b/arch/mips/configs/jmr3927_defconfig
index a8ded3d74152..53fbef1ac25d 100644
--- a/arch/mips/configs/jmr3927_defconfig
+++ b/arch/mips/configs/jmr3927_defconfig
@@ -1,7 +1,7 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.15-rc2 3# Linux kernel version: 2.6.16-rc1
4# Thu Nov 24 01:06:31 2005 4# Fri Jan 27 15:40:13 2006
5# 5#
6CONFIG_MIPS=y 6CONFIG_MIPS=y
7 7
@@ -148,26 +148,28 @@ CONFIG_SYSVIPC=y
148# CONFIG_BSD_PROCESS_ACCT is not set 148# CONFIG_BSD_PROCESS_ACCT is not set
149CONFIG_SYSCTL=y 149CONFIG_SYSCTL=y
150# CONFIG_AUDIT is not set 150# CONFIG_AUDIT is not set
151CONFIG_HOTPLUG=y
152CONFIG_KOBJECT_UEVENT=y
153# CONFIG_IKCONFIG is not set 151# CONFIG_IKCONFIG is not set
154CONFIG_INITRAMFS_SOURCE="" 152CONFIG_INITRAMFS_SOURCE=""
153# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
155CONFIG_EMBEDDED=y 154CONFIG_EMBEDDED=y
156CONFIG_KALLSYMS=y 155CONFIG_KALLSYMS=y
157# CONFIG_KALLSYMS_EXTRA_PASS is not set 156# CONFIG_KALLSYMS_EXTRA_PASS is not set
157CONFIG_HOTPLUG=y
158CONFIG_PRINTK=y 158CONFIG_PRINTK=y
159CONFIG_BUG=y 159CONFIG_BUG=y
160CONFIG_ELF_CORE=y
160CONFIG_BASE_FULL=y 161CONFIG_BASE_FULL=y
161CONFIG_FUTEX=y 162CONFIG_FUTEX=y
162CONFIG_EPOLL=y 163CONFIG_EPOLL=y
163# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
164CONFIG_SHMEM=y 164CONFIG_SHMEM=y
165CONFIG_CC_ALIGN_FUNCTIONS=0 165CONFIG_CC_ALIGN_FUNCTIONS=0
166CONFIG_CC_ALIGN_LABELS=0 166CONFIG_CC_ALIGN_LABELS=0
167CONFIG_CC_ALIGN_LOOPS=0 167CONFIG_CC_ALIGN_LOOPS=0
168CONFIG_CC_ALIGN_JUMPS=0 168CONFIG_CC_ALIGN_JUMPS=0
169CONFIG_SLAB=y
169# CONFIG_TINY_SHMEM is not set 170# CONFIG_TINY_SHMEM is not set
170CONFIG_BASE_SMALL=0 171CONFIG_BASE_SMALL=0
172# CONFIG_SLOB is not set
171 173
172# 174#
173# Loadable module support 175# Loadable module support
@@ -272,6 +274,11 @@ CONFIG_TCP_CONG_BIC=y
272# CONFIG_ATALK is not set 274# CONFIG_ATALK is not set
273# CONFIG_X25 is not set 275# CONFIG_X25 is not set
274# CONFIG_LAPB is not set 276# CONFIG_LAPB is not set
277
278#
279# TIPC Configuration (EXPERIMENTAL)
280#
281# CONFIG_TIPC is not set
275# CONFIG_NET_DIVERT is not set 282# CONFIG_NET_DIVERT is not set
276# CONFIG_ECONET is not set 283# CONFIG_ECONET is not set
277# CONFIG_WAN_ROUTER is not set 284# CONFIG_WAN_ROUTER is not set
@@ -292,7 +299,6 @@ CONFIG_IEEE80211=y
292# CONFIG_IEEE80211_DEBUG is not set 299# CONFIG_IEEE80211_DEBUG is not set
293CONFIG_IEEE80211_CRYPT_WEP=y 300CONFIG_IEEE80211_CRYPT_WEP=y
294CONFIG_IEEE80211_CRYPT_CCMP=y 301CONFIG_IEEE80211_CRYPT_CCMP=y
295CONFIG_IEEE80211_CRYPT_TKIP=y
296 302
297# 303#
298# Device Drivers 304# Device Drivers
@@ -411,6 +417,7 @@ CONFIG_NET_ETHERNET=y
411# CONFIG_SUNGEM is not set 417# CONFIG_SUNGEM is not set
412# CONFIG_CASSINI is not set 418# CONFIG_CASSINI is not set
413# CONFIG_NET_VENDOR_3COM is not set 419# CONFIG_NET_VENDOR_3COM is not set
420# CONFIG_DM9000 is not set
414 421
415# 422#
416# Tulip family network device support 423# Tulip family network device support
@@ -431,6 +438,7 @@ CONFIG_NET_ETHERNET=y
431# CONFIG_R8169 is not set 438# CONFIG_R8169 is not set
432# CONFIG_SIS190 is not set 439# CONFIG_SIS190 is not set
433# CONFIG_SKGE is not set 440# CONFIG_SKGE is not set
441# CONFIG_SKY2 is not set
434# CONFIG_SK98LIN is not set 442# CONFIG_SK98LIN is not set
435# CONFIG_TIGON3 is not set 443# CONFIG_TIGON3 is not set
436# CONFIG_BNX2 is not set 444# CONFIG_BNX2 is not set
@@ -451,8 +459,6 @@ CONFIG_NET_ETHERNET=y
451# Wireless LAN (non-hamradio) 459# Wireless LAN (non-hamradio)
452# 460#
453# CONFIG_NET_RADIO is not set 461# CONFIG_NET_RADIO is not set
454# CONFIG_IPW_DEBUG is not set
455CONFIG_IPW2200=y
456 462
457# 463#
458# Wan interfaces 464# Wan interfaces
@@ -529,6 +535,7 @@ CONFIG_SERIAL_NONSTANDARD=y
529# CONFIG_MOXA_SMARTIO is not set 535# CONFIG_MOXA_SMARTIO is not set
530# CONFIG_ISI is not set 536# CONFIG_ISI is not set
531# CONFIG_SYNCLINKMP is not set 537# CONFIG_SYNCLINKMP is not set
538# CONFIG_SYNCLINK_GT is not set
532# CONFIG_N_HDLC is not set 539# CONFIG_N_HDLC is not set
533# CONFIG_RISCOM8 is not set 540# CONFIG_RISCOM8 is not set
534# CONFIG_SPECIALIX is not set 541# CONFIG_SPECIALIX is not set
@@ -545,7 +552,6 @@ CONFIG_SERIAL_NONSTANDARD=y
545# Non-8250 serial port support 552# Non-8250 serial port support
546# 553#
547CONFIG_HAS_TXX9_SERIAL=y 554CONFIG_HAS_TXX9_SERIAL=y
548# CONFIG_SERIAL_JSM is not set
549# CONFIG_UNIX98_PTYS is not set 555# CONFIG_UNIX98_PTYS is not set
550CONFIG_LEGACY_PTYS=y 556CONFIG_LEGACY_PTYS=y
551CONFIG_LEGACY_PTY_COUNT=256 557CONFIG_LEGACY_PTY_COUNT=256
@@ -583,6 +589,12 @@ CONFIG_LEGACY_PTY_COUNT=256
583# CONFIG_I2C is not set 589# CONFIG_I2C is not set
584 590
585# 591#
592# SPI support
593#
594# CONFIG_SPI is not set
595# CONFIG_SPI_MASTER is not set
596
597#
586# Dallas's 1-wire bus 598# Dallas's 1-wire bus
587# 599#
588# CONFIG_W1 is not set 600# CONFIG_W1 is not set
@@ -641,7 +653,6 @@ CONFIG_FB=y
641# CONFIG_FB_3DFX is not set 653# CONFIG_FB_3DFX is not set
642# CONFIG_FB_VOODOO1 is not set 654# CONFIG_FB_VOODOO1 is not set
643# CONFIG_FB_SMIVGX is not set 655# CONFIG_FB_SMIVGX is not set
644# CONFIG_FB_CYBLA is not set
645# CONFIG_FB_TRIDENT is not set 656# CONFIG_FB_TRIDENT is not set
646# CONFIG_FB_VIRTUAL is not set 657# CONFIG_FB_VIRTUAL is not set
647 658
@@ -698,11 +709,11 @@ CONFIG_USB_ARCH_HAS_OHCI=y
698# 709#
699# CONFIG_EXT2_FS is not set 710# CONFIG_EXT2_FS is not set
700# CONFIG_EXT3_FS is not set 711# CONFIG_EXT3_FS is not set
701# CONFIG_JBD is not set
702# CONFIG_REISERFS_FS is not set 712# CONFIG_REISERFS_FS is not set
703# CONFIG_JFS_FS is not set 713# CONFIG_JFS_FS is not set
704# CONFIG_FS_POSIX_ACL is not set 714# CONFIG_FS_POSIX_ACL is not set
705# CONFIG_XFS_FS is not set 715# CONFIG_XFS_FS is not set
716# CONFIG_OCFS2_FS is not set
706# CONFIG_MINIX_FS is not set 717# CONFIG_MINIX_FS is not set
707# CONFIG_ROMFS_FS is not set 718# CONFIG_ROMFS_FS is not set
708CONFIG_INOTIFY=y 719CONFIG_INOTIFY=y
@@ -735,6 +746,7 @@ CONFIG_SYSFS=y
735# CONFIG_HUGETLB_PAGE is not set 746# CONFIG_HUGETLB_PAGE is not set
736CONFIG_RAMFS=y 747CONFIG_RAMFS=y
737CONFIG_RELAYFS_FS=y 748CONFIG_RELAYFS_FS=y
749# CONFIG_CONFIGFS_FS is not set
738 750
739# 751#
740# Miscellaneous filesystems 752# Miscellaneous filesystems
@@ -794,6 +806,7 @@ CONFIG_MSDOS_PARTITION=y
794# Kernel hacking 806# Kernel hacking
795# 807#
796# CONFIG_PRINTK_TIME is not set 808# CONFIG_PRINTK_TIME is not set
809# CONFIG_MAGIC_SYSRQ is not set
797# CONFIG_DEBUG_KERNEL is not set 810# CONFIG_DEBUG_KERNEL is not set
798CONFIG_LOG_BUF_SHIFT=14 811CONFIG_LOG_BUF_SHIFT=14
799CONFIG_CROSSCOMPILE=y 812CONFIG_CROSSCOMPILE=y
diff --git a/arch/mips/configs/lasat200_defconfig b/arch/mips/configs/lasat200_defconfig
index 6c5df76d48d9..ef0fa9fc79d6 100644
--- a/arch/mips/configs/lasat200_defconfig
+++ b/arch/mips/configs/lasat200_defconfig
@@ -1,7 +1,7 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.15-rc2 3# Linux kernel version: 2.6.16-rc1
4# Thu Nov 24 01:06:33 2005 4# Fri Jan 27 15:40:14 2006
5# 5#
6CONFIG_MIPS=y 6CONFIG_MIPS=y
7 7
@@ -156,26 +156,29 @@ CONFIG_SYSVIPC=y
156# CONFIG_BSD_PROCESS_ACCT is not set 156# CONFIG_BSD_PROCESS_ACCT is not set
157CONFIG_SYSCTL=y 157CONFIG_SYSCTL=y
158# CONFIG_AUDIT is not set 158# CONFIG_AUDIT is not set
159CONFIG_HOTPLUG=y
160CONFIG_KOBJECT_UEVENT=y
161# CONFIG_IKCONFIG is not set 159# CONFIG_IKCONFIG is not set
162CONFIG_INITRAMFS_SOURCE="" 160CONFIG_INITRAMFS_SOURCE=""
161# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
163CONFIG_EMBEDDED=y 162CONFIG_EMBEDDED=y
164CONFIG_KALLSYMS=y 163CONFIG_KALLSYMS=y
165# CONFIG_KALLSYMS_EXTRA_PASS is not set 164# CONFIG_KALLSYMS_EXTRA_PASS is not set
165CONFIG_HOTPLUG=y
166CONFIG_PRINTK=y 166CONFIG_PRINTK=y
167CONFIG_BUG=y 167CONFIG_BUG=y
168CONFIG_ELF_CORE=y
168CONFIG_BASE_FULL=y 169CONFIG_BASE_FULL=y
169CONFIG_FUTEX=y 170CONFIG_FUTEX=y
170CONFIG_EPOLL=y 171CONFIG_EPOLL=y
171# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
172CONFIG_SHMEM=y 172CONFIG_SHMEM=y
173CONFIG_CC_ALIGN_FUNCTIONS=0 173CONFIG_CC_ALIGN_FUNCTIONS=0
174CONFIG_CC_ALIGN_LABELS=0 174CONFIG_CC_ALIGN_LABELS=0
175CONFIG_CC_ALIGN_LOOPS=0 175CONFIG_CC_ALIGN_LOOPS=0
176CONFIG_CC_ALIGN_JUMPS=0 176CONFIG_CC_ALIGN_JUMPS=0
177CONFIG_SLAB=y
177# CONFIG_TINY_SHMEM is not set 178# CONFIG_TINY_SHMEM is not set
178CONFIG_BASE_SMALL=0 179CONFIG_BASE_SMALL=0
180# CONFIG_SLOB is not set
181CONFIG_OBSOLETE_INTERMODULE=y
179 182
180# 183#
181# Loadable module support 184# Loadable module support
@@ -282,6 +285,11 @@ CONFIG_TCP_CONG_BIC=y
282# CONFIG_ATALK is not set 285# CONFIG_ATALK is not set
283# CONFIG_X25 is not set 286# CONFIG_X25 is not set
284# CONFIG_LAPB is not set 287# CONFIG_LAPB is not set
288
289#
290# TIPC Configuration (EXPERIMENTAL)
291#
292# CONFIG_TIPC is not set
285# CONFIG_NET_DIVERT is not set 293# CONFIG_NET_DIVERT is not set
286# CONFIG_ECONET is not set 294# CONFIG_ECONET is not set
287# CONFIG_WAN_ROUTER is not set 295# CONFIG_WAN_ROUTER is not set
@@ -302,7 +310,6 @@ CONFIG_IEEE80211=m
302# CONFIG_IEEE80211_DEBUG is not set 310# CONFIG_IEEE80211_DEBUG is not set
303CONFIG_IEEE80211_CRYPT_WEP=m 311CONFIG_IEEE80211_CRYPT_WEP=m
304CONFIG_IEEE80211_CRYPT_CCMP=m 312CONFIG_IEEE80211_CRYPT_CCMP=m
305CONFIG_IEEE80211_CRYPT_TKIP=m
306 313
307# 314#
308# Device Drivers 315# Device Drivers
@@ -365,6 +372,7 @@ CONFIG_MTD_CFI_UTIL=y
365# CONFIG_MTD_RAM is not set 372# CONFIG_MTD_RAM is not set
366# CONFIG_MTD_ROM is not set 373# CONFIG_MTD_ROM is not set
367# CONFIG_MTD_ABSENT is not set 374# CONFIG_MTD_ABSENT is not set
375# CONFIG_MTD_OBSOLETE_CHIPS is not set
368 376
369# 377#
370# Mapping drivers for chip access 378# Mapping drivers for chip access
@@ -548,6 +556,7 @@ CONFIG_NET_ETHERNET=y
548# CONFIG_SUNGEM is not set 556# CONFIG_SUNGEM is not set
549# CONFIG_CASSINI is not set 557# CONFIG_CASSINI is not set
550# CONFIG_NET_VENDOR_3COM is not set 558# CONFIG_NET_VENDOR_3COM is not set
559# CONFIG_DM9000 is not set
551 560
552# 561#
553# Tulip family network device support 562# Tulip family network device support
@@ -568,6 +577,7 @@ CONFIG_NET_ETHERNET=y
568# CONFIG_R8169 is not set 577# CONFIG_R8169 is not set
569# CONFIG_SIS190 is not set 578# CONFIG_SIS190 is not set
570# CONFIG_SKGE is not set 579# CONFIG_SKGE is not set
580# CONFIG_SKY2 is not set
571# CONFIG_SK98LIN is not set 581# CONFIG_SK98LIN is not set
572# CONFIG_TIGON3 is not set 582# CONFIG_TIGON3 is not set
573# CONFIG_BNX2 is not set 583# CONFIG_BNX2 is not set
@@ -588,8 +598,6 @@ CONFIG_NET_ETHERNET=y
588# Wireless LAN (non-hamradio) 598# Wireless LAN (non-hamradio)
589# 599#
590# CONFIG_NET_RADIO is not set 600# CONFIG_NET_RADIO is not set
591# CONFIG_IPW_DEBUG is not set
592CONFIG_IPW2200=m
593 601
594# 602#
595# Wan interfaces 603# Wan interfaces
@@ -665,6 +673,7 @@ CONFIG_HW_CONSOLE=y
665CONFIG_SERIAL_8250=y 673CONFIG_SERIAL_8250=y
666CONFIG_SERIAL_8250_CONSOLE=y 674CONFIG_SERIAL_8250_CONSOLE=y
667CONFIG_SERIAL_8250_NR_UARTS=4 675CONFIG_SERIAL_8250_NR_UARTS=4
676CONFIG_SERIAL_8250_RUNTIME_UARTS=4
668# CONFIG_SERIAL_8250_EXTENDED is not set 677# CONFIG_SERIAL_8250_EXTENDED is not set
669 678
670# 679#
@@ -672,7 +681,6 @@ CONFIG_SERIAL_8250_NR_UARTS=4
672# 681#
673CONFIG_SERIAL_CORE=y 682CONFIG_SERIAL_CORE=y
674CONFIG_SERIAL_CORE_CONSOLE=y 683CONFIG_SERIAL_CORE_CONSOLE=y
675# CONFIG_SERIAL_JSM is not set
676CONFIG_UNIX98_PTYS=y 684CONFIG_UNIX98_PTYS=y
677CONFIG_LEGACY_PTYS=y 685CONFIG_LEGACY_PTYS=y
678CONFIG_LEGACY_PTY_COUNT=256 686CONFIG_LEGACY_PTY_COUNT=256
@@ -710,6 +718,12 @@ CONFIG_LEGACY_PTY_COUNT=256
710# CONFIG_I2C is not set 718# CONFIG_I2C is not set
711 719
712# 720#
721# SPI support
722#
723# CONFIG_SPI is not set
724# CONFIG_SPI_MASTER is not set
725
726#
713# Dallas's 1-wire bus 727# Dallas's 1-wire bus
714# 728#
715# CONFIG_W1 is not set 729# CONFIG_W1 is not set
@@ -801,6 +815,7 @@ CONFIG_FS_MBCACHE=y
801# CONFIG_JFS_FS is not set 815# CONFIG_JFS_FS is not set
802# CONFIG_FS_POSIX_ACL is not set 816# CONFIG_FS_POSIX_ACL is not set
803# CONFIG_XFS_FS is not set 817# CONFIG_XFS_FS is not set
818# CONFIG_OCFS2_FS is not set
804# CONFIG_MINIX_FS is not set 819# CONFIG_MINIX_FS is not set
805# CONFIG_ROMFS_FS is not set 820# CONFIG_ROMFS_FS is not set
806CONFIG_INOTIFY=y 821CONFIG_INOTIFY=y
@@ -833,6 +848,7 @@ CONFIG_SYSFS=y
833# CONFIG_HUGETLB_PAGE is not set 848# CONFIG_HUGETLB_PAGE is not set
834CONFIG_RAMFS=y 849CONFIG_RAMFS=y
835CONFIG_RELAYFS_FS=m 850CONFIG_RELAYFS_FS=m
851# CONFIG_CONFIGFS_FS is not set
836 852
837# 853#
838# Miscellaneous filesystems 854# Miscellaneous filesystems
@@ -895,6 +911,7 @@ CONFIG_MSDOS_PARTITION=y
895# Kernel hacking 911# Kernel hacking
896# 912#
897# CONFIG_PRINTK_TIME is not set 913# CONFIG_PRINTK_TIME is not set
914# CONFIG_MAGIC_SYSRQ is not set
898# CONFIG_DEBUG_KERNEL is not set 915# CONFIG_DEBUG_KERNEL is not set
899CONFIG_LOG_BUF_SHIFT=14 916CONFIG_LOG_BUF_SHIFT=14
900CONFIG_CROSSCOMPILE=y 917CONFIG_CROSSCOMPILE=y
diff --git a/arch/mips/configs/malta_defconfig b/arch/mips/configs/malta_defconfig
index da0677a03c1d..367d279efdd9 100644
--- a/arch/mips/configs/malta_defconfig
+++ b/arch/mips/configs/malta_defconfig
@@ -1,7 +1,7 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.15-rc5 3# Linux kernel version: 2.6.16-rc1
4# Fri Dec 23 02:21:03 2005 4# Fri Jan 27 15:40:15 2006
5# 5#
6CONFIG_MIPS=y 6CONFIG_MIPS=y
7 7
@@ -170,26 +170,28 @@ CONFIG_SYSVIPC=y
170# CONFIG_BSD_PROCESS_ACCT is not set 170# CONFIG_BSD_PROCESS_ACCT is not set
171CONFIG_SYSCTL=y 171CONFIG_SYSCTL=y
172# CONFIG_AUDIT is not set 172# CONFIG_AUDIT is not set
173CONFIG_HOTPLUG=y
174CONFIG_KOBJECT_UEVENT=y
175# CONFIG_IKCONFIG is not set 173# CONFIG_IKCONFIG is not set
176CONFIG_INITRAMFS_SOURCE="" 174CONFIG_INITRAMFS_SOURCE=""
175# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
177CONFIG_EMBEDDED=y 176CONFIG_EMBEDDED=y
178CONFIG_KALLSYMS=y 177CONFIG_KALLSYMS=y
179# CONFIG_KALLSYMS_EXTRA_PASS is not set 178# CONFIG_KALLSYMS_EXTRA_PASS is not set
179CONFIG_HOTPLUG=y
180CONFIG_PRINTK=y 180CONFIG_PRINTK=y
181CONFIG_BUG=y 181CONFIG_BUG=y
182CONFIG_ELF_CORE=y
182CONFIG_BASE_FULL=y 183CONFIG_BASE_FULL=y
183CONFIG_FUTEX=y 184CONFIG_FUTEX=y
184CONFIG_EPOLL=y 185CONFIG_EPOLL=y
185# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
186CONFIG_SHMEM=y 186CONFIG_SHMEM=y
187CONFIG_CC_ALIGN_FUNCTIONS=0 187CONFIG_CC_ALIGN_FUNCTIONS=0
188CONFIG_CC_ALIGN_LABELS=0 188CONFIG_CC_ALIGN_LABELS=0
189CONFIG_CC_ALIGN_LOOPS=0 189CONFIG_CC_ALIGN_LOOPS=0
190CONFIG_CC_ALIGN_JUMPS=0 190CONFIG_CC_ALIGN_JUMPS=0
191CONFIG_SLAB=y
191# CONFIG_TINY_SHMEM is not set 192# CONFIG_TINY_SHMEM is not set
192CONFIG_BASE_SMALL=0 193CONFIG_BASE_SMALL=0
194# CONFIG_SLOB is not set
193 195
194# 196#
195# Loadable module support 197# Loadable module support
@@ -341,6 +343,29 @@ CONFIG_BRIDGE_NETFILTER=y
341CONFIG_NETFILTER_NETLINK=m 343CONFIG_NETFILTER_NETLINK=m
342CONFIG_NETFILTER_NETLINK_QUEUE=m 344CONFIG_NETFILTER_NETLINK_QUEUE=m
343CONFIG_NETFILTER_NETLINK_LOG=m 345CONFIG_NETFILTER_NETLINK_LOG=m
346CONFIG_NETFILTER_XTABLES=m
347CONFIG_NETFILTER_XT_TARGET_CLASSIFY=m
348CONFIG_NETFILTER_XT_TARGET_CONNMARK=m
349CONFIG_NETFILTER_XT_TARGET_MARK=m
350CONFIG_NETFILTER_XT_TARGET_NFQUEUE=m
351CONFIG_NETFILTER_XT_TARGET_NOTRACK=m
352CONFIG_NETFILTER_XT_MATCH_COMMENT=m
353CONFIG_NETFILTER_XT_MATCH_CONNBYTES=m
354CONFIG_NETFILTER_XT_MATCH_CONNMARK=m
355CONFIG_NETFILTER_XT_MATCH_CONNTRACK=m
356CONFIG_NETFILTER_XT_MATCH_DCCP=m
357CONFIG_NETFILTER_XT_MATCH_HELPER=m
358CONFIG_NETFILTER_XT_MATCH_LENGTH=m
359CONFIG_NETFILTER_XT_MATCH_LIMIT=m
360CONFIG_NETFILTER_XT_MATCH_MAC=m
361CONFIG_NETFILTER_XT_MATCH_MARK=m
362# CONFIG_NETFILTER_XT_MATCH_PHYSDEV is not set
363CONFIG_NETFILTER_XT_MATCH_PKTTYPE=m
364CONFIG_NETFILTER_XT_MATCH_REALM=m
365CONFIG_NETFILTER_XT_MATCH_SCTP=m
366CONFIG_NETFILTER_XT_MATCH_STATE=m
367CONFIG_NETFILTER_XT_MATCH_STRING=m
368CONFIG_NETFILTER_XT_MATCH_TCPMSS=m
344 369
345# 370#
346# IP: Netfilter Configuration 371# IP: Netfilter Configuration
@@ -359,40 +384,23 @@ CONFIG_IP_NF_AMANDA=m
359CONFIG_IP_NF_PPTP=m 384CONFIG_IP_NF_PPTP=m
360CONFIG_IP_NF_QUEUE=m 385CONFIG_IP_NF_QUEUE=m
361CONFIG_IP_NF_IPTABLES=m 386CONFIG_IP_NF_IPTABLES=m
362CONFIG_IP_NF_MATCH_LIMIT=m
363CONFIG_IP_NF_MATCH_IPRANGE=m 387CONFIG_IP_NF_MATCH_IPRANGE=m
364CONFIG_IP_NF_MATCH_MAC=m
365CONFIG_IP_NF_MATCH_PKTTYPE=m
366CONFIG_IP_NF_MATCH_MARK=m
367CONFIG_IP_NF_MATCH_MULTIPORT=m 388CONFIG_IP_NF_MATCH_MULTIPORT=m
368CONFIG_IP_NF_MATCH_TOS=m 389CONFIG_IP_NF_MATCH_TOS=m
369CONFIG_IP_NF_MATCH_RECENT=m 390CONFIG_IP_NF_MATCH_RECENT=m
370CONFIG_IP_NF_MATCH_ECN=m 391CONFIG_IP_NF_MATCH_ECN=m
371CONFIG_IP_NF_MATCH_DSCP=m 392CONFIG_IP_NF_MATCH_DSCP=m
372CONFIG_IP_NF_MATCH_AH_ESP=m 393CONFIG_IP_NF_MATCH_AH_ESP=m
373CONFIG_IP_NF_MATCH_LENGTH=m
374CONFIG_IP_NF_MATCH_TTL=m 394CONFIG_IP_NF_MATCH_TTL=m
375CONFIG_IP_NF_MATCH_TCPMSS=m
376CONFIG_IP_NF_MATCH_HELPER=m
377CONFIG_IP_NF_MATCH_STATE=m
378CONFIG_IP_NF_MATCH_CONNTRACK=m
379CONFIG_IP_NF_MATCH_OWNER=m 395CONFIG_IP_NF_MATCH_OWNER=m
380CONFIG_IP_NF_MATCH_PHYSDEV=m
381CONFIG_IP_NF_MATCH_ADDRTYPE=m 396CONFIG_IP_NF_MATCH_ADDRTYPE=m
382CONFIG_IP_NF_MATCH_REALM=m
383CONFIG_IP_NF_MATCH_SCTP=m
384CONFIG_IP_NF_MATCH_DCCP=m
385CONFIG_IP_NF_MATCH_COMMENT=m
386CONFIG_IP_NF_MATCH_CONNMARK=m
387CONFIG_IP_NF_MATCH_CONNBYTES=m
388CONFIG_IP_NF_MATCH_HASHLIMIT=m 397CONFIG_IP_NF_MATCH_HASHLIMIT=m
389CONFIG_IP_NF_MATCH_STRING=m 398CONFIG_IP_NF_MATCH_POLICY=m
390CONFIG_IP_NF_FILTER=m 399CONFIG_IP_NF_FILTER=m
391CONFIG_IP_NF_TARGET_REJECT=m 400CONFIG_IP_NF_TARGET_REJECT=m
392CONFIG_IP_NF_TARGET_LOG=m 401CONFIG_IP_NF_TARGET_LOG=m
393CONFIG_IP_NF_TARGET_ULOG=m 402CONFIG_IP_NF_TARGET_ULOG=m
394CONFIG_IP_NF_TARGET_TCPMSS=m 403CONFIG_IP_NF_TARGET_TCPMSS=m
395CONFIG_IP_NF_TARGET_NFQUEUE=m
396CONFIG_IP_NF_NAT=m 404CONFIG_IP_NF_NAT=m
397CONFIG_IP_NF_NAT_NEEDED=y 405CONFIG_IP_NF_NAT_NEEDED=y
398CONFIG_IP_NF_TARGET_MASQUERADE=m 406CONFIG_IP_NF_TARGET_MASQUERADE=m
@@ -409,13 +417,9 @@ CONFIG_IP_NF_MANGLE=m
409CONFIG_IP_NF_TARGET_TOS=m 417CONFIG_IP_NF_TARGET_TOS=m
410CONFIG_IP_NF_TARGET_ECN=m 418CONFIG_IP_NF_TARGET_ECN=m
411CONFIG_IP_NF_TARGET_DSCP=m 419CONFIG_IP_NF_TARGET_DSCP=m
412CONFIG_IP_NF_TARGET_MARK=m
413CONFIG_IP_NF_TARGET_CLASSIFY=m
414CONFIG_IP_NF_TARGET_TTL=m 420CONFIG_IP_NF_TARGET_TTL=m
415CONFIG_IP_NF_TARGET_CONNMARK=m
416CONFIG_IP_NF_TARGET_CLUSTERIP=m 421CONFIG_IP_NF_TARGET_CLUSTERIP=m
417CONFIG_IP_NF_RAW=m 422CONFIG_IP_NF_RAW=m
418CONFIG_IP_NF_TARGET_NOTRACK=m
419CONFIG_IP_NF_ARPTABLES=m 423CONFIG_IP_NF_ARPTABLES=m
420CONFIG_IP_NF_ARPFILTER=m 424CONFIG_IP_NF_ARPFILTER=m
421CONFIG_IP_NF_ARP_MANGLE=m 425CONFIG_IP_NF_ARP_MANGLE=m
@@ -425,26 +429,20 @@ CONFIG_IP_NF_ARP_MANGLE=m
425# 429#
426CONFIG_IP6_NF_QUEUE=m 430CONFIG_IP6_NF_QUEUE=m
427CONFIG_IP6_NF_IPTABLES=m 431CONFIG_IP6_NF_IPTABLES=m
428CONFIG_IP6_NF_MATCH_LIMIT=m
429CONFIG_IP6_NF_MATCH_MAC=m
430CONFIG_IP6_NF_MATCH_RT=m 432CONFIG_IP6_NF_MATCH_RT=m
431CONFIG_IP6_NF_MATCH_OPTS=m 433CONFIG_IP6_NF_MATCH_OPTS=m
432CONFIG_IP6_NF_MATCH_FRAG=m 434CONFIG_IP6_NF_MATCH_FRAG=m
433CONFIG_IP6_NF_MATCH_HL=m 435CONFIG_IP6_NF_MATCH_HL=m
434CONFIG_IP6_NF_MATCH_MULTIPORT=m 436CONFIG_IP6_NF_MATCH_MULTIPORT=m
435CONFIG_IP6_NF_MATCH_OWNER=m 437CONFIG_IP6_NF_MATCH_OWNER=m
436CONFIG_IP6_NF_MATCH_MARK=m
437CONFIG_IP6_NF_MATCH_IPV6HEADER=m 438CONFIG_IP6_NF_MATCH_IPV6HEADER=m
438CONFIG_IP6_NF_MATCH_AHESP=m 439CONFIG_IP6_NF_MATCH_AHESP=m
439CONFIG_IP6_NF_MATCH_LENGTH=m
440CONFIG_IP6_NF_MATCH_EUI64=m 440CONFIG_IP6_NF_MATCH_EUI64=m
441CONFIG_IP6_NF_MATCH_PHYSDEV=m 441CONFIG_IP6_NF_MATCH_POLICY=m
442CONFIG_IP6_NF_FILTER=m 442CONFIG_IP6_NF_FILTER=m
443CONFIG_IP6_NF_TARGET_LOG=m 443CONFIG_IP6_NF_TARGET_LOG=m
444CONFIG_IP6_NF_TARGET_REJECT=m 444CONFIG_IP6_NF_TARGET_REJECT=m
445CONFIG_IP6_NF_TARGET_NFQUEUE=m
446CONFIG_IP6_NF_MANGLE=m 445CONFIG_IP6_NF_MANGLE=m
447CONFIG_IP6_NF_TARGET_MARK=m
448CONFIG_IP6_NF_TARGET_HL=m 446CONFIG_IP6_NF_TARGET_HL=m
449CONFIG_IP6_NF_RAW=m 447CONFIG_IP6_NF_RAW=m
450 448
@@ -500,6 +498,11 @@ CONFIG_IPDDP_ENCAP=y
500CONFIG_IPDDP_DECAP=y 498CONFIG_IPDDP_DECAP=y
501# CONFIG_X25 is not set 499# CONFIG_X25 is not set
502# CONFIG_LAPB is not set 500# CONFIG_LAPB is not set
501
502#
503# TIPC Configuration (EXPERIMENTAL)
504#
505# CONFIG_TIPC is not set
503CONFIG_NET_DIVERT=y 506CONFIG_NET_DIVERT=y
504# CONFIG_ECONET is not set 507# CONFIG_ECONET is not set
505# CONFIG_WAN_ROUTER is not set 508# CONFIG_WAN_ROUTER is not set
@@ -559,7 +562,6 @@ CONFIG_IEEE80211=m
559# CONFIG_IEEE80211_DEBUG is not set 562# CONFIG_IEEE80211_DEBUG is not set
560CONFIG_IEEE80211_CRYPT_WEP=m 563CONFIG_IEEE80211_CRYPT_WEP=m
561CONFIG_IEEE80211_CRYPT_CCMP=m 564CONFIG_IEEE80211_CRYPT_CCMP=m
562CONFIG_IEEE80211_CRYPT_TKIP=m
563 565
564# 566#
565# Device Drivers 567# Device Drivers
@@ -734,13 +736,7 @@ CONFIG_AIC7XXX_REG_PRETTY_PRINT=y
734# CONFIG_SCSI_IPR is not set 736# CONFIG_SCSI_IPR is not set
735# CONFIG_SCSI_QLOGIC_FC is not set 737# CONFIG_SCSI_QLOGIC_FC is not set
736# CONFIG_SCSI_QLOGIC_1280 is not set 738# CONFIG_SCSI_QLOGIC_1280 is not set
737CONFIG_SCSI_QLA2XXX=m 739# CONFIG_SCSI_QLA_FC is not set
738# CONFIG_SCSI_QLA21XX is not set
739# CONFIG_SCSI_QLA22XX is not set
740# CONFIG_SCSI_QLA2300 is not set
741# CONFIG_SCSI_QLA2322 is not set
742# CONFIG_SCSI_QLA6312 is not set
743# CONFIG_SCSI_QLA24XX is not set
744# CONFIG_SCSI_LPFC is not set 740# CONFIG_SCSI_LPFC is not set
745# CONFIG_SCSI_DC395x is not set 741# CONFIG_SCSI_DC395x is not set
746# CONFIG_SCSI_DC390T is not set 742# CONFIG_SCSI_DC390T is not set
@@ -823,6 +819,7 @@ CONFIG_MII=y
823# CONFIG_SUNGEM is not set 819# CONFIG_SUNGEM is not set
824# CONFIG_CASSINI is not set 820# CONFIG_CASSINI is not set
825# CONFIG_NET_VENDOR_3COM is not set 821# CONFIG_NET_VENDOR_3COM is not set
822# CONFIG_DM9000 is not set
826 823
827# 824#
828# Tulip family network device support 825# Tulip family network device support
@@ -862,6 +859,7 @@ CONFIG_PCNET32=y
862# CONFIG_R8169 is not set 859# CONFIG_R8169 is not set
863# CONFIG_SIS190 is not set 860# CONFIG_SIS190 is not set
864# CONFIG_SKGE is not set 861# CONFIG_SKGE is not set
862# CONFIG_SKY2 is not set
865# CONFIG_SK98LIN is not set 863# CONFIG_SK98LIN is not set
866# CONFIG_VIA_VELOCITY is not set 864# CONFIG_VIA_VELOCITY is not set
867# CONFIG_TIGON3 is not set 865# CONFIG_TIGON3 is not set
@@ -883,8 +881,6 @@ CONFIG_PCNET32=y
883# Wireless LAN (non-hamradio) 881# Wireless LAN (non-hamradio)
884# 882#
885# CONFIG_NET_RADIO is not set 883# CONFIG_NET_RADIO is not set
886# CONFIG_IPW_DEBUG is not set
887CONFIG_IPW2200=m
888 884
889# 885#
890# Wan interfaces 886# Wan interfaces
@@ -961,6 +957,7 @@ CONFIG_HW_CONSOLE=y
961CONFIG_SERIAL_8250=y 957CONFIG_SERIAL_8250=y
962CONFIG_SERIAL_8250_CONSOLE=y 958CONFIG_SERIAL_8250_CONSOLE=y
963CONFIG_SERIAL_8250_NR_UARTS=4 959CONFIG_SERIAL_8250_NR_UARTS=4
960CONFIG_SERIAL_8250_RUNTIME_UARTS=4
964# CONFIG_SERIAL_8250_EXTENDED is not set 961# CONFIG_SERIAL_8250_EXTENDED is not set
965 962
966# 963#
@@ -968,7 +965,6 @@ CONFIG_SERIAL_8250_NR_UARTS=4
968# 965#
969CONFIG_SERIAL_CORE=y 966CONFIG_SERIAL_CORE=y
970CONFIG_SERIAL_CORE_CONSOLE=y 967CONFIG_SERIAL_CORE_CONSOLE=y
971# CONFIG_SERIAL_JSM is not set
972CONFIG_UNIX98_PTYS=y 968CONFIG_UNIX98_PTYS=y
973CONFIG_LEGACY_PTYS=y 969CONFIG_LEGACY_PTYS=y
974CONFIG_LEGACY_PTY_COUNT=256 970CONFIG_LEGACY_PTY_COUNT=256
@@ -1005,6 +1001,12 @@ CONFIG_RTC=y
1005# CONFIG_I2C is not set 1001# CONFIG_I2C is not set
1006 1002
1007# 1003#
1004# SPI support
1005#
1006# CONFIG_SPI is not set
1007# CONFIG_SPI_MASTER is not set
1008
1009#
1008# Dallas's 1-wire bus 1010# Dallas's 1-wire bus
1009# 1011#
1010# CONFIG_W1 is not set 1012# CONFIG_W1 is not set
@@ -1110,6 +1112,7 @@ CONFIG_XFS_QUOTA=y
1110CONFIG_XFS_SECURITY=y 1112CONFIG_XFS_SECURITY=y
1111CONFIG_XFS_POSIX_ACL=y 1113CONFIG_XFS_POSIX_ACL=y
1112# CONFIG_XFS_RT is not set 1114# CONFIG_XFS_RT is not set
1115# CONFIG_OCFS2_FS is not set
1113CONFIG_MINIX_FS=m 1116CONFIG_MINIX_FS=m
1114CONFIG_ROMFS_FS=m 1117CONFIG_ROMFS_FS=m
1115CONFIG_INOTIFY=y 1118CONFIG_INOTIFY=y
@@ -1152,6 +1155,7 @@ CONFIG_SYSFS=y
1152# CONFIG_HUGETLB_PAGE is not set 1155# CONFIG_HUGETLB_PAGE is not set
1153CONFIG_RAMFS=y 1156CONFIG_RAMFS=y
1154CONFIG_RELAYFS_FS=m 1157CONFIG_RELAYFS_FS=m
1158# CONFIG_CONFIGFS_FS is not set
1155 1159
1156# 1160#
1157# Miscellaneous filesystems 1161# Miscellaneous filesystems
@@ -1259,6 +1263,7 @@ CONFIG_NLS_UTF8=m
1259# Kernel hacking 1263# Kernel hacking
1260# 1264#
1261# CONFIG_PRINTK_TIME is not set 1265# CONFIG_PRINTK_TIME is not set
1266# CONFIG_MAGIC_SYSRQ is not set
1262# CONFIG_DEBUG_KERNEL is not set 1267# CONFIG_DEBUG_KERNEL is not set
1263CONFIG_LOG_BUF_SHIFT=14 1268CONFIG_LOG_BUF_SHIFT=14
1264CONFIG_CROSSCOMPILE=y 1269CONFIG_CROSSCOMPILE=y
diff --git a/arch/mips/configs/mipssim_defconfig b/arch/mips/configs/mipssim_defconfig
index ac39ab7feeb7..fe78961762b8 100644
--- a/arch/mips/configs/mipssim_defconfig
+++ b/arch/mips/configs/mipssim_defconfig
@@ -1,7 +1,7 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.15-rc2 3# Linux kernel version: 2.6.16-rc1
4# Thu Nov 24 01:06:37 2005 4# Fri Jan 27 15:40:16 2006
5# 5#
6CONFIG_MIPS=y 6CONFIG_MIPS=y
7 7
@@ -156,27 +156,29 @@ CONFIG_SYSVIPC=y
156# CONFIG_BSD_PROCESS_ACCT is not set 156# CONFIG_BSD_PROCESS_ACCT is not set
157CONFIG_SYSCTL=y 157CONFIG_SYSCTL=y
158# CONFIG_AUDIT is not set 158# CONFIG_AUDIT is not set
159CONFIG_HOTPLUG=y
160CONFIG_KOBJECT_UEVENT=y
161# CONFIG_IKCONFIG is not set 159# CONFIG_IKCONFIG is not set
162CONFIG_INITRAMFS_SOURCE="" 160CONFIG_INITRAMFS_SOURCE=""
161# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
163CONFIG_EMBEDDED=y 162CONFIG_EMBEDDED=y
164CONFIG_KALLSYMS=y 163CONFIG_KALLSYMS=y
165# CONFIG_KALLSYMS_ALL is not set 164# CONFIG_KALLSYMS_ALL is not set
166# CONFIG_KALLSYMS_EXTRA_PASS is not set 165# CONFIG_KALLSYMS_EXTRA_PASS is not set
166CONFIG_HOTPLUG=y
167CONFIG_PRINTK=y 167CONFIG_PRINTK=y
168CONFIG_BUG=y 168CONFIG_BUG=y
169CONFIG_ELF_CORE=y
169CONFIG_BASE_FULL=y 170CONFIG_BASE_FULL=y
170CONFIG_FUTEX=y 171CONFIG_FUTEX=y
171CONFIG_EPOLL=y 172CONFIG_EPOLL=y
172# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
173CONFIG_SHMEM=y 173CONFIG_SHMEM=y
174CONFIG_CC_ALIGN_FUNCTIONS=0 174CONFIG_CC_ALIGN_FUNCTIONS=0
175CONFIG_CC_ALIGN_LABELS=0 175CONFIG_CC_ALIGN_LABELS=0
176CONFIG_CC_ALIGN_LOOPS=0 176CONFIG_CC_ALIGN_LOOPS=0
177CONFIG_CC_ALIGN_JUMPS=0 177CONFIG_CC_ALIGN_JUMPS=0
178CONFIG_SLAB=y
178# CONFIG_TINY_SHMEM is not set 179# CONFIG_TINY_SHMEM is not set
179CONFIG_BASE_SMALL=0 180CONFIG_BASE_SMALL=0
181# CONFIG_SLOB is not set
180 182
181# 183#
182# Loadable module support 184# Loadable module support
@@ -297,6 +299,11 @@ CONFIG_SCTP_HMAC_MD5=y
297# CONFIG_ATALK is not set 299# CONFIG_ATALK is not set
298# CONFIG_X25 is not set 300# CONFIG_X25 is not set
299# CONFIG_LAPB is not set 301# CONFIG_LAPB is not set
302
303#
304# TIPC Configuration (EXPERIMENTAL)
305#
306# CONFIG_TIPC is not set
300CONFIG_NET_DIVERT=y 307CONFIG_NET_DIVERT=y
301# CONFIG_ECONET is not set 308# CONFIG_ECONET is not set
302# CONFIG_WAN_ROUTER is not set 309# CONFIG_WAN_ROUTER is not set
@@ -525,6 +532,7 @@ CONFIG_SERIO_SERPORT=y
525CONFIG_SERIAL_8250=y 532CONFIG_SERIAL_8250=y
526CONFIG_SERIAL_8250_CONSOLE=y 533CONFIG_SERIAL_8250_CONSOLE=y
527CONFIG_SERIAL_8250_NR_UARTS=1 534CONFIG_SERIAL_8250_NR_UARTS=1
535CONFIG_SERIAL_8250_RUNTIME_UARTS=4
528# CONFIG_SERIAL_8250_EXTENDED is not set 536# CONFIG_SERIAL_8250_EXTENDED is not set
529 537
530# 538#
@@ -567,6 +575,12 @@ CONFIG_LEGACY_PTY_COUNT=256
567# CONFIG_I2C is not set 575# CONFIG_I2C is not set
568 576
569# 577#
578# SPI support
579#
580# CONFIG_SPI is not set
581# CONFIG_SPI_MASTER is not set
582
583#
570# Dallas's 1-wire bus 584# Dallas's 1-wire bus
571# 585#
572# CONFIG_W1 is not set 586# CONFIG_W1 is not set
@@ -640,11 +654,11 @@ CONFIG_EXT2_FS=y
640# CONFIG_EXT2_FS_XATTR is not set 654# CONFIG_EXT2_FS_XATTR is not set
641# CONFIG_EXT2_FS_XIP is not set 655# CONFIG_EXT2_FS_XIP is not set
642# CONFIG_EXT3_FS is not set 656# CONFIG_EXT3_FS is not set
643# CONFIG_JBD is not set
644# CONFIG_REISERFS_FS is not set 657# CONFIG_REISERFS_FS is not set
645# CONFIG_JFS_FS is not set 658# CONFIG_JFS_FS is not set
646# CONFIG_FS_POSIX_ACL is not set 659# CONFIG_FS_POSIX_ACL is not set
647# CONFIG_XFS_FS is not set 660# CONFIG_XFS_FS is not set
661# CONFIG_OCFS2_FS is not set
648# CONFIG_MINIX_FS is not set 662# CONFIG_MINIX_FS is not set
649CONFIG_ROMFS_FS=y 663CONFIG_ROMFS_FS=y
650# CONFIG_INOTIFY is not set 664# CONFIG_INOTIFY is not set
@@ -677,6 +691,7 @@ CONFIG_PROC_FS=y
677# CONFIG_HUGETLB_PAGE is not set 691# CONFIG_HUGETLB_PAGE is not set
678CONFIG_RAMFS=y 692CONFIG_RAMFS=y
679# CONFIG_RELAYFS_FS is not set 693# CONFIG_RELAYFS_FS is not set
694# CONFIG_CONFIGFS_FS is not set
680 695
681# 696#
682# Miscellaneous filesystems 697# Miscellaneous filesystems
@@ -738,17 +753,19 @@ CONFIG_MSDOS_PARTITION=y
738# Kernel hacking 753# Kernel hacking
739# 754#
740# CONFIG_PRINTK_TIME is not set 755# CONFIG_PRINTK_TIME is not set
741CONFIG_DEBUG_KERNEL=y
742# CONFIG_MAGIC_SYSRQ is not set 756# CONFIG_MAGIC_SYSRQ is not set
757CONFIG_DEBUG_KERNEL=y
743CONFIG_LOG_BUF_SHIFT=14 758CONFIG_LOG_BUF_SHIFT=14
744# CONFIG_DETECT_SOFTLOCKUP is not set 759# CONFIG_DETECT_SOFTLOCKUP is not set
745# CONFIG_SCHEDSTATS is not set 760# CONFIG_SCHEDSTATS is not set
746# CONFIG_DEBUG_SLAB is not set 761# CONFIG_DEBUG_SLAB is not set
762CONFIG_DEBUG_MUTEXES=y
747# CONFIG_DEBUG_SPINLOCK is not set 763# CONFIG_DEBUG_SPINLOCK is not set
748# CONFIG_DEBUG_SPINLOCK_SLEEP is not set 764# CONFIG_DEBUG_SPINLOCK_SLEEP is not set
749# CONFIG_DEBUG_KOBJECT is not set 765# CONFIG_DEBUG_KOBJECT is not set
750CONFIG_DEBUG_INFO=y 766CONFIG_DEBUG_INFO=y
751# CONFIG_DEBUG_VM is not set 767# CONFIG_DEBUG_VM is not set
768CONFIG_FORCED_INLINING=y
752# CONFIG_RCU_TORTURE_TEST is not set 769# CONFIG_RCU_TORTURE_TEST is not set
753CONFIG_CROSSCOMPILE=y 770CONFIG_CROSSCOMPILE=y
754CONFIG_CMDLINE="nfsroot=192.168.192.169:/u1/mipsel,timeo=20 ip=dhcp" 771CONFIG_CMDLINE="nfsroot=192.168.192.169:/u1/mipsel,timeo=20 ip=dhcp"
diff --git a/arch/mips/configs/mpc30x_defconfig b/arch/mips/configs/mpc30x_defconfig
index 2b5ea37484e4..e4620e7f0a5e 100644
--- a/arch/mips/configs/mpc30x_defconfig
+++ b/arch/mips/configs/mpc30x_defconfig
@@ -1,7 +1,7 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.15-rc2 3# Linux kernel version: 2.6.16-rc1
4# Thu Nov 24 01:06:39 2005 4# Fri Jan 27 15:40:17 2006
5# 5#
6CONFIG_MIPS=y 6CONFIG_MIPS=y
7 7
@@ -63,9 +63,9 @@ CONFIG_MACH_VR41XX=y
63# CONFIG_TOSHIBA_JMR3927 is not set 63# CONFIG_TOSHIBA_JMR3927 is not set
64# CONFIG_TOSHIBA_RBTX4927 is not set 64# CONFIG_TOSHIBA_RBTX4927 is not set
65# CONFIG_TOSHIBA_RBTX4938 is not set 65# CONFIG_TOSHIBA_RBTX4938 is not set
66# CONFIG_NEC_CMBVR4133 is not set
67# CONFIG_CASIO_E55 is not set 66# CONFIG_CASIO_E55 is not set
68# CONFIG_IBM_WORKPAD is not set 67# CONFIG_IBM_WORKPAD is not set
68# CONFIG_NEC_CMBVR4133 is not set
69# CONFIG_TANBAC_TB022X is not set 69# CONFIG_TANBAC_TB022X is not set
70CONFIG_VICTOR_MPC30X=y 70CONFIG_VICTOR_MPC30X=y
71# CONFIG_ZAO_CAPCELLA is not set 71# CONFIG_ZAO_CAPCELLA is not set
@@ -90,7 +90,7 @@ CONFIG_MIPS_L1_CACHE_SHIFT=5
90# CONFIG_CPU_MIPS64_R2 is not set 90# CONFIG_CPU_MIPS64_R2 is not set
91# CONFIG_CPU_R3000 is not set 91# CONFIG_CPU_R3000 is not set
92# CONFIG_CPU_TX39XX is not set 92# CONFIG_CPU_TX39XX is not set
93CONFIG_CPU_VR41XX=y 93# CONFIG_CPU_VR41XX is not set
94# CONFIG_CPU_R4300 is not set 94# CONFIG_CPU_R4300 is not set
95# CONFIG_CPU_R4X00 is not set 95# CONFIG_CPU_R4X00 is not set
96# CONFIG_CPU_TX49XX is not set 96# CONFIG_CPU_TX49XX is not set
@@ -103,23 +103,18 @@ CONFIG_CPU_VR41XX=y
103# CONFIG_CPU_RM7000 is not set 103# CONFIG_CPU_RM7000 is not set
104# CONFIG_CPU_RM9000 is not set 104# CONFIG_CPU_RM9000 is not set
105# CONFIG_CPU_SB1 is not set 105# CONFIG_CPU_SB1 is not set
106CONFIG_SYS_HAS_CPU_VR41XX=y
107CONFIG_SYS_SUPPORTS_32BIT_KERNEL=y
108CONFIG_SYS_SUPPORTS_64BIT_KERNEL=y
109CONFIG_CPU_SUPPORTS_32BIT_KERNEL=y
110CONFIG_CPU_SUPPORTS_64BIT_KERNEL=y
111 106
112# 107#
113# Kernel type 108# Kernel type
114# 109#
115CONFIG_32BIT=y 110# CONFIG_32BIT is not set
116# CONFIG_64BIT is not set 111# CONFIG_64BIT is not set
117CONFIG_PAGE_SIZE_4KB=y 112CONFIG_PAGE_SIZE_4KB=y
118# CONFIG_PAGE_SIZE_8KB is not set 113# CONFIG_PAGE_SIZE_8KB is not set
119# CONFIG_PAGE_SIZE_16KB is not set 114# CONFIG_PAGE_SIZE_16KB is not set
120# CONFIG_PAGE_SIZE_64KB is not set 115# CONFIG_PAGE_SIZE_64KB is not set
121# CONFIG_MIPS_MT is not set 116# CONFIG_MIPS_MT is not set
122# CONFIG_CPU_ADVANCED is not set 117CONFIG_CPU_HAS_LLSC=y
123CONFIG_CPU_HAS_SYNC=y 118CONFIG_CPU_HAS_SYNC=y
124CONFIG_GENERIC_HARDIRQS=y 119CONFIG_GENERIC_HARDIRQS=y
125CONFIG_GENERIC_IRQ_PROBE=y 120CONFIG_GENERIC_IRQ_PROBE=y
@@ -155,26 +150,28 @@ CONFIG_SYSVIPC=y
155# CONFIG_BSD_PROCESS_ACCT is not set 150# CONFIG_BSD_PROCESS_ACCT is not set
156CONFIG_SYSCTL=y 151CONFIG_SYSCTL=y
157# CONFIG_AUDIT is not set 152# CONFIG_AUDIT is not set
158CONFIG_HOTPLUG=y
159CONFIG_KOBJECT_UEVENT=y
160# CONFIG_IKCONFIG is not set 153# CONFIG_IKCONFIG is not set
161CONFIG_INITRAMFS_SOURCE="" 154CONFIG_INITRAMFS_SOURCE=""
155# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
162CONFIG_EMBEDDED=y 156CONFIG_EMBEDDED=y
163CONFIG_KALLSYMS=y 157CONFIG_KALLSYMS=y
164# CONFIG_KALLSYMS_EXTRA_PASS is not set 158# CONFIG_KALLSYMS_EXTRA_PASS is not set
159CONFIG_HOTPLUG=y
165CONFIG_PRINTK=y 160CONFIG_PRINTK=y
166CONFIG_BUG=y 161CONFIG_BUG=y
162CONFIG_ELF_CORE=y
167CONFIG_BASE_FULL=y 163CONFIG_BASE_FULL=y
168CONFIG_FUTEX=y 164CONFIG_FUTEX=y
169CONFIG_EPOLL=y 165CONFIG_EPOLL=y
170# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
171CONFIG_SHMEM=y 166CONFIG_SHMEM=y
172CONFIG_CC_ALIGN_FUNCTIONS=0 167CONFIG_CC_ALIGN_FUNCTIONS=0
173CONFIG_CC_ALIGN_LABELS=0 168CONFIG_CC_ALIGN_LABELS=0
174CONFIG_CC_ALIGN_LOOPS=0 169CONFIG_CC_ALIGN_LOOPS=0
175CONFIG_CC_ALIGN_JUMPS=0 170CONFIG_CC_ALIGN_JUMPS=0
171CONFIG_SLAB=y
176# CONFIG_TINY_SHMEM is not set 172# CONFIG_TINY_SHMEM is not set
177CONFIG_BASE_SMALL=0 173CONFIG_BASE_SMALL=0
174# CONFIG_SLOB is not set
178 175
179# 176#
180# Loadable module support 177# Loadable module support
@@ -190,7 +187,6 @@ CONFIG_KMOD=y
190# 187#
191# Block layer 188# Block layer
192# 189#
193# CONFIG_LBD is not set
194 190
195# 191#
196# IO Schedulers 192# IO Schedulers
@@ -229,7 +225,6 @@ CONFIG_PCMCIA_IOCTL=y
229# CONFIG_YENTA is not set 225# CONFIG_YENTA is not set
230# CONFIG_PD6729 is not set 226# CONFIG_PD6729 is not set
231# CONFIG_I82092 is not set 227# CONFIG_I82092 is not set
232CONFIG_PCMCIA_VRC4173=y
233 228
234# 229#
235# PCI Hotplug Support 230# PCI Hotplug Support
@@ -241,7 +236,6 @@ CONFIG_PCMCIA_VRC4173=y
241# 236#
242CONFIG_BINFMT_ELF=y 237CONFIG_BINFMT_ELF=y
243# CONFIG_BINFMT_MISC is not set 238# CONFIG_BINFMT_MISC is not set
244CONFIG_TRAD_SIGNALS=y
245 239
246# 240#
247# Networking 241# Networking
@@ -296,6 +290,11 @@ CONFIG_TCP_CONG_BIC=y
296# CONFIG_ATALK is not set 290# CONFIG_ATALK is not set
297# CONFIG_X25 is not set 291# CONFIG_X25 is not set
298# CONFIG_LAPB is not set 292# CONFIG_LAPB is not set
293
294#
295# TIPC Configuration (EXPERIMENTAL)
296#
297# CONFIG_TIPC is not set
299# CONFIG_NET_DIVERT is not set 298# CONFIG_NET_DIVERT is not set
300# CONFIG_ECONET is not set 299# CONFIG_ECONET is not set
301# CONFIG_WAN_ROUTER is not set 300# CONFIG_WAN_ROUTER is not set
@@ -455,6 +454,7 @@ CONFIG_MII=m
455# CONFIG_R8169 is not set 454# CONFIG_R8169 is not set
456# CONFIG_SIS190 is not set 455# CONFIG_SIS190 is not set
457# CONFIG_SKGE is not set 456# CONFIG_SKGE is not set
457# CONFIG_SKY2 is not set
458# CONFIG_SK98LIN is not set 458# CONFIG_SK98LIN is not set
459# CONFIG_TIGON3 is not set 459# CONFIG_TIGON3 is not set
460# CONFIG_BNX2 is not set 460# CONFIG_BNX2 is not set
@@ -604,11 +604,6 @@ CONFIG_HW_CONSOLE=y
604# 604#
605# Non-8250 serial port support 605# Non-8250 serial port support
606# 606#
607CONFIG_SERIAL_CORE=y
608CONFIG_SERIAL_CORE_CONSOLE=y
609CONFIG_SERIAL_VR41XX=y
610CONFIG_SERIAL_VR41XX_CONSOLE=y
611# CONFIG_SERIAL_JSM is not set
612CONFIG_UNIX98_PTYS=y 607CONFIG_UNIX98_PTYS=y
613CONFIG_LEGACY_PTYS=y 608CONFIG_LEGACY_PTYS=y
614CONFIG_LEGACY_PTY_COUNT=256 609CONFIG_LEGACY_PTY_COUNT=256
@@ -624,7 +619,6 @@ CONFIG_LEGACY_PTY_COUNT=256
624# CONFIG_WATCHDOG is not set 619# CONFIG_WATCHDOG is not set
625# CONFIG_RTC is not set 620# CONFIG_RTC is not set
626# CONFIG_GEN_RTC is not set 621# CONFIG_GEN_RTC is not set
627# CONFIG_RTC_VR41XX is not set
628# CONFIG_DTLK is not set 622# CONFIG_DTLK is not set
629# CONFIG_R3964 is not set 623# CONFIG_R3964 is not set
630# CONFIG_APPLICOM is not set 624# CONFIG_APPLICOM is not set
@@ -640,7 +634,6 @@ CONFIG_LEGACY_PTY_COUNT=256
640# CONFIG_SYNCLINK_CS is not set 634# CONFIG_SYNCLINK_CS is not set
641# CONFIG_CARDMAN_4000 is not set 635# CONFIG_CARDMAN_4000 is not set
642# CONFIG_CARDMAN_4040 is not set 636# CONFIG_CARDMAN_4040 is not set
643CONFIG_GPIO_VR41XX=y
644# CONFIG_RAW_DRIVER is not set 637# CONFIG_RAW_DRIVER is not set
645 638
646# 639#
@@ -655,6 +648,12 @@ CONFIG_GPIO_VR41XX=y
655# CONFIG_I2C is not set 648# CONFIG_I2C is not set
656 649
657# 650#
651# SPI support
652#
653# CONFIG_SPI is not set
654# CONFIG_SPI_MASTER is not set
655
656#
658# Dallas's 1-wire bus 657# Dallas's 1-wire bus
659# 658#
660# CONFIG_W1 is not set 659# CONFIG_W1 is not set
@@ -740,6 +739,7 @@ CONFIG_USB_OHCI_LITTLE_ENDIAN=y
740# may also be needed; see USB_STORAGE Help for more information 739# may also be needed; see USB_STORAGE Help for more information
741# 740#
742# CONFIG_USB_STORAGE is not set 741# CONFIG_USB_STORAGE is not set
742# CONFIG_USB_LIBUSUAL is not set
743 743
744# 744#
745# USB Input Devices 745# USB Input Devices
@@ -762,6 +762,7 @@ CONFIG_USB_OHCI_LITTLE_ENDIAN=y
762# CONFIG_USB_YEALINK is not set 762# CONFIG_USB_YEALINK is not set
763# CONFIG_USB_XPAD is not set 763# CONFIG_USB_XPAD is not set
764# CONFIG_USB_ATI_REMOTE is not set 764# CONFIG_USB_ATI_REMOTE is not set
765# CONFIG_USB_ATI_REMOTE2 is not set
765# CONFIG_USB_KEYSPAN_REMOTE is not set 766# CONFIG_USB_KEYSPAN_REMOTE is not set
766# CONFIG_USB_APPLETOUCH is not set 767# CONFIG_USB_APPLETOUCH is not set
767 768
@@ -846,11 +847,11 @@ CONFIG_EXT2_FS=y
846# CONFIG_EXT2_FS_XATTR is not set 847# CONFIG_EXT2_FS_XATTR is not set
847# CONFIG_EXT2_FS_XIP is not set 848# CONFIG_EXT2_FS_XIP is not set
848# CONFIG_EXT3_FS is not set 849# CONFIG_EXT3_FS is not set
849# CONFIG_JBD is not set
850# CONFIG_REISERFS_FS is not set 850# CONFIG_REISERFS_FS is not set
851# CONFIG_JFS_FS is not set 851# CONFIG_JFS_FS is not set
852# CONFIG_FS_POSIX_ACL is not set 852# CONFIG_FS_POSIX_ACL is not set
853# CONFIG_XFS_FS is not set 853# CONFIG_XFS_FS is not set
854# CONFIG_OCFS2_FS is not set
854# CONFIG_MINIX_FS is not set 855# CONFIG_MINIX_FS is not set
855# CONFIG_ROMFS_FS is not set 856# CONFIG_ROMFS_FS is not set
856CONFIG_INOTIFY=y 857CONFIG_INOTIFY=y
@@ -883,6 +884,7 @@ CONFIG_SYSFS=y
883# CONFIG_HUGETLB_PAGE is not set 884# CONFIG_HUGETLB_PAGE is not set
884CONFIG_RAMFS=y 885CONFIG_RAMFS=y
885CONFIG_RELAYFS_FS=m 886CONFIG_RELAYFS_FS=m
887# CONFIG_CONFIGFS_FS is not set
886 888
887# 889#
888# Miscellaneous filesystems 890# Miscellaneous filesystems
@@ -941,6 +943,7 @@ CONFIG_MSDOS_PARTITION=y
941# Kernel hacking 943# Kernel hacking
942# 944#
943# CONFIG_PRINTK_TIME is not set 945# CONFIG_PRINTK_TIME is not set
946# CONFIG_MAGIC_SYSRQ is not set
944# CONFIG_DEBUG_KERNEL is not set 947# CONFIG_DEBUG_KERNEL is not set
945CONFIG_LOG_BUF_SHIFT=14 948CONFIG_LOG_BUF_SHIFT=14
946CONFIG_CROSSCOMPILE=y 949CONFIG_CROSSCOMPILE=y
diff --git a/arch/mips/configs/ocelot_3_defconfig b/arch/mips/configs/ocelot_3_defconfig
index 7ad8718c1b69..925d8adef88d 100644
--- a/arch/mips/configs/ocelot_3_defconfig
+++ b/arch/mips/configs/ocelot_3_defconfig
@@ -1,7 +1,7 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.15-rc2 3# Linux kernel version: 2.6.16-rc1
4# Thu Nov 24 01:06:41 2005 4# Fri Jan 27 15:40:18 2006
5# 5#
6CONFIG_MIPS=y 6CONFIG_MIPS=y
7 7
@@ -159,27 +159,29 @@ CONFIG_SYSVIPC=y
159# CONFIG_BSD_PROCESS_ACCT is not set 159# CONFIG_BSD_PROCESS_ACCT is not set
160CONFIG_SYSCTL=y 160CONFIG_SYSCTL=y
161# CONFIG_AUDIT is not set 161# CONFIG_AUDIT is not set
162CONFIG_HOTPLUG=y
163CONFIG_KOBJECT_UEVENT=y
164CONFIG_IKCONFIG=y 162CONFIG_IKCONFIG=y
165CONFIG_IKCONFIG_PROC=y 163CONFIG_IKCONFIG_PROC=y
166CONFIG_INITRAMFS_SOURCE="" 164CONFIG_INITRAMFS_SOURCE=""
165# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
167CONFIG_EMBEDDED=y 166CONFIG_EMBEDDED=y
168CONFIG_KALLSYMS=y 167CONFIG_KALLSYMS=y
169# CONFIG_KALLSYMS_EXTRA_PASS is not set 168# CONFIG_KALLSYMS_EXTRA_PASS is not set
169CONFIG_HOTPLUG=y
170CONFIG_PRINTK=y 170CONFIG_PRINTK=y
171CONFIG_BUG=y 171CONFIG_BUG=y
172CONFIG_ELF_CORE=y
172CONFIG_BASE_FULL=y 173CONFIG_BASE_FULL=y
173CONFIG_FUTEX=y 174CONFIG_FUTEX=y
174CONFIG_EPOLL=y 175CONFIG_EPOLL=y
175# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
176CONFIG_SHMEM=y 176CONFIG_SHMEM=y
177CONFIG_CC_ALIGN_FUNCTIONS=0 177CONFIG_CC_ALIGN_FUNCTIONS=0
178CONFIG_CC_ALIGN_LABELS=0 178CONFIG_CC_ALIGN_LABELS=0
179CONFIG_CC_ALIGN_LOOPS=0 179CONFIG_CC_ALIGN_LOOPS=0
180CONFIG_CC_ALIGN_JUMPS=0 180CONFIG_CC_ALIGN_JUMPS=0
181CONFIG_SLAB=y
181# CONFIG_TINY_SHMEM is not set 182# CONFIG_TINY_SHMEM is not set
182CONFIG_BASE_SMALL=0 183CONFIG_BASE_SMALL=0
184# CONFIG_SLOB is not set
183 185
184# 186#
185# Loadable module support 187# Loadable module support
@@ -291,6 +293,21 @@ CONFIG_NETFILTER_NETLINK=m
291CONFIG_NETFILTER_NETLINK_QUEUE=m 293CONFIG_NETFILTER_NETLINK_QUEUE=m
292CONFIG_NETFILTER_NETLINK_LOG=m 294CONFIG_NETFILTER_NETLINK_LOG=m
293# CONFIG_NF_CONNTRACK is not set 295# CONFIG_NF_CONNTRACK is not set
296CONFIG_NETFILTER_XTABLES=m
297CONFIG_NETFILTER_XT_TARGET_CLASSIFY=m
298CONFIG_NETFILTER_XT_TARGET_MARK=m
299CONFIG_NETFILTER_XT_TARGET_NFQUEUE=m
300CONFIG_NETFILTER_XT_MATCH_COMMENT=m
301CONFIG_NETFILTER_XT_MATCH_DCCP=m
302CONFIG_NETFILTER_XT_MATCH_LENGTH=m
303CONFIG_NETFILTER_XT_MATCH_LIMIT=m
304CONFIG_NETFILTER_XT_MATCH_MAC=m
305CONFIG_NETFILTER_XT_MATCH_MARK=m
306CONFIG_NETFILTER_XT_MATCH_PKTTYPE=m
307CONFIG_NETFILTER_XT_MATCH_REALM=m
308CONFIG_NETFILTER_XT_MATCH_SCTP=m
309CONFIG_NETFILTER_XT_MATCH_STRING=m
310CONFIG_NETFILTER_XT_MATCH_TCPMSS=m
294 311
295# 312#
296# IP: Netfilter Configuration 313# IP: Netfilter Configuration
@@ -324,6 +341,11 @@ CONFIG_NETFILTER_NETLINK_LOG=m
324# CONFIG_ATALK is not set 341# CONFIG_ATALK is not set
325# CONFIG_X25 is not set 342# CONFIG_X25 is not set
326# CONFIG_LAPB is not set 343# CONFIG_LAPB is not set
344
345#
346# TIPC Configuration (EXPERIMENTAL)
347#
348# CONFIG_TIPC is not set
327# CONFIG_NET_DIVERT is not set 349# CONFIG_NET_DIVERT is not set
328# CONFIG_ECONET is not set 350# CONFIG_ECONET is not set
329# CONFIG_WAN_ROUTER is not set 351# CONFIG_WAN_ROUTER is not set
@@ -332,6 +354,7 @@ CONFIG_NETFILTER_NETLINK_LOG=m
332# QoS and/or fair queueing 354# QoS and/or fair queueing
333# 355#
334# CONFIG_NET_SCHED is not set 356# CONFIG_NET_SCHED is not set
357CONFIG_NET_CLS_ROUTE=y
335 358
336# 359#
337# Network testing 360# Network testing
@@ -344,7 +367,6 @@ CONFIG_IEEE80211=m
344# CONFIG_IEEE80211_DEBUG is not set 367# CONFIG_IEEE80211_DEBUG is not set
345CONFIG_IEEE80211_CRYPT_WEP=m 368CONFIG_IEEE80211_CRYPT_WEP=m
346CONFIG_IEEE80211_CRYPT_CCMP=m 369CONFIG_IEEE80211_CRYPT_CCMP=m
347CONFIG_IEEE80211_CRYPT_TKIP=m
348 370
349# 371#
350# Device Drivers 372# Device Drivers
@@ -426,7 +448,7 @@ CONFIG_SCSI_PROC_FS=y
426# SCSI Transport Attributes 448# SCSI Transport Attributes
427# 449#
428# CONFIG_SCSI_SPI_ATTRS is not set 450# CONFIG_SCSI_SPI_ATTRS is not set
429# CONFIG_SCSI_FC_ATTRS is not set 451CONFIG_SCSI_FC_ATTRS=m
430CONFIG_SCSI_ISCSI_ATTRS=m 452CONFIG_SCSI_ISCSI_ATTRS=m
431CONFIG_SCSI_SAS_ATTRS=m 453CONFIG_SCSI_SAS_ATTRS=m
432 454
@@ -455,13 +477,7 @@ CONFIG_ISCSI_TCP=m
455# CONFIG_SCSI_IPR is not set 477# CONFIG_SCSI_IPR is not set
456# CONFIG_SCSI_QLOGIC_FC is not set 478# CONFIG_SCSI_QLOGIC_FC is not set
457# CONFIG_SCSI_QLOGIC_1280 is not set 479# CONFIG_SCSI_QLOGIC_1280 is not set
458CONFIG_SCSI_QLA2XXX=m 480# CONFIG_SCSI_QLA_FC is not set
459# CONFIG_SCSI_QLA21XX is not set
460# CONFIG_SCSI_QLA22XX is not set
461# CONFIG_SCSI_QLA2300 is not set
462# CONFIG_SCSI_QLA2322 is not set
463# CONFIG_SCSI_QLA6312 is not set
464# CONFIG_SCSI_QLA24XX is not set
465# CONFIG_SCSI_LPFC is not set 481# CONFIG_SCSI_LPFC is not set
466# CONFIG_SCSI_DC395x is not set 482# CONFIG_SCSI_DC395x is not set
467# CONFIG_SCSI_DC390T is not set 483# CONFIG_SCSI_DC390T is not set
@@ -528,6 +544,7 @@ CONFIG_MII=y
528# CONFIG_SUNGEM is not set 544# CONFIG_SUNGEM is not set
529# CONFIG_CASSINI is not set 545# CONFIG_CASSINI is not set
530# CONFIG_NET_VENDOR_3COM is not set 546# CONFIG_NET_VENDOR_3COM is not set
547# CONFIG_DM9000 is not set
531 548
532# 549#
533# Tulip family network device support 550# Tulip family network device support
@@ -567,6 +584,7 @@ CONFIG_E100=y
567# CONFIG_R8169 is not set 584# CONFIG_R8169 is not set
568# CONFIG_SIS190 is not set 585# CONFIG_SIS190 is not set
569# CONFIG_SKGE is not set 586# CONFIG_SKGE is not set
587# CONFIG_SKY2 is not set
570# CONFIG_SK98LIN is not set 588# CONFIG_SK98LIN is not set
571# CONFIG_VIA_VELOCITY is not set 589# CONFIG_VIA_VELOCITY is not set
572# CONFIG_TIGON3 is not set 590# CONFIG_TIGON3 is not set
@@ -592,8 +610,6 @@ CONFIG_MV643XX_ETH_2=y
592# Wireless LAN (non-hamradio) 610# Wireless LAN (non-hamradio)
593# 611#
594# CONFIG_NET_RADIO is not set 612# CONFIG_NET_RADIO is not set
595# CONFIG_IPW_DEBUG is not set
596CONFIG_IPW2200=m
597 613
598# 614#
599# Wan interfaces 615# Wan interfaces
@@ -675,6 +691,7 @@ CONFIG_HW_CONSOLE=y
675CONFIG_SERIAL_8250=y 691CONFIG_SERIAL_8250=y
676CONFIG_SERIAL_8250_CONSOLE=y 692CONFIG_SERIAL_8250_CONSOLE=y
677CONFIG_SERIAL_8250_NR_UARTS=4 693CONFIG_SERIAL_8250_NR_UARTS=4
694CONFIG_SERIAL_8250_RUNTIME_UARTS=4
678# CONFIG_SERIAL_8250_EXTENDED is not set 695# CONFIG_SERIAL_8250_EXTENDED is not set
679 696
680# 697#
@@ -682,7 +699,6 @@ CONFIG_SERIAL_8250_NR_UARTS=4
682# 699#
683CONFIG_SERIAL_CORE=y 700CONFIG_SERIAL_CORE=y
684CONFIG_SERIAL_CORE_CONSOLE=y 701CONFIG_SERIAL_CORE_CONSOLE=y
685# CONFIG_SERIAL_JSM is not set
686CONFIG_UNIX98_PTYS=y 702CONFIG_UNIX98_PTYS=y
687CONFIG_LEGACY_PTYS=y 703CONFIG_LEGACY_PTYS=y
688CONFIG_LEGACY_PTY_COUNT=256 704CONFIG_LEGACY_PTY_COUNT=256
@@ -719,6 +735,12 @@ CONFIG_RTC=y
719# CONFIG_I2C is not set 735# CONFIG_I2C is not set
720 736
721# 737#
738# SPI support
739#
740# CONFIG_SPI is not set
741# CONFIG_SPI_MASTER is not set
742
743#
722# Dallas's 1-wire bus 744# Dallas's 1-wire bus
723# 745#
724# CONFIG_W1 is not set 746# CONFIG_W1 is not set
@@ -777,7 +799,6 @@ CONFIG_FB_MODE_HELPERS=y
777# CONFIG_FB_3DFX is not set 799# CONFIG_FB_3DFX is not set
778# CONFIG_FB_VOODOO1 is not set 800# CONFIG_FB_VOODOO1 is not set
779# CONFIG_FB_SMIVGX is not set 801# CONFIG_FB_SMIVGX is not set
780# CONFIG_FB_CYBLA is not set
781# CONFIG_FB_TRIDENT is not set 802# CONFIG_FB_TRIDENT is not set
782# CONFIG_FB_VIRTUAL is not set 803# CONFIG_FB_VIRTUAL is not set
783 804
@@ -861,6 +882,7 @@ CONFIG_XFS_EXPORT=y
861# CONFIG_XFS_SECURITY is not set 882# CONFIG_XFS_SECURITY is not set
862# CONFIG_XFS_POSIX_ACL is not set 883# CONFIG_XFS_POSIX_ACL is not set
863# CONFIG_XFS_RT is not set 884# CONFIG_XFS_RT is not set
885# CONFIG_OCFS2_FS is not set
864# CONFIG_MINIX_FS is not set 886# CONFIG_MINIX_FS is not set
865# CONFIG_ROMFS_FS is not set 887# CONFIG_ROMFS_FS is not set
866CONFIG_INOTIFY=y 888CONFIG_INOTIFY=y
@@ -893,6 +915,7 @@ CONFIG_TMPFS=y
893# CONFIG_HUGETLB_PAGE is not set 915# CONFIG_HUGETLB_PAGE is not set
894CONFIG_RAMFS=y 916CONFIG_RAMFS=y
895CONFIG_RELAYFS_FS=m 917CONFIG_RELAYFS_FS=m
918# CONFIG_CONFIGFS_FS is not set
896 919
897# 920#
898# Miscellaneous filesystems 921# Miscellaneous filesystems
@@ -999,6 +1022,7 @@ CONFIG_NLS_DEFAULT="iso8859-1"
999# Kernel hacking 1022# Kernel hacking
1000# 1023#
1001# CONFIG_PRINTK_TIME is not set 1024# CONFIG_PRINTK_TIME is not set
1025# CONFIG_MAGIC_SYSRQ is not set
1002# CONFIG_DEBUG_KERNEL is not set 1026# CONFIG_DEBUG_KERNEL is not set
1003CONFIG_LOG_BUF_SHIFT=14 1027CONFIG_LOG_BUF_SHIFT=14
1004CONFIG_CROSSCOMPILE=y 1028CONFIG_CROSSCOMPILE=y
@@ -1052,3 +1076,7 @@ CONFIG_CRC32=y
1052CONFIG_LIBCRC32C=m 1076CONFIG_LIBCRC32C=m
1053CONFIG_ZLIB_INFLATE=y 1077CONFIG_ZLIB_INFLATE=y
1054CONFIG_ZLIB_DEFLATE=m 1078CONFIG_ZLIB_DEFLATE=m
1079CONFIG_TEXTSEARCH=y
1080CONFIG_TEXTSEARCH_KMP=m
1081CONFIG_TEXTSEARCH_BM=m
1082CONFIG_TEXTSEARCH_FSM=m
diff --git a/arch/mips/configs/ocelot_c_defconfig b/arch/mips/configs/ocelot_c_defconfig
index e8d6bb3551a2..ee1cf9b9eb9a 100644
--- a/arch/mips/configs/ocelot_c_defconfig
+++ b/arch/mips/configs/ocelot_c_defconfig
@@ -1,7 +1,7 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.15-rc2 3# Linux kernel version: 2.6.16-rc1
4# Thu Nov 24 01:06:43 2005 4# Fri Jan 27 15:40:19 2006
5# 5#
6CONFIG_MIPS=y 6CONFIG_MIPS=y
7 7
@@ -154,26 +154,28 @@ CONFIG_SYSVIPC=y
154# CONFIG_BSD_PROCESS_ACCT is not set 154# CONFIG_BSD_PROCESS_ACCT is not set
155CONFIG_SYSCTL=y 155CONFIG_SYSCTL=y
156# CONFIG_AUDIT is not set 156# CONFIG_AUDIT is not set
157CONFIG_HOTPLUG=y
158CONFIG_KOBJECT_UEVENT=y
159# CONFIG_IKCONFIG is not set 157# CONFIG_IKCONFIG is not set
160CONFIG_INITRAMFS_SOURCE="" 158CONFIG_INITRAMFS_SOURCE=""
159# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
161CONFIG_EMBEDDED=y 160CONFIG_EMBEDDED=y
162CONFIG_KALLSYMS=y 161CONFIG_KALLSYMS=y
163# CONFIG_KALLSYMS_EXTRA_PASS is not set 162# CONFIG_KALLSYMS_EXTRA_PASS is not set
163CONFIG_HOTPLUG=y
164CONFIG_PRINTK=y 164CONFIG_PRINTK=y
165CONFIG_BUG=y 165CONFIG_BUG=y
166CONFIG_ELF_CORE=y
166CONFIG_BASE_FULL=y 167CONFIG_BASE_FULL=y
167CONFIG_FUTEX=y 168CONFIG_FUTEX=y
168CONFIG_EPOLL=y 169CONFIG_EPOLL=y
169# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
170CONFIG_SHMEM=y 170CONFIG_SHMEM=y
171CONFIG_CC_ALIGN_FUNCTIONS=0 171CONFIG_CC_ALIGN_FUNCTIONS=0
172CONFIG_CC_ALIGN_LABELS=0 172CONFIG_CC_ALIGN_LABELS=0
173CONFIG_CC_ALIGN_LOOPS=0 173CONFIG_CC_ALIGN_LOOPS=0
174CONFIG_CC_ALIGN_JUMPS=0 174CONFIG_CC_ALIGN_JUMPS=0
175CONFIG_SLAB=y
175# CONFIG_TINY_SHMEM is not set 176# CONFIG_TINY_SHMEM is not set
176CONFIG_BASE_SMALL=0 177CONFIG_BASE_SMALL=0
178# CONFIG_SLOB is not set
177 179
178# 180#
179# Loadable module support 181# Loadable module support
@@ -220,7 +222,6 @@ CONFIG_MMU=y
220# 222#
221CONFIG_BINFMT_ELF=y 223CONFIG_BINFMT_ELF=y
222# CONFIG_BINFMT_MISC is not set 224# CONFIG_BINFMT_MISC is not set
223# CONFIG_BUILD_ELF64 is not set
224CONFIG_MIPS32_COMPAT=y 225CONFIG_MIPS32_COMPAT=y
225CONFIG_COMPAT=y 226CONFIG_COMPAT=y
226CONFIG_MIPS32_O32=y 227CONFIG_MIPS32_O32=y
@@ -281,6 +282,11 @@ CONFIG_TCP_CONG_BIC=y
281# CONFIG_ATALK is not set 282# CONFIG_ATALK is not set
282# CONFIG_X25 is not set 283# CONFIG_X25 is not set
283# CONFIG_LAPB is not set 284# CONFIG_LAPB is not set
285
286#
287# TIPC Configuration (EXPERIMENTAL)
288#
289# CONFIG_TIPC is not set
284# CONFIG_NET_DIVERT is not set 290# CONFIG_NET_DIVERT is not set
285# CONFIG_ECONET is not set 291# CONFIG_ECONET is not set
286# CONFIG_WAN_ROUTER is not set 292# CONFIG_WAN_ROUTER is not set
@@ -301,7 +307,6 @@ CONFIG_IEEE80211=y
301# CONFIG_IEEE80211_DEBUG is not set 307# CONFIG_IEEE80211_DEBUG is not set
302CONFIG_IEEE80211_CRYPT_WEP=y 308CONFIG_IEEE80211_CRYPT_WEP=y
303CONFIG_IEEE80211_CRYPT_CCMP=y 309CONFIG_IEEE80211_CRYPT_CCMP=y
304CONFIG_IEEE80211_CRYPT_TKIP=y
305 310
306# 311#
307# Device Drivers 312# Device Drivers
@@ -420,6 +425,7 @@ CONFIG_NET_ETHERNET=y
420# CONFIG_SUNGEM is not set 425# CONFIG_SUNGEM is not set
421# CONFIG_CASSINI is not set 426# CONFIG_CASSINI is not set
422# CONFIG_NET_VENDOR_3COM is not set 427# CONFIG_NET_VENDOR_3COM is not set
428# CONFIG_DM9000 is not set
423 429
424# 430#
425# Tulip family network device support 431# Tulip family network device support
@@ -440,6 +446,7 @@ CONFIG_NET_ETHERNET=y
440# CONFIG_R8169 is not set 446# CONFIG_R8169 is not set
441# CONFIG_SIS190 is not set 447# CONFIG_SIS190 is not set
442# CONFIG_SKGE is not set 448# CONFIG_SKGE is not set
449# CONFIG_SKY2 is not set
443# CONFIG_SK98LIN is not set 450# CONFIG_SK98LIN is not set
444# CONFIG_TIGON3 is not set 451# CONFIG_TIGON3 is not set
445# CONFIG_BNX2 is not set 452# CONFIG_BNX2 is not set
@@ -461,8 +468,6 @@ CONFIG_NET_ETHERNET=y
461# Wireless LAN (non-hamradio) 468# Wireless LAN (non-hamradio)
462# 469#
463# CONFIG_NET_RADIO is not set 470# CONFIG_NET_RADIO is not set
464# CONFIG_IPW_DEBUG is not set
465CONFIG_IPW2200=y
466 471
467# 472#
468# Wan interfaces 473# Wan interfaces
@@ -538,6 +543,7 @@ CONFIG_HW_CONSOLE=y
538CONFIG_SERIAL_8250=y 543CONFIG_SERIAL_8250=y
539CONFIG_SERIAL_8250_CONSOLE=y 544CONFIG_SERIAL_8250_CONSOLE=y
540CONFIG_SERIAL_8250_NR_UARTS=4 545CONFIG_SERIAL_8250_NR_UARTS=4
546CONFIG_SERIAL_8250_RUNTIME_UARTS=4
541# CONFIG_SERIAL_8250_EXTENDED is not set 547# CONFIG_SERIAL_8250_EXTENDED is not set
542 548
543# 549#
@@ -545,7 +551,6 @@ CONFIG_SERIAL_8250_NR_UARTS=4
545# 551#
546CONFIG_SERIAL_CORE=y 552CONFIG_SERIAL_CORE=y
547CONFIG_SERIAL_CORE_CONSOLE=y 553CONFIG_SERIAL_CORE_CONSOLE=y
548# CONFIG_SERIAL_JSM is not set
549CONFIG_UNIX98_PTYS=y 554CONFIG_UNIX98_PTYS=y
550CONFIG_LEGACY_PTYS=y 555CONFIG_LEGACY_PTYS=y
551CONFIG_LEGACY_PTY_COUNT=256 556CONFIG_LEGACY_PTY_COUNT=256
@@ -583,6 +588,12 @@ CONFIG_LEGACY_PTY_COUNT=256
583# CONFIG_I2C is not set 588# CONFIG_I2C is not set
584 589
585# 590#
591# SPI support
592#
593# CONFIG_SPI is not set
594# CONFIG_SPI_MASTER is not set
595
596#
586# Dallas's 1-wire bus 597# Dallas's 1-wire bus
587# 598#
588# CONFIG_W1 is not set 599# CONFIG_W1 is not set
@@ -664,11 +675,11 @@ CONFIG_EXT2_FS=y
664# CONFIG_EXT2_FS_XATTR is not set 675# CONFIG_EXT2_FS_XATTR is not set
665# CONFIG_EXT2_FS_XIP is not set 676# CONFIG_EXT2_FS_XIP is not set
666# CONFIG_EXT3_FS is not set 677# CONFIG_EXT3_FS is not set
667# CONFIG_JBD is not set
668# CONFIG_REISERFS_FS is not set 678# CONFIG_REISERFS_FS is not set
669# CONFIG_JFS_FS is not set 679# CONFIG_JFS_FS is not set
670# CONFIG_FS_POSIX_ACL is not set 680# CONFIG_FS_POSIX_ACL is not set
671# CONFIG_XFS_FS is not set 681# CONFIG_XFS_FS is not set
682# CONFIG_OCFS2_FS is not set
672# CONFIG_MINIX_FS is not set 683# CONFIG_MINIX_FS is not set
673# CONFIG_ROMFS_FS is not set 684# CONFIG_ROMFS_FS is not set
674CONFIG_INOTIFY=y 685CONFIG_INOTIFY=y
@@ -701,6 +712,7 @@ CONFIG_SYSFS=y
701# CONFIG_HUGETLB_PAGE is not set 712# CONFIG_HUGETLB_PAGE is not set
702CONFIG_RAMFS=y 713CONFIG_RAMFS=y
703CONFIG_RELAYFS_FS=y 714CONFIG_RELAYFS_FS=y
715# CONFIG_CONFIGFS_FS is not set
704 716
705# 717#
706# Miscellaneous filesystems 718# Miscellaneous filesystems
@@ -763,6 +775,7 @@ CONFIG_MSDOS_PARTITION=y
763# Kernel hacking 775# Kernel hacking
764# 776#
765# CONFIG_PRINTK_TIME is not set 777# CONFIG_PRINTK_TIME is not set
778# CONFIG_MAGIC_SYSRQ is not set
766# CONFIG_DEBUG_KERNEL is not set 779# CONFIG_DEBUG_KERNEL is not set
767CONFIG_LOG_BUF_SHIFT=14 780CONFIG_LOG_BUF_SHIFT=14
768CONFIG_CROSSCOMPILE=y 781CONFIG_CROSSCOMPILE=y
diff --git a/arch/mips/configs/ocelot_defconfig b/arch/mips/configs/ocelot_defconfig
index f3787b68bdd1..d80ff278f2af 100644
--- a/arch/mips/configs/ocelot_defconfig
+++ b/arch/mips/configs/ocelot_defconfig
@@ -1,7 +1,7 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.15-rc2 3# Linux kernel version: 2.6.16-rc1
4# Thu Nov 24 01:06:44 2005 4# Fri Jan 27 15:40:20 2006
5# 5#
6CONFIG_MIPS=y 6CONFIG_MIPS=y
7 7
@@ -159,26 +159,28 @@ CONFIG_SYSVIPC=y
159# CONFIG_BSD_PROCESS_ACCT is not set 159# CONFIG_BSD_PROCESS_ACCT is not set
160CONFIG_SYSCTL=y 160CONFIG_SYSCTL=y
161# CONFIG_AUDIT is not set 161# CONFIG_AUDIT is not set
162# CONFIG_HOTPLUG is not set
163CONFIG_KOBJECT_UEVENT=y
164# CONFIG_IKCONFIG is not set 162# CONFIG_IKCONFIG is not set
165CONFIG_INITRAMFS_SOURCE="" 163CONFIG_INITRAMFS_SOURCE=""
164# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
166CONFIG_EMBEDDED=y 165CONFIG_EMBEDDED=y
167CONFIG_KALLSYMS=y 166CONFIG_KALLSYMS=y
168# CONFIG_KALLSYMS_EXTRA_PASS is not set 167# CONFIG_KALLSYMS_EXTRA_PASS is not set
168# CONFIG_HOTPLUG is not set
169CONFIG_PRINTK=y 169CONFIG_PRINTK=y
170CONFIG_BUG=y 170CONFIG_BUG=y
171CONFIG_ELF_CORE=y
171CONFIG_BASE_FULL=y 172CONFIG_BASE_FULL=y
172CONFIG_FUTEX=y 173CONFIG_FUTEX=y
173CONFIG_EPOLL=y 174CONFIG_EPOLL=y
174# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
175CONFIG_SHMEM=y 175CONFIG_SHMEM=y
176CONFIG_CC_ALIGN_FUNCTIONS=0 176CONFIG_CC_ALIGN_FUNCTIONS=0
177CONFIG_CC_ALIGN_LABELS=0 177CONFIG_CC_ALIGN_LABELS=0
178CONFIG_CC_ALIGN_LOOPS=0 178CONFIG_CC_ALIGN_LOOPS=0
179CONFIG_CC_ALIGN_JUMPS=0 179CONFIG_CC_ALIGN_JUMPS=0
180CONFIG_SLAB=y
180# CONFIG_TINY_SHMEM is not set 181# CONFIG_TINY_SHMEM is not set
181CONFIG_BASE_SMALL=0 182CONFIG_BASE_SMALL=0
183# CONFIG_SLOB is not set
182 184
183# 185#
184# Loadable module support 186# Loadable module support
@@ -280,6 +282,11 @@ CONFIG_TCP_CONG_BIC=y
280# CONFIG_ATALK is not set 282# CONFIG_ATALK is not set
281# CONFIG_X25 is not set 283# CONFIG_X25 is not set
282# CONFIG_LAPB is not set 284# CONFIG_LAPB is not set
285
286#
287# TIPC Configuration (EXPERIMENTAL)
288#
289# CONFIG_TIPC is not set
283# CONFIG_NET_DIVERT is not set 290# CONFIG_NET_DIVERT is not set
284# CONFIG_ECONET is not set 291# CONFIG_ECONET is not set
285# CONFIG_WAN_ROUTER is not set 292# CONFIG_WAN_ROUTER is not set
@@ -300,7 +307,6 @@ CONFIG_IEEE80211=y
300# CONFIG_IEEE80211_DEBUG is not set 307# CONFIG_IEEE80211_DEBUG is not set
301CONFIG_IEEE80211_CRYPT_WEP=y 308CONFIG_IEEE80211_CRYPT_WEP=y
302CONFIG_IEEE80211_CRYPT_CCMP=y 309CONFIG_IEEE80211_CRYPT_CCMP=y
303CONFIG_IEEE80211_CRYPT_TKIP=y
304 310
305# 311#
306# Device Drivers 312# Device Drivers
@@ -403,6 +409,7 @@ CONFIG_CICADA_PHY=y
403# 409#
404CONFIG_NET_ETHERNET=y 410CONFIG_NET_ETHERNET=y
405# CONFIG_MII is not set 411# CONFIG_MII is not set
412# CONFIG_DM9000 is not set
406 413
407# 414#
408# Ethernet (1000 Mbit) 415# Ethernet (1000 Mbit)
@@ -492,6 +499,7 @@ CONFIG_HW_CONSOLE=y
492CONFIG_SERIAL_8250=y 499CONFIG_SERIAL_8250=y
493CONFIG_SERIAL_8250_CONSOLE=y 500CONFIG_SERIAL_8250_CONSOLE=y
494CONFIG_SERIAL_8250_NR_UARTS=4 501CONFIG_SERIAL_8250_NR_UARTS=4
502CONFIG_SERIAL_8250_RUNTIME_UARTS=4
495# CONFIG_SERIAL_8250_EXTENDED is not set 503# CONFIG_SERIAL_8250_EXTENDED is not set
496 504
497# 505#
@@ -534,6 +542,12 @@ CONFIG_LEGACY_PTY_COUNT=256
534# CONFIG_I2C is not set 542# CONFIG_I2C is not set
535 543
536# 544#
545# SPI support
546#
547# CONFIG_SPI is not set
548# CONFIG_SPI_MASTER is not set
549
550#
537# Dallas's 1-wire bus 551# Dallas's 1-wire bus
538# 552#
539# CONFIG_W1 is not set 553# CONFIG_W1 is not set
@@ -613,11 +627,11 @@ CONFIG_EXT2_FS=y
613# CONFIG_EXT2_FS_XATTR is not set 627# CONFIG_EXT2_FS_XATTR is not set
614# CONFIG_EXT2_FS_XIP is not set 628# CONFIG_EXT2_FS_XIP is not set
615# CONFIG_EXT3_FS is not set 629# CONFIG_EXT3_FS is not set
616# CONFIG_JBD is not set
617# CONFIG_REISERFS_FS is not set 630# CONFIG_REISERFS_FS is not set
618# CONFIG_JFS_FS is not set 631# CONFIG_JFS_FS is not set
619# CONFIG_FS_POSIX_ACL is not set 632# CONFIG_FS_POSIX_ACL is not set
620# CONFIG_XFS_FS is not set 633# CONFIG_XFS_FS is not set
634# CONFIG_OCFS2_FS is not set
621# CONFIG_MINIX_FS is not set 635# CONFIG_MINIX_FS is not set
622# CONFIG_ROMFS_FS is not set 636# CONFIG_ROMFS_FS is not set
623CONFIG_INOTIFY=y 637CONFIG_INOTIFY=y
@@ -650,6 +664,7 @@ CONFIG_SYSFS=y
650# CONFIG_HUGETLB_PAGE is not set 664# CONFIG_HUGETLB_PAGE is not set
651CONFIG_RAMFS=y 665CONFIG_RAMFS=y
652CONFIG_RELAYFS_FS=y 666CONFIG_RELAYFS_FS=y
667# CONFIG_CONFIGFS_FS is not set
653 668
654# 669#
655# Miscellaneous filesystems 670# Miscellaneous filesystems
@@ -712,6 +727,7 @@ CONFIG_MSDOS_PARTITION=y
712# Kernel hacking 727# Kernel hacking
713# 728#
714# CONFIG_PRINTK_TIME is not set 729# CONFIG_PRINTK_TIME is not set
730# CONFIG_MAGIC_SYSRQ is not set
715# CONFIG_DEBUG_KERNEL is not set 731# CONFIG_DEBUG_KERNEL is not set
716CONFIG_LOG_BUF_SHIFT=14 732CONFIG_LOG_BUF_SHIFT=14
717CONFIG_CROSSCOMPILE=y 733CONFIG_CROSSCOMPILE=y
diff --git a/arch/mips/configs/ocelot_g_defconfig b/arch/mips/configs/ocelot_g_defconfig
index b6126ad4d06d..c0f508d180c4 100644
--- a/arch/mips/configs/ocelot_g_defconfig
+++ b/arch/mips/configs/ocelot_g_defconfig
@@ -1,7 +1,7 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.15-rc2 3# Linux kernel version: 2.6.16-rc1
4# Thu Nov 24 01:06:46 2005 4# Fri Jan 27 15:40:21 2006
5# 5#
6CONFIG_MIPS=y 6CONFIG_MIPS=y
7 7
@@ -157,26 +157,28 @@ CONFIG_SYSVIPC=y
157# CONFIG_BSD_PROCESS_ACCT is not set 157# CONFIG_BSD_PROCESS_ACCT is not set
158CONFIG_SYSCTL=y 158CONFIG_SYSCTL=y
159# CONFIG_AUDIT is not set 159# CONFIG_AUDIT is not set
160CONFIG_HOTPLUG=y
161CONFIG_KOBJECT_UEVENT=y
162# CONFIG_IKCONFIG is not set 160# CONFIG_IKCONFIG is not set
163CONFIG_INITRAMFS_SOURCE="" 161CONFIG_INITRAMFS_SOURCE=""
162# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
164CONFIG_EMBEDDED=y 163CONFIG_EMBEDDED=y
165CONFIG_KALLSYMS=y 164CONFIG_KALLSYMS=y
166# CONFIG_KALLSYMS_EXTRA_PASS is not set 165# CONFIG_KALLSYMS_EXTRA_PASS is not set
166CONFIG_HOTPLUG=y
167CONFIG_PRINTK=y 167CONFIG_PRINTK=y
168CONFIG_BUG=y 168CONFIG_BUG=y
169CONFIG_ELF_CORE=y
169CONFIG_BASE_FULL=y 170CONFIG_BASE_FULL=y
170CONFIG_FUTEX=y 171CONFIG_FUTEX=y
171CONFIG_EPOLL=y 172CONFIG_EPOLL=y
172# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
173CONFIG_SHMEM=y 173CONFIG_SHMEM=y
174CONFIG_CC_ALIGN_FUNCTIONS=0 174CONFIG_CC_ALIGN_FUNCTIONS=0
175CONFIG_CC_ALIGN_LABELS=0 175CONFIG_CC_ALIGN_LABELS=0
176CONFIG_CC_ALIGN_LOOPS=0 176CONFIG_CC_ALIGN_LOOPS=0
177CONFIG_CC_ALIGN_JUMPS=0 177CONFIG_CC_ALIGN_JUMPS=0
178CONFIG_SLAB=y
178# CONFIG_TINY_SHMEM is not set 179# CONFIG_TINY_SHMEM is not set
179CONFIG_BASE_SMALL=0 180CONFIG_BASE_SMALL=0
181# CONFIG_SLOB is not set
180 182
181# 183#
182# Loadable module support 184# Loadable module support
@@ -223,7 +225,6 @@ CONFIG_MMU=y
223# 225#
224CONFIG_BINFMT_ELF=y 226CONFIG_BINFMT_ELF=y
225# CONFIG_BINFMT_MISC is not set 227# CONFIG_BINFMT_MISC is not set
226# CONFIG_BUILD_ELF64 is not set
227CONFIG_MIPS32_COMPAT=y 228CONFIG_MIPS32_COMPAT=y
228CONFIG_COMPAT=y 229CONFIG_COMPAT=y
229CONFIG_MIPS32_O32=y 230CONFIG_MIPS32_O32=y
@@ -284,6 +285,11 @@ CONFIG_TCP_CONG_BIC=y
284# CONFIG_ATALK is not set 285# CONFIG_ATALK is not set
285# CONFIG_X25 is not set 286# CONFIG_X25 is not set
286# CONFIG_LAPB is not set 287# CONFIG_LAPB is not set
288
289#
290# TIPC Configuration (EXPERIMENTAL)
291#
292# CONFIG_TIPC is not set
287# CONFIG_NET_DIVERT is not set 293# CONFIG_NET_DIVERT is not set
288# CONFIG_ECONET is not set 294# CONFIG_ECONET is not set
289# CONFIG_WAN_ROUTER is not set 295# CONFIG_WAN_ROUTER is not set
@@ -304,7 +310,6 @@ CONFIG_IEEE80211=y
304# CONFIG_IEEE80211_DEBUG is not set 310# CONFIG_IEEE80211_DEBUG is not set
305CONFIG_IEEE80211_CRYPT_WEP=y 311CONFIG_IEEE80211_CRYPT_WEP=y
306CONFIG_IEEE80211_CRYPT_CCMP=y 312CONFIG_IEEE80211_CRYPT_CCMP=y
307CONFIG_IEEE80211_CRYPT_TKIP=y
308 313
309# 314#
310# Device Drivers 315# Device Drivers
@@ -424,6 +429,7 @@ CONFIG_GALILEO_64240_ETH=y
424# CONFIG_SUNGEM is not set 429# CONFIG_SUNGEM is not set
425# CONFIG_CASSINI is not set 430# CONFIG_CASSINI is not set
426# CONFIG_NET_VENDOR_3COM is not set 431# CONFIG_NET_VENDOR_3COM is not set
432# CONFIG_DM9000 is not set
427 433
428# 434#
429# Tulip family network device support 435# Tulip family network device support
@@ -444,6 +450,7 @@ CONFIG_GALILEO_64240_ETH=y
444# CONFIG_R8169 is not set 450# CONFIG_R8169 is not set
445# CONFIG_SIS190 is not set 451# CONFIG_SIS190 is not set
446# CONFIG_SKGE is not set 452# CONFIG_SKGE is not set
453# CONFIG_SKY2 is not set
447# CONFIG_SK98LIN is not set 454# CONFIG_SK98LIN is not set
448# CONFIG_TIGON3 is not set 455# CONFIG_TIGON3 is not set
449# CONFIG_BNX2 is not set 456# CONFIG_BNX2 is not set
@@ -464,8 +471,6 @@ CONFIG_GALILEO_64240_ETH=y
464# Wireless LAN (non-hamradio) 471# Wireless LAN (non-hamradio)
465# 472#
466# CONFIG_NET_RADIO is not set 473# CONFIG_NET_RADIO is not set
467# CONFIG_IPW_DEBUG is not set
468CONFIG_IPW2200=y
469 474
470# 475#
471# Wan interfaces 476# Wan interfaces
@@ -541,6 +546,7 @@ CONFIG_HW_CONSOLE=y
541CONFIG_SERIAL_8250=y 546CONFIG_SERIAL_8250=y
542CONFIG_SERIAL_8250_CONSOLE=y 547CONFIG_SERIAL_8250_CONSOLE=y
543CONFIG_SERIAL_8250_NR_UARTS=4 548CONFIG_SERIAL_8250_NR_UARTS=4
549CONFIG_SERIAL_8250_RUNTIME_UARTS=4
544# CONFIG_SERIAL_8250_EXTENDED is not set 550# CONFIG_SERIAL_8250_EXTENDED is not set
545 551
546# 552#
@@ -548,7 +554,6 @@ CONFIG_SERIAL_8250_NR_UARTS=4
548# 554#
549CONFIG_SERIAL_CORE=y 555CONFIG_SERIAL_CORE=y
550CONFIG_SERIAL_CORE_CONSOLE=y 556CONFIG_SERIAL_CORE_CONSOLE=y
551# CONFIG_SERIAL_JSM is not set
552CONFIG_UNIX98_PTYS=y 557CONFIG_UNIX98_PTYS=y
553CONFIG_LEGACY_PTYS=y 558CONFIG_LEGACY_PTYS=y
554CONFIG_LEGACY_PTY_COUNT=256 559CONFIG_LEGACY_PTY_COUNT=256
@@ -586,6 +591,12 @@ CONFIG_LEGACY_PTY_COUNT=256
586# CONFIG_I2C is not set 591# CONFIG_I2C is not set
587 592
588# 593#
594# SPI support
595#
596# CONFIG_SPI is not set
597# CONFIG_SPI_MASTER is not set
598
599#
589# Dallas's 1-wire bus 600# Dallas's 1-wire bus
590# 601#
591# CONFIG_W1 is not set 602# CONFIG_W1 is not set
@@ -667,11 +678,11 @@ CONFIG_EXT2_FS=y
667# CONFIG_EXT2_FS_XATTR is not set 678# CONFIG_EXT2_FS_XATTR is not set
668# CONFIG_EXT2_FS_XIP is not set 679# CONFIG_EXT2_FS_XIP is not set
669# CONFIG_EXT3_FS is not set 680# CONFIG_EXT3_FS is not set
670# CONFIG_JBD is not set
671# CONFIG_REISERFS_FS is not set 681# CONFIG_REISERFS_FS is not set
672# CONFIG_JFS_FS is not set 682# CONFIG_JFS_FS is not set
673# CONFIG_FS_POSIX_ACL is not set 683# CONFIG_FS_POSIX_ACL is not set
674# CONFIG_XFS_FS is not set 684# CONFIG_XFS_FS is not set
685# CONFIG_OCFS2_FS is not set
675# CONFIG_MINIX_FS is not set 686# CONFIG_MINIX_FS is not set
676# CONFIG_ROMFS_FS is not set 687# CONFIG_ROMFS_FS is not set
677CONFIG_INOTIFY=y 688CONFIG_INOTIFY=y
@@ -704,6 +715,7 @@ CONFIG_SYSFS=y
704# CONFIG_HUGETLB_PAGE is not set 715# CONFIG_HUGETLB_PAGE is not set
705CONFIG_RAMFS=y 716CONFIG_RAMFS=y
706CONFIG_RELAYFS_FS=y 717CONFIG_RELAYFS_FS=y
718# CONFIG_CONFIGFS_FS is not set
707 719
708# 720#
709# Miscellaneous filesystems 721# Miscellaneous filesystems
@@ -766,6 +778,7 @@ CONFIG_MSDOS_PARTITION=y
766# Kernel hacking 778# Kernel hacking
767# 779#
768# CONFIG_PRINTK_TIME is not set 780# CONFIG_PRINTK_TIME is not set
781# CONFIG_MAGIC_SYSRQ is not set
769# CONFIG_DEBUG_KERNEL is not set 782# CONFIG_DEBUG_KERNEL is not set
770CONFIG_LOG_BUF_SHIFT=14 783CONFIG_LOG_BUF_SHIFT=14
771CONFIG_CROSSCOMPILE=y 784CONFIG_CROSSCOMPILE=y
diff --git a/arch/mips/configs/pb1100_defconfig b/arch/mips/configs/pb1100_defconfig
index 883626afc47d..194b3c772bb7 100644
--- a/arch/mips/configs/pb1100_defconfig
+++ b/arch/mips/configs/pb1100_defconfig
@@ -1,7 +1,7 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.15-rc2 3# Linux kernel version: 2.6.16-rc1
4# Thu Nov 24 01:06:48 2005 4# Fri Jan 27 15:40:22 2006
5# 5#
6CONFIG_MIPS=y 6CONFIG_MIPS=y
7 7
@@ -153,26 +153,29 @@ CONFIG_SYSVIPC=y
153# CONFIG_BSD_PROCESS_ACCT is not set 153# CONFIG_BSD_PROCESS_ACCT is not set
154CONFIG_SYSCTL=y 154CONFIG_SYSCTL=y
155# CONFIG_AUDIT is not set 155# CONFIG_AUDIT is not set
156CONFIG_HOTPLUG=y
157CONFIG_KOBJECT_UEVENT=y
158# CONFIG_IKCONFIG is not set 156# CONFIG_IKCONFIG is not set
159CONFIG_INITRAMFS_SOURCE="" 157CONFIG_INITRAMFS_SOURCE=""
158# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
160CONFIG_EMBEDDED=y 159CONFIG_EMBEDDED=y
161CONFIG_KALLSYMS=y 160CONFIG_KALLSYMS=y
162# CONFIG_KALLSYMS_EXTRA_PASS is not set 161# CONFIG_KALLSYMS_EXTRA_PASS is not set
162CONFIG_HOTPLUG=y
163CONFIG_PRINTK=y 163CONFIG_PRINTK=y
164CONFIG_BUG=y 164CONFIG_BUG=y
165CONFIG_ELF_CORE=y
165CONFIG_BASE_FULL=y 166CONFIG_BASE_FULL=y
166CONFIG_FUTEX=y 167CONFIG_FUTEX=y
167CONFIG_EPOLL=y 168CONFIG_EPOLL=y
168# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
169CONFIG_SHMEM=y 169CONFIG_SHMEM=y
170CONFIG_CC_ALIGN_FUNCTIONS=0 170CONFIG_CC_ALIGN_FUNCTIONS=0
171CONFIG_CC_ALIGN_LABELS=0 171CONFIG_CC_ALIGN_LABELS=0
172CONFIG_CC_ALIGN_LOOPS=0 172CONFIG_CC_ALIGN_LOOPS=0
173CONFIG_CC_ALIGN_JUMPS=0 173CONFIG_CC_ALIGN_JUMPS=0
174CONFIG_SLAB=y
174# CONFIG_TINY_SHMEM is not set 175# CONFIG_TINY_SHMEM is not set
175CONFIG_BASE_SMALL=0 176CONFIG_BASE_SMALL=0
177# CONFIG_SLOB is not set
178CONFIG_OBSOLETE_INTERMODULE=y
176 179
177# 180#
178# Loadable module support 181# Loadable module support
@@ -287,6 +290,21 @@ CONFIG_NETFILTER_NETLINK=m
287CONFIG_NETFILTER_NETLINK_QUEUE=m 290CONFIG_NETFILTER_NETLINK_QUEUE=m
288CONFIG_NETFILTER_NETLINK_LOG=m 291CONFIG_NETFILTER_NETLINK_LOG=m
289# CONFIG_NF_CONNTRACK is not set 292# CONFIG_NF_CONNTRACK is not set
293CONFIG_NETFILTER_XTABLES=m
294CONFIG_NETFILTER_XT_TARGET_CLASSIFY=m
295CONFIG_NETFILTER_XT_TARGET_MARK=m
296CONFIG_NETFILTER_XT_TARGET_NFQUEUE=m
297CONFIG_NETFILTER_XT_MATCH_COMMENT=m
298CONFIG_NETFILTER_XT_MATCH_DCCP=m
299CONFIG_NETFILTER_XT_MATCH_LENGTH=m
300CONFIG_NETFILTER_XT_MATCH_LIMIT=m
301CONFIG_NETFILTER_XT_MATCH_MAC=m
302CONFIG_NETFILTER_XT_MATCH_MARK=m
303CONFIG_NETFILTER_XT_MATCH_PKTTYPE=m
304CONFIG_NETFILTER_XT_MATCH_REALM=m
305CONFIG_NETFILTER_XT_MATCH_SCTP=m
306CONFIG_NETFILTER_XT_MATCH_STRING=m
307CONFIG_NETFILTER_XT_MATCH_TCPMSS=m
290 308
291# 309#
292# IP: Netfilter Configuration 310# IP: Netfilter Configuration
@@ -314,6 +332,11 @@ CONFIG_NETFILTER_NETLINK_LOG=m
314# CONFIG_ATALK is not set 332# CONFIG_ATALK is not set
315# CONFIG_X25 is not set 333# CONFIG_X25 is not set
316# CONFIG_LAPB is not set 334# CONFIG_LAPB is not set
335
336#
337# TIPC Configuration (EXPERIMENTAL)
338#
339# CONFIG_TIPC is not set
317# CONFIG_NET_DIVERT is not set 340# CONFIG_NET_DIVERT is not set
318# CONFIG_ECONET is not set 341# CONFIG_ECONET is not set
319# CONFIG_WAN_ROUTER is not set 342# CONFIG_WAN_ROUTER is not set
@@ -322,6 +345,7 @@ CONFIG_NETFILTER_NETLINK_LOG=m
322# QoS and/or fair queueing 345# QoS and/or fair queueing
323# 346#
324# CONFIG_NET_SCHED is not set 347# CONFIG_NET_SCHED is not set
348CONFIG_NET_CLS_ROUTE=y
325 349
326# 350#
327# Network testing 351# Network testing
@@ -334,7 +358,6 @@ CONFIG_IEEE80211=m
334# CONFIG_IEEE80211_DEBUG is not set 358# CONFIG_IEEE80211_DEBUG is not set
335CONFIG_IEEE80211_CRYPT_WEP=m 359CONFIG_IEEE80211_CRYPT_WEP=m
336CONFIG_IEEE80211_CRYPT_CCMP=m 360CONFIG_IEEE80211_CRYPT_CCMP=m
337CONFIG_IEEE80211_CRYPT_TKIP=m
338 361
339# 362#
340# Device Drivers 363# Device Drivers
@@ -397,6 +420,7 @@ CONFIG_MTD_CFI_UTIL=y
397# CONFIG_MTD_RAM is not set 420# CONFIG_MTD_RAM is not set
398# CONFIG_MTD_ROM is not set 421# CONFIG_MTD_ROM is not set
399# CONFIG_MTD_ABSENT is not set 422# CONFIG_MTD_ABSENT is not set
423# CONFIG_MTD_OBSOLETE_CHIPS is not set
400 424
401# 425#
402# Mapping drivers for chip access 426# Mapping drivers for chip access
@@ -514,6 +538,7 @@ CONFIG_NET_ETHERNET=y
514# CONFIG_MII is not set 538# CONFIG_MII is not set
515# CONFIG_MIPS_AU1X00_ENET is not set 539# CONFIG_MIPS_AU1X00_ENET is not set
516# CONFIG_SMC91X is not set 540# CONFIG_SMC91X is not set
541# CONFIG_DM9000 is not set
517 542
518# 543#
519# Ethernet (1000 Mbit) 544# Ethernet (1000 Mbit)
@@ -619,13 +644,13 @@ CONFIG_SERIAL_8250=y
619CONFIG_SERIAL_8250_CONSOLE=y 644CONFIG_SERIAL_8250_CONSOLE=y
620# CONFIG_SERIAL_8250_CS is not set 645# CONFIG_SERIAL_8250_CS is not set
621CONFIG_SERIAL_8250_NR_UARTS=4 646CONFIG_SERIAL_8250_NR_UARTS=4
647CONFIG_SERIAL_8250_RUNTIME_UARTS=4
622# CONFIG_SERIAL_8250_EXTENDED is not set 648# CONFIG_SERIAL_8250_EXTENDED is not set
623CONFIG_SERIAL_8250_AU1X00=y 649CONFIG_SERIAL_8250_AU1X00=y
624 650
625# 651#
626# Non-8250 serial port support 652# Non-8250 serial port support
627# 653#
628# CONFIG_SERIAL_AU1X00 is not set
629CONFIG_SERIAL_CORE=y 654CONFIG_SERIAL_CORE=y
630CONFIG_SERIAL_CORE_CONSOLE=y 655CONFIG_SERIAL_CORE_CONSOLE=y
631CONFIG_UNIX98_PTYS=y 656CONFIG_UNIX98_PTYS=y
@@ -670,6 +695,12 @@ CONFIG_SYNCLINK_CS=m
670# CONFIG_I2C is not set 695# CONFIG_I2C is not set
671 696
672# 697#
698# SPI support
699#
700# CONFIG_SPI is not set
701# CONFIG_SPI_MASTER is not set
702
703#
673# Dallas's 1-wire bus 704# Dallas's 1-wire bus
674# 705#
675# CONFIG_W1 is not set 706# CONFIG_W1 is not set
@@ -767,6 +798,7 @@ CONFIG_REISERFS_FS_SECURITY=y
767# CONFIG_JFS_FS is not set 798# CONFIG_JFS_FS is not set
768CONFIG_FS_POSIX_ACL=y 799CONFIG_FS_POSIX_ACL=y
769# CONFIG_XFS_FS is not set 800# CONFIG_XFS_FS is not set
801# CONFIG_OCFS2_FS is not set
770# CONFIG_MINIX_FS is not set 802# CONFIG_MINIX_FS is not set
771# CONFIG_ROMFS_FS is not set 803# CONFIG_ROMFS_FS is not set
772CONFIG_INOTIFY=y 804CONFIG_INOTIFY=y
@@ -799,6 +831,7 @@ CONFIG_TMPFS=y
799# CONFIG_HUGETLB_PAGE is not set 831# CONFIG_HUGETLB_PAGE is not set
800CONFIG_RAMFS=y 832CONFIG_RAMFS=y
801CONFIG_RELAYFS_FS=m 833CONFIG_RELAYFS_FS=m
834# CONFIG_CONFIGFS_FS is not set
802 835
803# 836#
804# Miscellaneous filesystems 837# Miscellaneous filesystems
@@ -903,6 +936,7 @@ CONFIG_NLS_DEFAULT="iso8859-1"
903# Kernel hacking 936# Kernel hacking
904# 937#
905# CONFIG_PRINTK_TIME is not set 938# CONFIG_PRINTK_TIME is not set
939# CONFIG_MAGIC_SYSRQ is not set
906# CONFIG_DEBUG_KERNEL is not set 940# CONFIG_DEBUG_KERNEL is not set
907CONFIG_LOG_BUF_SHIFT=14 941CONFIG_LOG_BUF_SHIFT=14
908CONFIG_CROSSCOMPILE=y 942CONFIG_CROSSCOMPILE=y
@@ -957,3 +991,7 @@ CONFIG_CRC32=y
957CONFIG_LIBCRC32C=m 991CONFIG_LIBCRC32C=m
958CONFIG_ZLIB_INFLATE=m 992CONFIG_ZLIB_INFLATE=m
959CONFIG_ZLIB_DEFLATE=m 993CONFIG_ZLIB_DEFLATE=m
994CONFIG_TEXTSEARCH=y
995CONFIG_TEXTSEARCH_KMP=m
996CONFIG_TEXTSEARCH_BM=m
997CONFIG_TEXTSEARCH_FSM=m
diff --git a/arch/mips/configs/pb1500_defconfig b/arch/mips/configs/pb1500_defconfig
index f8fbc77f924e..8985725e6a98 100644
--- a/arch/mips/configs/pb1500_defconfig
+++ b/arch/mips/configs/pb1500_defconfig
@@ -1,7 +1,7 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.15-rc2 3# Linux kernel version: 2.6.16-rc1
4# Thu Nov 24 01:06:50 2005 4# Fri Jan 27 15:40:24 2006
5# 5#
6CONFIG_MIPS=y 6CONFIG_MIPS=y
7 7
@@ -152,26 +152,29 @@ CONFIG_SYSVIPC=y
152# CONFIG_BSD_PROCESS_ACCT is not set 152# CONFIG_BSD_PROCESS_ACCT is not set
153CONFIG_SYSCTL=y 153CONFIG_SYSCTL=y
154# CONFIG_AUDIT is not set 154# CONFIG_AUDIT is not set
155CONFIG_HOTPLUG=y
156CONFIG_KOBJECT_UEVENT=y
157# CONFIG_IKCONFIG is not set 155# CONFIG_IKCONFIG is not set
158CONFIG_INITRAMFS_SOURCE="" 156CONFIG_INITRAMFS_SOURCE=""
157# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
159CONFIG_EMBEDDED=y 158CONFIG_EMBEDDED=y
160CONFIG_KALLSYMS=y 159CONFIG_KALLSYMS=y
161# CONFIG_KALLSYMS_EXTRA_PASS is not set 160# CONFIG_KALLSYMS_EXTRA_PASS is not set
161CONFIG_HOTPLUG=y
162CONFIG_PRINTK=y 162CONFIG_PRINTK=y
163CONFIG_BUG=y 163CONFIG_BUG=y
164CONFIG_ELF_CORE=y
164CONFIG_BASE_FULL=y 165CONFIG_BASE_FULL=y
165CONFIG_FUTEX=y 166CONFIG_FUTEX=y
166CONFIG_EPOLL=y 167CONFIG_EPOLL=y
167# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
168CONFIG_SHMEM=y 168CONFIG_SHMEM=y
169CONFIG_CC_ALIGN_FUNCTIONS=0 169CONFIG_CC_ALIGN_FUNCTIONS=0
170CONFIG_CC_ALIGN_LABELS=0 170CONFIG_CC_ALIGN_LABELS=0
171CONFIG_CC_ALIGN_LOOPS=0 171CONFIG_CC_ALIGN_LOOPS=0
172CONFIG_CC_ALIGN_JUMPS=0 172CONFIG_CC_ALIGN_JUMPS=0
173CONFIG_SLAB=y
173# CONFIG_TINY_SHMEM is not set 174# CONFIG_TINY_SHMEM is not set
174CONFIG_BASE_SMALL=0 175CONFIG_BASE_SMALL=0
176# CONFIG_SLOB is not set
177CONFIG_OBSOLETE_INTERMODULE=y
175 178
176# 179#
177# Loadable module support 180# Loadable module support
@@ -293,6 +296,21 @@ CONFIG_NETFILTER_NETLINK=m
293CONFIG_NETFILTER_NETLINK_QUEUE=m 296CONFIG_NETFILTER_NETLINK_QUEUE=m
294CONFIG_NETFILTER_NETLINK_LOG=m 297CONFIG_NETFILTER_NETLINK_LOG=m
295# CONFIG_NF_CONNTRACK is not set 298# CONFIG_NF_CONNTRACK is not set
299CONFIG_NETFILTER_XTABLES=m
300CONFIG_NETFILTER_XT_TARGET_CLASSIFY=m
301CONFIG_NETFILTER_XT_TARGET_MARK=m
302CONFIG_NETFILTER_XT_TARGET_NFQUEUE=m
303CONFIG_NETFILTER_XT_MATCH_COMMENT=m
304CONFIG_NETFILTER_XT_MATCH_DCCP=m
305CONFIG_NETFILTER_XT_MATCH_LENGTH=m
306CONFIG_NETFILTER_XT_MATCH_LIMIT=m
307CONFIG_NETFILTER_XT_MATCH_MAC=m
308CONFIG_NETFILTER_XT_MATCH_MARK=m
309CONFIG_NETFILTER_XT_MATCH_PKTTYPE=m
310CONFIG_NETFILTER_XT_MATCH_REALM=m
311CONFIG_NETFILTER_XT_MATCH_SCTP=m
312CONFIG_NETFILTER_XT_MATCH_STRING=m
313CONFIG_NETFILTER_XT_MATCH_TCPMSS=m
296 314
297# 315#
298# IP: Netfilter Configuration 316# IP: Netfilter Configuration
@@ -320,6 +338,11 @@ CONFIG_NETFILTER_NETLINK_LOG=m
320# CONFIG_ATALK is not set 338# CONFIG_ATALK is not set
321# CONFIG_X25 is not set 339# CONFIG_X25 is not set
322# CONFIG_LAPB is not set 340# CONFIG_LAPB is not set
341
342#
343# TIPC Configuration (EXPERIMENTAL)
344#
345# CONFIG_TIPC is not set
323# CONFIG_NET_DIVERT is not set 346# CONFIG_NET_DIVERT is not set
324# CONFIG_ECONET is not set 347# CONFIG_ECONET is not set
325# CONFIG_WAN_ROUTER is not set 348# CONFIG_WAN_ROUTER is not set
@@ -328,6 +351,7 @@ CONFIG_NETFILTER_NETLINK_LOG=m
328# QoS and/or fair queueing 351# QoS and/or fair queueing
329# 352#
330# CONFIG_NET_SCHED is not set 353# CONFIG_NET_SCHED is not set
354CONFIG_NET_CLS_ROUTE=y
331 355
332# 356#
333# Network testing 357# Network testing
@@ -340,7 +364,6 @@ CONFIG_IEEE80211=m
340# CONFIG_IEEE80211_DEBUG is not set 364# CONFIG_IEEE80211_DEBUG is not set
341CONFIG_IEEE80211_CRYPT_WEP=m 365CONFIG_IEEE80211_CRYPT_WEP=m
342CONFIG_IEEE80211_CRYPT_CCMP=m 366CONFIG_IEEE80211_CRYPT_CCMP=m
343CONFIG_IEEE80211_CRYPT_TKIP=m
344 367
345# 368#
346# Device Drivers 369# Device Drivers
@@ -403,6 +426,7 @@ CONFIG_MTD_CFI_UTIL=y
403# CONFIG_MTD_RAM is not set 426# CONFIG_MTD_RAM is not set
404# CONFIG_MTD_ROM is not set 427# CONFIG_MTD_ROM is not set
405# CONFIG_MTD_ABSENT is not set 428# CONFIG_MTD_ABSENT is not set
429# CONFIG_MTD_OBSOLETE_CHIPS is not set
406 430
407# 431#
408# Mapping drivers for chip access 432# Mapping drivers for chip access
@@ -589,6 +613,7 @@ CONFIG_MIPS_AU1X00_ENET=y
589# CONFIG_CASSINI is not set 613# CONFIG_CASSINI is not set
590# CONFIG_NET_VENDOR_3COM is not set 614# CONFIG_NET_VENDOR_3COM is not set
591# CONFIG_SMC91X is not set 615# CONFIG_SMC91X is not set
616# CONFIG_DM9000 is not set
592 617
593# 618#
594# Tulip family network device support 619# Tulip family network device support
@@ -609,6 +634,7 @@ CONFIG_MIPS_AU1X00_ENET=y
609# CONFIG_R8169 is not set 634# CONFIG_R8169 is not set
610# CONFIG_SIS190 is not set 635# CONFIG_SIS190 is not set
611# CONFIG_SKGE is not set 636# CONFIG_SKGE is not set
637# CONFIG_SKY2 is not set
612# CONFIG_SK98LIN is not set 638# CONFIG_SK98LIN is not set
613# CONFIG_TIGON3 is not set 639# CONFIG_TIGON3 is not set
614# CONFIG_BNX2 is not set 640# CONFIG_BNX2 is not set
@@ -629,8 +655,6 @@ CONFIG_MIPS_AU1X00_ENET=y
629# Wireless LAN (non-hamradio) 655# Wireless LAN (non-hamradio)
630# 656#
631# CONFIG_NET_RADIO is not set 657# CONFIG_NET_RADIO is not set
632# CONFIG_IPW_DEBUG is not set
633CONFIG_IPW2200=m
634 658
635# 659#
636# PCMCIA network device support 660# PCMCIA network device support
@@ -728,16 +752,15 @@ CONFIG_SERIAL_8250=y
728CONFIG_SERIAL_8250_CONSOLE=y 752CONFIG_SERIAL_8250_CONSOLE=y
729# CONFIG_SERIAL_8250_CS is not set 753# CONFIG_SERIAL_8250_CS is not set
730CONFIG_SERIAL_8250_NR_UARTS=4 754CONFIG_SERIAL_8250_NR_UARTS=4
755CONFIG_SERIAL_8250_RUNTIME_UARTS=4
731# CONFIG_SERIAL_8250_EXTENDED is not set 756# CONFIG_SERIAL_8250_EXTENDED is not set
732CONFIG_SERIAL_8250_AU1X00=y 757CONFIG_SERIAL_8250_AU1X00=y
733 758
734# 759#
735# Non-8250 serial port support 760# Non-8250 serial port support
736# 761#
737# CONFIG_SERIAL_AU1X00 is not set
738CONFIG_SERIAL_CORE=y 762CONFIG_SERIAL_CORE=y
739CONFIG_SERIAL_CORE_CONSOLE=y 763CONFIG_SERIAL_CORE_CONSOLE=y
740# CONFIG_SERIAL_JSM is not set
741CONFIG_UNIX98_PTYS=y 764CONFIG_UNIX98_PTYS=y
742CONFIG_LEGACY_PTYS=y 765CONFIG_LEGACY_PTYS=y
743CONFIG_LEGACY_PTY_COUNT=256 766CONFIG_LEGACY_PTY_COUNT=256
@@ -782,6 +805,12 @@ CONFIG_SYNCLINK_CS=m
782# CONFIG_I2C is not set 805# CONFIG_I2C is not set
783 806
784# 807#
808# SPI support
809#
810# CONFIG_SPI is not set
811# CONFIG_SPI_MASTER is not set
812
813#
785# Dallas's 1-wire bus 814# Dallas's 1-wire bus
786# 815#
787# CONFIG_W1 is not set 816# CONFIG_W1 is not set
@@ -874,6 +903,7 @@ CONFIG_REISERFS_FS_SECURITY=y
874# CONFIG_JFS_FS is not set 903# CONFIG_JFS_FS is not set
875CONFIG_FS_POSIX_ACL=y 904CONFIG_FS_POSIX_ACL=y
876# CONFIG_XFS_FS is not set 905# CONFIG_XFS_FS is not set
906# CONFIG_OCFS2_FS is not set
877# CONFIG_MINIX_FS is not set 907# CONFIG_MINIX_FS is not set
878# CONFIG_ROMFS_FS is not set 908# CONFIG_ROMFS_FS is not set
879CONFIG_INOTIFY=y 909CONFIG_INOTIFY=y
@@ -906,6 +936,7 @@ CONFIG_TMPFS=y
906# CONFIG_HUGETLB_PAGE is not set 936# CONFIG_HUGETLB_PAGE is not set
907CONFIG_RAMFS=y 937CONFIG_RAMFS=y
908CONFIG_RELAYFS_FS=m 938CONFIG_RELAYFS_FS=m
939# CONFIG_CONFIGFS_FS is not set
909 940
910# 941#
911# Miscellaneous filesystems 942# Miscellaneous filesystems
@@ -1010,6 +1041,7 @@ CONFIG_NLS_DEFAULT="iso8859-1"
1010# Kernel hacking 1041# Kernel hacking
1011# 1042#
1012# CONFIG_PRINTK_TIME is not set 1043# CONFIG_PRINTK_TIME is not set
1044# CONFIG_MAGIC_SYSRQ is not set
1013# CONFIG_DEBUG_KERNEL is not set 1045# CONFIG_DEBUG_KERNEL is not set
1014CONFIG_LOG_BUF_SHIFT=14 1046CONFIG_LOG_BUF_SHIFT=14
1015CONFIG_CROSSCOMPILE=y 1047CONFIG_CROSSCOMPILE=y
@@ -1064,3 +1096,7 @@ CONFIG_CRC32=y
1064CONFIG_LIBCRC32C=m 1096CONFIG_LIBCRC32C=m
1065CONFIG_ZLIB_INFLATE=m 1097CONFIG_ZLIB_INFLATE=m
1066CONFIG_ZLIB_DEFLATE=m 1098CONFIG_ZLIB_DEFLATE=m
1099CONFIG_TEXTSEARCH=y
1100CONFIG_TEXTSEARCH_KMP=m
1101CONFIG_TEXTSEARCH_BM=m
1102CONFIG_TEXTSEARCH_FSM=m
diff --git a/arch/mips/configs/pb1550_defconfig b/arch/mips/configs/pb1550_defconfig
index 3d694cd68d38..adbf997b540e 100644
--- a/arch/mips/configs/pb1550_defconfig
+++ b/arch/mips/configs/pb1550_defconfig
@@ -1,7 +1,7 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.15-rc2 3# Linux kernel version: 2.6.16-rc1
4# Thu Nov 24 01:06:52 2005 4# Fri Jan 27 15:40:25 2006
5# 5#
6CONFIG_MIPS=y 6CONFIG_MIPS=y
7 7
@@ -152,26 +152,29 @@ CONFIG_SYSVIPC=y
152# CONFIG_BSD_PROCESS_ACCT is not set 152# CONFIG_BSD_PROCESS_ACCT is not set
153CONFIG_SYSCTL=y 153CONFIG_SYSCTL=y
154# CONFIG_AUDIT is not set 154# CONFIG_AUDIT is not set
155CONFIG_HOTPLUG=y
156CONFIG_KOBJECT_UEVENT=y
157# CONFIG_IKCONFIG is not set 155# CONFIG_IKCONFIG is not set
158CONFIG_INITRAMFS_SOURCE="" 156CONFIG_INITRAMFS_SOURCE=""
157# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
159CONFIG_EMBEDDED=y 158CONFIG_EMBEDDED=y
160CONFIG_KALLSYMS=y 159CONFIG_KALLSYMS=y
161# CONFIG_KALLSYMS_EXTRA_PASS is not set 160# CONFIG_KALLSYMS_EXTRA_PASS is not set
161CONFIG_HOTPLUG=y
162CONFIG_PRINTK=y 162CONFIG_PRINTK=y
163CONFIG_BUG=y 163CONFIG_BUG=y
164CONFIG_ELF_CORE=y
164CONFIG_BASE_FULL=y 165CONFIG_BASE_FULL=y
165CONFIG_FUTEX=y 166CONFIG_FUTEX=y
166CONFIG_EPOLL=y 167CONFIG_EPOLL=y
167# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
168CONFIG_SHMEM=y 168CONFIG_SHMEM=y
169CONFIG_CC_ALIGN_FUNCTIONS=0 169CONFIG_CC_ALIGN_FUNCTIONS=0
170CONFIG_CC_ALIGN_LABELS=0 170CONFIG_CC_ALIGN_LABELS=0
171CONFIG_CC_ALIGN_LOOPS=0 171CONFIG_CC_ALIGN_LOOPS=0
172CONFIG_CC_ALIGN_JUMPS=0 172CONFIG_CC_ALIGN_JUMPS=0
173CONFIG_SLAB=y
173# CONFIG_TINY_SHMEM is not set 174# CONFIG_TINY_SHMEM is not set
174CONFIG_BASE_SMALL=0 175CONFIG_BASE_SMALL=0
176# CONFIG_SLOB is not set
177CONFIG_OBSOLETE_INTERMODULE=y
175 178
176# 179#
177# Loadable module support 180# Loadable module support
@@ -293,6 +296,21 @@ CONFIG_NETFILTER_NETLINK=m
293CONFIG_NETFILTER_NETLINK_QUEUE=m 296CONFIG_NETFILTER_NETLINK_QUEUE=m
294CONFIG_NETFILTER_NETLINK_LOG=m 297CONFIG_NETFILTER_NETLINK_LOG=m
295# CONFIG_NF_CONNTRACK is not set 298# CONFIG_NF_CONNTRACK is not set
299CONFIG_NETFILTER_XTABLES=m
300CONFIG_NETFILTER_XT_TARGET_CLASSIFY=m
301CONFIG_NETFILTER_XT_TARGET_MARK=m
302CONFIG_NETFILTER_XT_TARGET_NFQUEUE=m
303CONFIG_NETFILTER_XT_MATCH_COMMENT=m
304CONFIG_NETFILTER_XT_MATCH_DCCP=m
305CONFIG_NETFILTER_XT_MATCH_LENGTH=m
306CONFIG_NETFILTER_XT_MATCH_LIMIT=m
307CONFIG_NETFILTER_XT_MATCH_MAC=m
308CONFIG_NETFILTER_XT_MATCH_MARK=m
309CONFIG_NETFILTER_XT_MATCH_PKTTYPE=m
310CONFIG_NETFILTER_XT_MATCH_REALM=m
311CONFIG_NETFILTER_XT_MATCH_SCTP=m
312CONFIG_NETFILTER_XT_MATCH_STRING=m
313CONFIG_NETFILTER_XT_MATCH_TCPMSS=m
296 314
297# 315#
298# IP: Netfilter Configuration 316# IP: Netfilter Configuration
@@ -320,6 +338,11 @@ CONFIG_NETFILTER_NETLINK_LOG=m
320# CONFIG_ATALK is not set 338# CONFIG_ATALK is not set
321# CONFIG_X25 is not set 339# CONFIG_X25 is not set
322# CONFIG_LAPB is not set 340# CONFIG_LAPB is not set
341
342#
343# TIPC Configuration (EXPERIMENTAL)
344#
345# CONFIG_TIPC is not set
323# CONFIG_NET_DIVERT is not set 346# CONFIG_NET_DIVERT is not set
324# CONFIG_ECONET is not set 347# CONFIG_ECONET is not set
325# CONFIG_WAN_ROUTER is not set 348# CONFIG_WAN_ROUTER is not set
@@ -328,6 +351,7 @@ CONFIG_NETFILTER_NETLINK_LOG=m
328# QoS and/or fair queueing 351# QoS and/or fair queueing
329# 352#
330# CONFIG_NET_SCHED is not set 353# CONFIG_NET_SCHED is not set
354CONFIG_NET_CLS_ROUTE=y
331 355
332# 356#
333# Network testing 357# Network testing
@@ -340,7 +364,6 @@ CONFIG_IEEE80211=m
340# CONFIG_IEEE80211_DEBUG is not set 364# CONFIG_IEEE80211_DEBUG is not set
341CONFIG_IEEE80211_CRYPT_WEP=m 365CONFIG_IEEE80211_CRYPT_WEP=m
342CONFIG_IEEE80211_CRYPT_CCMP=m 366CONFIG_IEEE80211_CRYPT_CCMP=m
343CONFIG_IEEE80211_CRYPT_TKIP=m
344 367
345# 368#
346# Device Drivers 369# Device Drivers
@@ -403,6 +426,7 @@ CONFIG_MTD_CFI_UTIL=y
403# CONFIG_MTD_RAM is not set 426# CONFIG_MTD_RAM is not set
404# CONFIG_MTD_ROM is not set 427# CONFIG_MTD_ROM is not set
405# CONFIG_MTD_ABSENT is not set 428# CONFIG_MTD_ABSENT is not set
429# CONFIG_MTD_OBSOLETE_CHIPS is not set
406 430
407# 431#
408# Mapping drivers for chip access 432# Mapping drivers for chip access
@@ -589,6 +613,7 @@ CONFIG_MIPS_AU1X00_ENET=y
589# CONFIG_CASSINI is not set 613# CONFIG_CASSINI is not set
590# CONFIG_NET_VENDOR_3COM is not set 614# CONFIG_NET_VENDOR_3COM is not set
591# CONFIG_SMC91X is not set 615# CONFIG_SMC91X is not set
616# CONFIG_DM9000 is not set
592 617
593# 618#
594# Tulip family network device support 619# Tulip family network device support
@@ -609,6 +634,7 @@ CONFIG_MIPS_AU1X00_ENET=y
609# CONFIG_R8169 is not set 634# CONFIG_R8169 is not set
610# CONFIG_SIS190 is not set 635# CONFIG_SIS190 is not set
611# CONFIG_SKGE is not set 636# CONFIG_SKGE is not set
637# CONFIG_SKY2 is not set
612# CONFIG_SK98LIN is not set 638# CONFIG_SK98LIN is not set
613# CONFIG_TIGON3 is not set 639# CONFIG_TIGON3 is not set
614# CONFIG_BNX2 is not set 640# CONFIG_BNX2 is not set
@@ -629,8 +655,6 @@ CONFIG_MIPS_AU1X00_ENET=y
629# Wireless LAN (non-hamradio) 655# Wireless LAN (non-hamradio)
630# 656#
631# CONFIG_NET_RADIO is not set 657# CONFIG_NET_RADIO is not set
632# CONFIG_IPW_DEBUG is not set
633CONFIG_IPW2200=m
634 658
635# 659#
636# PCMCIA network device support 660# PCMCIA network device support
@@ -720,16 +744,15 @@ CONFIG_SERIAL_8250=y
720CONFIG_SERIAL_8250_CONSOLE=y 744CONFIG_SERIAL_8250_CONSOLE=y
721# CONFIG_SERIAL_8250_CS is not set 745# CONFIG_SERIAL_8250_CS is not set
722CONFIG_SERIAL_8250_NR_UARTS=4 746CONFIG_SERIAL_8250_NR_UARTS=4
747CONFIG_SERIAL_8250_RUNTIME_UARTS=4
723# CONFIG_SERIAL_8250_EXTENDED is not set 748# CONFIG_SERIAL_8250_EXTENDED is not set
724CONFIG_SERIAL_8250_AU1X00=y 749CONFIG_SERIAL_8250_AU1X00=y
725 750
726# 751#
727# Non-8250 serial port support 752# Non-8250 serial port support
728# 753#
729# CONFIG_SERIAL_AU1X00 is not set
730CONFIG_SERIAL_CORE=y 754CONFIG_SERIAL_CORE=y
731CONFIG_SERIAL_CORE_CONSOLE=y 755CONFIG_SERIAL_CORE_CONSOLE=y
732# CONFIG_SERIAL_JSM is not set
733CONFIG_UNIX98_PTYS=y 756CONFIG_UNIX98_PTYS=y
734CONFIG_LEGACY_PTYS=y 757CONFIG_LEGACY_PTYS=y
735CONFIG_LEGACY_PTY_COUNT=256 758CONFIG_LEGACY_PTY_COUNT=256
@@ -774,6 +797,12 @@ CONFIG_SYNCLINK_CS=m
774# CONFIG_I2C is not set 797# CONFIG_I2C is not set
775 798
776# 799#
800# SPI support
801#
802# CONFIG_SPI is not set
803# CONFIG_SPI_MASTER is not set
804
805#
777# Dallas's 1-wire bus 806# Dallas's 1-wire bus
778# 807#
779# CONFIG_W1 is not set 808# CONFIG_W1 is not set
@@ -866,6 +895,7 @@ CONFIG_REISERFS_FS_SECURITY=y
866# CONFIG_JFS_FS is not set 895# CONFIG_JFS_FS is not set
867CONFIG_FS_POSIX_ACL=y 896CONFIG_FS_POSIX_ACL=y
868# CONFIG_XFS_FS is not set 897# CONFIG_XFS_FS is not set
898# CONFIG_OCFS2_FS is not set
869# CONFIG_MINIX_FS is not set 899# CONFIG_MINIX_FS is not set
870# CONFIG_ROMFS_FS is not set 900# CONFIG_ROMFS_FS is not set
871CONFIG_INOTIFY=y 901CONFIG_INOTIFY=y
@@ -898,6 +928,7 @@ CONFIG_TMPFS=y
898# CONFIG_HUGETLB_PAGE is not set 928# CONFIG_HUGETLB_PAGE is not set
899CONFIG_RAMFS=y 929CONFIG_RAMFS=y
900CONFIG_RELAYFS_FS=m 930CONFIG_RELAYFS_FS=m
931# CONFIG_CONFIGFS_FS is not set
901 932
902# 933#
903# Miscellaneous filesystems 934# Miscellaneous filesystems
@@ -1002,6 +1033,7 @@ CONFIG_NLS_DEFAULT="iso8859-1"
1002# Kernel hacking 1033# Kernel hacking
1003# 1034#
1004# CONFIG_PRINTK_TIME is not set 1035# CONFIG_PRINTK_TIME is not set
1036# CONFIG_MAGIC_SYSRQ is not set
1005# CONFIG_DEBUG_KERNEL is not set 1037# CONFIG_DEBUG_KERNEL is not set
1006CONFIG_LOG_BUF_SHIFT=14 1038CONFIG_LOG_BUF_SHIFT=14
1007CONFIG_CROSSCOMPILE=y 1039CONFIG_CROSSCOMPILE=y
@@ -1056,3 +1088,7 @@ CONFIG_CRC32=y
1056CONFIG_LIBCRC32C=m 1088CONFIG_LIBCRC32C=m
1057CONFIG_ZLIB_INFLATE=m 1089CONFIG_ZLIB_INFLATE=m
1058CONFIG_ZLIB_DEFLATE=m 1090CONFIG_ZLIB_DEFLATE=m
1091CONFIG_TEXTSEARCH=y
1092CONFIG_TEXTSEARCH_KMP=m
1093CONFIG_TEXTSEARCH_BM=m
1094CONFIG_TEXTSEARCH_FSM=m
diff --git a/arch/mips/configs/pnx8550-jbs_defconfig b/arch/mips/configs/pnx8550-jbs_defconfig
index fba624a792a9..b5db700450ba 100644
--- a/arch/mips/configs/pnx8550-jbs_defconfig
+++ b/arch/mips/configs/pnx8550-jbs_defconfig
@@ -1,7 +1,7 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.15-rc2 3# Linux kernel version: 2.6.16-rc1
4# Thu Nov 24 01:06:54 2005 4# Fri Jan 27 15:40:26 2006
5# 5#
6CONFIG_MIPS=y 6CONFIG_MIPS=y
7 7
@@ -151,28 +151,30 @@ CONFIG_SYSVIPC=y
151# CONFIG_BSD_PROCESS_ACCT is not set 151# CONFIG_BSD_PROCESS_ACCT is not set
152CONFIG_SYSCTL=y 152CONFIG_SYSCTL=y
153# CONFIG_AUDIT is not set 153# CONFIG_AUDIT is not set
154# CONFIG_HOTPLUG is not set
155CONFIG_KOBJECT_UEVENT=y
156CONFIG_IKCONFIG=y 154CONFIG_IKCONFIG=y
157CONFIG_IKCONFIG_PROC=y 155CONFIG_IKCONFIG_PROC=y
158CONFIG_INITRAMFS_SOURCE="" 156CONFIG_INITRAMFS_SOURCE=""
157# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
159CONFIG_EMBEDDED=y 158CONFIG_EMBEDDED=y
160CONFIG_KALLSYMS=y 159CONFIG_KALLSYMS=y
161# CONFIG_KALLSYMS_ALL is not set 160# CONFIG_KALLSYMS_ALL is not set
162# CONFIG_KALLSYMS_EXTRA_PASS is not set 161# CONFIG_KALLSYMS_EXTRA_PASS is not set
162CONFIG_HOTPLUG=y
163CONFIG_PRINTK=y 163CONFIG_PRINTK=y
164CONFIG_BUG=y 164CONFIG_BUG=y
165CONFIG_ELF_CORE=y
165CONFIG_BASE_FULL=y 166CONFIG_BASE_FULL=y
166CONFIG_FUTEX=y 167CONFIG_FUTEX=y
167CONFIG_EPOLL=y 168CONFIG_EPOLL=y
168# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
169CONFIG_SHMEM=y 169CONFIG_SHMEM=y
170CONFIG_CC_ALIGN_FUNCTIONS=0 170CONFIG_CC_ALIGN_FUNCTIONS=0
171CONFIG_CC_ALIGN_LABELS=0 171CONFIG_CC_ALIGN_LABELS=0
172CONFIG_CC_ALIGN_LOOPS=0 172CONFIG_CC_ALIGN_LOOPS=0
173CONFIG_CC_ALIGN_JUMPS=0 173CONFIG_CC_ALIGN_JUMPS=0
174CONFIG_SLAB=y
174# CONFIG_TINY_SHMEM is not set 175# CONFIG_TINY_SHMEM is not set
175CONFIG_BASE_SMALL=0 176CONFIG_BASE_SMALL=0
177# CONFIG_SLOB is not set
176 178
177# 179#
178# Loadable module support 180# Loadable module support
@@ -281,6 +283,11 @@ CONFIG_TCP_CONG_BIC=y
281# CONFIG_ATALK is not set 283# CONFIG_ATALK is not set
282# CONFIG_X25 is not set 284# CONFIG_X25 is not set
283# CONFIG_LAPB is not set 285# CONFIG_LAPB is not set
286
287#
288# TIPC Configuration (EXPERIMENTAL)
289#
290# CONFIG_TIPC is not set
284# CONFIG_NET_DIVERT is not set 291# CONFIG_NET_DIVERT is not set
285# CONFIG_ECONET is not set 292# CONFIG_ECONET is not set
286# CONFIG_WAN_ROUTER is not set 293# CONFIG_WAN_ROUTER is not set
@@ -308,7 +315,7 @@ CONFIG_TCP_CONG_BIC=y
308# 315#
309CONFIG_STANDALONE=y 316CONFIG_STANDALONE=y
310CONFIG_PREVENT_FIRMWARE_BUILD=y 317CONFIG_PREVENT_FIRMWARE_BUILD=y
311# CONFIG_FW_LOADER is not set 318CONFIG_FW_LOADER=y
312# CONFIG_DEBUG_DRIVER is not set 319# CONFIG_DEBUG_DRIVER is not set
313 320
314# 321#
@@ -435,7 +442,7 @@ CONFIG_SCSI_CONSTANTS=y
435# SCSI Transport Attributes 442# SCSI Transport Attributes
436# 443#
437# CONFIG_SCSI_SPI_ATTRS is not set 444# CONFIG_SCSI_SPI_ATTRS is not set
438# CONFIG_SCSI_FC_ATTRS is not set 445CONFIG_SCSI_FC_ATTRS=y
439CONFIG_SCSI_ISCSI_ATTRS=m 446CONFIG_SCSI_ISCSI_ATTRS=m
440# CONFIG_SCSI_SAS_ATTRS is not set 447# CONFIG_SCSI_SAS_ATTRS is not set
441 448
@@ -464,13 +471,7 @@ CONFIG_ISCSI_TCP=m
464# CONFIG_SCSI_IPR is not set 471# CONFIG_SCSI_IPR is not set
465# CONFIG_SCSI_QLOGIC_FC is not set 472# CONFIG_SCSI_QLOGIC_FC is not set
466# CONFIG_SCSI_QLOGIC_1280 is not set 473# CONFIG_SCSI_QLOGIC_1280 is not set
467CONFIG_SCSI_QLA2XXX=y 474# CONFIG_SCSI_QLA_FC is not set
468# CONFIG_SCSI_QLA21XX is not set
469# CONFIG_SCSI_QLA22XX is not set
470# CONFIG_SCSI_QLA2300 is not set
471# CONFIG_SCSI_QLA2322 is not set
472# CONFIG_SCSI_QLA6312 is not set
473# CONFIG_SCSI_QLA24XX is not set
474# CONFIG_SCSI_LPFC is not set 475# CONFIG_SCSI_LPFC is not set
475# CONFIG_SCSI_DC395x is not set 476# CONFIG_SCSI_DC395x is not set
476# CONFIG_SCSI_DC390T is not set 477# CONFIG_SCSI_DC390T is not set
@@ -528,6 +529,7 @@ CONFIG_MII=y
528# CONFIG_SUNGEM is not set 529# CONFIG_SUNGEM is not set
529# CONFIG_CASSINI is not set 530# CONFIG_CASSINI is not set
530# CONFIG_NET_VENDOR_3COM is not set 531# CONFIG_NET_VENDOR_3COM is not set
532# CONFIG_DM9000 is not set
531 533
532# 534#
533# Tulip family network device support 535# Tulip family network device support
@@ -571,6 +573,7 @@ CONFIG_8139TOO_8129=y
571# CONFIG_R8169 is not set 573# CONFIG_R8169 is not set
572# CONFIG_SIS190 is not set 574# CONFIG_SIS190 is not set
573# CONFIG_SKGE is not set 575# CONFIG_SKGE is not set
576# CONFIG_SKY2 is not set
574# CONFIG_SK98LIN is not set 577# CONFIG_SK98LIN is not set
575# CONFIG_VIA_VELOCITY is not set 578# CONFIG_VIA_VELOCITY is not set
576# CONFIG_TIGON3 is not set 579# CONFIG_TIGON3 is not set
@@ -668,7 +671,6 @@ CONFIG_HW_CONSOLE=y
668# Non-8250 serial port support 671# Non-8250 serial port support
669# 672#
670# CONFIG_SERIAL_IP3106 is not set 673# CONFIG_SERIAL_IP3106 is not set
671# CONFIG_SERIAL_JSM is not set
672CONFIG_UNIX98_PTYS=y 674CONFIG_UNIX98_PTYS=y
673CONFIG_LEGACY_PTYS=y 675CONFIG_LEGACY_PTYS=y
674CONFIG_LEGACY_PTY_COUNT=256 676CONFIG_LEGACY_PTY_COUNT=256
@@ -706,6 +708,12 @@ CONFIG_LEGACY_PTY_COUNT=256
706# CONFIG_I2C is not set 708# CONFIG_I2C is not set
707 709
708# 710#
711# SPI support
712#
713# CONFIG_SPI is not set
714# CONFIG_SPI_MASTER is not set
715
716#
709# Dallas's 1-wire bus 717# Dallas's 1-wire bus
710# 718#
711# CONFIG_W1 is not set 719# CONFIG_W1 is not set
@@ -801,6 +809,8 @@ CONFIG_USB_STORAGE_USBAT=y
801CONFIG_USB_STORAGE_SDDR09=y 809CONFIG_USB_STORAGE_SDDR09=y
802CONFIG_USB_STORAGE_SDDR55=y 810CONFIG_USB_STORAGE_SDDR55=y
803CONFIG_USB_STORAGE_JUMPSHOT=y 811CONFIG_USB_STORAGE_JUMPSHOT=y
812# CONFIG_USB_STORAGE_ALAUDA is not set
813# CONFIG_USB_LIBUSUAL is not set
804 814
805# 815#
806# USB Input Devices 816# USB Input Devices
@@ -823,6 +833,7 @@ CONFIG_USB_STORAGE_JUMPSHOT=y
823# CONFIG_USB_YEALINK is not set 833# CONFIG_USB_YEALINK is not set
824# CONFIG_USB_XPAD is not set 834# CONFIG_USB_XPAD is not set
825# CONFIG_USB_ATI_REMOTE is not set 835# CONFIG_USB_ATI_REMOTE is not set
836# CONFIG_USB_ATI_REMOTE2 is not set
826# CONFIG_USB_KEYSPAN_REMOTE is not set 837# CONFIG_USB_KEYSPAN_REMOTE is not set
827# CONFIG_USB_APPLETOUCH is not set 838# CONFIG_USB_APPLETOUCH is not set
828 839
@@ -906,11 +917,11 @@ CONFIG_EXT2_FS=y
906# CONFIG_EXT2_FS_XATTR is not set 917# CONFIG_EXT2_FS_XATTR is not set
907# CONFIG_EXT2_FS_XIP is not set 918# CONFIG_EXT2_FS_XIP is not set
908# CONFIG_EXT3_FS is not set 919# CONFIG_EXT3_FS is not set
909# CONFIG_JBD is not set
910# CONFIG_REISERFS_FS is not set 920# CONFIG_REISERFS_FS is not set
911# CONFIG_JFS_FS is not set 921# CONFIG_JFS_FS is not set
912# CONFIG_FS_POSIX_ACL is not set 922# CONFIG_FS_POSIX_ACL is not set
913# CONFIG_XFS_FS is not set 923# CONFIG_XFS_FS is not set
924# CONFIG_OCFS2_FS is not set
914# CONFIG_MINIX_FS is not set 925# CONFIG_MINIX_FS is not set
915# CONFIG_ROMFS_FS is not set 926# CONFIG_ROMFS_FS is not set
916CONFIG_INOTIFY=y 927CONFIG_INOTIFY=y
@@ -946,6 +957,7 @@ CONFIG_TMPFS=y
946# CONFIG_HUGETLB_PAGE is not set 957# CONFIG_HUGETLB_PAGE is not set
947CONFIG_RAMFS=y 958CONFIG_RAMFS=y
948# CONFIG_RELAYFS_FS is not set 959# CONFIG_RELAYFS_FS is not set
960# CONFIG_CONFIGFS_FS is not set
949 961
950# 962#
951# Miscellaneous filesystems 963# Miscellaneous filesystems
@@ -1049,18 +1061,20 @@ CONFIG_NLS_DEFAULT="iso8859-1"
1049# Kernel hacking 1061# Kernel hacking
1050# 1062#
1051# CONFIG_PRINTK_TIME is not set 1063# CONFIG_PRINTK_TIME is not set
1052CONFIG_DEBUG_KERNEL=y
1053CONFIG_MAGIC_SYSRQ=y 1064CONFIG_MAGIC_SYSRQ=y
1065CONFIG_DEBUG_KERNEL=y
1054CONFIG_LOG_BUF_SHIFT=14 1066CONFIG_LOG_BUF_SHIFT=14
1055CONFIG_DETECT_SOFTLOCKUP=y 1067CONFIG_DETECT_SOFTLOCKUP=y
1056# CONFIG_SCHEDSTATS is not set 1068# CONFIG_SCHEDSTATS is not set
1057CONFIG_DEBUG_SLAB=y 1069CONFIG_DEBUG_SLAB=y
1070CONFIG_DEBUG_MUTEXES=y
1058# CONFIG_DEBUG_SPINLOCK is not set 1071# CONFIG_DEBUG_SPINLOCK is not set
1059# CONFIG_DEBUG_SPINLOCK_SLEEP is not set 1072# CONFIG_DEBUG_SPINLOCK_SLEEP is not set
1060# CONFIG_DEBUG_KOBJECT is not set 1073# CONFIG_DEBUG_KOBJECT is not set
1061# CONFIG_DEBUG_INFO is not set 1074# CONFIG_DEBUG_INFO is not set
1062# CONFIG_DEBUG_FS is not set 1075# CONFIG_DEBUG_FS is not set
1063# CONFIG_DEBUG_VM is not set 1076# CONFIG_DEBUG_VM is not set
1077CONFIG_FORCED_INLINING=y
1064# CONFIG_RCU_TORTURE_TEST is not set 1078# CONFIG_RCU_TORTURE_TEST is not set
1065CONFIG_CROSSCOMPILE=y 1079CONFIG_CROSSCOMPILE=y
1066CONFIG_CMDLINE="console=ttyS1,38400n8 kgdb=ttyS0 root=/dev/nfs ip=bootp" 1080CONFIG_CMDLINE="console=ttyS1,38400n8 kgdb=ttyS0 root=/dev/nfs ip=bootp"
diff --git a/arch/mips/configs/pnx8550-v2pci_defconfig b/arch/mips/configs/pnx8550-v2pci_defconfig
index 4c650e708133..4187287f0763 100644
--- a/arch/mips/configs/pnx8550-v2pci_defconfig
+++ b/arch/mips/configs/pnx8550-v2pci_defconfig
@@ -1,7 +1,7 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.15-rc2 3# Linux kernel version: 2.6.16-rc1
4# Thu Nov 24 01:06:58 2005 4# Fri Jan 27 15:40:28 2006
5# 5#
6CONFIG_MIPS=y 6CONFIG_MIPS=y
7 7
@@ -152,27 +152,29 @@ CONFIG_SYSVIPC=y
152# CONFIG_BSD_PROCESS_ACCT is not set 152# CONFIG_BSD_PROCESS_ACCT is not set
153CONFIG_SYSCTL=y 153CONFIG_SYSCTL=y
154# CONFIG_AUDIT is not set 154# CONFIG_AUDIT is not set
155# CONFIG_HOTPLUG is not set
156CONFIG_KOBJECT_UEVENT=y
157CONFIG_IKCONFIG=y 155CONFIG_IKCONFIG=y
158CONFIG_IKCONFIG_PROC=y 156CONFIG_IKCONFIG_PROC=y
159CONFIG_INITRAMFS_SOURCE="" 157CONFIG_INITRAMFS_SOURCE=""
158# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
160CONFIG_EMBEDDED=y 159CONFIG_EMBEDDED=y
161CONFIG_KALLSYMS=y 160CONFIG_KALLSYMS=y
162# CONFIG_KALLSYMS_EXTRA_PASS is not set 161# CONFIG_KALLSYMS_EXTRA_PASS is not set
162CONFIG_HOTPLUG=y
163CONFIG_PRINTK=y 163CONFIG_PRINTK=y
164CONFIG_BUG=y 164CONFIG_BUG=y
165CONFIG_ELF_CORE=y
165CONFIG_BASE_FULL=y 166CONFIG_BASE_FULL=y
166CONFIG_FUTEX=y 167CONFIG_FUTEX=y
167CONFIG_EPOLL=y 168CONFIG_EPOLL=y
168# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
169CONFIG_SHMEM=y 169CONFIG_SHMEM=y
170CONFIG_CC_ALIGN_FUNCTIONS=0 170CONFIG_CC_ALIGN_FUNCTIONS=0
171CONFIG_CC_ALIGN_LABELS=0 171CONFIG_CC_ALIGN_LABELS=0
172CONFIG_CC_ALIGN_LOOPS=0 172CONFIG_CC_ALIGN_LOOPS=0
173CONFIG_CC_ALIGN_JUMPS=0 173CONFIG_CC_ALIGN_JUMPS=0
174CONFIG_SLAB=y
174# CONFIG_TINY_SHMEM is not set 175# CONFIG_TINY_SHMEM is not set
175CONFIG_BASE_SMALL=0 176CONFIG_BASE_SMALL=0
177# CONFIG_SLOB is not set
176 178
177# 179#
178# Loadable module support 180# Loadable module support
@@ -279,6 +281,21 @@ CONFIG_NETFILTER=y
279# 281#
280# CONFIG_NETFILTER_NETLINK is not set 282# CONFIG_NETFILTER_NETLINK is not set
281# CONFIG_NF_CONNTRACK is not set 283# CONFIG_NF_CONNTRACK is not set
284CONFIG_NETFILTER_XTABLES=m
285CONFIG_NETFILTER_XT_TARGET_CLASSIFY=m
286CONFIG_NETFILTER_XT_TARGET_MARK=m
287CONFIG_NETFILTER_XT_TARGET_NFQUEUE=m
288CONFIG_NETFILTER_XT_MATCH_COMMENT=m
289CONFIG_NETFILTER_XT_MATCH_DCCP=m
290CONFIG_NETFILTER_XT_MATCH_LENGTH=m
291CONFIG_NETFILTER_XT_MATCH_LIMIT=m
292CONFIG_NETFILTER_XT_MATCH_MAC=m
293CONFIG_NETFILTER_XT_MATCH_MARK=m
294CONFIG_NETFILTER_XT_MATCH_PKTTYPE=m
295CONFIG_NETFILTER_XT_MATCH_REALM=m
296CONFIG_NETFILTER_XT_MATCH_SCTP=m
297CONFIG_NETFILTER_XT_MATCH_STRING=m
298CONFIG_NETFILTER_XT_MATCH_TCPMSS=m
282 299
283# 300#
284# IP: Netfilter Configuration 301# IP: Netfilter Configuration
@@ -312,6 +329,11 @@ CONFIG_NETFILTER=y
312# CONFIG_ATALK is not set 329# CONFIG_ATALK is not set
313# CONFIG_X25 is not set 330# CONFIG_X25 is not set
314# CONFIG_LAPB is not set 331# CONFIG_LAPB is not set
332
333#
334# TIPC Configuration (EXPERIMENTAL)
335#
336# CONFIG_TIPC is not set
315# CONFIG_NET_DIVERT is not set 337# CONFIG_NET_DIVERT is not set
316# CONFIG_ECONET is not set 338# CONFIG_ECONET is not set
317# CONFIG_WAN_ROUTER is not set 339# CONFIG_WAN_ROUTER is not set
@@ -320,6 +342,7 @@ CONFIG_NETFILTER=y
320# QoS and/or fair queueing 342# QoS and/or fair queueing
321# 343#
322# CONFIG_NET_SCHED is not set 344# CONFIG_NET_SCHED is not set
345CONFIG_NET_CLS_ROUTE=y
323 346
324# 347#
325# Network testing 348# Network testing
@@ -339,7 +362,7 @@ CONFIG_NETFILTER=y
339# 362#
340CONFIG_STANDALONE=y 363CONFIG_STANDALONE=y
341CONFIG_PREVENT_FIRMWARE_BUILD=y 364CONFIG_PREVENT_FIRMWARE_BUILD=y
342# CONFIG_FW_LOADER is not set 365CONFIG_FW_LOADER=y
343 366
344# 367#
345# Connector - unified userspace <-> kernelspace linker 368# Connector - unified userspace <-> kernelspace linker
@@ -466,7 +489,7 @@ CONFIG_BLK_DEV_SD=y
466# SCSI Transport Attributes 489# SCSI Transport Attributes
467# 490#
468CONFIG_SCSI_SPI_ATTRS=m 491CONFIG_SCSI_SPI_ATTRS=m
469# CONFIG_SCSI_FC_ATTRS is not set 492CONFIG_SCSI_FC_ATTRS=y
470CONFIG_SCSI_ISCSI_ATTRS=m 493CONFIG_SCSI_ISCSI_ATTRS=m
471# CONFIG_SCSI_SAS_ATTRS is not set 494# CONFIG_SCSI_SAS_ATTRS is not set
472 495
@@ -500,13 +523,7 @@ CONFIG_AIC7XXX_DEBUG_MASK=0
500# CONFIG_SCSI_IPR is not set 523# CONFIG_SCSI_IPR is not set
501# CONFIG_SCSI_QLOGIC_FC is not set 524# CONFIG_SCSI_QLOGIC_FC is not set
502# CONFIG_SCSI_QLOGIC_1280 is not set 525# CONFIG_SCSI_QLOGIC_1280 is not set
503CONFIG_SCSI_QLA2XXX=y 526# CONFIG_SCSI_QLA_FC is not set
504# CONFIG_SCSI_QLA21XX is not set
505# CONFIG_SCSI_QLA22XX is not set
506# CONFIG_SCSI_QLA2300 is not set
507# CONFIG_SCSI_QLA2322 is not set
508# CONFIG_SCSI_QLA6312 is not set
509# CONFIG_SCSI_QLA24XX is not set
510# CONFIG_SCSI_LPFC is not set 527# CONFIG_SCSI_LPFC is not set
511# CONFIG_SCSI_DC395x is not set 528# CONFIG_SCSI_DC395x is not set
512# CONFIG_SCSI_DC390T is not set 529# CONFIG_SCSI_DC390T is not set
@@ -564,6 +581,7 @@ CONFIG_MII=y
564# CONFIG_SUNGEM is not set 581# CONFIG_SUNGEM is not set
565# CONFIG_CASSINI is not set 582# CONFIG_CASSINI is not set
566# CONFIG_NET_VENDOR_3COM is not set 583# CONFIG_NET_VENDOR_3COM is not set
584# CONFIG_DM9000 is not set
567 585
568# 586#
569# Tulip family network device support 587# Tulip family network device support
@@ -607,6 +625,7 @@ CONFIG_8139TOO=y
607# CONFIG_R8169 is not set 625# CONFIG_R8169 is not set
608# CONFIG_SIS190 is not set 626# CONFIG_SIS190 is not set
609# CONFIG_SKGE is not set 627# CONFIG_SKGE is not set
628# CONFIG_SKY2 is not set
610# CONFIG_SK98LIN is not set 629# CONFIG_SK98LIN is not set
611# CONFIG_VIA_VELOCITY is not set 630# CONFIG_VIA_VELOCITY is not set
612# CONFIG_TIGON3 is not set 631# CONFIG_TIGON3 is not set
@@ -721,6 +740,7 @@ CONFIG_SERIAL_NONSTANDARD=y
721# CONFIG_MOXA_SMARTIO is not set 740# CONFIG_MOXA_SMARTIO is not set
722# CONFIG_ISI is not set 741# CONFIG_ISI is not set
723# CONFIG_SYNCLINKMP is not set 742# CONFIG_SYNCLINKMP is not set
743# CONFIG_SYNCLINK_GT is not set
724# CONFIG_N_HDLC is not set 744# CONFIG_N_HDLC is not set
725# CONFIG_RISCOM8 is not set 745# CONFIG_RISCOM8 is not set
726# CONFIG_SPECIALIX is not set 746# CONFIG_SPECIALIX is not set
@@ -737,7 +757,6 @@ CONFIG_SERIAL_NONSTANDARD=y
737# Non-8250 serial port support 757# Non-8250 serial port support
738# 758#
739# CONFIG_SERIAL_IP3106 is not set 759# CONFIG_SERIAL_IP3106 is not set
740# CONFIG_SERIAL_JSM is not set
741CONFIG_UNIX98_PTYS=y 760CONFIG_UNIX98_PTYS=y
742CONFIG_LEGACY_PTYS=y 761CONFIG_LEGACY_PTYS=y
743CONFIG_LEGACY_PTY_COUNT=256 762CONFIG_LEGACY_PTY_COUNT=256
@@ -825,6 +844,12 @@ CONFIG_I2C_ALGOBIT=m
825# CONFIG_I2C_DEBUG_CHIP is not set 844# CONFIG_I2C_DEBUG_CHIP is not set
826 845
827# 846#
847# SPI support
848#
849# CONFIG_SPI is not set
850# CONFIG_SPI_MASTER is not set
851
852#
828# Dallas's 1-wire bus 853# Dallas's 1-wire bus
829# 854#
830# CONFIG_W1 is not set 855# CONFIG_W1 is not set
@@ -863,6 +888,7 @@ CONFIG_HWMON=y
863# CONFIG_SENSORS_SMSC47M1 is not set 888# CONFIG_SENSORS_SMSC47M1 is not set
864# CONFIG_SENSORS_SMSC47B397 is not set 889# CONFIG_SENSORS_SMSC47B397 is not set
865# CONFIG_SENSORS_VIA686A is not set 890# CONFIG_SENSORS_VIA686A is not set
891# CONFIG_SENSORS_VT8231 is not set
866# CONFIG_SENSORS_W83781D is not set 892# CONFIG_SENSORS_W83781D is not set
867# CONFIG_SENSORS_W83792D is not set 893# CONFIG_SENSORS_W83792D is not set
868# CONFIG_SENSORS_W83L785TS is not set 894# CONFIG_SENSORS_W83L785TS is not set
@@ -918,7 +944,6 @@ CONFIG_FB=y
918# CONFIG_FB_3DFX is not set 944# CONFIG_FB_3DFX is not set
919# CONFIG_FB_VOODOO1 is not set 945# CONFIG_FB_VOODOO1 is not set
920# CONFIG_FB_SMIVGX is not set 946# CONFIG_FB_SMIVGX is not set
921# CONFIG_FB_CYBLA is not set
922# CONFIG_FB_TRIDENT is not set 947# CONFIG_FB_TRIDENT is not set
923# CONFIG_FB_VIRTUAL is not set 948# CONFIG_FB_VIRTUAL is not set
924 949
@@ -988,13 +1013,16 @@ CONFIG_USB_STORAGE=y
988# CONFIG_USB_STORAGE_SDDR09 is not set 1013# CONFIG_USB_STORAGE_SDDR09 is not set
989# CONFIG_USB_STORAGE_SDDR55 is not set 1014# CONFIG_USB_STORAGE_SDDR55 is not set
990# CONFIG_USB_STORAGE_JUMPSHOT is not set 1015# CONFIG_USB_STORAGE_JUMPSHOT is not set
1016# CONFIG_USB_STORAGE_ALAUDA is not set
991# CONFIG_USB_STORAGE_ONETOUCH is not set 1017# CONFIG_USB_STORAGE_ONETOUCH is not set
1018# CONFIG_USB_LIBUSUAL is not set
992 1019
993# 1020#
994# USB Input Devices 1021# USB Input Devices
995# 1022#
996CONFIG_USB_HID=y 1023CONFIG_USB_HID=y
997CONFIG_USB_HIDINPUT=y 1024CONFIG_USB_HIDINPUT=y
1025# CONFIG_USB_HIDINPUT_POWERBOOK is not set
998# CONFIG_HID_FF is not set 1026# CONFIG_HID_FF is not set
999CONFIG_USB_HIDDEV=y 1027CONFIG_USB_HIDDEV=y
1000# CONFIG_USB_AIPTEK is not set 1028# CONFIG_USB_AIPTEK is not set
@@ -1008,6 +1036,7 @@ CONFIG_USB_HIDDEV=y
1008# CONFIG_USB_YEALINK is not set 1036# CONFIG_USB_YEALINK is not set
1009# CONFIG_USB_XPAD is not set 1037# CONFIG_USB_XPAD is not set
1010# CONFIG_USB_ATI_REMOTE is not set 1038# CONFIG_USB_ATI_REMOTE is not set
1039# CONFIG_USB_ATI_REMOTE2 is not set
1011# CONFIG_USB_KEYSPAN_REMOTE is not set 1040# CONFIG_USB_KEYSPAN_REMOTE is not set
1012# CONFIG_USB_APPLETOUCH is not set 1041# CONFIG_USB_APPLETOUCH is not set
1013 1042
@@ -1107,6 +1136,7 @@ CONFIG_XFS_EXPORT=y
1107# CONFIG_XFS_SECURITY is not set 1136# CONFIG_XFS_SECURITY is not set
1108# CONFIG_XFS_POSIX_ACL is not set 1137# CONFIG_XFS_POSIX_ACL is not set
1109# CONFIG_XFS_RT is not set 1138# CONFIG_XFS_RT is not set
1139# CONFIG_OCFS2_FS is not set
1110# CONFIG_MINIX_FS is not set 1140# CONFIG_MINIX_FS is not set
1111# CONFIG_ROMFS_FS is not set 1141# CONFIG_ROMFS_FS is not set
1112CONFIG_INOTIFY=y 1142CONFIG_INOTIFY=y
@@ -1142,6 +1172,7 @@ CONFIG_TMPFS=y
1142# CONFIG_HUGETLB_PAGE is not set 1172# CONFIG_HUGETLB_PAGE is not set
1143CONFIG_RAMFS=y 1173CONFIG_RAMFS=y
1144# CONFIG_RELAYFS_FS is not set 1174# CONFIG_RELAYFS_FS is not set
1175# CONFIG_CONFIGFS_FS is not set
1145 1176
1146# 1177#
1147# Miscellaneous filesystems 1178# Miscellaneous filesystems
@@ -1246,6 +1277,7 @@ CONFIG_NLS_DEFAULT="iso8859-1"
1246# Kernel hacking 1277# Kernel hacking
1247# 1278#
1248# CONFIG_PRINTK_TIME is not set 1279# CONFIG_PRINTK_TIME is not set
1280# CONFIG_MAGIC_SYSRQ is not set
1249# CONFIG_DEBUG_KERNEL is not set 1281# CONFIG_DEBUG_KERNEL is not set
1250CONFIG_LOG_BUF_SHIFT=14 1282CONFIG_LOG_BUF_SHIFT=14
1251CONFIG_CROSSCOMPILE=y 1283CONFIG_CROSSCOMPILE=y
@@ -1299,3 +1331,7 @@ CONFIG_CRC32=y
1299CONFIG_LIBCRC32C=m 1331CONFIG_LIBCRC32C=m
1300CONFIG_ZLIB_INFLATE=y 1332CONFIG_ZLIB_INFLATE=y
1301CONFIG_ZLIB_DEFLATE=m 1333CONFIG_ZLIB_DEFLATE=m
1334CONFIG_TEXTSEARCH=y
1335CONFIG_TEXTSEARCH_KMP=m
1336CONFIG_TEXTSEARCH_BM=m
1337CONFIG_TEXTSEARCH_FSM=m
diff --git a/arch/mips/configs/qemu_defconfig b/arch/mips/configs/qemu_defconfig
index c02becab850b..31f5afabafa8 100644
--- a/arch/mips/configs/qemu_defconfig
+++ b/arch/mips/configs/qemu_defconfig
@@ -1,7 +1,7 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.16-rc2 3# Linux kernel version: 2.6.16-rc2
4# Fri Feb 3 17:14:27 2006 4# Sun Feb 12 19:18:55 2006
5# 5#
6CONFIG_MIPS=y 6CONFIG_MIPS=y
7 7
@@ -133,7 +133,6 @@ CONFIG_PREEMPT_NONE=y
133# Code maturity level options 133# Code maturity level options
134# 134#
135# CONFIG_EXPERIMENTAL is not set 135# CONFIG_EXPERIMENTAL is not set
136CONFIG_CLEAN_COMPILE=y
137CONFIG_BROKEN_ON_SMP=y 136CONFIG_BROKEN_ON_SMP=y
138CONFIG_INIT_ENV_ARG_LIMIT=32 137CONFIG_INIT_ENV_ARG_LIMIT=32
139 138
@@ -145,7 +144,7 @@ CONFIG_LOCALVERSION_AUTO=y
145# CONFIG_SWAP is not set 144# CONFIG_SWAP is not set
146# CONFIG_SYSVIPC is not set 145# CONFIG_SYSVIPC is not set
147# CONFIG_BSD_PROCESS_ACCT is not set 146# CONFIG_BSD_PROCESS_ACCT is not set
148# CONFIG_SYSCTL is not set 147CONFIG_SYSCTL=y
149# CONFIG_AUDIT is not set 148# CONFIG_AUDIT is not set
150# CONFIG_IKCONFIG is not set 149# CONFIG_IKCONFIG is not set
151CONFIG_INITRAMFS_SOURCE="" 150CONFIG_INITRAMFS_SOURCE=""
@@ -222,6 +221,7 @@ CONFIG_NET=y
222# 221#
223# Networking options 222# Networking options
224# 223#
224# CONFIG_NETDEBUG is not set
225CONFIG_PACKET=y 225CONFIG_PACKET=y
226CONFIG_PACKET_MMAP=y 226CONFIG_PACKET_MMAP=y
227CONFIG_UNIX=y 227CONFIG_UNIX=y
@@ -476,8 +476,9 @@ CONFIG_SERIAL_8250_RUNTIME_UARTS=4
476# 476#
477CONFIG_SERIAL_CORE=y 477CONFIG_SERIAL_CORE=y
478CONFIG_SERIAL_CORE_CONSOLE=y 478CONFIG_SERIAL_CORE_CONSOLE=y
479# CONFIG_UNIX98_PTYS is not set 479CONFIG_UNIX98_PTYS=y
480# CONFIG_LEGACY_PTYS is not set 480CONFIG_LEGACY_PTYS=y
481CONFIG_LEGACY_PTY_COUNT=256
481 482
482# 483#
483# IPMI 484# IPMI
@@ -627,7 +628,7 @@ CONFIG_FUSE_FS=y
627# 628#
628CONFIG_PROC_FS=y 629CONFIG_PROC_FS=y
629CONFIG_PROC_KCORE=y 630CONFIG_PROC_KCORE=y
630# CONFIG_SYSFS is not set 631CONFIG_SYSFS=y
631# CONFIG_TMPFS is not set 632# CONFIG_TMPFS is not set
632# CONFIG_HUGETLB_PAGE is not set 633# CONFIG_HUGETLB_PAGE is not set
633CONFIG_RAMFS=y 634CONFIG_RAMFS=y
@@ -680,12 +681,13 @@ CONFIG_MSDOS_PARTITION=y
680# CONFIG_DEBUG_KERNEL is not set 681# CONFIG_DEBUG_KERNEL is not set
681CONFIG_LOG_BUF_SHIFT=14 682CONFIG_LOG_BUF_SHIFT=14
682CONFIG_CROSSCOMPILE=y 683CONFIG_CROSSCOMPILE=y
683CONFIG_CMDLINE="console=ttyS0 debug ip=172.20.0.2:172.20.0.1::255.255.0.0" 684CONFIG_CMDLINE=""
684 685
685# 686#
686# Security options 687# Security options
687# 688#
688# CONFIG_KEYS is not set 689# CONFIG_KEYS is not set
690# CONFIG_SECURITY is not set
689 691
690# 692#
691# Cryptographic options 693# Cryptographic options
diff --git a/arch/mips/configs/rbhma4500_defconfig b/arch/mips/configs/rbhma4500_defconfig
index 9aaa43024aec..b126f763cf51 100644
--- a/arch/mips/configs/rbhma4500_defconfig
+++ b/arch/mips/configs/rbhma4500_defconfig
@@ -1,7 +1,7 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.15-rc2 3# Linux kernel version: 2.6.16-rc1
4# Thu Nov 24 01:07:03 2005 4# Fri Jan 27 15:40:30 2006
5# 5#
6CONFIG_MIPS=y 6CONFIG_MIPS=y
7 7
@@ -160,27 +160,30 @@ CONFIG_SYSVIPC=y
160# CONFIG_BSD_PROCESS_ACCT is not set 160# CONFIG_BSD_PROCESS_ACCT is not set
161CONFIG_SYSCTL=y 161CONFIG_SYSCTL=y
162# CONFIG_AUDIT is not set 162# CONFIG_AUDIT is not set
163CONFIG_HOTPLUG=y
164# CONFIG_KOBJECT_UEVENT is not set
165CONFIG_IKCONFIG=y 163CONFIG_IKCONFIG=y
166CONFIG_IKCONFIG_PROC=y 164CONFIG_IKCONFIG_PROC=y
167CONFIG_INITRAMFS_SOURCE="" 165CONFIG_INITRAMFS_SOURCE=""
166# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
168CONFIG_EMBEDDED=y 167CONFIG_EMBEDDED=y
169CONFIG_KALLSYMS=y 168CONFIG_KALLSYMS=y
170# CONFIG_KALLSYMS_EXTRA_PASS is not set 169# CONFIG_KALLSYMS_EXTRA_PASS is not set
170CONFIG_HOTPLUG=y
171CONFIG_PRINTK=y 171CONFIG_PRINTK=y
172CONFIG_BUG=y 172CONFIG_BUG=y
173CONFIG_ELF_CORE=y
173CONFIG_BASE_FULL=y 174CONFIG_BASE_FULL=y
174# CONFIG_FUTEX is not set 175# CONFIG_FUTEX is not set
175# CONFIG_EPOLL is not set 176# CONFIG_EPOLL is not set
176# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
177CONFIG_SHMEM=y 177CONFIG_SHMEM=y
178CONFIG_CC_ALIGN_FUNCTIONS=0 178CONFIG_CC_ALIGN_FUNCTIONS=0
179CONFIG_CC_ALIGN_LABELS=0 179CONFIG_CC_ALIGN_LABELS=0
180CONFIG_CC_ALIGN_LOOPS=0 180CONFIG_CC_ALIGN_LOOPS=0
181CONFIG_CC_ALIGN_JUMPS=0 181CONFIG_CC_ALIGN_JUMPS=0
182CONFIG_SLAB=y
182# CONFIG_TINY_SHMEM is not set 183# CONFIG_TINY_SHMEM is not set
183CONFIG_BASE_SMALL=0 184CONFIG_BASE_SMALL=0
185# CONFIG_SLOB is not set
186CONFIG_OBSOLETE_INTERMODULE=y
184 187
185# 188#
186# Loadable module support 189# Loadable module support
@@ -291,6 +294,21 @@ CONFIG_NETFILTER_NETLINK=m
291CONFIG_NETFILTER_NETLINK_QUEUE=m 294CONFIG_NETFILTER_NETLINK_QUEUE=m
292CONFIG_NETFILTER_NETLINK_LOG=m 295CONFIG_NETFILTER_NETLINK_LOG=m
293# CONFIG_NF_CONNTRACK is not set 296# CONFIG_NF_CONNTRACK is not set
297CONFIG_NETFILTER_XTABLES=m
298CONFIG_NETFILTER_XT_TARGET_CLASSIFY=m
299CONFIG_NETFILTER_XT_TARGET_MARK=m
300CONFIG_NETFILTER_XT_TARGET_NFQUEUE=m
301CONFIG_NETFILTER_XT_MATCH_COMMENT=m
302CONFIG_NETFILTER_XT_MATCH_DCCP=m
303CONFIG_NETFILTER_XT_MATCH_LENGTH=m
304CONFIG_NETFILTER_XT_MATCH_LIMIT=m
305CONFIG_NETFILTER_XT_MATCH_MAC=m
306CONFIG_NETFILTER_XT_MATCH_MARK=m
307CONFIG_NETFILTER_XT_MATCH_PKTTYPE=m
308CONFIG_NETFILTER_XT_MATCH_REALM=m
309CONFIG_NETFILTER_XT_MATCH_SCTP=m
310CONFIG_NETFILTER_XT_MATCH_STRING=m
311CONFIG_NETFILTER_XT_MATCH_TCPMSS=m
294 312
295# 313#
296# IP: Netfilter Configuration 314# IP: Netfilter Configuration
@@ -324,6 +342,11 @@ CONFIG_NETFILTER_NETLINK_LOG=m
324# CONFIG_ATALK is not set 342# CONFIG_ATALK is not set
325# CONFIG_X25 is not set 343# CONFIG_X25 is not set
326# CONFIG_LAPB is not set 344# CONFIG_LAPB is not set
345
346#
347# TIPC Configuration (EXPERIMENTAL)
348#
349# CONFIG_TIPC is not set
327# CONFIG_NET_DIVERT is not set 350# CONFIG_NET_DIVERT is not set
328# CONFIG_ECONET is not set 351# CONFIG_ECONET is not set
329# CONFIG_WAN_ROUTER is not set 352# CONFIG_WAN_ROUTER is not set
@@ -332,6 +355,7 @@ CONFIG_NETFILTER_NETLINK_LOG=m
332# QoS and/or fair queueing 355# QoS and/or fair queueing
333# 356#
334# CONFIG_NET_SCHED is not set 357# CONFIG_NET_SCHED is not set
358CONFIG_NET_CLS_ROUTE=y
335 359
336# 360#
337# Network testing 361# Network testing
@@ -407,6 +431,7 @@ CONFIG_MTD_CFI_UTIL=y
407# CONFIG_MTD_RAM is not set 431# CONFIG_MTD_RAM is not set
408# CONFIG_MTD_ROM is not set 432# CONFIG_MTD_ROM is not set
409# CONFIG_MTD_ABSENT is not set 433# CONFIG_MTD_ABSENT is not set
434# CONFIG_MTD_OBSOLETE_CHIPS is not set
410 435
411# 436#
412# Mapping drivers for chip access 437# Mapping drivers for chip access
@@ -598,6 +623,7 @@ CONFIG_NET_ETHERNET=y
598# CONFIG_CASSINI is not set 623# CONFIG_CASSINI is not set
599# CONFIG_NET_VENDOR_3COM is not set 624# CONFIG_NET_VENDOR_3COM is not set
600# CONFIG_NET_VENDOR_SMC is not set 625# CONFIG_NET_VENDOR_SMC is not set
626# CONFIG_DM9000 is not set
601# CONFIG_NET_VENDOR_RACAL is not set 627# CONFIG_NET_VENDOR_RACAL is not set
602 628
603# 629#
@@ -654,6 +680,7 @@ CONFIG_NET_PCI=y
654# CONFIG_R8169 is not set 680# CONFIG_R8169 is not set
655# CONFIG_SIS190 is not set 681# CONFIG_SIS190 is not set
656# CONFIG_SKGE is not set 682# CONFIG_SKGE is not set
683# CONFIG_SKY2 is not set
657# CONFIG_SK98LIN is not set 684# CONFIG_SK98LIN is not set
658# CONFIG_VIA_VELOCITY is not set 685# CONFIG_VIA_VELOCITY is not set
659# CONFIG_TIGON3 is not set 686# CONFIG_TIGON3 is not set
@@ -687,8 +714,8 @@ CONFIG_NET_RADIO=y
687# Wireless 802.11b ISA/PCI cards support 714# Wireless 802.11b ISA/PCI cards support
688# 715#
689# CONFIG_IPW2100 is not set 716# CONFIG_IPW2100 is not set
690# CONFIG_IPW_DEBUG is not set
691CONFIG_IPW2200=m 717CONFIG_IPW2200=m
718# CONFIG_IPW2200_DEBUG is not set
692# CONFIG_HERMES is not set 719# CONFIG_HERMES is not set
693# CONFIG_ATMEL is not set 720# CONFIG_ATMEL is not set
694 721
@@ -795,7 +822,6 @@ CONFIG_HW_CONSOLE=y
795# Non-8250 serial port support 822# Non-8250 serial port support
796# 823#
797CONFIG_HAS_TXX9_SERIAL=y 824CONFIG_HAS_TXX9_SERIAL=y
798# CONFIG_SERIAL_JSM is not set
799CONFIG_UNIX98_PTYS=y 825CONFIG_UNIX98_PTYS=y
800CONFIG_LEGACY_PTYS=y 826CONFIG_LEGACY_PTYS=y
801CONFIG_LEGACY_PTY_COUNT=256 827CONFIG_LEGACY_PTY_COUNT=256
@@ -833,6 +859,12 @@ CONFIG_LEGACY_PTY_COUNT=256
833# CONFIG_I2C is not set 859# CONFIG_I2C is not set
834 860
835# 861#
862# SPI support
863#
864# CONFIG_SPI is not set
865# CONFIG_SPI_MASTER is not set
866
867#
836# Dallas's 1-wire bus 868# Dallas's 1-wire bus
837# 869#
838# CONFIG_W1 is not set 870# CONFIG_W1 is not set
@@ -887,7 +919,6 @@ CONFIG_FB_CFB_IMAGEBLIT=y
887CONFIG_FB_ATY=y 919CONFIG_FB_ATY=y
888CONFIG_FB_ATY_CT=y 920CONFIG_FB_ATY_CT=y
889# CONFIG_FB_ATY_GENERIC_LCD is not set 921# CONFIG_FB_ATY_GENERIC_LCD is not set
890# CONFIG_FB_ATY_XL_INIT is not set
891# CONFIG_FB_ATY_GX is not set 922# CONFIG_FB_ATY_GX is not set
892# CONFIG_FB_SAVAGE is not set 923# CONFIG_FB_SAVAGE is not set
893# CONFIG_FB_SIS is not set 924# CONFIG_FB_SIS is not set
@@ -896,7 +927,6 @@ CONFIG_FB_ATY_CT=y
896# CONFIG_FB_3DFX is not set 927# CONFIG_FB_3DFX is not set
897# CONFIG_FB_VOODOO1 is not set 928# CONFIG_FB_VOODOO1 is not set
898# CONFIG_FB_SMIVGX is not set 929# CONFIG_FB_SMIVGX is not set
899# CONFIG_FB_CYBLA is not set
900# CONFIG_FB_TRIDENT is not set 930# CONFIG_FB_TRIDENT is not set
901# CONFIG_FB_VIRTUAL is not set 931# CONFIG_FB_VIRTUAL is not set
902 932
@@ -958,12 +988,14 @@ CONFIG_USB=y
958# may also be needed; see USB_STORAGE Help for more information 988# may also be needed; see USB_STORAGE Help for more information
959# 989#
960# CONFIG_USB_STORAGE is not set 990# CONFIG_USB_STORAGE is not set
991# CONFIG_USB_LIBUSUAL is not set
961 992
962# 993#
963# USB Input Devices 994# USB Input Devices
964# 995#
965CONFIG_USB_HID=y 996CONFIG_USB_HID=y
966CONFIG_USB_HIDINPUT=y 997CONFIG_USB_HIDINPUT=y
998# CONFIG_USB_HIDINPUT_POWERBOOK is not set
967# CONFIG_HID_FF is not set 999# CONFIG_HID_FF is not set
968CONFIG_USB_HIDDEV=y 1000CONFIG_USB_HIDDEV=y
969# CONFIG_USB_AIPTEK is not set 1001# CONFIG_USB_AIPTEK is not set
@@ -977,6 +1009,7 @@ CONFIG_USB_HIDDEV=y
977CONFIG_USB_YEALINK=m 1009CONFIG_USB_YEALINK=m
978# CONFIG_USB_XPAD is not set 1010# CONFIG_USB_XPAD is not set
979# CONFIG_USB_ATI_REMOTE is not set 1011# CONFIG_USB_ATI_REMOTE is not set
1012# CONFIG_USB_ATI_REMOTE2 is not set
980# CONFIG_USB_KEYSPAN_REMOTE is not set 1013# CONFIG_USB_KEYSPAN_REMOTE is not set
981# CONFIG_USB_APPLETOUCH is not set 1014# CONFIG_USB_APPLETOUCH is not set
982 1015
@@ -1078,6 +1111,7 @@ CONFIG_XFS_EXPORT=y
1078# CONFIG_XFS_SECURITY is not set 1111# CONFIG_XFS_SECURITY is not set
1079# CONFIG_XFS_POSIX_ACL is not set 1112# CONFIG_XFS_POSIX_ACL is not set
1080# CONFIG_XFS_RT is not set 1113# CONFIG_XFS_RT is not set
1114# CONFIG_OCFS2_FS is not set
1081# CONFIG_MINIX_FS is not set 1115# CONFIG_MINIX_FS is not set
1082# CONFIG_ROMFS_FS is not set 1116# CONFIG_ROMFS_FS is not set
1083CONFIG_INOTIFY=y 1117CONFIG_INOTIFY=y
@@ -1115,6 +1149,7 @@ CONFIG_TMPFS=y
1115# CONFIG_HUGETLB_PAGE is not set 1149# CONFIG_HUGETLB_PAGE is not set
1116CONFIG_RAMFS=y 1150CONFIG_RAMFS=y
1117CONFIG_RELAYFS_FS=m 1151CONFIG_RELAYFS_FS=m
1152# CONFIG_CONFIGFS_FS is not set
1118 1153
1119# 1154#
1120# Miscellaneous filesystems 1155# Miscellaneous filesystems
@@ -1228,6 +1263,7 @@ CONFIG_NLS_DEFAULT="iso8859-1"
1228# Kernel hacking 1263# Kernel hacking
1229# 1264#
1230# CONFIG_PRINTK_TIME is not set 1265# CONFIG_PRINTK_TIME is not set
1266# CONFIG_MAGIC_SYSRQ is not set
1231# CONFIG_DEBUG_KERNEL is not set 1267# CONFIG_DEBUG_KERNEL is not set
1232CONFIG_LOG_BUF_SHIFT=14 1268CONFIG_LOG_BUF_SHIFT=14
1233CONFIG_CROSSCOMPILE=y 1269CONFIG_CROSSCOMPILE=y
@@ -1281,3 +1317,7 @@ CONFIG_CRC32=y
1281CONFIG_LIBCRC32C=m 1317CONFIG_LIBCRC32C=m
1282CONFIG_ZLIB_INFLATE=y 1318CONFIG_ZLIB_INFLATE=y
1283CONFIG_ZLIB_DEFLATE=y 1319CONFIG_ZLIB_DEFLATE=y
1320CONFIG_TEXTSEARCH=y
1321CONFIG_TEXTSEARCH_KMP=m
1322CONFIG_TEXTSEARCH_BM=m
1323CONFIG_TEXTSEARCH_FSM=m
diff --git a/arch/mips/configs/rm200_defconfig b/arch/mips/configs/rm200_defconfig
index abf61095931e..463ed3dbf6ae 100644
--- a/arch/mips/configs/rm200_defconfig
+++ b/arch/mips/configs/rm200_defconfig
@@ -1,7 +1,7 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.15-rc2 3# Linux kernel version: 2.6.16-rc1
4# Thu Nov 24 01:07:06 2005 4# Fri Jan 27 15:40:31 2006
5# 5#
6CONFIG_MIPS=y 6CONFIG_MIPS=y
7 7
@@ -161,27 +161,29 @@ CONFIG_BSD_PROCESS_ACCT=y
161# CONFIG_BSD_PROCESS_ACCT_V3 is not set 161# CONFIG_BSD_PROCESS_ACCT_V3 is not set
162CONFIG_SYSCTL=y 162CONFIG_SYSCTL=y
163# CONFIG_AUDIT is not set 163# CONFIG_AUDIT is not set
164CONFIG_HOTPLUG=y
165CONFIG_KOBJECT_UEVENT=y
166CONFIG_IKCONFIG=y 164CONFIG_IKCONFIG=y
167CONFIG_IKCONFIG_PROC=y 165CONFIG_IKCONFIG_PROC=y
168CONFIG_INITRAMFS_SOURCE="" 166CONFIG_INITRAMFS_SOURCE=""
167# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
169CONFIG_EMBEDDED=y 168CONFIG_EMBEDDED=y
170CONFIG_KALLSYMS=y 169CONFIG_KALLSYMS=y
171# CONFIG_KALLSYMS_EXTRA_PASS is not set 170# CONFIG_KALLSYMS_EXTRA_PASS is not set
171CONFIG_HOTPLUG=y
172CONFIG_PRINTK=y 172CONFIG_PRINTK=y
173CONFIG_BUG=y 173CONFIG_BUG=y
174CONFIG_ELF_CORE=y
174CONFIG_BASE_FULL=y 175CONFIG_BASE_FULL=y
175CONFIG_FUTEX=y 176CONFIG_FUTEX=y
176CONFIG_EPOLL=y 177CONFIG_EPOLL=y
177# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
178CONFIG_SHMEM=y 178CONFIG_SHMEM=y
179CONFIG_CC_ALIGN_FUNCTIONS=0 179CONFIG_CC_ALIGN_FUNCTIONS=0
180CONFIG_CC_ALIGN_LABELS=0 180CONFIG_CC_ALIGN_LABELS=0
181CONFIG_CC_ALIGN_LOOPS=0 181CONFIG_CC_ALIGN_LOOPS=0
182CONFIG_CC_ALIGN_JUMPS=0 182CONFIG_CC_ALIGN_JUMPS=0
183CONFIG_SLAB=y
183# CONFIG_TINY_SHMEM is not set 184# CONFIG_TINY_SHMEM is not set
184CONFIG_BASE_SMALL=0 185CONFIG_BASE_SMALL=0
186# CONFIG_SLOB is not set
185 187
186# 188#
187# Loadable module support 189# Loadable module support
@@ -297,6 +299,28 @@ CONFIG_BRIDGE_NETFILTER=y
297CONFIG_NETFILTER_NETLINK=m 299CONFIG_NETFILTER_NETLINK=m
298CONFIG_NETFILTER_NETLINK_QUEUE=m 300CONFIG_NETFILTER_NETLINK_QUEUE=m
299CONFIG_NETFILTER_NETLINK_LOG=m 301CONFIG_NETFILTER_NETLINK_LOG=m
302CONFIG_NETFILTER_XTABLES=m
303CONFIG_NETFILTER_XT_TARGET_CLASSIFY=m
304CONFIG_NETFILTER_XT_TARGET_CONNMARK=m
305CONFIG_NETFILTER_XT_TARGET_MARK=m
306CONFIG_NETFILTER_XT_TARGET_NFQUEUE=m
307CONFIG_NETFILTER_XT_TARGET_NOTRACK=m
308CONFIG_NETFILTER_XT_MATCH_COMMENT=m
309CONFIG_NETFILTER_XT_MATCH_CONNMARK=m
310CONFIG_NETFILTER_XT_MATCH_CONNTRACK=m
311CONFIG_NETFILTER_XT_MATCH_DCCP=m
312CONFIG_NETFILTER_XT_MATCH_HELPER=m
313CONFIG_NETFILTER_XT_MATCH_LENGTH=m
314CONFIG_NETFILTER_XT_MATCH_LIMIT=m
315CONFIG_NETFILTER_XT_MATCH_MAC=m
316CONFIG_NETFILTER_XT_MATCH_MARK=m
317CONFIG_NETFILTER_XT_MATCH_PHYSDEV=m
318CONFIG_NETFILTER_XT_MATCH_PKTTYPE=m
319CONFIG_NETFILTER_XT_MATCH_REALM=m
320CONFIG_NETFILTER_XT_MATCH_SCTP=m
321CONFIG_NETFILTER_XT_MATCH_STATE=m
322CONFIG_NETFILTER_XT_MATCH_STRING=m
323CONFIG_NETFILTER_XT_MATCH_TCPMSS=m
300 324
301# 325#
302# IP: Netfilter Configuration 326# IP: Netfilter Configuration
@@ -315,39 +339,23 @@ CONFIG_IP_NF_AMANDA=m
315CONFIG_IP_NF_PPTP=m 339CONFIG_IP_NF_PPTP=m
316CONFIG_IP_NF_QUEUE=m 340CONFIG_IP_NF_QUEUE=m
317CONFIG_IP_NF_IPTABLES=m 341CONFIG_IP_NF_IPTABLES=m
318CONFIG_IP_NF_MATCH_LIMIT=m
319CONFIG_IP_NF_MATCH_IPRANGE=m 342CONFIG_IP_NF_MATCH_IPRANGE=m
320CONFIG_IP_NF_MATCH_MAC=m
321CONFIG_IP_NF_MATCH_PKTTYPE=m
322CONFIG_IP_NF_MATCH_MARK=m
323CONFIG_IP_NF_MATCH_MULTIPORT=m 343CONFIG_IP_NF_MATCH_MULTIPORT=m
324CONFIG_IP_NF_MATCH_TOS=m 344CONFIG_IP_NF_MATCH_TOS=m
325CONFIG_IP_NF_MATCH_RECENT=m 345CONFIG_IP_NF_MATCH_RECENT=m
326CONFIG_IP_NF_MATCH_ECN=m 346CONFIG_IP_NF_MATCH_ECN=m
327CONFIG_IP_NF_MATCH_DSCP=m 347CONFIG_IP_NF_MATCH_DSCP=m
328CONFIG_IP_NF_MATCH_AH_ESP=m 348CONFIG_IP_NF_MATCH_AH_ESP=m
329CONFIG_IP_NF_MATCH_LENGTH=m
330CONFIG_IP_NF_MATCH_TTL=m 349CONFIG_IP_NF_MATCH_TTL=m
331CONFIG_IP_NF_MATCH_TCPMSS=m
332CONFIG_IP_NF_MATCH_HELPER=m
333CONFIG_IP_NF_MATCH_STATE=m
334CONFIG_IP_NF_MATCH_CONNTRACK=m
335CONFIG_IP_NF_MATCH_OWNER=m 350CONFIG_IP_NF_MATCH_OWNER=m
336CONFIG_IP_NF_MATCH_PHYSDEV=m
337CONFIG_IP_NF_MATCH_ADDRTYPE=m 351CONFIG_IP_NF_MATCH_ADDRTYPE=m
338CONFIG_IP_NF_MATCH_REALM=m
339CONFIG_IP_NF_MATCH_SCTP=m
340CONFIG_IP_NF_MATCH_DCCP=m
341CONFIG_IP_NF_MATCH_COMMENT=m
342CONFIG_IP_NF_MATCH_CONNMARK=m
343CONFIG_IP_NF_MATCH_HASHLIMIT=m 352CONFIG_IP_NF_MATCH_HASHLIMIT=m
344CONFIG_IP_NF_MATCH_STRING=m 353CONFIG_IP_NF_MATCH_POLICY=m
345CONFIG_IP_NF_FILTER=m 354CONFIG_IP_NF_FILTER=m
346CONFIG_IP_NF_TARGET_REJECT=m 355CONFIG_IP_NF_TARGET_REJECT=m
347CONFIG_IP_NF_TARGET_LOG=m 356CONFIG_IP_NF_TARGET_LOG=m
348CONFIG_IP_NF_TARGET_ULOG=m 357CONFIG_IP_NF_TARGET_ULOG=m
349CONFIG_IP_NF_TARGET_TCPMSS=m 358CONFIG_IP_NF_TARGET_TCPMSS=m
350CONFIG_IP_NF_TARGET_NFQUEUE=m
351CONFIG_IP_NF_NAT=m 359CONFIG_IP_NF_NAT=m
352CONFIG_IP_NF_NAT_NEEDED=y 360CONFIG_IP_NF_NAT_NEEDED=y
353CONFIG_IP_NF_TARGET_MASQUERADE=m 361CONFIG_IP_NF_TARGET_MASQUERADE=m
@@ -364,13 +372,9 @@ CONFIG_IP_NF_MANGLE=m
364CONFIG_IP_NF_TARGET_TOS=m 372CONFIG_IP_NF_TARGET_TOS=m
365CONFIG_IP_NF_TARGET_ECN=m 373CONFIG_IP_NF_TARGET_ECN=m
366CONFIG_IP_NF_TARGET_DSCP=m 374CONFIG_IP_NF_TARGET_DSCP=m
367CONFIG_IP_NF_TARGET_MARK=m
368CONFIG_IP_NF_TARGET_CLASSIFY=m
369CONFIG_IP_NF_TARGET_TTL=m 375CONFIG_IP_NF_TARGET_TTL=m
370CONFIG_IP_NF_TARGET_CONNMARK=m
371CONFIG_IP_NF_TARGET_CLUSTERIP=m 376CONFIG_IP_NF_TARGET_CLUSTERIP=m
372CONFIG_IP_NF_RAW=m 377CONFIG_IP_NF_RAW=m
373CONFIG_IP_NF_TARGET_NOTRACK=m
374CONFIG_IP_NF_ARPTABLES=m 378CONFIG_IP_NF_ARPTABLES=m
375CONFIG_IP_NF_ARPFILTER=m 379CONFIG_IP_NF_ARPFILTER=m
376CONFIG_IP_NF_ARP_MANGLE=m 380CONFIG_IP_NF_ARP_MANGLE=m
@@ -380,26 +384,20 @@ CONFIG_IP_NF_ARP_MANGLE=m
380# 384#
381CONFIG_IP6_NF_QUEUE=m 385CONFIG_IP6_NF_QUEUE=m
382CONFIG_IP6_NF_IPTABLES=m 386CONFIG_IP6_NF_IPTABLES=m
383CONFIG_IP6_NF_MATCH_LIMIT=m
384CONFIG_IP6_NF_MATCH_MAC=m
385CONFIG_IP6_NF_MATCH_RT=m 387CONFIG_IP6_NF_MATCH_RT=m
386CONFIG_IP6_NF_MATCH_OPTS=m 388CONFIG_IP6_NF_MATCH_OPTS=m
387CONFIG_IP6_NF_MATCH_FRAG=m 389CONFIG_IP6_NF_MATCH_FRAG=m
388CONFIG_IP6_NF_MATCH_HL=m 390CONFIG_IP6_NF_MATCH_HL=m
389CONFIG_IP6_NF_MATCH_MULTIPORT=m 391CONFIG_IP6_NF_MATCH_MULTIPORT=m
390CONFIG_IP6_NF_MATCH_OWNER=m 392CONFIG_IP6_NF_MATCH_OWNER=m
391CONFIG_IP6_NF_MATCH_MARK=m
392CONFIG_IP6_NF_MATCH_IPV6HEADER=m 393CONFIG_IP6_NF_MATCH_IPV6HEADER=m
393CONFIG_IP6_NF_MATCH_AHESP=m 394CONFIG_IP6_NF_MATCH_AHESP=m
394CONFIG_IP6_NF_MATCH_LENGTH=m
395CONFIG_IP6_NF_MATCH_EUI64=m 395CONFIG_IP6_NF_MATCH_EUI64=m
396CONFIG_IP6_NF_MATCH_PHYSDEV=m 396CONFIG_IP6_NF_MATCH_POLICY=m
397CONFIG_IP6_NF_FILTER=m 397CONFIG_IP6_NF_FILTER=m
398CONFIG_IP6_NF_TARGET_LOG=m 398CONFIG_IP6_NF_TARGET_LOG=m
399CONFIG_IP6_NF_TARGET_REJECT=m 399CONFIG_IP6_NF_TARGET_REJECT=m
400CONFIG_IP6_NF_TARGET_NFQUEUE=m
401CONFIG_IP6_NF_MANGLE=m 400CONFIG_IP6_NF_MANGLE=m
402CONFIG_IP6_NF_TARGET_MARK=m
403CONFIG_IP6_NF_TARGET_HL=m 401CONFIG_IP6_NF_TARGET_HL=m
404CONFIG_IP6_NF_RAW=m 402CONFIG_IP6_NF_RAW=m
405 403
@@ -451,6 +449,11 @@ CONFIG_DECNET=m
451# CONFIG_ATALK is not set 449# CONFIG_ATALK is not set
452# CONFIG_X25 is not set 450# CONFIG_X25 is not set
453# CONFIG_LAPB is not set 451# CONFIG_LAPB is not set
452
453#
454# TIPC Configuration (EXPERIMENTAL)
455#
456# CONFIG_TIPC is not set
454# CONFIG_NET_DIVERT is not set 457# CONFIG_NET_DIVERT is not set
455# CONFIG_ECONET is not set 458# CONFIG_ECONET is not set
456# CONFIG_WAN_ROUTER is not set 459# CONFIG_WAN_ROUTER is not set
@@ -530,7 +533,6 @@ CONFIG_IEEE80211=m
530# CONFIG_IEEE80211_DEBUG is not set 533# CONFIG_IEEE80211_DEBUG is not set
531CONFIG_IEEE80211_CRYPT_WEP=m 534CONFIG_IEEE80211_CRYPT_WEP=m
532CONFIG_IEEE80211_CRYPT_CCMP=m 535CONFIG_IEEE80211_CRYPT_CCMP=m
533CONFIG_IEEE80211_CRYPT_TKIP=m
534 536
535# 537#
536# Device Drivers 538# Device Drivers
@@ -541,7 +543,7 @@ CONFIG_IEEE80211_CRYPT_TKIP=m
541# 543#
542CONFIG_STANDALONE=y 544CONFIG_STANDALONE=y
543CONFIG_PREVENT_FIRMWARE_BUILD=y 545CONFIG_PREVENT_FIRMWARE_BUILD=y
544CONFIG_FW_LOADER=m 546CONFIG_FW_LOADER=y
545 547
546# 548#
547# Connector - unified userspace <-> kernelspace linker 549# Connector - unified userspace <-> kernelspace linker
@@ -657,7 +659,7 @@ CONFIG_SCSI_CONSTANTS=y
657# SCSI Transport Attributes 659# SCSI Transport Attributes
658# 660#
659CONFIG_SCSI_SPI_ATTRS=y 661CONFIG_SCSI_SPI_ATTRS=y
660# CONFIG_SCSI_FC_ATTRS is not set 662CONFIG_SCSI_FC_ATTRS=y
661CONFIG_SCSI_ISCSI_ATTRS=m 663CONFIG_SCSI_ISCSI_ATTRS=m
662CONFIG_SCSI_SAS_ATTRS=m 664CONFIG_SCSI_SAS_ATTRS=m
663 665
@@ -678,6 +680,7 @@ CONFIG_ISCSI_TCP=m
678CONFIG_MEGARAID_NEWGEN=y 680CONFIG_MEGARAID_NEWGEN=y
679CONFIG_MEGARAID_MM=m 681CONFIG_MEGARAID_MM=m
680CONFIG_MEGARAID_MAILBOX=m 682CONFIG_MEGARAID_MAILBOX=m
683# CONFIG_MEGARAID_LEGACY is not set
681# CONFIG_MEGARAID_SAS is not set 684# CONFIG_MEGARAID_SAS is not set
682# CONFIG_SCSI_SATA is not set 685# CONFIG_SCSI_SATA is not set
683# CONFIG_SCSI_DMX3191D is not set 686# CONFIG_SCSI_DMX3191D is not set
@@ -704,13 +707,7 @@ CONFIG_SCSI_SYM53C8XX_MAX_TAGS=64
704# CONFIG_SCSI_QLOGIC_FAS is not set 707# CONFIG_SCSI_QLOGIC_FAS is not set
705# CONFIG_SCSI_QLOGIC_FC is not set 708# CONFIG_SCSI_QLOGIC_FC is not set
706# CONFIG_SCSI_QLOGIC_1280 is not set 709# CONFIG_SCSI_QLOGIC_1280 is not set
707CONFIG_SCSI_QLA2XXX=y 710# CONFIG_SCSI_QLA_FC is not set
708# CONFIG_SCSI_QLA21XX is not set
709# CONFIG_SCSI_QLA22XX is not set
710# CONFIG_SCSI_QLA2300 is not set
711# CONFIG_SCSI_QLA2322 is not set
712# CONFIG_SCSI_QLA6312 is not set
713# CONFIG_SCSI_QLA24XX is not set
714# CONFIG_SCSI_LPFC is not set 711# CONFIG_SCSI_LPFC is not set
715# CONFIG_SCSI_SYM53C416 is not set 712# CONFIG_SCSI_SYM53C416 is not set
716# CONFIG_SCSI_DC395x is not set 713# CONFIG_SCSI_DC395x is not set
@@ -801,6 +798,7 @@ CONFIG_MII=y
801# CONFIG_CASSINI is not set 798# CONFIG_CASSINI is not set
802# CONFIG_NET_VENDOR_3COM is not set 799# CONFIG_NET_VENDOR_3COM is not set
803# CONFIG_NET_VENDOR_SMC is not set 800# CONFIG_NET_VENDOR_SMC is not set
801# CONFIG_DM9000 is not set
804# CONFIG_NET_VENDOR_RACAL is not set 802# CONFIG_NET_VENDOR_RACAL is not set
805 803
806# 804#
@@ -858,6 +856,7 @@ CONFIG_EEPRO100=m
858# CONFIG_R8169 is not set 856# CONFIG_R8169 is not set
859# CONFIG_SIS190 is not set 857# CONFIG_SIS190 is not set
860# CONFIG_SKGE is not set 858# CONFIG_SKGE is not set
859# CONFIG_SKY2 is not set
861# CONFIG_SK98LIN is not set 860# CONFIG_SK98LIN is not set
862CONFIG_VIA_VELOCITY=m 861CONFIG_VIA_VELOCITY=m
863# CONFIG_TIGON3 is not set 862# CONFIG_TIGON3 is not set
@@ -879,8 +878,6 @@ CONFIG_VIA_VELOCITY=m
879# Wireless LAN (non-hamradio) 878# Wireless LAN (non-hamradio)
880# 879#
881# CONFIG_NET_RADIO is not set 880# CONFIG_NET_RADIO is not set
882# CONFIG_IPW_DEBUG is not set
883CONFIG_IPW2200=m
884 881
885# 882#
886# Wan interfaces 883# Wan interfaces
@@ -969,6 +966,7 @@ CONFIG_HW_CONSOLE=y
969# 966#
970CONFIG_SERIAL_8250=m 967CONFIG_SERIAL_8250=m
971CONFIG_SERIAL_8250_NR_UARTS=4 968CONFIG_SERIAL_8250_NR_UARTS=4
969CONFIG_SERIAL_8250_RUNTIME_UARTS=4
972CONFIG_SERIAL_8250_EXTENDED=y 970CONFIG_SERIAL_8250_EXTENDED=y
973# CONFIG_SERIAL_8250_MANY_PORTS is not set 971# CONFIG_SERIAL_8250_MANY_PORTS is not set
974CONFIG_SERIAL_8250_SHARE_IRQ=y 972CONFIG_SERIAL_8250_SHARE_IRQ=y
@@ -979,7 +977,6 @@ CONFIG_SERIAL_8250_RSA=y
979# Non-8250 serial port support 977# Non-8250 serial port support
980# 978#
981CONFIG_SERIAL_CORE=m 979CONFIG_SERIAL_CORE=m
982# CONFIG_SERIAL_JSM is not set
983CONFIG_UNIX98_PTYS=y 980CONFIG_UNIX98_PTYS=y
984CONFIG_LEGACY_PTYS=y 981CONFIG_LEGACY_PTYS=y
985CONFIG_LEGACY_PTY_COUNT=256 982CONFIG_LEGACY_PTY_COUNT=256
@@ -1021,6 +1018,12 @@ CONFIG_RTC=m
1021# CONFIG_I2C is not set 1018# CONFIG_I2C is not set
1022 1019
1023# 1020#
1021# SPI support
1022#
1023# CONFIG_SPI is not set
1024# CONFIG_SPI_MASTER is not set
1025
1026#
1024# Dallas's 1-wire bus 1027# Dallas's 1-wire bus
1025# 1028#
1026CONFIG_W1=m 1029CONFIG_W1=m
@@ -1123,12 +1126,15 @@ CONFIG_USB_STORAGE_DPCM=y
1123CONFIG_USB_STORAGE_SDDR09=y 1126CONFIG_USB_STORAGE_SDDR09=y
1124CONFIG_USB_STORAGE_SDDR55=y 1127CONFIG_USB_STORAGE_SDDR55=y
1125CONFIG_USB_STORAGE_JUMPSHOT=y 1128CONFIG_USB_STORAGE_JUMPSHOT=y
1129# CONFIG_USB_STORAGE_ALAUDA is not set
1130# CONFIG_USB_LIBUSUAL is not set
1126 1131
1127# 1132#
1128# USB Input Devices 1133# USB Input Devices
1129# 1134#
1130CONFIG_USB_HID=m 1135CONFIG_USB_HID=m
1131CONFIG_USB_HIDINPUT=y 1136CONFIG_USB_HIDINPUT=y
1137# CONFIG_USB_HIDINPUT_POWERBOOK is not set
1132CONFIG_HID_FF=y 1138CONFIG_HID_FF=y
1133CONFIG_HID_PID=y 1139CONFIG_HID_PID=y
1134CONFIG_LOGITECH_FF=y 1140CONFIG_LOGITECH_FF=y
@@ -1151,6 +1157,7 @@ CONFIG_USB_EGALAX=m
1151CONFIG_USB_YEALINK=m 1157CONFIG_USB_YEALINK=m
1152CONFIG_USB_XPAD=m 1158CONFIG_USB_XPAD=m
1153# CONFIG_USB_ATI_REMOTE is not set 1159# CONFIG_USB_ATI_REMOTE is not set
1160# CONFIG_USB_ATI_REMOTE2 is not set
1154# CONFIG_USB_KEYSPAN_REMOTE is not set 1161# CONFIG_USB_KEYSPAN_REMOTE is not set
1155# CONFIG_USB_APPLETOUCH is not set 1162# CONFIG_USB_APPLETOUCH is not set
1156 1163
@@ -1309,6 +1316,7 @@ CONFIG_XFS_QUOTA=y
1309CONFIG_XFS_SECURITY=y 1316CONFIG_XFS_SECURITY=y
1310# CONFIG_XFS_POSIX_ACL is not set 1317# CONFIG_XFS_POSIX_ACL is not set
1311# CONFIG_XFS_RT is not set 1318# CONFIG_XFS_RT is not set
1319# CONFIG_OCFS2_FS is not set
1312CONFIG_MINIX_FS=m 1320CONFIG_MINIX_FS=m
1313CONFIG_ROMFS_FS=m 1321CONFIG_ROMFS_FS=m
1314CONFIG_INOTIFY=y 1322CONFIG_INOTIFY=y
@@ -1351,6 +1359,7 @@ CONFIG_SYSFS=y
1351# CONFIG_HUGETLB_PAGE is not set 1359# CONFIG_HUGETLB_PAGE is not set
1352CONFIG_RAMFS=y 1360CONFIG_RAMFS=y
1353CONFIG_RELAYFS_FS=m 1361CONFIG_RELAYFS_FS=m
1362# CONFIG_CONFIGFS_FS is not set
1354 1363
1355# 1364#
1356# Miscellaneous filesystems 1365# Miscellaneous filesystems
@@ -1432,6 +1441,7 @@ CONFIG_MSDOS_PARTITION=y
1432# CONFIG_SGI_PARTITION is not set 1441# CONFIG_SGI_PARTITION is not set
1433# CONFIG_ULTRIX_PARTITION is not set 1442# CONFIG_ULTRIX_PARTITION is not set
1434# CONFIG_SUN_PARTITION is not set 1443# CONFIG_SUN_PARTITION is not set
1444# CONFIG_KARMA_PARTITION is not set
1435# CONFIG_EFI_PARTITION is not set 1445# CONFIG_EFI_PARTITION is not set
1436 1446
1437# 1447#
@@ -1487,6 +1497,7 @@ CONFIG_NLS_UTF8=m
1487# Kernel hacking 1497# Kernel hacking
1488# 1498#
1489# CONFIG_PRINTK_TIME is not set 1499# CONFIG_PRINTK_TIME is not set
1500# CONFIG_MAGIC_SYSRQ is not set
1490# CONFIG_DEBUG_KERNEL is not set 1501# CONFIG_DEBUG_KERNEL is not set
1491CONFIG_LOG_BUF_SHIFT=14 1502CONFIG_LOG_BUF_SHIFT=14
1492CONFIG_CROSSCOMPILE=y 1503CONFIG_CROSSCOMPILE=y
diff --git a/arch/mips/configs/sb1250-swarm_defconfig b/arch/mips/configs/sb1250-swarm_defconfig
index 52048c906079..da68c3f72050 100644
--- a/arch/mips/configs/sb1250-swarm_defconfig
+++ b/arch/mips/configs/sb1250-swarm_defconfig
@@ -1,7 +1,7 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.15-rc2 3# Linux kernel version: 2.6.16-rc1
4# Thu Nov 24 01:07:09 2005 4# Fri Jan 27 15:40:32 2006
5# 5#
6CONFIG_MIPS=y 6CONFIG_MIPS=y
7 7
@@ -173,27 +173,29 @@ CONFIG_SYSVIPC=y
173# CONFIG_BSD_PROCESS_ACCT is not set 173# CONFIG_BSD_PROCESS_ACCT is not set
174CONFIG_SYSCTL=y 174CONFIG_SYSCTL=y
175# CONFIG_AUDIT is not set 175# CONFIG_AUDIT is not set
176CONFIG_HOTPLUG=y
177CONFIG_KOBJECT_UEVENT=y
178# CONFIG_IKCONFIG is not set 176# CONFIG_IKCONFIG is not set
179CONFIG_CPUSETS=y 177CONFIG_CPUSETS=y
180CONFIG_INITRAMFS_SOURCE="" 178CONFIG_INITRAMFS_SOURCE=""
179# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
181CONFIG_EMBEDDED=y 180CONFIG_EMBEDDED=y
182CONFIG_KALLSYMS=y 181CONFIG_KALLSYMS=y
183# CONFIG_KALLSYMS_EXTRA_PASS is not set 182# CONFIG_KALLSYMS_EXTRA_PASS is not set
183CONFIG_HOTPLUG=y
184CONFIG_PRINTK=y 184CONFIG_PRINTK=y
185CONFIG_BUG=y 185CONFIG_BUG=y
186CONFIG_ELF_CORE=y
186CONFIG_BASE_FULL=y 187CONFIG_BASE_FULL=y
187CONFIG_FUTEX=y 188CONFIG_FUTEX=y
188CONFIG_EPOLL=y 189CONFIG_EPOLL=y
189# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
190CONFIG_SHMEM=y 190CONFIG_SHMEM=y
191CONFIG_CC_ALIGN_FUNCTIONS=0 191CONFIG_CC_ALIGN_FUNCTIONS=0
192CONFIG_CC_ALIGN_LABELS=0 192CONFIG_CC_ALIGN_LABELS=0
193CONFIG_CC_ALIGN_LOOPS=0 193CONFIG_CC_ALIGN_LOOPS=0
194CONFIG_CC_ALIGN_JUMPS=0 194CONFIG_CC_ALIGN_JUMPS=0
195CONFIG_SLAB=y
195# CONFIG_TINY_SHMEM is not set 196# CONFIG_TINY_SHMEM is not set
196CONFIG_BASE_SMALL=0 197CONFIG_BASE_SMALL=0
198# CONFIG_SLOB is not set
197 199
198# 200#
199# Loadable module support 201# Loadable module support
@@ -247,7 +249,6 @@ CONFIG_MMU=y
247# 249#
248CONFIG_BINFMT_ELF=y 250CONFIG_BINFMT_ELF=y
249# CONFIG_BINFMT_MISC is not set 251# CONFIG_BINFMT_MISC is not set
250# CONFIG_BUILD_ELF64 is not set
251CONFIG_MIPS32_COMPAT=y 252CONFIG_MIPS32_COMPAT=y
252CONFIG_COMPAT=y 253CONFIG_COMPAT=y
253CONFIG_MIPS32_O32=y 254CONFIG_MIPS32_O32=y
@@ -309,6 +310,11 @@ CONFIG_TCP_CONG_BIC=y
309# CONFIG_ATALK is not set 310# CONFIG_ATALK is not set
310# CONFIG_X25 is not set 311# CONFIG_X25 is not set
311# CONFIG_LAPB is not set 312# CONFIG_LAPB is not set
313
314#
315# TIPC Configuration (EXPERIMENTAL)
316#
317# CONFIG_TIPC is not set
312# CONFIG_NET_DIVERT is not set 318# CONFIG_NET_DIVERT is not set
313# CONFIG_ECONET is not set 319# CONFIG_ECONET is not set
314# CONFIG_WAN_ROUTER is not set 320# CONFIG_WAN_ROUTER is not set
@@ -329,7 +335,6 @@ CONFIG_IEEE80211=m
329# CONFIG_IEEE80211_DEBUG is not set 335# CONFIG_IEEE80211_DEBUG is not set
330CONFIG_IEEE80211_CRYPT_WEP=m 336CONFIG_IEEE80211_CRYPT_WEP=m
331CONFIG_IEEE80211_CRYPT_CCMP=m 337CONFIG_IEEE80211_CRYPT_CCMP=m
332CONFIG_IEEE80211_CRYPT_TKIP=m
333 338
334# 339#
335# Device Drivers 340# Device Drivers
@@ -472,6 +477,7 @@ CONFIG_MII=y
472# CONFIG_SUNGEM is not set 477# CONFIG_SUNGEM is not set
473# CONFIG_CASSINI is not set 478# CONFIG_CASSINI is not set
474# CONFIG_NET_VENDOR_3COM is not set 479# CONFIG_NET_VENDOR_3COM is not set
480# CONFIG_DM9000 is not set
475 481
476# 482#
477# Tulip family network device support 483# Tulip family network device support
@@ -493,6 +499,7 @@ CONFIG_MII=y
493CONFIG_NET_SB1250_MAC=y 499CONFIG_NET_SB1250_MAC=y
494# CONFIG_SIS190 is not set 500# CONFIG_SIS190 is not set
495# CONFIG_SKGE is not set 501# CONFIG_SKGE is not set
502# CONFIG_SKY2 is not set
496# CONFIG_SK98LIN is not set 503# CONFIG_SK98LIN is not set
497# CONFIG_TIGON3 is not set 504# CONFIG_TIGON3 is not set
498# CONFIG_BNX2 is not set 505# CONFIG_BNX2 is not set
@@ -513,8 +520,6 @@ CONFIG_NET_SB1250_MAC=y
513# Wireless LAN (non-hamradio) 520# Wireless LAN (non-hamradio)
514# 521#
515# CONFIG_NET_RADIO is not set 522# CONFIG_NET_RADIO is not set
516# CONFIG_IPW_DEBUG is not set
517CONFIG_IPW2200=m
518 523
519# 524#
520# Wan interfaces 525# Wan interfaces
@@ -560,12 +565,15 @@ CONFIG_SERIO_RAW=m
560# 565#
561# CONFIG_VT is not set 566# CONFIG_VT is not set
562CONFIG_SERIAL_NONSTANDARD=y 567CONFIG_SERIAL_NONSTANDARD=y
568# CONFIG_COMPUTONE is not set
563# CONFIG_ROCKETPORT is not set 569# CONFIG_ROCKETPORT is not set
564# CONFIG_CYCLADES is not set 570# CONFIG_CYCLADES is not set
565# CONFIG_DIGIEPCA is not set 571# CONFIG_DIGIEPCA is not set
572# CONFIG_MOXA_INTELLIO is not set
566# CONFIG_MOXA_SMARTIO is not set 573# CONFIG_MOXA_SMARTIO is not set
567# CONFIG_ISI is not set 574# CONFIG_ISI is not set
568# CONFIG_SYNCLINKMP is not set 575# CONFIG_SYNCLINKMP is not set
576# CONFIG_SYNCLINK_GT is not set
569# CONFIG_N_HDLC is not set 577# CONFIG_N_HDLC is not set
570# CONFIG_SPECIALIX is not set 578# CONFIG_SPECIALIX is not set
571# CONFIG_SX is not set 579# CONFIG_SX is not set
@@ -581,7 +589,6 @@ CONFIG_SIBYTE_SB1250_DUART_CONSOLE=y
581# 589#
582# Non-8250 serial port support 590# Non-8250 serial port support
583# 591#
584# CONFIG_SERIAL_JSM is not set
585CONFIG_UNIX98_PTYS=y 592CONFIG_UNIX98_PTYS=y
586CONFIG_LEGACY_PTYS=y 593CONFIG_LEGACY_PTYS=y
587CONFIG_LEGACY_PTY_COUNT=256 594CONFIG_LEGACY_PTY_COUNT=256
@@ -619,6 +626,12 @@ CONFIG_LEGACY_PTY_COUNT=256
619# CONFIG_I2C is not set 626# CONFIG_I2C is not set
620 627
621# 628#
629# SPI support
630#
631# CONFIG_SPI is not set
632# CONFIG_SPI_MASTER is not set
633
634#
622# Dallas's 1-wire bus 635# Dallas's 1-wire bus
623# 636#
624# CONFIG_W1 is not set 637# CONFIG_W1 is not set
@@ -696,12 +709,12 @@ CONFIG_EXT2_FS_POSIX_ACL=y
696CONFIG_EXT2_FS_SECURITY=y 709CONFIG_EXT2_FS_SECURITY=y
697# CONFIG_EXT2_FS_XIP is not set 710# CONFIG_EXT2_FS_XIP is not set
698# CONFIG_EXT3_FS is not set 711# CONFIG_EXT3_FS is not set
699# CONFIG_JBD is not set
700CONFIG_FS_MBCACHE=y 712CONFIG_FS_MBCACHE=y
701# CONFIG_REISERFS_FS is not set 713# CONFIG_REISERFS_FS is not set
702# CONFIG_JFS_FS is not set 714# CONFIG_JFS_FS is not set
703CONFIG_FS_POSIX_ACL=y 715CONFIG_FS_POSIX_ACL=y
704# CONFIG_XFS_FS is not set 716# CONFIG_XFS_FS is not set
717# CONFIG_OCFS2_FS is not set
705# CONFIG_MINIX_FS is not set 718# CONFIG_MINIX_FS is not set
706# CONFIG_ROMFS_FS is not set 719# CONFIG_ROMFS_FS is not set
707CONFIG_INOTIFY=y 720CONFIG_INOTIFY=y
@@ -734,6 +747,7 @@ CONFIG_SYSFS=y
734# CONFIG_HUGETLB_PAGE is not set 747# CONFIG_HUGETLB_PAGE is not set
735CONFIG_RAMFS=y 748CONFIG_RAMFS=y
736CONFIG_RELAYFS_FS=m 749CONFIG_RELAYFS_FS=m
750# CONFIG_CONFIGFS_FS is not set
737 751
738# 752#
739# Miscellaneous filesystems 753# Miscellaneous filesystems
@@ -795,6 +809,7 @@ CONFIG_MSDOS_PARTITION=y
795# Kernel hacking 809# Kernel hacking
796# 810#
797# CONFIG_PRINTK_TIME is not set 811# CONFIG_PRINTK_TIME is not set
812# CONFIG_MAGIC_SYSRQ is not set
798# CONFIG_DEBUG_KERNEL is not set 813# CONFIG_DEBUG_KERNEL is not set
799CONFIG_LOG_BUF_SHIFT=15 814CONFIG_LOG_BUF_SHIFT=15
800CONFIG_CROSSCOMPILE=y 815CONFIG_CROSSCOMPILE=y
diff --git a/arch/mips/configs/sead_defconfig b/arch/mips/configs/sead_defconfig
index 41dd70824976..9a936d7b7c0c 100644
--- a/arch/mips/configs/sead_defconfig
+++ b/arch/mips/configs/sead_defconfig
@@ -1,7 +1,7 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.15-rc2 3# Linux kernel version: 2.6.16-rc1
4# Thu Nov 24 01:07:10 2005 4# Fri Jan 27 15:40:33 2006
5# 5#
6CONFIG_MIPS=y 6CONFIG_MIPS=y
7 7
@@ -153,25 +153,28 @@ CONFIG_LOCALVERSION_AUTO=y
153CONFIG_SYSVIPC=y 153CONFIG_SYSVIPC=y
154# CONFIG_BSD_PROCESS_ACCT is not set 154# CONFIG_BSD_PROCESS_ACCT is not set
155CONFIG_SYSCTL=y 155CONFIG_SYSCTL=y
156# CONFIG_HOTPLUG is not set
157# CONFIG_IKCONFIG is not set 156# CONFIG_IKCONFIG is not set
158CONFIG_INITRAMFS_SOURCE="" 157CONFIG_INITRAMFS_SOURCE=""
158# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
159CONFIG_EMBEDDED=y 159CONFIG_EMBEDDED=y
160CONFIG_KALLSYMS=y 160CONFIG_KALLSYMS=y
161# CONFIG_KALLSYMS_EXTRA_PASS is not set 161# CONFIG_KALLSYMS_EXTRA_PASS is not set
162# CONFIG_HOTPLUG is not set
162CONFIG_PRINTK=y 163CONFIG_PRINTK=y
163CONFIG_BUG=y 164CONFIG_BUG=y
165CONFIG_ELF_CORE=y
164CONFIG_BASE_FULL=y 166CONFIG_BASE_FULL=y
165CONFIG_FUTEX=y 167CONFIG_FUTEX=y
166CONFIG_EPOLL=y 168CONFIG_EPOLL=y
167# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
168CONFIG_SHMEM=y 169CONFIG_SHMEM=y
169CONFIG_CC_ALIGN_FUNCTIONS=0 170CONFIG_CC_ALIGN_FUNCTIONS=0
170CONFIG_CC_ALIGN_LABELS=0 171CONFIG_CC_ALIGN_LABELS=0
171CONFIG_CC_ALIGN_LOOPS=0 172CONFIG_CC_ALIGN_LOOPS=0
172CONFIG_CC_ALIGN_JUMPS=0 173CONFIG_CC_ALIGN_JUMPS=0
174CONFIG_SLAB=y
173# CONFIG_TINY_SHMEM is not set 175# CONFIG_TINY_SHMEM is not set
174CONFIG_BASE_SMALL=0 176CONFIG_BASE_SMALL=0
177# CONFIG_SLOB is not set
175 178
176# 179#
177# Loadable module support 180# Loadable module support
@@ -330,6 +333,7 @@ CONFIG_RAID_ATTRS=y
330CONFIG_SERIAL_8250=y 333CONFIG_SERIAL_8250=y
331CONFIG_SERIAL_8250_CONSOLE=y 334CONFIG_SERIAL_8250_CONSOLE=y
332CONFIG_SERIAL_8250_NR_UARTS=4 335CONFIG_SERIAL_8250_NR_UARTS=4
336CONFIG_SERIAL_8250_RUNTIME_UARTS=4
333# CONFIG_SERIAL_8250_EXTENDED is not set 337# CONFIG_SERIAL_8250_EXTENDED is not set
334 338
335# 339#
@@ -372,6 +376,12 @@ CONFIG_LEGACY_PTY_COUNT=256
372# CONFIG_I2C is not set 376# CONFIG_I2C is not set
373 377
374# 378#
379# SPI support
380#
381# CONFIG_SPI is not set
382# CONFIG_SPI_MASTER is not set
383
384#
375# Dallas's 1-wire bus 385# Dallas's 1-wire bus
376# 386#
377# CONFIG_W1 is not set 387# CONFIG_W1 is not set
@@ -444,7 +454,6 @@ CONFIG_EXT2_FS=y
444# CONFIG_EXT2_FS_XATTR is not set 454# CONFIG_EXT2_FS_XATTR is not set
445# CONFIG_EXT2_FS_XIP is not set 455# CONFIG_EXT2_FS_XIP is not set
446# CONFIG_EXT3_FS is not set 456# CONFIG_EXT3_FS is not set
447# CONFIG_JBD is not set
448# CONFIG_REISERFS_FS is not set 457# CONFIG_REISERFS_FS is not set
449# CONFIG_JFS_FS is not set 458# CONFIG_JFS_FS is not set
450# CONFIG_FS_POSIX_ACL is not set 459# CONFIG_FS_POSIX_ACL is not set
@@ -481,6 +490,7 @@ CONFIG_SYSFS=y
481# CONFIG_HUGETLB_PAGE is not set 490# CONFIG_HUGETLB_PAGE is not set
482CONFIG_RAMFS=y 491CONFIG_RAMFS=y
483CONFIG_RELAYFS_FS=y 492CONFIG_RELAYFS_FS=y
493# CONFIG_CONFIGFS_FS is not set
484 494
485# 495#
486# Miscellaneous filesystems 496# Miscellaneous filesystems
@@ -513,6 +523,7 @@ CONFIG_PARTITION_ADVANCED=y
513# CONFIG_SGI_PARTITION is not set 523# CONFIG_SGI_PARTITION is not set
514# CONFIG_ULTRIX_PARTITION is not set 524# CONFIG_ULTRIX_PARTITION is not set
515# CONFIG_SUN_PARTITION is not set 525# CONFIG_SUN_PARTITION is not set
526# CONFIG_KARMA_PARTITION is not set
516# CONFIG_EFI_PARTITION is not set 527# CONFIG_EFI_PARTITION is not set
517 528
518# 529#
@@ -529,6 +540,7 @@ CONFIG_PARTITION_ADVANCED=y
529# Kernel hacking 540# Kernel hacking
530# 541#
531# CONFIG_PRINTK_TIME is not set 542# CONFIG_PRINTK_TIME is not set
543# CONFIG_MAGIC_SYSRQ is not set
532# CONFIG_DEBUG_KERNEL is not set 544# CONFIG_DEBUG_KERNEL is not set
533CONFIG_LOG_BUF_SHIFT=14 545CONFIG_LOG_BUF_SHIFT=14
534CONFIG_CROSSCOMPILE=y 546CONFIG_CROSSCOMPILE=y
diff --git a/arch/mips/configs/tb0226_defconfig b/arch/mips/configs/tb0226_defconfig
index 83969466ecf6..c2dee0d1c72c 100644
--- a/arch/mips/configs/tb0226_defconfig
+++ b/arch/mips/configs/tb0226_defconfig
@@ -1,7 +1,7 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.15-rc2 3# Linux kernel version: 2.6.16-rc1
4# Thu Nov 24 01:07:12 2005 4# Fri Jan 27 15:40:34 2006
5# 5#
6CONFIG_MIPS=y 6CONFIG_MIPS=y
7 7
@@ -63,11 +63,12 @@ CONFIG_MACH_VR41XX=y
63# CONFIG_TOSHIBA_JMR3927 is not set 63# CONFIG_TOSHIBA_JMR3927 is not set
64# CONFIG_TOSHIBA_RBTX4927 is not set 64# CONFIG_TOSHIBA_RBTX4927 is not set
65# CONFIG_TOSHIBA_RBTX4938 is not set 65# CONFIG_TOSHIBA_RBTX4938 is not set
66# CONFIG_NEC_CMBVR4133 is not set
67# CONFIG_CASIO_E55 is not set 66# CONFIG_CASIO_E55 is not set
68# CONFIG_IBM_WORKPAD is not set 67# CONFIG_IBM_WORKPAD is not set
68# CONFIG_NEC_CMBVR4133 is not set
69CONFIG_TANBAC_TB022X=y 69CONFIG_TANBAC_TB022X=y
70CONFIG_TANBAC_TB0226=y 70CONFIG_TANBAC_TB0226=y
71CONFIG_TANBAC_TB0287=y
71# CONFIG_VICTOR_MPC30X is not set 72# CONFIG_VICTOR_MPC30X is not set
72# CONFIG_ZAO_CAPCELLA is not set 73# CONFIG_ZAO_CAPCELLA is not set
73CONFIG_PCI_VR41XX=y 74CONFIG_PCI_VR41XX=y
@@ -91,7 +92,7 @@ CONFIG_MIPS_L1_CACHE_SHIFT=5
91# CONFIG_CPU_MIPS64_R2 is not set 92# CONFIG_CPU_MIPS64_R2 is not set
92# CONFIG_CPU_R3000 is not set 93# CONFIG_CPU_R3000 is not set
93# CONFIG_CPU_TX39XX is not set 94# CONFIG_CPU_TX39XX is not set
94CONFIG_CPU_VR41XX=y 95# CONFIG_CPU_VR41XX is not set
95# CONFIG_CPU_R4300 is not set 96# CONFIG_CPU_R4300 is not set
96# CONFIG_CPU_R4X00 is not set 97# CONFIG_CPU_R4X00 is not set
97# CONFIG_CPU_TX49XX is not set 98# CONFIG_CPU_TX49XX is not set
@@ -104,23 +105,18 @@ CONFIG_CPU_VR41XX=y
104# CONFIG_CPU_RM7000 is not set 105# CONFIG_CPU_RM7000 is not set
105# CONFIG_CPU_RM9000 is not set 106# CONFIG_CPU_RM9000 is not set
106# CONFIG_CPU_SB1 is not set 107# CONFIG_CPU_SB1 is not set
107CONFIG_SYS_HAS_CPU_VR41XX=y
108CONFIG_SYS_SUPPORTS_32BIT_KERNEL=y
109CONFIG_SYS_SUPPORTS_64BIT_KERNEL=y
110CONFIG_CPU_SUPPORTS_32BIT_KERNEL=y
111CONFIG_CPU_SUPPORTS_64BIT_KERNEL=y
112 108
113# 109#
114# Kernel type 110# Kernel type
115# 111#
116CONFIG_32BIT=y 112# CONFIG_32BIT is not set
117# CONFIG_64BIT is not set 113# CONFIG_64BIT is not set
118CONFIG_PAGE_SIZE_4KB=y 114CONFIG_PAGE_SIZE_4KB=y
119# CONFIG_PAGE_SIZE_8KB is not set 115# CONFIG_PAGE_SIZE_8KB is not set
120# CONFIG_PAGE_SIZE_16KB is not set 116# CONFIG_PAGE_SIZE_16KB is not set
121# CONFIG_PAGE_SIZE_64KB is not set 117# CONFIG_PAGE_SIZE_64KB is not set
122# CONFIG_MIPS_MT is not set 118# CONFIG_MIPS_MT is not set
123# CONFIG_CPU_ADVANCED is not set 119CONFIG_CPU_HAS_LLSC=y
124CONFIG_CPU_HAS_SYNC=y 120CONFIG_CPU_HAS_SYNC=y
125CONFIG_GENERIC_HARDIRQS=y 121CONFIG_GENERIC_HARDIRQS=y
126CONFIG_GENERIC_IRQ_PROBE=y 122CONFIG_GENERIC_IRQ_PROBE=y
@@ -156,26 +152,28 @@ CONFIG_SYSVIPC=y
156# CONFIG_BSD_PROCESS_ACCT is not set 152# CONFIG_BSD_PROCESS_ACCT is not set
157CONFIG_SYSCTL=y 153CONFIG_SYSCTL=y
158# CONFIG_AUDIT is not set 154# CONFIG_AUDIT is not set
159# CONFIG_HOTPLUG is not set
160CONFIG_KOBJECT_UEVENT=y
161# CONFIG_IKCONFIG is not set 155# CONFIG_IKCONFIG is not set
162CONFIG_INITRAMFS_SOURCE="" 156CONFIG_INITRAMFS_SOURCE=""
157# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
163CONFIG_EMBEDDED=y 158CONFIG_EMBEDDED=y
164CONFIG_KALLSYMS=y 159CONFIG_KALLSYMS=y
165# CONFIG_KALLSYMS_EXTRA_PASS is not set 160# CONFIG_KALLSYMS_EXTRA_PASS is not set
161CONFIG_HOTPLUG=y
166CONFIG_PRINTK=y 162CONFIG_PRINTK=y
167CONFIG_BUG=y 163CONFIG_BUG=y
164CONFIG_ELF_CORE=y
168CONFIG_BASE_FULL=y 165CONFIG_BASE_FULL=y
169CONFIG_FUTEX=y 166CONFIG_FUTEX=y
170CONFIG_EPOLL=y 167CONFIG_EPOLL=y
171# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
172CONFIG_SHMEM=y 168CONFIG_SHMEM=y
173CONFIG_CC_ALIGN_FUNCTIONS=0 169CONFIG_CC_ALIGN_FUNCTIONS=0
174CONFIG_CC_ALIGN_LABELS=0 170CONFIG_CC_ALIGN_LABELS=0
175CONFIG_CC_ALIGN_LOOPS=0 171CONFIG_CC_ALIGN_LOOPS=0
176CONFIG_CC_ALIGN_JUMPS=0 172CONFIG_CC_ALIGN_JUMPS=0
173CONFIG_SLAB=y
177# CONFIG_TINY_SHMEM is not set 174# CONFIG_TINY_SHMEM is not set
178CONFIG_BASE_SMALL=0 175CONFIG_BASE_SMALL=0
176# CONFIG_SLOB is not set
179 177
180# 178#
181# Loadable module support 179# Loadable module support
@@ -191,7 +189,6 @@ CONFIG_KMOD=y
191# 189#
192# Block layer 190# Block layer
193# 191#
194# CONFIG_LBD is not set
195 192
196# 193#
197# IO Schedulers 194# IO Schedulers
@@ -229,7 +226,6 @@ CONFIG_MMU=y
229# 226#
230CONFIG_BINFMT_ELF=y 227CONFIG_BINFMT_ELF=y
231# CONFIG_BINFMT_MISC is not set 228# CONFIG_BINFMT_MISC is not set
232CONFIG_TRAD_SIGNALS=y
233 229
234# 230#
235# Networking 231# Networking
@@ -293,6 +289,11 @@ CONFIG_TCP_CONG_BIC=y
293# CONFIG_ATALK is not set 289# CONFIG_ATALK is not set
294# CONFIG_X25 is not set 290# CONFIG_X25 is not set
295# CONFIG_LAPB is not set 291# CONFIG_LAPB is not set
292
293#
294# TIPC Configuration (EXPERIMENTAL)
295#
296# CONFIG_TIPC is not set
296# CONFIG_NET_DIVERT is not set 297# CONFIG_NET_DIVERT is not set
297# CONFIG_ECONET is not set 298# CONFIG_ECONET is not set
298# CONFIG_WAN_ROUTER is not set 299# CONFIG_WAN_ROUTER is not set
@@ -313,7 +314,6 @@ CONFIG_IEEE80211=m
313# CONFIG_IEEE80211_DEBUG is not set 314# CONFIG_IEEE80211_DEBUG is not set
314CONFIG_IEEE80211_CRYPT_WEP=m 315CONFIG_IEEE80211_CRYPT_WEP=m
315CONFIG_IEEE80211_CRYPT_CCMP=m 316CONFIG_IEEE80211_CRYPT_CCMP=m
316CONFIG_IEEE80211_CRYPT_TKIP=m
317 317
318# 318#
319# Device Drivers 319# Device Drivers
@@ -324,7 +324,7 @@ CONFIG_IEEE80211_CRYPT_TKIP=m
324# 324#
325CONFIG_STANDALONE=y 325CONFIG_STANDALONE=y
326CONFIG_PREVENT_FIRMWARE_BUILD=y 326CONFIG_PREVENT_FIRMWARE_BUILD=y
327# CONFIG_FW_LOADER is not set 327CONFIG_FW_LOADER=y
328 328
329# 329#
330# Connector - unified userspace <-> kernelspace linker 330# Connector - unified userspace <-> kernelspace linker
@@ -397,7 +397,7 @@ CONFIG_SCSI_MULTI_LUN=y
397# SCSI Transport Attributes 397# SCSI Transport Attributes
398# 398#
399# CONFIG_SCSI_SPI_ATTRS is not set 399# CONFIG_SCSI_SPI_ATTRS is not set
400# CONFIG_SCSI_FC_ATTRS is not set 400CONFIG_SCSI_FC_ATTRS=y
401CONFIG_SCSI_ISCSI_ATTRS=m 401CONFIG_SCSI_ISCSI_ATTRS=m
402# CONFIG_SCSI_SAS_ATTRS is not set 402# CONFIG_SCSI_SAS_ATTRS is not set
403 403
@@ -426,13 +426,7 @@ CONFIG_ISCSI_TCP=m
426# CONFIG_SCSI_IPR is not set 426# CONFIG_SCSI_IPR is not set
427# CONFIG_SCSI_QLOGIC_FC is not set 427# CONFIG_SCSI_QLOGIC_FC is not set
428# CONFIG_SCSI_QLOGIC_1280 is not set 428# CONFIG_SCSI_QLOGIC_1280 is not set
429CONFIG_SCSI_QLA2XXX=y 429# CONFIG_SCSI_QLA_FC is not set
430# CONFIG_SCSI_QLA21XX is not set
431# CONFIG_SCSI_QLA22XX is not set
432# CONFIG_SCSI_QLA2300 is not set
433# CONFIG_SCSI_QLA2322 is not set
434# CONFIG_SCSI_QLA6312 is not set
435# CONFIG_SCSI_QLA24XX is not set
436# CONFIG_SCSI_LPFC is not set 430# CONFIG_SCSI_LPFC is not set
437# CONFIG_SCSI_DC395x is not set 431# CONFIG_SCSI_DC395x is not set
438# CONFIG_SCSI_DC390T is not set 432# CONFIG_SCSI_DC390T is not set
@@ -499,6 +493,7 @@ CONFIG_MII=y
499# CONFIG_SUNGEM is not set 493# CONFIG_SUNGEM is not set
500# CONFIG_CASSINI is not set 494# CONFIG_CASSINI is not set
501# CONFIG_NET_VENDOR_3COM is not set 495# CONFIG_NET_VENDOR_3COM is not set
496# CONFIG_DM9000 is not set
502 497
503# 498#
504# Tulip family network device support 499# Tulip family network device support
@@ -538,6 +533,7 @@ CONFIG_EEPRO100=y
538# CONFIG_R8169 is not set 533# CONFIG_R8169 is not set
539# CONFIG_SIS190 is not set 534# CONFIG_SIS190 is not set
540# CONFIG_SKGE is not set 535# CONFIG_SKGE is not set
536# CONFIG_SKY2 is not set
541# CONFIG_SK98LIN is not set 537# CONFIG_SK98LIN is not set
542# CONFIG_VIA_VELOCITY is not set 538# CONFIG_VIA_VELOCITY is not set
543# CONFIG_TIGON3 is not set 539# CONFIG_TIGON3 is not set
@@ -559,7 +555,6 @@ CONFIG_EEPRO100=y
559# Wireless LAN (non-hamradio) 555# Wireless LAN (non-hamradio)
560# 556#
561# CONFIG_NET_RADIO is not set 557# CONFIG_NET_RADIO is not set
562# CONFIG_IPW2200 is not set
563 558
564# 559#
565# Wan interfaces 560# Wan interfaces
@@ -630,11 +625,6 @@ CONFIG_HW_CONSOLE=y
630# 625#
631# Non-8250 serial port support 626# Non-8250 serial port support
632# 627#
633CONFIG_SERIAL_CORE=y
634CONFIG_SERIAL_CORE_CONSOLE=y
635CONFIG_SERIAL_VR41XX=y
636CONFIG_SERIAL_VR41XX_CONSOLE=y
637# CONFIG_SERIAL_JSM is not set
638CONFIG_UNIX98_PTYS=y 628CONFIG_UNIX98_PTYS=y
639CONFIG_LEGACY_PTYS=y 629CONFIG_LEGACY_PTYS=y
640CONFIG_LEGACY_PTY_COUNT=256 630CONFIG_LEGACY_PTY_COUNT=256
@@ -650,7 +640,6 @@ CONFIG_LEGACY_PTY_COUNT=256
650# CONFIG_WATCHDOG is not set 640# CONFIG_WATCHDOG is not set
651# CONFIG_RTC is not set 641# CONFIG_RTC is not set
652# CONFIG_GEN_RTC is not set 642# CONFIG_GEN_RTC is not set
653# CONFIG_RTC_VR41XX is not set
654# CONFIG_DTLK is not set 643# CONFIG_DTLK is not set
655# CONFIG_R3964 is not set 644# CONFIG_R3964 is not set
656# CONFIG_APPLICOM is not set 645# CONFIG_APPLICOM is not set
@@ -675,6 +664,12 @@ CONFIG_GPIO_VR41XX=y
675# CONFIG_I2C is not set 664# CONFIG_I2C is not set
676 665
677# 666#
667# SPI support
668#
669# CONFIG_SPI is not set
670# CONFIG_SPI_MASTER is not set
671
672#
678# Dallas's 1-wire bus 673# Dallas's 1-wire bus
679# 674#
680# CONFIG_W1 is not set 675# CONFIG_W1 is not set
@@ -770,6 +765,8 @@ CONFIG_USB_STORAGE=m
770# CONFIG_USB_STORAGE_SDDR09 is not set 765# CONFIG_USB_STORAGE_SDDR09 is not set
771# CONFIG_USB_STORAGE_SDDR55 is not set 766# CONFIG_USB_STORAGE_SDDR55 is not set
772# CONFIG_USB_STORAGE_JUMPSHOT is not set 767# CONFIG_USB_STORAGE_JUMPSHOT is not set
768# CONFIG_USB_STORAGE_ALAUDA is not set
769# CONFIG_USB_LIBUSUAL is not set
773 770
774# 771#
775# USB Input Devices 772# USB Input Devices
@@ -792,6 +789,7 @@ CONFIG_USB_STORAGE=m
792# CONFIG_USB_YEALINK is not set 789# CONFIG_USB_YEALINK is not set
793# CONFIG_USB_XPAD is not set 790# CONFIG_USB_XPAD is not set
794# CONFIG_USB_ATI_REMOTE is not set 791# CONFIG_USB_ATI_REMOTE is not set
792# CONFIG_USB_ATI_REMOTE2 is not set
795# CONFIG_USB_KEYSPAN_REMOTE is not set 793# CONFIG_USB_KEYSPAN_REMOTE is not set
796# CONFIG_USB_APPLETOUCH is not set 794# CONFIG_USB_APPLETOUCH is not set
797 795
@@ -877,11 +875,11 @@ CONFIG_EXT2_FS=y
877# CONFIG_EXT2_FS_XATTR is not set 875# CONFIG_EXT2_FS_XATTR is not set
878# CONFIG_EXT2_FS_XIP is not set 876# CONFIG_EXT2_FS_XIP is not set
879# CONFIG_EXT3_FS is not set 877# CONFIG_EXT3_FS is not set
880# CONFIG_JBD is not set
881# CONFIG_REISERFS_FS is not set 878# CONFIG_REISERFS_FS is not set
882# CONFIG_JFS_FS is not set 879# CONFIG_JFS_FS is not set
883# CONFIG_FS_POSIX_ACL is not set 880# CONFIG_FS_POSIX_ACL is not set
884# CONFIG_XFS_FS is not set 881# CONFIG_XFS_FS is not set
882# CONFIG_OCFS2_FS is not set
885# CONFIG_MINIX_FS is not set 883# CONFIG_MINIX_FS is not set
886CONFIG_ROMFS_FS=m 884CONFIG_ROMFS_FS=m
887CONFIG_INOTIFY=y 885CONFIG_INOTIFY=y
@@ -914,6 +912,7 @@ CONFIG_TMPFS=y
914# CONFIG_HUGETLB_PAGE is not set 912# CONFIG_HUGETLB_PAGE is not set
915CONFIG_RAMFS=y 913CONFIG_RAMFS=y
916CONFIG_RELAYFS_FS=m 914CONFIG_RELAYFS_FS=m
915# CONFIG_CONFIGFS_FS is not set
917 916
918# 917#
919# Miscellaneous filesystems 918# Miscellaneous filesystems
@@ -1021,6 +1020,7 @@ CONFIG_NLS_ISO8859_1=m
1021# Kernel hacking 1020# Kernel hacking
1022# 1021#
1023# CONFIG_PRINTK_TIME is not set 1022# CONFIG_PRINTK_TIME is not set
1023# CONFIG_MAGIC_SYSRQ is not set
1024# CONFIG_DEBUG_KERNEL is not set 1024# CONFIG_DEBUG_KERNEL is not set
1025CONFIG_LOG_BUF_SHIFT=14 1025CONFIG_LOG_BUF_SHIFT=14
1026CONFIG_CROSSCOMPILE=y 1026CONFIG_CROSSCOMPILE=y
diff --git a/arch/mips/configs/tb0229_defconfig b/arch/mips/configs/tb0229_defconfig
index ce7b9ed44432..be99261d7997 100644
--- a/arch/mips/configs/tb0229_defconfig
+++ b/arch/mips/configs/tb0229_defconfig
@@ -1,7 +1,7 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.15-rc2 3# Linux kernel version: 2.6.16-rc1
4# Thu Nov 24 01:07:15 2005 4# Fri Jan 27 15:40:35 2006
5# 5#
6CONFIG_MIPS=y 6CONFIG_MIPS=y
7 7
@@ -63,11 +63,12 @@ CONFIG_MACH_VR41XX=y
63# CONFIG_TOSHIBA_JMR3927 is not set 63# CONFIG_TOSHIBA_JMR3927 is not set
64# CONFIG_TOSHIBA_RBTX4927 is not set 64# CONFIG_TOSHIBA_RBTX4927 is not set
65# CONFIG_TOSHIBA_RBTX4938 is not set 65# CONFIG_TOSHIBA_RBTX4938 is not set
66# CONFIG_NEC_CMBVR4133 is not set
67# CONFIG_CASIO_E55 is not set 66# CONFIG_CASIO_E55 is not set
68# CONFIG_IBM_WORKPAD is not set 67# CONFIG_IBM_WORKPAD is not set
68# CONFIG_NEC_CMBVR4133 is not set
69CONFIG_TANBAC_TB022X=y 69CONFIG_TANBAC_TB022X=y
70# CONFIG_TANBAC_TB0226 is not set 70# CONFIG_TANBAC_TB0226 is not set
71CONFIG_TANBAC_TB0287=y
71# CONFIG_VICTOR_MPC30X is not set 72# CONFIG_VICTOR_MPC30X is not set
72# CONFIG_ZAO_CAPCELLA is not set 73# CONFIG_ZAO_CAPCELLA is not set
73CONFIG_PCI_VR41XX=y 74CONFIG_PCI_VR41XX=y
@@ -91,7 +92,7 @@ CONFIG_MIPS_L1_CACHE_SHIFT=5
91# CONFIG_CPU_MIPS64_R2 is not set 92# CONFIG_CPU_MIPS64_R2 is not set
92# CONFIG_CPU_R3000 is not set 93# CONFIG_CPU_R3000 is not set
93# CONFIG_CPU_TX39XX is not set 94# CONFIG_CPU_TX39XX is not set
94CONFIG_CPU_VR41XX=y 95# CONFIG_CPU_VR41XX is not set
95# CONFIG_CPU_R4300 is not set 96# CONFIG_CPU_R4300 is not set
96# CONFIG_CPU_R4X00 is not set 97# CONFIG_CPU_R4X00 is not set
97# CONFIG_CPU_TX49XX is not set 98# CONFIG_CPU_TX49XX is not set
@@ -104,23 +105,18 @@ CONFIG_CPU_VR41XX=y
104# CONFIG_CPU_RM7000 is not set 105# CONFIG_CPU_RM7000 is not set
105# CONFIG_CPU_RM9000 is not set 106# CONFIG_CPU_RM9000 is not set
106# CONFIG_CPU_SB1 is not set 107# CONFIG_CPU_SB1 is not set
107CONFIG_SYS_HAS_CPU_VR41XX=y
108CONFIG_SYS_SUPPORTS_32BIT_KERNEL=y
109CONFIG_SYS_SUPPORTS_64BIT_KERNEL=y
110CONFIG_CPU_SUPPORTS_32BIT_KERNEL=y
111CONFIG_CPU_SUPPORTS_64BIT_KERNEL=y
112 108
113# 109#
114# Kernel type 110# Kernel type
115# 111#
116CONFIG_32BIT=y 112# CONFIG_32BIT is not set
117# CONFIG_64BIT is not set 113# CONFIG_64BIT is not set
118CONFIG_PAGE_SIZE_4KB=y 114CONFIG_PAGE_SIZE_4KB=y
119# CONFIG_PAGE_SIZE_8KB is not set 115# CONFIG_PAGE_SIZE_8KB is not set
120# CONFIG_PAGE_SIZE_16KB is not set 116# CONFIG_PAGE_SIZE_16KB is not set
121# CONFIG_PAGE_SIZE_64KB is not set 117# CONFIG_PAGE_SIZE_64KB is not set
122# CONFIG_MIPS_MT is not set 118# CONFIG_MIPS_MT is not set
123# CONFIG_CPU_ADVANCED is not set 119CONFIG_CPU_HAS_LLSC=y
124CONFIG_CPU_HAS_SYNC=y 120CONFIG_CPU_HAS_SYNC=y
125CONFIG_GENERIC_HARDIRQS=y 121CONFIG_GENERIC_HARDIRQS=y
126CONFIG_GENERIC_IRQ_PROBE=y 122CONFIG_GENERIC_IRQ_PROBE=y
@@ -156,26 +152,28 @@ CONFIG_SYSVIPC=y
156# CONFIG_BSD_PROCESS_ACCT is not set 152# CONFIG_BSD_PROCESS_ACCT is not set
157CONFIG_SYSCTL=y 153CONFIG_SYSCTL=y
158# CONFIG_AUDIT is not set 154# CONFIG_AUDIT is not set
159CONFIG_HOTPLUG=y
160CONFIG_KOBJECT_UEVENT=y
161# CONFIG_IKCONFIG is not set 155# CONFIG_IKCONFIG is not set
162CONFIG_INITRAMFS_SOURCE="" 156CONFIG_INITRAMFS_SOURCE=""
157# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
163CONFIG_EMBEDDED=y 158CONFIG_EMBEDDED=y
164CONFIG_KALLSYMS=y 159CONFIG_KALLSYMS=y
165# CONFIG_KALLSYMS_EXTRA_PASS is not set 160# CONFIG_KALLSYMS_EXTRA_PASS is not set
161CONFIG_HOTPLUG=y
166CONFIG_PRINTK=y 162CONFIG_PRINTK=y
167CONFIG_BUG=y 163CONFIG_BUG=y
164CONFIG_ELF_CORE=y
168CONFIG_BASE_FULL=y 165CONFIG_BASE_FULL=y
169CONFIG_FUTEX=y 166CONFIG_FUTEX=y
170CONFIG_EPOLL=y 167CONFIG_EPOLL=y
171# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
172CONFIG_SHMEM=y 168CONFIG_SHMEM=y
173CONFIG_CC_ALIGN_FUNCTIONS=0 169CONFIG_CC_ALIGN_FUNCTIONS=0
174CONFIG_CC_ALIGN_LABELS=0 170CONFIG_CC_ALIGN_LABELS=0
175CONFIG_CC_ALIGN_LOOPS=0 171CONFIG_CC_ALIGN_LOOPS=0
176CONFIG_CC_ALIGN_JUMPS=0 172CONFIG_CC_ALIGN_JUMPS=0
173CONFIG_SLAB=y
177# CONFIG_TINY_SHMEM is not set 174# CONFIG_TINY_SHMEM is not set
178CONFIG_BASE_SMALL=0 175CONFIG_BASE_SMALL=0
176# CONFIG_SLOB is not set
179 177
180# 178#
181# Loadable module support 179# Loadable module support
@@ -191,7 +189,6 @@ CONFIG_KMOD=y
191# 189#
192# Block layer 190# Block layer
193# 191#
194# CONFIG_LBD is not set
195 192
196# 193#
197# IO Schedulers 194# IO Schedulers
@@ -229,7 +226,6 @@ CONFIG_MMU=y
229# 226#
230CONFIG_BINFMT_ELF=y 227CONFIG_BINFMT_ELF=y
231# CONFIG_BINFMT_MISC is not set 228# CONFIG_BINFMT_MISC is not set
232CONFIG_TRAD_SIGNALS=y
233 229
234# 230#
235# Networking 231# Networking
@@ -294,6 +290,11 @@ CONFIG_TCP_CONG_BIC=y
294# CONFIG_ATALK is not set 290# CONFIG_ATALK is not set
295# CONFIG_X25 is not set 291# CONFIG_X25 is not set
296# CONFIG_LAPB is not set 292# CONFIG_LAPB is not set
293
294#
295# TIPC Configuration (EXPERIMENTAL)
296#
297# CONFIG_TIPC is not set
297# CONFIG_NET_DIVERT is not set 298# CONFIG_NET_DIVERT is not set
298# CONFIG_ECONET is not set 299# CONFIG_ECONET is not set
299# CONFIG_WAN_ROUTER is not set 300# CONFIG_WAN_ROUTER is not set
@@ -314,7 +315,6 @@ CONFIG_IEEE80211=m
314# CONFIG_IEEE80211_DEBUG is not set 315# CONFIG_IEEE80211_DEBUG is not set
315CONFIG_IEEE80211_CRYPT_WEP=m 316CONFIG_IEEE80211_CRYPT_WEP=m
316CONFIG_IEEE80211_CRYPT_CCMP=m 317CONFIG_IEEE80211_CRYPT_CCMP=m
317CONFIG_IEEE80211_CRYPT_TKIP=m
318 318
319# 319#
320# Device Drivers 320# Device Drivers
@@ -436,6 +436,7 @@ CONFIG_MII=y
436# CONFIG_SUNGEM is not set 436# CONFIG_SUNGEM is not set
437# CONFIG_CASSINI is not set 437# CONFIG_CASSINI is not set
438# CONFIG_NET_VENDOR_3COM is not set 438# CONFIG_NET_VENDOR_3COM is not set
439# CONFIG_DM9000 is not set
439 440
440# 441#
441# Tulip family network device support 442# Tulip family network device support
@@ -480,6 +481,7 @@ CONFIG_R8169=y
480# CONFIG_R8169_NAPI is not set 481# CONFIG_R8169_NAPI is not set
481# CONFIG_SIS190 is not set 482# CONFIG_SIS190 is not set
482# CONFIG_SKGE is not set 483# CONFIG_SKGE is not set
484# CONFIG_SKY2 is not set
483# CONFIG_SK98LIN is not set 485# CONFIG_SK98LIN is not set
484# CONFIG_VIA_VELOCITY is not set 486# CONFIG_VIA_VELOCITY is not set
485# CONFIG_TIGON3 is not set 487# CONFIG_TIGON3 is not set
@@ -501,8 +503,6 @@ CONFIG_R8169=y
501# Wireless LAN (non-hamradio) 503# Wireless LAN (non-hamradio)
502# 504#
503# CONFIG_NET_RADIO is not set 505# CONFIG_NET_RADIO is not set
504# CONFIG_IPW_DEBUG is not set
505CONFIG_IPW2200=m
506 506
507# 507#
508# Wan interfaces 508# Wan interfaces
@@ -583,11 +583,6 @@ CONFIG_HW_CONSOLE=y
583# 583#
584# Non-8250 serial port support 584# Non-8250 serial port support
585# 585#
586CONFIG_SERIAL_CORE=y
587CONFIG_SERIAL_CORE_CONSOLE=y
588CONFIG_SERIAL_VR41XX=y
589CONFIG_SERIAL_VR41XX_CONSOLE=y
590# CONFIG_SERIAL_JSM is not set
591CONFIG_UNIX98_PTYS=y 586CONFIG_UNIX98_PTYS=y
592CONFIG_LEGACY_PTYS=y 587CONFIG_LEGACY_PTYS=y
593CONFIG_LEGACY_PTY_COUNT=256 588CONFIG_LEGACY_PTY_COUNT=256
@@ -603,7 +598,6 @@ CONFIG_LEGACY_PTY_COUNT=256
603# CONFIG_WATCHDOG is not set 598# CONFIG_WATCHDOG is not set
604# CONFIG_RTC is not set 599# CONFIG_RTC is not set
605# CONFIG_GEN_RTC is not set 600# CONFIG_GEN_RTC is not set
606# CONFIG_RTC_VR41XX is not set
607# CONFIG_DTLK is not set 601# CONFIG_DTLK is not set
608# CONFIG_R3964 is not set 602# CONFIG_R3964 is not set
609# CONFIG_APPLICOM is not set 603# CONFIG_APPLICOM is not set
@@ -613,7 +607,6 @@ CONFIG_TANBAC_TB0219=y
613# Ftape, the floppy tape device driver 607# Ftape, the floppy tape device driver
614# 608#
615# CONFIG_DRM is not set 609# CONFIG_DRM is not set
616CONFIG_GPIO_VR41XX=y
617# CONFIG_RAW_DRIVER is not set 610# CONFIG_RAW_DRIVER is not set
618 611
619# 612#
@@ -628,6 +621,12 @@ CONFIG_GPIO_VR41XX=y
628# CONFIG_I2C is not set 621# CONFIG_I2C is not set
629 622
630# 623#
624# SPI support
625#
626# CONFIG_SPI is not set
627# CONFIG_SPI_MASTER is not set
628
629#
631# Dallas's 1-wire bus 630# Dallas's 1-wire bus
632# 631#
633# CONFIG_W1 is not set 632# CONFIG_W1 is not set
@@ -715,6 +714,7 @@ CONFIG_USB_OHCI_LITTLE_ENDIAN=y
715# may also be needed; see USB_STORAGE Help for more information 714# may also be needed; see USB_STORAGE Help for more information
716# 715#
717# CONFIG_USB_STORAGE is not set 716# CONFIG_USB_STORAGE is not set
717# CONFIG_USB_LIBUSUAL is not set
718 718
719# 719#
720# USB Input Devices 720# USB Input Devices
@@ -737,6 +737,7 @@ CONFIG_USB_OHCI_LITTLE_ENDIAN=y
737# CONFIG_USB_YEALINK is not set 737# CONFIG_USB_YEALINK is not set
738# CONFIG_USB_XPAD is not set 738# CONFIG_USB_XPAD is not set
739# CONFIG_USB_ATI_REMOTE is not set 739# CONFIG_USB_ATI_REMOTE is not set
740# CONFIG_USB_ATI_REMOTE2 is not set
740# CONFIG_USB_KEYSPAN_REMOTE is not set 741# CONFIG_USB_KEYSPAN_REMOTE is not set
741# CONFIG_USB_APPLETOUCH is not set 742# CONFIG_USB_APPLETOUCH is not set
742 743
@@ -840,6 +841,7 @@ CONFIG_XFS_QUOTA=y
840# CONFIG_XFS_SECURITY is not set 841# CONFIG_XFS_SECURITY is not set
841CONFIG_XFS_POSIX_ACL=y 842CONFIG_XFS_POSIX_ACL=y
842# CONFIG_XFS_RT is not set 843# CONFIG_XFS_RT is not set
844# CONFIG_OCFS2_FS is not set
843# CONFIG_MINIX_FS is not set 845# CONFIG_MINIX_FS is not set
844CONFIG_ROMFS_FS=m 846CONFIG_ROMFS_FS=m
845CONFIG_INOTIFY=y 847CONFIG_INOTIFY=y
@@ -879,6 +881,7 @@ CONFIG_TMPFS=y
879# CONFIG_HUGETLB_PAGE is not set 881# CONFIG_HUGETLB_PAGE is not set
880CONFIG_RAMFS=y 882CONFIG_RAMFS=y
881CONFIG_RELAYFS_FS=m 883CONFIG_RELAYFS_FS=m
884# CONFIG_CONFIGFS_FS is not set
882 885
883# 886#
884# Miscellaneous filesystems 887# Miscellaneous filesystems
@@ -986,6 +989,7 @@ CONFIG_NLS_ISO8859_1=m
986# Kernel hacking 989# Kernel hacking
987# 990#
988# CONFIG_PRINTK_TIME is not set 991# CONFIG_PRINTK_TIME is not set
992# CONFIG_MAGIC_SYSRQ is not set
989# CONFIG_DEBUG_KERNEL is not set 993# CONFIG_DEBUG_KERNEL is not set
990CONFIG_LOG_BUF_SHIFT=14 994CONFIG_LOG_BUF_SHIFT=14
991CONFIG_CROSSCOMPILE=y 995CONFIG_CROSSCOMPILE=y
diff --git a/arch/mips/configs/tb0287_defconfig b/arch/mips/configs/tb0287_defconfig
deleted file mode 100644
index 95344832d66e..000000000000
--- a/arch/mips/configs/tb0287_defconfig
+++ /dev/null
@@ -1,1105 +0,0 @@
1#
2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.14-rc5-mm1
4# Tue Oct 25 00:20:22 2005
5#
6CONFIG_MIPS=y
7
8#
9# Code maturity level options
10#
11CONFIG_EXPERIMENTAL=y
12CONFIG_CLEAN_COMPILE=y
13CONFIG_BROKEN_ON_SMP=y
14CONFIG_INIT_ENV_ARG_LIMIT=32
15
16#
17# General setup
18#
19CONFIG_LOCALVERSION=""
20CONFIG_LOCALVERSION_AUTO=y
21CONFIG_SWAP=y
22CONFIG_SWAP_PREFETCH=y
23CONFIG_SYSVIPC=y
24# CONFIG_POSIX_MQUEUE is not set
25# CONFIG_BSD_PROCESS_ACCT is not set
26CONFIG_SYSCTL=y
27# CONFIG_AUDIT is not set
28# CONFIG_HOTPLUG is not set
29CONFIG_KOBJECT_UEVENT=y
30# CONFIG_IKCONFIG is not set
31CONFIG_INITRAMFS_SOURCE=""
32CONFIG_EMBEDDED=y
33CONFIG_KALLSYMS=y
34# CONFIG_KALLSYMS_EXTRA_PASS is not set
35CONFIG_PRINTK=y
36CONFIG_BUG=y
37CONFIG_BASE_FULL=y
38CONFIG_FUTEX=y
39CONFIG_EPOLL=y
40# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
41CONFIG_SHMEM=y
42CONFIG_CC_ALIGN_FUNCTIONS=0
43CONFIG_CC_ALIGN_LABELS=0
44CONFIG_CC_ALIGN_LOOPS=0
45CONFIG_CC_ALIGN_JUMPS=0
46# CONFIG_TINY_SHMEM is not set
47CONFIG_BASE_SMALL=0
48
49#
50# Loadable module support
51#
52CONFIG_MODULES=y
53CONFIG_MODULE_UNLOAD=y
54# CONFIG_MODULE_FORCE_UNLOAD is not set
55CONFIG_OBSOLETE_MODPARM=y
56CONFIG_MODVERSIONS=y
57CONFIG_MODULE_SRCVERSION_ALL=y
58CONFIG_KMOD=y
59
60#
61# Machine selection
62#
63# CONFIG_MIPS_MTX1 is not set
64# CONFIG_MIPS_BOSPORUS is not set
65# CONFIG_MIPS_PB1000 is not set
66# CONFIG_MIPS_PB1100 is not set
67# CONFIG_MIPS_PB1500 is not set
68# CONFIG_MIPS_PB1550 is not set
69# CONFIG_MIPS_PB1200 is not set
70# CONFIG_MIPS_DB1000 is not set
71# CONFIG_MIPS_DB1100 is not set
72# CONFIG_MIPS_DB1500 is not set
73# CONFIG_MIPS_DB1550 is not set
74# CONFIG_MIPS_DB1200 is not set
75# CONFIG_MIPS_MIRAGE is not set
76# CONFIG_MIPS_COBALT is not set
77# CONFIG_MACH_DECSTATION is not set
78# CONFIG_MIPS_EV64120 is not set
79# CONFIG_MIPS_EV96100 is not set
80# CONFIG_MIPS_IVR is not set
81# CONFIG_MIPS_ITE8172 is not set
82# CONFIG_MACH_JAZZ is not set
83# CONFIG_LASAT is not set
84# CONFIG_MIPS_ATLAS is not set
85# CONFIG_MIPS_MALTA is not set
86# CONFIG_MIPS_SEAD is not set
87# CONFIG_MIPS_SIM is not set
88# CONFIG_MOMENCO_JAGUAR_ATX is not set
89# CONFIG_MOMENCO_OCELOT is not set
90# CONFIG_MOMENCO_OCELOT_3 is not set
91# CONFIG_MOMENCO_OCELOT_C is not set
92# CONFIG_MOMENCO_OCELOT_G is not set
93# CONFIG_MIPS_XXS1500 is not set
94# CONFIG_PNX8550_V2PCI is not set
95# CONFIG_PNX8550_JBS is not set
96# CONFIG_DDB5074 is not set
97# CONFIG_DDB5476 is not set
98# CONFIG_DDB5477 is not set
99CONFIG_MACH_VR41XX=y
100# CONFIG_PMC_YOSEMITE is not set
101# CONFIG_QEMU is not set
102# CONFIG_SGI_IP22 is not set
103# CONFIG_SGI_IP27 is not set
104# CONFIG_SGI_IP32 is not set
105# CONFIG_SIBYTE_SWARM is not set
106# CONFIG_SIBYTE_SENTOSA is not set
107# CONFIG_SIBYTE_RHONE is not set
108# CONFIG_SIBYTE_CARMEL is not set
109# CONFIG_SIBYTE_PTSWARM is not set
110# CONFIG_SIBYTE_LITTLESUR is not set
111# CONFIG_SIBYTE_CRHINE is not set
112# CONFIG_SIBYTE_CRHONE is not set
113# CONFIG_SNI_RM200_PCI is not set
114# CONFIG_TOSHIBA_JMR3927 is not set
115# CONFIG_TOSHIBA_RBTX4927 is not set
116# CONFIG_TOSHIBA_RBTX4938 is not set
117# CONFIG_CASIO_E55 is not set
118# CONFIG_IBM_WORKPAD is not set
119# CONFIG_NEC_CMBVR4133 is not set
120CONFIG_TANBAC_TB022X=y
121# CONFIG_TANBAC_TB0226 is not set
122CONFIG_TANBAC_TB0287=y
123# CONFIG_VICTOR_MPC30X is not set
124# CONFIG_ZAO_CAPCELLA is not set
125CONFIG_PCI_VR41XX=y
126# CONFIG_VRC4173 is not set
127CONFIG_RWSEM_GENERIC_SPINLOCK=y
128CONFIG_GENERIC_CALIBRATE_DELAY=y
129CONFIG_DMA_NONCOHERENT=y
130CONFIG_DMA_NEED_PCI_MAP_STATE=y
131# CONFIG_CPU_BIG_ENDIAN is not set
132CONFIG_CPU_LITTLE_ENDIAN=y
133CONFIG_SYS_SUPPORTS_LITTLE_ENDIAN=y
134CONFIG_IRQ_CPU=y
135CONFIG_MIPS_L1_CACHE_SHIFT=5
136
137#
138# CPU selection
139#
140# CONFIG_CPU_MIPS32_R1 is not set
141# CONFIG_CPU_MIPS32_R2 is not set
142# CONFIG_CPU_MIPS64_R1 is not set
143# CONFIG_CPU_MIPS64_R2 is not set
144# CONFIG_CPU_R3000 is not set
145# CONFIG_CPU_TX39XX is not set
146CONFIG_CPU_VR41XX=y
147# CONFIG_CPU_R4300 is not set
148# CONFIG_CPU_R4X00 is not set
149# CONFIG_CPU_TX49XX is not set
150# CONFIG_CPU_R5000 is not set
151# CONFIG_CPU_R5432 is not set
152# CONFIG_CPU_R6000 is not set
153# CONFIG_CPU_NEVADA is not set
154# CONFIG_CPU_R8000 is not set
155# CONFIG_CPU_R10000 is not set
156# CONFIG_CPU_RM7000 is not set
157# CONFIG_CPU_RM9000 is not set
158# CONFIG_CPU_SB1 is not set
159CONFIG_SYS_SUPPORTS_32BIT_KERNEL=y
160CONFIG_SYS_SUPPORTS_64BIT_KERNEL=y
161CONFIG_CPU_SUPPORTS_32BIT_KERNEL=y
162CONFIG_CPU_SUPPORTS_64BIT_KERNEL=y
163
164#
165# Kernel type
166#
167CONFIG_32BIT=y
168# CONFIG_64BIT is not set
169CONFIG_PAGE_SIZE_4KB=y
170# CONFIG_PAGE_SIZE_8KB is not set
171# CONFIG_PAGE_SIZE_16KB is not set
172# CONFIG_PAGE_SIZE_64KB is not set
173# CONFIG_MIPS_MT is not set
174# CONFIG_CPU_ADVANCED is not set
175CONFIG_CPU_HAS_SYNC=y
176CONFIG_GENERIC_HARDIRQS=y
177CONFIG_GENERIC_IRQ_PROBE=y
178CONFIG_ARCH_FLATMEM_ENABLE=y
179CONFIG_SELECT_MEMORY_MODEL=y
180CONFIG_FLATMEM_MANUAL=y
181# CONFIG_DISCONTIGMEM_MANUAL is not set
182# CONFIG_SPARSEMEM_MANUAL is not set
183CONFIG_FLATMEM=y
184CONFIG_FLAT_NODE_MEM_MAP=y
185# CONFIG_SPARSEMEM_STATIC is not set
186CONFIG_SPLIT_PTLOCK_CPUS=4
187CONFIG_PREEMPT_NONE=y
188# CONFIG_PREEMPT_VOLUNTARY is not set
189# CONFIG_PREEMPT is not set
190
191#
192# Bus options (PCI, PCMCIA, EISA, ISA, TC)
193#
194CONFIG_HW_HAS_PCI=y
195CONFIG_PCI=y
196# CONFIG_PCI_LEGACY_PROC is not set
197CONFIG_MMU=y
198
199#
200# PCCARD (PCMCIA/CardBus) support
201#
202# CONFIG_PCCARD is not set
203
204#
205# PCI Hotplug Support
206#
207# CONFIG_HOTPLUG_PCI is not set
208
209#
210# Executable file formats
211#
212CONFIG_BINFMT_ELF=y
213# CONFIG_BINFMT_MISC is not set
214CONFIG_TRAD_SIGNALS=y
215
216#
217# Networking
218#
219CONFIG_NET=y
220
221#
222# Networking options
223#
224CONFIG_PACKET=y
225# CONFIG_PACKET_MMAP is not set
226CONFIG_UNIX=y
227CONFIG_XFRM=y
228CONFIG_XFRM_USER=m
229# CONFIG_NET_KEY is not set
230CONFIG_INET=y
231CONFIG_IP_MULTICAST=y
232CONFIG_IP_ADVANCED_ROUTER=y
233CONFIG_ASK_IP_FIB_HASH=y
234# CONFIG_IP_FIB_TRIE is not set
235CONFIG_IP_FIB_HASH=y
236CONFIG_IP_MULTIPLE_TABLES=y
237CONFIG_IP_ROUTE_MULTIPATH=y
238# CONFIG_IP_ROUTE_MULTIPATH_CACHED is not set
239CONFIG_IP_ROUTE_VERBOSE=y
240CONFIG_IP_PNP=y
241# CONFIG_IP_PNP_DHCP is not set
242CONFIG_IP_PNP_BOOTP=y
243# CONFIG_IP_PNP_RARP is not set
244CONFIG_NET_IPIP=m
245CONFIG_NET_IPGRE=m
246# CONFIG_NET_IPGRE_BROADCAST is not set
247# CONFIG_IP_MROUTE is not set
248# CONFIG_ARPD is not set
249CONFIG_SYN_COOKIES=y
250# CONFIG_INET_AH is not set
251# CONFIG_INET_ESP is not set
252# CONFIG_INET_IPCOMP is not set
253CONFIG_INET_TUNNEL=m
254CONFIG_INET_DIAG=y
255CONFIG_INET_TCP_DIAG=y
256CONFIG_TCP_CONG_ADVANCED=y
257
258#
259# TCP congestion control
260#
261CONFIG_TCP_CONG_BIC=y
262CONFIG_TCP_CONG_WESTWOOD=m
263CONFIG_TCP_CONG_HTCP=m
264# CONFIG_TCP_CONG_HSTCP is not set
265# CONFIG_TCP_CONG_HYBLA is not set
266# CONFIG_TCP_CONG_VEGAS is not set
267# CONFIG_TCP_CONG_SCALABLE is not set
268# CONFIG_IPV6 is not set
269# CONFIG_NETFILTER is not set
270
271#
272# DCCP Configuration (EXPERIMENTAL)
273#
274# CONFIG_IP_DCCP is not set
275
276#
277# SCTP Configuration (EXPERIMENTAL)
278#
279# CONFIG_IP_SCTP is not set
280# CONFIG_ATM is not set
281# CONFIG_BRIDGE is not set
282# CONFIG_VLAN_8021Q is not set
283# CONFIG_DECNET is not set
284# CONFIG_LLC2 is not set
285# CONFIG_IPX is not set
286# CONFIG_ATALK is not set
287# CONFIG_X25 is not set
288# CONFIG_LAPB is not set
289# CONFIG_NET_DIVERT is not set
290# CONFIG_ECONET is not set
291# CONFIG_WAN_ROUTER is not set
292# CONFIG_NET_SCHED is not set
293# CONFIG_NET_CLS_ROUTE is not set
294
295#
296# Network testing
297#
298# CONFIG_NET_PKTGEN is not set
299# CONFIG_HAMRADIO is not set
300# CONFIG_IRDA is not set
301# CONFIG_BT is not set
302# CONFIG_IEEE80211 is not set
303
304#
305# Device Drivers
306#
307
308#
309# Generic Driver Options
310#
311CONFIG_STANDALONE=y
312CONFIG_PREVENT_FIRMWARE_BUILD=y
313# CONFIG_FW_LOADER is not set
314
315#
316# Connector - unified userspace <-> kernelspace linker
317#
318# CONFIG_CONNECTOR is not set
319
320#
321# Memory Technology Devices (MTD)
322#
323# CONFIG_MTD is not set
324
325#
326# Parallel port support
327#
328# CONFIG_PARPORT is not set
329
330#
331# Plug and Play support
332#
333
334#
335# Block devices
336#
337# CONFIG_BLK_CPQ_DA is not set
338# CONFIG_BLK_CPQ_CISS_DA is not set
339# CONFIG_BLK_DEV_DAC960 is not set
340# CONFIG_BLK_DEV_UMEM is not set
341# CONFIG_BLK_DEV_COW_COMMON is not set
342CONFIG_BLK_DEV_LOOP=m
343# CONFIG_BLK_DEV_CRYPTOLOOP is not set
344CONFIG_BLK_DEV_NBD=m
345# CONFIG_BLK_DEV_SX8 is not set
346# CONFIG_BLK_DEV_UB is not set
347CONFIG_BLK_DEV_RAM=y
348CONFIG_BLK_DEV_RAM_COUNT=16
349CONFIG_BLK_DEV_RAM_SIZE=4096
350# CONFIG_BLK_DEV_INITRD is not set
351# CONFIG_LBD is not set
352# CONFIG_BLK_DEV_IO_TRACE is not set
353# CONFIG_CDROM_PKTCDVD is not set
354
355#
356# IO Schedulers
357#
358CONFIG_IOSCHED_NOOP=y
359CONFIG_IOSCHED_AS=y
360CONFIG_IOSCHED_DEADLINE=y
361CONFIG_IOSCHED_CFQ=y
362CONFIG_DEFAULT_AS=y
363# CONFIG_DEFAULT_DEADLINE is not set
364# CONFIG_DEFAULT_CFQ is not set
365# CONFIG_DEFAULT_NOOP is not set
366CONFIG_DEFAULT_IOSCHED="anticipatory"
367# CONFIG_ATA_OVER_ETH is not set
368
369#
370# ATA/ATAPI/MFM/RLL support
371#
372CONFIG_IDE=y
373CONFIG_BLK_DEV_IDE=y
374
375#
376# Please see Documentation/ide.txt for help/info on IDE drives
377#
378# CONFIG_BLK_DEV_IDE_SATA is not set
379CONFIG_BLK_DEV_IDEDISK=y
380# CONFIG_IDEDISK_MULTI_MODE is not set
381# CONFIG_BLK_DEV_IDECD is not set
382# CONFIG_BLK_DEV_IDETAPE is not set
383# CONFIG_BLK_DEV_IDEFLOPPY is not set
384# CONFIG_BLK_DEV_IDESCSI is not set
385# CONFIG_IDE_TASK_IOCTL is not set
386
387#
388# IDE chipset support/bugfixes
389#
390CONFIG_IDE_GENERIC=y
391CONFIG_BLK_DEV_IDEPCI=y
392# CONFIG_IDEPCI_SHARE_IRQ is not set
393# CONFIG_BLK_DEV_OFFBOARD is not set
394# CONFIG_BLK_DEV_GENERIC is not set
395# CONFIG_BLK_DEV_OPTI621 is not set
396CONFIG_BLK_DEV_IDEDMA_PCI=y
397# CONFIG_BLK_DEV_IDEDMA_FORCED is not set
398# CONFIG_IDEDMA_PCI_AUTO is not set
399# CONFIG_BLK_DEV_AEC62XX is not set
400# CONFIG_BLK_DEV_ALI15X3 is not set
401# CONFIG_BLK_DEV_AMD74XX is not set
402# CONFIG_BLK_DEV_CMD64X is not set
403# CONFIG_BLK_DEV_TRIFLEX is not set
404# CONFIG_BLK_DEV_CY82C693 is not set
405# CONFIG_BLK_DEV_CS5520 is not set
406# CONFIG_BLK_DEV_CS5530 is not set
407# CONFIG_BLK_DEV_HPT34X is not set
408# CONFIG_BLK_DEV_HPT366 is not set
409# CONFIG_BLK_DEV_SC1200 is not set
410# CONFIG_BLK_DEV_PIIX is not set
411# CONFIG_BLK_DEV_IT821X is not set
412# CONFIG_BLK_DEV_NS87415 is not set
413# CONFIG_BLK_DEV_PDC202XX_OLD is not set
414# CONFIG_BLK_DEV_PDC202XX_NEW is not set
415# CONFIG_BLK_DEV_SVWKS is not set
416CONFIG_BLK_DEV_SIIMAGE=y
417# CONFIG_BLK_DEV_SLC90E66 is not set
418# CONFIG_BLK_DEV_TRM290 is not set
419# CONFIG_BLK_DEV_VIA82CXXX is not set
420# CONFIG_IDE_ARM is not set
421CONFIG_BLK_DEV_IDEDMA=y
422# CONFIG_IDEDMA_IVB is not set
423# CONFIG_IDEDMA_AUTO is not set
424# CONFIG_BLK_DEV_HD is not set
425
426#
427# SCSI device support
428#
429# CONFIG_RAID_ATTRS is not set
430CONFIG_SCSI=y
431CONFIG_SCSI_PROC_FS=y
432
433#
434# SCSI support type (disk, tape, CD-ROM)
435#
436CONFIG_BLK_DEV_SD=y
437# CONFIG_CHR_DEV_ST is not set
438# CONFIG_CHR_DEV_OSST is not set
439# CONFIG_BLK_DEV_SR is not set
440# CONFIG_CHR_DEV_SG is not set
441# CONFIG_CHR_DEV_SCH is not set
442
443#
444# Some SCSI devices (e.g. CD jukebox) support multiple LUNs
445#
446# CONFIG_SCSI_MULTI_LUN is not set
447# CONFIG_SCSI_CONSTANTS is not set
448# CONFIG_SCSI_LOGGING is not set
449
450#
451# SCSI Transport Attributes
452#
453# CONFIG_SCSI_SPI_ATTRS is not set
454# CONFIG_SCSI_FC_ATTRS is not set
455# CONFIG_SCSI_ISCSI_ATTRS is not set
456# CONFIG_SCSI_SAS_ATTRS is not set
457
458#
459# SCSI Transport Layers
460#
461# CONFIG_SAS_CLASS is not set
462
463#
464# SCSI low-level drivers
465#
466# CONFIG_ISCSI_TCP is not set
467# CONFIG_SCSI_ARCMSR is not set
468# CONFIG_BLK_DEV_3W_XXXX_RAID is not set
469# CONFIG_SCSI_3W_9XXX is not set
470# CONFIG_SCSI_ACARD is not set
471# CONFIG_SCSI_AACRAID is not set
472# CONFIG_SCSI_AIC7XXX is not set
473# CONFIG_SCSI_AIC7XXX_OLD is not set
474# CONFIG_SCSI_AIC79XX is not set
475# CONFIG_SCSI_DPT_I2O is not set
476# CONFIG_MEGARAID_NEWGEN is not set
477# CONFIG_MEGARAID_LEGACY is not set
478# CONFIG_MEGARAID_SAS is not set
479# CONFIG_SCSI_SATA is not set
480# CONFIG_SCSI_DMX3191D is not set
481# CONFIG_SCSI_FUTURE_DOMAIN is not set
482# CONFIG_SCSI_IPS is not set
483# CONFIG_SCSI_INITIO is not set
484# CONFIG_SCSI_INIA100 is not set
485# CONFIG_SCSI_SYM53C8XX_2 is not set
486# CONFIG_SCSI_IPR is not set
487# CONFIG_SCSI_QLOGIC_FC is not set
488# CONFIG_SCSI_QLOGIC_1280 is not set
489CONFIG_SCSI_QLA2XXX=y
490# CONFIG_SCSI_QLA21XX is not set
491# CONFIG_SCSI_QLA22XX is not set
492# CONFIG_SCSI_QLA2300 is not set
493# CONFIG_SCSI_QLA2322 is not set
494# CONFIG_SCSI_QLA6312 is not set
495# CONFIG_SCSI_QLA24XX is not set
496# CONFIG_SCSI_LPFC is not set
497# CONFIG_SCSI_DC395x is not set
498# CONFIG_SCSI_DC390T is not set
499# CONFIG_SCSI_NSP32 is not set
500# CONFIG_SCSI_DEBUG is not set
501
502#
503# Multi-device support (RAID and LVM)
504#
505# CONFIG_MD is not set
506
507#
508# Fusion MPT device support
509#
510# CONFIG_FUSION is not set
511# CONFIG_FUSION_SPI is not set
512# CONFIG_FUSION_FC is not set
513# CONFIG_FUSION_SAS is not set
514
515#
516# IEEE 1394 (FireWire) support
517#
518CONFIG_IEEE1394=m
519
520#
521# Subsystem Options
522#
523# CONFIG_IEEE1394_VERBOSEDEBUG is not set
524# CONFIG_IEEE1394_OUI_DB is not set
525CONFIG_IEEE1394_EXTRA_CONFIG_ROMS=y
526CONFIG_IEEE1394_CONFIG_ROM_IP1394=y
527# CONFIG_IEEE1394_EXPORT_FULL_API is not set
528
529#
530# Device Drivers
531#
532
533#
534# Texas Instruments PCILynx requires I2C
535#
536CONFIG_IEEE1394_OHCI1394=m
537
538#
539# Protocol Drivers
540#
541CONFIG_IEEE1394_VIDEO1394=m
542CONFIG_IEEE1394_SBP2=m
543# CONFIG_IEEE1394_SBP2_PHYS_DMA is not set
544CONFIG_IEEE1394_ETH1394=m
545CONFIG_IEEE1394_DV1394=m
546CONFIG_IEEE1394_RAWIO=m
547CONFIG_IEEE1394_CMP=m
548CONFIG_IEEE1394_AMDTP=m
549
550#
551# I2O device support
552#
553# CONFIG_I2O is not set
554
555#
556# Network device support
557#
558CONFIG_NETDEVICES=y
559CONFIG_DUMMY=m
560# CONFIG_BONDING is not set
561# CONFIG_EQUALIZER is not set
562# CONFIG_TUN is not set
563
564#
565# ARCnet devices
566#
567# CONFIG_ARCNET is not set
568
569#
570# PHY device support
571#
572# CONFIG_PHYLIB is not set
573
574#
575# Ethernet (10 or 100Mbit)
576#
577CONFIG_NET_ETHERNET=y
578CONFIG_MII=y
579# CONFIG_HAPPYMEAL is not set
580# CONFIG_SUNGEM is not set
581# CONFIG_CASSINI is not set
582# CONFIG_NET_VENDOR_3COM is not set
583
584#
585# Tulip family network device support
586#
587# CONFIG_NET_TULIP is not set
588# CONFIG_HP100 is not set
589# CONFIG_NET_PCI is not set
590
591#
592# Ethernet (1000 Mbit)
593#
594# CONFIG_ACENIC is not set
595# CONFIG_DL2K is not set
596# CONFIG_E1000 is not set
597# CONFIG_NS83820 is not set
598# CONFIG_HAMACHI is not set
599# CONFIG_YELLOWFIN is not set
600CONFIG_R8169=y
601# CONFIG_R8169_NAPI is not set
602# CONFIG_SIS190 is not set
603# CONFIG_SKGE is not set
604# CONFIG_SKY2 is not set
605# CONFIG_SK98LIN is not set
606# CONFIG_TIGON3 is not set
607# CONFIG_BNX2 is not set
608
609#
610# Ethernet (10000 Mbit)
611#
612# CONFIG_CHELSIO_T1 is not set
613# CONFIG_IXGB is not set
614# CONFIG_S2IO is not set
615
616#
617# Token Ring devices
618#
619# CONFIG_TR is not set
620
621#
622# Wireless LAN (non-hamradio)
623#
624# CONFIG_NET_RADIO is not set
625# CONFIG_HOSTAP is not set
626
627#
628# Wan interfaces
629#
630# CONFIG_WAN is not set
631# CONFIG_FDDI is not set
632# CONFIG_HIPPI is not set
633# CONFIG_PPP is not set
634# CONFIG_SLIP is not set
635# CONFIG_NET_FC is not set
636# CONFIG_SHAPER is not set
637# CONFIG_NETCONSOLE is not set
638# CONFIG_KGDBOE is not set
639# CONFIG_NETPOLL is not set
640# CONFIG_NETPOLL_RX is not set
641# CONFIG_NETPOLL_TRAP is not set
642# CONFIG_NET_POLL_CONTROLLER is not set
643
644#
645# ISDN subsystem
646#
647# CONFIG_ISDN is not set
648
649#
650# Telephony Support
651#
652# CONFIG_PHONE is not set
653
654#
655# Input device support
656#
657CONFIG_INPUT=y
658
659#
660# Userland interfaces
661#
662# CONFIG_INPUT_MOUSEDEV is not set
663# CONFIG_INPUT_JOYDEV is not set
664# CONFIG_INPUT_TSDEV is not set
665# CONFIG_INPUT_EVDEV is not set
666# CONFIG_INPUT_EVBUG is not set
667
668#
669# Input Device Drivers
670#
671# CONFIG_INPUT_KEYBOARD is not set
672# CONFIG_INPUT_MOUSE is not set
673# CONFIG_INPUT_JOYSTICK is not set
674# CONFIG_INPUT_TOUCHSCREEN is not set
675# CONFIG_INPUT_MISC is not set
676
677#
678# Hardware I/O ports
679#
680# CONFIG_SERIO is not set
681# CONFIG_GAMEPORT is not set
682
683#
684# Character devices
685#
686CONFIG_VT=y
687CONFIG_VT_CONSOLE=y
688CONFIG_HW_CONSOLE=y
689# CONFIG_SERIAL_NONSTANDARD is not set
690
691#
692# Serial drivers
693#
694# CONFIG_SERIAL_8250 is not set
695
696#
697# Non-8250 serial port support
698#
699CONFIG_SERIAL_CORE=y
700CONFIG_SERIAL_CORE_CONSOLE=y
701CONFIG_SERIAL_VR41XX=y
702CONFIG_SERIAL_VR41XX_CONSOLE=y
703# CONFIG_SERIAL_JSM is not set
704CONFIG_UNIX98_PTYS=y
705CONFIG_LEGACY_PTYS=y
706CONFIG_LEGACY_PTY_COUNT=256
707
708#
709# IPMI
710#
711# CONFIG_IPMI_HANDLER is not set
712
713#
714# Watchdog Cards
715#
716# CONFIG_WATCHDOG is not set
717# CONFIG_RTC is not set
718# CONFIG_GEN_RTC is not set
719# CONFIG_RTC_VR41XX is not set
720# CONFIG_DTLK is not set
721# CONFIG_R3964 is not set
722# CONFIG_APPLICOM is not set
723# CONFIG_TANBAC_TB0219 is not set
724
725#
726# Ftape, the floppy tape device driver
727#
728# CONFIG_DRM is not set
729CONFIG_GPIO_VR41XX=y
730# CONFIG_RAW_DRIVER is not set
731
732#
733# TPM devices
734#
735# CONFIG_TCG_TPM is not set
736# CONFIG_TELCLOCK is not set
737
738#
739# I2C support
740#
741# CONFIG_I2C is not set
742
743#
744# Dallas's 1-wire bus
745#
746# CONFIG_W1 is not set
747
748#
749# Hardware Monitoring support
750#
751# CONFIG_HWMON is not set
752# CONFIG_HWMON_VID is not set
753
754#
755# Misc devices
756#
757
758#
759# Multimedia Capabilities Port drivers
760#
761
762#
763# Multimedia devices
764#
765# CONFIG_VIDEO_DEV is not set
766
767#
768# Digital Video Broadcasting Devices
769#
770# CONFIG_DVB is not set
771
772#
773# Graphics support
774#
775# CONFIG_FB is not set
776
777#
778# Console display driver support
779#
780# CONFIG_VGA_CONSOLE is not set
781CONFIG_DUMMY_CONSOLE=y
782
783#
784# Speakup console speech
785#
786# CONFIG_SPEAKUP is not set
787
788#
789# Sound
790#
791# CONFIG_SOUND is not set
792
793#
794# USB support
795#
796CONFIG_USB_ARCH_HAS_HCD=y
797CONFIG_USB_ARCH_HAS_OHCI=y
798CONFIG_USB=m
799# CONFIG_USB_DEBUG is not set
800
801#
802# Miscellaneous USB options
803#
804# CONFIG_USB_DEVICEFS is not set
805# CONFIG_USB_BANDWIDTH is not set
806# CONFIG_USB_DYNAMIC_MINORS is not set
807# CONFIG_USB_OTG is not set
808
809#
810# USB Host Controller Drivers
811#
812CONFIG_USB_EHCI_HCD=m
813# CONFIG_USB_EHCI_SPLIT_ISO is not set
814# CONFIG_USB_EHCI_ROOT_HUB_TT is not set
815# CONFIG_USB_ISP116X_HCD is not set
816CONFIG_USB_OHCI_HCD=m
817# CONFIG_USB_OHCI_BIG_ENDIAN is not set
818CONFIG_USB_OHCI_LITTLE_ENDIAN=y
819# CONFIG_USB_UHCI_HCD is not set
820# CONFIG_USB_SL811_HCD is not set
821
822#
823# USB Device Class drivers
824#
825# CONFIG_USB_ACM is not set
826# CONFIG_USB_PRINTER is not set
827
828#
829# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support'
830#
831
832#
833# may also be needed; see USB_STORAGE Help for more information
834#
835CONFIG_USB_STORAGE=m
836# CONFIG_USB_STORAGE_DEBUG is not set
837# CONFIG_USB_STORAGE_DATAFAB is not set
838# CONFIG_USB_STORAGE_FREECOM is not set
839# CONFIG_USB_STORAGE_ISD200 is not set
840# CONFIG_USB_STORAGE_DPCM is not set
841# CONFIG_USB_STORAGE_USBAT is not set
842# CONFIG_USB_STORAGE_SDDR09 is not set
843# CONFIG_USB_STORAGE_SDDR55 is not set
844# CONFIG_USB_STORAGE_JUMPSHOT is not set
845
846#
847# USB Input Devices
848#
849CONFIG_USB_HID=m
850CONFIG_USB_HIDINPUT=y
851# CONFIG_HID_FF is not set
852# CONFIG_USB_HIDDEV is not set
853
854#
855# USB HID Boot Protocol drivers
856#
857# CONFIG_USB_KBD is not set
858# CONFIG_USB_MOUSE is not set
859# CONFIG_USB_AIPTEK is not set
860# CONFIG_USB_WACOM is not set
861# CONFIG_USB_ACECAD is not set
862# CONFIG_USB_KBTAB is not set
863# CONFIG_USB_POWERMATE is not set
864# CONFIG_USB_MTOUCH is not set
865# CONFIG_USB_ITMTOUCH is not set
866# CONFIG_USB_EGALAX is not set
867# CONFIG_USB_YEALINK is not set
868# CONFIG_USB_XPAD is not set
869# CONFIG_USB_ATI_REMOTE is not set
870# CONFIG_USB_KEYSPAN_REMOTE is not set
871# CONFIG_USB_APPLETOUCH is not set
872
873#
874# USB Imaging devices
875#
876# CONFIG_USB_MDC800 is not set
877# CONFIG_USB_MICROTEK is not set
878
879#
880# USB Multimedia devices
881#
882# CONFIG_USB_DABUSB is not set
883
884#
885# Video4Linux support is needed for USB Multimedia device support
886#
887
888#
889# USB Network Adapters
890#
891# CONFIG_USB_CATC is not set
892# CONFIG_USB_KAWETH is not set
893# CONFIG_USB_PEGASUS is not set
894# CONFIG_USB_RTL8150 is not set
895# CONFIG_USB_USBNET is not set
896CONFIG_USB_MON=y
897
898#
899# USB port drivers
900#
901
902#
903# USB Serial Converter support
904#
905# CONFIG_USB_SERIAL is not set
906
907#
908# USB Miscellaneous drivers
909#
910# CONFIG_USB_EMI62 is not set
911# CONFIG_USB_EMI26 is not set
912# CONFIG_USB_AUERSWALD is not set
913# CONFIG_USB_RIO500 is not set
914# CONFIG_USB_LEGOTOWER is not set
915# CONFIG_USB_LCD is not set
916# CONFIG_USB_LED is not set
917# CONFIG_USB_CYTHERM is not set
918# CONFIG_USB_GOTEMP is not set
919# CONFIG_USB_PHIDGETKIT is not set
920# CONFIG_USB_PHIDGETSERVO is not set
921# CONFIG_USB_IDMOUSE is not set
922# CONFIG_USB_SISUSBVGA is not set
923# CONFIG_USB_LD is not set
924
925#
926# USB DSL modem support
927#
928
929#
930# USB Gadget Support
931#
932# CONFIG_USB_GADGET is not set
933
934#
935# MMC/SD Card support
936#
937# CONFIG_MMC is not set
938
939#
940# InfiniBand support
941#
942# CONFIG_INFINIBAND is not set
943
944#
945# SN Devices
946#
947
948#
949# EDAC - error detection and reporting (RAS)
950#
951# CONFIG_EDAC is not set
952
953#
954# Distributed Lock Manager
955#
956# CONFIG_DLM is not set
957
958#
959# File systems
960#
961CONFIG_EXT2_FS=y
962# CONFIG_EXT2_FS_XATTR is not set
963# CONFIG_EXT2_FS_XIP is not set
964CONFIG_EXT3_FS=y
965CONFIG_EXT3_FS_XATTR=y
966# CONFIG_EXT3_FS_POSIX_ACL is not set
967# CONFIG_EXT3_FS_SECURITY is not set
968CONFIG_JBD=y
969# CONFIG_JBD_DEBUG is not set
970CONFIG_FS_MBCACHE=y
971# CONFIG_REISER4_FS is not set
972# CONFIG_REISERFS_FS is not set
973# CONFIG_JFS_FS is not set
974# CONFIG_FS_POSIX_ACL is not set
975CONFIG_XFS_FS=y
976CONFIG_XFS_QUOTA=y
977# CONFIG_XFS_SECURITY is not set
978CONFIG_XFS_POSIX_ACL=y
979# CONFIG_XFS_RT is not set
980# CONFIG_OCFS2_FS is not set
981# CONFIG_MINIX_FS is not set
982CONFIG_ROMFS_FS=m
983CONFIG_INOTIFY=y
984# CONFIG_QUOTA is not set
985CONFIG_QUOTACTL=y
986# CONFIG_DNOTIFY is not set
987# CONFIG_AUTOFS_FS is not set
988CONFIG_AUTOFS4_FS=y
989# CONFIG_FUSE_FS is not set
990
991#
992# CD-ROM/DVD Filesystems
993#
994# CONFIG_ISO9660_FS is not set
995# CONFIG_UDF_FS is not set
996
997#
998# DOS/FAT/NT Filesystems
999#
1000# CONFIG_MSDOS_FS is not set
1001# CONFIG_VFAT_FS is not set
1002# CONFIG_NTFS_FS is not set
1003
1004#
1005# Pseudo filesystems
1006#
1007CONFIG_PROC_FS=y
1008CONFIG_PROC_KCORE=y
1009CONFIG_SYSFS=y
1010CONFIG_TMPFS=y
1011# CONFIG_HUGETLB_PAGE is not set
1012CONFIG_RAMFS=y
1013# CONFIG_RELAYFS_FS is not set
1014# CONFIG_CONFIGFS_FS is not set
1015
1016#
1017# Miscellaneous filesystems
1018#
1019# CONFIG_ADFS_FS is not set
1020# CONFIG_AFFS_FS is not set
1021# CONFIG_ASFS_FS is not set
1022# CONFIG_HFS_FS is not set
1023# CONFIG_HFSPLUS_FS is not set
1024# CONFIG_BEFS_FS is not set
1025# CONFIG_BFS_FS is not set
1026# CONFIG_EFS_FS is not set
1027CONFIG_CRAMFS=m
1028# CONFIG_VXFS_FS is not set
1029# CONFIG_HPFS_FS is not set
1030# CONFIG_QNX4FS_FS is not set
1031# CONFIG_SYSV_FS is not set
1032# CONFIG_UFS_FS is not set
1033
1034#
1035# Network File Systems
1036#
1037CONFIG_NFS_FS=y
1038CONFIG_NFS_V3=y
1039# CONFIG_NFS_V3_ACL is not set
1040# CONFIG_NFS_V4 is not set
1041# CONFIG_NFS_DIRECTIO is not set
1042# CONFIG_NFSD is not set
1043CONFIG_ROOT_NFS=y
1044CONFIG_LOCKD=y
1045CONFIG_LOCKD_V4=y
1046CONFIG_NFS_COMMON=y
1047CONFIG_SUNRPC=y
1048# CONFIG_RPCSEC_GSS_KRB5 is not set
1049# CONFIG_RPCSEC_GSS_SPKM3 is not set
1050# CONFIG_SMB_FS is not set
1051# CONFIG_CIFS is not set
1052# CONFIG_NCP_FS is not set
1053# CONFIG_CODA_FS is not set
1054# CONFIG_AFS_FS is not set
1055# CONFIG_9P_FS is not set
1056
1057#
1058# Partition Types
1059#
1060# CONFIG_PARTITION_ADVANCED is not set
1061CONFIG_MSDOS_PARTITION=y
1062
1063#
1064# Native Language Support
1065#
1066# CONFIG_NLS is not set
1067
1068#
1069# Profiling support
1070#
1071# CONFIG_PROFILING is not set
1072
1073#
1074# Kernel hacking
1075#
1076# CONFIG_PRINTK_TIME is not set
1077# CONFIG_DEBUG_KERNEL is not set
1078CONFIG_LOG_BUF_SHIFT=14
1079CONFIG_CROSSCOMPILE=y
1080CONFIG_CMDLINE="mem=64M console=ttyVR0,115200 ip=any root=/dev/nfs"
1081
1082#
1083# Security options
1084#
1085CONFIG_KEYS=y
1086CONFIG_KEYS_DEBUG_PROC_KEYS=y
1087# CONFIG_SECURITY is not set
1088
1089#
1090# Cryptographic options
1091#
1092# CONFIG_CRYPTO is not set
1093
1094#
1095# Hardware crypto devices
1096#
1097
1098#
1099# Library routines
1100#
1101# CONFIG_CRC_CCITT is not set
1102# CONFIG_CRC16 is not set
1103CONFIG_CRC32=y
1104# CONFIG_LIBCRC32C is not set
1105CONFIG_ZLIB_INFLATE=m
diff --git a/arch/mips/configs/workpad_defconfig b/arch/mips/configs/workpad_defconfig
index 02b2551023d4..7132e296d40a 100644
--- a/arch/mips/configs/workpad_defconfig
+++ b/arch/mips/configs/workpad_defconfig
@@ -1,7 +1,7 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.15-rc2 3# Linux kernel version: 2.6.16-rc1
4# Thu Nov 24 01:07:17 2005 4# Fri Jan 27 15:40:36 2006
5# 5#
6CONFIG_MIPS=y 6CONFIG_MIPS=y
7 7
@@ -63,9 +63,9 @@ CONFIG_MACH_VR41XX=y
63# CONFIG_TOSHIBA_JMR3927 is not set 63# CONFIG_TOSHIBA_JMR3927 is not set
64# CONFIG_TOSHIBA_RBTX4927 is not set 64# CONFIG_TOSHIBA_RBTX4927 is not set
65# CONFIG_TOSHIBA_RBTX4938 is not set 65# CONFIG_TOSHIBA_RBTX4938 is not set
66# CONFIG_NEC_CMBVR4133 is not set
67# CONFIG_CASIO_E55 is not set 66# CONFIG_CASIO_E55 is not set
68CONFIG_IBM_WORKPAD=y 67CONFIG_IBM_WORKPAD=y
68# CONFIG_NEC_CMBVR4133 is not set
69# CONFIG_TANBAC_TB022X is not set 69# CONFIG_TANBAC_TB022X is not set
70# CONFIG_VICTOR_MPC30X is not set 70# CONFIG_VICTOR_MPC30X is not set
71# CONFIG_ZAO_CAPCELLA is not set 71# CONFIG_ZAO_CAPCELLA is not set
@@ -88,7 +88,7 @@ CONFIG_MIPS_L1_CACHE_SHIFT=5
88# CONFIG_CPU_MIPS64_R2 is not set 88# CONFIG_CPU_MIPS64_R2 is not set
89# CONFIG_CPU_R3000 is not set 89# CONFIG_CPU_R3000 is not set
90# CONFIG_CPU_TX39XX is not set 90# CONFIG_CPU_TX39XX is not set
91CONFIG_CPU_VR41XX=y 91# CONFIG_CPU_VR41XX is not set
92# CONFIG_CPU_R4300 is not set 92# CONFIG_CPU_R4300 is not set
93# CONFIG_CPU_R4X00 is not set 93# CONFIG_CPU_R4X00 is not set
94# CONFIG_CPU_TX49XX is not set 94# CONFIG_CPU_TX49XX is not set
@@ -101,23 +101,18 @@ CONFIG_CPU_VR41XX=y
101# CONFIG_CPU_RM7000 is not set 101# CONFIG_CPU_RM7000 is not set
102# CONFIG_CPU_RM9000 is not set 102# CONFIG_CPU_RM9000 is not set
103# CONFIG_CPU_SB1 is not set 103# CONFIG_CPU_SB1 is not set
104CONFIG_SYS_HAS_CPU_VR41XX=y
105CONFIG_SYS_SUPPORTS_32BIT_KERNEL=y
106CONFIG_SYS_SUPPORTS_64BIT_KERNEL=y
107CONFIG_CPU_SUPPORTS_32BIT_KERNEL=y
108CONFIG_CPU_SUPPORTS_64BIT_KERNEL=y
109 104
110# 105#
111# Kernel type 106# Kernel type
112# 107#
113CONFIG_32BIT=y 108# CONFIG_32BIT is not set
114# CONFIG_64BIT is not set 109# CONFIG_64BIT is not set
115CONFIG_PAGE_SIZE_4KB=y 110CONFIG_PAGE_SIZE_4KB=y
116# CONFIG_PAGE_SIZE_8KB is not set 111# CONFIG_PAGE_SIZE_8KB is not set
117# CONFIG_PAGE_SIZE_16KB is not set 112# CONFIG_PAGE_SIZE_16KB is not set
118# CONFIG_PAGE_SIZE_64KB is not set 113# CONFIG_PAGE_SIZE_64KB is not set
119# CONFIG_MIPS_MT is not set 114# CONFIG_MIPS_MT is not set
120# CONFIG_CPU_ADVANCED is not set 115CONFIG_CPU_HAS_LLSC=y
121CONFIG_CPU_HAS_SYNC=y 116CONFIG_CPU_HAS_SYNC=y
122CONFIG_GENERIC_HARDIRQS=y 117CONFIG_GENERIC_HARDIRQS=y
123CONFIG_GENERIC_IRQ_PROBE=y 118CONFIG_GENERIC_IRQ_PROBE=y
@@ -153,26 +148,28 @@ CONFIG_SYSVIPC=y
153# CONFIG_BSD_PROCESS_ACCT is not set 148# CONFIG_BSD_PROCESS_ACCT is not set
154CONFIG_SYSCTL=y 149CONFIG_SYSCTL=y
155# CONFIG_AUDIT is not set 150# CONFIG_AUDIT is not set
156CONFIG_HOTPLUG=y
157CONFIG_KOBJECT_UEVENT=y
158# CONFIG_IKCONFIG is not set 151# CONFIG_IKCONFIG is not set
159CONFIG_INITRAMFS_SOURCE="" 152CONFIG_INITRAMFS_SOURCE=""
153# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
160CONFIG_EMBEDDED=y 154CONFIG_EMBEDDED=y
161CONFIG_KALLSYMS=y 155CONFIG_KALLSYMS=y
162# CONFIG_KALLSYMS_EXTRA_PASS is not set 156# CONFIG_KALLSYMS_EXTRA_PASS is not set
157CONFIG_HOTPLUG=y
163CONFIG_PRINTK=y 158CONFIG_PRINTK=y
164CONFIG_BUG=y 159CONFIG_BUG=y
160CONFIG_ELF_CORE=y
165CONFIG_BASE_FULL=y 161CONFIG_BASE_FULL=y
166CONFIG_FUTEX=y 162CONFIG_FUTEX=y
167CONFIG_EPOLL=y 163CONFIG_EPOLL=y
168# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
169CONFIG_SHMEM=y 164CONFIG_SHMEM=y
170CONFIG_CC_ALIGN_FUNCTIONS=0 165CONFIG_CC_ALIGN_FUNCTIONS=0
171CONFIG_CC_ALIGN_LABELS=0 166CONFIG_CC_ALIGN_LABELS=0
172CONFIG_CC_ALIGN_LOOPS=0 167CONFIG_CC_ALIGN_LOOPS=0
173CONFIG_CC_ALIGN_JUMPS=0 168CONFIG_CC_ALIGN_JUMPS=0
169CONFIG_SLAB=y
174# CONFIG_TINY_SHMEM is not set 170# CONFIG_TINY_SHMEM is not set
175CONFIG_BASE_SMALL=0 171CONFIG_BASE_SMALL=0
172# CONFIG_SLOB is not set
176 173
177# 174#
178# Loadable module support 175# Loadable module support
@@ -188,7 +185,6 @@ CONFIG_KMOD=y
188# 185#
189# Block layer 186# Block layer
190# 187#
191# CONFIG_LBD is not set
192 188
193# 189#
194# IO Schedulers 190# IO Schedulers
@@ -234,7 +230,6 @@ CONFIG_PCMCIA_PROBE=y
234# 230#
235CONFIG_BINFMT_ELF=y 231CONFIG_BINFMT_ELF=y
236# CONFIG_BINFMT_MISC is not set 232# CONFIG_BINFMT_MISC is not set
237CONFIG_TRAD_SIGNALS=y
238 233
239# 234#
240# Networking 235# Networking
@@ -289,6 +284,11 @@ CONFIG_TCP_CONG_BIC=y
289# CONFIG_ATALK is not set 284# CONFIG_ATALK is not set
290# CONFIG_X25 is not set 285# CONFIG_X25 is not set
291# CONFIG_LAPB is not set 286# CONFIG_LAPB is not set
287
288#
289# TIPC Configuration (EXPERIMENTAL)
290#
291# CONFIG_TIPC is not set
292# CONFIG_NET_DIVERT is not set 292# CONFIG_NET_DIVERT is not set
293# CONFIG_ECONET is not set 293# CONFIG_ECONET is not set
294# CONFIG_WAN_ROUTER is not set 294# CONFIG_WAN_ROUTER is not set
@@ -309,7 +309,6 @@ CONFIG_IEEE80211=m
309# CONFIG_IEEE80211_DEBUG is not set 309# CONFIG_IEEE80211_DEBUG is not set
310CONFIG_IEEE80211_CRYPT_WEP=m 310CONFIG_IEEE80211_CRYPT_WEP=m
311CONFIG_IEEE80211_CRYPT_CCMP=m 311CONFIG_IEEE80211_CRYPT_CCMP=m
312CONFIG_IEEE80211_CRYPT_TKIP=m
313 312
314# 313#
315# Device Drivers 314# Device Drivers
@@ -445,6 +444,7 @@ CONFIG_NET_ETHERNET=y
445CONFIG_MII=m 444CONFIG_MII=m
446# CONFIG_NET_VENDOR_3COM is not set 445# CONFIG_NET_VENDOR_3COM is not set
447# CONFIG_NET_VENDOR_SMC is not set 446# CONFIG_NET_VENDOR_SMC is not set
447# CONFIG_DM9000 is not set
448# CONFIG_NET_VENDOR_RACAL is not set 448# CONFIG_NET_VENDOR_RACAL is not set
449# CONFIG_AT1700 is not set 449# CONFIG_AT1700 is not set
450# CONFIG_DEPCA is not set 450# CONFIG_DEPCA is not set
@@ -556,10 +556,6 @@ CONFIG_HW_CONSOLE=y
556# 556#
557# Non-8250 serial port support 557# Non-8250 serial port support
558# 558#
559CONFIG_SERIAL_CORE=y
560CONFIG_SERIAL_CORE_CONSOLE=y
561CONFIG_SERIAL_VR41XX=y
562CONFIG_SERIAL_VR41XX_CONSOLE=y
563CONFIG_UNIX98_PTYS=y 559CONFIG_UNIX98_PTYS=y
564CONFIG_LEGACY_PTYS=y 560CONFIG_LEGACY_PTYS=y
565CONFIG_LEGACY_PTY_COUNT=256 561CONFIG_LEGACY_PTY_COUNT=256
@@ -588,7 +584,6 @@ CONFIG_WATCHDOG=y
588# CONFIG_WDT is not set 584# CONFIG_WDT is not set
589# CONFIG_RTC is not set 585# CONFIG_RTC is not set
590# CONFIG_GEN_RTC is not set 586# CONFIG_GEN_RTC is not set
591# CONFIG_RTC_VR41XX is not set
592# CONFIG_DTLK is not set 587# CONFIG_DTLK is not set
593# CONFIG_R3964 is not set 588# CONFIG_R3964 is not set
594 589
@@ -602,7 +597,6 @@ CONFIG_WATCHDOG=y
602# CONFIG_SYNCLINK_CS is not set 597# CONFIG_SYNCLINK_CS is not set
603# CONFIG_CARDMAN_4000 is not set 598# CONFIG_CARDMAN_4000 is not set
604# CONFIG_CARDMAN_4040 is not set 599# CONFIG_CARDMAN_4040 is not set
605# CONFIG_GPIO_VR41XX is not set
606# CONFIG_RAW_DRIVER is not set 600# CONFIG_RAW_DRIVER is not set
607 601
608# 602#
@@ -617,6 +611,12 @@ CONFIG_WATCHDOG=y
617# CONFIG_I2C is not set 611# CONFIG_I2C is not set
618 612
619# 613#
614# SPI support
615#
616# CONFIG_SPI is not set
617# CONFIG_SPI_MASTER is not set
618
619#
620# Dallas's 1-wire bus 620# Dallas's 1-wire bus
621# 621#
622# CONFIG_W1 is not set 622# CONFIG_W1 is not set
@@ -699,12 +699,12 @@ CONFIG_EXT2_FS_POSIX_ACL=y
699CONFIG_EXT2_FS_SECURITY=y 699CONFIG_EXT2_FS_SECURITY=y
700# CONFIG_EXT2_FS_XIP is not set 700# CONFIG_EXT2_FS_XIP is not set
701# CONFIG_EXT3_FS is not set 701# CONFIG_EXT3_FS is not set
702# CONFIG_JBD is not set
703CONFIG_FS_MBCACHE=y 702CONFIG_FS_MBCACHE=y
704# CONFIG_REISERFS_FS is not set 703# CONFIG_REISERFS_FS is not set
705# CONFIG_JFS_FS is not set 704# CONFIG_JFS_FS is not set
706CONFIG_FS_POSIX_ACL=y 705CONFIG_FS_POSIX_ACL=y
707# CONFIG_XFS_FS is not set 706# CONFIG_XFS_FS is not set
707# CONFIG_OCFS2_FS is not set
708# CONFIG_MINIX_FS is not set 708# CONFIG_MINIX_FS is not set
709# CONFIG_ROMFS_FS is not set 709# CONFIG_ROMFS_FS is not set
710CONFIG_INOTIFY=y 710CONFIG_INOTIFY=y
@@ -737,6 +737,7 @@ CONFIG_SYSFS=y
737# CONFIG_HUGETLB_PAGE is not set 737# CONFIG_HUGETLB_PAGE is not set
738CONFIG_RAMFS=y 738CONFIG_RAMFS=y
739CONFIG_RELAYFS_FS=m 739CONFIG_RELAYFS_FS=m
740# CONFIG_CONFIGFS_FS is not set
740 741
741# 742#
742# Miscellaneous filesystems 743# Miscellaneous filesystems
@@ -798,6 +799,7 @@ CONFIG_MSDOS_PARTITION=y
798# Kernel hacking 799# Kernel hacking
799# 800#
800# CONFIG_PRINTK_TIME is not set 801# CONFIG_PRINTK_TIME is not set
802# CONFIG_MAGIC_SYSRQ is not set
801# CONFIG_DEBUG_KERNEL is not set 803# CONFIG_DEBUG_KERNEL is not set
802CONFIG_LOG_BUF_SHIFT=14 804CONFIG_LOG_BUF_SHIFT=14
803CONFIG_CROSSCOMPILE=y 805CONFIG_CROSSCOMPILE=y
diff --git a/arch/mips/configs/yosemite_defconfig b/arch/mips/configs/yosemite_defconfig
index 468c2e443d71..67457850941d 100644
--- a/arch/mips/configs/yosemite_defconfig
+++ b/arch/mips/configs/yosemite_defconfig
@@ -1,7 +1,7 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.15-rc2 3# Linux kernel version: 2.6.16-rc1
4# Thu Nov 24 01:07:19 2005 4# Fri Jan 27 15:40:37 2006
5# 5#
6CONFIG_MIPS=y 6CONFIG_MIPS=y
7 7
@@ -154,8 +154,6 @@ CONFIG_SYSVIPC=y
154# CONFIG_BSD_PROCESS_ACCT is not set 154# CONFIG_BSD_PROCESS_ACCT is not set
155CONFIG_SYSCTL=y 155CONFIG_SYSCTL=y
156# CONFIG_AUDIT is not set 156# CONFIG_AUDIT is not set
157CONFIG_HOTPLUG=y
158CONFIG_KOBJECT_UEVENT=y
159CONFIG_IKCONFIG=y 157CONFIG_IKCONFIG=y
160CONFIG_IKCONFIG_PROC=y 158CONFIG_IKCONFIG_PROC=y
161# CONFIG_CPUSETS is not set 159# CONFIG_CPUSETS is not set
@@ -164,19 +162,22 @@ CONFIG_EMBEDDED=y
164CONFIG_KALLSYMS=y 162CONFIG_KALLSYMS=y
165# CONFIG_KALLSYMS_ALL is not set 163# CONFIG_KALLSYMS_ALL is not set
166# CONFIG_KALLSYMS_EXTRA_PASS is not set 164# CONFIG_KALLSYMS_EXTRA_PASS is not set
165CONFIG_HOTPLUG=y
167CONFIG_PRINTK=y 166CONFIG_PRINTK=y
168CONFIG_BUG=y 167CONFIG_BUG=y
168CONFIG_ELF_CORE=y
169CONFIG_BASE_FULL=y 169CONFIG_BASE_FULL=y
170CONFIG_FUTEX=y 170CONFIG_FUTEX=y
171CONFIG_EPOLL=y 171CONFIG_EPOLL=y
172# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
173CONFIG_SHMEM=y 172CONFIG_SHMEM=y
174CONFIG_CC_ALIGN_FUNCTIONS=0 173CONFIG_CC_ALIGN_FUNCTIONS=0
175CONFIG_CC_ALIGN_LABELS=0 174CONFIG_CC_ALIGN_LABELS=0
176CONFIG_CC_ALIGN_LOOPS=0 175CONFIG_CC_ALIGN_LOOPS=0
177CONFIG_CC_ALIGN_JUMPS=0 176CONFIG_CC_ALIGN_JUMPS=0
177CONFIG_SLAB=y
178# CONFIG_TINY_SHMEM is not set 178# CONFIG_TINY_SHMEM is not set
179CONFIG_BASE_SMALL=0 179CONFIG_BASE_SMALL=0
180# CONFIG_SLOB is not set
180 181
181# 182#
182# Loadable module support 183# Loadable module support
@@ -184,6 +185,7 @@ CONFIG_BASE_SMALL=0
184CONFIG_MODULES=y 185CONFIG_MODULES=y
185CONFIG_MODULE_UNLOAD=y 186CONFIG_MODULE_UNLOAD=y
186CONFIG_OBSOLETE_MODPARM=y 187CONFIG_OBSOLETE_MODPARM=y
188# CONFIG_MODVERSIONS is not set
187# CONFIG_MODULE_SRCVERSION_ALL is not set 189# CONFIG_MODULE_SRCVERSION_ALL is not set
188CONFIG_KMOD=y 190CONFIG_KMOD=y
189CONFIG_STOP_MACHINE=y 191CONFIG_STOP_MACHINE=y
@@ -295,7 +297,6 @@ CONFIG_IEEE80211=m
295# CONFIG_IEEE80211_DEBUG is not set 297# CONFIG_IEEE80211_DEBUG is not set
296CONFIG_IEEE80211_CRYPT_WEP=m 298CONFIG_IEEE80211_CRYPT_WEP=m
297CONFIG_IEEE80211_CRYPT_CCMP=m 299CONFIG_IEEE80211_CRYPT_CCMP=m
298CONFIG_IEEE80211_CRYPT_TKIP=m
299 300
300# 301#
301# Device Drivers 302# Device Drivers
@@ -413,6 +414,7 @@ CONFIG_MII=y
413# CONFIG_SUNGEM is not set 414# CONFIG_SUNGEM is not set
414# CONFIG_CASSINI is not set 415# CONFIG_CASSINI is not set
415# CONFIG_NET_VENDOR_3COM is not set 416# CONFIG_NET_VENDOR_3COM is not set
417# CONFIG_DM9000 is not set
416 418
417# 419#
418# Tulip family network device support 420# Tulip family network device support
@@ -452,8 +454,6 @@ CONFIG_TITAN_GE=y
452# Wireless LAN (non-hamradio) 454# Wireless LAN (non-hamradio)
453# 455#
454# CONFIG_NET_RADIO is not set 456# CONFIG_NET_RADIO is not set
455# CONFIG_IPW_DEBUG is not set
456CONFIG_IPW2200=m
457 457
458# 458#
459# Wan interfaces 459# Wan interfaces
@@ -498,6 +498,7 @@ CONFIG_IPW2200=m
498CONFIG_SERIAL_8250=y 498CONFIG_SERIAL_8250=y
499CONFIG_SERIAL_8250_CONSOLE=y 499CONFIG_SERIAL_8250_CONSOLE=y
500CONFIG_SERIAL_8250_NR_UARTS=4 500CONFIG_SERIAL_8250_NR_UARTS=4
501CONFIG_SERIAL_8250_RUNTIME_UARTS=4
501# CONFIG_SERIAL_8250_EXTENDED is not set 502# CONFIG_SERIAL_8250_EXTENDED is not set
502 503
503# 504#
@@ -505,7 +506,6 @@ CONFIG_SERIAL_8250_NR_UARTS=4
505# 506#
506CONFIG_SERIAL_CORE=y 507CONFIG_SERIAL_CORE=y
507CONFIG_SERIAL_CORE_CONSOLE=y 508CONFIG_SERIAL_CORE_CONSOLE=y
508# CONFIG_SERIAL_JSM is not set
509CONFIG_UNIX98_PTYS=y 509CONFIG_UNIX98_PTYS=y
510CONFIG_LEGACY_PTYS=y 510CONFIG_LEGACY_PTYS=y
511CONFIG_LEGACY_PTY_COUNT=256 511CONFIG_LEGACY_PTY_COUNT=256
@@ -542,6 +542,12 @@ CONFIG_GEN_RTC_X=y
542# CONFIG_I2C is not set 542# CONFIG_I2C is not set
543 543
544# 544#
545# SPI support
546#
547# CONFIG_SPI is not set
548# CONFIG_SPI_MASTER is not set
549
550#
545# Dallas's 1-wire bus 551# Dallas's 1-wire bus
546# 552#
547# CONFIG_W1 is not set 553# CONFIG_W1 is not set
@@ -615,7 +621,6 @@ CONFIG_USB_ARCH_HAS_OHCI=y
615# 621#
616# CONFIG_EXT2_FS is not set 622# CONFIG_EXT2_FS is not set
617# CONFIG_EXT3_FS is not set 623# CONFIG_EXT3_FS is not set
618# CONFIG_JBD is not set
619# CONFIG_REISERFS_FS is not set 624# CONFIG_REISERFS_FS is not set
620# CONFIG_JFS_FS is not set 625# CONFIG_JFS_FS is not set
621# CONFIG_FS_POSIX_ACL is not set 626# CONFIG_FS_POSIX_ACL is not set
@@ -694,12 +699,13 @@ CONFIG_MSDOS_PARTITION=y
694# Kernel hacking 699# Kernel hacking
695# 700#
696# CONFIG_PRINTK_TIME is not set 701# CONFIG_PRINTK_TIME is not set
697CONFIG_DEBUG_KERNEL=y
698# CONFIG_MAGIC_SYSRQ is not set 702# CONFIG_MAGIC_SYSRQ is not set
703CONFIG_DEBUG_KERNEL=y
699CONFIG_LOG_BUF_SHIFT=14 704CONFIG_LOG_BUF_SHIFT=14
700CONFIG_DETECT_SOFTLOCKUP=y 705CONFIG_DETECT_SOFTLOCKUP=y
701# CONFIG_SCHEDSTATS is not set 706# CONFIG_SCHEDSTATS is not set
702# CONFIG_DEBUG_SLAB is not set 707# CONFIG_DEBUG_SLAB is not set
708CONFIG_DEBUG_MUTEXES=y
703# CONFIG_DEBUG_SPINLOCK is not set 709# CONFIG_DEBUG_SPINLOCK is not set
704# CONFIG_DEBUG_SPINLOCK_SLEEP is not set 710# CONFIG_DEBUG_SPINLOCK_SLEEP is not set
705# CONFIG_DEBUG_KOBJECT is not set 711# CONFIG_DEBUG_KOBJECT is not set
@@ -707,6 +713,7 @@ CONFIG_DETECT_SOFTLOCKUP=y
707# CONFIG_DEBUG_INFO is not set 713# CONFIG_DEBUG_INFO is not set
708# CONFIG_DEBUG_FS is not set 714# CONFIG_DEBUG_FS is not set
709# CONFIG_DEBUG_VM is not set 715# CONFIG_DEBUG_VM is not set
716CONFIG_FORCED_INLINING=y
710# CONFIG_RCU_TORTURE_TEST is not set 717# CONFIG_RCU_TORTURE_TEST is not set
711CONFIG_CROSSCOMPILE=y 718CONFIG_CROSSCOMPILE=y
712CONFIG_CMDLINE="" 719CONFIG_CMDLINE=""
diff --git a/arch/mips/ddb5xxx/common/rtc_ds1386.c b/arch/mips/ddb5xxx/common/rtc_ds1386.c
index 995896ac0e39..5dc34daa7150 100644
--- a/arch/mips/ddb5xxx/common/rtc_ds1386.c
+++ b/arch/mips/ddb5xxx/common/rtc_ds1386.c
@@ -165,6 +165,6 @@ rtc_ds1386_init(unsigned long base)
165 WRITE_RTC(0xB, byte); 165 WRITE_RTC(0xB, byte);
166 166
167 /* set the function pointers */ 167 /* set the function pointers */
168 rtc_get_time = rtc_ds1386_get_time; 168 rtc_mips_get_time = rtc_ds1386_get_time;
169 rtc_set_time = rtc_ds1386_set_time; 169 rtc_mips_set_time = rtc_ds1386_set_time;
170} 170}
diff --git a/arch/mips/dec/prom/memory.c b/arch/mips/dec/prom/memory.c
index 83d4556c3cb5..1edaf3074ee9 100644
--- a/arch/mips/dec/prom/memory.c
+++ b/arch/mips/dec/prom/memory.c
@@ -45,7 +45,7 @@ static inline void pmax_setup_memory_region(void)
45 */ 45 */
46 for (memory_page = (unsigned char *)CKSEG1 + CHUNK_SIZE; 46 for (memory_page = (unsigned char *)CKSEG1 + CHUNK_SIZE;
47 mem_err == 0 && memory_page < (unsigned char *)CKSEG1 + 0x1e00000; 47 mem_err == 0 && memory_page < (unsigned char *)CKSEG1 + 0x1e00000;
48 memory_page += CHUNK_SIZE) { 48 memory_page += CHUNK_SIZE) {
49 dummy = *memory_page; 49 dummy = *memory_page;
50 } 50 }
51 memcpy((void *)(CKSEG0 + 0x80), &old_handler, 0x80); 51 memcpy((void *)(CKSEG0 + 0x80), &old_handler, 0x80);
@@ -118,7 +118,7 @@ unsigned long __init prom_free_prom_memory(void)
118 addr = PAGE_SIZE; 118 addr = PAGE_SIZE;
119 while (addr < end) { 119 while (addr < end) {
120 ClearPageReserved(virt_to_page(__va(addr))); 120 ClearPageReserved(virt_to_page(__va(addr)));
121 set_page_count(virt_to_page(__va(addr)), 1); 121 init_page_count(virt_to_page(__va(addr)));
122 free_page((unsigned long)__va(addr)); 122 free_page((unsigned long)__va(addr));
123 addr += PAGE_SIZE; 123 addr += PAGE_SIZE;
124 } 124 }
diff --git a/arch/mips/dec/time.c b/arch/mips/dec/time.c
index 174822344131..74cb055d4bf6 100644
--- a/arch/mips/dec/time.c
+++ b/arch/mips/dec/time.c
@@ -36,41 +36,13 @@
36#include <asm/dec/ioasic_addrs.h> 36#include <asm/dec/ioasic_addrs.h>
37#include <asm/dec/machtype.h> 37#include <asm/dec/machtype.h>
38 38
39
40/*
41 * Returns true if a clock update is in progress
42 */
43static inline unsigned char dec_rtc_is_updating(void)
44{
45 unsigned char uip;
46 unsigned long flags;
47
48 spin_lock_irqsave(&rtc_lock, flags);
49 uip = (CMOS_READ(RTC_FREQ_SELECT) & RTC_UIP);
50 spin_unlock_irqrestore(&rtc_lock, flags);
51 return uip;
52}
53
54static unsigned long dec_rtc_get_time(void) 39static unsigned long dec_rtc_get_time(void)
55{ 40{
56 unsigned int year, mon, day, hour, min, sec, real_year; 41 unsigned int year, mon, day, hour, min, sec, real_year;
57 int i;
58 unsigned long flags; 42 unsigned long flags;
59 43
60 /* The Linux interpretation of the DS1287 clock register contents:
61 * When the Update-In-Progress (UIP) flag goes from 1 to 0, the
62 * RTC registers show the second which has precisely just started.
63 * Let's hope other operating systems interpret the RTC the same way.
64 */
65 /* read RTC exactly on falling edge of update flag */
66 for (i = 0; i < 1000000; i++) /* may take up to 1 second... */
67 if (dec_rtc_is_updating())
68 break;
69 for (i = 0; i < 1000000; i++) /* must try at least 2.228 ms */
70 if (!dec_rtc_is_updating())
71 break;
72 spin_lock_irqsave(&rtc_lock, flags); 44 spin_lock_irqsave(&rtc_lock, flags);
73 /* Isn't this overkill? UIP above should guarantee consistency */ 45
74 do { 46 do {
75 sec = CMOS_READ(RTC_SECONDS); 47 sec = CMOS_READ(RTC_SECONDS);
76 min = CMOS_READ(RTC_MINUTES); 48 min = CMOS_READ(RTC_MINUTES);
@@ -78,7 +50,16 @@ static unsigned long dec_rtc_get_time(void)
78 day = CMOS_READ(RTC_DAY_OF_MONTH); 50 day = CMOS_READ(RTC_DAY_OF_MONTH);
79 mon = CMOS_READ(RTC_MONTH); 51 mon = CMOS_READ(RTC_MONTH);
80 year = CMOS_READ(RTC_YEAR); 52 year = CMOS_READ(RTC_YEAR);
53 /*
54 * The PROM will reset the year to either '72 or '73.
55 * Therefore we store the real year separately, in one
56 * of unused BBU RAM locations.
57 */
58 real_year = CMOS_READ(RTC_DEC_YEAR);
81 } while (sec != CMOS_READ(RTC_SECONDS)); 59 } while (sec != CMOS_READ(RTC_SECONDS));
60
61 spin_unlock_irqrestore(&rtc_lock, flags);
62
82 if (!(CMOS_READ(RTC_CONTROL) & RTC_DM_BINARY) || RTC_ALWAYS_BCD) { 63 if (!(CMOS_READ(RTC_CONTROL) & RTC_DM_BINARY) || RTC_ALWAYS_BCD) {
83 sec = BCD2BIN(sec); 64 sec = BCD2BIN(sec);
84 min = BCD2BIN(min); 65 min = BCD2BIN(min);
@@ -87,13 +68,7 @@ static unsigned long dec_rtc_get_time(void)
87 mon = BCD2BIN(mon); 68 mon = BCD2BIN(mon);
88 year = BCD2BIN(year); 69 year = BCD2BIN(year);
89 } 70 }
90 /* 71
91 * The PROM will reset the year to either '72 or '73.
92 * Therefore we store the real year separately, in one
93 * of unused BBU RAM locations.
94 */
95 real_year = CMOS_READ(RTC_DEC_YEAR);
96 spin_unlock_irqrestore(&rtc_lock, flags);
97 year += real_year - 72 + 2000; 72 year += real_year - 72 + 2000;
98 73
99 return mktime(year, mon, day, hour, min, sec); 74 return mktime(year, mon, day, hour, min, sec);
@@ -193,8 +168,8 @@ static void dec_ioasic_hpt_init(unsigned int count)
193 168
194void __init dec_time_init(void) 169void __init dec_time_init(void)
195{ 170{
196 rtc_get_time = dec_rtc_get_time; 171 rtc_mips_get_time = dec_rtc_get_time;
197 rtc_set_mmss = dec_rtc_set_mmss; 172 rtc_mips_set_mmss = dec_rtc_set_mmss;
198 173
199 mips_timer_state = dec_timer_state; 174 mips_timer_state = dec_timer_state;
200 mips_timer_ack = dec_timer_ack; 175 mips_timer_ack = dec_timer_ack;
diff --git a/arch/mips/defconfig b/arch/mips/defconfig
index 4f125e9e8e0b..42d5cd7927cb 100644
--- a/arch/mips/defconfig
+++ b/arch/mips/defconfig
@@ -1,7 +1,7 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.15-rc2 3# Linux kernel version: 2.6.16-rc1
4# Thu Nov 24 01:05:49 2005 4# Fri Jan 27 15:39:51 2006
5# 5#
6CONFIG_MIPS=y 6CONFIG_MIPS=y
7 7
@@ -158,27 +158,29 @@ CONFIG_SYSVIPC=y
158# CONFIG_BSD_PROCESS_ACCT is not set 158# CONFIG_BSD_PROCESS_ACCT is not set
159CONFIG_SYSCTL=y 159CONFIG_SYSCTL=y
160# CONFIG_AUDIT is not set 160# CONFIG_AUDIT is not set
161# CONFIG_HOTPLUG is not set
162CONFIG_KOBJECT_UEVENT=y
163CONFIG_IKCONFIG=y 161CONFIG_IKCONFIG=y
164CONFIG_IKCONFIG_PROC=y 162CONFIG_IKCONFIG_PROC=y
165CONFIG_INITRAMFS_SOURCE="" 163CONFIG_INITRAMFS_SOURCE=""
164# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
166CONFIG_EMBEDDED=y 165CONFIG_EMBEDDED=y
167CONFIG_KALLSYMS=y 166CONFIG_KALLSYMS=y
168# CONFIG_KALLSYMS_EXTRA_PASS is not set 167# CONFIG_KALLSYMS_EXTRA_PASS is not set
168# CONFIG_HOTPLUG is not set
169CONFIG_PRINTK=y 169CONFIG_PRINTK=y
170CONFIG_BUG=y 170CONFIG_BUG=y
171CONFIG_ELF_CORE=y
171CONFIG_BASE_FULL=y 172CONFIG_BASE_FULL=y
172CONFIG_FUTEX=y 173CONFIG_FUTEX=y
173CONFIG_EPOLL=y 174CONFIG_EPOLL=y
174# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
175CONFIG_SHMEM=y 175CONFIG_SHMEM=y
176CONFIG_CC_ALIGN_FUNCTIONS=0 176CONFIG_CC_ALIGN_FUNCTIONS=0
177CONFIG_CC_ALIGN_LABELS=0 177CONFIG_CC_ALIGN_LABELS=0
178CONFIG_CC_ALIGN_LOOPS=0 178CONFIG_CC_ALIGN_LOOPS=0
179CONFIG_CC_ALIGN_JUMPS=0 179CONFIG_CC_ALIGN_JUMPS=0
180CONFIG_SLAB=y
180# CONFIG_TINY_SHMEM is not set 181# CONFIG_TINY_SHMEM is not set
181CONFIG_BASE_SMALL=0 182CONFIG_BASE_SMALL=0
183# CONFIG_SLOB is not set
182 184
183# 185#
184# Loadable module support 186# Loadable module support
@@ -317,6 +319,28 @@ CONFIG_NETFILTER=y
317CONFIG_NETFILTER_NETLINK=m 319CONFIG_NETFILTER_NETLINK=m
318CONFIG_NETFILTER_NETLINK_QUEUE=m 320CONFIG_NETFILTER_NETLINK_QUEUE=m
319CONFIG_NETFILTER_NETLINK_LOG=m 321CONFIG_NETFILTER_NETLINK_LOG=m
322CONFIG_NETFILTER_XTABLES=m
323CONFIG_NETFILTER_XT_TARGET_CLASSIFY=m
324CONFIG_NETFILTER_XT_TARGET_CONNMARK=m
325CONFIG_NETFILTER_XT_TARGET_MARK=m
326CONFIG_NETFILTER_XT_TARGET_NFQUEUE=m
327CONFIG_NETFILTER_XT_TARGET_NOTRACK=m
328CONFIG_NETFILTER_XT_MATCH_COMMENT=m
329CONFIG_NETFILTER_XT_MATCH_CONNBYTES=m
330CONFIG_NETFILTER_XT_MATCH_CONNMARK=m
331CONFIG_NETFILTER_XT_MATCH_CONNTRACK=m
332CONFIG_NETFILTER_XT_MATCH_DCCP=m
333CONFIG_NETFILTER_XT_MATCH_HELPER=m
334CONFIG_NETFILTER_XT_MATCH_LENGTH=m
335CONFIG_NETFILTER_XT_MATCH_LIMIT=m
336CONFIG_NETFILTER_XT_MATCH_MAC=m
337CONFIG_NETFILTER_XT_MATCH_MARK=m
338CONFIG_NETFILTER_XT_MATCH_PKTTYPE=m
339CONFIG_NETFILTER_XT_MATCH_REALM=m
340CONFIG_NETFILTER_XT_MATCH_SCTP=m
341CONFIG_NETFILTER_XT_MATCH_STATE=m
342CONFIG_NETFILTER_XT_MATCH_STRING=m
343CONFIG_NETFILTER_XT_MATCH_TCPMSS=m
320 344
321# 345#
322# IP: Netfilter Configuration 346# IP: Netfilter Configuration
@@ -335,39 +359,23 @@ CONFIG_IP_NF_AMANDA=m
335CONFIG_IP_NF_PPTP=m 359CONFIG_IP_NF_PPTP=m
336CONFIG_IP_NF_QUEUE=m 360CONFIG_IP_NF_QUEUE=m
337CONFIG_IP_NF_IPTABLES=m 361CONFIG_IP_NF_IPTABLES=m
338CONFIG_IP_NF_MATCH_LIMIT=m
339CONFIG_IP_NF_MATCH_IPRANGE=m 362CONFIG_IP_NF_MATCH_IPRANGE=m
340CONFIG_IP_NF_MATCH_MAC=m
341CONFIG_IP_NF_MATCH_PKTTYPE=m
342CONFIG_IP_NF_MATCH_MARK=m
343CONFIG_IP_NF_MATCH_MULTIPORT=m 363CONFIG_IP_NF_MATCH_MULTIPORT=m
344CONFIG_IP_NF_MATCH_TOS=m 364CONFIG_IP_NF_MATCH_TOS=m
345CONFIG_IP_NF_MATCH_RECENT=m 365CONFIG_IP_NF_MATCH_RECENT=m
346CONFIG_IP_NF_MATCH_ECN=m 366CONFIG_IP_NF_MATCH_ECN=m
347CONFIG_IP_NF_MATCH_DSCP=m 367CONFIG_IP_NF_MATCH_DSCP=m
348CONFIG_IP_NF_MATCH_AH_ESP=m 368CONFIG_IP_NF_MATCH_AH_ESP=m
349CONFIG_IP_NF_MATCH_LENGTH=m
350CONFIG_IP_NF_MATCH_TTL=m 369CONFIG_IP_NF_MATCH_TTL=m
351CONFIG_IP_NF_MATCH_TCPMSS=m
352CONFIG_IP_NF_MATCH_HELPER=m
353CONFIG_IP_NF_MATCH_STATE=m
354CONFIG_IP_NF_MATCH_CONNTRACK=m
355CONFIG_IP_NF_MATCH_OWNER=m 370CONFIG_IP_NF_MATCH_OWNER=m
356CONFIG_IP_NF_MATCH_ADDRTYPE=m 371CONFIG_IP_NF_MATCH_ADDRTYPE=m
357CONFIG_IP_NF_MATCH_REALM=m
358CONFIG_IP_NF_MATCH_SCTP=m
359CONFIG_IP_NF_MATCH_DCCP=m
360CONFIG_IP_NF_MATCH_COMMENT=m
361CONFIG_IP_NF_MATCH_CONNMARK=m
362CONFIG_IP_NF_MATCH_CONNBYTES=m
363CONFIG_IP_NF_MATCH_HASHLIMIT=m 372CONFIG_IP_NF_MATCH_HASHLIMIT=m
364CONFIG_IP_NF_MATCH_STRING=m 373CONFIG_IP_NF_MATCH_POLICY=m
365CONFIG_IP_NF_FILTER=m 374CONFIG_IP_NF_FILTER=m
366CONFIG_IP_NF_TARGET_REJECT=m 375CONFIG_IP_NF_TARGET_REJECT=m
367CONFIG_IP_NF_TARGET_LOG=m 376CONFIG_IP_NF_TARGET_LOG=m
368CONFIG_IP_NF_TARGET_ULOG=m 377CONFIG_IP_NF_TARGET_ULOG=m
369CONFIG_IP_NF_TARGET_TCPMSS=m 378CONFIG_IP_NF_TARGET_TCPMSS=m
370CONFIG_IP_NF_TARGET_NFQUEUE=m
371CONFIG_IP_NF_NAT=m 379CONFIG_IP_NF_NAT=m
372CONFIG_IP_NF_NAT_NEEDED=y 380CONFIG_IP_NF_NAT_NEEDED=y
373CONFIG_IP_NF_TARGET_MASQUERADE=m 381CONFIG_IP_NF_TARGET_MASQUERADE=m
@@ -384,13 +392,9 @@ CONFIG_IP_NF_MANGLE=m
384CONFIG_IP_NF_TARGET_TOS=m 392CONFIG_IP_NF_TARGET_TOS=m
385CONFIG_IP_NF_TARGET_ECN=m 393CONFIG_IP_NF_TARGET_ECN=m
386CONFIG_IP_NF_TARGET_DSCP=m 394CONFIG_IP_NF_TARGET_DSCP=m
387CONFIG_IP_NF_TARGET_MARK=m
388CONFIG_IP_NF_TARGET_CLASSIFY=m
389CONFIG_IP_NF_TARGET_TTL=m 395CONFIG_IP_NF_TARGET_TTL=m
390CONFIG_IP_NF_TARGET_CONNMARK=m
391CONFIG_IP_NF_TARGET_CLUSTERIP=m 396CONFIG_IP_NF_TARGET_CLUSTERIP=m
392CONFIG_IP_NF_RAW=m 397CONFIG_IP_NF_RAW=m
393CONFIG_IP_NF_TARGET_NOTRACK=m
394CONFIG_IP_NF_ARPTABLES=m 398CONFIG_IP_NF_ARPTABLES=m
395CONFIG_IP_NF_ARPFILTER=m 399CONFIG_IP_NF_ARPFILTER=m
396CONFIG_IP_NF_ARP_MANGLE=m 400CONFIG_IP_NF_ARP_MANGLE=m
@@ -400,25 +404,20 @@ CONFIG_IP_NF_ARP_MANGLE=m
400# 404#
401CONFIG_IP6_NF_QUEUE=m 405CONFIG_IP6_NF_QUEUE=m
402CONFIG_IP6_NF_IPTABLES=m 406CONFIG_IP6_NF_IPTABLES=m
403CONFIG_IP6_NF_MATCH_LIMIT=m
404CONFIG_IP6_NF_MATCH_MAC=m
405CONFIG_IP6_NF_MATCH_RT=m 407CONFIG_IP6_NF_MATCH_RT=m
406CONFIG_IP6_NF_MATCH_OPTS=m 408CONFIG_IP6_NF_MATCH_OPTS=m
407CONFIG_IP6_NF_MATCH_FRAG=m 409CONFIG_IP6_NF_MATCH_FRAG=m
408CONFIG_IP6_NF_MATCH_HL=m 410CONFIG_IP6_NF_MATCH_HL=m
409CONFIG_IP6_NF_MATCH_MULTIPORT=m 411CONFIG_IP6_NF_MATCH_MULTIPORT=m
410CONFIG_IP6_NF_MATCH_OWNER=m 412CONFIG_IP6_NF_MATCH_OWNER=m
411CONFIG_IP6_NF_MATCH_MARK=m
412CONFIG_IP6_NF_MATCH_IPV6HEADER=m 413CONFIG_IP6_NF_MATCH_IPV6HEADER=m
413CONFIG_IP6_NF_MATCH_AHESP=m 414CONFIG_IP6_NF_MATCH_AHESP=m
414CONFIG_IP6_NF_MATCH_LENGTH=m
415CONFIG_IP6_NF_MATCH_EUI64=m 415CONFIG_IP6_NF_MATCH_EUI64=m
416CONFIG_IP6_NF_MATCH_POLICY=m
416CONFIG_IP6_NF_FILTER=m 417CONFIG_IP6_NF_FILTER=m
417CONFIG_IP6_NF_TARGET_LOG=m 418CONFIG_IP6_NF_TARGET_LOG=m
418CONFIG_IP6_NF_TARGET_REJECT=m 419CONFIG_IP6_NF_TARGET_REJECT=m
419CONFIG_IP6_NF_TARGET_NFQUEUE=m
420CONFIG_IP6_NF_MANGLE=m 420CONFIG_IP6_NF_MANGLE=m
421CONFIG_IP6_NF_TARGET_MARK=m
422CONFIG_IP6_NF_TARGET_HL=m 421CONFIG_IP6_NF_TARGET_HL=m
423CONFIG_IP6_NF_RAW=m 422CONFIG_IP6_NF_RAW=m
424 423
@@ -445,6 +444,11 @@ CONFIG_SCTP_HMAC_MD5=y
445# CONFIG_ATALK is not set 444# CONFIG_ATALK is not set
446# CONFIG_X25 is not set 445# CONFIG_X25 is not set
447# CONFIG_LAPB is not set 446# CONFIG_LAPB is not set
447
448#
449# TIPC Configuration (EXPERIMENTAL)
450#
451# CONFIG_TIPC is not set
448CONFIG_NET_DIVERT=y 452CONFIG_NET_DIVERT=y
449# CONFIG_ECONET is not set 453# CONFIG_ECONET is not set
450# CONFIG_WAN_ROUTER is not set 454# CONFIG_WAN_ROUTER is not set
@@ -504,7 +508,6 @@ CONFIG_IEEE80211=m
504# CONFIG_IEEE80211_DEBUG is not set 508# CONFIG_IEEE80211_DEBUG is not set
505CONFIG_IEEE80211_CRYPT_WEP=m 509CONFIG_IEEE80211_CRYPT_WEP=m
506CONFIG_IEEE80211_CRYPT_CCMP=m 510CONFIG_IEEE80211_CRYPT_CCMP=m
507CONFIG_IEEE80211_CRYPT_TKIP=m
508 511
509# 512#
510# Device Drivers 513# Device Drivers
@@ -641,6 +644,7 @@ CONFIG_CICADA_PHY=m
641# 644#
642CONFIG_NET_ETHERNET=y 645CONFIG_NET_ETHERNET=y
643# CONFIG_MII is not set 646# CONFIG_MII is not set
647# CONFIG_DM9000 is not set
644CONFIG_SGISEEQ=y 648CONFIG_SGISEEQ=y
645 649
646# 650#
@@ -787,6 +791,12 @@ CONFIG_MAX_RAW_DEVS=256
787# CONFIG_I2C is not set 791# CONFIG_I2C is not set
788 792
789# 793#
794# SPI support
795#
796# CONFIG_SPI is not set
797# CONFIG_SPI_MASTER is not set
798
799#
790# Dallas's 1-wire bus 800# Dallas's 1-wire bus
791# 801#
792# CONFIG_W1 is not set 802# CONFIG_W1 is not set
@@ -892,6 +902,7 @@ CONFIG_XFS_QUOTA=y
892CONFIG_XFS_SECURITY=y 902CONFIG_XFS_SECURITY=y
893# CONFIG_XFS_POSIX_ACL is not set 903# CONFIG_XFS_POSIX_ACL is not set
894# CONFIG_XFS_RT is not set 904# CONFIG_XFS_RT is not set
905# CONFIG_OCFS2_FS is not set
895CONFIG_MINIX_FS=m 906CONFIG_MINIX_FS=m
896# CONFIG_ROMFS_FS is not set 907# CONFIG_ROMFS_FS is not set
897CONFIG_INOTIFY=y 908CONFIG_INOTIFY=y
@@ -934,6 +945,7 @@ CONFIG_SYSFS=y
934# CONFIG_HUGETLB_PAGE is not set 945# CONFIG_HUGETLB_PAGE is not set
935CONFIG_RAMFS=y 946CONFIG_RAMFS=y
936CONFIG_RELAYFS_FS=m 947CONFIG_RELAYFS_FS=m
948# CONFIG_CONFIGFS_FS is not set
937 949
938# 950#
939# Miscellaneous filesystems 951# Miscellaneous filesystems
@@ -1007,6 +1019,7 @@ CONFIG_MSDOS_PARTITION=y
1007CONFIG_SGI_PARTITION=y 1019CONFIG_SGI_PARTITION=y
1008# CONFIG_ULTRIX_PARTITION is not set 1020# CONFIG_ULTRIX_PARTITION is not set
1009# CONFIG_SUN_PARTITION is not set 1021# CONFIG_SUN_PARTITION is not set
1022# CONFIG_KARMA_PARTITION is not set
1010# CONFIG_EFI_PARTITION is not set 1023# CONFIG_EFI_PARTITION is not set
1011 1024
1012# 1025#
@@ -1062,6 +1075,7 @@ CONFIG_NLS_UTF8=m
1062# Kernel hacking 1075# Kernel hacking
1063# 1076#
1064# CONFIG_PRINTK_TIME is not set 1077# CONFIG_PRINTK_TIME is not set
1078# CONFIG_MAGIC_SYSRQ is not set
1065# CONFIG_DEBUG_KERNEL is not set 1079# CONFIG_DEBUG_KERNEL is not set
1066CONFIG_LOG_BUF_SHIFT=14 1080CONFIG_LOG_BUF_SHIFT=14
1067CONFIG_CROSSCOMPILE=y 1081CONFIG_CROSSCOMPILE=y
diff --git a/arch/mips/ite-boards/generic/time.c b/arch/mips/ite-boards/generic/time.c
index f5d67ee21ac6..b79817bb6cce 100644
--- a/arch/mips/ite-boards/generic/time.c
+++ b/arch/mips/ite-boards/generic/time.c
@@ -227,8 +227,8 @@ void __init it8172_time_init(void)
227 227
228 local_irq_restore(flags); 228 local_irq_restore(flags);
229 229
230 rtc_get_time = it8172_rtc_get_time; 230 rtc_mips_get_time = it8172_rtc_get_time;
231 rtc_set_time = it8172_rtc_set_time; 231 rtc_mips_set_time = it8172_rtc_set_time;
232} 232}
233 233
234#define ALLINTS (IE_IRQ0 | IE_IRQ1 | IE_IRQ2 | IE_IRQ3 | IE_IRQ4 | IE_IRQ5) 234#define ALLINTS (IE_IRQ0 | IE_IRQ1 | IE_IRQ2 | IE_IRQ3 | IE_IRQ4 | IE_IRQ5)
diff --git a/arch/mips/ite-boards/ivr/init.c b/arch/mips/ite-boards/ivr/init.c
index ea4e1935fec5..b774db035b31 100644
--- a/arch/mips/ite-boards/ivr/init.c
+++ b/arch/mips/ite-boards/ivr/init.c
@@ -45,9 +45,6 @@ extern void __init prom_init_cmdline(void);
45extern unsigned long __init prom_get_memsize(void); 45extern unsigned long __init prom_get_memsize(void);
46extern void __init it8172_init_ram_resource(unsigned long memsize); 46extern void __init it8172_init_ram_resource(unsigned long memsize);
47 47
48#define PFN_UP(x) (((x) + PAGE_SIZE-1) >> PAGE_SHIFT)
49#define PFN_ALIGN(x) (((unsigned long)(x) + (PAGE_SIZE - 1)) & PAGE_MASK)
50
51const char *get_system_type(void) 48const char *get_system_type(void)
52{ 49{
53 return "Globespan IVR"; 50 return "Globespan IVR";
diff --git a/arch/mips/ite-boards/qed-4n-s01b/init.c b/arch/mips/ite-boards/qed-4n-s01b/init.c
index 56dca7e0c21d..e8ec8be66a80 100644
--- a/arch/mips/ite-boards/qed-4n-s01b/init.c
+++ b/arch/mips/ite-boards/qed-4n-s01b/init.c
@@ -45,9 +45,6 @@ extern void __init prom_init_cmdline(void);
45extern unsigned long __init prom_get_memsize(void); 45extern unsigned long __init prom_get_memsize(void);
46extern void __init it8172_init_ram_resource(unsigned long memsize); 46extern void __init it8172_init_ram_resource(unsigned long memsize);
47 47
48#define PFN_UP(x) (((x) + PAGE_SIZE-1) >> PAGE_SHIFT)
49#define PFN_ALIGN(x) (((unsigned long)(x) + (PAGE_SIZE - 1)) & PAGE_MASK)
50
51const char *get_system_type(void) 48const char *get_system_type(void)
52{ 49{
53 return "ITE QED-4N-S01B"; 50 return "ITE QED-4N-S01B";
diff --git a/arch/mips/jazz/int-handler.S b/arch/mips/jazz/int-handler.S
index 4dbcf91db884..dc752c67b528 100644
--- a/arch/mips/jazz/int-handler.S
+++ b/arch/mips/jazz/int-handler.S
@@ -248,17 +248,17 @@ loc_call: /*
248 and t2,s1 248 and t2,s1
249 sh t2,JAZZ_IO_IRQ_ENABLE 249 sh t2,JAZZ_IO_IRQ_ENABLE
250 250
251 nor s1,zero,s1 251 nor s1,zero,s1
252 jal do_IRQ 252 jal do_IRQ
253 253
254 /* 254 /*
255 * Reenable interrupt 255 * Reenable interrupt
256 */ 256 */
257 lhu t2,JAZZ_IO_IRQ_ENABLE 257 lhu t2,JAZZ_IO_IRQ_ENABLE
258 or t2,s1 258 or t2,s1
259 sh t2,JAZZ_IO_IRQ_ENABLE 259 sh t2,JAZZ_IO_IRQ_ENABLE
260 260
261 j ret_from_irq 261 j ret_from_irq
262 262
263/* 263/*
264 * "Jump extender" to reach spurious_interrupt 264 * "Jump extender" to reach spurious_interrupt
diff --git a/arch/mips/jmr3927/common/rtc_ds1742.c b/arch/mips/jmr3927/common/rtc_ds1742.c
index 9a8bff153d80..a6bd3f4d3049 100644
--- a/arch/mips/jmr3927/common/rtc_ds1742.c
+++ b/arch/mips/jmr3927/common/rtc_ds1742.c
@@ -159,8 +159,8 @@ rtc_ds1742_init(unsigned long base)
159 db_assert((rtc_base & 0xe0000000) == KSEG1); 159 db_assert((rtc_base & 0xe0000000) == KSEG1);
160 160
161 /* set the function pointers */ 161 /* set the function pointers */
162 rtc_get_time = rtc_ds1742_get_time; 162 rtc_mips_get_time = rtc_ds1742_get_time;
163 rtc_set_time = rtc_ds1742_set_time; 163 rtc_mips_set_time = rtc_ds1742_set_time;
164 164
165 /* clear oscillator stop bit */ 165 /* clear oscillator stop bit */
166 CMOS_WRITE(RTC_READ, RTC_CONTROL); 166 CMOS_WRITE(RTC_READ, RTC_CONTROL);
diff --git a/arch/mips/kernel/cpu-probe.c b/arch/mips/kernel/cpu-probe.c
index 292f8b243a5e..58b3b14873cb 100644
--- a/arch/mips/kernel/cpu-probe.c
+++ b/arch/mips/kernel/cpu-probe.c
@@ -291,7 +291,7 @@ static inline void cpu_probe_legacy(struct cpuinfo_mips *c)
291 * for documentation. Commented out because it shares 291 * for documentation. Commented out because it shares
292 * it's c0_prid id number with the TX3900. 292 * it's c0_prid id number with the TX3900.
293 */ 293 */
294 c->cputype = CPU_R4650; 294 c->cputype = CPU_R4650;
295 c->isa_level = MIPS_CPU_ISA_III; 295 c->isa_level = MIPS_CPU_ISA_III;
296 c->options = R4K_OPTS | MIPS_CPU_FPU | MIPS_CPU_LLSC; 296 c->options = R4K_OPTS | MIPS_CPU_FPU | MIPS_CPU_LLSC;
297 c->tlbsize = 48; 297 c->tlbsize = 48;
@@ -604,7 +604,7 @@ static inline void cpu_probe_alchemy(struct cpuinfo_mips *c)
604 case PRID_IMP_AU1_REV2: 604 case PRID_IMP_AU1_REV2:
605 switch ((c->processor_id >> 24) & 0xff) { 605 switch ((c->processor_id >> 24) & 0xff) {
606 case 0: 606 case 0:
607 c->cputype = CPU_AU1000; 607 c->cputype = CPU_AU1000;
608 break; 608 break;
609 case 1: 609 case 1:
610 c->cputype = CPU_AU1500; 610 c->cputype = CPU_AU1500;
@@ -705,7 +705,7 @@ __init void cpu_probe(void)
705 break; 705 break;
706 case PRID_COMP_PHILIPS: 706 case PRID_COMP_PHILIPS:
707 cpu_probe_philips(c); 707 cpu_probe_philips(c);
708 break; 708 break;
709 default: 709 default:
710 c->cputype = CPU_UNKNOWN; 710 c->cputype = CPU_UNKNOWN;
711 } 711 }
diff --git a/arch/mips/kernel/gdb-low.S b/arch/mips/kernel/gdb-low.S
index 83b8986f9401..235ad9f6bd35 100644
--- a/arch/mips/kernel/gdb-low.S
+++ b/arch/mips/kernel/gdb-low.S
@@ -41,7 +41,7 @@
41 */ 41 */
42 .align 5 42 .align 5
43 NESTED(trap_low, GDB_FR_SIZE, sp) 43 NESTED(trap_low, GDB_FR_SIZE, sp)
44 .set noat 44 .set noat
45 .set noreorder 45 .set noreorder
46 46
47 mfc0 k0, CP0_STATUS 47 mfc0 k0, CP0_STATUS
diff --git a/arch/mips/kernel/irixsig.c b/arch/mips/kernel/irixsig.c
index 08273a2a501d..8150f071f80a 100644
--- a/arch/mips/kernel/irixsig.c
+++ b/arch/mips/kernel/irixsig.c
@@ -603,7 +603,7 @@ repeat:
603 /* move to end of parent's list to avoid starvation */ 603 /* move to end of parent's list to avoid starvation */
604 write_lock_irq(&tasklist_lock); 604 write_lock_irq(&tasklist_lock);
605 remove_parent(p); 605 remove_parent(p);
606 add_parent(p, p->parent); 606 add_parent(p);
607 write_unlock_irq(&tasklist_lock); 607 write_unlock_irq(&tasklist_lock);
608 retval = ru ? getrusage(p, RUSAGE_BOTH, ru) : 0; 608 retval = ru ? getrusage(p, RUSAGE_BOTH, ru) : 0;
609 if (retval) 609 if (retval)
@@ -643,7 +643,7 @@ repeat:
643 write_lock_irq(&tasklist_lock); 643 write_lock_irq(&tasklist_lock);
644 remove_parent(p); 644 remove_parent(p);
645 p->parent = p->real_parent; 645 p->parent = p->real_parent;
646 add_parent(p, p->parent); 646 add_parent(p);
647 do_notify_parent(p, SIGCHLD); 647 do_notify_parent(p, SIGCHLD);
648 write_unlock_irq(&tasklist_lock); 648 write_unlock_irq(&tasklist_lock);
649 } else 649 } else
diff --git a/arch/mips/kernel/irq.c b/arch/mips/kernel/irq.c
index 7d93992e462c..3dd76b3d2967 100644
--- a/arch/mips/kernel/irq.c
+++ b/arch/mips/kernel/irq.c
@@ -68,9 +68,8 @@ int show_interrupts(struct seq_file *p, void *v)
68 68
69 if (i == 0) { 69 if (i == 0) {
70 seq_printf(p, " "); 70 seq_printf(p, " ");
71 for (j=0; j<NR_CPUS; j++) 71 for_each_online_cpu(j)
72 if (cpu_online(j)) 72 seq_printf(p, "CPU%d ",j);
73 seq_printf(p, "CPU%d ",j);
74 seq_putc(p, '\n'); 73 seq_putc(p, '\n');
75 } 74 }
76 75
@@ -83,9 +82,8 @@ int show_interrupts(struct seq_file *p, void *v)
83#ifndef CONFIG_SMP 82#ifndef CONFIG_SMP
84 seq_printf(p, "%10u ", kstat_irqs(i)); 83 seq_printf(p, "%10u ", kstat_irqs(i));
85#else 84#else
86 for (j = 0; j < NR_CPUS; j++) 85 for_each_online_cpu(j)
87 if (cpu_online(j)) 86 seq_printf(p, "%10u ", kstat_cpu(j).irqs[i]);
88 seq_printf(p, "%10u ", kstat_cpu(j).irqs[i]);
89#endif 87#endif
90 seq_printf(p, " %14s", irq_desc[i].handler->typename); 88 seq_printf(p, " %14s", irq_desc[i].handler->typename);
91 seq_printf(p, " %s", action->name); 89 seq_printf(p, " %s", action->name);
diff --git a/arch/mips/kernel/linux32.c b/arch/mips/kernel/linux32.c
index e00e5f6e7fdd..3f40c37a9ee6 100644
--- a/arch/mips/kernel/linux32.c
+++ b/arch/mips/kernel/linux32.c
@@ -30,7 +30,6 @@
30#include <linux/utime.h> 30#include <linux/utime.h>
31#include <linux/utsname.h> 31#include <linux/utsname.h>
32#include <linux/personality.h> 32#include <linux/personality.h>
33#include <linux/timex.h>
34#include <linux/dnotify.h> 33#include <linux/dnotify.h>
35#include <linux/module.h> 34#include <linux/module.h>
36#include <linux/binfmts.h> 35#include <linux/binfmts.h>
@@ -69,7 +68,7 @@
69 * Revalidate the inode. This is required for proper NFS attribute caching. 68 * Revalidate the inode. This is required for proper NFS attribute caching.
70 */ 69 */
71 70
72int cp_compat_stat(struct kstat *stat, struct compat_stat *statbuf) 71int cp_compat_stat(struct kstat *stat, struct compat_stat __user *statbuf)
73{ 72{
74 struct compat_stat tmp; 73 struct compat_stat tmp;
75 74
@@ -106,6 +105,10 @@ sys32_mmap2(unsigned long addr, unsigned long len, unsigned long prot,
106 unsigned long error; 105 unsigned long error;
107 106
108 error = -EINVAL; 107 error = -EINVAL;
108 if (pgoff & (~PAGE_MASK >> 12))
109 goto out;
110 pgoff >>= PAGE_SHIFT-12;
111
109 if (!(flags & MAP_ANONYMOUS)) { 112 if (!(flags & MAP_ANONYMOUS)) {
110 error = -EBADF; 113 error = -EBADF;
111 file = fget(fd); 114 file = fget(fd);
@@ -125,7 +128,7 @@ out:
125} 128}
126 129
127 130
128asmlinkage int sys_truncate64(const char *path, unsigned int high, 131asmlinkage int sys_truncate64(const char __user *path, unsigned int high,
129 unsigned int low) 132 unsigned int low)
130{ 133{
131 if ((int)high < 0) 134 if ((int)high < 0)
@@ -161,12 +164,6 @@ out:
161 return error; 164 return error;
162} 165}
163 166
164asmlinkage int
165sys32_waitpid(compat_pid_t pid, unsigned int *stat_addr, int options)
166{
167 return compat_sys_wait4(pid, stat_addr, options, NULL);
168}
169
170asmlinkage long 167asmlinkage long
171sysn32_waitid(int which, compat_pid_t pid, 168sysn32_waitid(int which, compat_pid_t pid,
172 siginfo_t __user *uinfo, int options, 169 siginfo_t __user *uinfo, int options,
@@ -175,6 +172,7 @@ sysn32_waitid(int which, compat_pid_t pid,
175 struct rusage ru; 172 struct rusage ru;
176 long ret; 173 long ret;
177 mm_segment_t old_fs = get_fs(); 174 mm_segment_t old_fs = get_fs();
175 int si_signo;
178 176
179 if (!access_ok(VERIFY_WRITE, uinfo, sizeof(*uinfo))) 177 if (!access_ok(VERIFY_WRITE, uinfo, sizeof(*uinfo)))
180 return -EFAULT; 178 return -EFAULT;
@@ -184,7 +182,9 @@ sysn32_waitid(int which, compat_pid_t pid,
184 uru ? (struct rusage __user *) &ru : NULL); 182 uru ? (struct rusage __user *) &ru : NULL);
185 set_fs (old_fs); 183 set_fs (old_fs);
186 184
187 if (ret < 0 || uinfo->si_signo == 0) 185 if (__get_user(si_signo, &uinfo->si_signo))
186 return -EFAULT;
187 if (ret < 0 || si_signo == 0)
188 return ret; 188 return ret;
189 189
190 if (uru) 190 if (uru)
@@ -208,14 +208,14 @@ struct sysinfo32 {
208 char _f[8]; 208 char _f[8];
209}; 209};
210 210
211asmlinkage int sys32_sysinfo(struct sysinfo32 *info) 211asmlinkage int sys32_sysinfo(struct sysinfo32 __user *info)
212{ 212{
213 struct sysinfo s; 213 struct sysinfo s;
214 int ret, err; 214 int ret, err;
215 mm_segment_t old_fs = get_fs (); 215 mm_segment_t old_fs = get_fs ();
216 216
217 set_fs (KERNEL_DS); 217 set_fs (KERNEL_DS);
218 ret = sys_sysinfo(&s); 218 ret = sys_sysinfo((struct sysinfo __user *)&s);
219 set_fs (old_fs); 219 set_fs (old_fs);
220 err = put_user (s.uptime, &info->uptime); 220 err = put_user (s.uptime, &info->uptime);
221 err |= __put_user (s.loads[0], &info->loads[0]); 221 err |= __put_user (s.loads[0], &info->loads[0]);
@@ -245,11 +245,11 @@ struct rlimit32 {
245}; 245};
246 246
247#ifdef __MIPSEB__ 247#ifdef __MIPSEB__
248asmlinkage long sys32_truncate64(const char * path, unsigned long __dummy, 248asmlinkage long sys32_truncate64(const char __user * path, unsigned long __dummy,
249 int length_hi, int length_lo) 249 int length_hi, int length_lo)
250#endif 250#endif
251#ifdef __MIPSEL__ 251#ifdef __MIPSEL__
252asmlinkage long sys32_truncate64(const char * path, unsigned long __dummy, 252asmlinkage long sys32_truncate64(const char __user * path, unsigned long __dummy,
253 int length_lo, int length_hi) 253 int length_lo, int length_hi)
254#endif 254#endif
255{ 255{
@@ -277,7 +277,7 @@ asmlinkage long sys32_ftruncate64(unsigned int fd, unsigned long __dummy,
277} 277}
278 278
279static inline long 279static inline long
280get_tv32(struct timeval *o, struct compat_timeval *i) 280get_tv32(struct timeval *o, struct compat_timeval __user *i)
281{ 281{
282 return (!access_ok(VERIFY_READ, i, sizeof(*i)) || 282 return (!access_ok(VERIFY_READ, i, sizeof(*i)) ||
283 (__get_user(o->tv_sec, &i->tv_sec) | 283 (__get_user(o->tv_sec, &i->tv_sec) |
@@ -285,7 +285,7 @@ get_tv32(struct timeval *o, struct compat_timeval *i)
285} 285}
286 286
287static inline long 287static inline long
288put_tv32(struct compat_timeval *o, struct timeval *i) 288put_tv32(struct compat_timeval __user *o, struct timeval *i)
289{ 289{
290 return (!access_ok(VERIFY_WRITE, o, sizeof(*o)) || 290 return (!access_ok(VERIFY_WRITE, o, sizeof(*o)) ||
291 (__put_user(i->tv_sec, &o->tv_sec) | 291 (__put_user(i->tv_sec, &o->tv_sec) |
@@ -295,7 +295,7 @@ put_tv32(struct compat_timeval *o, struct timeval *i)
295extern struct timezone sys_tz; 295extern struct timezone sys_tz;
296 296
297asmlinkage int 297asmlinkage int
298sys32_gettimeofday(struct compat_timeval *tv, struct timezone *tz) 298sys32_gettimeofday(struct compat_timeval __user *tv, struct timezone __user *tz)
299{ 299{
300 if (tv) { 300 if (tv) {
301 struct timeval ktv; 301 struct timeval ktv;
@@ -310,7 +310,7 @@ sys32_gettimeofday(struct compat_timeval *tv, struct timezone *tz)
310 return 0; 310 return 0;
311} 311}
312 312
313static inline long get_ts32(struct timespec *o, struct compat_timeval *i) 313static inline long get_ts32(struct timespec *o, struct compat_timeval __user *i)
314{ 314{
315 long usec; 315 long usec;
316 316
@@ -325,7 +325,7 @@ static inline long get_ts32(struct timespec *o, struct compat_timeval *i)
325} 325}
326 326
327asmlinkage int 327asmlinkage int
328sys32_settimeofday(struct compat_timeval *tv, struct timezone *tz) 328sys32_settimeofday(struct compat_timeval __user *tv, struct timezone __user *tz)
329{ 329{
330 struct timespec kts; 330 struct timespec kts;
331 struct timezone ktz; 331 struct timezone ktz;
@@ -343,7 +343,7 @@ sys32_settimeofday(struct compat_timeval *tv, struct timezone *tz)
343} 343}
344 344
345asmlinkage int sys32_llseek(unsigned int fd, unsigned int offset_high, 345asmlinkage int sys32_llseek(unsigned int fd, unsigned int offset_high,
346 unsigned int offset_low, loff_t * result, 346 unsigned int offset_low, loff_t __user * result,
347 unsigned int origin) 347 unsigned int origin)
348{ 348{
349 return sys_llseek(fd, offset_high, offset_low, result, origin); 349 return sys_llseek(fd, offset_high, offset_low, result, origin);
@@ -353,12 +353,12 @@ asmlinkage int sys32_llseek(unsigned int fd, unsigned int offset_high,
353 lseek back to original location. They fail just like lseek does on 353 lseek back to original location. They fail just like lseek does on
354 non-seekable files. */ 354 non-seekable files. */
355 355
356asmlinkage ssize_t sys32_pread(unsigned int fd, char * buf, 356asmlinkage ssize_t sys32_pread(unsigned int fd, char __user * buf,
357 size_t count, u32 unused, u64 a4, u64 a5) 357 size_t count, u32 unused, u64 a4, u64 a5)
358{ 358{
359 ssize_t ret; 359 ssize_t ret;
360 struct file * file; 360 struct file * file;
361 ssize_t (*read)(struct file *, char *, size_t, loff_t *); 361 ssize_t (*read)(struct file *, char __user *, size_t, loff_t *);
362 loff_t pos; 362 loff_t pos;
363 363
364 ret = -EBADF; 364 ret = -EBADF;
@@ -388,12 +388,12 @@ bad_file:
388 return ret; 388 return ret;
389} 389}
390 390
391asmlinkage ssize_t sys32_pwrite(unsigned int fd, const char * buf, 391asmlinkage ssize_t sys32_pwrite(unsigned int fd, const char __user * buf,
392 size_t count, u32 unused, u64 a4, u64 a5) 392 size_t count, u32 unused, u64 a4, u64 a5)
393{ 393{
394 ssize_t ret; 394 ssize_t ret;
395 struct file * file; 395 struct file * file;
396 ssize_t (*write)(struct file *, const char *, size_t, loff_t *); 396 ssize_t (*write)(struct file *, const char __user *, size_t, loff_t *);
397 loff_t pos; 397 loff_t pos;
398 398
399 ret = -EBADF; 399 ret = -EBADF;
@@ -426,14 +426,14 @@ bad_file:
426} 426}
427 427
428asmlinkage int sys32_sched_rr_get_interval(compat_pid_t pid, 428asmlinkage int sys32_sched_rr_get_interval(compat_pid_t pid,
429 struct compat_timespec *interval) 429 struct compat_timespec __user *interval)
430{ 430{
431 struct timespec t; 431 struct timespec t;
432 int ret; 432 int ret;
433 mm_segment_t old_fs = get_fs (); 433 mm_segment_t old_fs = get_fs ();
434 434
435 set_fs (KERNEL_DS); 435 set_fs (KERNEL_DS);
436 ret = sys_sched_rr_get_interval(pid, &t); 436 ret = sys_sched_rr_get_interval(pid, (struct timespec __user *)&t);
437 set_fs (old_fs); 437 set_fs (old_fs);
438 if (put_user (t.tv_sec, &interval->tv_sec) || 438 if (put_user (t.tv_sec, &interval->tv_sec) ||
439 __put_user (t.tv_nsec, &interval->tv_nsec)) 439 __put_user (t.tv_nsec, &interval->tv_nsec))
@@ -551,7 +551,7 @@ struct ipc_kludge32 {
551}; 551};
552 552
553static int 553static int
554do_sys32_semctl(int first, int second, int third, void *uptr) 554do_sys32_semctl(int first, int second, int third, void __user *uptr)
555{ 555{
556 union semun fourth; 556 union semun fourth;
557 u32 pad; 557 u32 pad;
@@ -562,12 +562,12 @@ do_sys32_semctl(int first, int second, int third, void *uptr)
562 if (!uptr) 562 if (!uptr)
563 return -EINVAL; 563 return -EINVAL;
564 err = -EFAULT; 564 err = -EFAULT;
565 if (get_user (pad, (u32 *)uptr)) 565 if (get_user (pad, (u32 __user *)uptr))
566 return err; 566 return err;
567 if ((third & ~IPC_64) == SETVAL) 567 if ((third & ~IPC_64) == SETVAL)
568 fourth.val = (int)pad; 568 fourth.val = (int)pad;
569 else 569 else
570 fourth.__pad = (void *)A(pad); 570 fourth.__pad = (void __user *)A(pad);
571 switch (third & ~IPC_64) { 571 switch (third & ~IPC_64) {
572 case IPC_INFO: 572 case IPC_INFO:
573 case IPC_RMID: 573 case IPC_RMID:
@@ -585,14 +585,14 @@ do_sys32_semctl(int first, int second, int third, void *uptr)
585 585
586 case IPC_STAT: 586 case IPC_STAT:
587 case SEM_STAT: 587 case SEM_STAT:
588 fourth.__pad = &s; 588 fourth.__pad = (struct semid64_ds __user *)&s;
589 old_fs = get_fs(); 589 old_fs = get_fs();
590 set_fs(KERNEL_DS); 590 set_fs(KERNEL_DS);
591 err = sys_semctl(first, second, third | IPC_64, fourth); 591 err = sys_semctl(first, second, third | IPC_64, fourth);
592 set_fs(old_fs); 592 set_fs(old_fs);
593 593
594 if (third & IPC_64) { 594 if (third & IPC_64) {
595 struct semid64_ds32 *usp64 = (struct semid64_ds32 *) A(pad); 595 struct semid64_ds32 __user *usp64 = (struct semid64_ds32 __user *) A(pad);
596 596
597 if (!access_ok(VERIFY_WRITE, usp64, sizeof(*usp64))) { 597 if (!access_ok(VERIFY_WRITE, usp64, sizeof(*usp64))) {
598 err = -EFAULT; 598 err = -EFAULT;
@@ -609,7 +609,7 @@ do_sys32_semctl(int first, int second, int third, void *uptr)
609 err2 |= __put_user(s.sem_ctime, &usp64->sem_ctime); 609 err2 |= __put_user(s.sem_ctime, &usp64->sem_ctime);
610 err2 |= __put_user(s.sem_nsems, &usp64->sem_nsems); 610 err2 |= __put_user(s.sem_nsems, &usp64->sem_nsems);
611 } else { 611 } else {
612 struct semid_ds32 *usp32 = (struct semid_ds32 *) A(pad); 612 struct semid_ds32 __user *usp32 = (struct semid_ds32 __user *) A(pad);
613 613
614 if (!access_ok(VERIFY_WRITE, usp32, sizeof(*usp32))) { 614 if (!access_ok(VERIFY_WRITE, usp32, sizeof(*usp32))) {
615 err = -EFAULT; 615 err = -EFAULT;
@@ -639,9 +639,9 @@ do_sys32_semctl(int first, int second, int third, void *uptr)
639} 639}
640 640
641static int 641static int
642do_sys32_msgsnd (int first, int second, int third, void *uptr) 642do_sys32_msgsnd (int first, int second, int third, void __user *uptr)
643{ 643{
644 struct msgbuf32 *up = (struct msgbuf32 *)uptr; 644 struct msgbuf32 __user *up = (struct msgbuf32 __user *)uptr;
645 struct msgbuf *p; 645 struct msgbuf *p;
646 mm_segment_t old_fs; 646 mm_segment_t old_fs;
647 int err; 647 int err;
@@ -660,7 +660,7 @@ do_sys32_msgsnd (int first, int second, int third, void *uptr)
660 goto out; 660 goto out;
661 old_fs = get_fs (); 661 old_fs = get_fs ();
662 set_fs (KERNEL_DS); 662 set_fs (KERNEL_DS);
663 err = sys_msgsnd (first, p, second, third); 663 err = sys_msgsnd (first, (struct msgbuf __user *)p, second, third);
664 set_fs (old_fs); 664 set_fs (old_fs);
665out: 665out:
666 kfree (p); 666 kfree (p);
@@ -670,15 +670,15 @@ out:
670 670
671static int 671static int
672do_sys32_msgrcv (int first, int second, int msgtyp, int third, 672do_sys32_msgrcv (int first, int second, int msgtyp, int third,
673 int version, void *uptr) 673 int version, void __user *uptr)
674{ 674{
675 struct msgbuf32 *up; 675 struct msgbuf32 __user *up;
676 struct msgbuf *p; 676 struct msgbuf *p;
677 mm_segment_t old_fs; 677 mm_segment_t old_fs;
678 int err; 678 int err;
679 679
680 if (!version) { 680 if (!version) {
681 struct ipc_kludge32 *uipck = (struct ipc_kludge32 *)uptr; 681 struct ipc_kludge32 __user *uipck = (struct ipc_kludge32 __user *)uptr;
682 struct ipc_kludge32 ipck; 682 struct ipc_kludge32 ipck;
683 683
684 err = -EINVAL; 684 err = -EINVAL;
@@ -687,7 +687,7 @@ do_sys32_msgrcv (int first, int second, int msgtyp, int third,
687 err = -EFAULT; 687 err = -EFAULT;
688 if (copy_from_user (&ipck, uipck, sizeof (struct ipc_kludge32))) 688 if (copy_from_user (&ipck, uipck, sizeof (struct ipc_kludge32)))
689 goto out; 689 goto out;
690 uptr = (void *)AA(ipck.msgp); 690 uptr = (void __user *)AA(ipck.msgp);
691 msgtyp = ipck.msgtyp; 691 msgtyp = ipck.msgtyp;
692 } 692 }
693 693
@@ -699,11 +699,11 @@ do_sys32_msgrcv (int first, int second, int msgtyp, int third,
699 goto out; 699 goto out;
700 old_fs = get_fs (); 700 old_fs = get_fs ();
701 set_fs (KERNEL_DS); 701 set_fs (KERNEL_DS);
702 err = sys_msgrcv (first, p, second + 4, msgtyp, third); 702 err = sys_msgrcv (first, (struct msgbuf __user *)p, second + 4, msgtyp, third);
703 set_fs (old_fs); 703 set_fs (old_fs);
704 if (err < 0) 704 if (err < 0)
705 goto free_then_out; 705 goto free_then_out;
706 up = (struct msgbuf32 *)uptr; 706 up = (struct msgbuf32 __user *)uptr;
707 if (put_user (p->mtype, &up->mtype) || 707 if (put_user (p->mtype, &up->mtype) ||
708 __copy_to_user (&up->mtext, p->mtext, err)) 708 __copy_to_user (&up->mtext, p->mtext, err))
709 err = -EFAULT; 709 err = -EFAULT;
@@ -714,19 +714,19 @@ out:
714} 714}
715 715
716static int 716static int
717do_sys32_msgctl (int first, int second, void *uptr) 717do_sys32_msgctl (int first, int second, void __user *uptr)
718{ 718{
719 int err = -EINVAL, err2; 719 int err = -EINVAL, err2;
720 struct msqid64_ds m; 720 struct msqid64_ds m;
721 struct msqid_ds32 *up32 = (struct msqid_ds32 *)uptr; 721 struct msqid_ds32 __user *up32 = (struct msqid_ds32 __user *)uptr;
722 struct msqid64_ds32 *up64 = (struct msqid64_ds32 *)uptr; 722 struct msqid64_ds32 __user *up64 = (struct msqid64_ds32 __user *)uptr;
723 mm_segment_t old_fs; 723 mm_segment_t old_fs;
724 724
725 switch (second & ~IPC_64) { 725 switch (second & ~IPC_64) {
726 case IPC_INFO: 726 case IPC_INFO:
727 case IPC_RMID: 727 case IPC_RMID:
728 case MSG_INFO: 728 case MSG_INFO:
729 err = sys_msgctl (first, second, (struct msqid_ds *)uptr); 729 err = sys_msgctl (first, second, (struct msqid_ds __user *)uptr);
730 break; 730 break;
731 731
732 case IPC_SET: 732 case IPC_SET:
@@ -753,7 +753,7 @@ do_sys32_msgctl (int first, int second, void *uptr)
753 break; 753 break;
754 old_fs = get_fs(); 754 old_fs = get_fs();
755 set_fs(KERNEL_DS); 755 set_fs(KERNEL_DS);
756 err = sys_msgctl(first, second | IPC_64, (struct msqid_ds *)&m); 756 err = sys_msgctl(first, second | IPC_64, (struct msqid_ds __user *)&m);
757 set_fs(old_fs); 757 set_fs(old_fs);
758 break; 758 break;
759 759
@@ -761,7 +761,7 @@ do_sys32_msgctl (int first, int second, void *uptr)
761 case MSG_STAT: 761 case MSG_STAT:
762 old_fs = get_fs(); 762 old_fs = get_fs();
763 set_fs(KERNEL_DS); 763 set_fs(KERNEL_DS);
764 err = sys_msgctl(first, second | IPC_64, (struct msqid_ds *)&m); 764 err = sys_msgctl(first, second | IPC_64, (struct msqid_ds __user *)&m);
765 set_fs(old_fs); 765 set_fs(old_fs);
766 if (second & IPC_64) { 766 if (second & IPC_64) {
767 if (!access_ok(VERIFY_WRITE, up64, sizeof(*up64))) { 767 if (!access_ok(VERIFY_WRITE, up64, sizeof(*up64))) {
@@ -815,10 +815,10 @@ do_sys32_msgctl (int first, int second, void *uptr)
815} 815}
816 816
817static int 817static int
818do_sys32_shmat (int first, int second, int third, int version, void *uptr) 818do_sys32_shmat (int first, int second, int third, int version, void __user *uptr)
819{ 819{
820 unsigned long raddr; 820 unsigned long raddr;
821 u32 *uaddr = (u32 *)A((u32)third); 821 u32 __user *uaddr = (u32 __user *)A((u32)third);
822 int err = -EINVAL; 822 int err = -EINVAL;
823 823
824 if (version == 1) 824 if (version == 1)
@@ -837,11 +837,11 @@ struct shm_info32 {
837}; 837};
838 838
839static int 839static int
840do_sys32_shmctl (int first, int second, void *uptr) 840do_sys32_shmctl (int first, int second, void __user *uptr)
841{ 841{
842 struct shmid64_ds32 *up64 = (struct shmid64_ds32 *)uptr; 842 struct shmid64_ds32 __user *up64 = (struct shmid64_ds32 __user *)uptr;
843 struct shmid_ds32 *up32 = (struct shmid_ds32 *)uptr; 843 struct shmid_ds32 __user *up32 = (struct shmid_ds32 __user *)uptr;
844 struct shm_info32 *uip = (struct shm_info32 *)uptr; 844 struct shm_info32 __user *uip = (struct shm_info32 __user *)uptr;
845 int err = -EFAULT, err2; 845 int err = -EFAULT, err2;
846 struct shmid64_ds s64; 846 struct shmid64_ds s64;
847 mm_segment_t old_fs; 847 mm_segment_t old_fs;
@@ -854,7 +854,7 @@ do_sys32_shmctl (int first, int second, void *uptr)
854 case IPC_RMID: 854 case IPC_RMID:
855 case SHM_LOCK: 855 case SHM_LOCK:
856 case SHM_UNLOCK: 856 case SHM_UNLOCK:
857 err = sys_shmctl(first, second, (struct shmid_ds *)uptr); 857 err = sys_shmctl(first, second, (struct shmid_ds __user *)uptr);
858 break; 858 break;
859 case IPC_SET: 859 case IPC_SET:
860 if (second & IPC_64) { 860 if (second & IPC_64) {
@@ -870,7 +870,7 @@ do_sys32_shmctl (int first, int second, void *uptr)
870 break; 870 break;
871 old_fs = get_fs(); 871 old_fs = get_fs();
872 set_fs(KERNEL_DS); 872 set_fs(KERNEL_DS);
873 err = sys_shmctl(first, second & ~IPC_64, &s); 873 err = sys_shmctl(first, second & ~IPC_64, (struct shmid_ds __user *)&s);
874 set_fs(old_fs); 874 set_fs(old_fs);
875 break; 875 break;
876 876
@@ -878,7 +878,7 @@ do_sys32_shmctl (int first, int second, void *uptr)
878 case SHM_STAT: 878 case SHM_STAT:
879 old_fs = get_fs(); 879 old_fs = get_fs();
880 set_fs(KERNEL_DS); 880 set_fs(KERNEL_DS);
881 err = sys_shmctl(first, second | IPC_64, (void *) &s64); 881 err = sys_shmctl(first, second | IPC_64, (void __user *) &s64);
882 set_fs(old_fs); 882 set_fs(old_fs);
883 if (err < 0) 883 if (err < 0)
884 break; 884 break;
@@ -928,7 +928,7 @@ do_sys32_shmctl (int first, int second, void *uptr)
928 case SHM_INFO: 928 case SHM_INFO:
929 old_fs = get_fs(); 929 old_fs = get_fs();
930 set_fs(KERNEL_DS); 930 set_fs(KERNEL_DS);
931 err = sys_shmctl(first, second, (void *)&si); 931 err = sys_shmctl(first, second, (void __user *)&si);
932 set_fs(old_fs); 932 set_fs(old_fs);
933 if (err < 0) 933 if (err < 0)
934 break; 934 break;
@@ -950,11 +950,11 @@ do_sys32_shmctl (int first, int second, void *uptr)
950 return err; 950 return err;
951} 951}
952 952
953static int sys32_semtimedop(int semid, struct sembuf *tsems, int nsems, 953static int sys32_semtimedop(int semid, struct sembuf __user *tsems, int nsems,
954 const struct compat_timespec *timeout32) 954 const struct compat_timespec __user *timeout32)
955{ 955{
956 struct compat_timespec t32; 956 struct compat_timespec t32;
957 struct timespec *t64 = compat_alloc_user_space(sizeof(*t64)); 957 struct timespec __user *t64 = compat_alloc_user_space(sizeof(*t64));
958 958
959 if (copy_from_user(&t32, timeout32, sizeof(t32))) 959 if (copy_from_user(&t32, timeout32, sizeof(t32)))
960 return -EFAULT; 960 return -EFAULT;
@@ -977,11 +977,11 @@ sys32_ipc (u32 call, int first, int second, int third, u32 ptr, u32 fifth)
977 switch (call) { 977 switch (call) {
978 case SEMOP: 978 case SEMOP:
979 /* struct sembuf is the same on 32 and 64bit :)) */ 979 /* struct sembuf is the same on 32 and 64bit :)) */
980 err = sys_semtimedop (first, (struct sembuf *)AA(ptr), second, 980 err = sys_semtimedop (first, (struct sembuf __user *)AA(ptr), second,
981 NULL); 981 NULL);
982 break; 982 break;
983 case SEMTIMEDOP: 983 case SEMTIMEDOP:
984 err = sys32_semtimedop (first, (struct sembuf *)AA(ptr), second, 984 err = sys32_semtimedop (first, (struct sembuf __user *)AA(ptr), second,
985 (const struct compat_timespec __user *)AA(fifth)); 985 (const struct compat_timespec __user *)AA(fifth));
986 break; 986 break;
987 case SEMGET: 987 case SEMGET:
@@ -989,36 +989,36 @@ sys32_ipc (u32 call, int first, int second, int third, u32 ptr, u32 fifth)
989 break; 989 break;
990 case SEMCTL: 990 case SEMCTL:
991 err = do_sys32_semctl (first, second, third, 991 err = do_sys32_semctl (first, second, third,
992 (void *)AA(ptr)); 992 (void __user *)AA(ptr));
993 break; 993 break;
994 994
995 case MSGSND: 995 case MSGSND:
996 err = do_sys32_msgsnd (first, second, third, 996 err = do_sys32_msgsnd (first, second, third,
997 (void *)AA(ptr)); 997 (void __user *)AA(ptr));
998 break; 998 break;
999 case MSGRCV: 999 case MSGRCV:
1000 err = do_sys32_msgrcv (first, second, fifth, third, 1000 err = do_sys32_msgrcv (first, second, fifth, third,
1001 version, (void *)AA(ptr)); 1001 version, (void __user *)AA(ptr));
1002 break; 1002 break;
1003 case MSGGET: 1003 case MSGGET:
1004 err = sys_msgget ((key_t) first, second); 1004 err = sys_msgget ((key_t) first, second);
1005 break; 1005 break;
1006 case MSGCTL: 1006 case MSGCTL:
1007 err = do_sys32_msgctl (first, second, (void *)AA(ptr)); 1007 err = do_sys32_msgctl (first, second, (void __user *)AA(ptr));
1008 break; 1008 break;
1009 1009
1010 case SHMAT: 1010 case SHMAT:
1011 err = do_sys32_shmat (first, second, third, 1011 err = do_sys32_shmat (first, second, third,
1012 version, (void *)AA(ptr)); 1012 version, (void __user *)AA(ptr));
1013 break; 1013 break;
1014 case SHMDT: 1014 case SHMDT:
1015 err = sys_shmdt ((char *)A(ptr)); 1015 err = sys_shmdt ((char __user *)A(ptr));
1016 break; 1016 break;
1017 case SHMGET: 1017 case SHMGET:
1018 err = sys_shmget (first, (unsigned)second, third); 1018 err = sys_shmget (first, (unsigned)second, third);
1019 break; 1019 break;
1020 case SHMCTL: 1020 case SHMCTL:
1021 err = do_sys32_shmctl (first, second, (void *)AA(ptr)); 1021 err = do_sys32_shmctl (first, second, (void __user *)AA(ptr));
1022 break; 1022 break;
1023 default: 1023 default:
1024 err = -EINVAL; 1024 err = -EINVAL;
@@ -1029,7 +1029,7 @@ sys32_ipc (u32 call, int first, int second, int third, u32 ptr, u32 fifth)
1029} 1029}
1030 1030
1031asmlinkage long sys32_shmat(int shmid, char __user *shmaddr, 1031asmlinkage long sys32_shmat(int shmid, char __user *shmaddr,
1032 int shmflg, int32_t *addr) 1032 int shmflg, int32_t __user *addr)
1033{ 1033{
1034 unsigned long raddr; 1034 unsigned long raddr;
1035 int err; 1035 int err;
@@ -1054,12 +1054,13 @@ struct sysctl_args32
1054 1054
1055#ifdef CONFIG_SYSCTL 1055#ifdef CONFIG_SYSCTL
1056 1056
1057asmlinkage long sys32_sysctl(struct sysctl_args32 *args) 1057asmlinkage long sys32_sysctl(struct sysctl_args32 __user *args)
1058{ 1058{
1059 struct sysctl_args32 tmp; 1059 struct sysctl_args32 tmp;
1060 int error; 1060 int error;
1061 size_t oldlen, *oldlenp = NULL; 1061 size_t oldlen;
1062 unsigned long addr = (((long)&args->__unused[0]) + 7) & ~7; 1062 size_t __user *oldlenp = NULL;
1063 unsigned long addr = (((unsigned long)&args->__unused[0]) + 7) & ~7;
1063 1064
1064 if (copy_from_user(&tmp, args, sizeof(tmp))) 1065 if (copy_from_user(&tmp, args, sizeof(tmp)))
1065 return -EFAULT; 1066 return -EFAULT;
@@ -1071,20 +1072,20 @@ asmlinkage long sys32_sysctl(struct sysctl_args32 *args)
1071 basically copy the whole sysctl.c here, and 1072 basically copy the whole sysctl.c here, and
1072 glibc's __sysctl uses rw memory for the structure 1073 glibc's __sysctl uses rw memory for the structure
1073 anyway. */ 1074 anyway. */
1074 if (get_user(oldlen, (u32 *)A(tmp.oldlenp)) || 1075 if (get_user(oldlen, (u32 __user *)A(tmp.oldlenp)) ||
1075 put_user(oldlen, (size_t *)addr)) 1076 put_user(oldlen, (size_t __user *)addr))
1076 return -EFAULT; 1077 return -EFAULT;
1077 oldlenp = (size_t *)addr; 1078 oldlenp = (size_t __user *)addr;
1078 } 1079 }
1079 1080
1080 lock_kernel(); 1081 lock_kernel();
1081 error = do_sysctl((int *)A(tmp.name), tmp.nlen, (void *)A(tmp.oldval), 1082 error = do_sysctl((int __user *)A(tmp.name), tmp.nlen, (void __user *)A(tmp.oldval),
1082 oldlenp, (void *)A(tmp.newval), tmp.newlen); 1083 oldlenp, (void __user *)A(tmp.newval), tmp.newlen);
1083 unlock_kernel(); 1084 unlock_kernel();
1084 if (oldlenp) { 1085 if (oldlenp) {
1085 if (!error) { 1086 if (!error) {
1086 if (get_user(oldlen, (size_t *)addr) || 1087 if (get_user(oldlen, (size_t __user *)addr) ||
1087 put_user(oldlen, (u32 *)A(tmp.oldlenp))) 1088 put_user(oldlen, (u32 __user *)A(tmp.oldlenp)))
1088 error = -EFAULT; 1089 error = -EFAULT;
1089 } 1090 }
1090 copy_to_user(args->__unused, tmp.__unused, sizeof(tmp.__unused)); 1091 copy_to_user(args->__unused, tmp.__unused, sizeof(tmp.__unused));
@@ -1094,7 +1095,7 @@ asmlinkage long sys32_sysctl(struct sysctl_args32 *args)
1094 1095
1095#endif /* CONFIG_SYSCTL */ 1096#endif /* CONFIG_SYSCTL */
1096 1097
1097asmlinkage long sys32_newuname(struct new_utsname * name) 1098asmlinkage long sys32_newuname(struct new_utsname __user * name)
1098{ 1099{
1099 int ret = 0; 1100 int ret = 0;
1100 1101
@@ -1129,9 +1130,9 @@ struct ustat32 {
1129 char f_fpack[6]; 1130 char f_fpack[6];
1130}; 1131};
1131 1132
1132extern asmlinkage long sys_ustat(dev_t dev, struct ustat * ubuf); 1133extern asmlinkage long sys_ustat(dev_t dev, struct ustat __user * ubuf);
1133 1134
1134asmlinkage int sys32_ustat(dev_t dev, struct ustat32 * ubuf32) 1135asmlinkage int sys32_ustat(dev_t dev, struct ustat32 __user * ubuf32)
1135{ 1136{
1136 int err; 1137 int err;
1137 struct ustat tmp; 1138 struct ustat tmp;
@@ -1139,7 +1140,7 @@ asmlinkage int sys32_ustat(dev_t dev, struct ustat32 * ubuf32)
1139 mm_segment_t old_fs = get_fs(); 1140 mm_segment_t old_fs = get_fs();
1140 1141
1141 set_fs(KERNEL_DS); 1142 set_fs(KERNEL_DS);
1142 err = sys_ustat(dev, &tmp); 1143 err = sys_ustat(dev, (struct ustat __user *)&tmp);
1143 set_fs (old_fs); 1144 set_fs (old_fs);
1144 1145
1145 if (err) 1146 if (err)
@@ -1155,80 +1156,7 @@ out:
1155 return err; 1156 return err;
1156} 1157}
1157 1158
1158/* Handle adjtimex compatibility. */ 1159asmlinkage int sys32_sendfile(int out_fd, int in_fd, compat_off_t __user *offset,
1159
1160struct timex32 {
1161 u32 modes;
1162 s32 offset, freq, maxerror, esterror;
1163 s32 status, constant, precision, tolerance;
1164 struct compat_timeval time;
1165 s32 tick;
1166 s32 ppsfreq, jitter, shift, stabil;
1167 s32 jitcnt, calcnt, errcnt, stbcnt;
1168 s32 :32; s32 :32; s32 :32; s32 :32;
1169 s32 :32; s32 :32; s32 :32; s32 :32;
1170 s32 :32; s32 :32; s32 :32; s32 :32;
1171};
1172
1173extern int do_adjtimex(struct timex *);
1174
1175asmlinkage int sys32_adjtimex(struct timex32 *utp)
1176{
1177 struct timex txc;
1178 int ret;
1179
1180 memset(&txc, 0, sizeof(struct timex));
1181
1182 if (get_user(txc.modes, &utp->modes) ||
1183 __get_user(txc.offset, &utp->offset) ||
1184 __get_user(txc.freq, &utp->freq) ||
1185 __get_user(txc.maxerror, &utp->maxerror) ||
1186 __get_user(txc.esterror, &utp->esterror) ||
1187 __get_user(txc.status, &utp->status) ||
1188 __get_user(txc.constant, &utp->constant) ||
1189 __get_user(txc.precision, &utp->precision) ||
1190 __get_user(txc.tolerance, &utp->tolerance) ||
1191 __get_user(txc.time.tv_sec, &utp->time.tv_sec) ||
1192 __get_user(txc.time.tv_usec, &utp->time.tv_usec) ||
1193 __get_user(txc.tick, &utp->tick) ||
1194 __get_user(txc.ppsfreq, &utp->ppsfreq) ||
1195 __get_user(txc.jitter, &utp->jitter) ||
1196 __get_user(txc.shift, &utp->shift) ||
1197 __get_user(txc.stabil, &utp->stabil) ||
1198 __get_user(txc.jitcnt, &utp->jitcnt) ||
1199 __get_user(txc.calcnt, &utp->calcnt) ||
1200 __get_user(txc.errcnt, &utp->errcnt) ||
1201 __get_user(txc.stbcnt, &utp->stbcnt))
1202 return -EFAULT;
1203
1204 ret = do_adjtimex(&txc);
1205
1206 if (put_user(txc.modes, &utp->modes) ||
1207 __put_user(txc.offset, &utp->offset) ||
1208 __put_user(txc.freq, &utp->freq) ||
1209 __put_user(txc.maxerror, &utp->maxerror) ||
1210 __put_user(txc.esterror, &utp->esterror) ||
1211 __put_user(txc.status, &utp->status) ||
1212 __put_user(txc.constant, &utp->constant) ||
1213 __put_user(txc.precision, &utp->precision) ||
1214 __put_user(txc.tolerance, &utp->tolerance) ||
1215 __put_user(txc.time.tv_sec, &utp->time.tv_sec) ||
1216 __put_user(txc.time.tv_usec, &utp->time.tv_usec) ||
1217 __put_user(txc.tick, &utp->tick) ||
1218 __put_user(txc.ppsfreq, &utp->ppsfreq) ||
1219 __put_user(txc.jitter, &utp->jitter) ||
1220 __put_user(txc.shift, &utp->shift) ||
1221 __put_user(txc.stabil, &utp->stabil) ||
1222 __put_user(txc.jitcnt, &utp->jitcnt) ||
1223 __put_user(txc.calcnt, &utp->calcnt) ||
1224 __put_user(txc.errcnt, &utp->errcnt) ||
1225 __put_user(txc.stbcnt, &utp->stbcnt))
1226 ret = -EFAULT;
1227
1228 return ret;
1229}
1230
1231asmlinkage int sys32_sendfile(int out_fd, int in_fd, compat_off_t *offset,
1232 s32 count) 1160 s32 count)
1233{ 1161{
1234 mm_segment_t old_fs = get_fs(); 1162 mm_segment_t old_fs = get_fs();
@@ -1239,7 +1167,7 @@ asmlinkage int sys32_sendfile(int out_fd, int in_fd, compat_off_t *offset,
1239 return -EFAULT; 1167 return -EFAULT;
1240 1168
1241 set_fs(KERNEL_DS); 1169 set_fs(KERNEL_DS);
1242 ret = sys_sendfile(out_fd, in_fd, offset ? &of : NULL, count); 1170 ret = sys_sendfile(out_fd, in_fd, offset ? (off_t __user *)&of : NULL, count);
1243 set_fs(old_fs); 1171 set_fs(old_fs);
1244 1172
1245 if (offset && put_user(of, offset)) 1173 if (offset && put_user(of, offset))
@@ -1269,7 +1197,7 @@ static unsigned char socketcall_nargs[18]={AL(0),AL(3),AL(3),AL(3),AL(2),AL(3),
1269 * it is set by the callees. 1197 * it is set by the callees.
1270 */ 1198 */
1271 1199
1272asmlinkage long sys32_socketcall(int call, unsigned int *args32) 1200asmlinkage long sys32_socketcall(int call, unsigned int __user *args32)
1273{ 1201{
1274 unsigned int a[6]; 1202 unsigned int a[6];
1275 unsigned int a0,a1; 1203 unsigned int a0,a1;
@@ -1291,7 +1219,7 @@ asmlinkage long sys32_socketcall(int call, unsigned int *args32)
1291 struct sockaddr __user *addr, int __user *addr_len); 1219 struct sockaddr __user *addr, int __user *addr_len);
1292 extern asmlinkage long sys_shutdown(int fd, int how); 1220 extern asmlinkage long sys_shutdown(int fd, int how);
1293 extern asmlinkage long sys_setsockopt(int fd, int level, int optname, char __user *optval, int optlen); 1221 extern asmlinkage long sys_setsockopt(int fd, int level, int optname, char __user *optval, int optlen);
1294 extern asmlinkage long sys_getsockopt(int fd, int level, int optname, char __user *optval, int *optlen); 1222 extern asmlinkage long sys_getsockopt(int fd, int level, int optname, char __user *optval, int __user *optlen);
1295 extern asmlinkage long sys_sendmsg(int fd, struct msghdr __user *msg, unsigned flags); 1223 extern asmlinkage long sys_sendmsg(int fd, struct msghdr __user *msg, unsigned flags);
1296 extern asmlinkage long sys_recvmsg(int fd, struct msghdr __user *msg, unsigned int flags); 1224 extern asmlinkage long sys_recvmsg(int fd, struct msghdr __user *msg, unsigned int flags);
1297 1225
@@ -1411,7 +1339,7 @@ _sys32_clone(nabi_no_regargs struct pt_regs regs)
1411 newsp = regs.regs[5]; 1339 newsp = regs.regs[5];
1412 if (!newsp) 1340 if (!newsp)
1413 newsp = regs.regs[29]; 1341 newsp = regs.regs[29];
1414 parent_tidptr = (int *) regs.regs[6]; 1342 parent_tidptr = (int __user *) regs.regs[6];
1415 1343
1416 /* Use __dummy4 instead of getting it off the stack, so that 1344 /* Use __dummy4 instead of getting it off the stack, so that
1417 syscall() works. */ 1345 syscall() works. */
diff --git a/arch/mips/kernel/proc.c b/arch/mips/kernel/proc.c
index 86fe15b273cd..84ab959f924a 100644
--- a/arch/mips/kernel/proc.c
+++ b/arch/mips/kernel/proc.c
@@ -135,6 +135,7 @@ static int show_cpuinfo(struct seq_file *m, void *v)
135 cpu_has_vce ? "%u" : "not available"); 135 cpu_has_vce ? "%u" : "not available");
136 seq_printf(m, fmt, 'D', vced_count); 136 seq_printf(m, fmt, 'D', vced_count);
137 seq_printf(m, fmt, 'I', vcei_count); 137 seq_printf(m, fmt, 'I', vcei_count);
138 seq_printf(m, "\n");
138 139
139 return 0; 140 return 0;
140} 141}
diff --git a/arch/mips/kernel/process.c b/arch/mips/kernel/process.c
index 092679c2dca9..c66db5e5ab62 100644
--- a/arch/mips/kernel/process.c
+++ b/arch/mips/kernel/process.c
@@ -60,17 +60,9 @@ ATTRIB_NORET void cpu_idle(void)
60 } 60 }
61} 61}
62 62
63extern void do_signal(struct pt_regs *regs);
64extern void do_signal32(struct pt_regs *regs);
65
66/* 63/*
67 * Native o32 and N64 ABI without DSP ASE 64 * Native o32 and N64 ABI without DSP ASE
68 */ 65 */
69extern int setup_frame(struct k_sigaction * ka, struct pt_regs *regs,
70 int signr, sigset_t *set);
71extern int setup_rt_frame(struct k_sigaction * ka, struct pt_regs *regs,
72 int signr, sigset_t *set, siginfo_t *info);
73
74struct mips_abi mips_abi = { 66struct mips_abi mips_abi = {
75 .do_signal = do_signal, 67 .do_signal = do_signal,
76#ifdef CONFIG_TRAD_SIGNALS 68#ifdef CONFIG_TRAD_SIGNALS
@@ -83,11 +75,6 @@ struct mips_abi mips_abi = {
83/* 75/*
84 * o32 compatibility on 64-bit kernels, without DSP ASE 76 * o32 compatibility on 64-bit kernels, without DSP ASE
85 */ 77 */
86extern int setup_frame_32(struct k_sigaction * ka, struct pt_regs *regs,
87 int signr, sigset_t *set);
88extern int setup_rt_frame_32(struct k_sigaction * ka, struct pt_regs *regs,
89 int signr, sigset_t *set, siginfo_t *info);
90
91struct mips_abi mips_abi_32 = { 78struct mips_abi mips_abi_32 = {
92 .do_signal = do_signal32, 79 .do_signal = do_signal32,
93 .setup_frame = setup_frame_32, 80 .setup_frame = setup_frame_32,
@@ -99,9 +86,6 @@ struct mips_abi mips_abi_32 = {
99/* 86/*
100 * N32 on 64-bit kernels, without DSP ASE 87 * N32 on 64-bit kernels, without DSP ASE
101 */ 88 */
102extern int setup_rt_frame_n32(struct k_sigaction * ka, struct pt_regs *regs,
103 int signr, sigset_t *set, siginfo_t *info);
104
105struct mips_abi mips_abi_n32 = { 89struct mips_abi mips_abi_n32 = {
106 .do_signal = do_signal, 90 .do_signal = do_signal,
107 .setup_rt_frame = setup_rt_frame_n32 91 .setup_rt_frame = setup_rt_frame_n32
@@ -435,4 +419,3 @@ unsigned long get_wchan(struct task_struct *p)
435 return pc; 419 return pc;
436} 420}
437 421
438EXPORT_SYMBOL(get_wchan);
diff --git a/arch/mips/kernel/scall64-n32.S b/arch/mips/kernel/scall64-n32.S
index 02c8267e45e7..05a2c0567dae 100644
--- a/arch/mips/kernel/scall64-n32.S
+++ b/arch/mips/kernel/scall64-n32.S
@@ -273,7 +273,7 @@ EXPORT(sysn32_call_table)
273 PTR sys_pivot_root 273 PTR sys_pivot_root
274 PTR sys32_sysctl 274 PTR sys32_sysctl
275 PTR sys_prctl 275 PTR sys_prctl
276 PTR sys32_adjtimex 276 PTR compat_sys_adjtimex
277 PTR compat_sys_setrlimit /* 6155 */ 277 PTR compat_sys_setrlimit /* 6155 */
278 PTR sys_chroot 278 PTR sys_chroot
279 PTR sys_sync 279 PTR sys_sync
diff --git a/arch/mips/kernel/scall64-o32.S b/arch/mips/kernel/scall64-o32.S
index 797e0d874889..19c4ca481b02 100644
--- a/arch/mips/kernel/scall64-o32.S
+++ b/arch/mips/kernel/scall64-o32.S
@@ -328,7 +328,7 @@ sys_call_table:
328 PTR sys_setdomainname 328 PTR sys_setdomainname
329 PTR sys32_newuname 329 PTR sys32_newuname
330 PTR sys_ni_syscall /* sys_modify_ldt */ 330 PTR sys_ni_syscall /* sys_modify_ldt */
331 PTR sys32_adjtimex 331 PTR compat_sys_adjtimex
332 PTR sys_mprotect /* 4125 */ 332 PTR sys_mprotect /* 4125 */
333 PTR compat_sys_sigprocmask 333 PTR compat_sys_sigprocmask
334 PTR sys_ni_syscall /* was creat_module */ 334 PTR sys_ni_syscall /* was creat_module */
diff --git a/arch/mips/kernel/setup.c b/arch/mips/kernel/setup.c
index d9293c558e41..dcbfd27071f0 100644
--- a/arch/mips/kernel/setup.c
+++ b/arch/mips/kernel/setup.c
@@ -34,6 +34,7 @@
34#include <linux/highmem.h> 34#include <linux/highmem.h>
35#include <linux/console.h> 35#include <linux/console.h>
36#include <linux/mmzone.h> 36#include <linux/mmzone.h>
37#include <linux/pfn.h>
37 38
38#include <asm/addrspace.h> 39#include <asm/addrspace.h>
39#include <asm/bootinfo.h> 40#include <asm/bootinfo.h>
@@ -257,10 +258,6 @@ static inline int parse_rd_cmdline(unsigned long* rd_start, unsigned long* rd_en
257 return 0; 258 return 0;
258} 259}
259 260
260#define PFN_UP(x) (((x) + PAGE_SIZE - 1) >> PAGE_SHIFT)
261#define PFN_DOWN(x) ((x) >> PAGE_SHIFT)
262#define PFN_PHYS(x) ((x) << PAGE_SHIFT)
263
264#define MAXMEM HIGHMEM_START 261#define MAXMEM HIGHMEM_START
265#define MAXMEM_PFN PFN_DOWN(MAXMEM) 262#define MAXMEM_PFN PFN_DOWN(MAXMEM)
266 263
@@ -447,21 +444,10 @@ static inline void resource_init(void)
447{ 444{
448 int i; 445 int i;
449 446
450#if defined(CONFIG_64BIT) && !defined(CONFIG_BUILD_ELF64)
451 /*
452 * The 64bit code in 32bit object format trick can't represent
453 * 64bit wide relocations for linker script symbols.
454 */
455 code_resource.start = CPHYSADDR(&_text);
456 code_resource.end = CPHYSADDR(&_etext) - 1;
457 data_resource.start = CPHYSADDR(&_etext);
458 data_resource.end = CPHYSADDR(&_edata) - 1;
459#else
460 code_resource.start = virt_to_phys(&_text); 447 code_resource.start = virt_to_phys(&_text);
461 code_resource.end = virt_to_phys(&_etext) - 1; 448 code_resource.end = virt_to_phys(&_etext) - 1;
462 data_resource.start = virt_to_phys(&_etext); 449 data_resource.start = virt_to_phys(&_etext);
463 data_resource.end = virt_to_phys(&_edata) - 1; 450 data_resource.end = virt_to_phys(&_edata) - 1;
464#endif
465 451
466 /* 452 /*
467 * Request address space for all standard RAM. 453 * Request address space for all standard RAM.
@@ -504,10 +490,6 @@ static inline void resource_init(void)
504 } 490 }
505} 491}
506 492
507#undef PFN_UP
508#undef PFN_DOWN
509#undef PFN_PHYS
510
511#undef MAXMEM 493#undef MAXMEM
512#undef MAXMEM_PFN 494#undef MAXMEM_PFN
513 495
diff --git a/arch/mips/kernel/signal-common.h b/arch/mips/kernel/signal-common.h
index 36bfc2588aa3..3ca786215d48 100644
--- a/arch/mips/kernel/signal-common.h
+++ b/arch/mips/kernel/signal-common.h
@@ -166,11 +166,11 @@ get_sigframe(struct k_sigaction *ka, struct pt_regs *regs, size_t frame_size)
166 sp = regs->regs[29]; 166 sp = regs->regs[29];
167 167
168 /* 168 /*
169 * FPU emulator may have it's own trampoline active just 169 * FPU emulator may have it's own trampoline active just
170 * above the user stack, 16-bytes before the next lowest 170 * above the user stack, 16-bytes before the next lowest
171 * 16 byte boundary. Try to avoid trashing it. 171 * 16 byte boundary. Try to avoid trashing it.
172 */ 172 */
173 sp -= 32; 173 sp -= 32;
174 174
175 /* This is the X/Open sanctioned signal stack switching. */ 175 /* This is the X/Open sanctioned signal stack switching. */
176 if ((ka->sa.sa_flags & SA_ONSTACK) && (sas_ss_flags (sp) == 0)) 176 if ((ka->sa.sa_flags & SA_ONSTACK) && (sas_ss_flags (sp) == 0))
diff --git a/arch/mips/kernel/signal.c b/arch/mips/kernel/signal.c
index c974cc9b30eb..402efd27c79e 100644
--- a/arch/mips/kernel/signal.c
+++ b/arch/mips/kernel/signal.c
@@ -100,8 +100,8 @@ _sys_rt_sigsuspend(nabi_no_regargs struct pt_regs regs)
100} 100}
101 101
102#ifdef CONFIG_TRAD_SIGNALS 102#ifdef CONFIG_TRAD_SIGNALS
103asmlinkage int sys_sigaction(int sig, const struct sigaction *act, 103asmlinkage int sys_sigaction(int sig, const struct sigaction __user *act,
104 struct sigaction *oact) 104 struct sigaction __user *oact)
105{ 105{
106 struct k_sigaction new_ka, old_ka; 106 struct k_sigaction new_ka, old_ka;
107 int ret; 107 int ret;
@@ -331,7 +331,7 @@ int setup_rt_frame(struct k_sigaction * ka, struct pt_regs *regs,
331 /* Create the ucontext. */ 331 /* Create the ucontext. */
332 err |= __put_user(0, &frame->rs_uc.uc_flags); 332 err |= __put_user(0, &frame->rs_uc.uc_flags);
333 err |= __put_user(NULL, &frame->rs_uc.uc_link); 333 err |= __put_user(NULL, &frame->rs_uc.uc_link);
334 err |= __put_user((void *)current->sas_ss_sp, 334 err |= __put_user((void __user *)current->sas_ss_sp,
335 &frame->rs_uc.uc_stack.ss_sp); 335 &frame->rs_uc.uc_stack.ss_sp);
336 err |= __put_user(sas_ss_flags(regs->regs[29]), 336 err |= __put_user(sas_ss_flags(regs->regs[29]),
337 &frame->rs_uc.uc_stack.ss_flags); 337 &frame->rs_uc.uc_stack.ss_flags);
diff --git a/arch/mips/kernel/signal32.c b/arch/mips/kernel/signal32.c
index 237cd8a2cd32..f32a22997c3d 100644
--- a/arch/mips/kernel/signal32.c
+++ b/arch/mips/kernel/signal32.c
@@ -163,7 +163,7 @@ static inline int put_sigset(const sigset_t *kbuf, compat_sigset_t __user *ubuf)
163 return err; 163 return err;
164} 164}
165 165
166static inline int get_sigset(sigset_t *kbuf, const compat_sigset_t *ubuf) 166static inline int get_sigset(sigset_t *kbuf, const compat_sigset_t __user *ubuf)
167{ 167{
168 int err = 0; 168 int err = 0;
169 unsigned long sig[4]; 169 unsigned long sig[4];
@@ -195,10 +195,10 @@ save_static_function(sys32_sigsuspend);
195__attribute_used__ noinline static int 195__attribute_used__ noinline static int
196_sys32_sigsuspend(nabi_no_regargs struct pt_regs regs) 196_sys32_sigsuspend(nabi_no_regargs struct pt_regs regs)
197{ 197{
198 compat_sigset_t *uset; 198 compat_sigset_t __user *uset;
199 sigset_t newset; 199 sigset_t newset;
200 200
201 uset = (compat_sigset_t *) regs.regs[4]; 201 uset = (compat_sigset_t __user *) regs.regs[4];
202 if (get_sigset(&newset, uset)) 202 if (get_sigset(&newset, uset))
203 return -EFAULT; 203 return -EFAULT;
204 sigdelsetmask(&newset, ~_BLOCKABLE); 204 sigdelsetmask(&newset, ~_BLOCKABLE);
@@ -219,7 +219,7 @@ save_static_function(sys32_rt_sigsuspend);
219__attribute_used__ noinline static int 219__attribute_used__ noinline static int
220_sys32_rt_sigsuspend(nabi_no_regargs struct pt_regs regs) 220_sys32_rt_sigsuspend(nabi_no_regargs struct pt_regs regs)
221{ 221{
222 compat_sigset_t *uset; 222 compat_sigset_t __user *uset;
223 sigset_t newset; 223 sigset_t newset;
224 size_t sigsetsize; 224 size_t sigsetsize;
225 225
@@ -228,7 +228,7 @@ _sys32_rt_sigsuspend(nabi_no_regargs struct pt_regs regs)
228 if (sigsetsize != sizeof(compat_sigset_t)) 228 if (sigsetsize != sizeof(compat_sigset_t))
229 return -EINVAL; 229 return -EINVAL;
230 230
231 uset = (compat_sigset_t *) regs.regs[4]; 231 uset = (compat_sigset_t __user *) regs.regs[4];
232 if (get_sigset(&newset, uset)) 232 if (get_sigset(&newset, uset))
233 return -EFAULT; 233 return -EFAULT;
234 sigdelsetmask(&newset, ~_BLOCKABLE); 234 sigdelsetmask(&newset, ~_BLOCKABLE);
@@ -236,7 +236,7 @@ _sys32_rt_sigsuspend(nabi_no_regargs struct pt_regs regs)
236 spin_lock_irq(&current->sighand->siglock); 236 spin_lock_irq(&current->sighand->siglock);
237 current->saved_sigmask = current->blocked; 237 current->saved_sigmask = current->blocked;
238 current->blocked = newset; 238 current->blocked = newset;
239 recalc_sigpending(); 239 recalc_sigpending();
240 spin_unlock_irq(&current->sighand->siglock); 240 spin_unlock_irq(&current->sighand->siglock);
241 241
242 current->state = TASK_INTERRUPTIBLE; 242 current->state = TASK_INTERRUPTIBLE;
@@ -245,8 +245,8 @@ _sys32_rt_sigsuspend(nabi_no_regargs struct pt_regs regs)
245 return -ERESTARTNOHAND; 245 return -ERESTARTNOHAND;
246} 246}
247 247
248asmlinkage int sys32_sigaction(int sig, const struct sigaction32 *act, 248asmlinkage int sys32_sigaction(int sig, const struct sigaction32 __user *act,
249 struct sigaction32 *oact) 249 struct sigaction32 __user *oact)
250{ 250{
251 struct k_sigaction new_ka, old_ka; 251 struct k_sigaction new_ka, old_ka;
252 int ret; 252 int ret;
@@ -272,15 +272,15 @@ asmlinkage int sys32_sigaction(int sig, const struct sigaction32 *act,
272 272
273 if (!ret && oact) { 273 if (!ret && oact) {
274 if (!access_ok(VERIFY_WRITE, oact, sizeof(*oact))) 274 if (!access_ok(VERIFY_WRITE, oact, sizeof(*oact)))
275 return -EFAULT; 275 return -EFAULT;
276 err |= __put_user(old_ka.sa.sa_flags, &oact->sa_flags); 276 err |= __put_user(old_ka.sa.sa_flags, &oact->sa_flags);
277 err |= __put_user((u32)(u64)old_ka.sa.sa_handler, 277 err |= __put_user((u32)(u64)old_ka.sa.sa_handler,
278 &oact->sa_handler); 278 &oact->sa_handler);
279 err |= __put_user(old_ka.sa.sa_mask.sig[0], oact->sa_mask.sig); 279 err |= __put_user(old_ka.sa.sa_mask.sig[0], oact->sa_mask.sig);
280 err |= __put_user(0, &oact->sa_mask.sig[1]); 280 err |= __put_user(0, &oact->sa_mask.sig[1]);
281 err |= __put_user(0, &oact->sa_mask.sig[2]); 281 err |= __put_user(0, &oact->sa_mask.sig[2]);
282 err |= __put_user(0, &oact->sa_mask.sig[3]); 282 err |= __put_user(0, &oact->sa_mask.sig[3]);
283 if (err) 283 if (err)
284 return -EFAULT; 284 return -EFAULT;
285 } 285 }
286 286
@@ -301,7 +301,7 @@ asmlinkage int sys32_sigaltstack(nabi_no_regargs struct pt_regs regs)
301 if (!access_ok(VERIFY_READ, uss, sizeof(*uss))) 301 if (!access_ok(VERIFY_READ, uss, sizeof(*uss)))
302 return -EFAULT; 302 return -EFAULT;
303 err |= __get_user(sp, &uss->ss_sp); 303 err |= __get_user(sp, &uss->ss_sp);
304 kss.ss_sp = (void *) (long) sp; 304 kss.ss_sp = (void __user *) (long) sp;
305 err |= __get_user(kss.ss_size, &uss->ss_size); 305 err |= __get_user(kss.ss_size, &uss->ss_size);
306 err |= __get_user(kss.ss_flags, &uss->ss_flags); 306 err |= __get_user(kss.ss_flags, &uss->ss_flags);
307 if (err) 307 if (err)
@@ -316,7 +316,7 @@ asmlinkage int sys32_sigaltstack(nabi_no_regargs struct pt_regs regs)
316 if (!ret && uoss) { 316 if (!ret && uoss) {
317 if (!access_ok(VERIFY_WRITE, uoss, sizeof(*uoss))) 317 if (!access_ok(VERIFY_WRITE, uoss, sizeof(*uoss)))
318 return -EFAULT; 318 return -EFAULT;
319 sp = (int) (long) koss.ss_sp; 319 sp = (int) (unsigned long) koss.ss_sp;
320 err |= __put_user(sp, &uoss->ss_sp); 320 err |= __put_user(sp, &uoss->ss_sp);
321 err |= __put_user(koss.ss_size, &uoss->ss_size); 321 err |= __put_user(koss.ss_size, &uoss->ss_size);
322 err |= __put_user(koss.ss_flags, &uoss->ss_flags); 322 err |= __put_user(koss.ss_flags, &uoss->ss_flags);
@@ -527,7 +527,7 @@ _sys32_rt_sigreturn(nabi_no_regargs struct pt_regs regs)
527 /* The ucontext contains a stack32_t, so we must convert! */ 527 /* The ucontext contains a stack32_t, so we must convert! */
528 if (__get_user(sp, &frame->rs_uc.uc_stack.ss_sp)) 528 if (__get_user(sp, &frame->rs_uc.uc_stack.ss_sp))
529 goto badframe; 529 goto badframe;
530 st.ss_sp = (void *)(long) sp; 530 st.ss_sp = (void __user *)(long) sp;
531 if (__get_user(st.ss_size, &frame->rs_uc.uc_stack.ss_size)) 531 if (__get_user(st.ss_size, &frame->rs_uc.uc_stack.ss_size))
532 goto badframe; 532 goto badframe;
533 if (__get_user(st.ss_flags, &frame->rs_uc.uc_stack.ss_flags)) 533 if (__get_user(st.ss_flags, &frame->rs_uc.uc_stack.ss_flags))
@@ -624,11 +624,11 @@ static inline void __user *get_sigframe(struct k_sigaction *ka,
624 sp = regs->regs[29]; 624 sp = regs->regs[29];
625 625
626 /* 626 /*
627 * FPU emulator may have it's own trampoline active just 627 * FPU emulator may have it's own trampoline active just
628 * above the user stack, 16-bytes before the next lowest 628 * above the user stack, 16-bytes before the next lowest
629 * 16 byte boundary. Try to avoid trashing it. 629 * 16 byte boundary. Try to avoid trashing it.
630 */ 630 */
631 sp -= 32; 631 sp -= 32;
632 632
633 /* This is the X/Open sanctioned signal stack switching. */ 633 /* This is the X/Open sanctioned signal stack switching. */
634 if ((ka->sa.sa_flags & SA_ONSTACK) && (sas_ss_flags (sp) == 0)) 634 if ((ka->sa.sa_flags & SA_ONSTACK) && (sas_ss_flags (sp) == 0))
@@ -868,7 +868,7 @@ no_signal:
868 } 868 }
869} 869}
870 870
871asmlinkage int sys32_rt_sigaction(int sig, const struct sigaction32 *act, 871asmlinkage int sys32_rt_sigaction(int sig, const struct sigaction32 __user *act,
872 struct sigaction32 __user *oact, 872 struct sigaction32 __user *oact,
873 unsigned int sigsetsize) 873 unsigned int sigsetsize)
874{ 874{
@@ -912,7 +912,7 @@ out:
912 return ret; 912 return ret;
913} 913}
914 914
915asmlinkage int sys32_rt_sigprocmask(int how, compat_sigset_t *set, 915asmlinkage int sys32_rt_sigprocmask(int how, compat_sigset_t __user *set,
916 compat_sigset_t __user *oset, unsigned int sigsetsize) 916 compat_sigset_t __user *oset, unsigned int sigsetsize)
917{ 917{
918 sigset_t old_set, new_set; 918 sigset_t old_set, new_set;
diff --git a/arch/mips/kernel/signal_n32.c b/arch/mips/kernel/signal_n32.c
index 3e168c08a3a8..477c5334ec1b 100644
--- a/arch/mips/kernel/signal_n32.c
+++ b/arch/mips/kernel/signal_n32.c
@@ -87,7 +87,8 @@ save_static_function(sysn32_rt_sigsuspend);
87__attribute_used__ noinline static int 87__attribute_used__ noinline static int
88_sysn32_rt_sigsuspend(nabi_no_regargs struct pt_regs regs) 88_sysn32_rt_sigsuspend(nabi_no_regargs struct pt_regs regs)
89{ 89{
90 compat_sigset_t __user *unewset, uset; 90 compat_sigset_t __user *unewset;
91 compat_sigset_t uset;
91 size_t sigsetsize; 92 size_t sigsetsize;
92 sigset_t newset; 93 sigset_t newset;
93 94
@@ -141,7 +142,7 @@ _sysn32_rt_sigreturn(nabi_no_regargs struct pt_regs regs)
141 /* The ucontext contains a stack32_t, so we must convert! */ 142 /* The ucontext contains a stack32_t, so we must convert! */
142 if (__get_user(sp, &frame->rs_uc.uc_stack.ss_sp)) 143 if (__get_user(sp, &frame->rs_uc.uc_stack.ss_sp))
143 goto badframe; 144 goto badframe;
144 st.ss_sp = (void *)(long) sp; 145 st.ss_sp = (void __user *)(long) sp;
145 if (__get_user(st.ss_size, &frame->rs_uc.uc_stack.ss_size)) 146 if (__get_user(st.ss_size, &frame->rs_uc.uc_stack.ss_size))
146 goto badframe; 147 goto badframe;
147 if (__get_user(st.ss_flags, &frame->rs_uc.uc_stack.ss_flags)) 148 if (__get_user(st.ss_flags, &frame->rs_uc.uc_stack.ss_flags))
diff --git a/arch/mips/kernel/smp.c b/arch/mips/kernel/smp.c
index 06ed90752424..78d171bfa331 100644
--- a/arch/mips/kernel/smp.c
+++ b/arch/mips/kernel/smp.c
@@ -167,8 +167,8 @@ int smp_call_function (void (*func) (void *info), void *info, int retry,
167 mb(); 167 mb();
168 168
169 /* Send a message to all other CPUs and wait for them to respond */ 169 /* Send a message to all other CPUs and wait for them to respond */
170 for (i = 0; i < NR_CPUS; i++) 170 for_each_online_cpu(i)
171 if (cpu_online(i) && i != cpu) 171 if (i != cpu)
172 core_send_ipi(i, SMP_CALL_FUNCTION); 172 core_send_ipi(i, SMP_CALL_FUNCTION);
173 173
174 /* Wait for response */ 174 /* Wait for response */
diff --git a/arch/mips/kernel/syscall.c b/arch/mips/kernel/syscall.c
index 1da2eeb3ef9e..2aeaa2fd4b32 100644
--- a/arch/mips/kernel/syscall.c
+++ b/arch/mips/kernel/syscall.c
@@ -162,7 +162,10 @@ asmlinkage unsigned long
162sys_mmap2(unsigned long addr, unsigned long len, unsigned long prot, 162sys_mmap2(unsigned long addr, unsigned long len, unsigned long prot,
163 unsigned long flags, unsigned long fd, unsigned long pgoff) 163 unsigned long flags, unsigned long fd, unsigned long pgoff)
164{ 164{
165 return do_mmap2(addr, len, prot, flags, fd, pgoff); 165 if (pgoff & (~PAGE_MASK >> 12))
166 return -EINVAL;
167
168 return do_mmap2(addr, len, prot, flags, fd, pgoff >> (PAGE_SHIFT-12));
166} 169}
167 170
168save_static_function(sys_fork); 171save_static_function(sys_fork);
@@ -345,7 +348,7 @@ asmlinkage int sys_ipc (uint call, int first, int second,
345 union semun fourth; 348 union semun fourth;
346 if (!ptr) 349 if (!ptr)
347 return -EINVAL; 350 return -EINVAL;
348 if (get_user(fourth.__pad, (void *__user *) ptr)) 351 if (get_user(fourth.__pad, (void __user *__user *) ptr))
349 return -EFAULT; 352 return -EFAULT;
350 return sys_semctl (first, second, third, fourth); 353 return sys_semctl (first, second, third, fourth);
351 } 354 }
diff --git a/arch/mips/kernel/sysirix.c b/arch/mips/kernel/sysirix.c
index 0fc3730a294f..5407b784cd01 100644
--- a/arch/mips/kernel/sysirix.c
+++ b/arch/mips/kernel/sysirix.c
@@ -645,27 +645,7 @@ static inline void getitimer_real(struct itimerval *value)
645 645
646asmlinkage unsigned int irix_alarm(unsigned int seconds) 646asmlinkage unsigned int irix_alarm(unsigned int seconds)
647{ 647{
648 struct itimerval it_new, it_old; 648 return alarm_setitimer(seconds);
649 unsigned int oldalarm;
650
651 if (!seconds) {
652 getitimer_real(&it_old);
653 del_timer(&current->real_timer);
654 } else {
655 it_new.it_interval.tv_sec = it_new.it_interval.tv_usec = 0;
656 it_new.it_value.tv_sec = seconds;
657 it_new.it_value.tv_usec = 0;
658 do_setitimer(ITIMER_REAL, &it_new, &it_old);
659 }
660 oldalarm = it_old.it_value.tv_sec;
661 /*
662 * ehhh.. We can't return 0 if we have an alarm pending ...
663 * And we'd better return too much than too little anyway
664 */
665 if (it_old.it_value.tv_usec)
666 oldalarm++;
667
668 return oldalarm;
669} 649}
670 650
671asmlinkage int irix_pause(void) 651asmlinkage int irix_pause(void)
diff --git a/arch/mips/kernel/time.c b/arch/mips/kernel/time.c
index 42c94c771afb..5e51a2d8f3f0 100644
--- a/arch/mips/kernel/time.c
+++ b/arch/mips/kernel/time.c
@@ -65,9 +65,9 @@ static int null_rtc_set_time(unsigned long sec)
65 return 0; 65 return 0;
66} 66}
67 67
68unsigned long (*rtc_get_time)(void) = null_rtc_get_time; 68unsigned long (*rtc_mips_get_time)(void) = null_rtc_get_time;
69int (*rtc_set_time)(unsigned long) = null_rtc_set_time; 69int (*rtc_mips_set_time)(unsigned long) = null_rtc_set_time;
70int (*rtc_set_mmss)(unsigned long); 70int (*rtc_mips_set_mmss)(unsigned long);
71 71
72 72
73/* usecs per counter cycle, shifted to left by 32 bits */ 73/* usecs per counter cycle, shifted to left by 32 bits */
@@ -424,6 +424,8 @@ irqreturn_t timer_interrupt(int irq, void *dev_id, struct pt_regs *regs)
424 unsigned long j; 424 unsigned long j;
425 unsigned int count; 425 unsigned int count;
426 426
427 write_seqlock(&xtime_lock);
428
427 count = mips_hpt_read(); 429 count = mips_hpt_read();
428 mips_timer_ack(); 430 mips_timer_ack();
429 431
@@ -438,22 +440,20 @@ irqreturn_t timer_interrupt(int irq, void *dev_id, struct pt_regs *regs)
438 440
439 /* 441 /*
440 * If we have an externally synchronized Linux clock, then update 442 * If we have an externally synchronized Linux clock, then update
441 * CMOS clock accordingly every ~11 minutes. rtc_set_time() has to be 443 * CMOS clock accordingly every ~11 minutes. rtc_mips_set_time() has to be
442 * called as close as possible to 500 ms before the new second starts. 444 * called as close as possible to 500 ms before the new second starts.
443 */ 445 */
444 write_seqlock(&xtime_lock);
445 if (ntp_synced() && 446 if (ntp_synced() &&
446 xtime.tv_sec > last_rtc_update + 660 && 447 xtime.tv_sec > last_rtc_update + 660 &&
447 (xtime.tv_nsec / 1000) >= 500000 - ((unsigned) TICK_SIZE) / 2 && 448 (xtime.tv_nsec / 1000) >= 500000 - ((unsigned) TICK_SIZE) / 2 &&
448 (xtime.tv_nsec / 1000) <= 500000 + ((unsigned) TICK_SIZE) / 2) { 449 (xtime.tv_nsec / 1000) <= 500000 + ((unsigned) TICK_SIZE) / 2) {
449 if (rtc_set_mmss(xtime.tv_sec) == 0) { 450 if (rtc_mips_set_mmss(xtime.tv_sec) == 0) {
450 last_rtc_update = xtime.tv_sec; 451 last_rtc_update = xtime.tv_sec;
451 } else { 452 } else {
452 /* do it again in 60 s */ 453 /* do it again in 60 s */
453 last_rtc_update = xtime.tv_sec - 600; 454 last_rtc_update = xtime.tv_sec - 600;
454 } 455 }
455 } 456 }
456 write_sequnlock(&xtime_lock);
457 457
458 /* 458 /*
459 * If jiffies has overflown in this timer_interrupt, we must 459 * If jiffies has overflown in this timer_interrupt, we must
@@ -496,6 +496,8 @@ irqreturn_t timer_interrupt(int irq, void *dev_id, struct pt_regs *regs)
496 } 496 }
497 } 497 }
498 498
499 write_sequnlock(&xtime_lock);
500
499 /* 501 /*
500 * In UP mode, we call local_timer_interrupt() to do profiling 502 * In UP mode, we call local_timer_interrupt() to do profiling
501 * and process accouting. 503 * and process accouting.
@@ -563,7 +565,7 @@ asmlinkage void ll_local_timer_interrupt(int irq, struct pt_regs *regs)
563 * b) (optional) calibrate and set the mips_hpt_frequency 565 * b) (optional) calibrate and set the mips_hpt_frequency
564 * (only needed if you intended to use fixed_rate_gettimeoffset 566 * (only needed if you intended to use fixed_rate_gettimeoffset
565 * or use cpu counter as timer interrupt source) 567 * or use cpu counter as timer interrupt source)
566 * 2) setup xtime based on rtc_get_time(). 568 * 2) setup xtime based on rtc_mips_get_time().
567 * 3) choose a appropriate gettimeoffset routine. 569 * 3) choose a appropriate gettimeoffset routine.
568 * 4) calculate a couple of cached variables for later usage 570 * 4) calculate a couple of cached variables for later usage
569 * 5) board_timer_setup() - 571 * 5) board_timer_setup() -
@@ -631,10 +633,10 @@ void __init time_init(void)
631 if (board_time_init) 633 if (board_time_init)
632 board_time_init(); 634 board_time_init();
633 635
634 if (!rtc_set_mmss) 636 if (!rtc_mips_set_mmss)
635 rtc_set_mmss = rtc_set_time; 637 rtc_mips_set_mmss = rtc_mips_set_time;
636 638
637 xtime.tv_sec = rtc_get_time(); 639 xtime.tv_sec = rtc_mips_get_time();
638 xtime.tv_nsec = 0; 640 xtime.tv_nsec = 0;
639 641
640 set_normalized_timespec(&wall_to_monotonic, 642 set_normalized_timespec(&wall_to_monotonic,
@@ -770,8 +772,8 @@ void to_tm(unsigned long tim, struct rtc_time *tm)
770 772
771EXPORT_SYMBOL(rtc_lock); 773EXPORT_SYMBOL(rtc_lock);
772EXPORT_SYMBOL(to_tm); 774EXPORT_SYMBOL(to_tm);
773EXPORT_SYMBOL(rtc_set_time); 775EXPORT_SYMBOL(rtc_mips_set_time);
774EXPORT_SYMBOL(rtc_get_time); 776EXPORT_SYMBOL(rtc_mips_get_time);
775 777
776unsigned long long sched_clock(void) 778unsigned long long sched_clock(void)
777{ 779{
diff --git a/arch/mips/kernel/traps.c b/arch/mips/kernel/traps.c
index 005debbfbe84..bed0eb6cf55d 100644
--- a/arch/mips/kernel/traps.c
+++ b/arch/mips/kernel/traps.c
@@ -576,7 +576,7 @@ asmlinkage void do_fpe(struct pt_regs *regs, unsigned long fcr31)
576 } 576 }
577#endif 577#endif
578 /* 578 /*
579 * Unimplemented operation exception. If we've got the full 579 * Unimplemented operation exception. If we've got the full
580 * software emulator on-board, let's use it... 580 * software emulator on-board, let's use it...
581 * 581 *
582 * Force FPU to dump state into task/thread context. We're 582 * Force FPU to dump state into task/thread context. We're
diff --git a/arch/mips/lasat/image/romscript.normal b/arch/mips/lasat/image/romscript.normal
index ca22336f6c36..988f8ad189cb 100644
--- a/arch/mips/lasat/image/romscript.normal
+++ b/arch/mips/lasat/image/romscript.normal
@@ -16,7 +16,8 @@ SECTIONS
16 _image_start = ADDR(.data); 16 _image_start = ADDR(.data);
17 _image_size = SIZEOF(.data); 17 _image_size = SIZEOF(.data);
18 18
19 .other : { 19 .other :
20 *(.*) 20 {
21 *(.*)
21 } 22 }
22} 23}
diff --git a/arch/mips/lasat/setup.c b/arch/mips/lasat/setup.c
index 83eb08b7a072..bb70a8240e61 100644
--- a/arch/mips/lasat/setup.c
+++ b/arch/mips/lasat/setup.c
@@ -165,7 +165,8 @@ void __init plat_setup(void)
165 165
166 /* Set up panic notifier */ 166 /* Set up panic notifier */
167 for (i = 0; i < sizeof(lasat_panic_block) / sizeof(struct notifier_block); i++) 167 for (i = 0; i < sizeof(lasat_panic_block) / sizeof(struct notifier_block); i++)
168 notifier_chain_register(&panic_notifier_list, &lasat_panic_block[i]); 168 atomic_notifier_chain_register(&panic_notifier_list,
169 &lasat_panic_block[i]);
169 170
170 lasat_reboot_setup(); 171 lasat_reboot_setup();
171 172
@@ -174,8 +175,8 @@ void __init plat_setup(void)
174 175
175#ifdef CONFIG_DS1603 176#ifdef CONFIG_DS1603
176 ds1603 = &ds_defs[mips_machtype]; 177 ds1603 = &ds_defs[mips_machtype];
177 rtc_get_time = ds1603_read; 178 rtc_mips_get_time = ds1603_read;
178 rtc_set_time = ds1603_set; 179 rtc_mips_set_time = ds1603_set;
179#endif 180#endif
180 181
181#ifdef DYNAMIC_SERIAL_INIT 182#ifdef DYNAMIC_SERIAL_INIT
diff --git a/arch/mips/lasat/sysctl.c b/arch/mips/lasat/sysctl.c
index 8ff43a1c1e99..e3d5aaa90f0d 100644
--- a/arch/mips/lasat/sysctl.c
+++ b/arch/mips/lasat/sysctl.c
@@ -30,12 +30,13 @@
30#include <linux/string.h> 30#include <linux/string.h>
31#include <linux/net.h> 31#include <linux/net.h>
32#include <linux/inet.h> 32#include <linux/inet.h>
33#include <linux/mutex.h>
33#include <asm/uaccess.h> 34#include <asm/uaccess.h>
34 35
35#include "sysctl.h" 36#include "sysctl.h"
36#include "ds1603.h" 37#include "ds1603.h"
37 38
38static DECLARE_MUTEX(lasat_info_sem); 39static DEFINE_MUTEX(lasat_info_mutex);
39 40
40/* Strategy function to write EEPROM after changing string entry */ 41/* Strategy function to write EEPROM after changing string entry */
41int sysctl_lasatstring(ctl_table *table, int *name, int nlen, 42int sysctl_lasatstring(ctl_table *table, int *name, int nlen,
@@ -43,17 +44,17 @@ int sysctl_lasatstring(ctl_table *table, int *name, int nlen,
43 void *newval, size_t newlen, void **context) 44 void *newval, size_t newlen, void **context)
44{ 45{
45 int r; 46 int r;
46 down(&lasat_info_sem); 47 mutex_lock(&lasat_info_mutex);
47 r = sysctl_string(table, name, 48 r = sysctl_string(table, name,
48 nlen, oldval, oldlenp, newval, newlen, context); 49 nlen, oldval, oldlenp, newval, newlen, context);
49 if (r < 0) { 50 if (r < 0) {
50 up(&lasat_info_sem); 51 mutex_unlock(&lasat_info_mutex);
51 return r; 52 return r;
52 } 53 }
53 if (newval && newlen) { 54 if (newval && newlen) {
54 lasat_write_eeprom_info(); 55 lasat_write_eeprom_info();
55 } 56 }
56 up(&lasat_info_sem); 57 mutex_unlock(&lasat_info_mutex);
57 return 1; 58 return 1;
58} 59}
59 60
@@ -63,14 +64,14 @@ int proc_dolasatstring(ctl_table *table, int write, struct file *filp,
63 void *buffer, size_t *lenp, loff_t *ppos) 64 void *buffer, size_t *lenp, loff_t *ppos)
64{ 65{
65 int r; 66 int r;
66 down(&lasat_info_sem); 67 mutex_lock(&lasat_info_mutex);
67 r = proc_dostring(table, write, filp, buffer, lenp, ppos); 68 r = proc_dostring(table, write, filp, buffer, lenp, ppos);
68 if ( (!write) || r) { 69 if ( (!write) || r) {
69 up(&lasat_info_sem); 70 mutex_unlock(&lasat_info_mutex);
70 return r; 71 return r;
71 } 72 }
72 lasat_write_eeprom_info(); 73 lasat_write_eeprom_info();
73 up(&lasat_info_sem); 74 mutex_unlock(&lasat_info_mutex);
74 return 0; 75 return 0;
75} 76}
76 77
@@ -79,14 +80,14 @@ int proc_dolasatint(ctl_table *table, int write, struct file *filp,
79 void *buffer, size_t *lenp, loff_t *ppos) 80 void *buffer, size_t *lenp, loff_t *ppos)
80{ 81{
81 int r; 82 int r;
82 down(&lasat_info_sem); 83 mutex_lock(&lasat_info_mutex);
83 r = proc_dointvec(table, write, filp, buffer, lenp, ppos); 84 r = proc_dointvec(table, write, filp, buffer, lenp, ppos);
84 if ( (!write) || r) { 85 if ( (!write) || r) {
85 up(&lasat_info_sem); 86 mutex_unlock(&lasat_info_mutex);
86 return r; 87 return r;
87 } 88 }
88 lasat_write_eeprom_info(); 89 lasat_write_eeprom_info();
89 up(&lasat_info_sem); 90 mutex_unlock(&lasat_info_mutex);
90 return 0; 91 return 0;
91} 92}
92 93
@@ -98,7 +99,7 @@ int proc_dolasatrtc(ctl_table *table, int write, struct file *filp,
98 void *buffer, size_t *lenp, loff_t *ppos) 99 void *buffer, size_t *lenp, loff_t *ppos)
99{ 100{
100 int r; 101 int r;
101 down(&lasat_info_sem); 102 mutex_lock(&lasat_info_mutex);
102 if (!write) { 103 if (!write) {
103 rtctmp = ds1603_read(); 104 rtctmp = ds1603_read();
104 /* check for time < 0 and set to 0 */ 105 /* check for time < 0 and set to 0 */
@@ -107,11 +108,11 @@ int proc_dolasatrtc(ctl_table *table, int write, struct file *filp,
107 } 108 }
108 r = proc_dointvec(table, write, filp, buffer, lenp, ppos); 109 r = proc_dointvec(table, write, filp, buffer, lenp, ppos);
109 if ( (!write) || r) { 110 if ( (!write) || r) {
110 up(&lasat_info_sem); 111 mutex_unlock(&lasat_info_mutex);
111 return r; 112 return r;
112 } 113 }
113 ds1603_set(rtctmp); 114 ds1603_set(rtctmp);
114 up(&lasat_info_sem); 115 mutex_unlock(&lasat_info_mutex);
115 return 0; 116 return 0;
116} 117}
117#endif 118#endif
@@ -122,16 +123,16 @@ int sysctl_lasat_intvec(ctl_table *table, int *name, int nlen,
122 void *newval, size_t newlen, void **context) 123 void *newval, size_t newlen, void **context)
123{ 124{
124 int r; 125 int r;
125 down(&lasat_info_sem); 126 mutex_lock(&lasat_info_mutex);
126 r = sysctl_intvec(table, name, nlen, oldval, oldlenp, newval, newlen, context); 127 r = sysctl_intvec(table, name, nlen, oldval, oldlenp, newval, newlen, context);
127 if (r < 0) { 128 if (r < 0) {
128 up(&lasat_info_sem); 129 mutex_unlock(&lasat_info_mutex);
129 return r; 130 return r;
130 } 131 }
131 if (newval && newlen) { 132 if (newval && newlen) {
132 lasat_write_eeprom_info(); 133 lasat_write_eeprom_info();
133 } 134 }
134 up(&lasat_info_sem); 135 mutex_unlock(&lasat_info_mutex);
135 return 1; 136 return 1;
136} 137}
137 138
@@ -142,19 +143,19 @@ int sysctl_lasat_rtc(ctl_table *table, int *name, int nlen,
142 void *newval, size_t newlen, void **context) 143 void *newval, size_t newlen, void **context)
143{ 144{
144 int r; 145 int r;
145 down(&lasat_info_sem); 146 mutex_lock(&lasat_info_mutex);
146 rtctmp = ds1603_read(); 147 rtctmp = ds1603_read();
147 if (rtctmp < 0) 148 if (rtctmp < 0)
148 rtctmp = 0; 149 rtctmp = 0;
149 r = sysctl_intvec(table, name, nlen, oldval, oldlenp, newval, newlen, context); 150 r = sysctl_intvec(table, name, nlen, oldval, oldlenp, newval, newlen, context);
150 if (r < 0) { 151 if (r < 0) {
151 up(&lasat_info_sem); 152 mutex_unlock(&lasat_info_mutex);
152 return r; 153 return r;
153 } 154 }
154 if (newval && newlen) { 155 if (newval && newlen) {
155 ds1603_set(rtctmp); 156 ds1603_set(rtctmp);
156 } 157 }
157 up(&lasat_info_sem); 158 mutex_unlock(&lasat_info_mutex);
158 return 1; 159 return 1;
159} 160}
160#endif 161#endif
@@ -192,13 +193,13 @@ int proc_lasat_ip(ctl_table *table, int write, struct file *filp,
192 return 0; 193 return 0;
193 } 194 }
194 195
195 down(&lasat_info_sem); 196 mutex_lock(&lasat_info_mutex);
196 if (write) { 197 if (write) {
197 len = 0; 198 len = 0;
198 p = buffer; 199 p = buffer;
199 while (len < *lenp) { 200 while (len < *lenp) {
200 if(get_user(c, p++)) { 201 if(get_user(c, p++)) {
201 up(&lasat_info_sem); 202 mutex_unlock(&lasat_info_mutex);
202 return -EFAULT; 203 return -EFAULT;
203 } 204 }
204 if (c == 0 || c == '\n') 205 if (c == 0 || c == '\n')
@@ -209,7 +210,7 @@ int proc_lasat_ip(ctl_table *table, int write, struct file *filp,
209 len = sizeof(proc_lasat_ipbuf) - 1; 210 len = sizeof(proc_lasat_ipbuf) - 1;
210 if (copy_from_user(proc_lasat_ipbuf, buffer, len)) 211 if (copy_from_user(proc_lasat_ipbuf, buffer, len))
211 { 212 {
212 up(&lasat_info_sem); 213 mutex_unlock(&lasat_info_mutex);
213 return -EFAULT; 214 return -EFAULT;
214 } 215 }
215 proc_lasat_ipbuf[len] = 0; 216 proc_lasat_ipbuf[len] = 0;
@@ -230,12 +231,12 @@ int proc_lasat_ip(ctl_table *table, int write, struct file *filp,
230 len = *lenp; 231 len = *lenp;
231 if (len) 232 if (len)
232 if(copy_to_user(buffer, proc_lasat_ipbuf, len)) { 233 if(copy_to_user(buffer, proc_lasat_ipbuf, len)) {
233 up(&lasat_info_sem); 234 mutex_unlock(&lasat_info_mutex);
234 return -EFAULT; 235 return -EFAULT;
235 } 236 }
236 if (len < *lenp) { 237 if (len < *lenp) {
237 if(put_user('\n', ((char *) buffer) + len)) { 238 if(put_user('\n', ((char *) buffer) + len)) {
238 up(&lasat_info_sem); 239 mutex_unlock(&lasat_info_mutex);
239 return -EFAULT; 240 return -EFAULT;
240 } 241 }
241 len++; 242 len++;
@@ -244,7 +245,7 @@ int proc_lasat_ip(ctl_table *table, int write, struct file *filp,
244 *ppos += len; 245 *ppos += len;
245 } 246 }
246 update_bcastaddr(); 247 update_bcastaddr();
247 up(&lasat_info_sem); 248 mutex_unlock(&lasat_info_mutex);
248 return 0; 249 return 0;
249} 250}
250#endif /* defined(CONFIG_INET) */ 251#endif /* defined(CONFIG_INET) */
@@ -256,10 +257,10 @@ static int sysctl_lasat_eeprom_value(ctl_table *table, int *name, int nlen,
256{ 257{
257 int r; 258 int r;
258 259
259 down(&lasat_info_sem); 260 mutex_lock(&lasat_info_mutex);
260 r = sysctl_intvec(table, name, nlen, oldval, oldlenp, newval, newlen, context); 261 r = sysctl_intvec(table, name, nlen, oldval, oldlenp, newval, newlen, context);
261 if (r < 0) { 262 if (r < 0) {
262 up(&lasat_info_sem); 263 mutex_unlock(&lasat_info_mutex);
263 return r; 264 return r;
264 } 265 }
265 266
@@ -271,7 +272,7 @@ static int sysctl_lasat_eeprom_value(ctl_table *table, int *name, int nlen,
271 lasat_write_eeprom_info(); 272 lasat_write_eeprom_info();
272 lasat_init_board_info(); 273 lasat_init_board_info();
273 } 274 }
274 up(&lasat_info_sem); 275 mutex_unlock(&lasat_info_mutex);
275 276
276 return 0; 277 return 0;
277} 278}
@@ -280,10 +281,10 @@ int proc_lasat_eeprom_value(ctl_table *table, int write, struct file *filp,
280 void *buffer, size_t *lenp, loff_t *ppos) 281 void *buffer, size_t *lenp, loff_t *ppos)
281{ 282{
282 int r; 283 int r;
283 down(&lasat_info_sem); 284 mutex_lock(&lasat_info_mutex);
284 r = proc_dointvec(table, write, filp, buffer, lenp, ppos); 285 r = proc_dointvec(table, write, filp, buffer, lenp, ppos);
285 if ( (!write) || r) { 286 if ( (!write) || r) {
286 up(&lasat_info_sem); 287 mutex_unlock(&lasat_info_mutex);
287 return r; 288 return r;
288 } 289 }
289 if (filp && filp->f_dentry) 290 if (filp && filp->f_dentry)
@@ -294,7 +295,7 @@ int proc_lasat_eeprom_value(ctl_table *table, int write, struct file *filp,
294 lasat_board_info.li_eeprom_info.debugaccess = lasat_board_info.li_debugaccess; 295 lasat_board_info.li_eeprom_info.debugaccess = lasat_board_info.li_debugaccess;
295 } 296 }
296 lasat_write_eeprom_info(); 297 lasat_write_eeprom_info();
297 up(&lasat_info_sem); 298 mutex_unlock(&lasat_info_mutex);
298 return 0; 299 return 0;
299} 300}
300 301
diff --git a/arch/mips/mips-boards/atlas/atlas_setup.c b/arch/mips/mips-boards/atlas/atlas_setup.c
index 873cf3141a31..c20d401ecf80 100644
--- a/arch/mips/mips-boards/atlas/atlas_setup.c
+++ b/arch/mips/mips-boards/atlas/atlas_setup.c
@@ -65,7 +65,7 @@ void __init plat_setup(void)
65 65
66 board_time_init = mips_time_init; 66 board_time_init = mips_time_init;
67 board_timer_setup = mips_timer_setup; 67 board_timer_setup = mips_timer_setup;
68 rtc_get_time = mips_rtc_get_time; 68 rtc_mips_get_time = mips_rtc_get_time;
69} 69}
70 70
71static void __init serial_init(void) 71static void __init serial_init(void)
diff --git a/arch/mips/mips-boards/generic/memory.c b/arch/mips/mips-boards/generic/memory.c
index 2c8afd77a20b..32c9210373ac 100644
--- a/arch/mips/mips-boards/generic/memory.c
+++ b/arch/mips/mips-boards/generic/memory.c
@@ -49,9 +49,6 @@ static char *mtypes[3] = {
49/* References to section boundaries */ 49/* References to section boundaries */
50extern char _end; 50extern char _end;
51 51
52#define PFN_ALIGN(x) (((unsigned long)(x) + (PAGE_SIZE - 1)) & PAGE_MASK)
53
54
55struct prom_pmemblock * __init prom_getmdesc(void) 52struct prom_pmemblock * __init prom_getmdesc(void)
56{ 53{
57 char *memsize_str; 54 char *memsize_str;
@@ -109,10 +106,10 @@ struct prom_pmemblock * __init prom_getmdesc(void)
109 106
110 mdesc[3].type = yamon_dontuse; 107 mdesc[3].type = yamon_dontuse;
111 mdesc[3].base = 0x00100000; 108 mdesc[3].base = 0x00100000;
112 mdesc[3].size = CPHYSADDR(PFN_ALIGN(&_end)) - mdesc[3].base; 109 mdesc[3].size = CPHYSADDR(PAGE_ALIGN(&_end)) - mdesc[3].base;
113 110
114 mdesc[4].type = yamon_free; 111 mdesc[4].type = yamon_free;
115 mdesc[4].base = CPHYSADDR(PFN_ALIGN(&_end)); 112 mdesc[4].base = CPHYSADDR(PAGE_ALIGN(&_end));
116 mdesc[4].size = memsize - mdesc[4].base; 113 mdesc[4].size = memsize - mdesc[4].base;
117 114
118 return &mdesc[0]; 115 return &mdesc[0];
@@ -174,7 +171,7 @@ unsigned long __init prom_free_prom_memory(void)
174 while (addr < boot_mem_map.map[i].addr 171 while (addr < boot_mem_map.map[i].addr
175 + boot_mem_map.map[i].size) { 172 + boot_mem_map.map[i].size) {
176 ClearPageReserved(virt_to_page(__va(addr))); 173 ClearPageReserved(virt_to_page(__va(addr)));
177 set_page_count(virt_to_page(__va(addr)), 1); 174 init_page_count(virt_to_page(__va(addr)));
178 free_page((unsigned long)__va(addr)); 175 free_page((unsigned long)__va(addr));
179 addr += PAGE_SIZE; 176 addr += PAGE_SIZE;
180 freed += PAGE_SIZE; 177 freed += PAGE_SIZE;
diff --git a/arch/mips/mips-boards/generic/mipsIRQ.S b/arch/mips/mips-boards/generic/mipsIRQ.S
index a397ecb872d6..ddd5c73a2971 100644
--- a/arch/mips/mips-boards/generic/mipsIRQ.S
+++ b/arch/mips/mips-boards/generic/mipsIRQ.S
@@ -98,7 +98,7 @@
98 and s0, s1 98 and s0, s1
99 99
100#if defined(CONFIG_CPU_MIPS32) || defined(CONFIG_CPU_MIPS64) 100#if defined(CONFIG_CPU_MIPS32) || defined(CONFIG_CPU_MIPS64)
101 .set mips32 101 .set mips32
102 clz a0, s0 102 clz a0, s0
103 .set mips0 103 .set mips0
104 negu a0 104 negu a0
diff --git a/arch/mips/mips-boards/malta/malta_setup.c b/arch/mips/mips-boards/malta/malta_setup.c
index 2209e8a9de34..b8488aab6df1 100644
--- a/arch/mips/mips-boards/malta/malta_setup.c
+++ b/arch/mips/mips-boards/malta/malta_setup.c
@@ -225,5 +225,5 @@ void __init plat_setup(void)
225 225
226 board_time_init = mips_time_init; 226 board_time_init = mips_time_init;
227 board_timer_setup = mips_timer_setup; 227 board_timer_setup = mips_timer_setup;
228 rtc_get_time = mips_rtc_get_time; 228 rtc_mips_get_time = mips_rtc_get_time;
229} 229}
diff --git a/arch/mips/mips-boards/sim/sim_IRQ.c b/arch/mips/mips-boards/sim/sim_IRQ.c
index 9987a85aabeb..5b84c7fe1022 100644
--- a/arch/mips/mips-boards/sim/sim_IRQ.c
+++ b/arch/mips/mips-boards/sim/sim_IRQ.c
@@ -96,7 +96,7 @@
96 andi a0, s0, CAUSEF_IP3 # delay slot, check hw1 interrupt 96 andi a0, s0, CAUSEF_IP3 # delay slot, check hw1 interrupt
97#else 97#else
98 beq a0, zero, 1f # delay slot, check hw3 interrupt 98 beq a0, zero, 1f # delay slot, check hw3 interrupt
99 andi a0, s0, CAUSEF_IP5 99 andi a0, s0, CAUSEF_IP5
100#endif 100#endif
101 101
102 /* Wheee, combined hardware level zero interrupt. */ 102 /* Wheee, combined hardware level zero interrupt. */
diff --git a/arch/mips/mips-boards/sim/sim_irq.S b/arch/mips/mips-boards/sim/sim_irq.S
index 835f0387fcd4..da52297a2216 100644
--- a/arch/mips/mips-boards/sim/sim_irq.S
+++ b/arch/mips/mips-boards/sim/sim_irq.S
@@ -42,7 +42,7 @@
42 and s0, s1 42 and s0, s1
43 43
44#if defined(CONFIG_CPU_MIPS32) || defined(CONFIG_CPU_MIPS64) 44#if defined(CONFIG_CPU_MIPS32) || defined(CONFIG_CPU_MIPS64)
45 .set mips32 45 .set mips32
46 clz a0, s0 46 clz a0, s0
47 .set mips0 47 .set mips0
48 negu a0 48 negu a0
diff --git a/arch/mips/mips-boards/sim/sim_mem.c b/arch/mips/mips-boards/sim/sim_mem.c
index 0dbd7435bb2a..e57f737bab10 100644
--- a/arch/mips/mips-boards/sim/sim_mem.c
+++ b/arch/mips/mips-boards/sim/sim_mem.c
@@ -42,9 +42,6 @@ static char *mtypes[3] = {
42/* References to section boundaries */ 42/* References to section boundaries */
43extern char _end; 43extern char _end;
44 44
45#define PFN_ALIGN(x) (((unsigned long)(x) + (PAGE_SIZE - 1)) & PAGE_MASK)
46
47
48struct prom_pmemblock * __init prom_getmdesc(void) 45struct prom_pmemblock * __init prom_getmdesc(void)
49{ 46{
50 unsigned int memsize; 47 unsigned int memsize;
@@ -64,10 +61,10 @@ struct prom_pmemblock * __init prom_getmdesc(void)
64 61
65 mdesc[2].type = simmem_reserved; 62 mdesc[2].type = simmem_reserved;
66 mdesc[2].base = 0x00100000; 63 mdesc[2].base = 0x00100000;
67 mdesc[2].size = CPHYSADDR(PFN_ALIGN(&_end)) - mdesc[2].base; 64 mdesc[2].size = CPHYSADDR(PAGE_ALIGN(&_end)) - mdesc[2].base;
68 65
69 mdesc[3].type = simmem_free; 66 mdesc[3].type = simmem_free;
70 mdesc[3].base = CPHYSADDR(PFN_ALIGN(&_end)); 67 mdesc[3].base = CPHYSADDR(PAGE_ALIGN(&_end));
71 mdesc[3].size = memsize - mdesc[3].base; 68 mdesc[3].size = memsize - mdesc[3].base;
72 69
73 return &mdesc[0]; 70 return &mdesc[0];
@@ -117,7 +114,7 @@ unsigned long __init prom_free_prom_memory(void)
117 while (addr < boot_mem_map.map[i].addr 114 while (addr < boot_mem_map.map[i].addr
118 + boot_mem_map.map[i].size) { 115 + boot_mem_map.map[i].size) {
119 ClearPageReserved(virt_to_page(__va(addr))); 116 ClearPageReserved(virt_to_page(__va(addr)));
120 set_page_count(virt_to_page(__va(addr)), 1); 117 init_page_count(virt_to_page(__va(addr)));
121 free_page((unsigned long)__va(addr)); 118 free_page((unsigned long)__va(addr));
122 addr += PAGE_SIZE; 119 addr += PAGE_SIZE;
123 freed += PAGE_SIZE; 120 freed += PAGE_SIZE;
diff --git a/arch/mips/mips-boards/sim/sim_smp.c b/arch/mips/mips-boards/sim/sim_smp.c
index 19824359f5de..a9f0c2bfe4ad 100644
--- a/arch/mips/mips-boards/sim/sim_smp.c
+++ b/arch/mips/mips-boards/sim/sim_smp.c
@@ -115,7 +115,7 @@ void prom_prepare_cpus(unsigned int max_cpus)
115#ifdef CONFIG_MIPS_MT_SMTC 115#ifdef CONFIG_MIPS_MT_SMTC
116 void mipsmt_prepare_cpus(int c); 116 void mipsmt_prepare_cpus(int c);
117 /* 117 /*
118 * As noted above, we can assume a single CPU for now 118 * As noted above, we can assume a single CPU for now
119 * but it may be multithreaded. 119 * but it may be multithreaded.
120 */ 120 */
121 121
diff --git a/arch/mips/mm/Makefile b/arch/mips/mm/Makefile
index b0178da019f0..4a6220116c96 100644
--- a/arch/mips/mm/Makefile
+++ b/arch/mips/mm/Makefile
@@ -12,7 +12,7 @@ obj-$(CONFIG_HIGHMEM) += highmem.o
12obj-$(CONFIG_CPU_MIPS32) += c-r4k.o cex-gen.o pg-r4k.o tlb-r4k.o 12obj-$(CONFIG_CPU_MIPS32) += c-r4k.o cex-gen.o pg-r4k.o tlb-r4k.o
13obj-$(CONFIG_CPU_MIPS64) += c-r4k.o cex-gen.o pg-r4k.o tlb-r4k.o 13obj-$(CONFIG_CPU_MIPS64) += c-r4k.o cex-gen.o pg-r4k.o tlb-r4k.o
14obj-$(CONFIG_CPU_NEVADA) += c-r4k.o cex-gen.o pg-r4k.o tlb-r4k.o 14obj-$(CONFIG_CPU_NEVADA) += c-r4k.o cex-gen.o pg-r4k.o tlb-r4k.o
15obj-$(CONFIG_CPU_R10000) += c-r4k.o cex-gen.o pg-r4k.o tlb-andes.o 15obj-$(CONFIG_CPU_R10000) += c-r4k.o cex-gen.o pg-r4k.o tlb-r4k.o
16obj-$(CONFIG_CPU_R3000) += c-r3k.o tlb-r3k.o pg-r4k.o 16obj-$(CONFIG_CPU_R3000) += c-r3k.o tlb-r3k.o pg-r4k.o
17obj-$(CONFIG_CPU_R4300) += c-r4k.o cex-gen.o pg-r4k.o tlb-r4k.o 17obj-$(CONFIG_CPU_R4300) += c-r4k.o cex-gen.o pg-r4k.o tlb-r4k.o
18obj-$(CONFIG_CPU_R4X00) += c-r4k.o cex-gen.o pg-r4k.o tlb-r4k.o 18obj-$(CONFIG_CPU_R4X00) += c-r4k.o cex-gen.o pg-r4k.o tlb-r4k.o
diff --git a/arch/mips/mm/c-r3k.c b/arch/mips/mm/c-r3k.c
index 27f4fa25e8c9..9dd1352d5748 100644
--- a/arch/mips/mm/c-r3k.c
+++ b/arch/mips/mm/c-r3k.c
@@ -129,7 +129,7 @@ static void r3k_flush_icache_range(unsigned long start, unsigned long end)
129 "sb\t$0, 0x014(%0)\n\t" 129 "sb\t$0, 0x014(%0)\n\t"
130 "sb\t$0, 0x018(%0)\n\t" 130 "sb\t$0, 0x018(%0)\n\t"
131 "sb\t$0, 0x01c(%0)\n\t" 131 "sb\t$0, 0x01c(%0)\n\t"
132 "sb\t$0, 0x020(%0)\n\t" 132 "sb\t$0, 0x020(%0)\n\t"
133 "sb\t$0, 0x024(%0)\n\t" 133 "sb\t$0, 0x024(%0)\n\t"
134 "sb\t$0, 0x028(%0)\n\t" 134 "sb\t$0, 0x028(%0)\n\t"
135 "sb\t$0, 0x02c(%0)\n\t" 135 "sb\t$0, 0x02c(%0)\n\t"
@@ -145,7 +145,7 @@ static void r3k_flush_icache_range(unsigned long start, unsigned long end)
145 "sb\t$0, 0x054(%0)\n\t" 145 "sb\t$0, 0x054(%0)\n\t"
146 "sb\t$0, 0x058(%0)\n\t" 146 "sb\t$0, 0x058(%0)\n\t"
147 "sb\t$0, 0x05c(%0)\n\t" 147 "sb\t$0, 0x05c(%0)\n\t"
148 "sb\t$0, 0x060(%0)\n\t" 148 "sb\t$0, 0x060(%0)\n\t"
149 "sb\t$0, 0x064(%0)\n\t" 149 "sb\t$0, 0x064(%0)\n\t"
150 "sb\t$0, 0x068(%0)\n\t" 150 "sb\t$0, 0x068(%0)\n\t"
151 "sb\t$0, 0x06c(%0)\n\t" 151 "sb\t$0, 0x06c(%0)\n\t"
@@ -182,31 +182,31 @@ static void r3k_flush_dcache_range(unsigned long start, unsigned long end)
182 "sb\t$0, 0x004(%0)\n\t" 182 "sb\t$0, 0x004(%0)\n\t"
183 "sb\t$0, 0x008(%0)\n\t" 183 "sb\t$0, 0x008(%0)\n\t"
184 "sb\t$0, 0x00c(%0)\n\t" 184 "sb\t$0, 0x00c(%0)\n\t"
185 "sb\t$0, 0x010(%0)\n\t" 185 "sb\t$0, 0x010(%0)\n\t"
186 "sb\t$0, 0x014(%0)\n\t" 186 "sb\t$0, 0x014(%0)\n\t"
187 "sb\t$0, 0x018(%0)\n\t" 187 "sb\t$0, 0x018(%0)\n\t"
188 "sb\t$0, 0x01c(%0)\n\t" 188 "sb\t$0, 0x01c(%0)\n\t"
189 "sb\t$0, 0x020(%0)\n\t" 189 "sb\t$0, 0x020(%0)\n\t"
190 "sb\t$0, 0x024(%0)\n\t" 190 "sb\t$0, 0x024(%0)\n\t"
191 "sb\t$0, 0x028(%0)\n\t" 191 "sb\t$0, 0x028(%0)\n\t"
192 "sb\t$0, 0x02c(%0)\n\t" 192 "sb\t$0, 0x02c(%0)\n\t"
193 "sb\t$0, 0x030(%0)\n\t" 193 "sb\t$0, 0x030(%0)\n\t"
194 "sb\t$0, 0x034(%0)\n\t" 194 "sb\t$0, 0x034(%0)\n\t"
195 "sb\t$0, 0x038(%0)\n\t" 195 "sb\t$0, 0x038(%0)\n\t"
196 "sb\t$0, 0x03c(%0)\n\t" 196 "sb\t$0, 0x03c(%0)\n\t"
197 "sb\t$0, 0x040(%0)\n\t" 197 "sb\t$0, 0x040(%0)\n\t"
198 "sb\t$0, 0x044(%0)\n\t" 198 "sb\t$0, 0x044(%0)\n\t"
199 "sb\t$0, 0x048(%0)\n\t" 199 "sb\t$0, 0x048(%0)\n\t"
200 "sb\t$0, 0x04c(%0)\n\t" 200 "sb\t$0, 0x04c(%0)\n\t"
201 "sb\t$0, 0x050(%0)\n\t" 201 "sb\t$0, 0x050(%0)\n\t"
202 "sb\t$0, 0x054(%0)\n\t" 202 "sb\t$0, 0x054(%0)\n\t"
203 "sb\t$0, 0x058(%0)\n\t" 203 "sb\t$0, 0x058(%0)\n\t"
204 "sb\t$0, 0x05c(%0)\n\t" 204 "sb\t$0, 0x05c(%0)\n\t"
205 "sb\t$0, 0x060(%0)\n\t" 205 "sb\t$0, 0x060(%0)\n\t"
206 "sb\t$0, 0x064(%0)\n\t" 206 "sb\t$0, 0x064(%0)\n\t"
207 "sb\t$0, 0x068(%0)\n\t" 207 "sb\t$0, 0x068(%0)\n\t"
208 "sb\t$0, 0x06c(%0)\n\t" 208 "sb\t$0, 0x06c(%0)\n\t"
209 "sb\t$0, 0x070(%0)\n\t" 209 "sb\t$0, 0x070(%0)\n\t"
210 "sb\t$0, 0x074(%0)\n\t" 210 "sb\t$0, 0x074(%0)\n\t"
211 "sb\t$0, 0x078(%0)\n\t" 211 "sb\t$0, 0x078(%0)\n\t"
212 "sb\t$0, 0x07c(%0)\n\t" 212 "sb\t$0, 0x07c(%0)\n\t"
diff --git a/arch/mips/mm/c-r4k.c b/arch/mips/mm/c-r4k.c
index 0668e9bfce41..32b7f6aeb983 100644
--- a/arch/mips/mm/c-r4k.c
+++ b/arch/mips/mm/c-r4k.c
@@ -375,6 +375,7 @@ static void r4k_flush_cache_mm(struct mm_struct *mm)
375struct flush_cache_page_args { 375struct flush_cache_page_args {
376 struct vm_area_struct *vma; 376 struct vm_area_struct *vma;
377 unsigned long addr; 377 unsigned long addr;
378 unsigned long pfn;
378}; 379};
379 380
380static inline void local_r4k_flush_cache_page(void *args) 381static inline void local_r4k_flush_cache_page(void *args)
@@ -382,6 +383,7 @@ static inline void local_r4k_flush_cache_page(void *args)
382 struct flush_cache_page_args *fcp_args = args; 383 struct flush_cache_page_args *fcp_args = args;
383 struct vm_area_struct *vma = fcp_args->vma; 384 struct vm_area_struct *vma = fcp_args->vma;
384 unsigned long addr = fcp_args->addr; 385 unsigned long addr = fcp_args->addr;
386 unsigned long paddr = fcp_args->pfn << PAGE_SHIFT;
385 int exec = vma->vm_flags & VM_EXEC; 387 int exec = vma->vm_flags & VM_EXEC;
386 struct mm_struct *mm = vma->vm_mm; 388 struct mm_struct *mm = vma->vm_mm;
387 pgd_t *pgdp; 389 pgd_t *pgdp;
@@ -431,11 +433,12 @@ static inline void local_r4k_flush_cache_page(void *args)
431 * Do indexed flush, too much work to get the (possible) TLB refills 433 * Do indexed flush, too much work to get the (possible) TLB refills
432 * to work correctly. 434 * to work correctly.
433 */ 435 */
434 addr = INDEX_BASE + (addr & (dcache_size - 1));
435 if (cpu_has_dc_aliases || (exec && !cpu_has_ic_fills_f_dc)) { 436 if (cpu_has_dc_aliases || (exec && !cpu_has_ic_fills_f_dc)) {
436 r4k_blast_dcache_page_indexed(addr); 437 r4k_blast_dcache_page_indexed(cpu_has_pindexed_dcache ?
437 if (exec && !cpu_icache_snoops_remote_store) 438 paddr : addr);
438 r4k_blast_scache_page_indexed(addr); 439 if (exec && !cpu_icache_snoops_remote_store) {
440 r4k_blast_scache_page_indexed(paddr);
441 }
439 } 442 }
440 if (exec) { 443 if (exec) {
441 if (cpu_has_vtag_icache) { 444 if (cpu_has_vtag_icache) {
@@ -455,6 +458,7 @@ static void r4k_flush_cache_page(struct vm_area_struct *vma,
455 458
456 args.vma = vma; 459 args.vma = vma;
457 args.addr = addr; 460 args.addr = addr;
461 args.pfn = pfn;
458 462
459 on_each_cpu(local_r4k_flush_cache_page, &args, 1, 1); 463 on_each_cpu(local_r4k_flush_cache_page, &args, 1, 1);
460} 464}
@@ -782,6 +786,7 @@ static void __init probe_pcache(void)
782 c->dcache.waybit = 0; 786 c->dcache.waybit = 0;
783 787
784 c->options |= MIPS_CPU_CACHE_CDEX_P; 788 c->options |= MIPS_CPU_CACHE_CDEX_P;
789 c->options |= MIPS_CPU_PREFETCH;
785 break; 790 break;
786 791
787 case CPU_R4000PC: 792 case CPU_R4000PC:
@@ -956,6 +961,7 @@ static void __init probe_pcache(void)
956 switch (c->cputype) { 961 switch (c->cputype) {
957 case CPU_20KC: 962 case CPU_20KC:
958 case CPU_25KF: 963 case CPU_25KF:
964 c->dcache.flags |= MIPS_CACHE_PINDEX;
959 case CPU_R10000: 965 case CPU_R10000:
960 case CPU_R12000: 966 case CPU_R12000:
961 case CPU_SB1: 967 case CPU_SB1:
diff --git a/arch/mips/mm/c-tx39.c b/arch/mips/mm/c-tx39.c
index 7c572bea4a98..fe232e3988e3 100644
--- a/arch/mips/mm/c-tx39.c
+++ b/arch/mips/mm/c-tx39.c
@@ -210,7 +210,6 @@ static void tx39_flush_cache_page(struct vm_area_struct *vma, unsigned long page
210 * Do indexed flush, too much work to get the (possible) TLB refills 210 * Do indexed flush, too much work to get the (possible) TLB refills
211 * to work correctly. 211 * to work correctly.
212 */ 212 */
213 page = (KSEG0 + (page & (dcache_size - 1)));
214 if (cpu_has_dc_aliases || exec) 213 if (cpu_has_dc_aliases || exec)
215 tx39_blast_dcache_page_indexed(page); 214 tx39_blast_dcache_page_indexed(page);
216 if (exec) 215 if (exec)
diff --git a/arch/mips/mm/dma-ip32.c b/arch/mips/mm/dma-ip32.c
index a7e3072ff78d..ec54ed0d26ff 100644
--- a/arch/mips/mm/dma-ip32.c
+++ b/arch/mips/mm/dma-ip32.c
@@ -138,7 +138,7 @@ dma_addr_t dma_map_single(struct device *dev, void *ptr, size_t size,
138 BUG(); 138 BUG();
139 } 139 }
140 140
141 addr = virt_to_phys(ptr)&RAM_OFFSET_MASK;; 141 addr = virt_to_phys(ptr)&RAM_OFFSET_MASK;
142 if(dev == NULL) 142 if(dev == NULL)
143 addr+=CRIME_HI_MEM_BASE; 143 addr+=CRIME_HI_MEM_BASE;
144 return (dma_addr_t)addr; 144 return (dma_addr_t)addr;
@@ -179,7 +179,7 @@ int dma_map_sg(struct device *dev, struct scatterlist *sg, int nents,
179 addr = (unsigned long) page_address(sg->page)+sg->offset; 179 addr = (unsigned long) page_address(sg->page)+sg->offset;
180 if (addr) 180 if (addr)
181 __dma_sync(addr, sg->length, direction); 181 __dma_sync(addr, sg->length, direction);
182 addr = __pa(addr)&RAM_OFFSET_MASK;; 182 addr = __pa(addr)&RAM_OFFSET_MASK;
183 if(dev == NULL) 183 if(dev == NULL)
184 addr += CRIME_HI_MEM_BASE; 184 addr += CRIME_HI_MEM_BASE;
185 sg->dma_address = (dma_addr_t)addr; 185 sg->dma_address = (dma_addr_t)addr;
@@ -199,7 +199,7 @@ dma_addr_t dma_map_page(struct device *dev, struct page *page,
199 199
200 addr = (unsigned long) page_address(page) + offset; 200 addr = (unsigned long) page_address(page) + offset;
201 dma_cache_wback_inv(addr, size); 201 dma_cache_wback_inv(addr, size);
202 addr = __pa(addr)&RAM_OFFSET_MASK;; 202 addr = __pa(addr)&RAM_OFFSET_MASK;
203 if(dev == NULL) 203 if(dev == NULL)
204 addr += CRIME_HI_MEM_BASE; 204 addr += CRIME_HI_MEM_BASE;
205 205
diff --git a/arch/mips/mm/init.c b/arch/mips/mm/init.c
index 0ff9a348b843..ad89c442f299 100644
--- a/arch/mips/mm/init.c
+++ b/arch/mips/mm/init.c
@@ -25,6 +25,7 @@
25#include <linux/highmem.h> 25#include <linux/highmem.h>
26#include <linux/swap.h> 26#include <linux/swap.h>
27#include <linux/proc_fs.h> 27#include <linux/proc_fs.h>
28#include <linux/pfn.h>
28 29
29#include <asm/bootinfo.h> 30#include <asm/bootinfo.h>
30#include <asm/cachectl.h> 31#include <asm/cachectl.h>
@@ -54,7 +55,8 @@ unsigned long empty_zero_page, zero_page_mask;
54 */ 55 */
55unsigned long setup_zero_pages(void) 56unsigned long setup_zero_pages(void)
56{ 57{
57 unsigned long order, size; 58 unsigned int order;
59 unsigned long size;
58 struct page *page; 60 struct page *page;
59 61
60 if (cpu_has_vce) 62 if (cpu_has_vce)
@@ -67,9 +69,9 @@ unsigned long setup_zero_pages(void)
67 panic("Oh boy, that early out of memory?"); 69 panic("Oh boy, that early out of memory?");
68 70
69 page = virt_to_page(empty_zero_page); 71 page = virt_to_page(empty_zero_page);
72 split_page(page, order);
70 while (page < virt_to_page(empty_zero_page + (PAGE_SIZE << order))) { 73 while (page < virt_to_page(empty_zero_page + (PAGE_SIZE << order))) {
71 SetPageReserved(page); 74 SetPageReserved(page);
72 set_page_count(page, 1);
73 page++; 75 page++;
74 } 76 }
75 77
@@ -176,9 +178,6 @@ void __init paging_init(void)
176 free_area_init(zones_size); 178 free_area_init(zones_size);
177} 179}
178 180
179#define PFN_UP(x) (((x) + PAGE_SIZE - 1) >> PAGE_SHIFT)
180#define PFN_DOWN(x) ((x) >> PAGE_SHIFT)
181
182static inline int page_is_ram(unsigned long pagenr) 181static inline int page_is_ram(unsigned long pagenr)
183{ 182{
184 int i; 183 int i;
@@ -244,7 +243,7 @@ void __init mem_init(void)
244#ifdef CONFIG_LIMITED_DMA 243#ifdef CONFIG_LIMITED_DMA
245 set_page_address(page, lowmem_page_address(page)); 244 set_page_address(page, lowmem_page_address(page));
246#endif 245#endif
247 set_page_count(page, 1); 246 init_page_count(page);
248 __free_page(page); 247 __free_page(page);
249 totalhigh_pages++; 248 totalhigh_pages++;
250 } 249 }
@@ -291,7 +290,7 @@ void free_initrd_mem(unsigned long start, unsigned long end)
291 290
292 for (; start < end; start += PAGE_SIZE) { 291 for (; start < end; start += PAGE_SIZE) {
293 ClearPageReserved(virt_to_page(start)); 292 ClearPageReserved(virt_to_page(start));
294 set_page_count(virt_to_page(start), 1); 293 init_page_count(virt_to_page(start));
295 free_page(start); 294 free_page(start);
296 totalram_pages++; 295 totalram_pages++;
297 } 296 }
@@ -314,7 +313,7 @@ void free_initmem(void)
314 page = addr; 313 page = addr;
315#endif 314#endif
316 ClearPageReserved(virt_to_page(page)); 315 ClearPageReserved(virt_to_page(page));
317 set_page_count(virt_to_page(page), 1); 316 init_page_count(virt_to_page(page));
318 free_page(page); 317 free_page(page);
319 totalram_pages++; 318 totalram_pages++;
320 freed += PAGE_SIZE; 319 freed += PAGE_SIZE;
diff --git a/arch/mips/mm/pg-r4k.c b/arch/mips/mm/pg-r4k.c
index f51e180072e3..e4390dc3eb48 100644
--- a/arch/mips/mm/pg-r4k.c
+++ b/arch/mips/mm/pg-r4k.c
@@ -124,7 +124,7 @@ static inline void build_nop(void)
124 124
125static inline void build_src_pref(int advance) 125static inline void build_src_pref(int advance)
126{ 126{
127 if (!(load_offset & (cpu_dcache_line_size() - 1))) { 127 if (!(load_offset & (cpu_dcache_line_size() - 1)) && advance) {
128 union mips_instruction mi; 128 union mips_instruction mi;
129 129
130 mi.i_format.opcode = pref_op; 130 mi.i_format.opcode = pref_op;
@@ -166,7 +166,7 @@ static inline void build_load_reg(int reg)
166 166
167static inline void build_dst_pref(int advance) 167static inline void build_dst_pref(int advance)
168{ 168{
169 if (!(store_offset & (cpu_dcache_line_size() - 1))) { 169 if (!(store_offset & (cpu_dcache_line_size() - 1)) && advance) {
170 union mips_instruction mi; 170 union mips_instruction mi;
171 171
172 mi.i_format.opcode = pref_op; 172 mi.i_format.opcode = pref_op;
@@ -340,6 +340,12 @@ void __init build_clear_page(void)
340 340
341 if (cpu_has_prefetch) { 341 if (cpu_has_prefetch) {
342 switch (current_cpu_data.cputype) { 342 switch (current_cpu_data.cputype) {
343 case CPU_TX49XX:
344 /* TX49 supports only Pref_Load */
345 pref_offset_clear = 0;
346 pref_offset_copy = 0;
347 break;
348
343 case CPU_RM9000: 349 case CPU_RM9000:
344 /* 350 /*
345 * As a workaround for erratum G105 which make the 351 * As a workaround for erratum G105 which make the
diff --git a/arch/mips/mm/sc-rm7k.c b/arch/mips/mm/sc-rm7k.c
index 9e8ff8badb19..3b6cc9ba1b05 100644
--- a/arch/mips/mm/sc-rm7k.c
+++ b/arch/mips/mm/sc-rm7k.c
@@ -9,6 +9,7 @@
9#include <linux/init.h> 9#include <linux/init.h>
10#include <linux/kernel.h> 10#include <linux/kernel.h>
11#include <linux/mm.h> 11#include <linux/mm.h>
12#include <linux/bitops.h>
12 13
13#include <asm/addrspace.h> 14#include <asm/addrspace.h>
14#include <asm/bcache.h> 15#include <asm/bcache.h>
@@ -43,14 +44,7 @@ static void rm7k_sc_wback_inv(unsigned long addr, unsigned long size)
43 /* Catch bad driver code */ 44 /* Catch bad driver code */
44 BUG_ON(size == 0); 45 BUG_ON(size == 0);
45 46
46 a = addr & ~(sc_lsize - 1); 47 blast_scache_range(addr, addr + size);
47 end = (addr + size - 1) & ~(sc_lsize - 1);
48 while (1) {
49 flush_scache_line(a); /* Hit_Writeback_Inv_SD */
50 if (a == end)
51 break;
52 a += sc_lsize;
53 }
54 48
55 if (!rm7k_tcache_enabled) 49 if (!rm7k_tcache_enabled)
56 return; 50 return;
@@ -74,14 +68,7 @@ static void rm7k_sc_inv(unsigned long addr, unsigned long size)
74 /* Catch bad driver code */ 68 /* Catch bad driver code */
75 BUG_ON(size == 0); 69 BUG_ON(size == 0);
76 70
77 a = addr & ~(sc_lsize - 1); 71 blast_inv_scache_range(addr, addr + size);
78 end = (addr + size - 1) & ~(sc_lsize - 1);
79 while (1) {
80 invalidate_scache_line(a); /* Hit_Invalidate_SD */
81 if (a == end)
82 break;
83 a += sc_lsize;
84 }
85 72
86 if (!rm7k_tcache_enabled) 73 if (!rm7k_tcache_enabled)
87 return; 74 return;
@@ -143,11 +130,17 @@ struct bcache_ops rm7k_sc_ops = {
143 130
144void __init rm7k_sc_init(void) 131void __init rm7k_sc_init(void)
145{ 132{
133 struct cpuinfo_mips *c = &current_cpu_data;
146 unsigned int config = read_c0_config(); 134 unsigned int config = read_c0_config();
147 135
148 if ((config & RM7K_CONF_SC)) 136 if ((config & RM7K_CONF_SC))
149 return; 137 return;
150 138
139 c->scache.linesz = sc_lsize;
140 c->scache.ways = 4;
141 c->scache.waybit= ffs(scache_size / c->scache.ways) - 1;
142 c->scache.waysize = scache_size / c->scache.ways;
143 c->scache.sets = scache_size / (c->scache.linesz * c->scache.ways);
151 printk(KERN_INFO "Secondary cache size %dK, linesize %d bytes.\n", 144 printk(KERN_INFO "Secondary cache size %dK, linesize %d bytes.\n",
152 (scache_size >> 10), sc_lsize); 145 (scache_size >> 10), sc_lsize);
153 146
diff --git a/arch/mips/mm/tlb-andes.c b/arch/mips/mm/tlb-andes.c
deleted file mode 100644
index 3f422a849c41..000000000000
--- a/arch/mips/mm/tlb-andes.c
+++ /dev/null
@@ -1,259 +0,0 @@
1/*
2 * This file is subject to the terms and conditions of the GNU General Public
3 * License. See the file "COPYING" in the main directory of this archive
4 * for more details.
5 *
6 * Copyright (C) 1997, 1998, 1999 Ralf Baechle (ralf@gnu.org)
7 * Copyright (C) 1999 Silicon Graphics, Inc.
8 * Copyright (C) 2000 Kanoj Sarcar (kanoj@sgi.com)
9 */
10#include <linux/init.h>
11#include <linux/kernel.h>
12#include <linux/sched.h>
13#include <linux/mm.h>
14#include <asm/page.h>
15#include <asm/pgtable.h>
16#include <asm/system.h>
17#include <asm/mmu_context.h>
18
19extern void build_tlb_refill_handler(void);
20
21#define NTLB_ENTRIES 64
22#define NTLB_ENTRIES_HALF 32
23
24void local_flush_tlb_all(void)
25{
26 unsigned long flags;
27 unsigned long old_ctx;
28 unsigned long entry;
29
30 local_irq_save(flags);
31 /* Save old context and create impossible VPN2 value */
32 old_ctx = read_c0_entryhi() & ASID_MASK;
33 write_c0_entryhi(CKSEG0);
34 write_c0_entrylo0(0);
35 write_c0_entrylo1(0);
36
37 entry = read_c0_wired();
38
39 /* Blast 'em all away. */
40 while (entry < NTLB_ENTRIES) {
41 write_c0_index(entry);
42 tlb_write_indexed();
43 entry++;
44 }
45 write_c0_entryhi(old_ctx);
46 local_irq_restore(flags);
47}
48
49void local_flush_tlb_mm(struct mm_struct *mm)
50{
51 int cpu = smp_processor_id();
52 if (cpu_context(cpu, mm) != 0) {
53 drop_mmu_context(mm,cpu);
54 }
55}
56
57void local_flush_tlb_range(struct vm_area_struct *vma, unsigned long start,
58 unsigned long end)
59{
60 struct mm_struct *mm = vma->vm_mm;
61 int cpu = smp_processor_id();
62
63 if (cpu_context(cpu, mm) != 0) {
64 unsigned long flags;
65 int size;
66
67 local_irq_save(flags);
68 size = (end - start + (PAGE_SIZE - 1)) >> PAGE_SHIFT;
69 size = (size + 1) >> 1;
70 if (size <= NTLB_ENTRIES_HALF) {
71 int oldpid = (read_c0_entryhi() & ASID_MASK);
72 int newpid = (cpu_context(smp_processor_id(), mm)
73 & ASID_MASK);
74
75 start &= (PAGE_MASK << 1);
76 end += ((PAGE_SIZE << 1) - 1);
77 end &= (PAGE_MASK << 1);
78 while(start < end) {
79 int idx;
80
81 write_c0_entryhi(start | newpid);
82 start += (PAGE_SIZE << 1);
83 tlb_probe();
84 idx = read_c0_index();
85 write_c0_entrylo0(0);
86 write_c0_entrylo1(0);
87 write_c0_entryhi(CKSEG0);
88 if(idx < 0)
89 continue;
90 tlb_write_indexed();
91 }
92 write_c0_entryhi(oldpid);
93 } else {
94 drop_mmu_context(mm, cpu);
95 }
96 local_irq_restore(flags);
97 }
98}
99
100void local_flush_tlb_kernel_range(unsigned long start, unsigned long end)
101{
102 unsigned long flags;
103 int size;
104
105 size = (end - start + (PAGE_SIZE - 1)) >> PAGE_SHIFT;
106 size = (size + 1) >> 1;
107
108 local_irq_save(flags);
109 if (size <= NTLB_ENTRIES_HALF) {
110 int pid = read_c0_entryhi();
111
112 start &= (PAGE_MASK << 1);
113 end += ((PAGE_SIZE << 1) - 1);
114 end &= (PAGE_MASK << 1);
115
116 while (start < end) {
117 int idx;
118
119 write_c0_entryhi(start);
120 start += (PAGE_SIZE << 1);
121 tlb_probe();
122 idx = read_c0_index();
123 write_c0_entrylo0(0);
124 write_c0_entrylo1(0);
125 write_c0_entryhi(CKSEG0 + (idx << (PAGE_SHIFT+1)));
126 if (idx < 0)
127 continue;
128 tlb_write_indexed();
129 }
130 write_c0_entryhi(pid);
131 } else {
132 local_flush_tlb_all();
133 }
134 local_irq_restore(flags);
135}
136
137void local_flush_tlb_page(struct vm_area_struct *vma, unsigned long page)
138{
139 if (cpu_context(smp_processor_id(), vma->vm_mm) != 0) {
140 unsigned long flags;
141 int oldpid, newpid, idx;
142
143 newpid = (cpu_context(smp_processor_id(), vma->vm_mm) &
144 ASID_MASK);
145 page &= (PAGE_MASK << 1);
146 local_irq_save(flags);
147 oldpid = (read_c0_entryhi() & ASID_MASK);
148 write_c0_entryhi(page | newpid);
149 tlb_probe();
150 idx = read_c0_index();
151 write_c0_entrylo0(0);
152 write_c0_entrylo1(0);
153 write_c0_entryhi(CKSEG0);
154 if (idx < 0)
155 goto finish;
156 tlb_write_indexed();
157
158 finish:
159 write_c0_entryhi(oldpid);
160 local_irq_restore(flags);
161 }
162}
163
164/*
165 * This one is only used for pages with the global bit set so we don't care
166 * much about the ASID.
167 */
168void local_flush_tlb_one(unsigned long page)
169{
170 unsigned long flags;
171 int oldpid, idx;
172
173 local_irq_save(flags);
174 page &= (PAGE_MASK << 1);
175 oldpid = read_c0_entryhi() & 0xff;
176 write_c0_entryhi(page);
177 tlb_probe();
178 idx = read_c0_index();
179 write_c0_entrylo0(0);
180 write_c0_entrylo1(0);
181 if (idx >= 0) {
182 /* Make sure all entries differ. */
183 write_c0_entryhi(CKSEG0+(idx<<(PAGE_SHIFT+1)));
184 tlb_write_indexed();
185 }
186 write_c0_entryhi(oldpid);
187
188 local_irq_restore(flags);
189}
190
191/* XXX Simplify this. On the R10000 writing a TLB entry for an virtual
192 address that already exists will overwrite the old entry and not result
193 in TLB malfunction or TLB shutdown. */
194void __update_tlb(struct vm_area_struct * vma, unsigned long address, pte_t pte)
195{
196 unsigned long flags;
197 pgd_t *pgdp;
198 pud_t *pudp;
199 pmd_t *pmdp;
200 pte_t *ptep;
201 int idx, pid;
202
203 /*
204 * Handle debugger faulting in for debugee.
205 */
206 if (current->active_mm != vma->vm_mm)
207 return;
208
209 pid = read_c0_entryhi() & ASID_MASK;
210
211 if ((pid != (cpu_context(smp_processor_id(), vma->vm_mm) & ASID_MASK))
212 || (cpu_context(smp_processor_id(), vma->vm_mm) == 0)) {
213 printk(KERN_WARNING
214 "%s: Wheee, bogus tlbpid mmpid=%d tlbpid=%d\n",
215 __FUNCTION__, (int) (cpu_context(smp_processor_id(),
216 vma->vm_mm) & ASID_MASK), pid);
217 }
218
219 local_irq_save(flags);
220 address &= (PAGE_MASK << 1);
221 write_c0_entryhi(address | (pid));
222 pgdp = pgd_offset(vma->vm_mm, address);
223 tlb_probe();
224 pudp = pud_offset(pgdp, address);
225 pmdp = pmd_offset(pudp, address);
226 idx = read_c0_index();
227 ptep = pte_offset_map(pmdp, address);
228 write_c0_entrylo0(pte_val(*ptep++) >> 6);
229 write_c0_entrylo1(pte_val(*ptep) >> 6);
230 write_c0_entryhi(address | pid);
231 if (idx < 0) {
232 tlb_write_random();
233 } else {
234 tlb_write_indexed();
235 }
236 write_c0_entryhi(pid);
237 local_irq_restore(flags);
238}
239
240void __init tlb_init(void)
241{
242 /*
243 * You should never change this register:
244 * - On R4600 1.7 the tlbp never hits for pages smaller than
245 * the value in the c0_pagemask register.
246 * - The entire mm handling assumes the c0_pagemask register to
247 * be set for 4kb pages.
248 */
249 write_c0_pagemask(PM_4K);
250 write_c0_wired(0);
251 write_c0_framemask(0);
252
253 /* From this point on the ARC firmware is dead. */
254 local_flush_tlb_all();
255
256 /* Did I tell you that ARC SUCKS? */
257
258 build_tlb_refill_handler();
259}
diff --git a/arch/mips/mm/tlb-r4k.c b/arch/mips/mm/tlb-r4k.c
index 8297970f0bb1..a865f2394cb0 100644
--- a/arch/mips/mm/tlb-r4k.c
+++ b/arch/mips/mm/tlb-r4k.c
@@ -424,8 +424,13 @@ void __init tlb_init(void)
424 probe_tlb(config); 424 probe_tlb(config);
425 write_c0_pagemask(PM_DEFAULT_MASK); 425 write_c0_pagemask(PM_DEFAULT_MASK);
426 write_c0_wired(0); 426 write_c0_wired(0);
427 write_c0_framemask(0);
427 temp_tlb_entry = current_cpu_data.tlbsize - 1; 428 temp_tlb_entry = current_cpu_data.tlbsize - 1;
429
430 /* From this point on the ARC firmware is dead. */
428 local_flush_tlb_all(); 431 local_flush_tlb_all();
429 432
433 /* Did I tell you that ARC SUCKS? */
434
430 build_tlb_refill_handler(); 435 build_tlb_refill_handler();
431} 436}
diff --git a/arch/mips/mm/tlbex.c b/arch/mips/mm/tlbex.c
index ac4f4bfaae50..599b3c297186 100644
--- a/arch/mips/mm/tlbex.c
+++ b/arch/mips/mm/tlbex.c
@@ -951,7 +951,6 @@ build_get_pmde64(u32 **p, struct label **l, struct reloc **r,
951 /* No i_nop needed here, since the next insn doesn't touch TMP. */ 951 /* No i_nop needed here, since the next insn doesn't touch TMP. */
952 952
953#ifdef CONFIG_SMP 953#ifdef CONFIG_SMP
954# ifdef CONFIG_BUILD_ELF64
955 /* 954 /*
956 * 64 bit SMP running in XKPHYS has smp_processor_id() << 3 955 * 64 bit SMP running in XKPHYS has smp_processor_id() << 3
957 * stored in CONTEXT. 956 * stored in CONTEXT.
@@ -962,18 +961,6 @@ build_get_pmde64(u32 **p, struct label **l, struct reloc **r,
962 i_daddu(p, ptr, ptr, tmp); 961 i_daddu(p, ptr, ptr, tmp);
963 i_dmfc0(p, tmp, C0_BADVADDR); 962 i_dmfc0(p, tmp, C0_BADVADDR);
964 i_ld(p, ptr, rel_lo(pgdc), ptr); 963 i_ld(p, ptr, rel_lo(pgdc), ptr);
965# else
966 /*
967 * 64 bit SMP running in compat space has the lower part of
968 * &pgd_current[smp_processor_id()] stored in CONTEXT.
969 */
970 if (!in_compat_space_p(pgdc))
971 panic("Invalid page directory address!");
972
973 i_dmfc0(p, ptr, C0_CONTEXT);
974 i_dsra(p, ptr, ptr, 23);
975 i_ld(p, ptr, 0, ptr);
976# endif
977#else 964#else
978 i_LA_mostly(p, ptr, pgdc); 965 i_LA_mostly(p, ptr, pgdc);
979 i_ld(p, ptr, rel_lo(pgdc), ptr); 966 i_ld(p, ptr, rel_lo(pgdc), ptr);
diff --git a/arch/mips/momentum/jaguar_atx/reset.c b/arch/mips/momentum/jaguar_atx/reset.c
index c4236b1e59fa..ce9fb2e3d952 100644
--- a/arch/mips/momentum/jaguar_atx/reset.c
+++ b/arch/mips/momentum/jaguar_atx/reset.c
@@ -32,7 +32,7 @@ void momenco_jaguar_restart(char *command)
32#else 32#else
33 void *nvram = (void*) 0xfc807000; 33 void *nvram = (void*) 0xfc807000;
34#endif 34#endif
35 /* Ask the NVRAM/RTC/watchdog chip to assert reset in 1/16 second */ 35 /* Ask the NVRAM/RTC/watchdog chip to assert reset in 1/16 second */
36 writeb(0x84, nvram + 0xff7); 36 writeb(0x84, nvram + 0xff7);
37 37
38 /* wait for the watchdog to go off */ 38 /* wait for the watchdog to go off */
diff --git a/arch/mips/momentum/jaguar_atx/setup.c b/arch/mips/momentum/jaguar_atx/setup.c
index 2699917b640a..91d9637143d7 100644
--- a/arch/mips/momentum/jaguar_atx/setup.c
+++ b/arch/mips/momentum/jaguar_atx/setup.c
@@ -229,8 +229,8 @@ void momenco_time_init(void)
229 mips_hpt_frequency = cpu_clock / 2; 229 mips_hpt_frequency = cpu_clock / 2;
230 board_timer_setup = momenco_timer_setup; 230 board_timer_setup = momenco_timer_setup;
231 231
232 rtc_get_time = m48t37y_get_time; 232 rtc_mips_get_time = m48t37y_get_time;
233 rtc_set_time = m48t37y_set_time; 233 rtc_mips_set_time = m48t37y_set_time;
234} 234}
235 235
236static struct resource mv_pci_io_mem0_resource = { 236static struct resource mv_pci_io_mem0_resource = {
@@ -461,7 +461,7 @@ void __init plat_setup(void)
461 unsigned int tbControl; 461 unsigned int tbControl;
462 tbControl = 462 tbControl =
463 0 << 26 | /* post trigger delay 0 */ 463 0 << 26 | /* post trigger delay 0 */
464 0x2 << 16 | /* sequential trace mode */ 464 0x2 << 16 | /* sequential trace mode */
465 // 0x0 << 16 | /* non-sequential trace mode */ 465 // 0x0 << 16 | /* non-sequential trace mode */
466 // 0xf << 4 | /* watchpoints disabled */ 466 // 0xf << 4 | /* watchpoints disabled */
467 2 << 2 | /* armed */ 467 2 << 2 | /* armed */
diff --git a/arch/mips/momentum/ocelot_3/reset.c b/arch/mips/momentum/ocelot_3/reset.c
index 72b4423c0864..9d86d2468376 100644
--- a/arch/mips/momentum/ocelot_3/reset.c
+++ b/arch/mips/momentum/ocelot_3/reset.c
@@ -34,7 +34,7 @@ void momenco_ocelot_restart(char *command)
34 /* base address of timekeeper portion of part */ 34 /* base address of timekeeper portion of part */
35 void *nvram = (void *) 0xfc807000L; 35 void *nvram = (void *) 0xfc807000L;
36 36
37 /* Ask the NVRAM/RTC/watchdog chip to assert reset in 1/16 second */ 37 /* Ask the NVRAM/RTC/watchdog chip to assert reset in 1/16 second */
38 writeb(0x84, nvram + 0xff7); 38 writeb(0x84, nvram + 0xff7);
39 39
40 /* wait for the watchdog to go off */ 40 /* wait for the watchdog to go off */
diff --git a/arch/mips/momentum/ocelot_3/setup.c b/arch/mips/momentum/ocelot_3/setup.c
index f95677f4f06f..370e75d0e75c 100644
--- a/arch/mips/momentum/ocelot_3/setup.c
+++ b/arch/mips/momentum/ocelot_3/setup.c
@@ -58,6 +58,7 @@
58#include <linux/bootmem.h> 58#include <linux/bootmem.h>
59#include <linux/mv643xx.h> 59#include <linux/mv643xx.h>
60#include <linux/pm.h> 60#include <linux/pm.h>
61#include <linux/bcd.h>
61 62
62#include <asm/time.h> 63#include <asm/time.h>
63#include <asm/page.h> 64#include <asm/page.h>
@@ -131,9 +132,6 @@ void setup_wired_tlb_entries(void)
131 add_wired_entry(ENTRYLO(0xfc000000), ENTRYLO(0xfd000000), (signed)0xfc000000, PM_16M); 132 add_wired_entry(ENTRYLO(0xfc000000), ENTRYLO(0xfd000000), (signed)0xfc000000, PM_16M);
132} 133}
133 134
134#define CONV_BCD_TO_BIN(val) (((val) & 0xf) + (((val) >> 4) * 10))
135#define CONV_BIN_TO_BCD(val) (((val) % 10) + (((val) / 10) << 4))
136
137unsigned long m48t37y_get_time(void) 135unsigned long m48t37y_get_time(void)
138{ 136{
139 unsigned int year, month, day, hour, min, sec; 137 unsigned int year, month, day, hour, min, sec;
@@ -143,16 +141,16 @@ unsigned long m48t37y_get_time(void)
143 /* stop the update */ 141 /* stop the update */
144 rtc_base[0x7ff8] = 0x40; 142 rtc_base[0x7ff8] = 0x40;
145 143
146 year = CONV_BCD_TO_BIN(rtc_base[0x7fff]); 144 year = BCD2BIN(rtc_base[0x7fff]);
147 year += CONV_BCD_TO_BIN(rtc_base[0x7ff1]) * 100; 145 year += BCD2BIN(rtc_base[0x7ff1]) * 100;
148 146
149 month = CONV_BCD_TO_BIN(rtc_base[0x7ffe]); 147 month = BCD2BIN(rtc_base[0x7ffe]);
150 148
151 day = CONV_BCD_TO_BIN(rtc_base[0x7ffd]); 149 day = BCD2BIN(rtc_base[0x7ffd]);
152 150
153 hour = CONV_BCD_TO_BIN(rtc_base[0x7ffb]); 151 hour = BCD2BIN(rtc_base[0x7ffb]);
154 min = CONV_BCD_TO_BIN(rtc_base[0x7ffa]); 152 min = BCD2BIN(rtc_base[0x7ffa]);
155 sec = CONV_BCD_TO_BIN(rtc_base[0x7ff9]); 153 sec = BCD2BIN(rtc_base[0x7ff9]);
156 154
157 /* start the update */ 155 /* start the update */
158 rtc_base[0x7ff8] = 0x00; 156 rtc_base[0x7ff8] = 0x00;
@@ -175,22 +173,22 @@ int m48t37y_set_time(unsigned long sec)
175 rtc_base[0x7ff8] = 0x80; 173 rtc_base[0x7ff8] = 0x80;
176 174
177 /* year */ 175 /* year */
178 rtc_base[0x7fff] = CONV_BIN_TO_BCD(tm.tm_year % 100); 176 rtc_base[0x7fff] = BIN2BCD(tm.tm_year % 100);
179 rtc_base[0x7ff1] = CONV_BIN_TO_BCD(tm.tm_year / 100); 177 rtc_base[0x7ff1] = BIN2BCD(tm.tm_year / 100);
180 178
181 /* month */ 179 /* month */
182 rtc_base[0x7ffe] = CONV_BIN_TO_BCD(tm.tm_mon); 180 rtc_base[0x7ffe] = BIN2BCD(tm.tm_mon);
183 181
184 /* day */ 182 /* day */
185 rtc_base[0x7ffd] = CONV_BIN_TO_BCD(tm.tm_mday); 183 rtc_base[0x7ffd] = BIN2BCD(tm.tm_mday);
186 184
187 /* hour/min/sec */ 185 /* hour/min/sec */
188 rtc_base[0x7ffb] = CONV_BIN_TO_BCD(tm.tm_hour); 186 rtc_base[0x7ffb] = BIN2BCD(tm.tm_hour);
189 rtc_base[0x7ffa] = CONV_BIN_TO_BCD(tm.tm_min); 187 rtc_base[0x7ffa] = BIN2BCD(tm.tm_min);
190 rtc_base[0x7ff9] = CONV_BIN_TO_BCD(tm.tm_sec); 188 rtc_base[0x7ff9] = BIN2BCD(tm.tm_sec);
191 189
192 /* day of week -- not really used, but let's keep it up-to-date */ 190 /* day of week -- not really used, but let's keep it up-to-date */
193 rtc_base[0x7ffc] = CONV_BIN_TO_BCD(tm.tm_wday + 1); 191 rtc_base[0x7ffc] = BIN2BCD(tm.tm_wday + 1);
194 192
195 /* disable writing */ 193 /* disable writing */
196 rtc_base[0x7ff8] = 0x00; 194 rtc_base[0x7ff8] = 0x00;
@@ -215,8 +213,8 @@ void momenco_time_init(void)
215 mips_hpt_frequency = cpu_clock / 2; 213 mips_hpt_frequency = cpu_clock / 2;
216 board_timer_setup = momenco_timer_setup; 214 board_timer_setup = momenco_timer_setup;
217 215
218 rtc_get_time = m48t37y_get_time; 216 rtc_mips_get_time = m48t37y_get_time;
219 rtc_set_time = m48t37y_set_time; 217 rtc_mips_set_time = m48t37y_set_time;
220} 218}
221 219
222/* 220/*
diff --git a/arch/mips/momentum/ocelot_c/reset.c b/arch/mips/momentum/ocelot_c/reset.c
index 6a2489f3b9a0..9dcd154c7767 100644
--- a/arch/mips/momentum/ocelot_c/reset.c
+++ b/arch/mips/momentum/ocelot_c/reset.c
@@ -34,7 +34,7 @@ void momenco_ocelot_restart(char *command)
34 0xfc807000; 34 0xfc807000;
35#endif 35#endif
36 36
37 /* Ask the NVRAM/RTC/watchdog chip to assert reset in 1/16 second */ 37 /* Ask the NVRAM/RTC/watchdog chip to assert reset in 1/16 second */
38 writeb(0x84, nvram + 0xff7); 38 writeb(0x84, nvram + 0xff7);
39 39
40 /* wait for the watchdog to go off */ 40 /* wait for the watchdog to go off */
diff --git a/arch/mips/momentum/ocelot_c/setup.c b/arch/mips/momentum/ocelot_c/setup.c
index bd02e60d037a..a3e6f5575592 100644
--- a/arch/mips/momentum/ocelot_c/setup.c
+++ b/arch/mips/momentum/ocelot_c/setup.c
@@ -227,8 +227,8 @@ void momenco_time_init(void)
227 printk("momenco_time_init cpu_clock=%d\n", cpu_clock); 227 printk("momenco_time_init cpu_clock=%d\n", cpu_clock);
228 board_timer_setup = momenco_timer_setup; 228 board_timer_setup = momenco_timer_setup;
229 229
230 rtc_get_time = m48t37y_get_time; 230 rtc_mips_get_time = m48t37y_get_time;
231 rtc_set_time = m48t37y_set_time; 231 rtc_mips_set_time = m48t37y_set_time;
232} 232}
233 233
234void __init plat_setup(void) 234void __init plat_setup(void)
diff --git a/arch/mips/pci/fixup-vr4133.c b/arch/mips/pci/fixup-vr4133.c
index 03a0ff2fc993..a8a47b494b23 100644
--- a/arch/mips/pci/fixup-vr4133.c
+++ b/arch/mips/pci/fixup-vr4133.c
@@ -45,7 +45,7 @@ int pcibios_plat_dev_init(struct pci_dev *dev)
45 45
46 /* 46 /*
47 * we have to open the bridges' windows down to 0 because otherwise 47 * we have to open the bridges' windows down to 0 because otherwise
48 * we cannot access ISA south bridge I/O registers that get mapped from 48 * we cannot access ISA south bridge I/O registers that get mapped from
49 * 0. for example, 8259 PIC would be unaccessible without that 49 * 0. for example, 8259 PIC would be unaccessible without that
50 */ 50 */
51 if(dev->vendor == PCI_VENDOR_ID_INTEL && dev->device == PCI_DEVICE_ID_INTEL_S21152BB) { 51 if(dev->vendor == PCI_VENDOR_ID_INTEL && dev->device == PCI_DEVICE_ID_INTEL_S21152BB) {
diff --git a/arch/mips/pci/ops-ddb5477.c b/arch/mips/pci/ops-ddb5477.c
index 0406b50a37d8..8e57d4c5d90f 100644
--- a/arch/mips/pci/ops-ddb5477.c
+++ b/arch/mips/pci/ops-ddb5477.c
@@ -253,9 +253,9 @@ static int write_config_byte(struct pci_config_swap *swap,
253static int prefix##_##rw##_config(struct pci_bus *bus, unsigned int devfn, int where, int size, u32 star val) \ 253static int prefix##_##rw##_config(struct pci_bus *bus, unsigned int devfn, int where, int size, u32 star val) \
254{ \ 254{ \
255 if (size == 1) \ 255 if (size == 1) \
256 return rw##_config_byte(pciswap, bus, devfn, where, (u8 star)val); \ 256 return rw##_config_byte(pciswap, bus, devfn, where, (u8 star)val); \
257 else if (size == 2) \ 257 else if (size == 2) \
258 return rw##_config_word(pciswap, bus, devfn, where, (u16 star)val); \ 258 return rw##_config_word(pciswap, bus, devfn, where, (u16 star)val); \
259 /* Size must be 4 */ \ 259 /* Size must be 4 */ \
260 return rw##_config_dword(pciswap, bus, devfn, where, val); \ 260 return rw##_config_dword(pciswap, bus, devfn, where, val); \
261} 261}
diff --git a/arch/mips/pci/ops-tx4938.c b/arch/mips/pci/ops-tx4938.c
index 4c0dcfce5297..0ff083489efd 100644
--- a/arch/mips/pci/ops-tx4938.c
+++ b/arch/mips/pci/ops-tx4938.c
@@ -34,16 +34,16 @@ struct resource pci_mem_resource = {
34}; 34};
35 35
36struct resource tx4938_pcic1_pci_io_resource = { 36struct resource tx4938_pcic1_pci_io_resource = {
37 .name = "PCI1 IO", 37 .name = "PCI1 IO",
38 .start = 0, 38 .start = 0,
39 .end = 0, 39 .end = 0,
40 .flags = IORESOURCE_IO 40 .flags = IORESOURCE_IO
41}; 41};
42struct resource tx4938_pcic1_pci_mem_resource = { 42struct resource tx4938_pcic1_pci_mem_resource = {
43 .name = "PCI1 mem", 43 .name = "PCI1 mem",
44 .start = 0, 44 .start = 0,
45 .end = 0, 45 .end = 0,
46 .flags = IORESOURCE_MEM 46 .flags = IORESOURCE_MEM
47}; 47};
48 48
49static int mkaddr(int bus, int dev_fn, int where, int *flagsp) 49static int mkaddr(int bus, int dev_fn, int where, int *flagsp)
diff --git a/arch/mips/pci/pci-bcm1480.c b/arch/mips/pci/pci-bcm1480.c
index ca975e7d32ff..f4ef1a35ca18 100644
--- a/arch/mips/pci/pci-bcm1480.c
+++ b/arch/mips/pci/pci-bcm1480.c
@@ -100,7 +100,7 @@ static int bcm1480_pci_can_access(struct pci_bus *bus, int devfn)
100 100
101 if (bus->number == 0) { 101 if (bus->number == 0) {
102 devno = PCI_SLOT(devfn); 102 devno = PCI_SLOT(devfn);
103 if (bcm1480_bus_status & PCI_DEVICE_MODE) 103 if (bcm1480_bus_status & PCI_DEVICE_MODE)
104 return 0; 104 return 0;
105 else 105 else
106 return 1; 106 return 1;
diff --git a/arch/mips/pci/pci-bcm1480ht.c b/arch/mips/pci/pci-bcm1480ht.c
index aca4a2e7a1c6..a3eebe5890a7 100644
--- a/arch/mips/pci/pci-bcm1480ht.c
+++ b/arch/mips/pci/pci-bcm1480ht.c
@@ -95,7 +95,7 @@ static int bcm1480ht_can_access(struct pci_bus *bus, int devfn)
95 95
96 if (bus->number == 0) { 96 if (bus->number == 0) {
97 devno = PCI_SLOT(devfn); 97 devno = PCI_SLOT(devfn);
98 if (bcm1480ht_bus_status & PCI_DEVICE_MODE) 98 if (bcm1480ht_bus_status & PCI_DEVICE_MODE)
99 return 0; 99 return 0;
100 } 100 }
101 return 1; 101 return 1;
diff --git a/arch/mips/pci/pci-ip27.c b/arch/mips/pci/pci-ip27.c
index efc96ce99eeb..6002d2a6a262 100644
--- a/arch/mips/pci/pci-ip27.c
+++ b/arch/mips/pci/pci-ip27.c
@@ -379,18 +379,18 @@ int __init bridge_probe(nasid_t nasid, int widget_id, int masterwid)
379 bridge = (bridge_t *) RAW_NODE_SWIN_BASE(nasid, widget_id); 379 bridge = (bridge_t *) RAW_NODE_SWIN_BASE(nasid, widget_id);
380 380
381 /* 381 /*
382 * Clear all pending interrupts. 382 * Clear all pending interrupts.
383 */ 383 */
384 bridge->b_int_rst_stat = BRIDGE_IRR_ALL_CLR; 384 bridge->b_int_rst_stat = BRIDGE_IRR_ALL_CLR;
385 385
386 /* 386 /*
387 * Until otherwise set up, assume all interrupts are from slot 0 387 * Until otherwise set up, assume all interrupts are from slot 0
388 */ 388 */
389 bridge->b_int_device = 0x0; 389 bridge->b_int_device = 0x0;
390 390
391 /* 391 /*
392 * swap pio's to pci mem and io space (big windows) 392 * swap pio's to pci mem and io space (big windows)
393 */ 393 */
394 bridge->b_wid_control |= BRIDGE_CTRL_IO_SWAP | 394 bridge->b_wid_control |= BRIDGE_CTRL_IO_SWAP |
395 BRIDGE_CTRL_MEM_SWAP; 395 BRIDGE_CTRL_MEM_SWAP;
396 396
diff --git a/arch/mips/philips/pnx8550/common/int.c b/arch/mips/philips/pnx8550/common/int.c
index 546144988bf5..c500e2d41f2c 100644
--- a/arch/mips/philips/pnx8550/common/int.c
+++ b/arch/mips/philips/pnx8550/common/int.c
@@ -251,7 +251,7 @@ void __init arch_init_irq(void)
251 if (gic_int_line == (PNX8550_INT_GPIO0 - PNX8550_INT_GIC_MIN)) { 251 if (gic_int_line == (PNX8550_INT_GPIO0 - PNX8550_INT_GIC_MIN)) {
252 /* PCI INT through gpio 8, which is setup in 252 /* PCI INT through gpio 8, which is setup in
253 * pnx8550_setup.c and routed to GPIO 253 * pnx8550_setup.c and routed to GPIO
254 * Interrupt Level 0 (GPIO Connection 58). 254 * Interrupt Level 0 (GPIO Connection 58).
255 * Set it active low. */ 255 * Set it active low. */
256 256
257 PNX8550_GIC_REQ(gic_int_line) = 0x1E020000; 257 PNX8550_GIC_REQ(gic_int_line) = 0x1E020000;
diff --git a/arch/mips/pmc-sierra/yosemite/setup.c b/arch/mips/pmc-sierra/yosemite/setup.c
index 8bce711575de..3f724d661bdb 100644
--- a/arch/mips/pmc-sierra/yosemite/setup.c
+++ b/arch/mips/pmc-sierra/yosemite/setup.c
@@ -198,8 +198,8 @@ static void __init py_rtc_setup(void)
198 if (!m48t37_base) 198 if (!m48t37_base)
199 printk(KERN_ERR "Mapping the RTC failed\n"); 199 printk(KERN_ERR "Mapping the RTC failed\n");
200 200
201 rtc_get_time = m48t37y_get_time; 201 rtc_mips_get_time = m48t37y_get_time;
202 rtc_set_time = m48t37y_set_time; 202 rtc_mips_set_time = m48t37y_set_time;
203 203
204 write_seqlock(&xtime_lock); 204 write_seqlock(&xtime_lock);
205 xtime.tv_sec = m48t37y_get_time(); 205 xtime.tv_sec = m48t37y_get_time();
diff --git a/arch/mips/qemu/Makefile b/arch/mips/qemu/Makefile
index 934944ab9e85..6a8e8bcef552 100644
--- a/arch/mips/qemu/Makefile
+++ b/arch/mips/qemu/Makefile
@@ -3,3 +3,5 @@
3# 3#
4 4
5obj-y = q-firmware.o q-int.o q-irq.o q-mem.o q-setup.o 5obj-y = q-firmware.o q-int.o q-irq.o q-mem.o q-setup.o
6
7obj-$(CONFIG_SMP) += q-smp.o
diff --git a/arch/mips/qemu/q-smp.c b/arch/mips/qemu/q-smp.c
new file mode 100644
index 000000000000..5a12354cd576
--- /dev/null
+++ b/arch/mips/qemu/q-smp.c
@@ -0,0 +1,48 @@
1/*
2 * This file is subject to the terms and conditions of the GNU General Public
3 * License. See the file "COPYING" in the main directory of this archive
4 * for more details.
5 *
6 * Copyright (C) 2006 by Ralf Baechle (ralf@linux-mips.org)
7 *
8 * Symmetric Uniprocessor (TM) Support
9 */
10#include <linux/kernel.h>
11#include <linux/sched.h>
12
13/*
14 * Send inter-processor interrupt
15 */
16void core_send_ipi(int cpu, unsigned int action)
17{
18 panic(KERN_ERR "%s called", __FUNCTION__);
19}
20
21/*
22 * After we've done initial boot, this function is called to allow the
23 * board code to clean up state, if needed
24 */
25void prom_init_secondary(void)
26{
27}
28
29void prom_smp_finish(void)
30{
31}
32
33/* Hook for after all CPUs are online */
34void prom_cpus_done(void)
35{
36}
37
38void __init prom_prepare_cpus(unsigned int max_cpus)
39{
40 cpus_clear(phys_cpu_present_map);
41}
42
43/*
44 * Firmware CPU startup hook
45 */
46void prom_boot_secondary(int cpu, struct task_struct *idle)
47{
48}
diff --git a/arch/mips/sgi-ip22/ip22-reset.c b/arch/mips/sgi-ip22/ip22-reset.c
index 92a3b3c15ed3..a9c58e067b53 100644
--- a/arch/mips/sgi-ip22/ip22-reset.c
+++ b/arch/mips/sgi-ip22/ip22-reset.c
@@ -238,7 +238,7 @@ static int __init reboot_setup(void)
238 request_irq(SGI_PANEL_IRQ, panel_int, 0, "Front Panel", NULL); 238 request_irq(SGI_PANEL_IRQ, panel_int, 0, "Front Panel", NULL);
239 init_timer(&blink_timer); 239 init_timer(&blink_timer);
240 blink_timer.function = blink_timeout; 240 blink_timer.function = blink_timeout;
241 notifier_chain_register(&panic_notifier_list, &panic_block); 241 atomic_notifier_chain_register(&panic_notifier_list, &panic_block);
242 242
243 return 0; 243 return 0;
244} 244}
diff --git a/arch/mips/sgi-ip22/ip22-time.c b/arch/mips/sgi-ip22/ip22-time.c
index b7300cc5c5ad..cca688ad64ad 100644
--- a/arch/mips/sgi-ip22/ip22-time.c
+++ b/arch/mips/sgi-ip22/ip22-time.c
@@ -212,8 +212,8 @@ static void indy_timer_setup(struct irqaction *irq)
212void __init ip22_time_init(void) 212void __init ip22_time_init(void)
213{ 213{
214 /* setup hookup functions */ 214 /* setup hookup functions */
215 rtc_get_time = indy_rtc_get_time; 215 rtc_mips_get_time = indy_rtc_get_time;
216 rtc_set_time = indy_rtc_set_time; 216 rtc_mips_set_time = indy_rtc_set_time;
217 217
218 board_time_init = indy_time_init; 218 board_time_init = indy_time_init;
219 board_timer_setup = indy_timer_setup; 219 board_timer_setup = indy_timer_setup;
diff --git a/arch/mips/sgi-ip27/ip27-irq.c b/arch/mips/sgi-ip27/ip27-irq.c
index 73e5e52781d8..2854ac4c9be1 100644
--- a/arch/mips/sgi-ip27/ip27-irq.c
+++ b/arch/mips/sgi-ip27/ip27-irq.c
@@ -88,12 +88,9 @@ static inline int find_level(cpuid_t *cpunum, int irq)
88{ 88{
89 int cpu, i; 89 int cpu, i;
90 90
91 for (cpu = 0; cpu <= NR_CPUS; cpu++) { 91 for_each_online_cpu(cpu) {
92 struct slice_data *si = cpu_data[cpu].data; 92 struct slice_data *si = cpu_data[cpu].data;
93 93
94 if (!cpu_online(cpu))
95 continue;
96
97 for (i = BASE_PCI_IRQ; i < LEVELS_PER_SLICE; i++) 94 for (i = BASE_PCI_IRQ; i < LEVELS_PER_SLICE; i++)
98 if (si->level_to_irq[i] == irq) { 95 if (si->level_to_irq[i] == irq) {
99 *cpunum = cpu; 96 *cpunum = cpu;
diff --git a/arch/mips/sgi-ip27/ip27-memory.c b/arch/mips/sgi-ip27/ip27-memory.c
index ef20d9ac0ba3..6c00dce9f73f 100644
--- a/arch/mips/sgi-ip27/ip27-memory.c
+++ b/arch/mips/sgi-ip27/ip27-memory.c
@@ -19,6 +19,7 @@
19#include <linux/nodemask.h> 19#include <linux/nodemask.h>
20#include <linux/swap.h> 20#include <linux/swap.h>
21#include <linux/bootmem.h> 21#include <linux/bootmem.h>
22#include <linux/pfn.h>
22#include <asm/page.h> 23#include <asm/page.h>
23#include <asm/sections.h> 24#include <asm/sections.h>
24 25
@@ -28,8 +29,6 @@
28#include <asm/sn/sn_private.h> 29#include <asm/sn/sn_private.h>
29 30
30 31
31#define PFN_UP(x) (((x) + PAGE_SIZE-1) >> PAGE_SHIFT)
32
33#define SLOT_PFNSHIFT (SLOT_SHIFT - PAGE_SHIFT) 32#define SLOT_PFNSHIFT (SLOT_SHIFT - PAGE_SHIFT)
34#define PFN_NASIDSHFT (NASID_SHFT - PAGE_SHIFT) 33#define PFN_NASIDSHFT (NASID_SHFT - PAGE_SHIFT)
35 34
@@ -540,8 +539,8 @@ void __init mem_init(void)
540 struct page *end, *p; 539 struct page *end, *p;
541 540
542 /* 541 /*
543 * This will free up the bootmem, ie, slot 0 memory. 542 * This will free up the bootmem, ie, slot 0 memory.
544 */ 543 */
545 totalram_pages += free_all_bootmem_node(NODE_DATA(node)); 544 totalram_pages += free_all_bootmem_node(NODE_DATA(node));
546 545
547 /* 546 /*
@@ -559,7 +558,7 @@ void __init mem_init(void)
559 /* if (!page_is_ram(pgnr)) continue; */ 558 /* if (!page_is_ram(pgnr)) continue; */
560 /* commented out until page_is_ram works */ 559 /* commented out until page_is_ram works */
561 ClearPageReserved(p); 560 ClearPageReserved(p);
562 set_page_count(p, 1); 561 init_page_count(p);
563 __free_page(p); 562 __free_page(p);
564 totalram_pages++; 563 totalram_pages++;
565 } 564 }
diff --git a/arch/mips/sgi-ip32/ip32-reset.c b/arch/mips/sgi-ip32/ip32-reset.c
index 0c948008b023..ab9d9cef089e 100644
--- a/arch/mips/sgi-ip32/ip32-reset.c
+++ b/arch/mips/sgi-ip32/ip32-reset.c
@@ -193,7 +193,7 @@ static __init int ip32_reboot_setup(void)
193 193
194 init_timer(&blink_timer); 194 init_timer(&blink_timer);
195 blink_timer.function = blink_timeout; 195 blink_timer.function = blink_timeout;
196 notifier_chain_register(&panic_notifier_list, &panic_block); 196 atomic_notifier_chain_register(&panic_notifier_list, &panic_block);
197 197
198 request_irq(MACEISA_RTC_IRQ, ip32_rtc_int, 0, "rtc", NULL); 198 request_irq(MACEISA_RTC_IRQ, ip32_rtc_int, 0, "rtc", NULL);
199 199
diff --git a/arch/mips/sgi-ip32/ip32-setup.c b/arch/mips/sgi-ip32/ip32-setup.c
index 2c38770b1e1b..a2dd8ae1ea8f 100644
--- a/arch/mips/sgi-ip32/ip32-setup.c
+++ b/arch/mips/sgi-ip32/ip32-setup.c
@@ -91,14 +91,14 @@ void __init plat_setup(void)
91{ 91{
92 board_be_init = ip32_be_init; 92 board_be_init = ip32_be_init;
93 93
94 rtc_get_time = mc146818_get_cmos_time; 94 rtc_mips_get_time = mc146818_get_cmos_time;
95 rtc_set_mmss = mc146818_set_rtc_mmss; 95 rtc_mips_set_mmss = mc146818_set_rtc_mmss;
96 96
97 board_time_init = ip32_time_init; 97 board_time_init = ip32_time_init;
98 board_timer_setup = ip32_timer_setup; 98 board_timer_setup = ip32_timer_setup;
99 99
100#ifdef CONFIG_SERIAL_8250 100#ifdef CONFIG_SERIAL_8250
101 { 101 {
102 static struct uart_port o2_serial[2]; 102 static struct uart_port o2_serial[2];
103 103
104 memset(o2_serial, 0, sizeof(o2_serial)); 104 memset(o2_serial, 0, sizeof(o2_serial));
diff --git a/arch/mips/sibyte/sb1250/time.c b/arch/mips/sibyte/sb1250/time.c
index 511c89d65f38..1588f6debd90 100644
--- a/arch/mips/sibyte/sb1250/time.c
+++ b/arch/mips/sibyte/sb1250/time.c
@@ -47,23 +47,51 @@
47#define IMR_IP3_VAL K_INT_MAP_I1 47#define IMR_IP3_VAL K_INT_MAP_I1
48#define IMR_IP4_VAL K_INT_MAP_I2 48#define IMR_IP4_VAL K_INT_MAP_I2
49 49
50#define SB1250_HPT_NUM 3
51#define SB1250_HPT_VALUE M_SCD_TIMER_CNT /* max value */
52#define SB1250_HPT_SHIFT ((sizeof(unsigned int)*8)-V_SCD_TIMER_WIDTH)
53
54
50extern int sb1250_steal_irq(int irq); 55extern int sb1250_steal_irq(int irq);
51 56
57static unsigned int sb1250_hpt_read(void);
58static void sb1250_hpt_init(unsigned int);
59
60static unsigned int hpt_offset;
61
62void __init sb1250_hpt_setup(void)
63{
64 int cpu = smp_processor_id();
65
66 if (!cpu) {
67 /* Setup hpt using timer #3 but do not enable irq for it */
68 __raw_writeq(0, IOADDR(A_SCD_TIMER_REGISTER(SB1250_HPT_NUM, R_SCD_TIMER_CFG)));
69 __raw_writeq(SB1250_HPT_VALUE,
70 IOADDR(A_SCD_TIMER_REGISTER(SB1250_HPT_NUM, R_SCD_TIMER_INIT)));
71 __raw_writeq(M_SCD_TIMER_ENABLE | M_SCD_TIMER_MODE_CONTINUOUS,
72 IOADDR(A_SCD_TIMER_REGISTER(SB1250_HPT_NUM, R_SCD_TIMER_CFG)));
73
74 /*
75 * we need to fill 32 bits, so just use the upper 23 bits and pretend
76 * the timer is going 512Mhz instead of 1Mhz
77 */
78 mips_hpt_frequency = V_SCD_TIMER_FREQ << SB1250_HPT_SHIFT;
79 mips_hpt_init = sb1250_hpt_init;
80 mips_hpt_read = sb1250_hpt_read;
81 }
82}
83
84
52void sb1250_time_init(void) 85void sb1250_time_init(void)
53{ 86{
54 int cpu = smp_processor_id(); 87 int cpu = smp_processor_id();
55 int irq = K_INT_TIMER_0+cpu; 88 int irq = K_INT_TIMER_0+cpu;
56 89
57 /* Only have 4 general purpose timers */ 90 /* Only have 4 general purpose timers, and we use last one as hpt */
58 if (cpu > 3) { 91 if (cpu > 2) {
59 BUG(); 92 BUG();
60 } 93 }
61 94
62 if (!cpu) {
63 /* Use our own gettimeoffset() routine */
64 do_gettimeoffset = sb1250_gettimeoffset;
65 }
66
67 sb1250_mask_irq(cpu, irq); 95 sb1250_mask_irq(cpu, irq);
68 96
69 /* Map the timer interrupt to ip[4] of this cpu */ 97 /* Map the timer interrupt to ip[4] of this cpu */
@@ -75,10 +103,10 @@ void sb1250_time_init(void)
75 /* Disable the timer and set up the count */ 103 /* Disable the timer and set up the count */
76 __raw_writeq(0, IOADDR(A_SCD_TIMER_REGISTER(cpu, R_SCD_TIMER_CFG))); 104 __raw_writeq(0, IOADDR(A_SCD_TIMER_REGISTER(cpu, R_SCD_TIMER_CFG)));
77#ifdef CONFIG_SIMULATION 105#ifdef CONFIG_SIMULATION
78 __raw_writeq(50000 / HZ, 106 __raw_writeq((50000 / HZ) - 1,
79 IOADDR(A_SCD_TIMER_REGISTER(cpu, R_SCD_TIMER_INIT))); 107 IOADDR(A_SCD_TIMER_REGISTER(cpu, R_SCD_TIMER_INIT)));
80#else 108#else
81 __raw_writeq(1000000 / HZ, 109 __raw_writeq((V_SCD_TIMER_FREQ / HZ) - 1,
82 IOADDR(A_SCD_TIMER_REGISTER(cpu, R_SCD_TIMER_INIT))); 110 IOADDR(A_SCD_TIMER_REGISTER(cpu, R_SCD_TIMER_INIT)));
83#endif 111#endif
84 112
@@ -103,7 +131,7 @@ void sb1250_timer_interrupt(struct pt_regs *regs)
103 int cpu = smp_processor_id(); 131 int cpu = smp_processor_id();
104 int irq = K_INT_TIMER_0 + cpu; 132 int irq = K_INT_TIMER_0 + cpu;
105 133
106 /* Reset the timer */ 134 /* ACK interrupt */
107 ____raw_writeq(M_SCD_TIMER_ENABLE | M_SCD_TIMER_MODE_CONTINUOUS, 135 ____raw_writeq(M_SCD_TIMER_ENABLE | M_SCD_TIMER_MODE_CONTINUOUS,
108 IOADDR(A_SCD_TIMER_REGISTER(cpu, R_SCD_TIMER_CFG))); 136 IOADDR(A_SCD_TIMER_REGISTER(cpu, R_SCD_TIMER_CFG)));
109 137
@@ -122,15 +150,26 @@ void sb1250_timer_interrupt(struct pt_regs *regs)
122} 150}
123 151
124/* 152/*
125 * We use our own do_gettimeoffset() instead of the generic one, 153 * The HPT is free running from SB1250_HPT_VALUE down to 0 then starts over
126 * because the generic one does not work for SMP case. 154 * again. There's no easy way to set to a specific value so store init value
127 * In addition, since we use general timer 0 for system time, 155 * in hpt_offset and subtract each time.
128 * we can get accurate intra-jiffy offset without calibration. 156 *
157 * Note: Timer isn't full 32bits so shift it into the upper part making
158 * it appear to run at a higher frequency.
129 */ 159 */
130unsigned long sb1250_gettimeoffset(void) 160static unsigned int sb1250_hpt_read(void)
131{ 161{
132 unsigned long count = 162 unsigned int count;
133 __raw_readq(IOADDR(A_SCD_TIMER_REGISTER(0, R_SCD_TIMER_CNT)));
134 163
135 return 1000000/HZ - count; 164 count = G_SCD_TIMER_CNT(__raw_readq(IOADDR(A_SCD_TIMER_REGISTER(SB1250_HPT_NUM, R_SCD_TIMER_CNT))));
136 } 165
166 count = (SB1250_HPT_VALUE - count) << SB1250_HPT_SHIFT;
167
168 return count - hpt_offset;
169}
170
171static void sb1250_hpt_init(unsigned int count)
172{
173 hpt_offset = count;
174 return;
175}
diff --git a/arch/mips/sibyte/swarm/setup.c b/arch/mips/sibyte/swarm/setup.c
index b614ca0ddb69..4b5f74ff3edd 100644
--- a/arch/mips/sibyte/swarm/setup.c
+++ b/arch/mips/sibyte/swarm/setup.c
@@ -70,6 +70,12 @@ const char *get_system_type(void)
70 return "SiByte " SIBYTE_BOARD_NAME; 70 return "SiByte " SIBYTE_BOARD_NAME;
71} 71}
72 72
73void __init swarm_time_init(void)
74{
75 /* Setup HPT */
76 sb1250_hpt_setup();
77}
78
73void __init swarm_timer_setup(struct irqaction *irq) 79void __init swarm_timer_setup(struct irqaction *irq)
74{ 80{
75 /* 81 /*
@@ -109,19 +115,20 @@ void __init plat_setup(void)
109 115
110 panic_timeout = 5; /* For debug. */ 116 panic_timeout = 5; /* For debug. */
111 117
118 board_time_init = swarm_time_init;
112 board_timer_setup = swarm_timer_setup; 119 board_timer_setup = swarm_timer_setup;
113 board_be_handler = swarm_be_handler; 120 board_be_handler = swarm_be_handler;
114 121
115 if (xicor_probe()) { 122 if (xicor_probe()) {
116 printk("swarm setup: Xicor 1241 RTC detected.\n"); 123 printk("swarm setup: Xicor 1241 RTC detected.\n");
117 rtc_get_time = xicor_get_time; 124 rtc_mips_get_time = xicor_get_time;
118 rtc_set_time = xicor_set_time; 125 rtc_mips_set_time = xicor_set_time;
119 } 126 }
120 127
121 if (m41t81_probe()) { 128 if (m41t81_probe()) {
122 printk("swarm setup: M41T81 RTC detected.\n"); 129 printk("swarm setup: M41T81 RTC detected.\n");
123 rtc_get_time = m41t81_get_time; 130 rtc_mips_get_time = m41t81_get_time;
124 rtc_set_time = m41t81_set_time; 131 rtc_mips_set_time = m41t81_set_time;
125 } 132 }
126 133
127 printk("This kernel optimized for " 134 printk("This kernel optimized for "
diff --git a/arch/mips/sni/setup.c b/arch/mips/sni/setup.c
index 1141fcd13a59..01ba6c581e3d 100644
--- a/arch/mips/sni/setup.c
+++ b/arch/mips/sni/setup.c
@@ -164,8 +164,8 @@ static struct pci_controller sni_controller = {
164 164
165static inline void sni_pcimt_time_init(void) 165static inline void sni_pcimt_time_init(void)
166{ 166{
167 rtc_get_time = mc146818_get_cmos_time; 167 rtc_mips_get_time = mc146818_get_cmos_time;
168 rtc_set_time = mc146818_set_rtc_mmss; 168 rtc_mips_set_time = mc146818_set_rtc_mmss;
169} 169}
170 170
171void __init plat_setup(void) 171void __init plat_setup(void)
diff --git a/arch/mips/tx4927/toshiba_rbtx4927/toshiba_rbtx4927_prom.c b/arch/mips/tx4927/toshiba_rbtx4927/toshiba_rbtx4927_prom.c
index e19e2be70f76..efe50562f0ce 100644
--- a/arch/mips/tx4927/toshiba_rbtx4927/toshiba_rbtx4927_prom.c
+++ b/arch/mips/tx4927/toshiba_rbtx4927/toshiba_rbtx4927_prom.c
@@ -70,10 +70,10 @@ void __init prom_init(void)
70 70
71 if ((read_c0_prid() & 0xff) == PRID_REV_TX4927) { 71 if ((read_c0_prid() & 0xff) == PRID_REV_TX4927) {
72 mips_machtype = MACH_TOSHIBA_RBTX4927; 72 mips_machtype = MACH_TOSHIBA_RBTX4927;
73 toshiba_name = "TX4927"; 73 toshiba_name = "TX4927";
74 } else { 74 } else {
75 mips_machtype = MACH_TOSHIBA_RBTX4937; 75 mips_machtype = MACH_TOSHIBA_RBTX4937;
76 toshiba_name = "TX4937"; 76 toshiba_name = "TX4937";
77 } 77 }
78 78
79 msize = tx4927_get_mem_size(); 79 msize = tx4927_get_mem_size();
diff --git a/arch/mips/tx4927/toshiba_rbtx4927/toshiba_rbtx4927_setup.c b/arch/mips/tx4927/toshiba_rbtx4927/toshiba_rbtx4927_setup.c
index 2ad6401d2af4..6dcf077f61a0 100644
--- a/arch/mips/tx4927/toshiba_rbtx4927/toshiba_rbtx4927_setup.c
+++ b/arch/mips/tx4927/toshiba_rbtx4927/toshiba_rbtx4927_setup.c
@@ -1036,8 +1036,8 @@ toshiba_rbtx4927_time_init(void)
1036 1036
1037#ifdef CONFIG_RTC_DS1742 1037#ifdef CONFIG_RTC_DS1742
1038 1038
1039 rtc_get_time = rtc_ds1742_get_time; 1039 rtc_mips_get_time = rtc_ds1742_get_time;
1040 rtc_set_time = rtc_ds1742_set_time; 1040 rtc_mips_set_time = rtc_ds1742_set_time;
1041 1041
1042 TOSHIBA_RBTX4927_SETUP_DPRINTK(TOSHIBA_RBTX4927_SETUP_TIME_INIT, 1042 TOSHIBA_RBTX4927_SETUP_DPRINTK(TOSHIBA_RBTX4927_SETUP_TIME_INIT,
1043 ":rtc_ds1742_init()-\n"); 1043 ":rtc_ds1742_init()-\n");
diff --git a/arch/mips/tx4938/common/rtc_rx5c348.c b/arch/mips/tx4938/common/rtc_rx5c348.c
index d249edbb6af4..07f782fc0725 100644
--- a/arch/mips/tx4938/common/rtc_rx5c348.c
+++ b/arch/mips/tx4938/common/rtc_rx5c348.c
@@ -14,6 +14,7 @@
14#include <linux/string.h> 14#include <linux/string.h>
15#include <linux/rtc.h> 15#include <linux/rtc.h>
16#include <linux/time.h> 16#include <linux/time.h>
17#include <linux/bcd.h>
17#include <asm/time.h> 18#include <asm/time.h>
18#include <asm/tx4938/spi.h> 19#include <asm/tx4938/spi.h>
19 20
@@ -77,17 +78,6 @@ spi_rtc_io(unsigned char *inbuf, unsigned char *outbuf, unsigned int count)
77 inbufs, incounts, outbufs, outcounts, 0); 78 inbufs, incounts, outbufs, outcounts, 0);
78} 79}
79 80
80/*
81 * Conversion between binary and BCD.
82 */
83#ifndef BCD_TO_BIN
84#define BCD_TO_BIN(val) ((val)=((val)&15) + ((val)>>4)*10)
85#endif
86
87#ifndef BIN_TO_BCD
88#define BIN_TO_BCD(val) ((val)=(((val)/10)<<4) + (val)%10)
89#endif
90
91/* RTC-dependent code for time.c */ 81/* RTC-dependent code for time.c */
92 82
93static int 83static int
@@ -197,6 +187,6 @@ rtc_rx5c348_init(int chipid)
197 srtc_24h = 1; 187 srtc_24h = 1;
198 188
199 /* set the function pointers */ 189 /* set the function pointers */
200 rtc_get_time = rtc_rx5c348_get_time; 190 rtc_mips_get_time = rtc_rx5c348_get_time;
201 rtc_set_time = rtc_rx5c348_set_time; 191 rtc_mips_set_time = rtc_rx5c348_set_time;
202} 192}
diff --git a/arch/mips/tx4938/toshiba_rbtx4938/setup.c b/arch/mips/tx4938/toshiba_rbtx4938/setup.c
index 5c7ace982a49..9166cd4557eb 100644
--- a/arch/mips/tx4938/toshiba_rbtx4938/setup.c
+++ b/arch/mips/tx4938/toshiba_rbtx4938/setup.c
@@ -684,7 +684,7 @@ void __init tx4938_board_setup(void)
684 for (i = 0; i < 8; i++) { 684 for (i = 0; i < 8; i++) {
685 if (!(tx4938_ebuscptr->cr[i] & 0x8)) 685 if (!(tx4938_ebuscptr->cr[i] & 0x8))
686 continue; /* disabled */ 686 continue; /* disabled */
687 rbtx4938_ce_base[i] = (unsigned long)TX4938_EBUSC_BA(i); 687 rbtx4938_ce_base[i] = (unsigned long)TX4938_EBUSC_BA(i);
688 txboard_add_phys_region(rbtx4938_ce_base[i], TX4938_EBUSC_SIZE(i)); 688 txboard_add_phys_region(rbtx4938_ce_base[i], TX4938_EBUSC_SIZE(i));
689 } 689 }
690 690
diff --git a/arch/mips/vr41xx/common/bcu.c b/arch/mips/vr41xx/common/bcu.c
index de0c1b35f11c..ff272b2e8395 100644
--- a/arch/mips/vr41xx/common/bcu.c
+++ b/arch/mips/vr41xx/common/bcu.c
@@ -183,11 +183,11 @@ static inline unsigned long calculate_tclock(uint16_t clkspeed, unsigned long pc
183 switch (current_cpu_data.cputype) { 183 switch (current_cpu_data.cputype) {
184 case CPU_VR4111: 184 case CPU_VR4111:
185 if (!(clkspeed & DIV2B)) 185 if (!(clkspeed & DIV2B))
186 tclock = pclock / 2; 186 tclock = pclock / 2;
187 else if (!(clkspeed & DIV3B)) 187 else if (!(clkspeed & DIV3B))
188 tclock = pclock / 3; 188 tclock = pclock / 3;
189 else if (!(clkspeed & DIV4B)) 189 else if (!(clkspeed & DIV4B))
190 tclock = pclock / 4; 190 tclock = pclock / 4;
191 break; 191 break;
192 case CPU_VR4121: 192 case CPU_VR4121:
193 tclock = pclock / DIVT(clkspeed); 193 tclock = pclock / DIVT(clkspeed);
diff --git a/arch/parisc/Kconfig b/arch/parisc/Kconfig
index eca33cfa8a4c..2fdf21989dc2 100644
--- a/arch/parisc/Kconfig
+++ b/arch/parisc/Kconfig
@@ -25,6 +25,14 @@ config RWSEM_GENERIC_SPINLOCK
25config RWSEM_XCHGADD_ALGORITHM 25config RWSEM_XCHGADD_ALGORITHM
26 bool 26 bool
27 27
28config GENERIC_FIND_NEXT_BIT
29 bool
30 default y
31
32config GENERIC_HWEIGHT
33 bool
34 default y
35
28config GENERIC_CALIBRATE_DELAY 36config GENERIC_CALIBRATE_DELAY
29 bool 37 bool
30 default y 38 default y
@@ -169,14 +177,10 @@ config ARCH_DISCONTIGMEM_DEFAULT
169 def_bool y 177 def_bool y
170 depends on ARCH_DISCONTIGMEM_ENABLE 178 depends on ARCH_DISCONTIGMEM_ENABLE
171 179
180source "kernel/Kconfig.preempt"
172source "kernel/Kconfig.hz" 181source "kernel/Kconfig.hz"
173source "mm/Kconfig" 182source "mm/Kconfig"
174 183
175config PREEMPT
176 bool
177# bool "Preemptible Kernel"
178 default n
179
180config COMPAT 184config COMPAT
181 def_bool y 185 def_bool y
182 depends on 64BIT 186 depends on 64BIT
diff --git a/arch/parisc/configs/712_defconfig b/arch/parisc/configs/712_defconfig
index 3e013f55df64..41fd0696bbe7 100644
--- a/arch/parisc/configs/712_defconfig
+++ b/arch/parisc/configs/712_defconfig
@@ -1,7 +1,7 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.14-rc5-pa1 3# Linux kernel version: 2.6.16-pa6
4# Fri Oct 21 23:04:34 2005 4# Sun Mar 26 19:59:51 2006
5# 5#
6CONFIG_PARISC=y 6CONFIG_PARISC=y
7CONFIG_MMU=y 7CONFIG_MMU=y
@@ -10,14 +10,11 @@ CONFIG_RWSEM_GENERIC_SPINLOCK=y
10CONFIG_GENERIC_CALIBRATE_DELAY=y 10CONFIG_GENERIC_CALIBRATE_DELAY=y
11CONFIG_GENERIC_HARDIRQS=y 11CONFIG_GENERIC_HARDIRQS=y
12CONFIG_GENERIC_IRQ_PROBE=y 12CONFIG_GENERIC_IRQ_PROBE=y
13CONFIG_ARCH_MAY_HAVE_PC_FDC=y
14 13
15# 14#
16# Code maturity level options 15# Code maturity level options
17# 16#
18CONFIG_EXPERIMENTAL=y 17CONFIG_EXPERIMENTAL=y
19# CONFIG_CLEAN_COMPILE is not set
20CONFIG_BROKEN=y
21CONFIG_BROKEN_ON_SMP=y 18CONFIG_BROKEN_ON_SMP=y
22CONFIG_INIT_ENV_ARG_LIMIT=32 19CONFIG_INIT_ENV_ARG_LIMIT=32
23 20
@@ -32,17 +29,18 @@ CONFIG_POSIX_MQUEUE=y
32# CONFIG_BSD_PROCESS_ACCT is not set 29# CONFIG_BSD_PROCESS_ACCT is not set
33CONFIG_SYSCTL=y 30CONFIG_SYSCTL=y
34# CONFIG_AUDIT is not set 31# CONFIG_AUDIT is not set
35CONFIG_HOTPLUG=y
36CONFIG_KOBJECT_UEVENT=y
37CONFIG_IKCONFIG=y 32CONFIG_IKCONFIG=y
38CONFIG_IKCONFIG_PROC=y 33CONFIG_IKCONFIG_PROC=y
39CONFIG_INITRAMFS_SOURCE="" 34CONFIG_INITRAMFS_SOURCE=""
35CONFIG_CC_OPTIMIZE_FOR_SIZE=y
40# CONFIG_EMBEDDED is not set 36# CONFIG_EMBEDDED is not set
41CONFIG_KALLSYMS=y 37CONFIG_KALLSYMS=y
42CONFIG_KALLSYMS_ALL=y 38CONFIG_KALLSYMS_ALL=y
43# CONFIG_KALLSYMS_EXTRA_PASS is not set 39# CONFIG_KALLSYMS_EXTRA_PASS is not set
40CONFIG_HOTPLUG=y
44CONFIG_PRINTK=y 41CONFIG_PRINTK=y
45CONFIG_BUG=y 42CONFIG_BUG=y
43CONFIG_ELF_CORE=y
46CONFIG_BASE_FULL=y 44CONFIG_BASE_FULL=y
47CONFIG_FUTEX=y 45CONFIG_FUTEX=y
48CONFIG_EPOLL=y 46CONFIG_EPOLL=y
@@ -51,8 +49,10 @@ CONFIG_CC_ALIGN_FUNCTIONS=0
51CONFIG_CC_ALIGN_LABELS=0 49CONFIG_CC_ALIGN_LABELS=0
52CONFIG_CC_ALIGN_LOOPS=0 50CONFIG_CC_ALIGN_LOOPS=0
53CONFIG_CC_ALIGN_JUMPS=0 51CONFIG_CC_ALIGN_JUMPS=0
52CONFIG_SLAB=y
54# CONFIG_TINY_SHMEM is not set 53# CONFIG_TINY_SHMEM is not set
55CONFIG_BASE_SMALL=0 54CONFIG_BASE_SMALL=0
55# CONFIG_SLOB is not set
56 56
57# 57#
58# Loadable module support 58# Loadable module support
@@ -66,6 +66,23 @@ CONFIG_OBSOLETE_MODPARM=y
66CONFIG_KMOD=y 66CONFIG_KMOD=y
67 67
68# 68#
69# Block layer
70#
71
72#
73# IO Schedulers
74#
75CONFIG_IOSCHED_NOOP=y
76CONFIG_IOSCHED_AS=y
77CONFIG_IOSCHED_DEADLINE=y
78CONFIG_IOSCHED_CFQ=y
79CONFIG_DEFAULT_AS=y
80# CONFIG_DEFAULT_DEADLINE is not set
81# CONFIG_DEFAULT_CFQ is not set
82# CONFIG_DEFAULT_NOOP is not set
83CONFIG_DEFAULT_IOSCHED="anticipatory"
84
85#
69# Processor type and features 86# Processor type and features
70# 87#
71# CONFIG_PA7000 is not set 88# CONFIG_PA7000 is not set
@@ -75,6 +92,10 @@ CONFIG_PA7100LC=y
75# CONFIG_PA8X00 is not set 92# CONFIG_PA8X00 is not set
76CONFIG_PA11=y 93CONFIG_PA11=y
77# CONFIG_SMP is not set 94# CONFIG_SMP is not set
95CONFIG_ARCH_FLATMEM_ENABLE=y
96# CONFIG_PREEMPT_NONE is not set
97CONFIG_PREEMPT_VOLUNTARY=y
98# CONFIG_PREEMPT is not set
78# CONFIG_HZ_100 is not set 99# CONFIG_HZ_100 is not set
79CONFIG_HZ_250=y 100CONFIG_HZ_250=y
80# CONFIG_HZ_1000 is not set 101# CONFIG_HZ_1000 is not set
@@ -86,7 +107,7 @@ CONFIG_FLATMEM_MANUAL=y
86CONFIG_FLATMEM=y 107CONFIG_FLATMEM=y
87CONFIG_FLAT_NODE_MEM_MAP=y 108CONFIG_FLAT_NODE_MEM_MAP=y
88# CONFIG_SPARSEMEM_STATIC is not set 109# CONFIG_SPARSEMEM_STATIC is not set
89# CONFIG_PREEMPT is not set 110CONFIG_SPLIT_PTLOCK_CPUS=4096
90# CONFIG_HPUX is not set 111# CONFIG_HPUX is not set
91 112
92# 113#
@@ -130,6 +151,7 @@ CONFIG_NET=y
130# 151#
131# Networking options 152# Networking options
132# 153#
154# CONFIG_NETDEBUG is not set
133CONFIG_PACKET=y 155CONFIG_PACKET=y
134CONFIG_PACKET_MMAP=y 156CONFIG_PACKET_MMAP=y
135CONFIG_UNIX=y 157CONFIG_UNIX=y
@@ -165,7 +187,12 @@ CONFIG_TCP_CONG_BIC=y
165# CONFIG_IPV6 is not set 187# CONFIG_IPV6 is not set
166CONFIG_NETFILTER=y 188CONFIG_NETFILTER=y
167# CONFIG_NETFILTER_DEBUG is not set 189# CONFIG_NETFILTER_DEBUG is not set
190
191#
192# Core Netfilter Configuration
193#
168# CONFIG_NETFILTER_NETLINK is not set 194# CONFIG_NETFILTER_NETLINK is not set
195# CONFIG_NETFILTER_XTABLES is not set
169 196
170# 197#
171# IP: Netfilter Configuration 198# IP: Netfilter Configuration
@@ -182,64 +209,6 @@ CONFIG_IP_NF_TFTP=m
182CONFIG_IP_NF_AMANDA=m 209CONFIG_IP_NF_AMANDA=m
183# CONFIG_IP_NF_PPTP is not set 210# CONFIG_IP_NF_PPTP is not set
184CONFIG_IP_NF_QUEUE=m 211CONFIG_IP_NF_QUEUE=m
185CONFIG_IP_NF_IPTABLES=m
186CONFIG_IP_NF_MATCH_LIMIT=m
187CONFIG_IP_NF_MATCH_IPRANGE=m
188CONFIG_IP_NF_MATCH_MAC=m
189CONFIG_IP_NF_MATCH_PKTTYPE=m
190CONFIG_IP_NF_MATCH_MARK=m
191CONFIG_IP_NF_MATCH_MULTIPORT=m
192CONFIG_IP_NF_MATCH_TOS=m
193CONFIG_IP_NF_MATCH_RECENT=m
194CONFIG_IP_NF_MATCH_ECN=m
195CONFIG_IP_NF_MATCH_DSCP=m
196CONFIG_IP_NF_MATCH_AH_ESP=m
197CONFIG_IP_NF_MATCH_LENGTH=m
198CONFIG_IP_NF_MATCH_TTL=m
199CONFIG_IP_NF_MATCH_TCPMSS=m
200CONFIG_IP_NF_MATCH_HELPER=m
201CONFIG_IP_NF_MATCH_STATE=m
202CONFIG_IP_NF_MATCH_CONNTRACK=m
203CONFIG_IP_NF_MATCH_OWNER=m
204# CONFIG_IP_NF_MATCH_ADDRTYPE is not set
205# CONFIG_IP_NF_MATCH_REALM is not set
206CONFIG_IP_NF_MATCH_SCTP=m
207# CONFIG_IP_NF_MATCH_DCCP is not set
208CONFIG_IP_NF_MATCH_COMMENT=m
209CONFIG_IP_NF_MATCH_CONNMARK=m
210CONFIG_IP_NF_MATCH_HASHLIMIT=m
211# CONFIG_IP_NF_MATCH_STRING is not set
212CONFIG_IP_NF_FILTER=m
213CONFIG_IP_NF_TARGET_REJECT=m
214CONFIG_IP_NF_TARGET_LOG=m
215CONFIG_IP_NF_TARGET_ULOG=m
216CONFIG_IP_NF_TARGET_TCPMSS=m
217# CONFIG_IP_NF_TARGET_NFQUEUE is not set
218CONFIG_IP_NF_NAT=m
219CONFIG_IP_NF_NAT_NEEDED=y
220CONFIG_IP_NF_TARGET_MASQUERADE=m
221CONFIG_IP_NF_TARGET_REDIRECT=m
222CONFIG_IP_NF_TARGET_NETMAP=m
223CONFIG_IP_NF_TARGET_SAME=m
224CONFIG_IP_NF_NAT_SNMP_BASIC=m
225CONFIG_IP_NF_NAT_IRC=m
226CONFIG_IP_NF_NAT_FTP=m
227CONFIG_IP_NF_NAT_TFTP=m
228CONFIG_IP_NF_NAT_AMANDA=m
229CONFIG_IP_NF_MANGLE=m
230CONFIG_IP_NF_TARGET_TOS=m
231CONFIG_IP_NF_TARGET_ECN=m
232CONFIG_IP_NF_TARGET_DSCP=m
233CONFIG_IP_NF_TARGET_MARK=m
234CONFIG_IP_NF_TARGET_CLASSIFY=m
235# CONFIG_IP_NF_TARGET_TTL is not set
236CONFIG_IP_NF_TARGET_CONNMARK=m
237CONFIG_IP_NF_TARGET_CLUSTERIP=m
238CONFIG_IP_NF_RAW=m
239CONFIG_IP_NF_TARGET_NOTRACK=m
240CONFIG_IP_NF_ARPTABLES=m
241CONFIG_IP_NF_ARPFILTER=m
242CONFIG_IP_NF_ARP_MANGLE=m
243 212
244# 213#
245# DCCP Configuration (EXPERIMENTAL) 214# DCCP Configuration (EXPERIMENTAL)
@@ -250,6 +219,11 @@ CONFIG_IP_NF_ARP_MANGLE=m
250# SCTP Configuration (EXPERIMENTAL) 219# SCTP Configuration (EXPERIMENTAL)
251# 220#
252# CONFIG_IP_SCTP is not set 221# CONFIG_IP_SCTP is not set
222
223#
224# TIPC Configuration (EXPERIMENTAL)
225#
226# CONFIG_TIPC is not set
253# CONFIG_ATM is not set 227# CONFIG_ATM is not set
254# CONFIG_BRIDGE is not set 228# CONFIG_BRIDGE is not set
255# CONFIG_VLAN_8021Q is not set 229# CONFIG_VLAN_8021Q is not set
@@ -263,8 +237,11 @@ CONFIG_LLC2=m
263# CONFIG_NET_DIVERT is not set 237# CONFIG_NET_DIVERT is not set
264# CONFIG_ECONET is not set 238# CONFIG_ECONET is not set
265# CONFIG_WAN_ROUTER is not set 239# CONFIG_WAN_ROUTER is not set
240
241#
242# QoS and/or fair queueing
243#
266# CONFIG_NET_SCHED is not set 244# CONFIG_NET_SCHED is not set
267# CONFIG_NET_CLS_ROUTE is not set
268 245
269# 246#
270# Network testing 247# Network testing
@@ -304,6 +281,7 @@ CONFIG_PARPORT=y
304CONFIG_PARPORT_PC=m 281CONFIG_PARPORT_PC=m
305# CONFIG_PARPORT_PC_FIFO is not set 282# CONFIG_PARPORT_PC_FIFO is not set
306# CONFIG_PARPORT_PC_SUPERIO is not set 283# CONFIG_PARPORT_PC_SUPERIO is not set
284CONFIG_PARPORT_NOT_PC=y
307CONFIG_PARPORT_GSC=y 285CONFIG_PARPORT_GSC=y
308# CONFIG_PARPORT_1284 is not set 286# CONFIG_PARPORT_1284 is not set
309 287
@@ -314,7 +292,6 @@ CONFIG_PARPORT_GSC=y
314# 292#
315# Block devices 293# Block devices
316# 294#
317# CONFIG_BLK_DEV_FD is not set
318# CONFIG_PARIDE is not set 295# CONFIG_PARIDE is not set
319# CONFIG_BLK_DEV_COW_COMMON is not set 296# CONFIG_BLK_DEV_COW_COMMON is not set
320CONFIG_BLK_DEV_LOOP=y 297CONFIG_BLK_DEV_LOOP=y
@@ -325,14 +302,6 @@ CONFIG_BLK_DEV_RAM_COUNT=16
325CONFIG_BLK_DEV_RAM_SIZE=6144 302CONFIG_BLK_DEV_RAM_SIZE=6144
326CONFIG_BLK_DEV_INITRD=y 303CONFIG_BLK_DEV_INITRD=y
327# CONFIG_CDROM_PKTCDVD is not set 304# CONFIG_CDROM_PKTCDVD is not set
328
329#
330# IO Schedulers
331#
332CONFIG_IOSCHED_NOOP=y
333CONFIG_IOSCHED_AS=y
334CONFIG_IOSCHED_DEADLINE=y
335CONFIG_IOSCHED_CFQ=y
336CONFIG_ATA_OVER_ETH=m 305CONFIG_ATA_OVER_ETH=m
337 306
338# 307#
@@ -376,6 +345,7 @@ CONFIG_SCSI_ISCSI_ATTRS=m
376# 345#
377# SCSI low-level drivers 346# SCSI low-level drivers
378# 347#
348# CONFIG_ISCSI_TCP is not set
379# CONFIG_SCSI_SATA is not set 349# CONFIG_SCSI_SATA is not set
380# CONFIG_SCSI_PPA is not set 350# CONFIG_SCSI_PPA is not set
381# CONFIG_SCSI_IMM is not set 351# CONFIG_SCSI_IMM is not set
@@ -407,7 +377,6 @@ CONFIG_MD_RAID1=m
407# 377#
408# IEEE 1394 (FireWire) support 378# IEEE 1394 (FireWire) support
409# 379#
410# CONFIG_IEEE1394 is not set
411 380
412# 381#
413# I2O device support 382# I2O device support
@@ -471,6 +440,7 @@ CONFIG_PPP_ASYNC=m
471CONFIG_PPP_SYNC_TTY=m 440CONFIG_PPP_SYNC_TTY=m
472CONFIG_PPP_DEFLATE=m 441CONFIG_PPP_DEFLATE=m
473CONFIG_PPP_BSDCOMP=m 442CONFIG_PPP_BSDCOMP=m
443CONFIG_PPP_MPPE=m
474CONFIG_PPPOE=m 444CONFIG_PPPOE=m
475# CONFIG_SLIP is not set 445# CONFIG_SLIP is not set
476# CONFIG_SHAPER is not set 446# CONFIG_SHAPER is not set
@@ -516,8 +486,8 @@ CONFIG_KEYBOARD_ATKBD_HP_KEYCODES=y
516# CONFIG_KEYBOARD_LKKBD is not set 486# CONFIG_KEYBOARD_LKKBD is not set
517# CONFIG_KEYBOARD_XTKBD is not set 487# CONFIG_KEYBOARD_XTKBD is not set
518# CONFIG_KEYBOARD_NEWTON is not set 488# CONFIG_KEYBOARD_NEWTON is not set
519CONFIG_KEYBOARD_HIL_OLD=y 489# CONFIG_KEYBOARD_HIL_OLD is not set
520# CONFIG_KEYBOARD_HIL is not set 490CONFIG_KEYBOARD_HIL=y
521CONFIG_INPUT_MOUSE=y 491CONFIG_INPUT_MOUSE=y
522CONFIG_MOUSE_PS2=y 492CONFIG_MOUSE_PS2=y
523CONFIG_MOUSE_SERIAL=m 493CONFIG_MOUSE_SERIAL=m
@@ -554,6 +524,7 @@ CONFIG_HW_CONSOLE=y
554CONFIG_SERIAL_8250=y 524CONFIG_SERIAL_8250=y
555CONFIG_SERIAL_8250_CONSOLE=y 525CONFIG_SERIAL_8250_CONSOLE=y
556CONFIG_SERIAL_8250_NR_UARTS=17 526CONFIG_SERIAL_8250_NR_UARTS=17
527CONFIG_SERIAL_8250_RUNTIME_UARTS=4
557CONFIG_SERIAL_8250_EXTENDED=y 528CONFIG_SERIAL_8250_EXTENDED=y
558CONFIG_SERIAL_8250_MANY_PORTS=y 529CONFIG_SERIAL_8250_MANY_PORTS=y
559CONFIG_SERIAL_8250_SHARE_IRQ=y 530CONFIG_SERIAL_8250_SHARE_IRQ=y
@@ -598,6 +569,8 @@ CONFIG_MAX_RAW_DEVS=256
598# 569#
599# TPM devices 570# TPM devices
600# 571#
572# CONFIG_TCG_TPM is not set
573# CONFIG_TELCLOCK is not set
601 574
602# 575#
603# I2C support 576# I2C support
@@ -605,6 +578,12 @@ CONFIG_MAX_RAW_DEVS=256
605# CONFIG_I2C is not set 578# CONFIG_I2C is not set
606 579
607# 580#
581# SPI support
582#
583# CONFIG_SPI is not set
584# CONFIG_SPI_MASTER is not set
585
586#
608# Dallas's 1-wire bus 587# Dallas's 1-wire bus
609# 588#
610# CONFIG_W1 is not set 589# CONFIG_W1 is not set
@@ -640,7 +619,6 @@ CONFIG_FB=y
640CONFIG_FB_CFB_FILLRECT=y 619CONFIG_FB_CFB_FILLRECT=y
641CONFIG_FB_CFB_COPYAREA=y 620CONFIG_FB_CFB_COPYAREA=y
642CONFIG_FB_CFB_IMAGEBLIT=y 621CONFIG_FB_CFB_IMAGEBLIT=y
643CONFIG_FB_SOFT_CURSOR=y
644# CONFIG_FB_MACMODES is not set 622# CONFIG_FB_MACMODES is not set
645CONFIG_FB_MODE_HELPERS=y 623CONFIG_FB_MODE_HELPERS=y
646CONFIG_FB_TILEBLITTING=y 624CONFIG_FB_TILEBLITTING=y
@@ -655,6 +633,7 @@ CONFIG_DUMMY_CONSOLE=y
655CONFIG_DUMMY_CONSOLE_COLUMNS=128 633CONFIG_DUMMY_CONSOLE_COLUMNS=128
656CONFIG_DUMMY_CONSOLE_ROWS=48 634CONFIG_DUMMY_CONSOLE_ROWS=48
657CONFIG_FRAMEBUFFER_CONSOLE=y 635CONFIG_FRAMEBUFFER_CONSOLE=y
636# CONFIG_FRAMEBUFFER_CONSOLE_ROTATION is not set
658CONFIG_STI_CONSOLE=y 637CONFIG_STI_CONSOLE=y
659CONFIG_FONTS=y 638CONFIG_FONTS=y
660CONFIG_FONT_8x8=y 639CONFIG_FONT_8x8=y
@@ -695,6 +674,8 @@ CONFIG_SND_OSSEMUL=y
695CONFIG_SND_MIXER_OSS=y 674CONFIG_SND_MIXER_OSS=y
696CONFIG_SND_PCM_OSS=y 675CONFIG_SND_PCM_OSS=y
697CONFIG_SND_SEQUENCER_OSS=y 676CONFIG_SND_SEQUENCER_OSS=y
677# CONFIG_SND_DYNAMIC_MINORS is not set
678CONFIG_SND_SUPPORT_OLD_API=y
698# CONFIG_SND_VERBOSE_PRINTK is not set 679# CONFIG_SND_VERBOSE_PRINTK is not set
699# CONFIG_SND_DEBUG is not set 680# CONFIG_SND_DEBUG is not set
700 681
@@ -724,6 +705,10 @@ CONFIG_SND_HARMONY=y
724# CONFIG_USB_ARCH_HAS_OHCI is not set 705# CONFIG_USB_ARCH_HAS_OHCI is not set
725 706
726# 707#
708# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support'
709#
710
711#
727# USB Gadget Support 712# USB Gadget Support
728# 713#
729# CONFIG_USB_GADGET is not set 714# CONFIG_USB_GADGET is not set
@@ -736,10 +721,9 @@ CONFIG_SND_HARMONY=y
736# 721#
737# InfiniBand support 722# InfiniBand support
738# 723#
739# CONFIG_INFINIBAND is not set
740 724
741# 725#
742# SN Devices 726# EDAC - error detection and reporting (RAS) (EXPERIMENTAL)
743# 727#
744 728
745# 729#
@@ -765,6 +749,7 @@ CONFIG_XFS_EXPORT=y
765# CONFIG_XFS_SECURITY is not set 749# CONFIG_XFS_SECURITY is not set
766# CONFIG_XFS_POSIX_ACL is not set 750# CONFIG_XFS_POSIX_ACL is not set
767# CONFIG_XFS_RT is not set 751# CONFIG_XFS_RT is not set
752# CONFIG_OCFS2_FS is not set
768# CONFIG_MINIX_FS is not set 753# CONFIG_MINIX_FS is not set
769# CONFIG_ROMFS_FS is not set 754# CONFIG_ROMFS_FS is not set
770CONFIG_INOTIFY=y 755CONFIG_INOTIFY=y
@@ -800,10 +785,10 @@ CONFIG_PROC_FS=y
800CONFIG_PROC_KCORE=y 785CONFIG_PROC_KCORE=y
801CONFIG_SYSFS=y 786CONFIG_SYSFS=y
802CONFIG_TMPFS=y 787CONFIG_TMPFS=y
803# CONFIG_HUGETLBFS is not set
804# CONFIG_HUGETLB_PAGE is not set 788# CONFIG_HUGETLB_PAGE is not set
805CONFIG_RAMFS=y 789CONFIG_RAMFS=y
806# CONFIG_RELAYFS_FS is not set 790# CONFIG_RELAYFS_FS is not set
791# CONFIG_CONFIGFS_FS is not set
807 792
808# 793#
809# Miscellaneous filesystems 794# Miscellaneous filesystems
@@ -821,7 +806,6 @@ CONFIG_RAMFS=y
821# CONFIG_QNX4FS_FS is not set 806# CONFIG_QNX4FS_FS is not set
822# CONFIG_SYSV_FS is not set 807# CONFIG_SYSV_FS is not set
823CONFIG_UFS_FS=m 808CONFIG_UFS_FS=m
824# CONFIG_UFS_FS_WRITE is not set
825 809
826# 810#
827# Network File Systems 811# Network File Systems
@@ -917,18 +901,22 @@ CONFIG_OPROFILE=m
917# Kernel hacking 901# Kernel hacking
918# 902#
919# CONFIG_PRINTK_TIME is not set 903# CONFIG_PRINTK_TIME is not set
920CONFIG_DEBUG_KERNEL=y
921CONFIG_MAGIC_SYSRQ=y 904CONFIG_MAGIC_SYSRQ=y
905CONFIG_DEBUG_KERNEL=y
922CONFIG_LOG_BUF_SHIFT=16 906CONFIG_LOG_BUF_SHIFT=16
923CONFIG_DETECT_SOFTLOCKUP=y 907CONFIG_DETECT_SOFTLOCKUP=y
924# CONFIG_SCHEDSTATS is not set 908# CONFIG_SCHEDSTATS is not set
925# CONFIG_DEBUG_SLAB is not set 909# CONFIG_DEBUG_SLAB is not set
910CONFIG_DEBUG_MUTEXES=y
926# CONFIG_DEBUG_SPINLOCK is not set 911# CONFIG_DEBUG_SPINLOCK is not set
927# CONFIG_DEBUG_SPINLOCK_SLEEP is not set 912# CONFIG_DEBUG_SPINLOCK_SLEEP is not set
928# CONFIG_DEBUG_KOBJECT is not set 913# CONFIG_DEBUG_KOBJECT is not set
929# CONFIG_DEBUG_INFO is not set 914# CONFIG_DEBUG_INFO is not set
930# CONFIG_DEBUG_IOREMAP is not set
931# CONFIG_DEBUG_FS is not set 915# CONFIG_DEBUG_FS is not set
916# CONFIG_DEBUG_VM is not set
917CONFIG_FORCED_INLINING=y
918# CONFIG_RCU_TORTURE_TEST is not set
919CONFIG_DEBUG_RODATA=y
932 920
933# 921#
934# Security options 922# Security options
diff --git a/arch/parisc/configs/a500_defconfig b/arch/parisc/configs/a500_defconfig
index 959ad3c4e372..f3b812f04592 100644
--- a/arch/parisc/configs/a500_defconfig
+++ b/arch/parisc/configs/a500_defconfig
@@ -1031,8 +1031,8 @@ CONFIG_NLS_CODEPAGE_850=m
1031# CONFIG_NLS_ISO8859_8 is not set 1031# CONFIG_NLS_ISO8859_8 is not set
1032# CONFIG_NLS_CODEPAGE_1250 is not set 1032# CONFIG_NLS_CODEPAGE_1250 is not set
1033# CONFIG_NLS_CODEPAGE_1251 is not set 1033# CONFIG_NLS_CODEPAGE_1251 is not set
1034# CONFIG_NLS_ASCII is not set 1034CONFIG_NLS_ASCII=m
1035# CONFIG_NLS_ISO8859_1 is not set 1035CONFIG_NLS_ISO8859_1=m
1036# CONFIG_NLS_ISO8859_2 is not set 1036# CONFIG_NLS_ISO8859_2 is not set
1037# CONFIG_NLS_ISO8859_3 is not set 1037# CONFIG_NLS_ISO8859_3 is not set
1038# CONFIG_NLS_ISO8859_4 is not set 1038# CONFIG_NLS_ISO8859_4 is not set
diff --git a/arch/parisc/configs/b180_defconfig b/arch/parisc/configs/b180_defconfig
index 37e98241ce4b..35093612ad2c 100644
--- a/arch/parisc/configs/b180_defconfig
+++ b/arch/parisc/configs/b180_defconfig
@@ -939,10 +939,10 @@ CONFIG_MSDOS_PARTITION=y
939# 939#
940CONFIG_NLS=y 940CONFIG_NLS=y
941CONFIG_NLS_DEFAULT="iso8859-1" 941CONFIG_NLS_DEFAULT="iso8859-1"
942# CONFIG_NLS_CODEPAGE_437 is not set 942CONFIG_NLS_CODEPAGE_437=m
943# CONFIG_NLS_CODEPAGE_737 is not set 943# CONFIG_NLS_CODEPAGE_737 is not set
944# CONFIG_NLS_CODEPAGE_775 is not set 944# CONFIG_NLS_CODEPAGE_775 is not set
945# CONFIG_NLS_CODEPAGE_850 is not set 945CONFIG_NLS_CODEPAGE_850=m
946# CONFIG_NLS_CODEPAGE_852 is not set 946# CONFIG_NLS_CODEPAGE_852 is not set
947# CONFIG_NLS_CODEPAGE_855 is not set 947# CONFIG_NLS_CODEPAGE_855 is not set
948# CONFIG_NLS_CODEPAGE_857 is not set 948# CONFIG_NLS_CODEPAGE_857 is not set
@@ -962,8 +962,8 @@ CONFIG_NLS_DEFAULT="iso8859-1"
962# CONFIG_NLS_ISO8859_8 is not set 962# CONFIG_NLS_ISO8859_8 is not set
963# CONFIG_NLS_CODEPAGE_1250 is not set 963# CONFIG_NLS_CODEPAGE_1250 is not set
964# CONFIG_NLS_CODEPAGE_1251 is not set 964# CONFIG_NLS_CODEPAGE_1251 is not set
965# CONFIG_NLS_ASCII is not set 965CONFIG_NLS_ASCII=m
966# CONFIG_NLS_ISO8859_1 is not set 966CONFIG_NLS_ISO8859_1=m
967# CONFIG_NLS_ISO8859_2 is not set 967# CONFIG_NLS_ISO8859_2 is not set
968# CONFIG_NLS_ISO8859_3 is not set 968# CONFIG_NLS_ISO8859_3 is not set
969# CONFIG_NLS_ISO8859_4 is not set 969# CONFIG_NLS_ISO8859_4 is not set
@@ -973,10 +973,10 @@ CONFIG_NLS_DEFAULT="iso8859-1"
973# CONFIG_NLS_ISO8859_9 is not set 973# CONFIG_NLS_ISO8859_9 is not set
974# CONFIG_NLS_ISO8859_13 is not set 974# CONFIG_NLS_ISO8859_13 is not set
975# CONFIG_NLS_ISO8859_14 is not set 975# CONFIG_NLS_ISO8859_14 is not set
976# CONFIG_NLS_ISO8859_15 is not set 976CONFIG_NLS_ISO8859_15=m
977# CONFIG_NLS_KOI8_R is not set 977# CONFIG_NLS_KOI8_R is not set
978# CONFIG_NLS_KOI8_U is not set 978# CONFIG_NLS_KOI8_U is not set
979# CONFIG_NLS_UTF8 is not set 979CONFIG_NLS_UTF8=m
980 980
981# 981#
982# Kernel hacking 982# Kernel hacking
diff --git a/arch/parisc/configs/c3000_defconfig b/arch/parisc/configs/c3000_defconfig
index 0b1c8c1fa8a3..782906b644dd 100644
--- a/arch/parisc/configs/c3000_defconfig
+++ b/arch/parisc/configs/c3000_defconfig
@@ -1,7 +1,7 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.14-rc5-pa1 3# Linux kernel version: 2.6.16-pa6
4# Fri Oct 21 23:06:31 2005 4# Sun Mar 26 20:03:29 2006
5# 5#
6CONFIG_PARISC=y 6CONFIG_PARISC=y
7CONFIG_MMU=y 7CONFIG_MMU=y
@@ -10,14 +10,11 @@ CONFIG_RWSEM_GENERIC_SPINLOCK=y
10CONFIG_GENERIC_CALIBRATE_DELAY=y 10CONFIG_GENERIC_CALIBRATE_DELAY=y
11CONFIG_GENERIC_HARDIRQS=y 11CONFIG_GENERIC_HARDIRQS=y
12CONFIG_GENERIC_IRQ_PROBE=y 12CONFIG_GENERIC_IRQ_PROBE=y
13CONFIG_ARCH_MAY_HAVE_PC_FDC=y
14 13
15# 14#
16# Code maturity level options 15# Code maturity level options
17# 16#
18CONFIG_EXPERIMENTAL=y 17CONFIG_EXPERIMENTAL=y
19# CONFIG_CLEAN_COMPILE is not set
20CONFIG_BROKEN=y
21CONFIG_BROKEN_ON_SMP=y 18CONFIG_BROKEN_ON_SMP=y
22CONFIG_INIT_ENV_ARG_LIMIT=32 19CONFIG_INIT_ENV_ARG_LIMIT=32
23 20
@@ -32,28 +29,30 @@ CONFIG_SYSVIPC=y
32# CONFIG_BSD_PROCESS_ACCT is not set 29# CONFIG_BSD_PROCESS_ACCT is not set
33CONFIG_SYSCTL=y 30CONFIG_SYSCTL=y
34# CONFIG_AUDIT is not set 31# CONFIG_AUDIT is not set
35CONFIG_HOTPLUG=y
36CONFIG_KOBJECT_UEVENT=y
37CONFIG_IKCONFIG=y 32CONFIG_IKCONFIG=y
38CONFIG_IKCONFIG_PROC=y 33CONFIG_IKCONFIG_PROC=y
39CONFIG_INITRAMFS_SOURCE="" 34CONFIG_INITRAMFS_SOURCE=""
35# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
40CONFIG_EMBEDDED=y 36CONFIG_EMBEDDED=y
41CONFIG_KALLSYMS=y 37CONFIG_KALLSYMS=y
42CONFIG_KALLSYMS_ALL=y 38CONFIG_KALLSYMS_ALL=y
43# CONFIG_KALLSYMS_EXTRA_PASS is not set 39# CONFIG_KALLSYMS_EXTRA_PASS is not set
40CONFIG_HOTPLUG=y
44CONFIG_PRINTK=y 41CONFIG_PRINTK=y
45CONFIG_BUG=y 42CONFIG_BUG=y
43CONFIG_ELF_CORE=y
46CONFIG_BASE_FULL=y 44CONFIG_BASE_FULL=y
47CONFIG_FUTEX=y 45CONFIG_FUTEX=y
48CONFIG_EPOLL=y 46CONFIG_EPOLL=y
49# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
50CONFIG_SHMEM=y 47CONFIG_SHMEM=y
51CONFIG_CC_ALIGN_FUNCTIONS=0 48CONFIG_CC_ALIGN_FUNCTIONS=0
52CONFIG_CC_ALIGN_LABELS=0 49CONFIG_CC_ALIGN_LABELS=0
53CONFIG_CC_ALIGN_LOOPS=0 50CONFIG_CC_ALIGN_LOOPS=0
54CONFIG_CC_ALIGN_JUMPS=0 51CONFIG_CC_ALIGN_JUMPS=0
52CONFIG_SLAB=y
55# CONFIG_TINY_SHMEM is not set 53# CONFIG_TINY_SHMEM is not set
56CONFIG_BASE_SMALL=0 54CONFIG_BASE_SMALL=0
55# CONFIG_SLOB is not set
57 56
58# 57#
59# Loadable module support 58# Loadable module support
@@ -67,6 +66,23 @@ CONFIG_OBSOLETE_MODPARM=y
67CONFIG_KMOD=y 66CONFIG_KMOD=y
68 67
69# 68#
69# Block layer
70#
71
72#
73# IO Schedulers
74#
75CONFIG_IOSCHED_NOOP=y
76CONFIG_IOSCHED_AS=y
77CONFIG_IOSCHED_DEADLINE=y
78CONFIG_IOSCHED_CFQ=y
79CONFIG_DEFAULT_AS=y
80# CONFIG_DEFAULT_DEADLINE is not set
81# CONFIG_DEFAULT_CFQ is not set
82# CONFIG_DEFAULT_NOOP is not set
83CONFIG_DEFAULT_IOSCHED="anticipatory"
84
85#
70# Processor type and features 86# Processor type and features
71# 87#
72# CONFIG_PA7000 is not set 88# CONFIG_PA7000 is not set
@@ -78,6 +94,10 @@ CONFIG_PA20=y
78CONFIG_PREFETCH=y 94CONFIG_PREFETCH=y
79# CONFIG_64BIT is not set 95# CONFIG_64BIT is not set
80# CONFIG_SMP is not set 96# CONFIG_SMP is not set
97CONFIG_ARCH_FLATMEM_ENABLE=y
98# CONFIG_PREEMPT_NONE is not set
99CONFIG_PREEMPT_VOLUNTARY=y
100# CONFIG_PREEMPT is not set
81# CONFIG_HZ_100 is not set 101# CONFIG_HZ_100 is not set
82CONFIG_HZ_250=y 102CONFIG_HZ_250=y
83# CONFIG_HZ_1000 is not set 103# CONFIG_HZ_1000 is not set
@@ -89,7 +109,7 @@ CONFIG_FLATMEM_MANUAL=y
89CONFIG_FLATMEM=y 109CONFIG_FLATMEM=y
90CONFIG_FLAT_NODE_MEM_MAP=y 110CONFIG_FLAT_NODE_MEM_MAP=y
91# CONFIG_SPARSEMEM_STATIC is not set 111# CONFIG_SPARSEMEM_STATIC is not set
92# CONFIG_PREEMPT is not set 112CONFIG_SPLIT_PTLOCK_CPUS=4
93# CONFIG_HPUX is not set 113# CONFIG_HPUX is not set
94 114
95# 115#
@@ -135,6 +155,7 @@ CONFIG_NET=y
135# 155#
136# Networking options 156# Networking options
137# 157#
158# CONFIG_NETDEBUG is not set
138CONFIG_PACKET=y 159CONFIG_PACKET=y
139CONFIG_PACKET_MMAP=y 160CONFIG_PACKET_MMAP=y
140CONFIG_UNIX=y 161CONFIG_UNIX=y
@@ -175,7 +196,12 @@ CONFIG_INET6_TUNNEL=m
175CONFIG_IPV6_TUNNEL=m 196CONFIG_IPV6_TUNNEL=m
176CONFIG_NETFILTER=y 197CONFIG_NETFILTER=y
177CONFIG_NETFILTER_DEBUG=y 198CONFIG_NETFILTER_DEBUG=y
199
200#
201# Core Netfilter Configuration
202#
178# CONFIG_NETFILTER_NETLINK is not set 203# CONFIG_NETFILTER_NETLINK is not set
204# CONFIG_NETFILTER_XTABLES is not set
179 205
180# 206#
181# IP: Netfilter Configuration 207# IP: Netfilter Configuration
@@ -192,87 +218,11 @@ CONFIG_IP_NF_TFTP=m
192CONFIG_IP_NF_AMANDA=m 218CONFIG_IP_NF_AMANDA=m
193# CONFIG_IP_NF_PPTP is not set 219# CONFIG_IP_NF_PPTP is not set
194CONFIG_IP_NF_QUEUE=m 220CONFIG_IP_NF_QUEUE=m
195CONFIG_IP_NF_IPTABLES=m
196CONFIG_IP_NF_MATCH_LIMIT=m
197CONFIG_IP_NF_MATCH_IPRANGE=m
198CONFIG_IP_NF_MATCH_MAC=m
199CONFIG_IP_NF_MATCH_PKTTYPE=m
200CONFIG_IP_NF_MATCH_MARK=m
201CONFIG_IP_NF_MATCH_MULTIPORT=m
202CONFIG_IP_NF_MATCH_TOS=m
203CONFIG_IP_NF_MATCH_RECENT=m
204CONFIG_IP_NF_MATCH_ECN=m
205CONFIG_IP_NF_MATCH_DSCP=m
206CONFIG_IP_NF_MATCH_AH_ESP=m
207CONFIG_IP_NF_MATCH_LENGTH=m
208CONFIG_IP_NF_MATCH_TTL=m
209CONFIG_IP_NF_MATCH_TCPMSS=m
210CONFIG_IP_NF_MATCH_HELPER=m
211CONFIG_IP_NF_MATCH_STATE=m
212CONFIG_IP_NF_MATCH_CONNTRACK=m
213CONFIG_IP_NF_MATCH_OWNER=m
214# CONFIG_IP_NF_MATCH_ADDRTYPE is not set
215# CONFIG_IP_NF_MATCH_REALM is not set
216# CONFIG_IP_NF_MATCH_SCTP is not set
217# CONFIG_IP_NF_MATCH_DCCP is not set
218# CONFIG_IP_NF_MATCH_COMMENT is not set
219# CONFIG_IP_NF_MATCH_HASHLIMIT is not set
220# CONFIG_IP_NF_MATCH_STRING is not set
221CONFIG_IP_NF_FILTER=m
222CONFIG_IP_NF_TARGET_REJECT=m
223CONFIG_IP_NF_TARGET_LOG=m
224CONFIG_IP_NF_TARGET_ULOG=m
225CONFIG_IP_NF_TARGET_TCPMSS=m
226# CONFIG_IP_NF_TARGET_NFQUEUE is not set
227CONFIG_IP_NF_NAT=m
228CONFIG_IP_NF_NAT_NEEDED=y
229CONFIG_IP_NF_TARGET_MASQUERADE=m
230CONFIG_IP_NF_TARGET_REDIRECT=m
231CONFIG_IP_NF_TARGET_NETMAP=m
232CONFIG_IP_NF_TARGET_SAME=m
233CONFIG_IP_NF_NAT_SNMP_BASIC=m
234CONFIG_IP_NF_NAT_IRC=m
235CONFIG_IP_NF_NAT_FTP=m
236CONFIG_IP_NF_NAT_TFTP=m
237CONFIG_IP_NF_NAT_AMANDA=m
238CONFIG_IP_NF_MANGLE=m
239CONFIG_IP_NF_TARGET_TOS=m
240CONFIG_IP_NF_TARGET_ECN=m
241CONFIG_IP_NF_TARGET_DSCP=m
242CONFIG_IP_NF_TARGET_MARK=m
243CONFIG_IP_NF_TARGET_CLASSIFY=m
244# CONFIG_IP_NF_TARGET_TTL is not set
245# CONFIG_IP_NF_RAW is not set
246CONFIG_IP_NF_ARPTABLES=m
247CONFIG_IP_NF_ARPFILTER=m
248CONFIG_IP_NF_ARP_MANGLE=m
249 221
250# 222#
251# IPv6: Netfilter Configuration (EXPERIMENTAL) 223# IPv6: Netfilter Configuration (EXPERIMENTAL)
252# 224#
253# CONFIG_IP6_NF_QUEUE is not set 225# CONFIG_IP6_NF_QUEUE is not set
254CONFIG_IP6_NF_IPTABLES=m
255# CONFIG_IP6_NF_MATCH_LIMIT is not set
256CONFIG_IP6_NF_MATCH_MAC=m
257CONFIG_IP6_NF_MATCH_RT=m
258# CONFIG_IP6_NF_MATCH_OPTS is not set
259# CONFIG_IP6_NF_MATCH_FRAG is not set
260# CONFIG_IP6_NF_MATCH_HL is not set
261# CONFIG_IP6_NF_MATCH_MULTIPORT is not set
262CONFIG_IP6_NF_MATCH_OWNER=m
263# CONFIG_IP6_NF_MATCH_MARK is not set
264CONFIG_IP6_NF_MATCH_IPV6HEADER=m
265# CONFIG_IP6_NF_MATCH_AHESP is not set
266CONFIG_IP6_NF_MATCH_LENGTH=m
267# CONFIG_IP6_NF_MATCH_EUI64 is not set
268CONFIG_IP6_NF_FILTER=m
269CONFIG_IP6_NF_TARGET_LOG=m
270CONFIG_IP6_NF_TARGET_REJECT=m
271# CONFIG_IP6_NF_TARGET_NFQUEUE is not set
272CONFIG_IP6_NF_MANGLE=m
273# CONFIG_IP6_NF_TARGET_MARK is not set
274# CONFIG_IP6_NF_TARGET_HL is not set
275# CONFIG_IP6_NF_RAW is not set
276 226
277# 227#
278# DCCP Configuration (EXPERIMENTAL) 228# DCCP Configuration (EXPERIMENTAL)
@@ -283,6 +233,11 @@ CONFIG_IP6_NF_MANGLE=m
283# SCTP Configuration (EXPERIMENTAL) 233# SCTP Configuration (EXPERIMENTAL)
284# 234#
285# CONFIG_IP_SCTP is not set 235# CONFIG_IP_SCTP is not set
236
237#
238# TIPC Configuration (EXPERIMENTAL)
239#
240# CONFIG_TIPC is not set
286# CONFIG_ATM is not set 241# CONFIG_ATM is not set
287# CONFIG_BRIDGE is not set 242# CONFIG_BRIDGE is not set
288# CONFIG_VLAN_8021Q is not set 243# CONFIG_VLAN_8021Q is not set
@@ -295,8 +250,11 @@ CONFIG_IP6_NF_MANGLE=m
295# CONFIG_NET_DIVERT is not set 250# CONFIG_NET_DIVERT is not set
296# CONFIG_ECONET is not set 251# CONFIG_ECONET is not set
297# CONFIG_WAN_ROUTER is not set 252# CONFIG_WAN_ROUTER is not set
253
254#
255# QoS and/or fair queueing
256#
298# CONFIG_NET_SCHED is not set 257# CONFIG_NET_SCHED is not set
299# CONFIG_NET_CLS_ROUTE is not set
300 258
301# 259#
302# Network testing 260# Network testing
@@ -341,7 +299,6 @@ CONFIG_FW_LOADER=y
341# 299#
342# Block devices 300# Block devices
343# 301#
344# CONFIG_BLK_DEV_FD is not set
345# CONFIG_BLK_CPQ_DA is not set 302# CONFIG_BLK_CPQ_DA is not set
346# CONFIG_BLK_CPQ_CISS_DA is not set 303# CONFIG_BLK_CPQ_CISS_DA is not set
347# CONFIG_BLK_DEV_DAC960 is not set 304# CONFIG_BLK_DEV_DAC960 is not set
@@ -355,14 +312,6 @@ CONFIG_BLK_DEV_CRYPTOLOOP=m
355# CONFIG_BLK_DEV_RAM is not set 312# CONFIG_BLK_DEV_RAM is not set
356CONFIG_BLK_DEV_RAM_COUNT=16 313CONFIG_BLK_DEV_RAM_COUNT=16
357# CONFIG_CDROM_PKTCDVD is not set 314# CONFIG_CDROM_PKTCDVD is not set
358
359#
360# IO Schedulers
361#
362CONFIG_IOSCHED_NOOP=y
363CONFIG_IOSCHED_AS=y
364CONFIG_IOSCHED_DEADLINE=y
365CONFIG_IOSCHED_CFQ=y
366# CONFIG_ATA_OVER_ETH is not set 315# CONFIG_ATA_OVER_ETH is not set
367 316
368# 317#
@@ -458,6 +407,7 @@ CONFIG_SCSI_ISCSI_ATTRS=m
458# 407#
459# SCSI low-level drivers 408# SCSI low-level drivers
460# 409#
410# CONFIG_ISCSI_TCP is not set
461# CONFIG_BLK_DEV_3W_XXXX_RAID is not set 411# CONFIG_BLK_DEV_3W_XXXX_RAID is not set
462# CONFIG_SCSI_3W_9XXX is not set 412# CONFIG_SCSI_3W_9XXX is not set
463# CONFIG_SCSI_ACARD is not set 413# CONFIG_SCSI_ACARD is not set
@@ -466,7 +416,6 @@ CONFIG_SCSI_ISCSI_ATTRS=m
466# CONFIG_SCSI_AIC7XXX_OLD is not set 416# CONFIG_SCSI_AIC7XXX_OLD is not set
467# CONFIG_SCSI_AIC79XX is not set 417# CONFIG_SCSI_AIC79XX is not set
468# CONFIG_SCSI_DPT_I2O is not set 418# CONFIG_SCSI_DPT_I2O is not set
469# CONFIG_SCSI_ADVANSYS is not set
470# CONFIG_MEGARAID_NEWGEN is not set 419# CONFIG_MEGARAID_NEWGEN is not set
471# CONFIG_MEGARAID_LEGACY is not set 420# CONFIG_MEGARAID_LEGACY is not set
472# CONFIG_MEGARAID_SAS is not set 421# CONFIG_MEGARAID_SAS is not set
@@ -476,18 +425,18 @@ CONFIG_SCSI_SATA=y
476CONFIG_SCSI_ATA_PIIX=m 425CONFIG_SCSI_ATA_PIIX=m
477# CONFIG_SCSI_SATA_MV is not set 426# CONFIG_SCSI_SATA_MV is not set
478# CONFIG_SCSI_SATA_NV is not set 427# CONFIG_SCSI_SATA_NV is not set
479CONFIG_SCSI_SATA_PROMISE=m 428# CONFIG_SCSI_PDC_ADMA is not set
480# CONFIG_SCSI_SATA_QSTOR is not set 429# CONFIG_SCSI_SATA_QSTOR is not set
430CONFIG_SCSI_SATA_PROMISE=m
481# CONFIG_SCSI_SATA_SX4 is not set 431# CONFIG_SCSI_SATA_SX4 is not set
482CONFIG_SCSI_SATA_SIL=m 432CONFIG_SCSI_SATA_SIL=m
433# CONFIG_SCSI_SATA_SIL24 is not set
483# CONFIG_SCSI_SATA_SIS is not set 434# CONFIG_SCSI_SATA_SIS is not set
484# CONFIG_SCSI_SATA_ULI is not set 435# CONFIG_SCSI_SATA_ULI is not set
485CONFIG_SCSI_SATA_VIA=m 436CONFIG_SCSI_SATA_VIA=m
486# CONFIG_SCSI_SATA_VITESSE is not set 437# CONFIG_SCSI_SATA_VITESSE is not set
487CONFIG_SCSI_SATA_INTEL_COMBINED=y 438CONFIG_SCSI_SATA_INTEL_COMBINED=y
488# CONFIG_SCSI_CPQFCTS is not set
489# CONFIG_SCSI_DMX3191D is not set 439# CONFIG_SCSI_DMX3191D is not set
490# CONFIG_SCSI_EATA_PIO is not set
491# CONFIG_SCSI_FUTURE_DOMAIN is not set 440# CONFIG_SCSI_FUTURE_DOMAIN is not set
492# CONFIG_SCSI_IPS is not set 441# CONFIG_SCSI_IPS is not set
493# CONFIG_SCSI_INITIO is not set 442# CONFIG_SCSI_INITIO is not set
@@ -496,18 +445,11 @@ CONFIG_SCSI_SYM53C8XX_2=y
496CONFIG_SCSI_SYM53C8XX_DMA_ADDRESSING_MODE=0 445CONFIG_SCSI_SYM53C8XX_DMA_ADDRESSING_MODE=0
497CONFIG_SCSI_SYM53C8XX_DEFAULT_TAGS=16 446CONFIG_SCSI_SYM53C8XX_DEFAULT_TAGS=16
498CONFIG_SCSI_SYM53C8XX_MAX_TAGS=64 447CONFIG_SCSI_SYM53C8XX_MAX_TAGS=64
499# CONFIG_SCSI_SYM53C8XX_IOMAPPED is not set 448CONFIG_SCSI_SYM53C8XX_MMIO=y
500# CONFIG_SCSI_IPR is not set 449# CONFIG_SCSI_IPR is not set
501# CONFIG_SCSI_QLOGIC_ISP is not set
502# CONFIG_SCSI_QLOGIC_FC is not set 450# CONFIG_SCSI_QLOGIC_FC is not set
503# CONFIG_SCSI_QLOGIC_1280 is not set 451# CONFIG_SCSI_QLOGIC_1280 is not set
504CONFIG_SCSI_QLA2XXX=y 452# CONFIG_SCSI_QLA_FC is not set
505# CONFIG_SCSI_QLA21XX is not set
506# CONFIG_SCSI_QLA22XX is not set
507# CONFIG_SCSI_QLA2300 is not set
508# CONFIG_SCSI_QLA2322 is not set
509# CONFIG_SCSI_QLA6312 is not set
510# CONFIG_SCSI_QLA24XX is not set
511# CONFIG_SCSI_LPFC is not set 453# CONFIG_SCSI_LPFC is not set
512# CONFIG_SCSI_DC395x is not set 454# CONFIG_SCSI_DC395x is not set
513# CONFIG_SCSI_DC390T is not set 455# CONFIG_SCSI_DC390T is not set
@@ -633,6 +575,7 @@ CONFIG_E1000=m
633# CONFIG_R8169 is not set 575# CONFIG_R8169 is not set
634# CONFIG_SIS190 is not set 576# CONFIG_SIS190 is not set
635# CONFIG_SKGE is not set 577# CONFIG_SKGE is not set
578# CONFIG_SKY2 is not set
636# CONFIG_SK98LIN is not set 579# CONFIG_SK98LIN is not set
637# CONFIG_VIA_VELOCITY is not set 580# CONFIG_VIA_VELOCITY is not set
638CONFIG_TIGON3=m 581CONFIG_TIGON3=m
@@ -668,6 +611,7 @@ CONFIG_PPP_ASYNC=m
668CONFIG_PPP_SYNC_TTY=m 611CONFIG_PPP_SYNC_TTY=m
669CONFIG_PPP_DEFLATE=m 612CONFIG_PPP_DEFLATE=m
670CONFIG_PPP_BSDCOMP=m 613CONFIG_PPP_BSDCOMP=m
614# CONFIG_PPP_MPPE is not set
671CONFIG_PPPOE=m 615CONFIG_PPPOE=m
672# CONFIG_SLIP is not set 616# CONFIG_SLIP is not set
673# CONFIG_NET_FC is not set 617# CONFIG_NET_FC is not set
@@ -744,6 +688,7 @@ CONFIG_HW_CONSOLE=y
744CONFIG_SERIAL_8250=y 688CONFIG_SERIAL_8250=y
745CONFIG_SERIAL_8250_CONSOLE=y 689CONFIG_SERIAL_8250_CONSOLE=y
746CONFIG_SERIAL_8250_NR_UARTS=13 690CONFIG_SERIAL_8250_NR_UARTS=13
691CONFIG_SERIAL_8250_RUNTIME_UARTS=4
747CONFIG_SERIAL_8250_EXTENDED=y 692CONFIG_SERIAL_8250_EXTENDED=y
748CONFIG_SERIAL_8250_MANY_PORTS=y 693CONFIG_SERIAL_8250_MANY_PORTS=y
749CONFIG_SERIAL_8250_SHARE_IRQ=y 694CONFIG_SERIAL_8250_SHARE_IRQ=y
@@ -753,7 +698,6 @@ CONFIG_SERIAL_8250_SHARE_IRQ=y
753# 698#
754# Non-8250 serial port support 699# Non-8250 serial port support
755# 700#
756# CONFIG_SERIAL_MUX is not set
757# CONFIG_PDC_CONSOLE is not set 701# CONFIG_PDC_CONSOLE is not set
758CONFIG_SERIAL_CORE=y 702CONFIG_SERIAL_CORE=y
759CONFIG_SERIAL_CORE_CONSOLE=y 703CONFIG_SERIAL_CORE_CONSOLE=y
@@ -788,6 +732,7 @@ CONFIG_MAX_RAW_DEVS=256
788# TPM devices 732# TPM devices
789# 733#
790# CONFIG_TCG_TPM is not set 734# CONFIG_TCG_TPM is not set
735# CONFIG_TELCLOCK is not set
791 736
792# 737#
793# I2C support 738# I2C support
@@ -795,6 +740,12 @@ CONFIG_MAX_RAW_DEVS=256
795# CONFIG_I2C is not set 740# CONFIG_I2C is not set
796 741
797# 742#
743# SPI support
744#
745# CONFIG_SPI is not set
746# CONFIG_SPI_MASTER is not set
747
748#
798# Dallas's 1-wire bus 749# Dallas's 1-wire bus
799# 750#
800# CONFIG_W1 is not set 751# CONFIG_W1 is not set
@@ -830,7 +781,6 @@ CONFIG_FB=y
830CONFIG_FB_CFB_FILLRECT=y 781CONFIG_FB_CFB_FILLRECT=y
831CONFIG_FB_CFB_COPYAREA=y 782CONFIG_FB_CFB_COPYAREA=y
832CONFIG_FB_CFB_IMAGEBLIT=y 783CONFIG_FB_CFB_IMAGEBLIT=y
833CONFIG_FB_SOFT_CURSOR=y
834# CONFIG_FB_MACMODES is not set 784# CONFIG_FB_MACMODES is not set
835# CONFIG_FB_MODE_HELPERS is not set 785# CONFIG_FB_MODE_HELPERS is not set
836# CONFIG_FB_TILEBLITTING is not set 786# CONFIG_FB_TILEBLITTING is not set
@@ -840,6 +790,7 @@ CONFIG_FB_SOFT_CURSOR=y
840# CONFIG_FB_ASILIANT is not set 790# CONFIG_FB_ASILIANT is not set
841# CONFIG_FB_IMSTT is not set 791# CONFIG_FB_IMSTT is not set
842CONFIG_FB_STI=y 792CONFIG_FB_STI=y
793# CONFIG_FB_S1D13XXX is not set
843# CONFIG_FB_NVIDIA is not set 794# CONFIG_FB_NVIDIA is not set
844# CONFIG_FB_RIVA is not set 795# CONFIG_FB_RIVA is not set
845# CONFIG_FB_MATROX is not set 796# CONFIG_FB_MATROX is not set
@@ -853,10 +804,7 @@ CONFIG_FB_STI=y
853# CONFIG_FB_KYRO is not set 804# CONFIG_FB_KYRO is not set
854# CONFIG_FB_3DFX is not set 805# CONFIG_FB_3DFX is not set
855# CONFIG_FB_VOODOO1 is not set 806# CONFIG_FB_VOODOO1 is not set
856# CONFIG_FB_CYBLA is not set
857# CONFIG_FB_TRIDENT is not set 807# CONFIG_FB_TRIDENT is not set
858# CONFIG_FB_PM3 is not set
859# CONFIG_FB_S1D13XXX is not set
860# CONFIG_FB_VIRTUAL is not set 808# CONFIG_FB_VIRTUAL is not set
861 809
862# 810#
@@ -866,6 +814,7 @@ CONFIG_DUMMY_CONSOLE=y
866CONFIG_DUMMY_CONSOLE_COLUMNS=160 814CONFIG_DUMMY_CONSOLE_COLUMNS=160
867CONFIG_DUMMY_CONSOLE_ROWS=64 815CONFIG_DUMMY_CONSOLE_ROWS=64
868CONFIG_FRAMEBUFFER_CONSOLE=y 816CONFIG_FRAMEBUFFER_CONSOLE=y
817# CONFIG_FRAMEBUFFER_CONSOLE_ROTATION is not set
869CONFIG_STI_CONSOLE=y 818CONFIG_STI_CONSOLE=y
870# CONFIG_FONTS is not set 819# CONFIG_FONTS is not set
871CONFIG_FONT_8x8=y 820CONFIG_FONT_8x8=y
@@ -898,23 +847,27 @@ CONFIG_SND_OSSEMUL=y
898CONFIG_SND_MIXER_OSS=y 847CONFIG_SND_MIXER_OSS=y
899CONFIG_SND_PCM_OSS=y 848CONFIG_SND_PCM_OSS=y
900CONFIG_SND_SEQUENCER_OSS=y 849CONFIG_SND_SEQUENCER_OSS=y
850# CONFIG_SND_DYNAMIC_MINORS is not set
851CONFIG_SND_SUPPORT_OLD_API=y
901# CONFIG_SND_VERBOSE_PRINTK is not set 852# CONFIG_SND_VERBOSE_PRINTK is not set
902# CONFIG_SND_DEBUG is not set 853# CONFIG_SND_DEBUG is not set
903 854
904# 855#
905# Generic devices 856# Generic devices
906# 857#
858CONFIG_SND_AC97_CODEC=y
859CONFIG_SND_AC97_BUS=y
907# CONFIG_SND_DUMMY is not set 860# CONFIG_SND_DUMMY is not set
908# CONFIG_SND_VIRMIDI is not set 861# CONFIG_SND_VIRMIDI is not set
909# CONFIG_SND_MTPAV is not set 862# CONFIG_SND_MTPAV is not set
910# CONFIG_SND_SERIAL_U16550 is not set 863# CONFIG_SND_SERIAL_U16550 is not set
911# CONFIG_SND_MPU401 is not set 864# CONFIG_SND_MPU401 is not set
912CONFIG_SND_AC97_CODEC=y
913CONFIG_SND_AC97_BUS=y
914 865
915# 866#
916# PCI devices 867# PCI devices
917# 868#
869CONFIG_SND_AD1889=y
870# CONFIG_SND_AD1889_OPL3 is not set
918# CONFIG_SND_ALI5451 is not set 871# CONFIG_SND_ALI5451 is not set
919# CONFIG_SND_ATIIXP is not set 872# CONFIG_SND_ATIIXP is not set
920# CONFIG_SND_ATIIXP_MODEM is not set 873# CONFIG_SND_ATIIXP_MODEM is not set
@@ -923,39 +876,38 @@ CONFIG_SND_AC97_BUS=y
923# CONFIG_SND_AU8830 is not set 876# CONFIG_SND_AU8830 is not set
924# CONFIG_SND_AZT3328 is not set 877# CONFIG_SND_AZT3328 is not set
925# CONFIG_SND_BT87X is not set 878# CONFIG_SND_BT87X is not set
926# CONFIG_SND_CS46XX is not set 879# CONFIG_SND_CA0106 is not set
880# CONFIG_SND_CMIPCI is not set
927# CONFIG_SND_CS4281 is not set 881# CONFIG_SND_CS4281 is not set
882# CONFIG_SND_CS46XX is not set
928# CONFIG_SND_EMU10K1 is not set 883# CONFIG_SND_EMU10K1 is not set
929# CONFIG_SND_EMU10K1X is not set 884# CONFIG_SND_EMU10K1X is not set
930# CONFIG_SND_CA0106 is not set
931# CONFIG_SND_KORG1212 is not set
932# CONFIG_SND_MIXART is not set
933# CONFIG_SND_NM256 is not set
934# CONFIG_SND_RME32 is not set
935# CONFIG_SND_RME96 is not set
936# CONFIG_SND_RME9652 is not set
937# CONFIG_SND_HDSP is not set
938# CONFIG_SND_HDSPM is not set
939# CONFIG_SND_TRIDENT is not set
940# CONFIG_SND_YMFPCI is not set
941CONFIG_SND_AD1889=y
942# CONFIG_SND_AD1889_OPL3 is not set
943# CONFIG_SND_CMIPCI is not set
944# CONFIG_SND_ENS1370 is not set 885# CONFIG_SND_ENS1370 is not set
945# CONFIG_SND_ENS1371 is not set 886# CONFIG_SND_ENS1371 is not set
946# CONFIG_SND_ES1938 is not set 887# CONFIG_SND_ES1938 is not set
947# CONFIG_SND_ES1968 is not set 888# CONFIG_SND_ES1968 is not set
948# CONFIG_SND_MAESTRO3 is not set
949# CONFIG_SND_FM801 is not set 889# CONFIG_SND_FM801 is not set
890# CONFIG_SND_HDA_INTEL is not set
891# CONFIG_SND_HDSP is not set
892# CONFIG_SND_HDSPM is not set
950# CONFIG_SND_ICE1712 is not set 893# CONFIG_SND_ICE1712 is not set
951# CONFIG_SND_ICE1724 is not set 894# CONFIG_SND_ICE1724 is not set
952# CONFIG_SND_INTEL8X0 is not set 895# CONFIG_SND_INTEL8X0 is not set
953# CONFIG_SND_INTEL8X0M is not set 896# CONFIG_SND_INTEL8X0M is not set
897# CONFIG_SND_KORG1212 is not set
898# CONFIG_SND_MAESTRO3 is not set
899# CONFIG_SND_MIXART is not set
900# CONFIG_SND_NM256 is not set
901# CONFIG_SND_PCXHR is not set
902# CONFIG_SND_RME32 is not set
903# CONFIG_SND_RME96 is not set
904# CONFIG_SND_RME9652 is not set
954# CONFIG_SND_SONICVIBES is not set 905# CONFIG_SND_SONICVIBES is not set
906# CONFIG_SND_TRIDENT is not set
955# CONFIG_SND_VIA82XX is not set 907# CONFIG_SND_VIA82XX is not set
956# CONFIG_SND_VIA82XX_MODEM is not set 908# CONFIG_SND_VIA82XX_MODEM is not set
957# CONFIG_SND_VX222 is not set 909# CONFIG_SND_VX222 is not set
958# CONFIG_SND_HDA_INTEL is not set 910# CONFIG_SND_YMFPCI is not set
959 911
960# 912#
961# USB devices 913# USB devices
@@ -998,12 +950,15 @@ CONFIG_USB_OHCI_LITTLE_ENDIAN=y
998# USB Device Class drivers 950# USB Device Class drivers
999# 951#
1000# CONFIG_OBSOLETE_OSS_USB_DRIVER is not set 952# CONFIG_OBSOLETE_OSS_USB_DRIVER is not set
1001# CONFIG_USB_BLUETOOTH_TTY is not set
1002# CONFIG_USB_ACM is not set 953# CONFIG_USB_ACM is not set
1003CONFIG_USB_PRINTER=m 954CONFIG_USB_PRINTER=m
1004 955
1005# 956#
1006# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support' may also be needed; see USB_STORAGE Help for more information 957# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support'
958#
959
960#
961# may also be needed; see USB_STORAGE Help for more information
1007# 962#
1008CONFIG_USB_STORAGE=m 963CONFIG_USB_STORAGE=m
1009# CONFIG_USB_STORAGE_DEBUG is not set 964# CONFIG_USB_STORAGE_DEBUG is not set
@@ -1015,12 +970,15 @@ CONFIG_USB_STORAGE_USBAT=y
1015CONFIG_USB_STORAGE_SDDR09=y 970CONFIG_USB_STORAGE_SDDR09=y
1016CONFIG_USB_STORAGE_SDDR55=y 971CONFIG_USB_STORAGE_SDDR55=y
1017CONFIG_USB_STORAGE_JUMPSHOT=y 972CONFIG_USB_STORAGE_JUMPSHOT=y
973# CONFIG_USB_STORAGE_ALAUDA is not set
974# CONFIG_USB_LIBUSUAL is not set
1018 975
1019# 976#
1020# USB Input Devices 977# USB Input Devices
1021# 978#
1022CONFIG_USB_HID=y 979CONFIG_USB_HID=y
1023CONFIG_USB_HIDINPUT=y 980CONFIG_USB_HIDINPUT=y
981# CONFIG_USB_HIDINPUT_POWERBOOK is not set
1024# CONFIG_HID_FF is not set 982# CONFIG_HID_FF is not set
1025CONFIG_USB_HIDDEV=y 983CONFIG_USB_HIDDEV=y
1026# CONFIG_USB_AIPTEK is not set 984# CONFIG_USB_AIPTEK is not set
@@ -1034,6 +992,7 @@ CONFIG_USB_HIDDEV=y
1034# CONFIG_USB_YEALINK is not set 992# CONFIG_USB_YEALINK is not set
1035# CONFIG_USB_XPAD is not set 993# CONFIG_USB_XPAD is not set
1036# CONFIG_USB_ATI_REMOTE is not set 994# CONFIG_USB_ATI_REMOTE is not set
995# CONFIG_USB_ATI_REMOTE2 is not set
1037# CONFIG_USB_KEYSPAN_REMOTE is not set 996# CONFIG_USB_KEYSPAN_REMOTE is not set
1038# CONFIG_USB_APPLETOUCH is not set 997# CONFIG_USB_APPLETOUCH is not set
1039 998
@@ -1108,7 +1067,7 @@ CONFIG_USB_LEGOTOWER=m
1108# CONFIG_INFINIBAND is not set 1067# CONFIG_INFINIBAND is not set
1109 1068
1110# 1069#
1111# SN Devices 1070# EDAC - error detection and reporting (RAS) (EXPERIMENTAL)
1112# 1071#
1113 1072
1114# 1073#
@@ -1130,6 +1089,7 @@ CONFIG_XFS_EXPORT=y
1130# CONFIG_XFS_SECURITY is not set 1089# CONFIG_XFS_SECURITY is not set
1131# CONFIG_XFS_POSIX_ACL is not set 1090# CONFIG_XFS_POSIX_ACL is not set
1132# CONFIG_XFS_RT is not set 1091# CONFIG_XFS_RT is not set
1092# CONFIG_OCFS2_FS is not set
1133# CONFIG_MINIX_FS is not set 1093# CONFIG_MINIX_FS is not set
1134# CONFIG_ROMFS_FS is not set 1094# CONFIG_ROMFS_FS is not set
1135CONFIG_INOTIFY=y 1095CONFIG_INOTIFY=y
@@ -1164,10 +1124,10 @@ CONFIG_PROC_FS=y
1164CONFIG_PROC_KCORE=y 1124CONFIG_PROC_KCORE=y
1165CONFIG_SYSFS=y 1125CONFIG_SYSFS=y
1166CONFIG_TMPFS=y 1126CONFIG_TMPFS=y
1167# CONFIG_HUGETLBFS is not set
1168# CONFIG_HUGETLB_PAGE is not set 1127# CONFIG_HUGETLB_PAGE is not set
1169CONFIG_RAMFS=y 1128CONFIG_RAMFS=y
1170# CONFIG_RELAYFS_FS is not set 1129# CONFIG_RELAYFS_FS is not set
1130# CONFIG_CONFIGFS_FS is not set
1171 1131
1172# 1132#
1173# Miscellaneous filesystems 1133# Miscellaneous filesystems
@@ -1225,10 +1185,10 @@ CONFIG_MSDOS_PARTITION=y
1225# 1185#
1226CONFIG_NLS=y 1186CONFIG_NLS=y
1227CONFIG_NLS_DEFAULT="iso8859-1" 1187CONFIG_NLS_DEFAULT="iso8859-1"
1228# CONFIG_NLS_CODEPAGE_437 is not set 1188CONFIG_NLS_CODEPAGE_437=m
1229# CONFIG_NLS_CODEPAGE_737 is not set 1189# CONFIG_NLS_CODEPAGE_737 is not set
1230# CONFIG_NLS_CODEPAGE_775 is not set 1190# CONFIG_NLS_CODEPAGE_775 is not set
1231# CONFIG_NLS_CODEPAGE_850 is not set 1191CONFIG_NLS_CODEPAGE_850=m
1232# CONFIG_NLS_CODEPAGE_852 is not set 1192# CONFIG_NLS_CODEPAGE_852 is not set
1233# CONFIG_NLS_CODEPAGE_855 is not set 1193# CONFIG_NLS_CODEPAGE_855 is not set
1234# CONFIG_NLS_CODEPAGE_857 is not set 1194# CONFIG_NLS_CODEPAGE_857 is not set
@@ -1248,8 +1208,8 @@ CONFIG_NLS_DEFAULT="iso8859-1"
1248# CONFIG_NLS_ISO8859_8 is not set 1208# CONFIG_NLS_ISO8859_8 is not set
1249# CONFIG_NLS_CODEPAGE_1250 is not set 1209# CONFIG_NLS_CODEPAGE_1250 is not set
1250# CONFIG_NLS_CODEPAGE_1251 is not set 1210# CONFIG_NLS_CODEPAGE_1251 is not set
1251# CONFIG_NLS_ASCII is not set 1211CONFIG_NLS_ASCII=m
1252# CONFIG_NLS_ISO8859_1 is not set 1212CONFIG_NLS_ISO8859_1=m
1253# CONFIG_NLS_ISO8859_2 is not set 1213# CONFIG_NLS_ISO8859_2 is not set
1254# CONFIG_NLS_ISO8859_3 is not set 1214# CONFIG_NLS_ISO8859_3 is not set
1255# CONFIG_NLS_ISO8859_4 is not set 1215# CONFIG_NLS_ISO8859_4 is not set
@@ -1259,10 +1219,10 @@ CONFIG_NLS_DEFAULT="iso8859-1"
1259# CONFIG_NLS_ISO8859_9 is not set 1219# CONFIG_NLS_ISO8859_9 is not set
1260# CONFIG_NLS_ISO8859_13 is not set 1220# CONFIG_NLS_ISO8859_13 is not set
1261# CONFIG_NLS_ISO8859_14 is not set 1221# CONFIG_NLS_ISO8859_14 is not set
1262# CONFIG_NLS_ISO8859_15 is not set 1222CONFIG_NLS_ISO8859_15=m
1263# CONFIG_NLS_KOI8_R is not set 1223# CONFIG_NLS_KOI8_R is not set
1264# CONFIG_NLS_KOI8_U is not set 1224# CONFIG_NLS_KOI8_U is not set
1265# CONFIG_NLS_UTF8 is not set 1225CONFIG_NLS_UTF8=m
1266 1226
1267# 1227#
1268# Profiling support 1228# Profiling support
@@ -1274,18 +1234,22 @@ CONFIG_OPROFILE=m
1274# Kernel hacking 1234# Kernel hacking
1275# 1235#
1276# CONFIG_PRINTK_TIME is not set 1236# CONFIG_PRINTK_TIME is not set
1277CONFIG_DEBUG_KERNEL=y
1278CONFIG_MAGIC_SYSRQ=y 1237CONFIG_MAGIC_SYSRQ=y
1238CONFIG_DEBUG_KERNEL=y
1279CONFIG_LOG_BUF_SHIFT=16 1239CONFIG_LOG_BUF_SHIFT=16
1280CONFIG_DETECT_SOFTLOCKUP=y 1240CONFIG_DETECT_SOFTLOCKUP=y
1281# CONFIG_SCHEDSTATS is not set 1241# CONFIG_SCHEDSTATS is not set
1282# CONFIG_DEBUG_SLAB is not set 1242# CONFIG_DEBUG_SLAB is not set
1243CONFIG_DEBUG_MUTEXES=y
1283# CONFIG_DEBUG_SPINLOCK is not set 1244# CONFIG_DEBUG_SPINLOCK is not set
1284# CONFIG_DEBUG_SPINLOCK_SLEEP is not set 1245# CONFIG_DEBUG_SPINLOCK_SLEEP is not set
1285# CONFIG_DEBUG_KOBJECT is not set 1246# CONFIG_DEBUG_KOBJECT is not set
1286# CONFIG_DEBUG_INFO is not set 1247# CONFIG_DEBUG_INFO is not set
1287# CONFIG_DEBUG_IOREMAP is not set
1288# CONFIG_DEBUG_FS is not set 1248# CONFIG_DEBUG_FS is not set
1249# CONFIG_DEBUG_VM is not set
1250CONFIG_FORCED_INLINING=y
1251# CONFIG_RCU_TORTURE_TEST is not set
1252CONFIG_DEBUG_RODATA=y
1289 1253
1290# 1254#
1291# Security options 1255# Security options
diff --git a/arch/parisc/defconfig b/arch/parisc/defconfig
index f38a4620d24f..59f7bc38e72e 100644
--- a/arch/parisc/defconfig
+++ b/arch/parisc/defconfig
@@ -1,7 +1,7 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.14-rc5-pa1 3# Linux kernel version: 2.6.16-pa6
4# Fri Oct 21 23:01:33 2005 4# Sun Mar 26 19:50:07 2006
5# 5#
6CONFIG_PARISC=y 6CONFIG_PARISC=y
7CONFIG_MMU=y 7CONFIG_MMU=y
@@ -15,7 +15,6 @@ CONFIG_GENERIC_IRQ_PROBE=y
15# Code maturity level options 15# Code maturity level options
16# 16#
17CONFIG_EXPERIMENTAL=y 17CONFIG_EXPERIMENTAL=y
18CONFIG_CLEAN_COMPILE=y
19CONFIG_BROKEN_ON_SMP=y 18CONFIG_BROKEN_ON_SMP=y
20CONFIG_INIT_ENV_ARG_LIMIT=32 19CONFIG_INIT_ENV_ARG_LIMIT=32
21 20
@@ -30,17 +29,18 @@ CONFIG_SYSVIPC=y
30# CONFIG_BSD_PROCESS_ACCT is not set 29# CONFIG_BSD_PROCESS_ACCT is not set
31CONFIG_SYSCTL=y 30CONFIG_SYSCTL=y
32# CONFIG_AUDIT is not set 31# CONFIG_AUDIT is not set
33# CONFIG_HOTPLUG is not set
34CONFIG_KOBJECT_UEVENT=y
35CONFIG_IKCONFIG=y 32CONFIG_IKCONFIG=y
36CONFIG_IKCONFIG_PROC=y 33CONFIG_IKCONFIG_PROC=y
37CONFIG_INITRAMFS_SOURCE="" 34CONFIG_INITRAMFS_SOURCE=""
35CONFIG_CC_OPTIMIZE_FOR_SIZE=y
38# CONFIG_EMBEDDED is not set 36# CONFIG_EMBEDDED is not set
39CONFIG_KALLSYMS=y 37CONFIG_KALLSYMS=y
40# CONFIG_KALLSYMS_ALL is not set 38# CONFIG_KALLSYMS_ALL is not set
41# CONFIG_KALLSYMS_EXTRA_PASS is not set 39# CONFIG_KALLSYMS_EXTRA_PASS is not set
40CONFIG_HOTPLUG=y
42CONFIG_PRINTK=y 41CONFIG_PRINTK=y
43CONFIG_BUG=y 42CONFIG_BUG=y
43CONFIG_ELF_CORE=y
44CONFIG_BASE_FULL=y 44CONFIG_BASE_FULL=y
45CONFIG_FUTEX=y 45CONFIG_FUTEX=y
46CONFIG_EPOLL=y 46CONFIG_EPOLL=y
@@ -49,8 +49,10 @@ CONFIG_CC_ALIGN_FUNCTIONS=0
49CONFIG_CC_ALIGN_LABELS=0 49CONFIG_CC_ALIGN_LABELS=0
50CONFIG_CC_ALIGN_LOOPS=0 50CONFIG_CC_ALIGN_LOOPS=0
51CONFIG_CC_ALIGN_JUMPS=0 51CONFIG_CC_ALIGN_JUMPS=0
52CONFIG_SLAB=y
52# CONFIG_TINY_SHMEM is not set 53# CONFIG_TINY_SHMEM is not set
53CONFIG_BASE_SMALL=0 54CONFIG_BASE_SMALL=0
55# CONFIG_SLOB is not set
54 56
55# 57#
56# Loadable module support 58# Loadable module support
@@ -58,6 +60,23 @@ CONFIG_BASE_SMALL=0
58# CONFIG_MODULES is not set 60# CONFIG_MODULES is not set
59 61
60# 62#
63# Block layer
64#
65
66#
67# IO Schedulers
68#
69CONFIG_IOSCHED_NOOP=y
70CONFIG_IOSCHED_AS=y
71CONFIG_IOSCHED_DEADLINE=y
72CONFIG_IOSCHED_CFQ=y
73CONFIG_DEFAULT_AS=y
74# CONFIG_DEFAULT_DEADLINE is not set
75# CONFIG_DEFAULT_CFQ is not set
76# CONFIG_DEFAULT_NOOP is not set
77CONFIG_DEFAULT_IOSCHED="anticipatory"
78
79#
61# Processor type and features 80# Processor type and features
62# 81#
63CONFIG_PA7000=y 82CONFIG_PA7000=y
@@ -67,6 +86,10 @@ CONFIG_PA7000=y
67# CONFIG_PA8X00 is not set 86# CONFIG_PA8X00 is not set
68CONFIG_PA11=y 87CONFIG_PA11=y
69# CONFIG_SMP is not set 88# CONFIG_SMP is not set
89CONFIG_ARCH_FLATMEM_ENABLE=y
90CONFIG_PREEMPT_NONE=y
91# CONFIG_PREEMPT_VOLUNTARY is not set
92# CONFIG_PREEMPT is not set
70# CONFIG_HZ_100 is not set 93# CONFIG_HZ_100 is not set
71CONFIG_HZ_250=y 94CONFIG_HZ_250=y
72# CONFIG_HZ_1000 is not set 95# CONFIG_HZ_1000 is not set
@@ -78,7 +101,7 @@ CONFIG_FLATMEM_MANUAL=y
78CONFIG_FLATMEM=y 101CONFIG_FLATMEM=y
79CONFIG_FLAT_NODE_MEM_MAP=y 102CONFIG_FLAT_NODE_MEM_MAP=y
80# CONFIG_SPARSEMEM_STATIC is not set 103# CONFIG_SPARSEMEM_STATIC is not set
81# CONFIG_PREEMPT is not set 104CONFIG_SPLIT_PTLOCK_CPUS=4096
82# CONFIG_HPUX is not set 105# CONFIG_HPUX is not set
83 106
84# 107#
@@ -132,6 +155,7 @@ CONFIG_NET=y
132# 155#
133# Networking options 156# Networking options
134# 157#
158# CONFIG_NETDEBUG is not set
135CONFIG_PACKET=y 159CONFIG_PACKET=y
136CONFIG_PACKET_MMAP=y 160CONFIG_PACKET_MMAP=y
137CONFIG_UNIX=y 161CONFIG_UNIX=y
@@ -174,6 +198,11 @@ CONFIG_IPV6=y
174# SCTP Configuration (EXPERIMENTAL) 198# SCTP Configuration (EXPERIMENTAL)
175# 199#
176# CONFIG_IP_SCTP is not set 200# CONFIG_IP_SCTP is not set
201
202#
203# TIPC Configuration (EXPERIMENTAL)
204#
205# CONFIG_TIPC is not set
177# CONFIG_ATM is not set 206# CONFIG_ATM is not set
178# CONFIG_BRIDGE is not set 207# CONFIG_BRIDGE is not set
179# CONFIG_VLAN_8021Q is not set 208# CONFIG_VLAN_8021Q is not set
@@ -186,8 +215,11 @@ CONFIG_IPV6=y
186# CONFIG_NET_DIVERT is not set 215# CONFIG_NET_DIVERT is not set
187# CONFIG_ECONET is not set 216# CONFIG_ECONET is not set
188# CONFIG_WAN_ROUTER is not set 217# CONFIG_WAN_ROUTER is not set
218
219#
220# QoS and/or fair queueing
221#
189# CONFIG_NET_SCHED is not set 222# CONFIG_NET_SCHED is not set
190# CONFIG_NET_CLS_ROUTE is not set
191 223
192# 224#
193# Network testing 225# Network testing
@@ -228,6 +260,7 @@ CONFIG_PARPORT_PC=y
228# CONFIG_PARPORT_SERIAL is not set 260# CONFIG_PARPORT_SERIAL is not set
229# CONFIG_PARPORT_PC_FIFO is not set 261# CONFIG_PARPORT_PC_FIFO is not set
230# CONFIG_PARPORT_PC_SUPERIO is not set 262# CONFIG_PARPORT_PC_SUPERIO is not set
263CONFIG_PARPORT_NOT_PC=y
231CONFIG_PARPORT_GSC=y 264CONFIG_PARPORT_GSC=y
232# CONFIG_PARPORT_1284 is not set 265# CONFIG_PARPORT_1284 is not set
233 266
@@ -254,14 +287,6 @@ CONFIG_BLK_DEV_RAM_COUNT=16
254CONFIG_BLK_DEV_RAM_SIZE=4096 287CONFIG_BLK_DEV_RAM_SIZE=4096
255CONFIG_BLK_DEV_INITRD=y 288CONFIG_BLK_DEV_INITRD=y
256# CONFIG_CDROM_PKTCDVD is not set 289# CONFIG_CDROM_PKTCDVD is not set
257
258#
259# IO Schedulers
260#
261CONFIG_IOSCHED_NOOP=y
262CONFIG_IOSCHED_AS=y
263CONFIG_IOSCHED_DEADLINE=y
264CONFIG_IOSCHED_CFQ=y
265# CONFIG_ATA_OVER_ETH is not set 290# CONFIG_ATA_OVER_ETH is not set
266 291
267# 292#
@@ -305,6 +330,7 @@ CONFIG_SCSI_SPI_ATTRS=y
305# 330#
306# SCSI low-level drivers 331# SCSI low-level drivers
307# 332#
333# CONFIG_ISCSI_TCP is not set
308# CONFIG_BLK_DEV_3W_XXXX_RAID is not set 334# CONFIG_BLK_DEV_3W_XXXX_RAID is not set
309# CONFIG_SCSI_3W_9XXX is not set 335# CONFIG_SCSI_3W_9XXX is not set
310# CONFIG_SCSI_ACARD is not set 336# CONFIG_SCSI_ACARD is not set
@@ -331,7 +357,7 @@ CONFIG_SCSI_SYM53C8XX_2=y
331CONFIG_SCSI_SYM53C8XX_DMA_ADDRESSING_MODE=1 357CONFIG_SCSI_SYM53C8XX_DMA_ADDRESSING_MODE=1
332CONFIG_SCSI_SYM53C8XX_DEFAULT_TAGS=16 358CONFIG_SCSI_SYM53C8XX_DEFAULT_TAGS=16
333CONFIG_SCSI_SYM53C8XX_MAX_TAGS=64 359CONFIG_SCSI_SYM53C8XX_MAX_TAGS=64
334# CONFIG_SCSI_SYM53C8XX_IOMAPPED is not set 360CONFIG_SCSI_SYM53C8XX_MMIO=y
335# CONFIG_SCSI_IPR is not set 361# CONFIG_SCSI_IPR is not set
336CONFIG_SCSI_ZALON=y 362CONFIG_SCSI_ZALON=y
337CONFIG_SCSI_NCR53C8XX_DEFAULT_TAGS=8 363CONFIG_SCSI_NCR53C8XX_DEFAULT_TAGS=8
@@ -340,13 +366,7 @@ CONFIG_SCSI_NCR53C8XX_SYNC=20
340# CONFIG_SCSI_NCR53C8XX_PROFILE is not set 366# CONFIG_SCSI_NCR53C8XX_PROFILE is not set
341# CONFIG_SCSI_QLOGIC_FC is not set 367# CONFIG_SCSI_QLOGIC_FC is not set
342# CONFIG_SCSI_QLOGIC_1280 is not set 368# CONFIG_SCSI_QLOGIC_1280 is not set
343CONFIG_SCSI_QLA2XXX=y 369# CONFIG_SCSI_QLA_FC is not set
344# CONFIG_SCSI_QLA21XX is not set
345# CONFIG_SCSI_QLA22XX is not set
346# CONFIG_SCSI_QLA2300 is not set
347# CONFIG_SCSI_QLA2322 is not set
348# CONFIG_SCSI_QLA6312 is not set
349# CONFIG_SCSI_QLA24XX is not set
350# CONFIG_SCSI_LPFC is not set 370# CONFIG_SCSI_LPFC is not set
351# CONFIG_SCSI_SIM710 is not set 371# CONFIG_SCSI_SIM710 is not set
352# CONFIG_SCSI_DC395x is not set 372# CONFIG_SCSI_DC395x is not set
@@ -471,6 +491,7 @@ CONFIG_ACENIC=y
471# CONFIG_R8169 is not set 491# CONFIG_R8169 is not set
472# CONFIG_SIS190 is not set 492# CONFIG_SIS190 is not set
473# CONFIG_SKGE is not set 493# CONFIG_SKGE is not set
494# CONFIG_SKY2 is not set
474# CONFIG_SK98LIN is not set 495# CONFIG_SK98LIN is not set
475# CONFIG_VIA_VELOCITY is not set 496# CONFIG_VIA_VELOCITY is not set
476CONFIG_TIGON3=y 497CONFIG_TIGON3=y
@@ -562,13 +583,13 @@ CONFIG_INPUT_KEYBOARD=y
562# CONFIG_KEYBOARD_LKKBD is not set 583# CONFIG_KEYBOARD_LKKBD is not set
563# CONFIG_KEYBOARD_XTKBD is not set 584# CONFIG_KEYBOARD_XTKBD is not set
564# CONFIG_KEYBOARD_NEWTON is not set 585# CONFIG_KEYBOARD_NEWTON is not set
565CONFIG_KEYBOARD_HIL_OLD=y 586# CONFIG_KEYBOARD_HIL_OLD is not set
566CONFIG_KEYBOARD_HIL=y 587CONFIG_KEYBOARD_HIL=y
567CONFIG_INPUT_MOUSE=y 588CONFIG_INPUT_MOUSE=y
568# CONFIG_MOUSE_PS2 is not set 589# CONFIG_MOUSE_PS2 is not set
569# CONFIG_MOUSE_SERIAL is not set 590# CONFIG_MOUSE_SERIAL is not set
570# CONFIG_MOUSE_VSXXXAA is not set 591# CONFIG_MOUSE_VSXXXAA is not set
571# CONFIG_MOUSE_HIL is not set 592CONFIG_MOUSE_HIL=y
572CONFIG_INPUT_JOYSTICK=y 593CONFIG_INPUT_JOYSTICK=y
573# CONFIG_JOYSTICK_ANALOG is not set 594# CONFIG_JOYSTICK_ANALOG is not set
574# CONFIG_JOYSTICK_A3D is not set 595# CONFIG_JOYSTICK_A3D is not set
@@ -628,6 +649,7 @@ CONFIG_HW_CONSOLE=y
628CONFIG_SERIAL_8250=y 649CONFIG_SERIAL_8250=y
629CONFIG_SERIAL_8250_CONSOLE=y 650CONFIG_SERIAL_8250_CONSOLE=y
630CONFIG_SERIAL_8250_NR_UARTS=13 651CONFIG_SERIAL_8250_NR_UARTS=13
652CONFIG_SERIAL_8250_RUNTIME_UARTS=4
631CONFIG_SERIAL_8250_EXTENDED=y 653CONFIG_SERIAL_8250_EXTENDED=y
632CONFIG_SERIAL_8250_MANY_PORTS=y 654CONFIG_SERIAL_8250_MANY_PORTS=y
633CONFIG_SERIAL_8250_SHARE_IRQ=y 655CONFIG_SERIAL_8250_SHARE_IRQ=y
@@ -675,6 +697,7 @@ CONFIG_GEN_RTC=y
675# TPM devices 697# TPM devices
676# 698#
677# CONFIG_TCG_TPM is not set 699# CONFIG_TCG_TPM is not set
700# CONFIG_TELCLOCK is not set
678 701
679# 702#
680# I2C support 703# I2C support
@@ -682,6 +705,12 @@ CONFIG_GEN_RTC=y
682# CONFIG_I2C is not set 705# CONFIG_I2C is not set
683 706
684# 707#
708# SPI support
709#
710# CONFIG_SPI is not set
711# CONFIG_SPI_MASTER is not set
712
713#
685# Dallas's 1-wire bus 714# Dallas's 1-wire bus
686# 715#
687# CONFIG_W1 is not set 716# CONFIG_W1 is not set
@@ -691,6 +720,7 @@ CONFIG_GEN_RTC=y
691# 720#
692CONFIG_HWMON=y 721CONFIG_HWMON=y
693# CONFIG_HWMON_VID is not set 722# CONFIG_HWMON_VID is not set
723# CONFIG_SENSORS_F71805F is not set
694# CONFIG_HWMON_DEBUG_CHIP is not set 724# CONFIG_HWMON_DEBUG_CHIP is not set
695 725
696# 726#
@@ -718,7 +748,6 @@ CONFIG_FB=y
718CONFIG_FB_CFB_FILLRECT=y 748CONFIG_FB_CFB_FILLRECT=y
719CONFIG_FB_CFB_COPYAREA=y 749CONFIG_FB_CFB_COPYAREA=y
720CONFIG_FB_CFB_IMAGEBLIT=y 750CONFIG_FB_CFB_IMAGEBLIT=y
721CONFIG_FB_SOFT_CURSOR=y
722# CONFIG_FB_MACMODES is not set 751# CONFIG_FB_MACMODES is not set
723# CONFIG_FB_MODE_HELPERS is not set 752# CONFIG_FB_MODE_HELPERS is not set
724# CONFIG_FB_TILEBLITTING is not set 753# CONFIG_FB_TILEBLITTING is not set
@@ -728,6 +757,7 @@ CONFIG_FB_SOFT_CURSOR=y
728# CONFIG_FB_ASILIANT is not set 757# CONFIG_FB_ASILIANT is not set
729# CONFIG_FB_IMSTT is not set 758# CONFIG_FB_IMSTT is not set
730CONFIG_FB_STI=y 759CONFIG_FB_STI=y
760# CONFIG_FB_S1D13XXX is not set
731# CONFIG_FB_NVIDIA is not set 761# CONFIG_FB_NVIDIA is not set
732# CONFIG_FB_RIVA is not set 762# CONFIG_FB_RIVA is not set
733# CONFIG_FB_MATROX is not set 763# CONFIG_FB_MATROX is not set
@@ -741,9 +771,7 @@ CONFIG_FB_STI=y
741# CONFIG_FB_KYRO is not set 771# CONFIG_FB_KYRO is not set
742# CONFIG_FB_3DFX is not set 772# CONFIG_FB_3DFX is not set
743# CONFIG_FB_VOODOO1 is not set 773# CONFIG_FB_VOODOO1 is not set
744# CONFIG_FB_CYBLA is not set
745# CONFIG_FB_TRIDENT is not set 774# CONFIG_FB_TRIDENT is not set
746# CONFIG_FB_S1D13XXX is not set
747# CONFIG_FB_VIRTUAL is not set 775# CONFIG_FB_VIRTUAL is not set
748 776
749# 777#
@@ -753,15 +781,28 @@ CONFIG_DUMMY_CONSOLE=y
753CONFIG_DUMMY_CONSOLE_COLUMNS=160 781CONFIG_DUMMY_CONSOLE_COLUMNS=160
754CONFIG_DUMMY_CONSOLE_ROWS=64 782CONFIG_DUMMY_CONSOLE_ROWS=64
755CONFIG_FRAMEBUFFER_CONSOLE=y 783CONFIG_FRAMEBUFFER_CONSOLE=y
784# CONFIG_FRAMEBUFFER_CONSOLE_ROTATION is not set
756CONFIG_STI_CONSOLE=y 785CONFIG_STI_CONSOLE=y
757# CONFIG_FONTS is not set 786CONFIG_FONTS=y
758CONFIG_FONT_8x8=y 787# CONFIG_FONT_8x8 is not set
759CONFIG_FONT_8x16=y 788CONFIG_FONT_8x16=y
789# CONFIG_FONT_6x11 is not set
790# CONFIG_FONT_7x14 is not set
791# CONFIG_FONT_PEARL_8x8 is not set
792# CONFIG_FONT_ACORN_8x8 is not set
793# CONFIG_FONT_MINI_4x6 is not set
794# CONFIG_FONT_SUN8x16 is not set
795# CONFIG_FONT_SUN12x22 is not set
796# CONFIG_FONT_10x18 is not set
760 797
761# 798#
762# Logo configuration 799# Logo configuration
763# 800#
764# CONFIG_LOGO is not set 801CONFIG_LOGO=y
802# CONFIG_LOGO_LINUX_MONO is not set
803# CONFIG_LOGO_LINUX_VGA16 is not set
804# CONFIG_LOGO_LINUX_CLUT224 is not set
805CONFIG_LOGO_PARISC_CLUT224=y
765# CONFIG_BACKLIGHT_LCD_SUPPORT is not set 806# CONFIG_BACKLIGHT_LCD_SUPPORT is not set
766 807
767# 808#
@@ -781,23 +822,27 @@ CONFIG_SND_OSSEMUL=y
781CONFIG_SND_MIXER_OSS=y 822CONFIG_SND_MIXER_OSS=y
782CONFIG_SND_PCM_OSS=y 823CONFIG_SND_PCM_OSS=y
783CONFIG_SND_SEQUENCER_OSS=y 824CONFIG_SND_SEQUENCER_OSS=y
825# CONFIG_SND_DYNAMIC_MINORS is not set
826CONFIG_SND_SUPPORT_OLD_API=y
784# CONFIG_SND_VERBOSE_PRINTK is not set 827# CONFIG_SND_VERBOSE_PRINTK is not set
785# CONFIG_SND_DEBUG is not set 828# CONFIG_SND_DEBUG is not set
786 829
787# 830#
788# Generic devices 831# Generic devices
789# 832#
833CONFIG_SND_AC97_CODEC=y
834CONFIG_SND_AC97_BUS=y
790# CONFIG_SND_DUMMY is not set 835# CONFIG_SND_DUMMY is not set
791# CONFIG_SND_VIRMIDI is not set 836# CONFIG_SND_VIRMIDI is not set
792# CONFIG_SND_MTPAV is not set 837# CONFIG_SND_MTPAV is not set
793# CONFIG_SND_SERIAL_U16550 is not set 838# CONFIG_SND_SERIAL_U16550 is not set
794# CONFIG_SND_MPU401 is not set 839# CONFIG_SND_MPU401 is not set
795CONFIG_SND_AC97_CODEC=y
796CONFIG_SND_AC97_BUS=y
797 840
798# 841#
799# PCI devices 842# PCI devices
800# 843#
844CONFIG_SND_AD1889=y
845# CONFIG_SND_AD1889_OPL3 is not set
801# CONFIG_SND_ALI5451 is not set 846# CONFIG_SND_ALI5451 is not set
802# CONFIG_SND_ATIIXP is not set 847# CONFIG_SND_ATIIXP is not set
803# CONFIG_SND_ATIIXP_MODEM is not set 848# CONFIG_SND_ATIIXP_MODEM is not set
@@ -806,39 +851,38 @@ CONFIG_SND_AC97_BUS=y
806# CONFIG_SND_AU8830 is not set 851# CONFIG_SND_AU8830 is not set
807# CONFIG_SND_AZT3328 is not set 852# CONFIG_SND_AZT3328 is not set
808# CONFIG_SND_BT87X is not set 853# CONFIG_SND_BT87X is not set
809# CONFIG_SND_CS46XX is not set 854# CONFIG_SND_CA0106 is not set
855# CONFIG_SND_CMIPCI is not set
810# CONFIG_SND_CS4281 is not set 856# CONFIG_SND_CS4281 is not set
857# CONFIG_SND_CS46XX is not set
811# CONFIG_SND_EMU10K1 is not set 858# CONFIG_SND_EMU10K1 is not set
812# CONFIG_SND_EMU10K1X is not set 859# CONFIG_SND_EMU10K1X is not set
813# CONFIG_SND_CA0106 is not set
814# CONFIG_SND_KORG1212 is not set
815# CONFIG_SND_MIXART is not set
816# CONFIG_SND_NM256 is not set
817# CONFIG_SND_RME32 is not set
818# CONFIG_SND_RME96 is not set
819# CONFIG_SND_RME9652 is not set
820# CONFIG_SND_HDSP is not set
821# CONFIG_SND_HDSPM is not set
822# CONFIG_SND_TRIDENT is not set
823# CONFIG_SND_YMFPCI is not set
824CONFIG_SND_AD1889=y
825# CONFIG_SND_AD1889_OPL3 is not set
826# CONFIG_SND_CMIPCI is not set
827# CONFIG_SND_ENS1370 is not set 860# CONFIG_SND_ENS1370 is not set
828# CONFIG_SND_ENS1371 is not set 861# CONFIG_SND_ENS1371 is not set
829# CONFIG_SND_ES1938 is not set 862# CONFIG_SND_ES1938 is not set
830# CONFIG_SND_ES1968 is not set 863# CONFIG_SND_ES1968 is not set
831# CONFIG_SND_MAESTRO3 is not set
832# CONFIG_SND_FM801 is not set 864# CONFIG_SND_FM801 is not set
865# CONFIG_SND_HDA_INTEL is not set
866# CONFIG_SND_HDSP is not set
867# CONFIG_SND_HDSPM is not set
833# CONFIG_SND_ICE1712 is not set 868# CONFIG_SND_ICE1712 is not set
834# CONFIG_SND_ICE1724 is not set 869# CONFIG_SND_ICE1724 is not set
835# CONFIG_SND_INTEL8X0 is not set 870# CONFIG_SND_INTEL8X0 is not set
836# CONFIG_SND_INTEL8X0M is not set 871# CONFIG_SND_INTEL8X0M is not set
872# CONFIG_SND_KORG1212 is not set
873# CONFIG_SND_MAESTRO3 is not set
874# CONFIG_SND_MIXART is not set
875# CONFIG_SND_NM256 is not set
876# CONFIG_SND_PCXHR is not set
877# CONFIG_SND_RME32 is not set
878# CONFIG_SND_RME96 is not set
879# CONFIG_SND_RME9652 is not set
837# CONFIG_SND_SONICVIBES is not set 880# CONFIG_SND_SONICVIBES is not set
881# CONFIG_SND_TRIDENT is not set
838# CONFIG_SND_VIA82XX is not set 882# CONFIG_SND_VIA82XX is not set
839# CONFIG_SND_VIA82XX_MODEM is not set 883# CONFIG_SND_VIA82XX_MODEM is not set
840# CONFIG_SND_VX222 is not set 884# CONFIG_SND_VX222 is not set
841# CONFIG_SND_HDA_INTEL is not set 885# CONFIG_SND_YMFPCI is not set
842 886
843# 887#
844# USB devices 888# USB devices
@@ -888,14 +932,18 @@ CONFIG_USB_OHCI_LITTLE_ENDIAN=y
888# USB Device Class drivers 932# USB Device Class drivers
889# 933#
890# CONFIG_OBSOLETE_OSS_USB_DRIVER is not set 934# CONFIG_OBSOLETE_OSS_USB_DRIVER is not set
891# CONFIG_USB_BLUETOOTH_TTY is not set
892# CONFIG_USB_ACM is not set 935# CONFIG_USB_ACM is not set
893# CONFIG_USB_PRINTER is not set 936# CONFIG_USB_PRINTER is not set
894 937
895# 938#
896# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support' may also be needed; see USB_STORAGE Help for more information 939# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support'
940#
941
942#
943# may also be needed; see USB_STORAGE Help for more information
897# 944#
898# CONFIG_USB_STORAGE is not set 945# CONFIG_USB_STORAGE is not set
946# CONFIG_USB_LIBUSUAL is not set
899 947
900# 948#
901# USB Input Devices 949# USB Input Devices
@@ -918,6 +966,7 @@ CONFIG_USB_OHCI_LITTLE_ENDIAN=y
918# CONFIG_USB_YEALINK is not set 966# CONFIG_USB_YEALINK is not set
919# CONFIG_USB_XPAD is not set 967# CONFIG_USB_XPAD is not set
920# CONFIG_USB_ATI_REMOTE is not set 968# CONFIG_USB_ATI_REMOTE is not set
969# CONFIG_USB_ATI_REMOTE2 is not set
921# CONFIG_USB_KEYSPAN_REMOTE is not set 970# CONFIG_USB_KEYSPAN_REMOTE is not set
922# CONFIG_USB_APPLETOUCH is not set 971# CONFIG_USB_APPLETOUCH is not set
923 972
@@ -994,7 +1043,7 @@ CONFIG_USB_MON=y
994# CONFIG_INFINIBAND is not set 1043# CONFIG_INFINIBAND is not set
995 1044
996# 1045#
997# SN Devices 1046# EDAC - error detection and reporting (RAS) (EXPERIMENTAL)
998# 1047#
999 1048
1000# 1049#
@@ -1011,6 +1060,7 @@ CONFIG_JBD=y
1011# CONFIG_JFS_FS is not set 1060# CONFIG_JFS_FS is not set
1012# CONFIG_FS_POSIX_ACL is not set 1061# CONFIG_FS_POSIX_ACL is not set
1013# CONFIG_XFS_FS is not set 1062# CONFIG_XFS_FS is not set
1063# CONFIG_OCFS2_FS is not set
1014# CONFIG_MINIX_FS is not set 1064# CONFIG_MINIX_FS is not set
1015# CONFIG_ROMFS_FS is not set 1065# CONFIG_ROMFS_FS is not set
1016CONFIG_INOTIFY=y 1066CONFIG_INOTIFY=y
@@ -1045,6 +1095,7 @@ CONFIG_TMPFS=y
1045# CONFIG_HUGETLB_PAGE is not set 1095# CONFIG_HUGETLB_PAGE is not set
1046CONFIG_RAMFS=y 1096CONFIG_RAMFS=y
1047# CONFIG_RELAYFS_FS is not set 1097# CONFIG_RELAYFS_FS is not set
1098# CONFIG_CONFIGFS_FS is not set
1048 1099
1049# 1100#
1050# Miscellaneous filesystems 1101# Miscellaneous filesystems
@@ -1151,18 +1202,22 @@ CONFIG_OPROFILE=y
1151# Kernel hacking 1202# Kernel hacking
1152# 1203#
1153# CONFIG_PRINTK_TIME is not set 1204# CONFIG_PRINTK_TIME is not set
1154CONFIG_DEBUG_KERNEL=y
1155CONFIG_MAGIC_SYSRQ=y 1205CONFIG_MAGIC_SYSRQ=y
1206CONFIG_DEBUG_KERNEL=y
1156CONFIG_LOG_BUF_SHIFT=15 1207CONFIG_LOG_BUF_SHIFT=15
1157CONFIG_DETECT_SOFTLOCKUP=y 1208CONFIG_DETECT_SOFTLOCKUP=y
1158# CONFIG_SCHEDSTATS is not set 1209# CONFIG_SCHEDSTATS is not set
1159# CONFIG_DEBUG_SLAB is not set 1210# CONFIG_DEBUG_SLAB is not set
1211CONFIG_DEBUG_MUTEXES=y
1160# CONFIG_DEBUG_SPINLOCK is not set 1212# CONFIG_DEBUG_SPINLOCK is not set
1161# CONFIG_DEBUG_SPINLOCK_SLEEP is not set 1213# CONFIG_DEBUG_SPINLOCK_SLEEP is not set
1162# CONFIG_DEBUG_KOBJECT is not set 1214# CONFIG_DEBUG_KOBJECT is not set
1163# CONFIG_DEBUG_INFO is not set 1215# CONFIG_DEBUG_INFO is not set
1164# CONFIG_DEBUG_IOREMAP is not set
1165# CONFIG_DEBUG_FS is not set 1216# CONFIG_DEBUG_FS is not set
1217# CONFIG_DEBUG_VM is not set
1218CONFIG_FORCED_INLINING=y
1219# CONFIG_RCU_TORTURE_TEST is not set
1220CONFIG_DEBUG_RODATA=y
1166 1221
1167# 1222#
1168# Security options 1223# Security options
diff --git a/arch/parisc/kernel/cache.c b/arch/parisc/kernel/cache.c
index d8a4ca021aac..360b7391cb8c 100644
--- a/arch/parisc/kernel/cache.c
+++ b/arch/parisc/kernel/cache.c
@@ -89,7 +89,7 @@ update_mmu_cache(struct vm_area_struct *vma, unsigned long address, pte_t pte)
89 if (pfn_valid(page_to_pfn(page)) && page_mapping(page) && 89 if (pfn_valid(page_to_pfn(page)) && page_mapping(page) &&
90 test_bit(PG_dcache_dirty, &page->flags)) { 90 test_bit(PG_dcache_dirty, &page->flags)) {
91 91
92 flush_kernel_dcache_page(page_address(page)); 92 flush_kernel_dcache_page(page);
93 clear_bit(PG_dcache_dirty, &page->flags); 93 clear_bit(PG_dcache_dirty, &page->flags);
94 } 94 }
95} 95}
@@ -278,7 +278,7 @@ void flush_dcache_page(struct page *page)
278 return; 278 return;
279 } 279 }
280 280
281 flush_kernel_dcache_page(page_address(page)); 281 flush_kernel_dcache_page(page);
282 282
283 if (!mapping) 283 if (!mapping)
284 return; 284 return;
@@ -317,7 +317,7 @@ EXPORT_SYMBOL(flush_dcache_page);
317 317
318/* Defined in arch/parisc/kernel/pacache.S */ 318/* Defined in arch/parisc/kernel/pacache.S */
319EXPORT_SYMBOL(flush_kernel_dcache_range_asm); 319EXPORT_SYMBOL(flush_kernel_dcache_range_asm);
320EXPORT_SYMBOL(flush_kernel_dcache_page); 320EXPORT_SYMBOL(flush_kernel_dcache_page_asm);
321EXPORT_SYMBOL(flush_data_cache_local); 321EXPORT_SYMBOL(flush_data_cache_local);
322EXPORT_SYMBOL(flush_kernel_icache_range_asm); 322EXPORT_SYMBOL(flush_kernel_icache_range_asm);
323 323
diff --git a/arch/parisc/kernel/entry.S b/arch/parisc/kernel/entry.S
index 9af4b22a6d77..7c95d7663c29 100644
--- a/arch/parisc/kernel/entry.S
+++ b/arch/parisc/kernel/entry.S
@@ -563,10 +563,10 @@
563 extrd,u,*= \pte,_PAGE_GATEWAY_BIT+32,1,%r0 563 extrd,u,*= \pte,_PAGE_GATEWAY_BIT+32,1,%r0
564 depd %r0,11,2,\prot /* If Gateway, Set PL2 to 0 */ 564 depd %r0,11,2,\prot /* If Gateway, Set PL2 to 0 */
565 565
566 /* Get rid of prot bits and convert to page addr for iitlbt */ 566 /* Get rid of prot bits and convert to page addr for iitlbt and idtlbt */
567 567
568 depd %r0,63,PAGE_SHIFT,\pte 568 depd %r0,63,PAGE_SHIFT,\pte
569 extrd,u \pte,56,32,\pte 569 extrd,s \pte,(63-PAGE_SHIFT)+(63-58),64-PAGE_SHIFT,\pte
570 .endm 570 .endm
571 571
572 /* Identical macro to make_insert_tlb above, except it 572 /* Identical macro to make_insert_tlb above, except it
@@ -584,7 +584,7 @@
584 584
585 /* Get rid of prot bits and convert to page addr for iitlba */ 585 /* Get rid of prot bits and convert to page addr for iitlba */
586 586
587 depi 0,31,12,\pte 587 depi 0,31,PAGE_SHIFT,\pte
588 extru \pte,24,25,\pte 588 extru \pte,24,25,\pte
589 589
590 .endm 590 .endm
@@ -1014,14 +1014,21 @@ intr_restore:
1014 nop 1014 nop
1015 nop 1015 nop
1016 1016
1017#ifndef CONFIG_PREEMPT
1018# define intr_do_preempt intr_restore
1019#endif /* !CONFIG_PREEMPT */
1020
1017 .import schedule,code 1021 .import schedule,code
1018intr_do_resched: 1022intr_do_resched:
1019 /* Only do reschedule if we are returning to user space */ 1023 /* Only call schedule on return to userspace. If we're returning
1024 * to kernel space, we may schedule if CONFIG_PREEMPT, otherwise
1025 * we jump back to intr_restore.
1026 */
1020 LDREG PT_IASQ0(%r16), %r20 1027 LDREG PT_IASQ0(%r16), %r20
1021 CMPIB= 0,%r20,intr_restore /* backward */ 1028 CMPIB= 0, %r20, intr_do_preempt
1022 nop 1029 nop
1023 LDREG PT_IASQ1(%r16), %r20 1030 LDREG PT_IASQ1(%r16), %r20
1024 CMPIB= 0,%r20,intr_restore /* backward */ 1031 CMPIB= 0, %r20, intr_do_preempt
1025 nop 1032 nop
1026 1033
1027#ifdef CONFIG_64BIT 1034#ifdef CONFIG_64BIT
@@ -1037,6 +1044,32 @@ intr_do_resched:
1037#endif 1044#endif
1038 ldo R%intr_check_sig(%r2), %r2 1045 ldo R%intr_check_sig(%r2), %r2
1039 1046
1047 /* preempt the current task on returning to kernel
1048 * mode from an interrupt, iff need_resched is set,
1049 * and preempt_count is 0. otherwise, we continue on
1050 * our merry way back to the current running task.
1051 */
1052#ifdef CONFIG_PREEMPT
1053 .import preempt_schedule_irq,code
1054intr_do_preempt:
1055 rsm PSW_SM_I, %r0 /* disable interrupts */
1056
1057 /* current_thread_info()->preempt_count */
1058 mfctl %cr30, %r1
1059 LDREG TI_PRE_COUNT(%r1), %r19
1060 CMPIB<> 0, %r19, intr_restore /* if preempt_count > 0 */
1061 nop /* prev insn branched backwards */
1062
1063 /* check if we interrupted a critical path */
1064 LDREG PT_PSW(%r16), %r20
1065 bb,<,n %r20, 31 - PSW_SM_I, intr_restore
1066 nop
1067
1068 BL preempt_schedule_irq, %r2
1069 nop
1070
1071 b intr_restore /* ssm PSW_SM_I done by intr_restore */
1072#endif /* CONFIG_PREEMPT */
1040 1073
1041 .import do_signal,code 1074 .import do_signal,code
1042intr_do_signal: 1075intr_do_signal:
diff --git a/arch/parisc/kernel/pacache.S b/arch/parisc/kernel/pacache.S
index 9534ee17b9be..7a4f07e8d3c3 100644
--- a/arch/parisc/kernel/pacache.S
+++ b/arch/parisc/kernel/pacache.S
@@ -621,9 +621,9 @@ __clear_user_page_asm:
621 621
622 .procend 622 .procend
623 623
624 .export flush_kernel_dcache_page 624 .export flush_kernel_dcache_page_asm
625 625
626flush_kernel_dcache_page: 626flush_kernel_dcache_page_asm:
627 .proc 627 .proc
628 .callinfo NO_CALLS 628 .callinfo NO_CALLS
629 .entry 629 .entry
diff --git a/arch/parisc/kernel/parisc_ksyms.c b/arch/parisc/kernel/parisc_ksyms.c
index 1d00c365f2b1..47ca5c0a323b 100644
--- a/arch/parisc/kernel/parisc_ksyms.c
+++ b/arch/parisc/kernel/parisc_ksyms.c
@@ -30,22 +30,7 @@
30#include <linux/syscalls.h> 30#include <linux/syscalls.h>
31 31
32#include <linux/string.h> 32#include <linux/string.h>
33EXPORT_SYMBOL(memchr);
34EXPORT_SYMBOL(memcmp);
35EXPORT_SYMBOL(memmove);
36EXPORT_SYMBOL(memscan);
37EXPORT_SYMBOL(memset); 33EXPORT_SYMBOL(memset);
38EXPORT_SYMBOL(strcat);
39EXPORT_SYMBOL(strchr);
40EXPORT_SYMBOL(strcmp);
41EXPORT_SYMBOL(strcpy);
42EXPORT_SYMBOL(strlen);
43EXPORT_SYMBOL(strncat);
44EXPORT_SYMBOL(strncmp);
45EXPORT_SYMBOL(strncpy);
46EXPORT_SYMBOL(strnlen);
47EXPORT_SYMBOL(strrchr);
48EXPORT_SYMBOL(strstr);
49EXPORT_SYMBOL(strpbrk); 34EXPORT_SYMBOL(strpbrk);
50 35
51#include <asm/atomic.h> 36#include <asm/atomic.h>
@@ -82,16 +67,12 @@ EXPORT_SYMBOL($global$);
82#endif 67#endif
83 68
84#include <asm/io.h> 69#include <asm/io.h>
85EXPORT_SYMBOL(__ioremap);
86EXPORT_SYMBOL(iounmap);
87EXPORT_SYMBOL(memcpy_toio); 70EXPORT_SYMBOL(memcpy_toio);
88EXPORT_SYMBOL(memcpy_fromio); 71EXPORT_SYMBOL(memcpy_fromio);
89EXPORT_SYMBOL(memset_io); 72EXPORT_SYMBOL(memset_io);
90 73
91#include <asm/unistd.h> 74#include <asm/unistd.h>
92EXPORT_SYMBOL(sys_open);
93EXPORT_SYMBOL(sys_lseek); 75EXPORT_SYMBOL(sys_lseek);
94EXPORT_SYMBOL(sys_read);
95EXPORT_SYMBOL(sys_write); 76EXPORT_SYMBOL(sys_write);
96 77
97#include <asm/semaphore.h> 78#include <asm/semaphore.h>
diff --git a/arch/parisc/kernel/pdc_chassis.c b/arch/parisc/kernel/pdc_chassis.c
index 2a01fe1bdc98..a45e2e2ffd9f 100644
--- a/arch/parisc/kernel/pdc_chassis.c
+++ b/arch/parisc/kernel/pdc_chassis.c
@@ -5,9 +5,8 @@
5 * Copyright (C) 2002-2004 Thibaut VARENE <varenet@parisc-linux.org> 5 * Copyright (C) 2002-2004 Thibaut VARENE <varenet@parisc-linux.org>
6 * 6 *
7 * This program is free software; you can redistribute it and/or modify 7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by 8 * it under the terms of the GNU General Public License, version 2, as
9 * the Free Software Foundation; either version 2 of the License, or 9 * published by the Free Software Foundation.
10 * (at your option) any later version.
11 * 10 *
12 * This program is distributed in the hope that it will be useful, 11 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -150,7 +149,8 @@ void __init parisc_pdc_chassis_init(void)
150 149
151 if (handle) { 150 if (handle) {
152 /* initialize panic notifier chain */ 151 /* initialize panic notifier chain */
153 notifier_chain_register(&panic_notifier_list, &pdc_chassis_panic_block); 152 atomic_notifier_chain_register(&panic_notifier_list,
153 &pdc_chassis_panic_block);
154 154
155 /* initialize reboot notifier chain */ 155 /* initialize reboot notifier chain */
156 register_reboot_notifier(&pdc_chassis_reboot_block); 156 register_reboot_notifier(&pdc_chassis_reboot_block);
diff --git a/arch/parisc/kernel/perf.c b/arch/parisc/kernel/perf.c
index 53f861c82f93..ac8ee205c351 100644
--- a/arch/parisc/kernel/perf.c
+++ b/arch/parisc/kernel/perf.c
@@ -805,7 +805,7 @@ static int perf_write_image(uint64_t *memaddr)
805 return -1; 805 return -1;
806 } 806 }
807 807
808 runway = ioremap(cpu_device->hpa.start, 4096); 808 runway = ioremap_nocache(cpu_device->hpa.start, 4096);
809 809
810 /* Merge intrigue bits into Runway STATUS 0 */ 810 /* Merge intrigue bits into Runway STATUS 0 */
811 tmp64 = __raw_readq(runway + RUNWAY_STATUS) & 0xffecfffffffffffful; 811 tmp64 = __raw_readq(runway + RUNWAY_STATUS) & 0xffecfffffffffffful;
diff --git a/arch/parisc/kernel/process.c b/arch/parisc/kernel/process.c
index e8dea4177113..0b485ef4be89 100644
--- a/arch/parisc/kernel/process.c
+++ b/arch/parisc/kernel/process.c
@@ -54,11 +54,6 @@
54#include <asm/uaccess.h> 54#include <asm/uaccess.h>
55#include <asm/unwind.h> 55#include <asm/unwind.h>
56 56
57void default_idle(void)
58{
59 barrier();
60}
61
62/* 57/*
63 * The idle thread. There's no useful work to be 58 * The idle thread. There's no useful work to be
64 * done, so just try to conserve power and have a 59 * done, so just try to conserve power and have a
diff --git a/arch/parisc/kernel/smp.c b/arch/parisc/kernel/smp.c
index 25564b7ca6bb..d6ac1c60a471 100644
--- a/arch/parisc/kernel/smp.c
+++ b/arch/parisc/kernel/smp.c
@@ -298,8 +298,8 @@ send_IPI_allbutself(enum ipi_message_type op)
298{ 298{
299 int i; 299 int i;
300 300
301 for (i = 0; i < NR_CPUS; i++) { 301 for_each_online_cpu(i) {
302 if (cpu_online(i) && i != smp_processor_id()) 302 if (i != smp_processor_id())
303 send_IPI_single(i, op); 303 send_IPI_single(i, op);
304 } 304 }
305} 305}
@@ -643,14 +643,13 @@ int sys_cpus(int argc, char **argv)
643 if ( argc == 1 ){ 643 if ( argc == 1 ){
644 644
645#ifdef DUMP_MORE_STATE 645#ifdef DUMP_MORE_STATE
646 for(i=0; i<NR_CPUS; i++) { 646 for_each_online_cpu(i) {
647 int cpus_per_line = 4; 647 int cpus_per_line = 4;
648 if(cpu_online(i)) { 648
649 if (j++ % cpus_per_line) 649 if (j++ % cpus_per_line)
650 printk(" %3d",i); 650 printk(" %3d",i);
651 else 651 else
652 printk("\n %3d",i); 652 printk("\n %3d",i);
653 }
654 } 653 }
655 printk("\n"); 654 printk("\n");
656#else 655#else
@@ -659,9 +658,7 @@ int sys_cpus(int argc, char **argv)
659 } else if((argc==2) && !(strcmp(argv[1],"-l"))) { 658 } else if((argc==2) && !(strcmp(argv[1],"-l"))) {
660 printk("\nCPUSTATE TASK CPUNUM CPUID HARDCPU(HPA)\n"); 659 printk("\nCPUSTATE TASK CPUNUM CPUID HARDCPU(HPA)\n");
661#ifdef DUMP_MORE_STATE 660#ifdef DUMP_MORE_STATE
662 for(i=0;i<NR_CPUS;i++) { 661 for_each_online_cpu(i) {
663 if (!cpu_online(i))
664 continue;
665 if (cpu_data[i].cpuid != NO_PROC_ID) { 662 if (cpu_data[i].cpuid != NO_PROC_ID) {
666 switch(cpu_data[i].state) { 663 switch(cpu_data[i].state) {
667 case STATE_RENDEZVOUS: 664 case STATE_RENDEZVOUS:
@@ -695,9 +692,7 @@ int sys_cpus(int argc, char **argv)
695 } else if ((argc==2) && !(strcmp(argv[1],"-s"))) { 692 } else if ((argc==2) && !(strcmp(argv[1],"-s"))) {
696#ifdef DUMP_MORE_STATE 693#ifdef DUMP_MORE_STATE
697 printk("\nCPUSTATE CPUID\n"); 694 printk("\nCPUSTATE CPUID\n");
698 for (i=0;i<NR_CPUS;i++) { 695 for_each_online_cpu(i) {
699 if (!cpu_online(i))
700 continue;
701 if (cpu_data[i].cpuid != NO_PROC_ID) { 696 if (cpu_data[i].cpuid != NO_PROC_ID) {
702 switch(cpu_data[i].state) { 697 switch(cpu_data[i].state) {
703 case STATE_RENDEZVOUS: 698 case STATE_RENDEZVOUS:
diff --git a/arch/parisc/kernel/sys_parisc32.c b/arch/parisc/kernel/sys_parisc32.c
index 613569018410..d286f68a3d3a 100644
--- a/arch/parisc/kernel/sys_parisc32.c
+++ b/arch/parisc/kernel/sys_parisc32.c
@@ -21,7 +21,6 @@
21#include <linux/times.h> 21#include <linux/times.h>
22#include <linux/utsname.h> 22#include <linux/utsname.h>
23#include <linux/time.h> 23#include <linux/time.h>
24#include <linux/timex.h>
25#include <linux/smp.h> 24#include <linux/smp.h>
26#include <linux/smp_lock.h> 25#include <linux/smp_lock.h>
27#include <linux/sem.h> 26#include <linux/sem.h>
@@ -567,63 +566,6 @@ asmlinkage int sys32_sendfile64(int out_fd, int in_fd, compat_loff_t __user *off
567} 566}
568 567
569 568
570struct timex32 {
571 unsigned int modes; /* mode selector */
572 int offset; /* time offset (usec) */
573 int freq; /* frequency offset (scaled ppm) */
574 int maxerror; /* maximum error (usec) */
575 int esterror; /* estimated error (usec) */
576 int status; /* clock command/status */
577 int constant; /* pll time constant */
578 int precision; /* clock precision (usec) (read only) */
579 int tolerance; /* clock frequency tolerance (ppm)
580 * (read only)
581 */
582 struct compat_timeval time; /* (read only) */
583 int tick; /* (modified) usecs between clock ticks */
584
585 int ppsfreq; /* pps frequency (scaled ppm) (ro) */
586 int jitter; /* pps jitter (us) (ro) */
587 int shift; /* interval duration (s) (shift) (ro) */
588 int stabil; /* pps stability (scaled ppm) (ro) */
589 int jitcnt; /* jitter limit exceeded (ro) */
590 int calcnt; /* calibration intervals (ro) */
591 int errcnt; /* calibration errors (ro) */
592 int stbcnt; /* stability limit exceeded (ro) */
593
594 int :32; int :32; int :32; int :32;
595 int :32; int :32; int :32; int :32;
596 int :32; int :32; int :32; int :32;
597};
598
599asmlinkage long sys32_adjtimex(struct timex32 __user *txc_p32)
600{
601 struct timex txc;
602 struct timex32 t32;
603 int ret;
604 extern int do_adjtimex(struct timex *txc);
605
606 if(copy_from_user(&t32, txc_p32, sizeof(struct timex32)))
607 return -EFAULT;
608#undef CP
609#define CP(x) txc.x = t32.x
610 CP(modes); CP(offset); CP(freq); CP(maxerror); CP(esterror);
611 CP(status); CP(constant); CP(precision); CP(tolerance);
612 CP(time.tv_sec); CP(time.tv_usec); CP(tick); CP(ppsfreq); CP(jitter);
613 CP(shift); CP(stabil); CP(jitcnt); CP(calcnt); CP(errcnt);
614 CP(stbcnt);
615 ret = do_adjtimex(&txc);
616#undef CP
617#define CP(x) t32.x = txc.x
618 CP(modes); CP(offset); CP(freq); CP(maxerror); CP(esterror);
619 CP(status); CP(constant); CP(precision); CP(tolerance);
620 CP(time.tv_sec); CP(time.tv_usec); CP(tick); CP(ppsfreq); CP(jitter);
621 CP(shift); CP(stabil); CP(jitcnt); CP(calcnt); CP(errcnt);
622 CP(stbcnt);
623 return copy_to_user(txc_p32, &t32, sizeof(struct timex32)) ? -EFAULT : ret;
624}
625
626
627struct sysinfo32 { 569struct sysinfo32 {
628 s32 uptime; 570 s32 uptime;
629 u32 loads[3]; 571 u32 loads[3];
diff --git a/arch/parisc/kernel/syscall_table.S b/arch/parisc/kernel/syscall_table.S
index 71011eadb872..bbeeb614cfab 100644
--- a/arch/parisc/kernel/syscall_table.S
+++ b/arch/parisc/kernel/syscall_table.S
@@ -207,7 +207,7 @@
207 /* struct sockaddr... */ 207 /* struct sockaddr... */
208 ENTRY_SAME(recvfrom) 208 ENTRY_SAME(recvfrom)
209 /* struct timex contains longs */ 209 /* struct timex contains longs */
210 ENTRY_DIFF(adjtimex) 210 ENTRY_COMP(adjtimex)
211 ENTRY_SAME(mprotect) /* 125 */ 211 ENTRY_SAME(mprotect) /* 125 */
212 /* old_sigset_t forced to 32 bits. Beware glibc sigset_t */ 212 /* old_sigset_t forced to 32 bits. Beware glibc sigset_t */
213 ENTRY_COMP(sigprocmask) 213 ENTRY_COMP(sigprocmask)
@@ -287,7 +287,7 @@
287 ENTRY_SAME(chown) /* 180 */ 287 ENTRY_SAME(chown) /* 180 */
288 /* setsockopt() used by iptables: SO_SET_REPLACE/SO_SET_ADD_COUNTERS */ 288 /* setsockopt() used by iptables: SO_SET_REPLACE/SO_SET_ADD_COUNTERS */
289 ENTRY_COMP(setsockopt) 289 ENTRY_COMP(setsockopt)
290 ENTRY_SAME(getsockopt) 290 ENTRY_COMP(getsockopt)
291 ENTRY_COMP(sendmsg) 291 ENTRY_COMP(sendmsg)
292 ENTRY_COMP(recvmsg) 292 ENTRY_COMP(recvmsg)
293 ENTRY_SAME(semop) /* 185 */ 293 ENTRY_SAME(semop) /* 185 */
diff --git a/arch/parisc/lib/iomap.c b/arch/parisc/lib/iomap.c
index 01bec8fcbd0d..f4a811690ab3 100644
--- a/arch/parisc/lib/iomap.c
+++ b/arch/parisc/lib/iomap.c
@@ -263,11 +263,7 @@ static const struct iomap_ops iomem_ops = {
263 263
264const struct iomap_ops *iomap_ops[8] = { 264const struct iomap_ops *iomap_ops[8] = {
265 [0] = &ioport_ops, 265 [0] = &ioport_ops,
266#ifdef CONFIG_DEBUG_IOREMAP
267 [6] = &iomem_ops,
268#else
269 [7] = &iomem_ops 266 [7] = &iomem_ops
270#endif
271}; 267};
272 268
273 269
diff --git a/arch/parisc/mm/init.c b/arch/parisc/mm/init.c
index 7847ca13d6c2..3796be67cd53 100644
--- a/arch/parisc/mm/init.c
+++ b/arch/parisc/mm/init.c
@@ -398,7 +398,7 @@ void free_initmem(void)
398 addr = (unsigned long)(&__init_begin); 398 addr = (unsigned long)(&__init_begin);
399 for (; addr < (unsigned long)(&__init_end); addr += PAGE_SIZE) { 399 for (; addr < (unsigned long)(&__init_end); addr += PAGE_SIZE) {
400 ClearPageReserved(virt_to_page(addr)); 400 ClearPageReserved(virt_to_page(addr));
401 set_page_count(virt_to_page(addr), 1); 401 init_page_count(virt_to_page(addr));
402 free_page(addr); 402 free_page(addr);
403 num_physpages++; 403 num_physpages++;
404 totalram_pages++; 404 totalram_pages++;
@@ -1013,16 +1013,15 @@ void flush_tlb_all(void)
1013#ifdef CONFIG_BLK_DEV_INITRD 1013#ifdef CONFIG_BLK_DEV_INITRD
1014void free_initrd_mem(unsigned long start, unsigned long end) 1014void free_initrd_mem(unsigned long start, unsigned long end)
1015{ 1015{
1016#if 0 1016 if (start >= end)
1017 if (start < end) 1017 return;
1018 printk(KERN_INFO "Freeing initrd memory: %ldk freed\n", (end - start) >> 10); 1018 printk(KERN_INFO "Freeing initrd memory: %ldk freed\n", (end - start) >> 10);
1019 for (; start < end; start += PAGE_SIZE) { 1019 for (; start < end; start += PAGE_SIZE) {
1020 ClearPageReserved(virt_to_page(start)); 1020 ClearPageReserved(virt_to_page(start));
1021 set_page_count(virt_to_page(start), 1); 1021 init_page_count(virt_to_page(start));
1022 free_page(start); 1022 free_page(start);
1023 num_physpages++; 1023 num_physpages++;
1024 totalram_pages++; 1024 totalram_pages++;
1025 } 1025 }
1026#endif
1027} 1026}
1028#endif 1027#endif
diff --git a/arch/parisc/mm/ioremap.c b/arch/parisc/mm/ioremap.c
index edd9a9559cba..0db12818d7bc 100644
--- a/arch/parisc/mm/ioremap.c
+++ b/arch/parisc/mm/ioremap.c
@@ -72,7 +72,6 @@ remap_area_pmd(pmd_t *pmd, unsigned long address, unsigned long size,
72 return 0; 72 return 0;
73} 73}
74 74
75#if USE_HPPA_IOREMAP
76static int 75static int
77remap_area_pages(unsigned long address, unsigned long phys_addr, 76remap_area_pages(unsigned long address, unsigned long phys_addr,
78 unsigned long size, unsigned long flags) 77 unsigned long size, unsigned long flags)
@@ -114,31 +113,6 @@ remap_area_pages(unsigned long address, unsigned long phys_addr,
114 113
115 return error; 114 return error;
116} 115}
117#endif /* USE_HPPA_IOREMAP */
118
119#ifdef CONFIG_DEBUG_IOREMAP
120static unsigned long last = 0;
121
122void gsc_bad_addr(unsigned long addr)
123{
124 if (time_after(jiffies, last + HZ*10)) {
125 printk("gsc_foo() called with bad address 0x%lx\n", addr);
126 dump_stack();
127 last = jiffies;
128 }
129}
130EXPORT_SYMBOL(gsc_bad_addr);
131
132void __raw_bad_addr(const volatile void __iomem *addr)
133{
134 if (time_after(jiffies, last + HZ*10)) {
135 printk("__raw_foo() called with bad address 0x%p\n", addr);
136 dump_stack();
137 last = jiffies;
138 }
139}
140EXPORT_SYMBOL(__raw_bad_addr);
141#endif
142 116
143/* 117/*
144 * Generic mapping function (not visible outside): 118 * Generic mapping function (not visible outside):
@@ -154,26 +128,19 @@ EXPORT_SYMBOL(__raw_bad_addr);
154 */ 128 */
155void __iomem * __ioremap(unsigned long phys_addr, unsigned long size, unsigned long flags) 129void __iomem * __ioremap(unsigned long phys_addr, unsigned long size, unsigned long flags)
156{ 130{
157#if !(USE_HPPA_IOREMAP) 131 void *addr;
132 struct vm_struct *area;
133 unsigned long offset, last_addr;
158 134
135#ifdef CONFIG_EISA
159 unsigned long end = phys_addr + size - 1; 136 unsigned long end = phys_addr + size - 1;
160 /* Support EISA addresses */ 137 /* Support EISA addresses */
161 if ((phys_addr >= 0x00080000 && end < 0x000fffff) 138 if ((phys_addr >= 0x00080000 && end < 0x000fffff) ||
162 || (phys_addr >= 0x00500000 && end < 0x03bfffff)) { 139 (phys_addr >= 0x00500000 && end < 0x03bfffff)) {
163 phys_addr |= 0xfc000000; 140 phys_addr |= F_EXTEND(0xfc000000);
164 } 141 }
165
166#ifdef CONFIG_DEBUG_IOREMAP
167 return (void __iomem *)(phys_addr - (0x1UL << NYBBLE_SHIFT));
168#else
169 return (void __iomem *)phys_addr;
170#endif 142#endif
171 143
172#else
173 void *addr;
174 struct vm_struct *area;
175 unsigned long offset, last_addr;
176
177 /* Don't allow wraparound or zero size */ 144 /* Don't allow wraparound or zero size */
178 last_addr = phys_addr + size - 1; 145 last_addr = phys_addr + size - 1;
179 if (!size || last_addr < phys_addr) 146 if (!size || last_addr < phys_addr)
@@ -217,15 +184,12 @@ void __iomem * __ioremap(unsigned long phys_addr, unsigned long size, unsigned l
217 } 184 }
218 185
219 return (void __iomem *) (offset + (char *)addr); 186 return (void __iomem *) (offset + (char *)addr);
220#endif
221} 187}
188EXPORT_SYMBOL(__ioremap);
222 189
223void iounmap(void __iomem *addr) 190void iounmap(void __iomem *addr)
224{ 191{
225#if !(USE_HPPA_IOREMAP)
226 return;
227#else
228 if (addr > high_memory) 192 if (addr > high_memory)
229 return vfree((void *) (PAGE_MASK & (unsigned long __force) addr)); 193 return vfree((void *) (PAGE_MASK & (unsigned long __force) addr));
230#endif
231} 194}
195EXPORT_SYMBOL(iounmap);
diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig
index a834f9e0bbb3..2cdc35ce8045 100644
--- a/arch/powerpc/Kconfig
+++ b/arch/powerpc/Kconfig
@@ -37,6 +37,10 @@ config RWSEM_XCHGADD_ALGORITHM
37 bool 37 bool
38 default y 38 default y
39 39
40config GENERIC_HWEIGHT
41 bool
42 default y
43
40config GENERIC_CALIBRATE_DELAY 44config GENERIC_CALIBRATE_DELAY
41 bool 45 bool
42 default y 46 default y
@@ -127,6 +131,12 @@ config PPC_83xx
127 select 83xx 131 select 83xx
128 select PPC_FPU 132 select PPC_FPU
129 133
134config PPC_85xx
135 bool "Freescale 85xx"
136 select E500
137 select FSL_SOC
138 select 85xx
139
130config 40x 140config 40x
131 bool "AMCC 40x" 141 bool "AMCC 40x"
132 142
@@ -139,8 +149,6 @@ config 8xx
139config E200 149config E200
140 bool "Freescale e200" 150 bool "Freescale e200"
141 151
142config E500
143 bool "Freescale e500"
144endchoice 152endchoice
145 153
146config POWER4_ONLY 154config POWER4_ONLY
@@ -168,6 +176,13 @@ config 6xx
168config 83xx 176config 83xx
169 bool 177 bool
170 178
179# this is temp to handle compat with arch=ppc
180config 85xx
181 bool
182
183config E500
184 bool
185
171config PPC_FPU 186config PPC_FPU
172 bool 187 bool
173 default y if PPC64 188 default y if PPC64
@@ -217,6 +232,7 @@ config ALTIVEC
217config SPE 232config SPE
218 bool "SPE Support" 233 bool "SPE Support"
219 depends on E200 || E500 234 depends on E200 || E500
235 default y
220 ---help--- 236 ---help---
221 This option enables kernel support for the Signal Processing 237 This option enables kernel support for the Signal Processing
222 Extensions (SPE) to the PowerPC processor. The kernel currently 238 Extensions (SPE) to the PowerPC processor. The kernel currently
@@ -238,6 +254,21 @@ config PPC_STD_MMU_32
238 def_bool y 254 def_bool y
239 depends on PPC_STD_MMU && PPC32 255 depends on PPC_STD_MMU && PPC32
240 256
257config VIRT_CPU_ACCOUNTING
258 bool "Deterministic task and CPU time accounting"
259 depends on PPC64
260 default y
261 help
262 Select this option to enable more accurate task and CPU time
263 accounting. This is done by reading a CPU counter on each
264 kernel entry and exit and on transitions within the kernel
265 between system, softirq and hardirq state, so there is a
266 small performance impact. This also enables accounting of
267 stolen time on logically-partitioned systems running on
268 IBM POWER5-based machines.
269
270 If in doubt, say Y here.
271
241config SMP 272config SMP
242 depends on PPC_STD_MMU 273 depends on PPC_STD_MMU
243 bool "Symmetric multi-processing support" 274 bool "Symmetric multi-processing support"
@@ -460,7 +491,7 @@ config PPC601_SYNC_FIX
460 If in doubt, say Y here. 491 If in doubt, say Y here.
461 492
462config TAU 493config TAU
463 bool "Thermal Management Support" 494 bool "On-chip CPU temperature sensor support"
464 depends on 6xx 495 depends on 6xx
465 help 496 help
466 G3 and G4 processors have an on-chip temperature sensor called the 497 G3 and G4 processors have an on-chip temperature sensor called the
@@ -469,7 +500,7 @@ config TAU
469 on-die temperature in /proc/cpuinfo if the cpu supports it. 500 on-die temperature in /proc/cpuinfo if the cpu supports it.
470 501
471 Unfortunately, on some chip revisions, this sensor is very inaccurate 502 Unfortunately, on some chip revisions, this sensor is very inaccurate
472 and in some cases, does not work at all, so don't assume the cpu 503 and in many cases, does not work at all, so don't assume the cpu
473 temp is actually what /proc/cpuinfo says it is. 504 temp is actually what /proc/cpuinfo says it is.
474 505
475config TAU_INT 506config TAU_INT
@@ -580,7 +611,7 @@ config KEXEC
580 strongly in flux, so no good recommendation can be made. 611 strongly in flux, so no good recommendation can be made.
581 612
582config CRASH_DUMP 613config CRASH_DUMP
583 bool "kernel crash dumps (EXPERIMENTAL)" 614 bool "Build a kdump crash kernel (EXPERIMENTAL)"
584 depends on PPC_MULTIPLATFORM && PPC64 && EXPERIMENTAL 615 depends on PPC_MULTIPLATFORM && PPC64 && EXPERIMENTAL
585 help 616 help
586 Build a kernel suitable for use as a kdump capture kernel. 617 Build a kernel suitable for use as a kdump capture kernel.
@@ -734,13 +765,12 @@ config GENERIC_ISA_DMA
734 765
735config PPC_I8259 766config PPC_I8259
736 bool 767 bool
737 default y if 85xx
738 default n 768 default n
739 769
740config PPC_INDIRECT_PCI 770config PPC_INDIRECT_PCI
741 bool 771 bool
742 depends on PCI 772 depends on PCI
743 default y if 40x || 44x || 85xx 773 default y if 40x || 44x
744 default n 774 default n
745 775
746config EISA 776config EISA
@@ -757,8 +787,8 @@ config MCA
757 bool 787 bool
758 788
759config PCI 789config PCI
760 bool "PCI support" if 40x || CPM2 || PPC_83xx || 85xx || PPC_MPC52xx || (EMBEDDED && PPC_ISERIES) 790 bool "PCI support" if 40x || CPM2 || PPC_83xx || PPC_85xx || PPC_MPC52xx || (EMBEDDED && PPC_ISERIES)
761 default y if !40x && !CPM2 && !8xx && !APUS && !PPC_83xx && !85xx 791 default y if !40x && !CPM2 && !8xx && !APUS && !PPC_83xx && !PPC_85xx
762 default PCI_PERMEDIA if !4xx && !CPM2 && !8xx && APUS 792 default PCI_PERMEDIA if !4xx && !CPM2 && !8xx && APUS
763 default PCI_QSPAN if !4xx && !CPM2 && 8xx 793 default PCI_QSPAN if !4xx && !CPM2 && 8xx
764 help 794 help
diff --git a/arch/powerpc/Kconfig.debug b/arch/powerpc/Kconfig.debug
index 9254806f7032..8d48e9e7162a 100644
--- a/arch/powerpc/Kconfig.debug
+++ b/arch/powerpc/Kconfig.debug
@@ -110,11 +110,6 @@ config SERIAL_TEXT_DEBUG
110 depends on 4xx || LOPEC || MV64X60 || PPLUS || PRPMC800 || \ 110 depends on 4xx || LOPEC || MV64X60 || PPLUS || PRPMC800 || \
111 PPC_GEN550 || PPC_MPC52xx 111 PPC_GEN550 || PPC_MPC52xx
112 112
113config PPC_OCP
114 bool
115 depends on IBM_OCP || XILINX_OCP
116 default y
117
118choice 113choice
119 prompt "Early debugging (dangerous)" 114 prompt "Early debugging (dangerous)"
120 bool 115 bool
diff --git a/arch/powerpc/Makefile b/arch/powerpc/Makefile
index 5500ab55d042..6ec84d37a337 100644
--- a/arch/powerpc/Makefile
+++ b/arch/powerpc/Makefile
@@ -129,13 +129,8 @@ core-y += arch/powerpc/kernel/ \
129 arch/powerpc/lib/ \ 129 arch/powerpc/lib/ \
130 arch/powerpc/sysdev/ \ 130 arch/powerpc/sysdev/ \
131 arch/powerpc/platforms/ 131 arch/powerpc/platforms/
132core-$(CONFIG_PPC32) += arch/ppc/kernel/ 132core-$(CONFIG_MATH_EMULATION) += arch/powerpc/math-emu/
133core-$(CONFIG_MATH_EMULATION) += arch/ppc/math-emu/
134core-$(CONFIG_XMON) += arch/powerpc/xmon/ 133core-$(CONFIG_XMON) += arch/powerpc/xmon/
135core-$(CONFIG_APUS) += arch/ppc/amiga/
136drivers-$(CONFIG_8xx) += arch/ppc/8xx_io/
137drivers-$(CONFIG_4xx) += arch/ppc/4xx_io/
138drivers-$(CONFIG_CPM2) += arch/ppc/8260_io/
139 134
140drivers-$(CONFIG_OPROFILE) += arch/powerpc/oprofile/ 135drivers-$(CONFIG_OPROFILE) += arch/powerpc/oprofile/
141 136
@@ -148,9 +143,9 @@ all: $(KBUILD_IMAGE)
148 143
149CPPFLAGS_vmlinux.lds := -Upowerpc 144CPPFLAGS_vmlinux.lds := -Upowerpc
150 145
151BOOT_TARGETS = zImage zImage.initrd znetboot znetboot.initrd vmlinux.sm uImage 146BOOT_TARGETS = zImage zImage.initrd znetboot znetboot.initrd vmlinux.sm uImage vmlinux.bin
152 147
153.PHONY: $(BOOT_TARGETS) 148PHONY += $(BOOT_TARGETS)
154 149
155boot := arch/$(ARCH)/boot 150boot := arch/$(ARCH)/boot
156 151
diff --git a/arch/powerpc/boot/crt0.S b/arch/powerpc/boot/crt0.S
index e0192c26037b..70e65b13e033 100644
--- a/arch/powerpc/boot/crt0.S
+++ b/arch/powerpc/boot/crt0.S
@@ -45,7 +45,8 @@ _zimage_start:
45 bdnz 2b 45 bdnz 2b
46 46
47 /* Do a cache flush for our text, in case OF didn't */ 47 /* Do a cache flush for our text, in case OF didn't */
483: lis r9,_start@h 483: lis r9,_start@ha
49 addi r9,r9,_start@l
49 add r9,r0,r9 50 add r9,r0,r9
50 lis r8,_etext@ha 51 lis r8,_etext@ha
51 addi r8,r8,_etext@l 52 addi r8,r8,_etext@l
@@ -53,7 +54,7 @@ _zimage_start:
534: dcbf r0,r9 544: dcbf r0,r9
54 icbi r0,r9 55 icbi r0,r9
55 addi r9,r9,0x20 56 addi r9,r9,0x20
56 cmplwi 0,r9,8 57 cmplw cr0,r9,r8
57 blt 4b 58 blt 4b
58 sync 59 sync
59 isync 60 isync
diff --git a/arch/powerpc/boot/install.sh b/arch/powerpc/boot/install.sh
index eacce9590816..b002bfd56786 100644
--- a/arch/powerpc/boot/install.sh
+++ b/arch/powerpc/boot/install.sh
@@ -1,7 +1,5 @@
1#!/bin/sh 1#!/bin/sh
2# 2#
3# arch/ppc64/boot/install.sh
4#
5# This file is subject to the terms and conditions of the GNU General Public 3# This file is subject to the terms and conditions of the GNU General Public
6# License. See the file "COPYING" in the main directory of this archive 4# License. See the file "COPYING" in the main directory of this archive
7# for more details. 5# for more details.
diff --git a/arch/powerpc/boot/main.c b/arch/powerpc/boot/main.c
index 55ec59867250..816446f0e497 100644
--- a/arch/powerpc/boot/main.c
+++ b/arch/powerpc/boot/main.c
@@ -152,7 +152,7 @@ static int is_elf64(void *hdr)
152 elf64ph = (Elf64_Phdr *)((unsigned long)elf64 + 152 elf64ph = (Elf64_Phdr *)((unsigned long)elf64 +
153 (unsigned long)elf64->e_phoff); 153 (unsigned long)elf64->e_phoff);
154 for (i = 0; i < (unsigned int)elf64->e_phnum; i++, elf64ph++) 154 for (i = 0; i < (unsigned int)elf64->e_phnum; i++, elf64ph++)
155 if (elf64ph->p_type == PT_LOAD && elf64ph->p_offset != 0) 155 if (elf64ph->p_type == PT_LOAD)
156 break; 156 break;
157 if (i >= (unsigned int)elf64->e_phnum) 157 if (i >= (unsigned int)elf64->e_phnum)
158 return 0; 158 return 0;
@@ -193,7 +193,7 @@ static int is_elf32(void *hdr)
193 elf32 = (Elf32_Ehdr *)elfheader; 193 elf32 = (Elf32_Ehdr *)elfheader;
194 elf32ph = (Elf32_Phdr *) ((unsigned long)elf32 + elf32->e_phoff); 194 elf32ph = (Elf32_Phdr *) ((unsigned long)elf32 + elf32->e_phoff);
195 for (i = 0; i < elf32->e_phnum; i++, elf32ph++) 195 for (i = 0; i < elf32->e_phnum; i++, elf32ph++)
196 if (elf32ph->p_type == PT_LOAD && elf32ph->p_offset != 0) 196 if (elf32ph->p_type == PT_LOAD)
197 break; 197 break;
198 if (i >= elf32->e_phnum) 198 if (i >= elf32->e_phnum)
199 return 0; 199 return 0;
diff --git a/arch/powerpc/configs/cell_defconfig b/arch/powerpc/configs/cell_defconfig
index 063b84f2cbea..fe22e54ab2b0 100644
--- a/arch/powerpc/configs/cell_defconfig
+++ b/arch/powerpc/configs/cell_defconfig
@@ -1,7 +1,7 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.15-rc5 3# Linux kernel version: 2.6.16
4# Tue Dec 20 15:59:26 2005 4# Thu Mar 23 20:48:09 2006
5# 5#
6CONFIG_PPC64=y 6CONFIG_PPC64=y
7CONFIG_64BIT=y 7CONFIG_64BIT=y
@@ -16,6 +16,10 @@ CONFIG_COMPAT=y
16CONFIG_SYSVIPC_COMPAT=y 16CONFIG_SYSVIPC_COMPAT=y
17CONFIG_SCHED_NO_NO_OMIT_FRAME_POINTER=y 17CONFIG_SCHED_NO_NO_OMIT_FRAME_POINTER=y
18CONFIG_ARCH_MAY_HAVE_PC_FDC=y 18CONFIG_ARCH_MAY_HAVE_PC_FDC=y
19CONFIG_PPC_OF=y
20CONFIG_PPC_UDBG_16550=y
21# CONFIG_GENERIC_TBSYNC is not set
22# CONFIG_DEFAULT_UIMAGE is not set
19 23
20# 24#
21# Processor support 25# Processor support
@@ -26,6 +30,7 @@ CONFIG_POWER4=y
26CONFIG_PPC_FPU=y 30CONFIG_PPC_FPU=y
27CONFIG_ALTIVEC=y 31CONFIG_ALTIVEC=y
28CONFIG_PPC_STD_MMU=y 32CONFIG_PPC_STD_MMU=y
33CONFIG_VIRT_CPU_ACCOUNTING=y
29CONFIG_SMP=y 34CONFIG_SMP=y
30CONFIG_NR_CPUS=4 35CONFIG_NR_CPUS=4
31 36
@@ -33,7 +38,6 @@ CONFIG_NR_CPUS=4
33# Code maturity level options 38# Code maturity level options
34# 39#
35CONFIG_EXPERIMENTAL=y 40CONFIG_EXPERIMENTAL=y
36CONFIG_CLEAN_COMPILE=y
37CONFIG_LOCK_KERNEL=y 41CONFIG_LOCK_KERNEL=y
38CONFIG_INIT_ENV_ARG_LIMIT=32 42CONFIG_INIT_ENV_ARG_LIMIT=32
39 43
@@ -48,9 +52,8 @@ CONFIG_SYSVIPC=y
48# CONFIG_BSD_PROCESS_ACCT is not set 52# CONFIG_BSD_PROCESS_ACCT is not set
49CONFIG_SYSCTL=y 53CONFIG_SYSCTL=y
50# CONFIG_AUDIT is not set 54# CONFIG_AUDIT is not set
51CONFIG_HOTPLUG=y 55CONFIG_IKCONFIG=y
52CONFIG_KOBJECT_UEVENT=y 56CONFIG_IKCONFIG_PROC=y
53# CONFIG_IKCONFIG is not set
54# CONFIG_CPUSETS is not set 57# CONFIG_CPUSETS is not set
55CONFIG_INITRAMFS_SOURCE="" 58CONFIG_INITRAMFS_SOURCE=""
56CONFIG_CC_OPTIMIZE_FOR_SIZE=y 59CONFIG_CC_OPTIMIZE_FOR_SIZE=y
@@ -58,8 +61,10 @@ CONFIG_CC_OPTIMIZE_FOR_SIZE=y
58CONFIG_KALLSYMS=y 61CONFIG_KALLSYMS=y
59# CONFIG_KALLSYMS_ALL is not set 62# CONFIG_KALLSYMS_ALL is not set
60# CONFIG_KALLSYMS_EXTRA_PASS is not set 63# CONFIG_KALLSYMS_EXTRA_PASS is not set
64CONFIG_HOTPLUG=y
61CONFIG_PRINTK=y 65CONFIG_PRINTK=y
62CONFIG_BUG=y 66CONFIG_BUG=y
67CONFIG_ELF_CORE=y
63CONFIG_BASE_FULL=y 68CONFIG_BASE_FULL=y
64CONFIG_FUTEX=y 69CONFIG_FUTEX=y
65CONFIG_EPOLL=y 70CONFIG_EPOLL=y
@@ -68,8 +73,10 @@ CONFIG_CC_ALIGN_FUNCTIONS=0
68CONFIG_CC_ALIGN_LABELS=0 73CONFIG_CC_ALIGN_LABELS=0
69CONFIG_CC_ALIGN_LOOPS=0 74CONFIG_CC_ALIGN_LOOPS=0
70CONFIG_CC_ALIGN_JUMPS=0 75CONFIG_CC_ALIGN_JUMPS=0
76CONFIG_SLAB=y
71# CONFIG_TINY_SHMEM is not set 77# CONFIG_TINY_SHMEM is not set
72CONFIG_BASE_SMALL=0 78CONFIG_BASE_SMALL=0
79# CONFIG_SLOB is not set
73 80
74# 81#
75# Loadable module support 82# Loadable module support
@@ -80,7 +87,7 @@ CONFIG_MODULE_UNLOAD=y
80CONFIG_OBSOLETE_MODPARM=y 87CONFIG_OBSOLETE_MODPARM=y
81# CONFIG_MODVERSIONS is not set 88# CONFIG_MODVERSIONS is not set
82# CONFIG_MODULE_SRCVERSION_ALL is not set 89# CONFIG_MODULE_SRCVERSION_ALL is not set
83# CONFIG_KMOD is not set 90CONFIG_KMOD=y
84CONFIG_STOP_MACHINE=y 91CONFIG_STOP_MACHINE=y
85 92
86# 93#
@@ -111,7 +118,6 @@ CONFIG_PPC_MULTIPLATFORM=y
111# CONFIG_PPC_PMAC is not set 118# CONFIG_PPC_PMAC is not set
112# CONFIG_PPC_MAPLE is not set 119# CONFIG_PPC_MAPLE is not set
113CONFIG_PPC_CELL=y 120CONFIG_PPC_CELL=y
114CONFIG_PPC_OF=y
115# CONFIG_U3_DART is not set 121# CONFIG_U3_DART is not set
116CONFIG_PPC_RTAS=y 122CONFIG_PPC_RTAS=y
117# CONFIG_RTAS_ERROR_LOGGING is not set 123# CONFIG_RTAS_ERROR_LOGGING is not set
@@ -120,11 +126,16 @@ CONFIG_RTAS_FLASH=y
120CONFIG_MMIO_NVRAM=y 126CONFIG_MMIO_NVRAM=y
121CONFIG_CELL_IIC=y 127CONFIG_CELL_IIC=y
122# CONFIG_PPC_MPC106 is not set 128# CONFIG_PPC_MPC106 is not set
123# CONFIG_GENERIC_TBSYNC is not set
124# CONFIG_CPU_FREQ is not set 129# CONFIG_CPU_FREQ is not set
125# CONFIG_WANT_EARLY_SERIAL is not set 130# CONFIG_WANT_EARLY_SERIAL is not set
126 131
127# 132#
133# Cell Broadband Engine options
134#
135CONFIG_SPU_FS=m
136CONFIG_SPUFS_MMAP=y
137
138#
128# Kernel options 139# Kernel options
129# 140#
130# CONFIG_HZ_100 is not set 141# CONFIG_HZ_100 is not set
@@ -136,23 +147,27 @@ CONFIG_PREEMPT_NONE=y
136# CONFIG_PREEMPT is not set 147# CONFIG_PREEMPT is not set
137CONFIG_PREEMPT_BKL=y 148CONFIG_PREEMPT_BKL=y
138CONFIG_BINFMT_ELF=y 149CONFIG_BINFMT_ELF=y
139# CONFIG_BINFMT_MISC is not set 150CONFIG_BINFMT_MISC=m
140CONFIG_FORCE_MAX_ZONEORDER=13 151CONFIG_FORCE_MAX_ZONEORDER=13
141# CONFIG_IOMMU_VMERGE is not set 152# CONFIG_IOMMU_VMERGE is not set
142CONFIG_KEXEC=y 153CONFIG_KEXEC=y
154# CONFIG_CRASH_DUMP is not set
143CONFIG_IRQ_ALL_CPUS=y 155CONFIG_IRQ_ALL_CPUS=y
144# CONFIG_NUMA is not set 156# CONFIG_NUMA is not set
145CONFIG_ARCH_SELECT_MEMORY_MODEL=y 157CONFIG_ARCH_SELECT_MEMORY_MODEL=y
146CONFIG_ARCH_FLATMEM_ENABLE=y 158CONFIG_ARCH_FLATMEM_ENABLE=y
147CONFIG_ARCH_SPARSEMEM_ENABLE=y 159CONFIG_ARCH_SPARSEMEM_ENABLE=y
148CONFIG_SELECT_MEMORY_MODEL=y 160CONFIG_SELECT_MEMORY_MODEL=y
149CONFIG_FLATMEM_MANUAL=y 161# CONFIG_FLATMEM_MANUAL is not set
150# CONFIG_DISCONTIGMEM_MANUAL is not set 162# CONFIG_DISCONTIGMEM_MANUAL is not set
151# CONFIG_SPARSEMEM_MANUAL is not set 163CONFIG_SPARSEMEM_MANUAL=y
152CONFIG_FLATMEM=y 164CONFIG_SPARSEMEM=y
153CONFIG_FLAT_NODE_MEM_MAP=y 165CONFIG_HAVE_MEMORY_PRESENT=y
154# CONFIG_SPARSEMEM_STATIC is not set 166# CONFIG_SPARSEMEM_STATIC is not set
167CONFIG_SPARSEMEM_EXTREME=y
168# CONFIG_MEMORY_HOTPLUG is not set
155CONFIG_SPLIT_PTLOCK_CPUS=4 169CONFIG_SPLIT_PTLOCK_CPUS=4
170CONFIG_MIGRATION=y
156# CONFIG_PPC_64K_PAGES is not set 171# CONFIG_PPC_64K_PAGES is not set
157CONFIG_SCHED_SMT=y 172CONFIG_SCHED_SMT=y
158CONFIG_PROC_DEVICETREE=y 173CONFIG_PROC_DEVICETREE=y
@@ -191,6 +206,7 @@ CONFIG_NET=y
191# 206#
192# Networking options 207# Networking options
193# 208#
209# CONFIG_NETDEBUG is not set
194CONFIG_PACKET=y 210CONFIG_PACKET=y
195# CONFIG_PACKET_MMAP is not set 211# CONFIG_PACKET_MMAP is not set
196CONFIG_UNIX=y 212CONFIG_UNIX=y
@@ -222,6 +238,7 @@ CONFIG_TCP_CONG_BIC=y
222# CONFIG_IP_VS is not set 238# CONFIG_IP_VS is not set
223CONFIG_IPV6=y 239CONFIG_IPV6=y
224# CONFIG_IPV6_PRIVACY is not set 240# CONFIG_IPV6_PRIVACY is not set
241# CONFIG_IPV6_ROUTER_PREF is not set
225CONFIG_INET6_AH=m 242CONFIG_INET6_AH=m
226CONFIG_INET6_ESP=m 243CONFIG_INET6_ESP=m
227CONFIG_INET6_IPCOMP=m 244CONFIG_INET6_IPCOMP=m
@@ -234,6 +251,7 @@ CONFIG_NETFILTER=y
234# Core Netfilter Configuration 251# Core Netfilter Configuration
235# 252#
236# CONFIG_NETFILTER_NETLINK is not set 253# CONFIG_NETFILTER_NETLINK is not set
254# CONFIG_NETFILTER_XTABLES is not set
237 255
238# 256#
239# IP: Netfilter Configuration 257# IP: Netfilter Configuration
@@ -249,69 +267,13 @@ CONFIG_IP_NF_IRC=m
249CONFIG_IP_NF_TFTP=m 267CONFIG_IP_NF_TFTP=m
250CONFIG_IP_NF_AMANDA=m 268CONFIG_IP_NF_AMANDA=m
251# CONFIG_IP_NF_PPTP is not set 269# CONFIG_IP_NF_PPTP is not set
270# CONFIG_IP_NF_H323 is not set
252CONFIG_IP_NF_QUEUE=m 271CONFIG_IP_NF_QUEUE=m
253CONFIG_IP_NF_IPTABLES=m
254CONFIG_IP_NF_MATCH_LIMIT=m
255CONFIG_IP_NF_MATCH_IPRANGE=m
256CONFIG_IP_NF_MATCH_MAC=m
257CONFIG_IP_NF_MATCH_PKTTYPE=m
258CONFIG_IP_NF_MATCH_MARK=m
259CONFIG_IP_NF_MATCH_MULTIPORT=m
260CONFIG_IP_NF_MATCH_TOS=m
261CONFIG_IP_NF_MATCH_RECENT=m
262CONFIG_IP_NF_MATCH_ECN=m
263CONFIG_IP_NF_MATCH_DSCP=m
264CONFIG_IP_NF_MATCH_AH_ESP=m
265CONFIG_IP_NF_MATCH_LENGTH=m
266CONFIG_IP_NF_MATCH_TTL=m
267CONFIG_IP_NF_MATCH_TCPMSS=m
268CONFIG_IP_NF_MATCH_HELPER=m
269CONFIG_IP_NF_MATCH_STATE=m
270CONFIG_IP_NF_MATCH_CONNTRACK=m
271CONFIG_IP_NF_MATCH_OWNER=m
272CONFIG_IP_NF_MATCH_ADDRTYPE=m
273CONFIG_IP_NF_MATCH_REALM=m
274CONFIG_IP_NF_MATCH_SCTP=m
275# CONFIG_IP_NF_MATCH_DCCP is not set
276CONFIG_IP_NF_MATCH_COMMENT=m
277CONFIG_IP_NF_MATCH_HASHLIMIT=m
278CONFIG_IP_NF_MATCH_STRING=m
279CONFIG_IP_NF_FILTER=m
280CONFIG_IP_NF_TARGET_REJECT=m
281CONFIG_IP_NF_TARGET_LOG=m
282CONFIG_IP_NF_TARGET_ULOG=m
283CONFIG_IP_NF_TARGET_TCPMSS=m
284CONFIG_IP_NF_TARGET_NFQUEUE=m
285CONFIG_IP_NF_NAT=m
286CONFIG_IP_NF_NAT_NEEDED=y
287CONFIG_IP_NF_TARGET_MASQUERADE=m
288CONFIG_IP_NF_TARGET_REDIRECT=m
289CONFIG_IP_NF_TARGET_NETMAP=m
290CONFIG_IP_NF_TARGET_SAME=m
291CONFIG_IP_NF_NAT_SNMP_BASIC=m
292CONFIG_IP_NF_NAT_IRC=m
293CONFIG_IP_NF_NAT_FTP=m
294CONFIG_IP_NF_NAT_TFTP=m
295CONFIG_IP_NF_NAT_AMANDA=m
296CONFIG_IP_NF_MANGLE=m
297CONFIG_IP_NF_TARGET_TOS=m
298CONFIG_IP_NF_TARGET_ECN=m
299CONFIG_IP_NF_TARGET_DSCP=m
300CONFIG_IP_NF_TARGET_MARK=m
301CONFIG_IP_NF_TARGET_CLASSIFY=m
302CONFIG_IP_NF_TARGET_TTL=m
303CONFIG_IP_NF_RAW=m
304CONFIG_IP_NF_TARGET_NOTRACK=m
305CONFIG_IP_NF_ARPTABLES=m
306CONFIG_IP_NF_ARPFILTER=m
307CONFIG_IP_NF_ARP_MANGLE=m
308 272
309# 273#
310# IPv6: Netfilter Configuration (EXPERIMENTAL) 274# IPv6: Netfilter Configuration (EXPERIMENTAL)
311# 275#
312# CONFIG_IP6_NF_QUEUE is not set 276# CONFIG_IP6_NF_QUEUE is not set
313# CONFIG_IP6_NF_IPTABLES is not set
314# CONFIG_IP6_NF_TARGET_NFQUEUE is not set
315 277
316# 278#
317# DCCP Configuration (EXPERIMENTAL) 279# DCCP Configuration (EXPERIMENTAL)
@@ -322,6 +284,11 @@ CONFIG_IP_NF_ARP_MANGLE=m
322# SCTP Configuration (EXPERIMENTAL) 284# SCTP Configuration (EXPERIMENTAL)
323# 285#
324# CONFIG_IP_SCTP is not set 286# CONFIG_IP_SCTP is not set
287
288#
289# TIPC Configuration (EXPERIMENTAL)
290#
291# CONFIG_TIPC is not set
325# CONFIG_ATM is not set 292# CONFIG_ATM is not set
326# CONFIG_BRIDGE is not set 293# CONFIG_BRIDGE is not set
327# CONFIG_VLAN_8021Q is not set 294# CONFIG_VLAN_8021Q is not set
@@ -339,7 +306,6 @@ CONFIG_IP_NF_ARP_MANGLE=m
339# QoS and/or fair queueing 306# QoS and/or fair queueing
340# 307#
341# CONFIG_NET_SCHED is not set 308# CONFIG_NET_SCHED is not set
342CONFIG_NET_CLS_ROUTE=y
343 309
344# 310#
345# Network testing 311# Network testing
@@ -392,7 +358,7 @@ CONFIG_FW_LOADER=y
392# CONFIG_BLK_DEV_COW_COMMON is not set 358# CONFIG_BLK_DEV_COW_COMMON is not set
393CONFIG_BLK_DEV_LOOP=y 359CONFIG_BLK_DEV_LOOP=y
394# CONFIG_BLK_DEV_CRYPTOLOOP is not set 360# CONFIG_BLK_DEV_CRYPTOLOOP is not set
395CONFIG_BLK_DEV_NBD=y 361# CONFIG_BLK_DEV_NBD is not set
396# CONFIG_BLK_DEV_SX8 is not set 362# CONFIG_BLK_DEV_SX8 is not set
397CONFIG_BLK_DEV_RAM=y 363CONFIG_BLK_DEV_RAM=y
398CONFIG_BLK_DEV_RAM_COUNT=16 364CONFIG_BLK_DEV_RAM_COUNT=16
@@ -468,7 +434,23 @@ CONFIG_IDEDMA_AUTO=y
468# 434#
469# Multi-device support (RAID and LVM) 435# Multi-device support (RAID and LVM)
470# 436#
471# CONFIG_MD is not set 437CONFIG_MD=y
438CONFIG_BLK_DEV_MD=m
439CONFIG_MD_LINEAR=m
440CONFIG_MD_RAID0=m
441CONFIG_MD_RAID1=m
442# CONFIG_MD_RAID10 is not set
443# CONFIG_MD_RAID5 is not set
444# CONFIG_MD_RAID6 is not set
445# CONFIG_MD_MULTIPATH is not set
446# CONFIG_MD_FAULTY is not set
447CONFIG_BLK_DEV_DM=m
448CONFIG_DM_CRYPT=m
449CONFIG_DM_SNAPSHOT=m
450CONFIG_DM_MIRROR=m
451CONFIG_DM_ZERO=m
452CONFIG_DM_MULTIPATH=m
453# CONFIG_DM_MULTIPATH_EMC is not set
472 454
473# 455#
474# Fusion MPT device support 456# Fusion MPT device support
@@ -532,7 +514,7 @@ CONFIG_MII=y
532# CONFIG_ACENIC is not set 514# CONFIG_ACENIC is not set
533# CONFIG_DL2K is not set 515# CONFIG_DL2K is not set
534CONFIG_E1000=m 516CONFIG_E1000=m
535# CONFIG_E1000_NAPI is not set 517CONFIG_E1000_NAPI=y
536# CONFIG_E1000_DISABLE_PACKET_SPLIT is not set 518# CONFIG_E1000_DISABLE_PACKET_SPLIT is not set
537# CONFIG_NS83820 is not set 519# CONFIG_NS83820 is not set
538# CONFIG_HAMACHI is not set 520# CONFIG_HAMACHI is not set
@@ -540,9 +522,11 @@ CONFIG_E1000=m
540# CONFIG_R8169 is not set 522# CONFIG_R8169 is not set
541# CONFIG_SIS190 is not set 523# CONFIG_SIS190 is not set
542CONFIG_SKGE=m 524CONFIG_SKGE=m
525# CONFIG_SKY2 is not set
543# CONFIG_SK98LIN is not set 526# CONFIG_SK98LIN is not set
544# CONFIG_TIGON3 is not set 527# CONFIG_TIGON3 is not set
545# CONFIG_BNX2 is not set 528# CONFIG_BNX2 is not set
529CONFIG_SPIDER_NET=m
546# CONFIG_MV643XX_ETH is not set 530# CONFIG_MV643XX_ETH is not set
547 531
548# 532#
@@ -628,13 +612,16 @@ CONFIG_VT=y
628CONFIG_VT_CONSOLE=y 612CONFIG_VT_CONSOLE=y
629CONFIG_HW_CONSOLE=y 613CONFIG_HW_CONSOLE=y
630CONFIG_SERIAL_NONSTANDARD=y 614CONFIG_SERIAL_NONSTANDARD=y
615# CONFIG_COMPUTONE is not set
631# CONFIG_ROCKETPORT is not set 616# CONFIG_ROCKETPORT is not set
632# CONFIG_CYCLADES is not set 617# CONFIG_CYCLADES is not set
633# CONFIG_DIGIEPCA is not set 618# CONFIG_DIGIEPCA is not set
619# CONFIG_MOXA_INTELLIO is not set
634# CONFIG_MOXA_SMARTIO is not set 620# CONFIG_MOXA_SMARTIO is not set
635# CONFIG_ISI is not set 621# CONFIG_ISI is not set
636# CONFIG_SYNCLINK is not set 622# CONFIG_SYNCLINK is not set
637# CONFIG_SYNCLINKMP is not set 623# CONFIG_SYNCLINKMP is not set
624# CONFIG_SYNCLINK_GT is not set
638# CONFIG_N_HDLC is not set 625# CONFIG_N_HDLC is not set
639# CONFIG_SPECIALIX is not set 626# CONFIG_SPECIALIX is not set
640# CONFIG_SX is not set 627# CONFIG_SX is not set
@@ -646,6 +633,7 @@ CONFIG_SERIAL_NONSTANDARD=y
646CONFIG_SERIAL_8250=y 633CONFIG_SERIAL_8250=y
647CONFIG_SERIAL_8250_CONSOLE=y 634CONFIG_SERIAL_8250_CONSOLE=y
648CONFIG_SERIAL_8250_NR_UARTS=4 635CONFIG_SERIAL_8250_NR_UARTS=4
636CONFIG_SERIAL_8250_RUNTIME_UARTS=4
649# CONFIG_SERIAL_8250_EXTENDED is not set 637# CONFIG_SERIAL_8250_EXTENDED is not set
650 638
651# 639#
@@ -656,6 +644,8 @@ CONFIG_SERIAL_CORE_CONSOLE=y
656# CONFIG_SERIAL_JSM is not set 644# CONFIG_SERIAL_JSM is not set
657CONFIG_UNIX98_PTYS=y 645CONFIG_UNIX98_PTYS=y
658# CONFIG_LEGACY_PTYS is not set 646# CONFIG_LEGACY_PTYS is not set
647CONFIG_HVC_DRIVER=y
648CONFIG_HVC_RTAS=y
659 649
660# 650#
661# IPMI 651# IPMI
@@ -672,14 +662,13 @@ CONFIG_WATCHDOG=y
672# Watchdog Device Drivers 662# Watchdog Device Drivers
673# 663#
674# CONFIG_SOFT_WATCHDOG is not set 664# CONFIG_SOFT_WATCHDOG is not set
675# CONFIG_WATCHDOG_RTAS is not set 665CONFIG_WATCHDOG_RTAS=y
676 666
677# 667#
678# PCI-based Watchdog Cards 668# PCI-based Watchdog Cards
679# 669#
680# CONFIG_PCIPCWATCHDOG is not set 670# CONFIG_PCIPCWATCHDOG is not set
681# CONFIG_WDTPCI is not set 671# CONFIG_WDTPCI is not set
682# CONFIG_RTC is not set
683CONFIG_GEN_RTC=y 672CONFIG_GEN_RTC=y
684# CONFIG_GEN_RTC_X is not set 673# CONFIG_GEN_RTC_X is not set
685# CONFIG_DTLK is not set 674# CONFIG_DTLK is not set
@@ -756,6 +745,12 @@ CONFIG_I2C_ALGOBIT=y
756# CONFIG_I2C_DEBUG_CHIP is not set 745# CONFIG_I2C_DEBUG_CHIP is not set
757 746
758# 747#
748# SPI support
749#
750# CONFIG_SPI is not set
751# CONFIG_SPI_MASTER is not set
752
753#
759# Dallas's 1-wire bus 754# Dallas's 1-wire bus
760# 755#
761# CONFIG_W1 is not set 756# CONFIG_W1 is not set
@@ -805,6 +800,7 @@ CONFIG_DUMMY_CONSOLE=y
805# 800#
806CONFIG_USB_ARCH_HAS_HCD=y 801CONFIG_USB_ARCH_HAS_HCD=y
807CONFIG_USB_ARCH_HAS_OHCI=y 802CONFIG_USB_ARCH_HAS_OHCI=y
803CONFIG_USB_ARCH_HAS_EHCI=y
808# CONFIG_USB is not set 804# CONFIG_USB is not set
809 805
810# 806#
@@ -824,10 +820,17 @@ CONFIG_USB_ARCH_HAS_OHCI=y
824# 820#
825# InfiniBand support 821# InfiniBand support
826# 822#
827# CONFIG_INFINIBAND is not set 823CONFIG_INFINIBAND=y
824CONFIG_INFINIBAND_USER_MAD=m
825CONFIG_INFINIBAND_USER_ACCESS=m
826CONFIG_INFINIBAND_MTHCA=m
827CONFIG_INFINIBAND_MTHCA_DEBUG=y
828CONFIG_INFINIBAND_IPOIB=m
829CONFIG_INFINIBAND_IPOIB_DEBUG=y
830CONFIG_INFINIBAND_IPOIB_DEBUG_DATA=y
828 831
829# 832#
830# SN Devices 833# EDAC - error detection and reporting (RAS) (EXPERIMENTAL)
831# 834#
832 835
833# 836#
@@ -847,6 +850,7 @@ CONFIG_FS_MBCACHE=y
847# CONFIG_JFS_FS is not set 850# CONFIG_JFS_FS is not set
848CONFIG_FS_POSIX_ACL=y 851CONFIG_FS_POSIX_ACL=y
849# CONFIG_XFS_FS is not set 852# CONFIG_XFS_FS is not set
853# CONFIG_OCFS2_FS is not set
850# CONFIG_MINIX_FS is not set 854# CONFIG_MINIX_FS is not set
851# CONFIG_ROMFS_FS is not set 855# CONFIG_ROMFS_FS is not set
852CONFIG_INOTIFY=y 856CONFIG_INOTIFY=y
@@ -886,6 +890,7 @@ CONFIG_HUGETLBFS=y
886CONFIG_HUGETLB_PAGE=y 890CONFIG_HUGETLB_PAGE=y
887CONFIG_RAMFS=y 891CONFIG_RAMFS=y
888# CONFIG_RELAYFS_FS is not set 892# CONFIG_RELAYFS_FS is not set
893# CONFIG_CONFIGFS_FS is not set
889 894
890# 895#
891# Miscellaneous filesystems 896# Miscellaneous filesystems
@@ -951,6 +956,7 @@ CONFIG_MSDOS_PARTITION=y
951# CONFIG_SGI_PARTITION is not set 956# CONFIG_SGI_PARTITION is not set
952# CONFIG_ULTRIX_PARTITION is not set 957# CONFIG_ULTRIX_PARTITION is not set
953# CONFIG_SUN_PARTITION is not set 958# CONFIG_SUN_PARTITION is not set
959# CONFIG_KARMA_PARTITION is not set
954CONFIG_EFI_PARTITION=y 960CONFIG_EFI_PARTITION=y
955 961
956# 962#
@@ -1006,10 +1012,6 @@ CONFIG_CRC32=y
1006# CONFIG_LIBCRC32C is not set 1012# CONFIG_LIBCRC32C is not set
1007CONFIG_ZLIB_INFLATE=m 1013CONFIG_ZLIB_INFLATE=m
1008CONFIG_ZLIB_DEFLATE=m 1014CONFIG_ZLIB_DEFLATE=m
1009CONFIG_TEXTSEARCH=y
1010CONFIG_TEXTSEARCH_KMP=m
1011CONFIG_TEXTSEARCH_BM=m
1012CONFIG_TEXTSEARCH_FSM=m
1013 1015
1014# 1016#
1015# Instrumentation Support 1017# Instrumentation Support
@@ -1021,18 +1023,20 @@ CONFIG_TEXTSEARCH_FSM=m
1021# Kernel hacking 1023# Kernel hacking
1022# 1024#
1023# CONFIG_PRINTK_TIME is not set 1025# CONFIG_PRINTK_TIME is not set
1024CONFIG_DEBUG_KERNEL=y
1025CONFIG_MAGIC_SYSRQ=y 1026CONFIG_MAGIC_SYSRQ=y
1027CONFIG_DEBUG_KERNEL=y
1026CONFIG_LOG_BUF_SHIFT=15 1028CONFIG_LOG_BUF_SHIFT=15
1027CONFIG_DETECT_SOFTLOCKUP=y 1029CONFIG_DETECT_SOFTLOCKUP=y
1028# CONFIG_SCHEDSTATS is not set 1030# CONFIG_SCHEDSTATS is not set
1029# CONFIG_DEBUG_SLAB is not set 1031# CONFIG_DEBUG_SLAB is not set
1032CONFIG_DEBUG_MUTEXES=y
1030# CONFIG_DEBUG_SPINLOCK is not set 1033# CONFIG_DEBUG_SPINLOCK is not set
1031CONFIG_DEBUG_SPINLOCK_SLEEP=y 1034CONFIG_DEBUG_SPINLOCK_SLEEP=y
1032# CONFIG_DEBUG_KOBJECT is not set 1035# CONFIG_DEBUG_KOBJECT is not set
1033# CONFIG_DEBUG_INFO is not set 1036# CONFIG_DEBUG_INFO is not set
1034CONFIG_DEBUG_FS=y 1037CONFIG_DEBUG_FS=y
1035# CONFIG_DEBUG_VM is not set 1038# CONFIG_DEBUG_VM is not set
1039# CONFIG_FORCED_INLINING is not set
1036# CONFIG_RCU_TORTURE_TEST is not set 1040# CONFIG_RCU_TORTURE_TEST is not set
1037# CONFIG_DEBUG_STACKOVERFLOW is not set 1041# CONFIG_DEBUG_STACKOVERFLOW is not set
1038# CONFIG_DEBUG_STACK_USAGE is not set 1042# CONFIG_DEBUG_STACK_USAGE is not set
@@ -1040,6 +1044,11 @@ CONFIG_DEBUGGER=y
1040# CONFIG_XMON is not set 1044# CONFIG_XMON is not set
1041CONFIG_IRQSTACKS=y 1045CONFIG_IRQSTACKS=y
1042# CONFIG_BOOTX_TEXT is not set 1046# CONFIG_BOOTX_TEXT is not set
1047# CONFIG_PPC_EARLY_DEBUG_LPAR is not set
1048# CONFIG_PPC_EARLY_DEBUG_G5 is not set
1049# CONFIG_PPC_EARLY_DEBUG_RTAS is not set
1050# CONFIG_PPC_EARLY_DEBUG_MAPLE is not set
1051# CONFIG_PPC_EARLY_DEBUG_ISERIES is not set
1043 1052
1044# 1053#
1045# Security options 1054# Security options
diff --git a/arch/powerpc/configs/iseries_defconfig b/arch/powerpc/configs/iseries_defconfig
index c775027947f9..1816a46742f6 100644
--- a/arch/powerpc/configs/iseries_defconfig
+++ b/arch/powerpc/configs/iseries_defconfig
@@ -1,7 +1,7 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.15-rc5 3# Linux kernel version: 2.6.16-rc6
4# Tue Dec 20 15:59:32 2005 4# Wed Mar 15 16:19:52 2006
5# 5#
6CONFIG_PPC64=y 6CONFIG_PPC64=y
7CONFIG_64BIT=y 7CONFIG_64BIT=y
@@ -16,6 +16,10 @@ CONFIG_COMPAT=y
16CONFIG_SYSVIPC_COMPAT=y 16CONFIG_SYSVIPC_COMPAT=y
17CONFIG_SCHED_NO_NO_OMIT_FRAME_POINTER=y 17CONFIG_SCHED_NO_NO_OMIT_FRAME_POINTER=y
18CONFIG_ARCH_MAY_HAVE_PC_FDC=y 18CONFIG_ARCH_MAY_HAVE_PC_FDC=y
19CONFIG_PPC_OF=y
20# CONFIG_PPC_UDBG_16550 is not set
21# CONFIG_GENERIC_TBSYNC is not set
22# CONFIG_DEFAULT_UIMAGE is not set
19 23
20# 24#
21# Processor support 25# Processor support
@@ -33,7 +37,6 @@ CONFIG_NR_CPUS=32
33# Code maturity level options 37# Code maturity level options
34# 38#
35CONFIG_EXPERIMENTAL=y 39CONFIG_EXPERIMENTAL=y
36CONFIG_CLEAN_COMPILE=y
37CONFIG_LOCK_KERNEL=y 40CONFIG_LOCK_KERNEL=y
38CONFIG_INIT_ENV_ARG_LIMIT=32 41CONFIG_INIT_ENV_ARG_LIMIT=32
39 42
@@ -49,8 +52,6 @@ CONFIG_POSIX_MQUEUE=y
49CONFIG_SYSCTL=y 52CONFIG_SYSCTL=y
50CONFIG_AUDIT=y 53CONFIG_AUDIT=y
51CONFIG_AUDITSYSCALL=y 54CONFIG_AUDITSYSCALL=y
52CONFIG_HOTPLUG=y
53CONFIG_KOBJECT_UEVENT=y
54CONFIG_IKCONFIG=y 55CONFIG_IKCONFIG=y
55CONFIG_IKCONFIG_PROC=y 56CONFIG_IKCONFIG_PROC=y
56# CONFIG_CPUSETS is not set 57# CONFIG_CPUSETS is not set
@@ -60,8 +61,10 @@ CONFIG_CC_OPTIMIZE_FOR_SIZE=y
60CONFIG_KALLSYMS=y 61CONFIG_KALLSYMS=y
61# CONFIG_KALLSYMS_ALL is not set 62# CONFIG_KALLSYMS_ALL is not set
62# CONFIG_KALLSYMS_EXTRA_PASS is not set 63# CONFIG_KALLSYMS_EXTRA_PASS is not set
64CONFIG_HOTPLUG=y
63CONFIG_PRINTK=y 65CONFIG_PRINTK=y
64CONFIG_BUG=y 66CONFIG_BUG=y
67CONFIG_ELF_CORE=y
65CONFIG_BASE_FULL=y 68CONFIG_BASE_FULL=y
66CONFIG_FUTEX=y 69CONFIG_FUTEX=y
67CONFIG_EPOLL=y 70CONFIG_EPOLL=y
@@ -70,8 +73,10 @@ CONFIG_CC_ALIGN_FUNCTIONS=0
70CONFIG_CC_ALIGN_LABELS=0 73CONFIG_CC_ALIGN_LABELS=0
71CONFIG_CC_ALIGN_LOOPS=0 74CONFIG_CC_ALIGN_LOOPS=0
72CONFIG_CC_ALIGN_JUMPS=0 75CONFIG_CC_ALIGN_JUMPS=0
76CONFIG_SLAB=y
73# CONFIG_TINY_SHMEM is not set 77# CONFIG_TINY_SHMEM is not set
74CONFIG_BASE_SMALL=0 78CONFIG_BASE_SMALL=0
79# CONFIG_SLOB is not set
75 80
76# 81#
77# Loadable module support 82# Loadable module support
@@ -113,7 +118,6 @@ CONFIG_PPC_ISERIES=y
113# CONFIG_MMIO_NVRAM is not set 118# CONFIG_MMIO_NVRAM is not set
114CONFIG_IBMVIO=y 119CONFIG_IBMVIO=y
115# CONFIG_PPC_MPC106 is not set 120# CONFIG_PPC_MPC106 is not set
116# CONFIG_GENERIC_TBSYNC is not set
117# CONFIG_CPU_FREQ is not set 121# CONFIG_CPU_FREQ is not set
118# CONFIG_WANT_EARLY_SERIAL is not set 122# CONFIG_WANT_EARLY_SERIAL is not set
119 123
@@ -183,6 +187,7 @@ CONFIG_NET=y
183# 187#
184# Networking options 188# Networking options
185# 189#
190# CONFIG_NETDEBUG is not set
186CONFIG_PACKET=y 191CONFIG_PACKET=y
187# CONFIG_PACKET_MMAP is not set 192# CONFIG_PACKET_MMAP is not set
188CONFIG_UNIX=y 193CONFIG_UNIX=y
@@ -220,6 +225,28 @@ CONFIG_NETFILTER=y
220# Core Netfilter Configuration 225# Core Netfilter Configuration
221# 226#
222# CONFIG_NETFILTER_NETLINK is not set 227# CONFIG_NETFILTER_NETLINK is not set
228CONFIG_NETFILTER_XTABLES=m
229CONFIG_NETFILTER_XT_TARGET_CLASSIFY=m
230CONFIG_NETFILTER_XT_TARGET_CONNMARK=m
231CONFIG_NETFILTER_XT_TARGET_MARK=m
232CONFIG_NETFILTER_XT_TARGET_NFQUEUE=m
233CONFIG_NETFILTER_XT_TARGET_NOTRACK=m
234CONFIG_NETFILTER_XT_MATCH_COMMENT=m
235CONFIG_NETFILTER_XT_MATCH_CONNBYTES=m
236CONFIG_NETFILTER_XT_MATCH_CONNMARK=m
237CONFIG_NETFILTER_XT_MATCH_CONNTRACK=m
238# CONFIG_NETFILTER_XT_MATCH_DCCP is not set
239CONFIG_NETFILTER_XT_MATCH_HELPER=m
240CONFIG_NETFILTER_XT_MATCH_LENGTH=m
241CONFIG_NETFILTER_XT_MATCH_LIMIT=m
242CONFIG_NETFILTER_XT_MATCH_MAC=m
243CONFIG_NETFILTER_XT_MATCH_MARK=m
244CONFIG_NETFILTER_XT_MATCH_PKTTYPE=m
245CONFIG_NETFILTER_XT_MATCH_REALM=m
246CONFIG_NETFILTER_XT_MATCH_SCTP=m
247CONFIG_NETFILTER_XT_MATCH_STATE=m
248CONFIG_NETFILTER_XT_MATCH_STRING=m
249CONFIG_NETFILTER_XT_MATCH_TCPMSS=m
223 250
224# 251#
225# IP: Netfilter Configuration 252# IP: Netfilter Configuration
@@ -237,39 +264,23 @@ CONFIG_IP_NF_AMANDA=m
237# CONFIG_IP_NF_PPTP is not set 264# CONFIG_IP_NF_PPTP is not set
238CONFIG_IP_NF_QUEUE=m 265CONFIG_IP_NF_QUEUE=m
239CONFIG_IP_NF_IPTABLES=m 266CONFIG_IP_NF_IPTABLES=m
240CONFIG_IP_NF_MATCH_LIMIT=m
241CONFIG_IP_NF_MATCH_IPRANGE=m 267CONFIG_IP_NF_MATCH_IPRANGE=m
242CONFIG_IP_NF_MATCH_MAC=m
243CONFIG_IP_NF_MATCH_PKTTYPE=m
244CONFIG_IP_NF_MATCH_MARK=m
245CONFIG_IP_NF_MATCH_MULTIPORT=m 268CONFIG_IP_NF_MATCH_MULTIPORT=m
246CONFIG_IP_NF_MATCH_TOS=m 269CONFIG_IP_NF_MATCH_TOS=m
247CONFIG_IP_NF_MATCH_RECENT=m 270CONFIG_IP_NF_MATCH_RECENT=m
248CONFIG_IP_NF_MATCH_ECN=m 271CONFIG_IP_NF_MATCH_ECN=m
249CONFIG_IP_NF_MATCH_DSCP=m 272CONFIG_IP_NF_MATCH_DSCP=m
250CONFIG_IP_NF_MATCH_AH_ESP=m 273CONFIG_IP_NF_MATCH_AH_ESP=m
251CONFIG_IP_NF_MATCH_LENGTH=m
252CONFIG_IP_NF_MATCH_TTL=m 274CONFIG_IP_NF_MATCH_TTL=m
253CONFIG_IP_NF_MATCH_TCPMSS=m
254CONFIG_IP_NF_MATCH_HELPER=m
255CONFIG_IP_NF_MATCH_STATE=m
256CONFIG_IP_NF_MATCH_CONNTRACK=m
257CONFIG_IP_NF_MATCH_OWNER=m 275CONFIG_IP_NF_MATCH_OWNER=m
258CONFIG_IP_NF_MATCH_ADDRTYPE=m 276CONFIG_IP_NF_MATCH_ADDRTYPE=m
259CONFIG_IP_NF_MATCH_REALM=m
260CONFIG_IP_NF_MATCH_SCTP=m
261# CONFIG_IP_NF_MATCH_DCCP is not set
262CONFIG_IP_NF_MATCH_COMMENT=m
263CONFIG_IP_NF_MATCH_CONNMARK=m
264CONFIG_IP_NF_MATCH_CONNBYTES=m
265CONFIG_IP_NF_MATCH_HASHLIMIT=m 277CONFIG_IP_NF_MATCH_HASHLIMIT=m
266CONFIG_IP_NF_MATCH_STRING=m 278CONFIG_IP_NF_MATCH_POLICY=m
267CONFIG_IP_NF_FILTER=m 279CONFIG_IP_NF_FILTER=m
268CONFIG_IP_NF_TARGET_REJECT=m 280CONFIG_IP_NF_TARGET_REJECT=m
269CONFIG_IP_NF_TARGET_LOG=m 281CONFIG_IP_NF_TARGET_LOG=m
270CONFIG_IP_NF_TARGET_ULOG=m 282CONFIG_IP_NF_TARGET_ULOG=m
271CONFIG_IP_NF_TARGET_TCPMSS=m 283CONFIG_IP_NF_TARGET_TCPMSS=m
272CONFIG_IP_NF_TARGET_NFQUEUE=m
273CONFIG_IP_NF_NAT=m 284CONFIG_IP_NF_NAT=m
274CONFIG_IP_NF_NAT_NEEDED=y 285CONFIG_IP_NF_NAT_NEEDED=y
275CONFIG_IP_NF_TARGET_MASQUERADE=m 286CONFIG_IP_NF_TARGET_MASQUERADE=m
@@ -285,13 +296,9 @@ CONFIG_IP_NF_MANGLE=m
285CONFIG_IP_NF_TARGET_TOS=m 296CONFIG_IP_NF_TARGET_TOS=m
286CONFIG_IP_NF_TARGET_ECN=m 297CONFIG_IP_NF_TARGET_ECN=m
287CONFIG_IP_NF_TARGET_DSCP=m 298CONFIG_IP_NF_TARGET_DSCP=m
288CONFIG_IP_NF_TARGET_MARK=m
289CONFIG_IP_NF_TARGET_CLASSIFY=m
290CONFIG_IP_NF_TARGET_TTL=m 299CONFIG_IP_NF_TARGET_TTL=m
291CONFIG_IP_NF_TARGET_CONNMARK=m
292CONFIG_IP_NF_TARGET_CLUSTERIP=m 300CONFIG_IP_NF_TARGET_CLUSTERIP=m
293CONFIG_IP_NF_RAW=m 301CONFIG_IP_NF_RAW=m
294CONFIG_IP_NF_TARGET_NOTRACK=m
295CONFIG_IP_NF_ARPTABLES=m 302CONFIG_IP_NF_ARPTABLES=m
296CONFIG_IP_NF_ARPFILTER=m 303CONFIG_IP_NF_ARPFILTER=m
297CONFIG_IP_NF_ARP_MANGLE=m 304CONFIG_IP_NF_ARP_MANGLE=m
@@ -305,6 +312,11 @@ CONFIG_IP_NF_ARP_MANGLE=m
305# SCTP Configuration (EXPERIMENTAL) 312# SCTP Configuration (EXPERIMENTAL)
306# 313#
307# CONFIG_IP_SCTP is not set 314# CONFIG_IP_SCTP is not set
315
316#
317# TIPC Configuration (EXPERIMENTAL)
318#
319# CONFIG_TIPC is not set
308# CONFIG_ATM is not set 320# CONFIG_ATM is not set
309# CONFIG_BRIDGE is not set 321# CONFIG_BRIDGE is not set
310# CONFIG_VLAN_8021Q is not set 322# CONFIG_VLAN_8021Q is not set
@@ -451,13 +463,7 @@ CONFIG_SCSI_IBMVSCSI=m
451# CONFIG_SCSI_IPR is not set 463# CONFIG_SCSI_IPR is not set
452# CONFIG_SCSI_QLOGIC_FC is not set 464# CONFIG_SCSI_QLOGIC_FC is not set
453# CONFIG_SCSI_QLOGIC_1280 is not set 465# CONFIG_SCSI_QLOGIC_1280 is not set
454CONFIG_SCSI_QLA2XXX=y 466# CONFIG_SCSI_QLA_FC is not set
455# CONFIG_SCSI_QLA21XX is not set
456# CONFIG_SCSI_QLA22XX is not set
457# CONFIG_SCSI_QLA2300 is not set
458# CONFIG_SCSI_QLA2322 is not set
459# CONFIG_SCSI_QLA6312 is not set
460# CONFIG_SCSI_QLA24XX is not set
461# CONFIG_SCSI_LPFC is not set 467# CONFIG_SCSI_LPFC is not set
462# CONFIG_SCSI_DC395x is not set 468# CONFIG_SCSI_DC395x is not set
463# CONFIG_SCSI_DC390T is not set 469# CONFIG_SCSI_DC390T is not set
@@ -574,6 +580,7 @@ CONFIG_E1000=m
574# CONFIG_R8169 is not set 580# CONFIG_R8169 is not set
575# CONFIG_SIS190 is not set 581# CONFIG_SIS190 is not set
576# CONFIG_SKGE is not set 582# CONFIG_SKGE is not set
583# CONFIG_SKY2 is not set
577# CONFIG_SK98LIN is not set 584# CONFIG_SK98LIN is not set
578# CONFIG_VIA_VELOCITY is not set 585# CONFIG_VIA_VELOCITY is not set
579# CONFIG_TIGON3 is not set 586# CONFIG_TIGON3 is not set
@@ -723,6 +730,12 @@ CONFIG_MAX_RAW_DEVS=256
723# CONFIG_I2C is not set 730# CONFIG_I2C is not set
724 731
725# 732#
733# SPI support
734#
735# CONFIG_SPI is not set
736# CONFIG_SPI_MASTER is not set
737
738#
726# Dallas's 1-wire bus 739# Dallas's 1-wire bus
727# 740#
728# CONFIG_W1 is not set 741# CONFIG_W1 is not set
@@ -788,7 +801,7 @@ CONFIG_USB_ARCH_HAS_OHCI=y
788# CONFIG_INFINIBAND is not set 801# CONFIG_INFINIBAND is not set
789 802
790# 803#
791# SN Devices 804# EDAC - error detection and reporting (RAS) (EXPERIMENTAL)
792# 805#
793 806
794# 807#
@@ -825,6 +838,7 @@ CONFIG_XFS_EXPORT=y
825CONFIG_XFS_SECURITY=y 838CONFIG_XFS_SECURITY=y
826CONFIG_XFS_POSIX_ACL=y 839CONFIG_XFS_POSIX_ACL=y
827# CONFIG_XFS_RT is not set 840# CONFIG_XFS_RT is not set
841# CONFIG_OCFS2_FS is not set
828# CONFIG_MINIX_FS is not set 842# CONFIG_MINIX_FS is not set
829# CONFIG_ROMFS_FS is not set 843# CONFIG_ROMFS_FS is not set
830CONFIG_INOTIFY=y 844CONFIG_INOTIFY=y
@@ -865,6 +879,7 @@ CONFIG_TMPFS=y
865# CONFIG_HUGETLB_PAGE is not set 879# CONFIG_HUGETLB_PAGE is not set
866CONFIG_RAMFS=y 880CONFIG_RAMFS=y
867# CONFIG_RELAYFS_FS is not set 881# CONFIG_RELAYFS_FS is not set
882# CONFIG_CONFIGFS_FS is not set
868 883
869# 884#
870# Miscellaneous filesystems 885# Miscellaneous filesystems
@@ -993,31 +1008,36 @@ CONFIG_TEXTSEARCH_FSM=m
993# 1008#
994# Instrumentation Support 1009# Instrumentation Support
995# 1010#
996CONFIG_PROFILING=y
997CONFIG_OPROFILE=y
998# CONFIG_KPROBES is not set 1011# CONFIG_KPROBES is not set
999 1012
1000# 1013#
1001# Kernel hacking 1014# Kernel hacking
1002# 1015#
1003# CONFIG_PRINTK_TIME is not set 1016# CONFIG_PRINTK_TIME is not set
1004CONFIG_DEBUG_KERNEL=y
1005CONFIG_MAGIC_SYSRQ=y 1017CONFIG_MAGIC_SYSRQ=y
1018CONFIG_DEBUG_KERNEL=y
1006CONFIG_LOG_BUF_SHIFT=17 1019CONFIG_LOG_BUF_SHIFT=17
1007CONFIG_DETECT_SOFTLOCKUP=y 1020CONFIG_DETECT_SOFTLOCKUP=y
1008# CONFIG_SCHEDSTATS is not set 1021# CONFIG_SCHEDSTATS is not set
1009# CONFIG_DEBUG_SLAB is not set 1022# CONFIG_DEBUG_SLAB is not set
1023# CONFIG_DEBUG_MUTEXES is not set
1010# CONFIG_DEBUG_SPINLOCK is not set 1024# CONFIG_DEBUG_SPINLOCK is not set
1011# CONFIG_DEBUG_SPINLOCK_SLEEP is not set 1025# CONFIG_DEBUG_SPINLOCK_SLEEP is not set
1012# CONFIG_DEBUG_KOBJECT is not set 1026# CONFIG_DEBUG_KOBJECT is not set
1013# CONFIG_DEBUG_INFO is not set 1027# CONFIG_DEBUG_INFO is not set
1014CONFIG_DEBUG_FS=y 1028CONFIG_DEBUG_FS=y
1015# CONFIG_DEBUG_VM is not set 1029# CONFIG_DEBUG_VM is not set
1030# CONFIG_FORCED_INLINING is not set
1016# CONFIG_RCU_TORTURE_TEST is not set 1031# CONFIG_RCU_TORTURE_TEST is not set
1017CONFIG_DEBUG_STACKOVERFLOW=y 1032CONFIG_DEBUG_STACKOVERFLOW=y
1018CONFIG_DEBUG_STACK_USAGE=y 1033CONFIG_DEBUG_STACK_USAGE=y
1019# CONFIG_DEBUGGER is not set 1034# CONFIG_DEBUGGER is not set
1020CONFIG_IRQSTACKS=y 1035CONFIG_IRQSTACKS=y
1036# CONFIG_PPC_EARLY_DEBUG_LPAR is not set
1037# CONFIG_PPC_EARLY_DEBUG_G5 is not set
1038# CONFIG_PPC_EARLY_DEBUG_RTAS is not set
1039# CONFIG_PPC_EARLY_DEBUG_MAPLE is not set
1040# CONFIG_PPC_EARLY_DEBUG_ISERIES is not set
1021 1041
1022# 1042#
1023# Security options 1043# Security options
diff --git a/arch/powerpc/configs/maple_defconfig b/arch/powerpc/configs/maple_defconfig
index 68194c03f6d1..80a0db43aeb7 100644
--- a/arch/powerpc/configs/maple_defconfig
+++ b/arch/powerpc/configs/maple_defconfig
@@ -1,7 +1,7 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.15-rc5 3# Linux kernel version: 2.6.16-rc6
4# Tue Dec 20 15:59:36 2005 4# Wed Mar 15 16:19:54 2006
5# 5#
6CONFIG_PPC64=y 6CONFIG_PPC64=y
7CONFIG_64BIT=y 7CONFIG_64BIT=y
@@ -16,6 +16,10 @@ CONFIG_COMPAT=y
16CONFIG_SYSVIPC_COMPAT=y 16CONFIG_SYSVIPC_COMPAT=y
17CONFIG_SCHED_NO_NO_OMIT_FRAME_POINTER=y 17CONFIG_SCHED_NO_NO_OMIT_FRAME_POINTER=y
18CONFIG_ARCH_MAY_HAVE_PC_FDC=y 18CONFIG_ARCH_MAY_HAVE_PC_FDC=y
19CONFIG_PPC_OF=y
20CONFIG_PPC_UDBG_16550=y
21CONFIG_GENERIC_TBSYNC=y
22# CONFIG_DEFAULT_UIMAGE is not set
19 23
20# 24#
21# Processor support 25# Processor support
@@ -32,7 +36,6 @@ CONFIG_NR_CPUS=2
32# Code maturity level options 36# Code maturity level options
33# 37#
34CONFIG_EXPERIMENTAL=y 38CONFIG_EXPERIMENTAL=y
35CONFIG_CLEAN_COMPILE=y
36CONFIG_LOCK_KERNEL=y 39CONFIG_LOCK_KERNEL=y
37CONFIG_INIT_ENV_ARG_LIMIT=32 40CONFIG_INIT_ENV_ARG_LIMIT=32
38 41
@@ -47,8 +50,6 @@ CONFIG_POSIX_MQUEUE=y
47# CONFIG_BSD_PROCESS_ACCT is not set 50# CONFIG_BSD_PROCESS_ACCT is not set
48CONFIG_SYSCTL=y 51CONFIG_SYSCTL=y
49# CONFIG_AUDIT is not set 52# CONFIG_AUDIT is not set
50# CONFIG_HOTPLUG is not set
51CONFIG_KOBJECT_UEVENT=y
52CONFIG_IKCONFIG=y 53CONFIG_IKCONFIG=y
53CONFIG_IKCONFIG_PROC=y 54CONFIG_IKCONFIG_PROC=y
54# CONFIG_CPUSETS is not set 55# CONFIG_CPUSETS is not set
@@ -58,8 +59,10 @@ CONFIG_CC_OPTIMIZE_FOR_SIZE=y
58CONFIG_KALLSYMS=y 59CONFIG_KALLSYMS=y
59CONFIG_KALLSYMS_ALL=y 60CONFIG_KALLSYMS_ALL=y
60# CONFIG_KALLSYMS_EXTRA_PASS is not set 61# CONFIG_KALLSYMS_EXTRA_PASS is not set
62CONFIG_HOTPLUG=y
61CONFIG_PRINTK=y 63CONFIG_PRINTK=y
62CONFIG_BUG=y 64CONFIG_BUG=y
65CONFIG_ELF_CORE=y
63CONFIG_BASE_FULL=y 66CONFIG_BASE_FULL=y
64CONFIG_FUTEX=y 67CONFIG_FUTEX=y
65CONFIG_EPOLL=y 68CONFIG_EPOLL=y
@@ -68,8 +71,10 @@ CONFIG_CC_ALIGN_FUNCTIONS=0
68CONFIG_CC_ALIGN_LABELS=0 71CONFIG_CC_ALIGN_LABELS=0
69CONFIG_CC_ALIGN_LOOPS=0 72CONFIG_CC_ALIGN_LOOPS=0
70CONFIG_CC_ALIGN_JUMPS=0 73CONFIG_CC_ALIGN_JUMPS=0
74CONFIG_SLAB=y
71# CONFIG_TINY_SHMEM is not set 75# CONFIG_TINY_SHMEM is not set
72CONFIG_BASE_SMALL=0 76CONFIG_BASE_SMALL=0
77# CONFIG_SLOB is not set
73 78
74# 79#
75# Loadable module support 80# Loadable module support
@@ -111,14 +116,12 @@ CONFIG_PPC_MULTIPLATFORM=y
111# CONFIG_PPC_PMAC is not set 116# CONFIG_PPC_PMAC is not set
112CONFIG_PPC_MAPLE=y 117CONFIG_PPC_MAPLE=y
113# CONFIG_PPC_CELL is not set 118# CONFIG_PPC_CELL is not set
114CONFIG_PPC_OF=y
115CONFIG_U3_DART=y 119CONFIG_U3_DART=y
116CONFIG_MPIC=y 120CONFIG_MPIC=y
117# CONFIG_PPC_RTAS is not set 121# CONFIG_PPC_RTAS is not set
118# CONFIG_MMIO_NVRAM is not set 122# CONFIG_MMIO_NVRAM is not set
119CONFIG_MPIC_BROKEN_U3=y 123CONFIG_MPIC_BROKEN_U3=y
120# CONFIG_PPC_MPC106 is not set 124# CONFIG_PPC_MPC106 is not set
121CONFIG_GENERIC_TBSYNC=y
122# CONFIG_CPU_FREQ is not set 125# CONFIG_CPU_FREQ is not set
123# CONFIG_WANT_EARLY_SERIAL is not set 126# CONFIG_WANT_EARLY_SERIAL is not set
124 127
@@ -138,6 +141,7 @@ CONFIG_BINFMT_ELF=y
138CONFIG_FORCE_MAX_ZONEORDER=13 141CONFIG_FORCE_MAX_ZONEORDER=13
139CONFIG_IOMMU_VMERGE=y 142CONFIG_IOMMU_VMERGE=y
140CONFIG_KEXEC=y 143CONFIG_KEXEC=y
144# CONFIG_CRASH_DUMP is not set
141CONFIG_IRQ_ALL_CPUS=y 145CONFIG_IRQ_ALL_CPUS=y
142# CONFIG_NUMA is not set 146# CONFIG_NUMA is not set
143CONFIG_ARCH_SELECT_MEMORY_MODEL=y 147CONFIG_ARCH_SELECT_MEMORY_MODEL=y
@@ -189,6 +193,7 @@ CONFIG_NET=y
189# 193#
190# Networking options 194# Networking options
191# 195#
196# CONFIG_NETDEBUG is not set
192CONFIG_PACKET=y 197CONFIG_PACKET=y
193CONFIG_PACKET_MMAP=y 198CONFIG_PACKET_MMAP=y
194CONFIG_UNIX=y 199CONFIG_UNIX=y
@@ -226,6 +231,11 @@ CONFIG_TCP_CONG_BIC=y
226# SCTP Configuration (EXPERIMENTAL) 231# SCTP Configuration (EXPERIMENTAL)
227# 232#
228# CONFIG_IP_SCTP is not set 233# CONFIG_IP_SCTP is not set
234
235#
236# TIPC Configuration (EXPERIMENTAL)
237#
238# CONFIG_TIPC is not set
229# CONFIG_ATM is not set 239# CONFIG_ATM is not set
230# CONFIG_BRIDGE is not set 240# CONFIG_BRIDGE is not set
231# CONFIG_VLAN_8021Q is not set 241# CONFIG_VLAN_8021Q is not set
@@ -461,6 +471,7 @@ CONFIG_E1000=y
461# CONFIG_R8169 is not set 471# CONFIG_R8169 is not set
462# CONFIG_SIS190 is not set 472# CONFIG_SIS190 is not set
463# CONFIG_SKGE is not set 473# CONFIG_SKGE is not set
474# CONFIG_SKY2 is not set
464# CONFIG_SK98LIN is not set 475# CONFIG_SK98LIN is not set
465# CONFIG_VIA_VELOCITY is not set 476# CONFIG_VIA_VELOCITY is not set
466# CONFIG_TIGON3 is not set 477# CONFIG_TIGON3 is not set
@@ -553,6 +564,7 @@ CONFIG_HW_CONSOLE=y
553CONFIG_SERIAL_8250=y 564CONFIG_SERIAL_8250=y
554CONFIG_SERIAL_8250_CONSOLE=y 565CONFIG_SERIAL_8250_CONSOLE=y
555CONFIG_SERIAL_8250_NR_UARTS=4 566CONFIG_SERIAL_8250_NR_UARTS=4
567CONFIG_SERIAL_8250_RUNTIME_UARTS=4
556# CONFIG_SERIAL_8250_EXTENDED is not set 568# CONFIG_SERIAL_8250_EXTENDED is not set
557 569
558# 570#
@@ -651,6 +663,12 @@ CONFIG_I2C_AMD8111=y
651# CONFIG_I2C_DEBUG_CHIP is not set 663# CONFIG_I2C_DEBUG_CHIP is not set
652 664
653# 665#
666# SPI support
667#
668# CONFIG_SPI is not set
669# CONFIG_SPI_MASTER is not set
670
671#
654# Dallas's 1-wire bus 672# Dallas's 1-wire bus
655# 673#
656# CONFIG_W1 is not set 674# CONFIG_W1 is not set
@@ -738,12 +756,14 @@ CONFIG_USB_UHCI_HCD=y
738# may also be needed; see USB_STORAGE Help for more information 756# may also be needed; see USB_STORAGE Help for more information
739# 757#
740# CONFIG_USB_STORAGE is not set 758# CONFIG_USB_STORAGE is not set
759# CONFIG_USB_LIBUSUAL is not set
741 760
742# 761#
743# USB Input Devices 762# USB Input Devices
744# 763#
745CONFIG_USB_HID=y 764CONFIG_USB_HID=y
746CONFIG_USB_HIDINPUT=y 765CONFIG_USB_HIDINPUT=y
766# CONFIG_USB_HIDINPUT_POWERBOOK is not set
747# CONFIG_HID_FF is not set 767# CONFIG_HID_FF is not set
748# CONFIG_USB_HIDDEV is not set 768# CONFIG_USB_HIDDEV is not set
749# CONFIG_USB_AIPTEK is not set 769# CONFIG_USB_AIPTEK is not set
@@ -757,6 +777,7 @@ CONFIG_USB_HIDINPUT=y
757# CONFIG_USB_YEALINK is not set 777# CONFIG_USB_YEALINK is not set
758# CONFIG_USB_XPAD is not set 778# CONFIG_USB_XPAD is not set
759# CONFIG_USB_ATI_REMOTE is not set 779# CONFIG_USB_ATI_REMOTE is not set
780# CONFIG_USB_ATI_REMOTE2 is not set
760# CONFIG_USB_KEYSPAN_REMOTE is not set 781# CONFIG_USB_KEYSPAN_REMOTE is not set
761# CONFIG_USB_APPLETOUCH is not set 782# CONFIG_USB_APPLETOUCH is not set
762 783
@@ -797,6 +818,7 @@ CONFIG_USB_SERIAL_GENERIC=y
797# CONFIG_USB_SERIAL_AIRPRIME is not set 818# CONFIG_USB_SERIAL_AIRPRIME is not set
798# CONFIG_USB_SERIAL_ANYDATA is not set 819# CONFIG_USB_SERIAL_ANYDATA is not set
799# CONFIG_USB_SERIAL_BELKIN is not set 820# CONFIG_USB_SERIAL_BELKIN is not set
821# CONFIG_USB_SERIAL_WHITEHEAT is not set
800# CONFIG_USB_SERIAL_DIGI_ACCELEPORT is not set 822# CONFIG_USB_SERIAL_DIGI_ACCELEPORT is not set
801# CONFIG_USB_SERIAL_CP2101 is not set 823# CONFIG_USB_SERIAL_CP2101 is not set
802CONFIG_USB_SERIAL_CYPRESS_M8=m 824CONFIG_USB_SERIAL_CYPRESS_M8=m
@@ -873,7 +895,7 @@ CONFIG_USB_EZUSB=y
873# CONFIG_INFINIBAND is not set 895# CONFIG_INFINIBAND is not set
874 896
875# 897#
876# SN Devices 898# EDAC - error detection and reporting (RAS) (EXPERIMENTAL)
877# 899#
878 900
879# 901#
@@ -891,6 +913,7 @@ CONFIG_JBD=y
891# CONFIG_JFS_FS is not set 913# CONFIG_JFS_FS is not set
892CONFIG_FS_POSIX_ACL=y 914CONFIG_FS_POSIX_ACL=y
893# CONFIG_XFS_FS is not set 915# CONFIG_XFS_FS is not set
916# CONFIG_OCFS2_FS is not set
894# CONFIG_MINIX_FS is not set 917# CONFIG_MINIX_FS is not set
895# CONFIG_ROMFS_FS is not set 918# CONFIG_ROMFS_FS is not set
896CONFIG_INOTIFY=y 919CONFIG_INOTIFY=y
@@ -927,6 +950,7 @@ CONFIG_HUGETLBFS=y
927CONFIG_HUGETLB_PAGE=y 950CONFIG_HUGETLB_PAGE=y
928CONFIG_RAMFS=y 951CONFIG_RAMFS=y
929# CONFIG_RELAYFS_FS is not set 952# CONFIG_RELAYFS_FS is not set
953# CONFIG_CONFIGFS_FS is not set
930 954
931# 955#
932# Miscellaneous filesystems 956# Miscellaneous filesystems
@@ -988,6 +1012,7 @@ CONFIG_MSDOS_PARTITION=y
988# CONFIG_SGI_PARTITION is not set 1012# CONFIG_SGI_PARTITION is not set
989# CONFIG_ULTRIX_PARTITION is not set 1013# CONFIG_ULTRIX_PARTITION is not set
990# CONFIG_SUN_PARTITION is not set 1014# CONFIG_SUN_PARTITION is not set
1015# CONFIG_KARMA_PARTITION is not set
991# CONFIG_EFI_PARTITION is not set 1016# CONFIG_EFI_PARTITION is not set
992 1017
993# 1018#
@@ -1053,18 +1078,20 @@ CONFIG_ZLIB_INFLATE=y
1053# Kernel hacking 1078# Kernel hacking
1054# 1079#
1055# CONFIG_PRINTK_TIME is not set 1080# CONFIG_PRINTK_TIME is not set
1056CONFIG_DEBUG_KERNEL=y
1057CONFIG_MAGIC_SYSRQ=y 1081CONFIG_MAGIC_SYSRQ=y
1082CONFIG_DEBUG_KERNEL=y
1058CONFIG_LOG_BUF_SHIFT=17 1083CONFIG_LOG_BUF_SHIFT=17
1059CONFIG_DETECT_SOFTLOCKUP=y 1084CONFIG_DETECT_SOFTLOCKUP=y
1060# CONFIG_SCHEDSTATS is not set 1085# CONFIG_SCHEDSTATS is not set
1061CONFIG_DEBUG_SLAB=y 1086CONFIG_DEBUG_SLAB=y
1087# CONFIG_DEBUG_MUTEXES is not set
1062# CONFIG_DEBUG_SPINLOCK is not set 1088# CONFIG_DEBUG_SPINLOCK is not set
1063CONFIG_DEBUG_SPINLOCK_SLEEP=y 1089CONFIG_DEBUG_SPINLOCK_SLEEP=y
1064# CONFIG_DEBUG_KOBJECT is not set 1090# CONFIG_DEBUG_KOBJECT is not set
1065# CONFIG_DEBUG_INFO is not set 1091# CONFIG_DEBUG_INFO is not set
1066CONFIG_DEBUG_FS=y 1092CONFIG_DEBUG_FS=y
1067# CONFIG_DEBUG_VM is not set 1093# CONFIG_DEBUG_VM is not set
1094# CONFIG_FORCED_INLINING is not set
1068# CONFIG_RCU_TORTURE_TEST is not set 1095# CONFIG_RCU_TORTURE_TEST is not set
1069CONFIG_DEBUG_STACKOVERFLOW=y 1096CONFIG_DEBUG_STACKOVERFLOW=y
1070CONFIG_DEBUG_STACK_USAGE=y 1097CONFIG_DEBUG_STACK_USAGE=y
@@ -1073,6 +1100,11 @@ CONFIG_XMON=y
1073CONFIG_XMON_DEFAULT=y 1100CONFIG_XMON_DEFAULT=y
1074# CONFIG_IRQSTACKS is not set 1101# CONFIG_IRQSTACKS is not set
1075CONFIG_BOOTX_TEXT=y 1102CONFIG_BOOTX_TEXT=y
1103# CONFIG_PPC_EARLY_DEBUG_LPAR is not set
1104# CONFIG_PPC_EARLY_DEBUG_G5 is not set
1105# CONFIG_PPC_EARLY_DEBUG_RTAS is not set
1106# CONFIG_PPC_EARLY_DEBUG_MAPLE is not set
1107# CONFIG_PPC_EARLY_DEBUG_ISERIES is not set
1076 1108
1077# 1109#
1078# Security options 1110# Security options
diff --git a/arch/powerpc/configs/mpc834x_sys_defconfig b/arch/powerpc/configs/mpc834x_sys_defconfig
index 3bff761965c2..5078b0441d61 100644
--- a/arch/powerpc/configs/mpc834x_sys_defconfig
+++ b/arch/powerpc/configs/mpc834x_sys_defconfig
@@ -1,7 +1,7 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.15-g461d4edf-dirty 3# Linux kernel version: 2.6.16-rc6
4# Fri Jan 13 11:01:47 2006 4# Wed Mar 15 16:19:56 2006
5# 5#
6# CONFIG_PPC64 is not set 6# CONFIG_PPC64 is not set
7CONFIG_PPC32=y 7CONFIG_PPC32=y
@@ -43,7 +43,6 @@ CONFIG_PPC_STD_MMU_32=y
43# Code maturity level options 43# Code maturity level options
44# 44#
45CONFIG_EXPERIMENTAL=y 45CONFIG_EXPERIMENTAL=y
46CONFIG_CLEAN_COMPILE=y
47CONFIG_BROKEN_ON_SMP=y 46CONFIG_BROKEN_ON_SMP=y
48CONFIG_INIT_ENV_ARG_LIMIT=32 47CONFIG_INIT_ENV_ARG_LIMIT=32
49 48
@@ -189,6 +188,7 @@ CONFIG_NET=y
189# 188#
190# Networking options 189# Networking options
191# 190#
191# CONFIG_NETDEBUG is not set
192CONFIG_PACKET=y 192CONFIG_PACKET=y
193# CONFIG_PACKET_MMAP is not set 193# CONFIG_PACKET_MMAP is not set
194CONFIG_UNIX=y 194CONFIG_UNIX=y
@@ -226,6 +226,11 @@ CONFIG_TCP_CONG_BIC=y
226# SCTP Configuration (EXPERIMENTAL) 226# SCTP Configuration (EXPERIMENTAL)
227# 227#
228# CONFIG_IP_SCTP is not set 228# CONFIG_IP_SCTP is not set
229
230#
231# TIPC Configuration (EXPERIMENTAL)
232#
233# CONFIG_TIPC is not set
229# CONFIG_ATM is not set 234# CONFIG_ATM is not set
230# CONFIG_BRIDGE is not set 235# CONFIG_BRIDGE is not set
231# CONFIG_VLAN_8021Q is not set 236# CONFIG_VLAN_8021Q is not set
@@ -511,6 +516,7 @@ CONFIG_SERIAL_8250_RUNTIME_UARTS=4
511# 516#
512CONFIG_SERIAL_CORE=y 517CONFIG_SERIAL_CORE=y
513CONFIG_SERIAL_CORE_CONSOLE=y 518CONFIG_SERIAL_CORE_CONSOLE=y
519# CONFIG_SERIAL_JSM is not set
514CONFIG_UNIX98_PTYS=y 520CONFIG_UNIX98_PTYS=y
515CONFIG_LEGACY_PTYS=y 521CONFIG_LEGACY_PTYS=y
516CONFIG_LEGACY_PTY_COUNT=256 522CONFIG_LEGACY_PTY_COUNT=256
@@ -615,6 +621,12 @@ CONFIG_I2C_MPC=y
615# CONFIG_I2C_DEBUG_CHIP is not set 621# CONFIG_I2C_DEBUG_CHIP is not set
616 622
617# 623#
624# SPI support
625#
626# CONFIG_SPI is not set
627# CONFIG_SPI_MASTER is not set
628
629#
618# Dallas's 1-wire bus 630# Dallas's 1-wire bus
619# 631#
620# CONFIG_W1 is not set 632# CONFIG_W1 is not set
@@ -632,6 +644,7 @@ CONFIG_HWMON=y
632# CONFIG_SENSORS_ASB100 is not set 644# CONFIG_SENSORS_ASB100 is not set
633# CONFIG_SENSORS_ATXP1 is not set 645# CONFIG_SENSORS_ATXP1 is not set
634# CONFIG_SENSORS_DS1621 is not set 646# CONFIG_SENSORS_DS1621 is not set
647# CONFIG_SENSORS_F71805F is not set
635# CONFIG_SENSORS_FSCHER is not set 648# CONFIG_SENSORS_FSCHER is not set
636# CONFIG_SENSORS_FSCPOS is not set 649# CONFIG_SENSORS_FSCPOS is not set
637# CONFIG_SENSORS_GL518SM is not set 650# CONFIG_SENSORS_GL518SM is not set
@@ -716,7 +729,7 @@ CONFIG_USB_ARCH_HAS_OHCI=y
716# CONFIG_INFINIBAND is not set 729# CONFIG_INFINIBAND is not set
717 730
718# 731#
719# SN Devices 732# EDAC - error detection and reporting (RAS) (EXPERIMENTAL)
720# 733#
721 734
722# 735#
@@ -826,6 +839,7 @@ CONFIG_PARTITION_ADVANCED=y
826# CONFIG_SGI_PARTITION is not set 839# CONFIG_SGI_PARTITION is not set
827# CONFIG_ULTRIX_PARTITION is not set 840# CONFIG_ULTRIX_PARTITION is not set
828# CONFIG_SUN_PARTITION is not set 841# CONFIG_SUN_PARTITION is not set
842# CONFIG_KARMA_PARTITION is not set
829# CONFIG_EFI_PARTITION is not set 843# CONFIG_EFI_PARTITION is not set
830 844
831# 845#
@@ -899,13 +913,3 @@ CONFIG_CRYPTO_DES=y
899# 913#
900# Hardware crypto devices 914# Hardware crypto devices
901# 915#
902
903#
904# SEC2.x Options
905#
906CONFIG_MPC8349E_SEC2x=y
907
908#
909# SEC2.x Test Options
910#
911CONFIG_MPC8349E_SEC2xTEST=y
diff --git a/arch/powerpc/configs/mpc8540_ads_defconfig b/arch/powerpc/configs/mpc8540_ads_defconfig
new file mode 100644
index 000000000000..7f0780f1aa39
--- /dev/null
+++ b/arch/powerpc/configs/mpc8540_ads_defconfig
@@ -0,0 +1,728 @@
1#
2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.16
4# Mon Mar 27 23:37:36 2006
5#
6# CONFIG_PPC64 is not set
7CONFIG_PPC32=y
8CONFIG_PPC_MERGE=y
9CONFIG_MMU=y
10CONFIG_GENERIC_HARDIRQS=y
11CONFIG_RWSEM_XCHGADD_ALGORITHM=y
12CONFIG_GENERIC_HWEIGHT=y
13CONFIG_GENERIC_CALIBRATE_DELAY=y
14CONFIG_PPC=y
15CONFIG_EARLY_PRINTK=y
16CONFIG_GENERIC_NVRAM=y
17CONFIG_SCHED_NO_NO_OMIT_FRAME_POINTER=y
18CONFIG_ARCH_MAY_HAVE_PC_FDC=y
19CONFIG_PPC_OF=y
20CONFIG_PPC_UDBG_16550=y
21# CONFIG_GENERIC_TBSYNC is not set
22CONFIG_DEFAULT_UIMAGE=y
23
24#
25# Processor support
26#
27# CONFIG_CLASSIC32 is not set
28# CONFIG_PPC_52xx is not set
29# CONFIG_PPC_82xx is not set
30# CONFIG_PPC_83xx is not set
31CONFIG_PPC_85xx=y
32# CONFIG_40x is not set
33# CONFIG_44x is not set
34# CONFIG_8xx is not set
35# CONFIG_E200 is not set
36CONFIG_85xx=y
37CONFIG_E500=y
38CONFIG_BOOKE=y
39CONFIG_FSL_BOOKE=y
40# CONFIG_PHYS_64BIT is not set
41CONFIG_SPE=y
42
43#
44# Code maturity level options
45#
46CONFIG_EXPERIMENTAL=y
47CONFIG_BROKEN_ON_SMP=y
48CONFIG_INIT_ENV_ARG_LIMIT=32
49
50#
51# General setup
52#
53CONFIG_LOCALVERSION=""
54CONFIG_LOCALVERSION_AUTO=y
55CONFIG_SWAP=y
56CONFIG_SYSVIPC=y
57# CONFIG_POSIX_MQUEUE is not set
58# CONFIG_BSD_PROCESS_ACCT is not set
59CONFIG_SYSCTL=y
60# CONFIG_AUDIT is not set
61# CONFIG_IKCONFIG is not set
62# CONFIG_RELAY is not set
63CONFIG_INITRAMFS_SOURCE=""
64# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
65CONFIG_EMBEDDED=y
66CONFIG_KALLSYMS=y
67# CONFIG_KALLSYMS_ALL is not set
68# CONFIG_KALLSYMS_EXTRA_PASS is not set
69CONFIG_HOTPLUG=y
70CONFIG_PRINTK=y
71CONFIG_BUG=y
72CONFIG_ELF_CORE=y
73CONFIG_BASE_FULL=y
74CONFIG_FUTEX=y
75CONFIG_EPOLL=y
76CONFIG_SHMEM=y
77CONFIG_SLAB=y
78# CONFIG_TINY_SHMEM is not set
79CONFIG_BASE_SMALL=0
80# CONFIG_SLOB is not set
81
82#
83# Loadable module support
84#
85# CONFIG_MODULES is not set
86
87#
88# Block layer
89#
90# CONFIG_LBD is not set
91# CONFIG_BLK_DEV_IO_TRACE is not set
92# CONFIG_LSF is not set
93
94#
95# IO Schedulers
96#
97CONFIG_IOSCHED_NOOP=y
98CONFIG_IOSCHED_AS=y
99CONFIG_IOSCHED_DEADLINE=y
100CONFIG_IOSCHED_CFQ=y
101CONFIG_DEFAULT_AS=y
102# CONFIG_DEFAULT_DEADLINE is not set
103# CONFIG_DEFAULT_CFQ is not set
104# CONFIG_DEFAULT_NOOP is not set
105CONFIG_DEFAULT_IOSCHED="anticipatory"
106CONFIG_MPIC=y
107# CONFIG_WANT_EARLY_SERIAL is not set
108
109#
110# Platform support
111#
112CONFIG_MPC8540_ADS=y
113CONFIG_MPC8540=y
114CONFIG_PPC_INDIRECT_PCI_BE=y
115
116#
117# Kernel options
118#
119# CONFIG_HIGHMEM is not set
120# CONFIG_HZ_100 is not set
121CONFIG_HZ_250=y
122# CONFIG_HZ_1000 is not set
123CONFIG_HZ=250
124CONFIG_PREEMPT_NONE=y
125# CONFIG_PREEMPT_VOLUNTARY is not set
126# CONFIG_PREEMPT is not set
127CONFIG_BINFMT_ELF=y
128CONFIG_BINFMT_MISC=y
129CONFIG_MATH_EMULATION=y
130CONFIG_ARCH_FLATMEM_ENABLE=y
131CONFIG_SELECT_MEMORY_MODEL=y
132CONFIG_FLATMEM_MANUAL=y
133# CONFIG_DISCONTIGMEM_MANUAL is not set
134# CONFIG_SPARSEMEM_MANUAL is not set
135CONFIG_FLATMEM=y
136CONFIG_FLAT_NODE_MEM_MAP=y
137# CONFIG_SPARSEMEM_STATIC is not set
138CONFIG_SPLIT_PTLOCK_CPUS=4
139CONFIG_PROC_DEVICETREE=y
140# CONFIG_CMDLINE_BOOL is not set
141# CONFIG_PM is not set
142# CONFIG_SOFTWARE_SUSPEND is not set
143# CONFIG_SECCOMP is not set
144CONFIG_ISA_DMA_API=y
145
146#
147# Bus options
148#
149# CONFIG_PPC_I8259 is not set
150CONFIG_PPC_INDIRECT_PCI=y
151CONFIG_FSL_SOC=y
152# CONFIG_PCI is not set
153# CONFIG_PCI_DOMAINS is not set
154
155#
156# PCCARD (PCMCIA/CardBus) support
157#
158# CONFIG_PCCARD is not set
159
160#
161# PCI Hotplug Support
162#
163
164#
165# Advanced setup
166#
167# CONFIG_ADVANCED_OPTIONS is not set
168
169#
170# Default settings for advanced configuration options are used
171#
172CONFIG_HIGHMEM_START=0xfe000000
173CONFIG_LOWMEM_SIZE=0x30000000
174CONFIG_KERNEL_START=0xc0000000
175CONFIG_TASK_SIZE=0x80000000
176CONFIG_BOOT_LOAD=0x00800000
177
178#
179# Networking
180#
181CONFIG_NET=y
182
183#
184# Networking options
185#
186# CONFIG_NETDEBUG is not set
187CONFIG_PACKET=y
188# CONFIG_PACKET_MMAP is not set
189CONFIG_UNIX=y
190# CONFIG_NET_KEY is not set
191CONFIG_INET=y
192CONFIG_IP_MULTICAST=y
193# CONFIG_IP_ADVANCED_ROUTER is not set
194CONFIG_IP_FIB_HASH=y
195CONFIG_IP_PNP=y
196CONFIG_IP_PNP_DHCP=y
197CONFIG_IP_PNP_BOOTP=y
198# CONFIG_IP_PNP_RARP is not set
199# CONFIG_NET_IPIP is not set
200# CONFIG_NET_IPGRE is not set
201# CONFIG_IP_MROUTE is not set
202# CONFIG_ARPD is not set
203CONFIG_SYN_COOKIES=y
204# CONFIG_INET_AH is not set
205# CONFIG_INET_ESP is not set
206# CONFIG_INET_IPCOMP is not set
207# CONFIG_INET_TUNNEL is not set
208CONFIG_INET_DIAG=y
209CONFIG_INET_TCP_DIAG=y
210# CONFIG_TCP_CONG_ADVANCED is not set
211CONFIG_TCP_CONG_BIC=y
212# CONFIG_IPV6 is not set
213# CONFIG_NETFILTER is not set
214
215#
216# DCCP Configuration (EXPERIMENTAL)
217#
218# CONFIG_IP_DCCP is not set
219
220#
221# SCTP Configuration (EXPERIMENTAL)
222#
223# CONFIG_IP_SCTP is not set
224
225#
226# TIPC Configuration (EXPERIMENTAL)
227#
228# CONFIG_TIPC is not set
229# CONFIG_ATM is not set
230# CONFIG_BRIDGE is not set
231# CONFIG_VLAN_8021Q is not set
232# CONFIG_DECNET is not set
233# CONFIG_LLC2 is not set
234# CONFIG_IPX is not set
235# CONFIG_ATALK is not set
236# CONFIG_X25 is not set
237# CONFIG_LAPB is not set
238# CONFIG_NET_DIVERT is not set
239# CONFIG_ECONET is not set
240# CONFIG_WAN_ROUTER is not set
241
242#
243# QoS and/or fair queueing
244#
245# CONFIG_NET_SCHED is not set
246
247#
248# Network testing
249#
250# CONFIG_NET_PKTGEN is not set
251# CONFIG_HAMRADIO is not set
252# CONFIG_IRDA is not set
253# CONFIG_BT is not set
254# CONFIG_IEEE80211 is not set
255
256#
257# Device Drivers
258#
259
260#
261# Generic Driver Options
262#
263CONFIG_STANDALONE=y
264CONFIG_PREVENT_FIRMWARE_BUILD=y
265# CONFIG_FW_LOADER is not set
266# CONFIG_DEBUG_DRIVER is not set
267
268#
269# Connector - unified userspace <-> kernelspace linker
270#
271# CONFIG_CONNECTOR is not set
272
273#
274# Memory Technology Devices (MTD)
275#
276# CONFIG_MTD is not set
277
278#
279# Parallel port support
280#
281# CONFIG_PARPORT is not set
282
283#
284# Plug and Play support
285#
286
287#
288# Block devices
289#
290# CONFIG_BLK_DEV_FD is not set
291# CONFIG_BLK_DEV_COW_COMMON is not set
292CONFIG_BLK_DEV_LOOP=y
293# CONFIG_BLK_DEV_CRYPTOLOOP is not set
294# CONFIG_BLK_DEV_NBD is not set
295CONFIG_BLK_DEV_RAM=y
296CONFIG_BLK_DEV_RAM_COUNT=16
297CONFIG_BLK_DEV_RAM_SIZE=32768
298CONFIG_BLK_DEV_INITRD=y
299# CONFIG_CDROM_PKTCDVD is not set
300# CONFIG_ATA_OVER_ETH is not set
301
302#
303# ATA/ATAPI/MFM/RLL support
304#
305# CONFIG_IDE is not set
306
307#
308# SCSI device support
309#
310# CONFIG_RAID_ATTRS is not set
311# CONFIG_SCSI is not set
312
313#
314# Multi-device support (RAID and LVM)
315#
316# CONFIG_MD is not set
317
318#
319# Fusion MPT device support
320#
321# CONFIG_FUSION is not set
322
323#
324# IEEE 1394 (FireWire) support
325#
326
327#
328# I2O device support
329#
330
331#
332# Macintosh device drivers
333#
334# CONFIG_WINDFARM is not set
335
336#
337# Network device support
338#
339CONFIG_NETDEVICES=y
340# CONFIG_DUMMY is not set
341# CONFIG_BONDING is not set
342# CONFIG_EQUALIZER is not set
343# CONFIG_TUN is not set
344
345#
346# PHY device support
347#
348CONFIG_PHYLIB=y
349
350#
351# MII PHY device drivers
352#
353# CONFIG_MARVELL_PHY is not set
354# CONFIG_DAVICOM_PHY is not set
355# CONFIG_QSEMI_PHY is not set
356# CONFIG_LXT_PHY is not set
357# CONFIG_CICADA_PHY is not set
358
359#
360# Ethernet (10 or 100Mbit)
361#
362CONFIG_NET_ETHERNET=y
363CONFIG_MII=y
364
365#
366# Ethernet (1000 Mbit)
367#
368CONFIG_GIANFAR=y
369CONFIG_GFAR_NAPI=y
370
371#
372# Ethernet (10000 Mbit)
373#
374
375#
376# Token Ring devices
377#
378
379#
380# Wireless LAN (non-hamradio)
381#
382# CONFIG_NET_RADIO is not set
383
384#
385# Wan interfaces
386#
387# CONFIG_WAN is not set
388# CONFIG_PPP is not set
389# CONFIG_SLIP is not set
390# CONFIG_SHAPER is not set
391# CONFIG_NETCONSOLE is not set
392# CONFIG_NETPOLL is not set
393# CONFIG_NET_POLL_CONTROLLER is not set
394
395#
396# ISDN subsystem
397#
398# CONFIG_ISDN is not set
399
400#
401# Telephony Support
402#
403# CONFIG_PHONE is not set
404
405#
406# Input device support
407#
408CONFIG_INPUT=y
409
410#
411# Userland interfaces
412#
413# CONFIG_INPUT_MOUSEDEV is not set
414# CONFIG_INPUT_JOYDEV is not set
415# CONFIG_INPUT_TSDEV is not set
416# CONFIG_INPUT_EVDEV is not set
417# CONFIG_INPUT_EVBUG is not set
418
419#
420# Input Device Drivers
421#
422# CONFIG_INPUT_KEYBOARD is not set
423# CONFIG_INPUT_MOUSE is not set
424# CONFIG_INPUT_JOYSTICK is not set
425# CONFIG_INPUT_TOUCHSCREEN is not set
426# CONFIG_INPUT_MISC is not set
427
428#
429# Hardware I/O ports
430#
431# CONFIG_SERIO is not set
432# CONFIG_GAMEPORT is not set
433
434#
435# Character devices
436#
437# CONFIG_VT is not set
438# CONFIG_SERIAL_NONSTANDARD is not set
439
440#
441# Serial drivers
442#
443CONFIG_SERIAL_8250=y
444CONFIG_SERIAL_8250_CONSOLE=y
445CONFIG_SERIAL_8250_NR_UARTS=4
446CONFIG_SERIAL_8250_RUNTIME_UARTS=4
447# CONFIG_SERIAL_8250_EXTENDED is not set
448
449#
450# Non-8250 serial port support
451#
452CONFIG_SERIAL_CORE=y
453CONFIG_SERIAL_CORE_CONSOLE=y
454CONFIG_UNIX98_PTYS=y
455CONFIG_LEGACY_PTYS=y
456CONFIG_LEGACY_PTY_COUNT=256
457
458#
459# IPMI
460#
461# CONFIG_IPMI_HANDLER is not set
462
463#
464# Watchdog Cards
465#
466# CONFIG_WATCHDOG is not set
467# CONFIG_NVRAM is not set
468CONFIG_GEN_RTC=y
469# CONFIG_GEN_RTC_X is not set
470# CONFIG_DTLK is not set
471# CONFIG_R3964 is not set
472
473#
474# Ftape, the floppy tape device driver
475#
476# CONFIG_AGP is not set
477# CONFIG_RAW_DRIVER is not set
478
479#
480# TPM devices
481#
482# CONFIG_TCG_TPM is not set
483# CONFIG_TELCLOCK is not set
484
485#
486# I2C support
487#
488# CONFIG_I2C is not set
489
490#
491# SPI support
492#
493# CONFIG_SPI is not set
494# CONFIG_SPI_MASTER is not set
495
496#
497# Dallas's 1-wire bus
498#
499# CONFIG_W1 is not set
500
501#
502# Hardware Monitoring support
503#
504CONFIG_HWMON=y
505# CONFIG_HWMON_VID is not set
506# CONFIG_SENSORS_F71805F is not set
507# CONFIG_HWMON_DEBUG_CHIP is not set
508
509#
510# Misc devices
511#
512
513#
514# Multimedia devices
515#
516# CONFIG_VIDEO_DEV is not set
517
518#
519# Digital Video Broadcasting Devices
520#
521# CONFIG_DVB is not set
522
523#
524# Graphics support
525#
526# CONFIG_FB is not set
527
528#
529# Sound
530#
531# CONFIG_SOUND is not set
532
533#
534# USB support
535#
536# CONFIG_USB_ARCH_HAS_HCD is not set
537# CONFIG_USB_ARCH_HAS_OHCI is not set
538# CONFIG_USB_ARCH_HAS_EHCI is not set
539
540#
541# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support'
542#
543
544#
545# USB Gadget Support
546#
547# CONFIG_USB_GADGET is not set
548
549#
550# MMC/SD Card support
551#
552# CONFIG_MMC is not set
553
554#
555# InfiniBand support
556#
557
558#
559# EDAC - error detection and reporting (RAS) (EXPERIMENTAL)
560#
561
562#
563# File systems
564#
565CONFIG_EXT2_FS=y
566# CONFIG_EXT2_FS_XATTR is not set
567# CONFIG_EXT2_FS_XIP is not set
568CONFIG_EXT3_FS=y
569CONFIG_EXT3_FS_XATTR=y
570# CONFIG_EXT3_FS_POSIX_ACL is not set
571# CONFIG_EXT3_FS_SECURITY is not set
572CONFIG_JBD=y
573# CONFIG_JBD_DEBUG is not set
574CONFIG_FS_MBCACHE=y
575# CONFIG_REISERFS_FS is not set
576# CONFIG_JFS_FS is not set
577# CONFIG_FS_POSIX_ACL is not set
578# CONFIG_XFS_FS is not set
579# CONFIG_OCFS2_FS is not set
580# CONFIG_MINIX_FS is not set
581# CONFIG_ROMFS_FS is not set
582CONFIG_INOTIFY=y
583# CONFIG_QUOTA is not set
584CONFIG_DNOTIFY=y
585# CONFIG_AUTOFS_FS is not set
586# CONFIG_AUTOFS4_FS is not set
587# CONFIG_FUSE_FS is not set
588
589#
590# CD-ROM/DVD Filesystems
591#
592# CONFIG_ISO9660_FS is not set
593# CONFIG_UDF_FS is not set
594
595#
596# DOS/FAT/NT Filesystems
597#
598# CONFIG_MSDOS_FS is not set
599# CONFIG_VFAT_FS is not set
600# CONFIG_NTFS_FS is not set
601
602#
603# Pseudo filesystems
604#
605CONFIG_PROC_FS=y
606CONFIG_PROC_KCORE=y
607CONFIG_SYSFS=y
608CONFIG_TMPFS=y
609# CONFIG_HUGETLB_PAGE is not set
610CONFIG_RAMFS=y
611# CONFIG_CONFIGFS_FS is not set
612
613#
614# Miscellaneous filesystems
615#
616# CONFIG_ADFS_FS is not set
617# CONFIG_AFFS_FS is not set
618# CONFIG_HFS_FS is not set
619# CONFIG_HFSPLUS_FS is not set
620# CONFIG_BEFS_FS is not set
621# CONFIG_BFS_FS is not set
622# CONFIG_EFS_FS is not set
623# CONFIG_CRAMFS is not set
624# CONFIG_VXFS_FS is not set
625# CONFIG_HPFS_FS is not set
626# CONFIG_QNX4FS_FS is not set
627# CONFIG_SYSV_FS is not set
628# CONFIG_UFS_FS is not set
629
630#
631# Network File Systems
632#
633CONFIG_NFS_FS=y
634# CONFIG_NFS_V3 is not set
635# CONFIG_NFS_V4 is not set
636# CONFIG_NFS_DIRECTIO is not set
637# CONFIG_NFSD is not set
638CONFIG_ROOT_NFS=y
639CONFIG_LOCKD=y
640CONFIG_NFS_COMMON=y
641CONFIG_SUNRPC=y
642# CONFIG_RPCSEC_GSS_KRB5 is not set
643# CONFIG_RPCSEC_GSS_SPKM3 is not set
644# CONFIG_SMB_FS is not set
645# CONFIG_CIFS is not set
646# CONFIG_NCP_FS is not set
647# CONFIG_CODA_FS is not set
648# CONFIG_AFS_FS is not set
649# CONFIG_9P_FS is not set
650
651#
652# Partition Types
653#
654CONFIG_PARTITION_ADVANCED=y
655# CONFIG_ACORN_PARTITION is not set
656# CONFIG_OSF_PARTITION is not set
657# CONFIG_AMIGA_PARTITION is not set
658# CONFIG_ATARI_PARTITION is not set
659# CONFIG_MAC_PARTITION is not set
660# CONFIG_MSDOS_PARTITION is not set
661# CONFIG_LDM_PARTITION is not set
662# CONFIG_SGI_PARTITION is not set
663# CONFIG_ULTRIX_PARTITION is not set
664# CONFIG_SUN_PARTITION is not set
665# CONFIG_KARMA_PARTITION is not set
666# CONFIG_EFI_PARTITION is not set
667
668#
669# Native Language Support
670#
671# CONFIG_NLS is not set
672
673#
674# Library routines
675#
676# CONFIG_CRC_CCITT is not set
677# CONFIG_CRC16 is not set
678CONFIG_CRC32=y
679# CONFIG_LIBCRC32C is not set
680
681#
682# Instrumentation Support
683#
684# CONFIG_PROFILING is not set
685
686#
687# Kernel hacking
688#
689# CONFIG_PRINTK_TIME is not set
690# CONFIG_MAGIC_SYSRQ is not set
691CONFIG_DEBUG_KERNEL=y
692CONFIG_LOG_BUF_SHIFT=14
693CONFIG_DETECT_SOFTLOCKUP=y
694# CONFIG_SCHEDSTATS is not set
695# CONFIG_DEBUG_SLAB is not set
696CONFIG_DEBUG_MUTEXES=y
697# CONFIG_DEBUG_SPINLOCK is not set
698# CONFIG_DEBUG_SPINLOCK_SLEEP is not set
699# CONFIG_DEBUG_KOBJECT is not set
700# CONFIG_DEBUG_INFO is not set
701# CONFIG_DEBUG_FS is not set
702# CONFIG_DEBUG_VM is not set
703# CONFIG_UNWIND_INFO is not set
704CONFIG_FORCED_INLINING=y
705# CONFIG_RCU_TORTURE_TEST is not set
706# CONFIG_DEBUGGER is not set
707# CONFIG_BDI_SWITCH is not set
708# CONFIG_BOOTX_TEXT is not set
709# CONFIG_PPC_EARLY_DEBUG_LPAR is not set
710# CONFIG_PPC_EARLY_DEBUG_G5 is not set
711# CONFIG_PPC_EARLY_DEBUG_RTAS is not set
712# CONFIG_PPC_EARLY_DEBUG_MAPLE is not set
713# CONFIG_PPC_EARLY_DEBUG_ISERIES is not set
714
715#
716# Security options
717#
718# CONFIG_KEYS is not set
719# CONFIG_SECURITY is not set
720
721#
722# Cryptographic options
723#
724# CONFIG_CRYPTO is not set
725
726#
727# Hardware crypto devices
728#
diff --git a/arch/powerpc/configs/pmac32_defconfig b/arch/powerpc/configs/pmac32_defconfig
index 2ace57d1e333..57a027971d67 100644
--- a/arch/powerpc/configs/pmac32_defconfig
+++ b/arch/powerpc/configs/pmac32_defconfig
@@ -1,7 +1,7 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.15 3# Linux kernel version: 2.6.16-rc6
4# Sat Jan 14 16:26:08 2006 4# Wed Mar 15 16:21:32 2006
5# 5#
6# CONFIG_PPC64 is not set 6# CONFIG_PPC64 is not set
7CONFIG_PPC32=y 7CONFIG_PPC32=y
@@ -17,8 +17,8 @@ CONFIG_SCHED_NO_NO_OMIT_FRAME_POINTER=y
17CONFIG_ARCH_MAY_HAVE_PC_FDC=y 17CONFIG_ARCH_MAY_HAVE_PC_FDC=y
18CONFIG_PPC_OF=y 18CONFIG_PPC_OF=y
19# CONFIG_PPC_UDBG_16550 is not set 19# CONFIG_PPC_UDBG_16550 is not set
20# CONFIG_CRASH_DUMP is not set
21# CONFIG_GENERIC_TBSYNC is not set 20# CONFIG_GENERIC_TBSYNC is not set
21# CONFIG_DEFAULT_UIMAGE is not set
22 22
23# 23#
24# Processor support 24# Processor support
@@ -43,7 +43,6 @@ CONFIG_PPC_STD_MMU_32=y
43# Code maturity level options 43# Code maturity level options
44# 44#
45CONFIG_EXPERIMENTAL=y 45CONFIG_EXPERIMENTAL=y
46CONFIG_CLEAN_COMPILE=y
47CONFIG_BROKEN_ON_SMP=y 46CONFIG_BROKEN_ON_SMP=y
48CONFIG_INIT_ENV_ARG_LIMIT=32 47CONFIG_INIT_ENV_ARG_LIMIT=32
49 48
@@ -236,6 +235,7 @@ CONFIG_NET=y
236# 235#
237# Networking options 236# Networking options
238# 237#
238# CONFIG_NETDEBUG is not set
239CONFIG_PACKET=y 239CONFIG_PACKET=y
240# CONFIG_PACKET_MMAP is not set 240# CONFIG_PACKET_MMAP is not set
241CONFIG_UNIX=y 241CONFIG_UNIX=y
@@ -271,6 +271,25 @@ CONFIG_NETFILTER=y
271# Core Netfilter Configuration 271# Core Netfilter Configuration
272# 272#
273# CONFIG_NETFILTER_NETLINK is not set 273# CONFIG_NETFILTER_NETLINK is not set
274CONFIG_NETFILTER_XTABLES=m
275CONFIG_NETFILTER_XT_TARGET_CLASSIFY=m
276CONFIG_NETFILTER_XT_TARGET_MARK=m
277CONFIG_NETFILTER_XT_TARGET_NFQUEUE=m
278CONFIG_NETFILTER_XT_TARGET_NOTRACK=m
279CONFIG_NETFILTER_XT_MATCH_COMMENT=m
280CONFIG_NETFILTER_XT_MATCH_CONNTRACK=m
281# CONFIG_NETFILTER_XT_MATCH_DCCP is not set
282CONFIG_NETFILTER_XT_MATCH_HELPER=m
283CONFIG_NETFILTER_XT_MATCH_LENGTH=m
284CONFIG_NETFILTER_XT_MATCH_LIMIT=m
285CONFIG_NETFILTER_XT_MATCH_MAC=m
286CONFIG_NETFILTER_XT_MATCH_MARK=m
287CONFIG_NETFILTER_XT_MATCH_PKTTYPE=m
288CONFIG_NETFILTER_XT_MATCH_REALM=m
289CONFIG_NETFILTER_XT_MATCH_SCTP=m
290CONFIG_NETFILTER_XT_MATCH_STATE=m
291CONFIG_NETFILTER_XT_MATCH_STRING=m
292CONFIG_NETFILTER_XT_MATCH_TCPMSS=m
274 293
275# 294#
276# IP: Netfilter Configuration 295# IP: Netfilter Configuration
@@ -288,37 +307,22 @@ CONFIG_IP_NF_AMANDA=m
288CONFIG_IP_NF_PPTP=m 307CONFIG_IP_NF_PPTP=m
289# CONFIG_IP_NF_QUEUE is not set 308# CONFIG_IP_NF_QUEUE is not set
290CONFIG_IP_NF_IPTABLES=m 309CONFIG_IP_NF_IPTABLES=m
291CONFIG_IP_NF_MATCH_LIMIT=m
292CONFIG_IP_NF_MATCH_IPRANGE=m 310CONFIG_IP_NF_MATCH_IPRANGE=m
293CONFIG_IP_NF_MATCH_MAC=m
294CONFIG_IP_NF_MATCH_PKTTYPE=m
295CONFIG_IP_NF_MATCH_MARK=m
296CONFIG_IP_NF_MATCH_MULTIPORT=m 311CONFIG_IP_NF_MATCH_MULTIPORT=m
297CONFIG_IP_NF_MATCH_TOS=m 312CONFIG_IP_NF_MATCH_TOS=m
298CONFIG_IP_NF_MATCH_RECENT=m 313CONFIG_IP_NF_MATCH_RECENT=m
299CONFIG_IP_NF_MATCH_ECN=m 314CONFIG_IP_NF_MATCH_ECN=m
300CONFIG_IP_NF_MATCH_DSCP=m 315CONFIG_IP_NF_MATCH_DSCP=m
301CONFIG_IP_NF_MATCH_AH_ESP=m 316CONFIG_IP_NF_MATCH_AH_ESP=m
302CONFIG_IP_NF_MATCH_LENGTH=m
303CONFIG_IP_NF_MATCH_TTL=m 317CONFIG_IP_NF_MATCH_TTL=m
304CONFIG_IP_NF_MATCH_TCPMSS=m
305CONFIG_IP_NF_MATCH_HELPER=m
306CONFIG_IP_NF_MATCH_STATE=m
307CONFIG_IP_NF_MATCH_CONNTRACK=m
308CONFIG_IP_NF_MATCH_OWNER=m 318CONFIG_IP_NF_MATCH_OWNER=m
309# CONFIG_IP_NF_MATCH_ADDRTYPE is not set 319CONFIG_IP_NF_MATCH_ADDRTYPE=m
310# CONFIG_IP_NF_MATCH_REALM is not set 320CONFIG_IP_NF_MATCH_HASHLIMIT=m
311# CONFIG_IP_NF_MATCH_SCTP is not set
312CONFIG_IP_NF_MATCH_DCCP=m
313# CONFIG_IP_NF_MATCH_COMMENT is not set
314# CONFIG_IP_NF_MATCH_HASHLIMIT is not set
315CONFIG_IP_NF_MATCH_STRING=m
316CONFIG_IP_NF_FILTER=m 321CONFIG_IP_NF_FILTER=m
317CONFIG_IP_NF_TARGET_REJECT=m 322CONFIG_IP_NF_TARGET_REJECT=m
318# CONFIG_IP_NF_TARGET_LOG is not set 323CONFIG_IP_NF_TARGET_LOG=m
319CONFIG_IP_NF_TARGET_ULOG=m 324CONFIG_IP_NF_TARGET_ULOG=m
320CONFIG_IP_NF_TARGET_TCPMSS=m 325CONFIG_IP_NF_TARGET_TCPMSS=m
321# CONFIG_IP_NF_TARGET_NFQUEUE is not set
322CONFIG_IP_NF_NAT=m 326CONFIG_IP_NF_NAT=m
323CONFIG_IP_NF_NAT_NEEDED=y 327CONFIG_IP_NF_NAT_NEEDED=y
324CONFIG_IP_NF_TARGET_MASQUERADE=m 328CONFIG_IP_NF_TARGET_MASQUERADE=m
@@ -331,9 +335,12 @@ CONFIG_IP_NF_NAT_FTP=m
331CONFIG_IP_NF_NAT_TFTP=m 335CONFIG_IP_NF_NAT_TFTP=m
332CONFIG_IP_NF_NAT_AMANDA=m 336CONFIG_IP_NF_NAT_AMANDA=m
333CONFIG_IP_NF_NAT_PPTP=m 337CONFIG_IP_NF_NAT_PPTP=m
334# CONFIG_IP_NF_MANGLE is not set 338CONFIG_IP_NF_MANGLE=m
339CONFIG_IP_NF_TARGET_TOS=m
340CONFIG_IP_NF_TARGET_ECN=m
341CONFIG_IP_NF_TARGET_DSCP=m
342CONFIG_IP_NF_TARGET_TTL=m
335CONFIG_IP_NF_RAW=m 343CONFIG_IP_NF_RAW=m
336CONFIG_IP_NF_TARGET_NOTRACK=m
337CONFIG_IP_NF_ARPTABLES=m 344CONFIG_IP_NF_ARPTABLES=m
338CONFIG_IP_NF_ARPFILTER=m 345CONFIG_IP_NF_ARPFILTER=m
339CONFIG_IP_NF_ARP_MANGLE=m 346CONFIG_IP_NF_ARP_MANGLE=m
@@ -360,6 +367,11 @@ CONFIG_IP_DCCP_TFRC_LIB=m
360# SCTP Configuration (EXPERIMENTAL) 367# SCTP Configuration (EXPERIMENTAL)
361# 368#
362# CONFIG_IP_SCTP is not set 369# CONFIG_IP_SCTP is not set
370
371#
372# TIPC Configuration (EXPERIMENTAL)
373#
374# CONFIG_TIPC is not set
363# CONFIG_ATM is not set 375# CONFIG_ATM is not set
364# CONFIG_BRIDGE is not set 376# CONFIG_BRIDGE is not set
365# CONFIG_VLAN_8021Q is not set 377# CONFIG_VLAN_8021Q is not set
@@ -377,6 +389,7 @@ CONFIG_IP_DCCP_TFRC_LIB=m
377# QoS and/or fair queueing 389# QoS and/or fair queueing
378# 390#
379# CONFIG_NET_SCHED is not set 391# CONFIG_NET_SCHED is not set
392CONFIG_NET_CLS_ROUTE=y
380 393
381# 394#
382# Network testing 395# Network testing
@@ -568,7 +581,6 @@ CONFIG_IDEDMA_PCI_AUTO=y
568# CONFIG_BLK_DEV_NS87415 is not set 581# CONFIG_BLK_DEV_NS87415 is not set
569# CONFIG_BLK_DEV_PDC202XX_OLD is not set 582# CONFIG_BLK_DEV_PDC202XX_OLD is not set
570CONFIG_BLK_DEV_PDC202XX_NEW=y 583CONFIG_BLK_DEV_PDC202XX_NEW=y
571# CONFIG_PDC202XX_FORCE is not set
572# CONFIG_BLK_DEV_SVWKS is not set 584# CONFIG_BLK_DEV_SVWKS is not set
573# CONFIG_BLK_DEV_SIIMAGE is not set 585# CONFIG_BLK_DEV_SIIMAGE is not set
574# CONFIG_BLK_DEV_SLC90E66 is not set 586# CONFIG_BLK_DEV_SLC90E66 is not set
@@ -654,8 +666,7 @@ CONFIG_SCSI_SYM53C8XX_MAX_TAGS=64
654# CONFIG_SCSI_IPR is not set 666# CONFIG_SCSI_IPR is not set
655# CONFIG_SCSI_QLOGIC_FC is not set 667# CONFIG_SCSI_QLOGIC_FC is not set
656# CONFIG_SCSI_QLOGIC_1280 is not set 668# CONFIG_SCSI_QLOGIC_1280 is not set
657CONFIG_SCSI_QLA2XXX=y 669# CONFIG_SCSI_QLA_FC is not set
658# CONFIG_SCSI_QLA2XXX_EMBEDDED_FIRMWARE is not set
659# CONFIG_SCSI_LPFC is not set 670# CONFIG_SCSI_LPFC is not set
660# CONFIG_SCSI_DC395x is not set 671# CONFIG_SCSI_DC395x is not set
661# CONFIG_SCSI_DC390T is not set 672# CONFIG_SCSI_DC390T is not set
@@ -991,6 +1002,7 @@ CONFIG_SERIAL_8250_RUNTIME_UARTS=4
991# 1002#
992CONFIG_SERIAL_CORE=m 1003CONFIG_SERIAL_CORE=m
993CONFIG_SERIAL_PMACZILOG=m 1004CONFIG_SERIAL_PMACZILOG=m
1005# CONFIG_SERIAL_JSM is not set
994CONFIG_UNIX98_PTYS=y 1006CONFIG_UNIX98_PTYS=y
995CONFIG_LEGACY_PTYS=y 1007CONFIG_LEGACY_PTYS=y
996CONFIG_LEGACY_PTY_COUNT=256 1008CONFIG_LEGACY_PTY_COUNT=256
@@ -1098,6 +1110,12 @@ CONFIG_I2C_POWERMAC=y
1098# CONFIG_I2C_DEBUG_CHIP is not set 1110# CONFIG_I2C_DEBUG_CHIP is not set
1099 1111
1100# 1112#
1113# SPI support
1114#
1115# CONFIG_SPI is not set
1116# CONFIG_SPI_MASTER is not set
1117
1118#
1101# Dallas's 1-wire bus 1119# Dallas's 1-wire bus
1102# 1120#
1103# CONFIG_W1 is not set 1121# CONFIG_W1 is not set
@@ -1348,6 +1366,7 @@ CONFIG_USB_PRINTER=m
1348# 1366#
1349CONFIG_USB_HID=y 1367CONFIG_USB_HID=y
1350CONFIG_USB_HIDINPUT=y 1368CONFIG_USB_HIDINPUT=y
1369CONFIG_USB_HIDINPUT_POWERBOOK=y
1351# CONFIG_HID_FF is not set 1370# CONFIG_HID_FF is not set
1352# CONFIG_USB_HIDDEV is not set 1371# CONFIG_USB_HIDDEV is not set
1353# CONFIG_USB_AIPTEK is not set 1372# CONFIG_USB_AIPTEK is not set
@@ -1488,7 +1507,7 @@ CONFIG_USB_EZUSB=y
1488# CONFIG_INFINIBAND is not set 1507# CONFIG_INFINIBAND is not set
1489 1508
1490# 1509#
1491# SN Devices 1510# EDAC - error detection and reporting (RAS) (EXPERIMENTAL)
1492# 1511#
1493 1512
1494# 1513#
@@ -1609,6 +1628,7 @@ CONFIG_MSDOS_PARTITION=y
1609# CONFIG_SGI_PARTITION is not set 1628# CONFIG_SGI_PARTITION is not set
1610# CONFIG_ULTRIX_PARTITION is not set 1629# CONFIG_ULTRIX_PARTITION is not set
1611# CONFIG_SUN_PARTITION is not set 1630# CONFIG_SUN_PARTITION is not set
1631# CONFIG_KARMA_PARTITION is not set
1612# CONFIG_EFI_PARTITION is not set 1632# CONFIG_EFI_PARTITION is not set
1613 1633
1614# 1634#
@@ -1692,6 +1712,7 @@ CONFIG_DETECT_SOFTLOCKUP=y
1692# CONFIG_DEBUG_INFO is not set 1712# CONFIG_DEBUG_INFO is not set
1693# CONFIG_DEBUG_FS is not set 1713# CONFIG_DEBUG_FS is not set
1694# CONFIG_DEBUG_VM is not set 1714# CONFIG_DEBUG_VM is not set
1715# CONFIG_FORCED_INLINING is not set
1695# CONFIG_RCU_TORTURE_TEST is not set 1716# CONFIG_RCU_TORTURE_TEST is not set
1696CONFIG_DEBUGGER=y 1717CONFIG_DEBUGGER=y
1697CONFIG_XMON=y 1718CONFIG_XMON=y
diff --git a/arch/powerpc/configs/ppc64_defconfig b/arch/powerpc/configs/ppc64_defconfig
index 0362a70aa97c..395e49847788 100644
--- a/arch/powerpc/configs/ppc64_defconfig
+++ b/arch/powerpc/configs/ppc64_defconfig
@@ -407,7 +407,7 @@ CONFIG_IDEPCI_SHARE_IRQ=y
407# CONFIG_BLK_DEV_OFFBOARD is not set 407# CONFIG_BLK_DEV_OFFBOARD is not set
408CONFIG_BLK_DEV_GENERIC=y 408CONFIG_BLK_DEV_GENERIC=y
409# CONFIG_BLK_DEV_OPTI621 is not set 409# CONFIG_BLK_DEV_OPTI621 is not set
410# CONFIG_BLK_DEV_SL82C105 is not set 410CONFIG_BLK_DEV_SL82C105=y
411CONFIG_BLK_DEV_IDEDMA_PCI=y 411CONFIG_BLK_DEV_IDEDMA_PCI=y
412# CONFIG_BLK_DEV_IDEDMA_FORCED is not set 412# CONFIG_BLK_DEV_IDEDMA_FORCED is not set
413CONFIG_IDEDMA_PCI_AUTO=y 413CONFIG_IDEDMA_PCI_AUTO=y
diff --git a/arch/powerpc/kernel/Makefile b/arch/powerpc/kernel/Makefile
index 80e9fe2632b8..0cc0995b81b0 100644
--- a/arch/powerpc/kernel/Makefile
+++ b/arch/powerpc/kernel/Makefile
@@ -12,12 +12,12 @@ endif
12 12
13obj-y := semaphore.o cputable.o ptrace.o syscalls.o \ 13obj-y := semaphore.o cputable.o ptrace.o syscalls.o \
14 irq.o align.o signal_32.o pmc.o vdso.o \ 14 irq.o align.o signal_32.o pmc.o vdso.o \
15 init_task.o process.o systbl.o 15 init_task.o process.o systbl.o idle.o
16obj-y += vdso32/ 16obj-y += vdso32/
17obj-$(CONFIG_PPC64) += setup_64.o binfmt_elf32.o sys_ppc32.o \ 17obj-$(CONFIG_PPC64) += setup_64.o binfmt_elf32.o sys_ppc32.o \
18 signal_64.o ptrace32.o \ 18 signal_64.o ptrace32.o \
19 paca.o cpu_setup_power4.o \ 19 paca.o cpu_setup_power4.o \
20 firmware.o sysfs.o idle_64.o 20 firmware.o sysfs.o
21obj-$(CONFIG_PPC64) += vdso64/ 21obj-$(CONFIG_PPC64) += vdso64/
22obj-$(CONFIG_ALTIVEC) += vecemu.o vector.o 22obj-$(CONFIG_ALTIVEC) += vecemu.o vector.o
23obj-$(CONFIG_POWER4) += idle_power4.o 23obj-$(CONFIG_POWER4) += idle_power4.o
@@ -34,6 +34,11 @@ obj-$(CONFIG_IBMEBUS) += ibmebus.o
34obj-$(CONFIG_GENERIC_TBSYNC) += smp-tbsync.o 34obj-$(CONFIG_GENERIC_TBSYNC) += smp-tbsync.o
35obj64-$(CONFIG_PPC_MULTIPLATFORM) += nvram_64.o 35obj64-$(CONFIG_PPC_MULTIPLATFORM) += nvram_64.o
36obj-$(CONFIG_CRASH_DUMP) += crash_dump.o 36obj-$(CONFIG_CRASH_DUMP) += crash_dump.o
37obj-$(CONFIG_6xx) += idle_6xx.o l2cr_6xx.o cpu_setup_6xx.o
38obj-$(CONFIG_TAU) += tau_6xx.o
39obj32-$(CONFIG_SOFTWARE_SUSPEND) += swsusp_32.o
40obj32-$(CONFIG_MODULES) += module_32.o
41obj-$(CONFIG_E500) += perfmon_fsl_booke.o
37 42
38ifeq ($(CONFIG_PPC_MERGE),y) 43ifeq ($(CONFIG_PPC_MERGE),y)
39 44
@@ -51,7 +56,6 @@ obj-$(CONFIG_PPC64) += misc_64.o dma_64.o iommu.o
51obj-$(CONFIG_PPC_MULTIPLATFORM) += prom_init.o 56obj-$(CONFIG_PPC_MULTIPLATFORM) += prom_init.o
52obj-$(CONFIG_MODULES) += ppc_ksyms.o 57obj-$(CONFIG_MODULES) += ppc_ksyms.o
53obj-$(CONFIG_BOOTX_TEXT) += btext.o 58obj-$(CONFIG_BOOTX_TEXT) += btext.o
54obj-$(CONFIG_6xx) += idle_6xx.o
55obj-$(CONFIG_SMP) += smp.o 59obj-$(CONFIG_SMP) += smp.o
56obj-$(CONFIG_KPROBES) += kprobes.o 60obj-$(CONFIG_KPROBES) += kprobes.o
57obj-$(CONFIG_PPC_UDBG_16550) += legacy_serial.o udbg_16550.o 61obj-$(CONFIG_PPC_UDBG_16550) += legacy_serial.o udbg_16550.o
@@ -77,6 +81,7 @@ smpobj-$(CONFIG_SMP) += smp.o
77 81
78endif 82endif
79 83
84obj-$(CONFIG_PPC32) += $(obj32-y)
80obj-$(CONFIG_PPC64) += $(obj64-y) 85obj-$(CONFIG_PPC64) += $(obj64-y)
81 86
82extra-$(CONFIG_PPC_FPU) += fpu.o 87extra-$(CONFIG_PPC_FPU) += fpu.o
diff --git a/arch/powerpc/kernel/asm-offsets.c b/arch/powerpc/kernel/asm-offsets.c
index c9a660e4c2db..54b48f330051 100644
--- a/arch/powerpc/kernel/asm-offsets.c
+++ b/arch/powerpc/kernel/asm-offsets.c
@@ -105,8 +105,6 @@ int main(void)
105 DEFINE(ICACHEL1LINESIZE, offsetof(struct ppc64_caches, iline_size)); 105 DEFINE(ICACHEL1LINESIZE, offsetof(struct ppc64_caches, iline_size));
106 DEFINE(ICACHEL1LOGLINESIZE, offsetof(struct ppc64_caches, log_iline_size)); 106 DEFINE(ICACHEL1LOGLINESIZE, offsetof(struct ppc64_caches, log_iline_size));
107 DEFINE(ICACHEL1LINESPERPAGE, offsetof(struct ppc64_caches, ilines_per_page)); 107 DEFINE(ICACHEL1LINESPERPAGE, offsetof(struct ppc64_caches, ilines_per_page));
108 DEFINE(PLATFORM_LPAR, PLATFORM_LPAR);
109
110 /* paca */ 108 /* paca */
111 DEFINE(PACA_SIZE, sizeof(struct paca_struct)); 109 DEFINE(PACA_SIZE, sizeof(struct paca_struct));
112 DEFINE(PACAPACAINDEX, offsetof(struct paca_struct, paca_index)); 110 DEFINE(PACAPACAINDEX, offsetof(struct paca_struct, paca_index));
@@ -136,6 +134,9 @@ int main(void)
136 DEFINE(PACAEMERGSP, offsetof(struct paca_struct, emergency_sp)); 134 DEFINE(PACAEMERGSP, offsetof(struct paca_struct, emergency_sp));
137 DEFINE(PACALPPACAPTR, offsetof(struct paca_struct, lppaca_ptr)); 135 DEFINE(PACALPPACAPTR, offsetof(struct paca_struct, lppaca_ptr));
138 DEFINE(PACAHWCPUID, offsetof(struct paca_struct, hw_cpu_id)); 136 DEFINE(PACAHWCPUID, offsetof(struct paca_struct, hw_cpu_id));
137 DEFINE(PACA_STARTPURR, offsetof(struct paca_struct, startpurr));
138 DEFINE(PACA_USER_TIME, offsetof(struct paca_struct, user_time));
139 DEFINE(PACA_SYSTEM_TIME, offsetof(struct paca_struct, system_time));
139 140
140 DEFINE(LPPACASRR0, offsetof(struct lppaca, saved_srr0)); 141 DEFINE(LPPACASRR0, offsetof(struct lppaca, saved_srr0));
141 DEFINE(LPPACASRR1, offsetof(struct lppaca, saved_srr1)); 142 DEFINE(LPPACASRR1, offsetof(struct lppaca, saved_srr1));
diff --git a/arch/ppc/kernel/cpu_setup_6xx.S b/arch/powerpc/kernel/cpu_setup_6xx.S
index 55ed7716636f..55ed7716636f 100644
--- a/arch/ppc/kernel/cpu_setup_6xx.S
+++ b/arch/powerpc/kernel/cpu_setup_6xx.S
diff --git a/arch/powerpc/kernel/cputable.c b/arch/powerpc/kernel/cputable.c
index e4e81374cb9a..39e348a3ade2 100644
--- a/arch/powerpc/kernel/cputable.c
+++ b/arch/powerpc/kernel/cputable.c
@@ -894,7 +894,7 @@ struct cpu_spec cpu_specs[] = {
894 .platform = "ppc405", 894 .platform = "ppc405",
895 }, 895 },
896 { /* Xilinx Virtex-II Pro */ 896 { /* Xilinx Virtex-II Pro */
897 .pvr_mask = 0xffff0000, 897 .pvr_mask = 0xfffff000,
898 .pvr_value = 0x20010000, 898 .pvr_value = 0x20010000,
899 .cpu_name = "Virtex-II Pro", 899 .cpu_name = "Virtex-II Pro",
900 .cpu_features = CPU_FTRS_40X, 900 .cpu_features = CPU_FTRS_40X,
@@ -904,6 +904,16 @@ struct cpu_spec cpu_specs[] = {
904 .dcache_bsize = 32, 904 .dcache_bsize = 32,
905 .platform = "ppc405", 905 .platform = "ppc405",
906 }, 906 },
907 { /* Xilinx Virtex-4 FX */
908 .pvr_mask = 0xfffff000,
909 .pvr_value = 0x20011000,
910 .cpu_name = "Virtex-4 FX",
911 .cpu_features = CPU_FTRS_40X,
912 .cpu_user_features = PPC_FEATURE_32 |
913 PPC_FEATURE_HAS_MMU | PPC_FEATURE_HAS_4xxMAC,
914 .icache_bsize = 32,
915 .dcache_bsize = 32,
916 },
907 { /* 405EP */ 917 { /* 405EP */
908 .pvr_mask = 0xffff0000, 918 .pvr_mask = 0xffff0000,
909 .pvr_value = 0x51210000, 919 .pvr_value = 0x51210000,
diff --git a/arch/powerpc/kernel/crash_dump.c b/arch/powerpc/kernel/crash_dump.c
index 211d72653ea6..764d07329716 100644
--- a/arch/powerpc/kernel/crash_dump.c
+++ b/arch/powerpc/kernel/crash_dump.c
@@ -61,7 +61,7 @@ static int __init parse_elfcorehdr(char *p)
61 if (p) 61 if (p)
62 elfcorehdr_addr = memparse(p, &p); 62 elfcorehdr_addr = memparse(p, &p);
63 63
64 return 0; 64 return 1;
65} 65}
66__setup("elfcorehdr=", parse_elfcorehdr); 66__setup("elfcorehdr=", parse_elfcorehdr);
67#endif 67#endif
@@ -71,7 +71,7 @@ static int __init parse_savemaxmem(char *p)
71 if (p) 71 if (p)
72 saved_max_pfn = (memparse(p, &p) >> PAGE_SHIFT) - 1; 72 saved_max_pfn = (memparse(p, &p) >> PAGE_SHIFT) - 1;
73 73
74 return 0; 74 return 1;
75} 75}
76__setup("savemaxmem=", parse_savemaxmem); 76__setup("savemaxmem=", parse_savemaxmem);
77 77
diff --git a/arch/powerpc/kernel/entry_32.S b/arch/powerpc/kernel/entry_32.S
index 4827ca1ec89b..b3a979467225 100644
--- a/arch/powerpc/kernel/entry_32.S
+++ b/arch/powerpc/kernel/entry_32.S
@@ -135,10 +135,10 @@ transfer_to_handler:
135 mfspr r11,SPRN_HID0 135 mfspr r11,SPRN_HID0
136 mtcr r11 136 mtcr r11
137BEGIN_FTR_SECTION 137BEGIN_FTR_SECTION
138 bt- 8,power_save_6xx_restore /* Check DOZE */ 138 bt- 8,4f /* Check DOZE */
139END_FTR_SECTION_IFSET(CPU_FTR_CAN_DOZE) 139END_FTR_SECTION_IFSET(CPU_FTR_CAN_DOZE)
140BEGIN_FTR_SECTION 140BEGIN_FTR_SECTION
141 bt- 9,power_save_6xx_restore /* Check NAP */ 141 bt- 9,4f /* Check NAP */
142END_FTR_SECTION_IFSET(CPU_FTR_CAN_NAP) 142END_FTR_SECTION_IFSET(CPU_FTR_CAN_NAP)
143#endif /* CONFIG_6xx */ 143#endif /* CONFIG_6xx */
144 .globl transfer_to_handler_cont 144 .globl transfer_to_handler_cont
@@ -157,6 +157,10 @@ transfer_to_handler_cont:
157 SYNC 157 SYNC
158 RFI /* jump to handler, enable MMU */ 158 RFI /* jump to handler, enable MMU */
159 159
160#ifdef CONFIG_6xx
1614: b power_save_6xx_restore
162#endif
163
160/* 164/*
161 * On kernel stack overflow, load up an initial stack pointer 165 * On kernel stack overflow, load up an initial stack pointer
162 * and call StackOverflow(regs), which should not return. 166 * and call StackOverflow(regs), which should not return.
diff --git a/arch/powerpc/kernel/entry_64.S b/arch/powerpc/kernel/entry_64.S
index 24be0cf86d7f..19ad5c6b1818 100644
--- a/arch/powerpc/kernel/entry_64.S
+++ b/arch/powerpc/kernel/entry_64.S
@@ -1,6 +1,4 @@
1/* 1/*
2 * arch/ppc64/kernel/entry.S
3 *
4 * PowerPC version 2 * PowerPC version
5 * Copyright (C) 1995-1996 Gary Thomas (gdt@linuxppc.org) 3 * Copyright (C) 1995-1996 Gary Thomas (gdt@linuxppc.org)
6 * Rewritten by Cort Dougan (cort@cs.nmt.edu) for PReP 4 * Rewritten by Cort Dougan (cort@cs.nmt.edu) for PReP
@@ -63,6 +61,7 @@ system_call_common:
63 std r12,_MSR(r1) 61 std r12,_MSR(r1)
64 std r0,GPR0(r1) 62 std r0,GPR0(r1)
65 std r10,GPR1(r1) 63 std r10,GPR1(r1)
64 ACCOUNT_CPU_USER_ENTRY(r10, r11)
66 std r2,GPR2(r1) 65 std r2,GPR2(r1)
67 std r3,GPR3(r1) 66 std r3,GPR3(r1)
68 std r4,GPR4(r1) 67 std r4,GPR4(r1)
@@ -170,8 +169,9 @@ syscall_error_cont:
170 stdcx. r0,0,r1 /* to clear the reservation */ 169 stdcx. r0,0,r1 /* to clear the reservation */
171 andi. r6,r8,MSR_PR 170 andi. r6,r8,MSR_PR
172 ld r4,_LINK(r1) 171 ld r4,_LINK(r1)
173 beq- 1f /* only restore r13 if */ 172 beq- 1f
174 ld r13,GPR13(r1) /* returning to usermode */ 173 ACCOUNT_CPU_USER_EXIT(r11, r12)
174 ld r13,GPR13(r1) /* only restore r13 if returning to usermode */
1751: ld r2,GPR2(r1) 1751: ld r2,GPR2(r1)
176 li r12,MSR_RI 176 li r12,MSR_RI
177 andc r11,r10,r12 177 andc r11,r10,r12
@@ -322,7 +322,7 @@ _GLOBAL(ret_from_fork)
322 * the fork code also. 322 * the fork code also.
323 * 323 *
324 * The code which creates the new task context is in 'copy_thread' 324 * The code which creates the new task context is in 'copy_thread'
325 * in arch/ppc64/kernel/process.c 325 * in arch/powerpc/kernel/process.c
326 */ 326 */
327 .align 7 327 .align 7
328_GLOBAL(_switch) 328_GLOBAL(_switch)
@@ -486,6 +486,7 @@ restore:
486 * userspace 486 * userspace
487 */ 487 */
488 beq 1f 488 beq 1f
489 ACCOUNT_CPU_USER_EXIT(r3, r4)
489 REST_GPR(13, r1) 490 REST_GPR(13, r1)
4901: 4911:
491 ld r3,_CTR(r1) 492 ld r3,_CTR(r1)
@@ -616,6 +617,12 @@ _GLOBAL(enter_rtas)
616 mfsrr1 r10 617 mfsrr1 r10
617 std r10,_SRR1(r1) 618 std r10,_SRR1(r1)
618 619
620 /* Temporary workaround to clear CR until RTAS can be modified to
621 * ignore all bits.
622 */
623 li r0,0
624 mtcr r0
625
619 /* There is no way it is acceptable to get here with interrupts enabled, 626 /* There is no way it is acceptable to get here with interrupts enabled,
620 * check it with the asm equivalent of WARN_ON 627 * check it with the asm equivalent of WARN_ON
621 */ 628 */
diff --git a/arch/powerpc/kernel/firmware.c b/arch/powerpc/kernel/firmware.c
index 65eae752a527..0bfe9061720a 100644
--- a/arch/powerpc/kernel/firmware.c
+++ b/arch/powerpc/kernel/firmware.c
@@ -14,32 +14,9 @@
14 */ 14 */
15 15
16#include <linux/config.h> 16#include <linux/config.h>
17#include <linux/module.h>
17 18
18#include <asm/firmware.h> 19#include <asm/firmware.h>
19 20
20unsigned long ppc64_firmware_features; 21unsigned long powerpc_firmware_features;
21 22EXPORT_SYMBOL_GPL(powerpc_firmware_features);
22#ifdef CONFIG_PPC_PSERIES
23firmware_feature_t firmware_features_table[FIRMWARE_MAX_FEATURES] = {
24 {FW_FEATURE_PFT, "hcall-pft"},
25 {FW_FEATURE_TCE, "hcall-tce"},
26 {FW_FEATURE_SPRG0, "hcall-sprg0"},
27 {FW_FEATURE_DABR, "hcall-dabr"},
28 {FW_FEATURE_COPY, "hcall-copy"},
29 {FW_FEATURE_ASR, "hcall-asr"},
30 {FW_FEATURE_DEBUG, "hcall-debug"},
31 {FW_FEATURE_PERF, "hcall-perf"},
32 {FW_FEATURE_DUMP, "hcall-dump"},
33 {FW_FEATURE_INTERRUPT, "hcall-interrupt"},
34 {FW_FEATURE_MIGRATE, "hcall-migrate"},
35 {FW_FEATURE_PERFMON, "hcall-perfmon"},
36 {FW_FEATURE_CRQ, "hcall-crq"},
37 {FW_FEATURE_VIO, "hcall-vio"},
38 {FW_FEATURE_RDMA, "hcall-rdma"},
39 {FW_FEATURE_LLAN, "hcall-lLAN"},
40 {FW_FEATURE_BULK, "hcall-bulk"},
41 {FW_FEATURE_XDABR, "hcall-xdabr"},
42 {FW_FEATURE_MULTITCE, "hcall-multi-tce"},
43 {FW_FEATURE_SPLPAR, "hcall-splpar"},
44};
45#endif
diff --git a/arch/powerpc/kernel/head_44x.S b/arch/powerpc/kernel/head_44x.S
index 8b49679fad54..47c7fa148c9a 100644
--- a/arch/powerpc/kernel/head_44x.S
+++ b/arch/powerpc/kernel/head_44x.S
@@ -1,6 +1,4 @@
1/* 1/*
2 * arch/ppc/kernel/head_44x.S
3 *
4 * Kernel execution entry point code. 2 * Kernel execution entry point code.
5 * 3 *
6 * Copyright (c) 1995-1996 Gary Thomas <gdt@linuxppc.org> 4 * Copyright (c) 1995-1996 Gary Thomas <gdt@linuxppc.org>
diff --git a/arch/powerpc/kernel/head_64.S b/arch/powerpc/kernel/head_64.S
index 9b65029dd2a3..a5ae04a57c78 100644
--- a/arch/powerpc/kernel/head_64.S
+++ b/arch/powerpc/kernel/head_64.S
@@ -1,6 +1,4 @@
1/* 1/*
2 * arch/ppc64/kernel/head.S
3 *
4 * PowerPC version 2 * PowerPC version
5 * Copyright (C) 1995-1996 Gary Thomas (gdt@linuxppc.org) 3 * Copyright (C) 1995-1996 Gary Thomas (gdt@linuxppc.org)
6 * 4 *
@@ -279,6 +277,7 @@ exception_marker:
279 std r10,0(r1); /* make stack chain pointer */ \ 277 std r10,0(r1); /* make stack chain pointer */ \
280 std r0,GPR0(r1); /* save r0 in stackframe */ \ 278 std r0,GPR0(r1); /* save r0 in stackframe */ \
281 std r10,GPR1(r1); /* save r1 in stackframe */ \ 279 std r10,GPR1(r1); /* save r1 in stackframe */ \
280 ACCOUNT_CPU_USER_ENTRY(r9, r10); \
282 std r2,GPR2(r1); /* save r2 in stackframe */ \ 281 std r2,GPR2(r1); /* save r2 in stackframe */ \
283 SAVE_4GPRS(3, r1); /* save r3 - r6 in stackframe */ \ 282 SAVE_4GPRS(3, r1); /* save r3 - r6 in stackframe */ \
284 SAVE_2GPRS(7, r1); /* save r7, r8 in stackframe */ \ 283 SAVE_2GPRS(7, r1); /* save r7, r8 in stackframe */ \
@@ -846,6 +845,14 @@ fast_exception_return:
846 ld r11,_NIP(r1) 845 ld r11,_NIP(r1)
847 andi. r3,r12,MSR_RI /* check if RI is set */ 846 andi. r3,r12,MSR_RI /* check if RI is set */
848 beq- unrecov_fer 847 beq- unrecov_fer
848
849#ifdef CONFIG_VIRT_CPU_ACCOUNTING
850 andi. r3,r12,MSR_PR
851 beq 2f
852 ACCOUNT_CPU_USER_EXIT(r3, r4)
8532:
854#endif
855
849 ld r3,_CCR(r1) 856 ld r3,_CCR(r1)
850 ld r4,_LINK(r1) 857 ld r4,_LINK(r1)
851 ld r5,_CTR(r1) 858 ld r5,_CTR(r1)
@@ -1537,7 +1544,11 @@ _STATIC(__boot_from_prom)
1537 mr r28,r6 1544 mr r28,r6
1538 mr r27,r7 1545 mr r27,r7
1539 1546
1540 /* Align the stack to 16-byte boundary for broken yaboot */ 1547 /*
1548 * Align the stack to 16-byte boundary
1549 * Depending on the size and layout of the ELF sections in the initial
1550 * boot binary, the stack pointer will be unalignet on PowerMac
1551 */
1541 rldicr r1,r1,0,59 1552 rldicr r1,r1,0,59
1542 1553
1543 /* Make sure we are running in 64 bits mode */ 1554 /* Make sure we are running in 64 bits mode */
@@ -1840,21 +1851,6 @@ _STATIC(start_here_multiplatform)
1840 bl .__save_cpu_setup 1851 bl .__save_cpu_setup
1841 sync 1852 sync
1842 1853
1843 /* Setup a valid physical PACA pointer in SPRG3 for early_setup
1844 * note that boot_cpuid can always be 0 nowadays since there is
1845 * nowhere it can be initialized differently before we reach this
1846 * code
1847 */
1848 LOAD_REG_IMMEDIATE(r27, boot_cpuid)
1849 add r27,r27,r26
1850 lwz r27,0(r27)
1851
1852 LOAD_REG_IMMEDIATE(r24, paca) /* Get base vaddr of paca array */
1853 mulli r13,r27,PACA_SIZE /* Calculate vaddr of right paca */
1854 add r13,r13,r24 /* for this processor. */
1855 add r13,r13,r26 /* convert to physical addr */
1856 mtspr SPRN_SPRG3,r13
1857
1858 /* Do very early kernel initializations, including initial hash table, 1854 /* Do very early kernel initializations, including initial hash table,
1859 * stab and slb setup before we turn on relocation. */ 1855 * stab and slb setup before we turn on relocation. */
1860 1856
@@ -1923,6 +1919,17 @@ _STATIC(start_here_common)
1923 /* Not reached */ 1919 /* Not reached */
1924 BUG_OPCODE 1920 BUG_OPCODE
1925 1921
1922/* Put the paca pointer into r13 and SPRG3 */
1923_GLOBAL(setup_boot_paca)
1924 LOAD_REG_IMMEDIATE(r3, boot_cpuid)
1925 lwz r3,0(r3)
1926 LOAD_REG_IMMEDIATE(r4, paca) /* Get base vaddr of paca array */
1927 mulli r3,r3,PACA_SIZE /* Calculate vaddr of right paca */
1928 add r13,r3,r4 /* for this processor. */
1929 mtspr SPRN_SPRG3,r13
1930
1931 blr
1932
1926/* 1933/*
1927 * We put a few things here that have to be page-aligned. 1934 * We put a few things here that have to be page-aligned.
1928 * This stuff goes at the beginning of the bss, which is page-aligned. 1935 * This stuff goes at the beginning of the bss, which is page-aligned.
diff --git a/arch/powerpc/kernel/head_8xx.S b/arch/powerpc/kernel/head_8xx.S
index bc6d1ac55235..28941f5ce673 100644
--- a/arch/powerpc/kernel/head_8xx.S
+++ b/arch/powerpc/kernel/head_8xx.S
@@ -1,6 +1,4 @@
1/* 1/*
2 * arch/ppc/kernel/except_8xx.S
3 *
4 * PowerPC version 2 * PowerPC version
5 * Copyright (C) 1995-1996 Gary Thomas (gdt@linuxppc.org) 3 * Copyright (C) 1995-1996 Gary Thomas (gdt@linuxppc.org)
6 * Rewritten by Cort Dougan (cort@cs.nmt.edu) for PReP 4 * Rewritten by Cort Dougan (cort@cs.nmt.edu) for PReP
diff --git a/arch/powerpc/kernel/head_booke.h b/arch/powerpc/kernel/head_booke.h
new file mode 100644
index 000000000000..8536e7676160
--- /dev/null
+++ b/arch/powerpc/kernel/head_booke.h
@@ -0,0 +1,363 @@
1#ifndef __HEAD_BOOKE_H__
2#define __HEAD_BOOKE_H__
3
4/*
5 * Macros used for common Book-e exception handling
6 */
7
8#define SET_IVOR(vector_number, vector_label) \
9 li r26,vector_label@l; \
10 mtspr SPRN_IVOR##vector_number,r26; \
11 sync
12
13#define NORMAL_EXCEPTION_PROLOG \
14 mtspr SPRN_SPRG0,r10; /* save two registers to work with */\
15 mtspr SPRN_SPRG1,r11; \
16 mtspr SPRN_SPRG4W,r1; \
17 mfcr r10; /* save CR in r10 for now */\
18 mfspr r11,SPRN_SRR1; /* check whether user or kernel */\
19 andi. r11,r11,MSR_PR; \
20 beq 1f; \
21 mfspr r1,SPRN_SPRG3; /* if from user, start at top of */\
22 lwz r1,THREAD_INFO-THREAD(r1); /* this thread's kernel stack */\
23 addi r1,r1,THREAD_SIZE; \
241: subi r1,r1,INT_FRAME_SIZE; /* Allocate an exception frame */\
25 mr r11,r1; \
26 stw r10,_CCR(r11); /* save various registers */\
27 stw r12,GPR12(r11); \
28 stw r9,GPR9(r11); \
29 mfspr r10,SPRN_SPRG0; \
30 stw r10,GPR10(r11); \
31 mfspr r12,SPRN_SPRG1; \
32 stw r12,GPR11(r11); \
33 mflr r10; \
34 stw r10,_LINK(r11); \
35 mfspr r10,SPRN_SPRG4R; \
36 mfspr r12,SPRN_SRR0; \
37 stw r10,GPR1(r11); \
38 mfspr r9,SPRN_SRR1; \
39 stw r10,0(r11); \
40 rlwinm r9,r9,0,14,12; /* clear MSR_WE (necessary?) */\
41 stw r0,GPR0(r11); \
42 SAVE_4GPRS(3, r11); \
43 SAVE_2GPRS(7, r11)
44
45/* To handle the additional exception priority levels on 40x and Book-E
46 * processors we allocate a 4k stack per additional priority level. The various
47 * head_xxx.S files allocate space (exception_stack_top) for each priority's
48 * stack times the number of CPUs
49 *
50 * On 40x critical is the only additional level
51 * On 44x/e500 we have critical and machine check
52 * On e200 we have critical and debug (machine check occurs via critical)
53 *
54 * Additionally we reserve a SPRG for each priority level so we can free up a
55 * GPR to use as the base for indirect access to the exception stacks. This
56 * is necessary since the MMU is always on, for Book-E parts, and the stacks
57 * are offset from KERNELBASE.
58 *
59 */
60#define BOOKE_EXCEPTION_STACK_SIZE (8192)
61
62/* CRIT_SPRG only used in critical exception handling */
63#define CRIT_SPRG SPRN_SPRG2
64/* MCHECK_SPRG only used in machine check exception handling */
65#define MCHECK_SPRG SPRN_SPRG6W
66
67#define MCHECK_STACK_TOP (exception_stack_top - 4096)
68#define CRIT_STACK_TOP (exception_stack_top)
69
70/* only on e200 for now */
71#define DEBUG_STACK_TOP (exception_stack_top - 4096)
72#define DEBUG_SPRG SPRN_SPRG6W
73
74#ifdef CONFIG_SMP
75#define BOOKE_LOAD_EXC_LEVEL_STACK(level) \
76 mfspr r8,SPRN_PIR; \
77 mulli r8,r8,BOOKE_EXCEPTION_STACK_SIZE; \
78 neg r8,r8; \
79 addis r8,r8,level##_STACK_TOP@ha; \
80 addi r8,r8,level##_STACK_TOP@l
81#else
82#define BOOKE_LOAD_EXC_LEVEL_STACK(level) \
83 lis r8,level##_STACK_TOP@h; \
84 ori r8,r8,level##_STACK_TOP@l
85#endif
86
87/*
88 * Exception prolog for critical/machine check exceptions. This is a
89 * little different from the normal exception prolog above since a
90 * critical/machine check exception can potentially occur at any point
91 * during normal exception processing. Thus we cannot use the same SPRG
92 * registers as the normal prolog above. Instead we use a portion of the
93 * critical/machine check exception stack at low physical addresses.
94 */
95#define EXC_LEVEL_EXCEPTION_PROLOG(exc_level, exc_level_srr0, exc_level_srr1) \
96 mtspr exc_level##_SPRG,r8; \
97 BOOKE_LOAD_EXC_LEVEL_STACK(exc_level);/* r8 points to the exc_level stack*/ \
98 stw r10,GPR10-INT_FRAME_SIZE(r8); \
99 stw r11,GPR11-INT_FRAME_SIZE(r8); \
100 mfcr r10; /* save CR in r10 for now */\
101 mfspr r11,exc_level_srr1; /* check whether user or kernel */\
102 andi. r11,r11,MSR_PR; \
103 mr r11,r8; \
104 mfspr r8,exc_level##_SPRG; \
105 beq 1f; \
106 /* COMING FROM USER MODE */ \
107 mfspr r11,SPRN_SPRG3; /* if from user, start at top of */\
108 lwz r11,THREAD_INFO-THREAD(r11); /* this thread's kernel stack */\
109 addi r11,r11,THREAD_SIZE; \
1101: subi r11,r11,INT_FRAME_SIZE; /* Allocate an exception frame */\
111 stw r10,_CCR(r11); /* save various registers */\
112 stw r12,GPR12(r11); \
113 stw r9,GPR9(r11); \
114 mflr r10; \
115 stw r10,_LINK(r11); \
116 mfspr r12,SPRN_DEAR; /* save DEAR and ESR in the frame */\
117 stw r12,_DEAR(r11); /* since they may have had stuff */\
118 mfspr r9,SPRN_ESR; /* in them at the point where the */\
119 stw r9,_ESR(r11); /* exception was taken */\
120 mfspr r12,exc_level_srr0; \
121 stw r1,GPR1(r11); \
122 mfspr r9,exc_level_srr1; \
123 stw r1,0(r11); \
124 mr r1,r11; \
125 rlwinm r9,r9,0,14,12; /* clear MSR_WE (necessary?) */\
126 stw r0,GPR0(r11); \
127 SAVE_4GPRS(3, r11); \
128 SAVE_2GPRS(7, r11)
129
130#define CRITICAL_EXCEPTION_PROLOG \
131 EXC_LEVEL_EXCEPTION_PROLOG(CRIT, SPRN_CSRR0, SPRN_CSRR1)
132#define DEBUG_EXCEPTION_PROLOG \
133 EXC_LEVEL_EXCEPTION_PROLOG(DEBUG, SPRN_DSRR0, SPRN_DSRR1)
134#define MCHECK_EXCEPTION_PROLOG \
135 EXC_LEVEL_EXCEPTION_PROLOG(MCHECK, SPRN_MCSRR0, SPRN_MCSRR1)
136
137/*
138 * Exception vectors.
139 */
140#define START_EXCEPTION(label) \
141 .align 5; \
142label:
143
144#define FINISH_EXCEPTION(func) \
145 bl transfer_to_handler_full; \
146 .long func; \
147 .long ret_from_except_full
148
149#define EXCEPTION(n, label, hdlr, xfer) \
150 START_EXCEPTION(label); \
151 NORMAL_EXCEPTION_PROLOG; \
152 addi r3,r1,STACK_FRAME_OVERHEAD; \
153 xfer(n, hdlr)
154
155#define CRITICAL_EXCEPTION(n, label, hdlr) \
156 START_EXCEPTION(label); \
157 CRITICAL_EXCEPTION_PROLOG; \
158 addi r3,r1,STACK_FRAME_OVERHEAD; \
159 EXC_XFER_TEMPLATE(hdlr, n+2, (MSR_KERNEL & ~(MSR_ME|MSR_DE|MSR_CE)), \
160 NOCOPY, crit_transfer_to_handler, \
161 ret_from_crit_exc)
162
163#define MCHECK_EXCEPTION(n, label, hdlr) \
164 START_EXCEPTION(label); \
165 MCHECK_EXCEPTION_PROLOG; \
166 mfspr r5,SPRN_ESR; \
167 stw r5,_ESR(r11); \
168 addi r3,r1,STACK_FRAME_OVERHEAD; \
169 EXC_XFER_TEMPLATE(hdlr, n+2, (MSR_KERNEL & ~(MSR_ME|MSR_DE|MSR_CE)), \
170 NOCOPY, mcheck_transfer_to_handler, \
171 ret_from_mcheck_exc)
172
173#define EXC_XFER_TEMPLATE(hdlr, trap, msr, copyee, tfer, ret) \
174 li r10,trap; \
175 stw r10,_TRAP(r11); \
176 lis r10,msr@h; \
177 ori r10,r10,msr@l; \
178 copyee(r10, r9); \
179 bl tfer; \
180 .long hdlr; \
181 .long ret
182
183#define COPY_EE(d, s) rlwimi d,s,0,16,16
184#define NOCOPY(d, s)
185
186#define EXC_XFER_STD(n, hdlr) \
187 EXC_XFER_TEMPLATE(hdlr, n, MSR_KERNEL, NOCOPY, transfer_to_handler_full, \
188 ret_from_except_full)
189
190#define EXC_XFER_LITE(n, hdlr) \
191 EXC_XFER_TEMPLATE(hdlr, n+1, MSR_KERNEL, NOCOPY, transfer_to_handler, \
192 ret_from_except)
193
194#define EXC_XFER_EE(n, hdlr) \
195 EXC_XFER_TEMPLATE(hdlr, n, MSR_KERNEL, COPY_EE, transfer_to_handler_full, \
196 ret_from_except_full)
197
198#define EXC_XFER_EE_LITE(n, hdlr) \
199 EXC_XFER_TEMPLATE(hdlr, n+1, MSR_KERNEL, COPY_EE, transfer_to_handler, \
200 ret_from_except)
201
202/* Check for a single step debug exception while in an exception
203 * handler before state has been saved. This is to catch the case
204 * where an instruction that we are trying to single step causes
205 * an exception (eg ITLB/DTLB miss) and thus the first instruction of
206 * the exception handler generates a single step debug exception.
207 *
208 * If we get a debug trap on the first instruction of an exception handler,
209 * we reset the MSR_DE in the _exception handler's_ MSR (the debug trap is
210 * a critical exception, so we are using SPRN_CSRR1 to manipulate the MSR).
211 * The exception handler was handling a non-critical interrupt, so it will
212 * save (and later restore) the MSR via SPRN_CSRR1, which will still have
213 * the MSR_DE bit set.
214 */
215#ifdef CONFIG_E200
216#define DEBUG_EXCEPTION \
217 START_EXCEPTION(Debug); \
218 DEBUG_EXCEPTION_PROLOG; \
219 \
220 /* \
221 * If there is a single step or branch-taken exception in an \
222 * exception entry sequence, it was probably meant to apply to \
223 * the code where the exception occurred (since exception entry \
224 * doesn't turn off DE automatically). We simulate the effect \
225 * of turning off DE on entry to an exception handler by turning \
226 * off DE in the CSRR1 value and clearing the debug status. \
227 */ \
228 mfspr r10,SPRN_DBSR; /* check single-step/branch taken */ \
229 andis. r10,r10,DBSR_IC@h; \
230 beq+ 2f; \
231 \
232 lis r10,KERNELBASE@h; /* check if exception in vectors */ \
233 ori r10,r10,KERNELBASE@l; \
234 cmplw r12,r10; \
235 blt+ 2f; /* addr below exception vectors */ \
236 \
237 lis r10,Debug@h; \
238 ori r10,r10,Debug@l; \
239 cmplw r12,r10; \
240 bgt+ 2f; /* addr above exception vectors */ \
241 \
242 /* here it looks like we got an inappropriate debug exception. */ \
2431: rlwinm r9,r9,0,~MSR_DE; /* clear DE in the CDRR1 value */ \
244 lis r10,DBSR_IC@h; /* clear the IC event */ \
245 mtspr SPRN_DBSR,r10; \
246 /* restore state and get out */ \
247 lwz r10,_CCR(r11); \
248 lwz r0,GPR0(r11); \
249 lwz r1,GPR1(r11); \
250 mtcrf 0x80,r10; \
251 mtspr SPRN_DSRR0,r12; \
252 mtspr SPRN_DSRR1,r9; \
253 lwz r9,GPR9(r11); \
254 lwz r12,GPR12(r11); \
255 mtspr DEBUG_SPRG,r8; \
256 BOOKE_LOAD_EXC_LEVEL_STACK(DEBUG); /* r8 points to the debug stack */ \
257 lwz r10,GPR10-INT_FRAME_SIZE(r8); \
258 lwz r11,GPR11-INT_FRAME_SIZE(r8); \
259 mfspr r8,DEBUG_SPRG; \
260 \
261 RFDI; \
262 b .; \
263 \
264 /* continue normal handling for a critical exception... */ \
2652: mfspr r4,SPRN_DBSR; \
266 addi r3,r1,STACK_FRAME_OVERHEAD; \
267 EXC_XFER_TEMPLATE(DebugException, 0x2002, (MSR_KERNEL & ~(MSR_ME|MSR_DE|MSR_CE)), NOCOPY, debug_transfer_to_handler, ret_from_debug_exc)
268#else
269#define DEBUG_EXCEPTION \
270 START_EXCEPTION(Debug); \
271 CRITICAL_EXCEPTION_PROLOG; \
272 \
273 /* \
274 * If there is a single step or branch-taken exception in an \
275 * exception entry sequence, it was probably meant to apply to \
276 * the code where the exception occurred (since exception entry \
277 * doesn't turn off DE automatically). We simulate the effect \
278 * of turning off DE on entry to an exception handler by turning \
279 * off DE in the CSRR1 value and clearing the debug status. \
280 */ \
281 mfspr r10,SPRN_DBSR; /* check single-step/branch taken */ \
282 andis. r10,r10,DBSR_IC@h; \
283 beq+ 2f; \
284 \
285 lis r10,KERNELBASE@h; /* check if exception in vectors */ \
286 ori r10,r10,KERNELBASE@l; \
287 cmplw r12,r10; \
288 blt+ 2f; /* addr below exception vectors */ \
289 \
290 lis r10,Debug@h; \
291 ori r10,r10,Debug@l; \
292 cmplw r12,r10; \
293 bgt+ 2f; /* addr above exception vectors */ \
294 \
295 /* here it looks like we got an inappropriate debug exception. */ \
2961: rlwinm r9,r9,0,~MSR_DE; /* clear DE in the CSRR1 value */ \
297 lis r10,DBSR_IC@h; /* clear the IC event */ \
298 mtspr SPRN_DBSR,r10; \
299 /* restore state and get out */ \
300 lwz r10,_CCR(r11); \
301 lwz r0,GPR0(r11); \
302 lwz r1,GPR1(r11); \
303 mtcrf 0x80,r10; \
304 mtspr SPRN_CSRR0,r12; \
305 mtspr SPRN_CSRR1,r9; \
306 lwz r9,GPR9(r11); \
307 lwz r12,GPR12(r11); \
308 mtspr CRIT_SPRG,r8; \
309 BOOKE_LOAD_EXC_LEVEL_STACK(CRIT); /* r8 points to the debug stack */ \
310 lwz r10,GPR10-INT_FRAME_SIZE(r8); \
311 lwz r11,GPR11-INT_FRAME_SIZE(r8); \
312 mfspr r8,CRIT_SPRG; \
313 \
314 rfci; \
315 b .; \
316 \
317 /* continue normal handling for a critical exception... */ \
3182: mfspr r4,SPRN_DBSR; \
319 addi r3,r1,STACK_FRAME_OVERHEAD; \
320 EXC_XFER_TEMPLATE(DebugException, 0x2002, (MSR_KERNEL & ~(MSR_ME|MSR_DE|MSR_CE)), NOCOPY, crit_transfer_to_handler, ret_from_crit_exc)
321#endif
322
323#define INSTRUCTION_STORAGE_EXCEPTION \
324 START_EXCEPTION(InstructionStorage) \
325 NORMAL_EXCEPTION_PROLOG; \
326 mfspr r5,SPRN_ESR; /* Grab the ESR and save it */ \
327 stw r5,_ESR(r11); \
328 mr r4,r12; /* Pass SRR0 as arg2 */ \
329 li r5,0; /* Pass zero as arg3 */ \
330 EXC_XFER_EE_LITE(0x0400, handle_page_fault)
331
332#define ALIGNMENT_EXCEPTION \
333 START_EXCEPTION(Alignment) \
334 NORMAL_EXCEPTION_PROLOG; \
335 mfspr r4,SPRN_DEAR; /* Grab the DEAR and save it */ \
336 stw r4,_DEAR(r11); \
337 addi r3,r1,STACK_FRAME_OVERHEAD; \
338 EXC_XFER_EE(0x0600, alignment_exception)
339
340#define PROGRAM_EXCEPTION \
341 START_EXCEPTION(Program) \
342 NORMAL_EXCEPTION_PROLOG; \
343 mfspr r4,SPRN_ESR; /* Grab the ESR and save it */ \
344 stw r4,_ESR(r11); \
345 addi r3,r1,STACK_FRAME_OVERHEAD; \
346 EXC_XFER_STD(0x0700, program_check_exception)
347
348#define DECREMENTER_EXCEPTION \
349 START_EXCEPTION(Decrementer) \
350 NORMAL_EXCEPTION_PROLOG; \
351 lis r0,TSR_DIS@h; /* Setup the DEC interrupt mask */ \
352 mtspr SPRN_TSR,r0; /* Clear the DEC interrupt */ \
353 addi r3,r1,STACK_FRAME_OVERHEAD; \
354 EXC_XFER_LITE(0x0900, timer_interrupt)
355
356#define FP_UNAVAILABLE_EXCEPTION \
357 START_EXCEPTION(FloatingPointUnavailable) \
358 NORMAL_EXCEPTION_PROLOG; \
359 bne load_up_fpu; /* if from user, just load it up */ \
360 addi r3,r1,STACK_FRAME_OVERHEAD; \
361 EXC_XFER_EE_LITE(0x800, kernel_fp_unavailable_exception)
362
363#endif /* __HEAD_BOOKE_H__ */
diff --git a/arch/powerpc/kernel/head_fsl_booke.S b/arch/powerpc/kernel/head_fsl_booke.S
index 8d60fa99fc4b..dd86bbed7627 100644
--- a/arch/powerpc/kernel/head_fsl_booke.S
+++ b/arch/powerpc/kernel/head_fsl_booke.S
@@ -1,6 +1,4 @@
1/* 1/*
2 * arch/ppc/kernel/head_fsl_booke.S
3 *
4 * Kernel execution entry point code. 2 * Kernel execution entry point code.
5 * 3 *
6 * Copyright (c) 1995-1996 Gary Thomas <gdt@linuxppc.org> 4 * Copyright (c) 1995-1996 Gary Thomas <gdt@linuxppc.org>
@@ -316,6 +314,7 @@ skpinv: addi r6,r6,1 /* Increment */
316 */ 314 */
317 lis r2,DBCR0_IDM@h 315 lis r2,DBCR0_IDM@h
318 mtspr SPRN_DBCR0,r2 316 mtspr SPRN_DBCR0,r2
317 isync
319 /* clear any residual debug events */ 318 /* clear any residual debug events */
320 li r2,-1 319 li r2,-1
321 mtspr SPRN_DBSR,r2 320 mtspr SPRN_DBSR,r2
@@ -1002,12 +1001,15 @@ _GLOBAL(giveup_fpu)
1002_GLOBAL(abort) 1001_GLOBAL(abort)
1003 li r13,0 1002 li r13,0
1004 mtspr SPRN_DBCR0,r13 /* disable all debug events */ 1003 mtspr SPRN_DBCR0,r13 /* disable all debug events */
1004 isync
1005 mfmsr r13 1005 mfmsr r13
1006 ori r13,r13,MSR_DE@l /* Enable Debug Events */ 1006 ori r13,r13,MSR_DE@l /* Enable Debug Events */
1007 mtmsr r13 1007 mtmsr r13
1008 isync
1008 mfspr r13,SPRN_DBCR0 1009 mfspr r13,SPRN_DBCR0
1009 lis r13,(DBCR0_IDM|DBCR0_RST_CHIP)@h 1010 lis r13,(DBCR0_IDM|DBCR0_RST_CHIP)@h
1010 mtspr SPRN_DBCR0,r13 1011 mtspr SPRN_DBCR0,r13
1012 isync
1011 1013
1012_GLOBAL(set_context) 1014_GLOBAL(set_context)
1013 1015
diff --git a/arch/powerpc/kernel/idle_64.c b/arch/powerpc/kernel/idle.c
index b879d3057ef8..e9f321d74d85 100644
--- a/arch/powerpc/kernel/idle_64.c
+++ b/arch/powerpc/kernel/idle.c
@@ -2,13 +2,17 @@
2 * Idle daemon for PowerPC. Idle daemon will handle any action 2 * Idle daemon for PowerPC. Idle daemon will handle any action
3 * that needs to be taken when the system becomes idle. 3 * that needs to be taken when the system becomes idle.
4 * 4 *
5 * Originally Written by Cort Dougan (cort@cs.nmt.edu) 5 * Originally written by Cort Dougan (cort@cs.nmt.edu).
6 * Subsequent 32-bit hacking by Tom Rini, Armin Kuster,
7 * Paul Mackerras and others.
6 * 8 *
7 * iSeries supported added by Mike Corrigan <mikejc@us.ibm.com> 9 * iSeries supported added by Mike Corrigan <mikejc@us.ibm.com>
8 * 10 *
9 * Additional shared processor, SMT, and firmware support 11 * Additional shared processor, SMT, and firmware support
10 * Copyright (c) 2003 Dave Engebretsen <engebret@us.ibm.com> 12 * Copyright (c) 2003 Dave Engebretsen <engebret@us.ibm.com>
11 * 13 *
14 * 32-bit and 64-bit versions merged by Paul Mackerras <paulus@samba.org>
15 *
12 * This program is free software; you can redistribute it and/or 16 * This program is free software; you can redistribute it and/or
13 * modify it under the terms of the GNU General Public License 17 * modify it under the terms of the GNU General Public License
14 * as published by the Free Software Foundation; either version 18 * as published by the Free Software Foundation; either version
@@ -29,18 +33,43 @@
29#include <asm/machdep.h> 33#include <asm/machdep.h>
30#include <asm/smp.h> 34#include <asm/smp.h>
31 35
32extern void power4_idle(void); 36#ifdef CONFIG_HOTPLUG_CPU
37#define cpu_should_die() (cpu_is_offline(smp_processor_id()) && \
38 system_state == SYSTEM_RUNNING)
39#else
40#define cpu_should_die() 0
41#endif
33 42
34void default_idle(void) 43/*
44 * The body of the idle task.
45 */
46void cpu_idle(void)
35{ 47{
36 unsigned int cpu = smp_processor_id(); 48 if (ppc_md.idle_loop)
37 set_thread_flag(TIF_POLLING_NRFLAG); 49 ppc_md.idle_loop(); /* doesn't return */
38 50
51 set_thread_flag(TIF_POLLING_NRFLAG);
39 while (1) { 52 while (1) {
40 if (!need_resched()) { 53 ppc64_runlatch_off();
41 while (!need_resched() && !cpu_is_offline(cpu)) {
42 ppc64_runlatch_off();
43 54
55 while (!need_resched() && !cpu_should_die()) {
56 if (ppc_md.power_save) {
57 clear_thread_flag(TIF_POLLING_NRFLAG);
58 /*
59 * smp_mb is so clearing of TIF_POLLING_NRFLAG
60 * is ordered w.r.t. need_resched() test.
61 */
62 smp_mb();
63 local_irq_disable();
64
65 /* check again after disabling irqs */
66 if (!need_resched() && !cpu_should_die())
67 ppc_md.power_save();
68
69 local_irq_enable();
70 set_thread_flag(TIF_POLLING_NRFLAG);
71
72 } else {
44 /* 73 /*
45 * Go into low thread priority and possibly 74 * Go into low thread priority and possibly
46 * low power mode. 75 * low power mode.
@@ -48,46 +77,18 @@ void default_idle(void)
48 HMT_low(); 77 HMT_low();
49 HMT_very_low(); 78 HMT_very_low();
50 } 79 }
51
52 HMT_medium();
53 } 80 }
54 81
82 HMT_medium();
55 ppc64_runlatch_on(); 83 ppc64_runlatch_on();
84 if (cpu_should_die())
85 cpu_die();
56 preempt_enable_no_resched(); 86 preempt_enable_no_resched();
57 schedule(); 87 schedule();
58 preempt_disable(); 88 preempt_disable();
59 if (cpu_is_offline(cpu) && system_state == SYSTEM_RUNNING)
60 cpu_die();
61 } 89 }
62} 90}
63 91
64void native_idle(void)
65{
66 while (1) {
67 ppc64_runlatch_off();
68
69 if (!need_resched())
70 power4_idle();
71
72 if (need_resched()) {
73 ppc64_runlatch_on();
74 preempt_enable_no_resched();
75 schedule();
76 preempt_disable();
77 }
78
79 if (cpu_is_offline(smp_processor_id()) &&
80 system_state == SYSTEM_RUNNING)
81 cpu_die();
82 }
83}
84
85void cpu_idle(void)
86{
87 BUG_ON(NULL == ppc_md.idle_loop);
88 ppc_md.idle_loop();
89}
90
91int powersave_nap; 92int powersave_nap;
92 93
93#ifdef CONFIG_SYSCTL 94#ifdef CONFIG_SYSCTL
diff --git a/arch/powerpc/kernel/idle_6xx.S b/arch/powerpc/kernel/idle_6xx.S
index 444fdcc769f1..12a4efbaa08f 100644
--- a/arch/powerpc/kernel/idle_6xx.S
+++ b/arch/powerpc/kernel/idle_6xx.S
@@ -87,19 +87,6 @@ END_FTR_SECTION_IFSET(CPU_FTR_CAN_NAP)
87 cmpwi 0,r3,0 87 cmpwi 0,r3,0
88 beqlr 88 beqlr
89 89
90 /* Clear MSR:EE */
91 mfmsr r7
92 rlwinm r0,r7,0,17,15
93 mtmsr r0
94
95 /* Check current_thread_info()->flags */
96 rlwinm r4,r1,0,0,18
97 lwz r4,TI_FLAGS(r4)
98 andi. r0,r4,_TIF_NEED_RESCHED
99 beq 1f
100 mtmsr r7 /* out of line this ? */
101 blr
1021:
103 /* Some pre-nap cleanups needed on some CPUs */ 90 /* Some pre-nap cleanups needed on some CPUs */
104 andis. r0,r3,HID0_NAP@h 91 andis. r0,r3,HID0_NAP@h
105 beq 2f 92 beq 2f
@@ -157,7 +144,8 @@ BEGIN_FTR_SECTION
157 DSSALL 144 DSSALL
158 sync 145 sync
159END_FTR_SECTION_IFSET(CPU_FTR_ALTIVEC) 146END_FTR_SECTION_IFSET(CPU_FTR_ALTIVEC)
160 ori r7,r7,MSR_EE /* Could be ommited (already set) */ 147 mfmsr r7
148 ori r7,r7,MSR_EE
161 oris r7,r7,MSR_POW@h 149 oris r7,r7,MSR_POW@h
162 sync 150 sync
163 isync 151 isync
@@ -220,8 +208,6 @@ _GLOBAL(nap_save_msscr0)
220_GLOBAL(nap_save_hid1) 208_GLOBAL(nap_save_hid1)
221 .space 4*NR_CPUS 209 .space 4*NR_CPUS
222 210
223_GLOBAL(powersave_nap)
224 .long 0
225_GLOBAL(powersave_lowspeed) 211_GLOBAL(powersave_lowspeed)
226 .long 0 212 .long 0
227 213
diff --git a/arch/powerpc/kernel/idle_power4.S b/arch/powerpc/kernel/idle_power4.S
index c16b4afab582..6dad1c02496e 100644
--- a/arch/powerpc/kernel/idle_power4.S
+++ b/arch/powerpc/kernel/idle_power4.S
@@ -1,11 +1,5 @@
1/* 1/*
2 * This file contains the power_save function for 6xx & 7xxx CPUs 2 * This file contains the power_save function for 970-family CPUs.
3 * rewritten in assembler
4 *
5 * Warning ! This code assumes that if your machine has a 750fx
6 * it will have PLL 1 set to low speed mode (used during NAP/DOZE).
7 * if this is not the case some additional changes will have to
8 * be done to check a runtime var (a bit like powersave-nap)
9 * 3 *
10 * This program is free software; you can redistribute it and/or 4 * This program is free software; you can redistribute it and/or
11 * modify it under the terms of the GNU General Public License 5 * modify it under the terms of the GNU General Public License
@@ -26,49 +20,23 @@
26 20
27 .text 21 .text
28 22
29/*
30 * Here is the power_save_6xx function. This could eventually be
31 * split into several functions & changing the function pointer
32 * depending on the various features.
33 */
34_GLOBAL(power4_idle) 23_GLOBAL(power4_idle)
35BEGIN_FTR_SECTION 24BEGIN_FTR_SECTION
36 blr 25 blr
37END_FTR_SECTION_IFCLR(CPU_FTR_CAN_NAP) 26END_FTR_SECTION_IFCLR(CPU_FTR_CAN_NAP)
38 /* We must dynamically check for the NAP feature as it
39 * can be cleared by CPU init after the fixups are done
40 */
41 LOAD_REG_ADDRBASE(r3,cur_cpu_spec)
42 ld r4,ADDROFF(cur_cpu_spec)(r3)
43 ld r4,CPU_SPEC_FEATURES(r4)
44 andi. r0,r4,CPU_FTR_CAN_NAP
45 beqlr
46 /* Now check if user or arch enabled NAP mode */ 27 /* Now check if user or arch enabled NAP mode */
47 LOAD_REG_ADDRBASE(r3,powersave_nap) 28 LOAD_REG_ADDRBASE(r3,powersave_nap)
48 lwz r4,ADDROFF(powersave_nap)(r3) 29 lwz r4,ADDROFF(powersave_nap)(r3)
49 cmpwi 0,r4,0 30 cmpwi 0,r4,0
50 beqlr 31 beqlr
51 32
52 /* Clear MSR:EE */
53 mfmsr r7
54 li r4,0
55 ori r4,r4,MSR_EE
56 andc r0,r7,r4
57 mtmsrd r0
58
59 /* Check current_thread_info()->flags */
60 clrrdi r4,r1,THREAD_SHIFT
61 ld r4,TI_FLAGS(r4)
62 andi. r0,r4,_TIF_NEED_RESCHED
63 beq 1f
64 mtmsrd r7 /* out of line this ? */
65 blr
661:
67 /* Go to NAP now */ 33 /* Go to NAP now */
68BEGIN_FTR_SECTION 34BEGIN_FTR_SECTION
69 DSSALL 35 DSSALL
70 sync 36 sync
71END_FTR_SECTION_IFSET(CPU_FTR_ALTIVEC) 37END_FTR_SECTION_IFSET(CPU_FTR_ALTIVEC)
38 mfmsr r7
39 ori r7,r7,MSR_EE
72 oris r7,r7,MSR_POW@h 40 oris r7,r7,MSR_POW@h
73 sync 41 sync
74 isync 42 isync
diff --git a/arch/powerpc/kernel/iomap.c b/arch/powerpc/kernel/iomap.c
index 6160c8dbb7c5..fd8214caedee 100644
--- a/arch/powerpc/kernel/iomap.c
+++ b/arch/powerpc/kernel/iomap.c
@@ -1,6 +1,4 @@
1/* 1/*
2 * arch/ppc64/kernel/iomap.c
3 *
4 * ppc64 "iomap" interface implementation. 2 * ppc64 "iomap" interface implementation.
5 * 3 *
6 * (C) Copyright 2004 Linus Torvalds 4 * (C) Copyright 2004 Linus Torvalds
diff --git a/arch/powerpc/kernel/iommu.c b/arch/powerpc/kernel/iommu.c
index 946f3219fd29..d9a7fdef59b9 100644
--- a/arch/powerpc/kernel/iommu.c
+++ b/arch/powerpc/kernel/iommu.c
@@ -1,5 +1,4 @@
1/* 1/*
2 * arch/ppc64/kernel/iommu.c
3 * Copyright (C) 2001 Mike Corrigan & Dave Engebretsen, IBM Corporation 2 * Copyright (C) 2001 Mike Corrigan & Dave Engebretsen, IBM Corporation
4 * 3 *
5 * Rewrite, cleanup, new allocation schemes, virtual merging: 4 * Rewrite, cleanup, new allocation schemes, virtual merging:
diff --git a/arch/powerpc/kernel/irq.c b/arch/powerpc/kernel/irq.c
index d1fffce86df9..bb5c9501234c 100644
--- a/arch/powerpc/kernel/irq.c
+++ b/arch/powerpc/kernel/irq.c
@@ -1,6 +1,4 @@
1/* 1/*
2 * arch/ppc/kernel/irq.c
3 *
4 * Derived from arch/i386/kernel/irq.c 2 * Derived from arch/i386/kernel/irq.c
5 * Copyright (C) 1992 Linus Torvalds 3 * Copyright (C) 1992 Linus Torvalds
6 * Adapted from arch/i386 by Gary Thomas 4 * Adapted from arch/i386 by Gary Thomas
@@ -137,9 +135,8 @@ skip:
137#ifdef CONFIG_TAU_INT 135#ifdef CONFIG_TAU_INT
138 if (tau_initialized){ 136 if (tau_initialized){
139 seq_puts(p, "TAU: "); 137 seq_puts(p, "TAU: ");
140 for (j = 0; j < NR_CPUS; j++) 138 for_each_online_cpu(j)
141 if (cpu_online(j)) 139 seq_printf(p, "%10u ", tau_interrupts(j));
142 seq_printf(p, "%10u ", tau_interrupts(j));
143 seq_puts(p, " PowerPC Thermal Assist (cpu temp)\n"); 140 seq_puts(p, " PowerPC Thermal Assist (cpu temp)\n");
144 } 141 }
145#endif 142#endif
@@ -371,6 +368,7 @@ unsigned int real_irq_to_virt_slowpath(unsigned int real_irq)
371 return NO_IRQ; 368 return NO_IRQ;
372 369
373} 370}
371#endif /* CONFIG_PPC64 */
374 372
375#ifdef CONFIG_IRQSTACKS 373#ifdef CONFIG_IRQSTACKS
376struct thread_info *softirq_ctx[NR_CPUS]; 374struct thread_info *softirq_ctx[NR_CPUS];
@@ -381,7 +379,7 @@ void irq_ctx_init(void)
381 struct thread_info *tp; 379 struct thread_info *tp;
382 int i; 380 int i;
383 381
384 for_each_cpu(i) { 382 for_each_possible_cpu(i) {
385 memset((void *)softirq_ctx[i], 0, THREAD_SIZE); 383 memset((void *)softirq_ctx[i], 0, THREAD_SIZE);
386 tp = softirq_ctx[i]; 384 tp = softirq_ctx[i];
387 tp->cpu = i; 385 tp->cpu = i;
@@ -394,10 +392,24 @@ void irq_ctx_init(void)
394 } 392 }
395} 393}
396 394
395static inline void do_softirq_onstack(void)
396{
397 struct thread_info *curtp, *irqtp;
398
399 curtp = current_thread_info();
400 irqtp = softirq_ctx[smp_processor_id()];
401 irqtp->task = curtp->task;
402 call_do_softirq(irqtp);
403 irqtp->task = NULL;
404}
405
406#else
407#define do_softirq_onstack() __do_softirq()
408#endif /* CONFIG_IRQSTACKS */
409
397void do_softirq(void) 410void do_softirq(void)
398{ 411{
399 unsigned long flags; 412 unsigned long flags;
400 struct thread_info *curtp, *irqtp;
401 413
402 if (in_interrupt()) 414 if (in_interrupt())
403 return; 415 return;
@@ -405,19 +417,18 @@ void do_softirq(void)
405 local_irq_save(flags); 417 local_irq_save(flags);
406 418
407 if (local_softirq_pending()) { 419 if (local_softirq_pending()) {
408 curtp = current_thread_info(); 420 account_system_vtime(current);
409 irqtp = softirq_ctx[smp_processor_id()]; 421 local_bh_disable();
410 irqtp->task = curtp->task; 422 do_softirq_onstack();
411 call_do_softirq(irqtp); 423 account_system_vtime(current);
412 irqtp->task = NULL; 424 __local_bh_enable();
413 } 425 }
414 426
415 local_irq_restore(flags); 427 local_irq_restore(flags);
416} 428}
417EXPORT_SYMBOL(do_softirq); 429EXPORT_SYMBOL(do_softirq);
418 430
419#endif /* CONFIG_IRQSTACKS */ 431#ifdef CONFIG_PPC64
420
421static int __init setup_noirqdistrib(char *str) 432static int __init setup_noirqdistrib(char *str)
422{ 433{
423 distribute_irqs = 0; 434 distribute_irqs = 0;
diff --git a/arch/powerpc/kernel/kprobes.c b/arch/powerpc/kernel/kprobes.c
index cfab48566db1..ad7a90212204 100644
--- a/arch/powerpc/kernel/kprobes.c
+++ b/arch/powerpc/kernel/kprobes.c
@@ -1,6 +1,5 @@
1/* 1/*
2 * Kernel Probes (KProbes) 2 * Kernel Probes (KProbes)
3 * arch/ppc64/kernel/kprobes.c
4 * 3 *
5 * This program is free software; you can redistribute it and/or modify 4 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by 5 * it under the terms of the GNU General Public License as published by
@@ -31,9 +30,11 @@
31#include <linux/kprobes.h> 30#include <linux/kprobes.h>
32#include <linux/ptrace.h> 31#include <linux/ptrace.h>
33#include <linux/preempt.h> 32#include <linux/preempt.h>
33#include <linux/module.h>
34#include <asm/cacheflush.h> 34#include <asm/cacheflush.h>
35#include <asm/kdebug.h> 35#include <asm/kdebug.h>
36#include <asm/sstep.h> 36#include <asm/sstep.h>
37#include <asm/uaccess.h>
37 38
38DEFINE_PER_CPU(struct kprobe *, current_kprobe) = NULL; 39DEFINE_PER_CPU(struct kprobe *, current_kprobe) = NULL;
39DEFINE_PER_CPU(struct kprobe_ctlblk, kprobe_ctlblk); 40DEFINE_PER_CPU(struct kprobe_ctlblk, kprobe_ctlblk);
@@ -82,9 +83,9 @@ void __kprobes arch_disarm_kprobe(struct kprobe *p)
82 83
83void __kprobes arch_remove_kprobe(struct kprobe *p) 84void __kprobes arch_remove_kprobe(struct kprobe *p)
84{ 85{
85 down(&kprobe_mutex); 86 mutex_lock(&kprobe_mutex);
86 free_insn_slot(p->ainsn.insn); 87 free_insn_slot(p->ainsn.insn);
87 up(&kprobe_mutex); 88 mutex_unlock(&kprobe_mutex);
88} 89}
89 90
90static inline void prepare_singlestep(struct kprobe *p, struct pt_regs *regs) 91static inline void prepare_singlestep(struct kprobe *p, struct pt_regs *regs)
@@ -373,17 +374,62 @@ static inline int kprobe_fault_handler(struct pt_regs *regs, int trapnr)
373{ 374{
374 struct kprobe *cur = kprobe_running(); 375 struct kprobe *cur = kprobe_running();
375 struct kprobe_ctlblk *kcb = get_kprobe_ctlblk(); 376 struct kprobe_ctlblk *kcb = get_kprobe_ctlblk();
376 377 const struct exception_table_entry *entry;
377 if (cur->fault_handler && cur->fault_handler(cur, regs, trapnr)) 378
378 return 1; 379 switch(kcb->kprobe_status) {
379 380 case KPROBE_HIT_SS:
380 if (kcb->kprobe_status & KPROBE_HIT_SS) { 381 case KPROBE_REENTER:
381 resume_execution(cur, regs); 382 /*
383 * We are here because the instruction being single
384 * stepped caused a page fault. We reset the current
385 * kprobe and the nip points back to the probe address
386 * and allow the page fault handler to continue as a
387 * normal page fault.
388 */
389 regs->nip = (unsigned long)cur->addr;
382 regs->msr &= ~MSR_SE; 390 regs->msr &= ~MSR_SE;
383 regs->msr |= kcb->kprobe_saved_msr; 391 regs->msr |= kcb->kprobe_saved_msr;
384 392 if (kcb->kprobe_status == KPROBE_REENTER)
385 reset_current_kprobe(); 393 restore_previous_kprobe(kcb);
394 else
395 reset_current_kprobe();
386 preempt_enable_no_resched(); 396 preempt_enable_no_resched();
397 break;
398 case KPROBE_HIT_ACTIVE:
399 case KPROBE_HIT_SSDONE:
400 /*
401 * We increment the nmissed count for accounting,
402 * we can also use npre/npostfault count for accouting
403 * these specific fault cases.
404 */
405 kprobes_inc_nmissed_count(cur);
406
407 /*
408 * We come here because instructions in the pre/post
409 * handler caused the page_fault, this could happen
410 * if handler tries to access user space by
411 * copy_from_user(), get_user() etc. Let the
412 * user-specified handler try to fix it first.
413 */
414 if (cur->fault_handler && cur->fault_handler(cur, regs, trapnr))
415 return 1;
416
417 /*
418 * In case the user-specified fault handler returned
419 * zero, try to fix up.
420 */
421 if ((entry = search_exception_tables(regs->nip)) != NULL) {
422 regs->nip = entry->fixup;
423 return 1;
424 }
425
426 /*
427 * fixup_exception() could not handle it,
428 * Let do_page_fault() fix it.
429 */
430 break;
431 default:
432 break;
387 } 433 }
388 return 0; 434 return 0;
389} 435}
@@ -397,6 +443,9 @@ int __kprobes kprobe_exceptions_notify(struct notifier_block *self,
397 struct die_args *args = (struct die_args *)data; 443 struct die_args *args = (struct die_args *)data;
398 int ret = NOTIFY_DONE; 444 int ret = NOTIFY_DONE;
399 445
446 if (args->regs && user_mode(args->regs))
447 return ret;
448
400 switch (val) { 449 switch (val) {
401 case DIE_BPT: 450 case DIE_BPT:
402 if (kprobe_handler(args->regs)) 451 if (kprobe_handler(args->regs))
diff --git a/arch/ppc/kernel/l2cr.S b/arch/powerpc/kernel/l2cr_6xx.S
index d7f4e982b539..d7f4e982b539 100644
--- a/arch/ppc/kernel/l2cr.S
+++ b/arch/powerpc/kernel/l2cr_6xx.S
diff --git a/arch/powerpc/kernel/legacy_serial.c b/arch/powerpc/kernel/legacy_serial.c
index c7a799a09516..6e67b5b49ba1 100644
--- a/arch/powerpc/kernel/legacy_serial.c
+++ b/arch/powerpc/kernel/legacy_serial.c
@@ -37,7 +37,7 @@ static int legacy_serial_console = -1;
37static int __init add_legacy_port(struct device_node *np, int want_index, 37static int __init add_legacy_port(struct device_node *np, int want_index,
38 int iotype, phys_addr_t base, 38 int iotype, phys_addr_t base,
39 phys_addr_t taddr, unsigned long irq, 39 phys_addr_t taddr, unsigned long irq,
40 unsigned int flags) 40 upf_t flags)
41{ 41{
42 u32 *clk, *spd, clock = BASE_BAUD * 16; 42 u32 *clk, *spd, clock = BASE_BAUD * 16;
43 int index; 43 int index;
@@ -113,7 +113,7 @@ static int __init add_legacy_soc_port(struct device_node *np,
113{ 113{
114 phys_addr_t addr; 114 phys_addr_t addr;
115 u32 *addrp; 115 u32 *addrp;
116 unsigned int flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST | UPF_SHARE_IRQ; 116 upf_t flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST | UPF_SHARE_IRQ;
117 117
118 /* We only support ports that have a clock frequency properly 118 /* We only support ports that have a clock frequency properly
119 * encoded in the device-tree. 119 * encoded in the device-tree.
@@ -236,6 +236,23 @@ static int __init add_legacy_pci_port(struct device_node *np,
236} 236}
237#endif 237#endif
238 238
239static void __init setup_legacy_serial_console(int console)
240{
241 struct legacy_serial_info *info =
242 &legacy_serial_infos[console];
243 void __iomem *addr;
244
245 if (info->taddr == 0)
246 return;
247 addr = ioremap(info->taddr, 0x1000);
248 if (addr == NULL)
249 return;
250 if (info->speed == 0)
251 info->speed = udbg_probe_uart_speed(addr, info->clock);
252 DBG("default console speed = %d\n", info->speed);
253 udbg_init_uart(addr, info->speed, info->clock);
254}
255
239/* 256/*
240 * This is called very early, as part of setup_system() or eventually 257 * This is called very early, as part of setup_system() or eventually
241 * setup_arch(), basically before anything else in this file. This function 258 * setup_arch(), basically before anything else in this file. This function
@@ -318,25 +335,8 @@ void __init find_legacy_serial_ports(void)
318#endif 335#endif
319 336
320 DBG("legacy_serial_console = %d\n", legacy_serial_console); 337 DBG("legacy_serial_console = %d\n", legacy_serial_console);
321 338 if (legacy_serial_console >= 0)
322 /* udbg is 64 bits only for now, that will change soon though ... */ 339 setup_legacy_serial_console(legacy_serial_console);
323 while (legacy_serial_console >= 0) {
324 struct legacy_serial_info *info =
325 &legacy_serial_infos[legacy_serial_console];
326 void __iomem *addr;
327
328 if (info->taddr == 0)
329 break;
330 addr = ioremap(info->taddr, 0x1000);
331 if (addr == NULL)
332 break;
333 if (info->speed == 0)
334 info->speed = udbg_probe_uart_speed(addr, info->clock);
335 DBG("default console speed = %d\n", info->speed);
336 udbg_init_uart(addr, info->speed, info->clock);
337 break;
338 }
339
340 DBG(" <- find_legacy_serial_port()\n"); 340 DBG(" <- find_legacy_serial_port()\n");
341} 341}
342 342
diff --git a/arch/powerpc/kernel/lparcfg.c b/arch/powerpc/kernel/lparcfg.c
index e789fef4eb8a..1b73508ecb2b 100644
--- a/arch/powerpc/kernel/lparcfg.c
+++ b/arch/powerpc/kernel/lparcfg.c
@@ -56,7 +56,7 @@ static unsigned long get_purr(void)
56 unsigned long sum_purr = 0; 56 unsigned long sum_purr = 0;
57 int cpu; 57 int cpu;
58 58
59 for_each_cpu(cpu) { 59 for_each_possible_cpu(cpu) {
60 sum_purr += lppaca[cpu].emulated_time_base; 60 sum_purr += lppaca[cpu].emulated_time_base;
61 61
62#ifdef PURR_DEBUG 62#ifdef PURR_DEBUG
@@ -222,7 +222,7 @@ static unsigned long get_purr(void)
222 int cpu; 222 int cpu;
223 struct cpu_usage *cu; 223 struct cpu_usage *cu;
224 224
225 for_each_cpu(cpu) { 225 for_each_possible_cpu(cpu) {
226 cu = &per_cpu(cpu_usage_array, cpu); 226 cu = &per_cpu(cpu_usage_array, cpu);
227 sum_purr += cu->current_tb; 227 sum_purr += cu->current_tb;
228 } 228 }
diff --git a/arch/ppc/kernel/module.c b/arch/powerpc/kernel/module_32.c
index 92f4e5f64f02..92f4e5f64f02 100644
--- a/arch/ppc/kernel/module.c
+++ b/arch/powerpc/kernel/module_32.c
diff --git a/arch/powerpc/kernel/nvram_64.c b/arch/powerpc/kernel/nvram_64.c
index fd7db8d542db..ada50aa5b600 100644
--- a/arch/powerpc/kernel/nvram_64.c
+++ b/arch/powerpc/kernel/nvram_64.c
@@ -160,7 +160,7 @@ static int dev_nvram_ioctl(struct inode *inode, struct file *file,
160 case IOC_NVRAM_GET_OFFSET: { 160 case IOC_NVRAM_GET_OFFSET: {
161 int part, offset; 161 int part, offset;
162 162
163 if (_machine != PLATFORM_POWERMAC) 163 if (!machine_is(powermac))
164 return -EINVAL; 164 return -EINVAL;
165 if (copy_from_user(&part, (void __user*)arg, sizeof(part)) != 0) 165 if (copy_from_user(&part, (void __user*)arg, sizeof(part)) != 0)
166 return -EFAULT; 166 return -EFAULT;
@@ -174,8 +174,9 @@ static int dev_nvram_ioctl(struct inode *inode, struct file *file,
174 return 0; 174 return 0;
175 } 175 }
176#endif /* CONFIG_PPC_PMAC */ 176#endif /* CONFIG_PPC_PMAC */
177 default:
178 return -EINVAL;
177 } 179 }
178 return -EINVAL;
179} 180}
180 181
181struct file_operations nvram_fops = { 182struct file_operations nvram_fops = {
@@ -443,7 +444,7 @@ static int nvram_setup_partition(void)
443 * in our nvram, as Apple defined partitions use pretty much 444 * in our nvram, as Apple defined partitions use pretty much
444 * all of the space 445 * all of the space
445 */ 446 */
446 if (_machine == PLATFORM_POWERMAC) 447 if (machine_is(powermac))
447 return -ENOSPC; 448 return -ENOSPC;
448 449
449 /* see if we have an OS partition that meets our needs. 450 /* see if we have an OS partition that meets our needs.
diff --git a/arch/powerpc/kernel/of_device.c b/arch/powerpc/kernel/of_device.c
index 22d83d4d1af5..9feeeef5a875 100644
--- a/arch/powerpc/kernel/of_device.c
+++ b/arch/powerpc/kernel/of_device.c
@@ -147,15 +147,12 @@ postcore_initcall(of_bus_driver_init);
147 147
148int of_register_driver(struct of_platform_driver *drv) 148int of_register_driver(struct of_platform_driver *drv)
149{ 149{
150 int count = 0;
151
152 /* initialize common driver fields */ 150 /* initialize common driver fields */
153 drv->driver.name = drv->name; 151 drv->driver.name = drv->name;
154 drv->driver.bus = &of_platform_bus_type; 152 drv->driver.bus = &of_platform_bus_type;
155 153
156 /* register with core */ 154 /* register with core */
157 count = driver_register(&drv->driver); 155 return driver_register(&drv->driver);
158 return count ? count : 1;
159} 156}
160 157
161void of_unregister_driver(struct of_platform_driver *drv) 158void of_unregister_driver(struct of_platform_driver *drv)
diff --git a/arch/powerpc/kernel/paca.c b/arch/powerpc/kernel/paca.c
index 5d1b708086bd..f505a8827e3e 100644
--- a/arch/powerpc/kernel/paca.c
+++ b/arch/powerpc/kernel/paca.c
@@ -56,14 +56,11 @@ struct lppaca lppaca[] = {
56 * processors. The processor VPD array needs one entry per physical 56 * processors. The processor VPD array needs one entry per physical
57 * processor (not thread). 57 * processor (not thread).
58 */ 58 */
59#define PACA_INIT_COMMON(number, start, asrr, asrv) \ 59#define PACA_INIT_COMMON(number) \
60 .lppaca_ptr = &lppaca[number], \ 60 .lppaca_ptr = &lppaca[number], \
61 .lock_token = 0x8000, \ 61 .lock_token = 0x8000, \
62 .paca_index = (number), /* Paca Index */ \ 62 .paca_index = (number), /* Paca Index */ \
63 .kernel_toc = (unsigned long)(&__toc_start) + 0x8000UL, \ 63 .kernel_toc = (unsigned long)(&__toc_start) + 0x8000UL, \
64 .stab_real = (asrr), /* Real pointer to segment table */ \
65 .stab_addr = (asrv), /* Virt pointer to segment table */ \
66 .cpu_start = (start), /* Processor start */ \
67 .hw_cpu_id = 0xffff, 64 .hw_cpu_id = 0xffff,
68 65
69#ifdef CONFIG_PPC_ISERIES 66#ifdef CONFIG_PPC_ISERIES
@@ -72,30 +69,20 @@ struct lppaca lppaca[] = {
72 69
73#define PACA_INIT(number) \ 70#define PACA_INIT(number) \
74{ \ 71{ \
75 PACA_INIT_COMMON(number, 0, 0, 0) \ 72 PACA_INIT_COMMON(number) \
76 PACA_INIT_ISERIES(number) \
77}
78
79#define BOOTCPU_PACA_INIT(number) \
80{ \
81 PACA_INIT_COMMON(number, 1, 0, (u64)&initial_stab) \
82 PACA_INIT_ISERIES(number) \ 73 PACA_INIT_ISERIES(number) \
83} 74}
84 75
85#else 76#else
86#define PACA_INIT(number) \ 77#define PACA_INIT(number) \
87{ \ 78{ \
88 PACA_INIT_COMMON(number, 0, 0, 0) \ 79 PACA_INIT_COMMON(number) \
89} 80}
90 81
91#define BOOTCPU_PACA_INIT(number) \
92{ \
93 PACA_INIT_COMMON(number, 1, STAB0_PHYS_ADDR, (u64)&initial_stab) \
94}
95#endif 82#endif
96 83
97struct paca_struct paca[] = { 84struct paca_struct paca[] = {
98 BOOTCPU_PACA_INIT(0), 85 PACA_INIT(0),
99#if NR_CPUS > 1 86#if NR_CPUS > 1
100 PACA_INIT( 1), PACA_INIT( 2), PACA_INIT( 3), 87 PACA_INIT( 1), PACA_INIT( 2), PACA_INIT( 3),
101#if NR_CPUS > 4 88#if NR_CPUS > 4
diff --git a/arch/powerpc/kernel/pci_32.c b/arch/powerpc/kernel/pci_32.c
index 704c846b2b0f..b129d2e4b759 100644
--- a/arch/powerpc/kernel/pci_32.c
+++ b/arch/powerpc/kernel/pci_32.c
@@ -787,7 +787,7 @@ pci_busdev_to_OF_node(struct pci_bus *bus, int devfn)
787 * fix has to be done by making the remapping per-host and always 787 * fix has to be done by making the remapping per-host and always
788 * filling the pci_to_OF map. --BenH 788 * filling the pci_to_OF map. --BenH
789 */ 789 */
790 if (_machine == _MACH_Pmac && busnr >= 0xf0) 790 if (machine_is(powermac) && busnr >= 0xf0)
791 busnr -= 0xf0; 791 busnr -= 0xf0;
792 else 792 else
793#endif 793#endif
@@ -1728,7 +1728,7 @@ long sys_pciconfig_iobase(long which, unsigned long bus, unsigned long devfn)
1728 * (bus 0 is HT root), we return the AGP one instead. 1728 * (bus 0 is HT root), we return the AGP one instead.
1729 */ 1729 */
1730#ifdef CONFIG_PPC_PMAC 1730#ifdef CONFIG_PPC_PMAC
1731 if (_machine == _MACH_Pmac && machine_is_compatible("MacRISC4")) 1731 if (machine_is(powermac) && machine_is_compatible("MacRISC4"))
1732 if (bus == 0) 1732 if (bus == 0)
1733 bus = 0xf0; 1733 bus = 0xf0;
1734#endif /* CONFIG_PPC_PMAC */ 1734#endif /* CONFIG_PPC_PMAC */
diff --git a/arch/powerpc/kernel/pci_64.c b/arch/powerpc/kernel/pci_64.c
index c367520bc1c3..4c4449be81ce 100644
--- a/arch/powerpc/kernel/pci_64.c
+++ b/arch/powerpc/kernel/pci_64.c
@@ -78,6 +78,7 @@ int global_phb_number; /* Global phb counter */
78 78
79/* Cached ISA bridge dev. */ 79/* Cached ISA bridge dev. */
80struct pci_dev *ppc64_isabridge_dev = NULL; 80struct pci_dev *ppc64_isabridge_dev = NULL;
81EXPORT_SYMBOL_GPL(ppc64_isabridge_dev);
81 82
82static void fixup_broken_pcnet32(struct pci_dev* dev) 83static void fixup_broken_pcnet32(struct pci_dev* dev)
83{ 84{
@@ -589,7 +590,6 @@ void __devinit scan_phb(struct pci_controller *hose)
589#endif /* CONFIG_PPC_MULTIPLATFORM */ 590#endif /* CONFIG_PPC_MULTIPLATFORM */
590 if (mode == PCI_PROBE_NORMAL) 591 if (mode == PCI_PROBE_NORMAL)
591 hose->last_busno = bus->subordinate = pci_scan_child_bus(bus); 592 hose->last_busno = bus->subordinate = pci_scan_child_bus(bus);
592 pci_bus_add_devices(bus);
593} 593}
594 594
595static int __init pcibios_init(void) 595static int __init pcibios_init(void)
@@ -608,8 +608,10 @@ static int __init pcibios_init(void)
608 printk("PCI: Probing PCI hardware\n"); 608 printk("PCI: Probing PCI hardware\n");
609 609
610 /* Scan all of the recorded PCI controllers. */ 610 /* Scan all of the recorded PCI controllers. */
611 list_for_each_entry_safe(hose, tmp, &hose_list, list_node) 611 list_for_each_entry_safe(hose, tmp, &hose_list, list_node) {
612 scan_phb(hose); 612 scan_phb(hose);
613 pci_bus_add_devices(hose->bus);
614 }
613 615
614#ifndef CONFIG_PPC_ISERIES 616#ifndef CONFIG_PPC_ISERIES
615 if (pci_probe_only) 617 if (pci_probe_only)
diff --git a/arch/powerpc/kernel/pci_iommu.c b/arch/powerpc/kernel/pci_iommu.c
index bdf15dbbf4f0..c336f3e31cff 100644
--- a/arch/powerpc/kernel/pci_iommu.c
+++ b/arch/powerpc/kernel/pci_iommu.c
@@ -1,5 +1,4 @@
1/* 1/*
2 * arch/ppc64/kernel/pci_iommu.c
3 * Copyright (C) 2001 Mike Corrigan & Dave Engebretsen, IBM Corporation 2 * Copyright (C) 2001 Mike Corrigan & Dave Engebretsen, IBM Corporation
4 * 3 *
5 * Rewrite, cleanup, new allocation schemes: 4 * Rewrite, cleanup, new allocation schemes:
diff --git a/arch/ppc/kernel/perfmon_fsl_booke.c b/arch/powerpc/kernel/perfmon_fsl_booke.c
index 32455dfcc36b..32455dfcc36b 100644
--- a/arch/ppc/kernel/perfmon_fsl_booke.c
+++ b/arch/powerpc/kernel/perfmon_fsl_booke.c
diff --git a/arch/powerpc/kernel/ppc_ksyms.c b/arch/powerpc/kernel/ppc_ksyms.c
index 8a731ea877b7..dfa5398ab3c8 100644
--- a/arch/powerpc/kernel/ppc_ksyms.c
+++ b/arch/powerpc/kernel/ppc_ksyms.c
@@ -57,7 +57,6 @@ extern void machine_check_exception(struct pt_regs *regs);
57extern void alignment_exception(struct pt_regs *regs); 57extern void alignment_exception(struct pt_regs *regs);
58extern void program_check_exception(struct pt_regs *regs); 58extern void program_check_exception(struct pt_regs *regs);
59extern void single_step_exception(struct pt_regs *regs); 59extern void single_step_exception(struct pt_regs *regs);
60extern int pmac_newworld;
61extern int sys_sigreturn(struct pt_regs *regs); 60extern int sys_sigreturn(struct pt_regs *regs);
62 61
63EXPORT_SYMBOL(clear_pages); 62EXPORT_SYMBOL(clear_pages);
@@ -110,15 +109,6 @@ EXPORT_SYMBOL(_insw_ns);
110EXPORT_SYMBOL(_outsw_ns); 109EXPORT_SYMBOL(_outsw_ns);
111EXPORT_SYMBOL(_insl_ns); 110EXPORT_SYMBOL(_insl_ns);
112EXPORT_SYMBOL(_outsl_ns); 111EXPORT_SYMBOL(_outsl_ns);
113EXPORT_SYMBOL(ioremap);
114#ifdef CONFIG_44x
115EXPORT_SYMBOL(ioremap64);
116#endif
117EXPORT_SYMBOL(__ioremap);
118EXPORT_SYMBOL(iounmap);
119#ifdef CONFIG_PPC32
120EXPORT_SYMBOL(ioremap_bot); /* aka VMALLOC_END */
121#endif
122 112
123#if defined(CONFIG_PPC32) && (defined(CONFIG_BLK_DEV_IDE) || defined(CONFIG_BLK_DEV_IDE_MODULE)) 113#if defined(CONFIG_PPC32) && (defined(CONFIG_BLK_DEV_IDE) || defined(CONFIG_BLK_DEV_IDE_MODULE))
124EXPORT_SYMBOL(ppc_ide_md); 114EXPORT_SYMBOL(ppc_ide_md);
@@ -161,7 +151,6 @@ EXPORT_SYMBOL(__flush_icache_range);
161EXPORT_SYMBOL(flush_dcache_range); 151EXPORT_SYMBOL(flush_dcache_range);
162 152
163#ifdef CONFIG_SMP 153#ifdef CONFIG_SMP
164EXPORT_SYMBOL(smp_call_function);
165#ifdef CONFIG_PPC32 154#ifdef CONFIG_PPC32
166EXPORT_SYMBOL(smp_hw_index); 155EXPORT_SYMBOL(smp_hw_index);
167#endif 156#endif
diff --git a/arch/powerpc/kernel/proc_ppc64.c b/arch/powerpc/kernel/proc_ppc64.c
index 7ba42a405f41..3c2cf661f6d9 100644
--- a/arch/powerpc/kernel/proc_ppc64.c
+++ b/arch/powerpc/kernel/proc_ppc64.c
@@ -23,6 +23,7 @@
23#include <linux/slab.h> 23#include <linux/slab.h>
24#include <linux/kernel.h> 24#include <linux/kernel.h>
25 25
26#include <asm/machdep.h>
26#include <asm/vdso_datapage.h> 27#include <asm/vdso_datapage.h>
27#include <asm/rtas.h> 28#include <asm/rtas.h>
28#include <asm/uaccess.h> 29#include <asm/uaccess.h>
@@ -51,7 +52,7 @@ static int __init proc_ppc64_create(void)
51 if (!root) 52 if (!root)
52 return 1; 53 return 1;
53 54
54 if (!(platform_is_pseries() || _machine == PLATFORM_CELL)) 55 if (!machine_is(pseries) && !machine_is(cell))
55 return 0; 56 return 0;
56 57
57 if (!proc_mkdir("rtas", root)) 58 if (!proc_mkdir("rtas", root))
diff --git a/arch/powerpc/kernel/process.c b/arch/powerpc/kernel/process.c
index c225cf154bfe..2dd47d2dd998 100644
--- a/arch/powerpc/kernel/process.c
+++ b/arch/powerpc/kernel/process.c
@@ -1,6 +1,4 @@
1/* 1/*
2 * arch/ppc/kernel/process.c
3 *
4 * Derived from "arch/i386/kernel/process.c" 2 * Derived from "arch/i386/kernel/process.c"
5 * Copyright (C) 1995 Linus Torvalds 3 * Copyright (C) 1995 Linus Torvalds
6 * 4 *
@@ -37,7 +35,6 @@
37#include <linux/mqueue.h> 35#include <linux/mqueue.h>
38#include <linux/hardirq.h> 36#include <linux/hardirq.h>
39#include <linux/utsname.h> 37#include <linux/utsname.h>
40#include <linux/kprobes.h>
41 38
42#include <asm/pgtable.h> 39#include <asm/pgtable.h>
43#include <asm/uaccess.h> 40#include <asm/uaccess.h>
@@ -47,9 +44,10 @@
47#include <asm/mmu.h> 44#include <asm/mmu.h>
48#include <asm/prom.h> 45#include <asm/prom.h>
49#include <asm/machdep.h> 46#include <asm/machdep.h>
47#include <asm/time.h>
48#include <asm/syscalls.h>
50#ifdef CONFIG_PPC64 49#ifdef CONFIG_PPC64
51#include <asm/firmware.h> 50#include <asm/firmware.h>
52#include <asm/time.h>
53#endif 51#endif
54 52
55extern unsigned long _get_SP(void); 53extern unsigned long _get_SP(void);
@@ -330,6 +328,11 @@ struct task_struct *__switch_to(struct task_struct *prev,
330#endif 328#endif
331 329
332 local_irq_save(flags); 330 local_irq_save(flags);
331
332 account_system_vtime(current);
333 account_process_vtime(current);
334 calculate_steal_time();
335
333 last = _switch(old_thread, new_thread); 336 last = _switch(old_thread, new_thread);
334 337
335 local_irq_restore(flags); 338 local_irq_restore(flags);
@@ -360,7 +363,11 @@ static void show_instructions(struct pt_regs *regs)
360 if (!(i % 8)) 363 if (!(i % 8))
361 printk("\n"); 364 printk("\n");
362 365
363 if (BAD_PC(pc) || __get_user(instr, (unsigned int *)pc)) { 366 /* We use __get_user here *only* to avoid an OOPS on a
367 * bad address because the pc *should* only be a
368 * kernel address.
369 */
370 if (BAD_PC(pc) || __get_user(instr, (unsigned int __user *)pc)) {
364 printk("XXXXXXXX "); 371 printk("XXXXXXXX ");
365 } else { 372 } else {
366 if (regs->nip == pc) 373 if (regs->nip == pc)
@@ -457,7 +464,6 @@ void show_regs(struct pt_regs * regs)
457 464
458void exit_thread(void) 465void exit_thread(void)
459{ 466{
460 kprobe_flush_task(current);
461 discard_lazy_cpu_state(); 467 discard_lazy_cpu_state();
462} 468}
463 469
@@ -764,7 +770,7 @@ out:
764 return error; 770 return error;
765} 771}
766 772
767static int validate_sp(unsigned long sp, struct task_struct *p, 773int validate_sp(unsigned long sp, struct task_struct *p,
768 unsigned long nbytes) 774 unsigned long nbytes)
769{ 775{
770 unsigned long stack_page = (unsigned long)task_stack_page(p); 776 unsigned long stack_page = (unsigned long)task_stack_page(p);
@@ -802,6 +808,8 @@ static int validate_sp(unsigned long sp, struct task_struct *p,
802#define FRAME_MARKER 2 808#define FRAME_MARKER 2
803#endif 809#endif
804 810
811EXPORT_SYMBOL(validate_sp);
812
805unsigned long get_wchan(struct task_struct *p) 813unsigned long get_wchan(struct task_struct *p)
806{ 814{
807 unsigned long ip, sp; 815 unsigned long ip, sp;
@@ -826,7 +834,6 @@ unsigned long get_wchan(struct task_struct *p)
826 } while (count++ < 16); 834 } while (count++ < 16);
827 return 0; 835 return 0;
828} 836}
829EXPORT_SYMBOL(get_wchan);
830 837
831static int kstack_depth_to_print = 64; 838static int kstack_depth_to_print = 64;
832 839
diff --git a/arch/powerpc/kernel/prom.c b/arch/powerpc/kernel/prom.c
index 6dbd21726770..4336390bcf34 100644
--- a/arch/powerpc/kernel/prom.c
+++ b/arch/powerpc/kernel/prom.c
@@ -383,14 +383,14 @@ static int __devinit finish_node_interrupts(struct device_node *np,
383 /* Apple uses bits in there in a different way, let's 383 /* Apple uses bits in there in a different way, let's
384 * only keep the real sense bit on macs 384 * only keep the real sense bit on macs
385 */ 385 */
386 if (_machine == PLATFORM_POWERMAC) 386 if (machine_is(powermac))
387 sense &= 0x1; 387 sense &= 0x1;
388 np->intrs[intrcount].sense = map_mpic_senses[sense]; 388 np->intrs[intrcount].sense = map_mpic_senses[sense];
389 } 389 }
390 390
391#ifdef CONFIG_PPC64 391#ifdef CONFIG_PPC64
392 /* We offset irq numbers for the u3 MPIC by 128 in PowerMac */ 392 /* We offset irq numbers for the u3 MPIC by 128 in PowerMac */
393 if (_machine == PLATFORM_POWERMAC && ic && ic->parent) { 393 if (machine_is(powermac) && ic && ic->parent) {
394 char *name = get_property(ic->parent, "name", NULL); 394 char *name = get_property(ic->parent, "name", NULL);
395 if (name && !strcmp(name, "u3")) 395 if (name && !strcmp(name, "u3"))
396 np->intrs[intrcount].line += 128; 396 np->intrs[intrcount].line += 128;
@@ -570,6 +570,18 @@ int __init of_scan_flat_dt(int (*it)(unsigned long node,
570 return rc; 570 return rc;
571} 571}
572 572
573unsigned long __init of_get_flat_dt_root(void)
574{
575 unsigned long p = ((unsigned long)initial_boot_params) +
576 initial_boot_params->off_dt_struct;
577
578 while(*((u32 *)p) == OF_DT_NOP)
579 p += 4;
580 BUG_ON (*((u32 *)p) != OF_DT_BEGIN_NODE);
581 p += 4;
582 return _ALIGN(p + strlen((char *)p) + 1, 4);
583}
584
573/** 585/**
574 * This function can be used within scan_flattened_dt callback to get 586 * This function can be used within scan_flattened_dt callback to get
575 * access to properties 587 * access to properties
@@ -612,6 +624,25 @@ void* __init of_get_flat_dt_prop(unsigned long node, const char *name,
612 } while(1); 624 } while(1);
613} 625}
614 626
627int __init of_flat_dt_is_compatible(unsigned long node, const char *compat)
628{
629 const char* cp;
630 unsigned long cplen, l;
631
632 cp = of_get_flat_dt_prop(node, "compatible", &cplen);
633 if (cp == NULL)
634 return 0;
635 while (cplen > 0) {
636 if (strncasecmp(cp, compat, strlen(compat)) == 0)
637 return 1;
638 l = strlen(cp) + 1;
639 cp += l;
640 cplen -= l;
641 }
642
643 return 0;
644}
645
615static void *__init unflatten_dt_alloc(unsigned long *mem, unsigned long size, 646static void *__init unflatten_dt_alloc(unsigned long *mem, unsigned long size,
616 unsigned long align) 647 unsigned long align)
617{ 648{
@@ -686,7 +717,7 @@ static unsigned long __init unflatten_dt_node(unsigned long mem,
686#ifdef DEBUG 717#ifdef DEBUG
687 if ((strlen(p) + l + 1) != allocl) { 718 if ((strlen(p) + l + 1) != allocl) {
688 DBG("%s: p: %d, l: %d, a: %d\n", 719 DBG("%s: p: %d, l: %d, a: %d\n",
689 pathp, strlen(p), l, allocl); 720 pathp, (int)strlen(p), l, allocl);
690 } 721 }
691#endif 722#endif
692 p += strlen(p); 723 p += strlen(p);
@@ -829,10 +860,6 @@ void __init unflatten_device_tree(void)
829 860
830 /* Allocate memory for the expanded device tree */ 861 /* Allocate memory for the expanded device tree */
831 mem = lmb_alloc(size + 4, __alignof__(struct device_node)); 862 mem = lmb_alloc(size + 4, __alignof__(struct device_node));
832 if (!mem) {
833 DBG("Couldn't allocate memory with lmb_alloc()!\n");
834 panic("Couldn't allocate memory with lmb_alloc()!\n");
835 }
836 mem = (unsigned long) __va(mem); 863 mem = (unsigned long) __va(mem);
837 864
838 ((u32 *)mem)[size / 4] = 0xdeadbeef; 865 ((u32 *)mem)[size / 4] = 0xdeadbeef;
@@ -858,35 +885,73 @@ void __init unflatten_device_tree(void)
858 DBG(" <- unflatten_device_tree()\n"); 885 DBG(" <- unflatten_device_tree()\n");
859} 886}
860 887
861
862static int __init early_init_dt_scan_cpus(unsigned long node, 888static int __init early_init_dt_scan_cpus(unsigned long node,
863 const char *uname, int depth, void *data) 889 const char *uname, int depth,
890 void *data)
864{ 891{
892 static int logical_cpuid = 0;
893 char *type = of_get_flat_dt_prop(node, "device_type", NULL);
894#ifdef CONFIG_ALTIVEC
865 u32 *prop; 895 u32 *prop;
866 unsigned long size; 896#endif
867 char *type = of_get_flat_dt_prop(node, "device_type", &size); 897 u32 *intserv;
898 int i, nthreads;
899 unsigned long len;
900 int found = 0;
868 901
869 /* We are scanning "cpu" nodes only */ 902 /* We are scanning "cpu" nodes only */
870 if (type == NULL || strcmp(type, "cpu") != 0) 903 if (type == NULL || strcmp(type, "cpu") != 0)
871 return 0; 904 return 0;
872 905
873 boot_cpuid = 0; 906 /* Get physical cpuid */
874 boot_cpuid_phys = 0; 907 intserv = of_get_flat_dt_prop(node, "ibm,ppc-interrupt-server#s", &len);
875 if (initial_boot_params && initial_boot_params->version >= 2) { 908 if (intserv) {
876 /* version 2 of the kexec param format adds the phys cpuid 909 nthreads = len / sizeof(int);
877 * of booted proc.
878 */
879 boot_cpuid_phys = initial_boot_params->boot_cpuid_phys;
880 } else { 910 } else {
881 /* Check if it's the boot-cpu, set it's hw index now */ 911 intserv = of_get_flat_dt_prop(node, "reg", NULL);
882 if (of_get_flat_dt_prop(node, 912 nthreads = 1;
913 }
914
915 /*
916 * Now see if any of these threads match our boot cpu.
917 * NOTE: This must match the parsing done in smp_setup_cpu_maps.
918 */
919 for (i = 0; i < nthreads; i++) {
920 /*
921 * version 2 of the kexec param format adds the phys cpuid of
922 * booted proc.
923 */
924 if (initial_boot_params && initial_boot_params->version >= 2) {
925 if (intserv[i] ==
926 initial_boot_params->boot_cpuid_phys) {
927 found = 1;
928 break;
929 }
930 } else {
931 /*
932 * Check if it's the boot-cpu, set it's hw index now,
933 * unfortunately this format did not support booting
934 * off secondary threads.
935 */
936 if (of_get_flat_dt_prop(node,
883 "linux,boot-cpu", NULL) != NULL) { 937 "linux,boot-cpu", NULL) != NULL) {
884 prop = of_get_flat_dt_prop(node, "reg", NULL); 938 found = 1;
885 if (prop != NULL) 939 break;
886 boot_cpuid_phys = *prop; 940 }
887 } 941 }
942
943#ifdef CONFIG_SMP
944 /* logical cpu id is always 0 on UP kernels */
945 logical_cpuid++;
946#endif
947 }
948
949 if (found) {
950 DBG("boot cpu: logical %d physical %d\n", logical_cpuid,
951 intserv[i]);
952 boot_cpuid = logical_cpuid;
953 set_hard_smp_processor_id(boot_cpuid, intserv[i]);
888 } 954 }
889 set_hard_smp_processor_id(0, boot_cpuid_phys);
890 955
891#ifdef CONFIG_ALTIVEC 956#ifdef CONFIG_ALTIVEC
892 /* Check if we have a VMX and eventually update CPU features */ 957 /* Check if we have a VMX and eventually update CPU features */
@@ -905,16 +970,10 @@ static int __init early_init_dt_scan_cpus(unsigned long node,
905#endif /* CONFIG_ALTIVEC */ 970#endif /* CONFIG_ALTIVEC */
906 971
907#ifdef CONFIG_PPC_PSERIES 972#ifdef CONFIG_PPC_PSERIES
908 /* 973 if (nthreads > 1)
909 * Check for an SMT capable CPU and set the CPU feature. We do
910 * this by looking at the size of the ibm,ppc-interrupt-server#s
911 * property
912 */
913 prop = (u32 *)of_get_flat_dt_prop(node, "ibm,ppc-interrupt-server#s",
914 &size);
915 cur_cpu_spec->cpu_features &= ~CPU_FTR_SMT;
916 if (prop && ((size / sizeof(u32)) > 1))
917 cur_cpu_spec->cpu_features |= CPU_FTR_SMT; 974 cur_cpu_spec->cpu_features |= CPU_FTR_SMT;
975 else
976 cur_cpu_spec->cpu_features &= ~CPU_FTR_SMT;
918#endif 977#endif
919 978
920 return 0; 979 return 0;
@@ -923,7 +982,6 @@ static int __init early_init_dt_scan_cpus(unsigned long node,
923static int __init early_init_dt_scan_chosen(unsigned long node, 982static int __init early_init_dt_scan_chosen(unsigned long node,
924 const char *uname, int depth, void *data) 983 const char *uname, int depth, void *data)
925{ 984{
926 u32 *prop;
927 unsigned long *lprop; 985 unsigned long *lprop;
928 unsigned long l; 986 unsigned long l;
929 char *p; 987 char *p;
@@ -934,14 +992,6 @@ static int __init early_init_dt_scan_chosen(unsigned long node,
934 (strcmp(uname, "chosen") != 0 && strcmp(uname, "chosen@0") != 0)) 992 (strcmp(uname, "chosen") != 0 && strcmp(uname, "chosen@0") != 0))
935 return 0; 993 return 0;
936 994
937 /* get platform type */
938 prop = (u32 *)of_get_flat_dt_prop(node, "linux,platform", NULL);
939 if (prop == NULL)
940 return 0;
941#ifdef CONFIG_PPC_MULTIPLATFORM
942 _machine = *prop;
943#endif
944
945#ifdef CONFIG_PPC64 995#ifdef CONFIG_PPC64
946 /* check if iommu is forced on or off */ 996 /* check if iommu is forced on or off */
947 if (of_get_flat_dt_prop(node, "linux,iommu-off", NULL) != NULL) 997 if (of_get_flat_dt_prop(node, "linux,iommu-off", NULL) != NULL)
@@ -968,15 +1018,15 @@ static int __init early_init_dt_scan_chosen(unsigned long node,
968 * set of RTAS infos now if available 1018 * set of RTAS infos now if available
969 */ 1019 */
970 { 1020 {
971 u64 *basep, *entryp; 1021 u64 *basep, *entryp, *sizep;
972 1022
973 basep = of_get_flat_dt_prop(node, "linux,rtas-base", NULL); 1023 basep = of_get_flat_dt_prop(node, "linux,rtas-base", NULL);
974 entryp = of_get_flat_dt_prop(node, "linux,rtas-entry", NULL); 1024 entryp = of_get_flat_dt_prop(node, "linux,rtas-entry", NULL);
975 prop = of_get_flat_dt_prop(node, "linux,rtas-size", NULL); 1025 sizep = of_get_flat_dt_prop(node, "linux,rtas-size", NULL);
976 if (basep && entryp && prop) { 1026 if (basep && entryp && sizep) {
977 rtas.base = *basep; 1027 rtas.base = *basep;
978 rtas.entry = *entryp; 1028 rtas.entry = *entryp;
979 rtas.size = *prop; 1029 rtas.size = *sizep;
980 } 1030 }
981 } 1031 }
982#endif /* CONFIG_PPC_RTAS */ 1032#endif /* CONFIG_PPC_RTAS */
@@ -1005,25 +1055,13 @@ static int __init early_init_dt_scan_chosen(unsigned long node,
1005 1055
1006 if (strstr(cmd_line, "mem=")) { 1056 if (strstr(cmd_line, "mem=")) {
1007 char *p, *q; 1057 char *p, *q;
1008 unsigned long maxmem = 0;
1009 1058
1010 for (q = cmd_line; (p = strstr(q, "mem=")) != 0; ) { 1059 for (q = cmd_line; (p = strstr(q, "mem=")) != 0; ) {
1011 q = p + 4; 1060 q = p + 4;
1012 if (p > cmd_line && p[-1] != ' ') 1061 if (p > cmd_line && p[-1] != ' ')
1013 continue; 1062 continue;
1014 maxmem = simple_strtoul(q, &q, 0); 1063 memory_limit = memparse(q, &q);
1015 if (*q == 'k' || *q == 'K') {
1016 maxmem <<= 10;
1017 ++q;
1018 } else if (*q == 'm' || *q == 'M') {
1019 maxmem <<= 20;
1020 ++q;
1021 } else if (*q == 'g' || *q == 'G') {
1022 maxmem <<= 30;
1023 ++q;
1024 }
1025 } 1064 }
1026 memory_limit = maxmem;
1027 } 1065 }
1028 1066
1029 /* break now */ 1067 /* break now */
@@ -1759,7 +1797,7 @@ static int of_finish_dynamic_node(struct device_node *node)
1759 /* We don't support that function on PowerMac, at least 1797 /* We don't support that function on PowerMac, at least
1760 * not yet 1798 * not yet
1761 */ 1799 */
1762 if (_machine == PLATFORM_POWERMAC) 1800 if (machine_is(powermac))
1763 return -ENODEV; 1801 return -ENODEV;
1764 1802
1765 /* fix up new node's linux_phandle field */ 1803 /* fix up new node's linux_phandle field */
diff --git a/arch/powerpc/kernel/prom_init.c b/arch/powerpc/kernel/prom_init.c
index 813c2cd194c2..d66c5e77fcff 100644
--- a/arch/powerpc/kernel/prom_init.c
+++ b/arch/powerpc/kernel/prom_init.c
@@ -180,6 +180,16 @@ static unsigned long __initdata prom_tce_alloc_start;
180static unsigned long __initdata prom_tce_alloc_end; 180static unsigned long __initdata prom_tce_alloc_end;
181#endif 181#endif
182 182
183/* Platforms codes are now obsolete in the kernel. Now only used within this
184 * file and ultimately gone too. Feel free to change them if you need, they
185 * are not shared with anything outside of this file anymore
186 */
187#define PLATFORM_PSERIES 0x0100
188#define PLATFORM_PSERIES_LPAR 0x0101
189#define PLATFORM_LPAR 0x0001
190#define PLATFORM_POWERMAC 0x0400
191#define PLATFORM_GENERIC 0x0500
192
183static int __initdata of_platform; 193static int __initdata of_platform;
184 194
185static char __initdata prom_cmd_line[COMMAND_LINE_SIZE]; 195static char __initdata prom_cmd_line[COMMAND_LINE_SIZE];
@@ -397,6 +407,11 @@ static void __init __attribute__((noreturn)) prom_panic(const char *reason)
397 reason = PTRRELOC(reason); 407 reason = PTRRELOC(reason);
398#endif 408#endif
399 prom_print(reason); 409 prom_print(reason);
410 /* Do not call exit because it clears the screen on pmac
411 * it also causes some sort of double-fault on early pmacs */
412 if (RELOC(of_platform) == PLATFORM_POWERMAC)
413 asm("trap\n");
414
400 /* ToDo: should put up an SRC here on p/iSeries */ 415 /* ToDo: should put up an SRC here on p/iSeries */
401 call_prom("exit", 0, 0); 416 call_prom("exit", 0, 0);
402 417
@@ -1487,7 +1502,10 @@ static int __init prom_find_machine_type(void)
1487 int len, i = 0; 1502 int len, i = 0;
1488#ifdef CONFIG_PPC64 1503#ifdef CONFIG_PPC64
1489 phandle rtas; 1504 phandle rtas;
1505 int x;
1490#endif 1506#endif
1507
1508 /* Look for a PowerMac */
1491 len = prom_getprop(_prom->root, "compatible", 1509 len = prom_getprop(_prom->root, "compatible",
1492 compat, sizeof(compat)-1); 1510 compat, sizeof(compat)-1);
1493 if (len > 0) { 1511 if (len > 0) {
@@ -1500,28 +1518,36 @@ static int __init prom_find_machine_type(void)
1500 if (strstr(p, RELOC("Power Macintosh")) || 1518 if (strstr(p, RELOC("Power Macintosh")) ||
1501 strstr(p, RELOC("MacRISC"))) 1519 strstr(p, RELOC("MacRISC")))
1502 return PLATFORM_POWERMAC; 1520 return PLATFORM_POWERMAC;
1503#ifdef CONFIG_PPC64
1504 if (strstr(p, RELOC("Momentum,Maple")))
1505 return PLATFORM_MAPLE;
1506 if (strstr(p, RELOC("IBM,CPB")))
1507 return PLATFORM_CELL;
1508#endif
1509 i += sl + 1; 1521 i += sl + 1;
1510 } 1522 }
1511 } 1523 }
1512#ifdef CONFIG_PPC64 1524#ifdef CONFIG_PPC64
1525 /* If not a mac, try to figure out if it's an IBM pSeries or any other
1526 * PAPR compliant platform. We assume it is if :
1527 * - /device_type is "chrp" (please, do NOT use that for future
1528 * non-IBM designs !
1529 * - it has /rtas
1530 */
1531 len = prom_getprop(_prom->root, "model",
1532 compat, sizeof(compat)-1);
1533 if (len <= 0)
1534 return PLATFORM_GENERIC;
1535 compat[len] = 0;
1536 if (strcmp(compat, "chrp"))
1537 return PLATFORM_GENERIC;
1538
1513 /* Default to pSeries. We need to know if we are running LPAR */ 1539 /* Default to pSeries. We need to know if we are running LPAR */
1514 rtas = call_prom("finddevice", 1, 1, ADDR("/rtas")); 1540 rtas = call_prom("finddevice", 1, 1, ADDR("/rtas"));
1515 if (PHANDLE_VALID(rtas)) { 1541 if (!PHANDLE_VALID(rtas))
1516 int x = prom_getproplen(rtas, "ibm,hypertas-functions"); 1542 return PLATFORM_GENERIC;
1517 if (x != PROM_ERROR) { 1543 x = prom_getproplen(rtas, "ibm,hypertas-functions");
1518 prom_printf("Hypertas detected, assuming LPAR !\n"); 1544 if (x != PROM_ERROR) {
1519 return PLATFORM_PSERIES_LPAR; 1545 prom_printf("Hypertas detected, assuming LPAR !\n");
1520 } 1546 return PLATFORM_PSERIES_LPAR;
1521 } 1547 }
1522 return PLATFORM_PSERIES; 1548 return PLATFORM_PSERIES;
1523#else 1549#else
1524 return PLATFORM_CHRP; 1550 return PLATFORM_GENERIC;
1525#endif 1551#endif
1526} 1552}
1527 1553
@@ -2029,7 +2055,6 @@ unsigned long __init prom_init(unsigned long r3, unsigned long r4,
2029{ 2055{
2030 struct prom_t *_prom; 2056 struct prom_t *_prom;
2031 unsigned long hdr; 2057 unsigned long hdr;
2032 u32 getprop_rval;
2033 unsigned long offset = reloc_offset(); 2058 unsigned long offset = reloc_offset();
2034 2059
2035#ifdef CONFIG_PPC32 2060#ifdef CONFIG_PPC32
@@ -2060,6 +2085,12 @@ unsigned long __init prom_init(unsigned long r3, unsigned long r4,
2060 */ 2085 */
2061 prom_init_stdout(); 2086 prom_init_stdout();
2062 2087
2088 /*
2089 * Get default machine type. At this point, we do not differentiate
2090 * between pSeries SMP and pSeries LPAR
2091 */
2092 RELOC(of_platform) = prom_find_machine_type();
2093
2063 /* Bail if this is a kdump kernel. */ 2094 /* Bail if this is a kdump kernel. */
2064 if (PHYSICAL_START > 0) 2095 if (PHYSICAL_START > 0)
2065 prom_panic("Error: You can't boot a kdump kernel from OF!\n"); 2096 prom_panic("Error: You can't boot a kdump kernel from OF!\n");
@@ -2069,15 +2100,6 @@ unsigned long __init prom_init(unsigned long r3, unsigned long r4,
2069 */ 2100 */
2070 prom_check_initrd(r3, r4); 2101 prom_check_initrd(r3, r4);
2071 2102
2072 /*
2073 * Get default machine type. At this point, we do not differentiate
2074 * between pSeries SMP and pSeries LPAR
2075 */
2076 RELOC(of_platform) = prom_find_machine_type();
2077 getprop_rval = RELOC(of_platform);
2078 prom_setprop(_prom->chosen, "/chosen", "linux,platform",
2079 &getprop_rval, sizeof(getprop_rval));
2080
2081#ifdef CONFIG_PPC_PSERIES 2103#ifdef CONFIG_PPC_PSERIES
2082 /* 2104 /*
2083 * On pSeries, inform the firmware about our capabilities 2105 * On pSeries, inform the firmware about our capabilities
diff --git a/arch/powerpc/kernel/ptrace-common.h b/arch/powerpc/kernel/ptrace-common.h
index 5ccbdbe0d5c9..c42a860c8d25 100644
--- a/arch/powerpc/kernel/ptrace-common.h
+++ b/arch/powerpc/kernel/ptrace-common.h
@@ -1,6 +1,4 @@
1/* 1/*
2 * linux/arch/ppc64/kernel/ptrace-common.h
3 *
4 * Copyright (c) 2002 Stephen Rothwell, IBM Coproration 2 * Copyright (c) 2002 Stephen Rothwell, IBM Coproration
5 * Extracted from ptrace.c and ptrace32.c 3 * Extracted from ptrace.c and ptrace32.c
6 * 4 *
diff --git a/arch/powerpc/kernel/rtas-proc.c b/arch/powerpc/kernel/rtas-proc.c
index 7a95b8a28354..456286cf1d14 100644
--- a/arch/powerpc/kernel/rtas-proc.c
+++ b/arch/powerpc/kernel/rtas-proc.c
@@ -1,5 +1,4 @@
1/* 1/*
2 * arch/ppc64/kernel/rtas-proc.c
3 * Copyright (C) 2000 Tilmann Bitterberg 2 * Copyright (C) 2000 Tilmann Bitterberg
4 * (tilmann@bitterberg.de) 3 * (tilmann@bitterberg.de)
5 * 4 *
@@ -258,7 +257,7 @@ static int __init proc_rtas_init(void)
258{ 257{
259 struct proc_dir_entry *entry; 258 struct proc_dir_entry *entry;
260 259
261 if (_machine != PLATFORM_PSERIES && _machine != PLATFORM_PSERIES_LPAR) 260 if (!machine_is(pseries))
262 return 1; 261 return 1;
263 262
264 rtas_node = of_find_node_by_name(NULL, "rtas"); 263 rtas_node = of_find_node_by_name(NULL, "rtas");
diff --git a/arch/powerpc/kernel/rtas-rtc.c b/arch/powerpc/kernel/rtas-rtc.c
index 635d3b9a8811..34d073fb6091 100644
--- a/arch/powerpc/kernel/rtas-rtc.c
+++ b/arch/powerpc/kernel/rtas-rtc.c
@@ -52,7 +52,7 @@ void rtas_get_rtc_time(struct rtc_time *rtc_tm)
52 error = rtas_call(rtas_token("get-time-of-day"), 0, 8, ret); 52 error = rtas_call(rtas_token("get-time-of-day"), 0, 8, ret);
53 if (error == RTAS_CLOCK_BUSY || rtas_is_extended_busy(error)) { 53 if (error == RTAS_CLOCK_BUSY || rtas_is_extended_busy(error)) {
54 if (in_interrupt() && printk_ratelimit()) { 54 if (in_interrupt() && printk_ratelimit()) {
55 memset(&rtc_tm, 0, sizeof(struct rtc_time)); 55 memset(rtc_tm, 0, sizeof(struct rtc_time));
56 printk(KERN_WARNING "error: reading clock" 56 printk(KERN_WARNING "error: reading clock"
57 " would delay interrupt\n"); 57 " would delay interrupt\n");
58 return; /* delay not allowed */ 58 return; /* delay not allowed */
diff --git a/arch/powerpc/kernel/rtas.c b/arch/powerpc/kernel/rtas.c
index b5b2add7ad1e..06636c927a7e 100644
--- a/arch/powerpc/kernel/rtas.c
+++ b/arch/powerpc/kernel/rtas.c
@@ -25,6 +25,7 @@
25#include <asm/hvcall.h> 25#include <asm/hvcall.h>
26#include <asm/semaphore.h> 26#include <asm/semaphore.h>
27#include <asm/machdep.h> 27#include <asm/machdep.h>
28#include <asm/firmware.h>
28#include <asm/page.h> 29#include <asm/page.h>
29#include <asm/param.h> 30#include <asm/param.h>
30#include <asm/system.h> 31#include <asm/system.h>
@@ -32,6 +33,7 @@
32#include <asm/uaccess.h> 33#include <asm/uaccess.h>
33#include <asm/lmb.h> 34#include <asm/lmb.h>
34#include <asm/udbg.h> 35#include <asm/udbg.h>
36#include <asm/syscalls.h>
35 37
36struct rtas_t rtas = { 38struct rtas_t rtas = {
37 .lock = SPIN_LOCK_UNLOCKED 39 .lock = SPIN_LOCK_UNLOCKED
@@ -591,7 +593,7 @@ static void rtas_percpu_suspend_me(void *info)
591 data->waiting = 0; 593 data->waiting = 0;
592 data->args->args[data->args->nargs] = 594 data->args->args[data->args->nargs] =
593 rtas_call(ibm_suspend_me_token, 0, 1, NULL); 595 rtas_call(ibm_suspend_me_token, 0, 1, NULL);
594 for_each_cpu(i) 596 for_each_possible_cpu(i)
595 plpar_hcall_norets(H_PROD,i); 597 plpar_hcall_norets(H_PROD,i);
596 } else { 598 } else {
597 data->waiting = -EBUSY; 599 data->waiting = -EBUSY;
@@ -624,7 +626,7 @@ static int rtas_ibm_suspend_me(struct rtas_args *args)
624 /* Prod each CPU. This won't hurt, and will wake 626 /* Prod each CPU. This won't hurt, and will wake
625 * anyone we successfully put to sleep with H_Join 627 * anyone we successfully put to sleep with H_Join
626 */ 628 */
627 for_each_cpu(i) 629 for_each_possible_cpu(i)
628 plpar_hcall_norets(H_PROD, i); 630 plpar_hcall_norets(H_PROD, i);
629 631
630 return data.waiting; 632 return data.waiting;
@@ -767,7 +769,7 @@ void __init rtas_initialize(void)
767 * the stop-self token if any 769 * the stop-self token if any
768 */ 770 */
769#ifdef CONFIG_PPC64 771#ifdef CONFIG_PPC64
770 if (_machine == PLATFORM_PSERIES_LPAR) { 772 if (machine_is(pseries) && firmware_has_feature(FW_FEATURE_LPAR)) {
771 rtas_region = min(lmb.rmo_size, RTAS_INSTANTIATE_MAX); 773 rtas_region = min(lmb.rmo_size, RTAS_INSTANTIATE_MAX);
772 ibm_suspend_me_token = rtas_token("ibm,suspend-me"); 774 ibm_suspend_me_token = rtas_token("ibm,suspend-me");
773 } 775 }
diff --git a/arch/powerpc/kernel/rtas_pci.c b/arch/powerpc/kernel/rtas_pci.c
index 5579f6559912..57b539a03fa9 100644
--- a/arch/powerpc/kernel/rtas_pci.c
+++ b/arch/powerpc/kernel/rtas_pci.c
@@ -1,6 +1,4 @@
1/* 1/*
2 * arch/ppc64/kernel/rtas_pci.c
3 *
4 * Copyright (C) 2001 Dave Engebretsen, IBM Corporation 2 * Copyright (C) 2001 Dave Engebretsen, IBM Corporation
5 * Copyright (C) 2003 Anton Blanchard <anton@au.ibm.com>, IBM 3 * Copyright (C) 2003 Anton Blanchard <anton@au.ibm.com>, IBM
6 * 4 *
@@ -280,8 +278,7 @@ static int phb_set_bus_ranges(struct device_node *dev,
280 return 0; 278 return 0;
281} 279}
282 280
283static int __devinit setup_phb(struct device_node *dev, 281int __devinit setup_phb(struct device_node *dev, struct pci_controller *phb)
284 struct pci_controller *phb)
285{ 282{
286 if (is_python(dev)) 283 if (is_python(dev))
287 python_countermeasures(dev); 284 python_countermeasures(dev);
@@ -359,27 +356,6 @@ unsigned long __init find_and_init_phbs(void)
359 return 0; 356 return 0;
360} 357}
361 358
362struct pci_controller * __devinit init_phb_dynamic(struct device_node *dn)
363{
364 struct pci_controller *phb;
365 int primary;
366
367 primary = list_empty(&hose_list);
368 phb = pcibios_alloc_controller(dn);
369 if (!phb)
370 return NULL;
371 setup_phb(dn, phb);
372 pci_process_bridge_OF_ranges(phb, dn, primary);
373
374 pci_setup_phb_io_dynamic(phb, primary);
375
376 pci_devs_phb_init_dynamic(phb);
377 scan_phb(phb);
378
379 return phb;
380}
381EXPORT_SYMBOL(init_phb_dynamic);
382
383/* RPA-specific bits for removing PHBs */ 359/* RPA-specific bits for removing PHBs */
384int pcibios_remove_root_bus(struct pci_controller *phb) 360int pcibios_remove_root_bus(struct pci_controller *phb)
385{ 361{
diff --git a/arch/powerpc/kernel/setup-common.c b/arch/powerpc/kernel/setup-common.c
index fc89d009d18d..1d93e73a7003 100644
--- a/arch/powerpc/kernel/setup-common.c
+++ b/arch/powerpc/kernel/setup-common.c
@@ -9,6 +9,9 @@
9 * as published by the Free Software Foundation; either version 9 * as published by the Free Software Foundation; either version
10 * 2 of the License, or (at your option) any later version. 10 * 2 of the License, or (at your option) any later version.
11 */ 11 */
12
13#undef DEBUG
14
12#include <linux/config.h> 15#include <linux/config.h>
13#include <linux/module.h> 16#include <linux/module.h>
14#include <linux/string.h> 17#include <linux/string.h>
@@ -42,6 +45,7 @@
42#include <asm/time.h> 45#include <asm/time.h>
43#include <asm/cputable.h> 46#include <asm/cputable.h>
44#include <asm/sections.h> 47#include <asm/sections.h>
48#include <asm/firmware.h>
45#include <asm/btext.h> 49#include <asm/btext.h>
46#include <asm/nvram.h> 50#include <asm/nvram.h>
47#include <asm/setup.h> 51#include <asm/setup.h>
@@ -57,8 +61,6 @@
57 61
58#include "setup.h" 62#include "setup.h"
59 63
60#undef DEBUG
61
62#ifdef DEBUG 64#ifdef DEBUG
63#include <asm/udbg.h> 65#include <asm/udbg.h>
64#define DBG(fmt...) udbg_printf(fmt) 66#define DBG(fmt...) udbg_printf(fmt)
@@ -66,10 +68,12 @@
66#define DBG(fmt...) 68#define DBG(fmt...)
67#endif 69#endif
68 70
69#ifdef CONFIG_PPC_MULTIPLATFORM 71/* The main machine-dep calls structure
70int _machine = 0; 72 */
71EXPORT_SYMBOL(_machine); 73struct machdep_calls ppc_md;
72#endif 74EXPORT_SYMBOL(ppc_md);
75struct machdep_calls *machine_id;
76EXPORT_SYMBOL(machine_id);
73 77
74unsigned long klimit = (unsigned long) _end; 78unsigned long klimit = (unsigned long) _end;
75 79
@@ -163,14 +167,14 @@ static int show_cpuinfo(struct seq_file *m, void *v)
163#if defined(CONFIG_SMP) && defined(CONFIG_PPC32) 167#if defined(CONFIG_SMP) && defined(CONFIG_PPC32)
164 unsigned long bogosum = 0; 168 unsigned long bogosum = 0;
165 int i; 169 int i;
166 for (i = 0; i < NR_CPUS; ++i) 170 for_each_online_cpu(i)
167 if (cpu_online(i)) 171 bogosum += loops_per_jiffy;
168 bogosum += loops_per_jiffy;
169 seq_printf(m, "total bogomips\t: %lu.%02lu\n", 172 seq_printf(m, "total bogomips\t: %lu.%02lu\n",
170 bogosum/(500000/HZ), bogosum/(5000/HZ) % 100); 173 bogosum/(500000/HZ), bogosum/(5000/HZ) % 100);
171#endif /* CONFIG_SMP && CONFIG_PPC32 */ 174#endif /* CONFIG_SMP && CONFIG_PPC32 */
172 seq_printf(m, "timebase\t: %lu\n", ppc_tb_freq); 175 seq_printf(m, "timebase\t: %lu\n", ppc_tb_freq);
173 176 if (ppc_md.name)
177 seq_printf(m, "platform\t: %s\n", ppc_md.name);
174 if (ppc_md.show_cpuinfo != NULL) 178 if (ppc_md.show_cpuinfo != NULL)
175 ppc_md.show_cpuinfo(m); 179 ppc_md.show_cpuinfo(m);
176 180
@@ -354,12 +358,13 @@ void __init check_for_initrd(void)
354 * must be called before using this. 358 * must be called before using this.
355 * 359 *
356 * While we're here, we may as well set the "physical" cpu ids in the paca. 360 * While we're here, we may as well set the "physical" cpu ids in the paca.
361 *
362 * NOTE: This must match the parsing done in early_init_dt_scan_cpus.
357 */ 363 */
358void __init smp_setup_cpu_maps(void) 364void __init smp_setup_cpu_maps(void)
359{ 365{
360 struct device_node *dn = NULL; 366 struct device_node *dn = NULL;
361 int cpu = 0; 367 int cpu = 0;
362 int swap_cpuid = 0;
363 368
364 while ((dn = of_find_node_by_type(dn, "cpu")) && cpu < NR_CPUS) { 369 while ((dn = of_find_node_by_type(dn, "cpu")) && cpu < NR_CPUS) {
365 int *intserv; 370 int *intserv;
@@ -378,30 +383,17 @@ void __init smp_setup_cpu_maps(void)
378 for (j = 0; j < nthreads && cpu < NR_CPUS; j++) { 383 for (j = 0; j < nthreads && cpu < NR_CPUS; j++) {
379 cpu_set(cpu, cpu_present_map); 384 cpu_set(cpu, cpu_present_map);
380 set_hard_smp_processor_id(cpu, intserv[j]); 385 set_hard_smp_processor_id(cpu, intserv[j]);
381
382 if (intserv[j] == boot_cpuid_phys)
383 swap_cpuid = cpu;
384 cpu_set(cpu, cpu_possible_map); 386 cpu_set(cpu, cpu_possible_map);
385 cpu++; 387 cpu++;
386 } 388 }
387 } 389 }
388 390
389 /* Swap CPU id 0 with boot_cpuid_phys, so we can always assume that
390 * boot cpu is logical 0.
391 */
392 if (boot_cpuid_phys != get_hard_smp_processor_id(0)) {
393 u32 tmp;
394 tmp = get_hard_smp_processor_id(0);
395 set_hard_smp_processor_id(0, boot_cpuid_phys);
396 set_hard_smp_processor_id(swap_cpuid, tmp);
397 }
398
399#ifdef CONFIG_PPC64 391#ifdef CONFIG_PPC64
400 /* 392 /*
401 * On pSeries LPAR, we need to know how many cpus 393 * On pSeries LPAR, we need to know how many cpus
402 * could possibly be added to this partition. 394 * could possibly be added to this partition.
403 */ 395 */
404 if (_machine == PLATFORM_PSERIES_LPAR && 396 if (machine_is(pseries) && firmware_has_feature(FW_FEATURE_LPAR) &&
405 (dn = of_find_node_by_path("/rtas"))) { 397 (dn = of_find_node_by_path("/rtas"))) {
406 int num_addr_cell, num_size_cell, maxcpus; 398 int num_addr_cell, num_size_cell, maxcpus;
407 unsigned int *ireg; 399 unsigned int *ireg;
@@ -440,7 +432,7 @@ void __init smp_setup_cpu_maps(void)
440 /* 432 /*
441 * Do the sibling map; assume only two threads per processor. 433 * Do the sibling map; assume only two threads per processor.
442 */ 434 */
443 for_each_cpu(cpu) { 435 for_each_possible_cpu(cpu) {
444 cpu_set(cpu, cpu_sibling_map[cpu]); 436 cpu_set(cpu, cpu_sibling_map[cpu]);
445 if (cpu_has_feature(CPU_FTR_SMT)) 437 if (cpu_has_feature(CPU_FTR_SMT))
446 cpu_set(cpu ^ 0x1, cpu_sibling_map[cpu]); 438 cpu_set(cpu ^ 0x1, cpu_sibling_map[cpu]);
@@ -493,3 +485,34 @@ static __init int add_pcspkr(void)
493 return ret; 485 return ret;
494} 486}
495device_initcall(add_pcspkr); 487device_initcall(add_pcspkr);
488
489void probe_machine(void)
490{
491 extern struct machdep_calls __machine_desc_start;
492 extern struct machdep_calls __machine_desc_end;
493
494 /*
495 * Iterate all ppc_md structures until we find the proper
496 * one for the current machine type
497 */
498 DBG("Probing machine type ...\n");
499
500 for (machine_id = &__machine_desc_start;
501 machine_id < &__machine_desc_end;
502 machine_id++) {
503 DBG(" %s ...", machine_id->name);
504 memcpy(&ppc_md, machine_id, sizeof(struct machdep_calls));
505 if (ppc_md.probe()) {
506 DBG(" match !\n");
507 break;
508 }
509 DBG("\n");
510 }
511 /* What can we do if we didn't find ? */
512 if (machine_id >= &__machine_desc_end) {
513 DBG("No suitable machine found !\n");
514 for (;;);
515 }
516
517 printk(KERN_INFO "Using %s machine description\n", ppc_md.name);
518}
diff --git a/arch/powerpc/kernel/setup_32.c b/arch/powerpc/kernel/setup_32.c
index db72a92943bf..a72bf5dceeee 100644
--- a/arch/powerpc/kernel/setup_32.c
+++ b/arch/powerpc/kernel/setup_32.c
@@ -53,9 +53,6 @@
53extern void platform_init(void); 53extern void platform_init(void);
54extern void bootx_init(unsigned long r4, unsigned long phys); 54extern void bootx_init(unsigned long r4, unsigned long phys);
55 55
56extern void ppc6xx_idle(void);
57extern void power4_idle(void);
58
59boot_infos_t *boot_infos; 56boot_infos_t *boot_infos;
60struct ide_machdep_calls ppc_ide_md; 57struct ide_machdep_calls ppc_ide_md;
61 58
@@ -70,10 +67,6 @@ unsigned int DMA_MODE_WRITE;
70int have_of = 1; 67int have_of = 1;
71 68
72#ifdef CONFIG_PPC_MULTIPLATFORM 69#ifdef CONFIG_PPC_MULTIPLATFORM
73extern void prep_init(void);
74extern void pmac_init(void);
75extern void chrp_init(void);
76
77dev_t boot_dev; 70dev_t boot_dev;
78#endif /* CONFIG_PPC_MULTIPLATFORM */ 71#endif /* CONFIG_PPC_MULTIPLATFORM */
79 72
@@ -85,9 +78,6 @@ unsigned long SYSRQ_KEY = 0x54;
85unsigned long vgacon_remap_base; 78unsigned long vgacon_remap_base;
86#endif 79#endif
87 80
88struct machdep_calls ppc_md;
89EXPORT_SYMBOL(ppc_md);
90
91/* 81/*
92 * These are used in binfmt_elf.c to put aux entries on the stack 82 * These are used in binfmt_elf.c to put aux entries on the stack
93 * for each elf executable being started. 83 * for each elf executable being started.
@@ -111,7 +101,7 @@ unsigned long __init early_init(unsigned long dt_ptr)
111 101
112 /* First zero the BSS -- use memset_io, some platforms don't have 102 /* First zero the BSS -- use memset_io, some platforms don't have
113 * caches on yet */ 103 * caches on yet */
114 memset_io(PTRRELOC(&__bss_start), 0, _end - __bss_start); 104 memset_io((void __iomem *)PTRRELOC(&__bss_start), 0, _end - __bss_start);
115 105
116 /* 106 /*
117 * Identify the CPU type and fix up code sections 107 * Identify the CPU type and fix up code sections
@@ -123,48 +113,6 @@ unsigned long __init early_init(unsigned long dt_ptr)
123 return KERNELBASE + offset; 113 return KERNELBASE + offset;
124} 114}
125 115
126#ifdef CONFIG_PPC_MULTIPLATFORM
127/*
128 * The PPC_MULTIPLATFORM version of platform_init...
129 */
130void __init platform_init(void)
131{
132 /* if we didn't get any bootinfo telling us what we are... */
133 if (_machine == 0) {
134 /* prep boot loader tells us if we're prep or not */
135 if ( *(unsigned long *)(KERNELBASE) == (0xdeadc0de) )
136 _machine = _MACH_prep;
137 }
138
139#ifdef CONFIG_PPC_PREP
140 /* not much more to do here, if prep */
141 if (_machine == _MACH_prep) {
142 prep_init();
143 return;
144 }
145#endif
146
147#ifdef CONFIG_ADB
148 if (strstr(cmd_line, "adb_sync")) {
149 extern int __adb_probe_sync;
150 __adb_probe_sync = 1;
151 }
152#endif /* CONFIG_ADB */
153
154 switch (_machine) {
155#ifdef CONFIG_PPC_PMAC
156 case _MACH_Pmac:
157 pmac_init();
158 break;
159#endif
160#ifdef CONFIG_PPC_CHRP
161 case _MACH_chrp:
162 chrp_init();
163 break;
164#endif
165 }
166}
167#endif
168 116
169/* 117/*
170 * Find out what kind of machine we're on and save any data we need 118 * Find out what kind of machine we're on and save any data we need
@@ -190,11 +138,17 @@ void __init machine_init(unsigned long dt_ptr, unsigned long phys)
190 strlcpy(cmd_line, CONFIG_CMDLINE, sizeof(cmd_line)); 138 strlcpy(cmd_line, CONFIG_CMDLINE, sizeof(cmd_line));
191#endif /* CONFIG_CMDLINE */ 139#endif /* CONFIG_CMDLINE */
192 140
193 /* Base init based on machine type */ 141#ifdef CONFIG_PPC_MULTIPLATFORM
142 probe_machine();
143#else
144 /* Base init based on machine type. Obsoloete, please kill ! */
194 platform_init(); 145 platform_init();
146#endif
195 147
196#ifdef CONFIG_6xx 148#ifdef CONFIG_6xx
197 ppc_md.power_save = ppc6xx_idle; 149 if (cpu_has_feature(CPU_FTR_CAN_DOZE) ||
150 cpu_has_feature(CPU_FTR_CAN_NAP))
151 ppc_md.power_save = ppc6xx_idle;
198#endif 152#endif
199 153
200 if (ppc_md.progress) 154 if (ppc_md.progress)
@@ -272,9 +226,8 @@ int __init ppc_init(void)
272 if ( ppc_md.progress ) ppc_md.progress(" ", 0xffff); 226 if ( ppc_md.progress ) ppc_md.progress(" ", 0xffff);
273 227
274 /* register CPU devices */ 228 /* register CPU devices */
275 for (i = 0; i < NR_CPUS; i++) 229 for_each_possible_cpu(i)
276 if (cpu_possible(i)) 230 register_cpu(&cpu_devices[i], i, NULL);
277 register_cpu(&cpu_devices[i], i, NULL);
278 231
279 /* call platform init */ 232 /* call platform init */
280 if (ppc_md.init != NULL) { 233 if (ppc_md.init != NULL) {
@@ -353,12 +306,6 @@ void __init setup_arch(char **cmdline_p)
353 do_init_bootmem(); 306 do_init_bootmem();
354 if ( ppc_md.progress ) ppc_md.progress("setup_arch: bootmem", 0x3eab); 307 if ( ppc_md.progress ) ppc_md.progress("setup_arch: bootmem", 0x3eab);
355 308
356#ifdef CONFIG_PPC_OCP
357 /* Initialize OCP device list */
358 ocp_early_init();
359 if ( ppc_md.progress ) ppc_md.progress("ocp: exit", 0x3eab);
360#endif
361
362#ifdef CONFIG_DUMMY_CONSOLE 309#ifdef CONFIG_DUMMY_CONSOLE
363 conswitchp = &dummy_con; 310 conswitchp = &dummy_con;
364#endif 311#endif
@@ -367,7 +314,4 @@ void __init setup_arch(char **cmdline_p)
367 if ( ppc_md.progress ) ppc_md.progress("arch: exit", 0x3eab); 314 if ( ppc_md.progress ) ppc_md.progress("arch: exit", 0x3eab);
368 315
369 paging_init(); 316 paging_init();
370
371 /* this is for modules since _machine can be a define -- Cort */
372 ppc_md.ppc_machine = _machine;
373} 317}
diff --git a/arch/powerpc/kernel/setup_64.c b/arch/powerpc/kernel/setup_64.c
index f96c49b03ba0..59aa92cd6fa4 100644
--- a/arch/powerpc/kernel/setup_64.c
+++ b/arch/powerpc/kernel/setup_64.c
@@ -73,7 +73,6 @@
73 73
74int have_of = 1; 74int have_of = 1;
75int boot_cpuid = 0; 75int boot_cpuid = 0;
76int boot_cpuid_phys = 0;
77dev_t boot_dev; 76dev_t boot_dev;
78u64 ppc64_pft_size; 77u64 ppc64_pft_size;
79 78
@@ -96,11 +95,6 @@ int dcache_bsize;
96int icache_bsize; 95int icache_bsize;
97int ucache_bsize; 96int ucache_bsize;
98 97
99/* The main machine-dep calls structure
100 */
101struct machdep_calls ppc_md;
102EXPORT_SYMBOL(ppc_md);
103
104#ifdef CONFIG_MAGIC_SYSRQ 98#ifdef CONFIG_MAGIC_SYSRQ
105unsigned long SYSRQ_KEY; 99unsigned long SYSRQ_KEY;
106#endif /* CONFIG_MAGIC_SYSRQ */ 100#endif /* CONFIG_MAGIC_SYSRQ */
@@ -161,32 +155,6 @@ early_param("smt-enabled", early_smt_enabled);
161#define check_smt_enabled() 155#define check_smt_enabled()
162#endif /* CONFIG_SMP */ 156#endif /* CONFIG_SMP */
163 157
164extern struct machdep_calls pSeries_md;
165extern struct machdep_calls pmac_md;
166extern struct machdep_calls maple_md;
167extern struct machdep_calls cell_md;
168extern struct machdep_calls iseries_md;
169
170/* Ultimately, stuff them in an elf section like initcalls... */
171static struct machdep_calls __initdata *machines[] = {
172#ifdef CONFIG_PPC_PSERIES
173 &pSeries_md,
174#endif /* CONFIG_PPC_PSERIES */
175#ifdef CONFIG_PPC_PMAC
176 &pmac_md,
177#endif /* CONFIG_PPC_PMAC */
178#ifdef CONFIG_PPC_MAPLE
179 &maple_md,
180#endif /* CONFIG_PPC_MAPLE */
181#ifdef CONFIG_PPC_CELL
182 &cell_md,
183#endif
184#ifdef CONFIG_PPC_ISERIES
185 &iseries_md,
186#endif
187 NULL
188};
189
190/* 158/*
191 * Early initialization entry point. This is called by head.S 159 * Early initialization entry point. This is called by head.S
192 * with MMU translation disabled. We rely on the "feature" of 160 * with MMU translation disabled. We rely on the "feature" of
@@ -208,13 +176,10 @@ static struct machdep_calls __initdata *machines[] = {
208 176
209void __init early_setup(unsigned long dt_ptr) 177void __init early_setup(unsigned long dt_ptr)
210{ 178{
211 struct paca_struct *lpaca = get_paca();
212 static struct machdep_calls **mach;
213
214 /* Enable early debugging if any specified (see udbg.h) */ 179 /* Enable early debugging if any specified (see udbg.h) */
215 udbg_early_init(); 180 udbg_early_init();
216 181
217 DBG(" -> early_setup()\n"); 182 DBG(" -> early_setup(), dt_ptr: 0x%lx\n", dt_ptr);
218 183
219 /* 184 /*
220 * Do early initializations using the flattened device 185 * Do early initializations using the flattened device
@@ -223,22 +188,16 @@ void __init early_setup(unsigned long dt_ptr)
223 */ 188 */
224 early_init_devtree(__va(dt_ptr)); 189 early_init_devtree(__va(dt_ptr));
225 190
226 /* 191 /* Now we know the logical id of our boot cpu, setup the paca. */
227 * Iterate all ppc_md structures until we find the proper 192 setup_boot_paca();
228 * one for the current machine type
229 */
230 DBG("Probing machine type for platform %x...\n", _machine);
231 193
232 for (mach = machines; *mach; mach++) { 194 /* Fix up paca fields required for the boot cpu */
233 if ((*mach)->probe(_machine)) 195 get_paca()->cpu_start = 1;
234 break; 196 get_paca()->stab_real = __pa((u64)&initial_stab);
235 } 197 get_paca()->stab_addr = (u64)&initial_stab;
236 /* What can we do if we didn't find ? */ 198
237 if (*mach == NULL) { 199 /* Probe the machine type */
238 DBG("No suitable machine found !\n"); 200 probe_machine();
239 for (;;);
240 }
241 ppc_md = **mach;
242 201
243#ifdef CONFIG_CRASH_DUMP 202#ifdef CONFIG_CRASH_DUMP
244 kdump_setup(); 203 kdump_setup();
@@ -260,7 +219,7 @@ void __init early_setup(unsigned long dt_ptr)
260 if (cpu_has_feature(CPU_FTR_SLB)) 219 if (cpu_has_feature(CPU_FTR_SLB))
261 slb_initialize(); 220 slb_initialize();
262 else 221 else
263 stab_initialize(lpaca->stab_real); 222 stab_initialize(get_paca()->stab_real);
264 } 223 }
265 224
266 DBG(" <- early_setup()\n"); 225 DBG(" <- early_setup()\n");
@@ -340,7 +299,7 @@ static void __init initialize_cache_info(void)
340 const char *dc, *ic; 299 const char *dc, *ic;
341 300
342 /* Then read cache informations */ 301 /* Then read cache informations */
343 if (_machine == PLATFORM_POWERMAC) { 302 if (machine_is(powermac)) {
344 dc = "d-cache-block-size"; 303 dc = "d-cache-block-size";
345 ic = "i-cache-block-size"; 304 ic = "i-cache-block-size";
346 } else { 305 } else {
@@ -484,7 +443,6 @@ void __init setup_system(void)
484 printk("ppc64_pft_size = 0x%lx\n", ppc64_pft_size); 443 printk("ppc64_pft_size = 0x%lx\n", ppc64_pft_size);
485 printk("ppc64_interrupt_controller = 0x%ld\n", 444 printk("ppc64_interrupt_controller = 0x%ld\n",
486 ppc64_interrupt_controller); 445 ppc64_interrupt_controller);
487 printk("platform = 0x%x\n", _machine);
488 printk("physicalMemorySize = 0x%lx\n", lmb_phys_mem_size()); 446 printk("physicalMemorySize = 0x%lx\n", lmb_phys_mem_size());
489 printk("ppc64_caches.dcache_line_size = 0x%x\n", 447 printk("ppc64_caches.dcache_line_size = 0x%x\n",
490 ppc64_caches.dline_size); 448 ppc64_caches.dline_size);
@@ -497,8 +455,6 @@ void __init setup_system(void)
497#endif 455#endif
498 printk("-----------------------------------------------------\n"); 456 printk("-----------------------------------------------------\n");
499 457
500 mm_init_ppc64();
501
502 DBG(" <- setup_system()\n"); 458 DBG(" <- setup_system()\n");
503} 459}
504 460
@@ -518,7 +474,7 @@ static void __init irqstack_early_init(void)
518 * interrupt stacks must be under 256MB, we cannot afford to take 474 * interrupt stacks must be under 256MB, we cannot afford to take
519 * SLB misses on them. 475 * SLB misses on them.
520 */ 476 */
521 for_each_cpu(i) { 477 for_each_possible_cpu(i) {
522 softirq_ctx[i] = (struct thread_info *) 478 softirq_ctx[i] = (struct thread_info *)
523 __va(lmb_alloc_base(THREAD_SIZE, 479 __va(lmb_alloc_base(THREAD_SIZE,
524 THREAD_SIZE, 0x10000000)); 480 THREAD_SIZE, 0x10000000));
@@ -551,7 +507,7 @@ static void __init emergency_stack_init(void)
551 */ 507 */
552 limit = min(0x10000000UL, lmb.rmo_size); 508 limit = min(0x10000000UL, lmb.rmo_size);
553 509
554 for_each_cpu(i) 510 for_each_possible_cpu(i)
555 paca[i].emergency_sp = 511 paca[i].emergency_sp =
556 __va(lmb_alloc_base(HW_PAGE_SIZE, 128, limit)) + HW_PAGE_SIZE; 512 __va(lmb_alloc_base(HW_PAGE_SIZE, 128, limit)) + HW_PAGE_SIZE;
557} 513}
@@ -581,7 +537,8 @@ void __init setup_arch(char **cmdline_p)
581 panic_timeout = 180; 537 panic_timeout = 180;
582 538
583 if (ppc_md.panic) 539 if (ppc_md.panic)
584 notifier_chain_register(&panic_notifier_list, &ppc64_panic_block); 540 atomic_notifier_chain_register(&panic_notifier_list,
541 &ppc64_panic_block);
585 542
586 init_mm.start_code = PAGE_OFFSET; 543 init_mm.start_code = PAGE_OFFSET;
587 init_mm.end_code = (unsigned long) _etext; 544 init_mm.end_code = (unsigned long) _etext;
@@ -603,12 +560,6 @@ void __init setup_arch(char **cmdline_p)
603 560
604 ppc_md.setup_arch(); 561 ppc_md.setup_arch();
605 562
606 /* Use the default idle loop if the platform hasn't provided one. */
607 if (NULL == ppc_md.idle_loop) {
608 ppc_md.idle_loop = default_idle;
609 printk(KERN_INFO "Using default idle loop\n");
610 }
611
612 paging_init(); 563 paging_init();
613 ppc64_boot_msg(0x15, "Setup Done"); 564 ppc64_boot_msg(0x15, "Setup Done");
614} 565}
@@ -673,7 +624,7 @@ void __init setup_per_cpu_areas(void)
673 size = PERCPU_ENOUGH_ROOM; 624 size = PERCPU_ENOUGH_ROOM;
674#endif 625#endif
675 626
676 for_each_cpu(i) { 627 for_each_possible_cpu(i) {
677 ptr = alloc_bootmem_node(NODE_DATA(cpu_to_node(i)), size); 628 ptr = alloc_bootmem_node(NODE_DATA(cpu_to_node(i)), size);
678 if (!ptr) 629 if (!ptr)
679 panic("Cannot allocate cpu data for CPU %d\n", i); 630 panic("Cannot allocate cpu data for CPU %d\n", i);
diff --git a/arch/powerpc/kernel/signal_32.c b/arch/powerpc/kernel/signal_32.c
index d7a4e814974d..01e3c08cb550 100644
--- a/arch/powerpc/kernel/signal_32.c
+++ b/arch/powerpc/kernel/signal_32.c
@@ -42,6 +42,7 @@
42 42
43#include <asm/uaccess.h> 43#include <asm/uaccess.h>
44#include <asm/cacheflush.h> 44#include <asm/cacheflush.h>
45#include <asm/syscalls.h>
45#include <asm/sigcontext.h> 46#include <asm/sigcontext.h>
46#include <asm/vdso.h> 47#include <asm/vdso.h>
47#ifdef CONFIG_PPC64 48#ifdef CONFIG_PPC64
diff --git a/arch/powerpc/kernel/signal_64.c b/arch/powerpc/kernel/signal_64.c
index 4324f8a8ba24..27f65b95184d 100644
--- a/arch/powerpc/kernel/signal_64.c
+++ b/arch/powerpc/kernel/signal_64.c
@@ -1,6 +1,4 @@
1/* 1/*
2 * linux/arch/ppc64/kernel/signal.c
3 *
4 * PowerPC version 2 * PowerPC version
5 * Copyright (C) 1995-1996 Gary Thomas (gdt@linuxppc.org) 3 * Copyright (C) 1995-1996 Gary Thomas (gdt@linuxppc.org)
6 * 4 *
@@ -35,6 +33,7 @@
35#include <asm/pgtable.h> 33#include <asm/pgtable.h>
36#include <asm/unistd.h> 34#include <asm/unistd.h>
37#include <asm/cacheflush.h> 35#include <asm/cacheflush.h>
36#include <asm/syscalls.h>
38#include <asm/vdso.h> 37#include <asm/vdso.h>
39 38
40#define DEBUG_SIG 0 39#define DEBUG_SIG 0
@@ -213,7 +212,7 @@ static inline void __user * get_sigframe(struct k_sigaction *ka, struct pt_regs
213 /* Default to using normal stack */ 212 /* Default to using normal stack */
214 newsp = regs->gpr[1]; 213 newsp = regs->gpr[1];
215 214
216 if (ka->sa.sa_flags & SA_ONSTACK) { 215 if ((ka->sa.sa_flags & SA_ONSTACK) && current->sas_ss_size) {
217 if (! on_sig_stack(regs->gpr[1])) 216 if (! on_sig_stack(regs->gpr[1]))
218 newsp = (current->sas_ss_sp + current->sas_ss_size); 217 newsp = (current->sas_ss_sp + current->sas_ss_size);
219 } 218 }
diff --git a/arch/powerpc/kernel/smp.c b/arch/powerpc/kernel/smp.c
index 13595a64f013..530f7dba0bd2 100644
--- a/arch/powerpc/kernel/smp.c
+++ b/arch/powerpc/kernel/smp.c
@@ -362,7 +362,7 @@ void __init smp_prepare_cpus(unsigned int max_cpus)
362 362
363 smp_space_timers(max_cpus); 363 smp_space_timers(max_cpus);
364 364
365 for_each_cpu(cpu) 365 for_each_possible_cpu(cpu)
366 if (cpu != boot_cpuid) 366 if (cpu != boot_cpuid)
367 smp_create_idle(cpu); 367 smp_create_idle(cpu);
368} 368}
@@ -541,7 +541,7 @@ int __devinit start_secondary(void *unused)
541 smp_ops->take_timebase(); 541 smp_ops->take_timebase();
542 542
543 if (system_state > SYSTEM_BOOTING) 543 if (system_state > SYSTEM_BOOTING)
544 per_cpu(last_jiffy, cpu) = get_tb(); 544 snapshot_timebase();
545 545
546 spin_lock(&call_lock); 546 spin_lock(&call_lock);
547 cpu_set(cpu, cpu_online_map); 547 cpu_set(cpu, cpu_online_map);
@@ -573,6 +573,8 @@ void __init smp_cpus_done(unsigned int max_cpus)
573 573
574 set_cpus_allowed(current, old_mask); 574 set_cpus_allowed(current, old_mask);
575 575
576 snapshot_timebases();
577
576 dump_numa_cpu_topology(); 578 dump_numa_cpu_topology();
577} 579}
578 580
diff --git a/arch/ppc/kernel/swsusp.S b/arch/powerpc/kernel/swsusp_32.S
index 69773cc1a85f..69773cc1a85f 100644
--- a/arch/ppc/kernel/swsusp.S
+++ b/arch/powerpc/kernel/swsusp_32.S
diff --git a/arch/powerpc/kernel/sys_ppc32.c b/arch/powerpc/kernel/sys_ppc32.c
index cd75ab2908fa..ec274e688816 100644
--- a/arch/powerpc/kernel/sys_ppc32.c
+++ b/arch/powerpc/kernel/sys_ppc32.c
@@ -24,7 +24,6 @@
24#include <linux/resource.h> 24#include <linux/resource.h>
25#include <linux/times.h> 25#include <linux/times.h>
26#include <linux/utsname.h> 26#include <linux/utsname.h>
27#include <linux/timex.h>
28#include <linux/smp.h> 27#include <linux/smp.h>
29#include <linux/smp_lock.h> 28#include <linux/smp_lock.h>
30#include <linux/sem.h> 29#include <linux/sem.h>
@@ -161,78 +160,6 @@ asmlinkage long compat_sys_sysfs(u32 option, u32 arg1, u32 arg2)
161 return sys_sysfs((int)option, arg1, arg2); 160 return sys_sysfs((int)option, arg1, arg2);
162} 161}
163 162
164/* Handle adjtimex compatibility. */
165struct timex32 {
166 u32 modes;
167 s32 offset, freq, maxerror, esterror;
168 s32 status, constant, precision, tolerance;
169 struct compat_timeval time;
170 s32 tick;
171 s32 ppsfreq, jitter, shift, stabil;
172 s32 jitcnt, calcnt, errcnt, stbcnt;
173 s32 :32; s32 :32; s32 :32; s32 :32;
174 s32 :32; s32 :32; s32 :32; s32 :32;
175 s32 :32; s32 :32; s32 :32; s32 :32;
176};
177
178extern int do_adjtimex(struct timex *);
179
180asmlinkage long compat_sys_adjtimex(struct timex32 __user *utp)
181{
182 struct timex txc;
183 int ret;
184
185 memset(&txc, 0, sizeof(struct timex));
186
187 if(get_user(txc.modes, &utp->modes) ||
188 __get_user(txc.offset, &utp->offset) ||
189 __get_user(txc.freq, &utp->freq) ||
190 __get_user(txc.maxerror, &utp->maxerror) ||
191 __get_user(txc.esterror, &utp->esterror) ||
192 __get_user(txc.status, &utp->status) ||
193 __get_user(txc.constant, &utp->constant) ||
194 __get_user(txc.precision, &utp->precision) ||
195 __get_user(txc.tolerance, &utp->tolerance) ||
196 __get_user(txc.time.tv_sec, &utp->time.tv_sec) ||
197 __get_user(txc.time.tv_usec, &utp->time.tv_usec) ||
198 __get_user(txc.tick, &utp->tick) ||
199 __get_user(txc.ppsfreq, &utp->ppsfreq) ||
200 __get_user(txc.jitter, &utp->jitter) ||
201 __get_user(txc.shift, &utp->shift) ||
202 __get_user(txc.stabil, &utp->stabil) ||
203 __get_user(txc.jitcnt, &utp->jitcnt) ||
204 __get_user(txc.calcnt, &utp->calcnt) ||
205 __get_user(txc.errcnt, &utp->errcnt) ||
206 __get_user(txc.stbcnt, &utp->stbcnt))
207 return -EFAULT;
208
209 ret = do_adjtimex(&txc);
210
211 if(put_user(txc.modes, &utp->modes) ||
212 __put_user(txc.offset, &utp->offset) ||
213 __put_user(txc.freq, &utp->freq) ||
214 __put_user(txc.maxerror, &utp->maxerror) ||
215 __put_user(txc.esterror, &utp->esterror) ||
216 __put_user(txc.status, &utp->status) ||
217 __put_user(txc.constant, &utp->constant) ||
218 __put_user(txc.precision, &utp->precision) ||
219 __put_user(txc.tolerance, &utp->tolerance) ||
220 __put_user(txc.time.tv_sec, &utp->time.tv_sec) ||
221 __put_user(txc.time.tv_usec, &utp->time.tv_usec) ||
222 __put_user(txc.tick, &utp->tick) ||
223 __put_user(txc.ppsfreq, &utp->ppsfreq) ||
224 __put_user(txc.jitter, &utp->jitter) ||
225 __put_user(txc.shift, &utp->shift) ||
226 __put_user(txc.stabil, &utp->stabil) ||
227 __put_user(txc.jitcnt, &utp->jitcnt) ||
228 __put_user(txc.calcnt, &utp->calcnt) ||
229 __put_user(txc.errcnt, &utp->errcnt) ||
230 __put_user(txc.stbcnt, &utp->stbcnt))
231 ret = -EFAULT;
232
233 return ret;
234}
235
236asmlinkage long compat_sys_pause(void) 163asmlinkage long compat_sys_pause(void)
237{ 164{
238 current->state = TASK_INTERRUPTIBLE; 165 current->state = TASK_INTERRUPTIBLE;
diff --git a/arch/powerpc/kernel/syscalls.c b/arch/powerpc/kernel/syscalls.c
index ad895c99813b..9b69d99a9103 100644
--- a/arch/powerpc/kernel/syscalls.c
+++ b/arch/powerpc/kernel/syscalls.c
@@ -40,6 +40,7 @@
40#include <asm/uaccess.h> 40#include <asm/uaccess.h>
41#include <asm/ipc.h> 41#include <asm/ipc.h>
42#include <asm/semaphore.h> 42#include <asm/semaphore.h>
43#include <asm/syscalls.h>
43#include <asm/time.h> 44#include <asm/time.h>
44#include <asm/unistd.h> 45#include <asm/unistd.h>
45 46
diff --git a/arch/powerpc/kernel/sysfs.c b/arch/powerpc/kernel/sysfs.c
index 0f0c3a9ae2e5..73560ef6f802 100644
--- a/arch/powerpc/kernel/sysfs.c
+++ b/arch/powerpc/kernel/sysfs.c
@@ -65,20 +65,20 @@ static int __init smt_setup(void)
65 unsigned int cpu; 65 unsigned int cpu;
66 66
67 if (!cpu_has_feature(CPU_FTR_SMT)) 67 if (!cpu_has_feature(CPU_FTR_SMT))
68 return 1; 68 return -ENODEV;
69 69
70 options = find_path_device("/options"); 70 options = find_path_device("/options");
71 if (!options) 71 if (!options)
72 return 1; 72 return -ENODEV;
73 73
74 val = (unsigned int *)get_property(options, "ibm,smt-snooze-delay", 74 val = (unsigned int *)get_property(options, "ibm,smt-snooze-delay",
75 NULL); 75 NULL);
76 if (!smt_snooze_cmdline && val) { 76 if (!smt_snooze_cmdline && val) {
77 for_each_cpu(cpu) 77 for_each_possible_cpu(cpu)
78 per_cpu(smt_snooze_delay, cpu) = *val; 78 per_cpu(smt_snooze_delay, cpu) = *val;
79 } 79 }
80 80
81 return 1; 81 return 0;
82} 82}
83__initcall(smt_setup); 83__initcall(smt_setup);
84 84
@@ -93,7 +93,7 @@ static int __init setup_smt_snooze_delay(char *str)
93 smt_snooze_cmdline = 1; 93 smt_snooze_cmdline = 1;
94 94
95 if (get_option(&str, &snooze)) { 95 if (get_option(&str, &snooze)) {
96 for_each_cpu(cpu) 96 for_each_possible_cpu(cpu)
97 per_cpu(smt_snooze_delay, cpu) = snooze; 97 per_cpu(smt_snooze_delay, cpu) = snooze;
98 } 98 }
99 99
@@ -347,7 +347,7 @@ static int __init topology_init(void)
347 347
348 register_cpu_notifier(&sysfs_cpu_nb); 348 register_cpu_notifier(&sysfs_cpu_nb);
349 349
350 for_each_cpu(cpu) { 350 for_each_possible_cpu(cpu) {
351 struct cpu *c = &per_cpu(cpu_devices, cpu); 351 struct cpu *c = &per_cpu(cpu_devices, cpu);
352 352
353#ifdef CONFIG_NUMA 353#ifdef CONFIG_NUMA
diff --git a/arch/ppc/kernel/temp.c b/arch/powerpc/kernel/tau_6xx.c
index 26bd8ea35a4e..26bd8ea35a4e 100644
--- a/arch/ppc/kernel/temp.c
+++ b/arch/powerpc/kernel/tau_6xx.c
diff --git a/arch/powerpc/kernel/time.c b/arch/powerpc/kernel/time.c
index 2a7ddc579379..24e3ad756de0 100644
--- a/arch/powerpc/kernel/time.c
+++ b/arch/powerpc/kernel/time.c
@@ -51,6 +51,7 @@
51#include <linux/percpu.h> 51#include <linux/percpu.h>
52#include <linux/rtc.h> 52#include <linux/rtc.h>
53#include <linux/jiffies.h> 53#include <linux/jiffies.h>
54#include <linux/posix-timers.h>
54 55
55#include <asm/io.h> 56#include <asm/io.h>
56#include <asm/processor.h> 57#include <asm/processor.h>
@@ -98,6 +99,7 @@ unsigned long tb_ticks_per_jiffy;
98unsigned long tb_ticks_per_usec = 100; /* sane default */ 99unsigned long tb_ticks_per_usec = 100; /* sane default */
99EXPORT_SYMBOL(tb_ticks_per_usec); 100EXPORT_SYMBOL(tb_ticks_per_usec);
100unsigned long tb_ticks_per_sec; 101unsigned long tb_ticks_per_sec;
102EXPORT_SYMBOL(tb_ticks_per_sec); /* for cputime_t conversions */
101u64 tb_to_xs; 103u64 tb_to_xs;
102unsigned tb_to_us; 104unsigned tb_to_us;
103 105
@@ -135,6 +137,224 @@ unsigned long tb_last_stamp;
135 */ 137 */
136DEFINE_PER_CPU(unsigned long, last_jiffy); 138DEFINE_PER_CPU(unsigned long, last_jiffy);
137 139
140#ifdef CONFIG_VIRT_CPU_ACCOUNTING
141/*
142 * Factors for converting from cputime_t (timebase ticks) to
143 * jiffies, milliseconds, seconds, and clock_t (1/USER_HZ seconds).
144 * These are all stored as 0.64 fixed-point binary fractions.
145 */
146u64 __cputime_jiffies_factor;
147EXPORT_SYMBOL(__cputime_jiffies_factor);
148u64 __cputime_msec_factor;
149EXPORT_SYMBOL(__cputime_msec_factor);
150u64 __cputime_sec_factor;
151EXPORT_SYMBOL(__cputime_sec_factor);
152u64 __cputime_clockt_factor;
153EXPORT_SYMBOL(__cputime_clockt_factor);
154
155static void calc_cputime_factors(void)
156{
157 struct div_result res;
158
159 div128_by_32(HZ, 0, tb_ticks_per_sec, &res);
160 __cputime_jiffies_factor = res.result_low;
161 div128_by_32(1000, 0, tb_ticks_per_sec, &res);
162 __cputime_msec_factor = res.result_low;
163 div128_by_32(1, 0, tb_ticks_per_sec, &res);
164 __cputime_sec_factor = res.result_low;
165 div128_by_32(USER_HZ, 0, tb_ticks_per_sec, &res);
166 __cputime_clockt_factor = res.result_low;
167}
168
169/*
170 * Read the PURR on systems that have it, otherwise the timebase.
171 */
172static u64 read_purr(void)
173{
174 if (cpu_has_feature(CPU_FTR_PURR))
175 return mfspr(SPRN_PURR);
176 return mftb();
177}
178
179/*
180 * Account time for a transition between system, hard irq
181 * or soft irq state.
182 */
183void account_system_vtime(struct task_struct *tsk)
184{
185 u64 now, delta;
186 unsigned long flags;
187
188 local_irq_save(flags);
189 now = read_purr();
190 delta = now - get_paca()->startpurr;
191 get_paca()->startpurr = now;
192 if (!in_interrupt()) {
193 delta += get_paca()->system_time;
194 get_paca()->system_time = 0;
195 }
196 account_system_time(tsk, 0, delta);
197 local_irq_restore(flags);
198}
199
200/*
201 * Transfer the user and system times accumulated in the paca
202 * by the exception entry and exit code to the generic process
203 * user and system time records.
204 * Must be called with interrupts disabled.
205 */
206void account_process_vtime(struct task_struct *tsk)
207{
208 cputime_t utime;
209
210 utime = get_paca()->user_time;
211 get_paca()->user_time = 0;
212 account_user_time(tsk, utime);
213}
214
215static void account_process_time(struct pt_regs *regs)
216{
217 int cpu = smp_processor_id();
218
219 account_process_vtime(current);
220 run_local_timers();
221 if (rcu_pending(cpu))
222 rcu_check_callbacks(cpu, user_mode(regs));
223 scheduler_tick();
224 run_posix_cpu_timers(current);
225}
226
227#ifdef CONFIG_PPC_SPLPAR
228/*
229 * Stuff for accounting stolen time.
230 */
231struct cpu_purr_data {
232 int initialized; /* thread is running */
233 u64 tb0; /* timebase at origin time */
234 u64 purr0; /* PURR at origin time */
235 u64 tb; /* last TB value read */
236 u64 purr; /* last PURR value read */
237 u64 stolen; /* stolen time so far */
238 spinlock_t lock;
239};
240
241static DEFINE_PER_CPU(struct cpu_purr_data, cpu_purr_data);
242
243static void snapshot_tb_and_purr(void *data)
244{
245 struct cpu_purr_data *p = &__get_cpu_var(cpu_purr_data);
246
247 p->tb0 = mftb();
248 p->purr0 = mfspr(SPRN_PURR);
249 p->tb = p->tb0;
250 p->purr = 0;
251 wmb();
252 p->initialized = 1;
253}
254
255/*
256 * Called during boot when all cpus have come up.
257 */
258void snapshot_timebases(void)
259{
260 int cpu;
261
262 if (!cpu_has_feature(CPU_FTR_PURR))
263 return;
264 for_each_possible_cpu(cpu)
265 spin_lock_init(&per_cpu(cpu_purr_data, cpu).lock);
266 on_each_cpu(snapshot_tb_and_purr, NULL, 0, 1);
267}
268
269void calculate_steal_time(void)
270{
271 u64 tb, purr, t0;
272 s64 stolen;
273 struct cpu_purr_data *p0, *pme, *phim;
274 int cpu;
275
276 if (!cpu_has_feature(CPU_FTR_PURR))
277 return;
278 cpu = smp_processor_id();
279 pme = &per_cpu(cpu_purr_data, cpu);
280 if (!pme->initialized)
281 return; /* this can happen in early boot */
282 p0 = &per_cpu(cpu_purr_data, cpu & ~1);
283 phim = &per_cpu(cpu_purr_data, cpu ^ 1);
284 spin_lock(&p0->lock);
285 tb = mftb();
286 purr = mfspr(SPRN_PURR) - pme->purr0;
287 if (!phim->initialized || !cpu_online(cpu ^ 1)) {
288 stolen = (tb - pme->tb) - (purr - pme->purr);
289 } else {
290 t0 = pme->tb0;
291 if (phim->tb0 < t0)
292 t0 = phim->tb0;
293 stolen = phim->tb - t0 - phim->purr - purr - p0->stolen;
294 }
295 if (stolen > 0) {
296 account_steal_time(current, stolen);
297 p0->stolen += stolen;
298 }
299 pme->tb = tb;
300 pme->purr = purr;
301 spin_unlock(&p0->lock);
302}
303
304/*
305 * Must be called before the cpu is added to the online map when
306 * a cpu is being brought up at runtime.
307 */
308static void snapshot_purr(void)
309{
310 int cpu;
311 u64 purr;
312 struct cpu_purr_data *p0, *pme, *phim;
313 unsigned long flags;
314
315 if (!cpu_has_feature(CPU_FTR_PURR))
316 return;
317 cpu = smp_processor_id();
318 pme = &per_cpu(cpu_purr_data, cpu);
319 p0 = &per_cpu(cpu_purr_data, cpu & ~1);
320 phim = &per_cpu(cpu_purr_data, cpu ^ 1);
321 spin_lock_irqsave(&p0->lock, flags);
322 pme->tb = pme->tb0 = mftb();
323 purr = mfspr(SPRN_PURR);
324 if (!phim->initialized) {
325 pme->purr = 0;
326 pme->purr0 = purr;
327 } else {
328 /* set p->purr and p->purr0 for no change in p0->stolen */
329 pme->purr = phim->tb - phim->tb0 - phim->purr - p0->stolen;
330 pme->purr0 = purr - pme->purr;
331 }
332 pme->initialized = 1;
333 spin_unlock_irqrestore(&p0->lock, flags);
334}
335
336#endif /* CONFIG_PPC_SPLPAR */
337
338#else /* ! CONFIG_VIRT_CPU_ACCOUNTING */
339#define calc_cputime_factors()
340#define account_process_time(regs) update_process_times(user_mode(regs))
341#define calculate_steal_time() do { } while (0)
342#endif
343
344#if !(defined(CONFIG_VIRT_CPU_ACCOUNTING) && defined(CONFIG_PPC_SPLPAR))
345#define snapshot_purr() do { } while (0)
346#endif
347
348/*
349 * Called when a cpu comes up after the system has finished booting,
350 * i.e. as a result of a hotplug cpu action.
351 */
352void snapshot_timebase(void)
353{
354 __get_cpu_var(last_jiffy) = get_tb();
355 snapshot_purr();
356}
357
138void __delay(unsigned long loops) 358void __delay(unsigned long loops)
139{ 359{
140 unsigned long start; 360 unsigned long start;
@@ -283,9 +503,9 @@ static inline void update_gtod(u64 new_tb_stamp, u64 new_stamp_xsec,
283 * the two values of tb_update_count match and are even then the 503 * the two values of tb_update_count match and are even then the
284 * tb_to_xs and stamp_xsec values are consistent. If not, then it 504 * tb_to_xs and stamp_xsec values are consistent. If not, then it
285 * loops back and reads them again until this criteria is met. 505 * loops back and reads them again until this criteria is met.
506 * We expect the caller to have done the first increment of
507 * vdso_data->tb_update_count already.
286 */ 508 */
287 ++(vdso_data->tb_update_count);
288 smp_wmb();
289 vdso_data->tb_orig_stamp = new_tb_stamp; 509 vdso_data->tb_orig_stamp = new_tb_stamp;
290 vdso_data->stamp_xsec = new_stamp_xsec; 510 vdso_data->stamp_xsec = new_stamp_xsec;
291 vdso_data->tb_to_xs = new_tb_to_xs; 511 vdso_data->tb_to_xs = new_tb_to_xs;
@@ -310,20 +530,15 @@ static __inline__ void timer_recalc_offset(u64 cur_tb)
310 unsigned long offset; 530 unsigned long offset;
311 u64 new_stamp_xsec; 531 u64 new_stamp_xsec;
312 u64 tlen, t2x; 532 u64 tlen, t2x;
533 u64 tb, xsec_old, xsec_new;
534 struct gettimeofday_vars *varp;
313 535
314 if (__USE_RTC()) 536 if (__USE_RTC())
315 return; 537 return;
316 tlen = current_tick_length(); 538 tlen = current_tick_length();
317 offset = cur_tb - do_gtod.varp->tb_orig_stamp; 539 offset = cur_tb - do_gtod.varp->tb_orig_stamp;
318 if (tlen == last_tick_len && offset < 0x80000000u) { 540 if (tlen == last_tick_len && offset < 0x80000000u)
319 /* check that we're still in sync; if not, resync */ 541 return;
320 struct timeval tv;
321 __do_gettimeofday(&tv, cur_tb);
322 if (tv.tv_sec <= xtime.tv_sec &&
323 (tv.tv_sec < xtime.tv_sec ||
324 tv.tv_usec * 1000 <= xtime.tv_nsec))
325 return;
326 }
327 if (tlen != last_tick_len) { 542 if (tlen != last_tick_len) {
328 t2x = mulhdu(tlen << TICKLEN_SHIFT, ticklen_to_xs); 543 t2x = mulhdu(tlen << TICKLEN_SHIFT, ticklen_to_xs);
329 last_tick_len = tlen; 544 last_tick_len = tlen;
@@ -332,6 +547,21 @@ static __inline__ void timer_recalc_offset(u64 cur_tb)
332 new_stamp_xsec = (u64) xtime.tv_nsec * XSEC_PER_SEC; 547 new_stamp_xsec = (u64) xtime.tv_nsec * XSEC_PER_SEC;
333 do_div(new_stamp_xsec, 1000000000); 548 do_div(new_stamp_xsec, 1000000000);
334 new_stamp_xsec += (u64) xtime.tv_sec * XSEC_PER_SEC; 549 new_stamp_xsec += (u64) xtime.tv_sec * XSEC_PER_SEC;
550
551 ++vdso_data->tb_update_count;
552 smp_mb();
553
554 /*
555 * Make sure time doesn't go backwards for userspace gettimeofday.
556 */
557 tb = get_tb();
558 varp = do_gtod.varp;
559 xsec_old = mulhdu(tb - varp->tb_orig_stamp, varp->tb_to_xs)
560 + varp->stamp_xsec;
561 xsec_new = mulhdu(tb - cur_tb, t2x) + new_stamp_xsec;
562 if (xsec_new < xsec_old)
563 new_stamp_xsec += xsec_old - xsec_new;
564
335 update_gtod(cur_tb, new_stamp_xsec, t2x); 565 update_gtod(cur_tb, new_stamp_xsec, t2x);
336} 566}
337 567
@@ -382,6 +612,7 @@ static void iSeries_tb_recal(void)
382 new_tb_ticks_per_jiffy, sign, tick_diff ); 612 new_tb_ticks_per_jiffy, sign, tick_diff );
383 tb_ticks_per_jiffy = new_tb_ticks_per_jiffy; 613 tb_ticks_per_jiffy = new_tb_ticks_per_jiffy;
384 tb_ticks_per_sec = new_tb_ticks_per_sec; 614 tb_ticks_per_sec = new_tb_ticks_per_sec;
615 calc_cputime_factors();
385 div128_by_32( XSEC_PER_SEC, 0, tb_ticks_per_sec, &divres ); 616 div128_by_32( XSEC_PER_SEC, 0, tb_ticks_per_sec, &divres );
386 do_gtod.tb_ticks_per_sec = tb_ticks_per_sec; 617 do_gtod.tb_ticks_per_sec = tb_ticks_per_sec;
387 tb_to_xs = divres.result_low; 618 tb_to_xs = divres.result_low;
@@ -430,6 +661,7 @@ void timer_interrupt(struct pt_regs * regs)
430 irq_enter(); 661 irq_enter();
431 662
432 profile_tick(CPU_PROFILING, regs); 663 profile_tick(CPU_PROFILING, regs);
664 calculate_steal_time();
433 665
434#ifdef CONFIG_PPC_ISERIES 666#ifdef CONFIG_PPC_ISERIES
435 get_lppaca()->int_dword.fields.decr_int = 0; 667 get_lppaca()->int_dword.fields.decr_int = 0;
@@ -451,7 +683,7 @@ void timer_interrupt(struct pt_regs * regs)
451 * is the case. 683 * is the case.
452 */ 684 */
453 if (!cpu_is_offline(cpu)) 685 if (!cpu_is_offline(cpu))
454 update_process_times(user_mode(regs)); 686 account_process_time(regs);
455 687
456 /* 688 /*
457 * No need to check whether cpu is offline here; boot_cpuid 689 * No need to check whether cpu is offline here; boot_cpuid
@@ -508,13 +740,27 @@ void wakeup_decrementer(void)
508void __init smp_space_timers(unsigned int max_cpus) 740void __init smp_space_timers(unsigned int max_cpus)
509{ 741{
510 int i; 742 int i;
743 unsigned long half = tb_ticks_per_jiffy / 2;
511 unsigned long offset = tb_ticks_per_jiffy / max_cpus; 744 unsigned long offset = tb_ticks_per_jiffy / max_cpus;
512 unsigned long previous_tb = per_cpu(last_jiffy, boot_cpuid); 745 unsigned long previous_tb = per_cpu(last_jiffy, boot_cpuid);
513 746
514 /* make sure tb > per_cpu(last_jiffy, cpu) for all cpus always */ 747 /* make sure tb > per_cpu(last_jiffy, cpu) for all cpus always */
515 previous_tb -= tb_ticks_per_jiffy; 748 previous_tb -= tb_ticks_per_jiffy;
516 for_each_cpu(i) { 749 /*
517 if (i != boot_cpuid) { 750 * The stolen time calculation for POWER5 shared-processor LPAR
751 * systems works better if the two threads' timebase interrupts
752 * are staggered by half a jiffy with respect to each other.
753 */
754 for_each_possible_cpu(i) {
755 if (i == boot_cpuid)
756 continue;
757 if (i == (boot_cpuid ^ 1))
758 per_cpu(last_jiffy, i) =
759 per_cpu(last_jiffy, boot_cpuid) - half;
760 else if (i & 1)
761 per_cpu(last_jiffy, i) =
762 per_cpu(last_jiffy, i ^ 1) + half;
763 else {
518 previous_tb += offset; 764 previous_tb += offset;
519 per_cpu(last_jiffy, i) = previous_tb; 765 per_cpu(last_jiffy, i) = previous_tb;
520 } 766 }
@@ -564,6 +810,10 @@ int do_settimeofday(struct timespec *tv)
564 } 810 }
565#endif 811#endif
566 812
813 /* Make userspace gettimeofday spin until we're done. */
814 ++vdso_data->tb_update_count;
815 smp_mb();
816
567 /* 817 /*
568 * Subtract off the number of nanoseconds since the 818 * Subtract off the number of nanoseconds since the
569 * beginning of the last tick. 819 * beginning of the last tick.
@@ -706,6 +956,7 @@ void __init time_init(void)
706 tb_ticks_per_sec = ppc_tb_freq; 956 tb_ticks_per_sec = ppc_tb_freq;
707 tb_ticks_per_usec = ppc_tb_freq / 1000000; 957 tb_ticks_per_usec = ppc_tb_freq / 1000000;
708 tb_to_us = mulhwu_scale_factor(ppc_tb_freq, 1000000); 958 tb_to_us = mulhwu_scale_factor(ppc_tb_freq, 1000000);
959 calc_cputime_factors();
709 960
710 /* 961 /*
711 * Calculate the length of each tick in ns. It will not be 962 * Calculate the length of each tick in ns. It will not be
@@ -724,10 +975,16 @@ void __init time_init(void)
724 * It is computed as: 975 * It is computed as:
725 * ticklen_to_xs = 2^N / (tb_ticks_per_jiffy * 1e9) 976 * ticklen_to_xs = 2^N / (tb_ticks_per_jiffy * 1e9)
726 * where N = 64 + 20 - TICKLEN_SCALE - TICKLEN_SHIFT 977 * where N = 64 + 20 - TICKLEN_SCALE - TICKLEN_SHIFT
727 * so as to give the result as a 0.64 fixed-point fraction. 978 * which turns out to be N = 51 - SHIFT_HZ.
979 * This gives the result as a 0.64 fixed-point fraction.
980 * That value is reduced by an offset amounting to 1 xsec per
981 * 2^31 timebase ticks to avoid problems with time going backwards
982 * by 1 xsec when we do timer_recalc_offset due to losing the
983 * fractional xsec. That offset is equal to ppc_tb_freq/2^51
984 * since there are 2^20 xsec in a second.
728 */ 985 */
729 div128_by_32(1ULL << (64 + 20 - TICKLEN_SCALE - TICKLEN_SHIFT), 0, 986 div128_by_32((1ULL << 51) - ppc_tb_freq, 0,
730 tb_ticks_per_jiffy, &res); 987 tb_ticks_per_jiffy << SHIFT_HZ, &res);
731 div128_by_32(res.result_high, res.result_low, NSEC_PER_SEC, &res); 988 div128_by_32(res.result_high, res.result_low, NSEC_PER_SEC, &res);
732 ticklen_to_xs = res.result_low; 989 ticklen_to_xs = res.result_low;
733 990
diff --git a/arch/powerpc/kernel/traps.c b/arch/powerpc/kernel/traps.c
index 98660aedeeb7..4cbde211eb69 100644
--- a/arch/powerpc/kernel/traps.c
+++ b/arch/powerpc/kernel/traps.c
@@ -74,19 +74,19 @@ EXPORT_SYMBOL(__debugger_dabr_match);
74EXPORT_SYMBOL(__debugger_fault_handler); 74EXPORT_SYMBOL(__debugger_fault_handler);
75#endif 75#endif
76 76
77struct notifier_block *powerpc_die_chain; 77ATOMIC_NOTIFIER_HEAD(powerpc_die_chain);
78static DEFINE_SPINLOCK(die_notifier_lock);
79 78
80int register_die_notifier(struct notifier_block *nb) 79int register_die_notifier(struct notifier_block *nb)
81{ 80{
82 int err = 0; 81 return atomic_notifier_chain_register(&powerpc_die_chain, nb);
83 unsigned long flags; 82}
83EXPORT_SYMBOL(register_die_notifier);
84 84
85 spin_lock_irqsave(&die_notifier_lock, flags); 85int unregister_die_notifier(struct notifier_block *nb)
86 err = notifier_chain_register(&powerpc_die_chain, nb); 86{
87 spin_unlock_irqrestore(&die_notifier_lock, flags); 87 return atomic_notifier_chain_unregister(&powerpc_die_chain, nb);
88 return err;
89} 88}
89EXPORT_SYMBOL(unregister_die_notifier);
90 90
91/* 91/*
92 * Trap & Exception support 92 * Trap & Exception support
@@ -97,7 +97,6 @@ static DEFINE_SPINLOCK(die_lock);
97int die(const char *str, struct pt_regs *regs, long err) 97int die(const char *str, struct pt_regs *regs, long err)
98{ 98{
99 static int die_counter, crash_dump_start = 0; 99 static int die_counter, crash_dump_start = 0;
100 int nl = 0;
101 100
102 if (debugger(regs)) 101 if (debugger(regs))
103 return 1; 102 return 1;
@@ -106,7 +105,7 @@ int die(const char *str, struct pt_regs *regs, long err)
106 spin_lock_irq(&die_lock); 105 spin_lock_irq(&die_lock);
107 bust_spinlocks(1); 106 bust_spinlocks(1);
108#ifdef CONFIG_PMAC_BACKLIGHT 107#ifdef CONFIG_PMAC_BACKLIGHT
109 if (_machine == _MACH_Pmac) { 108 if (machine_is(powermac)) {
110 set_backlight_enable(1); 109 set_backlight_enable(1);
111 set_backlight_level(BACKLIGHT_MAX); 110 set_backlight_level(BACKLIGHT_MAX);
112 } 111 }
@@ -114,46 +113,18 @@ int die(const char *str, struct pt_regs *regs, long err)
114 printk("Oops: %s, sig: %ld [#%d]\n", str, err, ++die_counter); 113 printk("Oops: %s, sig: %ld [#%d]\n", str, err, ++die_counter);
115#ifdef CONFIG_PREEMPT 114#ifdef CONFIG_PREEMPT
116 printk("PREEMPT "); 115 printk("PREEMPT ");
117 nl = 1;
118#endif 116#endif
119#ifdef CONFIG_SMP 117#ifdef CONFIG_SMP
120 printk("SMP NR_CPUS=%d ", NR_CPUS); 118 printk("SMP NR_CPUS=%d ", NR_CPUS);
121 nl = 1;
122#endif 119#endif
123#ifdef CONFIG_DEBUG_PAGEALLOC 120#ifdef CONFIG_DEBUG_PAGEALLOC
124 printk("DEBUG_PAGEALLOC "); 121 printk("DEBUG_PAGEALLOC ");
125 nl = 1;
126#endif 122#endif
127#ifdef CONFIG_NUMA 123#ifdef CONFIG_NUMA
128 printk("NUMA "); 124 printk("NUMA ");
129 nl = 1;
130#endif 125#endif
131#ifdef CONFIG_PPC64 126 printk("%s\n", ppc_md.name ? "" : ppc_md.name);
132 switch (_machine) { 127
133 case PLATFORM_PSERIES:
134 printk("PSERIES ");
135 nl = 1;
136 break;
137 case PLATFORM_PSERIES_LPAR:
138 printk("PSERIES LPAR ");
139 nl = 1;
140 break;
141 case PLATFORM_ISERIES_LPAR:
142 printk("ISERIES LPAR ");
143 nl = 1;
144 break;
145 case PLATFORM_POWERMAC:
146 printk("POWERMAC ");
147 nl = 1;
148 break;
149 case PLATFORM_CELL:
150 printk("CELL ");
151 nl = 1;
152 break;
153 }
154#endif
155 if (nl)
156 printk("\n");
157 print_modules(); 128 print_modules();
158 show_regs(regs); 129 show_regs(regs);
159 bust_spinlocks(0); 130 bust_spinlocks(0);
diff --git a/arch/powerpc/kernel/vdso.c b/arch/powerpc/kernel/vdso.c
index 04f7df39ffbb..573afb68d69e 100644
--- a/arch/powerpc/kernel/vdso.c
+++ b/arch/powerpc/kernel/vdso.c
@@ -1,6 +1,4 @@
1/* 1/*
2 * linux/arch/ppc64/kernel/vdso.c
3 *
4 * Copyright (C) 2004 Benjamin Herrenschmidt, IBM Corp. 2 * Copyright (C) 2004 Benjamin Herrenschmidt, IBM Corp.
5 * <benh@kernel.crashing.org> 3 * <benh@kernel.crashing.org>
6 * 4 *
@@ -35,6 +33,7 @@
35#include <asm/machdep.h> 33#include <asm/machdep.h>
36#include <asm/cputable.h> 34#include <asm/cputable.h>
37#include <asm/sections.h> 35#include <asm/sections.h>
36#include <asm/firmware.h>
38#include <asm/vdso.h> 37#include <asm/vdso.h>
39#include <asm/vdso_datapage.h> 38#include <asm/vdso_datapage.h>
40 39
@@ -669,7 +668,13 @@ void __init vdso_init(void)
669 vdso_data->version.major = SYSTEMCFG_MAJOR; 668 vdso_data->version.major = SYSTEMCFG_MAJOR;
670 vdso_data->version.minor = SYSTEMCFG_MINOR; 669 vdso_data->version.minor = SYSTEMCFG_MINOR;
671 vdso_data->processor = mfspr(SPRN_PVR); 670 vdso_data->processor = mfspr(SPRN_PVR);
672 vdso_data->platform = _machine; 671 /*
672 * Fake the old platform number for pSeries and iSeries and add
673 * in LPAR bit if necessary
674 */
675 vdso_data->platform = machine_is(iseries) ? 0x200 : 0x100;
676 if (firmware_has_feature(FW_FEATURE_LPAR))
677 vdso_data->platform |= 1;
673 vdso_data->physicalMemorySize = lmb_phys_mem_size(); 678 vdso_data->physicalMemorySize = lmb_phys_mem_size();
674 vdso_data->dcache_size = ppc64_caches.dsize; 679 vdso_data->dcache_size = ppc64_caches.dsize;
675 vdso_data->dcache_line_size = ppc64_caches.dline_size; 680 vdso_data->dcache_line_size = ppc64_caches.dline_size;
diff --git a/arch/powerpc/kernel/vdso32/sigtramp.S b/arch/powerpc/kernel/vdso32/sigtramp.S
index e04642781917..0c6a37b29dde 100644
--- a/arch/powerpc/kernel/vdso32/sigtramp.S
+++ b/arch/powerpc/kernel/vdso32/sigtramp.S
@@ -261,7 +261,7 @@ V_FUNCTION_END(__kernel_sigtramp_rt32)
261.Lcie_start: 261.Lcie_start:
262 .long 0 /* CIE ID */ 262 .long 0 /* CIE ID */
263 .byte 1 /* Version number */ 263 .byte 1 /* Version number */
264 .string "zR" /* NUL-terminated augmentation string */ 264 .string "zRS" /* NUL-terminated augmentation string */
265 .uleb128 4 /* Code alignment factor */ 265 .uleb128 4 /* Code alignment factor */
266 .sleb128 -4 /* Data alignment factor */ 266 .sleb128 -4 /* Data alignment factor */
267 .byte 67 /* Return address register column, ap */ 267 .byte 67 /* Return address register column, ap */
diff --git a/arch/powerpc/kernel/vdso64/sigtramp.S b/arch/powerpc/kernel/vdso64/sigtramp.S
index 31b604ab56de..7479edb101b8 100644
--- a/arch/powerpc/kernel/vdso64/sigtramp.S
+++ b/arch/powerpc/kernel/vdso64/sigtramp.S
@@ -263,7 +263,7 @@ V_FUNCTION_END(__kernel_sigtramp_rt64)
263.Lcie_start: 263.Lcie_start:
264 .long 0 /* CIE ID */ 264 .long 0 /* CIE ID */
265 .byte 1 /* Version number */ 265 .byte 1 /* Version number */
266 .string "zR" /* NUL-terminated augmentation string */ 266 .string "zRS" /* NUL-terminated augmentation string */
267 .uleb128 4 /* Code alignment factor */ 267 .uleb128 4 /* Code alignment factor */
268 .sleb128 -8 /* Data alignment factor */ 268 .sleb128 -8 /* Data alignment factor */
269 .byte 67 /* Return address register column, ap */ 269 .byte 67 /* Return address register column, ap */
diff --git a/arch/powerpc/kernel/vmlinux.lds.S b/arch/powerpc/kernel/vmlinux.lds.S
index 7fa7b15fd8e6..fe79c2584cb0 100644
--- a/arch/powerpc/kernel/vmlinux.lds.S
+++ b/arch/powerpc/kernel/vmlinux.lds.S
@@ -1,9 +1,11 @@
1#include <linux/config.h> 1#include <linux/config.h>
2#ifdef CONFIG_PPC64 2#ifdef CONFIG_PPC64
3#include <asm/page.h> 3#include <asm/page.h>
4#define PROVIDE32(x) PROVIDE(__unused__##x)
4#else 5#else
5#define PAGE_SIZE 4096 6#define PAGE_SIZE 4096
6#define KERNELBASE CONFIG_KERNEL_START 7#define KERNELBASE CONFIG_KERNEL_START
8#define PROVIDE32(x) PROVIDE(x)
7#endif 9#endif
8#include <asm-generic/vmlinux.lds.h> 10#include <asm-generic/vmlinux.lds.h>
9 11
@@ -18,43 +20,42 @@ jiffies = jiffies_64 + 4;
18#endif 20#endif
19SECTIONS 21SECTIONS
20{ 22{
21 /* Sections to be discarded. */ 23 /* Sections to be discarded. */
22 /DISCARD/ : { 24 /DISCARD/ : {
23 *(.exitcall.exit) 25 *(.exitcall.exit)
24 *(.exit.data) 26 *(.exit.data)
25 } 27 }
26
27 . = KERNELBASE;
28
29 /* Read-only sections, merged into text segment: */
30 .text : {
31 *(.text .text.*)
32 SCHED_TEXT
33 LOCK_TEXT
34 KPROBES_TEXT
35 *(.fixup)
36#ifdef CONFIG_PPC32
37 *(.got1)
38 __got2_start = .;
39 *(.got2)
40 __got2_end = .;
41#else
42 . = ALIGN(PAGE_SIZE);
43 _etext = .;
44#endif
45 }
46#ifdef CONFIG_PPC32
47 _etext = .;
48 PROVIDE (etext = .);
49 28
50 RODATA 29 . = KERNELBASE;
51 .fini : { *(.fini) } =0
52 .ctors : { *(.ctors) }
53 .dtors : { *(.dtors) }
54 30
55 .fixup : { *(.fixup) } 31/*
56#endif 32 * Text, read only data and other permanent read-only sections
33 */
34
35 /* Text and gots */
36 .text : {
37 *(.text .text.*)
38 SCHED_TEXT
39 LOCK_TEXT
40 KPROBES_TEXT
41 *(.fixup)
57 42
43#ifdef CONFIG_PPC32
44 *(.got1)
45 __got2_start = .;
46 *(.got2)
47 __got2_end = .;
48#endif /* CONFIG_PPC32 */
49
50 . = ALIGN(PAGE_SIZE);
51 _etext = .;
52 PROVIDE32 (etext = .);
53 }
54
55 /* Read-only data */
56 RODATA
57
58 /* Exception & bug tables */
58 __ex_table : { 59 __ex_table : {
59 __start___ex_table = .; 60 __start___ex_table = .;
60 *(__ex_table) 61 *(__ex_table)
@@ -67,192 +68,172 @@ SECTIONS
67 __stop___bug_table = .; 68 __stop___bug_table = .;
68 } 69 }
69 70
70#ifdef CONFIG_PPC64 71/*
72 * Init sections discarded at runtime
73 */
74 . = ALIGN(PAGE_SIZE);
75 __init_begin = .;
76
77 .init.text : {
78 _sinittext = .;
79 *(.init.text)
80 _einittext = .;
81 }
82
83 /* .exit.text is discarded at runtime, not link time,
84 * to deal with references from __bug_table
85 */
86 .exit.text : { *(.exit.text) }
87
88 .init.data : {
89 *(.init.data);
90 __vtop_table_begin = .;
91 *(.vtop_fixup);
92 __vtop_table_end = .;
93 __ptov_table_begin = .;
94 *(.ptov_fixup);
95 __ptov_table_end = .;
96 }
97
98 . = ALIGN(16);
99 .init.setup : {
100 __setup_start = .;
101 *(.init.setup)
102 __setup_end = .;
103 }
104
105 .initcall.init : {
106 __initcall_start = .;
107 *(.initcall1.init)
108 *(.initcall2.init)
109 *(.initcall3.init)
110 *(.initcall4.init)
111 *(.initcall5.init)
112 *(.initcall6.init)
113 *(.initcall7.init)
114 __initcall_end = .;
115 }
116
117 .con_initcall.init : {
118 __con_initcall_start = .;
119 *(.con_initcall.init)
120 __con_initcall_end = .;
121 }
122
123 SECURITY_INIT
124
125 . = ALIGN(8);
71 __ftr_fixup : { 126 __ftr_fixup : {
72 __start___ftr_fixup = .; 127 __start___ftr_fixup = .;
73 *(__ftr_fixup) 128 *(__ftr_fixup)
74 __stop___ftr_fixup = .; 129 __stop___ftr_fixup = .;
75 } 130 }
76 131
77 RODATA 132 . = ALIGN(PAGE_SIZE);
78#endif 133 .init.ramfs : {
134 __initramfs_start = .;
135 *(.init.ramfs)
136 __initramfs_end = .;
137 }
79 138
80#ifdef CONFIG_PPC32 139#ifdef CONFIG_PPC32
81 /* Read-write section, merged into data segment: */ 140 . = ALIGN(32);
82 . = ALIGN(PAGE_SIZE); 141#else
83 _sdata = .; 142 . = ALIGN(128);
84 .data :
85 {
86 *(.data)
87 *(.data1)
88 *(.sdata)
89 *(.sdata2)
90 *(.got.plt) *(.got)
91 *(.dynamic)
92 CONSTRUCTORS
93 }
94
95 . = ALIGN(PAGE_SIZE);
96 __nosave_begin = .;
97 .data_nosave : { *(.data.nosave) }
98 . = ALIGN(PAGE_SIZE);
99 __nosave_end = .;
100
101 . = ALIGN(32);
102 .data.cacheline_aligned : { *(.data.cacheline_aligned) }
103
104 _edata = .;
105 PROVIDE (edata = .);
106
107 . = ALIGN(8192);
108 .data.init_task : { *(.data.init_task) }
109#endif 143#endif
144 .data.percpu : {
145 __per_cpu_start = .;
146 *(.data.percpu)
147 __per_cpu_end = .;
148 }
110 149
111 /* will be freed after init */ 150 . = ALIGN(8);
112 . = ALIGN(PAGE_SIZE); 151 .machine.desc : {
113 __init_begin = .; 152 __machine_desc_start = . ;
114 .init.text : { 153 *(.machine.desc)
115 _sinittext = .; 154 __machine_desc_end = . ;
116 *(.init.text) 155 }
117 _einittext = .; 156
118 } 157 /* freed after init ends here */
119#ifdef CONFIG_PPC32 158 . = ALIGN(PAGE_SIZE);
120 /* .exit.text is discarded at runtime, not link time, 159 __init_end = .;
121 to deal with references from __bug_table */ 160
122 .exit.text : { *(.exit.text) } 161/*
123#endif 162 * And now the various read/write data
124 .init.data : { 163 */
125 *(.init.data); 164
126 __vtop_table_begin = .; 165 . = ALIGN(PAGE_SIZE);
127 *(.vtop_fixup); 166 _sdata = .;
128 __vtop_table_end = .;
129 __ptov_table_begin = .;
130 *(.ptov_fixup);
131 __ptov_table_end = .;
132 }
133
134 . = ALIGN(16);
135 .init.setup : {
136 __setup_start = .;
137 *(.init.setup)
138 __setup_end = .;
139 }
140
141 .initcall.init : {
142 __initcall_start = .;
143 *(.initcall1.init)
144 *(.initcall2.init)
145 *(.initcall3.init)
146 *(.initcall4.init)
147 *(.initcall5.init)
148 *(.initcall6.init)
149 *(.initcall7.init)
150 __initcall_end = .;
151 }
152
153 .con_initcall.init : {
154 __con_initcall_start = .;
155 *(.con_initcall.init)
156 __con_initcall_end = .;
157 }
158
159 SECURITY_INIT
160 167
161#ifdef CONFIG_PPC32 168#ifdef CONFIG_PPC32
162 __start___ftr_fixup = .; 169 .data :
163 __ftr_fixup : { *(__ftr_fixup) } 170 {
164 __stop___ftr_fixup = .; 171 *(.data)
172 *(.sdata)
173 *(.got.plt) *(.got)
174 }
165#else 175#else
166 . = ALIGN(PAGE_SIZE); 176 .data : {
167 .init.ramfs : { 177 *(.data .data.rel* .toc1)
168 __initramfs_start = .; 178 *(.branch_lt)
169 *(.init.ramfs) 179 }
170 __initramfs_end = .;
171 }
172#endif
173 180
174#ifdef CONFIG_PPC32 181 .opd : {
175 . = ALIGN(32); 182 *(.opd)
183 }
184
185 .got : {
186 __toc_start = .;
187 *(.got)
188 *(.toc)
189 }
176#endif 190#endif
177 .data.percpu : {
178 __per_cpu_start = .;
179 *(.data.percpu)
180 __per_cpu_end = .;
181 }
182 191
183 . = ALIGN(PAGE_SIZE); 192 . = ALIGN(PAGE_SIZE);
184#ifdef CONFIG_PPC64 193 _edata = .;
185 . = ALIGN(16384); 194 PROVIDE32 (edata = .);
186 __init_end = .; 195
187 /* freed after init ends here */ 196 /* The initial task and kernel stack */
188 197#ifdef CONFIG_PPC32
189 /* Read/write sections */ 198 . = ALIGN(8192);
190 . = ALIGN(PAGE_SIZE);
191 . = ALIGN(16384);
192 _sdata = .;
193 /* The initial task and kernel stack */
194 .data.init_task : {
195 *(.data.init_task)
196 }
197
198 . = ALIGN(PAGE_SIZE);
199 .data.page_aligned : {
200 *(.data.page_aligned)
201 }
202
203 .data.cacheline_aligned : {
204 *(.data.cacheline_aligned)
205 }
206
207 .data : {
208 *(.data .data.rel* .toc1)
209 *(.branch_lt)
210 }
211
212 .opd : {
213 *(.opd)
214 }
215
216 .got : {
217 __toc_start = .;
218 *(.got)
219 *(.toc)
220 . = ALIGN(PAGE_SIZE);
221 _edata = .;
222 }
223
224 . = ALIGN(PAGE_SIZE);
225#else 199#else
226 __initramfs_start = .; 200 . = ALIGN(16384);
227 .init.ramfs : { 201#endif
228 *(.init.ramfs) 202 .data.init_task : {
229 } 203 *(.data.init_task)
230 __initramfs_end = .; 204 }
231 205
232 . = ALIGN(4096); 206 . = ALIGN(PAGE_SIZE);
233 __init_end = .; 207 .data.page_aligned : {
208 *(.data.page_aligned)
209 }
234 210
235 . = ALIGN(4096); 211 .data.cacheline_aligned : {
236 _sextratext = .; 212 *(.data.cacheline_aligned)
237 _eextratext = .; 213 }
238 214
239 __bss_start = .; 215 . = ALIGN(PAGE_SIZE);
240#endif 216 __data_nosave : {
217 __nosave_begin = .;
218 *(.data.nosave)
219 . = ALIGN(PAGE_SIZE);
220 __nosave_end = .;
221 }
241 222
242 .bss : { 223/*
243 __bss_start = .; 224 * And finally the bss
244 *(.sbss) *(.scommon) 225 */
245 *(.dynbss) 226
246 *(.bss) 227 .bss : {
247 *(COMMON) 228 __bss_start = .;
248 __bss_stop = .; 229 *(.sbss) *(.scommon)
249 } 230 *(.dynbss)
231 *(.bss)
232 *(COMMON)
233 __bss_stop = .;
234 }
250 235
251#ifdef CONFIG_PPC64 236 . = ALIGN(PAGE_SIZE);
252 . = ALIGN(PAGE_SIZE); 237 _end = . ;
253#endif 238 PROVIDE32 (end = .);
254 _end = . ;
255#ifdef CONFIG_PPC32
256 PROVIDE (end = .);
257#endif
258} 239}
diff --git a/arch/powerpc/lib/copypage_64.S b/arch/powerpc/lib/copypage_64.S
index 40523b140109..f9837f44ac0b 100644
--- a/arch/powerpc/lib/copypage_64.S
+++ b/arch/powerpc/lib/copypage_64.S
@@ -1,6 +1,4 @@
1/* 1/*
2 * arch/ppc64/lib/copypage.S
3 *
4 * Copyright (C) 2002 Paul Mackerras, IBM Corp. 2 * Copyright (C) 2002 Paul Mackerras, IBM Corp.
5 * 3 *
6 * This program is free software; you can redistribute it and/or 4 * This program is free software; you can redistribute it and/or
diff --git a/arch/powerpc/lib/copyuser_64.S b/arch/powerpc/lib/copyuser_64.S
index 6d69ef39b7df..a6b54cb97c49 100644
--- a/arch/powerpc/lib/copyuser_64.S
+++ b/arch/powerpc/lib/copyuser_64.S
@@ -1,6 +1,4 @@
1/* 1/*
2 * arch/ppc64/lib/copyuser.S
3 *
4 * Copyright (C) 2002 Paul Mackerras, IBM Corp. 2 * Copyright (C) 2002 Paul Mackerras, IBM Corp.
5 * 3 *
6 * This program is free software; you can redistribute it and/or 4 * This program is free software; you can redistribute it and/or
diff --git a/arch/powerpc/lib/e2a.c b/arch/powerpc/lib/e2a.c
index d2b834887920..4b72ed8fd50e 100644
--- a/arch/powerpc/lib/e2a.c
+++ b/arch/powerpc/lib/e2a.c
@@ -1,9 +1,7 @@
1/* 1/*
2 * arch/ppc64/lib/e2a.c
3 *
4 * EBCDIC to ASCII conversion 2 * EBCDIC to ASCII conversion
5 * 3 *
6 * This function moved here from arch/ppc64/kernel/viopath.c 4 * This function moved here from arch/powerpc/platforms/iseries/viopath.c
7 * 5 *
8 * (C) Copyright 2000-2004 IBM Corporation 6 * (C) Copyright 2000-2004 IBM Corporation
9 * 7 *
@@ -105,4 +103,14 @@ unsigned char e2a(unsigned char x)
105} 103}
106EXPORT_SYMBOL(e2a); 104EXPORT_SYMBOL(e2a);
107 105
106unsigned char* strne2a(unsigned char *dest, const unsigned char *src, size_t n)
107{
108 int i;
109
110 n = strnlen(src, n);
108 111
112 for (i = 0; i < n; i++)
113 dest[i] = e2a(src[i]);
114
115 return dest;
116}
diff --git a/arch/powerpc/lib/memcpy_64.S b/arch/powerpc/lib/memcpy_64.S
index 9ccacdf5bcb9..fd66acfd3e3e 100644
--- a/arch/powerpc/lib/memcpy_64.S
+++ b/arch/powerpc/lib/memcpy_64.S
@@ -1,6 +1,4 @@
1/* 1/*
2 * arch/ppc64/lib/memcpy.S
3 *
4 * Copyright (C) 2002 Paul Mackerras, IBM Corp. 2 * Copyright (C) 2002 Paul Mackerras, IBM Corp.
5 * 3 *
6 * This program is free software; you can redistribute it and/or 4 * This program is free software; you can redistribute it and/or
diff --git a/arch/powerpc/lib/rheap.c b/arch/powerpc/lib/rheap.c
index 42c5de2c898f..31e511856dc5 100644
--- a/arch/powerpc/lib/rheap.c
+++ b/arch/powerpc/lib/rheap.c
@@ -1,6 +1,4 @@
1/* 1/*
2 * arch/ppc/syslib/rheap.c
3 *
4 * A Remote Heap. Remote means that we don't touch the memory that the 2 * A Remote Heap. Remote means that we don't touch the memory that the
5 * heap points to. Normal heap implementations use the memory they manage 3 * heap points to. Normal heap implementations use the memory they manage
6 * to place their list. We cannot do that because the memory we manage may 4 * to place their list. We cannot do that because the memory we manage may
diff --git a/arch/powerpc/lib/sstep.c b/arch/powerpc/lib/sstep.c
index 666c2aa55016..c251d9936612 100644
--- a/arch/powerpc/lib/sstep.c
+++ b/arch/powerpc/lib/sstep.c
@@ -18,7 +18,7 @@ extern char system_call_common[];
18 18
19#ifdef CONFIG_PPC64 19#ifdef CONFIG_PPC64
20/* Bits in SRR1 that are copied from MSR */ 20/* Bits in SRR1 that are copied from MSR */
21#define MSR_MASK 0xffffffff87c0ffff 21#define MSR_MASK 0xffffffff87c0ffffUL
22#else 22#else
23#define MSR_MASK 0x87c0ffff 23#define MSR_MASK 0x87c0ffff
24#endif 24#endif
diff --git a/arch/powerpc/lib/strcase.c b/arch/powerpc/lib/strcase.c
index 36b521091bbc..f8ec1eba3fdd 100644
--- a/arch/powerpc/lib/strcase.c
+++ b/arch/powerpc/lib/strcase.c
@@ -1,4 +1,6 @@
1#include <linux/types.h>
1#include <linux/ctype.h> 2#include <linux/ctype.h>
3#include <linux/string.h>
2 4
3int strcasecmp(const char *s1, const char *s2) 5int strcasecmp(const char *s1, const char *s2)
4{ 6{
@@ -11,7 +13,7 @@ int strcasecmp(const char *s1, const char *s2)
11 return c1 - c2; 13 return c1 - c2;
12} 14}
13 15
14int strncasecmp(const char *s1, const char *s2, int n) 16int strncasecmp(const char *s1, const char *s2, size_t n)
15{ 17{
16 int c1, c2; 18 int c1, c2;
17 19
diff --git a/arch/ppc/math-emu/Makefile b/arch/powerpc/math-emu/Makefile
index 754143e8936b..754143e8936b 100644
--- a/arch/ppc/math-emu/Makefile
+++ b/arch/powerpc/math-emu/Makefile
diff --git a/arch/ppc/math-emu/double.h b/arch/powerpc/math-emu/double.h
index ffba8b67f059..ffba8b67f059 100644
--- a/arch/ppc/math-emu/double.h
+++ b/arch/powerpc/math-emu/double.h
diff --git a/arch/ppc/math-emu/fabs.c b/arch/powerpc/math-emu/fabs.c
index 41f0617f3d3a..41f0617f3d3a 100644
--- a/arch/ppc/math-emu/fabs.c
+++ b/arch/powerpc/math-emu/fabs.c
diff --git a/arch/ppc/math-emu/fadd.c b/arch/powerpc/math-emu/fadd.c
index fc8836488b64..fc8836488b64 100644
--- a/arch/ppc/math-emu/fadd.c
+++ b/arch/powerpc/math-emu/fadd.c
diff --git a/arch/ppc/math-emu/fadds.c b/arch/powerpc/math-emu/fadds.c
index 93025b6c8f3c..93025b6c8f3c 100644
--- a/arch/ppc/math-emu/fadds.c
+++ b/arch/powerpc/math-emu/fadds.c
diff --git a/arch/ppc/math-emu/fcmpo.c b/arch/powerpc/math-emu/fcmpo.c
index 4efac394b4cb..4efac394b4cb 100644
--- a/arch/ppc/math-emu/fcmpo.c
+++ b/arch/powerpc/math-emu/fcmpo.c
diff --git a/arch/ppc/math-emu/fcmpu.c b/arch/powerpc/math-emu/fcmpu.c
index b7e33176e618..b7e33176e618 100644
--- a/arch/ppc/math-emu/fcmpu.c
+++ b/arch/powerpc/math-emu/fcmpu.c
diff --git a/arch/ppc/math-emu/fctiw.c b/arch/powerpc/math-emu/fctiw.c
index 3b3c98b840cf..3b3c98b840cf 100644
--- a/arch/ppc/math-emu/fctiw.c
+++ b/arch/powerpc/math-emu/fctiw.c
diff --git a/arch/ppc/math-emu/fctiwz.c b/arch/powerpc/math-emu/fctiwz.c
index 7717eb6fcfb6..7717eb6fcfb6 100644
--- a/arch/ppc/math-emu/fctiwz.c
+++ b/arch/powerpc/math-emu/fctiwz.c
diff --git a/arch/ppc/math-emu/fdiv.c b/arch/powerpc/math-emu/fdiv.c
index f2fba825b2d0..f2fba825b2d0 100644
--- a/arch/ppc/math-emu/fdiv.c
+++ b/arch/powerpc/math-emu/fdiv.c
diff --git a/arch/ppc/math-emu/fdivs.c b/arch/powerpc/math-emu/fdivs.c
index b971196e3175..b971196e3175 100644
--- a/arch/ppc/math-emu/fdivs.c
+++ b/arch/powerpc/math-emu/fdivs.c
diff --git a/arch/ppc/math-emu/fmadd.c b/arch/powerpc/math-emu/fmadd.c
index 0a1dbce793e9..0a1dbce793e9 100644
--- a/arch/ppc/math-emu/fmadd.c
+++ b/arch/powerpc/math-emu/fmadd.c
diff --git a/arch/ppc/math-emu/fmadds.c b/arch/powerpc/math-emu/fmadds.c
index 0f70bba9445e..0f70bba9445e 100644
--- a/arch/ppc/math-emu/fmadds.c
+++ b/arch/powerpc/math-emu/fmadds.c
diff --git a/arch/ppc/math-emu/fmr.c b/arch/powerpc/math-emu/fmr.c
index 28df700c0c7e..28df700c0c7e 100644
--- a/arch/ppc/math-emu/fmr.c
+++ b/arch/powerpc/math-emu/fmr.c
diff --git a/arch/ppc/math-emu/fmsub.c b/arch/powerpc/math-emu/fmsub.c
index 203fd48a6fec..203fd48a6fec 100644
--- a/arch/ppc/math-emu/fmsub.c
+++ b/arch/powerpc/math-emu/fmsub.c
diff --git a/arch/ppc/math-emu/fmsubs.c b/arch/powerpc/math-emu/fmsubs.c
index 8ce68624c189..8ce68624c189 100644
--- a/arch/ppc/math-emu/fmsubs.c
+++ b/arch/powerpc/math-emu/fmsubs.c
diff --git a/arch/ppc/math-emu/fmul.c b/arch/powerpc/math-emu/fmul.c
index 66c7e79aae2e..66c7e79aae2e 100644
--- a/arch/ppc/math-emu/fmul.c
+++ b/arch/powerpc/math-emu/fmul.c
diff --git a/arch/ppc/math-emu/fmuls.c b/arch/powerpc/math-emu/fmuls.c
index 26bc4278271c..26bc4278271c 100644
--- a/arch/ppc/math-emu/fmuls.c
+++ b/arch/powerpc/math-emu/fmuls.c
diff --git a/arch/ppc/math-emu/fnabs.c b/arch/powerpc/math-emu/fnabs.c
index c6b913d179e0..c6b913d179e0 100644
--- a/arch/ppc/math-emu/fnabs.c
+++ b/arch/powerpc/math-emu/fnabs.c
diff --git a/arch/ppc/math-emu/fneg.c b/arch/powerpc/math-emu/fneg.c
index fe9a98deff69..fe9a98deff69 100644
--- a/arch/ppc/math-emu/fneg.c
+++ b/arch/powerpc/math-emu/fneg.c
diff --git a/arch/ppc/math-emu/fnmadd.c b/arch/powerpc/math-emu/fnmadd.c
index 7f312276d920..7f312276d920 100644
--- a/arch/ppc/math-emu/fnmadd.c
+++ b/arch/powerpc/math-emu/fnmadd.c
diff --git a/arch/ppc/math-emu/fnmadds.c b/arch/powerpc/math-emu/fnmadds.c
index 65454c9c70bc..65454c9c70bc 100644
--- a/arch/ppc/math-emu/fnmadds.c
+++ b/arch/powerpc/math-emu/fnmadds.c
diff --git a/arch/ppc/math-emu/fnmsub.c b/arch/powerpc/math-emu/fnmsub.c
index f1ca7482b5f0..f1ca7482b5f0 100644
--- a/arch/ppc/math-emu/fnmsub.c
+++ b/arch/powerpc/math-emu/fnmsub.c
diff --git a/arch/ppc/math-emu/fnmsubs.c b/arch/powerpc/math-emu/fnmsubs.c
index 5c9a09a87dc7..5c9a09a87dc7 100644
--- a/arch/ppc/math-emu/fnmsubs.c
+++ b/arch/powerpc/math-emu/fnmsubs.c
diff --git a/arch/ppc/math-emu/fres.c b/arch/powerpc/math-emu/fres.c
index ec11e46d20af..ec11e46d20af 100644
--- a/arch/ppc/math-emu/fres.c
+++ b/arch/powerpc/math-emu/fres.c
diff --git a/arch/ppc/math-emu/frsp.c b/arch/powerpc/math-emu/frsp.c
index d879b2a3d0c9..d879b2a3d0c9 100644
--- a/arch/ppc/math-emu/frsp.c
+++ b/arch/powerpc/math-emu/frsp.c
diff --git a/arch/ppc/math-emu/frsqrte.c b/arch/powerpc/math-emu/frsqrte.c
index a11ae1829850..a11ae1829850 100644
--- a/arch/ppc/math-emu/frsqrte.c
+++ b/arch/powerpc/math-emu/frsqrte.c
diff --git a/arch/ppc/math-emu/fsel.c b/arch/powerpc/math-emu/fsel.c
index e36e6e72819a..e36e6e72819a 100644
--- a/arch/ppc/math-emu/fsel.c
+++ b/arch/powerpc/math-emu/fsel.c
diff --git a/arch/ppc/math-emu/fsqrt.c b/arch/powerpc/math-emu/fsqrt.c
index 6f8319f64a8a..6f8319f64a8a 100644
--- a/arch/ppc/math-emu/fsqrt.c
+++ b/arch/powerpc/math-emu/fsqrt.c
diff --git a/arch/ppc/math-emu/fsqrts.c b/arch/powerpc/math-emu/fsqrts.c
index 3b2b1cf55c12..3b2b1cf55c12 100644
--- a/arch/ppc/math-emu/fsqrts.c
+++ b/arch/powerpc/math-emu/fsqrts.c
diff --git a/arch/ppc/math-emu/fsub.c b/arch/powerpc/math-emu/fsub.c
index 956679042bb2..956679042bb2 100644
--- a/arch/ppc/math-emu/fsub.c
+++ b/arch/powerpc/math-emu/fsub.c
diff --git a/arch/ppc/math-emu/fsubs.c b/arch/powerpc/math-emu/fsubs.c
index 3428117dfe8c..3428117dfe8c 100644
--- a/arch/ppc/math-emu/fsubs.c
+++ b/arch/powerpc/math-emu/fsubs.c
diff --git a/arch/ppc/math-emu/lfd.c b/arch/powerpc/math-emu/lfd.c
index 7d38101c329b..7d38101c329b 100644
--- a/arch/ppc/math-emu/lfd.c
+++ b/arch/powerpc/math-emu/lfd.c
diff --git a/arch/ppc/math-emu/lfs.c b/arch/powerpc/math-emu/lfs.c
index c86dee3d7655..c86dee3d7655 100644
--- a/arch/ppc/math-emu/lfs.c
+++ b/arch/powerpc/math-emu/lfs.c
diff --git a/arch/ppc/math-emu/math.c b/arch/powerpc/math-emu/math.c
index b7dff53a7103..589153472761 100644
--- a/arch/ppc/math-emu/math.c
+++ b/arch/powerpc/math-emu/math.c
@@ -1,6 +1,4 @@
1/* 1/*
2 * arch/ppc/math-emu/math.c
3 *
4 * Copyright (C) 1999 Eddie C. Dost (ecd@atecom.com) 2 * Copyright (C) 1999 Eddie C. Dost (ecd@atecom.com)
5 */ 3 */
6 4
diff --git a/arch/ppc/math-emu/mcrfs.c b/arch/powerpc/math-emu/mcrfs.c
index 106dd912914b..106dd912914b 100644
--- a/arch/ppc/math-emu/mcrfs.c
+++ b/arch/powerpc/math-emu/mcrfs.c
diff --git a/arch/ppc/math-emu/mffs.c b/arch/powerpc/math-emu/mffs.c
index f477c9170e75..f477c9170e75 100644
--- a/arch/ppc/math-emu/mffs.c
+++ b/arch/powerpc/math-emu/mffs.c
diff --git a/arch/ppc/math-emu/mtfsb0.c b/arch/powerpc/math-emu/mtfsb0.c
index 99bfd80f4af3..99bfd80f4af3 100644
--- a/arch/ppc/math-emu/mtfsb0.c
+++ b/arch/powerpc/math-emu/mtfsb0.c
diff --git a/arch/ppc/math-emu/mtfsb1.c b/arch/powerpc/math-emu/mtfsb1.c
index 3d9e7ed92d2b..3d9e7ed92d2b 100644
--- a/arch/ppc/math-emu/mtfsb1.c
+++ b/arch/powerpc/math-emu/mtfsb1.c
diff --git a/arch/ppc/math-emu/mtfsf.c b/arch/powerpc/math-emu/mtfsf.c
index d70cf714994c..d70cf714994c 100644
--- a/arch/ppc/math-emu/mtfsf.c
+++ b/arch/powerpc/math-emu/mtfsf.c
diff --git a/arch/ppc/math-emu/mtfsfi.c b/arch/powerpc/math-emu/mtfsfi.c
index 71df854baa7e..71df854baa7e 100644
--- a/arch/ppc/math-emu/mtfsfi.c
+++ b/arch/powerpc/math-emu/mtfsfi.c
diff --git a/arch/ppc/math-emu/op-1.h b/arch/powerpc/math-emu/op-1.h
index c92fa95f562e..c92fa95f562e 100644
--- a/arch/ppc/math-emu/op-1.h
+++ b/arch/powerpc/math-emu/op-1.h
diff --git a/arch/ppc/math-emu/op-2.h b/arch/powerpc/math-emu/op-2.h
index b9b06b4c6ea1..b9b06b4c6ea1 100644
--- a/arch/ppc/math-emu/op-2.h
+++ b/arch/powerpc/math-emu/op-2.h
diff --git a/arch/ppc/math-emu/op-4.h b/arch/powerpc/math-emu/op-4.h
index fcdd6d064c54..fcdd6d064c54 100644
--- a/arch/ppc/math-emu/op-4.h
+++ b/arch/powerpc/math-emu/op-4.h
diff --git a/arch/ppc/math-emu/op-common.h b/arch/powerpc/math-emu/op-common.h
index afb82b6498ce..afb82b6498ce 100644
--- a/arch/ppc/math-emu/op-common.h
+++ b/arch/powerpc/math-emu/op-common.h
diff --git a/arch/ppc/math-emu/sfp-machine.h b/arch/powerpc/math-emu/sfp-machine.h
index 4b17d83cfcdd..4b17d83cfcdd 100644
--- a/arch/ppc/math-emu/sfp-machine.h
+++ b/arch/powerpc/math-emu/sfp-machine.h
diff --git a/arch/ppc/math-emu/single.h b/arch/powerpc/math-emu/single.h
index f19d99451815..f19d99451815 100644
--- a/arch/ppc/math-emu/single.h
+++ b/arch/powerpc/math-emu/single.h
diff --git a/arch/ppc/math-emu/soft-fp.h b/arch/powerpc/math-emu/soft-fp.h
index cca39598f873..cca39598f873 100644
--- a/arch/ppc/math-emu/soft-fp.h
+++ b/arch/powerpc/math-emu/soft-fp.h
diff --git a/arch/ppc/math-emu/stfd.c b/arch/powerpc/math-emu/stfd.c
index 3f8c2558a9e8..3f8c2558a9e8 100644
--- a/arch/ppc/math-emu/stfd.c
+++ b/arch/powerpc/math-emu/stfd.c
diff --git a/arch/ppc/math-emu/stfiwx.c b/arch/powerpc/math-emu/stfiwx.c
index 95caaeec6a08..95caaeec6a08 100644
--- a/arch/ppc/math-emu/stfiwx.c
+++ b/arch/powerpc/math-emu/stfiwx.c
diff --git a/arch/ppc/math-emu/stfs.c b/arch/powerpc/math-emu/stfs.c
index e87ca23c6dc3..e87ca23c6dc3 100644
--- a/arch/ppc/math-emu/stfs.c
+++ b/arch/powerpc/math-emu/stfs.c
diff --git a/arch/ppc/math-emu/types.c b/arch/powerpc/math-emu/types.c
index e1ed15d829db..e1ed15d829db 100644
--- a/arch/ppc/math-emu/types.c
+++ b/arch/powerpc/math-emu/types.c
diff --git a/arch/ppc/math-emu/udivmodti4.c b/arch/powerpc/math-emu/udivmodti4.c
index 7e112dc1e2f2..7e112dc1e2f2 100644
--- a/arch/ppc/math-emu/udivmodti4.c
+++ b/arch/powerpc/math-emu/udivmodti4.c
diff --git a/arch/powerpc/mm/fault.c b/arch/powerpc/mm/fault.c
index a4815d316722..5aea0909a5ec 100644
--- a/arch/powerpc/mm/fault.c
+++ b/arch/powerpc/mm/fault.c
@@ -1,6 +1,4 @@
1/* 1/*
2 * arch/ppc/mm/fault.c
3 *
4 * PowerPC version 2 * PowerPC version
5 * Copyright (C) 1995-1996 Gary Thomas (gdt@linuxppc.org) 3 * Copyright (C) 1995-1996 Gary Thomas (gdt@linuxppc.org)
6 * 4 *
@@ -269,25 +267,29 @@ good_area:
269#endif 267#endif
270#if defined(CONFIG_4xx) || defined(CONFIG_BOOKE) 268#if defined(CONFIG_4xx) || defined(CONFIG_BOOKE)
271 pte_t *ptep; 269 pte_t *ptep;
270 pmd_t *pmdp;
272 271
273 /* Since 4xx/Book-E supports per-page execute permission, 272 /* Since 4xx/Book-E supports per-page execute permission,
274 * we lazily flush dcache to icache. */ 273 * we lazily flush dcache to icache. */
275 ptep = NULL; 274 ptep = NULL;
276 if (get_pteptr(mm, address, &ptep) && pte_present(*ptep)) { 275 if (get_pteptr(mm, address, &ptep, &pmdp)) {
277 struct page *page = pte_page(*ptep); 276 spinlock_t *ptl = pte_lockptr(mm, pmdp);
278 277 spin_lock(ptl);
279 if (! test_bit(PG_arch_1, &page->flags)) { 278 if (pte_present(*ptep)) {
280 flush_dcache_icache_page(page); 279 struct page *page = pte_page(*ptep);
281 set_bit(PG_arch_1, &page->flags); 280
281 if (!test_bit(PG_arch_1, &page->flags)) {
282 flush_dcache_icache_page(page);
283 set_bit(PG_arch_1, &page->flags);
284 }
285 pte_update(ptep, 0, _PAGE_HWEXEC);
286 _tlbie(address);
287 pte_unmap_unlock(ptep, ptl);
288 up_read(&mm->mmap_sem);
289 return 0;
282 } 290 }
283 pte_update(ptep, 0, _PAGE_HWEXEC); 291 pte_unmap_unlock(ptep, ptl);
284 _tlbie(address);
285 pte_unmap(ptep);
286 up_read(&mm->mmap_sem);
287 return 0;
288 } 292 }
289 if (ptep != NULL)
290 pte_unmap(ptep);
291#endif 293#endif
292 /* a write */ 294 /* a write */
293 } else if (is_write) { 295 } else if (is_write) {
diff --git a/arch/powerpc/mm/hash_low_32.S b/arch/powerpc/mm/hash_low_32.S
index 12ccd7155bac..ea469eefa146 100644
--- a/arch/powerpc/mm/hash_low_32.S
+++ b/arch/powerpc/mm/hash_low_32.S
@@ -1,6 +1,4 @@
1/* 1/*
2 * arch/ppc/kernel/hashtable.S
3 *
4 * $Id: hashtable.S,v 1.6 1999/10/08 01:56:15 paulus Exp $ 2 * $Id: hashtable.S,v 1.6 1999/10/08 01:56:15 paulus Exp $
5 * 3 *
6 * PowerPC version 4 * PowerPC version
diff --git a/arch/powerpc/mm/hash_utils_64.c b/arch/powerpc/mm/hash_utils_64.c
index e9d589eefc14..c006d9039633 100644
--- a/arch/powerpc/mm/hash_utils_64.c
+++ b/arch/powerpc/mm/hash_utils_64.c
@@ -167,18 +167,18 @@ int htab_bolt_mapping(unsigned long vstart, unsigned long vend,
167 * normal insert callback here. 167 * normal insert callback here.
168 */ 168 */
169#ifdef CONFIG_PPC_ISERIES 169#ifdef CONFIG_PPC_ISERIES
170 if (_machine == PLATFORM_ISERIES_LPAR) 170 if (machine_is(iseries))
171 ret = iSeries_hpte_insert(hpteg, va, 171 ret = iSeries_hpte_insert(hpteg, va,
172 __pa(vaddr), 172 paddr,
173 tmp_mode, 173 tmp_mode,
174 HPTE_V_BOLTED, 174 HPTE_V_BOLTED,
175 psize); 175 psize);
176 else 176 else
177#endif 177#endif
178#ifdef CONFIG_PPC_PSERIES 178#ifdef CONFIG_PPC_PSERIES
179 if (_machine & PLATFORM_LPAR) 179 if (machine_is(pseries) && firmware_has_feature(FW_FEATURE_LPAR))
180 ret = pSeries_lpar_hpte_insert(hpteg, va, 180 ret = pSeries_lpar_hpte_insert(hpteg, va,
181 virt_to_abs(paddr), 181 paddr,
182 tmp_mode, 182 tmp_mode,
183 HPTE_V_BOLTED, 183 HPTE_V_BOLTED,
184 psize); 184 psize);
@@ -186,7 +186,7 @@ int htab_bolt_mapping(unsigned long vstart, unsigned long vend,
186#endif 186#endif
187#ifdef CONFIG_PPC_MULTIPLATFORM 187#ifdef CONFIG_PPC_MULTIPLATFORM
188 ret = native_hpte_insert(hpteg, va, 188 ret = native_hpte_insert(hpteg, va,
189 virt_to_abs(paddr), 189 paddr,
190 tmp_mode, HPTE_V_BOLTED, 190 tmp_mode, HPTE_V_BOLTED,
191 psize); 191 psize);
192#endif 192#endif
@@ -295,8 +295,7 @@ static void __init htab_init_page_sizes(void)
295 * Not in the device-tree, let's fallback on known size 295 * Not in the device-tree, let's fallback on known size
296 * list for 16M capable GP & GR 296 * list for 16M capable GP & GR
297 */ 297 */
298 if ((_machine != PLATFORM_ISERIES_LPAR) && 298 if (cpu_has_feature(CPU_FTR_16M_PAGE) && !machine_is(iseries))
299 cpu_has_feature(CPU_FTR_16M_PAGE))
300 memcpy(mmu_psize_defs, mmu_psize_defaults_gp, 299 memcpy(mmu_psize_defs, mmu_psize_defaults_gp,
301 sizeof(mmu_psize_defaults_gp)); 300 sizeof(mmu_psize_defaults_gp));
302 found: 301 found:
@@ -392,7 +391,7 @@ static unsigned long __init htab_get_table_size(void)
392#ifdef CONFIG_MEMORY_HOTPLUG 391#ifdef CONFIG_MEMORY_HOTPLUG
393void create_section_mapping(unsigned long start, unsigned long end) 392void create_section_mapping(unsigned long start, unsigned long end)
394{ 393{
395 BUG_ON(htab_bolt_mapping(start, end, start, 394 BUG_ON(htab_bolt_mapping(start, end, __pa(start),
396 _PAGE_ACCESSED | _PAGE_DIRTY | _PAGE_COHERENT | PP_RWXX, 395 _PAGE_ACCESSED | _PAGE_DIRTY | _PAGE_COHERENT | PP_RWXX,
397 mmu_linear_psize)); 396 mmu_linear_psize));
398} 397}
@@ -422,7 +421,7 @@ void __init htab_initialize(void)
422 421
423 htab_hash_mask = pteg_count - 1; 422 htab_hash_mask = pteg_count - 1;
424 423
425 if (platform_is_lpar()) { 424 if (firmware_has_feature(FW_FEATURE_LPAR)) {
426 /* Using a hypervisor which owns the htab */ 425 /* Using a hypervisor which owns the htab */
427 htab_address = NULL; 426 htab_address = NULL;
428 _SDR1 = 0; 427 _SDR1 = 0;
@@ -431,7 +430,6 @@ void __init htab_initialize(void)
431 * the absolute address space. 430 * the absolute address space.
432 */ 431 */
433 table = lmb_alloc(htab_size_bytes, htab_size_bytes); 432 table = lmb_alloc(htab_size_bytes, htab_size_bytes);
434 BUG_ON(table == 0);
435 433
436 DBG("Hash table allocated at %lx, size: %lx\n", table, 434 DBG("Hash table allocated at %lx, size: %lx\n", table,
437 htab_size_bytes); 435 htab_size_bytes);
@@ -474,21 +472,22 @@ void __init htab_initialize(void)
474 472
475 if (dart_tablebase != 0 && dart_tablebase >= base 473 if (dart_tablebase != 0 && dart_tablebase >= base
476 && dart_tablebase < (base + size)) { 474 && dart_tablebase < (base + size)) {
475 unsigned long dart_table_end = dart_tablebase + 16 * MB;
477 if (base != dart_tablebase) 476 if (base != dart_tablebase)
478 BUG_ON(htab_bolt_mapping(base, dart_tablebase, 477 BUG_ON(htab_bolt_mapping(base, dart_tablebase,
479 base, mode_rw, 478 __pa(base), mode_rw,
480 mmu_linear_psize)); 479 mmu_linear_psize));
481 if ((base + size) > (dart_tablebase + 16*MB)) 480 if ((base + size) > dart_table_end)
482 BUG_ON(htab_bolt_mapping(dart_tablebase+16*MB, 481 BUG_ON(htab_bolt_mapping(dart_tablebase+16*MB,
483 base + size, 482 base + size,
484 dart_tablebase+16*MB, 483 __pa(dart_table_end),
485 mode_rw, 484 mode_rw,
486 mmu_linear_psize)); 485 mmu_linear_psize));
487 continue; 486 continue;
488 } 487 }
489#endif /* CONFIG_U3_DART */ 488#endif /* CONFIG_U3_DART */
490 BUG_ON(htab_bolt_mapping(base, base + size, base, 489 BUG_ON(htab_bolt_mapping(base, base + size, __pa(base),
491 mode_rw, mmu_linear_psize)); 490 mode_rw, mmu_linear_psize));
492 } 491 }
493 492
494 /* 493 /*
@@ -505,8 +504,8 @@ void __init htab_initialize(void)
505 if (base + size >= tce_alloc_start) 504 if (base + size >= tce_alloc_start)
506 tce_alloc_start = base + size + 1; 505 tce_alloc_start = base + size + 1;
507 506
508 BUG_ON(htab_bolt_mapping(tce_alloc_start, tce_alloc_end, 507 BUG_ON(htab_bolt_mapping(tce_alloc_start, tce_alloc_end,
509 tce_alloc_start, mode_rw, 508 __pa(tce_alloc_start), mode_rw,
510 mmu_linear_psize)); 509 mmu_linear_psize));
511 } 510 }
512 511
@@ -517,7 +516,7 @@ void __init htab_initialize(void)
517 516
518void htab_initialize_secondary(void) 517void htab_initialize_secondary(void)
519{ 518{
520 if (!platform_is_lpar()) 519 if (!firmware_has_feature(FW_FEATURE_LPAR))
521 mtspr(SPRN_SDR1, _SDR1); 520 mtspr(SPRN_SDR1, _SDR1);
522} 521}
523 522
diff --git a/arch/powerpc/mm/hugetlbpage.c b/arch/powerpc/mm/hugetlbpage.c
index b51bb28c054b..7370f9f33e29 100644
--- a/arch/powerpc/mm/hugetlbpage.c
+++ b/arch/powerpc/mm/hugetlbpage.c
@@ -133,21 +133,6 @@ pte_t huge_ptep_get_and_clear(struct mm_struct *mm, unsigned long addr,
133 return __pte(old); 133 return __pte(old);
134} 134}
135 135
136/*
137 * This function checks for proper alignment of input addr and len parameters.
138 */
139int is_aligned_hugepage_range(unsigned long addr, unsigned long len)
140{
141 if (len & ~HPAGE_MASK)
142 return -EINVAL;
143 if (addr & ~HPAGE_MASK)
144 return -EINVAL;
145 if (! (within_hugepage_low_range(addr, len)
146 || within_hugepage_high_range(addr, len)) )
147 return -EINVAL;
148 return 0;
149}
150
151struct slb_flush_info { 136struct slb_flush_info {
152 struct mm_struct *mm; 137 struct mm_struct *mm;
153 u16 newareas; 138 u16 newareas;
diff --git a/arch/powerpc/mm/imalloc.c b/arch/powerpc/mm/imalloc.c
index 8b0c132bc163..add8c1a9af68 100644
--- a/arch/powerpc/mm/imalloc.c
+++ b/arch/powerpc/mm/imalloc.c
@@ -13,12 +13,12 @@
13#include <asm/uaccess.h> 13#include <asm/uaccess.h>
14#include <asm/pgalloc.h> 14#include <asm/pgalloc.h>
15#include <asm/pgtable.h> 15#include <asm/pgtable.h>
16#include <asm/semaphore.h> 16#include <linux/mutex.h>
17#include <asm/cacheflush.h> 17#include <asm/cacheflush.h>
18 18
19#include "mmu_decl.h" 19#include "mmu_decl.h"
20 20
21static DECLARE_MUTEX(imlist_sem); 21static DEFINE_MUTEX(imlist_mutex);
22struct vm_struct * imlist = NULL; 22struct vm_struct * imlist = NULL;
23 23
24static int get_free_im_addr(unsigned long size, unsigned long *im_addr) 24static int get_free_im_addr(unsigned long size, unsigned long *im_addr)
@@ -257,7 +257,7 @@ struct vm_struct * im_get_free_area(unsigned long size)
257 struct vm_struct *area; 257 struct vm_struct *area;
258 unsigned long addr; 258 unsigned long addr;
259 259
260 down(&imlist_sem); 260 mutex_lock(&imlist_mutex);
261 if (get_free_im_addr(size, &addr)) { 261 if (get_free_im_addr(size, &addr)) {
262 printk(KERN_ERR "%s() cannot obtain addr for size 0x%lx\n", 262 printk(KERN_ERR "%s() cannot obtain addr for size 0x%lx\n",
263 __FUNCTION__, size); 263 __FUNCTION__, size);
@@ -272,7 +272,7 @@ struct vm_struct * im_get_free_area(unsigned long size)
272 __FUNCTION__, addr, size); 272 __FUNCTION__, addr, size);
273 } 273 }
274next_im_done: 274next_im_done:
275 up(&imlist_sem); 275 mutex_unlock(&imlist_mutex);
276 return area; 276 return area;
277} 277}
278 278
@@ -281,9 +281,9 @@ struct vm_struct * im_get_area(unsigned long v_addr, unsigned long size,
281{ 281{
282 struct vm_struct *area; 282 struct vm_struct *area;
283 283
284 down(&imlist_sem); 284 mutex_lock(&imlist_mutex);
285 area = __im_get_area(v_addr, size, criteria); 285 area = __im_get_area(v_addr, size, criteria);
286 up(&imlist_sem); 286 mutex_unlock(&imlist_mutex);
287 return area; 287 return area;
288} 288}
289 289
@@ -297,17 +297,17 @@ void im_free(void * addr)
297 printk(KERN_ERR "Trying to %s bad address (%p)\n", __FUNCTION__, addr); 297 printk(KERN_ERR "Trying to %s bad address (%p)\n", __FUNCTION__, addr);
298 return; 298 return;
299 } 299 }
300 down(&imlist_sem); 300 mutex_lock(&imlist_mutex);
301 for (p = &imlist ; (tmp = *p) ; p = &tmp->next) { 301 for (p = &imlist ; (tmp = *p) ; p = &tmp->next) {
302 if (tmp->addr == addr) { 302 if (tmp->addr == addr) {
303 *p = tmp->next; 303 *p = tmp->next;
304 unmap_vm_area(tmp); 304 unmap_vm_area(tmp);
305 kfree(tmp); 305 kfree(tmp);
306 up(&imlist_sem); 306 mutex_unlock(&imlist_mutex);
307 return; 307 return;
308 } 308 }
309 } 309 }
310 up(&imlist_sem); 310 mutex_unlock(&imlist_mutex);
311 printk(KERN_ERR "Trying to %s nonexistent area (%p)\n", __FUNCTION__, 311 printk(KERN_ERR "Trying to %s nonexistent area (%p)\n", __FUNCTION__,
312 addr); 312 addr);
313} 313}
diff --git a/arch/powerpc/mm/init_32.c b/arch/powerpc/mm/init_32.c
index 7d0d75c11848..b57fb3a2b7bb 100644
--- a/arch/powerpc/mm/init_32.c
+++ b/arch/powerpc/mm/init_32.c
@@ -216,7 +216,7 @@ static void free_sec(unsigned long start, unsigned long end, const char *name)
216 216
217 while (start < end) { 217 while (start < end) {
218 ClearPageReserved(virt_to_page(start)); 218 ClearPageReserved(virt_to_page(start));
219 set_page_count(virt_to_page(start), 1); 219 init_page_count(virt_to_page(start));
220 free_page(start); 220 free_page(start);
221 cnt++; 221 cnt++;
222 start += PAGE_SIZE; 222 start += PAGE_SIZE;
@@ -248,7 +248,7 @@ void free_initrd_mem(unsigned long start, unsigned long end)
248 printk ("Freeing initrd memory: %ldk freed\n", (end - start) >> 10); 248 printk ("Freeing initrd memory: %ldk freed\n", (end - start) >> 10);
249 for (; start < end; start += PAGE_SIZE) { 249 for (; start < end; start += PAGE_SIZE) {
250 ClearPageReserved(virt_to_page(start)); 250 ClearPageReserved(virt_to_page(start));
251 set_page_count(virt_to_page(start), 1); 251 init_page_count(virt_to_page(start));
252 free_page(start); 252 free_page(start);
253 totalram_pages++; 253 totalram_pages++;
254 } 254 }
diff --git a/arch/powerpc/mm/init_64.c b/arch/powerpc/mm/init_64.c
index 81cfb0c2ec58..babebd15bdc4 100644
--- a/arch/powerpc/mm/init_64.c
+++ b/arch/powerpc/mm/init_64.c
@@ -84,54 +84,6 @@
84/* max amount of RAM to use */ 84/* max amount of RAM to use */
85unsigned long __max_memory; 85unsigned long __max_memory;
86 86
87/* info on what we think the IO hole is */
88unsigned long io_hole_start;
89unsigned long io_hole_size;
90
91/*
92 * Do very early mm setup.
93 */
94void __init mm_init_ppc64(void)
95{
96#ifndef CONFIG_PPC_ISERIES
97 unsigned long i;
98#endif
99
100 ppc64_boot_msg(0x100, "MM Init");
101
102 /* This is the story of the IO hole... please, keep seated,
103 * unfortunately, we are out of oxygen masks at the moment.
104 * So we need some rough way to tell where your big IO hole
105 * is. On pmac, it's between 2G and 4G, on POWER3, it's around
106 * that area as well, on POWER4 we don't have one, etc...
107 * We need that as a "hint" when sizing the TCE table on POWER3
108 * So far, the simplest way that seem work well enough for us it
109 * to just assume that the first discontinuity in our physical
110 * RAM layout is the IO hole. That may not be correct in the future
111 * (and isn't on iSeries but then we don't care ;)
112 */
113
114#ifndef CONFIG_PPC_ISERIES
115 for (i = 1; i < lmb.memory.cnt; i++) {
116 unsigned long base, prevbase, prevsize;
117
118 prevbase = lmb.memory.region[i-1].base;
119 prevsize = lmb.memory.region[i-1].size;
120 base = lmb.memory.region[i].base;
121 if (base > (prevbase + prevsize)) {
122 io_hole_start = prevbase + prevsize;
123 io_hole_size = base - (prevbase + prevsize);
124 break;
125 }
126 }
127#endif /* CONFIG_PPC_ISERIES */
128 if (io_hole_start)
129 printk("IO Hole assumed to be %lx -> %lx\n",
130 io_hole_start, io_hole_start + io_hole_size - 1);
131
132 ppc64_boot_msg(0x100, "MM Init Done");
133}
134
135void free_initmem(void) 87void free_initmem(void)
136{ 88{
137 unsigned long addr; 89 unsigned long addr;
@@ -140,7 +92,7 @@ void free_initmem(void)
140 for (; addr < (unsigned long)__init_end; addr += PAGE_SIZE) { 92 for (; addr < (unsigned long)__init_end; addr += PAGE_SIZE) {
141 memset((void *)addr, 0xcc, PAGE_SIZE); 93 memset((void *)addr, 0xcc, PAGE_SIZE);
142 ClearPageReserved(virt_to_page(addr)); 94 ClearPageReserved(virt_to_page(addr));
143 set_page_count(virt_to_page(addr), 1); 95 init_page_count(virt_to_page(addr));
144 free_page(addr); 96 free_page(addr);
145 totalram_pages++; 97 totalram_pages++;
146 } 98 }
@@ -155,7 +107,7 @@ void free_initrd_mem(unsigned long start, unsigned long end)
155 printk ("Freeing initrd memory: %ldk freed\n", (end - start) >> 10); 107 printk ("Freeing initrd memory: %ldk freed\n", (end - start) >> 10);
156 for (; start < end; start += PAGE_SIZE) { 108 for (; start < end; start += PAGE_SIZE) {
157 ClearPageReserved(virt_to_page(start)); 109 ClearPageReserved(virt_to_page(start));
158 set_page_count(virt_to_page(start), 1); 110 init_page_count(virt_to_page(start));
159 free_page(start); 111 free_page(start);
160 totalram_pages++; 112 totalram_pages++;
161 } 113 }
diff --git a/arch/powerpc/mm/lmb.c b/arch/powerpc/mm/lmb.c
index bbe3eac918e8..417d58518558 100644
--- a/arch/powerpc/mm/lmb.c
+++ b/arch/powerpc/mm/lmb.c
@@ -31,6 +31,8 @@
31#define DBG(fmt...) 31#define DBG(fmt...)
32#endif 32#endif
33 33
34#define LMB_ALLOC_ANYWHERE 0
35
34struct lmb lmb; 36struct lmb lmb;
35 37
36void lmb_dump_all(void) 38void lmb_dump_all(void)
@@ -226,6 +228,20 @@ unsigned long __init lmb_alloc(unsigned long size, unsigned long align)
226unsigned long __init lmb_alloc_base(unsigned long size, unsigned long align, 228unsigned long __init lmb_alloc_base(unsigned long size, unsigned long align,
227 unsigned long max_addr) 229 unsigned long max_addr)
228{ 230{
231 unsigned long alloc;
232
233 alloc = __lmb_alloc_base(size, align, max_addr);
234
235 if (alloc == 0)
236 panic("ERROR: Failed to allocate 0x%lx bytes below 0x%lx.\n",
237 size, max_addr);
238
239 return alloc;
240}
241
242unsigned long __init __lmb_alloc_base(unsigned long size, unsigned long align,
243 unsigned long max_addr)
244{
229 long i, j; 245 long i, j;
230 unsigned long base = 0; 246 unsigned long base = 0;
231 247
diff --git a/arch/powerpc/mm/mem.c b/arch/powerpc/mm/mem.c
index 550517c2dd42..741dd8802d49 100644
--- a/arch/powerpc/mm/mem.c
+++ b/arch/powerpc/mm/mem.c
@@ -108,8 +108,8 @@ EXPORT_SYMBOL(phys_mem_access_prot);
108void online_page(struct page *page) 108void online_page(struct page *page)
109{ 109{
110 ClearPageReserved(page); 110 ClearPageReserved(page);
111 set_page_count(page, 0); 111 init_page_count(page);
112 free_cold_page(page); 112 __free_page(page);
113 totalram_pages++; 113 totalram_pages++;
114 num_physpages++; 114 num_physpages++;
115} 115}
@@ -125,7 +125,7 @@ int __devinit add_memory(u64 start, u64 size)
125 nid = hot_add_scn_to_nid(start); 125 nid = hot_add_scn_to_nid(start);
126 pgdata = NODE_DATA(nid); 126 pgdata = NODE_DATA(nid);
127 127
128 start = __va(start); 128 start = (unsigned long)__va(start);
129 create_section_mapping(start, start + size); 129 create_section_mapping(start, start + size);
130 130
131 /* this should work for most non-highmem platforms */ 131 /* this should work for most non-highmem platforms */
@@ -195,7 +195,7 @@ void show_mem(void)
195 printk("Mem-info:\n"); 195 printk("Mem-info:\n");
196 show_free_areas(); 196 show_free_areas();
197 printk("Free swap: %6ldkB\n", nr_swap_pages<<(PAGE_SHIFT-10)); 197 printk("Free swap: %6ldkB\n", nr_swap_pages<<(PAGE_SHIFT-10));
198 for_each_pgdat(pgdat) { 198 for_each_online_pgdat(pgdat) {
199 unsigned long flags; 199 unsigned long flags;
200 pgdat_resize_lock(pgdat, &flags); 200 pgdat_resize_lock(pgdat, &flags);
201 for (i = 0; i < pgdat->node_spanned_pages; i++) { 201 for (i = 0; i < pgdat->node_spanned_pages; i++) {
@@ -249,7 +249,6 @@ void __init do_init_bootmem(void)
249 bootmap_pages = bootmem_bootmap_pages(total_pages); 249 bootmap_pages = bootmem_bootmap_pages(total_pages);
250 250
251 start = lmb_alloc(bootmap_pages << PAGE_SHIFT, PAGE_SIZE); 251 start = lmb_alloc(bootmap_pages << PAGE_SHIFT, PAGE_SIZE);
252 BUG_ON(!start);
253 252
254 boot_mapsize = init_bootmem(start >> PAGE_SHIFT, total_pages); 253 boot_mapsize = init_bootmem(start >> PAGE_SHIFT, total_pages);
255 254
@@ -343,7 +342,7 @@ void __init mem_init(void)
343#ifdef CONFIG_NEED_MULTIPLE_NODES 342#ifdef CONFIG_NEED_MULTIPLE_NODES
344 for_each_online_node(nid) { 343 for_each_online_node(nid) {
345 if (NODE_DATA(nid)->node_spanned_pages != 0) { 344 if (NODE_DATA(nid)->node_spanned_pages != 0) {
346 printk("freeing bootmem node %x\n", nid); 345 printk("freeing bootmem node %d\n", nid);
347 totalram_pages += 346 totalram_pages +=
348 free_all_bootmem_node(NODE_DATA(nid)); 347 free_all_bootmem_node(NODE_DATA(nid));
349 } 348 }
@@ -352,7 +351,7 @@ void __init mem_init(void)
352 max_mapnr = max_pfn; 351 max_mapnr = max_pfn;
353 totalram_pages += free_all_bootmem(); 352 totalram_pages += free_all_bootmem();
354#endif 353#endif
355 for_each_pgdat(pgdat) { 354 for_each_online_pgdat(pgdat) {
356 for (i = 0; i < pgdat->node_spanned_pages; i++) { 355 for (i = 0; i < pgdat->node_spanned_pages; i++) {
357 if (!pfn_valid(pgdat->node_start_pfn + i)) 356 if (!pfn_valid(pgdat->node_start_pfn + i))
358 continue; 357 continue;
@@ -376,7 +375,7 @@ void __init mem_init(void)
376 struct page *page = pfn_to_page(pfn); 375 struct page *page = pfn_to_page(pfn);
377 376
378 ClearPageReserved(page); 377 ClearPageReserved(page);
379 set_page_count(page, 1); 378 init_page_count(page);
380 __free_page(page); 379 __free_page(page);
381 totalhigh_pages++; 380 totalhigh_pages++;
382 } 381 }
diff --git a/arch/powerpc/mm/mmap.c b/arch/powerpc/mm/mmap.c
index fe65f522aff3..972a8e884b9a 100644
--- a/arch/powerpc/mm/mmap.c
+++ b/arch/powerpc/mm/mmap.c
@@ -1,6 +1,4 @@
1/* 1/*
2 * linux/arch/ppc64/mm/mmap.c
3 *
4 * flexible mmap layout support 2 * flexible mmap layout support
5 * 3 *
6 * Copyright 2003-2004 Red Hat Inc., Durham, North Carolina. 4 * Copyright 2003-2004 Red Hat Inc., Durham, North Carolina.
diff --git a/arch/powerpc/mm/numa.c b/arch/powerpc/mm/numa.c
index 2863a912bcd0..0a335f34974c 100644
--- a/arch/powerpc/mm/numa.c
+++ b/arch/powerpc/mm/numa.c
@@ -129,10 +129,12 @@ void __init get_region(unsigned int nid, unsigned long *start_pfn,
129 *start_pfn = 0; 129 *start_pfn = 0;
130} 130}
131 131
132static inline void map_cpu_to_node(int cpu, int node) 132static void __cpuinit map_cpu_to_node(int cpu, int node)
133{ 133{
134 numa_cpu_lookup_table[cpu] = node; 134 numa_cpu_lookup_table[cpu] = node;
135 135
136 dbg("adding cpu %d to node %d\n", cpu, node);
137
136 if (!(cpu_isset(cpu, numa_cpumask_lookup_table[node]))) 138 if (!(cpu_isset(cpu, numa_cpumask_lookup_table[node])))
137 cpu_set(cpu, numa_cpumask_lookup_table[node]); 139 cpu_set(cpu, numa_cpumask_lookup_table[node]);
138} 140}
@@ -153,7 +155,7 @@ static void unmap_cpu_from_node(unsigned long cpu)
153} 155}
154#endif /* CONFIG_HOTPLUG_CPU */ 156#endif /* CONFIG_HOTPLUG_CPU */
155 157
156static struct device_node *find_cpu_node(unsigned int cpu) 158static struct device_node * __cpuinit find_cpu_node(unsigned int cpu)
157{ 159{
158 unsigned int hw_cpuid = get_hard_smp_processor_id(cpu); 160 unsigned int hw_cpuid = get_hard_smp_processor_id(cpu);
159 struct device_node *cpu_node = NULL; 161 struct device_node *cpu_node = NULL;
@@ -189,23 +191,29 @@ static int *of_get_associativity(struct device_node *dev)
189 return (unsigned int *)get_property(dev, "ibm,associativity", NULL); 191 return (unsigned int *)get_property(dev, "ibm,associativity", NULL);
190} 192}
191 193
192static int of_node_numa_domain(struct device_node *device) 194/* Returns nid in the range [0..MAX_NUMNODES-1], or -1 if no useful numa
195 * info is found.
196 */
197static int of_node_to_nid(struct device_node *device)
193{ 198{
194 int numa_domain; 199 int nid = -1;
195 unsigned int *tmp; 200 unsigned int *tmp;
196 201
197 if (min_common_depth == -1) 202 if (min_common_depth == -1)
198 return 0; 203 goto out;
199 204
200 tmp = of_get_associativity(device); 205 tmp = of_get_associativity(device);
201 if (tmp && (tmp[0] >= min_common_depth)) { 206 if (!tmp)
202 numa_domain = tmp[min_common_depth]; 207 goto out;
203 } else { 208
204 dbg("WARNING: no NUMA information for %s\n", 209 if (tmp[0] >= min_common_depth)
205 device->full_name); 210 nid = tmp[min_common_depth];
206 numa_domain = 0; 211
207 } 212 /* POWER4 LPAR uses 0xffff as invalid node */
208 return numa_domain; 213 if (nid == 0xffff || nid >= MAX_NUMNODES)
214 nid = -1;
215out:
216 return nid;
209} 217}
210 218
211/* 219/*
@@ -246,8 +254,7 @@ static int __init find_min_common_depth(void)
246 if ((len >= 1) && ref_points) { 254 if ((len >= 1) && ref_points) {
247 depth = ref_points[1]; 255 depth = ref_points[1];
248 } else { 256 } else {
249 dbg("WARNING: could not find NUMA " 257 dbg("NUMA: ibm,associativity-reference-points not found.\n");
250 "associativity reference point\n");
251 depth = -1; 258 depth = -1;
252 } 259 }
253 of_node_put(rtas_root); 260 of_node_put(rtas_root);
@@ -283,9 +290,9 @@ static unsigned long __devinit read_n_cells(int n, unsigned int **buf)
283 * Figure out to which domain a cpu belongs and stick it there. 290 * Figure out to which domain a cpu belongs and stick it there.
284 * Return the id of the domain used. 291 * Return the id of the domain used.
285 */ 292 */
286static int numa_setup_cpu(unsigned long lcpu) 293static int __cpuinit numa_setup_cpu(unsigned long lcpu)
287{ 294{
288 int numa_domain = 0; 295 int nid = 0;
289 struct device_node *cpu = find_cpu_node(lcpu); 296 struct device_node *cpu = find_cpu_node(lcpu);
290 297
291 if (!cpu) { 298 if (!cpu) {
@@ -293,27 +300,16 @@ static int numa_setup_cpu(unsigned long lcpu)
293 goto out; 300 goto out;
294 } 301 }
295 302
296 numa_domain = of_node_numa_domain(cpu); 303 nid = of_node_to_nid(cpu);
297 304
298 if (numa_domain >= num_online_nodes()) { 305 if (nid < 0 || !node_online(nid))
299 /* 306 nid = any_online_node(NODE_MASK_ALL);
300 * POWER4 LPAR uses 0xffff as invalid node,
301 * dont warn in this case.
302 */
303 if (numa_domain != 0xffff)
304 printk(KERN_ERR "WARNING: cpu %ld "
305 "maps to invalid NUMA node %d\n",
306 lcpu, numa_domain);
307 numa_domain = 0;
308 }
309out: 307out:
310 node_set_online(numa_domain); 308 map_cpu_to_node(lcpu, nid);
311
312 map_cpu_to_node(lcpu, numa_domain);
313 309
314 of_node_put(cpu); 310 of_node_put(cpu);
315 311
316 return numa_domain; 312 return nid;
317} 313}
318 314
319static int cpu_numa_callback(struct notifier_block *nfb, 315static int cpu_numa_callback(struct notifier_block *nfb,
@@ -325,10 +321,7 @@ static int cpu_numa_callback(struct notifier_block *nfb,
325 321
326 switch (action) { 322 switch (action) {
327 case CPU_UP_PREPARE: 323 case CPU_UP_PREPARE:
328 if (min_common_depth == -1 || !numa_enabled) 324 numa_setup_cpu(lcpu);
329 map_cpu_to_node(lcpu, 0);
330 else
331 numa_setup_cpu(lcpu);
332 ret = NOTIFY_OK; 325 ret = NOTIFY_OK;
333 break; 326 break;
334#ifdef CONFIG_HOTPLUG_CPU 327#ifdef CONFIG_HOTPLUG_CPU
@@ -375,7 +368,7 @@ static int __init parse_numa_properties(void)
375{ 368{
376 struct device_node *cpu = NULL; 369 struct device_node *cpu = NULL;
377 struct device_node *memory = NULL; 370 struct device_node *memory = NULL;
378 int max_domain; 371 int default_nid = 0;
379 unsigned long i; 372 unsigned long i;
380 373
381 if (numa_enabled == 0) { 374 if (numa_enabled == 0) {
@@ -385,32 +378,32 @@ static int __init parse_numa_properties(void)
385 378
386 min_common_depth = find_min_common_depth(); 379 min_common_depth = find_min_common_depth();
387 380
388 dbg("NUMA associativity depth for CPU/Memory: %d\n", min_common_depth);
389 if (min_common_depth < 0) 381 if (min_common_depth < 0)
390 return min_common_depth; 382 return min_common_depth;
391 383
392 max_domain = numa_setup_cpu(boot_cpuid); 384 dbg("NUMA associativity depth for CPU/Memory: %d\n", min_common_depth);
393 385
394 /* 386 /*
395 * Even though we connect cpus to numa domains later in SMP init, 387 * Even though we connect cpus to numa domains later in SMP
396 * we need to know the maximum node id now. This is because each 388 * init, we need to know the node ids now. This is because
397 * node id must have NODE_DATA etc backing it. 389 * each node to be onlined must have NODE_DATA etc backing it.
398 * As a result of hotplug we could still have cpus appear later on
399 * with larger node ids. In that case we force the cpu into node 0.
400 */ 390 */
401 for_each_cpu(i) { 391 for_each_present_cpu(i) {
402 int numa_domain; 392 int nid;
403 393
404 cpu = find_cpu_node(i); 394 cpu = find_cpu_node(i);
395 BUG_ON(!cpu);
396 nid = of_node_to_nid(cpu);
397 of_node_put(cpu);
405 398
406 if (cpu) { 399 /*
407 numa_domain = of_node_numa_domain(cpu); 400 * Don't fall back to default_nid yet -- we will plug
408 of_node_put(cpu); 401 * cpus into nodes once the memory scan has discovered
409 402 * the topology.
410 if (numa_domain < MAX_NUMNODES && 403 */
411 max_domain < numa_domain) 404 if (nid < 0)
412 max_domain = numa_domain; 405 continue;
413 } 406 node_set_online(nid);
414 } 407 }
415 408
416 get_n_mem_cells(&n_mem_addr_cells, &n_mem_size_cells); 409 get_n_mem_cells(&n_mem_addr_cells, &n_mem_size_cells);
@@ -418,7 +411,7 @@ static int __init parse_numa_properties(void)
418 while ((memory = of_find_node_by_type(memory, "memory")) != NULL) { 411 while ((memory = of_find_node_by_type(memory, "memory")) != NULL) {
419 unsigned long start; 412 unsigned long start;
420 unsigned long size; 413 unsigned long size;
421 int numa_domain; 414 int nid;
422 int ranges; 415 int ranges;
423 unsigned int *memcell_buf; 416 unsigned int *memcell_buf;
424 unsigned int len; 417 unsigned int len;
@@ -439,18 +432,15 @@ new_range:
439 start = read_n_cells(n_mem_addr_cells, &memcell_buf); 432 start = read_n_cells(n_mem_addr_cells, &memcell_buf);
440 size = read_n_cells(n_mem_size_cells, &memcell_buf); 433 size = read_n_cells(n_mem_size_cells, &memcell_buf);
441 434
442 numa_domain = of_node_numa_domain(memory); 435 /*
443 436 * Assumption: either all memory nodes or none will
444 if (numa_domain >= MAX_NUMNODES) { 437 * have associativity properties. If none, then
445 if (numa_domain != 0xffff) 438 * everything goes to default_nid.
446 printk(KERN_ERR "WARNING: memory at %lx maps " 439 */
447 "to invalid NUMA node %d\n", start, 440 nid = of_node_to_nid(memory);
448 numa_domain); 441 if (nid < 0)
449 numa_domain = 0; 442 nid = default_nid;
450 } 443 node_set_online(nid);
451
452 if (max_domain < numa_domain)
453 max_domain = numa_domain;
454 444
455 if (!(size = numa_enforce_memory_limit(start, size))) { 445 if (!(size = numa_enforce_memory_limit(start, size))) {
456 if (--ranges) 446 if (--ranges)
@@ -459,16 +449,13 @@ new_range:
459 continue; 449 continue;
460 } 450 }
461 451
462 add_region(numa_domain, start >> PAGE_SHIFT, 452 add_region(nid, start >> PAGE_SHIFT,
463 size >> PAGE_SHIFT); 453 size >> PAGE_SHIFT);
464 454
465 if (--ranges) 455 if (--ranges)
466 goto new_range; 456 goto new_range;
467 } 457 }
468 458
469 for (i = 0; i <= max_domain; i++)
470 node_set_online(i);
471
472 return 0; 459 return 0;
473} 460}
474 461
@@ -483,7 +470,6 @@ static void __init setup_nonnuma(void)
483 printk(KERN_INFO "Memory hole size: %ldMB\n", 470 printk(KERN_INFO "Memory hole size: %ldMB\n",
484 (top_of_ram - total_ram) >> 20); 471 (top_of_ram - total_ram) >> 20);
485 472
486 map_cpu_to_node(boot_cpuid, 0);
487 for (i = 0; i < lmb.memory.cnt; ++i) 473 for (i = 0; i < lmb.memory.cnt; ++i)
488 add_region(0, lmb.memory.region[i].base >> PAGE_SHIFT, 474 add_region(0, lmb.memory.region[i].base >> PAGE_SHIFT,
489 lmb_size_pages(&lmb.memory, i)); 475 lmb_size_pages(&lmb.memory, i));
@@ -570,11 +556,11 @@ static void __init *careful_allocation(int nid, unsigned long size,
570 unsigned long end_pfn) 556 unsigned long end_pfn)
571{ 557{
572 int new_nid; 558 int new_nid;
573 unsigned long ret = lmb_alloc_base(size, align, end_pfn << PAGE_SHIFT); 559 unsigned long ret = __lmb_alloc_base(size, align, end_pfn << PAGE_SHIFT);
574 560
575 /* retry over all memory */ 561 /* retry over all memory */
576 if (!ret) 562 if (!ret)
577 ret = lmb_alloc_base(size, align, lmb_end_of_DRAM()); 563 ret = __lmb_alloc_base(size, align, lmb_end_of_DRAM());
578 564
579 if (!ret) 565 if (!ret)
580 panic("numa.c: cannot allocate %lu bytes on node %d", 566 panic("numa.c: cannot allocate %lu bytes on node %d",
@@ -620,6 +606,8 @@ void __init do_init_bootmem(void)
620 dump_numa_memory_topology(); 606 dump_numa_memory_topology();
621 607
622 register_cpu_notifier(&ppc64_numa_nb); 608 register_cpu_notifier(&ppc64_numa_nb);
609 cpu_numa_callback(&ppc64_numa_nb, CPU_UP_PREPARE,
610 (void *)(unsigned long)boot_cpuid);
623 611
624 for_each_online_node(nid) { 612 for_each_online_node(nid) {
625 unsigned long start_pfn, end_pfn, pages_present; 613 unsigned long start_pfn, end_pfn, pages_present;
@@ -767,10 +755,11 @@ int hot_add_scn_to_nid(unsigned long scn_addr)
767{ 755{
768 struct device_node *memory = NULL; 756 struct device_node *memory = NULL;
769 nodemask_t nodes; 757 nodemask_t nodes;
770 int numa_domain = 0; 758 int default_nid = any_online_node(NODE_MASK_ALL);
759 int nid;
771 760
772 if (!numa_enabled || (min_common_depth < 0)) 761 if (!numa_enabled || (min_common_depth < 0))
773 return numa_domain; 762 return default_nid;
774 763
775 while ((memory = of_find_node_by_type(memory, "memory")) != NULL) { 764 while ((memory = of_find_node_by_type(memory, "memory")) != NULL) {
776 unsigned long start, size; 765 unsigned long start, size;
@@ -787,29 +776,30 @@ int hot_add_scn_to_nid(unsigned long scn_addr)
787ha_new_range: 776ha_new_range:
788 start = read_n_cells(n_mem_addr_cells, &memcell_buf); 777 start = read_n_cells(n_mem_addr_cells, &memcell_buf);
789 size = read_n_cells(n_mem_size_cells, &memcell_buf); 778 size = read_n_cells(n_mem_size_cells, &memcell_buf);
790 numa_domain = of_node_numa_domain(memory); 779 nid = of_node_to_nid(memory);
791 780
792 /* Domains not present at boot default to 0 */ 781 /* Domains not present at boot default to 0 */
793 if (!node_online(numa_domain)) 782 if (nid < 0 || !node_online(nid))
794 numa_domain = any_online_node(NODE_MASK_ALL); 783 nid = default_nid;
795 784
796 if ((scn_addr >= start) && (scn_addr < (start + size))) { 785 if ((scn_addr >= start) && (scn_addr < (start + size))) {
797 of_node_put(memory); 786 of_node_put(memory);
798 goto got_numa_domain; 787 goto got_nid;
799 } 788 }
800 789
801 if (--ranges) /* process all ranges in cell */ 790 if (--ranges) /* process all ranges in cell */
802 goto ha_new_range; 791 goto ha_new_range;
803 } 792 }
804 BUG(); /* section address should be found above */ 793 BUG(); /* section address should be found above */
794 return 0;
805 795
806 /* Temporary code to ensure that returned node is not empty */ 796 /* Temporary code to ensure that returned node is not empty */
807got_numa_domain: 797got_nid:
808 nodes_setall(nodes); 798 nodes_setall(nodes);
809 while (NODE_DATA(numa_domain)->node_spanned_pages == 0) { 799 while (NODE_DATA(nid)->node_spanned_pages == 0) {
810 node_clear(numa_domain, nodes); 800 node_clear(nid, nodes);
811 numa_domain = any_online_node(nodes); 801 nid = any_online_node(nodes);
812 } 802 }
813 return numa_domain; 803 return nid;
814} 804}
815#endif /* CONFIG_MEMORY_HOTPLUG */ 805#endif /* CONFIG_MEMORY_HOTPLUG */
diff --git a/arch/powerpc/mm/pgtable_32.c b/arch/powerpc/mm/pgtable_32.c
index f4e5ac122615..90628601fac7 100644
--- a/arch/powerpc/mm/pgtable_32.c
+++ b/arch/powerpc/mm/pgtable_32.c
@@ -37,6 +37,7 @@
37 37
38unsigned long ioremap_base; 38unsigned long ioremap_base;
39unsigned long ioremap_bot; 39unsigned long ioremap_bot;
40EXPORT_SYMBOL(ioremap_bot); /* aka VMALLOC_END */
40int io_bat_index; 41int io_bat_index;
41 42
42#if defined(CONFIG_6xx) || defined(CONFIG_POWER3) 43#if defined(CONFIG_6xx) || defined(CONFIG_POWER3)
@@ -153,6 +154,7 @@ ioremap64(unsigned long long addr, unsigned long size)
153{ 154{
154 return __ioremap(addr, size, _PAGE_NO_CACHE); 155 return __ioremap(addr, size, _PAGE_NO_CACHE);
155} 156}
157EXPORT_SYMBOL(ioremap64);
156 158
157void __iomem * 159void __iomem *
158ioremap(phys_addr_t addr, unsigned long size) 160ioremap(phys_addr_t addr, unsigned long size)
@@ -162,6 +164,7 @@ ioremap(phys_addr_t addr, unsigned long size)
162 return ioremap64(addr64, size); 164 return ioremap64(addr64, size);
163} 165}
164#endif /* CONFIG_PHYS_64BIT */ 166#endif /* CONFIG_PHYS_64BIT */
167EXPORT_SYMBOL(ioremap);
165 168
166void __iomem * 169void __iomem *
167__ioremap(phys_addr_t addr, unsigned long size, unsigned long flags) 170__ioremap(phys_addr_t addr, unsigned long size, unsigned long flags)
@@ -247,6 +250,7 @@ __ioremap(phys_addr_t addr, unsigned long size, unsigned long flags)
247out: 250out:
248 return (void __iomem *) (v + ((unsigned long)addr & ~PAGE_MASK)); 251 return (void __iomem *) (v + ((unsigned long)addr & ~PAGE_MASK));
249} 252}
253EXPORT_SYMBOL(__ioremap);
250 254
251void iounmap(volatile void __iomem *addr) 255void iounmap(volatile void __iomem *addr)
252{ 256{
@@ -259,6 +263,7 @@ void iounmap(volatile void __iomem *addr)
259 if (addr > high_memory && (unsigned long) addr < ioremap_bot) 263 if (addr > high_memory && (unsigned long) addr < ioremap_bot)
260 vunmap((void *) (PAGE_MASK & (unsigned long)addr)); 264 vunmap((void *) (PAGE_MASK & (unsigned long)addr));
261} 265}
266EXPORT_SYMBOL(iounmap);
262 267
263void __iomem *ioport_map(unsigned long port, unsigned int len) 268void __iomem *ioport_map(unsigned long port, unsigned int len)
264{ 269{
@@ -367,7 +372,7 @@ void __init io_block_mapping(unsigned long virt, phys_addr_t phys,
367 * the PTE pointer is unmodified if PTE is not found. 372 * the PTE pointer is unmodified if PTE is not found.
368 */ 373 */
369int 374int
370get_pteptr(struct mm_struct *mm, unsigned long addr, pte_t **ptep) 375get_pteptr(struct mm_struct *mm, unsigned long addr, pte_t **ptep, pmd_t **pmdp)
371{ 376{
372 pgd_t *pgd; 377 pgd_t *pgd;
373 pmd_t *pmd; 378 pmd_t *pmd;
@@ -382,6 +387,8 @@ get_pteptr(struct mm_struct *mm, unsigned long addr, pte_t **ptep)
382 if (pte) { 387 if (pte) {
383 retval = 1; 388 retval = 1;
384 *ptep = pte; 389 *ptep = pte;
390 if (pmdp)
391 *pmdp = pmd;
385 /* XXX caller needs to do pte_unmap, yuck */ 392 /* XXX caller needs to do pte_unmap, yuck */
386 } 393 }
387 } 394 }
@@ -419,7 +426,7 @@ unsigned long iopa(unsigned long addr)
419 mm = &init_mm; 426 mm = &init_mm;
420 427
421 pa = 0; 428 pa = 0;
422 if (get_pteptr(mm, addr, &pte)) { 429 if (get_pteptr(mm, addr, &pte, NULL)) {
423 pa = (pte_val(*pte) & PAGE_MASK) | (addr & ~PAGE_MASK); 430 pa = (pte_val(*pte) & PAGE_MASK) | (addr & ~PAGE_MASK);
424 pte_unmap(pte); 431 pte_unmap(pte);
425 } 432 }
diff --git a/arch/powerpc/mm/slb_low.S b/arch/powerpc/mm/slb_low.S
index d1acee38f163..abfaabf667bf 100644
--- a/arch/powerpc/mm/slb_low.S
+++ b/arch/powerpc/mm/slb_low.S
@@ -1,6 +1,4 @@
1/* 1/*
2 * arch/ppc64/mm/slb_low.S
3 *
4 * Low-level SLB routines 2 * Low-level SLB routines
5 * 3 *
6 * Copyright (C) 2004 David Gibson <dwg@au.ibm.com>, IBM 4 * Copyright (C) 2004 David Gibson <dwg@au.ibm.com>, IBM
diff --git a/arch/powerpc/mm/stab.c b/arch/powerpc/mm/stab.c
index 82e4951826bc..4a9291d9fef8 100644
--- a/arch/powerpc/mm/stab.c
+++ b/arch/powerpc/mm/stab.c
@@ -239,7 +239,7 @@ void stabs_alloc(void)
239 if (cpu_has_feature(CPU_FTR_SLB)) 239 if (cpu_has_feature(CPU_FTR_SLB))
240 return; 240 return;
241 241
242 for_each_cpu(cpu) { 242 for_each_possible_cpu(cpu) {
243 unsigned long newstab; 243 unsigned long newstab;
244 244
245 if (cpu == 0) 245 if (cpu == 0)
@@ -247,10 +247,6 @@ void stabs_alloc(void)
247 247
248 newstab = lmb_alloc_base(HW_PAGE_SIZE, HW_PAGE_SIZE, 248 newstab = lmb_alloc_base(HW_PAGE_SIZE, HW_PAGE_SIZE,
249 1<<SID_SHIFT); 249 1<<SID_SHIFT);
250 if (! newstab)
251 panic("Unable to allocate segment table for CPU %d.\n",
252 cpu);
253
254 newstab = (unsigned long)__va(newstab); 250 newstab = (unsigned long)__va(newstab);
255 251
256 memset((void *)newstab, 0, HW_PAGE_SIZE); 252 memset((void *)newstab, 0, HW_PAGE_SIZE);
diff --git a/arch/powerpc/mm/tlb_64.c b/arch/powerpc/mm/tlb_64.c
index bb3afb6e6317..f734b11566c2 100644
--- a/arch/powerpc/mm/tlb_64.c
+++ b/arch/powerpc/mm/tlb_64.c
@@ -36,7 +36,7 @@
36DEFINE_PER_CPU(struct ppc64_tlb_batch, ppc64_tlb_batch); 36DEFINE_PER_CPU(struct ppc64_tlb_batch, ppc64_tlb_batch);
37 37
38/* This is declared as we are using the more or less generic 38/* This is declared as we are using the more or less generic
39 * include/asm-ppc64/tlb.h file -- tgall 39 * include/asm-powerpc/tlb.h file -- tgall
40 */ 40 */
41DEFINE_PER_CPU(struct mmu_gather, mmu_gathers); 41DEFINE_PER_CPU(struct mmu_gather, mmu_gathers);
42DEFINE_PER_CPU(struct pte_freelist_batch *, pte_freelist_cur); 42DEFINE_PER_CPU(struct pte_freelist_batch *, pte_freelist_cur);
diff --git a/arch/powerpc/oprofile/Makefile b/arch/powerpc/oprofile/Makefile
index 554cd7c75321..f5f9859a8338 100644
--- a/arch/powerpc/oprofile/Makefile
+++ b/arch/powerpc/oprofile/Makefile
@@ -6,7 +6,7 @@ DRIVER_OBJS := $(addprefix ../../../drivers/oprofile/, \
6 oprofilefs.o oprofile_stats.o \ 6 oprofilefs.o oprofile_stats.o \
7 timer_int.o ) 7 timer_int.o )
8 8
9oprofile-y := $(DRIVER_OBJS) common.o 9oprofile-y := $(DRIVER_OBJS) common.o backtrace.o
10oprofile-$(CONFIG_PPC64) += op_model_rs64.o op_model_power4.o 10oprofile-$(CONFIG_PPC64) += op_model_rs64.o op_model_power4.o
11oprofile-$(CONFIG_FSL_BOOKE) += op_model_fsl_booke.o 11oprofile-$(CONFIG_FSL_BOOKE) += op_model_fsl_booke.o
12oprofile-$(CONFIG_PPC32) += op_model_7450.o 12oprofile-$(CONFIG_PPC32) += op_model_7450.o
diff --git a/arch/powerpc/oprofile/backtrace.c b/arch/powerpc/oprofile/backtrace.c
new file mode 100644
index 000000000000..75f57bc96b40
--- /dev/null
+++ b/arch/powerpc/oprofile/backtrace.c
@@ -0,0 +1,126 @@
1/**
2 * Copyright (C) 2005 Brian Rogan <bcr6@cornell.edu>, IBM
3 *
4 * This program is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU General Public License
6 * as published by the Free Software Foundation; either version
7 * 2 of the License, or (at your option) any later version.
8**/
9
10#include <linux/oprofile.h>
11#include <linux/sched.h>
12#include <asm/processor.h>
13#include <asm/uaccess.h>
14
15#define STACK_SP(STACK) *(STACK)
16
17#define STACK_LR64(STACK) *((unsigned long *)(STACK) + 2)
18#define STACK_LR32(STACK) *((unsigned int *)(STACK) + 1)
19
20#ifdef CONFIG_PPC64
21#define STACK_LR(STACK) STACK_LR64(STACK)
22#else
23#define STACK_LR(STACK) STACK_LR32(STACK)
24#endif
25
26static unsigned int user_getsp32(unsigned int sp, int is_first)
27{
28 unsigned int stack_frame[2];
29
30 if (!access_ok(VERIFY_READ, sp, sizeof(stack_frame)))
31 return 0;
32
33 /*
34 * The most likely reason for this is that we returned -EFAULT,
35 * which means that we've done all that we can do from
36 * interrupt context.
37 */
38 if (__copy_from_user_inatomic(stack_frame, (void *)(long)sp,
39 sizeof(stack_frame)))
40 return 0;
41
42 if (!is_first)
43 oprofile_add_trace(STACK_LR32(stack_frame));
44
45 /*
46 * We do not enforce increasing stack addresses here because
47 * we may transition to a different stack, eg a signal handler.
48 */
49 return STACK_SP(stack_frame);
50}
51
52#ifdef CONFIG_PPC64
53static unsigned long user_getsp64(unsigned long sp, int is_first)
54{
55 unsigned long stack_frame[3];
56
57 if (!access_ok(VERIFY_READ, sp, sizeof(stack_frame)))
58 return 0;
59
60 if (__copy_from_user_inatomic(stack_frame, (void *)sp,
61 sizeof(stack_frame)))
62 return 0;
63
64 if (!is_first)
65 oprofile_add_trace(STACK_LR64(stack_frame));
66
67 return STACK_SP(stack_frame);
68}
69#endif
70
71static unsigned long kernel_getsp(unsigned long sp, int is_first)
72{
73 unsigned long *stack_frame = (unsigned long *)sp;
74
75 if (!validate_sp(sp, current, STACK_FRAME_OVERHEAD))
76 return 0;
77
78 if (!is_first)
79 oprofile_add_trace(STACK_LR(stack_frame));
80
81 /*
82 * We do not enforce increasing stack addresses here because
83 * we might be transitioning from an interrupt stack to a kernel
84 * stack. validate_sp() is designed to understand this, so just
85 * use it.
86 */
87 return STACK_SP(stack_frame);
88}
89
90void op_powerpc_backtrace(struct pt_regs * const regs, unsigned int depth)
91{
92 unsigned long sp = regs->gpr[1];
93 int first_frame = 1;
94
95 /* We ditch the top stackframe so need to loop through an extra time */
96 depth += 1;
97
98 if (!user_mode(regs)) {
99 while (depth--) {
100 sp = kernel_getsp(sp, first_frame);
101 if (!sp)
102 break;
103 first_frame = 0;
104 }
105 } else {
106#ifdef CONFIG_PPC64
107 if (!test_thread_flag(TIF_32BIT)) {
108 while (depth--) {
109 sp = user_getsp64(sp, first_frame);
110 if (!sp)
111 break;
112 first_frame = 0;
113 }
114
115 return;
116 }
117#endif
118
119 while (depth--) {
120 sp = user_getsp32(sp, first_frame);
121 if (!sp)
122 break;
123 first_frame = 0;
124 }
125 }
126}
diff --git a/arch/powerpc/oprofile/common.c b/arch/powerpc/oprofile/common.c
index cc2535be3a73..5b1de7e8041e 100644
--- a/arch/powerpc/oprofile/common.c
+++ b/arch/powerpc/oprofile/common.c
@@ -117,18 +117,10 @@ static int op_powerpc_create_files(struct super_block *sb, struct dentry *root)
117 117
118 oprofilefs_create_ulong(sb, root, "enable_kernel", &sys.enable_kernel); 118 oprofilefs_create_ulong(sb, root, "enable_kernel", &sys.enable_kernel);
119 oprofilefs_create_ulong(sb, root, "enable_user", &sys.enable_user); 119 oprofilefs_create_ulong(sb, root, "enable_user", &sys.enable_user);
120#ifdef CONFIG_PPC64
121 oprofilefs_create_ulong(sb, root, "backtrace_spinlocks",
122 &sys.backtrace_spinlocks);
123#endif
124 120
125 /* Default to tracing both kernel and user */ 121 /* Default to tracing both kernel and user */
126 sys.enable_kernel = 1; 122 sys.enable_kernel = 1;
127 sys.enable_user = 1; 123 sys.enable_user = 1;
128#ifdef CONFIG_PPC64
129 /* Turn on backtracing through spinlocks by default */
130 sys.backtrace_spinlocks = 1;
131#endif
132 124
133 return 0; 125 return 0;
134} 126}
@@ -168,6 +160,7 @@ int __init oprofile_arch_init(struct oprofile_operations *ops)
168 ops->shutdown = op_powerpc_shutdown; 160 ops->shutdown = op_powerpc_shutdown;
169 ops->start = op_powerpc_start; 161 ops->start = op_powerpc_start;
170 ops->stop = op_powerpc_stop; 162 ops->stop = op_powerpc_stop;
163 ops->backtrace = op_powerpc_backtrace;
171 164
172 printk(KERN_INFO "oprofile: using %s performance monitoring.\n", 165 printk(KERN_INFO "oprofile: using %s performance monitoring.\n",
173 ops->cpu_type); 166 ops->cpu_type);
diff --git a/arch/powerpc/oprofile/op_model_7450.c b/arch/powerpc/oprofile/op_model_7450.c
index 32abfdbb0eb1..e0491c3c71f1 100644
--- a/arch/powerpc/oprofile/op_model_7450.c
+++ b/arch/powerpc/oprofile/op_model_7450.c
@@ -176,13 +176,13 @@ static void fsl7450_handle_interrupt(struct pt_regs *regs,
176 mtmsr(mfmsr() | MSR_PMM); 176 mtmsr(mfmsr() | MSR_PMM);
177 177
178 pc = mfspr(SPRN_SIAR); 178 pc = mfspr(SPRN_SIAR);
179 is_kernel = (pc >= KERNELBASE); 179 is_kernel = is_kernel_addr(pc);
180 180
181 for (i = 0; i < NUM_CTRS; ++i) { 181 for (i = 0; i < NUM_CTRS; ++i) {
182 val = ctr_read(i); 182 val = ctr_read(i);
183 if (val < 0) { 183 if (val < 0) {
184 if (oprofile_running && ctr[i].enabled) { 184 if (oprofile_running && ctr[i].enabled) {
185 oprofile_add_pc(pc, is_kernel, i); 185 oprofile_add_ext_sample(pc, regs, i, is_kernel);
186 ctr_write(i, reset_value[i]); 186 ctr_write(i, reset_value[i]);
187 } else { 187 } else {
188 ctr_write(i, 0); 188 ctr_write(i, 0);
diff --git a/arch/powerpc/oprofile/op_model_fsl_booke.c b/arch/powerpc/oprofile/op_model_fsl_booke.c
index 26539cda6023..93d63e62662f 100644
--- a/arch/powerpc/oprofile/op_model_fsl_booke.c
+++ b/arch/powerpc/oprofile/op_model_fsl_booke.c
@@ -154,13 +154,13 @@ static void fsl_booke_handle_interrupt(struct pt_regs *regs,
154 mtmsr(mfmsr() | MSR_PMM); 154 mtmsr(mfmsr() | MSR_PMM);
155 155
156 pc = regs->nip; 156 pc = regs->nip;
157 is_kernel = (pc >= KERNELBASE); 157 is_kernel = is_kernel_addr(pc);
158 158
159 for (i = 0; i < num_counters; ++i) { 159 for (i = 0; i < num_counters; ++i) {
160 val = ctr_read(i); 160 val = ctr_read(i);
161 if (val < 0) { 161 if (val < 0) {
162 if (oprofile_running && ctr[i].enabled) { 162 if (oprofile_running && ctr[i].enabled) {
163 oprofile_add_pc(pc, is_kernel, i); 163 oprofile_add_ext_sample(pc, regs, i, is_kernel);
164 ctr_write(i, reset_value[i]); 164 ctr_write(i, reset_value[i]);
165 } else { 165 } else {
166 ctr_write(i, 0); 166 ctr_write(i, 0);
diff --git a/arch/powerpc/oprofile/op_model_power4.c b/arch/powerpc/oprofile/op_model_power4.c
index 659a021da0c7..4c2beab1fdc1 100644
--- a/arch/powerpc/oprofile/op_model_power4.c
+++ b/arch/powerpc/oprofile/op_model_power4.c
@@ -10,6 +10,7 @@
10#include <linux/oprofile.h> 10#include <linux/oprofile.h>
11#include <linux/init.h> 11#include <linux/init.h>
12#include <linux/smp.h> 12#include <linux/smp.h>
13#include <asm/firmware.h>
13#include <asm/ptrace.h> 14#include <asm/ptrace.h>
14#include <asm/system.h> 15#include <asm/system.h>
15#include <asm/processor.h> 16#include <asm/processor.h>
@@ -24,18 +25,14 @@ static unsigned long reset_value[OP_MAX_COUNTER];
24 25
25static int oprofile_running; 26static int oprofile_running;
26static int mmcra_has_sihv; 27static int mmcra_has_sihv;
28/* Unfortunately these bits vary between CPUs */
29static unsigned long mmcra_sihv = MMCRA_SIHV;
30static unsigned long mmcra_sipr = MMCRA_SIPR;
27 31
28/* mmcr values are set in power4_reg_setup, used in power4_cpu_setup */ 32/* mmcr values are set in power4_reg_setup, used in power4_cpu_setup */
29static u32 mmcr0_val; 33static u32 mmcr0_val;
30static u64 mmcr1_val; 34static u64 mmcr1_val;
31static u32 mmcra_val; 35static u64 mmcra_val;
32
33/*
34 * Since we do not have an NMI, backtracing through spinlocks is
35 * only a best guess. In light of this, allow it to be disabled at
36 * runtime.
37 */
38static int backtrace_spinlocks;
39 36
40static void power4_reg_setup(struct op_counter_config *ctr, 37static void power4_reg_setup(struct op_counter_config *ctr,
41 struct op_system_config *sys, 38 struct op_system_config *sys,
@@ -62,8 +59,6 @@ static void power4_reg_setup(struct op_counter_config *ctr,
62 mmcr1_val = sys->mmcr1; 59 mmcr1_val = sys->mmcr1;
63 mmcra_val = sys->mmcra; 60 mmcra_val = sys->mmcra;
64 61
65 backtrace_spinlocks = sys->backtrace_spinlocks;
66
67 for (i = 0; i < cur_cpu_spec->num_pmcs; ++i) 62 for (i = 0; i < cur_cpu_spec->num_pmcs; ++i)
68 reset_value[i] = 0x80000000UL - ctr[i].count; 63 reset_value[i] = 0x80000000UL - ctr[i].count;
69 64
@@ -196,25 +191,6 @@ static void __attribute_used__ kernel_unknown_bucket(void)
196{ 191{
197} 192}
198 193
199static unsigned long check_spinlock_pc(struct pt_regs *regs,
200 unsigned long profile_pc)
201{
202 unsigned long pc = instruction_pointer(regs);
203
204 /*
205 * If both the SIAR (sampled instruction) and the perfmon exception
206 * occurred in a spinlock region then we account the sample to the
207 * calling function. This isnt 100% correct, we really need soft
208 * IRQ disable so we always get the perfmon exception at the
209 * point at which the SIAR is set.
210 */
211 if (backtrace_spinlocks && in_lock_functions(pc) &&
212 in_lock_functions(profile_pc))
213 return regs->link;
214 else
215 return profile_pc;
216}
217
218/* 194/*
219 * On GQ and newer the MMCRA stores the HV and PR bits at the time 195 * On GQ and newer the MMCRA stores the HV and PR bits at the time
220 * the SIAR was sampled. We use that to work out if the SIAR was sampled in 196 * the SIAR was sampled. We use that to work out if the SIAR was sampled in
@@ -227,17 +203,17 @@ static unsigned long get_pc(struct pt_regs *regs)
227 203
228 /* Cant do much about it */ 204 /* Cant do much about it */
229 if (!mmcra_has_sihv) 205 if (!mmcra_has_sihv)
230 return check_spinlock_pc(regs, pc); 206 return pc;
231 207
232 mmcra = mfspr(SPRN_MMCRA); 208 mmcra = mfspr(SPRN_MMCRA);
233 209
234 /* Were we in the hypervisor? */ 210 /* Were we in the hypervisor? */
235 if (platform_is_lpar() && (mmcra & MMCRA_SIHV)) 211 if (firmware_has_feature(FW_FEATURE_LPAR) && (mmcra & mmcra_sihv))
236 /* function descriptor madness */ 212 /* function descriptor madness */
237 return *((unsigned long *)hypervisor_bucket); 213 return *((unsigned long *)hypervisor_bucket);
238 214
239 /* We were in userspace, nothing to do */ 215 /* We were in userspace, nothing to do */
240 if (mmcra & MMCRA_SIPR) 216 if (mmcra & mmcra_sipr)
241 return pc; 217 return pc;
242 218
243#ifdef CONFIG_PPC_RTAS 219#ifdef CONFIG_PPC_RTAS
@@ -256,7 +232,7 @@ static unsigned long get_pc(struct pt_regs *regs)
256 /* function descriptor madness */ 232 /* function descriptor madness */
257 return *((unsigned long *)kernel_unknown_bucket); 233 return *((unsigned long *)kernel_unknown_bucket);
258 234
259 return check_spinlock_pc(regs, pc); 235 return pc;
260} 236}
261 237
262static int get_kernel(unsigned long pc) 238static int get_kernel(unsigned long pc)
@@ -267,7 +243,7 @@ static int get_kernel(unsigned long pc)
267 is_kernel = is_kernel_addr(pc); 243 is_kernel = is_kernel_addr(pc);
268 } else { 244 } else {
269 unsigned long mmcra = mfspr(SPRN_MMCRA); 245 unsigned long mmcra = mfspr(SPRN_MMCRA);
270 is_kernel = ((mmcra & MMCRA_SIPR) == 0); 246 is_kernel = ((mmcra & mmcra_sipr) == 0);
271 } 247 }
272 248
273 return is_kernel; 249 return is_kernel;
@@ -292,7 +268,7 @@ static void power4_handle_interrupt(struct pt_regs *regs,
292 val = ctr_read(i); 268 val = ctr_read(i);
293 if (val < 0) { 269 if (val < 0) {
294 if (oprofile_running && ctr[i].enabled) { 270 if (oprofile_running && ctr[i].enabled) {
295 oprofile_add_pc(pc, is_kernel, i); 271 oprofile_add_ext_sample(pc, regs, i, is_kernel);
296 ctr_write(i, reset_value[i]); 272 ctr_write(i, reset_value[i]);
297 } else { 273 } else {
298 ctr_write(i, 0); 274 ctr_write(i, 0);
diff --git a/arch/powerpc/oprofile/op_model_rs64.c b/arch/powerpc/oprofile/op_model_rs64.c
index 5c909ee609fe..042f8f4867ad 100644
--- a/arch/powerpc/oprofile/op_model_rs64.c
+++ b/arch/powerpc/oprofile/op_model_rs64.c
@@ -175,10 +175,13 @@ static void rs64_handle_interrupt(struct pt_regs *regs,
175 struct op_counter_config *ctr) 175 struct op_counter_config *ctr)
176{ 176{
177 unsigned int mmcr0; 177 unsigned int mmcr0;
178 int is_kernel;
178 int val; 179 int val;
179 int i; 180 int i;
180 unsigned long pc = mfspr(SPRN_SIAR); 181 unsigned long pc = mfspr(SPRN_SIAR);
181 182
183 is_kernel = is_kernel_addr(pc);
184
182 /* set the PMM bit (see comment below) */ 185 /* set the PMM bit (see comment below) */
183 mtmsrd(mfmsr() | MSR_PMM); 186 mtmsrd(mfmsr() | MSR_PMM);
184 187
@@ -186,7 +189,7 @@ static void rs64_handle_interrupt(struct pt_regs *regs,
186 val = ctr_read(i); 189 val = ctr_read(i);
187 if (val < 0) { 190 if (val < 0) {
188 if (ctr[i].enabled) { 191 if (ctr[i].enabled) {
189 oprofile_add_pc(pc, is_kernel_addr(pc), i); 192 oprofile_add_ext_sample(pc, regs, i, is_kernel);
190 ctr_write(i, reset_value[i]); 193 ctr_write(i, reset_value[i]);
191 } else { 194 } else {
192 ctr_write(i, 0); 195 ctr_write(i, 0);
diff --git a/arch/powerpc/platforms/83xx/Makefile b/arch/powerpc/platforms/83xx/Makefile
index 9d8b28ef3343..5c72367441a8 100644
--- a/arch/powerpc/platforms/83xx/Makefile
+++ b/arch/powerpc/platforms/83xx/Makefile
@@ -1,4 +1,6 @@
1# 1#
2# Makefile for the PowerPC 83xx linux kernel. 2# Makefile for the PowerPC 83xx linux kernel.
3# 3#
4obj-$(CONFIG_MPC834x_SYS) += mpc834x_sys.o pci.o 4obj-y := misc.o
5obj-$(CONFIG_PCI) += pci.o
6obj-$(CONFIG_MPC834x_SYS) += mpc834x_sys.o
diff --git a/arch/powerpc/platforms/83xx/misc.c b/arch/powerpc/platforms/83xx/misc.c
new file mode 100644
index 000000000000..1455bcef4892
--- /dev/null
+++ b/arch/powerpc/platforms/83xx/misc.c
@@ -0,0 +1,55 @@
1/*
2 * misc setup functions for MPC83xx
3 *
4 * Maintainer: Kumar Gala <galak@kernel.crashing.org>
5 *
6 * This program is free software; you can redistribute it and/or modify it
7 * under the terms of the GNU General Public License as published by the
8 * Free Software Foundation; either version 2 of the License, or (at your
9 * option) any later version.
10 */
11
12#include <linux/config.h>
13#include <linux/stddef.h>
14#include <linux/kernel.h>
15
16#include <asm/io.h>
17#include <asm/hw_irq.h>
18#include <sysdev/fsl_soc.h>
19
20#include "mpc83xx.h"
21
22void mpc83xx_restart(char *cmd)
23{
24#define RST_OFFSET 0x00000900
25#define RST_PROT_REG 0x00000018
26#define RST_CTRL_REG 0x0000001c
27 __be32 __iomem *reg;
28
29 /* map reset register space */
30 reg = ioremap(get_immrbase() + 0x900, 0xff);
31
32 local_irq_disable();
33
34 /* enable software reset "RSTE" */
35 out_be32(reg + (RST_PROT_REG >> 2), 0x52535445);
36
37 /* set software hard reset */
38 out_be32(reg + (RST_CTRL_REG >> 2), 0x2);
39 for (;;) ;
40}
41
42long __init mpc83xx_time_init(void)
43{
44#define SPCR_OFFSET 0x00000110
45#define SPCR_TBEN 0x00400000
46 __be32 __iomem *spcr = ioremap(get_immrbase() + SPCR_OFFSET, 4);
47 __be32 tmp;
48
49 tmp = in_be32(spcr);
50 out_be32(spcr, tmp | SPCR_TBEN);
51
52 iounmap(spcr);
53
54 return 0;
55}
diff --git a/arch/powerpc/platforms/83xx/mpc834x_sys.c b/arch/powerpc/platforms/83xx/mpc834x_sys.c
index 2098dd05a773..7c18b4cd5db4 100644
--- a/arch/powerpc/platforms/83xx/mpc834x_sys.c
+++ b/arch/powerpc/platforms/83xx/mpc834x_sys.c
@@ -24,22 +24,15 @@
24#include <linux/delay.h> 24#include <linux/delay.h>
25#include <linux/seq_file.h> 25#include <linux/seq_file.h>
26#include <linux/root_dev.h> 26#include <linux/root_dev.h>
27#include <linux/module.h>
28#include <linux/fsl_devices.h>
29 27
30#include <asm/system.h> 28#include <asm/system.h>
31#include <asm/pgtable.h>
32#include <asm/page.h>
33#include <asm/atomic.h> 29#include <asm/atomic.h>
34#include <asm/time.h> 30#include <asm/time.h>
35#include <asm/io.h> 31#include <asm/io.h>
36#include <asm/machdep.h> 32#include <asm/machdep.h>
37#include <asm/ipic.h> 33#include <asm/ipic.h>
38#include <asm/bootinfo.h> 34#include <asm/bootinfo.h>
39#include <asm/pci-bridge.h>
40#include <asm/mpc83xx.h>
41#include <asm/irq.h> 35#include <asm/irq.h>
42#include <mm/mmu_decl.h>
43#include <asm/prom.h> 36#include <asm/prom.h>
44#include <asm/udbg.h> 37#include <asm/udbg.h>
45#include <sysdev/fsl_soc.h> 38#include <sysdev/fsl_soc.h>
@@ -52,8 +45,6 @@ unsigned long isa_mem_base = 0;
52#endif 45#endif
53 46
54#ifdef CONFIG_PCI 47#ifdef CONFIG_PCI
55extern int mpc83xx_pci2_busno;
56
57static int 48static int
58mpc83xx_map_irq(struct pci_dev *dev, unsigned char idsel, unsigned char pin) 49mpc83xx_map_irq(struct pci_dev *dev, unsigned char idsel, unsigned char pin)
59{ 50{
@@ -78,26 +69,14 @@ mpc83xx_map_irq(struct pci_dev *dev, unsigned char idsel, unsigned char pin)
78 const long min_idsel = 0x11, max_idsel = 0x20, irqs_per_slot = 4; 69 const long min_idsel = 0x11, max_idsel = 0x20, irqs_per_slot = 4;
79 return PCI_IRQ_TABLE_LOOKUP; 70 return PCI_IRQ_TABLE_LOOKUP;
80} 71}
81 72#endif /* CONFIG_PCI */
82static int
83mpc83xx_exclude_device(u_char bus, u_char devfn)
84{
85 if (bus == 0 && PCI_SLOT(devfn) == 0)
86 return PCIBIOS_DEVICE_NOT_FOUND;
87 if (mpc83xx_pci2_busno)
88 if (bus == (mpc83xx_pci2_busno) && PCI_SLOT(devfn) == 0)
89 return PCIBIOS_DEVICE_NOT_FOUND;
90 return PCIBIOS_SUCCESSFUL;
91}
92#endif /* CONFIG_PCI */
93 73
94/* ************************************************************************ 74/* ************************************************************************
95 * 75 *
96 * Setup the architecture 76 * Setup the architecture
97 * 77 *
98 */ 78 */
99static void __init 79static void __init mpc834x_sys_setup_arch(void)
100mpc834x_sys_setup_arch(void)
101{ 80{
102 struct device_node *np; 81 struct device_node *np;
103 82
@@ -106,14 +85,14 @@ mpc834x_sys_setup_arch(void)
106 85
107 np = of_find_node_by_type(NULL, "cpu"); 86 np = of_find_node_by_type(NULL, "cpu");
108 if (np != 0) { 87 if (np != 0) {
109 unsigned int *fp = (int *) get_property(np, "clock-frequency", NULL); 88 unsigned int *fp =
89 (int *)get_property(np, "clock-frequency", NULL);
110 if (fp != 0) 90 if (fp != 0)
111 loops_per_jiffy = *fp / HZ; 91 loops_per_jiffy = *fp / HZ;
112 else 92 else
113 loops_per_jiffy = 50000000 / HZ; 93 loops_per_jiffy = 50000000 / HZ;
114 of_node_put(np); 94 of_node_put(np);
115 } 95 }
116
117#ifdef CONFIG_PCI 96#ifdef CONFIG_PCI
118 for (np = NULL; (np = of_find_node_by_type(np, "pci")) != NULL;) 97 for (np = NULL; (np = of_find_node_by_type(np, "pci")) != NULL;)
119 add_bridge(np); 98 add_bridge(np);
@@ -124,14 +103,13 @@ mpc834x_sys_setup_arch(void)
124#endif 103#endif
125 104
126#ifdef CONFIG_ROOT_NFS 105#ifdef CONFIG_ROOT_NFS
127 ROOT_DEV = Root_NFS; 106 ROOT_DEV = Root_NFS;
128#else 107#else
129 ROOT_DEV = Root_HDA1; 108 ROOT_DEV = Root_HDA1;
130#endif 109#endif
131} 110}
132 111
133void __init 112void __init mpc834x_sys_init_IRQ(void)
134mpc834x_sys_init_IRQ(void)
135{ 113{
136 u8 senses[8] = { 114 u8 senses[8] = {
137 0, /* EXT 0 */ 115 0, /* EXT 0 */
@@ -160,64 +138,27 @@ mpc834x_sys_init_IRQ(void)
160} 138}
161 139
162#if defined(CONFIG_I2C_MPC) && defined(CONFIG_SENSORS_DS1374) 140#if defined(CONFIG_I2C_MPC) && defined(CONFIG_SENSORS_DS1374)
163extern ulong ds1374_get_rtc_time(void); 141extern ulong ds1374_get_rtc_time(void);
164extern int ds1374_set_rtc_time(ulong); 142extern int ds1374_set_rtc_time(ulong);
165 143
166static int __init 144static int __init mpc834x_rtc_hookup(void)
167mpc834x_rtc_hookup(void)
168{ 145{
169 struct timespec tv; 146 struct timespec tv;
170 147
171 ppc_md.get_rtc_time = ds1374_get_rtc_time; 148 ppc_md.get_rtc_time = ds1374_get_rtc_time;
172 ppc_md.set_rtc_time = ds1374_set_rtc_time; 149 ppc_md.set_rtc_time = ds1374_set_rtc_time;
173 150
174 tv.tv_nsec = 0; 151 tv.tv_nsec = 0;
175 tv.tv_sec = (ppc_md.get_rtc_time)(); 152 tv.tv_sec = (ppc_md.get_rtc_time) ();
176 do_settimeofday(&tv); 153 do_settimeofday(&tv);
177 154
178 return 0; 155 return 0;
179} 156}
157
180late_initcall(mpc834x_rtc_hookup); 158late_initcall(mpc834x_rtc_hookup);
181#endif 159#endif
182 160
183static void 161void __init platform_init(void)
184mpc83xx_restart(char *cmd)
185{
186#define RST_OFFSET 0x00000900
187#define RST_PROT_REG 0x00000018
188#define RST_CTRL_REG 0x0000001c
189 __be32 __iomem *reg;
190
191 // map reset register space
192 reg = ioremap(get_immrbase() + 0x900, 0xff);
193
194 local_irq_disable();
195
196 /* enable software reset "RSTE" */
197 out_be32(reg + (RST_PROT_REG >> 2), 0x52535445);
198
199 /* set software hard reset */
200 out_be32(reg + (RST_CTRL_REG >> 2), 0x52535445);
201 for(;;);
202}
203
204static long __init
205mpc83xx_time_init(void)
206{
207#define SPCR_OFFSET 0x00000110
208#define SPCR_TBEN 0x00400000
209 __be32 __iomem *spcr = ioremap(get_immrbase() + SPCR_OFFSET, 4);
210 __be32 tmp;
211
212 tmp = in_be32(spcr);
213 out_be32(spcr, tmp|SPCR_TBEN);
214
215 iounmap(spcr);
216
217 return 0;
218}
219void __init
220platform_init(void)
221{ 162{
222 /* setup the PowerPC module struct */ 163 /* setup the PowerPC module struct */
223 ppc_md.setup_arch = mpc834x_sys_setup_arch; 164 ppc_md.setup_arch = mpc834x_sys_setup_arch;
@@ -239,5 +180,3 @@ platform_init(void)
239 180
240 return; 181 return;
241} 182}
242
243
diff --git a/arch/powerpc/platforms/83xx/mpc834x_sys.h b/arch/powerpc/platforms/83xx/mpc834x_sys.h
index e4ca39f6a862..fedecb73f7ff 100644
--- a/arch/powerpc/platforms/83xx/mpc834x_sys.h
+++ b/arch/powerpc/platforms/83xx/mpc834x_sys.h
@@ -20,4 +20,4 @@
20#define PIRQC MPC83xx_IRQ_EXT6 20#define PIRQC MPC83xx_IRQ_EXT6
21#define PIRQD MPC83xx_IRQ_EXT7 21#define PIRQD MPC83xx_IRQ_EXT7
22 22
23#endif /* __MACH_MPC83XX_SYS_H__ */ 23#endif /* __MACH_MPC83XX_SYS_H__ */
diff --git a/arch/powerpc/platforms/83xx/mpc83xx.h b/arch/powerpc/platforms/83xx/mpc83xx.h
index ce9e66abef24..01cae106912b 100644
--- a/arch/powerpc/platforms/83xx/mpc83xx.h
+++ b/arch/powerpc/platforms/83xx/mpc83xx.h
@@ -10,5 +10,8 @@
10 */ 10 */
11 11
12extern int add_bridge(struct device_node *dev); 12extern int add_bridge(struct device_node *dev);
13extern int mpc83xx_exclude_device(u_char bus, u_char devfn);
14extern void mpc83xx_restart(char *cmd);
15extern long mpc83xx_time_init(void);
13 16
14#endif /* __MPC83XX_H__ */ 17#endif /* __MPC83XX_H__ */
diff --git a/arch/powerpc/platforms/83xx/pci.c b/arch/powerpc/platforms/83xx/pci.c
index 469cdacc5bd4..16f7d3b30e1d 100644
--- a/arch/powerpc/platforms/83xx/pci.c
+++ b/arch/powerpc/platforms/83xx/pci.c
@@ -36,7 +36,16 @@
36 36
37int mpc83xx_pci2_busno; 37int mpc83xx_pci2_busno;
38 38
39#ifdef CONFIG_PCI 39int mpc83xx_exclude_device(u_char bus, u_char devfn)
40{
41 if (bus == 0 && PCI_SLOT(devfn) == 0)
42 return PCIBIOS_DEVICE_NOT_FOUND;
43 if (mpc83xx_pci2_busno)
44 if (bus == (mpc83xx_pci2_busno) && PCI_SLOT(devfn) == 0)
45 return PCIBIOS_DEVICE_NOT_FOUND;
46 return PCIBIOS_SUCCESSFUL;
47}
48
40int __init add_bridge(struct device_node *dev) 49int __init add_bridge(struct device_node *dev)
41{ 50{
42 int len; 51 int len;
@@ -52,7 +61,7 @@ int __init add_bridge(struct device_node *dev)
52 has_address = (of_address_to_resource(dev, 0, &rsrc) == 0); 61 has_address = (of_address_to_resource(dev, 0, &rsrc) == 0);
53 62
54 /* Get bus range if any */ 63 /* Get bus range if any */
55 bus_range = (int *) get_property(dev, "bus-range", &len); 64 bus_range = (int *)get_property(dev, "bus-range", &len);
56 if (bus_range == NULL || len < 2 * sizeof(int)) { 65 if (bus_range == NULL || len < 2 * sizeof(int)) {
57 printk(KERN_WARNING "Can't get bus-range for %s, assume" 66 printk(KERN_WARNING "Can't get bus-range for %s, assume"
58 " bus 0\n", dev->full_name); 67 " bus 0\n", dev->full_name);
@@ -74,7 +83,7 @@ int __init add_bridge(struct device_node *dev)
74 if ((rsrc.start & 0xfffff) == 0x8500) { 83 if ((rsrc.start & 0xfffff) == 0x8500) {
75 setup_indirect_pci(hose, immr + 0x8300, immr + 0x8304); 84 setup_indirect_pci(hose, immr + 0x8300, immr + 0x8304);
76 } 85 }
77 /* PCI 2*/ 86 /* PCI 2 */
78 if ((rsrc.start & 0xfffff) == 0x8600) { 87 if ((rsrc.start & 0xfffff) == 0x8600) {
79 setup_indirect_pci(hose, immr + 0x8380, immr + 0x8384); 88 setup_indirect_pci(hose, immr + 0x8380, immr + 0x8384);
80 primary = 0; 89 primary = 0;
@@ -84,10 +93,10 @@ int __init add_bridge(struct device_node *dev)
84 93
85 printk(KERN_INFO "Found MPC83xx PCI host bridge at 0x%08lx. " 94 printk(KERN_INFO "Found MPC83xx PCI host bridge at 0x%08lx. "
86 "Firmware bus number: %d->%d\n", 95 "Firmware bus number: %d->%d\n",
87 rsrc.start, hose->first_busno, hose->last_busno); 96 rsrc.start, hose->first_busno, hose->last_busno);
88 97
89 DBG(" ->Hose at 0x%p, cfg_addr=0x%p,cfg_data=0x%p\n", 98 DBG(" ->Hose at 0x%p, cfg_addr=0x%p,cfg_data=0x%p\n",
90 hose, hose->cfg_addr, hose->cfg_data); 99 hose, hose->cfg_addr, hose->cfg_data);
91 100
92 /* Interpret the "ranges" property */ 101 /* Interpret the "ranges" property */
93 /* This also maps the I/O region and sets isa_io/mem_base */ 102 /* This also maps the I/O region and sets isa_io/mem_base */
@@ -95,5 +104,3 @@ int __init add_bridge(struct device_node *dev)
95 104
96 return 0; 105 return 0;
97} 106}
98
99#endif
diff --git a/arch/powerpc/platforms/85xx/Kconfig b/arch/powerpc/platforms/85xx/Kconfig
index c5bc2821d991..06e371282f57 100644
--- a/arch/powerpc/platforms/85xx/Kconfig
+++ b/arch/powerpc/platforms/85xx/Kconfig
@@ -1,86 +1,31 @@
1config 85xx 1menu "Platform support"
2 bool 2 depends on PPC_85xx
3 depends on E500
4 default y
5
6config PPC_INDIRECT_PCI_BE
7 bool
8 depends on 85xx
9 default y
10
11menu "Freescale 85xx options"
12 depends on E500
13 3
14choice 4choice
15 prompt "Machine Type" 5 prompt "Machine Type"
16 depends on 85xx
17 default MPC8540_ADS 6 default MPC8540_ADS
18 7
19config MPC8540_ADS 8config MPC8540_ADS
20 bool "Freescale MPC8540 ADS" 9 bool "Freescale MPC8540 ADS"
10 select DEFAULT_UIMAGE
21 help 11 help
22 This option enables support for the MPC 8540 ADS evaluation board. 12 This option enables support for the MPC 8540 ADS board
23
24config MPC8548_CDS
25 bool "Freescale MPC8548 CDS"
26 help
27 This option enablese support for the MPC8548 CDS evaluation board.
28
29config MPC8555_CDS
30 bool "Freescale MPC8555 CDS"
31 help
32 This option enablese support for the MPC8555 CDS evaluation board.
33
34config MPC8560_ADS
35 bool "Freescale MPC8560 ADS"
36 help
37 This option enables support for the MPC 8560 ADS evaluation board.
38
39config SBC8560
40 bool "WindRiver PowerQUICC III SBC8560"
41 help
42 This option enables support for the WindRiver PowerQUICC III
43 SBC8560 board.
44
45config STX_GP3
46 bool "Silicon Turnkey Express GP3"
47 help
48 This option enables support for the Silicon Turnkey Express GP3
49 board.
50 13
51endchoice 14endchoice
52 15
53# It's often necessary to know the specific 85xx processor type.
54# Fortunately, it is implied (so far) from the board type, so we
55# don't need to ask more redundant questions.
56config MPC8540 16config MPC8540
57 bool 17 bool
58 depends on MPC8540_ADS 18 select PPC_UDBG_16550
59 default y 19 select PPC_INDIRECT_PCI
60 20 default y if MPC8540_ADS
61config MPC8548
62 bool
63 depends on MPC8548_CDS
64 default y
65 21
66config MPC8555 22config PPC_INDIRECT_PCI_BE
67 bool
68 depends on MPC8555_CDS
69 default y
70
71config MPC8560
72 bool 23 bool
73 depends on SBC8560 || MPC8560_ADS || STX_GP3 24 depends on PPC_85xx
74 default y
75
76config 85xx_PCI2
77 bool "Supprt for 2nd PCI host controller"
78 depends on MPC8555_CDS
79 default y 25 default y
80 26
81config PPC_GEN550 27config MPIC
82 bool 28 bool
83 depends on MPC8540 || SBC8560 || MPC8555
84 default y 29 default y
85 30
86endmenu 31endmenu
diff --git a/arch/powerpc/platforms/85xx/Makefile b/arch/powerpc/platforms/85xx/Makefile
index 6407197ffd89..ffc4139cb214 100644
--- a/arch/powerpc/platforms/85xx/Makefile
+++ b/arch/powerpc/platforms/85xx/Makefile
@@ -1 +1,5 @@
1# empty makefile so make clean works 1#
2# Makefile for the PowerPC 85xx linux kernel.
3#
4obj-$(CONFIG_PPC_85xx) += misc.o pci.o
5obj-$(CONFIG_MPC8540_ADS) += mpc85xx_ads.o
diff --git a/arch/powerpc/platforms/85xx/misc.c b/arch/powerpc/platforms/85xx/misc.c
new file mode 100644
index 000000000000..26c5e822c7c8
--- /dev/null
+++ b/arch/powerpc/platforms/85xx/misc.c
@@ -0,0 +1,31 @@
1/*
2 * MPC85xx generic code.
3 *
4 * Maintained by Kumar Gala (see MAINTAINERS for contact information)
5 *
6 * Copyright 2005 Freescale Semiconductor Inc.
7 *
8 * This program is free software; you can redistribute it and/or modify it
9 * under the terms of the GNU General Public License as published by the
10 * Free Software Foundation; either version 2 of the License, or (at your
11 * option) any later version.
12 */
13#include <linux/irq.h>
14#include <linux/module.h>
15#include <asm/irq.h>
16
17extern void abort(void);
18
19void mpc85xx_restart(char *cmd)
20{
21 local_irq_disable();
22 abort();
23}
24
25/* For now this is a pass through */
26phys_addr_t fixup_bigphys_addr(phys_addr_t addr, phys_addr_t size)
27{
28 return addr;
29};
30
31EXPORT_SYMBOL(fixup_bigphys_addr);
diff --git a/arch/powerpc/platforms/85xx/mpc8540_ads.h b/arch/powerpc/platforms/85xx/mpc8540_ads.h
new file mode 100644
index 000000000000..f770cadb2080
--- /dev/null
+++ b/arch/powerpc/platforms/85xx/mpc8540_ads.h
@@ -0,0 +1,36 @@
1/*
2 * arch/ppc/platforms/85xx/mpc8540_ads.h
3 *
4 * MPC8540ADS board definitions
5 *
6 * Maintainer: Kumar Gala <kumar.gala@freescale.com>
7 *
8 * Copyright 2004 Freescale Semiconductor Inc.
9 *
10 * This program is free software; you can redistribute it and/or modify it
11 * under the terms of the GNU General Public License as published by the
12 * Free Software Foundation; either version 2 of the License, or (at your
13 * option) any later version.
14 *
15 */
16
17#ifndef __MACH_MPC8540ADS_H__
18#define __MACH_MPC8540ADS_H__
19
20#include <linux/config.h>
21#include <linux/initrd.h>
22
23#define BOARD_CCSRBAR ((uint)0xe0000000)
24#define BCSR_ADDR ((uint)0xf8000000)
25#define BCSR_SIZE ((uint)(32 * 1024))
26
27/* PCI interrupt controller */
28#define PIRQA MPC85xx_IRQ_EXT1
29#define PIRQB MPC85xx_IRQ_EXT2
30#define PIRQC MPC85xx_IRQ_EXT3
31#define PIRQD MPC85xx_IRQ_EXT4
32
33/* Offset of CPM register space */
34#define CPM_MAP_ADDR (CCSRBAR + MPC85xx_CPM_OFFSET)
35
36#endif /* __MACH_MPC8540ADS_H__ */
diff --git a/arch/powerpc/platforms/85xx/mpc85xx.h b/arch/powerpc/platforms/85xx/mpc85xx.h
new file mode 100644
index 000000000000..b44db6268f3d
--- /dev/null
+++ b/arch/powerpc/platforms/85xx/mpc85xx.h
@@ -0,0 +1,18 @@
1/*
2 * arch/ppc/platforms/85xx/mpc85xx.h
3 *
4 * MPC85xx soc definitions/function decls
5 *
6 * Maintainer: Kumar Gala <kumar.gala@freescale.com>
7 *
8 * Copyright 2005 Freescale Semiconductor Inc.
9 *
10 * This program is free software; you can redistribute it and/or modify it
11 * under the terms of the GNU General Public License as published by the
12 * Free Software Foundation; either version 2 of the License, or (at your
13 * option) any later version.
14 *
15 */
16
17extern void mpc85xx_restart(char *);
18extern int add_bridge(struct device_node *dev);
diff --git a/arch/powerpc/platforms/85xx/mpc85xx_ads.c b/arch/powerpc/platforms/85xx/mpc85xx_ads.c
new file mode 100644
index 000000000000..b7821dbae00d
--- /dev/null
+++ b/arch/powerpc/platforms/85xx/mpc85xx_ads.c
@@ -0,0 +1,244 @@
1/*
2 * MPC85xx setup and early boot code plus other random bits.
3 *
4 * Maintained by Kumar Gala (see MAINTAINERS for contact information)
5 *
6 * Copyright 2005 Freescale Semiconductor Inc.
7 *
8 * This program is free software; you can redistribute it and/or modify it
9 * under the terms of the GNU General Public License as published by the
10 * Free Software Foundation; either version 2 of the License, or (at your
11 * option) any later version.
12 */
13
14#include <linux/config.h>
15#include <linux/stddef.h>
16#include <linux/kernel.h>
17#include <linux/pci.h>
18#include <linux/kdev_t.h>
19#include <linux/delay.h>
20#include <linux/seq_file.h>
21#include <linux/root_dev.h>
22
23#include <asm/system.h>
24#include <asm/time.h>
25#include <asm/machdep.h>
26#include <asm/pci-bridge.h>
27#include <asm/mpc85xx.h>
28#include <asm/prom.h>
29#include <asm/mpic.h>
30#include <mm/mmu_decl.h>
31#include <asm/udbg.h>
32
33#include <sysdev/fsl_soc.h>
34#include "mpc85xx.h"
35
36#ifndef CONFIG_PCI
37unsigned long isa_io_base = 0;
38unsigned long isa_mem_base = 0;
39#endif
40
41/*
42 * Internal interrupts are all Level Sensitive, and Positive Polarity
43 *
44 * Note: Likely, this table and the following function should be
45 * obtained and derived from the OF Device Tree.
46 */
47static u_char mpc85xx_ads_openpic_initsenses[] __initdata = {
48 MPC85XX_INTERNAL_IRQ_SENSES,
49 0x0, /* External 0: */
50#if defined(CONFIG_PCI)
51 (IRQ_SENSE_LEVEL | IRQ_POLARITY_NEGATIVE), /* Ext 1: PCI slot 0 */
52 (IRQ_SENSE_LEVEL | IRQ_POLARITY_NEGATIVE), /* Ext 2: PCI slot 1 */
53 (IRQ_SENSE_LEVEL | IRQ_POLARITY_NEGATIVE), /* Ext 3: PCI slot 2 */
54 (IRQ_SENSE_LEVEL | IRQ_POLARITY_NEGATIVE), /* Ext 4: PCI slot 3 */
55#else
56 0x0, /* External 1: */
57 0x0, /* External 2: */
58 0x0, /* External 3: */
59 0x0, /* External 4: */
60#endif
61 (IRQ_SENSE_LEVEL | IRQ_POLARITY_NEGATIVE), /* External 5: PHY */
62 0x0, /* External 6: */
63 (IRQ_SENSE_LEVEL | IRQ_POLARITY_NEGATIVE), /* External 7: PHY */
64 0x0, /* External 8: */
65 0x0, /* External 9: */
66 0x0, /* External 10: */
67 0x0, /* External 11: */
68};
69
70#ifdef CONFIG_PCI
71/*
72 * interrupt routing
73 */
74
75int
76mpc85xx_map_irq(struct pci_dev *dev, unsigned char idsel, unsigned char pin)
77{
78 static char pci_irq_table[][4] =
79 /*
80 * This is little evil, but works around the fact
81 * that revA boards have IDSEL starting at 18
82 * and others boards (older) start at 12
83 *
84 * PCI IDSEL/INTPIN->INTLINE
85 * A B C D
86 */
87 {
88 {PIRQA, PIRQB, PIRQC, PIRQD}, /* IDSEL 2 */
89 {PIRQD, PIRQA, PIRQB, PIRQC},
90 {PIRQC, PIRQD, PIRQA, PIRQB},
91 {PIRQB, PIRQC, PIRQD, PIRQA}, /* IDSEL 5 */
92 {0, 0, 0, 0}, /* -- */
93 {0, 0, 0, 0}, /* -- */
94 {0, 0, 0, 0}, /* -- */
95 {0, 0, 0, 0}, /* -- */
96 {0, 0, 0, 0}, /* -- */
97 {0, 0, 0, 0}, /* -- */
98 {PIRQA, PIRQB, PIRQC, PIRQD}, /* IDSEL 12 */
99 {PIRQD, PIRQA, PIRQB, PIRQC},
100 {PIRQC, PIRQD, PIRQA, PIRQB},
101 {PIRQB, PIRQC, PIRQD, PIRQA}, /* IDSEL 15 */
102 {0, 0, 0, 0}, /* -- */
103 {0, 0, 0, 0}, /* -- */
104 {PIRQA, PIRQB, PIRQC, PIRQD}, /* IDSEL 18 */
105 {PIRQD, PIRQA, PIRQB, PIRQC},
106 {PIRQC, PIRQD, PIRQA, PIRQB},
107 {PIRQB, PIRQC, PIRQD, PIRQA}, /* IDSEL 21 */
108 };
109
110 const long min_idsel = 2, max_idsel = 21, irqs_per_slot = 4;
111 return PCI_IRQ_TABLE_LOOKUP;
112}
113
114int
115mpc85xx_exclude_device(u_char bus, u_char devfn)
116{
117 if (bus == 0 && PCI_SLOT(devfn) == 0)
118 return PCIBIOS_DEVICE_NOT_FOUND;
119 else
120 return PCIBIOS_SUCCESSFUL;
121}
122
123#endif /* CONFIG_PCI */
124
125
126void __init mpc85xx_ads_pic_init(void)
127{
128 struct mpic *mpic1;
129 phys_addr_t OpenPIC_PAddr;
130
131 /* Determine the Physical Address of the OpenPIC regs */
132 OpenPIC_PAddr = get_immrbase() + MPC85xx_OPENPIC_OFFSET;
133
134 mpic1 = mpic_alloc(OpenPIC_PAddr,
135 MPIC_PRIMARY | MPIC_WANTS_RESET | MPIC_BIG_ENDIAN,
136 4, MPC85xx_OPENPIC_IRQ_OFFSET, 0, 250,
137 mpc85xx_ads_openpic_initsenses,
138 sizeof(mpc85xx_ads_openpic_initsenses),
139 " OpenPIC ");
140 BUG_ON(mpic1 == NULL);
141 mpic_assign_isu(mpic1, 0, OpenPIC_PAddr + 0x10200);
142 mpic_assign_isu(mpic1, 1, OpenPIC_PAddr + 0x10280);
143 mpic_assign_isu(mpic1, 2, OpenPIC_PAddr + 0x10300);
144 mpic_assign_isu(mpic1, 3, OpenPIC_PAddr + 0x10380);
145 mpic_assign_isu(mpic1, 4, OpenPIC_PAddr + 0x10400);
146 mpic_assign_isu(mpic1, 5, OpenPIC_PAddr + 0x10480);
147 mpic_assign_isu(mpic1, 6, OpenPIC_PAddr + 0x10500);
148 mpic_assign_isu(mpic1, 7, OpenPIC_PAddr + 0x10580);
149
150 /* dummy mappings to get to 48 */
151 mpic_assign_isu(mpic1, 8, OpenPIC_PAddr + 0x10600);
152 mpic_assign_isu(mpic1, 9, OpenPIC_PAddr + 0x10680);
153 mpic_assign_isu(mpic1, 10, OpenPIC_PAddr + 0x10700);
154 mpic_assign_isu(mpic1, 11, OpenPIC_PAddr + 0x10780);
155
156 /* External ints */
157 mpic_assign_isu(mpic1, 12, OpenPIC_PAddr + 0x10000);
158 mpic_assign_isu(mpic1, 13, OpenPIC_PAddr + 0x10080);
159 mpic_assign_isu(mpic1, 14, OpenPIC_PAddr + 0x10100);
160 mpic_init(mpic1);
161}
162
163/*
164 * Setup the architecture
165 */
166static void __init mpc85xx_ads_setup_arch(void)
167{
168 struct device_node *cpu;
169 struct device_node *np;
170
171 if (ppc_md.progress)
172 ppc_md.progress("mpc85xx_ads_setup_arch()", 0);
173
174 cpu = of_find_node_by_type(NULL, "cpu");
175 if (cpu != 0) {
176 unsigned int *fp;
177
178 fp = (int *)get_property(cpu, "clock-frequency", NULL);
179 if (fp != 0)
180 loops_per_jiffy = *fp / HZ;
181 else
182 loops_per_jiffy = 50000000 / HZ;
183 of_node_put(cpu);
184 }
185
186#ifdef CONFIG_PCI
187 for (np = NULL; (np = of_find_node_by_type(np, "pci")) != NULL;)
188 add_bridge(np);
189
190 ppc_md.pci_swizzle = common_swizzle;
191 ppc_md.pci_map_irq = mpc85xx_map_irq;
192 ppc_md.pci_exclude_device = mpc85xx_exclude_device;
193#endif
194
195#ifdef CONFIG_ROOT_NFS
196 ROOT_DEV = Root_NFS;
197#else
198 ROOT_DEV = Root_HDA1;
199#endif
200}
201
202void mpc85xx_ads_show_cpuinfo(struct seq_file *m)
203{
204 uint pvid, svid, phid1;
205 uint memsize = total_memory;
206
207 pvid = mfspr(SPRN_PVR);
208 svid = mfspr(SPRN_SVR);
209
210 seq_printf(m, "Vendor\t\t: Freescale Semiconductor\n");
211 seq_printf(m, "Machine\t\t: mpc85xx\n");
212 seq_printf(m, "PVR\t\t: 0x%x\n", pvid);
213 seq_printf(m, "SVR\t\t: 0x%x\n", svid);
214
215 /* Display cpu Pll setting */
216 phid1 = mfspr(SPRN_HID1);
217 seq_printf(m, "PLL setting\t: 0x%x\n", ((phid1 >> 24) & 0x3f));
218
219 /* Display the amount of memory */
220 seq_printf(m, "Memory\t\t: %d MB\n", memsize / (1024 * 1024));
221}
222
223void __init platform_init(void)
224{
225 ppc_md.setup_arch = mpc85xx_ads_setup_arch;
226 ppc_md.show_cpuinfo = mpc85xx_ads_show_cpuinfo;
227
228 ppc_md.init_IRQ = mpc85xx_ads_pic_init;
229 ppc_md.get_irq = mpic_get_irq;
230
231 ppc_md.restart = mpc85xx_restart;
232 ppc_md.power_off = NULL;
233 ppc_md.halt = NULL;
234
235 ppc_md.time_init = NULL;
236 ppc_md.set_rtc_time = NULL;
237 ppc_md.get_rtc_time = NULL;
238 ppc_md.calibrate_decr = generic_calibrate_decr;
239
240 ppc_md.progress = udbg_progress;
241
242 if (ppc_md.progress)
243 ppc_md.progress("mpc85xx_ads platform_init(): exit", 0);
244}
diff --git a/arch/powerpc/platforms/85xx/pci.c b/arch/powerpc/platforms/85xx/pci.c
new file mode 100644
index 000000000000..bad290110ed1
--- /dev/null
+++ b/arch/powerpc/platforms/85xx/pci.c
@@ -0,0 +1,96 @@
1/*
2 * FSL SoC setup code
3 *
4 * Maintained by Kumar Gala (see MAINTAINERS for contact information)
5 *
6 * This program is free software; you can redistribute it and/or modify it
7 * under the terms of the GNU General Public License as published by the
8 * Free Software Foundation; either version 2 of the License, or (at your
9 * option) any later version.
10 */
11
12#include <linux/config.h>
13#include <linux/stddef.h>
14#include <linux/kernel.h>
15#include <linux/init.h>
16#include <linux/errno.h>
17#include <linux/pci.h>
18#include <linux/delay.h>
19#include <linux/irq.h>
20#include <linux/module.h>
21
22#include <asm/system.h>
23#include <asm/atomic.h>
24#include <asm/io.h>
25#include <asm/pci-bridge.h>
26#include <asm/prom.h>
27#include <sysdev/fsl_soc.h>
28
29#undef DEBUG
30
31#ifdef DEBUG
32#define DBG(x...) printk(x)
33#else
34#define DBG(x...)
35#endif
36
37int mpc85xx_pci2_busno = 0;
38
39#ifdef CONFIG_PCI
40int __init add_bridge(struct device_node *dev)
41{
42 int len;
43 struct pci_controller *hose;
44 struct resource rsrc;
45 int *bus_range;
46 int primary = 1, has_address = 0;
47 phys_addr_t immr = get_immrbase();
48
49 DBG("Adding PCI host bridge %s\n", dev->full_name);
50
51 /* Fetch host bridge registers address */
52 has_address = (of_address_to_resource(dev, 0, &rsrc) == 0);
53
54 /* Get bus range if any */
55 bus_range = (int *) get_property(dev, "bus-range", &len);
56 if (bus_range == NULL || len < 2 * sizeof(int)) {
57 printk(KERN_WARNING "Can't get bus-range for %s, assume"
58 " bus 0\n", dev->full_name);
59 }
60
61 hose = pcibios_alloc_controller();
62 if (!hose)
63 return -ENOMEM;
64 hose->arch_data = dev;
65 hose->set_cfg_type = 1;
66
67 hose->first_busno = bus_range ? bus_range[0] : 0;
68 hose->last_busno = bus_range ? bus_range[1] : 0xff;
69
70 /* PCI 1 */
71 if ((rsrc.start & 0xfffff) == 0x8000) {
72 setup_indirect_pci(hose, immr + 0x8000, immr + 0x8004);
73 }
74 /* PCI 2 */
75 if ((rsrc.start & 0xfffff) == 0x9000) {
76 setup_indirect_pci(hose, immr + 0x9000, immr + 0x9004);
77 primary = 0;
78 hose->bus_offset = hose->first_busno;
79 mpc85xx_pci2_busno = hose->first_busno;
80 }
81
82 printk(KERN_INFO "Found MPC85xx PCI host bridge at 0x%08lx. "
83 "Firmware bus number: %d->%d\n",
84 rsrc.start, hose->first_busno, hose->last_busno);
85
86 DBG(" ->Hose at 0x%p, cfg_addr=0x%p,cfg_data=0x%p\n",
87 hose, hose->cfg_addr, hose->cfg_data);
88
89 /* Interpret the "ranges" property */
90 /* This also maps the I/O region and sets isa_io/mem_base */
91 pci_process_bridge_OF_ranges(hose, dev, primary);
92
93 return 0;
94}
95
96#endif
diff --git a/arch/powerpc/platforms/Makefile b/arch/powerpc/platforms/Makefile
index 04073fd987ec..c4f6b0d2d140 100644
--- a/arch/powerpc/platforms/Makefile
+++ b/arch/powerpc/platforms/Makefile
@@ -8,7 +8,7 @@ endif
8obj-$(CONFIG_PPC_CHRP) += chrp/ 8obj-$(CONFIG_PPC_CHRP) += chrp/
9obj-$(CONFIG_4xx) += 4xx/ 9obj-$(CONFIG_4xx) += 4xx/
10obj-$(CONFIG_PPC_83xx) += 83xx/ 10obj-$(CONFIG_PPC_83xx) += 83xx/
11obj-$(CONFIG_85xx) += 85xx/ 11obj-$(CONFIG_PPC_85xx) += 85xx/
12obj-$(CONFIG_PPC_PSERIES) += pseries/ 12obj-$(CONFIG_PPC_PSERIES) += pseries/
13obj-$(CONFIG_PPC_ISERIES) += iseries/ 13obj-$(CONFIG_PPC_ISERIES) += iseries/
14obj-$(CONFIG_PPC_MAPLE) += maple/ 14obj-$(CONFIG_PPC_MAPLE) += maple/
diff --git a/arch/powerpc/platforms/cell/Kconfig b/arch/powerpc/platforms/cell/Kconfig
index 3157071e241c..c2a3db8edb0c 100644
--- a/arch/powerpc/platforms/cell/Kconfig
+++ b/arch/powerpc/platforms/cell/Kconfig
@@ -10,4 +10,9 @@ config SPU_FS
10 Units on machines implementing the Broadband Processor 10 Units on machines implementing the Broadband Processor
11 Architecture. 11 Architecture.
12 12
13config SPUFS_MMAP
14 bool
15 depends on SPU_FS && SPARSEMEM && !PPC_64K_PAGES
16 default y
17
13endmenu 18endmenu
diff --git a/arch/powerpc/platforms/cell/Makefile b/arch/powerpc/platforms/cell/Makefile
index 3b998a393e3f..e570bad06394 100644
--- a/arch/powerpc/platforms/cell/Makefile
+++ b/arch/powerpc/platforms/cell/Makefile
@@ -6,5 +6,11 @@ obj-$(CONFIG_SPU_FS) += spu-base.o spufs/
6 6
7spu-base-y += spu_base.o spu_priv1.o 7spu-base-y += spu_base.o spu_priv1.o
8 8
9builtin-spufs-$(CONFIG_SPU_FS) += spu_syscalls.o 9# needed only when building loadable spufs.ko
10obj-y += $(builtin-spufs-m) 10spufs-modular-$(CONFIG_SPU_FS) += spu_syscalls.o
11obj-y += $(spufs-modular-m)
12
13# always needed in kernel
14spufs-builtin-$(CONFIG_SPU_FS) += spu_callbacks.o
15obj-y += $(spufs-builtin-y) $(spufs-builtin-m)
16
diff --git a/arch/powerpc/platforms/cell/interrupt.c b/arch/powerpc/platforms/cell/interrupt.c
index 63aa52acf441..978be1c30c1b 100644
--- a/arch/powerpc/platforms/cell/interrupt.c
+++ b/arch/powerpc/platforms/cell/interrupt.c
@@ -63,7 +63,24 @@ static DEFINE_PER_CPU(struct iic, iic);
63 63
64void iic_local_enable(void) 64void iic_local_enable(void)
65{ 65{
66 out_be64(&__get_cpu_var(iic).regs->prio, 0xff); 66 struct iic *iic = &__get_cpu_var(iic);
67 u64 tmp;
68
69 /*
70 * There seems to be a bug that is present in DD2.x CPUs
71 * and still only partially fixed in DD3.1.
72 * This bug causes a value written to the priority register
73 * not to make it there, resulting in a system hang unless we
74 * write it again.
75 * Masking with 0xf0 is done because the Cell BE does not
76 * implement the lower four bits of the interrupt priority,
77 * they always read back as zeroes, although future CPUs
78 * might implement different bits.
79 */
80 do {
81 out_be64(&iic->regs->prio, 0xff);
82 tmp = in_be64(&iic->regs->prio);
83 } while ((tmp & 0xf0) != 0xf0);
67} 84}
68 85
69void iic_local_disable(void) 86void iic_local_disable(void)
@@ -123,7 +140,7 @@ static int iic_external_get_irq(struct iic_pending_bits pending)
123 pending.class != 2) 140 pending.class != 2)
124 break; 141 break;
125 irq = IIC_EXT_OFFSET 142 irq = IIC_EXT_OFFSET
126 + spider_get_irq(pending.prio + node * IIC_NODE_STRIDE) 143 + spider_get_irq(node)
127 + node * IIC_NODE_STRIDE; 144 + node * IIC_NODE_STRIDE;
128 break; 145 break;
129 case 0x01 ... 0x04: 146 case 0x01 ... 0x04:
@@ -174,38 +191,98 @@ int iic_get_irq(struct pt_regs *regs)
174 return irq; 191 return irq;
175} 192}
176 193
177static int setup_iic(int cpu, struct iic *iic) 194/* hardcoded part to be compatible with older firmware */
195
196static int setup_iic_hardcoded(void)
178{ 197{
179 struct device_node *np; 198 struct device_node *np;
180 int nodeid = cpu / 2; 199 int nodeid, cpu;
181 unsigned long regs; 200 unsigned long regs;
201 struct iic *iic;
182 202
183 for (np = of_find_node_by_type(NULL, "cpu"); 203 for_each_cpu(cpu) {
184 np; 204 iic = &per_cpu(iic, cpu);
185 np = of_find_node_by_type(np, "cpu")) { 205 nodeid = cpu/2;
186 if (nodeid == *(int *)get_property(np, "node-id", NULL)) 206
187 break; 207 for (np = of_find_node_by_type(NULL, "cpu");
208 np;
209 np = of_find_node_by_type(np, "cpu")) {
210 if (nodeid == *(int *)get_property(np, "node-id", NULL))
211 break;
212 }
213
214 if (!np) {
215 printk(KERN_WARNING "IIC: CPU %d not found\n", cpu);
216 iic->regs = NULL;
217 iic->target_id = 0xff;
218 return -ENODEV;
219 }
220
221 regs = *(long *)get_property(np, "iic", NULL);
222
223 /* hack until we have decided on the devtree info */
224 regs += 0x400;
225 if (cpu & 1)
226 regs += 0x20;
227
228 printk(KERN_INFO "IIC for CPU %d at %lx\n", cpu, regs);
229 iic->regs = ioremap(regs, sizeof(struct iic_regs));
230 iic->target_id = (nodeid << 4) + ((cpu & 1) ? 0xf : 0xe);
188 } 231 }
189 232
190 if (!np) { 233 return 0;
191 printk(KERN_WARNING "IIC: CPU %d not found\n", cpu); 234}
192 iic->regs = NULL;
193 iic->target_id = 0xff;
194 return -ENODEV;
195 }
196 235
197 regs = *(long *)get_property(np, "iic", NULL); 236static int setup_iic(void)
237{
238 struct device_node *dn;
239 unsigned long *regs;
240 char *compatible;
241 unsigned *np, found = 0;
242 struct iic *iic = NULL;
243
244 for (dn = NULL; (dn = of_find_node_by_name(dn, "interrupt-controller"));) {
245 compatible = (char *)get_property(dn, "compatible", NULL);
246
247 if (!compatible) {
248 printk(KERN_WARNING "no compatible property found !\n");
249 continue;
250 }
198 251
199 /* hack until we have decided on the devtree info */ 252 if (strstr(compatible, "IBM,CBEA-Internal-Interrupt-Controller"))
200 regs += 0x400; 253 regs = (unsigned long *)get_property(dn,"reg", NULL);
201 if (cpu & 1) 254 else
202 regs += 0x20; 255 continue;
203 256
204 printk(KERN_DEBUG "IIC for CPU %d at %lx\n", cpu, regs); 257 if (!regs)
205 iic->regs = __ioremap(regs, sizeof(struct iic_regs), 258 printk(KERN_WARNING "IIC: no reg property\n");
206 _PAGE_NO_CACHE); 259
207 iic->target_id = (nodeid << 4) + ((cpu & 1) ? 0xf : 0xe); 260 np = (unsigned int *)get_property(dn, "ibm,interrupt-server-ranges", NULL);
208 return 0; 261
262 if (!np) {
263 printk(KERN_WARNING "IIC: CPU association not found\n");
264 iic->regs = NULL;
265 iic->target_id = 0xff;
266 return -ENODEV;
267 }
268
269 iic = &per_cpu(iic, np[0]);
270 iic->regs = ioremap(regs[0], sizeof(struct iic_regs));
271 iic->target_id = ((np[0] & 2) << 3) + ((np[0] & 1) ? 0xf : 0xe);
272 printk("IIC for CPU %d at %lx mapped to %p\n", np[0], regs[0], iic->regs);
273
274 iic = &per_cpu(iic, np[1]);
275 iic->regs = ioremap(regs[2], sizeof(struct iic_regs));
276 iic->target_id = ((np[1] & 2) << 3) + ((np[1] & 1) ? 0xf : 0xe);
277 printk("IIC for CPU %d at %lx mapped to %p\n", np[1], regs[2], iic->regs);
278
279 found++;
280 }
281
282 if (found)
283 return 0;
284 else
285 return -ENODEV;
209} 286}
210 287
211#ifdef CONFIG_SMP 288#ifdef CONFIG_SMP
@@ -283,10 +360,12 @@ void iic_init_IRQ(void)
283 int cpu, irq_offset; 360 int cpu, irq_offset;
284 struct iic *iic; 361 struct iic *iic;
285 362
363 if (setup_iic() < 0)
364 setup_iic_hardcoded();
365
286 irq_offset = 0; 366 irq_offset = 0;
287 for_each_cpu(cpu) { 367 for_each_possible_cpu(cpu) {
288 iic = &per_cpu(iic, cpu); 368 iic = &per_cpu(iic, cpu);
289 setup_iic(cpu, iic);
290 if (iic->regs) 369 if (iic->regs)
291 out_be64(&iic->regs->prio, 0xff); 370 out_be64(&iic->regs->prio, 0xff);
292 } 371 }
diff --git a/arch/powerpc/platforms/cell/interrupt.h b/arch/powerpc/platforms/cell/interrupt.h
index a14bd38791c0..799f77d98f96 100644
--- a/arch/powerpc/platforms/cell/interrupt.h
+++ b/arch/powerpc/platforms/cell/interrupt.h
@@ -57,7 +57,7 @@ extern void iic_local_disable(void);
57extern u8 iic_get_target_id(int cpu); 57extern u8 iic_get_target_id(int cpu);
58 58
59extern void spider_init_IRQ(void); 59extern void spider_init_IRQ(void);
60extern int spider_get_irq(unsigned long int_pending); 60extern int spider_get_irq(int node);
61 61
62#endif 62#endif
63#endif /* ASM_CELL_PIC_H */ 63#endif /* ASM_CELL_PIC_H */
diff --git a/arch/powerpc/platforms/cell/iommu.c b/arch/powerpc/platforms/cell/iommu.c
index 46e7cb9c3e64..a49ceb799a8e 100644
--- a/arch/powerpc/platforms/cell/iommu.c
+++ b/arch/powerpc/platforms/cell/iommu.c
@@ -289,7 +289,7 @@ static void cell_do_map_iommu(struct cell_iommu *iommu,
289 ioc_base = iommu->mapped_base; 289 ioc_base = iommu->mapped_base;
290 ioc_mmio_base = iommu->mapped_mmio_base; 290 ioc_mmio_base = iommu->mapped_mmio_base;
291 291
292 for (real_address = 0, io_address = 0; 292 for (real_address = 0, io_address = map_start;
293 io_address <= map_start + map_size; 293 io_address <= map_start + map_size;
294 real_address += io_page_size, io_address += io_page_size) { 294 real_address += io_page_size, io_address += io_page_size) {
295 ioste = get_iost_entry(fake_iopt, io_address, io_page_size); 295 ioste = get_iost_entry(fake_iopt, io_address, io_page_size);
@@ -302,7 +302,7 @@ static void cell_do_map_iommu(struct cell_iommu *iommu,
302 set_iopt_cache(ioc_mmio_base, 302 set_iopt_cache(ioc_mmio_base,
303 get_ioc_hash_1way(ioste, io_address), 303 get_ioc_hash_1way(ioste, io_address),
304 get_ioc_tag(ioste, io_address), 304 get_ioc_tag(ioste, io_address),
305 get_iopt_entry(real_address-map_start, ioid, IOPT_PROT_RW)); 305 get_iopt_entry(real_address, ioid, IOPT_PROT_RW));
306 } 306 }
307} 307}
308 308
@@ -344,8 +344,8 @@ static int cell_map_iommu_hardcoded(int num_nodes)
344 344
345 /* node 0 */ 345 /* node 0 */
346 iommu = &cell_iommus[0]; 346 iommu = &cell_iommus[0];
347 iommu->mapped_base = __ioremap(0x20000511000, 0x1000, _PAGE_NO_CACHE); 347 iommu->mapped_base = ioremap(0x20000511000, 0x1000);
348 iommu->mapped_mmio_base = __ioremap(0x20000510000, 0x1000, _PAGE_NO_CACHE); 348 iommu->mapped_mmio_base = ioremap(0x20000510000, 0x1000);
349 349
350 enable_mapping(iommu->mapped_base, iommu->mapped_mmio_base); 350 enable_mapping(iommu->mapped_base, iommu->mapped_mmio_base);
351 351
@@ -357,8 +357,8 @@ static int cell_map_iommu_hardcoded(int num_nodes)
357 357
358 /* node 1 */ 358 /* node 1 */
359 iommu = &cell_iommus[1]; 359 iommu = &cell_iommus[1];
360 iommu->mapped_base = __ioremap(0x30000511000, 0x1000, _PAGE_NO_CACHE); 360 iommu->mapped_base = ioremap(0x30000511000, 0x1000);
361 iommu->mapped_mmio_base = __ioremap(0x30000510000, 0x1000, _PAGE_NO_CACHE); 361 iommu->mapped_mmio_base = ioremap(0x30000510000, 0x1000);
362 362
363 enable_mapping(iommu->mapped_base, iommu->mapped_mmio_base); 363 enable_mapping(iommu->mapped_base, iommu->mapped_mmio_base);
364 364
@@ -407,8 +407,8 @@ static int cell_map_iommu(void)
407 iommu->base = *base; 407 iommu->base = *base;
408 iommu->mmio_base = *mmio_base; 408 iommu->mmio_base = *mmio_base;
409 409
410 iommu->mapped_base = __ioremap(*base, 0x1000, _PAGE_NO_CACHE); 410 iommu->mapped_base = ioremap(*base, 0x1000);
411 iommu->mapped_mmio_base = __ioremap(*mmio_base, 0x1000, _PAGE_NO_CACHE); 411 iommu->mapped_mmio_base = ioremap(*mmio_base, 0x1000);
412 412
413 enable_mapping(iommu->mapped_base, 413 enable_mapping(iommu->mapped_base,
414 iommu->mapped_mmio_base); 414 iommu->mapped_mmio_base);
diff --git a/arch/powerpc/platforms/cell/pervasive.c b/arch/powerpc/platforms/cell/pervasive.c
index e0e051c675dd..7eed8c624517 100644
--- a/arch/powerpc/platforms/cell/pervasive.c
+++ b/arch/powerpc/platforms/cell/pervasive.c
@@ -203,7 +203,7 @@ found:
203 203
204 pr_debug("pervasive area for CPU %d at %lx, size %x\n", 204 pr_debug("pervasive area for CPU %d at %lx, size %x\n",
205 cpu, real_address, size); 205 cpu, real_address, size);
206 p->regs = __ioremap(real_address, size, _PAGE_NO_CACHE); 206 p->regs = ioremap(real_address, size);
207 p->thread = thread; 207 p->thread = thread;
208 return 0; 208 return 0;
209} 209}
@@ -217,7 +217,7 @@ void __init cell_pervasive_init(void)
217 if (!cpu_has_feature(CPU_FTR_PAUSE_ZERO)) 217 if (!cpu_has_feature(CPU_FTR_PAUSE_ZERO))
218 return; 218 return;
219 219
220 for_each_cpu(cpu) { 220 for_each_possible_cpu(cpu) {
221 p = &cbe_pervasive[cpu]; 221 p = &cbe_pervasive[cpu];
222 ret = cbe_find_pmd_mmio(cpu, p); 222 ret = cbe_find_pmd_mmio(cpu, p);
223 if (ret) 223 if (ret)
diff --git a/arch/powerpc/platforms/cell/setup.c b/arch/powerpc/platforms/cell/setup.c
index b33a4443f5a9..dac5d0365fde 100644
--- a/arch/powerpc/platforms/cell/setup.c
+++ b/arch/powerpc/platforms/cell/setup.c
@@ -115,7 +115,7 @@ static void __init cell_spuprop_present(struct device_node *spe,
115 for (pfn = start_pfn; pfn < end_pfn; pfn++) { 115 for (pfn = start_pfn; pfn < end_pfn; pfn++) {
116 struct page *page = pfn_to_page(pfn); 116 struct page *page = pfn_to_page(pfn);
117 set_page_links(page, ZONE_DMA, node_id, pfn); 117 set_page_links(page, ZONE_DMA, node_id, pfn);
118 set_page_count(page, 1); 118 init_page_count(page);
119 reset_page_mapcount(page); 119 reset_page_mapcount(page);
120 SetPageReserved(page); 120 SetPageReserved(page);
121 INIT_LIST_HEAD(&page->lru); 121 INIT_LIST_HEAD(&page->lru);
@@ -195,9 +195,13 @@ static void __init cell_init_early(void)
195} 195}
196 196
197 197
198static int __init cell_probe(int platform) 198static int __init cell_probe(void)
199{ 199{
200 if (platform != PLATFORM_CELL) 200 /* XXX This is temporary, the Cell maintainer will come up with
201 * more appropriate detection logic
202 */
203 unsigned long root = of_get_flat_dt_root();
204 if (!of_flat_dt_is_compatible(root, "IBM,CPBW-1.0"))
201 return 0; 205 return 0;
202 206
203 return 1; 207 return 1;
@@ -212,7 +216,8 @@ static int cell_check_legacy_ioport(unsigned int baseport)
212 return -ENODEV; 216 return -ENODEV;
213} 217}
214 218
215struct machdep_calls __initdata cell_md = { 219define_machine(cell) {
220 .name = "Cell",
216 .probe = cell_probe, 221 .probe = cell_probe,
217 .setup_arch = cell_setup_arch, 222 .setup_arch = cell_setup_arch,
218 .init_early = cell_init_early, 223 .init_early = cell_init_early,
diff --git a/arch/powerpc/platforms/cell/spider-pic.c b/arch/powerpc/platforms/cell/spider-pic.c
index e74132188bdf..55cbdd77a62d 100644
--- a/arch/powerpc/platforms/cell/spider-pic.c
+++ b/arch/powerpc/platforms/cell/spider-pic.c
@@ -84,10 +84,11 @@ static void __iomem *spider_get_irq_config(int irq)
84 84
85static void spider_enable_irq(unsigned int irq) 85static void spider_enable_irq(unsigned int irq)
86{ 86{
87 int nodeid = (irq / IIC_NODE_STRIDE) * 0x10;
87 void __iomem *cfg = spider_get_irq_config(irq); 88 void __iomem *cfg = spider_get_irq_config(irq);
88 irq = spider_get_nr(irq); 89 irq = spider_get_nr(irq);
89 90
90 out_be32(cfg, in_be32(cfg) | 0x3107000eu); 91 out_be32(cfg, (in_be32(cfg) & ~0xf0)| 0x3107000eu | nodeid);
91 out_be32(cfg + 4, in_be32(cfg + 4) | 0x00020000u | irq); 92 out_be32(cfg + 4, in_be32(cfg + 4) | 0x00020000u | irq);
92} 93}
93 94
@@ -131,61 +132,108 @@ static struct hw_interrupt_type spider_pic = {
131 .end = spider_end_irq, 132 .end = spider_end_irq,
132}; 133};
133 134
134 135int spider_get_irq(int node)
135int spider_get_irq(unsigned long int_pending)
136{ 136{
137 void __iomem *regs = spider_get_pic(int_pending);
138 unsigned long cs; 137 unsigned long cs;
139 int irq; 138 void __iomem *regs = spider_pics[node];
140
141 cs = in_be32(regs + TIR_CS);
142 139
143 irq = cs >> 24; 140 cs = in_be32(regs + TIR_CS) >> 24;
144 if (irq != 63)
145 return irq;
146 141
147 return -1; 142 if (cs == 63)
143 return -1;
144 else
145 return cs;
148} 146}
149 147
150void spider_init_IRQ(void) 148/* hardcoded part to be compatible with older firmware */
149
150void spider_init_IRQ_hardcoded(void)
151{ 151{
152 int node; 152 int node;
153 struct device_node *dn;
154 unsigned int *property;
155 long spiderpic; 153 long spiderpic;
154 long pics[] = { 0x24000008000, 0x34000008000 };
156 int n; 155 int n;
157 156
158/* FIXME: detect multiple PICs as soon as the device tree has them */ 157 pr_debug("%s(%d): Using hardcoded defaults\n", __FUNCTION__, __LINE__);
159 for (node = 0; node < 1; node++) {
160 dn = of_find_node_by_path("/");
161 n = prom_n_addr_cells(dn);
162 property = (unsigned int *) get_property(dn,
163 "platform-spider-pic", NULL);
164 158
165 if (!property) 159 for (node = 0; node < num_present_cpus()/2; node++) {
166 continue; 160 spiderpic = pics[node];
167 for (spiderpic = 0; n > 0; --n)
168 spiderpic = (spiderpic << 32) + *property++;
169 printk(KERN_DEBUG "SPIDER addr: %lx\n", spiderpic); 161 printk(KERN_DEBUG "SPIDER addr: %lx\n", spiderpic);
170 spider_pics[node] = __ioremap(spiderpic, 0x800, _PAGE_NO_CACHE); 162 spider_pics[node] = ioremap(spiderpic, 0x800);
171 for (n = 0; n < IIC_NUM_EXT; n++) { 163 for (n = 0; n < IIC_NUM_EXT; n++) {
172 int irq = n + IIC_EXT_OFFSET + node * IIC_NODE_STRIDE; 164 int irq = n + IIC_EXT_OFFSET + node * IIC_NODE_STRIDE;
173 get_irq_desc(irq)->handler = &spider_pic; 165 get_irq_desc(irq)->handler = &spider_pic;
166 }
174 167
175 /* do not mask any interrupts because of level */ 168 /* do not mask any interrupts because of level */
176 out_be32(spider_pics[node] + TIR_MSK, 0x0); 169 out_be32(spider_pics[node] + TIR_MSK, 0x0);
177 170
178 /* disable edge detection clear */ 171 /* disable edge detection clear */
179 /* out_be32(spider_pics[node] + TIR_EDC, 0x0); */ 172 /* out_be32(spider_pics[node] + TIR_EDC, 0x0); */
180 173
181 /* enable interrupt packets to be output */ 174 /* enable interrupt packets to be output */
182 out_be32(spider_pics[node] + TIR_PIEN, 175 out_be32(spider_pics[node] + TIR_PIEN,
183 in_be32(spider_pics[node] + TIR_PIEN) | 0x1); 176 in_be32(spider_pics[node] + TIR_PIEN) | 0x1);
184 177
185 /* Enable the interrupt detection enable bit. Do this last! */ 178 /* Enable the interrupt detection enable bit. Do this last! */
186 out_be32(spider_pics[node] + TIR_DEN, 179 out_be32(spider_pics[node] + TIR_DEN,
187 in_be32(spider_pics[node] +TIR_DEN) | 0x1); 180 in_be32(spider_pics[node] + TIR_DEN) | 0x1);
181 }
182}
183
184void spider_init_IRQ(void)
185{
186 long spider_reg;
187 struct device_node *dn;
188 char *compatible;
189 int n, node = 0;
190
191 for (dn = NULL; (dn = of_find_node_by_name(dn, "interrupt-controller"));) {
192 compatible = (char *)get_property(dn, "compatible", NULL);
188 193
194 if (!compatible)
195 continue;
196
197 if (strstr(compatible, "CBEA,platform-spider-pic"))
198 spider_reg = *(long *)get_property(dn,"reg", NULL);
199 else if (strstr(compatible, "sti,platform-spider-pic")) {
200 spider_init_IRQ_hardcoded();
201 return;
202 } else
203 continue;
204
205 if (!spider_reg)
206 printk("interrupt controller does not have reg property !\n");
207
208 n = prom_n_addr_cells(dn);
209
210 if ( n != 2)
211 printk("reg property with invalid number of elements \n");
212
213 spider_pics[node] = ioremap(spider_reg, 0x800);
214
215 printk("SPIDER addr: %lx with %i addr_cells mapped to %p\n",
216 spider_reg, n, spider_pics[node]);
217
218 for (n = 0; n < IIC_NUM_EXT; n++) {
219 int irq = n + IIC_EXT_OFFSET + node * IIC_NODE_STRIDE;
220 get_irq_desc(irq)->handler = &spider_pic;
189 } 221 }
222
223 /* do not mask any interrupts because of level */
224 out_be32(spider_pics[node] + TIR_MSK, 0x0);
225
226 /* disable edge detection clear */
227 /* out_be32(spider_pics[node] + TIR_EDC, 0x0); */
228
229 /* enable interrupt packets to be output */
230 out_be32(spider_pics[node] + TIR_PIEN,
231 in_be32(spider_pics[node] + TIR_PIEN) | 0x1);
232
233 /* Enable the interrupt detection enable bit. Do this last! */
234 out_be32(spider_pics[node] + TIR_DEN,
235 in_be32(spider_pics[node] + TIR_DEN) | 0x1);
236
237 node++;
190 } 238 }
191} 239}
diff --git a/arch/powerpc/platforms/cell/spu_base.c b/arch/powerpc/platforms/cell/spu_base.c
index d75ae03df686..269dda4fd0b4 100644
--- a/arch/powerpc/platforms/cell/spu_base.c
+++ b/arch/powerpc/platforms/cell/spu_base.c
@@ -32,7 +32,7 @@
32 32
33#include <asm/io.h> 33#include <asm/io.h>
34#include <asm/prom.h> 34#include <asm/prom.h>
35#include <asm/semaphore.h> 35#include <linux/mutex.h>
36#include <asm/spu.h> 36#include <asm/spu.h>
37#include <asm/mmu_context.h> 37#include <asm/mmu_context.h>
38 38
@@ -111,7 +111,7 @@ static int __spu_trap_data_seg(struct spu *spu, unsigned long ea)
111extern int hash_page(unsigned long ea, unsigned long access, unsigned long trap); //XXX 111extern int hash_page(unsigned long ea, unsigned long access, unsigned long trap); //XXX
112static int __spu_trap_data_map(struct spu *spu, unsigned long ea, u64 dsisr) 112static int __spu_trap_data_map(struct spu *spu, unsigned long ea, u64 dsisr)
113{ 113{
114 pr_debug("%s\n", __FUNCTION__); 114 pr_debug("%s, %lx, %lx\n", __FUNCTION__, dsisr, ea);
115 115
116 /* Handle kernel space hash faults immediately. 116 /* Handle kernel space hash faults immediately.
117 User hash faults need to be deferred to process context. */ 117 User hash faults need to be deferred to process context. */
@@ -168,7 +168,7 @@ static int __spu_trap_halt(struct spu *spu)
168static int __spu_trap_tag_group(struct spu *spu) 168static int __spu_trap_tag_group(struct spu *spu)
169{ 169{
170 pr_debug("%s\n", __FUNCTION__); 170 pr_debug("%s\n", __FUNCTION__);
171 /* wake_up(&spu->dma_wq); */ 171 spu->mfc_callback(spu);
172 return 0; 172 return 0;
173} 173}
174 174
@@ -242,6 +242,8 @@ spu_irq_class_1(int irq, void *data, struct pt_regs *regs)
242 spu_mfc_dsisr_set(spu, 0ul); 242 spu_mfc_dsisr_set(spu, 0ul);
243 spu_int_stat_clear(spu, 1, stat); 243 spu_int_stat_clear(spu, 1, stat);
244 spin_unlock(&spu->register_lock); 244 spin_unlock(&spu->register_lock);
245 pr_debug("%s: %lx %lx %lx %lx\n", __FUNCTION__, mask, stat,
246 dar, dsisr);
245 247
246 if (stat & 1) /* segment fault */ 248 if (stat & 1) /* segment fault */
247 __spu_trap_data_seg(spu, dar); 249 __spu_trap_data_seg(spu, dar);
@@ -342,7 +344,7 @@ spu_free_irqs(struct spu *spu)
342} 344}
343 345
344static LIST_HEAD(spu_list); 346static LIST_HEAD(spu_list);
345static DECLARE_MUTEX(spu_mutex); 347static DEFINE_MUTEX(spu_mutex);
346 348
347static void spu_init_channels(struct spu *spu) 349static void spu_init_channels(struct spu *spu)
348{ 350{
@@ -382,7 +384,7 @@ struct spu *spu_alloc(void)
382{ 384{
383 struct spu *spu; 385 struct spu *spu;
384 386
385 down(&spu_mutex); 387 mutex_lock(&spu_mutex);
386 if (!list_empty(&spu_list)) { 388 if (!list_empty(&spu_list)) {
387 spu = list_entry(spu_list.next, struct spu, list); 389 spu = list_entry(spu_list.next, struct spu, list);
388 list_del_init(&spu->list); 390 list_del_init(&spu->list);
@@ -391,7 +393,7 @@ struct spu *spu_alloc(void)
391 pr_debug("No SPU left\n"); 393 pr_debug("No SPU left\n");
392 spu = NULL; 394 spu = NULL;
393 } 395 }
394 up(&spu_mutex); 396 mutex_unlock(&spu_mutex);
395 397
396 if (spu) 398 if (spu)
397 spu_init_channels(spu); 399 spu_init_channels(spu);
@@ -402,9 +404,9 @@ EXPORT_SYMBOL_GPL(spu_alloc);
402 404
403void spu_free(struct spu *spu) 405void spu_free(struct spu *spu)
404{ 406{
405 down(&spu_mutex); 407 mutex_lock(&spu_mutex);
406 list_add_tail(&spu->list, &spu_list); 408 list_add_tail(&spu->list, &spu_list);
407 up(&spu_mutex); 409 mutex_unlock(&spu_mutex);
408} 410}
409EXPORT_SYMBOL_GPL(spu_free); 411EXPORT_SYMBOL_GPL(spu_free);
410 412
@@ -484,14 +486,13 @@ int spu_irq_class_1_bottom(struct spu *spu)
484 486
485 ea = spu->dar; 487 ea = spu->dar;
486 dsisr = spu->dsisr; 488 dsisr = spu->dsisr;
487 if (dsisr & MFC_DSISR_PTE_NOT_FOUND) { 489 if (dsisr & (MFC_DSISR_PTE_NOT_FOUND | MFC_DSISR_ACCESS_DENIED)) {
488 access = (_PAGE_PRESENT | _PAGE_USER); 490 access = (_PAGE_PRESENT | _PAGE_USER);
489 access |= (dsisr & MFC_DSISR_ACCESS_PUT) ? _PAGE_RW : 0UL; 491 access |= (dsisr & MFC_DSISR_ACCESS_PUT) ? _PAGE_RW : 0UL;
490 if (hash_page(ea, access, 0x300) != 0) 492 if (hash_page(ea, access, 0x300) != 0)
491 error |= CLASS1_ENABLE_STORAGE_FAULT_INTR; 493 error |= CLASS1_ENABLE_STORAGE_FAULT_INTR;
492 } 494 }
493 if ((error & CLASS1_ENABLE_STORAGE_FAULT_INTR) || 495 if (error & CLASS1_ENABLE_STORAGE_FAULT_INTR) {
494 (dsisr & MFC_DSISR_ACCESS_DENIED)) {
495 if ((ret = spu_handle_mm_fault(spu)) != 0) 496 if ((ret = spu_handle_mm_fault(spu)) != 0)
496 error |= CLASS1_ENABLE_STORAGE_FAULT_INTR; 497 error |= CLASS1_ENABLE_STORAGE_FAULT_INTR;
497 else 498 else
@@ -568,6 +569,11 @@ static int __init spu_map_device(struct spu *spu, struct device_node *spe)
568 if (!spu->local_store) 569 if (!spu->local_store)
569 goto out; 570 goto out;
570 571
572 prop = get_property(spe, "problem", NULL);
573 if (!prop)
574 goto out_unmap;
575 spu->problem_phys = *(unsigned long *)prop;
576
571 spu->problem= map_spe_prop(spe, "problem"); 577 spu->problem= map_spe_prop(spe, "problem");
572 if (!spu->problem) 578 if (!spu->problem)
573 goto out_unmap; 579 goto out_unmap;
@@ -632,15 +638,16 @@ static int __init create_spu(struct device_node *spe)
632 spu->ibox_callback = NULL; 638 spu->ibox_callback = NULL;
633 spu->wbox_callback = NULL; 639 spu->wbox_callback = NULL;
634 spu->stop_callback = NULL; 640 spu->stop_callback = NULL;
641 spu->mfc_callback = NULL;
635 642
636 down(&spu_mutex); 643 mutex_lock(&spu_mutex);
637 spu->number = number++; 644 spu->number = number++;
638 ret = spu_request_irqs(spu); 645 ret = spu_request_irqs(spu);
639 if (ret) 646 if (ret)
640 goto out_unmap; 647 goto out_unmap;
641 648
642 list_add(&spu->list, &spu_list); 649 list_add(&spu->list, &spu_list);
643 up(&spu_mutex); 650 mutex_unlock(&spu_mutex);
644 651
645 pr_debug(KERN_DEBUG "Using SPE %s %02x %p %p %p %p %d\n", 652 pr_debug(KERN_DEBUG "Using SPE %s %02x %p %p %p %p %d\n",
646 spu->name, spu->isrc, spu->local_store, 653 spu->name, spu->isrc, spu->local_store,
@@ -648,7 +655,7 @@ static int __init create_spu(struct device_node *spe)
648 goto out; 655 goto out;
649 656
650out_unmap: 657out_unmap:
651 up(&spu_mutex); 658 mutex_unlock(&spu_mutex);
652 spu_unmap(spu); 659 spu_unmap(spu);
653out_free: 660out_free:
654 kfree(spu); 661 kfree(spu);
@@ -668,10 +675,10 @@ static void destroy_spu(struct spu *spu)
668static void cleanup_spu_base(void) 675static void cleanup_spu_base(void)
669{ 676{
670 struct spu *spu, *tmp; 677 struct spu *spu, *tmp;
671 down(&spu_mutex); 678 mutex_lock(&spu_mutex);
672 list_for_each_entry_safe(spu, tmp, &spu_list, list) 679 list_for_each_entry_safe(spu, tmp, &spu_list, list)
673 destroy_spu(spu); 680 destroy_spu(spu);
674 up(&spu_mutex); 681 mutex_unlock(&spu_mutex);
675} 682}
676module_exit(cleanup_spu_base); 683module_exit(cleanup_spu_base);
677 684
diff --git a/arch/powerpc/platforms/cell/spu_callbacks.c b/arch/powerpc/platforms/cell/spu_callbacks.c
new file mode 100644
index 000000000000..3a4245c926ad
--- /dev/null
+++ b/arch/powerpc/platforms/cell/spu_callbacks.c
@@ -0,0 +1,345 @@
1/*
2 * System call callback functions for SPUs
3 */
4
5#define DEBUG
6
7#include <linux/kallsyms.h>
8#include <linux/module.h>
9#include <linux/syscalls.h>
10
11#include <asm/spu.h>
12#include <asm/syscalls.h>
13#include <asm/unistd.h>
14
15/*
16 * This table defines the system calls that an SPU can call.
17 * It is currently a subset of the 64 bit powerpc system calls,
18 * with the exact semantics.
19 *
20 * The reasons for disabling some of the system calls are:
21 * 1. They interact with the way SPU syscalls are handled
22 * and we can't let them execute ever:
23 * restart_syscall, exit, for, execve, ptrace, ...
24 * 2. They are deprecated and replaced by other means:
25 * uselib, pciconfig_*, sysfs, ...
26 * 3. They are somewhat interacting with the system in a way
27 * we don't want an SPU to:
28 * reboot, init_module, mount, kexec_load
29 * 4. They are optional and we can't rely on them being
30 * linked into the kernel. Unfortunately, the cond_syscall
31 * helper does not work here as it does not add the necessary
32 * opd symbols:
33 * mbind, mq_open, ipc, ...
34 */
35
36void *spu_syscall_table[] = {
37 [__NR_restart_syscall] sys_ni_syscall, /* sys_restart_syscall */
38 [__NR_exit] sys_ni_syscall, /* sys_exit */
39 [__NR_fork] sys_ni_syscall, /* ppc_fork */
40 [__NR_read] sys_read,
41 [__NR_write] sys_write,
42 [__NR_open] sys_open,
43 [__NR_close] sys_close,
44 [__NR_waitpid] sys_waitpid,
45 [__NR_creat] sys_creat,
46 [__NR_link] sys_link,
47 [__NR_unlink] sys_unlink,
48 [__NR_execve] sys_ni_syscall, /* sys_execve */
49 [__NR_chdir] sys_chdir,
50 [__NR_time] sys_time,
51 [__NR_mknod] sys_mknod,
52 [__NR_chmod] sys_chmod,
53 [__NR_lchown] sys_lchown,
54 [__NR_break] sys_ni_syscall,
55 [__NR_oldstat] sys_ni_syscall,
56 [__NR_lseek] sys_lseek,
57 [__NR_getpid] sys_getpid,
58 [__NR_mount] sys_ni_syscall, /* sys_mount */
59 [__NR_umount] sys_ni_syscall,
60 [__NR_setuid] sys_setuid,
61 [__NR_getuid] sys_getuid,
62 [__NR_stime] sys_stime,
63 [__NR_ptrace] sys_ni_syscall, /* sys_ptrace */
64 [__NR_alarm] sys_alarm,
65 [__NR_oldfstat] sys_ni_syscall,
66 [__NR_pause] sys_ni_syscall, /* sys_pause */
67 [__NR_utime] sys_ni_syscall, /* sys_utime */
68 [__NR_stty] sys_ni_syscall,
69 [__NR_gtty] sys_ni_syscall,
70 [__NR_access] sys_access,
71 [__NR_nice] sys_nice,
72 [__NR_ftime] sys_ni_syscall,
73 [__NR_sync] sys_sync,
74 [__NR_kill] sys_kill,
75 [__NR_rename] sys_rename,
76 [__NR_mkdir] sys_mkdir,
77 [__NR_rmdir] sys_rmdir,
78 [__NR_dup] sys_dup,
79 [__NR_pipe] sys_pipe,
80 [__NR_times] sys_times,
81 [__NR_prof] sys_ni_syscall,
82 [__NR_brk] sys_brk,
83 [__NR_setgid] sys_setgid,
84 [__NR_getgid] sys_getgid,
85 [__NR_signal] sys_ni_syscall, /* sys_signal */
86 [__NR_geteuid] sys_geteuid,
87 [__NR_getegid] sys_getegid,
88 [__NR_acct] sys_ni_syscall, /* sys_acct */
89 [__NR_umount2] sys_ni_syscall, /* sys_umount */
90 [__NR_lock] sys_ni_syscall,
91 [__NR_ioctl] sys_ioctl,
92 [__NR_fcntl] sys_fcntl,
93 [__NR_mpx] sys_ni_syscall,
94 [__NR_setpgid] sys_setpgid,
95 [__NR_ulimit] sys_ni_syscall,
96 [__NR_oldolduname] sys_ni_syscall,
97 [__NR_umask] sys_umask,
98 [__NR_chroot] sys_chroot,
99 [__NR_ustat] sys_ni_syscall, /* sys_ustat */
100 [__NR_dup2] sys_dup2,
101 [__NR_getppid] sys_getppid,
102 [__NR_getpgrp] sys_getpgrp,
103 [__NR_setsid] sys_setsid,
104 [__NR_sigaction] sys_ni_syscall,
105 [__NR_sgetmask] sys_sgetmask,
106 [__NR_ssetmask] sys_ssetmask,
107 [__NR_setreuid] sys_setreuid,
108 [__NR_setregid] sys_setregid,
109 [__NR_sigsuspend] sys_ni_syscall,
110 [__NR_sigpending] sys_ni_syscall,
111 [__NR_sethostname] sys_sethostname,
112 [__NR_setrlimit] sys_setrlimit,
113 [__NR_getrlimit] sys_ni_syscall,
114 [__NR_getrusage] sys_getrusage,
115 [__NR_gettimeofday] sys_gettimeofday,
116 [__NR_settimeofday] sys_settimeofday,
117 [__NR_getgroups] sys_getgroups,
118 [__NR_setgroups] sys_setgroups,
119 [__NR_select] sys_ni_syscall,
120 [__NR_symlink] sys_symlink,
121 [__NR_oldlstat] sys_ni_syscall,
122 [__NR_readlink] sys_readlink,
123 [__NR_uselib] sys_ni_syscall, /* sys_uselib */
124 [__NR_swapon] sys_ni_syscall, /* sys_swapon */
125 [__NR_reboot] sys_ni_syscall, /* sys_reboot */
126 [__NR_readdir] sys_ni_syscall,
127 [__NR_mmap] sys_mmap,
128 [__NR_munmap] sys_munmap,
129 [__NR_truncate] sys_truncate,
130 [__NR_ftruncate] sys_ftruncate,
131 [__NR_fchmod] sys_fchmod,
132 [__NR_fchown] sys_fchown,
133 [__NR_getpriority] sys_getpriority,
134 [__NR_setpriority] sys_setpriority,
135 [__NR_profil] sys_ni_syscall,
136 [__NR_statfs] sys_ni_syscall, /* sys_statfs */
137 [__NR_fstatfs] sys_ni_syscall, /* sys_fstatfs */
138 [__NR_ioperm] sys_ni_syscall,
139 [__NR_socketcall] sys_socketcall,
140 [__NR_syslog] sys_syslog,
141 [__NR_setitimer] sys_setitimer,
142 [__NR_getitimer] sys_getitimer,
143 [__NR_stat] sys_newstat,
144 [__NR_lstat] sys_newlstat,
145 [__NR_fstat] sys_newfstat,
146 [__NR_olduname] sys_ni_syscall,
147 [__NR_iopl] sys_ni_syscall,
148 [__NR_vhangup] sys_vhangup,
149 [__NR_idle] sys_ni_syscall,
150 [__NR_vm86] sys_ni_syscall,
151 [__NR_wait4] sys_wait4,
152 [__NR_swapoff] sys_ni_syscall, /* sys_swapoff */
153 [__NR_sysinfo] sys_sysinfo,
154 [__NR_ipc] sys_ni_syscall, /* sys_ipc */
155 [__NR_fsync] sys_fsync,
156 [__NR_sigreturn] sys_ni_syscall,
157 [__NR_clone] sys_ni_syscall, /* ppc_clone */
158 [__NR_setdomainname] sys_setdomainname,
159 [__NR_uname] ppc_newuname,
160 [__NR_modify_ldt] sys_ni_syscall,
161 [__NR_adjtimex] sys_adjtimex,
162 [__NR_mprotect] sys_mprotect,
163 [__NR_sigprocmask] sys_ni_syscall,
164 [__NR_create_module] sys_ni_syscall,
165 [__NR_init_module] sys_ni_syscall, /* sys_init_module */
166 [__NR_delete_module] sys_ni_syscall, /* sys_delete_module */
167 [__NR_get_kernel_syms] sys_ni_syscall,
168 [__NR_quotactl] sys_ni_syscall, /* sys_quotactl */
169 [__NR_getpgid] sys_getpgid,
170 [__NR_fchdir] sys_fchdir,
171 [__NR_bdflush] sys_bdflush,
172 [__NR_sysfs] sys_ni_syscall, /* sys_sysfs */
173 [__NR_personality] ppc64_personality,
174 [__NR_afs_syscall] sys_ni_syscall,
175 [__NR_setfsuid] sys_setfsuid,
176 [__NR_setfsgid] sys_setfsgid,
177 [__NR__llseek] sys_llseek,
178 [__NR_getdents] sys_getdents,
179 [__NR__newselect] sys_select,
180 [__NR_flock] sys_flock,
181 [__NR_msync] sys_msync,
182 [__NR_readv] sys_readv,
183 [__NR_writev] sys_writev,
184 [__NR_getsid] sys_getsid,
185 [__NR_fdatasync] sys_fdatasync,
186 [__NR__sysctl] sys_ni_syscall, /* sys_sysctl */
187 [__NR_mlock] sys_mlock,
188 [__NR_munlock] sys_munlock,
189 [__NR_mlockall] sys_mlockall,
190 [__NR_munlockall] sys_munlockall,
191 [__NR_sched_setparam] sys_sched_setparam,
192 [__NR_sched_getparam] sys_sched_getparam,
193 [__NR_sched_setscheduler] sys_sched_setscheduler,
194 [__NR_sched_getscheduler] sys_sched_getscheduler,
195 [__NR_sched_yield] sys_sched_yield,
196 [__NR_sched_get_priority_max] sys_sched_get_priority_max,
197 [__NR_sched_get_priority_min] sys_sched_get_priority_min,
198 [__NR_sched_rr_get_interval] sys_sched_rr_get_interval,
199 [__NR_nanosleep] sys_nanosleep,
200 [__NR_mremap] sys_mremap,
201 [__NR_setresuid] sys_setresuid,
202 [__NR_getresuid] sys_getresuid,
203 [__NR_query_module] sys_ni_syscall,
204 [__NR_poll] sys_poll,
205 [__NR_nfsservctl] sys_ni_syscall, /* sys_nfsservctl */
206 [__NR_setresgid] sys_setresgid,
207 [__NR_getresgid] sys_getresgid,
208 [__NR_prctl] sys_prctl,
209 [__NR_rt_sigreturn] sys_ni_syscall, /* ppc64_rt_sigreturn */
210 [__NR_rt_sigaction] sys_ni_syscall, /* sys_rt_sigaction */
211 [__NR_rt_sigprocmask] sys_ni_syscall, /* sys_rt_sigprocmask */
212 [__NR_rt_sigpending] sys_ni_syscall, /* sys_rt_sigpending */
213 [__NR_rt_sigtimedwait] sys_ni_syscall, /* sys_rt_sigtimedwait */
214 [__NR_rt_sigqueueinfo] sys_ni_syscall, /* sys_rt_sigqueueinfo */
215 [__NR_rt_sigsuspend] sys_ni_syscall, /* sys_rt_sigsuspend */
216 [__NR_pread64] sys_pread64,
217 [__NR_pwrite64] sys_pwrite64,
218 [__NR_chown] sys_chown,
219 [__NR_getcwd] sys_getcwd,
220 [__NR_capget] sys_capget,
221 [__NR_capset] sys_capset,
222 [__NR_sigaltstack] sys_ni_syscall, /* sys_sigaltstack */
223 [__NR_sendfile] sys_sendfile64,
224 [__NR_getpmsg] sys_ni_syscall,
225 [__NR_putpmsg] sys_ni_syscall,
226 [__NR_vfork] sys_ni_syscall, /* ppc_vfork */
227 [__NR_ugetrlimit] sys_getrlimit,
228 [__NR_readahead] sys_readahead,
229 [192] sys_ni_syscall,
230 [193] sys_ni_syscall,
231 [194] sys_ni_syscall,
232 [195] sys_ni_syscall,
233 [196] sys_ni_syscall,
234 [197] sys_ni_syscall,
235 [__NR_pciconfig_read] sys_ni_syscall, /* sys_pciconfig_read */
236 [__NR_pciconfig_write] sys_ni_syscall, /* sys_pciconfig_write */
237 [__NR_pciconfig_iobase] sys_ni_syscall, /* sys_pciconfig_iobase */
238 [__NR_multiplexer] sys_ni_syscall,
239 [__NR_getdents64] sys_getdents64,
240 [__NR_pivot_root] sys_pivot_root,
241 [204] sys_ni_syscall,
242 [__NR_madvise] sys_madvise,
243 [__NR_mincore] sys_mincore,
244 [__NR_gettid] sys_gettid,
245 [__NR_tkill] sys_tkill,
246 [__NR_setxattr] sys_setxattr,
247 [__NR_lsetxattr] sys_lsetxattr,
248 [__NR_fsetxattr] sys_fsetxattr,
249 [__NR_getxattr] sys_getxattr,
250 [__NR_lgetxattr] sys_lgetxattr,
251 [__NR_fgetxattr] sys_fgetxattr,
252 [__NR_listxattr] sys_listxattr,
253 [__NR_llistxattr] sys_llistxattr,
254 [__NR_flistxattr] sys_flistxattr,
255 [__NR_removexattr] sys_removexattr,
256 [__NR_lremovexattr] sys_lremovexattr,
257 [__NR_fremovexattr] sys_fremovexattr,
258 [__NR_futex] sys_futex,
259 [__NR_sched_setaffinity] sys_sched_setaffinity,
260 [__NR_sched_getaffinity] sys_sched_getaffinity,
261 [__NR_tuxcall] sys_ni_syscall,
262 [226] sys_ni_syscall,
263 [__NR_io_setup] sys_io_setup,
264 [__NR_io_destroy] sys_io_destroy,
265 [__NR_io_getevents] sys_io_getevents,
266 [__NR_io_submit] sys_io_submit,
267 [__NR_io_cancel] sys_io_cancel,
268 [__NR_set_tid_address] sys_ni_syscall, /* sys_set_tid_address */
269 [__NR_fadvise64] sys_fadvise64,
270 [__NR_exit_group] sys_ni_syscall, /* sys_exit_group */
271 [__NR_lookup_dcookie] sys_ni_syscall, /* sys_lookup_dcookie */
272 [__NR_epoll_create] sys_epoll_create,
273 [__NR_epoll_ctl] sys_epoll_ctl,
274 [__NR_epoll_wait] sys_epoll_wait,
275 [__NR_remap_file_pages] sys_remap_file_pages,
276 [__NR_timer_create] sys_timer_create,
277 [__NR_timer_settime] sys_timer_settime,
278 [__NR_timer_gettime] sys_timer_gettime,
279 [__NR_timer_getoverrun] sys_timer_getoverrun,
280 [__NR_timer_delete] sys_timer_delete,
281 [__NR_clock_settime] sys_clock_settime,
282 [__NR_clock_gettime] sys_clock_gettime,
283 [__NR_clock_getres] sys_clock_getres,
284 [__NR_clock_nanosleep] sys_clock_nanosleep,
285 [__NR_swapcontext] sys_ni_syscall, /* ppc64_swapcontext */
286 [__NR_tgkill] sys_tgkill,
287 [__NR_utimes] sys_utimes,
288 [__NR_statfs64] sys_statfs64,
289 [__NR_fstatfs64] sys_fstatfs64,
290 [254] sys_ni_syscall,
291 [__NR_rtas] ppc_rtas,
292 [256] sys_ni_syscall,
293 [257] sys_ni_syscall,
294 [258] sys_ni_syscall,
295 [__NR_mbind] sys_ni_syscall, /* sys_mbind */
296 [__NR_get_mempolicy] sys_ni_syscall, /* sys_get_mempolicy */
297 [__NR_set_mempolicy] sys_ni_syscall, /* sys_set_mempolicy */
298 [__NR_mq_open] sys_ni_syscall, /* sys_mq_open */
299 [__NR_mq_unlink] sys_ni_syscall, /* sys_mq_unlink */
300 [__NR_mq_timedsend] sys_ni_syscall, /* sys_mq_timedsend */
301 [__NR_mq_timedreceive] sys_ni_syscall, /* sys_mq_timedreceive */
302 [__NR_mq_notify] sys_ni_syscall, /* sys_mq_notify */
303 [__NR_mq_getsetattr] sys_ni_syscall, /* sys_mq_getsetattr */
304 [__NR_kexec_load] sys_ni_syscall, /* sys_kexec_load */
305 [__NR_add_key] sys_ni_syscall, /* sys_add_key */
306 [__NR_request_key] sys_ni_syscall, /* sys_request_key */
307 [__NR_keyctl] sys_ni_syscall, /* sys_keyctl */
308 [__NR_waitid] sys_ni_syscall, /* sys_waitid */
309 [__NR_ioprio_set] sys_ni_syscall, /* sys_ioprio_set */
310 [__NR_ioprio_get] sys_ni_syscall, /* sys_ioprio_get */
311 [__NR_inotify_init] sys_ni_syscall, /* sys_inotify_init */
312 [__NR_inotify_add_watch] sys_ni_syscall, /* sys_inotify_add_watch */
313 [__NR_inotify_rm_watch] sys_ni_syscall, /* sys_inotify_rm_watch */
314 [__NR_spu_run] sys_ni_syscall, /* sys_spu_run */
315 [__NR_spu_create] sys_ni_syscall, /* sys_spu_create */
316 [__NR_pselect6] sys_ni_syscall, /* sys_pselect */
317 [__NR_ppoll] sys_ni_syscall, /* sys_ppoll */
318 [__NR_unshare] sys_unshare,
319};
320
321long spu_sys_callback(struct spu_syscall_block *s)
322{
323 long (*syscall)(u64 a1, u64 a2, u64 a3, u64 a4, u64 a5, u64 a6);
324
325 BUILD_BUG_ON(ARRAY_SIZE(spu_syscall_table) != __NR_syscalls);
326
327 syscall = spu_syscall_table[s->nr_ret];
328
329 if (s->nr_ret >= __NR_syscalls) {
330 pr_debug("%s: invalid syscall #%ld", __FUNCTION__, s->nr_ret);
331 return -ENOSYS;
332 }
333
334#ifdef DEBUG
335 print_symbol(KERN_DEBUG "SPU-syscall %s:", (unsigned long)syscall);
336 printk("syscall%ld(%lx, %lx, %lx, %lx, %lx, %lx)\n",
337 s->nr_ret,
338 s->parm[0], s->parm[1], s->parm[2],
339 s->parm[3], s->parm[4], s->parm[5]);
340#endif
341
342 return syscall(s->parm[0], s->parm[1], s->parm[2],
343 s->parm[3], s->parm[4], s->parm[5]);
344}
345EXPORT_SYMBOL_GPL(spu_sys_callback);
diff --git a/arch/powerpc/platforms/cell/spufs/backing_ops.c b/arch/powerpc/platforms/cell/spufs/backing_ops.c
index a5c489a53c61..f1d35ddc9df3 100644
--- a/arch/powerpc/platforms/cell/spufs/backing_ops.c
+++ b/arch/powerpc/platforms/cell/spufs/backing_ops.c
@@ -285,6 +285,49 @@ static void spu_backing_runcntl_stop(struct spu_context *ctx)
285 spu_backing_runcntl_write(ctx, SPU_RUNCNTL_STOP); 285 spu_backing_runcntl_write(ctx, SPU_RUNCNTL_STOP);
286} 286}
287 287
288static int spu_backing_set_mfc_query(struct spu_context * ctx, u32 mask,
289 u32 mode)
290{
291 struct spu_problem_collapsed *prob = &ctx->csa.prob;
292 int ret;
293
294 spin_lock(&ctx->csa.register_lock);
295 ret = -EAGAIN;
296 if (prob->dma_querytype_RW)
297 goto out;
298 ret = 0;
299 /* FIXME: what are the side-effects of this? */
300 prob->dma_querymask_RW = mask;
301 prob->dma_querytype_RW = mode;
302out:
303 spin_unlock(&ctx->csa.register_lock);
304
305 return ret;
306}
307
308static u32 spu_backing_read_mfc_tagstatus(struct spu_context * ctx)
309{
310 return ctx->csa.prob.dma_tagstatus_R;
311}
312
313static u32 spu_backing_get_mfc_free_elements(struct spu_context *ctx)
314{
315 return ctx->csa.prob.dma_qstatus_R;
316}
317
318static int spu_backing_send_mfc_command(struct spu_context *ctx,
319 struct mfc_dma_command *cmd)
320{
321 int ret;
322
323 spin_lock(&ctx->csa.register_lock);
324 ret = -EAGAIN;
325 /* FIXME: set up priv2->puq */
326 spin_unlock(&ctx->csa.register_lock);
327
328 return ret;
329}
330
288struct spu_context_ops spu_backing_ops = { 331struct spu_context_ops spu_backing_ops = {
289 .mbox_read = spu_backing_mbox_read, 332 .mbox_read = spu_backing_mbox_read,
290 .mbox_stat_read = spu_backing_mbox_stat_read, 333 .mbox_stat_read = spu_backing_mbox_stat_read,
@@ -305,4 +348,8 @@ struct spu_context_ops spu_backing_ops = {
305 .get_ls = spu_backing_get_ls, 348 .get_ls = spu_backing_get_ls,
306 .runcntl_write = spu_backing_runcntl_write, 349 .runcntl_write = spu_backing_runcntl_write,
307 .runcntl_stop = spu_backing_runcntl_stop, 350 .runcntl_stop = spu_backing_runcntl_stop,
351 .set_mfc_query = spu_backing_set_mfc_query,
352 .read_mfc_tagstatus = spu_backing_read_mfc_tagstatus,
353 .get_mfc_free_elements = spu_backing_get_mfc_free_elements,
354 .send_mfc_command = spu_backing_send_mfc_command,
308}; 355};
diff --git a/arch/powerpc/platforms/cell/spufs/context.c b/arch/powerpc/platforms/cell/spufs/context.c
index 336f238102fd..8bb33abfad17 100644
--- a/arch/powerpc/platforms/cell/spufs/context.c
+++ b/arch/powerpc/platforms/cell/spufs/context.c
@@ -27,7 +27,7 @@
27#include <asm/spu_csa.h> 27#include <asm/spu_csa.h>
28#include "spufs.h" 28#include "spufs.h"
29 29
30struct spu_context *alloc_spu_context(struct address_space *local_store) 30struct spu_context *alloc_spu_context(void)
31{ 31{
32 struct spu_context *ctx; 32 struct spu_context *ctx;
33 ctx = kmalloc(sizeof *ctx, GFP_KERNEL); 33 ctx = kmalloc(sizeof *ctx, GFP_KERNEL);
@@ -47,10 +47,17 @@ struct spu_context *alloc_spu_context(struct address_space *local_store)
47 init_waitqueue_head(&ctx->ibox_wq); 47 init_waitqueue_head(&ctx->ibox_wq);
48 init_waitqueue_head(&ctx->wbox_wq); 48 init_waitqueue_head(&ctx->wbox_wq);
49 init_waitqueue_head(&ctx->stop_wq); 49 init_waitqueue_head(&ctx->stop_wq);
50 init_waitqueue_head(&ctx->mfc_wq);
50 ctx->ibox_fasync = NULL; 51 ctx->ibox_fasync = NULL;
51 ctx->wbox_fasync = NULL; 52 ctx->wbox_fasync = NULL;
53 ctx->mfc_fasync = NULL;
54 ctx->mfc = NULL;
55 ctx->tagwait = 0;
52 ctx->state = SPU_STATE_SAVED; 56 ctx->state = SPU_STATE_SAVED;
53 ctx->local_store = local_store; 57 ctx->local_store = NULL;
58 ctx->cntl = NULL;
59 ctx->signal1 = NULL;
60 ctx->signal2 = NULL;
54 ctx->spu = NULL; 61 ctx->spu = NULL;
55 ctx->ops = &spu_backing_ops; 62 ctx->ops = &spu_backing_ops;
56 ctx->owner = get_task_mm(current); 63 ctx->owner = get_task_mm(current);
@@ -68,8 +75,6 @@ void destroy_spu_context(struct kref *kref)
68 ctx = container_of(kref, struct spu_context, kref); 75 ctx = container_of(kref, struct spu_context, kref);
69 down_write(&ctx->state_sema); 76 down_write(&ctx->state_sema);
70 spu_deactivate(ctx); 77 spu_deactivate(ctx);
71 ctx->ibox_fasync = NULL;
72 ctx->wbox_fasync = NULL;
73 up_write(&ctx->state_sema); 78 up_write(&ctx->state_sema);
74 spu_fini_csa(&ctx->csa); 79 spu_fini_csa(&ctx->csa);
75 kfree(ctx); 80 kfree(ctx);
@@ -109,7 +114,16 @@ void spu_release(struct spu_context *ctx)
109 114
110void spu_unmap_mappings(struct spu_context *ctx) 115void spu_unmap_mappings(struct spu_context *ctx)
111{ 116{
112 unmap_mapping_range(ctx->local_store, 0, LS_SIZE, 1); 117 if (ctx->local_store)
118 unmap_mapping_range(ctx->local_store, 0, LS_SIZE, 1);
119 if (ctx->mfc)
120 unmap_mapping_range(ctx->mfc, 0, 0x4000, 1);
121 if (ctx->cntl)
122 unmap_mapping_range(ctx->cntl, 0, 0x4000, 1);
123 if (ctx->signal1)
124 unmap_mapping_range(ctx->signal1, 0, 0x4000, 1);
125 if (ctx->signal2)
126 unmap_mapping_range(ctx->signal2, 0, 0x4000, 1);
113} 127}
114 128
115int spu_acquire_runnable(struct spu_context *ctx) 129int spu_acquire_runnable(struct spu_context *ctx)
diff --git a/arch/powerpc/platforms/cell/spufs/file.c b/arch/powerpc/platforms/cell/spufs/file.c
index dfa649c9b956..366185e92667 100644
--- a/arch/powerpc/platforms/cell/spufs/file.c
+++ b/arch/powerpc/platforms/cell/spufs/file.c
@@ -20,6 +20,8 @@
20 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 20 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
21 */ 21 */
22 22
23#undef DEBUG
24
23#include <linux/fs.h> 25#include <linux/fs.h>
24#include <linux/ioctl.h> 26#include <linux/ioctl.h>
25#include <linux/module.h> 27#include <linux/module.h>
@@ -39,8 +41,10 @@ static int
39spufs_mem_open(struct inode *inode, struct file *file) 41spufs_mem_open(struct inode *inode, struct file *file)
40{ 42{
41 struct spufs_inode_info *i = SPUFS_I(inode); 43 struct spufs_inode_info *i = SPUFS_I(inode);
42 file->private_data = i->i_ctx; 44 struct spu_context *ctx = i->i_ctx;
43 file->f_mapping = i->i_ctx->local_store; 45 file->private_data = ctx;
46 file->f_mapping = inode->i_mapping;
47 ctx->local_store = inode->i_mapping;
44 return 0; 48 return 0;
45} 49}
46 50
@@ -84,7 +88,7 @@ spufs_mem_write(struct file *file, const char __user *buffer,
84 return ret; 88 return ret;
85} 89}
86 90
87#ifdef CONFIG_SPARSEMEM 91#ifdef CONFIG_SPUFS_MMAP
88static struct page * 92static struct page *
89spufs_mem_mmap_nopage(struct vm_area_struct *vma, 93spufs_mem_mmap_nopage(struct vm_area_struct *vma,
90 unsigned long address, int *type) 94 unsigned long address, int *type)
@@ -136,11 +140,113 @@ static struct file_operations spufs_mem_fops = {
136 .read = spufs_mem_read, 140 .read = spufs_mem_read,
137 .write = spufs_mem_write, 141 .write = spufs_mem_write,
138 .llseek = generic_file_llseek, 142 .llseek = generic_file_llseek,
139#ifdef CONFIG_SPARSEMEM 143#ifdef CONFIG_SPUFS_MMAP
140 .mmap = spufs_mem_mmap, 144 .mmap = spufs_mem_mmap,
141#endif 145#endif
142}; 146};
143 147
148#ifdef CONFIG_SPUFS_MMAP
149static struct page *spufs_ps_nopage(struct vm_area_struct *vma,
150 unsigned long address,
151 int *type, unsigned long ps_offs)
152{
153 struct page *page = NOPAGE_SIGBUS;
154 int fault_type = VM_FAULT_SIGBUS;
155 struct spu_context *ctx = vma->vm_file->private_data;
156 unsigned long offset = address - vma->vm_start;
157 unsigned long area;
158 int ret;
159
160 offset += vma->vm_pgoff << PAGE_SHIFT;
161 if (offset >= 0x4000)
162 goto out;
163
164 ret = spu_acquire_runnable(ctx);
165 if (ret)
166 goto out;
167
168 area = ctx->spu->problem_phys + ps_offs;
169 page = pfn_to_page((area + offset) >> PAGE_SHIFT);
170 fault_type = VM_FAULT_MINOR;
171 page_cache_get(page);
172
173 spu_release(ctx);
174
175 out:
176 if (type)
177 *type = fault_type;
178
179 return page;
180}
181
182static struct page *spufs_cntl_mmap_nopage(struct vm_area_struct *vma,
183 unsigned long address, int *type)
184{
185 return spufs_ps_nopage(vma, address, type, 0x4000);
186}
187
188static struct vm_operations_struct spufs_cntl_mmap_vmops = {
189 .nopage = spufs_cntl_mmap_nopage,
190};
191
192/*
193 * mmap support for problem state control area [0x4000 - 0x4fff].
194 * Mapping this area requires that the application have CAP_SYS_RAWIO,
195 * as these registers require special care when read/writing.
196 */
197static int spufs_cntl_mmap(struct file *file, struct vm_area_struct *vma)
198{
199 if (!(vma->vm_flags & VM_SHARED))
200 return -EINVAL;
201
202 if (!capable(CAP_SYS_RAWIO))
203 return -EPERM;
204
205 vma->vm_flags |= VM_RESERVED;
206 vma->vm_page_prot = __pgprot(pgprot_val(vma->vm_page_prot)
207 | _PAGE_NO_CACHE);
208
209 vma->vm_ops = &spufs_cntl_mmap_vmops;
210 return 0;
211}
212#endif
213
214static int spufs_cntl_open(struct inode *inode, struct file *file)
215{
216 struct spufs_inode_info *i = SPUFS_I(inode);
217 struct spu_context *ctx = i->i_ctx;
218
219 file->private_data = ctx;
220 file->f_mapping = inode->i_mapping;
221 ctx->cntl = inode->i_mapping;
222 return 0;
223}
224
225static ssize_t
226spufs_cntl_read(struct file *file, char __user *buffer,
227 size_t size, loff_t *pos)
228{
229 /* FIXME: read from spu status */
230 return -EINVAL;
231}
232
233static ssize_t
234spufs_cntl_write(struct file *file, const char __user *buffer,
235 size_t size, loff_t *pos)
236{
237 /* FIXME: write to runctl bit */
238 return -EINVAL;
239}
240
241static struct file_operations spufs_cntl_fops = {
242 .open = spufs_cntl_open,
243 .read = spufs_cntl_read,
244 .write = spufs_cntl_write,
245#ifdef CONFIG_SPUFS_MMAP
246 .mmap = spufs_cntl_mmap,
247#endif
248};
249
144static int 250static int
145spufs_regs_open(struct inode *inode, struct file *file) 251spufs_regs_open(struct inode *inode, struct file *file)
146{ 252{
@@ -501,6 +607,16 @@ static struct file_operations spufs_wbox_stat_fops = {
501 .read = spufs_wbox_stat_read, 607 .read = spufs_wbox_stat_read,
502}; 608};
503 609
610static int spufs_signal1_open(struct inode *inode, struct file *file)
611{
612 struct spufs_inode_info *i = SPUFS_I(inode);
613 struct spu_context *ctx = i->i_ctx;
614 file->private_data = ctx;
615 file->f_mapping = inode->i_mapping;
616 ctx->signal1 = inode->i_mapping;
617 return nonseekable_open(inode, file);
618}
619
504static ssize_t spufs_signal1_read(struct file *file, char __user *buf, 620static ssize_t spufs_signal1_read(struct file *file, char __user *buf,
505 size_t len, loff_t *pos) 621 size_t len, loff_t *pos)
506{ 622{
@@ -541,12 +657,50 @@ static ssize_t spufs_signal1_write(struct file *file, const char __user *buf,
541 return 4; 657 return 4;
542} 658}
543 659
660#ifdef CONFIG_SPUFS_MMAP
661static struct page *spufs_signal1_mmap_nopage(struct vm_area_struct *vma,
662 unsigned long address, int *type)
663{
664 return spufs_ps_nopage(vma, address, type, 0x14000);
665}
666
667static struct vm_operations_struct spufs_signal1_mmap_vmops = {
668 .nopage = spufs_signal1_mmap_nopage,
669};
670
671static int spufs_signal1_mmap(struct file *file, struct vm_area_struct *vma)
672{
673 if (!(vma->vm_flags & VM_SHARED))
674 return -EINVAL;
675
676 vma->vm_flags |= VM_RESERVED;
677 vma->vm_page_prot = __pgprot(pgprot_val(vma->vm_page_prot)
678 | _PAGE_NO_CACHE);
679
680 vma->vm_ops = &spufs_signal1_mmap_vmops;
681 return 0;
682}
683#endif
684
544static struct file_operations spufs_signal1_fops = { 685static struct file_operations spufs_signal1_fops = {
545 .open = spufs_pipe_open, 686 .open = spufs_signal1_open,
546 .read = spufs_signal1_read, 687 .read = spufs_signal1_read,
547 .write = spufs_signal1_write, 688 .write = spufs_signal1_write,
689#ifdef CONFIG_SPUFS_MMAP
690 .mmap = spufs_signal1_mmap,
691#endif
548}; 692};
549 693
694static int spufs_signal2_open(struct inode *inode, struct file *file)
695{
696 struct spufs_inode_info *i = SPUFS_I(inode);
697 struct spu_context *ctx = i->i_ctx;
698 file->private_data = ctx;
699 file->f_mapping = inode->i_mapping;
700 ctx->signal2 = inode->i_mapping;
701 return nonseekable_open(inode, file);
702}
703
550static ssize_t spufs_signal2_read(struct file *file, char __user *buf, 704static ssize_t spufs_signal2_read(struct file *file, char __user *buf,
551 size_t len, loff_t *pos) 705 size_t len, loff_t *pos)
552{ 706{
@@ -589,10 +743,39 @@ static ssize_t spufs_signal2_write(struct file *file, const char __user *buf,
589 return 4; 743 return 4;
590} 744}
591 745
746#ifdef CONFIG_SPUFS_MMAP
747static struct page *spufs_signal2_mmap_nopage(struct vm_area_struct *vma,
748 unsigned long address, int *type)
749{
750 return spufs_ps_nopage(vma, address, type, 0x1c000);
751}
752
753static struct vm_operations_struct spufs_signal2_mmap_vmops = {
754 .nopage = spufs_signal2_mmap_nopage,
755};
756
757static int spufs_signal2_mmap(struct file *file, struct vm_area_struct *vma)
758{
759 if (!(vma->vm_flags & VM_SHARED))
760 return -EINVAL;
761
762 /* FIXME: */
763 vma->vm_flags |= VM_RESERVED;
764 vma->vm_page_prot = __pgprot(pgprot_val(vma->vm_page_prot)
765 | _PAGE_NO_CACHE);
766
767 vma->vm_ops = &spufs_signal2_mmap_vmops;
768 return 0;
769}
770#endif
771
592static struct file_operations spufs_signal2_fops = { 772static struct file_operations spufs_signal2_fops = {
593 .open = spufs_pipe_open, 773 .open = spufs_signal2_open,
594 .read = spufs_signal2_read, 774 .read = spufs_signal2_read,
595 .write = spufs_signal2_write, 775 .write = spufs_signal2_write,
776#ifdef CONFIG_SPUFS_MMAP
777 .mmap = spufs_signal2_mmap,
778#endif
596}; 779};
597 780
598static void spufs_signal1_type_set(void *data, u64 val) 781static void spufs_signal1_type_set(void *data, u64 val)
@@ -641,6 +824,332 @@ static u64 spufs_signal2_type_get(void *data)
641DEFINE_SIMPLE_ATTRIBUTE(spufs_signal2_type, spufs_signal2_type_get, 824DEFINE_SIMPLE_ATTRIBUTE(spufs_signal2_type, spufs_signal2_type_get,
642 spufs_signal2_type_set, "%llu"); 825 spufs_signal2_type_set, "%llu");
643 826
827#ifdef CONFIG_SPUFS_MMAP
828static struct page *spufs_mfc_mmap_nopage(struct vm_area_struct *vma,
829 unsigned long address, int *type)
830{
831 return spufs_ps_nopage(vma, address, type, 0x3000);
832}
833
834static struct vm_operations_struct spufs_mfc_mmap_vmops = {
835 .nopage = spufs_mfc_mmap_nopage,
836};
837
838/*
839 * mmap support for problem state MFC DMA area [0x0000 - 0x0fff].
840 * Mapping this area requires that the application have CAP_SYS_RAWIO,
841 * as these registers require special care when read/writing.
842 */
843static int spufs_mfc_mmap(struct file *file, struct vm_area_struct *vma)
844{
845 if (!(vma->vm_flags & VM_SHARED))
846 return -EINVAL;
847
848 if (!capable(CAP_SYS_RAWIO))
849 return -EPERM;
850
851 vma->vm_flags |= VM_RESERVED;
852 vma->vm_page_prot = __pgprot(pgprot_val(vma->vm_page_prot)
853 | _PAGE_NO_CACHE);
854
855 vma->vm_ops = &spufs_mfc_mmap_vmops;
856 return 0;
857}
858#endif
859
860static int spufs_mfc_open(struct inode *inode, struct file *file)
861{
862 struct spufs_inode_info *i = SPUFS_I(inode);
863 struct spu_context *ctx = i->i_ctx;
864
865 /* we don't want to deal with DMA into other processes */
866 if (ctx->owner != current->mm)
867 return -EINVAL;
868
869 if (atomic_read(&inode->i_count) != 1)
870 return -EBUSY;
871
872 file->private_data = ctx;
873 return nonseekable_open(inode, file);
874}
875
876/* interrupt-level mfc callback function. */
877void spufs_mfc_callback(struct spu *spu)
878{
879 struct spu_context *ctx = spu->ctx;
880
881 wake_up_all(&ctx->mfc_wq);
882
883 pr_debug("%s %s\n", __FUNCTION__, spu->name);
884 if (ctx->mfc_fasync) {
885 u32 free_elements, tagstatus;
886 unsigned int mask;
887
888 /* no need for spu_acquire in interrupt context */
889 free_elements = ctx->ops->get_mfc_free_elements(ctx);
890 tagstatus = ctx->ops->read_mfc_tagstatus(ctx);
891
892 mask = 0;
893 if (free_elements & 0xffff)
894 mask |= POLLOUT;
895 if (tagstatus & ctx->tagwait)
896 mask |= POLLIN;
897
898 kill_fasync(&ctx->mfc_fasync, SIGIO, mask);
899 }
900}
901
902static int spufs_read_mfc_tagstatus(struct spu_context *ctx, u32 *status)
903{
904 /* See if there is one tag group is complete */
905 /* FIXME we need locking around tagwait */
906 *status = ctx->ops->read_mfc_tagstatus(ctx) & ctx->tagwait;
907 ctx->tagwait &= ~*status;
908 if (*status)
909 return 1;
910
911 /* enable interrupt waiting for any tag group,
912 may silently fail if interrupts are already enabled */
913 ctx->ops->set_mfc_query(ctx, ctx->tagwait, 1);
914 return 0;
915}
916
917static ssize_t spufs_mfc_read(struct file *file, char __user *buffer,
918 size_t size, loff_t *pos)
919{
920 struct spu_context *ctx = file->private_data;
921 int ret = -EINVAL;
922 u32 status;
923
924 if (size != 4)
925 goto out;
926
927 spu_acquire(ctx);
928 if (file->f_flags & O_NONBLOCK) {
929 status = ctx->ops->read_mfc_tagstatus(ctx);
930 if (!(status & ctx->tagwait))
931 ret = -EAGAIN;
932 else
933 ctx->tagwait &= ~status;
934 } else {
935 ret = spufs_wait(ctx->mfc_wq,
936 spufs_read_mfc_tagstatus(ctx, &status));
937 }
938 spu_release(ctx);
939
940 if (ret)
941 goto out;
942
943 ret = 4;
944 if (copy_to_user(buffer, &status, 4))
945 ret = -EFAULT;
946
947out:
948 return ret;
949}
950
951static int spufs_check_valid_dma(struct mfc_dma_command *cmd)
952{
953 pr_debug("queueing DMA %x %lx %x %x %x\n", cmd->lsa,
954 cmd->ea, cmd->size, cmd->tag, cmd->cmd);
955
956 switch (cmd->cmd) {
957 case MFC_PUT_CMD:
958 case MFC_PUTF_CMD:
959 case MFC_PUTB_CMD:
960 case MFC_GET_CMD:
961 case MFC_GETF_CMD:
962 case MFC_GETB_CMD:
963 break;
964 default:
965 pr_debug("invalid DMA opcode %x\n", cmd->cmd);
966 return -EIO;
967 }
968
969 if ((cmd->lsa & 0xf) != (cmd->ea &0xf)) {
970 pr_debug("invalid DMA alignment, ea %lx lsa %x\n",
971 cmd->ea, cmd->lsa);
972 return -EIO;
973 }
974
975 switch (cmd->size & 0xf) {
976 case 1:
977 break;
978 case 2:
979 if (cmd->lsa & 1)
980 goto error;
981 break;
982 case 4:
983 if (cmd->lsa & 3)
984 goto error;
985 break;
986 case 8:
987 if (cmd->lsa & 7)
988 goto error;
989 break;
990 case 0:
991 if (cmd->lsa & 15)
992 goto error;
993 break;
994 error:
995 default:
996 pr_debug("invalid DMA alignment %x for size %x\n",
997 cmd->lsa & 0xf, cmd->size);
998 return -EIO;
999 }
1000
1001 if (cmd->size > 16 * 1024) {
1002 pr_debug("invalid DMA size %x\n", cmd->size);
1003 return -EIO;
1004 }
1005
1006 if (cmd->tag & 0xfff0) {
1007 /* we reserve the higher tag numbers for kernel use */
1008 pr_debug("invalid DMA tag\n");
1009 return -EIO;
1010 }
1011
1012 if (cmd->class) {
1013 /* not supported in this version */
1014 pr_debug("invalid DMA class\n");
1015 return -EIO;
1016 }
1017
1018 return 0;
1019}
1020
1021static int spu_send_mfc_command(struct spu_context *ctx,
1022 struct mfc_dma_command cmd,
1023 int *error)
1024{
1025 *error = ctx->ops->send_mfc_command(ctx, &cmd);
1026 if (*error == -EAGAIN) {
1027 /* wait for any tag group to complete
1028 so we have space for the new command */
1029 ctx->ops->set_mfc_query(ctx, ctx->tagwait, 1);
1030 /* try again, because the queue might be
1031 empty again */
1032 *error = ctx->ops->send_mfc_command(ctx, &cmd);
1033 if (*error == -EAGAIN)
1034 return 0;
1035 }
1036 return 1;
1037}
1038
1039static ssize_t spufs_mfc_write(struct file *file, const char __user *buffer,
1040 size_t size, loff_t *pos)
1041{
1042 struct spu_context *ctx = file->private_data;
1043 struct mfc_dma_command cmd;
1044 int ret = -EINVAL;
1045
1046 if (size != sizeof cmd)
1047 goto out;
1048
1049 ret = -EFAULT;
1050 if (copy_from_user(&cmd, buffer, sizeof cmd))
1051 goto out;
1052
1053 ret = spufs_check_valid_dma(&cmd);
1054 if (ret)
1055 goto out;
1056
1057 spu_acquire_runnable(ctx);
1058 if (file->f_flags & O_NONBLOCK) {
1059 ret = ctx->ops->send_mfc_command(ctx, &cmd);
1060 } else {
1061 int status;
1062 ret = spufs_wait(ctx->mfc_wq,
1063 spu_send_mfc_command(ctx, cmd, &status));
1064 if (status)
1065 ret = status;
1066 }
1067 spu_release(ctx);
1068
1069 if (ret)
1070 goto out;
1071
1072 ctx->tagwait |= 1 << cmd.tag;
1073
1074out:
1075 return ret;
1076}
1077
1078static unsigned int spufs_mfc_poll(struct file *file,poll_table *wait)
1079{
1080 struct spu_context *ctx = file->private_data;
1081 u32 free_elements, tagstatus;
1082 unsigned int mask;
1083
1084 spu_acquire(ctx);
1085 ctx->ops->set_mfc_query(ctx, ctx->tagwait, 2);
1086 free_elements = ctx->ops->get_mfc_free_elements(ctx);
1087 tagstatus = ctx->ops->read_mfc_tagstatus(ctx);
1088 spu_release(ctx);
1089
1090 poll_wait(file, &ctx->mfc_wq, wait);
1091
1092 mask = 0;
1093 if (free_elements & 0xffff)
1094 mask |= POLLOUT | POLLWRNORM;
1095 if (tagstatus & ctx->tagwait)
1096 mask |= POLLIN | POLLRDNORM;
1097
1098 pr_debug("%s: free %d tagstatus %d tagwait %d\n", __FUNCTION__,
1099 free_elements, tagstatus, ctx->tagwait);
1100
1101 return mask;
1102}
1103
1104static int spufs_mfc_flush(struct file *file)
1105{
1106 struct spu_context *ctx = file->private_data;
1107 int ret;
1108
1109 spu_acquire(ctx);
1110#if 0
1111/* this currently hangs */
1112 ret = spufs_wait(ctx->mfc_wq,
1113 ctx->ops->set_mfc_query(ctx, ctx->tagwait, 2));
1114 if (ret)
1115 goto out;
1116 ret = spufs_wait(ctx->mfc_wq,
1117 ctx->ops->read_mfc_tagstatus(ctx) == ctx->tagwait);
1118out:
1119#else
1120 ret = 0;
1121#endif
1122 spu_release(ctx);
1123
1124 return ret;
1125}
1126
1127static int spufs_mfc_fsync(struct file *file, struct dentry *dentry,
1128 int datasync)
1129{
1130 return spufs_mfc_flush(file);
1131}
1132
1133static int spufs_mfc_fasync(int fd, struct file *file, int on)
1134{
1135 struct spu_context *ctx = file->private_data;
1136
1137 return fasync_helper(fd, file, on, &ctx->mfc_fasync);
1138}
1139
1140static struct file_operations spufs_mfc_fops = {
1141 .open = spufs_mfc_open,
1142 .read = spufs_mfc_read,
1143 .write = spufs_mfc_write,
1144 .poll = spufs_mfc_poll,
1145 .flush = spufs_mfc_flush,
1146 .fsync = spufs_mfc_fsync,
1147 .fasync = spufs_mfc_fasync,
1148#ifdef CONFIG_SPUFS_MMAP
1149 .mmap = spufs_mfc_mmap,
1150#endif
1151};
1152
644static void spufs_npc_set(void *data, u64 val) 1153static void spufs_npc_set(void *data, u64 val)
645{ 1154{
646 struct spu_context *ctx = data; 1155 struct spu_context *ctx = data;
@@ -783,6 +1292,8 @@ struct tree_descr spufs_dir_contents[] = {
783 { "signal2", &spufs_signal2_fops, 0666, }, 1292 { "signal2", &spufs_signal2_fops, 0666, },
784 { "signal1_type", &spufs_signal1_type, 0666, }, 1293 { "signal1_type", &spufs_signal1_type, 0666, },
785 { "signal2_type", &spufs_signal2_type, 0666, }, 1294 { "signal2_type", &spufs_signal2_type, 0666, },
1295 { "mfc", &spufs_mfc_fops, 0666, },
1296 { "cntl", &spufs_cntl_fops, 0666, },
786 { "npc", &spufs_npc_ops, 0666, }, 1297 { "npc", &spufs_npc_ops, 0666, },
787 { "fpcr", &spufs_fpcr_fops, 0666, }, 1298 { "fpcr", &spufs_fpcr_fops, 0666, },
788 { "decr", &spufs_decr_ops, 0666, }, 1299 { "decr", &spufs_decr_ops, 0666, },
diff --git a/arch/powerpc/platforms/cell/spufs/hw_ops.c b/arch/powerpc/platforms/cell/spufs/hw_ops.c
index 5445719bff79..a13a8b5a014d 100644
--- a/arch/powerpc/platforms/cell/spufs/hw_ops.c
+++ b/arch/powerpc/platforms/cell/spufs/hw_ops.c
@@ -232,6 +232,59 @@ static void spu_hw_runcntl_stop(struct spu_context *ctx)
232 spin_unlock_irq(&ctx->spu->register_lock); 232 spin_unlock_irq(&ctx->spu->register_lock);
233} 233}
234 234
235static int spu_hw_set_mfc_query(struct spu_context * ctx, u32 mask, u32 mode)
236{
237 struct spu_problem *prob = ctx->spu->problem;
238 int ret;
239
240 spin_lock_irq(&ctx->spu->register_lock);
241 ret = -EAGAIN;
242 if (in_be32(&prob->dma_querytype_RW))
243 goto out;
244 ret = 0;
245 out_be32(&prob->dma_querymask_RW, mask);
246 out_be32(&prob->dma_querytype_RW, mode);
247out:
248 spin_unlock_irq(&ctx->spu->register_lock);
249 return ret;
250}
251
252static u32 spu_hw_read_mfc_tagstatus(struct spu_context * ctx)
253{
254 return in_be32(&ctx->spu->problem->dma_tagstatus_R);
255}
256
257static u32 spu_hw_get_mfc_free_elements(struct spu_context *ctx)
258{
259 return in_be32(&ctx->spu->problem->dma_qstatus_R);
260}
261
262static int spu_hw_send_mfc_command(struct spu_context *ctx,
263 struct mfc_dma_command *cmd)
264{
265 u32 status;
266 struct spu_problem *prob = ctx->spu->problem;
267
268 spin_lock_irq(&ctx->spu->register_lock);
269 out_be32(&prob->mfc_lsa_W, cmd->lsa);
270 out_be64(&prob->mfc_ea_W, cmd->ea);
271 out_be32(&prob->mfc_union_W.by32.mfc_size_tag32,
272 cmd->size << 16 | cmd->tag);
273 out_be32(&prob->mfc_union_W.by32.mfc_class_cmd32,
274 cmd->class << 16 | cmd->cmd);
275 status = in_be32(&prob->mfc_union_W.by32.mfc_class_cmd32);
276 spin_unlock_irq(&ctx->spu->register_lock);
277
278 switch (status & 0xffff) {
279 case 0:
280 return 0;
281 case 2:
282 return -EAGAIN;
283 default:
284 return -EINVAL;
285 }
286}
287
235struct spu_context_ops spu_hw_ops = { 288struct spu_context_ops spu_hw_ops = {
236 .mbox_read = spu_hw_mbox_read, 289 .mbox_read = spu_hw_mbox_read,
237 .mbox_stat_read = spu_hw_mbox_stat_read, 290 .mbox_stat_read = spu_hw_mbox_stat_read,
@@ -252,4 +305,8 @@ struct spu_context_ops spu_hw_ops = {
252 .get_ls = spu_hw_get_ls, 305 .get_ls = spu_hw_get_ls,
253 .runcntl_write = spu_hw_runcntl_write, 306 .runcntl_write = spu_hw_runcntl_write,
254 .runcntl_stop = spu_hw_runcntl_stop, 307 .runcntl_stop = spu_hw_runcntl_stop,
308 .set_mfc_query = spu_hw_set_mfc_query,
309 .read_mfc_tagstatus = spu_hw_read_mfc_tagstatus,
310 .get_mfc_free_elements = spu_hw_get_mfc_free_elements,
311 .send_mfc_command = spu_hw_send_mfc_command,
255}; 312};
diff --git a/arch/powerpc/platforms/cell/spufs/inode.c b/arch/powerpc/platforms/cell/spufs/inode.c
index b3962c3a0348..d9554199afa7 100644
--- a/arch/powerpc/platforms/cell/spufs/inode.c
+++ b/arch/powerpc/platforms/cell/spufs/inode.c
@@ -103,7 +103,7 @@ spufs_setattr(struct dentry *dentry, struct iattr *attr)
103 103
104static int 104static int
105spufs_new_file(struct super_block *sb, struct dentry *dentry, 105spufs_new_file(struct super_block *sb, struct dentry *dentry,
106 struct file_operations *fops, int mode, 106 const struct file_operations *fops, int mode,
107 struct spu_context *ctx) 107 struct spu_context *ctx)
108{ 108{
109 static struct inode_operations spufs_file_iops = { 109 static struct inode_operations spufs_file_iops = {
@@ -241,7 +241,7 @@ spufs_mkdir(struct inode *dir, struct dentry *dentry, int mode)
241 inode->i_gid = dir->i_gid; 241 inode->i_gid = dir->i_gid;
242 inode->i_mode &= S_ISGID; 242 inode->i_mode &= S_ISGID;
243 } 243 }
244 ctx = alloc_spu_context(inode->i_mapping); 244 ctx = alloc_spu_context();
245 SPUFS_I(inode)->i_ctx = ctx; 245 SPUFS_I(inode)->i_ctx = ctx;
246 if (!ctx) 246 if (!ctx)
247 goto out_iput; 247 goto out_iput;
@@ -442,7 +442,7 @@ static struct file_system_type spufs_type = {
442 .kill_sb = kill_litter_super, 442 .kill_sb = kill_litter_super,
443}; 443};
444 444
445static int spufs_init(void) 445static int __init spufs_init(void)
446{ 446{
447 int ret; 447 int ret;
448 ret = -ENOMEM; 448 ret = -ENOMEM;
@@ -472,7 +472,7 @@ out:
472} 472}
473module_init(spufs_init); 473module_init(spufs_init);
474 474
475static void spufs_exit(void) 475static void __exit spufs_exit(void)
476{ 476{
477 spu_sched_exit(); 477 spu_sched_exit();
478 unregister_spu_syscalls(&spufs_calls); 478 unregister_spu_syscalls(&spufs_calls);
diff --git a/arch/powerpc/platforms/cell/spufs/run.c b/arch/powerpc/platforms/cell/spufs/run.c
index 18ea8866c61a..c04e078c0fe5 100644
--- a/arch/powerpc/platforms/cell/spufs/run.c
+++ b/arch/powerpc/platforms/cell/spufs/run.c
@@ -76,6 +76,90 @@ static inline int spu_reacquire_runnable(struct spu_context *ctx, u32 *npc,
76 return 0; 76 return 0;
77} 77}
78 78
79/*
80 * SPU syscall restarting is tricky because we violate the basic
81 * assumption that the signal handler is running on the interrupted
82 * thread. Here instead, the handler runs on PowerPC user space code,
83 * while the syscall was called from the SPU.
84 * This means we can only do a very rough approximation of POSIX
85 * signal semantics.
86 */
87int spu_handle_restartsys(struct spu_context *ctx, long *spu_ret,
88 unsigned int *npc)
89{
90 int ret;
91
92 switch (*spu_ret) {
93 case -ERESTARTSYS:
94 case -ERESTARTNOINTR:
95 /*
96 * Enter the regular syscall restarting for
97 * sys_spu_run, then restart the SPU syscall
98 * callback.
99 */
100 *npc -= 8;
101 ret = -ERESTARTSYS;
102 break;
103 case -ERESTARTNOHAND:
104 case -ERESTART_RESTARTBLOCK:
105 /*
106 * Restart block is too hard for now, just return -EINTR
107 * to the SPU.
108 * ERESTARTNOHAND comes from sys_pause, we also return
109 * -EINTR from there.
110 * Assume that we need to be restarted ourselves though.
111 */
112 *spu_ret = -EINTR;
113 ret = -ERESTARTSYS;
114 break;
115 default:
116 printk(KERN_WARNING "%s: unexpected return code %ld\n",
117 __FUNCTION__, *spu_ret);
118 ret = 0;
119 }
120 return ret;
121}
122
123int spu_process_callback(struct spu_context *ctx)
124{
125 struct spu_syscall_block s;
126 u32 ls_pointer, npc;
127 char *ls;
128 long spu_ret;
129 int ret;
130
131 /* get syscall block from local store */
132 npc = ctx->ops->npc_read(ctx);
133 ls = ctx->ops->get_ls(ctx);
134 ls_pointer = *(u32*)(ls + npc);
135 if (ls_pointer > (LS_SIZE - sizeof(s)))
136 return -EFAULT;
137 memcpy(&s, ls + ls_pointer, sizeof (s));
138
139 /* do actual syscall without pinning the spu */
140 ret = 0;
141 spu_ret = -ENOSYS;
142 npc += 4;
143
144 if (s.nr_ret < __NR_syscalls) {
145 spu_release(ctx);
146 /* do actual system call from here */
147 spu_ret = spu_sys_callback(&s);
148 if (spu_ret <= -ERESTARTSYS) {
149 ret = spu_handle_restartsys(ctx, &spu_ret, &npc);
150 }
151 spu_acquire(ctx);
152 if (ret == -ERESTARTSYS)
153 return ret;
154 }
155
156 /* write result, jump over indirect pointer */
157 memcpy(ls + ls_pointer, &spu_ret, sizeof (spu_ret));
158 ctx->ops->npc_write(ctx, npc);
159 ctx->ops->runcntl_write(ctx, SPU_RUNCNTL_RUNNABLE);
160 return ret;
161}
162
79static inline int spu_process_events(struct spu_context *ctx) 163static inline int spu_process_events(struct spu_context *ctx)
80{ 164{
81 struct spu *spu = ctx->spu; 165 struct spu *spu = ctx->spu;
@@ -107,6 +191,13 @@ long spufs_run_spu(struct file *file, struct spu_context *ctx,
107 ret = spufs_wait(ctx->stop_wq, spu_stopped(ctx, status)); 191 ret = spufs_wait(ctx->stop_wq, spu_stopped(ctx, status));
108 if (unlikely(ret)) 192 if (unlikely(ret))
109 break; 193 break;
194 if ((*status & SPU_STATUS_STOPPED_BY_STOP) &&
195 (*status >> SPU_STOP_STATUS_SHIFT == 0x2104)) {
196 ret = spu_process_callback(ctx);
197 if (ret)
198 break;
199 *status &= ~SPU_STATUS_STOPPED_BY_STOP;
200 }
110 if (unlikely(ctx->state != SPU_STATE_RUNNABLE)) { 201 if (unlikely(ctx->state != SPU_STATE_RUNNABLE)) {
111 ret = spu_reacquire_runnable(ctx, npc, status); 202 ret = spu_reacquire_runnable(ctx, npc, status);
112 if (ret) 203 if (ret)
diff --git a/arch/powerpc/platforms/cell/spufs/sched.c b/arch/powerpc/platforms/cell/spufs/sched.c
index 963182fbd1aa..bf652cd77000 100644
--- a/arch/powerpc/platforms/cell/spufs/sched.c
+++ b/arch/powerpc/platforms/cell/spufs/sched.c
@@ -180,6 +180,7 @@ static inline void bind_context(struct spu *spu, struct spu_context *ctx)
180 spu->ibox_callback = spufs_ibox_callback; 180 spu->ibox_callback = spufs_ibox_callback;
181 spu->wbox_callback = spufs_wbox_callback; 181 spu->wbox_callback = spufs_wbox_callback;
182 spu->stop_callback = spufs_stop_callback; 182 spu->stop_callback = spufs_stop_callback;
183 spu->mfc_callback = spufs_mfc_callback;
183 mb(); 184 mb();
184 spu_unmap_mappings(ctx); 185 spu_unmap_mappings(ctx);
185 spu_restore(&ctx->csa, spu); 186 spu_restore(&ctx->csa, spu);
@@ -197,6 +198,7 @@ static inline void unbind_context(struct spu *spu, struct spu_context *ctx)
197 spu->ibox_callback = NULL; 198 spu->ibox_callback = NULL;
198 spu->wbox_callback = NULL; 199 spu->wbox_callback = NULL;
199 spu->stop_callback = NULL; 200 spu->stop_callback = NULL;
201 spu->mfc_callback = NULL;
200 spu->mm = NULL; 202 spu->mm = NULL;
201 spu->pid = 0; 203 spu->pid = 0;
202 spu->prio = MAX_PRIO; 204 spu->prio = MAX_PRIO;
diff --git a/arch/powerpc/platforms/cell/spufs/spufs.h b/arch/powerpc/platforms/cell/spufs/spufs.h
index db2601f0abd5..4485738e2102 100644
--- a/arch/powerpc/platforms/cell/spufs/spufs.h
+++ b/arch/powerpc/platforms/cell/spufs/spufs.h
@@ -43,7 +43,11 @@ struct spu_context {
43 struct spu *spu; /* pointer to a physical SPU */ 43 struct spu *spu; /* pointer to a physical SPU */
44 struct spu_state csa; /* SPU context save area. */ 44 struct spu_state csa; /* SPU context save area. */
45 spinlock_t mmio_lock; /* protects mmio access */ 45 spinlock_t mmio_lock; /* protects mmio access */
46 struct address_space *local_store;/* local store backing store */ 46 struct address_space *local_store; /* local store mapping. */
47 struct address_space *mfc; /* 'mfc' area mappings. */
48 struct address_space *cntl; /* 'control' area mappings. */
49 struct address_space *signal1; /* 'signal1' area mappings. */
50 struct address_space *signal2; /* 'signal2' area mappings. */
47 51
48 enum { SPU_STATE_RUNNABLE, SPU_STATE_SAVED } state; 52 enum { SPU_STATE_RUNNABLE, SPU_STATE_SAVED } state;
49 struct rw_semaphore state_sema; 53 struct rw_semaphore state_sema;
@@ -55,13 +59,27 @@ struct spu_context {
55 wait_queue_head_t ibox_wq; 59 wait_queue_head_t ibox_wq;
56 wait_queue_head_t wbox_wq; 60 wait_queue_head_t wbox_wq;
57 wait_queue_head_t stop_wq; 61 wait_queue_head_t stop_wq;
62 wait_queue_head_t mfc_wq;
58 struct fasync_struct *ibox_fasync; 63 struct fasync_struct *ibox_fasync;
59 struct fasync_struct *wbox_fasync; 64 struct fasync_struct *wbox_fasync;
65 struct fasync_struct *mfc_fasync;
66 u32 tagwait;
60 struct spu_context_ops *ops; 67 struct spu_context_ops *ops;
61 struct work_struct reap_work; 68 struct work_struct reap_work;
62 u64 flags; 69 u64 flags;
63}; 70};
64 71
72struct mfc_dma_command {
73 int32_t pad; /* reserved */
74 uint32_t lsa; /* local storage address */
75 uint64_t ea; /* effective address */
76 uint16_t size; /* transfer size */
77 uint16_t tag; /* command tag */
78 uint16_t class; /* class ID */
79 uint16_t cmd; /* command opcode */
80};
81
82
65/* SPU context query/set operations. */ 83/* SPU context query/set operations. */
66struct spu_context_ops { 84struct spu_context_ops {
67 int (*mbox_read) (struct spu_context * ctx, u32 * data); 85 int (*mbox_read) (struct spu_context * ctx, u32 * data);
@@ -84,6 +102,11 @@ struct spu_context_ops {
84 char*(*get_ls) (struct spu_context * ctx); 102 char*(*get_ls) (struct spu_context * ctx);
85 void (*runcntl_write) (struct spu_context * ctx, u32 data); 103 void (*runcntl_write) (struct spu_context * ctx, u32 data);
86 void (*runcntl_stop) (struct spu_context * ctx); 104 void (*runcntl_stop) (struct spu_context * ctx);
105 int (*set_mfc_query)(struct spu_context * ctx, u32 mask, u32 mode);
106 u32 (*read_mfc_tagstatus)(struct spu_context * ctx);
107 u32 (*get_mfc_free_elements)(struct spu_context *ctx);
108 int (*send_mfc_command)(struct spu_context *ctx,
109 struct mfc_dma_command *cmd);
87}; 110};
88 111
89extern struct spu_context_ops spu_hw_ops; 112extern struct spu_context_ops spu_hw_ops;
@@ -106,7 +129,7 @@ long spufs_create_thread(struct nameidata *nd,
106extern struct file_operations spufs_context_fops; 129extern struct file_operations spufs_context_fops;
107 130
108/* context management */ 131/* context management */
109struct spu_context * alloc_spu_context(struct address_space *local_store); 132struct spu_context * alloc_spu_context(void);
110void destroy_spu_context(struct kref *kref); 133void destroy_spu_context(struct kref *kref);
111struct spu_context * get_spu_context(struct spu_context *ctx); 134struct spu_context * get_spu_context(struct spu_context *ctx);
112int put_spu_context(struct spu_context *ctx); 135int put_spu_context(struct spu_context *ctx);
@@ -159,5 +182,6 @@ size_t spu_ibox_read(struct spu_context *ctx, u32 *data);
159void spufs_ibox_callback(struct spu *spu); 182void spufs_ibox_callback(struct spu *spu);
160void spufs_wbox_callback(struct spu *spu); 183void spufs_wbox_callback(struct spu *spu);
161void spufs_stop_callback(struct spu *spu); 184void spufs_stop_callback(struct spu *spu);
185void spufs_mfc_callback(struct spu *spu);
162 186
163#endif 187#endif
diff --git a/arch/powerpc/platforms/cell/spufs/switch.c b/arch/powerpc/platforms/cell/spufs/switch.c
index 212db28531fa..97898d5d34e5 100644
--- a/arch/powerpc/platforms/cell/spufs/switch.c
+++ b/arch/powerpc/platforms/cell/spufs/switch.c
@@ -2145,7 +2145,8 @@ static void init_priv1(struct spu_state *csa)
2145 csa->priv1.int_mask_class1_RW = CLASS1_ENABLE_SEGMENT_FAULT_INTR | 2145 csa->priv1.int_mask_class1_RW = CLASS1_ENABLE_SEGMENT_FAULT_INTR |
2146 CLASS1_ENABLE_STORAGE_FAULT_INTR; 2146 CLASS1_ENABLE_STORAGE_FAULT_INTR;
2147 csa->priv1.int_mask_class2_RW = CLASS2_ENABLE_SPU_STOP_INTR | 2147 csa->priv1.int_mask_class2_RW = CLASS2_ENABLE_SPU_STOP_INTR |
2148 CLASS2_ENABLE_SPU_HALT_INTR; 2148 CLASS2_ENABLE_SPU_HALT_INTR |
2149 CLASS2_ENABLE_SPU_DMA_TAG_GROUP_COMPLETE_INTR;
2149} 2150}
2150 2151
2151static void init_priv2(struct spu_state *csa) 2152static void init_priv2(struct spu_state *csa)
diff --git a/arch/powerpc/platforms/chrp/chrp.h b/arch/powerpc/platforms/chrp/chrp.h
index 814f54742e0f..63f0aee4c158 100644
--- a/arch/powerpc/platforms/chrp/chrp.h
+++ b/arch/powerpc/platforms/chrp/chrp.h
@@ -8,4 +8,4 @@ extern int chrp_set_rtc_time(struct rtc_time *);
8extern long chrp_time_init(void); 8extern long chrp_time_init(void);
9 9
10extern void chrp_find_bridges(void); 10extern void chrp_find_bridges(void);
11extern void chrp_event_scan(void); 11extern void chrp_event_scan(unsigned long);
diff --git a/arch/powerpc/platforms/chrp/pegasos_eth.c b/arch/powerpc/platforms/chrp/pegasos_eth.c
index 29c86781c493..6ad4b1a72c96 100644
--- a/arch/powerpc/platforms/chrp/pegasos_eth.c
+++ b/arch/powerpc/platforms/chrp/pegasos_eth.c
@@ -1,6 +1,4 @@
1/* 1/*
2 * arch/ppc/platforms/chrp_pegasos_eth.c
3 *
4 * Copyright (C) 2005 Sven Luther <sl@bplan-gmbh.de> 2 * Copyright (C) 2005 Sven Luther <sl@bplan-gmbh.de>
5 * Thanks to : 3 * Thanks to :
6 * Dale Farnsworth <dale@farnsworth.org> 4 * Dale Farnsworth <dale@farnsworth.org>
diff --git a/arch/powerpc/platforms/chrp/setup.c b/arch/powerpc/platforms/chrp/setup.c
index e1fadbf49150..23a201718704 100644
--- a/arch/powerpc/platforms/chrp/setup.c
+++ b/arch/powerpc/platforms/chrp/setup.c
@@ -1,6 +1,4 @@
1/* 1/*
2 * arch/ppc/platforms/setup.c
3 *
4 * Copyright (C) 1995 Linus Torvalds 2 * Copyright (C) 1995 Linus Torvalds
5 * Adapted from 'alpha' version by Gary Thomas 3 * Adapted from 'alpha' version by Gary Thomas
6 * Modified by Cort Dougan (cort@cs.nmt.edu) 4 * Modified by Cort Dougan (cort@cs.nmt.edu)
@@ -37,6 +35,7 @@
37#include <linux/root_dev.h> 35#include <linux/root_dev.h>
38#include <linux/initrd.h> 36#include <linux/initrd.h>
39#include <linux/module.h> 37#include <linux/module.h>
38#include <linux/timer.h>
40 39
41#include <asm/io.h> 40#include <asm/io.h>
42#include <asm/pgtable.h> 41#include <asm/pgtable.h>
@@ -63,6 +62,10 @@ EXPORT_SYMBOL(_chrp_type);
63 62
64struct mpic *chrp_mpic; 63struct mpic *chrp_mpic;
65 64
65/* Used for doing CHRP event-scans */
66DEFINE_PER_CPU(struct timer_list, heartbeat_timer);
67unsigned long event_scan_interval;
68
66/* 69/*
67 * XXX this should be in xmon.h, but putting it there means xmon.h 70 * XXX this should be in xmon.h, but putting it there means xmon.h
68 * has to include <linux/interrupt.h> (to get irqreturn_t), which 71 * has to include <linux/interrupt.h> (to get irqreturn_t), which
@@ -231,8 +234,6 @@ void __init chrp_setup_arch(void)
231{ 234{
232 struct device_node *root = find_path_device ("/"); 235 struct device_node *root = find_path_device ("/");
233 char *machine = NULL; 236 char *machine = NULL;
234 struct device_node *device;
235 unsigned int *p = NULL;
236 237
237 /* init to some ~sane value until calibrate_delay() runs */ 238 /* init to some ~sane value until calibrate_delay() runs */
238 loops_per_jiffy = 50000000/HZ; 239 loops_per_jiffy = 50000000/HZ;
@@ -289,23 +290,12 @@ void __init chrp_setup_arch(void)
289 */ 290 */
290 sio_init(); 291 sio_init();
291 292
292 /* Get the event scan rate for the rtas so we know how
293 * often it expects a heartbeat. -- Cort
294 */
295 device = find_devices("rtas");
296 if (device)
297 p = (unsigned int *) get_property
298 (device, "rtas-event-scan-rate", NULL);
299 if (p && *p) {
300 ppc_md.heartbeat = chrp_event_scan;
301 ppc_md.heartbeat_reset = HZ / (*p * 30) - 1;
302 ppc_md.heartbeat_count = 1;
303 printk("RTAS Event Scan Rate: %u (%lu jiffies)\n",
304 *p, ppc_md.heartbeat_reset);
305 }
306
307 pci_create_OF_bus_map(); 293 pci_create_OF_bus_map();
308 294
295#ifdef CONFIG_SMP
296 smp_ops = &chrp_smp_ops;
297#endif /* CONFIG_SMP */
298
309 /* 299 /*
310 * Print the banner, then scroll down so boot progress 300 * Print the banner, then scroll down so boot progress
311 * can be printed. -- Cort 301 * can be printed. -- Cort
@@ -314,7 +304,7 @@ void __init chrp_setup_arch(void)
314} 304}
315 305
316void 306void
317chrp_event_scan(void) 307chrp_event_scan(unsigned long unused)
318{ 308{
319 unsigned char log[1024]; 309 unsigned char log[1024];
320 int ret = 0; 310 int ret = 0;
@@ -322,7 +312,8 @@ chrp_event_scan(void)
322 /* XXX: we should loop until the hardware says no more error logs -- Cort */ 312 /* XXX: we should loop until the hardware says no more error logs -- Cort */
323 rtas_call(rtas_token("event-scan"), 4, 1, &ret, 0xffffffff, 0, 313 rtas_call(rtas_token("event-scan"), 4, 1, &ret, 0xffffffff, 0,
324 __pa(log), 1024); 314 __pa(log), 1024);
325 ppc_md.heartbeat_count = ppc_md.heartbeat_reset; 315 mod_timer(&__get_cpu_var(heartbeat_timer),
316 jiffies + event_scan_interval);
326} 317}
327 318
328/* 319/*
@@ -467,6 +458,9 @@ void __init chrp_init_IRQ(void)
467void __init 458void __init
468chrp_init2(void) 459chrp_init2(void)
469{ 460{
461 struct device_node *device;
462 unsigned int *p = NULL;
463
470#ifdef CONFIG_NVRAM 464#ifdef CONFIG_NVRAM
471 chrp_nvram_init(); 465 chrp_nvram_init();
472#endif 466#endif
@@ -478,12 +472,53 @@ chrp_init2(void)
478 request_region(0x80,0x10,"dma page reg"); 472 request_region(0x80,0x10,"dma page reg");
479 request_region(0xc0,0x20,"dma2"); 473 request_region(0xc0,0x20,"dma2");
480 474
475 /* Get the event scan rate for the rtas so we know how
476 * often it expects a heartbeat. -- Cort
477 */
478 device = find_devices("rtas");
479 if (device)
480 p = (unsigned int *) get_property
481 (device, "rtas-event-scan-rate", NULL);
482 if (p && *p) {
483 /*
484 * Arrange to call chrp_event_scan at least *p times
485 * per minute. We use 59 rather than 60 here so that
486 * the rate will be slightly higher than the minimum.
487 * This all assumes we don't do hotplug CPU on any
488 * machine that needs the event scans done.
489 */
490 unsigned long interval, offset;
491 int cpu, ncpus;
492 struct timer_list *timer;
493
494 interval = HZ * 59 / *p;
495 offset = HZ;
496 ncpus = num_online_cpus();
497 event_scan_interval = ncpus * interval;
498 for (cpu = 0; cpu < ncpus; ++cpu) {
499 timer = &per_cpu(heartbeat_timer, cpu);
500 setup_timer(timer, chrp_event_scan, 0);
501 timer->expires = jiffies + offset;
502 add_timer_on(timer, cpu);
503 offset += interval;
504 }
505 printk("RTAS Event Scan Rate: %u (%lu jiffies)\n",
506 *p, interval);
507 }
508
481 if (ppc_md.progress) 509 if (ppc_md.progress)
482 ppc_md.progress(" Have fun! ", 0x7777); 510 ppc_md.progress(" Have fun! ", 0x7777);
483} 511}
484 512
485void __init chrp_init(void) 513static int __init chrp_probe(void)
486{ 514{
515 char *dtype = of_get_flat_dt_prop(of_get_flat_dt_root(),
516 "device_type", NULL);
517 if (dtype == NULL)
518 return 0;
519 if (strcmp(dtype, "chrp"))
520 return 0;
521
487 ISA_DMA_THRESHOLD = ~0L; 522 ISA_DMA_THRESHOLD = ~0L;
488 DMA_MODE_READ = 0x44; 523 DMA_MODE_READ = 0x44;
489 DMA_MODE_WRITE = 0x48; 524 DMA_MODE_WRITE = 0x48;
diff --git a/arch/powerpc/platforms/chrp/time.c b/arch/powerpc/platforms/chrp/time.c
index 78df2e7ca88a..7d7889026936 100644
--- a/arch/powerpc/platforms/chrp/time.c
+++ b/arch/powerpc/platforms/chrp/time.c
@@ -1,6 +1,4 @@
1/* 1/*
2 * arch/ppc/platforms/chrp_time.c
3 *
4 * Copyright (C) 1991, 1992, 1995 Linus Torvalds 2 * Copyright (C) 1991, 1992, 1995 Linus Torvalds
5 * 3 *
6 * Adapted for PowerPC (PReP) by Gary Thomas 4 * Adapted for PowerPC (PReP) by Gary Thomas
@@ -122,33 +120,15 @@ int chrp_set_rtc_time(struct rtc_time *tmarg)
122void chrp_get_rtc_time(struct rtc_time *tm) 120void chrp_get_rtc_time(struct rtc_time *tm)
123{ 121{
124 unsigned int year, mon, day, hour, min, sec; 122 unsigned int year, mon, day, hour, min, sec;
125 int uip, i;
126
127 /* The Linux interpretation of the CMOS clock register contents:
128 * When the Update-In-Progress (UIP) flag goes from 1 to 0, the
129 * RTC registers show the second which has precisely just started.
130 * Let's hope other operating systems interpret the RTC the same way.
131 */
132 123
133 /* Since the UIP flag is set for about 2.2 ms and the clock 124 do {
134 * is typically written with a precision of 1 jiffy, trying
135 * to obtain a precision better than a few milliseconds is
136 * an illusion. Only consistency is interesting, this also
137 * allows to use the routine for /dev/rtc without a potential
138 * 1 second kernel busy loop triggered by any reader of /dev/rtc.
139 */
140
141 for ( i = 0; i<1000000; i++) {
142 uip = chrp_cmos_clock_read(RTC_FREQ_SELECT);
143 sec = chrp_cmos_clock_read(RTC_SECONDS); 125 sec = chrp_cmos_clock_read(RTC_SECONDS);
144 min = chrp_cmos_clock_read(RTC_MINUTES); 126 min = chrp_cmos_clock_read(RTC_MINUTES);
145 hour = chrp_cmos_clock_read(RTC_HOURS); 127 hour = chrp_cmos_clock_read(RTC_HOURS);
146 day = chrp_cmos_clock_read(RTC_DAY_OF_MONTH); 128 day = chrp_cmos_clock_read(RTC_DAY_OF_MONTH);
147 mon = chrp_cmos_clock_read(RTC_MONTH); 129 mon = chrp_cmos_clock_read(RTC_MONTH);
148 year = chrp_cmos_clock_read(RTC_YEAR); 130 year = chrp_cmos_clock_read(RTC_YEAR);
149 uip |= chrp_cmos_clock_read(RTC_FREQ_SELECT); 131 } while (sec != chrp_cmos_clock_read(RTC_SECONDS));
150 if ((uip & RTC_UIP)==0) break;
151 }
152 132
153 if (!(chrp_cmos_clock_read(RTC_CONTROL) & RTC_DM_BINARY) || RTC_ALWAYS_BCD) { 133 if (!(chrp_cmos_clock_read(RTC_CONTROL) & RTC_DM_BINARY) || RTC_ALWAYS_BCD) {
154 BCD_TO_BIN(sec); 134 BCD_TO_BIN(sec);
diff --git a/arch/powerpc/platforms/iseries/mf.c b/arch/powerpc/platforms/iseries/mf.c
index a41d8b78c0cd..d771b8ee857d 100644
--- a/arch/powerpc/platforms/iseries/mf.c
+++ b/arch/powerpc/platforms/iseries/mf.c
@@ -46,6 +46,7 @@
46#include "setup.h" 46#include "setup.h"
47 47
48extern int piranha_simulator; 48extern int piranha_simulator;
49static int mf_initialized;
49 50
50/* 51/*
51 * This is the structure layout for the Machine Facilites LPAR event 52 * This is the structure layout for the Machine Facilites LPAR event
@@ -143,7 +144,8 @@ static spinlock_t pending_event_spinlock;
143static struct pending_event *pending_event_head; 144static struct pending_event *pending_event_head;
144static struct pending_event *pending_event_tail; 145static struct pending_event *pending_event_tail;
145static struct pending_event *pending_event_avail; 146static struct pending_event *pending_event_avail;
146static struct pending_event pending_event_prealloc[16]; 147#define PENDING_EVENT_PREALLOC_LEN 16
148static struct pending_event pending_event_prealloc[PENDING_EVENT_PREALLOC_LEN];
147 149
148/* 150/*
149 * Put a pending event onto the available queue, so it can get reused. 151 * Put a pending event onto the available queue, so it can get reused.
@@ -597,7 +599,7 @@ void mf_power_off(void)
597 * Global kernel interface to tell the VSP object in the primary 599 * Global kernel interface to tell the VSP object in the primary
598 * partition to reboot this partition. 600 * partition to reboot this partition.
599 */ 601 */
600void mf_reboot(void) 602void mf_reboot(char *cmd)
601{ 603{
602 printk(KERN_INFO "mf.c: Preparing to bounce...\n"); 604 printk(KERN_INFO "mf.c: Preparing to bounce...\n");
603 signal_ce_msg_simple(0x4e, NULL); 605 signal_ce_msg_simple(0x4e, NULL);
@@ -625,7 +627,7 @@ void mf_display_src(u32 word)
625/* 627/*
626 * Display a single word SRC of the form "PROGXXXX" on the VSP control panel. 628 * Display a single word SRC of the form "PROGXXXX" on the VSP control panel.
627 */ 629 */
628void mf_display_progress(u16 value) 630static __init void mf_display_progress_src(u16 value)
629{ 631{
630 u8 ce[12]; 632 u8 ce[12];
631 u8 src[72]; 633 u8 src[72];
@@ -649,30 +651,42 @@ void mf_display_progress(u16 value)
649 * Clear the VSP control panel. Used to "erase" an SRC that was 651 * Clear the VSP control panel. Used to "erase" an SRC that was
650 * previously displayed. 652 * previously displayed.
651 */ 653 */
652void mf_clear_src(void) 654static void mf_clear_src(void)
653{ 655{
654 signal_ce_msg_simple(0x4b, NULL); 656 signal_ce_msg_simple(0x4b, NULL);
655} 657}
656 658
659void __init mf_display_progress(u16 value)
660{
661 if (piranha_simulator || !mf_initialized)
662 return;
663
664 if (0xFFFF == value)
665 mf_clear_src();
666 else
667 mf_display_progress_src(value);
668}
669
657/* 670/*
658 * Initialization code here. 671 * Initialization code here.
659 */ 672 */
660void mf_init(void) 673void __init mf_init(void)
661{ 674{
662 int i; 675 int i;
663 676
664 /* initialize */
665 spin_lock_init(&pending_event_spinlock); 677 spin_lock_init(&pending_event_spinlock);
666 for (i = 0; 678
667 i < sizeof(pending_event_prealloc) / sizeof(*pending_event_prealloc); 679 for (i = 0; i < PENDING_EVENT_PREALLOC_LEN; i++)
668 ++i)
669 free_pending_event(&pending_event_prealloc[i]); 680 free_pending_event(&pending_event_prealloc[i]);
681
670 HvLpEvent_registerHandler(HvLpEvent_Type_MachineFac, &hv_handler); 682 HvLpEvent_registerHandler(HvLpEvent_Type_MachineFac, &hv_handler);
671 683
672 /* virtual continue ack */ 684 /* virtual continue ack */
673 signal_ce_msg_simple(0x57, NULL); 685 signal_ce_msg_simple(0x57, NULL);
674 686
675 /* initialization complete */ 687 mf_initialized = 1;
688 mb();
689
676 printk(KERN_NOTICE "mf.c: iSeries Linux LPAR Machine Facilities " 690 printk(KERN_NOTICE "mf.c: iSeries Linux LPAR Machine Facilities "
677 "initialized\n"); 691 "initialized\n");
678} 692}
@@ -692,6 +706,43 @@ static void get_rtc_time_complete(void *token, struct ce_msg_data *ce_msg)
692 complete(&rtc->com); 706 complete(&rtc->com);
693} 707}
694 708
709static int mf_set_rtc(struct rtc_time *tm)
710{
711 char ce_time[12];
712 u8 day, mon, hour, min, sec, y1, y2;
713 unsigned year;
714
715 year = 1900 + tm->tm_year;
716 y1 = year / 100;
717 y2 = year % 100;
718
719 sec = tm->tm_sec;
720 min = tm->tm_min;
721 hour = tm->tm_hour;
722 day = tm->tm_mday;
723 mon = tm->tm_mon + 1;
724
725 BIN_TO_BCD(sec);
726 BIN_TO_BCD(min);
727 BIN_TO_BCD(hour);
728 BIN_TO_BCD(mon);
729 BIN_TO_BCD(day);
730 BIN_TO_BCD(y1);
731 BIN_TO_BCD(y2);
732
733 memset(ce_time, 0, sizeof(ce_time));
734 ce_time[3] = 0x41;
735 ce_time[4] = y1;
736 ce_time[5] = y2;
737 ce_time[6] = sec;
738 ce_time[7] = min;
739 ce_time[8] = hour;
740 ce_time[10] = day;
741 ce_time[11] = mon;
742
743 return signal_ce_msg(ce_time, NULL);
744}
745
695static int rtc_set_tm(int rc, u8 *ce_msg, struct rtc_time *tm) 746static int rtc_set_tm(int rc, u8 *ce_msg, struct rtc_time *tm)
696{ 747{
697 tm->tm_wday = 0; 748 tm->tm_wday = 0;
@@ -747,7 +798,7 @@ static int rtc_set_tm(int rc, u8 *ce_msg, struct rtc_time *tm)
747 return 0; 798 return 0;
748} 799}
749 800
750int mf_get_rtc(struct rtc_time *tm) 801static int mf_get_rtc(struct rtc_time *tm)
751{ 802{
752 struct ce_msg_comp_data ce_complete; 803 struct ce_msg_comp_data ce_complete;
753 struct rtc_time_data rtc_data; 804 struct rtc_time_data rtc_data;
@@ -780,7 +831,7 @@ static void get_boot_rtc_time_complete(void *token, struct ce_msg_data *ce_msg)
780 rtc->busy = 0; 831 rtc->busy = 0;
781} 832}
782 833
783int mf_get_boot_rtc(struct rtc_time *tm) 834static int mf_get_boot_rtc(struct rtc_time *tm)
784{ 835{
785 struct ce_msg_comp_data ce_complete; 836 struct ce_msg_comp_data ce_complete;
786 struct boot_rtc_time_data rtc_data; 837 struct boot_rtc_time_data rtc_data;
@@ -802,43 +853,6 @@ int mf_get_boot_rtc(struct rtc_time *tm)
802 return rtc_set_tm(rtc_data.rc, rtc_data.ce_msg.ce_msg, tm); 853 return rtc_set_tm(rtc_data.rc, rtc_data.ce_msg.ce_msg, tm);
803} 854}
804 855
805int mf_set_rtc(struct rtc_time *tm)
806{
807 char ce_time[12];
808 u8 day, mon, hour, min, sec, y1, y2;
809 unsigned year;
810
811 year = 1900 + tm->tm_year;
812 y1 = year / 100;
813 y2 = year % 100;
814
815 sec = tm->tm_sec;
816 min = tm->tm_min;
817 hour = tm->tm_hour;
818 day = tm->tm_mday;
819 mon = tm->tm_mon + 1;
820
821 BIN_TO_BCD(sec);
822 BIN_TO_BCD(min);
823 BIN_TO_BCD(hour);
824 BIN_TO_BCD(mon);
825 BIN_TO_BCD(day);
826 BIN_TO_BCD(y1);
827 BIN_TO_BCD(y2);
828
829 memset(ce_time, 0, sizeof(ce_time));
830 ce_time[3] = 0x41;
831 ce_time[4] = y1;
832 ce_time[5] = y2;
833 ce_time[6] = sec;
834 ce_time[7] = min;
835 ce_time[8] = hour;
836 ce_time[10] = day;
837 ce_time[11] = mon;
838
839 return signal_ce_msg(ce_time, NULL);
840}
841
842#ifdef CONFIG_PROC_FS 856#ifdef CONFIG_PROC_FS
843 857
844static int proc_mf_dump_cmdline(char *page, char **start, off_t off, 858static int proc_mf_dump_cmdline(char *page, char **start, off_t off,
diff --git a/arch/powerpc/platforms/iseries/setup.c b/arch/powerpc/platforms/iseries/setup.c
index 3ecc4a652d82..6ce8a404ba6b 100644
--- a/arch/powerpc/platforms/iseries/setup.c
+++ b/arch/powerpc/platforms/iseries/setup.c
@@ -50,6 +50,7 @@
50#include <asm/iseries/hv_call_xm.h> 50#include <asm/iseries/hv_call_xm.h>
51#include <asm/iseries/it_lp_queue.h> 51#include <asm/iseries/it_lp_queue.h>
52#include <asm/iseries/mf.h> 52#include <asm/iseries/mf.h>
53#include <asm/iseries/it_exp_vpd_panel.h>
53#include <asm/iseries/hv_lp_event.h> 54#include <asm/iseries/hv_lp_event.h>
54#include <asm/iseries/lpar_map.h> 55#include <asm/iseries/lpar_map.h>
55#include <asm/udbg.h> 56#include <asm/udbg.h>
@@ -89,8 +90,6 @@ extern unsigned long embedded_sysmap_end;
89extern unsigned long iSeries_recal_tb; 90extern unsigned long iSeries_recal_tb;
90extern unsigned long iSeries_recal_titan; 91extern unsigned long iSeries_recal_titan;
91 92
92static int mf_initialized;
93
94static unsigned long cmd_mem_limit; 93static unsigned long cmd_mem_limit;
95 94
96struct MemoryBlock { 95struct MemoryBlock {
@@ -303,8 +302,6 @@ static void __init iSeries_init_early(void)
303{ 302{
304 DBG(" -> iSeries_init_early()\n"); 303 DBG(" -> iSeries_init_early()\n");
305 304
306 ppc64_firmware_features = FW_FEATURE_ISERIES;
307
308 ppc64_interrupt_controller = IC_ISERIES; 305 ppc64_interrupt_controller = IC_ISERIES;
309 306
310#if defined(CONFIG_BLK_DEV_INITRD) 307#if defined(CONFIG_BLK_DEV_INITRD)
@@ -349,8 +346,6 @@ static void __init iSeries_init_early(void)
349 HvCallEvent_setLpEventQueueInterruptProc(0, 0); 346 HvCallEvent_setLpEventQueueInterruptProc(0, 0);
350 347
351 mf_init(); 348 mf_init();
352 mf_initialized = 1;
353 mb();
354 349
355 /* If we were passed an initrd, set the ROOT_DEV properly if the values 350 /* If we were passed an initrd, set the ROOT_DEV properly if the values
356 * look sensible. If not, clear initrd reference. 351 * look sensible. If not, clear initrd reference.
@@ -560,39 +555,10 @@ static void iSeries_show_cpuinfo(struct seq_file *m)
560 seq_printf(m, "machine\t\t: 64-bit iSeries Logical Partition\n"); 555 seq_printf(m, "machine\t\t: 64-bit iSeries Logical Partition\n");
561} 556}
562 557
563/*
564 * Document me.
565 */
566static void iSeries_restart(char *cmd)
567{
568 mf_reboot();
569}
570
571/*
572 * Document me.
573 */
574static void iSeries_power_off(void)
575{
576 mf_power_off();
577}
578
579/*
580 * Document me.
581 */
582static void iSeries_halt(void)
583{
584 mf_power_off();
585}
586
587static void __init iSeries_progress(char * st, unsigned short code) 558static void __init iSeries_progress(char * st, unsigned short code)
588{ 559{
589 printk("Progress: [%04x] - %s\n", (unsigned)code, st); 560 printk("Progress: [%04x] - %s\n", (unsigned)code, st);
590 if (!piranha_simulator && mf_initialized) { 561 mf_display_progress(code);
591 if (code != 0xffff)
592 mf_display_progress(code);
593 else
594 mf_clear_src();
595 }
596} 562}
597 563
598static void __init iSeries_fixup_klimit(void) 564static void __init iSeries_fixup_klimit(void)
@@ -709,21 +675,29 @@ static void iseries_dedicated_idle(void)
709void __init iSeries_init_IRQ(void) { } 675void __init iSeries_init_IRQ(void) { }
710#endif 676#endif
711 677
712static int __init iseries_probe(int platform) 678static int __init iseries_probe(void)
713{ 679{
714 return PLATFORM_ISERIES_LPAR == platform; 680 unsigned long root = of_get_flat_dt_root();
681 if (!of_flat_dt_is_compatible(root, "IBM,iSeries"))
682 return 0;
683
684 powerpc_firmware_features |= FW_FEATURE_ISERIES;
685 powerpc_firmware_features |= FW_FEATURE_LPAR;
686
687 return 1;
715} 688}
716 689
717struct machdep_calls __initdata iseries_md = { 690define_machine(iseries) {
691 .name = "iSeries",
718 .setup_arch = iSeries_setup_arch, 692 .setup_arch = iSeries_setup_arch,
719 .show_cpuinfo = iSeries_show_cpuinfo, 693 .show_cpuinfo = iSeries_show_cpuinfo,
720 .init_IRQ = iSeries_init_IRQ, 694 .init_IRQ = iSeries_init_IRQ,
721 .get_irq = iSeries_get_irq, 695 .get_irq = iSeries_get_irq,
722 .init_early = iSeries_init_early, 696 .init_early = iSeries_init_early,
723 .pcibios_fixup = iSeries_pci_final_fixup, 697 .pcibios_fixup = iSeries_pci_final_fixup,
724 .restart = iSeries_restart, 698 .restart = mf_reboot,
725 .power_off = iSeries_power_off, 699 .power_off = mf_power_off,
726 .halt = iSeries_halt, 700 .halt = mf_power_off,
727 .get_boot_time = iSeries_get_boot_time, 701 .get_boot_time = iSeries_get_boot_time,
728 .set_rtc_time = iSeries_set_rtc_time, 702 .set_rtc_time = iSeries_set_rtc_time,
729 .get_rtc_time = iSeries_get_rtc_time, 703 .get_rtc_time = iSeries_get_rtc_time,
@@ -917,6 +891,24 @@ void dt_cpus(struct iseries_flat_dt *dt)
917 dt_end_node(dt); 891 dt_end_node(dt);
918} 892}
919 893
894void dt_model(struct iseries_flat_dt *dt)
895{
896 char buf[16] = "IBM,";
897
898 /* "IBM," + mfgId[2:3] + systemSerial[1:5] */
899 strne2a(buf + 4, xItExtVpdPanel.mfgID + 2, 2);
900 strne2a(buf + 6, xItExtVpdPanel.systemSerial + 1, 5);
901 buf[11] = '\0';
902 dt_prop_str(dt, "system-id", buf);
903
904 /* "IBM," + machineType[0:4] */
905 strne2a(buf + 4, xItExtVpdPanel.machineType, 4);
906 buf[8] = '\0';
907 dt_prop_str(dt, "model", buf);
908
909 dt_prop_str(dt, "compatible", "IBM,iSeries");
910}
911
920void build_flat_dt(struct iseries_flat_dt *dt, unsigned long phys_mem_size) 912void build_flat_dt(struct iseries_flat_dt *dt, unsigned long phys_mem_size)
921{ 913{
922 u64 tmp[2]; 914 u64 tmp[2];
@@ -927,6 +919,7 @@ void build_flat_dt(struct iseries_flat_dt *dt, unsigned long phys_mem_size)
927 919
928 dt_prop_u32(dt, "#address-cells", 2); 920 dt_prop_u32(dt, "#address-cells", 2);
929 dt_prop_u32(dt, "#size-cells", 2); 921 dt_prop_u32(dt, "#size-cells", 2);
922 dt_model(dt);
930 923
931 /* /memory */ 924 /* /memory */
932 dt_start_node(dt, "memory@0"); 925 dt_start_node(dt, "memory@0");
@@ -939,7 +932,7 @@ void build_flat_dt(struct iseries_flat_dt *dt, unsigned long phys_mem_size)
939 932
940 /* /chosen */ 933 /* /chosen */
941 dt_start_node(dt, "chosen"); 934 dt_start_node(dt, "chosen");
942 dt_prop_u32(dt, "linux,platform", PLATFORM_ISERIES_LPAR); 935 dt_prop_str(dt, "bootargs", cmd_line);
943 if (cmd_mem_limit) 936 if (cmd_mem_limit)
944 dt_prop_u64(dt, "linux,memory-limit", cmd_mem_limit); 937 dt_prop_u64(dt, "linux,memory-limit", cmd_mem_limit);
945 dt_end_node(dt); 938 dt_end_node(dt);
diff --git a/arch/powerpc/platforms/maple/setup.c b/arch/powerpc/platforms/maple/setup.c
index ec5c1e10c407..24c0aef4ea39 100644
--- a/arch/powerpc/platforms/maple/setup.c
+++ b/arch/powerpc/platforms/maple/setup.c
@@ -259,9 +259,10 @@ static void __init maple_progress(char *s, unsigned short hex)
259/* 259/*
260 * Called very early, MMU is off, device-tree isn't unflattened 260 * Called very early, MMU is off, device-tree isn't unflattened
261 */ 261 */
262static int __init maple_probe(int platform) 262static int __init maple_probe(void)
263{ 263{
264 if (platform != PLATFORM_MAPLE) 264 unsigned long root = of_get_flat_dt_root();
265 if (!of_flat_dt_is_compatible(root, "Momentum,Maple"))
265 return 0; 266 return 0;
266 /* 267 /*
267 * On U3, the DART (iommu) must be allocated now since it 268 * On U3, the DART (iommu) must be allocated now since it
@@ -274,7 +275,8 @@ static int __init maple_probe(int platform)
274 return 1; 275 return 1;
275} 276}
276 277
277struct machdep_calls __initdata maple_md = { 278define_machine(maple_md) {
279 .name = "Maple",
278 .probe = maple_probe, 280 .probe = maple_probe,
279 .setup_arch = maple_setup_arch, 281 .setup_arch = maple_setup_arch,
280 .init_early = maple_init_early, 282 .init_early = maple_init_early,
@@ -290,7 +292,7 @@ struct machdep_calls __initdata maple_md = {
290 .get_rtc_time = maple_get_rtc_time, 292 .get_rtc_time = maple_get_rtc_time,
291 .calibrate_decr = generic_calibrate_decr, 293 .calibrate_decr = generic_calibrate_decr,
292 .progress = maple_progress, 294 .progress = maple_progress,
293 .idle_loop = native_idle, 295 .power_save = power4_idle,
294#ifdef CONFIG_KEXEC 296#ifdef CONFIG_KEXEC
295 .machine_kexec = default_machine_kexec, 297 .machine_kexec = default_machine_kexec,
296 .machine_kexec_prepare = default_machine_kexec_prepare, 298 .machine_kexec_prepare = default_machine_kexec_prepare,
diff --git a/arch/powerpc/platforms/maple/time.c b/arch/powerpc/platforms/maple/time.c
index 50bc4eb85353..b9a2b3d4bf33 100644
--- a/arch/powerpc/platforms/maple/time.c
+++ b/arch/powerpc/platforms/maple/time.c
@@ -1,6 +1,4 @@
1/* 1/*
2 * arch/ppc64/kernel/maple_time.c
3 *
4 * (c) Copyright 2004 Benjamin Herrenschmidt (benh@kernel.crashing.org), 2 * (c) Copyright 2004 Benjamin Herrenschmidt (benh@kernel.crashing.org),
5 * IBM Corp. 3 * IBM Corp.
6 * 4 *
@@ -62,34 +60,14 @@ static void maple_clock_write(unsigned long val, int addr)
62 60
63void maple_get_rtc_time(struct rtc_time *tm) 61void maple_get_rtc_time(struct rtc_time *tm)
64{ 62{
65 int uip, i; 63 do {
66
67 /* The Linux interpretation of the CMOS clock register contents:
68 * When the Update-In-Progress (UIP) flag goes from 1 to 0, the
69 * RTC registers show the second which has precisely just started.
70 * Let's hope other operating systems interpret the RTC the same way.
71 */
72
73 /* Since the UIP flag is set for about 2.2 ms and the clock
74 * is typically written with a precision of 1 jiffy, trying
75 * to obtain a precision better than a few milliseconds is
76 * an illusion. Only consistency is interesting, this also
77 * allows to use the routine for /dev/rtc without a potential
78 * 1 second kernel busy loop triggered by any reader of /dev/rtc.
79 */
80
81 for (i = 0; i<1000000; i++) {
82 uip = maple_clock_read(RTC_FREQ_SELECT);
83 tm->tm_sec = maple_clock_read(RTC_SECONDS); 64 tm->tm_sec = maple_clock_read(RTC_SECONDS);
84 tm->tm_min = maple_clock_read(RTC_MINUTES); 65 tm->tm_min = maple_clock_read(RTC_MINUTES);
85 tm->tm_hour = maple_clock_read(RTC_HOURS); 66 tm->tm_hour = maple_clock_read(RTC_HOURS);
86 tm->tm_mday = maple_clock_read(RTC_DAY_OF_MONTH); 67 tm->tm_mday = maple_clock_read(RTC_DAY_OF_MONTH);
87 tm->tm_mon = maple_clock_read(RTC_MONTH); 68 tm->tm_mon = maple_clock_read(RTC_MONTH);
88 tm->tm_year = maple_clock_read(RTC_YEAR); 69 tm->tm_year = maple_clock_read(RTC_YEAR);
89 uip |= maple_clock_read(RTC_FREQ_SELECT); 70 } while (tm->tm_sec != maple_clock_read(RTC_SECONDS));
90 if ((uip & RTC_UIP)==0)
91 break;
92 }
93 71
94 if (!(maple_clock_read(RTC_CONTROL) & RTC_DM_BINARY) 72 if (!(maple_clock_read(RTC_CONTROL) & RTC_DM_BINARY)
95 || RTC_ALWAYS_BCD) { 73 || RTC_ALWAYS_BCD) {
diff --git a/arch/powerpc/platforms/powermac/bootx_init.c b/arch/powerpc/platforms/powermac/bootx_init.c
index fa8b4d7b5ded..eacbfd9beabc 100644
--- a/arch/powerpc/platforms/powermac/bootx_init.c
+++ b/arch/powerpc/platforms/powermac/bootx_init.c
@@ -161,9 +161,7 @@ static void __init bootx_dt_add_prop(char *name, void *data, int size,
161static void __init bootx_add_chosen_props(unsigned long base, 161static void __init bootx_add_chosen_props(unsigned long base,
162 unsigned long *mem_end) 162 unsigned long *mem_end)
163{ 163{
164 u32 val = _MACH_Pmac; 164 u32 val;
165
166 bootx_dt_add_prop("linux,platform", &val, 4, mem_end);
167 165
168 if (bootx_info->kernelParamsOffset) { 166 if (bootx_info->kernelParamsOffset) {
169 char *args = (char *)((unsigned long)bootx_info) + 167 char *args = (char *)((unsigned long)bootx_info) +
@@ -493,7 +491,7 @@ void __init bootx_init(unsigned long r3, unsigned long r4)
493 && (strcmp(model, "iMac,1") == 0 491 && (strcmp(model, "iMac,1") == 0
494 || strcmp(model, "PowerMac1,1") == 0)) { 492 || strcmp(model, "PowerMac1,1") == 0)) {
495 bootx_printf("iMac,1 detected, shutting down USB \n"); 493 bootx_printf("iMac,1 detected, shutting down USB \n");
496 out_le32((unsigned *)0x80880008, 1); /* XXX */ 494 out_le32((unsigned __iomem *)0x80880008, 1); /* XXX */
497 } 495 }
498 } 496 }
499 497
diff --git a/arch/powerpc/platforms/powermac/cpufreq_32.c b/arch/powerpc/platforms/powermac/cpufreq_32.c
index 56fd4e05fede..cfd6527a0d7e 100644
--- a/arch/powerpc/platforms/powermac/cpufreq_32.c
+++ b/arch/powerpc/platforms/powermac/cpufreq_32.c
@@ -1,6 +1,4 @@
1/* 1/*
2 * arch/ppc/platforms/pmac_cpufreq.c
3 *
4 * Copyright (C) 2002 - 2005 Benjamin Herrenschmidt <benh@kernel.crashing.org> 2 * Copyright (C) 2002 - 2005 Benjamin Herrenschmidt <benh@kernel.crashing.org>
5 * Copyright (C) 2004 John Steele Scott <toojays@toojays.net> 3 * Copyright (C) 2004 John Steele Scott <toojays@toojays.net>
6 * 4 *
diff --git a/arch/powerpc/platforms/powermac/cpufreq_64.c b/arch/powerpc/platforms/powermac/cpufreq_64.c
index a415e8d2f7af..b57e465a1b71 100644
--- a/arch/powerpc/platforms/powermac/cpufreq_64.c
+++ b/arch/powerpc/platforms/powermac/cpufreq_64.c
@@ -21,6 +21,7 @@
21#include <linux/cpufreq.h> 21#include <linux/cpufreq.h>
22#include <linux/init.h> 22#include <linux/init.h>
23#include <linux/completion.h> 23#include <linux/completion.h>
24#include <linux/mutex.h>
24#include <asm/prom.h> 25#include <asm/prom.h>
25#include <asm/machdep.h> 26#include <asm/machdep.h>
26#include <asm/irq.h> 27#include <asm/irq.h>
@@ -90,7 +91,7 @@ static void (*g5_switch_volt)(int speed_mode);
90static int (*g5_switch_freq)(int speed_mode); 91static int (*g5_switch_freq)(int speed_mode);
91static int (*g5_query_freq)(void); 92static int (*g5_query_freq)(void);
92 93
93static DECLARE_MUTEX(g5_switch_mutex); 94static DEFINE_MUTEX(g5_switch_mutex);
94 95
95 96
96static struct smu_sdbp_fvt *g5_fvt_table; /* table of op. points */ 97static struct smu_sdbp_fvt *g5_fvt_table; /* table of op. points */
@@ -327,7 +328,7 @@ static int g5_cpufreq_target(struct cpufreq_policy *policy,
327 if (g5_pmode_cur == newstate) 328 if (g5_pmode_cur == newstate)
328 return 0; 329 return 0;
329 330
330 down(&g5_switch_mutex); 331 mutex_lock(&g5_switch_mutex);
331 332
332 freqs.old = g5_cpu_freqs[g5_pmode_cur].frequency; 333 freqs.old = g5_cpu_freqs[g5_pmode_cur].frequency;
333 freqs.new = g5_cpu_freqs[newstate].frequency; 334 freqs.new = g5_cpu_freqs[newstate].frequency;
@@ -337,7 +338,7 @@ static int g5_cpufreq_target(struct cpufreq_policy *policy,
337 rc = g5_switch_freq(newstate); 338 rc = g5_switch_freq(newstate);
338 cpufreq_notify_transition(&freqs, CPUFREQ_POSTCHANGE); 339 cpufreq_notify_transition(&freqs, CPUFREQ_POSTCHANGE);
339 340
340 up(&g5_switch_mutex); 341 mutex_unlock(&g5_switch_mutex);
341 342
342 return rc; 343 return rc;
343} 344}
diff --git a/arch/powerpc/platforms/powermac/feature.c b/arch/powerpc/platforms/powermac/feature.c
index 34714d3ea69a..a5063cd675c5 100644
--- a/arch/powerpc/platforms/powermac/feature.c
+++ b/arch/powerpc/platforms/powermac/feature.c
@@ -1,6 +1,4 @@
1/* 1/*
2 * arch/ppc/platforms/pmac_feature.c
3 *
4 * Copyright (C) 1996-2001 Paul Mackerras (paulus@cs.anu.edu.au) 2 * Copyright (C) 1996-2001 Paul Mackerras (paulus@cs.anu.edu.au)
5 * Ben. Herrenschmidt (benh@kernel.crashing.org) 3 * Ben. Herrenschmidt (benh@kernel.crashing.org)
6 * 4 *
@@ -2491,9 +2489,7 @@ found:
2491 pmac_mb.model_id = PMAC_TYPE_COMET; 2489 pmac_mb.model_id = PMAC_TYPE_COMET;
2492 iounmap(mach_id_ptr); 2490 iounmap(mach_id_ptr);
2493 } 2491 }
2494#endif /* CONFIG_POWER4 */
2495 2492
2496#ifdef CONFIG_6xx
2497 /* Set default value of powersave_nap on machines that support it. 2493 /* Set default value of powersave_nap on machines that support it.
2498 * It appears that uninorth rev 3 has a problem with it, we don't 2494 * It appears that uninorth rev 3 has a problem with it, we don't
2499 * enable it on those. In theory, the flush-on-lock property is 2495 * enable it on those. In theory, the flush-on-lock property is
@@ -2522,10 +2518,11 @@ found:
2522 * NAP mode 2518 * NAP mode
2523 */ 2519 */
2524 powersave_lowspeed = 1; 2520 powersave_lowspeed = 1;
2525#endif /* CONFIG_6xx */ 2521
2526#ifdef CONFIG_POWER4 2522#else /* CONFIG_POWER4 */
2527 powersave_nap = 1; 2523 powersave_nap = 1;
2528#endif 2524#endif /* CONFIG_POWER4 */
2525
2529 /* Check for "mobile" machine */ 2526 /* Check for "mobile" machine */
2530 if (model && (strncmp(model, "PowerBook", 9) == 0 2527 if (model && (strncmp(model, "PowerBook", 9) == 0
2531 || strncmp(model, "iBook", 5) == 0)) 2528 || strncmp(model, "iBook", 5) == 0))
@@ -2954,7 +2951,7 @@ static void *pmac_early_vresume_data;
2954 2951
2955void pmac_set_early_video_resume(void (*proc)(void *data), void *data) 2952void pmac_set_early_video_resume(void (*proc)(void *data), void *data)
2956{ 2953{
2957 if (_machine != _MACH_Pmac) 2954 if (!machine_is(powermac))
2958 return; 2955 return;
2959 preempt_disable(); 2956 preempt_disable();
2960 pmac_early_vresume_proc = proc; 2957 pmac_early_vresume_proc = proc;
diff --git a/arch/powerpc/platforms/powermac/low_i2c.c b/arch/powerpc/platforms/powermac/low_i2c.c
index 87eb6bb7f0e7..e14f9ac55cf4 100644
--- a/arch/powerpc/platforms/powermac/low_i2c.c
+++ b/arch/powerpc/platforms/powermac/low_i2c.c
@@ -1457,6 +1457,9 @@ int __init pmac_i2c_init(void)
1457 return 0; 1457 return 0;
1458 i2c_inited = 1; 1458 i2c_inited = 1;
1459 1459
1460 if (!machine_is(powermac))
1461 return 0;
1462
1460 /* Probe keywest-i2c busses */ 1463 /* Probe keywest-i2c busses */
1461 kw_i2c_probe(); 1464 kw_i2c_probe();
1462 1465
diff --git a/arch/powerpc/platforms/powermac/nvram.c b/arch/powerpc/platforms/powermac/nvram.c
index 3ebd045a3350..262f967b880a 100644
--- a/arch/powerpc/platforms/powermac/nvram.c
+++ b/arch/powerpc/platforms/powermac/nvram.c
@@ -1,6 +1,4 @@
1/* 1/*
2 * arch/ppc/platforms/pmac_nvram.c
3 *
4 * Copyright (C) 2002 Benjamin Herrenschmidt (benh@kernel.crashing.org) 2 * Copyright (C) 2002 Benjamin Herrenschmidt (benh@kernel.crashing.org)
5 * 3 *
6 * This program is free software; you can redistribute it and/or 4 * This program is free software; you can redistribute it and/or
@@ -76,7 +74,7 @@ struct core99_header {
76 * Read and write the non-volatile RAM on PowerMacs and CHRP machines. 74 * Read and write the non-volatile RAM on PowerMacs and CHRP machines.
77 */ 75 */
78static int nvram_naddrs; 76static int nvram_naddrs;
79static volatile unsigned char *nvram_data; 77static volatile unsigned char __iomem *nvram_data;
80static int is_core_99; 78static int is_core_99;
81static int core99_bank = 0; 79static int core99_bank = 0;
82static int nvram_partitions[3]; 80static int nvram_partitions[3];
@@ -150,7 +148,7 @@ static ssize_t core99_nvram_size(void)
150} 148}
151 149
152#ifdef CONFIG_PPC32 150#ifdef CONFIG_PPC32
153static volatile unsigned char *nvram_addr; 151static volatile unsigned char __iomem *nvram_addr;
154static int nvram_mult; 152static int nvram_mult;
155 153
156static unsigned char direct_nvram_read_byte(int addr) 154static unsigned char direct_nvram_read_byte(int addr)
@@ -287,7 +285,7 @@ static int sm_erase_bank(int bank)
287 int stat, i; 285 int stat, i;
288 unsigned long timeout; 286 unsigned long timeout;
289 287
290 u8* base = (u8 *)nvram_data + core99_bank*NVRAM_SIZE; 288 u8 __iomem *base = (u8 __iomem *)nvram_data + core99_bank*NVRAM_SIZE;
291 289
292 DBG("nvram: Sharp/Micron Erasing bank %d...\n", bank); 290 DBG("nvram: Sharp/Micron Erasing bank %d...\n", bank);
293 291
@@ -319,7 +317,7 @@ static int sm_write_bank(int bank, u8* datas)
319 int i, stat = 0; 317 int i, stat = 0;
320 unsigned long timeout; 318 unsigned long timeout;
321 319
322 u8* base = (u8 *)nvram_data + core99_bank*NVRAM_SIZE; 320 u8 __iomem *base = (u8 __iomem *)nvram_data + core99_bank*NVRAM_SIZE;
323 321
324 DBG("nvram: Sharp/Micron Writing bank %d...\n", bank); 322 DBG("nvram: Sharp/Micron Writing bank %d...\n", bank);
325 323
@@ -354,7 +352,7 @@ static int amd_erase_bank(int bank)
354 int i, stat = 0; 352 int i, stat = 0;
355 unsigned long timeout; 353 unsigned long timeout;
356 354
357 u8* base = (u8 *)nvram_data + core99_bank*NVRAM_SIZE; 355 u8 __iomem *base = (u8 __iomem *)nvram_data + core99_bank*NVRAM_SIZE;
358 356
359 DBG("nvram: AMD Erasing bank %d...\n", bank); 357 DBG("nvram: AMD Erasing bank %d...\n", bank);
360 358
@@ -401,7 +399,7 @@ static int amd_write_bank(int bank, u8* datas)
401 int i, stat = 0; 399 int i, stat = 0;
402 unsigned long timeout; 400 unsigned long timeout;
403 401
404 u8* base = (u8 *)nvram_data + core99_bank*NVRAM_SIZE; 402 u8 __iomem *base = (u8 __iomem *)nvram_data + core99_bank*NVRAM_SIZE;
405 403
406 DBG("nvram: AMD Writing bank %d...\n", bank); 404 DBG("nvram: AMD Writing bank %d...\n", bank);
407 405
@@ -599,7 +597,7 @@ int __init pmac_nvram_init(void)
599 } 597 }
600 598
601#ifdef CONFIG_PPC32 599#ifdef CONFIG_PPC32
602 if (_machine == _MACH_chrp && nvram_naddrs == 1) { 600 if (machine_is(chrp) && nvram_naddrs == 1) {
603 nvram_data = ioremap(r1.start, s1); 601 nvram_data = ioremap(r1.start, s1);
604 nvram_mult = 1; 602 nvram_mult = 1;
605 ppc_md.nvram_read_val = direct_nvram_read_byte; 603 ppc_md.nvram_read_val = direct_nvram_read_byte;
diff --git a/arch/powerpc/platforms/powermac/pci.c b/arch/powerpc/platforms/powermac/pci.c
index de3f30e6b333..f5d8d15d74fa 100644
--- a/arch/powerpc/platforms/powermac/pci.c
+++ b/arch/powerpc/platforms/powermac/pci.c
@@ -1201,7 +1201,7 @@ void __init pmac_pcibios_after_init(void)
1201#ifdef CONFIG_PPC32 1201#ifdef CONFIG_PPC32
1202void pmac_pci_fixup_cardbus(struct pci_dev* dev) 1202void pmac_pci_fixup_cardbus(struct pci_dev* dev)
1203{ 1203{
1204 if (_machine != _MACH_Pmac) 1204 if (!machine_is(powermac))
1205 return; 1205 return;
1206 /* 1206 /*
1207 * Fix the interrupt routing on the various cardbus bridges 1207 * Fix the interrupt routing on the various cardbus bridges
@@ -1244,8 +1244,9 @@ void pmac_pci_fixup_pciata(struct pci_dev* dev)
1244 * On PowerMacs, we try to switch any PCI ATA controller to 1244 * On PowerMacs, we try to switch any PCI ATA controller to
1245 * fully native mode 1245 * fully native mode
1246 */ 1246 */
1247 if (_machine != _MACH_Pmac) 1247 if (!machine_is(powermac))
1248 return; 1248 return;
1249
1249 /* Some controllers don't have the class IDE */ 1250 /* Some controllers don't have the class IDE */
1250 if (dev->vendor == PCI_VENDOR_ID_PROMISE) 1251 if (dev->vendor == PCI_VENDOR_ID_PROMISE)
1251 switch(dev->device) { 1252 switch(dev->device) {
diff --git a/arch/powerpc/platforms/powermac/pfunc_base.c b/arch/powerpc/platforms/powermac/pfunc_base.c
index 9b7150f10414..a3bd3e728fa3 100644
--- a/arch/powerpc/platforms/powermac/pfunc_base.c
+++ b/arch/powerpc/platforms/powermac/pfunc_base.c
@@ -336,6 +336,8 @@ int __init pmac_pfunc_base_install(void)
336 return 0; 336 return 0;
337 pfbase_inited = 1; 337 pfbase_inited = 1;
338 338
339 if (!machine_is(powermac))
340 return 0;
339 341
340 DBG("Installing base platform functions...\n"); 342 DBG("Installing base platform functions...\n");
341 343
diff --git a/arch/powerpc/platforms/powermac/setup.c b/arch/powerpc/platforms/powermac/setup.c
index 1955462f4082..4d15e396655c 100644
--- a/arch/powerpc/platforms/powermac/setup.c
+++ b/arch/powerpc/platforms/powermac/setup.c
@@ -86,11 +86,10 @@ int ppc_override_l2cr = 0;
86int ppc_override_l2cr_value; 86int ppc_override_l2cr_value;
87int has_l2cache = 0; 87int has_l2cache = 0;
88 88
89int pmac_newworld = 1; 89int pmac_newworld;
90 90
91static int current_root_goodness = -1; 91static int current_root_goodness = -1;
92 92
93extern int pmac_newworld;
94extern struct machdep_calls pmac_md; 93extern struct machdep_calls pmac_md;
95 94
96#define DEFAULT_ROOT_DEVICE Root_SDA1 /* sda1 - slightly silly choice */ 95#define DEFAULT_ROOT_DEVICE Root_SDA1 /* sda1 - slightly silly choice */
@@ -308,9 +307,10 @@ static void __init pmac_setup_arch(void)
308 for (ic = NULL; (ic = of_find_all_nodes(ic)) != NULL; ) 307 for (ic = NULL; (ic = of_find_all_nodes(ic)) != NULL; )
309 if (get_property(ic, "interrupt-controller", NULL)) 308 if (get_property(ic, "interrupt-controller", NULL))
310 break; 309 break;
311 pmac_newworld = (ic != NULL); 310 if (ic) {
312 if (ic) 311 pmac_newworld = 1;
313 of_node_put(ic); 312 of_node_put(ic);
313 }
314 314
315 /* Lookup PCI hosts */ 315 /* Lookup PCI hosts */
316 pmac_pci_init(); 316 pmac_pci_init();
@@ -350,6 +350,13 @@ static void __init pmac_setup_arch(void)
350 smp_ops = &psurge_smp_ops; 350 smp_ops = &psurge_smp_ops;
351#endif 351#endif
352#endif /* CONFIG_SMP */ 352#endif /* CONFIG_SMP */
353
354#ifdef CONFIG_ADB
355 if (strstr(cmd_line, "adb_sync")) {
356 extern int __adb_probe_sync;
357 __adb_probe_sync = 1;
358 }
359#endif /* CONFIG_ADB */
353} 360}
354 361
355char *bootpath; 362char *bootpath;
@@ -576,30 +583,6 @@ pmac_halt(void)
576 pmac_power_off(); 583 pmac_power_off();
577} 584}
578 585
579#ifdef CONFIG_PPC32
580void __init pmac_init(void)
581{
582 /* isa_io_base gets set in pmac_pci_init */
583 isa_mem_base = PMAC_ISA_MEM_BASE;
584 pci_dram_offset = PMAC_PCI_DRAM_OFFSET;
585 ISA_DMA_THRESHOLD = ~0L;
586 DMA_MODE_READ = 1;
587 DMA_MODE_WRITE = 2;
588
589 ppc_md = pmac_md;
590
591#if defined(CONFIG_BLK_DEV_IDE) || defined(CONFIG_BLK_DEV_IDE_MODULE)
592#ifdef CONFIG_BLK_DEV_IDE_PMAC
593 ppc_ide_md.ide_init_hwif = pmac_ide_init_hwif_ports;
594 ppc_ide_md.default_io_base = pmac_ide_get_base;
595#endif /* CONFIG_BLK_DEV_IDE_PMAC */
596#endif /* defined(CONFIG_BLK_DEV_IDE) || defined(CONFIG_BLK_DEV_IDE_MODULE) */
597
598 if (ppc_md.progress) ppc_md.progress("pmac_init(): exit", 0);
599
600}
601#endif
602
603/* 586/*
604 * Early initialization. 587 * Early initialization.
605 */ 588 */
@@ -621,10 +604,6 @@ static void __init pmac_init_early(void)
621 /* Probe motherboard chipset */ 604 /* Probe motherboard chipset */
622 pmac_feature_init(); 605 pmac_feature_init();
623 606
624 /* We can NAP */
625 powersave_nap = 1;
626 printk(KERN_INFO "Using native/NAP idle loop\n");
627
628 /* Initialize debug stuff */ 607 /* Initialize debug stuff */
629 udbg_scc_init(!!strstr(cmd_line, "sccdbg")); 608 udbg_scc_init(!!strstr(cmd_line, "sccdbg"));
630 udbg_adb_init(!!strstr(cmd_line, "btextdbg")); 609 udbg_adb_init(!!strstr(cmd_line, "btextdbg"));
@@ -650,6 +629,12 @@ static int __init pmac_declare_of_platform_devices(void)
650{ 629{
651 struct device_node *np; 630 struct device_node *np;
652 631
632 if (machine_is(chrp))
633 return -1;
634
635 if (!machine_is(powermac))
636 return 0;
637
653 np = of_find_node_by_name(NULL, "valkyrie"); 638 np = of_find_node_by_name(NULL, "valkyrie");
654 if (np) 639 if (np)
655 of_platform_device_create(np, "valkyrie", NULL); 640 of_platform_device_create(np, "valkyrie", NULL);
@@ -670,12 +655,15 @@ device_initcall(pmac_declare_of_platform_devices);
670/* 655/*
671 * Called very early, MMU is off, device-tree isn't unflattened 656 * Called very early, MMU is off, device-tree isn't unflattened
672 */ 657 */
673static int __init pmac_probe(int platform) 658static int __init pmac_probe(void)
674{ 659{
675#ifdef CONFIG_PPC64 660 unsigned long root = of_get_flat_dt_root();
676 if (platform != PLATFORM_POWERMAC) 661
662 if (!of_flat_dt_is_compatible(root, "Power Macintosh") &&
663 !of_flat_dt_is_compatible(root, "MacRISC"))
677 return 0; 664 return 0;
678 665
666#ifdef CONFIG_PPC64
679 /* 667 /*
680 * On U3, the DART (iommu) must be allocated now since it 668 * On U3, the DART (iommu) must be allocated now since it
681 * has an impact on htab_initialize (due to the large page it 669 * has an impact on htab_initialize (due to the large page it
@@ -685,6 +673,23 @@ static int __init pmac_probe(int platform)
685 alloc_dart_table(); 673 alloc_dart_table();
686#endif 674#endif
687 675
676#ifdef CONFIG_PPC32
677 /* isa_io_base gets set in pmac_pci_init */
678 isa_mem_base = PMAC_ISA_MEM_BASE;
679 pci_dram_offset = PMAC_PCI_DRAM_OFFSET;
680 ISA_DMA_THRESHOLD = ~0L;
681 DMA_MODE_READ = 1;
682 DMA_MODE_WRITE = 2;
683
684#if defined(CONFIG_BLK_DEV_IDE) || defined(CONFIG_BLK_DEV_IDE_MODULE)
685#ifdef CONFIG_BLK_DEV_IDE_PMAC
686 ppc_ide_md.ide_init_hwif = pmac_ide_init_hwif_ports;
687 ppc_ide_md.default_io_base = pmac_ide_get_base;
688#endif /* CONFIG_BLK_DEV_IDE_PMAC */
689#endif /* defined(CONFIG_BLK_DEV_IDE) || defined(CONFIG_BLK_DEV_IDE_MODULE) */
690
691#endif /* CONFIG_PPC32 */
692
688#ifdef CONFIG_PMAC_SMU 693#ifdef CONFIG_PMAC_SMU
689 /* 694 /*
690 * SMU based G5s need some memory below 2Gb, at least the current 695 * SMU based G5s need some memory below 2Gb, at least the current
@@ -713,10 +718,8 @@ static int pmac_pci_probe_mode(struct pci_bus *bus)
713} 718}
714#endif 719#endif
715 720
716struct machdep_calls __initdata pmac_md = { 721define_machine(powermac) {
717#if defined(CONFIG_HOTPLUG_CPU) && defined(CONFIG_PPC64) 722 .name = "PowerMac",
718 .cpu_die = generic_mach_cpu_die,
719#endif
720 .probe = pmac_probe, 723 .probe = pmac_probe,
721 .setup_arch = pmac_setup_arch, 724 .setup_arch = pmac_setup_arch,
722 .init_early = pmac_init_early, 725 .init_early = pmac_init_early,
@@ -737,7 +740,7 @@ struct machdep_calls __initdata pmac_md = {
737 .progress = udbg_progress, 740 .progress = udbg_progress,
738#ifdef CONFIG_PPC64 741#ifdef CONFIG_PPC64
739 .pci_probe_mode = pmac_pci_probe_mode, 742 .pci_probe_mode = pmac_pci_probe_mode,
740 .idle_loop = native_idle, 743 .power_save = power4_idle,
741 .enable_pmcs = power4_enable_pmcs, 744 .enable_pmcs = power4_enable_pmcs,
742#ifdef CONFIG_KEXEC 745#ifdef CONFIG_KEXEC
743 .machine_kexec = default_machine_kexec, 746 .machine_kexec = default_machine_kexec,
@@ -750,4 +753,7 @@ struct machdep_calls __initdata pmac_md = {
750 .pcibios_after_init = pmac_pcibios_after_init, 753 .pcibios_after_init = pmac_pcibios_after_init,
751 .phys_mem_access_prot = pci_phys_mem_access_prot, 754 .phys_mem_access_prot = pci_phys_mem_access_prot,
752#endif 755#endif
756#if defined(CONFIG_HOTPLUG_CPU) && defined(CONFIG_PPC64)
757 .cpu_die = generic_mach_cpu_die,
758#endif
753}; 759};
diff --git a/arch/powerpc/platforms/powermac/smp.c b/arch/powerpc/platforms/powermac/smp.c
index 6d64a9bf3474..1065d87fc279 100644
--- a/arch/powerpc/platforms/powermac/smp.c
+++ b/arch/powerpc/platforms/powermac/smp.c
@@ -191,9 +191,7 @@ static void smp_psurge_message_pass(int target, int msg)
191 if (num_online_cpus() < 2) 191 if (num_online_cpus() < 2)
192 return; 192 return;
193 193
194 for (i = 0; i < NR_CPUS; i++) { 194 for_each_online_cpu(i) {
195 if (!cpu_online(i))
196 continue;
197 if (target == MSG_ALL 195 if (target == MSG_ALL
198 || (target == MSG_ALL_BUT_SELF && i != smp_processor_id()) 196 || (target == MSG_ALL_BUT_SELF && i != smp_processor_id())
199 || target == i) { 197 || target == i) {
diff --git a/arch/powerpc/platforms/powermac/time.c b/arch/powerpc/platforms/powermac/time.c
index 5d9afa1fa02d..890758aa9667 100644
--- a/arch/powerpc/platforms/powermac/time.c
+++ b/arch/powerpc/platforms/powermac/time.c
@@ -336,10 +336,10 @@ static struct pmu_sleep_notifier time_sleep_notifier = {
336 */ 336 */
337void __init pmac_calibrate_decr(void) 337void __init pmac_calibrate_decr(void)
338{ 338{
339#ifdef CONFIG_PM 339#if defined(CONFIG_PM) && defined(CONFIG_ADB_PMU)
340 /* XXX why here? */ 340 /* XXX why here? */
341 pmu_register_sleep_notifier(&time_sleep_notifier); 341 pmu_register_sleep_notifier(&time_sleep_notifier);
342#endif /* CONFIG_PM */ 342#endif
343 343
344 generic_calibrate_decr(); 344 generic_calibrate_decr();
345 345
diff --git a/arch/powerpc/platforms/powermac/udbg_scc.c b/arch/powerpc/platforms/powermac/udbg_scc.c
index c4352a8db644..b4fa9f03b461 100644
--- a/arch/powerpc/platforms/powermac/udbg_scc.c
+++ b/arch/powerpc/platforms/powermac/udbg_scc.c
@@ -116,7 +116,7 @@ void udbg_scc_init(int force_scc)
116 /* Setup for 57600 8N1 */ 116 /* Setup for 57600 8N1 */
117 if (ch == ch_a) 117 if (ch == ch_a)
118 addr += 0x20; 118 addr += 0x20;
119 sccc = (volatile u8 * __iomem) ioremap(addr & PAGE_MASK, PAGE_SIZE) ; 119 sccc = ioremap(addr & PAGE_MASK, PAGE_SIZE) ;
120 sccc += addr & ~PAGE_MASK; 120 sccc += addr & ~PAGE_MASK;
121 sccd = sccc + 0x10; 121 sccd = sccc + 0x10;
122 122
diff --git a/arch/powerpc/platforms/pseries/Kconfig b/arch/powerpc/platforms/pseries/Kconfig
index 4e5c8f8d869d..a57032cf6f1b 100644
--- a/arch/powerpc/platforms/pseries/Kconfig
+++ b/arch/powerpc/platforms/pseries/Kconfig
@@ -19,7 +19,7 @@ config SCANLOG
19 depends on RTAS_PROC && PPC_PSERIES 19 depends on RTAS_PROC && PPC_PSERIES
20 20
21config LPARCFG 21config LPARCFG
22 tristate "LPAR Configuration Data" 22 bool "LPAR Configuration Data"
23 depends on PPC_PSERIES || PPC_ISERIES 23 depends on PPC_PSERIES || PPC_ISERIES
24 help 24 help
25 Provide system capacity information via human readable 25 Provide system capacity information via human readable
diff --git a/arch/powerpc/platforms/pseries/Makefile b/arch/powerpc/platforms/pseries/Makefile
index 61616d144072..930898635c9f 100644
--- a/arch/powerpc/platforms/pseries/Makefile
+++ b/arch/powerpc/platforms/pseries/Makefile
@@ -1,5 +1,6 @@
1obj-y := pci.o lpar.o hvCall.o nvram.o reconfig.o \ 1obj-y := pci.o lpar.o hvCall.o nvram.o reconfig.o \
2 setup.o iommu.o ras.o rtasd.o pci_dlpar.o 2 setup.o iommu.o ras.o rtasd.o pci_dlpar.o \
3 firmware.o
3obj-$(CONFIG_SMP) += smp.o 4obj-$(CONFIG_SMP) += smp.o
4obj-$(CONFIG_IBMVIO) += vio.o 5obj-$(CONFIG_IBMVIO) += vio.o
5obj-$(CONFIG_XICS) += xics.o 6obj-$(CONFIG_XICS) += xics.o
diff --git a/arch/powerpc/platforms/pseries/eeh.c b/arch/powerpc/platforms/pseries/eeh.c
index 2ab9dcdfb415..9b2b1cb117b3 100644
--- a/arch/powerpc/platforms/pseries/eeh.c
+++ b/arch/powerpc/platforms/pseries/eeh.c
@@ -1018,7 +1018,7 @@ static int __init eeh_init_proc(void)
1018{ 1018{
1019 struct proc_dir_entry *e; 1019 struct proc_dir_entry *e;
1020 1020
1021 if (platform_is_pseries()) { 1021 if (machine_is(pseries)) {
1022 e = create_proc_entry("ppc64/eeh", 0, NULL); 1022 e = create_proc_entry("ppc64/eeh", 0, NULL);
1023 if (e) 1023 if (e)
1024 e->proc_fops = &proc_eeh_operations; 1024 e->proc_fops = &proc_eeh_operations;
diff --git a/arch/powerpc/platforms/pseries/eeh_driver.c b/arch/powerpc/platforms/pseries/eeh_driver.c
index b811d5ff92fe..cc2495a0cdd5 100644
--- a/arch/powerpc/platforms/pseries/eeh_driver.c
+++ b/arch/powerpc/platforms/pseries/eeh_driver.c
@@ -257,6 +257,7 @@ void handle_eeh_events (struct eeh_event *event)
257 struct pci_bus *frozen_bus; 257 struct pci_bus *frozen_bus;
258 int rc = 0; 258 int rc = 0;
259 enum pci_ers_result result = PCI_ERS_RESULT_NONE; 259 enum pci_ers_result result = PCI_ERS_RESULT_NONE;
260 const char *pci_str, *drv_str;
260 261
261 frozen_dn = find_device_pe(event->dn); 262 frozen_dn = find_device_pe(event->dn);
262 frozen_bus = pcibios_find_pci_bus(frozen_dn); 263 frozen_bus = pcibios_find_pci_bus(frozen_dn);
@@ -291,6 +292,13 @@ void handle_eeh_events (struct eeh_event *event)
291 292
292 frozen_pdn = PCI_DN(frozen_dn); 293 frozen_pdn = PCI_DN(frozen_dn);
293 frozen_pdn->eeh_freeze_count++; 294 frozen_pdn->eeh_freeze_count++;
295
296 pci_str = pci_name (frozen_pdn->pcidev);
297 drv_str = pcid_name (frozen_pdn->pcidev);
298 if (!pci_str) {
299 pci_str = pci_name (event->dev);
300 drv_str = pcid_name (event->dev);
301 }
294 302
295 if (frozen_pdn->eeh_freeze_count > EEH_MAX_ALLOWED_FREEZES) 303 if (frozen_pdn->eeh_freeze_count > EEH_MAX_ALLOWED_FREEZES)
296 goto hard_fail; 304 goto hard_fail;
@@ -306,9 +314,7 @@ void handle_eeh_events (struct eeh_event *event)
306 eeh_slot_error_detail(frozen_pdn, 1 /* Temporary Error */); 314 eeh_slot_error_detail(frozen_pdn, 1 /* Temporary Error */);
307 printk(KERN_WARNING 315 printk(KERN_WARNING
308 "EEH: This PCI device has failed %d times since last reboot: %s - %s\n", 316 "EEH: This PCI device has failed %d times since last reboot: %s - %s\n",
309 frozen_pdn->eeh_freeze_count, 317 frozen_pdn->eeh_freeze_count, drv_str, pci_str);
310 pci_name (frozen_pdn->pcidev),
311 pcid_name(frozen_pdn->pcidev));
312 318
313 /* Walk the various device drivers attached to this slot through 319 /* Walk the various device drivers attached to this slot through
314 * a reset sequence, giving each an opportunity to do what it needs 320 * a reset sequence, giving each an opportunity to do what it needs
@@ -360,9 +366,7 @@ hard_fail:
360 "EEH: PCI device %s - %s has failed %d times \n" 366 "EEH: PCI device %s - %s has failed %d times \n"
361 "and has been permanently disabled. Please try reseating\n" 367 "and has been permanently disabled. Please try reseating\n"
362 "this device or replacing it.\n", 368 "this device or replacing it.\n",
363 pci_name (frozen_pdn->pcidev), 369 drv_str, pci_str, frozen_pdn->eeh_freeze_count);
364 pcid_name(frozen_pdn->pcidev),
365 frozen_pdn->eeh_freeze_count);
366 370
367 eeh_slot_error_detail(frozen_pdn, 2 /* Permanent Error */); 371 eeh_slot_error_detail(frozen_pdn, 2 /* Permanent Error */);
368 372
diff --git a/arch/powerpc/platforms/pseries/firmware.c b/arch/powerpc/platforms/pseries/firmware.c
new file mode 100644
index 000000000000..c01d8f0cbe6d
--- /dev/null
+++ b/arch/powerpc/platforms/pseries/firmware.c
@@ -0,0 +1,103 @@
1/*
2 * pSeries firmware setup code.
3 *
4 * Portions from arch/powerpc/platforms/pseries/setup.c:
5 * Copyright (C) 1995 Linus Torvalds
6 * Adapted from 'alpha' version by Gary Thomas
7 * Modified by Cort Dougan (cort@cs.nmt.edu)
8 * Modified by PPC64 Team, IBM Corp
9 *
10 * Portions from arch/powerpc/kernel/firmware.c
11 * Copyright (C) 2001 Ben. Herrenschmidt (benh@kernel.crashing.org)
12 * Modifications for ppc64:
13 * Copyright (C) 2003 Dave Engebretsen <engebret@us.ibm.com>
14 * Copyright (C) 2005 Stephen Rothwell, IBM Corporation
15 *
16 * Copyright 2006 IBM Corporation.
17 *
18 * This program is free software; you can redistribute it and/or
19 * modify it under the terms of the GNU General Public License
20 * as published by the Free Software Foundation; either version
21 * 2 of the License, or (at your option) any later version.
22 */
23
24#undef DEBUG
25
26#include <asm/firmware.h>
27#include <asm/prom.h>
28
29#ifdef DEBUG
30#define DBG(fmt...) udbg_printf(fmt)
31#else
32#define DBG(fmt...)
33#endif
34
35typedef struct {
36 unsigned long val;
37 char * name;
38} firmware_feature_t;
39
40static __initdata firmware_feature_t
41firmware_features_table[FIRMWARE_MAX_FEATURES] = {
42 {FW_FEATURE_PFT, "hcall-pft"},
43 {FW_FEATURE_TCE, "hcall-tce"},
44 {FW_FEATURE_SPRG0, "hcall-sprg0"},
45 {FW_FEATURE_DABR, "hcall-dabr"},
46 {FW_FEATURE_COPY, "hcall-copy"},
47 {FW_FEATURE_ASR, "hcall-asr"},
48 {FW_FEATURE_DEBUG, "hcall-debug"},
49 {FW_FEATURE_PERF, "hcall-perf"},
50 {FW_FEATURE_DUMP, "hcall-dump"},
51 {FW_FEATURE_INTERRUPT, "hcall-interrupt"},
52 {FW_FEATURE_MIGRATE, "hcall-migrate"},
53 {FW_FEATURE_PERFMON, "hcall-perfmon"},
54 {FW_FEATURE_CRQ, "hcall-crq"},
55 {FW_FEATURE_VIO, "hcall-vio"},
56 {FW_FEATURE_RDMA, "hcall-rdma"},
57 {FW_FEATURE_LLAN, "hcall-lLAN"},
58 {FW_FEATURE_BULK, "hcall-bulk"},
59 {FW_FEATURE_XDABR, "hcall-xdabr"},
60 {FW_FEATURE_MULTITCE, "hcall-multi-tce"},
61 {FW_FEATURE_SPLPAR, "hcall-splpar"},
62};
63
64/* Build up the firmware features bitmask using the contents of
65 * device-tree/ibm,hypertas-functions. Ultimately this functionality may
66 * be moved into prom.c prom_init().
67 */
68void __init fw_feature_init(void)
69{
70 struct device_node *dn;
71 char *hypertas, *s;
72 int len, i;
73
74 DBG(" -> fw_feature_init()\n");
75
76 dn = of_find_node_by_path("/rtas");
77 if (dn == NULL) {
78 printk(KERN_ERR "WARNING! Cannot find RTAS in device-tree!\n");
79 goto out;
80 }
81
82 hypertas = get_property(dn, "ibm,hypertas-functions", &len);
83 if (hypertas == NULL)
84 goto out;
85
86 for (s = hypertas; s < hypertas + len; s += strlen(s) + 1) {
87 for (i = 0; i < FIRMWARE_MAX_FEATURES; i++) {
88 /* check value against table of strings */
89 if (!firmware_features_table[i].name ||
90 strcmp(firmware_features_table[i].name, s))
91 continue;
92
93 /* we have a match */
94 powerpc_firmware_features |=
95 firmware_features_table[i].val;
96 break;
97 }
98 }
99
100out:
101 of_node_put(dn);
102 DBG(" <- fw_feature_init()\n");
103}
diff --git a/arch/powerpc/platforms/pseries/firmware.h b/arch/powerpc/platforms/pseries/firmware.h
new file mode 100644
index 000000000000..714f56f55362
--- /dev/null
+++ b/arch/powerpc/platforms/pseries/firmware.h
@@ -0,0 +1,17 @@
1/*
2 * Copyright 2006 IBM Corporation.
3 *
4 * This program is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU General Public License
6 * as published by the Free Software Foundation; either version
7 * 2 of the License, or (at your option) any later version.
8 */
9
10#ifndef _PSERIES_FIRMWARE_H
11#define _PSERIES_FIRMWARE_H
12
13#include <asm/firmware.h>
14
15extern void __init fw_feature_init(void);
16
17#endif /* _PSERIES_FIRMWARE_H */
diff --git a/arch/powerpc/platforms/pseries/hvCall.S b/arch/powerpc/platforms/pseries/hvCall.S
index 176e8da76466..db7c19fe9297 100644
--- a/arch/powerpc/platforms/pseries/hvCall.S
+++ b/arch/powerpc/platforms/pseries/hvCall.S
@@ -1,6 +1,4 @@
1/* 1/*
2 * arch/ppc64/kernel/pSeries_hvCall.S
3 *
4 * This file contains the generic code to perform a call to the 2 * This file contains the generic code to perform a call to the
5 * pSeries LPAR hypervisor. 3 * pSeries LPAR hypervisor.
6 * NOTE: this file will go away when we move to inline this work. 4 * NOTE: this file will go away when we move to inline this work.
diff --git a/arch/powerpc/platforms/pseries/hvconsole.c b/arch/powerpc/platforms/pseries/hvconsole.c
index 138e128a3886..ba6befd96636 100644
--- a/arch/powerpc/platforms/pseries/hvconsole.c
+++ b/arch/powerpc/platforms/pseries/hvconsole.c
@@ -62,6 +62,11 @@ int hvc_put_chars(uint32_t vtermno, const char *buf, int count)
62 unsigned long *lbuf = (unsigned long *) buf; 62 unsigned long *lbuf = (unsigned long *) buf;
63 long ret; 63 long ret;
64 64
65
66 /* hcall will ret H_PARAMETER if 'count' exceeds firmware max.*/
67 if (count > MAX_VIO_PUT_CHARS)
68 count = MAX_VIO_PUT_CHARS;
69
65 ret = plpar_hcall_norets(H_PUT_TERM_CHAR, vtermno, count, lbuf[0], 70 ret = plpar_hcall_norets(H_PUT_TERM_CHAR, vtermno, count, lbuf[0],
66 lbuf[1]); 71 lbuf[1]);
67 if (ret == H_Success) 72 if (ret == H_Success)
diff --git a/arch/powerpc/platforms/pseries/iommu.c b/arch/powerpc/platforms/pseries/iommu.c
index 48cfbfc43f99..2643078433f0 100644
--- a/arch/powerpc/platforms/pseries/iommu.c
+++ b/arch/powerpc/platforms/pseries/iommu.c
@@ -1,6 +1,4 @@
1/* 1/*
2 * arch/ppc64/kernel/pSeries_iommu.c
3 *
4 * Copyright (C) 2001 Mike Corrigan & Dave Engebretsen, IBM Corporation 2 * Copyright (C) 2001 Mike Corrigan & Dave Engebretsen, IBM Corporation
5 * 3 *
6 * Rewrite, cleanup: 4 * Rewrite, cleanup:
@@ -582,7 +580,7 @@ void iommu_init_early_pSeries(void)
582 return; 580 return;
583 } 581 }
584 582
585 if (platform_is_lpar()) { 583 if (firmware_has_feature(FW_FEATURE_LPAR)) {
586 if (firmware_has_feature(FW_FEATURE_MULTITCE)) { 584 if (firmware_has_feature(FW_FEATURE_MULTITCE)) {
587 ppc_md.tce_build = tce_buildmulti_pSeriesLP; 585 ppc_md.tce_build = tce_buildmulti_pSeriesLP;
588 ppc_md.tce_free = tce_freemulti_pSeriesLP; 586 ppc_md.tce_free = tce_freemulti_pSeriesLP;
diff --git a/arch/powerpc/platforms/pseries/pci.c b/arch/powerpc/platforms/pseries/pci.c
index 999a9620b5ce..e97e67f5e079 100644
--- a/arch/powerpc/platforms/pseries/pci.c
+++ b/arch/powerpc/platforms/pseries/pci.c
@@ -1,6 +1,4 @@
1/* 1/*
2 * arch/ppc64/kernel/pSeries_pci.c
3 *
4 * Copyright (C) 2001 Dave Engebretsen, IBM Corporation 2 * Copyright (C) 2001 Dave Engebretsen, IBM Corporation
5 * Copyright (C) 2003 Anton Blanchard <anton@au.ibm.com>, IBM 3 * Copyright (C) 2003 Anton Blanchard <anton@au.ibm.com>, IBM
6 * 4 *
@@ -122,7 +120,7 @@ static void fixup_winbond_82c105(struct pci_dev* dev)
122 int i; 120 int i;
123 unsigned int reg; 121 unsigned int reg;
124 122
125 if (!platform_is_pseries()) 123 if (!machine_is(pseries))
126 return; 124 return;
127 125
128 printk("Using INTC for W82c105 IDE controller.\n"); 126 printk("Using INTC for W82c105 IDE controller.\n");
diff --git a/arch/powerpc/platforms/pseries/pci_dlpar.c b/arch/powerpc/platforms/pseries/pci_dlpar.c
index f3bad900bbcf..6bfacc217085 100644
--- a/arch/powerpc/platforms/pseries/pci_dlpar.c
+++ b/arch/powerpc/platforms/pseries/pci_dlpar.c
@@ -27,6 +27,8 @@
27 27
28#include <linux/pci.h> 28#include <linux/pci.h>
29#include <asm/pci-bridge.h> 29#include <asm/pci-bridge.h>
30#include <asm/ppc-pci.h>
31#include <asm/firmware.h>
30 32
31static struct pci_bus * 33static struct pci_bus *
32find_bus_among_children(struct pci_bus *bus, 34find_bus_among_children(struct pci_bus *bus,
@@ -151,20 +153,24 @@ pcibios_pci_config_bridge(struct pci_dev *dev)
151void 153void
152pcibios_add_pci_devices(struct pci_bus * bus) 154pcibios_add_pci_devices(struct pci_bus * bus)
153{ 155{
154 int slotno, num; 156 int slotno, num, mode;
155 struct pci_dev *dev; 157 struct pci_dev *dev;
156 struct device_node *dn = pci_bus_to_OF_node(bus); 158 struct device_node *dn = pci_bus_to_OF_node(bus);
157 159
158 eeh_add_device_tree_early(dn); 160 eeh_add_device_tree_early(dn);
159 161
160 if (_machine == PLATFORM_PSERIES_LPAR) { 162 mode = PCI_PROBE_NORMAL;
163 if (ppc_md.pci_probe_mode)
164 mode = ppc_md.pci_probe_mode(bus);
165
166 if (mode == PCI_PROBE_DEVTREE) {
161 /* use ofdt-based probe */ 167 /* use ofdt-based probe */
162 of_scan_bus(dn, bus); 168 of_scan_bus(dn, bus);
163 if (!list_empty(&bus->devices)) { 169 if (!list_empty(&bus->devices)) {
164 pcibios_fixup_new_pci_devices(bus, 0); 170 pcibios_fixup_new_pci_devices(bus, 0);
165 pci_bus_add_devices(bus); 171 pci_bus_add_devices(bus);
166 } 172 }
167 } else { 173 } else if (mode == PCI_PROBE_NORMAL) {
168 /* use legacy probe */ 174 /* use legacy probe */
169 slotno = PCI_SLOT(PCI_DN(dn->child)->devfn); 175 slotno = PCI_SLOT(PCI_DN(dn->child)->devfn);
170 num = pci_scan_slot(bus, PCI_DEVFN(slotno, 0)); 176 num = pci_scan_slot(bus, PCI_DEVFN(slotno, 0));
@@ -179,3 +185,30 @@ pcibios_add_pci_devices(struct pci_bus * bus)
179 } 185 }
180} 186}
181EXPORT_SYMBOL_GPL(pcibios_add_pci_devices); 187EXPORT_SYMBOL_GPL(pcibios_add_pci_devices);
188
189struct pci_controller * __devinit init_phb_dynamic(struct device_node *dn)
190{
191 struct pci_controller *phb;
192 int primary;
193
194 primary = list_empty(&hose_list);
195 phb = pcibios_alloc_controller(dn);
196 if (!phb)
197 return NULL;
198 setup_phb(dn, phb);
199 pci_process_bridge_OF_ranges(phb, dn, 0);
200
201 pci_setup_phb_io_dynamic(phb, primary);
202
203 pci_devs_phb_init_dynamic(phb);
204
205 if (dn->child)
206 eeh_add_device_tree_early(dn);
207
208 scan_phb(phb);
209 pcibios_fixup_new_pci_devices(phb->bus, 0);
210 pci_bus_add_devices(phb->bus);
211
212 return phb;
213}
214EXPORT_SYMBOL_GPL(init_phb_dynamic);
diff --git a/arch/powerpc/platforms/pseries/ras.c b/arch/powerpc/platforms/pseries/ras.c
index b046bcf7443d..9639c66b453d 100644
--- a/arch/powerpc/platforms/pseries/ras.c
+++ b/arch/powerpc/platforms/pseries/ras.c
@@ -132,7 +132,7 @@ static int __init init_ras_IRQ(void)
132 of_node_put(np); 132 of_node_put(np);
133 } 133 }
134 134
135 return 1; 135 return 0;
136} 136}
137__initcall(init_ras_IRQ); 137__initcall(init_ras_IRQ);
138 138
diff --git a/arch/powerpc/platforms/pseries/reconfig.c b/arch/powerpc/platforms/pseries/reconfig.c
index 86cfa6ecdcf3..1773103354be 100644
--- a/arch/powerpc/platforms/pseries/reconfig.c
+++ b/arch/powerpc/platforms/pseries/reconfig.c
@@ -17,8 +17,9 @@
17#include <linux/proc_fs.h> 17#include <linux/proc_fs.h>
18 18
19#include <asm/prom.h> 19#include <asm/prom.h>
20#include <asm/pSeries_reconfig.h> 20#include <asm/machdep.h>
21#include <asm/uaccess.h> 21#include <asm/uaccess.h>
22#include <asm/pSeries_reconfig.h>
22 23
23 24
24 25
@@ -94,16 +95,16 @@ static struct device_node *derive_parent(const char *path)
94 return parent; 95 return parent;
95} 96}
96 97
97static struct notifier_block *pSeries_reconfig_chain; 98static BLOCKING_NOTIFIER_HEAD(pSeries_reconfig_chain);
98 99
99int pSeries_reconfig_notifier_register(struct notifier_block *nb) 100int pSeries_reconfig_notifier_register(struct notifier_block *nb)
100{ 101{
101 return notifier_chain_register(&pSeries_reconfig_chain, nb); 102 return blocking_notifier_chain_register(&pSeries_reconfig_chain, nb);
102} 103}
103 104
104void pSeries_reconfig_notifier_unregister(struct notifier_block *nb) 105void pSeries_reconfig_notifier_unregister(struct notifier_block *nb)
105{ 106{
106 notifier_chain_unregister(&pSeries_reconfig_chain, nb); 107 blocking_notifier_chain_unregister(&pSeries_reconfig_chain, nb);
107} 108}
108 109
109static int pSeries_reconfig_add_node(const char *path, struct property *proplist) 110static int pSeries_reconfig_add_node(const char *path, struct property *proplist)
@@ -131,7 +132,7 @@ static int pSeries_reconfig_add_node(const char *path, struct property *proplist
131 goto out_err; 132 goto out_err;
132 } 133 }
133 134
134 err = notifier_call_chain(&pSeries_reconfig_chain, 135 err = blocking_notifier_call_chain(&pSeries_reconfig_chain,
135 PSERIES_RECONFIG_ADD, np); 136 PSERIES_RECONFIG_ADD, np);
136 if (err == NOTIFY_BAD) { 137 if (err == NOTIFY_BAD) {
137 printk(KERN_ERR "Failed to add device node %s\n", path); 138 printk(KERN_ERR "Failed to add device node %s\n", path);
@@ -171,7 +172,7 @@ static int pSeries_reconfig_remove_node(struct device_node *np)
171 172
172 remove_node_proc_entries(np); 173 remove_node_proc_entries(np);
173 174
174 notifier_call_chain(&pSeries_reconfig_chain, 175 blocking_notifier_call_chain(&pSeries_reconfig_chain,
175 PSERIES_RECONFIG_REMOVE, np); 176 PSERIES_RECONFIG_REMOVE, np);
176 of_detach_node(np); 177 of_detach_node(np);
177 178
@@ -508,7 +509,7 @@ static int proc_ppc64_create_ofdt(void)
508{ 509{
509 struct proc_dir_entry *ent; 510 struct proc_dir_entry *ent;
510 511
511 if (!platform_is_pseries()) 512 if (!machine_is(pseries))
512 return 0; 513 return 0;
513 514
514 ent = create_proc_entry("ppc64/ofdt", S_IWUSR, NULL); 515 ent = create_proc_entry("ppc64/ofdt", S_IWUSR, NULL);
diff --git a/arch/powerpc/platforms/pseries/rtasd.c b/arch/powerpc/platforms/pseries/rtasd.c
index a6f628d4c9dc..fcc4d561a236 100644
--- a/arch/powerpc/platforms/pseries/rtasd.c
+++ b/arch/powerpc/platforms/pseries/rtasd.c
@@ -27,6 +27,7 @@
27#include <asm/prom.h> 27#include <asm/prom.h>
28#include <asm/nvram.h> 28#include <asm/nvram.h>
29#include <asm/atomic.h> 29#include <asm/atomic.h>
30#include <asm/machdep.h>
30 31
31#if 0 32#if 0
32#define DEBUG(A...) printk(KERN_ERR A) 33#define DEBUG(A...) printk(KERN_ERR A)
@@ -481,7 +482,7 @@ static int __init rtas_init(void)
481{ 482{
482 struct proc_dir_entry *entry; 483 struct proc_dir_entry *entry;
483 484
484 if (!platform_is_pseries()) 485 if (!machine_is(pseries))
485 return 0; 486 return 0;
486 487
487 /* No RTAS */ 488 /* No RTAS */
diff --git a/arch/powerpc/platforms/pseries/setup.c b/arch/powerpc/platforms/pseries/setup.c
index 9edeca83f434..b2fbf8ba8fbb 100644
--- a/arch/powerpc/platforms/pseries/setup.c
+++ b/arch/powerpc/platforms/pseries/setup.c
@@ -60,7 +60,6 @@
60#include <asm/time.h> 60#include <asm/time.h>
61#include <asm/nvram.h> 61#include <asm/nvram.h>
62#include "xics.h" 62#include "xics.h"
63#include <asm/firmware.h>
64#include <asm/pmc.h> 63#include <asm/pmc.h>
65#include <asm/mpic.h> 64#include <asm/mpic.h>
66#include <asm/ppc-pci.h> 65#include <asm/ppc-pci.h>
@@ -70,6 +69,7 @@
70 69
71#include "plpar_wrappers.h" 70#include "plpar_wrappers.h"
72#include "ras.h" 71#include "ras.h"
72#include "firmware.h"
73 73
74#ifdef DEBUG 74#ifdef DEBUG
75#define DBG(fmt...) udbg_printf(fmt) 75#define DBG(fmt...) udbg_printf(fmt)
@@ -81,8 +81,8 @@ extern void find_udbg_vterm(void);
81 81
82int fwnmi_active; /* TRUE if an FWNMI handler is present */ 82int fwnmi_active; /* TRUE if an FWNMI handler is present */
83 83
84static void pseries_shared_idle(void); 84static void pseries_shared_idle_sleep(void);
85static void pseries_dedicated_idle(void); 85static void pseries_dedicated_idle_sleep(void);
86 86
87struct mpic *pSeries_mpic; 87struct mpic *pSeries_mpic;
88 88
@@ -236,17 +236,16 @@ static void __init pSeries_setup_arch(void)
236 vpa_init(boot_cpuid); 236 vpa_init(boot_cpuid);
237 if (get_lppaca()->shared_proc) { 237 if (get_lppaca()->shared_proc) {
238 printk(KERN_INFO "Using shared processor idle loop\n"); 238 printk(KERN_INFO "Using shared processor idle loop\n");
239 ppc_md.idle_loop = pseries_shared_idle; 239 ppc_md.power_save = pseries_shared_idle_sleep;
240 } else { 240 } else {
241 printk(KERN_INFO "Using dedicated idle loop\n"); 241 printk(KERN_INFO "Using dedicated idle loop\n");
242 ppc_md.idle_loop = pseries_dedicated_idle; 242 ppc_md.power_save = pseries_dedicated_idle_sleep;
243 } 243 }
244 } else { 244 } else {
245 printk(KERN_INFO "Using default idle loop\n"); 245 printk(KERN_INFO "Using default idle loop\n");
246 ppc_md.idle_loop = default_idle;
247 } 246 }
248 247
249 if (platform_is_lpar()) 248 if (firmware_has_feature(FW_FEATURE_LPAR))
250 ppc_md.enable_pmcs = pseries_lpar_enable_pmcs; 249 ppc_md.enable_pmcs = pseries_lpar_enable_pmcs;
251 else 250 else
252 ppc_md.enable_pmcs = power4_enable_pmcs; 251 ppc_md.enable_pmcs = power4_enable_pmcs;
@@ -262,53 +261,6 @@ static int __init pSeries_init_panel(void)
262} 261}
263arch_initcall(pSeries_init_panel); 262arch_initcall(pSeries_init_panel);
264 263
265
266/* Build up the ppc64_firmware_features bitmask field
267 * using contents of device-tree/ibm,hypertas-functions.
268 * Ultimately this functionality may be moved into prom.c prom_init().
269 */
270static void __init fw_feature_init(void)
271{
272 struct device_node * dn;
273 char * hypertas;
274 unsigned int len;
275
276 DBG(" -> fw_feature_init()\n");
277
278 ppc64_firmware_features = 0;
279 dn = of_find_node_by_path("/rtas");
280 if (dn == NULL) {
281 printk(KERN_ERR "WARNING ! Cannot find RTAS in device-tree !\n");
282 goto no_rtas;
283 }
284
285 hypertas = get_property(dn, "ibm,hypertas-functions", &len);
286 if (hypertas) {
287 while (len > 0){
288 int i, hypertas_len;
289 /* check value against table of strings */
290 for(i=0; i < FIRMWARE_MAX_FEATURES ;i++) {
291 if ((firmware_features_table[i].name) &&
292 (strcmp(firmware_features_table[i].name,hypertas))==0) {
293 /* we have a match */
294 ppc64_firmware_features |=
295 (firmware_features_table[i].val);
296 break;
297 }
298 }
299 hypertas_len = strlen(hypertas);
300 len -= hypertas_len +1;
301 hypertas+= hypertas_len +1;
302 }
303 }
304
305 of_node_put(dn);
306no_rtas:
307
308 DBG(" <- fw_feature_init()\n");
309}
310
311
312static void __init pSeries_discover_pic(void) 264static void __init pSeries_discover_pic(void)
313{ 265{
314 struct device_node *np; 266 struct device_node *np;
@@ -367,21 +319,16 @@ static int pseries_set_xdabr(unsigned long dabr)
367 */ 319 */
368static void __init pSeries_init_early(void) 320static void __init pSeries_init_early(void)
369{ 321{
370 int iommu_off = 0;
371
372 DBG(" -> pSeries_init_early()\n"); 322 DBG(" -> pSeries_init_early()\n");
373 323
374 fw_feature_init(); 324 fw_feature_init();
375 325
376 if (platform_is_lpar()) 326 if (firmware_has_feature(FW_FEATURE_LPAR))
377 hpte_init_lpar(); 327 hpte_init_lpar();
378 else { 328 else
379 hpte_init_native(); 329 hpte_init_native();
380 iommu_off = (of_chosen &&
381 get_property(of_chosen, "linux,iommu-off", NULL));
382 }
383 330
384 if (platform_is_lpar()) 331 if (firmware_has_feature(FW_FEATURE_LPAR))
385 find_udbg_vterm(); 332 find_udbg_vterm();
386 333
387 if (firmware_has_feature(FW_FEATURE_DABR)) 334 if (firmware_has_feature(FW_FEATURE_DABR))
@@ -425,158 +372,128 @@ static int pSeries_check_legacy_ioport(unsigned int baseport)
425/* 372/*
426 * Called very early, MMU is off, device-tree isn't unflattened 373 * Called very early, MMU is off, device-tree isn't unflattened
427 */ 374 */
428extern struct machdep_calls pSeries_md;
429 375
430static int __init pSeries_probe(int platform) 376static int __init pSeries_probe_hypertas(unsigned long node,
377 const char *uname, int depth,
378 void *data)
431{ 379{
432 if (platform != PLATFORM_PSERIES && 380 if (depth != 1 ||
433 platform != PLATFORM_PSERIES_LPAR) 381 (strcmp(uname, "rtas") != 0 && strcmp(uname, "rtas@0") != 0))
434 return 0; 382 return 0;
435 383
436 /* if we have some ppc_md fixups for LPAR to do, do 384 if (of_get_flat_dt_prop(node, "ibm,hypertas-functions", NULL) != NULL)
437 * it here ... 385 powerpc_firmware_features |= FW_FEATURE_LPAR;
438 */
439 386
440 return 1; 387 return 1;
441} 388}
442 389
443DECLARE_PER_CPU(unsigned long, smt_snooze_delay); 390static int __init pSeries_probe(void)
444
445static inline void dedicated_idle_sleep(unsigned int cpu)
446{ 391{
447 struct lppaca *plppaca = &lppaca[cpu ^ 1]; 392 char *dtype = of_get_flat_dt_prop(of_get_flat_dt_root(),
393 "device_type", NULL);
394 if (dtype == NULL)
395 return 0;
396 if (strcmp(dtype, "chrp"))
397 return 0;
448 398
449 /* Only sleep if the other thread is not idle */ 399 DBG("pSeries detected, looking for LPAR capability...\n");
450 if (!(plppaca->idle)) {
451 local_irq_disable();
452 400
453 /* 401 /* Now try to figure out if we are running on LPAR */
454 * We are about to sleep the thread and so wont be polling any 402 of_scan_flat_dt(pSeries_probe_hypertas, NULL);
455 * more. 403
456 */ 404 DBG("Machine is%s LPAR !\n",
457 clear_thread_flag(TIF_POLLING_NRFLAG); 405 (powerpc_firmware_features & FW_FEATURE_LPAR) ? "" : " not");
458 smp_mb__after_clear_bit(); 406
459 407 return 1;
460 /*
461 * SMT dynamic mode. Cede will result in this thread going
462 * dormant, if the partner thread is still doing work. Thread
463 * wakes up if partner goes idle, an interrupt is presented, or
464 * a prod occurs. Returning from the cede enables external
465 * interrupts.
466 */
467 if (!need_resched())
468 cede_processor();
469 else
470 local_irq_enable();
471 set_thread_flag(TIF_POLLING_NRFLAG);
472 } else {
473 /*
474 * Give the HV an opportunity at the processor, since we are
475 * not doing any work.
476 */
477 poll_pending();
478 }
479} 408}
480 409
481static void pseries_dedicated_idle(void) 410
411DECLARE_PER_CPU(unsigned long, smt_snooze_delay);
412
413static void pseries_dedicated_idle_sleep(void)
482{ 414{
483 unsigned int cpu = smp_processor_id(); 415 unsigned int cpu = smp_processor_id();
484 unsigned long start_snooze; 416 unsigned long start_snooze;
485 unsigned long *smt_snooze_delay = &__get_cpu_var(smt_snooze_delay); 417 unsigned long *smt_snooze_delay = &__get_cpu_var(smt_snooze_delay);
486 set_thread_flag(TIF_POLLING_NRFLAG);
487
488 while (1) {
489 /*
490 * Indicate to the HV that we are idle. Now would be
491 * a good time to find other work to dispatch.
492 */
493 get_lppaca()->idle = 1;
494
495 if (!need_resched()) {
496 start_snooze = get_tb() +
497 *smt_snooze_delay * tb_ticks_per_usec;
498
499 while (!need_resched() && !cpu_is_offline(cpu)) {
500 ppc64_runlatch_off();
501
502 /*
503 * Go into low thread priority and possibly
504 * low power mode.
505 */
506 HMT_low();
507 HMT_very_low();
508
509 if (*smt_snooze_delay != 0 &&
510 get_tb() > start_snooze) {
511 HMT_medium();
512 dedicated_idle_sleep(cpu);
513 }
514
515 }
516
517 HMT_medium();
518 }
519 418
520 get_lppaca()->idle = 0; 419 /*
521 ppc64_runlatch_on(); 420 * Indicate to the HV that we are idle. Now would be
522 421 * a good time to find other work to dispatch.
523 preempt_enable_no_resched(); 422 */
524 schedule(); 423 get_lppaca()->idle = 1;
525 preempt_disable();
526 424
527 if (cpu_is_offline(cpu) && system_state == SYSTEM_RUNNING) 425 /*
528 cpu_die(); 426 * We come in with interrupts disabled, and need_resched()
529 } 427 * has been checked recently. If we should poll for a little
530} 428 * while, do so.
429 */
430 if (*smt_snooze_delay) {
431 start_snooze = get_tb() +
432 *smt_snooze_delay * tb_ticks_per_usec;
433 local_irq_enable();
434 set_thread_flag(TIF_POLLING_NRFLAG);
531 435
532static void pseries_shared_idle(void) 436 while (get_tb() < start_snooze) {
533{ 437 if (need_resched() || cpu_is_offline(cpu))
534 unsigned int cpu = smp_processor_id(); 438 goto out;
439 ppc64_runlatch_off();
440 HMT_low();
441 HMT_very_low();
442 }
535 443
536 while (1) { 444 HMT_medium();
537 /* 445 clear_thread_flag(TIF_POLLING_NRFLAG);
538 * Indicate to the HV that we are idle. Now would be 446 smp_mb();
539 * a good time to find other work to dispatch. 447 local_irq_disable();
540 */ 448 if (need_resched() || cpu_is_offline(cpu))
541 get_lppaca()->idle = 1; 449 goto out;
450 }
542 451
543 while (!need_resched() && !cpu_is_offline(cpu)) { 452 /*
544 local_irq_disable(); 453 * Cede if the other thread is not idle, so that it can
545 ppc64_runlatch_off(); 454 * go single-threaded. If the other thread is idle,
455 * we ask the hypervisor if it has pending work it
456 * wants to do and cede if it does. Otherwise we keep
457 * polling in order to reduce interrupt latency.
458 *
459 * Doing the cede when the other thread is active will
460 * result in this thread going dormant, meaning the other
461 * thread gets to run in single-threaded (ST) mode, which
462 * is slightly faster than SMT mode with this thread at
463 * very low priority. The cede enables interrupts, which
464 * doesn't matter here.
465 */
466 if (!lppaca[cpu ^ 1].idle || poll_pending() == H_Pending)
467 cede_processor();
546 468
547 /* 469out:
548 * Yield the processor to the hypervisor. We return if 470 HMT_medium();
549 * an external interrupt occurs (which are driven prior 471 get_lppaca()->idle = 0;
550 * to returning here) or if a prod occurs from another 472}
551 * processor. When returning here, external interrupts
552 * are enabled.
553 *
554 * Check need_resched() again with interrupts disabled
555 * to avoid a race.
556 */
557 if (!need_resched())
558 cede_processor();
559 else
560 local_irq_enable();
561
562 HMT_medium();
563 }
564 473
565 get_lppaca()->idle = 0; 474static void pseries_shared_idle_sleep(void)
566 ppc64_runlatch_on(); 475{
476 /*
477 * Indicate to the HV that we are idle. Now would be
478 * a good time to find other work to dispatch.
479 */
480 get_lppaca()->idle = 1;
567 481
568 preempt_enable_no_resched(); 482 /*
569 schedule(); 483 * Yield the processor to the hypervisor. We return if
570 preempt_disable(); 484 * an external interrupt occurs (which are driven prior
485 * to returning here) or if a prod occurs from another
486 * processor. When returning here, external interrupts
487 * are enabled.
488 */
489 cede_processor();
571 490
572 if (cpu_is_offline(cpu) && system_state == SYSTEM_RUNNING) 491 get_lppaca()->idle = 0;
573 cpu_die();
574 }
575} 492}
576 493
577static int pSeries_pci_probe_mode(struct pci_bus *bus) 494static int pSeries_pci_probe_mode(struct pci_bus *bus)
578{ 495{
579 if (platform_is_lpar()) 496 if (firmware_has_feature(FW_FEATURE_LPAR))
580 return PCI_PROBE_DEVTREE; 497 return PCI_PROBE_DEVTREE;
581 return PCI_PROBE_NORMAL; 498 return PCI_PROBE_NORMAL;
582} 499}
@@ -602,7 +519,8 @@ static void pseries_kexec_cpu_down(int crash_shutdown, int secondary)
602} 519}
603#endif 520#endif
604 521
605struct machdep_calls __initdata pSeries_md = { 522define_machine(pseries) {
523 .name = "pSeries",
606 .probe = pSeries_probe, 524 .probe = pSeries_probe,
607 .setup_arch = pSeries_setup_arch, 525 .setup_arch = pSeries_setup_arch,
608 .init_early = pSeries_init_early, 526 .init_early = pSeries_init_early,
diff --git a/arch/powerpc/platforms/pseries/smp.c b/arch/powerpc/platforms/pseries/smp.c
index 8d710af50756..3cf78a6cd27c 100644
--- a/arch/powerpc/platforms/pseries/smp.c
+++ b/arch/powerpc/platforms/pseries/smp.c
@@ -443,7 +443,7 @@ void __init smp_init_pSeries(void)
443 smp_ops->cpu_die = pSeries_cpu_die; 443 smp_ops->cpu_die = pSeries_cpu_die;
444 444
445 /* Processors can be added/removed only on LPAR */ 445 /* Processors can be added/removed only on LPAR */
446 if (platform_is_lpar()) 446 if (firmware_has_feature(FW_FEATURE_LPAR))
447 pSeries_reconfig_notifier_register(&pSeries_smp_nb); 447 pSeries_reconfig_notifier_register(&pSeries_smp_nb);
448#endif 448#endif
449 449
diff --git a/arch/powerpc/platforms/pseries/xics.c b/arch/powerpc/platforms/pseries/xics.c
index fd823c7c9ac8..4864cb32be25 100644
--- a/arch/powerpc/platforms/pseries/xics.c
+++ b/arch/powerpc/platforms/pseries/xics.c
@@ -20,6 +20,7 @@
20#include <linux/gfp.h> 20#include <linux/gfp.h>
21#include <linux/radix-tree.h> 21#include <linux/radix-tree.h>
22#include <linux/cpu.h> 22#include <linux/cpu.h>
23#include <asm/firmware.h>
23#include <asm/prom.h> 24#include <asm/prom.h>
24#include <asm/io.h> 25#include <asm/io.h>
25#include <asm/pgtable.h> 26#include <asm/pgtable.h>
@@ -499,7 +500,7 @@ nextnode:
499 np; 500 np;
500 np = of_find_node_by_type(np, "cpu")) { 501 np = of_find_node_by_type(np, "cpu")) {
501 ireg = (uint *)get_property(np, "reg", &ilen); 502 ireg = (uint *)get_property(np, "reg", &ilen);
502 if (ireg && ireg[0] == boot_cpuid_phys) { 503 if (ireg && ireg[0] == get_hard_smp_processor_id(boot_cpuid)) {
503 ireg = (uint *)get_property(np, "ibm,ppc-interrupt-gserver#s", 504 ireg = (uint *)get_property(np, "ibm,ppc-interrupt-gserver#s",
504 &ilen); 505 &ilen);
505 i = ilen / sizeof(int); 506 i = ilen / sizeof(int);
@@ -536,11 +537,11 @@ nextnode:
536 of_node_put(np); 537 of_node_put(np);
537 } 538 }
538 539
539 if (platform_is_lpar()) 540 if (firmware_has_feature(FW_FEATURE_LPAR))
540 ops = &pSeriesLP_ops; 541 ops = &pSeriesLP_ops;
541 else { 542 else {
542#ifdef CONFIG_SMP 543#ifdef CONFIG_SMP
543 for_each_cpu(i) { 544 for_each_possible_cpu(i) {
544 int hard_id; 545 int hard_id;
545 546
546 /* FIXME: Do this dynamically! --RR */ 547 /* FIXME: Do this dynamically! --RR */
diff --git a/arch/powerpc/sysdev/dart_iommu.c b/arch/powerpc/sysdev/dart_iommu.c
index 6298264efe36..61d317428610 100644
--- a/arch/powerpc/sysdev/dart_iommu.c
+++ b/arch/powerpc/sysdev/dart_iommu.c
@@ -194,8 +194,6 @@ static int dart_init(struct device_node *dart_node)
194 * prefetching into invalid pages and corrupting data 194 * prefetching into invalid pages and corrupting data
195 */ 195 */
196 tmp = lmb_alloc(DART_PAGE_SIZE, DART_PAGE_SIZE); 196 tmp = lmb_alloc(DART_PAGE_SIZE, DART_PAGE_SIZE);
197 if (!tmp)
198 panic("DART: Cannot allocate spare page!");
199 dart_emptyval = DARTMAP_VALID | ((tmp >> DART_PAGE_SHIFT) & 197 dart_emptyval = DARTMAP_VALID | ((tmp >> DART_PAGE_SHIFT) &
200 DARTMAP_RPNMASK); 198 DARTMAP_RPNMASK);
201 199
diff --git a/arch/powerpc/sysdev/dcr.S b/arch/powerpc/sysdev/dcr.S
index 895f10243a43..2078f39e2f17 100644
--- a/arch/powerpc/sysdev/dcr.S
+++ b/arch/powerpc/sysdev/dcr.S
@@ -1,6 +1,4 @@
1/* 1/*
2 * arch/ppc/syslib/dcr.S
3 *
4 * "Indirect" DCR access 2 * "Indirect" DCR access
5 * 3 *
6 * Copyright (c) 2004 Eugene Surovegin <ebs@ebshome.net> 4 * Copyright (c) 2004 Eugene Surovegin <ebs@ebshome.net>
diff --git a/arch/powerpc/sysdev/fsl_soc.c b/arch/powerpc/sysdev/fsl_soc.c
index 064c9de47732..ceb584682fa3 100644
--- a/arch/powerpc/sysdev/fsl_soc.c
+++ b/arch/powerpc/sysdev/fsl_soc.c
@@ -40,7 +40,7 @@ phys_addr_t get_immrbase(void)
40 return immrbase; 40 return immrbase;
41 41
42 soc = of_find_node_by_type(NULL, "soc"); 42 soc = of_find_node_by_type(NULL, "soc");
43 if (soc != 0) { 43 if (soc) {
44 unsigned int size; 44 unsigned int size;
45 void *prop = get_property(soc, "reg", &size); 45 void *prop = get_property(soc, "reg", &size);
46 immrbase = of_translate_address(soc, prop); 46 immrbase = of_translate_address(soc, prop);
@@ -49,21 +49,20 @@ phys_addr_t get_immrbase(void)
49 49
50 return immrbase; 50 return immrbase;
51} 51}
52EXPORT_SYMBOL(get_immrbase);
53 52
54static const char * gfar_tx_intr = "tx"; 53EXPORT_SYMBOL(get_immrbase);
55static const char * gfar_rx_intr = "rx";
56static const char * gfar_err_intr = "error";
57 54
58static int __init gfar_of_init(void) 55static int __init gfar_mdio_of_init(void)
59{ 56{
60 struct device_node *np; 57 struct device_node *np;
61 unsigned int i; 58 unsigned int i;
62 struct platform_device *mdio_dev, *gfar_dev; 59 struct platform_device *mdio_dev;
63 struct resource res; 60 struct resource res;
64 int ret; 61 int ret;
65 62
66 for (np = NULL, i = 0; (np = of_find_compatible_node(np, "mdio", "gianfar")) != NULL; i++) { 63 for (np = NULL, i = 0;
64 (np = of_find_compatible_node(np, "mdio", "gianfar")) != NULL;
65 i++) {
67 int k; 66 int k;
68 struct device_node *child = NULL; 67 struct device_node *child = NULL;
69 struct gianfar_mdio_data mdio_data; 68 struct gianfar_mdio_data mdio_data;
@@ -73,12 +72,14 @@ static int __init gfar_of_init(void)
73 72
74 ret = of_address_to_resource(np, 0, &res); 73 ret = of_address_to_resource(np, 0, &res);
75 if (ret) 74 if (ret)
76 goto mdio_err; 75 goto err;
77 76
78 mdio_dev = platform_device_register_simple("fsl-gianfar_mdio", res.start, &res, 1); 77 mdio_dev =
78 platform_device_register_simple("fsl-gianfar_mdio",
79 res.start, &res, 1);
79 if (IS_ERR(mdio_dev)) { 80 if (IS_ERR(mdio_dev)) {
80 ret = PTR_ERR(mdio_dev); 81 ret = PTR_ERR(mdio_dev);
81 goto mdio_err; 82 goto err;
82 } 83 }
83 84
84 for (k = 0; k < 32; k++) 85 for (k = 0; k < 32; k++)
@@ -86,17 +87,44 @@ static int __init gfar_of_init(void)
86 87
87 while ((child = of_get_next_child(np, child)) != NULL) { 88 while ((child = of_get_next_child(np, child)) != NULL) {
88 if (child->n_intrs) { 89 if (child->n_intrs) {
89 u32 *id = (u32 *) get_property(child, "reg", NULL); 90 u32 *id =
91 (u32 *) get_property(child, "reg", NULL);
90 mdio_data.irq[*id] = child->intrs[0].line; 92 mdio_data.irq[*id] = child->intrs[0].line;
91 } 93 }
92 } 94 }
93 95
94 ret = platform_device_add_data(mdio_dev, &mdio_data, sizeof(struct gianfar_mdio_data)); 96 ret =
97 platform_device_add_data(mdio_dev, &mdio_data,
98 sizeof(struct gianfar_mdio_data));
95 if (ret) 99 if (ret)
96 goto mdio_unreg; 100 goto unreg;
97 } 101 }
98 102
99 for (np = NULL, i = 0; (np = of_find_compatible_node(np, "network", "gianfar")) != NULL; i++) { 103 return 0;
104
105unreg:
106 platform_device_unregister(mdio_dev);
107err:
108 return ret;
109}
110
111arch_initcall(gfar_mdio_of_init);
112
113static const char *gfar_tx_intr = "tx";
114static const char *gfar_rx_intr = "rx";
115static const char *gfar_err_intr = "error";
116
117static int __init gfar_of_init(void)
118{
119 struct device_node *np;
120 unsigned int i;
121 struct platform_device *gfar_dev;
122 struct resource res;
123 int ret;
124
125 for (np = NULL, i = 0;
126 (np = of_find_compatible_node(np, "network", "gianfar")) != NULL;
127 i++) {
100 struct resource r[4]; 128 struct resource r[4];
101 struct device_node *phy, *mdio; 129 struct device_node *phy, *mdio;
102 struct gianfar_platform_data gfar_data; 130 struct gianfar_platform_data gfar_data;
@@ -110,7 +138,7 @@ static int __init gfar_of_init(void)
110 138
111 ret = of_address_to_resource(np, 0, &r[0]); 139 ret = of_address_to_resource(np, 0, &r[0]);
112 if (ret) 140 if (ret)
113 goto gfar_err; 141 goto err;
114 142
115 r[1].start = np->intrs[0].line; 143 r[1].start = np->intrs[0].line;
116 r[1].end = np->intrs[0].line; 144 r[1].end = np->intrs[0].line;
@@ -133,11 +161,13 @@ static int __init gfar_of_init(void)
133 r[3].flags = IORESOURCE_IRQ; 161 r[3].flags = IORESOURCE_IRQ;
134 } 162 }
135 163
136 gfar_dev = platform_device_register_simple("fsl-gianfar", i, &r[0], np->n_intrs + 1); 164 gfar_dev =
165 platform_device_register_simple("fsl-gianfar", i, &r[0],
166 np->n_intrs + 1);
137 167
138 if (IS_ERR(gfar_dev)) { 168 if (IS_ERR(gfar_dev)) {
139 ret = PTR_ERR(gfar_dev); 169 ret = PTR_ERR(gfar_dev);
140 goto gfar_err; 170 goto err;
141 } 171 }
142 172
143 mac_addr = get_property(np, "address", NULL); 173 mac_addr = get_property(np, "address", NULL);
@@ -145,26 +175,26 @@ static int __init gfar_of_init(void)
145 175
146 if (model && !strcasecmp(model, "TSEC")) 176 if (model && !strcasecmp(model, "TSEC"))
147 gfar_data.device_flags = 177 gfar_data.device_flags =
148 FSL_GIANFAR_DEV_HAS_GIGABIT | 178 FSL_GIANFAR_DEV_HAS_GIGABIT |
149 FSL_GIANFAR_DEV_HAS_COALESCE | 179 FSL_GIANFAR_DEV_HAS_COALESCE |
150 FSL_GIANFAR_DEV_HAS_RMON | 180 FSL_GIANFAR_DEV_HAS_RMON |
151 FSL_GIANFAR_DEV_HAS_MULTI_INTR; 181 FSL_GIANFAR_DEV_HAS_MULTI_INTR;
152 if (model && !strcasecmp(model, "eTSEC")) 182 if (model && !strcasecmp(model, "eTSEC"))
153 gfar_data.device_flags = 183 gfar_data.device_flags =
154 FSL_GIANFAR_DEV_HAS_GIGABIT | 184 FSL_GIANFAR_DEV_HAS_GIGABIT |
155 FSL_GIANFAR_DEV_HAS_COALESCE | 185 FSL_GIANFAR_DEV_HAS_COALESCE |
156 FSL_GIANFAR_DEV_HAS_RMON | 186 FSL_GIANFAR_DEV_HAS_RMON |
157 FSL_GIANFAR_DEV_HAS_MULTI_INTR | 187 FSL_GIANFAR_DEV_HAS_MULTI_INTR |
158 FSL_GIANFAR_DEV_HAS_CSUM | 188 FSL_GIANFAR_DEV_HAS_CSUM |
159 FSL_GIANFAR_DEV_HAS_VLAN | 189 FSL_GIANFAR_DEV_HAS_VLAN |
160 FSL_GIANFAR_DEV_HAS_EXTENDED_HASH; 190 FSL_GIANFAR_DEV_HAS_EXTENDED_HASH;
161 191
162 ph = (phandle *) get_property(np, "phy-handle", NULL); 192 ph = (phandle *) get_property(np, "phy-handle", NULL);
163 phy = of_find_node_by_phandle(*ph); 193 phy = of_find_node_by_phandle(*ph);
164 194
165 if (phy == NULL) { 195 if (phy == NULL) {
166 ret = -ENODEV; 196 ret = -ENODEV;
167 goto gfar_unreg; 197 goto unreg;
168 } 198 }
169 199
170 mdio = of_get_parent(phy); 200 mdio = of_get_parent(phy);
@@ -174,7 +204,7 @@ static int __init gfar_of_init(void)
174 if (ret) { 204 if (ret) {
175 of_node_put(phy); 205 of_node_put(phy);
176 of_node_put(mdio); 206 of_node_put(mdio);
177 goto gfar_unreg; 207 goto unreg;
178 } 208 }
179 209
180 gfar_data.phy_id = *id; 210 gfar_data.phy_id = *id;
@@ -183,23 +213,22 @@ static int __init gfar_of_init(void)
183 of_node_put(phy); 213 of_node_put(phy);
184 of_node_put(mdio); 214 of_node_put(mdio);
185 215
186 ret = platform_device_add_data(gfar_dev, &gfar_data, sizeof(struct gianfar_platform_data)); 216 ret =
217 platform_device_add_data(gfar_dev, &gfar_data,
218 sizeof(struct
219 gianfar_platform_data));
187 if (ret) 220 if (ret)
188 goto gfar_unreg; 221 goto unreg;
189 } 222 }
190 223
191 return 0; 224 return 0;
192 225
193mdio_unreg: 226unreg:
194 platform_device_unregister(mdio_dev);
195mdio_err:
196 return ret;
197
198gfar_unreg:
199 platform_device_unregister(gfar_dev); 227 platform_device_unregister(gfar_dev);
200gfar_err: 228err:
201 return ret; 229 return ret;
202} 230}
231
203arch_initcall(gfar_of_init); 232arch_initcall(gfar_of_init);
204 233
205static int __init fsl_i2c_of_init(void) 234static int __init fsl_i2c_of_init(void)
@@ -209,17 +238,19 @@ static int __init fsl_i2c_of_init(void)
209 struct platform_device *i2c_dev; 238 struct platform_device *i2c_dev;
210 int ret; 239 int ret;
211 240
212 for (np = NULL, i = 0; (np = of_find_compatible_node(np, "i2c", "fsl-i2c")) != NULL; i++) { 241 for (np = NULL, i = 0;
242 (np = of_find_compatible_node(np, "i2c", "fsl-i2c")) != NULL;
243 i++) {
213 struct resource r[2]; 244 struct resource r[2];
214 struct fsl_i2c_platform_data i2c_data; 245 struct fsl_i2c_platform_data i2c_data;
215 unsigned char * flags = NULL; 246 unsigned char *flags = NULL;
216 247
217 memset(&r, 0, sizeof(r)); 248 memset(&r, 0, sizeof(r));
218 memset(&i2c_data, 0, sizeof(i2c_data)); 249 memset(&i2c_data, 0, sizeof(i2c_data));
219 250
220 ret = of_address_to_resource(np, 0, &r[0]); 251 ret = of_address_to_resource(np, 0, &r[0]);
221 if (ret) 252 if (ret)
222 goto i2c_err; 253 goto err;
223 254
224 r[1].start = np->intrs[0].line; 255 r[1].start = np->intrs[0].line;
225 r[1].end = np->intrs[0].line; 256 r[1].end = np->intrs[0].line;
@@ -228,7 +259,7 @@ static int __init fsl_i2c_of_init(void)
228 i2c_dev = platform_device_register_simple("fsl-i2c", i, r, 2); 259 i2c_dev = platform_device_register_simple("fsl-i2c", i, r, 2);
229 if (IS_ERR(i2c_dev)) { 260 if (IS_ERR(i2c_dev)) {
230 ret = PTR_ERR(i2c_dev); 261 ret = PTR_ERR(i2c_dev);
231 goto i2c_err; 262 goto err;
232 } 263 }
233 264
234 i2c_data.device_flags = 0; 265 i2c_data.device_flags = 0;
@@ -240,18 +271,22 @@ static int __init fsl_i2c_of_init(void)
240 if (flags) 271 if (flags)
241 i2c_data.device_flags |= FSL_I2C_DEV_CLOCK_5200; 272 i2c_data.device_flags |= FSL_I2C_DEV_CLOCK_5200;
242 273
243 ret = platform_device_add_data(i2c_dev, &i2c_data, sizeof(struct fsl_i2c_platform_data)); 274 ret =
275 platform_device_add_data(i2c_dev, &i2c_data,
276 sizeof(struct
277 fsl_i2c_platform_data));
244 if (ret) 278 if (ret)
245 goto i2c_unreg; 279 goto unreg;
246 } 280 }
247 281
248 return 0; 282 return 0;
249 283
250i2c_unreg: 284unreg:
251 platform_device_unregister(i2c_dev); 285 platform_device_unregister(i2c_dev);
252i2c_err: 286err:
253 return ret; 287 return ret;
254} 288}
289
255arch_initcall(fsl_i2c_of_init); 290arch_initcall(fsl_i2c_of_init);
256 291
257#ifdef CONFIG_PPC_83xx 292#ifdef CONFIG_PPC_83xx
@@ -267,51 +302,192 @@ static int __init mpc83xx_wdt_init(void)
267 302
268 if (!np) { 303 if (!np) {
269 ret = -ENODEV; 304 ret = -ENODEV;
270 goto mpc83xx_wdt_nodev; 305 goto nodev;
271 } 306 }
272 307
273 soc = of_find_node_by_type(NULL, "soc"); 308 soc = of_find_node_by_type(NULL, "soc");
274 309
275 if (!soc) { 310 if (!soc) {
276 ret = -ENODEV; 311 ret = -ENODEV;
277 goto mpc83xx_wdt_nosoc; 312 goto nosoc;
278 } 313 }
279 314
280 freq = (unsigned int *)get_property(soc, "bus-frequency", NULL); 315 freq = (unsigned int *)get_property(soc, "bus-frequency", NULL);
281 if (!freq) { 316 if (!freq) {
282 ret = -ENODEV; 317 ret = -ENODEV;
283 goto mpc83xx_wdt_err; 318 goto err;
284 } 319 }
285 320
286 memset(&r, 0, sizeof(r)); 321 memset(&r, 0, sizeof(r));
287 322
288 ret = of_address_to_resource(np, 0, &r); 323 ret = of_address_to_resource(np, 0, &r);
289 if (ret) 324 if (ret)
290 goto mpc83xx_wdt_err; 325 goto err;
291 326
292 dev = platform_device_register_simple("mpc83xx_wdt", 0, &r, 1); 327 dev = platform_device_register_simple("mpc83xx_wdt", 0, &r, 1);
293 if (IS_ERR(dev)) { 328 if (IS_ERR(dev)) {
294 ret = PTR_ERR(dev); 329 ret = PTR_ERR(dev);
295 goto mpc83xx_wdt_err; 330 goto err;
296 } 331 }
297 332
298 ret = platform_device_add_data(dev, freq, sizeof(int)); 333 ret = platform_device_add_data(dev, freq, sizeof(int));
299 if (ret) 334 if (ret)
300 goto mpc83xx_wdt_unreg; 335 goto unreg;
301 336
302 of_node_put(soc); 337 of_node_put(soc);
303 of_node_put(np); 338 of_node_put(np);
304 339
305 return 0; 340 return 0;
306 341
307mpc83xx_wdt_unreg: 342unreg:
308 platform_device_unregister(dev); 343 platform_device_unregister(dev);
309mpc83xx_wdt_err: 344err:
310 of_node_put(soc); 345 of_node_put(soc);
311mpc83xx_wdt_nosoc: 346nosoc:
312 of_node_put(np); 347 of_node_put(np);
313mpc83xx_wdt_nodev: 348nodev:
314 return ret; 349 return ret;
315} 350}
351
316arch_initcall(mpc83xx_wdt_init); 352arch_initcall(mpc83xx_wdt_init);
317#endif 353#endif
354
355static enum fsl_usb2_phy_modes determine_usb_phy(char * phy_type)
356{
357 if (!phy_type)
358 return FSL_USB2_PHY_NONE;
359 if (!strcasecmp(phy_type, "ulpi"))
360 return FSL_USB2_PHY_ULPI;
361 if (!strcasecmp(phy_type, "utmi"))
362 return FSL_USB2_PHY_UTMI;
363 if (!strcasecmp(phy_type, "utmi_wide"))
364 return FSL_USB2_PHY_UTMI_WIDE;
365 if (!strcasecmp(phy_type, "serial"))
366 return FSL_USB2_PHY_SERIAL;
367
368 return FSL_USB2_PHY_NONE;
369}
370
371static int __init fsl_usb_of_init(void)
372{
373 struct device_node *np;
374 unsigned int i;
375 struct platform_device *usb_dev;
376 int ret;
377
378 for (np = NULL, i = 0;
379 (np = of_find_compatible_node(np, "usb", "fsl-usb2-mph")) != NULL;
380 i++) {
381 struct resource r[2];
382 struct fsl_usb2_platform_data usb_data;
383 unsigned char *prop = NULL;
384
385 memset(&r, 0, sizeof(r));
386 memset(&usb_data, 0, sizeof(usb_data));
387
388 ret = of_address_to_resource(np, 0, &r[0]);
389 if (ret)
390 goto err;
391
392 r[1].start = np->intrs[0].line;
393 r[1].end = np->intrs[0].line;
394 r[1].flags = IORESOURCE_IRQ;
395
396 usb_dev =
397 platform_device_register_simple("fsl-usb2-mph", i, r, 2);
398 if (IS_ERR(usb_dev)) {
399 ret = PTR_ERR(usb_dev);
400 goto err;
401 }
402
403 usb_dev->dev.coherent_dma_mask = 0xffffffffUL;
404 usb_dev->dev.dma_mask = &usb_dev->dev.coherent_dma_mask;
405
406 usb_data.operating_mode = FSL_USB2_MPH_HOST;
407
408 prop = get_property(np, "port0", NULL);
409 if (prop)
410 usb_data.port_enables |= FSL_USB2_PORT0_ENABLED;
411
412 prop = get_property(np, "port1", NULL);
413 if (prop)
414 usb_data.port_enables |= FSL_USB2_PORT1_ENABLED;
415
416 prop = get_property(np, "phy_type", NULL);
417 usb_data.phy_mode = determine_usb_phy(prop);
418
419 ret =
420 platform_device_add_data(usb_dev, &usb_data,
421 sizeof(struct
422 fsl_usb2_platform_data));
423 if (ret)
424 goto unreg;
425 }
426
427 return 0;
428
429unreg:
430 platform_device_unregister(usb_dev);
431err:
432 return ret;
433}
434
435arch_initcall(fsl_usb_of_init);
436
437static int __init fsl_usb_dr_of_init(void)
438{
439 struct device_node *np;
440 unsigned int i;
441 struct platform_device *usb_dev;
442 int ret;
443
444 for (np = NULL, i = 0;
445 (np = of_find_compatible_node(np, "usb", "fsl-usb2-dr")) != NULL;
446 i++) {
447 struct resource r[2];
448 struct fsl_usb2_platform_data usb_data;
449 unsigned char *prop = NULL;
450
451 memset(&r, 0, sizeof(r));
452 memset(&usb_data, 0, sizeof(usb_data));
453
454 ret = of_address_to_resource(np, 0, &r[0]);
455 if (ret)
456 goto err;
457
458 r[1].start = np->intrs[0].line;
459 r[1].end = np->intrs[0].line;
460 r[1].flags = IORESOURCE_IRQ;
461
462 usb_dev =
463 platform_device_register_simple("fsl-usb2-dr", i, r, 2);
464 if (IS_ERR(usb_dev)) {
465 ret = PTR_ERR(usb_dev);
466 goto err;
467 }
468
469 usb_dev->dev.coherent_dma_mask = 0xffffffffUL;
470 usb_dev->dev.dma_mask = &usb_dev->dev.coherent_dma_mask;
471
472 usb_data.operating_mode = FSL_USB2_DR_HOST;
473
474 prop = get_property(np, "phy_type", NULL);
475 usb_data.phy_mode = determine_usb_phy(prop);
476
477 ret =
478 platform_device_add_data(usb_dev, &usb_data,
479 sizeof(struct
480 fsl_usb2_platform_data));
481 if (ret)
482 goto unreg;
483 }
484
485 return 0;
486
487unreg:
488 platform_device_unregister(usb_dev);
489err:
490 return ret;
491}
492
493arch_initcall(fsl_usb_dr_of_init);
diff --git a/arch/powerpc/sysdev/ipic.h b/arch/powerpc/sysdev/ipic.h
index a7ce7da8785c..a60c9d18bb7f 100644
--- a/arch/powerpc/sysdev/ipic.h
+++ b/arch/powerpc/sysdev/ipic.h
@@ -1,6 +1,4 @@
1/* 1/*
2 * arch/ppc/kernel/ipic.h
3 *
4 * IPIC private definitions and structure. 2 * IPIC private definitions and structure.
5 * 3 *
6 * Maintainer: Kumar Gala <galak@kernel.crashing.org> 4 * Maintainer: Kumar Gala <galak@kernel.crashing.org>
diff --git a/arch/powerpc/xmon/xmon.c b/arch/powerpc/xmon/xmon.c
index 7d02fa2a8990..4735b41c113c 100644
--- a/arch/powerpc/xmon/xmon.c
+++ b/arch/powerpc/xmon/xmon.c
@@ -191,6 +191,7 @@ Commands:\n\
191 di dump instructions\n\ 191 di dump instructions\n\
192 df dump float values\n\ 192 df dump float values\n\
193 dd dump double values\n\ 193 dd dump double values\n\
194 dr dump stream of raw bytes\n\
194 e print exception information\n\ 195 e print exception information\n\
195 f flush cache\n\ 196 f flush cache\n\
196 la lookup symbol+offset of specified address\n\ 197 la lookup symbol+offset of specified address\n\
@@ -1938,6 +1939,28 @@ bsesc(void)
1938 return c; 1939 return c;
1939} 1940}
1940 1941
1942static void xmon_rawdump (unsigned long adrs, long ndump)
1943{
1944 long n, m, r, nr;
1945 unsigned char temp[16];
1946
1947 for (n = ndump; n > 0;) {
1948 r = n < 16? n: 16;
1949 nr = mread(adrs, temp, r);
1950 adrs += nr;
1951 for (m = 0; m < r; ++m) {
1952 if (m < nr)
1953 printf("%.2x", temp[m]);
1954 else
1955 printf("%s", fault_chars[fault_type]);
1956 }
1957 n -= r;
1958 if (nr < r)
1959 break;
1960 }
1961 printf("\n");
1962}
1963
1941#define isxdigit(c) (('0' <= (c) && (c) <= '9') \ 1964#define isxdigit(c) (('0' <= (c) && (c) <= '9') \
1942 || ('a' <= (c) && (c) <= 'f') \ 1965 || ('a' <= (c) && (c) <= 'f') \
1943 || ('A' <= (c) && (c) <= 'F')) 1966 || ('A' <= (c) && (c) <= 'F'))
@@ -1960,6 +1983,13 @@ dump(void)
1960 nidump = MAX_DUMP; 1983 nidump = MAX_DUMP;
1961 adrs += ppc_inst_dump(adrs, nidump, 1); 1984 adrs += ppc_inst_dump(adrs, nidump, 1);
1962 last_cmd = "di\n"; 1985 last_cmd = "di\n";
1986 } else if (c == 'r') {
1987 scanhex(&ndump);
1988 if (ndump == 0)
1989 ndump = 64;
1990 xmon_rawdump(adrs, ndump);
1991 adrs += ndump;
1992 last_cmd = "dr\n";
1963 } else { 1993 } else {
1964 scanhex(&ndump); 1994 scanhex(&ndump);
1965 if (ndump == 0) 1995 if (ndump == 0)
diff --git a/arch/ppc/4xx_io/serial_sicc.c b/arch/ppc/4xx_io/serial_sicc.c
index 8ace2a1f3b48..98b25fa0049a 100644
--- a/arch/ppc/4xx_io/serial_sicc.c
+++ b/arch/ppc/4xx_io/serial_sicc.c
@@ -1,6 +1,4 @@
1/* 1/*
2 * arch/ppc/4xx_io/serial_sicc.c
3 *
4 * Driver for IBM STB3xxx SICC serial port 2 * Driver for IBM STB3xxx SICC serial port
5 * 3 *
6 * Based on drivers/char/serial_amba.c, by ARM Ltd. 4 * Based on drivers/char/serial_amba.c, by ARM Ltd.
@@ -1639,9 +1637,8 @@ static struct SICC_info *siccuart_get(int line)
1639 state->count++; 1637 state->count++;
1640 if (state->info) 1638 if (state->info)
1641 return state->info; 1639 return state->info;
1642 info = kmalloc(sizeof(struct SICC_info), GFP_KERNEL); 1640 info = kzalloc(sizeof(struct SICC_info), GFP_KERNEL);
1643 if (info) { 1641 if (info) {
1644 memset(info, 0, sizeof(struct SICC_info));
1645 init_waitqueue_head(&info->open_wait); 1642 init_waitqueue_head(&info->open_wait);
1646 init_waitqueue_head(&info->close_wait); 1643 init_waitqueue_head(&info->close_wait);
1647 init_waitqueue_head(&info->delta_msr_wait); 1644 init_waitqueue_head(&info->delta_msr_wait);
diff --git a/arch/ppc/8xx_io/commproc.c b/arch/ppc/8xx_io/commproc.c
index 579cd40258b9..12b84ca51327 100644
--- a/arch/ppc/8xx_io/commproc.c
+++ b/arch/ppc/8xx_io/commproc.c
@@ -73,7 +73,7 @@ cpm_mask_irq(unsigned int irq)
73{ 73{
74 int cpm_vec = irq - CPM_IRQ_OFFSET; 74 int cpm_vec = irq - CPM_IRQ_OFFSET;
75 75
76 out_be32(&((immap_t *)IMAP_ADDR)->im_cpic.cpic_cimr, in_be32(&((immap_t *)IMAP_ADDR)->im_cpic.cpic_cimr) & ~(1 << cpm_vec)); 76 clrbits32(&((immap_t *)IMAP_ADDR)->im_cpic.cpic_cimr, (1 << cpm_vec));
77} 77}
78 78
79static void 79static void
@@ -81,7 +81,7 @@ cpm_unmask_irq(unsigned int irq)
81{ 81{
82 int cpm_vec = irq - CPM_IRQ_OFFSET; 82 int cpm_vec = irq - CPM_IRQ_OFFSET;
83 83
84 out_be32(&((immap_t *)IMAP_ADDR)->im_cpic.cpic_cimr, in_be32(&((immap_t *)IMAP_ADDR)->im_cpic.cpic_cimr) | (1 << cpm_vec)); 84 setbits32(&((immap_t *)IMAP_ADDR)->im_cpic.cpic_cimr, (1 << cpm_vec));
85} 85}
86 86
87static void 87static void
@@ -198,7 +198,7 @@ cpm_interrupt_init(void)
198 if (setup_irq(CPM_IRQ_OFFSET + CPMVEC_ERROR, &cpm_error_irqaction)) 198 if (setup_irq(CPM_IRQ_OFFSET + CPMVEC_ERROR, &cpm_error_irqaction))
199 panic("Could not allocate CPM error IRQ!"); 199 panic("Could not allocate CPM error IRQ!");
200 200
201 out_be32(&((immap_t *)IMAP_ADDR)->im_cpic.cpic_cicr, in_be32(&((immap_t *)IMAP_ADDR)->im_cpic.cpic_cicr) | CICR_IEN); 201 setbits32(&((immap_t *)IMAP_ADDR)->im_cpic.cpic_cicr, CICR_IEN);
202} 202}
203 203
204/* 204/*
diff --git a/arch/ppc/8xx_io/cs4218_tdm.c b/arch/ppc/8xx_io/cs4218_tdm.c
index 49eb2a7e65c0..a892356d5c3b 100644
--- a/arch/ppc/8xx_io/cs4218_tdm.c
+++ b/arch/ppc/8xx_io/cs4218_tdm.c
@@ -126,11 +126,11 @@ static int numReadBufs = 4, readbufSize = 32;
126*/ 126*/
127static volatile cbd_t *rx_base, *rx_cur, *tx_base, *tx_cur; 127static volatile cbd_t *rx_base, *rx_cur, *tx_base, *tx_cur;
128 128
129MODULE_PARM(catchRadius, "i"); 129module_param(catchRadius, int, 0);
130MODULE_PARM(numBufs, "i"); 130module_param(numBufs, int, 0);
131MODULE_PARM(bufSize, "i"); 131module_param(bufSize, int, 0);
132MODULE_PARM(numreadBufs, "i"); 132module_param(numreadBufs, int, 0);
133MODULE_PARM(readbufSize, "i"); 133module_param(readbufSize, int, 0);
134 134
135#define arraysize(x) (sizeof(x)/sizeof(*(x))) 135#define arraysize(x) (sizeof(x)/sizeof(*(x)))
136#define le2be16(x) (((x)<<8 & 0xff00) | ((x)>>8 & 0x00ff)) 136#define le2be16(x) (((x)<<8 & 0xff00) | ((x)>>8 & 0x00ff))
diff --git a/arch/ppc/Kconfig b/arch/ppc/Kconfig
index 11899f06bf06..e9a8f5d1dfcd 100644
--- a/arch/ppc/Kconfig
+++ b/arch/ppc/Kconfig
@@ -19,6 +19,10 @@ config RWSEM_XCHGADD_ALGORITHM
19 bool 19 bool
20 default y 20 default y
21 21
22config GENERIC_HWEIGHT
23 bool
24 default y
25
22config GENERIC_CALIBRATE_DELAY 26config GENERIC_CALIBRATE_DELAY
23 bool 27 bool
24 default y 28 default y
@@ -57,15 +61,15 @@ config 6xx
57 select PPC_FPU 61 select PPC_FPU
58 help 62 help
59 There are four types of PowerPC chips supported. The more common 63 There are four types of PowerPC chips supported. The more common
60 types (601, 603, 604, 740, 750, 7400), the Motorola embedded 64 types (601, 603, 604, 740, 750, 7400), the older Freescale
61 versions (821, 823, 850, 855, 860, 52xx, 82xx, 83xx), the IBM 65 (formerly Motorola) embedded versions (821, 823, 850, 855, 860,
62 embedded versions (403 and 405) and the POWER3 processor. 66 52xx, 82xx, 83xx), the IBM embedded versions (403 and 405) and
63 (For support for more recent 64-bit processors, set ARCH=powerpc.) 67 the Book E embedded processors from IBM (44x) and Freescale (85xx).
68 For support for 64-bit processors, set ARCH=powerpc.
64 Unless you are building a kernel for one of the embedded processor 69 Unless you are building a kernel for one of the embedded processor
65 systems or a POWER3-based IBM RS/6000, choose 6xx. 70 systems, choose 6xx.
66 Note that the kernel runs in 32-bit mode even on 64-bit chips. 71 Also note that because the 52xx, 82xx, & 83xx family have a 603e
67 Also note that because the 52xx, 82xx, & 83xx family has a 603e core, 72 core, specific support for that chipset is asked later on.
68 specific support for that chipset is asked later on.
69 73
70config 40x 74config 40x
71 bool "40x" 75 bool "40x"
@@ -73,10 +77,6 @@ config 40x
73config 44x 77config 44x
74 bool "44x" 78 bool "44x"
75 79
76config POWER3
77 select PPC_FPU
78 bool "POWER3"
79
80config 8xx 80config 8xx
81 bool "8xx" 81 bool "8xx"
82 82
@@ -248,14 +248,9 @@ config PPC601_SYNC_FIX
248source arch/ppc/platforms/4xx/Kconfig 248source arch/ppc/platforms/4xx/Kconfig
249source arch/ppc/platforms/85xx/Kconfig 249source arch/ppc/platforms/85xx/Kconfig
250 250
251config PPC64BRIDGE
252 bool
253 depends on POWER3
254 default y
255
256config PPC_STD_MMU 251config PPC_STD_MMU
257 bool 252 bool
258 depends on 6xx || POWER3 253 depends on 6xx
259 default y 254 default y
260 255
261config NOT_COHERENT_CACHE 256config NOT_COHERENT_CACHE
@@ -481,10 +476,57 @@ config WINCEPT
481 476
482endchoice 477endchoice
483 478
479menu "Freescale Ethernet driver platform-specific options"
480 depends on FS_ENET
481
482 config MPC8xx_SECOND_ETH
483 bool "Second Ethernet channel"
484 depends on (MPC885ADS || MPC86XADS)
485 default y
486 help
487 This enables support for second Ethernet on MPC885ADS and MPC86xADS boards.
488 The latter will use SCC1, for 885ADS you can select it below.
489
490 choice
491 prompt "Second Ethernet channel"
492 depends on MPC8xx_SECOND_ETH
493 default MPC8xx_SECOND_ETH_FEC2
494
495 config MPC8xx_SECOND_ETH_FEC2
496 bool "FEC2"
497 depends on MPC885ADS
498 help
499 Enable FEC2 to serve as 2-nd Ethernet channel. Note that SMC2
500 (often 2-nd UART) will not work if this is enabled.
501
502 config MPC8xx_SECOND_ETH_SCC1
503 bool "SCC1"
504 depends on MPC86XADS
505 select MPC8xx_SCC_ENET_FIXED
506 help
507 Enable SCC1 to serve as 2-nd Ethernet channel. Note that SMC1
508 (often 1-nd UART) will not work if this is enabled.
509
510 config MPC8xx_SECOND_ETH_SCC3
511 bool "SCC3"
512 depends on MPC885ADS
513 help
514 Enable SCC3 to serve as 2-nd Ethernet channel. Note that SMC1
515 (often 1-nd UART) will not work if this is enabled.
516
517 endchoice
518
519 config MPC8xx_SCC_ENET_FIXED
520 depends on MPC8xx_SECOND_ETH_SCC
521 default n
522 bool "Use fixed MII-less mode for SCC Ethernet"
523
524endmenu
525
484choice 526choice
485 prompt "Machine Type" 527 prompt "Machine Type"
486 depends on 6xx || POWER3 528 depends on 6xx
487 default PPC_MULTIPLATFORM 529 default PPC_PREP
488 ---help--- 530 ---help---
489 Linux currently supports several different kinds of PowerPC-based 531 Linux currently supports several different kinds of PowerPC-based
490 machines: Apple Power Macintoshes and clones (such as the Motorola 532 machines: Apple Power Macintoshes and clones (such as the Motorola
@@ -494,15 +536,14 @@ choice
494 Platform) machines (including all of the recent IBM RS/6000 and 536 Platform) machines (including all of the recent IBM RS/6000 and
495 pSeries machines), and several embedded PowerPC systems containing 537 pSeries machines), and several embedded PowerPC systems containing
496 4xx, 6xx, 7xx, 8xx, 74xx, and 82xx processors. Currently, the 538 4xx, 6xx, 7xx, 8xx, 74xx, and 82xx processors. Currently, the
497 default option is to build a kernel which works on PReP and CHRP. 539 default option is to build a kernel which works on PReP.
498 540
499 Note that support for Apple machines is now only available with 541 Note that support for Apple and CHRP machines is now only available
500 ARCH=powerpc, and has been removed from this menu. If you wish 542 with ARCH=powerpc, and has been removed from this menu. If you
501 to build a kernel for an Apple machine, exit this configuration 543 wish to build a kernel for an Apple or CHRP machine, exit this
502 process and re-run it with ARCH=powerpc. 544 configuration process and re-run it with ARCH=powerpc.
503 545
504 Select CHRP/PReP if configuring for an IBM RS/6000 or 546 Select PReP if configuring for a PReP machine.
505 pSeries machine, or a PReP machine.
506 547
507 Select Gemini if configuring for a Synergy Microsystems' Gemini 548 Select Gemini if configuring for a Synergy Microsystems' Gemini
508 series Single Board Computer. More information is available at: 549 series Single Board Computer. More information is available at:
@@ -511,8 +552,8 @@ choice
511 Select APUS if configuring for a PowerUP Amiga. More information is 552 Select APUS if configuring for a PowerUP Amiga. More information is
512 available at: <http://linux-apus.sourceforge.net/>. 553 available at: <http://linux-apus.sourceforge.net/>.
513 554
514config PPC_MULTIPLATFORM 555config PPC_PREP
515 bool "CHRP/PReP" 556 bool "PReP"
516 557
517config APUS 558config APUS
518 bool "Amiga-APUS" 559 bool "Amiga-APUS"
@@ -664,6 +705,13 @@ config LITE5200
664 much but it's only been tested on this board version. I think this 705 much but it's only been tested on this board version. I think this
665 board is also known as IceCube. 706 board is also known as IceCube.
666 707
708config LITE5200B
709 bool "Freescale LITE5200B"
710 depends LITE5200
711 help
712 Support for the LITE5200B dev board for the MPC5200 from Freescale.
713 This is the new board with 2 PCI slots.
714
667config MPC834x_SYS 715config MPC834x_SYS
668 bool "Freescale MPC834x SYS" 716 bool "Freescale MPC834x SYS"
669 help 717 help
@@ -749,25 +797,6 @@ config CPM2
749 you wish to build a kernel for a machine with a CPM2 coprocessor 797 you wish to build a kernel for a machine with a CPM2 coprocessor
750 on it (826x, 827x, 8560). 798 on it (826x, 827x, 8560).
751 799
752config PPC_CHRP
753 bool "Support for CHRP (Common Hardware Reference Platform) machines"
754 depends on PPC_MULTIPLATFORM
755 select PPC_I8259
756 select PPC_INDIRECT_PCI
757 default y
758
759config PPC_PREP
760 bool "Support for PReP (PowerPC Reference Platform) machines"
761 depends on PPC_MULTIPLATFORM
762 select PPC_I8259
763 select PPC_INDIRECT_PCI
764 default y
765
766config PPC_OF
767 bool
768 depends on PPC_CHRP
769 default y
770
771config PPC_GEN550 800config PPC_GEN550
772 bool 801 bool
773 depends on SANDPOINT || SPRUCE || PPLUS || \ 802 depends on SANDPOINT || SPRUCE || PPLUS || \
@@ -926,14 +955,6 @@ source "mm/Kconfig"
926 955
927source "fs/Kconfig.binfmt" 956source "fs/Kconfig.binfmt"
928 957
929config PROC_DEVICETREE
930 bool "Support for Open Firmware device tree in /proc"
931 depends on PPC_OF && PROC_FS
932 help
933 This option adds a device-tree directory under /proc which contains
934 an image of the device tree that the kernel copies from Open
935 Firmware. If unsure, say Y here.
936
937config PREP_RESIDUAL 958config PREP_RESIDUAL
938 bool "Support for PReP Residual Data" 959 bool "Support for PReP Residual Data"
939 depends on PPC_PREP 960 depends on PPC_PREP
@@ -1126,8 +1147,7 @@ menu "Bus options"
1126 1147
1127config ISA 1148config ISA
1128 bool "Support for ISA-bus hardware" 1149 bool "Support for ISA-bus hardware"
1129 depends on PPC_PREP || PPC_CHRP 1150 depends on PPC_PREP
1130 select PPC_I8259
1131 help 1151 help
1132 Find out whether you have ISA slots on your motherboard. ISA is the 1152 Find out whether you have ISA slots on your motherboard. ISA is the
1133 name of a bus system, i.e. the way the CPU talks to the other stuff 1153 name of a bus system, i.e. the way the CPU talks to the other stuff
@@ -1137,18 +1157,18 @@ config ISA
1137 1157
1138config GENERIC_ISA_DMA 1158config GENERIC_ISA_DMA
1139 bool 1159 bool
1140 depends on POWER3 || 6xx && !CPM2 1160 depends on 6xx && !CPM2
1141 default y 1161 default y
1142 1162
1143config PPC_I8259 1163config PPC_I8259
1144 bool 1164 bool
1145 default y if 85xx 1165 default y if 85xx || PPC_PREP
1146 default n 1166 default n
1147 1167
1148config PPC_INDIRECT_PCI 1168config PPC_INDIRECT_PCI
1149 bool 1169 bool
1150 depends on PCI 1170 depends on PCI
1151 default y if 40x || 44x || 85xx || 83xx 1171 default y if 40x || 44x || 85xx || 83xx || PPC_PREP
1152 default n 1172 default n
1153 1173
1154config EISA 1174config EISA
@@ -1339,7 +1359,7 @@ config CONSISTENT_SIZE
1339 1359
1340config BOOT_LOAD_BOOL 1360config BOOT_LOAD_BOOL
1341 bool "Set the boot link/load address" 1361 bool "Set the boot link/load address"
1342 depends on ADVANCED_OPTIONS && !PPC_MULTIPLATFORM 1362 depends on ADVANCED_OPTIONS && !PPC_PREP
1343 help 1363 help
1344 This option allows you to set the initial load address of the zImage 1364 This option allows you to set the initial load address of the zImage
1345 or zImage.initrd file. This can be useful if you are on a board 1365 or zImage.initrd file. This can be useful if you are on a board
diff --git a/arch/ppc/Kconfig.debug b/arch/ppc/Kconfig.debug
index 61653cb60c4e..f94b87740973 100644
--- a/arch/ppc/Kconfig.debug
+++ b/arch/ppc/Kconfig.debug
@@ -53,13 +53,6 @@ config BDI_SWITCH
53 Unless you are intending to debug the kernel with one of these 53 Unless you are intending to debug the kernel with one of these
54 machines, say N here. 54 machines, say N here.
55 55
56config BOOTX_TEXT
57 bool "Support for early boot text console (BootX or OpenFirmware only)"
58 depends PPC_OF
59 help
60 Say Y here to see progress messages from the boot firmware in text
61 mode. Requires either BootX or Open Firmware.
62
63config SERIAL_TEXT_DEBUG 56config SERIAL_TEXT_DEBUG
64 bool "Support for early boot texts over serial port" 57 bool "Support for early boot texts over serial port"
65 depends on 4xx || LOPEC || MV64X60 || PPLUS || PRPMC800 || \ 58 depends on 4xx || LOPEC || MV64X60 || PPLUS || PRPMC800 || \
@@ -67,7 +60,7 @@ config SERIAL_TEXT_DEBUG
67 60
68config PPC_OCP 61config PPC_OCP
69 bool 62 bool
70 depends on IBM_OCP || XILINX_OCP 63 depends on IBM_OCP
71 default y 64 default y
72 65
73endmenu 66endmenu
diff --git a/arch/ppc/Makefile b/arch/ppc/Makefile
index 98e940beeb3b..0db66dcf0723 100644
--- a/arch/ppc/Makefile
+++ b/arch/ppc/Makefile
@@ -40,10 +40,8 @@ ifndef CONFIG_FSL_BOOKE
40CFLAGS += -mstring 40CFLAGS += -mstring
41endif 41endif
42 42
43cpu-as-$(CONFIG_PPC64BRIDGE) += -Wa,-mppc64bridge
44cpu-as-$(CONFIG_4xx) += -Wa,-m405 43cpu-as-$(CONFIG_4xx) += -Wa,-m405
45cpu-as-$(CONFIG_6xx) += -Wa,-maltivec 44cpu-as-$(CONFIG_6xx) += -Wa,-maltivec
46cpu-as-$(CONFIG_POWER4) += -Wa,-maltivec
47cpu-as-$(CONFIG_E500) += -Wa,-me500 45cpu-as-$(CONFIG_E500) += -Wa,-me500
48cpu-as-$(CONFIG_E200) += -Wa,-me200 46cpu-as-$(CONFIG_E200) += -Wa,-me200
49 47
@@ -59,8 +57,6 @@ head-$(CONFIG_4xx) := arch/ppc/kernel/head_4xx.o
59head-$(CONFIG_44x) := arch/ppc/kernel/head_44x.o 57head-$(CONFIG_44x) := arch/ppc/kernel/head_44x.o
60head-$(CONFIG_FSL_BOOKE) := arch/ppc/kernel/head_fsl_booke.o 58head-$(CONFIG_FSL_BOOKE) := arch/ppc/kernel/head_fsl_booke.o
61 59
62head-$(CONFIG_6xx) += arch/ppc/kernel/idle_6xx.o
63head-$(CONFIG_POWER4) += arch/ppc/kernel/idle_power4.o
64head-$(CONFIG_PPC_FPU) += arch/powerpc/kernel/fpu.o 60head-$(CONFIG_PPC_FPU) += arch/powerpc/kernel/fpu.o
65 61
66core-y += arch/ppc/kernel/ arch/powerpc/kernel/ \ 62core-y += arch/ppc/kernel/ arch/powerpc/kernel/ \
@@ -71,7 +67,7 @@ core-y += arch/ppc/kernel/ arch/powerpc/kernel/ \
71core-$(CONFIG_4xx) += arch/ppc/platforms/4xx/ 67core-$(CONFIG_4xx) += arch/ppc/platforms/4xx/
72core-$(CONFIG_83xx) += arch/ppc/platforms/83xx/ 68core-$(CONFIG_83xx) += arch/ppc/platforms/83xx/
73core-$(CONFIG_85xx) += arch/ppc/platforms/85xx/ 69core-$(CONFIG_85xx) += arch/ppc/platforms/85xx/
74core-$(CONFIG_MATH_EMULATION) += arch/ppc/math-emu/ 70core-$(CONFIG_MATH_EMULATION) += arch/powerpc/math-emu/
75core-$(CONFIG_XMON) += arch/ppc/xmon/ 71core-$(CONFIG_XMON) += arch/ppc/xmon/
76core-$(CONFIG_APUS) += arch/ppc/amiga/ 72core-$(CONFIG_APUS) += arch/ppc/amiga/
77drivers-$(CONFIG_8xx) += arch/ppc/8xx_io/ 73drivers-$(CONFIG_8xx) += arch/ppc/8xx_io/
@@ -82,7 +78,7 @@ drivers-$(CONFIG_OPROFILE) += arch/powerpc/oprofile/
82 78
83BOOT_TARGETS = zImage zImage.initrd znetboot znetboot.initrd vmlinux.sm 79BOOT_TARGETS = zImage zImage.initrd znetboot znetboot.initrd vmlinux.sm
84 80
85.PHONY: $(BOOT_TARGETS) 81PHONY += $(BOOT_TARGETS)
86 82
87all: uImage zImage 83all: uImage zImage
88 84
diff --git a/arch/ppc/amiga/amiints.c b/arch/ppc/amiga/amiints.c
index 5f35cf3986f7..b2bba052ab93 100644
--- a/arch/ppc/amiga/amiints.c
+++ b/arch/ppc/amiga/amiints.c
@@ -1,5 +1,5 @@
1/* 1/*
2 * arch/ppc/amiga/amiints.c -- Amiga Linux interrupt handling code 2 * Amiga Linux interrupt handling code
3 * 3 *
4 * This file is subject to the terms and conditions of the GNU General Public 4 * This file is subject to the terms and conditions of the GNU General Public
5 * License. See the file COPYING in the main directory of this archive 5 * License. See the file COPYING in the main directory of this archive
diff --git a/arch/ppc/amiga/bootinfo.c b/arch/ppc/amiga/bootinfo.c
index e2e965661d03..efd869a3ed9b 100644
--- a/arch/ppc/amiga/bootinfo.c
+++ b/arch/ppc/amiga/bootinfo.c
@@ -1,6 +1,4 @@
1/* 1/*
2 * arch/ppc/amiga/bootinfo.c
3 *
4 * Extracted from arch/m68k/kernel/setup.c. 2 * Extracted from arch/m68k/kernel/setup.c.
5 * Should be properly generalized and put somewhere else. 3 * Should be properly generalized and put somewhere else.
6 * Jesper 4 * Jesper
diff --git a/arch/ppc/amiga/cia.c b/arch/ppc/amiga/cia.c
index 4431c58f611a..9558f2f40e64 100644
--- a/arch/ppc/amiga/cia.c
+++ b/arch/ppc/amiga/cia.c
@@ -1,6 +1,4 @@
1/* 1/*
2 * arch/ppc/amiga/cia.c - CIA support
3 *
4 * Copyright (C) 1996 Roman Zippel 2 * Copyright (C) 1996 Roman Zippel
5 * 3 *
6 * The concept of some functions bases on the original Amiga OS function 4 * The concept of some functions bases on the original Amiga OS function
diff --git a/arch/ppc/amiga/config.c b/arch/ppc/amiga/config.c
index 60e2da1c92c0..bbe47c9bd707 100644
--- a/arch/ppc/amiga/config.c
+++ b/arch/ppc/amiga/config.c
@@ -1,8 +1,6 @@
1#define m68k_debug_device debug_device 1#define m68k_debug_device debug_device
2 2
3/* 3/*
4 * arch/ppc/amiga/config.c
5 *
6 * Copyright (C) 1993 Hamish Macdonald 4 * Copyright (C) 1993 Hamish Macdonald
7 * 5 *
8 * This file is subject to the terms and conditions of the GNU General Public 6 * This file is subject to the terms and conditions of the GNU General Public
diff --git a/arch/ppc/amiga/ints.c b/arch/ppc/amiga/ints.c
index 5d318e498f06..083a17462190 100644
--- a/arch/ppc/amiga/ints.c
+++ b/arch/ppc/amiga/ints.c
@@ -1,6 +1,4 @@
1/* 1/*
2 * arch/ppc/amiga/ints.c
3 *
4 * Linux/m68k general interrupt handling code from arch/m68k/kernel/ints.c 2 * Linux/m68k general interrupt handling code from arch/m68k/kernel/ints.c
5 * Needed to drive the m68k emulating IRQ hardware on the PowerUp boards. 3 * Needed to drive the m68k emulating IRQ hardware on the PowerUp boards.
6 */ 4 */
diff --git a/arch/ppc/boot/Makefile b/arch/ppc/boot/Makefile
index efd8ce515d5f..b739e25d4728 100644
--- a/arch/ppc/boot/Makefile
+++ b/arch/ppc/boot/Makefile
@@ -1,6 +1,9 @@
1# 1#
2# arch/ppc/boot/Makefile 2# arch/ppc/boot/Makefile
3# 3#
4# This file is included by the global makefile so that you can add your own
5# architecture-specific flags and dependencies.
6#
4# This file is subject to the terms and conditions of the GNU General Public 7# This file is subject to the terms and conditions of the GNU General Public
5# License. See the file "COPYING" in the main directory of this archive 8# License. See the file "COPYING" in the main directory of this archive
6# for more details. 9# for more details.
@@ -16,16 +19,15 @@ HOSTCFLAGS += -Iarch/$(ARCH)/boot/include
16BOOT_TARGETS = zImage zImage.initrd znetboot znetboot.initrd 19BOOT_TARGETS = zImage zImage.initrd znetboot znetboot.initrd
17 20
18bootdir-y := simple 21bootdir-y := simple
19bootdir-$(CONFIG_PPC_OF) += openfirmware
20subdir-y := lib common images 22subdir-y := lib common images
21subdir-$(CONFIG_PPC_MULTIPLATFORM) += of1275 23subdir-$(CONFIG_PPC_PREP) += of1275
22 24
23# for cleaning 25# for cleaning
24subdir- += simple openfirmware 26subdir- += simple
25 27
26hostprogs-y := $(addprefix utils/, addnote mknote hack-coff mkprep mkbugboot mktree) 28hostprogs-y := $(addprefix utils/, mkprep mkbugboot mktree)
27 29
28.PHONY: $(BOOT_TARGETS) $(bootdir-y) 30PHONY += $(BOOT_TARGETS) $(bootdir-y)
29 31
30$(BOOT_TARGETS): $(bootdir-y) 32$(BOOT_TARGETS): $(bootdir-y)
31 33
diff --git a/arch/ppc/boot/common/Makefile b/arch/ppc/boot/common/Makefile
index f88d647d5dd4..a2e85e3beb88 100644
--- a/arch/ppc/boot/common/Makefile
+++ b/arch/ppc/boot/common/Makefile
@@ -1,6 +1,3 @@
1#
2# arch/ppc/boot/common/Makefile
3#
4# This file is subject to the terms and conditions of the GNU General Public 1# This file is subject to the terms and conditions of the GNU General Public
5# License. See the file "COPYING" in the main directory of this archive 2# License. See the file "COPYING" in the main directory of this archive
6# for more details. 3# for more details.
diff --git a/arch/ppc/boot/common/bootinfo.c b/arch/ppc/boot/common/bootinfo.c
index 9c6e528940e9..f4dc9b9fab9c 100644
--- a/arch/ppc/boot/common/bootinfo.c
+++ b/arch/ppc/boot/common/bootinfo.c
@@ -1,6 +1,4 @@
1/* 1/*
2 * arch/ppc/common/bootinfo.c
3 *
4 * General bootinfo record utilities 2 * General bootinfo record utilities
5 * Author: Randy Vinson <rvinson@mvista.com> 3 * Author: Randy Vinson <rvinson@mvista.com>
6 * 4 *
diff --git a/arch/ppc/boot/common/misc-common.c b/arch/ppc/boot/common/misc-common.c
index e79e6b3f276e..073830a8559a 100644
--- a/arch/ppc/boot/common/misc-common.c
+++ b/arch/ppc/boot/common/misc-common.c
@@ -1,6 +1,4 @@
1/* 1/*
2 * arch/ppc/boot/common/misc-common.c
3 *
4 * Misc. bootloader code (almost) all platforms can use 2 * Misc. bootloader code (almost) all platforms can use
5 * 3 *
6 * Author: Johnnie Peters <jpeters@mvista.com> 4 * Author: Johnnie Peters <jpeters@mvista.com>
diff --git a/arch/ppc/boot/common/ns16550.c b/arch/ppc/boot/common/ns16550.c
index 26818bbb6cff..4f00c93ac870 100644
--- a/arch/ppc/boot/common/ns16550.c
+++ b/arch/ppc/boot/common/ns16550.c
@@ -8,6 +8,9 @@
8#include <linux/serial_reg.h> 8#include <linux/serial_reg.h>
9#include <asm/serial.h> 9#include <asm/serial.h>
10 10
11#if defined(CONFIG_XILINX_VIRTEX)
12#include <platforms/4xx/xparameters/xparameters.h>
13#endif
11#include "nonstdio.h" 14#include "nonstdio.h"
12#include "serial.h" 15#include "serial.h"
13 16
diff --git a/arch/ppc/boot/common/serial_stub.c b/arch/ppc/boot/common/serial_stub.c
index 03dfaa01fa63..5cc9ae66a8ba 100644
--- a/arch/ppc/boot/common/serial_stub.c
+++ b/arch/ppc/boot/common/serial_stub.c
@@ -1,6 +1,4 @@
1/* 1/*
2 * arch/ppc/boot/common/serial_stub.c
3 *
4 * This is a few stub routines to make the boot code cleaner looking when 2 * This is a few stub routines to make the boot code cleaner looking when
5 * there is no serial port support doesn't need to be closed, for example. 3 * there is no serial port support doesn't need to be closed, for example.
6 * 4 *
diff --git a/arch/ppc/boot/common/util.S b/arch/ppc/boot/common/util.S
index 368ec035e6cd..0c5e43c4ae06 100644
--- a/arch/ppc/boot/common/util.S
+++ b/arch/ppc/boot/common/util.S
@@ -1,6 +1,4 @@
1/* 1/*
2 * arch/ppc/boot/common/util.S
3 *
4 * Useful bootup functions, which are more easily done in asm than C. 2 * Useful bootup functions, which are more easily done in asm than C.
5 * 3 *
6 * NOTE: Be very very careful about the registers you use here. 4 * NOTE: Be very very careful about the registers you use here.
diff --git a/arch/ppc/boot/include/mpc10x.h b/arch/ppc/boot/include/mpc10x.h
index 6cd40ecabc74..6e5d540d8d3e 100644
--- a/arch/ppc/boot/include/mpc10x.h
+++ b/arch/ppc/boot/include/mpc10x.h
@@ -1,6 +1,4 @@
1/* 1/*
2 * arch/ppc/boot/include/mpc10.h
3 *
4 * Common defines for the Motorola SPS MPC106/8240/107 Host bridge/Mem 2 * Common defines for the Motorola SPS MPC106/8240/107 Host bridge/Mem
5 * ctrl/EPIC/etc. 3 * ctrl/EPIC/etc.
6 * 4 *
diff --git a/arch/ppc/boot/openfirmware/Makefile b/arch/ppc/boot/openfirmware/Makefile
deleted file mode 100644
index 2a411ec2e650..000000000000
--- a/arch/ppc/boot/openfirmware/Makefile
+++ /dev/null
@@ -1,106 +0,0 @@
1# Makefile for making bootable images on various OpenFirmware machines.
2#
3# Paul Mackerras January 1997
4# XCOFF bootable images for PowerMacs
5# Geert Uytterhoeven September 1997
6# ELF bootable iamges for CHRP machines.
7# Tom Rini January 2001
8# Cleaned up, moved into arch/ppc/boot/pmac
9# Tom Rini July/August 2002
10# Merged 'chrp' and 'pmac' into 'openfirmware', and cleaned up the
11# rules.
12
13zImage.initrd znetboot.initrd: del-ramdisk-sec := -R .ramdisk
14zImage.initrd znetboot.initrd: initrd := .initrd
15
16
17boot := arch/ppc/boot
18common := $(boot)/common
19utils := $(boot)/utils
20bootlib := $(boot)/lib
21of1275 := $(boot)/of1275
22images := $(boot)/images
23
24CHRP_LD_ARGS := -T $(srctree)/$(boot)/ld.script -e _start -Ttext 0x00800000
25
26COMMONOBJS := start.o misc.o common.o
27CHRPOBJS := crt0.o $(COMMONOBJS) chrpmain.o
28
29targets := $(CHRPOBJS) dummy.o
30CHRPOBJS := $(addprefix $(obj)/, $(CHRPOBJS))
31
32LIBS := lib/lib.a $(bootlib)/lib.a $(of1275)/lib.a $(common)/lib.a
33
34ifdef CONFIG_SMP
35END := .smp
36endif
37ifdef CONFIG_PPC64BRIDGE
38END += .64
39endif
40
41
42$(images)/ramdisk.image.gz:
43 @echo ' MISSING $@'
44 @echo ' RAM disk image must be provided separately'
45 @/bin/false
46
47quiet_cmd_genimage = GEN $@
48 cmd_genimage = $(OBJCOPY) -R .comment \
49 --add-section=.image=$(images)/vmlinux.gz \
50 --set-section-flags=.image=contents,alloc,load,readonly,data $< $@
51
52targets += image.o
53$(obj)/image.o: $(obj)/dummy.o $(images)/vmlinux.gz FORCE
54 $(call if_changed,genimage)
55
56# Place the ramdisk in the initrd image.
57quiet_cmd_genimage-initrd = GEN $@
58 cmd_genimage-initrd = $(OBJCOPY) $< $@ \
59 --add-section=.ramdisk=$(images)/ramdisk.image.gz \
60 --set-section-flags=.ramdisk=contents,alloc,load,readonly,data
61targets += image.initrd.o
62$(obj)/image.initrd.o: $(obj)/image.o $(images)/ramdisk.image.gz FORCE
63 $(call if_changed,genimage-initrd)
64
65
66targets += crt0.o
67$(obj)/crt0.o: $(common)/crt0.S FORCE
68 $(call if_changed_dep,as_o_S)
69
70quiet_cmd_gen-chrp = CHRP $@
71 cmd_gen-chrp = $(LD) $(CHRP_LD_ARGS) -o $@ $(CHRPOBJS) $< $(LIBS) && \
72 $(OBJCOPY) $@ $@ -R .comment $(del-ramdisk-sec)
73
74$(images)/zImage.chrp: $(obj)/image.o $(CHRPOBJS) $(LIBS) \
75 $(srctree)/$(boot)/ld.script
76 $(call cmd,gen-chrp)
77$(images)/zImage.initrd.chrp: $(obj)/image.initrd.o $(CHRPOBJS) $(LIBS) \
78 $(srctree)/$(boot)/ld.script
79 $(call cmd,gen-chrp)
80
81quiet_cmd_addnote = ADDNOTE $@
82 cmd_addnote = cat $< > $@ && $(utils)/addnote $@
83$(images)/zImage.chrp-rs6k $(images)/zImage.initrd.chrp-rs6k: \
84 %-rs6k: %
85 $(call cmd,addnote)
86
87# The targets used on the make command-line
88
89.PHONY: zImage zImage.initrd
90zImage: $(images)/zImage.chrp \
91 $(images)/zImage.chrp-rs6k
92 @echo ' kernel: $@ is ready ($<)'
93zImage.initrd: $(images)/zImage.initrd.chrp \
94 $(images)/zImage.initrd.chrp-rs6k
95 @echo ' kernel: $@ is ready ($<)'
96
97TFTPIMAGE := /tftpboot/zImage
98
99.PHONY: znetboot znetboot.initrd
100znetboot: $(images)/zImage.chrp
101 cp $(images)/zImage.chrp $(TFTPIMAGE).chrp$(END)
102 @echo ' kernel: $@ is ready ($<)'
103znetboot.initrd:$(images)/zImage.initrd.chrp
104 cp $(images)/zImage.initrd.chrp $(TFTPIMAGE).chrp$(END)
105 @echo ' kernel: $@ is ready ($<)'
106
diff --git a/arch/ppc/boot/openfirmware/chrpmain.c b/arch/ppc/boot/openfirmware/chrpmain.c
deleted file mode 100644
index 245dbd9fc120..000000000000
--- a/arch/ppc/boot/openfirmware/chrpmain.c
+++ /dev/null
@@ -1,101 +0,0 @@
1/*
2 * Copyright (C) Paul Mackerras 1997.
3 *
4 * This program is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU General Public License
6 * as published by the Free Software Foundation; either version
7 * 2 of the License, or (at your option) any later version.
8 */
9#include <linux/string.h>
10#include "nonstdio.h"
11#include "of1275.h"
12#include <asm/processor.h>
13#include <asm/page.h>
14
15/* Passed from the linker */
16extern char __image_begin, __image_end;
17extern char __ramdisk_begin, __ramdisk_end;
18extern char _start, _end;
19
20extern unsigned int heap_max;
21extern void flush_cache(void *, unsigned long);
22extern void gunzip(void *, int, unsigned char *, int *);
23extern void make_bi_recs(unsigned long addr, char *name, unsigned int mach,
24 unsigned int progend);
25
26char *avail_ram;
27char *begin_avail, *end_avail;
28char *avail_high;
29
30#define RAM_START 0x00000000
31#define RAM_END (64<<20)
32
33#define BOOT_START ((unsigned long)_start)
34#define BOOT_END ((unsigned long)(_end + 0xFFF) & ~0xFFF)
35
36#define RAM_FREE ((unsigned long)(_end+0x1000)&~0xFFF)
37#define PROG_START 0x00010000
38#define PROG_SIZE 0x007f0000 /* 8MB */
39
40#define SCRATCH_SIZE (128 << 10)
41
42static char scratch[SCRATCH_SIZE]; /* 128k of scratch space for gunzip */
43
44typedef void (*kernel_start_t)(int, int, void *, unsigned int, unsigned int);
45
46void
47boot(int a1, int a2, void *prom)
48{
49 unsigned sa, len;
50 void *dst;
51 unsigned char *im;
52 unsigned int initrd_size, initrd_start;
53
54 printf("chrpboot starting: loaded at 0x%p\n\r", &_start);
55
56 initrd_size = &__ramdisk_end - &__ramdisk_begin;
57 if (initrd_size) {
58 initrd_start = (RAM_END - initrd_size) & ~0xFFF;
59 a1 = initrd_start;
60 a2 = initrd_size;
61 claim(initrd_start, RAM_END - initrd_start, 0);
62 printf("initial ramdisk moving 0x%x <- 0x%p (%x bytes)\n\r",
63 initrd_start, &__ramdisk_begin, initrd_size);
64 memcpy((char *)initrd_start, &__ramdisk_begin, initrd_size);
65 } else {
66 initrd_start = 0;
67 initrd_size = 0;
68 a2 = 0xdeadbeef;
69 }
70
71 im = &__image_begin;
72 len = &__image_end - &__image_begin;
73 /* claim 4MB starting at PROG_START */
74 claim(PROG_START, PROG_SIZE - PROG_START, 0);
75 dst = (void *) PROG_START;
76 if (im[0] == 0x1f && im[1] == 0x8b) {
77 avail_ram = scratch;
78 begin_avail = avail_high = avail_ram;
79 end_avail = scratch + sizeof(scratch);
80 printf("gunzipping (0x%p <- 0x%p:0x%p)...", dst, im, im+len);
81 gunzip(dst, PROG_SIZE - PROG_START, im, &len);
82 printf("done %u bytes\n\r", len);
83 printf("%u bytes of heap consumed, max in use %u\n\r",
84 avail_high - begin_avail, heap_max);
85 } else {
86 memmove(dst, im, len);
87 }
88
89 flush_cache(dst, len);
90 make_bi_recs(((unsigned long) dst + len), "chrpboot", _MACH_chrp,
91 (PROG_START + PROG_SIZE));
92
93 sa = PROG_START;
94 printf("start address = 0x%x\n\r", sa);
95
96 (*(kernel_start_t)sa)(a1, a2, prom, initrd_start, initrd_size);
97
98 printf("returned?\n\r");
99
100 pause();
101}
diff --git a/arch/ppc/boot/openfirmware/common.c b/arch/ppc/boot/openfirmware/common.c
deleted file mode 100644
index 0f46756a903e..000000000000
--- a/arch/ppc/boot/openfirmware/common.c
+++ /dev/null
@@ -1,146 +0,0 @@
1/*
2 * Copyright (C) Paul Mackerras 1997.
3 *
4 * This program is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU General Public License
6 * as published by the Free Software Foundation; either version
7 * 2 of the License, or (at your option) any later version.
8 */
9
10#include "nonstdio.h"
11#include "of1275.h"
12#include <linux/string.h>
13#include <linux/zlib.h>
14#include <asm/bootinfo.h>
15#include <asm/page.h>
16
17/* Information from the linker */
18
19extern int strcmp(const char *s1, const char *s2);
20extern char *avail_ram, *avail_high;
21extern char *end_avail;
22
23unsigned int heap_use, heap_max;
24
25struct memchunk {
26 unsigned int size;
27 struct memchunk *next;
28};
29
30static struct memchunk *freechunks;
31
32static void *zalloc(unsigned size)
33{
34 void *p;
35 struct memchunk **mpp, *mp;
36
37 size = (size + 7) & -8;
38 heap_use += size;
39 if (heap_use > heap_max)
40 heap_max = heap_use;
41 for (mpp = &freechunks; (mp = *mpp) != 0; mpp = &mp->next) {
42 if (mp->size == size) {
43 *mpp = mp->next;
44 return mp;
45 }
46 }
47 p = avail_ram;
48 avail_ram += size;
49 if (avail_ram > avail_high)
50 avail_high = avail_ram;
51 if (avail_ram > end_avail) {
52 printf("oops... out of memory\n\r");
53 pause();
54 }
55 return p;
56}
57
58#define HEAD_CRC 2
59#define EXTRA_FIELD 4
60#define ORIG_NAME 8
61#define COMMENT 0x10
62#define RESERVED 0xe0
63
64void gunzip(void *dst, int dstlen, unsigned char *src, int *lenp)
65{
66 z_stream s;
67 int r, i, flags;
68
69 /* skip header */
70 i = 10;
71 flags = src[3];
72 if (src[2] != Z_DEFLATED || (flags & RESERVED) != 0) {
73 printf("bad gzipped data\n\r");
74 exit();
75 }
76 if ((flags & EXTRA_FIELD) != 0)
77 i = 12 + src[10] + (src[11] << 8);
78 if ((flags & ORIG_NAME) != 0)
79 while (src[i++] != 0)
80 ;
81 if ((flags & COMMENT) != 0)
82 while (src[i++] != 0)
83 ;
84 if ((flags & HEAD_CRC) != 0)
85 i += 2;
86 if (i >= *lenp) {
87 printf("gunzip: ran out of data in header\n\r");
88 exit();
89 }
90
91 /* Initialize ourself. */
92 s.workspace = zalloc(zlib_inflate_workspacesize());
93 r = zlib_inflateInit2(&s, -MAX_WBITS);
94 if (r != Z_OK) {
95 printf("zlib_inflateInit2 returned %d\n\r", r);
96 exit();
97 }
98 s.next_in = src + i;
99 s.avail_in = *lenp - i;
100 s.next_out = dst;
101 s.avail_out = dstlen;
102 r = zlib_inflate(&s, Z_FINISH);
103 if (r != Z_OK && r != Z_STREAM_END) {
104 printf("inflate returned %d msg: %s\n\r", r, s.msg);
105 exit();
106 }
107 *lenp = s.next_out - (unsigned char *) dst;
108 zlib_inflateEnd(&s);
109}
110
111/* Make a bi_rec in OF. We need to be passed a name for BI_BOOTLOADER_ID,
112 * a machine type for BI_MACHTYPE, and the location where the end of the
113 * bootloader is (PROG_START + PROG_SIZE)
114 */
115void make_bi_recs(unsigned long addr, char *name, unsigned int mach,
116 unsigned long progend)
117{
118 struct bi_record *rec;
119
120
121 /* leave a 1MB gap then align to the next 1MB boundary */
122 addr = _ALIGN(addr+ (1<<20) - 1, (1<<20));
123 /* oldworld machine seem very unhappy about this. -- Tom */
124 if (addr >= progend)
125 claim(addr, 0x1000, 0);
126
127 rec = (struct bi_record *)addr;
128 rec->tag = BI_FIRST;
129 rec->size = sizeof(struct bi_record);
130 rec = (struct bi_record *)((unsigned long)rec + rec->size);
131
132 rec->tag = BI_BOOTLOADER_ID;
133 sprintf( (char *)rec->data, name);
134 rec->size = sizeof(struct bi_record) + strlen(name) + 1;
135 rec = (struct bi_record *)((unsigned long)rec + rec->size);
136
137 rec->tag = BI_MACHTYPE;
138 rec->data[0] = mach;
139 rec->data[1] = 1;
140 rec->size = sizeof(struct bi_record) + 2 * sizeof(unsigned long);
141 rec = (struct bi_record *)((unsigned long)rec + rec->size);
142
143 rec->tag = BI_LAST;
144 rec->size = sizeof(struct bi_record);
145 rec = (struct bi_record *)((unsigned long)rec + rec->size);
146}
diff --git a/arch/ppc/boot/openfirmware/dummy.c b/arch/ppc/boot/openfirmware/dummy.c
deleted file mode 100644
index 31dbf45bf99c..000000000000
--- a/arch/ppc/boot/openfirmware/dummy.c
+++ /dev/null
@@ -1,4 +0,0 @@
1int main(void)
2{
3 return 0;
4}
diff --git a/arch/ppc/boot/openfirmware/misc.S b/arch/ppc/boot/openfirmware/misc.S
deleted file mode 100644
index ab9e897cadd0..000000000000
--- a/arch/ppc/boot/openfirmware/misc.S
+++ /dev/null
@@ -1,67 +0,0 @@
1/*
2 * Copyright (C) Paul Mackerras 1997.
3 *
4 * This program is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU General Public License
6 * as published by the Free Software Foundation; either version
7 * 2 of the License, or (at your option) any later version.
8 */
9 .text
10
11/*
12 * Use the BAT2 & 3 registers to map the 1st 16MB of RAM to
13 * the address given as the 1st argument.
14 */
15 .globl setup_bats
16setup_bats:
17 mfpvr 5
18 rlwinm 5,5,16,16,31 /* r3 = 1 for 601, 4 for 604 */
19 cmpwi 0,5,1
20 li 0,0
21 bne 4f
22 mtibatl 3,0 /* invalidate BAT first */
23 ori 3,3,4 /* set up BAT registers for 601 */
24 li 4,0x7f
25 mtibatu 2,3
26 mtibatl 2,4
27 oris 3,3,0x80
28 oris 4,4,0x80
29 mtibatu 3,3
30 mtibatl 3,4
31 b 5f
324: mtdbatu 3,0 /* invalidate BATs first */
33 mtibatu 3,0
34 ori 3,3,0xff /* set up BAT registers for 604 */
35 li 4,2
36 mtdbatl 2,4
37 mtdbatu 2,3
38 mtibatl 2,4
39 mtibatu 2,3
40 oris 3,3,0x80
41 oris 4,4,0x80
42 mtdbatl 3,4
43 mtdbatu 3,3
44 mtibatl 3,4
45 mtibatu 3,3
465: sync
47 isync
48 blr
49
50/*
51 * Flush the dcache and invalidate the icache for a range of addresses.
52 *
53 * flush_cache(addr, len)
54 */
55 .global flush_cache
56flush_cache:
57 addi 4,4,0x1f /* len = (len + 0x1f) / 0x20 */
58 rlwinm. 4,4,27,5,31
59 mtctr 4
60 beqlr
611: dcbf 0,3
62 icbi 0,3
63 addi 3,3,0x20
64 bdnz 1b
65 sync
66 isync
67 blr
diff --git a/arch/ppc/boot/openfirmware/start.c b/arch/ppc/boot/openfirmware/start.c
deleted file mode 100644
index 1617a26956bf..000000000000
--- a/arch/ppc/boot/openfirmware/start.c
+++ /dev/null
@@ -1,172 +0,0 @@
1/*
2 * Copyright (C) Paul Mackerras 1997.
3 *
4 * This program is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU General Public License
6 * as published by the Free Software Foundation; either version
7 * 2 of the License, or (at your option) any later version.
8 */
9#include <stdarg.h>
10#include "of1275.h"
11
12extern int strlen(const char *s);
13extern void boot(int a1, int a2, void *prom);
14
15phandle stdin;
16phandle stdout;
17phandle stderr;
18
19void printk(char *fmt, ...);
20
21void
22start(int a1, int a2, void *promptr)
23{
24 ofinit(promptr);
25 if (ofstdio(&stdin, &stdout, &stderr))
26 exit();
27
28 boot(a1, a2, promptr);
29 for (;;)
30 exit();
31}
32
33int writestring(void *f, char *ptr, int nb)
34{
35 int w = 0, i;
36 char *ret = "\r";
37
38 for (i = 0; i < nb; ++i) {
39 if (ptr[i] == '\n') {
40 if (i > w) {
41 write(f, ptr + w, i - w);
42 w = i;
43 }
44 write(f, ret, 1);
45 }
46 }
47 if (w < nb)
48 write(f, ptr + w, nb - w);
49 return nb;
50}
51
52int
53putc(int c, void *f)
54{
55 char ch = c;
56
57 return writestring(f, &ch, 1) == 1? c: -1;
58}
59
60int
61putchar(int c)
62{
63 return putc(c, stdout);
64}
65
66int
67fputs(char *str, void *f)
68{
69 int n = strlen(str);
70
71 return writestring(f, str, n) == n? 0: -1;
72}
73
74int
75readchar(void)
76{
77 char ch;
78
79 for (;;) {
80 switch (read(stdin, &ch, 1)) {
81 case 1:
82 return ch;
83 case -1:
84 printk("read(stdin) returned -1\n");
85 return -1;
86 }
87 }
88}
89
90static char line[256];
91static char *lineptr;
92static int lineleft;
93
94int
95getchar(void)
96{
97 int c;
98
99 if (lineleft == 0) {
100 lineptr = line;
101 for (;;) {
102 c = readchar();
103 if (c == -1 || c == 4)
104 break;
105 if (c == '\r' || c == '\n') {
106 *lineptr++ = '\n';
107 putchar('\n');
108 break;
109 }
110 switch (c) {
111 case 0177:
112 case '\b':
113 if (lineptr > line) {
114 putchar('\b');
115 putchar(' ');
116 putchar('\b');
117 --lineptr;
118 }
119 break;
120 case 'U' & 0x1F:
121 while (lineptr > line) {
122 putchar('\b');
123 putchar(' ');
124 putchar('\b');
125 --lineptr;
126 }
127 break;
128 default:
129 if (lineptr >= &line[sizeof(line) - 1])
130 putchar('\a');
131 else {
132 putchar(c);
133 *lineptr++ = c;
134 }
135 }
136 }
137 lineleft = lineptr - line;
138 lineptr = line;
139 }
140 if (lineleft == 0)
141 return -1;
142 --lineleft;
143 return *lineptr++;
144}
145
146extern int vsprintf(char *buf, const char *fmt, va_list args);
147static char sprint_buf[1024];
148
149void
150printk(char *fmt, ...)
151{
152 va_list args;
153 int n;
154
155 va_start(args, fmt);
156 n = vsprintf(sprint_buf, fmt, args);
157 va_end(args);
158 writestring(stdout, sprint_buf, n);
159}
160
161int
162printf(char *fmt, ...)
163{
164 va_list args;
165 int n;
166
167 va_start(args, fmt);
168 n = vsprintf(sprint_buf, fmt, args);
169 va_end(args);
170 writestring(stdout, sprint_buf, n);
171 return n;
172}
diff --git a/arch/ppc/boot/simple/Makefile b/arch/ppc/boot/simple/Makefile
index 9533f8de238f..28be01b99c44 100644
--- a/arch/ppc/boot/simple/Makefile
+++ b/arch/ppc/boot/simple/Makefile
@@ -192,6 +192,7 @@ boot-$(CONFIG_8xx) += embed_config.o
192boot-$(CONFIG_8260) += embed_config.o 192boot-$(CONFIG_8260) += embed_config.o
193boot-$(CONFIG_EP405) += embed_config.o 193boot-$(CONFIG_EP405) += embed_config.o
194boot-$(CONFIG_XILINX_ML300) += embed_config.o 194boot-$(CONFIG_XILINX_ML300) += embed_config.o
195boot-$(CONFIG_XILINX_ML403) += embed_config.o
195boot-$(CONFIG_BSEIP) += iic.o 196boot-$(CONFIG_BSEIP) += iic.o
196boot-$(CONFIG_MBX) += iic.o pci.o qspan_pci.o 197boot-$(CONFIG_MBX) += iic.o pci.o qspan_pci.o
197boot-$(CONFIG_MV64X60) += misc-mv64x60.o 198boot-$(CONFIG_MV64X60) += misc-mv64x60.o
diff --git a/arch/ppc/boot/simple/cpc700_memory.c b/arch/ppc/boot/simple/cpc700_memory.c
index 8c75cf6c2383..d75420a45a59 100644
--- a/arch/ppc/boot/simple/cpc700_memory.c
+++ b/arch/ppc/boot/simple/cpc700_memory.c
@@ -1,6 +1,4 @@
1/* 1/*
2 * arch/ppc/boot/common/cpc700_memory.c
3 *
4 * Find memory based upon settings in the CPC700 bridge 2 * Find memory based upon settings in the CPC700 bridge
5 * 3 *
6 * Author: Dan Cox 4 * Author: Dan Cox
diff --git a/arch/ppc/boot/simple/embed_config.c b/arch/ppc/boot/simple/embed_config.c
index 491a691d10cc..3a51b1062940 100644
--- a/arch/ppc/boot/simple/embed_config.c
+++ b/arch/ppc/boot/simple/embed_config.c
@@ -21,6 +21,9 @@
21#ifdef CONFIG_40x 21#ifdef CONFIG_40x
22#include <asm/io.h> 22#include <asm/io.h>
23#endif 23#endif
24#ifdef CONFIG_XILINX_VIRTEX
25#include <platforms/4xx/xparameters/xparameters.h>
26#endif
24extern unsigned long timebase_period_ns; 27extern unsigned long timebase_period_ns;
25 28
26/* For those boards that don't provide one. 29/* For those boards that don't provide one.
@@ -742,7 +745,7 @@ embed_config(bd_t **bdp)
742} 745}
743#endif /* WILLOW */ 746#endif /* WILLOW */
744 747
745#ifdef CONFIG_XILINX_ML300 748#if defined(CONFIG_XILINX_ML300) || defined(CONFIG_XILINX_ML403)
746void 749void
747embed_config(bd_t ** bdp) 750embed_config(bd_t ** bdp)
748{ 751{
@@ -779,7 +782,7 @@ embed_config(bd_t ** bdp)
779 timebase_period_ns = 1000000000 / bd->bi_tbfreq; 782 timebase_period_ns = 1000000000 / bd->bi_tbfreq;
780 /* see bi_tbfreq definition in arch/ppc/platforms/4xx/xilinx_ml300.h */ 783 /* see bi_tbfreq definition in arch/ppc/platforms/4xx/xilinx_ml300.h */
781} 784}
782#endif /* CONFIG_XILINX_ML300 */ 785#endif /* CONFIG_XILINX_ML300 || CONFIG_XILINX_ML403 */
783 786
784#ifdef CONFIG_IBM_OPENBIOS 787#ifdef CONFIG_IBM_OPENBIOS
785/* This could possibly work for all treeboot roms. 788/* This could possibly work for all treeboot roms.
diff --git a/arch/ppc/boot/simple/head.S b/arch/ppc/boot/simple/head.S
index 5e4adc298bf9..160da1006ff8 100644
--- a/arch/ppc/boot/simple/head.S
+++ b/arch/ppc/boot/simple/head.S
@@ -1,6 +1,4 @@
1/* 1/*
2 * arch/ppc/boot/simple/head.S
3 *
4 * Initial board bringup code for many different boards. 2 * Initial board bringup code for many different boards.
5 * 3 *
6 * Author: Tom Rini 4 * Author: Tom Rini
@@ -65,6 +63,13 @@ start_:
65 */ 63 */
66#endif 64#endif
67 65
66#if defined(CONFIG_XILINX_VIRTEX_4_FX)
67 /* PPC errata 213: only for Virtex-4 FX */
68 mfccr0 0
69 oris 0,0,0x50000000@h
70 mtccr0 0
71#endif
72
68 mflr r3 /* Save our actual starting address. */ 73 mflr r3 /* Save our actual starting address. */
69 74
70 /* The following functions we call must not modify r3 or r4..... 75 /* The following functions we call must not modify r3 or r4.....
diff --git a/arch/ppc/boot/simple/misc-chestnut.c b/arch/ppc/boot/simple/misc-chestnut.c
index 0dce7f3557e4..b94e142ad892 100644
--- a/arch/ppc/boot/simple/misc-chestnut.c
+++ b/arch/ppc/boot/simple/misc-chestnut.c
@@ -1,6 +1,4 @@
1/* 1/*
2 * arch/ppc/boot/simple/misc-chestnut.c
3 *
4 * Setup for the IBM Chestnut (ibm-750fxgx_eval) 2 * Setup for the IBM Chestnut (ibm-750fxgx_eval)
5 * 3 *
6 * Author: Mark A. Greer <mgreer@mvista.com> 4 * Author: Mark A. Greer <mgreer@mvista.com>
diff --git a/arch/ppc/boot/simple/misc-cpci690.c b/arch/ppc/boot/simple/misc-cpci690.c
index 26860300fa09..8a8614d11a32 100644
--- a/arch/ppc/boot/simple/misc-cpci690.c
+++ b/arch/ppc/boot/simple/misc-cpci690.c
@@ -1,6 +1,4 @@
1/* 1/*
2 * arch/ppc/boot/simple/misc-cpci690.c
3 *
4 * Add birec data for Force CPCI690 board. 2 * Add birec data for Force CPCI690 board.
5 * 3 *
6 * Author: Mark A. Greer <source@mvista.com> 4 * Author: Mark A. Greer <source@mvista.com>
diff --git a/arch/ppc/boot/simple/misc-ev64260.c b/arch/ppc/boot/simple/misc-ev64260.c
index 52ece6937a7a..2678c224af22 100644
--- a/arch/ppc/boot/simple/misc-ev64260.c
+++ b/arch/ppc/boot/simple/misc-ev64260.c
@@ -1,6 +1,4 @@
1/* 1/*
2 * arch/ppc/boot/simple/misc-ev64260.c
3 *
4 * Host bridge init code for the Marvell/Galileo EV-64260-BP evaluation board 2 * Host bridge init code for the Marvell/Galileo EV-64260-BP evaluation board
5 * with a GT64260 onboard. 3 * with a GT64260 onboard.
6 * 4 *
diff --git a/arch/ppc/boot/simple/misc-ev64360.c b/arch/ppc/boot/simple/misc-ev64360.c
index cd1ccf2a1582..a212b5b988cb 100644
--- a/arch/ppc/boot/simple/misc-ev64360.c
+++ b/arch/ppc/boot/simple/misc-ev64360.c
@@ -1,5 +1,4 @@
1/* 1/*
2 * arch/ppc/boot/simple/misc-ev64360.c
3 * Copyright (C) 2005 Lee Nicks <allinux@gmail.com> 2 * Copyright (C) 2005 Lee Nicks <allinux@gmail.com>
4 * 3 *
5 * Based on arch/ppc/boot/simple/misc-katana.c from: 4 * Based on arch/ppc/boot/simple/misc-katana.c from:
diff --git a/arch/ppc/boot/simple/misc-katana.c b/arch/ppc/boot/simple/misc-katana.c
index ec94a11bacac..d97f2ee6f04e 100644
--- a/arch/ppc/boot/simple/misc-katana.c
+++ b/arch/ppc/boot/simple/misc-katana.c
@@ -1,6 +1,4 @@
1/* 1/*
2 * arch/ppc/boot/simple/misc-katana.c
3 *
4 * Set up MPSC values to bootwrapper can prompt user. 2 * Set up MPSC values to bootwrapper can prompt user.
5 * 3 *
6 * Author: Mark A. Greer <source@mvista.com> 4 * Author: Mark A. Greer <source@mvista.com>
diff --git a/arch/ppc/boot/simple/misc-mv64x60.c b/arch/ppc/boot/simple/misc-mv64x60.c
index 258d4599fadc..71ff20fd494a 100644
--- a/arch/ppc/boot/simple/misc-mv64x60.c
+++ b/arch/ppc/boot/simple/misc-mv64x60.c
@@ -1,6 +1,4 @@
1/* 1/*
2 * arch/ppc/boot/simple/misc-mv64x60.c
3 *
4 * Relocate bridge's register base and call board specific routine. 2 * Relocate bridge's register base and call board specific routine.
5 * 3 *
6 * Author: Mark A. Greer <source@mvista.com> 4 * Author: Mark A. Greer <source@mvista.com>
diff --git a/arch/ppc/boot/simple/misc-prep.c b/arch/ppc/boot/simple/misc-prep.c
index 75380ac41669..63def9d13d70 100644
--- a/arch/ppc/boot/simple/misc-prep.c
+++ b/arch/ppc/boot/simple/misc-prep.c
@@ -1,6 +1,4 @@
1/* 1/*
2 * arch/ppc/boot/simple/misc-prep.c
3 *
4 * Maintainer: Tom Rini <trini@kernel.crashing.org> 2 * Maintainer: Tom Rini <trini@kernel.crashing.org>
5 * 3 *
6 * In the past: Gary Thomas, Cort Dougan <cort@cs.nmt.edu> 4 * In the past: Gary Thomas, Cort Dougan <cort@cs.nmt.edu>
diff --git a/arch/ppc/boot/simple/misc-radstone_ppc7d.c b/arch/ppc/boot/simple/misc-radstone_ppc7d.c
index 569e0d4feeaf..0f302ea9c3d1 100644
--- a/arch/ppc/boot/simple/misc-radstone_ppc7d.c
+++ b/arch/ppc/boot/simple/misc-radstone_ppc7d.c
@@ -1,6 +1,4 @@
1/* 1/*
2 * arch/ppc/boot/simple/misc-radstone_ppc7d.c
3 *
4 * Misc data for Radstone PPC7D board. 2 * Misc data for Radstone PPC7D board.
5 * 3 *
6 * Author: James Chapman <jchapman@katalix.com> 4 * Author: James Chapman <jchapman@katalix.com>
diff --git a/arch/ppc/boot/simple/misc-spruce.c b/arch/ppc/boot/simple/misc-spruce.c
index d012c39278fd..0cad2f557a1e 100644
--- a/arch/ppc/boot/simple/misc-spruce.c
+++ b/arch/ppc/boot/simple/misc-spruce.c
@@ -1,6 +1,4 @@
1/* 1/*
2 * arch/ppc/boot/spruce/misc.c
3 *
4 * Misc. bootloader code for IBM Spruce reference platform 2 * Misc. bootloader code for IBM Spruce reference platform
5 * 3 *
6 * Authors: Johnnie Peters <jpeters@mvista.com> 4 * Authors: Johnnie Peters <jpeters@mvista.com>
diff --git a/arch/ppc/boot/simple/misc.c b/arch/ppc/boot/simple/misc.c
index f415d6c62362..3d78571ad945 100644
--- a/arch/ppc/boot/simple/misc.c
+++ b/arch/ppc/boot/simple/misc.c
@@ -1,6 +1,4 @@
1/* 1/*
2 * arch/ppc/simple/misc.c
3 *
4 * Misc. bootloader code for many machines. This assumes you have are using 2 * Misc. bootloader code for many machines. This assumes you have are using
5 * a 6xx/7xx/74xx CPU in your machine. This assumes the chunk of memory 3 * a 6xx/7xx/74xx CPU in your machine. This assumes the chunk of memory
6 * below 8MB is free. Finally, it assumes you have a NS16550-style uart for 4 * below 8MB is free. Finally, it assumes you have a NS16550-style uart for
diff --git a/arch/ppc/boot/simple/mpc10x_memory.c b/arch/ppc/boot/simple/mpc10x_memory.c
index 20d92a34ceb8..8da8f576031d 100644
--- a/arch/ppc/boot/simple/mpc10x_memory.c
+++ b/arch/ppc/boot/simple/mpc10x_memory.c
@@ -1,6 +1,4 @@
1/* 1/*
2 * arch/ppc/boot/common/mpc10x_common.c
3 *
4 * A routine to find out how much memory the machine has. 2 * A routine to find out how much memory the machine has.
5 * 3 *
6 * Based on: 4 * Based on:
@@ -52,10 +50,10 @@ MPC10X_PCI_OP(read, dword, u32 *, in_le32, 0)
52 * the system. This assumes that the firmware has correctly set up the memory 50 * the system. This assumes that the firmware has correctly set up the memory
53 * controller registers. On CONFIG_PPC_PREP, we know we are being called 51 * controller registers. On CONFIG_PPC_PREP, we know we are being called
54 * under a PReP memory map. On all other machines, we assume we are under 52 * under a PReP memory map. On all other machines, we assume we are under
55 * a CHRP memory map. Further, on CONFIG_PPC_MULTIPLATFORM we must rename 53 * a CHRP memory map. Further, on CONFIG_PPC_PREP we must rename
56 * this function. 54 * this function.
57 */ 55 */
58#ifdef CONFIG_PPC_MULTIPLATFORM 56#ifdef CONFIG_PPC_PREP
59#define get_mem_size mpc10x_get_mem_size 57#define get_mem_size mpc10x_get_mem_size
60#endif 58#endif
61unsigned long 59unsigned long
diff --git a/arch/ppc/boot/simple/mpc52xx_tty.c b/arch/ppc/boot/simple/mpc52xx_tty.c
index 3acc6b7c0727..1964493cf3bd 100644
--- a/arch/ppc/boot/simple/mpc52xx_tty.c
+++ b/arch/ppc/boot/simple/mpc52xx_tty.c
@@ -1,6 +1,4 @@
1/* 1/*
2 * arch/ppc/boot/simple/mpc52xx_tty.c
3 *
4 * Minimal serial functions needed to send messages out a MPC52xx 2 * Minimal serial functions needed to send messages out a MPC52xx
5 * Programmable Serial Controller (PSC). 3 * Programmable Serial Controller (PSC).
6 * 4 *
diff --git a/arch/ppc/boot/simple/mv64x60_tty.c b/arch/ppc/boot/simple/mv64x60_tty.c
index b9c24d4c738b..0c52f5c784a2 100644
--- a/arch/ppc/boot/simple/mv64x60_tty.c
+++ b/arch/ppc/boot/simple/mv64x60_tty.c
@@ -1,6 +1,4 @@
1/* 1/*
2 * arch/ppc/boot/simple/mv64x60_tty.c
3 *
4 * Bootloader version of the embedded MPSC/UART driver for the Marvell 64x60. 2 * Bootloader version of the embedded MPSC/UART driver for the Marvell 64x60.
5 * Note: Due to a GT64260A erratum, DMA will be used for UART input (via SDMA). 3 * Note: Due to a GT64260A erratum, DMA will be used for UART input (via SDMA).
6 * 4 *
diff --git a/arch/ppc/boot/simple/openbios.c b/arch/ppc/boot/simple/openbios.c
index 81f11d8b30a7..3f2ed53f793a 100644
--- a/arch/ppc/boot/simple/openbios.c
+++ b/arch/ppc/boot/simple/openbios.c
@@ -1,6 +1,4 @@
1/* 1/*
2 * arch/ppc/boot/simple/openbios.c
3 *
4 * Copyright (c) 2005 DENX Software Engineering 2 * Copyright (c) 2005 DENX Software Engineering
5 * Stefan Roese <sr@denx.de> 3 * Stefan Roese <sr@denx.de>
6 * 4 *
diff --git a/arch/ppc/boot/simple/relocate.S b/arch/ppc/boot/simple/relocate.S
index 555a216ccc49..2533113c1cc5 100644
--- a/arch/ppc/boot/simple/relocate.S
+++ b/arch/ppc/boot/simple/relocate.S
@@ -1,6 +1,4 @@
1/* 1/*
2 * arch/ppc/boot/simple/relocate.S
3 *
4 * This is the common part of the loader relocation and initialization 2 * This is the common part of the loader relocation and initialization
5 * process. All of the board/processor specific initialization is 3 * process. All of the board/processor specific initialization is
6 * done before we get here. 4 * done before we get here.
@@ -196,7 +194,7 @@ start_ldr:
196 /* 194 /*
197 * Start at the begining. 195 * Start at the begining.
198 */ 196 */
199#ifdef CONFIG_PPC_MULTIPLATFORM 197#ifdef CONFIG_PPC_PREP
200 li r9,0xc 198 li r9,0xc
201 mtlr r9 199 mtlr r9
202 /* tell kernel we're prep, by putting 0xdeadc0de at KERNELLOAD, 200 /* tell kernel we're prep, by putting 0xdeadc0de at KERNELLOAD,
diff --git a/arch/ppc/boot/utils/addnote.c b/arch/ppc/boot/utils/addnote.c
deleted file mode 100644
index 6c52b18f2d04..000000000000
--- a/arch/ppc/boot/utils/addnote.c
+++ /dev/null
@@ -1,175 +0,0 @@
1/*
2 * Program to hack in a PT_NOTE program header entry in an ELF file.
3 * This is needed for OF on RS/6000s to load an image correctly.
4 * Note that OF needs a program header entry for the note, not an
5 * ELF section.
6 *
7 * Copyright 2000 Paul Mackerras.
8 *
9 * This program is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU General Public License
11 * as published by the Free Software Foundation; either version
12 * 2 of the License, or (at your option) any later version.
13 *
14 * Usage: addnote zImage
15 */
16#include <stdio.h>
17#include <stdlib.h>
18#include <fcntl.h>
19#include <unistd.h>
20#include <string.h>
21
22char arch[] = "PowerPC";
23
24#define N_DESCR 6
25unsigned int descr[N_DESCR] = {
26#if 1
27 /* values for IBM RS/6000 machines */
28 0xffffffff, /* real-mode = true */
29 0x00c00000, /* real-base, i.e. where we expect OF to be */
30 0xffffffff, /* real-size */
31 0xffffffff, /* virt-base */
32 0xffffffff, /* virt-size */
33 0x4000, /* load-base */
34#else
35 /* values for longtrail CHRP */
36 0, /* real-mode = false */
37 0xffffffff, /* real-base */
38 0xffffffff, /* real-size */
39 0xffffffff, /* virt-base */
40 0xffffffff, /* virt-size */
41 0x00600000, /* load-base */
42#endif
43};
44
45unsigned char buf[512];
46
47#define GET_16BE(off) ((buf[off] << 8) + (buf[(off)+1]))
48#define GET_32BE(off) ((GET_16BE(off) << 16) + GET_16BE((off)+2))
49
50#define PUT_16BE(off, v) (buf[off] = ((v) >> 8) & 0xff, \
51 buf[(off) + 1] = (v) & 0xff)
52#define PUT_32BE(off, v) (PUT_16BE((off), (v) >> 16), \
53 PUT_16BE((off) + 2, (v)))
54
55/* Structure of an ELF file */
56#define E_IDENT 0 /* ELF header */
57#define E_PHOFF 28
58#define E_PHENTSIZE 42
59#define E_PHNUM 44
60#define E_HSIZE 52 /* size of ELF header */
61
62#define EI_MAGIC 0 /* offsets in E_IDENT area */
63#define EI_CLASS 4
64#define EI_DATA 5
65
66#define PH_TYPE 0 /* ELF program header */
67#define PH_OFFSET 4
68#define PH_FILESZ 16
69#define PH_HSIZE 32 /* size of program header */
70
71#define PT_NOTE 4 /* Program header type = note */
72
73#define ELFCLASS32 1
74#define ELFDATA2MSB 2
75
76unsigned char elf_magic[4] = { 0x7f, 'E', 'L', 'F' };
77
78int main(int ac, char **av)
79{
80 int fd, n, i;
81 int ph, ps, np;
82 int nnote, ns;
83
84 if (ac != 2) {
85 fprintf(stderr, "Usage: %s elf-file\n", av[0]);
86 exit(1);
87 }
88 fd = open(av[1], O_RDWR);
89 if (fd < 0) {
90 perror(av[1]);
91 exit(1);
92 }
93
94 nnote = strlen(arch) + 1 + (N_DESCR + 3) * 4;
95
96 n = read(fd, buf, sizeof(buf));
97 if (n < 0) {
98 perror("read");
99 exit(1);
100 }
101
102 if (n < E_HSIZE || memcmp(&buf[E_IDENT+EI_MAGIC], elf_magic, 4) != 0)
103 goto notelf;
104
105 if (buf[E_IDENT+EI_CLASS] != ELFCLASS32
106 || buf[E_IDENT+EI_DATA] != ELFDATA2MSB) {
107 fprintf(stderr, "%s is not a big-endian 32-bit ELF image\n",
108 av[1]);
109 exit(1);
110 }
111
112 ph = GET_32BE(E_PHOFF);
113 ps = GET_16BE(E_PHENTSIZE);
114 np = GET_16BE(E_PHNUM);
115 if (ph < E_HSIZE || ps < PH_HSIZE || np < 1)
116 goto notelf;
117 if (ph + (np + 1) * ps + nnote > n)
118 goto nospace;
119
120 for (i = 0; i < np; ++i) {
121 if (GET_32BE(ph + PH_TYPE) == PT_NOTE) {
122 fprintf(stderr, "%s already has a note entry\n",
123 av[1]);
124 exit(0);
125 }
126 ph += ps;
127 }
128
129 /* XXX check that the area we want to use is all zeroes */
130 for (i = 0; i < ps + nnote; ++i)
131 if (buf[ph + i] != 0)
132 goto nospace;
133
134 /* fill in the program header entry */
135 ns = ph + ps;
136 PUT_32BE(ph + PH_TYPE, PT_NOTE);
137 PUT_32BE(ph + PH_OFFSET, ns);
138 PUT_32BE(ph + PH_FILESZ, nnote);
139
140 /* fill in the note area we point to */
141 /* XXX we should probably make this a proper section */
142 PUT_32BE(ns, strlen(arch) + 1);
143 PUT_32BE(ns + 4, N_DESCR * 4);
144 PUT_32BE(ns + 8, 0x1275);
145 strcpy(&buf[ns + 12], arch);
146 ns += 12 + strlen(arch) + 1;
147 for (i = 0; i < N_DESCR; ++i)
148 PUT_32BE(ns + i * 4, descr[i]);
149
150 /* Update the number of program headers */
151 PUT_16BE(E_PHNUM, np + 1);
152
153 /* write back */
154 lseek(fd, (long) 0, SEEK_SET);
155 i = write(fd, buf, n);
156 if (i < 0) {
157 perror("write");
158 exit(1);
159 }
160 if (i < n) {
161 fprintf(stderr, "%s: write truncated\n", av[1]);
162 exit(1);
163 }
164
165 exit(0);
166
167 notelf:
168 fprintf(stderr, "%s does not appear to be an ELF file\n", av[0]);
169 exit(1);
170
171 nospace:
172 fprintf(stderr, "sorry, I can't find space in %s to put the note\n",
173 av[0]);
174 exit(1);
175}
diff --git a/arch/ppc/boot/utils/hack-coff.c b/arch/ppc/boot/utils/hack-coff.c
deleted file mode 100644
index 5e5a6573a1ef..000000000000
--- a/arch/ppc/boot/utils/hack-coff.c
+++ /dev/null
@@ -1,84 +0,0 @@
1/*
2 * hack-coff.c - hack the header of an xcoff file to fill in
3 * a few fields needed by the Open Firmware xcoff loader on
4 * Power Macs but not initialized by objcopy.
5 *
6 * Copyright (C) Paul Mackerras 1997.
7 *
8 * This program is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU General Public License
10 * as published by the Free Software Foundation; either version
11 * 2 of the License, or (at your option) any later version.
12 */
13#include <stdio.h>
14#include <stdlib.h>
15#include <unistd.h>
16#include <fcntl.h>
17#include <string.h>
18#include "rs6000.h"
19
20#define AOUT_MAGIC 0x010b
21
22#define get_16be(x) ((((unsigned char *)(x))[0] << 8) \
23 + ((unsigned char *)(x))[1])
24#define put_16be(x, v) (((unsigned char *)(x))[0] = (v) >> 8, \
25 ((unsigned char *)(x))[1] = (v) & 0xff)
26#define get_32be(x) ((((unsigned char *)(x))[0] << 24) \
27 + (((unsigned char *)(x))[1] << 16) \
28 + (((unsigned char *)(x))[2] << 8) \
29 + ((unsigned char *)(x))[3])
30
31int
32main(int ac, char **av)
33{
34 int fd;
35 int i, nsect;
36 int aoutsz;
37 struct external_filehdr fhdr;
38 AOUTHDR aout;
39 struct external_scnhdr shdr;
40
41 if (ac != 2) {
42 fprintf(stderr, "Usage: hack-coff coff-file\n");
43 exit(1);
44 }
45 if ((fd = open(av[1], 2)) == -1) {
46 perror(av[2]);
47 exit(1);
48 }
49 if (read(fd, &fhdr, sizeof(fhdr)) != sizeof(fhdr))
50 goto readerr;
51 i = get_16be(fhdr.f_magic);
52 if (i != U802TOCMAGIC && i != U802WRMAGIC && i != U802ROMAGIC) {
53 fprintf(stderr, "%s: not an xcoff file\n", av[1]);
54 exit(1);
55 }
56 aoutsz = get_16be(fhdr.f_opthdr);
57 if (read(fd, &aout, aoutsz) != aoutsz)
58 goto readerr;
59 nsect = get_16be(fhdr.f_nscns);
60 for (i = 0; i < nsect; ++i) {
61 if (read(fd, &shdr, sizeof(shdr)) != sizeof(shdr))
62 goto readerr;
63 if (strcmp(shdr.s_name, ".text") == 0) {
64 put_16be(aout.o_snentry, i+1);
65 put_16be(aout.o_sntext, i+1);
66 } else if (strcmp(shdr.s_name, ".data") == 0) {
67 put_16be(aout.o_sndata, i+1);
68 } else if (strcmp(shdr.s_name, ".bss") == 0) {
69 put_16be(aout.o_snbss, i+1);
70 }
71 }
72 put_16be(aout.magic, AOUT_MAGIC);
73 if (lseek(fd, (long) sizeof(struct external_filehdr), 0) == -1
74 || write(fd, &aout, aoutsz) != aoutsz) {
75 fprintf(stderr, "%s: write error\n", av[1]);
76 exit(1);
77 }
78 close(fd);
79 exit(0);
80
81readerr:
82 fprintf(stderr, "%s: read error or file too short\n", av[1]);
83 exit(1);
84}
diff --git a/arch/ppc/boot/utils/mkbugboot.c b/arch/ppc/boot/utils/mkbugboot.c
index 886122283f39..29115e01f60a 100644
--- a/arch/ppc/boot/utils/mkbugboot.c
+++ b/arch/ppc/boot/utils/mkbugboot.c
@@ -1,6 +1,4 @@
1/* 1/*
2 * arch/ppc/boot/utils/mkbugboot.c
3 *
4 * Makes a Motorola PPCBUG ROM bootable image which can be flashed 2 * Makes a Motorola PPCBUG ROM bootable image which can be flashed
5 * into one of the FLASH banks on a Motorola PowerPlus board. 3 * into one of the FLASH banks on a Motorola PowerPlus board.
6 * 4 *
diff --git a/arch/ppc/boot/utils/mknote.c b/arch/ppc/boot/utils/mknote.c
deleted file mode 100644
index b9fbb2cbfc8f..000000000000
--- a/arch/ppc/boot/utils/mknote.c
+++ /dev/null
@@ -1,44 +0,0 @@
1/*
2 * Copyright (C) Cort Dougan 1999.
3 *
4 * This program is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU General Public License
6 * as published by the Free Software Foundation; either version
7 * 2 of the License, or (at your option) any later version.
8 *
9 * Generate a note section as per the CHRP specification.
10 *
11 */
12
13#include <stdio.h>
14#include <string.h>
15
16#define PL(x) printf("%c%c%c%c", ((x)>>24)&0xff, ((x)>>16)&0xff, ((x)>>8)&0xff, (x)&0xff );
17
18int main(void)
19{
20/* header */
21 /* namesz */
22 PL(strlen("PowerPC")+1);
23 /* descrsz */
24 PL(6*4);
25 /* type */
26 PL(0x1275);
27 /* name */
28 printf("PowerPC"); printf("%c", 0);
29
30/* descriptor */
31 /* real-mode */
32 PL(0xffffffff);
33 /* real-base */
34 PL(0x00c00000);
35 /* real-size */
36 PL(0xffffffff);
37 /* virt-base */
38 PL(0xffffffff);
39 /* virt-size */
40 PL(0xffffffff);
41 /* load-base */
42 PL(0x4000);
43 return 0;
44}
diff --git a/arch/ppc/configs/ibmchrp_defconfig b/arch/ppc/configs/ibmchrp_defconfig
deleted file mode 100644
index 27f3e69c1f96..000000000000
--- a/arch/ppc/configs/ibmchrp_defconfig
+++ /dev/null
@@ -1,875 +0,0 @@
1#
2# Automatically generated make config: don't edit
3#
4CONFIG_MMU=y
5CONFIG_RWSEM_XCHGADD_ALGORITHM=y
6CONFIG_HAVE_DEC_LOCK=y
7CONFIG_PPC=y
8CONFIG_PPC32=y
9CONFIG_GENERIC_NVRAM=y
10
11#
12# Code maturity level options
13#
14CONFIG_EXPERIMENTAL=y
15CONFIG_CLEAN_COMPILE=y
16# CONFIG_STANDALONE is not set
17CONFIG_BROKEN_ON_SMP=y
18
19#
20# General setup
21#
22CONFIG_SWAP=y
23CONFIG_SYSVIPC=y
24CONFIG_POSIX_MQUEUE=y
25# CONFIG_BSD_PROCESS_ACCT is not set
26CONFIG_SYSCTL=y
27# CONFIG_AUDIT is not set
28CONFIG_LOG_BUF_SHIFT=14
29# CONFIG_HOTPLUG is not set
30CONFIG_IKCONFIG=y
31CONFIG_IKCONFIG_PROC=y
32# CONFIG_EMBEDDED is not set
33CONFIG_KALLSYMS=y
34CONFIG_FUTEX=y
35CONFIG_EPOLL=y
36CONFIG_IOSCHED_NOOP=y
37CONFIG_IOSCHED_AS=y
38CONFIG_IOSCHED_DEADLINE=y
39CONFIG_IOSCHED_CFQ=y
40# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
41
42#
43# Loadable module support
44#
45CONFIG_MODULES=y
46CONFIG_MODULE_UNLOAD=y
47CONFIG_MODULE_FORCE_UNLOAD=y
48CONFIG_OBSOLETE_MODPARM=y
49# CONFIG_MODVERSIONS is not set
50CONFIG_KMOD=y
51
52#
53# Processor
54#
55CONFIG_6xx=y
56# CONFIG_40x is not set
57# CONFIG_44x is not set
58# CONFIG_POWER3 is not set
59# CONFIG_POWER4 is not set
60# CONFIG_8xx is not set
61# CONFIG_ALTIVEC is not set
62# CONFIG_TAU is not set
63# CONFIG_CPU_FREQ is not set
64# CONFIG_PPC601_SYNC_FIX is not set
65CONFIG_PPC_STD_MMU=y
66
67#
68# Platform options
69#
70CONFIG_PPC_MULTIPLATFORM=y
71# CONFIG_APUS is not set
72# CONFIG_WILLOW is not set
73# CONFIG_PCORE is not set
74# CONFIG_POWERPMC250 is not set
75# CONFIG_EV64260 is not set
76# CONFIG_SPRUCE is not set
77# CONFIG_LOPEC is not set
78# CONFIG_MCPN765 is not set
79# CONFIG_MVME5100 is not set
80# CONFIG_PPLUS is not set
81# CONFIG_PRPMC750 is not set
82# CONFIG_PRPMC800 is not set
83# CONFIG_SANDPOINT is not set
84# CONFIG_ADIR is not set
85# CONFIG_K2 is not set
86# CONFIG_PAL4 is not set
87# CONFIG_GEMINI is not set
88# CONFIG_EST8260 is not set
89# CONFIG_SBS8260 is not set
90# CONFIG_RPX6 is not set
91# CONFIG_TQM8260 is not set
92CONFIG_PPC_CHRP=y
93CONFIG_PPC_PMAC=y
94CONFIG_PPC_PREP=y
95CONFIG_PPC_OF=y
96CONFIG_PPCBUG_NVRAM=y
97# CONFIG_SMP is not set
98# CONFIG_PREEMPT is not set
99CONFIG_HIGHMEM=y
100CONFIG_KERNEL_ELF=y
101CONFIG_BINFMT_ELF=y
102CONFIG_BINFMT_MISC=y
103CONFIG_PROC_DEVICETREE=y
104CONFIG_PPC_RTAS=y
105# CONFIG_PREP_RESIDUAL is not set
106# CONFIG_CMDLINE_BOOL is not set
107
108#
109# Bus options
110#
111CONFIG_ISA=y
112CONFIG_GENERIC_ISA_DMA=y
113CONFIG_PCI=y
114CONFIG_PCI_DOMAINS=y
115CONFIG_PCI_LEGACY_PROC=y
116CONFIG_PCI_NAMES=y
117
118#
119# Advanced setup
120#
121# CONFIG_ADVANCED_OPTIONS is not set
122
123#
124# Default settings for advanced configuration options are used
125#
126CONFIG_HIGHMEM_START=0xfe000000
127CONFIG_LOWMEM_SIZE=0x30000000
128CONFIG_KERNEL_START=0xc0000000
129CONFIG_TASK_SIZE=0x80000000
130CONFIG_BOOT_LOAD=0x00800000
131
132#
133# Device Drivers
134#
135
136#
137# Generic Driver Options
138#
139
140#
141# Memory Technology Devices (MTD)
142#
143# CONFIG_MTD is not set
144
145#
146# Parallel port support
147#
148# CONFIG_PARPORT is not set
149
150#
151# Plug and Play support
152#
153# CONFIG_PNP is not set
154
155#
156# Block devices
157#
158CONFIG_BLK_DEV_FD=y
159# CONFIG_BLK_DEV_XD is not set
160# CONFIG_BLK_CPQ_DA is not set
161# CONFIG_BLK_CPQ_CISS_DA is not set
162# CONFIG_BLK_DEV_DAC960 is not set
163# CONFIG_BLK_DEV_UMEM is not set
164CONFIG_BLK_DEV_LOOP=y
165# CONFIG_BLK_DEV_CRYPTOLOOP is not set
166# CONFIG_BLK_DEV_NBD is not set
167# CONFIG_BLK_DEV_CARMEL is not set
168CONFIG_BLK_DEV_RAM=y
169CONFIG_BLK_DEV_RAM_SIZE=4096
170CONFIG_BLK_DEV_INITRD=y
171CONFIG_LBD=y
172
173#
174# ATA/ATAPI/MFM/RLL support
175#
176# CONFIG_IDE is not set
177
178#
179# SCSI device support
180#
181CONFIG_SCSI=y
182CONFIG_SCSI_PROC_FS=y
183
184#
185# SCSI support type (disk, tape, CD-ROM)
186#
187CONFIG_BLK_DEV_SD=y
188CONFIG_CHR_DEV_ST=y
189# CONFIG_CHR_DEV_OSST is not set
190CONFIG_BLK_DEV_SR=y
191CONFIG_BLK_DEV_SR_VENDOR=y
192CONFIG_CHR_DEV_SG=y
193
194#
195# Some SCSI devices (e.g. CD jukebox) support multiple LUNs
196#
197# CONFIG_SCSI_MULTI_LUN is not set
198# CONFIG_SCSI_REPORT_LUNS is not set
199CONFIG_SCSI_CONSTANTS=y
200# CONFIG_SCSI_LOGGING is not set
201
202#
203# SCSI Transport Attributes
204#
205CONFIG_SCSI_SPI_ATTRS=y
206# CONFIG_SCSI_FC_ATTRS is not set
207
208#
209# SCSI low-level drivers
210#
211# CONFIG_BLK_DEV_3W_XXXX_RAID is not set
212# CONFIG_SCSI_7000FASST is not set
213# CONFIG_SCSI_ACARD is not set
214# CONFIG_SCSI_AHA152X is not set
215# CONFIG_SCSI_AHA1542 is not set
216# CONFIG_SCSI_AACRAID is not set
217# CONFIG_SCSI_AIC7XXX is not set
218# CONFIG_SCSI_AIC7XXX_OLD is not set
219# CONFIG_SCSI_AIC79XX is not set
220# CONFIG_SCSI_ADVANSYS is not set
221# CONFIG_SCSI_IN2000 is not set
222# CONFIG_SCSI_MEGARAID is not set
223# CONFIG_SCSI_SATA is not set
224# CONFIG_SCSI_BUSLOGIC is not set
225# CONFIG_SCSI_CPQFCTS is not set
226# CONFIG_SCSI_DMX3191D is not set
227# CONFIG_SCSI_DTC3280 is not set
228# CONFIG_SCSI_EATA is not set
229# CONFIG_SCSI_EATA_PIO is not set
230# CONFIG_SCSI_FUTURE_DOMAIN is not set
231# CONFIG_SCSI_GDTH is not set
232# CONFIG_SCSI_GENERIC_NCR5380 is not set
233# CONFIG_SCSI_GENERIC_NCR5380_MMIO is not set
234# CONFIG_SCSI_IPS is not set
235# CONFIG_SCSI_INIA100 is not set
236# CONFIG_SCSI_NCR53C406A is not set
237CONFIG_SCSI_SYM53C8XX_2=y
238CONFIG_SCSI_SYM53C8XX_DMA_ADDRESSING_MODE=0
239CONFIG_SCSI_SYM53C8XX_DEFAULT_TAGS=16
240CONFIG_SCSI_SYM53C8XX_MAX_TAGS=64
241# CONFIG_SCSI_SYM53C8XX_IOMAPPED is not set
242# CONFIG_SCSI_IPR is not set
243# CONFIG_SCSI_PAS16 is not set
244# CONFIG_SCSI_PSI240I is not set
245# CONFIG_SCSI_QLOGIC_FAS is not set
246# CONFIG_SCSI_QLOGIC_ISP is not set
247# CONFIG_SCSI_QLOGIC_FC is not set
248# CONFIG_SCSI_QLOGIC_1280 is not set
249CONFIG_SCSI_QLA2XXX=y
250# CONFIG_SCSI_QLA21XX is not set
251# CONFIG_SCSI_QLA22XX is not set
252# CONFIG_SCSI_QLA2300 is not set
253# CONFIG_SCSI_QLA2322 is not set
254# CONFIG_SCSI_QLA6312 is not set
255# CONFIG_SCSI_QLA6322 is not set
256# CONFIG_SCSI_SYM53C416 is not set
257# CONFIG_SCSI_DC395x is not set
258# CONFIG_SCSI_DC390T is not set
259# CONFIG_SCSI_T128 is not set
260# CONFIG_SCSI_U14_34F is not set
261# CONFIG_SCSI_NSP32 is not set
262# CONFIG_SCSI_DEBUG is not set
263# CONFIG_SCSI_MESH is not set
264# CONFIG_SCSI_MAC53C94 is not set
265
266#
267# Old CD-ROM drivers (not SCSI, not IDE)
268#
269# CONFIG_CD_NO_IDESCSI is not set
270
271#
272# Multi-device support (RAID and LVM)
273#
274# CONFIG_MD is not set
275
276#
277# Fusion MPT device support
278#
279# CONFIG_FUSION is not set
280
281#
282# IEEE 1394 (FireWire) support
283#
284# CONFIG_IEEE1394 is not set
285
286#
287# I2O device support
288#
289# CONFIG_I2O is not set
290
291#
292# Macintosh device drivers
293#
294# CONFIG_ADB is not set
295# CONFIG_ADB_CUDA is not set
296# CONFIG_ADB_PMU is not set
297# CONFIG_MAC_FLOPPY is not set
298# CONFIG_MAC_SERIAL is not set
299
300#
301# Networking support
302#
303CONFIG_NET=y
304
305#
306# Networking options
307#
308CONFIG_PACKET=y
309# CONFIG_PACKET_MMAP is not set
310# CONFIG_NETLINK_DEV is not set
311CONFIG_UNIX=y
312# CONFIG_NET_KEY is not set
313CONFIG_INET=y
314CONFIG_IP_MULTICAST=y
315# CONFIG_IP_ADVANCED_ROUTER is not set
316# CONFIG_IP_PNP is not set
317# CONFIG_NET_IPIP is not set
318# CONFIG_NET_IPGRE is not set
319# CONFIG_IP_MROUTE is not set
320# CONFIG_ARPD is not set
321CONFIG_SYN_COOKIES=y
322# CONFIG_INET_AH is not set
323# CONFIG_INET_ESP is not set
324# CONFIG_INET_IPCOMP is not set
325
326#
327# IP: Virtual Server Configuration
328#
329# CONFIG_IP_VS is not set
330# CONFIG_IPV6 is not set
331CONFIG_NETFILTER=y
332# CONFIG_NETFILTER_DEBUG is not set
333
334#
335# IP: Netfilter Configuration
336#
337CONFIG_IP_NF_CONNTRACK=m
338CONFIG_IP_NF_FTP=m
339CONFIG_IP_NF_IRC=m
340CONFIG_IP_NF_TFTP=m
341CONFIG_IP_NF_AMANDA=m
342# CONFIG_IP_NF_QUEUE is not set
343CONFIG_IP_NF_IPTABLES=m
344CONFIG_IP_NF_MATCH_LIMIT=m
345CONFIG_IP_NF_MATCH_IPRANGE=m
346CONFIG_IP_NF_MATCH_MAC=m
347# CONFIG_IP_NF_MATCH_PKTTYPE is not set
348CONFIG_IP_NF_MATCH_MARK=m
349CONFIG_IP_NF_MATCH_MULTIPORT=m
350CONFIG_IP_NF_MATCH_TOS=m
351CONFIG_IP_NF_MATCH_RECENT=m
352CONFIG_IP_NF_MATCH_ECN=m
353CONFIG_IP_NF_MATCH_DSCP=m
354CONFIG_IP_NF_MATCH_AH_ESP=m
355CONFIG_IP_NF_MATCH_LENGTH=m
356CONFIG_IP_NF_MATCH_TTL=m
357CONFIG_IP_NF_MATCH_TCPMSS=m
358CONFIG_IP_NF_MATCH_HELPER=m
359CONFIG_IP_NF_MATCH_STATE=m
360CONFIG_IP_NF_MATCH_CONNTRACK=m
361CONFIG_IP_NF_MATCH_OWNER=m
362CONFIG_IP_NF_FILTER=m
363CONFIG_IP_NF_TARGET_REJECT=m
364CONFIG_IP_NF_NAT=m
365CONFIG_IP_NF_NAT_NEEDED=y
366CONFIG_IP_NF_TARGET_MASQUERADE=m
367CONFIG_IP_NF_TARGET_REDIRECT=m
368CONFIG_IP_NF_TARGET_NETMAP=m
369CONFIG_IP_NF_TARGET_SAME=m
370CONFIG_IP_NF_NAT_SNMP_BASIC=m
371CONFIG_IP_NF_NAT_IRC=m
372CONFIG_IP_NF_NAT_FTP=m
373CONFIG_IP_NF_NAT_TFTP=m
374CONFIG_IP_NF_NAT_AMANDA=m
375# CONFIG_IP_NF_MANGLE is not set
376# CONFIG_IP_NF_TARGET_LOG is not set
377CONFIG_IP_NF_TARGET_ULOG=m
378CONFIG_IP_NF_TARGET_TCPMSS=m
379CONFIG_IP_NF_ARPTABLES=m
380CONFIG_IP_NF_ARPFILTER=m
381CONFIG_IP_NF_ARP_MANGLE=m
382CONFIG_IP_NF_COMPAT_IPCHAINS=m
383# CONFIG_IP_NF_COMPAT_IPFWADM is not set
384CONFIG_IP_NF_TARGET_NOTRACK=m
385CONFIG_IP_NF_RAW=m
386
387#
388# SCTP Configuration (EXPERIMENTAL)
389#
390# CONFIG_IP_SCTP is not set
391# CONFIG_ATM is not set
392# CONFIG_BRIDGE is not set
393# CONFIG_VLAN_8021Q is not set
394# CONFIG_DECNET is not set
395# CONFIG_LLC2 is not set
396# CONFIG_IPX is not set
397# CONFIG_ATALK is not set
398# CONFIG_X25 is not set
399# CONFIG_LAPB is not set
400# CONFIG_NET_DIVERT is not set
401# CONFIG_ECONET is not set
402# CONFIG_WAN_ROUTER is not set
403# CONFIG_NET_HW_FLOWCONTROL is not set
404
405#
406# QoS and/or fair queueing
407#
408# CONFIG_NET_SCHED is not set
409
410#
411# Network testing
412#
413# CONFIG_NET_PKTGEN is not set
414# CONFIG_NETPOLL is not set
415# CONFIG_NET_POLL_CONTROLLER is not set
416# CONFIG_HAMRADIO is not set
417# CONFIG_IRDA is not set
418# CONFIG_BT is not set
419CONFIG_NETDEVICES=y
420# CONFIG_DUMMY is not set
421# CONFIG_BONDING is not set
422# CONFIG_EQUALIZER is not set
423# CONFIG_TUN is not set
424
425#
426# ARCnet devices
427#
428# CONFIG_ARCNET is not set
429
430#
431# Ethernet (10 or 100Mbit)
432#
433CONFIG_NET_ETHERNET=y
434CONFIG_MII=y
435# CONFIG_MACE is not set
436# CONFIG_BMAC is not set
437# CONFIG_OAKNET is not set
438# CONFIG_HAPPYMEAL is not set
439# CONFIG_SUNGEM is not set
440# CONFIG_NET_VENDOR_3COM is not set
441# CONFIG_LANCE is not set
442# CONFIG_NET_VENDOR_SMC is not set
443# CONFIG_NET_VENDOR_RACAL is not set
444
445#
446# Tulip family network device support
447#
448# CONFIG_NET_TULIP is not set
449# CONFIG_AT1700 is not set
450# CONFIG_DEPCA is not set
451# CONFIG_HP100 is not set
452# CONFIG_NET_ISA is not set
453CONFIG_NET_PCI=y
454CONFIG_PCNET32=y
455# CONFIG_AMD8111_ETH is not set
456# CONFIG_ADAPTEC_STARFIRE is not set
457# CONFIG_AC3200 is not set
458# CONFIG_APRICOT is not set
459# CONFIG_B44 is not set
460# CONFIG_FORCEDETH is not set
461# CONFIG_CS89x0 is not set
462# CONFIG_DGRS is not set
463# CONFIG_EEPRO100 is not set
464# CONFIG_E100 is not set
465# CONFIG_FEALNX is not set
466# CONFIG_NATSEMI is not set
467# CONFIG_NE2K_PCI is not set
468# CONFIG_8139CP is not set
469# CONFIG_8139TOO is not set
470# CONFIG_SIS900 is not set
471# CONFIG_EPIC100 is not set
472# CONFIG_SUNDANCE is not set
473# CONFIG_TLAN is not set
474# CONFIG_VIA_RHINE is not set
475# CONFIG_NET_POCKET is not set
476
477#
478# Ethernet (1000 Mbit)
479#
480# CONFIG_ACENIC is not set
481# CONFIG_DL2K is not set
482# CONFIG_E1000 is not set
483# CONFIG_NS83820 is not set
484# CONFIG_HAMACHI is not set
485# CONFIG_YELLOWFIN is not set
486# CONFIG_R8169 is not set
487# CONFIG_SK98LIN is not set
488# CONFIG_TIGON3 is not set
489
490#
491# Ethernet (10000 Mbit)
492#
493# CONFIG_IXGB is not set
494# CONFIG_S2IO is not set
495
496#
497# Token Ring devices
498#
499# CONFIG_TR is not set
500
501#
502# Wireless LAN (non-hamradio)
503#
504# CONFIG_NET_RADIO is not set
505
506#
507# Wan interfaces
508#
509# CONFIG_WAN is not set
510# CONFIG_FDDI is not set
511# CONFIG_HIPPI is not set
512# CONFIG_PPP is not set
513# CONFIG_SLIP is not set
514# CONFIG_NET_FC is not set
515# CONFIG_RCPCI is not set
516# CONFIG_SHAPER is not set
517# CONFIG_NETCONSOLE is not set
518
519#
520# ISDN subsystem
521#
522# CONFIG_ISDN is not set
523
524#
525# Telephony Support
526#
527# CONFIG_PHONE is not set
528
529#
530# Input device support
531#
532CONFIG_INPUT=y
533
534#
535# Userland interfaces
536#
537CONFIG_INPUT_MOUSEDEV=y
538CONFIG_INPUT_MOUSEDEV_PSAUX=y
539CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024
540CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768
541# CONFIG_INPUT_JOYDEV is not set
542# CONFIG_INPUT_TSDEV is not set
543CONFIG_INPUT_EVDEV=y
544# CONFIG_INPUT_EVBUG is not set
545
546#
547# Input I/O drivers
548#
549# CONFIG_GAMEPORT is not set
550CONFIG_SOUND_GAMEPORT=y
551CONFIG_SERIO=y
552CONFIG_SERIO_I8042=y
553CONFIG_SERIO_SERPORT=y
554# CONFIG_SERIO_CT82C710 is not set
555# CONFIG_SERIO_PCIPS2 is not set
556
557#
558# Input Device Drivers
559#
560CONFIG_INPUT_KEYBOARD=y
561CONFIG_KEYBOARD_ATKBD=y
562# CONFIG_KEYBOARD_SUNKBD is not set
563# CONFIG_KEYBOARD_LKKBD is not set
564# CONFIG_KEYBOARD_XTKBD is not set
565# CONFIG_KEYBOARD_NEWTON is not set
566CONFIG_INPUT_MOUSE=y
567CONFIG_MOUSE_PS2=y
568# CONFIG_MOUSE_SERIAL is not set
569# CONFIG_MOUSE_INPORT is not set
570# CONFIG_MOUSE_LOGIBM is not set
571# CONFIG_MOUSE_PC110PAD is not set
572# CONFIG_MOUSE_VSXXXAA is not set
573# CONFIG_INPUT_JOYSTICK is not set
574# CONFIG_INPUT_TOUCHSCREEN is not set
575CONFIG_INPUT_MISC=y
576CONFIG_INPUT_UINPUT=y
577
578#
579# Character devices
580#
581CONFIG_VT=y
582CONFIG_VT_CONSOLE=y
583CONFIG_HW_CONSOLE=y
584# CONFIG_SERIAL_NONSTANDARD is not set
585
586#
587# Serial drivers
588#
589CONFIG_SERIAL_8250=y
590# CONFIG_SERIAL_8250_CONSOLE is not set
591CONFIG_SERIAL_8250_NR_UARTS=4
592# CONFIG_SERIAL_8250_EXTENDED is not set
593
594#
595# Non-8250 serial port support
596#
597CONFIG_SERIAL_CORE=y
598# CONFIG_SERIAL_PMACZILOG is not set
599CONFIG_UNIX98_PTYS=y
600CONFIG_LEGACY_PTYS=y
601CONFIG_LEGACY_PTY_COUNT=256
602# CONFIG_QIC02_TAPE is not set
603
604#
605# IPMI
606#
607# CONFIG_IPMI_HANDLER is not set
608
609#
610# Watchdog Cards
611#
612# CONFIG_WATCHDOG is not set
613CONFIG_NVRAM=y
614CONFIG_GEN_RTC=y
615# CONFIG_GEN_RTC_X is not set
616# CONFIG_DTLK is not set
617# CONFIG_R3964 is not set
618# CONFIG_APPLICOM is not set
619
620#
621# Ftape, the floppy tape device driver
622#
623# CONFIG_FTAPE is not set
624# CONFIG_AGP is not set
625# CONFIG_DRM is not set
626# CONFIG_RAW_DRIVER is not set
627
628#
629# I2C support
630#
631# CONFIG_I2C is not set
632
633#
634# Misc devices
635#
636
637#
638# Multimedia devices
639#
640# CONFIG_VIDEO_DEV is not set
641
642#
643# Digital Video Broadcasting Devices
644#
645# CONFIG_DVB is not set
646
647#
648# Graphics support
649#
650CONFIG_FB=y
651# CONFIG_FB_PM2 is not set
652# CONFIG_FB_CYBER2000 is not set
653CONFIG_FB_OF=y
654# CONFIG_FB_CONTROL is not set
655# CONFIG_FB_PLATINUM is not set
656# CONFIG_FB_VALKYRIE is not set
657# CONFIG_FB_CT65550 is not set
658# CONFIG_FB_IMSTT is not set
659# CONFIG_FB_S3TRIO is not set
660# CONFIG_FB_VGA16 is not set
661# CONFIG_FB_RIVA is not set
662CONFIG_FB_MATROX=y
663CONFIG_FB_MATROX_MILLENIUM=y
664CONFIG_FB_MATROX_MYSTIQUE=y
665# CONFIG_FB_MATROX_G450 is not set
666CONFIG_FB_MATROX_G100A=y
667CONFIG_FB_MATROX_G100=y
668# CONFIG_FB_MATROX_MULTIHEAD is not set
669# CONFIG_FB_RADEON_OLD is not set
670# CONFIG_FB_RADEON is not set
671# CONFIG_FB_ATY128 is not set
672# CONFIG_FB_ATY is not set
673# CONFIG_FB_SIS is not set
674# CONFIG_FB_NEOMAGIC is not set
675# CONFIG_FB_KYRO is not set
676CONFIG_FB_3DFX=y
677# CONFIG_FB_VOODOO1 is not set
678# CONFIG_FB_TRIDENT is not set
679# CONFIG_FB_VIRTUAL is not set
680
681#
682# Console display driver support
683#
684CONFIG_VGA_CONSOLE=y
685# CONFIG_MDA_CONSOLE is not set
686CONFIG_DUMMY_CONSOLE=y
687CONFIG_FRAMEBUFFER_CONSOLE=y
688CONFIG_PCI_CONSOLE=y
689# CONFIG_FONTS is not set
690CONFIG_FONT_8x8=y
691CONFIG_FONT_8x16=y
692
693#
694# Logo configuration
695#
696CONFIG_LOGO=y
697CONFIG_LOGO_LINUX_MONO=y
698CONFIG_LOGO_LINUX_VGA16=y
699CONFIG_LOGO_LINUX_CLUT224=y
700
701#
702# Sound
703#
704# CONFIG_SOUND is not set
705
706#
707# USB support
708#
709# CONFIG_USB is not set
710
711#
712# USB Gadget Support
713#
714# CONFIG_USB_GADGET is not set
715
716#
717# File systems
718#
719CONFIG_EXT2_FS=y
720# CONFIG_EXT2_FS_XATTR is not set
721# CONFIG_EXT3_FS is not set
722# CONFIG_JBD is not set
723# CONFIG_REISERFS_FS is not set
724# CONFIG_JFS_FS is not set
725# CONFIG_XFS_FS is not set
726# CONFIG_MINIX_FS is not set
727# CONFIG_ROMFS_FS is not set
728# CONFIG_QUOTA is not set
729# CONFIG_AUTOFS_FS is not set
730# CONFIG_AUTOFS4_FS is not set
731
732#
733# CD-ROM/DVD Filesystems
734#
735CONFIG_ISO9660_FS=y
736# CONFIG_JOLIET is not set
737# CONFIG_ZISOFS is not set
738# CONFIG_UDF_FS is not set
739
740#
741# DOS/FAT/NT Filesystems
742#
743CONFIG_FAT_FS=m
744CONFIG_MSDOS_FS=m
745CONFIG_VFAT_FS=m
746# CONFIG_NTFS_FS is not set
747
748#
749# Pseudo filesystems
750#
751CONFIG_PROC_FS=y
752CONFIG_PROC_KCORE=y
753CONFIG_SYSFS=y
754CONFIG_DEVFS_FS=y
755# CONFIG_DEVFS_MOUNT is not set
756# CONFIG_DEVFS_DEBUG is not set
757# CONFIG_DEVPTS_FS_XATTR is not set
758CONFIG_TMPFS=y
759# CONFIG_HUGETLB_PAGE is not set
760CONFIG_RAMFS=y
761
762#
763# Miscellaneous filesystems
764#
765# CONFIG_ADFS_FS is not set
766# CONFIG_AFFS_FS is not set
767# CONFIG_HFS_FS is not set
768# CONFIG_HFSPLUS_FS is not set
769# CONFIG_BEFS_FS is not set
770# CONFIG_BFS_FS is not set
771# CONFIG_EFS_FS is not set
772# CONFIG_CRAMFS is not set
773# CONFIG_VXFS_FS is not set
774# CONFIG_HPFS_FS is not set
775# CONFIG_QNX4FS_FS is not set
776# CONFIG_SYSV_FS is not set
777# CONFIG_UFS_FS is not set
778
779#
780# Network File Systems
781#
782# CONFIG_NFS_FS is not set
783# CONFIG_NFSD is not set
784# CONFIG_EXPORTFS is not set
785# CONFIG_SMB_FS is not set
786# CONFIG_CIFS is not set
787# CONFIG_NCP_FS is not set
788# CONFIG_CODA_FS is not set
789# CONFIG_AFS_FS is not set
790
791#
792# Partition Types
793#
794CONFIG_PARTITION_ADVANCED=y
795# CONFIG_ACORN_PARTITION is not set
796# CONFIG_OSF_PARTITION is not set
797# CONFIG_AMIGA_PARTITION is not set
798# CONFIG_ATARI_PARTITION is not set
799CONFIG_MAC_PARTITION=y
800CONFIG_MSDOS_PARTITION=y
801# CONFIG_BSD_DISKLABEL is not set
802# CONFIG_MINIX_SUBPARTITION is not set
803# CONFIG_SOLARIS_X86_PARTITION is not set
804# CONFIG_UNIXWARE_DISKLABEL is not set
805# CONFIG_LDM_PARTITION is not set
806# CONFIG_NEC98_PARTITION is not set
807# CONFIG_SGI_PARTITION is not set
808# CONFIG_ULTRIX_PARTITION is not set
809# CONFIG_SUN_PARTITION is not set
810# CONFIG_EFI_PARTITION is not set
811
812#
813# Native Language Support
814#
815CONFIG_NLS=y
816CONFIG_NLS_DEFAULT="iso8859-1"
817# CONFIG_NLS_CODEPAGE_437 is not set
818# CONFIG_NLS_CODEPAGE_737 is not set
819# CONFIG_NLS_CODEPAGE_775 is not set
820# CONFIG_NLS_CODEPAGE_850 is not set
821# CONFIG_NLS_CODEPAGE_852 is not set
822# CONFIG_NLS_CODEPAGE_855 is not set
823# CONFIG_NLS_CODEPAGE_857 is not set
824# CONFIG_NLS_CODEPAGE_860 is not set
825# CONFIG_NLS_CODEPAGE_861 is not set
826# CONFIG_NLS_CODEPAGE_862 is not set
827# CONFIG_NLS_CODEPAGE_863 is not set
828# CONFIG_NLS_CODEPAGE_864 is not set
829# CONFIG_NLS_CODEPAGE_865 is not set
830# CONFIG_NLS_CODEPAGE_866 is not set
831# CONFIG_NLS_CODEPAGE_869 is not set
832# CONFIG_NLS_CODEPAGE_936 is not set
833# CONFIG_NLS_CODEPAGE_950 is not set
834# CONFIG_NLS_CODEPAGE_932 is not set
835# CONFIG_NLS_CODEPAGE_949 is not set
836# CONFIG_NLS_CODEPAGE_874 is not set
837# CONFIG_NLS_ISO8859_8 is not set
838# CONFIG_NLS_CODEPAGE_1250 is not set
839# CONFIG_NLS_CODEPAGE_1251 is not set
840CONFIG_NLS_ISO8859_1=m
841# CONFIG_NLS_ISO8859_2 is not set
842# CONFIG_NLS_ISO8859_3 is not set
843# CONFIG_NLS_ISO8859_4 is not set
844# CONFIG_NLS_ISO8859_5 is not set
845# CONFIG_NLS_ISO8859_6 is not set
846# CONFIG_NLS_ISO8859_7 is not set
847# CONFIG_NLS_ISO8859_9 is not set
848# CONFIG_NLS_ISO8859_13 is not set
849# CONFIG_NLS_ISO8859_14 is not set
850# CONFIG_NLS_ISO8859_15 is not set
851# CONFIG_NLS_KOI8_R is not set
852# CONFIG_NLS_KOI8_U is not set
853# CONFIG_NLS_UTF8 is not set
854
855#
856# Library routines
857#
858CONFIG_CRC32=y
859# CONFIG_LIBCRC32C is not set
860
861#
862# Kernel hacking
863#
864# CONFIG_DEBUG_KERNEL is not set
865# CONFIG_BOOTX_TEXT is not set
866
867#
868# Security options
869#
870# CONFIG_SECURITY is not set
871
872#
873# Cryptographic options
874#
875# CONFIG_CRYPTO is not set
diff --git a/arch/ppc/configs/ml300_defconfig b/arch/ppc/configs/ml300_defconfig
new file mode 100644
index 000000000000..4a33aca948cc
--- /dev/null
+++ b/arch/ppc/configs/ml300_defconfig
@@ -0,0 +1,739 @@
1#
2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.16-rc1
4# Wed Jan 18 00:49:20 2006
5#
6CONFIG_MMU=y
7CONFIG_GENERIC_HARDIRQS=y
8CONFIG_RWSEM_XCHGADD_ALGORITHM=y
9CONFIG_GENERIC_CALIBRATE_DELAY=y
10CONFIG_PPC=y
11CONFIG_PPC32=y
12CONFIG_GENERIC_NVRAM=y
13CONFIG_SCHED_NO_NO_OMIT_FRAME_POINTER=y
14CONFIG_ARCH_MAY_HAVE_PC_FDC=y
15
16#
17# Code maturity level options
18#
19CONFIG_EXPERIMENTAL=y
20CONFIG_CLEAN_COMPILE=y
21CONFIG_BROKEN_ON_SMP=y
22CONFIG_INIT_ENV_ARG_LIMIT=32
23
24#
25# General setup
26#
27CONFIG_LOCALVERSION=""
28CONFIG_LOCALVERSION_AUTO=y
29# CONFIG_SWAP is not set
30CONFIG_SYSVIPC=y
31# CONFIG_POSIX_MQUEUE is not set
32CONFIG_BSD_PROCESS_ACCT=y
33CONFIG_BSD_PROCESS_ACCT_V3=y
34CONFIG_SYSCTL=y
35# CONFIG_AUDIT is not set
36# CONFIG_IKCONFIG is not set
37CONFIG_INITRAMFS_SOURCE=""
38CONFIG_CC_OPTIMIZE_FOR_SIZE=y
39# CONFIG_EMBEDDED is not set
40CONFIG_KALLSYMS=y
41# CONFIG_KALLSYMS_ALL is not set
42# CONFIG_KALLSYMS_EXTRA_PASS is not set
43CONFIG_HOTPLUG=y
44CONFIG_PRINTK=y
45CONFIG_BUG=y
46CONFIG_ELF_CORE=y
47CONFIG_BASE_FULL=y
48CONFIG_FUTEX=y
49CONFIG_EPOLL=y
50CONFIG_SHMEM=y
51CONFIG_CC_ALIGN_FUNCTIONS=0
52CONFIG_CC_ALIGN_LABELS=0
53CONFIG_CC_ALIGN_LOOPS=0
54CONFIG_CC_ALIGN_JUMPS=0
55CONFIG_SLAB=y
56# CONFIG_TINY_SHMEM is not set
57CONFIG_BASE_SMALL=0
58# CONFIG_SLOB is not set
59
60#
61# Loadable module support
62#
63CONFIG_MODULES=y
64CONFIG_MODULE_UNLOAD=y
65CONFIG_MODULE_FORCE_UNLOAD=y
66CONFIG_OBSOLETE_MODPARM=y
67CONFIG_MODVERSIONS=y
68CONFIG_MODULE_SRCVERSION_ALL=y
69CONFIG_KMOD=y
70
71#
72# Block layer
73#
74CONFIG_LBD=y
75
76#
77# IO Schedulers
78#
79CONFIG_IOSCHED_NOOP=y
80CONFIG_IOSCHED_AS=y
81CONFIG_IOSCHED_DEADLINE=y
82CONFIG_IOSCHED_CFQ=y
83CONFIG_DEFAULT_AS=y
84# CONFIG_DEFAULT_DEADLINE is not set
85# CONFIG_DEFAULT_CFQ is not set
86# CONFIG_DEFAULT_NOOP is not set
87CONFIG_DEFAULT_IOSCHED="anticipatory"
88
89#
90# Processor
91#
92# CONFIG_6xx is not set
93CONFIG_40x=y
94# CONFIG_44x is not set
95# CONFIG_POWER3 is not set
96# CONFIG_8xx is not set
97# CONFIG_E200 is not set
98# CONFIG_E500 is not set
99# CONFIG_MATH_EMULATION is not set
100# CONFIG_KEXEC is not set
101# CONFIG_CPU_FREQ is not set
102CONFIG_4xx=y
103# CONFIG_WANT_EARLY_SERIAL is not set
104
105#
106# IBM 4xx options
107#
108# CONFIG_BUBINGA is not set
109# CONFIG_CPCI405 is not set
110# CONFIG_EP405 is not set
111# CONFIG_REDWOOD_5 is not set
112# CONFIG_REDWOOD_6 is not set
113# CONFIG_SYCAMORE is not set
114# CONFIG_WALNUT is not set
115CONFIG_XILINX_ML300=y
116CONFIG_IBM405_ERR77=y
117CONFIG_IBM405_ERR51=y
118CONFIG_XILINX_VIRTEX=y
119CONFIG_EMBEDDEDBOOT=y
120# CONFIG_PPC4xx_DMA is not set
121CONFIG_PPC_GEN550=y
122CONFIG_UART0_TTYS0=y
123# CONFIG_UART0_TTYS1 is not set
124CONFIG_NOT_COHERENT_CACHE=y
125
126#
127# Platform options
128#
129# CONFIG_PC_KEYBOARD is not set
130# CONFIG_HIGHMEM is not set
131# CONFIG_HZ_100 is not set
132CONFIG_HZ_250=y
133# CONFIG_HZ_1000 is not set
134CONFIG_HZ=250
135CONFIG_PREEMPT_NONE=y
136# CONFIG_PREEMPT_VOLUNTARY is not set
137# CONFIG_PREEMPT is not set
138CONFIG_SELECT_MEMORY_MODEL=y
139CONFIG_FLATMEM_MANUAL=y
140# CONFIG_DISCONTIGMEM_MANUAL is not set
141# CONFIG_SPARSEMEM_MANUAL is not set
142CONFIG_FLATMEM=y
143CONFIG_FLAT_NODE_MEM_MAP=y
144# CONFIG_SPARSEMEM_STATIC is not set
145CONFIG_SPLIT_PTLOCK_CPUS=4
146CONFIG_BINFMT_ELF=y
147# CONFIG_BINFMT_MISC is not set
148CONFIG_CMDLINE_BOOL=y
149CONFIG_CMDLINE="console=ttyS0,9600"
150# CONFIG_PM is not set
151# CONFIG_SOFTWARE_SUSPEND is not set
152CONFIG_SECCOMP=y
153CONFIG_ISA_DMA_API=y
154
155#
156# Bus options
157#
158# CONFIG_PPC_I8259 is not set
159# CONFIG_PCI is not set
160# CONFIG_PCI_DOMAINS is not set
161
162#
163# PCCARD (PCMCIA/CardBus) support
164#
165# CONFIG_PCCARD is not set
166
167#
168# Advanced setup
169#
170# CONFIG_ADVANCED_OPTIONS is not set
171
172#
173# Default settings for advanced configuration options are used
174#
175CONFIG_HIGHMEM_START=0xfe000000
176CONFIG_LOWMEM_SIZE=0x30000000
177CONFIG_KERNEL_START=0xc0000000
178CONFIG_TASK_SIZE=0x80000000
179CONFIG_CONSISTENT_START=0xff100000
180CONFIG_CONSISTENT_SIZE=0x00200000
181CONFIG_BOOT_LOAD=0x00400000
182
183#
184# Networking
185#
186CONFIG_NET=y
187
188#
189# Networking options
190#
191CONFIG_PACKET=y
192CONFIG_PACKET_MMAP=y
193CONFIG_UNIX=y
194# CONFIG_NET_KEY is not set
195CONFIG_INET=y
196# CONFIG_IP_MULTICAST is not set
197# CONFIG_IP_ADVANCED_ROUTER is not set
198CONFIG_IP_FIB_HASH=y
199CONFIG_IP_PNP=y
200CONFIG_IP_PNP_DHCP=y
201# CONFIG_IP_PNP_BOOTP is not set
202# CONFIG_IP_PNP_RARP is not set
203# CONFIG_NET_IPIP is not set
204# CONFIG_NET_IPGRE is not set
205# CONFIG_ARPD is not set
206# CONFIG_SYN_COOKIES is not set
207# CONFIG_INET_AH is not set
208# CONFIG_INET_ESP is not set
209# CONFIG_INET_IPCOMP is not set
210# CONFIG_INET_TUNNEL is not set
211CONFIG_INET_DIAG=y
212CONFIG_INET_TCP_DIAG=y
213# CONFIG_TCP_CONG_ADVANCED is not set
214CONFIG_TCP_CONG_BIC=y
215# CONFIG_IPV6 is not set
216# CONFIG_NETFILTER is not set
217
218#
219# DCCP Configuration (EXPERIMENTAL)
220#
221# CONFIG_IP_DCCP is not set
222
223#
224# SCTP Configuration (EXPERIMENTAL)
225#
226# CONFIG_IP_SCTP is not set
227# CONFIG_ATM is not set
228# CONFIG_BRIDGE is not set
229# CONFIG_VLAN_8021Q is not set
230# CONFIG_DECNET is not set
231# CONFIG_LLC2 is not set
232# CONFIG_IPX is not set
233# CONFIG_ATALK is not set
234# CONFIG_X25 is not set
235# CONFIG_LAPB is not set
236
237#
238# TIPC Configuration (EXPERIMENTAL)
239#
240# CONFIG_TIPC is not set
241# CONFIG_NET_DIVERT is not set
242# CONFIG_ECONET is not set
243# CONFIG_WAN_ROUTER is not set
244
245#
246# QoS and/or fair queueing
247#
248# CONFIG_NET_SCHED is not set
249
250#
251# Network testing
252#
253# CONFIG_NET_PKTGEN is not set
254# CONFIG_HAMRADIO is not set
255# CONFIG_IRDA is not set
256# CONFIG_BT is not set
257# CONFIG_IEEE80211 is not set
258
259#
260# Device Drivers
261#
262
263#
264# Generic Driver Options
265#
266CONFIG_STANDALONE=y
267CONFIG_PREVENT_FIRMWARE_BUILD=y
268# CONFIG_FW_LOADER is not set
269# CONFIG_DEBUG_DRIVER is not set
270
271#
272# Connector - unified userspace <-> kernelspace linker
273#
274# CONFIG_CONNECTOR is not set
275
276#
277# Memory Technology Devices (MTD)
278#
279# CONFIG_MTD is not set
280
281#
282# Parallel port support
283#
284# CONFIG_PARPORT is not set
285
286#
287# Plug and Play support
288#
289
290#
291# Block devices
292#
293# CONFIG_BLK_DEV_FD is not set
294# CONFIG_BLK_DEV_COW_COMMON is not set
295# CONFIG_BLK_DEV_LOOP is not set
296# CONFIG_BLK_DEV_NBD is not set
297CONFIG_BLK_DEV_RAM=y
298CONFIG_BLK_DEV_RAM_COUNT=16
299CONFIG_BLK_DEV_RAM_SIZE=65536
300CONFIG_BLK_DEV_INITRD=y
301# CONFIG_CDROM_PKTCDVD is not set
302# CONFIG_ATA_OVER_ETH is not set
303
304#
305# ATA/ATAPI/MFM/RLL support
306#
307# CONFIG_IDE is not set
308
309#
310# SCSI device support
311#
312# CONFIG_RAID_ATTRS is not set
313# CONFIG_SCSI is not set
314
315#
316# Multi-device support (RAID and LVM)
317#
318# CONFIG_MD is not set
319
320#
321# Fusion MPT device support
322#
323# CONFIG_FUSION is not set
324
325#
326# IEEE 1394 (FireWire) support
327#
328
329#
330# I2O device support
331#
332
333#
334# Macintosh device drivers
335#
336# CONFIG_WINDFARM is not set
337
338#
339# Network device support
340#
341CONFIG_NETDEVICES=y
342# CONFIG_DUMMY is not set
343# CONFIG_BONDING is not set
344# CONFIG_EQUALIZER is not set
345CONFIG_TUN=y
346
347#
348# PHY device support
349#
350
351#
352# Ethernet (10 or 100Mbit)
353#
354# CONFIG_NET_ETHERNET is not set
355# CONFIG_IBM_EMAC is not set
356
357#
358# Ethernet (1000 Mbit)
359#
360
361#
362# Ethernet (10000 Mbit)
363#
364
365#
366# Token Ring devices
367#
368
369#
370# Wireless LAN (non-hamradio)
371#
372# CONFIG_NET_RADIO is not set
373
374#
375# Wan interfaces
376#
377# CONFIG_WAN is not set
378# CONFIG_PPP is not set
379# CONFIG_SLIP is not set
380# CONFIG_SHAPER is not set
381# CONFIG_NETCONSOLE is not set
382# CONFIG_NETPOLL is not set
383# CONFIG_NET_POLL_CONTROLLER is not set
384
385#
386# ISDN subsystem
387#
388# CONFIG_ISDN is not set
389
390#
391# Telephony Support
392#
393# CONFIG_PHONE is not set
394
395#
396# Input device support
397#
398CONFIG_INPUT=y
399
400#
401# Userland interfaces
402#
403CONFIG_INPUT_MOUSEDEV=y
404# CONFIG_INPUT_MOUSEDEV_PSAUX is not set
405CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024
406CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768
407# CONFIG_INPUT_JOYDEV is not set
408# CONFIG_INPUT_TSDEV is not set
409# CONFIG_INPUT_EVDEV is not set
410# CONFIG_INPUT_EVBUG is not set
411
412#
413# Input Device Drivers
414#
415# CONFIG_INPUT_KEYBOARD is not set
416# CONFIG_INPUT_MOUSE is not set
417# CONFIG_INPUT_JOYSTICK is not set
418# CONFIG_INPUT_TOUCHSCREEN is not set
419# CONFIG_INPUT_MISC is not set
420
421#
422# Hardware I/O ports
423#
424# CONFIG_SERIO is not set
425# CONFIG_GAMEPORT is not set
426
427#
428# Character devices
429#
430CONFIG_VT=y
431CONFIG_VT_CONSOLE=y
432CONFIG_HW_CONSOLE=y
433# CONFIG_SERIAL_NONSTANDARD is not set
434
435#
436# Serial drivers
437#
438CONFIG_SERIAL_8250=y
439CONFIG_SERIAL_8250_CONSOLE=y
440CONFIG_SERIAL_8250_NR_UARTS=4
441CONFIG_SERIAL_8250_RUNTIME_UARTS=4
442# CONFIG_SERIAL_8250_EXTENDED is not set
443
444#
445# Non-8250 serial port support
446#
447CONFIG_SERIAL_CORE=y
448CONFIG_SERIAL_CORE_CONSOLE=y
449CONFIG_UNIX98_PTYS=y
450# CONFIG_LEGACY_PTYS is not set
451
452#
453# IPMI
454#
455# CONFIG_IPMI_HANDLER is not set
456
457#
458# Watchdog Cards
459#
460# CONFIG_WATCHDOG is not set
461# CONFIG_NVRAM is not set
462# CONFIG_GEN_RTC is not set
463# CONFIG_DTLK is not set
464# CONFIG_R3964 is not set
465
466#
467# Ftape, the floppy tape device driver
468#
469# CONFIG_AGP is not set
470# CONFIG_RAW_DRIVER is not set
471
472#
473# TPM devices
474#
475# CONFIG_TCG_TPM is not set
476# CONFIG_TELCLOCK is not set
477
478#
479# I2C support
480#
481# CONFIG_I2C is not set
482
483#
484# SPI support
485#
486# CONFIG_SPI is not set
487# CONFIG_SPI_MASTER is not set
488
489#
490# Dallas's 1-wire bus
491#
492# CONFIG_W1 is not set
493
494#
495# Hardware Monitoring support
496#
497# CONFIG_HWMON is not set
498# CONFIG_HWMON_VID is not set
499
500#
501# Misc devices
502#
503
504#
505# Multimedia Capabilities Port drivers
506#
507
508#
509# Multimedia devices
510#
511# CONFIG_VIDEO_DEV is not set
512
513#
514# Digital Video Broadcasting Devices
515#
516# CONFIG_DVB is not set
517
518#
519# Graphics support
520#
521# CONFIG_FB is not set
522
523#
524# Console display driver support
525#
526CONFIG_DUMMY_CONSOLE=y
527
528#
529# Sound
530#
531# CONFIG_SOUND is not set
532
533#
534# USB support
535#
536# CONFIG_USB_ARCH_HAS_HCD is not set
537# CONFIG_USB_ARCH_HAS_OHCI is not set
538
539#
540# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support'
541#
542
543#
544# USB Gadget Support
545#
546# CONFIG_USB_GADGET is not set
547
548#
549# MMC/SD Card support
550#
551# CONFIG_MMC is not set
552
553#
554# InfiniBand support
555#
556
557#
558# SN Devices
559#
560
561#
562# File systems
563#
564CONFIG_EXT2_FS=y
565# CONFIG_EXT2_FS_XATTR is not set
566# CONFIG_EXT2_FS_XIP is not set
567# CONFIG_EXT3_FS is not set
568# CONFIG_REISERFS_FS is not set
569# CONFIG_JFS_FS is not set
570# CONFIG_FS_POSIX_ACL is not set
571# CONFIG_XFS_FS is not set
572# CONFIG_OCFS2_FS is not set
573# CONFIG_MINIX_FS is not set
574# CONFIG_ROMFS_FS is not set
575CONFIG_INOTIFY=y
576# CONFIG_QUOTA is not set
577CONFIG_DNOTIFY=y
578# CONFIG_AUTOFS_FS is not set
579# CONFIG_AUTOFS4_FS is not set
580# CONFIG_FUSE_FS is not set
581
582#
583# CD-ROM/DVD Filesystems
584#
585# CONFIG_ISO9660_FS is not set
586# CONFIG_UDF_FS is not set
587
588#
589# DOS/FAT/NT Filesystems
590#
591CONFIG_FAT_FS=y
592CONFIG_MSDOS_FS=y
593CONFIG_VFAT_FS=y
594CONFIG_FAT_DEFAULT_CODEPAGE=437
595CONFIG_FAT_DEFAULT_IOCHARSET="iso8859-1"
596# CONFIG_NTFS_FS is not set
597
598#
599# Pseudo filesystems
600#
601CONFIG_PROC_FS=y
602CONFIG_PROC_KCORE=y
603CONFIG_SYSFS=y
604CONFIG_TMPFS=y
605# CONFIG_HUGETLB_PAGE is not set
606CONFIG_RAMFS=y
607# CONFIG_RELAYFS_FS is not set
608# CONFIG_CONFIGFS_FS is not set
609
610#
611# Miscellaneous filesystems
612#
613# CONFIG_ADFS_FS is not set
614# CONFIG_AFFS_FS is not set
615# CONFIG_HFS_FS is not set
616# CONFIG_HFSPLUS_FS is not set
617# CONFIG_BEFS_FS is not set
618# CONFIG_BFS_FS is not set
619# CONFIG_EFS_FS is not set
620# CONFIG_CRAMFS is not set
621# CONFIG_VXFS_FS is not set
622# CONFIG_HPFS_FS is not set
623# CONFIG_QNX4FS_FS is not set
624# CONFIG_SYSV_FS is not set
625# CONFIG_UFS_FS is not set
626
627#
628# Network File Systems
629#
630# CONFIG_NFS_FS is not set
631# CONFIG_NFSD is not set
632# CONFIG_SMB_FS is not set
633# CONFIG_CIFS is not set
634# CONFIG_NCP_FS is not set
635# CONFIG_CODA_FS is not set
636# CONFIG_AFS_FS is not set
637# CONFIG_9P_FS is not set
638
639#
640# Partition Types
641#
642# CONFIG_PARTITION_ADVANCED is not set
643CONFIG_MSDOS_PARTITION=y
644
645#
646# Native Language Support
647#
648CONFIG_NLS=y
649CONFIG_NLS_DEFAULT="iso8859-1"
650CONFIG_NLS_CODEPAGE_437=y
651# CONFIG_NLS_CODEPAGE_737 is not set
652# CONFIG_NLS_CODEPAGE_775 is not set
653# CONFIG_NLS_CODEPAGE_850 is not set
654# CONFIG_NLS_CODEPAGE_852 is not set
655# CONFIG_NLS_CODEPAGE_855 is not set
656# CONFIG_NLS_CODEPAGE_857 is not set
657# CONFIG_NLS_CODEPAGE_860 is not set
658# CONFIG_NLS_CODEPAGE_861 is not set
659# CONFIG_NLS_CODEPAGE_862 is not set
660# CONFIG_NLS_CODEPAGE_863 is not set
661# CONFIG_NLS_CODEPAGE_864 is not set
662# CONFIG_NLS_CODEPAGE_865 is not set
663# CONFIG_NLS_CODEPAGE_866 is not set
664# CONFIG_NLS_CODEPAGE_869 is not set
665# CONFIG_NLS_CODEPAGE_936 is not set
666# CONFIG_NLS_CODEPAGE_950 is not set
667# CONFIG_NLS_CODEPAGE_932 is not set
668# CONFIG_NLS_CODEPAGE_949 is not set
669# CONFIG_NLS_CODEPAGE_874 is not set
670# CONFIG_NLS_ISO8859_8 is not set
671# CONFIG_NLS_CODEPAGE_1250 is not set
672# CONFIG_NLS_CODEPAGE_1251 is not set
673CONFIG_NLS_ASCII=y
674CONFIG_NLS_ISO8859_1=y
675# CONFIG_NLS_ISO8859_2 is not set
676# CONFIG_NLS_ISO8859_3 is not set
677# CONFIG_NLS_ISO8859_4 is not set
678# CONFIG_NLS_ISO8859_5 is not set
679# CONFIG_NLS_ISO8859_6 is not set
680# CONFIG_NLS_ISO8859_7 is not set
681# CONFIG_NLS_ISO8859_9 is not set
682# CONFIG_NLS_ISO8859_13 is not set
683# CONFIG_NLS_ISO8859_14 is not set
684# CONFIG_NLS_ISO8859_15 is not set
685# CONFIG_NLS_KOI8_R is not set
686# CONFIG_NLS_KOI8_U is not set
687CONFIG_NLS_UTF8=y
688
689#
690# IBM 40x options
691#
692
693#
694# Library routines
695#
696# CONFIG_CRC_CCITT is not set
697# CONFIG_CRC16 is not set
698CONFIG_CRC32=y
699# CONFIG_LIBCRC32C is not set
700# CONFIG_PROFILING is not set
701
702#
703# Kernel hacking
704#
705CONFIG_PRINTK_TIME=y
706CONFIG_MAGIC_SYSRQ=y
707CONFIG_DEBUG_KERNEL=y
708CONFIG_LOG_BUF_SHIFT=14
709CONFIG_DETECT_SOFTLOCKUP=y
710# CONFIG_SCHEDSTATS is not set
711# CONFIG_DEBUG_SLAB is not set
712CONFIG_DEBUG_MUTEXES=y
713# CONFIG_DEBUG_SPINLOCK is not set
714# CONFIG_DEBUG_SPINLOCK_SLEEP is not set
715# CONFIG_DEBUG_KOBJECT is not set
716CONFIG_DEBUG_INFO=y
717# CONFIG_DEBUG_FS is not set
718# CONFIG_DEBUG_VM is not set
719CONFIG_FORCED_INLINING=y
720# CONFIG_RCU_TORTURE_TEST is not set
721# CONFIG_KGDB is not set
722CONFIG_XMON=y
723# CONFIG_BDI_SWITCH is not set
724# CONFIG_SERIAL_TEXT_DEBUG is not set
725
726#
727# Security options
728#
729# CONFIG_KEYS is not set
730# CONFIG_SECURITY is not set
731
732#
733# Cryptographic options
734#
735# CONFIG_CRYPTO is not set
736
737#
738# Hardware crypto devices
739#
diff --git a/arch/ppc/configs/ml403_defconfig b/arch/ppc/configs/ml403_defconfig
new file mode 100644
index 000000000000..fafd2516fa51
--- /dev/null
+++ b/arch/ppc/configs/ml403_defconfig
@@ -0,0 +1,740 @@
1#
2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.16-rc1
4# Wed Jan 18 01:11:41 2006
5#
6CONFIG_MMU=y
7CONFIG_GENERIC_HARDIRQS=y
8CONFIG_RWSEM_XCHGADD_ALGORITHM=y
9CONFIG_GENERIC_CALIBRATE_DELAY=y
10CONFIG_PPC=y
11CONFIG_PPC32=y
12CONFIG_GENERIC_NVRAM=y
13CONFIG_SCHED_NO_NO_OMIT_FRAME_POINTER=y
14CONFIG_ARCH_MAY_HAVE_PC_FDC=y
15
16#
17# Code maturity level options
18#
19CONFIG_EXPERIMENTAL=y
20CONFIG_CLEAN_COMPILE=y
21CONFIG_BROKEN_ON_SMP=y
22CONFIG_INIT_ENV_ARG_LIMIT=32
23
24#
25# General setup
26#
27CONFIG_LOCALVERSION=""
28CONFIG_LOCALVERSION_AUTO=y
29# CONFIG_SWAP is not set
30CONFIG_SYSVIPC=y
31# CONFIG_POSIX_MQUEUE is not set
32CONFIG_BSD_PROCESS_ACCT=y
33CONFIG_BSD_PROCESS_ACCT_V3=y
34CONFIG_SYSCTL=y
35# CONFIG_AUDIT is not set
36# CONFIG_IKCONFIG is not set
37CONFIG_INITRAMFS_SOURCE=""
38CONFIG_CC_OPTIMIZE_FOR_SIZE=y
39# CONFIG_EMBEDDED is not set
40CONFIG_KALLSYMS=y
41# CONFIG_KALLSYMS_ALL is not set
42# CONFIG_KALLSYMS_EXTRA_PASS is not set
43CONFIG_HOTPLUG=y
44CONFIG_PRINTK=y
45CONFIG_BUG=y
46CONFIG_ELF_CORE=y
47CONFIG_BASE_FULL=y
48CONFIG_FUTEX=y
49CONFIG_EPOLL=y
50CONFIG_SHMEM=y
51CONFIG_CC_ALIGN_FUNCTIONS=0
52CONFIG_CC_ALIGN_LABELS=0
53CONFIG_CC_ALIGN_LOOPS=0
54CONFIG_CC_ALIGN_JUMPS=0
55CONFIG_SLAB=y
56# CONFIG_TINY_SHMEM is not set
57CONFIG_BASE_SMALL=0
58# CONFIG_SLOB is not set
59
60#
61# Loadable module support
62#
63CONFIG_MODULES=y
64CONFIG_MODULE_UNLOAD=y
65CONFIG_MODULE_FORCE_UNLOAD=y
66CONFIG_OBSOLETE_MODPARM=y
67CONFIG_MODVERSIONS=y
68CONFIG_MODULE_SRCVERSION_ALL=y
69CONFIG_KMOD=y
70
71#
72# Block layer
73#
74CONFIG_LBD=y
75
76#
77# IO Schedulers
78#
79CONFIG_IOSCHED_NOOP=y
80CONFIG_IOSCHED_AS=y
81CONFIG_IOSCHED_DEADLINE=y
82CONFIG_IOSCHED_CFQ=y
83CONFIG_DEFAULT_AS=y
84# CONFIG_DEFAULT_DEADLINE is not set
85# CONFIG_DEFAULT_CFQ is not set
86# CONFIG_DEFAULT_NOOP is not set
87CONFIG_DEFAULT_IOSCHED="anticipatory"
88
89#
90# Processor
91#
92# CONFIG_6xx is not set
93CONFIG_40x=y
94# CONFIG_44x is not set
95# CONFIG_POWER3 is not set
96# CONFIG_8xx is not set
97# CONFIG_E200 is not set
98# CONFIG_E500 is not set
99# CONFIG_MATH_EMULATION is not set
100# CONFIG_KEXEC is not set
101# CONFIG_CPU_FREQ is not set
102CONFIG_4xx=y
103# CONFIG_WANT_EARLY_SERIAL is not set
104
105#
106# IBM 4xx options
107#
108# CONFIG_BUBINGA is not set
109# CONFIG_CPCI405 is not set
110# CONFIG_EP405 is not set
111# CONFIG_REDWOOD_5 is not set
112# CONFIG_REDWOOD_6 is not set
113# CONFIG_SYCAMORE is not set
114# CONFIG_WALNUT is not set
115# CONFIG_XILINX_ML300 is not set
116CONFIG_XILINX_ML403=y
117CONFIG_IBM405_ERR77=y
118CONFIG_IBM405_ERR51=y
119CONFIG_XILINX_VIRTEX=y
120CONFIG_EMBEDDEDBOOT=y
121# CONFIG_PPC4xx_DMA is not set
122CONFIG_PPC_GEN550=y
123CONFIG_UART0_TTYS0=y
124# CONFIG_UART0_TTYS1 is not set
125CONFIG_NOT_COHERENT_CACHE=y
126
127#
128# Platform options
129#
130# CONFIG_PC_KEYBOARD is not set
131# CONFIG_HIGHMEM is not set
132# CONFIG_HZ_100 is not set
133CONFIG_HZ_250=y
134# CONFIG_HZ_1000 is not set
135CONFIG_HZ=250
136CONFIG_PREEMPT_NONE=y
137# CONFIG_PREEMPT_VOLUNTARY is not set
138# CONFIG_PREEMPT is not set
139CONFIG_SELECT_MEMORY_MODEL=y
140CONFIG_FLATMEM_MANUAL=y
141# CONFIG_DISCONTIGMEM_MANUAL is not set
142# CONFIG_SPARSEMEM_MANUAL is not set
143CONFIG_FLATMEM=y
144CONFIG_FLAT_NODE_MEM_MAP=y
145# CONFIG_SPARSEMEM_STATIC is not set
146CONFIG_SPLIT_PTLOCK_CPUS=4
147CONFIG_BINFMT_ELF=y
148# CONFIG_BINFMT_MISC is not set
149CONFIG_CMDLINE_BOOL=y
150CONFIG_CMDLINE="console=ttyS0,9600"
151# CONFIG_PM is not set
152# CONFIG_SOFTWARE_SUSPEND is not set
153CONFIG_SECCOMP=y
154CONFIG_ISA_DMA_API=y
155
156#
157# Bus options
158#
159# CONFIG_PPC_I8259 is not set
160# CONFIG_PCI is not set
161# CONFIG_PCI_DOMAINS is not set
162
163#
164# PCCARD (PCMCIA/CardBus) support
165#
166# CONFIG_PCCARD is not set
167
168#
169# Advanced setup
170#
171# CONFIG_ADVANCED_OPTIONS is not set
172
173#
174# Default settings for advanced configuration options are used
175#
176CONFIG_HIGHMEM_START=0xfe000000
177CONFIG_LOWMEM_SIZE=0x30000000
178CONFIG_KERNEL_START=0xc0000000
179CONFIG_TASK_SIZE=0x80000000
180CONFIG_CONSISTENT_START=0xff100000
181CONFIG_CONSISTENT_SIZE=0x00200000
182CONFIG_BOOT_LOAD=0x00400000
183
184#
185# Networking
186#
187CONFIG_NET=y
188
189#
190# Networking options
191#
192CONFIG_PACKET=y
193CONFIG_PACKET_MMAP=y
194CONFIG_UNIX=y
195# CONFIG_NET_KEY is not set
196CONFIG_INET=y
197# CONFIG_IP_MULTICAST is not set
198# CONFIG_IP_ADVANCED_ROUTER is not set
199CONFIG_IP_FIB_HASH=y
200CONFIG_IP_PNP=y
201CONFIG_IP_PNP_DHCP=y
202# CONFIG_IP_PNP_BOOTP is not set
203# CONFIG_IP_PNP_RARP is not set
204# CONFIG_NET_IPIP is not set
205# CONFIG_NET_IPGRE is not set
206# CONFIG_ARPD is not set
207# CONFIG_SYN_COOKIES is not set
208# CONFIG_INET_AH is not set
209# CONFIG_INET_ESP is not set
210# CONFIG_INET_IPCOMP is not set
211# CONFIG_INET_TUNNEL is not set
212CONFIG_INET_DIAG=y
213CONFIG_INET_TCP_DIAG=y
214# CONFIG_TCP_CONG_ADVANCED is not set
215CONFIG_TCP_CONG_BIC=y
216# CONFIG_IPV6 is not set
217# CONFIG_NETFILTER is not set
218
219#
220# DCCP Configuration (EXPERIMENTAL)
221#
222# CONFIG_IP_DCCP is not set
223
224#
225# SCTP Configuration (EXPERIMENTAL)
226#
227# CONFIG_IP_SCTP is not set
228# CONFIG_ATM is not set
229# CONFIG_BRIDGE is not set
230# CONFIG_VLAN_8021Q is not set
231# CONFIG_DECNET is not set
232# CONFIG_LLC2 is not set
233# CONFIG_IPX is not set
234# CONFIG_ATALK is not set
235# CONFIG_X25 is not set
236# CONFIG_LAPB is not set
237
238#
239# TIPC Configuration (EXPERIMENTAL)
240#
241# CONFIG_TIPC is not set
242# CONFIG_NET_DIVERT is not set
243# CONFIG_ECONET is not set
244# CONFIG_WAN_ROUTER is not set
245
246#
247# QoS and/or fair queueing
248#
249# CONFIG_NET_SCHED is not set
250
251#
252# Network testing
253#
254# CONFIG_NET_PKTGEN is not set
255# CONFIG_HAMRADIO is not set
256# CONFIG_IRDA is not set
257# CONFIG_BT is not set
258# CONFIG_IEEE80211 is not set
259
260#
261# Device Drivers
262#
263
264#
265# Generic Driver Options
266#
267CONFIG_STANDALONE=y
268CONFIG_PREVENT_FIRMWARE_BUILD=y
269# CONFIG_FW_LOADER is not set
270# CONFIG_DEBUG_DRIVER is not set
271
272#
273# Connector - unified userspace <-> kernelspace linker
274#
275# CONFIG_CONNECTOR is not set
276
277#
278# Memory Technology Devices (MTD)
279#
280# CONFIG_MTD is not set
281
282#
283# Parallel port support
284#
285# CONFIG_PARPORT is not set
286
287#
288# Plug and Play support
289#
290
291#
292# Block devices
293#
294# CONFIG_BLK_DEV_FD is not set
295# CONFIG_BLK_DEV_COW_COMMON is not set
296# CONFIG_BLK_DEV_LOOP is not set
297# CONFIG_BLK_DEV_NBD is not set
298CONFIG_BLK_DEV_RAM=y
299CONFIG_BLK_DEV_RAM_COUNT=16
300CONFIG_BLK_DEV_RAM_SIZE=65536
301CONFIG_BLK_DEV_INITRD=y
302# CONFIG_CDROM_PKTCDVD is not set
303# CONFIG_ATA_OVER_ETH is not set
304
305#
306# ATA/ATAPI/MFM/RLL support
307#
308# CONFIG_IDE is not set
309
310#
311# SCSI device support
312#
313# CONFIG_RAID_ATTRS is not set
314# CONFIG_SCSI is not set
315
316#
317# Multi-device support (RAID and LVM)
318#
319# CONFIG_MD is not set
320
321#
322# Fusion MPT device support
323#
324# CONFIG_FUSION is not set
325
326#
327# IEEE 1394 (FireWire) support
328#
329
330#
331# I2O device support
332#
333
334#
335# Macintosh device drivers
336#
337# CONFIG_WINDFARM is not set
338
339#
340# Network device support
341#
342CONFIG_NETDEVICES=y
343# CONFIG_DUMMY is not set
344# CONFIG_BONDING is not set
345# CONFIG_EQUALIZER is not set
346CONFIG_TUN=y
347
348#
349# PHY device support
350#
351
352#
353# Ethernet (10 or 100Mbit)
354#
355# CONFIG_NET_ETHERNET is not set
356# CONFIG_IBM_EMAC is not set
357
358#
359# Ethernet (1000 Mbit)
360#
361
362#
363# Ethernet (10000 Mbit)
364#
365
366#
367# Token Ring devices
368#
369
370#
371# Wireless LAN (non-hamradio)
372#
373# CONFIG_NET_RADIO is not set
374
375#
376# Wan interfaces
377#
378# CONFIG_WAN is not set
379# CONFIG_PPP is not set
380# CONFIG_SLIP is not set
381# CONFIG_SHAPER is not set
382# CONFIG_NETCONSOLE is not set
383# CONFIG_NETPOLL is not set
384# CONFIG_NET_POLL_CONTROLLER is not set
385
386#
387# ISDN subsystem
388#
389# CONFIG_ISDN is not set
390
391#
392# Telephony Support
393#
394# CONFIG_PHONE is not set
395
396#
397# Input device support
398#
399CONFIG_INPUT=y
400
401#
402# Userland interfaces
403#
404CONFIG_INPUT_MOUSEDEV=y
405# CONFIG_INPUT_MOUSEDEV_PSAUX is not set
406CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024
407CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768
408# CONFIG_INPUT_JOYDEV is not set
409# CONFIG_INPUT_TSDEV is not set
410# CONFIG_INPUT_EVDEV is not set
411# CONFIG_INPUT_EVBUG is not set
412
413#
414# Input Device Drivers
415#
416# CONFIG_INPUT_KEYBOARD is not set
417# CONFIG_INPUT_MOUSE is not set
418# CONFIG_INPUT_JOYSTICK is not set
419# CONFIG_INPUT_TOUCHSCREEN is not set
420# CONFIG_INPUT_MISC is not set
421
422#
423# Hardware I/O ports
424#
425# CONFIG_SERIO is not set
426# CONFIG_GAMEPORT is not set
427
428#
429# Character devices
430#
431CONFIG_VT=y
432CONFIG_VT_CONSOLE=y
433CONFIG_HW_CONSOLE=y
434# CONFIG_SERIAL_NONSTANDARD is not set
435
436#
437# Serial drivers
438#
439CONFIG_SERIAL_8250=y
440CONFIG_SERIAL_8250_CONSOLE=y
441CONFIG_SERIAL_8250_NR_UARTS=4
442CONFIG_SERIAL_8250_RUNTIME_UARTS=4
443# CONFIG_SERIAL_8250_EXTENDED is not set
444
445#
446# Non-8250 serial port support
447#
448CONFIG_SERIAL_CORE=y
449CONFIG_SERIAL_CORE_CONSOLE=y
450CONFIG_UNIX98_PTYS=y
451# CONFIG_LEGACY_PTYS is not set
452
453#
454# IPMI
455#
456# CONFIG_IPMI_HANDLER is not set
457
458#
459# Watchdog Cards
460#
461# CONFIG_WATCHDOG is not set
462# CONFIG_NVRAM is not set
463# CONFIG_GEN_RTC is not set
464# CONFIG_DTLK is not set
465# CONFIG_R3964 is not set
466
467#
468# Ftape, the floppy tape device driver
469#
470# CONFIG_AGP is not set
471# CONFIG_RAW_DRIVER is not set
472
473#
474# TPM devices
475#
476# CONFIG_TCG_TPM is not set
477# CONFIG_TELCLOCK is not set
478
479#
480# I2C support
481#
482# CONFIG_I2C is not set
483
484#
485# SPI support
486#
487# CONFIG_SPI is not set
488# CONFIG_SPI_MASTER is not set
489
490#
491# Dallas's 1-wire bus
492#
493# CONFIG_W1 is not set
494
495#
496# Hardware Monitoring support
497#
498# CONFIG_HWMON is not set
499# CONFIG_HWMON_VID is not set
500
501#
502# Misc devices
503#
504
505#
506# Multimedia Capabilities Port drivers
507#
508
509#
510# Multimedia devices
511#
512# CONFIG_VIDEO_DEV is not set
513
514#
515# Digital Video Broadcasting Devices
516#
517# CONFIG_DVB is not set
518
519#
520# Graphics support
521#
522# CONFIG_FB is not set
523
524#
525# Console display driver support
526#
527CONFIG_DUMMY_CONSOLE=y
528
529#
530# Sound
531#
532# CONFIG_SOUND is not set
533
534#
535# USB support
536#
537# CONFIG_USB_ARCH_HAS_HCD is not set
538# CONFIG_USB_ARCH_HAS_OHCI is not set
539
540#
541# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support'
542#
543
544#
545# USB Gadget Support
546#
547# CONFIG_USB_GADGET is not set
548
549#
550# MMC/SD Card support
551#
552# CONFIG_MMC is not set
553
554#
555# InfiniBand support
556#
557
558#
559# SN Devices
560#
561
562#
563# File systems
564#
565CONFIG_EXT2_FS=y
566# CONFIG_EXT2_FS_XATTR is not set
567# CONFIG_EXT2_FS_XIP is not set
568# CONFIG_EXT3_FS is not set
569# CONFIG_REISERFS_FS is not set
570# CONFIG_JFS_FS is not set
571# CONFIG_FS_POSIX_ACL is not set
572# CONFIG_XFS_FS is not set
573# CONFIG_OCFS2_FS is not set
574# CONFIG_MINIX_FS is not set
575# CONFIG_ROMFS_FS is not set
576CONFIG_INOTIFY=y
577# CONFIG_QUOTA is not set
578CONFIG_DNOTIFY=y
579# CONFIG_AUTOFS_FS is not set
580# CONFIG_AUTOFS4_FS is not set
581# CONFIG_FUSE_FS is not set
582
583#
584# CD-ROM/DVD Filesystems
585#
586# CONFIG_ISO9660_FS is not set
587# CONFIG_UDF_FS is not set
588
589#
590# DOS/FAT/NT Filesystems
591#
592CONFIG_FAT_FS=y
593CONFIG_MSDOS_FS=y
594CONFIG_VFAT_FS=y
595CONFIG_FAT_DEFAULT_CODEPAGE=437
596CONFIG_FAT_DEFAULT_IOCHARSET="iso8859-1"
597# CONFIG_NTFS_FS is not set
598
599#
600# Pseudo filesystems
601#
602CONFIG_PROC_FS=y
603CONFIG_PROC_KCORE=y
604CONFIG_SYSFS=y
605CONFIG_TMPFS=y
606# CONFIG_HUGETLB_PAGE is not set
607CONFIG_RAMFS=y
608# CONFIG_RELAYFS_FS is not set
609# CONFIG_CONFIGFS_FS is not set
610
611#
612# Miscellaneous filesystems
613#
614# CONFIG_ADFS_FS is not set
615# CONFIG_AFFS_FS is not set
616# CONFIG_HFS_FS is not set
617# CONFIG_HFSPLUS_FS is not set
618# CONFIG_BEFS_FS is not set
619# CONFIG_BFS_FS is not set
620# CONFIG_EFS_FS is not set
621# CONFIG_CRAMFS is not set
622# CONFIG_VXFS_FS is not set
623# CONFIG_HPFS_FS is not set
624# CONFIG_QNX4FS_FS is not set
625# CONFIG_SYSV_FS is not set
626# CONFIG_UFS_FS is not set
627
628#
629# Network File Systems
630#
631# CONFIG_NFS_FS is not set
632# CONFIG_NFSD is not set
633# CONFIG_SMB_FS is not set
634# CONFIG_CIFS is not set
635# CONFIG_NCP_FS is not set
636# CONFIG_CODA_FS is not set
637# CONFIG_AFS_FS is not set
638# CONFIG_9P_FS is not set
639
640#
641# Partition Types
642#
643# CONFIG_PARTITION_ADVANCED is not set
644CONFIG_MSDOS_PARTITION=y
645
646#
647# Native Language Support
648#
649CONFIG_NLS=y
650CONFIG_NLS_DEFAULT="iso8859-1"
651CONFIG_NLS_CODEPAGE_437=y
652# CONFIG_NLS_CODEPAGE_737 is not set
653# CONFIG_NLS_CODEPAGE_775 is not set
654# CONFIG_NLS_CODEPAGE_850 is not set
655# CONFIG_NLS_CODEPAGE_852 is not set
656# CONFIG_NLS_CODEPAGE_855 is not set
657# CONFIG_NLS_CODEPAGE_857 is not set
658# CONFIG_NLS_CODEPAGE_860 is not set
659# CONFIG_NLS_CODEPAGE_861 is not set
660# CONFIG_NLS_CODEPAGE_862 is not set
661# CONFIG_NLS_CODEPAGE_863 is not set
662# CONFIG_NLS_CODEPAGE_864 is not set
663# CONFIG_NLS_CODEPAGE_865 is not set
664# CONFIG_NLS_CODEPAGE_866 is not set
665# CONFIG_NLS_CODEPAGE_869 is not set
666# CONFIG_NLS_CODEPAGE_936 is not set
667# CONFIG_NLS_CODEPAGE_950 is not set
668# CONFIG_NLS_CODEPAGE_932 is not set
669# CONFIG_NLS_CODEPAGE_949 is not set
670# CONFIG_NLS_CODEPAGE_874 is not set
671# CONFIG_NLS_ISO8859_8 is not set
672# CONFIG_NLS_CODEPAGE_1250 is not set
673# CONFIG_NLS_CODEPAGE_1251 is not set
674CONFIG_NLS_ASCII=y
675CONFIG_NLS_ISO8859_1=y
676# CONFIG_NLS_ISO8859_2 is not set
677# CONFIG_NLS_ISO8859_3 is not set
678# CONFIG_NLS_ISO8859_4 is not set
679# CONFIG_NLS_ISO8859_5 is not set
680# CONFIG_NLS_ISO8859_6 is not set
681# CONFIG_NLS_ISO8859_7 is not set
682# CONFIG_NLS_ISO8859_9 is not set
683# CONFIG_NLS_ISO8859_13 is not set
684# CONFIG_NLS_ISO8859_14 is not set
685# CONFIG_NLS_ISO8859_15 is not set
686# CONFIG_NLS_KOI8_R is not set
687# CONFIG_NLS_KOI8_U is not set
688CONFIG_NLS_UTF8=y
689
690#
691# IBM 40x options
692#
693
694#
695# Library routines
696#
697# CONFIG_CRC_CCITT is not set
698# CONFIG_CRC16 is not set
699CONFIG_CRC32=y
700# CONFIG_LIBCRC32C is not set
701# CONFIG_PROFILING is not set
702
703#
704# Kernel hacking
705#
706CONFIG_PRINTK_TIME=y
707CONFIG_MAGIC_SYSRQ=y
708CONFIG_DEBUG_KERNEL=y
709CONFIG_LOG_BUF_SHIFT=14
710CONFIG_DETECT_SOFTLOCKUP=y
711# CONFIG_SCHEDSTATS is not set
712# CONFIG_DEBUG_SLAB is not set
713CONFIG_DEBUG_MUTEXES=y
714# CONFIG_DEBUG_SPINLOCK is not set
715# CONFIG_DEBUG_SPINLOCK_SLEEP is not set
716# CONFIG_DEBUG_KOBJECT is not set
717CONFIG_DEBUG_INFO=y
718# CONFIG_DEBUG_FS is not set
719# CONFIG_DEBUG_VM is not set
720CONFIG_FORCED_INLINING=y
721# CONFIG_RCU_TORTURE_TEST is not set
722# CONFIG_KGDB is not set
723CONFIG_XMON=y
724# CONFIG_BDI_SWITCH is not set
725# CONFIG_SERIAL_TEXT_DEBUG is not set
726
727#
728# Security options
729#
730# CONFIG_KEYS is not set
731# CONFIG_SECURITY is not set
732
733#
734# Cryptographic options
735#
736# CONFIG_CRYPTO is not set
737
738#
739# Hardware crypto devices
740#
diff --git a/arch/ppc/configs/pmac_defconfig b/arch/ppc/configs/pmac_defconfig
deleted file mode 100644
index a2db8b541c9b..000000000000
--- a/arch/ppc/configs/pmac_defconfig
+++ /dev/null
@@ -1,1591 +0,0 @@
1#
2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.13-rc3
4# Wed Jul 13 14:13:13 2005
5#
6CONFIG_MMU=y
7CONFIG_GENERIC_HARDIRQS=y
8CONFIG_RWSEM_XCHGADD_ALGORITHM=y
9CONFIG_GENERIC_CALIBRATE_DELAY=y
10CONFIG_HAVE_DEC_LOCK=y
11CONFIG_PPC=y
12CONFIG_PPC32=y
13CONFIG_GENERIC_NVRAM=y
14CONFIG_SCHED_NO_NO_OMIT_FRAME_POINTER=y
15
16#
17# Code maturity level options
18#
19CONFIG_EXPERIMENTAL=y
20CONFIG_CLEAN_COMPILE=y
21CONFIG_BROKEN_ON_SMP=y
22CONFIG_INIT_ENV_ARG_LIMIT=32
23
24#
25# General setup
26#
27CONFIG_LOCALVERSION=""
28CONFIG_SWAP=y
29CONFIG_SYSVIPC=y
30CONFIG_POSIX_MQUEUE=y
31# CONFIG_BSD_PROCESS_ACCT is not set
32CONFIG_SYSCTL=y
33# CONFIG_AUDIT is not set
34CONFIG_HOTPLUG=y
35CONFIG_KOBJECT_UEVENT=y
36CONFIG_IKCONFIG=y
37CONFIG_IKCONFIG_PROC=y
38# CONFIG_EMBEDDED is not set
39CONFIG_KALLSYMS=y
40# CONFIG_KALLSYMS_ALL is not set
41# CONFIG_KALLSYMS_EXTRA_PASS is not set
42CONFIG_PRINTK=y
43CONFIG_BUG=y
44CONFIG_BASE_FULL=y
45CONFIG_FUTEX=y
46CONFIG_EPOLL=y
47CONFIG_SHMEM=y
48CONFIG_CC_ALIGN_FUNCTIONS=0
49CONFIG_CC_ALIGN_LABELS=0
50CONFIG_CC_ALIGN_LOOPS=0
51CONFIG_CC_ALIGN_JUMPS=0
52# CONFIG_TINY_SHMEM is not set
53CONFIG_BASE_SMALL=0
54
55#
56# Loadable module support
57#
58CONFIG_MODULES=y
59CONFIG_MODULE_UNLOAD=y
60# CONFIG_MODULE_FORCE_UNLOAD is not set
61CONFIG_OBSOLETE_MODPARM=y
62CONFIG_MODVERSIONS=y
63CONFIG_MODULE_SRCVERSION_ALL=y
64CONFIG_KMOD=y
65
66#
67# Processor
68#
69CONFIG_6xx=y
70# CONFIG_40x is not set
71# CONFIG_44x is not set
72# CONFIG_POWER3 is not set
73# CONFIG_POWER4 is not set
74# CONFIG_8xx is not set
75# CONFIG_E200 is not set
76# CONFIG_E500 is not set
77CONFIG_PPC_FPU=y
78CONFIG_ALTIVEC=y
79CONFIG_TAU=y
80# CONFIG_TAU_INT is not set
81# CONFIG_TAU_AVERAGE is not set
82# CONFIG_KEXEC is not set
83CONFIG_CPU_FREQ=y
84CONFIG_CPU_FREQ_TABLE=y
85# CONFIG_CPU_FREQ_DEBUG is not set
86CONFIG_CPU_FREQ_STAT=m
87CONFIG_CPU_FREQ_STAT_DETAILS=y
88CONFIG_CPU_FREQ_DEFAULT_GOV_PERFORMANCE=y
89# CONFIG_CPU_FREQ_DEFAULT_GOV_USERSPACE is not set
90CONFIG_CPU_FREQ_GOV_PERFORMANCE=y
91CONFIG_CPU_FREQ_GOV_POWERSAVE=m
92CONFIG_CPU_FREQ_GOV_USERSPACE=m
93CONFIG_CPU_FREQ_GOV_ONDEMAND=m
94CONFIG_CPU_FREQ_GOV_CONSERVATIVE=m
95CONFIG_CPU_FREQ_PMAC=y
96CONFIG_PPC601_SYNC_FIX=y
97CONFIG_PM=y
98CONFIG_PPC_STD_MMU=y
99
100#
101# Platform options
102#
103CONFIG_PPC_MULTIPLATFORM=y
104# CONFIG_APUS is not set
105# CONFIG_KATANA is not set
106# CONFIG_WILLOW is not set
107# CONFIG_CPCI690 is not set
108# CONFIG_PCORE is not set
109# CONFIG_POWERPMC250 is not set
110# CONFIG_CHESTNUT is not set
111# CONFIG_SPRUCE is not set
112# CONFIG_HDPU is not set
113# CONFIG_EV64260 is not set
114# CONFIG_LOPEC is not set
115# CONFIG_MCPN765 is not set
116# CONFIG_MVME5100 is not set
117# CONFIG_PPLUS is not set
118# CONFIG_PRPMC750 is not set
119# CONFIG_PRPMC800 is not set
120# CONFIG_SANDPOINT is not set
121# CONFIG_RADSTONE_PPC7D is not set
122# CONFIG_ADIR is not set
123# CONFIG_K2 is not set
124# CONFIG_PAL4 is not set
125# CONFIG_GEMINI is not set
126# CONFIG_EST8260 is not set
127# CONFIG_SBC82xx is not set
128# CONFIG_SBS8260 is not set
129# CONFIG_RPX8260 is not set
130# CONFIG_TQM8260 is not set
131# CONFIG_ADS8272 is not set
132# CONFIG_PQ2FADS is not set
133# CONFIG_LITE5200 is not set
134# CONFIG_MPC834x_SYS is not set
135CONFIG_PPC_CHRP=y
136CONFIG_PPC_PMAC=y
137CONFIG_PPC_PREP=y
138CONFIG_PPC_OF=y
139CONFIG_PPCBUG_NVRAM=y
140# CONFIG_SMP is not set
141# CONFIG_HIGHMEM is not set
142# CONFIG_HZ_100 is not set
143CONFIG_HZ_250=y
144# CONFIG_HZ_1000 is not set
145CONFIG_HZ=250
146CONFIG_PREEMPT_NONE=y
147# CONFIG_PREEMPT_VOLUNTARY is not set
148# CONFIG_PREEMPT is not set
149CONFIG_SELECT_MEMORY_MODEL=y
150CONFIG_FLATMEM_MANUAL=y
151# CONFIG_DISCONTIGMEM_MANUAL is not set
152# CONFIG_SPARSEMEM_MANUAL is not set
153CONFIG_FLATMEM=y
154CONFIG_FLAT_NODE_MEM_MAP=y
155CONFIG_BINFMT_ELF=y
156CONFIG_BINFMT_MISC=m
157CONFIG_PROC_DEVICETREE=y
158# CONFIG_PREP_RESIDUAL is not set
159# CONFIG_CMDLINE_BOOL is not set
160# CONFIG_PM_DEBUG is not set
161CONFIG_SOFTWARE_SUSPEND=y
162CONFIG_PM_STD_PARTITION=""
163# CONFIG_SECCOMP is not set
164CONFIG_ISA_DMA_API=y
165
166#
167# Bus options
168#
169# CONFIG_ISA is not set
170CONFIG_GENERIC_ISA_DMA=y
171CONFIG_PCI=y
172CONFIG_PCI_DOMAINS=y
173CONFIG_PCI_LEGACY_PROC=y
174CONFIG_PCI_NAMES=y
175# CONFIG_PCI_DEBUG is not set
176
177#
178# PCCARD (PCMCIA/CardBus) support
179#
180CONFIG_PCCARD=m
181# CONFIG_PCMCIA_DEBUG is not set
182CONFIG_PCMCIA=m
183# CONFIG_PCMCIA_LOAD_CIS is not set
184# CONFIG_PCMCIA_IOCTL is not set
185CONFIG_CARDBUS=y
186
187#
188# PC-card bridges
189#
190CONFIG_YENTA=m
191# CONFIG_PD6729 is not set
192# CONFIG_I82092 is not set
193# CONFIG_TCIC is not set
194CONFIG_PCCARD_NONSTATIC=m
195
196#
197# Advanced setup
198#
199CONFIG_ADVANCED_OPTIONS=y
200CONFIG_HIGHMEM_START=0xfe000000
201# CONFIG_LOWMEM_SIZE_BOOL is not set
202CONFIG_LOWMEM_SIZE=0x30000000
203# CONFIG_KERNEL_START_BOOL is not set
204CONFIG_KERNEL_START=0xc0000000
205CONFIG_TASK_SIZE_BOOL=y
206CONFIG_TASK_SIZE=0xc0000000
207CONFIG_BOOT_LOAD=0x00800000
208
209#
210# Networking
211#
212CONFIG_NET=y
213
214#
215# Networking options
216#
217CONFIG_PACKET=y
218# CONFIG_PACKET_MMAP is not set
219CONFIG_UNIX=y
220# CONFIG_NET_KEY is not set
221CONFIG_INET=y
222CONFIG_IP_MULTICAST=y
223# CONFIG_IP_ADVANCED_ROUTER is not set
224CONFIG_IP_FIB_HASH=y
225# CONFIG_IP_PNP is not set
226# CONFIG_NET_IPIP is not set
227# CONFIG_NET_IPGRE is not set
228# CONFIG_IP_MROUTE is not set
229# CONFIG_ARPD is not set
230CONFIG_SYN_COOKIES=y
231# CONFIG_INET_AH is not set
232# CONFIG_INET_ESP is not set
233# CONFIG_INET_IPCOMP is not set
234# CONFIG_INET_TUNNEL is not set
235CONFIG_IP_TCPDIAG=y
236# CONFIG_IP_TCPDIAG_IPV6 is not set
237# CONFIG_TCP_CONG_ADVANCED is not set
238CONFIG_TCP_CONG_BIC=y
239
240#
241# IP: Virtual Server Configuration
242#
243# CONFIG_IP_VS is not set
244# CONFIG_IPV6 is not set
245CONFIG_NETFILTER=y
246# CONFIG_NETFILTER_DEBUG is not set
247
248#
249# IP: Netfilter Configuration
250#
251CONFIG_IP_NF_CONNTRACK=m
252CONFIG_IP_NF_CT_ACCT=y
253CONFIG_IP_NF_CONNTRACK_MARK=y
254CONFIG_IP_NF_CT_PROTO_SCTP=m
255CONFIG_IP_NF_FTP=m
256CONFIG_IP_NF_IRC=m
257CONFIG_IP_NF_TFTP=m
258CONFIG_IP_NF_AMANDA=m
259CONFIG_IP_NF_QUEUE=m
260CONFIG_IP_NF_IPTABLES=m
261CONFIG_IP_NF_MATCH_LIMIT=m
262CONFIG_IP_NF_MATCH_IPRANGE=m
263CONFIG_IP_NF_MATCH_MAC=m
264CONFIG_IP_NF_MATCH_PKTTYPE=m
265CONFIG_IP_NF_MATCH_MARK=m
266CONFIG_IP_NF_MATCH_MULTIPORT=m
267CONFIG_IP_NF_MATCH_TOS=m
268CONFIG_IP_NF_MATCH_RECENT=m
269CONFIG_IP_NF_MATCH_ECN=m
270CONFIG_IP_NF_MATCH_DSCP=m
271CONFIG_IP_NF_MATCH_AH_ESP=m
272CONFIG_IP_NF_MATCH_LENGTH=m
273CONFIG_IP_NF_MATCH_TTL=m
274CONFIG_IP_NF_MATCH_TCPMSS=m
275CONFIG_IP_NF_MATCH_HELPER=m
276CONFIG_IP_NF_MATCH_STATE=m
277CONFIG_IP_NF_MATCH_CONNTRACK=m
278CONFIG_IP_NF_MATCH_OWNER=m
279CONFIG_IP_NF_MATCH_ADDRTYPE=m
280CONFIG_IP_NF_MATCH_REALM=m
281CONFIG_IP_NF_MATCH_SCTP=m
282CONFIG_IP_NF_MATCH_COMMENT=m
283CONFIG_IP_NF_MATCH_CONNMARK=m
284CONFIG_IP_NF_MATCH_HASHLIMIT=m
285CONFIG_IP_NF_FILTER=m
286CONFIG_IP_NF_TARGET_REJECT=m
287CONFIG_IP_NF_TARGET_LOG=m
288CONFIG_IP_NF_TARGET_ULOG=m
289CONFIG_IP_NF_TARGET_TCPMSS=m
290CONFIG_IP_NF_NAT=m
291CONFIG_IP_NF_NAT_NEEDED=y
292CONFIG_IP_NF_TARGET_MASQUERADE=m
293CONFIG_IP_NF_TARGET_REDIRECT=m
294CONFIG_IP_NF_TARGET_NETMAP=m
295CONFIG_IP_NF_TARGET_SAME=m
296CONFIG_IP_NF_NAT_SNMP_BASIC=m
297CONFIG_IP_NF_NAT_IRC=m
298CONFIG_IP_NF_NAT_FTP=m
299CONFIG_IP_NF_NAT_TFTP=m
300CONFIG_IP_NF_NAT_AMANDA=m
301CONFIG_IP_NF_MANGLE=m
302CONFIG_IP_NF_TARGET_TOS=m
303CONFIG_IP_NF_TARGET_ECN=m
304CONFIG_IP_NF_TARGET_DSCP=m
305CONFIG_IP_NF_TARGET_MARK=m
306CONFIG_IP_NF_TARGET_CLASSIFY=m
307CONFIG_IP_NF_TARGET_CONNMARK=m
308CONFIG_IP_NF_TARGET_CLUSTERIP=m
309CONFIG_IP_NF_RAW=m
310CONFIG_IP_NF_TARGET_NOTRACK=m
311CONFIG_IP_NF_ARPTABLES=m
312CONFIG_IP_NF_ARPFILTER=m
313CONFIG_IP_NF_ARP_MANGLE=m
314
315#
316# SCTP Configuration (EXPERIMENTAL)
317#
318# CONFIG_IP_SCTP is not set
319# CONFIG_ATM is not set
320# CONFIG_BRIDGE is not set
321# CONFIG_VLAN_8021Q is not set
322# CONFIG_DECNET is not set
323# CONFIG_LLC2 is not set
324# CONFIG_IPX is not set
325# CONFIG_ATALK is not set
326# CONFIG_X25 is not set
327# CONFIG_LAPB is not set
328# CONFIG_NET_DIVERT is not set
329# CONFIG_ECONET is not set
330# CONFIG_WAN_ROUTER is not set
331# CONFIG_NET_SCHED is not set
332CONFIG_NET_CLS_ROUTE=y
333
334#
335# Network testing
336#
337# CONFIG_NET_PKTGEN is not set
338CONFIG_NETPOLL=y
339# CONFIG_NETPOLL_RX is not set
340# CONFIG_NETPOLL_TRAP is not set
341CONFIG_NET_POLL_CONTROLLER=y
342# CONFIG_HAMRADIO is not set
343CONFIG_IRDA=m
344
345#
346# IrDA protocols
347#
348CONFIG_IRLAN=m
349CONFIG_IRNET=m
350CONFIG_IRCOMM=m
351# CONFIG_IRDA_ULTRA is not set
352
353#
354# IrDA options
355#
356CONFIG_IRDA_CACHE_LAST_LSAP=y
357CONFIG_IRDA_FAST_RR=y
358# CONFIG_IRDA_DEBUG is not set
359
360#
361# Infrared-port device drivers
362#
363
364#
365# SIR device drivers
366#
367CONFIG_IRTTY_SIR=m
368
369#
370# Dongle support
371#
372# CONFIG_DONGLE is not set
373
374#
375# Old SIR device drivers
376#
377# CONFIG_IRPORT_SIR is not set
378
379#
380# Old Serial dongle support
381#
382
383#
384# FIR device drivers
385#
386# CONFIG_USB_IRDA is not set
387# CONFIG_SIGMATEL_FIR is not set
388# CONFIG_NSC_FIR is not set
389# CONFIG_WINBOND_FIR is not set
390# CONFIG_TOSHIBA_FIR is not set
391# CONFIG_SMC_IRCC_FIR is not set
392# CONFIG_ALI_FIR is not set
393# CONFIG_VLSI_FIR is not set
394# CONFIG_VIA_FIR is not set
395# CONFIG_BT is not set
396
397#
398# Device Drivers
399#
400
401#
402# Generic Driver Options
403#
404# CONFIG_STANDALONE is not set
405CONFIG_PREVENT_FIRMWARE_BUILD=y
406CONFIG_FW_LOADER=m
407# CONFIG_DEBUG_DRIVER is not set
408
409#
410# Memory Technology Devices (MTD)
411#
412# CONFIG_MTD is not set
413
414#
415# Parallel port support
416#
417# CONFIG_PARPORT is not set
418
419#
420# Plug and Play support
421#
422
423#
424# Block devices
425#
426# CONFIG_BLK_DEV_FD is not set
427CONFIG_MAC_FLOPPY=m
428# CONFIG_BLK_CPQ_DA is not set
429# CONFIG_BLK_CPQ_CISS_DA is not set
430# CONFIG_BLK_DEV_DAC960 is not set
431# CONFIG_BLK_DEV_UMEM is not set
432# CONFIG_BLK_DEV_COW_COMMON is not set
433CONFIG_BLK_DEV_LOOP=y
434# CONFIG_BLK_DEV_CRYPTOLOOP is not set
435# CONFIG_BLK_DEV_NBD is not set
436# CONFIG_BLK_DEV_SX8 is not set
437# CONFIG_BLK_DEV_UB is not set
438CONFIG_BLK_DEV_RAM=y
439CONFIG_BLK_DEV_RAM_COUNT=16
440CONFIG_BLK_DEV_RAM_SIZE=4096
441CONFIG_BLK_DEV_INITRD=y
442CONFIG_INITRAMFS_SOURCE=""
443CONFIG_LBD=y
444CONFIG_CDROM_PKTCDVD=m
445CONFIG_CDROM_PKTCDVD_BUFFERS=8
446# CONFIG_CDROM_PKTCDVD_WCACHE is not set
447
448#
449# IO Schedulers
450#
451CONFIG_IOSCHED_NOOP=y
452CONFIG_IOSCHED_AS=y
453CONFIG_IOSCHED_DEADLINE=y
454CONFIG_IOSCHED_CFQ=y
455# CONFIG_ATA_OVER_ETH is not set
456
457#
458# ATA/ATAPI/MFM/RLL support
459#
460CONFIG_IDE=y
461CONFIG_BLK_DEV_IDE=y
462
463#
464# Please see Documentation/ide.txt for help/info on IDE drives
465#
466# CONFIG_BLK_DEV_IDE_SATA is not set
467CONFIG_BLK_DEV_IDEDISK=y
468# CONFIG_IDEDISK_MULTI_MODE is not set
469# CONFIG_BLK_DEV_IDECS is not set
470CONFIG_BLK_DEV_IDECD=y
471# CONFIG_BLK_DEV_IDETAPE is not set
472CONFIG_BLK_DEV_IDEFLOPPY=y
473CONFIG_BLK_DEV_IDESCSI=y
474# CONFIG_IDE_TASK_IOCTL is not set
475
476#
477# IDE chipset support/bugfixes
478#
479# CONFIG_IDE_GENERIC is not set
480CONFIG_BLK_DEV_IDEPCI=y
481CONFIG_IDEPCI_SHARE_IRQ=y
482# CONFIG_BLK_DEV_OFFBOARD is not set
483CONFIG_BLK_DEV_GENERIC=y
484# CONFIG_BLK_DEV_OPTI621 is not set
485# CONFIG_BLK_DEV_SL82C105 is not set
486CONFIG_BLK_DEV_IDEDMA_PCI=y
487# CONFIG_BLK_DEV_IDEDMA_FORCED is not set
488CONFIG_IDEDMA_PCI_AUTO=y
489# CONFIG_IDEDMA_ONLYDISK is not set
490# CONFIG_BLK_DEV_AEC62XX is not set
491# CONFIG_BLK_DEV_ALI15X3 is not set
492# CONFIG_BLK_DEV_AMD74XX is not set
493CONFIG_BLK_DEV_CMD64X=y
494# CONFIG_BLK_DEV_TRIFLEX is not set
495# CONFIG_BLK_DEV_CY82C693 is not set
496# CONFIG_BLK_DEV_CS5520 is not set
497# CONFIG_BLK_DEV_CS5530 is not set
498# CONFIG_BLK_DEV_HPT34X is not set
499# CONFIG_BLK_DEV_HPT366 is not set
500# CONFIG_BLK_DEV_SC1200 is not set
501# CONFIG_BLK_DEV_PIIX is not set
502# CONFIG_BLK_DEV_IT821X is not set
503# CONFIG_BLK_DEV_NS87415 is not set
504# CONFIG_BLK_DEV_PDC202XX_OLD is not set
505CONFIG_BLK_DEV_PDC202XX_NEW=y
506# CONFIG_PDC202XX_FORCE is not set
507# CONFIG_BLK_DEV_SVWKS is not set
508# CONFIG_BLK_DEV_SIIMAGE is not set
509# CONFIG_BLK_DEV_SLC90E66 is not set
510# CONFIG_BLK_DEV_TRM290 is not set
511# CONFIG_BLK_DEV_VIA82CXXX is not set
512CONFIG_BLK_DEV_IDE_PMAC=y
513CONFIG_BLK_DEV_IDE_PMAC_ATA100FIRST=y
514CONFIG_BLK_DEV_IDEDMA_PMAC=y
515CONFIG_BLK_DEV_IDE_PMAC_BLINK=y
516# CONFIG_IDE_ARM is not set
517CONFIG_BLK_DEV_IDEDMA=y
518# CONFIG_IDEDMA_IVB is not set
519CONFIG_IDEDMA_AUTO=y
520# CONFIG_BLK_DEV_HD is not set
521
522#
523# SCSI device support
524#
525CONFIG_SCSI=y
526CONFIG_SCSI_PROC_FS=y
527
528#
529# SCSI support type (disk, tape, CD-ROM)
530#
531CONFIG_BLK_DEV_SD=y
532CONFIG_CHR_DEV_ST=y
533# CONFIG_CHR_DEV_OSST is not set
534CONFIG_BLK_DEV_SR=y
535CONFIG_BLK_DEV_SR_VENDOR=y
536CONFIG_CHR_DEV_SG=y
537# CONFIG_CHR_DEV_SCH is not set
538
539#
540# Some SCSI devices (e.g. CD jukebox) support multiple LUNs
541#
542# CONFIG_SCSI_MULTI_LUN is not set
543CONFIG_SCSI_CONSTANTS=y
544# CONFIG_SCSI_LOGGING is not set
545
546#
547# SCSI Transport Attributes
548#
549CONFIG_SCSI_SPI_ATTRS=y
550# CONFIG_SCSI_FC_ATTRS is not set
551# CONFIG_SCSI_ISCSI_ATTRS is not set
552
553#
554# SCSI low-level drivers
555#
556# CONFIG_BLK_DEV_3W_XXXX_RAID is not set
557# CONFIG_SCSI_3W_9XXX is not set
558# CONFIG_SCSI_ACARD is not set
559# CONFIG_SCSI_AACRAID is not set
560CONFIG_SCSI_AIC7XXX=m
561CONFIG_AIC7XXX_CMDS_PER_DEVICE=253
562CONFIG_AIC7XXX_RESET_DELAY_MS=15000
563CONFIG_AIC7XXX_DEBUG_ENABLE=y
564CONFIG_AIC7XXX_DEBUG_MASK=0
565CONFIG_AIC7XXX_REG_PRETTY_PRINT=y
566CONFIG_SCSI_AIC7XXX_OLD=m
567# CONFIG_SCSI_AIC79XX is not set
568# CONFIG_SCSI_DPT_I2O is not set
569# CONFIG_MEGARAID_NEWGEN is not set
570# CONFIG_MEGARAID_LEGACY is not set
571# CONFIG_SCSI_SATA is not set
572# CONFIG_SCSI_BUSLOGIC is not set
573# CONFIG_SCSI_DMX3191D is not set
574# CONFIG_SCSI_EATA is not set
575# CONFIG_SCSI_FUTURE_DOMAIN is not set
576# CONFIG_SCSI_GDTH is not set
577# CONFIG_SCSI_IPS is not set
578# CONFIG_SCSI_INITIO is not set
579# CONFIG_SCSI_INIA100 is not set
580CONFIG_SCSI_SYM53C8XX_2=y
581CONFIG_SCSI_SYM53C8XX_DMA_ADDRESSING_MODE=0
582CONFIG_SCSI_SYM53C8XX_DEFAULT_TAGS=16
583CONFIG_SCSI_SYM53C8XX_MAX_TAGS=64
584# CONFIG_SCSI_SYM53C8XX_IOMAPPED is not set
585# CONFIG_SCSI_IPR is not set
586# CONFIG_SCSI_QLOGIC_FC is not set
587# CONFIG_SCSI_QLOGIC_1280 is not set
588CONFIG_SCSI_QLA2XXX=y
589# CONFIG_SCSI_QLA21XX is not set
590# CONFIG_SCSI_QLA22XX is not set
591# CONFIG_SCSI_QLA2300 is not set
592# CONFIG_SCSI_QLA2322 is not set
593# CONFIG_SCSI_QLA6312 is not set
594# CONFIG_SCSI_LPFC is not set
595# CONFIG_SCSI_DC395x is not set
596# CONFIG_SCSI_DC390T is not set
597# CONFIG_SCSI_NSP32 is not set
598# CONFIG_SCSI_DEBUG is not set
599CONFIG_SCSI_MESH=y
600CONFIG_SCSI_MESH_SYNC_RATE=5
601CONFIG_SCSI_MESH_RESET_DELAY_MS=1000
602CONFIG_SCSI_MAC53C94=y
603
604#
605# PCMCIA SCSI adapter support
606#
607# CONFIG_PCMCIA_AHA152X is not set
608# CONFIG_PCMCIA_FDOMAIN is not set
609# CONFIG_PCMCIA_NINJA_SCSI is not set
610# CONFIG_PCMCIA_QLOGIC is not set
611# CONFIG_PCMCIA_SYM53C500 is not set
612
613#
614# Multi-device support (RAID and LVM)
615#
616# CONFIG_MD is not set
617
618#
619# Fusion MPT device support
620#
621# CONFIG_FUSION is not set
622# CONFIG_FUSION_SPI is not set
623# CONFIG_FUSION_FC is not set
624
625#
626# IEEE 1394 (FireWire) support
627#
628CONFIG_IEEE1394=m
629
630#
631# Subsystem Options
632#
633# CONFIG_IEEE1394_VERBOSEDEBUG is not set
634# CONFIG_IEEE1394_OUI_DB is not set
635CONFIG_IEEE1394_EXTRA_CONFIG_ROMS=y
636CONFIG_IEEE1394_CONFIG_ROM_IP1394=y
637# CONFIG_IEEE1394_EXPORT_FULL_API is not set
638
639#
640# Device Drivers
641#
642# CONFIG_IEEE1394_PCILYNX is not set
643CONFIG_IEEE1394_OHCI1394=m
644
645#
646# Protocol Drivers
647#
648CONFIG_IEEE1394_VIDEO1394=m
649CONFIG_IEEE1394_SBP2=m
650# CONFIG_IEEE1394_SBP2_PHYS_DMA is not set
651CONFIG_IEEE1394_ETH1394=m
652CONFIG_IEEE1394_DV1394=m
653CONFIG_IEEE1394_RAWIO=m
654CONFIG_IEEE1394_CMP=m
655CONFIG_IEEE1394_AMDTP=m
656
657#
658# I2O device support
659#
660# CONFIG_I2O is not set
661
662#
663# Macintosh device drivers
664#
665CONFIG_ADB=y
666CONFIG_ADB_CUDA=y
667CONFIG_ADB_PMU=y
668CONFIG_PMAC_APM_EMU=y
669CONFIG_PMAC_MEDIABAY=y
670CONFIG_PMAC_BACKLIGHT=y
671CONFIG_ADB_MACIO=y
672CONFIG_INPUT_ADBHID=y
673CONFIG_MAC_EMUMOUSEBTN=y
674CONFIG_THERM_WINDTUNNEL=m
675CONFIG_THERM_ADT746X=m
676# CONFIG_ANSLCD is not set
677
678#
679# Network device support
680#
681CONFIG_NETDEVICES=y
682# CONFIG_DUMMY is not set
683# CONFIG_BONDING is not set
684# CONFIG_EQUALIZER is not set
685CONFIG_TUN=m
686
687#
688# ARCnet devices
689#
690# CONFIG_ARCNET is not set
691
692#
693# Ethernet (10 or 100Mbit)
694#
695CONFIG_NET_ETHERNET=y
696CONFIG_MII=y
697CONFIG_MACE=y
698# CONFIG_MACE_AAUI_PORT is not set
699CONFIG_BMAC=y
700# CONFIG_HAPPYMEAL is not set
701CONFIG_SUNGEM=y
702# CONFIG_NET_VENDOR_3COM is not set
703
704#
705# Tulip family network device support
706#
707# CONFIG_NET_TULIP is not set
708# CONFIG_HP100 is not set
709CONFIG_NET_PCI=y
710CONFIG_PCNET32=y
711# CONFIG_AMD8111_ETH is not set
712# CONFIG_ADAPTEC_STARFIRE is not set
713# CONFIG_B44 is not set
714# CONFIG_FORCEDETH is not set
715# CONFIG_DGRS is not set
716# CONFIG_EEPRO100 is not set
717# CONFIG_E100 is not set
718# CONFIG_FEALNX is not set
719# CONFIG_NATSEMI is not set
720# CONFIG_NE2K_PCI is not set
721# CONFIG_8139CP is not set
722# CONFIG_8139TOO is not set
723# CONFIG_SIS900 is not set
724# CONFIG_EPIC100 is not set
725# CONFIG_SUNDANCE is not set
726# CONFIG_TLAN is not set
727# CONFIG_VIA_RHINE is not set
728
729#
730# Ethernet (1000 Mbit)
731#
732# CONFIG_ACENIC is not set
733# CONFIG_DL2K is not set
734# CONFIG_E1000 is not set
735# CONFIG_NS83820 is not set
736# CONFIG_HAMACHI is not set
737# CONFIG_YELLOWFIN is not set
738# CONFIG_R8169 is not set
739# CONFIG_SKGE is not set
740# CONFIG_SK98LIN is not set
741# CONFIG_VIA_VELOCITY is not set
742# CONFIG_TIGON3 is not set
743# CONFIG_BNX2 is not set
744# CONFIG_MV643XX_ETH is not set
745
746#
747# Ethernet (10000 Mbit)
748#
749# CONFIG_IXGB is not set
750# CONFIG_S2IO is not set
751
752#
753# Token Ring devices
754#
755# CONFIG_TR is not set
756
757#
758# Wireless LAN (non-hamradio)
759#
760CONFIG_NET_RADIO=y
761
762#
763# Obsolete Wireless cards support (pre-802.11)
764#
765# CONFIG_STRIP is not set
766# CONFIG_PCMCIA_WAVELAN is not set
767# CONFIG_PCMCIA_NETWAVE is not set
768
769#
770# Wireless 802.11 Frequency Hopping cards support
771#
772# CONFIG_PCMCIA_RAYCS is not set
773
774#
775# Wireless 802.11b ISA/PCI cards support
776#
777CONFIG_HERMES=m
778CONFIG_APPLE_AIRPORT=m
779# CONFIG_PLX_HERMES is not set
780# CONFIG_TMD_HERMES is not set
781# CONFIG_PCI_HERMES is not set
782# CONFIG_ATMEL is not set
783
784#
785# Wireless 802.11b Pcmcia/Cardbus cards support
786#
787CONFIG_PCMCIA_HERMES=m
788# CONFIG_AIRO_CS is not set
789# CONFIG_PCMCIA_WL3501 is not set
790
791#
792# Prism GT/Duette 802.11(a/b/g) PCI/Cardbus support
793#
794# CONFIG_PRISM54 is not set
795CONFIG_NET_WIRELESS=y
796
797#
798# PCMCIA network device support
799#
800# CONFIG_NET_PCMCIA is not set
801
802#
803# Wan interfaces
804#
805# CONFIG_WAN is not set
806# CONFIG_FDDI is not set
807# CONFIG_HIPPI is not set
808CONFIG_PPP=y
809CONFIG_PPP_MULTILINK=y
810# CONFIG_PPP_FILTER is not set
811CONFIG_PPP_ASYNC=y
812CONFIG_PPP_SYNC_TTY=m
813CONFIG_PPP_DEFLATE=y
814CONFIG_PPP_BSDCOMP=m
815CONFIG_PPPOE=m
816# CONFIG_SLIP is not set
817# CONFIG_NET_FC is not set
818# CONFIG_SHAPER is not set
819CONFIG_NETCONSOLE=m
820
821#
822# ISDN subsystem
823#
824# CONFIG_ISDN is not set
825
826#
827# Telephony Support
828#
829# CONFIG_PHONE is not set
830
831#
832# Input device support
833#
834CONFIG_INPUT=y
835
836#
837# Userland interfaces
838#
839CONFIG_INPUT_MOUSEDEV=y
840# CONFIG_INPUT_MOUSEDEV_PSAUX is not set
841CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024
842CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768
843# CONFIG_INPUT_JOYDEV is not set
844# CONFIG_INPUT_TSDEV is not set
845CONFIG_INPUT_EVDEV=y
846# CONFIG_INPUT_EVBUG is not set
847
848#
849# Input Device Drivers
850#
851CONFIG_INPUT_KEYBOARD=y
852# CONFIG_KEYBOARD_ATKBD is not set
853# CONFIG_KEYBOARD_SUNKBD is not set
854# CONFIG_KEYBOARD_LKKBD is not set
855# CONFIG_KEYBOARD_XTKBD is not set
856# CONFIG_KEYBOARD_NEWTON is not set
857CONFIG_INPUT_MOUSE=y
858# CONFIG_MOUSE_PS2 is not set
859# CONFIG_MOUSE_SERIAL is not set
860# CONFIG_MOUSE_VSXXXAA is not set
861# CONFIG_INPUT_JOYSTICK is not set
862# CONFIG_INPUT_TOUCHSCREEN is not set
863# CONFIG_INPUT_MISC is not set
864
865#
866# Hardware I/O ports
867#
868# CONFIG_SERIO is not set
869# CONFIG_GAMEPORT is not set
870
871#
872# Character devices
873#
874CONFIG_VT=y
875CONFIG_VT_CONSOLE=y
876CONFIG_HW_CONSOLE=y
877# CONFIG_SERIAL_NONSTANDARD is not set
878
879#
880# Serial drivers
881#
882CONFIG_SERIAL_8250=m
883CONFIG_SERIAL_8250_CS=m
884CONFIG_SERIAL_8250_NR_UARTS=4
885# CONFIG_SERIAL_8250_EXTENDED is not set
886
887#
888# Non-8250 serial port support
889#
890CONFIG_SERIAL_CORE=y
891CONFIG_SERIAL_CORE_CONSOLE=y
892CONFIG_SERIAL_PMACZILOG=y
893CONFIG_SERIAL_PMACZILOG_CONSOLE=y
894# CONFIG_SERIAL_JSM is not set
895CONFIG_UNIX98_PTYS=y
896CONFIG_LEGACY_PTYS=y
897CONFIG_LEGACY_PTY_COUNT=256
898
899#
900# IPMI
901#
902# CONFIG_IPMI_HANDLER is not set
903
904#
905# Watchdog Cards
906#
907# CONFIG_WATCHDOG is not set
908CONFIG_NVRAM=y
909CONFIG_GEN_RTC=y
910# CONFIG_GEN_RTC_X is not set
911# CONFIG_DTLK is not set
912# CONFIG_R3964 is not set
913# CONFIG_APPLICOM is not set
914
915#
916# Ftape, the floppy tape device driver
917#
918CONFIG_AGP=m
919CONFIG_AGP_UNINORTH=m
920CONFIG_DRM=m
921# CONFIG_DRM_TDFX is not set
922CONFIG_DRM_R128=m
923CONFIG_DRM_RADEON=m
924# CONFIG_DRM_MGA is not set
925# CONFIG_DRM_SIS is not set
926# CONFIG_DRM_VIA is not set
927
928#
929# PCMCIA character devices
930#
931# CONFIG_SYNCLINK_CS is not set
932# CONFIG_RAW_DRIVER is not set
933
934#
935# TPM devices
936#
937# CONFIG_TCG_TPM is not set
938
939#
940# I2C support
941#
942CONFIG_I2C=y
943CONFIG_I2C_CHARDEV=m
944
945#
946# I2C Algorithms
947#
948CONFIG_I2C_ALGOBIT=y
949# CONFIG_I2C_ALGOPCF is not set
950# CONFIG_I2C_ALGOPCA is not set
951
952#
953# I2C Hardware Bus support
954#
955# CONFIG_I2C_ALI1535 is not set
956# CONFIG_I2C_ALI1563 is not set
957# CONFIG_I2C_ALI15X3 is not set
958# CONFIG_I2C_AMD756 is not set
959# CONFIG_I2C_AMD8111 is not set
960# CONFIG_I2C_HYDRA is not set
961# CONFIG_I2C_I801 is not set
962# CONFIG_I2C_I810 is not set
963# CONFIG_I2C_PIIX4 is not set
964# CONFIG_I2C_ISA is not set
965CONFIG_I2C_KEYWEST=m
966# CONFIG_I2C_MPC is not set
967# CONFIG_I2C_NFORCE2 is not set
968# CONFIG_I2C_PARPORT_LIGHT is not set
969# CONFIG_I2C_PROSAVAGE is not set
970# CONFIG_I2C_SAVAGE4 is not set
971# CONFIG_SCx200_ACB is not set
972# CONFIG_I2C_SIS5595 is not set
973# CONFIG_I2C_SIS630 is not set
974# CONFIG_I2C_SIS96X is not set
975# CONFIG_I2C_STUB is not set
976# CONFIG_I2C_VIA is not set
977# CONFIG_I2C_VIAPRO is not set
978# CONFIG_I2C_VOODOO3 is not set
979# CONFIG_I2C_PCA_ISA is not set
980# CONFIG_I2C_SENSOR is not set
981
982#
983# Miscellaneous I2C Chip support
984#
985# CONFIG_SENSORS_DS1337 is not set
986# CONFIG_SENSORS_DS1374 is not set
987# CONFIG_SENSORS_EEPROM is not set
988# CONFIG_SENSORS_PCF8574 is not set
989# CONFIG_SENSORS_PCA9539 is not set
990# CONFIG_SENSORS_PCF8591 is not set
991# CONFIG_SENSORS_RTC8564 is not set
992# CONFIG_SENSORS_M41T00 is not set
993# CONFIG_SENSORS_MAX6875 is not set
994# CONFIG_I2C_DEBUG_CORE is not set
995# CONFIG_I2C_DEBUG_ALGO is not set
996# CONFIG_I2C_DEBUG_BUS is not set
997# CONFIG_I2C_DEBUG_CHIP is not set
998
999#
1000# Dallas's 1-wire bus
1001#
1002# CONFIG_W1 is not set
1003
1004#
1005# Hardware Monitoring support
1006#
1007# CONFIG_HWMON is not set
1008
1009#
1010# Misc devices
1011#
1012
1013#
1014# Multimedia devices
1015#
1016# CONFIG_VIDEO_DEV is not set
1017
1018#
1019# Digital Video Broadcasting Devices
1020#
1021# CONFIG_DVB is not set
1022
1023#
1024# Graphics support
1025#
1026CONFIG_FB=y
1027CONFIG_FB_CFB_FILLRECT=y
1028CONFIG_FB_CFB_COPYAREA=y
1029CONFIG_FB_CFB_IMAGEBLIT=y
1030CONFIG_FB_SOFT_CURSOR=y
1031CONFIG_FB_MACMODES=y
1032CONFIG_FB_MODE_HELPERS=y
1033CONFIG_FB_TILEBLITTING=y
1034# CONFIG_FB_CIRRUS is not set
1035# CONFIG_FB_PM2 is not set
1036# CONFIG_FB_CYBER2000 is not set
1037CONFIG_FB_OF=y
1038CONFIG_FB_CONTROL=y
1039CONFIG_FB_PLATINUM=y
1040CONFIG_FB_VALKYRIE=y
1041CONFIG_FB_CT65550=y
1042# CONFIG_FB_ASILIANT is not set
1043CONFIG_FB_IMSTT=y
1044# CONFIG_FB_VGA16 is not set
1045# CONFIG_FB_NVIDIA is not set
1046# CONFIG_FB_RIVA is not set
1047CONFIG_FB_MATROX=y
1048CONFIG_FB_MATROX_MILLENIUM=y
1049CONFIG_FB_MATROX_MYSTIQUE=y
1050CONFIG_FB_MATROX_G=y
1051# CONFIG_FB_MATROX_I2C is not set
1052# CONFIG_FB_MATROX_MULTIHEAD is not set
1053# CONFIG_FB_RADEON_OLD is not set
1054CONFIG_FB_RADEON=y
1055CONFIG_FB_RADEON_I2C=y
1056# CONFIG_FB_RADEON_DEBUG is not set
1057CONFIG_FB_ATY128=y
1058CONFIG_FB_ATY=y
1059CONFIG_FB_ATY_CT=y
1060CONFIG_FB_ATY_GENERIC_LCD=y
1061# CONFIG_FB_ATY_XL_INIT is not set
1062CONFIG_FB_ATY_GX=y
1063# CONFIG_FB_SAVAGE is not set
1064# CONFIG_FB_SIS is not set
1065# CONFIG_FB_NEOMAGIC is not set
1066# CONFIG_FB_KYRO is not set
1067CONFIG_FB_3DFX=y
1068CONFIG_FB_3DFX_ACCEL=y
1069# CONFIG_FB_VOODOO1 is not set
1070# CONFIG_FB_TRIDENT is not set
1071# CONFIG_FB_S1D13XXX is not set
1072# CONFIG_FB_VIRTUAL is not set
1073
1074#
1075# Console display driver support
1076#
1077# CONFIG_VGA_CONSOLE is not set
1078CONFIG_DUMMY_CONSOLE=y
1079CONFIG_FRAMEBUFFER_CONSOLE=y
1080# CONFIG_FONTS is not set
1081CONFIG_FONT_8x8=y
1082CONFIG_FONT_8x16=y
1083
1084#
1085# Logo configuration
1086#
1087CONFIG_LOGO=y
1088CONFIG_LOGO_LINUX_MONO=y
1089CONFIG_LOGO_LINUX_VGA16=y
1090CONFIG_LOGO_LINUX_CLUT224=y
1091CONFIG_BACKLIGHT_LCD_SUPPORT=y
1092CONFIG_BACKLIGHT_CLASS_DEVICE=y
1093CONFIG_BACKLIGHT_DEVICE=y
1094CONFIG_LCD_CLASS_DEVICE=y
1095CONFIG_LCD_DEVICE=y
1096
1097#
1098# Sound
1099#
1100CONFIG_SOUND=m
1101CONFIG_DMASOUND_PMAC=m
1102CONFIG_DMASOUND=m
1103
1104#
1105# Advanced Linux Sound Architecture
1106#
1107CONFIG_SND=m
1108CONFIG_SND_TIMER=m
1109CONFIG_SND_PCM=m
1110CONFIG_SND_HWDEP=m
1111CONFIG_SND_RAWMIDI=m
1112CONFIG_SND_SEQUENCER=m
1113CONFIG_SND_SEQ_DUMMY=m
1114CONFIG_SND_OSSEMUL=y
1115CONFIG_SND_MIXER_OSS=m
1116CONFIG_SND_PCM_OSS=m
1117CONFIG_SND_SEQUENCER_OSS=y
1118# CONFIG_SND_VERBOSE_PRINTK is not set
1119# CONFIG_SND_DEBUG is not set
1120
1121#
1122# Generic devices
1123#
1124CONFIG_SND_DUMMY=m
1125# CONFIG_SND_VIRMIDI is not set
1126# CONFIG_SND_MTPAV is not set
1127# CONFIG_SND_SERIAL_U16550 is not set
1128# CONFIG_SND_MPU401 is not set
1129
1130#
1131# PCI devices
1132#
1133# CONFIG_SND_ALI5451 is not set
1134# CONFIG_SND_ATIIXP is not set
1135# CONFIG_SND_ATIIXP_MODEM is not set
1136# CONFIG_SND_AU8810 is not set
1137# CONFIG_SND_AU8820 is not set
1138# CONFIG_SND_AU8830 is not set
1139# CONFIG_SND_AZT3328 is not set
1140# CONFIG_SND_BT87X is not set
1141# CONFIG_SND_CS46XX is not set
1142# CONFIG_SND_CS4281 is not set
1143# CONFIG_SND_EMU10K1 is not set
1144# CONFIG_SND_EMU10K1X is not set
1145# CONFIG_SND_CA0106 is not set
1146# CONFIG_SND_KORG1212 is not set
1147# CONFIG_SND_MIXART is not set
1148# CONFIG_SND_NM256 is not set
1149# CONFIG_SND_RME32 is not set
1150# CONFIG_SND_RME96 is not set
1151# CONFIG_SND_RME9652 is not set
1152# CONFIG_SND_HDSP is not set
1153# CONFIG_SND_HDSPM is not set
1154# CONFIG_SND_TRIDENT is not set
1155# CONFIG_SND_YMFPCI is not set
1156# CONFIG_SND_ALS4000 is not set
1157# CONFIG_SND_CMIPCI is not set
1158# CONFIG_SND_ENS1370 is not set
1159# CONFIG_SND_ENS1371 is not set
1160# CONFIG_SND_ES1938 is not set
1161# CONFIG_SND_ES1968 is not set
1162# CONFIG_SND_MAESTRO3 is not set
1163# CONFIG_SND_FM801 is not set
1164# CONFIG_SND_ICE1712 is not set
1165# CONFIG_SND_ICE1724 is not set
1166# CONFIG_SND_INTEL8X0 is not set
1167# CONFIG_SND_INTEL8X0M is not set
1168# CONFIG_SND_SONICVIBES is not set
1169# CONFIG_SND_VIA82XX is not set
1170# CONFIG_SND_VIA82XX_MODEM is not set
1171# CONFIG_SND_VX222 is not set
1172# CONFIG_SND_HDA_INTEL is not set
1173
1174#
1175# ALSA PowerMac devices
1176#
1177CONFIG_SND_POWERMAC=m
1178
1179#
1180# USB devices
1181#
1182CONFIG_SND_USB_AUDIO=m
1183CONFIG_SND_USB_USX2Y=m
1184
1185#
1186# PCMCIA devices
1187#
1188
1189#
1190# Open Sound System
1191#
1192# CONFIG_SOUND_PRIME is not set
1193
1194#
1195# USB support
1196#
1197CONFIG_USB_ARCH_HAS_HCD=y
1198CONFIG_USB_ARCH_HAS_OHCI=y
1199CONFIG_USB=y
1200# CONFIG_USB_DEBUG is not set
1201
1202#
1203# Miscellaneous USB options
1204#
1205CONFIG_USB_DEVICEFS=y
1206# CONFIG_USB_BANDWIDTH is not set
1207CONFIG_USB_DYNAMIC_MINORS=y
1208CONFIG_USB_SUSPEND=y
1209# CONFIG_USB_OTG is not set
1210
1211#
1212# USB Host Controller Drivers
1213#
1214# CONFIG_USB_EHCI_HCD is not set
1215# CONFIG_USB_ISP116X_HCD is not set
1216CONFIG_USB_OHCI_HCD=y
1217# CONFIG_USB_OHCI_BIG_ENDIAN is not set
1218CONFIG_USB_OHCI_LITTLE_ENDIAN=y
1219# CONFIG_USB_UHCI_HCD is not set
1220# CONFIG_USB_SL811_HCD is not set
1221
1222#
1223# USB Device Class drivers
1224#
1225# CONFIG_USB_AUDIO is not set
1226# CONFIG_USB_BLUETOOTH_TTY is not set
1227# CONFIG_USB_MIDI is not set
1228CONFIG_USB_ACM=m
1229CONFIG_USB_PRINTER=m
1230
1231#
1232# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support' may also be needed; see USB_STORAGE Help for more information
1233#
1234# CONFIG_USB_STORAGE is not set
1235
1236#
1237# USB Input Devices
1238#
1239CONFIG_USB_HID=y
1240CONFIG_USB_HIDINPUT=y
1241# CONFIG_HID_FF is not set
1242CONFIG_USB_HIDDEV=y
1243# CONFIG_USB_AIPTEK is not set
1244# CONFIG_USB_WACOM is not set
1245# CONFIG_USB_ACECAD is not set
1246# CONFIG_USB_KBTAB is not set
1247# CONFIG_USB_POWERMATE is not set
1248# CONFIG_USB_MTOUCH is not set
1249# CONFIG_USB_ITMTOUCH is not set
1250# CONFIG_USB_EGALAX is not set
1251# CONFIG_USB_XPAD is not set
1252# CONFIG_USB_ATI_REMOTE is not set
1253# CONFIG_USB_KEYSPAN_REMOTE is not set
1254
1255#
1256# USB Imaging devices
1257#
1258# CONFIG_USB_MDC800 is not set
1259# CONFIG_USB_MICROTEK is not set
1260
1261#
1262# USB Multimedia devices
1263#
1264# CONFIG_USB_DABUSB is not set
1265
1266#
1267# Video4Linux support is needed for USB Multimedia device support
1268#
1269
1270#
1271# USB Network Adapters
1272#
1273# CONFIG_USB_CATC is not set
1274# CONFIG_USB_KAWETH is not set
1275CONFIG_USB_PEGASUS=m
1276# CONFIG_USB_RTL8150 is not set
1277# CONFIG_USB_USBNET is not set
1278# CONFIG_USB_ZD1201 is not set
1279# CONFIG_USB_MON is not set
1280
1281#
1282# USB port drivers
1283#
1284
1285#
1286# USB Serial Converter support
1287#
1288CONFIG_USB_SERIAL=m
1289# CONFIG_USB_SERIAL_GENERIC is not set
1290# CONFIG_USB_SERIAL_AIRPRIME is not set
1291# CONFIG_USB_SERIAL_BELKIN is not set
1292# CONFIG_USB_SERIAL_WHITEHEAT is not set
1293# CONFIG_USB_SERIAL_DIGI_ACCELEPORT is not set
1294# CONFIG_USB_SERIAL_CP2101 is not set
1295# CONFIG_USB_SERIAL_CYPRESS_M8 is not set
1296# CONFIG_USB_SERIAL_EMPEG is not set
1297# CONFIG_USB_SERIAL_FTDI_SIO is not set
1298CONFIG_USB_SERIAL_VISOR=m
1299# CONFIG_USB_SERIAL_IPAQ is not set
1300# CONFIG_USB_SERIAL_IR is not set
1301# CONFIG_USB_SERIAL_EDGEPORT is not set
1302# CONFIG_USB_SERIAL_EDGEPORT_TI is not set
1303# CONFIG_USB_SERIAL_GARMIN is not set
1304# CONFIG_USB_SERIAL_IPW is not set
1305# CONFIG_USB_SERIAL_KEYSPAN_PDA is not set
1306CONFIG_USB_SERIAL_KEYSPAN=m
1307CONFIG_USB_SERIAL_KEYSPAN_MPR=y
1308CONFIG_USB_SERIAL_KEYSPAN_USA28=y
1309CONFIG_USB_SERIAL_KEYSPAN_USA28X=y
1310CONFIG_USB_SERIAL_KEYSPAN_USA28XA=y
1311CONFIG_USB_SERIAL_KEYSPAN_USA28XB=y
1312CONFIG_USB_SERIAL_KEYSPAN_USA19=y
1313CONFIG_USB_SERIAL_KEYSPAN_USA18X=y
1314CONFIG_USB_SERIAL_KEYSPAN_USA19W=y
1315CONFIG_USB_SERIAL_KEYSPAN_USA19QW=y
1316CONFIG_USB_SERIAL_KEYSPAN_USA19QI=y
1317CONFIG_USB_SERIAL_KEYSPAN_USA49W=y
1318CONFIG_USB_SERIAL_KEYSPAN_USA49WLC=y
1319# CONFIG_USB_SERIAL_KLSI is not set
1320# CONFIG_USB_SERIAL_KOBIL_SCT is not set
1321# CONFIG_USB_SERIAL_MCT_U232 is not set
1322# CONFIG_USB_SERIAL_PL2303 is not set
1323# CONFIG_USB_SERIAL_HP4X is not set
1324# CONFIG_USB_SERIAL_SAFE is not set
1325# CONFIG_USB_SERIAL_TI is not set
1326# CONFIG_USB_SERIAL_CYBERJACK is not set
1327# CONFIG_USB_SERIAL_XIRCOM is not set
1328# CONFIG_USB_SERIAL_OPTION is not set
1329# CONFIG_USB_SERIAL_OMNINET is not set
1330CONFIG_USB_EZUSB=y
1331
1332#
1333# USB Miscellaneous drivers
1334#
1335# CONFIG_USB_EMI62 is not set
1336# CONFIG_USB_EMI26 is not set
1337# CONFIG_USB_AUERSWALD is not set
1338# CONFIG_USB_RIO500 is not set
1339# CONFIG_USB_LEGOTOWER is not set
1340# CONFIG_USB_LCD is not set
1341# CONFIG_USB_LED is not set
1342# CONFIG_USB_CYTHERM is not set
1343# CONFIG_USB_PHIDGETKIT is not set
1344# CONFIG_USB_PHIDGETSERVO is not set
1345# CONFIG_USB_IDMOUSE is not set
1346# CONFIG_USB_LD is not set
1347# CONFIG_USB_TEST is not set
1348
1349#
1350# USB DSL modem support
1351#
1352
1353#
1354# USB Gadget Support
1355#
1356# CONFIG_USB_GADGET is not set
1357
1358#
1359# MMC/SD Card support
1360#
1361# CONFIG_MMC is not set
1362
1363#
1364# InfiniBand support
1365#
1366# CONFIG_INFINIBAND is not set
1367
1368#
1369# SN Devices
1370#
1371
1372#
1373# File systems
1374#
1375CONFIG_EXT2_FS=y
1376CONFIG_EXT2_FS_XATTR=y
1377# CONFIG_EXT2_FS_POSIX_ACL is not set
1378# CONFIG_EXT2_FS_SECURITY is not set
1379# CONFIG_EXT2_FS_XIP is not set
1380CONFIG_EXT3_FS=y
1381CONFIG_EXT3_FS_XATTR=y
1382# CONFIG_EXT3_FS_POSIX_ACL is not set
1383# CONFIG_EXT3_FS_SECURITY is not set
1384CONFIG_JBD=y
1385# CONFIG_JBD_DEBUG is not set
1386CONFIG_FS_MBCACHE=y
1387# CONFIG_REISERFS_FS is not set
1388# CONFIG_JFS_FS is not set
1389CONFIG_FS_POSIX_ACL=y
1390
1391#
1392# XFS support
1393#
1394# CONFIG_XFS_FS is not set
1395# CONFIG_MINIX_FS is not set
1396# CONFIG_ROMFS_FS is not set
1397CONFIG_INOTIFY=y
1398# CONFIG_QUOTA is not set
1399CONFIG_DNOTIFY=y
1400# CONFIG_AUTOFS_FS is not set
1401# CONFIG_AUTOFS4_FS is not set
1402
1403#
1404# CD-ROM/DVD Filesystems
1405#
1406CONFIG_ISO9660_FS=y
1407# CONFIG_JOLIET is not set
1408# CONFIG_ZISOFS is not set
1409CONFIG_UDF_FS=m
1410CONFIG_UDF_NLS=y
1411
1412#
1413# DOS/FAT/NT Filesystems
1414#
1415CONFIG_FAT_FS=m
1416CONFIG_MSDOS_FS=m
1417CONFIG_VFAT_FS=m
1418CONFIG_FAT_DEFAULT_CODEPAGE=437
1419CONFIG_FAT_DEFAULT_IOCHARSET="iso8859-1"
1420# CONFIG_NTFS_FS is not set
1421
1422#
1423# Pseudo filesystems
1424#
1425CONFIG_PROC_FS=y
1426CONFIG_PROC_KCORE=y
1427CONFIG_SYSFS=y
1428CONFIG_DEVPTS_FS_XATTR=y
1429CONFIG_DEVPTS_FS_SECURITY=y
1430CONFIG_TMPFS=y
1431CONFIG_TMPFS_XATTR=y
1432CONFIG_TMPFS_SECURITY=y
1433# CONFIG_HUGETLB_PAGE is not set
1434CONFIG_RAMFS=y
1435
1436#
1437# Miscellaneous filesystems
1438#
1439# CONFIG_ADFS_FS is not set
1440# CONFIG_AFFS_FS is not set
1441CONFIG_HFS_FS=m
1442CONFIG_HFSPLUS_FS=m
1443# CONFIG_BEFS_FS is not set
1444# CONFIG_BFS_FS is not set
1445# CONFIG_EFS_FS is not set
1446CONFIG_CRAMFS=m
1447# CONFIG_VXFS_FS is not set
1448# CONFIG_HPFS_FS is not set
1449# CONFIG_QNX4FS_FS is not set
1450# CONFIG_SYSV_FS is not set
1451# CONFIG_UFS_FS is not set
1452
1453#
1454# Network File Systems
1455#
1456CONFIG_NFS_FS=y
1457CONFIG_NFS_V3=y
1458CONFIG_NFS_V3_ACL=y
1459# CONFIG_NFS_V4 is not set
1460# CONFIG_NFS_DIRECTIO is not set
1461CONFIG_NFSD=y
1462CONFIG_NFSD_V2_ACL=y
1463CONFIG_NFSD_V3=y
1464CONFIG_NFSD_V3_ACL=y
1465# CONFIG_NFSD_V4 is not set
1466CONFIG_NFSD_TCP=y
1467CONFIG_LOCKD=y
1468CONFIG_LOCKD_V4=y
1469CONFIG_EXPORTFS=y
1470CONFIG_NFS_ACL_SUPPORT=y
1471CONFIG_NFS_COMMON=y
1472CONFIG_SUNRPC=y
1473# CONFIG_RPCSEC_GSS_KRB5 is not set
1474# CONFIG_RPCSEC_GSS_SPKM3 is not set
1475CONFIG_SMB_FS=m
1476# CONFIG_SMB_NLS_DEFAULT is not set
1477# CONFIG_CIFS is not set
1478# CONFIG_NCP_FS is not set
1479# CONFIG_CODA_FS is not set
1480# CONFIG_AFS_FS is not set
1481
1482#
1483# Partition Types
1484#
1485CONFIG_PARTITION_ADVANCED=y
1486# CONFIG_ACORN_PARTITION is not set
1487# CONFIG_OSF_PARTITION is not set
1488# CONFIG_AMIGA_PARTITION is not set
1489# CONFIG_ATARI_PARTITION is not set
1490CONFIG_MAC_PARTITION=y
1491CONFIG_MSDOS_PARTITION=y
1492# CONFIG_BSD_DISKLABEL is not set
1493# CONFIG_MINIX_SUBPARTITION is not set
1494# CONFIG_SOLARIS_X86_PARTITION is not set
1495# CONFIG_UNIXWARE_DISKLABEL is not set
1496# CONFIG_LDM_PARTITION is not set
1497# CONFIG_SGI_PARTITION is not set
1498# CONFIG_ULTRIX_PARTITION is not set
1499# CONFIG_SUN_PARTITION is not set
1500# CONFIG_EFI_PARTITION is not set
1501
1502#
1503# Native Language Support
1504#
1505CONFIG_NLS=y
1506CONFIG_NLS_DEFAULT="iso8859-1"
1507# CONFIG_NLS_CODEPAGE_437 is not set
1508# CONFIG_NLS_CODEPAGE_737 is not set
1509# CONFIG_NLS_CODEPAGE_775 is not set
1510# CONFIG_NLS_CODEPAGE_850 is not set
1511# CONFIG_NLS_CODEPAGE_852 is not set
1512# CONFIG_NLS_CODEPAGE_855 is not set
1513# CONFIG_NLS_CODEPAGE_857 is not set
1514# CONFIG_NLS_CODEPAGE_860 is not set
1515# CONFIG_NLS_CODEPAGE_861 is not set
1516# CONFIG_NLS_CODEPAGE_862 is not set
1517# CONFIG_NLS_CODEPAGE_863 is not set
1518# CONFIG_NLS_CODEPAGE_864 is not set
1519# CONFIG_NLS_CODEPAGE_865 is not set
1520# CONFIG_NLS_CODEPAGE_866 is not set
1521# CONFIG_NLS_CODEPAGE_869 is not set
1522# CONFIG_NLS_CODEPAGE_936 is not set
1523# CONFIG_NLS_CODEPAGE_950 is not set
1524# CONFIG_NLS_CODEPAGE_932 is not set
1525# CONFIG_NLS_CODEPAGE_949 is not set
1526# CONFIG_NLS_CODEPAGE_874 is not set
1527# CONFIG_NLS_ISO8859_8 is not set
1528CONFIG_NLS_CODEPAGE_1250=m
1529CONFIG_NLS_CODEPAGE_1251=m
1530CONFIG_NLS_ASCII=m
1531CONFIG_NLS_ISO8859_1=m
1532# CONFIG_NLS_ISO8859_2 is not set
1533# CONFIG_NLS_ISO8859_3 is not set
1534# CONFIG_NLS_ISO8859_4 is not set
1535# CONFIG_NLS_ISO8859_5 is not set
1536# CONFIG_NLS_ISO8859_6 is not set
1537# CONFIG_NLS_ISO8859_7 is not set
1538# CONFIG_NLS_ISO8859_9 is not set
1539# CONFIG_NLS_ISO8859_13 is not set
1540# CONFIG_NLS_ISO8859_14 is not set
1541CONFIG_NLS_ISO8859_15=m
1542# CONFIG_NLS_KOI8_R is not set
1543# CONFIG_NLS_KOI8_U is not set
1544CONFIG_NLS_UTF8=m
1545
1546#
1547# Library routines
1548#
1549CONFIG_CRC_CCITT=y
1550CONFIG_CRC32=y
1551# CONFIG_LIBCRC32C is not set
1552CONFIG_ZLIB_INFLATE=y
1553CONFIG_ZLIB_DEFLATE=y
1554
1555#
1556# Profiling support
1557#
1558# CONFIG_PROFILING is not set
1559
1560#
1561# Kernel hacking
1562#
1563# CONFIG_PRINTK_TIME is not set
1564CONFIG_DEBUG_KERNEL=y
1565CONFIG_MAGIC_SYSRQ=y
1566CONFIG_LOG_BUF_SHIFT=16
1567# CONFIG_SCHEDSTATS is not set
1568# CONFIG_DEBUG_SLAB is not set
1569# CONFIG_DEBUG_SPINLOCK is not set
1570# CONFIG_DEBUG_SPINLOCK_SLEEP is not set
1571# CONFIG_DEBUG_KOBJECT is not set
1572# CONFIG_DEBUG_INFO is not set
1573# CONFIG_DEBUG_FS is not set
1574# CONFIG_XMON is not set
1575# CONFIG_BDI_SWITCH is not set
1576CONFIG_BOOTX_TEXT=y
1577
1578#
1579# Security options
1580#
1581# CONFIG_KEYS is not set
1582# CONFIG_SECURITY is not set
1583
1584#
1585# Cryptographic options
1586#
1587# CONFIG_CRYPTO is not set
1588
1589#
1590# Hardware crypto devices
1591#
diff --git a/arch/ppc/configs/power3_defconfig b/arch/ppc/configs/power3_defconfig
deleted file mode 100644
index a1ef929bca59..000000000000
--- a/arch/ppc/configs/power3_defconfig
+++ /dev/null
@@ -1,1035 +0,0 @@
1#
2# Automatically generated make config: don't edit
3#
4CONFIG_MMU=y
5CONFIG_RWSEM_XCHGADD_ALGORITHM=y
6CONFIG_HAVE_DEC_LOCK=y
7CONFIG_PPC=y
8CONFIG_PPC32=y
9CONFIG_GENERIC_NVRAM=y
10
11#
12# Code maturity level options
13#
14CONFIG_EXPERIMENTAL=y
15CONFIG_CLEAN_COMPILE=y
16# CONFIG_STANDALONE is not set
17
18#
19# General setup
20#
21CONFIG_SWAP=y
22CONFIG_SYSVIPC=y
23CONFIG_POSIX_MQUEUE=y
24# CONFIG_BSD_PROCESS_ACCT is not set
25CONFIG_SYSCTL=y
26# CONFIG_AUDIT is not set
27CONFIG_LOG_BUF_SHIFT=15
28# CONFIG_HOTPLUG is not set
29CONFIG_IKCONFIG=y
30CONFIG_IKCONFIG_PROC=y
31# CONFIG_EMBEDDED is not set
32CONFIG_KALLSYMS=y
33CONFIG_FUTEX=y
34CONFIG_EPOLL=y
35CONFIG_IOSCHED_NOOP=y
36CONFIG_IOSCHED_AS=y
37CONFIG_IOSCHED_DEADLINE=y
38CONFIG_IOSCHED_CFQ=y
39# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
40
41#
42# Loadable module support
43#
44CONFIG_MODULES=y
45CONFIG_MODULE_UNLOAD=y
46CONFIG_MODULE_FORCE_UNLOAD=y
47CONFIG_OBSOLETE_MODPARM=y
48# CONFIG_MODVERSIONS is not set
49CONFIG_KMOD=y
50CONFIG_STOP_MACHINE=y
51
52#
53# Processor
54#
55# CONFIG_6xx is not set
56# CONFIG_40x is not set
57# CONFIG_44x is not set
58CONFIG_POWER3=y
59# CONFIG_POWER4 is not set
60# CONFIG_8xx is not set
61# CONFIG_CPU_FREQ is not set
62CONFIG_PPC64BRIDGE=y
63CONFIG_PPC_STD_MMU=y
64
65#
66# Platform options
67#
68CONFIG_PPC_MULTIPLATFORM=y
69# CONFIG_APUS is not set
70# CONFIG_WILLOW is not set
71# CONFIG_PCORE is not set
72# CONFIG_POWERPMC250 is not set
73# CONFIG_EV64260 is not set
74# CONFIG_SPRUCE is not set
75# CONFIG_LOPEC is not set
76# CONFIG_MCPN765 is not set
77# CONFIG_MVME5100 is not set
78# CONFIG_PPLUS is not set
79# CONFIG_PRPMC750 is not set
80# CONFIG_PRPMC800 is not set
81# CONFIG_SANDPOINT is not set
82# CONFIG_ADIR is not set
83# CONFIG_K2 is not set
84# CONFIG_PAL4 is not set
85# CONFIG_GEMINI is not set
86# CONFIG_EST8260 is not set
87# CONFIG_SBS8260 is not set
88# CONFIG_RPX6 is not set
89# CONFIG_TQM8260 is not set
90CONFIG_PPC_CHRP=y
91CONFIG_PPC_PMAC=y
92CONFIG_PPC_PREP=y
93CONFIG_PPC_OF=y
94CONFIG_PPCBUG_NVRAM=y
95CONFIG_SMP=y
96# CONFIG_IRQ_ALL_CPUS is not set
97CONFIG_NR_CPUS=32
98# CONFIG_PREEMPT is not set
99CONFIG_HIGHMEM=y
100CONFIG_KERNEL_ELF=y
101CONFIG_BINFMT_ELF=y
102CONFIG_BINFMT_MISC=y
103CONFIG_PROC_DEVICETREE=y
104CONFIG_PPC_RTAS=y
105# CONFIG_PREP_RESIDUAL is not set
106# CONFIG_CMDLINE_BOOL is not set
107
108#
109# Bus options
110#
111CONFIG_ISA=y
112CONFIG_GENERIC_ISA_DMA=y
113CONFIG_PCI=y
114CONFIG_PCI_DOMAINS=y
115CONFIG_PCI_LEGACY_PROC=y
116CONFIG_PCI_NAMES=y
117
118#
119# Advanced setup
120#
121CONFIG_ADVANCED_OPTIONS=y
122# CONFIG_HIGHMEM_START_BOOL is not set
123CONFIG_HIGHMEM_START=0xfe000000
124# CONFIG_LOWMEM_SIZE_BOOL is not set
125CONFIG_LOWMEM_SIZE=0x30000000
126# CONFIG_KERNEL_START_BOOL is not set
127CONFIG_KERNEL_START=0xc0000000
128CONFIG_TASK_SIZE_BOOL=y
129CONFIG_TASK_SIZE=0xc0000000
130CONFIG_BOOT_LOAD=0x00800000
131
132#
133# Device Drivers
134#
135
136#
137# Generic Driver Options
138#
139
140#
141# Memory Technology Devices (MTD)
142#
143# CONFIG_MTD is not set
144
145#
146# Parallel port support
147#
148CONFIG_PARPORT=m
149CONFIG_PARPORT_PC=m
150CONFIG_PARPORT_PC_CML1=m
151# CONFIG_PARPORT_SERIAL is not set
152CONFIG_PARPORT_PC_FIFO=y
153# CONFIG_PARPORT_PC_SUPERIO is not set
154# CONFIG_PARPORT_OTHER is not set
155# CONFIG_PARPORT_1284 is not set
156
157#
158# Plug and Play support
159#
160# CONFIG_PNP is not set
161
162#
163# Block devices
164#
165CONFIG_BLK_DEV_FD=y
166# CONFIG_BLK_DEV_XD is not set
167# CONFIG_PARIDE is not set
168# CONFIG_BLK_CPQ_DA is not set
169# CONFIG_BLK_CPQ_CISS_DA is not set
170# CONFIG_BLK_DEV_DAC960 is not set
171# CONFIG_BLK_DEV_UMEM is not set
172CONFIG_BLK_DEV_LOOP=y
173# CONFIG_BLK_DEV_CRYPTOLOOP is not set
174# CONFIG_BLK_DEV_NBD is not set
175# CONFIG_BLK_DEV_CARMEL is not set
176CONFIG_BLK_DEV_RAM=y
177CONFIG_BLK_DEV_RAM_SIZE=4096
178CONFIG_BLK_DEV_INITRD=y
179CONFIG_LBD=y
180
181#
182# ATA/ATAPI/MFM/RLL support
183#
184# CONFIG_IDE is not set
185
186#
187# SCSI device support
188#
189CONFIG_SCSI=y
190CONFIG_SCSI_PROC_FS=y
191
192#
193# SCSI support type (disk, tape, CD-ROM)
194#
195CONFIG_BLK_DEV_SD=y
196CONFIG_CHR_DEV_ST=y
197# CONFIG_CHR_DEV_OSST is not set
198CONFIG_BLK_DEV_SR=y
199CONFIG_BLK_DEV_SR_VENDOR=y
200CONFIG_CHR_DEV_SG=y
201
202#
203# Some SCSI devices (e.g. CD jukebox) support multiple LUNs
204#
205# CONFIG_SCSI_MULTI_LUN is not set
206# CONFIG_SCSI_REPORT_LUNS is not set
207CONFIG_SCSI_CONSTANTS=y
208CONFIG_SCSI_LOGGING=y
209
210#
211# SCSI Transport Attributes
212#
213CONFIG_SCSI_SPI_ATTRS=y
214# CONFIG_SCSI_FC_ATTRS is not set
215
216#
217# SCSI low-level drivers
218#
219# CONFIG_BLK_DEV_3W_XXXX_RAID is not set
220# CONFIG_SCSI_7000FASST is not set
221# CONFIG_SCSI_ACARD is not set
222# CONFIG_SCSI_AHA152X is not set
223# CONFIG_SCSI_AHA1542 is not set
224# CONFIG_SCSI_AACRAID is not set
225# CONFIG_SCSI_AIC7XXX is not set
226# CONFIG_SCSI_AIC7XXX_OLD is not set
227# CONFIG_SCSI_AIC79XX is not set
228# CONFIG_SCSI_ADVANSYS is not set
229# CONFIG_SCSI_IN2000 is not set
230# CONFIG_SCSI_MEGARAID is not set
231# CONFIG_SCSI_SATA is not set
232# CONFIG_SCSI_BUSLOGIC is not set
233# CONFIG_SCSI_CPQFCTS is not set
234# CONFIG_SCSI_DMX3191D is not set
235# CONFIG_SCSI_DTC3280 is not set
236# CONFIG_SCSI_EATA is not set
237# CONFIG_SCSI_EATA_PIO is not set
238# CONFIG_SCSI_FUTURE_DOMAIN is not set
239# CONFIG_SCSI_GDTH is not set
240# CONFIG_SCSI_GENERIC_NCR5380 is not set
241# CONFIG_SCSI_GENERIC_NCR5380_MMIO is not set
242# CONFIG_SCSI_IPS is not set
243# CONFIG_SCSI_INIA100 is not set
244# CONFIG_SCSI_PPA is not set
245# CONFIG_SCSI_IMM is not set
246# CONFIG_SCSI_NCR53C406A is not set
247CONFIG_SCSI_SYM53C8XX_2=y
248CONFIG_SCSI_SYM53C8XX_DMA_ADDRESSING_MODE=1
249CONFIG_SCSI_SYM53C8XX_DEFAULT_TAGS=16
250CONFIG_SCSI_SYM53C8XX_MAX_TAGS=64
251# CONFIG_SCSI_SYM53C8XX_IOMAPPED is not set
252# CONFIG_SCSI_IPR is not set
253# CONFIG_SCSI_PAS16 is not set
254# CONFIG_SCSI_PSI240I is not set
255# CONFIG_SCSI_QLOGIC_FAS is not set
256# CONFIG_SCSI_QLOGIC_ISP is not set
257# CONFIG_SCSI_QLOGIC_FC is not set
258# CONFIG_SCSI_QLOGIC_1280 is not set
259CONFIG_SCSI_QLA2XXX=y
260# CONFIG_SCSI_QLA21XX is not set
261# CONFIG_SCSI_QLA22XX is not set
262# CONFIG_SCSI_QLA2300 is not set
263# CONFIG_SCSI_QLA2322 is not set
264# CONFIG_SCSI_QLA6312 is not set
265# CONFIG_SCSI_QLA6322 is not set
266# CONFIG_SCSI_SYM53C416 is not set
267# CONFIG_SCSI_DC395x is not set
268# CONFIG_SCSI_DC390T is not set
269# CONFIG_SCSI_T128 is not set
270# CONFIG_SCSI_U14_34F is not set
271# CONFIG_SCSI_NSP32 is not set
272# CONFIG_SCSI_DEBUG is not set
273# CONFIG_SCSI_MESH is not set
274# CONFIG_SCSI_MAC53C94 is not set
275
276#
277# Old CD-ROM drivers (not SCSI, not IDE)
278#
279# CONFIG_CD_NO_IDESCSI is not set
280
281#
282# Multi-device support (RAID and LVM)
283#
284CONFIG_MD=y
285CONFIG_BLK_DEV_MD=y
286CONFIG_MD_LINEAR=y
287CONFIG_MD_RAID0=y
288CONFIG_MD_RAID1=y
289CONFIG_MD_RAID5=y
290CONFIG_MD_RAID6=y
291# CONFIG_MD_MULTIPATH is not set
292CONFIG_BLK_DEV_DM=y
293CONFIG_DM_CRYPT=y
294
295#
296# Fusion MPT device support
297#
298# CONFIG_FUSION is not set
299
300#
301# IEEE 1394 (FireWire) support
302#
303# CONFIG_IEEE1394 is not set
304
305#
306# I2O device support
307#
308# CONFIG_I2O is not set
309
310#
311# Macintosh device drivers
312#
313# CONFIG_ADB is not set
314# CONFIG_ADB_CUDA is not set
315# CONFIG_ADB_PMU is not set
316# CONFIG_MAC_FLOPPY is not set
317# CONFIG_MAC_SERIAL is not set
318
319#
320# Networking support
321#
322CONFIG_NET=y
323
324#
325# Networking options
326#
327CONFIG_PACKET=y
328# CONFIG_PACKET_MMAP is not set
329# CONFIG_NETLINK_DEV is not set
330CONFIG_UNIX=y
331# CONFIG_NET_KEY is not set
332CONFIG_INET=y
333CONFIG_IP_MULTICAST=y
334# CONFIG_IP_ADVANCED_ROUTER is not set
335# CONFIG_IP_PNP is not set
336# CONFIG_NET_IPIP is not set
337# CONFIG_NET_IPGRE is not set
338# CONFIG_IP_MROUTE is not set
339# CONFIG_ARPD is not set
340CONFIG_SYN_COOKIES=y
341# CONFIG_INET_AH is not set
342# CONFIG_INET_ESP is not set
343# CONFIG_INET_IPCOMP is not set
344# CONFIG_IPV6 is not set
345# CONFIG_NETFILTER is not set
346
347#
348# SCTP Configuration (EXPERIMENTAL)
349#
350# CONFIG_IP_SCTP is not set
351# CONFIG_ATM is not set
352# CONFIG_BRIDGE is not set
353# CONFIG_VLAN_8021Q is not set
354# CONFIG_DECNET is not set
355# CONFIG_LLC2 is not set
356# CONFIG_IPX is not set
357# CONFIG_ATALK is not set
358# CONFIG_X25 is not set
359# CONFIG_LAPB is not set
360# CONFIG_NET_DIVERT is not set
361# CONFIG_ECONET is not set
362# CONFIG_WAN_ROUTER is not set
363# CONFIG_NET_HW_FLOWCONTROL is not set
364
365#
366# QoS and/or fair queueing
367#
368# CONFIG_NET_SCHED is not set
369
370#
371# Network testing
372#
373# CONFIG_NET_PKTGEN is not set
374# CONFIG_NETPOLL is not set
375# CONFIG_NET_POLL_CONTROLLER is not set
376# CONFIG_HAMRADIO is not set
377# CONFIG_IRDA is not set
378# CONFIG_BT is not set
379CONFIG_NETDEVICES=y
380# CONFIG_DUMMY is not set
381# CONFIG_BONDING is not set
382# CONFIG_EQUALIZER is not set
383# CONFIG_TUN is not set
384
385#
386# ARCnet devices
387#
388# CONFIG_ARCNET is not set
389
390#
391# Ethernet (10 or 100Mbit)
392#
393CONFIG_NET_ETHERNET=y
394CONFIG_MII=y
395# CONFIG_MACE is not set
396# CONFIG_BMAC is not set
397# CONFIG_OAKNET is not set
398# CONFIG_HAPPYMEAL is not set
399# CONFIG_SUNGEM is not set
400# CONFIG_NET_VENDOR_3COM is not set
401# CONFIG_LANCE is not set
402# CONFIG_NET_VENDOR_SMC is not set
403# CONFIG_NET_VENDOR_RACAL is not set
404
405#
406# Tulip family network device support
407#
408# CONFIG_NET_TULIP is not set
409# CONFIG_AT1700 is not set
410# CONFIG_DEPCA is not set
411# CONFIG_HP100 is not set
412# CONFIG_NET_ISA is not set
413CONFIG_NET_PCI=y
414CONFIG_PCNET32=y
415# CONFIG_AMD8111_ETH is not set
416# CONFIG_ADAPTEC_STARFIRE is not set
417# CONFIG_AC3200 is not set
418# CONFIG_APRICOT is not set
419# CONFIG_B44 is not set
420# CONFIG_FORCEDETH is not set
421# CONFIG_CS89x0 is not set
422# CONFIG_DGRS is not set
423# CONFIG_EEPRO100 is not set
424CONFIG_E100=y
425# CONFIG_E100_NAPI is not set
426# CONFIG_FEALNX is not set
427# CONFIG_NATSEMI is not set
428# CONFIG_NE2K_PCI is not set
429# CONFIG_8139CP is not set
430# CONFIG_8139TOO is not set
431# CONFIG_SIS900 is not set
432# CONFIG_EPIC100 is not set
433# CONFIG_SUNDANCE is not set
434# CONFIG_TLAN is not set
435# CONFIG_VIA_RHINE is not set
436# CONFIG_NET_POCKET is not set
437
438#
439# Ethernet (1000 Mbit)
440#
441# CONFIG_ACENIC is not set
442# CONFIG_DL2K is not set
443CONFIG_E1000=y
444# CONFIG_E1000_NAPI is not set
445# CONFIG_E1000_DISABLE_PACKET_SPLIT is not set
446# CONFIG_NS83820 is not set
447# CONFIG_HAMACHI is not set
448# CONFIG_YELLOWFIN is not set
449# CONFIG_R8169 is not set
450# CONFIG_SK98LIN is not set
451# CONFIG_TIGON3 is not set
452
453#
454# Ethernet (10000 Mbit)
455#
456# CONFIG_IXGB is not set
457# CONFIG_S2IO is not set
458
459#
460# Token Ring devices
461#
462# CONFIG_TR is not set
463
464#
465# Wireless LAN (non-hamradio)
466#
467# CONFIG_NET_RADIO is not set
468
469#
470# Wan interfaces
471#
472# CONFIG_WAN is not set
473# CONFIG_FDDI is not set
474# CONFIG_HIPPI is not set
475# CONFIG_PLIP is not set
476# CONFIG_PPP is not set
477# CONFIG_SLIP is not set
478# CONFIG_NET_FC is not set
479# CONFIG_RCPCI is not set
480# CONFIG_SHAPER is not set
481# CONFIG_NETCONSOLE is not set
482
483#
484# ISDN subsystem
485#
486# CONFIG_ISDN is not set
487
488#
489# Telephony Support
490#
491# CONFIG_PHONE is not set
492
493#
494# Input device support
495#
496CONFIG_INPUT=y
497
498#
499# Userland interfaces
500#
501CONFIG_INPUT_MOUSEDEV=y
502CONFIG_INPUT_MOUSEDEV_PSAUX=y
503CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024
504CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768
505# CONFIG_INPUT_JOYDEV is not set
506# CONFIG_INPUT_TSDEV is not set
507CONFIG_INPUT_EVDEV=y
508# CONFIG_INPUT_EVBUG is not set
509
510#
511# Input I/O drivers
512#
513CONFIG_GAMEPORT=m
514CONFIG_SOUND_GAMEPORT=m
515# CONFIG_GAMEPORT_NS558 is not set
516# CONFIG_GAMEPORT_L4 is not set
517# CONFIG_GAMEPORT_EMU10K1 is not set
518# CONFIG_GAMEPORT_VORTEX is not set
519# CONFIG_GAMEPORT_FM801 is not set
520# CONFIG_GAMEPORT_CS461x is not set
521CONFIG_SERIO=y
522CONFIG_SERIO_I8042=y
523CONFIG_SERIO_SERPORT=y
524# CONFIG_SERIO_CT82C710 is not set
525# CONFIG_SERIO_PARKBD is not set
526# CONFIG_SERIO_PCIPS2 is not set
527
528#
529# Input Device Drivers
530#
531CONFIG_INPUT_KEYBOARD=y
532CONFIG_KEYBOARD_ATKBD=y
533# CONFIG_KEYBOARD_SUNKBD is not set
534# CONFIG_KEYBOARD_LKKBD is not set
535# CONFIG_KEYBOARD_XTKBD is not set
536# CONFIG_KEYBOARD_NEWTON is not set
537CONFIG_INPUT_MOUSE=y
538CONFIG_MOUSE_PS2=y
539# CONFIG_MOUSE_SERIAL is not set
540# CONFIG_MOUSE_INPORT is not set
541# CONFIG_MOUSE_LOGIBM is not set
542# CONFIG_MOUSE_PC110PAD is not set
543# CONFIG_MOUSE_VSXXXAA is not set
544# CONFIG_INPUT_JOYSTICK is not set
545# CONFIG_INPUT_TOUCHSCREEN is not set
546CONFIG_INPUT_MISC=y
547CONFIG_INPUT_UINPUT=y
548
549#
550# Character devices
551#
552CONFIG_VT=y
553CONFIG_VT_CONSOLE=y
554CONFIG_HW_CONSOLE=y
555# CONFIG_SERIAL_NONSTANDARD is not set
556
557#
558# Serial drivers
559#
560CONFIG_SERIAL_8250=y
561CONFIG_SERIAL_8250_CONSOLE=y
562CONFIG_SERIAL_8250_NR_UARTS=4
563# CONFIG_SERIAL_8250_EXTENDED is not set
564
565#
566# Non-8250 serial port support
567#
568CONFIG_SERIAL_CORE=y
569CONFIG_SERIAL_CORE_CONSOLE=y
570# CONFIG_SERIAL_PMACZILOG is not set
571CONFIG_UNIX98_PTYS=y
572CONFIG_LEGACY_PTYS=y
573CONFIG_LEGACY_PTY_COUNT=256
574CONFIG_PRINTER=m
575# CONFIG_LP_CONSOLE is not set
576# CONFIG_PPDEV is not set
577# CONFIG_TIPAR is not set
578# CONFIG_QIC02_TAPE is not set
579
580#
581# IPMI
582#
583# CONFIG_IPMI_HANDLER is not set
584
585#
586# Watchdog Cards
587#
588# CONFIG_WATCHDOG is not set
589CONFIG_NVRAM=y
590CONFIG_GEN_RTC=y
591# CONFIG_GEN_RTC_X is not set
592# CONFIG_DTLK is not set
593# CONFIG_R3964 is not set
594# CONFIG_APPLICOM is not set
595
596#
597# Ftape, the floppy tape device driver
598#
599# CONFIG_AGP is not set
600# CONFIG_DRM is not set
601# CONFIG_RAW_DRIVER is not set
602
603#
604# I2C support
605#
606CONFIG_I2C=y
607CONFIG_I2C_CHARDEV=y
608
609#
610# I2C Algorithms
611#
612CONFIG_I2C_ALGOBIT=y
613CONFIG_I2C_ALGOPCF=y
614
615#
616# I2C Hardware Bus support
617#
618# CONFIG_I2C_ALI1535 is not set
619# CONFIG_I2C_ALI1563 is not set
620# CONFIG_I2C_ALI15X3 is not set
621# CONFIG_I2C_AMD756 is not set
622# CONFIG_I2C_AMD8111 is not set
623# CONFIG_I2C_HYDRA is not set
624# CONFIG_I2C_I801 is not set
625# CONFIG_I2C_I810 is not set
626# CONFIG_I2C_ISA is not set
627# CONFIG_I2C_KEYWEST is not set
628# CONFIG_I2C_NFORCE2 is not set
629# CONFIG_I2C_PARPORT is not set
630# CONFIG_I2C_PARPORT_LIGHT is not set
631# CONFIG_I2C_PIIX4 is not set
632# CONFIG_I2C_PROSAVAGE is not set
633# CONFIG_I2C_SAVAGE4 is not set
634# CONFIG_SCx200_ACB is not set
635# CONFIG_I2C_SIS5595 is not set
636# CONFIG_I2C_SIS630 is not set
637# CONFIG_I2C_SIS96X is not set
638# CONFIG_I2C_VIA is not set
639# CONFIG_I2C_VIAPRO is not set
640# CONFIG_I2C_VOODOO3 is not set
641
642#
643# Hardware Sensors Chip support
644#
645# CONFIG_I2C_SENSOR is not set
646# CONFIG_SENSORS_ADM1021 is not set
647# CONFIG_SENSORS_ASB100 is not set
648# CONFIG_SENSORS_DS1621 is not set
649# CONFIG_SENSORS_FSCHER is not set
650# CONFIG_SENSORS_GL518SM is not set
651# CONFIG_SENSORS_IT87 is not set
652# CONFIG_SENSORS_LM75 is not set
653# CONFIG_SENSORS_LM78 is not set
654# CONFIG_SENSORS_LM80 is not set
655# CONFIG_SENSORS_LM83 is not set
656# CONFIG_SENSORS_LM85 is not set
657# CONFIG_SENSORS_LM90 is not set
658# CONFIG_SENSORS_VIA686A is not set
659# CONFIG_SENSORS_W83781D is not set
660# CONFIG_SENSORS_W83L785TS is not set
661# CONFIG_SENSORS_W83627HF is not set
662
663#
664# Other I2C Chip support
665#
666# CONFIG_SENSORS_EEPROM is not set
667# CONFIG_SENSORS_PCF8574 is not set
668# CONFIG_SENSORS_PCF8591 is not set
669# CONFIG_I2C_DEBUG_CORE is not set
670# CONFIG_I2C_DEBUG_ALGO is not set
671# CONFIG_I2C_DEBUG_BUS is not set
672# CONFIG_I2C_DEBUG_CHIP is not set
673
674#
675# Misc devices
676#
677
678#
679# Multimedia devices
680#
681# CONFIG_VIDEO_DEV is not set
682
683#
684# Digital Video Broadcasting Devices
685#
686# CONFIG_DVB is not set
687
688#
689# Graphics support
690#
691CONFIG_FB=y
692# CONFIG_FB_PM2 is not set
693# CONFIG_FB_CYBER2000 is not set
694CONFIG_FB_OF=y
695# CONFIG_FB_CONTROL is not set
696# CONFIG_FB_PLATINUM is not set
697# CONFIG_FB_VALKYRIE is not set
698# CONFIG_FB_CT65550 is not set
699# CONFIG_FB_IMSTT is not set
700# CONFIG_FB_S3TRIO is not set
701# CONFIG_FB_VGA16 is not set
702# CONFIG_FB_RIVA is not set
703CONFIG_FB_MATROX=y
704CONFIG_FB_MATROX_MILLENIUM=y
705CONFIG_FB_MATROX_MYSTIQUE=y
706# CONFIG_FB_MATROX_G450 is not set
707CONFIG_FB_MATROX_G100A=y
708CONFIG_FB_MATROX_G100=y
709CONFIG_FB_MATROX_I2C=y
710# CONFIG_FB_MATROX_MAVEN is not set
711CONFIG_FB_MATROX_MULTIHEAD=y
712# CONFIG_FB_RADEON_OLD is not set
713# CONFIG_FB_RADEON is not set
714# CONFIG_FB_ATY128 is not set
715# CONFIG_FB_ATY is not set
716# CONFIG_FB_SIS is not set
717# CONFIG_FB_NEOMAGIC is not set
718# CONFIG_FB_KYRO is not set
719# CONFIG_FB_3DFX is not set
720# CONFIG_FB_VOODOO1 is not set
721# CONFIG_FB_TRIDENT is not set
722# CONFIG_FB_VIRTUAL is not set
723
724#
725# Console display driver support
726#
727# CONFIG_VGA_CONSOLE is not set
728# CONFIG_MDA_CONSOLE is not set
729CONFIG_DUMMY_CONSOLE=y
730CONFIG_FRAMEBUFFER_CONSOLE=y
731CONFIG_PCI_CONSOLE=y
732# CONFIG_FONTS is not set
733CONFIG_FONT_8x8=y
734CONFIG_FONT_8x16=y
735
736#
737# Logo configuration
738#
739CONFIG_LOGO=y
740CONFIG_LOGO_LINUX_MONO=y
741CONFIG_LOGO_LINUX_VGA16=y
742CONFIG_LOGO_LINUX_CLUT224=y
743
744#
745# Sound
746#
747CONFIG_SOUND=y
748# CONFIG_DMASOUND_PMAC is not set
749
750#
751# Advanced Linux Sound Architecture
752#
753CONFIG_SND=m
754CONFIG_SND_TIMER=m
755CONFIG_SND_PCM=m
756CONFIG_SND_HWDEP=m
757CONFIG_SND_RAWMIDI=m
758CONFIG_SND_SEQUENCER=m
759CONFIG_SND_SEQ_DUMMY=m
760CONFIG_SND_OSSEMUL=y
761CONFIG_SND_MIXER_OSS=m
762CONFIG_SND_PCM_OSS=m
763CONFIG_SND_SEQUENCER_OSS=y
764# CONFIG_SND_VERBOSE_PRINTK is not set
765# CONFIG_SND_DEBUG is not set
766
767#
768# Generic devices
769#
770CONFIG_SND_MPU401_UART=m
771CONFIG_SND_OPL3_LIB=m
772CONFIG_SND_DUMMY=m
773# CONFIG_SND_VIRMIDI is not set
774# CONFIG_SND_MTPAV is not set
775# CONFIG_SND_SERIAL_U16550 is not set
776# CONFIG_SND_MPU401 is not set
777
778#
779# ISA devices
780#
781# CONFIG_SND_AD1848 is not set
782# CONFIG_SND_CS4231 is not set
783CONFIG_SND_CS4232=m
784# CONFIG_SND_CS4236 is not set
785# CONFIG_SND_ES1688 is not set
786# CONFIG_SND_ES18XX is not set
787# CONFIG_SND_GUSCLASSIC is not set
788# CONFIG_SND_GUSEXTREME is not set
789# CONFIG_SND_GUSMAX is not set
790# CONFIG_SND_INTERWAVE is not set
791# CONFIG_SND_INTERWAVE_STB is not set
792# CONFIG_SND_OPTI92X_AD1848 is not set
793# CONFIG_SND_OPTI92X_CS4231 is not set
794# CONFIG_SND_OPTI93X is not set
795# CONFIG_SND_SB8 is not set
796# CONFIG_SND_SB16 is not set
797# CONFIG_SND_SBAWE is not set
798# CONFIG_SND_WAVEFRONT is not set
799# CONFIG_SND_CMI8330 is not set
800# CONFIG_SND_OPL3SA2 is not set
801# CONFIG_SND_SGALAXY is not set
802# CONFIG_SND_SSCAPE is not set
803
804#
805# PCI devices
806#
807CONFIG_SND_AC97_CODEC=m
808# CONFIG_SND_ALI5451 is not set
809# CONFIG_SND_ATIIXP is not set
810# CONFIG_SND_AU8810 is not set
811# CONFIG_SND_AU8820 is not set
812# CONFIG_SND_AU8830 is not set
813# CONFIG_SND_AZT3328 is not set
814# CONFIG_SND_BT87X is not set
815CONFIG_SND_CS46XX=m
816# CONFIG_SND_CS46XX_NEW_DSP is not set
817CONFIG_SND_CS4281=m
818# CONFIG_SND_EMU10K1 is not set
819# CONFIG_SND_KORG1212 is not set
820# CONFIG_SND_MIXART is not set
821# CONFIG_SND_NM256 is not set
822# CONFIG_SND_RME32 is not set
823# CONFIG_SND_RME96 is not set
824# CONFIG_SND_RME9652 is not set
825# CONFIG_SND_HDSP is not set
826# CONFIG_SND_TRIDENT is not set
827# CONFIG_SND_YMFPCI is not set
828# CONFIG_SND_ALS4000 is not set
829# CONFIG_SND_CMIPCI is not set
830# CONFIG_SND_ENS1370 is not set
831# CONFIG_SND_ENS1371 is not set
832# CONFIG_SND_ES1938 is not set
833# CONFIG_SND_ES1968 is not set
834# CONFIG_SND_MAESTRO3 is not set
835# CONFIG_SND_FM801 is not set
836# CONFIG_SND_ICE1712 is not set
837# CONFIG_SND_ICE1724 is not set
838# CONFIG_SND_INTEL8X0 is not set
839# CONFIG_SND_INTEL8X0M is not set
840# CONFIG_SND_SONICVIBES is not set
841# CONFIG_SND_VIA82XX is not set
842# CONFIG_SND_VX222 is not set
843
844#
845# ALSA PowerMac devices
846#
847# CONFIG_SND_POWERMAC is not set
848
849#
850# Open Sound System
851#
852# CONFIG_SOUND_PRIME is not set
853
854#
855# USB support
856#
857# CONFIG_USB is not set
858
859#
860# USB Gadget Support
861#
862# CONFIG_USB_GADGET is not set
863
864#
865# File systems
866#
867CONFIG_EXT2_FS=y
868# CONFIG_EXT2_FS_XATTR is not set
869# CONFIG_EXT3_FS is not set
870# CONFIG_JBD is not set
871# CONFIG_REISERFS_FS is not set
872# CONFIG_JFS_FS is not set
873# CONFIG_XFS_FS is not set
874# CONFIG_MINIX_FS is not set
875# CONFIG_ROMFS_FS is not set
876# CONFIG_QUOTA is not set
877# CONFIG_AUTOFS_FS is not set
878# CONFIG_AUTOFS4_FS is not set
879
880#
881# CD-ROM/DVD Filesystems
882#
883CONFIG_ISO9660_FS=y
884CONFIG_JOLIET=y
885# CONFIG_ZISOFS is not set
886# CONFIG_UDF_FS is not set
887
888#
889# DOS/FAT/NT Filesystems
890#
891CONFIG_FAT_FS=y
892CONFIG_MSDOS_FS=y
893CONFIG_VFAT_FS=y
894# CONFIG_NTFS_FS is not set
895
896#
897# Pseudo filesystems
898#
899CONFIG_PROC_FS=y
900CONFIG_PROC_KCORE=y
901CONFIG_SYSFS=y
902# CONFIG_DEVFS_FS is not set
903# CONFIG_DEVPTS_FS_XATTR is not set
904CONFIG_TMPFS=y
905# CONFIG_HUGETLB_PAGE is not set
906CONFIG_RAMFS=y
907
908#
909# Miscellaneous filesystems
910#
911# CONFIG_ADFS_FS is not set
912# CONFIG_AFFS_FS is not set
913# CONFIG_HFS_FS is not set
914# CONFIG_HFSPLUS_FS is not set
915# CONFIG_BEFS_FS is not set
916# CONFIG_BFS_FS is not set
917# CONFIG_EFS_FS is not set
918# CONFIG_CRAMFS is not set
919# CONFIG_VXFS_FS is not set
920# CONFIG_HPFS_FS is not set
921# CONFIG_QNX4FS_FS is not set
922# CONFIG_SYSV_FS is not set
923# CONFIG_UFS_FS is not set
924
925#
926# Network File Systems
927#
928CONFIG_NFS_FS=y
929# CONFIG_NFS_V3 is not set
930# CONFIG_NFS_V4 is not set
931# CONFIG_NFS_DIRECTIO is not set
932CONFIG_NFSD=y
933# CONFIG_NFSD_V3 is not set
934# CONFIG_NFSD_TCP is not set
935CONFIG_LOCKD=y
936CONFIG_EXPORTFS=y
937CONFIG_SUNRPC=y
938# CONFIG_RPCSEC_GSS_KRB5 is not set
939# CONFIG_SMB_FS is not set
940# CONFIG_CIFS is not set
941# CONFIG_NCP_FS is not set
942# CONFIG_CODA_FS is not set
943# CONFIG_AFS_FS is not set
944
945#
946# Partition Types
947#
948# CONFIG_PARTITION_ADVANCED is not set
949CONFIG_MSDOS_PARTITION=y
950
951#
952# Native Language Support
953#
954CONFIG_NLS=y
955CONFIG_NLS_DEFAULT="iso8859-1"
956CONFIG_NLS_CODEPAGE_437=y
957# CONFIG_NLS_CODEPAGE_737 is not set
958# CONFIG_NLS_CODEPAGE_775 is not set
959# CONFIG_NLS_CODEPAGE_850 is not set
960# CONFIG_NLS_CODEPAGE_852 is not set
961# CONFIG_NLS_CODEPAGE_855 is not set
962# CONFIG_NLS_CODEPAGE_857 is not set
963# CONFIG_NLS_CODEPAGE_860 is not set
964# CONFIG_NLS_CODEPAGE_861 is not set
965# CONFIG_NLS_CODEPAGE_862 is not set
966# CONFIG_NLS_CODEPAGE_863 is not set
967# CONFIG_NLS_CODEPAGE_864 is not set
968# CONFIG_NLS_CODEPAGE_865 is not set
969# CONFIG_NLS_CODEPAGE_866 is not set
970# CONFIG_NLS_CODEPAGE_869 is not set
971# CONFIG_NLS_CODEPAGE_936 is not set
972# CONFIG_NLS_CODEPAGE_950 is not set
973# CONFIG_NLS_CODEPAGE_932 is not set
974# CONFIG_NLS_CODEPAGE_949 is not set
975# CONFIG_NLS_CODEPAGE_874 is not set
976# CONFIG_NLS_ISO8859_8 is not set
977# CONFIG_NLS_CODEPAGE_1250 is not set
978# CONFIG_NLS_CODEPAGE_1251 is not set
979CONFIG_NLS_ISO8859_1=y
980# CONFIG_NLS_ISO8859_2 is not set
981# CONFIG_NLS_ISO8859_3 is not set
982# CONFIG_NLS_ISO8859_4 is not set
983# CONFIG_NLS_ISO8859_5 is not set
984# CONFIG_NLS_ISO8859_6 is not set
985# CONFIG_NLS_ISO8859_7 is not set
986# CONFIG_NLS_ISO8859_9 is not set
987# CONFIG_NLS_ISO8859_13 is not set
988# CONFIG_NLS_ISO8859_14 is not set
989# CONFIG_NLS_ISO8859_15 is not set
990# CONFIG_NLS_KOI8_R is not set
991# CONFIG_NLS_KOI8_U is not set
992# CONFIG_NLS_UTF8 is not set
993
994#
995# Library routines
996#
997CONFIG_CRC32=y
998# CONFIG_LIBCRC32C is not set
999CONFIG_ZLIB_INFLATE=m
1000CONFIG_ZLIB_DEFLATE=m
1001
1002#
1003# Kernel hacking
1004#
1005# CONFIG_DEBUG_KERNEL is not set
1006CONFIG_BOOTX_TEXT=y
1007
1008#
1009# Security options
1010#
1011# CONFIG_SECURITY is not set
1012
1013#
1014# Cryptographic options
1015#
1016CONFIG_CRYPTO=y
1017CONFIG_CRYPTO_HMAC=y
1018CONFIG_CRYPTO_NULL=y
1019CONFIG_CRYPTO_MD4=m
1020CONFIG_CRYPTO_MD5=m
1021CONFIG_CRYPTO_SHA1=m
1022CONFIG_CRYPTO_SHA256=m
1023CONFIG_CRYPTO_SHA512=m
1024CONFIG_CRYPTO_DES=m
1025CONFIG_CRYPTO_BLOWFISH=m
1026CONFIG_CRYPTO_TWOFISH=m
1027# CONFIG_CRYPTO_SERPENT is not set
1028CONFIG_CRYPTO_AES=m
1029CONFIG_CRYPTO_CAST5=m
1030CONFIG_CRYPTO_CAST6=m
1031CONFIG_CRYPTO_ARC4=m
1032CONFIG_CRYPTO_DEFLATE=m
1033CONFIG_CRYPTO_MICHAEL_MIC=m
1034# CONFIG_CRYPTO_CRC32C is not set
1035# CONFIG_CRYPTO_TEST is not set
diff --git a/arch/ppc/configs/common_defconfig b/arch/ppc/configs/prep_defconfig
index 4d33bee23a89..4d33bee23a89 100644
--- a/arch/ppc/configs/common_defconfig
+++ b/arch/ppc/configs/prep_defconfig
diff --git a/arch/ppc/kernel/Makefile b/arch/ppc/kernel/Makefile
index e399bbb969a4..466437f4bcbb 100644
--- a/arch/ppc/kernel/Makefile
+++ b/arch/ppc/kernel/Makefile
@@ -1,48 +1,24 @@
1# 1#
2# Makefile for the linux kernel. 2# Makefile for the linux kernel.
3# 3#
4ifneq ($(CONFIG_PPC_MERGE),y)
5
6extra-$(CONFIG_PPC_STD_MMU) := head.o 4extra-$(CONFIG_PPC_STD_MMU) := head.o
7extra-$(CONFIG_40x) := head_4xx.o 5extra-$(CONFIG_40x) := head_4xx.o
8extra-$(CONFIG_44x) := head_44x.o 6extra-$(CONFIG_44x) := head_44x.o
9extra-$(CONFIG_FSL_BOOKE) := head_fsl_booke.o 7extra-$(CONFIG_FSL_BOOKE) := head_fsl_booke.o
10extra-$(CONFIG_8xx) := head_8xx.o 8extra-$(CONFIG_8xx) := head_8xx.o
11extra-$(CONFIG_6xx) += idle_6xx.o
12extra-y += vmlinux.lds 9extra-y += vmlinux.lds
13 10
14obj-y := entry.o traps.o idle.o time.o misc.o \ 11obj-y := entry.o traps.o time.o misc.o \
15 setup.o \ 12 setup.o \
16 ppc_htab.o 13 ppc_htab.o
17obj-$(CONFIG_6xx) += l2cr.o cpu_setup_6xx.o 14obj-$(CONFIG_MODULES) += ppc_ksyms.o
18obj-$(CONFIG_SOFTWARE_SUSPEND) += swsusp.o
19obj-$(CONFIG_MODULES) += module.o ppc_ksyms.o
20obj-$(CONFIG_NOT_COHERENT_CACHE) += dma-mapping.o 15obj-$(CONFIG_NOT_COHERENT_CACHE) += dma-mapping.o
21obj-$(CONFIG_PCI) += pci.o 16obj-$(CONFIG_PCI) += pci.o
22obj-$(CONFIG_RAPIDIO) += rio.o 17obj-$(CONFIG_RAPIDIO) += rio.o
23obj-$(CONFIG_KGDB) += ppc-stub.o 18obj-$(CONFIG_KGDB) += ppc-stub.o
24obj-$(CONFIG_SMP) += smp.o smp-tbsync.o 19obj-$(CONFIG_SMP) += smp.o smp-tbsync.o
25obj-$(CONFIG_TAU) += temp.o
26ifndef CONFIG_E200
27obj-$(CONFIG_FSL_BOOKE) += perfmon_fsl_booke.o
28endif
29obj-$(CONFIG_KEXEC) += machine_kexec.o relocate_kernel.o 20obj-$(CONFIG_KEXEC) += machine_kexec.o relocate_kernel.o
30 21
31ifndef CONFIG_MATH_EMULATION 22ifndef CONFIG_MATH_EMULATION
32obj-$(CONFIG_8xx) += softemu8xx.o 23obj-$(CONFIG_8xx) += softemu8xx.o
33endif 24endif
34
35# These are here while we do the architecture merge
36
37else
38obj-y := idle.o
39obj-$(CONFIG_6xx) += l2cr.o cpu_setup_6xx.o
40obj-$(CONFIG_SOFTWARE_SUSPEND) += swsusp.o
41obj-$(CONFIG_MODULES) += module.o
42obj-$(CONFIG_NOT_COHERENT_CACHE) += dma-mapping.o
43obj-$(CONFIG_KGDB) += ppc-stub.o
44obj-$(CONFIG_TAU) += temp.o
45ifndef CONFIG_E200
46obj-$(CONFIG_FSL_BOOKE) += perfmon_fsl_booke.o
47endif
48endif
diff --git a/arch/ppc/kernel/dma-mapping.c b/arch/ppc/kernel/dma-mapping.c
index 685fd0defe23..61465ec88bc7 100644
--- a/arch/ppc/kernel/dma-mapping.c
+++ b/arch/ppc/kernel/dma-mapping.c
@@ -223,6 +223,8 @@ __dma_alloc_coherent(size_t size, dma_addr_t *handle, gfp_t gfp)
223 pte_t *pte = consistent_pte + CONSISTENT_OFFSET(vaddr); 223 pte_t *pte = consistent_pte + CONSISTENT_OFFSET(vaddr);
224 struct page *end = page + (1 << order); 224 struct page *end = page + (1 << order);
225 225
226 split_page(page, order);
227
226 /* 228 /*
227 * Set the "dma handle" 229 * Set the "dma handle"
228 */ 230 */
@@ -231,7 +233,6 @@ __dma_alloc_coherent(size_t size, dma_addr_t *handle, gfp_t gfp)
231 do { 233 do {
232 BUG_ON(!pte_none(*pte)); 234 BUG_ON(!pte_none(*pte));
233 235
234 set_page_count(page, 1);
235 SetPageReserved(page); 236 SetPageReserved(page);
236 set_pte_at(&init_mm, vaddr, 237 set_pte_at(&init_mm, vaddr,
237 pte, mk_pte(page, pgprot_noncached(PAGE_KERNEL))); 238 pte, mk_pte(page, pgprot_noncached(PAGE_KERNEL)));
@@ -244,7 +245,6 @@ __dma_alloc_coherent(size_t size, dma_addr_t *handle, gfp_t gfp)
244 * Free the otherwise unused pages. 245 * Free the otherwise unused pages.
245 */ 246 */
246 while (page < end) { 247 while (page < end) {
247 set_page_count(page, 1);
248 __free_page(page); 248 __free_page(page);
249 page++; 249 page++;
250 } 250 }
diff --git a/arch/ppc/kernel/entry.S b/arch/ppc/kernel/entry.S
index 3a2815978488..5891ecbdc703 100644
--- a/arch/ppc/kernel/entry.S
+++ b/arch/ppc/kernel/entry.S
@@ -135,10 +135,10 @@ transfer_to_handler:
135 mfspr r11,SPRN_HID0 135 mfspr r11,SPRN_HID0
136 mtcr r11 136 mtcr r11
137BEGIN_FTR_SECTION 137BEGIN_FTR_SECTION
138 bt- 8,power_save_6xx_restore /* Check DOZE */ 138 bt- 8,4f /* Check DOZE */
139END_FTR_SECTION_IFSET(CPU_FTR_CAN_DOZE) 139END_FTR_SECTION_IFSET(CPU_FTR_CAN_DOZE)
140BEGIN_FTR_SECTION 140BEGIN_FTR_SECTION
141 bt- 9,power_save_6xx_restore /* Check NAP */ 141 bt- 9,4f /* Check NAP */
142END_FTR_SECTION_IFSET(CPU_FTR_CAN_NAP) 142END_FTR_SECTION_IFSET(CPU_FTR_CAN_NAP)
143#endif /* CONFIG_6xx */ 143#endif /* CONFIG_6xx */
144 .globl transfer_to_handler_cont 144 .globl transfer_to_handler_cont
@@ -157,6 +157,10 @@ transfer_to_handler_cont:
157 SYNC 157 SYNC
158 RFI /* jump to handler, enable MMU */ 158 RFI /* jump to handler, enable MMU */
159 159
160#ifdef CONFIG_6xx
1614: b power_save_6xx_restore
162#endif
163
160/* 164/*
161 * On kernel stack overflow, load up an initial stack pointer 165 * On kernel stack overflow, load up an initial stack pointer
162 * and call StackOverflow(regs), which should not return. 166 * and call StackOverflow(regs), which should not return.
@@ -926,55 +930,3 @@ END_FTR_SECTION_IFSET(CPU_FTR_601)
926 b 4b 930 b 4b
927 931
928 .comm ee_restarts,4 932 .comm ee_restarts,4
929
930/*
931 * PROM code for specific machines follows. Put it
932 * here so it's easy to add arch-specific sections later.
933 * -- Cort
934 */
935#ifdef CONFIG_PPC_OF
936/*
937 * On CHRP, the Run-Time Abstraction Services (RTAS) have to be
938 * called with the MMU off.
939 */
940_GLOBAL(enter_rtas)
941 stwu r1,-INT_FRAME_SIZE(r1)
942 mflr r0
943 stw r0,INT_FRAME_SIZE+4(r1)
944 lis r4,rtas_data@ha
945 lwz r4,rtas_data@l(r4)
946 lis r6,1f@ha /* physical return address for rtas */
947 addi r6,r6,1f@l
948 tophys(r6,r6)
949 tophys(r7,r1)
950 lis r8,rtas_entry@ha
951 lwz r8,rtas_entry@l(r8)
952 mfmsr r9
953 stw r9,8(r1)
954 LOAD_MSR_KERNEL(r0,MSR_KERNEL)
955 SYNC /* disable interrupts so SRR0/1 */
956 MTMSRD(r0) /* don't get trashed */
957 li r9,MSR_KERNEL & ~(MSR_IR|MSR_DR)
958 mtlr r6
959 CLR_TOP32(r7)
960 mtspr SPRN_SPRG2,r7
961 mtspr SPRN_SRR0,r8
962 mtspr SPRN_SRR1,r9
963 RFI
9641: tophys(r9,r1)
965 lwz r8,INT_FRAME_SIZE+4(r9) /* get return address */
966 lwz r9,8(r9) /* original msr value */
967 FIX_SRR1(r9,r0)
968 addi r1,r1,INT_FRAME_SIZE
969 li r0,0
970 mtspr SPRN_SPRG2,r0
971 mtspr SPRN_SRR0,r8
972 mtspr SPRN_SRR1,r9
973 RFI /* return to caller */
974
975 .globl machine_check_in_rtas
976machine_check_in_rtas:
977 twi 31,0,0
978 /* XXX load up BATs and panic */
979
980#endif /* CONFIG_PPC_OF */
diff --git a/arch/ppc/kernel/head.S b/arch/ppc/kernel/head.S
index 53ea845fb911..01303efeddad 100644
--- a/arch/ppc/kernel/head.S
+++ b/arch/ppc/kernel/head.S
@@ -37,19 +37,6 @@
37#include <asm/amigappc.h> 37#include <asm/amigappc.h>
38#endif 38#endif
39 39
40#ifdef CONFIG_PPC64BRIDGE
41#define LOAD_BAT(n, reg, RA, RB) \
42 ld RA,(n*32)+0(reg); \
43 ld RB,(n*32)+8(reg); \
44 mtspr SPRN_IBAT##n##U,RA; \
45 mtspr SPRN_IBAT##n##L,RB; \
46 ld RA,(n*32)+16(reg); \
47 ld RB,(n*32)+24(reg); \
48 mtspr SPRN_DBAT##n##U,RA; \
49 mtspr SPRN_DBAT##n##L,RB; \
50
51#else /* CONFIG_PPC64BRIDGE */
52
53/* 601 only have IBAT; cr0.eq is set on 601 when using this macro */ 40/* 601 only have IBAT; cr0.eq is set on 601 when using this macro */
54#define LOAD_BAT(n, reg, RA, RB) \ 41#define LOAD_BAT(n, reg, RA, RB) \
55 /* see the comment for clear_bats() -- Cort */ \ 42 /* see the comment for clear_bats() -- Cort */ \
@@ -66,7 +53,6 @@
66 mtspr SPRN_DBAT##n##U,RA; \ 53 mtspr SPRN_DBAT##n##U,RA; \
67 mtspr SPRN_DBAT##n##L,RB; \ 54 mtspr SPRN_DBAT##n##L,RB; \
681: 551:
69#endif /* CONFIG_PPC64BRIDGE */
70 56
71 .text 57 .text
72 .stabs "arch/ppc/kernel/",N_SO,0,0,0f 58 .stabs "arch/ppc/kernel/",N_SO,0,0,0f
@@ -129,11 +115,6 @@ _start:
129 115
130 .globl __start 116 .globl __start
131__start: 117__start:
132/*
133 * We have to do any OF calls before we map ourselves to KERNELBASE,
134 * because OF may have I/O devices mapped into that area
135 * (particularly on CHRP).
136 */
137 mr r31,r3 /* save parameters */ 118 mr r31,r3 /* save parameters */
138 mr r30,r4 119 mr r30,r4
139 mr r29,r5 120 mr r29,r5
@@ -148,14 +129,6 @@ __start:
148 */ 129 */
149 bl early_init 130 bl early_init
150 131
151/*
152 * On POWER4, we first need to tweak some CPU configuration registers
153 * like real mode cache inhibit or exception base
154 */
155#ifdef CONFIG_POWER4
156 bl __970_cpu_preinit
157#endif /* CONFIG_POWER4 */
158
159#ifdef CONFIG_APUS 132#ifdef CONFIG_APUS
160/* On APUS the __va/__pa constants need to be set to the correct 133/* On APUS the __va/__pa constants need to be set to the correct
161 * values before continuing. 134 * values before continuing.
@@ -169,7 +142,6 @@ __start:
169 */ 142 */
170 bl mmu_off 143 bl mmu_off
171__after_mmu_off: 144__after_mmu_off:
172#ifndef CONFIG_POWER4
173 bl clear_bats 145 bl clear_bats
174 bl flush_tlbs 146 bl flush_tlbs
175 147
@@ -177,10 +149,6 @@ __after_mmu_off:
177#if !defined(CONFIG_APUS) && defined(CONFIG_BOOTX_TEXT) 149#if !defined(CONFIG_APUS) && defined(CONFIG_BOOTX_TEXT)
178 bl setup_disp_bat 150 bl setup_disp_bat
179#endif 151#endif
180#else /* CONFIG_POWER4 */
181 bl reloc_offset
182 bl initial_mm_power4
183#endif /* CONFIG_POWER4 */
184 152
185/* 153/*
186 * Call setup_cpu for CPU 0 and initialize 6xx Idle 154 * Call setup_cpu for CPU 0 and initialize 6xx Idle
@@ -192,18 +160,11 @@ __after_mmu_off:
192 bl reloc_offset 160 bl reloc_offset
193 bl init_idle_6xx 161 bl init_idle_6xx
194#endif /* CONFIG_6xx */ 162#endif /* CONFIG_6xx */
195#ifdef CONFIG_POWER4
196 bl reloc_offset
197 bl init_idle_power4
198#endif /* CONFIG_POWER4 */
199 163
200 164
201#ifndef CONFIG_APUS 165#ifndef CONFIG_APUS
202/* 166/*
203 * We need to run with _start at physical address 0. 167 * We need to run with _start at physical address 0.
204 * On CHRP, we are loaded at 0x10000 since OF on CHRP uses
205 * the exception vectors at 0 (and therefore this copy
206 * overwrites OF's exception vectors with our own).
207 * If the MMU is already turned on, we copy stuff to KERNELBASE, 168 * If the MMU is already turned on, we copy stuff to KERNELBASE,
208 * otherwise we copy it to 0. 169 * otherwise we copy it to 0.
209 */ 170 */
@@ -358,51 +319,19 @@ i##n: \
358#endif 319#endif
359 320
360/* Machine check */ 321/* Machine check */
361/*
362 * On CHRP, this is complicated by the fact that we could get a
363 * machine check inside RTAS, and we have no guarantee that certain
364 * critical registers will have the values we expect. The set of
365 * registers that might have bad values includes all the GPRs
366 * and all the BATs. We indicate that we are in RTAS by putting
367 * a non-zero value, the address of the exception frame to use,
368 * in SPRG2. The machine check handler checks SPRG2 and uses its
369 * value if it is non-zero. If we ever needed to free up SPRG2,
370 * we could use a field in the thread_info or thread_struct instead.
371 * (Other exception handlers assume that r1 is a valid kernel stack
372 * pointer when we take an exception from supervisor mode.)
373 * -- paulus.
374 */
375 . = 0x200 322 . = 0x200
376 mtspr SPRN_SPRG0,r10 323 mtspr SPRN_SPRG0,r10
377 mtspr SPRN_SPRG1,r11 324 mtspr SPRN_SPRG1,r11
378 mfcr r10 325 mfcr r10
379#ifdef CONFIG_PPC_CHRP
380 mfspr r11,SPRN_SPRG2
381 cmpwi 0,r11,0
382 bne 7f
383#endif /* CONFIG_PPC_CHRP */
384 EXCEPTION_PROLOG_1 326 EXCEPTION_PROLOG_1
3857: EXCEPTION_PROLOG_2 3277: EXCEPTION_PROLOG_2
386 addi r3,r1,STACK_FRAME_OVERHEAD 328 addi r3,r1,STACK_FRAME_OVERHEAD
387#ifdef CONFIG_PPC_CHRP
388 mfspr r4,SPRN_SPRG2
389 cmpwi cr1,r4,0
390 bne cr1,1f
391#endif
392 EXC_XFER_STD(0x200, machine_check_exception) 329 EXC_XFER_STD(0x200, machine_check_exception)
393#ifdef CONFIG_PPC_CHRP
3941: b machine_check_in_rtas
395#endif
396 330
397/* Data access exception. */ 331/* Data access exception. */
398 . = 0x300 332 . = 0x300
399#ifdef CONFIG_PPC64BRIDGE
400 b DataAccess
401DataAccessCont:
402#else
403DataAccess: 333DataAccess:
404 EXCEPTION_PROLOG 334 EXCEPTION_PROLOG
405#endif /* CONFIG_PPC64BRIDGE */
406 mfspr r10,SPRN_DSISR 335 mfspr r10,SPRN_DSISR
407 andis. r0,r10,0xa470 /* weird error? */ 336 andis. r0,r10,0xa470 /* weird error? */
408 bne 1f /* if not, try to put a PTE */ 337 bne 1f /* if not, try to put a PTE */
@@ -414,21 +343,10 @@ DataAccess:
414 mfspr r4,SPRN_DAR 343 mfspr r4,SPRN_DAR
415 EXC_XFER_EE_LITE(0x300, handle_page_fault) 344 EXC_XFER_EE_LITE(0x300, handle_page_fault)
416 345
417#ifdef CONFIG_PPC64BRIDGE
418/* SLB fault on data access. */
419 . = 0x380
420 b DataSegment
421#endif /* CONFIG_PPC64BRIDGE */
422
423/* Instruction access exception. */ 346/* Instruction access exception. */
424 . = 0x400 347 . = 0x400
425#ifdef CONFIG_PPC64BRIDGE
426 b InstructionAccess
427InstructionAccessCont:
428#else
429InstructionAccess: 348InstructionAccess:
430 EXCEPTION_PROLOG 349 EXCEPTION_PROLOG
431#endif /* CONFIG_PPC64BRIDGE */
432 andis. r0,r9,0x4000 /* no pte found? */ 350 andis. r0,r9,0x4000 /* no pte found? */
433 beq 1f /* if so, try to put a PTE */ 351 beq 1f /* if so, try to put a PTE */
434 li r3,0 /* into the hash table */ 352 li r3,0 /* into the hash table */
@@ -438,12 +356,6 @@ InstructionAccess:
438 mr r5,r9 356 mr r5,r9
439 EXC_XFER_EE_LITE(0x400, handle_page_fault) 357 EXC_XFER_EE_LITE(0x400, handle_page_fault)
440 358
441#ifdef CONFIG_PPC64BRIDGE
442/* SLB fault on instruction access. */
443 . = 0x480
444 b InstructionSegment
445#endif /* CONFIG_PPC64BRIDGE */
446
447/* External interrupt */ 359/* External interrupt */
448 EXCEPTION(0x500, HardwareInterrupt, do_IRQ, EXC_XFER_LITE) 360 EXCEPTION(0x500, HardwareInterrupt, do_IRQ, EXC_XFER_LITE)
449 361
@@ -708,15 +620,9 @@ DataStoreTLBMiss:
708 EXCEPTION(0x1300, Trap_13, instruction_breakpoint_exception, EXC_XFER_EE) 620 EXCEPTION(0x1300, Trap_13, instruction_breakpoint_exception, EXC_XFER_EE)
709 EXCEPTION(0x1400, SMI, SMIException, EXC_XFER_EE) 621 EXCEPTION(0x1400, SMI, SMIException, EXC_XFER_EE)
710 EXCEPTION(0x1500, Trap_15, unknown_exception, EXC_XFER_EE) 622 EXCEPTION(0x1500, Trap_15, unknown_exception, EXC_XFER_EE)
711#ifdef CONFIG_POWER4
712 EXCEPTION(0x1600, Trap_16, unknown_exception, EXC_XFER_EE)
713 EXCEPTION(0x1700, Trap_17, altivec_assist_exception, EXC_XFER_EE)
714 EXCEPTION(0x1800, Trap_18, TAUException, EXC_XFER_STD)
715#else /* !CONFIG_POWER4 */
716 EXCEPTION(0x1600, Trap_16, altivec_assist_exception, EXC_XFER_EE) 623 EXCEPTION(0x1600, Trap_16, altivec_assist_exception, EXC_XFER_EE)
717 EXCEPTION(0x1700, Trap_17, TAUException, EXC_XFER_STD) 624 EXCEPTION(0x1700, Trap_17, TAUException, EXC_XFER_STD)
718 EXCEPTION(0x1800, Trap_18, unknown_exception, EXC_XFER_EE) 625 EXCEPTION(0x1800, Trap_18, unknown_exception, EXC_XFER_EE)
719#endif /* CONFIG_POWER4 */
720 EXCEPTION(0x1900, Trap_19, unknown_exception, EXC_XFER_EE) 626 EXCEPTION(0x1900, Trap_19, unknown_exception, EXC_XFER_EE)
721 EXCEPTION(0x1a00, Trap_1a, unknown_exception, EXC_XFER_EE) 627 EXCEPTION(0x1a00, Trap_1a, unknown_exception, EXC_XFER_EE)
722 EXCEPTION(0x1b00, Trap_1b, unknown_exception, EXC_XFER_EE) 628 EXCEPTION(0x1b00, Trap_1b, unknown_exception, EXC_XFER_EE)
@@ -754,28 +660,6 @@ AltiVecUnavailable:
754 addi r3,r1,STACK_FRAME_OVERHEAD 660 addi r3,r1,STACK_FRAME_OVERHEAD
755 EXC_XFER_EE_LITE(0xf20, altivec_unavailable_exception) 661 EXC_XFER_EE_LITE(0xf20, altivec_unavailable_exception)
756 662
757#ifdef CONFIG_PPC64BRIDGE
758DataAccess:
759 EXCEPTION_PROLOG
760 b DataAccessCont
761
762InstructionAccess:
763 EXCEPTION_PROLOG
764 b InstructionAccessCont
765
766DataSegment:
767 EXCEPTION_PROLOG
768 addi r3,r1,STACK_FRAME_OVERHEAD
769 mfspr r4,SPRN_DAR
770 stw r4,_DAR(r11)
771 EXC_XFER_STD(0x380, unknown_exception)
772
773InstructionSegment:
774 EXCEPTION_PROLOG
775 addi r3,r1,STACK_FRAME_OVERHEAD
776 EXC_XFER_STD(0x480, unknown_exception)
777#endif /* CONFIG_PPC64BRIDGE */
778
779#ifdef CONFIG_ALTIVEC 663#ifdef CONFIG_ALTIVEC
780/* Note that the AltiVec support is closely modeled after the FP 664/* Note that the AltiVec support is closely modeled after the FP
781 * support. Changes to one are likely to be applicable to the 665 * support. Changes to one are likely to be applicable to the
@@ -1048,13 +932,6 @@ __secondary_start_pmac_0:
1048 932
1049 .globl __secondary_start 933 .globl __secondary_start
1050__secondary_start: 934__secondary_start:
1051#ifdef CONFIG_PPC64BRIDGE
1052 mfmsr r0
1053 clrldi r0,r0,1 /* make sure it's in 32-bit mode */
1054 SYNC
1055 MTMSRD(r0)
1056 isync
1057#endif
1058 /* Copy some CPU settings from CPU 0 */ 935 /* Copy some CPU settings from CPU 0 */
1059 bl __restore_cpu_setup 936 bl __restore_cpu_setup
1060 937
@@ -1065,10 +942,6 @@ __secondary_start:
1065 lis r3,-KERNELBASE@h 942 lis r3,-KERNELBASE@h
1066 bl init_idle_6xx 943 bl init_idle_6xx
1067#endif /* CONFIG_6xx */ 944#endif /* CONFIG_6xx */
1068#ifdef CONFIG_POWER4
1069 lis r3,-KERNELBASE@h
1070 bl init_idle_power4
1071#endif /* CONFIG_POWER4 */
1072 945
1073 /* get current_thread_info and current */ 946 /* get current_thread_info and current */
1074 lis r1,secondary_ti@ha 947 lis r1,secondary_ti@ha
@@ -1109,12 +982,12 @@ __secondary_start:
1109 * Those generic dummy functions are kept for CPUs not 982 * Those generic dummy functions are kept for CPUs not
1110 * included in CONFIG_6xx 983 * included in CONFIG_6xx
1111 */ 984 */
1112#if !defined(CONFIG_6xx) && !defined(CONFIG_POWER4) 985#if !defined(CONFIG_6xx)
1113_GLOBAL(__save_cpu_setup) 986_GLOBAL(__save_cpu_setup)
1114 blr 987 blr
1115_GLOBAL(__restore_cpu_setup) 988_GLOBAL(__restore_cpu_setup)
1116 blr 989 blr
1117#endif /* !defined(CONFIG_6xx) && !defined(CONFIG_POWER4) */ 990#endif /* !defined(CONFIG_6xx) */
1118 991
1119 992
1120/* 993/*
@@ -1132,11 +1005,6 @@ load_up_mmu:
1132 tophys(r6,r6) 1005 tophys(r6,r6)
1133 lwz r6,_SDR1@l(r6) 1006 lwz r6,_SDR1@l(r6)
1134 mtspr SPRN_SDR1,r6 1007 mtspr SPRN_SDR1,r6
1135#ifdef CONFIG_PPC64BRIDGE
1136 /* clear the ASR so we only use the pseudo-segment registers. */
1137 li r6,0
1138 mtasr r6
1139#endif /* CONFIG_PPC64BRIDGE */
1140 li r0,16 /* load up segment register values */ 1008 li r0,16 /* load up segment register values */
1141 mtctr r0 /* for context 0 */ 1009 mtctr r0 /* for context 0 */
1142 lis r3,0x2000 /* Ku = 1, VSID = 0 */ 1010 lis r3,0x2000 /* Ku = 1, VSID = 0 */
@@ -1145,7 +1013,7 @@ load_up_mmu:
1145 addi r3,r3,0x111 /* increment VSID */ 1013 addi r3,r3,0x111 /* increment VSID */
1146 addis r4,r4,0x1000 /* address of next segment */ 1014 addis r4,r4,0x1000 /* address of next segment */
1147 bdnz 3b 1015 bdnz 3b
1148#ifndef CONFIG_POWER4 1016
1149/* Load the BAT registers with the values set up by MMU_init. 1017/* Load the BAT registers with the values set up by MMU_init.
1150 MMU_init takes care of whether we're on a 601 or not. */ 1018 MMU_init takes care of whether we're on a 601 or not. */
1151 mfpvr r3 1019 mfpvr r3
@@ -1158,7 +1026,7 @@ load_up_mmu:
1158 LOAD_BAT(1,r3,r4,r5) 1026 LOAD_BAT(1,r3,r4,r5)
1159 LOAD_BAT(2,r3,r4,r5) 1027 LOAD_BAT(2,r3,r4,r5)
1160 LOAD_BAT(3,r3,r4,r5) 1028 LOAD_BAT(3,r3,r4,r5)
1161#endif /* CONFIG_POWER4 */ 1029
1162 blr 1030 blr
1163 1031
1164/* 1032/*
@@ -1269,9 +1137,6 @@ _GLOBAL(set_context)
1269 li r4,0 1137 li r4,0
1270 isync 1138 isync
12713: 11393:
1272#ifdef CONFIG_PPC64BRIDGE
1273 slbie r4
1274#endif /* CONFIG_PPC64BRIDGE */
1275 mtsrin r3,r4 1140 mtsrin r3,r4
1276 addi r3,r3,0x111 /* next VSID */ 1141 addi r3,r3,0x111 /* next VSID */
1277 rlwinm r3,r3,0,8,3 /* clear out any overflow from VSID field */ 1142 rlwinm r3,r3,0,8,3 /* clear out any overflow from VSID field */
@@ -1358,7 +1223,6 @@ mmu_off:
1358 sync 1223 sync
1359 RFI 1224 RFI
1360 1225
1361#ifndef CONFIG_POWER4
1362/* 1226/*
1363 * Use the first pair of BAT registers to map the 1st 16MB 1227 * Use the first pair of BAT registers to map the 1st 16MB
1364 * of RAM to KERNELBASE. From this point on we can't safely 1228 * of RAM to KERNELBASE. From this point on we can't safely
@@ -1366,7 +1230,6 @@ mmu_off:
1366 */ 1230 */
1367initial_bats: 1231initial_bats:
1368 lis r11,KERNELBASE@h 1232 lis r11,KERNELBASE@h
1369#ifndef CONFIG_PPC64BRIDGE
1370 mfspr r9,SPRN_PVR 1233 mfspr r9,SPRN_PVR
1371 rlwinm r9,r9,16,16,31 /* r9 = 1 for 601, 4 for 604 */ 1234 rlwinm r9,r9,16,16,31 /* r9 = 1 for 601, 4 for 604 */
1372 cmpwi 0,r9,1 1235 cmpwi 0,r9,1
@@ -1381,7 +1244,6 @@ initial_bats:
1381 mtspr SPRN_IBAT1L,r10 1244 mtspr SPRN_IBAT1L,r10
1382 isync 1245 isync
1383 blr 1246 blr
1384#endif /* CONFIG_PPC64BRIDGE */
1385 1247
13864: tophys(r8,r11) 12484: tophys(r8,r11)
1387#ifdef CONFIG_SMP 1249#ifdef CONFIG_SMP
@@ -1395,11 +1257,6 @@ initial_bats:
1395 ori r11,r11,BL_256M<<2|0x2 /* set up BAT registers for 604 */ 1257 ori r11,r11,BL_256M<<2|0x2 /* set up BAT registers for 604 */
1396#endif /* CONFIG_APUS */ 1258#endif /* CONFIG_APUS */
1397 1259
1398#ifdef CONFIG_PPC64BRIDGE
1399 /* clear out the high 32 bits in the BAT */
1400 clrldi r11,r11,32
1401 clrldi r8,r8,32
1402#endif /* CONFIG_PPC64BRIDGE */
1403 mtspr SPRN_DBAT0L,r8 /* N.B. 6xx (not 601) have valid */ 1260 mtspr SPRN_DBAT0L,r8 /* N.B. 6xx (not 601) have valid */
1404 mtspr SPRN_DBAT0U,r11 /* bit in upper BAT register */ 1261 mtspr SPRN_DBAT0U,r11 /* bit in upper BAT register */
1405 mtspr SPRN_IBAT0L,r8 1262 mtspr SPRN_IBAT0L,r8
@@ -1432,38 +1289,6 @@ setup_disp_bat:
1432 1289
1433#endif /* !defined(CONFIG_APUS) && defined(CONFIG_BOOTX_TEXT) */ 1290#endif /* !defined(CONFIG_APUS) && defined(CONFIG_BOOTX_TEXT) */
1434 1291
1435#else /* CONFIG_POWER4 */
1436/*
1437 * Load up the SDR1 and segment register values now
1438 * since we don't have the BATs.
1439 * Also make sure we are running in 32-bit mode.
1440 */
1441
1442initial_mm_power4:
1443 addis r14,r3,_SDR1@ha /* get the value from _SDR1 */
1444 lwz r14,_SDR1@l(r14) /* assume hash table below 4GB */
1445 mtspr SPRN_SDR1,r14
1446 slbia
1447 lis r4,0x2000 /* set pseudo-segment reg 12 */
1448 ori r5,r4,0x0ccc
1449 mtsr 12,r5
1450#if 0
1451 ori r5,r4,0x0888 /* set pseudo-segment reg 8 */
1452 mtsr 8,r5 /* (for access to serial port) */
1453#endif
1454#ifdef CONFIG_BOOTX_TEXT
1455 ori r5,r4,0x0999 /* set pseudo-segment reg 9 */
1456 mtsr 9,r5 /* (for access to screen) */
1457#endif
1458 mfmsr r0
1459 clrldi r0,r0,1
1460 sync
1461 mtmsr r0
1462 isync
1463 blr
1464
1465#endif /* CONFIG_POWER4 */
1466
1467#ifdef CONFIG_8260 1292#ifdef CONFIG_8260
1468/* Jump into the system reset for the rom. 1293/* Jump into the system reset for the rom.
1469 * We first disable the MMU, and then jump to the ROM reset address. 1294 * We first disable the MMU, and then jump to the ROM reset address.
diff --git a/arch/ppc/kernel/head_44x.S b/arch/ppc/kernel/head_44x.S
index 677c571aa276..0d8b88219d38 100644
--- a/arch/ppc/kernel/head_44x.S
+++ b/arch/ppc/kernel/head_44x.S
@@ -1,6 +1,4 @@
1/* 1/*
2 * arch/ppc/kernel/head_44x.S
3 *
4 * Kernel execution entry point code. 2 * Kernel execution entry point code.
5 * 3 *
6 * Copyright (c) 1995-1996 Gary Thomas <gdt@linuxppc.org> 4 * Copyright (c) 1995-1996 Gary Thomas <gdt@linuxppc.org>
diff --git a/arch/ppc/kernel/head_8xx.S b/arch/ppc/kernel/head_8xx.S
index c1e89ad0684d..ec53c7d65f2b 100644
--- a/arch/ppc/kernel/head_8xx.S
+++ b/arch/ppc/kernel/head_8xx.S
@@ -1,6 +1,4 @@
1/* 1/*
2 * arch/ppc/kernel/except_8xx.S
3 *
4 * PowerPC version 2 * PowerPC version
5 * Copyright (C) 1995-1996 Gary Thomas (gdt@linuxppc.org) 3 * Copyright (C) 1995-1996 Gary Thomas (gdt@linuxppc.org)
6 * Rewritten by Cort Dougan (cort@cs.nmt.edu) for PReP 4 * Rewritten by Cort Dougan (cort@cs.nmt.edu) for PReP
diff --git a/arch/ppc/kernel/head_fsl_booke.S b/arch/ppc/kernel/head_fsl_booke.S
index 8d60fa99fc4b..dd86bbed7627 100644
--- a/arch/ppc/kernel/head_fsl_booke.S
+++ b/arch/ppc/kernel/head_fsl_booke.S
@@ -1,6 +1,4 @@
1/* 1/*
2 * arch/ppc/kernel/head_fsl_booke.S
3 *
4 * Kernel execution entry point code. 2 * Kernel execution entry point code.
5 * 3 *
6 * Copyright (c) 1995-1996 Gary Thomas <gdt@linuxppc.org> 4 * Copyright (c) 1995-1996 Gary Thomas <gdt@linuxppc.org>
@@ -316,6 +314,7 @@ skpinv: addi r6,r6,1 /* Increment */
316 */ 314 */
317 lis r2,DBCR0_IDM@h 315 lis r2,DBCR0_IDM@h
318 mtspr SPRN_DBCR0,r2 316 mtspr SPRN_DBCR0,r2
317 isync
319 /* clear any residual debug events */ 318 /* clear any residual debug events */
320 li r2,-1 319 li r2,-1
321 mtspr SPRN_DBSR,r2 320 mtspr SPRN_DBSR,r2
@@ -1002,12 +1001,15 @@ _GLOBAL(giveup_fpu)
1002_GLOBAL(abort) 1001_GLOBAL(abort)
1003 li r13,0 1002 li r13,0
1004 mtspr SPRN_DBCR0,r13 /* disable all debug events */ 1003 mtspr SPRN_DBCR0,r13 /* disable all debug events */
1004 isync
1005 mfmsr r13 1005 mfmsr r13
1006 ori r13,r13,MSR_DE@l /* Enable Debug Events */ 1006 ori r13,r13,MSR_DE@l /* Enable Debug Events */
1007 mtmsr r13 1007 mtmsr r13
1008 isync
1008 mfspr r13,SPRN_DBCR0 1009 mfspr r13,SPRN_DBCR0
1009 lis r13,(DBCR0_IDM|DBCR0_RST_CHIP)@h 1010 lis r13,(DBCR0_IDM|DBCR0_RST_CHIP)@h
1010 mtspr SPRN_DBCR0,r13 1011 mtspr SPRN_DBCR0,r13
1012 isync
1011 1013
1012_GLOBAL(set_context) 1014_GLOBAL(set_context)
1013 1015
diff --git a/arch/ppc/kernel/idle.c b/arch/ppc/kernel/idle.c
deleted file mode 100644
index 1be3ca5bae40..000000000000
--- a/arch/ppc/kernel/idle.c
+++ /dev/null
@@ -1,112 +0,0 @@
1/*
2 * Idle daemon for PowerPC. Idle daemon will handle any action
3 * that needs to be taken when the system becomes idle.
4 *
5 * Written by Cort Dougan (cort@cs.nmt.edu). Subsequently hacked
6 * on by Tom Rini, Armin Kuster, Paul Mackerras and others.
7 *
8 * This program is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU General Public License
10 * as published by the Free Software Foundation; either version
11 * 2 of the License, or (at your option) any later version.
12 */
13#include <linux/config.h>
14#include <linux/errno.h>
15#include <linux/sched.h>
16#include <linux/kernel.h>
17#include <linux/mm.h>
18#include <linux/smp.h>
19#include <linux/smp_lock.h>
20#include <linux/stddef.h>
21#include <linux/unistd.h>
22#include <linux/ptrace.h>
23#include <linux/slab.h>
24#include <linux/sysctl.h>
25#include <linux/cpu.h>
26
27#include <asm/pgtable.h>
28#include <asm/uaccess.h>
29#include <asm/system.h>
30#include <asm/io.h>
31#include <asm/mmu.h>
32#include <asm/cache.h>
33#include <asm/cputable.h>
34#include <asm/machdep.h>
35#include <asm/smp.h>
36
37void default_idle(void)
38{
39 void (*powersave)(void);
40
41 powersave = ppc_md.power_save;
42
43 if (!need_resched()) {
44 if (powersave != NULL)
45 powersave();
46#ifdef CONFIG_SMP
47 else {
48 set_thread_flag(TIF_POLLING_NRFLAG);
49 while (!need_resched() &&
50 !cpu_is_offline(smp_processor_id()))
51 barrier();
52 clear_thread_flag(TIF_POLLING_NRFLAG);
53 }
54#endif
55 }
56}
57
58/*
59 * The body of the idle task.
60 */
61void cpu_idle(void)
62{
63 int cpu = smp_processor_id();
64
65 for (;;) {
66 while (!need_resched()) {
67 if (ppc_md.idle != NULL)
68 ppc_md.idle();
69 else
70 default_idle();
71 }
72
73 if (cpu_is_offline(cpu) && system_state == SYSTEM_RUNNING)
74 cpu_die();
75 preempt_enable_no_resched();
76 schedule();
77 preempt_disable();
78 }
79}
80
81#if defined(CONFIG_SYSCTL) && defined(CONFIG_6xx)
82/*
83 * Register the sysctl to set/clear powersave_nap.
84 */
85extern int powersave_nap;
86
87static ctl_table powersave_nap_ctl_table[]={
88 {
89 .ctl_name = KERN_PPC_POWERSAVE_NAP,
90 .procname = "powersave-nap",
91 .data = &powersave_nap,
92 .maxlen = sizeof(int),
93 .mode = 0644,
94 .proc_handler = &proc_dointvec,
95 },
96 { 0, },
97};
98static ctl_table powersave_nap_sysctl_root[] = {
99 { 1, "kernel", NULL, 0, 0755, powersave_nap_ctl_table, },
100 { 0,},
101};
102
103static int __init
104register_powersave_nap_sysctl(void)
105{
106 register_sysctl_table(powersave_nap_sysctl_root, 0);
107
108 return 0;
109}
110
111__initcall(register_powersave_nap_sysctl);
112#endif
diff --git a/arch/ppc/kernel/idle_6xx.S b/arch/ppc/kernel/idle_6xx.S
deleted file mode 100644
index 1a2194cf6828..000000000000
--- a/arch/ppc/kernel/idle_6xx.S
+++ /dev/null
@@ -1,233 +0,0 @@
1/*
2 * This file contains the power_save function for 6xx & 7xxx CPUs
3 * rewritten in assembler
4 *
5 * Warning ! This code assumes that if your machine has a 750fx
6 * it will have PLL 1 set to low speed mode (used during NAP/DOZE).
7 * if this is not the case some additional changes will have to
8 * be done to check a runtime var (a bit like powersave-nap)
9 *
10 * This program is free software; you can redistribute it and/or
11 * modify it under the terms of the GNU General Public License
12 * as published by the Free Software Foundation; either version
13 * 2 of the License, or (at your option) any later version.
14 */
15
16#include <linux/config.h>
17#include <linux/threads.h>
18#include <asm/processor.h>
19#include <asm/page.h>
20#include <asm/cputable.h>
21#include <asm/thread_info.h>
22#include <asm/ppc_asm.h>
23#include <asm/asm-offsets.h>
24
25#undef DEBUG
26
27 .text
28
29/*
30 * Init idle, called at early CPU setup time from head.S for each CPU
31 * Make sure no rest of NAP mode remains in HID0, save default
32 * values for some CPU specific registers. Called with r24
33 * containing CPU number and r3 reloc offset
34 */
35_GLOBAL(init_idle_6xx)
36BEGIN_FTR_SECTION
37 mfspr r4,SPRN_HID0
38 rlwinm r4,r4,0,10,8 /* Clear NAP */
39 mtspr SPRN_HID0, r4
40 b 1f
41END_FTR_SECTION_IFSET(CPU_FTR_CAN_NAP)
42 blr
431:
44 slwi r5,r24,2
45 add r5,r5,r3
46BEGIN_FTR_SECTION
47 mfspr r4,SPRN_MSSCR0
48 addis r6,r5, nap_save_msscr0@ha
49 stw r4,nap_save_msscr0@l(r6)
50END_FTR_SECTION_IFSET(CPU_FTR_NAP_DISABLE_L2_PR)
51BEGIN_FTR_SECTION
52 mfspr r4,SPRN_HID1
53 addis r6,r5,nap_save_hid1@ha
54 stw r4,nap_save_hid1@l(r6)
55END_FTR_SECTION_IFSET(CPU_FTR_DUAL_PLL_750FX)
56 blr
57
58/*
59 * Here is the power_save_6xx function. This could eventually be
60 * split into several functions & changing the function pointer
61 * depending on the various features.
62 */
63_GLOBAL(ppc6xx_idle)
64 /* Check if we can nap or doze, put HID0 mask in r3
65 */
66 lis r3, 0
67BEGIN_FTR_SECTION
68 lis r3,HID0_DOZE@h
69END_FTR_SECTION_IFSET(CPU_FTR_CAN_DOZE)
70BEGIN_FTR_SECTION
71 /* We must dynamically check for the NAP feature as it
72 * can be cleared by CPU init after the fixups are done
73 */
74 lis r4,cur_cpu_spec@ha
75 lwz r4,cur_cpu_spec@l(r4)
76 lwz r4,CPU_SPEC_FEATURES(r4)
77 andi. r0,r4,CPU_FTR_CAN_NAP
78 beq 1f
79 /* Now check if user or arch enabled NAP mode */
80 lis r4,powersave_nap@ha
81 lwz r4,powersave_nap@l(r4)
82 cmpwi 0,r4,0
83 beq 1f
84 lis r3,HID0_NAP@h
851:
86END_FTR_SECTION_IFSET(CPU_FTR_CAN_NAP)
87 cmpwi 0,r3,0
88 beqlr
89
90 /* Clear MSR:EE */
91 mfmsr r7
92 rlwinm r0,r7,0,17,15
93 mtmsr r0
94
95 /* Check current_thread_info()->flags */
96 rlwinm r4,r1,0,0,18
97 lwz r4,TI_FLAGS(r4)
98 andi. r0,r4,_TIF_NEED_RESCHED
99 beq 1f
100 mtmsr r7 /* out of line this ? */
101 blr
1021:
103 /* Some pre-nap cleanups needed on some CPUs */
104 andis. r0,r3,HID0_NAP@h
105 beq 2f
106BEGIN_FTR_SECTION
107 /* Disable L2 prefetch on some 745x and try to ensure
108 * L2 prefetch engines are idle. As explained by errata
109 * text, we can't be sure they are, we just hope very hard
110 * that well be enough (sic !). At least I noticed Apple
111 * doesn't even bother doing the dcbf's here...
112 */
113 mfspr r4,SPRN_MSSCR0
114 rlwinm r4,r4,0,0,29
115 sync
116 mtspr SPRN_MSSCR0,r4
117 sync
118 isync
119 lis r4,KERNELBASE@h
120 dcbf 0,r4
121 dcbf 0,r4
122 dcbf 0,r4
123 dcbf 0,r4
124END_FTR_SECTION_IFSET(CPU_FTR_NAP_DISABLE_L2_PR)
125#ifdef DEBUG
126 lis r6,nap_enter_count@ha
127 lwz r4,nap_enter_count@l(r6)
128 addi r4,r4,1
129 stw r4,nap_enter_count@l(r6)
130#endif
1312:
132BEGIN_FTR_SECTION
133 /* Go to low speed mode on some 750FX */
134 lis r4,powersave_lowspeed@ha
135 lwz r4,powersave_lowspeed@l(r4)
136 cmpwi 0,r4,0
137 beq 1f
138 mfspr r4,SPRN_HID1
139 oris r4,r4,0x0001
140 mtspr SPRN_HID1,r4
1411:
142END_FTR_SECTION_IFSET(CPU_FTR_DUAL_PLL_750FX)
143
144 /* Go to NAP or DOZE now */
145 mfspr r4,SPRN_HID0
146 lis r5,(HID0_NAP|HID0_SLEEP)@h
147BEGIN_FTR_SECTION
148 oris r5,r5,HID0_DOZE@h
149END_FTR_SECTION_IFSET(CPU_FTR_CAN_DOZE)
150 andc r4,r4,r5
151 or r4,r4,r3
152BEGIN_FTR_SECTION
153 oris r4,r4,HID0_DPM@h /* that should be done once for all */
154END_FTR_SECTION_IFCLR(CPU_FTR_NO_DPM)
155 mtspr SPRN_HID0,r4
156BEGIN_FTR_SECTION
157 DSSALL
158 sync
159END_FTR_SECTION_IFSET(CPU_FTR_ALTIVEC)
160 ori r7,r7,MSR_EE /* Could be ommited (already set) */
161 oris r7,r7,MSR_POW@h
162 sync
163 isync
164 mtmsr r7
165 isync
166 sync
167 blr
168
169/*
170 * Return from NAP/DOZE mode, restore some CPU specific registers,
171 * we are called with DR/IR still off and r2 containing physical
172 * address of current.
173 */
174_GLOBAL(power_save_6xx_restore)
175 mfspr r11,SPRN_HID0
176 rlwinm. r11,r11,0,10,8 /* Clear NAP & copy NAP bit !state to cr1 EQ */
177 cror 4*cr1+eq,4*cr0+eq,4*cr0+eq
178BEGIN_FTR_SECTION
179 rlwinm r11,r11,0,9,7 /* Clear DOZE */
180END_FTR_SECTION_IFSET(CPU_FTR_CAN_DOZE)
181 mtspr SPRN_HID0, r11
182
183#ifdef DEBUG
184 beq cr1,1f
185 lis r11,(nap_return_count-KERNELBASE)@ha
186 lwz r9,nap_return_count@l(r11)
187 addi r9,r9,1
188 stw r9,nap_return_count@l(r11)
1891:
190#endif
191
192 rlwinm r9,r1,0,0,18
193 tophys(r9,r9)
194 lwz r11,TI_CPU(r9)
195 slwi r11,r11,2
196 /* Todo make sure all these are in the same page
197 * and load r22 (@ha part + CPU offset) only once
198 */
199BEGIN_FTR_SECTION
200 beq cr1,1f
201 addis r9,r11,(nap_save_msscr0-KERNELBASE)@ha
202 lwz r9,nap_save_msscr0@l(r9)
203 mtspr SPRN_MSSCR0, r9
204 sync
205 isync
2061:
207END_FTR_SECTION_IFSET(CPU_FTR_NAP_DISABLE_L2_PR)
208BEGIN_FTR_SECTION
209 addis r9,r11,(nap_save_hid1-KERNELBASE)@ha
210 lwz r9,nap_save_hid1@l(r9)
211 mtspr SPRN_HID1, r9
212END_FTR_SECTION_IFSET(CPU_FTR_DUAL_PLL_750FX)
213 b transfer_to_handler_cont
214
215 .data
216
217_GLOBAL(nap_save_msscr0)
218 .space 4*NR_CPUS
219
220_GLOBAL(nap_save_hid1)
221 .space 4*NR_CPUS
222
223_GLOBAL(powersave_nap)
224 .long 0
225_GLOBAL(powersave_lowspeed)
226 .long 0
227
228#ifdef DEBUG
229_GLOBAL(nap_enter_count)
230 .space 4
231_GLOBAL(nap_return_count)
232 .space 4
233#endif
diff --git a/arch/ppc/kernel/idle_power4.S b/arch/ppc/kernel/idle_power4.S
deleted file mode 100644
index cc0d535365cd..000000000000
--- a/arch/ppc/kernel/idle_power4.S
+++ /dev/null
@@ -1,91 +0,0 @@
1/*
2 * This file contains the power_save function for 6xx & 7xxx CPUs
3 * rewritten in assembler
4 *
5 * Warning ! This code assumes that if your machine has a 750fx
6 * it will have PLL 1 set to low speed mode (used during NAP/DOZE).
7 * if this is not the case some additional changes will have to
8 * be done to check a runtime var (a bit like powersave-nap)
9 *
10 * This program is free software; you can redistribute it and/or
11 * modify it under the terms of the GNU General Public License
12 * as published by the Free Software Foundation; either version
13 * 2 of the License, or (at your option) any later version.
14 */
15
16#include <linux/config.h>
17#include <linux/threads.h>
18#include <asm/processor.h>
19#include <asm/page.h>
20#include <asm/cputable.h>
21#include <asm/thread_info.h>
22#include <asm/ppc_asm.h>
23#include <asm/asm-offsets.h>
24
25#undef DEBUG
26
27 .text
28
29/*
30 * Init idle, called at early CPU setup time from head.S for each CPU
31 * So nothing for now. Called with r24 containing CPU number and r3
32 * reloc offset
33 */
34 .globl init_idle_power4
35init_idle_power4:
36 blr
37
38/*
39 * Here is the power_save_6xx function. This could eventually be
40 * split into several functions & changing the function pointer
41 * depending on the various features.
42 */
43 .globl power4_idle
44power4_idle:
45BEGIN_FTR_SECTION
46 blr
47END_FTR_SECTION_IFCLR(CPU_FTR_CAN_NAP)
48 /* We must dynamically check for the NAP feature as it
49 * can be cleared by CPU init after the fixups are done
50 */
51 lis r4,cur_cpu_spec@ha
52 lwz r4,cur_cpu_spec@l(r4)
53 lwz r4,CPU_SPEC_FEATURES(r4)
54 andi. r0,r4,CPU_FTR_CAN_NAP
55 beqlr
56 /* Now check if user or arch enabled NAP mode */
57 lis r4,powersave_nap@ha
58 lwz r4,powersave_nap@l(r4)
59 cmpwi 0,r4,0
60 beqlr
61
62 /* Clear MSR:EE */
63 mfmsr r7
64 rlwinm r0,r7,0,17,15
65 mtmsr r0
66
67 /* Check current_thread_info()->flags */
68 rlwinm r4,r1,0,0,18
69 lwz r4,TI_FLAGS(r4)
70 andi. r0,r4,_TIF_NEED_RESCHED
71 beq 1f
72 mtmsr r7 /* out of line this ? */
73 blr
741:
75 /* Go to NAP now */
76BEGIN_FTR_SECTION
77 DSSALL
78 sync
79END_FTR_SECTION_IFSET(CPU_FTR_ALTIVEC)
80 ori r7,r7,MSR_EE /* Could be ommited (already set) */
81 oris r7,r7,MSR_POW@h
82 sync
83 isync
84 mtmsr r7
85 isync
86 sync
87 blr
88
89 .globl powersave_nap
90powersave_nap:
91 .long 0
diff --git a/arch/ppc/kernel/pci.c b/arch/ppc/kernel/pci.c
index 04d04c5bfdd0..809673a36f7a 100644
--- a/arch/ppc/kernel/pci.c
+++ b/arch/ppc/kernel/pci.c
@@ -46,9 +46,6 @@ static void pcibios_fixup_resources(struct pci_dev* dev);
46static void fixup_broken_pcnet32(struct pci_dev* dev); 46static void fixup_broken_pcnet32(struct pci_dev* dev);
47static int reparent_resources(struct resource *parent, struct resource *res); 47static int reparent_resources(struct resource *parent, struct resource *res);
48static void fixup_cpc710_pci64(struct pci_dev* dev); 48static void fixup_cpc710_pci64(struct pci_dev* dev);
49#ifdef CONFIG_PPC_OF
50static u8* pci_to_OF_bus_map;
51#endif
52 49
53/* By default, we don't re-assign bus numbers. 50/* By default, we don't re-assign bus numbers.
54 */ 51 */
@@ -625,406 +622,13 @@ pcibios_alloc_controller(void)
625 return hose; 622 return hose;
626} 623}
627 624
628#ifdef CONFIG_PPC_OF
629/*
630 * Functions below are used on OpenFirmware machines.
631 */
632static void
633make_one_node_map(struct device_node* node, u8 pci_bus)
634{
635 int *bus_range;
636 int len;
637
638 if (pci_bus >= pci_bus_count)
639 return;
640 bus_range = (int *) get_property(node, "bus-range", &len);
641 if (bus_range == NULL || len < 2 * sizeof(int)) {
642 printk(KERN_WARNING "Can't get bus-range for %s, "
643 "assuming it starts at 0\n", node->full_name);
644 pci_to_OF_bus_map[pci_bus] = 0;
645 } else
646 pci_to_OF_bus_map[pci_bus] = bus_range[0];
647
648 for (node=node->child; node != 0;node = node->sibling) {
649 struct pci_dev* dev;
650 unsigned int *class_code, *reg;
651
652 class_code = (unsigned int *) get_property(node, "class-code", NULL);
653 if (!class_code || ((*class_code >> 8) != PCI_CLASS_BRIDGE_PCI &&
654 (*class_code >> 8) != PCI_CLASS_BRIDGE_CARDBUS))
655 continue;
656 reg = (unsigned int *)get_property(node, "reg", NULL);
657 if (!reg)
658 continue;
659 dev = pci_find_slot(pci_bus, ((reg[0] >> 8) & 0xff));
660 if (!dev || !dev->subordinate)
661 continue;
662 make_one_node_map(node, dev->subordinate->number);
663 }
664}
665
666void
667pcibios_make_OF_bus_map(void)
668{
669 int i;
670 struct pci_controller* hose;
671 u8* of_prop_map;
672
673 pci_to_OF_bus_map = (u8*)kmalloc(pci_bus_count, GFP_KERNEL);
674 if (!pci_to_OF_bus_map) {
675 printk(KERN_ERR "Can't allocate OF bus map !\n");
676 return;
677 }
678
679 /* We fill the bus map with invalid values, that helps
680 * debugging.
681 */
682 for (i=0; i<pci_bus_count; i++)
683 pci_to_OF_bus_map[i] = 0xff;
684
685 /* For each hose, we begin searching bridges */
686 for(hose=hose_head; hose; hose=hose->next) {
687 struct device_node* node;
688 node = (struct device_node *)hose->arch_data;
689 if (!node)
690 continue;
691 make_one_node_map(node, hose->first_busno);
692 }
693 of_prop_map = get_property(find_path_device("/"), "pci-OF-bus-map", NULL);
694 if (of_prop_map)
695 memcpy(of_prop_map, pci_to_OF_bus_map, pci_bus_count);
696#ifdef DEBUG
697 printk("PCI->OF bus map:\n");
698 for (i=0; i<pci_bus_count; i++) {
699 if (pci_to_OF_bus_map[i] == 0xff)
700 continue;
701 printk("%d -> %d\n", i, pci_to_OF_bus_map[i]);
702 }
703#endif
704}
705
706typedef int (*pci_OF_scan_iterator)(struct device_node* node, void* data);
707
708static struct device_node*
709scan_OF_pci_childs(struct device_node* node, pci_OF_scan_iterator filter, void* data)
710{
711 struct device_node* sub_node;
712
713 for (; node != 0;node = node->sibling) {
714 unsigned int *class_code;
715
716 if (filter(node, data))
717 return node;
718
719 /* For PCI<->PCI bridges or CardBus bridges, we go down
720 * Note: some OFs create a parent node "multifunc-device" as
721 * a fake root for all functions of a multi-function device,
722 * we go down them as well.
723 */
724 class_code = (unsigned int *) get_property(node, "class-code", NULL);
725 if ((!class_code || ((*class_code >> 8) != PCI_CLASS_BRIDGE_PCI &&
726 (*class_code >> 8) != PCI_CLASS_BRIDGE_CARDBUS)) &&
727 strcmp(node->name, "multifunc-device"))
728 continue;
729 sub_node = scan_OF_pci_childs(node->child, filter, data);
730 if (sub_node)
731 return sub_node;
732 }
733 return NULL;
734}
735
736static int
737scan_OF_pci_childs_iterator(struct device_node* node, void* data)
738{
739 unsigned int *reg;
740 u8* fdata = (u8*)data;
741
742 reg = (unsigned int *) get_property(node, "reg", NULL);
743 if (reg && ((reg[0] >> 8) & 0xff) == fdata[1]
744 && ((reg[0] >> 16) & 0xff) == fdata[0])
745 return 1;
746 return 0;
747}
748
749static struct device_node*
750scan_OF_childs_for_device(struct device_node* node, u8 bus, u8 dev_fn)
751{
752 u8 filter_data[2] = {bus, dev_fn};
753
754 return scan_OF_pci_childs(node, scan_OF_pci_childs_iterator, filter_data);
755}
756
757/*
758 * Scans the OF tree for a device node matching a PCI device
759 */
760struct device_node *
761pci_busdev_to_OF_node(struct pci_bus *bus, int devfn)
762{
763 struct pci_controller *hose;
764 struct device_node *node;
765 int busnr;
766
767 if (!have_of)
768 return NULL;
769
770 /* Lookup the hose */
771 busnr = bus->number;
772 hose = pci_bus_to_hose(busnr);
773 if (!hose)
774 return NULL;
775
776 /* Check it has an OF node associated */
777 node = (struct device_node *) hose->arch_data;
778 if (!node)
779 return NULL;
780
781 /* Fixup bus number according to what OF think it is. */
782 if (pci_to_OF_bus_map)
783 busnr = pci_to_OF_bus_map[busnr];
784 if (busnr == 0xff)
785 return NULL;
786
787 /* Now, lookup childs of the hose */
788 return scan_OF_childs_for_device(node->child, busnr, devfn);
789}
790EXPORT_SYMBOL(pci_busdev_to_OF_node);
791
792struct device_node*
793pci_device_to_OF_node(struct pci_dev *dev)
794{
795 return pci_busdev_to_OF_node(dev->bus, dev->devfn);
796}
797EXPORT_SYMBOL(pci_device_to_OF_node);
798
799/* This routine is meant to be used early during boot, when the
800 * PCI bus numbers have not yet been assigned, and you need to
801 * issue PCI config cycles to an OF device.
802 * It could also be used to "fix" RTAS config cycles if you want
803 * to set pci_assign_all_buses to 1 and still use RTAS for PCI
804 * config cycles.
805 */
806struct pci_controller* pci_find_hose_for_OF_device(struct device_node* node)
807{
808 if (!have_of)
809 return NULL;
810 while(node) {
811 struct pci_controller* hose;
812 for (hose=hose_head;hose;hose=hose->next)
813 if (hose->arch_data == node)
814 return hose;
815 node=node->parent;
816 }
817 return NULL;
818}
819
820static int
821find_OF_pci_device_filter(struct device_node* node, void* data)
822{
823 return ((void *)node == data);
824}
825
826/*
827 * Returns the PCI device matching a given OF node
828 */
829int
830pci_device_from_OF_node(struct device_node* node, u8* bus, u8* devfn)
831{
832 unsigned int *reg;
833 struct pci_controller* hose;
834 struct pci_dev* dev = NULL;
835
836 if (!have_of)
837 return -ENODEV;
838 /* Make sure it's really a PCI device */
839 hose = pci_find_hose_for_OF_device(node);
840 if (!hose || !hose->arch_data)
841 return -ENODEV;
842 if (!scan_OF_pci_childs(((struct device_node*)hose->arch_data)->child,
843 find_OF_pci_device_filter, (void *)node))
844 return -ENODEV;
845 reg = (unsigned int *) get_property(node, "reg", NULL);
846 if (!reg)
847 return -ENODEV;
848 *bus = (reg[0] >> 16) & 0xff;
849 *devfn = ((reg[0] >> 8) & 0xff);
850
851 /* Ok, here we need some tweak. If we have already renumbered
852 * all busses, we can't rely on the OF bus number any more.
853 * the pci_to_OF_bus_map is not enough as several PCI busses
854 * may match the same OF bus number.
855 */
856 if (!pci_to_OF_bus_map)
857 return 0;
858
859 for_each_pci_dev(dev)
860 if (pci_to_OF_bus_map[dev->bus->number] == *bus &&
861 dev->devfn == *devfn) {
862 *bus = dev->bus->number;
863 pci_dev_put(dev);
864 return 0;
865 }
866
867 return -ENODEV;
868}
869EXPORT_SYMBOL(pci_device_from_OF_node);
870
871void __init
872pci_process_bridge_OF_ranges(struct pci_controller *hose,
873 struct device_node *dev, int primary)
874{
875 static unsigned int static_lc_ranges[256] __initdata;
876 unsigned int *dt_ranges, *lc_ranges, *ranges, *prev;
877 unsigned int size;
878 int rlen = 0, orig_rlen;
879 int memno = 0;
880 struct resource *res;
881 int np, na = prom_n_addr_cells(dev);
882 np = na + 5;
883
884 /* First we try to merge ranges to fix a problem with some pmacs
885 * that can have more than 3 ranges, fortunately using contiguous
886 * addresses -- BenH
887 */
888 dt_ranges = (unsigned int *) get_property(dev, "ranges", &rlen);
889 if (!dt_ranges)
890 return;
891 /* Sanity check, though hopefully that never happens */
892 if (rlen > sizeof(static_lc_ranges)) {
893 printk(KERN_WARNING "OF ranges property too large !\n");
894 rlen = sizeof(static_lc_ranges);
895 }
896 lc_ranges = static_lc_ranges;
897 memcpy(lc_ranges, dt_ranges, rlen);
898 orig_rlen = rlen;
899
900 /* Let's work on a copy of the "ranges" property instead of damaging
901 * the device-tree image in memory
902 */
903 ranges = lc_ranges;
904 prev = NULL;
905 while ((rlen -= np * sizeof(unsigned int)) >= 0) {
906 if (prev) {
907 if (prev[0] == ranges[0] && prev[1] == ranges[1] &&
908 (prev[2] + prev[na+4]) == ranges[2] &&
909 (prev[na+2] + prev[na+4]) == ranges[na+2]) {
910 prev[na+4] += ranges[na+4];
911 ranges[0] = 0;
912 ranges += np;
913 continue;
914 }
915 }
916 prev = ranges;
917 ranges += np;
918 }
919
920 /*
921 * The ranges property is laid out as an array of elements,
922 * each of which comprises:
923 * cells 0 - 2: a PCI address
924 * cells 3 or 3+4: a CPU physical address
925 * (size depending on dev->n_addr_cells)
926 * cells 4+5 or 5+6: the size of the range
927 */
928 ranges = lc_ranges;
929 rlen = orig_rlen;
930 while (ranges && (rlen -= np * sizeof(unsigned int)) >= 0) {
931 res = NULL;
932 size = ranges[na+4];
933 switch ((ranges[0] >> 24) & 0x3) {
934 case 1: /* I/O space */
935 if (ranges[2] != 0)
936 break;
937 hose->io_base_phys = ranges[na+2];
938 /* limit I/O space to 16MB */
939 if (size > 0x01000000)
940 size = 0x01000000;
941 hose->io_base_virt = ioremap(ranges[na+2], size);
942 if (primary)
943 isa_io_base = (unsigned long) hose->io_base_virt;
944 res = &hose->io_resource;
945 res->flags = IORESOURCE_IO;
946 res->start = ranges[2];
947 DBG("PCI: IO 0x%lx -> 0x%lx\n",
948 res->start, res->start + size - 1);
949 break;
950 case 2: /* memory space */
951 memno = 0;
952 if (ranges[1] == 0 && ranges[2] == 0
953 && ranges[na+4] <= (16 << 20)) {
954 /* 1st 16MB, i.e. ISA memory area */
955 if (primary)
956 isa_mem_base = ranges[na+2];
957 memno = 1;
958 }
959 while (memno < 3 && hose->mem_resources[memno].flags)
960 ++memno;
961 if (memno == 0)
962 hose->pci_mem_offset = ranges[na+2] - ranges[2];
963 if (memno < 3) {
964 res = &hose->mem_resources[memno];
965 res->flags = IORESOURCE_MEM;
966 if(ranges[0] & 0x40000000)
967 res->flags |= IORESOURCE_PREFETCH;
968 res->start = ranges[na+2];
969 DBG("PCI: MEM[%d] 0x%lx -> 0x%lx\n", memno,
970 res->start, res->start + size - 1);
971 }
972 break;
973 }
974 if (res != NULL) {
975 res->name = dev->full_name;
976 res->end = res->start + size - 1;
977 res->parent = NULL;
978 res->sibling = NULL;
979 res->child = NULL;
980 }
981 ranges += np;
982 }
983}
984
985/* We create the "pci-OF-bus-map" property now so it appears in the
986 * /proc device tree
987 */
988void __init
989pci_create_OF_bus_map(void)
990{
991 struct property* of_prop;
992
993 of_prop = (struct property*) alloc_bootmem(sizeof(struct property) + 256);
994 if (of_prop && find_path_device("/")) {
995 memset(of_prop, -1, sizeof(struct property) + 256);
996 of_prop->name = "pci-OF-bus-map";
997 of_prop->length = 256;
998 of_prop->value = (unsigned char *)&of_prop[1];
999 prom_add_property(find_path_device("/"), of_prop);
1000 }
1001}
1002
1003static ssize_t pci_show_devspec(struct device *dev, struct device_attribute *attr, char *buf)
1004{
1005 struct pci_dev *pdev;
1006 struct device_node *np;
1007
1008 pdev = to_pci_dev (dev);
1009 np = pci_device_to_OF_node(pdev);
1010 if (np == NULL || np->full_name == NULL)
1011 return 0;
1012 return sprintf(buf, "%s", np->full_name);
1013}
1014static DEVICE_ATTR(devspec, S_IRUGO, pci_show_devspec, NULL);
1015
1016#else /* CONFIG_PPC_OF */
1017void pcibios_make_OF_bus_map(void) 625void pcibios_make_OF_bus_map(void)
1018{ 626{
1019} 627}
1020#endif /* CONFIG_PPC_OF */
1021 628
1022/* Add sysfs properties */ 629/* Add sysfs properties */
1023void pcibios_add_platform_entries(struct pci_dev *pdev) 630void pcibios_add_platform_entries(struct pci_dev *pdev)
1024{ 631{
1025#ifdef CONFIG_PPC_OF
1026 device_create_file(&pdev->dev, &dev_attr_devspec);
1027#endif /* CONFIG_PPC_OF */
1028} 632}
1029 633
1030 634
diff --git a/arch/ppc/kernel/ppc_htab.c b/arch/ppc/kernel/ppc_htab.c
index 2f5c7650274f..75c645043746 100644
--- a/arch/ppc/kernel/ppc_htab.c
+++ b/arch/ppc/kernel/ppc_htab.c
@@ -52,7 +52,7 @@ static int ppc_htab_open(struct inode *inode, struct file *file)
52 return single_open(file, ppc_htab_show, NULL); 52 return single_open(file, ppc_htab_show, NULL);
53} 53}
54 54
55struct file_operations ppc_htab_operations = { 55const struct file_operations ppc_htab_operations = {
56 .open = ppc_htab_open, 56 .open = ppc_htab_open,
57 .read = seq_read, 57 .read = seq_read,
58 .llseek = seq_lseek, 58 .llseek = seq_lseek,
@@ -104,7 +104,7 @@ static char *pmc2_lookup(unsigned long mmcr0)
104static int ppc_htab_show(struct seq_file *m, void *v) 104static int ppc_htab_show(struct seq_file *m, void *v)
105{ 105{
106 unsigned long mmcr0 = 0, pmc1 = 0, pmc2 = 0; 106 unsigned long mmcr0 = 0, pmc1 = 0, pmc2 = 0;
107#if defined(CONFIG_PPC_STD_MMU) && !defined(CONFIG_PPC64BRIDGE) 107#if defined(CONFIG_PPC_STD_MMU)
108 unsigned int kptes = 0, uptes = 0; 108 unsigned int kptes = 0, uptes = 0;
109 PTE *ptr; 109 PTE *ptr;
110#endif /* CONFIG_PPC_STD_MMU */ 110#endif /* CONFIG_PPC_STD_MMU */
@@ -133,7 +133,6 @@ static int ppc_htab_show(struct seq_file *m, void *v)
133 return 0; 133 return 0;
134 } 134 }
135 135
136#ifndef CONFIG_PPC64BRIDGE
137 for (ptr = Hash; ptr < Hash_end; ptr++) { 136 for (ptr = Hash; ptr < Hash_end; ptr++) {
138 unsigned int mctx, vsid; 137 unsigned int mctx, vsid;
139 138
@@ -147,7 +146,6 @@ static int ppc_htab_show(struct seq_file *m, void *v)
147 else 146 else
148 uptes++; 147 uptes++;
149 } 148 }
150#endif
151 149
152 seq_printf(m, 150 seq_printf(m,
153 "PTE Hash Table Information\n" 151 "PTE Hash Table Information\n"
@@ -155,20 +153,16 @@ static int ppc_htab_show(struct seq_file *m, void *v)
155 "Buckets\t\t: %lu\n" 153 "Buckets\t\t: %lu\n"
156 "Address\t\t: %08lx\n" 154 "Address\t\t: %08lx\n"
157 "Entries\t\t: %lu\n" 155 "Entries\t\t: %lu\n"
158#ifndef CONFIG_PPC64BRIDGE
159 "User ptes\t: %u\n" 156 "User ptes\t: %u\n"
160 "Kernel ptes\t: %u\n" 157 "Kernel ptes\t: %u\n"
161 "Percent full\t: %lu%%\n" 158 "Percent full\t: %lu%%\n"
162#endif
163 , (unsigned long)(Hash_size>>10), 159 , (unsigned long)(Hash_size>>10),
164 (Hash_size/(sizeof(PTE)*8)), 160 (Hash_size/(sizeof(PTE)*8)),
165 (unsigned long)Hash, 161 (unsigned long)Hash,
166 Hash_size/sizeof(PTE) 162 Hash_size/sizeof(PTE)
167#ifndef CONFIG_PPC64BRIDGE
168 , uptes, 163 , uptes,
169 kptes, 164 kptes,
170 ((kptes+uptes)*100) / (Hash_size/sizeof(PTE)) 165 ((kptes+uptes)*100) / (Hash_size/sizeof(PTE))
171#endif
172 ); 166 );
173 167
174 seq_printf(m, 168 seq_printf(m,
diff --git a/arch/ppc/kernel/ppc_ksyms.c b/arch/ppc/kernel/ppc_ksyms.c
index 82adb4601348..865ba74991a9 100644
--- a/arch/ppc/kernel/ppc_ksyms.c
+++ b/arch/ppc/kernel/ppc_ksyms.c
@@ -18,7 +18,6 @@
18#include <linux/bitops.h> 18#include <linux/bitops.h>
19 19
20#include <asm/page.h> 20#include <asm/page.h>
21#include <asm/semaphore.h>
22#include <asm/processor.h> 21#include <asm/processor.h>
23#include <asm/uaccess.h> 22#include <asm/uaccess.h>
24#include <asm/io.h> 23#include <asm/io.h>
@@ -30,7 +29,6 @@
30#include <linux/adb.h> 29#include <linux/adb.h>
31#include <linux/cuda.h> 30#include <linux/cuda.h>
32#include <linux/pmu.h> 31#include <linux/pmu.h>
33#include <asm/prom.h>
34#include <asm/system.h> 32#include <asm/system.h>
35#include <asm/pci-bridge.h> 33#include <asm/pci-bridge.h>
36#include <asm/irq.h> 34#include <asm/irq.h>
@@ -208,27 +206,6 @@ EXPORT_SYMBOL(adb_try_handler_change);
208EXPORT_SYMBOL(cuda_request); 206EXPORT_SYMBOL(cuda_request);
209EXPORT_SYMBOL(cuda_poll); 207EXPORT_SYMBOL(cuda_poll);
210#endif /* CONFIG_ADB_CUDA */ 208#endif /* CONFIG_ADB_CUDA */
211#ifdef CONFIG_PPC_OF
212EXPORT_SYMBOL(find_devices);
213EXPORT_SYMBOL(find_type_devices);
214EXPORT_SYMBOL(find_compatible_devices);
215EXPORT_SYMBOL(find_path_device);
216EXPORT_SYMBOL(device_is_compatible);
217EXPORT_SYMBOL(machine_is_compatible);
218EXPORT_SYMBOL(find_all_nodes);
219EXPORT_SYMBOL(get_property);
220EXPORT_SYMBOL(request_OF_resource);
221EXPORT_SYMBOL(release_OF_resource);
222EXPORT_SYMBOL(of_find_node_by_name);
223EXPORT_SYMBOL(of_find_node_by_type);
224EXPORT_SYMBOL(of_find_compatible_node);
225EXPORT_SYMBOL(of_find_node_by_path);
226EXPORT_SYMBOL(of_find_all_nodes);
227EXPORT_SYMBOL(of_get_parent);
228EXPORT_SYMBOL(of_get_next_child);
229EXPORT_SYMBOL(of_node_get);
230EXPORT_SYMBOL(of_node_put);
231#endif /* CONFIG_PPC_OF */
232#if defined(CONFIG_BOOTX_TEXT) 209#if defined(CONFIG_BOOTX_TEXT)
233EXPORT_SYMBOL(btext_update_display); 210EXPORT_SYMBOL(btext_update_display);
234#endif 211#endif
@@ -262,9 +239,6 @@ EXPORT_SYMBOL(console_drivers);
262EXPORT_SYMBOL(xmon); 239EXPORT_SYMBOL(xmon);
263EXPORT_SYMBOL(xmon_printf); 240EXPORT_SYMBOL(xmon_printf);
264#endif 241#endif
265EXPORT_SYMBOL(__up);
266EXPORT_SYMBOL(__down);
267EXPORT_SYMBOL(__down_interruptible);
268 242
269#if defined(CONFIG_KGDB) || defined(CONFIG_XMON) 243#if defined(CONFIG_KGDB) || defined(CONFIG_XMON)
270extern void (*debugger)(struct pt_regs *regs); 244extern void (*debugger)(struct pt_regs *regs);
diff --git a/arch/ppc/kernel/setup.c b/arch/ppc/kernel/setup.c
index c08ab432e958..1f79e84ab464 100644
--- a/arch/ppc/kernel/setup.c
+++ b/arch/ppc/kernel/setup.c
@@ -1,5 +1,5 @@
1/* 1/*
2 * Common prep/chrp boot and setup code. 2 * Common prep boot and setup code.
3 */ 3 */
4 4
5#include <linux/config.h> 5#include <linux/config.h>
@@ -72,17 +72,12 @@ unsigned long ISA_DMA_THRESHOLD;
72unsigned int DMA_MODE_READ; 72unsigned int DMA_MODE_READ;
73unsigned int DMA_MODE_WRITE; 73unsigned int DMA_MODE_WRITE;
74 74
75#ifdef CONFIG_PPC_MULTIPLATFORM 75#ifdef CONFIG_PPC_PREP
76int _machine = 0;
77EXPORT_SYMBOL(_machine);
78
79extern void prep_init(unsigned long r3, unsigned long r4, 76extern void prep_init(unsigned long r3, unsigned long r4,
80 unsigned long r5, unsigned long r6, unsigned long r7); 77 unsigned long r5, unsigned long r6, unsigned long r7);
81extern void chrp_init(unsigned long r3, unsigned long r4,
82 unsigned long r5, unsigned long r6, unsigned long r7);
83 78
84dev_t boot_dev; 79dev_t boot_dev;
85#endif /* CONFIG_PPC_MULTIPLATFORM */ 80#endif /* CONFIG_PPC_PREP */
86 81
87int have_of; 82int have_of;
88EXPORT_SYMBOL(have_of); 83EXPORT_SYMBOL(have_of);
@@ -168,9 +163,8 @@ int show_cpuinfo(struct seq_file *m, void *v)
168 /* Show summary information */ 163 /* Show summary information */
169#ifdef CONFIG_SMP 164#ifdef CONFIG_SMP
170 unsigned long bogosum = 0; 165 unsigned long bogosum = 0;
171 for (i = 0; i < NR_CPUS; ++i) 166 for_each_online_cpu(i)
172 if (cpu_online(i)) 167 bogosum += cpu_data[i].loops_per_jiffy;
173 bogosum += cpu_data[i].loops_per_jiffy;
174 seq_printf(m, "total bogomips\t: %lu.%02lu\n", 168 seq_printf(m, "total bogomips\t: %lu.%02lu\n",
175 bogosum/(500000/HZ), bogosum/(5000/HZ) % 100); 169 bogosum/(500000/HZ), bogosum/(5000/HZ) % 100);
176#endif /* CONFIG_SMP */ 170#endif /* CONFIG_SMP */
@@ -320,72 +314,12 @@ early_init(int r3, int r4, int r5)
320 identify_cpu(offset, 0); 314 identify_cpu(offset, 0);
321 do_cpu_ftr_fixups(offset); 315 do_cpu_ftr_fixups(offset);
322 316
323#if defined(CONFIG_PPC_OF)
324 reloc_got2(offset);
325
326 /*
327 * don't do anything on prep
328 * for now, don't use bootinfo because it breaks yaboot 0.5
329 * and assume that if we didn't find a magic number, we have OF
330 */
331 if (*(unsigned long *)(0) != 0xdeadc0de)
332 phys = prom_init(r3, r4, (prom_entry)r5);
333
334 reloc_got2(-offset);
335#endif
336
337 return phys; 317 return phys;
338} 318}
339 319
340#ifdef CONFIG_PPC_OF 320#ifdef CONFIG_PPC_PREP
341/*
342 * Assume here that all clock rates are the same in a
343 * smp system. -- Cort
344 */
345int
346of_show_percpuinfo(struct seq_file *m, int i)
347{
348 struct device_node *cpu_node;
349 u32 *fp;
350 int s;
351
352 cpu_node = find_type_devices("cpu");
353 if (!cpu_node)
354 return 0;
355 for (s = 0; s < i && cpu_node->next; s++)
356 cpu_node = cpu_node->next;
357 fp = (u32 *)get_property(cpu_node, "clock-frequency", NULL);
358 if (fp)
359 seq_printf(m, "clock\t\t: %dMHz\n", *fp / 1000000);
360 return 0;
361}
362
363void __init
364intuit_machine_type(void)
365{
366 char *model;
367 struct device_node *root;
368
369 /* ask the OF info if we're a chrp or pmac */
370 root = find_path_device("/");
371 if (root != 0) {
372 /* assume pmac unless proven to be chrp -- Cort */
373 _machine = _MACH_Pmac;
374 model = get_property(root, "device_type", NULL);
375 if (model && !strncmp("chrp", model, 4))
376 _machine = _MACH_chrp;
377 else {
378 model = get_property(root, "model", NULL);
379 if (model && !strncmp(model, "IBM", 3))
380 _machine = _MACH_chrp;
381 }
382 }
383}
384#endif
385
386#ifdef CONFIG_PPC_MULTIPLATFORM
387/* 321/*
388 * The PPC_MULTIPLATFORM version of platform_init... 322 * The PPC_PREP version of platform_init...
389 */ 323 */
390void __init 324void __init
391platform_init(unsigned long r3, unsigned long r4, unsigned long r5, 325platform_init(unsigned long r3, unsigned long r4, unsigned long r5,
@@ -400,161 +334,9 @@ platform_init(unsigned long r3, unsigned long r4, unsigned long r5,
400 334
401 parse_bootinfo(find_bootinfo()); 335 parse_bootinfo(find_bootinfo());
402 336
403 /* if we didn't get any bootinfo telling us what we are... */ 337 prep_init(r3, r4, r5, r6, r7);
404 if (_machine == 0) {
405 /* prep boot loader tells us if we're prep or not */
406 if ( *(unsigned long *)(KERNELBASE) == (0xdeadc0de) )
407 _machine = _MACH_prep;
408 }
409
410#ifdef CONFIG_PPC_PREP
411 /* not much more to do here, if prep */
412 if (_machine == _MACH_prep) {
413 prep_init(r3, r4, r5, r6, r7);
414 return;
415 }
416#endif
417
418#ifdef CONFIG_PPC_OF
419 have_of = 1;
420
421 /* prom_init has already been called from __start */
422 if (boot_infos)
423 relocate_nodes();
424
425 /* If we aren't PReP, we can find out if we're Pmac
426 * or CHRP with this. */
427 if (_machine == 0)
428 intuit_machine_type();
429
430 /* finish_device_tree may need _machine defined. */
431 finish_device_tree();
432
433 /*
434 * If we were booted via quik, r3 points to the physical
435 * address of the command-line parameters.
436 * If we were booted from an xcoff image (i.e. netbooted or
437 * booted from floppy), we get the command line from the
438 * bootargs property of the /chosen node.
439 * If an initial ramdisk is present, r3 and r4
440 * are used for initrd_start and initrd_size,
441 * otherwise they contain 0xdeadbeef.
442 */
443 if (r3 >= 0x4000 && r3 < 0x800000 && r4 == 0) {
444 strlcpy(cmd_line, (char *)r3 + KERNELBASE,
445 sizeof(cmd_line));
446 } else if (boot_infos != 0) {
447 /* booted by BootX - check for ramdisk */
448 if (boot_infos->kernelParamsOffset != 0)
449 strlcpy(cmd_line, (char *) boot_infos
450 + boot_infos->kernelParamsOffset,
451 sizeof(cmd_line));
452#ifdef CONFIG_BLK_DEV_INITRD
453 if (boot_infos->ramDisk) {
454 initrd_start = (unsigned long) boot_infos
455 + boot_infos->ramDisk;
456 initrd_end = initrd_start + boot_infos->ramDiskSize;
457 initrd_below_start_ok = 1;
458 }
459#endif
460 } else {
461 struct device_node *chosen;
462 char *p;
463
464#ifdef CONFIG_BLK_DEV_INITRD
465 if (r3 && r4 && r4 != 0xdeadbeef) {
466 if (r3 < KERNELBASE)
467 r3 += KERNELBASE;
468 initrd_start = r3;
469 initrd_end = r3 + r4;
470 ROOT_DEV = Root_RAM0;
471 initrd_below_start_ok = 1;
472 }
473#endif
474 chosen = find_devices("chosen");
475 if (chosen != NULL) {
476 p = get_property(chosen, "bootargs", NULL);
477 if (p && *p) {
478 strlcpy(cmd_line, p, sizeof(cmd_line));
479 }
480 }
481 }
482#ifdef CONFIG_ADB
483 if (strstr(cmd_line, "adb_sync")) {
484 extern int __adb_probe_sync;
485 __adb_probe_sync = 1;
486 }
487#endif /* CONFIG_ADB */
488
489 switch (_machine) {
490#ifdef CONFIG_PPC_CHRP
491 case _MACH_chrp:
492 chrp_init(r3, r4, r5, r6, r7);
493 break;
494#endif
495 }
496#endif /* CONFIG_PPC_OF */
497} 338}
498#endif /* CONFIG_PPC_MULTIPLATFORM */ 339#endif /* CONFIG_PPC_PREP */
499
500#ifdef CONFIG_PPC_OF
501#ifdef CONFIG_SERIAL_CORE_CONSOLE
502extern char *of_stdout_device;
503
504static int __init set_preferred_console(void)
505{
506 struct device_node *prom_stdout;
507 char *name;
508 int offset = 0;
509
510 if (of_stdout_device == NULL)
511 return -ENODEV;
512
513 /* The user has requested a console so this is already set up. */
514 if (strstr(saved_command_line, "console="))
515 return -EBUSY;
516
517 prom_stdout = find_path_device(of_stdout_device);
518 if (!prom_stdout)
519 return -ENODEV;
520
521 name = (char *)get_property(prom_stdout, "name", NULL);
522 if (!name)
523 return -ENODEV;
524
525 if (strcmp(name, "serial") == 0) {
526 int i;
527 u32 *reg = (u32 *)get_property(prom_stdout, "reg", &i);
528 if (i > 8) {
529 switch (reg[1]) {
530 case 0x3f8:
531 offset = 0;
532 break;
533 case 0x2f8:
534 offset = 1;
535 break;
536 case 0x898:
537 offset = 2;
538 break;
539 case 0x890:
540 offset = 3;
541 break;
542 default:
543 /* We dont recognise the serial port */
544 return -ENODEV;
545 }
546 }
547 } else if (strcmp(name, "ch-a") == 0)
548 offset = 0;
549 else if (strcmp(name, "ch-b") == 0)
550 offset = 1;
551 else
552 return -ENODEV;
553 return add_preferred_console("ttyS", offset, NULL);
554}
555console_initcall(set_preferred_console);
556#endif /* CONFIG_SERIAL_CORE_CONSOLE */
557#endif /* CONFIG_PPC_OF */
558 340
559struct bi_record *find_bootinfo(void) 341struct bi_record *find_bootinfo(void)
560{ 342{
@@ -590,23 +372,6 @@ void parse_bootinfo(struct bi_record *rec)
590 initrd_end = data[0] + data[1] + KERNELBASE; 372 initrd_end = data[0] + data[1] + KERNELBASE;
591 break; 373 break;
592#endif /* CONFIG_BLK_DEV_INITRD */ 374#endif /* CONFIG_BLK_DEV_INITRD */
593#ifdef CONFIG_PPC_MULTIPLATFORM
594 case BI_MACHTYPE:
595 /* Machine types changed with the merge. Since the
596 * bootinfo are now deprecated, we can just hard code
597 * the appropriate conversion here for when we are
598 * called with yaboot which passes us a machine type
599 * this way.
600 */
601 switch(data[0]) {
602 case 1: _machine = _MACH_prep; break;
603 case 2: _machine = _MACH_Pmac; break;
604 case 4: _machine = _MACH_chrp; break;
605 default:
606 _machine = data[0];
607 }
608 break;
609#endif
610 case BI_MEMSIZE: 375 case BI_MEMSIZE:
611 boot_mem_size = data[0]; 376 boot_mem_size = data[0];
612 break; 377 break;
@@ -632,9 +397,6 @@ machine_init(unsigned long r3, unsigned long r4, unsigned long r5,
632#ifdef CONFIG_6xx 397#ifdef CONFIG_6xx
633 ppc_md.power_save = ppc6xx_idle; 398 ppc_md.power_save = ppc6xx_idle;
634#endif 399#endif
635#ifdef CONFIG_POWER4
636 ppc_md.power_save = power4_idle;
637#endif
638 400
639 platform_init(r3, r4, r5, r6, r7); 401 platform_init(r3, r4, r5, r6, r7);
640 402
@@ -712,9 +474,8 @@ int __init ppc_init(void)
712 if ( ppc_md.progress ) ppc_md.progress(" ", 0xffff); 474 if ( ppc_md.progress ) ppc_md.progress(" ", 0xffff);
713 475
714 /* register CPU devices */ 476 /* register CPU devices */
715 for (i = 0; i < NR_CPUS; i++) 477 for_each_possible_cpu(i)
716 if (cpu_possible(i)) 478 register_cpu(&cpu_devices[i], i, NULL);
717 register_cpu(&cpu_devices[i], i, NULL);
718 479
719 /* call platform init */ 480 /* call platform init */
720 if (ppc_md.init != NULL) { 481 if (ppc_md.init != NULL) {
@@ -801,7 +562,4 @@ void __init setup_arch(char **cmdline_p)
801 if ( ppc_md.progress ) ppc_md.progress("arch: exit", 0x3eab); 562 if ( ppc_md.progress ) ppc_md.progress("arch: exit", 0x3eab);
802 563
803 paging_init(); 564 paging_init();
804
805 /* this is for modules since _machine can be a define -- Cort */
806 ppc_md.ppc_machine = _machine;
807} 565}
diff --git a/arch/ppc/kernel/smp-tbsync.c b/arch/ppc/kernel/smp-tbsync.c
index 2c9cd95bcea6..6a5694fcc711 100644
--- a/arch/ppc/kernel/smp-tbsync.c
+++ b/arch/ppc/kernel/smp-tbsync.c
@@ -126,8 +126,7 @@ smp_generic_give_timebase( void )
126 printk("Synchronizing timebase\n"); 126 printk("Synchronizing timebase\n");
127 127
128 /* if this fails then this kernel won't work anyway... */ 128 /* if this fails then this kernel won't work anyway... */
129 tbsync = kmalloc( sizeof(*tbsync), GFP_KERNEL ); 129 tbsync = kzalloc( sizeof(*tbsync), GFP_KERNEL );
130 memset( tbsync, 0, sizeof(*tbsync) );
131 mb(); 130 mb();
132 running = 1; 131 running = 1;
133 132
diff --git a/arch/ppc/kernel/smp.c b/arch/ppc/kernel/smp.c
index e55cdda6149a..f77795a64dae 100644
--- a/arch/ppc/kernel/smp.c
+++ b/arch/ppc/kernel/smp.c
@@ -311,7 +311,7 @@ void __init smp_prepare_cpus(unsigned int max_cpus)
311 /* Backup CPU 0 state */ 311 /* Backup CPU 0 state */
312 __save_cpu_setup(); 312 __save_cpu_setup();
313 313
314 for_each_cpu(cpu) { 314 for_each_possible_cpu(cpu) {
315 if (cpu == smp_processor_id()) 315 if (cpu == smp_processor_id())
316 continue; 316 continue;
317 /* create a process for the processor */ 317 /* create a process for the processor */
diff --git a/arch/ppc/kernel/traps.c b/arch/ppc/kernel/traps.c
index 6d0a1838d94c..1c0d68026abd 100644
--- a/arch/ppc/kernel/traps.c
+++ b/arch/ppc/kernel/traps.c
@@ -1,6 +1,4 @@
1/* 1/*
2 * arch/ppc/kernel/traps.c
3 *
4 * Copyright (C) 1995-1996 Gary Thomas (gdt@linuxppc.org) 2 * Copyright (C) 1995-1996 Gary Thomas (gdt@linuxppc.org)
5 * 3 *
6 * This program is free software; you can redistribute it and/or 4 * This program is free software; you can redistribute it and/or
diff --git a/arch/ppc/lib/rheap.c b/arch/ppc/lib/rheap.c
index 42c5de2c898f..31e511856dc5 100644
--- a/arch/ppc/lib/rheap.c
+++ b/arch/ppc/lib/rheap.c
@@ -1,6 +1,4 @@
1/* 1/*
2 * arch/ppc/syslib/rheap.c
3 *
4 * A Remote Heap. Remote means that we don't touch the memory that the 2 * A Remote Heap. Remote means that we don't touch the memory that the
5 * heap points to. Normal heap implementations use the memory they manage 3 * heap points to. Normal heap implementations use the memory they manage
6 * to place their list. We cannot do that because the memory we manage may 4 * to place their list. We cannot do that because the memory we manage may
diff --git a/arch/ppc/lib/strcase.c b/arch/ppc/lib/strcase.c
index 36b521091bbc..3b0094cc2b52 100644
--- a/arch/ppc/lib/strcase.c
+++ b/arch/ppc/lib/strcase.c
@@ -1,4 +1,5 @@
1#include <linux/ctype.h> 1#include <linux/ctype.h>
2#include <linux/types.h>
2 3
3int strcasecmp(const char *s1, const char *s2) 4int strcasecmp(const char *s1, const char *s2)
4{ 5{
@@ -11,7 +12,7 @@ int strcasecmp(const char *s1, const char *s2)
11 return c1 - c2; 12 return c1 - c2;
12} 13}
13 14
14int strncasecmp(const char *s1, const char *s2, int n) 15int strncasecmp(const char *s1, const char *s2, size_t n)
15{ 16{
16 int c1, c2; 17 int c1, c2;
17 18
diff --git a/arch/ppc/mm/44x_mmu.c b/arch/ppc/mm/44x_mmu.c
index 3d79ce281b67..e0152a9b26e6 100644
--- a/arch/ppc/mm/44x_mmu.c
+++ b/arch/ppc/mm/44x_mmu.c
@@ -104,7 +104,7 @@ unsigned long __init mmu_mapin_ram(void)
104 104
105 /* Determine number of entries necessary to cover lowmem */ 105 /* Determine number of entries necessary to cover lowmem */
106 pinned_tlbs = (unsigned int) 106 pinned_tlbs = (unsigned int)
107 (_ALIGN(total_lowmem, PPC44x_PIN_SIZE) >> PPC44x_PIN_SHIFT); 107 (_ALIGN(total_lowmem, PPC_PIN_SIZE) >> PPC44x_PIN_SHIFT);
108 108
109 /* Write upper watermark to save location */ 109 /* Write upper watermark to save location */
110 tlb_44x_hwater = PPC44x_LOW_SLOT - pinned_tlbs; 110 tlb_44x_hwater = PPC44x_LOW_SLOT - pinned_tlbs;
@@ -112,7 +112,7 @@ unsigned long __init mmu_mapin_ram(void)
112 /* If necessary, set additional pinned TLBs */ 112 /* If necessary, set additional pinned TLBs */
113 if (pinned_tlbs > 1) 113 if (pinned_tlbs > 1)
114 for (i = (PPC44x_LOW_SLOT-(pinned_tlbs-1)); i < PPC44x_LOW_SLOT; i++) { 114 for (i = (PPC44x_LOW_SLOT-(pinned_tlbs-1)); i < PPC44x_LOW_SLOT; i++) {
115 unsigned int phys_addr = (PPC44x_LOW_SLOT-i) * PPC44x_PIN_SIZE; 115 unsigned int phys_addr = (PPC44x_LOW_SLOT-i) * PPC_PIN_SIZE;
116 ppc44x_pin_tlb(i, phys_addr+PAGE_OFFSET, phys_addr); 116 ppc44x_pin_tlb(i, phys_addr+PAGE_OFFSET, phys_addr);
117 } 117 }
118 118
diff --git a/arch/ppc/mm/fault.c b/arch/ppc/mm/fault.c
index ee5e9f25baf9..8e08ca32531a 100644
--- a/arch/ppc/mm/fault.c
+++ b/arch/ppc/mm/fault.c
@@ -1,6 +1,4 @@
1/* 1/*
2 * arch/ppc/mm/fault.c
3 *
4 * PowerPC version 2 * PowerPC version
5 * Copyright (C) 1995-1996 Gary Thomas (gdt@linuxppc.org) 3 * Copyright (C) 1995-1996 Gary Thomas (gdt@linuxppc.org)
6 * 4 *
@@ -204,6 +202,7 @@ good_area:
204 /* an exec - 4xx/Book-E allows for per-page execute permission */ 202 /* an exec - 4xx/Book-E allows for per-page execute permission */
205 } else if (TRAP(regs) == 0x400) { 203 } else if (TRAP(regs) == 0x400) {
206 pte_t *ptep; 204 pte_t *ptep;
205 pmd_t *pmdp;
207 206
208#if 0 207#if 0
209 /* It would be nice to actually enforce the VM execute 208 /* It would be nice to actually enforce the VM execute
@@ -217,21 +216,24 @@ good_area:
217 /* Since 4xx/Book-E supports per-page execute permission, 216 /* Since 4xx/Book-E supports per-page execute permission,
218 * we lazily flush dcache to icache. */ 217 * we lazily flush dcache to icache. */
219 ptep = NULL; 218 ptep = NULL;
220 if (get_pteptr(mm, address, &ptep) && pte_present(*ptep)) { 219 if (get_pteptr(mm, address, &ptep, &pmdp)) {
221 struct page *page = pte_page(*ptep); 220 spinlock_t *ptl = pte_lockptr(mm, pmdp);
222 221 spin_lock(ptl);
223 if (! test_bit(PG_arch_1, &page->flags)) { 222 if (pte_present(*ptep)) {
224 flush_dcache_icache_page(page); 223 struct page *page = pte_page(*ptep);
225 set_bit(PG_arch_1, &page->flags); 224
225 if (!test_bit(PG_arch_1, &page->flags)) {
226 flush_dcache_icache_page(page);
227 set_bit(PG_arch_1, &page->flags);
228 }
229 pte_update(ptep, 0, _PAGE_HWEXEC);
230 _tlbie(address);
231 pte_unmap_unlock(ptep, ptl);
232 up_read(&mm->mmap_sem);
233 return 0;
226 } 234 }
227 pte_update(ptep, 0, _PAGE_HWEXEC); 235 pte_unmap_unlock(ptep, ptl);
228 _tlbie(address);
229 pte_unmap(ptep);
230 up_read(&mm->mmap_sem);
231 return 0;
232 } 236 }
233 if (ptep != NULL)
234 pte_unmap(ptep);
235#endif 237#endif
236 /* a read */ 238 /* a read */
237 } else { 239 } else {
diff --git a/arch/ppc/mm/hashtable.S b/arch/ppc/mm/hashtable.S
index 3ec87c91343e..31d0a924317c 100644
--- a/arch/ppc/mm/hashtable.S
+++ b/arch/ppc/mm/hashtable.S
@@ -1,6 +1,4 @@
1/* 1/*
2 * arch/ppc/kernel/hashtable.S
3 *
4 * $Id: hashtable.S,v 1.6 1999/10/08 01:56:15 paulus Exp $ 2 * $Id: hashtable.S,v 1.6 1999/10/08 01:56:15 paulus Exp $
5 * 3 *
6 * PowerPC version 4 * PowerPC version
@@ -76,12 +74,6 @@ _GLOBAL(hash_page_sync)
76 */ 74 */
77 .text 75 .text
78_GLOBAL(hash_page) 76_GLOBAL(hash_page)
79#ifdef CONFIG_PPC64BRIDGE
80 mfmsr r0
81 clrldi r0,r0,1 /* make sure it's in 32-bit mode */
82 MTMSRD(r0)
83 isync
84#endif
85 tophys(r7,0) /* gets -KERNELBASE into r7 */ 77 tophys(r7,0) /* gets -KERNELBASE into r7 */
86#ifdef CONFIG_SMP 78#ifdef CONFIG_SMP
87 addis r8,r7,mmu_hash_lock@h 79 addis r8,r7,mmu_hash_lock@h
@@ -305,7 +297,6 @@ Hash_base = 0xc0180000
305Hash_bits = 12 /* e.g. 256kB hash table */ 297Hash_bits = 12 /* e.g. 256kB hash table */
306Hash_msk = (((1 << Hash_bits) - 1) * 64) 298Hash_msk = (((1 << Hash_bits) - 1) * 64)
307 299
308#ifndef CONFIG_PPC64BRIDGE
309/* defines for the PTE format for 32-bit PPCs */ 300/* defines for the PTE format for 32-bit PPCs */
310#define PTE_SIZE 8 301#define PTE_SIZE 8
311#define PTEG_SIZE 64 302#define PTEG_SIZE 64
@@ -319,21 +310,6 @@ Hash_msk = (((1 << Hash_bits) - 1) * 64)
319#define SET_V(r) oris r,r,PTE_V@h 310#define SET_V(r) oris r,r,PTE_V@h
320#define CLR_V(r,t) rlwinm r,r,0,1,31 311#define CLR_V(r,t) rlwinm r,r,0,1,31
321 312
322#else
323/* defines for the PTE format for 64-bit PPCs */
324#define PTE_SIZE 16
325#define PTEG_SIZE 128
326#define LG_PTEG_SIZE 7
327#define LDPTEu ldu
328#define STPTE std
329#define CMPPTE cmpd
330#define PTE_H 2
331#define PTE_V 1
332#define TST_V(r) andi. r,r,PTE_V
333#define SET_V(r) ori r,r,PTE_V
334#define CLR_V(r,t) li t,PTE_V; andc r,r,t
335#endif /* CONFIG_PPC64BRIDGE */
336
337#define HASH_LEFT 31-(LG_PTEG_SIZE+Hash_bits-1) 313#define HASH_LEFT 31-(LG_PTEG_SIZE+Hash_bits-1)
338#define HASH_RIGHT 31-LG_PTEG_SIZE 314#define HASH_RIGHT 31-LG_PTEG_SIZE
339 315
@@ -351,14 +327,8 @@ BEGIN_FTR_SECTION
351END_FTR_SECTION_IFSET(CPU_FTR_NEED_COHERENT) 327END_FTR_SECTION_IFSET(CPU_FTR_NEED_COHERENT)
352 328
353 /* Construct the high word of the PPC-style PTE (r5) */ 329 /* Construct the high word of the PPC-style PTE (r5) */
354#ifndef CONFIG_PPC64BRIDGE
355 rlwinm r5,r3,7,1,24 /* put VSID in 0x7fffff80 bits */ 330 rlwinm r5,r3,7,1,24 /* put VSID in 0x7fffff80 bits */
356 rlwimi r5,r4,10,26,31 /* put in API (abbrev page index) */ 331 rlwimi r5,r4,10,26,31 /* put in API (abbrev page index) */
357#else /* CONFIG_PPC64BRIDGE */
358 clrlwi r3,r3,8 /* reduce vsid to 24 bits */
359 sldi r5,r3,12 /* shift vsid into position */
360 rlwimi r5,r4,16,20,24 /* put in API (abbrev page index) */
361#endif /* CONFIG_PPC64BRIDGE */
362 SET_V(r5) /* set V (valid) bit */ 332 SET_V(r5) /* set V (valid) bit */
363 333
364 /* Get the address of the primary PTE group in the hash table (r3) */ 334 /* Get the address of the primary PTE group in the hash table (r3) */
@@ -542,14 +512,8 @@ _GLOBAL(flush_hash_pages)
542 add r3,r3,r0 /* note code below trims to 24 bits */ 512 add r3,r3,r0 /* note code below trims to 24 bits */
543 513
544 /* Construct the high word of the PPC-style PTE (r11) */ 514 /* Construct the high word of the PPC-style PTE (r11) */
545#ifndef CONFIG_PPC64BRIDGE
546 rlwinm r11,r3,7,1,24 /* put VSID in 0x7fffff80 bits */ 515 rlwinm r11,r3,7,1,24 /* put VSID in 0x7fffff80 bits */
547 rlwimi r11,r4,10,26,31 /* put in API (abbrev page index) */ 516 rlwimi r11,r4,10,26,31 /* put in API (abbrev page index) */
548#else /* CONFIG_PPC64BRIDGE */
549 clrlwi r3,r3,8 /* reduce vsid to 24 bits */
550 sldi r11,r3,12 /* shift vsid into position */
551 rlwimi r11,r4,16,20,24 /* put in API (abbrev page index) */
552#endif /* CONFIG_PPC64BRIDGE */
553 SET_V(r11) /* set V (valid) bit */ 517 SET_V(r11) /* set V (valid) bit */
554 518
555#ifdef CONFIG_SMP 519#ifdef CONFIG_SMP
diff --git a/arch/ppc/mm/init.c b/arch/ppc/mm/init.c
index 134db5c04203..386e000bcb73 100644
--- a/arch/ppc/mm/init.c
+++ b/arch/ppc/mm/init.c
@@ -140,7 +140,7 @@ static void free_sec(unsigned long start, unsigned long end, const char *name)
140 140
141 while (start < end) { 141 while (start < end) {
142 ClearPageReserved(virt_to_page(start)); 142 ClearPageReserved(virt_to_page(start));
143 set_page_count(virt_to_page(start), 1); 143 init_page_count(virt_to_page(start));
144 free_page(start); 144 free_page(start);
145 cnt++; 145 cnt++;
146 start += PAGE_SIZE; 146 start += PAGE_SIZE;
@@ -172,7 +172,7 @@ void free_initrd_mem(unsigned long start, unsigned long end)
172 172
173 for (; start < end; start += PAGE_SIZE) { 173 for (; start < end; start += PAGE_SIZE) {
174 ClearPageReserved(virt_to_page(start)); 174 ClearPageReserved(virt_to_page(start));
175 set_page_count(virt_to_page(start), 1); 175 init_page_count(virt_to_page(start));
176 free_page(start); 176 free_page(start);
177 totalram_pages++; 177 totalram_pages++;
178 } 178 }
@@ -412,14 +412,6 @@ void __init mem_init(void)
412 } 412 }
413#endif /* CONFIG_BLK_DEV_INITRD */ 413#endif /* CONFIG_BLK_DEV_INITRD */
414 414
415#ifdef CONFIG_PPC_OF
416 /* mark the RTAS pages as reserved */
417 if ( rtas_data )
418 for (addr = (ulong)__va(rtas_data);
419 addr < PAGE_ALIGN((ulong)__va(rtas_data)+rtas_size) ;
420 addr += PAGE_SIZE)
421 SetPageReserved(virt_to_page(addr));
422#endif
423 for (addr = PAGE_OFFSET; addr < (unsigned long)high_memory; 415 for (addr = PAGE_OFFSET; addr < (unsigned long)high_memory;
424 addr += PAGE_SIZE) { 416 addr += PAGE_SIZE) {
425 if (!PageReserved(virt_to_page(addr))) 417 if (!PageReserved(virt_to_page(addr)))
@@ -441,7 +433,7 @@ void __init mem_init(void)
441 struct page *page = mem_map + pfn; 433 struct page *page = mem_map + pfn;
442 434
443 ClearPageReserved(page); 435 ClearPageReserved(page);
444 set_page_count(page, 1); 436 init_page_count(page);
445 __free_page(page); 437 __free_page(page);
446 totalhigh_pages++; 438 totalhigh_pages++;
447 } 439 }
@@ -494,11 +486,6 @@ set_phys_avail(unsigned long total_memory)
494 initrd_end - initrd_start, 1); 486 initrd_end - initrd_start, 1);
495 } 487 }
496#endif /* CONFIG_BLK_DEV_INITRD */ 488#endif /* CONFIG_BLK_DEV_INITRD */
497#ifdef CONFIG_PPC_OF
498 /* remove the RTAS pages from the available memory */
499 if (rtas_data)
500 mem_pieces_remove(&phys_avail, rtas_data, rtas_size, 1);
501#endif
502} 489}
503 490
504/* Mark some memory as reserved by removing it from phys_avail. */ 491/* Mark some memory as reserved by removing it from phys_avail. */
diff --git a/arch/ppc/mm/mmu_context.c b/arch/ppc/mm/mmu_context.c
index a8816e0f6a86..b4a4b3f02a1c 100644
--- a/arch/ppc/mm/mmu_context.c
+++ b/arch/ppc/mm/mmu_context.c
@@ -2,7 +2,7 @@
2 * This file contains the routines for handling the MMU on those 2 * This file contains the routines for handling the MMU on those
3 * PowerPC implementations where the MMU substantially follows the 3 * PowerPC implementations where the MMU substantially follows the
4 * architecture specification. This includes the 6xx, 7xx, 7xxx, 4 * architecture specification. This includes the 6xx, 7xx, 7xxx,
5 * 8260, and POWER3 implementations but excludes the 8xx and 4xx. 5 * 8260, and 83xx implementations but excludes the 8xx and 4xx.
6 * -- paulus 6 * -- paulus
7 * 7 *
8 * Derived from arch/ppc/mm/init.c: 8 * Derived from arch/ppc/mm/init.c:
diff --git a/arch/ppc/mm/pgtable.c b/arch/ppc/mm/pgtable.c
index 6ea9185fd120..706bca8eb144 100644
--- a/arch/ppc/mm/pgtable.c
+++ b/arch/ppc/mm/pgtable.c
@@ -39,7 +39,7 @@ unsigned long ioremap_base;
39unsigned long ioremap_bot; 39unsigned long ioremap_bot;
40int io_bat_index; 40int io_bat_index;
41 41
42#if defined(CONFIG_6xx) || defined(CONFIG_POWER3) 42#if defined(CONFIG_6xx)
43#define HAVE_BATS 1 43#define HAVE_BATS 1
44#endif 44#endif
45 45
@@ -368,7 +368,7 @@ void __init io_block_mapping(unsigned long virt, phys_addr_t phys,
368 * the PTE pointer is unmodified if PTE is not found. 368 * the PTE pointer is unmodified if PTE is not found.
369 */ 369 */
370int 370int
371get_pteptr(struct mm_struct *mm, unsigned long addr, pte_t **ptep) 371get_pteptr(struct mm_struct *mm, unsigned long addr, pte_t **ptep, pmd_t **pmdp)
372{ 372{
373 pgd_t *pgd; 373 pgd_t *pgd;
374 pmd_t *pmd; 374 pmd_t *pmd;
@@ -383,6 +383,8 @@ get_pteptr(struct mm_struct *mm, unsigned long addr, pte_t **ptep)
383 if (pte) { 383 if (pte) {
384 retval = 1; 384 retval = 1;
385 *ptep = pte; 385 *ptep = pte;
386 if (pmdp)
387 *pmdp = pmd;
386 /* XXX caller needs to do pte_unmap, yuck */ 388 /* XXX caller needs to do pte_unmap, yuck */
387 } 389 }
388 } 390 }
@@ -420,7 +422,7 @@ unsigned long iopa(unsigned long addr)
420 mm = &init_mm; 422 mm = &init_mm;
421 423
422 pa = 0; 424 pa = 0;
423 if (get_pteptr(mm, addr, &pte)) { 425 if (get_pteptr(mm, addr, &pte, NULL)) {
424 pa = (pte_val(*pte) & PAGE_MASK) | (addr & ~PAGE_MASK); 426 pa = (pte_val(*pte) & PAGE_MASK) | (addr & ~PAGE_MASK);
425 pte_unmap(pte); 427 pte_unmap(pte);
426 } 428 }
diff --git a/arch/ppc/mm/ppc_mmu.c b/arch/ppc/mm/ppc_mmu.c
index 9a381ed5eb21..25bb6f3347c1 100644
--- a/arch/ppc/mm/ppc_mmu.c
+++ b/arch/ppc/mm/ppc_mmu.c
@@ -2,7 +2,7 @@
2 * This file contains the routines for handling the MMU on those 2 * This file contains the routines for handling the MMU on those
3 * PowerPC implementations where the MMU substantially follows the 3 * PowerPC implementations where the MMU substantially follows the
4 * architecture specification. This includes the 6xx, 7xx, 7xxx, 4 * architecture specification. This includes the 6xx, 7xx, 7xxx,
5 * 8260, and POWER3 implementations but excludes the 8xx and 4xx. 5 * 8260, and 83xx implementations but excludes the 8xx and 4xx.
6 * -- paulus 6 * -- paulus
7 * 7 *
8 * Derived from arch/ppc/mm/init.c: 8 * Derived from arch/ppc/mm/init.c:
@@ -42,11 +42,7 @@ unsigned long _SDR1;
42 42
43union ubat { /* BAT register values to be loaded */ 43union ubat { /* BAT register values to be loaded */
44 BAT bat; 44 BAT bat;
45#ifdef CONFIG_PPC64BRIDGE
46 u64 word[2];
47#else
48 u32 word[2]; 45 u32 word[2];
49#endif
50} BATS[4][2]; /* 4 pairs of IBAT, DBAT */ 46} BATS[4][2]; /* 4 pairs of IBAT, DBAT */
51 47
52struct batrange { /* stores address ranges mapped by BATs */ 48struct batrange { /* stores address ranges mapped by BATs */
@@ -83,9 +79,6 @@ unsigned long p_mapped_by_bats(unsigned long pa)
83 79
84unsigned long __init mmu_mapin_ram(void) 80unsigned long __init mmu_mapin_ram(void)
85{ 81{
86#ifdef CONFIG_POWER4
87 return 0;
88#else
89 unsigned long tot, bl, done; 82 unsigned long tot, bl, done;
90 unsigned long max_size = (256<<20); 83 unsigned long max_size = (256<<20);
91 unsigned long align; 84 unsigned long align;
@@ -122,7 +115,6 @@ unsigned long __init mmu_mapin_ram(void)
122 } 115 }
123 116
124 return done; 117 return done;
125#endif
126} 118}
127 119
128/* 120/*
@@ -205,27 +197,10 @@ void __init MMU_init_hw(void)
205 197
206 if ( ppc_md.progress ) ppc_md.progress("hash:enter", 0x105); 198 if ( ppc_md.progress ) ppc_md.progress("hash:enter", 0x105);
207 199
208#ifdef CONFIG_PPC64BRIDGE
209#define LG_HPTEG_SIZE 7 /* 128 bytes per HPTEG */
210#define SDR1_LOW_BITS (lg_n_hpteg - 11)
211#define MIN_N_HPTEG 2048 /* min 256kB hash table */
212#else
213#define LG_HPTEG_SIZE 6 /* 64 bytes per HPTEG */ 200#define LG_HPTEG_SIZE 6 /* 64 bytes per HPTEG */
214#define SDR1_LOW_BITS ((n_hpteg - 1) >> 10) 201#define SDR1_LOW_BITS ((n_hpteg - 1) >> 10)
215#define MIN_N_HPTEG 1024 /* min 64kB hash table */ 202#define MIN_N_HPTEG 1024 /* min 64kB hash table */
216#endif
217
218#ifdef CONFIG_POWER4
219 /* The hash table has already been allocated and initialized
220 in prom.c */
221 n_hpteg = Hash_size >> LG_HPTEG_SIZE;
222 lg_n_hpteg = __ilog2(n_hpteg);
223
224 /* Remove the hash table from the available memory */
225 if (Hash)
226 reserve_phys_mem(__pa(Hash), Hash_size);
227 203
228#else /* CONFIG_POWER4 */
229 /* 204 /*
230 * Allow 1 HPTE (1/8 HPTEG) for each page of memory. 205 * Allow 1 HPTE (1/8 HPTEG) for each page of memory.
231 * This is less than the recommended amount, but then 206 * This is less than the recommended amount, but then
@@ -248,7 +223,6 @@ void __init MMU_init_hw(void)
248 Hash = mem_pieces_find(Hash_size, Hash_size); 223 Hash = mem_pieces_find(Hash_size, Hash_size);
249 cacheable_memzero(Hash, Hash_size); 224 cacheable_memzero(Hash, Hash_size);
250 _SDR1 = __pa(Hash) | SDR1_LOW_BITS; 225 _SDR1 = __pa(Hash) | SDR1_LOW_BITS;
251#endif /* CONFIG_POWER4 */
252 226
253 Hash_end = (PTE *) ((unsigned long)Hash + Hash_size); 227 Hash_end = (PTE *) ((unsigned long)Hash + Hash_size);
254 228
diff --git a/arch/ppc/platforms/4xx/Kconfig b/arch/ppc/platforms/4xx/Kconfig
index d8837911bbc6..174ddbc9758b 100644
--- a/arch/ppc/platforms/4xx/Kconfig
+++ b/arch/ppc/platforms/4xx/Kconfig
@@ -57,6 +57,10 @@ config XILINX_ML300
57 help 57 help
58 This option enables support for the Xilinx ML300 evaluation board. 58 This option enables support for the Xilinx ML300 evaluation board.
59 59
60config XILINX_ML403
61 bool "Xilinx-ML403"
62 help
63 This option enables support for the Xilinx ML403 evaluation board.
60endchoice 64endchoice
61 65
62choice 66choice
@@ -172,11 +176,6 @@ config IBM_OCP
172 depends on ASH || BAMBOO || BUBINGA || CPCI405 || EBONY || EP405 || LUAN || YUCCA || OCOTEA || REDWOOD_5 || REDWOOD_6 || SYCAMORE || WALNUT 176 depends on ASH || BAMBOO || BUBINGA || CPCI405 || EBONY || EP405 || LUAN || YUCCA || OCOTEA || REDWOOD_5 || REDWOOD_6 || SYCAMORE || WALNUT
173 default y 177 default y
174 178
175config XILINX_OCP
176 bool
177 depends on XILINX_ML300
178 default y
179
180config IBM_EMAC4 179config IBM_EMAC4
181 bool 180 bool
182 depends on 440GX || 440SP || 440SPE 181 depends on 440GX || 440SP || 440SPE
@@ -208,11 +207,21 @@ config 405GPR
208 depends on SYCAMORE 207 depends on SYCAMORE
209 default y 208 default y
210 209
211config VIRTEX_II_PRO 210config XILINX_VIRTEX_II_PRO
212 bool 211 bool
213 depends on XILINX_ML300 212 depends on XILINX_ML300
214 default y 213 default y
215 214
215config XILINX_VIRTEX_4_FX
216 bool
217 depends on XILINX_ML403
218 default y
219
220config XILINX_VIRTEX
221 bool
222 depends on XILINX_VIRTEX_II_PRO || XILINX_VIRTEX_4_FX
223 default y
224
216config STB03xxx 225config STB03xxx
217 bool 226 bool
218 depends on REDWOOD_5 || REDWOOD_6 227 depends on REDWOOD_5 || REDWOOD_6
@@ -220,7 +229,7 @@ config STB03xxx
220 229
221config EMBEDDEDBOOT 230config EMBEDDEDBOOT
222 bool 231 bool
223 depends on EP405 || XILINX_ML300 232 depends on EP405 || XILINX_ML300 || XILINX_ML403
224 default y 233 default y
225 234
226config IBM_OPENBIOS 235config IBM_OPENBIOS
diff --git a/arch/ppc/platforms/4xx/Makefile b/arch/ppc/platforms/4xx/Makefile
index c9bb61170954..a04a0d0a0f5c 100644
--- a/arch/ppc/platforms/4xx/Makefile
+++ b/arch/ppc/platforms/4xx/Makefile
@@ -14,6 +14,7 @@ obj-$(CONFIG_REDWOOD_6) += redwood6.o
14obj-$(CONFIG_SYCAMORE) += sycamore.o 14obj-$(CONFIG_SYCAMORE) += sycamore.o
15obj-$(CONFIG_WALNUT) += walnut.o 15obj-$(CONFIG_WALNUT) += walnut.o
16obj-$(CONFIG_XILINX_ML300) += xilinx_ml300.o 16obj-$(CONFIG_XILINX_ML300) += xilinx_ml300.o
17obj-$(CONFIG_XILINX_ML403) += xilinx_ml403.o
17 18
18obj-$(CONFIG_405GP) += ibm405gp.o 19obj-$(CONFIG_405GP) += ibm405gp.o
19obj-$(CONFIG_REDWOOD_5) += ibmstb4.o 20obj-$(CONFIG_REDWOOD_5) += ibmstb4.o
@@ -26,4 +27,5 @@ obj-$(CONFIG_440SP) += ibm440sp.o
26obj-$(CONFIG_440SPE) += ppc440spe.o 27obj-$(CONFIG_440SPE) += ppc440spe.o
27obj-$(CONFIG_405EP) += ibm405ep.o 28obj-$(CONFIG_405EP) += ibm405ep.o
28obj-$(CONFIG_405GPR) += ibm405gpr.o 29obj-$(CONFIG_405GPR) += ibm405gpr.o
29obj-$(CONFIG_VIRTEX_II_PRO) += virtex-ii_pro.o 30obj-$(CONFIG_XILINX_VIRTEX) += virtex.o
31
diff --git a/arch/ppc/platforms/4xx/bamboo.c b/arch/ppc/platforms/4xx/bamboo.c
index 0ec53f049338..b940cfd646c2 100644
--- a/arch/ppc/platforms/4xx/bamboo.c
+++ b/arch/ppc/platforms/4xx/bamboo.c
@@ -1,6 +1,4 @@
1/* 1/*
2 * arch/ppc/platforms/4xx/bamboo.c
3 *
4 * Bamboo board specific routines 2 * Bamboo board specific routines
5 * 3 *
6 * Wade Farnsworth <wfarnsworth@mvista.com> 4 * Wade Farnsworth <wfarnsworth@mvista.com>
diff --git a/arch/ppc/platforms/4xx/bamboo.h b/arch/ppc/platforms/4xx/bamboo.h
index 5c0192826494..31c0dd6a26cb 100644
--- a/arch/ppc/platforms/4xx/bamboo.h
+++ b/arch/ppc/platforms/4xx/bamboo.h
@@ -1,6 +1,4 @@
1/* 1/*
2 * arch/ppc/platforms/bamboo.h
3 *
4 * Bamboo board definitions 2 * Bamboo board definitions
5 * 3 *
6 * Wade Farnsworth <wfarnsworth@mvista.com> 4 * Wade Farnsworth <wfarnsworth@mvista.com>
diff --git a/arch/ppc/platforms/4xx/bubinga.h b/arch/ppc/platforms/4xx/bubinga.h
index b5380cfaf5c0..606aa9fa5caa 100644
--- a/arch/ppc/platforms/4xx/bubinga.h
+++ b/arch/ppc/platforms/4xx/bubinga.h
@@ -1,6 +1,4 @@
1/* 1/*
2 * arch/ppc/platforms/4xx/bubinga.h
3 *
4 * Bubinga board definitions 2 * Bubinga board definitions
5 * 3 *
6 * Copyright (c) 2005 DENX Software Engineering 4 * Copyright (c) 2005 DENX Software Engineering
diff --git a/arch/ppc/platforms/4xx/cpci405.c b/arch/ppc/platforms/4xx/cpci405.c
index ff966773a0bf..6571e39fbe48 100644
--- a/arch/ppc/platforms/4xx/cpci405.c
+++ b/arch/ppc/platforms/4xx/cpci405.c
@@ -1,6 +1,4 @@
1/* 1/*
2 * arch/ppc/platforms/cpci405.c
3 *
4 * Board setup routines for the esd CPCI-405 cPCI Board. 2 * Board setup routines for the esd CPCI-405 cPCI Board.
5 * 3 *
6 * Author: Stefan Roese 4 * Author: Stefan Roese
diff --git a/arch/ppc/platforms/4xx/ebony.c b/arch/ppc/platforms/4xx/ebony.c
index 9a828b623417..b4ecb9c79854 100644
--- a/arch/ppc/platforms/4xx/ebony.c
+++ b/arch/ppc/platforms/4xx/ebony.c
@@ -1,6 +1,4 @@
1/* 1/*
2 * arch/ppc/platforms/4xx/ebony.c
3 *
4 * Ebony board specific routines 2 * Ebony board specific routines
5 * 3 *
6 * Matt Porter <mporter@kernel.crashing.org> 4 * Matt Porter <mporter@kernel.crashing.org>
diff --git a/arch/ppc/platforms/4xx/ebony.h b/arch/ppc/platforms/4xx/ebony.h
index b91ad4272dfe..27b2e77c7c83 100644
--- a/arch/ppc/platforms/4xx/ebony.h
+++ b/arch/ppc/platforms/4xx/ebony.h
@@ -1,6 +1,4 @@
1/* 1/*
2 * arch/ppc/platforms/ebony.h
3 *
4 * Ebony board definitions 2 * Ebony board definitions
5 * 3 *
6 * Matt Porter <mporter@mvista.com> 4 * Matt Porter <mporter@mvista.com>
diff --git a/arch/ppc/platforms/4xx/ep405.c b/arch/ppc/platforms/4xx/ep405.c
index 26a07cdb30ec..6efa91ff9c07 100644
--- a/arch/ppc/platforms/4xx/ep405.c
+++ b/arch/ppc/platforms/4xx/ep405.c
@@ -1,6 +1,4 @@
1/* 1/*
2 * arch/ppc/platforms/4xx/ep405.c
3 *
4 * Embedded Planet 405GP board 2 * Embedded Planet 405GP board
5 * http://www.embeddedplanet.com 3 * http://www.embeddedplanet.com
6 * 4 *
diff --git a/arch/ppc/platforms/4xx/ep405.h b/arch/ppc/platforms/4xx/ep405.h
index ea3eb21338fb..9814fc431725 100644
--- a/arch/ppc/platforms/4xx/ep405.h
+++ b/arch/ppc/platforms/4xx/ep405.h
@@ -1,6 +1,4 @@
1/* 1/*
2 * arch/ppc/platforms/4xx/ep405.h
3 *
4 * Embedded Planet 405GP board 2 * Embedded Planet 405GP board
5 * http://www.embeddedplanet.com 3 * http://www.embeddedplanet.com
6 * 4 *
diff --git a/arch/ppc/platforms/4xx/ibm405ep.c b/arch/ppc/platforms/4xx/ibm405ep.c
index 093b28d27a41..55af769a6e70 100644
--- a/arch/ppc/platforms/4xx/ibm405ep.c
+++ b/arch/ppc/platforms/4xx/ibm405ep.c
@@ -1,6 +1,4 @@
1/* 1/*
2 * arch/ppc/platforms/ibm405ep.c
3 *
4 * Support for IBM PPC 405EP processors. 2 * Support for IBM PPC 405EP processors.
5 * 3 *
6 * Author: SAW (IBM), derived from ibmnp405l.c. 4 * Author: SAW (IBM), derived from ibmnp405l.c.
diff --git a/arch/ppc/platforms/4xx/ibm405ep.h b/arch/ppc/platforms/4xx/ibm405ep.h
index e051e3fe8c63..fe46640de152 100644
--- a/arch/ppc/platforms/4xx/ibm405ep.h
+++ b/arch/ppc/platforms/4xx/ibm405ep.h
@@ -1,6 +1,4 @@
1/* 1/*
2 * arch/ppc/platforms/4xx/ibm405ep.h
3 *
4 * IBM PPC 405EP processor defines. 2 * IBM PPC 405EP processor defines.
5 * 3 *
6 * Author: SAW (IBM), derived from ibm405gp.h. 4 * Author: SAW (IBM), derived from ibm405gp.h.
diff --git a/arch/ppc/platforms/4xx/ibm405gp.h b/arch/ppc/platforms/4xx/ibm405gp.h
index b2b642e81af7..eaf0ef57028d 100644
--- a/arch/ppc/platforms/4xx/ibm405gp.h
+++ b/arch/ppc/platforms/4xx/ibm405gp.h
@@ -1,6 +1,4 @@
1/* 1/*
2 * arch/ppc/platforms/4xx/ibm405gp.h
3 *
4 * Author: Armin Kuster akuster@mvista.com 2 * Author: Armin Kuster akuster@mvista.com
5 * 3 *
6 * 2001 (c) MontaVista, Software, Inc. This file is licensed under 4 * 2001 (c) MontaVista, Software, Inc. This file is licensed under
diff --git a/arch/ppc/platforms/4xx/ibm405gpr.c b/arch/ppc/platforms/4xx/ibm405gpr.c
index cd0d00d8e8ee..49da61f6854a 100644
--- a/arch/ppc/platforms/4xx/ibm405gpr.c
+++ b/arch/ppc/platforms/4xx/ibm405gpr.c
@@ -1,6 +1,4 @@
1/* 1/*
2 * arch/ppc/platforms/4xx/ibm405gpr.c
3 *
4 * Author: Armin Kuster <akuster@mvista.com> 2 * Author: Armin Kuster <akuster@mvista.com>
5 * 3 *
6 * 2002 (c) MontaVista, Software, Inc. This file is licensed under 4 * 2002 (c) MontaVista, Software, Inc. This file is licensed under
diff --git a/arch/ppc/platforms/4xx/ibm405gpr.h b/arch/ppc/platforms/4xx/ibm405gpr.h
index 45412fb4368f..e90c5dde01d3 100644
--- a/arch/ppc/platforms/4xx/ibm405gpr.h
+++ b/arch/ppc/platforms/4xx/ibm405gpr.h
@@ -1,6 +1,4 @@
1/* 1/*
2 * arch/ppc/platforms/4xx/ibm405gpr.h
3 *
4 * Author: Armin Kuster <akuster@mvista.com> 2 * Author: Armin Kuster <akuster@mvista.com>
5 * 3 *
6 * 2002 (c) MontaVista, Software, Inc. This file is licensed under 4 * 2002 (c) MontaVista, Software, Inc. This file is licensed under
diff --git a/arch/ppc/platforms/4xx/ibm440ep.c b/arch/ppc/platforms/4xx/ibm440ep.c
index 65ac0b9c2d05..1fed6638c81f 100644
--- a/arch/ppc/platforms/4xx/ibm440ep.c
+++ b/arch/ppc/platforms/4xx/ibm440ep.c
@@ -1,6 +1,4 @@
1/* 1/*
2 * arch/ppc/platforms/4xx/ibm440ep.c
3 *
4 * PPC440EP I/O descriptions 2 * PPC440EP I/O descriptions
5 * 3 *
6 * Wade Farnsworth <wfarnsworth@mvista.com> 4 * Wade Farnsworth <wfarnsworth@mvista.com>
diff --git a/arch/ppc/platforms/4xx/ibm440ep.h b/arch/ppc/platforms/4xx/ibm440ep.h
index 97c80b8e3e10..61717e8a799e 100644
--- a/arch/ppc/platforms/4xx/ibm440ep.h
+++ b/arch/ppc/platforms/4xx/ibm440ep.h
@@ -1,6 +1,4 @@
1/* 1/*
2 * arch/ppc/platforms/4xx/ibm440ep.h
3 *
4 * PPC440EP definitions 2 * PPC440EP definitions
5 * 3 *
6 * Wade Farnsworth <wfarnsworth@mvista.com> 4 * Wade Farnsworth <wfarnsworth@mvista.com>
diff --git a/arch/ppc/platforms/4xx/ibm440gp.c b/arch/ppc/platforms/4xx/ibm440gp.c
index d926245e8b3e..b67a72e5c6fe 100644
--- a/arch/ppc/platforms/4xx/ibm440gp.c
+++ b/arch/ppc/platforms/4xx/ibm440gp.c
@@ -1,6 +1,4 @@
1/* 1/*
2 * arch/ppc/platforms/4xx/ibm440gp.c
3 *
4 * PPC440GP I/O descriptions 2 * PPC440GP I/O descriptions
5 * 3 *
6 * Matt Porter <mporter@mvista.com> 4 * Matt Porter <mporter@mvista.com>
diff --git a/arch/ppc/platforms/4xx/ibm440gp.h b/arch/ppc/platforms/4xx/ibm440gp.h
index ae1efc03b295..7b2763b6024f 100644
--- a/arch/ppc/platforms/4xx/ibm440gp.h
+++ b/arch/ppc/platforms/4xx/ibm440gp.h
@@ -1,6 +1,4 @@
1/* 1/*
2 * arch/ppc/platforms/4xx/ibm440gp.h
3 *
4 * PPC440GP definitions 2 * PPC440GP definitions
5 * 3 *
6 * Roland Dreier <roland@digitalvampire.org> 4 * Roland Dreier <roland@digitalvampire.org>
diff --git a/arch/ppc/platforms/4xx/ibm440gx.c b/arch/ppc/platforms/4xx/ibm440gx.c
index d24c09ee7b18..685abffcb6ce 100644
--- a/arch/ppc/platforms/4xx/ibm440gx.c
+++ b/arch/ppc/platforms/4xx/ibm440gx.c
@@ -1,6 +1,4 @@
1/* 1/*
2 * arch/ppc/platforms/4xx/ibm440gx.c
3 *
4 * PPC440GX I/O descriptions 2 * PPC440GX I/O descriptions
5 * 3 *
6 * Matt Porter <mporter@mvista.com> 4 * Matt Porter <mporter@mvista.com>
diff --git a/arch/ppc/platforms/4xx/ibm440gx.h b/arch/ppc/platforms/4xx/ibm440gx.h
index 0b59d8dcd03c..070a34efe1c7 100644
--- a/arch/ppc/platforms/4xx/ibm440gx.h
+++ b/arch/ppc/platforms/4xx/ibm440gx.h
@@ -1,6 +1,4 @@
1/* 1/*
2 * arch/ppc/platforms/ibm440gx.h
3 *
4 * PPC440GX definitions 2 * PPC440GX definitions
5 * 3 *
6 * Matt Porter <mporter@mvista.com> 4 * Matt Porter <mporter@mvista.com>
diff --git a/arch/ppc/platforms/4xx/ibm440sp.c b/arch/ppc/platforms/4xx/ibm440sp.c
index 71a0117d3597..de8f7ac5623c 100644
--- a/arch/ppc/platforms/4xx/ibm440sp.c
+++ b/arch/ppc/platforms/4xx/ibm440sp.c
@@ -1,6 +1,4 @@
1/* 1/*
2 * arch/ppc/platforms/4xx/ibm440sp.c
3 *
4 * PPC440SP I/O descriptions 2 * PPC440SP I/O descriptions
5 * 3 *
6 * Matt Porter <mporter@kernel.crashing.org> 4 * Matt Porter <mporter@kernel.crashing.org>
diff --git a/arch/ppc/platforms/4xx/ibm440sp.h b/arch/ppc/platforms/4xx/ibm440sp.h
index c71e46a18b9e..77e8bb22c527 100644
--- a/arch/ppc/platforms/4xx/ibm440sp.h
+++ b/arch/ppc/platforms/4xx/ibm440sp.h
@@ -1,6 +1,4 @@
1/* 1/*
2 * arch/ppc/platforms/4xx/ibm440sp.h
3 *
4 * PPC440SP definitions 2 * PPC440SP definitions
5 * 3 *
6 * Matt Porter <mporter@kernel.crashing.org> 4 * Matt Porter <mporter@kernel.crashing.org>
diff --git a/arch/ppc/platforms/4xx/ibmnp405h.c b/arch/ppc/platforms/4xx/ibmnp405h.c
index a477a78f4902..f1dcb0ac15b7 100644
--- a/arch/ppc/platforms/4xx/ibmnp405h.c
+++ b/arch/ppc/platforms/4xx/ibmnp405h.c
@@ -1,6 +1,4 @@
1/* 1/*
2 * arch/ppc/platforms/4xx/ibmnp405h.c
3 *
4 * Author: Armin Kuster <akuster@mvista.com> 2 * Author: Armin Kuster <akuster@mvista.com>
5 * 3 *
6 * 2000-2002 (c) MontaVista, Software, Inc. This file is licensed under 4 * 2000-2002 (c) MontaVista, Software, Inc. This file is licensed under
diff --git a/arch/ppc/platforms/4xx/ibmnp405h.h b/arch/ppc/platforms/4xx/ibmnp405h.h
index e2c2b06128c8..2c683f6aaa66 100644
--- a/arch/ppc/platforms/4xx/ibmnp405h.h
+++ b/arch/ppc/platforms/4xx/ibmnp405h.h
@@ -1,6 +1,4 @@
1/* 1/*
2 * arch/ppc/platforms/4xx/ibmnp405h.h
3 *
4 * Author: Armin Kuster <akuster@mvista.com> 2 * Author: Armin Kuster <akuster@mvista.com>
5 * 3 *
6 * 2002 (c) MontaVista, Software, Inc. This file is licensed under 4 * 2002 (c) MontaVista, Software, Inc. This file is licensed under
diff --git a/arch/ppc/platforms/4xx/ibmstb4.c b/arch/ppc/platforms/4xx/ibmstb4.c
index 7e33bb635443..799a2eccccc3 100644
--- a/arch/ppc/platforms/4xx/ibmstb4.c
+++ b/arch/ppc/platforms/4xx/ibmstb4.c
@@ -1,6 +1,4 @@
1/* 1/*
2 * arch/ppc/platforms/4xx/ibmstb4.c
3 *
4 * Author: Armin Kuster <akuster@mvista.com> 2 * Author: Armin Kuster <akuster@mvista.com>
5 * 3 *
6 * 2000-2001 (c) MontaVista, Software, Inc. This file is licensed under 4 * 2000-2001 (c) MontaVista, Software, Inc. This file is licensed under
diff --git a/arch/ppc/platforms/4xx/ibmstb4.h b/arch/ppc/platforms/4xx/ibmstb4.h
index 9f21d4c88a3d..9de426597351 100644
--- a/arch/ppc/platforms/4xx/ibmstb4.h
+++ b/arch/ppc/platforms/4xx/ibmstb4.h
@@ -1,6 +1,4 @@
1/* 1/*
2 * arch/ppc/platforms/4xx/ibmstb4.h
3 *
4 * Author: Armin Kuster <akuster@mvista.com> 2 * Author: Armin Kuster <akuster@mvista.com>
5 * 3 *
6 * 2001 (c) MontaVista, Software, Inc. This file is licensed under 4 * 2001 (c) MontaVista, Software, Inc. This file is licensed under
diff --git a/arch/ppc/platforms/4xx/ibmstbx25.c b/arch/ppc/platforms/4xx/ibmstbx25.c
index b895b9cca57d..090ddcbecc5e 100644
--- a/arch/ppc/platforms/4xx/ibmstbx25.c
+++ b/arch/ppc/platforms/4xx/ibmstbx25.c
@@ -1,6 +1,4 @@
1/* 1/*
2 * arch/ppc/platforms/4xx/ibmstbx25.c
3 *
4 * Author: Armin Kuster <akuster@mvista.com> 2 * Author: Armin Kuster <akuster@mvista.com>
5 * 3 *
6 * 2000-2002 (c) MontaVista, Software, Inc. This file is licensed under 4 * 2000-2002 (c) MontaVista, Software, Inc. This file is licensed under
diff --git a/arch/ppc/platforms/4xx/ibmstbx25.h b/arch/ppc/platforms/4xx/ibmstbx25.h
index 9a2efc366e9c..6884a49d3482 100644
--- a/arch/ppc/platforms/4xx/ibmstbx25.h
+++ b/arch/ppc/platforms/4xx/ibmstbx25.h
@@ -1,6 +1,4 @@
1/* 1/*
2 * arch/ppc/platforms/4xx/ibmstbx25.h
3 *
4 * Author: Armin Kuster <akuster@mvista.com> 2 * Author: Armin Kuster <akuster@mvista.com>
5 * 3 *
6 * 2002 (c) MontaVista, Software, Inc. This file is licensed under 4 * 2002 (c) MontaVista, Software, Inc. This file is licensed under
diff --git a/arch/ppc/platforms/4xx/luan.c b/arch/ppc/platforms/4xx/luan.c
index 21d29132aebd..5c37de28e135 100644
--- a/arch/ppc/platforms/4xx/luan.c
+++ b/arch/ppc/platforms/4xx/luan.c
@@ -1,6 +1,4 @@
1/* 1/*
2 * arch/ppc/platforms/4xx/luan.c
3 *
4 * Luan board specific routines 2 * Luan board specific routines
5 * 3 *
6 * Matt Porter <mporter@kernel.crashing.org> 4 * Matt Porter <mporter@kernel.crashing.org>
diff --git a/arch/ppc/platforms/4xx/luan.h b/arch/ppc/platforms/4xx/luan.h
index bbe7d0766db8..e0db6a810feb 100644
--- a/arch/ppc/platforms/4xx/luan.h
+++ b/arch/ppc/platforms/4xx/luan.h
@@ -1,6 +1,4 @@
1/* 1/*
2 * arch/ppc/platforms/4xx/luan.h
3 *
4 * Luan board definitions 2 * Luan board definitions
5 * 3 *
6 * Matt Porter <mporter@kernel.crashing.org> 4 * Matt Porter <mporter@kernel.crashing.org>
diff --git a/arch/ppc/platforms/4xx/ocotea.c b/arch/ppc/platforms/4xx/ocotea.c
index 4f355b6acab2..f841972f1fa9 100644
--- a/arch/ppc/platforms/4xx/ocotea.c
+++ b/arch/ppc/platforms/4xx/ocotea.c
@@ -1,6 +1,4 @@
1/* 1/*
2 * arch/ppc/platforms/4xx/ocotea.c
3 *
4 * Ocotea board specific routines 2 * Ocotea board specific routines
5 * 3 *
6 * Matt Porter <mporter@kernel.crashing.org> 4 * Matt Porter <mporter@kernel.crashing.org>
diff --git a/arch/ppc/platforms/4xx/ocotea.h b/arch/ppc/platforms/4xx/ocotea.h
index 33251153ac5f..7c799a9ff82b 100644
--- a/arch/ppc/platforms/4xx/ocotea.h
+++ b/arch/ppc/platforms/4xx/ocotea.h
@@ -1,6 +1,4 @@
1/* 1/*
2 * arch/ppc/platforms/ocotea.h
3 *
4 * Ocotea board definitions 2 * Ocotea board definitions
5 * 3 *
6 * Matt Porter <mporter@kernel.crashing.org> 4 * Matt Porter <mporter@kernel.crashing.org>
diff --git a/arch/ppc/platforms/4xx/ppc440spe.c b/arch/ppc/platforms/4xx/ppc440spe.c
index 6139a0b3393e..1be5d1c8e266 100644
--- a/arch/ppc/platforms/4xx/ppc440spe.c
+++ b/arch/ppc/platforms/4xx/ppc440spe.c
@@ -1,6 +1,4 @@
1/* 1/*
2 * arch/ppc/platforms/4xx/ppc440spe.c
3 *
4 * PPC440SPe I/O descriptions 2 * PPC440SPe I/O descriptions
5 * 3 *
6 * Roland Dreier <rolandd@cisco.com> 4 * Roland Dreier <rolandd@cisco.com>
diff --git a/arch/ppc/platforms/4xx/ppc440spe.h b/arch/ppc/platforms/4xx/ppc440spe.h
index 2216846973b8..d3a620ddcdee 100644
--- a/arch/ppc/platforms/4xx/ppc440spe.h
+++ b/arch/ppc/platforms/4xx/ppc440spe.h
@@ -1,6 +1,4 @@
1/* 1/*
2 * arch/ppc/platforms/4xx/ibm440spe.h
3 *
4 * PPC440SPe definitions 2 * PPC440SPe definitions
5 * 3 *
6 * Roland Dreier <rolandd@cisco.com> 4 * Roland Dreier <rolandd@cisco.com>
diff --git a/arch/ppc/platforms/4xx/redwood5.c b/arch/ppc/platforms/4xx/redwood5.c
index 611ac861804d..53da2b4f7c24 100644
--- a/arch/ppc/platforms/4xx/redwood5.c
+++ b/arch/ppc/platforms/4xx/redwood5.c
@@ -1,6 +1,4 @@
1/* 1/*
2 * arch/ppc/platforms/4xx/redwood5.c
3 *
4 * Support for the IBM redwood5 eval board file 2 * Support for the IBM redwood5 eval board file
5 * 3 *
6 * Author: Armin Kuster <akuster@mvista.com> 4 * Author: Armin Kuster <akuster@mvista.com>
diff --git a/arch/ppc/platforms/4xx/redwood5.h b/arch/ppc/platforms/4xx/redwood5.h
index 264e34fb3fbd..49edd4818970 100644
--- a/arch/ppc/platforms/4xx/redwood5.h
+++ b/arch/ppc/platforms/4xx/redwood5.h
@@ -1,6 +1,4 @@
1/* 1/*
2 * arch/ppc/platforms/4xx/redwood5.h
3 *
4 * Macros, definitions, and data structures specific to the IBM PowerPC 2 * Macros, definitions, and data structures specific to the IBM PowerPC
5 * STB03xxx "Redwood" evaluation board. 3 * STB03xxx "Redwood" evaluation board.
6 * 4 *
diff --git a/arch/ppc/platforms/4xx/redwood6.c b/arch/ppc/platforms/4xx/redwood6.c
index b13116691289..41b27d106fa3 100644
--- a/arch/ppc/platforms/4xx/redwood6.c
+++ b/arch/ppc/platforms/4xx/redwood6.c
@@ -1,6 +1,4 @@
1/* 1/*
2 * arch/ppc/platforms/4xx/redwood6.c
3 *
4 * Author: Armin Kuster <akuster@mvista.com> 2 * Author: Armin Kuster <akuster@mvista.com>
5 * 3 *
6 * 2002 (c) MontaVista, Software, Inc. This file is licensed under 4 * 2002 (c) MontaVista, Software, Inc. This file is licensed under
diff --git a/arch/ppc/platforms/4xx/redwood6.h b/arch/ppc/platforms/4xx/redwood6.h
index 1814b9f5fc3a..1edcbe5c51c7 100644
--- a/arch/ppc/platforms/4xx/redwood6.h
+++ b/arch/ppc/platforms/4xx/redwood6.h
@@ -1,6 +1,4 @@
1/* 1/*
2 * arch/ppc/platforms/4xx/redwood6.h
3 *
4 * Macros, definitions, and data structures specific to the IBM PowerPC 2 * Macros, definitions, and data structures specific to the IBM PowerPC
5 * STBx25xx "Redwood6" evaluation board. 3 * STBx25xx "Redwood6" evaluation board.
6 * 4 *
diff --git a/arch/ppc/platforms/4xx/sycamore.c b/arch/ppc/platforms/4xx/sycamore.c
index 281b4a2ffb96..bab31eb30687 100644
--- a/arch/ppc/platforms/4xx/sycamore.c
+++ b/arch/ppc/platforms/4xx/sycamore.c
@@ -1,6 +1,4 @@
1/* 1/*
2 * arch/ppc/platforms/4xx/sycamore.c
3 *
4 * Architecture- / platform-specific boot-time initialization code for 2 * Architecture- / platform-specific boot-time initialization code for
5 * IBM PowerPC 4xx based boards. 3 * IBM PowerPC 4xx based boards.
6 * 4 *
diff --git a/arch/ppc/platforms/4xx/sycamore.h b/arch/ppc/platforms/4xx/sycamore.h
index 1cd6c824fd62..dae01620227d 100644
--- a/arch/ppc/platforms/4xx/sycamore.h
+++ b/arch/ppc/platforms/4xx/sycamore.h
@@ -1,6 +1,4 @@
1/* 1/*
2 * arch/ppc/platforms/4xx/sycamore.h
3 *
4 * Sycamore board definitions 2 * Sycamore board definitions
5 * 3 *
6 * Copyright (c) 2005 DENX Software Engineering 4 * Copyright (c) 2005 DENX Software Engineering
diff --git a/arch/ppc/platforms/4xx/virtex-ii_pro.c b/arch/ppc/platforms/4xx/virtex-ii_pro.c
deleted file mode 100644
index 097cc9d5aca0..000000000000
--- a/arch/ppc/platforms/4xx/virtex-ii_pro.c
+++ /dev/null
@@ -1,60 +0,0 @@
1/*
2 * arch/ppc/platforms/4xx/virtex-ii_pro.c
3 *
4 * Author: MontaVista Software, Inc.
5 * source@mvista.com
6 *
7 * 2002-2004 (c) MontaVista Software, Inc. This file is licensed under the
8 * terms of the GNU General Public License version 2. This program is licensed
9 * "as is" without any warranty of any kind, whether express or implied.
10 */
11
12#include <linux/config.h>
13#include <linux/init.h>
14#include <asm/ocp.h>
15#include "virtex-ii_pro.h"
16
17/* Have OCP take care of the serial ports. */
18struct ocp_def core_ocp[] = {
19#ifdef XPAR_UARTNS550_0_BASEADDR
20 { .vendor = OCP_VENDOR_XILINX,
21 .function = OCP_FUNC_16550,
22 .index = 0,
23 .paddr = XPAR_UARTNS550_0_BASEADDR,
24 .irq = XPAR_INTC_0_UARTNS550_0_VEC_ID,
25 .pm = OCP_CPM_NA
26 },
27#ifdef XPAR_UARTNS550_1_BASEADDR
28 { .vendor = OCP_VENDOR_XILINX,
29 .function = OCP_FUNC_16550,
30 .index = 1,
31 .paddr = XPAR_UARTNS550_1_BASEADDR,
32 .irq = XPAR_INTC_0_UARTNS550_1_VEC_ID,
33 .pm = OCP_CPM_NA
34 },
35#ifdef XPAR_UARTNS550_2_BASEADDR
36 { .vendor = OCP_VENDOR_XILINX,
37 .function = OCP_FUNC_16550,
38 .index = 2,
39 .paddr = XPAR_UARTNS550_2_BASEADDR,
40 .irq = XPAR_INTC_0_UARTNS550_2_VEC_ID,
41 .pm = OCP_CPM_NA
42 },
43#ifdef XPAR_UARTNS550_3_BASEADDR
44 { .vendor = OCP_VENDOR_XILINX,
45 .function = OCP_FUNC_16550,
46 .index = 3,
47 .paddr = XPAR_UARTNS550_3_BASEADDR,
48 .irq = XPAR_INTC_0_UARTNS550_3_VEC_ID,
49 .pm = OCP_CPM_NA
50 },
51#ifdef XPAR_UARTNS550_4_BASEADDR
52#error Edit this file to add more devices.
53#endif /* 4 */
54#endif /* 3 */
55#endif /* 2 */
56#endif /* 1 */
57#endif /* 0 */
58 { .vendor = OCP_VENDOR_INVALID
59 }
60};
diff --git a/arch/ppc/platforms/4xx/virtex-ii_pro.h b/arch/ppc/platforms/4xx/virtex-ii_pro.h
deleted file mode 100644
index 9014c4887339..000000000000
--- a/arch/ppc/platforms/4xx/virtex-ii_pro.h
+++ /dev/null
@@ -1,99 +0,0 @@
1/*
2 * arch/ppc/platforms/4xx/virtex-ii_pro.h
3 *
4 * Include file that defines the Xilinx Virtex-II Pro processor
5 *
6 * Author: MontaVista Software, Inc.
7 * source@mvista.com
8 *
9 * 2002-2004 (c) MontaVista Software, Inc. This file is licensed under the
10 * terms of the GNU General Public License version 2. This program is licensed
11 * "as is" without any warranty of any kind, whether express or implied.
12 */
13
14#ifdef __KERNEL__
15#ifndef __ASM_VIRTEXIIPRO_H__
16#define __ASM_VIRTEXIIPRO_H__
17
18#include <linux/config.h>
19#include <asm/xparameters.h>
20
21/* serial defines */
22
23#define RS_TABLE_SIZE 4 /* change this and add more devices below
24 if you have more then 4 16x50 UARTs */
25
26#define BASE_BAUD (XPAR_UARTNS550_0_CLOCK_FREQ_HZ/16)
27
28/* The serial ports in the Virtex-II Pro have each I/O byte in the
29 * LSByte of a word. This means that iomem_reg_shift needs to be 2 to
30 * change the byte offsets into word offsets. In addition the base
31 * addresses need to have 3 added to them to get to the LSByte.
32 */
33#define STD_UART_OP(num) \
34 { 0, BASE_BAUD, 0, XPAR_INTC_0_UARTNS550_##num##_VEC_ID, \
35 ASYNC_BOOT_AUTOCONF, \
36 .iomem_base = (u8 *)XPAR_UARTNS550_##num##_BASEADDR + 3, \
37 .iomem_reg_shift = 2, \
38 .io_type = SERIAL_IO_MEM},
39
40#if defined(XPAR_INTC_0_UARTNS550_0_VEC_ID)
41#define ML300_UART0 STD_UART_OP(0)
42#else
43#define ML300_UART0
44#endif
45
46#if defined(XPAR_INTC_0_UARTNS550_1_VEC_ID)
47#define ML300_UART1 STD_UART_OP(1)
48#else
49#define ML300_UART1
50#endif
51
52#if defined(XPAR_INTC_0_UARTNS550_2_VEC_ID)
53#define ML300_UART2 STD_UART_OP(2)
54#else
55#define ML300_UART2
56#endif
57
58#if defined(XPAR_INTC_0_UARTNS550_3_VEC_ID)
59#define ML300_UART3 STD_UART_OP(3)
60#else
61#define ML300_UART3
62#endif
63
64#if defined(XPAR_INTC_0_UARTNS550_4_VEC_ID)
65#error Edit this file to add more devices.
66#elif defined(XPAR_INTC_0_UARTNS550_3_VEC_ID)
67#define NR_SER_PORTS 4
68#elif defined(XPAR_INTC_0_UARTNS550_2_VEC_ID)
69#define NR_SER_PORTS 3
70#elif defined(XPAR_INTC_0_UARTNS550_1_VEC_ID)
71#define NR_SER_PORTS 2
72#elif defined(XPAR_INTC_0_UARTNS550_0_VEC_ID)
73#define NR_SER_PORTS 1
74#else
75#define NR_SER_PORTS 0
76#endif
77
78#if defined(CONFIG_UART0_TTYS0)
79#define SERIAL_PORT_DFNS \
80 ML300_UART0 \
81 ML300_UART1 \
82 ML300_UART2 \
83 ML300_UART3
84#endif
85
86#if defined(CONFIG_UART0_TTYS1)
87#define SERIAL_PORT_DFNS \
88 ML300_UART1 \
89 ML300_UART0 \
90 ML300_UART2 \
91 ML300_UART3
92#endif
93
94#define DCRN_CPMFR_BASE 0
95
96#include <asm/ibm405.h>
97
98#endif /* __ASM_VIRTEXIIPRO_H__ */
99#endif /* __KERNEL__ */
diff --git a/arch/ppc/platforms/4xx/virtex.c b/arch/ppc/platforms/4xx/virtex.c
new file mode 100644
index 000000000000..133a83147199
--- /dev/null
+++ b/arch/ppc/platforms/4xx/virtex.c
@@ -0,0 +1,56 @@
1/*
2 * Virtex-II Pro & Virtex-4 FX common infrastructure
3 *
4 * Maintainer: Grant Likely <grant.likely@secretlab.ca>
5 *
6 * Copyright 2005 Secret Lab Technologies Ltd.
7 * Copyright 2005 General Dynamics Canada Ltd.
8 * Copyright 2005 Freescale Semiconductor Inc.
9 *
10 * This program is free software; you can redistribute it and/or modify it
11 * under the terms of the GNU General Public License as published by the
12 * Free Software Foundation; either version 2 of the License, or (at your
13 * option) any later version.
14 */
15
16#include <linux/init.h>
17#include <linux/module.h>
18#include <linux/device.h>
19#include <linux/serial_8250.h>
20#include <asm/ppc_sys.h>
21#include <platforms/4xx/virtex.h>
22#include <platforms/4xx/xparameters/xparameters.h>
23
24#define XPAR_UART(num) { \
25 .mapbase = XPAR_UARTNS550_##num##_BASEADDR + 3, \
26 .irq = XPAR_INTC_0_UARTNS550_##num##_VEC_ID, \
27 .iotype = UPIO_MEM, \
28 .uartclk = XPAR_UARTNS550_##num##_CLOCK_FREQ_HZ, \
29 .flags = UPF_BOOT_AUTOCONF, \
30 .regshift = 2, \
31 }
32
33struct plat_serial8250_port serial_platform_data[] = {
34#ifdef XPAR_UARTNS550_0_BASEADDR
35 XPAR_UART(0),
36#endif
37#ifdef XPAR_UARTNS550_1_BASEADDR
38 XPAR_UART(1),
39#endif
40#ifdef XPAR_UARTNS550_2_BASEADDR
41 XPAR_UART(2),
42#endif
43#ifdef XPAR_UARTNS550_3_BASEADDR
44 XPAR_UART(3),
45#endif
46 { }, /* terminated by empty record */
47};
48
49struct platform_device ppc_sys_platform_devices[] = {
50 [VIRTEX_UART] = {
51 .name = "serial8250",
52 .id = 0,
53 .dev.platform_data = serial_platform_data,
54 },
55};
56
diff --git a/arch/ppc/platforms/4xx/virtex.h b/arch/ppc/platforms/4xx/virtex.h
new file mode 100644
index 000000000000..c14325dfd7b1
--- /dev/null
+++ b/arch/ppc/platforms/4xx/virtex.h
@@ -0,0 +1,35 @@
1/*
2 * arch/ppc/platforms/4xx/virtex.h
3 *
4 * Include file that defines the Xilinx Virtex-II Pro processor
5 *
6 * Author: MontaVista Software, Inc.
7 * source@mvista.com
8 *
9 * 2002-2004 (c) MontaVista Software, Inc. This file is licensed under the
10 * terms of the GNU General Public License version 2. This program is licensed
11 * "as is" without any warranty of any kind, whether express or implied.
12 */
13
14#ifdef __KERNEL__
15#ifndef __ASM_VIRTEX_H__
16#define __ASM_VIRTEX_H__
17
18/* serial defines */
19
20#include <asm/ibm405.h>
21
22/* Ugly, ugly, ugly! BASE_BAUD defined here to keep 8250.c happy. */
23#if !defined(BASE_BAUD)
24 #define BASE_BAUD (0) /* dummy value; not used */
25#endif
26
27/* Device type enumeration for platform bus definitions */
28#ifndef __ASSEMBLY__
29enum ppc_sys_devices {
30 VIRTEX_UART, NUM_PPC_SYS_DEVS,
31};
32#endif
33
34#endif /* __ASM_VIRTEX_H__ */
35#endif /* __KERNEL__ */
diff --git a/arch/ppc/platforms/4xx/walnut.c b/arch/ppc/platforms/4xx/walnut.c
index 74cb33182d9f..6bd77902b9a4 100644
--- a/arch/ppc/platforms/4xx/walnut.c
+++ b/arch/ppc/platforms/4xx/walnut.c
@@ -1,6 +1,4 @@
1/* 1/*
2 * arch/ppc/platforms/4xx/walnut.c
3 *
4 * Architecture- / platform-specific boot-time initialization code for 2 * Architecture- / platform-specific boot-time initialization code for
5 * IBM PowerPC 4xx based boards. Adapted from original 3 * IBM PowerPC 4xx based boards. Adapted from original
6 * code by Gary Thomas, Cort Dougan <cort@fsmlabs.com>, and Dan Malek 4 * code by Gary Thomas, Cort Dougan <cort@fsmlabs.com>, and Dan Malek
diff --git a/arch/ppc/platforms/4xx/walnut.h b/arch/ppc/platforms/4xx/walnut.h
index dcf2691698c0..f13a577f0a41 100644
--- a/arch/ppc/platforms/4xx/walnut.h
+++ b/arch/ppc/platforms/4xx/walnut.h
@@ -1,6 +1,4 @@
1/* 1/*
2 * arch/ppc/platforms/4xx/walnut.h
3 *
4 * Walnut board definitions 2 * Walnut board definitions
5 * 3 *
6 * Copyright (c) 2005 DENX Software Engineering 4 * Copyright (c) 2005 DENX Software Engineering
diff --git a/arch/ppc/platforms/4xx/xilinx_ml300.c b/arch/ppc/platforms/4xx/xilinx_ml300.c
index e90d97f64f76..d97a7f269f97 100644
--- a/arch/ppc/platforms/4xx/xilinx_ml300.c
+++ b/arch/ppc/platforms/4xx/xilinx_ml300.c
@@ -1,6 +1,4 @@
1/* 1/*
2 * arch/ppc/platforms/4xx/xilinx_ml300.c
3 *
4 * Xilinx ML300 evaluation board initialization 2 * Xilinx ML300 evaluation board initialization
5 * 3 *
6 * Author: MontaVista Software, Inc. 4 * Author: MontaVista Software, Inc.
@@ -17,12 +15,14 @@
17#include <linux/tty.h> 15#include <linux/tty.h>
18#include <linux/serial.h> 16#include <linux/serial.h>
19#include <linux/serial_core.h> 17#include <linux/serial_core.h>
18#include <linux/serial_8250.h>
20#include <linux/serialP.h> 19#include <linux/serialP.h>
21#include <asm/io.h> 20#include <asm/io.h>
22#include <asm/machdep.h> 21#include <asm/machdep.h>
23#include <asm/ocp.h> 22#include <asm/ppc_sys.h>
24 23
25#include <platforms/4xx/virtex-ii_pro.h> /* for NR_SER_PORTS */ 24#include <syslib/gen550.h>
25#include <platforms/4xx/xparameters/xparameters.h>
26 26
27/* 27/*
28 * As an overview of how the following functions (platform_init, 28 * As an overview of how the following functions (platform_init,
@@ -54,6 +54,22 @@
54 * ppc4xx_pic_init arch/ppc/syslib/xilinx_pic.c 54 * ppc4xx_pic_init arch/ppc/syslib/xilinx_pic.c
55 */ 55 */
56 56
57/* Board specifications structures */
58struct ppc_sys_spec *cur_ppc_sys_spec;
59struct ppc_sys_spec ppc_sys_specs[] = {
60 {
61 /* Only one entry, always assume the same design */
62 .ppc_sys_name = "Xilinx ML300 Reference Design",
63 .mask = 0x00000000,
64 .value = 0x00000000,
65 .num_devices = 1,
66 .device_list = (enum ppc_sys_devices[])
67 {
68 VIRTEX_UART,
69 },
70 },
71};
72
57#if defined(XPAR_POWER_0_POWERDOWN_BASEADDR) 73#if defined(XPAR_POWER_0_POWERDOWN_BASEADDR)
58 74
59static volatile unsigned *powerdown_base = 75static volatile unsigned *powerdown_base =
@@ -80,28 +96,39 @@ ml300_map_io(void)
80#endif 96#endif
81} 97}
82 98
99/* Early serial support functions */
83static void __init 100static void __init
101ml300_early_serial_init(int num, struct plat_serial8250_port *pdata)
102{
103#if defined(CONFIG_SERIAL_TEXT_DEBUG) || defined(CONFIG_KGDB)
104 struct uart_port serial_req;
105
106 memset(&serial_req, 0, sizeof(serial_req));
107 serial_req.mapbase = pdata->mapbase;
108 serial_req.membase = pdata->membase;
109 serial_req.irq = pdata->irq;
110 serial_req.uartclk = pdata->uartclk;
111 serial_req.regshift = pdata->regshift;
112 serial_req.iotype = pdata->iotype;
113 serial_req.flags = pdata->flags;
114 gen550_init(num, &serial_req);
115#endif
116}
117
118void __init
84ml300_early_serial_map(void) 119ml300_early_serial_map(void)
85{ 120{
86#ifdef CONFIG_SERIAL_8250 121#ifdef CONFIG_SERIAL_8250
87 struct serial_state old_ports[] = { SERIAL_PORT_DFNS }; 122 struct plat_serial8250_port *pdata;
88 struct uart_port port; 123 int i = 0;
89 int i; 124
90 125 pdata = (struct plat_serial8250_port *) ppc_sys_get_pdata(VIRTEX_UART);
91 /* Setup ioremapped serial port access */ 126 while(pdata && pdata->flags)
92 for (i = 0; i < ARRAY_SIZE(old_ports); i++ ) { 127 {
93 memset(&port, 0, sizeof(port)); 128 pdata->membase = ioremap(pdata->mapbase, 0x100);
94 port.membase = ioremap((phys_addr_t)(old_ports[i].iomem_base), 16); 129 ml300_early_serial_init(i, pdata);
95 port.irq = old_ports[i].irq; 130 pdata++;
96 port.uartclk = old_ports[i].baud_base * 16; 131 i++;
97 port.regshift = old_ports[i].iomem_reg_shift;
98 port.iotype = UPIO_MEM;
99 port.flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST;
100 port.line = i;
101
102 if (early_serial_setup(&port) != 0) {
103 printk("Early serial init of port %d failed\n", i);
104 }
105 } 132 }
106#endif /* CONFIG_SERIAL_8250 */ 133#endif /* CONFIG_SERIAL_8250 */
107} 134}
@@ -109,9 +136,8 @@ ml300_early_serial_map(void)
109void __init 136void __init
110ml300_setup_arch(void) 137ml300_setup_arch(void)
111{ 138{
112 ppc4xx_setup_arch(); /* calls ppc4xx_find_bridges() */
113
114 ml300_early_serial_map(); 139 ml300_early_serial_map();
140 ppc4xx_setup_arch(); /* calls ppc4xx_find_bridges() */
115 141
116 /* Identify the system */ 142 /* Identify the system */
117 printk(KERN_INFO "Xilinx Virtex-II Pro port\n"); 143 printk(KERN_INFO "Xilinx Virtex-II Pro port\n");
@@ -131,6 +157,8 @@ platform_init(unsigned long r3, unsigned long r4, unsigned long r5,
131{ 157{
132 ppc4xx_init(r3, r4, r5, r6, r7); 158 ppc4xx_init(r3, r4, r5, r6, r7);
133 159
160 identify_ppc_sys_by_id(mfspr(SPRN_PVR));
161
134 ppc_md.setup_arch = ml300_setup_arch; 162 ppc_md.setup_arch = ml300_setup_arch;
135 ppc_md.setup_io_mappings = ml300_map_io; 163 ppc_md.setup_io_mappings = ml300_map_io;
136 ppc_md.init_IRQ = ml300_init_irq; 164 ppc_md.init_IRQ = ml300_init_irq;
diff --git a/arch/ppc/platforms/4xx/xilinx_ml300.h b/arch/ppc/platforms/4xx/xilinx_ml300.h
index f8c588412336..3d57332ba820 100644
--- a/arch/ppc/platforms/4xx/xilinx_ml300.h
+++ b/arch/ppc/platforms/4xx/xilinx_ml300.h
@@ -1,6 +1,4 @@
1/* 1/*
2 * arch/ppc/platforms/4xx/xilinx_ml300.h
3 *
4 * Include file that defines the Xilinx ML300 evaluation board 2 * Include file that defines the Xilinx ML300 evaluation board
5 * 3 *
6 * Author: MontaVista Software, Inc. 4 * Author: MontaVista Software, Inc.
@@ -16,7 +14,7 @@
16#define __ASM_XILINX_ML300_H__ 14#define __ASM_XILINX_ML300_H__
17 15
18/* ML300 has a Xilinx Virtex-II Pro processor */ 16/* ML300 has a Xilinx Virtex-II Pro processor */
19#include <platforms/4xx/virtex-ii_pro.h> 17#include <platforms/4xx/virtex.h>
20 18
21#ifndef __ASSEMBLY__ 19#ifndef __ASSEMBLY__
22 20
@@ -41,7 +39,7 @@ typedef struct board_info {
41#define PPC4xx_ONB_IO_VADDR 0u 39#define PPC4xx_ONB_IO_VADDR 0u
42#define PPC4xx_ONB_IO_SIZE 0u 40#define PPC4xx_ONB_IO_SIZE 0u
43 41
44#define PPC4xx_MACHINE_NAME "Xilinx ML300" 42#define PPC4xx_MACHINE_NAME "Xilinx ML300 Reference System"
45 43
46#endif /* __ASM_XILINX_ML300_H__ */ 44#endif /* __ASM_XILINX_ML300_H__ */
47#endif /* __KERNEL__ */ 45#endif /* __KERNEL__ */
diff --git a/arch/ppc/platforms/4xx/xilinx_ml403.c b/arch/ppc/platforms/4xx/xilinx_ml403.c
new file mode 100644
index 000000000000..4c0c7e4c1114
--- /dev/null
+++ b/arch/ppc/platforms/4xx/xilinx_ml403.c
@@ -0,0 +1,177 @@
1/*
2 * arch/ppc/platforms/4xx/xilinx_ml403.c
3 *
4 * Xilinx ML403 evaluation board initialization
5 *
6 * Author: Grant Likely <grant.likely@secretlab.ca>
7 *
8 * 2005 (c) Secret Lab Technologies Ltd.
9 * 2002-2004 (c) MontaVista Software, Inc.
10 *
11 * This file is licensed under the terms of the GNU General Public License
12 * version 2. This program is licensed "as is" without any warranty of any
13 * kind, whether express or implied.
14 */
15
16#include <linux/config.h>
17#include <linux/init.h>
18#include <linux/irq.h>
19#include <linux/tty.h>
20#include <linux/serial.h>
21#include <linux/serial_core.h>
22#include <linux/serial_8250.h>
23#include <linux/serialP.h>
24#include <asm/io.h>
25#include <asm/machdep.h>
26#include <asm/ppc_sys.h>
27
28#include <syslib/gen550.h>
29#include <platforms/4xx/xparameters/xparameters.h>
30
31/*
32 * As an overview of how the following functions (platform_init,
33 * ml403_map_io, ml403_setup_arch and ml403_init_IRQ) fit into the
34 * kernel startup procedure, here's a call tree:
35 *
36 * start_here arch/ppc/kernel/head_4xx.S
37 * early_init arch/ppc/kernel/setup.c
38 * machine_init arch/ppc/kernel/setup.c
39 * platform_init this file
40 * ppc4xx_init arch/ppc/syslib/ppc4xx_setup.c
41 * parse_bootinfo
42 * find_bootinfo
43 * "setup some default ppc_md pointers"
44 * MMU_init arch/ppc/mm/init.c
45 * *ppc_md.setup_io_mappings == ml403_map_io this file
46 * ppc4xx_map_io arch/ppc/syslib/ppc4xx_setup.c
47 * start_kernel init/main.c
48 * setup_arch arch/ppc/kernel/setup.c
49 * #if defined(CONFIG_KGDB)
50 * *ppc_md.kgdb_map_scc() == gen550_kgdb_map_scc
51 * #endif
52 * *ppc_md.setup_arch == ml403_setup_arch this file
53 * ppc4xx_setup_arch arch/ppc/syslib/ppc4xx_setup.c
54 * ppc4xx_find_bridges arch/ppc/syslib/ppc405_pci.c
55 * init_IRQ arch/ppc/kernel/irq.c
56 * *ppc_md.init_IRQ == ml403_init_IRQ this file
57 * ppc4xx_init_IRQ arch/ppc/syslib/ppc4xx_setup.c
58 * ppc4xx_pic_init arch/ppc/syslib/xilinx_pic.c
59 */
60
61/* Board specifications structures */
62struct ppc_sys_spec *cur_ppc_sys_spec;
63struct ppc_sys_spec ppc_sys_specs[] = {
64 {
65 /* Only one entry, always assume the same design */
66 .ppc_sys_name = "Xilinx ML403 Reference Design",
67 .mask = 0x00000000,
68 .value = 0x00000000,
69 .num_devices = 1,
70 .device_list = (enum ppc_sys_devices[])
71 {
72 VIRTEX_UART,
73 },
74 },
75};
76
77#if defined(XPAR_POWER_0_POWERDOWN_BASEADDR)
78
79static volatile unsigned *powerdown_base =
80 (volatile unsigned *) XPAR_POWER_0_POWERDOWN_BASEADDR;
81
82static void
83xilinx_power_off(void)
84{
85 local_irq_disable();
86 out_be32(powerdown_base, XPAR_POWER_0_POWERDOWN_VALUE);
87 while (1) ;
88}
89#endif
90
91void __init
92ml403_map_io(void)
93{
94 ppc4xx_map_io();
95
96#if defined(XPAR_POWER_0_POWERDOWN_BASEADDR)
97 powerdown_base = ioremap((unsigned long) powerdown_base,
98 XPAR_POWER_0_POWERDOWN_HIGHADDR -
99 XPAR_POWER_0_POWERDOWN_BASEADDR + 1);
100#endif
101}
102
103/* Early serial support functions */
104static void __init
105ml403_early_serial_init(int num, struct plat_serial8250_port *pdata)
106{
107#if defined(CONFIG_SERIAL_TEXT_DEBUG) || defined(CONFIG_KGDB)
108 struct uart_port serial_req;
109
110 memset(&serial_req, 0, sizeof(serial_req));
111 serial_req.mapbase = pdata->mapbase;
112 serial_req.membase = pdata->membase;
113 serial_req.irq = pdata->irq;
114 serial_req.uartclk = pdata->uartclk;
115 serial_req.regshift = pdata->regshift;
116 serial_req.iotype = pdata->iotype;
117 serial_req.flags = pdata->flags;
118 gen550_init(num, &serial_req);
119#endif
120}
121
122void __init
123ml403_early_serial_map(void)
124{
125#ifdef CONFIG_SERIAL_8250
126 struct plat_serial8250_port *pdata;
127 int i = 0;
128
129 pdata = (struct plat_serial8250_port *) ppc_sys_get_pdata(VIRTEX_UART);
130 while(pdata && pdata->flags)
131 {
132 pdata->membase = ioremap(pdata->mapbase, 0x100);
133 ml403_early_serial_init(i, pdata);
134 pdata++;
135 i++;
136 }
137#endif /* CONFIG_SERIAL_8250 */
138}
139
140void __init
141ml403_setup_arch(void)
142{
143 ml403_early_serial_map();
144 ppc4xx_setup_arch(); /* calls ppc4xx_find_bridges() */
145
146 /* Identify the system */
147 printk(KERN_INFO "Xilinx ML403 Reference System (Virtex-4 FX)\n");
148}
149
150/* Called after board_setup_irq from ppc4xx_init_IRQ(). */
151void __init
152ml403_init_irq(void)
153{
154 ppc4xx_init_IRQ();
155}
156
157void __init
158platform_init(unsigned long r3, unsigned long r4, unsigned long r5,
159 unsigned long r6, unsigned long r7)
160{
161 ppc4xx_init(r3, r4, r5, r6, r7);
162
163 identify_ppc_sys_by_id(mfspr(SPRN_PVR));
164
165 ppc_md.setup_arch = ml403_setup_arch;
166 ppc_md.setup_io_mappings = ml403_map_io;
167 ppc_md.init_IRQ = ml403_init_irq;
168
169#if defined(XPAR_POWER_0_POWERDOWN_BASEADDR)
170 ppc_md.power_off = xilinx_power_off;
171#endif
172
173#ifdef CONFIG_KGDB
174 ppc_md.early_serial_map = ml403_early_serial_map;
175#endif
176}
177
diff --git a/arch/ppc/platforms/4xx/xilinx_ml403.h b/arch/ppc/platforms/4xx/xilinx_ml403.h
new file mode 100644
index 000000000000..473596959902
--- /dev/null
+++ b/arch/ppc/platforms/4xx/xilinx_ml403.h
@@ -0,0 +1,49 @@
1/*
2 * arch/ppc/platforms/4xx/xilinx_ml403.h
3 *
4 * Include file that defines the Xilinx ML403 reference design
5 *
6 * Author: Grant Likely <grant.likely@secretlab.ca>
7 *
8 * 2005 (c) Secret Lab Technologies Ltd.
9 * 2002-2004 (c) MontaVista Software, Inc.
10 *
11 * This file is licensed under the terms of the GNU General Public License
12 * version 2. This program is licensed "as is" without any warranty of any
13 * kind, whether express or implied.
14 */
15
16#ifdef __KERNEL__
17#ifndef __ASM_XILINX_ML403_H__
18#define __ASM_XILINX_ML403_H__
19
20/* ML403 has a Xilinx Virtex-4 FPGA with a PPC405 hard core */
21#include <platforms/4xx/virtex.h>
22
23#ifndef __ASSEMBLY__
24
25#include <linux/types.h>
26
27typedef struct board_info {
28 unsigned int bi_memsize; /* DRAM installed, in bytes */
29 unsigned char bi_enetaddr[6]; /* Local Ethernet MAC address */
30 unsigned int bi_intfreq; /* Processor speed, in Hz */
31 unsigned int bi_busfreq; /* PLB Bus speed, in Hz */
32 unsigned int bi_pci_busfreq; /* PCI Bus speed, in Hz */
33} bd_t;
34
35/* Some 4xx parts use a different timebase frequency from the internal clock.
36*/
37#define bi_tbfreq bi_intfreq
38
39#endif /* !__ASSEMBLY__ */
40
41/* We don't need anything mapped. Size of zero will accomplish that. */
42#define PPC4xx_ONB_IO_PADDR 0u
43#define PPC4xx_ONB_IO_VADDR 0u
44#define PPC4xx_ONB_IO_SIZE 0u
45
46#define PPC4xx_MACHINE_NAME "Xilinx ML403 Reference Design"
47
48#endif /* __ASM_XILINX_ML403_H__ */
49#endif /* __KERNEL__ */
diff --git a/arch/ppc/platforms/4xx/xparameters/xparameters.h b/arch/ppc/platforms/4xx/xparameters/xparameters.h
new file mode 100644
index 000000000000..4cf21f256356
--- /dev/null
+++ b/arch/ppc/platforms/4xx/xparameters/xparameters.h
@@ -0,0 +1,37 @@
1/*
2 * include/asm-ppc/xparameters.h
3 *
4 * This file includes the correct xparameters.h for the CONFIG'ed board plus
5 * fixups to translate board specific XPAR values to a common set of names
6 *
7 * Author: MontaVista Software, Inc.
8 * source@mvista.com
9 *
10 * 2004 (c) MontaVista Software, Inc. This file is licensed under the terms
11 * of the GNU General Public License version 2. This program is licensed
12 * "as is" without any warranty of any kind, whether express or implied.
13 */
14
15#include <linux/config.h>
16
17#if defined(CONFIG_XILINX_ML300)
18 #include "xparameters_ml300.h"
19#elif defined(CONFIG_XILINX_ML403)
20 #include "xparameters_ml403.h"
21#else
22 /* Add other board xparameter includes here before the #else */
23 #error No xparameters_*.h file included
24#endif
25
26#ifndef SERIAL_PORT_DFNS
27 /* zImage serial port definitions */
28 #define RS_TABLE_SIZE 1
29 #define SERIAL_PORT_DFNS { \
30 .baud_base = XPAR_UARTNS550_0_CLOCK_FREQ_HZ/16, \
31 .irq = XPAR_INTC_0_UARTNS550_0_VEC_ID, \
32 .flags = ASYNC_BOOT_AUTOCONF, \
33 .iomem_base = (u8 *)XPAR_UARTNS550_0_BASEADDR + 3, \
34 .iomem_reg_shift = 2, \
35 .io_type = SERIAL_IO_MEM, \
36 },
37#endif
diff --git a/arch/ppc/platforms/4xx/xparameters/xparameters_ml403.h b/arch/ppc/platforms/4xx/xparameters/xparameters_ml403.h
new file mode 100644
index 000000000000..5cacdcb3964d
--- /dev/null
+++ b/arch/ppc/platforms/4xx/xparameters/xparameters_ml403.h
@@ -0,0 +1,243 @@
1
2/*******************************************************************
3*
4* CAUTION: This file is automatically generated by libgen.
5* Version: Xilinx EDK 7.1.2 EDK_H.12.5.1
6* DO NOT EDIT.
7*
8* Copyright (c) 2005 Xilinx, Inc. All rights reserved.
9*
10* Description: Driver parameters
11*
12*******************************************************************/
13
14#define XPAR_PLB_BRAM_IF_CNTLR_0_BASEADDR 0xFFFF0000
15#define XPAR_PLB_BRAM_IF_CNTLR_0_HIGHADDR 0xFFFFFFFF
16
17/******************************************************************/
18
19#define XPAR_OPB_EMC_0_MEM0_BASEADDR 0x20000000
20#define XPAR_OPB_EMC_0_MEM0_HIGHADDR 0x200FFFFF
21#define XPAR_OPB_EMC_0_MEM1_BASEADDR 0x28000000
22#define XPAR_OPB_EMC_0_MEM1_HIGHADDR 0x287FFFFF
23#define XPAR_OPB_AC97_CONTROLLER_REF_0_BASEADDR 0xA6000000
24#define XPAR_OPB_AC97_CONTROLLER_REF_0_HIGHADDR 0xA60000FF
25#define XPAR_OPB_EMC_USB_0_MEM0_BASEADDR 0xA5000000
26#define XPAR_OPB_EMC_USB_0_MEM0_HIGHADDR 0xA50000FF
27#define XPAR_PLB_DDR_0_MEM0_BASEADDR 0x00000000
28#define XPAR_PLB_DDR_0_MEM0_HIGHADDR 0x0FFFFFFF
29
30/******************************************************************/
31
32#define XPAR_XEMAC_NUM_INSTANCES 1
33#define XPAR_OPB_ETHERNET_0_BASEADDR 0x60000000
34#define XPAR_OPB_ETHERNET_0_HIGHADDR 0x60003FFF
35#define XPAR_OPB_ETHERNET_0_DEVICE_ID 0
36#define XPAR_OPB_ETHERNET_0_ERR_COUNT_EXIST 1
37#define XPAR_OPB_ETHERNET_0_DMA_PRESENT 1
38#define XPAR_OPB_ETHERNET_0_MII_EXIST 1
39
40/******************************************************************/
41
42#define XPAR_XUARTNS550_NUM_INSTANCES 1
43#define XPAR_XUARTNS550_CLOCK_HZ 100000000
44#define XPAR_OPB_UART16550_0_BASEADDR 0xA0000000
45#define XPAR_OPB_UART16550_0_HIGHADDR 0xA0001FFF
46#define XPAR_OPB_UART16550_0_DEVICE_ID 0
47
48/******************************************************************/
49
50#define XPAR_XGPIO_NUM_INSTANCES 3
51#define XPAR_OPB_GPIO_0_BASEADDR 0x90000000
52#define XPAR_OPB_GPIO_0_HIGHADDR 0x900001FF
53#define XPAR_OPB_GPIO_0_DEVICE_ID 0
54#define XPAR_OPB_GPIO_0_INTERRUPT_PRESENT 0
55#define XPAR_OPB_GPIO_0_IS_DUAL 1
56#define XPAR_OPB_GPIO_EXP_HDR_0_BASEADDR 0x90001000
57#define XPAR_OPB_GPIO_EXP_HDR_0_HIGHADDR 0x900011FF
58#define XPAR_OPB_GPIO_EXP_HDR_0_DEVICE_ID 1
59#define XPAR_OPB_GPIO_EXP_HDR_0_INTERRUPT_PRESENT 0
60#define XPAR_OPB_GPIO_EXP_HDR_0_IS_DUAL 1
61#define XPAR_OPB_GPIO_CHAR_LCD_0_BASEADDR 0x90002000
62#define XPAR_OPB_GPIO_CHAR_LCD_0_HIGHADDR 0x900021FF
63#define XPAR_OPB_GPIO_CHAR_LCD_0_DEVICE_ID 2
64#define XPAR_OPB_GPIO_CHAR_LCD_0_INTERRUPT_PRESENT 0
65#define XPAR_OPB_GPIO_CHAR_LCD_0_IS_DUAL 0
66
67/******************************************************************/
68
69#define XPAR_XPS2_NUM_INSTANCES 2
70#define XPAR_OPB_PS2_DUAL_REF_0_DEVICE_ID_0 0
71#define XPAR_OPB_PS2_DUAL_REF_0_BASEADDR_0 0xA9000000
72#define XPAR_OPB_PS2_DUAL_REF_0_HIGHADDR_0 (0xA9000000+0x3F)
73#define XPAR_OPB_PS2_DUAL_REF_0_DEVICE_ID_1 1
74#define XPAR_OPB_PS2_DUAL_REF_0_BASEADDR_1 (0xA9000000+0x1000)
75#define XPAR_OPB_PS2_DUAL_REF_0_HIGHADDR_1 (0xA9000000+0x103F)
76
77/******************************************************************/
78
79#define XPAR_XIIC_NUM_INSTANCES 1
80#define XPAR_OPB_IIC_0_BASEADDR 0xA8000000
81#define XPAR_OPB_IIC_0_HIGHADDR 0xA80001FF
82#define XPAR_OPB_IIC_0_DEVICE_ID 0
83#define XPAR_OPB_IIC_0_TEN_BIT_ADR 0
84#define XPAR_OPB_IIC_0_GPO_WIDTH 1
85
86/******************************************************************/
87
88#define XPAR_INTC_MAX_NUM_INTR_INPUTS 10
89#define XPAR_XINTC_HAS_IPR 1
90#define XPAR_XINTC_USE_DCR 0
91#define XPAR_XINTC_NUM_INSTANCES 1
92#define XPAR_OPB_INTC_0_BASEADDR 0xD1000FC0
93#define XPAR_OPB_INTC_0_HIGHADDR 0xD1000FDF
94#define XPAR_OPB_INTC_0_DEVICE_ID 0
95#define XPAR_OPB_INTC_0_KIND_OF_INTR 0x00000000
96
97/******************************************************************/
98
99#define XPAR_INTC_SINGLE_BASEADDR 0xD1000FC0
100#define XPAR_INTC_SINGLE_HIGHADDR 0xD1000FDF
101#define XPAR_INTC_SINGLE_DEVICE_ID XPAR_OPB_INTC_0_DEVICE_ID
102#define XPAR_OPB_ETHERNET_0_IP2INTC_IRPT_MASK 0X000001
103#define XPAR_OPB_INTC_0_OPB_ETHERNET_0_IP2INTC_IRPT_INTR 0
104#define XPAR_SYSTEM_USB_HPI_INT_MASK 0X000002
105#define XPAR_OPB_INTC_0_SYSTEM_USB_HPI_INT_INTR 1
106#define XPAR_MISC_LOGIC_0_PHY_MII_INT_MASK 0X000004
107#define XPAR_OPB_INTC_0_MISC_LOGIC_0_PHY_MII_INT_INTR 2
108#define XPAR_OPB_SYSACE_0_SYSACE_IRQ_MASK 0X000008
109#define XPAR_OPB_INTC_0_OPB_SYSACE_0_SYSACE_IRQ_INTR 3
110#define XPAR_OPB_AC97_CONTROLLER_REF_0_RECORD_INTERRUPT_MASK 0X000010
111#define XPAR_OPB_INTC_0_OPB_AC97_CONTROLLER_REF_0_RECORD_INTERRUPT_INTR 4
112#define XPAR_OPB_AC97_CONTROLLER_REF_0_PLAYBACK_INTERRUPT_MASK 0X000020
113#define XPAR_OPB_INTC_0_OPB_AC97_CONTROLLER_REF_0_PLAYBACK_INTERRUPT_INTR 5
114#define XPAR_OPB_IIC_0_IP2INTC_IRPT_MASK 0X000040
115#define XPAR_OPB_INTC_0_OPB_IIC_0_IP2INTC_IRPT_INTR 6
116#define XPAR_OPB_PS2_DUAL_REF_0_SYS_INTR2_MASK 0X000080
117#define XPAR_OPB_INTC_0_OPB_PS2_DUAL_REF_0_SYS_INTR2_INTR 7
118#define XPAR_OPB_PS2_DUAL_REF_0_SYS_INTR1_MASK 0X000100
119#define XPAR_OPB_INTC_0_OPB_PS2_DUAL_REF_0_SYS_INTR1_INTR 8
120#define XPAR_OPB_UART16550_0_IP2INTC_IRPT_MASK 0X000200
121#define XPAR_OPB_INTC_0_OPB_UART16550_0_IP2INTC_IRPT_INTR 9
122
123/******************************************************************/
124
125#define XPAR_XTFT_NUM_INSTANCES 1
126#define XPAR_PLB_TFT_CNTLR_REF_0_DCR_BASEADDR 0xD0000200
127#define XPAR_PLB_TFT_CNTLR_REF_0_DCR_HIGHADDR 0xD0000207
128#define XPAR_PLB_TFT_CNTLR_REF_0_DEVICE_ID 0
129
130/******************************************************************/
131
132#define XPAR_XSYSACE_MEM_WIDTH 16
133#define XPAR_XSYSACE_NUM_INSTANCES 1
134#define XPAR_OPB_SYSACE_0_BASEADDR 0xCF000000
135#define XPAR_OPB_SYSACE_0_HIGHADDR 0xCF0001FF
136#define XPAR_OPB_SYSACE_0_DEVICE_ID 0
137#define XPAR_OPB_SYSACE_0_MEM_WIDTH 16
138
139/******************************************************************/
140
141#define XPAR_CPU_PPC405_CORE_CLOCK_FREQ_HZ 300000000
142
143/******************************************************************/
144
145
146/******************************************************************/
147
148/* Linux Redefines */
149
150/******************************************************************/
151
152#define XPAR_UARTNS550_0_BASEADDR (XPAR_OPB_UART16550_0_BASEADDR+0x1000)
153#define XPAR_UARTNS550_0_HIGHADDR XPAR_OPB_UART16550_0_HIGHADDR
154#define XPAR_UARTNS550_0_CLOCK_FREQ_HZ XPAR_XUARTNS550_CLOCK_HZ
155#define XPAR_UARTNS550_0_DEVICE_ID XPAR_OPB_UART16550_0_DEVICE_ID
156
157/******************************************************************/
158
159#define XPAR_INTC_0_BASEADDR XPAR_OPB_INTC_0_BASEADDR
160#define XPAR_INTC_0_HIGHADDR XPAR_OPB_INTC_0_HIGHADDR
161#define XPAR_INTC_0_KIND_OF_INTR XPAR_OPB_INTC_0_KIND_OF_INTR
162#define XPAR_INTC_0_DEVICE_ID XPAR_OPB_INTC_0_DEVICE_ID
163
164/******************************************************************/
165
166#define XPAR_INTC_0_EMAC_0_VEC_ID XPAR_OPB_INTC_0_OPB_ETHERNET_0_IP2INTC_IRPT_INTR
167#define XPAR_INTC_0_SYSACE_0_VEC_ID XPAR_OPB_INTC_0_OPB_SYSACE_0_SYSACE_IRQ_INTR
168#define XPAR_INTC_0_IIC_0_VEC_ID XPAR_OPB_INTC_0_OPB_IIC_0_IP2INTC_IRPT_INTR
169#define XPAR_INTC_0_PS2_1_VEC_ID XPAR_OPB_INTC_0_OPB_PS2_DUAL_REF_0_SYS_INTR2_INTR
170#define XPAR_INTC_0_PS2_0_VEC_ID XPAR_OPB_INTC_0_OPB_PS2_DUAL_REF_0_SYS_INTR1_INTR
171#define XPAR_INTC_0_UARTNS550_0_VEC_ID XPAR_OPB_INTC_0_OPB_UART16550_0_IP2INTC_IRPT_INTR
172
173/******************************************************************/
174
175#define XPAR_TFT_0_BASEADDR XPAR_PLB_TFT_CNTLR_REF_0_DCR_BASEADDR
176
177/******************************************************************/
178
179#define XPAR_EMAC_0_BASEADDR XPAR_OPB_ETHERNET_0_BASEADDR
180#define XPAR_EMAC_0_HIGHADDR XPAR_OPB_ETHERNET_0_HIGHADDR
181#define XPAR_EMAC_0_DMA_PRESENT XPAR_OPB_ETHERNET_0_DMA_PRESENT
182#define XPAR_EMAC_0_MII_EXIST XPAR_OPB_ETHERNET_0_MII_EXIST
183#define XPAR_EMAC_0_ERR_COUNT_EXIST XPAR_OPB_ETHERNET_0_ERR_COUNT_EXIST
184#define XPAR_EMAC_0_DEVICE_ID XPAR_OPB_ETHERNET_0_DEVICE_ID
185
186/******************************************************************/
187
188#define XPAR_GPIO_0_BASEADDR XPAR_OPB_GPIO_0_BASEADDR_0
189#define XPAR_GPIO_0_HIGHADDR XPAR_OPB_GPIO_0_HIGHADDR_0
190#define XPAR_GPIO_0_DEVICE_ID XPAR_OPB_GPIO_0_DEVICE_ID_0
191#define XPAR_GPIO_1_BASEADDR XPAR_OPB_GPIO_0_BASEADDR_1
192#define XPAR_GPIO_1_HIGHADDR XPAR_OPB_GPIO_0_HIGHADDR_1
193#define XPAR_GPIO_1_DEVICE_ID XPAR_OPB_GPIO_0_DEVICE_ID_1
194#define XPAR_GPIO_2_BASEADDR XPAR_OPB_GPIO_EXP_HDR_0_BASEADDR_0
195#define XPAR_GPIO_2_HIGHADDR XPAR_OPB_GPIO_EXP_HDR_0_HIGHADDR_0
196#define XPAR_GPIO_2_DEVICE_ID XPAR_OPB_GPIO_EXP_HDR_0_DEVICE_ID_0
197#define XPAR_GPIO_3_BASEADDR XPAR_OPB_GPIO_EXP_HDR_0_BASEADDR_1
198#define XPAR_GPIO_3_HIGHADDR XPAR_OPB_GPIO_EXP_HDR_0_HIGHADDR_1
199#define XPAR_GPIO_3_DEVICE_ID XPAR_OPB_GPIO_EXP_HDR_0_DEVICE_ID_1
200#define XPAR_GPIO_4_BASEADDR XPAR_OPB_GPIO_CHAR_LCD_0_BASEADDR
201#define XPAR_GPIO_4_HIGHADDR XPAR_OPB_GPIO_CHAR_LCD_0_HIGHADDR
202#define XPAR_GPIO_4_DEVICE_ID XPAR_OPB_GPIO_CHAR_LCD_0_DEVICE_ID
203
204/******************************************************************/
205
206#define XPAR_PS2_0_BASEADDR XPAR_OPB_PS2_DUAL_REF_0_BASEADDR_0
207#define XPAR_PS2_0_HIGHADDR XPAR_OPB_PS2_DUAL_REF_0_HIGHADDR_0
208#define XPAR_PS2_0_DEVICE_ID XPAR_OPB_PS2_DUAL_REF_0_DEVICE_ID_0
209#define XPAR_PS2_1_BASEADDR XPAR_OPB_PS2_DUAL_REF_0_BASEADDR_1
210#define XPAR_PS2_1_HIGHADDR XPAR_OPB_PS2_DUAL_REF_0_HIGHADDR_1
211#define XPAR_PS2_1_DEVICE_ID XPAR_OPB_PS2_DUAL_REF_0_DEVICE_ID_1
212
213/******************************************************************/
214
215#define XPAR_SYSACE_0_BASEADDR XPAR_OPB_SYSACE_0_BASEADDR
216#define XPAR_SYSACE_0_HIGHADDR XPAR_OPB_SYSACE_0_HIGHADDR
217#define XPAR_SYSACE_0_DEVICE_ID XPAR_OPB_SYSACE_0_DEVICE_ID
218
219/******************************************************************/
220
221#define XPAR_IIC_0_BASEADDR XPAR_OPB_IIC_0_BASEADDR
222#define XPAR_IIC_0_HIGHADDR XPAR_OPB_IIC_0_HIGHADDR
223#define XPAR_IIC_0_TEN_BIT_ADR XPAR_OPB_IIC_0_TEN_BIT_ADR
224#define XPAR_IIC_0_DEVICE_ID XPAR_OPB_IIC_0_DEVICE_ID
225
226/******************************************************************/
227
228#define XPAR_PLB_CLOCK_FREQ_HZ 100000000
229#define XPAR_CORE_CLOCK_FREQ_HZ XPAR_CPU_PPC405_CORE_CLOCK_FREQ_HZ
230#define XPAR_DDR_0_SIZE 0x4000000
231
232/******************************************************************/
233
234#define XPAR_PERSISTENT_0_IIC_0_BASEADDR 0x00000400
235#define XPAR_PERSISTENT_0_IIC_0_HIGHADDR 0x000007FF
236#define XPAR_PERSISTENT_0_IIC_0_EEPROMADDR 0xA0
237
238/******************************************************************/
239
240#define XPAR_PCI_0_CLOCK_FREQ_HZ 0
241
242/******************************************************************/
243
diff --git a/arch/ppc/platforms/4xx/yucca.c b/arch/ppc/platforms/4xx/yucca.c
index b065b8babcd3..f287dcdbffce 100644
--- a/arch/ppc/platforms/4xx/yucca.c
+++ b/arch/ppc/platforms/4xx/yucca.c
@@ -1,6 +1,4 @@
1/* 1/*
2 * arch/ppc/platforms/4xx/yucca.c
3 *
4 * Yucca board specific routines 2 * Yucca board specific routines
5 * 3 *
6 * Roland Dreier <rolandd@cisco.com> (based on luan.c by Matt Porter) 4 * Roland Dreier <rolandd@cisco.com> (based on luan.c by Matt Porter)
diff --git a/arch/ppc/platforms/4xx/yucca.h b/arch/ppc/platforms/4xx/yucca.h
index 01a4afea1514..7ae23012237a 100644
--- a/arch/ppc/platforms/4xx/yucca.h
+++ b/arch/ppc/platforms/4xx/yucca.h
@@ -1,6 +1,4 @@
1/* 1/*
2 * arch/ppc/platforms/4xx/yucca.h
3 *
4 * Yucca board definitions 2 * Yucca board definitions
5 * 3 *
6 * Roland Dreier <rolandd@cisco.com> (based on luan.h by Matt Porter) 4 * Roland Dreier <rolandd@cisco.com> (based on luan.h by Matt Porter)
diff --git a/arch/ppc/platforms/83xx/mpc834x_sys.c b/arch/ppc/platforms/83xx/mpc834x_sys.c
index 1a659bbc1860..11626dd9090f 100644
--- a/arch/ppc/platforms/83xx/mpc834x_sys.c
+++ b/arch/ppc/platforms/83xx/mpc834x_sys.c
@@ -1,6 +1,4 @@
1/* 1/*
2 * arch/ppc/platforms/83xx/mpc834x_sys.c
3 *
4 * MPC834x SYS board specific routines 2 * MPC834x SYS board specific routines
5 * 3 *
6 * Maintainer: Kumar Gala <galak@kernel.crashing.org> 4 * Maintainer: Kumar Gala <galak@kernel.crashing.org>
diff --git a/arch/ppc/platforms/83xx/mpc834x_sys.h b/arch/ppc/platforms/83xx/mpc834x_sys.h
index 2e514d316fb8..6727bbdc36ec 100644
--- a/arch/ppc/platforms/83xx/mpc834x_sys.h
+++ b/arch/ppc/platforms/83xx/mpc834x_sys.h
@@ -1,6 +1,4 @@
1/* 1/*
2 * arch/ppc/platforms/83xx/mpc834x_sys.h
3 *
4 * MPC834X SYS common board definitions 2 * MPC834X SYS common board definitions
5 * 3 *
6 * Maintainer: Kumar Gala <galak@kernel.crashing.org> 4 * Maintainer: Kumar Gala <galak@kernel.crashing.org>
@@ -25,7 +23,7 @@
25#define VIRT_IMMRBAR ((uint)0xfe000000) 23#define VIRT_IMMRBAR ((uint)0xfe000000)
26 24
27#define BCSR_PHYS_ADDR ((uint)0xf8000000) 25#define BCSR_PHYS_ADDR ((uint)0xf8000000)
28#define BCSR_SIZE ((uint)(128 * 1024)) 26#define BCSR_SIZE ((uint)(32 * 1024))
29 27
30#define BCSR_MISC_REG2_OFF 0x07 28#define BCSR_MISC_REG2_OFF 0x07
31#define BCSR_MISC_REG2_PORESET 0x01 29#define BCSR_MISC_REG2_PORESET 0x01
diff --git a/arch/ppc/platforms/85xx/mpc8540_ads.c b/arch/ppc/platforms/85xx/mpc8540_ads.c
index 408d64f18e1a..9b014df516b9 100644
--- a/arch/ppc/platforms/85xx/mpc8540_ads.c
+++ b/arch/ppc/platforms/85xx/mpc8540_ads.c
@@ -1,6 +1,4 @@
1/* 1/*
2 * arch/ppc/platforms/85xx/mpc8540_ads.c
3 *
4 * MPC8540ADS board specific routines 2 * MPC8540ADS board specific routines
5 * 3 *
6 * Maintainer: Kumar Gala <galak@kernel.crashing.org> 4 * Maintainer: Kumar Gala <galak@kernel.crashing.org>
diff --git a/arch/ppc/platforms/85xx/mpc8540_ads.h b/arch/ppc/platforms/85xx/mpc8540_ads.h
index e48ca3a97397..0b5e7ff856f5 100644
--- a/arch/ppc/platforms/85xx/mpc8540_ads.h
+++ b/arch/ppc/platforms/85xx/mpc8540_ads.h
@@ -1,6 +1,4 @@
1/* 1/*
2 * arch/ppc/platforms/85xx/mpc8540_ads.h
3 *
4 * MPC8540ADS board definitions 2 * MPC8540ADS board definitions
5 * 3 *
6 * Maintainer: Kumar Gala <galak@kernel.crashing.org> 4 * Maintainer: Kumar Gala <galak@kernel.crashing.org>
diff --git a/arch/ppc/platforms/85xx/mpc8555_cds.h b/arch/ppc/platforms/85xx/mpc8555_cds.h
index 1a8e6c67355d..9754dbd5d18c 100644
--- a/arch/ppc/platforms/85xx/mpc8555_cds.h
+++ b/arch/ppc/platforms/85xx/mpc8555_cds.h
@@ -1,6 +1,4 @@
1/* 1/*
2 * arch/ppc/platforms/mpc8555_cds.h
3 *
4 * MPC8555CDS board definitions 2 * MPC8555CDS board definitions
5 * 3 *
6 * Maintainer: Kumar Gala <galak@kernel.crashing.org> 4 * Maintainer: Kumar Gala <galak@kernel.crashing.org>
diff --git a/arch/ppc/platforms/85xx/mpc8560_ads.c b/arch/ppc/platforms/85xx/mpc8560_ads.c
index 442c7ff195d3..0cb2e86470e2 100644
--- a/arch/ppc/platforms/85xx/mpc8560_ads.c
+++ b/arch/ppc/platforms/85xx/mpc8560_ads.c
@@ -1,6 +1,4 @@
1/* 1/*
2 * arch/ppc/platforms/85xx/mpc8560_ads.c
3 *
4 * MPC8560ADS board specific routines 2 * MPC8560ADS board specific routines
5 * 3 *
6 * Maintainer: Kumar Gala <galak@kernel.crashing.org> 4 * Maintainer: Kumar Gala <galak@kernel.crashing.org>
diff --git a/arch/ppc/platforms/85xx/mpc8560_ads.h b/arch/ppc/platforms/85xx/mpc8560_ads.h
index 143ae7eefa7c..c2247c21fc53 100644
--- a/arch/ppc/platforms/85xx/mpc8560_ads.h
+++ b/arch/ppc/platforms/85xx/mpc8560_ads.h
@@ -1,6 +1,4 @@
1/* 1/*
2 * arch/ppc/platforms/mpc8560_ads.h
3 *
4 * MPC8540ADS board definitions 2 * MPC8540ADS board definitions
5 * 3 *
6 * Maintainer: Kumar Gala <galak@kernel.crashing.org> 4 * Maintainer: Kumar Gala <galak@kernel.crashing.org>
diff --git a/arch/ppc/platforms/85xx/mpc85xx_ads_common.c b/arch/ppc/platforms/85xx/mpc85xx_ads_common.c
index 17ce48fe3503..8fd9d763f58d 100644
--- a/arch/ppc/platforms/85xx/mpc85xx_ads_common.c
+++ b/arch/ppc/platforms/85xx/mpc85xx_ads_common.c
@@ -1,6 +1,4 @@
1/* 1/*
2 * arch/ppc/platforms/85xx/mpc85xx_ads_common.c
3 *
4 * MPC85xx ADS board common routines 2 * MPC85xx ADS board common routines
5 * 3 *
6 * Maintainer: Kumar Gala <galak@kernel.crashing.org> 4 * Maintainer: Kumar Gala <galak@kernel.crashing.org>
diff --git a/arch/ppc/platforms/85xx/mpc85xx_ads_common.h b/arch/ppc/platforms/85xx/mpc85xx_ads_common.h
index 198a6a02cde8..de8d41aafe11 100644
--- a/arch/ppc/platforms/85xx/mpc85xx_ads_common.h
+++ b/arch/ppc/platforms/85xx/mpc85xx_ads_common.h
@@ -1,6 +1,4 @@
1/* 1/*
2 * arch/ppc/platforms/85xx/mpc85xx_ads_common.h
3 *
4 * MPC85XX ADS common board definitions 2 * MPC85XX ADS common board definitions
5 * 3 *
6 * Maintainer: Kumar Gala <galak@kernel.crashing.org> 4 * Maintainer: Kumar Gala <galak@kernel.crashing.org>
diff --git a/arch/ppc/platforms/85xx/mpc85xx_cds_common.c b/arch/ppc/platforms/85xx/mpc85xx_cds_common.c
index 1801ab392e22..c9e0aeeca3d8 100644
--- a/arch/ppc/platforms/85xx/mpc85xx_cds_common.c
+++ b/arch/ppc/platforms/85xx/mpc85xx_cds_common.c
@@ -1,6 +1,4 @@
1/* 1/*
2 * arch/ppc/platform/85xx/mpc85xx_cds_common.c
3 *
4 * MPC85xx CDS board specific routines 2 * MPC85xx CDS board specific routines
5 * 3 *
6 * Maintainer: Kumar Gala <galak@kernel.crashing.org> 4 * Maintainer: Kumar Gala <galak@kernel.crashing.org>
diff --git a/arch/ppc/platforms/85xx/mpc85xx_cds_common.h b/arch/ppc/platforms/85xx/mpc85xx_cds_common.h
index 5b588cfd0e41..62df54f61ae3 100644
--- a/arch/ppc/platforms/85xx/mpc85xx_cds_common.h
+++ b/arch/ppc/platforms/85xx/mpc85xx_cds_common.h
@@ -1,6 +1,4 @@
1/* 1/*
2 * arch/ppc/platforms/85xx/mpc85xx_cds_common.h
3 *
4 * MPC85xx CDS board definitions 2 * MPC85xx CDS board definitions
5 * 3 *
6 * Maintainer: Kumar Gala <galak@kernel.crashing.org> 4 * Maintainer: Kumar Gala <galak@kernel.crashing.org>
diff --git a/arch/ppc/platforms/85xx/sbc8560.c b/arch/ppc/platforms/85xx/sbc8560.c
index 8a72221f816c..b73778ecf827 100644
--- a/arch/ppc/platforms/85xx/sbc8560.c
+++ b/arch/ppc/platforms/85xx/sbc8560.c
@@ -1,6 +1,4 @@
1/* 1/*
2 * arch/ppc/platforms/85xx/sbc8560.c
3 *
4 * Wind River SBC8560 board specific routines 2 * Wind River SBC8560 board specific routines
5 * 3 *
6 * Maintainer: Kumar Gala 4 * Maintainer: Kumar Gala
diff --git a/arch/ppc/platforms/85xx/sbc8560.h b/arch/ppc/platforms/85xx/sbc8560.h
index 5e1b00c77da5..44ffaa2d2c87 100644
--- a/arch/ppc/platforms/85xx/sbc8560.h
+++ b/arch/ppc/platforms/85xx/sbc8560.h
@@ -1,6 +1,4 @@
1/* 1/*
2 * arch/ppc/platforms/85xx/sbc8560.h
3 *
4 * Wind River SBC8560 board definitions 2 * Wind River SBC8560 board definitions
5 * 3 *
6 * Copyright 2003 Motorola Inc. 4 * Copyright 2003 Motorola Inc.
diff --git a/arch/ppc/platforms/85xx/sbc85xx.c b/arch/ppc/platforms/85xx/sbc85xx.c
index c02f110219f5..d3ff280510ff 100644
--- a/arch/ppc/platforms/85xx/sbc85xx.c
+++ b/arch/ppc/platforms/85xx/sbc85xx.c
@@ -1,6 +1,4 @@
1/* 1/*
2 * arch/ppc/platform/85xx/sbc85xx.c
3 *
4 * WindRiver PowerQUICC III SBC85xx board common routines 2 * WindRiver PowerQUICC III SBC85xx board common routines
5 * 3 *
6 * Copyright 2002, 2003 Motorola Inc. 4 * Copyright 2002, 2003 Motorola Inc.
diff --git a/arch/ppc/platforms/85xx/sbc85xx.h b/arch/ppc/platforms/85xx/sbc85xx.h
index 7af93c691a6b..5dd8b6a98c9b 100644
--- a/arch/ppc/platforms/85xx/sbc85xx.h
+++ b/arch/ppc/platforms/85xx/sbc85xx.h
@@ -1,6 +1,4 @@
1/* 1/*
2 * arch/ppc/platforms/85xx/sbc85xx.h
3 *
4 * WindRiver PowerQUICC III SBC85xx common board definitions 2 * WindRiver PowerQUICC III SBC85xx common board definitions
5 * 3 *
6 * Copyright 2003 Motorola Inc. 4 * Copyright 2003 Motorola Inc.
diff --git a/arch/ppc/platforms/85xx/stx_gp3.c b/arch/ppc/platforms/85xx/stx_gp3.c
index 061bb7cf2d9a..8d7baa9a397a 100644
--- a/arch/ppc/platforms/85xx/stx_gp3.c
+++ b/arch/ppc/platforms/85xx/stx_gp3.c
@@ -1,6 +1,4 @@
1/* 1/*
2 * arch/ppc/platforms/85xx/stx_gp3.c
3 *
4 * STx GP3 board specific routines 2 * STx GP3 board specific routines
5 * 3 *
6 * Dan Malek <dan@embeddededge.com> 4 * Dan Malek <dan@embeddededge.com>
diff --git a/arch/ppc/platforms/85xx/stx_gp3.h b/arch/ppc/platforms/85xx/stx_gp3.h
index 2f25b5195152..3f71f8f59370 100644
--- a/arch/ppc/platforms/85xx/stx_gp3.h
+++ b/arch/ppc/platforms/85xx/stx_gp3.h
@@ -1,6 +1,4 @@
1/* 1/*
2 * arch/ppc/platforms/stx8560_gp3.h
3 *
4 * STx GP3 board definitions 2 * STx GP3 board definitions
5 * 3 *
6 * Dan Malek (dan@embeddededge.com) 4 * Dan Malek (dan@embeddededge.com)
diff --git a/arch/ppc/platforms/85xx/tqm85xx.c b/arch/ppc/platforms/85xx/tqm85xx.c
index a5e38ba62732..00af132262b3 100644
--- a/arch/ppc/platforms/85xx/tqm85xx.c
+++ b/arch/ppc/platforms/85xx/tqm85xx.c
@@ -1,6 +1,4 @@
1/* 1/*
2 * arch/ppc/platforms/85xx/tqm85xx.c
3 *
4 * TQM85xx (40/41/55/60) board specific routines 2 * TQM85xx (40/41/55/60) board specific routines
5 * 3 *
6 * Copyright (c) 2005 DENX Software Engineering 4 * Copyright (c) 2005 DENX Software Engineering
diff --git a/arch/ppc/platforms/85xx/tqm85xx.h b/arch/ppc/platforms/85xx/tqm85xx.h
index 3775eb363fde..612d80504f9b 100644
--- a/arch/ppc/platforms/85xx/tqm85xx.h
+++ b/arch/ppc/platforms/85xx/tqm85xx.h
@@ -1,6 +1,4 @@
1/* 1/*
2 * arch/ppc/platforms/85xx/tqm85xx.h
3 *
4 * TQM85xx (40/41/55/60) board definitions 2 * TQM85xx (40/41/55/60) board definitions
5 * 3 *
6 * Copyright (c) 2005 DENX Software Engineering 4 * Copyright (c) 2005 DENX Software Engineering
diff --git a/arch/ppc/platforms/Makefile b/arch/ppc/platforms/Makefile
index 51430e294b32..90c622294423 100644
--- a/arch/ppc/platforms/Makefile
+++ b/arch/ppc/platforms/Makefile
@@ -2,18 +2,10 @@
2# Makefile for the linux kernel. 2# Makefile for the linux kernel.
3# 3#
4 4
5# Extra CFLAGS so we don't have to do relative includes
6CFLAGS_chrp_setup.o += -Iarch/$(ARCH)/mm
7
8obj-$(CONFIG_APUS) += apus_setup.o 5obj-$(CONFIG_APUS) += apus_setup.o
9ifeq ($(CONFIG_APUS),y) 6ifeq ($(CONFIG_APUS),y)
10obj-$(CONFIG_PCI) += apus_pci.o 7obj-$(CONFIG_PCI) += apus_pci.o
11endif 8endif
12obj-$(CONFIG_PPC_CHRP) += chrp_setup.o chrp_time.o chrp_pci.o \
13 chrp_pegasos_eth.o
14ifeq ($(CONFIG_PPC_CHRP),y)
15obj-$(CONFIG_NVRAM) += chrp_nvram.o
16endif
17obj-$(CONFIG_PPC_PREP) += prep_pci.o prep_setup.o 9obj-$(CONFIG_PPC_PREP) += prep_pci.o prep_setup.o
18obj-$(CONFIG_PREP_RESIDUAL) += residual.o 10obj-$(CONFIG_PREP_RESIDUAL) += residual.o
19obj-$(CONFIG_PQ2ADS) += pq2ads.o 11obj-$(CONFIG_PQ2ADS) += pq2ads.o
@@ -37,7 +29,6 @@ obj-$(CONFIG_SBC82xx) += sbc82xx.o
37obj-$(CONFIG_SPRUCE) += spruce.o 29obj-$(CONFIG_SPRUCE) += spruce.o
38obj-$(CONFIG_LITE5200) += lite5200.o 30obj-$(CONFIG_LITE5200) += lite5200.o
39obj-$(CONFIG_EV64360) += ev64360.o 31obj-$(CONFIG_EV64360) += ev64360.o
40 32obj-$(CONFIG_MPC86XADS) += mpc866ads_setup.o
41ifeq ($(CONFIG_SMP),y) 33obj-$(CONFIG_MPC885ADS) += mpc885ads_setup.o
42obj-$(CONFIG_PPC_CHRP) += chrp_smp.o 34obj-$(CONFIG_ADS8272) += mpc8272ads_setup.o
43endif
diff --git a/arch/ppc/platforms/apus_setup.c b/arch/ppc/platforms/apus_setup.c
index c42c50073da5..fe0cdc04d436 100644
--- a/arch/ppc/platforms/apus_setup.c
+++ b/arch/ppc/platforms/apus_setup.c
@@ -1,6 +1,4 @@
1/* 1/*
2 * arch/ppc/platforms/apus_setup.c
3 *
4 * Copyright (C) 1998, 1999 Jesper Skov 2 * Copyright (C) 1998, 1999 Jesper Skov
5 * 3 *
6 * Basically what is needed to replace functionality found in 4 * Basically what is needed to replace functionality found in
diff --git a/arch/ppc/platforms/chestnut.c b/arch/ppc/platforms/chestnut.c
index aefcc0e7be57..f324f757cae1 100644
--- a/arch/ppc/platforms/chestnut.c
+++ b/arch/ppc/platforms/chestnut.c
@@ -1,6 +1,4 @@
1/* 1/*
2 * arch/ppc/platforms/chestnut.c
3 *
4 * Board setup routines for IBM Chestnut 2 * Board setup routines for IBM Chestnut
5 * 3 *
6 * Author: <source@mvista.com> 4 * Author: <source@mvista.com>
diff --git a/arch/ppc/platforms/chestnut.h b/arch/ppc/platforms/chestnut.h
index 0400b2be40ab..e00fd9f8bbd0 100644
--- a/arch/ppc/platforms/chestnut.h
+++ b/arch/ppc/platforms/chestnut.h
@@ -1,6 +1,4 @@
1/* 1/*
2 * arch/ppc/platforms/chestnut.h
3 *
4 * Definitions for IBM 750FXGX Eval (Chestnut) 2 * Definitions for IBM 750FXGX Eval (Chestnut)
5 * 3 *
6 * Author: <source@mvista.com> 4 * Author: <source@mvista.com>
diff --git a/arch/ppc/platforms/chrp_nvram.c b/arch/ppc/platforms/chrp_nvram.c
deleted file mode 100644
index 465ba9b090ef..000000000000
--- a/arch/ppc/platforms/chrp_nvram.c
+++ /dev/null
@@ -1,83 +0,0 @@
1/*
2 * c 2001 PPC 64 Team, IBM Corp
3 *
4 * This program is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU General Public License
6 * as published by the Free Software Foundation; either version
7 * 2 of the License, or (at your option) any later version.
8 *
9 * /dev/nvram driver for PPC
10 *
11 */
12
13#include <linux/kernel.h>
14#include <linux/init.h>
15#include <linux/slab.h>
16#include <linux/spinlock.h>
17#include <asm/uaccess.h>
18#include <asm/prom.h>
19#include <asm/machdep.h>
20
21static unsigned int nvram_size;
22static unsigned char nvram_buf[4];
23static DEFINE_SPINLOCK(nvram_lock);
24
25static unsigned char chrp_nvram_read(int addr)
26{
27 unsigned long done, flags;
28 unsigned char ret;
29
30 if (addr >= nvram_size) {
31 printk(KERN_DEBUG "%s: read addr %d > nvram_size %u\n",
32 current->comm, addr, nvram_size);
33 return 0xff;
34 }
35 spin_lock_irqsave(&nvram_lock, flags);
36 if ((call_rtas("nvram-fetch", 3, 2, &done, addr, __pa(nvram_buf), 1) != 0) || 1 != done)
37 ret = 0xff;
38 else
39 ret = nvram_buf[0];
40 spin_unlock_irqrestore(&nvram_lock, flags);
41
42 return ret;
43}
44
45static void chrp_nvram_write(int addr, unsigned char val)
46{
47 unsigned long done, flags;
48
49 if (addr >= nvram_size) {
50 printk(KERN_DEBUG "%s: write addr %d > nvram_size %u\n",
51 current->comm, addr, nvram_size);
52 return;
53 }
54 spin_lock_irqsave(&nvram_lock, flags);
55 nvram_buf[0] = val;
56 if ((call_rtas("nvram-store", 3, 2, &done, addr, __pa(nvram_buf), 1) != 0) || 1 != done)
57 printk(KERN_DEBUG "rtas IO error storing 0x%02x at %d", val, addr);
58 spin_unlock_irqrestore(&nvram_lock, flags);
59}
60
61void __init chrp_nvram_init(void)
62{
63 struct device_node *nvram;
64 unsigned int *nbytes_p, proplen;
65
66 nvram = of_find_node_by_type(NULL, "nvram");
67 if (nvram == NULL)
68 return;
69
70 nbytes_p = (unsigned int *)get_property(nvram, "#bytes", &proplen);
71 if (nbytes_p == NULL || proplen != sizeof(unsigned int))
72 return;
73
74 nvram_size = *nbytes_p;
75
76 printk(KERN_INFO "CHRP nvram contains %u bytes\n", nvram_size);
77 of_node_put(nvram);
78
79 ppc_md.nvram_read_val = chrp_nvram_read;
80 ppc_md.nvram_write_val = chrp_nvram_write;
81
82 return;
83}
diff --git a/arch/ppc/platforms/chrp_pci.c b/arch/ppc/platforms/chrp_pci.c
deleted file mode 100644
index c7fe6182bb77..000000000000
--- a/arch/ppc/platforms/chrp_pci.c
+++ /dev/null
@@ -1,309 +0,0 @@
1/*
2 * CHRP pci routines.
3 */
4
5#include <linux/config.h>
6#include <linux/kernel.h>
7#include <linux/pci.h>
8#include <linux/delay.h>
9#include <linux/string.h>
10#include <linux/init.h>
11#include <linux/ide.h>
12
13#include <asm/io.h>
14#include <asm/pgtable.h>
15#include <asm/irq.h>
16#include <asm/hydra.h>
17#include <asm/prom.h>
18#include <asm/gg2.h>
19#include <asm/machdep.h>
20#include <asm/sections.h>
21#include <asm/pci-bridge.h>
22#include <asm/open_pic.h>
23
24/* LongTrail */
25void __iomem *gg2_pci_config_base;
26
27/*
28 * The VLSI Golden Gate II has only 512K of PCI configuration space, so we
29 * limit the bus number to 3 bits
30 */
31
32int gg2_read_config(struct pci_bus *bus, unsigned int devfn, int off,
33 int len, u32 *val)
34{
35 volatile void __iomem *cfg_data;
36 struct pci_controller *hose = bus->sysdata;
37
38 if (bus->number > 7)
39 return PCIBIOS_DEVICE_NOT_FOUND;
40 /*
41 * Note: the caller has already checked that off is
42 * suitably aligned and that len is 1, 2 or 4.
43 */
44 cfg_data = hose->cfg_data + ((bus->number<<16) | (devfn<<8) | off);
45 switch (len) {
46 case 1:
47 *val = in_8(cfg_data);
48 break;
49 case 2:
50 *val = in_le16(cfg_data);
51 break;
52 default:
53 *val = in_le32(cfg_data);
54 break;
55 }
56 return PCIBIOS_SUCCESSFUL;
57}
58
59int gg2_write_config(struct pci_bus *bus, unsigned int devfn, int off,
60 int len, u32 val)
61{
62 volatile void __iomem *cfg_data;
63 struct pci_controller *hose = bus->sysdata;
64
65 if (bus->number > 7)
66 return PCIBIOS_DEVICE_NOT_FOUND;
67 /*
68 * Note: the caller has already checked that off is
69 * suitably aligned and that len is 1, 2 or 4.
70 */
71 cfg_data = hose->cfg_data + ((bus->number<<16) | (devfn<<8) | off);
72 switch (len) {
73 case 1:
74 out_8(cfg_data, val);
75 break;
76 case 2:
77 out_le16(cfg_data, val);
78 break;
79 default:
80 out_le32(cfg_data, val);
81 break;
82 }
83 return PCIBIOS_SUCCESSFUL;
84}
85
86static struct pci_ops gg2_pci_ops =
87{
88 gg2_read_config,
89 gg2_write_config
90};
91
92/*
93 * Access functions for PCI config space using RTAS calls.
94 */
95int
96rtas_read_config(struct pci_bus *bus, unsigned int devfn, int offset,
97 int len, u32 *val)
98{
99 struct pci_controller *hose = bus->sysdata;
100 unsigned long addr = (offset & 0xff) | ((devfn & 0xff) << 8)
101 | (((bus->number - hose->first_busno) & 0xff) << 16)
102 | (hose->index << 24);
103 unsigned long ret = ~0UL;
104 int rval;
105
106 rval = call_rtas("read-pci-config", 2, 2, &ret, addr, len);
107 *val = ret;
108 return rval? PCIBIOS_DEVICE_NOT_FOUND: PCIBIOS_SUCCESSFUL;
109}
110
111int
112rtas_write_config(struct pci_bus *bus, unsigned int devfn, int offset,
113 int len, u32 val)
114{
115 struct pci_controller *hose = bus->sysdata;
116 unsigned long addr = (offset & 0xff) | ((devfn & 0xff) << 8)
117 | (((bus->number - hose->first_busno) & 0xff) << 16)
118 | (hose->index << 24);
119 int rval;
120
121 rval = call_rtas("write-pci-config", 3, 1, NULL, addr, len, val);
122 return rval? PCIBIOS_DEVICE_NOT_FOUND: PCIBIOS_SUCCESSFUL;
123}
124
125static struct pci_ops rtas_pci_ops =
126{
127 rtas_read_config,
128 rtas_write_config
129};
130
131volatile struct Hydra __iomem *Hydra = NULL;
132
133int __init
134hydra_init(void)
135{
136 struct device_node *np;
137
138 np = find_devices("mac-io");
139 if (np == NULL || np->n_addrs == 0)
140 return 0;
141 Hydra = ioremap(np->addrs[0].address, np->addrs[0].size);
142 printk("Hydra Mac I/O at %x\n", np->addrs[0].address);
143 printk("Hydra Feature_Control was %x",
144 in_le32(&Hydra->Feature_Control));
145 out_le32(&Hydra->Feature_Control, (HYDRA_FC_SCC_CELL_EN |
146 HYDRA_FC_SCSI_CELL_EN |
147 HYDRA_FC_SCCA_ENABLE |
148 HYDRA_FC_SCCB_ENABLE |
149 HYDRA_FC_ARB_BYPASS |
150 HYDRA_FC_MPIC_ENABLE |
151 HYDRA_FC_SLOW_SCC_PCLK |
152 HYDRA_FC_MPIC_IS_MASTER));
153 printk(", now %x\n", in_le32(&Hydra->Feature_Control));
154 return 1;
155}
156
157void __init
158chrp_pcibios_fixup(void)
159{
160 struct pci_dev *dev = NULL;
161 struct device_node *np;
162
163 /* PCI interrupts are controlled by the OpenPIC */
164 for_each_pci_dev(dev) {
165 np = pci_device_to_OF_node(dev);
166 if ((np != 0) && (np->n_intrs > 0) && (np->intrs[0].line != 0))
167 dev->irq = np->intrs[0].line;
168 pci_write_config_byte(dev, PCI_INTERRUPT_LINE, dev->irq);
169 }
170}
171
172#define PRG_CL_RESET_VALID 0x00010000
173
174static void __init
175setup_python(struct pci_controller *hose, struct device_node *dev)
176{
177 u32 __iomem *reg;
178 u32 val;
179 unsigned long addr = dev->addrs[0].address;
180
181 setup_indirect_pci(hose, addr + 0xf8000, addr + 0xf8010);
182
183 /* Clear the magic go-slow bit */
184 reg = ioremap(dev->addrs[0].address + 0xf6000, 0x40);
185 val = in_be32(&reg[12]);
186 if (val & PRG_CL_RESET_VALID) {
187 out_be32(&reg[12], val & ~PRG_CL_RESET_VALID);
188 in_be32(&reg[12]);
189 }
190 iounmap(reg);
191}
192
193/* Marvell Discovery II based Pegasos 2 */
194static void __init setup_peg2(struct pci_controller *hose, struct device_node *dev)
195{
196 struct device_node *root = find_path_device("/");
197 struct device_node *rtas;
198
199 rtas = of_find_node_by_name (root, "rtas");
200 if (rtas) {
201 hose->ops = &rtas_pci_ops;
202 } else {
203 printk ("RTAS supporting Pegasos OF not found, please upgrade"
204 " your firmware\n");
205 }
206 pci_assign_all_buses = 1;
207}
208
209void __init
210chrp_find_bridges(void)
211{
212 struct device_node *dev;
213 int *bus_range;
214 int len, index = -1;
215 struct pci_controller *hose;
216 unsigned int *dma;
217 char *model, *machine;
218 int is_longtrail = 0, is_mot = 0, is_pegasos = 0;
219 struct device_node *root = find_path_device("/");
220
221 /*
222 * The PCI host bridge nodes on some machines don't have
223 * properties to adequately identify them, so we have to
224 * look at what sort of machine this is as well.
225 */
226 machine = get_property(root, "model", NULL);
227 if (machine != NULL) {
228 is_longtrail = strncmp(machine, "IBM,LongTrail", 13) == 0;
229 is_mot = strncmp(machine, "MOT", 3) == 0;
230 if (strncmp(machine, "Pegasos2", 8) == 0)
231 is_pegasos = 2;
232 else if (strncmp(machine, "Pegasos", 7) == 0)
233 is_pegasos = 1;
234 }
235 for (dev = root->child; dev != NULL; dev = dev->sibling) {
236 if (dev->type == NULL || strcmp(dev->type, "pci") != 0)
237 continue;
238 ++index;
239 /* The GG2 bridge on the LongTrail doesn't have an address */
240 if (dev->n_addrs < 1 && !is_longtrail) {
241 printk(KERN_WARNING "Can't use %s: no address\n",
242 dev->full_name);
243 continue;
244 }
245 bus_range = (int *) get_property(dev, "bus-range", &len);
246 if (bus_range == NULL || len < 2 * sizeof(int)) {
247 printk(KERN_WARNING "Can't get bus-range for %s\n",
248 dev->full_name);
249 continue;
250 }
251 if (bus_range[1] == bus_range[0])
252 printk(KERN_INFO "PCI bus %d", bus_range[0]);
253 else
254 printk(KERN_INFO "PCI buses %d..%d",
255 bus_range[0], bus_range[1]);
256 printk(" controlled by %s", dev->type);
257 if (dev->n_addrs > 0)
258 printk(" at %x", dev->addrs[0].address);
259 printk("\n");
260
261 hose = pcibios_alloc_controller();
262 if (!hose) {
263 printk("Can't allocate PCI controller structure for %s\n",
264 dev->full_name);
265 continue;
266 }
267 hose->arch_data = dev;
268 hose->first_busno = bus_range[0];
269 hose->last_busno = bus_range[1];
270
271 model = get_property(dev, "model", NULL);
272 if (model == NULL)
273 model = "<none>";
274 if (device_is_compatible(dev, "IBM,python")) {
275 setup_python(hose, dev);
276 } else if (is_mot
277 || strncmp(model, "Motorola, Grackle", 17) == 0) {
278 setup_indirect_pci(hose, 0xfec00000, 0xfee00000);
279 } else if (is_longtrail) {
280 void __iomem *p = ioremap(GG2_PCI_CONFIG_BASE, 0x80000);
281 hose->ops = &gg2_pci_ops;
282 hose->cfg_data = p;
283 gg2_pci_config_base = p;
284 } else if (is_pegasos == 1) {
285 setup_indirect_pci(hose, 0xfec00cf8, 0xfee00cfc);
286 } else if (is_pegasos == 2) {
287 setup_peg2(hose, dev);
288 } else {
289 printk("No methods for %s (model %s), using RTAS\n",
290 dev->full_name, model);
291 hose->ops = &rtas_pci_ops;
292 }
293
294 pci_process_bridge_OF_ranges(hose, dev, index == 0);
295
296 /* check the first bridge for a property that we can
297 use to set pci_dram_offset */
298 dma = (unsigned int *)
299 get_property(dev, "ibm,dma-ranges", &len);
300 if (index == 0 && dma != NULL && len >= 6 * sizeof(*dma)) {
301 pci_dram_offset = dma[2] - dma[3];
302 printk("pci_dram_offset = %lx\n", pci_dram_offset);
303 }
304 }
305
306 /* Do not fixup interrupts from OF tree on pegasos */
307 if (is_pegasos == 0)
308 ppc_md.pcibios_fixup = chrp_pcibios_fixup;
309}
diff --git a/arch/ppc/platforms/chrp_pegasos_eth.c b/arch/ppc/platforms/chrp_pegasos_eth.c
deleted file mode 100644
index 108a6e265185..000000000000
--- a/arch/ppc/platforms/chrp_pegasos_eth.c
+++ /dev/null
@@ -1,213 +0,0 @@
1/*
2 * arch/ppc/platforms/chrp_pegasos_eth.c
3 *
4 * Copyright (C) 2005 Sven Luther <sl@bplan-gmbh.de>
5 * Thanks to :
6 * Dale Farnsworth <dale@farnsworth.org>
7 * Mark A. Greer <mgreer@mvista.com>
8 * Nicolas DET <nd@bplan-gmbh.de>
9 * Benjamin Herrenschmidt <benh@kernel.crashing.org>
10 * And anyone else who helped me on this.
11 */
12
13#include <linux/types.h>
14#include <linux/init.h>
15#include <linux/ioport.h>
16#include <linux/platform_device.h>
17#include <linux/mv643xx.h>
18#include <linux/pci.h>
19
20#define PEGASOS2_MARVELL_REGBASE (0xf1000000)
21#define PEGASOS2_MARVELL_REGSIZE (0x00004000)
22#define PEGASOS2_SRAM_BASE (0xf2000000)
23#define PEGASOS2_SRAM_SIZE (256*1024)
24
25#define PEGASOS2_SRAM_BASE_ETH0 (PEGASOS2_SRAM_BASE)
26#define PEGASOS2_SRAM_BASE_ETH1 (PEGASOS2_SRAM_BASE_ETH0 + (PEGASOS2_SRAM_SIZE / 2) )
27
28
29#define PEGASOS2_SRAM_RXRING_SIZE (PEGASOS2_SRAM_SIZE/4)
30#define PEGASOS2_SRAM_TXRING_SIZE (PEGASOS2_SRAM_SIZE/4)
31
32#undef BE_VERBOSE
33
34static struct resource mv643xx_eth_shared_resources[] = {
35 [0] = {
36 .name = "ethernet shared base",
37 .start = 0xf1000000 + MV643XX_ETH_SHARED_REGS,
38 .end = 0xf1000000 + MV643XX_ETH_SHARED_REGS +
39 MV643XX_ETH_SHARED_REGS_SIZE - 1,
40 .flags = IORESOURCE_MEM,
41 },
42};
43
44static struct platform_device mv643xx_eth_shared_device = {
45 .name = MV643XX_ETH_SHARED_NAME,
46 .id = 0,
47 .num_resources = ARRAY_SIZE(mv643xx_eth_shared_resources),
48 .resource = mv643xx_eth_shared_resources,
49};
50
51static struct resource mv643xx_eth0_resources[] = {
52 [0] = {
53 .name = "eth0 irq",
54 .start = 9,
55 .end = 9,
56 .flags = IORESOURCE_IRQ,
57 },
58};
59
60
61static struct mv643xx_eth_platform_data eth0_pd = {
62 .tx_sram_addr = PEGASOS2_SRAM_BASE_ETH0,
63 .tx_sram_size = PEGASOS2_SRAM_TXRING_SIZE,
64 .tx_queue_size = PEGASOS2_SRAM_TXRING_SIZE/16,
65
66 .rx_sram_addr = PEGASOS2_SRAM_BASE_ETH0 + PEGASOS2_SRAM_TXRING_SIZE,
67 .rx_sram_size = PEGASOS2_SRAM_RXRING_SIZE,
68 .rx_queue_size = PEGASOS2_SRAM_RXRING_SIZE/16,
69};
70
71static struct platform_device eth0_device = {
72 .name = MV643XX_ETH_NAME,
73 .id = 0,
74 .num_resources = ARRAY_SIZE(mv643xx_eth0_resources),
75 .resource = mv643xx_eth0_resources,
76 .dev = {
77 .platform_data = &eth0_pd,
78 },
79};
80
81static struct resource mv643xx_eth1_resources[] = {
82 [0] = {
83 .name = "eth1 irq",
84 .start = 9,
85 .end = 9,
86 .flags = IORESOURCE_IRQ,
87 },
88};
89
90static struct mv643xx_eth_platform_data eth1_pd = {
91 .tx_sram_addr = PEGASOS2_SRAM_BASE_ETH1,
92 .tx_sram_size = PEGASOS2_SRAM_TXRING_SIZE,
93 .tx_queue_size = PEGASOS2_SRAM_TXRING_SIZE/16,
94
95 .rx_sram_addr = PEGASOS2_SRAM_BASE_ETH1 + PEGASOS2_SRAM_TXRING_SIZE,
96 .rx_sram_size = PEGASOS2_SRAM_RXRING_SIZE,
97 .rx_queue_size = PEGASOS2_SRAM_RXRING_SIZE/16,
98};
99
100static struct platform_device eth1_device = {
101 .name = MV643XX_ETH_NAME,
102 .id = 1,
103 .num_resources = ARRAY_SIZE(mv643xx_eth1_resources),
104 .resource = mv643xx_eth1_resources,
105 .dev = {
106 .platform_data = &eth1_pd,
107 },
108};
109
110static struct platform_device *mv643xx_eth_pd_devs[] __initdata = {
111 &mv643xx_eth_shared_device,
112 &eth0_device,
113 &eth1_device,
114};
115
116/***********/
117/***********/
118#define MV_READ(offset,val) { val = readl(mv643xx_reg_base + offset); }
119#define MV_WRITE(offset,data) writel(data, mv643xx_reg_base + offset)
120
121static void __iomem *mv643xx_reg_base;
122
123static int Enable_SRAM(void)
124{
125 u32 ALong;
126
127 if (mv643xx_reg_base == NULL)
128 mv643xx_reg_base = ioremap(PEGASOS2_MARVELL_REGBASE,
129 PEGASOS2_MARVELL_REGSIZE);
130
131 if (mv643xx_reg_base == NULL)
132 return -ENOMEM;
133
134#ifdef BE_VERBOSE
135 printk("Pegasos II/Marvell MV64361: register remapped from %p to %p\n",
136 (void *)PEGASOS2_MARVELL_REGBASE, (void *)mv643xx_reg_base);
137#endif
138
139 MV_WRITE(MV64340_SRAM_CONFIG, 0);
140
141 MV_WRITE(MV64340_INTEGRATED_SRAM_BASE_ADDR, PEGASOS2_SRAM_BASE >> 16);
142
143 MV_READ(MV64340_BASE_ADDR_ENABLE, ALong);
144 ALong &= ~(1 << 19);
145 MV_WRITE(MV64340_BASE_ADDR_ENABLE, ALong);
146
147 ALong = 0x02;
148 ALong |= PEGASOS2_SRAM_BASE & 0xffff0000;
149 MV_WRITE(MV643XX_ETH_BAR_4, ALong);
150
151 MV_WRITE(MV643XX_ETH_SIZE_REG_4, (PEGASOS2_SRAM_SIZE-1) & 0xffff0000);
152
153 MV_READ(MV643XX_ETH_BASE_ADDR_ENABLE_REG, ALong);
154 ALong &= ~(1 << 4);
155 MV_WRITE(MV643XX_ETH_BASE_ADDR_ENABLE_REG, ALong);
156
157#ifdef BE_VERBOSE
158 printk("Pegasos II/Marvell MV64361: register unmapped\n");
159 printk("Pegasos II/Marvell MV64361: SRAM at %p, size=%x\n", (void*) PEGASOS2_SRAM_BASE, PEGASOS2_SRAM_SIZE);
160#endif
161
162 iounmap(mv643xx_reg_base);
163 mv643xx_reg_base = NULL;
164
165 return 1;
166}
167
168
169/***********/
170/***********/
171int mv643xx_eth_add_pds(void)
172{
173 int ret = 0;
174 static struct pci_device_id pci_marvell_mv64360[] = {
175 { PCI_DEVICE(PCI_VENDOR_ID_MARVELL, PCI_DEVICE_ID_MARVELL_MV64360) },
176 { }
177 };
178
179#ifdef BE_VERBOSE
180 printk("Pegasos II/Marvell MV64361: init\n");
181#endif
182
183 if (pci_dev_present(pci_marvell_mv64360)) {
184 ret = platform_add_devices(mv643xx_eth_pd_devs,
185 ARRAY_SIZE(mv643xx_eth_pd_devs));
186
187 if ( Enable_SRAM() < 0)
188 {
189 eth0_pd.tx_sram_addr = 0;
190 eth0_pd.tx_sram_size = 0;
191 eth0_pd.rx_sram_addr = 0;
192 eth0_pd.rx_sram_size = 0;
193
194 eth1_pd.tx_sram_addr = 0;
195 eth1_pd.tx_sram_size = 0;
196 eth1_pd.rx_sram_addr = 0;
197 eth1_pd.rx_sram_size = 0;
198
199#ifdef BE_VERBOSE
200 printk("Pegasos II/Marvell MV64361: Can't enable the "
201 "SRAM\n");
202#endif
203 }
204 }
205
206#ifdef BE_VERBOSE
207 printk("Pegasos II/Marvell MV64361: init is over\n");
208#endif
209
210 return ret;
211}
212
213device_initcall(mv643xx_eth_add_pds);
diff --git a/arch/ppc/platforms/chrp_setup.c b/arch/ppc/platforms/chrp_setup.c
deleted file mode 100644
index 48996b787378..000000000000
--- a/arch/ppc/platforms/chrp_setup.c
+++ /dev/null
@@ -1,671 +0,0 @@
1/*
2 * arch/ppc/platforms/setup.c
3 *
4 * Copyright (C) 1995 Linus Torvalds
5 * Adapted from 'alpha' version by Gary Thomas
6 * Modified by Cort Dougan (cort@cs.nmt.edu)
7 */
8
9/*
10 * bootup setup stuff..
11 */
12
13#include <linux/config.h>
14#include <linux/errno.h>
15#include <linux/sched.h>
16#include <linux/kernel.h>
17#include <linux/mm.h>
18#include <linux/stddef.h>
19#include <linux/unistd.h>
20#include <linux/ptrace.h>
21#include <linux/slab.h>
22#include <linux/user.h>
23#include <linux/a.out.h>
24#include <linux/tty.h>
25#include <linux/major.h>
26#include <linux/interrupt.h>
27#include <linux/reboot.h>
28#include <linux/init.h>
29#include <linux/pci.h>
30#include <linux/version.h>
31#include <linux/adb.h>
32#include <linux/module.h>
33#include <linux/delay.h>
34#include <linux/ide.h>
35#include <linux/console.h>
36#include <linux/seq_file.h>
37#include <linux/root_dev.h>
38#include <linux/initrd.h>
39#include <linux/module.h>
40
41#include <asm/io.h>
42#include <asm/pgtable.h>
43#include <asm/prom.h>
44#include <asm/gg2.h>
45#include <asm/pci-bridge.h>
46#include <asm/dma.h>
47#include <asm/machdep.h>
48#include <asm/irq.h>
49#include <asm/hydra.h>
50#include <asm/sections.h>
51#include <asm/time.h>
52#include <asm/btext.h>
53#include <asm/i8259.h>
54#include <asm/open_pic.h>
55#include <asm/xmon.h>
56#include "mem_pieces.h"
57
58unsigned long chrp_get_rtc_time(void);
59int chrp_set_rtc_time(unsigned long nowtime);
60void chrp_calibrate_decr(void);
61long chrp_time_init(void);
62
63void chrp_find_bridges(void);
64void chrp_event_scan(void);
65void rtas_display_progress(char *, unsigned short);
66void rtas_indicator_progress(char *, unsigned short);
67void btext_progress(char *, unsigned short);
68
69extern int of_show_percpuinfo(struct seq_file *, int);
70
71int _chrp_type;
72EXPORT_SYMBOL(_chrp_type);
73
74/*
75 * XXX this should be in xmon.h, but putting it there means xmon.h
76 * has to include <linux/interrupt.h> (to get irqreturn_t), which
77 * causes all sorts of problems. -- paulus
78 */
79extern irqreturn_t xmon_irq(int, void *, struct pt_regs *);
80
81extern dev_t boot_dev;
82
83extern PTE *Hash, *Hash_end;
84extern unsigned long Hash_size, Hash_mask;
85extern int probingmem;
86extern unsigned long loops_per_jiffy;
87static int max_width;
88
89#ifdef CONFIG_SMP
90extern struct smp_ops_t chrp_smp_ops;
91#endif
92
93static const char *gg2_memtypes[4] = {
94 "FPM", "SDRAM", "EDO", "BEDO"
95};
96static const char *gg2_cachesizes[4] = {
97 "256 KB", "512 KB", "1 MB", "Reserved"
98};
99static const char *gg2_cachetypes[4] = {
100 "Asynchronous", "Reserved", "Flow-Through Synchronous",
101 "Pipelined Synchronous"
102};
103static const char *gg2_cachemodes[4] = {
104 "Disabled", "Write-Through", "Copy-Back", "Transparent Mode"
105};
106
107int
108chrp_show_cpuinfo(struct seq_file *m)
109{
110 int i, sdramen;
111 unsigned int t;
112 struct device_node *root;
113 const char *model = "";
114
115 root = find_path_device("/");
116 if (root)
117 model = get_property(root, "model", NULL);
118 seq_printf(m, "machine\t\t: CHRP %s\n", model);
119
120 /* longtrail (goldengate) stuff */
121 if (!strncmp(model, "IBM,LongTrail", 13)) {
122 /* VLSI VAS96011/12 `Golden Gate 2' */
123 /* Memory banks */
124 sdramen = (in_le32(gg2_pci_config_base + GG2_PCI_DRAM_CTRL)
125 >>31) & 1;
126 for (i = 0; i < (sdramen ? 4 : 6); i++) {
127 t = in_le32(gg2_pci_config_base+
128 GG2_PCI_DRAM_BANK0+
129 i*4);
130 if (!(t & 1))
131 continue;
132 switch ((t>>8) & 0x1f) {
133 case 0x1f:
134 model = "4 MB";
135 break;
136 case 0x1e:
137 model = "8 MB";
138 break;
139 case 0x1c:
140 model = "16 MB";
141 break;
142 case 0x18:
143 model = "32 MB";
144 break;
145 case 0x10:
146 model = "64 MB";
147 break;
148 case 0x00:
149 model = "128 MB";
150 break;
151 default:
152 model = "Reserved";
153 break;
154 }
155 seq_printf(m, "memory bank %d\t: %s %s\n", i, model,
156 gg2_memtypes[sdramen ? 1 : ((t>>1) & 3)]);
157 }
158 /* L2 cache */
159 t = in_le32(gg2_pci_config_base+GG2_PCI_CC_CTRL);
160 seq_printf(m, "board l2\t: %s %s (%s)\n",
161 gg2_cachesizes[(t>>7) & 3],
162 gg2_cachetypes[(t>>2) & 3],
163 gg2_cachemodes[t & 3]);
164 }
165 return 0;
166}
167
168/*
169 * Fixes for the National Semiconductor PC78308VUL SuperI/O
170 *
171 * Some versions of Open Firmware incorrectly initialize the IRQ settings
172 * for keyboard and mouse
173 */
174static inline void __init sio_write(u8 val, u8 index)
175{
176 outb(index, 0x15c);
177 outb(val, 0x15d);
178}
179
180static inline u8 __init sio_read(u8 index)
181{
182 outb(index, 0x15c);
183 return inb(0x15d);
184}
185
186static void __init sio_fixup_irq(const char *name, u8 device, u8 level,
187 u8 type)
188{
189 u8 level0, type0, active;
190
191 /* select logical device */
192 sio_write(device, 0x07);
193 active = sio_read(0x30);
194 level0 = sio_read(0x70);
195 type0 = sio_read(0x71);
196 if (level0 != level || type0 != type || !active) {
197 printk(KERN_WARNING "sio: %s irq level %d, type %d, %sactive: "
198 "remapping to level %d, type %d, active\n",
199 name, level0, type0, !active ? "in" : "", level, type);
200 sio_write(0x01, 0x30);
201 sio_write(level, 0x70);
202 sio_write(type, 0x71);
203 }
204}
205
206static void __init sio_init(void)
207{
208 struct device_node *root;
209
210 if ((root = find_path_device("/")) &&
211 !strncmp(get_property(root, "model", NULL), "IBM,LongTrail", 13)) {
212 /* logical device 0 (KBC/Keyboard) */
213 sio_fixup_irq("keyboard", 0, 1, 2);
214 /* select logical device 1 (KBC/Mouse) */
215 sio_fixup_irq("mouse", 1, 12, 2);
216 }
217}
218
219
220static void __init pegasos_set_l2cr(void)
221{
222 struct device_node *np;
223
224 /* On Pegasos, enable the l2 cache if needed, as the OF forgets it */
225 if (_chrp_type != _CHRP_Pegasos)
226 return;
227
228 /* Enable L2 cache if needed */
229 np = find_type_devices("cpu");
230 if (np != NULL) {
231 unsigned int *l2cr = (unsigned int *)
232 get_property (np, "l2cr", NULL);
233 if (l2cr == NULL) {
234 printk ("Pegasos l2cr : no cpu l2cr property found\n");
235 return;
236 }
237 if (!((*l2cr) & 0x80000000)) {
238 printk ("Pegasos l2cr : L2 cache was not active, "
239 "activating\n");
240 _set_L2CR(0);
241 _set_L2CR((*l2cr) | 0x80000000);
242 }
243 }
244}
245
246void __init chrp_setup_arch(void)
247{
248 struct device_node *device;
249
250 /* init to some ~sane value until calibrate_delay() runs */
251 loops_per_jiffy = 50000000/HZ;
252
253#ifdef CONFIG_BLK_DEV_INITRD
254 /* this is fine for chrp */
255 initrd_below_start_ok = 1;
256
257 if (initrd_start)
258 ROOT_DEV = Root_RAM0;
259 else
260#endif
261 ROOT_DEV = Root_SDA2; /* sda2 (sda1 is for the kernel) */
262
263 /* On pegasos, enable the L2 cache if not already done by OF */
264 pegasos_set_l2cr();
265
266 /* Lookup PCI host bridges */
267 chrp_find_bridges();
268
269#ifndef CONFIG_PPC64BRIDGE
270 /*
271 * Temporary fixes for PCI devices.
272 * -- Geert
273 */
274 hydra_init(); /* Mac I/O */
275
276#endif /* CONFIG_PPC64BRIDGE */
277
278 /*
279 * Fix the Super I/O configuration
280 */
281 sio_init();
282
283 /* Get the event scan rate for the rtas so we know how
284 * often it expects a heartbeat. -- Cort
285 */
286 if ( rtas_data ) {
287 struct property *p;
288 device = find_devices("rtas");
289 for ( p = device->properties;
290 p && strncmp(p->name, "rtas-event-scan-rate", 20);
291 p = p->next )
292 /* nothing */ ;
293 if ( p && *(unsigned long *)p->value ) {
294 ppc_md.heartbeat = chrp_event_scan;
295 ppc_md.heartbeat_reset = (HZ/(*(unsigned long *)p->value)*30)-1;
296 ppc_md.heartbeat_count = 1;
297 printk("RTAS Event Scan Rate: %lu (%lu jiffies)\n",
298 *(unsigned long *)p->value, ppc_md.heartbeat_reset );
299 }
300 }
301
302 pci_create_OF_bus_map();
303}
304
305void
306chrp_event_scan(void)
307{
308 unsigned char log[1024];
309 unsigned long ret = 0;
310 /* XXX: we should loop until the hardware says no more error logs -- Cort */
311 call_rtas( "event-scan", 4, 1, &ret, 0xffffffff, 0,
312 __pa(log), 1024 );
313 ppc_md.heartbeat_count = ppc_md.heartbeat_reset;
314}
315
316void
317chrp_restart(char *cmd)
318{
319 printk("RTAS system-reboot returned %d\n",
320 call_rtas("system-reboot", 0, 1, NULL));
321 for (;;);
322}
323
324void
325chrp_power_off(void)
326{
327 /* allow power on only with power button press */
328 printk("RTAS power-off returned %d\n",
329 call_rtas("power-off", 2, 1, NULL,0xffffffff,0xffffffff));
330 for (;;);
331}
332
333void
334chrp_halt(void)
335{
336 chrp_power_off();
337}
338
339/*
340 * Finds the open-pic node and sets OpenPIC_Addr based on its reg property.
341 * Then checks if it has an interrupt-ranges property. If it does then
342 * we have a distributed open-pic, so call openpic_set_sources to tell
343 * the openpic code where to find the interrupt source registers.
344 */
345static void __init chrp_find_openpic(void)
346{
347 struct device_node *np;
348 int len, i;
349 unsigned int *iranges;
350 void __iomem *isu;
351
352 np = find_type_devices("open-pic");
353 if (np == NULL || np->n_addrs == 0)
354 return;
355 printk(KERN_INFO "OpenPIC at %x (size %x)\n",
356 np->addrs[0].address, np->addrs[0].size);
357 OpenPIC_Addr = ioremap(np->addrs[0].address, 0x40000);
358 if (OpenPIC_Addr == NULL) {
359 printk(KERN_ERR "Failed to map OpenPIC!\n");
360 return;
361 }
362
363 iranges = (unsigned int *) get_property(np, "interrupt-ranges", &len);
364 if (iranges == NULL || len < 2 * sizeof(unsigned int))
365 return; /* not distributed */
366
367 /*
368 * The first pair of cells in interrupt-ranges refers to the
369 * IDU; subsequent pairs refer to the ISUs.
370 */
371 len /= 2 * sizeof(unsigned int);
372 if (np->n_addrs < len) {
373 printk(KERN_ERR "Insufficient addresses for distributed"
374 " OpenPIC (%d < %d)\n", np->n_addrs, len);
375 return;
376 }
377 if (iranges[1] != 0) {
378 printk(KERN_INFO "OpenPIC irqs %d..%d in IDU\n",
379 iranges[0], iranges[0] + iranges[1] - 1);
380 openpic_set_sources(iranges[0], iranges[1], NULL);
381 }
382 for (i = 1; i < len; ++i) {
383 iranges += 2;
384 printk(KERN_INFO "OpenPIC irqs %d..%d in ISU at %x (%x)\n",
385 iranges[0], iranges[0] + iranges[1] - 1,
386 np->addrs[i].address, np->addrs[i].size);
387 isu = ioremap(np->addrs[i].address, np->addrs[i].size);
388 if (isu != NULL)
389 openpic_set_sources(iranges[0], iranges[1], isu);
390 else
391 printk(KERN_ERR "Failed to map OpenPIC ISU at %x!\n",
392 np->addrs[i].address);
393 }
394}
395
396#if defined(CONFIG_VT) && defined(CONFIG_INPUT_ADBHID) && defined(XMON)
397static struct irqaction xmon_irqaction = {
398 .handler = xmon_irq,
399 .mask = CPU_MASK_NONE,
400 .name = "XMON break",
401};
402#endif
403
404void __init chrp_init_IRQ(void)
405{
406 struct device_node *np;
407 unsigned long chrp_int_ack = 0;
408 unsigned char init_senses[NR_IRQS - NUM_8259_INTERRUPTS];
409#if defined(CONFIG_VT) && defined(CONFIG_INPUT_ADBHID) && defined(XMON)
410 struct device_node *kbd;
411#endif
412
413 for (np = find_devices("pci"); np != NULL; np = np->next) {
414 unsigned int *addrp = (unsigned int *)
415 get_property(np, "8259-interrupt-acknowledge", NULL);
416
417 if (addrp == NULL)
418 continue;
419 chrp_int_ack = addrp[prom_n_addr_cells(np)-1];
420 break;
421 }
422 if (np == NULL)
423 printk(KERN_ERR "Cannot find PCI interrupt acknowledge address\n");
424
425 chrp_find_openpic();
426
427 if (OpenPIC_Addr) {
428 prom_get_irq_senses(init_senses, NUM_8259_INTERRUPTS, NR_IRQS);
429 OpenPIC_InitSenses = init_senses;
430 OpenPIC_NumInitSenses = NR_IRQS - NUM_8259_INTERRUPTS;
431
432 openpic_init(NUM_8259_INTERRUPTS);
433 /* We have a cascade on OpenPIC IRQ 0, Linux IRQ 16 */
434 openpic_hookup_cascade(NUM_8259_INTERRUPTS, "82c59 cascade",
435 i8259_irq);
436
437 }
438 i8259_init(chrp_int_ack, 0);
439
440#if defined(CONFIG_VT) && defined(CONFIG_INPUT_ADBHID) && defined(XMON)
441 /* see if there is a keyboard in the device tree
442 with a parent of type "adb" */
443 for (kbd = find_devices("keyboard"); kbd; kbd = kbd->next)
444 if (kbd->parent && kbd->parent->type
445 && strcmp(kbd->parent->type, "adb") == 0)
446 break;
447 if (kbd)
448 setup_irq(HYDRA_INT_ADB_NMI, &xmon_irqaction);
449#endif
450}
451
452void __init
453chrp_init2(void)
454{
455#ifdef CONFIG_NVRAM
456 chrp_nvram_init();
457#endif
458
459 request_region(0x20,0x20,"pic1");
460 request_region(0xa0,0x20,"pic2");
461 request_region(0x00,0x20,"dma1");
462 request_region(0x40,0x20,"timer");
463 request_region(0x80,0x10,"dma page reg");
464 request_region(0xc0,0x20,"dma2");
465
466 if (ppc_md.progress)
467 ppc_md.progress(" Have fun! ", 0x7777);
468}
469
470static struct device_node *memory_node;
471
472static int __init get_mem_prop(char *name, struct mem_pieces *mp)
473{
474 struct reg_property *rp;
475 int i, s;
476 unsigned int *ip;
477 int nac = prom_n_addr_cells(memory_node);
478 int nsc = prom_n_size_cells(memory_node);
479
480 ip = (unsigned int *) get_property(memory_node, name, &s);
481 if (ip == NULL) {
482 printk(KERN_ERR "error: couldn't get %s property on /memory\n",
483 name);
484 return 0;
485 }
486 s /= (nsc + nac) * 4;
487 rp = mp->regions;
488 for (i = 0; i < s; ++i, ip += nac+nsc) {
489 if (nac >= 2 && ip[nac-2] != 0)
490 continue;
491 rp->address = ip[nac-1];
492 if (nsc >= 2 && ip[nac+nsc-2] != 0)
493 rp->size = ~0U;
494 else
495 rp->size = ip[nac+nsc-1];
496 ++rp;
497 }
498 mp->n_regions = rp - mp->regions;
499
500 /* Make sure the pieces are sorted. */
501 mem_pieces_sort(mp);
502 mem_pieces_coalesce(mp);
503 return 1;
504}
505
506static unsigned long __init chrp_find_end_of_memory(void)
507{
508 unsigned long a, total;
509 struct mem_pieces phys_mem;
510
511 /*
512 * Find out where physical memory is, and check that it
513 * starts at 0 and is contiguous. It seems that RAM is
514 * always physically contiguous on Power Macintoshes.
515 *
516 * Supporting discontiguous physical memory isn't hard,
517 * it just makes the virtual <-> physical mapping functions
518 * more complicated (or else you end up wasting space
519 * in mem_map).
520 */
521 memory_node = find_devices("memory");
522 if (memory_node == NULL || !get_mem_prop("reg", &phys_mem)
523 || phys_mem.n_regions == 0)
524 panic("No RAM??");
525 a = phys_mem.regions[0].address;
526 if (a != 0)
527 panic("RAM doesn't start at physical address 0");
528 total = phys_mem.regions[0].size;
529
530 if (phys_mem.n_regions > 1) {
531 printk("RAM starting at 0x%x is not contiguous\n",
532 phys_mem.regions[1].address);
533 printk("Using RAM from 0 to 0x%lx\n", total-1);
534 }
535
536 return total;
537}
538
539void __init
540chrp_init(unsigned long r3, unsigned long r4, unsigned long r5,
541 unsigned long r6, unsigned long r7)
542{
543 struct device_node *root = find_path_device ("/");
544 char *machine = NULL;
545
546#ifdef CONFIG_BLK_DEV_INITRD
547 /* take care of initrd if we have one */
548 if ( r6 )
549 {
550 initrd_start = r6 + KERNELBASE;
551 initrd_end = r6 + r7 + KERNELBASE;
552 }
553#endif /* CONFIG_BLK_DEV_INITRD */
554
555 ISA_DMA_THRESHOLD = ~0L;
556 DMA_MODE_READ = 0x44;
557 DMA_MODE_WRITE = 0x48;
558 isa_io_base = CHRP_ISA_IO_BASE; /* default value */
559 ppc_do_canonicalize_irqs = 1;
560
561 if (root)
562 machine = get_property(root, "model", NULL);
563 if (machine && strncmp(machine, "Pegasos", 7) == 0) {
564 _chrp_type = _CHRP_Pegasos;
565 } else if (machine && strncmp(machine, "IBM", 3) == 0) {
566 _chrp_type = _CHRP_IBM;
567 } else if (machine && strncmp(machine, "MOT", 3) == 0) {
568 _chrp_type = _CHRP_Motorola;
569 } else {
570 /* Let's assume it is an IBM chrp if all else fails */
571 _chrp_type = _CHRP_IBM;
572 }
573
574 ppc_md.setup_arch = chrp_setup_arch;
575 ppc_md.show_percpuinfo = of_show_percpuinfo;
576 ppc_md.show_cpuinfo = chrp_show_cpuinfo;
577
578 ppc_md.init_IRQ = chrp_init_IRQ;
579 if (_chrp_type == _CHRP_Pegasos)
580 ppc_md.get_irq = i8259_irq;
581 else
582 ppc_md.get_irq = openpic_get_irq;
583
584 ppc_md.init = chrp_init2;
585
586 ppc_md.phys_mem_access_prot = pci_phys_mem_access_prot;
587
588 ppc_md.restart = chrp_restart;
589 ppc_md.power_off = chrp_power_off;
590 ppc_md.halt = chrp_halt;
591
592 ppc_md.time_init = chrp_time_init;
593 ppc_md.set_rtc_time = chrp_set_rtc_time;
594 ppc_md.get_rtc_time = chrp_get_rtc_time;
595 ppc_md.calibrate_decr = chrp_calibrate_decr;
596
597 ppc_md.find_end_of_memory = chrp_find_end_of_memory;
598
599 if (rtas_data) {
600 struct device_node *rtas;
601 unsigned int *p;
602
603 rtas = find_devices("rtas");
604 if (rtas != NULL) {
605 if (get_property(rtas, "display-character", NULL)) {
606 ppc_md.progress = rtas_display_progress;
607 p = (unsigned int *) get_property
608 (rtas, "ibm,display-line-length", NULL);
609 if (p)
610 max_width = *p;
611 } else if (get_property(rtas, "set-indicator", NULL))
612 ppc_md.progress = rtas_indicator_progress;
613 }
614 }
615#ifdef CONFIG_BOOTX_TEXT
616 if (ppc_md.progress == NULL && boot_text_mapped)
617 ppc_md.progress = btext_progress;
618#endif
619
620#ifdef CONFIG_SMP
621 smp_ops = &chrp_smp_ops;
622#endif /* CONFIG_SMP */
623
624 /*
625 * Print the banner, then scroll down so boot progress
626 * can be printed. -- Cort
627 */
628 if (ppc_md.progress) ppc_md.progress("Linux/PPC "UTS_RELEASE"\n", 0x0);
629}
630
631void
632rtas_display_progress(char *s, unsigned short hex)
633{
634 int width;
635 char *os = s;
636
637 if ( call_rtas( "display-character", 1, 1, NULL, '\r' ) )
638 return;
639
640 width = max_width;
641 while ( *os )
642 {
643 if ( (*os == '\n') || (*os == '\r') )
644 width = max_width;
645 else
646 width--;
647 call_rtas( "display-character", 1, 1, NULL, *os++ );
648 /* if we overwrite the screen length */
649 if ( width == 0 )
650 while ( (*os != 0) && (*os != '\n') && (*os != '\r') )
651 os++;
652 }
653
654 /*while ( width-- > 0 )*/
655 call_rtas( "display-character", 1, 1, NULL, ' ' );
656}
657
658void
659rtas_indicator_progress(char *s, unsigned short hex)
660{
661 call_rtas("set-indicator", 3, 1, NULL, 6, 0, hex);
662}
663
664#ifdef CONFIG_BOOTX_TEXT
665void
666btext_progress(char *s, unsigned short hex)
667{
668 prom_print(s);
669 prom_print("\n");
670}
671#endif /* CONFIG_BOOTX_TEXT */
diff --git a/arch/ppc/platforms/chrp_smp.c b/arch/ppc/platforms/chrp_smp.c
deleted file mode 100644
index 97e539557ecb..000000000000
--- a/arch/ppc/platforms/chrp_smp.c
+++ /dev/null
@@ -1,99 +0,0 @@
1/*
2 * Smp support for CHRP machines.
3 *
4 * Written by Cort Dougan (cort@cs.nmt.edu) borrowing a great
5 * deal of code from the sparc and intel versions.
6 *
7 * Copyright (C) 1999 Cort Dougan <cort@cs.nmt.edu>
8 *
9 */
10
11#include <linux/config.h>
12#include <linux/kernel.h>
13#include <linux/sched.h>
14#include <linux/smp.h>
15#include <linux/smp_lock.h>
16#include <linux/interrupt.h>
17#include <linux/kernel_stat.h>
18#include <linux/delay.h>
19#include <linux/init.h>
20#include <linux/spinlock.h>
21
22#include <asm/ptrace.h>
23#include <asm/atomic.h>
24#include <asm/irq.h>
25#include <asm/page.h>
26#include <asm/pgtable.h>
27#include <asm/sections.h>
28#include <asm/io.h>
29#include <asm/prom.h>
30#include <asm/smp.h>
31#include <asm/residual.h>
32#include <asm/time.h>
33#include <asm/open_pic.h>
34#include <asm/machdep.h>
35
36extern unsigned long smp_chrp_cpu_nr;
37
38static int __init
39smp_chrp_probe(void)
40{
41 if (smp_chrp_cpu_nr > 1)
42 openpic_request_IPIs();
43
44 return smp_chrp_cpu_nr;
45}
46
47static void __devinit
48smp_chrp_kick_cpu(int nr)
49{
50 *(unsigned long *)KERNELBASE = nr;
51 asm volatile("dcbf 0,%0"::"r"(KERNELBASE):"memory");
52}
53
54static void __devinit
55smp_chrp_setup_cpu(int cpu_nr)
56{
57 if (OpenPIC_Addr)
58 do_openpic_setup_cpu();
59}
60
61static DEFINE_SPINLOCK(timebase_lock);
62static unsigned int timebase_upper = 0, timebase_lower = 0;
63
64void __devinit
65smp_chrp_give_timebase(void)
66{
67 spin_lock(&timebase_lock);
68 call_rtas("freeze-time-base", 0, 1, NULL);
69 timebase_upper = get_tbu();
70 timebase_lower = get_tbl();
71 spin_unlock(&timebase_lock);
72
73 while (timebase_upper || timebase_lower)
74 barrier();
75 call_rtas("thaw-time-base", 0, 1, NULL);
76}
77
78void __devinit
79smp_chrp_take_timebase(void)
80{
81 while (!(timebase_upper || timebase_lower))
82 barrier();
83 spin_lock(&timebase_lock);
84 set_tb(timebase_upper, timebase_lower);
85 timebase_upper = 0;
86 timebase_lower = 0;
87 spin_unlock(&timebase_lock);
88 printk("CPU %i taken timebase\n", smp_processor_id());
89}
90
91/* CHRP with openpic */
92struct smp_ops_t chrp_smp_ops = {
93 .message_pass = smp_openpic_message_pass,
94 .probe = smp_chrp_probe,
95 .kick_cpu = smp_chrp_kick_cpu,
96 .setup_cpu = smp_chrp_setup_cpu,
97 .give_timebase = smp_chrp_give_timebase,
98 .take_timebase = smp_chrp_take_timebase,
99};
diff --git a/arch/ppc/platforms/chrp_time.c b/arch/ppc/platforms/chrp_time.c
deleted file mode 100644
index 57753a55b580..000000000000
--- a/arch/ppc/platforms/chrp_time.c
+++ /dev/null
@@ -1,253 +0,0 @@
1/*
2 * arch/ppc/platforms/chrp_time.c
3 *
4 * Copyright (C) 1991, 1992, 1995 Linus Torvalds
5 *
6 * Adapted for PowerPC (PReP) by Gary Thomas
7 * Modified by Cort Dougan (cort@cs.nmt.edu).
8 * Copied and modified from arch/i386/kernel/time.c
9 *
10 */
11#include <linux/errno.h>
12#include <linux/sched.h>
13#include <linux/kernel.h>
14#include <linux/param.h>
15#include <linux/string.h>
16#include <linux/mm.h>
17#include <linux/interrupt.h>
18#include <linux/time.h>
19#include <linux/timex.h>
20#include <linux/kernel_stat.h>
21#include <linux/mc146818rtc.h>
22#include <linux/init.h>
23#include <linux/bcd.h>
24
25#include <asm/io.h>
26#include <asm/nvram.h>
27#include <asm/prom.h>
28#include <asm/sections.h>
29#include <asm/time.h>
30
31extern spinlock_t rtc_lock;
32
33static int nvram_as1 = NVRAM_AS1;
34static int nvram_as0 = NVRAM_AS0;
35static int nvram_data = NVRAM_DATA;
36
37long __init chrp_time_init(void)
38{
39 struct device_node *rtcs;
40 int base;
41
42 rtcs = find_compatible_devices("rtc", "pnpPNP,b00");
43 if (rtcs == NULL)
44 rtcs = find_compatible_devices("rtc", "ds1385-rtc");
45 if (rtcs == NULL || rtcs->addrs == NULL)
46 return 0;
47 base = rtcs->addrs[0].address;
48 nvram_as1 = 0;
49 nvram_as0 = base;
50 nvram_data = base + 1;
51
52 return 0;
53}
54
55int chrp_cmos_clock_read(int addr)
56{
57 if (nvram_as1 != 0)
58 outb(addr>>8, nvram_as1);
59 outb(addr, nvram_as0);
60 return (inb(nvram_data));
61}
62
63void chrp_cmos_clock_write(unsigned long val, int addr)
64{
65 if (nvram_as1 != 0)
66 outb(addr>>8, nvram_as1);
67 outb(addr, nvram_as0);
68 outb(val, nvram_data);
69 return;
70}
71
72/*
73 * Set the hardware clock. -- Cort
74 */
75int chrp_set_rtc_time(unsigned long nowtime)
76{
77 unsigned char save_control, save_freq_select;
78 struct rtc_time tm;
79
80 spin_lock(&rtc_lock);
81 to_tm(nowtime, &tm);
82
83 save_control = chrp_cmos_clock_read(RTC_CONTROL); /* tell the clock it's being set */
84
85 chrp_cmos_clock_write((save_control|RTC_SET), RTC_CONTROL);
86
87 save_freq_select = chrp_cmos_clock_read(RTC_FREQ_SELECT); /* stop and reset prescaler */
88
89 chrp_cmos_clock_write((save_freq_select|RTC_DIV_RESET2), RTC_FREQ_SELECT);
90
91 tm.tm_year -= 1900;
92 if (!(save_control & RTC_DM_BINARY) || RTC_ALWAYS_BCD) {
93 BIN_TO_BCD(tm.tm_sec);
94 BIN_TO_BCD(tm.tm_min);
95 BIN_TO_BCD(tm.tm_hour);
96 BIN_TO_BCD(tm.tm_mon);
97 BIN_TO_BCD(tm.tm_mday);
98 BIN_TO_BCD(tm.tm_year);
99 }
100 chrp_cmos_clock_write(tm.tm_sec,RTC_SECONDS);
101 chrp_cmos_clock_write(tm.tm_min,RTC_MINUTES);
102 chrp_cmos_clock_write(tm.tm_hour,RTC_HOURS);
103 chrp_cmos_clock_write(tm.tm_mon,RTC_MONTH);
104 chrp_cmos_clock_write(tm.tm_mday,RTC_DAY_OF_MONTH);
105 chrp_cmos_clock_write(tm.tm_year,RTC_YEAR);
106
107 /* The following flags have to be released exactly in this order,
108 * otherwise the DS12887 (popular MC146818A clone with integrated
109 * battery and quartz) will not reset the oscillator and will not
110 * update precisely 500 ms later. You won't find this mentioned in
111 * the Dallas Semiconductor data sheets, but who believes data
112 * sheets anyway ... -- Markus Kuhn
113 */
114 chrp_cmos_clock_write(save_control, RTC_CONTROL);
115 chrp_cmos_clock_write(save_freq_select, RTC_FREQ_SELECT);
116
117 spin_unlock(&rtc_lock);
118 return 0;
119}
120
121unsigned long chrp_get_rtc_time(void)
122{
123 unsigned int year, mon, day, hour, min, sec;
124 int uip, i;
125
126 /* The Linux interpretation of the CMOS clock register contents:
127 * When the Update-In-Progress (UIP) flag goes from 1 to 0, the
128 * RTC registers show the second which has precisely just started.
129 * Let's hope other operating systems interpret the RTC the same way.
130 */
131
132 /* Since the UIP flag is set for about 2.2 ms and the clock
133 * is typically written with a precision of 1 jiffy, trying
134 * to obtain a precision better than a few milliseconds is
135 * an illusion. Only consistency is interesting, this also
136 * allows to use the routine for /dev/rtc without a potential
137 * 1 second kernel busy loop triggered by any reader of /dev/rtc.
138 */
139
140 for ( i = 0; i<1000000; i++) {
141 uip = chrp_cmos_clock_read(RTC_FREQ_SELECT);
142 sec = chrp_cmos_clock_read(RTC_SECONDS);
143 min = chrp_cmos_clock_read(RTC_MINUTES);
144 hour = chrp_cmos_clock_read(RTC_HOURS);
145 day = chrp_cmos_clock_read(RTC_DAY_OF_MONTH);
146 mon = chrp_cmos_clock_read(RTC_MONTH);
147 year = chrp_cmos_clock_read(RTC_YEAR);
148 uip |= chrp_cmos_clock_read(RTC_FREQ_SELECT);
149 if ((uip & RTC_UIP)==0) break;
150 }
151
152 if (!(chrp_cmos_clock_read(RTC_CONTROL) & RTC_DM_BINARY) || RTC_ALWAYS_BCD)
153 {
154 BCD_TO_BIN(sec);
155 BCD_TO_BIN(min);
156 BCD_TO_BIN(hour);
157 BCD_TO_BIN(day);
158 BCD_TO_BIN(mon);
159 BCD_TO_BIN(year);
160 }
161 if ((year += 1900) < 1970)
162 year += 100;
163 return mktime(year, mon, day, hour, min, sec);
164}
165
166/*
167 * Calibrate the decrementer frequency with the VIA timer 1.
168 */
169#define VIA_TIMER_FREQ_6 4700000 /* time 1 frequency * 6 */
170
171/* VIA registers */
172#define RS 0x200 /* skip between registers */
173#define T1CL (4*RS) /* Timer 1 ctr/latch (low 8 bits) */
174#define T1CH (5*RS) /* Timer 1 counter (high 8 bits) */
175#define T1LL (6*RS) /* Timer 1 latch (low 8 bits) */
176#define T1LH (7*RS) /* Timer 1 latch (high 8 bits) */
177#define ACR (11*RS) /* Auxiliary control register */
178#define IFR (13*RS) /* Interrupt flag register */
179
180/* Bits in ACR */
181#define T1MODE 0xc0 /* Timer 1 mode */
182#define T1MODE_CONT 0x40 /* continuous interrupts */
183
184/* Bits in IFR and IER */
185#define T1_INT 0x40 /* Timer 1 interrupt */
186
187static int __init chrp_via_calibrate_decr(void)
188{
189 struct device_node *vias;
190 volatile unsigned char __iomem *via;
191 int count = VIA_TIMER_FREQ_6 / 100;
192 unsigned int dstart, dend;
193
194 vias = find_devices("via-cuda");
195 if (vias == 0)
196 vias = find_devices("via");
197 if (vias == 0 || vias->n_addrs == 0)
198 return 0;
199 via = ioremap(vias->addrs[0].address, vias->addrs[0].size);
200
201 /* set timer 1 for continuous interrupts */
202 out_8(&via[ACR], (via[ACR] & ~T1MODE) | T1MODE_CONT);
203 /* set the counter to a small value */
204 out_8(&via[T1CH], 2);
205 /* set the latch to `count' */
206 out_8(&via[T1LL], count);
207 out_8(&via[T1LH], count >> 8);
208 /* wait until it hits 0 */
209 while ((in_8(&via[IFR]) & T1_INT) == 0)
210 ;
211 dstart = get_dec();
212 /* clear the interrupt & wait until it hits 0 again */
213 in_8(&via[T1CL]);
214 while ((in_8(&via[IFR]) & T1_INT) == 0)
215 ;
216 dend = get_dec();
217
218 tb_ticks_per_jiffy = (dstart - dend) / ((6 * HZ)/100);
219 tb_to_us = mulhwu_scale_factor(dstart - dend, 60000);
220
221 printk(KERN_INFO "via_calibrate_decr: ticks per jiffy = %u (%u ticks)\n",
222 tb_ticks_per_jiffy, dstart - dend);
223
224 iounmap(via);
225
226 return 1;
227}
228
229void __init chrp_calibrate_decr(void)
230{
231 struct device_node *cpu;
232 unsigned int freq, *fp;
233
234 if (chrp_via_calibrate_decr())
235 return;
236
237 /*
238 * The cpu node should have a timebase-frequency property
239 * to tell us the rate at which the decrementer counts.
240 */
241 freq = 16666000; /* hardcoded default */
242 cpu = find_type_devices("cpu");
243 if (cpu != 0) {
244 fp = (unsigned int *)
245 get_property(cpu, "timebase-frequency", NULL);
246 if (fp != 0)
247 freq = *fp;
248 }
249 printk("time_init: decrementer frequency = %u.%.6u MHz\n",
250 freq/1000000, freq%1000000);
251 tb_ticks_per_jiffy = freq / HZ;
252 tb_to_us = mulhwu_scale_factor(freq, 1000000);
253}
diff --git a/arch/ppc/platforms/cpci690.c b/arch/ppc/platforms/cpci690.c
index 6ca7bcac9474..790475c22fd7 100644
--- a/arch/ppc/platforms/cpci690.c
+++ b/arch/ppc/platforms/cpci690.c
@@ -1,6 +1,4 @@
1/* 1/*
2 * arch/ppc/platforms/cpci690.c
3 *
4 * Board setup routines for the Force CPCI690 board. 2 * Board setup routines for the Force CPCI690 board.
5 * 3 *
6 * Author: Mark A. Greer <mgreer@mvista.com> 4 * Author: Mark A. Greer <mgreer@mvista.com>
@@ -290,7 +288,7 @@ cpci690_fixup_mpsc_pdata(struct platform_device *pdev)
290 pdata->brg_clk_freq = cpci690_get_bus_freq(); 288 pdata->brg_clk_freq = cpci690_get_bus_freq();
291} 289}
292 290
293static int __init 291static int
294cpci690_platform_notify(struct device *dev) 292cpci690_platform_notify(struct device *dev)
295{ 293{
296 static struct { 294 static struct {
diff --git a/arch/ppc/platforms/cpci690.h b/arch/ppc/platforms/cpci690.h
index 49584c9cedf3..0fa5a4c31b67 100644
--- a/arch/ppc/platforms/cpci690.h
+++ b/arch/ppc/platforms/cpci690.h
@@ -1,6 +1,4 @@
1/* 1/*
2 * arch/ppc/platforms/cpci690.h
3 *
4 * Definitions for Force CPCI690 2 * Definitions for Force CPCI690
5 * 3 *
6 * Author: Mark A. Greer <mgreer@mvista.com> 4 * Author: Mark A. Greer <mgreer@mvista.com>
diff --git a/arch/ppc/platforms/ev64260.c b/arch/ppc/platforms/ev64260.c
index ffde8f6f6302..31e8e21e1d5c 100644
--- a/arch/ppc/platforms/ev64260.c
+++ b/arch/ppc/platforms/ev64260.c
@@ -1,6 +1,4 @@
1/* 1/*
2 * arch/ppc/platforms/ev64260.c
3 *
4 * Board setup routines for the Marvell/Galileo EV-64260-BP Evaluation Board. 2 * Board setup routines for the Marvell/Galileo EV-64260-BP Evaluation Board.
5 * 3 *
6 * Author: Mark A. Greer <mgreer@mvista.com> 4 * Author: Mark A. Greer <mgreer@mvista.com>
@@ -416,7 +414,7 @@ ev64260_fixup_mpsc_pdata(struct platform_device *pdev)
416 return; 414 return;
417} 415}
418 416
419static int __init 417static int
420ev64260_platform_notify(struct device *dev) 418ev64260_platform_notify(struct device *dev)
421{ 419{
422 static struct { 420 static struct {
diff --git a/arch/ppc/platforms/ev64260.h b/arch/ppc/platforms/ev64260.h
index bedffced3a02..44d90d56745a 100644
--- a/arch/ppc/platforms/ev64260.h
+++ b/arch/ppc/platforms/ev64260.h
@@ -1,6 +1,4 @@
1/* 1/*
2 * arch/ppc/platforms/ev64260.h
3 *
4 * Definitions for Marvell/Galileo EV-64260-BP Evaluation Board. 2 * Definitions for Marvell/Galileo EV-64260-BP Evaluation Board.
5 * 3 *
6 * Author: Mark A. Greer <mgreer@mvista.com> 4 * Author: Mark A. Greer <mgreer@mvista.com>
diff --git a/arch/ppc/platforms/ev64360.c b/arch/ppc/platforms/ev64360.c
index b9d844f88c2b..104ac9b16e8b 100644
--- a/arch/ppc/platforms/ev64360.c
+++ b/arch/ppc/platforms/ev64360.c
@@ -1,6 +1,4 @@
1/* 1/*
2 * arch/ppc/platforms/ev64360.c
3 *
4 * Board setup routines for the Marvell EV-64360-BP Evaluation Board. 2 * Board setup routines for the Marvell EV-64360-BP Evaluation Board.
5 * 3 *
6 * Author: Lee Nicks <allinux@gmail.com> 4 * Author: Lee Nicks <allinux@gmail.com>
@@ -300,7 +298,7 @@ ev64360_fixup_eth_pdata(struct platform_device *pdev)
300} 298}
301#endif 299#endif
302 300
303static int __init 301static int
304ev64360_platform_notify(struct device *dev) 302ev64360_platform_notify(struct device *dev)
305{ 303{
306 static struct { 304 static struct {
diff --git a/arch/ppc/platforms/ev64360.h b/arch/ppc/platforms/ev64360.h
index 68eabe490397..b30f4722690a 100644
--- a/arch/ppc/platforms/ev64360.h
+++ b/arch/ppc/platforms/ev64360.h
@@ -1,6 +1,4 @@
1/* 1/*
2 * arch/ppc/platforms/ev64360.h
3 *
4 * Definitions for Marvell EV-64360-BP Evaluation Board. 2 * Definitions for Marvell EV-64360-BP Evaluation Board.
5 * 3 *
6 * Author: Lee Nicks <allinux@gmail.com> 4 * Author: Lee Nicks <allinux@gmail.com>
diff --git a/arch/ppc/platforms/fads.h b/arch/ppc/platforms/fads.h
index a48fb8d723e4..e1c0b1b6dcb3 100644
--- a/arch/ppc/platforms/fads.h
+++ b/arch/ppc/platforms/fads.h
@@ -112,7 +112,7 @@
112 112
113/* CPM Ethernet through SCC1 or SCC2 */ 113/* CPM Ethernet through SCC1 or SCC2 */
114 114
115#ifdef CONFIG_SCC1_ENET /* Probably 860 variant */ 115#if defined(CONFIG_SCC1_ENET) || defined(CONFIG_MPC8xx_SECOND_ETH_SCC1) /* Probably 860 variant */
116/* Bits in parallel I/O port registers that have to be set/cleared 116/* Bits in parallel I/O port registers that have to be set/cleared
117 * to configure the pins for SCC1 use. 117 * to configure the pins for SCC1 use.
118 * TCLK - CLK1, RCLK - CLK2. 118 * TCLK - CLK1, RCLK - CLK2.
diff --git a/arch/ppc/platforms/gemini.h b/arch/ppc/platforms/gemini.h
index 06de59248918..5528fd0a1216 100644
--- a/arch/ppc/platforms/gemini.h
+++ b/arch/ppc/platforms/gemini.h
@@ -1,7 +1,4 @@
1/* 1/*
2 * arch/ppc/platforms/gemini.h
3 *
4 *
5 * Onboard registers and descriptions for Synergy Microsystems' 2 * Onboard registers and descriptions for Synergy Microsystems'
6 * "Gemini" boards. 3 * "Gemini" boards.
7 * 4 *
diff --git a/arch/ppc/platforms/gemini_prom.S b/arch/ppc/platforms/gemini_prom.S
index 8c5065d56505..b181f2108001 100644
--- a/arch/ppc/platforms/gemini_prom.S
+++ b/arch/ppc/platforms/gemini_prom.S
@@ -1,6 +1,4 @@
1/* 1/*
2 * arch/ppc/platforms/gemini_prom.S
3 *
4 * Not really prom support code (yet), but sort of anti-prom code. The current 2 * Not really prom support code (yet), but sort of anti-prom code. The current
5 * bootloader does a number of things it shouldn't and doesn't do things that it 3 * bootloader does a number of things it shouldn't and doesn't do things that it
6 * should. The stuff in here is mainly a hodge-podge collection of setup code 4 * should. The stuff in here is mainly a hodge-podge collection of setup code
diff --git a/arch/ppc/platforms/gemini_setup.c b/arch/ppc/platforms/gemini_setup.c
index 729897c59033..0090ff154608 100644
--- a/arch/ppc/platforms/gemini_setup.c
+++ b/arch/ppc/platforms/gemini_setup.c
@@ -1,6 +1,4 @@
1/* 1/*
2 * arch/ppc/platforms/gemini_setup.c
3 *
4 * Copyright (C) 1995 Linus Torvalds 2 * Copyright (C) 1995 Linus Torvalds
5 * Adapted from 'alpha' version by Gary Thomas 3 * Adapted from 'alpha' version by Gary Thomas
6 * Modified by Cort Dougan (cort@cs.nmt.edu) 4 * Modified by Cort Dougan (cort@cs.nmt.edu)
diff --git a/arch/ppc/platforms/hdpu.c b/arch/ppc/platforms/hdpu.c
index 50039a204c24..75dc2ee87d2f 100644
--- a/arch/ppc/platforms/hdpu.c
+++ b/arch/ppc/platforms/hdpu.c
@@ -1,7 +1,4 @@
1
2/* 1/*
3 * arch/ppc/platforms/hdpu_setup.c
4 *
5 * Board setup routines for the Sky Computers HDPU Compute Blade. 2 * Board setup routines for the Sky Computers HDPU Compute Blade.
6 * 3 *
7 * Written by Brian Waite <waite@skycomputers.com> 4 * Written by Brian Waite <waite@skycomputers.com>
@@ -319,11 +316,10 @@ static void __init hdpu_fixup_eth_pdata(struct platform_device *pd)
319 struct mv643xx_eth_platform_data *eth_pd; 316 struct mv643xx_eth_platform_data *eth_pd;
320 eth_pd = pd->dev.platform_data; 317 eth_pd = pd->dev.platform_data;
321 318
322 eth_pd->port_serial_control =
323 mv64x60_read(&bh, MV643XX_ETH_PORT_SERIAL_CONTROL_REG(pd->id) & ~1);
324
325 eth_pd->force_phy_addr = 1; 319 eth_pd->force_phy_addr = 1;
326 eth_pd->phy_addr = pd->id; 320 eth_pd->phy_addr = pd->id;
321 eth_pd->speed = SPEED_100;
322 eth_pd->duplex = DUPLEX_FULL;
327 eth_pd->tx_queue_size = 400; 323 eth_pd->tx_queue_size = 400;
328 eth_pd->rx_queue_size = 800; 324 eth_pd->rx_queue_size = 800;
329} 325}
@@ -354,7 +350,7 @@ static void __init hdpu_fixup_cpustate_pdata(struct platform_device *pd)
354} 350}
355#endif 351#endif
356 352
357static int __init hdpu_platform_notify(struct device *dev) 353static int hdpu_platform_notify(struct device *dev)
358{ 354{
359 static struct { 355 static struct {
360 char *bus_id; 356 char *bus_id;
diff --git a/arch/ppc/platforms/hdpu.h b/arch/ppc/platforms/hdpu.h
index 07c3cffb5c7b..f9e020b6970c 100644
--- a/arch/ppc/platforms/hdpu.h
+++ b/arch/ppc/platforms/hdpu.h
@@ -1,6 +1,4 @@
1/* 1/*
2 * arch/ppc/platforms/hdpu.h
3 *
4 * Definitions for Sky Computers HDPU board. 2 * Definitions for Sky Computers HDPU board.
5 * 3 *
6 * Brian Waite <waite@skycomputers.com> 4 * Brian Waite <waite@skycomputers.com>
diff --git a/arch/ppc/platforms/katana.c b/arch/ppc/platforms/katana.c
index 6e58e30ceed1..ad21280e8920 100644
--- a/arch/ppc/platforms/katana.c
+++ b/arch/ppc/platforms/katana.c
@@ -1,6 +1,4 @@
1/* 1/*
2 * arch/ppc/platforms/katana.c
3 *
4 * Board setup routines for the Artesyn Katana cPCI boards. 2 * Board setup routines for the Artesyn Katana cPCI boards.
5 * 3 *
6 * Author: Tim Montgomery <timm@artesyncp.com> 4 * Author: Tim Montgomery <timm@artesyncp.com>
@@ -598,7 +596,7 @@ katana_fixup_mv64xxx_pdata(struct platform_device *pdev)
598} 596}
599#endif 597#endif
600 598
601static int __init 599static int
602katana_platform_notify(struct device *dev) 600katana_platform_notify(struct device *dev)
603{ 601{
604 static struct { 602 static struct {
@@ -664,12 +662,11 @@ katana_setup_mtd(void)
664 662
665 ptbl_entries = (size >= (64*MB)) ? 6 : 4; 663 ptbl_entries = (size >= (64*MB)) ? 6 : 4;
666 664
667 if ((ptbl = kmalloc(ptbl_entries * sizeof(struct mtd_partition), 665 if ((ptbl = kcalloc(ptbl_entries, sizeof(struct mtd_partition),
668 GFP_KERNEL)) == NULL) { 666 GFP_KERNEL)) == NULL) {
669 printk(KERN_WARNING "Can't alloc MTD partition table\n"); 667 printk(KERN_WARNING "Can't alloc MTD partition table\n");
670 return -ENOMEM; 668 return -ENOMEM;
671 } 669 }
672 memset(ptbl, 0, ptbl_entries * sizeof(struct mtd_partition));
673 670
674 ptbl[0].name = "Monitor"; 671 ptbl[0].name = "Monitor";
675 ptbl[0].size = KATANA_MTD_MONITOR_SIZE; 672 ptbl[0].size = KATANA_MTD_MONITOR_SIZE;
diff --git a/arch/ppc/platforms/katana.h b/arch/ppc/platforms/katana.h
index 597257eff2ec..0a9b036526b1 100644
--- a/arch/ppc/platforms/katana.h
+++ b/arch/ppc/platforms/katana.h
@@ -1,6 +1,4 @@
1/* 1/*
2 * arch/ppc/platforms/katana.h
3 *
4 * Definitions for Artesyn Katana750i/3750 board. 2 * Definitions for Artesyn Katana750i/3750 board.
5 * 3 *
6 * Author: Tim Montgomery <timm@artesyncp.com> 4 * Author: Tim Montgomery <timm@artesyncp.com>
diff --git a/arch/ppc/platforms/lite5200.c b/arch/ppc/platforms/lite5200.c
index 7ed52dc340c9..fecbe9adc9e0 100644
--- a/arch/ppc/platforms/lite5200.c
+++ b/arch/ppc/platforms/lite5200.c
@@ -1,6 +1,4 @@
1/* 1/*
2 * arch/ppc/platforms/lite5200.c
3 *
4 * Platform support file for the Freescale LITE5200 based on MPC52xx. 2 * Platform support file for the Freescale LITE5200 based on MPC52xx.
5 * A maximum of this file should be moved to syslib/mpc52xx_????? 3 * A maximum of this file should be moved to syslib/mpc52xx_?????
6 * so that new platform based on MPC52xx need a minimal platform file 4 * so that new platform based on MPC52xx need a minimal platform file
@@ -36,8 +34,7 @@
36#include <asm/mpc52xx.h> 34#include <asm/mpc52xx.h>
37#include <asm/ppc_sys.h> 35#include <asm/ppc_sys.h>
38#include <asm/machdep.h> 36#include <asm/machdep.h>
39 37#include <asm/pci-bridge.h>
40#include <syslib/mpc52xx_pci.h>
41 38
42 39
43extern int powersave_nap; 40extern int powersave_nap;
@@ -70,44 +67,53 @@ lite5200_show_cpuinfo(struct seq_file *m)
70} 67}
71 68
72#ifdef CONFIG_PCI 69#ifdef CONFIG_PCI
70#ifdef CONFIG_LITE5200B
71static int
72lite5200_map_irq(struct pci_dev *dev, unsigned char idsel,
73 unsigned char pin)
74{
75 static char pci_irq_table[][4] =
76 /*
77 * PCI IDSEL/INTPIN->INTLINE
78 * A B C D
79 */
80 {
81 {MPC52xx_IRQ0, MPC52xx_IRQ1, MPC52xx_IRQ2, MPC52xx_IRQ3},
82 {MPC52xx_IRQ1, MPC52xx_IRQ2, MPC52xx_IRQ3, MPC52xx_IRQ0},
83 };
84
85 const long min_idsel = 24, max_idsel = 25, irqs_per_slot = 4;
86 return PCI_IRQ_TABLE_LOOKUP;
87}
88#else /* Original Lite */
73static int 89static int
74lite5200_map_irq(struct pci_dev *dev, unsigned char idsel, unsigned char pin) 90lite5200_map_irq(struct pci_dev *dev, unsigned char idsel, unsigned char pin)
75{ 91{
76 return (pin == 1) && (idsel==24) ? MPC52xx_IRQ0 : -1; 92 return (pin == 1) && (idsel==24) ? MPC52xx_IRQ0 : -1;
77} 93}
78#endif 94#endif
95#endif
79 96
80static void __init 97static void __init
81lite5200_setup_cpu(void) 98lite5200_setup_cpu(void)
82{ 99{
83 struct mpc52xx_cdm __iomem *cdm;
84 struct mpc52xx_gpio __iomem *gpio; 100 struct mpc52xx_gpio __iomem *gpio;
85 struct mpc52xx_intr __iomem *intr; 101 struct mpc52xx_intr __iomem *intr;
86 struct mpc52xx_xlb __iomem *xlb;
87 102
88 u32 port_config; 103 u32 port_config;
89 u32 intr_ctrl; 104 u32 intr_ctrl;
90 105
91 /* Map zones */ 106 /* Map zones */
92 cdm = ioremap(MPC52xx_PA(MPC52xx_CDM_OFFSET), MPC52xx_CDM_SIZE);
93 gpio = ioremap(MPC52xx_PA(MPC52xx_GPIO_OFFSET), MPC52xx_GPIO_SIZE); 107 gpio = ioremap(MPC52xx_PA(MPC52xx_GPIO_OFFSET), MPC52xx_GPIO_SIZE);
94 xlb = ioremap(MPC52xx_PA(MPC52xx_XLB_OFFSET), MPC52xx_XLB_SIZE);
95 intr = ioremap(MPC52xx_PA(MPC52xx_INTR_OFFSET), MPC52xx_INTR_SIZE); 108 intr = ioremap(MPC52xx_PA(MPC52xx_INTR_OFFSET), MPC52xx_INTR_SIZE);
96 109
97 if (!cdm || !gpio || !xlb || !intr) { 110 if (!gpio || !intr) {
98 printk("lite5200.c: Error while mapping CDM/GPIO/XLB/INTR during" 111 printk(KERN_ERR __FILE__ ": "
99 "lite5200_setup_cpu\n"); 112 "Error while mapping GPIO/INTR during "
113 "lite5200_setup_cpu\n");
100 goto unmap_regs; 114 goto unmap_regs;
101 } 115 }
102 116
103 /* Use internal 48 Mhz */
104 out_8(&cdm->ext_48mhz_en, 0x00);
105 out_8(&cdm->fd_enable, 0x01);
106 if (in_be32(&cdm->rstcfg) & 0x40) /* Assumes 33Mhz clock */
107 out_be16(&cdm->fd_counters, 0x0001);
108 else
109 out_be16(&cdm->fd_counters, 0x5555);
110
111 /* Get port mux config */ 117 /* Get port mux config */
112 port_config = in_be32(&gpio->port_config); 118 port_config = in_be32(&gpio->port_config);
113 119
@@ -118,29 +124,29 @@ lite5200_setup_cpu(void)
118 port_config &= ~0x00007000; /* Differential mode - USB1 only */ 124 port_config &= ~0x00007000; /* Differential mode - USB1 only */
119 port_config |= 0x00001000; 125 port_config |= 0x00001000;
120 126
127 /* ATA CS is on csb_4/5 */
128 port_config &= ~0x03000000;
129 port_config |= 0x01000000;
130
121 /* Commit port config */ 131 /* Commit port config */
122 out_be32(&gpio->port_config, port_config); 132 out_be32(&gpio->port_config, port_config);
123 133
124 /* Configure the XLB Arbiter */ 134 /* IRQ[0-3] setup */
125 out_be32(&xlb->master_pri_enable, 0xff);
126 out_be32(&xlb->master_priority, 0x11111111);
127
128 /* Enable ram snooping for 1GB window */
129 out_be32(&xlb->config, in_be32(&xlb->config) | MPC52xx_XLB_CFG_SNOOP);
130 out_be32(&xlb->snoop_window, MPC52xx_PCI_TARGET_MEM | 0x1d);
131
132 /* IRQ[0-3] setup : IRQ0 - Level Active Low */
133 /* IRQ[1-3] - Level Active High */
134 intr_ctrl = in_be32(&intr->ctrl); 135 intr_ctrl = in_be32(&intr->ctrl);
135 intr_ctrl &= ~0x00ff0000; 136 intr_ctrl &= ~0x00ff0000;
136 intr_ctrl |= 0x00c00000; 137#ifdef CONFIG_LITE5200B
138 /* IRQ[0-3] Level Active Low */
139 intr_ctrl |= 0x00ff0000;
140#else
141 /* IRQ0 Level Active Low
142 * IRQ[1-3] Level Active High */
143 intr_ctrl |= 0x00c00000;
144#endif
137 out_be32(&intr->ctrl, intr_ctrl); 145 out_be32(&intr->ctrl, intr_ctrl);
138 146
139 /* Unmap reg zone */ 147 /* Unmap reg zone */
140unmap_regs: 148unmap_regs:
141 if (cdm) iounmap(cdm);
142 if (gpio) iounmap(gpio); 149 if (gpio) iounmap(gpio);
143 if (xlb) iounmap(xlb);
144 if (intr) iounmap(intr); 150 if (intr) iounmap(intr);
145} 151}
146 152
@@ -148,7 +154,8 @@ static void __init
148lite5200_setup_arch(void) 154lite5200_setup_arch(void)
149{ 155{
150 /* CPU & Port mux setup */ 156 /* CPU & Port mux setup */
151 lite5200_setup_cpu(); 157 mpc52xx_setup_cpu(); /* Generic */
158 lite5200_setup_cpu(); /* Platform specific */
152 159
153#ifdef CONFIG_PCI 160#ifdef CONFIG_PCI
154 /* PCI Bridge setup */ 161 /* PCI Bridge setup */
diff --git a/arch/ppc/platforms/lite5200.h b/arch/ppc/platforms/lite5200.h
index c1de2aa47175..852a18e24d0b 100644
--- a/arch/ppc/platforms/lite5200.h
+++ b/arch/ppc/platforms/lite5200.h
@@ -1,6 +1,4 @@
1/* 1/*
2 * arch/ppc/platforms/lite5200.h
3 *
4 * Definitions for Freescale LITE5200 : MPC52xx Standard Development 2 * Definitions for Freescale LITE5200 : MPC52xx Standard Development
5 * Platform board support 3 * Platform board support
6 * 4 *
diff --git a/arch/ppc/platforms/lopec.c b/arch/ppc/platforms/lopec.c
index 06d247c23b82..c6445a727ca3 100644
--- a/arch/ppc/platforms/lopec.c
+++ b/arch/ppc/platforms/lopec.c
@@ -1,6 +1,4 @@
1/* 1/*
2 * arch/ppc/platforms/lopec.c
3 *
4 * Setup routines for the Motorola LoPEC. 2 * Setup routines for the Motorola LoPEC.
5 * 3 *
6 * Author: Dan Cox 4 * Author: Dan Cox
diff --git a/arch/ppc/platforms/mpc8272ads_setup.c b/arch/ppc/platforms/mpc8272ads_setup.c
new file mode 100644
index 000000000000..bc9b94f77e39
--- /dev/null
+++ b/arch/ppc/platforms/mpc8272ads_setup.c
@@ -0,0 +1,236 @@
1/*
2 * arch/ppc/platforms/82xx/pq2ads_pd.c
3 *
4 * MPC82xx Board-specific PlatformDevice descriptions
5 *
6 * 2005 (c) MontaVista Software, Inc.
7 * Vitaly Bordug <vbordug@ru.mvista.com>
8 *
9 * This file is licensed under the terms of the GNU General Public License
10 * version 2. This program is licensed "as is" without any warranty of any
11 * kind, whether express or implied.
12 */
13
14
15#include <linux/init.h>
16#include <linux/module.h>
17#include <linux/device.h>
18#include <linux/ioport.h>
19#include <linux/fs_enet_pd.h>
20#include <linux/platform_device.h>
21
22#include <asm/io.h>
23#include <asm/mpc8260.h>
24#include <asm/cpm2.h>
25#include <asm/immap_cpm2.h>
26#include <asm/irq.h>
27#include <asm/ppc_sys.h>
28#include <asm/ppcboot.h>
29
30#include "pq2ads_pd.h"
31
32static void init_fcc1_ioports(void);
33static void init_fcc2_ioports(void);
34
35static struct fs_mii_bus_info mii_bus_info = {
36 .method = fsmii_bitbang,
37 .id = 0,
38 .i.bitbang = {
39 .mdio_port = fsiop_portc,
40 .mdio_bit = 18,
41 .mdc_port = fsiop_portc,
42 .mdc_bit = 19,
43 .delay = 1,
44 },
45};
46
47static struct fs_platform_info mpc82xx_fcc1_pdata = {
48 .fs_no = fsid_fcc1,
49 .cp_page = CPM_CR_FCC1_PAGE,
50 .cp_block = CPM_CR_FCC1_SBLOCK,
51 .clk_trx = (PC_F1RXCLK | PC_F1TXCLK),
52 .clk_route = CMX1_CLK_ROUTE,
53 .clk_mask = CMX1_CLK_MASK,
54 .init_ioports = init_fcc1_ioports,
55
56 .phy_addr = 0,
57#ifdef PHY_INTERRUPT
58 .phy_irq = PHY_INTERRUPT,
59#else
60 .phy_irq = -1;
61#endif
62 .mem_offset = FCC1_MEM_OFFSET,
63 .bus_info = &mii_bus_info,
64 .rx_ring = 32,
65 .tx_ring = 32,
66 .rx_copybreak = 240,
67 .use_napi = 0,
68 .napi_weight = 17,
69};
70
71static struct fs_platform_info mpc82xx_fcc2_pdata = {
72 .fs_no = fsid_fcc2,
73 .cp_page = CPM_CR_FCC2_PAGE,
74 .cp_block = CPM_CR_FCC2_SBLOCK,
75 .clk_trx = (PC_F2RXCLK | PC_F2TXCLK),
76 .clk_route = CMX2_CLK_ROUTE,
77 .clk_mask = CMX2_CLK_MASK,
78 .init_ioports = init_fcc2_ioports,
79
80 .phy_addr = 3,
81#ifdef PHY_INTERRUPT
82 .phy_irq = PHY_INTERRUPT,
83#else
84 .phy_irq = -1;
85#endif
86 .mem_offset = FCC2_MEM_OFFSET,
87 .bus_info = &mii_bus_info,
88 .rx_ring = 32,
89 .tx_ring = 32,
90 .rx_copybreak = 240,
91 .use_napi = 0,
92 .napi_weight = 17,
93};
94
95static void init_fcc1_ioports(void)
96{
97 struct io_port *io;
98 u32 tempval;
99 cpm2_map_t* immap = ioremap(CPM_MAP_ADDR, sizeof(cpm2_map_t));
100 u32 *bcsr = ioremap(BCSR_ADDR+4, sizeof(u32));
101
102 io = &immap->im_ioport;
103
104 /* Enable the PHY */
105 clrbits32(bcsr, BCSR1_FETHIEN);
106 setbits32(bcsr, BCSR1_FETH_RST);
107
108 /* FCC1 pins are on port A/C. */
109 /* Configure port A and C pins for FCC1 Ethernet. */
110
111 tempval = in_be32(&io->iop_pdira);
112 tempval &= ~PA1_DIRA0;
113 tempval |= PA1_DIRA1;
114 out_be32(&io->iop_pdira, tempval);
115
116 tempval = in_be32(&io->iop_psora);
117 tempval &= ~PA1_PSORA0;
118 tempval |= PA1_PSORA1;
119 out_be32(&io->iop_psora, tempval);
120
121 setbits32(&io->iop_ppara,PA1_DIRA0 | PA1_DIRA1);
122
123 /* Alter clocks */
124 tempval = PC_F1TXCLK|PC_F1RXCLK;
125
126 clrbits32(&io->iop_psorc, tempval);
127 clrbits32(&io->iop_pdirc, tempval);
128 setbits32(&io->iop_pparc, tempval);
129
130 clrbits32(&immap->im_cpmux.cmx_fcr, CMX1_CLK_MASK);
131 setbits32(&immap->im_cpmux.cmx_fcr, CMX1_CLK_ROUTE);
132 iounmap(bcsr);
133 iounmap(immap);
134}
135
136static void init_fcc2_ioports(void)
137{
138 cpm2_map_t* immap = ioremap(CPM_MAP_ADDR, sizeof(cpm2_map_t));
139 u32 *bcsr = ioremap(BCSR_ADDR+12, sizeof(u32));
140
141 struct io_port *io;
142 u32 tempval;
143
144 immap = cpm2_immr;
145
146 io = &immap->im_ioport;
147
148 /* Enable the PHY */
149 clrbits32(bcsr, BCSR3_FETHIEN2);
150 setbits32(bcsr, BCSR3_FETH2_RST);
151
152 /* FCC2 are port B/C. */
153 /* Configure port A and C pins for FCC2 Ethernet. */
154
155 tempval = in_be32(&io->iop_pdirb);
156 tempval &= ~PB2_DIRB0;
157 tempval |= PB2_DIRB1;
158 out_be32(&io->iop_pdirb, tempval);
159
160 tempval = in_be32(&io->iop_psorb);
161 tempval &= ~PB2_PSORB0;
162 tempval |= PB2_PSORB1;
163 out_be32(&io->iop_psorb, tempval);
164
165 setbits32(&io->iop_pparb,PB2_DIRB0 | PB2_DIRB1);
166
167 tempval = PC_F2RXCLK|PC_F2TXCLK;
168
169 /* Alter clocks */
170 clrbits32(&io->iop_psorc,tempval);
171 clrbits32(&io->iop_pdirc,tempval);
172 setbits32(&io->iop_pparc,tempval);
173
174 clrbits32(&immap->im_cpmux.cmx_fcr, CMX2_CLK_MASK);
175 setbits32(&immap->im_cpmux.cmx_fcr, CMX2_CLK_ROUTE);
176
177 iounmap(bcsr);
178 iounmap(immap);
179}
180
181
182static void __init mpc8272ads_fixup_enet_pdata(struct platform_device *pdev,
183 int idx)
184{
185 bd_t* bi = (void*)__res;
186 int fs_no = fsid_fcc1+pdev->id-1;
187
188 mpc82xx_fcc1_pdata.dpram_offset = mpc82xx_fcc2_pdata.dpram_offset = (u32)cpm2_immr->im_dprambase;
189 mpc82xx_fcc1_pdata.fcc_regs_c = mpc82xx_fcc2_pdata.fcc_regs_c = (u32)cpm2_immr->im_fcc_c;
190
191 switch(fs_no) {
192 case fsid_fcc1:
193 memcpy(&mpc82xx_fcc1_pdata.macaddr,bi->bi_enetaddr,6);
194 pdev->dev.platform_data = &mpc82xx_fcc1_pdata;
195 break;
196 case fsid_fcc2:
197 memcpy(&mpc82xx_fcc2_pdata.macaddr,bi->bi_enetaddr,6);
198 mpc82xx_fcc2_pdata.macaddr[5] ^= 1;
199 pdev->dev.platform_data = &mpc82xx_fcc2_pdata;
200 break;
201 }
202}
203
204static int mpc8272ads_platform_notify(struct device *dev)
205{
206 static const struct platform_notify_dev_map dev_map[] = {
207 {
208 .bus_id = "fsl-cpm-fcc",
209 .rtn = mpc8272ads_fixup_enet_pdata
210 },
211 {
212 .bus_id = NULL
213 }
214 };
215 platform_notify_map(dev_map,dev);
216
217 return 0;
218
219}
220
221int __init mpc8272ads_init(void)
222{
223 printk(KERN_NOTICE "mpc8272ads: Init\n");
224
225 platform_notify = mpc8272ads_platform_notify;
226
227 ppc_sys_device_initfunc();
228
229 ppc_sys_device_disable_all();
230 ppc_sys_device_enable(MPC82xx_CPM_FCC1);
231 ppc_sys_device_enable(MPC82xx_CPM_FCC2);
232
233 return 0;
234}
235
236arch_initcall(mpc8272ads_init);
diff --git a/arch/ppc/platforms/mpc866ads_setup.c b/arch/ppc/platforms/mpc866ads_setup.c
new file mode 100644
index 000000000000..ac8fcc68afeb
--- /dev/null
+++ b/arch/ppc/platforms/mpc866ads_setup.c
@@ -0,0 +1,273 @@
1/*arch/ppc/platforms/mpc885ads-setup.c
2 *
3 * Platform setup for the Freescale mpc885ads board
4 *
5 * Vitaly Bordug <vbordug@ru.mvista.com>
6 *
7 * Copyright 2005 MontaVista Software Inc.
8 *
9 * This file is licensed under the terms of the GNU General Public License
10 * version 2. This program is licensed "as is" without any warranty of any
11 * kind, whether express or implied.
12 */
13
14#include <linux/config.h>
15#include <linux/init.h>
16#include <linux/module.h>
17#include <linux/param.h>
18#include <linux/string.h>
19#include <linux/ioport.h>
20#include <linux/device.h>
21
22#include <linux/fs_enet_pd.h>
23#include <linux/mii.h>
24
25#include <asm/delay.h>
26#include <asm/io.h>
27#include <asm/machdep.h>
28#include <asm/page.h>
29#include <asm/processor.h>
30#include <asm/system.h>
31#include <asm/time.h>
32#include <asm/ppcboot.h>
33#include <asm/8xx_immap.h>
34#include <asm/commproc.h>
35#include <asm/ppc_sys.h>
36#include <asm/mpc8xx.h>
37
38extern unsigned char __res[];
39
40static struct fs_mii_bus_info fec_mii_bus_info = {
41 .method = fsmii_fec,
42 .id = 0,
43};
44
45static struct fs_mii_bus_info scc_mii_bus_info = {
46 .method = fsmii_fixed,
47 .id = 0,
48 .i.fixed.speed = 10,
49 .i.fixed.duplex = 0,
50};
51
52static struct fs_platform_info mpc8xx_fec_pdata[] = {
53 {
54 .rx_ring = 128,
55 .tx_ring = 16,
56 .rx_copybreak = 240,
57
58 .use_napi = 1,
59 .napi_weight = 17,
60
61 .phy_addr = 15,
62 .phy_irq = -1,
63
64 .use_rmii = 0,
65
66 .bus_info = &fec_mii_bus_info,
67 }
68};
69
70static struct fs_platform_info mpc8xx_scc_pdata = {
71 .rx_ring = 64,
72 .tx_ring = 8,
73 .rx_copybreak = 240,
74
75 .use_napi = 1,
76 .napi_weight = 17,
77
78 .phy_addr = -1,
79 .phy_irq = -1,
80
81 .bus_info = &scc_mii_bus_info,
82};
83
84void __init board_init(void)
85{
86 volatile cpm8xx_t *cp = cpmp;
87 unsigned *bcsr_io;
88
89 bcsr_io = ioremap(BCSR1, sizeof(unsigned long));
90
91 if (bcsr_io == NULL) {
92 printk(KERN_CRIT "Could not remap BCSR1\n");
93 return;
94 }
95#ifdef CONFIG_SERIAL_CPM_SMC1
96 cp->cp_simode &= ~(0xe0000000 >> 17); /* brg1 */
97 clrbits32(bcsr_io,(0x80000000 >> 7));
98#else
99 setbits32(bcsr_io,(0x80000000 >> 7));
100
101 cp->cp_pbpar &= ~(0x000000c0);
102 cp->cp_pbdir |= 0x000000c0;
103 cp->cp_smc[0].smc_smcmr = 0;
104 cp->cp_smc[0].smc_smce = 0;
105#endif
106
107#ifdef CONFIG_SERIAL_CPM_SMC2
108 cp->cp_simode &= ~(0xe0000000 >> 1);
109 cp->cp_simode |= (0x20000000 >> 1); /* brg2 */
110 clrbits32(bcsr_io,(0x80000000 >> 13));
111#else
112 clrbits32(bcsr_io,(0x80000000 >> 13));
113 cp->cp_pbpar &= ~(0x00000c00);
114 cp->cp_pbdir |= 0x00000c00;
115 cp->cp_smc[1].smc_smcmr = 0;
116 cp->cp_smc[1].smc_smce = 0;
117#endif
118 iounmap(bcsr_io);
119}
120
121static void setup_fec1_ioports(void)
122{
123 immap_t *immap = (immap_t *) IMAP_ADDR;
124
125 setbits16(&immap->im_ioport.iop_pdpar, 0x1fff);
126 setbits16(&immap->im_ioport.iop_pddir, 0x1fff);
127}
128
129static void setup_scc1_ioports(void)
130{
131 immap_t *immap = (immap_t *) IMAP_ADDR;
132 unsigned *bcsr_io;
133
134 bcsr_io = ioremap(BCSR1, sizeof(unsigned long));
135
136 if (bcsr_io == NULL) {
137 printk(KERN_CRIT "Could not remap BCSR1\n");
138 return;
139 }
140
141 /* Enable the PHY.
142 */
143 clrbits32(bcsr_io,BCSR1_ETHEN);
144
145 /* Configure port A pins for Txd and Rxd.
146 */
147 /* Disable receive and transmit in case EPPC-Bug started it.
148 */
149 setbits16(&immap->im_ioport.iop_papar, PA_ENET_RXD | PA_ENET_TXD);
150 clrbits16(&immap->im_ioport.iop_padir, PA_ENET_RXD | PA_ENET_TXD);
151 clrbits16(&immap->im_ioport.iop_paodr, PA_ENET_TXD);
152
153 /* Configure port C pins to enable CLSN and RENA.
154 */
155 clrbits16(&immap->im_ioport.iop_pcpar, PC_ENET_CLSN | PC_ENET_RENA);
156 clrbits16(&immap->im_ioport.iop_pcdir, PC_ENET_CLSN | PC_ENET_RENA);
157 setbits16(&immap->im_ioport.iop_pcso, PC_ENET_CLSN | PC_ENET_RENA);
158 /* Configure port A for TCLK and RCLK.
159 */
160 setbits16(&immap->im_ioport.iop_papar, PA_ENET_TCLK | PA_ENET_RCLK);
161 clrbits16(&immap->im_ioport.iop_padir, PA_ENET_TCLK | PA_ENET_RCLK);
162 clrbits32(&immap->im_cpm.cp_pbpar, PB_ENET_TENA);
163 clrbits32(&immap->im_cpm.cp_pbdir, PB_ENET_TENA);
164
165 /* Configure Serial Interface clock routing.
166 * First, clear all SCC bits to zero, then set the ones we want.
167 */
168 clrbits32(&immap->im_cpm.cp_sicr, SICR_ENET_MASK);
169 setbits32(&immap->im_cpm.cp_sicr, SICR_ENET_CLKRT);
170
171 /* In the original SCC enet driver the following code is placed at
172 the end of the initialization */
173 setbits32(&immap->im_cpm.cp_pbpar, PB_ENET_TENA);
174 setbits32(&immap->im_cpm.cp_pbdir, PB_ENET_TENA);
175
176}
177
178static void mpc866ads_fixup_enet_pdata(struct platform_device *pdev, int fs_no)
179{
180 struct fs_platform_info *fpi = pdev->dev.platform_data;
181
182 volatile cpm8xx_t *cp;
183 bd_t *bd = (bd_t *) __res;
184 char *e;
185 int i;
186
187 /* Get pointer to Communication Processor */
188 cp = cpmp;
189 switch (fs_no) {
190 case fsid_fec1:
191 fpi = &mpc8xx_fec_pdata[0];
192 fpi->init_ioports = &setup_fec1_ioports;
193
194 break;
195 case fsid_scc1:
196 fpi = &mpc8xx_scc_pdata;
197 fpi->init_ioports = &setup_scc1_ioports;
198
199 break;
200 default:
201 printk(KERN_WARNING"Device %s is not supported!\n", pdev->name);
202 return;
203 }
204
205 pdev->dev.platform_data = fpi;
206 fpi->fs_no = fs_no;
207
208 e = (unsigned char *)&bd->bi_enetaddr;
209 for (i = 0; i < 6; i++)
210 fpi->macaddr[i] = *e++;
211
212 fpi->macaddr[5 - pdev->id]++;
213
214}
215
216static void mpc866ads_fixup_fec_enet_pdata(struct platform_device *pdev,
217 int idx)
218{
219 /* This is for FEC devices only */
220 if (!pdev || !pdev->name || (!strstr(pdev->name, "fsl-cpm-fec")))
221 return;
222 mpc866ads_fixup_enet_pdata(pdev, fsid_fec1 + pdev->id - 1);
223}
224
225static void mpc866ads_fixup_scc_enet_pdata(struct platform_device *pdev,
226 int idx)
227{
228 /* This is for SCC devices only */
229 if (!pdev || !pdev->name || (!strstr(pdev->name, "fsl-cpm-scc")))
230 return;
231
232 mpc866ads_fixup_enet_pdata(pdev, fsid_scc1 + pdev->id - 1);
233}
234
235static int mpc866ads_platform_notify(struct device *dev)
236{
237 static const struct platform_notify_dev_map dev_map[] = {
238 {
239 .bus_id = "fsl-cpm-fec",
240 .rtn = mpc866ads_fixup_fec_enet_pdata,
241 },
242 {
243 .bus_id = "fsl-cpm-scc",
244 .rtn = mpc866ads_fixup_scc_enet_pdata,
245 },
246 {
247 .bus_id = NULL
248 }
249 };
250
251 platform_notify_map(dev_map,dev);
252
253 return 0;
254}
255
256int __init mpc866ads_init(void)
257{
258 printk(KERN_NOTICE "mpc866ads: Init\n");
259
260 platform_notify = mpc866ads_platform_notify;
261
262 ppc_sys_device_initfunc();
263 ppc_sys_device_disable_all();
264
265#ifdef MPC8xx_SECOND_ETH_SCC1
266 ppc_sys_device_enable(MPC8xx_CPM_SCC1);
267#endif
268 ppc_sys_device_enable(MPC8xx_CPM_FEC1);
269
270 return 0;
271}
272
273arch_initcall(mpc866ads_init);
diff --git a/arch/ppc/platforms/mpc885ads_setup.c b/arch/ppc/platforms/mpc885ads_setup.c
new file mode 100644
index 000000000000..50a99e5f7c68
--- /dev/null
+++ b/arch/ppc/platforms/mpc885ads_setup.c
@@ -0,0 +1,389 @@
1/*arch/ppc/platforms/mpc885ads-setup.c
2 *
3 * Platform setup for the Freescale mpc885ads board
4 *
5 * Vitaly Bordug <vbordug@ru.mvista.com>
6 *
7 * Copyright 2005 MontaVista Software Inc.
8 *
9 * This file is licensed under the terms of the GNU General Public License
10 * version 2. This program is licensed "as is" without any warranty of any
11 * kind, whether express or implied.
12 */
13
14#include <linux/config.h>
15#include <linux/init.h>
16#include <linux/module.h>
17#include <linux/param.h>
18#include <linux/string.h>
19#include <linux/ioport.h>
20#include <linux/device.h>
21
22#include <linux/fs_enet_pd.h>
23#include <linux/mii.h>
24
25#include <asm/delay.h>
26#include <asm/io.h>
27#include <asm/machdep.h>
28#include <asm/page.h>
29#include <asm/processor.h>
30#include <asm/system.h>
31#include <asm/time.h>
32#include <asm/ppcboot.h>
33#include <asm/8xx_immap.h>
34#include <asm/commproc.h>
35#include <asm/ppc_sys.h>
36
37extern unsigned char __res[];
38
39static void __init mpc885ads_scc_phy_init(char);
40
41static struct fs_mii_bus_info fec_mii_bus_info = {
42 .method = fsmii_fec,
43 .id = 0,
44};
45
46static struct fs_mii_bus_info scc_mii_bus_info = {
47#ifdef CONFIG_SCC_ENET_8xx_FIXED
48 .method = fsmii_fixed,
49#else
50 .method = fsmii_fec,
51#endif
52
53 .id = 0,
54};
55
56static struct fs_platform_info mpc8xx_fec_pdata[] = {
57 {
58 .rx_ring = 128,
59 .tx_ring = 16,
60 .rx_copybreak = 240,
61
62 .use_napi = 1,
63 .napi_weight = 17,
64
65 .phy_addr = 0,
66 .phy_irq = SIU_IRQ7,
67
68 .bus_info = &fec_mii_bus_info,
69 }, {
70 .rx_ring = 128,
71 .tx_ring = 16,
72 .rx_copybreak = 240,
73
74 .use_napi = 1,
75 .napi_weight = 17,
76
77 .phy_addr = 1,
78 .phy_irq = SIU_IRQ7,
79
80 .bus_info = &fec_mii_bus_info,
81 }
82};
83
84static struct fs_platform_info mpc8xx_scc_pdata = {
85 .rx_ring = 64,
86 .tx_ring = 8,
87 .rx_copybreak = 240,
88
89 .use_napi = 1,
90 .napi_weight = 17,
91
92 .phy_addr = 2,
93#ifdef CONFIG_MPC8xx_SCC_ENET_FIXED
94 .phy_irq = -1,
95#else
96 .phy_irq = SIU_IRQ7,
97#endif
98
99 .bus_info = &scc_mii_bus_info,
100};
101
102void __init board_init(void)
103{
104 volatile cpm8xx_t *cp = cpmp;
105 unsigned int *bcsr_io;
106
107#ifdef CONFIG_FS_ENET
108 immap_t *immap = (immap_t *) IMAP_ADDR;
109#endif
110 bcsr_io = ioremap(BCSR1, sizeof(unsigned long));
111
112 if (bcsr_io == NULL) {
113 printk(KERN_CRIT "Could not remap BCSR\n");
114 return;
115 }
116#ifdef CONFIG_SERIAL_CPM_SMC1
117 cp->cp_simode &= ~(0xe0000000 >> 17); /* brg1 */
118 clrbits32(bcsr_io, BCSR1_RS232EN_1);
119#else
120 setbits32(bcsr_io,BCSR1_RS232EN_1);
121 cp->cp_smc[0].smc_smcmr = 0;
122 cp->cp_smc[0].smc_smce = 0;
123#endif
124
125#ifdef CONFIG_SERIAL_CPM_SMC2
126 cp->cp_simode &= ~(0xe0000000 >> 1);
127 cp->cp_simode |= (0x20000000 >> 1); /* brg2 */
128 clrbits32(bcsr_io,BCSR1_RS232EN_2);
129#else
130 setbits32(bcsr_io,BCSR1_RS232EN_2);
131 cp->cp_smc[1].smc_smcmr = 0;
132 cp->cp_smc[1].smc_smce = 0;
133#endif
134 iounmap(bcsr_io);
135
136#ifdef CONFIG_FS_ENET
137 /* use MDC for MII (common) */
138 setbits16(&immap->im_ioport.iop_pdpar, 0x0080);
139 clrbits16(&immap->im_ioport.iop_pddir, 0x0080);
140#endif
141}
142
143static void setup_fec1_ioports(void)
144{
145 immap_t *immap = (immap_t *) IMAP_ADDR;
146
147 /* configure FEC1 pins */
148 setbits16(&immap->im_ioport.iop_papar, 0xf830);
149 setbits16(&immap->im_ioport.iop_padir, 0x0830);
150 clrbits16(&immap->im_ioport.iop_padir, 0xf000);
151 setbits32(&immap->im_cpm.cp_pbpar, 0x00001001);
152
153 clrbits32(&immap->im_cpm.cp_pbdir, 0x00001001);
154 setbits16(&immap->im_ioport.iop_pcpar, 0x000c);
155 clrbits16(&immap->im_ioport.iop_pcdir, 0x000c);
156 setbits32(&immap->im_cpm.cp_pepar, 0x00000003);
157
158 setbits32(&immap->im_cpm.cp_pedir, 0x00000003);
159 clrbits32(&immap->im_cpm.cp_peso, 0x00000003);
160 clrbits32(&immap->im_cpm.cp_cptr, 0x00000100);
161}
162
163static void setup_fec2_ioports(void)
164{
165 immap_t *immap = (immap_t *) IMAP_ADDR;
166
167 /* configure FEC2 pins */
168 setbits32(&immap->im_cpm.cp_pepar, 0x0003fffc);
169 setbits32(&immap->im_cpm.cp_pedir, 0x0003fffc);
170 setbits32(&immap->im_cpm.cp_peso, 0x00037800);
171 clrbits32(&immap->im_cpm.cp_peso, 0x000087fc);
172 clrbits32(&immap->im_cpm.cp_cptr, 0x00000080);
173}
174
175static void setup_scc3_ioports(void)
176{
177 immap_t *immap = (immap_t *) IMAP_ADDR;
178 unsigned *bcsr_io;
179
180 bcsr_io = ioremap(BCSR_ADDR, BCSR_SIZE);
181
182 if (bcsr_io == NULL) {
183 printk(KERN_CRIT "Could not remap BCSR\n");
184 return;
185 }
186
187 /* Enable the PHY.
188 */
189 setbits32(bcsr_io+4, BCSR4_ETH10_RST);
190 /* Configure port A pins for Txd and Rxd.
191 */
192 setbits16(&immap->im_ioport.iop_papar, PA_ENET_RXD | PA_ENET_TXD);
193 clrbits16(&immap->im_ioport.iop_padir, PA_ENET_RXD | PA_ENET_TXD);
194
195 /* Configure port C pins to enable CLSN and RENA.
196 */
197 clrbits16(&immap->im_ioport.iop_pcpar, PC_ENET_CLSN | PC_ENET_RENA);
198 clrbits16(&immap->im_ioport.iop_pcdir, PC_ENET_CLSN | PC_ENET_RENA);
199 setbits16(&immap->im_ioport.iop_pcso, PC_ENET_CLSN | PC_ENET_RENA);
200
201 /* Configure port E for TCLK and RCLK.
202 */
203 setbits32(&immap->im_cpm.cp_pepar, PE_ENET_TCLK | PE_ENET_RCLK);
204 clrbits32(&immap->im_cpm.cp_pepar, PE_ENET_TENA);
205 clrbits32(&immap->im_cpm.cp_pedir,
206 PE_ENET_TCLK | PE_ENET_RCLK | PE_ENET_TENA);
207 clrbits32(&immap->im_cpm.cp_peso, PE_ENET_TCLK | PE_ENET_RCLK);
208 setbits32(&immap->im_cpm.cp_peso, PE_ENET_TENA);
209
210 /* Configure Serial Interface clock routing.
211 * First, clear all SCC bits to zero, then set the ones we want.
212 */
213 clrbits32(&immap->im_cpm.cp_sicr, SICR_ENET_MASK);
214 setbits32(&immap->im_cpm.cp_sicr, SICR_ENET_CLKRT);
215
216 /* Disable Rx and Tx. SMC1 sshould be stopped if SCC3 eternet are used.
217 */
218 immap->im_cpm.cp_smc[0].smc_smcmr &= ~(SMCMR_REN | SMCMR_TEN);
219 /* On the MPC885ADS SCC ethernet PHY is initialized in the full duplex mode
220 * by H/W setting after reset. SCC ethernet controller support only half duplex.
221 * This discrepancy of modes causes a lot of carrier lost errors.
222 */
223
224 /* In the original SCC enet driver the following code is placed at
225 the end of the initialization */
226 setbits32(&immap->im_cpm.cp_pepar, PE_ENET_TENA);
227 clrbits32(&immap->im_cpm.cp_pedir, PE_ENET_TENA);
228 setbits32(&immap->im_cpm.cp_peso, PE_ENET_TENA);
229
230 setbits32(bcsr_io+1, BCSR1_ETHEN);
231 iounmap(bcsr_io);
232}
233
234static void mpc885ads_fixup_enet_pdata(struct platform_device *pdev, int fs_no)
235{
236 struct fs_platform_info *fpi = pdev->dev.platform_data;
237
238 volatile cpm8xx_t *cp;
239 bd_t *bd = (bd_t *) __res;
240 char *e;
241 int i;
242
243 /* Get pointer to Communication Processor */
244 cp = cpmp;
245 switch (fs_no) {
246 case fsid_fec1:
247 fpi = &mpc8xx_fec_pdata[0];
248 fpi->init_ioports = &setup_fec1_ioports;
249 break;
250 case fsid_fec2:
251 fpi = &mpc8xx_fec_pdata[1];
252 fpi->init_ioports = &setup_fec2_ioports;
253 break;
254 case fsid_scc3:
255 fpi = &mpc8xx_scc_pdata;
256 fpi->init_ioports = &setup_scc3_ioports;
257 mpc885ads_scc_phy_init(fpi->phy_addr);
258 break;
259 default:
260 printk(KERN_WARNING"Device %s is not supported!\n", pdev->name);
261 return;
262 }
263
264 pdev->dev.platform_data = fpi;
265 fpi->fs_no = fs_no;
266
267 e = (unsigned char *)&bd->bi_enetaddr;
268 for (i = 0; i < 6; i++)
269 fpi->macaddr[i] = *e++;
270
271 fpi->macaddr[5 - pdev->id]++;
272
273}
274
275static void mpc885ads_fixup_fec_enet_pdata(struct platform_device *pdev,
276 int idx)
277{
278 /* This is for FEC devices only */
279 if (!pdev || !pdev->name || (!strstr(pdev->name, "fsl-cpm-fec")))
280 return;
281 mpc885ads_fixup_enet_pdata(pdev, fsid_fec1 + pdev->id - 1);
282}
283
284static void __init mpc885ads_fixup_scc_enet_pdata(struct platform_device *pdev,
285 int idx)
286{
287 /* This is for SCC devices only */
288 if (!pdev || !pdev->name || (!strstr(pdev->name, "fsl-cpm-scc")))
289 return;
290
291 mpc885ads_fixup_enet_pdata(pdev, fsid_scc1 + pdev->id - 1);
292}
293
294/* SCC ethernet controller does not have MII management channel. FEC1 MII
295 * channel is used to communicate with the 10Mbit PHY.
296 */
297
298#define MII_ECNTRL_PINMUX 0x4
299#define FEC_ECNTRL_PINMUX 0x00000004
300#define FEC_RCNTRL_MII_MODE 0x00000004
301
302/* Make MII read/write commands.
303 */
304#define mk_mii_write(REG, VAL, PHY_ADDR) (0x50020000 | (((REG) & 0x1f) << 18) | \
305 ((VAL) & 0xffff) | ((PHY_ADDR) << 23))
306
307static void mpc885ads_scc_phy_init(char phy_addr)
308{
309 volatile immap_t *immap;
310 volatile fec_t *fecp;
311 bd_t *bd;
312
313 bd = (bd_t *) __res;
314 immap = (immap_t *) IMAP_ADDR; /* pointer to internal registers */
315 fecp = &(immap->im_cpm.cp_fec);
316
317 /* Enable MII pins of the FEC1
318 */
319 setbits16(&immap->im_ioport.iop_pdpar, 0x0080);
320 clrbits16(&immap->im_ioport.iop_pddir, 0x0080);
321 /* Set MII speed to 2.5 MHz
322 */
323 out_be32(&fecp->fec_mii_speed,
324 ((((bd->bi_intfreq + 4999999) / 2500000) / 2) & 0x3F) << 1);
325
326 /* Enable FEC pin MUX
327 */
328 setbits32(&fecp->fec_ecntrl, MII_ECNTRL_PINMUX);
329 setbits32(&fecp->fec_r_cntrl, FEC_RCNTRL_MII_MODE);
330
331 out_be32(&fecp->fec_mii_data,
332 mk_mii_write(MII_BMCR, BMCR_ISOLATE, phy_addr));
333 udelay(100);
334 out_be32(&fecp->fec_mii_data,
335 mk_mii_write(MII_ADVERTISE,
336 ADVERTISE_10HALF | ADVERTISE_CSMA, phy_addr));
337 udelay(100);
338
339 /* Disable FEC MII settings
340 */
341 clrbits32(&fecp->fec_ecntrl, MII_ECNTRL_PINMUX);
342 clrbits32(&fecp->fec_r_cntrl, FEC_RCNTRL_MII_MODE);
343 out_be32(&fecp->fec_mii_speed, 0);
344}
345
346static int mpc885ads_platform_notify(struct device *dev)
347{
348
349 static const struct platform_notify_dev_map dev_map[] = {
350 {
351 .bus_id = "fsl-cpm-fec",
352 .rtn = mpc885ads_fixup_fec_enet_pdata,
353 },
354 {
355 .bus_id = "fsl-cpm-scc",
356 .rtn = mpc885ads_fixup_scc_enet_pdata,
357 },
358 {
359 .bus_id = NULL
360 }
361 };
362
363 platform_notify_map(dev_map,dev);
364
365}
366
367int __init mpc885ads_init(void)
368{
369 printk(KERN_NOTICE "mpc885ads: Init\n");
370
371 platform_notify = mpc885ads_platform_notify;
372
373 ppc_sys_device_initfunc();
374 ppc_sys_device_disable_all();
375
376 ppc_sys_device_enable(MPC8xx_CPM_FEC1);
377
378#ifdef CONFIG_MPC8xx_SECOND_ETH_SCC3
379 ppc_sys_device_enable(MPC8xx_CPM_SCC1);
380
381#endif
382#ifdef CONFIG_MPC8xx_SECOND_ETH_FEC2
383 ppc_sys_device_enable(MPC8xx_CPM_FEC2);
384#endif
385
386 return 0;
387}
388
389arch_initcall(mpc885ads_init);
diff --git a/arch/ppc/platforms/mvme5100.c b/arch/ppc/platforms/mvme5100.c
index 108eb182dddc..c717cd92c028 100644
--- a/arch/ppc/platforms/mvme5100.c
+++ b/arch/ppc/platforms/mvme5100.c
@@ -1,6 +1,4 @@
1/* 1/*
2 * arch/ppc/platforms/mvme5100.c
3 *
4 * Board setup routines for the Motorola MVME5100. 2 * Board setup routines for the Motorola MVME5100.
5 * 3 *
6 * Author: Matt Porter <mporter@mvista.com> 4 * Author: Matt Porter <mporter@mvista.com>
diff --git a/arch/ppc/platforms/pal4.h b/arch/ppc/platforms/pal4.h
index 641a11a31657..8569c423d887 100644
--- a/arch/ppc/platforms/pal4.h
+++ b/arch/ppc/platforms/pal4.h
@@ -1,6 +1,4 @@
1/* 1/*
2 * arch/ppc/platforms/pal4.h
3 *
4 * Definitions for SBS Palomar IV board 2 * Definitions for SBS Palomar IV board
5 * 3 *
6 * Author: Dan Cox 4 * Author: Dan Cox
diff --git a/arch/ppc/platforms/pal4_pci.c b/arch/ppc/platforms/pal4_pci.c
index c3b1b757a48b..d81ae1c7e1cf 100644
--- a/arch/ppc/platforms/pal4_pci.c
+++ b/arch/ppc/platforms/pal4_pci.c
@@ -1,6 +1,4 @@
1/* 1/*
2 * arch/ppc/platforms/pal4_pci.c
3 *
4 * PCI support for SBS Palomar IV 2 * PCI support for SBS Palomar IV
5 * 3 *
6 * Author: Dan Cox 4 * Author: Dan Cox
diff --git a/arch/ppc/platforms/pal4_serial.h b/arch/ppc/platforms/pal4_serial.h
index a715c66e1adf..a75343224cfd 100644
--- a/arch/ppc/platforms/pal4_serial.h
+++ b/arch/ppc/platforms/pal4_serial.h
@@ -1,6 +1,4 @@
1/* 1/*
2 * arch/ppc/platforms/pal4_serial.h
3 *
4 * Definitions for SBS PalomarIV serial support 2 * Definitions for SBS PalomarIV serial support
5 * 3 *
6 * Author: Dan Cox 4 * Author: Dan Cox
diff --git a/arch/ppc/platforms/pal4_setup.c b/arch/ppc/platforms/pal4_setup.c
index f93a3f871932..3c3d881df00d 100644
--- a/arch/ppc/platforms/pal4_setup.c
+++ b/arch/ppc/platforms/pal4_setup.c
@@ -1,6 +1,4 @@
1/* 1/*
2 * arch/ppc/platforms/pal4_setup.c
3 *
4 * Board setup routines for the SBS PalomarIV. 2 * Board setup routines for the SBS PalomarIV.
5 * 3 *
6 * Author: Dan Cox 4 * Author: Dan Cox
diff --git a/arch/ppc/platforms/powerpmc250.c b/arch/ppc/platforms/powerpmc250.c
index e6b520e6e13f..c3a86be11fb7 100644
--- a/arch/ppc/platforms/powerpmc250.c
+++ b/arch/ppc/platforms/powerpmc250.c
@@ -1,6 +1,4 @@
1/* 1/*
2 * arch/ppc/platforms/powerpmc250.c
3 *
4 * Board setup routines for Force PowerPMC-250 Processor PMC 2 * Board setup routines for Force PowerPMC-250 Processor PMC
5 * 3 *
6 * Author: Troy Benjegerdes <tbenjegerdes@mvista.com> 4 * Author: Troy Benjegerdes <tbenjegerdes@mvista.com>
diff --git a/arch/ppc/platforms/pplus.c b/arch/ppc/platforms/pplus.c
index 22bd40cfb092..de2761ebe0d9 100644
--- a/arch/ppc/platforms/pplus.c
+++ b/arch/ppc/platforms/pplus.c
@@ -1,6 +1,4 @@
1/* 1/*
2 * arch/ppc/platforms/pplus.c
3 *
4 * Board and PCI setup routines for MCG PowerPlus 2 * Board and PCI setup routines for MCG PowerPlus
5 * 3 *
6 * Author: Randy Vinson <rvinson@mvista.com> 4 * Author: Randy Vinson <rvinson@mvista.com>
diff --git a/arch/ppc/platforms/pplus.h b/arch/ppc/platforms/pplus.h
index 90f0cb2d409f..a07cbbdd72c6 100644
--- a/arch/ppc/platforms/pplus.h
+++ b/arch/ppc/platforms/pplus.h
@@ -1,6 +1,4 @@
1/* 1/*
2 * arch/ppc/platforms/pplus.h
3 *
4 * Definitions for Motorola MCG Falcon/Raven & HAWK North Bridge & Memory ctlr. 2 * Definitions for Motorola MCG Falcon/Raven & HAWK North Bridge & Memory ctlr.
5 * 3 *
6 * Author: Mark A. Greerinclude/asm-ppc/hawk.h 4 * Author: Mark A. Greerinclude/asm-ppc/hawk.h
diff --git a/arch/ppc/platforms/pq2ads.c b/arch/ppc/platforms/pq2ads.c
index 71c9fca1fe9b..3365fd788a7a 100644
--- a/arch/ppc/platforms/pq2ads.c
+++ b/arch/ppc/platforms/pq2ads.c
@@ -1,6 +1,4 @@
1/* 1/*
2 * arch/ppc/platforms/pq2ads.c
3 *
4 * PQ2ADS platform support 2 * PQ2ADS platform support
5 * 3 *
6 * Author: Kumar Gala <galak@kernel.crashing.org> 4 * Author: Kumar Gala <galak@kernel.crashing.org>
diff --git a/arch/ppc/platforms/pq2ads.h b/arch/ppc/platforms/pq2ads.h
index 067d9a5aebc1..6b26dd36c640 100644
--- a/arch/ppc/platforms/pq2ads.h
+++ b/arch/ppc/platforms/pq2ads.h
@@ -13,6 +13,10 @@
13 13
14#include <asm/ppcboot.h> 14#include <asm/ppcboot.h>
15 15
16#if defined(CONFIG_ADS8272)
17#define BOARD_CHIP_NAME "8272"
18#endif
19
16/* Memory map is configured by the PROM startup. 20/* Memory map is configured by the PROM startup.
17 * We just map a few things we need. The CSR is actually 4 byte-wide 21 * We just map a few things we need. The CSR is actually 4 byte-wide
18 * registers that can be accessed as 8-, 16-, or 32-bit values. 22 * registers that can be accessed as 8-, 16-, or 32-bit values.
diff --git a/arch/ppc/platforms/pq2ads_pd.h b/arch/ppc/platforms/pq2ads_pd.h
new file mode 100644
index 000000000000..8f14a43eafec
--- /dev/null
+++ b/arch/ppc/platforms/pq2ads_pd.h
@@ -0,0 +1,114 @@
1#ifndef __PQ2ADS_PD_H
2#define __PQ2ADS_PD_H
3/*
4 * arch/ppc/platforms/82xx/pq2ads_pd.h
5 *
6 * Some defines for MPC82xx board-specific PlatformDevice descriptions
7 *
8 * 2005 (c) MontaVista Software, Inc.
9 * Vitaly Bordug <vbordug@ru.mvista.com>
10 *
11 * This file is licensed under the terms of the GNU General Public License
12 * version 2. This program is licensed "as is" without any warranty of any
13 * kind, whether express or implied.
14 */
15
16/* FCC1 Clock Source Configuration. These can be redefined in the board specific file.
17 Can only choose from CLK9-12 */
18
19#define F1_RXCLK 11
20#define F1_TXCLK 10
21
22/* FCC2 Clock Source Configuration. These can be redefined in the board specific file.
23 Can only choose from CLK13-16 */
24#define F2_RXCLK 15
25#define F2_TXCLK 16
26
27/* FCC3 Clock Source Configuration. These can be redefined in the board specific file.
28 Can only choose from CLK13-16 */
29#define F3_RXCLK 13
30#define F3_TXCLK 14
31
32/* Automatically generates register configurations */
33#define PC_CLK(x) ((uint)(1<<(x-1))) /* FCC CLK I/O ports */
34
35#define CMXFCR_RF1CS(x) ((uint)((x-5)<<27)) /* FCC1 Receive Clock Source */
36#define CMXFCR_TF1CS(x) ((uint)((x-5)<<24)) /* FCC1 Transmit Clock Source */
37#define CMXFCR_RF2CS(x) ((uint)((x-9)<<19)) /* FCC2 Receive Clock Source */
38#define CMXFCR_TF2CS(x) ((uint)((x-9)<<16)) /* FCC2 Transmit Clock Source */
39#define CMXFCR_RF3CS(x) ((uint)((x-9)<<11)) /* FCC3 Receive Clock Source */
40#define CMXFCR_TF3CS(x) ((uint)((x-9)<<8)) /* FCC3 Transmit Clock Source */
41
42#define PC_F1RXCLK PC_CLK(F1_RXCLK)
43#define PC_F1TXCLK PC_CLK(F1_TXCLK)
44#define CMX1_CLK_ROUTE (CMXFCR_RF1CS(F1_RXCLK) | CMXFCR_TF1CS(F1_TXCLK))
45#define CMX1_CLK_MASK ((uint)0xff000000)
46
47#define PC_F2RXCLK PC_CLK(F2_RXCLK)
48#define PC_F2TXCLK PC_CLK(F2_TXCLK)
49#define CMX2_CLK_ROUTE (CMXFCR_RF2CS(F2_RXCLK) | CMXFCR_TF2CS(F2_TXCLK))
50#define CMX2_CLK_MASK ((uint)0x00ff0000)
51
52#define PC_F3RXCLK PC_CLK(F3_RXCLK)
53#define PC_F3TXCLK PC_CLK(F3_TXCLK)
54#define CMX3_CLK_ROUTE (CMXFCR_RF3CS(F3_RXCLK) | CMXFCR_TF3CS(F3_TXCLK))
55#define CMX3_CLK_MASK ((uint)0x0000ff00)
56
57/* I/O Pin assignment for FCC1. I don't yet know the best way to do this,
58 * but there is little variation among the choices.
59 */
60#define PA1_COL 0x00000001U
61#define PA1_CRS 0x00000002U
62#define PA1_TXER 0x00000004U
63#define PA1_TXEN 0x00000008U
64#define PA1_RXDV 0x00000010U
65#define PA1_RXER 0x00000020U
66#define PA1_TXDAT 0x00003c00U
67#define PA1_RXDAT 0x0003c000U
68#define PA1_PSORA0 (PA1_RXDAT | PA1_TXDAT)
69#define PA1_PSORA1 (PA1_COL | PA1_CRS | PA1_TXER | PA1_TXEN | \
70 PA1_RXDV | PA1_RXER)
71#define PA1_DIRA0 (PA1_RXDAT | PA1_CRS | PA1_COL | PA1_RXER | PA1_RXDV)
72#define PA1_DIRA1 (PA1_TXDAT | PA1_TXEN | PA1_TXER)
73
74
75/* I/O Pin assignment for FCC2. I don't yet know the best way to do this,
76 * but there is little variation among the choices.
77 */
78#define PB2_TXER 0x00000001U
79#define PB2_RXDV 0x00000002U
80#define PB2_TXEN 0x00000004U
81#define PB2_RXER 0x00000008U
82#define PB2_COL 0x00000010U
83#define PB2_CRS 0x00000020U
84#define PB2_TXDAT 0x000003c0U
85#define PB2_RXDAT 0x00003c00U
86#define PB2_PSORB0 (PB2_RXDAT | PB2_TXDAT | PB2_CRS | PB2_COL | \
87 PB2_RXER | PB2_RXDV | PB2_TXER)
88#define PB2_PSORB1 (PB2_TXEN)
89#define PB2_DIRB0 (PB2_RXDAT | PB2_CRS | PB2_COL | PB2_RXER | PB2_RXDV)
90#define PB2_DIRB1 (PB2_TXDAT | PB2_TXEN | PB2_TXER)
91
92
93/* I/O Pin assignment for FCC3. I don't yet know the best way to do this,
94 * but there is little variation among the choices.
95 */
96#define PB3_RXDV 0x00004000U
97#define PB3_RXER 0x00008000U
98#define PB3_TXER 0x00010000U
99#define PB3_TXEN 0x00020000U
100#define PB3_COL 0x00040000U
101#define PB3_CRS 0x00080000U
102#define PB3_TXDAT 0x0f000000U
103#define PB3_RXDAT 0x00f00000U
104#define PB3_PSORB0 (PB3_RXDAT | PB3_TXDAT | PB3_CRS | PB3_COL | \
105 PB3_RXER | PB3_RXDV | PB3_TXER | PB3_TXEN)
106#define PB3_PSORB1 0
107#define PB3_DIRB0 (PB3_RXDAT | PB3_CRS | PB3_COL | PB3_RXER | PB3_RXDV)
108#define PB3_DIRB1 (PB3_TXDAT | PB3_TXEN | PB3_TXER)
109
110#define FCC_MEM_OFFSET(x) (CPM_FCC_SPECIAL_BASE + (x*128))
111#define FCC1_MEM_OFFSET FCC_MEM_OFFSET(0)
112#define FCC2_MEM_OFFSET FCC_MEM_OFFSET(1)
113
114#endif
diff --git a/arch/ppc/platforms/prep_setup.c b/arch/ppc/platforms/prep_setup.c
index d06535802003..e86f6156d589 100644
--- a/arch/ppc/platforms/prep_setup.c
+++ b/arch/ppc/platforms/prep_setup.c
@@ -1,6 +1,4 @@
1/* 1/*
2 * arch/ppc/platforms/setup.c
3 *
4 * Copyright (C) 1995 Linus Torvalds 2 * Copyright (C) 1995 Linus Torvalds
5 * Adapted from 'alpha' version by Gary Thomas 3 * Adapted from 'alpha' version by Gary Thomas
6 * Modified by Cort Dougan (cort@cs.nmt.edu) 4 * Modified by Cort Dougan (cort@cs.nmt.edu)
@@ -738,7 +736,7 @@ ibm_statusled_progress(char *s, unsigned short hex)
738 hex = 0xfff; 736 hex = 0xfff;
739 if (!notifier_installed) { 737 if (!notifier_installed) {
740 ++notifier_installed; 738 ++notifier_installed;
741 notifier_chain_register(&panic_notifier_list, 739 atomic_notifier_chain_register(&panic_notifier_list,
742 &ibm_statusled_block); 740 &ibm_statusled_block);
743 } 741 }
744 } 742 }
@@ -1069,15 +1067,13 @@ prep_map_io(void)
1069static int __init 1067static int __init
1070prep_request_io(void) 1068prep_request_io(void)
1071{ 1069{
1072 if (_machine == _MACH_prep) {
1073#ifdef CONFIG_NVRAM 1070#ifdef CONFIG_NVRAM
1074 request_region(PREP_NVRAM_AS0, 0x8, "nvram"); 1071 request_region(PREP_NVRAM_AS0, 0x8, "nvram");
1075#endif 1072#endif
1076 request_region(0x00,0x20,"dma1"); 1073 request_region(0x00,0x20,"dma1");
1077 request_region(0x40,0x20,"timer"); 1074 request_region(0x40,0x20,"timer");
1078 request_region(0x80,0x10,"dma page reg"); 1075 request_region(0x80,0x10,"dma page reg");
1079 request_region(0xc0,0x20,"dma2"); 1076 request_region(0xc0,0x20,"dma2");
1080 }
1081 1077
1082 return 0; 1078 return 0;
1083} 1079}
diff --git a/arch/ppc/platforms/prpmc750.c b/arch/ppc/platforms/prpmc750.c
index 0bb14a5e824c..cdd9cfb13ee9 100644
--- a/arch/ppc/platforms/prpmc750.c
+++ b/arch/ppc/platforms/prpmc750.c
@@ -1,6 +1,4 @@
1/* 1/*
2 * arch/ppc/platforms/prpmc750_setup.c
3 *
4 * Board setup routines for Motorola PrPMC750 2 * Board setup routines for Motorola PrPMC750
5 * 3 *
6 * Author: Matt Porter <mporter@mvista.com> 4 * Author: Matt Porter <mporter@mvista.com>
diff --git a/arch/ppc/platforms/prpmc800.c b/arch/ppc/platforms/prpmc800.c
index de7baefacd3a..e459a199fb1d 100644
--- a/arch/ppc/platforms/prpmc800.c
+++ b/arch/ppc/platforms/prpmc800.c
@@ -1,6 +1,4 @@
1/* 1/*
2 * arch/ppc/platforms/prpmc800.c
3 *
4 * Author: Dale Farnsworth <dale.farnsworth@mvista.com> 2 * Author: Dale Farnsworth <dale.farnsworth@mvista.com>
5 * 3 *
6 * 2001-2004 (c) MontaVista, Software, Inc. This file is licensed under 4 * 2001-2004 (c) MontaVista, Software, Inc. This file is licensed under
diff --git a/arch/ppc/platforms/radstone_ppc7d.c b/arch/ppc/platforms/radstone_ppc7d.c
index 872c0a3ba3c7..bc26b6d71c1d 100644
--- a/arch/ppc/platforms/radstone_ppc7d.c
+++ b/arch/ppc/platforms/radstone_ppc7d.c
@@ -1,6 +1,4 @@
1/* 1/*
2 * arch/ppc/platforms/radstone_ppc7d.c
3 *
4 * Board setup routines for the Radstone PPC7D boards. 2 * Board setup routines for the Radstone PPC7D boards.
5 * 3 *
6 * Author: James Chapman <jchapman@katalix.com> 4 * Author: James Chapman <jchapman@katalix.com>
@@ -685,11 +683,10 @@ ppc7d_fixup_i2c_pdata(struct platform_device *pdev)
685 683
686 pdata = pdev->dev.platform_data; 684 pdata = pdev->dev.platform_data;
687 if (pdata == NULL) { 685 if (pdata == NULL) {
688 pdata = kmalloc(sizeof(*pdata), GFP_KERNEL); 686 pdata = kzalloc(sizeof(*pdata), GFP_KERNEL);
689 if (pdata == NULL) 687 if (pdata == NULL)
690 return; 688 return;
691 689
692 memset(pdata, 0, sizeof(*pdata));
693 pdev->dev.platform_data = pdata; 690 pdev->dev.platform_data = pdata;
694 } 691 }
695 692
@@ -712,7 +709,7 @@ ppc7d_fixup_i2c_pdata(struct platform_device *pdev)
712} 709}
713#endif 710#endif
714 711
715static int __init ppc7d_platform_notify(struct device *dev) 712static int ppc7d_platform_notify(struct device *dev)
716{ 713{
717 static struct { 714 static struct {
718 char *bus_id; 715 char *bus_id;
diff --git a/arch/ppc/platforms/radstone_ppc7d.h b/arch/ppc/platforms/radstone_ppc7d.h
index 938375510be4..2bb093a0c03e 100644
--- a/arch/ppc/platforms/radstone_ppc7d.h
+++ b/arch/ppc/platforms/radstone_ppc7d.h
@@ -1,6 +1,4 @@
1/* 1/*
2 * arch/ppc/platforms/radstone_ppc7d.h
3 *
4 * Board definitions for the Radstone PPC7D boards. 2 * Board definitions for the Radstone PPC7D boards.
5 * 3 *
6 * Author: James Chapman <jchapman@katalix.com> 4 * Author: James Chapman <jchapman@katalix.com>
diff --git a/arch/ppc/platforms/sandpoint.c b/arch/ppc/platforms/sandpoint.c
index 9eeed3572309..6dc459decb2d 100644
--- a/arch/ppc/platforms/sandpoint.c
+++ b/arch/ppc/platforms/sandpoint.c
@@ -1,6 +1,4 @@
1/* 1/*
2 * arch/ppc/platforms/sandpoint_setup.c
3 *
4 * Board setup routines for the Motorola SPS Sandpoint Test Platform. 2 * Board setup routines for the Motorola SPS Sandpoint Test Platform.
5 * 3 *
6 * Author: Mark A. Greer 4 * Author: Mark A. Greer
diff --git a/arch/ppc/platforms/sandpoint.h b/arch/ppc/platforms/sandpoint.h
index f4e982cb69df..3b64e6418489 100644
--- a/arch/ppc/platforms/sandpoint.h
+++ b/arch/ppc/platforms/sandpoint.h
@@ -1,6 +1,4 @@
1/* 1/*
2 * arch/ppc/platforms/sandpoint.h
3 *
4 * Definitions for Motorola SPS Sandpoint Test Platform 2 * Definitions for Motorola SPS Sandpoint Test Platform
5 * 3 *
6 * Author: Mark A. Greer 4 * Author: Mark A. Greer
diff --git a/arch/ppc/platforms/sbc82xx.c b/arch/ppc/platforms/sbc82xx.c
index 74c9ff72c3dd..866807b4ad0b 100644
--- a/arch/ppc/platforms/sbc82xx.c
+++ b/arch/ppc/platforms/sbc82xx.c
@@ -1,6 +1,4 @@
1/* 1/*
2 * arch/ppc/platforms/sbc82xx.c
3 *
4 * SBC82XX platform support 2 * SBC82XX platform support
5 * 3 *
6 * Author: Guy Streeter <streeter@redhat.com> 4 * Author: Guy Streeter <streeter@redhat.com>
diff --git a/arch/ppc/platforms/spruce.c b/arch/ppc/platforms/spruce.c
index 69e1de7971f2..3783deccd9b2 100644
--- a/arch/ppc/platforms/spruce.c
+++ b/arch/ppc/platforms/spruce.c
@@ -1,6 +1,4 @@
1/* 1/*
2 * arch/ppc/platforms/spruce.c
3 *
4 * Board and PCI setup routines for IBM Spruce 2 * Board and PCI setup routines for IBM Spruce
5 * 3 *
6 * Author: MontaVista Software <source@mvista.com> 4 * Author: MontaVista Software <source@mvista.com>
diff --git a/arch/ppc/platforms/tqm8260_setup.c b/arch/ppc/platforms/tqm8260_setup.c
index 3409139330b1..b766339f44ac 100644
--- a/arch/ppc/platforms/tqm8260_setup.c
+++ b/arch/ppc/platforms/tqm8260_setup.c
@@ -1,6 +1,4 @@
1/* 1/*
2 * arch/ppc/platforms/tqm8260_setup.c
3 *
4 * TQM8260 platform support 2 * TQM8260 platform support
5 * 3 *
6 * Author: Allen Curtis <acurtis@onz.com> 4 * Author: Allen Curtis <acurtis@onz.com>
diff --git a/arch/ppc/syslib/Makefile b/arch/ppc/syslib/Makefile
index 159dcd92a6d1..490749ca88f9 100644
--- a/arch/ppc/syslib/Makefile
+++ b/arch/ppc/syslib/Makefile
@@ -17,8 +17,8 @@ obj-$(CONFIG_440GX) += ibm440gx_common.o
17obj-$(CONFIG_440SP) += ibm440gx_common.o ibm440sp_common.o 17obj-$(CONFIG_440SP) += ibm440gx_common.o ibm440sp_common.o
18obj-$(CONFIG_440SPE) += ibm440gx_common.o ibm440sp_common.o ppc440spe_pcie.o 18obj-$(CONFIG_440SPE) += ibm440gx_common.o ibm440sp_common.o ppc440spe_pcie.o
19ifeq ($(CONFIG_4xx),y) 19ifeq ($(CONFIG_4xx),y)
20ifeq ($(CONFIG_VIRTEX_II_PRO),y) 20ifeq ($(CONFIG_XILINX_VIRTEX),y)
21obj-$(CONFIG_40x) += xilinx_pic.o 21obj-$(CONFIG_40x) += xilinx_pic.o ppc_sys.o
22else 22else
23ifeq ($(CONFIG_403),y) 23ifeq ($(CONFIG_403),y)
24obj-$(CONFIG_40x) += ppc403_pic.o 24obj-$(CONFIG_40x) += ppc403_pic.o
@@ -38,8 +38,6 @@ endif
38obj-$(CONFIG_8xx) += m8xx_setup.o ppc8xx_pic.o $(wdt-mpc8xx-y) \ 38obj-$(CONFIG_8xx) += m8xx_setup.o ppc8xx_pic.o $(wdt-mpc8xx-y) \
39 ppc_sys.o mpc8xx_devices.o mpc8xx_sys.o 39 ppc_sys.o mpc8xx_devices.o mpc8xx_sys.o
40obj-$(CONFIG_PCI_QSPAN) += qspan_pci.o 40obj-$(CONFIG_PCI_QSPAN) += qspan_pci.o
41obj-$(CONFIG_PPC_OF) += prom_init.o prom.o
42obj-$(CONFIG_PPC_CHRP) += open_pic.o
43obj-$(CONFIG_PPC_PREP) += open_pic.o todc_time.o 41obj-$(CONFIG_PPC_PREP) += open_pic.o todc_time.o
44obj-$(CONFIG_BAMBOO) += pci_auto.o todc_time.o 42obj-$(CONFIG_BAMBOO) += pci_auto.o todc_time.o
45obj-$(CONFIG_CPCI690) += todc_time.o pci_auto.o 43obj-$(CONFIG_CPCI690) += todc_time.o pci_auto.o
diff --git a/arch/ppc/syslib/cpc700.h b/arch/ppc/syslib/cpc700.h
index f2c002531019..0a8a5d84390f 100644
--- a/arch/ppc/syslib/cpc700.h
+++ b/arch/ppc/syslib/cpc700.h
@@ -1,6 +1,4 @@
1/* 1/*
2 * arch/ppc/syslib/cpc700.h
3 *
4 * Header file for IBM CPC700 Host Bridge, et. al. 2 * Header file for IBM CPC700 Host Bridge, et. al.
5 * 3 *
6 * Author: Mark A. Greer 4 * Author: Mark A. Greer
diff --git a/arch/ppc/syslib/cpc700_pic.c b/arch/ppc/syslib/cpc700_pic.c
index 75fe8eb10693..5add0a919ef6 100644
--- a/arch/ppc/syslib/cpc700_pic.c
+++ b/arch/ppc/syslib/cpc700_pic.c
@@ -1,6 +1,4 @@
1/* 1/*
2 * arch/ppc/syslib/cpc700_pic.c
3 *
4 * Interrupt controller support for IBM Spruce 2 * Interrupt controller support for IBM Spruce
5 * 3 *
6 * Authors: Mark Greer, Matt Porter, and Johnnie Peters 4 * Authors: Mark Greer, Matt Porter, and Johnnie Peters
diff --git a/arch/ppc/syslib/cpc710.h b/arch/ppc/syslib/cpc710.h
index cc0afd804029..5299bf8b5d01 100644
--- a/arch/ppc/syslib/cpc710.h
+++ b/arch/ppc/syslib/cpc710.h
@@ -1,6 +1,4 @@
1/* 1/*
2 * arch/ppc/syslib/cpc710.h
3 *
4 * Definitions for the IBM CPC710 PCI Host Bridge 2 * Definitions for the IBM CPC710 PCI Host Bridge
5 * 3 *
6 * Author: Matt Porter <mporter@mvista.com> 4 * Author: Matt Porter <mporter@mvista.com>
diff --git a/arch/ppc/syslib/gen550.h b/arch/ppc/syslib/gen550.h
index 039d249e19a8..5254d3cdbca6 100644
--- a/arch/ppc/syslib/gen550.h
+++ b/arch/ppc/syslib/gen550.h
@@ -1,6 +1,4 @@
1/* 1/*
2 * arch/ppc/syslib/gen550.h
3 *
4 * gen550 prototypes 2 * gen550 prototypes
5 * 3 *
6 * Matt Porter <mporter@kernel.crashing.org> 4 * Matt Porter <mporter@kernel.crashing.org>
diff --git a/arch/ppc/syslib/gen550_dbg.c b/arch/ppc/syslib/gen550_dbg.c
index 9ef0113c83d1..9fcff74bfdd0 100644
--- a/arch/ppc/syslib/gen550_dbg.c
+++ b/arch/ppc/syslib/gen550_dbg.c
@@ -1,6 +1,4 @@
1/* 1/*
2 * arch/ppc/syslib/gen550_dbg.c
3 *
4 * A library of polled 16550 serial routines. These are intended to 2 * A library of polled 16550 serial routines. These are intended to
5 * be used to support progress messages, xmon, kgdb, etc. on a 3 * be used to support progress messages, xmon, kgdb, etc. on a
6 * variety of platforms. 4 * variety of platforms.
diff --git a/arch/ppc/syslib/gen550_kgdb.c b/arch/ppc/syslib/gen550_kgdb.c
index 7239d5d7ddcd..874078a7664d 100644
--- a/arch/ppc/syslib/gen550_kgdb.c
+++ b/arch/ppc/syslib/gen550_kgdb.c
@@ -1,6 +1,4 @@
1/* 1/*
2 * arch/ppc/syslib/gen550_kgdb.c
3 *
4 * Generic 16550 kgdb support intended to be useful on a variety 2 * Generic 16550 kgdb support intended to be useful on a variety
5 * of platforms. To enable this support, it is necessary to set 3 * of platforms. To enable this support, it is necessary to set
6 * the CONFIG_GEN550 option. Any virtual mapping of the serial 4 * the CONFIG_GEN550 option. Any virtual mapping of the serial
diff --git a/arch/ppc/syslib/gt64260_pic.c b/arch/ppc/syslib/gt64260_pic.c
index f97b3a9abd1e..dc3bd9ecbbf6 100644
--- a/arch/ppc/syslib/gt64260_pic.c
+++ b/arch/ppc/syslib/gt64260_pic.c
@@ -1,6 +1,4 @@
1/* 1/*
2 * arch/ppc/syslib/gt64260_pic.c
3 *
4 * Interrupt controller support for Galileo's GT64260. 2 * Interrupt controller support for Galileo's GT64260.
5 * 3 *
6 * Author: Chris Zankel <source@mvista.com> 4 * Author: Chris Zankel <source@mvista.com>
diff --git a/arch/ppc/syslib/harrier.c b/arch/ppc/syslib/harrier.c
index a6b3f8645793..c1583f488325 100644
--- a/arch/ppc/syslib/harrier.c
+++ b/arch/ppc/syslib/harrier.c
@@ -1,6 +1,4 @@
1/* 1/*
2 * arch/ppc/syslib/harrier.c
3 *
4 * Motorola MCG Harrier northbridge/memory controller support 2 * Motorola MCG Harrier northbridge/memory controller support
5 * 3 *
6 * Author: Dale Farnsworth 4 * Author: Dale Farnsworth
diff --git a/arch/ppc/syslib/hawk_common.c b/arch/ppc/syslib/hawk_common.c
index a9911dc3a82f..c5bf16b0d6a1 100644
--- a/arch/ppc/syslib/hawk_common.c
+++ b/arch/ppc/syslib/hawk_common.c
@@ -1,6 +1,4 @@
1/* 1/*
2 * arch/ppc/syslib/hawk_common.c
3 *
4 * Common Motorola PowerPlus Platform--really Falcon/Raven or HAWK. 2 * Common Motorola PowerPlus Platform--really Falcon/Raven or HAWK.
5 * 3 *
6 * Author: Mark A. Greer 4 * Author: Mark A. Greer
diff --git a/arch/ppc/syslib/ibm440gp_common.c b/arch/ppc/syslib/ibm440gp_common.c
index 0d6be2d6dd67..fbaae5f6d834 100644
--- a/arch/ppc/syslib/ibm440gp_common.c
+++ b/arch/ppc/syslib/ibm440gp_common.c
@@ -1,6 +1,4 @@
1/* 1/*
2 * arch/ppc/syslib/ibm440gp_common.c
3 *
4 * PPC440GP system library 2 * PPC440GP system library
5 * 3 *
6 * Matt Porter <mporter@mvista.com> 4 * Matt Porter <mporter@mvista.com>
diff --git a/arch/ppc/syslib/ibm440gp_common.h b/arch/ppc/syslib/ibm440gp_common.h
index a054d83cb1ac..f48529f3c23d 100644
--- a/arch/ppc/syslib/ibm440gp_common.h
+++ b/arch/ppc/syslib/ibm440gp_common.h
@@ -1,6 +1,4 @@
1/* 1/*
2 * arch/ppc/kernel/ibm440gp_common.h
3 *
4 * PPC440GP system library 2 * PPC440GP system library
5 * 3 *
6 * Eugene Surovegin <eugene.surovegin@zultys.com> or <ebs@ebshome.net> 4 * Eugene Surovegin <eugene.surovegin@zultys.com> or <ebs@ebshome.net>
diff --git a/arch/ppc/syslib/ibm440gx_common.c b/arch/ppc/syslib/ibm440gx_common.c
index c36db279b43d..a7dd55f1c63e 100644
--- a/arch/ppc/syslib/ibm440gx_common.c
+++ b/arch/ppc/syslib/ibm440gx_common.c
@@ -1,6 +1,4 @@
1/* 1/*
2 * arch/ppc/kernel/ibm440gx_common.c
3 *
4 * PPC440GX system library 2 * PPC440GX system library
5 * 3 *
6 * Eugene Surovegin <eugene.surovegin@zultys.com> or <ebs@ebshome.net> 4 * Eugene Surovegin <eugene.surovegin@zultys.com> or <ebs@ebshome.net>
diff --git a/arch/ppc/syslib/ibm440gx_common.h b/arch/ppc/syslib/ibm440gx_common.h
index e73aa0411d35..a2ab9fab8e34 100644
--- a/arch/ppc/syslib/ibm440gx_common.h
+++ b/arch/ppc/syslib/ibm440gx_common.h
@@ -1,6 +1,4 @@
1/* 1/*
2 * arch/ppc/kernel/ibm440gx_common.h
3 *
4 * PPC440GX system library 2 * PPC440GX system library
5 * 3 *
6 * Eugene Surovegin <eugene.surovegin@zultys.com> or <ebs@ebshome.net> 4 * Eugene Surovegin <eugene.surovegin@zultys.com> or <ebs@ebshome.net>
diff --git a/arch/ppc/syslib/ibm440sp_common.c b/arch/ppc/syslib/ibm440sp_common.c
index cdafda127d81..293e4138d172 100644
--- a/arch/ppc/syslib/ibm440sp_common.c
+++ b/arch/ppc/syslib/ibm440sp_common.c
@@ -1,6 +1,4 @@
1/* 1/*
2 * arch/ppc/syslib/ibm440sp_common.c
3 *
4 * PPC440SP/PPC440SPe system library 2 * PPC440SP/PPC440SPe system library
5 * 3 *
6 * Matt Porter <mporter@kernel.crashing.org> 4 * Matt Porter <mporter@kernel.crashing.org>
diff --git a/arch/ppc/syslib/ibm440sp_common.h b/arch/ppc/syslib/ibm440sp_common.h
index a21a9906dcc9..8077bf8ed118 100644
--- a/arch/ppc/syslib/ibm440sp_common.h
+++ b/arch/ppc/syslib/ibm440sp_common.h
@@ -1,6 +1,4 @@
1/* 1/*
2 * arch/ppc/syslib/ibm440sp_common.h
3 *
4 * PPC440SP system library 2 * PPC440SP system library
5 * 3 *
6 * Matt Porter <mporter@kernel.crashing.org> 4 * Matt Porter <mporter@kernel.crashing.org>
diff --git a/arch/ppc/syslib/ibm44x_common.c b/arch/ppc/syslib/ibm44x_common.c
index 71db11d22158..14a981a5cea7 100644
--- a/arch/ppc/syslib/ibm44x_common.c
+++ b/arch/ppc/syslib/ibm44x_common.c
@@ -1,6 +1,4 @@
1/* 1/*
2 * arch/ppc/syslib/ibm44x_common.c
3 *
4 * PPC44x system library 2 * PPC44x system library
5 * 3 *
6 * Matt Porter <mporter@kernel.crashing.org> 4 * Matt Porter <mporter@kernel.crashing.org>
diff --git a/arch/ppc/syslib/ibm44x_common.h b/arch/ppc/syslib/ibm44x_common.h
index b25a8995e4e9..f179db8634e0 100644
--- a/arch/ppc/syslib/ibm44x_common.h
+++ b/arch/ppc/syslib/ibm44x_common.h
@@ -1,6 +1,4 @@
1/* 1/*
2 * arch/ppc/kernel/ibm44x_common.h
3 *
4 * PPC44x system library 2 * PPC44x system library
5 * 3 *
6 * Eugene Surovegin <eugene.surovegin@zultys.com> or <ebs@ebshome.net> 4 * Eugene Surovegin <eugene.surovegin@zultys.com> or <ebs@ebshome.net>
diff --git a/arch/ppc/syslib/m8260_pci_erratum9.c b/arch/ppc/syslib/m8260_pci_erratum9.c
index 1dc7e4e1d491..99e4bc0e42af 100644
--- a/arch/ppc/syslib/m8260_pci_erratum9.c
+++ b/arch/ppc/syslib/m8260_pci_erratum9.c
@@ -1,6 +1,4 @@
1/* 1/*
2 * arch/ppc/platforms/mpc8260_pci9.c
3 *
4 * Workaround for device erratum PCI 9. 2 * Workaround for device erratum PCI 9.
5 * See Motorola's "XPC826xA Family Device Errata Reference." 3 * See Motorola's "XPC826xA Family Device Errata Reference."
6 * The erratum applies to all 8260 family Hip4 processors. It is scheduled 4 * The erratum applies to all 8260 family Hip4 processors. It is scheduled
diff --git a/arch/ppc/syslib/m8260_setup.c b/arch/ppc/syslib/m8260_setup.c
index 76a2aa4ce65e..b7a6cb2d8d52 100644
--- a/arch/ppc/syslib/m8260_setup.c
+++ b/arch/ppc/syslib/m8260_setup.c
@@ -1,6 +1,4 @@
1/* 1/*
2 * arch/ppc/syslib/m8260_setup.c
3 *
4 * Copyright (C) 1995 Linus Torvalds 2 * Copyright (C) 1995 Linus Torvalds
5 * Adapted from 'alpha' version by Gary Thomas 3 * Adapted from 'alpha' version by Gary Thomas
6 * Modified by Cort Dougan (cort@cs.nmt.edu) 4 * Modified by Cort Dougan (cort@cs.nmt.edu)
diff --git a/arch/ppc/syslib/m8xx_setup.c b/arch/ppc/syslib/m8xx_setup.c
index 688616de3cde..dae9af78bde1 100644
--- a/arch/ppc/syslib/m8xx_setup.c
+++ b/arch/ppc/syslib/m8xx_setup.c
@@ -1,6 +1,4 @@
1/* 1/*
2 * arch/ppc/kernel/setup.c
3 *
4 * Copyright (C) 1995 Linus Torvalds 2 * Copyright (C) 1995 Linus Torvalds
5 * Adapted from 'alpha' version by Gary Thomas 3 * Adapted from 'alpha' version by Gary Thomas
6 * Modified by Cort Dougan (cort@cs.nmt.edu) 4 * Modified by Cort Dougan (cort@cs.nmt.edu)
@@ -34,6 +32,13 @@
34#include <linux/seq_file.h> 32#include <linux/seq_file.h>
35#include <linux/root_dev.h> 33#include <linux/root_dev.h>
36 34
35#if defined(CONFIG_MTD) && defined(CONFIG_MTD_PHYSMAP)
36#include <linux/mtd/partitions.h>
37#include <linux/mtd/physmap.h>
38#include <linux/mtd/mtd.h>
39#include <linux/mtd/map.h>
40#endif
41
37#include <asm/mmu.h> 42#include <asm/mmu.h>
38#include <asm/reg.h> 43#include <asm/reg.h>
39#include <asm/residual.h> 44#include <asm/residual.h>
@@ -49,6 +54,34 @@
49 54
50#include "ppc8xx_pic.h" 55#include "ppc8xx_pic.h"
51 56
57#ifdef CONFIG_MTD_PHYSMAP
58#define MPC8xxADS_BANK_WIDTH 4
59#endif
60
61#define MPC8xxADS_U_BOOT_SIZE 0x80000
62#define MPC8xxADS_FREE_AREA_OFFSET MPC8xxADS_U_BOOT_SIZE
63
64#if defined(CONFIG_MTD_PARTITIONS)
65 /*
66 NOTE: bank width and interleave relative to the installed flash
67 should have been chosen within MTD_CFI_GEOMETRY options.
68 */
69static struct mtd_partition mpc8xxads_partitions[] = {
70 {
71 .name = "bootloader",
72 .size = MPC8xxADS_U_BOOT_SIZE,
73 .offset = 0,
74 .mask_flags = MTD_WRITEABLE, /* force read-only */
75 }, {
76 .name = "User FS",
77 .offset = MPC8xxADS_FREE_AREA_OFFSET
78 }
79};
80
81#define mpc8xxads_part_num (sizeof (mpc8xxads_partitions) / sizeof (mpc8xxads_partitions[0]))
82
83#endif
84
52static int m8xx_set_rtc_time(unsigned long time); 85static int m8xx_set_rtc_time(unsigned long time);
53static unsigned long m8xx_get_rtc_time(void); 86static unsigned long m8xx_get_rtc_time(void);
54void m8xx_calibrate_decr(void); 87void m8xx_calibrate_decr(void);
@@ -71,6 +104,10 @@ board_init(void)
71void __init 104void __init
72m8xx_setup_arch(void) 105m8xx_setup_arch(void)
73{ 106{
107#if defined(CONFIG_MTD) && defined(CONFIG_MTD_PHYSMAP)
108 bd_t *binfo = (bd_t *)__res;
109#endif
110
74 /* Reset the Communication Processor Module. 111 /* Reset the Communication Processor Module.
75 */ 112 */
76 m8xx_cpm_reset(); 113 m8xx_cpm_reset();
@@ -106,6 +143,17 @@ m8xx_setup_arch(void)
106 } 143 }
107#endif 144#endif
108#endif 145#endif
146
147#if defined (CONFIG_MPC86XADS) || defined (CONFIG_MPC885ADS)
148#if defined(CONFIG_MTD_PHYSMAP)
149 physmap_configure(binfo->bi_flashstart, binfo->bi_flashsize,
150 MPC8xxADS_BANK_WIDTH, NULL);
151#ifdef CONFIG_MTD_PARTITIONS
152 physmap_set_partitions(mpc8xxads_partitions, mpc8xxads_part_num);
153#endif /* CONFIG_MTD_PARTITIONS */
154#endif /* CONFIG_MTD_PHYSMAP */
155#endif
156
109 board_init(); 157 board_init();
110} 158}
111 159
@@ -140,9 +188,11 @@ void __init __attribute__ ((weak))
140init_internal_rtc(void) 188init_internal_rtc(void)
141{ 189{
142 /* Disable the RTC one second and alarm interrupts. */ 190 /* Disable the RTC one second and alarm interrupts. */
143 out_be16(&((immap_t *)IMAP_ADDR)->im_sit.sit_rtcsc, in_be16(&((immap_t *)IMAP_ADDR)->im_sit.sit_rtcsc) & ~(RTCSC_SIE | RTCSC_ALE)); 191 clrbits16(&((immap_t *)IMAP_ADDR)->im_sit.sit_rtcsc, (RTCSC_SIE | RTCSC_ALE));
192
144 /* Enable the RTC */ 193 /* Enable the RTC */
145 out_be16(&((immap_t *)IMAP_ADDR)->im_sit.sit_rtcsc, in_be16(&((immap_t *)IMAP_ADDR)->im_sit.sit_rtcsc) | (RTCSC_RTF | RTCSC_RTE)); 194 setbits16(&((immap_t *)IMAP_ADDR)->im_sit.sit_rtcsc, (RTCSC_RTF | RTCSC_RTE));
195
146} 196}
147 197
148/* The decrementer counts at the system (internal) clock frequency divided by 198/* The decrementer counts at the system (internal) clock frequency divided by
@@ -159,8 +209,7 @@ void __init m8xx_calibrate_decr(void)
159 out_be32(&((immap_t *)IMAP_ADDR)->im_clkrstk.cark_sccrk, KAPWR_KEY); 209 out_be32(&((immap_t *)IMAP_ADDR)->im_clkrstk.cark_sccrk, KAPWR_KEY);
160 210
161 /* Force all 8xx processors to use divide by 16 processor clock. */ 211 /* Force all 8xx processors to use divide by 16 processor clock. */
162 out_be32(&((immap_t *)IMAP_ADDR)->im_clkrst.car_sccr, 212 setbits32(&((immap_t *)IMAP_ADDR)->im_clkrst.car_sccr, 0x02000000);
163 in_be32(&((immap_t *)IMAP_ADDR)->im_clkrst.car_sccr)|0x02000000);
164 /* Processor frequency is MHz. 213 /* Processor frequency is MHz.
165 * The value 'fp' is the number of decrementer ticks per second. 214 * The value 'fp' is the number of decrementer ticks per second.
166 */ 215 */
@@ -239,8 +288,8 @@ m8xx_restart(char *cmd)
239 __volatile__ unsigned char dummy; 288 __volatile__ unsigned char dummy;
240 289
241 local_irq_disable(); 290 local_irq_disable();
242 out_be32(&((immap_t *)IMAP_ADDR)->im_clkrst.car_plprcr, in_be32(&((immap_t *)IMAP_ADDR)->im_clkrst.car_plprcr) | 0x00000080);
243 291
292 setbits32(&((immap_t *)IMAP_ADDR)->im_clkrst.car_plprcr, 0x00000080);
244 /* Clear the ME bit in MSR to cause checkstop on machine check 293 /* Clear the ME bit in MSR to cause checkstop on machine check
245 */ 294 */
246 mtmsr(mfmsr() & ~0x1000); 295 mtmsr(mfmsr() & ~0x1000);
@@ -310,8 +359,8 @@ m8xx_init_IRQ(void)
310 i8259_init(0); 359 i8259_init(0);
311 360
312 /* The i8259 cascade interrupt must be level sensitive. */ 361 /* The i8259 cascade interrupt must be level sensitive. */
313 out_be32(&((immap_t *)IMAP_ADDR)->im_siu_conf.sc_siel, in_be32(&((immap_t *)IMAP_ADDR)->im_siu_conf.sc_siel & ~(0x80000000 >> ISA_BRIDGE_INT)));
314 362
363 clrbits32(&((immap_t *)IMAP_ADDR)->im_siu_conf.sc_siel, (0x80000000 >> ISA_BRIDGE_INT));
315 if (setup_irq(ISA_BRIDGE_INT, &mbx_i8259_irqaction)) 364 if (setup_irq(ISA_BRIDGE_INT, &mbx_i8259_irqaction))
316 enable_irq(ISA_BRIDGE_INT); 365 enable_irq(ISA_BRIDGE_INT);
317#endif /* CONFIG_PCI */ 366#endif /* CONFIG_PCI */
diff --git a/arch/ppc/syslib/m8xx_wdt.c b/arch/ppc/syslib/m8xx_wdt.c
index df6c9557b86a..ac11d7bab443 100644
--- a/arch/ppc/syslib/m8xx_wdt.c
+++ b/arch/ppc/syslib/m8xx_wdt.c
@@ -41,8 +41,7 @@ static irqreturn_t m8xx_wdt_interrupt(int irq, void *dev, struct pt_regs *regs)
41 41
42 m8xx_wdt_reset(); 42 m8xx_wdt_reset();
43 43
44 out_be16(&imap->im_sit.sit_piscr, in_be16(&imap->im_sit.sit_piscr) | PISCR_PS); /* clear irq */ 44 setbits16(&imap->im_sit.sit_piscr, PISCR_PS);
45
46 return IRQ_HANDLED; 45 return IRQ_HANDLED;
47} 46}
48 47
diff --git a/arch/ppc/syslib/mpc10x_common.c b/arch/ppc/syslib/mpc10x_common.c
index 3e039706bdbc..2fc7c4150a18 100644
--- a/arch/ppc/syslib/mpc10x_common.c
+++ b/arch/ppc/syslib/mpc10x_common.c
@@ -1,6 +1,4 @@
1/* 1/*
2 * arch/ppc/syslib/mpc10x_common.c
3 *
4 * Common routines for the Motorola SPS MPC106, MPC107 and MPC8240 Host bridge, 2 * Common routines for the Motorola SPS MPC106, MPC107 and MPC8240 Host bridge,
5 * Mem ctlr, EPIC, etc. 3 * Mem ctlr, EPIC, etc.
6 * 4 *
diff --git a/arch/ppc/syslib/mpc52xx_devices.c b/arch/ppc/syslib/mpc52xx_devices.c
index da3c74bfdc92..7487539a4e92 100644
--- a/arch/ppc/syslib/mpc52xx_devices.c
+++ b/arch/ppc/syslib/mpc52xx_devices.c
@@ -1,6 +1,4 @@
1/* 1/*
2 * arch/ppc/syslib/mpc52xx_devices.c
3 *
4 * Freescale MPC52xx device descriptions 2 * Freescale MPC52xx device descriptions
5 * 3 *
6 * 4 *
diff --git a/arch/ppc/syslib/mpc52xx_pci.c b/arch/ppc/syslib/mpc52xx_pci.c
index 313c96ec7eb1..5a5a7a9cd248 100644
--- a/arch/ppc/syslib/mpc52xx_pci.c
+++ b/arch/ppc/syslib/mpc52xx_pci.c
@@ -1,6 +1,4 @@
1/* 1/*
2 * arch/ppc/syslib/mpc52xx_pci.c
3 *
4 * PCI code for the Freescale MPC52xx embedded CPU. 2 * PCI code for the Freescale MPC52xx embedded CPU.
5 * 3 *
6 * 4 *
@@ -227,7 +225,8 @@ mpc52xx_pci_fixup_resources(struct pci_dev *dev)
227 /* The PCI Host bridge of MPC52xx has a prefetch memory resource 225 /* The PCI Host bridge of MPC52xx has a prefetch memory resource
228 fixed to 1Gb. Doesn't fit in the resource system so we remove it */ 226 fixed to 1Gb. Doesn't fit in the resource system so we remove it */
229 if ( (dev->vendor == PCI_VENDOR_ID_MOTOROLA) && 227 if ( (dev->vendor == PCI_VENDOR_ID_MOTOROLA) &&
230 (dev->device == PCI_DEVICE_ID_MOTOROLA_MPC5200) ) { 228 ( dev->device == PCI_DEVICE_ID_MOTOROLA_MPC5200
229 || dev->device == PCI_DEVICE_ID_MOTOROLA_MPC5200B) ) {
231 struct resource *res = &dev->resource[1]; 230 struct resource *res = &dev->resource[1];
232 res->start = res->end = res->flags = 0; 231 res->start = res->end = res->flags = 0;
233 } 232 }
diff --git a/arch/ppc/syslib/mpc52xx_pci.h b/arch/ppc/syslib/mpc52xx_pci.h
index 04b509a02530..77d47dbba85e 100644
--- a/arch/ppc/syslib/mpc52xx_pci.h
+++ b/arch/ppc/syslib/mpc52xx_pci.h
@@ -1,6 +1,4 @@
1/* 1/*
2 * arch/ppc/syslib/mpc52xx_pci.h
3 *
4 * PCI Include file the Freescale MPC52xx embedded cpu chips 2 * PCI Include file the Freescale MPC52xx embedded cpu chips
5 * 3 *
6 * 4 *
diff --git a/arch/ppc/syslib/mpc52xx_pic.c b/arch/ppc/syslib/mpc52xx_pic.c
index 4c4497e62517..c4406f9dc6a3 100644
--- a/arch/ppc/syslib/mpc52xx_pic.c
+++ b/arch/ppc/syslib/mpc52xx_pic.c
@@ -1,6 +1,4 @@
1/* 1/*
2 * arch/ppc/syslib/mpc52xx_pic.c
3 *
4 * Programmable Interrupt Controller functions for the Freescale MPC52xx 2 * Programmable Interrupt Controller functions for the Freescale MPC52xx
5 * embedded CPU. 3 * embedded CPU.
6 * 4 *
diff --git a/arch/ppc/syslib/mpc52xx_setup.c b/arch/ppc/syslib/mpc52xx_setup.c
index a4a4b02227df..ee6379bb415e 100644
--- a/arch/ppc/syslib/mpc52xx_setup.c
+++ b/arch/ppc/syslib/mpc52xx_setup.c
@@ -1,6 +1,4 @@
1/* 1/*
2 * arch/ppc/syslib/mpc52xx_setup.c
3 *
4 * Common code for the boards based on Freescale MPC52xx embedded CPU. 2 * Common code for the boards based on Freescale MPC52xx embedded CPU.
5 * 3 *
6 * 4 *
@@ -26,6 +24,8 @@
26#include <asm/pgtable.h> 24#include <asm/pgtable.h>
27#include <asm/ppcboot.h> 25#include <asm/ppcboot.h>
28 26
27#include <syslib/mpc52xx_pci.h>
28
29extern bd_t __res; 29extern bd_t __res;
30 30
31static int core_mult[] = { /* CPU Frequency multiplier, taken */ 31static int core_mult[] = { /* CPU Frequency multiplier, taken */
@@ -218,6 +218,52 @@ mpc52xx_calibrate_decr(void)
218 tb_to_us = mulhwu_scale_factor(xlbfreq / divisor, 1000000); 218 tb_to_us = mulhwu_scale_factor(xlbfreq / divisor, 1000000);
219} 219}
220 220
221
222void __init
223mpc52xx_setup_cpu(void)
224{
225 struct mpc52xx_cdm __iomem *cdm;
226 struct mpc52xx_xlb __iomem *xlb;
227
228 /* Map zones */
229 cdm = ioremap(MPC52xx_PA(MPC52xx_CDM_OFFSET), MPC52xx_CDM_SIZE);
230 xlb = ioremap(MPC52xx_PA(MPC52xx_XLB_OFFSET), MPC52xx_XLB_SIZE);
231
232 if (!cdm || !xlb) {
233 printk(KERN_ERR __FILE__ ": "
234 "Error while mapping CDM/XLB during "
235 "mpc52xx_setup_cpu\n");
236 goto unmap_regs;
237 }
238
239 /* Use internal 48 Mhz */
240 out_8(&cdm->ext_48mhz_en, 0x00);
241 out_8(&cdm->fd_enable, 0x01);
242 if (in_be32(&cdm->rstcfg) & 0x40) /* Assumes 33Mhz clock */
243 out_be16(&cdm->fd_counters, 0x0001);
244 else
245 out_be16(&cdm->fd_counters, 0x5555);
246
247 /* Configure the XLB Arbiter priorities */
248 out_be32(&xlb->master_pri_enable, 0xff);
249 out_be32(&xlb->master_priority, 0x11111111);
250
251 /* Enable ram snooping for 1GB window */
252 out_be32(&xlb->config, in_be32(&xlb->config) | MPC52xx_XLB_CFG_SNOOP);
253 out_be32(&xlb->snoop_window, MPC52xx_PCI_TARGET_MEM | 0x1d);
254
255 /* Disable XLB pipelining */
256 /* (cfr errate 292. We could do this only just before ATA PIO
257 transaction and re-enable it after ...) */
258 out_be32(&xlb->config, in_be32(&xlb->config) | MPC52xx_XLB_CFG_PLDIS);
259
260 /* Unmap reg zone */
261unmap_regs:
262 if (cdm) iounmap(cdm);
263 if (xlb) iounmap(xlb);
264}
265
266
221int mpc52xx_match_psc_function(int psc_idx, const char *func) 267int mpc52xx_match_psc_function(int psc_idx, const char *func)
222{ 268{
223 struct mpc52xx_psc_func *cf = mpc52xx_psc_functions; 269 struct mpc52xx_psc_func *cf = mpc52xx_psc_functions;
diff --git a/arch/ppc/syslib/mpc52xx_sys.c b/arch/ppc/syslib/mpc52xx_sys.c
index 9a0f90aa8aac..b4e6f978f057 100644
--- a/arch/ppc/syslib/mpc52xx_sys.c
+++ b/arch/ppc/syslib/mpc52xx_sys.c
@@ -1,6 +1,4 @@
1/* 1/*
2 * arch/ppc/syslib/mpc52xx_sys.c
3 *
4 * Freescale MPC52xx system descriptions 2 * Freescale MPC52xx system descriptions
5 * 3 *
6 * 4 *
diff --git a/arch/ppc/syslib/mpc83xx_devices.c b/arch/ppc/syslib/mpc83xx_devices.c
index f9b95de70e23..1af2c000fcfa 100644
--- a/arch/ppc/syslib/mpc83xx_devices.c
+++ b/arch/ppc/syslib/mpc83xx_devices.c
@@ -1,6 +1,4 @@
1/* 1/*
2 * arch/ppc/platforms/83xx/mpc83xx_devices.c
3 *
4 * MPC83xx Device descriptions 2 * MPC83xx Device descriptions
5 * 3 *
6 * Maintainer: Kumar Gala <galak@kernel.crashing.org> 4 * Maintainer: Kumar Gala <galak@kernel.crashing.org>
diff --git a/arch/ppc/syslib/mpc83xx_sys.c b/arch/ppc/syslib/mpc83xx_sys.c
index 82cf3ab77f4a..0498ae7e01e3 100644
--- a/arch/ppc/syslib/mpc83xx_sys.c
+++ b/arch/ppc/syslib/mpc83xx_sys.c
@@ -1,6 +1,4 @@
1/* 1/*
2 * arch/ppc/platforms/83xx/mpc83xx_sys.c
3 *
4 * MPC83xx System descriptions 2 * MPC83xx System descriptions
5 * 3 *
6 * Maintainer: Kumar Gala <galak@kernel.crashing.org> 4 * Maintainer: Kumar Gala <galak@kernel.crashing.org>
diff --git a/arch/ppc/syslib/mpc85xx_devices.c b/arch/ppc/syslib/mpc85xx_devices.c
index 00e9b6ff2f6e..7735336f5b8f 100644
--- a/arch/ppc/syslib/mpc85xx_devices.c
+++ b/arch/ppc/syslib/mpc85xx_devices.c
@@ -1,6 +1,4 @@
1/* 1/*
2 * arch/ppc/platforms/85xx/mpc85xx_devices.c
3 *
4 * MPC85xx Device descriptions 2 * MPC85xx Device descriptions
5 * 3 *
6 * Maintainer: Kumar Gala <galak@kernel.crashing.org> 4 * Maintainer: Kumar Gala <galak@kernel.crashing.org>
diff --git a/arch/ppc/syslib/mpc85xx_sys.c b/arch/ppc/syslib/mpc85xx_sys.c
index 397cfbcce5ea..d96a93dbcb5a 100644
--- a/arch/ppc/syslib/mpc85xx_sys.c
+++ b/arch/ppc/syslib/mpc85xx_sys.c
@@ -1,6 +1,4 @@
1/* 1/*
2 * arch/ppc/platforms/85xx/mpc85xx_sys.c
3 *
4 * MPC85xx System descriptions 2 * MPC85xx System descriptions
5 * 3 *
6 * Maintainer: Kumar Gala <galak@kernel.crashing.org> 4 * Maintainer: Kumar Gala <galak@kernel.crashing.org>
diff --git a/arch/ppc/syslib/mpc8xx_devices.c b/arch/ppc/syslib/mpc8xx_devices.c
index 92dc98b36bde..bd41ed83beb3 100644
--- a/arch/ppc/syslib/mpc8xx_devices.c
+++ b/arch/ppc/syslib/mpc8xx_devices.c
@@ -1,6 +1,4 @@
1/* 1/*
2 * arch/ppc/syslib/mpc8xx_devices.c
3 *
4 * MPC8xx Device descriptions 2 * MPC8xx Device descriptions
5 * 3 *
6 * Maintainer: Kumar Gala <galak@kernel.crashing.org> 4 * Maintainer: Kumar Gala <galak@kernel.crashing.org>
diff --git a/arch/ppc/syslib/mpc8xx_sys.c b/arch/ppc/syslib/mpc8xx_sys.c
index d3c617521603..eee213284855 100644
--- a/arch/ppc/syslib/mpc8xx_sys.c
+++ b/arch/ppc/syslib/mpc8xx_sys.c
@@ -1,6 +1,4 @@
1/* 1/*
2 * arch/ppc/platforms/mpc8xx_sys.c
3 *
4 * MPC8xx System descriptions 2 * MPC8xx System descriptions
5 * 3 *
6 * Maintainer: Kumar Gala <galak@kernel.crashing.org> 4 * Maintainer: Kumar Gala <galak@kernel.crashing.org>
diff --git a/arch/ppc/syslib/mv64360_pic.c b/arch/ppc/syslib/mv64360_pic.c
index 58b0aa813e85..5a19697060f0 100644
--- a/arch/ppc/syslib/mv64360_pic.c
+++ b/arch/ppc/syslib/mv64360_pic.c
@@ -1,6 +1,4 @@
1/* 1/*
2 * arch/ppc/kernel/mv64360_pic.c
3 *
4 * Interrupt controller support for Marvell's MV64360. 2 * Interrupt controller support for Marvell's MV64360.
5 * 3 *
6 * Author: Rabeeh Khoury <rabeeh@galileo.co.il> 4 * Author: Rabeeh Khoury <rabeeh@galileo.co.il>
diff --git a/arch/ppc/syslib/mv64x60.c b/arch/ppc/syslib/mv64x60.c
index 1f01b7e2376b..3b039c30a439 100644
--- a/arch/ppc/syslib/mv64x60.c
+++ b/arch/ppc/syslib/mv64x60.c
@@ -1,6 +1,4 @@
1/* 1/*
2 * arch/ppc/syslib/mv64x60.c
3 *
4 * Common routines for the Marvell/Galileo Discovery line of host bridges 2 * Common routines for the Marvell/Galileo Discovery line of host bridges
5 * (gt64260, mv64360, mv64460, ...). 3 * (gt64260, mv64360, mv64460, ...).
6 * 4 *
diff --git a/arch/ppc/syslib/mv64x60_dbg.c b/arch/ppc/syslib/mv64x60_dbg.c
index fa5b2e45e0ca..9cf18764a1a1 100644
--- a/arch/ppc/syslib/mv64x60_dbg.c
+++ b/arch/ppc/syslib/mv64x60_dbg.c
@@ -1,6 +1,4 @@
1/* 1/*
2 * arch/ppc/syslib/mv64x60_dbg.c
3 *
4 * KGDB and progress routines for the Marvell/Galileo MV64x60 (Discovery). 2 * KGDB and progress routines for the Marvell/Galileo MV64x60 (Discovery).
5 * 3 *
6 * Author: Mark A. Greer <mgreer@mvista.com> 4 * Author: Mark A. Greer <mgreer@mvista.com>
diff --git a/arch/ppc/syslib/mv64x60_win.c b/arch/ppc/syslib/mv64x60_win.c
index 5b827e2bbe22..4bf1ad17bf1a 100644
--- a/arch/ppc/syslib/mv64x60_win.c
+++ b/arch/ppc/syslib/mv64x60_win.c
@@ -1,6 +1,4 @@
1/* 1/*
2 * arch/ppc/syslib/mv64x60_win.c
3 *
4 * Tables with info on how to manipulate the 32 & 64 bit windows on the 2 * Tables with info on how to manipulate the 32 & 64 bit windows on the
5 * various types of Marvell bridge chips. 3 * various types of Marvell bridge chips.
6 * 4 *
diff --git a/arch/ppc/syslib/ocp.c b/arch/ppc/syslib/ocp.c
index 2fe28ded2c60..a4ecc2ee579f 100644
--- a/arch/ppc/syslib/ocp.c
+++ b/arch/ppc/syslib/ocp.c
@@ -451,10 +451,9 @@ ocp_driver_init(void)
451 DBG(("ocp: ocp_driver_init()...\n")); 451 DBG(("ocp: ocp_driver_init()...\n"));
452 452
453 /* Allocate/register primary OCP bus */ 453 /* Allocate/register primary OCP bus */
454 ocp_bus = kmalloc(sizeof(struct device), GFP_KERNEL); 454 ocp_bus = kzalloc(sizeof(struct device), GFP_KERNEL);
455 if (ocp_bus == NULL) 455 if (ocp_bus == NULL)
456 return 1; 456 return 1;
457 memset(ocp_bus, 0, sizeof(struct device));
458 strcpy(ocp_bus->bus_id, "ocp"); 457 strcpy(ocp_bus->bus_id, "ocp");
459 458
460 bus_register(&ocp_bus_type); 459 bus_register(&ocp_bus_type);
diff --git a/arch/ppc/syslib/open_pic.c b/arch/ppc/syslib/open_pic.c
index 894779712b46..70456c8f998c 100644
--- a/arch/ppc/syslib/open_pic.c
+++ b/arch/ppc/syslib/open_pic.c
@@ -1,6 +1,4 @@
1/* 1/*
2 * arch/ppc/kernel/open_pic.c -- OpenPIC Interrupt Handling
3 *
4 * Copyright (C) 1997 Geert Uytterhoeven 2 * Copyright (C) 1997 Geert Uytterhoeven
5 * 3 *
6 * This file is subject to the terms and conditions of the GNU General Public 4 * This file is subject to the terms and conditions of the GNU General Public
@@ -218,7 +216,7 @@ static void openpic_safe_writefield(volatile u_int __iomem *addr, u_int mask,
218u_int openpic_read_IPI(volatile u_int __iomem * addr) 216u_int openpic_read_IPI(volatile u_int __iomem * addr)
219{ 217{
220 u_int val = 0; 218 u_int val = 0;
221#if defined(OPENPIC_BIG_ENDIAN) || defined(CONFIG_POWER3) 219#if defined(OPENPIC_BIG_ENDIAN)
222 val = in_be32(addr); 220 val = in_be32(addr);
223#else 221#else
224 val = in_le32(addr); 222 val = in_le32(addr);
diff --git a/arch/ppc/syslib/open_pic2.c b/arch/ppc/syslib/open_pic2.c
index 1c40049b9a45..bcbe40de26fe 100644
--- a/arch/ppc/syslib/open_pic2.c
+++ b/arch/ppc/syslib/open_pic2.c
@@ -1,6 +1,4 @@
1/* 1/*
2 * arch/ppc/kernel/open_pic.c -- OpenPIC Interrupt Handling
3 *
4 * Copyright (C) 1997 Geert Uytterhoeven 2 * Copyright (C) 1997 Geert Uytterhoeven
5 * 3 *
6 * This file is subject to the terms and conditions of the GNU General Public 4 * This file is subject to the terms and conditions of the GNU General Public
diff --git a/arch/ppc/syslib/open_pic_defs.h b/arch/ppc/syslib/open_pic_defs.h
index 6c94e7131463..3a25de7cb572 100644
--- a/arch/ppc/syslib/open_pic_defs.h
+++ b/arch/ppc/syslib/open_pic_defs.h
@@ -1,6 +1,4 @@
1/* 1/*
2 * arch/ppc/kernel/open_pic_defs.h -- OpenPIC definitions
3 *
4 * Copyright (C) 1997 Geert Uytterhoeven 2 * Copyright (C) 1997 Geert Uytterhoeven
5 * 3 *
6 * This file is based on the following documentation: 4 * This file is based on the following documentation:
diff --git a/arch/ppc/syslib/pci_auto.c b/arch/ppc/syslib/pci_auto.c
index d64207c2a972..ee20a86fcc4b 100644
--- a/arch/ppc/syslib/pci_auto.c
+++ b/arch/ppc/syslib/pci_auto.c
@@ -1,6 +1,4 @@
1/* 1/*
2 * arch/ppc/syslib/pci_auto.c
3 *
4 * PCI autoconfiguration library 2 * PCI autoconfiguration library
5 * 3 *
6 * Author: Matt Porter <mporter@mvista.com> 4 * Author: Matt Porter <mporter@mvista.com>
diff --git a/arch/ppc/syslib/ppc4xx_dma.c b/arch/ppc/syslib/ppc4xx_dma.c
index 05ccd598dd4e..b40b96a8c609 100644
--- a/arch/ppc/syslib/ppc4xx_dma.c
+++ b/arch/ppc/syslib/ppc4xx_dma.c
@@ -1,6 +1,4 @@
1/* 1/*
2 * arch/ppc/kernel/ppc4xx_dma.c
3 *
4 * IBM PPC4xx DMA engine core library 2 * IBM PPC4xx DMA engine core library
5 * 3 *
6 * Copyright 2000-2004 MontaVista Software Inc. 4 * Copyright 2000-2004 MontaVista Software Inc.
diff --git a/arch/ppc/syslib/ppc4xx_pic.c b/arch/ppc/syslib/ppc4xx_pic.c
index aa4165144ec2..fd9af0fc0e9f 100644
--- a/arch/ppc/syslib/ppc4xx_pic.c
+++ b/arch/ppc/syslib/ppc4xx_pic.c
@@ -1,6 +1,4 @@
1/* 1/*
2 * arch/ppc/syslib/ppc4xx_pic.c
3 *
4 * Interrupt controller driver for PowerPC 4xx-based processors. 2 * Interrupt controller driver for PowerPC 4xx-based processors.
5 * 3 *
6 * Eugene Surovegin <eugene.surovegin@zultys.com> or <ebs@ebshome.net> 4 * Eugene Surovegin <eugene.surovegin@zultys.com> or <ebs@ebshome.net>
diff --git a/arch/ppc/syslib/ppc4xx_pm.c b/arch/ppc/syslib/ppc4xx_pm.c
deleted file mode 100644
index 60a479204885..000000000000
--- a/arch/ppc/syslib/ppc4xx_pm.c
+++ /dev/null
@@ -1,47 +0,0 @@
1/*
2 * Author: Armin Kuster <akuster@mvista.com>
3 *
4 * 2002 (c) MontaVista, Software, Inc. This file is licensed under
5 * the terms of the GNU General Public License version 2. This program
6 * is licensed "as is" without any warranty of any kind, whether express
7 * or implied.
8 *
9 * This an attempt to get Power Management going for the IBM 4xx processor.
10 * This was derived from the ppc4xx._setup.c file
11 */
12
13#include <linux/config.h>
14#include <linux/init.h>
15
16#include <asm/ibm4xx.h>
17
18void __init
19ppc4xx_pm_init(void)
20{
21
22 unsigned int value = 0;
23
24 /* turn off unused hardware to save power */
25#ifdef CONFIG_405GP
26 value |= CPM_DCP; /* CodePack */
27#endif
28
29#if !defined(CONFIG_IBM_OCP_GPIO)
30 value |= CPM_GPIO0;
31#endif
32
33#if !defined(CONFIG_PPC405_I2C_ADAP)
34 value |= CPM_IIC0;
35#ifdef CONFIG_STB03xxx
36 value |= CPM_IIC1;
37#endif
38#endif
39
40
41#if !defined(CONFIG_405_DMA)
42 value |= CPM_DMA;
43#endif
44
45 mtdcr(DCRN_CPMFR, value);
46
47}
diff --git a/arch/ppc/syslib/ppc4xx_sgdma.c b/arch/ppc/syslib/ppc4xx_sgdma.c
index 9f76e8ee39ed..280ea010a9c8 100644
--- a/arch/ppc/syslib/ppc4xx_sgdma.c
+++ b/arch/ppc/syslib/ppc4xx_sgdma.c
@@ -1,6 +1,4 @@
1/* 1/*
2 * arch/ppc/kernel/ppc4xx_sgdma.c
3 *
4 * IBM PPC4xx DMA engine scatter/gather library 2 * IBM PPC4xx DMA engine scatter/gather library
5 * 3 *
6 * Copyright 2002-2003 MontaVista Software Inc. 4 * Copyright 2002-2003 MontaVista Software Inc.
diff --git a/arch/ppc/syslib/ppc83xx_setup.c b/arch/ppc/syslib/ppc83xx_setup.c
index 7bada82527a8..26afd637dc81 100644
--- a/arch/ppc/syslib/ppc83xx_setup.c
+++ b/arch/ppc/syslib/ppc83xx_setup.c
@@ -1,6 +1,4 @@
1/* 1/*
2 * arch/ppc/syslib/ppc83xx_setup.c
3 *
4 * MPC83XX common board code 2 * MPC83XX common board code
5 * 3 *
6 * Maintainer: Kumar Gala <galak@kernel.crashing.org> 4 * Maintainer: Kumar Gala <galak@kernel.crashing.org>
diff --git a/arch/ppc/syslib/ppc83xx_setup.h b/arch/ppc/syslib/ppc83xx_setup.h
index a122a7322e5e..478b011cd963 100644
--- a/arch/ppc/syslib/ppc83xx_setup.h
+++ b/arch/ppc/syslib/ppc83xx_setup.h
@@ -1,6 +1,4 @@
1/* 1/*
2 * arch/ppc/syslib/ppc83xx_setup.h
3 *
4 * MPC83XX common board definitions 2 * MPC83XX common board definitions
5 * 3 *
6 * Maintainer: Kumar Gala <galak@kernel.crashing.org> 4 * Maintainer: Kumar Gala <galak@kernel.crashing.org>
diff --git a/arch/ppc/syslib/ppc85xx_common.c b/arch/ppc/syslib/ppc85xx_common.c
index 19ad537225e4..0145c968f9ad 100644
--- a/arch/ppc/syslib/ppc85xx_common.c
+++ b/arch/ppc/syslib/ppc85xx_common.c
@@ -1,6 +1,4 @@
1/* 1/*
2 * arch/ppc/syslib/ppc85xx_common.c
3 *
4 * MPC85xx support routines 2 * MPC85xx support routines
5 * 3 *
6 * Maintainer: Kumar Gala <galak@kernel.crashing.org> 4 * Maintainer: Kumar Gala <galak@kernel.crashing.org>
diff --git a/arch/ppc/syslib/ppc85xx_common.h b/arch/ppc/syslib/ppc85xx_common.h
index 94edf32151dd..182744a1321c 100644
--- a/arch/ppc/syslib/ppc85xx_common.h
+++ b/arch/ppc/syslib/ppc85xx_common.h
@@ -1,6 +1,4 @@
1/* 1/*
2 * arch/ppc/syslib/ppc85xx_common.h
3 *
4 * MPC85xx support routines 2 * MPC85xx support routines
5 * 3 *
6 * Maintainer: Kumar Gala <galak@kernel.crashing.org> 4 * Maintainer: Kumar Gala <galak@kernel.crashing.org>
diff --git a/arch/ppc/syslib/ppc85xx_setup.c b/arch/ppc/syslib/ppc85xx_setup.c
index e4dda43fdaa7..79b7089d7500 100644
--- a/arch/ppc/syslib/ppc85xx_setup.c
+++ b/arch/ppc/syslib/ppc85xx_setup.c
@@ -1,6 +1,4 @@
1/* 1/*
2 * arch/ppc/syslib/ppc85xx_setup.c
3 *
4 * MPC85XX common board code 2 * MPC85XX common board code
5 * 3 *
6 * Maintainer: Kumar Gala <galak@kernel.crashing.org> 4 * Maintainer: Kumar Gala <galak@kernel.crashing.org>
@@ -237,7 +235,7 @@ mpc85xx_setup_pci2(struct pci_controller *hose)
237 (__ilog2(MPC85XX_PCI2_UPPER_MEM - MPC85XX_PCI2_LOWER_MEM + 1) - 1); 235 (__ilog2(MPC85XX_PCI2_UPPER_MEM - MPC85XX_PCI2_LOWER_MEM + 1) - 1);
238 236
239 /* Setup outbound IO windows @ MPC85XX_PCI2_IO_BASE */ 237 /* Setup outbound IO windows @ MPC85XX_PCI2_IO_BASE */
240 pci->potar2 = (MPC85XX_PCI2_LOWER_IO >> 12) & 0x000fffff;; 238 pci->potar2 = (MPC85XX_PCI2_LOWER_IO >> 12) & 0x000fffff;
241 pci->potear2 = 0x00000000; 239 pci->potear2 = 0x00000000;
242 pci->powbar2 = (MPC85XX_PCI2_IO_BASE >> 12) & 0x000fffff; 240 pci->powbar2 = (MPC85XX_PCI2_IO_BASE >> 12) & 0x000fffff;
243 /* Enable, IO R/W */ 241 /* Enable, IO R/W */
diff --git a/arch/ppc/syslib/ppc85xx_setup.h b/arch/ppc/syslib/ppc85xx_setup.h
index e340b0545fb5..f55b8032d3d9 100644
--- a/arch/ppc/syslib/ppc85xx_setup.h
+++ b/arch/ppc/syslib/ppc85xx_setup.h
@@ -1,6 +1,4 @@
1/* 1/*
2 * arch/ppc/syslib/ppc85xx_setup.h
3 *
4 * MPC85XX common board definitions 2 * MPC85XX common board definitions
5 * 3 *
6 * Maintainer: Kumar Gala <galak@kernel.crashing.org> 4 * Maintainer: Kumar Gala <galak@kernel.crashing.org>
diff --git a/arch/ppc/syslib/ppc_sys.c b/arch/ppc/syslib/ppc_sys.c
index c0b93c4191ee..60c724e11584 100644
--- a/arch/ppc/syslib/ppc_sys.c
+++ b/arch/ppc/syslib/ppc_sys.c
@@ -1,6 +1,4 @@
1/* 1/*
2 * arch/ppc/syslib/ppc_sys.c
3 *
4 * PPC System library functions 2 * PPC System library functions
5 * 3 *
6 * Maintainer: Kumar Gala <galak@kernel.crashing.org> 4 * Maintainer: Kumar Gala <galak@kernel.crashing.org>
@@ -15,11 +13,22 @@
15 */ 13 */
16 14
17#include <linux/string.h> 15#include <linux/string.h>
16#include <linux/bootmem.h>
18#include <asm/ppc_sys.h> 17#include <asm/ppc_sys.h>
19 18
20int (*ppc_sys_device_fixup) (struct platform_device * pdev); 19int (*ppc_sys_device_fixup) (struct platform_device * pdev);
21 20
22static int ppc_sys_inited; 21static int ppc_sys_inited;
22static int ppc_sys_func_inited;
23
24static const char *ppc_sys_func_names[] = {
25 [PPC_SYS_FUNC_DUMMY] = "dummy",
26 [PPC_SYS_FUNC_ETH] = "eth",
27 [PPC_SYS_FUNC_UART] = "uart",
28 [PPC_SYS_FUNC_HLDC] = "hldc",
29 [PPC_SYS_FUNC_USB] = "usb",
30 [PPC_SYS_FUNC_IRDA] = "irda",
31};
23 32
24void __init identify_ppc_sys_by_id(u32 id) 33void __init identify_ppc_sys_by_id(u32 id)
25{ 34{
@@ -38,13 +47,13 @@ void __init identify_ppc_sys_by_id(u32 id)
38void __init identify_ppc_sys_by_name(char *name) 47void __init identify_ppc_sys_by_name(char *name)
39{ 48{
40 unsigned int i = 0; 49 unsigned int i = 0;
41 while (ppc_sys_specs[i].ppc_sys_name[0]) 50 while (ppc_sys_specs[i].ppc_sys_name[0]) {
42 {
43 if (!strcmp(ppc_sys_specs[i].ppc_sys_name, name)) 51 if (!strcmp(ppc_sys_specs[i].ppc_sys_name, name))
44 break; 52 break;
45 i++; 53 i++;
46 } 54 }
47 cur_ppc_sys_spec = &ppc_sys_specs[i]; 55 cur_ppc_sys_spec = &ppc_sys_specs[i];
56
48 return; 57 return;
49} 58}
50 59
@@ -128,6 +137,165 @@ void ppc_sys_device_remove(enum ppc_sys_devices dev)
128 } 137 }
129} 138}
130 139
140/* Platform-notify mapping
141 * Helper function for BSP code to assign board-specific platfom-divice bits
142 */
143
144void platform_notify_map(const struct platform_notify_dev_map *map,
145 struct device *dev)
146{
147 struct platform_device *pdev;
148 int len, idx;
149 const char *s;
150
151 /* do nothing if no device or no bus_id */
152 if (!dev || !dev->bus_id)
153 return;
154
155 /* call per device map */
156 while (map->bus_id != NULL) {
157 idx = -1;
158 s = strrchr(dev->bus_id, '.');
159 if (s != NULL)
160 idx = (int)simple_strtol(s + 1, NULL, 10);
161 else
162 s = dev->bus_id;
163
164 len = s - dev->bus_id;
165
166 if (!strncmp(dev->bus_id, map->bus_id, len)) {
167 pdev = container_of(dev, struct platform_device, dev);
168 map->rtn(pdev, idx);
169 }
170 map++;
171 }
172}
173
174/*
175 Function assignment stuff.
176 Intended to work as follows:
177 the device name defined in foo_devices.c will be concatenated with :"func",
178 where func is string map of respective function from platfom_device_func enum
179
180 The PPC_SYS_FUNC_DUMMY function is intended to remove all assignments, making the device to appear
181 in platform bus with unmodified name.
182 */
183
184/*
185 Here we'll replace .name pointers with fixed-lenght strings
186 Hereby, this should be called *before* any func stuff triggeded.
187 */
188void ppc_sys_device_initfunc(void)
189{
190 int i;
191 const char *name;
192 static char new_names[NUM_PPC_SYS_DEVS][BUS_ID_SIZE];
193 enum ppc_sys_devices cur_dev;
194
195 /* If inited yet, do nothing */
196 if (ppc_sys_func_inited)
197 return;
198
199 for (i = 0; i < cur_ppc_sys_spec->num_devices; i++) {
200 if ((cur_dev = cur_ppc_sys_spec->device_list[i]) < 0)
201 continue;
202
203 if (ppc_sys_platform_devices[cur_dev].name) {
204 /*backup name */
205 name = ppc_sys_platform_devices[cur_dev].name;
206 strlcpy(new_names[i], name, BUS_ID_SIZE);
207 ppc_sys_platform_devices[cur_dev].name = new_names[i];
208 }
209 }
210
211 ppc_sys_func_inited = 1;
212}
213
214/*The "engine" of the func stuff. Here we either concat specified function string description
215 to the name, or remove it if PPC_SYS_FUNC_DUMMY parameter is passed here*/
216void ppc_sys_device_setfunc(enum ppc_sys_devices dev,
217 enum platform_device_func func)
218{
219 char *s;
220 char *name = (char *)ppc_sys_platform_devices[dev].name;
221 char tmp[BUS_ID_SIZE];
222
223 if (!ppc_sys_func_inited) {
224 printk(KERN_ERR "Unable to alter function - not inited!\n");
225 return;
226 }
227
228 if (ppc_sys_inited) {
229 platform_device_unregister(&ppc_sys_platform_devices[dev]);
230 }
231
232 if ((s = (char *)strchr(name, ':')) != NULL) { /* reassign */
233 /* Either change the name after ':' or remove func modifications */
234 if (func != PPC_SYS_FUNC_DUMMY)
235 strlcpy(s + 1, ppc_sys_func_names[func], BUS_ID_SIZE);
236 else
237 *s = 0;
238 } else if (func != PPC_SYS_FUNC_DUMMY) {
239 /* do assignment if it is not just "clear" request */
240 sprintf(tmp, "%s:%s", name, ppc_sys_func_names[func]);
241 strlcpy(name, tmp, BUS_ID_SIZE);
242 }
243
244 if (ppc_sys_inited) {
245 platform_device_register(&ppc_sys_platform_devices[dev]);
246 }
247}
248
249void ppc_sys_device_disable(enum ppc_sys_devices dev)
250{
251 BUG_ON(cur_ppc_sys_spec == NULL);
252
253 /*Check if it is enabled*/
254 if(!(cur_ppc_sys_spec->config[dev] & PPC_SYS_CONFIG_DISABLED)) {
255 if (ppc_sys_inited) {
256 platform_device_unregister(&ppc_sys_platform_devices[dev]);
257 }
258 cur_ppc_sys_spec->config[dev] |= PPC_SYS_CONFIG_DISABLED;
259 }
260}
261
262void ppc_sys_device_enable(enum ppc_sys_devices dev)
263{
264 BUG_ON(cur_ppc_sys_spec == NULL);
265
266 /*Check if it is disabled*/
267 if(cur_ppc_sys_spec->config[dev] & PPC_SYS_CONFIG_DISABLED) {
268 if (ppc_sys_inited) {
269 platform_device_register(&ppc_sys_platform_devices[dev]);
270 }
271 cur_ppc_sys_spec->config[dev] &= ~PPC_SYS_CONFIG_DISABLED;
272 }
273
274}
275
276void ppc_sys_device_enable_all(void)
277{
278 enum ppc_sys_devices cur_dev;
279 int i;
280
281 for (i = 0; i < cur_ppc_sys_spec->num_devices; i++) {
282 cur_dev = cur_ppc_sys_spec->device_list[i];
283 ppc_sys_device_enable(cur_dev);
284 }
285}
286
287void ppc_sys_device_disable_all(void)
288{
289 enum ppc_sys_devices cur_dev;
290 int i;
291
292 for (i = 0; i < cur_ppc_sys_spec->num_devices; i++) {
293 cur_dev = cur_ppc_sys_spec->device_list[i];
294 ppc_sys_device_disable(cur_dev);
295 }
296}
297
298
131static int __init ppc_sys_init(void) 299static int __init ppc_sys_init(void)
132{ 300{
133 unsigned int i, dev_id, ret = 0; 301 unsigned int i, dev_id, ret = 0;
@@ -136,7 +304,8 @@ static int __init ppc_sys_init(void)
136 304
137 for (i = 0; i < cur_ppc_sys_spec->num_devices; i++) { 305 for (i = 0; i < cur_ppc_sys_spec->num_devices; i++) {
138 dev_id = cur_ppc_sys_spec->device_list[i]; 306 dev_id = cur_ppc_sys_spec->device_list[i];
139 if (dev_id != -1) { 307 if ((dev_id != -1) &&
308 !(cur_ppc_sys_spec->config[dev_id] & PPC_SYS_CONFIG_DISABLED)) {
140 if (ppc_sys_device_fixup != NULL) 309 if (ppc_sys_device_fixup != NULL)
141 ppc_sys_device_fixup(&ppc_sys_platform_devices 310 ppc_sys_device_fixup(&ppc_sys_platform_devices
142 [dev_id]); 311 [dev_id]);
diff --git a/arch/ppc/syslib/pq2_devices.c b/arch/ppc/syslib/pq2_devices.c
index 6ff3aab82fc3..0636aed7b827 100644
--- a/arch/ppc/syslib/pq2_devices.c
+++ b/arch/ppc/syslib/pq2_devices.c
@@ -1,6 +1,4 @@
1/* 1/*
2 * arch/ppc/syslib/pq2_devices.c
3 *
4 * PQ2 Device descriptions 2 * PQ2 Device descriptions
5 * 3 *
6 * Maintainer: Kumar Gala <galak@kernel.crashing.org> 4 * Maintainer: Kumar Gala <galak@kernel.crashing.org>
diff --git a/arch/ppc/syslib/pq2_sys.c b/arch/ppc/syslib/pq2_sys.c
index 36d6e2179940..75e64f1c144d 100644
--- a/arch/ppc/syslib/pq2_sys.c
+++ b/arch/ppc/syslib/pq2_sys.c
@@ -1,6 +1,4 @@
1/* 1/*
2 * arch/ppc/syslib/pq2_devices.c
3 *
4 * PQ2 System descriptions 2 * PQ2 System descriptions
5 * 3 *
6 * Maintainer: Kumar Gala <galak@kernel.crashing.org> 4 * Maintainer: Kumar Gala <galak@kernel.crashing.org>
diff --git a/arch/ppc/syslib/prep_nvram.c b/arch/ppc/syslib/prep_nvram.c
index 2c6364d9641f..474dccbc4a8a 100644
--- a/arch/ppc/syslib/prep_nvram.c
+++ b/arch/ppc/syslib/prep_nvram.c
@@ -1,6 +1,4 @@
1/* 1/*
2 * arch/ppc/kernel/prep_nvram.c
3 *
4 * Copyright (C) 1998 Corey Minyard 2 * Copyright (C) 1998 Corey Minyard
5 * 3 *
6 * This reads the NvRAM on PReP compliant machines (generally from IBM or 4 * This reads the NvRAM on PReP compliant machines (generally from IBM or
diff --git a/arch/ppc/syslib/prom.c b/arch/ppc/syslib/prom.c
deleted file mode 100644
index 482f837fd373..000000000000
--- a/arch/ppc/syslib/prom.c
+++ /dev/null
@@ -1,1429 +0,0 @@
1/*
2 * Procedures for interfacing to the Open Firmware PROM on
3 * Power Macintosh computers.
4 *
5 * In particular, we are interested in the device tree
6 * and in using some of its services (exit, write to stdout).
7 *
8 * Paul Mackerras August 1996.
9 * Copyright (C) 1996 Paul Mackerras.
10 */
11#include <stdarg.h>
12#include <linux/config.h>
13#include <linux/kernel.h>
14#include <linux/string.h>
15#include <linux/init.h>
16#include <linux/threads.h>
17#include <linux/spinlock.h>
18#include <linux/ioport.h>
19#include <linux/pci.h>
20#include <linux/slab.h>
21#include <linux/bitops.h>
22
23#include <asm/sections.h>
24#include <asm/prom.h>
25#include <asm/page.h>
26#include <asm/processor.h>
27#include <asm/irq.h>
28#include <asm/io.h>
29#include <asm/smp.h>
30#include <asm/bootx.h>
31#include <asm/system.h>
32#include <asm/mmu.h>
33#include <asm/pgtable.h>
34#include <asm/bootinfo.h>
35#include <asm/btext.h>
36#include <asm/pci-bridge.h>
37#include <asm/open_pic.h>
38
39
40struct pci_address {
41 unsigned a_hi;
42 unsigned a_mid;
43 unsigned a_lo;
44};
45
46struct pci_reg_property {
47 struct pci_address addr;
48 unsigned size_hi;
49 unsigned size_lo;
50};
51
52struct isa_reg_property {
53 unsigned space;
54 unsigned address;
55 unsigned size;
56};
57
58typedef unsigned long interpret_func(struct device_node *, unsigned long,
59 int, int);
60static interpret_func interpret_pci_props;
61static interpret_func interpret_dbdma_props;
62static interpret_func interpret_isa_props;
63static interpret_func interpret_macio_props;
64static interpret_func interpret_root_props;
65
66extern char *klimit;
67
68/* Set for a newworld or CHRP machine */
69int use_of_interrupt_tree;
70struct device_node *dflt_interrupt_controller;
71int num_interrupt_controllers;
72
73extern unsigned int rtas_entry; /* physical pointer */
74
75extern struct device_node *allnodes;
76
77static unsigned long finish_node(struct device_node *, unsigned long,
78 interpret_func *, int, int);
79static unsigned long finish_node_interrupts(struct device_node *, unsigned long);
80static struct device_node *find_phandle(phandle);
81
82extern void enter_rtas(void *);
83void phys_call_rtas(int, int, int, ...);
84
85extern char cmd_line[512]; /* XXX */
86extern boot_infos_t *boot_infos;
87unsigned long dev_tree_size;
88
89void
90phys_call_rtas(int service, int nargs, int nret, ...)
91{
92 va_list list;
93 union {
94 unsigned long words[16];
95 double align;
96 } u;
97 void (*rtas)(void *, unsigned long);
98 int i;
99
100 u.words[0] = service;
101 u.words[1] = nargs;
102 u.words[2] = nret;
103 va_start(list, nret);
104 for (i = 0; i < nargs; ++i)
105 u.words[i+3] = va_arg(list, unsigned long);
106 va_end(list);
107
108 rtas = (void (*)(void *, unsigned long)) rtas_entry;
109 rtas(&u, rtas_data);
110}
111
112/*
113 * finish_device_tree is called once things are running normally
114 * (i.e. with text and data mapped to the address they were linked at).
115 * It traverses the device tree and fills in the name, type,
116 * {n_}addrs and {n_}intrs fields of each node.
117 */
118void __init
119finish_device_tree(void)
120{
121 unsigned long mem = (unsigned long) klimit;
122 struct device_node *np;
123
124 /* All CHRPs now use the interrupt tree */
125 for (np = allnodes; np != NULL; np = np->allnext) {
126 if (get_property(np, "interrupt-parent", NULL)) {
127 use_of_interrupt_tree = 1;
128 break;
129 }
130 }
131
132 if (use_of_interrupt_tree) {
133 /*
134 * We want to find out here how many interrupt-controller
135 * nodes there are, and if we are booted from BootX,
136 * we need a pointer to the first (and hopefully only)
137 * such node. But we can't use find_devices here since
138 * np->name has not been set yet. -- paulus
139 */
140 int n = 0;
141 char *name, *ic;
142 int iclen;
143
144 for (np = allnodes; np != NULL; np = np->allnext) {
145 ic = get_property(np, "interrupt-controller", &iclen);
146 name = get_property(np, "name", NULL);
147 /* checking iclen makes sure we don't get a false
148 match on /chosen.interrupt_controller */
149 if ((name != NULL
150 && strcmp(name, "interrupt-controller") == 0)
151 || (ic != NULL && iclen == 0 && strcmp(name, "AppleKiwi"))) {
152 if (n == 0)
153 dflt_interrupt_controller = np;
154 ++n;
155 }
156 }
157 num_interrupt_controllers = n;
158 }
159
160 mem = finish_node(allnodes, mem, NULL, 1, 1);
161 dev_tree_size = mem - (unsigned long) allnodes;
162 klimit = (char *) mem;
163}
164
165static unsigned long __init
166finish_node(struct device_node *np, unsigned long mem_start,
167 interpret_func *ifunc, int naddrc, int nsizec)
168{
169 struct device_node *child;
170 int *ip;
171
172 np->name = get_property(np, "name", NULL);
173 np->type = get_property(np, "device_type", NULL);
174
175 if (!np->name)
176 np->name = "<NULL>";
177 if (!np->type)
178 np->type = "<NULL>";
179
180 /* get the device addresses and interrupts */
181 if (ifunc != NULL)
182 mem_start = ifunc(np, mem_start, naddrc, nsizec);
183
184 if (use_of_interrupt_tree)
185 mem_start = finish_node_interrupts(np, mem_start);
186
187 /* Look for #address-cells and #size-cells properties. */
188 ip = (int *) get_property(np, "#address-cells", NULL);
189 if (ip != NULL)
190 naddrc = *ip;
191 ip = (int *) get_property(np, "#size-cells", NULL);
192 if (ip != NULL)
193 nsizec = *ip;
194
195 if (np->parent == NULL)
196 ifunc = interpret_root_props;
197 else if (np->type == 0)
198 ifunc = NULL;
199 else if (!strcmp(np->type, "pci") || !strcmp(np->type, "vci"))
200 ifunc = interpret_pci_props;
201 else if (!strcmp(np->type, "dbdma"))
202 ifunc = interpret_dbdma_props;
203 else if (!strcmp(np->type, "mac-io")
204 || ifunc == interpret_macio_props)
205 ifunc = interpret_macio_props;
206 else if (!strcmp(np->type, "isa"))
207 ifunc = interpret_isa_props;
208 else if (!strcmp(np->name, "uni-n") || !strcmp(np->name, "u3"))
209 ifunc = interpret_root_props;
210 else if (!((ifunc == interpret_dbdma_props
211 || ifunc == interpret_macio_props)
212 && (!strcmp(np->type, "escc")
213 || !strcmp(np->type, "media-bay"))))
214 ifunc = NULL;
215
216 /* if we were booted from BootX, convert the full name */
217 if (boot_infos
218 && strncmp(np->full_name, "Devices:device-tree", 19) == 0) {
219 if (np->full_name[19] == 0) {
220 strcpy(np->full_name, "/");
221 } else if (np->full_name[19] == ':') {
222 char *p = np->full_name + 19;
223 np->full_name = p;
224 for (; *p; ++p)
225 if (*p == ':')
226 *p = '/';
227 }
228 }
229
230 for (child = np->child; child != NULL; child = child->sibling)
231 mem_start = finish_node(child, mem_start, ifunc,
232 naddrc, nsizec);
233
234 return mem_start;
235}
236
237/*
238 * Find the interrupt parent of a node.
239 */
240static struct device_node * __init
241intr_parent(struct device_node *p)
242{
243 phandle *parp;
244
245 parp = (phandle *) get_property(p, "interrupt-parent", NULL);
246 if (parp == NULL)
247 return p->parent;
248 p = find_phandle(*parp);
249 if (p != NULL)
250 return p;
251 /*
252 * On a powermac booted with BootX, we don't get to know the
253 * phandles for any nodes, so find_phandle will return NULL.
254 * Fortunately these machines only have one interrupt controller
255 * so there isn't in fact any ambiguity. -- paulus
256 */
257 if (num_interrupt_controllers == 1)
258 p = dflt_interrupt_controller;
259 return p;
260}
261
262/*
263 * Find out the size of each entry of the interrupts property
264 * for a node.
265 */
266static int __init
267prom_n_intr_cells(struct device_node *np)
268{
269 struct device_node *p;
270 unsigned int *icp;
271
272 for (p = np; (p = intr_parent(p)) != NULL; ) {
273 icp = (unsigned int *)
274 get_property(p, "#interrupt-cells", NULL);
275 if (icp != NULL)
276 return *icp;
277 if (get_property(p, "interrupt-controller", NULL) != NULL
278 || get_property(p, "interrupt-map", NULL) != NULL) {
279 printk("oops, node %s doesn't have #interrupt-cells\n",
280 p->full_name);
281 return 1;
282 }
283 }
284 printk("prom_n_intr_cells failed for %s\n", np->full_name);
285 return 1;
286}
287
288/*
289 * Map an interrupt from a device up to the platform interrupt
290 * descriptor.
291 */
292static int __init
293map_interrupt(unsigned int **irq, struct device_node **ictrler,
294 struct device_node *np, unsigned int *ints, int nintrc)
295{
296 struct device_node *p, *ipar;
297 unsigned int *imap, *imask, *ip;
298 int i, imaplen, match;
299 int newintrc = 1, newaddrc = 1;
300 unsigned int *reg;
301 int naddrc;
302
303 reg = (unsigned int *) get_property(np, "reg", NULL);
304 naddrc = prom_n_addr_cells(np);
305 p = intr_parent(np);
306 while (p != NULL) {
307 if (get_property(p, "interrupt-controller", NULL) != NULL)
308 /* this node is an interrupt controller, stop here */
309 break;
310 imap = (unsigned int *)
311 get_property(p, "interrupt-map", &imaplen);
312 if (imap == NULL) {
313 p = intr_parent(p);
314 continue;
315 }
316 imask = (unsigned int *)
317 get_property(p, "interrupt-map-mask", NULL);
318 if (imask == NULL) {
319 printk("oops, %s has interrupt-map but no mask\n",
320 p->full_name);
321 return 0;
322 }
323 imaplen /= sizeof(unsigned int);
324 match = 0;
325 ipar = NULL;
326 while (imaplen > 0 && !match) {
327 /* check the child-interrupt field */
328 match = 1;
329 for (i = 0; i < naddrc && match; ++i)
330 match = ((reg[i] ^ imap[i]) & imask[i]) == 0;
331 for (; i < naddrc + nintrc && match; ++i)
332 match = ((ints[i-naddrc] ^ imap[i]) & imask[i]) == 0;
333 imap += naddrc + nintrc;
334 imaplen -= naddrc + nintrc;
335 /* grab the interrupt parent */
336 ipar = find_phandle((phandle) *imap++);
337 --imaplen;
338 if (ipar == NULL && num_interrupt_controllers == 1)
339 /* cope with BootX not giving us phandles */
340 ipar = dflt_interrupt_controller;
341 if (ipar == NULL) {
342 printk("oops, no int parent %x in map of %s\n",
343 imap[-1], p->full_name);
344 return 0;
345 }
346 /* find the parent's # addr and intr cells */
347 ip = (unsigned int *)
348 get_property(ipar, "#interrupt-cells", NULL);
349 if (ip == NULL) {
350 printk("oops, no #interrupt-cells on %s\n",
351 ipar->full_name);
352 return 0;
353 }
354 newintrc = *ip;
355 ip = (unsigned int *)
356 get_property(ipar, "#address-cells", NULL);
357 newaddrc = (ip == NULL)? 0: *ip;
358 imap += newaddrc + newintrc;
359 imaplen -= newaddrc + newintrc;
360 }
361 if (imaplen < 0) {
362 printk("oops, error decoding int-map on %s, len=%d\n",
363 p->full_name, imaplen);
364 return 0;
365 }
366 if (!match) {
367 printk("oops, no match in %s int-map for %s\n",
368 p->full_name, np->full_name);
369 return 0;
370 }
371 p = ipar;
372 naddrc = newaddrc;
373 nintrc = newintrc;
374 ints = imap - nintrc;
375 reg = ints - naddrc;
376 }
377 if (p == NULL)
378 printk("hmmm, int tree for %s doesn't have ctrler\n",
379 np->full_name);
380 *irq = ints;
381 *ictrler = p;
382 return nintrc;
383}
384
385/*
386 * New version of finish_node_interrupts.
387 */
388static unsigned long __init
389finish_node_interrupts(struct device_node *np, unsigned long mem_start)
390{
391 unsigned int *ints;
392 int intlen, intrcells;
393 int i, j, n, offset;
394 unsigned int *irq;
395 struct device_node *ic;
396
397 ints = (unsigned int *) get_property(np, "interrupts", &intlen);
398 if (ints == NULL)
399 return mem_start;
400 intrcells = prom_n_intr_cells(np);
401 intlen /= intrcells * sizeof(unsigned int);
402 np->n_intrs = intlen;
403 np->intrs = (struct interrupt_info *) mem_start;
404 mem_start += intlen * sizeof(struct interrupt_info);
405
406 for (i = 0; i < intlen; ++i) {
407 np->intrs[i].line = 0;
408 np->intrs[i].sense = 1;
409 n = map_interrupt(&irq, &ic, np, ints, intrcells);
410 if (n <= 0)
411 continue;
412 offset = 0;
413 /*
414 * On a CHRP we have an 8259 which is subordinate to
415 * the openpic in the interrupt tree, but we want the
416 * openpic's interrupt numbers offsetted, not the 8259's.
417 * So we apply the offset if the controller is at the
418 * root of the interrupt tree, i.e. has no interrupt-parent.
419 * This doesn't cope with the general case of multiple
420 * cascaded interrupt controllers, but then neither will
421 * irq.c at the moment either. -- paulus
422 * The G5 triggers that code, I add a machine test. On
423 * those machines, we want to offset interrupts from the
424 * second openpic by 128 -- BenH
425 */
426 if (num_interrupt_controllers > 1
427 && ic != NULL
428 && get_property(ic, "interrupt-parent", NULL) == NULL)
429 offset = 16;
430
431 np->intrs[i].line = irq[0] + offset;
432 if (n > 1)
433 np->intrs[i].sense = irq[1];
434 if (n > 2) {
435 printk("hmmm, got %d intr cells for %s:", n,
436 np->full_name);
437 for (j = 0; j < n; ++j)
438 printk(" %d", irq[j]);
439 printk("\n");
440 }
441 ints += intrcells;
442 }
443
444 return mem_start;
445}
446
447/*
448 * When BootX makes a copy of the device tree from the MacOS
449 * Name Registry, it is in the format we use but all of the pointers
450 * are offsets from the start of the tree.
451 * This procedure updates the pointers.
452 */
453void __init
454relocate_nodes(void)
455{
456 unsigned long base;
457 struct device_node *np;
458 struct property *pp;
459
460#define ADDBASE(x) (x = (typeof (x))((x)? ((unsigned long)(x) + base): 0))
461
462 base = (unsigned long) boot_infos + boot_infos->deviceTreeOffset;
463 allnodes = (struct device_node *)(base + 4);
464 for (np = allnodes; np != 0; np = np->allnext) {
465 ADDBASE(np->full_name);
466 ADDBASE(np->properties);
467 ADDBASE(np->parent);
468 ADDBASE(np->child);
469 ADDBASE(np->sibling);
470 ADDBASE(np->allnext);
471 for (pp = np->properties; pp != 0; pp = pp->next) {
472 ADDBASE(pp->name);
473 ADDBASE(pp->value);
474 ADDBASE(pp->next);
475 }
476 }
477}
478
479int
480prom_n_addr_cells(struct device_node* np)
481{
482 int* ip;
483 do {
484 if (np->parent)
485 np = np->parent;
486 ip = (int *) get_property(np, "#address-cells", NULL);
487 if (ip != NULL)
488 return *ip;
489 } while (np->parent);
490 /* No #address-cells property for the root node, default to 1 */
491 return 1;
492}
493
494int
495prom_n_size_cells(struct device_node* np)
496{
497 int* ip;
498 do {
499 if (np->parent)
500 np = np->parent;
501 ip = (int *) get_property(np, "#size-cells", NULL);
502 if (ip != NULL)
503 return *ip;
504 } while (np->parent);
505 /* No #size-cells property for the root node, default to 1 */
506 return 1;
507}
508
509static unsigned long __init
510map_addr(struct device_node *np, unsigned long space, unsigned long addr)
511{
512 int na;
513 unsigned int *ranges;
514 int rlen = 0;
515 unsigned int type;
516
517 type = (space >> 24) & 3;
518 if (type == 0)
519 return addr;
520
521 while ((np = np->parent) != NULL) {
522 if (strcmp(np->type, "pci") != 0)
523 continue;
524 /* PCI bridge: map the address through the ranges property */
525 na = prom_n_addr_cells(np);
526 ranges = (unsigned int *) get_property(np, "ranges", &rlen);
527 while ((rlen -= (na + 5) * sizeof(unsigned int)) >= 0) {
528 if (((ranges[0] >> 24) & 3) == type
529 && ranges[2] <= addr
530 && addr - ranges[2] < ranges[na+4]) {
531 /* ok, this matches, translate it */
532 addr += ranges[na+2] - ranges[2];
533 break;
534 }
535 ranges += na + 5;
536 }
537 }
538 return addr;
539}
540
541static unsigned long __init
542interpret_pci_props(struct device_node *np, unsigned long mem_start,
543 int naddrc, int nsizec)
544{
545 struct address_range *adr;
546 struct pci_reg_property *pci_addrs;
547 int i, l, *ip;
548
549 pci_addrs = (struct pci_reg_property *)
550 get_property(np, "assigned-addresses", &l);
551 if (pci_addrs != 0 && l >= sizeof(struct pci_reg_property)) {
552 i = 0;
553 adr = (struct address_range *) mem_start;
554 while ((l -= sizeof(struct pci_reg_property)) >= 0) {
555 adr[i].space = pci_addrs[i].addr.a_hi;
556 adr[i].address = map_addr(np, pci_addrs[i].addr.a_hi,
557 pci_addrs[i].addr.a_lo);
558 adr[i].size = pci_addrs[i].size_lo;
559 ++i;
560 }
561 np->addrs = adr;
562 np->n_addrs = i;
563 mem_start += i * sizeof(struct address_range);
564 }
565
566 if (use_of_interrupt_tree)
567 return mem_start;
568
569 ip = (int *) get_property(np, "AAPL,interrupts", &l);
570 if (ip == 0 && np->parent)
571 ip = (int *) get_property(np->parent, "AAPL,interrupts", &l);
572 if (ip == 0)
573 ip = (int *) get_property(np, "interrupts", &l);
574 if (ip != 0) {
575 np->intrs = (struct interrupt_info *) mem_start;
576 np->n_intrs = l / sizeof(int);
577 mem_start += np->n_intrs * sizeof(struct interrupt_info);
578 for (i = 0; i < np->n_intrs; ++i) {
579 np->intrs[i].line = *ip++;
580 np->intrs[i].sense = 1;
581 }
582 }
583
584 return mem_start;
585}
586
587static unsigned long __init
588interpret_dbdma_props(struct device_node *np, unsigned long mem_start,
589 int naddrc, int nsizec)
590{
591 struct reg_property *rp;
592 struct address_range *adr;
593 unsigned long base_address;
594 int i, l, *ip;
595 struct device_node *db;
596
597 base_address = 0;
598 for (db = np->parent; db != NULL; db = db->parent) {
599 if (!strcmp(db->type, "dbdma") && db->n_addrs != 0) {
600 base_address = db->addrs[0].address;
601 break;
602 }
603 }
604
605 rp = (struct reg_property *) get_property(np, "reg", &l);
606 if (rp != 0 && l >= sizeof(struct reg_property)) {
607 i = 0;
608 adr = (struct address_range *) mem_start;
609 while ((l -= sizeof(struct reg_property)) >= 0) {
610 adr[i].space = 2;
611 adr[i].address = rp[i].address + base_address;
612 adr[i].size = rp[i].size;
613 ++i;
614 }
615 np->addrs = adr;
616 np->n_addrs = i;
617 mem_start += i * sizeof(struct address_range);
618 }
619
620 if (use_of_interrupt_tree)
621 return mem_start;
622
623 ip = (int *) get_property(np, "AAPL,interrupts", &l);
624 if (ip == 0)
625 ip = (int *) get_property(np, "interrupts", &l);
626 if (ip != 0) {
627 np->intrs = (struct interrupt_info *) mem_start;
628 np->n_intrs = l / sizeof(int);
629 mem_start += np->n_intrs * sizeof(struct interrupt_info);
630 for (i = 0; i < np->n_intrs; ++i) {
631 np->intrs[i].line = *ip++;
632 np->intrs[i].sense = 1;
633 }
634 }
635
636 return mem_start;
637}
638
639static unsigned long __init
640interpret_macio_props(struct device_node *np, unsigned long mem_start,
641 int naddrc, int nsizec)
642{
643 struct reg_property *rp;
644 struct address_range *adr;
645 unsigned long base_address;
646 int i, l, *ip;
647 struct device_node *db;
648
649 base_address = 0;
650 for (db = np->parent; db != NULL; db = db->parent) {
651 if (!strcmp(db->type, "mac-io") && db->n_addrs != 0) {
652 base_address = db->addrs[0].address;
653 break;
654 }
655 }
656
657 rp = (struct reg_property *) get_property(np, "reg", &l);
658 if (rp != 0 && l >= sizeof(struct reg_property)) {
659 i = 0;
660 adr = (struct address_range *) mem_start;
661 while ((l -= sizeof(struct reg_property)) >= 0) {
662 adr[i].space = 2;
663 adr[i].address = rp[i].address + base_address;
664 adr[i].size = rp[i].size;
665 ++i;
666 }
667 np->addrs = adr;
668 np->n_addrs = i;
669 mem_start += i * sizeof(struct address_range);
670 }
671
672 if (use_of_interrupt_tree)
673 return mem_start;
674
675 ip = (int *) get_property(np, "interrupts", &l);
676 if (ip == 0)
677 ip = (int *) get_property(np, "AAPL,interrupts", &l);
678 if (ip != 0) {
679 np->intrs = (struct interrupt_info *) mem_start;
680 np->n_intrs = l / sizeof(int);
681 for (i = 0; i < np->n_intrs; ++i) {
682 np->intrs[i].line = *ip++;
683 np->intrs[i].sense = 1;
684 }
685 mem_start += np->n_intrs * sizeof(struct interrupt_info);
686 }
687
688 return mem_start;
689}
690
691static unsigned long __init
692interpret_isa_props(struct device_node *np, unsigned long mem_start,
693 int naddrc, int nsizec)
694{
695 struct isa_reg_property *rp;
696 struct address_range *adr;
697 int i, l, *ip;
698
699 rp = (struct isa_reg_property *) get_property(np, "reg", &l);
700 if (rp != 0 && l >= sizeof(struct isa_reg_property)) {
701 i = 0;
702 adr = (struct address_range *) mem_start;
703 while ((l -= sizeof(struct reg_property)) >= 0) {
704 adr[i].space = rp[i].space;
705 adr[i].address = rp[i].address
706 + (adr[i].space? 0: _ISA_MEM_BASE);
707 adr[i].size = rp[i].size;
708 ++i;
709 }
710 np->addrs = adr;
711 np->n_addrs = i;
712 mem_start += i * sizeof(struct address_range);
713 }
714
715 if (use_of_interrupt_tree)
716 return mem_start;
717
718 ip = (int *) get_property(np, "interrupts", &l);
719 if (ip != 0) {
720 np->intrs = (struct interrupt_info *) mem_start;
721 np->n_intrs = l / (2 * sizeof(int));
722 mem_start += np->n_intrs * sizeof(struct interrupt_info);
723 for (i = 0; i < np->n_intrs; ++i) {
724 np->intrs[i].line = *ip++;
725 np->intrs[i].sense = *ip++;
726 }
727 }
728
729 return mem_start;
730}
731
732static unsigned long __init
733interpret_root_props(struct device_node *np, unsigned long mem_start,
734 int naddrc, int nsizec)
735{
736 struct address_range *adr;
737 int i, l, *ip;
738 unsigned int *rp;
739 int rpsize = (naddrc + nsizec) * sizeof(unsigned int);
740
741 rp = (unsigned int *) get_property(np, "reg", &l);
742 if (rp != 0 && l >= rpsize) {
743 i = 0;
744 adr = (struct address_range *) mem_start;
745 while ((l -= rpsize) >= 0) {
746 adr[i].space = (naddrc >= 2? rp[naddrc-2]: 2);
747 adr[i].address = rp[naddrc - 1];
748 adr[i].size = rp[naddrc + nsizec - 1];
749 ++i;
750 rp += naddrc + nsizec;
751 }
752 np->addrs = adr;
753 np->n_addrs = i;
754 mem_start += i * sizeof(struct address_range);
755 }
756
757 if (use_of_interrupt_tree)
758 return mem_start;
759
760 ip = (int *) get_property(np, "AAPL,interrupts", &l);
761 if (ip == 0)
762 ip = (int *) get_property(np, "interrupts", &l);
763 if (ip != 0) {
764 np->intrs = (struct interrupt_info *) mem_start;
765 np->n_intrs = l / sizeof(int);
766 mem_start += np->n_intrs * sizeof(struct interrupt_info);
767 for (i = 0; i < np->n_intrs; ++i) {
768 np->intrs[i].line = *ip++;
769 np->intrs[i].sense = 1;
770 }
771 }
772
773 return mem_start;
774}
775
776/*
777 * Work out the sense (active-low level / active-high edge)
778 * of each interrupt from the device tree.
779 */
780void __init
781prom_get_irq_senses(unsigned char *senses, int off, int max)
782{
783 struct device_node *np;
784 int i, j;
785
786 /* default to level-triggered */
787 memset(senses, 1, max - off);
788 if (!use_of_interrupt_tree)
789 return;
790
791 for (np = allnodes; np != 0; np = np->allnext) {
792 for (j = 0; j < np->n_intrs; j++) {
793 i = np->intrs[j].line;
794 if (i >= off && i < max) {
795 if (np->intrs[j].sense == 1)
796 senses[i-off] = (IRQ_SENSE_LEVEL
797 | IRQ_POLARITY_NEGATIVE);
798 else
799 senses[i-off] = (IRQ_SENSE_EDGE
800 | IRQ_POLARITY_POSITIVE);
801 }
802 }
803 }
804}
805
806/*
807 * Construct and return a list of the device_nodes with a given name.
808 */
809struct device_node *
810find_devices(const char *name)
811{
812 struct device_node *head, **prevp, *np;
813
814 prevp = &head;
815 for (np = allnodes; np != 0; np = np->allnext) {
816 if (np->name != 0 && strcasecmp(np->name, name) == 0) {
817 *prevp = np;
818 prevp = &np->next;
819 }
820 }
821 *prevp = NULL;
822 return head;
823}
824
825/*
826 * Construct and return a list of the device_nodes with a given type.
827 */
828struct device_node *
829find_type_devices(const char *type)
830{
831 struct device_node *head, **prevp, *np;
832
833 prevp = &head;
834 for (np = allnodes; np != 0; np = np->allnext) {
835 if (np->type != 0 && strcasecmp(np->type, type) == 0) {
836 *prevp = np;
837 prevp = &np->next;
838 }
839 }
840 *prevp = NULL;
841 return head;
842}
843
844/*
845 * Returns all nodes linked together
846 */
847struct device_node *
848find_all_nodes(void)
849{
850 struct device_node *head, **prevp, *np;
851
852 prevp = &head;
853 for (np = allnodes; np != 0; np = np->allnext) {
854 *prevp = np;
855 prevp = &np->next;
856 }
857 *prevp = NULL;
858 return head;
859}
860
861/* Checks if the given "compat" string matches one of the strings in
862 * the device's "compatible" property
863 */
864int
865device_is_compatible(struct device_node *device, const char *compat)
866{
867 const char* cp;
868 int cplen, l;
869
870 cp = (char *) get_property(device, "compatible", &cplen);
871 if (cp == NULL)
872 return 0;
873 while (cplen > 0) {
874 if (strncasecmp(cp, compat, strlen(compat)) == 0)
875 return 1;
876 l = strlen(cp) + 1;
877 cp += l;
878 cplen -= l;
879 }
880
881 return 0;
882}
883
884
885/*
886 * Indicates whether the root node has a given value in its
887 * compatible property.
888 */
889int
890machine_is_compatible(const char *compat)
891{
892 struct device_node *root;
893
894 root = find_path_device("/");
895 if (root == 0)
896 return 0;
897 return device_is_compatible(root, compat);
898}
899
900/*
901 * Construct and return a list of the device_nodes with a given type
902 * and compatible property.
903 */
904struct device_node *
905find_compatible_devices(const char *type, const char *compat)
906{
907 struct device_node *head, **prevp, *np;
908
909 prevp = &head;
910 for (np = allnodes; np != 0; np = np->allnext) {
911 if (type != NULL
912 && !(np->type != 0 && strcasecmp(np->type, type) == 0))
913 continue;
914 if (device_is_compatible(np, compat)) {
915 *prevp = np;
916 prevp = &np->next;
917 }
918 }
919 *prevp = NULL;
920 return head;
921}
922
923/*
924 * Find the device_node with a given full_name.
925 */
926struct device_node *
927find_path_device(const char *path)
928{
929 struct device_node *np;
930
931 for (np = allnodes; np != 0; np = np->allnext)
932 if (np->full_name != 0 && strcasecmp(np->full_name, path) == 0)
933 return np;
934 return NULL;
935}
936
937/*******
938 *
939 * New implementation of the OF "find" APIs, return a refcounted
940 * object, call of_node_put() when done. Currently, still lacks
941 * locking as old implementation, this is beeing done for ppc64.
942 *
943 * Note that property management will need some locking as well,
944 * this isn't dealt with yet
945 *
946 *******/
947
948/**
949 * of_find_node_by_name - Find a node by it's "name" property
950 * @from: The node to start searching from or NULL, the node
951 * you pass will not be searched, only the next one
952 * will; typically, you pass what the previous call
953 * returned. of_node_put() will be called on it
954 * @name: The name string to match against
955 *
956 * Returns a node pointer with refcount incremented, use
957 * of_node_put() on it when done.
958 */
959struct device_node *of_find_node_by_name(struct device_node *from,
960 const char *name)
961{
962 struct device_node *np = from ? from->allnext : allnodes;
963
964 for (; np != 0; np = np->allnext)
965 if (np->name != 0 && strcasecmp(np->name, name) == 0)
966 break;
967 if (from)
968 of_node_put(from);
969 return of_node_get(np);
970}
971
972/**
973 * of_find_node_by_type - Find a node by it's "device_type" property
974 * @from: The node to start searching from or NULL, the node
975 * you pass will not be searched, only the next one
976 * will; typically, you pass what the previous call
977 * returned. of_node_put() will be called on it
978 * @name: The type string to match against
979 *
980 * Returns a node pointer with refcount incremented, use
981 * of_node_put() on it when done.
982 */
983struct device_node *of_find_node_by_type(struct device_node *from,
984 const char *type)
985{
986 struct device_node *np = from ? from->allnext : allnodes;
987
988 for (; np != 0; np = np->allnext)
989 if (np->type != 0 && strcasecmp(np->type, type) == 0)
990 break;
991 if (from)
992 of_node_put(from);
993 return of_node_get(np);
994}
995
996/**
997 * of_find_compatible_node - Find a node based on type and one of the
998 * tokens in it's "compatible" property
999 * @from: The node to start searching from or NULL, the node
1000 * you pass will not be searched, only the next one
1001 * will; typically, you pass what the previous call
1002 * returned. of_node_put() will be called on it
1003 * @type: The type string to match "device_type" or NULL to ignore
1004 * @compatible: The string to match to one of the tokens in the device
1005 * "compatible" list.
1006 *
1007 * Returns a node pointer with refcount incremented, use
1008 * of_node_put() on it when done.
1009 */
1010struct device_node *of_find_compatible_node(struct device_node *from,
1011 const char *type, const char *compatible)
1012{
1013 struct device_node *np = from ? from->allnext : allnodes;
1014
1015 for (; np != 0; np = np->allnext) {
1016 if (type != NULL
1017 && !(np->type != 0 && strcasecmp(np->type, type) == 0))
1018 continue;
1019 if (device_is_compatible(np, compatible))
1020 break;
1021 }
1022 if (from)
1023 of_node_put(from);
1024 return of_node_get(np);
1025}
1026
1027/**
1028 * of_find_node_by_path - Find a node matching a full OF path
1029 * @path: The full path to match
1030 *
1031 * Returns a node pointer with refcount incremented, use
1032 * of_node_put() on it when done.
1033 */
1034struct device_node *of_find_node_by_path(const char *path)
1035{
1036 struct device_node *np = allnodes;
1037
1038 for (; np != 0; np = np->allnext)
1039 if (np->full_name != 0 && strcasecmp(np->full_name, path) == 0)
1040 break;
1041 return of_node_get(np);
1042}
1043
1044/**
1045 * of_find_all_nodes - Get next node in global list
1046 * @prev: Previous node or NULL to start iteration
1047 * of_node_put() will be called on it
1048 *
1049 * Returns a node pointer with refcount incremented, use
1050 * of_node_put() on it when done.
1051 */
1052struct device_node *of_find_all_nodes(struct device_node *prev)
1053{
1054 return of_node_get(prev ? prev->allnext : allnodes);
1055}
1056
1057/**
1058 * of_get_parent - Get a node's parent if any
1059 * @node: Node to get parent
1060 *
1061 * Returns a node pointer with refcount incremented, use
1062 * of_node_put() on it when done.
1063 */
1064struct device_node *of_get_parent(const struct device_node *node)
1065{
1066 return node ? of_node_get(node->parent) : NULL;
1067}
1068
1069/**
1070 * of_get_next_child - Iterate a node childs
1071 * @node: parent node
1072 * @prev: previous child of the parent node, or NULL to get first
1073 *
1074 * Returns a node pointer with refcount incremented, use
1075 * of_node_put() on it when done.
1076 */
1077struct device_node *of_get_next_child(const struct device_node *node,
1078 struct device_node *prev)
1079{
1080 struct device_node *next = prev ? prev->sibling : node->child;
1081
1082 for (; next != 0; next = next->sibling)
1083 if (of_node_get(next))
1084 break;
1085 if (prev)
1086 of_node_put(prev);
1087 return next;
1088}
1089
1090/**
1091 * of_node_get - Increment refcount of a node
1092 * @node: Node to inc refcount, NULL is supported to
1093 * simplify writing of callers
1094 *
1095 * Returns the node itself or NULL if gone. Current implementation
1096 * does nothing as we don't yet do dynamic node allocation on ppc32
1097 */
1098struct device_node *of_node_get(struct device_node *node)
1099{
1100 return node;
1101}
1102
1103/**
1104 * of_node_put - Decrement refcount of a node
1105 * @node: Node to dec refcount, NULL is supported to
1106 * simplify writing of callers
1107 *
1108 * Current implementation does nothing as we don't yet do dynamic node
1109 * allocation on ppc32
1110 */
1111void of_node_put(struct device_node *node)
1112{
1113}
1114
1115/*
1116 * Find the device_node with a given phandle.
1117 */
1118static struct device_node * __init
1119find_phandle(phandle ph)
1120{
1121 struct device_node *np;
1122
1123 for (np = allnodes; np != 0; np = np->allnext)
1124 if (np->node == ph)
1125 return np;
1126 return NULL;
1127}
1128
1129/*
1130 * Find a property with a given name for a given node
1131 * and return the value.
1132 */
1133unsigned char *
1134get_property(struct device_node *np, const char *name, int *lenp)
1135{
1136 struct property *pp;
1137
1138 for (pp = np->properties; pp != 0; pp = pp->next)
1139 if (pp->name != NULL && strcmp(pp->name, name) == 0) {
1140 if (lenp != 0)
1141 *lenp = pp->length;
1142 return pp->value;
1143 }
1144 return NULL;
1145}
1146
1147/*
1148 * Add a property to a node
1149 */
1150int
1151prom_add_property(struct device_node* np, struct property* prop)
1152{
1153 struct property **next = &np->properties;
1154
1155 prop->next = NULL;
1156 while (*next)
1157 next = &(*next)->next;
1158 *next = prop;
1159
1160 return 0;
1161}
1162
1163/* I quickly hacked that one, check against spec ! */
1164static inline unsigned long
1165bus_space_to_resource_flags(unsigned int bus_space)
1166{
1167 u8 space = (bus_space >> 24) & 0xf;
1168 if (space == 0)
1169 space = 0x02;
1170 if (space == 0x02)
1171 return IORESOURCE_MEM;
1172 else if (space == 0x01)
1173 return IORESOURCE_IO;
1174 else {
1175 printk(KERN_WARNING "prom.c: bus_space_to_resource_flags(), space: %x\n",
1176 bus_space);
1177 return 0;
1178 }
1179}
1180
1181static struct resource*
1182find_parent_pci_resource(struct pci_dev* pdev, struct address_range *range)
1183{
1184 unsigned long mask;
1185 int i;
1186
1187 /* Check this one */
1188 mask = bus_space_to_resource_flags(range->space);
1189 for (i=0; i<DEVICE_COUNT_RESOURCE; i++) {
1190 if ((pdev->resource[i].flags & mask) == mask &&
1191 pdev->resource[i].start <= range->address &&
1192 pdev->resource[i].end > range->address) {
1193 if ((range->address + range->size - 1) > pdev->resource[i].end) {
1194 /* Add better message */
1195 printk(KERN_WARNING "PCI/OF resource overlap !\n");
1196 return NULL;
1197 }
1198 break;
1199 }
1200 }
1201 if (i == DEVICE_COUNT_RESOURCE)
1202 return NULL;
1203 return &pdev->resource[i];
1204}
1205
1206/*
1207 * Request an OF device resource. Currently handles child of PCI devices,
1208 * or other nodes attached to the root node. Ultimately, put some
1209 * link to resources in the OF node.
1210 */
1211struct resource*
1212request_OF_resource(struct device_node* node, int index, const char* name_postfix)
1213{
1214 struct pci_dev* pcidev;
1215 u8 pci_bus, pci_devfn;
1216 unsigned long iomask;
1217 struct device_node* nd;
1218 struct resource* parent;
1219 struct resource *res = NULL;
1220 int nlen, plen;
1221
1222 if (index >= node->n_addrs)
1223 goto fail;
1224
1225 /* Sanity check on bus space */
1226 iomask = bus_space_to_resource_flags(node->addrs[index].space);
1227 if (iomask & IORESOURCE_MEM)
1228 parent = &iomem_resource;
1229 else if (iomask & IORESOURCE_IO)
1230 parent = &ioport_resource;
1231 else
1232 goto fail;
1233
1234 /* Find a PCI parent if any */
1235 nd = node;
1236 pcidev = NULL;
1237 while(nd) {
1238 if (!pci_device_from_OF_node(nd, &pci_bus, &pci_devfn))
1239 pcidev = pci_find_slot(pci_bus, pci_devfn);
1240 if (pcidev) break;
1241 nd = nd->parent;
1242 }
1243 if (pcidev)
1244 parent = find_parent_pci_resource(pcidev, &node->addrs[index]);
1245 if (!parent) {
1246 printk(KERN_WARNING "request_OF_resource(%s), parent not found\n",
1247 node->name);
1248 goto fail;
1249 }
1250
1251 res = __request_region(parent, node->addrs[index].address, node->addrs[index].size, NULL);
1252 if (!res)
1253 goto fail;
1254 nlen = strlen(node->name);
1255 plen = name_postfix ? strlen(name_postfix) : 0;
1256 res->name = (const char *)kmalloc(nlen+plen+1, GFP_KERNEL);
1257 if (res->name) {
1258 strcpy((char *)res->name, node->name);
1259 if (plen)
1260 strcpy((char *)res->name+nlen, name_postfix);
1261 }
1262 return res;
1263fail:
1264 return NULL;
1265}
1266
1267int
1268release_OF_resource(struct device_node* node, int index)
1269{
1270 struct pci_dev* pcidev;
1271 u8 pci_bus, pci_devfn;
1272 unsigned long iomask, start, end;
1273 struct device_node* nd;
1274 struct resource* parent;
1275 struct resource *res = NULL;
1276
1277 if (index >= node->n_addrs)
1278 return -EINVAL;
1279
1280 /* Sanity check on bus space */
1281 iomask = bus_space_to_resource_flags(node->addrs[index].space);
1282 if (iomask & IORESOURCE_MEM)
1283 parent = &iomem_resource;
1284 else if (iomask & IORESOURCE_IO)
1285 parent = &ioport_resource;
1286 else
1287 return -EINVAL;
1288
1289 /* Find a PCI parent if any */
1290 nd = node;
1291 pcidev = NULL;
1292 while(nd) {
1293 if (!pci_device_from_OF_node(nd, &pci_bus, &pci_devfn))
1294 pcidev = pci_find_slot(pci_bus, pci_devfn);
1295 if (pcidev) break;
1296 nd = nd->parent;
1297 }
1298 if (pcidev)
1299 parent = find_parent_pci_resource(pcidev, &node->addrs[index]);
1300 if (!parent) {
1301 printk(KERN_WARNING "release_OF_resource(%s), parent not found\n",
1302 node->name);
1303 return -ENODEV;
1304 }
1305
1306 /* Find us in the parent and its childs */
1307 res = parent->child;
1308 start = node->addrs[index].address;
1309 end = start + node->addrs[index].size - 1;
1310 while (res) {
1311 if (res->start == start && res->end == end &&
1312 (res->flags & IORESOURCE_BUSY))
1313 break;
1314 if (res->start <= start && res->end >= end)
1315 res = res->child;
1316 else
1317 res = res->sibling;
1318 }
1319 if (!res)
1320 return -ENODEV;
1321
1322 kfree(res->name);
1323 res->name = NULL;
1324 release_resource(res);
1325 kfree(res);
1326
1327 return 0;
1328}
1329
1330#if 0
1331void
1332print_properties(struct device_node *np)
1333{
1334 struct property *pp;
1335 char *cp;
1336 int i, n;
1337
1338 for (pp = np->properties; pp != 0; pp = pp->next) {
1339 printk(KERN_INFO "%s", pp->name);
1340 for (i = strlen(pp->name); i < 16; ++i)
1341 printk(" ");
1342 cp = (char *) pp->value;
1343 for (i = pp->length; i > 0; --i, ++cp)
1344 if ((i > 1 && (*cp < 0x20 || *cp > 0x7e))
1345 || (i == 1 && *cp != 0))
1346 break;
1347 if (i == 0 && pp->length > 1) {
1348 /* looks like a string */
1349 printk(" %s\n", (char *) pp->value);
1350 } else {
1351 /* dump it in hex */
1352 n = pp->length;
1353 if (n > 64)
1354 n = 64;
1355 if (pp->length % 4 == 0) {
1356 unsigned int *p = (unsigned int *) pp->value;
1357
1358 n /= 4;
1359 for (i = 0; i < n; ++i) {
1360 if (i != 0 && (i % 4) == 0)
1361 printk("\n ");
1362 printk(" %08x", *p++);
1363 }
1364 } else {
1365 unsigned char *bp = pp->value;
1366
1367 for (i = 0; i < n; ++i) {
1368 if (i != 0 && (i % 16) == 0)
1369 printk("\n ");
1370 printk(" %02x", *bp++);
1371 }
1372 }
1373 printk("\n");
1374 if (pp->length > 64)
1375 printk(" ... (length = %d)\n",
1376 pp->length);
1377 }
1378 }
1379}
1380#endif
1381
1382static DEFINE_SPINLOCK(rtas_lock);
1383
1384/* this can be called after setup -- Cort */
1385int
1386call_rtas(const char *service, int nargs, int nret,
1387 unsigned long *outputs, ...)
1388{
1389 va_list list;
1390 int i;
1391 unsigned long s;
1392 struct device_node *rtas;
1393 int *tokp;
1394 union {
1395 unsigned long words[16];
1396 double align;
1397 } u;
1398
1399 rtas = find_devices("rtas");
1400 if (rtas == NULL)
1401 return -1;
1402 tokp = (int *) get_property(rtas, service, NULL);
1403 if (tokp == NULL) {
1404 printk(KERN_ERR "No RTAS service called %s\n", service);
1405 return -1;
1406 }
1407 u.words[0] = *tokp;
1408 u.words[1] = nargs;
1409 u.words[2] = nret;
1410 va_start(list, outputs);
1411 for (i = 0; i < nargs; ++i)
1412 u.words[i+3] = va_arg(list, unsigned long);
1413 va_end(list);
1414
1415 /*
1416 * RTAS doesn't use floating point.
1417 * Or at least, according to the CHRP spec we enter RTAS
1418 * with FP disabled, and it doesn't change the FP registers.
1419 * -- paulus.
1420 */
1421 spin_lock_irqsave(&rtas_lock, s);
1422 enter_rtas((void *)__pa(&u));
1423 spin_unlock_irqrestore(&rtas_lock, s);
1424
1425 if (nret > 1 && outputs != NULL)
1426 for (i = 0; i < nret-1; ++i)
1427 outputs[i] = u.words[i+nargs+4];
1428 return u.words[nargs+3];
1429}
diff --git a/arch/ppc/syslib/prom_init.c b/arch/ppc/syslib/prom_init.c
deleted file mode 100644
index df14422ae1c6..000000000000
--- a/arch/ppc/syslib/prom_init.c
+++ /dev/null
@@ -1,1011 +0,0 @@
1/*
2 * Note that prom_init() and anything called from prom_init()
3 * may be running at an address that is different from the address
4 * that it was linked at. References to static data items are
5 * handled by compiling this file with -mrelocatable-lib.
6 */
7
8#include <linux/config.h>
9#include <linux/kernel.h>
10#include <linux/string.h>
11#include <linux/init.h>
12#include <linux/threads.h>
13#include <linux/spinlock.h>
14#include <linux/ioport.h>
15#include <linux/pci.h>
16#include <linux/slab.h>
17#include <linux/bitops.h>
18
19#include <asm/sections.h>
20#include <asm/prom.h>
21#include <asm/page.h>
22#include <asm/irq.h>
23#include <asm/io.h>
24#include <asm/smp.h>
25#include <asm/bootx.h>
26#include <asm/system.h>
27#include <asm/mmu.h>
28#include <asm/pgtable.h>
29#include <asm/bootinfo.h>
30#include <asm/btext.h>
31#include <asm/pci-bridge.h>
32#include <asm/open_pic.h>
33#include <asm/cacheflush.h>
34
35#ifdef CONFIG_LOGO_LINUX_CLUT224
36#include <linux/linux_logo.h>
37extern const struct linux_logo logo_linux_clut224;
38#endif
39
40/*
41 * Properties whose value is longer than this get excluded from our
42 * copy of the device tree. This way we don't waste space storing
43 * things like "driver,AAPL,MacOS,PowerPC" properties. But this value
44 * does need to be big enough to ensure that we don't lose things
45 * like the interrupt-map property on a PCI-PCI bridge.
46 */
47#define MAX_PROPERTY_LENGTH 4096
48
49#ifndef FB_MAX /* avoid pulling in all of the fb stuff */
50#define FB_MAX 8
51#endif
52
53#define ALIGNUL(x) (((x) + sizeof(unsigned long)-1) & -sizeof(unsigned long))
54
55typedef u32 prom_arg_t;
56
57struct prom_args {
58 const char *service;
59 int nargs;
60 int nret;
61 prom_arg_t args[10];
62};
63
64struct pci_address {
65 unsigned a_hi;
66 unsigned a_mid;
67 unsigned a_lo;
68};
69
70struct pci_reg_property {
71 struct pci_address addr;
72 unsigned size_hi;
73 unsigned size_lo;
74};
75
76struct pci_range {
77 struct pci_address addr;
78 unsigned phys;
79 unsigned size_hi;
80 unsigned size_lo;
81};
82
83struct isa_reg_property {
84 unsigned space;
85 unsigned address;
86 unsigned size;
87};
88
89struct pci_intr_map {
90 struct pci_address addr;
91 unsigned dunno;
92 phandle int_ctrler;
93 unsigned intr;
94};
95
96static void prom_exit(void);
97static int call_prom(const char *service, int nargs, int nret, ...);
98static int call_prom_ret(const char *service, int nargs, int nret,
99 prom_arg_t *rets, ...);
100static void prom_print_hex(unsigned int v);
101static int prom_set_color(ihandle ih, int i, int r, int g, int b);
102static int prom_next_node(phandle *nodep);
103static unsigned long check_display(unsigned long mem);
104static void setup_disp_fake_bi(ihandle dp);
105static unsigned long copy_device_tree(unsigned long mem_start,
106 unsigned long mem_end);
107static unsigned long inspect_node(phandle node, struct device_node *dad,
108 unsigned long mem_start, unsigned long mem_end,
109 struct device_node ***allnextpp);
110static void prom_hold_cpus(unsigned long mem);
111static void prom_instantiate_rtas(void);
112static void * early_get_property(unsigned long base, unsigned long node,
113 char *prop);
114
115prom_entry prom __initdata;
116ihandle prom_chosen __initdata;
117ihandle prom_stdout __initdata;
118
119static char *prom_display_paths[FB_MAX] __initdata;
120static phandle prom_display_nodes[FB_MAX] __initdata;
121static unsigned int prom_num_displays __initdata;
122static ihandle prom_disp_node __initdata;
123char *of_stdout_device __initdata;
124
125unsigned int rtas_data; /* physical pointer */
126unsigned int rtas_entry; /* physical pointer */
127unsigned int rtas_size;
128unsigned int old_rtas;
129
130boot_infos_t *boot_infos;
131char *bootpath;
132char *bootdevice;
133struct device_node *allnodes;
134
135extern char *klimit;
136
137static void __init
138prom_exit(void)
139{
140 struct prom_args args;
141
142 args.service = "exit";
143 args.nargs = 0;
144 args.nret = 0;
145 prom(&args);
146 for (;;) /* should never get here */
147 ;
148}
149
150static int __init
151call_prom(const char *service, int nargs, int nret, ...)
152{
153 va_list list;
154 int i;
155 struct prom_args prom_args;
156
157 prom_args.service = service;
158 prom_args.nargs = nargs;
159 prom_args.nret = nret;
160 va_start(list, nret);
161 for (i = 0; i < nargs; ++i)
162 prom_args.args[i] = va_arg(list, prom_arg_t);
163 va_end(list);
164 for (i = 0; i < nret; ++i)
165 prom_args.args[i + nargs] = 0;
166 prom(&prom_args);
167 return prom_args.args[nargs];
168}
169
170static int __init
171call_prom_ret(const char *service, int nargs, int nret, prom_arg_t *rets, ...)
172{
173 va_list list;
174 int i;
175 struct prom_args prom_args;
176
177 prom_args.service = service;
178 prom_args.nargs = nargs;
179 prom_args.nret = nret;
180 va_start(list, rets);
181 for (i = 0; i < nargs; ++i)
182 prom_args.args[i] = va_arg(list, int);
183 va_end(list);
184 for (i = 0; i < nret; ++i)
185 prom_args.args[i + nargs] = 0;
186 prom(&prom_args);
187 for (i = 1; i < nret; ++i)
188 rets[i-1] = prom_args.args[nargs + i];
189 return prom_args.args[nargs];
190}
191
192void __init
193prom_print(const char *msg)
194{
195 const char *p, *q;
196
197 if (prom_stdout == 0)
198 return;
199
200 for (p = msg; *p != 0; p = q) {
201 for (q = p; *q != 0 && *q != '\n'; ++q)
202 ;
203 if (q > p)
204 call_prom("write", 3, 1, prom_stdout, p, q - p);
205 if (*q != 0) {
206 ++q;
207 call_prom("write", 3, 1, prom_stdout, "\r\n", 2);
208 }
209 }
210}
211
212static void __init
213prom_print_hex(unsigned int v)
214{
215 char buf[16];
216 int i, c;
217
218 for (i = 0; i < 8; ++i) {
219 c = (v >> ((7-i)*4)) & 0xf;
220 c += (c >= 10)? ('a' - 10): '0';
221 buf[i] = c;
222 }
223 buf[i] = ' ';
224 buf[i+1] = 0;
225 prom_print(buf);
226}
227
228static int __init
229prom_set_color(ihandle ih, int i, int r, int g, int b)
230{
231 return call_prom("call-method", 6, 1, "color!", ih, i, b, g, r);
232}
233
234static int __init
235prom_next_node(phandle *nodep)
236{
237 phandle node;
238
239 if ((node = *nodep) != 0
240 && (*nodep = call_prom("child", 1, 1, node)) != 0)
241 return 1;
242 if ((*nodep = call_prom("peer", 1, 1, node)) != 0)
243 return 1;
244 for (;;) {
245 if ((node = call_prom("parent", 1, 1, node)) == 0)
246 return 0;
247 if ((*nodep = call_prom("peer", 1, 1, node)) != 0)
248 return 1;
249 }
250}
251
252#ifdef CONFIG_POWER4
253/*
254 * Set up a hash table with a set of entries in it to map the
255 * first 64MB of RAM. This is used on 64-bit machines since
256 * some of them don't have BATs.
257 */
258
259static inline void make_pte(unsigned long htab, unsigned int hsize,
260 unsigned int va, unsigned int pa, int mode)
261{
262 unsigned int *pteg;
263 unsigned int hash, i, vsid;
264
265 vsid = ((va >> 28) * 0x111) << 12;
266 hash = ((va ^ vsid) >> 5) & 0x7fff80;
267 pteg = (unsigned int *)(htab + (hash & (hsize - 1)));
268 for (i = 0; i < 8; ++i, pteg += 4) {
269 if ((pteg[1] & 1) == 0) {
270 pteg[1] = vsid | ((va >> 16) & 0xf80) | 1;
271 pteg[3] = pa | mode;
272 break;
273 }
274 }
275}
276
277extern unsigned long _SDR1;
278extern PTE *Hash;
279extern unsigned long Hash_size;
280
281static void __init
282prom_alloc_htab(void)
283{
284 unsigned int hsize;
285 unsigned long htab;
286 unsigned int addr;
287
288 /*
289 * Because of OF bugs we can't use the "claim" client
290 * interface to allocate memory for the hash table.
291 * This code is only used on 64-bit PPCs, and the only
292 * 64-bit PPCs at the moment are RS/6000s, and their
293 * OF is based at 0xc00000 (the 12M point), so we just
294 * arbitrarily use the 0x800000 - 0xc00000 region for the
295 * hash table.
296 * -- paulus.
297 */
298 hsize = 4 << 20; /* POWER4 has no BATs */
299 htab = (8 << 20);
300 call_prom("claim", 3, 1, htab, hsize, 0);
301 Hash = (void *)(htab + KERNELBASE);
302 Hash_size = hsize;
303 _SDR1 = htab + __ilog2(hsize) - 18;
304
305 /*
306 * Put in PTEs for the first 64MB of RAM
307 */
308 memset((void *)htab, 0, hsize);
309 for (addr = 0; addr < 0x4000000; addr += 0x1000)
310 make_pte(htab, hsize, addr + KERNELBASE, addr,
311 _PAGE_ACCESSED | _PAGE_COHERENT | PP_RWXX);
312#if 0 /* DEBUG stuff mapping the SCC */
313 make_pte(htab, hsize, 0x80013000, 0x80013000,
314 _PAGE_ACCESSED | _PAGE_NO_CACHE | _PAGE_GUARDED | PP_RWXX);
315#endif
316}
317#endif /* CONFIG_POWER4 */
318
319
320/*
321 * If we have a display that we don't know how to drive,
322 * we will want to try to execute OF's open method for it
323 * later. However, OF will probably fall over if we do that
324 * we've taken over the MMU.
325 * So we check whether we will need to open the display,
326 * and if so, open it now.
327 */
328static unsigned long __init
329check_display(unsigned long mem)
330{
331 phandle node;
332 ihandle ih;
333 int i, j;
334 char type[16], *path;
335 static unsigned char default_colors[] = {
336 0x00, 0x00, 0x00,
337 0x00, 0x00, 0xaa,
338 0x00, 0xaa, 0x00,
339 0x00, 0xaa, 0xaa,
340 0xaa, 0x00, 0x00,
341 0xaa, 0x00, 0xaa,
342 0xaa, 0xaa, 0x00,
343 0xaa, 0xaa, 0xaa,
344 0x55, 0x55, 0x55,
345 0x55, 0x55, 0xff,
346 0x55, 0xff, 0x55,
347 0x55, 0xff, 0xff,
348 0xff, 0x55, 0x55,
349 0xff, 0x55, 0xff,
350 0xff, 0xff, 0x55,
351 0xff, 0xff, 0xff
352 };
353 const unsigned char *clut;
354
355 prom_disp_node = 0;
356
357 for (node = 0; prom_next_node(&node); ) {
358 type[0] = 0;
359 call_prom("getprop", 4, 1, node, "device_type",
360 type, sizeof(type));
361 if (strcmp(type, "display") != 0)
362 continue;
363 /* It seems OF doesn't null-terminate the path :-( */
364 path = (char *) mem;
365 memset(path, 0, 256);
366 if (call_prom("package-to-path", 3, 1, node, path, 255) < 0)
367 continue;
368
369 /*
370 * If this display is the device that OF is using for stdout,
371 * move it to the front of the list.
372 */
373 mem += strlen(path) + 1;
374 i = prom_num_displays++;
375 if (of_stdout_device != 0 && i > 0
376 && strcmp(of_stdout_device, path) == 0) {
377 for (; i > 0; --i) {
378 prom_display_paths[i]
379 = prom_display_paths[i-1];
380 prom_display_nodes[i]
381 = prom_display_nodes[i-1];
382 }
383 }
384 prom_display_paths[i] = path;
385 prom_display_nodes[i] = node;
386 if (i == 0)
387 prom_disp_node = node;
388 if (prom_num_displays >= FB_MAX)
389 break;
390 }
391
392 for (j=0; j<prom_num_displays; j++) {
393 path = prom_display_paths[j];
394 node = prom_display_nodes[j];
395 prom_print("opening display ");
396 prom_print(path);
397 ih = call_prom("open", 1, 1, path);
398 if (ih == 0 || ih == (ihandle) -1) {
399 prom_print("... failed\n");
400 for (i=j+1; i<prom_num_displays; i++) {
401 prom_display_paths[i-1] = prom_display_paths[i];
402 prom_display_nodes[i-1] = prom_display_nodes[i];
403 }
404 if (--prom_num_displays > 0) {
405 prom_disp_node = prom_display_nodes[j];
406 j--;
407 } else
408 prom_disp_node = 0;
409 continue;
410 } else {
411 prom_print("... ok\n");
412 call_prom("setprop", 4, 1, node, "linux,opened", 0, 0);
413
414 /*
415 * Setup a usable color table when the appropriate
416 * method is available.
417 * Should update this to use set-colors.
418 */
419 clut = default_colors;
420 for (i = 0; i < 32; i++, clut += 3)
421 if (prom_set_color(ih, i, clut[0], clut[1],
422 clut[2]) != 0)
423 break;
424
425#ifdef CONFIG_LOGO_LINUX_CLUT224
426 clut = PTRRELOC(logo_linux_clut224.clut);
427 for (i = 0; i < logo_linux_clut224.clutsize;
428 i++, clut += 3)
429 if (prom_set_color(ih, i + 32, clut[0],
430 clut[1], clut[2]) != 0)
431 break;
432#endif /* CONFIG_LOGO_LINUX_CLUT224 */
433 }
434 }
435
436 if (prom_stdout) {
437 phandle p;
438 p = call_prom("instance-to-package", 1, 1, prom_stdout);
439 if (p && p != -1) {
440 type[0] = 0;
441 call_prom("getprop", 4, 1, p, "device_type",
442 type, sizeof(type));
443 if (strcmp(type, "display") == 0)
444 call_prom("setprop", 4, 1, p, "linux,boot-display",
445 0, 0);
446 }
447 }
448
449 return ALIGNUL(mem);
450}
451
452/* This function will enable the early boot text when doing OF booting. This
453 * way, xmon output should work too
454 */
455static void __init
456setup_disp_fake_bi(ihandle dp)
457{
458#ifdef CONFIG_BOOTX_TEXT
459 int width = 640, height = 480, depth = 8, pitch;
460 unsigned address;
461 struct pci_reg_property addrs[8];
462 int i, naddrs;
463 char name[32];
464 char *getprop = "getprop";
465
466 prom_print("Initializing fake screen: ");
467
468 memset(name, 0, sizeof(name));
469 call_prom(getprop, 4, 1, dp, "name", name, sizeof(name));
470 name[sizeof(name)-1] = 0;
471 prom_print(name);
472 prom_print("\n");
473 call_prom(getprop, 4, 1, dp, "width", &width, sizeof(width));
474 call_prom(getprop, 4, 1, dp, "height", &height, sizeof(height));
475 call_prom(getprop, 4, 1, dp, "depth", &depth, sizeof(depth));
476 pitch = width * ((depth + 7) / 8);
477 call_prom(getprop, 4, 1, dp, "linebytes",
478 &pitch, sizeof(pitch));
479 if (pitch == 1)
480 pitch = 0x1000; /* for strange IBM display */
481 address = 0;
482 call_prom(getprop, 4, 1, dp, "address",
483 &address, sizeof(address));
484 if (address == 0) {
485 /* look for an assigned address with a size of >= 1MB */
486 naddrs = call_prom(getprop, 4, 1, dp, "assigned-addresses",
487 addrs, sizeof(addrs));
488 naddrs /= sizeof(struct pci_reg_property);
489 for (i = 0; i < naddrs; ++i) {
490 if (addrs[i].size_lo >= (1 << 20)) {
491 address = addrs[i].addr.a_lo;
492 /* use the BE aperture if possible */
493 if (addrs[i].size_lo >= (16 << 20))
494 address += (8 << 20);
495 break;
496 }
497 }
498 if (address == 0) {
499 prom_print("Failed to get address\n");
500 return;
501 }
502 }
503 /* kludge for valkyrie */
504 if (strcmp(name, "valkyrie") == 0)
505 address += 0x1000;
506
507#ifdef CONFIG_POWER4
508#if CONFIG_TASK_SIZE > 0x80000000
509#error CONFIG_TASK_SIZE cannot be above 0x80000000 with BOOTX_TEXT on G5
510#endif
511 {
512 extern boot_infos_t disp_bi;
513 unsigned long va, pa, i, offset;
514 va = 0x90000000;
515 pa = address & 0xfffff000ul;
516 offset = address & 0x00000fff;
517
518 for (i=0; i<0x4000; i++) {
519 make_pte((unsigned long)Hash - KERNELBASE, Hash_size, va, pa,
520 _PAGE_ACCESSED | _PAGE_NO_CACHE |
521 _PAGE_GUARDED | PP_RWXX);
522 va += 0x1000;
523 pa += 0x1000;
524 }
525 btext_setup_display(width, height, depth, pitch, 0x90000000 | offset);
526 disp_bi.dispDeviceBase = (u8 *)address;
527 }
528#else /* CONFIG_POWER4 */
529 btext_setup_display(width, height, depth, pitch, address);
530 btext_prepare_BAT();
531#endif /* CONFIG_POWER4 */
532#endif /* CONFIG_BOOTX_TEXT */
533}
534
535/*
536 * Make a copy of the device tree from the PROM.
537 */
538static unsigned long __init
539copy_device_tree(unsigned long mem_start, unsigned long mem_end)
540{
541 phandle root;
542 unsigned long new_start;
543 struct device_node **allnextp;
544
545 root = call_prom("peer", 1, 1, (phandle)0);
546 if (root == (phandle)0) {
547 prom_print("couldn't get device tree root\n");
548 prom_exit();
549 }
550 allnextp = &allnodes;
551 mem_start = ALIGNUL(mem_start);
552 new_start = inspect_node(root, NULL, mem_start, mem_end, &allnextp);
553 *allnextp = NULL;
554 return new_start;
555}
556
557static unsigned long __init
558inspect_node(phandle node, struct device_node *dad,
559 unsigned long mem_start, unsigned long mem_end,
560 struct device_node ***allnextpp)
561{
562 int l;
563 phandle child;
564 struct device_node *np;
565 struct property *pp, **prev_propp;
566 char *prev_name, *namep;
567 unsigned char *valp;
568
569 np = (struct device_node *) mem_start;
570 mem_start += sizeof(struct device_node);
571 memset(np, 0, sizeof(*np));
572 np->node = node;
573 **allnextpp = PTRUNRELOC(np);
574 *allnextpp = &np->allnext;
575 if (dad != 0) {
576 np->parent = PTRUNRELOC(dad);
577 /* we temporarily use the `next' field as `last_child'. */
578 if (dad->next == 0)
579 dad->child = PTRUNRELOC(np);
580 else
581 dad->next->sibling = PTRUNRELOC(np);
582 dad->next = np;
583 }
584
585 /* get and store all properties */
586 prev_propp = &np->properties;
587 prev_name = "";
588 for (;;) {
589 pp = (struct property *) mem_start;
590 namep = (char *) (pp + 1);
591 pp->name = PTRUNRELOC(namep);
592 if (call_prom("nextprop", 3, 1, node, prev_name, namep) <= 0)
593 break;
594 mem_start = ALIGNUL((unsigned long)namep + strlen(namep) + 1);
595 prev_name = namep;
596 valp = (unsigned char *) mem_start;
597 pp->value = PTRUNRELOC(valp);
598 pp->length = call_prom("getprop", 4, 1, node, namep,
599 valp, mem_end - mem_start);
600 if (pp->length < 0)
601 continue;
602#ifdef MAX_PROPERTY_LENGTH
603 if (pp->length > MAX_PROPERTY_LENGTH)
604 continue; /* ignore this property */
605#endif
606 mem_start = ALIGNUL(mem_start + pp->length);
607 *prev_propp = PTRUNRELOC(pp);
608 prev_propp = &pp->next;
609 }
610 if (np->node != 0) {
611 /* Add a "linux,phandle" property" */
612 pp = (struct property *) mem_start;
613 *prev_propp = PTRUNRELOC(pp);
614 prev_propp = &pp->next;
615 namep = (char *) (pp + 1);
616 pp->name = PTRUNRELOC(namep);
617 strcpy(namep, "linux,phandle");
618 mem_start = ALIGNUL((unsigned long)namep + strlen(namep) + 1);
619 pp->value = (unsigned char *) PTRUNRELOC(&np->node);
620 pp->length = sizeof(np->node);
621 }
622 *prev_propp = NULL;
623
624 /* get the node's full name */
625 l = call_prom("package-to-path", 3, 1, node,
626 mem_start, mem_end - mem_start);
627 if (l >= 0) {
628 char *p, *ep;
629
630 np->full_name = PTRUNRELOC((char *) mem_start);
631 *(char *)(mem_start + l) = 0;
632 /* Fixup an Apple bug where they have bogus \0 chars in the
633 * middle of the path in some properties
634 */
635 for (p = (char *)mem_start, ep = p + l; p < ep; p++)
636 if ((*p) == '\0') {
637 memmove(p, p+1, ep - p);
638 ep--;
639 }
640 mem_start = ALIGNUL(mem_start + l + 1);
641 }
642
643 /* do all our children */
644 child = call_prom("child", 1, 1, node);
645 while (child != 0) {
646 mem_start = inspect_node(child, np, mem_start, mem_end,
647 allnextpp);
648 child = call_prom("peer", 1, 1, child);
649 }
650
651 return mem_start;
652}
653
654unsigned long smp_chrp_cpu_nr __initdata = 0;
655
656/*
657 * With CHRP SMP we need to use the OF to start the other
658 * processors so we can't wait until smp_boot_cpus (the OF is
659 * trashed by then) so we have to put the processors into
660 * a holding pattern controlled by the kernel (not OF) before
661 * we destroy the OF.
662 *
663 * This uses a chunk of high memory, puts some holding pattern
664 * code there and sends the other processors off to there until
665 * smp_boot_cpus tells them to do something. We do that by using
666 * physical address 0x0. The holding pattern checks that address
667 * until its cpu # is there, when it is that cpu jumps to
668 * __secondary_start(). smp_boot_cpus() takes care of setting those
669 * values.
670 *
671 * We also use physical address 0x4 here to tell when a cpu
672 * is in its holding pattern code.
673 *
674 * -- Cort
675 *
676 * Note that we have to do this if we have more than one CPU,
677 * even if this is a UP kernel. Otherwise when we trash OF
678 * the other CPUs will start executing some random instructions
679 * and crash the system. -- paulus
680 */
681static void __init
682prom_hold_cpus(unsigned long mem)
683{
684 extern void __secondary_hold(void);
685 unsigned long i;
686 int cpu;
687 phandle node;
688 char type[16], *path;
689 unsigned int reg;
690
691 /*
692 * XXX: hack to make sure we're chrp, assume that if we're
693 * chrp we have a device_type property -- Cort
694 */
695 node = call_prom("finddevice", 1, 1, "/");
696 if (call_prom("getprop", 4, 1, node,
697 "device_type", type, sizeof(type)) <= 0)
698 return;
699
700 /* copy the holding pattern code to someplace safe (0) */
701 /* the holding pattern is now within the first 0x100
702 bytes of the kernel image -- paulus */
703 memcpy((void *)0, _stext, 0x100);
704 flush_icache_range(0, 0x100);
705
706 /* look for cpus */
707 *(unsigned long *)(0x0) = 0;
708 asm volatile("dcbf 0,%0": : "r" (0) : "memory");
709 for (node = 0; prom_next_node(&node); ) {
710 type[0] = 0;
711 call_prom("getprop", 4, 1, node, "device_type",
712 type, sizeof(type));
713 if (strcmp(type, "cpu") != 0)
714 continue;
715 path = (char *) mem;
716 memset(path, 0, 256);
717 if (call_prom("package-to-path", 3, 1, node, path, 255) < 0)
718 continue;
719 reg = -1;
720 call_prom("getprop", 4, 1, node, "reg", &reg, sizeof(reg));
721 cpu = smp_chrp_cpu_nr++;
722#ifdef CONFIG_SMP
723 smp_hw_index[cpu] = reg;
724#endif /* CONFIG_SMP */
725 /* XXX: hack - don't start cpu 0, this cpu -- Cort */
726 if (cpu == 0)
727 continue;
728 prom_print("starting cpu ");
729 prom_print(path);
730 *(ulong *)(0x4) = 0;
731 call_prom("start-cpu", 3, 0, node,
732 (char *)__secondary_hold - _stext, cpu);
733 prom_print("...");
734 for ( i = 0 ; (i < 10000) && (*(ulong *)(0x4) == 0); i++ )
735 ;
736 if (*(ulong *)(0x4) == cpu)
737 prom_print("ok\n");
738 else {
739 prom_print("failed: ");
740 prom_print_hex(*(ulong *)0x4);
741 prom_print("\n");
742 }
743 }
744}
745
746static void __init
747prom_instantiate_rtas(void)
748{
749 ihandle prom_rtas;
750 prom_arg_t result;
751
752 prom_rtas = call_prom("finddevice", 1, 1, "/rtas");
753 if (prom_rtas == -1)
754 return;
755
756 rtas_size = 0;
757 call_prom("getprop", 4, 1, prom_rtas,
758 "rtas-size", &rtas_size, sizeof(rtas_size));
759 prom_print("instantiating rtas");
760 if (rtas_size == 0) {
761 rtas_data = 0;
762 } else {
763 /*
764 * Ask OF for some space for RTAS.
765 * Actually OF has bugs so we just arbitrarily
766 * use memory at the 6MB point.
767 */
768 rtas_data = 6 << 20;
769 prom_print(" at ");
770 prom_print_hex(rtas_data);
771 }
772
773 prom_rtas = call_prom("open", 1, 1, "/rtas");
774 prom_print("...");
775 rtas_entry = 0;
776 if (call_prom_ret("call-method", 3, 2, &result,
777 "instantiate-rtas", prom_rtas, rtas_data) == 0)
778 rtas_entry = result;
779 if ((rtas_entry == -1) || (rtas_entry == 0))
780 prom_print(" failed\n");
781 else
782 prom_print(" done\n");
783}
784
785/*
786 * We enter here early on, when the Open Firmware prom is still
787 * handling exceptions and the MMU hash table for us.
788 */
789unsigned long __init
790prom_init(int r3, int r4, prom_entry pp)
791{
792 unsigned long mem;
793 ihandle prom_mmu;
794 unsigned long offset = reloc_offset();
795 int i, l;
796 char *p, *d;
797 unsigned long phys;
798 prom_arg_t result[3];
799 char model[32];
800 phandle node;
801 int rc;
802
803 /* Default */
804 phys = (unsigned long) &_stext;
805
806 /* First get a handle for the stdout device */
807 prom = pp;
808 prom_chosen = call_prom("finddevice", 1, 1, "/chosen");
809 if (prom_chosen == -1)
810 prom_exit();
811 if (call_prom("getprop", 4, 1, prom_chosen, "stdout",
812 &prom_stdout, sizeof(prom_stdout)) <= 0)
813 prom_exit();
814
815 /* Get the full OF pathname of the stdout device */
816 mem = (unsigned long) klimit + offset;
817 p = (char *) mem;
818 memset(p, 0, 256);
819 call_prom("instance-to-path", 3, 1, prom_stdout, p, 255);
820 of_stdout_device = p;
821 mem += strlen(p) + 1;
822
823 /* Get the boot device and translate it to a full OF pathname. */
824 p = (char *) mem;
825 l = call_prom("getprop", 4, 1, prom_chosen, "bootpath", p, 1<<20);
826 if (l > 0) {
827 p[l] = 0; /* should already be null-terminated */
828 bootpath = PTRUNRELOC(p);
829 mem += l + 1;
830 d = (char *) mem;
831 *d = 0;
832 call_prom("canon", 3, 1, p, d, 1<<20);
833 bootdevice = PTRUNRELOC(d);
834 mem = ALIGNUL(mem + strlen(d) + 1);
835 }
836
837 prom_instantiate_rtas();
838
839#ifdef CONFIG_POWER4
840 /*
841 * Find out how much memory we have and allocate a
842 * suitably-sized hash table.
843 */
844 prom_alloc_htab();
845#endif
846 mem = check_display(mem);
847
848 prom_print("copying OF device tree...");
849 mem = copy_device_tree(mem, mem + (1<<20));
850 prom_print("done\n");
851
852 prom_hold_cpus(mem);
853
854 klimit = (char *) (mem - offset);
855
856 node = call_prom("finddevice", 1, 1, "/");
857 rc = call_prom("getprop", 4, 1, node, "model", model, sizeof(model));
858 if (rc > 0 && !strncmp (model, "Pegasos", 7)
859 && strncmp (model, "Pegasos2", 8)) {
860 /* Pegasos 1 has a broken translate method in the OF,
861 * and furthermore the BATs are mapped 1:1 so the phys
862 * address calculated above is correct, so let's use
863 * it directly.
864 */
865 } else if (offset == 0) {
866 /* If we are already running at 0xc0000000, we assume we were
867 * loaded by an OF bootloader which did set a BAT for us.
868 * This breaks OF translate so we force phys to be 0.
869 */
870 prom_print("(already at 0xc0000000) phys=0\n");
871 phys = 0;
872 } else if (call_prom("getprop", 4, 1, prom_chosen, "mmu",
873 &prom_mmu, sizeof(prom_mmu)) <= 0) {
874 prom_print(" no MMU found\n");
875 } else if (call_prom_ret("call-method", 4, 4, result, "translate",
876 prom_mmu, &_stext, 1) != 0) {
877 prom_print(" (translate failed)\n");
878 } else {
879 /* We assume the phys. address size is 3 cells */
880 phys = result[2];
881 }
882
883 if (prom_disp_node != 0)
884 setup_disp_fake_bi(prom_disp_node);
885
886 /* Use quiesce call to get OF to shut down any devices it's using */
887 prom_print("Calling quiesce ...\n");
888 call_prom("quiesce", 0, 0);
889
890 /* Relocate various pointers which will be used once the
891 kernel is running at the address it was linked at. */
892 for (i = 0; i < prom_num_displays; ++i)
893 prom_display_paths[i] = PTRUNRELOC(prom_display_paths[i]);
894
895#ifdef CONFIG_SERIAL_CORE_CONSOLE
896 /* Relocate the of stdout for console autodetection */
897 of_stdout_device = PTRUNRELOC(of_stdout_device);
898#endif
899
900 prom_print("returning 0x");
901 prom_print_hex(phys);
902 prom_print("from prom_init\n");
903 prom_stdout = 0;
904
905 return phys;
906}
907
908/*
909 * early_get_property is used to access the device tree image prepared
910 * by BootX very early on, before the pointers in it have been relocated.
911 */
912static void * __init
913early_get_property(unsigned long base, unsigned long node, char *prop)
914{
915 struct device_node *np = (struct device_node *)(base + node);
916 struct property *pp;
917
918 for (pp = np->properties; pp != 0; pp = pp->next) {
919 pp = (struct property *) (base + (unsigned long)pp);
920 if (strcmp((char *)((unsigned long)pp->name + base),
921 prop) == 0) {
922 return (void *)((unsigned long)pp->value + base);
923 }
924 }
925 return NULL;
926}
927
928/* Is boot-info compatible ? */
929#define BOOT_INFO_IS_COMPATIBLE(bi) ((bi)->compatible_version <= BOOT_INFO_VERSION)
930#define BOOT_INFO_IS_V2_COMPATIBLE(bi) ((bi)->version >= 2)
931#define BOOT_INFO_IS_V4_COMPATIBLE(bi) ((bi)->version >= 4)
932
933void __init
934bootx_init(unsigned long r4, unsigned long phys)
935{
936 boot_infos_t *bi = (boot_infos_t *) r4;
937 unsigned long space;
938 unsigned long ptr, x;
939 char *model;
940
941 boot_infos = PTRUNRELOC(bi);
942 if (!BOOT_INFO_IS_V2_COMPATIBLE(bi))
943 bi->logicalDisplayBase = NULL;
944
945#ifdef CONFIG_BOOTX_TEXT
946 btext_init(bi);
947
948 /*
949 * Test if boot-info is compatible. Done only in config
950 * CONFIG_BOOTX_TEXT since there is nothing much we can do
951 * with an incompatible version, except display a message
952 * and eventually hang the processor...
953 *
954 * I'll try to keep enough of boot-info compatible in the
955 * future to always allow display of this message;
956 */
957 if (!BOOT_INFO_IS_COMPATIBLE(bi)) {
958 btext_drawstring(" !!! WARNING - Incompatible version of BootX !!!\n\n\n");
959 btext_flushscreen();
960 }
961#endif /* CONFIG_BOOTX_TEXT */
962
963 /* New BootX enters kernel with MMU off, i/os are not allowed
964 here. This hack will have been done by the boostrap anyway.
965 */
966 if (bi->version < 4) {
967 /*
968 * XXX If this is an iMac, turn off the USB controller.
969 */
970 model = (char *) early_get_property
971 (r4 + bi->deviceTreeOffset, 4, "model");
972 if (model
973 && (strcmp(model, "iMac,1") == 0
974 || strcmp(model, "PowerMac1,1") == 0)) {
975 out_le32((unsigned *)0x80880008, 1); /* XXX */
976 }
977 }
978
979 /* Move klimit to enclose device tree, args, ramdisk, etc... */
980 if (bi->version < 5) {
981 space = bi->deviceTreeOffset + bi->deviceTreeSize;
982 if (bi->ramDisk)
983 space = bi->ramDisk + bi->ramDiskSize;
984 } else
985 space = bi->totalParamsSize;
986 klimit = PTRUNRELOC((char *) bi + space);
987
988 /* New BootX will have flushed all TLBs and enters kernel with
989 MMU switched OFF, so this should not be useful anymore.
990 */
991 if (bi->version < 4) {
992 /*
993 * Touch each page to make sure the PTEs for them
994 * are in the hash table - the aim is to try to avoid
995 * getting DSI exceptions while copying the kernel image.
996 */
997 for (ptr = ((unsigned long) &_stext) & PAGE_MASK;
998 ptr < (unsigned long)bi + space; ptr += PAGE_SIZE)
999 x = *(volatile unsigned long *)ptr;
1000 }
1001
1002#ifdef CONFIG_BOOTX_TEXT
1003 /*
1004 * Note that after we call btext_prepare_BAT, we can't do
1005 * prom_draw*, flushscreen or clearscreen until we turn the MMU
1006 * on, since btext_prepare_BAT sets disp_bi.logicalDisplayBase
1007 * to a virtual address.
1008 */
1009 btext_prepare_BAT();
1010#endif
1011}
diff --git a/arch/ppc/syslib/todc_time.c b/arch/ppc/syslib/todc_time.c
index 1323c641c19d..a8168b8e5683 100644
--- a/arch/ppc/syslib/todc_time.c
+++ b/arch/ppc/syslib/todc_time.c
@@ -1,6 +1,4 @@
1/* 1/*
2 * arch/ppc/syslib/todc_time.c
3 *
4 * Time of Day Clock support for the M48T35, M48T37, M48T59, and MC146818 2 * Time of Day Clock support for the M48T35, M48T37, M48T59, and MC146818
5 * Real Time Clocks/Timekeepers. 3 * Real Time Clocks/Timekeepers.
6 * 4 *
diff --git a/arch/ppc/syslib/xilinx_pic.c b/arch/ppc/syslib/xilinx_pic.c
index 47f04c71fe9c..e672b600f315 100644
--- a/arch/ppc/syslib/xilinx_pic.c
+++ b/arch/ppc/syslib/xilinx_pic.c
@@ -1,6 +1,4 @@
1/* 1/*
2 * arch/ppc/syslib/xilinx_pic.c
3 *
4 * Interrupt controller driver for Xilinx Virtex-II Pro. 2 * Interrupt controller driver for Xilinx Virtex-II Pro.
5 * 3 *
6 * Author: MontaVista Software, Inc. 4 * Author: MontaVista Software, Inc.
@@ -15,7 +13,7 @@
15#include <linux/init.h> 13#include <linux/init.h>
16#include <linux/irq.h> 14#include <linux/irq.h>
17#include <asm/io.h> 15#include <asm/io.h>
18#include <asm/xparameters.h> 16#include <platforms/4xx/xparameters/xparameters.h>
19#include <asm/ibm4xx.h> 17#include <asm/ibm4xx.h>
20#include <asm/machdep.h> 18#include <asm/machdep.h>
21 19
diff --git a/arch/ppc/xmon/start.c b/arch/ppc/xmon/start.c
index ff86b2d814cb..cfc2d6ad464d 100644
--- a/arch/ppc/xmon/start.c
+++ b/arch/ppc/xmon/start.c
@@ -58,7 +58,7 @@ static struct sysrq_key_op sysrq_xmon_op =
58void 58void
59xmon_map_scc(void) 59xmon_map_scc(void)
60{ 60{
61#ifdef CONFIG_PPC_MULTIPLATFORM 61#ifdef CONFIG_PPC_PREP
62 volatile unsigned char *base; 62 volatile unsigned char *base;
63 63
64#elif defined(CONFIG_GEMINI) 64#elif defined(CONFIG_GEMINI)
diff --git a/arch/s390/Kconfig b/arch/s390/Kconfig
index b7ca5bf9acfc..01c5c082f970 100644
--- a/arch/s390/Kconfig
+++ b/arch/s390/Kconfig
@@ -14,6 +14,10 @@ config RWSEM_XCHGADD_ALGORITHM
14 bool 14 bool
15 default y 15 default y
16 16
17config GENERIC_HWEIGHT
18 bool
19 default y
20
17config GENERIC_CALIBRATE_DELAY 21config GENERIC_CALIBRATE_DELAY
18 bool 22 bool
19 default y 23 default y
@@ -460,6 +464,8 @@ config PCMCIA
460 464
461source "drivers/base/Kconfig" 465source "drivers/base/Kconfig"
462 466
467source "drivers/connector/Kconfig"
468
463source "drivers/scsi/Kconfig" 469source "drivers/scsi/Kconfig"
464 470
465source "drivers/s390/Kconfig" 471source "drivers/s390/Kconfig"
diff --git a/arch/s390/appldata/appldata_base.c b/arch/s390/appldata/appldata_base.c
index d06a8d71c71d..54d35c130907 100644
--- a/arch/s390/appldata/appldata_base.c
+++ b/arch/s390/appldata/appldata_base.c
@@ -531,12 +531,11 @@ int appldata_register_ops(struct appldata_ops *ops)
531 P_ERROR("ctl_nr %i already in use!\n", ops->ctl_nr); 531 P_ERROR("ctl_nr %i already in use!\n", ops->ctl_nr);
532 return -EBUSY; 532 return -EBUSY;
533 } 533 }
534 ops->ctl_table = kmalloc(4*sizeof(struct ctl_table), GFP_KERNEL); 534 ops->ctl_table = kzalloc(4*sizeof(struct ctl_table), GFP_KERNEL);
535 if (ops->ctl_table == NULL) { 535 if (ops->ctl_table == NULL) {
536 P_ERROR("Not enough memory for %s ctl_table!\n", ops->name); 536 P_ERROR("Not enough memory for %s ctl_table!\n", ops->name);
537 return -ENOMEM; 537 return -ENOMEM;
538 } 538 }
539 memset(ops->ctl_table, 0, 4*sizeof(struct ctl_table));
540 539
541 spin_lock(&appldata_ops_lock); 540 spin_lock(&appldata_ops_lock);
542 list_for_each(lh, &appldata_ops_list) { 541 list_for_each(lh, &appldata_ops_list) {
diff --git a/arch/s390/crypto/crypt_s390_query.c b/arch/s390/crypto/crypt_s390_query.c
index def02bdc44a4..54fb11d7fadd 100644
--- a/arch/s390/crypto/crypt_s390_query.c
+++ b/arch/s390/crypto/crypt_s390_query.c
@@ -55,7 +55,7 @@ static void query_available_functions(void)
55 printk(KERN_INFO "KMC_AES_256: %d\n", 55 printk(KERN_INFO "KMC_AES_256: %d\n",
56 crypt_s390_func_available(KMC_AES_256_ENCRYPT)); 56 crypt_s390_func_available(KMC_AES_256_ENCRYPT));
57 57
58 /* query available KIMD fucntions */ 58 /* query available KIMD functions */
59 printk(KERN_INFO "KIMD_QUERY: %d\n", 59 printk(KERN_INFO "KIMD_QUERY: %d\n",
60 crypt_s390_func_available(KIMD_QUERY)); 60 crypt_s390_func_available(KIMD_QUERY));
61 printk(KERN_INFO "KIMD_SHA_1: %d\n", 61 printk(KERN_INFO "KIMD_SHA_1: %d\n",
diff --git a/arch/s390/kernel/compat_linux.c b/arch/s390/kernel/compat_linux.c
index cc058dc3bc8b..5e14de37c17b 100644
--- a/arch/s390/kernel/compat_linux.c
+++ b/arch/s390/kernel/compat_linux.c
@@ -26,7 +26,6 @@
26#include <linux/resource.h> 26#include <linux/resource.h>
27#include <linux/times.h> 27#include <linux/times.h>
28#include <linux/utsname.h> 28#include <linux/utsname.h>
29#include <linux/timex.h>
30#include <linux/smp.h> 29#include <linux/smp.h>
31#include <linux/smp_lock.h> 30#include <linux/smp_lock.h>
32#include <linux/sem.h> 31#include <linux/sem.h>
@@ -705,79 +704,6 @@ asmlinkage long sys32_sendfile64(int out_fd, int in_fd,
705 return ret; 704 return ret;
706} 705}
707 706
708/* Handle adjtimex compatibility. */
709
710struct timex32 {
711 u32 modes;
712 s32 offset, freq, maxerror, esterror;
713 s32 status, constant, precision, tolerance;
714 struct compat_timeval time;
715 s32 tick;
716 s32 ppsfreq, jitter, shift, stabil;
717 s32 jitcnt, calcnt, errcnt, stbcnt;
718 s32 :32; s32 :32; s32 :32; s32 :32;
719 s32 :32; s32 :32; s32 :32; s32 :32;
720 s32 :32; s32 :32; s32 :32; s32 :32;
721};
722
723extern int do_adjtimex(struct timex *);
724
725asmlinkage long sys32_adjtimex(struct timex32 __user *utp)
726{
727 struct timex txc;
728 int ret;
729
730 memset(&txc, 0, sizeof(struct timex));
731
732 if(get_user(txc.modes, &utp->modes) ||
733 __get_user(txc.offset, &utp->offset) ||
734 __get_user(txc.freq, &utp->freq) ||
735 __get_user(txc.maxerror, &utp->maxerror) ||
736 __get_user(txc.esterror, &utp->esterror) ||
737 __get_user(txc.status, &utp->status) ||
738 __get_user(txc.constant, &utp->constant) ||
739 __get_user(txc.precision, &utp->precision) ||
740 __get_user(txc.tolerance, &utp->tolerance) ||
741 __get_user(txc.time.tv_sec, &utp->time.tv_sec) ||
742 __get_user(txc.time.tv_usec, &utp->time.tv_usec) ||
743 __get_user(txc.tick, &utp->tick) ||
744 __get_user(txc.ppsfreq, &utp->ppsfreq) ||
745 __get_user(txc.jitter, &utp->jitter) ||
746 __get_user(txc.shift, &utp->shift) ||
747 __get_user(txc.stabil, &utp->stabil) ||
748 __get_user(txc.jitcnt, &utp->jitcnt) ||
749 __get_user(txc.calcnt, &utp->calcnt) ||
750 __get_user(txc.errcnt, &utp->errcnt) ||
751 __get_user(txc.stbcnt, &utp->stbcnt))
752 return -EFAULT;
753
754 ret = do_adjtimex(&txc);
755
756 if(put_user(txc.modes, &utp->modes) ||
757 __put_user(txc.offset, &utp->offset) ||
758 __put_user(txc.freq, &utp->freq) ||
759 __put_user(txc.maxerror, &utp->maxerror) ||
760 __put_user(txc.esterror, &utp->esterror) ||
761 __put_user(txc.status, &utp->status) ||
762 __put_user(txc.constant, &utp->constant) ||
763 __put_user(txc.precision, &utp->precision) ||
764 __put_user(txc.tolerance, &utp->tolerance) ||
765 __put_user(txc.time.tv_sec, &utp->time.tv_sec) ||
766 __put_user(txc.time.tv_usec, &utp->time.tv_usec) ||
767 __put_user(txc.tick, &utp->tick) ||
768 __put_user(txc.ppsfreq, &utp->ppsfreq) ||
769 __put_user(txc.jitter, &utp->jitter) ||
770 __put_user(txc.shift, &utp->shift) ||
771 __put_user(txc.stabil, &utp->stabil) ||
772 __put_user(txc.jitcnt, &utp->jitcnt) ||
773 __put_user(txc.calcnt, &utp->calcnt) ||
774 __put_user(txc.errcnt, &utp->errcnt) ||
775 __put_user(txc.stbcnt, &utp->stbcnt))
776 ret = -EFAULT;
777
778 return ret;
779}
780
781#ifdef CONFIG_SYSCTL 707#ifdef CONFIG_SYSCTL
782struct __sysctl_args32 { 708struct __sysctl_args32 {
783 u32 name; 709 u32 name;
diff --git a/arch/s390/kernel/compat_wrapper.S b/arch/s390/kernel/compat_wrapper.S
index 50e80138e7ad..199da68bd7be 100644
--- a/arch/s390/kernel/compat_wrapper.S
+++ b/arch/s390/kernel/compat_wrapper.S
@@ -551,10 +551,10 @@ sys32_newuname_wrapper:
551 llgtr %r2,%r2 # struct new_utsname * 551 llgtr %r2,%r2 # struct new_utsname *
552 jg s390x_newuname # branch to system call 552 jg s390x_newuname # branch to system call
553 553
554 .globl sys32_adjtimex_wrapper 554 .globl compat_sys_adjtimex_wrapper
555sys32_adjtimex_wrapper: 555compat_sys_adjtimex_wrapper:
556 llgtr %r2,%r2 # struct timex_emu31 * 556 llgtr %r2,%r2 # struct compat_timex *
557 jg sys32_adjtimex # branch to system call 557 jg compat_sys_adjtimex # branch to system call
558 558
559 .globl sys32_mprotect_wrapper 559 .globl sys32_mprotect_wrapper
560sys32_mprotect_wrapper: 560sys32_mprotect_wrapper:
diff --git a/arch/s390/kernel/debug.c b/arch/s390/kernel/debug.c
index 896d39d0e4ce..06a3fbc12536 100644
--- a/arch/s390/kernel/debug.c
+++ b/arch/s390/kernel/debug.c
@@ -204,16 +204,13 @@ debug_areas_alloc(int pages_per_area, int nr_areas)
204 goto fail_malloc_areas2; 204 goto fail_malloc_areas2;
205 } 205 }
206 for(j = 0; j < pages_per_area; j++) { 206 for(j = 0; j < pages_per_area; j++) {
207 areas[i][j] = (debug_entry_t*)kmalloc(PAGE_SIZE, 207 areas[i][j] = kzalloc(PAGE_SIZE, GFP_KERNEL);
208 GFP_KERNEL);
209 if(!areas[i][j]) { 208 if(!areas[i][j]) {
210 for(j--; j >=0 ; j--) { 209 for(j--; j >=0 ; j--) {
211 kfree(areas[i][j]); 210 kfree(areas[i][j]);
212 } 211 }
213 kfree(areas[i]); 212 kfree(areas[i]);
214 goto fail_malloc_areas2; 213 goto fail_malloc_areas2;
215 } else {
216 memset(areas[i][j],0,PAGE_SIZE);
217 } 214 }
218 } 215 }
219 } 216 }
@@ -249,14 +246,12 @@ debug_info_alloc(char *name, int pages_per_area, int nr_areas, int buf_size,
249 rc = (debug_info_t*) kmalloc(sizeof(debug_info_t), GFP_KERNEL); 246 rc = (debug_info_t*) kmalloc(sizeof(debug_info_t), GFP_KERNEL);
250 if(!rc) 247 if(!rc)
251 goto fail_malloc_rc; 248 goto fail_malloc_rc;
252 rc->active_entries = (int*)kmalloc(nr_areas * sizeof(int), GFP_KERNEL); 249 rc->active_entries = kcalloc(nr_areas, sizeof(int), GFP_KERNEL);
253 if(!rc->active_entries) 250 if(!rc->active_entries)
254 goto fail_malloc_active_entries; 251 goto fail_malloc_active_entries;
255 memset(rc->active_entries, 0, nr_areas * sizeof(int)); 252 rc->active_pages = kcalloc(nr_areas, sizeof(int), GFP_KERNEL);
256 rc->active_pages = (int*)kmalloc(nr_areas * sizeof(int), GFP_KERNEL);
257 if(!rc->active_pages) 253 if(!rc->active_pages)
258 goto fail_malloc_active_pages; 254 goto fail_malloc_active_pages;
259 memset(rc->active_pages, 0, nr_areas * sizeof(int));
260 if((mode == ALL_AREAS) && (pages_per_area != 0)){ 255 if((mode == ALL_AREAS) && (pages_per_area != 0)){
261 rc->areas = debug_areas_alloc(pages_per_area, nr_areas); 256 rc->areas = debug_areas_alloc(pages_per_area, nr_areas);
262 if(!rc->areas) 257 if(!rc->areas)
diff --git a/arch/s390/kernel/process.c b/arch/s390/kernel/process.c
index da6fbae8df91..4a0f5a1551ea 100644
--- a/arch/s390/kernel/process.c
+++ b/arch/s390/kernel/process.c
@@ -76,17 +76,17 @@ unsigned long thread_saved_pc(struct task_struct *tsk)
76/* 76/*
77 * Need to know about CPUs going idle? 77 * Need to know about CPUs going idle?
78 */ 78 */
79static struct notifier_block *idle_chain; 79static ATOMIC_NOTIFIER_HEAD(idle_chain);
80 80
81int register_idle_notifier(struct notifier_block *nb) 81int register_idle_notifier(struct notifier_block *nb)
82{ 82{
83 return notifier_chain_register(&idle_chain, nb); 83 return atomic_notifier_chain_register(&idle_chain, nb);
84} 84}
85EXPORT_SYMBOL(register_idle_notifier); 85EXPORT_SYMBOL(register_idle_notifier);
86 86
87int unregister_idle_notifier(struct notifier_block *nb) 87int unregister_idle_notifier(struct notifier_block *nb)
88{ 88{
89 return notifier_chain_unregister(&idle_chain, nb); 89 return atomic_notifier_chain_unregister(&idle_chain, nb);
90} 90}
91EXPORT_SYMBOL(unregister_idle_notifier); 91EXPORT_SYMBOL(unregister_idle_notifier);
92 92
@@ -95,7 +95,7 @@ void do_monitor_call(struct pt_regs *regs, long interruption_code)
95 /* disable monitor call class 0 */ 95 /* disable monitor call class 0 */
96 __ctl_clear_bit(8, 15); 96 __ctl_clear_bit(8, 15);
97 97
98 notifier_call_chain(&idle_chain, CPU_NOT_IDLE, 98 atomic_notifier_call_chain(&idle_chain, CPU_NOT_IDLE,
99 (void *)(long) smp_processor_id()); 99 (void *)(long) smp_processor_id());
100} 100}
101 101
@@ -103,7 +103,7 @@ extern void s390_handle_mcck(void);
103/* 103/*
104 * The idle loop on a S390... 104 * The idle loop on a S390...
105 */ 105 */
106void default_idle(void) 106static void default_idle(void)
107{ 107{
108 int cpu, rc; 108 int cpu, rc;
109 109
@@ -116,7 +116,8 @@ void default_idle(void)
116 return; 116 return;
117 } 117 }
118 118
119 rc = notifier_call_chain(&idle_chain, CPU_IDLE, (void *)(long) cpu); 119 rc = atomic_notifier_call_chain(&idle_chain,
120 CPU_IDLE, (void *)(long) cpu);
120 if (rc != NOTIFY_OK && rc != NOTIFY_DONE) 121 if (rc != NOTIFY_OK && rc != NOTIFY_DONE)
121 BUG(); 122 BUG();
122 if (rc != NOTIFY_OK) { 123 if (rc != NOTIFY_OK) {
diff --git a/arch/s390/kernel/setup.c b/arch/s390/kernel/setup.c
index 24f62f16c0e5..0a04e4a564b2 100644
--- a/arch/s390/kernel/setup.c
+++ b/arch/s390/kernel/setup.c
@@ -78,8 +78,6 @@ extern int _text,_etext, _edata, _end;
78 78
79#include <asm/setup.h> 79#include <asm/setup.h>
80 80
81static char command_line[COMMAND_LINE_SIZE] = { 0, };
82
83static struct resource code_resource = { 81static struct resource code_resource = {
84 .name = "Kernel code", 82 .name = "Kernel code",
85 .start = (unsigned long) &_text, 83 .start = (unsigned long) &_text,
@@ -335,63 +333,38 @@ add_memory_hole(unsigned long start, unsigned long end)
335 } 333 }
336} 334}
337 335
338static void __init 336static int __init early_parse_mem(char *p)
339parse_cmdline_early(char **cmdline_p) 337{
338 memory_end = memparse(p, &p);
339 return 0;
340}
341early_param("mem", early_parse_mem);
342
343/*
344 * "ipldelay=XXX[sm]" sets ipl delay in seconds or minutes
345 */
346static int __init early_parse_ipldelay(char *p)
340{ 347{
341 char c = ' ', cn, *to = command_line, *from = COMMAND_LINE;
342 unsigned long delay = 0; 348 unsigned long delay = 0;
343 349
344 /* Save unparsed command line copy for /proc/cmdline */ 350 delay = simple_strtoul(p, &p, 0);
345 memcpy(saved_command_line, COMMAND_LINE, COMMAND_LINE_SIZE);
346 saved_command_line[COMMAND_LINE_SIZE-1] = '\0';
347 351
348 for (;;) { 352 switch (*p) {
349 /* 353 case 's':
350 * "mem=XXX[kKmM]" sets memsize 354 case 'S':
351 */ 355 delay *= 1000000;
352 if (c == ' ' && strncmp(from, "mem=", 4) == 0) { 356 break;
353 memory_end = simple_strtoul(from+4, &from, 0); 357 case 'm':
354 if ( *from == 'K' || *from == 'k' ) { 358 case 'M':
355 memory_end = memory_end << 10; 359 delay *= 60 * 1000000;
356 from++;
357 } else if ( *from == 'M' || *from == 'm' ) {
358 memory_end = memory_end << 20;
359 from++;
360 }
361 }
362 /*
363 * "ipldelay=XXX[sm]" sets ipl delay in seconds or minutes
364 */
365 if (c == ' ' && strncmp(from, "ipldelay=", 9) == 0) {
366 delay = simple_strtoul(from+9, &from, 0);
367 if (*from == 's' || *from == 'S') {
368 delay = delay*1000000;
369 from++;
370 } else if (*from == 'm' || *from == 'M') {
371 delay = delay*60*1000000;
372 from++;
373 }
374 /* now wait for the requested amount of time */
375 udelay(delay);
376 }
377 cn = *(from++);
378 if (!cn)
379 break;
380 if (cn == '\n')
381 cn = ' '; /* replace newlines with space */
382 if (cn == 0x0d)
383 cn = ' '; /* replace 0x0d with space */
384 if (cn == ' ' && c == ' ')
385 continue; /* remove additional spaces */
386 c = cn;
387 if (to - command_line >= COMMAND_LINE_SIZE)
388 break;
389 *(to++) = c;
390 } 360 }
391 if (c == ' ' && to > command_line) to--; 361
392 *to = '\0'; 362 /* now wait for the requested amount of time */
393 *cmdline_p = command_line; 363 udelay(delay);
364
365 return 0;
394} 366}
367early_param("ipldelay", early_parse_ipldelay);
395 368
396static void __init 369static void __init
397setup_lowcore(void) 370setup_lowcore(void)
@@ -580,9 +553,26 @@ setup_arch(char **cmdline_p)
580 "We are running native (64 bit mode)\n"); 553 "We are running native (64 bit mode)\n");
581#endif /* CONFIG_64BIT */ 554#endif /* CONFIG_64BIT */
582 555
556 /* Save unparsed command line copy for /proc/cmdline */
557 strlcpy(saved_command_line, COMMAND_LINE, COMMAND_LINE_SIZE);
558
559 *cmdline_p = COMMAND_LINE;
560 *(*cmdline_p + COMMAND_LINE_SIZE - 1) = '\0';
561
583 ROOT_DEV = Root_RAM0; 562 ROOT_DEV = Root_RAM0;
563
564 init_mm.start_code = PAGE_OFFSET;
565 init_mm.end_code = (unsigned long) &_etext;
566 init_mm.end_data = (unsigned long) &_edata;
567 init_mm.brk = (unsigned long) &_end;
568
569 memory_end = memory_size;
570
571 parse_early_param();
572
584#ifndef CONFIG_64BIT 573#ifndef CONFIG_64BIT
585 memory_end = memory_size & ~0x400000UL; /* align memory end to 4MB */ 574 memory_end &= ~0x400000UL;
575
586 /* 576 /*
587 * We need some free virtual space to be able to do vmalloc. 577 * We need some free virtual space to be able to do vmalloc.
588 * On a machine with 2GB memory we make sure that we have at 578 * On a machine with 2GB memory we make sure that we have at
@@ -591,17 +581,9 @@ setup_arch(char **cmdline_p)
591 if (memory_end > 1920*1024*1024) 581 if (memory_end > 1920*1024*1024)
592 memory_end = 1920*1024*1024; 582 memory_end = 1920*1024*1024;
593#else /* CONFIG_64BIT */ 583#else /* CONFIG_64BIT */
594 memory_end = memory_size & ~0x200000UL; /* detected in head.s */ 584 memory_end &= ~0x200000UL;
595#endif /* CONFIG_64BIT */ 585#endif /* CONFIG_64BIT */
596 586
597 init_mm.start_code = PAGE_OFFSET;
598 init_mm.end_code = (unsigned long) &_etext;
599 init_mm.end_data = (unsigned long) &_edata;
600 init_mm.brk = (unsigned long) &_end;
601
602 parse_cmdline_early(cmdline_p);
603 parse_early_param();
604
605 setup_memory(); 587 setup_memory();
606 setup_resources(); 588 setup_resources();
607 setup_lowcore(); 589 setup_lowcore();
diff --git a/arch/s390/kernel/smp.c b/arch/s390/kernel/smp.c
index 7dbe00c76c6b..343120c9223d 100644
--- a/arch/s390/kernel/smp.c
+++ b/arch/s390/kernel/smp.c
@@ -665,7 +665,9 @@ __cpu_up(unsigned int cpu)
665 cpu_lowcore->current_task = (unsigned long) idle; 665 cpu_lowcore->current_task = (unsigned long) idle;
666 cpu_lowcore->cpu_data.cpu_nr = cpu; 666 cpu_lowcore->cpu_data.cpu_nr = cpu;
667 eieio(); 667 eieio();
668 signal_processor(cpu,sigp_restart); 668
669 while (signal_processor(cpu,sigp_restart) == sigp_busy)
670 udelay(10);
669 671
670 while (!cpu_online(cpu)) 672 while (!cpu_online(cpu))
671 cpu_relax(); 673 cpu_relax();
@@ -799,9 +801,7 @@ void __init smp_prepare_cpus(unsigned int max_cpus)
799 */ 801 */
800 print_cpu_info(&S390_lowcore.cpu_data); 802 print_cpu_info(&S390_lowcore.cpu_data);
801 803
802 for(i = 0; i < NR_CPUS; i++) { 804 for_each_possible_cpu(i) {
803 if (!cpu_possible(i))
804 continue;
805 lowcore_ptr[i] = (struct _lowcore *) 805 lowcore_ptr[i] = (struct _lowcore *)
806 __get_free_pages(GFP_KERNEL|GFP_DMA, 806 __get_free_pages(GFP_KERNEL|GFP_DMA,
807 sizeof(void*) == 8 ? 1 : 0); 807 sizeof(void*) == 8 ? 1 : 0);
@@ -831,7 +831,7 @@ void __init smp_prepare_cpus(unsigned int max_cpus)
831#endif 831#endif
832 set_prefix((u32)(unsigned long) lowcore_ptr[smp_processor_id()]); 832 set_prefix((u32)(unsigned long) lowcore_ptr[smp_processor_id()]);
833 833
834 for_each_cpu(cpu) 834 for_each_possible_cpu(cpu)
835 if (cpu != smp_processor_id()) 835 if (cpu != smp_processor_id())
836 smp_create_idle(cpu); 836 smp_create_idle(cpu);
837} 837}
@@ -868,7 +868,7 @@ static int __init topology_init(void)
868 int cpu; 868 int cpu;
869 int ret; 869 int ret;
870 870
871 for_each_cpu(cpu) { 871 for_each_possible_cpu(cpu) {
872 ret = register_cpu(&per_cpu(cpu_devices, cpu), cpu, NULL); 872 ret = register_cpu(&per_cpu(cpu_devices, cpu), cpu, NULL);
873 if (ret) 873 if (ret)
874 printk(KERN_WARNING "topology_init: register_cpu %d " 874 printk(KERN_WARNING "topology_init: register_cpu %d "
diff --git a/arch/s390/kernel/syscalls.S b/arch/s390/kernel/syscalls.S
index 7c88d85c3597..2f56654da821 100644
--- a/arch/s390/kernel/syscalls.S
+++ b/arch/s390/kernel/syscalls.S
@@ -132,7 +132,7 @@ SYSCALL(sys_clone_glue,sys_clone_glue,sys32_clone_glue) /* 120 */
132SYSCALL(sys_setdomainname,sys_setdomainname,sys32_setdomainname_wrapper) 132SYSCALL(sys_setdomainname,sys_setdomainname,sys32_setdomainname_wrapper)
133SYSCALL(sys_newuname,s390x_newuname,sys32_newuname_wrapper) 133SYSCALL(sys_newuname,s390x_newuname,sys32_newuname_wrapper)
134NI_SYSCALL /* modify_ldt for i386 */ 134NI_SYSCALL /* modify_ldt for i386 */
135SYSCALL(sys_adjtimex,sys_adjtimex,sys32_adjtimex_wrapper) 135SYSCALL(sys_adjtimex,sys_adjtimex,compat_sys_adjtimex_wrapper)
136SYSCALL(sys_mprotect,sys_mprotect,sys32_mprotect_wrapper) /* 125 */ 136SYSCALL(sys_mprotect,sys_mprotect,sys32_mprotect_wrapper) /* 125 */
137SYSCALL(sys_sigprocmask,sys_sigprocmask,compat_sys_sigprocmask_wrapper) 137SYSCALL(sys_sigprocmask,sys_sigprocmask,compat_sys_sigprocmask_wrapper)
138NI_SYSCALL /* old "create module" */ 138NI_SYSCALL /* old "create module" */
diff --git a/arch/s390/mm/cmm.c b/arch/s390/mm/cmm.c
index b075ab499d05..51596f429235 100644
--- a/arch/s390/mm/cmm.c
+++ b/arch/s390/mm/cmm.c
@@ -339,19 +339,19 @@ static struct ctl_table cmm_table[] = {
339 { 339 {
340 .ctl_name = VM_CMM_PAGES, 340 .ctl_name = VM_CMM_PAGES,
341 .procname = "cmm_pages", 341 .procname = "cmm_pages",
342 .mode = 0600, 342 .mode = 0644,
343 .proc_handler = &cmm_pages_handler, 343 .proc_handler = &cmm_pages_handler,
344 }, 344 },
345 { 345 {
346 .ctl_name = VM_CMM_TIMED_PAGES, 346 .ctl_name = VM_CMM_TIMED_PAGES,
347 .procname = "cmm_timed_pages", 347 .procname = "cmm_timed_pages",
348 .mode = 0600, 348 .mode = 0644,
349 .proc_handler = &cmm_pages_handler, 349 .proc_handler = &cmm_pages_handler,
350 }, 350 },
351 { 351 {
352 .ctl_name = VM_CMM_TIMEOUT, 352 .ctl_name = VM_CMM_TIMEOUT,
353 .procname = "cmm_timeout", 353 .procname = "cmm_timeout",
354 .mode = 0600, 354 .mode = 0644,
355 .proc_handler = &cmm_timeout_handler, 355 .proc_handler = &cmm_timeout_handler,
356 }, 356 },
357 { .ctl_name = 0 } 357 { .ctl_name = 0 }
diff --git a/arch/s390/mm/init.c b/arch/s390/mm/init.c
index df953383724d..a055894f3bd8 100644
--- a/arch/s390/mm/init.c
+++ b/arch/s390/mm/init.c
@@ -292,7 +292,7 @@ void free_initmem(void)
292 addr = (unsigned long)(&__init_begin); 292 addr = (unsigned long)(&__init_begin);
293 for (; addr < (unsigned long)(&__init_end); addr += PAGE_SIZE) { 293 for (; addr < (unsigned long)(&__init_end); addr += PAGE_SIZE) {
294 ClearPageReserved(virt_to_page(addr)); 294 ClearPageReserved(virt_to_page(addr));
295 set_page_count(virt_to_page(addr), 1); 295 init_page_count(virt_to_page(addr));
296 free_page(addr); 296 free_page(addr);
297 totalram_pages++; 297 totalram_pages++;
298 } 298 }
@@ -307,7 +307,7 @@ void free_initrd_mem(unsigned long start, unsigned long end)
307 printk ("Freeing initrd memory: %ldk freed\n", (end - start) >> 10); 307 printk ("Freeing initrd memory: %ldk freed\n", (end - start) >> 10);
308 for (; start < end; start += PAGE_SIZE) { 308 for (; start < end; start += PAGE_SIZE) {
309 ClearPageReserved(virt_to_page(start)); 309 ClearPageReserved(virt_to_page(start));
310 set_page_count(virt_to_page(start), 1); 310 init_page_count(virt_to_page(start));
311 free_page(start); 311 free_page(start);
312 totalram_pages++; 312 totalram_pages++;
313 } 313 }
diff --git a/arch/sh/Kconfig b/arch/sh/Kconfig
index e9b275d90737..58583f459471 100644
--- a/arch/sh/Kconfig
+++ b/arch/sh/Kconfig
@@ -21,6 +21,14 @@ config RWSEM_GENERIC_SPINLOCK
21config RWSEM_XCHGADD_ALGORITHM 21config RWSEM_XCHGADD_ALGORITHM
22 bool 22 bool
23 23
24config GENERIC_FIND_NEXT_BIT
25 bool
26 default y
27
28config GENERIC_HWEIGHT
29 bool
30 default y
31
24config GENERIC_HARDIRQS 32config GENERIC_HARDIRQS
25 bool 33 bool
26 default y 34 default y
diff --git a/arch/sh/Makefile b/arch/sh/Makefile
index 08c9515c4806..c72e17a96eed 100644
--- a/arch/sh/Makefile
+++ b/arch/sh/Makefile
@@ -172,7 +172,7 @@ include/asm-sh/.mach: $(wildcard include/config/sh/*.h) include/config/MARKER
172 172
173archprepare: maketools include/asm-sh/.cpu include/asm-sh/.mach 173archprepare: maketools include/asm-sh/.cpu include/asm-sh/.mach
174 174
175.PHONY: maketools FORCE 175PHONY += maketools FORCE
176maketools: include/linux/version.h FORCE 176maketools: include/linux/version.h FORCE
177 $(Q)$(MAKE) $(build)=arch/sh/tools include/asm-sh/machtypes.h 177 $(Q)$(MAKE) $(build)=arch/sh/tools include/asm-sh/machtypes.h
178 178
diff --git a/arch/sh/boards/mpc1211/rtc.c b/arch/sh/boards/mpc1211/rtc.c
index 4d100f048072..a76c655dceee 100644
--- a/arch/sh/boards/mpc1211/rtc.c
+++ b/arch/sh/boards/mpc1211/rtc.c
@@ -9,36 +9,16 @@
9#include <linux/kernel.h> 9#include <linux/kernel.h>
10#include <linux/sched.h> 10#include <linux/sched.h>
11#include <linux/time.h> 11#include <linux/time.h>
12#include <linux/bcd.h>
12#include <linux/mc146818rtc.h> 13#include <linux/mc146818rtc.h>
13 14
14#ifndef BCD_TO_BIN
15#define BCD_TO_BIN(val) ((val)=((val)&15) + ((val)>>4)*10)
16#endif
17
18#ifndef BIN_TO_BCD
19#define BIN_TO_BCD(val) ((val)=(((val)/10)<<4) + (val)%10)
20#endif
21
22/* arc/i386/kernel/time.c */
23unsigned long get_cmos_time(void) 15unsigned long get_cmos_time(void)
24{ 16{
25 unsigned int year, mon, day, hour, min, sec; 17 unsigned int year, mon, day, hour, min, sec;
26 int i;
27 18
28 spin_lock(&rtc_lock); 19 spin_lock(&rtc_lock);
29 /* The Linux interpretation of the CMOS clock register contents: 20
30 * When the Update-In-Progress (UIP) flag goes from 1 to 0, the 21 do {
31 * RTC registers show the second which has precisely just started.
32 * Let's hope other operating systems interpret the RTC the same way.
33 */
34 /* read RTC exactly on falling edge of update flag */
35 for (i = 0 ; i < 1000000 ; i++) /* may take up to 1 second... */
36 if (CMOS_READ(RTC_FREQ_SELECT) & RTC_UIP)
37 break;
38 for (i = 0 ; i < 1000000 ; i++) /* must try at least 2.228 ms */
39 if (!(CMOS_READ(RTC_FREQ_SELECT) & RTC_UIP))
40 break;
41 do { /* Isn't this overkill ? UIP above should guarantee consistency */
42 sec = CMOS_READ(RTC_SECONDS); 22 sec = CMOS_READ(RTC_SECONDS);
43 min = CMOS_READ(RTC_MINUTES); 23 min = CMOS_READ(RTC_MINUTES);
44 hour = CMOS_READ(RTC_HOURS); 24 hour = CMOS_READ(RTC_HOURS);
@@ -46,18 +26,22 @@ unsigned long get_cmos_time(void)
46 mon = CMOS_READ(RTC_MONTH); 26 mon = CMOS_READ(RTC_MONTH);
47 year = CMOS_READ(RTC_YEAR); 27 year = CMOS_READ(RTC_YEAR);
48 } while (sec != CMOS_READ(RTC_SECONDS)); 28 } while (sec != CMOS_READ(RTC_SECONDS));
49 if (!(CMOS_READ(RTC_CONTROL) & RTC_DM_BINARY) || RTC_ALWAYS_BCD) 29
50 { 30 if (!(CMOS_READ(RTC_CONTROL) & RTC_DM_BINARY) || RTC_ALWAYS_BCD) {
51 BCD_TO_BIN(sec); 31 BCD_TO_BIN(sec);
52 BCD_TO_BIN(min); 32 BCD_TO_BIN(min);
53 BCD_TO_BIN(hour); 33 BCD_TO_BIN(hour);
54 BCD_TO_BIN(day); 34 BCD_TO_BIN(day);
55 BCD_TO_BIN(mon); 35 BCD_TO_BIN(mon);
56 BCD_TO_BIN(year); 36 BCD_TO_BIN(year);
57 } 37 }
38
58 spin_unlock(&rtc_lock); 39 spin_unlock(&rtc_lock);
59 if ((year += 1900) < 1970) 40
41 year += 1900;
42 if (year < 1970)
60 year += 100; 43 year += 100;
44
61 return mktime(year, mon, day, hour, min, sec); 45 return mktime(year, mon, day, hour, min, sec);
62} 46}
63 47
diff --git a/arch/sh/boards/sh03/rtc.c b/arch/sh/boards/sh03/rtc.c
index cbeca7037ba5..d609863cfe53 100644
--- a/arch/sh/boards/sh03/rtc.c
+++ b/arch/sh/boards/sh03/rtc.c
@@ -9,6 +9,7 @@
9#include <linux/kernel.h> 9#include <linux/kernel.h>
10#include <linux/sched.h> 10#include <linux/sched.h>
11#include <linux/time.h> 11#include <linux/time.h>
12#include <linux/bcd.h>
12#include <asm/io.h> 13#include <asm/io.h>
13#include <linux/rtc.h> 14#include <linux/rtc.h>
14#include <linux/spinlock.h> 15#include <linux/spinlock.h>
@@ -33,14 +34,6 @@
33#define RTC_BUSY 1 34#define RTC_BUSY 1
34#define RTC_STOP 2 35#define RTC_STOP 2
35 36
36#ifndef BCD_TO_BIN
37#define BCD_TO_BIN(val) ((val)=((val)&15) + ((val)>>4)*10)
38#endif
39
40#ifndef BIN_TO_BCD
41#define BIN_TO_BCD(val) ((val)=(((val)/10)<<4) + (val)%10)
42#endif
43
44extern void (*rtc_get_time)(struct timespec *); 37extern void (*rtc_get_time)(struct timespec *);
45extern int (*rtc_set_time)(const time_t); 38extern int (*rtc_set_time)(const time_t);
46extern spinlock_t rtc_lock; 39extern spinlock_t rtc_lock;
@@ -48,13 +41,9 @@ extern spinlock_t rtc_lock;
48unsigned long get_cmos_time(void) 41unsigned long get_cmos_time(void)
49{ 42{
50 unsigned int year, mon, day, hour, min, sec; 43 unsigned int year, mon, day, hour, min, sec;
51 int i;
52 44
53 spin_lock(&rtc_lock); 45 spin_lock(&rtc_lock);
54 again: 46 again:
55 for (i = 0 ; i < 1000000 ; i++) /* may take up to 1 second... */
56 if (!(ctrl_inb(RTC_CTL) & RTC_BUSY))
57 break;
58 do { 47 do {
59 sec = (ctrl_inb(RTC_SEC1) & 0xf) + (ctrl_inb(RTC_SEC10) & 0x7) * 10; 48 sec = (ctrl_inb(RTC_SEC1) & 0xf) + (ctrl_inb(RTC_SEC10) & 0x7) * 10;
60 min = (ctrl_inb(RTC_MIN1) & 0xf) + (ctrl_inb(RTC_MIN10) & 0xf) * 10; 49 min = (ctrl_inb(RTC_MIN1) & 0xf) + (ctrl_inb(RTC_MIN10) & 0xf) * 10;
diff --git a/arch/sh/kernel/cpu/init.c b/arch/sh/kernel/cpu/init.c
index cf94e8ef17c5..868e68b28880 100644
--- a/arch/sh/kernel/cpu/init.c
+++ b/arch/sh/kernel/cpu/init.c
@@ -30,7 +30,7 @@ static int x##_disabled __initdata = 0; \
30static int __init x##_setup(char *opts) \ 30static int __init x##_setup(char *opts) \
31{ \ 31{ \
32 x##_disabled = 1; \ 32 x##_disabled = 1; \
33 return 0; \ 33 return 1; \
34} \ 34} \
35__setup("no" __stringify(x), x##_setup); 35__setup("no" __stringify(x), x##_setup);
36 36
diff --git a/arch/sh/kernel/cpu/rtc.c b/arch/sh/kernel/cpu/rtc.c
index f8361f5e788b..4304cf75cfa2 100644
--- a/arch/sh/kernel/cpu/rtc.c
+++ b/arch/sh/kernel/cpu/rtc.c
@@ -9,18 +9,10 @@
9#include <linux/kernel.h> 9#include <linux/kernel.h>
10#include <linux/sched.h> 10#include <linux/sched.h>
11#include <linux/time.h> 11#include <linux/time.h>
12 12#include <linux/bcd.h>
13#include <asm/io.h> 13#include <asm/io.h>
14#include <asm/rtc.h> 14#include <asm/rtc.h>
15 15
16#ifndef BCD_TO_BIN
17#define BCD_TO_BIN(val) ((val)=((val)&15) + ((val)>>4)*10)
18#endif
19
20#ifndef BIN_TO_BCD
21#define BIN_TO_BCD(val) ((val)=(((val)/10)<<4) + (val)%10)
22#endif
23
24void sh_rtc_gettimeofday(struct timespec *ts) 16void sh_rtc_gettimeofday(struct timespec *ts)
25{ 17{
26 unsigned int sec128, sec, sec2, min, hr, wk, day, mon, yr, yr100, cf_bit; 18 unsigned int sec128, sec, sec2, min, hr, wk, day, mon, yr, yr100, cf_bit;
diff --git a/arch/sh/kernel/irq.c b/arch/sh/kernel/irq.c
index 6883c00728cb..b56e79632f24 100644
--- a/arch/sh/kernel/irq.c
+++ b/arch/sh/kernel/irq.c
@@ -35,9 +35,8 @@ int show_interrupts(struct seq_file *p, void *v)
35 35
36 if (i == 0) { 36 if (i == 0) {
37 seq_puts(p, " "); 37 seq_puts(p, " ");
38 for (j=0; j<NR_CPUS; j++) 38 for_each_online_cpu(j)
39 if (cpu_online(j)) 39 seq_printf(p, "CPU%d ",j);
40 seq_printf(p, "CPU%d ",j);
41 seq_putc(p, '\n'); 40 seq_putc(p, '\n');
42 } 41 }
43 42
diff --git a/arch/sh/kernel/process.c b/arch/sh/kernel/process.c
index 9fd1723e6219..22dc9c21201d 100644
--- a/arch/sh/kernel/process.c
+++ b/arch/sh/kernel/process.c
@@ -19,7 +19,6 @@
19#include <linux/slab.h> 19#include <linux/slab.h>
20#include <linux/pm.h> 20#include <linux/pm.h>
21#include <linux/ptrace.h> 21#include <linux/ptrace.h>
22#include <linux/platform.h>
23#include <linux/kallsyms.h> 22#include <linux/kallsyms.h>
24#include <linux/kexec.h> 23#include <linux/kexec.h>
25 24
diff --git a/arch/sh/kernel/setup.c b/arch/sh/kernel/setup.c
index a067a34e0b64..bb229ef030f3 100644
--- a/arch/sh/kernel/setup.c
+++ b/arch/sh/kernel/setup.c
@@ -20,6 +20,7 @@
20#include <linux/root_dev.h> 20#include <linux/root_dev.h>
21#include <linux/utsname.h> 21#include <linux/utsname.h>
22#include <linux/cpu.h> 22#include <linux/cpu.h>
23#include <linux/pfn.h>
23#include <asm/uaccess.h> 24#include <asm/uaccess.h>
24#include <asm/io.h> 25#include <asm/io.h>
25#include <asm/sections.h> 26#include <asm/sections.h>
@@ -275,10 +276,6 @@ void __init setup_arch(char **cmdline_p)
275 276
276 sh_mv_setup(cmdline_p); 277 sh_mv_setup(cmdline_p);
277 278
278#define PFN_UP(x) (((x) + PAGE_SIZE-1) >> PAGE_SHIFT)
279#define PFN_DOWN(x) ((x) >> PAGE_SHIFT)
280#define PFN_PHYS(x) ((x) << PAGE_SHIFT)
281
282 /* 279 /*
283 * Find the highest page frame number we have available 280 * Find the highest page frame number we have available
284 */ 281 */
@@ -404,9 +401,8 @@ static int __init topology_init(void)
404{ 401{
405 int cpu_id; 402 int cpu_id;
406 403
407 for (cpu_id = 0; cpu_id < NR_CPUS; cpu_id++) 404 for_each_possible_cpu(cpu_id)
408 if (cpu_possible(cpu_id)) 405 register_cpu(&cpu[cpu_id], cpu_id, NULL);
409 register_cpu(&cpu[cpu_id], cpu_id, NULL);
410 406
411 return 0; 407 return 0;
412} 408}
diff --git a/arch/sh/mm/consistent.c b/arch/sh/mm/consistent.c
index df3a9e452cc5..ee73e30263af 100644
--- a/arch/sh/mm/consistent.c
+++ b/arch/sh/mm/consistent.c
@@ -23,6 +23,7 @@ void *consistent_alloc(gfp_t gfp, size_t size, dma_addr_t *handle)
23 page = alloc_pages(gfp, order); 23 page = alloc_pages(gfp, order);
24 if (!page) 24 if (!page)
25 return NULL; 25 return NULL;
26 split_page(page, order);
26 27
27 ret = page_address(page); 28 ret = page_address(page);
28 *handle = virt_to_phys(ret); 29 *handle = virt_to_phys(ret);
@@ -37,8 +38,6 @@ void *consistent_alloc(gfp_t gfp, size_t size, dma_addr_t *handle)
37 end = page + (1 << order); 38 end = page + (1 << order);
38 39
39 while (++page < end) { 40 while (++page < end) {
40 set_page_count(page, 1);
41
42 /* Free any unused pages */ 41 /* Free any unused pages */
43 if (page >= free) { 42 if (page >= free) {
44 __free_page(page); 43 __free_page(page);
diff --git a/arch/sh/mm/hugetlbpage.c b/arch/sh/mm/hugetlbpage.c
index 6b7a7688c98e..a3568fd51508 100644
--- a/arch/sh/mm/hugetlbpage.c
+++ b/arch/sh/mm/hugetlbpage.c
@@ -84,18 +84,6 @@ pte_t huge_ptep_get_and_clear(struct mm_struct *mm, unsigned long addr,
84 return entry; 84 return entry;
85} 85}
86 86
87/*
88 * This function checks for proper alignment of input addr and len parameters.
89 */
90int is_aligned_hugepage_range(unsigned long addr, unsigned long len)
91{
92 if (len & ~HPAGE_MASK)
93 return -EINVAL;
94 if (addr & ~HPAGE_MASK)
95 return -EINVAL;
96 return 0;
97}
98
99struct page *follow_huge_addr(struct mm_struct *mm, 87struct page *follow_huge_addr(struct mm_struct *mm,
100 unsigned long address, int write) 88 unsigned long address, int write)
101{ 89{
diff --git a/arch/sh/mm/init.c b/arch/sh/mm/init.c
index e342565f75fb..77b4a838fe10 100644
--- a/arch/sh/mm/init.c
+++ b/arch/sh/mm/init.c
@@ -273,7 +273,7 @@ void free_initmem(void)
273 addr = (unsigned long)(&__init_begin); 273 addr = (unsigned long)(&__init_begin);
274 for (; addr < (unsigned long)(&__init_end); addr += PAGE_SIZE) { 274 for (; addr < (unsigned long)(&__init_end); addr += PAGE_SIZE) {
275 ClearPageReserved(virt_to_page(addr)); 275 ClearPageReserved(virt_to_page(addr));
276 set_page_count(virt_to_page(addr), 1); 276 init_page_count(virt_to_page(addr));
277 free_page(addr); 277 free_page(addr);
278 totalram_pages++; 278 totalram_pages++;
279 } 279 }
@@ -286,7 +286,7 @@ void free_initrd_mem(unsigned long start, unsigned long end)
286 unsigned long p; 286 unsigned long p;
287 for (p = start; p < end; p += PAGE_SIZE) { 287 for (p = start; p < end; p += PAGE_SIZE) {
288 ClearPageReserved(virt_to_page(p)); 288 ClearPageReserved(virt_to_page(p));
289 set_page_count(virt_to_page(p), 1); 289 init_page_count(virt_to_page(p));
290 free_page(p); 290 free_page(p);
291 totalram_pages++; 291 totalram_pages++;
292 } 292 }
diff --git a/arch/sh64/Kconfig b/arch/sh64/Kconfig
index 07b172deb872..58c678e06667 100644
--- a/arch/sh64/Kconfig
+++ b/arch/sh64/Kconfig
@@ -21,6 +21,14 @@ config RWSEM_GENERIC_SPINLOCK
21 bool 21 bool
22 default y 22 default y
23 23
24config GENERIC_FIND_NEXT_BIT
25 bool
26 default y
27
28config GENERIC_HWEIGHT
29 bool
30 default y
31
24config GENERIC_CALIBRATE_DELAY 32config GENERIC_CALIBRATE_DELAY
25 bool 33 bool
26 default y 34 default y
diff --git a/arch/sh64/kernel/irq.c b/arch/sh64/kernel/irq.c
index 9fc2b71dbd84..d69879c0e063 100644
--- a/arch/sh64/kernel/irq.c
+++ b/arch/sh64/kernel/irq.c
@@ -53,9 +53,8 @@ int show_interrupts(struct seq_file *p, void *v)
53 53
54 if (i == 0) { 54 if (i == 0) {
55 seq_puts(p, " "); 55 seq_puts(p, " ");
56 for (j=0; j<NR_CPUS; j++) 56 for_each_online_cpu(j)
57 if (cpu_online(j)) 57 seq_printf(p, "CPU%d ",j);
58 seq_printf(p, "CPU%d ",j);
59 seq_putc(p, '\n'); 58 seq_putc(p, '\n');
60 } 59 }
61 60
diff --git a/arch/sh64/kernel/setup.c b/arch/sh64/kernel/setup.c
index c7a7b816a30f..d2711c9c9d13 100644
--- a/arch/sh64/kernel/setup.c
+++ b/arch/sh64/kernel/setup.c
@@ -48,6 +48,7 @@
48#include <linux/root_dev.h> 48#include <linux/root_dev.h>
49#include <linux/cpu.h> 49#include <linux/cpu.h>
50#include <linux/initrd.h> 50#include <linux/initrd.h>
51#include <linux/pfn.h>
51#include <asm/processor.h> 52#include <asm/processor.h>
52#include <asm/page.h> 53#include <asm/page.h>
53#include <asm/pgtable.h> 54#include <asm/pgtable.h>
diff --git a/arch/sh64/kernel/time.c b/arch/sh64/kernel/time.c
index 0773c9f389f3..6b8f4d22abc6 100644
--- a/arch/sh64/kernel/time.c
+++ b/arch/sh64/kernel/time.c
@@ -30,6 +30,7 @@
30#include <linux/profile.h> 30#include <linux/profile.h>
31#include <linux/smp.h> 31#include <linux/smp.h>
32#include <linux/module.h> 32#include <linux/module.h>
33#include <linux/bcd.h>
33 34
34#include <asm/registers.h> /* required by inline __asm__ stmt. */ 35#include <asm/registers.h> /* required by inline __asm__ stmt. */
35 36
@@ -105,14 +106,6 @@
105#define RCR1 rtc_base+0x38 106#define RCR1 rtc_base+0x38
106#define RCR2 rtc_base+0x3c 107#define RCR2 rtc_base+0x3c
107 108
108#ifndef BCD_TO_BIN
109#define BCD_TO_BIN(val) ((val)=((val)&15) + ((val)>>4)*10)
110#endif
111
112#ifndef BIN_TO_BCD
113#define BIN_TO_BCD(val) ((val)=(((val)/10)<<4) + (val)%10)
114#endif
115
116#define TICK_SIZE (tick_nsec / 1000) 109#define TICK_SIZE (tick_nsec / 1000)
117 110
118extern unsigned long wall_jiffies; 111extern unsigned long wall_jiffies;
diff --git a/arch/sh64/mm/hugetlbpage.c b/arch/sh64/mm/hugetlbpage.c
index ed6a505b3ee2..3d89f2a6c785 100644
--- a/arch/sh64/mm/hugetlbpage.c
+++ b/arch/sh64/mm/hugetlbpage.c
@@ -84,18 +84,6 @@ pte_t huge_ptep_get_and_clear(struct mm_struct *mm, unsigned long addr,
84 return entry; 84 return entry;
85} 85}
86 86
87/*
88 * This function checks for proper alignment of input addr and len parameters.
89 */
90int is_aligned_hugepage_range(unsigned long addr, unsigned long len)
91{
92 if (len & ~HPAGE_MASK)
93 return -EINVAL;
94 if (addr & ~HPAGE_MASK)
95 return -EINVAL;
96 return 0;
97}
98
99struct page *follow_huge_addr(struct mm_struct *mm, 87struct page *follow_huge_addr(struct mm_struct *mm,
100 unsigned long address, int write) 88 unsigned long address, int write)
101{ 89{
diff --git a/arch/sh64/mm/init.c b/arch/sh64/mm/init.c
index a65e8bb2c3cc..1169757fb38b 100644
--- a/arch/sh64/mm/init.c
+++ b/arch/sh64/mm/init.c
@@ -173,7 +173,7 @@ void free_initmem(void)
173 addr = (unsigned long)(&__init_begin); 173 addr = (unsigned long)(&__init_begin);
174 for (; addr < (unsigned long)(&__init_end); addr += PAGE_SIZE) { 174 for (; addr < (unsigned long)(&__init_end); addr += PAGE_SIZE) {
175 ClearPageReserved(virt_to_page(addr)); 175 ClearPageReserved(virt_to_page(addr));
176 set_page_count(virt_to_page(addr), 1); 176 init_page_count(virt_to_page(addr));
177 free_page(addr); 177 free_page(addr);
178 totalram_pages++; 178 totalram_pages++;
179 } 179 }
@@ -186,7 +186,7 @@ void free_initrd_mem(unsigned long start, unsigned long end)
186 unsigned long p; 186 unsigned long p;
187 for (p = start; p < end; p += PAGE_SIZE) { 187 for (p = start; p < end; p += PAGE_SIZE) {
188 ClearPageReserved(virt_to_page(p)); 188 ClearPageReserved(virt_to_page(p));
189 set_page_count(virt_to_page(p), 1); 189 init_page_count(virt_to_page(p));
190 free_page(p); 190 free_page(p);
191 totalram_pages++; 191 totalram_pages++;
192 } 192 }
diff --git a/arch/sparc/Kconfig b/arch/sparc/Kconfig
index f944b58cdfe7..9431e967aa45 100644
--- a/arch/sparc/Kconfig
+++ b/arch/sparc/Kconfig
@@ -23,7 +23,6 @@ menu "General machine setup"
23 23
24config SMP 24config SMP
25 bool "Symmetric multi-processing support (does not work on sun4/sun4c)" 25 bool "Symmetric multi-processing support (does not work on sun4/sun4c)"
26 depends on BROKEN
27 ---help--- 26 ---help---
28 This enables support for systems with more than one CPU. If you have 27 This enables support for systems with more than one CPU. If you have
29 a system with only one CPU, say N. If you have a system with more 28 a system with only one CPU, say N. If you have a system with more
@@ -151,6 +150,14 @@ config RWSEM_GENERIC_SPINLOCK
151config RWSEM_XCHGADD_ALGORITHM 150config RWSEM_XCHGADD_ALGORITHM
152 bool 151 bool
153 152
153config GENERIC_FIND_NEXT_BIT
154 bool
155 default y
156
157config GENERIC_HWEIGHT
158 bool
159 default y
160
154config GENERIC_CALIBRATE_DELAY 161config GENERIC_CALIBRATE_DELAY
155 bool 162 bool
156 default y 163 default y
diff --git a/arch/sparc/kernel/ioport.c b/arch/sparc/kernel/ioport.c
index d39c9f206271..460f72e640e6 100644
--- a/arch/sparc/kernel/ioport.c
+++ b/arch/sparc/kernel/ioport.c
@@ -217,7 +217,7 @@ static void _sparc_free_io(struct resource *res)
217 unsigned long plen; 217 unsigned long plen;
218 218
219 plen = res->end - res->start + 1; 219 plen = res->end - res->start + 1;
220 if ((plen & (PAGE_SIZE-1)) != 0) BUG(); 220 BUG_ON((plen & (PAGE_SIZE-1)) != 0);
221 sparc_unmapiorange(res->start, plen); 221 sparc_unmapiorange(res->start, plen);
222 release_resource(res); 222 release_resource(res);
223} 223}
@@ -512,8 +512,7 @@ void pci_free_consistent(struct pci_dev *pdev, size_t n, void *p, dma_addr_t ba)
512dma_addr_t pci_map_single(struct pci_dev *hwdev, void *ptr, size_t size, 512dma_addr_t pci_map_single(struct pci_dev *hwdev, void *ptr, size_t size,
513 int direction) 513 int direction)
514{ 514{
515 if (direction == PCI_DMA_NONE) 515 BUG_ON(direction == PCI_DMA_NONE);
516 BUG();
517 /* IIep is write-through, not flushing. */ 516 /* IIep is write-through, not flushing. */
518 return virt_to_phys(ptr); 517 return virt_to_phys(ptr);
519} 518}
@@ -528,8 +527,7 @@ dma_addr_t pci_map_single(struct pci_dev *hwdev, void *ptr, size_t size,
528void pci_unmap_single(struct pci_dev *hwdev, dma_addr_t ba, size_t size, 527void pci_unmap_single(struct pci_dev *hwdev, dma_addr_t ba, size_t size,
529 int direction) 528 int direction)
530{ 529{
531 if (direction == PCI_DMA_NONE) 530 BUG_ON(direction == PCI_DMA_NONE);
532 BUG();
533 if (direction != PCI_DMA_TODEVICE) { 531 if (direction != PCI_DMA_TODEVICE) {
534 mmu_inval_dma_area((unsigned long)phys_to_virt(ba), 532 mmu_inval_dma_area((unsigned long)phys_to_virt(ba),
535 (size + PAGE_SIZE-1) & PAGE_MASK); 533 (size + PAGE_SIZE-1) & PAGE_MASK);
@@ -542,8 +540,7 @@ void pci_unmap_single(struct pci_dev *hwdev, dma_addr_t ba, size_t size,
542dma_addr_t pci_map_page(struct pci_dev *hwdev, struct page *page, 540dma_addr_t pci_map_page(struct pci_dev *hwdev, struct page *page,
543 unsigned long offset, size_t size, int direction) 541 unsigned long offset, size_t size, int direction)
544{ 542{
545 if (direction == PCI_DMA_NONE) 543 BUG_ON(direction == PCI_DMA_NONE);
546 BUG();
547 /* IIep is write-through, not flushing. */ 544 /* IIep is write-through, not flushing. */
548 return page_to_phys(page) + offset; 545 return page_to_phys(page) + offset;
549} 546}
@@ -551,8 +548,7 @@ dma_addr_t pci_map_page(struct pci_dev *hwdev, struct page *page,
551void pci_unmap_page(struct pci_dev *hwdev, 548void pci_unmap_page(struct pci_dev *hwdev,
552 dma_addr_t dma_address, size_t size, int direction) 549 dma_addr_t dma_address, size_t size, int direction)
553{ 550{
554 if (direction == PCI_DMA_NONE) 551 BUG_ON(direction == PCI_DMA_NONE);
555 BUG();
556 /* mmu_inval_dma_area XXX */ 552 /* mmu_inval_dma_area XXX */
557} 553}
558 554
@@ -576,11 +572,10 @@ int pci_map_sg(struct pci_dev *hwdev, struct scatterlist *sg, int nents,
576{ 572{
577 int n; 573 int n;
578 574
579 if (direction == PCI_DMA_NONE) 575 BUG_ON(direction == PCI_DMA_NONE);
580 BUG();
581 /* IIep is write-through, not flushing. */ 576 /* IIep is write-through, not flushing. */
582 for (n = 0; n < nents; n++) { 577 for (n = 0; n < nents; n++) {
583 if (page_address(sg->page) == NULL) BUG(); 578 BUG_ON(page_address(sg->page) == NULL);
584 sg->dvma_address = virt_to_phys(page_address(sg->page)); 579 sg->dvma_address = virt_to_phys(page_address(sg->page));
585 sg->dvma_length = sg->length; 580 sg->dvma_length = sg->length;
586 sg++; 581 sg++;
@@ -597,11 +592,10 @@ void pci_unmap_sg(struct pci_dev *hwdev, struct scatterlist *sg, int nents,
597{ 592{
598 int n; 593 int n;
599 594
600 if (direction == PCI_DMA_NONE) 595 BUG_ON(direction == PCI_DMA_NONE);
601 BUG();
602 if (direction != PCI_DMA_TODEVICE) { 596 if (direction != PCI_DMA_TODEVICE) {
603 for (n = 0; n < nents; n++) { 597 for (n = 0; n < nents; n++) {
604 if (page_address(sg->page) == NULL) BUG(); 598 BUG_ON(page_address(sg->page) == NULL);
605 mmu_inval_dma_area( 599 mmu_inval_dma_area(
606 (unsigned long) page_address(sg->page), 600 (unsigned long) page_address(sg->page),
607 (sg->length + PAGE_SIZE-1) & PAGE_MASK); 601 (sg->length + PAGE_SIZE-1) & PAGE_MASK);
@@ -622,8 +616,7 @@ void pci_unmap_sg(struct pci_dev *hwdev, struct scatterlist *sg, int nents,
622 */ 616 */
623void pci_dma_sync_single_for_cpu(struct pci_dev *hwdev, dma_addr_t ba, size_t size, int direction) 617void pci_dma_sync_single_for_cpu(struct pci_dev *hwdev, dma_addr_t ba, size_t size, int direction)
624{ 618{
625 if (direction == PCI_DMA_NONE) 619 BUG_ON(direction == PCI_DMA_NONE);
626 BUG();
627 if (direction != PCI_DMA_TODEVICE) { 620 if (direction != PCI_DMA_TODEVICE) {
628 mmu_inval_dma_area((unsigned long)phys_to_virt(ba), 621 mmu_inval_dma_area((unsigned long)phys_to_virt(ba),
629 (size + PAGE_SIZE-1) & PAGE_MASK); 622 (size + PAGE_SIZE-1) & PAGE_MASK);
@@ -632,8 +625,7 @@ void pci_dma_sync_single_for_cpu(struct pci_dev *hwdev, dma_addr_t ba, size_t si
632 625
633void pci_dma_sync_single_for_device(struct pci_dev *hwdev, dma_addr_t ba, size_t size, int direction) 626void pci_dma_sync_single_for_device(struct pci_dev *hwdev, dma_addr_t ba, size_t size, int direction)
634{ 627{
635 if (direction == PCI_DMA_NONE) 628 BUG_ON(direction == PCI_DMA_NONE);
636 BUG();
637 if (direction != PCI_DMA_TODEVICE) { 629 if (direction != PCI_DMA_TODEVICE) {
638 mmu_inval_dma_area((unsigned long)phys_to_virt(ba), 630 mmu_inval_dma_area((unsigned long)phys_to_virt(ba),
639 (size + PAGE_SIZE-1) & PAGE_MASK); 631 (size + PAGE_SIZE-1) & PAGE_MASK);
@@ -650,11 +642,10 @@ void pci_dma_sync_sg_for_cpu(struct pci_dev *hwdev, struct scatterlist *sg, int
650{ 642{
651 int n; 643 int n;
652 644
653 if (direction == PCI_DMA_NONE) 645 BUG_ON(direction == PCI_DMA_NONE);
654 BUG();
655 if (direction != PCI_DMA_TODEVICE) { 646 if (direction != PCI_DMA_TODEVICE) {
656 for (n = 0; n < nents; n++) { 647 for (n = 0; n < nents; n++) {
657 if (page_address(sg->page) == NULL) BUG(); 648 BUG_ON(page_address(sg->page) == NULL);
658 mmu_inval_dma_area( 649 mmu_inval_dma_area(
659 (unsigned long) page_address(sg->page), 650 (unsigned long) page_address(sg->page),
660 (sg->length + PAGE_SIZE-1) & PAGE_MASK); 651 (sg->length + PAGE_SIZE-1) & PAGE_MASK);
@@ -667,11 +658,10 @@ void pci_dma_sync_sg_for_device(struct pci_dev *hwdev, struct scatterlist *sg, i
667{ 658{
668 int n; 659 int n;
669 660
670 if (direction == PCI_DMA_NONE) 661 BUG_ON(direction == PCI_DMA_NONE);
671 BUG();
672 if (direction != PCI_DMA_TODEVICE) { 662 if (direction != PCI_DMA_TODEVICE) {
673 for (n = 0; n < nents; n++) { 663 for (n = 0; n < nents; n++) {
674 if (page_address(sg->page) == NULL) BUG(); 664 BUG_ON(page_address(sg->page) == NULL);
675 mmu_inval_dma_area( 665 mmu_inval_dma_area(
676 (unsigned long) page_address(sg->page), 666 (unsigned long) page_address(sg->page),
677 (sg->length + PAGE_SIZE-1) & PAGE_MASK); 667 (sg->length + PAGE_SIZE-1) & PAGE_MASK);
diff --git a/arch/sparc/kernel/irq.c b/arch/sparc/kernel/irq.c
index 410b9a72aba9..aac8af5aae51 100644
--- a/arch/sparc/kernel/irq.c
+++ b/arch/sparc/kernel/irq.c
@@ -154,9 +154,11 @@ void (*sparc_init_timers)(irqreturn_t (*)(int, void *,struct pt_regs *)) =
154struct irqaction static_irqaction[MAX_STATIC_ALLOC]; 154struct irqaction static_irqaction[MAX_STATIC_ALLOC];
155int static_irq_count; 155int static_irq_count;
156 156
157struct irqaction *irq_action[NR_IRQS] = { 157struct {
158 [0 ... (NR_IRQS-1)] = NULL 158 struct irqaction *action;
159}; 159 int flags;
160} sparc_irq[NR_IRQS];
161#define SPARC_IRQ_INPROGRESS 1
160 162
161/* Used to protect the IRQ action lists */ 163/* Used to protect the IRQ action lists */
162DEFINE_SPINLOCK(irq_action_lock); 164DEFINE_SPINLOCK(irq_action_lock);
@@ -177,17 +179,16 @@ int show_interrupts(struct seq_file *p, void *v)
177 } 179 }
178 spin_lock_irqsave(&irq_action_lock, flags); 180 spin_lock_irqsave(&irq_action_lock, flags);
179 if (i < NR_IRQS) { 181 if (i < NR_IRQS) {
180 action = *(i + irq_action); 182 action = sparc_irq[i].action;
181 if (!action) 183 if (!action)
182 goto out_unlock; 184 goto out_unlock;
183 seq_printf(p, "%3d: ", i); 185 seq_printf(p, "%3d: ", i);
184#ifndef CONFIG_SMP 186#ifndef CONFIG_SMP
185 seq_printf(p, "%10u ", kstat_irqs(i)); 187 seq_printf(p, "%10u ", kstat_irqs(i));
186#else 188#else
187 for (j = 0; j < NR_CPUS; j++) { 189 for_each_online_cpu(j) {
188 if (cpu_online(j)) 190 seq_printf(p, "%10u ",
189 seq_printf(p, "%10u ", 191 kstat_cpu(j).irqs[i]);
190 kstat_cpu(cpu_logical_map(j)).irqs[i]);
191 } 192 }
192#endif 193#endif
193 seq_printf(p, " %c %s", 194 seq_printf(p, " %c %s",
@@ -208,7 +209,7 @@ out_unlock:
208void free_irq(unsigned int irq, void *dev_id) 209void free_irq(unsigned int irq, void *dev_id)
209{ 210{
210 struct irqaction * action; 211 struct irqaction * action;
211 struct irqaction * tmp = NULL; 212 struct irqaction **actionp;
212 unsigned long flags; 213 unsigned long flags;
213 unsigned int cpu_irq; 214 unsigned int cpu_irq;
214 215
@@ -226,7 +227,8 @@ void free_irq(unsigned int irq, void *dev_id)
226 227
227 spin_lock_irqsave(&irq_action_lock, flags); 228 spin_lock_irqsave(&irq_action_lock, flags);
228 229
229 action = *(cpu_irq + irq_action); 230 actionp = &sparc_irq[cpu_irq].action;
231 action = *actionp;
230 232
231 if (!action->handler) { 233 if (!action->handler) {
232 printk("Trying to free free IRQ%d\n",irq); 234 printk("Trying to free free IRQ%d\n",irq);
@@ -236,7 +238,7 @@ void free_irq(unsigned int irq, void *dev_id)
236 for (; action; action = action->next) { 238 for (; action; action = action->next) {
237 if (action->dev_id == dev_id) 239 if (action->dev_id == dev_id)
238 break; 240 break;
239 tmp = action; 241 actionp = &action->next;
240 } 242 }
241 if (!action) { 243 if (!action) {
242 printk("Trying to free free shared IRQ%d\n",irq); 244 printk("Trying to free free shared IRQ%d\n",irq);
@@ -255,11 +257,8 @@ void free_irq(unsigned int irq, void *dev_id)
255 irq, action->name); 257 irq, action->name);
256 goto out_unlock; 258 goto out_unlock;
257 } 259 }
258 260
259 if (action && tmp) 261 *actionp = action->next;
260 tmp->next = action->next;
261 else
262 *(cpu_irq + irq_action) = action->next;
263 262
264 spin_unlock_irqrestore(&irq_action_lock, flags); 263 spin_unlock_irqrestore(&irq_action_lock, flags);
265 264
@@ -269,7 +268,7 @@ void free_irq(unsigned int irq, void *dev_id)
269 268
270 kfree(action); 269 kfree(action);
271 270
272 if (!(*(cpu_irq + irq_action))) 271 if (!sparc_irq[cpu_irq].action)
273 disable_irq(irq); 272 disable_irq(irq);
274 273
275out_unlock: 274out_unlock:
@@ -288,8 +287,11 @@ EXPORT_SYMBOL(free_irq);
288#ifdef CONFIG_SMP 287#ifdef CONFIG_SMP
289void synchronize_irq(unsigned int irq) 288void synchronize_irq(unsigned int irq)
290{ 289{
291 printk("synchronize_irq says: implement me!\n"); 290 unsigned int cpu_irq;
292 BUG(); 291
292 cpu_irq = irq & (NR_IRQS - 1);
293 while (sparc_irq[cpu_irq].flags & SPARC_IRQ_INPROGRESS)
294 cpu_relax();
293} 295}
294#endif /* SMP */ 296#endif /* SMP */
295 297
@@ -300,7 +302,7 @@ void unexpected_irq(int irq, void *dev_id, struct pt_regs * regs)
300 unsigned int cpu_irq; 302 unsigned int cpu_irq;
301 303
302 cpu_irq = irq & (NR_IRQS - 1); 304 cpu_irq = irq & (NR_IRQS - 1);
303 action = *(cpu_irq + irq_action); 305 action = sparc_irq[cpu_irq].action;
304 306
305 printk("IO device interrupt, irq = %d\n", irq); 307 printk("IO device interrupt, irq = %d\n", irq);
306 printk("PC = %08lx NPC = %08lx FP=%08lx\n", regs->pc, 308 printk("PC = %08lx NPC = %08lx FP=%08lx\n", regs->pc,
@@ -331,7 +333,8 @@ void handler_irq(int irq, struct pt_regs * regs)
331 if(irq < 10) 333 if(irq < 10)
332 smp4m_irq_rotate(cpu); 334 smp4m_irq_rotate(cpu);
333#endif 335#endif
334 action = *(irq + irq_action); 336 action = sparc_irq[irq].action;
337 sparc_irq[irq].flags |= SPARC_IRQ_INPROGRESS;
335 kstat_cpu(cpu).irqs[irq]++; 338 kstat_cpu(cpu).irqs[irq]++;
336 do { 339 do {
337 if (!action || !action->handler) 340 if (!action || !action->handler)
@@ -339,6 +342,7 @@ void handler_irq(int irq, struct pt_regs * regs)
339 action->handler(irq, action->dev_id, regs); 342 action->handler(irq, action->dev_id, regs);
340 action = action->next; 343 action = action->next;
341 } while (action); 344 } while (action);
345 sparc_irq[irq].flags &= ~SPARC_IRQ_INPROGRESS;
342 enable_pil_irq(irq); 346 enable_pil_irq(irq);
343 irq_exit(); 347 irq_exit();
344} 348}
@@ -390,7 +394,7 @@ int request_fast_irq(unsigned int irq,
390 394
391 spin_lock_irqsave(&irq_action_lock, flags); 395 spin_lock_irqsave(&irq_action_lock, flags);
392 396
393 action = *(cpu_irq + irq_action); 397 action = sparc_irq[cpu_irq].action;
394 if(action) { 398 if(action) {
395 if(action->flags & SA_SHIRQ) 399 if(action->flags & SA_SHIRQ)
396 panic("Trying to register fast irq when already shared.\n"); 400 panic("Trying to register fast irq when already shared.\n");
@@ -453,7 +457,7 @@ int request_fast_irq(unsigned int irq,
453 action->dev_id = NULL; 457 action->dev_id = NULL;
454 action->next = NULL; 458 action->next = NULL;
455 459
456 *(cpu_irq + irq_action) = action; 460 sparc_irq[cpu_irq].action = action;
457 461
458 enable_irq(irq); 462 enable_irq(irq);
459 463
@@ -468,7 +472,7 @@ int request_irq(unsigned int irq,
468 irqreturn_t (*handler)(int, void *, struct pt_regs *), 472 irqreturn_t (*handler)(int, void *, struct pt_regs *),
469 unsigned long irqflags, const char * devname, void *dev_id) 473 unsigned long irqflags, const char * devname, void *dev_id)
470{ 474{
471 struct irqaction * action, *tmp = NULL; 475 struct irqaction * action, **actionp;
472 unsigned long flags; 476 unsigned long flags;
473 unsigned int cpu_irq; 477 unsigned int cpu_irq;
474 int ret; 478 int ret;
@@ -491,20 +495,20 @@ int request_irq(unsigned int irq,
491 495
492 spin_lock_irqsave(&irq_action_lock, flags); 496 spin_lock_irqsave(&irq_action_lock, flags);
493 497
494 action = *(cpu_irq + irq_action); 498 actionp = &sparc_irq[cpu_irq].action;
499 action = *actionp;
495 if (action) { 500 if (action) {
496 if ((action->flags & SA_SHIRQ) && (irqflags & SA_SHIRQ)) { 501 if (!(action->flags & SA_SHIRQ) || !(irqflags & SA_SHIRQ)) {
497 for (tmp = action; tmp->next; tmp = tmp->next);
498 } else {
499 ret = -EBUSY; 502 ret = -EBUSY;
500 goto out_unlock; 503 goto out_unlock;
501 } 504 }
502 if ((action->flags & SA_INTERRUPT) ^ (irqflags & SA_INTERRUPT)) { 505 if ((action->flags & SA_INTERRUPT) != (irqflags & SA_INTERRUPT)) {
503 printk("Attempt to mix fast and slow interrupts on IRQ%d denied\n", irq); 506 printk("Attempt to mix fast and slow interrupts on IRQ%d denied\n", irq);
504 ret = -EBUSY; 507 ret = -EBUSY;
505 goto out_unlock; 508 goto out_unlock;
506 } 509 }
507 action = NULL; /* Or else! */ 510 for ( ; action; action = *actionp)
511 actionp = &action->next;
508 } 512 }
509 513
510 /* If this is flagged as statically allocated then we use our 514 /* If this is flagged as statically allocated then we use our
@@ -533,10 +537,7 @@ int request_irq(unsigned int irq,
533 action->next = NULL; 537 action->next = NULL;
534 action->dev_id = dev_id; 538 action->dev_id = dev_id;
535 539
536 if (tmp) 540 *actionp = action;
537 tmp->next = action;
538 else
539 *(cpu_irq + irq_action) = action;
540 541
541 enable_irq(irq); 542 enable_irq(irq);
542 543
diff --git a/arch/sparc/kernel/smp.c b/arch/sparc/kernel/smp.c
index c6e721d8f477..2be812115197 100644
--- a/arch/sparc/kernel/smp.c
+++ b/arch/sparc/kernel/smp.c
@@ -45,6 +45,7 @@ volatile int __cpu_logical_map[NR_CPUS];
45 45
46cpumask_t cpu_online_map = CPU_MASK_NONE; 46cpumask_t cpu_online_map = CPU_MASK_NONE;
47cpumask_t phys_cpu_present_map = CPU_MASK_NONE; 47cpumask_t phys_cpu_present_map = CPU_MASK_NONE;
48cpumask_t smp_commenced_mask = CPU_MASK_NONE;
48 49
49/* The only guaranteed locking primitive available on all Sparc 50/* The only guaranteed locking primitive available on all Sparc
50 * processors is 'ldstub [%reg + immediate], %dest_reg' which atomically 51 * processors is 'ldstub [%reg + immediate], %dest_reg' which atomically
@@ -57,11 +58,6 @@ cpumask_t phys_cpu_present_map = CPU_MASK_NONE;
57/* Used to make bitops atomic */ 58/* Used to make bitops atomic */
58unsigned char bitops_spinlock = 0; 59unsigned char bitops_spinlock = 0;
59 60
60volatile unsigned long ipi_count;
61
62volatile int smp_process_available=0;
63volatile int smp_commenced = 0;
64
65void __init smp_store_cpu_info(int id) 61void __init smp_store_cpu_info(int id)
66{ 62{
67 int cpu_node; 63 int cpu_node;
@@ -79,6 +75,22 @@ void __init smp_store_cpu_info(int id)
79 75
80void __init smp_cpus_done(unsigned int max_cpus) 76void __init smp_cpus_done(unsigned int max_cpus)
81{ 77{
78 extern void smp4m_smp_done(void);
79 unsigned long bogosum = 0;
80 int cpu, num;
81
82 for (cpu = 0, num = 0; cpu < NR_CPUS; cpu++)
83 if (cpu_online(cpu)) {
84 num++;
85 bogosum += cpu_data(cpu).udelay_val;
86 }
87
88 printk("Total of %d processors activated (%lu.%02lu BogoMIPS).\n",
89 num, bogosum/(500000/HZ),
90 (bogosum/(5000/HZ))%100);
91
92 BUG_ON(sparc_cpu_model != sun4m);
93 smp4m_smp_done();
82} 94}
83 95
84void cpu_panic(void) 96void cpu_panic(void)
@@ -89,17 +101,6 @@ void cpu_panic(void)
89 101
90struct linux_prom_registers smp_penguin_ctable __initdata = { 0 }; 102struct linux_prom_registers smp_penguin_ctable __initdata = { 0 };
91 103
92void __init smp_boot_cpus(void)
93{
94 extern void smp4m_boot_cpus(void);
95 extern void smp4d_boot_cpus(void);
96
97 if (sparc_cpu_model == sun4m)
98 smp4m_boot_cpus();
99 else
100 smp4d_boot_cpus();
101}
102
103void smp_send_reschedule(int cpu) 104void smp_send_reschedule(int cpu)
104{ 105{
105 /* See sparc64 */ 106 /* See sparc64 */
@@ -243,9 +244,8 @@ int setup_profiling_timer(unsigned int multiplier)
243 return -EINVAL; 244 return -EINVAL;
244 245
245 spin_lock_irqsave(&prof_setup_lock, flags); 246 spin_lock_irqsave(&prof_setup_lock, flags);
246 for(i = 0; i < NR_CPUS; i++) { 247 for_each_cpu(i) {
247 if (cpu_possible(i)) 248 load_profile_irq(i, lvl14_resolution / multiplier);
248 load_profile_irq(i, lvl14_resolution / multiplier);
249 prof_multiplier(i) = multiplier; 249 prof_multiplier(i) = multiplier;
250 } 250 }
251 spin_unlock_irqrestore(&prof_setup_lock, flags); 251 spin_unlock_irqrestore(&prof_setup_lock, flags);
@@ -253,33 +253,73 @@ int setup_profiling_timer(unsigned int multiplier)
253 return 0; 253 return 0;
254} 254}
255 255
256void __init smp_prepare_cpus(unsigned int maxcpus) 256void __init smp_prepare_cpus(unsigned int max_cpus)
257{ 257{
258 extern void smp4m_boot_cpus(void);
259 int i, cpuid, ncpus, extra;
260
261 BUG_ON(sparc_cpu_model != sun4m);
262 printk("Entering SMP Mode...\n");
263
264 ncpus = 1;
265 extra = 0;
266 for (i = 0; !cpu_find_by_instance(i, NULL, &cpuid); i++) {
267 if (cpuid == boot_cpu_id)
268 continue;
269 if (cpuid < NR_CPUS && ncpus++ < max_cpus)
270 cpu_set(cpuid, phys_cpu_present_map);
271 else
272 extra++;
273 }
274 if (max_cpus >= NR_CPUS && extra)
275 printk("Warning: NR_CPUS is too low to start all cpus\n");
276
277 smp_store_cpu_info(boot_cpu_id);
278
279 smp4m_boot_cpus();
258} 280}
259 281
260void __devinit smp_prepare_boot_cpu(void) 282void __devinit smp_prepare_boot_cpu(void)
261{ 283{
262 current_thread_info()->cpu = hard_smp_processor_id(); 284 int cpuid = hard_smp_processor_id();
263 cpu_set(smp_processor_id(), cpu_online_map); 285
264 cpu_set(smp_processor_id(), phys_cpu_present_map); 286 if (cpuid >= NR_CPUS) {
287 prom_printf("Serious problem, boot cpu id >= NR_CPUS\n");
288 prom_halt();
289 }
290 if (cpuid != 0)
291 printk("boot cpu id != 0, this could work but is untested\n");
292
293 current_thread_info()->cpu = cpuid;
294 cpu_set(cpuid, cpu_online_map);
295 cpu_set(cpuid, phys_cpu_present_map);
265} 296}
266 297
267int __devinit __cpu_up(unsigned int cpu) 298int __devinit __cpu_up(unsigned int cpu)
268{ 299{
269 panic("smp doesn't work\n"); 300 extern int smp4m_boot_one_cpu(int);
301 int ret;
302
303 ret = smp4m_boot_one_cpu(cpu);
304
305 if (!ret) {
306 cpu_set(cpu, smp_commenced_mask);
307 while (!cpu_online(cpu))
308 mb();
309 }
310 return ret;
270} 311}
271 312
272void smp_bogo(struct seq_file *m) 313void smp_bogo(struct seq_file *m)
273{ 314{
274 int i; 315 int i;
275 316
276 for (i = 0; i < NR_CPUS; i++) { 317 for_each_online_cpu(i) {
277 if (cpu_online(i)) 318 seq_printf(m,
278 seq_printf(m, 319 "Cpu%dBogo\t: %lu.%02lu\n",
279 "Cpu%dBogo\t: %lu.%02lu\n", 320 i,
280 i, 321 cpu_data(i).udelay_val/(500000/HZ),
281 cpu_data(i).udelay_val/(500000/HZ), 322 (cpu_data(i).udelay_val/(5000/HZ))%100);
282 (cpu_data(i).udelay_val/(5000/HZ))%100);
283 } 323 }
284} 324}
285 325
@@ -288,8 +328,6 @@ void smp_info(struct seq_file *m)
288 int i; 328 int i;
289 329
290 seq_printf(m, "State:\n"); 330 seq_printf(m, "State:\n");
291 for (i = 0; i < NR_CPUS; i++) { 331 for_each_online_cpu(i)
292 if (cpu_online(i)) 332 seq_printf(m, "CPU%d\t\t: online\n", i);
293 seq_printf(m, "CPU%d\t\t: online\n", i);
294 }
295} 333}
diff --git a/arch/sparc/kernel/sparc_ksyms.c b/arch/sparc/kernel/sparc_ksyms.c
index 19b25399d7e4..2c21d7907635 100644
--- a/arch/sparc/kernel/sparc_ksyms.c
+++ b/arch/sparc/kernel/sparc_ksyms.c
@@ -136,10 +136,6 @@ EXPORT_PER_CPU_SYMBOL(__cpu_data);
136/* IRQ implementation. */ 136/* IRQ implementation. */
137EXPORT_SYMBOL(synchronize_irq); 137EXPORT_SYMBOL(synchronize_irq);
138 138
139/* Misc SMP information */
140EXPORT_SYMBOL(__cpu_number_map);
141EXPORT_SYMBOL(__cpu_logical_map);
142
143/* CPU online map and active count. */ 139/* CPU online map and active count. */
144EXPORT_SYMBOL(cpu_online_map); 140EXPORT_SYMBOL(cpu_online_map);
145EXPORT_SYMBOL(phys_cpu_present_map); 141EXPORT_SYMBOL(phys_cpu_present_map);
diff --git a/arch/sparc/kernel/sun4d_irq.c b/arch/sparc/kernel/sun4d_irq.c
index 52621348a56c..ca656d9bd6fd 100644
--- a/arch/sparc/kernel/sun4d_irq.c
+++ b/arch/sparc/kernel/sun4d_irq.c
@@ -54,7 +54,7 @@ unsigned char cpu_leds[32];
54unsigned char sbus_tid[32]; 54unsigned char sbus_tid[32];
55#endif 55#endif
56 56
57extern struct irqaction *irq_action[]; 57static struct irqaction *irq_action[NR_IRQS];
58extern spinlock_t irq_action_lock; 58extern spinlock_t irq_action_lock;
59 59
60struct sbus_action { 60struct sbus_action {
@@ -103,11 +103,9 @@ found_it: seq_printf(p, "%3d: ", i);
103#ifndef CONFIG_SMP 103#ifndef CONFIG_SMP
104 seq_printf(p, "%10u ", kstat_irqs(i)); 104 seq_printf(p, "%10u ", kstat_irqs(i));
105#else 105#else
106 for (x = 0; x < NR_CPUS; x++) { 106 for_each_online_cpu(x)
107 if (cpu_online(x)) 107 seq_printf(p, "%10u ",
108 seq_printf(p, "%10u ", 108 kstat_cpu(cpu_logical_map(x)).irqs[i]);
109 kstat_cpu(cpu_logical_map(x)).irqs[i]);
110 }
111#endif 109#endif
112 seq_printf(p, "%c %s", 110 seq_printf(p, "%c %s",
113 (action->flags & SA_INTERRUPT) ? '+' : ' ', 111 (action->flags & SA_INTERRUPT) ? '+' : ' ',
diff --git a/arch/sparc/kernel/sun4d_smp.c b/arch/sparc/kernel/sun4d_smp.c
index 40d426cce824..b141b7ee6717 100644
--- a/arch/sparc/kernel/sun4d_smp.c
+++ b/arch/sparc/kernel/sun4d_smp.c
@@ -46,14 +46,16 @@ extern volatile int smp_processors_ready;
46extern int smp_num_cpus; 46extern int smp_num_cpus;
47static int smp_highest_cpu; 47static int smp_highest_cpu;
48extern volatile unsigned long cpu_callin_map[NR_CPUS]; 48extern volatile unsigned long cpu_callin_map[NR_CPUS];
49extern struct cpuinfo_sparc cpu_data[NR_CPUS]; 49extern cpuinfo_sparc cpu_data[NR_CPUS];
50extern unsigned char boot_cpu_id; 50extern unsigned char boot_cpu_id;
51extern int smp_activated; 51extern int smp_activated;
52extern volatile int __cpu_number_map[NR_CPUS]; 52extern volatile int __cpu_number_map[NR_CPUS];
53extern volatile int __cpu_logical_map[NR_CPUS]; 53extern volatile int __cpu_logical_map[NR_CPUS];
54extern volatile unsigned long ipi_count; 54extern volatile unsigned long ipi_count;
55extern volatile int smp_process_available; 55extern volatile int smp_process_available;
56extern volatile int smp_commenced; 56
57extern cpumask_t smp_commenced_mask;
58
57extern int __smp4d_processor_id(void); 59extern int __smp4d_processor_id(void);
58 60
59/* #define SMP_DEBUG */ 61/* #define SMP_DEBUG */
@@ -136,7 +138,7 @@ void __init smp4d_callin(void)
136 138
137 local_irq_enable(); /* We don't allow PIL 14 yet */ 139 local_irq_enable(); /* We don't allow PIL 14 yet */
138 140
139 while(!smp_commenced) 141 while (!cpu_isset(cpuid, smp_commenced_mask))
140 barrier(); 142 barrier();
141 143
142 spin_lock_irqsave(&sun4d_imsk_lock, flags); 144 spin_lock_irqsave(&sun4d_imsk_lock, flags);
@@ -249,11 +251,9 @@ void __init smp4d_boot_cpus(void)
249 } else { 251 } else {
250 unsigned long bogosum = 0; 252 unsigned long bogosum = 0;
251 253
252 for(i = 0; i < NR_CPUS; i++) { 254 for_each_present_cpu(i) {
253 if (cpu_isset(i, cpu_present_map)) { 255 bogosum += cpu_data(i).udelay_val;
254 bogosum += cpu_data(i).udelay_val; 256 smp_highest_cpu = i;
255 smp_highest_cpu = i;
256 }
257 } 257 }
258 SMP_PRINTK(("Total of %d Processors activated (%lu.%02lu BogoMIPS).\n", cpucount + 1, bogosum/(500000/HZ), (bogosum/(5000/HZ))%100)); 258 SMP_PRINTK(("Total of %d Processors activated (%lu.%02lu BogoMIPS).\n", cpucount + 1, bogosum/(500000/HZ), (bogosum/(5000/HZ))%100));
259 printk("Total of %d Processors activated (%lu.%02lu BogoMIPS).\n", 259 printk("Total of %d Processors activated (%lu.%02lu BogoMIPS).\n",
@@ -266,19 +266,19 @@ void __init smp4d_boot_cpus(void)
266 266
267 /* Free unneeded trap tables */ 267 /* Free unneeded trap tables */
268 ClearPageReserved(virt_to_page(trapbase_cpu1)); 268 ClearPageReserved(virt_to_page(trapbase_cpu1));
269 set_page_count(virt_to_page(trapbase_cpu1), 1); 269 init_page_count(virt_to_page(trapbase_cpu1));
270 free_page((unsigned long)trapbase_cpu1); 270 free_page((unsigned long)trapbase_cpu1);
271 totalram_pages++; 271 totalram_pages++;
272 num_physpages++; 272 num_physpages++;
273 273
274 ClearPageReserved(virt_to_page(trapbase_cpu2)); 274 ClearPageReserved(virt_to_page(trapbase_cpu2));
275 set_page_count(virt_to_page(trapbase_cpu2), 1); 275 init_page_count(virt_to_page(trapbase_cpu2));
276 free_page((unsigned long)trapbase_cpu2); 276 free_page((unsigned long)trapbase_cpu2);
277 totalram_pages++; 277 totalram_pages++;
278 num_physpages++; 278 num_physpages++;
279 279
280 ClearPageReserved(virt_to_page(trapbase_cpu3)); 280 ClearPageReserved(virt_to_page(trapbase_cpu3));
281 set_page_count(virt_to_page(trapbase_cpu3), 1); 281 init_page_count(virt_to_page(trapbase_cpu3));
282 free_page((unsigned long)trapbase_cpu3); 282 free_page((unsigned long)trapbase_cpu3);
283 totalram_pages++; 283 totalram_pages++;
284 num_physpages++; 284 num_physpages++;
diff --git a/arch/sparc/kernel/sun4m_smp.c b/arch/sparc/kernel/sun4m_smp.c
index a21f27d10e55..70b375a4c2c2 100644
--- a/arch/sparc/kernel/sun4m_smp.c
+++ b/arch/sparc/kernel/sun4m_smp.c
@@ -40,15 +40,11 @@ extern ctxd_t *srmmu_ctx_table_phys;
40extern void calibrate_delay(void); 40extern void calibrate_delay(void);
41 41
42extern volatile int smp_processors_ready; 42extern volatile int smp_processors_ready;
43extern int smp_num_cpus;
44extern volatile unsigned long cpu_callin_map[NR_CPUS]; 43extern volatile unsigned long cpu_callin_map[NR_CPUS];
45extern unsigned char boot_cpu_id; 44extern unsigned char boot_cpu_id;
46extern int smp_activated; 45
47extern volatile int __cpu_number_map[NR_CPUS]; 46extern cpumask_t smp_commenced_mask;
48extern volatile int __cpu_logical_map[NR_CPUS]; 47
49extern volatile unsigned long ipi_count;
50extern volatile int smp_process_available;
51extern volatile int smp_commenced;
52extern int __smp4m_processor_id(void); 48extern int __smp4m_processor_id(void);
53 49
54/*#define SMP_DEBUG*/ 50/*#define SMP_DEBUG*/
@@ -77,8 +73,6 @@ void __init smp4m_callin(void)
77 local_flush_cache_all(); 73 local_flush_cache_all();
78 local_flush_tlb_all(); 74 local_flush_tlb_all();
79 75
80 set_irq_udt(boot_cpu_id);
81
82 /* Get our local ticker going. */ 76 /* Get our local ticker going. */
83 smp_setup_percpu_timer(); 77 smp_setup_percpu_timer();
84 78
@@ -95,8 +89,9 @@ void __init smp4m_callin(void)
95 * to call the scheduler code. 89 * to call the scheduler code.
96 */ 90 */
97 /* Allow master to continue. */ 91 /* Allow master to continue. */
98 swap((unsigned long *)&cpu_callin_map[cpuid], 1); 92 swap(&cpu_callin_map[cpuid], 1);
99 93
94 /* XXX: What's up with all the flushes? */
100 local_flush_cache_all(); 95 local_flush_cache_all();
101 local_flush_tlb_all(); 96 local_flush_tlb_all();
102 97
@@ -111,13 +106,14 @@ void __init smp4m_callin(void)
111 atomic_inc(&init_mm.mm_count); 106 atomic_inc(&init_mm.mm_count);
112 current->active_mm = &init_mm; 107 current->active_mm = &init_mm;
113 108
114 while(!smp_commenced) 109 while (!cpu_isset(cpuid, smp_commenced_mask))
115 barrier(); 110 mb();
116
117 local_flush_cache_all();
118 local_flush_tlb_all();
119 111
120 local_irq_enable(); 112 local_irq_enable();
113
114 cpu_set(cpuid, cpu_online_map);
115 /* last one in gets all the interrupts (for testing) */
116 set_irq_udt(boot_cpu_id);
121} 117}
122 118
123extern void init_IRQ(void); 119extern void init_IRQ(void);
@@ -134,120 +130,92 @@ extern unsigned long trapbase_cpu3[];
134 130
135void __init smp4m_boot_cpus(void) 131void __init smp4m_boot_cpus(void)
136{ 132{
137 int cpucount = 0; 133 smp_setup_percpu_timer();
138 int i, mid; 134 local_flush_cache_all();
135}
139 136
140 printk("Entering SMP Mode...\n"); 137int smp4m_boot_one_cpu(int i)
138{
139 extern unsigned long sun4m_cpu_startup;
140 unsigned long *entry = &sun4m_cpu_startup;
141 struct task_struct *p;
142 int timeout;
143 int cpu_node;
141 144
142 local_irq_enable(); 145 cpu_find_by_mid(i, &cpu_node);
143 cpus_clear(cpu_present_map);
144 146
145 for (i = 0; !cpu_find_by_instance(i, NULL, &mid); i++) 147 /* Cook up an idler for this guy. */
146 cpu_set(mid, cpu_present_map); 148 p = fork_idle(i);
149 current_set[i] = task_thread_info(p);
150 /* See trampoline.S for details... */
151 entry += ((i-1) * 3);
147 152
148 for(i=0; i < NR_CPUS; i++) { 153 /*
149 __cpu_number_map[i] = -1; 154 * Initialize the contexts table
150 __cpu_logical_map[i] = -1; 155 * Since the call to prom_startcpu() trashes the structure,
156 * we need to re-initialize it for each cpu
157 */
158 smp_penguin_ctable.which_io = 0;
159 smp_penguin_ctable.phys_addr = (unsigned int) srmmu_ctx_table_phys;
160 smp_penguin_ctable.reg_size = 0;
161
162 /* whirrr, whirrr, whirrrrrrrrr... */
163 printk("Starting CPU %d at %p\n", i, entry);
164 local_flush_cache_all();
165 prom_startcpu(cpu_node,
166 &smp_penguin_ctable, 0, (char *)entry);
167
168 /* wheee... it's going... */
169 for(timeout = 0; timeout < 10000; timeout++) {
170 if(cpu_callin_map[i])
171 break;
172 udelay(200);
151 } 173 }
152 174
153 __cpu_number_map[boot_cpu_id] = 0; 175 if (!(cpu_callin_map[i])) {
154 __cpu_logical_map[0] = boot_cpu_id; 176 printk("Processor %d is stuck.\n", i);
155 current_thread_info()->cpu = boot_cpu_id; 177 return -ENODEV;
178 }
156 179
157 smp_store_cpu_info(boot_cpu_id);
158 set_irq_udt(boot_cpu_id);
159 smp_setup_percpu_timer();
160 local_flush_cache_all(); 180 local_flush_cache_all();
161 if(cpu_find_by_instance(1, NULL, NULL)) 181 return 0;
162 return; /* Not an MP box. */ 182}
163 for(i = 0; i < NR_CPUS; i++) { 183
164 if(i == boot_cpu_id) 184void __init smp4m_smp_done(void)
165 continue; 185{
166 186 int i, first;
167 if (cpu_isset(i, cpu_present_map)) { 187 int *prev;
168 extern unsigned long sun4m_cpu_startup; 188
169 unsigned long *entry = &sun4m_cpu_startup; 189 /* setup cpu list for irq rotation */
170 struct task_struct *p; 190 first = 0;
171 int timeout; 191 prev = &first;
172 192 for (i = 0; i < NR_CPUS; i++) {
173 /* Cook up an idler for this guy. */ 193 if (cpu_online(i)) {
174 p = fork_idle(i); 194 *prev = i;
175 cpucount++; 195 prev = &cpu_data(i).next;
176 current_set[i] = task_thread_info(p);
177 /* See trampoline.S for details... */
178 entry += ((i-1) * 3);
179
180 /*
181 * Initialize the contexts table
182 * Since the call to prom_startcpu() trashes the structure,
183 * we need to re-initialize it for each cpu
184 */
185 smp_penguin_ctable.which_io = 0;
186 smp_penguin_ctable.phys_addr = (unsigned int) srmmu_ctx_table_phys;
187 smp_penguin_ctable.reg_size = 0;
188
189 /* whirrr, whirrr, whirrrrrrrrr... */
190 printk("Starting CPU %d at %p\n", i, entry);
191 local_flush_cache_all();
192 prom_startcpu(cpu_data(i).prom_node,
193 &smp_penguin_ctable, 0, (char *)entry);
194
195 /* wheee... it's going... */
196 for(timeout = 0; timeout < 10000; timeout++) {
197 if(cpu_callin_map[i])
198 break;
199 udelay(200);
200 }
201 if(cpu_callin_map[i]) {
202 /* Another "Red Snapper". */
203 __cpu_number_map[i] = i;
204 __cpu_logical_map[i] = i;
205 } else {
206 cpucount--;
207 printk("Processor %d is stuck.\n", i);
208 }
209 }
210 if(!(cpu_callin_map[i])) {
211 cpu_clear(i, cpu_present_map);
212 __cpu_number_map[i] = -1;
213 } 196 }
214 } 197 }
198 *prev = first;
215 local_flush_cache_all(); 199 local_flush_cache_all();
216 if(cpucount == 0) {
217 printk("Error: only one Processor found.\n");
218 cpu_present_map = cpumask_of_cpu(smp_processor_id());
219 } else {
220 unsigned long bogosum = 0;
221 for(i = 0; i < NR_CPUS; i++) {
222 if (cpu_isset(i, cpu_present_map))
223 bogosum += cpu_data(i).udelay_val;
224 }
225 printk("Total of %d Processors activated (%lu.%02lu BogoMIPS).\n",
226 cpucount + 1,
227 bogosum/(500000/HZ),
228 (bogosum/(5000/HZ))%100);
229 smp_activated = 1;
230 smp_num_cpus = cpucount + 1;
231 }
232 200
233 /* Free unneeded trap tables */ 201 /* Free unneeded trap tables */
234 if (!cpu_isset(i, cpu_present_map)) { 202 if (!cpu_isset(1, cpu_present_map)) {
235 ClearPageReserved(virt_to_page(trapbase_cpu1)); 203 ClearPageReserved(virt_to_page(trapbase_cpu1));
236 set_page_count(virt_to_page(trapbase_cpu1), 1); 204 init_page_count(virt_to_page(trapbase_cpu1));
237 free_page((unsigned long)trapbase_cpu1); 205 free_page((unsigned long)trapbase_cpu1);
238 totalram_pages++; 206 totalram_pages++;
239 num_physpages++; 207 num_physpages++;
240 } 208 }
241 if (!cpu_isset(2, cpu_present_map)) { 209 if (!cpu_isset(2, cpu_present_map)) {
242 ClearPageReserved(virt_to_page(trapbase_cpu2)); 210 ClearPageReserved(virt_to_page(trapbase_cpu2));
243 set_page_count(virt_to_page(trapbase_cpu2), 1); 211 init_page_count(virt_to_page(trapbase_cpu2));
244 free_page((unsigned long)trapbase_cpu2); 212 free_page((unsigned long)trapbase_cpu2);
245 totalram_pages++; 213 totalram_pages++;
246 num_physpages++; 214 num_physpages++;
247 } 215 }
248 if (!cpu_isset(3, cpu_present_map)) { 216 if (!cpu_isset(3, cpu_present_map)) {
249 ClearPageReserved(virt_to_page(trapbase_cpu3)); 217 ClearPageReserved(virt_to_page(trapbase_cpu3));
250 set_page_count(virt_to_page(trapbase_cpu3), 1); 218 init_page_count(virt_to_page(trapbase_cpu3));
251 free_page((unsigned long)trapbase_cpu3); 219 free_page((unsigned long)trapbase_cpu3);
252 totalram_pages++; 220 totalram_pages++;
253 num_physpages++; 221 num_physpages++;
@@ -265,6 +233,9 @@ void __init smp4m_boot_cpus(void)
265 */ 233 */
266void smp4m_irq_rotate(int cpu) 234void smp4m_irq_rotate(int cpu)
267{ 235{
236 int next = cpu_data(cpu).next;
237 if (next != cpu)
238 set_irq_udt(next);
268} 239}
269 240
270/* Cross calls, in order to work efficiently and atomically do all 241/* Cross calls, in order to work efficiently and atomically do all
@@ -291,7 +262,7 @@ void smp4m_message_pass(int target, int msg, unsigned long data, int wait)
291 262
292 smp_cpu_in_msg[me]++; 263 smp_cpu_in_msg[me]++;
293 if(target == MSG_ALL_BUT_SELF || target == MSG_ALL) { 264 if(target == MSG_ALL_BUT_SELF || target == MSG_ALL) {
294 mask = cpu_present_map; 265 mask = cpu_online_map;
295 if(target == MSG_ALL_BUT_SELF) 266 if(target == MSG_ALL_BUT_SELF)
296 cpu_clear(me, mask); 267 cpu_clear(me, mask);
297 for(i = 0; i < 4; i++) { 268 for(i = 0; i < 4; i++) {
@@ -316,8 +287,8 @@ static struct smp_funcall {
316 unsigned long arg3; 287 unsigned long arg3;
317 unsigned long arg4; 288 unsigned long arg4;
318 unsigned long arg5; 289 unsigned long arg5;
319 unsigned long processors_in[NR_CPUS]; /* Set when ipi entered. */ 290 unsigned long processors_in[SUN4M_NCPUS]; /* Set when ipi entered. */
320 unsigned long processors_out[NR_CPUS]; /* Set when ipi exited. */ 291 unsigned long processors_out[SUN4M_NCPUS]; /* Set when ipi exited. */
321} ccall_info; 292} ccall_info;
322 293
323static DEFINE_SPINLOCK(cross_call_lock); 294static DEFINE_SPINLOCK(cross_call_lock);
@@ -326,8 +297,7 @@ static DEFINE_SPINLOCK(cross_call_lock);
326void smp4m_cross_call(smpfunc_t func, unsigned long arg1, unsigned long arg2, 297void smp4m_cross_call(smpfunc_t func, unsigned long arg1, unsigned long arg2,
327 unsigned long arg3, unsigned long arg4, unsigned long arg5) 298 unsigned long arg3, unsigned long arg4, unsigned long arg5)
328{ 299{
329 if(smp_processors_ready) { 300 register int ncpus = SUN4M_NCPUS;
330 register int ncpus = smp_num_cpus;
331 unsigned long flags; 301 unsigned long flags;
332 302
333 spin_lock_irqsave(&cross_call_lock, flags); 303 spin_lock_irqsave(&cross_call_lock, flags);
@@ -342,7 +312,7 @@ void smp4m_cross_call(smpfunc_t func, unsigned long arg1, unsigned long arg2,
342 312
343 /* Init receive/complete mapping, plus fire the IPI's off. */ 313 /* Init receive/complete mapping, plus fire the IPI's off. */
344 { 314 {
345 cpumask_t mask = cpu_present_map; 315 cpumask_t mask = cpu_online_map;
346 register int i; 316 register int i;
347 317
348 cpu_clear(smp_processor_id(), mask); 318 cpu_clear(smp_processor_id(), mask);
@@ -375,7 +345,6 @@ void smp4m_cross_call(smpfunc_t func, unsigned long arg1, unsigned long arg2,
375 } 345 }
376 346
377 spin_unlock_irqrestore(&cross_call_lock, flags); 347 spin_unlock_irqrestore(&cross_call_lock, flags);
378 }
379} 348}
380 349
381/* Running cross calls. */ 350/* Running cross calls. */
diff --git a/arch/sparc/mm/generic.c b/arch/sparc/mm/generic.c
index 2cb0728cee05..1ef7fa03fefe 100644
--- a/arch/sparc/mm/generic.c
+++ b/arch/sparc/mm/generic.c
@@ -76,7 +76,6 @@ int io_remap_pfn_range(struct vm_area_struct *vma, unsigned long from,
76 vma->vm_pgoff = (offset >> PAGE_SHIFT) | 76 vma->vm_pgoff = (offset >> PAGE_SHIFT) |
77 ((unsigned long)space << 28UL); 77 ((unsigned long)space << 28UL);
78 78
79 prot = __pgprot(pg_iobits);
80 offset -= from; 79 offset -= from;
81 dir = pgd_offset(mm, from); 80 dir = pgd_offset(mm, from);
82 flush_cache_range(vma, beg, end); 81 flush_cache_range(vma, beg, end);
diff --git a/arch/sparc/mm/init.c b/arch/sparc/mm/init.c
index c03babaa0498..898669732466 100644
--- a/arch/sparc/mm/init.c
+++ b/arch/sparc/mm/init.c
@@ -383,7 +383,7 @@ void map_high_region(unsigned long start_pfn, unsigned long end_pfn)
383 struct page *page = pfn_to_page(tmp); 383 struct page *page = pfn_to_page(tmp);
384 384
385 ClearPageReserved(page); 385 ClearPageReserved(page);
386 set_page_count(page, 1); 386 init_page_count(page);
387 __free_page(page); 387 __free_page(page);
388 totalhigh_pages++; 388 totalhigh_pages++;
389 } 389 }
@@ -480,7 +480,7 @@ void free_initmem (void)
480 p = virt_to_page(addr); 480 p = virt_to_page(addr);
481 481
482 ClearPageReserved(p); 482 ClearPageReserved(p);
483 set_page_count(p, 1); 483 init_page_count(p);
484 __free_page(p); 484 __free_page(p);
485 totalram_pages++; 485 totalram_pages++;
486 num_physpages++; 486 num_physpages++;
@@ -497,7 +497,7 @@ void free_initrd_mem(unsigned long start, unsigned long end)
497 struct page *p = virt_to_page(start); 497 struct page *p = virt_to_page(start);
498 498
499 ClearPageReserved(p); 499 ClearPageReserved(p);
500 set_page_count(p, 1); 500 init_page_count(p);
501 __free_page(p); 501 __free_page(p);
502 num_physpages++; 502 num_physpages++;
503 } 503 }
diff --git a/arch/sparc/mm/loadmmu.c b/arch/sparc/mm/loadmmu.c
index e9f9571601ba..36b4d24988f8 100644
--- a/arch/sparc/mm/loadmmu.c
+++ b/arch/sparc/mm/loadmmu.c
@@ -22,8 +22,6 @@ struct ctx_list *ctx_list_pool;
22struct ctx_list ctx_free; 22struct ctx_list ctx_free;
23struct ctx_list ctx_used; 23struct ctx_list ctx_used;
24 24
25unsigned int pg_iobits;
26
27extern void ld_mmu_sun4c(void); 25extern void ld_mmu_sun4c(void);
28extern void ld_mmu_srmmu(void); 26extern void ld_mmu_srmmu(void);
29 27
diff --git a/arch/sparc/mm/srmmu.c b/arch/sparc/mm/srmmu.c
index c664b962987c..58c65cc8d0d3 100644
--- a/arch/sparc/mm/srmmu.c
+++ b/arch/sparc/mm/srmmu.c
@@ -1302,7 +1302,12 @@ void __init srmmu_paging_init(void)
1302 1302
1303 flush_cache_all(); 1303 flush_cache_all();
1304 srmmu_set_ctable_ptr((unsigned long)srmmu_ctx_table_phys); 1304 srmmu_set_ctable_ptr((unsigned long)srmmu_ctx_table_phys);
1305#ifdef CONFIG_SMP
1306 /* Stop from hanging here... */
1307 local_flush_tlb_all();
1308#else
1305 flush_tlb_all(); 1309 flush_tlb_all();
1310#endif
1306 poke_srmmu(); 1311 poke_srmmu();
1307 1312
1308#ifdef CONFIG_SUN_IO 1313#ifdef CONFIG_SUN_IO
@@ -1419,6 +1424,7 @@ static void __init init_vac_layout(void)
1419 max_size = vac_cache_size; 1424 max_size = vac_cache_size;
1420 if(vac_line_size < min_line_size) 1425 if(vac_line_size < min_line_size)
1421 min_line_size = vac_line_size; 1426 min_line_size = vac_line_size;
1427 //FIXME: cpus not contiguous!!
1422 cpu++; 1428 cpu++;
1423 if (cpu >= NR_CPUS || !cpu_online(cpu)) 1429 if (cpu >= NR_CPUS || !cpu_online(cpu))
1424 break; 1430 break;
@@ -2130,6 +2136,13 @@ static unsigned long srmmu_pte_to_pgoff(pte_t pte)
2130 return pte_val(pte) >> SRMMU_PTE_FILE_SHIFT; 2136 return pte_val(pte) >> SRMMU_PTE_FILE_SHIFT;
2131} 2137}
2132 2138
2139static pgprot_t srmmu_pgprot_noncached(pgprot_t prot)
2140{
2141 prot &= ~__pgprot(SRMMU_CACHE);
2142
2143 return prot;
2144}
2145
2133/* Load up routines and constants for sun4m and sun4d mmu */ 2146/* Load up routines and constants for sun4m and sun4d mmu */
2134void __init ld_mmu_srmmu(void) 2147void __init ld_mmu_srmmu(void)
2135{ 2148{
@@ -2150,9 +2163,9 @@ void __init ld_mmu_srmmu(void)
2150 BTFIXUPSET_INT(page_readonly, pgprot_val(SRMMU_PAGE_RDONLY)); 2163 BTFIXUPSET_INT(page_readonly, pgprot_val(SRMMU_PAGE_RDONLY));
2151 BTFIXUPSET_INT(page_kernel, pgprot_val(SRMMU_PAGE_KERNEL)); 2164 BTFIXUPSET_INT(page_kernel, pgprot_val(SRMMU_PAGE_KERNEL));
2152 page_kernel = pgprot_val(SRMMU_PAGE_KERNEL); 2165 page_kernel = pgprot_val(SRMMU_PAGE_KERNEL);
2153 pg_iobits = SRMMU_VALID | SRMMU_WRITE | SRMMU_REF;
2154 2166
2155 /* Functions */ 2167 /* Functions */
2168 BTFIXUPSET_CALL(pgprot_noncached, srmmu_pgprot_noncached, BTFIXUPCALL_NORM);
2156#ifndef CONFIG_SMP 2169#ifndef CONFIG_SMP
2157 BTFIXUPSET_CALL(___xchg32, ___xchg32_sun4md, BTFIXUPCALL_SWAPG1G2); 2170 BTFIXUPSET_CALL(___xchg32, ___xchg32_sun4md, BTFIXUPCALL_SWAPG1G2);
2158#endif 2171#endif
diff --git a/arch/sparc/mm/sun4c.c b/arch/sparc/mm/sun4c.c
index 731f19603cad..49f28c1bdc6d 100644
--- a/arch/sparc/mm/sun4c.c
+++ b/arch/sparc/mm/sun4c.c
@@ -1589,7 +1589,10 @@ static void sun4c_flush_tlb_page(struct vm_area_struct *vma, unsigned long page)
1589 1589
1590static inline void sun4c_mapioaddr(unsigned long physaddr, unsigned long virt_addr) 1590static inline void sun4c_mapioaddr(unsigned long physaddr, unsigned long virt_addr)
1591{ 1591{
1592 unsigned long page_entry; 1592 unsigned long page_entry, pg_iobits;
1593
1594 pg_iobits = _SUN4C_PAGE_PRESENT | _SUN4C_READABLE | _SUN4C_WRITEABLE |
1595 _SUN4C_PAGE_IO | _SUN4C_PAGE_NOCACHE;
1593 1596
1594 page_entry = ((physaddr >> PAGE_SHIFT) & SUN4C_PFN_MASK); 1597 page_entry = ((physaddr >> PAGE_SHIFT) & SUN4C_PFN_MASK);
1595 page_entry |= ((pg_iobits | _SUN4C_PAGE_PRIV) & ~(_SUN4C_PAGE_PRESENT)); 1598 page_entry |= ((pg_iobits | _SUN4C_PAGE_PRIV) & ~(_SUN4C_PAGE_PRESENT));
@@ -2134,6 +2137,13 @@ void __init sun4c_paging_init(void)
2134 printk("SUN4C: %d mmu entries for the kernel\n", cnt); 2137 printk("SUN4C: %d mmu entries for the kernel\n", cnt);
2135} 2138}
2136 2139
2140static pgprot_t sun4c_pgprot_noncached(pgprot_t prot)
2141{
2142 prot |= __pgprot(_SUN4C_PAGE_IO | _SUN4C_PAGE_NOCACHE);
2143
2144 return prot;
2145}
2146
2137/* Load up routines and constants for sun4c mmu */ 2147/* Load up routines and constants for sun4c mmu */
2138void __init ld_mmu_sun4c(void) 2148void __init ld_mmu_sun4c(void)
2139{ 2149{
@@ -2156,10 +2166,9 @@ void __init ld_mmu_sun4c(void)
2156 BTFIXUPSET_INT(page_readonly, pgprot_val(SUN4C_PAGE_READONLY)); 2166 BTFIXUPSET_INT(page_readonly, pgprot_val(SUN4C_PAGE_READONLY));
2157 BTFIXUPSET_INT(page_kernel, pgprot_val(SUN4C_PAGE_KERNEL)); 2167 BTFIXUPSET_INT(page_kernel, pgprot_val(SUN4C_PAGE_KERNEL));
2158 page_kernel = pgprot_val(SUN4C_PAGE_KERNEL); 2168 page_kernel = pgprot_val(SUN4C_PAGE_KERNEL);
2159 pg_iobits = _SUN4C_PAGE_PRESENT | _SUN4C_READABLE | _SUN4C_WRITEABLE |
2160 _SUN4C_PAGE_IO | _SUN4C_PAGE_NOCACHE;
2161 2169
2162 /* Functions */ 2170 /* Functions */
2171 BTFIXUPSET_CALL(pgprot_noncached, sun4c_pgprot_noncached, BTFIXUPCALL_NORM);
2163 BTFIXUPSET_CALL(___xchg32, ___xchg32_sun4c, BTFIXUPCALL_NORM); 2172 BTFIXUPSET_CALL(___xchg32, ___xchg32_sun4c, BTFIXUPCALL_NORM);
2164 BTFIXUPSET_CALL(do_check_pgt_cache, sun4c_check_pgt_cache, BTFIXUPCALL_NORM); 2173 BTFIXUPSET_CALL(do_check_pgt_cache, sun4c_check_pgt_cache, BTFIXUPCALL_NORM);
2165 2174
diff --git a/arch/sparc64/Kconfig b/arch/sparc64/Kconfig
index 4c0a50a76554..d1e2fc566486 100644
--- a/arch/sparc64/Kconfig
+++ b/arch/sparc64/Kconfig
@@ -162,6 +162,14 @@ config RWSEM_XCHGADD_ALGORITHM
162 bool 162 bool
163 default y 163 default y
164 164
165config GENERIC_FIND_NEXT_BIT
166 bool
167 default y
168
169config GENERIC_HWEIGHT
170 bool
171 default y if !ULTRA_HAS_POPULATION_COUNT
172
165config GENERIC_CALIBRATE_DELAY 173config GENERIC_CALIBRATE_DELAY
166 bool 174 bool
167 default y 175 default y
@@ -175,17 +183,26 @@ config HUGETLB_PAGE_SIZE_4MB
175 bool "4MB" 183 bool "4MB"
176 184
177config HUGETLB_PAGE_SIZE_512K 185config HUGETLB_PAGE_SIZE_512K
178 depends on !SPARC64_PAGE_SIZE_4MB 186 depends on !SPARC64_PAGE_SIZE_4MB && !SPARC64_PAGE_SIZE_512KB
179 bool "512K" 187 bool "512K"
180 188
181config HUGETLB_PAGE_SIZE_64K 189config HUGETLB_PAGE_SIZE_64K
182 depends on !SPARC64_PAGE_SIZE_4MB && !SPARC64_PAGE_SIZE_512KB 190 depends on !SPARC64_PAGE_SIZE_4MB && !SPARC64_PAGE_SIZE_512KB && !SPARC64_PAGE_SIZE_64K
183 bool "64K" 191 bool "64K"
184 192
185endchoice 193endchoice
186 194
187endmenu 195endmenu
188 196
197config ARCH_SPARSEMEM_ENABLE
198 def_bool y
199
200config ARCH_SPARSEMEM_DEFAULT
201 def_bool y
202
203config LARGE_ALLOCS
204 def_bool y
205
189source "mm/Kconfig" 206source "mm/Kconfig"
190 207
191config GENERIC_ISA_DMA 208config GENERIC_ISA_DMA
@@ -350,6 +367,15 @@ config SOLARIS_EMUL
350 367
351endmenu 368endmenu
352 369
370config SCHED_SMT
371 bool "SMT (Hyperthreading) scheduler support"
372 depends on SMP
373 default y
374 help
375 SMT scheduler support improves the CPU scheduler's decision making
376 when dealing with UltraSPARC cpus at a cost of slightly increased
377 overhead in some places. If unsure say N here.
378
353config CMDLINE_BOOL 379config CMDLINE_BOOL
354 bool "Default bootloader kernel arguments" 380 bool "Default bootloader kernel arguments"
355 381
diff --git a/arch/sparc64/Kconfig.debug b/arch/sparc64/Kconfig.debug
index 3e31be494e54..afe0a7720a26 100644
--- a/arch/sparc64/Kconfig.debug
+++ b/arch/sparc64/Kconfig.debug
@@ -24,7 +24,7 @@ config DEBUG_BOOTMEM
24 bool "Debug BOOTMEM initialization" 24 bool "Debug BOOTMEM initialization"
25 25
26config DEBUG_PAGEALLOC 26config DEBUG_PAGEALLOC
27 bool "Page alloc debugging" 27 bool "Debug page memory allocations"
28 depends on DEBUG_KERNEL && !SOFTWARE_SUSPEND 28 depends on DEBUG_KERNEL && !SOFTWARE_SUSPEND
29 help 29 help
30 Unmap pages from the kernel linear mapping after free_pages(). 30 Unmap pages from the kernel linear mapping after free_pages().
diff --git a/arch/sparc64/defconfig b/arch/sparc64/defconfig
index 069d49777b2a..900fb0b940d8 100644
--- a/arch/sparc64/defconfig
+++ b/arch/sparc64/defconfig
@@ -1,7 +1,7 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.16-rc2 3# Linux kernel version: 2.6.16
4# Tue Feb 7 17:47:18 2006 4# Sun Mar 26 14:58:11 2006
5# 5#
6CONFIG_SPARC=y 6CONFIG_SPARC=y
7CONFIG_SPARC64=y 7CONFIG_SPARC64=y
@@ -38,6 +38,7 @@ CONFIG_POSIX_MQUEUE=y
38CONFIG_SYSCTL=y 38CONFIG_SYSCTL=y
39# CONFIG_AUDIT is not set 39# CONFIG_AUDIT is not set
40# CONFIG_IKCONFIG is not set 40# CONFIG_IKCONFIG is not set
41CONFIG_RELAY=y
41CONFIG_INITRAMFS_SOURCE="" 42CONFIG_INITRAMFS_SOURCE=""
42CONFIG_UID16=y 43CONFIG_UID16=y
43CONFIG_CC_OPTIMIZE_FOR_SIZE=y 44CONFIG_CC_OPTIMIZE_FOR_SIZE=y
@@ -53,10 +54,6 @@ CONFIG_BASE_FULL=y
53CONFIG_FUTEX=y 54CONFIG_FUTEX=y
54CONFIG_EPOLL=y 55CONFIG_EPOLL=y
55CONFIG_SHMEM=y 56CONFIG_SHMEM=y
56CONFIG_CC_ALIGN_FUNCTIONS=0
57CONFIG_CC_ALIGN_LABELS=0
58CONFIG_CC_ALIGN_LOOPS=0
59CONFIG_CC_ALIGN_JUMPS=0
60CONFIG_SLAB=y 57CONFIG_SLAB=y
61# CONFIG_TINY_SHMEM is not set 58# CONFIG_TINY_SHMEM is not set
62CONFIG_BASE_SMALL=0 59CONFIG_BASE_SMALL=0
@@ -68,7 +65,6 @@ CONFIG_BASE_SMALL=0
68CONFIG_MODULES=y 65CONFIG_MODULES=y
69CONFIG_MODULE_UNLOAD=y 66CONFIG_MODULE_UNLOAD=y
70CONFIG_MODULE_FORCE_UNLOAD=y 67CONFIG_MODULE_FORCE_UNLOAD=y
71CONFIG_OBSOLETE_MODPARM=y
72CONFIG_MODVERSIONS=y 68CONFIG_MODVERSIONS=y
73CONFIG_MODULE_SRCVERSION_ALL=y 69CONFIG_MODULE_SRCVERSION_ALL=y
74CONFIG_KMOD=y 70CONFIG_KMOD=y
@@ -76,6 +72,7 @@ CONFIG_KMOD=y
76# 72#
77# Block layer 73# Block layer
78# 74#
75CONFIG_BLK_DEV_IO_TRACE=y
79 76
80# 77#
81# IO Schedulers 78# IO Schedulers
@@ -111,17 +108,24 @@ CONFIG_CPU_FREQ_GOV_CONSERVATIVE=m
111CONFIG_US3_FREQ=m 108CONFIG_US3_FREQ=m
112CONFIG_US2E_FREQ=m 109CONFIG_US2E_FREQ=m
113CONFIG_RWSEM_XCHGADD_ALGORITHM=y 110CONFIG_RWSEM_XCHGADD_ALGORITHM=y
111CONFIG_GENERIC_FIND_NEXT_BIT=y
112CONFIG_GENERIC_HWEIGHT=y
114CONFIG_GENERIC_CALIBRATE_DELAY=y 113CONFIG_GENERIC_CALIBRATE_DELAY=y
115CONFIG_HUGETLB_PAGE_SIZE_4MB=y 114CONFIG_HUGETLB_PAGE_SIZE_4MB=y
116# CONFIG_HUGETLB_PAGE_SIZE_512K is not set 115# CONFIG_HUGETLB_PAGE_SIZE_512K is not set
117# CONFIG_HUGETLB_PAGE_SIZE_64K is not set 116# CONFIG_HUGETLB_PAGE_SIZE_64K is not set
117CONFIG_ARCH_SPARSEMEM_ENABLE=y
118CONFIG_ARCH_SPARSEMEM_DEFAULT=y
119CONFIG_LARGE_ALLOCS=y
118CONFIG_SELECT_MEMORY_MODEL=y 120CONFIG_SELECT_MEMORY_MODEL=y
119CONFIG_FLATMEM_MANUAL=y 121# CONFIG_FLATMEM_MANUAL is not set
120# CONFIG_DISCONTIGMEM_MANUAL is not set 122# CONFIG_DISCONTIGMEM_MANUAL is not set
121# CONFIG_SPARSEMEM_MANUAL is not set 123CONFIG_SPARSEMEM_MANUAL=y
122CONFIG_FLATMEM=y 124CONFIG_SPARSEMEM=y
123CONFIG_FLAT_NODE_MEM_MAP=y 125CONFIG_HAVE_MEMORY_PRESENT=y
124# CONFIG_SPARSEMEM_STATIC is not set 126# CONFIG_SPARSEMEM_STATIC is not set
127CONFIG_SPARSEMEM_EXTREME=y
128CONFIG_MEMORY_HOTPLUG=y
125CONFIG_SPLIT_PTLOCK_CPUS=4 129CONFIG_SPLIT_PTLOCK_CPUS=4
126CONFIG_GENERIC_ISA_DMA=y 130CONFIG_GENERIC_ISA_DMA=y
127CONFIG_SBUS=y 131CONFIG_SBUS=y
@@ -130,7 +134,6 @@ CONFIG_SUN_AUXIO=y
130CONFIG_SUN_IO=y 134CONFIG_SUN_IO=y
131CONFIG_PCI=y 135CONFIG_PCI=y
132CONFIG_PCI_DOMAINS=y 136CONFIG_PCI_DOMAINS=y
133# CONFIG_PCI_LEGACY_PROC is not set
134# CONFIG_PCI_DEBUG is not set 137# CONFIG_PCI_DEBUG is not set
135CONFIG_SUN_OPENPROMFS=m 138CONFIG_SUN_OPENPROMFS=m
136CONFIG_SPARC32_COMPAT=y 139CONFIG_SPARC32_COMPAT=y
@@ -195,6 +198,8 @@ CONFIG_TCP_CONG_VEGAS=m
195CONFIG_TCP_CONG_SCALABLE=m 198CONFIG_TCP_CONG_SCALABLE=m
196CONFIG_IPV6=m 199CONFIG_IPV6=m
197CONFIG_IPV6_PRIVACY=y 200CONFIG_IPV6_PRIVACY=y
201CONFIG_IPV6_ROUTER_PREF=y
202CONFIG_IPV6_ROUTE_INFO=y
198CONFIG_INET6_AH=m 203CONFIG_INET6_AH=m
199CONFIG_INET6_ESP=m 204CONFIG_INET6_ESP=m
200CONFIG_INET6_IPCOMP=m 205CONFIG_INET6_IPCOMP=m
@@ -207,10 +212,12 @@ CONFIG_IPV6_TUNNEL=m
207# 212#
208CONFIG_IP_DCCP=m 213CONFIG_IP_DCCP=m
209CONFIG_INET_DCCP_DIAG=m 214CONFIG_INET_DCCP_DIAG=m
215CONFIG_IP_DCCP_ACKVEC=y
210 216
211# 217#
212# DCCP CCIDs Configuration (EXPERIMENTAL) 218# DCCP CCIDs Configuration (EXPERIMENTAL)
213# 219#
220CONFIG_IP_DCCP_CCID2=m
214CONFIG_IP_DCCP_CCID3=m 221CONFIG_IP_DCCP_CCID3=m
215CONFIG_IP_DCCP_TFRC_LIB=m 222CONFIG_IP_DCCP_TFRC_LIB=m
216 223
@@ -218,7 +225,6 @@ CONFIG_IP_DCCP_TFRC_LIB=m
218# DCCP Kernel Hacking 225# DCCP Kernel Hacking
219# 226#
220# CONFIG_IP_DCCP_DEBUG is not set 227# CONFIG_IP_DCCP_DEBUG is not set
221# CONFIG_IP_DCCP_UNLOAD_HACK is not set
222 228
223# 229#
224# SCTP Configuration (EXPERIMENTAL) 230# SCTP Configuration (EXPERIMENTAL)
@@ -303,6 +309,7 @@ CONFIG_BLK_DEV_NBD=m
303CONFIG_BLK_DEV_UB=m 309CONFIG_BLK_DEV_UB=m
304# CONFIG_BLK_DEV_RAM is not set 310# CONFIG_BLK_DEV_RAM is not set
305CONFIG_BLK_DEV_RAM_COUNT=16 311CONFIG_BLK_DEV_RAM_COUNT=16
312# CONFIG_BLK_DEV_INITRD is not set
306CONFIG_CDROM_PKTCDVD=m 313CONFIG_CDROM_PKTCDVD=m
307CONFIG_CDROM_PKTCDVD_BUFFERS=8 314CONFIG_CDROM_PKTCDVD_BUFFERS=8
308CONFIG_CDROM_PKTCDVD_WCACHE=y 315CONFIG_CDROM_PKTCDVD_WCACHE=y
@@ -655,6 +662,7 @@ CONFIG_SERIAL_SUNCORE=y
655CONFIG_SERIAL_SUNSU=y 662CONFIG_SERIAL_SUNSU=y
656CONFIG_SERIAL_SUNSU_CONSOLE=y 663CONFIG_SERIAL_SUNSU_CONSOLE=y
657CONFIG_SERIAL_SUNSAB=m 664CONFIG_SERIAL_SUNSAB=m
665CONFIG_SERIAL_SUNHV=y
658CONFIG_SERIAL_CORE=y 666CONFIG_SERIAL_CORE=y
659CONFIG_SERIAL_CORE_CONSOLE=y 667CONFIG_SERIAL_CORE_CONSOLE=y
660# CONFIG_SERIAL_JSM is not set 668# CONFIG_SERIAL_JSM is not set
@@ -715,7 +723,6 @@ CONFIG_I2C_ALGOBIT=y
715# CONFIG_I2C_PARPORT_LIGHT is not set 723# CONFIG_I2C_PARPORT_LIGHT is not set
716# CONFIG_I2C_PROSAVAGE is not set 724# CONFIG_I2C_PROSAVAGE is not set
717# CONFIG_I2C_SAVAGE4 is not set 725# CONFIG_I2C_SAVAGE4 is not set
718# CONFIG_SCx200_ACB is not set
719# CONFIG_I2C_SIS5595 is not set 726# CONFIG_I2C_SIS5595 is not set
720# CONFIG_I2C_SIS630 is not set 727# CONFIG_I2C_SIS630 is not set
721# CONFIG_I2C_SIS96X is not set 728# CONFIG_I2C_SIS96X is not set
@@ -801,10 +808,6 @@ CONFIG_HWMON=y
801# 808#
802 809
803# 810#
804# Multimedia Capabilities Port drivers
805#
806
807#
808# Multimedia devices 811# Multimedia devices
809# 812#
810# CONFIG_VIDEO_DEV is not set 813# CONFIG_VIDEO_DEV is not set
@@ -813,6 +816,7 @@ CONFIG_HWMON=y
813# Digital Video Broadcasting Devices 816# Digital Video Broadcasting Devices
814# 817#
815# CONFIG_DVB is not set 818# CONFIG_DVB is not set
819# CONFIG_USB_DABUSB is not set
816 820
817# 821#
818# Graphics support 822# Graphics support
@@ -894,10 +898,12 @@ CONFIG_SND_SEQ_DUMMY=m
894CONFIG_SND_OSSEMUL=y 898CONFIG_SND_OSSEMUL=y
895CONFIG_SND_MIXER_OSS=m 899CONFIG_SND_MIXER_OSS=m
896CONFIG_SND_PCM_OSS=m 900CONFIG_SND_PCM_OSS=m
901CONFIG_SND_PCM_OSS_PLUGINS=y
897CONFIG_SND_SEQUENCER_OSS=y 902CONFIG_SND_SEQUENCER_OSS=y
898# CONFIG_SND_RTCTIMER is not set 903# CONFIG_SND_RTCTIMER is not set
899# CONFIG_SND_DYNAMIC_MINORS is not set 904# CONFIG_SND_DYNAMIC_MINORS is not set
900CONFIG_SND_SUPPORT_OLD_API=y 905CONFIG_SND_SUPPORT_OLD_API=y
906CONFIG_SND_VERBOSE_PROCFS=y
901# CONFIG_SND_VERBOSE_PRINTK is not set 907# CONFIG_SND_VERBOSE_PRINTK is not set
902# CONFIG_SND_DEBUG is not set 908# CONFIG_SND_DEBUG is not set
903 909
@@ -980,6 +986,7 @@ CONFIG_SND_SUN_CS4231=m
980# 986#
981CONFIG_USB_ARCH_HAS_HCD=y 987CONFIG_USB_ARCH_HAS_HCD=y
982CONFIG_USB_ARCH_HAS_OHCI=y 988CONFIG_USB_ARCH_HAS_OHCI=y
989CONFIG_USB_ARCH_HAS_EHCI=y
983CONFIG_USB=y 990CONFIG_USB=y
984# CONFIG_USB_DEBUG is not set 991# CONFIG_USB_DEBUG is not set
985 992
@@ -1007,7 +1014,6 @@ CONFIG_USB_UHCI_HCD=m
1007# 1014#
1008# USB Device Class drivers 1015# USB Device Class drivers
1009# 1016#
1010# CONFIG_OBSOLETE_OSS_USB_DRIVER is not set
1011# CONFIG_USB_ACM is not set 1017# CONFIG_USB_ACM is not set
1012# CONFIG_USB_PRINTER is not set 1018# CONFIG_USB_PRINTER is not set
1013 1019
@@ -1051,15 +1057,6 @@ CONFIG_USB_HIDDEV=y
1051# CONFIG_USB_MICROTEK is not set 1057# CONFIG_USB_MICROTEK is not set
1052 1058
1053# 1059#
1054# USB Multimedia devices
1055#
1056# CONFIG_USB_DABUSB is not set
1057
1058#
1059# Video4Linux support is needed for USB Multimedia device support
1060#
1061
1062#
1063# USB Network Adapters 1060# USB Network Adapters
1064# 1061#
1065# CONFIG_USB_CATC is not set 1062# CONFIG_USB_CATC is not set
@@ -1116,11 +1113,7 @@ CONFIG_USB_HIDDEV=y
1116# CONFIG_INFINIBAND is not set 1113# CONFIG_INFINIBAND is not set
1117 1114
1118# 1115#
1119# SN Devices 1116# EDAC - error detection and reporting (RAS) (EXPERIMENTAL)
1120#
1121
1122#
1123# EDAC - error detection and reporting (RAS)
1124# 1117#
1125 1118
1126# 1119#
@@ -1191,7 +1184,6 @@ CONFIG_TMPFS=y
1191CONFIG_HUGETLBFS=y 1184CONFIG_HUGETLBFS=y
1192CONFIG_HUGETLB_PAGE=y 1185CONFIG_HUGETLB_PAGE=y
1193CONFIG_RAMFS=y 1186CONFIG_RAMFS=y
1194CONFIG_RELAYFS_FS=m
1195# CONFIG_CONFIGFS_FS is not set 1187# CONFIG_CONFIGFS_FS is not set
1196 1188
1197# 1189#
diff --git a/arch/sparc64/kernel/Makefile b/arch/sparc64/kernel/Makefile
index 83d67eb18895..6f6816488b04 100644
--- a/arch/sparc64/kernel/Makefile
+++ b/arch/sparc64/kernel/Makefile
@@ -11,10 +11,12 @@ obj-y := process.o setup.o cpu.o idprom.o \
11 traps.o devices.o auxio.o una_asm.o \ 11 traps.o devices.o auxio.o una_asm.o \
12 irq.o ptrace.o time.o sys_sparc.o signal.o \ 12 irq.o ptrace.o time.o sys_sparc.o signal.o \
13 unaligned.o central.o pci.o starfire.o semaphore.o \ 13 unaligned.o central.o pci.o starfire.o semaphore.o \
14 power.o sbus.o iommu_common.o sparc64_ksyms.o chmc.o 14 power.o sbus.o iommu_common.o sparc64_ksyms.o chmc.o \
15 visemul.o
15 16
16obj-$(CONFIG_PCI) += ebus.o isa.o pci_common.o pci_iommu.o \ 17obj-$(CONFIG_PCI) += ebus.o isa.o pci_common.o pci_iommu.o \
17 pci_psycho.o pci_sabre.o pci_schizo.o 18 pci_psycho.o pci_sabre.o pci_schizo.o \
19 pci_sun4v.o pci_sun4v_asm.o
18obj-$(CONFIG_SMP) += smp.o trampoline.o 20obj-$(CONFIG_SMP) += smp.o trampoline.o
19obj-$(CONFIG_SPARC32_COMPAT) += sys32.o sys_sparc32.o signal32.o 21obj-$(CONFIG_SPARC32_COMPAT) += sys32.o sys_sparc32.o signal32.o
20obj-$(CONFIG_BINFMT_ELF32) += binfmt_elf32.o 22obj-$(CONFIG_BINFMT_ELF32) += binfmt_elf32.o
@@ -38,5 +40,5 @@ else
38 CMODEL_CFLAG := -m64 -mcmodel=medlow 40 CMODEL_CFLAG := -m64 -mcmodel=medlow
39endif 41endif
40 42
41head.o: head.S ttable.S itlb_base.S dtlb_base.S dtlb_backend.S dtlb_prot.S \ 43head.o: head.S ttable.S itlb_miss.S dtlb_miss.S ktlb.S tsb.S \
42 etrap.S rtrap.S winfixup.S entry.S 44 etrap.S rtrap.S winfixup.S entry.S
diff --git a/arch/sparc64/kernel/binfmt_aout32.c b/arch/sparc64/kernel/binfmt_aout32.c
index 202a80c24b6f..d7caa60a0074 100644
--- a/arch/sparc64/kernel/binfmt_aout32.c
+++ b/arch/sparc64/kernel/binfmt_aout32.c
@@ -31,6 +31,7 @@
31#include <asm/system.h> 31#include <asm/system.h>
32#include <asm/uaccess.h> 32#include <asm/uaccess.h>
33#include <asm/pgalloc.h> 33#include <asm/pgalloc.h>
34#include <asm/mmu_context.h>
34 35
35static int load_aout32_binary(struct linux_binprm *, struct pt_regs * regs); 36static int load_aout32_binary(struct linux_binprm *, struct pt_regs * regs);
36static int load_aout32_library(struct file*); 37static int load_aout32_library(struct file*);
@@ -238,6 +239,8 @@ static int load_aout32_binary(struct linux_binprm * bprm, struct pt_regs * regs)
238 (current->mm->start_data = N_DATADDR(ex)); 239 (current->mm->start_data = N_DATADDR(ex));
239 current->mm->brk = ex.a_bss + 240 current->mm->brk = ex.a_bss +
240 (current->mm->start_brk = N_BSSADDR(ex)); 241 (current->mm->start_brk = N_BSSADDR(ex));
242 current->mm->free_area_cache = current->mm->mmap_base;
243 current->mm->cached_hole_size = 0;
241 244
242 current->mm->mmap = NULL; 245 current->mm->mmap = NULL;
243 compute_creds(bprm); 246 compute_creds(bprm);
@@ -329,15 +332,8 @@ beyond_if:
329 332
330 current->mm->start_stack = 333 current->mm->start_stack =
331 (unsigned long) create_aout32_tables((char __user *)bprm->p, bprm); 334 (unsigned long) create_aout32_tables((char __user *)bprm->p, bprm);
332 if (!(orig_thr_flags & _TIF_32BIT)) { 335 tsb_context_switch(current->mm);
333 unsigned long pgd_cache = get_pgd_cache(current->mm->pgd); 336
334
335 __asm__ __volatile__("stxa\t%0, [%1] %2\n\t"
336 "membar #Sync"
337 : /* no outputs */
338 : "r" (pgd_cache),
339 "r" (TSB_REG), "i" (ASI_DMMU));
340 }
341 start_thread32(regs, ex.a_entry, current->mm->start_stack); 337 start_thread32(regs, ex.a_entry, current->mm->start_stack);
342 if (current->ptrace & PT_PTRACED) 338 if (current->ptrace & PT_PTRACED)
343 send_sig(SIGTRAP, current, 0); 339 send_sig(SIGTRAP, current, 0);
diff --git a/arch/sparc64/kernel/binfmt_elf32.c b/arch/sparc64/kernel/binfmt_elf32.c
index a1a12d2aa353..8a2abcce2737 100644
--- a/arch/sparc64/kernel/binfmt_elf32.c
+++ b/arch/sparc64/kernel/binfmt_elf32.c
@@ -153,7 +153,9 @@ MODULE_AUTHOR("Eric Youngdale, David S. Miller, Jakub Jelinek");
153#undef MODULE_DESCRIPTION 153#undef MODULE_DESCRIPTION
154#undef MODULE_AUTHOR 154#undef MODULE_AUTHOR
155 155
156#include <asm/a.out.h>
157
156#undef TASK_SIZE 158#undef TASK_SIZE
157#define TASK_SIZE 0xf0000000 159#define TASK_SIZE STACK_TOP32
158 160
159#include "../../../fs/binfmt_elf.c" 161#include "../../../fs/binfmt_elf.c"
diff --git a/arch/sparc64/kernel/cpu.c b/arch/sparc64/kernel/cpu.c
index 00eed88ef2e8..11cc0caef592 100644
--- a/arch/sparc64/kernel/cpu.c
+++ b/arch/sparc64/kernel/cpu.c
@@ -13,6 +13,7 @@
13#include <asm/system.h> 13#include <asm/system.h>
14#include <asm/fpumacro.h> 14#include <asm/fpumacro.h>
15#include <asm/cpudata.h> 15#include <asm/cpudata.h>
16#include <asm/spitfire.h>
16 17
17DEFINE_PER_CPU(cpuinfo_sparc, __cpu_data) = { 0 }; 18DEFINE_PER_CPU(cpuinfo_sparc, __cpu_data) = { 0 };
18 19
@@ -71,6 +72,12 @@ void __init cpu_probe(void)
71 unsigned long ver, fpu_vers, manuf, impl, fprs; 72 unsigned long ver, fpu_vers, manuf, impl, fprs;
72 int i; 73 int i;
73 74
75 if (tlb_type == hypervisor) {
76 sparc_cpu_type = "UltraSparc T1 (Niagara)";
77 sparc_fpu_type = "UltraSparc T1 integrated FPU";
78 return;
79 }
80
74 fprs = fprs_read(); 81 fprs = fprs_read();
75 fprs_write(FPRS_FEF); 82 fprs_write(FPRS_FEF);
76 __asm__ __volatile__ ("rdpr %%ver, %0; stx %%fsr, [%1]" 83 __asm__ __volatile__ ("rdpr %%ver, %0; stx %%fsr, [%1]"
diff --git a/arch/sparc64/kernel/devices.c b/arch/sparc64/kernel/devices.c
index df9a1ca8fd77..007e8922cd16 100644
--- a/arch/sparc64/kernel/devices.c
+++ b/arch/sparc64/kernel/devices.c
@@ -12,6 +12,7 @@
12#include <linux/string.h> 12#include <linux/string.h>
13#include <linux/spinlock.h> 13#include <linux/spinlock.h>
14#include <linux/errno.h> 14#include <linux/errno.h>
15#include <linux/bootmem.h>
15 16
16#include <asm/page.h> 17#include <asm/page.h>
17#include <asm/oplib.h> 18#include <asm/oplib.h>
@@ -20,6 +21,8 @@
20#include <asm/spitfire.h> 21#include <asm/spitfire.h>
21#include <asm/timer.h> 22#include <asm/timer.h>
22#include <asm/cpudata.h> 23#include <asm/cpudata.h>
24#include <asm/vdev.h>
25#include <asm/irq.h>
23 26
24/* Used to synchronize acceses to NatSemi SUPER I/O chip configure 27/* Used to synchronize acceses to NatSemi SUPER I/O chip configure
25 * operations in asm/ns87303.h 28 * operations in asm/ns87303.h
@@ -29,13 +32,158 @@ DEFINE_SPINLOCK(ns87303_lock);
29extern void cpu_probe(void); 32extern void cpu_probe(void);
30extern void central_probe(void); 33extern void central_probe(void);
31 34
32static char *cpu_mid_prop(void) 35u32 sun4v_vdev_devhandle;
36int sun4v_vdev_root;
37
38struct vdev_intmap {
39 unsigned int phys;
40 unsigned int irq;
41 unsigned int cnode;
42 unsigned int cinterrupt;
43};
44
45struct vdev_intmask {
46 unsigned int phys;
47 unsigned int interrupt;
48 unsigned int __unused;
49};
50
51static struct vdev_intmap *vdev_intmap;
52static int vdev_num_intmap;
53static struct vdev_intmask vdev_intmask;
54
55static void __init sun4v_virtual_device_probe(void)
56{
57 struct linux_prom64_registers regs;
58 struct vdev_intmap *ip;
59 int node, sz, err;
60
61 if (tlb_type != hypervisor)
62 return;
63
64 node = prom_getchild(prom_root_node);
65 node = prom_searchsiblings(node, "virtual-devices");
66 if (!node) {
67 prom_printf("SUN4V: Fatal error, no virtual-devices node.\n");
68 prom_halt();
69 }
70
71 sun4v_vdev_root = node;
72
73 prom_getproperty(node, "reg", (char *)&regs, sizeof(regs));
74 sun4v_vdev_devhandle = (regs.phys_addr >> 32UL) & 0x0fffffff;
75
76 sz = prom_getproplen(node, "interrupt-map");
77 if (sz <= 0) {
78 prom_printf("SUN4V: Error, no vdev interrupt-map.\n");
79 prom_halt();
80 }
81
82 if ((sz % sizeof(*ip)) != 0) {
83 prom_printf("SUN4V: Bogus interrupt-map property size %d\n",
84 sz);
85 prom_halt();
86 }
87
88 vdev_intmap = ip = alloc_bootmem_low_pages(sz);
89 if (!vdev_intmap) {
90 prom_printf("SUN4V: Error, cannot allocate vdev_intmap.\n");
91 prom_halt();
92 }
93
94 err = prom_getproperty(node, "interrupt-map", (char *) ip, sz);
95 if (err == -1) {
96 prom_printf("SUN4V: Fatal error, no vdev interrupt-map.\n");
97 prom_halt();
98 }
99 if (err != sz) {
100 prom_printf("SUN4V: Inconsistent interrupt-map size, "
101 "proplen(%d) vs getprop(%d).\n", sz,err);
102 prom_halt();
103 }
104
105 vdev_num_intmap = err / sizeof(*ip);
106
107 err = prom_getproperty(node, "interrupt-map-mask",
108 (char *) &vdev_intmask,
109 sizeof(vdev_intmask));
110 if (err <= 0) {
111 prom_printf("SUN4V: Fatal error, no vdev "
112 "interrupt-map-mask.\n");
113 prom_halt();
114 }
115 if (err % sizeof(vdev_intmask)) {
116 prom_printf("SUN4V: Bogus interrupt-map-mask "
117 "property size %d\n", err);
118 prom_halt();
119 }
120
121 printk("SUN4V: virtual-devices devhandle[%x]\n",
122 sun4v_vdev_devhandle);
123}
124
125unsigned int sun4v_vdev_device_interrupt(unsigned int dev_node)
126{
127 unsigned int irq, reg;
128 int err, i;
129
130 err = prom_getproperty(dev_node, "interrupts",
131 (char *) &irq, sizeof(irq));
132 if (err <= 0) {
133 printk("VDEV: Cannot get \"interrupts\" "
134 "property for OBP node %x\n", dev_node);
135 return 0;
136 }
137
138 err = prom_getproperty(dev_node, "reg",
139 (char *) &reg, sizeof(reg));
140 if (err <= 0) {
141 printk("VDEV: Cannot get \"reg\" "
142 "property for OBP node %x\n", dev_node);
143 return 0;
144 }
145
146 for (i = 0; i < vdev_num_intmap; i++) {
147 if (vdev_intmap[i].phys == (reg & vdev_intmask.phys) &&
148 vdev_intmap[i].irq == (irq & vdev_intmask.interrupt)) {
149 irq = vdev_intmap[i].cinterrupt;
150 break;
151 }
152 }
153
154 if (i == vdev_num_intmap) {
155 printk("VDEV: No matching interrupt map entry "
156 "for OBP node %x\n", dev_node);
157 return 0;
158 }
159
160 return sun4v_build_irq(sun4v_vdev_devhandle, irq, 5, 0);
161}
162
163static const char *cpu_mid_prop(void)
33{ 164{
34 if (tlb_type == spitfire) 165 if (tlb_type == spitfire)
35 return "upa-portid"; 166 return "upa-portid";
36 return "portid"; 167 return "portid";
37} 168}
38 169
170static int get_cpu_mid(int prom_node)
171{
172 if (tlb_type == hypervisor) {
173 struct linux_prom64_registers reg;
174
175 if (prom_getproplen(prom_node, "cpuid") == 4)
176 return prom_getintdefault(prom_node, "cpuid", 0);
177
178 prom_getproperty(prom_node, "reg", (char *) &reg, sizeof(reg));
179 return (reg.phys_addr >> 32) & 0x0fffffffUL;
180 } else {
181 const char *prop_name = cpu_mid_prop();
182
183 return prom_getintdefault(prom_node, prop_name, 0);
184 }
185}
186
39static int check_cpu_node(int nd, int *cur_inst, 187static int check_cpu_node(int nd, int *cur_inst,
40 int (*compare)(int, int, void *), void *compare_arg, 188 int (*compare)(int, int, void *), void *compare_arg,
41 int *prom_node, int *mid) 189 int *prom_node, int *mid)
@@ -50,7 +198,7 @@ static int check_cpu_node(int nd, int *cur_inst,
50 if (prom_node) 198 if (prom_node)
51 *prom_node = nd; 199 *prom_node = nd;
52 if (mid) 200 if (mid)
53 *mid = prom_getintdefault(nd, cpu_mid_prop(), 0); 201 *mid = get_cpu_mid(nd);
54 return 0; 202 return 0;
55 } 203 }
56 204
@@ -105,7 +253,7 @@ static int cpu_mid_compare(int nd, int instance, void *_arg)
105 int desired_mid = (int) (long) _arg; 253 int desired_mid = (int) (long) _arg;
106 int this_mid; 254 int this_mid;
107 255
108 this_mid = prom_getintdefault(nd, cpu_mid_prop(), 0); 256 this_mid = get_cpu_mid(nd);
109 if (this_mid == desired_mid) 257 if (this_mid == desired_mid)
110 return 0; 258 return 0;
111 return -ENODEV; 259 return -ENODEV;
@@ -126,7 +274,8 @@ void __init device_scan(void)
126 274
127#ifndef CONFIG_SMP 275#ifndef CONFIG_SMP
128 { 276 {
129 int err, cpu_node; 277 int err, cpu_node, def;
278
130 err = cpu_find_by_instance(0, &cpu_node, NULL); 279 err = cpu_find_by_instance(0, &cpu_node, NULL);
131 if (err) { 280 if (err) {
132 prom_printf("No cpu nodes, cannot continue\n"); 281 prom_printf("No cpu nodes, cannot continue\n");
@@ -135,21 +284,40 @@ void __init device_scan(void)
135 cpu_data(0).clock_tick = prom_getintdefault(cpu_node, 284 cpu_data(0).clock_tick = prom_getintdefault(cpu_node,
136 "clock-frequency", 285 "clock-frequency",
137 0); 286 0);
287
288 def = ((tlb_type == hypervisor) ?
289 (8 * 1024) :
290 (16 * 1024));
138 cpu_data(0).dcache_size = prom_getintdefault(cpu_node, 291 cpu_data(0).dcache_size = prom_getintdefault(cpu_node,
139 "dcache-size", 292 "dcache-size",
140 16 * 1024); 293 def);
294
295 def = 32;
141 cpu_data(0).dcache_line_size = 296 cpu_data(0).dcache_line_size =
142 prom_getintdefault(cpu_node, "dcache-line-size", 32); 297 prom_getintdefault(cpu_node, "dcache-line-size",
298 def);
299
300 def = 16 * 1024;
143 cpu_data(0).icache_size = prom_getintdefault(cpu_node, 301 cpu_data(0).icache_size = prom_getintdefault(cpu_node,
144 "icache-size", 302 "icache-size",
145 16 * 1024); 303 def);
304
305 def = 32;
146 cpu_data(0).icache_line_size = 306 cpu_data(0).icache_line_size =
147 prom_getintdefault(cpu_node, "icache-line-size", 32); 307 prom_getintdefault(cpu_node, "icache-line-size",
308 def);
309
310 def = ((tlb_type == hypervisor) ?
311 (3 * 1024 * 1024) :
312 (4 * 1024 * 1024));
148 cpu_data(0).ecache_size = prom_getintdefault(cpu_node, 313 cpu_data(0).ecache_size = prom_getintdefault(cpu_node,
149 "ecache-size", 314 "ecache-size",
150 4 * 1024 * 1024); 315 def);
316
317 def = 64;
151 cpu_data(0).ecache_line_size = 318 cpu_data(0).ecache_line_size =
152 prom_getintdefault(cpu_node, "ecache-line-size", 64); 319 prom_getintdefault(cpu_node, "ecache-line-size",
320 def);
153 printk("CPU[0]: Caches " 321 printk("CPU[0]: Caches "
154 "D[sz(%d):line_sz(%d)] " 322 "D[sz(%d):line_sz(%d)] "
155 "I[sz(%d):line_sz(%d)] " 323 "I[sz(%d):line_sz(%d)] "
@@ -160,6 +328,7 @@ void __init device_scan(void)
160 } 328 }
161#endif 329#endif
162 330
331 sun4v_virtual_device_probe();
163 central_probe(); 332 central_probe();
164 333
165 cpu_probe(); 334 cpu_probe();
diff --git a/arch/sparc64/kernel/dtlb_backend.S b/arch/sparc64/kernel/dtlb_backend.S
deleted file mode 100644
index acc889a7f9c1..000000000000
--- a/arch/sparc64/kernel/dtlb_backend.S
+++ /dev/null
@@ -1,170 +0,0 @@
1/* $Id: dtlb_backend.S,v 1.16 2001/10/09 04:02:11 davem Exp $
2 * dtlb_backend.S: Back end to DTLB miss replacement strategy.
3 * This is included directly into the trap table.
4 *
5 * Copyright (C) 1996,1998 David S. Miller (davem@redhat.com)
6 * Copyright (C) 1997,1998 Jakub Jelinek (jj@ultra.linux.cz)
7 */
8
9#include <asm/pgtable.h>
10#include <asm/mmu.h>
11
12#define VALID_SZ_BITS (_PAGE_VALID | _PAGE_SZBITS)
13
14#define VPTE_BITS (_PAGE_CP | _PAGE_CV | _PAGE_P )
15#define VPTE_SHIFT (PAGE_SHIFT - 3)
16
17/* Ways we can get here:
18 *
19 * 1) Nucleus loads and stores to/from PA-->VA direct mappings at tl>1.
20 * 2) Nucleus loads and stores to/from user/kernel window save areas.
21 * 3) VPTE misses from dtlb_base and itlb_base.
22 *
23 * We need to extract out the PMD and PGDIR indexes from the
24 * linear virtual page table access address. The PTE index
25 * is at the bottom, but we are not concerned with it. Bits
26 * 0 to 2 are clear since each PTE is 8 bytes in size. Each
27 * PMD and PGDIR entry are 4 bytes in size. Thus, this
28 * address looks something like:
29 *
30 * |---------------------------------------------------------------|
31 * | ... | PGDIR index | PMD index | PTE index | |
32 * |---------------------------------------------------------------|
33 * 63 F E D C B A 3 2 0 <- bit nr
34 *
35 * The variable bits above are defined as:
36 * A --> 3 + (PAGE_SHIFT - log2(8))
37 * --> 3 + (PAGE_SHIFT - 3) - 1
38 * (ie. this is "bit 3" + PAGE_SIZE - size of PTE entry in bits - 1)
39 * B --> A + 1
40 * C --> B + (PAGE_SHIFT - log2(4))
41 * --> B + (PAGE_SHIFT - 2) - 1
42 * (ie. this is "bit B" + PAGE_SIZE - size of PMD entry in bits - 1)
43 * D --> C + 1
44 * E --> D + (PAGE_SHIFT - log2(4))
45 * --> D + (PAGE_SHIFT - 2) - 1
46 * (ie. this is "bit D" + PAGE_SIZE - size of PGDIR entry in bits - 1)
47 * F --> E + 1
48 *
49 * (Note how "B" always evalutes to PAGE_SHIFT, all the other constants
50 * cancel out.)
51 *
52 * For 8K PAGE_SIZE (thus, PAGE_SHIFT of 13) the bit numbers are:
53 * A --> 12
54 * B --> 13
55 * C --> 23
56 * D --> 24
57 * E --> 34
58 * F --> 35
59 *
60 * For 64K PAGE_SIZE (thus, PAGE_SHIFT of 16) the bit numbers are:
61 * A --> 15
62 * B --> 16
63 * C --> 29
64 * D --> 30
65 * E --> 43
66 * F --> 44
67 *
68 * Because bits both above and below each PGDIR and PMD index need to
69 * be masked out, and the index can be as long as 14 bits (when using a
70 * 64K PAGE_SIZE, and thus a PAGE_SHIFT of 16), we need 3 instructions
71 * to extract each index out.
72 *
73 * Shifts do not pair very well on UltraSPARC-I, II, IIi, and IIe, so
74 * we try to avoid using them for the entire operation. We could setup
75 * a mask anywhere from bit 31 down to bit 10 using the sethi instruction.
76 *
77 * We need a mask covering bits B --> C and one covering D --> E.
78 * For 8K PAGE_SIZE these masks are 0x00ffe000 and 0x7ff000000.
79 * For 64K PAGE_SIZE these masks are 0x3fff0000 and 0xfffc0000000.
80 * The second in each set cannot be loaded with a single sethi
81 * instruction, because the upper bits are past bit 32. We would
82 * need to use a sethi + a shift.
83 *
84 * For the time being, we use 2 shifts and a simple "and" mask.
85 * We shift left to clear the bits above the index, we shift down
86 * to clear the bits below the index (sans the log2(4 or 8) bits)
87 * and a mask to clear the log2(4 or 8) bits. We need therefore
88 * define 4 shift counts, all of which are relative to PAGE_SHIFT.
89 *
90 * Although unsupportable for other reasons, this does mean that
91 * 512K and 4MB page sizes would be generaally supported by the
92 * kernel. (ELF binaries would break with > 64K PAGE_SIZE since
93 * the sections are only aligned that strongly).
94 *
95 * The operations performed for extraction are thus:
96 *
97 * ((X << FOO_SHIFT_LEFT) >> FOO_SHIFT_RIGHT) & ~0x3
98 *
99 */
100
101#define A (3 + (PAGE_SHIFT - 3) - 1)
102#define B (A + 1)
103#define C (B + (PAGE_SHIFT - 2) - 1)
104#define D (C + 1)
105#define E (D + (PAGE_SHIFT - 2) - 1)
106#define F (E + 1)
107
108#define PMD_SHIFT_LEFT (64 - D)
109#define PMD_SHIFT_RIGHT (64 - (D - B) - 2)
110#define PGDIR_SHIFT_LEFT (64 - F)
111#define PGDIR_SHIFT_RIGHT (64 - (F - D) - 2)
112#define LOW_MASK_BITS 0x3
113
114/* TLB1 ** ICACHE line 1: tl1 DTLB and quick VPTE miss */
115 ldxa [%g1 + %g1] ASI_DMMU, %g4 ! Get TAG_ACCESS
116 add %g3, %g3, %g5 ! Compute VPTE base
117 cmp %g4, %g5 ! VPTE miss?
118 bgeu,pt %xcc, 1f ! Continue here
119 andcc %g4, TAG_CONTEXT_BITS, %g5 ! tl0 miss Nucleus test
120 ba,a,pt %xcc, from_tl1_trap ! Fall to tl0 miss
1211: sllx %g6, VPTE_SHIFT, %g4 ! Position TAG_ACCESS
122 or %g4, %g5, %g4 ! Prepare TAG_ACCESS
123
124/* TLB1 ** ICACHE line 2: Quick VPTE miss */
125 mov TSB_REG, %g1 ! Grab TSB reg
126 ldxa [%g1] ASI_DMMU, %g5 ! Doing PGD caching?
127 sllx %g6, PMD_SHIFT_LEFT, %g1 ! Position PMD offset
128 be,pn %xcc, sparc64_vpte_nucleus ! Is it from Nucleus?
129 srlx %g1, PMD_SHIFT_RIGHT, %g1 ! Mask PMD offset bits
130 brnz,pt %g5, sparc64_vpte_continue ! Yep, go like smoke
131 andn %g1, LOW_MASK_BITS, %g1 ! Final PMD mask
132 sllx %g6, PGDIR_SHIFT_LEFT, %g5 ! Position PGD offset
133
134/* TLB1 ** ICACHE line 3: Quick VPTE miss */
135 srlx %g5, PGDIR_SHIFT_RIGHT, %g5 ! Mask PGD offset bits
136 andn %g5, LOW_MASK_BITS, %g5 ! Final PGD mask
137 lduwa [%g7 + %g5] ASI_PHYS_USE_EC, %g5! Load PGD
138 brz,pn %g5, vpte_noent ! Valid?
139sparc64_kpte_continue:
140 sllx %g5, 11, %g5 ! Shift into place
141sparc64_vpte_continue:
142 lduwa [%g5 + %g1] ASI_PHYS_USE_EC, %g5! Load PMD
143 sllx %g5, 11, %g5 ! Shift into place
144 brz,pn %g5, vpte_noent ! Valid?
145
146/* TLB1 ** ICACHE line 4: Quick VPTE miss */
147 mov (VALID_SZ_BITS >> 61), %g1 ! upper vpte into %g1
148 sllx %g1, 61, %g1 ! finish calc
149 or %g5, VPTE_BITS, %g5 ! Prepare VPTE data
150 or %g5, %g1, %g5 ! ...
151 mov TLB_SFSR, %g1 ! Restore %g1 value
152 stxa %g5, [%g0] ASI_DTLB_DATA_IN ! Load VPTE into TLB
153 stxa %g4, [%g1 + %g1] ASI_DMMU ! Restore previous TAG_ACCESS
154 retry ! Load PTE once again
155
156#undef VALID_SZ_BITS
157#undef VPTE_SHIFT
158#undef VPTE_BITS
159#undef A
160#undef B
161#undef C
162#undef D
163#undef E
164#undef F
165#undef PMD_SHIFT_LEFT
166#undef PMD_SHIFT_RIGHT
167#undef PGDIR_SHIFT_LEFT
168#undef PGDIR_SHIFT_RIGHT
169#undef LOW_MASK_BITS
170
diff --git a/arch/sparc64/kernel/dtlb_base.S b/arch/sparc64/kernel/dtlb_base.S
deleted file mode 100644
index 6528786840c0..000000000000
--- a/arch/sparc64/kernel/dtlb_base.S
+++ /dev/null
@@ -1,109 +0,0 @@
1/* $Id: dtlb_base.S,v 1.17 2001/10/11 22:33:52 davem Exp $
2 * dtlb_base.S: Front end to DTLB miss replacement strategy.
3 * This is included directly into the trap table.
4 *
5 * Copyright (C) 1996,1998 David S. Miller (davem@redhat.com)
6 * Copyright (C) 1997,1998 Jakub Jelinek (jj@ultra.linux.cz)
7 */
8
9#include <asm/pgtable.h>
10#include <asm/mmu.h>
11
12/* %g1 TLB_SFSR (%g1 + %g1 == TLB_TAG_ACCESS)
13 * %g2 (KERN_HIGHBITS | KERN_LOWBITS)
14 * %g3 VPTE base (0xfffffffe00000000) Spitfire/Blackbird (44-bit VA space)
15 * (0xffe0000000000000) Cheetah (64-bit VA space)
16 * %g7 __pa(current->mm->pgd)
17 *
18 * The VPTE base value is completely magic, but note that
19 * few places in the kernel other than these TLB miss
20 * handlers know anything about the VPTE mechanism or
21 * how it works (see VPTE_SIZE, TASK_SIZE and PTRS_PER_PGD).
22 * Consider the 44-bit VADDR Ultra-I/II case as an example:
23 *
24 * VA[0 : (1<<43)] produce VPTE index [%g3 : 0]
25 * VA[0 : -(1<<43)] produce VPTE index [%g3-(1<<(43-PAGE_SHIFT+3)) : %g3]
26 *
27 * For Cheetah's 64-bit VADDR space this is:
28 *
29 * VA[0 : (1<<63)] produce VPTE index [%g3 : 0]
30 * VA[0 : -(1<<63)] produce VPTE index [%g3-(1<<(63-PAGE_SHIFT+3)) : %g3]
31 *
32 * If you're paying attention you'll notice that this means half of
33 * the VPTE table is above %g3 and half is below, low VA addresses
34 * map progressively upwards from %g3, and high VA addresses map
35 * progressively upwards towards %g3. This trick was needed to make
36 * the same 8 instruction handler work both for Spitfire/Blackbird's
37 * peculiar VA space hole configuration and the full 64-bit VA space
38 * one of Cheetah at the same time.
39 */
40
41/* Ways we can get here:
42 *
43 * 1) Nucleus loads and stores to/from PA-->VA direct mappings.
44 * 2) Nucleus loads and stores to/from vmalloc() areas.
45 * 3) User loads and stores.
46 * 4) User space accesses by nucleus at tl0
47 */
48
49#if PAGE_SHIFT == 13
50/*
51 * To compute vpte offset, we need to do ((addr >> 13) << 3),
52 * which can be optimized to (addr >> 10) if bits 10/11/12 can
53 * be guaranteed to be 0 ... mmu_context.h does guarantee this
54 * by only using 10 bits in the hwcontext value.
55 */
56#define CREATE_VPTE_OFFSET1(r1, r2) nop
57#define CREATE_VPTE_OFFSET2(r1, r2) \
58 srax r1, 10, r2
59#else
60#define CREATE_VPTE_OFFSET1(r1, r2) \
61 srax r1, PAGE_SHIFT, r2
62#define CREATE_VPTE_OFFSET2(r1, r2) \
63 sllx r2, 3, r2
64#endif
65
66/* DTLB ** ICACHE line 1: Quick user TLB misses */
67 mov TLB_SFSR, %g1
68 ldxa [%g1 + %g1] ASI_DMMU, %g4 ! Get TAG_ACCESS
69 andcc %g4, TAG_CONTEXT_BITS, %g0 ! From Nucleus?
70from_tl1_trap:
71 rdpr %tl, %g5 ! For TL==3 test
72 CREATE_VPTE_OFFSET1(%g4, %g6) ! Create VPTE offset
73 be,pn %xcc, kvmap ! Yep, special processing
74 CREATE_VPTE_OFFSET2(%g4, %g6) ! Create VPTE offset
75 cmp %g5, 4 ! Last trap level?
76
77/* DTLB ** ICACHE line 2: User finish + quick kernel TLB misses */
78 be,pn %xcc, longpath ! Yep, cannot risk VPTE miss
79 nop ! delay slot
80 ldxa [%g3 + %g6] ASI_S, %g5 ! Load VPTE
811: brgez,pn %g5, longpath ! Invalid, branch out
82 nop ! Delay-slot
839: stxa %g5, [%g0] ASI_DTLB_DATA_IN ! Reload TLB
84 retry ! Trap return
85 nop
86
87/* DTLB ** ICACHE line 3: winfixups+real_faults */
88longpath:
89 rdpr %pstate, %g5 ! Move into alternate globals
90 wrpr %g5, PSTATE_AG|PSTATE_MG, %pstate
91 rdpr %tl, %g4 ! See where we came from.
92 cmp %g4, 1 ! Is etrap/rtrap window fault?
93 mov TLB_TAG_ACCESS, %g4 ! Prepare for fault processing
94 ldxa [%g4] ASI_DMMU, %g5 ! Load faulting VA page
95 be,pt %xcc, sparc64_realfault_common ! Jump to normal fault handling
96 mov FAULT_CODE_DTLB, %g4 ! It was read from DTLB
97
98/* DTLB ** ICACHE line 4: Unused... */
99 ba,a,pt %xcc, winfix_trampoline ! Call window fixup code
100 nop
101 nop
102 nop
103 nop
104 nop
105 nop
106 nop
107
108#undef CREATE_VPTE_OFFSET1
109#undef CREATE_VPTE_OFFSET2
diff --git a/arch/sparc64/kernel/dtlb_miss.S b/arch/sparc64/kernel/dtlb_miss.S
new file mode 100644
index 000000000000..09a6a15a7105
--- /dev/null
+++ b/arch/sparc64/kernel/dtlb_miss.S
@@ -0,0 +1,39 @@
1/* DTLB ** ICACHE line 1: Context 0 check and TSB load */
2 ldxa [%g0] ASI_DMMU_TSB_8KB_PTR, %g1 ! Get TSB 8K pointer
3 ldxa [%g0] ASI_DMMU, %g6 ! Get TAG TARGET
4 srlx %g6, 48, %g5 ! Get context
5 sllx %g6, 22, %g6 ! Zero out context
6 brz,pn %g5, kvmap_dtlb ! Context 0 processing
7 srlx %g6, 22, %g6 ! Delay slot
8 TSB_LOAD_QUAD(%g1, %g4) ! Load TSB entry
9 cmp %g4, %g6 ! Compare TAG
10
11/* DTLB ** ICACHE line 2: TSB compare and TLB load */
12 bne,pn %xcc, tsb_miss_dtlb ! Miss
13 mov FAULT_CODE_DTLB, %g3
14 stxa %g5, [%g0] ASI_DTLB_DATA_IN ! Load TLB
15 retry ! Trap done
16 nop
17 nop
18 nop
19 nop
20
21/* DTLB ** ICACHE line 3: */
22 nop
23 nop
24 nop
25 nop
26 nop
27 nop
28 nop
29 nop
30
31/* DTLB ** ICACHE line 4: */
32 nop
33 nop
34 nop
35 nop
36 nop
37 nop
38 nop
39 nop
diff --git a/arch/sparc64/kernel/ebus.c b/arch/sparc64/kernel/ebus.c
index 7991e919d8ab..c69504aa638f 100644
--- a/arch/sparc64/kernel/ebus.c
+++ b/arch/sparc64/kernel/ebus.c
@@ -277,10 +277,9 @@ static inline void *ebus_alloc(size_t size)
277{ 277{
278 void *mem; 278 void *mem;
279 279
280 mem = kmalloc(size, GFP_ATOMIC); 280 mem = kzalloc(size, GFP_ATOMIC);
281 if (!mem) 281 if (!mem)
282 panic("ebus_alloc: out of memory"); 282 panic("ebus_alloc: out of memory");
283 memset((char *)mem, 0, size);
284 return mem; 283 return mem;
285} 284}
286 285
diff --git a/arch/sparc64/kernel/entry.S b/arch/sparc64/kernel/entry.S
index a73553ae7e53..6d0b3ed77a02 100644
--- a/arch/sparc64/kernel/entry.S
+++ b/arch/sparc64/kernel/entry.S
@@ -50,7 +50,8 @@ do_fpdis:
50 add %g0, %g0, %g0 50 add %g0, %g0, %g0
51 ba,a,pt %xcc, rtrap_clr_l6 51 ba,a,pt %xcc, rtrap_clr_l6
52 52
531: ldub [%g6 + TI_FPSAVED], %g5 531: TRAP_LOAD_THREAD_REG(%g6, %g1)
54 ldub [%g6 + TI_FPSAVED], %g5
54 wr %g0, FPRS_FEF, %fprs 55 wr %g0, FPRS_FEF, %fprs
55 andcc %g5, FPRS_FEF, %g0 56 andcc %g5, FPRS_FEF, %g0
56 be,a,pt %icc, 1f 57 be,a,pt %icc, 1f
@@ -96,10 +97,22 @@ do_fpdis:
96 add %g6, TI_FPREGS + 0x80, %g1 97 add %g6, TI_FPREGS + 0x80, %g1
97 faddd %f0, %f2, %f4 98 faddd %f0, %f2, %f4
98 fmuld %f0, %f2, %f6 99 fmuld %f0, %f2, %f6
99 ldxa [%g3] ASI_DMMU, %g5 100
101661: ldxa [%g3] ASI_DMMU, %g5
102 .section .sun4v_1insn_patch, "ax"
103 .word 661b
104 ldxa [%g3] ASI_MMU, %g5
105 .previous
106
100 sethi %hi(sparc64_kern_sec_context), %g2 107 sethi %hi(sparc64_kern_sec_context), %g2
101 ldx [%g2 + %lo(sparc64_kern_sec_context)], %g2 108 ldx [%g2 + %lo(sparc64_kern_sec_context)], %g2
102 stxa %g2, [%g3] ASI_DMMU 109
110661: stxa %g2, [%g3] ASI_DMMU
111 .section .sun4v_1insn_patch, "ax"
112 .word 661b
113 stxa %g2, [%g3] ASI_MMU
114 .previous
115
103 membar #Sync 116 membar #Sync
104 add %g6, TI_FPREGS + 0xc0, %g2 117 add %g6, TI_FPREGS + 0xc0, %g2
105 faddd %f0, %f2, %f8 118 faddd %f0, %f2, %f8
@@ -125,11 +138,23 @@ do_fpdis:
125 fzero %f32 138 fzero %f32
126 mov SECONDARY_CONTEXT, %g3 139 mov SECONDARY_CONTEXT, %g3
127 fzero %f34 140 fzero %f34
128 ldxa [%g3] ASI_DMMU, %g5 141
142661: ldxa [%g3] ASI_DMMU, %g5
143 .section .sun4v_1insn_patch, "ax"
144 .word 661b
145 ldxa [%g3] ASI_MMU, %g5
146 .previous
147
129 add %g6, TI_FPREGS, %g1 148 add %g6, TI_FPREGS, %g1
130 sethi %hi(sparc64_kern_sec_context), %g2 149 sethi %hi(sparc64_kern_sec_context), %g2
131 ldx [%g2 + %lo(sparc64_kern_sec_context)], %g2 150 ldx [%g2 + %lo(sparc64_kern_sec_context)], %g2
132 stxa %g2, [%g3] ASI_DMMU 151
152661: stxa %g2, [%g3] ASI_DMMU
153 .section .sun4v_1insn_patch, "ax"
154 .word 661b
155 stxa %g2, [%g3] ASI_MMU
156 .previous
157
133 membar #Sync 158 membar #Sync
134 add %g6, TI_FPREGS + 0x40, %g2 159 add %g6, TI_FPREGS + 0x40, %g2
135 faddd %f32, %f34, %f36 160 faddd %f32, %f34, %f36
@@ -154,10 +179,22 @@ do_fpdis:
154 nop 179 nop
1553: mov SECONDARY_CONTEXT, %g3 1803: mov SECONDARY_CONTEXT, %g3
156 add %g6, TI_FPREGS, %g1 181 add %g6, TI_FPREGS, %g1
157 ldxa [%g3] ASI_DMMU, %g5 182
183661: ldxa [%g3] ASI_DMMU, %g5
184 .section .sun4v_1insn_patch, "ax"
185 .word 661b
186 ldxa [%g3] ASI_MMU, %g5
187 .previous
188
158 sethi %hi(sparc64_kern_sec_context), %g2 189 sethi %hi(sparc64_kern_sec_context), %g2
159 ldx [%g2 + %lo(sparc64_kern_sec_context)], %g2 190 ldx [%g2 + %lo(sparc64_kern_sec_context)], %g2
160 stxa %g2, [%g3] ASI_DMMU 191
192661: stxa %g2, [%g3] ASI_DMMU
193 .section .sun4v_1insn_patch, "ax"
194 .word 661b
195 stxa %g2, [%g3] ASI_MMU
196 .previous
197
161 membar #Sync 198 membar #Sync
162 mov 0x40, %g2 199 mov 0x40, %g2
163 membar #Sync 200 membar #Sync
@@ -168,7 +205,13 @@ do_fpdis:
168 ldda [%g1 + %g2] ASI_BLK_S, %f48 205 ldda [%g1 + %g2] ASI_BLK_S, %f48
169 membar #Sync 206 membar #Sync
170fpdis_exit: 207fpdis_exit:
171 stxa %g5, [%g3] ASI_DMMU 208
209661: stxa %g5, [%g3] ASI_DMMU
210 .section .sun4v_1insn_patch, "ax"
211 .word 661b
212 stxa %g5, [%g3] ASI_MMU
213 .previous
214
172 membar #Sync 215 membar #Sync
173fpdis_exit2: 216fpdis_exit2:
174 wr %g7, 0, %gsr 217 wr %g7, 0, %gsr
@@ -189,6 +232,7 @@ fp_other_bounce:
189 .globl do_fpother_check_fitos 232 .globl do_fpother_check_fitos
190 .align 32 233 .align 32
191do_fpother_check_fitos: 234do_fpother_check_fitos:
235 TRAP_LOAD_THREAD_REG(%g6, %g1)
192 sethi %hi(fp_other_bounce - 4), %g7 236 sethi %hi(fp_other_bounce - 4), %g7
193 or %g7, %lo(fp_other_bounce - 4), %g7 237 or %g7, %lo(fp_other_bounce - 4), %g7
194 238
@@ -312,6 +356,7 @@ fitos_emul_fini:
312 .globl do_fptrap 356 .globl do_fptrap
313 .align 32 357 .align 32
314do_fptrap: 358do_fptrap:
359 TRAP_LOAD_THREAD_REG(%g6, %g1)
315 stx %fsr, [%g6 + TI_XFSR] 360 stx %fsr, [%g6 + TI_XFSR]
316do_fptrap_after_fsr: 361do_fptrap_after_fsr:
317 ldub [%g6 + TI_FPSAVED], %g3 362 ldub [%g6 + TI_FPSAVED], %g3
@@ -321,10 +366,22 @@ do_fptrap_after_fsr:
321 rd %gsr, %g3 366 rd %gsr, %g3
322 stx %g3, [%g6 + TI_GSR] 367 stx %g3, [%g6 + TI_GSR]
323 mov SECONDARY_CONTEXT, %g3 368 mov SECONDARY_CONTEXT, %g3
324 ldxa [%g3] ASI_DMMU, %g5 369
370661: ldxa [%g3] ASI_DMMU, %g5
371 .section .sun4v_1insn_patch, "ax"
372 .word 661b
373 ldxa [%g3] ASI_MMU, %g5
374 .previous
375
325 sethi %hi(sparc64_kern_sec_context), %g2 376 sethi %hi(sparc64_kern_sec_context), %g2
326 ldx [%g2 + %lo(sparc64_kern_sec_context)], %g2 377 ldx [%g2 + %lo(sparc64_kern_sec_context)], %g2
327 stxa %g2, [%g3] ASI_DMMU 378
379661: stxa %g2, [%g3] ASI_DMMU
380 .section .sun4v_1insn_patch, "ax"
381 .word 661b
382 stxa %g2, [%g3] ASI_MMU
383 .previous
384
328 membar #Sync 385 membar #Sync
329 add %g6, TI_FPREGS, %g2 386 add %g6, TI_FPREGS, %g2
330 andcc %g1, FPRS_DL, %g0 387 andcc %g1, FPRS_DL, %g0
@@ -339,7 +396,13 @@ do_fptrap_after_fsr:
339 stda %f48, [%g2 + %g3] ASI_BLK_S 396 stda %f48, [%g2 + %g3] ASI_BLK_S
3405: mov SECONDARY_CONTEXT, %g1 3975: mov SECONDARY_CONTEXT, %g1
341 membar #Sync 398 membar #Sync
342 stxa %g5, [%g1] ASI_DMMU 399
400661: stxa %g5, [%g1] ASI_DMMU
401 .section .sun4v_1insn_patch, "ax"
402 .word 661b
403 stxa %g5, [%g1] ASI_MMU
404 .previous
405
343 membar #Sync 406 membar #Sync
344 ba,pt %xcc, etrap 407 ba,pt %xcc, etrap
345 wr %g0, 0, %fprs 408 wr %g0, 0, %fprs
@@ -353,8 +416,6 @@ do_fptrap_after_fsr:
353 * 416 *
354 * With this method we can do most of the cross-call tlb/cache 417 * With this method we can do most of the cross-call tlb/cache
355 * flushing very quickly. 418 * flushing very quickly.
356 *
357 * Current CPU's IRQ worklist table is locked into %g6, don't touch.
358 */ 419 */
359 .text 420 .text
360 .align 32 421 .align 32
@@ -378,6 +439,8 @@ do_ivec:
378 sllx %g2, %g4, %g2 439 sllx %g2, %g4, %g2
379 sllx %g4, 2, %g4 440 sllx %g4, 2, %g4
380 441
442 TRAP_LOAD_IRQ_WORK(%g6, %g1)
443
381 lduw [%g6 + %g4], %g5 /* g5 = irq_work(cpu, pil) */ 444 lduw [%g6 + %g4], %g5 /* g5 = irq_work(cpu, pil) */
382 stw %g5, [%g3 + 0x00] /* bucket->irq_chain = g5 */ 445 stw %g5, [%g3 + 0x00] /* bucket->irq_chain = g5 */
383 stw %g3, [%g6 + %g4] /* irq_work(cpu, pil) = bucket */ 446 stw %g3, [%g6 + %g4] /* irq_work(cpu, pil) = bucket */
@@ -399,76 +462,6 @@ do_ivec_xcall:
3991: jmpl %g3, %g0 4621: jmpl %g3, %g0
400 nop 463 nop
401 464
402 .globl save_alternate_globals
403save_alternate_globals: /* %o0 = save_area */
404 rdpr %pstate, %o5
405 andn %o5, PSTATE_IE, %o1
406 wrpr %o1, PSTATE_AG, %pstate
407 stx %g0, [%o0 + 0x00]
408 stx %g1, [%o0 + 0x08]
409 stx %g2, [%o0 + 0x10]
410 stx %g3, [%o0 + 0x18]
411 stx %g4, [%o0 + 0x20]
412 stx %g5, [%o0 + 0x28]
413 stx %g6, [%o0 + 0x30]
414 stx %g7, [%o0 + 0x38]
415 wrpr %o1, PSTATE_IG, %pstate
416 stx %g0, [%o0 + 0x40]
417 stx %g1, [%o0 + 0x48]
418 stx %g2, [%o0 + 0x50]
419 stx %g3, [%o0 + 0x58]
420 stx %g4, [%o0 + 0x60]
421 stx %g5, [%o0 + 0x68]
422 stx %g6, [%o0 + 0x70]
423 stx %g7, [%o0 + 0x78]
424 wrpr %o1, PSTATE_MG, %pstate
425 stx %g0, [%o0 + 0x80]
426 stx %g1, [%o0 + 0x88]
427 stx %g2, [%o0 + 0x90]
428 stx %g3, [%o0 + 0x98]
429 stx %g4, [%o0 + 0xa0]
430 stx %g5, [%o0 + 0xa8]
431 stx %g6, [%o0 + 0xb0]
432 stx %g7, [%o0 + 0xb8]
433 wrpr %o5, 0x0, %pstate
434 retl
435 nop
436
437 .globl restore_alternate_globals
438restore_alternate_globals: /* %o0 = save_area */
439 rdpr %pstate, %o5
440 andn %o5, PSTATE_IE, %o1
441 wrpr %o1, PSTATE_AG, %pstate
442 ldx [%o0 + 0x00], %g0
443 ldx [%o0 + 0x08], %g1
444 ldx [%o0 + 0x10], %g2
445 ldx [%o0 + 0x18], %g3
446 ldx [%o0 + 0x20], %g4
447 ldx [%o0 + 0x28], %g5
448 ldx [%o0 + 0x30], %g6
449 ldx [%o0 + 0x38], %g7
450 wrpr %o1, PSTATE_IG, %pstate
451 ldx [%o0 + 0x40], %g0
452 ldx [%o0 + 0x48], %g1
453 ldx [%o0 + 0x50], %g2
454 ldx [%o0 + 0x58], %g3
455 ldx [%o0 + 0x60], %g4
456 ldx [%o0 + 0x68], %g5
457 ldx [%o0 + 0x70], %g6
458 ldx [%o0 + 0x78], %g7
459 wrpr %o1, PSTATE_MG, %pstate
460 ldx [%o0 + 0x80], %g0
461 ldx [%o0 + 0x88], %g1
462 ldx [%o0 + 0x90], %g2
463 ldx [%o0 + 0x98], %g3
464 ldx [%o0 + 0xa0], %g4
465 ldx [%o0 + 0xa8], %g5
466 ldx [%o0 + 0xb0], %g6
467 ldx [%o0 + 0xb8], %g7
468 wrpr %o5, 0x0, %pstate
469 retl
470 nop
471
472 .globl getcc, setcc 465 .globl getcc, setcc
473getcc: 466getcc:
474 ldx [%o0 + PT_V9_TSTATE], %o1 467 ldx [%o0 + PT_V9_TSTATE], %o1
@@ -488,9 +481,24 @@ setcc:
488 retl 481 retl
489 stx %o1, [%o0 + PT_V9_TSTATE] 482 stx %o1, [%o0 + PT_V9_TSTATE]
490 483
491 .globl utrap, utrap_ill 484 .globl utrap_trap
492utrap: brz,pn %g1, etrap 485utrap_trap: /* %g3=handler,%g4=level */
486 TRAP_LOAD_THREAD_REG(%g6, %g1)
487 ldx [%g6 + TI_UTRAPS], %g1
488 brnz,pt %g1, invoke_utrap
493 nop 489 nop
490
491 ba,pt %xcc, etrap
492 rd %pc, %g7
493 mov %l4, %o1
494 call bad_trap
495 add %sp, PTREGS_OFF, %o0
496 ba,pt %xcc, rtrap
497 clr %l6
498
499invoke_utrap:
500 sllx %g3, 3, %g3
501 ldx [%g1 + %g3], %g1
494 save %sp, -128, %sp 502 save %sp, -128, %sp
495 rdpr %tstate, %l6 503 rdpr %tstate, %l6
496 rdpr %cwp, %l7 504 rdpr %cwp, %l7
@@ -500,17 +508,6 @@ utrap: brz,pn %g1, etrap
500 rdpr %tnpc, %l7 508 rdpr %tnpc, %l7
501 wrpr %g1, 0, %tnpc 509 wrpr %g1, 0, %tnpc
502 done 510 done
503utrap_ill:
504 call bad_trap
505 add %sp, PTREGS_OFF, %o0
506 ba,pt %xcc, rtrap
507 clr %l6
508
509 /* XXX Here is stuff we still need to write... -DaveM XXX */
510 .globl netbsd_syscall
511netbsd_syscall:
512 retl
513 nop
514 511
515 /* We need to carefully read the error status, ACK 512 /* We need to carefully read the error status, ACK
516 * the errors, prevent recursive traps, and pass the 513 * the errors, prevent recursive traps, and pass the
@@ -1001,7 +998,7 @@ dcpe_icpe_tl1_common:
1001 * %g3: scratch 998 * %g3: scratch
1002 * %g4: AFSR 999 * %g4: AFSR
1003 * %g5: AFAR 1000 * %g5: AFAR
1004 * %g6: current thread ptr 1001 * %g6: unused, will have current thread ptr after etrap
1005 * %g7: scratch 1002 * %g7: scratch
1006 */ 1003 */
1007__cheetah_log_error: 1004__cheetah_log_error:
@@ -1539,13 +1536,14 @@ ret_from_syscall:
1539 1536
15401: b,pt %xcc, ret_sys_call 15371: b,pt %xcc, ret_sys_call
1541 ldx [%sp + PTREGS_OFF + PT_V9_I0], %o0 1538 ldx [%sp + PTREGS_OFF + PT_V9_I0], %o0
1542sparc_exit: wrpr %g0, (PSTATE_RMO | PSTATE_PEF | PSTATE_PRIV), %pstate 1539sparc_exit: rdpr %pstate, %g2
1540 wrpr %g2, PSTATE_IE, %pstate
1543 rdpr %otherwin, %g1 1541 rdpr %otherwin, %g1
1544 rdpr %cansave, %g3 1542 rdpr %cansave, %g3
1545 add %g3, %g1, %g3 1543 add %g3, %g1, %g3
1546 wrpr %g3, 0x0, %cansave 1544 wrpr %g3, 0x0, %cansave
1547 wrpr %g0, 0x0, %otherwin 1545 wrpr %g0, 0x0, %otherwin
1548 wrpr %g0, (PSTATE_RMO | PSTATE_PEF | PSTATE_PRIV | PSTATE_IE), %pstate 1546 wrpr %g2, 0x0, %pstate
1549 ba,pt %xcc, sys_exit 1547 ba,pt %xcc, sys_exit
1550 stb %g0, [%g6 + TI_WSAVED] 1548 stb %g0, [%g6 + TI_WSAVED]
1551 1549
@@ -1690,3 +1688,138 @@ __flushw_user:
1690 restore %g0, %g0, %g0 1688 restore %g0, %g0, %g0
16912: retl 16892: retl
1692 nop 1690 nop
1691
1692#ifdef CONFIG_SMP
1693 .globl hard_smp_processor_id
1694hard_smp_processor_id:
1695#endif
1696 .globl real_hard_smp_processor_id
1697real_hard_smp_processor_id:
1698 __GET_CPUID(%o0)
1699 retl
1700 nop
1701
1702 /* %o0: devhandle
1703 * %o1: devino
1704 *
1705 * returns %o0: sysino
1706 */
1707 .globl sun4v_devino_to_sysino
1708sun4v_devino_to_sysino:
1709 mov HV_FAST_INTR_DEVINO2SYSINO, %o5
1710 ta HV_FAST_TRAP
1711 retl
1712 mov %o1, %o0
1713
1714 /* %o0: sysino
1715 *
1716 * returns %o0: intr_enabled (HV_INTR_{DISABLED,ENABLED})
1717 */
1718 .globl sun4v_intr_getenabled
1719sun4v_intr_getenabled:
1720 mov HV_FAST_INTR_GETENABLED, %o5
1721 ta HV_FAST_TRAP
1722 retl
1723 mov %o1, %o0
1724
1725 /* %o0: sysino
1726 * %o1: intr_enabled (HV_INTR_{DISABLED,ENABLED})
1727 */
1728 .globl sun4v_intr_setenabled
1729sun4v_intr_setenabled:
1730 mov HV_FAST_INTR_SETENABLED, %o5
1731 ta HV_FAST_TRAP
1732 retl
1733 nop
1734
1735 /* %o0: sysino
1736 *
1737 * returns %o0: intr_state (HV_INTR_STATE_*)
1738 */
1739 .globl sun4v_intr_getstate
1740sun4v_intr_getstate:
1741 mov HV_FAST_INTR_GETSTATE, %o5
1742 ta HV_FAST_TRAP
1743 retl
1744 mov %o1, %o0
1745
1746 /* %o0: sysino
1747 * %o1: intr_state (HV_INTR_STATE_*)
1748 */
1749 .globl sun4v_intr_setstate
1750sun4v_intr_setstate:
1751 mov HV_FAST_INTR_SETSTATE, %o5
1752 ta HV_FAST_TRAP
1753 retl
1754 nop
1755
1756 /* %o0: sysino
1757 *
1758 * returns %o0: cpuid
1759 */
1760 .globl sun4v_intr_gettarget
1761sun4v_intr_gettarget:
1762 mov HV_FAST_INTR_GETTARGET, %o5
1763 ta HV_FAST_TRAP
1764 retl
1765 mov %o1, %o0
1766
1767 /* %o0: sysino
1768 * %o1: cpuid
1769 */
1770 .globl sun4v_intr_settarget
1771sun4v_intr_settarget:
1772 mov HV_FAST_INTR_SETTARGET, %o5
1773 ta HV_FAST_TRAP
1774 retl
1775 nop
1776
1777 /* %o0: type
1778 * %o1: queue paddr
1779 * %o2: num queue entries
1780 *
1781 * returns %o0: status
1782 */
1783 .globl sun4v_cpu_qconf
1784sun4v_cpu_qconf:
1785 mov HV_FAST_CPU_QCONF, %o5
1786 ta HV_FAST_TRAP
1787 retl
1788 nop
1789
1790 /* returns %o0: status
1791 */
1792 .globl sun4v_cpu_yield
1793sun4v_cpu_yield:
1794 mov HV_FAST_CPU_YIELD, %o5
1795 ta HV_FAST_TRAP
1796 retl
1797 nop
1798
1799 /* %o0: num cpus in cpu list
1800 * %o1: cpu list paddr
1801 * %o2: mondo block paddr
1802 *
1803 * returns %o0: status
1804 */
1805 .globl sun4v_cpu_mondo_send
1806sun4v_cpu_mondo_send:
1807 mov HV_FAST_CPU_MONDO_SEND, %o5
1808 ta HV_FAST_TRAP
1809 retl
1810 nop
1811
1812 /* %o0: CPU ID
1813 *
1814 * returns %o0: -status if status non-zero, else
1815 * %o0: cpu state as HV_CPU_STATE_*
1816 */
1817 .globl sun4v_cpu_state
1818sun4v_cpu_state:
1819 mov HV_FAST_CPU_STATE, %o5
1820 ta HV_FAST_TRAP
1821 brnz,pn %o0, 1f
1822 sub %g0, %o0, %o0
1823 mov %o1, %o0
18241: retl
1825 nop
diff --git a/arch/sparc64/kernel/etrap.S b/arch/sparc64/kernel/etrap.S
index 0d8eba21111b..149383835c25 100644
--- a/arch/sparc64/kernel/etrap.S
+++ b/arch/sparc64/kernel/etrap.S
@@ -31,6 +31,7 @@
31 .globl etrap, etrap_irq, etraptl1 31 .globl etrap, etrap_irq, etraptl1
32etrap: rdpr %pil, %g2 32etrap: rdpr %pil, %g2
33etrap_irq: 33etrap_irq:
34 TRAP_LOAD_THREAD_REG(%g6, %g1)
34 rdpr %tstate, %g1 35 rdpr %tstate, %g1
35 sllx %g2, 20, %g3 36 sllx %g2, 20, %g3
36 andcc %g1, TSTATE_PRIV, %g0 37 andcc %g1, TSTATE_PRIV, %g0
@@ -54,7 +55,31 @@ etrap_irq:
54 rd %y, %g3 55 rd %y, %g3
55 stx %g1, [%g2 + STACKFRAME_SZ + PT_V9_TNPC] 56 stx %g1, [%g2 + STACKFRAME_SZ + PT_V9_TNPC]
56 st %g3, [%g2 + STACKFRAME_SZ + PT_V9_Y] 57 st %g3, [%g2 + STACKFRAME_SZ + PT_V9_Y]
57 save %g2, -STACK_BIAS, %sp ! Ordering here is critical 58
59 rdpr %cansave, %g1
60 brnz,pt %g1, etrap_save
61 nop
62
63 rdpr %cwp, %g1
64 add %g1, 2, %g1
65 wrpr %g1, %cwp
66 be,pt %xcc, etrap_user_spill
67 mov ASI_AIUP, %g3
68
69 rdpr %otherwin, %g3
70 brz %g3, etrap_kernel_spill
71 mov ASI_AIUS, %g3
72
73etrap_user_spill:
74
75 wr %g3, 0x0, %asi
76 ldx [%g6 + TI_FLAGS], %g3
77 and %g3, _TIF_32BIT, %g3
78 brnz,pt %g3, etrap_user_spill_32bit
79 nop
80 ba,a,pt %xcc, etrap_user_spill_64bit
81
82etrap_save: save %g2, -STACK_BIAS, %sp
58 mov %g6, %l6 83 mov %g6, %l6
59 84
60 bne,pn %xcc, 3f 85 bne,pn %xcc, 3f
@@ -70,42 +95,56 @@ etrap_irq:
70 wrpr %g2, 0, %wstate 95 wrpr %g2, 0, %wstate
71 sethi %hi(sparc64_kern_pri_context), %g2 96 sethi %hi(sparc64_kern_pri_context), %g2
72 ldx [%g2 + %lo(sparc64_kern_pri_context)], %g3 97 ldx [%g2 + %lo(sparc64_kern_pri_context)], %g3
73 stxa %g3, [%l4] ASI_DMMU 98
74 flush %l6 99661: stxa %g3, [%l4] ASI_DMMU
75 wr %g0, ASI_AIUS, %asi 100 .section .sun4v_1insn_patch, "ax"
762: wrpr %g0, 0x0, %tl 101 .word 661b
77 mov %g4, %l4 102 stxa %g3, [%l4] ASI_MMU
103 .previous
104
105 sethi %hi(KERNBASE), %l4
106 flush %l4
107 mov ASI_AIUS, %l7
1082: mov %g4, %l4
78 mov %g5, %l5 109 mov %g5, %l5
110 add %g7, 4, %l2
111
112 /* Go to trap time globals so we can save them. */
113661: wrpr %g0, ETRAP_PSTATE1, %pstate
114 .section .sun4v_1insn_patch, "ax"
115 .word 661b
116 SET_GL(0)
117 .previous
79 118
80 mov %g7, %l2
81 wrpr %g0, ETRAP_PSTATE1, %pstate
82 stx %g1, [%sp + PTREGS_OFF + PT_V9_G1] 119 stx %g1, [%sp + PTREGS_OFF + PT_V9_G1]
83 stx %g2, [%sp + PTREGS_OFF + PT_V9_G2] 120 stx %g2, [%sp + PTREGS_OFF + PT_V9_G2]
121 sllx %l7, 24, %l7
84 stx %g3, [%sp + PTREGS_OFF + PT_V9_G3] 122 stx %g3, [%sp + PTREGS_OFF + PT_V9_G3]
123 rdpr %cwp, %l0
85 stx %g4, [%sp + PTREGS_OFF + PT_V9_G4] 124 stx %g4, [%sp + PTREGS_OFF + PT_V9_G4]
86 stx %g5, [%sp + PTREGS_OFF + PT_V9_G5] 125 stx %g5, [%sp + PTREGS_OFF + PT_V9_G5]
87 stx %g6, [%sp + PTREGS_OFF + PT_V9_G6] 126 stx %g6, [%sp + PTREGS_OFF + PT_V9_G6]
88
89 stx %g7, [%sp + PTREGS_OFF + PT_V9_G7] 127 stx %g7, [%sp + PTREGS_OFF + PT_V9_G7]
128 or %l7, %l0, %l7
129 sethi %hi(TSTATE_RMO | TSTATE_PEF), %l0
130 or %l7, %l0, %l7
131 wrpr %l2, %tnpc
132 wrpr %l7, (TSTATE_PRIV | TSTATE_IE), %tstate
90 stx %i0, [%sp + PTREGS_OFF + PT_V9_I0] 133 stx %i0, [%sp + PTREGS_OFF + PT_V9_I0]
91 stx %i1, [%sp + PTREGS_OFF + PT_V9_I1] 134 stx %i1, [%sp + PTREGS_OFF + PT_V9_I1]
92 stx %i2, [%sp + PTREGS_OFF + PT_V9_I2] 135 stx %i2, [%sp + PTREGS_OFF + PT_V9_I2]
93 stx %i3, [%sp + PTREGS_OFF + PT_V9_I3] 136 stx %i3, [%sp + PTREGS_OFF + PT_V9_I3]
94 stx %i4, [%sp + PTREGS_OFF + PT_V9_I4] 137 stx %i4, [%sp + PTREGS_OFF + PT_V9_I4]
95 stx %i5, [%sp + PTREGS_OFF + PT_V9_I5] 138 stx %i5, [%sp + PTREGS_OFF + PT_V9_I5]
96
97 stx %i6, [%sp + PTREGS_OFF + PT_V9_I6] 139 stx %i6, [%sp + PTREGS_OFF + PT_V9_I6]
98 stx %i7, [%sp + PTREGS_OFF + PT_V9_I7]
99 wrpr %g0, ETRAP_PSTATE2, %pstate
100 mov %l6, %g6 140 mov %l6, %g6
101#ifdef CONFIG_SMP 141 stx %i7, [%sp + PTREGS_OFF + PT_V9_I7]
102 mov TSB_REG, %g3 142 LOAD_PER_CPU_BASE(%g5, %g6, %g4, %g3, %l1)
103 ldxa [%g3] ASI_IMMU, %g5 143 ldx [%g6 + TI_TASK], %g4
104#endif 144 done
105 jmpl %l2 + 0x4, %g0
106 ldx [%g6 + TI_TASK], %g4
107 145
1083: ldub [%l6 + TI_FPDEPTH], %l5 1463: mov ASI_P, %l7
147 ldub [%l6 + TI_FPDEPTH], %l5
109 add %l6, TI_FPSAVED + 1, %l4 148 add %l6, TI_FPSAVED + 1, %l4
110 srl %l5, 1, %l3 149 srl %l5, 1, %l3
111 add %l5, 2, %l5 150 add %l5, 2, %l5
@@ -125,6 +164,7 @@ etraptl1: /* Save tstate/tpc/tnpc of TL 1-->4 and the tl register itself.
125 * 0x58 TL4's TT 164 * 0x58 TL4's TT
126 * 0x60 TL 165 * 0x60 TL
127 */ 166 */
167 TRAP_LOAD_THREAD_REG(%g6, %g1)
128 sub %sp, ((4 * 8) * 4) + 8, %g2 168 sub %sp, ((4 * 8) * 4) + 8, %g2
129 rdpr %tl, %g1 169 rdpr %tl, %g1
130 170
@@ -148,6 +188,11 @@ etraptl1: /* Save tstate/tpc/tnpc of TL 1-->4 and the tl register itself.
148 rdpr %tt, %g3 188 rdpr %tt, %g3
149 stx %g3, [%g2 + STACK_BIAS + 0x38] 189 stx %g3, [%g2 + STACK_BIAS + 0x38]
150 190
191 sethi %hi(is_sun4v), %g3
192 lduw [%g3 + %lo(is_sun4v)], %g3
193 brnz,pn %g3, finish_tl1_capture
194 nop
195
151 wrpr %g0, 3, %tl 196 wrpr %g0, 3, %tl
152 rdpr %tstate, %g3 197 rdpr %tstate, %g3
153 stx %g3, [%g2 + STACK_BIAS + 0x40] 198 stx %g3, [%g2 + STACK_BIAS + 0x40]
@@ -168,91 +213,20 @@ etraptl1: /* Save tstate/tpc/tnpc of TL 1-->4 and the tl register itself.
168 rdpr %tt, %g3 213 rdpr %tt, %g3
169 stx %g3, [%g2 + STACK_BIAS + 0x78] 214 stx %g3, [%g2 + STACK_BIAS + 0x78]
170 215
171 wrpr %g1, %tl
172 stx %g1, [%g2 + STACK_BIAS + 0x80] 216 stx %g1, [%g2 + STACK_BIAS + 0x80]
173 217
218finish_tl1_capture:
219 wrpr %g0, 1, %tl
220661: nop
221 .section .sun4v_1insn_patch, "ax"
222 .word 661b
223 SET_GL(1)
224 .previous
225
174 rdpr %tstate, %g1 226 rdpr %tstate, %g1
175 sub %g2, STACKFRAME_SZ + TRACEREG_SZ - STACK_BIAS, %g2 227 sub %g2, STACKFRAME_SZ + TRACEREG_SZ - STACK_BIAS, %g2
176 ba,pt %xcc, 1b 228 ba,pt %xcc, 1b
177 andcc %g1, TSTATE_PRIV, %g0 229 andcc %g1, TSTATE_PRIV, %g0
178 230
179 .align 64
180 .globl scetrap
181scetrap: rdpr %pil, %g2
182 rdpr %tstate, %g1
183 sllx %g2, 20, %g3
184 andcc %g1, TSTATE_PRIV, %g0
185 or %g1, %g3, %g1
186 bne,pn %xcc, 1f
187 sub %sp, (STACKFRAME_SZ+TRACEREG_SZ-STACK_BIAS), %g2
188 wrpr %g0, 7, %cleanwin
189
190 sllx %g1, 51, %g3
191 sethi %hi(TASK_REGOFF), %g2
192 or %g2, %lo(TASK_REGOFF), %g2
193 brlz,pn %g3, 1f
194 add %g6, %g2, %g2
195 wr %g0, 0, %fprs
1961: rdpr %tpc, %g3
197 stx %g1, [%g2 + STACKFRAME_SZ + PT_V9_TSTATE]
198
199 rdpr %tnpc, %g1
200 stx %g3, [%g2 + STACKFRAME_SZ + PT_V9_TPC]
201 stx %g1, [%g2 + STACKFRAME_SZ + PT_V9_TNPC]
202 save %g2, -STACK_BIAS, %sp ! Ordering here is critical
203 mov %g6, %l6
204 bne,pn %xcc, 2f
205 mov ASI_P, %l7
206 rdpr %canrestore, %g3
207
208 rdpr %wstate, %g2
209 wrpr %g0, 0, %canrestore
210 sll %g2, 3, %g2
211 mov PRIMARY_CONTEXT, %l4
212 wrpr %g3, 0, %otherwin
213 wrpr %g2, 0, %wstate
214 sethi %hi(sparc64_kern_pri_context), %g2
215 ldx [%g2 + %lo(sparc64_kern_pri_context)], %g3
216 stxa %g3, [%l4] ASI_DMMU
217 flush %l6
218
219 mov ASI_AIUS, %l7
2202: mov %g4, %l4
221 mov %g5, %l5
222 add %g7, 0x4, %l2
223 wrpr %g0, ETRAP_PSTATE1, %pstate
224 stx %g1, [%sp + PTREGS_OFF + PT_V9_G1]
225 stx %g2, [%sp + PTREGS_OFF + PT_V9_G2]
226 sllx %l7, 24, %l7
227
228 stx %g3, [%sp + PTREGS_OFF + PT_V9_G3]
229 rdpr %cwp, %l0
230 stx %g4, [%sp + PTREGS_OFF + PT_V9_G4]
231 stx %g5, [%sp + PTREGS_OFF + PT_V9_G5]
232 stx %g6, [%sp + PTREGS_OFF + PT_V9_G6]
233 stx %g7, [%sp + PTREGS_OFF + PT_V9_G7]
234 or %l7, %l0, %l7
235 sethi %hi(TSTATE_RMO | TSTATE_PEF), %l0
236
237 or %l7, %l0, %l7
238 wrpr %l2, %tnpc
239 wrpr %l7, (TSTATE_PRIV | TSTATE_IE), %tstate
240 stx %i0, [%sp + PTREGS_OFF + PT_V9_I0]
241 stx %i1, [%sp + PTREGS_OFF + PT_V9_I1]
242 stx %i2, [%sp + PTREGS_OFF + PT_V9_I2]
243 stx %i3, [%sp + PTREGS_OFF + PT_V9_I3]
244 stx %i4, [%sp + PTREGS_OFF + PT_V9_I4]
245
246 stx %i5, [%sp + PTREGS_OFF + PT_V9_I5]
247 stx %i6, [%sp + PTREGS_OFF + PT_V9_I6]
248 mov %l6, %g6
249 stx %i7, [%sp + PTREGS_OFF + PT_V9_I7]
250#ifdef CONFIG_SMP
251 mov TSB_REG, %g3
252 ldxa [%g3] ASI_IMMU, %g5
253#endif
254 ldx [%g6 + TI_TASK], %g4
255 done
256
257#undef TASK_REGOFF 231#undef TASK_REGOFF
258#undef ETRAP_PSTATE1 232#undef ETRAP_PSTATE1
diff --git a/arch/sparc64/kernel/head.S b/arch/sparc64/kernel/head.S
index b49dcd4504b0..3eadac5e171e 100644
--- a/arch/sparc64/kernel/head.S
+++ b/arch/sparc64/kernel/head.S
@@ -26,6 +26,7 @@
26#include <asm/head.h> 26#include <asm/head.h>
27#include <asm/ttable.h> 27#include <asm/ttable.h>
28#include <asm/mmu.h> 28#include <asm/mmu.h>
29#include <asm/cpudata.h>
29 30
30/* This section from from _start to sparc64_boot_end should fit into 31/* This section from from _start to sparc64_boot_end should fit into
31 * 0x0000000000404000 to 0x0000000000408000. 32 * 0x0000000000404000 to 0x0000000000408000.
@@ -94,12 +95,17 @@ sparc64_boot:
94 wrpr %g1, 0x0, %pstate 95 wrpr %g1, 0x0, %pstate
95 ba,a,pt %xcc, 1f 96 ba,a,pt %xcc, 1f
96 97
97 .globl prom_finddev_name, prom_chosen_path 98 .globl prom_finddev_name, prom_chosen_path, prom_root_node
98 .globl prom_getprop_name, prom_mmu_name 99 .globl prom_getprop_name, prom_mmu_name, prom_peer_name
99 .globl prom_callmethod_name, prom_translate_name 100 .globl prom_callmethod_name, prom_translate_name, prom_root_compatible
100 .globl prom_map_name, prom_unmap_name, prom_mmu_ihandle_cache 101 .globl prom_map_name, prom_unmap_name, prom_mmu_ihandle_cache
101 .globl prom_boot_mapped_pc, prom_boot_mapping_mode 102 .globl prom_boot_mapped_pc, prom_boot_mapping_mode
102 .globl prom_boot_mapping_phys_high, prom_boot_mapping_phys_low 103 .globl prom_boot_mapping_phys_high, prom_boot_mapping_phys_low
104 .globl is_sun4v
105prom_peer_name:
106 .asciz "peer"
107prom_compatible_name:
108 .asciz "compatible"
103prom_finddev_name: 109prom_finddev_name:
104 .asciz "finddevice" 110 .asciz "finddevice"
105prom_chosen_path: 111prom_chosen_path:
@@ -116,7 +122,13 @@ prom_map_name:
116 .asciz "map" 122 .asciz "map"
117prom_unmap_name: 123prom_unmap_name:
118 .asciz "unmap" 124 .asciz "unmap"
125prom_sun4v_name:
126 .asciz "sun4v"
119 .align 4 127 .align 4
128prom_root_compatible:
129 .skip 64
130prom_root_node:
131 .word 0
120prom_mmu_ihandle_cache: 132prom_mmu_ihandle_cache:
121 .word 0 133 .word 0
122prom_boot_mapped_pc: 134prom_boot_mapped_pc:
@@ -128,8 +140,54 @@ prom_boot_mapping_phys_high:
128 .xword 0 140 .xword 0
129prom_boot_mapping_phys_low: 141prom_boot_mapping_phys_low:
130 .xword 0 142 .xword 0
143is_sun4v:
144 .word 0
1311: 1451:
132 rd %pc, %l0 146 rd %pc, %l0
147
148 mov (1b - prom_peer_name), %l1
149 sub %l0, %l1, %l1
150 mov 0, %l2
151
152 /* prom_root_node = prom_peer(0) */
153 stx %l1, [%sp + 2047 + 128 + 0x00] ! service, "peer"
154 mov 1, %l3
155 stx %l3, [%sp + 2047 + 128 + 0x08] ! num_args, 1
156 stx %l3, [%sp + 2047 + 128 + 0x10] ! num_rets, 1
157 stx %l2, [%sp + 2047 + 128 + 0x18] ! arg1, 0
158 stx %g0, [%sp + 2047 + 128 + 0x20] ! ret1
159 call %l7
160 add %sp, (2047 + 128), %o0 ! argument array
161
162 ldx [%sp + 2047 + 128 + 0x20], %l4 ! prom root node
163 mov (1b - prom_root_node), %l1
164 sub %l0, %l1, %l1
165 stw %l4, [%l1]
166
167 mov (1b - prom_getprop_name), %l1
168 mov (1b - prom_compatible_name), %l2
169 mov (1b - prom_root_compatible), %l5
170 sub %l0, %l1, %l1
171 sub %l0, %l2, %l2
172 sub %l0, %l5, %l5
173
174 /* prom_getproperty(prom_root_node, "compatible",
175 * &prom_root_compatible, 64)
176 */
177 stx %l1, [%sp + 2047 + 128 + 0x00] ! service, "getprop"
178 mov 4, %l3
179 stx %l3, [%sp + 2047 + 128 + 0x08] ! num_args, 4
180 mov 1, %l3
181 stx %l3, [%sp + 2047 + 128 + 0x10] ! num_rets, 1
182 stx %l4, [%sp + 2047 + 128 + 0x18] ! arg1, prom_root_node
183 stx %l2, [%sp + 2047 + 128 + 0x20] ! arg2, "compatible"
184 stx %l5, [%sp + 2047 + 128 + 0x28] ! arg3, &prom_root_compatible
185 mov 64, %l3
186 stx %l3, [%sp + 2047 + 128 + 0x30] ! arg4, size
187 stx %g0, [%sp + 2047 + 128 + 0x38] ! ret1
188 call %l7
189 add %sp, (2047 + 128), %o0 ! argument array
190
133 mov (1b - prom_finddev_name), %l1 191 mov (1b - prom_finddev_name), %l1
134 mov (1b - prom_chosen_path), %l2 192 mov (1b - prom_chosen_path), %l2
135 mov (1b - prom_boot_mapped_pc), %l3 193 mov (1b - prom_boot_mapped_pc), %l3
@@ -238,6 +296,27 @@ prom_boot_mapping_phys_low:
238 add %sp, (192 + 128), %sp 296 add %sp, (192 + 128), %sp
239 297
240sparc64_boot_after_remap: 298sparc64_boot_after_remap:
299 sethi %hi(prom_root_compatible), %g1
300 or %g1, %lo(prom_root_compatible), %g1
301 sethi %hi(prom_sun4v_name), %g7
302 or %g7, %lo(prom_sun4v_name), %g7
303 mov 5, %g3
3041: ldub [%g7], %g2
305 ldub [%g1], %g4
306 cmp %g2, %g4
307 bne,pn %icc, 2f
308 add %g7, 1, %g7
309 subcc %g3, 1, %g3
310 bne,pt %xcc, 1b
311 add %g1, 1, %g1
312
313 sethi %hi(is_sun4v), %g1
314 or %g1, %lo(is_sun4v), %g1
315 mov 1, %g7
316 stw %g7, [%g1]
317
3182:
319 BRANCH_IF_SUN4V(g1, jump_to_sun4u_init)
241 BRANCH_IF_CHEETAH_BASE(g1,g7,cheetah_boot) 320 BRANCH_IF_CHEETAH_BASE(g1,g7,cheetah_boot)
242 BRANCH_IF_CHEETAH_PLUS_OR_FOLLOWON(g1,g7,cheetah_plus_boot) 321 BRANCH_IF_CHEETAH_PLUS_OR_FOLLOWON(g1,g7,cheetah_plus_boot)
243 ba,pt %xcc, spitfire_boot 322 ba,pt %xcc, spitfire_boot
@@ -301,20 +380,58 @@ jump_to_sun4u_init:
301 nop 380 nop
302 381
303sun4u_init: 382sun4u_init:
383 BRANCH_IF_SUN4V(g1, sun4v_init)
384
304 /* Set ctx 0 */ 385 /* Set ctx 0 */
305 mov PRIMARY_CONTEXT, %g7 386 mov PRIMARY_CONTEXT, %g7
306 stxa %g0, [%g7] ASI_DMMU 387 stxa %g0, [%g7] ASI_DMMU
307 membar #Sync 388 membar #Sync
308 389
309 mov SECONDARY_CONTEXT, %g7 390 mov SECONDARY_CONTEXT, %g7
310 stxa %g0, [%g7] ASI_DMMU 391 stxa %g0, [%g7] ASI_DMMU
311 membar #Sync 392 membar #Sync
312 393
313 BRANCH_IF_ANY_CHEETAH(g1,g7,cheetah_tlb_fixup) 394 ba,pt %xcc, sun4u_continue
395 nop
396
397sun4v_init:
398 /* Set ctx 0 */
399 mov PRIMARY_CONTEXT, %g7
400 stxa %g0, [%g7] ASI_MMU
401 membar #Sync
402
403 mov SECONDARY_CONTEXT, %g7
404 stxa %g0, [%g7] ASI_MMU
405 membar #Sync
406 ba,pt %xcc, niagara_tlb_fixup
407 nop
408
409sun4u_continue:
410 BRANCH_IF_ANY_CHEETAH(g1, g7, cheetah_tlb_fixup)
314 411
315 ba,pt %xcc, spitfire_tlb_fixup 412 ba,pt %xcc, spitfire_tlb_fixup
316 nop 413 nop
317 414
415niagara_tlb_fixup:
416 mov 3, %g2 /* Set TLB type to hypervisor. */
417 sethi %hi(tlb_type), %g1
418 stw %g2, [%g1 + %lo(tlb_type)]
419
420 /* Patch copy/clear ops. */
421 call niagara_patch_copyops
422 nop
423 call niagara_patch_bzero
424 nop
425 call niagara_patch_pageops
426 nop
427
428 /* Patch TLB/cache ops. */
429 call hypervisor_patch_cachetlbops
430 nop
431
432 ba,pt %xcc, tlb_fixup_done
433 nop
434
318cheetah_tlb_fixup: 435cheetah_tlb_fixup:
319 mov 2, %g2 /* Set TLB type to cheetah+. */ 436 mov 2, %g2 /* Set TLB type to cheetah+. */
320 BRANCH_IF_CHEETAH_PLUS_OR_FOLLOWON(g1,g7,1f) 437 BRANCH_IF_CHEETAH_PLUS_OR_FOLLOWON(g1,g7,1f)
@@ -411,85 +528,55 @@ setup_trap_table:
411 wrpr %g0, 15, %pil 528 wrpr %g0, 15, %pil
412 529
413 /* Make the firmware call to jump over to the Linux trap table. */ 530 /* Make the firmware call to jump over to the Linux trap table. */
414 call prom_set_trap_table 531 sethi %hi(is_sun4v), %o0
415 sethi %hi(sparc64_ttable_tl0), %o0 532 lduw [%o0 + %lo(is_sun4v)], %o0
533 brz,pt %o0, 1f
534 nop
416 535
417 /* Start using proper page size encodings in ctx register. */ 536 TRAP_LOAD_TRAP_BLOCK(%g2, %g3)
418 sethi %hi(sparc64_kern_pri_context), %g3 537 add %g2, TRAP_PER_CPU_FAULT_INFO, %g2
419 ldx [%g3 + %lo(sparc64_kern_pri_context)], %g2 538 stxa %g2, [%g0] ASI_SCRATCHPAD
420 mov PRIMARY_CONTEXT, %g1
421 stxa %g2, [%g1] ASI_DMMU
422 membar #Sync
423 539
424 /* The Linux trap handlers expect various trap global registers 540 /* Compute physical address:
425 * to be setup with some fixed values. So here we set these
426 * up very carefully. These globals are:
427 *
428 * Alternate Globals (PSTATE_AG):
429 *
430 * %g6 --> current_thread_info()
431 *
432 * MMU Globals (PSTATE_MG):
433 *
434 * %g1 --> TLB_SFSR
435 * %g2 --> ((_PAGE_VALID | _PAGE_SZ4MB |
436 * _PAGE_CP | _PAGE_CV | _PAGE_P | _PAGE_W)
437 * ^ 0xfffff80000000000)
438 * (this %g2 value is used for computing the PAGE_OFFSET kernel
439 * TLB entries quickly, the virtual address of the fault XOR'd
440 * with this %g2 value is the PTE to load into the TLB)
441 * %g3 --> VPTE_BASE_CHEETAH or VPTE_BASE_SPITFIRE
442 * 541 *
443 * Interrupt Globals (PSTATE_IG, setup by init_irqwork_curcpu()): 542 * paddr = kern_base + (mmfsa_vaddr - KERNBASE)
444 *
445 * %g6 --> __irq_work[smp_processor_id()]
446 */ 543 */
544 sethi %hi(KERNBASE), %g3
545 sub %g2, %g3, %g2
546 sethi %hi(kern_base), %g3
547 ldx [%g3 + %lo(kern_base)], %g3
548 add %g2, %g3, %o1
447 549
448 rdpr %pstate, %o1 550 call prom_set_trap_table_sun4v
449 mov %g6, %o2 551 sethi %hi(sparc64_ttable_tl0), %o0
450 wrpr %o1, PSTATE_AG, %pstate 552
451 mov %o2, %g6 553 ba,pt %xcc, 2f
452
453#define KERN_HIGHBITS ((_PAGE_VALID|_PAGE_SZ4MB)^0xfffff80000000000)
454#define KERN_LOWBITS (_PAGE_CP | _PAGE_CV | _PAGE_P | _PAGE_W)
455 wrpr %o1, PSTATE_MG, %pstate
456 mov TSB_REG, %g1
457 stxa %g0, [%g1] ASI_DMMU
458 membar #Sync
459 stxa %g0, [%g1] ASI_IMMU
460 membar #Sync
461 mov TLB_SFSR, %g1
462 sethi %uhi(KERN_HIGHBITS), %g2
463 or %g2, %ulo(KERN_HIGHBITS), %g2
464 sllx %g2, 32, %g2
465 or %g2, KERN_LOWBITS, %g2
466
467 BRANCH_IF_ANY_CHEETAH(g3,g7,8f)
468 ba,pt %xcc, 9f
469 nop 554 nop
470 555
4718: 5561: call prom_set_trap_table
472 sethi %uhi(VPTE_BASE_CHEETAH), %g3 557 sethi %hi(sparc64_ttable_tl0), %o0
473 or %g3, %ulo(VPTE_BASE_CHEETAH), %g3
474 ba,pt %xcc, 2f
475 sllx %g3, 32, %g3
476 558
4779: 559 /* Start using proper page size encodings in ctx register. */
478 sethi %uhi(VPTE_BASE_SPITFIRE), %g3 5602: sethi %hi(sparc64_kern_pri_context), %g3
479 or %g3, %ulo(VPTE_BASE_SPITFIRE), %g3 561 ldx [%g3 + %lo(sparc64_kern_pri_context)], %g2
480 sllx %g3, 32, %g3
481 562
4822: 563 mov PRIMARY_CONTEXT, %g1
483 clr %g7 564
484#undef KERN_HIGHBITS 565661: stxa %g2, [%g1] ASI_DMMU
485#undef KERN_LOWBITS 566 .section .sun4v_1insn_patch, "ax"
567 .word 661b
568 stxa %g2, [%g1] ASI_MMU
569 .previous
570
571 membar #Sync
486 572
487 /* Kill PROM timer */ 573 /* Kill PROM timer */
488 sethi %hi(0x80000000), %o2 574 sethi %hi(0x80000000), %o2
489 sllx %o2, 32, %o2 575 sllx %o2, 32, %o2
490 wr %o2, 0, %tick_cmpr 576 wr %o2, 0, %tick_cmpr
491 577
492 BRANCH_IF_ANY_CHEETAH(o2,o3,1f) 578 BRANCH_IF_SUN4V(o2, 1f)
579 BRANCH_IF_ANY_CHEETAH(o2, o3, 1f)
493 580
494 ba,pt %xcc, 2f 581 ba,pt %xcc, 2f
495 nop 582 nop
@@ -502,7 +589,6 @@ setup_trap_table:
502 589
5032: 5902:
504 wrpr %g0, %g0, %wstate 591 wrpr %g0, %g0, %wstate
505 wrpr %o1, 0x0, %pstate
506 592
507 call init_irqwork_curcpu 593 call init_irqwork_curcpu
508 nop 594 nop
@@ -517,7 +603,7 @@ setup_trap_table:
517 restore 603 restore
518 604
519 .globl setup_tba 605 .globl setup_tba
520setup_tba: /* i0 = is_starfire */ 606setup_tba:
521 save %sp, -192, %sp 607 save %sp, -192, %sp
522 608
523 /* The boot processor is the only cpu which invokes this 609 /* The boot processor is the only cpu which invokes this
@@ -536,31 +622,35 @@ setup_tba: /* i0 = is_starfire */
536 restore 622 restore
537sparc64_boot_end: 623sparc64_boot_end:
538 624
539#include "systbls.S"
540#include "ktlb.S" 625#include "ktlb.S"
626#include "tsb.S"
541#include "etrap.S" 627#include "etrap.S"
542#include "rtrap.S" 628#include "rtrap.S"
543#include "winfixup.S" 629#include "winfixup.S"
544#include "entry.S" 630#include "entry.S"
631#include "sun4v_tlb_miss.S"
632#include "sun4v_ivec.S"
545 633
546/* 634/*
547 * The following skip makes sure the trap table in ttable.S is aligned 635 * The following skip makes sure the trap table in ttable.S is aligned
548 * on a 32K boundary as required by the v9 specs for TBA register. 636 * on a 32K boundary as required by the v9 specs for TBA register.
637 *
638 * We align to a 32K boundary, then we have the 32K kernel TSB,
639 * then the 32K aligned trap table.
549 */ 640 */
5501: 6411:
551 .skip 0x4000 + _start - 1b 642 .skip 0x4000 + _start - 1b
552 643
553#ifdef CONFIG_SBUS 644 .globl swapper_tsb
554/* This is just a hack to fool make depend config.h discovering 645swapper_tsb:
555 strategy: As the .S files below need config.h, but 646 .skip (32 * 1024)
556 make depend does not find it for them, we include config.h
557 in head.S */
558#endif
559 647
560! 0x0000000000408000 648! 0x0000000000408000
561 649
562#include "ttable.S" 650#include "ttable.S"
563 651
652#include "systbls.S"
653
564 .data 654 .data
565 .align 8 655 .align 8
566 .globl prom_tba, tlb_type 656 .globl prom_tba, tlb_type
diff --git a/arch/sparc64/kernel/irq.c b/arch/sparc64/kernel/irq.c
index 233526ba3abe..11e645c9ec50 100644
--- a/arch/sparc64/kernel/irq.c
+++ b/arch/sparc64/kernel/irq.c
@@ -21,6 +21,7 @@
21#include <linux/delay.h> 21#include <linux/delay.h>
22#include <linux/proc_fs.h> 22#include <linux/proc_fs.h>
23#include <linux/seq_file.h> 23#include <linux/seq_file.h>
24#include <linux/bootmem.h>
24 25
25#include <asm/ptrace.h> 26#include <asm/ptrace.h>
26#include <asm/processor.h> 27#include <asm/processor.h>
@@ -39,6 +40,7 @@
39#include <asm/cache.h> 40#include <asm/cache.h>
40#include <asm/cpudata.h> 41#include <asm/cpudata.h>
41#include <asm/auxio.h> 42#include <asm/auxio.h>
43#include <asm/head.h>
42 44
43#ifdef CONFIG_SMP 45#ifdef CONFIG_SMP
44static void distribute_irqs(void); 46static void distribute_irqs(void);
@@ -115,9 +117,7 @@ int show_interrupts(struct seq_file *p, void *v)
115#ifndef CONFIG_SMP 117#ifndef CONFIG_SMP
116 seq_printf(p, "%10u ", kstat_irqs(i)); 118 seq_printf(p, "%10u ", kstat_irqs(i));
117#else 119#else
118 for (j = 0; j < NR_CPUS; j++) { 120 for_each_online_cpu(j) {
119 if (!cpu_online(j))
120 continue;
121 seq_printf(p, "%10u ", 121 seq_printf(p, "%10u ",
122 kstat_cpu(j).irqs[i]); 122 kstat_cpu(j).irqs[i]);
123 } 123 }
@@ -136,12 +136,48 @@ out_unlock:
136 return 0; 136 return 0;
137} 137}
138 138
139extern unsigned long real_hard_smp_processor_id(void);
140
141static unsigned int sun4u_compute_tid(unsigned long imap, unsigned long cpuid)
142{
143 unsigned int tid;
144
145 if (this_is_starfire) {
146 tid = starfire_translate(imap, cpuid);
147 tid <<= IMAP_TID_SHIFT;
148 tid &= IMAP_TID_UPA;
149 } else {
150 if (tlb_type == cheetah || tlb_type == cheetah_plus) {
151 unsigned long ver;
152
153 __asm__ ("rdpr %%ver, %0" : "=r" (ver));
154 if ((ver >> 32UL) == __JALAPENO_ID ||
155 (ver >> 32UL) == __SERRANO_ID) {
156 tid = cpuid << IMAP_TID_SHIFT;
157 tid &= IMAP_TID_JBUS;
158 } else {
159 unsigned int a = cpuid & 0x1f;
160 unsigned int n = (cpuid >> 5) & 0x1f;
161
162 tid = ((a << IMAP_AID_SHIFT) |
163 (n << IMAP_NID_SHIFT));
164 tid &= (IMAP_AID_SAFARI |
165 IMAP_NID_SAFARI);;
166 }
167 } else {
168 tid = cpuid << IMAP_TID_SHIFT;
169 tid &= IMAP_TID_UPA;
170 }
171 }
172
173 return tid;
174}
175
139/* Now these are always passed a true fully specified sun4u INO. */ 176/* Now these are always passed a true fully specified sun4u INO. */
140void enable_irq(unsigned int irq) 177void enable_irq(unsigned int irq)
141{ 178{
142 struct ino_bucket *bucket = __bucket(irq); 179 struct ino_bucket *bucket = __bucket(irq);
143 unsigned long imap; 180 unsigned long imap, cpuid;
144 unsigned long tid;
145 181
146 imap = bucket->imap; 182 imap = bucket->imap;
147 if (imap == 0UL) 183 if (imap == 0UL)
@@ -149,47 +185,38 @@ void enable_irq(unsigned int irq)
149 185
150 preempt_disable(); 186 preempt_disable();
151 187
152 if (tlb_type == cheetah || tlb_type == cheetah_plus) { 188 /* This gets the physical processor ID, even on uniprocessor,
153 unsigned long ver; 189 * so we can always program the interrupt target correctly.
154 190 */
155 __asm__ ("rdpr %%ver, %0" : "=r" (ver)); 191 cpuid = real_hard_smp_processor_id();
156 if ((ver >> 32) == 0x003e0016) { 192
157 /* We set it to our JBUS ID. */ 193 if (tlb_type == hypervisor) {
158 __asm__ __volatile__("ldxa [%%g0] %1, %0" 194 unsigned int ino = __irq_ino(irq);
159 : "=r" (tid) 195 int err;
160 : "i" (ASI_JBUS_CONFIG)); 196
161 tid = ((tid & (0x1fUL<<17)) << 9); 197 err = sun4v_intr_settarget(ino, cpuid);
162 tid &= IMAP_TID_JBUS; 198 if (err != HV_EOK)
163 } else { 199 printk("sun4v_intr_settarget(%x,%lu): err(%d)\n",
164 /* We set it to our Safari AID. */ 200 ino, cpuid, err);
165 __asm__ __volatile__("ldxa [%%g0] %1, %0" 201 err = sun4v_intr_setenabled(ino, HV_INTR_ENABLED);
166 : "=r" (tid) 202 if (err != HV_EOK)
167 : "i" (ASI_SAFARI_CONFIG)); 203 printk("sun4v_intr_setenabled(%x): err(%d)\n",
168 tid = ((tid & (0x3ffUL<<17)) << 9); 204 ino, err);
169 tid &= IMAP_AID_SAFARI;
170 }
171 } else if (this_is_starfire == 0) {
172 /* We set it to our UPA MID. */
173 __asm__ __volatile__("ldxa [%%g0] %1, %0"
174 : "=r" (tid)
175 : "i" (ASI_UPA_CONFIG));
176 tid = ((tid & UPA_CONFIG_MID) << 9);
177 tid &= IMAP_TID_UPA;
178 } else { 205 } else {
179 tid = (starfire_translate(imap, smp_processor_id()) << 26); 206 unsigned int tid = sun4u_compute_tid(imap, cpuid);
180 tid &= IMAP_TID_UPA; 207
208 /* NOTE NOTE NOTE, IGN and INO are read-only, IGN is a product
209 * of this SYSIO's preconfigured IGN in the SYSIO Control
210 * Register, the hardware just mirrors that value here.
211 * However for Graphics and UPA Slave devices the full
212 * IMAP_INR field can be set by the programmer here.
213 *
214 * Things like FFB can now be handled via the new IRQ
215 * mechanism.
216 */
217 upa_writel(tid | IMAP_VALID, imap);
181 } 218 }
182 219
183 /* NOTE NOTE NOTE, IGN and INO are read-only, IGN is a product
184 * of this SYSIO's preconfigured IGN in the SYSIO Control
185 * Register, the hardware just mirrors that value here.
186 * However for Graphics and UPA Slave devices the full
187 * IMAP_INR field can be set by the programmer here.
188 *
189 * Things like FFB can now be handled via the new IRQ mechanism.
190 */
191 upa_writel(tid | IMAP_VALID, imap);
192
193 preempt_enable(); 220 preempt_enable();
194} 221}
195 222
@@ -201,16 +228,26 @@ void disable_irq(unsigned int irq)
201 228
202 imap = bucket->imap; 229 imap = bucket->imap;
203 if (imap != 0UL) { 230 if (imap != 0UL) {
204 u32 tmp; 231 if (tlb_type == hypervisor) {
232 unsigned int ino = __irq_ino(irq);
233 int err;
234
235 err = sun4v_intr_setenabled(ino, HV_INTR_DISABLED);
236 if (err != HV_EOK)
237 printk("sun4v_intr_setenabled(%x): "
238 "err(%d)\n", ino, err);
239 } else {
240 u32 tmp;
205 241
206 /* NOTE: We do not want to futz with the IRQ clear registers 242 /* NOTE: We do not want to futz with the IRQ clear registers
207 * and move the state to IDLE, the SCSI code does call 243 * and move the state to IDLE, the SCSI code does call
208 * disable_irq() to assure atomicity in the queue cmd 244 * disable_irq() to assure atomicity in the queue cmd
209 * SCSI adapter driver code. Thus we'd lose interrupts. 245 * SCSI adapter driver code. Thus we'd lose interrupts.
210 */ 246 */
211 tmp = upa_readl(imap); 247 tmp = upa_readl(imap);
212 tmp &= ~IMAP_VALID; 248 tmp &= ~IMAP_VALID;
213 upa_writel(tmp, imap); 249 upa_writel(tmp, imap);
250 }
214 } 251 }
215} 252}
216 253
@@ -248,6 +285,8 @@ unsigned int build_irq(int pil, int inofixup, unsigned long iclr, unsigned long
248 return __irq(&pil0_dummy_bucket); 285 return __irq(&pil0_dummy_bucket);
249 } 286 }
250 287
288 BUG_ON(tlb_type == hypervisor);
289
251 /* RULE: Both must be specified in all other cases. */ 290 /* RULE: Both must be specified in all other cases. */
252 if (iclr == 0UL || imap == 0UL) { 291 if (iclr == 0UL || imap == 0UL) {
253 prom_printf("Invalid build_irq %d %d %016lx %016lx\n", 292 prom_printf("Invalid build_irq %d %d %016lx %016lx\n",
@@ -275,12 +314,11 @@ unsigned int build_irq(int pil, int inofixup, unsigned long iclr, unsigned long
275 goto out; 314 goto out;
276 } 315 }
277 316
278 bucket->irq_info = kmalloc(sizeof(struct irq_desc), GFP_ATOMIC); 317 bucket->irq_info = kzalloc(sizeof(struct irq_desc), GFP_ATOMIC);
279 if (!bucket->irq_info) { 318 if (!bucket->irq_info) {
280 prom_printf("IRQ: Error, kmalloc(irq_desc) failed.\n"); 319 prom_printf("IRQ: Error, kmalloc(irq_desc) failed.\n");
281 prom_halt(); 320 prom_halt();
282 } 321 }
283 memset(bucket->irq_info, 0, sizeof(struct irq_desc));
284 322
285 /* Ok, looks good, set it up. Don't touch the irq_chain or 323 /* Ok, looks good, set it up. Don't touch the irq_chain or
286 * the pending flag. 324 * the pending flag.
@@ -294,6 +332,37 @@ out:
294 return __irq(bucket); 332 return __irq(bucket);
295} 333}
296 334
335unsigned int sun4v_build_irq(u32 devhandle, unsigned int devino, int pil, unsigned char flags)
336{
337 struct ino_bucket *bucket;
338 unsigned long sysino;
339
340 sysino = sun4v_devino_to_sysino(devhandle, devino);
341
342 bucket = &ivector_table[sysino];
343
344 /* Catch accidental accesses to these things. IMAP/ICLR handling
345 * is done by hypervisor calls on sun4v platforms, not by direct
346 * register accesses.
347 *
348 * But we need to make them look unique for the disable_irq() logic
349 * in free_irq().
350 */
351 bucket->imap = ~0UL - sysino;
352 bucket->iclr = ~0UL - sysino;
353
354 bucket->pil = pil;
355 bucket->flags = flags;
356
357 bucket->irq_info = kzalloc(sizeof(struct irq_desc), GFP_ATOMIC);
358 if (!bucket->irq_info) {
359 prom_printf("IRQ: Error, kmalloc(irq_desc) failed.\n");
360 prom_halt();
361 }
362
363 return __irq(bucket);
364}
365
297static void atomic_bucket_insert(struct ino_bucket *bucket) 366static void atomic_bucket_insert(struct ino_bucket *bucket)
298{ 367{
299 unsigned long pstate; 368 unsigned long pstate;
@@ -482,7 +551,6 @@ void free_irq(unsigned int irq, void *dev_id)
482 bucket = __bucket(irq); 551 bucket = __bucket(irq);
483 if (bucket != &pil0_dummy_bucket) { 552 if (bucket != &pil0_dummy_bucket) {
484 struct irq_desc *desc = bucket->irq_info; 553 struct irq_desc *desc = bucket->irq_info;
485 unsigned long imap = bucket->imap;
486 int ent, i; 554 int ent, i;
487 555
488 for (i = 0; i < MAX_IRQ_DESC_ACTION; i++) { 556 for (i = 0; i < MAX_IRQ_DESC_ACTION; i++) {
@@ -495,6 +563,8 @@ void free_irq(unsigned int irq, void *dev_id)
495 } 563 }
496 564
497 if (!desc->action_active_mask) { 565 if (!desc->action_active_mask) {
566 unsigned long imap = bucket->imap;
567
498 /* This unique interrupt source is now inactive. */ 568 /* This unique interrupt source is now inactive. */
499 bucket->flags &= ~IBF_ACTIVE; 569 bucket->flags &= ~IBF_ACTIVE;
500 570
@@ -592,7 +662,18 @@ static void process_bucket(int irq, struct ino_bucket *bp, struct pt_regs *regs)
592 break; 662 break;
593 } 663 }
594 if (bp->pil != 0) { 664 if (bp->pil != 0) {
595 upa_writel(ICLR_IDLE, bp->iclr); 665 if (tlb_type == hypervisor) {
666 unsigned int ino = __irq_ino(bp);
667 int err;
668
669 err = sun4v_intr_setstate(ino, HV_INTR_STATE_IDLE);
670 if (err != HV_EOK)
671 printk("sun4v_intr_setstate(%x): "
672 "err(%d)\n", ino, err);
673 } else {
674 upa_writel(ICLR_IDLE, bp->iclr);
675 }
676
596 /* Test and add entropy */ 677 /* Test and add entropy */
597 if (random & SA_SAMPLE_RANDOM) 678 if (random & SA_SAMPLE_RANDOM)
598 add_interrupt_randomness(irq); 679 add_interrupt_randomness(irq);
@@ -646,7 +727,7 @@ void handler_irq(int irq, struct pt_regs *regs)
646} 727}
647 728
648#ifdef CONFIG_BLK_DEV_FD 729#ifdef CONFIG_BLK_DEV_FD
649extern irqreturn_t floppy_interrupt(int, void *, struct pt_regs *);; 730extern irqreturn_t floppy_interrupt(int, void *, struct pt_regs *);
650 731
651/* XXX No easy way to include asm/floppy.h XXX */ 732/* XXX No easy way to include asm/floppy.h XXX */
652extern unsigned char *pdma_vaddr; 733extern unsigned char *pdma_vaddr;
@@ -694,7 +775,7 @@ irqreturn_t sparc_floppy_irq(int irq, void *dev_cookie, struct pt_regs *regs)
694 val = readb(auxio_register); 775 val = readb(auxio_register);
695 val |= AUXIO_AUX1_FTCNT; 776 val |= AUXIO_AUX1_FTCNT;
696 writeb(val, auxio_register); 777 writeb(val, auxio_register);
697 val &= AUXIO_AUX1_FTCNT; 778 val &= ~AUXIO_AUX1_FTCNT;
698 writeb(val, auxio_register); 779 writeb(val, auxio_register);
699 780
700 doing_pdma = 0; 781 doing_pdma = 0;
@@ -727,25 +808,23 @@ EXPORT_SYMBOL(probe_irq_off);
727static int retarget_one_irq(struct irqaction *p, int goal_cpu) 808static int retarget_one_irq(struct irqaction *p, int goal_cpu)
728{ 809{
729 struct ino_bucket *bucket = get_ino_in_irqaction(p) + ivector_table; 810 struct ino_bucket *bucket = get_ino_in_irqaction(p) + ivector_table;
730 unsigned long imap = bucket->imap;
731 unsigned int tid;
732 811
733 while (!cpu_online(goal_cpu)) { 812 while (!cpu_online(goal_cpu)) {
734 if (++goal_cpu >= NR_CPUS) 813 if (++goal_cpu >= NR_CPUS)
735 goal_cpu = 0; 814 goal_cpu = 0;
736 } 815 }
737 816
738 if (tlb_type == cheetah || tlb_type == cheetah_plus) { 817 if (tlb_type == hypervisor) {
739 tid = goal_cpu << 26; 818 unsigned int ino = __irq_ino(bucket);
740 tid &= IMAP_AID_SAFARI; 819
741 } else if (this_is_starfire == 0) { 820 sun4v_intr_settarget(ino, goal_cpu);
742 tid = goal_cpu << 26; 821 sun4v_intr_setenabled(ino, HV_INTR_ENABLED);
743 tid &= IMAP_TID_UPA;
744 } else { 822 } else {
745 tid = (starfire_translate(imap, goal_cpu) << 26); 823 unsigned long imap = bucket->imap;
746 tid &= IMAP_TID_UPA; 824 unsigned int tid = sun4u_compute_tid(imap, goal_cpu);
825
826 upa_writel(tid | IMAP_VALID, imap);
747 } 827 }
748 upa_writel(tid | IMAP_VALID, imap);
749 828
750 do { 829 do {
751 if (++goal_cpu >= NR_CPUS) 830 if (++goal_cpu >= NR_CPUS)
@@ -848,33 +927,114 @@ static void kill_prom_timer(void)
848 927
849void init_irqwork_curcpu(void) 928void init_irqwork_curcpu(void)
850{ 929{
851 register struct irq_work_struct *workp asm("o2");
852 register unsigned long tmp asm("o3");
853 int cpu = hard_smp_processor_id(); 930 int cpu = hard_smp_processor_id();
854 931
855 memset(__irq_work + cpu, 0, sizeof(*workp)); 932 memset(__irq_work + cpu, 0, sizeof(struct irq_work_struct));
856 933}
857 /* Make sure we are called with PSTATE_IE disabled. */ 934
858 __asm__ __volatile__("rdpr %%pstate, %0\n\t" 935static void __cpuinit register_one_mondo(unsigned long paddr, unsigned long type)
859 : "=r" (tmp)); 936{
860 if (tmp & PSTATE_IE) { 937 unsigned long num_entries = 128;
861 prom_printf("BUG: init_irqwork_curcpu() called with " 938 unsigned long status;
862 "PSTATE_IE enabled, bailing.\n"); 939
863 __asm__ __volatile__("mov %%i7, %0\n\t" 940 status = sun4v_cpu_qconf(type, paddr, num_entries);
864 : "=r" (tmp)); 941 if (status != HV_EOK) {
865 prom_printf("BUG: Called from %lx\n", tmp); 942 prom_printf("SUN4V: sun4v_cpu_qconf(%lu:%lx:%lu) failed, "
943 "err %lu\n", type, paddr, num_entries, status);
866 prom_halt(); 944 prom_halt();
867 } 945 }
946}
868 947
869 /* Set interrupt globals. */ 948static void __cpuinit sun4v_register_mondo_queues(int this_cpu)
870 workp = &__irq_work[cpu]; 949{
871 __asm__ __volatile__( 950 struct trap_per_cpu *tb = &trap_block[this_cpu];
872 "rdpr %%pstate, %0\n\t" 951
873 "wrpr %0, %1, %%pstate\n\t" 952 register_one_mondo(tb->cpu_mondo_pa, HV_CPU_QUEUE_CPU_MONDO);
874 "mov %2, %%g6\n\t" 953 register_one_mondo(tb->dev_mondo_pa, HV_CPU_QUEUE_DEVICE_MONDO);
875 "wrpr %0, 0x0, %%pstate\n\t" 954 register_one_mondo(tb->resum_mondo_pa, HV_CPU_QUEUE_RES_ERROR);
876 : "=&r" (tmp) 955 register_one_mondo(tb->nonresum_mondo_pa, HV_CPU_QUEUE_NONRES_ERROR);
877 : "i" (PSTATE_IG), "r" (workp)); 956}
957
958static void __cpuinit alloc_one_mondo(unsigned long *pa_ptr, int use_bootmem)
959{
960 void *page;
961
962 if (use_bootmem)
963 page = alloc_bootmem_low_pages(PAGE_SIZE);
964 else
965 page = (void *) get_zeroed_page(GFP_ATOMIC);
966
967 if (!page) {
968 prom_printf("SUN4V: Error, cannot allocate mondo queue.\n");
969 prom_halt();
970 }
971
972 *pa_ptr = __pa(page);
973}
974
975static void __cpuinit alloc_one_kbuf(unsigned long *pa_ptr, int use_bootmem)
976{
977 void *page;
978
979 if (use_bootmem)
980 page = alloc_bootmem_low_pages(PAGE_SIZE);
981 else
982 page = (void *) get_zeroed_page(GFP_ATOMIC);
983
984 if (!page) {
985 prom_printf("SUN4V: Error, cannot allocate kbuf page.\n");
986 prom_halt();
987 }
988
989 *pa_ptr = __pa(page);
990}
991
992static void __cpuinit init_cpu_send_mondo_info(struct trap_per_cpu *tb, int use_bootmem)
993{
994#ifdef CONFIG_SMP
995 void *page;
996
997 BUILD_BUG_ON((NR_CPUS * sizeof(u16)) > (PAGE_SIZE - 64));
998
999 if (use_bootmem)
1000 page = alloc_bootmem_low_pages(PAGE_SIZE);
1001 else
1002 page = (void *) get_zeroed_page(GFP_ATOMIC);
1003
1004 if (!page) {
1005 prom_printf("SUN4V: Error, cannot allocate cpu mondo page.\n");
1006 prom_halt();
1007 }
1008
1009 tb->cpu_mondo_block_pa = __pa(page);
1010 tb->cpu_list_pa = __pa(page + 64);
1011#endif
1012}
1013
1014/* Allocate and register the mondo and error queues for this cpu. */
1015void __cpuinit sun4v_init_mondo_queues(int use_bootmem, int cpu, int alloc, int load)
1016{
1017 struct trap_per_cpu *tb = &trap_block[cpu];
1018
1019 if (alloc) {
1020 alloc_one_mondo(&tb->cpu_mondo_pa, use_bootmem);
1021 alloc_one_mondo(&tb->dev_mondo_pa, use_bootmem);
1022 alloc_one_mondo(&tb->resum_mondo_pa, use_bootmem);
1023 alloc_one_kbuf(&tb->resum_kernel_buf_pa, use_bootmem);
1024 alloc_one_mondo(&tb->nonresum_mondo_pa, use_bootmem);
1025 alloc_one_kbuf(&tb->nonresum_kernel_buf_pa, use_bootmem);
1026
1027 init_cpu_send_mondo_info(tb, use_bootmem);
1028 }
1029
1030 if (load) {
1031 if (cpu != hard_smp_processor_id()) {
1032 prom_printf("SUN4V: init mondo on cpu %d not %d\n",
1033 cpu, hard_smp_processor_id());
1034 prom_halt();
1035 }
1036 sun4v_register_mondo_queues(cpu);
1037 }
878} 1038}
879 1039
880/* Only invoked on boot processor. */ 1040/* Only invoked on boot processor. */
@@ -884,6 +1044,9 @@ void __init init_IRQ(void)
884 kill_prom_timer(); 1044 kill_prom_timer();
885 memset(&ivector_table[0], 0, sizeof(ivector_table)); 1045 memset(&ivector_table[0], 0, sizeof(ivector_table));
886 1046
1047 if (tlb_type == hypervisor)
1048 sun4v_init_mondo_queues(1, hard_smp_processor_id(), 1, 1);
1049
887 /* We need to clear any IRQ's pending in the soft interrupt 1050 /* We need to clear any IRQ's pending in the soft interrupt
888 * registers, a spurious one could be left around from the 1051 * registers, a spurious one could be left around from the
889 * PROM timer which we just disabled. 1052 * PROM timer which we just disabled.
diff --git a/arch/sparc64/kernel/itlb_base.S b/arch/sparc64/kernel/itlb_base.S
deleted file mode 100644
index 4951ff8f6877..000000000000
--- a/arch/sparc64/kernel/itlb_base.S
+++ /dev/null
@@ -1,79 +0,0 @@
1/* $Id: itlb_base.S,v 1.12 2002/02/09 19:49:30 davem Exp $
2 * itlb_base.S: Front end to ITLB miss replacement strategy.
3 * This is included directly into the trap table.
4 *
5 * Copyright (C) 1996,1998 David S. Miller (davem@redhat.com)
6 * Copyright (C) 1997,1998 Jakub Jelinek (jj@ultra.linux.cz)
7 */
8
9#if PAGE_SHIFT == 13
10/*
11 * To compute vpte offset, we need to do ((addr >> 13) << 3),
12 * which can be optimized to (addr >> 10) if bits 10/11/12 can
13 * be guaranteed to be 0 ... mmu_context.h does guarantee this
14 * by only using 10 bits in the hwcontext value.
15 */
16#define CREATE_VPTE_OFFSET1(r1, r2) \
17 srax r1, 10, r2
18#define CREATE_VPTE_OFFSET2(r1, r2) nop
19#else /* PAGE_SHIFT */
20#define CREATE_VPTE_OFFSET1(r1, r2) \
21 srax r1, PAGE_SHIFT, r2
22#define CREATE_VPTE_OFFSET2(r1, r2) \
23 sllx r2, 3, r2
24#endif /* PAGE_SHIFT */
25
26
27/* Ways we can get here:
28 *
29 * 1) Nucleus instruction misses from module code.
30 * 2) All user instruction misses.
31 *
32 * All real page faults merge their code paths to the
33 * sparc64_realfault_common label below.
34 */
35
36/* ITLB ** ICACHE line 1: Quick user TLB misses */
37 mov TLB_SFSR, %g1
38 ldxa [%g1 + %g1] ASI_IMMU, %g4 ! Get TAG_ACCESS
39 CREATE_VPTE_OFFSET1(%g4, %g6) ! Create VPTE offset
40 CREATE_VPTE_OFFSET2(%g4, %g6) ! Create VPTE offset
41 ldxa [%g3 + %g6] ASI_P, %g5 ! Load VPTE
421: brgez,pn %g5, 3f ! Not valid, branch out
43 sethi %hi(_PAGE_EXEC), %g4 ! Delay-slot
44 andcc %g5, %g4, %g0 ! Executable?
45
46/* ITLB ** ICACHE line 2: Real faults */
47 be,pn %xcc, 3f ! Nope, branch.
48 nop ! Delay-slot
492: stxa %g5, [%g0] ASI_ITLB_DATA_IN ! Load PTE into TLB
50 retry ! Trap return
513: rdpr %pstate, %g4 ! Move into alt-globals
52 wrpr %g4, PSTATE_AG|PSTATE_MG, %pstate
53 rdpr %tpc, %g5 ! And load faulting VA
54 mov FAULT_CODE_ITLB, %g4 ! It was read from ITLB
55
56/* ITLB ** ICACHE line 3: Finish faults */
57sparc64_realfault_common: ! Called by dtlb_miss
58 stb %g4, [%g6 + TI_FAULT_CODE]
59 stx %g5, [%g6 + TI_FAULT_ADDR]
60 ba,pt %xcc, etrap ! Save state
611: rd %pc, %g7 ! ...
62 call do_sparc64_fault ! Call fault handler
63 add %sp, PTREGS_OFF, %o0! Compute pt_regs arg
64 ba,pt %xcc, rtrap_clr_l6 ! Restore cpu state
65 nop
66
67/* ITLB ** ICACHE line 4: Window fixups */
68winfix_trampoline:
69 rdpr %tpc, %g3 ! Prepare winfixup TNPC
70 or %g3, 0x7c, %g3 ! Compute branch offset
71 wrpr %g3, %tnpc ! Write it into TNPC
72 done ! Do it to it
73 nop
74 nop
75 nop
76 nop
77
78#undef CREATE_VPTE_OFFSET1
79#undef CREATE_VPTE_OFFSET2
diff --git a/arch/sparc64/kernel/itlb_miss.S b/arch/sparc64/kernel/itlb_miss.S
new file mode 100644
index 000000000000..ad46e2024f4b
--- /dev/null
+++ b/arch/sparc64/kernel/itlb_miss.S
@@ -0,0 +1,39 @@
1/* ITLB ** ICACHE line 1: Context 0 check and TSB load */
2 ldxa [%g0] ASI_IMMU_TSB_8KB_PTR, %g1 ! Get TSB 8K pointer
3 ldxa [%g0] ASI_IMMU, %g6 ! Get TAG TARGET
4 srlx %g6, 48, %g5 ! Get context
5 sllx %g6, 22, %g6 ! Zero out context
6 brz,pn %g5, kvmap_itlb ! Context 0 processing
7 srlx %g6, 22, %g6 ! Delay slot
8 TSB_LOAD_QUAD(%g1, %g4) ! Load TSB entry
9 cmp %g4, %g6 ! Compare TAG
10
11/* ITLB ** ICACHE line 2: TSB compare and TLB load */
12 bne,pn %xcc, tsb_miss_itlb ! Miss
13 mov FAULT_CODE_ITLB, %g3
14 andcc %g5, _PAGE_EXEC_4U, %g0 ! Executable?
15 be,pn %xcc, tsb_do_fault
16 nop ! Delay slot, fill me
17 stxa %g5, [%g0] ASI_ITLB_DATA_IN ! Load TLB
18 retry ! Trap done
19 nop
20
21/* ITLB ** ICACHE line 3: */
22 nop
23 nop
24 nop
25 nop
26 nop
27 nop
28 nop
29 nop
30
31/* ITLB ** ICACHE line 4: */
32 nop
33 nop
34 nop
35 nop
36 nop
37 nop
38 nop
39 nop
diff --git a/arch/sparc64/kernel/kprobes.c b/arch/sparc64/kernel/kprobes.c
index b9a9ce70e55c..ffc7309e9f22 100644
--- a/arch/sparc64/kernel/kprobes.c
+++ b/arch/sparc64/kernel/kprobes.c
@@ -6,9 +6,11 @@
6#include <linux/config.h> 6#include <linux/config.h>
7#include <linux/kernel.h> 7#include <linux/kernel.h>
8#include <linux/kprobes.h> 8#include <linux/kprobes.h>
9#include <linux/module.h>
9#include <asm/kdebug.h> 10#include <asm/kdebug.h>
10#include <asm/signal.h> 11#include <asm/signal.h>
11#include <asm/cacheflush.h> 12#include <asm/cacheflush.h>
13#include <asm/uaccess.h>
12 14
13/* We do not have hardware single-stepping on sparc64. 15/* We do not have hardware single-stepping on sparc64.
14 * So we implement software single-stepping with breakpoint 16 * So we implement software single-stepping with breakpoint
@@ -302,16 +304,68 @@ static inline int kprobe_fault_handler(struct pt_regs *regs, int trapnr)
302{ 304{
303 struct kprobe *cur = kprobe_running(); 305 struct kprobe *cur = kprobe_running();
304 struct kprobe_ctlblk *kcb = get_kprobe_ctlblk(); 306 struct kprobe_ctlblk *kcb = get_kprobe_ctlblk();
307 const struct exception_table_entry *entry;
308
309 switch(kcb->kprobe_status) {
310 case KPROBE_HIT_SS:
311 case KPROBE_REENTER:
312 /*
313 * We are here because the instruction being single
314 * stepped caused a page fault. We reset the current
315 * kprobe and the tpc points back to the probe address
316 * and allow the page fault handler to continue as a
317 * normal page fault.
318 */
319 regs->tpc = (unsigned long)cur->addr;
320 regs->tnpc = kcb->kprobe_orig_tnpc;
321 regs->tstate = ((regs->tstate & ~TSTATE_PIL) |
322 kcb->kprobe_orig_tstate_pil);
323 if (kcb->kprobe_status == KPROBE_REENTER)
324 restore_previous_kprobe(kcb);
325 else
326 reset_current_kprobe();
327 preempt_enable_no_resched();
328 break;
329 case KPROBE_HIT_ACTIVE:
330 case KPROBE_HIT_SSDONE:
331 /*
332 * We increment the nmissed count for accounting,
333 * we can also use npre/npostfault count for accouting
334 * these specific fault cases.
335 */
336 kprobes_inc_nmissed_count(cur);
337
338 /*
339 * We come here because instructions in the pre/post
340 * handler caused the page_fault, this could happen
341 * if handler tries to access user space by
342 * copy_from_user(), get_user() etc. Let the
343 * user-specified handler try to fix it first.
344 */
345 if (cur->fault_handler && cur->fault_handler(cur, regs, trapnr))
346 return 1;
305 347
306 if (cur->fault_handler && cur->fault_handler(cur, regs, trapnr)) 348 /*
307 return 1; 349 * In case the user-specified fault handler returned
350 * zero, try to fix up.
351 */
308 352
309 if (kcb->kprobe_status & KPROBE_HIT_SS) { 353 entry = search_exception_tables(regs->tpc);
310 resume_execution(cur, regs, kcb); 354 if (entry) {
355 regs->tpc = entry->fixup;
356 regs->tnpc = regs->tpc + 4;
357 return 1;
358 }
311 359
312 reset_current_kprobe(); 360 /*
313 preempt_enable_no_resched(); 361 * fixup_exception() could not handle it,
362 * Let do_page_fault() fix it.
363 */
364 break;
365 default:
366 break;
314 } 367 }
368
315 return 0; 369 return 0;
316} 370}
317 371
@@ -324,6 +378,9 @@ int __kprobes kprobe_exceptions_notify(struct notifier_block *self,
324 struct die_args *args = (struct die_args *)data; 378 struct die_args *args = (struct die_args *)data;
325 int ret = NOTIFY_DONE; 379 int ret = NOTIFY_DONE;
326 380
381 if (args->regs && user_mode(args->regs))
382 return ret;
383
327 switch (val) { 384 switch (val) {
328 case DIE_DEBUG: 385 case DIE_DEBUG:
329 if (kprobe_handler(args->regs)) 386 if (kprobe_handler(args->regs))
diff --git a/arch/sparc64/kernel/ktlb.S b/arch/sparc64/kernel/ktlb.S
index d9244d3c9f73..31da1e564c95 100644
--- a/arch/sparc64/kernel/ktlb.S
+++ b/arch/sparc64/kernel/ktlb.S
@@ -4,191 +4,276 @@
4 * Copyright (C) 1996 Eddie C. Dost (ecd@brainaid.de) 4 * Copyright (C) 1996 Eddie C. Dost (ecd@brainaid.de)
5 * Copyright (C) 1996 Miguel de Icaza (miguel@nuclecu.unam.mx) 5 * Copyright (C) 1996 Miguel de Icaza (miguel@nuclecu.unam.mx)
6 * Copyright (C) 1996,98,99 Jakub Jelinek (jj@sunsite.mff.cuni.cz) 6 * Copyright (C) 1996,98,99 Jakub Jelinek (jj@sunsite.mff.cuni.cz)
7*/ 7 */
8 8
9#include <linux/config.h> 9#include <linux/config.h>
10#include <asm/head.h> 10#include <asm/head.h>
11#include <asm/asi.h> 11#include <asm/asi.h>
12#include <asm/page.h> 12#include <asm/page.h>
13#include <asm/pgtable.h> 13#include <asm/pgtable.h>
14#include <asm/tsb.h>
14 15
15 .text 16 .text
16 .align 32 17 .align 32
17 18
18/* 19kvmap_itlb:
19 * On a second level vpte miss, check whether the original fault is to the OBP 20 /* g6: TAG TARGET */
20 * range (note that this is only possible for instruction miss, data misses to 21 mov TLB_TAG_ACCESS, %g4
21 * obp range do not use vpte). If so, go back directly to the faulting address. 22 ldxa [%g4] ASI_IMMU, %g4
22 * This is because we want to read the tpc, otherwise we have no way of knowing 23
23 * the 8k aligned faulting address if we are using >8k kernel pagesize. This 24 /* sun4v_itlb_miss branches here with the missing virtual
24 * also ensures no vpte range addresses are dropped into tlb while obp is 25 * address already loaded into %g4
25 * executing (see inherit_locked_prom_mappings() rant).
26 */
27sparc64_vpte_nucleus:
28 /* Note that kvmap below has verified that the address is
29 * in the range MODULES_VADDR --> VMALLOC_END already. So
30 * here we need only check if it is an OBP address or not.
31 */ 26 */
27kvmap_itlb_4v:
28
29kvmap_itlb_nonlinear:
30 /* Catch kernel NULL pointer calls. */
31 sethi %hi(PAGE_SIZE), %g5
32 cmp %g4, %g5
33 bleu,pn %xcc, kvmap_dtlb_longpath
34 nop
35
36 KERN_TSB_LOOKUP_TL1(%g4, %g6, %g5, %g1, %g2, %g3, kvmap_itlb_load)
37
38kvmap_itlb_tsb_miss:
32 sethi %hi(LOW_OBP_ADDRESS), %g5 39 sethi %hi(LOW_OBP_ADDRESS), %g5
33 cmp %g4, %g5 40 cmp %g4, %g5
34 blu,pn %xcc, kern_vpte 41 blu,pn %xcc, kvmap_itlb_vmalloc_addr
35 mov 0x1, %g5 42 mov 0x1, %g5
36 sllx %g5, 32, %g5 43 sllx %g5, 32, %g5
37 cmp %g4, %g5 44 cmp %g4, %g5
38 blu,pn %xcc, vpte_insn_obp 45 blu,pn %xcc, kvmap_itlb_obp
39 nop 46 nop
40 47
41 /* These two instructions are patched by paginig_init(). */ 48kvmap_itlb_vmalloc_addr:
42kern_vpte: 49 KERN_PGTABLE_WALK(%g4, %g5, %g2, kvmap_itlb_longpath)
43 sethi %hi(swapper_pgd_zero), %g5
44 lduw [%g5 + %lo(swapper_pgd_zero)], %g5
45 50
46 /* With kernel PGD in %g5, branch back into dtlb_backend. */ 51 KTSB_LOCK_TAG(%g1, %g2, %g7)
47 ba,pt %xcc, sparc64_kpte_continue
48 andn %g1, 0x3, %g1 /* Finish PMD offset adjustment. */
49 52
50vpte_noent: 53 /* Load and check PTE. */
51 /* Restore previous TAG_ACCESS, %g5 is zero, and we will 54 ldxa [%g5] ASI_PHYS_USE_EC, %g5
52 * skip over the trap instruction so that the top level 55 mov 1, %g7
53 * TLB miss handler will thing this %g5 value is just an 56 sllx %g7, TSB_TAG_INVALID_BIT, %g7
54 * invalid PTE, thus branching to full fault processing. 57 brgez,a,pn %g5, kvmap_itlb_longpath
55 */ 58 KTSB_STORE(%g1, %g7)
56 mov TLB_SFSR, %g1 59
57 stxa %g4, [%g1 + %g1] ASI_DMMU 60 KTSB_WRITE(%g1, %g5, %g6)
58 done 61
59 62 /* fallthrough to TLB load */
60vpte_insn_obp:
61 /* Behave as if we are at TL0. */
62 wrpr %g0, 1, %tl
63 rdpr %tpc, %g4 /* Find original faulting iaddr */
64 srlx %g4, 13, %g4 /* Throw out context bits */
65 sllx %g4, 13, %g4 /* g4 has vpn + ctx0 now */
66
67 /* Restore previous TAG_ACCESS. */
68 mov TLB_SFSR, %g1
69 stxa %g4, [%g1 + %g1] ASI_IMMU
70
71 sethi %hi(prom_trans), %g5
72 or %g5, %lo(prom_trans), %g5
73
741: ldx [%g5 + 0x00], %g6 ! base
75 brz,a,pn %g6, longpath ! no more entries, fail
76 mov TLB_SFSR, %g1 ! and restore %g1
77 ldx [%g5 + 0x08], %g1 ! len
78 add %g6, %g1, %g1 ! end
79 cmp %g6, %g4
80 bgu,pt %xcc, 2f
81 cmp %g4, %g1
82 bgeu,pt %xcc, 2f
83 ldx [%g5 + 0x10], %g1 ! PTE
84
85 /* TLB load, restore %g1, and return from trap. */
86 sub %g4, %g6, %g6
87 add %g1, %g6, %g5
88 mov TLB_SFSR, %g1
89 stxa %g5, [%g0] ASI_ITLB_DATA_IN
90 retry
91 63
922: ba,pt %xcc, 1b 64kvmap_itlb_load:
93 add %g5, (3 * 8), %g5 ! next entry 65
94 66661: stxa %g5, [%g0] ASI_ITLB_DATA_IN
95kvmap_do_obp:
96 sethi %hi(prom_trans), %g5
97 or %g5, %lo(prom_trans), %g5
98 srlx %g4, 13, %g4
99 sllx %g4, 13, %g4
100
1011: ldx [%g5 + 0x00], %g6 ! base
102 brz,a,pn %g6, longpath ! no more entries, fail
103 mov TLB_SFSR, %g1 ! and restore %g1
104 ldx [%g5 + 0x08], %g1 ! len
105 add %g6, %g1, %g1 ! end
106 cmp %g6, %g4
107 bgu,pt %xcc, 2f
108 cmp %g4, %g1
109 bgeu,pt %xcc, 2f
110 ldx [%g5 + 0x10], %g1 ! PTE
111
112 /* TLB load, restore %g1, and return from trap. */
113 sub %g4, %g6, %g6
114 add %g1, %g6, %g5
115 mov TLB_SFSR, %g1
116 stxa %g5, [%g0] ASI_DTLB_DATA_IN
117 retry 67 retry
68 .section .sun4v_2insn_patch, "ax"
69 .word 661b
70 nop
71 nop
72 .previous
73
74 /* For sun4v the ASI_ITLB_DATA_IN store and the retry
75 * instruction get nop'd out and we get here to branch
76 * to the sun4v tlb load code. The registers are setup
77 * as follows:
78 *
79 * %g4: vaddr
80 * %g5: PTE
81 * %g6: TAG
82 *
83 * The sun4v TLB load wants the PTE in %g3 so we fix that
84 * up here.
85 */
86 ba,pt %xcc, sun4v_itlb_load
87 mov %g5, %g3
118 88
1192: ba,pt %xcc, 1b 89kvmap_itlb_longpath:
120 add %g5, (3 * 8), %g5 ! next entry 90
91661: rdpr %pstate, %g5
92 wrpr %g5, PSTATE_AG | PSTATE_MG, %pstate
93 .section .sun4v_2insn_patch, "ax"
94 .word 661b
95 SET_GL(1)
96 nop
97 .previous
98
99 rdpr %tpc, %g5
100 ba,pt %xcc, sparc64_realfault_common
101 mov FAULT_CODE_ITLB, %g4
102
103kvmap_itlb_obp:
104 OBP_TRANS_LOOKUP(%g4, %g5, %g2, %g3, kvmap_itlb_longpath)
105
106 KTSB_LOCK_TAG(%g1, %g2, %g7)
107
108 KTSB_WRITE(%g1, %g5, %g6)
109
110 ba,pt %xcc, kvmap_itlb_load
111 nop
112
113kvmap_dtlb_obp:
114 OBP_TRANS_LOOKUP(%g4, %g5, %g2, %g3, kvmap_dtlb_longpath)
115
116 KTSB_LOCK_TAG(%g1, %g2, %g7)
117
118 KTSB_WRITE(%g1, %g5, %g6)
119
120 ba,pt %xcc, kvmap_dtlb_load
121 nop
121 122
122/*
123 * On a first level data miss, check whether this is to the OBP range (note
124 * that such accesses can be made by prom, as well as by kernel using
125 * prom_getproperty on "address"), and if so, do not use vpte access ...
126 * rather, use information saved during inherit_prom_mappings() using 8k
127 * pagesize.
128 */
129 .align 32 123 .align 32
130kvmap: 124kvmap_dtlb_tsb4m_load:
131 brgez,pn %g4, kvmap_nonlinear 125 KTSB_LOCK_TAG(%g1, %g2, %g7)
126 KTSB_WRITE(%g1, %g5, %g6)
127 ba,pt %xcc, kvmap_dtlb_load
132 nop 128 nop
133 129
134#ifdef CONFIG_DEBUG_PAGEALLOC 130kvmap_dtlb:
131 /* %g6: TAG TARGET */
132 mov TLB_TAG_ACCESS, %g4
133 ldxa [%g4] ASI_DMMU, %g4
134
135 /* sun4v_dtlb_miss branches here with the missing virtual
136 * address already loaded into %g4
137 */
138kvmap_dtlb_4v:
139 brgez,pn %g4, kvmap_dtlb_nonlinear
140 nop
141
142 /* Correct TAG_TARGET is already in %g6, check 4mb TSB. */
143 KERN_TSB4M_LOOKUP_TL1(%g6, %g5, %g1, %g2, %g3, kvmap_dtlb_load)
144
145 /* TSB entry address left in %g1, lookup linear PTE.
146 * Must preserve %g1 and %g6 (TAG).
147 */
148kvmap_dtlb_tsb4m_miss:
149 sethi %hi(kpte_linear_bitmap), %g2
150 or %g2, %lo(kpte_linear_bitmap), %g2
151
152 /* Clear the PAGE_OFFSET top virtual bits, then shift
153 * down to get a 256MB physical address index.
154 */
155 sllx %g4, 21, %g5
156 mov 1, %g7
157 srlx %g5, 21 + 28, %g5
158
159 /* Don't try this at home kids... this depends upon srlx
160 * only taking the low 6 bits of the shift count in %g5.
161 */
162 sllx %g7, %g5, %g7
163
164 /* Divide by 64 to get the offset into the bitmask. */
165 srlx %g5, 6, %g5
166 sllx %g5, 3, %g5
167
168 /* kern_linear_pte_xor[((mask & bit) ? 1 : 0)] */
169 ldx [%g2 + %g5], %g2
170 andcc %g2, %g7, %g0
171 sethi %hi(kern_linear_pte_xor), %g5
172 or %g5, %lo(kern_linear_pte_xor), %g5
173 bne,a,pt %xcc, 1f
174 add %g5, 8, %g5
175
1761: ldx [%g5], %g2
177
135 .globl kvmap_linear_patch 178 .globl kvmap_linear_patch
136kvmap_linear_patch: 179kvmap_linear_patch:
137#endif 180 ba,pt %xcc, kvmap_dtlb_tsb4m_load
138 ba,pt %xcc, kvmap_load
139 xor %g2, %g4, %g5 181 xor %g2, %g4, %g5
140 182
141#ifdef CONFIG_DEBUG_PAGEALLOC 183kvmap_dtlb_vmalloc_addr:
142 sethi %hi(swapper_pg_dir), %g5 184 KERN_PGTABLE_WALK(%g4, %g5, %g2, kvmap_dtlb_longpath)
143 or %g5, %lo(swapper_pg_dir), %g5 185
144 sllx %g4, 64 - (PGDIR_SHIFT + PGDIR_BITS), %g6 186 KTSB_LOCK_TAG(%g1, %g2, %g7)
145 srlx %g6, 64 - PAGE_SHIFT, %g6 187
146 andn %g6, 0x3, %g6 188 /* Load and check PTE. */
147 lduw [%g5 + %g6], %g5 189 ldxa [%g5] ASI_PHYS_USE_EC, %g5
148 brz,pn %g5, longpath 190 mov 1, %g7
149 sllx %g4, 64 - (PMD_SHIFT + PMD_BITS), %g6 191 sllx %g7, TSB_TAG_INVALID_BIT, %g7
150 srlx %g6, 64 - PAGE_SHIFT, %g6 192 brgez,a,pn %g5, kvmap_dtlb_longpath
151 sllx %g5, 11, %g5 193 KTSB_STORE(%g1, %g7)
152 andn %g6, 0x3, %g6 194
153 lduwa [%g5 + %g6] ASI_PHYS_USE_EC, %g5 195 KTSB_WRITE(%g1, %g5, %g6)
154 brz,pn %g5, longpath 196
155 sllx %g4, 64 - PMD_SHIFT, %g6 197 /* fallthrough to TLB load */
156 srlx %g6, 64 - PAGE_SHIFT, %g6 198
157 sllx %g5, 11, %g5 199kvmap_dtlb_load:
158 andn %g6, 0x7, %g6 200
159 ldxa [%g5 + %g6] ASI_PHYS_USE_EC, %g5 201661: stxa %g5, [%g0] ASI_DTLB_DATA_IN ! Reload TLB
160 brz,pn %g5, longpath 202 retry
203 .section .sun4v_2insn_patch, "ax"
204 .word 661b
205 nop
206 nop
207 .previous
208
209 /* For sun4v the ASI_DTLB_DATA_IN store and the retry
210 * instruction get nop'd out and we get here to branch
211 * to the sun4v tlb load code. The registers are setup
212 * as follows:
213 *
214 * %g4: vaddr
215 * %g5: PTE
216 * %g6: TAG
217 *
218 * The sun4v TLB load wants the PTE in %g3 so we fix that
219 * up here.
220 */
221 ba,pt %xcc, sun4v_dtlb_load
222 mov %g5, %g3
223
224kvmap_dtlb_nonlinear:
225 /* Catch kernel NULL pointer derefs. */
226 sethi %hi(PAGE_SIZE), %g5
227 cmp %g4, %g5
228 bleu,pn %xcc, kvmap_dtlb_longpath
161 nop 229 nop
162 ba,a,pt %xcc, kvmap_load
163#endif
164 230
165kvmap_nonlinear: 231 KERN_TSB_LOOKUP_TL1(%g4, %g6, %g5, %g1, %g2, %g3, kvmap_dtlb_load)
232
233kvmap_dtlb_tsbmiss:
166 sethi %hi(MODULES_VADDR), %g5 234 sethi %hi(MODULES_VADDR), %g5
167 cmp %g4, %g5 235 cmp %g4, %g5
168 blu,pn %xcc, longpath 236 blu,pn %xcc, kvmap_dtlb_longpath
169 mov (VMALLOC_END >> 24), %g5 237 mov (VMALLOC_END >> 24), %g5
170 sllx %g5, 24, %g5 238 sllx %g5, 24, %g5
171 cmp %g4, %g5 239 cmp %g4, %g5
172 bgeu,pn %xcc, longpath 240 bgeu,pn %xcc, kvmap_dtlb_longpath
173 nop 241 nop
174 242
175kvmap_check_obp: 243kvmap_check_obp:
176 sethi %hi(LOW_OBP_ADDRESS), %g5 244 sethi %hi(LOW_OBP_ADDRESS), %g5
177 cmp %g4, %g5 245 cmp %g4, %g5
178 blu,pn %xcc, kvmap_vmalloc_addr 246 blu,pn %xcc, kvmap_dtlb_vmalloc_addr
179 mov 0x1, %g5 247 mov 0x1, %g5
180 sllx %g5, 32, %g5 248 sllx %g5, 32, %g5
181 cmp %g4, %g5 249 cmp %g4, %g5
182 blu,pn %xcc, kvmap_do_obp 250 blu,pn %xcc, kvmap_dtlb_obp
183 nop 251 nop
184 252 ba,pt %xcc, kvmap_dtlb_vmalloc_addr
185kvmap_vmalloc_addr:
186 /* If we get here, a vmalloc addr was accessed, load kernel VPTE. */
187 ldxa [%g3 + %g6] ASI_N, %g5
188 brgez,pn %g5, longpath
189 nop 253 nop
190 254
191kvmap_load: 255kvmap_dtlb_longpath:
192 /* PTE is valid, load into TLB and return from trap. */ 256
193 stxa %g5, [%g0] ASI_DTLB_DATA_IN ! Reload TLB 257661: rdpr %pstate, %g5
194 retry 258 wrpr %g5, PSTATE_AG | PSTATE_MG, %pstate
259 .section .sun4v_2insn_patch, "ax"
260 .word 661b
261 SET_GL(1)
262 ldxa [%g0] ASI_SCRATCHPAD, %g5
263 .previous
264
265 rdpr %tl, %g3
266 cmp %g3, 1
267
268661: mov TLB_TAG_ACCESS, %g4
269 ldxa [%g4] ASI_DMMU, %g5
270 .section .sun4v_2insn_patch, "ax"
271 .word 661b
272 ldx [%g5 + HV_FAULT_D_ADDR_OFFSET], %g5
273 nop
274 .previous
275
276 be,pt %xcc, sparc64_realfault_common
277 mov FAULT_CODE_DTLB, %g4
278 ba,pt %xcc, winfix_trampoline
279 nop
diff --git a/arch/sparc64/kernel/pci.c b/arch/sparc64/kernel/pci.c
index 2ff7c32ab0ce..dfccff29e182 100644
--- a/arch/sparc64/kernel/pci.c
+++ b/arch/sparc64/kernel/pci.c
@@ -188,6 +188,7 @@ extern void psycho_init(int, char *);
188extern void schizo_init(int, char *); 188extern void schizo_init(int, char *);
189extern void schizo_plus_init(int, char *); 189extern void schizo_plus_init(int, char *);
190extern void tomatillo_init(int, char *); 190extern void tomatillo_init(int, char *);
191extern void sun4v_pci_init(int, char *);
191 192
192static struct { 193static struct {
193 char *model_name; 194 char *model_name;
@@ -204,6 +205,7 @@ static struct {
204 { "pci108e,8002", schizo_plus_init }, 205 { "pci108e,8002", schizo_plus_init },
205 { "SUNW,tomatillo", tomatillo_init }, 206 { "SUNW,tomatillo", tomatillo_init },
206 { "pci108e,a801", tomatillo_init }, 207 { "pci108e,a801", tomatillo_init },
208 { "SUNW,sun4v-pci", sun4v_pci_init },
207}; 209};
208#define PCI_NUM_CONTROLLER_TYPES (sizeof(pci_controller_table) / \ 210#define PCI_NUM_CONTROLLER_TYPES (sizeof(pci_controller_table) / \
209 sizeof(pci_controller_table[0])) 211 sizeof(pci_controller_table[0]))
@@ -283,6 +285,12 @@ int __init pcic_present(void)
283 return pci_controller_scan(pci_is_controller); 285 return pci_controller_scan(pci_is_controller);
284} 286}
285 287
288struct pci_iommu_ops *pci_iommu_ops;
289EXPORT_SYMBOL(pci_iommu_ops);
290
291extern struct pci_iommu_ops pci_sun4u_iommu_ops,
292 pci_sun4v_iommu_ops;
293
286/* Find each controller in the system, attach and initialize 294/* Find each controller in the system, attach and initialize
287 * software state structure for each and link into the 295 * software state structure for each and link into the
288 * pci_controller_root. Setup the controller enough such 296 * pci_controller_root. Setup the controller enough such
@@ -290,6 +298,11 @@ int __init pcic_present(void)
290 */ 298 */
291static void __init pci_controller_probe(void) 299static void __init pci_controller_probe(void)
292{ 300{
301 if (tlb_type == hypervisor)
302 pci_iommu_ops = &pci_sun4v_iommu_ops;
303 else
304 pci_iommu_ops = &pci_sun4u_iommu_ops;
305
293 printk("PCI: Probing for controllers.\n"); 306 printk("PCI: Probing for controllers.\n");
294 307
295 pci_controller_scan(pci_controller_init); 308 pci_controller_scan(pci_controller_init);
@@ -643,6 +656,7 @@ int pci_mmap_page_range(struct pci_dev *dev, struct vm_area_struct *vma,
643 __pci_mmap_set_flags(dev, vma, mmap_state); 656 __pci_mmap_set_flags(dev, vma, mmap_state);
644 __pci_mmap_set_pgprot(dev, vma, mmap_state); 657 __pci_mmap_set_pgprot(dev, vma, mmap_state);
645 658
659 vma->vm_page_prot = pgprot_noncached(vma->vm_page_prot);
646 ret = io_remap_pfn_range(vma, vma->vm_start, 660 ret = io_remap_pfn_range(vma, vma->vm_start,
647 vma->vm_pgoff, 661 vma->vm_pgoff,
648 vma->vm_end - vma->vm_start, 662 vma->vm_end - vma->vm_start,
@@ -650,7 +664,6 @@ int pci_mmap_page_range(struct pci_dev *dev, struct vm_area_struct *vma,
650 if (ret) 664 if (ret)
651 return ret; 665 return ret;
652 666
653 vma->vm_flags |= VM_IO;
654 return 0; 667 return 0;
655} 668}
656 669
diff --git a/arch/sparc64/kernel/pci_common.c b/arch/sparc64/kernel/pci_common.c
index 58310aacea28..33dedb1aacd4 100644
--- a/arch/sparc64/kernel/pci_common.c
+++ b/arch/sparc64/kernel/pci_common.c
@@ -39,6 +39,8 @@ static int __init find_device_prom_node(struct pci_pbm_info *pbm,
39{ 39{
40 int node; 40 int node;
41 41
42 *nregs = 0;
43
42 /* 44 /*
43 * Return the PBM's PROM node in case we are it's PCI device, 45 * Return the PBM's PROM node in case we are it's PCI device,
44 * as the PBM's reg property is different to standard PCI reg 46 * as the PBM's reg property is different to standard PCI reg
@@ -51,10 +53,8 @@ static int __init find_device_prom_node(struct pci_pbm_info *pbm,
51 pdev->device == PCI_DEVICE_ID_SUN_SCHIZO || 53 pdev->device == PCI_DEVICE_ID_SUN_SCHIZO ||
52 pdev->device == PCI_DEVICE_ID_SUN_TOMATILLO || 54 pdev->device == PCI_DEVICE_ID_SUN_TOMATILLO ||
53 pdev->device == PCI_DEVICE_ID_SUN_SABRE || 55 pdev->device == PCI_DEVICE_ID_SUN_SABRE ||
54 pdev->device == PCI_DEVICE_ID_SUN_HUMMINGBIRD)) { 56 pdev->device == PCI_DEVICE_ID_SUN_HUMMINGBIRD))
55 *nregs = 0;
56 return bus_prom_node; 57 return bus_prom_node;
57 }
58 58
59 node = prom_getchild(bus_prom_node); 59 node = prom_getchild(bus_prom_node);
60 while (node != 0) { 60 while (node != 0) {
@@ -541,135 +541,183 @@ void __init pci_assign_unassigned(struct pci_pbm_info *pbm,
541 pci_assign_unassigned(pbm, bus); 541 pci_assign_unassigned(pbm, bus);
542} 542}
543 543
544static int __init pci_intmap_match(struct pci_dev *pdev, unsigned int *interrupt) 544static inline unsigned int pci_slot_swivel(struct pci_pbm_info *pbm,
545 struct pci_dev *toplevel_pdev,
546 struct pci_dev *pdev,
547 unsigned int interrupt)
545{ 548{
546 struct linux_prom_pci_intmap bridge_local_intmap[PROM_PCIIMAP_MAX], *intmap; 549 unsigned int ret;
547 struct linux_prom_pci_intmask bridge_local_intmask, *intmask;
548 struct pcidev_cookie *dev_pcp = pdev->sysdata;
549 struct pci_pbm_info *pbm = dev_pcp->pbm;
550 struct linux_prom_pci_registers *pregs = dev_pcp->prom_regs;
551 unsigned int hi, mid, lo, irq;
552 int i, num_intmap, map_slot;
553 550
554 intmap = &pbm->pbm_intmap[0]; 551 if (unlikely(interrupt < 1 || interrupt > 4)) {
555 intmask = &pbm->pbm_intmask; 552 printk("%s: Device %s interrupt value of %u is strange.\n",
556 num_intmap = pbm->num_pbm_intmap; 553 pbm->name, pci_name(pdev), interrupt);
557 map_slot = 0; 554 return interrupt;
555 }
558 556
559 /* If we are underneath a PCI bridge, use PROM register 557 ret = ((interrupt - 1 + (PCI_SLOT(pdev->devfn) & 3)) & 3) + 1;
560 * property of the parent bridge which is closest to 558
561 * the PBM. 559 printk("%s: %s IRQ Swivel %s [%x:%x] -> [%x]\n",
562 * 560 pbm->name, pci_name(toplevel_pdev), pci_name(pdev),
563 * However if that parent bridge has interrupt map/mask 561 interrupt, PCI_SLOT(pdev->devfn), ret);
564 * properties of its own we use the PROM register property 562
565 * of the next child device on the path to PDEV. 563 return ret;
566 * 564}
567 * In detail the two cases are (note that the 'X' below is the 565
568 * 'next child on the path to PDEV' mentioned above): 566static inline unsigned int pci_apply_intmap(struct pci_pbm_info *pbm,
569 * 567 struct pci_dev *toplevel_pdev,
570 * 1) PBM --> PCI bus lacking int{map,mask} --> X ... PDEV 568 struct pci_dev *pbus,
571 * 569 struct pci_dev *pdev,
572 * Here we use regs of 'PCI bus' device. 570 unsigned int interrupt,
573 * 571 unsigned int *cnode)
574 * 2) PBM --> PCI bus with int{map,mask} --> X ... PDEV 572{
575 * 573 struct linux_prom_pci_intmap imap[PROM_PCIIMAP_MAX];
576 * Here we use regs of 'X'. Note that X can be PDEV. 574 struct linux_prom_pci_intmask imask;
577 */ 575 struct pcidev_cookie *pbus_pcp = pbus->sysdata;
578 if (pdev->bus->number != pbm->pci_first_busno) { 576 struct pcidev_cookie *pdev_pcp = pdev->sysdata;
579 struct pcidev_cookie *bus_pcp, *regs_pcp; 577 struct linux_prom_pci_registers *pregs = pdev_pcp->prom_regs;
580 struct pci_dev *bus_dev, *regs_dev; 578 int plen, num_imap, i;
581 int plen; 579 unsigned int hi, mid, lo, irq, orig_interrupt;
580
581 *cnode = pbus_pcp->prom_node;
582
583 plen = prom_getproperty(pbus_pcp->prom_node, "interrupt-map",
584 (char *) &imap[0], sizeof(imap));
585 if (plen <= 0 ||
586 (plen % sizeof(struct linux_prom_pci_intmap)) != 0) {
587 printk("%s: Device %s interrupt-map has bad len %d\n",
588 pbm->name, pci_name(pbus), plen);
589 goto no_intmap;
590 }
591 num_imap = plen / sizeof(struct linux_prom_pci_intmap);
592
593 plen = prom_getproperty(pbus_pcp->prom_node, "interrupt-map-mask",
594 (char *) &imask, sizeof(imask));
595 if (plen <= 0 ||
596 (plen % sizeof(struct linux_prom_pci_intmask)) != 0) {
597 printk("%s: Device %s interrupt-map-mask has bad len %d\n",
598 pbm->name, pci_name(pbus), plen);
599 goto no_intmap;
600 }
601
602 orig_interrupt = interrupt;
582 603
583 bus_dev = pdev->bus->self; 604 hi = pregs->phys_hi & imask.phys_hi;
584 regs_dev = pdev; 605 mid = pregs->phys_mid & imask.phys_mid;
606 lo = pregs->phys_lo & imask.phys_lo;
607 irq = interrupt & imask.interrupt;
585 608
586 while (bus_dev->bus && 609 for (i = 0; i < num_imap; i++) {
587 bus_dev->bus->number != pbm->pci_first_busno) { 610 if (imap[i].phys_hi == hi &&
588 regs_dev = bus_dev; 611 imap[i].phys_mid == mid &&
589 bus_dev = bus_dev->bus->self; 612 imap[i].phys_lo == lo &&
613 imap[i].interrupt == irq) {
614 *cnode = imap[i].cnode;
615 interrupt = imap[i].cinterrupt;
590 } 616 }
617 }
591 618
592 regs_pcp = regs_dev->sysdata; 619 printk("%s: %s MAP BUS %s DEV %s [%x] -> [%x]\n",
593 pregs = regs_pcp->prom_regs; 620 pbm->name, pci_name(toplevel_pdev),
621 pci_name(pbus), pci_name(pdev),
622 orig_interrupt, interrupt);
594 623
595 bus_pcp = bus_dev->sysdata; 624no_intmap:
625 return interrupt;
626}
596 627
597 /* But if the PCI bridge has it's own interrupt map 628/* For each PCI bus on the way to the root:
598 * and mask properties, use that and the regs of the 629 * 1) If it has an interrupt-map property, apply it.
599 * PCI entity at the next level down on the path to the 630 * 2) Else, swivel the interrupt number based upon the PCI device number.
600 * device. 631 *
601 */ 632 * Return the "IRQ controller" node. If this is the PBM's device node,
602 plen = prom_getproperty(bus_pcp->prom_node, "interrupt-map", 633 * all interrupt translations are complete, else we should use that node's
603 (char *) &bridge_local_intmap[0], 634 * "reg" property to apply the PBM's "interrupt-{map,mask}" to the interrupt.
604 sizeof(bridge_local_intmap)); 635 */
605 if (plen != -1) { 636static unsigned int __init pci_intmap_match_to_root(struct pci_pbm_info *pbm,
606 intmap = &bridge_local_intmap[0]; 637 struct pci_dev *pdev,
607 num_intmap = plen / sizeof(struct linux_prom_pci_intmap); 638 unsigned int *interrupt)
608 plen = prom_getproperty(bus_pcp->prom_node, 639{
609 "interrupt-map-mask", 640 struct pci_dev *toplevel_pdev = pdev;
610 (char *) &bridge_local_intmask, 641 struct pcidev_cookie *toplevel_pcp = toplevel_pdev->sysdata;
611 sizeof(bridge_local_intmask)); 642 unsigned int cnode = toplevel_pcp->prom_node;
612 if (plen == -1) { 643
613 printk("pci_intmap_match: Warning! Bridge has intmap " 644 while (pdev->bus->number != pbm->pci_first_busno) {
614 "but no intmask.\n"); 645 struct pci_dev *pbus = pdev->bus->self;
615 printk("pci_intmap_match: Trying to recover.\n"); 646 struct pcidev_cookie *pcp = pbus->sysdata;
616 return 0; 647 int plen;
617 }
618 648
619 if (pdev->bus->self != bus_dev) 649 plen = prom_getproplen(pcp->prom_node, "interrupt-map");
620 map_slot = 1; 650 if (plen <= 0) {
651 *interrupt = pci_slot_swivel(pbm, toplevel_pdev,
652 pdev, *interrupt);
653 cnode = pcp->prom_node;
621 } else { 654 } else {
622 pregs = bus_pcp->prom_regs; 655 *interrupt = pci_apply_intmap(pbm, toplevel_pdev,
623 map_slot = 1; 656 pbus, pdev,
657 *interrupt, &cnode);
658
659 while (pcp->prom_node != cnode &&
660 pbus->bus->number != pbm->pci_first_busno) {
661 pbus = pbus->bus->self;
662 pcp = pbus->sysdata;
663 }
624 } 664 }
625 } 665 pdev = pbus;
626 666
627 if (map_slot) { 667 if (cnode == pbm->prom_node)
628 *interrupt = ((*interrupt 668 break;
629 - 1
630 + PCI_SLOT(pdev->devfn)) & 0x3) + 1;
631 } 669 }
632 670
633 hi = pregs->phys_hi & intmask->phys_hi; 671 return cnode;
634 mid = pregs->phys_mid & intmask->phys_mid; 672}
635 lo = pregs->phys_lo & intmask->phys_lo; 673
636 irq = *interrupt & intmask->interrupt; 674static int __init pci_intmap_match(struct pci_dev *pdev, unsigned int *interrupt)
637 675{
638 for (i = 0; i < num_intmap; i++) { 676 struct pcidev_cookie *dev_pcp = pdev->sysdata;
639 if (intmap[i].phys_hi == hi && 677 struct pci_pbm_info *pbm = dev_pcp->pbm;
640 intmap[i].phys_mid == mid && 678 struct linux_prom_pci_registers reg[PROMREG_MAX];
641 intmap[i].phys_lo == lo && 679 unsigned int hi, mid, lo, irq;
642 intmap[i].interrupt == irq) { 680 int i, cnode, plen;
643 *interrupt = intmap[i].cinterrupt; 681
644 printk("PCI-IRQ: Routing bus[%2x] slot[%2x] map[%d] to INO[%02x]\n", 682 cnode = pci_intmap_match_to_root(pbm, pdev, interrupt);
645 pdev->bus->number, PCI_SLOT(pdev->devfn), 683 if (cnode == pbm->prom_node)
646 map_slot, *interrupt); 684 goto success;
647 return 1; 685
648 } 686 plen = prom_getproperty(cnode, "reg", (char *) reg, sizeof(reg));
687 if (plen <= 0 ||
688 (plen % sizeof(struct linux_prom_pci_registers)) != 0) {
689 printk("%s: OBP node %x reg property has bad len %d\n",
690 pbm->name, cnode, plen);
691 goto fail;
649 } 692 }
650 693
651 /* We will run this code even if pbm->num_pbm_intmap is zero, just so 694 hi = reg[0].phys_hi & pbm->pbm_intmask.phys_hi;
652 * we can apply the slot mapping to the PROM interrupt property value. 695 mid = reg[0].phys_mid & pbm->pbm_intmask.phys_mid;
653 * So do not spit out these warnings in that case. 696 lo = reg[0].phys_lo & pbm->pbm_intmask.phys_lo;
654 */ 697 irq = *interrupt & pbm->pbm_intmask.interrupt;
655 if (num_intmap != 0) { 698
656 /* Print it both to OBP console and kernel one so that if bootup 699 for (i = 0; i < pbm->num_pbm_intmap; i++) {
657 * hangs here the user has the information to report. 700 struct linux_prom_pci_intmap *intmap;
658 */ 701
659 prom_printf("pci_intmap_match: bus %02x, devfn %02x: ", 702 intmap = &pbm->pbm_intmap[i];
660 pdev->bus->number, pdev->devfn); 703
661 prom_printf("IRQ [%08x.%08x.%08x.%08x] not found in interrupt-map\n", 704 if (intmap->phys_hi == hi &&
662 pregs->phys_hi, pregs->phys_mid, pregs->phys_lo, *interrupt); 705 intmap->phys_mid == mid &&
663 prom_printf("Please email this information to davem@redhat.com\n"); 706 intmap->phys_lo == lo &&
664 707 intmap->interrupt == irq) {
665 printk("pci_intmap_match: bus %02x, devfn %02x: ", 708 *interrupt = intmap->cinterrupt;
666 pdev->bus->number, pdev->devfn); 709 goto success;
667 printk("IRQ [%08x.%08x.%08x.%08x] not found in interrupt-map\n", 710 }
668 pregs->phys_hi, pregs->phys_mid, pregs->phys_lo, *interrupt);
669 printk("Please email this information to davem@redhat.com\n");
670 } 711 }
671 712
713fail:
672 return 0; 714 return 0;
715
716success:
717 printk("PCI-IRQ: Routing bus[%2x] slot[%2x] to INO[%02x]\n",
718 pdev->bus->number, PCI_SLOT(pdev->devfn),
719 *interrupt);
720 return 1;
673} 721}
674 722
675static void __init pdev_fixup_irq(struct pci_dev *pdev) 723static void __init pdev_fixup_irq(struct pci_dev *pdev)
@@ -703,16 +751,18 @@ static void __init pdev_fixup_irq(struct pci_dev *pdev)
703 return; 751 return;
704 } 752 }
705 753
706 /* Fully specified already? */ 754 if (tlb_type != hypervisor) {
707 if (((prom_irq & PCI_IRQ_IGN) >> 6) == portid) { 755 /* Fully specified already? */
708 pdev->irq = p->irq_build(pbm, pdev, prom_irq); 756 if (((prom_irq & PCI_IRQ_IGN) >> 6) == portid) {
709 goto have_irq; 757 pdev->irq = p->irq_build(pbm, pdev, prom_irq);
710 } 758 goto have_irq;
759 }
711 760
712 /* An onboard device? (bit 5 set) */ 761 /* An onboard device? (bit 5 set) */
713 if ((prom_irq & PCI_IRQ_INO) & 0x20) { 762 if ((prom_irq & PCI_IRQ_INO) & 0x20) {
714 pdev->irq = p->irq_build(pbm, pdev, (portid << 6 | prom_irq)); 763 pdev->irq = p->irq_build(pbm, pdev, (portid << 6 | prom_irq));
715 goto have_irq; 764 goto have_irq;
765 }
716 } 766 }
717 767
718 /* Can we find a matching entry in the interrupt-map? */ 768 /* Can we find a matching entry in the interrupt-map? */
@@ -927,33 +977,30 @@ void pci_register_legacy_regions(struct resource *io_res,
927 struct resource *p; 977 struct resource *p;
928 978
929 /* VGA Video RAM. */ 979 /* VGA Video RAM. */
930 p = kmalloc(sizeof(*p), GFP_KERNEL); 980 p = kzalloc(sizeof(*p), GFP_KERNEL);
931 if (!p) 981 if (!p)
932 return; 982 return;
933 983
934 memset(p, 0, sizeof(*p));
935 p->name = "Video RAM area"; 984 p->name = "Video RAM area";
936 p->start = mem_res->start + 0xa0000UL; 985 p->start = mem_res->start + 0xa0000UL;
937 p->end = p->start + 0x1ffffUL; 986 p->end = p->start + 0x1ffffUL;
938 p->flags = IORESOURCE_BUSY; 987 p->flags = IORESOURCE_BUSY;
939 request_resource(mem_res, p); 988 request_resource(mem_res, p);
940 989
941 p = kmalloc(sizeof(*p), GFP_KERNEL); 990 p = kzalloc(sizeof(*p), GFP_KERNEL);
942 if (!p) 991 if (!p)
943 return; 992 return;
944 993
945 memset(p, 0, sizeof(*p));
946 p->name = "System ROM"; 994 p->name = "System ROM";
947 p->start = mem_res->start + 0xf0000UL; 995 p->start = mem_res->start + 0xf0000UL;
948 p->end = p->start + 0xffffUL; 996 p->end = p->start + 0xffffUL;
949 p->flags = IORESOURCE_BUSY; 997 p->flags = IORESOURCE_BUSY;
950 request_resource(mem_res, p); 998 request_resource(mem_res, p);
951 999
952 p = kmalloc(sizeof(*p), GFP_KERNEL); 1000 p = kzalloc(sizeof(*p), GFP_KERNEL);
953 if (!p) 1001 if (!p)
954 return; 1002 return;
955 1003
956 memset(p, 0, sizeof(*p));
957 p->name = "Video ROM"; 1004 p->name = "Video ROM";
958 p->start = mem_res->start + 0xc0000UL; 1005 p->start = mem_res->start + 0xc0000UL;
959 p->end = p->start + 0x7fffUL; 1006 p->end = p->start + 0x7fffUL;
diff --git a/arch/sparc64/kernel/pci_iommu.c b/arch/sparc64/kernel/pci_iommu.c
index a11910be1013..8efbc139769d 100644
--- a/arch/sparc64/kernel/pci_iommu.c
+++ b/arch/sparc64/kernel/pci_iommu.c
@@ -139,12 +139,11 @@ void pci_iommu_table_init(struct pci_iommu *iommu, int tsbsize, u32 dma_offset,
139 /* Allocate and initialize the free area map. */ 139 /* Allocate and initialize the free area map. */
140 sz = num_tsb_entries / 8; 140 sz = num_tsb_entries / 8;
141 sz = (sz + 7UL) & ~7UL; 141 sz = (sz + 7UL) & ~7UL;
142 iommu->arena.map = kmalloc(sz, GFP_KERNEL); 142 iommu->arena.map = kzalloc(sz, GFP_KERNEL);
143 if (!iommu->arena.map) { 143 if (!iommu->arena.map) {
144 prom_printf("PCI_IOMMU: Error, kmalloc(arena.map) failed.\n"); 144 prom_printf("PCI_IOMMU: Error, kmalloc(arena.map) failed.\n");
145 prom_halt(); 145 prom_halt();
146 } 146 }
147 memset(iommu->arena.map, 0, sz);
148 iommu->arena.limit = num_tsb_entries; 147 iommu->arena.limit = num_tsb_entries;
149 148
150 /* Allocate and initialize the dummy page which we 149 /* Allocate and initialize the dummy page which we
@@ -219,7 +218,7 @@ static inline void iommu_free_ctx(struct pci_iommu *iommu, int ctx)
219 * DMA for PCI device PDEV. Return non-NULL cpu-side address if 218 * DMA for PCI device PDEV. Return non-NULL cpu-side address if
220 * successful and set *DMA_ADDRP to the PCI side dma address. 219 * successful and set *DMA_ADDRP to the PCI side dma address.
221 */ 220 */
222void *pci_alloc_consistent(struct pci_dev *pdev, size_t size, dma_addr_t *dma_addrp) 221static void *pci_4u_alloc_consistent(struct pci_dev *pdev, size_t size, dma_addr_t *dma_addrp)
223{ 222{
224 struct pcidev_cookie *pcp; 223 struct pcidev_cookie *pcp;
225 struct pci_iommu *iommu; 224 struct pci_iommu *iommu;
@@ -267,7 +266,7 @@ void *pci_alloc_consistent(struct pci_dev *pdev, size_t size, dma_addr_t *dma_ad
267} 266}
268 267
269/* Free and unmap a consistent DMA translation. */ 268/* Free and unmap a consistent DMA translation. */
270void pci_free_consistent(struct pci_dev *pdev, size_t size, void *cpu, dma_addr_t dvma) 269static void pci_4u_free_consistent(struct pci_dev *pdev, size_t size, void *cpu, dma_addr_t dvma)
271{ 270{
272 struct pcidev_cookie *pcp; 271 struct pcidev_cookie *pcp;
273 struct pci_iommu *iommu; 272 struct pci_iommu *iommu;
@@ -294,7 +293,7 @@ void pci_free_consistent(struct pci_dev *pdev, size_t size, void *cpu, dma_addr_
294/* Map a single buffer at PTR of SZ bytes for PCI DMA 293/* Map a single buffer at PTR of SZ bytes for PCI DMA
295 * in streaming mode. 294 * in streaming mode.
296 */ 295 */
297dma_addr_t pci_map_single(struct pci_dev *pdev, void *ptr, size_t sz, int direction) 296static dma_addr_t pci_4u_map_single(struct pci_dev *pdev, void *ptr, size_t sz, int direction)
298{ 297{
299 struct pcidev_cookie *pcp; 298 struct pcidev_cookie *pcp;
300 struct pci_iommu *iommu; 299 struct pci_iommu *iommu;
@@ -415,7 +414,7 @@ do_flush_sync:
415} 414}
416 415
417/* Unmap a single streaming mode DMA translation. */ 416/* Unmap a single streaming mode DMA translation. */
418void pci_unmap_single(struct pci_dev *pdev, dma_addr_t bus_addr, size_t sz, int direction) 417static void pci_4u_unmap_single(struct pci_dev *pdev, dma_addr_t bus_addr, size_t sz, int direction)
419{ 418{
420 struct pcidev_cookie *pcp; 419 struct pcidev_cookie *pcp;
421 struct pci_iommu *iommu; 420 struct pci_iommu *iommu;
@@ -548,7 +547,7 @@ static inline void fill_sg(iopte_t *iopte, struct scatterlist *sg,
548 * When making changes here, inspect the assembly output. I was having 547 * When making changes here, inspect the assembly output. I was having
549 * hard time to kepp this routine out of using stack slots for holding variables. 548 * hard time to kepp this routine out of using stack slots for holding variables.
550 */ 549 */
551int pci_map_sg(struct pci_dev *pdev, struct scatterlist *sglist, int nelems, int direction) 550static int pci_4u_map_sg(struct pci_dev *pdev, struct scatterlist *sglist, int nelems, int direction)
552{ 551{
553 struct pcidev_cookie *pcp; 552 struct pcidev_cookie *pcp;
554 struct pci_iommu *iommu; 553 struct pci_iommu *iommu;
@@ -562,9 +561,9 @@ int pci_map_sg(struct pci_dev *pdev, struct scatterlist *sglist, int nelems, int
562 /* Fast path single entry scatterlists. */ 561 /* Fast path single entry scatterlists. */
563 if (nelems == 1) { 562 if (nelems == 1) {
564 sglist->dma_address = 563 sglist->dma_address =
565 pci_map_single(pdev, 564 pci_4u_map_single(pdev,
566 (page_address(sglist->page) + sglist->offset), 565 (page_address(sglist->page) + sglist->offset),
567 sglist->length, direction); 566 sglist->length, direction);
568 if (unlikely(sglist->dma_address == PCI_DMA_ERROR_CODE)) 567 if (unlikely(sglist->dma_address == PCI_DMA_ERROR_CODE))
569 return 0; 568 return 0;
570 sglist->dma_length = sglist->length; 569 sglist->dma_length = sglist->length;
@@ -635,7 +634,7 @@ bad_no_ctx:
635} 634}
636 635
637/* Unmap a set of streaming mode DMA translations. */ 636/* Unmap a set of streaming mode DMA translations. */
638void pci_unmap_sg(struct pci_dev *pdev, struct scatterlist *sglist, int nelems, int direction) 637static void pci_4u_unmap_sg(struct pci_dev *pdev, struct scatterlist *sglist, int nelems, int direction)
639{ 638{
640 struct pcidev_cookie *pcp; 639 struct pcidev_cookie *pcp;
641 struct pci_iommu *iommu; 640 struct pci_iommu *iommu;
@@ -695,7 +694,7 @@ void pci_unmap_sg(struct pci_dev *pdev, struct scatterlist *sglist, int nelems,
695/* Make physical memory consistent for a single 694/* Make physical memory consistent for a single
696 * streaming mode DMA translation after a transfer. 695 * streaming mode DMA translation after a transfer.
697 */ 696 */
698void pci_dma_sync_single_for_cpu(struct pci_dev *pdev, dma_addr_t bus_addr, size_t sz, int direction) 697static void pci_4u_dma_sync_single_for_cpu(struct pci_dev *pdev, dma_addr_t bus_addr, size_t sz, int direction)
699{ 698{
700 struct pcidev_cookie *pcp; 699 struct pcidev_cookie *pcp;
701 struct pci_iommu *iommu; 700 struct pci_iommu *iommu;
@@ -735,7 +734,7 @@ void pci_dma_sync_single_for_cpu(struct pci_dev *pdev, dma_addr_t bus_addr, size
735/* Make physical memory consistent for a set of streaming 734/* Make physical memory consistent for a set of streaming
736 * mode DMA translations after a transfer. 735 * mode DMA translations after a transfer.
737 */ 736 */
738void pci_dma_sync_sg_for_cpu(struct pci_dev *pdev, struct scatterlist *sglist, int nelems, int direction) 737static void pci_4u_dma_sync_sg_for_cpu(struct pci_dev *pdev, struct scatterlist *sglist, int nelems, int direction)
739{ 738{
740 struct pcidev_cookie *pcp; 739 struct pcidev_cookie *pcp;
741 struct pci_iommu *iommu; 740 struct pci_iommu *iommu;
@@ -776,6 +775,17 @@ void pci_dma_sync_sg_for_cpu(struct pci_dev *pdev, struct scatterlist *sglist, i
776 spin_unlock_irqrestore(&iommu->lock, flags); 775 spin_unlock_irqrestore(&iommu->lock, flags);
777} 776}
778 777
778struct pci_iommu_ops pci_sun4u_iommu_ops = {
779 .alloc_consistent = pci_4u_alloc_consistent,
780 .free_consistent = pci_4u_free_consistent,
781 .map_single = pci_4u_map_single,
782 .unmap_single = pci_4u_unmap_single,
783 .map_sg = pci_4u_map_sg,
784 .unmap_sg = pci_4u_unmap_sg,
785 .dma_sync_single_for_cpu = pci_4u_dma_sync_single_for_cpu,
786 .dma_sync_sg_for_cpu = pci_4u_dma_sync_sg_for_cpu,
787};
788
779static void ali_sound_dma_hack(struct pci_dev *pdev, int set_bit) 789static void ali_sound_dma_hack(struct pci_dev *pdev, int set_bit)
780{ 790{
781 struct pci_dev *ali_isa_bridge; 791 struct pci_dev *ali_isa_bridge;
diff --git a/arch/sparc64/kernel/pci_psycho.c b/arch/sparc64/kernel/pci_psycho.c
index c03ed5f49d31..d17878b145c2 100644
--- a/arch/sparc64/kernel/pci_psycho.c
+++ b/arch/sparc64/kernel/pci_psycho.c
@@ -286,17 +286,17 @@ static unsigned char psycho_pil_table[] = {
286/*0x14*/0, 0, 0, 0, /* PCI B slot 1 Int A, B, C, D */ 286/*0x14*/0, 0, 0, 0, /* PCI B slot 1 Int A, B, C, D */
287/*0x18*/0, 0, 0, 0, /* PCI B slot 2 Int A, B, C, D */ 287/*0x18*/0, 0, 0, 0, /* PCI B slot 2 Int A, B, C, D */
288/*0x1c*/0, 0, 0, 0, /* PCI B slot 3 Int A, B, C, D */ 288/*0x1c*/0, 0, 0, 0, /* PCI B slot 3 Int A, B, C, D */
289/*0x20*/4, /* SCSI */ 289/*0x20*/5, /* SCSI */
290/*0x21*/5, /* Ethernet */ 290/*0x21*/5, /* Ethernet */
291/*0x22*/8, /* Parallel Port */ 291/*0x22*/8, /* Parallel Port */
292/*0x23*/13, /* Audio Record */ 292/*0x23*/13, /* Audio Record */
293/*0x24*/14, /* Audio Playback */ 293/*0x24*/14, /* Audio Playback */
294/*0x25*/15, /* PowerFail */ 294/*0x25*/15, /* PowerFail */
295/*0x26*/4, /* second SCSI */ 295/*0x26*/5, /* second SCSI */
296/*0x27*/11, /* Floppy */ 296/*0x27*/11, /* Floppy */
297/*0x28*/4, /* Spare Hardware */ 297/*0x28*/5, /* Spare Hardware */
298/*0x29*/9, /* Keyboard */ 298/*0x29*/9, /* Keyboard */
299/*0x2a*/4, /* Mouse */ 299/*0x2a*/5, /* Mouse */
300/*0x2b*/12, /* Serial */ 300/*0x2b*/12, /* Serial */
301/*0x2c*/10, /* Timer 0 */ 301/*0x2c*/10, /* Timer 0 */
302/*0x2d*/11, /* Timer 1 */ 302/*0x2d*/11, /* Timer 1 */
@@ -313,11 +313,11 @@ static int psycho_ino_to_pil(struct pci_dev *pdev, unsigned int ino)
313 313
314 ret = psycho_pil_table[ino]; 314 ret = psycho_pil_table[ino];
315 if (ret == 0 && pdev == NULL) { 315 if (ret == 0 && pdev == NULL) {
316 ret = 4; 316 ret = 5;
317 } else if (ret == 0) { 317 } else if (ret == 0) {
318 switch ((pdev->class >> 16) & 0xff) { 318 switch ((pdev->class >> 16) & 0xff) {
319 case PCI_BASE_CLASS_STORAGE: 319 case PCI_BASE_CLASS_STORAGE:
320 ret = 4; 320 ret = 5;
321 break; 321 break;
322 322
323 case PCI_BASE_CLASS_NETWORK: 323 case PCI_BASE_CLASS_NETWORK:
@@ -336,7 +336,7 @@ static int psycho_ino_to_pil(struct pci_dev *pdev, unsigned int ino)
336 break; 336 break;
337 337
338 default: 338 default:
339 ret = 4; 339 ret = 5;
340 break; 340 break;
341 }; 341 };
342 } 342 }
@@ -1164,7 +1164,7 @@ static void pbm_config_busmastering(struct pci_pbm_info *pbm)
1164static void pbm_scan_bus(struct pci_controller_info *p, 1164static void pbm_scan_bus(struct pci_controller_info *p,
1165 struct pci_pbm_info *pbm) 1165 struct pci_pbm_info *pbm)
1166{ 1166{
1167 struct pcidev_cookie *cookie = kmalloc(sizeof(*cookie), GFP_KERNEL); 1167 struct pcidev_cookie *cookie = kzalloc(sizeof(*cookie), GFP_KERNEL);
1168 1168
1169 if (!cookie) { 1169 if (!cookie) {
1170 prom_printf("PSYCHO: Critical allocation failure.\n"); 1170 prom_printf("PSYCHO: Critical allocation failure.\n");
@@ -1172,7 +1172,6 @@ static void pbm_scan_bus(struct pci_controller_info *p,
1172 } 1172 }
1173 1173
1174 /* All we care about is the PBM. */ 1174 /* All we care about is the PBM. */
1175 memset(cookie, 0, sizeof(*cookie));
1176 cookie->pbm = pbm; 1175 cookie->pbm = pbm;
1177 1176
1178 pbm->pci_bus = pci_scan_bus(pbm->pci_first_busno, 1177 pbm->pci_bus = pci_scan_bus(pbm->pci_first_busno,
@@ -1465,18 +1464,16 @@ void psycho_init(int node, char *model_name)
1465 } 1464 }
1466 } 1465 }
1467 1466
1468 p = kmalloc(sizeof(struct pci_controller_info), GFP_ATOMIC); 1467 p = kzalloc(sizeof(struct pci_controller_info), GFP_ATOMIC);
1469 if (!p) { 1468 if (!p) {
1470 prom_printf("PSYCHO: Fatal memory allocation error.\n"); 1469 prom_printf("PSYCHO: Fatal memory allocation error.\n");
1471 prom_halt(); 1470 prom_halt();
1472 } 1471 }
1473 memset(p, 0, sizeof(*p)); 1472 iommu = kzalloc(sizeof(struct pci_iommu), GFP_ATOMIC);
1474 iommu = kmalloc(sizeof(struct pci_iommu), GFP_ATOMIC);
1475 if (!iommu) { 1473 if (!iommu) {
1476 prom_printf("PSYCHO: Fatal memory allocation error.\n"); 1474 prom_printf("PSYCHO: Fatal memory allocation error.\n");
1477 prom_halt(); 1475 prom_halt();
1478 } 1476 }
1479 memset(iommu, 0, sizeof(*iommu));
1480 p->pbm_A.iommu = p->pbm_B.iommu = iommu; 1477 p->pbm_A.iommu = p->pbm_B.iommu = iommu;
1481 1478
1482 p->next = pci_controller_root; 1479 p->next = pci_controller_root;
diff --git a/arch/sparc64/kernel/pci_sabre.c b/arch/sparc64/kernel/pci_sabre.c
index da8e1364194f..f67bb7f078cf 100644
--- a/arch/sparc64/kernel/pci_sabre.c
+++ b/arch/sparc64/kernel/pci_sabre.c
@@ -533,17 +533,17 @@ static unsigned char sabre_pil_table[] = {
533/*0x14*/0, 0, 0, 0, /* PCI B slot 1 Int A, B, C, D */ 533/*0x14*/0, 0, 0, 0, /* PCI B slot 1 Int A, B, C, D */
534/*0x18*/0, 0, 0, 0, /* PCI B slot 2 Int A, B, C, D */ 534/*0x18*/0, 0, 0, 0, /* PCI B slot 2 Int A, B, C, D */
535/*0x1c*/0, 0, 0, 0, /* PCI B slot 3 Int A, B, C, D */ 535/*0x1c*/0, 0, 0, 0, /* PCI B slot 3 Int A, B, C, D */
536/*0x20*/4, /* SCSI */ 536/*0x20*/5, /* SCSI */
537/*0x21*/5, /* Ethernet */ 537/*0x21*/5, /* Ethernet */
538/*0x22*/8, /* Parallel Port */ 538/*0x22*/8, /* Parallel Port */
539/*0x23*/13, /* Audio Record */ 539/*0x23*/13, /* Audio Record */
540/*0x24*/14, /* Audio Playback */ 540/*0x24*/14, /* Audio Playback */
541/*0x25*/15, /* PowerFail */ 541/*0x25*/15, /* PowerFail */
542/*0x26*/4, /* second SCSI */ 542/*0x26*/5, /* second SCSI */
543/*0x27*/11, /* Floppy */ 543/*0x27*/11, /* Floppy */
544/*0x28*/4, /* Spare Hardware */ 544/*0x28*/5, /* Spare Hardware */
545/*0x29*/9, /* Keyboard */ 545/*0x29*/9, /* Keyboard */
546/*0x2a*/4, /* Mouse */ 546/*0x2a*/5, /* Mouse */
547/*0x2b*/12, /* Serial */ 547/*0x2b*/12, /* Serial */
548/*0x2c*/10, /* Timer 0 */ 548/*0x2c*/10, /* Timer 0 */
549/*0x2d*/11, /* Timer 1 */ 549/*0x2d*/11, /* Timer 1 */
@@ -565,11 +565,11 @@ static int sabre_ino_to_pil(struct pci_dev *pdev, unsigned int ino)
565 565
566 ret = sabre_pil_table[ino]; 566 ret = sabre_pil_table[ino];
567 if (ret == 0 && pdev == NULL) { 567 if (ret == 0 && pdev == NULL) {
568 ret = 4; 568 ret = 5;
569 } else if (ret == 0) { 569 } else if (ret == 0) {
570 switch ((pdev->class >> 16) & 0xff) { 570 switch ((pdev->class >> 16) & 0xff) {
571 case PCI_BASE_CLASS_STORAGE: 571 case PCI_BASE_CLASS_STORAGE:
572 ret = 4; 572 ret = 5;
573 break; 573 break;
574 574
575 case PCI_BASE_CLASS_NETWORK: 575 case PCI_BASE_CLASS_NETWORK:
@@ -588,7 +588,7 @@ static int sabre_ino_to_pil(struct pci_dev *pdev, unsigned int ino)
588 break; 588 break;
589 589
590 default: 590 default:
591 ret = 4; 591 ret = 5;
592 break; 592 break;
593 }; 593 };
594 } 594 }
@@ -1167,7 +1167,7 @@ static void apb_init(struct pci_controller_info *p, struct pci_bus *sabre_bus)
1167 1167
1168static struct pcidev_cookie *alloc_bridge_cookie(struct pci_pbm_info *pbm) 1168static struct pcidev_cookie *alloc_bridge_cookie(struct pci_pbm_info *pbm)
1169{ 1169{
1170 struct pcidev_cookie *cookie = kmalloc(sizeof(*cookie), GFP_KERNEL); 1170 struct pcidev_cookie *cookie = kzalloc(sizeof(*cookie), GFP_KERNEL);
1171 1171
1172 if (!cookie) { 1172 if (!cookie) {
1173 prom_printf("SABRE: Critical allocation failure.\n"); 1173 prom_printf("SABRE: Critical allocation failure.\n");
@@ -1175,7 +1175,6 @@ static struct pcidev_cookie *alloc_bridge_cookie(struct pci_pbm_info *pbm)
1175 } 1175 }
1176 1176
1177 /* All we care about is the PBM. */ 1177 /* All we care about is the PBM. */
1178 memset(cookie, 0, sizeof(*cookie));
1179 cookie->pbm = pbm; 1178 cookie->pbm = pbm;
1180 1179
1181 return cookie; 1180 return cookie;
@@ -1556,19 +1555,17 @@ void sabre_init(int pnode, char *model_name)
1556 } 1555 }
1557 } 1556 }
1558 1557
1559 p = kmalloc(sizeof(*p), GFP_ATOMIC); 1558 p = kzalloc(sizeof(*p), GFP_ATOMIC);
1560 if (!p) { 1559 if (!p) {
1561 prom_printf("SABRE: Error, kmalloc(pci_controller_info) failed.\n"); 1560 prom_printf("SABRE: Error, kmalloc(pci_controller_info) failed.\n");
1562 prom_halt(); 1561 prom_halt();
1563 } 1562 }
1564 memset(p, 0, sizeof(*p));
1565 1563
1566 iommu = kmalloc(sizeof(*iommu), GFP_ATOMIC); 1564 iommu = kzalloc(sizeof(*iommu), GFP_ATOMIC);
1567 if (!iommu) { 1565 if (!iommu) {
1568 prom_printf("SABRE: Error, kmalloc(pci_iommu) failed.\n"); 1566 prom_printf("SABRE: Error, kmalloc(pci_iommu) failed.\n");
1569 prom_halt(); 1567 prom_halt();
1570 } 1568 }
1571 memset(iommu, 0, sizeof(*iommu));
1572 p->pbm_A.iommu = p->pbm_B.iommu = iommu; 1569 p->pbm_A.iommu = p->pbm_B.iommu = iommu;
1573 1570
1574 upa_portid = prom_getintdefault(pnode, "upa-portid", 0xff); 1571 upa_portid = prom_getintdefault(pnode, "upa-portid", 0xff);
diff --git a/arch/sparc64/kernel/pci_schizo.c b/arch/sparc64/kernel/pci_schizo.c
index d8c4e0919b4e..7fe4de03ac2e 100644
--- a/arch/sparc64/kernel/pci_schizo.c
+++ b/arch/sparc64/kernel/pci_schizo.c
@@ -243,8 +243,8 @@ static unsigned char schizo_pil_table[] = {
243/*0x0c*/0, 0, 0, 0, /* PCI slot 3 Int A, B, C, D */ 243/*0x0c*/0, 0, 0, 0, /* PCI slot 3 Int A, B, C, D */
244/*0x10*/0, 0, 0, 0, /* PCI slot 4 Int A, B, C, D */ 244/*0x10*/0, 0, 0, 0, /* PCI slot 4 Int A, B, C, D */
245/*0x14*/0, 0, 0, 0, /* PCI slot 5 Int A, B, C, D */ 245/*0x14*/0, 0, 0, 0, /* PCI slot 5 Int A, B, C, D */
246/*0x18*/4, /* SCSI */ 246/*0x18*/5, /* SCSI */
247/*0x19*/4, /* second SCSI */ 247/*0x19*/5, /* second SCSI */
248/*0x1a*/0, /* UNKNOWN */ 248/*0x1a*/0, /* UNKNOWN */
249/*0x1b*/0, /* UNKNOWN */ 249/*0x1b*/0, /* UNKNOWN */
250/*0x1c*/8, /* Parallel */ 250/*0x1c*/8, /* Parallel */
@@ -254,7 +254,7 @@ static unsigned char schizo_pil_table[] = {
254/*0x20*/13, /* Audio Record */ 254/*0x20*/13, /* Audio Record */
255/*0x21*/14, /* Audio Playback */ 255/*0x21*/14, /* Audio Playback */
256/*0x22*/12, /* Serial */ 256/*0x22*/12, /* Serial */
257/*0x23*/4, /* EBUS I2C */ 257/*0x23*/5, /* EBUS I2C */
258/*0x24*/10, /* RTC Clock */ 258/*0x24*/10, /* RTC Clock */
259/*0x25*/11, /* Floppy */ 259/*0x25*/11, /* Floppy */
260/*0x26*/0, /* UNKNOWN */ 260/*0x26*/0, /* UNKNOWN */
@@ -296,11 +296,11 @@ static int schizo_ino_to_pil(struct pci_dev *pdev, unsigned int ino)
296 296
297 ret = schizo_pil_table[ino]; 297 ret = schizo_pil_table[ino];
298 if (ret == 0 && pdev == NULL) { 298 if (ret == 0 && pdev == NULL) {
299 ret = 4; 299 ret = 5;
300 } else if (ret == 0) { 300 } else if (ret == 0) {
301 switch ((pdev->class >> 16) & 0xff) { 301 switch ((pdev->class >> 16) & 0xff) {
302 case PCI_BASE_CLASS_STORAGE: 302 case PCI_BASE_CLASS_STORAGE:
303 ret = 4; 303 ret = 5;
304 break; 304 break;
305 305
306 case PCI_BASE_CLASS_NETWORK: 306 case PCI_BASE_CLASS_NETWORK:
@@ -319,7 +319,7 @@ static int schizo_ino_to_pil(struct pci_dev *pdev, unsigned int ino)
319 break; 319 break;
320 320
321 default: 321 default:
322 ret = 4; 322 ret = 5;
323 break; 323 break;
324 }; 324 };
325 } 325 }
@@ -1525,7 +1525,7 @@ static void pbm_config_busmastering(struct pci_pbm_info *pbm)
1525static void pbm_scan_bus(struct pci_controller_info *p, 1525static void pbm_scan_bus(struct pci_controller_info *p,
1526 struct pci_pbm_info *pbm) 1526 struct pci_pbm_info *pbm)
1527{ 1527{
1528 struct pcidev_cookie *cookie = kmalloc(sizeof(*cookie), GFP_KERNEL); 1528 struct pcidev_cookie *cookie = kzalloc(sizeof(*cookie), GFP_KERNEL);
1529 1529
1530 if (!cookie) { 1530 if (!cookie) {
1531 prom_printf("%s: Critical allocation failure.\n", pbm->name); 1531 prom_printf("%s: Critical allocation failure.\n", pbm->name);
@@ -1533,7 +1533,6 @@ static void pbm_scan_bus(struct pci_controller_info *p,
1533 } 1533 }
1534 1534
1535 /* All we care about is the PBM. */ 1535 /* All we care about is the PBM. */
1536 memset(cookie, 0, sizeof(*cookie));
1537 cookie->pbm = pbm; 1536 cookie->pbm = pbm;
1538 1537
1539 pbm->pci_bus = pci_scan_bus(pbm->pci_first_busno, 1538 pbm->pci_bus = pci_scan_bus(pbm->pci_first_busno,
@@ -2120,27 +2119,24 @@ static void __schizo_init(int node, char *model_name, int chip_type)
2120 } 2119 }
2121 } 2120 }
2122 2121
2123 p = kmalloc(sizeof(struct pci_controller_info), GFP_ATOMIC); 2122 p = kzalloc(sizeof(struct pci_controller_info), GFP_ATOMIC);
2124 if (!p) { 2123 if (!p) {
2125 prom_printf("SCHIZO: Fatal memory allocation error.\n"); 2124 prom_printf("SCHIZO: Fatal memory allocation error.\n");
2126 prom_halt(); 2125 prom_halt();
2127 } 2126 }
2128 memset(p, 0, sizeof(*p));
2129 2127
2130 iommu = kmalloc(sizeof(struct pci_iommu), GFP_ATOMIC); 2128 iommu = kzalloc(sizeof(struct pci_iommu), GFP_ATOMIC);
2131 if (!iommu) { 2129 if (!iommu) {
2132 prom_printf("SCHIZO: Fatal memory allocation error.\n"); 2130 prom_printf("SCHIZO: Fatal memory allocation error.\n");
2133 prom_halt(); 2131 prom_halt();
2134 } 2132 }
2135 memset(iommu, 0, sizeof(*iommu));
2136 p->pbm_A.iommu = iommu; 2133 p->pbm_A.iommu = iommu;
2137 2134
2138 iommu = kmalloc(sizeof(struct pci_iommu), GFP_ATOMIC); 2135 iommu = kzalloc(sizeof(struct pci_iommu), GFP_ATOMIC);
2139 if (!iommu) { 2136 if (!iommu) {
2140 prom_printf("SCHIZO: Fatal memory allocation error.\n"); 2137 prom_printf("SCHIZO: Fatal memory allocation error.\n");
2141 prom_halt(); 2138 prom_halt();
2142 } 2139 }
2143 memset(iommu, 0, sizeof(*iommu));
2144 p->pbm_B.iommu = iommu; 2140 p->pbm_B.iommu = iommu;
2145 2141
2146 p->next = pci_controller_root; 2142 p->next = pci_controller_root;
diff --git a/arch/sparc64/kernel/pci_sun4v.c b/arch/sparc64/kernel/pci_sun4v.c
new file mode 100644
index 000000000000..9372d4f376d5
--- /dev/null
+++ b/arch/sparc64/kernel/pci_sun4v.c
@@ -0,0 +1,1147 @@
1/* pci_sun4v.c: SUN4V specific PCI controller support.
2 *
3 * Copyright (C) 2006 David S. Miller (davem@davemloft.net)
4 */
5
6#include <linux/kernel.h>
7#include <linux/types.h>
8#include <linux/pci.h>
9#include <linux/init.h>
10#include <linux/slab.h>
11#include <linux/interrupt.h>
12#include <linux/percpu.h>
13
14#include <asm/pbm.h>
15#include <asm/iommu.h>
16#include <asm/irq.h>
17#include <asm/upa.h>
18#include <asm/pstate.h>
19#include <asm/oplib.h>
20#include <asm/hypervisor.h>
21
22#include "pci_impl.h"
23#include "iommu_common.h"
24
25#include "pci_sun4v.h"
26
27#define PGLIST_NENTS (PAGE_SIZE / sizeof(u64))
28
29struct pci_iommu_batch {
30 struct pci_dev *pdev; /* Device mapping is for. */
31 unsigned long prot; /* IOMMU page protections */
32 unsigned long entry; /* Index into IOTSB. */
33 u64 *pglist; /* List of physical pages */
34 unsigned long npages; /* Number of pages in list. */
35};
36
37static DEFINE_PER_CPU(struct pci_iommu_batch, pci_iommu_batch);
38
39/* Interrupts must be disabled. */
40static inline void pci_iommu_batch_start(struct pci_dev *pdev, unsigned long prot, unsigned long entry)
41{
42 struct pci_iommu_batch *p = &__get_cpu_var(pci_iommu_batch);
43
44 p->pdev = pdev;
45 p->prot = prot;
46 p->entry = entry;
47 p->npages = 0;
48}
49
50/* Interrupts must be disabled. */
51static long pci_iommu_batch_flush(struct pci_iommu_batch *p)
52{
53 struct pcidev_cookie *pcp = p->pdev->sysdata;
54 unsigned long devhandle = pcp->pbm->devhandle;
55 unsigned long prot = p->prot;
56 unsigned long entry = p->entry;
57 u64 *pglist = p->pglist;
58 unsigned long npages = p->npages;
59
60 while (npages != 0) {
61 long num;
62
63 num = pci_sun4v_iommu_map(devhandle, HV_PCI_TSBID(0, entry),
64 npages, prot, __pa(pglist));
65 if (unlikely(num < 0)) {
66 if (printk_ratelimit())
67 printk("pci_iommu_batch_flush: IOMMU map of "
68 "[%08lx:%08lx:%lx:%lx:%lx] failed with "
69 "status %ld\n",
70 devhandle, HV_PCI_TSBID(0, entry),
71 npages, prot, __pa(pglist), num);
72 return -1;
73 }
74
75 entry += num;
76 npages -= num;
77 pglist += num;
78 }
79
80 p->entry = entry;
81 p->npages = 0;
82
83 return 0;
84}
85
86/* Interrupts must be disabled. */
87static inline long pci_iommu_batch_add(u64 phys_page)
88{
89 struct pci_iommu_batch *p = &__get_cpu_var(pci_iommu_batch);
90
91 BUG_ON(p->npages >= PGLIST_NENTS);
92
93 p->pglist[p->npages++] = phys_page;
94 if (p->npages == PGLIST_NENTS)
95 return pci_iommu_batch_flush(p);
96
97 return 0;
98}
99
100/* Interrupts must be disabled. */
101static inline long pci_iommu_batch_end(void)
102{
103 struct pci_iommu_batch *p = &__get_cpu_var(pci_iommu_batch);
104
105 BUG_ON(p->npages >= PGLIST_NENTS);
106
107 return pci_iommu_batch_flush(p);
108}
109
110static long pci_arena_alloc(struct pci_iommu_arena *arena, unsigned long npages)
111{
112 unsigned long n, i, start, end, limit;
113 int pass;
114
115 limit = arena->limit;
116 start = arena->hint;
117 pass = 0;
118
119again:
120 n = find_next_zero_bit(arena->map, limit, start);
121 end = n + npages;
122 if (unlikely(end >= limit)) {
123 if (likely(pass < 1)) {
124 limit = start;
125 start = 0;
126 pass++;
127 goto again;
128 } else {
129 /* Scanned the whole thing, give up. */
130 return -1;
131 }
132 }
133
134 for (i = n; i < end; i++) {
135 if (test_bit(i, arena->map)) {
136 start = i + 1;
137 goto again;
138 }
139 }
140
141 for (i = n; i < end; i++)
142 __set_bit(i, arena->map);
143
144 arena->hint = end;
145
146 return n;
147}
148
149static void pci_arena_free(struct pci_iommu_arena *arena, unsigned long base, unsigned long npages)
150{
151 unsigned long i;
152
153 for (i = base; i < (base + npages); i++)
154 __clear_bit(i, arena->map);
155}
156
157static void *pci_4v_alloc_consistent(struct pci_dev *pdev, size_t size, dma_addr_t *dma_addrp)
158{
159 struct pcidev_cookie *pcp;
160 struct pci_iommu *iommu;
161 unsigned long flags, order, first_page, npages, n;
162 void *ret;
163 long entry;
164
165 size = IO_PAGE_ALIGN(size);
166 order = get_order(size);
167 if (unlikely(order >= MAX_ORDER))
168 return NULL;
169
170 npages = size >> IO_PAGE_SHIFT;
171
172 first_page = __get_free_pages(GFP_ATOMIC, order);
173 if (unlikely(first_page == 0UL))
174 return NULL;
175
176 memset((char *)first_page, 0, PAGE_SIZE << order);
177
178 pcp = pdev->sysdata;
179 iommu = pcp->pbm->iommu;
180
181 spin_lock_irqsave(&iommu->lock, flags);
182 entry = pci_arena_alloc(&iommu->arena, npages);
183 spin_unlock_irqrestore(&iommu->lock, flags);
184
185 if (unlikely(entry < 0L))
186 goto arena_alloc_fail;
187
188 *dma_addrp = (iommu->page_table_map_base +
189 (entry << IO_PAGE_SHIFT));
190 ret = (void *) first_page;
191 first_page = __pa(first_page);
192
193 local_irq_save(flags);
194
195 pci_iommu_batch_start(pdev,
196 (HV_PCI_MAP_ATTR_READ |
197 HV_PCI_MAP_ATTR_WRITE),
198 entry);
199
200 for (n = 0; n < npages; n++) {
201 long err = pci_iommu_batch_add(first_page + (n * PAGE_SIZE));
202 if (unlikely(err < 0L))
203 goto iommu_map_fail;
204 }
205
206 if (unlikely(pci_iommu_batch_end() < 0L))
207 goto iommu_map_fail;
208
209 local_irq_restore(flags);
210
211 return ret;
212
213iommu_map_fail:
214 /* Interrupts are disabled. */
215 spin_lock(&iommu->lock);
216 pci_arena_free(&iommu->arena, entry, npages);
217 spin_unlock_irqrestore(&iommu->lock, flags);
218
219arena_alloc_fail:
220 free_pages(first_page, order);
221 return NULL;
222}
223
224static void pci_4v_free_consistent(struct pci_dev *pdev, size_t size, void *cpu, dma_addr_t dvma)
225{
226 struct pcidev_cookie *pcp;
227 struct pci_iommu *iommu;
228 unsigned long flags, order, npages, entry;
229 u32 devhandle;
230
231 npages = IO_PAGE_ALIGN(size) >> IO_PAGE_SHIFT;
232 pcp = pdev->sysdata;
233 iommu = pcp->pbm->iommu;
234 devhandle = pcp->pbm->devhandle;
235 entry = ((dvma - iommu->page_table_map_base) >> IO_PAGE_SHIFT);
236
237 spin_lock_irqsave(&iommu->lock, flags);
238
239 pci_arena_free(&iommu->arena, entry, npages);
240
241 do {
242 unsigned long num;
243
244 num = pci_sun4v_iommu_demap(devhandle, HV_PCI_TSBID(0, entry),
245 npages);
246 entry += num;
247 npages -= num;
248 } while (npages != 0);
249
250 spin_unlock_irqrestore(&iommu->lock, flags);
251
252 order = get_order(size);
253 if (order < 10)
254 free_pages((unsigned long)cpu, order);
255}
256
257static dma_addr_t pci_4v_map_single(struct pci_dev *pdev, void *ptr, size_t sz, int direction)
258{
259 struct pcidev_cookie *pcp;
260 struct pci_iommu *iommu;
261 unsigned long flags, npages, oaddr;
262 unsigned long i, base_paddr;
263 u32 bus_addr, ret;
264 unsigned long prot;
265 long entry;
266
267 pcp = pdev->sysdata;
268 iommu = pcp->pbm->iommu;
269
270 if (unlikely(direction == PCI_DMA_NONE))
271 goto bad;
272
273 oaddr = (unsigned long)ptr;
274 npages = IO_PAGE_ALIGN(oaddr + sz) - (oaddr & IO_PAGE_MASK);
275 npages >>= IO_PAGE_SHIFT;
276
277 spin_lock_irqsave(&iommu->lock, flags);
278 entry = pci_arena_alloc(&iommu->arena, npages);
279 spin_unlock_irqrestore(&iommu->lock, flags);
280
281 if (unlikely(entry < 0L))
282 goto bad;
283
284 bus_addr = (iommu->page_table_map_base +
285 (entry << IO_PAGE_SHIFT));
286 ret = bus_addr | (oaddr & ~IO_PAGE_MASK);
287 base_paddr = __pa(oaddr & IO_PAGE_MASK);
288 prot = HV_PCI_MAP_ATTR_READ;
289 if (direction != PCI_DMA_TODEVICE)
290 prot |= HV_PCI_MAP_ATTR_WRITE;
291
292 local_irq_save(flags);
293
294 pci_iommu_batch_start(pdev, prot, entry);
295
296 for (i = 0; i < npages; i++, base_paddr += IO_PAGE_SIZE) {
297 long err = pci_iommu_batch_add(base_paddr);
298 if (unlikely(err < 0L))
299 goto iommu_map_fail;
300 }
301 if (unlikely(pci_iommu_batch_end() < 0L))
302 goto iommu_map_fail;
303
304 local_irq_restore(flags);
305
306 return ret;
307
308bad:
309 if (printk_ratelimit())
310 WARN_ON(1);
311 return PCI_DMA_ERROR_CODE;
312
313iommu_map_fail:
314 /* Interrupts are disabled. */
315 spin_lock(&iommu->lock);
316 pci_arena_free(&iommu->arena, entry, npages);
317 spin_unlock_irqrestore(&iommu->lock, flags);
318
319 return PCI_DMA_ERROR_CODE;
320}
321
322static void pci_4v_unmap_single(struct pci_dev *pdev, dma_addr_t bus_addr, size_t sz, int direction)
323{
324 struct pcidev_cookie *pcp;
325 struct pci_iommu *iommu;
326 unsigned long flags, npages;
327 long entry;
328 u32 devhandle;
329
330 if (unlikely(direction == PCI_DMA_NONE)) {
331 if (printk_ratelimit())
332 WARN_ON(1);
333 return;
334 }
335
336 pcp = pdev->sysdata;
337 iommu = pcp->pbm->iommu;
338 devhandle = pcp->pbm->devhandle;
339
340 npages = IO_PAGE_ALIGN(bus_addr + sz) - (bus_addr & IO_PAGE_MASK);
341 npages >>= IO_PAGE_SHIFT;
342 bus_addr &= IO_PAGE_MASK;
343
344 spin_lock_irqsave(&iommu->lock, flags);
345
346 entry = (bus_addr - iommu->page_table_map_base) >> IO_PAGE_SHIFT;
347 pci_arena_free(&iommu->arena, entry, npages);
348
349 do {
350 unsigned long num;
351
352 num = pci_sun4v_iommu_demap(devhandle, HV_PCI_TSBID(0, entry),
353 npages);
354 entry += num;
355 npages -= num;
356 } while (npages != 0);
357
358 spin_unlock_irqrestore(&iommu->lock, flags);
359}
360
361#define SG_ENT_PHYS_ADDRESS(SG) \
362 (__pa(page_address((SG)->page)) + (SG)->offset)
363
364static inline long fill_sg(long entry, struct pci_dev *pdev,
365 struct scatterlist *sg,
366 int nused, int nelems, unsigned long prot)
367{
368 struct scatterlist *dma_sg = sg;
369 struct scatterlist *sg_end = sg + nelems;
370 unsigned long flags;
371 int i;
372
373 local_irq_save(flags);
374
375 pci_iommu_batch_start(pdev, prot, entry);
376
377 for (i = 0; i < nused; i++) {
378 unsigned long pteval = ~0UL;
379 u32 dma_npages;
380
381 dma_npages = ((dma_sg->dma_address & (IO_PAGE_SIZE - 1UL)) +
382 dma_sg->dma_length +
383 ((IO_PAGE_SIZE - 1UL))) >> IO_PAGE_SHIFT;
384 do {
385 unsigned long offset;
386 signed int len;
387
388 /* If we are here, we know we have at least one
389 * more page to map. So walk forward until we
390 * hit a page crossing, and begin creating new
391 * mappings from that spot.
392 */
393 for (;;) {
394 unsigned long tmp;
395
396 tmp = SG_ENT_PHYS_ADDRESS(sg);
397 len = sg->length;
398 if (((tmp ^ pteval) >> IO_PAGE_SHIFT) != 0UL) {
399 pteval = tmp & IO_PAGE_MASK;
400 offset = tmp & (IO_PAGE_SIZE - 1UL);
401 break;
402 }
403 if (((tmp ^ (tmp + len - 1UL)) >> IO_PAGE_SHIFT) != 0UL) {
404 pteval = (tmp + IO_PAGE_SIZE) & IO_PAGE_MASK;
405 offset = 0UL;
406 len -= (IO_PAGE_SIZE - (tmp & (IO_PAGE_SIZE - 1UL)));
407 break;
408 }
409 sg++;
410 }
411
412 pteval = (pteval & IOPTE_PAGE);
413 while (len > 0) {
414 long err;
415
416 err = pci_iommu_batch_add(pteval);
417 if (unlikely(err < 0L))
418 goto iommu_map_failed;
419
420 pteval += IO_PAGE_SIZE;
421 len -= (IO_PAGE_SIZE - offset);
422 offset = 0;
423 dma_npages--;
424 }
425
426 pteval = (pteval & IOPTE_PAGE) + len;
427 sg++;
428
429 /* Skip over any tail mappings we've fully mapped,
430 * adjusting pteval along the way. Stop when we
431 * detect a page crossing event.
432 */
433 while (sg < sg_end &&
434 (pteval << (64 - IO_PAGE_SHIFT)) != 0UL &&
435 (pteval == SG_ENT_PHYS_ADDRESS(sg)) &&
436 ((pteval ^
437 (SG_ENT_PHYS_ADDRESS(sg) + sg->length - 1UL)) >> IO_PAGE_SHIFT) == 0UL) {
438 pteval += sg->length;
439 sg++;
440 }
441 if ((pteval << (64 - IO_PAGE_SHIFT)) == 0UL)
442 pteval = ~0UL;
443 } while (dma_npages != 0);
444 dma_sg++;
445 }
446
447 if (unlikely(pci_iommu_batch_end() < 0L))
448 goto iommu_map_failed;
449
450 local_irq_restore(flags);
451 return 0;
452
453iommu_map_failed:
454 local_irq_restore(flags);
455 return -1L;
456}
457
458static int pci_4v_map_sg(struct pci_dev *pdev, struct scatterlist *sglist, int nelems, int direction)
459{
460 struct pcidev_cookie *pcp;
461 struct pci_iommu *iommu;
462 unsigned long flags, npages, prot;
463 u32 dma_base;
464 struct scatterlist *sgtmp;
465 long entry, err;
466 int used;
467
468 /* Fast path single entry scatterlists. */
469 if (nelems == 1) {
470 sglist->dma_address =
471 pci_4v_map_single(pdev,
472 (page_address(sglist->page) + sglist->offset),
473 sglist->length, direction);
474 if (unlikely(sglist->dma_address == PCI_DMA_ERROR_CODE))
475 return 0;
476 sglist->dma_length = sglist->length;
477 return 1;
478 }
479
480 pcp = pdev->sysdata;
481 iommu = pcp->pbm->iommu;
482
483 if (unlikely(direction == PCI_DMA_NONE))
484 goto bad;
485
486 /* Step 1: Prepare scatter list. */
487 npages = prepare_sg(sglist, nelems);
488
489 /* Step 2: Allocate a cluster and context, if necessary. */
490 spin_lock_irqsave(&iommu->lock, flags);
491 entry = pci_arena_alloc(&iommu->arena, npages);
492 spin_unlock_irqrestore(&iommu->lock, flags);
493
494 if (unlikely(entry < 0L))
495 goto bad;
496
497 dma_base = iommu->page_table_map_base +
498 (entry << IO_PAGE_SHIFT);
499
500 /* Step 3: Normalize DMA addresses. */
501 used = nelems;
502
503 sgtmp = sglist;
504 while (used && sgtmp->dma_length) {
505 sgtmp->dma_address += dma_base;
506 sgtmp++;
507 used--;
508 }
509 used = nelems - used;
510
511 /* Step 4: Create the mappings. */
512 prot = HV_PCI_MAP_ATTR_READ;
513 if (direction != PCI_DMA_TODEVICE)
514 prot |= HV_PCI_MAP_ATTR_WRITE;
515
516 err = fill_sg(entry, pdev, sglist, used, nelems, prot);
517 if (unlikely(err < 0L))
518 goto iommu_map_failed;
519
520 return used;
521
522bad:
523 if (printk_ratelimit())
524 WARN_ON(1);
525 return 0;
526
527iommu_map_failed:
528 spin_lock_irqsave(&iommu->lock, flags);
529 pci_arena_free(&iommu->arena, entry, npages);
530 spin_unlock_irqrestore(&iommu->lock, flags);
531
532 return 0;
533}
534
535static void pci_4v_unmap_sg(struct pci_dev *pdev, struct scatterlist *sglist, int nelems, int direction)
536{
537 struct pcidev_cookie *pcp;
538 struct pci_iommu *iommu;
539 unsigned long flags, i, npages;
540 long entry;
541 u32 devhandle, bus_addr;
542
543 if (unlikely(direction == PCI_DMA_NONE)) {
544 if (printk_ratelimit())
545 WARN_ON(1);
546 }
547
548 pcp = pdev->sysdata;
549 iommu = pcp->pbm->iommu;
550 devhandle = pcp->pbm->devhandle;
551
552 bus_addr = sglist->dma_address & IO_PAGE_MASK;
553
554 for (i = 1; i < nelems; i++)
555 if (sglist[i].dma_length == 0)
556 break;
557 i--;
558 npages = (IO_PAGE_ALIGN(sglist[i].dma_address + sglist[i].dma_length) -
559 bus_addr) >> IO_PAGE_SHIFT;
560
561 entry = ((bus_addr - iommu->page_table_map_base) >> IO_PAGE_SHIFT);
562
563 spin_lock_irqsave(&iommu->lock, flags);
564
565 pci_arena_free(&iommu->arena, entry, npages);
566
567 do {
568 unsigned long num;
569
570 num = pci_sun4v_iommu_demap(devhandle, HV_PCI_TSBID(0, entry),
571 npages);
572 entry += num;
573 npages -= num;
574 } while (npages != 0);
575
576 spin_unlock_irqrestore(&iommu->lock, flags);
577}
578
579static void pci_4v_dma_sync_single_for_cpu(struct pci_dev *pdev, dma_addr_t bus_addr, size_t sz, int direction)
580{
581 /* Nothing to do... */
582}
583
584static void pci_4v_dma_sync_sg_for_cpu(struct pci_dev *pdev, struct scatterlist *sglist, int nelems, int direction)
585{
586 /* Nothing to do... */
587}
588
589struct pci_iommu_ops pci_sun4v_iommu_ops = {
590 .alloc_consistent = pci_4v_alloc_consistent,
591 .free_consistent = pci_4v_free_consistent,
592 .map_single = pci_4v_map_single,
593 .unmap_single = pci_4v_unmap_single,
594 .map_sg = pci_4v_map_sg,
595 .unmap_sg = pci_4v_unmap_sg,
596 .dma_sync_single_for_cpu = pci_4v_dma_sync_single_for_cpu,
597 .dma_sync_sg_for_cpu = pci_4v_dma_sync_sg_for_cpu,
598};
599
600/* SUN4V PCI configuration space accessors. */
601
602static inline int pci_sun4v_out_of_range(struct pci_pbm_info *pbm, unsigned int bus, unsigned int device, unsigned int func)
603{
604 if (bus == pbm->pci_first_busno) {
605 if (device == 0 && func == 0)
606 return 0;
607 return 1;
608 }
609
610 if (bus < pbm->pci_first_busno ||
611 bus > pbm->pci_last_busno)
612 return 1;
613 return 0;
614}
615
616static int pci_sun4v_read_pci_cfg(struct pci_bus *bus_dev, unsigned int devfn,
617 int where, int size, u32 *value)
618{
619 struct pci_pbm_info *pbm = bus_dev->sysdata;
620 u32 devhandle = pbm->devhandle;
621 unsigned int bus = bus_dev->number;
622 unsigned int device = PCI_SLOT(devfn);
623 unsigned int func = PCI_FUNC(devfn);
624 unsigned long ret;
625
626 if (pci_sun4v_out_of_range(pbm, bus, device, func)) {
627 ret = ~0UL;
628 } else {
629 ret = pci_sun4v_config_get(devhandle,
630 HV_PCI_DEVICE_BUILD(bus, device, func),
631 where, size);
632#if 0
633 printk("rcfg: [%x:%x:%x:%d]=[%lx]\n",
634 devhandle, HV_PCI_DEVICE_BUILD(bus, device, func),
635 where, size, ret);
636#endif
637 }
638 switch (size) {
639 case 1:
640 *value = ret & 0xff;
641 break;
642 case 2:
643 *value = ret & 0xffff;
644 break;
645 case 4:
646 *value = ret & 0xffffffff;
647 break;
648 };
649
650
651 return PCIBIOS_SUCCESSFUL;
652}
653
654static int pci_sun4v_write_pci_cfg(struct pci_bus *bus_dev, unsigned int devfn,
655 int where, int size, u32 value)
656{
657 struct pci_pbm_info *pbm = bus_dev->sysdata;
658 u32 devhandle = pbm->devhandle;
659 unsigned int bus = bus_dev->number;
660 unsigned int device = PCI_SLOT(devfn);
661 unsigned int func = PCI_FUNC(devfn);
662 unsigned long ret;
663
664 if (pci_sun4v_out_of_range(pbm, bus, device, func)) {
665 /* Do nothing. */
666 } else {
667 ret = pci_sun4v_config_put(devhandle,
668 HV_PCI_DEVICE_BUILD(bus, device, func),
669 where, size, value);
670#if 0
671 printk("wcfg: [%x:%x:%x:%d] v[%x] == [%lx]\n",
672 devhandle, HV_PCI_DEVICE_BUILD(bus, device, func),
673 where, size, value, ret);
674#endif
675 }
676 return PCIBIOS_SUCCESSFUL;
677}
678
679static struct pci_ops pci_sun4v_ops = {
680 .read = pci_sun4v_read_pci_cfg,
681 .write = pci_sun4v_write_pci_cfg,
682};
683
684
685static void pbm_scan_bus(struct pci_controller_info *p,
686 struct pci_pbm_info *pbm)
687{
688 struct pcidev_cookie *cookie = kmalloc(sizeof(*cookie), GFP_KERNEL);
689
690 if (!cookie) {
691 prom_printf("%s: Critical allocation failure.\n", pbm->name);
692 prom_halt();
693 }
694
695 /* All we care about is the PBM. */
696 memset(cookie, 0, sizeof(*cookie));
697 cookie->pbm = pbm;
698
699 pbm->pci_bus = pci_scan_bus(pbm->pci_first_busno, p->pci_ops, pbm);
700#if 0
701 pci_fixup_host_bridge_self(pbm->pci_bus);
702 pbm->pci_bus->self->sysdata = cookie;
703#endif
704 pci_fill_in_pbm_cookies(pbm->pci_bus, pbm,
705 pbm->prom_node);
706 pci_record_assignments(pbm, pbm->pci_bus);
707 pci_assign_unassigned(pbm, pbm->pci_bus);
708 pci_fixup_irq(pbm, pbm->pci_bus);
709 pci_determine_66mhz_disposition(pbm, pbm->pci_bus);
710 pci_setup_busmastering(pbm, pbm->pci_bus);
711}
712
713static void pci_sun4v_scan_bus(struct pci_controller_info *p)
714{
715 if (p->pbm_A.prom_node) {
716 p->pbm_A.is_66mhz_capable =
717 prom_getbool(p->pbm_A.prom_node, "66mhz-capable");
718
719 pbm_scan_bus(p, &p->pbm_A);
720 }
721 if (p->pbm_B.prom_node) {
722 p->pbm_B.is_66mhz_capable =
723 prom_getbool(p->pbm_B.prom_node, "66mhz-capable");
724
725 pbm_scan_bus(p, &p->pbm_B);
726 }
727
728 /* XXX register error interrupt handlers XXX */
729}
730
731static unsigned int pci_sun4v_irq_build(struct pci_pbm_info *pbm,
732 struct pci_dev *pdev,
733 unsigned int devino)
734{
735 u32 devhandle = pbm->devhandle;
736 int pil;
737
738 pil = 5;
739 if (pdev) {
740 switch ((pdev->class >> 16) & 0xff) {
741 case PCI_BASE_CLASS_STORAGE:
742 pil = 5;
743 break;
744
745 case PCI_BASE_CLASS_NETWORK:
746 pil = 6;
747 break;
748
749 case PCI_BASE_CLASS_DISPLAY:
750 pil = 9;
751 break;
752
753 case PCI_BASE_CLASS_MULTIMEDIA:
754 case PCI_BASE_CLASS_MEMORY:
755 case PCI_BASE_CLASS_BRIDGE:
756 case PCI_BASE_CLASS_SERIAL:
757 pil = 10;
758 break;
759
760 default:
761 pil = 5;
762 break;
763 };
764 }
765 BUG_ON(PIL_RESERVED(pil));
766
767 return sun4v_build_irq(devhandle, devino, pil, IBF_PCI);
768}
769
770static void pci_sun4v_base_address_update(struct pci_dev *pdev, int resource)
771{
772 struct pcidev_cookie *pcp = pdev->sysdata;
773 struct pci_pbm_info *pbm = pcp->pbm;
774 struct resource *res, *root;
775 u32 reg;
776 int where, size, is_64bit;
777
778 res = &pdev->resource[resource];
779 if (resource < 6) {
780 where = PCI_BASE_ADDRESS_0 + (resource * 4);
781 } else if (resource == PCI_ROM_RESOURCE) {
782 where = pdev->rom_base_reg;
783 } else {
784 /* Somebody might have asked allocation of a non-standard resource */
785 return;
786 }
787
788 /* XXX 64-bit MEM handling is not %100 correct... XXX */
789 is_64bit = 0;
790 if (res->flags & IORESOURCE_IO)
791 root = &pbm->io_space;
792 else {
793 root = &pbm->mem_space;
794 if ((res->flags & PCI_BASE_ADDRESS_MEM_TYPE_MASK)
795 == PCI_BASE_ADDRESS_MEM_TYPE_64)
796 is_64bit = 1;
797 }
798
799 size = res->end - res->start;
800 pci_read_config_dword(pdev, where, &reg);
801 reg = ((reg & size) |
802 (((u32)(res->start - root->start)) & ~size));
803 if (resource == PCI_ROM_RESOURCE) {
804 reg |= PCI_ROM_ADDRESS_ENABLE;
805 res->flags |= IORESOURCE_ROM_ENABLE;
806 }
807 pci_write_config_dword(pdev, where, reg);
808
809 /* This knows that the upper 32-bits of the address
810 * must be zero. Our PCI common layer enforces this.
811 */
812 if (is_64bit)
813 pci_write_config_dword(pdev, where + 4, 0);
814}
815
816static void pci_sun4v_resource_adjust(struct pci_dev *pdev,
817 struct resource *res,
818 struct resource *root)
819{
820 res->start += root->start;
821 res->end += root->start;
822}
823
824/* Use ranges property to determine where PCI MEM, I/O, and Config
825 * space are for this PCI bus module.
826 */
827static void pci_sun4v_determine_mem_io_space(struct pci_pbm_info *pbm)
828{
829 int i, saw_mem, saw_io;
830
831 saw_mem = saw_io = 0;
832 for (i = 0; i < pbm->num_pbm_ranges; i++) {
833 struct linux_prom_pci_ranges *pr = &pbm->pbm_ranges[i];
834 unsigned long a;
835 int type;
836
837 type = (pr->child_phys_hi >> 24) & 0x3;
838 a = (((unsigned long)pr->parent_phys_hi << 32UL) |
839 ((unsigned long)pr->parent_phys_lo << 0UL));
840
841 switch (type) {
842 case 1:
843 /* 16-bit IO space, 16MB */
844 pbm->io_space.start = a;
845 pbm->io_space.end = a + ((16UL*1024UL*1024UL) - 1UL);
846 pbm->io_space.flags = IORESOURCE_IO;
847 saw_io = 1;
848 break;
849
850 case 2:
851 /* 32-bit MEM space, 2GB */
852 pbm->mem_space.start = a;
853 pbm->mem_space.end = a + (0x80000000UL - 1UL);
854 pbm->mem_space.flags = IORESOURCE_MEM;
855 saw_mem = 1;
856 break;
857
858 case 3:
859 /* XXX 64-bit MEM handling XXX */
860
861 default:
862 break;
863 };
864 }
865
866 if (!saw_io || !saw_mem) {
867 prom_printf("%s: Fatal error, missing %s PBM range.\n",
868 pbm->name,
869 (!saw_io ? "IO" : "MEM"));
870 prom_halt();
871 }
872
873 printk("%s: PCI IO[%lx] MEM[%lx]\n",
874 pbm->name,
875 pbm->io_space.start,
876 pbm->mem_space.start);
877}
878
879static void pbm_register_toplevel_resources(struct pci_controller_info *p,
880 struct pci_pbm_info *pbm)
881{
882 pbm->io_space.name = pbm->mem_space.name = pbm->name;
883
884 request_resource(&ioport_resource, &pbm->io_space);
885 request_resource(&iomem_resource, &pbm->mem_space);
886 pci_register_legacy_regions(&pbm->io_space,
887 &pbm->mem_space);
888}
889
890static unsigned long probe_existing_entries(struct pci_pbm_info *pbm,
891 struct pci_iommu *iommu)
892{
893 struct pci_iommu_arena *arena = &iommu->arena;
894 unsigned long i, cnt = 0;
895 u32 devhandle;
896
897 devhandle = pbm->devhandle;
898 for (i = 0; i < arena->limit; i++) {
899 unsigned long ret, io_attrs, ra;
900
901 ret = pci_sun4v_iommu_getmap(devhandle,
902 HV_PCI_TSBID(0, i),
903 &io_attrs, &ra);
904 if (ret == HV_EOK) {
905 cnt++;
906 __set_bit(i, arena->map);
907 }
908 }
909
910 return cnt;
911}
912
913static void pci_sun4v_iommu_init(struct pci_pbm_info *pbm)
914{
915 struct pci_iommu *iommu = pbm->iommu;
916 unsigned long num_tsb_entries, sz;
917 u32 vdma[2], dma_mask, dma_offset;
918 int err, tsbsize;
919
920 err = prom_getproperty(pbm->prom_node, "virtual-dma",
921 (char *)&vdma[0], sizeof(vdma));
922 if (err == 0 || err == -1) {
923 /* No property, use default values. */
924 vdma[0] = 0x80000000;
925 vdma[1] = 0x80000000;
926 }
927
928 dma_mask = vdma[0];
929 switch (vdma[1]) {
930 case 0x20000000:
931 dma_mask |= 0x1fffffff;
932 tsbsize = 64;
933 break;
934
935 case 0x40000000:
936 dma_mask |= 0x3fffffff;
937 tsbsize = 128;
938 break;
939
940 case 0x80000000:
941 dma_mask |= 0x7fffffff;
942 tsbsize = 256;
943 break;
944
945 default:
946 prom_printf("PCI-SUN4V: strange virtual-dma size.\n");
947 prom_halt();
948 };
949
950 tsbsize *= (8 * 1024);
951
952 num_tsb_entries = tsbsize / sizeof(iopte_t);
953
954 dma_offset = vdma[0];
955
956 /* Setup initial software IOMMU state. */
957 spin_lock_init(&iommu->lock);
958 iommu->ctx_lowest_free = 1;
959 iommu->page_table_map_base = dma_offset;
960 iommu->dma_addr_mask = dma_mask;
961
962 /* Allocate and initialize the free area map. */
963 sz = num_tsb_entries / 8;
964 sz = (sz + 7UL) & ~7UL;
965 iommu->arena.map = kmalloc(sz, GFP_KERNEL);
966 if (!iommu->arena.map) {
967 prom_printf("PCI_IOMMU: Error, kmalloc(arena.map) failed.\n");
968 prom_halt();
969 }
970 memset(iommu->arena.map, 0, sz);
971 iommu->arena.limit = num_tsb_entries;
972
973 sz = probe_existing_entries(pbm, iommu);
974
975 printk("%s: TSB entries [%lu], existing mapings [%lu]\n",
976 pbm->name, num_tsb_entries, sz);
977}
978
979static void pci_sun4v_get_bus_range(struct pci_pbm_info *pbm)
980{
981 unsigned int busrange[2];
982 int prom_node = pbm->prom_node;
983 int err;
984
985 err = prom_getproperty(prom_node, "bus-range",
986 (char *)&busrange[0],
987 sizeof(busrange));
988 if (err == 0 || err == -1) {
989 prom_printf("%s: Fatal error, no bus-range.\n", pbm->name);
990 prom_halt();
991 }
992
993 pbm->pci_first_busno = busrange[0];
994 pbm->pci_last_busno = busrange[1];
995
996}
997
998static void pci_sun4v_pbm_init(struct pci_controller_info *p, int prom_node, u32 devhandle)
999{
1000 struct pci_pbm_info *pbm;
1001 int err, i;
1002
1003 if (devhandle & 0x40)
1004 pbm = &p->pbm_B;
1005 else
1006 pbm = &p->pbm_A;
1007
1008 pbm->parent = p;
1009 pbm->prom_node = prom_node;
1010 pbm->pci_first_slot = 1;
1011
1012 pbm->devhandle = devhandle;
1013
1014 sprintf(pbm->name, "SUN4V-PCI%d PBM%c",
1015 p->index, (pbm == &p->pbm_A ? 'A' : 'B'));
1016
1017 printk("%s: devhandle[%x] prom_node[%x:%x]\n",
1018 pbm->name, pbm->devhandle,
1019 pbm->prom_node, prom_getchild(pbm->prom_node));
1020
1021 prom_getstring(prom_node, "name",
1022 pbm->prom_name, sizeof(pbm->prom_name));
1023
1024 err = prom_getproperty(prom_node, "ranges",
1025 (char *) pbm->pbm_ranges,
1026 sizeof(pbm->pbm_ranges));
1027 if (err == 0 || err == -1) {
1028 prom_printf("%s: Fatal error, no ranges property.\n",
1029 pbm->name);
1030 prom_halt();
1031 }
1032
1033 pbm->num_pbm_ranges =
1034 (err / sizeof(struct linux_prom_pci_ranges));
1035
1036 /* Mask out the top 8 bits of the ranges, leaving the real
1037 * physical address.
1038 */
1039 for (i = 0; i < pbm->num_pbm_ranges; i++)
1040 pbm->pbm_ranges[i].parent_phys_hi &= 0x0fffffff;
1041
1042 pci_sun4v_determine_mem_io_space(pbm);
1043 pbm_register_toplevel_resources(p, pbm);
1044
1045 err = prom_getproperty(prom_node, "interrupt-map",
1046 (char *)pbm->pbm_intmap,
1047 sizeof(pbm->pbm_intmap));
1048 if (err == 0 || err == -1) {
1049 prom_printf("%s: Fatal error, no interrupt-map property.\n",
1050 pbm->name);
1051 prom_halt();
1052 }
1053
1054 pbm->num_pbm_intmap = (err / sizeof(struct linux_prom_pci_intmap));
1055 err = prom_getproperty(prom_node, "interrupt-map-mask",
1056 (char *)&pbm->pbm_intmask,
1057 sizeof(pbm->pbm_intmask));
1058 if (err == 0 || err == -1) {
1059 prom_printf("%s: Fatal error, no interrupt-map-mask.\n",
1060 pbm->name);
1061 prom_halt();
1062 }
1063
1064 pci_sun4v_get_bus_range(pbm);
1065 pci_sun4v_iommu_init(pbm);
1066}
1067
1068void sun4v_pci_init(int node, char *model_name)
1069{
1070 struct pci_controller_info *p;
1071 struct pci_iommu *iommu;
1072 struct linux_prom64_registers regs;
1073 u32 devhandle;
1074 int i;
1075
1076 prom_getproperty(node, "reg", (char *)&regs, sizeof(regs));
1077 devhandle = (regs.phys_addr >> 32UL) & 0x0fffffff;
1078
1079 for (p = pci_controller_root; p; p = p->next) {
1080 struct pci_pbm_info *pbm;
1081
1082 if (p->pbm_A.prom_node && p->pbm_B.prom_node)
1083 continue;
1084
1085 pbm = (p->pbm_A.prom_node ?
1086 &p->pbm_A :
1087 &p->pbm_B);
1088
1089 if (pbm->devhandle == (devhandle ^ 0x40)) {
1090 pci_sun4v_pbm_init(p, node, devhandle);
1091 return;
1092 }
1093 }
1094
1095 for_each_cpu(i) {
1096 unsigned long page = get_zeroed_page(GFP_ATOMIC);
1097
1098 if (!page)
1099 goto fatal_memory_error;
1100
1101 per_cpu(pci_iommu_batch, i).pglist = (u64 *) page;
1102 }
1103
1104 p = kmalloc(sizeof(struct pci_controller_info), GFP_ATOMIC);
1105 if (!p)
1106 goto fatal_memory_error;
1107
1108 memset(p, 0, sizeof(*p));
1109
1110 iommu = kmalloc(sizeof(struct pci_iommu), GFP_ATOMIC);
1111 if (!iommu)
1112 goto fatal_memory_error;
1113
1114 memset(iommu, 0, sizeof(*iommu));
1115 p->pbm_A.iommu = iommu;
1116
1117 iommu = kmalloc(sizeof(struct pci_iommu), GFP_ATOMIC);
1118 if (!iommu)
1119 goto fatal_memory_error;
1120
1121 memset(iommu, 0, sizeof(*iommu));
1122 p->pbm_B.iommu = iommu;
1123
1124 p->next = pci_controller_root;
1125 pci_controller_root = p;
1126
1127 p->index = pci_num_controllers++;
1128 p->pbms_same_domain = 0;
1129
1130 p->scan_bus = pci_sun4v_scan_bus;
1131 p->irq_build = pci_sun4v_irq_build;
1132 p->base_address_update = pci_sun4v_base_address_update;
1133 p->resource_adjust = pci_sun4v_resource_adjust;
1134 p->pci_ops = &pci_sun4v_ops;
1135
1136 /* Like PSYCHO and SCHIZO we have a 2GB aligned area
1137 * for memory space.
1138 */
1139 pci_memspace_mask = 0x7fffffffUL;
1140
1141 pci_sun4v_pbm_init(p, node, devhandle);
1142 return;
1143
1144fatal_memory_error:
1145 prom_printf("SUN4V_PCI: Fatal memory allocation error.\n");
1146 prom_halt();
1147}
diff --git a/arch/sparc64/kernel/pci_sun4v.h b/arch/sparc64/kernel/pci_sun4v.h
new file mode 100644
index 000000000000..884d25f6158d
--- /dev/null
+++ b/arch/sparc64/kernel/pci_sun4v.h
@@ -0,0 +1,31 @@
1/* pci_sun4v.h: SUN4V specific PCI controller support.
2 *
3 * Copyright (C) 2006 David S. Miller (davem@davemloft.net)
4 */
5
6#ifndef _PCI_SUN4V_H
7#define _PCI_SUN4V_H
8
9extern long pci_sun4v_iommu_map(unsigned long devhandle,
10 unsigned long tsbid,
11 unsigned long num_ttes,
12 unsigned long io_attributes,
13 unsigned long io_page_list_pa);
14extern unsigned long pci_sun4v_iommu_demap(unsigned long devhandle,
15 unsigned long tsbid,
16 unsigned long num_ttes);
17extern unsigned long pci_sun4v_iommu_getmap(unsigned long devhandle,
18 unsigned long tsbid,
19 unsigned long *io_attributes,
20 unsigned long *real_address);
21extern unsigned long pci_sun4v_config_get(unsigned long devhandle,
22 unsigned long pci_device,
23 unsigned long config_offset,
24 unsigned long size);
25extern int pci_sun4v_config_put(unsigned long devhandle,
26 unsigned long pci_device,
27 unsigned long config_offset,
28 unsigned long size,
29 unsigned long data);
30
31#endif /* !(_PCI_SUN4V_H) */
diff --git a/arch/sparc64/kernel/pci_sun4v_asm.S b/arch/sparc64/kernel/pci_sun4v_asm.S
new file mode 100644
index 000000000000..6604fdbf746c
--- /dev/null
+++ b/arch/sparc64/kernel/pci_sun4v_asm.S
@@ -0,0 +1,95 @@
1/* pci_sun4v_asm: Hypervisor calls for PCI support.
2 *
3 * Copyright (C) 2006 David S. Miller <davem@davemloft.net>
4 */
5
6#include <asm/hypervisor.h>
7
8 /* %o0: devhandle
9 * %o1: tsbid
10 * %o2: num ttes
11 * %o3: io_attributes
12 * %o4: io_page_list phys address
13 *
14 * returns %o0: -status if status was non-zero, else
15 * %o0: num pages mapped
16 */
17 .globl pci_sun4v_iommu_map
18pci_sun4v_iommu_map:
19 mov %o5, %g1
20 mov HV_FAST_PCI_IOMMU_MAP, %o5
21 ta HV_FAST_TRAP
22 brnz,pn %o0, 1f
23 sub %g0, %o0, %o0
24 mov %o1, %o0
251: retl
26 nop
27
28 /* %o0: devhandle
29 * %o1: tsbid
30 * %o2: num ttes
31 *
32 * returns %o0: num ttes demapped
33 */
34 .globl pci_sun4v_iommu_demap
35pci_sun4v_iommu_demap:
36 mov HV_FAST_PCI_IOMMU_DEMAP, %o5
37 ta HV_FAST_TRAP
38 retl
39 mov %o1, %o0
40
41 /* %o0: devhandle
42 * %o1: tsbid
43 * %o2: &io_attributes
44 * %o3: &real_address
45 *
46 * returns %o0: status
47 */
48 .globl pci_sun4v_iommu_getmap
49pci_sun4v_iommu_getmap:
50 mov %o2, %o4
51 mov HV_FAST_PCI_IOMMU_GETMAP, %o5
52 ta HV_FAST_TRAP
53 stx %o1, [%o4]
54 stx %o2, [%o3]
55 retl
56 mov %o0, %o0
57
58 /* %o0: devhandle
59 * %o1: pci_device
60 * %o2: pci_config_offset
61 * %o3: size
62 *
63 * returns %o0: data
64 *
65 * If there is an error, the data will be returned
66 * as all 1's.
67 */
68 .globl pci_sun4v_config_get
69pci_sun4v_config_get:
70 mov HV_FAST_PCI_CONFIG_GET, %o5
71 ta HV_FAST_TRAP
72 brnz,a,pn %o1, 1f
73 mov -1, %o2
741: retl
75 mov %o2, %o0
76
77 /* %o0: devhandle
78 * %o1: pci_device
79 * %o2: pci_config_offset
80 * %o3: size
81 * %o4: data
82 *
83 * returns %o0: status
84 *
85 * status will be zero if the operation completed
86 * successfully, else -1 if not
87 */
88 .globl pci_sun4v_config_put
89pci_sun4v_config_put:
90 mov HV_FAST_PCI_CONFIG_PUT, %o5
91 ta HV_FAST_TRAP
92 brnz,a,pn %o1, 1f
93 mov -1, %o1
941: retl
95 mov %o1, %o0
diff --git a/arch/sparc64/kernel/process.c b/arch/sparc64/kernel/process.c
index 059b0d025224..1c7ca2f712d9 100644
--- a/arch/sparc64/kernel/process.c
+++ b/arch/sparc64/kernel/process.c
@@ -44,83 +44,61 @@
44#include <asm/fpumacro.h> 44#include <asm/fpumacro.h>
45#include <asm/head.h> 45#include <asm/head.h>
46#include <asm/cpudata.h> 46#include <asm/cpudata.h>
47#include <asm/mmu_context.h>
47#include <asm/unistd.h> 48#include <asm/unistd.h>
49#include <asm/hypervisor.h>
48 50
49/* #define VERBOSE_SHOWREGS */ 51/* #define VERBOSE_SHOWREGS */
50 52
51/* 53static void sparc64_yield(void)
52 * Nothing special yet...
53 */
54void default_idle(void)
55{
56}
57
58#ifndef CONFIG_SMP
59
60/*
61 * the idle loop on a Sparc... ;)
62 */
63void cpu_idle(void)
64{ 54{
65 /* endless idle loop with no priority at all */ 55 if (tlb_type != hypervisor)
66 for (;;) { 56 return;
67 /* If current->work.need_resched is zero we should really
68 * setup for a system wakup event and execute a shutdown
69 * instruction.
70 *
71 * But this requires writing back the contents of the
72 * L2 cache etc. so implement this later. -DaveM
73 */
74 while (!need_resched())
75 barrier();
76 57
77 preempt_enable_no_resched(); 58 clear_thread_flag(TIF_POLLING_NRFLAG);
78 schedule(); 59 smp_mb__after_clear_bit();
79 preempt_disable(); 60
80 check_pgt_cache(); 61 while (!need_resched()) {
62 unsigned long pstate;
63
64 /* Disable interrupts. */
65 __asm__ __volatile__(
66 "rdpr %%pstate, %0\n\t"
67 "andn %0, %1, %0\n\t"
68 "wrpr %0, %%g0, %%pstate"
69 : "=&r" (pstate)
70 : "i" (PSTATE_IE));
71
72 if (!need_resched())
73 sun4v_cpu_yield();
74
75 /* Re-enable interrupts. */
76 __asm__ __volatile__(
77 "rdpr %%pstate, %0\n\t"
78 "or %0, %1, %0\n\t"
79 "wrpr %0, %%g0, %%pstate"
80 : "=&r" (pstate)
81 : "i" (PSTATE_IE));
81 } 82 }
82}
83 83
84#else 84 set_thread_flag(TIF_POLLING_NRFLAG);
85}
85 86
86/* 87/* The idle loop on sparc64. */
87 * the idle loop on a UltraMultiPenguin...
88 *
89 * TIF_POLLING_NRFLAG is set because we do not sleep the cpu
90 * inside of the idler task, so an interrupt is not needed
91 * to get a clean fast response.
92 *
93 * XXX Reverify this assumption... -DaveM
94 *
95 * Addendum: We do want it to do something for the signal
96 * delivery case, we detect that by just seeing
97 * if we are trying to send this to an idler or not.
98 */
99void cpu_idle(void) 88void cpu_idle(void)
100{ 89{
101 cpuinfo_sparc *cpuinfo = &local_cpu_data();
102 set_thread_flag(TIF_POLLING_NRFLAG); 90 set_thread_flag(TIF_POLLING_NRFLAG);
103 91
104 while(1) { 92 while(1) {
105 if (need_resched()) { 93 if (need_resched()) {
106 cpuinfo->idle_volume = 0;
107 preempt_enable_no_resched(); 94 preempt_enable_no_resched();
108 schedule(); 95 schedule();
109 preempt_disable(); 96 preempt_disable();
110 check_pgt_cache();
111 } 97 }
112 cpuinfo->idle_volume++; 98 sparc64_yield();
113
114 /* The store ordering is so that IRQ handlers on
115 * other cpus see our increasing idleness for the buddy
116 * redistribution algorithm. -DaveM
117 */
118 membar_storeload_storestore();
119 } 99 }
120} 100}
121 101
122#endif
123
124extern char reboot_command []; 102extern char reboot_command [];
125 103
126extern void (*prom_palette)(int); 104extern void (*prom_palette)(int);
@@ -354,6 +332,7 @@ void show_regs(struct pt_regs *regs)
354 extern long etrap, etraptl1; 332 extern long etrap, etraptl1;
355#endif 333#endif
356 __show_regs(regs); 334 __show_regs(regs);
335#if 0
357#ifdef CONFIG_SMP 336#ifdef CONFIG_SMP
358 { 337 {
359 extern void smp_report_regs(void); 338 extern void smp_report_regs(void);
@@ -361,6 +340,7 @@ void show_regs(struct pt_regs *regs)
361 smp_report_regs(); 340 smp_report_regs();
362 } 341 }
363#endif 342#endif
343#endif
364 344
365#ifdef VERBOSE_SHOWREGS 345#ifdef VERBOSE_SHOWREGS
366 if (regs->tpc >= &etrap && regs->tpc < &etraptl1 && 346 if (regs->tpc >= &etrap && regs->tpc < &etraptl1 &&
@@ -433,30 +413,15 @@ void exit_thread(void)
433void flush_thread(void) 413void flush_thread(void)
434{ 414{
435 struct thread_info *t = current_thread_info(); 415 struct thread_info *t = current_thread_info();
416 struct mm_struct *mm;
436 417
437 if (t->flags & _TIF_ABI_PENDING) 418 if (t->flags & _TIF_ABI_PENDING)
438 t->flags ^= (_TIF_ABI_PENDING | _TIF_32BIT); 419 t->flags ^= (_TIF_ABI_PENDING | _TIF_32BIT);
439 420
440 if (t->task->mm) { 421 mm = t->task->mm;
441 unsigned long pgd_cache = 0UL; 422 if (mm)
442 if (test_thread_flag(TIF_32BIT)) { 423 tsb_context_switch(mm);
443 struct mm_struct *mm = t->task->mm;
444 pgd_t *pgd0 = &mm->pgd[0];
445 pud_t *pud0 = pud_offset(pgd0, 0);
446 424
447 if (pud_none(*pud0)) {
448 pmd_t *page = pmd_alloc_one(mm, 0);
449 pud_set(pud0, page);
450 }
451 pgd_cache = get_pgd_cache(pgd0);
452 }
453 __asm__ __volatile__("stxa %0, [%1] %2\n\t"
454 "membar #Sync"
455 : /* no outputs */
456 : "r" (pgd_cache),
457 "r" (TSB_REG),
458 "i" (ASI_DMMU));
459 }
460 set_thread_wsaved(0); 425 set_thread_wsaved(0);
461 426
462 /* Turn off performance counters if on. */ 427 /* Turn off performance counters if on. */
@@ -555,6 +520,18 @@ void synchronize_user_stack(void)
555 } 520 }
556} 521}
557 522
523static void stack_unaligned(unsigned long sp)
524{
525 siginfo_t info;
526
527 info.si_signo = SIGBUS;
528 info.si_errno = 0;
529 info.si_code = BUS_ADRALN;
530 info.si_addr = (void __user *) sp;
531 info.si_trapno = 0;
532 force_sig_info(SIGBUS, &info, current);
533}
534
558void fault_in_user_windows(void) 535void fault_in_user_windows(void)
559{ 536{
560 struct thread_info *t = current_thread_info(); 537 struct thread_info *t = current_thread_info();
@@ -570,13 +547,17 @@ void fault_in_user_windows(void)
570 flush_user_windows(); 547 flush_user_windows();
571 window = get_thread_wsaved(); 548 window = get_thread_wsaved();
572 549
573 if (window != 0) { 550 if (likely(window != 0)) {
574 window -= 1; 551 window -= 1;
575 do { 552 do {
576 unsigned long sp = (t->rwbuf_stkptrs[window] + bias); 553 unsigned long sp = (t->rwbuf_stkptrs[window] + bias);
577 struct reg_window *rwin = &t->reg_window[window]; 554 struct reg_window *rwin = &t->reg_window[window];
578 555
579 if (copy_to_user((char __user *)sp, rwin, winsize)) 556 if (unlikely(sp & 0x7UL))
557 stack_unaligned(sp);
558
559 if (unlikely(copy_to_user((char __user *)sp,
560 rwin, winsize)))
580 goto barf; 561 goto barf;
581 } while (window--); 562 } while (window--);
582 } 563 }
diff --git a/arch/sparc64/kernel/ptrace.c b/arch/sparc64/kernel/ptrace.c
index 3f9746f856d2..eb93e9c52846 100644
--- a/arch/sparc64/kernel/ptrace.c
+++ b/arch/sparc64/kernel/ptrace.c
@@ -124,6 +124,9 @@ void flush_ptrace_access(struct vm_area_struct *vma, struct page *page,
124{ 124{
125 BUG_ON(len > PAGE_SIZE); 125 BUG_ON(len > PAGE_SIZE);
126 126
127 if (tlb_type == hypervisor)
128 return;
129
127#ifdef DCACHE_ALIASING_POSSIBLE 130#ifdef DCACHE_ALIASING_POSSIBLE
128 /* If bit 13 of the kernel address we used to access the 131 /* If bit 13 of the kernel address we used to access the
129 * user page is the same as the virtual address that page 132 * user page is the same as the virtual address that page
diff --git a/arch/sparc64/kernel/rtrap.S b/arch/sparc64/kernel/rtrap.S
index b80eba0081ca..7130e866f935 100644
--- a/arch/sparc64/kernel/rtrap.S
+++ b/arch/sparc64/kernel/rtrap.S
@@ -223,12 +223,26 @@ rt_continue: ldx [%sp + PTREGS_OFF + PT_V9_G1], %g1
223 ldx [%sp + PTREGS_OFF + PT_V9_G3], %g3 223 ldx [%sp + PTREGS_OFF + PT_V9_G3], %g3
224 ldx [%sp + PTREGS_OFF + PT_V9_G4], %g4 224 ldx [%sp + PTREGS_OFF + PT_V9_G4], %g4
225 ldx [%sp + PTREGS_OFF + PT_V9_G5], %g5 225 ldx [%sp + PTREGS_OFF + PT_V9_G5], %g5
226 mov TSB_REG, %g6 226 brz,pt %l3, 1f
227 brnz,a,pn %l3, 1f 227 mov %g6, %l2
228 ldxa [%g6] ASI_IMMU, %g5 228
2291: ldx [%sp + PTREGS_OFF + PT_V9_G6], %g6 229 /* Must do this before thread reg is clobbered below. */
230 LOAD_PER_CPU_BASE(%g5, %g6, %i0, %i1, %i2)
2311:
232 ldx [%sp + PTREGS_OFF + PT_V9_G6], %g6
230 ldx [%sp + PTREGS_OFF + PT_V9_G7], %g7 233 ldx [%sp + PTREGS_OFF + PT_V9_G7], %g7
231 wrpr %g0, RTRAP_PSTATE_AG_IRQOFF, %pstate 234
235 /* Normal globals are restored, go to trap globals. */
236661: wrpr %g0, RTRAP_PSTATE_AG_IRQOFF, %pstate
237 nop
238 .section .sun4v_2insn_patch, "ax"
239 .word 661b
240 wrpr %g0, RTRAP_PSTATE_IRQOFF, %pstate
241 SET_GL(1)
242 .previous
243
244 mov %l2, %g6
245
232 ldx [%sp + PTREGS_OFF + PT_V9_I0], %i0 246 ldx [%sp + PTREGS_OFF + PT_V9_I0], %i0
233 ldx [%sp + PTREGS_OFF + PT_V9_I1], %i1 247 ldx [%sp + PTREGS_OFF + PT_V9_I1], %i1
234 248
@@ -252,27 +266,108 @@ rt_continue: ldx [%sp + PTREGS_OFF + PT_V9_G1], %g1
252 266
253 brnz,pn %l3, kern_rtt 267 brnz,pn %l3, kern_rtt
254 mov PRIMARY_CONTEXT, %l7 268 mov PRIMARY_CONTEXT, %l7
255 ldxa [%l7 + %l7] ASI_DMMU, %l0 269
270661: ldxa [%l7 + %l7] ASI_DMMU, %l0
271 .section .sun4v_1insn_patch, "ax"
272 .word 661b
273 ldxa [%l7 + %l7] ASI_MMU, %l0
274 .previous
275
256 sethi %hi(sparc64_kern_pri_nuc_bits), %l1 276 sethi %hi(sparc64_kern_pri_nuc_bits), %l1
257 ldx [%l1 + %lo(sparc64_kern_pri_nuc_bits)], %l1 277 ldx [%l1 + %lo(sparc64_kern_pri_nuc_bits)], %l1
258 or %l0, %l1, %l0 278 or %l0, %l1, %l0
259 stxa %l0, [%l7] ASI_DMMU 279
260 flush %g6 280661: stxa %l0, [%l7] ASI_DMMU
281 .section .sun4v_1insn_patch, "ax"
282 .word 661b
283 stxa %l0, [%l7] ASI_MMU
284 .previous
285
286 sethi %hi(KERNBASE), %l7
287 flush %l7
261 rdpr %wstate, %l1 288 rdpr %wstate, %l1
262 rdpr %otherwin, %l2 289 rdpr %otherwin, %l2
263 srl %l1, 3, %l1 290 srl %l1, 3, %l1
264 291
265 wrpr %l2, %g0, %canrestore 292 wrpr %l2, %g0, %canrestore
266 wrpr %l1, %g0, %wstate 293 wrpr %l1, %g0, %wstate
267 wrpr %g0, %g0, %otherwin 294 brnz,pt %l2, user_rtt_restore
295 wrpr %g0, %g0, %otherwin
296
297 ldx [%g6 + TI_FLAGS], %g3
298 wr %g0, ASI_AIUP, %asi
299 rdpr %cwp, %g1
300 andcc %g3, _TIF_32BIT, %g0
301 sub %g1, 1, %g1
302 bne,pt %xcc, user_rtt_fill_32bit
303 wrpr %g1, %cwp
304 ba,a,pt %xcc, user_rtt_fill_64bit
305
306user_rtt_fill_fixup:
307 rdpr %cwp, %g1
308 add %g1, 1, %g1
309 wrpr %g1, 0x0, %cwp
310
311 rdpr %wstate, %g2
312 sll %g2, 3, %g2
313 wrpr %g2, 0x0, %wstate
314
315 /* We know %canrestore and %otherwin are both zero. */
316
317 sethi %hi(sparc64_kern_pri_context), %g2
318 ldx [%g2 + %lo(sparc64_kern_pri_context)], %g2
319 mov PRIMARY_CONTEXT, %g1
320
321661: stxa %g2, [%g1] ASI_DMMU
322 .section .sun4v_1insn_patch, "ax"
323 .word 661b
324 stxa %g2, [%g1] ASI_MMU
325 .previous
326
327 sethi %hi(KERNBASE), %g1
328 flush %g1
329
330 or %g4, FAULT_CODE_WINFIXUP, %g4
331 stb %g4, [%g6 + TI_FAULT_CODE]
332 stx %g5, [%g6 + TI_FAULT_ADDR]
333
334 mov %g6, %l1
335 wrpr %g0, 0x0, %tl
336
337661: nop
338 .section .sun4v_1insn_patch, "ax"
339 .word 661b
340 SET_GL(0)
341 .previous
342
343 wrpr %g0, RTRAP_PSTATE, %pstate
344
345 mov %l1, %g6
346 ldx [%g6 + TI_TASK], %g4
347 LOAD_PER_CPU_BASE(%g5, %g6, %g1, %g2, %g3)
348 call do_sparc64_fault
349 add %sp, PTREGS_OFF, %o0
350 ba,pt %xcc, rtrap
351 nop
352
353user_rtt_pre_restore:
354 add %g1, 1, %g1
355 wrpr %g1, 0x0, %cwp
356
357user_rtt_restore:
268 restore 358 restore
269 rdpr %canrestore, %g1 359 rdpr %canrestore, %g1
270 wrpr %g1, 0x0, %cleanwin 360 wrpr %g1, 0x0, %cleanwin
271 retry 361 retry
272 nop 362 nop
273 363
274kern_rtt: restore 364kern_rtt: rdpr %canrestore, %g1
365 brz,pn %g1, kern_rtt_fill
366 nop
367kern_rtt_restore:
368 restore
275 retry 369 retry
370
276to_kernel: 371to_kernel:
277#ifdef CONFIG_PREEMPT 372#ifdef CONFIG_PREEMPT
278 ldsw [%g6 + TI_PRE_COUNT], %l5 373 ldsw [%g6 + TI_PRE_COUNT], %l5
diff --git a/arch/sparc64/kernel/sbus.c b/arch/sparc64/kernel/sbus.c
index d95a1bcf163d..1d6ffdeabd4c 100644
--- a/arch/sparc64/kernel/sbus.c
+++ b/arch/sparc64/kernel/sbus.c
@@ -693,11 +693,11 @@ void sbus_set_sbus64(struct sbus_dev *sdev, int bursts)
693 693
694/* SBUS SYSIO INO number to Sparc PIL level. */ 694/* SBUS SYSIO INO number to Sparc PIL level. */
695static unsigned char sysio_ino_to_pil[] = { 695static unsigned char sysio_ino_to_pil[] = {
696 0, 4, 4, 7, 5, 7, 8, 9, /* SBUS slot 0 */ 696 0, 5, 5, 7, 5, 7, 8, 9, /* SBUS slot 0 */
697 0, 4, 4, 7, 5, 7, 8, 9, /* SBUS slot 1 */ 697 0, 5, 5, 7, 5, 7, 8, 9, /* SBUS slot 1 */
698 0, 4, 4, 7, 5, 7, 8, 9, /* SBUS slot 2 */ 698 0, 5, 5, 7, 5, 7, 8, 9, /* SBUS slot 2 */
699 0, 4, 4, 7, 5, 7, 8, 9, /* SBUS slot 3 */ 699 0, 5, 5, 7, 5, 7, 8, 9, /* SBUS slot 3 */
700 4, /* Onboard SCSI */ 700 5, /* Onboard SCSI */
701 5, /* Onboard Ethernet */ 701 5, /* Onboard Ethernet */
702/*XXX*/ 8, /* Onboard BPP */ 702/*XXX*/ 8, /* Onboard BPP */
703 0, /* Bogon */ 703 0, /* Bogon */
diff --git a/arch/sparc64/kernel/setup.c b/arch/sparc64/kernel/setup.c
index 158bd31e15b7..7d0e67c1ce50 100644
--- a/arch/sparc64/kernel/setup.c
+++ b/arch/sparc64/kernel/setup.c
@@ -64,12 +64,6 @@ struct screen_info screen_info = {
64 16 /* orig-video-points */ 64 16 /* orig-video-points */
65}; 65};
66 66
67/* Typing sync at the prom prompt calls the function pointed to by
68 * the sync callback which I set to the following function.
69 * This should sync all filesystems and return, for now it just
70 * prints out pretty messages and returns.
71 */
72
73void (*prom_palette)(int); 67void (*prom_palette)(int);
74void (*prom_keyboard)(void); 68void (*prom_keyboard)(void);
75 69
@@ -79,259 +73,6 @@ prom_console_write(struct console *con, const char *s, unsigned n)
79 prom_write(s, n); 73 prom_write(s, n);
80} 74}
81 75
82static struct console prom_console = {
83 .name = "prom",
84 .write = prom_console_write,
85 .flags = CON_CONSDEV | CON_ENABLED,
86 .index = -1,
87};
88
89#define PROM_TRUE -1
90#define PROM_FALSE 0
91
92/* Pretty sick eh? */
93int prom_callback(long *args)
94{
95 struct console *cons, *saved_console = NULL;
96 unsigned long flags;
97 char *cmd;
98 extern spinlock_t prom_entry_lock;
99
100 if (!args)
101 return -1;
102 if (!(cmd = (char *)args[0]))
103 return -1;
104
105 /*
106 * The callback can be invoked on the cpu that first dropped
107 * into prom_cmdline after taking the serial interrupt, or on
108 * a slave processor that was smp_captured() if the
109 * administrator has done a switch-cpu inside obp. In either
110 * case, the cpu is marked as in-interrupt. Drop IRQ locks.
111 */
112 irq_exit();
113
114 /* XXX Revisit the locking here someday. This is a debugging
115 * XXX feature so it isnt all that critical. -DaveM
116 */
117 local_irq_save(flags);
118
119 spin_unlock(&prom_entry_lock);
120 cons = console_drivers;
121 while (cons) {
122 unregister_console(cons);
123 cons->flags &= ~(CON_PRINTBUFFER);
124 cons->next = saved_console;
125 saved_console = cons;
126 cons = console_drivers;
127 }
128 register_console(&prom_console);
129 if (!strcmp(cmd, "sync")) {
130 prom_printf("PROM `%s' command...\n", cmd);
131 show_free_areas();
132 if (current->pid != 0) {
133 local_irq_enable();
134 sys_sync();
135 local_irq_disable();
136 }
137 args[2] = 0;
138 args[args[1] + 3] = -1;
139 prom_printf("Returning to PROM\n");
140 } else if (!strcmp(cmd, "va>tte-data")) {
141 unsigned long ctx, va;
142 unsigned long tte = 0;
143 long res = PROM_FALSE;
144
145 ctx = args[3];
146 va = args[4];
147 if (ctx) {
148 /*
149 * Find process owning ctx, lookup mapping.
150 */
151 struct task_struct *p;
152 struct mm_struct *mm = NULL;
153 pgd_t *pgdp;
154 pud_t *pudp;
155 pmd_t *pmdp;
156 pte_t *ptep;
157 pte_t pte;
158
159 for_each_process(p) {
160 mm = p->mm;
161 if (CTX_NRBITS(mm->context) == ctx)
162 break;
163 }
164 if (!mm ||
165 CTX_NRBITS(mm->context) != ctx)
166 goto done;
167
168 pgdp = pgd_offset(mm, va);
169 if (pgd_none(*pgdp))
170 goto done;
171 pudp = pud_offset(pgdp, va);
172 if (pud_none(*pudp))
173 goto done;
174 pmdp = pmd_offset(pudp, va);
175 if (pmd_none(*pmdp))
176 goto done;
177
178 /* Preemption implicitly disabled by virtue of
179 * being called from inside OBP.
180 */
181 ptep = pte_offset_map(pmdp, va);
182 pte = *ptep;
183 if (pte_present(pte)) {
184 tte = pte_val(pte);
185 res = PROM_TRUE;
186 }
187 pte_unmap(ptep);
188 goto done;
189 }
190
191 if ((va >= KERNBASE) && (va < (KERNBASE + (4 * 1024 * 1024)))) {
192 extern unsigned long sparc64_kern_pri_context;
193
194 /* Spitfire Errata #32 workaround */
195 __asm__ __volatile__("stxa %0, [%1] %2\n\t"
196 "flush %%g6"
197 : /* No outputs */
198 : "r" (sparc64_kern_pri_context),
199 "r" (PRIMARY_CONTEXT),
200 "i" (ASI_DMMU));
201
202 /*
203 * Locked down tlb entry.
204 */
205
206 if (tlb_type == spitfire)
207 tte = spitfire_get_dtlb_data(SPITFIRE_HIGHEST_LOCKED_TLBENT);
208 else if (tlb_type == cheetah || tlb_type == cheetah_plus)
209 tte = cheetah_get_ldtlb_data(CHEETAH_HIGHEST_LOCKED_TLBENT);
210
211 res = PROM_TRUE;
212 goto done;
213 }
214
215 if (va < PGDIR_SIZE) {
216 /*
217 * vmalloc or prom_inherited mapping.
218 */
219 pgd_t *pgdp;
220 pud_t *pudp;
221 pmd_t *pmdp;
222 pte_t *ptep;
223 pte_t pte;
224 int error;
225
226 if ((va >= LOW_OBP_ADDRESS) && (va < HI_OBP_ADDRESS)) {
227 tte = prom_virt_to_phys(va, &error);
228 if (!error)
229 res = PROM_TRUE;
230 goto done;
231 }
232 pgdp = pgd_offset_k(va);
233 if (pgd_none(*pgdp))
234 goto done;
235 pudp = pud_offset(pgdp, va);
236 if (pud_none(*pudp))
237 goto done;
238 pmdp = pmd_offset(pudp, va);
239 if (pmd_none(*pmdp))
240 goto done;
241
242 /* Preemption implicitly disabled by virtue of
243 * being called from inside OBP.
244 */
245 ptep = pte_offset_kernel(pmdp, va);
246 pte = *ptep;
247 if (pte_present(pte)) {
248 tte = pte_val(pte);
249 res = PROM_TRUE;
250 }
251 goto done;
252 }
253
254 if (va < PAGE_OFFSET) {
255 /*
256 * No mappings here.
257 */
258 goto done;
259 }
260
261 if (va & (1UL << 40)) {
262 /*
263 * I/O page.
264 */
265
266 tte = (__pa(va) & _PAGE_PADDR) |
267 _PAGE_VALID | _PAGE_SZ4MB |
268 _PAGE_E | _PAGE_P | _PAGE_W;
269 res = PROM_TRUE;
270 goto done;
271 }
272
273 /*
274 * Normal page.
275 */
276 tte = (__pa(va) & _PAGE_PADDR) |
277 _PAGE_VALID | _PAGE_SZ4MB |
278 _PAGE_CP | _PAGE_CV | _PAGE_P | _PAGE_W;
279 res = PROM_TRUE;
280
281 done:
282 if (res == PROM_TRUE) {
283 args[2] = 3;
284 args[args[1] + 3] = 0;
285 args[args[1] + 4] = res;
286 args[args[1] + 5] = tte;
287 } else {
288 args[2] = 2;
289 args[args[1] + 3] = 0;
290 args[args[1] + 4] = res;
291 }
292 } else if (!strcmp(cmd, ".soft1")) {
293 unsigned long tte;
294
295 tte = args[3];
296 prom_printf("%lx:\"%s%s%s%s%s\" ",
297 (tte & _PAGE_SOFT) >> 7,
298 tte & _PAGE_MODIFIED ? "M" : "-",
299 tte & _PAGE_ACCESSED ? "A" : "-",
300 tte & _PAGE_READ ? "W" : "-",
301 tte & _PAGE_WRITE ? "R" : "-",
302 tte & _PAGE_PRESENT ? "P" : "-");
303
304 args[2] = 2;
305 args[args[1] + 3] = 0;
306 args[args[1] + 4] = PROM_TRUE;
307 } else if (!strcmp(cmd, ".soft2")) {
308 unsigned long tte;
309
310 tte = args[3];
311 prom_printf("%lx ", (tte & 0x07FC000000000000UL) >> 50);
312
313 args[2] = 2;
314 args[args[1] + 3] = 0;
315 args[args[1] + 4] = PROM_TRUE;
316 } else {
317 prom_printf("unknown PROM `%s' command...\n", cmd);
318 }
319 unregister_console(&prom_console);
320 while (saved_console) {
321 cons = saved_console;
322 saved_console = cons->next;
323 register_console(cons);
324 }
325 spin_lock(&prom_entry_lock);
326 local_irq_restore(flags);
327
328 /*
329 * Restore in-interrupt status for a resume from obp.
330 */
331 irq_enter();
332 return 0;
333}
334
335unsigned int boot_flags = 0; 76unsigned int boot_flags = 0;
336#define BOOTME_DEBUG 0x1 77#define BOOTME_DEBUG 0x1
337#define BOOTME_SINGLE 0x2 78#define BOOTME_SINGLE 0x2
@@ -479,15 +220,99 @@ char reboot_command[COMMAND_LINE_SIZE];
479 220
480static struct pt_regs fake_swapper_regs = { { 0, }, 0, 0, 0, 0 }; 221static struct pt_regs fake_swapper_regs = { { 0, }, 0, 0, 0, 0 };
481 222
482void register_prom_callbacks(void) 223static void __init per_cpu_patch(void)
483{ 224{
484 prom_setcallback(prom_callback); 225 struct cpuid_patch_entry *p;
485 prom_feval(": linux-va>tte-data 2 \" va>tte-data\" $callback drop ; " 226 unsigned long ver;
486 "' linux-va>tte-data to va>tte-data"); 227 int is_jbus;
487 prom_feval(": linux-.soft1 1 \" .soft1\" $callback 2drop ; " 228
488 "' linux-.soft1 to .soft1"); 229 if (tlb_type == spitfire && !this_is_starfire)
489 prom_feval(": linux-.soft2 1 \" .soft2\" $callback 2drop ; " 230 return;
490 "' linux-.soft2 to .soft2"); 231
232 is_jbus = 0;
233 if (tlb_type != hypervisor) {
234 __asm__ ("rdpr %%ver, %0" : "=r" (ver));
235 is_jbus = ((ver >> 32UL) == __JALAPENO_ID ||
236 (ver >> 32UL) == __SERRANO_ID);
237 }
238
239 p = &__cpuid_patch;
240 while (p < &__cpuid_patch_end) {
241 unsigned long addr = p->addr;
242 unsigned int *insns;
243
244 switch (tlb_type) {
245 case spitfire:
246 insns = &p->starfire[0];
247 break;
248 case cheetah:
249 case cheetah_plus:
250 if (is_jbus)
251 insns = &p->cheetah_jbus[0];
252 else
253 insns = &p->cheetah_safari[0];
254 break;
255 case hypervisor:
256 insns = &p->sun4v[0];
257 break;
258 default:
259 prom_printf("Unknown cpu type, halting.\n");
260 prom_halt();
261 };
262
263 *(unsigned int *) (addr + 0) = insns[0];
264 wmb();
265 __asm__ __volatile__("flush %0" : : "r" (addr + 0));
266
267 *(unsigned int *) (addr + 4) = insns[1];
268 wmb();
269 __asm__ __volatile__("flush %0" : : "r" (addr + 4));
270
271 *(unsigned int *) (addr + 8) = insns[2];
272 wmb();
273 __asm__ __volatile__("flush %0" : : "r" (addr + 8));
274
275 *(unsigned int *) (addr + 12) = insns[3];
276 wmb();
277 __asm__ __volatile__("flush %0" : : "r" (addr + 12));
278
279 p++;
280 }
281}
282
283static void __init sun4v_patch(void)
284{
285 struct sun4v_1insn_patch_entry *p1;
286 struct sun4v_2insn_patch_entry *p2;
287
288 if (tlb_type != hypervisor)
289 return;
290
291 p1 = &__sun4v_1insn_patch;
292 while (p1 < &__sun4v_1insn_patch_end) {
293 unsigned long addr = p1->addr;
294
295 *(unsigned int *) (addr + 0) = p1->insn;
296 wmb();
297 __asm__ __volatile__("flush %0" : : "r" (addr + 0));
298
299 p1++;
300 }
301
302 p2 = &__sun4v_2insn_patch;
303 while (p2 < &__sun4v_2insn_patch_end) {
304 unsigned long addr = p2->addr;
305
306 *(unsigned int *) (addr + 0) = p2->insns[0];
307 wmb();
308 __asm__ __volatile__("flush %0" : : "r" (addr + 0));
309
310 *(unsigned int *) (addr + 4) = p2->insns[1];
311 wmb();
312 __asm__ __volatile__("flush %0" : : "r" (addr + 4));
313
314 p2++;
315 }
491} 316}
492 317
493void __init setup_arch(char **cmdline_p) 318void __init setup_arch(char **cmdline_p)
@@ -496,7 +321,10 @@ void __init setup_arch(char **cmdline_p)
496 *cmdline_p = prom_getbootargs(); 321 *cmdline_p = prom_getbootargs();
497 strcpy(saved_command_line, *cmdline_p); 322 strcpy(saved_command_line, *cmdline_p);
498 323
499 printk("ARCH: SUN4U\n"); 324 if (tlb_type == hypervisor)
325 printk("ARCH: SUN4V\n");
326 else
327 printk("ARCH: SUN4U\n");
500 328
501#ifdef CONFIG_DUMMY_CONSOLE 329#ifdef CONFIG_DUMMY_CONSOLE
502 conswitchp = &dummy_con; 330 conswitchp = &dummy_con;
@@ -507,6 +335,13 @@ void __init setup_arch(char **cmdline_p)
507 /* Work out if we are starfire early on */ 335 /* Work out if we are starfire early on */
508 check_if_starfire(); 336 check_if_starfire();
509 337
338 /* Now we know enough to patch the get_cpuid sequences
339 * used by trap code.
340 */
341 per_cpu_patch();
342
343 sun4v_patch();
344
510 boot_flags_init(*cmdline_p); 345 boot_flags_init(*cmdline_p);
511 346
512 idprom_init(); 347 idprom_init();
@@ -514,7 +349,7 @@ void __init setup_arch(char **cmdline_p)
514 if (!root_flags) 349 if (!root_flags)
515 root_mountflags &= ~MS_RDONLY; 350 root_mountflags &= ~MS_RDONLY;
516 ROOT_DEV = old_decode_dev(root_dev); 351 ROOT_DEV = old_decode_dev(root_dev);
517#ifdef CONFIG_BLK_DEV_INITRD 352#ifdef CONFIG_BLK_DEV_RAM
518 rd_image_start = ram_flags & RAMDISK_IMAGE_START_MASK; 353 rd_image_start = ram_flags & RAMDISK_IMAGE_START_MASK;
519 rd_prompt = ((ram_flags & RAMDISK_PROMPT_FLAG) != 0); 354 rd_prompt = ((ram_flags & RAMDISK_PROMPT_FLAG) != 0);
520 rd_doload = ((ram_flags & RAMDISK_LOAD_FLAG) != 0); 355 rd_doload = ((ram_flags & RAMDISK_LOAD_FLAG) != 0);
@@ -544,6 +379,9 @@ void __init setup_arch(char **cmdline_p)
544 379
545 smp_setup_cpu_possible_map(); 380 smp_setup_cpu_possible_map();
546 381
382 /* Get boot processor trap_block[] setup. */
383 init_cur_cpu_trap(current_thread_info());
384
547 paging_init(); 385 paging_init();
548} 386}
549 387
@@ -565,6 +403,12 @@ static int __init set_preferred_console(void)
565 serial_console = 2; 403 serial_console = 2;
566 } else if (idev == PROMDEV_IRSC && odev == PROMDEV_ORSC) { 404 } else if (idev == PROMDEV_IRSC && odev == PROMDEV_ORSC) {
567 serial_console = 3; 405 serial_console = 3;
406 } else if (idev == PROMDEV_IVCONS && odev == PROMDEV_OVCONS) {
407 /* sunhv_console_init() doesn't check the serial_console
408 * value anyways...
409 */
410 serial_console = 4;
411 return add_preferred_console("ttyHV", 0, NULL);
568 } else { 412 } else {
569 prom_printf("Inconsistent console: " 413 prom_printf("Inconsistent console: "
570 "input %d, output %d\n", 414 "input %d, output %d\n",
@@ -598,9 +442,8 @@ static int show_cpuinfo(struct seq_file *m, void *__unused)
598 seq_printf(m, 442 seq_printf(m,
599 "cpu\t\t: %s\n" 443 "cpu\t\t: %s\n"
600 "fpu\t\t: %s\n" 444 "fpu\t\t: %s\n"
601 "promlib\t\t: Version 3 Revision %d\n" 445 "prom\t\t: %s\n"
602 "prom\t\t: %d.%d.%d\n" 446 "type\t\t: %s\n"
603 "type\t\t: sun4u\n"
604 "ncpus probed\t: %d\n" 447 "ncpus probed\t: %d\n"
605 "ncpus active\t: %d\n" 448 "ncpus active\t: %d\n"
606 "D$ parity tl1\t: %u\n" 449 "D$ parity tl1\t: %u\n"
@@ -612,10 +455,10 @@ static int show_cpuinfo(struct seq_file *m, void *__unused)
612 , 455 ,
613 sparc_cpu_type, 456 sparc_cpu_type,
614 sparc_fpu_type, 457 sparc_fpu_type,
615 prom_rev, 458 prom_version,
616 prom_prev >> 16, 459 ((tlb_type == hypervisor) ?
617 (prom_prev >> 8) & 0xff, 460 "sun4v" :
618 prom_prev & 0xff, 461 "sun4u"),
619 ncpus_probed, 462 ncpus_probed,
620 num_online_cpus(), 463 num_online_cpus(),
621 dcache_parity_tl1_occurred, 464 dcache_parity_tl1_occurred,
@@ -692,15 +535,11 @@ static int __init topology_init(void)
692 while (!cpu_find_by_instance(ncpus_probed, NULL, NULL)) 535 while (!cpu_find_by_instance(ncpus_probed, NULL, NULL))
693 ncpus_probed++; 536 ncpus_probed++;
694 537
695 for (i = 0; i < NR_CPUS; i++) { 538 for_each_cpu(i) {
696 if (cpu_possible(i)) { 539 struct cpu *p = kzalloc(sizeof(*p), GFP_KERNEL);
697 struct cpu *p = kmalloc(sizeof(*p), GFP_KERNEL); 540 if (p) {
698 541 register_cpu(p, i, NULL);
699 if (p) { 542 err = 0;
700 memset(p, 0, sizeof(*p));
701 register_cpu(p, i, NULL);
702 err = 0;
703 }
704 } 543 }
705 } 544 }
706 545
diff --git a/arch/sparc64/kernel/smp.c b/arch/sparc64/kernel/smp.c
index 1f7ad8a69052..7dc28a484268 100644
--- a/arch/sparc64/kernel/smp.c
+++ b/arch/sparc64/kernel/smp.c
@@ -38,6 +38,7 @@
38#include <asm/timer.h> 38#include <asm/timer.h>
39#include <asm/starfire.h> 39#include <asm/starfire.h>
40#include <asm/tlb.h> 40#include <asm/tlb.h>
41#include <asm/sections.h>
41 42
42extern void calibrate_delay(void); 43extern void calibrate_delay(void);
43 44
@@ -46,6 +47,8 @@ static unsigned char boot_cpu_id;
46 47
47cpumask_t cpu_online_map __read_mostly = CPU_MASK_NONE; 48cpumask_t cpu_online_map __read_mostly = CPU_MASK_NONE;
48cpumask_t phys_cpu_present_map __read_mostly = CPU_MASK_NONE; 49cpumask_t phys_cpu_present_map __read_mostly = CPU_MASK_NONE;
50cpumask_t cpu_sibling_map[NR_CPUS] __read_mostly =
51 { [0 ... NR_CPUS-1] = CPU_MASK_NONE };
49static cpumask_t smp_commenced_mask; 52static cpumask_t smp_commenced_mask;
50static cpumask_t cpu_callout_map; 53static cpumask_t cpu_callout_map;
51 54
@@ -54,30 +57,26 @@ void smp_info(struct seq_file *m)
54 int i; 57 int i;
55 58
56 seq_printf(m, "State:\n"); 59 seq_printf(m, "State:\n");
57 for (i = 0; i < NR_CPUS; i++) { 60 for_each_online_cpu(i)
58 if (cpu_online(i)) 61 seq_printf(m, "CPU%d:\t\tonline\n", i);
59 seq_printf(m,
60 "CPU%d:\t\tonline\n", i);
61 }
62} 62}
63 63
64void smp_bogo(struct seq_file *m) 64void smp_bogo(struct seq_file *m)
65{ 65{
66 int i; 66 int i;
67 67
68 for (i = 0; i < NR_CPUS; i++) 68 for_each_online_cpu(i)
69 if (cpu_online(i)) 69 seq_printf(m,
70 seq_printf(m, 70 "Cpu%dBogo\t: %lu.%02lu\n"
71 "Cpu%dBogo\t: %lu.%02lu\n" 71 "Cpu%dClkTck\t: %016lx\n",
72 "Cpu%dClkTck\t: %016lx\n", 72 i, cpu_data(i).udelay_val / (500000/HZ),
73 i, cpu_data(i).udelay_val / (500000/HZ), 73 (cpu_data(i).udelay_val / (5000/HZ)) % 100,
74 (cpu_data(i).udelay_val / (5000/HZ)) % 100, 74 i, cpu_data(i).clock_tick);
75 i, cpu_data(i).clock_tick);
76} 75}
77 76
78void __init smp_store_cpu_info(int id) 77void __init smp_store_cpu_info(int id)
79{ 78{
80 int cpu_node; 79 int cpu_node, def;
81 80
82 /* multiplier and counter set by 81 /* multiplier and counter set by
83 smp_setup_percpu_timer() */ 82 smp_setup_percpu_timer() */
@@ -87,24 +86,32 @@ void __init smp_store_cpu_info(int id)
87 cpu_data(id).clock_tick = prom_getintdefault(cpu_node, 86 cpu_data(id).clock_tick = prom_getintdefault(cpu_node,
88 "clock-frequency", 0); 87 "clock-frequency", 0);
89 88
90 cpu_data(id).pgcache_size = 0; 89 def = ((tlb_type == hypervisor) ? (8 * 1024) : (16 * 1024));
91 cpu_data(id).pte_cache[0] = NULL;
92 cpu_data(id).pte_cache[1] = NULL;
93 cpu_data(id).pgd_cache = NULL;
94 cpu_data(id).idle_volume = 1;
95
96 cpu_data(id).dcache_size = prom_getintdefault(cpu_node, "dcache-size", 90 cpu_data(id).dcache_size = prom_getintdefault(cpu_node, "dcache-size",
97 16 * 1024); 91 def);
92
93 def = 32;
98 cpu_data(id).dcache_line_size = 94 cpu_data(id).dcache_line_size =
99 prom_getintdefault(cpu_node, "dcache-line-size", 32); 95 prom_getintdefault(cpu_node, "dcache-line-size", def);
96
97 def = 16 * 1024;
100 cpu_data(id).icache_size = prom_getintdefault(cpu_node, "icache-size", 98 cpu_data(id).icache_size = prom_getintdefault(cpu_node, "icache-size",
101 16 * 1024); 99 def);
100
101 def = 32;
102 cpu_data(id).icache_line_size = 102 cpu_data(id).icache_line_size =
103 prom_getintdefault(cpu_node, "icache-line-size", 32); 103 prom_getintdefault(cpu_node, "icache-line-size", def);
104
105 def = ((tlb_type == hypervisor) ?
106 (3 * 1024 * 1024) :
107 (4 * 1024 * 1024));
104 cpu_data(id).ecache_size = prom_getintdefault(cpu_node, "ecache-size", 108 cpu_data(id).ecache_size = prom_getintdefault(cpu_node, "ecache-size",
105 4 * 1024 * 1024); 109 def);
110
111 def = 64;
106 cpu_data(id).ecache_line_size = 112 cpu_data(id).ecache_line_size =
107 prom_getintdefault(cpu_node, "ecache-line-size", 64); 113 prom_getintdefault(cpu_node, "ecache-line-size", def);
114
108 printk("CPU[%d]: Caches " 115 printk("CPU[%d]: Caches "
109 "D[sz(%d):line_sz(%d)] " 116 "D[sz(%d):line_sz(%d)] "
110 "I[sz(%d):line_sz(%d)] " 117 "I[sz(%d):line_sz(%d)] "
@@ -119,27 +126,16 @@ static void smp_setup_percpu_timer(void);
119 126
120static volatile unsigned long callin_flag = 0; 127static volatile unsigned long callin_flag = 0;
121 128
122extern void inherit_locked_prom_mappings(int save_p);
123
124static inline void cpu_setup_percpu_base(unsigned long cpu_id)
125{
126 __asm__ __volatile__("mov %0, %%g5\n\t"
127 "stxa %0, [%1] %2\n\t"
128 "membar #Sync"
129 : /* no outputs */
130 : "r" (__per_cpu_offset(cpu_id)),
131 "r" (TSB_REG), "i" (ASI_IMMU));
132}
133
134void __init smp_callin(void) 129void __init smp_callin(void)
135{ 130{
136 int cpuid = hard_smp_processor_id(); 131 int cpuid = hard_smp_processor_id();
137 132
138 inherit_locked_prom_mappings(0); 133 __local_per_cpu_offset = __per_cpu_offset(cpuid);
139 134
140 __flush_tlb_all(); 135 if (tlb_type == hypervisor)
136 sun4v_ktsb_register();
141 137
142 cpu_setup_percpu_base(cpuid); 138 __flush_tlb_all();
143 139
144 smp_setup_percpu_timer(); 140 smp_setup_percpu_timer();
145 141
@@ -316,6 +312,8 @@ static void smp_synchronize_one_tick(int cpu)
316 spin_unlock_irqrestore(&itc_sync_lock, flags); 312 spin_unlock_irqrestore(&itc_sync_lock, flags);
317} 313}
318 314
315extern void sun4v_init_mondo_queues(int use_bootmem, int cpu, int alloc, int load);
316
319extern unsigned long sparc64_cpu_startup; 317extern unsigned long sparc64_cpu_startup;
320 318
321/* The OBP cpu startup callback truncates the 3rd arg cookie to 319/* The OBP cpu startup callback truncates the 3rd arg cookie to
@@ -331,21 +329,31 @@ static int __devinit smp_boot_one_cpu(unsigned int cpu)
331 unsigned long cookie = 329 unsigned long cookie =
332 (unsigned long)(&cpu_new_thread); 330 (unsigned long)(&cpu_new_thread);
333 struct task_struct *p; 331 struct task_struct *p;
334 int timeout, ret, cpu_node; 332 int timeout, ret;
335 333
336 p = fork_idle(cpu); 334 p = fork_idle(cpu);
337 callin_flag = 0; 335 callin_flag = 0;
338 cpu_new_thread = task_thread_info(p); 336 cpu_new_thread = task_thread_info(p);
339 cpu_set(cpu, cpu_callout_map); 337 cpu_set(cpu, cpu_callout_map);
340 338
341 cpu_find_by_mid(cpu, &cpu_node); 339 if (tlb_type == hypervisor) {
342 prom_startcpu(cpu_node, entry, cookie); 340 /* Alloc the mondo queues, cpu will load them. */
341 sun4v_init_mondo_queues(0, cpu, 1, 0);
342
343 prom_startcpu_cpuid(cpu, entry, cookie);
344 } else {
345 int cpu_node;
346
347 cpu_find_by_mid(cpu, &cpu_node);
348 prom_startcpu(cpu_node, entry, cookie);
349 }
343 350
344 for (timeout = 0; timeout < 5000000; timeout++) { 351 for (timeout = 0; timeout < 5000000; timeout++) {
345 if (callin_flag) 352 if (callin_flag)
346 break; 353 break;
347 udelay(100); 354 udelay(100);
348 } 355 }
356
349 if (callin_flag) { 357 if (callin_flag) {
350 ret = 0; 358 ret = 0;
351 } else { 359 } else {
@@ -441,7 +449,7 @@ static __inline__ void spitfire_xcall_deliver(u64 data0, u64 data1, u64 data2, c
441static void cheetah_xcall_deliver(u64 data0, u64 data1, u64 data2, cpumask_t mask) 449static void cheetah_xcall_deliver(u64 data0, u64 data1, u64 data2, cpumask_t mask)
442{ 450{
443 u64 pstate, ver; 451 u64 pstate, ver;
444 int nack_busy_id, is_jalapeno; 452 int nack_busy_id, is_jbus;
445 453
446 if (cpus_empty(mask)) 454 if (cpus_empty(mask))
447 return; 455 return;
@@ -451,7 +459,8 @@ static void cheetah_xcall_deliver(u64 data0, u64 data1, u64 data2, cpumask_t mas
451 * derivative processor. 459 * derivative processor.
452 */ 460 */
453 __asm__ ("rdpr %%ver, %0" : "=r" (ver)); 461 __asm__ ("rdpr %%ver, %0" : "=r" (ver));
454 is_jalapeno = ((ver >> 32) == 0x003e0016); 462 is_jbus = ((ver >> 32) == __JALAPENO_ID ||
463 (ver >> 32) == __SERRANO_ID);
455 464
456 __asm__ __volatile__("rdpr %%pstate, %0" : "=r" (pstate)); 465 __asm__ __volatile__("rdpr %%pstate, %0" : "=r" (pstate));
457 466
@@ -476,7 +485,7 @@ retry:
476 for_each_cpu_mask(i, mask) { 485 for_each_cpu_mask(i, mask) {
477 u64 target = (i << 14) | 0x70; 486 u64 target = (i << 14) | 0x70;
478 487
479 if (!is_jalapeno) 488 if (!is_jbus)
480 target |= (nack_busy_id << 24); 489 target |= (nack_busy_id << 24);
481 __asm__ __volatile__( 490 __asm__ __volatile__(
482 "stxa %%g0, [%0] %1\n\t" 491 "stxa %%g0, [%0] %1\n\t"
@@ -529,7 +538,7 @@ retry:
529 for_each_cpu_mask(i, mask) { 538 for_each_cpu_mask(i, mask) {
530 u64 check_mask; 539 u64 check_mask;
531 540
532 if (is_jalapeno) 541 if (is_jbus)
533 check_mask = (0x2UL << (2*i)); 542 check_mask = (0x2UL << (2*i));
534 else 543 else
535 check_mask = (0x2UL << 544 check_mask = (0x2UL <<
@@ -544,6 +553,155 @@ retry:
544 } 553 }
545} 554}
546 555
556/* Multi-cpu list version. */
557static void hypervisor_xcall_deliver(u64 data0, u64 data1, u64 data2, cpumask_t mask)
558{
559 struct trap_per_cpu *tb;
560 u16 *cpu_list;
561 u64 *mondo;
562 cpumask_t error_mask;
563 unsigned long flags, status;
564 int cnt, retries, this_cpu, prev_sent, i;
565
566 /* We have to do this whole thing with interrupts fully disabled.
567 * Otherwise if we send an xcall from interrupt context it will
568 * corrupt both our mondo block and cpu list state.
569 *
570 * One consequence of this is that we cannot use timeout mechanisms
571 * that depend upon interrupts being delivered locally. So, for
572 * example, we cannot sample jiffies and expect it to advance.
573 *
574 * Fortunately, udelay() uses %stick/%tick so we can use that.
575 */
576 local_irq_save(flags);
577
578 this_cpu = smp_processor_id();
579 tb = &trap_block[this_cpu];
580
581 mondo = __va(tb->cpu_mondo_block_pa);
582 mondo[0] = data0;
583 mondo[1] = data1;
584 mondo[2] = data2;
585 wmb();
586
587 cpu_list = __va(tb->cpu_list_pa);
588
589 /* Setup the initial cpu list. */
590 cnt = 0;
591 for_each_cpu_mask(i, mask)
592 cpu_list[cnt++] = i;
593
594 cpus_clear(error_mask);
595 retries = 0;
596 prev_sent = 0;
597 do {
598 int forward_progress, n_sent;
599
600 status = sun4v_cpu_mondo_send(cnt,
601 tb->cpu_list_pa,
602 tb->cpu_mondo_block_pa);
603
604 /* HV_EOK means all cpus received the xcall, we're done. */
605 if (likely(status == HV_EOK))
606 break;
607
608 /* First, see if we made any forward progress.
609 *
610 * The hypervisor indicates successful sends by setting
611 * cpu list entries to the value 0xffff.
612 */
613 n_sent = 0;
614 for (i = 0; i < cnt; i++) {
615 if (likely(cpu_list[i] == 0xffff))
616 n_sent++;
617 }
618
619 forward_progress = 0;
620 if (n_sent > prev_sent)
621 forward_progress = 1;
622
623 prev_sent = n_sent;
624
625 /* If we get a HV_ECPUERROR, then one or more of the cpus
626 * in the list are in error state. Use the cpu_state()
627 * hypervisor call to find out which cpus are in error state.
628 */
629 if (unlikely(status == HV_ECPUERROR)) {
630 for (i = 0; i < cnt; i++) {
631 long err;
632 u16 cpu;
633
634 cpu = cpu_list[i];
635 if (cpu == 0xffff)
636 continue;
637
638 err = sun4v_cpu_state(cpu);
639 if (err >= 0 &&
640 err == HV_CPU_STATE_ERROR) {
641 cpu_list[i] = 0xffff;
642 cpu_set(cpu, error_mask);
643 }
644 }
645 } else if (unlikely(status != HV_EWOULDBLOCK))
646 goto fatal_mondo_error;
647
648 /* Don't bother rewriting the CPU list, just leave the
649 * 0xffff and non-0xffff entries in there and the
650 * hypervisor will do the right thing.
651 *
652 * Only advance timeout state if we didn't make any
653 * forward progress.
654 */
655 if (unlikely(!forward_progress)) {
656 if (unlikely(++retries > 10000))
657 goto fatal_mondo_timeout;
658
659 /* Delay a little bit to let other cpus catch up
660 * on their cpu mondo queue work.
661 */
662 udelay(2 * cnt);
663 }
664 } while (1);
665
666 local_irq_restore(flags);
667
668 if (unlikely(!cpus_empty(error_mask)))
669 goto fatal_mondo_cpu_error;
670
671 return;
672
673fatal_mondo_cpu_error:
674 printk(KERN_CRIT "CPU[%d]: SUN4V mondo cpu error, some target cpus "
675 "were in error state\n",
676 this_cpu);
677 printk(KERN_CRIT "CPU[%d]: Error mask [ ", this_cpu);
678 for_each_cpu_mask(i, error_mask)
679 printk("%d ", i);
680 printk("]\n");
681 return;
682
683fatal_mondo_timeout:
684 local_irq_restore(flags);
685 printk(KERN_CRIT "CPU[%d]: SUN4V mondo timeout, no forward "
686 " progress after %d retries.\n",
687 this_cpu, retries);
688 goto dump_cpu_list_and_out;
689
690fatal_mondo_error:
691 local_irq_restore(flags);
692 printk(KERN_CRIT "CPU[%d]: Unexpected SUN4V mondo error %lu\n",
693 this_cpu, status);
694 printk(KERN_CRIT "CPU[%d]: Args were cnt(%d) cpulist_pa(%lx) "
695 "mondo_block_pa(%lx)\n",
696 this_cpu, cnt, tb->cpu_list_pa, tb->cpu_mondo_block_pa);
697
698dump_cpu_list_and_out:
699 printk(KERN_CRIT "CPU[%d]: CPU list [ ", this_cpu);
700 for (i = 0; i < cnt; i++)
701 printk("%u ", cpu_list[i]);
702 printk("]\n");
703}
704
547/* Send cross call to all processors mentioned in MASK 705/* Send cross call to all processors mentioned in MASK
548 * except self. 706 * except self.
549 */ 707 */
@@ -557,8 +715,10 @@ static void smp_cross_call_masked(unsigned long *func, u32 ctx, u64 data1, u64 d
557 715
558 if (tlb_type == spitfire) 716 if (tlb_type == spitfire)
559 spitfire_xcall_deliver(data0, data1, data2, mask); 717 spitfire_xcall_deliver(data0, data1, data2, mask);
560 else 718 else if (tlb_type == cheetah || tlb_type == cheetah_plus)
561 cheetah_xcall_deliver(data0, data1, data2, mask); 719 cheetah_xcall_deliver(data0, data1, data2, mask);
720 else
721 hypervisor_xcall_deliver(data0, data1, data2, mask);
562 /* NOTE: Caller runs local copy on master. */ 722 /* NOTE: Caller runs local copy on master. */
563 723
564 put_cpu(); 724 put_cpu();
@@ -594,16 +754,13 @@ extern unsigned long xcall_call_function;
594 * You must not call this function with disabled interrupts or from a 754 * You must not call this function with disabled interrupts or from a
595 * hardware interrupt handler or from a bottom half handler. 755 * hardware interrupt handler or from a bottom half handler.
596 */ 756 */
597int smp_call_function(void (*func)(void *info), void *info, 757static int smp_call_function_mask(void (*func)(void *info), void *info,
598 int nonatomic, int wait) 758 int nonatomic, int wait, cpumask_t mask)
599{ 759{
600 struct call_data_struct data; 760 struct call_data_struct data;
601 int cpus = num_online_cpus() - 1; 761 int cpus;
602 long timeout; 762 long timeout;
603 763
604 if (!cpus)
605 return 0;
606
607 /* Can deadlock when called with interrupts disabled */ 764 /* Can deadlock when called with interrupts disabled */
608 WARN_ON(irqs_disabled()); 765 WARN_ON(irqs_disabled());
609 766
@@ -614,9 +771,14 @@ int smp_call_function(void (*func)(void *info), void *info,
614 771
615 spin_lock(&call_lock); 772 spin_lock(&call_lock);
616 773
774 cpu_clear(smp_processor_id(), mask);
775 cpus = cpus_weight(mask);
776 if (!cpus)
777 goto out_unlock;
778
617 call_data = &data; 779 call_data = &data;
618 780
619 smp_cross_call(&xcall_call_function, 0, 0, 0); 781 smp_cross_call_masked(&xcall_call_function, 0, 0, 0, mask);
620 782
621 /* 783 /*
622 * Wait for other cpus to complete function or at 784 * Wait for other cpus to complete function or at
@@ -630,18 +792,25 @@ int smp_call_function(void (*func)(void *info), void *info,
630 udelay(1); 792 udelay(1);
631 } 793 }
632 794
795out_unlock:
633 spin_unlock(&call_lock); 796 spin_unlock(&call_lock);
634 797
635 return 0; 798 return 0;
636 799
637out_timeout: 800out_timeout:
638 spin_unlock(&call_lock); 801 spin_unlock(&call_lock);
639 printk("XCALL: Remote cpus not responding, ncpus=%ld finished=%ld\n", 802 printk("XCALL: Remote cpus not responding, ncpus=%d finished=%d\n",
640 (long) num_online_cpus() - 1L, 803 cpus, atomic_read(&data.finished));
641 (long) atomic_read(&data.finished));
642 return 0; 804 return 0;
643} 805}
644 806
807int smp_call_function(void (*func)(void *info), void *info,
808 int nonatomic, int wait)
809{
810 return smp_call_function_mask(func, info, nonatomic, wait,
811 cpu_online_map);
812}
813
645void smp_call_function_client(int irq, struct pt_regs *regs) 814void smp_call_function_client(int irq, struct pt_regs *regs)
646{ 815{
647 void (*func) (void *info) = call_data->func; 816 void (*func) (void *info) = call_data->func;
@@ -659,13 +828,25 @@ void smp_call_function_client(int irq, struct pt_regs *regs)
659 } 828 }
660} 829}
661 830
831static void tsb_sync(void *info)
832{
833 struct mm_struct *mm = info;
834
835 if (current->active_mm == mm)
836 tsb_context_switch(mm);
837}
838
839void smp_tsb_sync(struct mm_struct *mm)
840{
841 smp_call_function_mask(tsb_sync, mm, 0, 1, mm->cpu_vm_mask);
842}
843
662extern unsigned long xcall_flush_tlb_mm; 844extern unsigned long xcall_flush_tlb_mm;
663extern unsigned long xcall_flush_tlb_pending; 845extern unsigned long xcall_flush_tlb_pending;
664extern unsigned long xcall_flush_tlb_kernel_range; 846extern unsigned long xcall_flush_tlb_kernel_range;
665extern unsigned long xcall_flush_tlb_all_spitfire;
666extern unsigned long xcall_flush_tlb_all_cheetah;
667extern unsigned long xcall_report_regs; 847extern unsigned long xcall_report_regs;
668extern unsigned long xcall_receive_signal; 848extern unsigned long xcall_receive_signal;
849extern unsigned long xcall_new_mmu_context_version;
669 850
670#ifdef DCACHE_ALIASING_POSSIBLE 851#ifdef DCACHE_ALIASING_POSSIBLE
671extern unsigned long xcall_flush_dcache_page_cheetah; 852extern unsigned long xcall_flush_dcache_page_cheetah;
@@ -693,11 +874,17 @@ static __inline__ void __local_flush_dcache_page(struct page *page)
693void smp_flush_dcache_page_impl(struct page *page, int cpu) 874void smp_flush_dcache_page_impl(struct page *page, int cpu)
694{ 875{
695 cpumask_t mask = cpumask_of_cpu(cpu); 876 cpumask_t mask = cpumask_of_cpu(cpu);
696 int this_cpu = get_cpu(); 877 int this_cpu;
878
879 if (tlb_type == hypervisor)
880 return;
697 881
698#ifdef CONFIG_DEBUG_DCFLUSH 882#ifdef CONFIG_DEBUG_DCFLUSH
699 atomic_inc(&dcpage_flushes); 883 atomic_inc(&dcpage_flushes);
700#endif 884#endif
885
886 this_cpu = get_cpu();
887
701 if (cpu == this_cpu) { 888 if (cpu == this_cpu) {
702 __local_flush_dcache_page(page); 889 __local_flush_dcache_page(page);
703 } else if (cpu_online(cpu)) { 890 } else if (cpu_online(cpu)) {
@@ -713,7 +900,7 @@ void smp_flush_dcache_page_impl(struct page *page, int cpu)
713 __pa(pg_addr), 900 __pa(pg_addr),
714 (u64) pg_addr, 901 (u64) pg_addr,
715 mask); 902 mask);
716 } else { 903 } else if (tlb_type == cheetah || tlb_type == cheetah_plus) {
717#ifdef DCACHE_ALIASING_POSSIBLE 904#ifdef DCACHE_ALIASING_POSSIBLE
718 data0 = 905 data0 =
719 ((u64)&xcall_flush_dcache_page_cheetah); 906 ((u64)&xcall_flush_dcache_page_cheetah);
@@ -735,7 +922,12 @@ void flush_dcache_page_all(struct mm_struct *mm, struct page *page)
735 void *pg_addr = page_address(page); 922 void *pg_addr = page_address(page);
736 cpumask_t mask = cpu_online_map; 923 cpumask_t mask = cpu_online_map;
737 u64 data0; 924 u64 data0;
738 int this_cpu = get_cpu(); 925 int this_cpu;
926
927 if (tlb_type == hypervisor)
928 return;
929
930 this_cpu = get_cpu();
739 931
740 cpu_clear(this_cpu, mask); 932 cpu_clear(this_cpu, mask);
741 933
@@ -752,7 +944,7 @@ void flush_dcache_page_all(struct mm_struct *mm, struct page *page)
752 __pa(pg_addr), 944 __pa(pg_addr),
753 (u64) pg_addr, 945 (u64) pg_addr,
754 mask); 946 mask);
755 } else { 947 } else if (tlb_type == cheetah || tlb_type == cheetah_plus) {
756#ifdef DCACHE_ALIASING_POSSIBLE 948#ifdef DCACHE_ALIASING_POSSIBLE
757 data0 = ((u64)&xcall_flush_dcache_page_cheetah); 949 data0 = ((u64)&xcall_flush_dcache_page_cheetah);
758 cheetah_xcall_deliver(data0, 950 cheetah_xcall_deliver(data0,
@@ -769,38 +961,58 @@ void flush_dcache_page_all(struct mm_struct *mm, struct page *page)
769 put_cpu(); 961 put_cpu();
770} 962}
771 963
964static void __smp_receive_signal_mask(cpumask_t mask)
965{
966 smp_cross_call_masked(&xcall_receive_signal, 0, 0, 0, mask);
967}
968
772void smp_receive_signal(int cpu) 969void smp_receive_signal(int cpu)
773{ 970{
774 cpumask_t mask = cpumask_of_cpu(cpu); 971 cpumask_t mask = cpumask_of_cpu(cpu);
775 972
776 if (cpu_online(cpu)) { 973 if (cpu_online(cpu))
777 u64 data0 = (((u64)&xcall_receive_signal) & 0xffffffff); 974 __smp_receive_signal_mask(mask);
778
779 if (tlb_type == spitfire)
780 spitfire_xcall_deliver(data0, 0, 0, mask);
781 else
782 cheetah_xcall_deliver(data0, 0, 0, mask);
783 }
784} 975}
785 976
786void smp_receive_signal_client(int irq, struct pt_regs *regs) 977void smp_receive_signal_client(int irq, struct pt_regs *regs)
787{ 978{
788 /* Just return, rtrap takes care of the rest. */
789 clear_softint(1 << irq); 979 clear_softint(1 << irq);
790} 980}
791 981
792void smp_report_regs(void) 982void smp_new_mmu_context_version_client(int irq, struct pt_regs *regs)
793{ 983{
794 smp_cross_call(&xcall_report_regs, 0, 0, 0); 984 struct mm_struct *mm;
985 unsigned long flags;
986
987 clear_softint(1 << irq);
988
989 /* See if we need to allocate a new TLB context because
990 * the version of the one we are using is now out of date.
991 */
992 mm = current->active_mm;
993 if (unlikely(!mm || (mm == &init_mm)))
994 return;
995
996 spin_lock_irqsave(&mm->context.lock, flags);
997
998 if (unlikely(!CTX_VALID(mm->context)))
999 get_new_mmu_context(mm);
1000
1001 spin_unlock_irqrestore(&mm->context.lock, flags);
1002
1003 load_secondary_context(mm);
1004 __flush_tlb_mm(CTX_HWBITS(mm->context),
1005 SECONDARY_CONTEXT);
795} 1006}
796 1007
797void smp_flush_tlb_all(void) 1008void smp_new_mmu_context_version(void)
798{ 1009{
799 if (tlb_type == spitfire) 1010 smp_cross_call(&xcall_new_mmu_context_version, 0, 0, 0);
800 smp_cross_call(&xcall_flush_tlb_all_spitfire, 0, 0, 0); 1011}
801 else 1012
802 smp_cross_call(&xcall_flush_tlb_all_cheetah, 0, 0, 0); 1013void smp_report_regs(void)
803 __flush_tlb_all(); 1014{
1015 smp_cross_call(&xcall_report_regs, 0, 0, 0);
804} 1016}
805 1017
806/* We know that the window frames of the user have been flushed 1018/* We know that the window frames of the user have been flushed
@@ -944,24 +1156,19 @@ void smp_release(void)
944 * can service tlb flush xcalls... 1156 * can service tlb flush xcalls...
945 */ 1157 */
946extern void prom_world(int); 1158extern void prom_world(int);
947extern void save_alternate_globals(unsigned long *); 1159
948extern void restore_alternate_globals(unsigned long *);
949void smp_penguin_jailcell(int irq, struct pt_regs *regs) 1160void smp_penguin_jailcell(int irq, struct pt_regs *regs)
950{ 1161{
951 unsigned long global_save[24];
952
953 clear_softint(1 << irq); 1162 clear_softint(1 << irq);
954 1163
955 preempt_disable(); 1164 preempt_disable();
956 1165
957 __asm__ __volatile__("flushw"); 1166 __asm__ __volatile__("flushw");
958 save_alternate_globals(global_save);
959 prom_world(1); 1167 prom_world(1);
960 atomic_inc(&smp_capture_registry); 1168 atomic_inc(&smp_capture_registry);
961 membar_storeload_storestore(); 1169 membar_storeload_storestore();
962 while (penguins_are_doing_time) 1170 while (penguins_are_doing_time)
963 rmb(); 1171 rmb();
964 restore_alternate_globals(global_save);
965 atomic_dec(&smp_capture_registry); 1172 atomic_dec(&smp_capture_registry);
966 prom_world(0); 1173 prom_world(0);
967 1174
@@ -1071,7 +1278,7 @@ int setup_profiling_timer(unsigned int multiplier)
1071 return -EINVAL; 1278 return -EINVAL;
1072 1279
1073 spin_lock_irqsave(&prof_setup_lock, flags); 1280 spin_lock_irqsave(&prof_setup_lock, flags);
1074 for (i = 0; i < NR_CPUS; i++) 1281 for_each_cpu(i)
1075 prof_multiplier(i) = multiplier; 1282 prof_multiplier(i) = multiplier;
1076 current_tick_offset = (timer_tick_offset / multiplier); 1283 current_tick_offset = (timer_tick_offset / multiplier);
1077 spin_unlock_irqrestore(&prof_setup_lock, flags); 1284 spin_unlock_irqrestore(&prof_setup_lock, flags);
@@ -1082,6 +1289,8 @@ int setup_profiling_timer(unsigned int multiplier)
1082/* Constrain the number of cpus to max_cpus. */ 1289/* Constrain the number of cpus to max_cpus. */
1083void __init smp_prepare_cpus(unsigned int max_cpus) 1290void __init smp_prepare_cpus(unsigned int max_cpus)
1084{ 1291{
1292 int i;
1293
1085 if (num_possible_cpus() > max_cpus) { 1294 if (num_possible_cpus() > max_cpus) {
1086 int instance, mid; 1295 int instance, mid;
1087 1296
@@ -1089,6 +1298,7 @@ void __init smp_prepare_cpus(unsigned int max_cpus)
1089 while (!cpu_find_by_instance(instance, NULL, &mid)) { 1298 while (!cpu_find_by_instance(instance, NULL, &mid)) {
1090 if (mid != boot_cpu_id) { 1299 if (mid != boot_cpu_id) {
1091 cpu_clear(mid, phys_cpu_present_map); 1300 cpu_clear(mid, phys_cpu_present_map);
1301 cpu_clear(mid, cpu_present_map);
1092 if (num_possible_cpus() <= max_cpus) 1302 if (num_possible_cpus() <= max_cpus)
1093 break; 1303 break;
1094 } 1304 }
@@ -1096,6 +1306,20 @@ void __init smp_prepare_cpus(unsigned int max_cpus)
1096 } 1306 }
1097 } 1307 }
1098 1308
1309 for_each_cpu(i) {
1310 if (tlb_type == hypervisor) {
1311 int j;
1312
1313 /* XXX get this mapping from machine description */
1314 for_each_cpu(j) {
1315 if ((j >> 2) == (i >> 2))
1316 cpu_set(j, cpu_sibling_map[i]);
1317 }
1318 } else {
1319 cpu_set(i, cpu_sibling_map[i]);
1320 }
1321 }
1322
1099 smp_store_cpu_info(boot_cpu_id); 1323 smp_store_cpu_info(boot_cpu_id);
1100} 1324}
1101 1325
@@ -1109,20 +1333,25 @@ void __init smp_setup_cpu_possible_map(void)
1109 1333
1110 instance = 0; 1334 instance = 0;
1111 while (!cpu_find_by_instance(instance, NULL, &mid)) { 1335 while (!cpu_find_by_instance(instance, NULL, &mid)) {
1112 if (mid < NR_CPUS) 1336 if (mid < NR_CPUS) {
1113 cpu_set(mid, phys_cpu_present_map); 1337 cpu_set(mid, phys_cpu_present_map);
1338 cpu_set(mid, cpu_present_map);
1339 }
1114 instance++; 1340 instance++;
1115 } 1341 }
1116} 1342}
1117 1343
1118void __devinit smp_prepare_boot_cpu(void) 1344void __devinit smp_prepare_boot_cpu(void)
1119{ 1345{
1120 if (hard_smp_processor_id() >= NR_CPUS) { 1346 int cpu = hard_smp_processor_id();
1347
1348 if (cpu >= NR_CPUS) {
1121 prom_printf("Serious problem, boot cpu id >= NR_CPUS\n"); 1349 prom_printf("Serious problem, boot cpu id >= NR_CPUS\n");
1122 prom_halt(); 1350 prom_halt();
1123 } 1351 }
1124 1352
1125 current_thread_info()->cpu = hard_smp_processor_id(); 1353 current_thread_info()->cpu = cpu;
1354 __local_per_cpu_offset = __per_cpu_offset(cpu);
1126 1355
1127 cpu_set(smp_processor_id(), cpu_online_map); 1356 cpu_set(smp_processor_id(), cpu_online_map);
1128 cpu_set(smp_processor_id(), phys_cpu_present_map); 1357 cpu_set(smp_processor_id(), phys_cpu_present_map);
@@ -1139,7 +1368,11 @@ int __devinit __cpu_up(unsigned int cpu)
1139 if (!cpu_isset(cpu, cpu_online_map)) { 1368 if (!cpu_isset(cpu, cpu_online_map)) {
1140 ret = -ENODEV; 1369 ret = -ENODEV;
1141 } else { 1370 } else {
1142 smp_synchronize_one_tick(cpu); 1371 /* On SUN4V, writes to %tick and %stick are
1372 * not allowed.
1373 */
1374 if (tlb_type != hypervisor)
1375 smp_synchronize_one_tick(cpu);
1143 } 1376 }
1144 } 1377 }
1145 return ret; 1378 return ret;
@@ -1150,10 +1383,8 @@ void __init smp_cpus_done(unsigned int max_cpus)
1150 unsigned long bogosum = 0; 1383 unsigned long bogosum = 0;
1151 int i; 1384 int i;
1152 1385
1153 for (i = 0; i < NR_CPUS; i++) { 1386 for_each_online_cpu(i)
1154 if (cpu_online(i)) 1387 bogosum += cpu_data(i).udelay_val;
1155 bogosum += cpu_data(i).udelay_val;
1156 }
1157 printk("Total of %ld processors activated " 1388 printk("Total of %ld processors activated "
1158 "(%lu.%02lu BogoMIPS).\n", 1389 "(%lu.%02lu BogoMIPS).\n",
1159 (long) num_online_cpus(), 1390 (long) num_online_cpus(),
@@ -1183,12 +1414,9 @@ void __init setup_per_cpu_areas(void)
1183{ 1414{
1184 unsigned long goal, size, i; 1415 unsigned long goal, size, i;
1185 char *ptr; 1416 char *ptr;
1186 /* Created by linker magic */
1187 extern char __per_cpu_start[], __per_cpu_end[];
1188 1417
1189 /* Copy section for each CPU (we discard the original) */ 1418 /* Copy section for each CPU (we discard the original) */
1190 goal = ALIGN(__per_cpu_end - __per_cpu_start, PAGE_SIZE); 1419 goal = ALIGN(__per_cpu_end - __per_cpu_start, SMP_CACHE_BYTES);
1191
1192#ifdef CONFIG_MODULES 1420#ifdef CONFIG_MODULES
1193 if (goal < PERCPU_ENOUGH_ROOM) 1421 if (goal < PERCPU_ENOUGH_ROOM)
1194 goal = PERCPU_ENOUGH_ROOM; 1422 goal = PERCPU_ENOUGH_ROOM;
@@ -1197,31 +1425,10 @@ void __init setup_per_cpu_areas(void)
1197 for (size = 1UL; size < goal; size <<= 1UL) 1425 for (size = 1UL; size < goal; size <<= 1UL)
1198 __per_cpu_shift++; 1426 __per_cpu_shift++;
1199 1427
1200 /* Make sure the resulting __per_cpu_base value 1428 ptr = alloc_bootmem(size * NR_CPUS);
1201 * will fit in the 43-bit sign extended IMMU
1202 * TSB register.
1203 */
1204 ptr = __alloc_bootmem(size * NR_CPUS, PAGE_SIZE,
1205 (unsigned long) __per_cpu_start);
1206 1429
1207 __per_cpu_base = ptr - __per_cpu_start; 1430 __per_cpu_base = ptr - __per_cpu_start;
1208 1431
1209 if ((__per_cpu_shift < PAGE_SHIFT) ||
1210 (__per_cpu_base & ~PAGE_MASK) ||
1211 (__per_cpu_base != (((long) __per_cpu_base << 20) >> 20))) {
1212 prom_printf("PER_CPU: Invalid layout, "
1213 "ptr[%p] shift[%lx] base[%lx]\n",
1214 ptr, __per_cpu_shift, __per_cpu_base);
1215 prom_halt();
1216 }
1217
1218 for (i = 0; i < NR_CPUS; i++, ptr += size) 1432 for (i = 0; i < NR_CPUS; i++, ptr += size)
1219 memcpy(ptr, __per_cpu_start, __per_cpu_end - __per_cpu_start); 1433 memcpy(ptr, __per_cpu_start, __per_cpu_end - __per_cpu_start);
1220
1221 /* Finally, load in the boot cpu's base value.
1222 * We abuse the IMMU TSB register for trap handler
1223 * entry and exit loading of %g5. That is why it
1224 * has to be page aligned.
1225 */
1226 cpu_setup_percpu_base(hard_smp_processor_id());
1227} 1434}
diff --git a/arch/sparc64/kernel/sparc64_ksyms.c b/arch/sparc64/kernel/sparc64_ksyms.c
index 3c06bfb92a8c..f5e8db1de76b 100644
--- a/arch/sparc64/kernel/sparc64_ksyms.c
+++ b/arch/sparc64/kernel/sparc64_ksyms.c
@@ -95,9 +95,6 @@ extern int __ashrdi3(int, int);
95 95
96extern int dump_fpu (struct pt_regs * regs, elf_fpregset_t * fpregs); 96extern int dump_fpu (struct pt_regs * regs, elf_fpregset_t * fpregs);
97 97
98extern unsigned long phys_base;
99extern unsigned long pfn_base;
100
101extern unsigned int sys_call_table[]; 98extern unsigned int sys_call_table[];
102 99
103extern void xor_vis_2(unsigned long, unsigned long *, unsigned long *); 100extern void xor_vis_2(unsigned long, unsigned long *, unsigned long *);
@@ -108,6 +105,14 @@ extern void xor_vis_4(unsigned long, unsigned long *, unsigned long *,
108extern void xor_vis_5(unsigned long, unsigned long *, unsigned long *, 105extern void xor_vis_5(unsigned long, unsigned long *, unsigned long *,
109 unsigned long *, unsigned long *, unsigned long *); 106 unsigned long *, unsigned long *, unsigned long *);
110 107
108extern void xor_niagara_2(unsigned long, unsigned long *, unsigned long *);
109extern void xor_niagara_3(unsigned long, unsigned long *, unsigned long *,
110 unsigned long *);
111extern void xor_niagara_4(unsigned long, unsigned long *, unsigned long *,
112 unsigned long *, unsigned long *);
113extern void xor_niagara_5(unsigned long, unsigned long *, unsigned long *,
114 unsigned long *, unsigned long *, unsigned long *);
115
111/* Per-CPU information table */ 116/* Per-CPU information table */
112EXPORT_PER_CPU_SYMBOL(__cpu_data); 117EXPORT_PER_CPU_SYMBOL(__cpu_data);
113 118
@@ -170,11 +175,6 @@ EXPORT_SYMBOL(set_bit);
170EXPORT_SYMBOL(clear_bit); 175EXPORT_SYMBOL(clear_bit);
171EXPORT_SYMBOL(change_bit); 176EXPORT_SYMBOL(change_bit);
172 177
173/* Bit searching */
174EXPORT_SYMBOL(find_next_bit);
175EXPORT_SYMBOL(find_next_zero_bit);
176EXPORT_SYMBOL(find_next_zero_le_bit);
177
178EXPORT_SYMBOL(ivector_table); 178EXPORT_SYMBOL(ivector_table);
179EXPORT_SYMBOL(enable_irq); 179EXPORT_SYMBOL(enable_irq);
180EXPORT_SYMBOL(disable_irq); 180EXPORT_SYMBOL(disable_irq);
@@ -241,10 +241,6 @@ EXPORT_SYMBOL(verify_compat_iovec);
241#endif 241#endif
242 242
243EXPORT_SYMBOL(dump_fpu); 243EXPORT_SYMBOL(dump_fpu);
244EXPORT_SYMBOL(pte_alloc_one_kernel);
245#ifndef CONFIG_SMP
246EXPORT_SYMBOL(pgt_quicklists);
247#endif
248EXPORT_SYMBOL(put_fs_struct); 244EXPORT_SYMBOL(put_fs_struct);
249 245
250/* math-emu wants this */ 246/* math-emu wants this */
@@ -278,18 +274,9 @@ EXPORT_SYMBOL(__prom_getsibling);
278 274
279/* sparc library symbols */ 275/* sparc library symbols */
280EXPORT_SYMBOL(strlen); 276EXPORT_SYMBOL(strlen);
281EXPORT_SYMBOL(strnlen);
282EXPORT_SYMBOL(__strlen_user); 277EXPORT_SYMBOL(__strlen_user);
283EXPORT_SYMBOL(__strnlen_user); 278EXPORT_SYMBOL(__strnlen_user);
284EXPORT_SYMBOL(strcpy);
285EXPORT_SYMBOL(strncpy);
286EXPORT_SYMBOL(strcat);
287EXPORT_SYMBOL(strncat);
288EXPORT_SYMBOL(strcmp);
289EXPORT_SYMBOL(strchr);
290EXPORT_SYMBOL(strrchr);
291EXPORT_SYMBOL(strpbrk); 279EXPORT_SYMBOL(strpbrk);
292EXPORT_SYMBOL(strstr);
293 280
294#ifdef CONFIG_SOLARIS_EMUL_MODULE 281#ifdef CONFIG_SOLARIS_EMUL_MODULE
295EXPORT_SYMBOL(linux_sparc_syscall); 282EXPORT_SYMBOL(linux_sparc_syscall);
@@ -323,7 +310,6 @@ EXPORT_SYMBOL(__memscan_zero);
323EXPORT_SYMBOL(__memscan_generic); 310EXPORT_SYMBOL(__memscan_generic);
324EXPORT_SYMBOL(__memcmp); 311EXPORT_SYMBOL(__memcmp);
325EXPORT_SYMBOL(__memset); 312EXPORT_SYMBOL(__memset);
326EXPORT_SYMBOL(memchr);
327 313
328EXPORT_SYMBOL(csum_partial); 314EXPORT_SYMBOL(csum_partial);
329EXPORT_SYMBOL(csum_partial_copy_nocheck); 315EXPORT_SYMBOL(csum_partial_copy_nocheck);
@@ -339,14 +325,10 @@ EXPORT_SYMBOL(copy_to_user_fixup);
339EXPORT_SYMBOL(copy_from_user_fixup); 325EXPORT_SYMBOL(copy_from_user_fixup);
340EXPORT_SYMBOL(copy_in_user_fixup); 326EXPORT_SYMBOL(copy_in_user_fixup);
341EXPORT_SYMBOL(__strncpy_from_user); 327EXPORT_SYMBOL(__strncpy_from_user);
342EXPORT_SYMBOL(__bzero_noasi); 328EXPORT_SYMBOL(__clear_user);
343 329
344/* Various address conversion macros use this. */ 330/* Various address conversion macros use this. */
345EXPORT_SYMBOL(phys_base);
346EXPORT_SYMBOL(pfn_base);
347EXPORT_SYMBOL(sparc64_valid_addr_bitmap); 331EXPORT_SYMBOL(sparc64_valid_addr_bitmap);
348EXPORT_SYMBOL(page_to_pfn);
349EXPORT_SYMBOL(pfn_to_page);
350 332
351/* No version information on this, heavily used in inline asm, 333/* No version information on this, heavily used in inline asm,
352 * and will always be 'void __ret_efault(void)'. 334 * and will always be 'void __ret_efault(void)'.
@@ -392,4 +374,9 @@ EXPORT_SYMBOL(xor_vis_3);
392EXPORT_SYMBOL(xor_vis_4); 374EXPORT_SYMBOL(xor_vis_4);
393EXPORT_SYMBOL(xor_vis_5); 375EXPORT_SYMBOL(xor_vis_5);
394 376
377EXPORT_SYMBOL(xor_niagara_2);
378EXPORT_SYMBOL(xor_niagara_3);
379EXPORT_SYMBOL(xor_niagara_4);
380EXPORT_SYMBOL(xor_niagara_5);
381
395EXPORT_SYMBOL(prom_palette); 382EXPORT_SYMBOL(prom_palette);
diff --git a/arch/sparc64/kernel/sun4v_ivec.S b/arch/sparc64/kernel/sun4v_ivec.S
new file mode 100644
index 000000000000..b49a68bdda43
--- /dev/null
+++ b/arch/sparc64/kernel/sun4v_ivec.S
@@ -0,0 +1,334 @@
1/* sun4v_ivec.S: Sun4v interrupt vector handling.
2 *
3 * Copyright (C) 2006 <davem@davemloft.net>
4 */
5
6#include <asm/cpudata.h>
7#include <asm/intr_queue.h>
8
9 .text
10 .align 32
11
12sun4v_cpu_mondo:
13 /* Head offset in %g2, tail offset in %g4.
14 * If they are the same, no work.
15 */
16 mov INTRQ_CPU_MONDO_HEAD, %g2
17 ldxa [%g2] ASI_QUEUE, %g2
18 mov INTRQ_CPU_MONDO_TAIL, %g4
19 ldxa [%g4] ASI_QUEUE, %g4
20 cmp %g2, %g4
21 be,pn %xcc, sun4v_cpu_mondo_queue_empty
22 nop
23
24 /* Get &trap_block[smp_processor_id()] into %g3. */
25 ldxa [%g0] ASI_SCRATCHPAD, %g3
26 sub %g3, TRAP_PER_CPU_FAULT_INFO, %g3
27
28 /* Get CPU mondo queue base phys address into %g7. */
29 ldx [%g3 + TRAP_PER_CPU_CPU_MONDO_PA], %g7
30
31 /* Now get the cross-call arguments and handler PC, same
32 * layout as sun4u:
33 *
34 * 1st 64-bit word: low half is 32-bit PC, put into %g3 and jmpl to it
35 * high half is context arg to MMU flushes, into %g5
36 * 2nd 64-bit word: 64-bit arg, load into %g1
37 * 3rd 64-bit word: 64-bit arg, load into %g7
38 */
39 ldxa [%g7 + %g2] ASI_PHYS_USE_EC, %g3
40 add %g2, 0x8, %g2
41 srlx %g3, 32, %g5
42 ldxa [%g7 + %g2] ASI_PHYS_USE_EC, %g1
43 add %g2, 0x8, %g2
44 srl %g3, 0, %g3
45 ldxa [%g7 + %g2] ASI_PHYS_USE_EC, %g7
46 add %g2, 0x40 - 0x8 - 0x8, %g2
47
48 /* Update queue head pointer. */
49 sethi %hi(8192 - 1), %g4
50 or %g4, %lo(8192 - 1), %g4
51 and %g2, %g4, %g2
52
53 mov INTRQ_CPU_MONDO_HEAD, %g4
54 stxa %g2, [%g4] ASI_QUEUE
55 membar #Sync
56
57 jmpl %g3, %g0
58 nop
59
60sun4v_cpu_mondo_queue_empty:
61 retry
62
63sun4v_dev_mondo:
64 /* Head offset in %g2, tail offset in %g4. */
65 mov INTRQ_DEVICE_MONDO_HEAD, %g2
66 ldxa [%g2] ASI_QUEUE, %g2
67 mov INTRQ_DEVICE_MONDO_TAIL, %g4
68 ldxa [%g4] ASI_QUEUE, %g4
69 cmp %g2, %g4
70 be,pn %xcc, sun4v_dev_mondo_queue_empty
71 nop
72
73 /* Get &trap_block[smp_processor_id()] into %g3. */
74 ldxa [%g0] ASI_SCRATCHPAD, %g3
75 sub %g3, TRAP_PER_CPU_FAULT_INFO, %g3
76
77 /* Get DEV mondo queue base phys address into %g5. */
78 ldx [%g3 + TRAP_PER_CPU_DEV_MONDO_PA], %g5
79
80 /* Load IVEC into %g3. */
81 ldxa [%g5 + %g2] ASI_PHYS_USE_EC, %g3
82 add %g2, 0x40, %g2
83
84 /* XXX There can be a full 64-byte block of data here.
85 * XXX This is how we can get at MSI vector data.
86 * XXX Current we do not capture this, but when we do we'll
87 * XXX need to add a 64-byte storage area in the struct ino_bucket
88 * XXX or the struct irq_desc.
89 */
90
91 /* Update queue head pointer, this frees up some registers. */
92 sethi %hi(8192 - 1), %g4
93 or %g4, %lo(8192 - 1), %g4
94 and %g2, %g4, %g2
95
96 mov INTRQ_DEVICE_MONDO_HEAD, %g4
97 stxa %g2, [%g4] ASI_QUEUE
98 membar #Sync
99
100 /* Get &__irq_work[smp_processor_id()] into %g1. */
101 TRAP_LOAD_IRQ_WORK(%g1, %g4)
102
103 /* Get &ivector_table[IVEC] into %g4. */
104 sethi %hi(ivector_table), %g4
105 sllx %g3, 5, %g3
106 or %g4, %lo(ivector_table), %g4
107 add %g4, %g3, %g4
108
109 /* Load IRQ %pil into %g5. */
110 ldub [%g4 + 0x04], %g5
111
112 /* Insert ivector_table[] entry into __irq_work[] queue. */
113 sllx %g5, 2, %g3
114 lduw [%g1 + %g3], %g2 /* g2 = irq_work(cpu, pil) */
115 stw %g2, [%g4 + 0x00] /* bucket->irq_chain = g2 */
116 stw %g4, [%g1 + %g3] /* irq_work(cpu, pil) = bucket */
117
118 /* Signal the interrupt by setting (1 << pil) in %softint. */
119 mov 1, %g2
120 sllx %g2, %g5, %g2
121 wr %g2, 0x0, %set_softint
122
123sun4v_dev_mondo_queue_empty:
124 retry
125
126sun4v_res_mondo:
127 /* Head offset in %g2, tail offset in %g4. */
128 mov INTRQ_RESUM_MONDO_HEAD, %g2
129 ldxa [%g2] ASI_QUEUE, %g2
130 mov INTRQ_RESUM_MONDO_TAIL, %g4
131 ldxa [%g4] ASI_QUEUE, %g4
132 cmp %g2, %g4
133 be,pn %xcc, sun4v_res_mondo_queue_empty
134 nop
135
136 /* Get &trap_block[smp_processor_id()] into %g3. */
137 ldxa [%g0] ASI_SCRATCHPAD, %g3
138 sub %g3, TRAP_PER_CPU_FAULT_INFO, %g3
139
140 /* Get RES mondo queue base phys address into %g5. */
141 ldx [%g3 + TRAP_PER_CPU_RESUM_MONDO_PA], %g5
142
143 /* Get RES kernel buffer base phys address into %g7. */
144 ldx [%g3 + TRAP_PER_CPU_RESUM_KBUF_PA], %g7
145
146 /* If the first word is non-zero, queue is full. */
147 ldxa [%g7 + %g2] ASI_PHYS_USE_EC, %g1
148 brnz,pn %g1, sun4v_res_mondo_queue_full
149 nop
150
151 /* Remember this entry's offset in %g1. */
152 mov %g2, %g1
153
154 /* Copy 64-byte queue entry into kernel buffer. */
155 ldxa [%g5 + %g2] ASI_PHYS_USE_EC, %g3
156 stxa %g3, [%g7 + %g2] ASI_PHYS_USE_EC
157 add %g2, 0x08, %g2
158 ldxa [%g5 + %g2] ASI_PHYS_USE_EC, %g3
159 stxa %g3, [%g7 + %g2] ASI_PHYS_USE_EC
160 add %g2, 0x08, %g2
161 ldxa [%g5 + %g2] ASI_PHYS_USE_EC, %g3
162 stxa %g3, [%g7 + %g2] ASI_PHYS_USE_EC
163 add %g2, 0x08, %g2
164 ldxa [%g5 + %g2] ASI_PHYS_USE_EC, %g3
165 stxa %g3, [%g7 + %g2] ASI_PHYS_USE_EC
166 add %g2, 0x08, %g2
167 ldxa [%g5 + %g2] ASI_PHYS_USE_EC, %g3
168 stxa %g3, [%g7 + %g2] ASI_PHYS_USE_EC
169 add %g2, 0x08, %g2
170 ldxa [%g5 + %g2] ASI_PHYS_USE_EC, %g3
171 stxa %g3, [%g7 + %g2] ASI_PHYS_USE_EC
172 add %g2, 0x08, %g2
173 ldxa [%g5 + %g2] ASI_PHYS_USE_EC, %g3
174 stxa %g3, [%g7 + %g2] ASI_PHYS_USE_EC
175 add %g2, 0x08, %g2
176 ldxa [%g5 + %g2] ASI_PHYS_USE_EC, %g3
177 stxa %g3, [%g7 + %g2] ASI_PHYS_USE_EC
178 add %g2, 0x08, %g2
179
180 /* Update queue head pointer. */
181 sethi %hi(8192 - 1), %g4
182 or %g4, %lo(8192 - 1), %g4
183 and %g2, %g4, %g2
184
185 mov INTRQ_RESUM_MONDO_HEAD, %g4
186 stxa %g2, [%g4] ASI_QUEUE
187 membar #Sync
188
189 /* Disable interrupts and save register state so we can call
190 * C code. The etrap handling will leave %g4 in %l4 for us
191 * when it's done.
192 */
193 rdpr %pil, %g2
194 wrpr %g0, 15, %pil
195 mov %g1, %g4
196 ba,pt %xcc, etrap_irq
197 rd %pc, %g7
198
199 /* Log the event. */
200 add %sp, PTREGS_OFF, %o0
201 call sun4v_resum_error
202 mov %l4, %o1
203
204 /* Return from trap. */
205 ba,pt %xcc, rtrap_irq
206 nop
207
208sun4v_res_mondo_queue_empty:
209 retry
210
211sun4v_res_mondo_queue_full:
212 /* The queue is full, consolidate our damage by setting
213 * the head equal to the tail. We'll just trap again otherwise.
214 * Call C code to log the event.
215 */
216 mov INTRQ_RESUM_MONDO_HEAD, %g2
217 stxa %g4, [%g2] ASI_QUEUE
218 membar #Sync
219
220 rdpr %pil, %g2
221 wrpr %g0, 15, %pil
222 ba,pt %xcc, etrap_irq
223 rd %pc, %g7
224
225 call sun4v_resum_overflow
226 add %sp, PTREGS_OFF, %o0
227
228 ba,pt %xcc, rtrap_irq
229 nop
230
231sun4v_nonres_mondo:
232 /* Head offset in %g2, tail offset in %g4. */
233 mov INTRQ_NONRESUM_MONDO_HEAD, %g2
234 ldxa [%g2] ASI_QUEUE, %g2
235 mov INTRQ_NONRESUM_MONDO_TAIL, %g4
236 ldxa [%g4] ASI_QUEUE, %g4
237 cmp %g2, %g4
238 be,pn %xcc, sun4v_nonres_mondo_queue_empty
239 nop
240
241 /* Get &trap_block[smp_processor_id()] into %g3. */
242 ldxa [%g0] ASI_SCRATCHPAD, %g3
243 sub %g3, TRAP_PER_CPU_FAULT_INFO, %g3
244
245 /* Get RES mondo queue base phys address into %g5. */
246 ldx [%g3 + TRAP_PER_CPU_NONRESUM_MONDO_PA], %g5
247
248 /* Get RES kernel buffer base phys address into %g7. */
249 ldx [%g3 + TRAP_PER_CPU_NONRESUM_KBUF_PA], %g7
250
251 /* If the first word is non-zero, queue is full. */
252 ldxa [%g7 + %g2] ASI_PHYS_USE_EC, %g1
253 brnz,pn %g1, sun4v_nonres_mondo_queue_full
254 nop
255
256 /* Remember this entry's offset in %g1. */
257 mov %g2, %g1
258
259 /* Copy 64-byte queue entry into kernel buffer. */
260 ldxa [%g5 + %g2] ASI_PHYS_USE_EC, %g3
261 stxa %g3, [%g7 + %g2] ASI_PHYS_USE_EC
262 add %g2, 0x08, %g2
263 ldxa [%g5 + %g2] ASI_PHYS_USE_EC, %g3
264 stxa %g3, [%g7 + %g2] ASI_PHYS_USE_EC
265 add %g2, 0x08, %g2
266 ldxa [%g5 + %g2] ASI_PHYS_USE_EC, %g3
267 stxa %g3, [%g7 + %g2] ASI_PHYS_USE_EC
268 add %g2, 0x08, %g2
269 ldxa [%g5 + %g2] ASI_PHYS_USE_EC, %g3
270 stxa %g3, [%g7 + %g2] ASI_PHYS_USE_EC
271 add %g2, 0x08, %g2
272 ldxa [%g5 + %g2] ASI_PHYS_USE_EC, %g3
273 stxa %g3, [%g7 + %g2] ASI_PHYS_USE_EC
274 add %g2, 0x08, %g2
275 ldxa [%g5 + %g2] ASI_PHYS_USE_EC, %g3
276 stxa %g3, [%g7 + %g2] ASI_PHYS_USE_EC
277 add %g2, 0x08, %g2
278 ldxa [%g5 + %g2] ASI_PHYS_USE_EC, %g3
279 stxa %g3, [%g7 + %g2] ASI_PHYS_USE_EC
280 add %g2, 0x08, %g2
281 ldxa [%g5 + %g2] ASI_PHYS_USE_EC, %g3
282 stxa %g3, [%g7 + %g2] ASI_PHYS_USE_EC
283 add %g2, 0x08, %g2
284
285 /* Update queue head pointer. */
286 sethi %hi(8192 - 1), %g4
287 or %g4, %lo(8192 - 1), %g4
288 and %g2, %g4, %g2
289
290 mov INTRQ_NONRESUM_MONDO_HEAD, %g4
291 stxa %g2, [%g4] ASI_QUEUE
292 membar #Sync
293
294 /* Disable interrupts and save register state so we can call
295 * C code. The etrap handling will leave %g4 in %l4 for us
296 * when it's done.
297 */
298 rdpr %pil, %g2
299 wrpr %g0, 15, %pil
300 mov %g1, %g4
301 ba,pt %xcc, etrap_irq
302 rd %pc, %g7
303
304 /* Log the event. */
305 add %sp, PTREGS_OFF, %o0
306 call sun4v_nonresum_error
307 mov %l4, %o1
308
309 /* Return from trap. */
310 ba,pt %xcc, rtrap_irq
311 nop
312
313sun4v_nonres_mondo_queue_empty:
314 retry
315
316sun4v_nonres_mondo_queue_full:
317 /* The queue is full, consolidate our damage by setting
318 * the head equal to the tail. We'll just trap again otherwise.
319 * Call C code to log the event.
320 */
321 mov INTRQ_NONRESUM_MONDO_HEAD, %g2
322 stxa %g4, [%g2] ASI_QUEUE
323 membar #Sync
324
325 rdpr %pil, %g2
326 wrpr %g0, 15, %pil
327 ba,pt %xcc, etrap_irq
328 rd %pc, %g7
329
330 call sun4v_nonresum_overflow
331 add %sp, PTREGS_OFF, %o0
332
333 ba,pt %xcc, rtrap_irq
334 nop
diff --git a/arch/sparc64/kernel/sun4v_tlb_miss.S b/arch/sparc64/kernel/sun4v_tlb_miss.S
new file mode 100644
index 000000000000..b731881224e8
--- /dev/null
+++ b/arch/sparc64/kernel/sun4v_tlb_miss.S
@@ -0,0 +1,426 @@
1/* sun4v_tlb_miss.S: Sun4v TLB miss handlers.
2 *
3 * Copyright (C) 2006 <davem@davemloft.net>
4 */
5
6 .text
7 .align 32
8
9 /* Load ITLB fault information into VADDR and CTX, using BASE. */
10#define LOAD_ITLB_INFO(BASE, VADDR, CTX) \
11 ldx [BASE + HV_FAULT_I_ADDR_OFFSET], VADDR; \
12 ldx [BASE + HV_FAULT_I_CTX_OFFSET], CTX;
13
14 /* Load DTLB fault information into VADDR and CTX, using BASE. */
15#define LOAD_DTLB_INFO(BASE, VADDR, CTX) \
16 ldx [BASE + HV_FAULT_D_ADDR_OFFSET], VADDR; \
17 ldx [BASE + HV_FAULT_D_CTX_OFFSET], CTX;
18
19 /* DEST = (VADDR >> 22)
20 *
21 * Branch to ZERO_CTX_LABEL if context is zero.
22 */
23#define COMPUTE_TAG_TARGET(DEST, VADDR, CTX, ZERO_CTX_LABEL) \
24 srlx VADDR, 22, DEST; \
25 brz,pn CTX, ZERO_CTX_LABEL; \
26 nop;
27
28 /* Create TSB pointer. This is something like:
29 *
30 * index_mask = (512 << (tsb_reg & 0x7UL)) - 1UL;
31 * tsb_base = tsb_reg & ~0x7UL;
32 * tsb_index = ((vaddr >> HASH_SHIFT) & tsb_mask);
33 * tsb_ptr = tsb_base + (tsb_index * 16);
34 */
35#define COMPUTE_TSB_PTR(TSB_PTR, VADDR, HASH_SHIFT, TMP1, TMP2) \
36 and TSB_PTR, 0x7, TMP1; \
37 mov 512, TMP2; \
38 andn TSB_PTR, 0x7, TSB_PTR; \
39 sllx TMP2, TMP1, TMP2; \
40 srlx VADDR, HASH_SHIFT, TMP1; \
41 sub TMP2, 1, TMP2; \
42 and TMP1, TMP2, TMP1; \
43 sllx TMP1, 4, TMP1; \
44 add TSB_PTR, TMP1, TSB_PTR;
45
46sun4v_itlb_miss:
47 /* Load MMU Miss base into %g2. */
48 ldxa [%g0] ASI_SCRATCHPAD, %g2
49
50 /* Load UTSB reg into %g1. */
51 mov SCRATCHPAD_UTSBREG1, %g1
52 ldxa [%g1] ASI_SCRATCHPAD, %g1
53
54 LOAD_ITLB_INFO(%g2, %g4, %g5)
55 COMPUTE_TAG_TARGET(%g6, %g4, %g5, kvmap_itlb_4v)
56 COMPUTE_TSB_PTR(%g1, %g4, PAGE_SHIFT, %g3, %g7)
57
58 /* Load TSB tag/pte into %g2/%g3 and compare the tag. */
59 ldda [%g1] ASI_QUAD_LDD_PHYS_4V, %g2
60 cmp %g2, %g6
61 bne,a,pn %xcc, tsb_miss_page_table_walk
62 mov FAULT_CODE_ITLB, %g3
63 andcc %g3, _PAGE_EXEC_4V, %g0
64 be,a,pn %xcc, tsb_do_fault
65 mov FAULT_CODE_ITLB, %g3
66
67 /* We have a valid entry, make hypervisor call to load
68 * I-TLB and return from trap.
69 *
70 * %g3: PTE
71 * %g4: vaddr
72 */
73sun4v_itlb_load:
74 ldxa [%g0] ASI_SCRATCHPAD, %g6
75 mov %o0, %g1 ! save %o0
76 mov %o1, %g2 ! save %o1
77 mov %o2, %g5 ! save %o2
78 mov %o3, %g7 ! save %o3
79 mov %g4, %o0 ! vaddr
80 ldx [%g6 + HV_FAULT_I_CTX_OFFSET], %o1 ! ctx
81 mov %g3, %o2 ! PTE
82 mov HV_MMU_IMMU, %o3 ! flags
83 ta HV_MMU_MAP_ADDR_TRAP
84 brnz,pn %o0, sun4v_itlb_error
85 mov %g2, %o1 ! restore %o1
86 mov %g1, %o0 ! restore %o0
87 mov %g5, %o2 ! restore %o2
88 mov %g7, %o3 ! restore %o3
89
90 retry
91
92sun4v_dtlb_miss:
93 /* Load MMU Miss base into %g2. */
94 ldxa [%g0] ASI_SCRATCHPAD, %g2
95
96 /* Load UTSB reg into %g1. */
97 mov SCRATCHPAD_UTSBREG1, %g1
98 ldxa [%g1] ASI_SCRATCHPAD, %g1
99
100 LOAD_DTLB_INFO(%g2, %g4, %g5)
101 COMPUTE_TAG_TARGET(%g6, %g4, %g5, kvmap_dtlb_4v)
102 COMPUTE_TSB_PTR(%g1, %g4, PAGE_SHIFT, %g3, %g7)
103
104 /* Load TSB tag/pte into %g2/%g3 and compare the tag. */
105 ldda [%g1] ASI_QUAD_LDD_PHYS_4V, %g2
106 cmp %g2, %g6
107 bne,a,pn %xcc, tsb_miss_page_table_walk
108 mov FAULT_CODE_DTLB, %g3
109
110 /* We have a valid entry, make hypervisor call to load
111 * D-TLB and return from trap.
112 *
113 * %g3: PTE
114 * %g4: vaddr
115 */
116sun4v_dtlb_load:
117 ldxa [%g0] ASI_SCRATCHPAD, %g6
118 mov %o0, %g1 ! save %o0
119 mov %o1, %g2 ! save %o1
120 mov %o2, %g5 ! save %o2
121 mov %o3, %g7 ! save %o3
122 mov %g4, %o0 ! vaddr
123 ldx [%g6 + HV_FAULT_D_CTX_OFFSET], %o1 ! ctx
124 mov %g3, %o2 ! PTE
125 mov HV_MMU_DMMU, %o3 ! flags
126 ta HV_MMU_MAP_ADDR_TRAP
127 brnz,pn %o0, sun4v_dtlb_error
128 mov %g2, %o1 ! restore %o1
129 mov %g1, %o0 ! restore %o0
130 mov %g5, %o2 ! restore %o2
131 mov %g7, %o3 ! restore %o3
132
133 retry
134
135sun4v_dtlb_prot:
136 SET_GL(1)
137
138 /* Load MMU Miss base into %g5. */
139 ldxa [%g0] ASI_SCRATCHPAD, %g5
140
141 ldx [%g5 + HV_FAULT_D_ADDR_OFFSET], %g5
142 rdpr %tl, %g1
143 cmp %g1, 1
144 bgu,pn %xcc, winfix_trampoline
145 nop
146 ba,pt %xcc, sparc64_realfault_common
147 mov FAULT_CODE_DTLB | FAULT_CODE_WRITE, %g4
148
149 /* Called from trap table:
150 * %g4: vaddr
151 * %g5: context
152 * %g6: TAG TARGET
153 */
154sun4v_itsb_miss:
155 mov SCRATCHPAD_UTSBREG1, %g1
156 ldxa [%g1] ASI_SCRATCHPAD, %g1
157 brz,pn %g5, kvmap_itlb_4v
158 mov FAULT_CODE_ITLB, %g3
159 ba,a,pt %xcc, sun4v_tsb_miss_common
160
161 /* Called from trap table:
162 * %g4: vaddr
163 * %g5: context
164 * %g6: TAG TARGET
165 */
166sun4v_dtsb_miss:
167 mov SCRATCHPAD_UTSBREG1, %g1
168 ldxa [%g1] ASI_SCRATCHPAD, %g1
169 brz,pn %g5, kvmap_dtlb_4v
170 mov FAULT_CODE_DTLB, %g3
171
172 /* fallthrough */
173
174sun4v_tsb_miss_common:
175 COMPUTE_TSB_PTR(%g1, %g4, PAGE_SHIFT, %g5, %g7)
176
177 sub %g2, TRAP_PER_CPU_FAULT_INFO, %g2
178
179#ifdef CONFIG_HUGETLB_PAGE
180 mov SCRATCHPAD_UTSBREG2, %g5
181 ldxa [%g5] ASI_SCRATCHPAD, %g5
182 cmp %g5, -1
183 be,pt %xcc, 80f
184 nop
185 COMPUTE_TSB_PTR(%g5, %g4, HPAGE_SHIFT, %g2, %g7)
186
187 /* That clobbered %g2, reload it. */
188 ldxa [%g0] ASI_SCRATCHPAD, %g2
189 sub %g2, TRAP_PER_CPU_FAULT_INFO, %g2
190
19180: stx %g5, [%g2 + TRAP_PER_CPU_TSB_HUGE_TEMP]
192#endif
193
194 ba,pt %xcc, tsb_miss_page_table_walk_sun4v_fastpath
195 ldx [%g2 + TRAP_PER_CPU_PGD_PADDR], %g7
196
197sun4v_itlb_error:
198 sethi %hi(sun4v_err_itlb_vaddr), %g1
199 stx %g4, [%g1 + %lo(sun4v_err_itlb_vaddr)]
200 sethi %hi(sun4v_err_itlb_ctx), %g1
201 ldxa [%g0] ASI_SCRATCHPAD, %g6
202 ldx [%g6 + HV_FAULT_I_CTX_OFFSET], %o1
203 stx %o1, [%g1 + %lo(sun4v_err_itlb_ctx)]
204 sethi %hi(sun4v_err_itlb_pte), %g1
205 stx %g3, [%g1 + %lo(sun4v_err_itlb_pte)]
206 sethi %hi(sun4v_err_itlb_error), %g1
207 stx %o0, [%g1 + %lo(sun4v_err_itlb_error)]
208
209 rdpr %tl, %g4
210 cmp %g4, 1
211 ble,pt %icc, 1f
212 sethi %hi(2f), %g7
213 ba,pt %xcc, etraptl1
214 or %g7, %lo(2f), %g7
215
2161: ba,pt %xcc, etrap
2172: or %g7, %lo(2b), %g7
218 call sun4v_itlb_error_report
219 add %sp, PTREGS_OFF, %o0
220
221 /* NOTREACHED */
222
223sun4v_dtlb_error:
224 sethi %hi(sun4v_err_dtlb_vaddr), %g1
225 stx %g4, [%g1 + %lo(sun4v_err_dtlb_vaddr)]
226 sethi %hi(sun4v_err_dtlb_ctx), %g1
227 ldxa [%g0] ASI_SCRATCHPAD, %g6
228 ldx [%g6 + HV_FAULT_D_CTX_OFFSET], %o1
229 stx %o1, [%g1 + %lo(sun4v_err_dtlb_ctx)]
230 sethi %hi(sun4v_err_dtlb_pte), %g1
231 stx %g3, [%g1 + %lo(sun4v_err_dtlb_pte)]
232 sethi %hi(sun4v_err_dtlb_error), %g1
233 stx %o0, [%g1 + %lo(sun4v_err_dtlb_error)]
234
235 rdpr %tl, %g4
236 cmp %g4, 1
237 ble,pt %icc, 1f
238 sethi %hi(2f), %g7
239 ba,pt %xcc, etraptl1
240 or %g7, %lo(2f), %g7
241
2421: ba,pt %xcc, etrap
2432: or %g7, %lo(2b), %g7
244 call sun4v_dtlb_error_report
245 add %sp, PTREGS_OFF, %o0
246
247 /* NOTREACHED */
248
249 /* Instruction Access Exception, tl0. */
250sun4v_iacc:
251 ldxa [%g0] ASI_SCRATCHPAD, %g2
252 ldx [%g2 + HV_FAULT_I_TYPE_OFFSET], %g3
253 ldx [%g2 + HV_FAULT_I_ADDR_OFFSET], %g4
254 ldx [%g2 + HV_FAULT_I_CTX_OFFSET], %g5
255 sllx %g3, 16, %g3
256 or %g5, %g3, %g5
257 ba,pt %xcc, etrap
258 rd %pc, %g7
259 mov %l4, %o1
260 mov %l5, %o2
261 call sun4v_insn_access_exception
262 add %sp, PTREGS_OFF, %o0
263 ba,a,pt %xcc, rtrap_clr_l6
264
265 /* Instruction Access Exception, tl1. */
266sun4v_iacc_tl1:
267 ldxa [%g0] ASI_SCRATCHPAD, %g2
268 ldx [%g2 + HV_FAULT_I_TYPE_OFFSET], %g3
269 ldx [%g2 + HV_FAULT_I_ADDR_OFFSET], %g4
270 ldx [%g2 + HV_FAULT_I_CTX_OFFSET], %g5
271 sllx %g3, 16, %g3
272 or %g5, %g3, %g5
273 ba,pt %xcc, etraptl1
274 rd %pc, %g7
275 mov %l4, %o1
276 mov %l5, %o2
277 call sun4v_insn_access_exception_tl1
278 add %sp, PTREGS_OFF, %o0
279 ba,a,pt %xcc, rtrap_clr_l6
280
281 /* Data Access Exception, tl0. */
282sun4v_dacc:
283 ldxa [%g0] ASI_SCRATCHPAD, %g2
284 ldx [%g2 + HV_FAULT_D_TYPE_OFFSET], %g3
285 ldx [%g2 + HV_FAULT_D_ADDR_OFFSET], %g4
286 ldx [%g2 + HV_FAULT_D_CTX_OFFSET], %g5
287 sllx %g3, 16, %g3
288 or %g5, %g3, %g5
289 ba,pt %xcc, etrap
290 rd %pc, %g7
291 mov %l4, %o1
292 mov %l5, %o2
293 call sun4v_data_access_exception
294 add %sp, PTREGS_OFF, %o0
295 ba,a,pt %xcc, rtrap_clr_l6
296
297 /* Data Access Exception, tl1. */
298sun4v_dacc_tl1:
299 ldxa [%g0] ASI_SCRATCHPAD, %g2
300 ldx [%g2 + HV_FAULT_D_TYPE_OFFSET], %g3
301 ldx [%g2 + HV_FAULT_D_ADDR_OFFSET], %g4
302 ldx [%g2 + HV_FAULT_D_CTX_OFFSET], %g5
303 sllx %g3, 16, %g3
304 or %g5, %g3, %g5
305 ba,pt %xcc, etraptl1
306 rd %pc, %g7
307 mov %l4, %o1
308 mov %l5, %o2
309 call sun4v_data_access_exception_tl1
310 add %sp, PTREGS_OFF, %o0
311 ba,a,pt %xcc, rtrap_clr_l6
312
313 /* Memory Address Unaligned. */
314sun4v_mna:
315 /* Window fixup? */
316 rdpr %tl, %g2
317 cmp %g2, 1
318 ble,pt %icc, 1f
319 nop
320
321 SET_GL(1)
322 ldxa [%g0] ASI_SCRATCHPAD, %g2
323 ldx [%g2 + HV_FAULT_D_ADDR_OFFSET], %g5
324 mov HV_FAULT_TYPE_UNALIGNED, %g3
325 ldx [%g2 + HV_FAULT_D_CTX_OFFSET], %g4
326 sllx %g3, 16, %g3
327 or %g4, %g3, %g4
328 ba,pt %xcc, winfix_mna
329 rdpr %tpc, %g3
330 /* not reached */
331
3321: ldxa [%g0] ASI_SCRATCHPAD, %g2
333 mov HV_FAULT_TYPE_UNALIGNED, %g3
334 ldx [%g2 + HV_FAULT_D_ADDR_OFFSET], %g4
335 ldx [%g2 + HV_FAULT_D_CTX_OFFSET], %g5
336 sllx %g3, 16, %g3
337 or %g5, %g3, %g5
338
339 ba,pt %xcc, etrap
340 rd %pc, %g7
341 mov %l4, %o1
342 mov %l5, %o2
343 call sun4v_do_mna
344 add %sp, PTREGS_OFF, %o0
345 ba,a,pt %xcc, rtrap_clr_l6
346
347 /* Privileged Action. */
348sun4v_privact:
349 ba,pt %xcc, etrap
350 rd %pc, %g7
351 call do_privact
352 add %sp, PTREGS_OFF, %o0
353 ba,a,pt %xcc, rtrap_clr_l6
354
355 /* Unaligned ldd float, tl0. */
356sun4v_lddfmna:
357 ldxa [%g0] ASI_SCRATCHPAD, %g2
358 ldx [%g2 + HV_FAULT_D_TYPE_OFFSET], %g3
359 ldx [%g2 + HV_FAULT_D_ADDR_OFFSET], %g4
360 ldx [%g2 + HV_FAULT_D_CTX_OFFSET], %g5
361 sllx %g3, 16, %g3
362 or %g5, %g3, %g5
363 ba,pt %xcc, etrap
364 rd %pc, %g7
365 mov %l4, %o1
366 mov %l5, %o2
367 call handle_lddfmna
368 add %sp, PTREGS_OFF, %o0
369 ba,a,pt %xcc, rtrap_clr_l6
370
371 /* Unaligned std float, tl0. */
372sun4v_stdfmna:
373 ldxa [%g0] ASI_SCRATCHPAD, %g2
374 ldx [%g2 + HV_FAULT_D_TYPE_OFFSET], %g3
375 ldx [%g2 + HV_FAULT_D_ADDR_OFFSET], %g4
376 ldx [%g2 + HV_FAULT_D_CTX_OFFSET], %g5
377 sllx %g3, 16, %g3
378 or %g5, %g3, %g5
379 ba,pt %xcc, etrap
380 rd %pc, %g7
381 mov %l4, %o1
382 mov %l5, %o2
383 call handle_stdfmna
384 add %sp, PTREGS_OFF, %o0
385 ba,a,pt %xcc, rtrap_clr_l6
386
387#define BRANCH_ALWAYS 0x10680000
388#define NOP 0x01000000
389#define SUN4V_DO_PATCH(OLD, NEW) \
390 sethi %hi(NEW), %g1; \
391 or %g1, %lo(NEW), %g1; \
392 sethi %hi(OLD), %g2; \
393 or %g2, %lo(OLD), %g2; \
394 sub %g1, %g2, %g1; \
395 sethi %hi(BRANCH_ALWAYS), %g3; \
396 sll %g1, 11, %g1; \
397 srl %g1, 11 + 2, %g1; \
398 or %g3, %lo(BRANCH_ALWAYS), %g3; \
399 or %g3, %g1, %g3; \
400 stw %g3, [%g2]; \
401 sethi %hi(NOP), %g3; \
402 or %g3, %lo(NOP), %g3; \
403 stw %g3, [%g2 + 0x4]; \
404 flush %g2;
405
406 .globl sun4v_patch_tlb_handlers
407 .type sun4v_patch_tlb_handlers,#function
408sun4v_patch_tlb_handlers:
409 SUN4V_DO_PATCH(tl0_iamiss, sun4v_itlb_miss)
410 SUN4V_DO_PATCH(tl1_iamiss, sun4v_itlb_miss)
411 SUN4V_DO_PATCH(tl0_damiss, sun4v_dtlb_miss)
412 SUN4V_DO_PATCH(tl1_damiss, sun4v_dtlb_miss)
413 SUN4V_DO_PATCH(tl0_daprot, sun4v_dtlb_prot)
414 SUN4V_DO_PATCH(tl1_daprot, sun4v_dtlb_prot)
415 SUN4V_DO_PATCH(tl0_iax, sun4v_iacc)
416 SUN4V_DO_PATCH(tl1_iax, sun4v_iacc_tl1)
417 SUN4V_DO_PATCH(tl0_dax, sun4v_dacc)
418 SUN4V_DO_PATCH(tl1_dax, sun4v_dacc_tl1)
419 SUN4V_DO_PATCH(tl0_mna, sun4v_mna)
420 SUN4V_DO_PATCH(tl1_mna, sun4v_mna)
421 SUN4V_DO_PATCH(tl0_lddfmna, sun4v_lddfmna)
422 SUN4V_DO_PATCH(tl0_stdfmna, sun4v_stdfmna)
423 SUN4V_DO_PATCH(tl0_privact, sun4v_privact)
424 retl
425 nop
426 .size sun4v_patch_tlb_handlers,.-sun4v_patch_tlb_handlers
diff --git a/arch/sparc64/kernel/sys_sparc.c b/arch/sparc64/kernel/sys_sparc.c
index 5f8c822a2b4a..7a869138c37f 100644
--- a/arch/sparc64/kernel/sys_sparc.c
+++ b/arch/sparc64/kernel/sys_sparc.c
@@ -25,25 +25,93 @@
25#include <linux/syscalls.h> 25#include <linux/syscalls.h>
26#include <linux/ipc.h> 26#include <linux/ipc.h>
27#include <linux/personality.h> 27#include <linux/personality.h>
28#include <linux/random.h>
28 29
29#include <asm/uaccess.h> 30#include <asm/uaccess.h>
30#include <asm/ipc.h> 31#include <asm/ipc.h>
31#include <asm/utrap.h> 32#include <asm/utrap.h>
32#include <asm/perfctr.h> 33#include <asm/perfctr.h>
34#include <asm/a.out.h>
33 35
34/* #define DEBUG_UNIMP_SYSCALL */ 36/* #define DEBUG_UNIMP_SYSCALL */
35 37
36/* XXX Make this per-binary type, this way we can detect the type of
37 * XXX a binary. Every Sparc executable calls this very early on.
38 */
39asmlinkage unsigned long sys_getpagesize(void) 38asmlinkage unsigned long sys_getpagesize(void)
40{ 39{
41 return PAGE_SIZE; 40 return PAGE_SIZE;
42} 41}
43 42
44#define COLOUR_ALIGN(addr,pgoff) \ 43#define VA_EXCLUDE_START (0x0000080000000000UL - (1UL << 32UL))
45 ((((addr)+SHMLBA-1)&~(SHMLBA-1)) + \ 44#define VA_EXCLUDE_END (0xfffff80000000000UL + (1UL << 32UL))
46 (((pgoff)<<PAGE_SHIFT) & (SHMLBA-1))) 45
46/* Does addr --> addr+len fall within 4GB of the VA-space hole or
47 * overflow past the end of the 64-bit address space?
48 */
49static inline int invalid_64bit_range(unsigned long addr, unsigned long len)
50{
51 unsigned long va_exclude_start, va_exclude_end;
52
53 va_exclude_start = VA_EXCLUDE_START;
54 va_exclude_end = VA_EXCLUDE_END;
55
56 if (unlikely(len >= va_exclude_start))
57 return 1;
58
59 if (unlikely((addr + len) < addr))
60 return 1;
61
62 if (unlikely((addr >= va_exclude_start && addr < va_exclude_end) ||
63 ((addr + len) >= va_exclude_start &&
64 (addr + len) < va_exclude_end)))
65 return 1;
66
67 return 0;
68}
69
70/* Does start,end straddle the VA-space hole? */
71static inline int straddles_64bit_va_hole(unsigned long start, unsigned long end)
72{
73 unsigned long va_exclude_start, va_exclude_end;
74
75 va_exclude_start = VA_EXCLUDE_START;
76 va_exclude_end = VA_EXCLUDE_END;
77
78 if (likely(start < va_exclude_start && end < va_exclude_start))
79 return 0;
80
81 if (likely(start >= va_exclude_end && end >= va_exclude_end))
82 return 0;
83
84 return 1;
85}
86
87/* These functions differ from the default implementations in
88 * mm/mmap.c in two ways:
89 *
90 * 1) For file backed MAP_SHARED mmap()'s we D-cache color align,
91 * for fixed such mappings we just validate what the user gave us.
92 * 2) For 64-bit tasks we avoid mapping anything within 4GB of
93 * the spitfire/niagara VA-hole.
94 */
95
96static inline unsigned long COLOUR_ALIGN(unsigned long addr,
97 unsigned long pgoff)
98{
99 unsigned long base = (addr+SHMLBA-1)&~(SHMLBA-1);
100 unsigned long off = (pgoff<<PAGE_SHIFT) & (SHMLBA-1);
101
102 return base + off;
103}
104
105static inline unsigned long COLOUR_ALIGN_DOWN(unsigned long addr,
106 unsigned long pgoff)
107{
108 unsigned long base = addr & ~(SHMLBA-1);
109 unsigned long off = (pgoff<<PAGE_SHIFT) & (SHMLBA-1);
110
111 if (base + off <= addr)
112 return base + off;
113 return base - off;
114}
47 115
48unsigned long arch_get_unmapped_area(struct file *filp, unsigned long addr, unsigned long len, unsigned long pgoff, unsigned long flags) 116unsigned long arch_get_unmapped_area(struct file *filp, unsigned long addr, unsigned long len, unsigned long pgoff, unsigned long flags)
49{ 117{
@@ -64,8 +132,8 @@ unsigned long arch_get_unmapped_area(struct file *filp, unsigned long addr, unsi
64 } 132 }
65 133
66 if (test_thread_flag(TIF_32BIT)) 134 if (test_thread_flag(TIF_32BIT))
67 task_size = 0xf0000000UL; 135 task_size = STACK_TOP32;
68 if (len > task_size || len > -PAGE_OFFSET) 136 if (unlikely(len > task_size || len >= VA_EXCLUDE_START))
69 return -ENOMEM; 137 return -ENOMEM;
70 138
71 do_color_align = 0; 139 do_color_align = 0;
@@ -84,11 +152,12 @@ unsigned long arch_get_unmapped_area(struct file *filp, unsigned long addr, unsi
84 return addr; 152 return addr;
85 } 153 }
86 154
87 if (len <= mm->cached_hole_size) { 155 if (len > mm->cached_hole_size) {
156 start_addr = addr = mm->free_area_cache;
157 } else {
158 start_addr = addr = TASK_UNMAPPED_BASE;
88 mm->cached_hole_size = 0; 159 mm->cached_hole_size = 0;
89 mm->free_area_cache = TASK_UNMAPPED_BASE;
90 } 160 }
91 start_addr = addr = mm->free_area_cache;
92 161
93 task_size -= len; 162 task_size -= len;
94 163
@@ -100,11 +169,12 @@ full_search:
100 169
101 for (vma = find_vma(mm, addr); ; vma = vma->vm_next) { 170 for (vma = find_vma(mm, addr); ; vma = vma->vm_next) {
102 /* At this point: (!vma || addr < vma->vm_end). */ 171 /* At this point: (!vma || addr < vma->vm_end). */
103 if (addr < PAGE_OFFSET && -PAGE_OFFSET - len < addr) { 172 if (addr < VA_EXCLUDE_START &&
104 addr = PAGE_OFFSET; 173 (addr + len) >= VA_EXCLUDE_START) {
105 vma = find_vma(mm, PAGE_OFFSET); 174 addr = VA_EXCLUDE_END;
175 vma = find_vma(mm, VA_EXCLUDE_END);
106 } 176 }
107 if (task_size < addr) { 177 if (unlikely(task_size < addr)) {
108 if (start_addr != TASK_UNMAPPED_BASE) { 178 if (start_addr != TASK_UNMAPPED_BASE) {
109 start_addr = addr = TASK_UNMAPPED_BASE; 179 start_addr = addr = TASK_UNMAPPED_BASE;
110 mm->cached_hole_size = 0; 180 mm->cached_hole_size = 0;
@@ -112,7 +182,7 @@ full_search:
112 } 182 }
113 return -ENOMEM; 183 return -ENOMEM;
114 } 184 }
115 if (!vma || addr + len <= vma->vm_start) { 185 if (likely(!vma || addr + len <= vma->vm_start)) {
116 /* 186 /*
117 * Remember the place where we stopped the search: 187 * Remember the place where we stopped the search:
118 */ 188 */
@@ -128,6 +198,121 @@ full_search:
128 } 198 }
129} 199}
130 200
201unsigned long
202arch_get_unmapped_area_topdown(struct file *filp, const unsigned long addr0,
203 const unsigned long len, const unsigned long pgoff,
204 const unsigned long flags)
205{
206 struct vm_area_struct *vma;
207 struct mm_struct *mm = current->mm;
208 unsigned long task_size = STACK_TOP32;
209 unsigned long addr = addr0;
210 int do_color_align;
211
212 /* This should only ever run for 32-bit processes. */
213 BUG_ON(!test_thread_flag(TIF_32BIT));
214
215 if (flags & MAP_FIXED) {
216 /* We do not accept a shared mapping if it would violate
217 * cache aliasing constraints.
218 */
219 if ((flags & MAP_SHARED) &&
220 ((addr - (pgoff << PAGE_SHIFT)) & (SHMLBA - 1)))
221 return -EINVAL;
222 return addr;
223 }
224
225 if (unlikely(len > task_size))
226 return -ENOMEM;
227
228 do_color_align = 0;
229 if (filp || (flags & MAP_SHARED))
230 do_color_align = 1;
231
232 /* requesting a specific address */
233 if (addr) {
234 if (do_color_align)
235 addr = COLOUR_ALIGN(addr, pgoff);
236 else
237 addr = PAGE_ALIGN(addr);
238
239 vma = find_vma(mm, addr);
240 if (task_size - len >= addr &&
241 (!vma || addr + len <= vma->vm_start))
242 return addr;
243 }
244
245 /* check if free_area_cache is useful for us */
246 if (len <= mm->cached_hole_size) {
247 mm->cached_hole_size = 0;
248 mm->free_area_cache = mm->mmap_base;
249 }
250
251 /* either no address requested or can't fit in requested address hole */
252 addr = mm->free_area_cache;
253 if (do_color_align) {
254 unsigned long base = COLOUR_ALIGN_DOWN(addr-len, pgoff);
255
256 addr = base + len;
257 }
258
259 /* make sure it can fit in the remaining address space */
260 if (likely(addr > len)) {
261 vma = find_vma(mm, addr-len);
262 if (!vma || addr <= vma->vm_start) {
263 /* remember the address as a hint for next time */
264 return (mm->free_area_cache = addr-len);
265 }
266 }
267
268 if (unlikely(mm->mmap_base < len))
269 goto bottomup;
270
271 addr = mm->mmap_base-len;
272 if (do_color_align)
273 addr = COLOUR_ALIGN_DOWN(addr, pgoff);
274
275 do {
276 /*
277 * Lookup failure means no vma is above this address,
278 * else if new region fits below vma->vm_start,
279 * return with success:
280 */
281 vma = find_vma(mm, addr);
282 if (likely(!vma || addr+len <= vma->vm_start)) {
283 /* remember the address as a hint for next time */
284 return (mm->free_area_cache = addr);
285 }
286
287 /* remember the largest hole we saw so far */
288 if (addr + mm->cached_hole_size < vma->vm_start)
289 mm->cached_hole_size = vma->vm_start - addr;
290
291 /* try just below the current vma->vm_start */
292 addr = vma->vm_start-len;
293 if (do_color_align)
294 addr = COLOUR_ALIGN_DOWN(addr, pgoff);
295 } while (likely(len < vma->vm_start));
296
297bottomup:
298 /*
299 * A failed mmap() very likely causes application failure,
300 * so fall back to the bottom-up function here. This scenario
301 * can happen with large stack limits and large mmap()
302 * allocations.
303 */
304 mm->cached_hole_size = ~0UL;
305 mm->free_area_cache = TASK_UNMAPPED_BASE;
306 addr = arch_get_unmapped_area(filp, addr0, len, pgoff, flags);
307 /*
308 * Restore the topdown base:
309 */
310 mm->free_area_cache = mm->mmap_base;
311 mm->cached_hole_size = ~0UL;
312
313 return addr;
314}
315
131/* Try to align mapping such that we align it as much as possible. */ 316/* Try to align mapping such that we align it as much as possible. */
132unsigned long get_fb_unmapped_area(struct file *filp, unsigned long orig_addr, unsigned long len, unsigned long pgoff, unsigned long flags) 317unsigned long get_fb_unmapped_area(struct file *filp, unsigned long orig_addr, unsigned long len, unsigned long pgoff, unsigned long flags)
133{ 318{
@@ -171,15 +356,57 @@ unsigned long get_fb_unmapped_area(struct file *filp, unsigned long orig_addr, u
171 return addr; 356 return addr;
172} 357}
173 358
359/* Essentially the same as PowerPC... */
360void arch_pick_mmap_layout(struct mm_struct *mm)
361{
362 unsigned long random_factor = 0UL;
363
364 if (current->flags & PF_RANDOMIZE) {
365 random_factor = get_random_int();
366 if (test_thread_flag(TIF_32BIT))
367 random_factor &= ((1 * 1024 * 1024) - 1);
368 else
369 random_factor = ((random_factor << PAGE_SHIFT) &
370 0xffffffffUL);
371 }
372
373 /*
374 * Fall back to the standard layout if the personality
375 * bit is set, or if the expected stack growth is unlimited:
376 */
377 if (!test_thread_flag(TIF_32BIT) ||
378 (current->personality & ADDR_COMPAT_LAYOUT) ||
379 current->signal->rlim[RLIMIT_STACK].rlim_cur == RLIM_INFINITY ||
380 sysctl_legacy_va_layout) {
381 mm->mmap_base = TASK_UNMAPPED_BASE + random_factor;
382 mm->get_unmapped_area = arch_get_unmapped_area;
383 mm->unmap_area = arch_unmap_area;
384 } else {
385 /* We know it's 32-bit */
386 unsigned long task_size = STACK_TOP32;
387 unsigned long gap;
388
389 gap = current->signal->rlim[RLIMIT_STACK].rlim_cur;
390 if (gap < 128 * 1024 * 1024)
391 gap = 128 * 1024 * 1024;
392 if (gap > (task_size / 6 * 5))
393 gap = (task_size / 6 * 5);
394
395 mm->mmap_base = PAGE_ALIGN(task_size - gap - random_factor);
396 mm->get_unmapped_area = arch_get_unmapped_area_topdown;
397 mm->unmap_area = arch_unmap_area_topdown;
398 }
399}
400
174asmlinkage unsigned long sparc_brk(unsigned long brk) 401asmlinkage unsigned long sparc_brk(unsigned long brk)
175{ 402{
176 /* People could try to be nasty and use ta 0x6d in 32bit programs */ 403 /* People could try to be nasty and use ta 0x6d in 32bit programs */
177 if (test_thread_flag(TIF_32BIT) && 404 if (test_thread_flag(TIF_32BIT) && brk >= STACK_TOP32)
178 brk >= 0xf0000000UL)
179 return current->mm->brk; 405 return current->mm->brk;
180 406
181 if ((current->mm->brk & PAGE_OFFSET) != (brk & PAGE_OFFSET)) 407 if (unlikely(straddles_64bit_va_hole(current->mm->brk, brk)))
182 return current->mm->brk; 408 return current->mm->brk;
409
183 return sys_brk(brk); 410 return sys_brk(brk);
184} 411}
185 412
@@ -340,13 +567,16 @@ asmlinkage unsigned long sys_mmap(unsigned long addr, unsigned long len,
340 retval = -EINVAL; 567 retval = -EINVAL;
341 568
342 if (test_thread_flag(TIF_32BIT)) { 569 if (test_thread_flag(TIF_32BIT)) {
343 if (len > 0xf0000000UL || 570 if (len >= STACK_TOP32)
344 ((flags & MAP_FIXED) && addr > 0xf0000000UL - len)) 571 goto out_putf;
572
573 if ((flags & MAP_FIXED) && addr > STACK_TOP32 - len)
345 goto out_putf; 574 goto out_putf;
346 } else { 575 } else {
347 if (len > -PAGE_OFFSET || 576 if (len >= VA_EXCLUDE_START)
348 ((flags & MAP_FIXED) && 577 goto out_putf;
349 addr < PAGE_OFFSET && addr + len > -PAGE_OFFSET)) 578
579 if ((flags & MAP_FIXED) && invalid_64bit_range(addr, len))
350 goto out_putf; 580 goto out_putf;
351 } 581 }
352 582
@@ -365,9 +595,9 @@ asmlinkage long sys64_munmap(unsigned long addr, size_t len)
365{ 595{
366 long ret; 596 long ret;
367 597
368 if (len > -PAGE_OFFSET || 598 if (invalid_64bit_range(addr, len))
369 (addr < PAGE_OFFSET && addr + len > -PAGE_OFFSET))
370 return -EINVAL; 599 return -EINVAL;
600
371 down_write(&current->mm->mmap_sem); 601 down_write(&current->mm->mmap_sem);
372 ret = do_munmap(current->mm, addr, len); 602 ret = do_munmap(current->mm, addr, len);
373 up_write(&current->mm->mmap_sem); 603 up_write(&current->mm->mmap_sem);
@@ -384,18 +614,19 @@ asmlinkage unsigned long sys64_mremap(unsigned long addr,
384{ 614{
385 struct vm_area_struct *vma; 615 struct vm_area_struct *vma;
386 unsigned long ret = -EINVAL; 616 unsigned long ret = -EINVAL;
617
387 if (test_thread_flag(TIF_32BIT)) 618 if (test_thread_flag(TIF_32BIT))
388 goto out; 619 goto out;
389 if (old_len > -PAGE_OFFSET || new_len > -PAGE_OFFSET) 620 if (unlikely(new_len >= VA_EXCLUDE_START))
390 goto out; 621 goto out;
391 if (addr < PAGE_OFFSET && addr + old_len > -PAGE_OFFSET) 622 if (unlikely(invalid_64bit_range(addr, old_len)))
392 goto out; 623 goto out;
624
393 down_write(&current->mm->mmap_sem); 625 down_write(&current->mm->mmap_sem);
394 if (flags & MREMAP_FIXED) { 626 if (flags & MREMAP_FIXED) {
395 if (new_addr < PAGE_OFFSET && 627 if (invalid_64bit_range(new_addr, new_len))
396 new_addr + new_len > -PAGE_OFFSET)
397 goto out_sem; 628 goto out_sem;
398 } else if (addr < PAGE_OFFSET && addr + new_len > -PAGE_OFFSET) { 629 } else if (invalid_64bit_range(addr, new_len)) {
399 unsigned long map_flags = 0; 630 unsigned long map_flags = 0;
400 struct file *file = NULL; 631 struct file *file = NULL;
401 632
@@ -554,12 +785,10 @@ asmlinkage long sys_utrap_install(utrap_entry_t type,
554 } 785 }
555 if (!current_thread_info()->utraps) { 786 if (!current_thread_info()->utraps) {
556 current_thread_info()->utraps = 787 current_thread_info()->utraps =
557 kmalloc((UT_TRAP_INSTRUCTION_31+1)*sizeof(long), GFP_KERNEL); 788 kzalloc((UT_TRAP_INSTRUCTION_31+1)*sizeof(long), GFP_KERNEL);
558 if (!current_thread_info()->utraps) 789 if (!current_thread_info()->utraps)
559 return -ENOMEM; 790 return -ENOMEM;
560 current_thread_info()->utraps[0] = 1; 791 current_thread_info()->utraps[0] = 1;
561 memset(current_thread_info()->utraps+1, 0,
562 UT_TRAP_INSTRUCTION_31*sizeof(long));
563 } else { 792 } else {
564 if ((utrap_handler_t)current_thread_info()->utraps[type] != new_p && 793 if ((utrap_handler_t)current_thread_info()->utraps[type] != new_p &&
565 current_thread_info()->utraps[0] > 1) { 794 current_thread_info()->utraps[0] > 1) {
diff --git a/arch/sparc64/kernel/sys_sparc32.c b/arch/sparc64/kernel/sys_sparc32.c
index 417727bd87ba..2e906bad56fa 100644
--- a/arch/sparc64/kernel/sys_sparc32.c
+++ b/arch/sparc64/kernel/sys_sparc32.c
@@ -19,7 +19,6 @@
19#include <linux/resource.h> 19#include <linux/resource.h>
20#include <linux/times.h> 20#include <linux/times.h>
21#include <linux/utsname.h> 21#include <linux/utsname.h>
22#include <linux/timex.h>
23#include <linux/smp.h> 22#include <linux/smp.h>
24#include <linux/smp_lock.h> 23#include <linux/smp_lock.h>
25#include <linux/sem.h> 24#include <linux/sem.h>
@@ -62,6 +61,7 @@
62#include <asm/fpumacro.h> 61#include <asm/fpumacro.h>
63#include <asm/semaphore.h> 62#include <asm/semaphore.h>
64#include <asm/mmu_context.h> 63#include <asm/mmu_context.h>
64#include <asm/a.out.h>
65 65
66asmlinkage long sys32_chown16(const char __user * filename, u16 user, u16 group) 66asmlinkage long sys32_chown16(const char __user * filename, u16 user, u16 group)
67{ 67{
@@ -944,79 +944,6 @@ asmlinkage long compat_sys_sendfile64(int out_fd, int in_fd,
944 return ret; 944 return ret;
945} 945}
946 946
947/* Handle adjtimex compatibility. */
948
949struct timex32 {
950 u32 modes;
951 s32 offset, freq, maxerror, esterror;
952 s32 status, constant, precision, tolerance;
953 struct compat_timeval time;
954 s32 tick;
955 s32 ppsfreq, jitter, shift, stabil;
956 s32 jitcnt, calcnt, errcnt, stbcnt;
957 s32 :32; s32 :32; s32 :32; s32 :32;
958 s32 :32; s32 :32; s32 :32; s32 :32;
959 s32 :32; s32 :32; s32 :32; s32 :32;
960};
961
962extern int do_adjtimex(struct timex *);
963
964asmlinkage long sys32_adjtimex(struct timex32 __user *utp)
965{
966 struct timex txc;
967 int ret;
968
969 memset(&txc, 0, sizeof(struct timex));
970
971 if (get_user(txc.modes, &utp->modes) ||
972 __get_user(txc.offset, &utp->offset) ||
973 __get_user(txc.freq, &utp->freq) ||
974 __get_user(txc.maxerror, &utp->maxerror) ||
975 __get_user(txc.esterror, &utp->esterror) ||
976 __get_user(txc.status, &utp->status) ||
977 __get_user(txc.constant, &utp->constant) ||
978 __get_user(txc.precision, &utp->precision) ||
979 __get_user(txc.tolerance, &utp->tolerance) ||
980 __get_user(txc.time.tv_sec, &utp->time.tv_sec) ||
981 __get_user(txc.time.tv_usec, &utp->time.tv_usec) ||
982 __get_user(txc.tick, &utp->tick) ||
983 __get_user(txc.ppsfreq, &utp->ppsfreq) ||
984 __get_user(txc.jitter, &utp->jitter) ||
985 __get_user(txc.shift, &utp->shift) ||
986 __get_user(txc.stabil, &utp->stabil) ||
987 __get_user(txc.jitcnt, &utp->jitcnt) ||
988 __get_user(txc.calcnt, &utp->calcnt) ||
989 __get_user(txc.errcnt, &utp->errcnt) ||
990 __get_user(txc.stbcnt, &utp->stbcnt))
991 return -EFAULT;
992
993 ret = do_adjtimex(&txc);
994
995 if (put_user(txc.modes, &utp->modes) ||
996 __put_user(txc.offset, &utp->offset) ||
997 __put_user(txc.freq, &utp->freq) ||
998 __put_user(txc.maxerror, &utp->maxerror) ||
999 __put_user(txc.esterror, &utp->esterror) ||
1000 __put_user(txc.status, &utp->status) ||
1001 __put_user(txc.constant, &utp->constant) ||
1002 __put_user(txc.precision, &utp->precision) ||
1003 __put_user(txc.tolerance, &utp->tolerance) ||
1004 __put_user(txc.time.tv_sec, &utp->time.tv_sec) ||
1005 __put_user(txc.time.tv_usec, &utp->time.tv_usec) ||
1006 __put_user(txc.tick, &utp->tick) ||
1007 __put_user(txc.ppsfreq, &utp->ppsfreq) ||
1008 __put_user(txc.jitter, &utp->jitter) ||
1009 __put_user(txc.shift, &utp->shift) ||
1010 __put_user(txc.stabil, &utp->stabil) ||
1011 __put_user(txc.jitcnt, &utp->jitcnt) ||
1012 __put_user(txc.calcnt, &utp->calcnt) ||
1013 __put_user(txc.errcnt, &utp->errcnt) ||
1014 __put_user(txc.stbcnt, &utp->stbcnt))
1015 ret = -EFAULT;
1016
1017 return ret;
1018}
1019
1020/* This is just a version for 32-bit applications which does 947/* This is just a version for 32-bit applications which does
1021 * not force O_LARGEFILE on. 948 * not force O_LARGEFILE on.
1022 */ 949 */
@@ -1039,15 +966,15 @@ asmlinkage unsigned long sys32_mremap(unsigned long addr,
1039 unsigned long ret = -EINVAL; 966 unsigned long ret = -EINVAL;
1040 unsigned long new_addr = __new_addr; 967 unsigned long new_addr = __new_addr;
1041 968
1042 if (old_len > 0xf0000000UL || new_len > 0xf0000000UL) 969 if (old_len > STACK_TOP32 || new_len > STACK_TOP32)
1043 goto out; 970 goto out;
1044 if (addr > 0xf0000000UL - old_len) 971 if (addr > STACK_TOP32 - old_len)
1045 goto out; 972 goto out;
1046 down_write(&current->mm->mmap_sem); 973 down_write(&current->mm->mmap_sem);
1047 if (flags & MREMAP_FIXED) { 974 if (flags & MREMAP_FIXED) {
1048 if (new_addr > 0xf0000000UL - new_len) 975 if (new_addr > STACK_TOP32 - new_len)
1049 goto out_sem; 976 goto out_sem;
1050 } else if (addr > 0xf0000000UL - new_len) { 977 } else if (addr > STACK_TOP32 - new_len) {
1051 unsigned long map_flags = 0; 978 unsigned long map_flags = 0;
1052 struct file *file = NULL; 979 struct file *file = NULL;
1053 980
diff --git a/arch/sparc64/kernel/systbls.S b/arch/sparc64/kernel/systbls.S
index c3adb7ac167d..3b250f2318fd 100644
--- a/arch/sparc64/kernel/systbls.S
+++ b/arch/sparc64/kernel/systbls.S
@@ -63,7 +63,7 @@ sys_call_table32:
63/*200*/ .word sys32_ssetmask, sys_sigsuspend, compat_sys_newlstat, sys_uselib, compat_sys_old_readdir 63/*200*/ .word sys32_ssetmask, sys_sigsuspend, compat_sys_newlstat, sys_uselib, compat_sys_old_readdir
64 .word sys32_readahead, sys32_socketcall, sys32_syslog, sys32_lookup_dcookie, sys32_fadvise64 64 .word sys32_readahead, sys32_socketcall, sys32_syslog, sys32_lookup_dcookie, sys32_fadvise64
65/*210*/ .word sys32_fadvise64_64, sys32_tgkill, sys32_waitpid, sys_swapoff, sys32_sysinfo 65/*210*/ .word sys32_fadvise64_64, sys32_tgkill, sys32_waitpid, sys_swapoff, sys32_sysinfo
66 .word sys32_ipc, sys32_sigreturn, sys_clone, sys32_ioprio_get, sys32_adjtimex 66 .word sys32_ipc, sys32_sigreturn, sys_clone, sys32_ioprio_get, compat_sys_adjtimex
67/*220*/ .word sys32_sigprocmask, sys_ni_syscall, sys32_delete_module, sys_ni_syscall, sys32_getpgid 67/*220*/ .word sys32_sigprocmask, sys_ni_syscall, sys32_delete_module, sys_ni_syscall, sys32_getpgid
68 .word sys32_bdflush, sys32_sysfs, sys_nis_syscall, sys32_setfsuid16, sys32_setfsgid16 68 .word sys32_bdflush, sys32_sysfs, sys_nis_syscall, sys32_setfsuid16, sys32_setfsgid16
69/*230*/ .word sys32_select, compat_sys_time, sys_nis_syscall, compat_sys_stime, compat_sys_statfs64 69/*230*/ .word sys32_select, compat_sys_time, sys_nis_syscall, compat_sys_stime, compat_sys_statfs64
diff --git a/arch/sparc64/kernel/time.c b/arch/sparc64/kernel/time.c
index a22930d62adf..e55b5c6ece02 100644
--- a/arch/sparc64/kernel/time.c
+++ b/arch/sparc64/kernel/time.c
@@ -30,6 +30,8 @@
30#include <linux/cpufreq.h> 30#include <linux/cpufreq.h>
31#include <linux/percpu.h> 31#include <linux/percpu.h>
32#include <linux/profile.h> 32#include <linux/profile.h>
33#include <linux/miscdevice.h>
34#include <linux/rtc.h>
33 35
34#include <asm/oplib.h> 36#include <asm/oplib.h>
35#include <asm/mostek.h> 37#include <asm/mostek.h>
@@ -45,6 +47,7 @@
45#include <asm/smp.h> 47#include <asm/smp.h>
46#include <asm/sections.h> 48#include <asm/sections.h>
47#include <asm/cpudata.h> 49#include <asm/cpudata.h>
50#include <asm/uaccess.h>
48 51
49DEFINE_SPINLOCK(mostek_lock); 52DEFINE_SPINLOCK(mostek_lock);
50DEFINE_SPINLOCK(rtc_lock); 53DEFINE_SPINLOCK(rtc_lock);
@@ -193,16 +196,22 @@ struct sparc64_tick_ops *tick_ops __read_mostly = &tick_operations;
193 196
194static void stick_init_tick(unsigned long offset) 197static void stick_init_tick(unsigned long offset)
195{ 198{
196 tick_disable_protection(); 199 /* Writes to the %tick and %stick register are not
197 200 * allowed on sun4v. The Hypervisor controls that
198 /* Let the user get at STICK too. */ 201 * bit, per-strand.
199 __asm__ __volatile__( 202 */
200 " rd %%asr24, %%g2\n" 203 if (tlb_type != hypervisor) {
201 " andn %%g2, %0, %%g2\n" 204 tick_disable_protection();
202 " wr %%g2, 0, %%asr24" 205
203 : /* no outputs */ 206 /* Let the user get at STICK too. */
204 : "r" (TICK_PRIV_BIT) 207 __asm__ __volatile__(
205 : "g1", "g2"); 208 " rd %%asr24, %%g2\n"
209 " andn %%g2, %0, %%g2\n"
210 " wr %%g2, 0, %%asr24"
211 : /* no outputs */
212 : "r" (TICK_PRIV_BIT)
213 : "g1", "g2");
214 }
206 215
207 __asm__ __volatile__( 216 __asm__ __volatile__(
208 " rd %%asr24, %%g1\n" 217 " rd %%asr24, %%g1\n"
@@ -632,23 +641,8 @@ static void __init set_system_time(void)
632 mon = MSTK_REG_MONTH(mregs); 641 mon = MSTK_REG_MONTH(mregs);
633 year = MSTK_CVT_YEAR( MSTK_REG_YEAR(mregs) ); 642 year = MSTK_CVT_YEAR( MSTK_REG_YEAR(mregs) );
634 } else { 643 } else {
635 int i;
636
637 /* Dallas 12887 RTC chip. */ 644 /* Dallas 12887 RTC chip. */
638 645
639 /* Stolen from arch/i386/kernel/time.c, see there for
640 * credits and descriptive comments.
641 */
642 for (i = 0; i < 1000000; i++) {
643 if (CMOS_READ(RTC_FREQ_SELECT) & RTC_UIP)
644 break;
645 udelay(10);
646 }
647 for (i = 0; i < 1000000; i++) {
648 if (!(CMOS_READ(RTC_FREQ_SELECT) & RTC_UIP))
649 break;
650 udelay(10);
651 }
652 do { 646 do {
653 sec = CMOS_READ(RTC_SECONDS); 647 sec = CMOS_READ(RTC_SECONDS);
654 min = CMOS_READ(RTC_MINUTES); 648 min = CMOS_READ(RTC_MINUTES);
@@ -657,6 +651,7 @@ static void __init set_system_time(void)
657 mon = CMOS_READ(RTC_MONTH); 651 mon = CMOS_READ(RTC_MONTH);
658 year = CMOS_READ(RTC_YEAR); 652 year = CMOS_READ(RTC_YEAR);
659 } while (sec != CMOS_READ(RTC_SECONDS)); 653 } while (sec != CMOS_READ(RTC_SECONDS));
654
660 if (!(CMOS_READ(RTC_CONTROL) & RTC_DM_BINARY) || RTC_ALWAYS_BCD) { 655 if (!(CMOS_READ(RTC_CONTROL) & RTC_DM_BINARY) || RTC_ALWAYS_BCD) {
661 BCD_TO_BIN(sec); 656 BCD_TO_BIN(sec);
662 BCD_TO_BIN(min); 657 BCD_TO_BIN(min);
@@ -683,6 +678,83 @@ static void __init set_system_time(void)
683 } 678 }
684} 679}
685 680
681/* davem suggests we keep this within the 4M locked kernel image */
682static u32 starfire_get_time(void)
683{
684 static char obp_gettod[32];
685 static u32 unix_tod;
686
687 sprintf(obp_gettod, "h# %08x unix-gettod",
688 (unsigned int) (long) &unix_tod);
689 prom_feval(obp_gettod);
690
691 return unix_tod;
692}
693
694static int starfire_set_time(u32 val)
695{
696 /* Do nothing, time is set using the service processor
697 * console on this platform.
698 */
699 return 0;
700}
701
702static u32 hypervisor_get_time(void)
703{
704 register unsigned long func asm("%o5");
705 register unsigned long arg0 asm("%o0");
706 register unsigned long arg1 asm("%o1");
707 int retries = 10000;
708
709retry:
710 func = HV_FAST_TOD_GET;
711 arg0 = 0;
712 arg1 = 0;
713 __asm__ __volatile__("ta %6"
714 : "=&r" (func), "=&r" (arg0), "=&r" (arg1)
715 : "0" (func), "1" (arg0), "2" (arg1),
716 "i" (HV_FAST_TRAP));
717 if (arg0 == HV_EOK)
718 return arg1;
719 if (arg0 == HV_EWOULDBLOCK) {
720 if (--retries > 0) {
721 udelay(100);
722 goto retry;
723 }
724 printk(KERN_WARNING "SUN4V: tod_get() timed out.\n");
725 return 0;
726 }
727 printk(KERN_WARNING "SUN4V: tod_get() not supported.\n");
728 return 0;
729}
730
731static int hypervisor_set_time(u32 secs)
732{
733 register unsigned long func asm("%o5");
734 register unsigned long arg0 asm("%o0");
735 int retries = 10000;
736
737retry:
738 func = HV_FAST_TOD_SET;
739 arg0 = secs;
740 __asm__ __volatile__("ta %4"
741 : "=&r" (func), "=&r" (arg0)
742 : "0" (func), "1" (arg0),
743 "i" (HV_FAST_TRAP));
744 if (arg0 == HV_EOK)
745 return 0;
746 if (arg0 == HV_EWOULDBLOCK) {
747 if (--retries > 0) {
748 udelay(100);
749 goto retry;
750 }
751 printk(KERN_WARNING "SUN4V: tod_set() timed out.\n");
752 return -EAGAIN;
753 }
754 printk(KERN_WARNING "SUN4V: tod_set() not supported.\n");
755 return -EOPNOTSUPP;
756}
757
686void __init clock_probe(void) 758void __init clock_probe(void)
687{ 759{
688 struct linux_prom_registers clk_reg[2]; 760 struct linux_prom_registers clk_reg[2];
@@ -702,14 +774,14 @@ void __init clock_probe(void)
702 774
703 775
704 if (this_is_starfire) { 776 if (this_is_starfire) {
705 /* davem suggests we keep this within the 4M locked kernel image */ 777 xtime.tv_sec = starfire_get_time();
706 static char obp_gettod[256]; 778 xtime.tv_nsec = (INITIAL_JIFFIES % HZ) * (NSEC_PER_SEC / HZ);
707 static u32 unix_tod; 779 set_normalized_timespec(&wall_to_monotonic,
708 780 -xtime.tv_sec, -xtime.tv_nsec);
709 sprintf(obp_gettod, "h# %08x unix-gettod", 781 return;
710 (unsigned int) (long) &unix_tod); 782 }
711 prom_feval(obp_gettod); 783 if (tlb_type == hypervisor) {
712 xtime.tv_sec = unix_tod; 784 xtime.tv_sec = hypervisor_get_time();
713 xtime.tv_nsec = (INITIAL_JIFFIES % HZ) * (NSEC_PER_SEC / HZ); 785 xtime.tv_nsec = (INITIAL_JIFFIES % HZ) * (NSEC_PER_SEC / HZ);
714 set_normalized_timespec(&wall_to_monotonic, 786 set_normalized_timespec(&wall_to_monotonic,
715 -xtime.tv_sec, -xtime.tv_nsec); 787 -xtime.tv_sec, -xtime.tv_nsec);
@@ -981,11 +1053,10 @@ static void sparc64_start_timers(irqreturn_t (*cfunc)(int, void *, struct pt_reg
981} 1053}
982 1054
983struct freq_table { 1055struct freq_table {
984 unsigned long udelay_val_ref;
985 unsigned long clock_tick_ref; 1056 unsigned long clock_tick_ref;
986 unsigned int ref_freq; 1057 unsigned int ref_freq;
987}; 1058};
988static DEFINE_PER_CPU(struct freq_table, sparc64_freq_table) = { 0, 0, 0 }; 1059static DEFINE_PER_CPU(struct freq_table, sparc64_freq_table) = { 0, 0 };
989 1060
990unsigned long sparc64_get_clock_tick(unsigned int cpu) 1061unsigned long sparc64_get_clock_tick(unsigned int cpu)
991{ 1062{
@@ -1007,16 +1078,11 @@ static int sparc64_cpufreq_notifier(struct notifier_block *nb, unsigned long val
1007 1078
1008 if (!ft->ref_freq) { 1079 if (!ft->ref_freq) {
1009 ft->ref_freq = freq->old; 1080 ft->ref_freq = freq->old;
1010 ft->udelay_val_ref = cpu_data(cpu).udelay_val;
1011 ft->clock_tick_ref = cpu_data(cpu).clock_tick; 1081 ft->clock_tick_ref = cpu_data(cpu).clock_tick;
1012 } 1082 }
1013 if ((val == CPUFREQ_PRECHANGE && freq->old < freq->new) || 1083 if ((val == CPUFREQ_PRECHANGE && freq->old < freq->new) ||
1014 (val == CPUFREQ_POSTCHANGE && freq->old > freq->new) || 1084 (val == CPUFREQ_POSTCHANGE && freq->old > freq->new) ||
1015 (val == CPUFREQ_RESUMECHANGE)) { 1085 (val == CPUFREQ_RESUMECHANGE)) {
1016 cpu_data(cpu).udelay_val =
1017 cpufreq_scale(ft->udelay_val_ref,
1018 ft->ref_freq,
1019 freq->new);
1020 cpu_data(cpu).clock_tick = 1086 cpu_data(cpu).clock_tick =
1021 cpufreq_scale(ft->clock_tick_ref, 1087 cpufreq_scale(ft->clock_tick_ref,
1022 ft->ref_freq, 1088 ft->ref_freq,
@@ -1179,3 +1245,246 @@ static int set_rtc_mmss(unsigned long nowtime)
1179 return retval; 1245 return retval;
1180 } 1246 }
1181} 1247}
1248
1249#define RTC_IS_OPEN 0x01 /* means /dev/rtc is in use */
1250static unsigned char mini_rtc_status; /* bitmapped status byte. */
1251
1252/* months start at 0 now */
1253static unsigned char days_in_mo[] =
1254{31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
1255
1256#define FEBRUARY 2
1257#define STARTOFTIME 1970
1258#define SECDAY 86400L
1259#define SECYR (SECDAY * 365)
1260#define leapyear(year) ((year) % 4 == 0 && \
1261 ((year) % 100 != 0 || (year) % 400 == 0))
1262#define days_in_year(a) (leapyear(a) ? 366 : 365)
1263#define days_in_month(a) (month_days[(a) - 1])
1264
1265static int month_days[12] = {
1266 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31
1267};
1268
1269/*
1270 * This only works for the Gregorian calendar - i.e. after 1752 (in the UK)
1271 */
1272static void GregorianDay(struct rtc_time * tm)
1273{
1274 int leapsToDate;
1275 int lastYear;
1276 int day;
1277 int MonthOffset[] = { 0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334 };
1278
1279 lastYear = tm->tm_year - 1;
1280
1281 /*
1282 * Number of leap corrections to apply up to end of last year
1283 */
1284 leapsToDate = lastYear / 4 - lastYear / 100 + lastYear / 400;
1285
1286 /*
1287 * This year is a leap year if it is divisible by 4 except when it is
1288 * divisible by 100 unless it is divisible by 400
1289 *
1290 * e.g. 1904 was a leap year, 1900 was not, 1996 is, and 2000 was
1291 */
1292 day = tm->tm_mon > 2 && leapyear(tm->tm_year);
1293
1294 day += lastYear*365 + leapsToDate + MonthOffset[tm->tm_mon-1] +
1295 tm->tm_mday;
1296
1297 tm->tm_wday = day % 7;
1298}
1299
1300static void to_tm(int tim, struct rtc_time *tm)
1301{
1302 register int i;
1303 register long hms, day;
1304
1305 day = tim / SECDAY;
1306 hms = tim % SECDAY;
1307
1308 /* Hours, minutes, seconds are easy */
1309 tm->tm_hour = hms / 3600;
1310 tm->tm_min = (hms % 3600) / 60;
1311 tm->tm_sec = (hms % 3600) % 60;
1312
1313 /* Number of years in days */
1314 for (i = STARTOFTIME; day >= days_in_year(i); i++)
1315 day -= days_in_year(i);
1316 tm->tm_year = i;
1317
1318 /* Number of months in days left */
1319 if (leapyear(tm->tm_year))
1320 days_in_month(FEBRUARY) = 29;
1321 for (i = 1; day >= days_in_month(i); i++)
1322 day -= days_in_month(i);
1323 days_in_month(FEBRUARY) = 28;
1324 tm->tm_mon = i;
1325
1326 /* Days are what is left over (+1) from all that. */
1327 tm->tm_mday = day + 1;
1328
1329 /*
1330 * Determine the day of week
1331 */
1332 GregorianDay(tm);
1333}
1334
1335/* Both Starfire and SUN4V give us seconds since Jan 1st, 1970,
1336 * aka Unix time. So we have to convert to/from rtc_time.
1337 */
1338static inline void mini_get_rtc_time(struct rtc_time *time)
1339{
1340 unsigned long flags;
1341 u32 seconds;
1342
1343 spin_lock_irqsave(&rtc_lock, flags);
1344 seconds = 0;
1345 if (this_is_starfire)
1346 seconds = starfire_get_time();
1347 else if (tlb_type == hypervisor)
1348 seconds = hypervisor_get_time();
1349 spin_unlock_irqrestore(&rtc_lock, flags);
1350
1351 to_tm(seconds, time);
1352 time->tm_year -= 1900;
1353 time->tm_mon -= 1;
1354}
1355
1356static inline int mini_set_rtc_time(struct rtc_time *time)
1357{
1358 u32 seconds = mktime(time->tm_year + 1900, time->tm_mon + 1,
1359 time->tm_mday, time->tm_hour,
1360 time->tm_min, time->tm_sec);
1361 unsigned long flags;
1362 int err;
1363
1364 spin_lock_irqsave(&rtc_lock, flags);
1365 err = -ENODEV;
1366 if (this_is_starfire)
1367 err = starfire_set_time(seconds);
1368 else if (tlb_type == hypervisor)
1369 err = hypervisor_set_time(seconds);
1370 spin_unlock_irqrestore(&rtc_lock, flags);
1371
1372 return err;
1373}
1374
1375static int mini_rtc_ioctl(struct inode *inode, struct file *file,
1376 unsigned int cmd, unsigned long arg)
1377{
1378 struct rtc_time wtime;
1379 void __user *argp = (void __user *)arg;
1380
1381 switch (cmd) {
1382
1383 case RTC_PLL_GET:
1384 return -EINVAL;
1385
1386 case RTC_PLL_SET:
1387 return -EINVAL;
1388
1389 case RTC_UIE_OFF: /* disable ints from RTC updates. */
1390 return 0;
1391
1392 case RTC_UIE_ON: /* enable ints for RTC updates. */
1393 return -EINVAL;
1394
1395 case RTC_RD_TIME: /* Read the time/date from RTC */
1396 /* this doesn't get week-day, who cares */
1397 memset(&wtime, 0, sizeof(wtime));
1398 mini_get_rtc_time(&wtime);
1399
1400 return copy_to_user(argp, &wtime, sizeof(wtime)) ? -EFAULT : 0;
1401
1402 case RTC_SET_TIME: /* Set the RTC */
1403 {
1404 int year;
1405 unsigned char leap_yr;
1406
1407 if (!capable(CAP_SYS_TIME))
1408 return -EACCES;
1409
1410 if (copy_from_user(&wtime, argp, sizeof(wtime)))
1411 return -EFAULT;
1412
1413 year = wtime.tm_year + 1900;
1414 leap_yr = ((!(year % 4) && (year % 100)) ||
1415 !(year % 400));
1416
1417 if ((wtime.tm_mon < 0 || wtime.tm_mon > 11) || (wtime.tm_mday < 1))
1418 return -EINVAL;
1419
1420 if (wtime.tm_mday < 0 || wtime.tm_mday >
1421 (days_in_mo[wtime.tm_mon] + ((wtime.tm_mon == 1) && leap_yr)))
1422 return -EINVAL;
1423
1424 if (wtime.tm_hour < 0 || wtime.tm_hour >= 24 ||
1425 wtime.tm_min < 0 || wtime.tm_min >= 60 ||
1426 wtime.tm_sec < 0 || wtime.tm_sec >= 60)
1427 return -EINVAL;
1428
1429 return mini_set_rtc_time(&wtime);
1430 }
1431 }
1432
1433 return -EINVAL;
1434}
1435
1436static int mini_rtc_open(struct inode *inode, struct file *file)
1437{
1438 if (mini_rtc_status & RTC_IS_OPEN)
1439 return -EBUSY;
1440
1441 mini_rtc_status |= RTC_IS_OPEN;
1442
1443 return 0;
1444}
1445
1446static int mini_rtc_release(struct inode *inode, struct file *file)
1447{
1448 mini_rtc_status &= ~RTC_IS_OPEN;
1449 return 0;
1450}
1451
1452
1453static struct file_operations mini_rtc_fops = {
1454 .owner = THIS_MODULE,
1455 .ioctl = mini_rtc_ioctl,
1456 .open = mini_rtc_open,
1457 .release = mini_rtc_release,
1458};
1459
1460static struct miscdevice rtc_mini_dev =
1461{
1462 .minor = RTC_MINOR,
1463 .name = "rtc",
1464 .fops = &mini_rtc_fops,
1465};
1466
1467static int __init rtc_mini_init(void)
1468{
1469 int retval;
1470
1471 if (tlb_type != hypervisor && !this_is_starfire)
1472 return -ENODEV;
1473
1474 printk(KERN_INFO "Mini RTC Driver\n");
1475
1476 retval = misc_register(&rtc_mini_dev);
1477 if (retval < 0)
1478 return retval;
1479
1480 return 0;
1481}
1482
1483static void __exit rtc_mini_exit(void)
1484{
1485 misc_deregister(&rtc_mini_dev);
1486}
1487
1488
1489module_init(rtc_mini_init);
1490module_exit(rtc_mini_exit);
diff --git a/arch/sparc64/kernel/trampoline.S b/arch/sparc64/kernel/trampoline.S
index 9478551cb020..a4dc01a3d238 100644
--- a/arch/sparc64/kernel/trampoline.S
+++ b/arch/sparc64/kernel/trampoline.S
@@ -16,6 +16,8 @@
16#include <asm/processor.h> 16#include <asm/processor.h>
17#include <asm/thread_info.h> 17#include <asm/thread_info.h>
18#include <asm/mmu.h> 18#include <asm/mmu.h>
19#include <asm/hypervisor.h>
20#include <asm/cpudata.h>
19 21
20 .data 22 .data
21 .align 8 23 .align 8
@@ -28,14 +30,19 @@ itlb_load:
28dtlb_load: 30dtlb_load:
29 .asciz "SUNW,dtlb-load" 31 .asciz "SUNW,dtlb-load"
30 32
33 /* XXX __cpuinit this thing XXX */
34#define TRAMP_STACK_SIZE 1024
35 .align 16
36tramp_stack:
37 .skip TRAMP_STACK_SIZE
38
31 .text 39 .text
32 .align 8 40 .align 8
33 .globl sparc64_cpu_startup, sparc64_cpu_startup_end 41 .globl sparc64_cpu_startup, sparc64_cpu_startup_end
34sparc64_cpu_startup: 42sparc64_cpu_startup:
35 flushw 43 BRANCH_IF_SUN4V(g1, niagara_startup)
36 44 BRANCH_IF_CHEETAH_BASE(g1, g5, cheetah_startup)
37 BRANCH_IF_CHEETAH_BASE(g1,g5,cheetah_startup) 45 BRANCH_IF_CHEETAH_PLUS_OR_FOLLOWON(g1, g5, cheetah_plus_startup)
38 BRANCH_IF_CHEETAH_PLUS_OR_FOLLOWON(g1,g5,cheetah_plus_startup)
39 46
40 ba,pt %xcc, spitfire_startup 47 ba,pt %xcc, spitfire_startup
41 nop 48 nop
@@ -55,6 +62,7 @@ cheetah_startup:
55 or %g5, DCU_DM | DCU_IM | DCU_DC | DCU_IC, %g5 62 or %g5, DCU_DM | DCU_IM | DCU_DC | DCU_IC, %g5
56 stxa %g5, [%g0] ASI_DCU_CONTROL_REG 63 stxa %g5, [%g0] ASI_DCU_CONTROL_REG
57 membar #Sync 64 membar #Sync
65 /* fallthru */
58 66
59cheetah_generic_startup: 67cheetah_generic_startup:
60 mov TSB_EXTENSION_P, %g3 68 mov TSB_EXTENSION_P, %g3
@@ -70,7 +78,9 @@ cheetah_generic_startup:
70 stxa %g0, [%g3] ASI_DMMU 78 stxa %g0, [%g3] ASI_DMMU
71 stxa %g0, [%g3] ASI_IMMU 79 stxa %g0, [%g3] ASI_IMMU
72 membar #Sync 80 membar #Sync
81 /* fallthru */
73 82
83niagara_startup:
74 /* Disable STICK_INT interrupts. */ 84 /* Disable STICK_INT interrupts. */
75 sethi %hi(0x80000000), %g5 85 sethi %hi(0x80000000), %g5
76 sllx %g5, 32, %g5 86 sllx %g5, 32, %g5
@@ -85,17 +95,17 @@ spitfire_startup:
85 membar #Sync 95 membar #Sync
86 96
87startup_continue: 97startup_continue:
88 wrpr %g0, 15, %pil
89
90 sethi %hi(0x80000000), %g2 98 sethi %hi(0x80000000), %g2
91 sllx %g2, 32, %g2 99 sllx %g2, 32, %g2
92 wr %g2, 0, %tick_cmpr 100 wr %g2, 0, %tick_cmpr
93 101
102 mov %o0, %l0
103
104 BRANCH_IF_SUN4V(g1, niagara_lock_tlb)
105
94 /* Call OBP by hand to lock KERNBASE into i/d tlbs. 106 /* Call OBP by hand to lock KERNBASE into i/d tlbs.
95 * We lock 2 consequetive entries if we are 'bigkernel'. 107 * We lock 2 consequetive entries if we are 'bigkernel'.
96 */ 108 */
97 mov %o0, %l0
98
99 sethi %hi(prom_entry_lock), %g2 109 sethi %hi(prom_entry_lock), %g2
1001: ldstub [%g2 + %lo(prom_entry_lock)], %g1 1101: ldstub [%g2 + %lo(prom_entry_lock)], %g1
101 membar #StoreLoad | #StoreStore 111 membar #StoreLoad | #StoreStore
@@ -105,7 +115,6 @@ startup_continue:
105 sethi %hi(p1275buf), %g2 115 sethi %hi(p1275buf), %g2
106 or %g2, %lo(p1275buf), %g2 116 or %g2, %lo(p1275buf), %g2
107 ldx [%g2 + 0x10], %l2 117 ldx [%g2 + 0x10], %l2
108 mov %sp, %l1
109 add %l2, -(192 + 128), %sp 118 add %l2, -(192 + 128), %sp
110 flushw 119 flushw
111 120
@@ -142,8 +151,7 @@ startup_continue:
142 151
143 sethi %hi(bigkernel), %g2 152 sethi %hi(bigkernel), %g2
144 lduw [%g2 + %lo(bigkernel)], %g2 153 lduw [%g2 + %lo(bigkernel)], %g2
145 cmp %g2, 0 154 brz,pt %g2, do_dtlb
146 be,pt %icc, do_dtlb
147 nop 155 nop
148 156
149 sethi %hi(call_method), %g2 157 sethi %hi(call_method), %g2
@@ -214,8 +222,7 @@ do_dtlb:
214 222
215 sethi %hi(bigkernel), %g2 223 sethi %hi(bigkernel), %g2
216 lduw [%g2 + %lo(bigkernel)], %g2 224 lduw [%g2 + %lo(bigkernel)], %g2
217 cmp %g2, 0 225 brz,pt %g2, do_unlock
218 be,pt %icc, do_unlock
219 nop 226 nop
220 227
221 sethi %hi(call_method), %g2 228 sethi %hi(call_method), %g2
@@ -257,99 +264,180 @@ do_unlock:
257 stb %g0, [%g2 + %lo(prom_entry_lock)] 264 stb %g0, [%g2 + %lo(prom_entry_lock)]
258 membar #StoreStore | #StoreLoad 265 membar #StoreStore | #StoreLoad
259 266
260 mov %l1, %sp 267 ba,pt %xcc, after_lock_tlb
261 flushw 268 nop
269
270niagara_lock_tlb:
271 mov HV_FAST_MMU_MAP_PERM_ADDR, %o5
272 sethi %hi(KERNBASE), %o0
273 clr %o1
274 sethi %hi(kern_locked_tte_data), %o2
275 ldx [%o2 + %lo(kern_locked_tte_data)], %o2
276 mov HV_MMU_IMMU, %o3
277 ta HV_FAST_TRAP
278
279 mov HV_FAST_MMU_MAP_PERM_ADDR, %o5
280 sethi %hi(KERNBASE), %o0
281 clr %o1
282 sethi %hi(kern_locked_tte_data), %o2
283 ldx [%o2 + %lo(kern_locked_tte_data)], %o2
284 mov HV_MMU_DMMU, %o3
285 ta HV_FAST_TRAP
262 286
263 mov %l0, %o0 287 sethi %hi(bigkernel), %g2
288 lduw [%g2 + %lo(bigkernel)], %g2
289 brz,pt %g2, after_lock_tlb
290 nop
264 291
292 mov HV_FAST_MMU_MAP_PERM_ADDR, %o5
293 sethi %hi(KERNBASE + 0x400000), %o0
294 clr %o1
295 sethi %hi(kern_locked_tte_data), %o2
296 ldx [%o2 + %lo(kern_locked_tte_data)], %o2
297 sethi %hi(0x400000), %o3
298 add %o2, %o3, %o2
299 mov HV_MMU_IMMU, %o3
300 ta HV_FAST_TRAP
301
302 mov HV_FAST_MMU_MAP_PERM_ADDR, %o5
303 sethi %hi(KERNBASE + 0x400000), %o0
304 clr %o1
305 sethi %hi(kern_locked_tte_data), %o2
306 ldx [%o2 + %lo(kern_locked_tte_data)], %o2
307 sethi %hi(0x400000), %o3
308 add %o2, %o3, %o2
309 mov HV_MMU_DMMU, %o3
310 ta HV_FAST_TRAP
311
312after_lock_tlb:
265 wrpr %g0, (PSTATE_PRIV | PSTATE_PEF), %pstate 313 wrpr %g0, (PSTATE_PRIV | PSTATE_PEF), %pstate
266 wr %g0, 0, %fprs 314 wr %g0, 0, %fprs
267 315
268 /* XXX Buggy PROM... */
269 srl %o0, 0, %o0
270 ldx [%o0], %g6
271
272 wr %g0, ASI_P, %asi 316 wr %g0, ASI_P, %asi
273 317
274 mov PRIMARY_CONTEXT, %g7 318 mov PRIMARY_CONTEXT, %g7
275 stxa %g0, [%g7] ASI_DMMU 319
320661: stxa %g0, [%g7] ASI_DMMU
321 .section .sun4v_1insn_patch, "ax"
322 .word 661b
323 stxa %g0, [%g7] ASI_MMU
324 .previous
325
276 membar #Sync 326 membar #Sync
277 mov SECONDARY_CONTEXT, %g7 327 mov SECONDARY_CONTEXT, %g7
278 stxa %g0, [%g7] ASI_DMMU 328
329661: stxa %g0, [%g7] ASI_DMMU
330 .section .sun4v_1insn_patch, "ax"
331 .word 661b
332 stxa %g0, [%g7] ASI_MMU
333 .previous
334
279 membar #Sync 335 membar #Sync
280 336
281 mov 1, %g5 337 /* Everything we do here, until we properly take over the
282 sllx %g5, THREAD_SHIFT, %g5 338 * trap table, must be done with extreme care. We cannot
283 sub %g5, (STACKFRAME_SZ + STACK_BIAS), %g5 339 * make any references to %g6 (current thread pointer),
284 add %g6, %g5, %sp 340 * %g4 (current task pointer), or %g5 (base of current cpu's
341 * per-cpu area) until we properly take over the trap table
342 * from the firmware and hypervisor.
343 *
344 * Get onto temporary stack which is in the locked kernel image.
345 */
346 sethi %hi(tramp_stack), %g1
347 or %g1, %lo(tramp_stack), %g1
348 add %g1, TRAMP_STACK_SIZE, %g1
349 sub %g1, STACKFRAME_SZ + STACK_BIAS, %sp
285 mov 0, %fp 350 mov 0, %fp
286 351
287 wrpr %g0, 0, %wstate 352 /* Put garbage in these registers to trap any access to them. */
288 wrpr %g0, 0, %tl 353 set 0xdeadbeef, %g4
354 set 0xdeadbeef, %g5
355 set 0xdeadbeef, %g6
289 356
290 /* Setup the trap globals, then we can resurface. */ 357 call init_irqwork_curcpu
291 rdpr %pstate, %o1 358 nop
292 mov %g6, %o2
293 wrpr %o1, PSTATE_AG, %pstate
294 sethi %hi(sparc64_ttable_tl0), %g5
295 wrpr %g5, %tba
296 mov %o2, %g6
297
298 wrpr %o1, PSTATE_MG, %pstate
299#define KERN_HIGHBITS ((_PAGE_VALID|_PAGE_SZ4MB)^0xfffff80000000000)
300#define KERN_LOWBITS (_PAGE_CP | _PAGE_CV | _PAGE_P | _PAGE_W)
301
302 mov TSB_REG, %g1
303 stxa %g0, [%g1] ASI_DMMU
304 membar #Sync
305 mov TLB_SFSR, %g1
306 sethi %uhi(KERN_HIGHBITS), %g2
307 or %g2, %ulo(KERN_HIGHBITS), %g2
308 sllx %g2, 32, %g2
309 or %g2, KERN_LOWBITS, %g2
310 359
311 BRANCH_IF_ANY_CHEETAH(g3,g7,9f) 360 sethi %hi(tlb_type), %g3
361 lduw [%g3 + %lo(tlb_type)], %g2
362 cmp %g2, 3
363 bne,pt %icc, 1f
364 nop
312 365
313 ba,pt %xcc, 1f 366 call hard_smp_processor_id
314 nop 367 nop
368
369 mov %o0, %o1
370 mov 0, %o0
371 mov 0, %o2
372 call sun4v_init_mondo_queues
373 mov 1, %o3
315 374
3169: 3751: call init_cur_cpu_trap
317 sethi %uhi(VPTE_BASE_CHEETAH), %g3 376 ldx [%l0], %o0
318 or %g3, %ulo(VPTE_BASE_CHEETAH), %g3 377
319 ba,pt %xcc, 2f 378 /* Start using proper page size encodings in ctx register. */
320 sllx %g3, 32, %g3 379 sethi %hi(sparc64_kern_pri_context), %g3
3211: 380 ldx [%g3 + %lo(sparc64_kern_pri_context)], %g2
322 sethi %uhi(VPTE_BASE_SPITFIRE), %g3 381 mov PRIMARY_CONTEXT, %g1
323 or %g3, %ulo(VPTE_BASE_SPITFIRE), %g3
324 sllx %g3, 32, %g3
325 382
3262: 383661: stxa %g2, [%g1] ASI_DMMU
327 clr %g7 384 .section .sun4v_1insn_patch, "ax"
328#undef KERN_HIGHBITS 385 .word 661b
329#undef KERN_LOWBITS 386 stxa %g2, [%g1] ASI_MMU
387 .previous
330 388
331 wrpr %o1, 0x0, %pstate 389 membar #Sync
332 ldx [%g6 + TI_TASK], %g4
333 390
334 wrpr %g0, 0, %wstate 391 wrpr %g0, 0, %wstate
335 392
336 call init_irqwork_curcpu 393 /* As a hack, put &init_thread_union into %g6.
394 * prom_world() loads from here to restore the %asi
395 * register.
396 */
397 sethi %hi(init_thread_union), %g6
398 or %g6, %lo(init_thread_union), %g6
399
400 sethi %hi(is_sun4v), %o0
401 lduw [%o0 + %lo(is_sun4v)], %o0
402 brz,pt %o0, 1f
337 nop 403 nop
338 404
339 /* Start using proper page size encodings in ctx register. */ 405 TRAP_LOAD_TRAP_BLOCK(%g2, %g3)
340 sethi %hi(sparc64_kern_pri_context), %g3 406 add %g2, TRAP_PER_CPU_FAULT_INFO, %g2
341 ldx [%g3 + %lo(sparc64_kern_pri_context)], %g2 407 stxa %g2, [%g0] ASI_SCRATCHPAD
342 mov PRIMARY_CONTEXT, %g1 408
343 stxa %g2, [%g1] ASI_DMMU 409 /* Compute physical address:
344 membar #Sync 410 *
411 * paddr = kern_base + (mmfsa_vaddr - KERNBASE)
412 */
413 sethi %hi(KERNBASE), %g3
414 sub %g2, %g3, %g2
415 sethi %hi(kern_base), %g3
416 ldx [%g3 + %lo(kern_base)], %g3
417 add %g2, %g3, %o1
418
419 call prom_set_trap_table_sun4v
420 sethi %hi(sparc64_ttable_tl0), %o0
421
422 ba,pt %xcc, 2f
423 nop
424
4251: call prom_set_trap_table
426 sethi %hi(sparc64_ttable_tl0), %o0
427
4282: ldx [%l0], %g6
429 ldx [%g6 + TI_TASK], %g4
430
431 mov 1, %g5
432 sllx %g5, THREAD_SHIFT, %g5
433 sub %g5, (STACKFRAME_SZ + STACK_BIAS), %g5
434 add %g6, %g5, %sp
435 mov 0, %fp
345 436
346 rdpr %pstate, %o1 437 rdpr %pstate, %o1
347 or %o1, PSTATE_IE, %o1 438 or %o1, PSTATE_IE, %o1
348 wrpr %o1, 0, %pstate 439 wrpr %o1, 0, %pstate
349 440
350 call prom_set_trap_table
351 sethi %hi(sparc64_ttable_tl0), %o0
352
353 call smp_callin 441 call smp_callin
354 nop 442 nop
355 call cpu_idle 443 call cpu_idle
diff --git a/arch/sparc64/kernel/traps.c b/arch/sparc64/kernel/traps.c
index 8d44ae5a15e3..ff090bb9734b 100644
--- a/arch/sparc64/kernel/traps.c
+++ b/arch/sparc64/kernel/traps.c
@@ -38,22 +38,24 @@
38#include <asm/processor.h> 38#include <asm/processor.h>
39#include <asm/timer.h> 39#include <asm/timer.h>
40#include <asm/kdebug.h> 40#include <asm/kdebug.h>
41#include <asm/head.h>
41#ifdef CONFIG_KMOD 42#ifdef CONFIG_KMOD
42#include <linux/kmod.h> 43#include <linux/kmod.h>
43#endif 44#endif
44 45
45struct notifier_block *sparc64die_chain; 46ATOMIC_NOTIFIER_HEAD(sparc64die_chain);
46static DEFINE_SPINLOCK(die_notifier_lock);
47 47
48int register_die_notifier(struct notifier_block *nb) 48int register_die_notifier(struct notifier_block *nb)
49{ 49{
50 int err = 0; 50 return atomic_notifier_chain_register(&sparc64die_chain, nb);
51 unsigned long flags;
52 spin_lock_irqsave(&die_notifier_lock, flags);
53 err = notifier_chain_register(&sparc64die_chain, nb);
54 spin_unlock_irqrestore(&die_notifier_lock, flags);
55 return err;
56} 51}
52EXPORT_SYMBOL(register_die_notifier);
53
54int unregister_die_notifier(struct notifier_block *nb)
55{
56 return atomic_notifier_chain_unregister(&sparc64die_chain, nb);
57}
58EXPORT_SYMBOL(unregister_die_notifier);
57 59
58/* When an irrecoverable trap occurs at tl > 0, the trap entry 60/* When an irrecoverable trap occurs at tl > 0, the trap entry
59 * code logs the trap state registers at every level in the trap 61 * code logs the trap state registers at every level in the trap
@@ -72,12 +74,14 @@ struct tl1_traplog {
72 74
73static void dump_tl1_traplog(struct tl1_traplog *p) 75static void dump_tl1_traplog(struct tl1_traplog *p)
74{ 76{
75 int i; 77 int i, limit;
78
79 printk(KERN_EMERG "TRAPLOG: Error at trap level 0x%lx, "
80 "dumping track stack.\n", p->tl);
76 81
77 printk("TRAPLOG: Error at trap level 0x%lx, dumping track stack.\n", 82 limit = (tlb_type == hypervisor) ? 2 : 4;
78 p->tl); 83 for (i = 0; i < limit; i++) {
79 for (i = 0; i < 4; i++) { 84 printk(KERN_EMERG
80 printk(KERN_CRIT
81 "TRAPLOG: Trap level %d TSTATE[%016lx] TPC[%016lx] " 85 "TRAPLOG: Trap level %d TSTATE[%016lx] TPC[%016lx] "
82 "TNPC[%016lx] TT[%lx]\n", 86 "TNPC[%016lx] TT[%lx]\n",
83 i + 1, 87 i + 1,
@@ -179,6 +183,45 @@ void spitfire_insn_access_exception_tl1(struct pt_regs *regs, unsigned long sfsr
179 spitfire_insn_access_exception(regs, sfsr, sfar); 183 spitfire_insn_access_exception(regs, sfsr, sfar);
180} 184}
181 185
186void sun4v_insn_access_exception(struct pt_regs *regs, unsigned long addr, unsigned long type_ctx)
187{
188 unsigned short type = (type_ctx >> 16);
189 unsigned short ctx = (type_ctx & 0xffff);
190 siginfo_t info;
191
192 if (notify_die(DIE_TRAP, "instruction access exception", regs,
193 0, 0x8, SIGTRAP) == NOTIFY_STOP)
194 return;
195
196 if (regs->tstate & TSTATE_PRIV) {
197 printk("sun4v_insn_access_exception: ADDR[%016lx] "
198 "CTX[%04x] TYPE[%04x], going.\n",
199 addr, ctx, type);
200 die_if_kernel("Iax", regs);
201 }
202
203 if (test_thread_flag(TIF_32BIT)) {
204 regs->tpc &= 0xffffffff;
205 regs->tnpc &= 0xffffffff;
206 }
207 info.si_signo = SIGSEGV;
208 info.si_errno = 0;
209 info.si_code = SEGV_MAPERR;
210 info.si_addr = (void __user *) addr;
211 info.si_trapno = 0;
212 force_sig_info(SIGSEGV, &info, current);
213}
214
215void sun4v_insn_access_exception_tl1(struct pt_regs *regs, unsigned long addr, unsigned long type_ctx)
216{
217 if (notify_die(DIE_TRAP_TL1, "instruction access exception tl1", regs,
218 0, 0x8, SIGTRAP) == NOTIFY_STOP)
219 return;
220
221 dump_tl1_traplog((struct tl1_traplog *)(regs + 1));
222 sun4v_insn_access_exception(regs, addr, type_ctx);
223}
224
182void spitfire_data_access_exception(struct pt_regs *regs, unsigned long sfsr, unsigned long sfar) 225void spitfire_data_access_exception(struct pt_regs *regs, unsigned long sfsr, unsigned long sfar)
183{ 226{
184 siginfo_t info; 227 siginfo_t info;
@@ -227,6 +270,45 @@ void spitfire_data_access_exception_tl1(struct pt_regs *regs, unsigned long sfsr
227 spitfire_data_access_exception(regs, sfsr, sfar); 270 spitfire_data_access_exception(regs, sfsr, sfar);
228} 271}
229 272
273void sun4v_data_access_exception(struct pt_regs *regs, unsigned long addr, unsigned long type_ctx)
274{
275 unsigned short type = (type_ctx >> 16);
276 unsigned short ctx = (type_ctx & 0xffff);
277 siginfo_t info;
278
279 if (notify_die(DIE_TRAP, "data access exception", regs,
280 0, 0x8, SIGTRAP) == NOTIFY_STOP)
281 return;
282
283 if (regs->tstate & TSTATE_PRIV) {
284 printk("sun4v_data_access_exception: ADDR[%016lx] "
285 "CTX[%04x] TYPE[%04x], going.\n",
286 addr, ctx, type);
287 die_if_kernel("Dax", regs);
288 }
289
290 if (test_thread_flag(TIF_32BIT)) {
291 regs->tpc &= 0xffffffff;
292 regs->tnpc &= 0xffffffff;
293 }
294 info.si_signo = SIGSEGV;
295 info.si_errno = 0;
296 info.si_code = SEGV_MAPERR;
297 info.si_addr = (void __user *) addr;
298 info.si_trapno = 0;
299 force_sig_info(SIGSEGV, &info, current);
300}
301
302void sun4v_data_access_exception_tl1(struct pt_regs *regs, unsigned long addr, unsigned long type_ctx)
303{
304 if (notify_die(DIE_TRAP_TL1, "data access exception tl1", regs,
305 0, 0x8, SIGTRAP) == NOTIFY_STOP)
306 return;
307
308 dump_tl1_traplog((struct tl1_traplog *)(regs + 1));
309 sun4v_data_access_exception(regs, addr, type_ctx);
310}
311
230#ifdef CONFIG_PCI 312#ifdef CONFIG_PCI
231/* This is really pathetic... */ 313/* This is really pathetic... */
232extern volatile int pci_poke_in_progress; 314extern volatile int pci_poke_in_progress;
@@ -788,7 +870,8 @@ void __init cheetah_ecache_flush_init(void)
788 cheetah_error_log[i].afsr = CHAFSR_INVALID; 870 cheetah_error_log[i].afsr = CHAFSR_INVALID;
789 871
790 __asm__ ("rdpr %%ver, %0" : "=r" (ver)); 872 __asm__ ("rdpr %%ver, %0" : "=r" (ver));
791 if ((ver >> 32) == 0x003e0016) { 873 if ((ver >> 32) == __JALAPENO_ID ||
874 (ver >> 32) == __SERRANO_ID) {
792 cheetah_error_table = &__jalapeno_error_table[0]; 875 cheetah_error_table = &__jalapeno_error_table[0];
793 cheetah_afsr_errors = JPAFSR_ERRORS; 876 cheetah_afsr_errors = JPAFSR_ERRORS;
794 } else if ((ver >> 32) == 0x003e0015) { 877 } else if ((ver >> 32) == 0x003e0015) {
@@ -1666,6 +1749,238 @@ void cheetah_plus_parity_error(int type, struct pt_regs *regs)
1666 regs->tpc); 1749 regs->tpc);
1667} 1750}
1668 1751
1752struct sun4v_error_entry {
1753 u64 err_handle;
1754 u64 err_stick;
1755
1756 u32 err_type;
1757#define SUN4V_ERR_TYPE_UNDEFINED 0
1758#define SUN4V_ERR_TYPE_UNCORRECTED_RES 1
1759#define SUN4V_ERR_TYPE_PRECISE_NONRES 2
1760#define SUN4V_ERR_TYPE_DEFERRED_NONRES 3
1761#define SUN4V_ERR_TYPE_WARNING_RES 4
1762
1763 u32 err_attrs;
1764#define SUN4V_ERR_ATTRS_PROCESSOR 0x00000001
1765#define SUN4V_ERR_ATTRS_MEMORY 0x00000002
1766#define SUN4V_ERR_ATTRS_PIO 0x00000004
1767#define SUN4V_ERR_ATTRS_INT_REGISTERS 0x00000008
1768#define SUN4V_ERR_ATTRS_FPU_REGISTERS 0x00000010
1769#define SUN4V_ERR_ATTRS_USER_MODE 0x01000000
1770#define SUN4V_ERR_ATTRS_PRIV_MODE 0x02000000
1771#define SUN4V_ERR_ATTRS_RES_QUEUE_FULL 0x80000000
1772
1773 u64 err_raddr;
1774 u32 err_size;
1775 u16 err_cpu;
1776 u16 err_pad;
1777};
1778
1779static atomic_t sun4v_resum_oflow_cnt = ATOMIC_INIT(0);
1780static atomic_t sun4v_nonresum_oflow_cnt = ATOMIC_INIT(0);
1781
1782static const char *sun4v_err_type_to_str(u32 type)
1783{
1784 switch (type) {
1785 case SUN4V_ERR_TYPE_UNDEFINED:
1786 return "undefined";
1787 case SUN4V_ERR_TYPE_UNCORRECTED_RES:
1788 return "uncorrected resumable";
1789 case SUN4V_ERR_TYPE_PRECISE_NONRES:
1790 return "precise nonresumable";
1791 case SUN4V_ERR_TYPE_DEFERRED_NONRES:
1792 return "deferred nonresumable";
1793 case SUN4V_ERR_TYPE_WARNING_RES:
1794 return "warning resumable";
1795 default:
1796 return "unknown";
1797 };
1798}
1799
1800static void sun4v_log_error(struct sun4v_error_entry *ent, int cpu, const char *pfx, atomic_t *ocnt)
1801{
1802 int cnt;
1803
1804 printk("%s: Reporting on cpu %d\n", pfx, cpu);
1805 printk("%s: err_handle[%lx] err_stick[%lx] err_type[%08x:%s]\n",
1806 pfx,
1807 ent->err_handle, ent->err_stick,
1808 ent->err_type,
1809 sun4v_err_type_to_str(ent->err_type));
1810 printk("%s: err_attrs[%08x:%s %s %s %s %s %s %s %s]\n",
1811 pfx,
1812 ent->err_attrs,
1813 ((ent->err_attrs & SUN4V_ERR_ATTRS_PROCESSOR) ?
1814 "processor" : ""),
1815 ((ent->err_attrs & SUN4V_ERR_ATTRS_MEMORY) ?
1816 "memory" : ""),
1817 ((ent->err_attrs & SUN4V_ERR_ATTRS_PIO) ?
1818 "pio" : ""),
1819 ((ent->err_attrs & SUN4V_ERR_ATTRS_INT_REGISTERS) ?
1820 "integer-regs" : ""),
1821 ((ent->err_attrs & SUN4V_ERR_ATTRS_FPU_REGISTERS) ?
1822 "fpu-regs" : ""),
1823 ((ent->err_attrs & SUN4V_ERR_ATTRS_USER_MODE) ?
1824 "user" : ""),
1825 ((ent->err_attrs & SUN4V_ERR_ATTRS_PRIV_MODE) ?
1826 "privileged" : ""),
1827 ((ent->err_attrs & SUN4V_ERR_ATTRS_RES_QUEUE_FULL) ?
1828 "queue-full" : ""));
1829 printk("%s: err_raddr[%016lx] err_size[%u] err_cpu[%u]\n",
1830 pfx,
1831 ent->err_raddr, ent->err_size, ent->err_cpu);
1832
1833 if ((cnt = atomic_read(ocnt)) != 0) {
1834 atomic_set(ocnt, 0);
1835 wmb();
1836 printk("%s: Queue overflowed %d times.\n",
1837 pfx, cnt);
1838 }
1839}
1840
1841/* We run with %pil set to 15 and PSTATE_IE enabled in %pstate.
1842 * Log the event and clear the first word of the entry.
1843 */
1844void sun4v_resum_error(struct pt_regs *regs, unsigned long offset)
1845{
1846 struct sun4v_error_entry *ent, local_copy;
1847 struct trap_per_cpu *tb;
1848 unsigned long paddr;
1849 int cpu;
1850
1851 cpu = get_cpu();
1852
1853 tb = &trap_block[cpu];
1854 paddr = tb->resum_kernel_buf_pa + offset;
1855 ent = __va(paddr);
1856
1857 memcpy(&local_copy, ent, sizeof(struct sun4v_error_entry));
1858
1859 /* We have a local copy now, so release the entry. */
1860 ent->err_handle = 0;
1861 wmb();
1862
1863 put_cpu();
1864
1865 sun4v_log_error(&local_copy, cpu,
1866 KERN_ERR "RESUMABLE ERROR",
1867 &sun4v_resum_oflow_cnt);
1868}
1869
1870/* If we try to printk() we'll probably make matters worse, by trying
1871 * to retake locks this cpu already holds or causing more errors. So
1872 * just bump a counter, and we'll report these counter bumps above.
1873 */
1874void sun4v_resum_overflow(struct pt_regs *regs)
1875{
1876 atomic_inc(&sun4v_resum_oflow_cnt);
1877}
1878
1879/* We run with %pil set to 15 and PSTATE_IE enabled in %pstate.
1880 * Log the event, clear the first word of the entry, and die.
1881 */
1882void sun4v_nonresum_error(struct pt_regs *regs, unsigned long offset)
1883{
1884 struct sun4v_error_entry *ent, local_copy;
1885 struct trap_per_cpu *tb;
1886 unsigned long paddr;
1887 int cpu;
1888
1889 cpu = get_cpu();
1890
1891 tb = &trap_block[cpu];
1892 paddr = tb->nonresum_kernel_buf_pa + offset;
1893 ent = __va(paddr);
1894
1895 memcpy(&local_copy, ent, sizeof(struct sun4v_error_entry));
1896
1897 /* We have a local copy now, so release the entry. */
1898 ent->err_handle = 0;
1899 wmb();
1900
1901 put_cpu();
1902
1903#ifdef CONFIG_PCI
1904 /* Check for the special PCI poke sequence. */
1905 if (pci_poke_in_progress && pci_poke_cpu == cpu) {
1906 pci_poke_faulted = 1;
1907 regs->tpc += 4;
1908 regs->tnpc = regs->tpc + 4;
1909 return;
1910 }
1911#endif
1912
1913 sun4v_log_error(&local_copy, cpu,
1914 KERN_EMERG "NON-RESUMABLE ERROR",
1915 &sun4v_nonresum_oflow_cnt);
1916
1917 panic("Non-resumable error.");
1918}
1919
1920/* If we try to printk() we'll probably make matters worse, by trying
1921 * to retake locks this cpu already holds or causing more errors. So
1922 * just bump a counter, and we'll report these counter bumps above.
1923 */
1924void sun4v_nonresum_overflow(struct pt_regs *regs)
1925{
1926 /* XXX Actually even this can make not that much sense. Perhaps
1927 * XXX we should just pull the plug and panic directly from here?
1928 */
1929 atomic_inc(&sun4v_nonresum_oflow_cnt);
1930}
1931
1932unsigned long sun4v_err_itlb_vaddr;
1933unsigned long sun4v_err_itlb_ctx;
1934unsigned long sun4v_err_itlb_pte;
1935unsigned long sun4v_err_itlb_error;
1936
1937void sun4v_itlb_error_report(struct pt_regs *regs, int tl)
1938{
1939 if (tl > 1)
1940 dump_tl1_traplog((struct tl1_traplog *)(regs + 1));
1941
1942 printk(KERN_EMERG "SUN4V-ITLB: Error at TPC[%lx], tl %d\n",
1943 regs->tpc, tl);
1944 printk(KERN_EMERG "SUN4V-ITLB: vaddr[%lx] ctx[%lx] "
1945 "pte[%lx] error[%lx]\n",
1946 sun4v_err_itlb_vaddr, sun4v_err_itlb_ctx,
1947 sun4v_err_itlb_pte, sun4v_err_itlb_error);
1948
1949 prom_halt();
1950}
1951
1952unsigned long sun4v_err_dtlb_vaddr;
1953unsigned long sun4v_err_dtlb_ctx;
1954unsigned long sun4v_err_dtlb_pte;
1955unsigned long sun4v_err_dtlb_error;
1956
1957void sun4v_dtlb_error_report(struct pt_regs *regs, int tl)
1958{
1959 if (tl > 1)
1960 dump_tl1_traplog((struct tl1_traplog *)(regs + 1));
1961
1962 printk(KERN_EMERG "SUN4V-DTLB: Error at TPC[%lx], tl %d\n",
1963 regs->tpc, tl);
1964 printk(KERN_EMERG "SUN4V-DTLB: vaddr[%lx] ctx[%lx] "
1965 "pte[%lx] error[%lx]\n",
1966 sun4v_err_dtlb_vaddr, sun4v_err_dtlb_ctx,
1967 sun4v_err_dtlb_pte, sun4v_err_dtlb_error);
1968
1969 prom_halt();
1970}
1971
1972void hypervisor_tlbop_error(unsigned long err, unsigned long op)
1973{
1974 printk(KERN_CRIT "SUN4V: TLB hv call error %lu for op %lu\n",
1975 err, op);
1976}
1977
1978void hypervisor_tlbop_error_xcall(unsigned long err, unsigned long op)
1979{
1980 printk(KERN_CRIT "SUN4V: XCALL TLB hv call error %lu for op %lu\n",
1981 err, op);
1982}
1983
1669void do_fpe_common(struct pt_regs *regs) 1984void do_fpe_common(struct pt_regs *regs)
1670{ 1985{
1671 if (regs->tstate & TSTATE_PRIV) { 1986 if (regs->tstate & TSTATE_PRIV) {
@@ -1924,10 +2239,11 @@ void die_if_kernel(char *str, struct pt_regs *regs)
1924 } 2239 }
1925 user_instruction_dump ((unsigned int __user *) regs->tpc); 2240 user_instruction_dump ((unsigned int __user *) regs->tpc);
1926 } 2241 }
2242#if 0
1927#ifdef CONFIG_SMP 2243#ifdef CONFIG_SMP
1928 smp_report_regs(); 2244 smp_report_regs();
1929#endif 2245#endif
1930 2246#endif
1931 if (regs->tstate & TSTATE_PRIV) 2247 if (regs->tstate & TSTATE_PRIV)
1932 do_exit(SIGKILL); 2248 do_exit(SIGKILL);
1933 do_exit(SIGSEGV); 2249 do_exit(SIGSEGV);
@@ -1958,6 +2274,11 @@ void do_illegal_instruction(struct pt_regs *regs)
1958 } else if ((insn & 0xc1580000) == 0xc1100000) /* LDQ/STQ */ { 2274 } else if ((insn & 0xc1580000) == 0xc1100000) /* LDQ/STQ */ {
1959 if (handle_ldf_stq(insn, regs)) 2275 if (handle_ldf_stq(insn, regs))
1960 return; 2276 return;
2277 } else if (tlb_type == hypervisor) {
2278 extern int vis_emul(struct pt_regs *, unsigned int);
2279
2280 if (!vis_emul(regs, insn))
2281 return;
1961 } 2282 }
1962 } 2283 }
1963 info.si_signo = SIGILL; 2284 info.si_signo = SIGILL;
@@ -1968,6 +2289,8 @@ void do_illegal_instruction(struct pt_regs *regs)
1968 force_sig_info(SIGILL, &info, current); 2289 force_sig_info(SIGILL, &info, current);
1969} 2290}
1970 2291
2292extern void kernel_unaligned_trap(struct pt_regs *regs, unsigned int insn);
2293
1971void mem_address_unaligned(struct pt_regs *regs, unsigned long sfar, unsigned long sfsr) 2294void mem_address_unaligned(struct pt_regs *regs, unsigned long sfar, unsigned long sfsr)
1972{ 2295{
1973 siginfo_t info; 2296 siginfo_t info;
@@ -1977,13 +2300,7 @@ void mem_address_unaligned(struct pt_regs *regs, unsigned long sfar, unsigned lo
1977 return; 2300 return;
1978 2301
1979 if (regs->tstate & TSTATE_PRIV) { 2302 if (regs->tstate & TSTATE_PRIV) {
1980 extern void kernel_unaligned_trap(struct pt_regs *regs, 2303 kernel_unaligned_trap(regs, *((unsigned int *)regs->tpc));
1981 unsigned int insn,
1982 unsigned long sfar,
1983 unsigned long sfsr);
1984
1985 kernel_unaligned_trap(regs, *((unsigned int *)regs->tpc),
1986 sfar, sfsr);
1987 return; 2304 return;
1988 } 2305 }
1989 info.si_signo = SIGBUS; 2306 info.si_signo = SIGBUS;
@@ -1994,6 +2311,26 @@ void mem_address_unaligned(struct pt_regs *regs, unsigned long sfar, unsigned lo
1994 force_sig_info(SIGBUS, &info, current); 2311 force_sig_info(SIGBUS, &info, current);
1995} 2312}
1996 2313
2314void sun4v_do_mna(struct pt_regs *regs, unsigned long addr, unsigned long type_ctx)
2315{
2316 siginfo_t info;
2317
2318 if (notify_die(DIE_TRAP, "memory address unaligned", regs,
2319 0, 0x34, SIGSEGV) == NOTIFY_STOP)
2320 return;
2321
2322 if (regs->tstate & TSTATE_PRIV) {
2323 kernel_unaligned_trap(regs, *((unsigned int *)regs->tpc));
2324 return;
2325 }
2326 info.si_signo = SIGBUS;
2327 info.si_errno = 0;
2328 info.si_code = BUS_ADRALN;
2329 info.si_addr = (void __user *) addr;
2330 info.si_trapno = 0;
2331 force_sig_info(SIGBUS, &info, current);
2332}
2333
1997void do_privop(struct pt_regs *regs) 2334void do_privop(struct pt_regs *regs)
1998{ 2335{
1999 siginfo_t info; 2336 siginfo_t info;
@@ -2130,7 +2467,23 @@ void do_getpsr(struct pt_regs *regs)
2130 } 2467 }
2131} 2468}
2132 2469
2470struct trap_per_cpu trap_block[NR_CPUS];
2471
2472/* This can get invoked before sched_init() so play it super safe
2473 * and use hard_smp_processor_id().
2474 */
2475void init_cur_cpu_trap(struct thread_info *t)
2476{
2477 int cpu = hard_smp_processor_id();
2478 struct trap_per_cpu *p = &trap_block[cpu];
2479
2480 p->thread = t;
2481 p->pgd_paddr = 0;
2482}
2483
2133extern void thread_info_offsets_are_bolixed_dave(void); 2484extern void thread_info_offsets_are_bolixed_dave(void);
2485extern void trap_per_cpu_offsets_are_bolixed_dave(void);
2486extern void tsb_config_offsets_are_bolixed_dave(void);
2134 2487
2135/* Only invoked on boot processor. */ 2488/* Only invoked on boot processor. */
2136void __init trap_init(void) 2489void __init trap_init(void)
@@ -2154,7 +2507,6 @@ void __init trap_init(void)
2154 TI_KERN_CNTD0 != offsetof(struct thread_info, kernel_cntd0) || 2507 TI_KERN_CNTD0 != offsetof(struct thread_info, kernel_cntd0) ||
2155 TI_KERN_CNTD1 != offsetof(struct thread_info, kernel_cntd1) || 2508 TI_KERN_CNTD1 != offsetof(struct thread_info, kernel_cntd1) ||
2156 TI_PCR != offsetof(struct thread_info, pcr_reg) || 2509 TI_PCR != offsetof(struct thread_info, pcr_reg) ||
2157 TI_CEE_STUFF != offsetof(struct thread_info, cee_stuff) ||
2158 TI_PRE_COUNT != offsetof(struct thread_info, preempt_count) || 2510 TI_PRE_COUNT != offsetof(struct thread_info, preempt_count) ||
2159 TI_NEW_CHILD != offsetof(struct thread_info, new_child) || 2511 TI_NEW_CHILD != offsetof(struct thread_info, new_child) ||
2160 TI_SYS_NOERROR != offsetof(struct thread_info, syscall_noerror) || 2512 TI_SYS_NOERROR != offsetof(struct thread_info, syscall_noerror) ||
@@ -2165,6 +2517,47 @@ void __init trap_init(void)
2165 (TI_FPREGS & (64 - 1))) 2517 (TI_FPREGS & (64 - 1)))
2166 thread_info_offsets_are_bolixed_dave(); 2518 thread_info_offsets_are_bolixed_dave();
2167 2519
2520 if (TRAP_PER_CPU_THREAD != offsetof(struct trap_per_cpu, thread) ||
2521 (TRAP_PER_CPU_PGD_PADDR !=
2522 offsetof(struct trap_per_cpu, pgd_paddr)) ||
2523 (TRAP_PER_CPU_CPU_MONDO_PA !=
2524 offsetof(struct trap_per_cpu, cpu_mondo_pa)) ||
2525 (TRAP_PER_CPU_DEV_MONDO_PA !=
2526 offsetof(struct trap_per_cpu, dev_mondo_pa)) ||
2527 (TRAP_PER_CPU_RESUM_MONDO_PA !=
2528 offsetof(struct trap_per_cpu, resum_mondo_pa)) ||
2529 (TRAP_PER_CPU_RESUM_KBUF_PA !=
2530 offsetof(struct trap_per_cpu, resum_kernel_buf_pa)) ||
2531 (TRAP_PER_CPU_NONRESUM_MONDO_PA !=
2532 offsetof(struct trap_per_cpu, nonresum_mondo_pa)) ||
2533 (TRAP_PER_CPU_NONRESUM_KBUF_PA !=
2534 offsetof(struct trap_per_cpu, nonresum_kernel_buf_pa)) ||
2535 (TRAP_PER_CPU_FAULT_INFO !=
2536 offsetof(struct trap_per_cpu, fault_info)) ||
2537 (TRAP_PER_CPU_CPU_MONDO_BLOCK_PA !=
2538 offsetof(struct trap_per_cpu, cpu_mondo_block_pa)) ||
2539 (TRAP_PER_CPU_CPU_LIST_PA !=
2540 offsetof(struct trap_per_cpu, cpu_list_pa)) ||
2541 (TRAP_PER_CPU_TSB_HUGE !=
2542 offsetof(struct trap_per_cpu, tsb_huge)) ||
2543 (TRAP_PER_CPU_TSB_HUGE_TEMP !=
2544 offsetof(struct trap_per_cpu, tsb_huge_temp)))
2545 trap_per_cpu_offsets_are_bolixed_dave();
2546
2547 if ((TSB_CONFIG_TSB !=
2548 offsetof(struct tsb_config, tsb)) ||
2549 (TSB_CONFIG_RSS_LIMIT !=
2550 offsetof(struct tsb_config, tsb_rss_limit)) ||
2551 (TSB_CONFIG_NENTRIES !=
2552 offsetof(struct tsb_config, tsb_nentries)) ||
2553 (TSB_CONFIG_REG_VAL !=
2554 offsetof(struct tsb_config, tsb_reg_val)) ||
2555 (TSB_CONFIG_MAP_VADDR !=
2556 offsetof(struct tsb_config, tsb_map_vaddr)) ||
2557 (TSB_CONFIG_MAP_PTE !=
2558 offsetof(struct tsb_config, tsb_map_pte)))
2559 tsb_config_offsets_are_bolixed_dave();
2560
2168 /* Attach to the address space of init_task. On SMP we 2561 /* Attach to the address space of init_task. On SMP we
2169 * do this in smp.c:smp_callin for other cpus. 2562 * do this in smp.c:smp_callin for other cpus.
2170 */ 2563 */
diff --git a/arch/sparc64/kernel/tsb.S b/arch/sparc64/kernel/tsb.S
new file mode 100644
index 000000000000..a0c8ba58920b
--- /dev/null
+++ b/arch/sparc64/kernel/tsb.S
@@ -0,0 +1,552 @@
1/* tsb.S: Sparc64 TSB table handling.
2 *
3 * Copyright (C) 2006 David S. Miller <davem@davemloft.net>
4 */
5
6#include <linux/config.h>
7
8#include <asm/tsb.h>
9#include <asm/hypervisor.h>
10#include <asm/page.h>
11#include <asm/cpudata.h>
12#include <asm/mmu.h>
13
14 .text
15 .align 32
16
17 /* Invoked from TLB miss handler, we are in the
18 * MMU global registers and they are setup like
19 * this:
20 *
21 * %g1: TSB entry pointer
22 * %g2: available temporary
23 * %g3: FAULT_CODE_{D,I}TLB
24 * %g4: available temporary
25 * %g5: available temporary
26 * %g6: TAG TARGET
27 * %g7: available temporary, will be loaded by us with
28 * the physical address base of the linux page
29 * tables for the current address space
30 */
31tsb_miss_dtlb:
32 mov TLB_TAG_ACCESS, %g4
33 ba,pt %xcc, tsb_miss_page_table_walk
34 ldxa [%g4] ASI_DMMU, %g4
35
36tsb_miss_itlb:
37 mov TLB_TAG_ACCESS, %g4
38 ba,pt %xcc, tsb_miss_page_table_walk
39 ldxa [%g4] ASI_IMMU, %g4
40
41 /* At this point we have:
42 * %g1 -- PAGE_SIZE TSB entry address
43 * %g3 -- FAULT_CODE_{D,I}TLB
44 * %g4 -- missing virtual address
45 * %g6 -- TAG TARGET (vaddr >> 22)
46 */
47tsb_miss_page_table_walk:
48 TRAP_LOAD_TRAP_BLOCK(%g7, %g5)
49
50 /* Before committing to a full page table walk,
51 * check the huge page TSB.
52 */
53#ifdef CONFIG_HUGETLB_PAGE
54
55661: ldx [%g7 + TRAP_PER_CPU_TSB_HUGE], %g5
56 nop
57 .section .sun4v_2insn_patch, "ax"
58 .word 661b
59 mov SCRATCHPAD_UTSBREG2, %g5
60 ldxa [%g5] ASI_SCRATCHPAD, %g5
61 .previous
62
63 cmp %g5, -1
64 be,pt %xcc, 80f
65 nop
66
67 /* We need an aligned pair of registers containing 2 values
68 * which can be easily rematerialized. %g6 and %g7 foot the
69 * bill just nicely. We'll save %g6 away into %g2 for the
70 * huge page TSB TAG comparison.
71 *
72 * Perform a huge page TSB lookup.
73 */
74 mov %g6, %g2
75 and %g5, 0x7, %g6
76 mov 512, %g7
77 andn %g5, 0x7, %g5
78 sllx %g7, %g6, %g7
79 srlx %g4, HPAGE_SHIFT, %g6
80 sub %g7, 1, %g7
81 and %g6, %g7, %g6
82 sllx %g6, 4, %g6
83 add %g5, %g6, %g5
84
85 TSB_LOAD_QUAD(%g5, %g6)
86 cmp %g6, %g2
87 be,a,pt %xcc, tsb_tlb_reload
88 mov %g7, %g5
89
90 /* No match, remember the huge page TSB entry address,
91 * and restore %g6 and %g7.
92 */
93 TRAP_LOAD_TRAP_BLOCK(%g7, %g6)
94 srlx %g4, 22, %g6
9580: stx %g5, [%g7 + TRAP_PER_CPU_TSB_HUGE_TEMP]
96
97#endif
98
99 ldx [%g7 + TRAP_PER_CPU_PGD_PADDR], %g7
100
101 /* At this point we have:
102 * %g1 -- TSB entry address
103 * %g3 -- FAULT_CODE_{D,I}TLB
104 * %g4 -- missing virtual address
105 * %g6 -- TAG TARGET (vaddr >> 22)
106 * %g7 -- page table physical address
107 *
108 * We know that both the base PAGE_SIZE TSB and the HPAGE_SIZE
109 * TSB both lack a matching entry.
110 */
111tsb_miss_page_table_walk_sun4v_fastpath:
112 USER_PGTABLE_WALK_TL1(%g4, %g7, %g5, %g2, tsb_do_fault)
113
114 /* Load and check PTE. */
115 ldxa [%g5] ASI_PHYS_USE_EC, %g5
116 brgez,pn %g5, tsb_do_fault
117 nop
118
119#ifdef CONFIG_HUGETLB_PAGE
120661: sethi %uhi(_PAGE_SZALL_4U), %g7
121 sllx %g7, 32, %g7
122 .section .sun4v_2insn_patch, "ax"
123 .word 661b
124 mov _PAGE_SZALL_4V, %g7
125 nop
126 .previous
127
128 and %g5, %g7, %g2
129
130661: sethi %uhi(_PAGE_SZHUGE_4U), %g7
131 sllx %g7, 32, %g7
132 .section .sun4v_2insn_patch, "ax"
133 .word 661b
134 mov _PAGE_SZHUGE_4V, %g7
135 nop
136 .previous
137
138 cmp %g2, %g7
139 bne,pt %xcc, 60f
140 nop
141
142 /* It is a huge page, use huge page TSB entry address we
143 * calculated above.
144 */
145 TRAP_LOAD_TRAP_BLOCK(%g7, %g2)
146 ldx [%g7 + TRAP_PER_CPU_TSB_HUGE_TEMP], %g2
147 cmp %g2, -1
148 movne %xcc, %g2, %g1
14960:
150#endif
151
152 /* At this point we have:
153 * %g1 -- TSB entry address
154 * %g3 -- FAULT_CODE_{D,I}TLB
155 * %g5 -- valid PTE
156 * %g6 -- TAG TARGET (vaddr >> 22)
157 */
158tsb_reload:
159 TSB_LOCK_TAG(%g1, %g2, %g7)
160 TSB_WRITE(%g1, %g5, %g6)
161
162 /* Finally, load TLB and return from trap. */
163tsb_tlb_reload:
164 cmp %g3, FAULT_CODE_DTLB
165 bne,pn %xcc, tsb_itlb_load
166 nop
167
168tsb_dtlb_load:
169
170661: stxa %g5, [%g0] ASI_DTLB_DATA_IN
171 retry
172 .section .sun4v_2insn_patch, "ax"
173 .word 661b
174 nop
175 nop
176 .previous
177
178 /* For sun4v the ASI_DTLB_DATA_IN store and the retry
179 * instruction get nop'd out and we get here to branch
180 * to the sun4v tlb load code. The registers are setup
181 * as follows:
182 *
183 * %g4: vaddr
184 * %g5: PTE
185 * %g6: TAG
186 *
187 * The sun4v TLB load wants the PTE in %g3 so we fix that
188 * up here.
189 */
190 ba,pt %xcc, sun4v_dtlb_load
191 mov %g5, %g3
192
193tsb_itlb_load:
194 /* Executable bit must be set. */
195661: andcc %g5, _PAGE_EXEC_4U, %g0
196 .section .sun4v_1insn_patch, "ax"
197 .word 661b
198 andcc %g5, _PAGE_EXEC_4V, %g0
199 .previous
200
201 be,pn %xcc, tsb_do_fault
202 nop
203
204661: stxa %g5, [%g0] ASI_ITLB_DATA_IN
205 retry
206 .section .sun4v_2insn_patch, "ax"
207 .word 661b
208 nop
209 nop
210 .previous
211
212 /* For sun4v the ASI_ITLB_DATA_IN store and the retry
213 * instruction get nop'd out and we get here to branch
214 * to the sun4v tlb load code. The registers are setup
215 * as follows:
216 *
217 * %g4: vaddr
218 * %g5: PTE
219 * %g6: TAG
220 *
221 * The sun4v TLB load wants the PTE in %g3 so we fix that
222 * up here.
223 */
224 ba,pt %xcc, sun4v_itlb_load
225 mov %g5, %g3
226
227 /* No valid entry in the page tables, do full fault
228 * processing.
229 */
230
231 .globl tsb_do_fault
232tsb_do_fault:
233 cmp %g3, FAULT_CODE_DTLB
234
235661: rdpr %pstate, %g5
236 wrpr %g5, PSTATE_AG | PSTATE_MG, %pstate
237 .section .sun4v_2insn_patch, "ax"
238 .word 661b
239 SET_GL(1)
240 ldxa [%g0] ASI_SCRATCHPAD, %g4
241 .previous
242
243 bne,pn %xcc, tsb_do_itlb_fault
244 nop
245
246tsb_do_dtlb_fault:
247 rdpr %tl, %g3
248 cmp %g3, 1
249
250661: mov TLB_TAG_ACCESS, %g4
251 ldxa [%g4] ASI_DMMU, %g5
252 .section .sun4v_2insn_patch, "ax"
253 .word 661b
254 ldx [%g4 + HV_FAULT_D_ADDR_OFFSET], %g5
255 nop
256 .previous
257
258 be,pt %xcc, sparc64_realfault_common
259 mov FAULT_CODE_DTLB, %g4
260 ba,pt %xcc, winfix_trampoline
261 nop
262
263tsb_do_itlb_fault:
264 rdpr %tpc, %g5
265 ba,pt %xcc, sparc64_realfault_common
266 mov FAULT_CODE_ITLB, %g4
267
268 .globl sparc64_realfault_common
269sparc64_realfault_common:
270 /* fault code in %g4, fault address in %g5, etrap will
271 * preserve these two values in %l4 and %l5 respectively
272 */
273 ba,pt %xcc, etrap ! Save trap state
2741: rd %pc, %g7 ! ...
275 stb %l4, [%g6 + TI_FAULT_CODE] ! Save fault code
276 stx %l5, [%g6 + TI_FAULT_ADDR] ! Save fault address
277 call do_sparc64_fault ! Call fault handler
278 add %sp, PTREGS_OFF, %o0 ! Compute pt_regs arg
279 ba,pt %xcc, rtrap_clr_l6 ! Restore cpu state
280 nop ! Delay slot (fill me)
281
282winfix_trampoline:
283 rdpr %tpc, %g3 ! Prepare winfixup TNPC
284 or %g3, 0x7c, %g3 ! Compute branch offset
285 wrpr %g3, %tnpc ! Write it into TNPC
286 done ! Trap return
287
288 /* Insert an entry into the TSB.
289 *
290 * %o0: TSB entry pointer (virt or phys address)
291 * %o1: tag
292 * %o2: pte
293 */
294 .align 32
295 .globl __tsb_insert
296__tsb_insert:
297 rdpr %pstate, %o5
298 wrpr %o5, PSTATE_IE, %pstate
299 TSB_LOCK_TAG(%o0, %g2, %g3)
300 TSB_WRITE(%o0, %o2, %o1)
301 wrpr %o5, %pstate
302 retl
303 nop
304 .size __tsb_insert, .-__tsb_insert
305
306 /* Flush the given TSB entry if it has the matching
307 * tag.
308 *
309 * %o0: TSB entry pointer (virt or phys address)
310 * %o1: tag
311 */
312 .align 32
313 .globl tsb_flush
314 .type tsb_flush,#function
315tsb_flush:
316 sethi %hi(TSB_TAG_LOCK_HIGH), %g2
3171: TSB_LOAD_TAG(%o0, %g1)
318 srlx %g1, 32, %o3
319 andcc %o3, %g2, %g0
320 bne,pn %icc, 1b
321 membar #LoadLoad
322 cmp %g1, %o1
323 mov 1, %o3
324 bne,pt %xcc, 2f
325 sllx %o3, TSB_TAG_INVALID_BIT, %o3
326 TSB_CAS_TAG(%o0, %g1, %o3)
327 cmp %g1, %o3
328 bne,pn %xcc, 1b
329 nop
3302: retl
331 TSB_MEMBAR
332 .size tsb_flush, .-tsb_flush
333
334 /* Reload MMU related context switch state at
335 * schedule() time.
336 *
337 * %o0: page table physical address
338 * %o1: TSB base config pointer
339 * %o2: TSB huge config pointer, or NULL if none
340 * %o3: Hypervisor TSB descriptor physical address
341 *
342 * We have to run this whole thing with interrupts
343 * disabled so that the current cpu doesn't change
344 * due to preemption.
345 */
346 .align 32
347 .globl __tsb_context_switch
348 .type __tsb_context_switch,#function
349__tsb_context_switch:
350 rdpr %pstate, %g1
351 wrpr %g1, PSTATE_IE, %pstate
352
353 TRAP_LOAD_TRAP_BLOCK(%g2, %g3)
354
355 stx %o0, [%g2 + TRAP_PER_CPU_PGD_PADDR]
356
357 ldx [%o1 + TSB_CONFIG_REG_VAL], %o0
358 brz,pt %o2, 1f
359 mov -1, %g3
360
361 ldx [%o2 + TSB_CONFIG_REG_VAL], %g3
362
3631: stx %g3, [%g2 + TRAP_PER_CPU_TSB_HUGE]
364
365 sethi %hi(tlb_type), %g2
366 lduw [%g2 + %lo(tlb_type)], %g2
367 cmp %g2, 3
368 bne,pt %icc, 50f
369 nop
370
371 /* Hypervisor TSB switch. */
372 mov SCRATCHPAD_UTSBREG1, %o5
373 stxa %o0, [%o5] ASI_SCRATCHPAD
374 mov SCRATCHPAD_UTSBREG2, %o5
375 stxa %g3, [%o5] ASI_SCRATCHPAD
376
377 mov 2, %o0
378 cmp %g3, -1
379 move %xcc, 1, %o0
380
381 mov HV_FAST_MMU_TSB_CTXNON0, %o5
382 mov %o3, %o1
383 ta HV_FAST_TRAP
384
385 /* Finish up. */
386 ba,pt %xcc, 9f
387 nop
388
389 /* SUN4U TSB switch. */
39050: mov TSB_REG, %o5
391 stxa %o0, [%o5] ASI_DMMU
392 membar #Sync
393 stxa %o0, [%o5] ASI_IMMU
394 membar #Sync
395
3962: ldx [%o1 + TSB_CONFIG_MAP_VADDR], %o4
397 brz %o4, 9f
398 ldx [%o1 + TSB_CONFIG_MAP_PTE], %o5
399
400 sethi %hi(sparc64_highest_unlocked_tlb_ent), %g2
401 mov TLB_TAG_ACCESS, %g3
402 lduw [%g2 + %lo(sparc64_highest_unlocked_tlb_ent)], %g2
403 stxa %o4, [%g3] ASI_DMMU
404 membar #Sync
405 sllx %g2, 3, %g2
406 stxa %o5, [%g2] ASI_DTLB_DATA_ACCESS
407 membar #Sync
408
409 brz,pt %o2, 9f
410 nop
411
412 ldx [%o2 + TSB_CONFIG_MAP_VADDR], %o4
413 ldx [%o2 + TSB_CONFIG_MAP_PTE], %o5
414 mov TLB_TAG_ACCESS, %g3
415 stxa %o4, [%g3] ASI_DMMU
416 membar #Sync
417 sub %g2, (1 << 3), %g2
418 stxa %o5, [%g2] ASI_DTLB_DATA_ACCESS
419 membar #Sync
420
4219:
422 wrpr %g1, %pstate
423
424 retl
425 nop
426 .size __tsb_context_switch, .-__tsb_context_switch
427
428#define TSB_PASS_BITS ((1 << TSB_TAG_LOCK_BIT) | \
429 (1 << TSB_TAG_INVALID_BIT))
430
431 .align 32
432 .globl copy_tsb
433 .type copy_tsb,#function
434copy_tsb: /* %o0=old_tsb_base, %o1=old_tsb_size
435 * %o2=new_tsb_base, %o3=new_tsb_size
436 */
437 sethi %uhi(TSB_PASS_BITS), %g7
438 srlx %o3, 4, %o3
439 add %o0, %o1, %g1 /* end of old tsb */
440 sllx %g7, 32, %g7
441 sub %o3, 1, %o3 /* %o3 == new tsb hash mask */
442
443661: prefetcha [%o0] ASI_N, #one_read
444 .section .tsb_phys_patch, "ax"
445 .word 661b
446 prefetcha [%o0] ASI_PHYS_USE_EC, #one_read
447 .previous
448
44990: andcc %o0, (64 - 1), %g0
450 bne 1f
451 add %o0, 64, %o5
452
453661: prefetcha [%o5] ASI_N, #one_read
454 .section .tsb_phys_patch, "ax"
455 .word 661b
456 prefetcha [%o5] ASI_PHYS_USE_EC, #one_read
457 .previous
458
4591: TSB_LOAD_QUAD(%o0, %g2) /* %g2/%g3 == TSB entry */
460 andcc %g2, %g7, %g0 /* LOCK or INVALID set? */
461 bne,pn %xcc, 80f /* Skip it */
462 sllx %g2, 22, %o4 /* TAG --> VADDR */
463
464 /* This can definitely be computed faster... */
465 srlx %o0, 4, %o5 /* Build index */
466 and %o5, 511, %o5 /* Mask index */
467 sllx %o5, PAGE_SHIFT, %o5 /* Put into vaddr position */
468 or %o4, %o5, %o4 /* Full VADDR. */
469 srlx %o4, PAGE_SHIFT, %o4 /* Shift down to create index */
470 and %o4, %o3, %o4 /* Mask with new_tsb_nents-1 */
471 sllx %o4, 4, %o4 /* Shift back up into tsb ent offset */
472 TSB_STORE(%o2 + %o4, %g2) /* Store TAG */
473 add %o4, 0x8, %o4 /* Advance to TTE */
474 TSB_STORE(%o2 + %o4, %g3) /* Store TTE */
475
47680: add %o0, 16, %o0
477 cmp %o0, %g1
478 bne,pt %xcc, 90b
479 nop
480
481 retl
482 TSB_MEMBAR
483 .size copy_tsb, .-copy_tsb
484
485 /* Set the invalid bit in all TSB entries. */
486 .align 32
487 .globl tsb_init
488 .type tsb_init,#function
489tsb_init: /* %o0 = TSB vaddr, %o1 = size in bytes */
490 prefetch [%o0 + 0x000], #n_writes
491 mov 1, %g1
492 prefetch [%o0 + 0x040], #n_writes
493 sllx %g1, TSB_TAG_INVALID_BIT, %g1
494 prefetch [%o0 + 0x080], #n_writes
4951: prefetch [%o0 + 0x0c0], #n_writes
496 stx %g1, [%o0 + 0x00]
497 stx %g1, [%o0 + 0x10]
498 stx %g1, [%o0 + 0x20]
499 stx %g1, [%o0 + 0x30]
500 prefetch [%o0 + 0x100], #n_writes
501 stx %g1, [%o0 + 0x40]
502 stx %g1, [%o0 + 0x50]
503 stx %g1, [%o0 + 0x60]
504 stx %g1, [%o0 + 0x70]
505 prefetch [%o0 + 0x140], #n_writes
506 stx %g1, [%o0 + 0x80]
507 stx %g1, [%o0 + 0x90]
508 stx %g1, [%o0 + 0xa0]
509 stx %g1, [%o0 + 0xb0]
510 prefetch [%o0 + 0x180], #n_writes
511 stx %g1, [%o0 + 0xc0]
512 stx %g1, [%o0 + 0xd0]
513 stx %g1, [%o0 + 0xe0]
514 stx %g1, [%o0 + 0xf0]
515 subcc %o1, 0x100, %o1
516 bne,pt %xcc, 1b
517 add %o0, 0x100, %o0
518 retl
519 nop
520 nop
521 nop
522 .size tsb_init, .-tsb_init
523
524 .globl NGtsb_init
525 .type NGtsb_init,#function
526NGtsb_init:
527 rd %asi, %g2
528 mov 1, %g1
529 wr %g0, ASI_BLK_INIT_QUAD_LDD_P, %asi
530 sllx %g1, TSB_TAG_INVALID_BIT, %g1
5311: stxa %g1, [%o0 + 0x00] %asi
532 stxa %g1, [%o0 + 0x10] %asi
533 stxa %g1, [%o0 + 0x20] %asi
534 stxa %g1, [%o0 + 0x30] %asi
535 stxa %g1, [%o0 + 0x40] %asi
536 stxa %g1, [%o0 + 0x50] %asi
537 stxa %g1, [%o0 + 0x60] %asi
538 stxa %g1, [%o0 + 0x70] %asi
539 stxa %g1, [%o0 + 0x80] %asi
540 stxa %g1, [%o0 + 0x90] %asi
541 stxa %g1, [%o0 + 0xa0] %asi
542 stxa %g1, [%o0 + 0xb0] %asi
543 stxa %g1, [%o0 + 0xc0] %asi
544 stxa %g1, [%o0 + 0xd0] %asi
545 stxa %g1, [%o0 + 0xe0] %asi
546 stxa %g1, [%o0 + 0xf0] %asi
547 subcc %o1, 0x100, %o1
548 bne,pt %xcc, 1b
549 add %o0, 0x100, %o0
550 retl
551 wr %g2, 0x0, %asi
552 .size NGtsb_init, .-NGtsb_init
diff --git a/arch/sparc64/kernel/ttable.S b/arch/sparc64/kernel/ttable.S
index 8365bc1f81f3..5d901519db55 100644
--- a/arch/sparc64/kernel/ttable.S
+++ b/arch/sparc64/kernel/ttable.S
@@ -1,7 +1,6 @@
1/* $Id: ttable.S,v 1.38 2002/02/09 19:49:30 davem Exp $ 1/* ttable.S: Sparc V9 Trap Table(s) with SpitFire/Cheetah/SUN4V extensions.
2 * ttable.S: Sparc V9 Trap Table(s) with SpitFire/Cheetah extensions.
3 * 2 *
4 * Copyright (C) 1996, 2001 David S. Miller (davem@caip.rutgers.edu) 3 * Copyright (C) 1996, 2001, 2006 David S. Miller (davem@davemloft.net)
5 */ 4 */
6 5
7#include <linux/config.h> 6#include <linux/config.h>
@@ -19,7 +18,7 @@ tl0_resv000: BOOT_KERNEL BTRAP(0x1) BTRAP(0x2) BTRAP(0x3)
19tl0_resv004: BTRAP(0x4) BTRAP(0x5) BTRAP(0x6) BTRAP(0x7) 18tl0_resv004: BTRAP(0x4) BTRAP(0x5) BTRAP(0x6) BTRAP(0x7)
20tl0_iax: membar #Sync 19tl0_iax: membar #Sync
21 TRAP_NOSAVE_7INSNS(__spitfire_insn_access_exception) 20 TRAP_NOSAVE_7INSNS(__spitfire_insn_access_exception)
22tl0_resv009: BTRAP(0x9) 21tl0_itsb_4v: SUN4V_ITSB_MISS
23tl0_iae: membar #Sync 22tl0_iae: membar #Sync
24 TRAP_NOSAVE_7INSNS(__spitfire_access_error) 23 TRAP_NOSAVE_7INSNS(__spitfire_access_error)
25tl0_resv00b: BTRAP(0xb) BTRAP(0xc) BTRAP(0xd) BTRAP(0xe) BTRAP(0xf) 24tl0_resv00b: BTRAP(0xb) BTRAP(0xc) BTRAP(0xd) BTRAP(0xe) BTRAP(0xf)
@@ -38,7 +37,7 @@ tl0_div0: TRAP(do_div0)
38tl0_resv029: BTRAP(0x29) BTRAP(0x2a) BTRAP(0x2b) BTRAP(0x2c) BTRAP(0x2d) BTRAP(0x2e) 37tl0_resv029: BTRAP(0x29) BTRAP(0x2a) BTRAP(0x2b) BTRAP(0x2c) BTRAP(0x2d) BTRAP(0x2e)
39tl0_resv02f: BTRAP(0x2f) 38tl0_resv02f: BTRAP(0x2f)
40tl0_dax: TRAP_NOSAVE(__spitfire_data_access_exception) 39tl0_dax: TRAP_NOSAVE(__spitfire_data_access_exception)
41tl0_resv031: BTRAP(0x31) 40tl0_dtsb_4v: SUN4V_DTSB_MISS
42tl0_dae: membar #Sync 41tl0_dae: membar #Sync
43 TRAP_NOSAVE_7INSNS(__spitfire_access_error) 42 TRAP_NOSAVE_7INSNS(__spitfire_access_error)
44tl0_resv033: BTRAP(0x33) 43tl0_resv033: BTRAP(0x33)
@@ -52,12 +51,13 @@ tl0_resv03e: BTRAP(0x3e) BTRAP(0x3f) BTRAP(0x40)
52tl0_irq1: TRAP_IRQ(smp_call_function_client, 1) 51tl0_irq1: TRAP_IRQ(smp_call_function_client, 1)
53tl0_irq2: TRAP_IRQ(smp_receive_signal_client, 2) 52tl0_irq2: TRAP_IRQ(smp_receive_signal_client, 2)
54tl0_irq3: TRAP_IRQ(smp_penguin_jailcell, 3) 53tl0_irq3: TRAP_IRQ(smp_penguin_jailcell, 3)
54tl0_irq4: TRAP_IRQ(smp_new_mmu_context_version_client, 4)
55#else 55#else
56tl0_irq1: BTRAP(0x41) 56tl0_irq1: BTRAP(0x41)
57tl0_irq2: BTRAP(0x42) 57tl0_irq2: BTRAP(0x42)
58tl0_irq3: BTRAP(0x43) 58tl0_irq3: BTRAP(0x43)
59tl0_irq4: BTRAP(0x44)
59#endif 60#endif
60tl0_irq4: TRAP_IRQ(handler_irq, 4)
61tl0_irq5: TRAP_IRQ(handler_irq, 5) TRAP_IRQ(handler_irq, 6) 61tl0_irq5: TRAP_IRQ(handler_irq, 5) TRAP_IRQ(handler_irq, 6)
62tl0_irq7: TRAP_IRQ(handler_irq, 7) TRAP_IRQ(handler_irq, 8) 62tl0_irq7: TRAP_IRQ(handler_irq, 7) TRAP_IRQ(handler_irq, 8)
63tl0_irq9: TRAP_IRQ(handler_irq, 9) TRAP_IRQ(handler_irq, 10) 63tl0_irq9: TRAP_IRQ(handler_irq, 9) TRAP_IRQ(handler_irq, 10)
@@ -78,9 +78,9 @@ tl0_vaw: TRAP(do_vaw)
78tl0_cee: membar #Sync 78tl0_cee: membar #Sync
79 TRAP_NOSAVE_7INSNS(__spitfire_cee_trap) 79 TRAP_NOSAVE_7INSNS(__spitfire_cee_trap)
80tl0_iamiss: 80tl0_iamiss:
81#include "itlb_base.S" 81#include "itlb_miss.S"
82tl0_damiss: 82tl0_damiss:
83#include "dtlb_base.S" 83#include "dtlb_miss.S"
84tl0_daprot: 84tl0_daprot:
85#include "dtlb_prot.S" 85#include "dtlb_prot.S"
86tl0_fecc: BTRAP(0x70) /* Fast-ECC on Cheetah */ 86tl0_fecc: BTRAP(0x70) /* Fast-ECC on Cheetah */
@@ -88,15 +88,18 @@ tl0_dcpe: BTRAP(0x71) /* D-cache Parity Error on Cheetah+ */
88tl0_icpe: BTRAP(0x72) /* I-cache Parity Error on Cheetah+ */ 88tl0_icpe: BTRAP(0x72) /* I-cache Parity Error on Cheetah+ */
89tl0_resv073: BTRAP(0x73) BTRAP(0x74) BTRAP(0x75) 89tl0_resv073: BTRAP(0x73) BTRAP(0x74) BTRAP(0x75)
90tl0_resv076: BTRAP(0x76) BTRAP(0x77) BTRAP(0x78) BTRAP(0x79) BTRAP(0x7a) BTRAP(0x7b) 90tl0_resv076: BTRAP(0x76) BTRAP(0x77) BTRAP(0x78) BTRAP(0x79) BTRAP(0x7a) BTRAP(0x7b)
91tl0_resv07c: BTRAP(0x7c) BTRAP(0x7d) BTRAP(0x7e) BTRAP(0x7f) 91tl0_cpu_mondo: TRAP_NOSAVE(sun4v_cpu_mondo)
92tl0_dev_mondo: TRAP_NOSAVE(sun4v_dev_mondo)
93tl0_res_mondo: TRAP_NOSAVE(sun4v_res_mondo)
94tl0_nres_mondo: TRAP_NOSAVE(sun4v_nonres_mondo)
92tl0_s0n: SPILL_0_NORMAL 95tl0_s0n: SPILL_0_NORMAL
93tl0_s1n: SPILL_1_NORMAL 96tl0_s1n: SPILL_1_NORMAL
94tl0_s2n: SPILL_2_NORMAL 97tl0_s2n: SPILL_2_NORMAL
95tl0_s3n: SPILL_3_NORMAL 98tl0_s3n: SPILL_0_NORMAL_ETRAP
96tl0_s4n: SPILL_4_NORMAL 99tl0_s4n: SPILL_1_GENERIC_ETRAP
97tl0_s5n: SPILL_5_NORMAL 100tl0_s5n: SPILL_1_GENERIC_ETRAP_FIXUP
98tl0_s6n: SPILL_6_NORMAL 101tl0_s6n: SPILL_2_GENERIC_ETRAP
99tl0_s7n: SPILL_7_NORMAL 102tl0_s7n: SPILL_2_GENERIC_ETRAP_FIXUP
100tl0_s0o: SPILL_0_OTHER 103tl0_s0o: SPILL_0_OTHER
101tl0_s1o: SPILL_1_OTHER 104tl0_s1o: SPILL_1_OTHER
102tl0_s2o: SPILL_2_OTHER 105tl0_s2o: SPILL_2_OTHER
@@ -110,9 +113,9 @@ tl0_f1n: FILL_1_NORMAL
110tl0_f2n: FILL_2_NORMAL 113tl0_f2n: FILL_2_NORMAL
111tl0_f3n: FILL_3_NORMAL 114tl0_f3n: FILL_3_NORMAL
112tl0_f4n: FILL_4_NORMAL 115tl0_f4n: FILL_4_NORMAL
113tl0_f5n: FILL_5_NORMAL 116tl0_f5n: FILL_0_NORMAL_RTRAP
114tl0_f6n: FILL_6_NORMAL 117tl0_f6n: FILL_1_GENERIC_RTRAP
115tl0_f7n: FILL_7_NORMAL 118tl0_f7n: FILL_2_GENERIC_RTRAP
116tl0_f0o: FILL_0_OTHER 119tl0_f0o: FILL_0_OTHER
117tl0_f1o: FILL_1_OTHER 120tl0_f1o: FILL_1_OTHER
118tl0_f2o: FILL_2_OTHER 121tl0_f2o: FILL_2_OTHER
@@ -128,7 +131,7 @@ tl0_flushw: FLUSH_WINDOW_TRAP
128tl0_resv104: BTRAP(0x104) BTRAP(0x105) BTRAP(0x106) BTRAP(0x107) 131tl0_resv104: BTRAP(0x104) BTRAP(0x105) BTRAP(0x106) BTRAP(0x107)
129 .globl tl0_solaris 132 .globl tl0_solaris
130tl0_solaris: SOLARIS_SYSCALL_TRAP 133tl0_solaris: SOLARIS_SYSCALL_TRAP
131tl0_netbsd: NETBSD_SYSCALL_TRAP 134tl0_resv109: BTRAP(0x109)
132tl0_resv10a: BTRAP(0x10a) BTRAP(0x10b) BTRAP(0x10c) BTRAP(0x10d) BTRAP(0x10e) 135tl0_resv10a: BTRAP(0x10a) BTRAP(0x10b) BTRAP(0x10c) BTRAP(0x10d) BTRAP(0x10e)
133tl0_resv10f: BTRAP(0x10f) 136tl0_resv10f: BTRAP(0x10f)
134tl0_linux32: LINUX_32BIT_SYSCALL_TRAP 137tl0_linux32: LINUX_32BIT_SYSCALL_TRAP
@@ -179,7 +182,7 @@ sparc64_ttable_tl1:
179tl1_resv000: BOOT_KERNEL BTRAPTL1(0x1) BTRAPTL1(0x2) BTRAPTL1(0x3) 182tl1_resv000: BOOT_KERNEL BTRAPTL1(0x1) BTRAPTL1(0x2) BTRAPTL1(0x3)
180tl1_resv004: BTRAPTL1(0x4) BTRAPTL1(0x5) BTRAPTL1(0x6) BTRAPTL1(0x7) 183tl1_resv004: BTRAPTL1(0x4) BTRAPTL1(0x5) BTRAPTL1(0x6) BTRAPTL1(0x7)
181tl1_iax: TRAP_NOSAVE(__spitfire_insn_access_exception_tl1) 184tl1_iax: TRAP_NOSAVE(__spitfire_insn_access_exception_tl1)
182tl1_resv009: BTRAPTL1(0x9) 185tl1_itsb_4v: SUN4V_ITSB_MISS
183tl1_iae: membar #Sync 186tl1_iae: membar #Sync
184 TRAP_NOSAVE_7INSNS(__spitfire_access_error) 187 TRAP_NOSAVE_7INSNS(__spitfire_access_error)
185tl1_resv00b: BTRAPTL1(0xb) BTRAPTL1(0xc) BTRAPTL1(0xd) BTRAPTL1(0xe) BTRAPTL1(0xf) 188tl1_resv00b: BTRAPTL1(0xb) BTRAPTL1(0xc) BTRAPTL1(0xd) BTRAPTL1(0xe) BTRAPTL1(0xf)
@@ -198,7 +201,7 @@ tl1_div0: TRAPTL1(do_div0_tl1)
198tl1_resv029: BTRAPTL1(0x29) BTRAPTL1(0x2a) BTRAPTL1(0x2b) BTRAPTL1(0x2c) 201tl1_resv029: BTRAPTL1(0x29) BTRAPTL1(0x2a) BTRAPTL1(0x2b) BTRAPTL1(0x2c)
199tl1_resv02d: BTRAPTL1(0x2d) BTRAPTL1(0x2e) BTRAPTL1(0x2f) 202tl1_resv02d: BTRAPTL1(0x2d) BTRAPTL1(0x2e) BTRAPTL1(0x2f)
200tl1_dax: TRAP_NOSAVE(__spitfire_data_access_exception_tl1) 203tl1_dax: TRAP_NOSAVE(__spitfire_data_access_exception_tl1)
201tl1_resv031: BTRAPTL1(0x31) 204tl1_dtsb_4v: SUN4V_DTSB_MISS
202tl1_dae: membar #Sync 205tl1_dae: membar #Sync
203 TRAP_NOSAVE_7INSNS(__spitfire_access_error) 206 TRAP_NOSAVE_7INSNS(__spitfire_access_error)
204tl1_resv033: BTRAPTL1(0x33) 207tl1_resv033: BTRAPTL1(0x33)
@@ -222,26 +225,10 @@ tl1_resv05c: BTRAPTL1(0x5c) BTRAPTL1(0x5d) BTRAPTL1(0x5e) BTRAPTL1(0x5f)
222tl1_ivec: TRAP_IVEC 225tl1_ivec: TRAP_IVEC
223tl1_paw: TRAPTL1(do_paw_tl1) 226tl1_paw: TRAPTL1(do_paw_tl1)
224tl1_vaw: TRAPTL1(do_vaw_tl1) 227tl1_vaw: TRAPTL1(do_vaw_tl1)
225 228tl1_cee: BTRAPTL1(0x63)
226 /* The grotty trick to save %g1 into current->thread.cee_stuff
227 * is because when we take this trap we could be interrupting
228 * trap code already using the trap alternate global registers.
229 *
230 * We cross our fingers and pray that this store/load does
231 * not cause yet another CEE trap.
232 */
233tl1_cee: membar #Sync
234 stx %g1, [%g6 + TI_CEE_STUFF]
235 ldxa [%g0] ASI_AFSR, %g1
236 membar #Sync
237 stxa %g1, [%g0] ASI_AFSR
238 membar #Sync
239 ldx [%g6 + TI_CEE_STUFF], %g1
240 retry
241
242tl1_iamiss: BTRAPTL1(0x64) BTRAPTL1(0x65) BTRAPTL1(0x66) BTRAPTL1(0x67) 229tl1_iamiss: BTRAPTL1(0x64) BTRAPTL1(0x65) BTRAPTL1(0x66) BTRAPTL1(0x67)
243tl1_damiss: 230tl1_damiss:
244#include "dtlb_backend.S" 231#include "dtlb_miss.S"
245tl1_daprot: 232tl1_daprot:
246#include "dtlb_prot.S" 233#include "dtlb_prot.S"
247tl1_fecc: BTRAPTL1(0x70) /* Fast-ECC on Cheetah */ 234tl1_fecc: BTRAPTL1(0x70) /* Fast-ECC on Cheetah */
diff --git a/arch/sparc64/kernel/unaligned.c b/arch/sparc64/kernel/unaligned.c
index 70faf630603b..001e8518331f 100644
--- a/arch/sparc64/kernel/unaligned.c
+++ b/arch/sparc64/kernel/unaligned.c
@@ -277,7 +277,7 @@ static void kernel_mna_trap_fault(void)
277 regs->tstate |= (ASI_AIUS << 24UL); 277 regs->tstate |= (ASI_AIUS << 24UL);
278} 278}
279 279
280asmlinkage void kernel_unaligned_trap(struct pt_regs *regs, unsigned int insn, unsigned long sfar, unsigned long sfsr) 280asmlinkage void kernel_unaligned_trap(struct pt_regs *regs, unsigned int insn)
281{ 281{
282 enum direction dir = decode_direction(insn); 282 enum direction dir = decode_direction(insn);
283 int size = decode_access_size(insn); 283 int size = decode_access_size(insn);
@@ -405,6 +405,9 @@ extern void do_privact(struct pt_regs *regs);
405extern void spitfire_data_access_exception(struct pt_regs *regs, 405extern void spitfire_data_access_exception(struct pt_regs *regs,
406 unsigned long sfsr, 406 unsigned long sfsr,
407 unsigned long sfar); 407 unsigned long sfar);
408extern void sun4v_data_access_exception(struct pt_regs *regs,
409 unsigned long addr,
410 unsigned long type_ctx);
408 411
409int handle_ldf_stq(u32 insn, struct pt_regs *regs) 412int handle_ldf_stq(u32 insn, struct pt_regs *regs)
410{ 413{
@@ -447,14 +450,20 @@ int handle_ldf_stq(u32 insn, struct pt_regs *regs)
447 break; 450 break;
448 } 451 }
449 default: 452 default:
450 spitfire_data_access_exception(regs, 0, addr); 453 if (tlb_type == hypervisor)
454 sun4v_data_access_exception(regs, addr, 0);
455 else
456 spitfire_data_access_exception(regs, 0, addr);
451 return 1; 457 return 1;
452 } 458 }
453 if (put_user (first >> 32, (u32 __user *)addr) || 459 if (put_user (first >> 32, (u32 __user *)addr) ||
454 __put_user ((u32)first, (u32 __user *)(addr + 4)) || 460 __put_user ((u32)first, (u32 __user *)(addr + 4)) ||
455 __put_user (second >> 32, (u32 __user *)(addr + 8)) || 461 __put_user (second >> 32, (u32 __user *)(addr + 8)) ||
456 __put_user ((u32)second, (u32 __user *)(addr + 12))) { 462 __put_user ((u32)second, (u32 __user *)(addr + 12))) {
457 spitfire_data_access_exception(regs, 0, addr); 463 if (tlb_type == hypervisor)
464 sun4v_data_access_exception(regs, addr, 0);
465 else
466 spitfire_data_access_exception(regs, 0, addr);
458 return 1; 467 return 1;
459 } 468 }
460 } else { 469 } else {
@@ -467,7 +476,10 @@ int handle_ldf_stq(u32 insn, struct pt_regs *regs)
467 do_privact(regs); 476 do_privact(regs);
468 return 1; 477 return 1;
469 } else if (asi > ASI_SNFL) { 478 } else if (asi > ASI_SNFL) {
470 spitfire_data_access_exception(regs, 0, addr); 479 if (tlb_type == hypervisor)
480 sun4v_data_access_exception(regs, addr, 0);
481 else
482 spitfire_data_access_exception(regs, 0, addr);
471 return 1; 483 return 1;
472 } 484 }
473 switch (insn & 0x180000) { 485 switch (insn & 0x180000) {
@@ -484,7 +496,10 @@ int handle_ldf_stq(u32 insn, struct pt_regs *regs)
484 err |= __get_user (data[i], (u32 __user *)(addr + 4*i)); 496 err |= __get_user (data[i], (u32 __user *)(addr + 4*i));
485 } 497 }
486 if (err && !(asi & 0x2 /* NF */)) { 498 if (err && !(asi & 0x2 /* NF */)) {
487 spitfire_data_access_exception(regs, 0, addr); 499 if (tlb_type == hypervisor)
500 sun4v_data_access_exception(regs, addr, 0);
501 else
502 spitfire_data_access_exception(regs, 0, addr);
488 return 1; 503 return 1;
489 } 504 }
490 if (asi & 0x8) /* Little */ { 505 if (asi & 0x8) /* Little */ {
@@ -548,7 +563,7 @@ void handle_lddfmna(struct pt_regs *regs, unsigned long sfar, unsigned long sfsr
548 u32 insn; 563 u32 insn;
549 u32 first, second; 564 u32 first, second;
550 u64 value; 565 u64 value;
551 u8 asi, freg; 566 u8 freg;
552 int flag; 567 int flag;
553 struct fpustate *f = FPUSTATE; 568 struct fpustate *f = FPUSTATE;
554 569
@@ -557,7 +572,7 @@ void handle_lddfmna(struct pt_regs *regs, unsigned long sfar, unsigned long sfsr
557 if (test_thread_flag(TIF_32BIT)) 572 if (test_thread_flag(TIF_32BIT))
558 pc = (u32)pc; 573 pc = (u32)pc;
559 if (get_user(insn, (u32 __user *) pc) != -EFAULT) { 574 if (get_user(insn, (u32 __user *) pc) != -EFAULT) {
560 asi = sfsr >> 16; 575 int asi = decode_asi(insn, regs);
561 if ((asi > ASI_SNFL) || 576 if ((asi > ASI_SNFL) ||
562 (asi < ASI_P)) 577 (asi < ASI_P))
563 goto daex; 578 goto daex;
@@ -587,7 +602,11 @@ void handle_lddfmna(struct pt_regs *regs, unsigned long sfar, unsigned long sfsr
587 *(u64 *)(f->regs + freg) = value; 602 *(u64 *)(f->regs + freg) = value;
588 current_thread_info()->fpsaved[0] |= flag; 603 current_thread_info()->fpsaved[0] |= flag;
589 } else { 604 } else {
590daex: spitfire_data_access_exception(regs, sfsr, sfar); 605daex:
606 if (tlb_type == hypervisor)
607 sun4v_data_access_exception(regs, sfar, sfsr);
608 else
609 spitfire_data_access_exception(regs, sfsr, sfar);
591 return; 610 return;
592 } 611 }
593 advance(regs); 612 advance(regs);
@@ -600,7 +619,7 @@ void handle_stdfmna(struct pt_regs *regs, unsigned long sfar, unsigned long sfsr
600 unsigned long tstate = regs->tstate; 619 unsigned long tstate = regs->tstate;
601 u32 insn; 620 u32 insn;
602 u64 value; 621 u64 value;
603 u8 asi, freg; 622 u8 freg;
604 int flag; 623 int flag;
605 struct fpustate *f = FPUSTATE; 624 struct fpustate *f = FPUSTATE;
606 625
@@ -609,8 +628,8 @@ void handle_stdfmna(struct pt_regs *regs, unsigned long sfar, unsigned long sfsr
609 if (test_thread_flag(TIF_32BIT)) 628 if (test_thread_flag(TIF_32BIT))
610 pc = (u32)pc; 629 pc = (u32)pc;
611 if (get_user(insn, (u32 __user *) pc) != -EFAULT) { 630 if (get_user(insn, (u32 __user *) pc) != -EFAULT) {
631 int asi = decode_asi(insn, regs);
612 freg = ((insn >> 25) & 0x1e) | ((insn >> 20) & 0x20); 632 freg = ((insn >> 25) & 0x1e) | ((insn >> 20) & 0x20);
613 asi = sfsr >> 16;
614 value = 0; 633 value = 0;
615 flag = (freg < 32) ? FPRS_DL : FPRS_DU; 634 flag = (freg < 32) ? FPRS_DL : FPRS_DU;
616 if ((asi > ASI_SNFL) || 635 if ((asi > ASI_SNFL) ||
@@ -631,7 +650,11 @@ void handle_stdfmna(struct pt_regs *regs, unsigned long sfar, unsigned long sfsr
631 __put_user ((u32)value, (u32 __user *)(sfar + 4))) 650 __put_user ((u32)value, (u32 __user *)(sfar + 4)))
632 goto daex; 651 goto daex;
633 } else { 652 } else {
634daex: spitfire_data_access_exception(regs, sfsr, sfar); 653daex:
654 if (tlb_type == hypervisor)
655 sun4v_data_access_exception(regs, sfar, sfsr);
656 else
657 spitfire_data_access_exception(regs, sfsr, sfar);
635 return; 658 return;
636 } 659 }
637 advance(regs); 660 advance(regs);
diff --git a/arch/sparc64/kernel/us2e_cpufreq.c b/arch/sparc64/kernel/us2e_cpufreq.c
index b35dc8dc995a..1f83fe6a82d6 100644
--- a/arch/sparc64/kernel/us2e_cpufreq.c
+++ b/arch/sparc64/kernel/us2e_cpufreq.c
@@ -346,6 +346,9 @@ static int __init us2e_freq_init(void)
346 unsigned long manuf, impl, ver; 346 unsigned long manuf, impl, ver;
347 int ret; 347 int ret;
348 348
349 if (tlb_type != spitfire)
350 return -ENODEV;
351
349 __asm__("rdpr %%ver, %0" : "=r" (ver)); 352 __asm__("rdpr %%ver, %0" : "=r" (ver));
350 manuf = ((ver >> 48) & 0xffff); 353 manuf = ((ver >> 48) & 0xffff);
351 impl = ((ver >> 32) & 0xffff); 354 impl = ((ver >> 32) & 0xffff);
@@ -354,20 +357,16 @@ static int __init us2e_freq_init(void)
354 struct cpufreq_driver *driver; 357 struct cpufreq_driver *driver;
355 358
356 ret = -ENOMEM; 359 ret = -ENOMEM;
357 driver = kmalloc(sizeof(struct cpufreq_driver), GFP_KERNEL); 360 driver = kzalloc(sizeof(struct cpufreq_driver), GFP_KERNEL);
358 if (!driver) 361 if (!driver)
359 goto err_out; 362 goto err_out;
360 memset(driver, 0, sizeof(*driver));
361 363
362 us2e_freq_table = kmalloc( 364 us2e_freq_table = kzalloc(
363 (NR_CPUS * sizeof(struct us2e_freq_percpu_info)), 365 (NR_CPUS * sizeof(struct us2e_freq_percpu_info)),
364 GFP_KERNEL); 366 GFP_KERNEL);
365 if (!us2e_freq_table) 367 if (!us2e_freq_table)
366 goto err_out; 368 goto err_out;
367 369
368 memset(us2e_freq_table, 0,
369 (NR_CPUS * sizeof(struct us2e_freq_percpu_info)));
370
371 driver->init = us2e_freq_cpu_init; 370 driver->init = us2e_freq_cpu_init;
372 driver->verify = us2e_freq_verify; 371 driver->verify = us2e_freq_verify;
373 driver->target = us2e_freq_target; 372 driver->target = us2e_freq_target;
diff --git a/arch/sparc64/kernel/us3_cpufreq.c b/arch/sparc64/kernel/us3_cpufreq.c
index 6d1f9a3c464f..47e3acafb5be 100644
--- a/arch/sparc64/kernel/us3_cpufreq.c
+++ b/arch/sparc64/kernel/us3_cpufreq.c
@@ -203,6 +203,9 @@ static int __init us3_freq_init(void)
203 unsigned long manuf, impl, ver; 203 unsigned long manuf, impl, ver;
204 int ret; 204 int ret;
205 205
206 if (tlb_type != cheetah && tlb_type != cheetah_plus)
207 return -ENODEV;
208
206 __asm__("rdpr %%ver, %0" : "=r" (ver)); 209 __asm__("rdpr %%ver, %0" : "=r" (ver));
207 manuf = ((ver >> 48) & 0xffff); 210 manuf = ((ver >> 48) & 0xffff);
208 impl = ((ver >> 32) & 0xffff); 211 impl = ((ver >> 32) & 0xffff);
@@ -215,20 +218,16 @@ static int __init us3_freq_init(void)
215 struct cpufreq_driver *driver; 218 struct cpufreq_driver *driver;
216 219
217 ret = -ENOMEM; 220 ret = -ENOMEM;
218 driver = kmalloc(sizeof(struct cpufreq_driver), GFP_KERNEL); 221 driver = kzalloc(sizeof(struct cpufreq_driver), GFP_KERNEL);
219 if (!driver) 222 if (!driver)
220 goto err_out; 223 goto err_out;
221 memset(driver, 0, sizeof(*driver));
222 224
223 us3_freq_table = kmalloc( 225 us3_freq_table = kzalloc(
224 (NR_CPUS * sizeof(struct us3_freq_percpu_info)), 226 (NR_CPUS * sizeof(struct us3_freq_percpu_info)),
225 GFP_KERNEL); 227 GFP_KERNEL);
226 if (!us3_freq_table) 228 if (!us3_freq_table)
227 goto err_out; 229 goto err_out;
228 230
229 memset(us3_freq_table, 0,
230 (NR_CPUS * sizeof(struct us3_freq_percpu_info)));
231
232 driver->init = us3_freq_cpu_init; 231 driver->init = us3_freq_cpu_init;
233 driver->verify = us3_freq_verify; 232 driver->verify = us3_freq_verify;
234 driver->target = us3_freq_target; 233 driver->target = us3_freq_target;
diff --git a/arch/sparc64/kernel/visemul.c b/arch/sparc64/kernel/visemul.c
new file mode 100644
index 000000000000..84fedaa38aae
--- /dev/null
+++ b/arch/sparc64/kernel/visemul.c
@@ -0,0 +1,894 @@
1/* visemul.c: Emulation of VIS instructions.
2 *
3 * Copyright (C) 2006 David S. Miller (davem@davemloft.net)
4 */
5#include <linux/kernel.h>
6#include <linux/errno.h>
7#include <linux/thread_info.h>
8
9#include <asm/ptrace.h>
10#include <asm/pstate.h>
11#include <asm/system.h>
12#include <asm/fpumacro.h>
13#include <asm/uaccess.h>
14
15/* OPF field of various VIS instructions. */
16
17/* 000111011 - four 16-bit packs */
18#define FPACK16_OPF 0x03b
19
20/* 000111010 - two 32-bit packs */
21#define FPACK32_OPF 0x03a
22
23/* 000111101 - four 16-bit packs */
24#define FPACKFIX_OPF 0x03d
25
26/* 001001101 - four 16-bit expands */
27#define FEXPAND_OPF 0x04d
28
29/* 001001011 - two 32-bit merges */
30#define FPMERGE_OPF 0x04b
31
32/* 000110001 - 8-by-16-bit partitoned product */
33#define FMUL8x16_OPF 0x031
34
35/* 000110011 - 8-by-16-bit upper alpha partitioned product */
36#define FMUL8x16AU_OPF 0x033
37
38/* 000110101 - 8-by-16-bit lower alpha partitioned product */
39#define FMUL8x16AL_OPF 0x035
40
41/* 000110110 - upper 8-by-16-bit partitioned product */
42#define FMUL8SUx16_OPF 0x036
43
44/* 000110111 - lower 8-by-16-bit partitioned product */
45#define FMUL8ULx16_OPF 0x037
46
47/* 000111000 - upper 8-by-16-bit partitioned product */
48#define FMULD8SUx16_OPF 0x038
49
50/* 000111001 - lower unsigned 8-by-16-bit partitioned product */
51#define FMULD8ULx16_OPF 0x039
52
53/* 000101000 - four 16-bit compare; set rd if src1 > src2 */
54#define FCMPGT16_OPF 0x028
55
56/* 000101100 - two 32-bit compare; set rd if src1 > src2 */
57#define FCMPGT32_OPF 0x02c
58
59/* 000100000 - four 16-bit compare; set rd if src1 <= src2 */
60#define FCMPLE16_OPF 0x020
61
62/* 000100100 - two 32-bit compare; set rd if src1 <= src2 */
63#define FCMPLE32_OPF 0x024
64
65/* 000100010 - four 16-bit compare; set rd if src1 != src2 */
66#define FCMPNE16_OPF 0x022
67
68/* 000100110 - two 32-bit compare; set rd if src1 != src2 */
69#define FCMPNE32_OPF 0x026
70
71/* 000101010 - four 16-bit compare; set rd if src1 == src2 */
72#define FCMPEQ16_OPF 0x02a
73
74/* 000101110 - two 32-bit compare; set rd if src1 == src2 */
75#define FCMPEQ32_OPF 0x02e
76
77/* 000000000 - Eight 8-bit edge boundary processing */
78#define EDGE8_OPF 0x000
79
80/* 000000001 - Eight 8-bit edge boundary processing, no CC */
81#define EDGE8N_OPF 0x001
82
83/* 000000010 - Eight 8-bit edge boundary processing, little-endian */
84#define EDGE8L_OPF 0x002
85
86/* 000000011 - Eight 8-bit edge boundary processing, little-endian, no CC */
87#define EDGE8LN_OPF 0x003
88
89/* 000000100 - Four 16-bit edge boundary processing */
90#define EDGE16_OPF 0x004
91
92/* 000000101 - Four 16-bit edge boundary processing, no CC */
93#define EDGE16N_OPF 0x005
94
95/* 000000110 - Four 16-bit edge boundary processing, little-endian */
96#define EDGE16L_OPF 0x006
97
98/* 000000111 - Four 16-bit edge boundary processing, little-endian, no CC */
99#define EDGE16LN_OPF 0x007
100
101/* 000001000 - Two 32-bit edge boundary processing */
102#define EDGE32_OPF 0x008
103
104/* 000001001 - Two 32-bit edge boundary processing, no CC */
105#define EDGE32N_OPF 0x009
106
107/* 000001010 - Two 32-bit edge boundary processing, little-endian */
108#define EDGE32L_OPF 0x00a
109
110/* 000001011 - Two 32-bit edge boundary processing, little-endian, no CC */
111#define EDGE32LN_OPF 0x00b
112
113/* 000111110 - distance between 8 8-bit components */
114#define PDIST_OPF 0x03e
115
116/* 000010000 - convert 8-bit 3-D address to blocked byte address */
117#define ARRAY8_OPF 0x010
118
119/* 000010010 - convert 16-bit 3-D address to blocked byte address */
120#define ARRAY16_OPF 0x012
121
122/* 000010100 - convert 32-bit 3-D address to blocked byte address */
123#define ARRAY32_OPF 0x014
124
125/* 000011001 - Set the GSR.MASK field in preparation for a BSHUFFLE */
126#define BMASK_OPF 0x019
127
128/* 001001100 - Permute bytes as specified by GSR.MASK */
129#define BSHUFFLE_OPF 0x04c
130
131#define VIS_OPCODE_MASK ((0x3 << 30) | (0x3f << 19))
132#define VIS_OPCODE_VAL ((0x2 << 30) | (0x36 << 19))
133
134#define VIS_OPF_SHIFT 5
135#define VIS_OPF_MASK (0x1ff << VIS_OPF_SHIFT)
136
137#define RS1(INSN) (((INSN) >> 24) & 0x1f)
138#define RS2(INSN) (((INSN) >> 0) & 0x1f)
139#define RD(INSN) (((INSN) >> 25) & 0x1f)
140
141static inline void maybe_flush_windows(unsigned int rs1, unsigned int rs2,
142 unsigned int rd, int from_kernel)
143{
144 if (rs2 >= 16 || rs1 >= 16 || rd >= 16) {
145 if (from_kernel != 0)
146 __asm__ __volatile__("flushw");
147 else
148 flushw_user();
149 }
150}
151
152static unsigned long fetch_reg(unsigned int reg, struct pt_regs *regs)
153{
154 unsigned long value;
155
156 if (reg < 16)
157 return (!reg ? 0 : regs->u_regs[reg]);
158 if (regs->tstate & TSTATE_PRIV) {
159 struct reg_window *win;
160 win = (struct reg_window *)(regs->u_regs[UREG_FP] + STACK_BIAS);
161 value = win->locals[reg - 16];
162 } else if (test_thread_flag(TIF_32BIT)) {
163 struct reg_window32 __user *win32;
164 win32 = (struct reg_window32 __user *)((unsigned long)((u32)regs->u_regs[UREG_FP]));
165 get_user(value, &win32->locals[reg - 16]);
166 } else {
167 struct reg_window __user *win;
168 win = (struct reg_window __user *)(regs->u_regs[UREG_FP] + STACK_BIAS);
169 get_user(value, &win->locals[reg - 16]);
170 }
171 return value;
172}
173
174static inline unsigned long __user *__fetch_reg_addr_user(unsigned int reg,
175 struct pt_regs *regs)
176{
177 BUG_ON(reg < 16);
178 BUG_ON(regs->tstate & TSTATE_PRIV);
179
180 if (test_thread_flag(TIF_32BIT)) {
181 struct reg_window32 __user *win32;
182 win32 = (struct reg_window32 __user *)((unsigned long)((u32)regs->u_regs[UREG_FP]));
183 return (unsigned long __user *)&win32->locals[reg - 16];
184 } else {
185 struct reg_window __user *win;
186 win = (struct reg_window __user *)(regs->u_regs[UREG_FP] + STACK_BIAS);
187 return &win->locals[reg - 16];
188 }
189}
190
191static inline unsigned long *__fetch_reg_addr_kern(unsigned int reg,
192 struct pt_regs *regs)
193{
194 BUG_ON(reg >= 16);
195 BUG_ON(regs->tstate & TSTATE_PRIV);
196
197 return &regs->u_regs[reg];
198}
199
200static void store_reg(struct pt_regs *regs, unsigned long val, unsigned long rd)
201{
202 if (rd < 16) {
203 unsigned long *rd_kern = __fetch_reg_addr_kern(rd, regs);
204
205 *rd_kern = val;
206 } else {
207 unsigned long __user *rd_user = __fetch_reg_addr_user(rd, regs);
208
209 if (test_thread_flag(TIF_32BIT))
210 __put_user((u32)val, (u32 __user *)rd_user);
211 else
212 __put_user(val, rd_user);
213 }
214}
215
216static inline unsigned long fpd_regval(struct fpustate *f,
217 unsigned int insn_regnum)
218{
219 insn_regnum = (((insn_regnum & 1) << 5) |
220 (insn_regnum & 0x1e));
221
222 return *(unsigned long *) &f->regs[insn_regnum];
223}
224
225static inline unsigned long *fpd_regaddr(struct fpustate *f,
226 unsigned int insn_regnum)
227{
228 insn_regnum = (((insn_regnum & 1) << 5) |
229 (insn_regnum & 0x1e));
230
231 return (unsigned long *) &f->regs[insn_regnum];
232}
233
234static inline unsigned int fps_regval(struct fpustate *f,
235 unsigned int insn_regnum)
236{
237 return f->regs[insn_regnum];
238}
239
240static inline unsigned int *fps_regaddr(struct fpustate *f,
241 unsigned int insn_regnum)
242{
243 return &f->regs[insn_regnum];
244}
245
246struct edge_tab {
247 u16 left, right;
248};
249struct edge_tab edge8_tab[8] = {
250 { 0xff, 0x80 },
251 { 0x7f, 0xc0 },
252 { 0x3f, 0xe0 },
253 { 0x1f, 0xf0 },
254 { 0x0f, 0xf8 },
255 { 0x07, 0xfc },
256 { 0x03, 0xfe },
257 { 0x01, 0xff },
258};
259struct edge_tab edge8_tab_l[8] = {
260 { 0xff, 0x01 },
261 { 0xfe, 0x03 },
262 { 0xfc, 0x07 },
263 { 0xf8, 0x0f },
264 { 0xf0, 0x1f },
265 { 0xe0, 0x3f },
266 { 0xc0, 0x7f },
267 { 0x80, 0xff },
268};
269struct edge_tab edge16_tab[4] = {
270 { 0xf, 0x8 },
271 { 0x7, 0xc },
272 { 0x3, 0xe },
273 { 0x1, 0xf },
274};
275struct edge_tab edge16_tab_l[4] = {
276 { 0xf, 0x1 },
277 { 0xe, 0x3 },
278 { 0xc, 0x7 },
279 { 0x8, 0xf },
280};
281struct edge_tab edge32_tab[2] = {
282 { 0x3, 0x2 },
283 { 0x1, 0x3 },
284};
285struct edge_tab edge32_tab_l[2] = {
286 { 0x3, 0x1 },
287 { 0x2, 0x3 },
288};
289
290static void edge(struct pt_regs *regs, unsigned int insn, unsigned int opf)
291{
292 unsigned long orig_rs1, rs1, orig_rs2, rs2, rd_val;
293 u16 left, right;
294
295 maybe_flush_windows(RS1(insn), RS2(insn), RD(insn), 0);
296 orig_rs1 = rs1 = fetch_reg(RS1(insn), regs);
297 orig_rs2 = rs2 = fetch_reg(RS2(insn), regs);
298
299 if (test_thread_flag(TIF_32BIT)) {
300 rs1 = rs1 & 0xffffffff;
301 rs2 = rs2 & 0xffffffff;
302 }
303 switch (opf) {
304 default:
305 case EDGE8_OPF:
306 case EDGE8N_OPF:
307 left = edge8_tab[rs1 & 0x7].left;
308 right = edge8_tab[rs2 & 0x7].right;
309 break;
310 case EDGE8L_OPF:
311 case EDGE8LN_OPF:
312 left = edge8_tab_l[rs1 & 0x7].left;
313 right = edge8_tab_l[rs2 & 0x7].right;
314 break;
315
316 case EDGE16_OPF:
317 case EDGE16N_OPF:
318 left = edge16_tab[(rs1 >> 1) & 0x3].left;
319 right = edge16_tab[(rs2 >> 1) & 0x3].right;
320 break;
321
322 case EDGE16L_OPF:
323 case EDGE16LN_OPF:
324 left = edge16_tab_l[(rs1 >> 1) & 0x3].left;
325 right = edge16_tab_l[(rs2 >> 1) & 0x3].right;
326 break;
327
328 case EDGE32_OPF:
329 case EDGE32N_OPF:
330 left = edge32_tab[(rs1 >> 2) & 0x1].left;
331 right = edge32_tab[(rs2 >> 2) & 0x1].right;
332 break;
333
334 case EDGE32L_OPF:
335 case EDGE32LN_OPF:
336 left = edge32_tab_l[(rs1 >> 2) & 0x1].left;
337 right = edge32_tab_l[(rs2 >> 2) & 0x1].right;
338 break;
339 };
340
341 if ((rs1 & ~0x7UL) == (rs2 & ~0x7UL))
342 rd_val = right & left;
343 else
344 rd_val = left;
345
346 store_reg(regs, rd_val, RD(insn));
347
348 switch (opf) {
349 case EDGE8_OPF:
350 case EDGE8L_OPF:
351 case EDGE16_OPF:
352 case EDGE16L_OPF:
353 case EDGE32_OPF:
354 case EDGE32L_OPF: {
355 unsigned long ccr, tstate;
356
357 __asm__ __volatile__("subcc %1, %2, %%g0\n\t"
358 "rd %%ccr, %0"
359 : "=r" (ccr)
360 : "r" (orig_rs1), "r" (orig_rs2)
361 : "cc");
362 tstate = regs->tstate & ~(TSTATE_XCC | TSTATE_ICC);
363 regs->tstate = tstate | (ccr << 32UL);
364 }
365 };
366}
367
368static void array(struct pt_regs *regs, unsigned int insn, unsigned int opf)
369{
370 unsigned long rs1, rs2, rd_val;
371 unsigned int bits, bits_mask;
372
373 maybe_flush_windows(RS1(insn), RS2(insn), RD(insn), 0);
374 rs1 = fetch_reg(RS1(insn), regs);
375 rs2 = fetch_reg(RS2(insn), regs);
376
377 bits = (rs2 > 5 ? 5 : rs2);
378 bits_mask = (1UL << bits) - 1UL;
379
380 rd_val = ((((rs1 >> 11) & 0x3) << 0) |
381 (((rs1 >> 33) & 0x3) << 2) |
382 (((rs1 >> 55) & 0x1) << 4) |
383 (((rs1 >> 13) & 0xf) << 5) |
384 (((rs1 >> 35) & 0xf) << 9) |
385 (((rs1 >> 56) & 0xf) << 13) |
386 (((rs1 >> 17) & bits_mask) << 17) |
387 (((rs1 >> 39) & bits_mask) << (17 + bits)) |
388 (((rs1 >> 60) & 0xf) << (17 + (2*bits))));
389
390 switch (opf) {
391 case ARRAY16_OPF:
392 rd_val <<= 1;
393 break;
394
395 case ARRAY32_OPF:
396 rd_val <<= 2;
397 };
398
399 store_reg(regs, rd_val, RD(insn));
400}
401
402static void bmask(struct pt_regs *regs, unsigned int insn)
403{
404 unsigned long rs1, rs2, rd_val, gsr;
405
406 maybe_flush_windows(RS1(insn), RS2(insn), RD(insn), 0);
407 rs1 = fetch_reg(RS1(insn), regs);
408 rs2 = fetch_reg(RS2(insn), regs);
409 rd_val = rs1 + rs2;
410
411 store_reg(regs, rd_val, RD(insn));
412
413 gsr = current_thread_info()->gsr[0] & 0xffffffff;
414 gsr |= rd_val << 32UL;
415 current_thread_info()->gsr[0] = gsr;
416}
417
418static void bshuffle(struct pt_regs *regs, unsigned int insn)
419{
420 struct fpustate *f = FPUSTATE;
421 unsigned long rs1, rs2, rd_val;
422 unsigned long bmask, i;
423
424 bmask = current_thread_info()->gsr[0] >> 32UL;
425
426 rs1 = fpd_regval(f, RS1(insn));
427 rs2 = fpd_regval(f, RS2(insn));
428
429 rd_val = 0UL;
430 for (i = 0; i < 8; i++) {
431 unsigned long which = (bmask >> (i * 4)) & 0xf;
432 unsigned long byte;
433
434 if (which < 8)
435 byte = (rs1 >> (which * 8)) & 0xff;
436 else
437 byte = (rs2 >> ((which-8)*8)) & 0xff;
438 rd_val |= (byte << (i * 8));
439 }
440
441 *fpd_regaddr(f, RD(insn)) = rd_val;
442}
443
444static void pdist(struct pt_regs *regs, unsigned int insn)
445{
446 struct fpustate *f = FPUSTATE;
447 unsigned long rs1, rs2, *rd, rd_val;
448 unsigned long i;
449
450 rs1 = fpd_regval(f, RS1(insn));
451 rs2 = fpd_regval(f, RS1(insn));
452 rd = fpd_regaddr(f, RD(insn));
453
454 rd_val = *rd;
455
456 for (i = 0; i < 8; i++) {
457 s16 s1, s2;
458
459 s1 = (rs1 >> (56 - (i * 8))) & 0xff;
460 s2 = (rs2 >> (56 - (i * 8))) & 0xff;
461
462 /* Absolute value of difference. */
463 s1 -= s2;
464 if (s1 < 0)
465 s1 = ~s1 + 1;
466
467 rd_val += s1;
468 }
469
470 *rd = rd_val;
471}
472
473static void pformat(struct pt_regs *regs, unsigned int insn, unsigned int opf)
474{
475 struct fpustate *f = FPUSTATE;
476 unsigned long rs1, rs2, gsr, scale, rd_val;
477
478 gsr = current_thread_info()->gsr[0];
479 scale = (gsr >> 3) & (opf == FPACK16_OPF ? 0xf : 0x1f);
480 switch (opf) {
481 case FPACK16_OPF: {
482 unsigned long byte;
483
484 rs2 = fpd_regval(f, RS2(insn));
485 rd_val = 0;
486 for (byte = 0; byte < 4; byte++) {
487 unsigned int val;
488 s16 src = (rs2 >> (byte * 16UL)) & 0xffffUL;
489 int scaled = src << scale;
490 int from_fixed = scaled >> 7;
491
492 val = ((from_fixed < 0) ?
493 0 :
494 (from_fixed > 255) ?
495 255 : from_fixed);
496
497 rd_val |= (val << (8 * byte));
498 }
499 *fps_regaddr(f, RD(insn)) = rd_val;
500 break;
501 }
502
503 case FPACK32_OPF: {
504 unsigned long word;
505
506 rs1 = fpd_regval(f, RS1(insn));
507 rs2 = fpd_regval(f, RS2(insn));
508 rd_val = (rs1 << 8) & ~(0x000000ff000000ffUL);
509 for (word = 0; word < 2; word++) {
510 unsigned long val;
511 s32 src = (rs2 >> (word * 32UL));
512 s64 scaled = src << scale;
513 s64 from_fixed = scaled >> 23;
514
515 val = ((from_fixed < 0) ?
516 0 :
517 (from_fixed > 255) ?
518 255 : from_fixed);
519
520 rd_val |= (val << (32 * word));
521 }
522 *fpd_regaddr(f, RD(insn)) = rd_val;
523 break;
524 }
525
526 case FPACKFIX_OPF: {
527 unsigned long word;
528
529 rs2 = fpd_regval(f, RS2(insn));
530
531 rd_val = 0;
532 for (word = 0; word < 2; word++) {
533 long val;
534 s32 src = (rs2 >> (word * 32UL));
535 s64 scaled = src << scale;
536 s64 from_fixed = scaled >> 16;
537
538 val = ((from_fixed < -32768) ?
539 -32768 :
540 (from_fixed > 32767) ?
541 32767 : from_fixed);
542
543 rd_val |= ((val & 0xffff) << (word * 16));
544 }
545 *fps_regaddr(f, RD(insn)) = rd_val;
546 break;
547 }
548
549 case FEXPAND_OPF: {
550 unsigned long byte;
551
552 rs2 = fps_regval(f, RS2(insn));
553
554 rd_val = 0;
555 for (byte = 0; byte < 4; byte++) {
556 unsigned long val;
557 u8 src = (rs2 >> (byte * 8)) & 0xff;
558
559 val = src << 4;
560
561 rd_val |= (val << (byte * 16));
562 }
563 *fpd_regaddr(f, RD(insn)) = rd_val;
564 break;
565 }
566
567 case FPMERGE_OPF: {
568 rs1 = fps_regval(f, RS1(insn));
569 rs2 = fps_regval(f, RS2(insn));
570
571 rd_val = (((rs2 & 0x000000ff) << 0) |
572 ((rs1 & 0x000000ff) << 8) |
573 ((rs2 & 0x0000ff00) << 8) |
574 ((rs1 & 0x0000ff00) << 16) |
575 ((rs2 & 0x00ff0000) << 16) |
576 ((rs1 & 0x00ff0000) << 24) |
577 ((rs2 & 0xff000000) << 24) |
578 ((rs1 & 0xff000000) << 32));
579 *fpd_regaddr(f, RD(insn)) = rd_val;
580 break;
581 }
582 };
583}
584
585static void pmul(struct pt_regs *regs, unsigned int insn, unsigned int opf)
586{
587 struct fpustate *f = FPUSTATE;
588 unsigned long rs1, rs2, rd_val;
589
590 switch (opf) {
591 case FMUL8x16_OPF: {
592 unsigned long byte;
593
594 rs1 = fps_regval(f, RS1(insn));
595 rs2 = fpd_regval(f, RS2(insn));
596
597 rd_val = 0;
598 for (byte = 0; byte < 4; byte++) {
599 u16 src1 = (rs1 >> (byte * 8)) & 0x00ff;
600 s16 src2 = (rs2 >> (byte * 16)) & 0xffff;
601 u32 prod = src1 * src2;
602 u16 scaled = ((prod & 0x00ffff00) >> 8);
603
604 /* Round up. */
605 if (prod & 0x80)
606 scaled++;
607 rd_val |= ((scaled & 0xffffUL) << (byte * 16UL));
608 }
609
610 *fpd_regaddr(f, RD(insn)) = rd_val;
611 break;
612 }
613
614 case FMUL8x16AU_OPF:
615 case FMUL8x16AL_OPF: {
616 unsigned long byte;
617 s16 src2;
618
619 rs1 = fps_regval(f, RS1(insn));
620 rs2 = fps_regval(f, RS2(insn));
621
622 rd_val = 0;
623 src2 = (rs2 >> (opf == FMUL8x16AU_OPF) ? 16 : 0);
624 for (byte = 0; byte < 4; byte++) {
625 u16 src1 = (rs1 >> (byte * 8)) & 0x00ff;
626 u32 prod = src1 * src2;
627 u16 scaled = ((prod & 0x00ffff00) >> 8);
628
629 /* Round up. */
630 if (prod & 0x80)
631 scaled++;
632 rd_val |= ((scaled & 0xffffUL) << (byte * 16UL));
633 }
634
635 *fpd_regaddr(f, RD(insn)) = rd_val;
636 break;
637 }
638
639 case FMUL8SUx16_OPF:
640 case FMUL8ULx16_OPF: {
641 unsigned long byte, ushift;
642
643 rs1 = fpd_regval(f, RS1(insn));
644 rs2 = fpd_regval(f, RS2(insn));
645
646 rd_val = 0;
647 ushift = (opf == FMUL8SUx16_OPF) ? 8 : 0;
648 for (byte = 0; byte < 4; byte++) {
649 u16 src1;
650 s16 src2;
651 u32 prod;
652 u16 scaled;
653
654 src1 = ((rs1 >> ((16 * byte) + ushift)) & 0x00ff);
655 src2 = ((rs2 >> (16 * byte)) & 0xffff);
656 prod = src1 * src2;
657 scaled = ((prod & 0x00ffff00) >> 8);
658
659 /* Round up. */
660 if (prod & 0x80)
661 scaled++;
662 rd_val |= ((scaled & 0xffffUL) << (byte * 16UL));
663 }
664
665 *fpd_regaddr(f, RD(insn)) = rd_val;
666 break;
667 }
668
669 case FMULD8SUx16_OPF:
670 case FMULD8ULx16_OPF: {
671 unsigned long byte, ushift;
672
673 rs1 = fps_regval(f, RS1(insn));
674 rs2 = fps_regval(f, RS2(insn));
675
676 rd_val = 0;
677 ushift = (opf == FMULD8SUx16_OPF) ? 8 : 0;
678 for (byte = 0; byte < 2; byte++) {
679 u16 src1;
680 s16 src2;
681 u32 prod;
682 u16 scaled;
683
684 src1 = ((rs1 >> ((16 * byte) + ushift)) & 0x00ff);
685 src2 = ((rs2 >> (16 * byte)) & 0xffff);
686 prod = src1 * src2;
687 scaled = ((prod & 0x00ffff00) >> 8);
688
689 /* Round up. */
690 if (prod & 0x80)
691 scaled++;
692 rd_val |= ((scaled & 0xffffUL) <<
693 ((byte * 32UL) + 7UL));
694 }
695 *fpd_regaddr(f, RD(insn)) = rd_val;
696 break;
697 }
698 };
699}
700
701static void pcmp(struct pt_regs *regs, unsigned int insn, unsigned int opf)
702{
703 struct fpustate *f = FPUSTATE;
704 unsigned long rs1, rs2, rd_val, i;
705
706 rs1 = fpd_regval(f, RS1(insn));
707 rs2 = fpd_regval(f, RS2(insn));
708
709 rd_val = 0;
710
711 switch (opf) {
712 case FCMPGT16_OPF:
713 for (i = 0; i < 4; i++) {
714 s16 a = (rs1 >> (i * 16)) & 0xffff;
715 s16 b = (rs2 >> (i * 16)) & 0xffff;
716
717 if (a > b)
718 rd_val |= 1 << i;
719 }
720 break;
721
722 case FCMPGT32_OPF:
723 for (i = 0; i < 2; i++) {
724 s32 a = (rs1 >> (i * 32)) & 0xffff;
725 s32 b = (rs2 >> (i * 32)) & 0xffff;
726
727 if (a > b)
728 rd_val |= 1 << i;
729 }
730 break;
731
732 case FCMPLE16_OPF:
733 for (i = 0; i < 4; i++) {
734 s16 a = (rs1 >> (i * 16)) & 0xffff;
735 s16 b = (rs2 >> (i * 16)) & 0xffff;
736
737 if (a <= b)
738 rd_val |= 1 << i;
739 }
740 break;
741
742 case FCMPLE32_OPF:
743 for (i = 0; i < 2; i++) {
744 s32 a = (rs1 >> (i * 32)) & 0xffff;
745 s32 b = (rs2 >> (i * 32)) & 0xffff;
746
747 if (a <= b)
748 rd_val |= 1 << i;
749 }
750 break;
751
752 case FCMPNE16_OPF:
753 for (i = 0; i < 4; i++) {
754 s16 a = (rs1 >> (i * 16)) & 0xffff;
755 s16 b = (rs2 >> (i * 16)) & 0xffff;
756
757 if (a != b)
758 rd_val |= 1 << i;
759 }
760 break;
761
762 case FCMPNE32_OPF:
763 for (i = 0; i < 2; i++) {
764 s32 a = (rs1 >> (i * 32)) & 0xffff;
765 s32 b = (rs2 >> (i * 32)) & 0xffff;
766
767 if (a != b)
768 rd_val |= 1 << i;
769 }
770 break;
771
772 case FCMPEQ16_OPF:
773 for (i = 0; i < 4; i++) {
774 s16 a = (rs1 >> (i * 16)) & 0xffff;
775 s16 b = (rs2 >> (i * 16)) & 0xffff;
776
777 if (a == b)
778 rd_val |= 1 << i;
779 }
780 break;
781
782 case FCMPEQ32_OPF:
783 for (i = 0; i < 2; i++) {
784 s32 a = (rs1 >> (i * 32)) & 0xffff;
785 s32 b = (rs2 >> (i * 32)) & 0xffff;
786
787 if (a == b)
788 rd_val |= 1 << i;
789 }
790 break;
791 };
792
793 maybe_flush_windows(0, 0, RD(insn), 0);
794 store_reg(regs, rd_val, RD(insn));
795}
796
797/* Emulate the VIS instructions which are not implemented in
798 * hardware on Niagara.
799 */
800int vis_emul(struct pt_regs *regs, unsigned int insn)
801{
802 unsigned long pc = regs->tpc;
803 unsigned int opf;
804
805 BUG_ON(regs->tstate & TSTATE_PRIV);
806
807 if (test_thread_flag(TIF_32BIT))
808 pc = (u32)pc;
809
810 if (get_user(insn, (u32 __user *) pc))
811 return -EFAULT;
812
813 if ((insn & VIS_OPCODE_MASK) != VIS_OPCODE_VAL)
814 return -EINVAL;
815
816 opf = (insn & VIS_OPF_MASK) >> VIS_OPF_SHIFT;
817 switch (opf) {
818 default:
819 return -EINVAL;
820
821 /* Pixel Formatting Instructions. */
822 case FPACK16_OPF:
823 case FPACK32_OPF:
824 case FPACKFIX_OPF:
825 case FEXPAND_OPF:
826 case FPMERGE_OPF:
827 pformat(regs, insn, opf);
828 break;
829
830 /* Partitioned Multiply Instructions */
831 case FMUL8x16_OPF:
832 case FMUL8x16AU_OPF:
833 case FMUL8x16AL_OPF:
834 case FMUL8SUx16_OPF:
835 case FMUL8ULx16_OPF:
836 case FMULD8SUx16_OPF:
837 case FMULD8ULx16_OPF:
838 pmul(regs, insn, opf);
839 break;
840
841 /* Pixel Compare Instructions */
842 case FCMPGT16_OPF:
843 case FCMPGT32_OPF:
844 case FCMPLE16_OPF:
845 case FCMPLE32_OPF:
846 case FCMPNE16_OPF:
847 case FCMPNE32_OPF:
848 case FCMPEQ16_OPF:
849 case FCMPEQ32_OPF:
850 pcmp(regs, insn, opf);
851 break;
852
853 /* Edge Handling Instructions */
854 case EDGE8_OPF:
855 case EDGE8N_OPF:
856 case EDGE8L_OPF:
857 case EDGE8LN_OPF:
858 case EDGE16_OPF:
859 case EDGE16N_OPF:
860 case EDGE16L_OPF:
861 case EDGE16LN_OPF:
862 case EDGE32_OPF:
863 case EDGE32N_OPF:
864 case EDGE32L_OPF:
865 case EDGE32LN_OPF:
866 edge(regs, insn, opf);
867 break;
868
869 /* Pixel Component Distance */
870 case PDIST_OPF:
871 pdist(regs, insn);
872 break;
873
874 /* Three-Dimensional Array Addressing Instructions */
875 case ARRAY8_OPF:
876 case ARRAY16_OPF:
877 case ARRAY32_OPF:
878 array(regs, insn, opf);
879 break;
880
881 /* Byte Mask and Shuffle Instructions */
882 case BMASK_OPF:
883 bmask(regs, insn);
884 break;
885
886 case BSHUFFLE_OPF:
887 bshuffle(regs, insn);
888 break;
889 };
890
891 regs->tpc = regs->tnpc;
892 regs->tnpc += 4;
893 return 0;
894}
diff --git a/arch/sparc64/kernel/vmlinux.lds.S b/arch/sparc64/kernel/vmlinux.lds.S
index 467d13a0d5c1..b097379a49a8 100644
--- a/arch/sparc64/kernel/vmlinux.lds.S
+++ b/arch/sparc64/kernel/vmlinux.lds.S
@@ -70,6 +70,22 @@ SECTIONS
70 .con_initcall.init : { *(.con_initcall.init) } 70 .con_initcall.init : { *(.con_initcall.init) }
71 __con_initcall_end = .; 71 __con_initcall_end = .;
72 SECURITY_INIT 72 SECURITY_INIT
73 . = ALIGN(4);
74 __tsb_ldquad_phys_patch = .;
75 .tsb_ldquad_phys_patch : { *(.tsb_ldquad_phys_patch) }
76 __tsb_ldquad_phys_patch_end = .;
77 __tsb_phys_patch = .;
78 .tsb_phys_patch : { *(.tsb_phys_patch) }
79 __tsb_phys_patch_end = .;
80 __cpuid_patch = .;
81 .cpuid_patch : { *(.cpuid_patch) }
82 __cpuid_patch_end = .;
83 __sun4v_1insn_patch = .;
84 .sun4v_1insn_patch : { *(.sun4v_1insn_patch) }
85 __sun4v_1insn_patch_end = .;
86 __sun4v_2insn_patch = .;
87 .sun4v_2insn_patch : { *(.sun4v_2insn_patch) }
88 __sun4v_2insn_patch_end = .;
73 . = ALIGN(8192); 89 . = ALIGN(8192);
74 __initramfs_start = .; 90 __initramfs_start = .;
75 .init.ramfs : { *(.init.ramfs) } 91 .init.ramfs : { *(.init.ramfs) }
diff --git a/arch/sparc64/kernel/winfixup.S b/arch/sparc64/kernel/winfixup.S
index 39160926267b..c4aa110a10e5 100644
--- a/arch/sparc64/kernel/winfixup.S
+++ b/arch/sparc64/kernel/winfixup.S
@@ -1,8 +1,6 @@
1/* $Id: winfixup.S,v 1.30 2002/02/09 19:49:30 davem Exp $ 1/* winfixup.S: Handle cases where user stack pointer is found to be bogus.
2 * 2 *
3 * winfixup.S: Handle cases where user stack pointer is found to be bogus. 3 * Copyright (C) 1997, 2006 David S. Miller (davem@davemloft.net)
4 *
5 * Copyright (C) 1997 David S. Miller (davem@caip.rutgers.edu)
6 */ 4 */
7 5
8#include <asm/asi.h> 6#include <asm/asi.h>
@@ -15,374 +13,144 @@
15 13
16 .text 14 .text
17 15
18set_pcontext: 16 /* It used to be the case that these register window fault
19 sethi %hi(sparc64_kern_pri_context), %l1 17 * handlers could run via the save and restore instructions
20 ldx [%l1 + %lo(sparc64_kern_pri_context)], %l1 18 * done by the trap entry and exit code. They now do the
21 mov PRIMARY_CONTEXT, %g1 19 * window spill/fill by hand, so that case no longer can occur.
22 stxa %l1, [%g1] ASI_DMMU 20 */
23 flush %g6
24 retl
25 nop
26 21
27 .align 32 22 .align 32
28
29 /* Here are the rules, pay attention.
30 *
31 * The kernel is disallowed from touching user space while
32 * the trap level is greater than zero, except for from within
33 * the window spill/fill handlers. This must be followed
34 * so that we can easily detect the case where we tried to
35 * spill/fill with a bogus (or unmapped) user stack pointer.
36 *
37 * These are layed out in a special way for cache reasons,
38 * don't touch...
39 */
40 .globl fill_fixup, spill_fixup
41fill_fixup: 23fill_fixup:
42 rdpr %tstate, %g1 24 TRAP_LOAD_THREAD_REG(%g6, %g1)
43 andcc %g1, TSTATE_PRIV, %g0 25 rdpr %tstate, %g1
44 or %g4, FAULT_CODE_WINFIXUP, %g4 26 and %g1, TSTATE_CWP, %g1
45 be,pt %xcc, window_scheisse_from_user_common 27 or %g4, FAULT_CODE_WINFIXUP, %g4
46 and %g1, TSTATE_CWP, %g1 28 stb %g4, [%g6 + TI_FAULT_CODE]
47 29 stx %g5, [%g6 + TI_FAULT_ADDR]
48 /* This is the extremely complex case, but it does happen from 30 wrpr %g1, %cwp
49 * time to time if things are just right. Essentially the restore 31 ba,pt %xcc, etrap
50 * done in rtrap right before going back to user mode, with tl=1 32 rd %pc, %g7
51 * and that levels trap stack registers all setup, took a fill trap, 33 call do_sparc64_fault
52 * the user stack was not mapped in the tlb, and tlb miss occurred, 34 add %sp, PTREGS_OFF, %o0
53 * the pte found was not valid, and a simple ref bit watch update 35 ba,pt %xcc, rtrap_clr_l6
54 * could not satisfy the miss, so we got here.
55 *
56 * We must carefully unwind the state so we get back to tl=0, preserve
57 * all the register values we were going to give to the user. Luckily
58 * most things are where they need to be, we also have the address
59 * which triggered the fault handy as well.
60 *
61 * Also note that we must preserve %l5 and %l6. If the user was
62 * returning from a system call, we must make it look this way
63 * after we process the fill fault on the users stack.
64 *
65 * First, get into the window where the original restore was executed.
66 */
67
68 rdpr %wstate, %g2 ! Grab user mode wstate.
69 wrpr %g1, %cwp ! Get into the right window.
70 sll %g2, 3, %g2 ! NORMAL-->OTHER
71
72 wrpr %g0, 0x0, %canrestore ! Standard etrap stuff.
73 wrpr %g2, 0x0, %wstate ! This must be consistent.
74 wrpr %g0, 0x0, %otherwin ! We know this.
75 call set_pcontext ! Change contexts...
76 nop 36 nop
77 rdpr %pstate, %l1 ! Prepare to change globals.
78 mov %g6, %o7 ! Get current.
79
80 andn %l1, PSTATE_MM, %l1 ! We want to be in RMO
81 stb %g4, [%g6 + TI_FAULT_CODE]
82 stx %g5, [%g6 + TI_FAULT_ADDR]
83 wrpr %g0, 0x0, %tl ! Out of trap levels.
84 wrpr %l1, (PSTATE_IE | PSTATE_AG | PSTATE_RMO), %pstate
85 mov %o7, %g6
86 ldx [%g6 + TI_TASK], %g4
87#ifdef CONFIG_SMP
88 mov TSB_REG, %g1
89 ldxa [%g1] ASI_IMMU, %g5
90#endif
91 37
92 /* This is the same as below, except we handle this a bit special 38 /* Be very careful about usage of the trap globals here.
93 * since we must preserve %l5 and %l6, see comment above. 39 * You cannot touch %g5 as that has the fault information.
94 */
95 call do_sparc64_fault
96 add %sp, PTREGS_OFF, %o0
97 ba,pt %xcc, rtrap
98 nop ! yes, nop is correct
99
100 /* Be very careful about usage of the alternate globals here.
101 * You cannot touch %g4/%g5 as that has the fault information
102 * should this be from usermode. Also be careful for the case
103 * where we get here from the save instruction in etrap.S when
104 * coming from either user or kernel (does not matter which, it
105 * is the same problem in both cases). Essentially this means
106 * do not touch %g7 or %g2 so we handle the two cases fine.
107 */ 40 */
108spill_fixup: 41spill_fixup:
109 ldx [%g6 + TI_FLAGS], %g1 42spill_fixup_mna:
110 andcc %g1, _TIF_32BIT, %g0 43spill_fixup_dax:
111 ldub [%g6 + TI_WSAVED], %g1 44 TRAP_LOAD_THREAD_REG(%g6, %g1)
112 45 ldx [%g6 + TI_FLAGS], %g1
113 sll %g1, 3, %g3 46 andcc %g1, _TIF_32BIT, %g0
114 add %g6, %g3, %g3 47 ldub [%g6 + TI_WSAVED], %g1
115 stx %sp, [%g3 + TI_RWIN_SPTRS] 48 sll %g1, 3, %g3
116 sll %g1, 7, %g3 49 add %g6, %g3, %g3
117 bne,pt %xcc, 1f 50 stx %sp, [%g3 + TI_RWIN_SPTRS]
118 add %g6, %g3, %g3 51 sll %g1, 7, %g3
119 stx %l0, [%g3 + TI_REG_WINDOW + 0x00] 52 bne,pt %xcc, 1f
120 stx %l1, [%g3 + TI_REG_WINDOW + 0x08] 53 add %g6, %g3, %g3
121 54 stx %l0, [%g3 + TI_REG_WINDOW + 0x00]
122 stx %l2, [%g3 + TI_REG_WINDOW + 0x10] 55 stx %l1, [%g3 + TI_REG_WINDOW + 0x08]
123 stx %l3, [%g3 + TI_REG_WINDOW + 0x18] 56 stx %l2, [%g3 + TI_REG_WINDOW + 0x10]
124 stx %l4, [%g3 + TI_REG_WINDOW + 0x20] 57 stx %l3, [%g3 + TI_REG_WINDOW + 0x18]
125 stx %l5, [%g3 + TI_REG_WINDOW + 0x28] 58 stx %l4, [%g3 + TI_REG_WINDOW + 0x20]
126 stx %l6, [%g3 + TI_REG_WINDOW + 0x30] 59 stx %l5, [%g3 + TI_REG_WINDOW + 0x28]
127 stx %l7, [%g3 + TI_REG_WINDOW + 0x38] 60 stx %l6, [%g3 + TI_REG_WINDOW + 0x30]
128 stx %i0, [%g3 + TI_REG_WINDOW + 0x40] 61 stx %l7, [%g3 + TI_REG_WINDOW + 0x38]
129 stx %i1, [%g3 + TI_REG_WINDOW + 0x48] 62 stx %i0, [%g3 + TI_REG_WINDOW + 0x40]
130 63 stx %i1, [%g3 + TI_REG_WINDOW + 0x48]
131 stx %i2, [%g3 + TI_REG_WINDOW + 0x50] 64 stx %i2, [%g3 + TI_REG_WINDOW + 0x50]
132 stx %i3, [%g3 + TI_REG_WINDOW + 0x58] 65 stx %i3, [%g3 + TI_REG_WINDOW + 0x58]
133 stx %i4, [%g3 + TI_REG_WINDOW + 0x60] 66 stx %i4, [%g3 + TI_REG_WINDOW + 0x60]
134 stx %i5, [%g3 + TI_REG_WINDOW + 0x68] 67 stx %i5, [%g3 + TI_REG_WINDOW + 0x68]
135 stx %i6, [%g3 + TI_REG_WINDOW + 0x70] 68 stx %i6, [%g3 + TI_REG_WINDOW + 0x70]
136 b,pt %xcc, 2f 69 ba,pt %xcc, 2f
137 stx %i7, [%g3 + TI_REG_WINDOW + 0x78] 70 stx %i7, [%g3 + TI_REG_WINDOW + 0x78]
1381: stw %l0, [%g3 + TI_REG_WINDOW + 0x00] 711: stw %l0, [%g3 + TI_REG_WINDOW + 0x00]
139 72 stw %l1, [%g3 + TI_REG_WINDOW + 0x04]
140 stw %l1, [%g3 + TI_REG_WINDOW + 0x04] 73 stw %l2, [%g3 + TI_REG_WINDOW + 0x08]
141 stw %l2, [%g3 + TI_REG_WINDOW + 0x08] 74 stw %l3, [%g3 + TI_REG_WINDOW + 0x0c]
142 stw %l3, [%g3 + TI_REG_WINDOW + 0x0c] 75 stw %l4, [%g3 + TI_REG_WINDOW + 0x10]
143 stw %l4, [%g3 + TI_REG_WINDOW + 0x10] 76 stw %l5, [%g3 + TI_REG_WINDOW + 0x14]
144 stw %l5, [%g3 + TI_REG_WINDOW + 0x14] 77 stw %l6, [%g3 + TI_REG_WINDOW + 0x18]
145 stw %l6, [%g3 + TI_REG_WINDOW + 0x18] 78 stw %l7, [%g3 + TI_REG_WINDOW + 0x1c]
146 stw %l7, [%g3 + TI_REG_WINDOW + 0x1c] 79 stw %i0, [%g3 + TI_REG_WINDOW + 0x20]
147 stw %i0, [%g3 + TI_REG_WINDOW + 0x20] 80 stw %i1, [%g3 + TI_REG_WINDOW + 0x24]
148 81 stw %i2, [%g3 + TI_REG_WINDOW + 0x28]
149 stw %i1, [%g3 + TI_REG_WINDOW + 0x24] 82 stw %i3, [%g3 + TI_REG_WINDOW + 0x2c]
150 stw %i2, [%g3 + TI_REG_WINDOW + 0x28] 83 stw %i4, [%g3 + TI_REG_WINDOW + 0x30]
151 stw %i3, [%g3 + TI_REG_WINDOW + 0x2c] 84 stw %i5, [%g3 + TI_REG_WINDOW + 0x34]
152 stw %i4, [%g3 + TI_REG_WINDOW + 0x30] 85 stw %i6, [%g3 + TI_REG_WINDOW + 0x38]
153 stw %i5, [%g3 + TI_REG_WINDOW + 0x34] 86 stw %i7, [%g3 + TI_REG_WINDOW + 0x3c]
154 stw %i6, [%g3 + TI_REG_WINDOW + 0x38] 872: add %g1, 1, %g1
155 stw %i7, [%g3 + TI_REG_WINDOW + 0x3c] 88 stb %g1, [%g6 + TI_WSAVED]
1562: add %g1, 1, %g1 89 rdpr %tstate, %g1
157 90 andcc %g1, TSTATE_PRIV, %g0
158 stb %g1, [%g6 + TI_WSAVED]
159 rdpr %tstate, %g1
160 andcc %g1, TSTATE_PRIV, %g0
161 saved 91 saved
162 and %g1, TSTATE_CWP, %g1 92 be,pn %xcc, 1f
163 be,pn %xcc, window_scheisse_from_user_common 93 and %g1, TSTATE_CWP, %g1
164 mov FAULT_CODE_WRITE | FAULT_CODE_DTLB | FAULT_CODE_WINFIXUP, %g4
165 retry 94 retry
951: mov FAULT_CODE_WRITE | FAULT_CODE_DTLB | FAULT_CODE_WINFIXUP, %g4
96 stb %g4, [%g6 + TI_FAULT_CODE]
97 stx %g5, [%g6 + TI_FAULT_ADDR]
98 wrpr %g1, %cwp
99 ba,pt %xcc, etrap
100 rd %pc, %g7
101 call do_sparc64_fault
102 add %sp, PTREGS_OFF, %o0
103 ba,a,pt %xcc, rtrap_clr_l6
166 104
167window_scheisse_from_user_common:
168 stb %g4, [%g6 + TI_FAULT_CODE]
169 stx %g5, [%g6 + TI_FAULT_ADDR]
170 wrpr %g1, %cwp
171 ba,pt %xcc, etrap
172 rd %pc, %g7
173 call do_sparc64_fault
174 add %sp, PTREGS_OFF, %o0
175 ba,a,pt %xcc, rtrap_clr_l6
176
177 .globl winfix_mna, fill_fixup_mna, spill_fixup_mna
178winfix_mna: 105winfix_mna:
179 andn %g3, 0x7f, %g3 106 andn %g3, 0x7f, %g3
180 add %g3, 0x78, %g3 107 add %g3, 0x78, %g3
181 wrpr %g3, %tnpc 108 wrpr %g3, %tnpc
182 done 109 done
183fill_fixup_mna:
184 rdpr %tstate, %g1
185 andcc %g1, TSTATE_PRIV, %g0
186 be,pt %xcc, window_mna_from_user_common
187 and %g1, TSTATE_CWP, %g1
188 110
189 /* Please, see fill_fixup commentary about why we must preserve 111fill_fixup_mna:
190 * %l5 and %l6 to preserve absolute correct semantics. 112 rdpr %tstate, %g1
191 */ 113 and %g1, TSTATE_CWP, %g1
192 rdpr %wstate, %g2 ! Grab user mode wstate. 114 wrpr %g1, %cwp
193 wrpr %g1, %cwp ! Get into the right window. 115 ba,pt %xcc, etrap
194 sll %g2, 3, %g2 ! NORMAL-->OTHER 116 rd %pc, %g7
195 wrpr %g0, 0x0, %canrestore ! Standard etrap stuff. 117 sethi %hi(tlb_type), %g1
196 118 lduw [%g1 + %lo(tlb_type)], %g1
197 wrpr %g2, 0x0, %wstate ! This must be consistent. 119 cmp %g1, 3
198 wrpr %g0, 0x0, %otherwin ! We know this. 120 bne,pt %icc, 1f
199 call set_pcontext ! Change contexts... 121 add %sp, PTREGS_OFF, %o0
122 mov %l4, %o2
123 call sun4v_do_mna
124 mov %l5, %o1
125 ba,a,pt %xcc, rtrap_clr_l6
1261: mov %l4, %o1
127 mov %l5, %o2
128 call mem_address_unaligned
200 nop 129 nop
201 rdpr %pstate, %l1 ! Prepare to change globals. 130 ba,a,pt %xcc, rtrap_clr_l6
202 mov %g4, %o2 ! Setup args for
203 mov %g5, %o1 ! final call to mem_address_unaligned.
204 andn %l1, PSTATE_MM, %l1 ! We want to be in RMO
205 131
206 mov %g6, %o7 ! Stash away current.
207 wrpr %g0, 0x0, %tl ! Out of trap levels.
208 wrpr %l1, (PSTATE_IE | PSTATE_AG | PSTATE_RMO), %pstate
209 mov %o7, %g6 ! Get current back.
210 ldx [%g6 + TI_TASK], %g4 ! Finish it.
211#ifdef CONFIG_SMP
212 mov TSB_REG, %g1
213 ldxa [%g1] ASI_IMMU, %g5
214#endif
215 call mem_address_unaligned
216 add %sp, PTREGS_OFF, %o0
217
218 b,pt %xcc, rtrap
219 nop ! yes, the nop is correct
220spill_fixup_mna:
221 ldx [%g6 + TI_FLAGS], %g1
222 andcc %g1, _TIF_32BIT, %g0
223 ldub [%g6 + TI_WSAVED], %g1
224 sll %g1, 3, %g3
225 add %g6, %g3, %g3
226 stx %sp, [%g3 + TI_RWIN_SPTRS]
227
228 sll %g1, 7, %g3
229 bne,pt %xcc, 1f
230 add %g6, %g3, %g3
231 stx %l0, [%g3 + TI_REG_WINDOW + 0x00]
232 stx %l1, [%g3 + TI_REG_WINDOW + 0x08]
233 stx %l2, [%g3 + TI_REG_WINDOW + 0x10]
234 stx %l3, [%g3 + TI_REG_WINDOW + 0x18]
235 stx %l4, [%g3 + TI_REG_WINDOW + 0x20]
236
237 stx %l5, [%g3 + TI_REG_WINDOW + 0x28]
238 stx %l6, [%g3 + TI_REG_WINDOW + 0x30]
239 stx %l7, [%g3 + TI_REG_WINDOW + 0x38]
240 stx %i0, [%g3 + TI_REG_WINDOW + 0x40]
241 stx %i1, [%g3 + TI_REG_WINDOW + 0x48]
242 stx %i2, [%g3 + TI_REG_WINDOW + 0x50]
243 stx %i3, [%g3 + TI_REG_WINDOW + 0x58]
244 stx %i4, [%g3 + TI_REG_WINDOW + 0x60]
245
246 stx %i5, [%g3 + TI_REG_WINDOW + 0x68]
247 stx %i6, [%g3 + TI_REG_WINDOW + 0x70]
248 stx %i7, [%g3 + TI_REG_WINDOW + 0x78]
249 b,pt %xcc, 2f
250 add %g1, 1, %g1
2511: std %l0, [%g3 + TI_REG_WINDOW + 0x00]
252 std %l2, [%g3 + TI_REG_WINDOW + 0x08]
253 std %l4, [%g3 + TI_REG_WINDOW + 0x10]
254
255 std %l6, [%g3 + TI_REG_WINDOW + 0x18]
256 std %i0, [%g3 + TI_REG_WINDOW + 0x20]
257 std %i2, [%g3 + TI_REG_WINDOW + 0x28]
258 std %i4, [%g3 + TI_REG_WINDOW + 0x30]
259 std %i6, [%g3 + TI_REG_WINDOW + 0x38]
260 add %g1, 1, %g1
2612: stb %g1, [%g6 + TI_WSAVED]
262 rdpr %tstate, %g1
263
264 andcc %g1, TSTATE_PRIV, %g0
265 saved
266 be,pn %xcc, window_mna_from_user_common
267 and %g1, TSTATE_CWP, %g1
268 retry
269window_mna_from_user_common:
270 wrpr %g1, %cwp
271 sethi %hi(109f), %g7
272 ba,pt %xcc, etrap
273109: or %g7, %lo(109b), %g7
274 mov %l4, %o2
275 mov %l5, %o1
276 call mem_address_unaligned
277 add %sp, PTREGS_OFF, %o0
278 ba,pt %xcc, rtrap
279 clr %l6
280
281 /* These are only needed for 64-bit mode processes which
282 * put their stack pointer into the VPTE area and there
283 * happens to be a VPTE tlb entry mapped there during
284 * a spill/fill trap to that stack frame.
285 */
286 .globl winfix_dax, fill_fixup_dax, spill_fixup_dax
287winfix_dax: 132winfix_dax:
288 andn %g3, 0x7f, %g3 133 andn %g3, 0x7f, %g3
289 add %g3, 0x74, %g3 134 add %g3, 0x74, %g3
290 wrpr %g3, %tnpc 135 wrpr %g3, %tnpc
291 done 136 done
292fill_fixup_dax:
293 rdpr %tstate, %g1
294 andcc %g1, TSTATE_PRIV, %g0
295 be,pt %xcc, window_dax_from_user_common
296 and %g1, TSTATE_CWP, %g1
297
298 /* Please, see fill_fixup commentary about why we must preserve
299 * %l5 and %l6 to preserve absolute correct semantics.
300 */
301 rdpr %wstate, %g2 ! Grab user mode wstate.
302 wrpr %g1, %cwp ! Get into the right window.
303 sll %g2, 3, %g2 ! NORMAL-->OTHER
304 wrpr %g0, 0x0, %canrestore ! Standard etrap stuff.
305 137
306 wrpr %g2, 0x0, %wstate ! This must be consistent. 138fill_fixup_dax:
307 wrpr %g0, 0x0, %otherwin ! We know this. 139 rdpr %tstate, %g1
308 call set_pcontext ! Change contexts... 140 and %g1, TSTATE_CWP, %g1
141 wrpr %g1, %cwp
142 ba,pt %xcc, etrap
143 rd %pc, %g7
144 sethi %hi(tlb_type), %g1
145 mov %l4, %o1
146 lduw [%g1 + %lo(tlb_type)], %g1
147 mov %l5, %o2
148 cmp %g1, 3
149 bne,pt %icc, 1f
150 add %sp, PTREGS_OFF, %o0
151 call sun4v_data_access_exception
309 nop 152 nop
310 rdpr %pstate, %l1 ! Prepare to change globals. 153 ba,a,pt %xcc, rtrap_clr_l6
311 mov %g4, %o1 ! Setup args for 1541: call spitfire_data_access_exception
312 mov %g5, %o2 ! final call to spitfire_data_access_exception. 155 nop
313 andn %l1, PSTATE_MM, %l1 ! We want to be in RMO 156 ba,a,pt %xcc, rtrap_clr_l6
314
315 mov %g6, %o7 ! Stash away current.
316 wrpr %g0, 0x0, %tl ! Out of trap levels.
317 wrpr %l1, (PSTATE_IE | PSTATE_AG | PSTATE_RMO), %pstate
318 mov %o7, %g6 ! Get current back.
319 ldx [%g6 + TI_TASK], %g4 ! Finish it.
320#ifdef CONFIG_SMP
321 mov TSB_REG, %g1
322 ldxa [%g1] ASI_IMMU, %g5
323#endif
324 call spitfire_data_access_exception
325 add %sp, PTREGS_OFF, %o0
326
327 b,pt %xcc, rtrap
328 nop ! yes, the nop is correct
329spill_fixup_dax:
330 ldx [%g6 + TI_FLAGS], %g1
331 andcc %g1, _TIF_32BIT, %g0
332 ldub [%g6 + TI_WSAVED], %g1
333 sll %g1, 3, %g3
334 add %g6, %g3, %g3
335 stx %sp, [%g3 + TI_RWIN_SPTRS]
336
337 sll %g1, 7, %g3
338 bne,pt %xcc, 1f
339 add %g6, %g3, %g3
340 stx %l0, [%g3 + TI_REG_WINDOW + 0x00]
341 stx %l1, [%g3 + TI_REG_WINDOW + 0x08]
342 stx %l2, [%g3 + TI_REG_WINDOW + 0x10]
343 stx %l3, [%g3 + TI_REG_WINDOW + 0x18]
344 stx %l4, [%g3 + TI_REG_WINDOW + 0x20]
345
346 stx %l5, [%g3 + TI_REG_WINDOW + 0x28]
347 stx %l6, [%g3 + TI_REG_WINDOW + 0x30]
348 stx %l7, [%g3 + TI_REG_WINDOW + 0x38]
349 stx %i0, [%g3 + TI_REG_WINDOW + 0x40]
350 stx %i1, [%g3 + TI_REG_WINDOW + 0x48]
351 stx %i2, [%g3 + TI_REG_WINDOW + 0x50]
352 stx %i3, [%g3 + TI_REG_WINDOW + 0x58]
353 stx %i4, [%g3 + TI_REG_WINDOW + 0x60]
354
355 stx %i5, [%g3 + TI_REG_WINDOW + 0x68]
356 stx %i6, [%g3 + TI_REG_WINDOW + 0x70]
357 stx %i7, [%g3 + TI_REG_WINDOW + 0x78]
358 b,pt %xcc, 2f
359 add %g1, 1, %g1
3601: std %l0, [%g3 + TI_REG_WINDOW + 0x00]
361 std %l2, [%g3 + TI_REG_WINDOW + 0x08]
362 std %l4, [%g3 + TI_REG_WINDOW + 0x10]
363
364 std %l6, [%g3 + TI_REG_WINDOW + 0x18]
365 std %i0, [%g3 + TI_REG_WINDOW + 0x20]
366 std %i2, [%g3 + TI_REG_WINDOW + 0x28]
367 std %i4, [%g3 + TI_REG_WINDOW + 0x30]
368 std %i6, [%g3 + TI_REG_WINDOW + 0x38]
369 add %g1, 1, %g1
3702: stb %g1, [%g6 + TI_WSAVED]
371 rdpr %tstate, %g1
372
373 andcc %g1, TSTATE_PRIV, %g0
374 saved
375 be,pn %xcc, window_dax_from_user_common
376 and %g1, TSTATE_CWP, %g1
377 retry
378window_dax_from_user_common:
379 wrpr %g1, %cwp
380 sethi %hi(109f), %g7
381 ba,pt %xcc, etrap
382109: or %g7, %lo(109b), %g7
383 mov %l4, %o1
384 mov %l5, %o2
385 call spitfire_data_access_exception
386 add %sp, PTREGS_OFF, %o0
387 ba,pt %xcc, rtrap
388 clr %l6
diff --git a/arch/sparc64/lib/Makefile b/arch/sparc64/lib/Makefile
index c295806500f7..4a725d8985f1 100644
--- a/arch/sparc64/lib/Makefile
+++ b/arch/sparc64/lib/Makefile
@@ -11,7 +11,9 @@ lib-y := PeeCeeI.o copy_page.o clear_page.o strlen.o strncmp.o \
11 VISsave.o atomic.o bitops.o \ 11 VISsave.o atomic.o bitops.o \
12 U1memcpy.o U1copy_from_user.o U1copy_to_user.o \ 12 U1memcpy.o U1copy_from_user.o U1copy_to_user.o \
13 U3memcpy.o U3copy_from_user.o U3copy_to_user.o U3patch.o \ 13 U3memcpy.o U3copy_from_user.o U3copy_to_user.o U3patch.o \
14 NGmemcpy.o NGcopy_from_user.o NGcopy_to_user.o NGpatch.o \
15 NGpage.o NGbzero.o \
14 copy_in_user.o user_fixup.o memmove.o \ 16 copy_in_user.o user_fixup.o memmove.o \
15 mcount.o ipcsum.o rwsem.o xor.o find_bit.o delay.o 17 mcount.o ipcsum.o rwsem.o xor.o delay.o
16 18
17obj-y += iomap.o 19obj-y += iomap.o
diff --git a/arch/sparc64/lib/NGbzero.S b/arch/sparc64/lib/NGbzero.S
new file mode 100644
index 000000000000..e86baece5cc8
--- /dev/null
+++ b/arch/sparc64/lib/NGbzero.S
@@ -0,0 +1,163 @@
1/* NGbzero.S: Niagara optimized memset/clear_user.
2 *
3 * Copyright (C) 2006 David S. Miller (davem@davemloft.net)
4 */
5#include <asm/asi.h>
6
7#define EX_ST(x,y) \
898: x,y; \
9 .section .fixup; \
10 .align 4; \
1199: retl; \
12 mov %o1, %o0; \
13 .section __ex_table; \
14 .align 4; \
15 .word 98b, 99b; \
16 .text; \
17 .align 4;
18
19 .text
20
21 .globl NGmemset
22 .type NGmemset, #function
23NGmemset: /* %o0=buf, %o1=pat, %o2=len */
24 and %o1, 0xff, %o3
25 mov %o2, %o1
26 sllx %o3, 8, %g1
27 or %g1, %o3, %o2
28 sllx %o2, 16, %g1
29 or %g1, %o2, %o2
30 sllx %o2, 32, %g1
31 ba,pt %xcc, 1f
32 or %g1, %o2, %o2
33
34 .globl NGbzero
35 .type NGbzero, #function
36NGbzero:
37 clr %o2
381: brz,pn %o1, NGbzero_return
39 mov %o0, %o3
40
41 /* %o5: saved %asi, restored at NGbzero_done
42 * %g7: store-init %asi to use
43 * %o4: non-store-init %asi to use
44 */
45 rd %asi, %o5
46 mov ASI_BLK_INIT_QUAD_LDD_P, %g7
47 mov ASI_P, %o4
48 wr %o4, 0x0, %asi
49
50NGbzero_from_clear_user:
51 cmp %o1, 15
52 bl,pn %icc, NGbzero_tiny
53 andcc %o0, 0x7, %g1
54 be,pt %xcc, 2f
55 mov 8, %g2
56 sub %g2, %g1, %g1
57 sub %o1, %g1, %o1
581: EX_ST(stba %o2, [%o0 + 0x00] %asi)
59 subcc %g1, 1, %g1
60 bne,pt %xcc, 1b
61 add %o0, 1, %o0
622: cmp %o1, 128
63 bl,pn %icc, NGbzero_medium
64 andcc %o0, (64 - 1), %g1
65 be,pt %xcc, NGbzero_pre_loop
66 mov 64, %g2
67 sub %g2, %g1, %g1
68 sub %o1, %g1, %o1
691: EX_ST(stxa %o2, [%o0 + 0x00] %asi)
70 subcc %g1, 8, %g1
71 bne,pt %xcc, 1b
72 add %o0, 8, %o0
73
74NGbzero_pre_loop:
75 wr %g7, 0x0, %asi
76 andn %o1, (64 - 1), %g1
77 sub %o1, %g1, %o1
78NGbzero_loop:
79 EX_ST(stxa %o2, [%o0 + 0x00] %asi)
80 EX_ST(stxa %o2, [%o0 + 0x08] %asi)
81 EX_ST(stxa %o2, [%o0 + 0x10] %asi)
82 EX_ST(stxa %o2, [%o0 + 0x18] %asi)
83 EX_ST(stxa %o2, [%o0 + 0x20] %asi)
84 EX_ST(stxa %o2, [%o0 + 0x28] %asi)
85 EX_ST(stxa %o2, [%o0 + 0x30] %asi)
86 EX_ST(stxa %o2, [%o0 + 0x38] %asi)
87 subcc %g1, 64, %g1
88 bne,pt %xcc, NGbzero_loop
89 add %o0, 64, %o0
90
91 wr %o4, 0x0, %asi
92 brz,pn %o1, NGbzero_done
93NGbzero_medium:
94 andncc %o1, 0x7, %g1
95 be,pn %xcc, 2f
96 sub %o1, %g1, %o1
971: EX_ST(stxa %o2, [%o0 + 0x00] %asi)
98 subcc %g1, 8, %g1
99 bne,pt %xcc, 1b
100 add %o0, 8, %o0
1012: brz,pt %o1, NGbzero_done
102 nop
103
104NGbzero_tiny:
1051: EX_ST(stba %o2, [%o0 + 0x00] %asi)
106 subcc %o1, 1, %o1
107 bne,pt %icc, 1b
108 add %o0, 1, %o0
109
110 /* fallthrough */
111
112NGbzero_done:
113 wr %o5, 0x0, %asi
114
115NGbzero_return:
116 retl
117 mov %o3, %o0
118 .size NGbzero, .-NGbzero
119 .size NGmemset, .-NGmemset
120
121 .globl NGclear_user
122 .type NGclear_user, #function
123NGclear_user: /* %o0=buf, %o1=len */
124 rd %asi, %o5
125 brz,pn %o1, NGbzero_done
126 clr %o3
127 cmp %o5, ASI_AIUS
128 bne,pn %icc, NGbzero
129 clr %o2
130 mov ASI_BLK_INIT_QUAD_LDD_AIUS, %g7
131 ba,pt %xcc, NGbzero_from_clear_user
132 mov ASI_AIUS, %o4
133 .size NGclear_user, .-NGclear_user
134
135#define BRANCH_ALWAYS 0x10680000
136#define NOP 0x01000000
137#define NG_DO_PATCH(OLD, NEW) \
138 sethi %hi(NEW), %g1; \
139 or %g1, %lo(NEW), %g1; \
140 sethi %hi(OLD), %g2; \
141 or %g2, %lo(OLD), %g2; \
142 sub %g1, %g2, %g1; \
143 sethi %hi(BRANCH_ALWAYS), %g3; \
144 sll %g1, 11, %g1; \
145 srl %g1, 11 + 2, %g1; \
146 or %g3, %lo(BRANCH_ALWAYS), %g3; \
147 or %g3, %g1, %g3; \
148 stw %g3, [%g2]; \
149 sethi %hi(NOP), %g3; \
150 or %g3, %lo(NOP), %g3; \
151 stw %g3, [%g2 + 0x4]; \
152 flush %g2;
153
154 .globl niagara_patch_bzero
155 .type niagara_patch_bzero,#function
156niagara_patch_bzero:
157 NG_DO_PATCH(memset, NGmemset)
158 NG_DO_PATCH(__bzero, NGbzero)
159 NG_DO_PATCH(__clear_user, NGclear_user)
160 NG_DO_PATCH(tsb_init, NGtsb_init)
161 retl
162 nop
163 .size niagara_patch_bzero,.-niagara_patch_bzero
diff --git a/arch/sparc64/lib/NGcopy_from_user.S b/arch/sparc64/lib/NGcopy_from_user.S
new file mode 100644
index 000000000000..2d93456f76dd
--- /dev/null
+++ b/arch/sparc64/lib/NGcopy_from_user.S
@@ -0,0 +1,37 @@
1/* NGcopy_from_user.S: Niagara optimized copy from userspace.
2 *
3 * Copyright (C) 2006 David S. Miller (davem@davemloft.net)
4 */
5
6#define EX_LD(x) \
798: x; \
8 .section .fixup; \
9 .align 4; \
1099: wr %g0, ASI_AIUS, %asi;\
11 retl; \
12 mov 1, %o0; \
13 .section __ex_table,"a";\
14 .align 4; \
15 .word 98b, 99b; \
16 .text; \
17 .align 4;
18
19#ifndef ASI_AIUS
20#define ASI_AIUS 0x11
21#endif
22
23#define FUNC_NAME NGcopy_from_user
24#define LOAD(type,addr,dest) type##a [addr] ASI_AIUS, dest
25#define LOAD_TWIN(addr_reg,dest0,dest1) \
26 ldda [addr_reg] ASI_BLK_INIT_QUAD_LDD_AIUS, dest0
27#define EX_RETVAL(x) 0
28
29#ifdef __KERNEL__
30#define PREAMBLE \
31 rd %asi, %g1; \
32 cmp %g1, ASI_AIUS; \
33 bne,pn %icc, memcpy_user_stub; \
34 nop
35#endif
36
37#include "NGmemcpy.S"
diff --git a/arch/sparc64/lib/NGcopy_to_user.S b/arch/sparc64/lib/NGcopy_to_user.S
new file mode 100644
index 000000000000..34112d5054ef
--- /dev/null
+++ b/arch/sparc64/lib/NGcopy_to_user.S
@@ -0,0 +1,40 @@
1/* NGcopy_to_user.S: Niagara optimized copy to userspace.
2 *
3 * Copyright (C) 2006 David S. Miller (davem@davemloft.net)
4 */
5
6#define EX_ST(x) \
798: x; \
8 .section .fixup; \
9 .align 4; \
1099: wr %g0, ASI_AIUS, %asi;\
11 retl; \
12 mov 1, %o0; \
13 .section __ex_table,"a";\
14 .align 4; \
15 .word 98b, 99b; \
16 .text; \
17 .align 4;
18
19#ifndef ASI_AIUS
20#define ASI_AIUS 0x11
21#endif
22
23#define FUNC_NAME NGcopy_to_user
24#define STORE(type,src,addr) type##a src, [addr] ASI_AIUS
25#define STORE_ASI ASI_BLK_INIT_QUAD_LDD_AIUS
26#define EX_RETVAL(x) 0
27
28#ifdef __KERNEL__
29 /* Writing to %asi is _expensive_ so we hardcode it.
30 * Reading %asi to check for KERNEL_DS is comparatively
31 * cheap.
32 */
33#define PREAMBLE \
34 rd %asi, %g1; \
35 cmp %g1, ASI_AIUS; \
36 bne,pn %icc, memcpy_user_stub; \
37 nop
38#endif
39
40#include "NGmemcpy.S"
diff --git a/arch/sparc64/lib/NGmemcpy.S b/arch/sparc64/lib/NGmemcpy.S
new file mode 100644
index 000000000000..8e522b3dc095
--- /dev/null
+++ b/arch/sparc64/lib/NGmemcpy.S
@@ -0,0 +1,368 @@
1/* NGmemcpy.S: Niagara optimized memcpy.
2 *
3 * Copyright (C) 2006 David S. Miller (davem@davemloft.net)
4 */
5
6#ifdef __KERNEL__
7#include <asm/asi.h>
8#include <asm/thread_info.h>
9#define GLOBAL_SPARE %g7
10#define RESTORE_ASI(TMP) \
11 ldub [%g6 + TI_CURRENT_DS], TMP; \
12 wr TMP, 0x0, %asi;
13#else
14#define GLOBAL_SPARE %g5
15#define RESTORE_ASI(TMP) \
16 wr %g0, ASI_PNF, %asi
17#endif
18
19#ifndef STORE_ASI
20#define STORE_ASI ASI_BLK_INIT_QUAD_LDD_P
21#endif
22
23#ifndef EX_LD
24#define EX_LD(x) x
25#endif
26
27#ifndef EX_ST
28#define EX_ST(x) x
29#endif
30
31#ifndef EX_RETVAL
32#define EX_RETVAL(x) x
33#endif
34
35#ifndef LOAD
36#ifndef MEMCPY_DEBUG
37#define LOAD(type,addr,dest) type [addr], dest
38#else
39#define LOAD(type,addr,dest) type##a [addr] 0x80, dest
40#endif
41#endif
42
43#ifndef LOAD_TWIN
44#define LOAD_TWIN(addr_reg,dest0,dest1) \
45 ldda [addr_reg] ASI_BLK_INIT_QUAD_LDD_P, dest0
46#endif
47
48#ifndef STORE
49#define STORE(type,src,addr) type src, [addr]
50#endif
51
52#ifndef STORE_INIT
53#define STORE_INIT(src,addr) stxa src, [addr] %asi
54#endif
55
56#ifndef FUNC_NAME
57#define FUNC_NAME NGmemcpy
58#endif
59
60#ifndef PREAMBLE
61#define PREAMBLE
62#endif
63
64#ifndef XCC
65#define XCC xcc
66#endif
67
68 .register %g2,#scratch
69 .register %g3,#scratch
70
71 .text
72 .align 64
73
74 .globl FUNC_NAME
75 .type FUNC_NAME,#function
76FUNC_NAME: /* %o0=dst, %o1=src, %o2=len */
77 srlx %o2, 31, %g2
78 cmp %g2, 0
79 tne %xcc, 5
80 PREAMBLE
81 mov %o0, GLOBAL_SPARE
82 cmp %o2, 0
83 be,pn %XCC, 85f
84 or %o0, %o1, %o3
85 cmp %o2, 16
86 blu,a,pn %XCC, 80f
87 or %o3, %o2, %o3
88
89 /* 2 blocks (128 bytes) is the minimum we can do the block
90 * copy with. We need to ensure that we'll iterate at least
91 * once in the block copy loop. At worst we'll need to align
92 * the destination to a 64-byte boundary which can chew up
93 * to (64 - 1) bytes from the length before we perform the
94 * block copy loop.
95 */
96 cmp %o2, (2 * 64)
97 blu,pt %XCC, 70f
98 andcc %o3, 0x7, %g0
99
100 /* %o0: dst
101 * %o1: src
102 * %o2: len (known to be >= 128)
103 *
104 * The block copy loops will use %o4/%o5,%g2/%g3 as
105 * temporaries while copying the data.
106 */
107
108 LOAD(prefetch, %o1, #one_read)
109 wr %g0, STORE_ASI, %asi
110
111 /* Align destination on 64-byte boundary. */
112 andcc %o0, (64 - 1), %o4
113 be,pt %XCC, 2f
114 sub %o4, 64, %o4
115 sub %g0, %o4, %o4 ! bytes to align dst
116 sub %o2, %o4, %o2
1171: subcc %o4, 1, %o4
118 EX_LD(LOAD(ldub, %o1, %g1))
119 EX_ST(STORE(stb, %g1, %o0))
120 add %o1, 1, %o1
121 bne,pt %XCC, 1b
122 add %o0, 1, %o0
123
124 /* If the source is on a 16-byte boundary we can do
125 * the direct block copy loop. If it is 8-byte aligned
126 * we can do the 16-byte loads offset by -8 bytes and the
127 * init stores offset by one register.
128 *
129 * If the source is not even 8-byte aligned, we need to do
130 * shifting and masking (basically integer faligndata).
131 *
132 * The careful bit with init stores is that if we store
133 * to any part of the cache line we have to store the whole
134 * cacheline else we can end up with corrupt L2 cache line
135 * contents. Since the loop works on 64-bytes of 64-byte
136 * aligned store data at a time, this is easy to ensure.
137 */
1382:
139 andcc %o1, (16 - 1), %o4
140 andn %o2, (64 - 1), %g1 ! block copy loop iterator
141 sub %o2, %g1, %o2 ! final sub-block copy bytes
142 be,pt %XCC, 50f
143 cmp %o4, 8
144 be,a,pt %XCC, 10f
145 sub %o1, 0x8, %o1
146
147 /* Neither 8-byte nor 16-byte aligned, shift and mask. */
148 mov %g1, %o4
149 and %o1, 0x7, %g1
150 sll %g1, 3, %g1
151 mov 64, %o3
152 andn %o1, 0x7, %o1
153 EX_LD(LOAD(ldx, %o1, %g2))
154 sub %o3, %g1, %o3
155 sllx %g2, %g1, %g2
156
157#define SWIVEL_ONE_DWORD(SRC, TMP1, TMP2, PRE_VAL, PRE_SHIFT, POST_SHIFT, DST)\
158 EX_LD(LOAD(ldx, SRC, TMP1)); \
159 srlx TMP1, PRE_SHIFT, TMP2; \
160 or TMP2, PRE_VAL, TMP2; \
161 EX_ST(STORE_INIT(TMP2, DST)); \
162 sllx TMP1, POST_SHIFT, PRE_VAL;
163
1641: add %o1, 0x8, %o1
165 SWIVEL_ONE_DWORD(%o1, %g3, %o5, %g2, %o3, %g1, %o0 + 0x00)
166 add %o1, 0x8, %o1
167 SWIVEL_ONE_DWORD(%o1, %g3, %o5, %g2, %o3, %g1, %o0 + 0x08)
168 add %o1, 0x8, %o1
169 SWIVEL_ONE_DWORD(%o1, %g3, %o5, %g2, %o3, %g1, %o0 + 0x10)
170 add %o1, 0x8, %o1
171 SWIVEL_ONE_DWORD(%o1, %g3, %o5, %g2, %o3, %g1, %o0 + 0x18)
172 add %o1, 32, %o1
173 LOAD(prefetch, %o1, #one_read)
174 sub %o1, 32 - 8, %o1
175 SWIVEL_ONE_DWORD(%o1, %g3, %o5, %g2, %o3, %g1, %o0 + 0x20)
176 add %o1, 8, %o1
177 SWIVEL_ONE_DWORD(%o1, %g3, %o5, %g2, %o3, %g1, %o0 + 0x28)
178 add %o1, 8, %o1
179 SWIVEL_ONE_DWORD(%o1, %g3, %o5, %g2, %o3, %g1, %o0 + 0x30)
180 add %o1, 8, %o1
181 SWIVEL_ONE_DWORD(%o1, %g3, %o5, %g2, %o3, %g1, %o0 + 0x38)
182 subcc %o4, 64, %o4
183 bne,pt %XCC, 1b
184 add %o0, 64, %o0
185
186#undef SWIVEL_ONE_DWORD
187
188 srl %g1, 3, %g1
189 ba,pt %XCC, 60f
190 add %o1, %g1, %o1
191
19210: /* Destination is 64-byte aligned, source was only 8-byte
193 * aligned but it has been subtracted by 8 and we perform
194 * one twin load ahead, then add 8 back into source when
195 * we finish the loop.
196 */
197 EX_LD(LOAD_TWIN(%o1, %o4, %o5))
1981: add %o1, 16, %o1
199 EX_LD(LOAD_TWIN(%o1, %g2, %g3))
200 add %o1, 16 + 32, %o1
201 LOAD(prefetch, %o1, #one_read)
202 sub %o1, 32, %o1
203 EX_ST(STORE_INIT(%o5, %o0 + 0x00)) ! initializes cache line
204 EX_ST(STORE_INIT(%g2, %o0 + 0x08))
205 EX_LD(LOAD_TWIN(%o1, %o4, %o5))
206 add %o1, 16, %o1
207 EX_ST(STORE_INIT(%g3, %o0 + 0x10))
208 EX_ST(STORE_INIT(%o4, %o0 + 0x18))
209 EX_LD(LOAD_TWIN(%o1, %g2, %g3))
210 add %o1, 16, %o1
211 EX_ST(STORE_INIT(%o5, %o0 + 0x20))
212 EX_ST(STORE_INIT(%g2, %o0 + 0x28))
213 EX_LD(LOAD_TWIN(%o1, %o4, %o5))
214 EX_ST(STORE_INIT(%g3, %o0 + 0x30))
215 EX_ST(STORE_INIT(%o4, %o0 + 0x38))
216 subcc %g1, 64, %g1
217 bne,pt %XCC, 1b
218 add %o0, 64, %o0
219
220 ba,pt %XCC, 60f
221 add %o1, 0x8, %o1
222
22350: /* Destination is 64-byte aligned, and source is 16-byte
224 * aligned.
225 */
2261: EX_LD(LOAD_TWIN(%o1, %o4, %o5))
227 add %o1, 16, %o1
228 EX_LD(LOAD_TWIN(%o1, %g2, %g3))
229 add %o1, 16 + 32, %o1
230 LOAD(prefetch, %o1, #one_read)
231 sub %o1, 32, %o1
232 EX_ST(STORE_INIT(%o4, %o0 + 0x00)) ! initializes cache line
233 EX_ST(STORE_INIT(%o5, %o0 + 0x08))
234 EX_LD(LOAD_TWIN(%o1, %o4, %o5))
235 add %o1, 16, %o1
236 EX_ST(STORE_INIT(%g2, %o0 + 0x10))
237 EX_ST(STORE_INIT(%g3, %o0 + 0x18))
238 EX_LD(LOAD_TWIN(%o1, %g2, %g3))
239 add %o1, 16, %o1
240 EX_ST(STORE_INIT(%o4, %o0 + 0x20))
241 EX_ST(STORE_INIT(%o5, %o0 + 0x28))
242 EX_ST(STORE_INIT(%g2, %o0 + 0x30))
243 EX_ST(STORE_INIT(%g3, %o0 + 0x38))
244 subcc %g1, 64, %g1
245 bne,pt %XCC, 1b
246 add %o0, 64, %o0
247 /* fall through */
248
24960:
250 /* %o2 contains any final bytes still needed to be copied
251 * over. If anything is left, we copy it one byte at a time.
252 */
253 RESTORE_ASI(%o3)
254 brz,pt %o2, 85f
255 sub %o0, %o1, %o3
256 ba,a,pt %XCC, 90f
257
258 .align 64
25970: /* 16 < len <= 64 */
260 bne,pn %XCC, 75f
261 sub %o0, %o1, %o3
262
26372:
264 andn %o2, 0xf, %o4
265 and %o2, 0xf, %o2
2661: subcc %o4, 0x10, %o4
267 EX_LD(LOAD(ldx, %o1, %o5))
268 add %o1, 0x08, %o1
269 EX_LD(LOAD(ldx, %o1, %g1))
270 sub %o1, 0x08, %o1
271 EX_ST(STORE(stx, %o5, %o1 + %o3))
272 add %o1, 0x8, %o1
273 EX_ST(STORE(stx, %g1, %o1 + %o3))
274 bgu,pt %XCC, 1b
275 add %o1, 0x8, %o1
27673: andcc %o2, 0x8, %g0
277 be,pt %XCC, 1f
278 nop
279 sub %o2, 0x8, %o2
280 EX_LD(LOAD(ldx, %o1, %o5))
281 EX_ST(STORE(stx, %o5, %o1 + %o3))
282 add %o1, 0x8, %o1
2831: andcc %o2, 0x4, %g0
284 be,pt %XCC, 1f
285 nop
286 sub %o2, 0x4, %o2
287 EX_LD(LOAD(lduw, %o1, %o5))
288 EX_ST(STORE(stw, %o5, %o1 + %o3))
289 add %o1, 0x4, %o1
2901: cmp %o2, 0
291 be,pt %XCC, 85f
292 nop
293 ba,pt %xcc, 90f
294 nop
295
29675:
297 andcc %o0, 0x7, %g1
298 sub %g1, 0x8, %g1
299 be,pn %icc, 2f
300 sub %g0, %g1, %g1
301 sub %o2, %g1, %o2
302
3031: subcc %g1, 1, %g1
304 EX_LD(LOAD(ldub, %o1, %o5))
305 EX_ST(STORE(stb, %o5, %o1 + %o3))
306 bgu,pt %icc, 1b
307 add %o1, 1, %o1
308
3092: add %o1, %o3, %o0
310 andcc %o1, 0x7, %g1
311 bne,pt %icc, 8f
312 sll %g1, 3, %g1
313
314 cmp %o2, 16
315 bgeu,pt %icc, 72b
316 nop
317 ba,a,pt %xcc, 73b
318
3198: mov 64, %o3
320 andn %o1, 0x7, %o1
321 EX_LD(LOAD(ldx, %o1, %g2))
322 sub %o3, %g1, %o3
323 andn %o2, 0x7, %o4
324 sllx %g2, %g1, %g2
3251: add %o1, 0x8, %o1
326 EX_LD(LOAD(ldx, %o1, %g3))
327 subcc %o4, 0x8, %o4
328 srlx %g3, %o3, %o5
329 or %o5, %g2, %o5
330 EX_ST(STORE(stx, %o5, %o0))
331 add %o0, 0x8, %o0
332 bgu,pt %icc, 1b
333 sllx %g3, %g1, %g2
334
335 srl %g1, 3, %g1
336 andcc %o2, 0x7, %o2
337 be,pn %icc, 85f
338 add %o1, %g1, %o1
339 ba,pt %xcc, 90f
340 sub %o0, %o1, %o3
341
342 .align 64
34380: /* 0 < len <= 16 */
344 andcc %o3, 0x3, %g0
345 bne,pn %XCC, 90f
346 sub %o0, %o1, %o3
347
3481:
349 subcc %o2, 4, %o2
350 EX_LD(LOAD(lduw, %o1, %g1))
351 EX_ST(STORE(stw, %g1, %o1 + %o3))
352 bgu,pt %XCC, 1b
353 add %o1, 4, %o1
354
35585: retl
356 mov EX_RETVAL(GLOBAL_SPARE), %o0
357
358 .align 32
35990:
360 subcc %o2, 1, %o2
361 EX_LD(LOAD(ldub, %o1, %g1))
362 EX_ST(STORE(stb, %g1, %o1 + %o3))
363 bgu,pt %XCC, 90b
364 add %o1, 1, %o1
365 retl
366 mov EX_RETVAL(GLOBAL_SPARE), %o0
367
368 .size FUNC_NAME, .-FUNC_NAME
diff --git a/arch/sparc64/lib/NGpage.S b/arch/sparc64/lib/NGpage.S
new file mode 100644
index 000000000000..7d7c3bb8dcbf
--- /dev/null
+++ b/arch/sparc64/lib/NGpage.S
@@ -0,0 +1,96 @@
1/* NGpage.S: Niagara optimize clear and copy page.
2 *
3 * Copyright (C) 2006 (davem@davemloft.net)
4 */
5
6#include <asm/asi.h>
7#include <asm/page.h>
8
9 .text
10 .align 32
11
12 /* This is heavily simplified from the sun4u variants
13 * because Niagara does not have any D-cache aliasing issues
14 * and also we don't need to use the FPU in order to implement
15 * an optimal page copy/clear.
16 */
17
18NGcopy_user_page: /* %o0=dest, %o1=src, %o2=vaddr */
19 prefetch [%o1 + 0x00], #one_read
20 mov 8, %g1
21 mov 16, %g2
22 mov 24, %g3
23 set PAGE_SIZE, %g7
24
251: ldda [%o1 + %g0] ASI_BLK_INIT_QUAD_LDD_P, %o2
26 ldda [%o1 + %g2] ASI_BLK_INIT_QUAD_LDD_P, %o4
27 prefetch [%o1 + 0x40], #one_read
28 add %o1, 32, %o1
29 stxa %o2, [%o0 + %g0] ASI_BLK_INIT_QUAD_LDD_P
30 stxa %o3, [%o0 + %g1] ASI_BLK_INIT_QUAD_LDD_P
31 ldda [%o1 + %g0] ASI_BLK_INIT_QUAD_LDD_P, %o2
32 stxa %o4, [%o0 + %g2] ASI_BLK_INIT_QUAD_LDD_P
33 stxa %o5, [%o0 + %g3] ASI_BLK_INIT_QUAD_LDD_P
34 ldda [%o1 + %g2] ASI_BLK_INIT_QUAD_LDD_P, %o4
35 add %o1, 32, %o1
36 add %o0, 32, %o0
37 stxa %o2, [%o0 + %g0] ASI_BLK_INIT_QUAD_LDD_P
38 stxa %o3, [%o0 + %g1] ASI_BLK_INIT_QUAD_LDD_P
39 stxa %o4, [%o0 + %g2] ASI_BLK_INIT_QUAD_LDD_P
40 stxa %o5, [%o0 + %g3] ASI_BLK_INIT_QUAD_LDD_P
41 subcc %g7, 64, %g7
42 bne,pt %xcc, 1b
43 add %o0, 32, %o0
44 retl
45 nop
46
47NGclear_page: /* %o0=dest */
48NGclear_user_page: /* %o0=dest, %o1=vaddr */
49 mov 8, %g1
50 mov 16, %g2
51 mov 24, %g3
52 set PAGE_SIZE, %g7
53
541: stxa %g0, [%o0 + %g0] ASI_BLK_INIT_QUAD_LDD_P
55 stxa %g0, [%o0 + %g1] ASI_BLK_INIT_QUAD_LDD_P
56 stxa %g0, [%o0 + %g2] ASI_BLK_INIT_QUAD_LDD_P
57 stxa %g0, [%o0 + %g3] ASI_BLK_INIT_QUAD_LDD_P
58 add %o0, 32, %o0
59 stxa %g0, [%o0 + %g0] ASI_BLK_INIT_QUAD_LDD_P
60 stxa %g0, [%o0 + %g1] ASI_BLK_INIT_QUAD_LDD_P
61 stxa %g0, [%o0 + %g2] ASI_BLK_INIT_QUAD_LDD_P
62 stxa %g0, [%o0 + %g3] ASI_BLK_INIT_QUAD_LDD_P
63 subcc %g7, 64, %g7
64 bne,pt %xcc, 1b
65 add %o0, 32, %o0
66 retl
67 nop
68
69#define BRANCH_ALWAYS 0x10680000
70#define NOP 0x01000000
71#define NG_DO_PATCH(OLD, NEW) \
72 sethi %hi(NEW), %g1; \
73 or %g1, %lo(NEW), %g1; \
74 sethi %hi(OLD), %g2; \
75 or %g2, %lo(OLD), %g2; \
76 sub %g1, %g2, %g1; \
77 sethi %hi(BRANCH_ALWAYS), %g3; \
78 sll %g1, 11, %g1; \
79 srl %g1, 11 + 2, %g1; \
80 or %g3, %lo(BRANCH_ALWAYS), %g3; \
81 or %g3, %g1, %g3; \
82 stw %g3, [%g2]; \
83 sethi %hi(NOP), %g3; \
84 or %g3, %lo(NOP), %g3; \
85 stw %g3, [%g2 + 0x4]; \
86 flush %g2;
87
88 .globl niagara_patch_pageops
89 .type niagara_patch_pageops,#function
90niagara_patch_pageops:
91 NG_DO_PATCH(copy_user_page, NGcopy_user_page)
92 NG_DO_PATCH(_clear_page, NGclear_page)
93 NG_DO_PATCH(clear_user_page, NGclear_user_page)
94 retl
95 nop
96 .size niagara_patch_pageops,.-niagara_patch_pageops
diff --git a/arch/sparc64/lib/NGpatch.S b/arch/sparc64/lib/NGpatch.S
new file mode 100644
index 000000000000..3b0674fc3366
--- /dev/null
+++ b/arch/sparc64/lib/NGpatch.S
@@ -0,0 +1,33 @@
1/* NGpatch.S: Patch Ultra-I routines with Niagara variant.
2 *
3 * Copyright (C) 2006 David S. Miller <davem@davemloft.net>
4 */
5
6#define BRANCH_ALWAYS 0x10680000
7#define NOP 0x01000000
8#define NG_DO_PATCH(OLD, NEW) \
9 sethi %hi(NEW), %g1; \
10 or %g1, %lo(NEW), %g1; \
11 sethi %hi(OLD), %g2; \
12 or %g2, %lo(OLD), %g2; \
13 sub %g1, %g2, %g1; \
14 sethi %hi(BRANCH_ALWAYS), %g3; \
15 sll %g1, 11, %g1; \
16 srl %g1, 11 + 2, %g1; \
17 or %g3, %lo(BRANCH_ALWAYS), %g3; \
18 or %g3, %g1, %g3; \
19 stw %g3, [%g2]; \
20 sethi %hi(NOP), %g3; \
21 or %g3, %lo(NOP), %g3; \
22 stw %g3, [%g2 + 0x4]; \
23 flush %g2;
24
25 .globl niagara_patch_copyops
26 .type niagara_patch_copyops,#function
27niagara_patch_copyops:
28 NG_DO_PATCH(memcpy, NGmemcpy)
29 NG_DO_PATCH(___copy_from_user, NGcopy_from_user)
30 NG_DO_PATCH(___copy_to_user, NGcopy_to_user)
31 retl
32 nop
33 .size niagara_patch_copyops,.-niagara_patch_copyops
diff --git a/arch/sparc64/lib/U3patch.S b/arch/sparc64/lib/U3patch.S
index e2b6c5e4b95a..ecc302619a6e 100644
--- a/arch/sparc64/lib/U3patch.S
+++ b/arch/sparc64/lib/U3patch.S
@@ -12,7 +12,8 @@
12 or %g2, %lo(OLD), %g2; \ 12 or %g2, %lo(OLD), %g2; \
13 sub %g1, %g2, %g1; \ 13 sub %g1, %g2, %g1; \
14 sethi %hi(BRANCH_ALWAYS), %g3; \ 14 sethi %hi(BRANCH_ALWAYS), %g3; \
15 srl %g1, 2, %g1; \ 15 sll %g1, 11, %g1; \
16 srl %g1, 11 + 2, %g1; \
16 or %g3, %lo(BRANCH_ALWAYS), %g3; \ 17 or %g3, %lo(BRANCH_ALWAYS), %g3; \
17 or %g3, %g1, %g3; \ 18 or %g3, %g1, %g3; \
18 stw %g3, [%g2]; \ 19 stw %g3, [%g2]; \
diff --git a/arch/sparc64/lib/bzero.S b/arch/sparc64/lib/bzero.S
index 1d2abcfa4e52..c7bbae8c590f 100644
--- a/arch/sparc64/lib/bzero.S
+++ b/arch/sparc64/lib/bzero.S
@@ -98,12 +98,12 @@ __bzero_done:
98 .text; \ 98 .text; \
99 .align 4; 99 .align 4;
100 100
101 .globl __bzero_noasi 101 .globl __clear_user
102 .type __bzero_noasi, #function 102 .type __clear_user, #function
103__bzero_noasi: /* %o0=buf, %o1=len */ 103__clear_user: /* %o0=buf, %o1=len */
104 brz,pn %o1, __bzero_noasi_done 104 brz,pn %o1, __clear_user_done
105 cmp %o1, 16 105 cmp %o1, 16
106 bl,pn %icc, __bzero_noasi_tiny 106 bl,pn %icc, __clear_user_tiny
107 EX_ST(prefetcha [%o0 + 0x00] %asi, #n_writes) 107 EX_ST(prefetcha [%o0 + 0x00] %asi, #n_writes)
108 andcc %o0, 0x3, %g0 108 andcc %o0, 0x3, %g0
109 be,pt %icc, 2f 109 be,pt %icc, 2f
@@ -145,14 +145,14 @@ __bzero_noasi: /* %o0=buf, %o1=len */
145 subcc %g1, 8, %g1 145 subcc %g1, 8, %g1
146 bne,pt %icc, 5b 146 bne,pt %icc, 5b
147 add %o0, 0x8, %o0 147 add %o0, 0x8, %o0
1486: brz,pt %o1, __bzero_noasi_done 1486: brz,pt %o1, __clear_user_done
149 nop 149 nop
150__bzero_noasi_tiny: 150__clear_user_tiny:
1511: EX_ST(stba %g0, [%o0 + 0x00] %asi) 1511: EX_ST(stba %g0, [%o0 + 0x00] %asi)
152 subcc %o1, 1, %o1 152 subcc %o1, 1, %o1
153 bne,pt %icc, 1b 153 bne,pt %icc, 1b
154 add %o0, 1, %o0 154 add %o0, 1, %o0
155__bzero_noasi_done: 155__clear_user_done:
156 retl 156 retl
157 clr %o0 157 clr %o0
158 .size __bzero_noasi, .-__bzero_noasi 158 .size __clear_user, .-__clear_user
diff --git a/arch/sparc64/lib/clear_page.S b/arch/sparc64/lib/clear_page.S
index b59884ef051d..77e531f6c2a7 100644
--- a/arch/sparc64/lib/clear_page.S
+++ b/arch/sparc64/lib/clear_page.S
@@ -9,6 +9,7 @@
9#include <asm/page.h> 9#include <asm/page.h>
10#include <asm/pgtable.h> 10#include <asm/pgtable.h>
11#include <asm/spitfire.h> 11#include <asm/spitfire.h>
12#include <asm/head.h>
12 13
13 /* What we used to do was lock a TLB entry into a specific 14 /* What we used to do was lock a TLB entry into a specific
14 * TLB slot, clear the page with interrupts disabled, then 15 * TLB slot, clear the page with interrupts disabled, then
@@ -22,9 +23,6 @@
22 * disable preemption during the clear. 23 * disable preemption during the clear.
23 */ 24 */
24 25
25#define TTE_BITS_TOP (_PAGE_VALID | _PAGE_SZBITS)
26#define TTE_BITS_BOTTOM (_PAGE_CP | _PAGE_CV | _PAGE_P | _PAGE_L | _PAGE_W)
27
28 .text 26 .text
29 27
30 .globl _clear_page 28 .globl _clear_page
@@ -43,12 +41,11 @@ clear_user_page: /* %o0=dest, %o1=vaddr */
43 sethi %hi(PAGE_SIZE), %o4 41 sethi %hi(PAGE_SIZE), %o4
44 42
45 sllx %g2, 32, %g2 43 sllx %g2, 32, %g2
46 sethi %uhi(TTE_BITS_TOP), %g3 44 sethi %hi(PAGE_KERNEL_LOCKED), %g3
47 45
48 sllx %g3, 32, %g3 46 ldx [%g3 + %lo(PAGE_KERNEL_LOCKED)], %g3
49 sub %o0, %g2, %g1 ! paddr 47 sub %o0, %g2, %g1 ! paddr
50 48
51 or %g3, TTE_BITS_BOTTOM, %g3
52 and %o1, %o4, %o0 ! vaddr D-cache alias bit 49 and %o1, %o4, %o0 ! vaddr D-cache alias bit
53 50
54 or %g1, %g3, %g1 ! TTE data 51 or %g1, %g3, %g1 ! TTE data
@@ -66,7 +63,8 @@ clear_user_page: /* %o0=dest, %o1=vaddr */
66 wrpr %o4, PSTATE_IE, %pstate 63 wrpr %o4, PSTATE_IE, %pstate
67 stxa %o0, [%g3] ASI_DMMU 64 stxa %o0, [%g3] ASI_DMMU
68 stxa %g1, [%g0] ASI_DTLB_DATA_IN 65 stxa %g1, [%g0] ASI_DTLB_DATA_IN
69 flush %g6 66 sethi %hi(KERNBASE), %g1
67 flush %g1
70 wrpr %o4, 0x0, %pstate 68 wrpr %o4, 0x0, %pstate
71 69
72 mov 1, %o4 70 mov 1, %o4
diff --git a/arch/sparc64/lib/copy_page.S b/arch/sparc64/lib/copy_page.S
index feebb14fd27a..37460666a5c3 100644
--- a/arch/sparc64/lib/copy_page.S
+++ b/arch/sparc64/lib/copy_page.S
@@ -23,8 +23,6 @@
23 * disable preemption during the clear. 23 * disable preemption during the clear.
24 */ 24 */
25 25
26#define TTE_BITS_TOP (_PAGE_VALID | _PAGE_SZBITS)
27#define TTE_BITS_BOTTOM (_PAGE_CP | _PAGE_CV | _PAGE_P | _PAGE_L | _PAGE_W)
28#define DCACHE_SIZE (PAGE_SIZE * 2) 26#define DCACHE_SIZE (PAGE_SIZE * 2)
29 27
30#if (PAGE_SHIFT == 13) || (PAGE_SHIFT == 19) 28#if (PAGE_SHIFT == 13) || (PAGE_SHIFT == 19)
@@ -52,13 +50,12 @@ copy_user_page: /* %o0=dest, %o1=src, %o2=vaddr */
52 sethi %hi(PAGE_SIZE), %o3 50 sethi %hi(PAGE_SIZE), %o3
53 51
54 sllx %g2, 32, %g2 52 sllx %g2, 32, %g2
55 sethi %uhi(TTE_BITS_TOP), %g3 53 sethi %hi(PAGE_KERNEL_LOCKED), %g3
56 54
57 sllx %g3, 32, %g3 55 ldx [%g3 + %lo(PAGE_KERNEL_LOCKED)], %g3
58 sub %o0, %g2, %g1 ! dest paddr 56 sub %o0, %g2, %g1 ! dest paddr
59 57
60 sub %o1, %g2, %g2 ! src paddr 58 sub %o1, %g2, %g2 ! src paddr
61 or %g3, TTE_BITS_BOTTOM, %g3
62 59
63 and %o2, %o3, %o0 ! vaddr D-cache alias bit 60 and %o2, %o3, %o0 ! vaddr D-cache alias bit
64 or %g1, %g3, %g1 ! dest TTE data 61 or %g1, %g3, %g1 ! dest TTE data
diff --git a/arch/sparc64/lib/delay.c b/arch/sparc64/lib/delay.c
index e8808727617a..fb27e54a03ee 100644
--- a/arch/sparc64/lib/delay.c
+++ b/arch/sparc64/lib/delay.c
@@ -1,6 +1,6 @@
1/* delay.c: Delay loops for sparc64 1/* delay.c: Delay loops for sparc64
2 * 2 *
3 * Copyright (C) 2004 David S. Miller <davem@redhat.com> 3 * Copyright (C) 2004, 2006 David S. Miller <davem@davemloft.net>
4 * 4 *
5 * Based heavily upon x86 variant which is: 5 * Based heavily upon x86 variant which is:
6 * Copyright (C) 1993 Linus Torvalds 6 * Copyright (C) 1993 Linus Torvalds
@@ -8,19 +8,16 @@
8 */ 8 */
9 9
10#include <linux/delay.h> 10#include <linux/delay.h>
11#include <asm/timer.h>
11 12
12void __delay(unsigned long loops) 13void __delay(unsigned long loops)
13{ 14{
14 __asm__ __volatile__( 15 unsigned long bclock, now;
15" b,pt %%xcc, 1f\n" 16
16" cmp %0, 0\n" 17 bclock = tick_ops->get_tick();
17" .align 32\n" 18 do {
18"1:\n" 19 now = tick_ops->get_tick();
19" bne,pt %%xcc, 1b\n" 20 } while ((now-bclock) < loops);
20" subcc %0, 1, %0\n"
21 : "=&r" (loops)
22 : "0" (loops)
23 : "cc");
24} 21}
25 22
26/* We used to multiply by HZ after shifting down by 32 bits 23/* We used to multiply by HZ after shifting down by 32 bits
diff --git a/arch/sparc64/lib/find_bit.c b/arch/sparc64/lib/find_bit.c
deleted file mode 100644
index 6059557067b4..000000000000
--- a/arch/sparc64/lib/find_bit.c
+++ /dev/null
@@ -1,127 +0,0 @@
1#include <linux/bitops.h>
2
3/**
4 * find_next_bit - find the next set bit in a memory region
5 * @addr: The address to base the search on
6 * @offset: The bitnumber to start searching at
7 * @size: The maximum size to search
8 */
9unsigned long find_next_bit(const unsigned long *addr, unsigned long size,
10 unsigned long offset)
11{
12 const unsigned long *p = addr + (offset >> 6);
13 unsigned long result = offset & ~63UL;
14 unsigned long tmp;
15
16 if (offset >= size)
17 return size;
18 size -= result;
19 offset &= 63UL;
20 if (offset) {
21 tmp = *(p++);
22 tmp &= (~0UL << offset);
23 if (size < 64)
24 goto found_first;
25 if (tmp)
26 goto found_middle;
27 size -= 64;
28 result += 64;
29 }
30 while (size & ~63UL) {
31 if ((tmp = *(p++)))
32 goto found_middle;
33 result += 64;
34 size -= 64;
35 }
36 if (!size)
37 return result;
38 tmp = *p;
39
40found_first:
41 tmp &= (~0UL >> (64 - size));
42 if (tmp == 0UL) /* Are any bits set? */
43 return result + size; /* Nope. */
44found_middle:
45 return result + __ffs(tmp);
46}
47
48/* find_next_zero_bit() finds the first zero bit in a bit string of length
49 * 'size' bits, starting the search at bit 'offset'. This is largely based
50 * on Linus's ALPHA routines, which are pretty portable BTW.
51 */
52
53unsigned long find_next_zero_bit(const unsigned long *addr,
54 unsigned long size, unsigned long offset)
55{
56 const unsigned long *p = addr + (offset >> 6);
57 unsigned long result = offset & ~63UL;
58 unsigned long tmp;
59
60 if (offset >= size)
61 return size;
62 size -= result;
63 offset &= 63UL;
64 if (offset) {
65 tmp = *(p++);
66 tmp |= ~0UL >> (64-offset);
67 if (size < 64)
68 goto found_first;
69 if (~tmp)
70 goto found_middle;
71 size -= 64;
72 result += 64;
73 }
74 while (size & ~63UL) {
75 if (~(tmp = *(p++)))
76 goto found_middle;
77 result += 64;
78 size -= 64;
79 }
80 if (!size)
81 return result;
82 tmp = *p;
83
84found_first:
85 tmp |= ~0UL << size;
86 if (tmp == ~0UL) /* Are any bits zero? */
87 return result + size; /* Nope. */
88found_middle:
89 return result + ffz(tmp);
90}
91
92unsigned long find_next_zero_le_bit(unsigned long *addr, unsigned long size, unsigned long offset)
93{
94 unsigned long *p = addr + (offset >> 6);
95 unsigned long result = offset & ~63UL;
96 unsigned long tmp;
97
98 if (offset >= size)
99 return size;
100 size -= result;
101 offset &= 63UL;
102 if(offset) {
103 tmp = __swab64p(p++);
104 tmp |= (~0UL >> (64-offset));
105 if(size < 64)
106 goto found_first;
107 if(~tmp)
108 goto found_middle;
109 size -= 64;
110 result += 64;
111 }
112 while(size & ~63) {
113 if(~(tmp = __swab64p(p++)))
114 goto found_middle;
115 result += 64;
116 size -= 64;
117 }
118 if(!size)
119 return result;
120 tmp = __swab64p(p);
121found_first:
122 tmp |= (~0UL << size);
123 if (tmp == ~0UL) /* Are any bits zero? */
124 return result + size; /* Nope. */
125found_middle:
126 return result + ffz(tmp);
127}
diff --git a/arch/sparc64/lib/xor.S b/arch/sparc64/lib/xor.S
index 4cd5d2be1ae1..a79c8888170d 100644
--- a/arch/sparc64/lib/xor.S
+++ b/arch/sparc64/lib/xor.S
@@ -2,9 +2,10 @@
2 * arch/sparc64/lib/xor.S 2 * arch/sparc64/lib/xor.S
3 * 3 *
4 * High speed xor_block operation for RAID4/5 utilizing the 4 * High speed xor_block operation for RAID4/5 utilizing the
5 * UltraSparc Visual Instruction Set. 5 * UltraSparc Visual Instruction Set and Niagara store-init/twin-load.
6 * 6 *
7 * Copyright (C) 1997, 1999 Jakub Jelinek (jj@ultra.linux.cz) 7 * Copyright (C) 1997, 1999 Jakub Jelinek (jj@ultra.linux.cz)
8 * Copyright (C) 2006 David S. Miller <davem@davemloft.net>
8 */ 9 */
9 10
10#include <asm/visasm.h> 11#include <asm/visasm.h>
@@ -19,6 +20,8 @@
19 */ 20 */
20 .text 21 .text
21 .align 32 22 .align 32
23
24 /* VIS versions. */
22 .globl xor_vis_2 25 .globl xor_vis_2
23 .type xor_vis_2,#function 26 .type xor_vis_2,#function
24xor_vis_2: 27xor_vis_2:
@@ -352,3 +355,298 @@ xor_vis_5:
352 ret 355 ret
353 restore 356 restore
354 .size xor_vis_5, .-xor_vis_5 357 .size xor_vis_5, .-xor_vis_5
358
359 /* Niagara versions. */
360 .globl xor_niagara_2
361 .type xor_niagara_2,#function
362xor_niagara_2: /* %o0=bytes, %o1=dest, %o2=src */
363 save %sp, -192, %sp
364 prefetch [%i1], #n_writes
365 prefetch [%i2], #one_read
366 rd %asi, %g7
367 wr %g0, ASI_BLK_INIT_QUAD_LDD_P, %asi
368 srlx %i0, 6, %g1
369 mov %i1, %i0
370 mov %i2, %i1
3711: ldda [%i1 + 0x00] %asi, %i2 /* %i2/%i3 = src + 0x00 */
372 ldda [%i1 + 0x10] %asi, %i4 /* %i4/%i5 = src + 0x10 */
373 ldda [%i1 + 0x20] %asi, %g2 /* %g2/%g3 = src + 0x20 */
374 ldda [%i1 + 0x30] %asi, %l0 /* %l0/%l1 = src + 0x30 */
375 prefetch [%i1 + 0x40], #one_read
376 ldda [%i0 + 0x00] %asi, %o0 /* %o0/%o1 = dest + 0x00 */
377 ldda [%i0 + 0x10] %asi, %o2 /* %o2/%o3 = dest + 0x10 */
378 ldda [%i0 + 0x20] %asi, %o4 /* %o4/%o5 = dest + 0x20 */
379 ldda [%i0 + 0x30] %asi, %l2 /* %l2/%l3 = dest + 0x30 */
380 prefetch [%i0 + 0x40], #n_writes
381 xor %o0, %i2, %o0
382 xor %o1, %i3, %o1
383 stxa %o0, [%i0 + 0x00] %asi
384 stxa %o1, [%i0 + 0x08] %asi
385 xor %o2, %i4, %o2
386 xor %o3, %i5, %o3
387 stxa %o2, [%i0 + 0x10] %asi
388 stxa %o3, [%i0 + 0x18] %asi
389 xor %o4, %g2, %o4
390 xor %o5, %g3, %o5
391 stxa %o4, [%i0 + 0x20] %asi
392 stxa %o5, [%i0 + 0x28] %asi
393 xor %l2, %l0, %l2
394 xor %l3, %l1, %l3
395 stxa %l2, [%i0 + 0x30] %asi
396 stxa %l3, [%i0 + 0x38] %asi
397 add %i0, 0x40, %i0
398 subcc %g1, 1, %g1
399 bne,pt %xcc, 1b
400 add %i1, 0x40, %i1
401 membar #Sync
402 wr %g7, 0x0, %asi
403 ret
404 restore
405 .size xor_niagara_2, .-xor_niagara_2
406
407 .globl xor_niagara_3
408 .type xor_niagara_3,#function
409xor_niagara_3: /* %o0=bytes, %o1=dest, %o2=src1, %o3=src2 */
410 save %sp, -192, %sp
411 prefetch [%i1], #n_writes
412 prefetch [%i2], #one_read
413 prefetch [%i3], #one_read
414 rd %asi, %g7
415 wr %g0, ASI_BLK_INIT_QUAD_LDD_P, %asi
416 srlx %i0, 6, %g1
417 mov %i1, %i0
418 mov %i2, %i1
419 mov %i3, %l7
4201: ldda [%i1 + 0x00] %asi, %i2 /* %i2/%i3 = src1 + 0x00 */
421 ldda [%i1 + 0x10] %asi, %i4 /* %i4/%i5 = src1 + 0x10 */
422 ldda [%l7 + 0x00] %asi, %g2 /* %g2/%g3 = src2 + 0x00 */
423 ldda [%l7 + 0x10] %asi, %l0 /* %l0/%l1 = src2 + 0x10 */
424 ldda [%i0 + 0x00] %asi, %o0 /* %o0/%o1 = dest + 0x00 */
425 ldda [%i0 + 0x10] %asi, %o2 /* %o2/%o3 = dest + 0x10 */
426 xor %g2, %i2, %g2
427 xor %g3, %i3, %g3
428 xor %o0, %g2, %o0
429 xor %o1, %g3, %o1
430 stxa %o0, [%i0 + 0x00] %asi
431 stxa %o1, [%i0 + 0x08] %asi
432 ldda [%i1 + 0x20] %asi, %i2 /* %i2/%i3 = src1 + 0x20 */
433 ldda [%l7 + 0x20] %asi, %g2 /* %g2/%g3 = src2 + 0x20 */
434 ldda [%i0 + 0x20] %asi, %o0 /* %o0/%o1 = dest + 0x20 */
435 xor %l0, %i4, %l0
436 xor %l1, %i5, %l1
437 xor %o2, %l0, %o2
438 xor %o3, %l1, %o3
439 stxa %o2, [%i0 + 0x10] %asi
440 stxa %o3, [%i0 + 0x18] %asi
441 ldda [%i1 + 0x30] %asi, %i4 /* %i4/%i5 = src1 + 0x30 */
442 ldda [%l7 + 0x30] %asi, %l0 /* %l0/%l1 = src2 + 0x30 */
443 ldda [%i0 + 0x30] %asi, %o2 /* %o2/%o3 = dest + 0x30 */
444 prefetch [%i1 + 0x40], #one_read
445 prefetch [%l7 + 0x40], #one_read
446 prefetch [%i0 + 0x40], #n_writes
447 xor %g2, %i2, %g2
448 xor %g3, %i3, %g3
449 xor %o0, %g2, %o0
450 xor %o1, %g3, %o1
451 stxa %o0, [%i0 + 0x20] %asi
452 stxa %o1, [%i0 + 0x28] %asi
453 xor %l0, %i4, %l0
454 xor %l1, %i5, %l1
455 xor %o2, %l0, %o2
456 xor %o3, %l1, %o3
457 stxa %o2, [%i0 + 0x30] %asi
458 stxa %o3, [%i0 + 0x38] %asi
459 add %i0, 0x40, %i0
460 add %i1, 0x40, %i1
461 subcc %g1, 1, %g1
462 bne,pt %xcc, 1b
463 add %l7, 0x40, %l7
464 membar #Sync
465 wr %g7, 0x0, %asi
466 ret
467 restore
468 .size xor_niagara_3, .-xor_niagara_3
469
470 .globl xor_niagara_4
471 .type xor_niagara_4,#function
472xor_niagara_4: /* %o0=bytes, %o1=dest, %o2=src1, %o3=src2, %o4=src3 */
473 save %sp, -192, %sp
474 prefetch [%i1], #n_writes
475 prefetch [%i2], #one_read
476 prefetch [%i3], #one_read
477 prefetch [%i4], #one_read
478 rd %asi, %g7
479 wr %g0, ASI_BLK_INIT_QUAD_LDD_P, %asi
480 srlx %i0, 6, %g1
481 mov %i1, %i0
482 mov %i2, %i1
483 mov %i3, %l7
484 mov %i4, %l6
4851: ldda [%i1 + 0x00] %asi, %i2 /* %i2/%i3 = src1 + 0x00 */
486 ldda [%l7 + 0x00] %asi, %i4 /* %i4/%i5 = src2 + 0x00 */
487 ldda [%l6 + 0x00] %asi, %g2 /* %g2/%g3 = src3 + 0x00 */
488 ldda [%i0 + 0x00] %asi, %l0 /* %l0/%l1 = dest + 0x00 */
489 xor %i4, %i2, %i4
490 xor %i5, %i3, %i5
491 ldda [%i1 + 0x10] %asi, %i2 /* %i2/%i3 = src1 + 0x10 */
492 xor %g2, %i4, %g2
493 xor %g3, %i5, %g3
494 ldda [%i7 + 0x10] %asi, %i4 /* %i4/%i5 = src2 + 0x10 */
495 xor %l0, %g2, %l0
496 xor %l1, %g3, %l1
497 stxa %l0, [%i0 + 0x00] %asi
498 stxa %l1, [%i0 + 0x08] %asi
499 ldda [%i6 + 0x10] %asi, %g2 /* %g2/%g3 = src3 + 0x10 */
500 ldda [%i0 + 0x10] %asi, %l0 /* %l0/%l1 = dest + 0x10 */
501
502 xor %i4, %i2, %i4
503 xor %i5, %i3, %i5
504 ldda [%i1 + 0x20] %asi, %i2 /* %i2/%i3 = src1 + 0x20 */
505 xor %g2, %i4, %g2
506 xor %g3, %i5, %g3
507 ldda [%i7 + 0x20] %asi, %i4 /* %i4/%i5 = src2 + 0x20 */
508 xor %l0, %g2, %l0
509 xor %l1, %g3, %l1
510 stxa %l0, [%i0 + 0x10] %asi
511 stxa %l1, [%i0 + 0x18] %asi
512 ldda [%i6 + 0x20] %asi, %g2 /* %g2/%g3 = src3 + 0x20 */
513 ldda [%i0 + 0x20] %asi, %l0 /* %l0/%l1 = dest + 0x20 */
514
515 xor %i4, %i2, %i4
516 xor %i5, %i3, %i5
517 ldda [%i1 + 0x30] %asi, %i2 /* %i2/%i3 = src1 + 0x30 */
518 xor %g2, %i4, %g2
519 xor %g3, %i5, %g3
520 ldda [%i7 + 0x30] %asi, %i4 /* %i4/%i5 = src2 + 0x30 */
521 xor %l0, %g2, %l0
522 xor %l1, %g3, %l1
523 stxa %l0, [%i0 + 0x20] %asi
524 stxa %l1, [%i0 + 0x28] %asi
525 ldda [%i6 + 0x30] %asi, %g2 /* %g2/%g3 = src3 + 0x30 */
526 ldda [%i0 + 0x30] %asi, %l0 /* %l0/%l1 = dest + 0x30 */
527
528 prefetch [%i1 + 0x40], #one_read
529 prefetch [%l7 + 0x40], #one_read
530 prefetch [%l6 + 0x40], #one_read
531 prefetch [%i0 + 0x40], #n_writes
532
533 xor %i4, %i2, %i4
534 xor %i5, %i3, %i5
535 xor %g2, %i4, %g2
536 xor %g3, %i5, %g3
537 xor %l0, %g2, %l0
538 xor %l1, %g3, %l1
539 stxa %l0, [%i0 + 0x30] %asi
540 stxa %l1, [%i0 + 0x38] %asi
541
542 add %i0, 0x40, %i0
543 add %i1, 0x40, %i1
544 add %l7, 0x40, %l7
545 subcc %g1, 1, %g1
546 bne,pt %xcc, 1b
547 add %l6, 0x40, %l6
548 membar #Sync
549 wr %g7, 0x0, %asi
550 ret
551 restore
552 .size xor_niagara_4, .-xor_niagara_4
553
554 .globl xor_niagara_5
555 .type xor_niagara_5,#function
556xor_niagara_5: /* %o0=bytes, %o1=dest, %o2=src1, %o3=src2, %o4=src3, %o5=src4 */
557 save %sp, -192, %sp
558 prefetch [%i1], #n_writes
559 prefetch [%i2], #one_read
560 prefetch [%i3], #one_read
561 prefetch [%i4], #one_read
562 prefetch [%i5], #one_read
563 rd %asi, %g7
564 wr %g0, ASI_BLK_INIT_QUAD_LDD_P, %asi
565 srlx %i0, 6, %g1
566 mov %i1, %i0
567 mov %i2, %i1
568 mov %i3, %l7
569 mov %i4, %l6
570 mov %i5, %l5
5711: ldda [%i1 + 0x00] %asi, %i2 /* %i2/%i3 = src1 + 0x00 */
572 ldda [%l7 + 0x00] %asi, %i4 /* %i4/%i5 = src2 + 0x00 */
573 ldda [%l6 + 0x00] %asi, %g2 /* %g2/%g3 = src3 + 0x00 */
574 ldda [%l5 + 0x00] %asi, %l0 /* %l0/%l1 = src4 + 0x00 */
575 ldda [%i0 + 0x00] %asi, %l2 /* %l2/%l3 = dest + 0x00 */
576 xor %i4, %i2, %i4
577 xor %i5, %i3, %i5
578 ldda [%i1 + 0x10] %asi, %i2 /* %i2/%i3 = src1 + 0x10 */
579 xor %g2, %i4, %g2
580 xor %g3, %i5, %g3
581 ldda [%l7 + 0x10] %asi, %i4 /* %i4/%i5 = src2 + 0x10 */
582 xor %l0, %g2, %l0
583 xor %l1, %g3, %l1
584 ldda [%l6 + 0x10] %asi, %g2 /* %g2/%g3 = src3 + 0x10 */
585 xor %l2, %l0, %l2
586 xor %l3, %l1, %l3
587 stxa %l2, [%i0 + 0x00] %asi
588 stxa %l3, [%i0 + 0x08] %asi
589 ldda [%l5 + 0x10] %asi, %l0 /* %l0/%l1 = src4 + 0x10 */
590 ldda [%i0 + 0x10] %asi, %l2 /* %l2/%l3 = dest + 0x10 */
591
592 xor %i4, %i2, %i4
593 xor %i5, %i3, %i5
594 ldda [%i1 + 0x20] %asi, %i2 /* %i2/%i3 = src1 + 0x20 */
595 xor %g2, %i4, %g2
596 xor %g3, %i5, %g3
597 ldda [%l7 + 0x20] %asi, %i4 /* %i4/%i5 = src2 + 0x20 */
598 xor %l0, %g2, %l0
599 xor %l1, %g3, %l1
600 ldda [%l6 + 0x20] %asi, %g2 /* %g2/%g3 = src3 + 0x20 */
601 xor %l2, %l0, %l2
602 xor %l3, %l1, %l3
603 stxa %l2, [%i0 + 0x10] %asi
604 stxa %l3, [%i0 + 0x18] %asi
605 ldda [%l5 + 0x20] %asi, %l0 /* %l0/%l1 = src4 + 0x20 */
606 ldda [%i0 + 0x20] %asi, %l2 /* %l2/%l3 = dest + 0x20 */
607
608 xor %i4, %i2, %i4
609 xor %i5, %i3, %i5
610 ldda [%i1 + 0x30] %asi, %i2 /* %i2/%i3 = src1 + 0x30 */
611 xor %g2, %i4, %g2
612 xor %g3, %i5, %g3
613 ldda [%l7 + 0x30] %asi, %i4 /* %i4/%i5 = src2 + 0x30 */
614 xor %l0, %g2, %l0
615 xor %l1, %g3, %l1
616 ldda [%l6 + 0x30] %asi, %g2 /* %g2/%g3 = src3 + 0x30 */
617 xor %l2, %l0, %l2
618 xor %l3, %l1, %l3
619 stxa %l2, [%i0 + 0x20] %asi
620 stxa %l3, [%i0 + 0x28] %asi
621 ldda [%l5 + 0x30] %asi, %l0 /* %l0/%l1 = src4 + 0x30 */
622 ldda [%i0 + 0x30] %asi, %l2 /* %l2/%l3 = dest + 0x30 */
623
624 prefetch [%i1 + 0x40], #one_read
625 prefetch [%l7 + 0x40], #one_read
626 prefetch [%l6 + 0x40], #one_read
627 prefetch [%l5 + 0x40], #one_read
628 prefetch [%i0 + 0x40], #n_writes
629
630 xor %i4, %i2, %i4
631 xor %i5, %i3, %i5
632 xor %g2, %i4, %g2
633 xor %g3, %i5, %g3
634 xor %l0, %g2, %l0
635 xor %l1, %g3, %l1
636 xor %l2, %l0, %l2
637 xor %l3, %l1, %l3
638 stxa %l2, [%i0 + 0x30] %asi
639 stxa %l3, [%i0 + 0x38] %asi
640
641 add %i0, 0x40, %i0
642 add %i1, 0x40, %i1
643 add %l7, 0x40, %l7
644 add %l6, 0x40, %l6
645 subcc %g1, 1, %g1
646 bne,pt %xcc, 1b
647 add %l5, 0x40, %l5
648 membar #Sync
649 wr %g7, 0x0, %asi
650 ret
651 restore
652 .size xor_niagara_5, .-xor_niagara_5
diff --git a/arch/sparc64/math-emu/math.c b/arch/sparc64/math-emu/math.c
index 2ae05cd7b773..6ee496c2864a 100644
--- a/arch/sparc64/math-emu/math.c
+++ b/arch/sparc64/math-emu/math.c
@@ -206,9 +206,29 @@ int do_mathemu(struct pt_regs *regs, struct fpustate *f)
206 case FSTOQ: TYPE(3,3,1,1,1,0,0); break; 206 case FSTOQ: TYPE(3,3,1,1,1,0,0); break;
207 case FDTOQ: TYPE(3,3,1,2,1,0,0); break; 207 case FDTOQ: TYPE(3,3,1,2,1,0,0); break;
208 case FQTOI: TYPE(3,1,0,3,1,0,0); break; 208 case FQTOI: TYPE(3,1,0,3,1,0,0); break;
209
210 /* We can get either unimplemented or unfinished
211 * for these cases. Pre-Niagara systems generate
212 * unfinished fpop for SUBNORMAL cases, and Niagara
213 * always gives unimplemented fpop for fsqrt{s,d}.
214 */
215 case FSQRTS: {
216 unsigned long x = current_thread_info()->xfsr[0];
217
218 x = (x >> 14) & 0xf;
219 TYPE(x,1,1,1,1,0,0);
220 break;
221 }
222
223 case FSQRTD: {
224 unsigned long x = current_thread_info()->xfsr[0];
225
226 x = (x >> 14) & 0xf;
227 TYPE(x,2,1,2,1,0,0);
228 break;
229 }
230
209 /* SUBNORMAL - ftt == 2 */ 231 /* SUBNORMAL - ftt == 2 */
210 case FSQRTS: TYPE(2,1,1,1,1,0,0); break;
211 case FSQRTD: TYPE(2,2,1,2,1,0,0); break;
212 case FADDD: 232 case FADDD:
213 case FSUBD: 233 case FSUBD:
214 case FMULD: 234 case FMULD:
diff --git a/arch/sparc64/mm/Makefile b/arch/sparc64/mm/Makefile
index 9d0960e69f48..e415bf942bcd 100644
--- a/arch/sparc64/mm/Makefile
+++ b/arch/sparc64/mm/Makefile
@@ -5,6 +5,6 @@
5EXTRA_AFLAGS := -ansi 5EXTRA_AFLAGS := -ansi
6EXTRA_CFLAGS := -Werror 6EXTRA_CFLAGS := -Werror
7 7
8obj-y := ultra.o tlb.o fault.o init.o generic.o 8obj-y := ultra.o tlb.o tsb.o fault.o init.o generic.o
9 9
10obj-$(CONFIG_HUGETLB_PAGE) += hugetlbpage.o 10obj-$(CONFIG_HUGETLB_PAGE) += hugetlbpage.o
diff --git a/arch/sparc64/mm/fault.c b/arch/sparc64/mm/fault.c
index 6f0539aa44d0..0db2f7d9fab5 100644
--- a/arch/sparc64/mm/fault.c
+++ b/arch/sparc64/mm/fault.c
@@ -29,6 +29,7 @@
29#include <asm/lsu.h> 29#include <asm/lsu.h>
30#include <asm/sections.h> 30#include <asm/sections.h>
31#include <asm/kdebug.h> 31#include <asm/kdebug.h>
32#include <asm/mmu_context.h>
32 33
33/* 34/*
34 * To debug kernel to catch accesses to certain virtual/physical addresses. 35 * To debug kernel to catch accesses to certain virtual/physical addresses.
@@ -91,12 +92,13 @@ static void __kprobes unhandled_fault(unsigned long address,
91 die_if_kernel("Oops", regs); 92 die_if_kernel("Oops", regs);
92} 93}
93 94
94static void bad_kernel_pc(struct pt_regs *regs) 95static void bad_kernel_pc(struct pt_regs *regs, unsigned long vaddr)
95{ 96{
96 unsigned long *ksp; 97 unsigned long *ksp;
97 98
98 printk(KERN_CRIT "OOPS: Bogus kernel PC [%016lx] in fault handler\n", 99 printk(KERN_CRIT "OOPS: Bogus kernel PC [%016lx] in fault handler\n",
99 regs->tpc); 100 regs->tpc);
101 printk(KERN_CRIT "OOPS: Fault was to vaddr[%lx]\n", vaddr);
100 __asm__("mov %%sp, %0" : "=r" (ksp)); 102 __asm__("mov %%sp, %0" : "=r" (ksp));
101 show_stack(current, ksp); 103 show_stack(current, ksp);
102 unhandled_fault(regs->tpc, current, regs); 104 unhandled_fault(regs->tpc, current, regs);
@@ -137,7 +139,7 @@ static unsigned int get_user_insn(unsigned long tpc)
137 if (!pte_present(pte)) 139 if (!pte_present(pte))
138 goto out; 140 goto out;
139 141
140 pa = (pte_val(pte) & _PAGE_PADDR); 142 pa = (pte_pfn(pte) << PAGE_SHIFT);
141 pa += (tpc & ~PAGE_MASK); 143 pa += (tpc & ~PAGE_MASK);
142 144
143 /* Use phys bypass so we don't pollute dtlb/dcache. */ 145 /* Use phys bypass so we don't pollute dtlb/dcache. */
@@ -257,7 +259,7 @@ asmlinkage void __kprobes do_sparc64_fault(struct pt_regs *regs)
257 struct vm_area_struct *vma; 259 struct vm_area_struct *vma;
258 unsigned int insn = 0; 260 unsigned int insn = 0;
259 int si_code, fault_code; 261 int si_code, fault_code;
260 unsigned long address; 262 unsigned long address, mm_rss;
261 263
262 fault_code = get_thread_fault_code(); 264 fault_code = get_thread_fault_code();
263 265
@@ -280,7 +282,7 @@ asmlinkage void __kprobes do_sparc64_fault(struct pt_regs *regs)
280 (tpc >= MODULES_VADDR && tpc < MODULES_END)) { 282 (tpc >= MODULES_VADDR && tpc < MODULES_END)) {
281 /* Valid, no problems... */ 283 /* Valid, no problems... */
282 } else { 284 } else {
283 bad_kernel_pc(regs); 285 bad_kernel_pc(regs, address);
284 return; 286 return;
285 } 287 }
286 } 288 }
@@ -406,6 +408,20 @@ good_area:
406 } 408 }
407 409
408 up_read(&mm->mmap_sem); 410 up_read(&mm->mmap_sem);
411
412 mm_rss = get_mm_rss(mm);
413#ifdef CONFIG_HUGETLB_PAGE
414 mm_rss -= (mm->context.huge_pte_count * (HPAGE_SIZE / PAGE_SIZE));
415#endif
416 if (unlikely(mm_rss >
417 mm->context.tsb_block[MM_TSB_BASE].tsb_rss_limit))
418 tsb_grow(mm, MM_TSB_BASE, mm_rss);
419#ifdef CONFIG_HUGETLB_PAGE
420 mm_rss = mm->context.huge_pte_count;
421 if (unlikely(mm_rss >
422 mm->context.tsb_block[MM_TSB_HUGE].tsb_rss_limit))
423 tsb_grow(mm, MM_TSB_HUGE, mm_rss);
424#endif
409 return; 425 return;
410 426
411 /* 427 /*
diff --git a/arch/sparc64/mm/generic.c b/arch/sparc64/mm/generic.c
index 580b63da836b..8cb06205d265 100644
--- a/arch/sparc64/mm/generic.c
+++ b/arch/sparc64/mm/generic.c
@@ -15,15 +15,6 @@
15#include <asm/page.h> 15#include <asm/page.h>
16#include <asm/tlbflush.h> 16#include <asm/tlbflush.h>
17 17
18static inline pte_t mk_pte_io(unsigned long page, pgprot_t prot, int space)
19{
20 pte_t pte;
21 pte_val(pte) = (((page) | pgprot_val(prot) | _PAGE_E) &
22 ~(unsigned long)_PAGE_CACHE);
23 pte_val(pte) |= (((unsigned long)space) << 32);
24 return pte;
25}
26
27/* Remap IO memory, the same way as remap_pfn_range(), but use 18/* Remap IO memory, the same way as remap_pfn_range(), but use
28 * the obio memory space. 19 * the obio memory space.
29 * 20 *
@@ -48,24 +39,29 @@ static inline void io_remap_pte_range(struct mm_struct *mm, pte_t * pte,
48 pte_t entry; 39 pte_t entry;
49 unsigned long curend = address + PAGE_SIZE; 40 unsigned long curend = address + PAGE_SIZE;
50 41
51 entry = mk_pte_io(offset, prot, space); 42 entry = mk_pte_io(offset, prot, space, PAGE_SIZE);
52 if (!(address & 0xffff)) { 43 if (!(address & 0xffff)) {
53 if (!(address & 0x3fffff) && !(offset & 0x3ffffe) && end >= address + 0x400000) { 44 if (PAGE_SIZE < (4 * 1024 * 1024) &&
54 entry = mk_pte_io(offset, 45 !(address & 0x3fffff) &&
55 __pgprot(pgprot_val (prot) | _PAGE_SZ4MB), 46 !(offset & 0x3ffffe) &&
56 space); 47 end >= address + 0x400000) {
48 entry = mk_pte_io(offset, prot, space,
49 4 * 1024 * 1024);
57 curend = address + 0x400000; 50 curend = address + 0x400000;
58 offset += 0x400000; 51 offset += 0x400000;
59 } else if (!(address & 0x7ffff) && !(offset & 0x7fffe) && end >= address + 0x80000) { 52 } else if (PAGE_SIZE < (512 * 1024) &&
60 entry = mk_pte_io(offset, 53 !(address & 0x7ffff) &&
61 __pgprot(pgprot_val (prot) | _PAGE_SZ512K), 54 !(offset & 0x7fffe) &&
62 space); 55 end >= address + 0x80000) {
56 entry = mk_pte_io(offset, prot, space,
57 512 * 1024 * 1024);
63 curend = address + 0x80000; 58 curend = address + 0x80000;
64 offset += 0x80000; 59 offset += 0x80000;
65 } else if (!(offset & 0xfffe) && end >= address + 0x10000) { 60 } else if (PAGE_SIZE < (64 * 1024) &&
66 entry = mk_pte_io(offset, 61 !(offset & 0xfffe) &&
67 __pgprot(pgprot_val (prot) | _PAGE_SZ64K), 62 end >= address + 0x10000) {
68 space); 63 entry = mk_pte_io(offset, prot, space,
64 64 * 1024);
69 curend = address + 0x10000; 65 curend = address + 0x10000;
70 offset += 0x10000; 66 offset += 0x10000;
71 } else 67 } else
@@ -144,7 +140,6 @@ int io_remap_pfn_range(struct vm_area_struct *vma, unsigned long from,
144 vma->vm_flags |= VM_IO | VM_RESERVED | VM_PFNMAP; 140 vma->vm_flags |= VM_IO | VM_RESERVED | VM_PFNMAP;
145 vma->vm_pgoff = phys_base >> PAGE_SHIFT; 141 vma->vm_pgoff = phys_base >> PAGE_SHIFT;
146 142
147 prot = __pgprot(pg_iobits);
148 offset -= from; 143 offset -= from;
149 dir = pgd_offset(mm, from); 144 dir = pgd_offset(mm, from);
150 flush_cache_range(vma, beg, end); 145 flush_cache_range(vma, beg, end);
diff --git a/arch/sparc64/mm/hugetlbpage.c b/arch/sparc64/mm/hugetlbpage.c
index 625cbb336a23..074620d413d4 100644
--- a/arch/sparc64/mm/hugetlbpage.c
+++ b/arch/sparc64/mm/hugetlbpage.c
@@ -1,7 +1,7 @@
1/* 1/*
2 * SPARC64 Huge TLB page support. 2 * SPARC64 Huge TLB page support.
3 * 3 *
4 * Copyright (C) 2002, 2003 David S. Miller (davem@redhat.com) 4 * Copyright (C) 2002, 2003, 2006 David S. Miller (davem@davemloft.net)
5 */ 5 */
6 6
7#include <linux/config.h> 7#include <linux/config.h>
@@ -22,6 +22,175 @@
22#include <asm/cacheflush.h> 22#include <asm/cacheflush.h>
23#include <asm/mmu_context.h> 23#include <asm/mmu_context.h>
24 24
25/* Slightly simplified from the non-hugepage variant because by
26 * definition we don't have to worry about any page coloring stuff
27 */
28#define VA_EXCLUDE_START (0x0000080000000000UL - (1UL << 32UL))
29#define VA_EXCLUDE_END (0xfffff80000000000UL + (1UL << 32UL))
30
31static unsigned long hugetlb_get_unmapped_area_bottomup(struct file *filp,
32 unsigned long addr,
33 unsigned long len,
34 unsigned long pgoff,
35 unsigned long flags)
36{
37 struct mm_struct *mm = current->mm;
38 struct vm_area_struct * vma;
39 unsigned long task_size = TASK_SIZE;
40 unsigned long start_addr;
41
42 if (test_thread_flag(TIF_32BIT))
43 task_size = STACK_TOP32;
44 if (unlikely(len >= VA_EXCLUDE_START))
45 return -ENOMEM;
46
47 if (len > mm->cached_hole_size) {
48 start_addr = addr = mm->free_area_cache;
49 } else {
50 start_addr = addr = TASK_UNMAPPED_BASE;
51 mm->cached_hole_size = 0;
52 }
53
54 task_size -= len;
55
56full_search:
57 addr = ALIGN(addr, HPAGE_SIZE);
58
59 for (vma = find_vma(mm, addr); ; vma = vma->vm_next) {
60 /* At this point: (!vma || addr < vma->vm_end). */
61 if (addr < VA_EXCLUDE_START &&
62 (addr + len) >= VA_EXCLUDE_START) {
63 addr = VA_EXCLUDE_END;
64 vma = find_vma(mm, VA_EXCLUDE_END);
65 }
66 if (unlikely(task_size < addr)) {
67 if (start_addr != TASK_UNMAPPED_BASE) {
68 start_addr = addr = TASK_UNMAPPED_BASE;
69 mm->cached_hole_size = 0;
70 goto full_search;
71 }
72 return -ENOMEM;
73 }
74 if (likely(!vma || addr + len <= vma->vm_start)) {
75 /*
76 * Remember the place where we stopped the search:
77 */
78 mm->free_area_cache = addr + len;
79 return addr;
80 }
81 if (addr + mm->cached_hole_size < vma->vm_start)
82 mm->cached_hole_size = vma->vm_start - addr;
83
84 addr = ALIGN(vma->vm_end, HPAGE_SIZE);
85 }
86}
87
88static unsigned long
89hugetlb_get_unmapped_area_topdown(struct file *filp, const unsigned long addr0,
90 const unsigned long len,
91 const unsigned long pgoff,
92 const unsigned long flags)
93{
94 struct vm_area_struct *vma;
95 struct mm_struct *mm = current->mm;
96 unsigned long addr = addr0;
97
98 /* This should only ever run for 32-bit processes. */
99 BUG_ON(!test_thread_flag(TIF_32BIT));
100
101 /* check if free_area_cache is useful for us */
102 if (len <= mm->cached_hole_size) {
103 mm->cached_hole_size = 0;
104 mm->free_area_cache = mm->mmap_base;
105 }
106
107 /* either no address requested or can't fit in requested address hole */
108 addr = mm->free_area_cache & HPAGE_MASK;
109
110 /* make sure it can fit in the remaining address space */
111 if (likely(addr > len)) {
112 vma = find_vma(mm, addr-len);
113 if (!vma || addr <= vma->vm_start) {
114 /* remember the address as a hint for next time */
115 return (mm->free_area_cache = addr-len);
116 }
117 }
118
119 if (unlikely(mm->mmap_base < len))
120 goto bottomup;
121
122 addr = (mm->mmap_base-len) & HPAGE_MASK;
123
124 do {
125 /*
126 * Lookup failure means no vma is above this address,
127 * else if new region fits below vma->vm_start,
128 * return with success:
129 */
130 vma = find_vma(mm, addr);
131 if (likely(!vma || addr+len <= vma->vm_start)) {
132 /* remember the address as a hint for next time */
133 return (mm->free_area_cache = addr);
134 }
135
136 /* remember the largest hole we saw so far */
137 if (addr + mm->cached_hole_size < vma->vm_start)
138 mm->cached_hole_size = vma->vm_start - addr;
139
140 /* try just below the current vma->vm_start */
141 addr = (vma->vm_start-len) & HPAGE_MASK;
142 } while (likely(len < vma->vm_start));
143
144bottomup:
145 /*
146 * A failed mmap() very likely causes application failure,
147 * so fall back to the bottom-up function here. This scenario
148 * can happen with large stack limits and large mmap()
149 * allocations.
150 */
151 mm->cached_hole_size = ~0UL;
152 mm->free_area_cache = TASK_UNMAPPED_BASE;
153 addr = arch_get_unmapped_area(filp, addr0, len, pgoff, flags);
154 /*
155 * Restore the topdown base:
156 */
157 mm->free_area_cache = mm->mmap_base;
158 mm->cached_hole_size = ~0UL;
159
160 return addr;
161}
162
163unsigned long
164hugetlb_get_unmapped_area(struct file *file, unsigned long addr,
165 unsigned long len, unsigned long pgoff, unsigned long flags)
166{
167 struct mm_struct *mm = current->mm;
168 struct vm_area_struct *vma;
169 unsigned long task_size = TASK_SIZE;
170
171 if (test_thread_flag(TIF_32BIT))
172 task_size = STACK_TOP32;
173
174 if (len & ~HPAGE_MASK)
175 return -EINVAL;
176 if (len > task_size)
177 return -ENOMEM;
178
179 if (addr) {
180 addr = ALIGN(addr, HPAGE_SIZE);
181 vma = find_vma(mm, addr);
182 if (task_size - len >= addr &&
183 (!vma || addr + len <= vma->vm_start))
184 return addr;
185 }
186 if (mm->get_unmapped_area == arch_get_unmapped_area)
187 return hugetlb_get_unmapped_area_bottomup(file, addr, len,
188 pgoff, flags);
189 else
190 return hugetlb_get_unmapped_area_topdown(file, addr, len,
191 pgoff, flags);
192}
193
25pte_t *huge_pte_alloc(struct mm_struct *mm, unsigned long addr) 194pte_t *huge_pte_alloc(struct mm_struct *mm, unsigned long addr)
26{ 195{
27 pgd_t *pgd; 196 pgd_t *pgd;
@@ -30,13 +199,11 @@ pte_t *huge_pte_alloc(struct mm_struct *mm, unsigned long addr)
30 pte_t *pte = NULL; 199 pte_t *pte = NULL;
31 200
32 pgd = pgd_offset(mm, addr); 201 pgd = pgd_offset(mm, addr);
33 if (pgd) { 202 pud = pud_alloc(mm, pgd, addr);
34 pud = pud_offset(pgd, addr); 203 if (pud) {
35 if (pud) { 204 pmd = pmd_alloc(mm, pud, addr);
36 pmd = pmd_alloc(mm, pud, addr); 205 if (pmd)
37 if (pmd) 206 pte = pte_alloc_map(mm, pmd, addr);
38 pte = pte_alloc_map(mm, pmd, addr);
39 }
40 } 207 }
41 return pte; 208 return pte;
42} 209}
@@ -48,25 +215,28 @@ pte_t *huge_pte_offset(struct mm_struct *mm, unsigned long addr)
48 pmd_t *pmd; 215 pmd_t *pmd;
49 pte_t *pte = NULL; 216 pte_t *pte = NULL;
50 217
218 addr &= HPAGE_MASK;
219
51 pgd = pgd_offset(mm, addr); 220 pgd = pgd_offset(mm, addr);
52 if (pgd) { 221 if (!pgd_none(*pgd)) {
53 pud = pud_offset(pgd, addr); 222 pud = pud_offset(pgd, addr);
54 if (pud) { 223 if (!pud_none(*pud)) {
55 pmd = pmd_offset(pud, addr); 224 pmd = pmd_offset(pud, addr);
56 if (pmd) 225 if (!pmd_none(*pmd))
57 pte = pte_offset_map(pmd, addr); 226 pte = pte_offset_map(pmd, addr);
58 } 227 }
59 } 228 }
60 return pte; 229 return pte;
61} 230}
62 231
63#define mk_pte_huge(entry) do { pte_val(entry) |= _PAGE_SZHUGE; } while (0)
64
65void set_huge_pte_at(struct mm_struct *mm, unsigned long addr, 232void set_huge_pte_at(struct mm_struct *mm, unsigned long addr,
66 pte_t *ptep, pte_t entry) 233 pte_t *ptep, pte_t entry)
67{ 234{
68 int i; 235 int i;
69 236
237 if (!pte_present(*ptep) && pte_present(entry))
238 mm->context.huge_pte_count++;
239
70 for (i = 0; i < (1 << HUGETLB_PAGE_ORDER); i++) { 240 for (i = 0; i < (1 << HUGETLB_PAGE_ORDER); i++) {
71 set_pte_at(mm, addr, ptep, entry); 241 set_pte_at(mm, addr, ptep, entry);
72 ptep++; 242 ptep++;
@@ -82,6 +252,8 @@ pte_t huge_ptep_get_and_clear(struct mm_struct *mm, unsigned long addr,
82 int i; 252 int i;
83 253
84 entry = *ptep; 254 entry = *ptep;
255 if (pte_present(entry))
256 mm->context.huge_pte_count--;
85 257
86 for (i = 0; i < (1 << HUGETLB_PAGE_ORDER); i++) { 258 for (i = 0; i < (1 << HUGETLB_PAGE_ORDER); i++) {
87 pte_clear(mm, addr, ptep); 259 pte_clear(mm, addr, ptep);
@@ -92,18 +264,6 @@ pte_t huge_ptep_get_and_clear(struct mm_struct *mm, unsigned long addr,
92 return entry; 264 return entry;
93} 265}
94 266
95/*
96 * This function checks for proper alignment of input addr and len parameters.
97 */
98int is_aligned_hugepage_range(unsigned long addr, unsigned long len)
99{
100 if (len & ~HPAGE_MASK)
101 return -EINVAL;
102 if (addr & ~HPAGE_MASK)
103 return -EINVAL;
104 return 0;
105}
106
107struct page *follow_huge_addr(struct mm_struct *mm, 267struct page *follow_huge_addr(struct mm_struct *mm,
108 unsigned long address, int write) 268 unsigned long address, int write)
109{ 269{
@@ -131,6 +291,15 @@ static void context_reload(void *__data)
131 291
132void hugetlb_prefault_arch_hook(struct mm_struct *mm) 292void hugetlb_prefault_arch_hook(struct mm_struct *mm)
133{ 293{
294 struct tsb_config *tp = &mm->context.tsb_block[MM_TSB_HUGE];
295
296 if (likely(tp->tsb != NULL))
297 return;
298
299 tsb_grow(mm, MM_TSB_HUGE, 0);
300 tsb_context_switch(mm);
301 smp_tsb_sync(mm);
302
134 /* On UltraSPARC-III+ and later, configure the second half of 303 /* On UltraSPARC-III+ and later, configure the second half of
135 * the Data-TLB for huge pages. 304 * the Data-TLB for huge pages.
136 */ 305 */
diff --git a/arch/sparc64/mm/init.c b/arch/sparc64/mm/init.c
index 1e44ee26cee8..1539a8362b6f 100644
--- a/arch/sparc64/mm/init.c
+++ b/arch/sparc64/mm/init.c
@@ -6,6 +6,7 @@
6 */ 6 */
7 7
8#include <linux/config.h> 8#include <linux/config.h>
9#include <linux/module.h>
9#include <linux/kernel.h> 10#include <linux/kernel.h>
10#include <linux/sched.h> 11#include <linux/sched.h>
11#include <linux/string.h> 12#include <linux/string.h>
@@ -39,9 +40,27 @@
39#include <asm/tlb.h> 40#include <asm/tlb.h>
40#include <asm/spitfire.h> 41#include <asm/spitfire.h>
41#include <asm/sections.h> 42#include <asm/sections.h>
43#include <asm/tsb.h>
44#include <asm/hypervisor.h>
42 45
43extern void device_scan(void); 46extern void device_scan(void);
44 47
48#define MAX_PHYS_ADDRESS (1UL << 42UL)
49#define KPTE_BITMAP_CHUNK_SZ (256UL * 1024UL * 1024UL)
50#define KPTE_BITMAP_BYTES \
51 ((MAX_PHYS_ADDRESS / KPTE_BITMAP_CHUNK_SZ) / 8)
52
53unsigned long kern_linear_pte_xor[2] __read_mostly;
54
55/* A bitmap, one bit for every 256MB of physical memory. If the bit
56 * is clear, we should use a 4MB page (via kern_linear_pte_xor[0]) else
57 * if set we should use a 256MB page (via kern_linear_pte_xor[1]).
58 */
59unsigned long kpte_linear_bitmap[KPTE_BITMAP_BYTES / sizeof(unsigned long)];
60
61/* A special kernel TSB for 4MB and 256MB linear mappings. */
62struct tsb swapper_4m_tsb[KERNEL_TSB4M_NENTRIES];
63
45#define MAX_BANKS 32 64#define MAX_BANKS 32
46 65
47static struct linux_prom64_registers pavail[MAX_BANKS] __initdata; 66static struct linux_prom64_registers pavail[MAX_BANKS] __initdata;
@@ -111,11 +130,9 @@ static void __init read_obp_memory(const char *property,
111 130
112unsigned long *sparc64_valid_addr_bitmap __read_mostly; 131unsigned long *sparc64_valid_addr_bitmap __read_mostly;
113 132
114/* Ugly, but necessary... -DaveM */ 133/* Kernel physical address base and size in bytes. */
115unsigned long phys_base __read_mostly;
116unsigned long kern_base __read_mostly; 134unsigned long kern_base __read_mostly;
117unsigned long kern_size __read_mostly; 135unsigned long kern_size __read_mostly;
118unsigned long pfn_base __read_mostly;
119 136
120/* get_new_mmu_context() uses "cache + 1". */ 137/* get_new_mmu_context() uses "cache + 1". */
121DEFINE_SPINLOCK(ctx_alloc_lock); 138DEFINE_SPINLOCK(ctx_alloc_lock);
@@ -141,24 +158,28 @@ unsigned long sparc64_kern_sec_context __read_mostly;
141 158
142int bigkernel = 0; 159int bigkernel = 0;
143 160
144/* XXX Tune this... */ 161kmem_cache_t *pgtable_cache __read_mostly;
145#define PGT_CACHE_LOW 25 162
146#define PGT_CACHE_HIGH 50 163static void zero_ctor(void *addr, kmem_cache_t *cache, unsigned long flags)
164{
165 clear_page(addr);
166}
167
168extern void tsb_cache_init(void);
147 169
148void check_pgt_cache(void) 170void pgtable_cache_init(void)
149{ 171{
150 preempt_disable(); 172 pgtable_cache = kmem_cache_create("pgtable_cache",
151 if (pgtable_cache_size > PGT_CACHE_HIGH) { 173 PAGE_SIZE, PAGE_SIZE,
152 do { 174 SLAB_HWCACHE_ALIGN |
153 if (pgd_quicklist) 175 SLAB_MUST_HWCACHE_ALIGN,
154 free_pgd_slow(get_pgd_fast()); 176 zero_ctor,
155 if (pte_quicklist[0]) 177 NULL);
156 free_pte_slow(pte_alloc_one_fast(NULL, 0)); 178 if (!pgtable_cache) {
157 if (pte_quicklist[1]) 179 prom_printf("Could not create pgtable_cache\n");
158 free_pte_slow(pte_alloc_one_fast(NULL, 1 << (PAGE_SHIFT + 10))); 180 prom_halt();
159 } while (pgtable_cache_size > PGT_CACHE_LOW);
160 } 181 }
161 preempt_enable(); 182 tsb_cache_init();
162} 183}
163 184
164#ifdef CONFIG_DEBUG_DCFLUSH 185#ifdef CONFIG_DEBUG_DCFLUSH
@@ -168,8 +189,9 @@ atomic_t dcpage_flushes_xcall = ATOMIC_INIT(0);
168#endif 189#endif
169#endif 190#endif
170 191
171__inline__ void flush_dcache_page_impl(struct page *page) 192inline void flush_dcache_page_impl(struct page *page)
172{ 193{
194 BUG_ON(tlb_type == hypervisor);
173#ifdef CONFIG_DEBUG_DCFLUSH 195#ifdef CONFIG_DEBUG_DCFLUSH
174 atomic_inc(&dcpage_flushes); 196 atomic_inc(&dcpage_flushes);
175#endif 197#endif
@@ -186,8 +208,8 @@ __inline__ void flush_dcache_page_impl(struct page *page)
186} 208}
187 209
188#define PG_dcache_dirty PG_arch_1 210#define PG_dcache_dirty PG_arch_1
189#define PG_dcache_cpu_shift 24 211#define PG_dcache_cpu_shift 24UL
190#define PG_dcache_cpu_mask (256 - 1) 212#define PG_dcache_cpu_mask (256UL - 1UL)
191 213
192#if NR_CPUS > 256 214#if NR_CPUS > 256
193#error D-cache dirty tracking and thread_info->cpu need fixing for > 256 cpus 215#error D-cache dirty tracking and thread_info->cpu need fixing for > 256 cpus
@@ -243,32 +265,78 @@ static __inline__ void clear_dcache_dirty_cpu(struct page *page, unsigned long c
243 : "g1", "g7"); 265 : "g1", "g7");
244} 266}
245 267
268static inline void tsb_insert(struct tsb *ent, unsigned long tag, unsigned long pte)
269{
270 unsigned long tsb_addr = (unsigned long) ent;
271
272 if (tlb_type == cheetah_plus || tlb_type == hypervisor)
273 tsb_addr = __pa(tsb_addr);
274
275 __tsb_insert(tsb_addr, tag, pte);
276}
277
278unsigned long _PAGE_ALL_SZ_BITS __read_mostly;
279unsigned long _PAGE_SZBITS __read_mostly;
280
246void update_mmu_cache(struct vm_area_struct *vma, unsigned long address, pte_t pte) 281void update_mmu_cache(struct vm_area_struct *vma, unsigned long address, pte_t pte)
247{ 282{
248 struct page *page; 283 struct mm_struct *mm;
249 unsigned long pfn; 284 struct tsb *tsb;
250 unsigned long pg_flags; 285 unsigned long tag, flags;
251 286 unsigned long tsb_index, tsb_hash_shift;
252 pfn = pte_pfn(pte); 287
253 if (pfn_valid(pfn) && 288 if (tlb_type != hypervisor) {
254 (page = pfn_to_page(pfn), page_mapping(page)) && 289 unsigned long pfn = pte_pfn(pte);
255 ((pg_flags = page->flags) & (1UL << PG_dcache_dirty))) { 290 unsigned long pg_flags;
256 int cpu = ((pg_flags >> PG_dcache_cpu_shift) & 291 struct page *page;
257 PG_dcache_cpu_mask); 292
258 int this_cpu = get_cpu(); 293 if (pfn_valid(pfn) &&
259 294 (page = pfn_to_page(pfn), page_mapping(page)) &&
260 /* This is just to optimize away some function calls 295 ((pg_flags = page->flags) & (1UL << PG_dcache_dirty))) {
261 * in the SMP case. 296 int cpu = ((pg_flags >> PG_dcache_cpu_shift) &
262 */ 297 PG_dcache_cpu_mask);
263 if (cpu == this_cpu) 298 int this_cpu = get_cpu();
264 flush_dcache_page_impl(page); 299
265 else 300 /* This is just to optimize away some function calls
266 smp_flush_dcache_page_impl(page, cpu); 301 * in the SMP case.
302 */
303 if (cpu == this_cpu)
304 flush_dcache_page_impl(page);
305 else
306 smp_flush_dcache_page_impl(page, cpu);
307
308 clear_dcache_dirty_cpu(page, cpu);
267 309
268 clear_dcache_dirty_cpu(page, cpu); 310 put_cpu();
311 }
312 }
269 313
270 put_cpu(); 314 mm = vma->vm_mm;
315
316 tsb_index = MM_TSB_BASE;
317 tsb_hash_shift = PAGE_SHIFT;
318
319 spin_lock_irqsave(&mm->context.lock, flags);
320
321#ifdef CONFIG_HUGETLB_PAGE
322 if (mm->context.tsb_block[MM_TSB_HUGE].tsb != NULL) {
323 if ((tlb_type == hypervisor &&
324 (pte_val(pte) & _PAGE_SZALL_4V) == _PAGE_SZHUGE_4V) ||
325 (tlb_type != hypervisor &&
326 (pte_val(pte) & _PAGE_SZALL_4U) == _PAGE_SZHUGE_4U)) {
327 tsb_index = MM_TSB_HUGE;
328 tsb_hash_shift = HPAGE_SHIFT;
329 }
271 } 330 }
331#endif
332
333 tsb = mm->context.tsb_block[tsb_index].tsb;
334 tsb += ((address >> tsb_hash_shift) &
335 (mm->context.tsb_block[tsb_index].tsb_nentries - 1UL));
336 tag = (address >> 22UL);
337 tsb_insert(tsb, tag, pte_val(pte));
338
339 spin_unlock_irqrestore(&mm->context.lock, flags);
272} 340}
273 341
274void flush_dcache_page(struct page *page) 342void flush_dcache_page(struct page *page)
@@ -276,6 +344,9 @@ void flush_dcache_page(struct page *page)
276 struct address_space *mapping; 344 struct address_space *mapping;
277 int this_cpu; 345 int this_cpu;
278 346
347 if (tlb_type == hypervisor)
348 return;
349
279 /* Do not bother with the expensive D-cache flush if it 350 /* Do not bother with the expensive D-cache flush if it
280 * is merely the zero page. The 'bigcore' testcase in GDB 351 * is merely the zero page. The 'bigcore' testcase in GDB
281 * causes this case to run millions of times. 352 * causes this case to run millions of times.
@@ -311,7 +382,7 @@ out:
311 382
312void __kprobes flush_icache_range(unsigned long start, unsigned long end) 383void __kprobes flush_icache_range(unsigned long start, unsigned long end)
313{ 384{
314 /* Cheetah has coherent I-cache. */ 385 /* Cheetah and Hypervisor platform cpus have coherent I-cache. */
315 if (tlb_type == spitfire) { 386 if (tlb_type == spitfire) {
316 unsigned long kaddr; 387 unsigned long kaddr;
317 388
@@ -320,16 +391,6 @@ void __kprobes flush_icache_range(unsigned long start, unsigned long end)
320 } 391 }
321} 392}
322 393
323unsigned long page_to_pfn(struct page *page)
324{
325 return (unsigned long) ((page - mem_map) + pfn_base);
326}
327
328struct page *pfn_to_page(unsigned long pfn)
329{
330 return (mem_map + (pfn - pfn_base));
331}
332
333void show_mem(void) 394void show_mem(void)
334{ 395{
335 printk("Mem-info:\n"); 396 printk("Mem-info:\n");
@@ -338,7 +399,6 @@ void show_mem(void)
338 nr_swap_pages << (PAGE_SHIFT-10)); 399 nr_swap_pages << (PAGE_SHIFT-10));
339 printk("%ld pages of RAM\n", num_physpages); 400 printk("%ld pages of RAM\n", num_physpages);
340 printk("%d free pages\n", nr_free_pages()); 401 printk("%d free pages\n", nr_free_pages());
341 printk("%d pages in page table cache\n",pgtable_cache_size);
342} 402}
343 403
344void mmu_info(struct seq_file *m) 404void mmu_info(struct seq_file *m)
@@ -349,6 +409,8 @@ void mmu_info(struct seq_file *m)
349 seq_printf(m, "MMU Type\t: Cheetah+\n"); 409 seq_printf(m, "MMU Type\t: Cheetah+\n");
350 else if (tlb_type == spitfire) 410 else if (tlb_type == spitfire)
351 seq_printf(m, "MMU Type\t: Spitfire\n"); 411 seq_printf(m, "MMU Type\t: Spitfire\n");
412 else if (tlb_type == hypervisor)
413 seq_printf(m, "MMU Type\t: Hypervisor (sun4v)\n");
352 else 414 else
353 seq_printf(m, "MMU Type\t: ???\n"); 415 seq_printf(m, "MMU Type\t: ???\n");
354 416
@@ -371,45 +433,13 @@ struct linux_prom_translation {
371/* Exported for kernel TLB miss handling in ktlb.S */ 433/* Exported for kernel TLB miss handling in ktlb.S */
372struct linux_prom_translation prom_trans[512] __read_mostly; 434struct linux_prom_translation prom_trans[512] __read_mostly;
373unsigned int prom_trans_ents __read_mostly; 435unsigned int prom_trans_ents __read_mostly;
374unsigned int swapper_pgd_zero __read_mostly;
375
376extern unsigned long prom_boot_page;
377extern void prom_remap(unsigned long physpage, unsigned long virtpage, int mmu_ihandle);
378extern int prom_get_mmu_ihandle(void);
379extern void register_prom_callbacks(void);
380 436
381/* Exported for SMP bootup purposes. */ 437/* Exported for SMP bootup purposes. */
382unsigned long kern_locked_tte_data; 438unsigned long kern_locked_tte_data;
383 439
384/*
385 * Translate PROM's mapping we capture at boot time into physical address.
386 * The second parameter is only set from prom_callback() invocations.
387 */
388unsigned long prom_virt_to_phys(unsigned long promva, int *error)
389{
390 int i;
391
392 for (i = 0; i < prom_trans_ents; i++) {
393 struct linux_prom_translation *p = &prom_trans[i];
394
395 if (promva >= p->virt &&
396 promva < (p->virt + p->size)) {
397 unsigned long base = p->data & _PAGE_PADDR;
398
399 if (error)
400 *error = 0;
401 return base + (promva & (8192 - 1));
402 }
403 }
404 if (error)
405 *error = 1;
406 return 0UL;
407}
408
409/* The obp translations are saved based on 8k pagesize, since obp can 440/* The obp translations are saved based on 8k pagesize, since obp can
410 * use a mixture of pagesizes. Misses to the LOW_OBP_ADDRESS -> 441 * use a mixture of pagesizes. Misses to the LOW_OBP_ADDRESS ->
411 * HI_OBP_ADDRESS range are handled in ktlb.S and do not use the vpte 442 * HI_OBP_ADDRESS range are handled in ktlb.S.
412 * scheme (also, see rant in inherit_locked_prom_mappings()).
413 */ 443 */
414static inline int in_obp_range(unsigned long vaddr) 444static inline int in_obp_range(unsigned long vaddr)
415{ 445{
@@ -490,6 +520,36 @@ static void __init read_obp_translations(void)
490 } 520 }
491} 521}
492 522
523static void __init hypervisor_tlb_lock(unsigned long vaddr,
524 unsigned long pte,
525 unsigned long mmu)
526{
527 register unsigned long func asm("%o5");
528 register unsigned long arg0 asm("%o0");
529 register unsigned long arg1 asm("%o1");
530 register unsigned long arg2 asm("%o2");
531 register unsigned long arg3 asm("%o3");
532
533 func = HV_FAST_MMU_MAP_PERM_ADDR;
534 arg0 = vaddr;
535 arg1 = 0;
536 arg2 = pte;
537 arg3 = mmu;
538 __asm__ __volatile__("ta 0x80"
539 : "=&r" (func), "=&r" (arg0),
540 "=&r" (arg1), "=&r" (arg2),
541 "=&r" (arg3)
542 : "0" (func), "1" (arg0), "2" (arg1),
543 "3" (arg2), "4" (arg3));
544 if (arg0 != 0) {
545 prom_printf("hypervisor_tlb_lock[%lx:%lx:%lx:%lx]: "
546 "errors with %lx\n", vaddr, 0, pte, mmu, arg0);
547 prom_halt();
548 }
549}
550
551static unsigned long kern_large_tte(unsigned long paddr);
552
493static void __init remap_kernel(void) 553static void __init remap_kernel(void)
494{ 554{
495 unsigned long phys_page, tte_vaddr, tte_data; 555 unsigned long phys_page, tte_vaddr, tte_data;
@@ -497,25 +557,34 @@ static void __init remap_kernel(void)
497 557
498 tte_vaddr = (unsigned long) KERNBASE; 558 tte_vaddr = (unsigned long) KERNBASE;
499 phys_page = (prom_boot_mapping_phys_low >> 22UL) << 22UL; 559 phys_page = (prom_boot_mapping_phys_low >> 22UL) << 22UL;
500 tte_data = (phys_page | (_PAGE_VALID | _PAGE_SZ4MB | 560 tte_data = kern_large_tte(phys_page);
501 _PAGE_CP | _PAGE_CV | _PAGE_P |
502 _PAGE_L | _PAGE_W));
503 561
504 kern_locked_tte_data = tte_data; 562 kern_locked_tte_data = tte_data;
505 563
506 /* Now lock us into the TLBs via OBP. */ 564 /* Now lock us into the TLBs via Hypervisor or OBP. */
507 prom_dtlb_load(tlb_ent, tte_data, tte_vaddr); 565 if (tlb_type == hypervisor) {
508 prom_itlb_load(tlb_ent, tte_data, tte_vaddr); 566 hypervisor_tlb_lock(tte_vaddr, tte_data, HV_MMU_DMMU);
509 if (bigkernel) { 567 hypervisor_tlb_lock(tte_vaddr, tte_data, HV_MMU_IMMU);
510 tlb_ent -= 1; 568 if (bigkernel) {
511 prom_dtlb_load(tlb_ent, 569 tte_vaddr += 0x400000;
512 tte_data + 0x400000, 570 tte_data += 0x400000;
513 tte_vaddr + 0x400000); 571 hypervisor_tlb_lock(tte_vaddr, tte_data, HV_MMU_DMMU);
514 prom_itlb_load(tlb_ent, 572 hypervisor_tlb_lock(tte_vaddr, tte_data, HV_MMU_IMMU);
515 tte_data + 0x400000, 573 }
516 tte_vaddr + 0x400000); 574 } else {
575 prom_dtlb_load(tlb_ent, tte_data, tte_vaddr);
576 prom_itlb_load(tlb_ent, tte_data, tte_vaddr);
577 if (bigkernel) {
578 tlb_ent -= 1;
579 prom_dtlb_load(tlb_ent,
580 tte_data + 0x400000,
581 tte_vaddr + 0x400000);
582 prom_itlb_load(tlb_ent,
583 tte_data + 0x400000,
584 tte_vaddr + 0x400000);
585 }
586 sparc64_highest_unlocked_tlb_ent = tlb_ent - 1;
517 } 587 }
518 sparc64_highest_unlocked_tlb_ent = tlb_ent - 1;
519 if (tlb_type == cheetah_plus) { 588 if (tlb_type == cheetah_plus) {
520 sparc64_kern_pri_context = (CTX_CHEETAH_PLUS_CTX0 | 589 sparc64_kern_pri_context = (CTX_CHEETAH_PLUS_CTX0 |
521 CTX_CHEETAH_PLUS_NUC); 590 CTX_CHEETAH_PLUS_NUC);
@@ -533,372 +602,14 @@ static void __init inherit_prom_mappings(void)
533 prom_printf("Remapping the kernel... "); 602 prom_printf("Remapping the kernel... ");
534 remap_kernel(); 603 remap_kernel();
535 prom_printf("done.\n"); 604 prom_printf("done.\n");
536
537 prom_printf("Registering callbacks... ");
538 register_prom_callbacks();
539 prom_printf("done.\n");
540} 605}
541 606
542/* The OBP specifications for sun4u mark 0xfffffffc00000000 and
543 * upwards as reserved for use by the firmware (I wonder if this
544 * will be the same on Cheetah...). We use this virtual address
545 * range for the VPTE table mappings of the nucleus so we need
546 * to zap them when we enter the PROM. -DaveM
547 */
548static void __flush_nucleus_vptes(void)
549{
550 unsigned long prom_reserved_base = 0xfffffffc00000000UL;
551 int i;
552
553 /* Only DTLB must be checked for VPTE entries. */
554 if (tlb_type == spitfire) {
555 for (i = 0; i < 63; i++) {
556 unsigned long tag;
557
558 /* Spitfire Errata #32 workaround */
559 /* NOTE: Always runs on spitfire, so no cheetah+
560 * page size encodings.
561 */
562 __asm__ __volatile__("stxa %0, [%1] %2\n\t"
563 "flush %%g6"
564 : /* No outputs */
565 : "r" (0),
566 "r" (PRIMARY_CONTEXT), "i" (ASI_DMMU));
567
568 tag = spitfire_get_dtlb_tag(i);
569 if (((tag & ~(PAGE_MASK)) == 0) &&
570 ((tag & (PAGE_MASK)) >= prom_reserved_base)) {
571 __asm__ __volatile__("stxa %%g0, [%0] %1\n\t"
572 "membar #Sync"
573 : /* no outputs */
574 : "r" (TLB_TAG_ACCESS), "i" (ASI_DMMU));
575 spitfire_put_dtlb_data(i, 0x0UL);
576 }
577 }
578 } else if (tlb_type == cheetah || tlb_type == cheetah_plus) {
579 for (i = 0; i < 512; i++) {
580 unsigned long tag = cheetah_get_dtlb_tag(i, 2);
581
582 if ((tag & ~PAGE_MASK) == 0 &&
583 (tag & PAGE_MASK) >= prom_reserved_base) {
584 __asm__ __volatile__("stxa %%g0, [%0] %1\n\t"
585 "membar #Sync"
586 : /* no outputs */
587 : "r" (TLB_TAG_ACCESS), "i" (ASI_DMMU));
588 cheetah_put_dtlb_data(i, 0x0UL, 2);
589 }
590
591 if (tlb_type != cheetah_plus)
592 continue;
593
594 tag = cheetah_get_dtlb_tag(i, 3);
595
596 if ((tag & ~PAGE_MASK) == 0 &&
597 (tag & PAGE_MASK) >= prom_reserved_base) {
598 __asm__ __volatile__("stxa %%g0, [%0] %1\n\t"
599 "membar #Sync"
600 : /* no outputs */
601 : "r" (TLB_TAG_ACCESS), "i" (ASI_DMMU));
602 cheetah_put_dtlb_data(i, 0x0UL, 3);
603 }
604 }
605 } else {
606 /* Implement me :-) */
607 BUG();
608 }
609}
610
611static int prom_ditlb_set;
612struct prom_tlb_entry {
613 int tlb_ent;
614 unsigned long tlb_tag;
615 unsigned long tlb_data;
616};
617struct prom_tlb_entry prom_itlb[16], prom_dtlb[16];
618
619void prom_world(int enter) 607void prom_world(int enter)
620{ 608{
621 unsigned long pstate;
622 int i;
623
624 if (!enter) 609 if (!enter)
625 set_fs((mm_segment_t) { get_thread_current_ds() }); 610 set_fs((mm_segment_t) { get_thread_current_ds() });
626 611
627 if (!prom_ditlb_set) 612 __asm__ __volatile__("flushw");
628 return;
629
630 /* Make sure the following runs atomically. */
631 __asm__ __volatile__("flushw\n\t"
632 "rdpr %%pstate, %0\n\t"
633 "wrpr %0, %1, %%pstate"
634 : "=r" (pstate)
635 : "i" (PSTATE_IE));
636
637 if (enter) {
638 /* Kick out nucleus VPTEs. */
639 __flush_nucleus_vptes();
640
641 /* Install PROM world. */
642 for (i = 0; i < 16; i++) {
643 if (prom_dtlb[i].tlb_ent != -1) {
644 __asm__ __volatile__("stxa %0, [%1] %2\n\t"
645 "membar #Sync"
646 : : "r" (prom_dtlb[i].tlb_tag), "r" (TLB_TAG_ACCESS),
647 "i" (ASI_DMMU));
648 if (tlb_type == spitfire)
649 spitfire_put_dtlb_data(prom_dtlb[i].tlb_ent,
650 prom_dtlb[i].tlb_data);
651 else if (tlb_type == cheetah || tlb_type == cheetah_plus)
652 cheetah_put_ldtlb_data(prom_dtlb[i].tlb_ent,
653 prom_dtlb[i].tlb_data);
654 }
655 if (prom_itlb[i].tlb_ent != -1) {
656 __asm__ __volatile__("stxa %0, [%1] %2\n\t"
657 "membar #Sync"
658 : : "r" (prom_itlb[i].tlb_tag),
659 "r" (TLB_TAG_ACCESS),
660 "i" (ASI_IMMU));
661 if (tlb_type == spitfire)
662 spitfire_put_itlb_data(prom_itlb[i].tlb_ent,
663 prom_itlb[i].tlb_data);
664 else if (tlb_type == cheetah || tlb_type == cheetah_plus)
665 cheetah_put_litlb_data(prom_itlb[i].tlb_ent,
666 prom_itlb[i].tlb_data);
667 }
668 }
669 } else {
670 for (i = 0; i < 16; i++) {
671 if (prom_dtlb[i].tlb_ent != -1) {
672 __asm__ __volatile__("stxa %%g0, [%0] %1\n\t"
673 "membar #Sync"
674 : : "r" (TLB_TAG_ACCESS), "i" (ASI_DMMU));
675 if (tlb_type == spitfire)
676 spitfire_put_dtlb_data(prom_dtlb[i].tlb_ent, 0x0UL);
677 else
678 cheetah_put_ldtlb_data(prom_dtlb[i].tlb_ent, 0x0UL);
679 }
680 if (prom_itlb[i].tlb_ent != -1) {
681 __asm__ __volatile__("stxa %%g0, [%0] %1\n\t"
682 "membar #Sync"
683 : : "r" (TLB_TAG_ACCESS),
684 "i" (ASI_IMMU));
685 if (tlb_type == spitfire)
686 spitfire_put_itlb_data(prom_itlb[i].tlb_ent, 0x0UL);
687 else
688 cheetah_put_litlb_data(prom_itlb[i].tlb_ent, 0x0UL);
689 }
690 }
691 }
692 __asm__ __volatile__("wrpr %0, 0, %%pstate"
693 : : "r" (pstate));
694}
695
696void inherit_locked_prom_mappings(int save_p)
697{
698 int i;
699 int dtlb_seen = 0;
700 int itlb_seen = 0;
701
702 /* Fucking losing PROM has more mappings in the TLB, but
703 * it (conveniently) fails to mention any of these in the
704 * translations property. The only ones that matter are
705 * the locked PROM tlb entries, so we impose the following
706 * irrecovable rule on the PROM, it is allowed 8 locked
707 * entries in the ITLB and 8 in the DTLB.
708 *
709 * Supposedly the upper 16GB of the address space is
710 * reserved for OBP, BUT I WISH THIS WAS DOCUMENTED
711 * SOMEWHERE!!!!!!!!!!!!!!!!! Furthermore the entire interface
712 * used between the client program and the firmware on sun5
713 * systems to coordinate mmu mappings is also COMPLETELY
714 * UNDOCUMENTED!!!!!! Thanks S(t)un!
715 */
716 if (save_p) {
717 for (i = 0; i < 16; i++) {
718 prom_itlb[i].tlb_ent = -1;
719 prom_dtlb[i].tlb_ent = -1;
720 }
721 }
722 if (tlb_type == spitfire) {
723 int high = sparc64_highest_unlocked_tlb_ent;
724 for (i = 0; i <= high; i++) {
725 unsigned long data;
726
727 /* Spitfire Errata #32 workaround */
728 /* NOTE: Always runs on spitfire, so no cheetah+
729 * page size encodings.
730 */
731 __asm__ __volatile__("stxa %0, [%1] %2\n\t"
732 "flush %%g6"
733 : /* No outputs */
734 : "r" (0),
735 "r" (PRIMARY_CONTEXT), "i" (ASI_DMMU));
736
737 data = spitfire_get_dtlb_data(i);
738 if ((data & (_PAGE_L|_PAGE_VALID)) == (_PAGE_L|_PAGE_VALID)) {
739 unsigned long tag;
740
741 /* Spitfire Errata #32 workaround */
742 /* NOTE: Always runs on spitfire, so no
743 * cheetah+ page size encodings.
744 */
745 __asm__ __volatile__("stxa %0, [%1] %2\n\t"
746 "flush %%g6"
747 : /* No outputs */
748 : "r" (0),
749 "r" (PRIMARY_CONTEXT), "i" (ASI_DMMU));
750
751 tag = spitfire_get_dtlb_tag(i);
752 if (save_p) {
753 prom_dtlb[dtlb_seen].tlb_ent = i;
754 prom_dtlb[dtlb_seen].tlb_tag = tag;
755 prom_dtlb[dtlb_seen].tlb_data = data;
756 }
757 __asm__ __volatile__("stxa %%g0, [%0] %1\n\t"
758 "membar #Sync"
759 : : "r" (TLB_TAG_ACCESS), "i" (ASI_DMMU));
760 spitfire_put_dtlb_data(i, 0x0UL);
761
762 dtlb_seen++;
763 if (dtlb_seen > 15)
764 break;
765 }
766 }
767
768 for (i = 0; i < high; i++) {
769 unsigned long data;
770
771 /* Spitfire Errata #32 workaround */
772 /* NOTE: Always runs on spitfire, so no
773 * cheetah+ page size encodings.
774 */
775 __asm__ __volatile__("stxa %0, [%1] %2\n\t"
776 "flush %%g6"
777 : /* No outputs */
778 : "r" (0),
779 "r" (PRIMARY_CONTEXT), "i" (ASI_DMMU));
780
781 data = spitfire_get_itlb_data(i);
782 if ((data & (_PAGE_L|_PAGE_VALID)) == (_PAGE_L|_PAGE_VALID)) {
783 unsigned long tag;
784
785 /* Spitfire Errata #32 workaround */
786 /* NOTE: Always runs on spitfire, so no
787 * cheetah+ page size encodings.
788 */
789 __asm__ __volatile__("stxa %0, [%1] %2\n\t"
790 "flush %%g6"
791 : /* No outputs */
792 : "r" (0),
793 "r" (PRIMARY_CONTEXT), "i" (ASI_DMMU));
794
795 tag = spitfire_get_itlb_tag(i);
796 if (save_p) {
797 prom_itlb[itlb_seen].tlb_ent = i;
798 prom_itlb[itlb_seen].tlb_tag = tag;
799 prom_itlb[itlb_seen].tlb_data = data;
800 }
801 __asm__ __volatile__("stxa %%g0, [%0] %1\n\t"
802 "membar #Sync"
803 : : "r" (TLB_TAG_ACCESS), "i" (ASI_IMMU));
804 spitfire_put_itlb_data(i, 0x0UL);
805
806 itlb_seen++;
807 if (itlb_seen > 15)
808 break;
809 }
810 }
811 } else if (tlb_type == cheetah || tlb_type == cheetah_plus) {
812 int high = sparc64_highest_unlocked_tlb_ent;
813
814 for (i = 0; i <= high; i++) {
815 unsigned long data;
816
817 data = cheetah_get_ldtlb_data(i);
818 if ((data & (_PAGE_L|_PAGE_VALID)) == (_PAGE_L|_PAGE_VALID)) {
819 unsigned long tag;
820
821 tag = cheetah_get_ldtlb_tag(i);
822 if (save_p) {
823 prom_dtlb[dtlb_seen].tlb_ent = i;
824 prom_dtlb[dtlb_seen].tlb_tag = tag;
825 prom_dtlb[dtlb_seen].tlb_data = data;
826 }
827 __asm__ __volatile__("stxa %%g0, [%0] %1\n\t"
828 "membar #Sync"
829 : : "r" (TLB_TAG_ACCESS), "i" (ASI_DMMU));
830 cheetah_put_ldtlb_data(i, 0x0UL);
831
832 dtlb_seen++;
833 if (dtlb_seen > 15)
834 break;
835 }
836 }
837
838 for (i = 0; i < high; i++) {
839 unsigned long data;
840
841 data = cheetah_get_litlb_data(i);
842 if ((data & (_PAGE_L|_PAGE_VALID)) == (_PAGE_L|_PAGE_VALID)) {
843 unsigned long tag;
844
845 tag = cheetah_get_litlb_tag(i);
846 if (save_p) {
847 prom_itlb[itlb_seen].tlb_ent = i;
848 prom_itlb[itlb_seen].tlb_tag = tag;
849 prom_itlb[itlb_seen].tlb_data = data;
850 }
851 __asm__ __volatile__("stxa %%g0, [%0] %1\n\t"
852 "membar #Sync"
853 : : "r" (TLB_TAG_ACCESS), "i" (ASI_IMMU));
854 cheetah_put_litlb_data(i, 0x0UL);
855
856 itlb_seen++;
857 if (itlb_seen > 15)
858 break;
859 }
860 }
861 } else {
862 /* Implement me :-) */
863 BUG();
864 }
865 if (save_p)
866 prom_ditlb_set = 1;
867}
868
869/* Give PROM back his world, done during reboots... */
870void prom_reload_locked(void)
871{
872 int i;
873
874 for (i = 0; i < 16; i++) {
875 if (prom_dtlb[i].tlb_ent != -1) {
876 __asm__ __volatile__("stxa %0, [%1] %2\n\t"
877 "membar #Sync"
878 : : "r" (prom_dtlb[i].tlb_tag), "r" (TLB_TAG_ACCESS),
879 "i" (ASI_DMMU));
880 if (tlb_type == spitfire)
881 spitfire_put_dtlb_data(prom_dtlb[i].tlb_ent,
882 prom_dtlb[i].tlb_data);
883 else if (tlb_type == cheetah || tlb_type == cheetah_plus)
884 cheetah_put_ldtlb_data(prom_dtlb[i].tlb_ent,
885 prom_dtlb[i].tlb_data);
886 }
887
888 if (prom_itlb[i].tlb_ent != -1) {
889 __asm__ __volatile__("stxa %0, [%1] %2\n\t"
890 "membar #Sync"
891 : : "r" (prom_itlb[i].tlb_tag),
892 "r" (TLB_TAG_ACCESS),
893 "i" (ASI_IMMU));
894 if (tlb_type == spitfire)
895 spitfire_put_itlb_data(prom_itlb[i].tlb_ent,
896 prom_itlb[i].tlb_data);
897 else
898 cheetah_put_litlb_data(prom_itlb[i].tlb_ent,
899 prom_itlb[i].tlb_data);
900 }
901 }
902} 613}
903 614
904#ifdef DCACHE_ALIASING_POSSIBLE 615#ifdef DCACHE_ALIASING_POSSIBLE
@@ -914,7 +625,7 @@ void __flush_dcache_range(unsigned long start, unsigned long end)
914 if (++n >= 512) 625 if (++n >= 512)
915 break; 626 break;
916 } 627 }
917 } else { 628 } else if (tlb_type == cheetah || tlb_type == cheetah_plus) {
918 start = __pa(start); 629 start = __pa(start);
919 end = __pa(end); 630 end = __pa(end);
920 for (va = start; va < end; va += 32) 631 for (va = start; va < end; va += 32)
@@ -927,63 +638,6 @@ void __flush_dcache_range(unsigned long start, unsigned long end)
927} 638}
928#endif /* DCACHE_ALIASING_POSSIBLE */ 639#endif /* DCACHE_ALIASING_POSSIBLE */
929 640
930/* If not locked, zap it. */
931void __flush_tlb_all(void)
932{
933 unsigned long pstate;
934 int i;
935
936 __asm__ __volatile__("flushw\n\t"
937 "rdpr %%pstate, %0\n\t"
938 "wrpr %0, %1, %%pstate"
939 : "=r" (pstate)
940 : "i" (PSTATE_IE));
941 if (tlb_type == spitfire) {
942 for (i = 0; i < 64; i++) {
943 /* Spitfire Errata #32 workaround */
944 /* NOTE: Always runs on spitfire, so no
945 * cheetah+ page size encodings.
946 */
947 __asm__ __volatile__("stxa %0, [%1] %2\n\t"
948 "flush %%g6"
949 : /* No outputs */
950 : "r" (0),
951 "r" (PRIMARY_CONTEXT), "i" (ASI_DMMU));
952
953 if (!(spitfire_get_dtlb_data(i) & _PAGE_L)) {
954 __asm__ __volatile__("stxa %%g0, [%0] %1\n\t"
955 "membar #Sync"
956 : /* no outputs */
957 : "r" (TLB_TAG_ACCESS), "i" (ASI_DMMU));
958 spitfire_put_dtlb_data(i, 0x0UL);
959 }
960
961 /* Spitfire Errata #32 workaround */
962 /* NOTE: Always runs on spitfire, so no
963 * cheetah+ page size encodings.
964 */
965 __asm__ __volatile__("stxa %0, [%1] %2\n\t"
966 "flush %%g6"
967 : /* No outputs */
968 : "r" (0),
969 "r" (PRIMARY_CONTEXT), "i" (ASI_DMMU));
970
971 if (!(spitfire_get_itlb_data(i) & _PAGE_L)) {
972 __asm__ __volatile__("stxa %%g0, [%0] %1\n\t"
973 "membar #Sync"
974 : /* no outputs */
975 : "r" (TLB_TAG_ACCESS), "i" (ASI_IMMU));
976 spitfire_put_itlb_data(i, 0x0UL);
977 }
978 }
979 } else if (tlb_type == cheetah || tlb_type == cheetah_plus) {
980 cheetah_flush_dtlb_all();
981 cheetah_flush_itlb_all();
982 }
983 __asm__ __volatile__("wrpr %0, 0, %%pstate"
984 : : "r" (pstate));
985}
986
987/* Caller does TLB context flushing on local CPU if necessary. 641/* Caller does TLB context flushing on local CPU if necessary.
988 * The caller also ensures that CTX_VALID(mm->context) is false. 642 * The caller also ensures that CTX_VALID(mm->context) is false.
989 * 643 *
@@ -991,17 +645,21 @@ void __flush_tlb_all(void)
991 * let the user have CTX 0 (nucleus) or we ever use a CTX 645 * let the user have CTX 0 (nucleus) or we ever use a CTX
992 * version of zero (and thus NO_CONTEXT would not be caught 646 * version of zero (and thus NO_CONTEXT would not be caught
993 * by version mis-match tests in mmu_context.h). 647 * by version mis-match tests in mmu_context.h).
648 *
649 * Always invoked with interrupts disabled.
994 */ 650 */
995void get_new_mmu_context(struct mm_struct *mm) 651void get_new_mmu_context(struct mm_struct *mm)
996{ 652{
997 unsigned long ctx, new_ctx; 653 unsigned long ctx, new_ctx;
998 unsigned long orig_pgsz_bits; 654 unsigned long orig_pgsz_bits;
999 655 unsigned long flags;
656 int new_version;
1000 657
1001 spin_lock(&ctx_alloc_lock); 658 spin_lock_irqsave(&ctx_alloc_lock, flags);
1002 orig_pgsz_bits = (mm->context.sparc64_ctx_val & CTX_PGSZ_MASK); 659 orig_pgsz_bits = (mm->context.sparc64_ctx_val & CTX_PGSZ_MASK);
1003 ctx = (tlb_context_cache + 1) & CTX_NR_MASK; 660 ctx = (tlb_context_cache + 1) & CTX_NR_MASK;
1004 new_ctx = find_next_zero_bit(mmu_context_bmap, 1 << CTX_NR_BITS, ctx); 661 new_ctx = find_next_zero_bit(mmu_context_bmap, 1 << CTX_NR_BITS, ctx);
662 new_version = 0;
1005 if (new_ctx >= (1 << CTX_NR_BITS)) { 663 if (new_ctx >= (1 << CTX_NR_BITS)) {
1006 new_ctx = find_next_zero_bit(mmu_context_bmap, ctx, 1); 664 new_ctx = find_next_zero_bit(mmu_context_bmap, ctx, 1);
1007 if (new_ctx >= ctx) { 665 if (new_ctx >= ctx) {
@@ -1024,6 +682,7 @@ void get_new_mmu_context(struct mm_struct *mm)
1024 mmu_context_bmap[i + 2] = 0; 682 mmu_context_bmap[i + 2] = 0;
1025 mmu_context_bmap[i + 3] = 0; 683 mmu_context_bmap[i + 3] = 0;
1026 } 684 }
685 new_version = 1;
1027 goto out; 686 goto out;
1028 } 687 }
1029 } 688 }
@@ -1032,79 +691,10 @@ void get_new_mmu_context(struct mm_struct *mm)
1032out: 691out:
1033 tlb_context_cache = new_ctx; 692 tlb_context_cache = new_ctx;
1034 mm->context.sparc64_ctx_val = new_ctx | orig_pgsz_bits; 693 mm->context.sparc64_ctx_val = new_ctx | orig_pgsz_bits;
1035 spin_unlock(&ctx_alloc_lock); 694 spin_unlock_irqrestore(&ctx_alloc_lock, flags);
1036}
1037
1038#ifndef CONFIG_SMP
1039struct pgtable_cache_struct pgt_quicklists;
1040#endif
1041 695
1042/* OK, we have to color these pages. The page tables are accessed 696 if (unlikely(new_version))
1043 * by non-Dcache enabled mapping in the VPTE area by the dtlb_backend.S 697 smp_new_mmu_context_version();
1044 * code, as well as by PAGE_OFFSET range direct-mapped addresses by
1045 * other parts of the kernel. By coloring, we make sure that the tlbmiss
1046 * fast handlers do not get data from old/garbage dcache lines that
1047 * correspond to an old/stale virtual address (user/kernel) that
1048 * previously mapped the pagetable page while accessing vpte range
1049 * addresses. The idea is that if the vpte color and PAGE_OFFSET range
1050 * color is the same, then when the kernel initializes the pagetable
1051 * using the later address range, accesses with the first address
1052 * range will see the newly initialized data rather than the garbage.
1053 */
1054#ifdef DCACHE_ALIASING_POSSIBLE
1055#define DC_ALIAS_SHIFT 1
1056#else
1057#define DC_ALIAS_SHIFT 0
1058#endif
1059pte_t *pte_alloc_one_kernel(struct mm_struct *mm, unsigned long address)
1060{
1061 struct page *page;
1062 unsigned long color;
1063
1064 {
1065 pte_t *ptep = pte_alloc_one_fast(mm, address);
1066
1067 if (ptep)
1068 return ptep;
1069 }
1070
1071 color = VPTE_COLOR(address);
1072 page = alloc_pages(GFP_KERNEL|__GFP_REPEAT, DC_ALIAS_SHIFT);
1073 if (page) {
1074 unsigned long *to_free;
1075 unsigned long paddr;
1076 pte_t *pte;
1077
1078#ifdef DCACHE_ALIASING_POSSIBLE
1079 set_page_count(page, 1);
1080 ClearPageCompound(page);
1081
1082 set_page_count((page + 1), 1);
1083 ClearPageCompound(page + 1);
1084#endif
1085 paddr = (unsigned long) page_address(page);
1086 memset((char *)paddr, 0, (PAGE_SIZE << DC_ALIAS_SHIFT));
1087
1088 if (!color) {
1089 pte = (pte_t *) paddr;
1090 to_free = (unsigned long *) (paddr + PAGE_SIZE);
1091 } else {
1092 pte = (pte_t *) (paddr + PAGE_SIZE);
1093 to_free = (unsigned long *) paddr;
1094 }
1095
1096#ifdef DCACHE_ALIASING_POSSIBLE
1097 /* Now free the other one up, adjust cache size. */
1098 preempt_disable();
1099 *to_free = (unsigned long) pte_quicklist[color ^ 0x1];
1100 pte_quicklist[color ^ 0x1] = to_free;
1101 pgtable_cache_size++;
1102 preempt_enable();
1103#endif
1104
1105 return pte;
1106 }
1107 return NULL;
1108} 698}
1109 699
1110void sparc_ultra_dump_itlb(void) 700void sparc_ultra_dump_itlb(void)
@@ -1196,9 +786,78 @@ void sparc_ultra_dump_dtlb(void)
1196 786
1197extern unsigned long cmdline_memory_size; 787extern unsigned long cmdline_memory_size;
1198 788
1199unsigned long __init bootmem_init(unsigned long *pages_avail) 789/* Find a free area for the bootmem map, avoiding the kernel image
790 * and the initial ramdisk.
791 */
792static unsigned long __init choose_bootmap_pfn(unsigned long start_pfn,
793 unsigned long end_pfn)
1200{ 794{
1201 unsigned long bootmap_size, start_pfn, end_pfn; 795 unsigned long avoid_start, avoid_end, bootmap_size;
796 int i;
797
798 bootmap_size = ((end_pfn - start_pfn) + 7) / 8;
799 bootmap_size = ALIGN(bootmap_size, sizeof(long));
800
801 avoid_start = avoid_end = 0;
802#ifdef CONFIG_BLK_DEV_INITRD
803 avoid_start = initrd_start;
804 avoid_end = PAGE_ALIGN(initrd_end);
805#endif
806
807#ifdef CONFIG_DEBUG_BOOTMEM
808 prom_printf("choose_bootmap_pfn: kern[%lx:%lx] avoid[%lx:%lx]\n",
809 kern_base, PAGE_ALIGN(kern_base + kern_size),
810 avoid_start, avoid_end);
811#endif
812 for (i = 0; i < pavail_ents; i++) {
813 unsigned long start, end;
814
815 start = pavail[i].phys_addr;
816 end = start + pavail[i].reg_size;
817
818 while (start < end) {
819 if (start >= kern_base &&
820 start < PAGE_ALIGN(kern_base + kern_size)) {
821 start = PAGE_ALIGN(kern_base + kern_size);
822 continue;
823 }
824 if (start >= avoid_start && start < avoid_end) {
825 start = avoid_end;
826 continue;
827 }
828
829 if ((end - start) < bootmap_size)
830 break;
831
832 if (start < kern_base &&
833 (start + bootmap_size) > kern_base) {
834 start = PAGE_ALIGN(kern_base + kern_size);
835 continue;
836 }
837
838 if (start < avoid_start &&
839 (start + bootmap_size) > avoid_start) {
840 start = avoid_end;
841 continue;
842 }
843
844 /* OK, it doesn't overlap anything, use it. */
845#ifdef CONFIG_DEBUG_BOOTMEM
846 prom_printf("choose_bootmap_pfn: Using %lx [%lx]\n",
847 start >> PAGE_SHIFT, start);
848#endif
849 return start >> PAGE_SHIFT;
850 }
851 }
852
853 prom_printf("Cannot find free area for bootmap, aborting.\n");
854 prom_halt();
855}
856
857static unsigned long __init bootmem_init(unsigned long *pages_avail,
858 unsigned long phys_base)
859{
860 unsigned long bootmap_size, end_pfn;
1202 unsigned long end_of_phys_memory = 0UL; 861 unsigned long end_of_phys_memory = 0UL;
1203 unsigned long bootmap_pfn, bytes_avail, size; 862 unsigned long bootmap_pfn, bytes_avail, size;
1204 int i; 863 int i;
@@ -1236,14 +895,6 @@ unsigned long __init bootmem_init(unsigned long *pages_avail)
1236 895
1237 *pages_avail = bytes_avail >> PAGE_SHIFT; 896 *pages_avail = bytes_avail >> PAGE_SHIFT;
1238 897
1239 /* Start with page aligned address of last symbol in kernel
1240 * image. The kernel is hard mapped below PAGE_OFFSET in a
1241 * 4MB locked TLB translation.
1242 */
1243 start_pfn = PAGE_ALIGN(kern_base + kern_size) >> PAGE_SHIFT;
1244
1245 bootmap_pfn = start_pfn;
1246
1247 end_pfn = end_of_phys_memory >> PAGE_SHIFT; 898 end_pfn = end_of_phys_memory >> PAGE_SHIFT;
1248 899
1249#ifdef CONFIG_BLK_DEV_INITRD 900#ifdef CONFIG_BLK_DEV_INITRD
@@ -1260,23 +911,22 @@ unsigned long __init bootmem_init(unsigned long *pages_avail)
1260 "(0x%016lx > 0x%016lx)\ndisabling initrd\n", 911 "(0x%016lx > 0x%016lx)\ndisabling initrd\n",
1261 initrd_end, end_of_phys_memory); 912 initrd_end, end_of_phys_memory);
1262 initrd_start = 0; 913 initrd_start = 0;
1263 } 914 initrd_end = 0;
1264 if (initrd_start) {
1265 if (initrd_start >= (start_pfn << PAGE_SHIFT) &&
1266 initrd_start < (start_pfn << PAGE_SHIFT) + 2 * PAGE_SIZE)
1267 bootmap_pfn = PAGE_ALIGN (initrd_end) >> PAGE_SHIFT;
1268 } 915 }
1269 } 916 }
1270#endif 917#endif
1271 /* Initialize the boot-time allocator. */ 918 /* Initialize the boot-time allocator. */
1272 max_pfn = max_low_pfn = end_pfn; 919 max_pfn = max_low_pfn = end_pfn;
1273 min_low_pfn = pfn_base; 920 min_low_pfn = (phys_base >> PAGE_SHIFT);
921
922 bootmap_pfn = choose_bootmap_pfn(min_low_pfn, end_pfn);
1274 923
1275#ifdef CONFIG_DEBUG_BOOTMEM 924#ifdef CONFIG_DEBUG_BOOTMEM
1276 prom_printf("init_bootmem(min[%lx], bootmap[%lx], max[%lx])\n", 925 prom_printf("init_bootmem(min[%lx], bootmap[%lx], max[%lx])\n",
1277 min_low_pfn, bootmap_pfn, max_low_pfn); 926 min_low_pfn, bootmap_pfn, max_low_pfn);
1278#endif 927#endif
1279 bootmap_size = init_bootmem_node(NODE_DATA(0), bootmap_pfn, pfn_base, end_pfn); 928 bootmap_size = init_bootmem_node(NODE_DATA(0), bootmap_pfn,
929 min_low_pfn, end_pfn);
1280 930
1281 /* Now register the available physical memory with the 931 /* Now register the available physical memory with the
1282 * allocator. 932 * allocator.
@@ -1324,9 +974,26 @@ unsigned long __init bootmem_init(unsigned long *pages_avail)
1324 reserve_bootmem((bootmap_pfn << PAGE_SHIFT), size); 974 reserve_bootmem((bootmap_pfn << PAGE_SHIFT), size);
1325 *pages_avail -= PAGE_ALIGN(size) >> PAGE_SHIFT; 975 *pages_avail -= PAGE_ALIGN(size) >> PAGE_SHIFT;
1326 976
977 for (i = 0; i < pavail_ents; i++) {
978 unsigned long start_pfn, end_pfn;
979
980 start_pfn = pavail[i].phys_addr >> PAGE_SHIFT;
981 end_pfn = (start_pfn + (pavail[i].reg_size >> PAGE_SHIFT));
982#ifdef CONFIG_DEBUG_BOOTMEM
983 prom_printf("memory_present(0, %lx, %lx)\n",
984 start_pfn, end_pfn);
985#endif
986 memory_present(0, start_pfn, end_pfn);
987 }
988
989 sparse_init();
990
1327 return end_pfn; 991 return end_pfn;
1328} 992}
1329 993
994static struct linux_prom64_registers pall[MAX_BANKS] __initdata;
995static int pall_ents __initdata;
996
1330#ifdef CONFIG_DEBUG_PAGEALLOC 997#ifdef CONFIG_DEBUG_PAGEALLOC
1331static unsigned long kernel_map_range(unsigned long pstart, unsigned long pend, pgprot_t prot) 998static unsigned long kernel_map_range(unsigned long pstart, unsigned long pend, pgprot_t prot)
1332{ 999{
@@ -1382,14 +1049,44 @@ static unsigned long kernel_map_range(unsigned long pstart, unsigned long pend,
1382 return alloc_bytes; 1049 return alloc_bytes;
1383} 1050}
1384 1051
1385static struct linux_prom64_registers pall[MAX_BANKS] __initdata;
1386static int pall_ents __initdata;
1387
1388extern unsigned int kvmap_linear_patch[1]; 1052extern unsigned int kvmap_linear_patch[1];
1053#endif /* CONFIG_DEBUG_PAGEALLOC */
1054
1055static void __init mark_kpte_bitmap(unsigned long start, unsigned long end)
1056{
1057 const unsigned long shift_256MB = 28;
1058 const unsigned long mask_256MB = ((1UL << shift_256MB) - 1UL);
1059 const unsigned long size_256MB = (1UL << shift_256MB);
1060
1061 while (start < end) {
1062 long remains;
1063
1064 remains = end - start;
1065 if (remains < size_256MB)
1066 break;
1067
1068 if (start & mask_256MB) {
1069 start = (start + size_256MB) & ~mask_256MB;
1070 continue;
1071 }
1072
1073 while (remains >= size_256MB) {
1074 unsigned long index = start >> shift_256MB;
1075
1076 __set_bit(index, kpte_linear_bitmap);
1077
1078 start += size_256MB;
1079 remains -= size_256MB;
1080 }
1081 }
1082}
1389 1083
1390static void __init kernel_physical_mapping_init(void) 1084static void __init kernel_physical_mapping_init(void)
1391{ 1085{
1392 unsigned long i, mem_alloced = 0UL; 1086 unsigned long i;
1087#ifdef CONFIG_DEBUG_PAGEALLOC
1088 unsigned long mem_alloced = 0UL;
1089#endif
1393 1090
1394 read_obp_memory("reg", &pall[0], &pall_ents); 1091 read_obp_memory("reg", &pall[0], &pall_ents);
1395 1092
@@ -1398,10 +1095,16 @@ static void __init kernel_physical_mapping_init(void)
1398 1095
1399 phys_start = pall[i].phys_addr; 1096 phys_start = pall[i].phys_addr;
1400 phys_end = phys_start + pall[i].reg_size; 1097 phys_end = phys_start + pall[i].reg_size;
1098
1099 mark_kpte_bitmap(phys_start, phys_end);
1100
1101#ifdef CONFIG_DEBUG_PAGEALLOC
1401 mem_alloced += kernel_map_range(phys_start, phys_end, 1102 mem_alloced += kernel_map_range(phys_start, phys_end,
1402 PAGE_KERNEL); 1103 PAGE_KERNEL);
1104#endif
1403 } 1105 }
1404 1106
1107#ifdef CONFIG_DEBUG_PAGEALLOC
1405 printk("Allocated %ld bytes for kernel page tables.\n", 1108 printk("Allocated %ld bytes for kernel page tables.\n",
1406 mem_alloced); 1109 mem_alloced);
1407 1110
@@ -1409,8 +1112,10 @@ static void __init kernel_physical_mapping_init(void)
1409 flushi(&kvmap_linear_patch[0]); 1112 flushi(&kvmap_linear_patch[0]);
1410 1113
1411 __flush_tlb_all(); 1114 __flush_tlb_all();
1115#endif
1412} 1116}
1413 1117
1118#ifdef CONFIG_DEBUG_PAGEALLOC
1414void kernel_map_pages(struct page *page, int numpages, int enable) 1119void kernel_map_pages(struct page *page, int numpages, int enable)
1415{ 1120{
1416 unsigned long phys_start = page_to_pfn(page) << PAGE_SHIFT; 1121 unsigned long phys_start = page_to_pfn(page) << PAGE_SHIFT;
@@ -1419,6 +1124,9 @@ void kernel_map_pages(struct page *page, int numpages, int enable)
1419 kernel_map_range(phys_start, phys_end, 1124 kernel_map_range(phys_start, phys_end,
1420 (enable ? PAGE_KERNEL : __pgprot(0))); 1125 (enable ? PAGE_KERNEL : __pgprot(0)));
1421 1126
1127 flush_tsb_kernel_range(PAGE_OFFSET + phys_start,
1128 PAGE_OFFSET + phys_end);
1129
1422 /* we should perform an IPI and flush all tlbs, 1130 /* we should perform an IPI and flush all tlbs,
1423 * but that can deadlock->flush only current cpu. 1131 * but that can deadlock->flush only current cpu.
1424 */ 1132 */
@@ -1439,18 +1147,150 @@ unsigned long __init find_ecache_flush_span(unsigned long size)
1439 return ~0UL; 1147 return ~0UL;
1440} 1148}
1441 1149
1150static void __init tsb_phys_patch(void)
1151{
1152 struct tsb_ldquad_phys_patch_entry *pquad;
1153 struct tsb_phys_patch_entry *p;
1154
1155 pquad = &__tsb_ldquad_phys_patch;
1156 while (pquad < &__tsb_ldquad_phys_patch_end) {
1157 unsigned long addr = pquad->addr;
1158
1159 if (tlb_type == hypervisor)
1160 *(unsigned int *) addr = pquad->sun4v_insn;
1161 else
1162 *(unsigned int *) addr = pquad->sun4u_insn;
1163 wmb();
1164 __asm__ __volatile__("flush %0"
1165 : /* no outputs */
1166 : "r" (addr));
1167
1168 pquad++;
1169 }
1170
1171 p = &__tsb_phys_patch;
1172 while (p < &__tsb_phys_patch_end) {
1173 unsigned long addr = p->addr;
1174
1175 *(unsigned int *) addr = p->insn;
1176 wmb();
1177 __asm__ __volatile__("flush %0"
1178 : /* no outputs */
1179 : "r" (addr));
1180
1181 p++;
1182 }
1183}
1184
1185/* Don't mark as init, we give this to the Hypervisor. */
1186static struct hv_tsb_descr ktsb_descr[2];
1187extern struct tsb swapper_tsb[KERNEL_TSB_NENTRIES];
1188
1189static void __init sun4v_ktsb_init(void)
1190{
1191 unsigned long ktsb_pa;
1192
1193 /* First KTSB for PAGE_SIZE mappings. */
1194 ktsb_pa = kern_base + ((unsigned long)&swapper_tsb[0] - KERNBASE);
1195
1196 switch (PAGE_SIZE) {
1197 case 8 * 1024:
1198 default:
1199 ktsb_descr[0].pgsz_idx = HV_PGSZ_IDX_8K;
1200 ktsb_descr[0].pgsz_mask = HV_PGSZ_MASK_8K;
1201 break;
1202
1203 case 64 * 1024:
1204 ktsb_descr[0].pgsz_idx = HV_PGSZ_IDX_64K;
1205 ktsb_descr[0].pgsz_mask = HV_PGSZ_MASK_64K;
1206 break;
1207
1208 case 512 * 1024:
1209 ktsb_descr[0].pgsz_idx = HV_PGSZ_IDX_512K;
1210 ktsb_descr[0].pgsz_mask = HV_PGSZ_MASK_512K;
1211 break;
1212
1213 case 4 * 1024 * 1024:
1214 ktsb_descr[0].pgsz_idx = HV_PGSZ_IDX_4MB;
1215 ktsb_descr[0].pgsz_mask = HV_PGSZ_MASK_4MB;
1216 break;
1217 };
1218
1219 ktsb_descr[0].assoc = 1;
1220 ktsb_descr[0].num_ttes = KERNEL_TSB_NENTRIES;
1221 ktsb_descr[0].ctx_idx = 0;
1222 ktsb_descr[0].tsb_base = ktsb_pa;
1223 ktsb_descr[0].resv = 0;
1224
1225 /* Second KTSB for 4MB/256MB mappings. */
1226 ktsb_pa = (kern_base +
1227 ((unsigned long)&swapper_4m_tsb[0] - KERNBASE));
1228
1229 ktsb_descr[1].pgsz_idx = HV_PGSZ_IDX_4MB;
1230 ktsb_descr[1].pgsz_mask = (HV_PGSZ_MASK_4MB |
1231 HV_PGSZ_MASK_256MB);
1232 ktsb_descr[1].assoc = 1;
1233 ktsb_descr[1].num_ttes = KERNEL_TSB4M_NENTRIES;
1234 ktsb_descr[1].ctx_idx = 0;
1235 ktsb_descr[1].tsb_base = ktsb_pa;
1236 ktsb_descr[1].resv = 0;
1237}
1238
1239void __cpuinit sun4v_ktsb_register(void)
1240{
1241 register unsigned long func asm("%o5");
1242 register unsigned long arg0 asm("%o0");
1243 register unsigned long arg1 asm("%o1");
1244 unsigned long pa;
1245
1246 pa = kern_base + ((unsigned long)&ktsb_descr[0] - KERNBASE);
1247
1248 func = HV_FAST_MMU_TSB_CTX0;
1249 arg0 = 2;
1250 arg1 = pa;
1251 __asm__ __volatile__("ta %6"
1252 : "=&r" (func), "=&r" (arg0), "=&r" (arg1)
1253 : "0" (func), "1" (arg0), "2" (arg1),
1254 "i" (HV_FAST_TRAP));
1255}
1256
1442/* paging_init() sets up the page tables */ 1257/* paging_init() sets up the page tables */
1443 1258
1444extern void cheetah_ecache_flush_init(void); 1259extern void cheetah_ecache_flush_init(void);
1260extern void sun4v_patch_tlb_handlers(void);
1445 1261
1446static unsigned long last_valid_pfn; 1262static unsigned long last_valid_pfn;
1447pgd_t swapper_pg_dir[2048]; 1263pgd_t swapper_pg_dir[2048];
1448 1264
1265static void sun4u_pgprot_init(void);
1266static void sun4v_pgprot_init(void);
1267
1449void __init paging_init(void) 1268void __init paging_init(void)
1450{ 1269{
1451 unsigned long end_pfn, pages_avail, shift; 1270 unsigned long end_pfn, pages_avail, shift, phys_base;
1452 unsigned long real_end, i; 1271 unsigned long real_end, i;
1453 1272
1273 kern_base = (prom_boot_mapping_phys_low >> 22UL) << 22UL;
1274 kern_size = (unsigned long)&_end - (unsigned long)KERNBASE;
1275
1276 /* Invalidate both kernel TSBs. */
1277 memset(swapper_tsb, 0x40, sizeof(swapper_tsb));
1278 memset(swapper_4m_tsb, 0x40, sizeof(swapper_4m_tsb));
1279
1280 if (tlb_type == hypervisor)
1281 sun4v_pgprot_init();
1282 else
1283 sun4u_pgprot_init();
1284
1285 if (tlb_type == cheetah_plus ||
1286 tlb_type == hypervisor)
1287 tsb_phys_patch();
1288
1289 if (tlb_type == hypervisor) {
1290 sun4v_patch_tlb_handlers();
1291 sun4v_ktsb_init();
1292 }
1293
1454 /* Find available physical memory... */ 1294 /* Find available physical memory... */
1455 read_obp_memory("available", &pavail[0], &pavail_ents); 1295 read_obp_memory("available", &pavail[0], &pavail_ents);
1456 1296
@@ -1458,11 +1298,6 @@ void __init paging_init(void)
1458 for (i = 0; i < pavail_ents; i++) 1298 for (i = 0; i < pavail_ents; i++)
1459 phys_base = min(phys_base, pavail[i].phys_addr); 1299 phys_base = min(phys_base, pavail[i].phys_addr);
1460 1300
1461 pfn_base = phys_base >> PAGE_SHIFT;
1462
1463 kern_base = (prom_boot_mapping_phys_low >> 22UL) << 22UL;
1464 kern_size = (unsigned long)&_end - (unsigned long)KERNBASE;
1465
1466 set_bit(0, mmu_context_bmap); 1301 set_bit(0, mmu_context_bmap);
1467 1302
1468 shift = kern_base + PAGE_OFFSET - ((unsigned long)KERNBASE); 1303 shift = kern_base + PAGE_OFFSET - ((unsigned long)KERNBASE);
@@ -1486,47 +1321,38 @@ void __init paging_init(void)
1486 pud_set(pud_offset(&swapper_pg_dir[0], 0), 1321 pud_set(pud_offset(&swapper_pg_dir[0], 0),
1487 swapper_low_pmd_dir + (shift / sizeof(pgd_t))); 1322 swapper_low_pmd_dir + (shift / sizeof(pgd_t)));
1488 1323
1489 swapper_pgd_zero = pgd_val(swapper_pg_dir[0]);
1490
1491 inherit_prom_mappings(); 1324 inherit_prom_mappings();
1492 1325
1493 /* Ok, we can use our TLB miss and window trap handlers safely. 1326 /* Ok, we can use our TLB miss and window trap handlers safely. */
1494 * We need to do a quick peek here to see if we are on StarFire 1327 setup_tba();
1495 * or not, so setup_tba can setup the IRQ globals correctly (it
1496 * needs to get the hard smp processor id correctly).
1497 */
1498 {
1499 extern void setup_tba(int);
1500 setup_tba(this_is_starfire);
1501 }
1502
1503 inherit_locked_prom_mappings(1);
1504 1328
1505 __flush_tlb_all(); 1329 __flush_tlb_all();
1506 1330
1331 if (tlb_type == hypervisor)
1332 sun4v_ktsb_register();
1333
1507 /* Setup bootmem... */ 1334 /* Setup bootmem... */
1508 pages_avail = 0; 1335 pages_avail = 0;
1509 last_valid_pfn = end_pfn = bootmem_init(&pages_avail); 1336 last_valid_pfn = end_pfn = bootmem_init(&pages_avail, phys_base);
1337
1338 max_mapnr = last_valid_pfn;
1510 1339
1511#ifdef CONFIG_DEBUG_PAGEALLOC
1512 kernel_physical_mapping_init(); 1340 kernel_physical_mapping_init();
1513#endif
1514 1341
1515 { 1342 {
1516 unsigned long zones_size[MAX_NR_ZONES]; 1343 unsigned long zones_size[MAX_NR_ZONES];
1517 unsigned long zholes_size[MAX_NR_ZONES]; 1344 unsigned long zholes_size[MAX_NR_ZONES];
1518 unsigned long npages;
1519 int znum; 1345 int znum;
1520 1346
1521 for (znum = 0; znum < MAX_NR_ZONES; znum++) 1347 for (znum = 0; znum < MAX_NR_ZONES; znum++)
1522 zones_size[znum] = zholes_size[znum] = 0; 1348 zones_size[znum] = zholes_size[znum] = 0;
1523 1349
1524 npages = end_pfn - pfn_base; 1350 zones_size[ZONE_DMA] = end_pfn;
1525 zones_size[ZONE_DMA] = npages; 1351 zholes_size[ZONE_DMA] = end_pfn - pages_avail;
1526 zholes_size[ZONE_DMA] = npages - pages_avail;
1527 1352
1528 free_area_init_node(0, &contig_page_data, zones_size, 1353 free_area_init_node(0, &contig_page_data, zones_size,
1529 phys_base >> PAGE_SHIFT, zholes_size); 1354 __pa(PAGE_OFFSET) >> PAGE_SHIFT,
1355 zholes_size);
1530 } 1356 }
1531 1357
1532 device_scan(); 1358 device_scan();
@@ -1596,7 +1422,6 @@ void __init mem_init(void)
1596 1422
1597 taint_real_pages(); 1423 taint_real_pages();
1598 1424
1599 max_mapnr = last_valid_pfn - pfn_base;
1600 high_memory = __va(last_valid_pfn << PAGE_SHIFT); 1425 high_memory = __va(last_valid_pfn << PAGE_SHIFT);
1601 1426
1602#ifdef CONFIG_DEBUG_BOOTMEM 1427#ifdef CONFIG_DEBUG_BOOTMEM
@@ -1653,7 +1478,7 @@ void free_initmem(void)
1653 p = virt_to_page(page); 1478 p = virt_to_page(page);
1654 1479
1655 ClearPageReserved(p); 1480 ClearPageReserved(p);
1656 set_page_count(p, 1); 1481 init_page_count(p);
1657 __free_page(p); 1482 __free_page(p);
1658 num_physpages++; 1483 num_physpages++;
1659 totalram_pages++; 1484 totalram_pages++;
@@ -1669,10 +1494,349 @@ void free_initrd_mem(unsigned long start, unsigned long end)
1669 struct page *p = virt_to_page(start); 1494 struct page *p = virt_to_page(start);
1670 1495
1671 ClearPageReserved(p); 1496 ClearPageReserved(p);
1672 set_page_count(p, 1); 1497 init_page_count(p);
1673 __free_page(p); 1498 __free_page(p);
1674 num_physpages++; 1499 num_physpages++;
1675 totalram_pages++; 1500 totalram_pages++;
1676 } 1501 }
1677} 1502}
1678#endif 1503#endif
1504
1505#define _PAGE_CACHE_4U (_PAGE_CP_4U | _PAGE_CV_4U)
1506#define _PAGE_CACHE_4V (_PAGE_CP_4V | _PAGE_CV_4V)
1507#define __DIRTY_BITS_4U (_PAGE_MODIFIED_4U | _PAGE_WRITE_4U | _PAGE_W_4U)
1508#define __DIRTY_BITS_4V (_PAGE_MODIFIED_4V | _PAGE_WRITE_4V | _PAGE_W_4V)
1509#define __ACCESS_BITS_4U (_PAGE_ACCESSED_4U | _PAGE_READ_4U | _PAGE_R)
1510#define __ACCESS_BITS_4V (_PAGE_ACCESSED_4V | _PAGE_READ_4V | _PAGE_R)
1511
1512pgprot_t PAGE_KERNEL __read_mostly;
1513EXPORT_SYMBOL(PAGE_KERNEL);
1514
1515pgprot_t PAGE_KERNEL_LOCKED __read_mostly;
1516pgprot_t PAGE_COPY __read_mostly;
1517
1518pgprot_t PAGE_SHARED __read_mostly;
1519EXPORT_SYMBOL(PAGE_SHARED);
1520
1521pgprot_t PAGE_EXEC __read_mostly;
1522unsigned long pg_iobits __read_mostly;
1523
1524unsigned long _PAGE_IE __read_mostly;
1525
1526unsigned long _PAGE_E __read_mostly;
1527EXPORT_SYMBOL(_PAGE_E);
1528
1529unsigned long _PAGE_CACHE __read_mostly;
1530EXPORT_SYMBOL(_PAGE_CACHE);
1531
1532static void prot_init_common(unsigned long page_none,
1533 unsigned long page_shared,
1534 unsigned long page_copy,
1535 unsigned long page_readonly,
1536 unsigned long page_exec_bit)
1537{
1538 PAGE_COPY = __pgprot(page_copy);
1539 PAGE_SHARED = __pgprot(page_shared);
1540
1541 protection_map[0x0] = __pgprot(page_none);
1542 protection_map[0x1] = __pgprot(page_readonly & ~page_exec_bit);
1543 protection_map[0x2] = __pgprot(page_copy & ~page_exec_bit);
1544 protection_map[0x3] = __pgprot(page_copy & ~page_exec_bit);
1545 protection_map[0x4] = __pgprot(page_readonly);
1546 protection_map[0x5] = __pgprot(page_readonly);
1547 protection_map[0x6] = __pgprot(page_copy);
1548 protection_map[0x7] = __pgprot(page_copy);
1549 protection_map[0x8] = __pgprot(page_none);
1550 protection_map[0x9] = __pgprot(page_readonly & ~page_exec_bit);
1551 protection_map[0xa] = __pgprot(page_shared & ~page_exec_bit);
1552 protection_map[0xb] = __pgprot(page_shared & ~page_exec_bit);
1553 protection_map[0xc] = __pgprot(page_readonly);
1554 protection_map[0xd] = __pgprot(page_readonly);
1555 protection_map[0xe] = __pgprot(page_shared);
1556 protection_map[0xf] = __pgprot(page_shared);
1557}
1558
1559static void __init sun4u_pgprot_init(void)
1560{
1561 unsigned long page_none, page_shared, page_copy, page_readonly;
1562 unsigned long page_exec_bit;
1563
1564 PAGE_KERNEL = __pgprot (_PAGE_PRESENT_4U | _PAGE_VALID |
1565 _PAGE_CACHE_4U | _PAGE_P_4U |
1566 __ACCESS_BITS_4U | __DIRTY_BITS_4U |
1567 _PAGE_EXEC_4U);
1568 PAGE_KERNEL_LOCKED = __pgprot (_PAGE_PRESENT_4U | _PAGE_VALID |
1569 _PAGE_CACHE_4U | _PAGE_P_4U |
1570 __ACCESS_BITS_4U | __DIRTY_BITS_4U |
1571 _PAGE_EXEC_4U | _PAGE_L_4U);
1572 PAGE_EXEC = __pgprot(_PAGE_EXEC_4U);
1573
1574 _PAGE_IE = _PAGE_IE_4U;
1575 _PAGE_E = _PAGE_E_4U;
1576 _PAGE_CACHE = _PAGE_CACHE_4U;
1577
1578 pg_iobits = (_PAGE_VALID | _PAGE_PRESENT_4U | __DIRTY_BITS_4U |
1579 __ACCESS_BITS_4U | _PAGE_E_4U);
1580
1581 kern_linear_pte_xor[0] = (_PAGE_VALID | _PAGE_SZ4MB_4U) ^
1582 0xfffff80000000000;
1583 kern_linear_pte_xor[0] |= (_PAGE_CP_4U | _PAGE_CV_4U |
1584 _PAGE_P_4U | _PAGE_W_4U);
1585
1586 /* XXX Should use 256MB on Panther. XXX */
1587 kern_linear_pte_xor[1] = kern_linear_pte_xor[0];
1588
1589 _PAGE_SZBITS = _PAGE_SZBITS_4U;
1590 _PAGE_ALL_SZ_BITS = (_PAGE_SZ4MB_4U | _PAGE_SZ512K_4U |
1591 _PAGE_SZ64K_4U | _PAGE_SZ8K_4U |
1592 _PAGE_SZ32MB_4U | _PAGE_SZ256MB_4U);
1593
1594
1595 page_none = _PAGE_PRESENT_4U | _PAGE_ACCESSED_4U | _PAGE_CACHE_4U;
1596 page_shared = (_PAGE_VALID | _PAGE_PRESENT_4U | _PAGE_CACHE_4U |
1597 __ACCESS_BITS_4U | _PAGE_WRITE_4U | _PAGE_EXEC_4U);
1598 page_copy = (_PAGE_VALID | _PAGE_PRESENT_4U | _PAGE_CACHE_4U |
1599 __ACCESS_BITS_4U | _PAGE_EXEC_4U);
1600 page_readonly = (_PAGE_VALID | _PAGE_PRESENT_4U | _PAGE_CACHE_4U |
1601 __ACCESS_BITS_4U | _PAGE_EXEC_4U);
1602
1603 page_exec_bit = _PAGE_EXEC_4U;
1604
1605 prot_init_common(page_none, page_shared, page_copy, page_readonly,
1606 page_exec_bit);
1607}
1608
1609static void __init sun4v_pgprot_init(void)
1610{
1611 unsigned long page_none, page_shared, page_copy, page_readonly;
1612 unsigned long page_exec_bit;
1613
1614 PAGE_KERNEL = __pgprot (_PAGE_PRESENT_4V | _PAGE_VALID |
1615 _PAGE_CACHE_4V | _PAGE_P_4V |
1616 __ACCESS_BITS_4V | __DIRTY_BITS_4V |
1617 _PAGE_EXEC_4V);
1618 PAGE_KERNEL_LOCKED = PAGE_KERNEL;
1619 PAGE_EXEC = __pgprot(_PAGE_EXEC_4V);
1620
1621 _PAGE_IE = _PAGE_IE_4V;
1622 _PAGE_E = _PAGE_E_4V;
1623 _PAGE_CACHE = _PAGE_CACHE_4V;
1624
1625 kern_linear_pte_xor[0] = (_PAGE_VALID | _PAGE_SZ4MB_4V) ^
1626 0xfffff80000000000;
1627 kern_linear_pte_xor[0] |= (_PAGE_CP_4V | _PAGE_CV_4V |
1628 _PAGE_P_4V | _PAGE_W_4V);
1629
1630 kern_linear_pte_xor[1] = (_PAGE_VALID | _PAGE_SZ256MB_4V) ^
1631 0xfffff80000000000;
1632 kern_linear_pte_xor[1] |= (_PAGE_CP_4V | _PAGE_CV_4V |
1633 _PAGE_P_4V | _PAGE_W_4V);
1634
1635 pg_iobits = (_PAGE_VALID | _PAGE_PRESENT_4V | __DIRTY_BITS_4V |
1636 __ACCESS_BITS_4V | _PAGE_E_4V);
1637
1638 _PAGE_SZBITS = _PAGE_SZBITS_4V;
1639 _PAGE_ALL_SZ_BITS = (_PAGE_SZ16GB_4V | _PAGE_SZ2GB_4V |
1640 _PAGE_SZ256MB_4V | _PAGE_SZ32MB_4V |
1641 _PAGE_SZ4MB_4V | _PAGE_SZ512K_4V |
1642 _PAGE_SZ64K_4V | _PAGE_SZ8K_4V);
1643
1644 page_none = _PAGE_PRESENT_4V | _PAGE_ACCESSED_4V | _PAGE_CACHE_4V;
1645 page_shared = (_PAGE_VALID | _PAGE_PRESENT_4V | _PAGE_CACHE_4V |
1646 __ACCESS_BITS_4V | _PAGE_WRITE_4V | _PAGE_EXEC_4V);
1647 page_copy = (_PAGE_VALID | _PAGE_PRESENT_4V | _PAGE_CACHE_4V |
1648 __ACCESS_BITS_4V | _PAGE_EXEC_4V);
1649 page_readonly = (_PAGE_VALID | _PAGE_PRESENT_4V | _PAGE_CACHE_4V |
1650 __ACCESS_BITS_4V | _PAGE_EXEC_4V);
1651
1652 page_exec_bit = _PAGE_EXEC_4V;
1653
1654 prot_init_common(page_none, page_shared, page_copy, page_readonly,
1655 page_exec_bit);
1656}
1657
1658unsigned long pte_sz_bits(unsigned long sz)
1659{
1660 if (tlb_type == hypervisor) {
1661 switch (sz) {
1662 case 8 * 1024:
1663 default:
1664 return _PAGE_SZ8K_4V;
1665 case 64 * 1024:
1666 return _PAGE_SZ64K_4V;
1667 case 512 * 1024:
1668 return _PAGE_SZ512K_4V;
1669 case 4 * 1024 * 1024:
1670 return _PAGE_SZ4MB_4V;
1671 };
1672 } else {
1673 switch (sz) {
1674 case 8 * 1024:
1675 default:
1676 return _PAGE_SZ8K_4U;
1677 case 64 * 1024:
1678 return _PAGE_SZ64K_4U;
1679 case 512 * 1024:
1680 return _PAGE_SZ512K_4U;
1681 case 4 * 1024 * 1024:
1682 return _PAGE_SZ4MB_4U;
1683 };
1684 }
1685}
1686
1687pte_t mk_pte_io(unsigned long page, pgprot_t prot, int space, unsigned long page_size)
1688{
1689 pte_t pte;
1690
1691 pte_val(pte) = page | pgprot_val(pgprot_noncached(prot));
1692 pte_val(pte) |= (((unsigned long)space) << 32);
1693 pte_val(pte) |= pte_sz_bits(page_size);
1694
1695 return pte;
1696}
1697
1698static unsigned long kern_large_tte(unsigned long paddr)
1699{
1700 unsigned long val;
1701
1702 val = (_PAGE_VALID | _PAGE_SZ4MB_4U |
1703 _PAGE_CP_4U | _PAGE_CV_4U | _PAGE_P_4U |
1704 _PAGE_EXEC_4U | _PAGE_L_4U | _PAGE_W_4U);
1705 if (tlb_type == hypervisor)
1706 val = (_PAGE_VALID | _PAGE_SZ4MB_4V |
1707 _PAGE_CP_4V | _PAGE_CV_4V | _PAGE_P_4V |
1708 _PAGE_EXEC_4V | _PAGE_W_4V);
1709
1710 return val | paddr;
1711}
1712
1713/*
1714 * Translate PROM's mapping we capture at boot time into physical address.
1715 * The second parameter is only set from prom_callback() invocations.
1716 */
1717unsigned long prom_virt_to_phys(unsigned long promva, int *error)
1718{
1719 unsigned long mask;
1720 int i;
1721
1722 mask = _PAGE_PADDR_4U;
1723 if (tlb_type == hypervisor)
1724 mask = _PAGE_PADDR_4V;
1725
1726 for (i = 0; i < prom_trans_ents; i++) {
1727 struct linux_prom_translation *p = &prom_trans[i];
1728
1729 if (promva >= p->virt &&
1730 promva < (p->virt + p->size)) {
1731 unsigned long base = p->data & mask;
1732
1733 if (error)
1734 *error = 0;
1735 return base + (promva & (8192 - 1));
1736 }
1737 }
1738 if (error)
1739 *error = 1;
1740 return 0UL;
1741}
1742
1743/* XXX We should kill off this ugly thing at so me point. XXX */
1744unsigned long sun4u_get_pte(unsigned long addr)
1745{
1746 pgd_t *pgdp;
1747 pud_t *pudp;
1748 pmd_t *pmdp;
1749 pte_t *ptep;
1750 unsigned long mask = _PAGE_PADDR_4U;
1751
1752 if (tlb_type == hypervisor)
1753 mask = _PAGE_PADDR_4V;
1754
1755 if (addr >= PAGE_OFFSET)
1756 return addr & mask;
1757
1758 if ((addr >= LOW_OBP_ADDRESS) && (addr < HI_OBP_ADDRESS))
1759 return prom_virt_to_phys(addr, NULL);
1760
1761 pgdp = pgd_offset_k(addr);
1762 pudp = pud_offset(pgdp, addr);
1763 pmdp = pmd_offset(pudp, addr);
1764 ptep = pte_offset_kernel(pmdp, addr);
1765
1766 return pte_val(*ptep) & mask;
1767}
1768
1769/* If not locked, zap it. */
1770void __flush_tlb_all(void)
1771{
1772 unsigned long pstate;
1773 int i;
1774
1775 __asm__ __volatile__("flushw\n\t"
1776 "rdpr %%pstate, %0\n\t"
1777 "wrpr %0, %1, %%pstate"
1778 : "=r" (pstate)
1779 : "i" (PSTATE_IE));
1780 if (tlb_type == spitfire) {
1781 for (i = 0; i < 64; i++) {
1782 /* Spitfire Errata #32 workaround */
1783 /* NOTE: Always runs on spitfire, so no
1784 * cheetah+ page size encodings.
1785 */
1786 __asm__ __volatile__("stxa %0, [%1] %2\n\t"
1787 "flush %%g6"
1788 : /* No outputs */
1789 : "r" (0),
1790 "r" (PRIMARY_CONTEXT), "i" (ASI_DMMU));
1791
1792 if (!(spitfire_get_dtlb_data(i) & _PAGE_L_4U)) {
1793 __asm__ __volatile__("stxa %%g0, [%0] %1\n\t"
1794 "membar #Sync"
1795 : /* no outputs */
1796 : "r" (TLB_TAG_ACCESS), "i" (ASI_DMMU));
1797 spitfire_put_dtlb_data(i, 0x0UL);
1798 }
1799
1800 /* Spitfire Errata #32 workaround */
1801 /* NOTE: Always runs on spitfire, so no
1802 * cheetah+ page size encodings.
1803 */
1804 __asm__ __volatile__("stxa %0, [%1] %2\n\t"
1805 "flush %%g6"
1806 : /* No outputs */
1807 : "r" (0),
1808 "r" (PRIMARY_CONTEXT), "i" (ASI_DMMU));
1809
1810 if (!(spitfire_get_itlb_data(i) & _PAGE_L_4U)) {
1811 __asm__ __volatile__("stxa %%g0, [%0] %1\n\t"
1812 "membar #Sync"
1813 : /* no outputs */
1814 : "r" (TLB_TAG_ACCESS), "i" (ASI_IMMU));
1815 spitfire_put_itlb_data(i, 0x0UL);
1816 }
1817 }
1818 } else if (tlb_type == cheetah || tlb_type == cheetah_plus) {
1819 cheetah_flush_dtlb_all();
1820 cheetah_flush_itlb_all();
1821 }
1822 __asm__ __volatile__("wrpr %0, 0, %%pstate"
1823 : : "r" (pstate));
1824}
1825
1826#ifdef CONFIG_MEMORY_HOTPLUG
1827
1828void online_page(struct page *page)
1829{
1830 ClearPageReserved(page);
1831 init_page_count(page);
1832 __free_page(page);
1833 totalram_pages++;
1834 num_physpages++;
1835}
1836
1837int remove_memory(u64 start, u64 size)
1838{
1839 return -EINVAL;
1840}
1841
1842#endif /* CONFIG_MEMORY_HOTPLUG */
diff --git a/arch/sparc64/mm/tlb.c b/arch/sparc64/mm/tlb.c
index 8b104be4662b..a079cf42505e 100644
--- a/arch/sparc64/mm/tlb.c
+++ b/arch/sparc64/mm/tlb.c
@@ -25,6 +25,8 @@ void flush_tlb_pending(void)
25 struct mmu_gather *mp = &__get_cpu_var(mmu_gathers); 25 struct mmu_gather *mp = &__get_cpu_var(mmu_gathers);
26 26
27 if (mp->tlb_nr) { 27 if (mp->tlb_nr) {
28 flush_tsb_user(mp);
29
28 if (CTX_VALID(mp->mm->context)) { 30 if (CTX_VALID(mp->mm->context)) {
29#ifdef CONFIG_SMP 31#ifdef CONFIG_SMP
30 smp_flush_tlb_pending(mp->mm, mp->tlb_nr, 32 smp_flush_tlb_pending(mp->mm, mp->tlb_nr,
@@ -47,7 +49,8 @@ void tlb_batch_add(struct mm_struct *mm, unsigned long vaddr, pte_t *ptep, pte_t
47 if (pte_exec(orig)) 49 if (pte_exec(orig))
48 vaddr |= 0x1UL; 50 vaddr |= 0x1UL;
49 51
50 if (pte_dirty(orig)) { 52 if (tlb_type != hypervisor &&
53 pte_dirty(orig)) {
51 unsigned long paddr, pfn = pte_pfn(orig); 54 unsigned long paddr, pfn = pte_pfn(orig);
52 struct address_space *mapping; 55 struct address_space *mapping;
53 struct page *page; 56 struct page *page;
@@ -89,62 +92,3 @@ no_cache_flush:
89 if (nr >= TLB_BATCH_NR) 92 if (nr >= TLB_BATCH_NR)
90 flush_tlb_pending(); 93 flush_tlb_pending();
91} 94}
92
93void flush_tlb_pgtables(struct mm_struct *mm, unsigned long start, unsigned long end)
94{
95 struct mmu_gather *mp = &__get_cpu_var(mmu_gathers);
96 unsigned long nr = mp->tlb_nr;
97 long s = start, e = end, vpte_base;
98
99 if (mp->fullmm)
100 return;
101
102 /* If start is greater than end, that is a real problem. */
103 BUG_ON(start > end);
104
105 /* However, straddling the VA space hole is quite normal. */
106 s &= PMD_MASK;
107 e = (e + PMD_SIZE - 1) & PMD_MASK;
108
109 vpte_base = (tlb_type == spitfire ?
110 VPTE_BASE_SPITFIRE :
111 VPTE_BASE_CHEETAH);
112
113 if (unlikely(nr != 0 && mm != mp->mm)) {
114 flush_tlb_pending();
115 nr = 0;
116 }
117
118 if (nr == 0)
119 mp->mm = mm;
120
121 start = vpte_base + (s >> (PAGE_SHIFT - 3));
122 end = vpte_base + (e >> (PAGE_SHIFT - 3));
123
124 /* If the request straddles the VA space hole, we
125 * need to swap start and end. The reason this
126 * occurs is that "vpte_base" is the center of
127 * the linear page table mapping area. Thus,
128 * high addresses with the sign bit set map to
129 * addresses below vpte_base and non-sign bit
130 * addresses map to addresses above vpte_base.
131 */
132 if (end < start) {
133 unsigned long tmp = start;
134
135 start = end;
136 end = tmp;
137 }
138
139 while (start < end) {
140 mp->vaddrs[nr] = start;
141 mp->tlb_nr = ++nr;
142 if (nr >= TLB_BATCH_NR) {
143 flush_tlb_pending();
144 nr = 0;
145 }
146 start += PAGE_SIZE;
147 }
148 if (nr)
149 flush_tlb_pending();
150}
diff --git a/arch/sparc64/mm/tsb.c b/arch/sparc64/mm/tsb.c
new file mode 100644
index 000000000000..beaa02810f0e
--- /dev/null
+++ b/arch/sparc64/mm/tsb.c
@@ -0,0 +1,500 @@
1/* arch/sparc64/mm/tsb.c
2 *
3 * Copyright (C) 2006 David S. Miller <davem@davemloft.net>
4 */
5
6#include <linux/kernel.h>
7#include <asm/system.h>
8#include <asm/page.h>
9#include <asm/tlbflush.h>
10#include <asm/tlb.h>
11#include <asm/mmu_context.h>
12#include <asm/pgtable.h>
13#include <asm/tsb.h>
14#include <asm/oplib.h>
15
16extern struct tsb swapper_tsb[KERNEL_TSB_NENTRIES];
17
18static inline unsigned long tsb_hash(unsigned long vaddr, unsigned long hash_shift, unsigned long nentries)
19{
20 vaddr >>= hash_shift;
21 return vaddr & (nentries - 1);
22}
23
24static inline int tag_compare(unsigned long tag, unsigned long vaddr)
25{
26 return (tag == (vaddr >> 22));
27}
28
29/* TSB flushes need only occur on the processor initiating the address
30 * space modification, not on each cpu the address space has run on.
31 * Only the TLB flush needs that treatment.
32 */
33
34void flush_tsb_kernel_range(unsigned long start, unsigned long end)
35{
36 unsigned long v;
37
38 for (v = start; v < end; v += PAGE_SIZE) {
39 unsigned long hash = tsb_hash(v, PAGE_SHIFT,
40 KERNEL_TSB_NENTRIES);
41 struct tsb *ent = &swapper_tsb[hash];
42
43 if (tag_compare(ent->tag, v)) {
44 ent->tag = (1UL << TSB_TAG_INVALID_BIT);
45 membar_storeload_storestore();
46 }
47 }
48}
49
50static void __flush_tsb_one(struct mmu_gather *mp, unsigned long hash_shift, unsigned long tsb, unsigned long nentries)
51{
52 unsigned long i;
53
54 for (i = 0; i < mp->tlb_nr; i++) {
55 unsigned long v = mp->vaddrs[i];
56 unsigned long tag, ent, hash;
57
58 v &= ~0x1UL;
59
60 hash = tsb_hash(v, hash_shift, nentries);
61 ent = tsb + (hash * sizeof(struct tsb));
62 tag = (v >> 22UL);
63
64 tsb_flush(ent, tag);
65 }
66}
67
68void flush_tsb_user(struct mmu_gather *mp)
69{
70 struct mm_struct *mm = mp->mm;
71 unsigned long nentries, base, flags;
72
73 spin_lock_irqsave(&mm->context.lock, flags);
74
75 base = (unsigned long) mm->context.tsb_block[MM_TSB_BASE].tsb;
76 nentries = mm->context.tsb_block[MM_TSB_BASE].tsb_nentries;
77 if (tlb_type == cheetah_plus || tlb_type == hypervisor)
78 base = __pa(base);
79 __flush_tsb_one(mp, PAGE_SHIFT, base, nentries);
80
81#ifdef CONFIG_HUGETLB_PAGE
82 if (mm->context.tsb_block[MM_TSB_HUGE].tsb) {
83 base = (unsigned long) mm->context.tsb_block[MM_TSB_HUGE].tsb;
84 nentries = mm->context.tsb_block[MM_TSB_HUGE].tsb_nentries;
85 if (tlb_type == cheetah_plus || tlb_type == hypervisor)
86 base = __pa(base);
87 __flush_tsb_one(mp, HPAGE_SHIFT, base, nentries);
88 }
89#endif
90 spin_unlock_irqrestore(&mm->context.lock, flags);
91}
92
93#if defined(CONFIG_SPARC64_PAGE_SIZE_8KB)
94#define HV_PGSZ_IDX_BASE HV_PGSZ_IDX_8K
95#define HV_PGSZ_MASK_BASE HV_PGSZ_MASK_8K
96#elif defined(CONFIG_SPARC64_PAGE_SIZE_64KB)
97#define HV_PGSZ_IDX_BASE HV_PGSZ_IDX_64K
98#define HV_PGSZ_MASK_BASE HV_PGSZ_MASK_64K
99#elif defined(CONFIG_SPARC64_PAGE_SIZE_512KB)
100#define HV_PGSZ_IDX_BASE HV_PGSZ_IDX_512K
101#define HV_PGSZ_MASK_BASE HV_PGSZ_MASK_512K
102#elif defined(CONFIG_SPARC64_PAGE_SIZE_4MB)
103#define HV_PGSZ_IDX_BASE HV_PGSZ_IDX_4MB
104#define HV_PGSZ_MASK_BASE HV_PGSZ_MASK_4MB
105#else
106#error Broken base page size setting...
107#endif
108
109#ifdef CONFIG_HUGETLB_PAGE
110#if defined(CONFIG_HUGETLB_PAGE_SIZE_64K)
111#define HV_PGSZ_IDX_HUGE HV_PGSZ_IDX_64K
112#define HV_PGSZ_MASK_HUGE HV_PGSZ_MASK_64K
113#elif defined(CONFIG_HUGETLB_PAGE_SIZE_512K)
114#define HV_PGSZ_IDX_HUGE HV_PGSZ_IDX_512K
115#define HV_PGSZ_MASK_HUGE HV_PGSZ_MASK_512K
116#elif defined(CONFIG_HUGETLB_PAGE_SIZE_4MB)
117#define HV_PGSZ_IDX_HUGE HV_PGSZ_IDX_4MB
118#define HV_PGSZ_MASK_HUGE HV_PGSZ_MASK_4MB
119#else
120#error Broken huge page size setting...
121#endif
122#endif
123
124static void setup_tsb_params(struct mm_struct *mm, unsigned long tsb_idx, unsigned long tsb_bytes)
125{
126 unsigned long tsb_reg, base, tsb_paddr;
127 unsigned long page_sz, tte;
128
129 mm->context.tsb_block[tsb_idx].tsb_nentries =
130 tsb_bytes / sizeof(struct tsb);
131
132 base = TSBMAP_BASE;
133 tte = pgprot_val(PAGE_KERNEL_LOCKED);
134 tsb_paddr = __pa(mm->context.tsb_block[tsb_idx].tsb);
135 BUG_ON(tsb_paddr & (tsb_bytes - 1UL));
136
137 /* Use the smallest page size that can map the whole TSB
138 * in one TLB entry.
139 */
140 switch (tsb_bytes) {
141 case 8192 << 0:
142 tsb_reg = 0x0UL;
143#ifdef DCACHE_ALIASING_POSSIBLE
144 base += (tsb_paddr & 8192);
145#endif
146 page_sz = 8192;
147 break;
148
149 case 8192 << 1:
150 tsb_reg = 0x1UL;
151 page_sz = 64 * 1024;
152 break;
153
154 case 8192 << 2:
155 tsb_reg = 0x2UL;
156 page_sz = 64 * 1024;
157 break;
158
159 case 8192 << 3:
160 tsb_reg = 0x3UL;
161 page_sz = 64 * 1024;
162 break;
163
164 case 8192 << 4:
165 tsb_reg = 0x4UL;
166 page_sz = 512 * 1024;
167 break;
168
169 case 8192 << 5:
170 tsb_reg = 0x5UL;
171 page_sz = 512 * 1024;
172 break;
173
174 case 8192 << 6:
175 tsb_reg = 0x6UL;
176 page_sz = 512 * 1024;
177 break;
178
179 case 8192 << 7:
180 tsb_reg = 0x7UL;
181 page_sz = 4 * 1024 * 1024;
182 break;
183
184 default:
185 BUG();
186 };
187 tte |= pte_sz_bits(page_sz);
188
189 if (tlb_type == cheetah_plus || tlb_type == hypervisor) {
190 /* Physical mapping, no locked TLB entry for TSB. */
191 tsb_reg |= tsb_paddr;
192
193 mm->context.tsb_block[tsb_idx].tsb_reg_val = tsb_reg;
194 mm->context.tsb_block[tsb_idx].tsb_map_vaddr = 0;
195 mm->context.tsb_block[tsb_idx].tsb_map_pte = 0;
196 } else {
197 tsb_reg |= base;
198 tsb_reg |= (tsb_paddr & (page_sz - 1UL));
199 tte |= (tsb_paddr & ~(page_sz - 1UL));
200
201 mm->context.tsb_block[tsb_idx].tsb_reg_val = tsb_reg;
202 mm->context.tsb_block[tsb_idx].tsb_map_vaddr = base;
203 mm->context.tsb_block[tsb_idx].tsb_map_pte = tte;
204 }
205
206 /* Setup the Hypervisor TSB descriptor. */
207 if (tlb_type == hypervisor) {
208 struct hv_tsb_descr *hp = &mm->context.tsb_descr[tsb_idx];
209
210 switch (tsb_idx) {
211 case MM_TSB_BASE:
212 hp->pgsz_idx = HV_PGSZ_IDX_BASE;
213 break;
214#ifdef CONFIG_HUGETLB_PAGE
215 case MM_TSB_HUGE:
216 hp->pgsz_idx = HV_PGSZ_IDX_HUGE;
217 break;
218#endif
219 default:
220 BUG();
221 };
222 hp->assoc = 1;
223 hp->num_ttes = tsb_bytes / 16;
224 hp->ctx_idx = 0;
225 switch (tsb_idx) {
226 case MM_TSB_BASE:
227 hp->pgsz_mask = HV_PGSZ_MASK_BASE;
228 break;
229#ifdef CONFIG_HUGETLB_PAGE
230 case MM_TSB_HUGE:
231 hp->pgsz_mask = HV_PGSZ_MASK_HUGE;
232 break;
233#endif
234 default:
235 BUG();
236 };
237 hp->tsb_base = tsb_paddr;
238 hp->resv = 0;
239 }
240}
241
242static kmem_cache_t *tsb_caches[8] __read_mostly;
243
244static const char *tsb_cache_names[8] = {
245 "tsb_8KB",
246 "tsb_16KB",
247 "tsb_32KB",
248 "tsb_64KB",
249 "tsb_128KB",
250 "tsb_256KB",
251 "tsb_512KB",
252 "tsb_1MB",
253};
254
255void __init tsb_cache_init(void)
256{
257 unsigned long i;
258
259 for (i = 0; i < 8; i++) {
260 unsigned long size = 8192 << i;
261 const char *name = tsb_cache_names[i];
262
263 tsb_caches[i] = kmem_cache_create(name,
264 size, size,
265 SLAB_HWCACHE_ALIGN |
266 SLAB_MUST_HWCACHE_ALIGN,
267 NULL, NULL);
268 if (!tsb_caches[i]) {
269 prom_printf("Could not create %s cache\n", name);
270 prom_halt();
271 }
272 }
273}
274
275/* When the RSS of an address space exceeds tsb_rss_limit for a TSB,
276 * do_sparc64_fault() invokes this routine to try and grow it.
277 *
278 * When we reach the maximum TSB size supported, we stick ~0UL into
279 * tsb_rss_limit for that TSB so the grow checks in do_sparc64_fault()
280 * will not trigger any longer.
281 *
282 * The TSB can be anywhere from 8K to 1MB in size, in increasing powers
283 * of two. The TSB must be aligned to it's size, so f.e. a 512K TSB
284 * must be 512K aligned. It also must be physically contiguous, so we
285 * cannot use vmalloc().
286 *
287 * The idea here is to grow the TSB when the RSS of the process approaches
288 * the number of entries that the current TSB can hold at once. Currently,
289 * we trigger when the RSS hits 3/4 of the TSB capacity.
290 */
291void tsb_grow(struct mm_struct *mm, unsigned long tsb_index, unsigned long rss)
292{
293 unsigned long max_tsb_size = 1 * 1024 * 1024;
294 unsigned long new_size, old_size, flags;
295 struct tsb *old_tsb, *new_tsb;
296 unsigned long new_cache_index, old_cache_index;
297 unsigned long new_rss_limit;
298 gfp_t gfp_flags;
299
300 if (max_tsb_size > (PAGE_SIZE << MAX_ORDER))
301 max_tsb_size = (PAGE_SIZE << MAX_ORDER);
302
303 new_cache_index = 0;
304 for (new_size = 8192; new_size < max_tsb_size; new_size <<= 1UL) {
305 unsigned long n_entries = new_size / sizeof(struct tsb);
306
307 n_entries = (n_entries * 3) / 4;
308 if (n_entries > rss)
309 break;
310
311 new_cache_index++;
312 }
313
314 if (new_size == max_tsb_size)
315 new_rss_limit = ~0UL;
316 else
317 new_rss_limit = ((new_size / sizeof(struct tsb)) * 3) / 4;
318
319retry_tsb_alloc:
320 gfp_flags = GFP_KERNEL;
321 if (new_size > (PAGE_SIZE * 2))
322 gfp_flags = __GFP_NOWARN | __GFP_NORETRY;
323
324 new_tsb = kmem_cache_alloc(tsb_caches[new_cache_index], gfp_flags);
325 if (unlikely(!new_tsb)) {
326 /* Not being able to fork due to a high-order TSB
327 * allocation failure is very bad behavior. Just back
328 * down to a 0-order allocation and force no TSB
329 * growing for this address space.
330 */
331 if (mm->context.tsb_block[tsb_index].tsb == NULL &&
332 new_cache_index > 0) {
333 new_cache_index = 0;
334 new_size = 8192;
335 new_rss_limit = ~0UL;
336 goto retry_tsb_alloc;
337 }
338
339 /* If we failed on a TSB grow, we are under serious
340 * memory pressure so don't try to grow any more.
341 */
342 if (mm->context.tsb_block[tsb_index].tsb != NULL)
343 mm->context.tsb_block[tsb_index].tsb_rss_limit = ~0UL;
344 return;
345 }
346
347 /* Mark all tags as invalid. */
348 tsb_init(new_tsb, new_size);
349
350 /* Ok, we are about to commit the changes. If we are
351 * growing an existing TSB the locking is very tricky,
352 * so WATCH OUT!
353 *
354 * We have to hold mm->context.lock while committing to the
355 * new TSB, this synchronizes us with processors in
356 * flush_tsb_user() and switch_mm() for this address space.
357 *
358 * But even with that lock held, processors run asynchronously
359 * accessing the old TSB via TLB miss handling. This is OK
360 * because those actions are just propagating state from the
361 * Linux page tables into the TSB, page table mappings are not
362 * being changed. If a real fault occurs, the processor will
363 * synchronize with us when it hits flush_tsb_user(), this is
364 * also true for the case where vmscan is modifying the page
365 * tables. The only thing we need to be careful with is to
366 * skip any locked TSB entries during copy_tsb().
367 *
368 * When we finish committing to the new TSB, we have to drop
369 * the lock and ask all other cpus running this address space
370 * to run tsb_context_switch() to see the new TSB table.
371 */
372 spin_lock_irqsave(&mm->context.lock, flags);
373
374 old_tsb = mm->context.tsb_block[tsb_index].tsb;
375 old_cache_index =
376 (mm->context.tsb_block[tsb_index].tsb_reg_val & 0x7UL);
377 old_size = (mm->context.tsb_block[tsb_index].tsb_nentries *
378 sizeof(struct tsb));
379
380
381 /* Handle multiple threads trying to grow the TSB at the same time.
382 * One will get in here first, and bump the size and the RSS limit.
383 * The others will get in here next and hit this check.
384 */
385 if (unlikely(old_tsb &&
386 (rss < mm->context.tsb_block[tsb_index].tsb_rss_limit))) {
387 spin_unlock_irqrestore(&mm->context.lock, flags);
388
389 kmem_cache_free(tsb_caches[new_cache_index], new_tsb);
390 return;
391 }
392
393 mm->context.tsb_block[tsb_index].tsb_rss_limit = new_rss_limit;
394
395 if (old_tsb) {
396 extern void copy_tsb(unsigned long old_tsb_base,
397 unsigned long old_tsb_size,
398 unsigned long new_tsb_base,
399 unsigned long new_tsb_size);
400 unsigned long old_tsb_base = (unsigned long) old_tsb;
401 unsigned long new_tsb_base = (unsigned long) new_tsb;
402
403 if (tlb_type == cheetah_plus || tlb_type == hypervisor) {
404 old_tsb_base = __pa(old_tsb_base);
405 new_tsb_base = __pa(new_tsb_base);
406 }
407 copy_tsb(old_tsb_base, old_size, new_tsb_base, new_size);
408 }
409
410 mm->context.tsb_block[tsb_index].tsb = new_tsb;
411 setup_tsb_params(mm, tsb_index, new_size);
412
413 spin_unlock_irqrestore(&mm->context.lock, flags);
414
415 /* If old_tsb is NULL, we're being invoked for the first time
416 * from init_new_context().
417 */
418 if (old_tsb) {
419 /* Reload it on the local cpu. */
420 tsb_context_switch(mm);
421
422 /* Now force other processors to do the same. */
423 smp_tsb_sync(mm);
424
425 /* Now it is safe to free the old tsb. */
426 kmem_cache_free(tsb_caches[old_cache_index], old_tsb);
427 }
428}
429
430int init_new_context(struct task_struct *tsk, struct mm_struct *mm)
431{
432#ifdef CONFIG_HUGETLB_PAGE
433 unsigned long huge_pte_count;
434#endif
435 unsigned int i;
436
437 spin_lock_init(&mm->context.lock);
438
439 mm->context.sparc64_ctx_val = 0UL;
440
441#ifdef CONFIG_HUGETLB_PAGE
442 /* We reset it to zero because the fork() page copying
443 * will re-increment the counters as the parent PTEs are
444 * copied into the child address space.
445 */
446 huge_pte_count = mm->context.huge_pte_count;
447 mm->context.huge_pte_count = 0;
448#endif
449
450 /* copy_mm() copies over the parent's mm_struct before calling
451 * us, so we need to zero out the TSB pointer or else tsb_grow()
452 * will be confused and think there is an older TSB to free up.
453 */
454 for (i = 0; i < MM_NUM_TSBS; i++)
455 mm->context.tsb_block[i].tsb = NULL;
456
457 /* If this is fork, inherit the parent's TSB size. We would
458 * grow it to that size on the first page fault anyways.
459 */
460 tsb_grow(mm, MM_TSB_BASE, get_mm_rss(mm));
461
462#ifdef CONFIG_HUGETLB_PAGE
463 if (unlikely(huge_pte_count))
464 tsb_grow(mm, MM_TSB_HUGE, huge_pte_count);
465#endif
466
467 if (unlikely(!mm->context.tsb_block[MM_TSB_BASE].tsb))
468 return -ENOMEM;
469
470 return 0;
471}
472
473static void tsb_destroy_one(struct tsb_config *tp)
474{
475 unsigned long cache_index;
476
477 if (!tp->tsb)
478 return;
479 cache_index = tp->tsb_reg_val & 0x7UL;
480 kmem_cache_free(tsb_caches[cache_index], tp->tsb);
481 tp->tsb = NULL;
482 tp->tsb_reg_val = 0UL;
483}
484
485void destroy_context(struct mm_struct *mm)
486{
487 unsigned long flags, i;
488
489 for (i = 0; i < MM_NUM_TSBS; i++)
490 tsb_destroy_one(&mm->context.tsb_block[i]);
491
492 spin_lock_irqsave(&ctx_alloc_lock, flags);
493
494 if (CTX_VALID(mm->context)) {
495 unsigned long nr = CTX_NRBITS(mm->context);
496 mmu_context_bmap[nr>>6] &= ~(1UL << (nr & 63));
497 }
498
499 spin_unlock_irqrestore(&ctx_alloc_lock, flags);
500}
diff --git a/arch/sparc64/mm/ultra.S b/arch/sparc64/mm/ultra.S
index e4c9151fa116..f8479fad4047 100644
--- a/arch/sparc64/mm/ultra.S
+++ b/arch/sparc64/mm/ultra.S
@@ -15,6 +15,7 @@
15#include <asm/head.h> 15#include <asm/head.h>
16#include <asm/thread_info.h> 16#include <asm/thread_info.h>
17#include <asm/cacheflush.h> 17#include <asm/cacheflush.h>
18#include <asm/hypervisor.h>
18 19
19 /* Basically, most of the Spitfire vs. Cheetah madness 20 /* Basically, most of the Spitfire vs. Cheetah madness
20 * has to do with the fact that Cheetah does not support 21 * has to do with the fact that Cheetah does not support
@@ -29,16 +30,18 @@
29 .text 30 .text
30 .align 32 31 .align 32
31 .globl __flush_tlb_mm 32 .globl __flush_tlb_mm
32__flush_tlb_mm: /* %o0=(ctx & TAG_CONTEXT_BITS), %o1=SECONDARY_CONTEXT */ 33__flush_tlb_mm: /* 18 insns */
34 /* %o0=(ctx & TAG_CONTEXT_BITS), %o1=SECONDARY_CONTEXT */
33 ldxa [%o1] ASI_DMMU, %g2 35 ldxa [%o1] ASI_DMMU, %g2
34 cmp %g2, %o0 36 cmp %g2, %o0
35 bne,pn %icc, __spitfire_flush_tlb_mm_slow 37 bne,pn %icc, __spitfire_flush_tlb_mm_slow
36 mov 0x50, %g3 38 mov 0x50, %g3
37 stxa %g0, [%g3] ASI_DMMU_DEMAP 39 stxa %g0, [%g3] ASI_DMMU_DEMAP
38 stxa %g0, [%g3] ASI_IMMU_DEMAP 40 stxa %g0, [%g3] ASI_IMMU_DEMAP
41 sethi %hi(KERNBASE), %g3
42 flush %g3
39 retl 43 retl
40 flush %g6 44 nop
41 nop
42 nop 45 nop
43 nop 46 nop
44 nop 47 nop
@@ -51,7 +54,7 @@ __flush_tlb_mm: /* %o0=(ctx & TAG_CONTEXT_BITS), %o1=SECONDARY_CONTEXT */
51 54
52 .align 32 55 .align 32
53 .globl __flush_tlb_pending 56 .globl __flush_tlb_pending
54__flush_tlb_pending: 57__flush_tlb_pending: /* 26 insns */
55 /* %o0 = context, %o1 = nr, %o2 = vaddrs[] */ 58 /* %o0 = context, %o1 = nr, %o2 = vaddrs[] */
56 rdpr %pstate, %g7 59 rdpr %pstate, %g7
57 sllx %o1, 3, %o1 60 sllx %o1, 3, %o1
@@ -72,7 +75,8 @@ __flush_tlb_pending:
72 brnz,pt %o1, 1b 75 brnz,pt %o1, 1b
73 nop 76 nop
74 stxa %g2, [%o4] ASI_DMMU 77 stxa %g2, [%o4] ASI_DMMU
75 flush %g6 78 sethi %hi(KERNBASE), %o4
79 flush %o4
76 retl 80 retl
77 wrpr %g7, 0x0, %pstate 81 wrpr %g7, 0x0, %pstate
78 nop 82 nop
@@ -82,7 +86,8 @@ __flush_tlb_pending:
82 86
83 .align 32 87 .align 32
84 .globl __flush_tlb_kernel_range 88 .globl __flush_tlb_kernel_range
85__flush_tlb_kernel_range: /* %o0=start, %o1=end */ 89__flush_tlb_kernel_range: /* 16 insns */
90 /* %o0=start, %o1=end */
86 cmp %o0, %o1 91 cmp %o0, %o1
87 be,pn %xcc, 2f 92 be,pn %xcc, 2f
88 sethi %hi(PAGE_SIZE), %o4 93 sethi %hi(PAGE_SIZE), %o4
@@ -94,8 +99,11 @@ __flush_tlb_kernel_range: /* %o0=start, %o1=end */
94 membar #Sync 99 membar #Sync
95 brnz,pt %o3, 1b 100 brnz,pt %o3, 1b
96 sub %o3, %o4, %o3 101 sub %o3, %o4, %o3
972: retl 1022: sethi %hi(KERNBASE), %o3
98 flush %g6 103 flush %o3
104 retl
105 nop
106 nop
99 107
100__spitfire_flush_tlb_mm_slow: 108__spitfire_flush_tlb_mm_slow:
101 rdpr %pstate, %g1 109 rdpr %pstate, %g1
@@ -105,7 +113,8 @@ __spitfire_flush_tlb_mm_slow:
105 stxa %g0, [%g3] ASI_IMMU_DEMAP 113 stxa %g0, [%g3] ASI_IMMU_DEMAP
106 flush %g6 114 flush %g6
107 stxa %g2, [%o1] ASI_DMMU 115 stxa %g2, [%o1] ASI_DMMU
108 flush %g6 116 sethi %hi(KERNBASE), %o1
117 flush %o1
109 retl 118 retl
110 wrpr %g1, 0, %pstate 119 wrpr %g1, 0, %pstate
111 120
@@ -181,7 +190,7 @@ __flush_dcache_page: /* %o0=kaddr, %o1=flush_icache */
181 .previous 190 .previous
182 191
183 /* Cheetah specific versions, patched at boot time. */ 192 /* Cheetah specific versions, patched at boot time. */
184__cheetah_flush_tlb_mm: /* 18 insns */ 193__cheetah_flush_tlb_mm: /* 19 insns */
185 rdpr %pstate, %g7 194 rdpr %pstate, %g7
186 andn %g7, PSTATE_IE, %g2 195 andn %g7, PSTATE_IE, %g2
187 wrpr %g2, 0x0, %pstate 196 wrpr %g2, 0x0, %pstate
@@ -196,12 +205,13 @@ __cheetah_flush_tlb_mm: /* 18 insns */
196 stxa %g0, [%g3] ASI_DMMU_DEMAP 205 stxa %g0, [%g3] ASI_DMMU_DEMAP
197 stxa %g0, [%g3] ASI_IMMU_DEMAP 206 stxa %g0, [%g3] ASI_IMMU_DEMAP
198 stxa %g2, [%o2] ASI_DMMU 207 stxa %g2, [%o2] ASI_DMMU
199 flush %g6 208 sethi %hi(KERNBASE), %o2
209 flush %o2
200 wrpr %g0, 0, %tl 210 wrpr %g0, 0, %tl
201 retl 211 retl
202 wrpr %g7, 0x0, %pstate 212 wrpr %g7, 0x0, %pstate
203 213
204__cheetah_flush_tlb_pending: /* 26 insns */ 214__cheetah_flush_tlb_pending: /* 27 insns */
205 /* %o0 = context, %o1 = nr, %o2 = vaddrs[] */ 215 /* %o0 = context, %o1 = nr, %o2 = vaddrs[] */
206 rdpr %pstate, %g7 216 rdpr %pstate, %g7
207 sllx %o1, 3, %o1 217 sllx %o1, 3, %o1
@@ -225,7 +235,8 @@ __cheetah_flush_tlb_pending: /* 26 insns */
225 brnz,pt %o1, 1b 235 brnz,pt %o1, 1b
226 nop 236 nop
227 stxa %g2, [%o4] ASI_DMMU 237 stxa %g2, [%o4] ASI_DMMU
228 flush %g6 238 sethi %hi(KERNBASE), %o4
239 flush %o4
229 wrpr %g0, 0, %tl 240 wrpr %g0, 0, %tl
230 retl 241 retl
231 wrpr %g7, 0x0, %pstate 242 wrpr %g7, 0x0, %pstate
@@ -245,7 +256,76 @@ __cheetah_flush_dcache_page: /* 11 insns */
245 nop 256 nop
246#endif /* DCACHE_ALIASING_POSSIBLE */ 257#endif /* DCACHE_ALIASING_POSSIBLE */
247 258
248cheetah_patch_one: 259 /* Hypervisor specific versions, patched at boot time. */
260__hypervisor_tlb_tl0_error:
261 save %sp, -192, %sp
262 mov %i0, %o0
263 call hypervisor_tlbop_error
264 mov %i1, %o1
265 ret
266 restore
267
268__hypervisor_flush_tlb_mm: /* 10 insns */
269 mov %o0, %o2 /* ARG2: mmu context */
270 mov 0, %o0 /* ARG0: CPU lists unimplemented */
271 mov 0, %o1 /* ARG1: CPU lists unimplemented */
272 mov HV_MMU_ALL, %o3 /* ARG3: flags */
273 mov HV_FAST_MMU_DEMAP_CTX, %o5
274 ta HV_FAST_TRAP
275 brnz,pn %o0, __hypervisor_tlb_tl0_error
276 mov HV_FAST_MMU_DEMAP_CTX, %o1
277 retl
278 nop
279
280__hypervisor_flush_tlb_pending: /* 16 insns */
281 /* %o0 = context, %o1 = nr, %o2 = vaddrs[] */
282 sllx %o1, 3, %g1
283 mov %o2, %g2
284 mov %o0, %g3
2851: sub %g1, (1 << 3), %g1
286 ldx [%g2 + %g1], %o0 /* ARG0: vaddr + IMMU-bit */
287 mov %g3, %o1 /* ARG1: mmu context */
288 mov HV_MMU_ALL, %o2 /* ARG2: flags */
289 srlx %o0, PAGE_SHIFT, %o0
290 sllx %o0, PAGE_SHIFT, %o0
291 ta HV_MMU_UNMAP_ADDR_TRAP
292 brnz,pn %o0, __hypervisor_tlb_tl0_error
293 mov HV_MMU_UNMAP_ADDR_TRAP, %o1
294 brnz,pt %g1, 1b
295 nop
296 retl
297 nop
298
299__hypervisor_flush_tlb_kernel_range: /* 16 insns */
300 /* %o0=start, %o1=end */
301 cmp %o0, %o1
302 be,pn %xcc, 2f
303 sethi %hi(PAGE_SIZE), %g3
304 mov %o0, %g1
305 sub %o1, %g1, %g2
306 sub %g2, %g3, %g2
3071: add %g1, %g2, %o0 /* ARG0: virtual address */
308 mov 0, %o1 /* ARG1: mmu context */
309 mov HV_MMU_ALL, %o2 /* ARG2: flags */
310 ta HV_MMU_UNMAP_ADDR_TRAP
311 brnz,pn %o0, __hypervisor_tlb_tl0_error
312 mov HV_MMU_UNMAP_ADDR_TRAP, %o1
313 brnz,pt %g2, 1b
314 sub %g2, %g3, %g2
3152: retl
316 nop
317
318#ifdef DCACHE_ALIASING_POSSIBLE
319 /* XXX Niagara and friends have an 8K cache, so no aliasing is
320 * XXX possible, but nothing explicit in the Hypervisor API
321 * XXX guarantees this.
322 */
323__hypervisor_flush_dcache_page: /* 2 insns */
324 retl
325 nop
326#endif
327
328tlb_patch_one:
2491: lduw [%o1], %g1 3291: lduw [%o1], %g1
250 stw %g1, [%o0] 330 stw %g1, [%o0]
251 flush %o0 331 flush %o0
@@ -264,22 +344,22 @@ cheetah_patch_cachetlbops:
264 or %o0, %lo(__flush_tlb_mm), %o0 344 or %o0, %lo(__flush_tlb_mm), %o0
265 sethi %hi(__cheetah_flush_tlb_mm), %o1 345 sethi %hi(__cheetah_flush_tlb_mm), %o1
266 or %o1, %lo(__cheetah_flush_tlb_mm), %o1 346 or %o1, %lo(__cheetah_flush_tlb_mm), %o1
267 call cheetah_patch_one 347 call tlb_patch_one
268 mov 18, %o2 348 mov 19, %o2
269 349
270 sethi %hi(__flush_tlb_pending), %o0 350 sethi %hi(__flush_tlb_pending), %o0
271 or %o0, %lo(__flush_tlb_pending), %o0 351 or %o0, %lo(__flush_tlb_pending), %o0
272 sethi %hi(__cheetah_flush_tlb_pending), %o1 352 sethi %hi(__cheetah_flush_tlb_pending), %o1
273 or %o1, %lo(__cheetah_flush_tlb_pending), %o1 353 or %o1, %lo(__cheetah_flush_tlb_pending), %o1
274 call cheetah_patch_one 354 call tlb_patch_one
275 mov 26, %o2 355 mov 27, %o2
276 356
277#ifdef DCACHE_ALIASING_POSSIBLE 357#ifdef DCACHE_ALIASING_POSSIBLE
278 sethi %hi(__flush_dcache_page), %o0 358 sethi %hi(__flush_dcache_page), %o0
279 or %o0, %lo(__flush_dcache_page), %o0 359 or %o0, %lo(__flush_dcache_page), %o0
280 sethi %hi(__cheetah_flush_dcache_page), %o1 360 sethi %hi(__cheetah_flush_dcache_page), %o1
281 or %o1, %lo(__cheetah_flush_dcache_page), %o1 361 or %o1, %lo(__cheetah_flush_dcache_page), %o1
282 call cheetah_patch_one 362 call tlb_patch_one
283 mov 11, %o2 363 mov 11, %o2
284#endif /* DCACHE_ALIASING_POSSIBLE */ 364#endif /* DCACHE_ALIASING_POSSIBLE */
285 365
@@ -295,16 +375,14 @@ cheetah_patch_cachetlbops:
295 * %g1 address arg 1 (tlb page and range flushes) 375 * %g1 address arg 1 (tlb page and range flushes)
296 * %g7 address arg 2 (tlb range flush only) 376 * %g7 address arg 2 (tlb range flush only)
297 * 377 *
298 * %g6 ivector table, don't touch 378 * %g6 scratch 1
299 * %g2 scratch 1 379 * %g2 scratch 2
300 * %g3 scratch 2 380 * %g3 scratch 3
301 * %g4 scratch 3 381 * %g4 scratch 4
302 *
303 * TODO: Make xcall TLB range flushes use the tricks above... -DaveM
304 */ 382 */
305 .align 32 383 .align 32
306 .globl xcall_flush_tlb_mm 384 .globl xcall_flush_tlb_mm
307xcall_flush_tlb_mm: 385xcall_flush_tlb_mm: /* 21 insns */
308 mov PRIMARY_CONTEXT, %g2 386 mov PRIMARY_CONTEXT, %g2
309 ldxa [%g2] ASI_DMMU, %g3 387 ldxa [%g2] ASI_DMMU, %g3
310 srlx %g3, CTX_PGSZ1_NUC_SHIFT, %g4 388 srlx %g3, CTX_PGSZ1_NUC_SHIFT, %g4
@@ -316,9 +394,19 @@ xcall_flush_tlb_mm:
316 stxa %g0, [%g4] ASI_IMMU_DEMAP 394 stxa %g0, [%g4] ASI_IMMU_DEMAP
317 stxa %g3, [%g2] ASI_DMMU 395 stxa %g3, [%g2] ASI_DMMU
318 retry 396 retry
397 nop
398 nop
399 nop
400 nop
401 nop
402 nop
403 nop
404 nop
405 nop
406 nop
319 407
320 .globl xcall_flush_tlb_pending 408 .globl xcall_flush_tlb_pending
321xcall_flush_tlb_pending: 409xcall_flush_tlb_pending: /* 21 insns */
322 /* %g5=context, %g1=nr, %g7=vaddrs[] */ 410 /* %g5=context, %g1=nr, %g7=vaddrs[] */
323 sllx %g1, 3, %g1 411 sllx %g1, 3, %g1
324 mov PRIMARY_CONTEXT, %g4 412 mov PRIMARY_CONTEXT, %g4
@@ -341,9 +429,10 @@ xcall_flush_tlb_pending:
341 nop 429 nop
342 stxa %g2, [%g4] ASI_DMMU 430 stxa %g2, [%g4] ASI_DMMU
343 retry 431 retry
432 nop
344 433
345 .globl xcall_flush_tlb_kernel_range 434 .globl xcall_flush_tlb_kernel_range
346xcall_flush_tlb_kernel_range: 435xcall_flush_tlb_kernel_range: /* 25 insns */
347 sethi %hi(PAGE_SIZE - 1), %g2 436 sethi %hi(PAGE_SIZE - 1), %g2
348 or %g2, %lo(PAGE_SIZE - 1), %g2 437 or %g2, %lo(PAGE_SIZE - 1), %g2
349 andn %g1, %g2, %g1 438 andn %g1, %g2, %g1
@@ -360,14 +449,30 @@ xcall_flush_tlb_kernel_range:
360 retry 449 retry
361 nop 450 nop
362 nop 451 nop
452 nop
453 nop
454 nop
455 nop
456 nop
457 nop
458 nop
459 nop
460 nop
363 461
364 /* This runs in a very controlled environment, so we do 462 /* This runs in a very controlled environment, so we do
365 * not need to worry about BH races etc. 463 * not need to worry about BH races etc.
366 */ 464 */
367 .globl xcall_sync_tick 465 .globl xcall_sync_tick
368xcall_sync_tick: 466xcall_sync_tick:
369 rdpr %pstate, %g2 467
468661: rdpr %pstate, %g2
370 wrpr %g2, PSTATE_IG | PSTATE_AG, %pstate 469 wrpr %g2, PSTATE_IG | PSTATE_AG, %pstate
470 .section .sun4v_2insn_patch, "ax"
471 .word 661b
472 nop
473 nop
474 .previous
475
371 rdpr %pil, %g2 476 rdpr %pil, %g2
372 wrpr %g0, 15, %pil 477 wrpr %g0, 15, %pil
373 sethi %hi(109f), %g7 478 sethi %hi(109f), %g7
@@ -390,8 +495,15 @@ xcall_sync_tick:
390 */ 495 */
391 .globl xcall_report_regs 496 .globl xcall_report_regs
392xcall_report_regs: 497xcall_report_regs:
393 rdpr %pstate, %g2 498
499661: rdpr %pstate, %g2
394 wrpr %g2, PSTATE_IG | PSTATE_AG, %pstate 500 wrpr %g2, PSTATE_IG | PSTATE_AG, %pstate
501 .section .sun4v_2insn_patch, "ax"
502 .word 661b
503 nop
504 nop
505 .previous
506
395 rdpr %pil, %g2 507 rdpr %pil, %g2
396 wrpr %g0, 15, %pil 508 wrpr %g0, 15, %pil
397 sethi %hi(109f), %g7 509 sethi %hi(109f), %g7
@@ -453,62 +565,96 @@ xcall_flush_dcache_page_spitfire: /* %g1 == physical page address
453 nop 565 nop
454 nop 566 nop
455 567
456 .data 568 /* %g5: error
457 569 * %g6: tlb op
458errata32_hwbug: 570 */
459 .xword 0 571__hypervisor_tlb_xcall_error:
460 572 mov %g5, %g4
461 .text 573 mov %g6, %g5
462 574 ba,pt %xcc, etrap
463 /* These two are not performance critical... */ 575 rd %pc, %g7
464 .globl xcall_flush_tlb_all_spitfire 576 mov %l4, %o0
465xcall_flush_tlb_all_spitfire: 577 call hypervisor_tlbop_error_xcall
466 /* Spitfire Errata #32 workaround. */ 578 mov %l5, %o1
467 sethi %hi(errata32_hwbug), %g4 579 ba,a,pt %xcc, rtrap_clr_l6
468 stx %g0, [%g4 + %lo(errata32_hwbug)] 580
469 581 .globl __hypervisor_xcall_flush_tlb_mm
470 clr %g2 582__hypervisor_xcall_flush_tlb_mm: /* 21 insns */
471 clr %g3 583 /* %g5=ctx, g1,g2,g3,g4,g7=scratch, %g6=unusable */
4721: ldxa [%g3] ASI_DTLB_DATA_ACCESS, %g4 584 mov %o0, %g2
473 and %g4, _PAGE_L, %g5 585 mov %o1, %g3
474 brnz,pn %g5, 2f 586 mov %o2, %g4
475 mov TLB_TAG_ACCESS, %g7 587 mov %o3, %g1
476 588 mov %o5, %g7
477 stxa %g0, [%g7] ASI_DMMU 589 clr %o0 /* ARG0: CPU lists unimplemented */
478 membar #Sync 590 clr %o1 /* ARG1: CPU lists unimplemented */
479 stxa %g0, [%g3] ASI_DTLB_DATA_ACCESS 591 mov %g5, %o2 /* ARG2: mmu context */
592 mov HV_MMU_ALL, %o3 /* ARG3: flags */
593 mov HV_FAST_MMU_DEMAP_CTX, %o5
594 ta HV_FAST_TRAP
595 mov HV_FAST_MMU_DEMAP_CTX, %g6
596 brnz,pn %o0, __hypervisor_tlb_xcall_error
597 mov %o0, %g5
598 mov %g2, %o0
599 mov %g3, %o1
600 mov %g4, %o2
601 mov %g1, %o3
602 mov %g7, %o5
480 membar #Sync 603 membar #Sync
604 retry
481 605
482 /* Spitfire Errata #32 workaround. */ 606 .globl __hypervisor_xcall_flush_tlb_pending
483 sethi %hi(errata32_hwbug), %g4 607__hypervisor_xcall_flush_tlb_pending: /* 21 insns */
484 stx %g0, [%g4 + %lo(errata32_hwbug)] 608 /* %g5=ctx, %g1=nr, %g7=vaddrs[], %g2,%g3,%g4,g6=scratch */
485 609 sllx %g1, 3, %g1
4862: ldxa [%g3] ASI_ITLB_DATA_ACCESS, %g4 610 mov %o0, %g2
487 and %g4, _PAGE_L, %g5 611 mov %o1, %g3
488 brnz,pn %g5, 2f 612 mov %o2, %g4
489 mov TLB_TAG_ACCESS, %g7 6131: sub %g1, (1 << 3), %g1
490 614 ldx [%g7 + %g1], %o0 /* ARG0: virtual address */
491 stxa %g0, [%g7] ASI_IMMU 615 mov %g5, %o1 /* ARG1: mmu context */
492 membar #Sync 616 mov HV_MMU_ALL, %o2 /* ARG2: flags */
493 stxa %g0, [%g3] ASI_ITLB_DATA_ACCESS 617 srlx %o0, PAGE_SHIFT, %o0
618 sllx %o0, PAGE_SHIFT, %o0
619 ta HV_MMU_UNMAP_ADDR_TRAP
620 mov HV_MMU_UNMAP_ADDR_TRAP, %g6
621 brnz,a,pn %o0, __hypervisor_tlb_xcall_error
622 mov %o0, %g5
623 brnz,pt %g1, 1b
624 nop
625 mov %g2, %o0
626 mov %g3, %o1
627 mov %g4, %o2
494 membar #Sync 628 membar #Sync
495
496 /* Spitfire Errata #32 workaround. */
497 sethi %hi(errata32_hwbug), %g4
498 stx %g0, [%g4 + %lo(errata32_hwbug)]
499
5002: add %g2, 1, %g2
501 cmp %g2, SPITFIRE_HIGHEST_LOCKED_TLBENT
502 ble,pt %icc, 1b
503 sll %g2, 3, %g3
504 flush %g6
505 retry 629 retry
506 630
507 .globl xcall_flush_tlb_all_cheetah 631 .globl __hypervisor_xcall_flush_tlb_kernel_range
508xcall_flush_tlb_all_cheetah: 632__hypervisor_xcall_flush_tlb_kernel_range: /* 25 insns */
509 mov 0x80, %g2 633 /* %g1=start, %g7=end, g2,g3,g4,g5,g6=scratch */
510 stxa %g0, [%g2] ASI_DMMU_DEMAP 634 sethi %hi(PAGE_SIZE - 1), %g2
511 stxa %g0, [%g2] ASI_IMMU_DEMAP 635 or %g2, %lo(PAGE_SIZE - 1), %g2
636 andn %g1, %g2, %g1
637 andn %g7, %g2, %g7
638 sub %g7, %g1, %g3
639 add %g2, 1, %g2
640 sub %g3, %g2, %g3
641 mov %o0, %g2
642 mov %o1, %g4
643 mov %o2, %g7
6441: add %g1, %g3, %o0 /* ARG0: virtual address */
645 mov 0, %o1 /* ARG1: mmu context */
646 mov HV_MMU_ALL, %o2 /* ARG2: flags */
647 ta HV_MMU_UNMAP_ADDR_TRAP
648 mov HV_MMU_UNMAP_ADDR_TRAP, %g6
649 brnz,pn %o0, __hypervisor_tlb_xcall_error
650 mov %o0, %g5
651 sethi %hi(PAGE_SIZE), %o2
652 brnz,pt %g3, 1b
653 sub %g3, %o2, %g3
654 mov %g2, %o0
655 mov %g4, %o1
656 mov %g7, %o2
657 membar #Sync
512 retry 658 retry
513 659
514 /* These just get rescheduled to PIL vectors. */ 660 /* These just get rescheduled to PIL vectors. */
@@ -527,4 +673,70 @@ xcall_capture:
527 wr %g0, (1 << PIL_SMP_CAPTURE), %set_softint 673 wr %g0, (1 << PIL_SMP_CAPTURE), %set_softint
528 retry 674 retry
529 675
676 .globl xcall_new_mmu_context_version
677xcall_new_mmu_context_version:
678 wr %g0, (1 << PIL_SMP_CTX_NEW_VERSION), %set_softint
679 retry
680
530#endif /* CONFIG_SMP */ 681#endif /* CONFIG_SMP */
682
683
684 .globl hypervisor_patch_cachetlbops
685hypervisor_patch_cachetlbops:
686 save %sp, -128, %sp
687
688 sethi %hi(__flush_tlb_mm), %o0
689 or %o0, %lo(__flush_tlb_mm), %o0
690 sethi %hi(__hypervisor_flush_tlb_mm), %o1
691 or %o1, %lo(__hypervisor_flush_tlb_mm), %o1
692 call tlb_patch_one
693 mov 10, %o2
694
695 sethi %hi(__flush_tlb_pending), %o0
696 or %o0, %lo(__flush_tlb_pending), %o0
697 sethi %hi(__hypervisor_flush_tlb_pending), %o1
698 or %o1, %lo(__hypervisor_flush_tlb_pending), %o1
699 call tlb_patch_one
700 mov 16, %o2
701
702 sethi %hi(__flush_tlb_kernel_range), %o0
703 or %o0, %lo(__flush_tlb_kernel_range), %o0
704 sethi %hi(__hypervisor_flush_tlb_kernel_range), %o1
705 or %o1, %lo(__hypervisor_flush_tlb_kernel_range), %o1
706 call tlb_patch_one
707 mov 16, %o2
708
709#ifdef DCACHE_ALIASING_POSSIBLE
710 sethi %hi(__flush_dcache_page), %o0
711 or %o0, %lo(__flush_dcache_page), %o0
712 sethi %hi(__hypervisor_flush_dcache_page), %o1
713 or %o1, %lo(__hypervisor_flush_dcache_page), %o1
714 call tlb_patch_one
715 mov 2, %o2
716#endif /* DCACHE_ALIASING_POSSIBLE */
717
718#ifdef CONFIG_SMP
719 sethi %hi(xcall_flush_tlb_mm), %o0
720 or %o0, %lo(xcall_flush_tlb_mm), %o0
721 sethi %hi(__hypervisor_xcall_flush_tlb_mm), %o1
722 or %o1, %lo(__hypervisor_xcall_flush_tlb_mm), %o1
723 call tlb_patch_one
724 mov 21, %o2
725
726 sethi %hi(xcall_flush_tlb_pending), %o0
727 or %o0, %lo(xcall_flush_tlb_pending), %o0
728 sethi %hi(__hypervisor_xcall_flush_tlb_pending), %o1
729 or %o1, %lo(__hypervisor_xcall_flush_tlb_pending), %o1
730 call tlb_patch_one
731 mov 21, %o2
732
733 sethi %hi(xcall_flush_tlb_kernel_range), %o0
734 or %o0, %lo(xcall_flush_tlb_kernel_range), %o0
735 sethi %hi(__hypervisor_xcall_flush_tlb_kernel_range), %o1
736 or %o1, %lo(__hypervisor_xcall_flush_tlb_kernel_range), %o1
737 call tlb_patch_one
738 mov 25, %o2
739#endif /* CONFIG_SMP */
740
741 ret
742 restore
diff --git a/arch/sparc64/prom/cif.S b/arch/sparc64/prom/cif.S
index 29d0ae74aed8..5f27ad779c0c 100644
--- a/arch/sparc64/prom/cif.S
+++ b/arch/sparc64/prom/cif.S
@@ -1,10 +1,12 @@
1/* cif.S: PROM entry/exit assembler trampolines. 1/* cif.S: PROM entry/exit assembler trampolines.
2 * 2 *
3 * Copyright (C) 1996,1997 Jakub Jelinek (jj@sunsite.mff.cuni.cz) 3 * Copyright (C) 1996, 1997 Jakub Jelinek (jj@sunsite.mff.cuni.cz)
4 * Copyright (C) 2005 David S. Miller <davem@davemloft.net> 4 * Copyright (C) 2005, 2006 David S. Miller <davem@davemloft.net>
5 */ 5 */
6 6
7#include <asm/pstate.h> 7#include <asm/pstate.h>
8#include <asm/cpudata.h>
9#include <asm/thread_info.h>
8 10
9 .text 11 .text
10 .globl prom_cif_interface 12 .globl prom_cif_interface
@@ -12,78 +14,16 @@ prom_cif_interface:
12 sethi %hi(p1275buf), %o0 14 sethi %hi(p1275buf), %o0
13 or %o0, %lo(p1275buf), %o0 15 or %o0, %lo(p1275buf), %o0
14 ldx [%o0 + 0x010], %o1 ! prom_cif_stack 16 ldx [%o0 + 0x010], %o1 ! prom_cif_stack
15 save %o1, -0x190, %sp 17 save %o1, -192, %sp
16 ldx [%i0 + 0x008], %l2 ! prom_cif_handler 18 ldx [%i0 + 0x008], %l2 ! prom_cif_handler
17 rdpr %pstate, %l4 19 mov %g4, %l0
18 wrpr %g0, 0x15, %pstate ! save alternate globals 20 mov %g5, %l1
19 stx %g1, [%sp + 2047 + 0x0b0] 21 mov %g6, %l3
20 stx %g2, [%sp + 2047 + 0x0b8]
21 stx %g3, [%sp + 2047 + 0x0c0]
22 stx %g4, [%sp + 2047 + 0x0c8]
23 stx %g5, [%sp + 2047 + 0x0d0]
24 stx %g6, [%sp + 2047 + 0x0d8]
25 stx %g7, [%sp + 2047 + 0x0e0]
26 wrpr %g0, 0x814, %pstate ! save interrupt globals
27 stx %g1, [%sp + 2047 + 0x0e8]
28 stx %g2, [%sp + 2047 + 0x0f0]
29 stx %g3, [%sp + 2047 + 0x0f8]
30 stx %g4, [%sp + 2047 + 0x100]
31 stx %g5, [%sp + 2047 + 0x108]
32 stx %g6, [%sp + 2047 + 0x110]
33 stx %g7, [%sp + 2047 + 0x118]
34 wrpr %g0, 0x14, %pstate ! save normal globals
35 stx %g1, [%sp + 2047 + 0x120]
36 stx %g2, [%sp + 2047 + 0x128]
37 stx %g3, [%sp + 2047 + 0x130]
38 stx %g4, [%sp + 2047 + 0x138]
39 stx %g5, [%sp + 2047 + 0x140]
40 stx %g6, [%sp + 2047 + 0x148]
41 stx %g7, [%sp + 2047 + 0x150]
42 wrpr %g0, 0x414, %pstate ! save mmu globals
43 stx %g1, [%sp + 2047 + 0x158]
44 stx %g2, [%sp + 2047 + 0x160]
45 stx %g3, [%sp + 2047 + 0x168]
46 stx %g4, [%sp + 2047 + 0x170]
47 stx %g5, [%sp + 2047 + 0x178]
48 stx %g6, [%sp + 2047 + 0x180]
49 stx %g7, [%sp + 2047 + 0x188]
50 mov %g1, %l0 ! also save to locals, so we can handle
51 mov %g2, %l1 ! tlb faults later on, when accessing
52 mov %g3, %l3 ! the stack.
53 mov %g7, %l5
54 wrpr %l4, PSTATE_IE, %pstate ! turn off interrupts
55 call %l2 22 call %l2
56 add %i0, 0x018, %o0 ! prom_args 23 add %i0, 0x018, %o0 ! prom_args
57 wrpr %g0, 0x414, %pstate ! restore mmu globals 24 mov %l0, %g4
58 mov %l0, %g1 25 mov %l1, %g5
59 mov %l1, %g2 26 mov %l3, %g6
60 mov %l3, %g3
61 mov %l5, %g7
62 wrpr %g0, 0x14, %pstate ! restore normal globals
63 ldx [%sp + 2047 + 0x120], %g1
64 ldx [%sp + 2047 + 0x128], %g2
65 ldx [%sp + 2047 + 0x130], %g3
66 ldx [%sp + 2047 + 0x138], %g4
67 ldx [%sp + 2047 + 0x140], %g5
68 ldx [%sp + 2047 + 0x148], %g6
69 ldx [%sp + 2047 + 0x150], %g7
70 wrpr %g0, 0x814, %pstate ! restore interrupt globals
71 ldx [%sp + 2047 + 0x0e8], %g1
72 ldx [%sp + 2047 + 0x0f0], %g2
73 ldx [%sp + 2047 + 0x0f8], %g3
74 ldx [%sp + 2047 + 0x100], %g4
75 ldx [%sp + 2047 + 0x108], %g5
76 ldx [%sp + 2047 + 0x110], %g6
77 ldx [%sp + 2047 + 0x118], %g7
78 wrpr %g0, 0x15, %pstate ! restore alternate globals
79 ldx [%sp + 2047 + 0x0b0], %g1
80 ldx [%sp + 2047 + 0x0b8], %g2
81 ldx [%sp + 2047 + 0x0c0], %g3
82 ldx [%sp + 2047 + 0x0c8], %g4
83 ldx [%sp + 2047 + 0x0d0], %g5
84 ldx [%sp + 2047 + 0x0d8], %g6
85 ldx [%sp + 2047 + 0x0e0], %g7
86 wrpr %l4, 0, %pstate ! restore original pstate
87 ret 27 ret
88 restore 28 restore
89 29
@@ -91,135 +31,18 @@ prom_cif_interface:
91prom_cif_callback: 31prom_cif_callback:
92 sethi %hi(p1275buf), %o1 32 sethi %hi(p1275buf), %o1
93 or %o1, %lo(p1275buf), %o1 33 or %o1, %lo(p1275buf), %o1
94 save %sp, -0x270, %sp 34 save %sp, -192, %sp
95 rdpr %pstate, %l4 35 TRAP_LOAD_THREAD_REG(%g6, %g1)
96 wrpr %g0, 0x15, %pstate ! save PROM alternate globals 36 LOAD_PER_CPU_BASE(%g5, %g6, %g4, %g3, %o0)
97 stx %g1, [%sp + 2047 + 0x0b0] 37 ldx [%g6 + TI_TASK], %g4
98 stx %g2, [%sp + 2047 + 0x0b8]
99 stx %g3, [%sp + 2047 + 0x0c0]
100 stx %g4, [%sp + 2047 + 0x0c8]
101 stx %g5, [%sp + 2047 + 0x0d0]
102 stx %g6, [%sp + 2047 + 0x0d8]
103 stx %g7, [%sp + 2047 + 0x0e0]
104 ! restore Linux alternate globals
105 ldx [%sp + 2047 + 0x190], %g1
106 ldx [%sp + 2047 + 0x198], %g2
107 ldx [%sp + 2047 + 0x1a0], %g3
108 ldx [%sp + 2047 + 0x1a8], %g4
109 ldx [%sp + 2047 + 0x1b0], %g5
110 ldx [%sp + 2047 + 0x1b8], %g6
111 ldx [%sp + 2047 + 0x1c0], %g7
112 wrpr %g0, 0x814, %pstate ! save PROM interrupt globals
113 stx %g1, [%sp + 2047 + 0x0e8]
114 stx %g2, [%sp + 2047 + 0x0f0]
115 stx %g3, [%sp + 2047 + 0x0f8]
116 stx %g4, [%sp + 2047 + 0x100]
117 stx %g5, [%sp + 2047 + 0x108]
118 stx %g6, [%sp + 2047 + 0x110]
119 stx %g7, [%sp + 2047 + 0x118]
120 ! restore Linux interrupt globals
121 ldx [%sp + 2047 + 0x1c8], %g1
122 ldx [%sp + 2047 + 0x1d0], %g2
123 ldx [%sp + 2047 + 0x1d8], %g3
124 ldx [%sp + 2047 + 0x1e0], %g4
125 ldx [%sp + 2047 + 0x1e8], %g5
126 ldx [%sp + 2047 + 0x1f0], %g6
127 ldx [%sp + 2047 + 0x1f8], %g7
128 wrpr %g0, 0x14, %pstate ! save PROM normal globals
129 stx %g1, [%sp + 2047 + 0x120]
130 stx %g2, [%sp + 2047 + 0x128]
131 stx %g3, [%sp + 2047 + 0x130]
132 stx %g4, [%sp + 2047 + 0x138]
133 stx %g5, [%sp + 2047 + 0x140]
134 stx %g6, [%sp + 2047 + 0x148]
135 stx %g7, [%sp + 2047 + 0x150]
136 ! restore Linux normal globals
137 ldx [%sp + 2047 + 0x200], %g1
138 ldx [%sp + 2047 + 0x208], %g2
139 ldx [%sp + 2047 + 0x210], %g3
140 ldx [%sp + 2047 + 0x218], %g4
141 ldx [%sp + 2047 + 0x220], %g5
142 ldx [%sp + 2047 + 0x228], %g6
143 ldx [%sp + 2047 + 0x230], %g7
144 wrpr %g0, 0x414, %pstate ! save PROM mmu globals
145 stx %g1, [%sp + 2047 + 0x158]
146 stx %g2, [%sp + 2047 + 0x160]
147 stx %g3, [%sp + 2047 + 0x168]
148 stx %g4, [%sp + 2047 + 0x170]
149 stx %g5, [%sp + 2047 + 0x178]
150 stx %g6, [%sp + 2047 + 0x180]
151 stx %g7, [%sp + 2047 + 0x188]
152 ! restore Linux mmu globals
153 ldx [%sp + 2047 + 0x238], %o0
154 ldx [%sp + 2047 + 0x240], %o1
155 ldx [%sp + 2047 + 0x248], %l2
156 ldx [%sp + 2047 + 0x250], %l3
157 ldx [%sp + 2047 + 0x258], %l5
158 ldx [%sp + 2047 + 0x260], %l6
159 ldx [%sp + 2047 + 0x268], %l7
160 ! switch to Linux tba
161 sethi %hi(sparc64_ttable_tl0), %l1
162 rdpr %tba, %l0 ! save PROM tba
163 mov %o0, %g1
164 mov %o1, %g2
165 mov %l2, %g3
166 mov %l3, %g4
167 mov %l5, %g5
168 mov %l6, %g6
169 mov %l7, %g7
170 wrpr %l1, %tba ! install Linux tba
171 wrpr %l4, 0, %pstate ! restore PSTATE
172 call prom_world 38 call prom_world
173 mov %g0, %o0 39 mov 0, %o0
174 ldx [%i1 + 0x000], %l2 40 ldx [%i1 + 0x000], %l2
175 call %l2 41 call %l2
176 mov %i0, %o0 42 mov %i0, %o0
177 mov %o0, %l1 43 mov %o0, %l1
178 call prom_world 44 call prom_world
179 or %g0, 1, %o0 45 mov 1, %o0
180 wrpr %g0, 0x14, %pstate ! interrupts off
181 ! restore PROM mmu globals
182 ldx [%sp + 2047 + 0x158], %o0
183 ldx [%sp + 2047 + 0x160], %o1
184 ldx [%sp + 2047 + 0x168], %l2
185 ldx [%sp + 2047 + 0x170], %l3
186 ldx [%sp + 2047 + 0x178], %l5
187 ldx [%sp + 2047 + 0x180], %l6
188 ldx [%sp + 2047 + 0x188], %l7
189 wrpr %g0, 0x414, %pstate ! restore PROM mmu globals
190 mov %o0, %g1
191 mov %o1, %g2
192 mov %l2, %g3
193 mov %l3, %g4
194 mov %l5, %g5
195 mov %l6, %g6
196 mov %l7, %g7
197 wrpr %l0, %tba ! restore PROM tba
198 wrpr %g0, 0x14, %pstate ! restore PROM normal globals
199 ldx [%sp + 2047 + 0x120], %g1
200 ldx [%sp + 2047 + 0x128], %g2
201 ldx [%sp + 2047 + 0x130], %g3
202 ldx [%sp + 2047 + 0x138], %g4
203 ldx [%sp + 2047 + 0x140], %g5
204 ldx [%sp + 2047 + 0x148], %g6
205 ldx [%sp + 2047 + 0x150], %g7
206 wrpr %g0, 0x814, %pstate ! restore PROM interrupt globals
207 ldx [%sp + 2047 + 0x0e8], %g1
208 ldx [%sp + 2047 + 0x0f0], %g2
209 ldx [%sp + 2047 + 0x0f8], %g3
210 ldx [%sp + 2047 + 0x100], %g4
211 ldx [%sp + 2047 + 0x108], %g5
212 ldx [%sp + 2047 + 0x110], %g6
213 ldx [%sp + 2047 + 0x118], %g7
214 wrpr %g0, 0x15, %pstate ! restore PROM alternate globals
215 ldx [%sp + 2047 + 0x0b0], %g1
216 ldx [%sp + 2047 + 0x0b8], %g2
217 ldx [%sp + 2047 + 0x0c0], %g3
218 ldx [%sp + 2047 + 0x0c8], %g4
219 ldx [%sp + 2047 + 0x0d0], %g5
220 ldx [%sp + 2047 + 0x0d8], %g6
221 ldx [%sp + 2047 + 0x0e0], %g7
222 wrpr %l4, 0, %pstate
223 ret 46 ret
224 restore %l1, 0, %o0 47 restore %l1, 0, %o0
225 48
diff --git a/arch/sparc64/prom/console.c b/arch/sparc64/prom/console.c
index ac6d035dd150..7c25c54cefdc 100644
--- a/arch/sparc64/prom/console.c
+++ b/arch/sparc64/prom/console.c
@@ -102,6 +102,9 @@ prom_query_input_device(void)
102 if (!strncmp (propb, "rsc", 3)) 102 if (!strncmp (propb, "rsc", 3))
103 return PROMDEV_IRSC; 103 return PROMDEV_IRSC;
104 104
105 if (!strncmp (propb, "virtual-console", 3))
106 return PROMDEV_IVCONS;
107
105 if (strncmp (propb, "tty", 3) || !propb[3]) 108 if (strncmp (propb, "tty", 3) || !propb[3])
106 return PROMDEV_I_UNK; 109 return PROMDEV_I_UNK;
107 110
@@ -143,6 +146,9 @@ prom_query_output_device(void)
143 if (!strncmp (propb, "rsc", 3)) 146 if (!strncmp (propb, "rsc", 3))
144 return PROMDEV_ORSC; 147 return PROMDEV_ORSC;
145 148
149 if (!strncmp (propb, "virtual-console", 3))
150 return PROMDEV_OVCONS;
151
146 if (strncmp (propb, "tty", 3) || !propb[3]) 152 if (strncmp (propb, "tty", 3) || !propb[3])
147 return PROMDEV_O_UNK; 153 return PROMDEV_O_UNK;
148 154
diff --git a/arch/sparc64/prom/init.c b/arch/sparc64/prom/init.c
index f3cc2d8578b2..1c0db842a6f4 100644
--- a/arch/sparc64/prom/init.c
+++ b/arch/sparc64/prom/init.c
@@ -14,11 +14,10 @@
14#include <asm/openprom.h> 14#include <asm/openprom.h>
15#include <asm/oplib.h> 15#include <asm/oplib.h>
16 16
17enum prom_major_version prom_vers; 17/* OBP version string. */
18unsigned int prom_rev, prom_prev; 18char prom_version[80];
19 19
20/* The root node of the prom device tree. */ 20/* The root node of the prom device tree. */
21int prom_root_node;
22int prom_stdin, prom_stdout; 21int prom_stdin, prom_stdout;
23int prom_chosen_node; 22int prom_chosen_node;
24 23
@@ -31,68 +30,25 @@ extern void prom_cif_init(void *, void *);
31 30
32void __init prom_init(void *cif_handler, void *cif_stack) 31void __init prom_init(void *cif_handler, void *cif_stack)
33{ 32{
34 char buffer[80], *p;
35 int ints[3];
36 int node; 33 int node;
37 int i = 0;
38 int bufadjust;
39
40 prom_vers = PROM_P1275;
41 34
42 prom_cif_init(cif_handler, cif_stack); 35 prom_cif_init(cif_handler, cif_stack);
43 36
44 prom_root_node = prom_getsibling(0);
45 if((prom_root_node == 0) || (prom_root_node == -1))
46 prom_halt();
47
48 prom_chosen_node = prom_finddevice(prom_chosen_path); 37 prom_chosen_node = prom_finddevice(prom_chosen_path);
49 if (!prom_chosen_node || prom_chosen_node == -1) 38 if (!prom_chosen_node || prom_chosen_node == -1)
50 prom_halt(); 39 prom_halt();
51 40
52 prom_stdin = prom_getint (prom_chosen_node, "stdin"); 41 prom_stdin = prom_getint(prom_chosen_node, "stdin");
53 prom_stdout = prom_getint (prom_chosen_node, "stdout"); 42 prom_stdout = prom_getint(prom_chosen_node, "stdout");
54 43
55 node = prom_finddevice("/openprom"); 44 node = prom_finddevice("/openprom");
56 if (!node || node == -1) 45 if (!node || node == -1)
57 prom_halt(); 46 prom_halt();
58 47
59 prom_getstring (node, "version", buffer, sizeof (buffer)); 48 prom_getstring(node, "version", prom_version, sizeof(prom_version));
60
61 prom_printf ("\n");
62
63 if (strncmp (buffer, "OBP ", 4))
64 goto strange_version;
65
66 /*
67 * Version field is expected to be 'OBP xx.yy.zz date...'
68 * However, Sun can't stick to this format very well, so
69 * we need to check for 'OBP xx.yy.zz date...' and adjust
70 * accordingly. -spot
71 */
72
73 if (strncmp (buffer, "OBP ", 5))
74 bufadjust = 4;
75 else
76 bufadjust = 5;
77
78 p = buffer + bufadjust;
79 while (p && isdigit(*p) && i < 3) {
80 ints[i++] = simple_strtoul(p, NULL, 0);
81 if ((p = strchr(p, '.')) != NULL)
82 p++;
83 }
84 if (i != 3)
85 goto strange_version;
86
87 prom_rev = ints[1];
88 prom_prev = (ints[0] << 16) | (ints[1] << 8) | ints[2];
89
90 printk ("PROMLIB: Sun IEEE Boot Prom %s\n", buffer + bufadjust);
91 49
92 /* Initialization successful. */ 50 prom_printf("\n");
93 return;
94 51
95strange_version: 52 printk("PROMLIB: Sun IEEE Boot Prom '%s'\n", prom_version);
96 prom_printf ("Strange OBP version `%s'.\n", buffer); 53 printk("PROMLIB: Root node compatible: %s\n", prom_root_compatible);
97 prom_halt ();
98} 54}
diff --git a/arch/sparc64/prom/misc.c b/arch/sparc64/prom/misc.c
index 87f5cfce23bb..577bde8b6647 100644
--- a/arch/sparc64/prom/misc.c
+++ b/arch/sparc64/prom/misc.c
@@ -112,28 +112,20 @@ unsigned char prom_get_idprom(char *idbuf, int num_bytes)
112 return 0xff; 112 return 0xff;
113} 113}
114 114
115/* Get the major prom version number. */ 115/* Install Linux trap table so PROM uses that instead of its own. */
116int prom_version(void) 116void prom_set_trap_table(unsigned long tba)
117{
118 return PROM_P1275;
119}
120
121/* Get the prom plugin-revision. */
122int prom_getrev(void)
123{
124 return prom_rev;
125}
126
127/* Get the prom firmware print revision. */
128int prom_getprev(void)
129{ 117{
130 return prom_prev; 118 p1275_cmd("SUNW,set-trap-table",
119 (P1275_ARG(0, P1275_ARG_IN_64B) |
120 P1275_INOUT(1, 0)), tba);
131} 121}
132 122
133/* Install Linux trap table so PROM uses that instead of its own. */ 123void prom_set_trap_table_sun4v(unsigned long tba, unsigned long mmfsa)
134void prom_set_trap_table(unsigned long tba)
135{ 124{
136 p1275_cmd("SUNW,set-trap-table", P1275_INOUT(1, 0), tba); 125 p1275_cmd("SUNW,set-trap-table",
126 (P1275_ARG(0, P1275_ARG_IN_64B) |
127 P1275_ARG(1, P1275_ARG_IN_64B) |
128 P1275_INOUT(2, 0)), tba, mmfsa);
137} 129}
138 130
139int prom_get_mmu_ihandle(void) 131int prom_get_mmu_ihandle(void)
@@ -303,9 +295,21 @@ int prom_wakeupsystem(void)
303} 295}
304 296
305#ifdef CONFIG_SMP 297#ifdef CONFIG_SMP
306void prom_startcpu(int cpunode, unsigned long pc, unsigned long o0) 298void prom_startcpu(int cpunode, unsigned long pc, unsigned long arg)
299{
300 p1275_cmd("SUNW,start-cpu", P1275_INOUT(3, 0), cpunode, pc, arg);
301}
302
303void prom_startcpu_cpuid(int cpuid, unsigned long pc, unsigned long arg)
304{
305 p1275_cmd("SUNW,start-cpu-by-cpuid", P1275_INOUT(3, 0),
306 cpuid, pc, arg);
307}
308
309void prom_stopcpu_cpuid(int cpuid)
307{ 310{
308 p1275_cmd("SUNW,start-cpu", P1275_INOUT(3, 0), cpunode, pc, o0); 311 p1275_cmd("SUNW,stop-cpu-by-cpuid", P1275_INOUT(1, 0),
312 cpuid);
309} 313}
310 314
311void prom_stopself(void) 315void prom_stopself(void)
diff --git a/arch/sparc64/prom/p1275.c b/arch/sparc64/prom/p1275.c
index a5a7c5712028..2b32c489860c 100644
--- a/arch/sparc64/prom/p1275.c
+++ b/arch/sparc64/prom/p1275.c
@@ -30,16 +30,6 @@ extern void prom_world(int);
30extern void prom_cif_interface(void); 30extern void prom_cif_interface(void);
31extern void prom_cif_callback(void); 31extern void prom_cif_callback(void);
32 32
33static inline unsigned long spitfire_get_primary_context(void)
34{
35 unsigned long ctx;
36
37 __asm__ __volatile__("ldxa [%1] %2, %0"
38 : "=r" (ctx)
39 : "r" (PRIMARY_CONTEXT), "i" (ASI_DMMU));
40 return ctx;
41}
42
43/* 33/*
44 * This provides SMP safety on the p1275buf. prom_callback() drops this lock 34 * This provides SMP safety on the p1275buf. prom_callback() drops this lock
45 * to allow recursuve acquisition. 35 * to allow recursuve acquisition.
@@ -55,7 +45,6 @@ long p1275_cmd(const char *service, long fmt, ...)
55 long attrs, x; 45 long attrs, x;
56 46
57 p = p1275buf.prom_buffer; 47 p = p1275buf.prom_buffer;
58 BUG_ON((spitfire_get_primary_context() & CTX_NR_MASK) != 0);
59 48
60 spin_lock_irqsave(&prom_entry_lock, flags); 49 spin_lock_irqsave(&prom_entry_lock, flags);
61 50
diff --git a/arch/sparc64/prom/tree.c b/arch/sparc64/prom/tree.c
index b1ff9e87dcc6..49075abd7cbc 100644
--- a/arch/sparc64/prom/tree.c
+++ b/arch/sparc64/prom/tree.c
@@ -51,7 +51,7 @@ prom_getparent(int node)
51__inline__ int 51__inline__ int
52__prom_getsibling(int node) 52__prom_getsibling(int node)
53{ 53{
54 return p1275_cmd ("peer", P1275_INOUT(1, 1), node); 54 return p1275_cmd(prom_peer_name, P1275_INOUT(1, 1), node);
55} 55}
56 56
57__inline__ int 57__inline__ int
@@ -59,9 +59,12 @@ prom_getsibling(int node)
59{ 59{
60 int sibnode; 60 int sibnode;
61 61
62 if(node == -1) return 0; 62 if (node == -1)
63 return 0;
63 sibnode = __prom_getsibling(node); 64 sibnode = __prom_getsibling(node);
64 if(sibnode == -1) return 0; 65 if (sibnode == -1)
66 return 0;
67
65 return sibnode; 68 return sibnode;
66} 69}
67 70
diff --git a/arch/sparc64/solaris/misc.c b/arch/sparc64/solaris/misc.c
index 3ab4677395f2..5284996780a7 100644
--- a/arch/sparc64/solaris/misc.c
+++ b/arch/sparc64/solaris/misc.c
@@ -90,7 +90,7 @@ static u32 do_solaris_mmap(u32 addr, u32 len, u32 prot, u32 flags, u32 fd, u64 o
90 len = PAGE_ALIGN(len); 90 len = PAGE_ALIGN(len);
91 if(!(flags & MAP_FIXED)) 91 if(!(flags & MAP_FIXED))
92 addr = 0; 92 addr = 0;
93 else if (len > 0xf0000000UL || addr > 0xf0000000UL - len) 93 else if (len > STACK_TOP32 || addr > STACK_TOP32 - len)
94 goto out_putf; 94 goto out_putf;
95 ret_type = flags & _MAP_NEW; 95 ret_type = flags & _MAP_NEW;
96 flags &= ~_MAP_NEW; 96 flags &= ~_MAP_NEW;
@@ -102,7 +102,7 @@ static u32 do_solaris_mmap(u32 addr, u32 len, u32 prot, u32 flags, u32 fd, u64 o
102 (unsigned long) prot, (unsigned long) flags, off); 102 (unsigned long) prot, (unsigned long) flags, off);
103 up_write(&current->mm->mmap_sem); 103 up_write(&current->mm->mmap_sem);
104 if(!ret_type) 104 if(!ret_type)
105 retval = ((retval < 0xf0000000) ? 0 : retval); 105 retval = ((retval < STACK_TOP32) ? 0 : retval);
106 106
107out_putf: 107out_putf:
108 if (file) 108 if (file)
diff --git a/arch/um/Kconfig b/arch/um/Kconfig
index 5982fe2753e0..05fbb20636cb 100644
--- a/arch/um/Kconfig
+++ b/arch/um/Kconfig
@@ -22,6 +22,9 @@ config SBUS
22config PCI 22config PCI
23 bool 23 bool
24 24
25config PCMCIA
26 bool
27
25config GENERIC_CALIBRATE_DELAY 28config GENERIC_CALIBRATE_DELAY
26 bool 29 bool
27 default y 30 default y
diff --git a/arch/um/Kconfig.i386 b/arch/um/Kconfig.i386
index ef79ed25aecd..85e6a55b3b59 100644
--- a/arch/um/Kconfig.i386
+++ b/arch/um/Kconfig.i386
@@ -52,3 +52,8 @@ config ARCH_HAS_SC_SIGNALS
52config ARCH_REUSE_HOST_VSYSCALL_AREA 52config ARCH_REUSE_HOST_VSYSCALL_AREA
53 bool 53 bool
54 default y 54 default y
55
56config GENERIC_HWEIGHT
57 bool
58 default y
59
diff --git a/arch/um/Kconfig.x86_64 b/arch/um/Kconfig.x86_64
index aae19bc4b06a..f60e9e506424 100644
--- a/arch/um/Kconfig.x86_64
+++ b/arch/um/Kconfig.x86_64
@@ -46,3 +46,8 @@ config ARCH_REUSE_HOST_VSYSCALL_AREA
46config SMP_BROKEN 46config SMP_BROKEN
47 bool 47 bool
48 default y 48 default y
49
50config GENERIC_HWEIGHT
51 bool
52 default y
53
diff --git a/arch/um/Makefile b/arch/um/Makefile
index c58b657f0097..24790bed2054 100644
--- a/arch/um/Makefile
+++ b/arch/um/Makefile
@@ -1,4 +1,7 @@
1# 1#
2# This file is included by the global makefile so that you can add your own
3# architecture-specific flags and dependencies.
4#
2# Copyright (C) 2002 Jeff Dike (jdike@karaya.com) 5# Copyright (C) 2002 Jeff Dike (jdike@karaya.com)
3# Licensed under the GPL 6# Licensed under the GPL
4# 7#
@@ -17,7 +20,7 @@ core-y += $(ARCH_DIR)/kernel/ \
17 20
18# Have to precede the include because the included Makefiles reference them. 21# Have to precede the include because the included Makefiles reference them.
19SYMLINK_HEADERS := archparam.h system.h sigcontext.h processor.h ptrace.h \ 22SYMLINK_HEADERS := archparam.h system.h sigcontext.h processor.h ptrace.h \
20 module.h vm-flags.h elf.h ldt.h 23 module.h vm-flags.h elf.h host_ldt.h
21SYMLINK_HEADERS := $(foreach header,$(SYMLINK_HEADERS),include/asm-um/$(header)) 24SYMLINK_HEADERS := $(foreach header,$(SYMLINK_HEADERS),include/asm-um/$(header))
22 25
23# XXX: The "os" symlink is only used by arch/um/include/os.h, which includes 26# XXX: The "os" symlink is only used by arch/um/include/os.h, which includes
@@ -88,7 +91,7 @@ CONFIG_KERNEL_HALF_GIGS ?= 0
88 91
89SIZE = (($(CONFIG_NEST_LEVEL) + $(CONFIG_KERNEL_HALF_GIGS)) * 0x20000000) 92SIZE = (($(CONFIG_NEST_LEVEL) + $(CONFIG_KERNEL_HALF_GIGS)) * 0x20000000)
90 93
91.PHONY: linux 94PHONY += linux
92 95
93all: linux 96all: linux
94 97
@@ -126,7 +129,7 @@ CPPFLAGS_vmlinux.lds = -U$(SUBARCH) \
126 -DSTART=$(START) -DELF_ARCH=$(ELF_ARCH) \ 129 -DSTART=$(START) -DELF_ARCH=$(ELF_ARCH) \
127 -DELF_FORMAT="$(ELF_FORMAT)" $(CPP_MODE-y) \ 130 -DELF_FORMAT="$(ELF_FORMAT)" $(CPP_MODE-y) \
128 -DKERNEL_STACK_SIZE=$(STACK_SIZE) \ 131 -DKERNEL_STACK_SIZE=$(STACK_SIZE) \
129 -DUNMAP_PATH=arch/um/sys-$(SUBARCH)/unmap_fin.o 132 -DUNMAP_PATH=arch/um/sys-$(SUBARCH)/unmap.o
130 133
131#The wrappers will select whether using "malloc" or the kernel allocator. 134#The wrappers will select whether using "malloc" or the kernel allocator.
132LINK_WRAPS = -Wl,--wrap,malloc -Wl,--wrap,free -Wl,--wrap,calloc 135LINK_WRAPS = -Wl,--wrap,malloc -Wl,--wrap,free -Wl,--wrap,calloc
@@ -147,8 +150,7 @@ CLEAN_FILES += linux x.i gmon.out $(ARCH_DIR)/include/uml-config.h \
147 $(ARCH_DIR)/include/user_constants.h \ 150 $(ARCH_DIR)/include/user_constants.h \
148 $(ARCH_DIR)/include/kern_constants.h $(ARCH_DIR)/Kconfig.arch 151 $(ARCH_DIR)/include/kern_constants.h $(ARCH_DIR)/Kconfig.arch
149 152
150MRPROPER_FILES += $(SYMLINK_HEADERS) $(ARCH_SYMLINKS) \ 153MRPROPER_FILES += $(ARCH_SYMLINKS)
151 $(addprefix $(ARCH_DIR)/kernel/,$(KERN_SYMLINKS)) $(ARCH_DIR)/os
152 154
153archclean: 155archclean:
154 @find . \( -name '*.bb' -o -name '*.bbg' -o -name '*.da' \ 156 @find . \( -name '*.bb' -o -name '*.bbg' -o -name '*.da' \
diff --git a/arch/um/Makefile-x86_64 b/arch/um/Makefile-x86_64
index 38df311e75dc..dfd88b652fbe 100644
--- a/arch/um/Makefile-x86_64
+++ b/arch/um/Makefile-x86_64
@@ -1,7 +1,7 @@
1# Copyright 2003 - 2004 Pathscale, Inc 1# Copyright 2003 - 2004 Pathscale, Inc
2# Released under the GPL 2# Released under the GPL
3 3
4libs-y += arch/um/sys-x86_64/ 4core-y += arch/um/sys-x86_64/
5START := 0x60000000 5START := 0x60000000
6 6
7#We #undef __x86_64__ for kernelspace, not for userspace where 7#We #undef __x86_64__ for kernelspace, not for userspace where
diff --git a/arch/um/drivers/daemon_kern.c b/arch/um/drivers/daemon_kern.c
index a61b7b46bc02..53d09ed78b42 100644
--- a/arch/um/drivers/daemon_kern.c
+++ b/arch/um/drivers/daemon_kern.c
@@ -95,18 +95,7 @@ static struct transport daemon_transport = {
95static int register_daemon(void) 95static int register_daemon(void)
96{ 96{
97 register_transport(&daemon_transport); 97 register_transport(&daemon_transport);
98 return(1); 98 return 0;
99} 99}
100 100
101__initcall(register_daemon); 101__initcall(register_daemon);
102
103/*
104 * Overrides for Emacs so that we follow Linus's tabbing style.
105 * Emacs will notice this stuff at the end of the file and automatically
106 * adjust the settings for this buffer only. This must remain at the end
107 * of the file.
108 * ---------------------------------------------------------------------------
109 * Local variables:
110 * c-file-style: "linux"
111 * End:
112 */
diff --git a/arch/um/drivers/harddog_kern.c b/arch/um/drivers/harddog_kern.c
index 49acb2badf32..d18a974735e6 100644
--- a/arch/um/drivers/harddog_kern.c
+++ b/arch/um/drivers/harddog_kern.c
@@ -104,7 +104,7 @@ static int harddog_release(struct inode *inode, struct file *file)
104 104
105extern int ping_watchdog(int fd); 105extern int ping_watchdog(int fd);
106 106
107static ssize_t harddog_write(struct file *file, const char *data, size_t len, 107static ssize_t harddog_write(struct file *file, const char __user *data, size_t len,
108 loff_t *ppos) 108 loff_t *ppos)
109{ 109{
110 /* 110 /*
@@ -118,6 +118,7 @@ static ssize_t harddog_write(struct file *file, const char *data, size_t len,
118static int harddog_ioctl(struct inode *inode, struct file *file, 118static int harddog_ioctl(struct inode *inode, struct file *file,
119 unsigned int cmd, unsigned long arg) 119 unsigned int cmd, unsigned long arg)
120{ 120{
121 void __user *argp= (void __user *)arg;
121 static struct watchdog_info ident = { 122 static struct watchdog_info ident = {
122 WDIOC_SETTIMEOUT, 123 WDIOC_SETTIMEOUT,
123 0, 124 0,
@@ -127,13 +128,12 @@ static int harddog_ioctl(struct inode *inode, struct file *file,
127 default: 128 default:
128 return -ENOTTY; 129 return -ENOTTY;
129 case WDIOC_GETSUPPORT: 130 case WDIOC_GETSUPPORT:
130 if(copy_to_user((struct harddog_info *)arg, &ident, 131 if(copy_to_user(argp, &ident, sizeof(ident)))
131 sizeof(ident)))
132 return -EFAULT; 132 return -EFAULT;
133 return 0; 133 return 0;
134 case WDIOC_GETSTATUS: 134 case WDIOC_GETSTATUS:
135 case WDIOC_GETBOOTSTATUS: 135 case WDIOC_GETBOOTSTATUS:
136 return put_user(0,(int *)arg); 136 return put_user(0,(int __user *)argp);
137 case WDIOC_KEEPALIVE: 137 case WDIOC_KEEPALIVE:
138 return(ping_watchdog(harddog_out_fd)); 138 return(ping_watchdog(harddog_out_fd));
139 } 139 }
diff --git a/arch/um/drivers/hostaudio_kern.c b/arch/um/drivers/hostaudio_kern.c
index 59602b81b240..37232f908cd7 100644
--- a/arch/um/drivers/hostaudio_kern.c
+++ b/arch/um/drivers/hostaudio_kern.c
@@ -67,8 +67,8 @@ MODULE_PARM_DESC(mixer, MIXER_HELP);
67 67
68/* /dev/dsp file operations */ 68/* /dev/dsp file operations */
69 69
70static ssize_t hostaudio_read(struct file *file, char *buffer, size_t count, 70static ssize_t hostaudio_read(struct file *file, char __user *buffer,
71 loff_t *ppos) 71 size_t count, loff_t *ppos)
72{ 72{
73 struct hostaudio_state *state = file->private_data; 73 struct hostaudio_state *state = file->private_data;
74 void *kbuf; 74 void *kbuf;
@@ -94,7 +94,7 @@ static ssize_t hostaudio_read(struct file *file, char *buffer, size_t count,
94 return(err); 94 return(err);
95} 95}
96 96
97static ssize_t hostaudio_write(struct file *file, const char *buffer, 97static ssize_t hostaudio_write(struct file *file, const char __user *buffer,
98 size_t count, loff_t *ppos) 98 size_t count, loff_t *ppos)
99{ 99{
100 struct hostaudio_state *state = file->private_data; 100 struct hostaudio_state *state = file->private_data;
@@ -152,7 +152,7 @@ static int hostaudio_ioctl(struct inode *inode, struct file *file,
152 case SNDCTL_DSP_CHANNELS: 152 case SNDCTL_DSP_CHANNELS:
153 case SNDCTL_DSP_SUBDIVIDE: 153 case SNDCTL_DSP_SUBDIVIDE:
154 case SNDCTL_DSP_SETFRAGMENT: 154 case SNDCTL_DSP_SETFRAGMENT:
155 if(get_user(data, (int *) arg)) 155 if(get_user(data, (int __user *) arg))
156 return(-EFAULT); 156 return(-EFAULT);
157 break; 157 break;
158 default: 158 default:
@@ -168,7 +168,7 @@ static int hostaudio_ioctl(struct inode *inode, struct file *file,
168 case SNDCTL_DSP_CHANNELS: 168 case SNDCTL_DSP_CHANNELS:
169 case SNDCTL_DSP_SUBDIVIDE: 169 case SNDCTL_DSP_SUBDIVIDE:
170 case SNDCTL_DSP_SETFRAGMENT: 170 case SNDCTL_DSP_SETFRAGMENT:
171 if(put_user(data, (int *) arg)) 171 if(put_user(data, (int __user *) arg))
172 return(-EFAULT); 172 return(-EFAULT);
173 break; 173 break;
174 default: 174 default:
diff --git a/arch/um/drivers/mcast_kern.c b/arch/um/drivers/mcast_kern.c
index c9b078fba03e..3a7af18cf944 100644
--- a/arch/um/drivers/mcast_kern.c
+++ b/arch/um/drivers/mcast_kern.c
@@ -124,18 +124,7 @@ static struct transport mcast_transport = {
124static int register_mcast(void) 124static int register_mcast(void)
125{ 125{
126 register_transport(&mcast_transport); 126 register_transport(&mcast_transport);
127 return(1); 127 return 0;
128} 128}
129 129
130__initcall(register_mcast); 130__initcall(register_mcast);
131
132/*
133 * Overrides for Emacs so that we follow Linus's tabbing style.
134 * Emacs will notice this stuff at the end of the file and automatically
135 * adjust the settings for this buffer only. This must remain at the end
136 * of the file.
137 * ---------------------------------------------------------------------------
138 * Local variables:
139 * c-file-style: "linux"
140 * End:
141 */
diff --git a/arch/um/drivers/mconsole_kern.c b/arch/um/drivers/mconsole_kern.c
index 54388d10bcf9..28e3760e8b98 100644
--- a/arch/um/drivers/mconsole_kern.c
+++ b/arch/um/drivers/mconsole_kern.c
@@ -20,6 +20,8 @@
20#include "linux/namei.h" 20#include "linux/namei.h"
21#include "linux/proc_fs.h" 21#include "linux/proc_fs.h"
22#include "linux/syscalls.h" 22#include "linux/syscalls.h"
23#include "linux/list.h"
24#include "linux/mm.h"
23#include "linux/console.h" 25#include "linux/console.h"
24#include "asm/irq.h" 26#include "asm/irq.h"
25#include "asm/uaccess.h" 27#include "asm/uaccess.h"
@@ -347,6 +349,142 @@ static struct mc_device *mconsole_find_dev(char *name)
347 return(NULL); 349 return(NULL);
348} 350}
349 351
352#define UNPLUGGED_PER_PAGE \
353 ((PAGE_SIZE - sizeof(struct list_head)) / sizeof(unsigned long))
354
355struct unplugged_pages {
356 struct list_head list;
357 void *pages[UNPLUGGED_PER_PAGE];
358};
359
360static unsigned long long unplugged_pages_count = 0;
361static struct list_head unplugged_pages = LIST_HEAD_INIT(unplugged_pages);
362static int unplug_index = UNPLUGGED_PER_PAGE;
363
364static int mem_config(char *str)
365{
366 unsigned long long diff;
367 int err = -EINVAL, i, add;
368 char *ret;
369
370 if(str[0] != '=')
371 goto out;
372
373 str++;
374 if(str[0] == '-')
375 add = 0;
376 else if(str[0] == '+'){
377 add = 1;
378 }
379 else goto out;
380
381 str++;
382 diff = memparse(str, &ret);
383 if(*ret != '\0')
384 goto out;
385
386 diff /= PAGE_SIZE;
387
388 for(i = 0; i < diff; i++){
389 struct unplugged_pages *unplugged;
390 void *addr;
391
392 if(add){
393 if(list_empty(&unplugged_pages))
394 break;
395
396 unplugged = list_entry(unplugged_pages.next,
397 struct unplugged_pages, list);
398 if(unplug_index > 0)
399 addr = unplugged->pages[--unplug_index];
400 else {
401 list_del(&unplugged->list);
402 addr = unplugged;
403 unplug_index = UNPLUGGED_PER_PAGE;
404 }
405
406 free_page((unsigned long) addr);
407 unplugged_pages_count--;
408 }
409 else {
410 struct page *page;
411
412 page = alloc_page(GFP_ATOMIC);
413 if(page == NULL)
414 break;
415
416 unplugged = page_address(page);
417 if(unplug_index == UNPLUGGED_PER_PAGE){
418 INIT_LIST_HEAD(&unplugged->list);
419 list_add(&unplugged->list, &unplugged_pages);
420 unplug_index = 0;
421 }
422 else {
423 struct list_head *entry = unplugged_pages.next;
424 addr = unplugged;
425
426 unplugged = list_entry(entry,
427 struct unplugged_pages,
428 list);
429 unplugged->pages[unplug_index++] = addr;
430 err = os_drop_memory(addr, PAGE_SIZE);
431 if(err)
432 printk("Failed to release memory - "
433 "errno = %d\n", err);
434 }
435
436 unplugged_pages_count++;
437 }
438 }
439
440 err = 0;
441out:
442 return err;
443}
444
445static int mem_get_config(char *name, char *str, int size, char **error_out)
446{
447 char buf[sizeof("18446744073709551615")];
448 int len = 0;
449
450 sprintf(buf, "%ld", uml_physmem);
451 CONFIG_CHUNK(str, size, len, buf, 1);
452
453 return len;
454}
455
456static int mem_id(char **str, int *start_out, int *end_out)
457{
458 *start_out = 0;
459 *end_out = 0;
460
461 return 0;
462}
463
464static int mem_remove(int n)
465{
466 return -EBUSY;
467}
468
469static struct mc_device mem_mc = {
470 .name = "mem",
471 .config = mem_config,
472 .get_config = mem_get_config,
473 .id = mem_id,
474 .remove = mem_remove,
475};
476
477static int mem_mc_init(void)
478{
479 if(can_drop_memory())
480 mconsole_register_dev(&mem_mc);
481 else printk("Can't release memory to the host - memory hotplug won't "
482 "be supported\n");
483 return 0;
484}
485
486__initcall(mem_mc_init);
487
350#define CONFIG_BUF_SIZE 64 488#define CONFIG_BUF_SIZE 64
351 489
352static void mconsole_get_config(int (*get_config)(char *, char *, int, 490static void mconsole_get_config(int (*get_config)(char *, char *, int,
@@ -478,7 +616,7 @@ static void console_write(struct console *console, const char *string,
478 return; 616 return;
479 617
480 while(1){ 618 while(1){
481 n = min(len, ARRAY_SIZE(console_buf) - console_index); 619 n = min((size_t)len, ARRAY_SIZE(console_buf) - console_index);
482 strncpy(&console_buf[console_index], string, n); 620 strncpy(&console_buf[console_index], string, n);
483 console_index += n; 621 console_index += n;
484 string += n; 622 string += n;
@@ -762,7 +900,8 @@ static struct notifier_block panic_exit_notifier = {
762 900
763static int add_notifier(void) 901static int add_notifier(void)
764{ 902{
765 notifier_chain_register(&panic_notifier_list, &panic_exit_notifier); 903 atomic_notifier_chain_register(&panic_notifier_list,
904 &panic_exit_notifier);
766 return(0); 905 return(0);
767} 906}
768 907
diff --git a/arch/um/drivers/pcap_kern.c b/arch/um/drivers/pcap_kern.c
index 07c80f2156ef..466ff2c2f918 100644
--- a/arch/um/drivers/pcap_kern.c
+++ b/arch/um/drivers/pcap_kern.c
@@ -106,18 +106,7 @@ static struct transport pcap_transport = {
106static int register_pcap(void) 106static int register_pcap(void)
107{ 107{
108 register_transport(&pcap_transport); 108 register_transport(&pcap_transport);
109 return(1); 109 return 0;
110} 110}
111 111
112__initcall(register_pcap); 112__initcall(register_pcap);
113
114/*
115 * Overrides for Emacs so that we follow Linus's tabbing style.
116 * Emacs will notice this stuff at the end of the file and automatically
117 * adjust the settings for this buffer only. This must remain at the end
118 * of the file.
119 * ---------------------------------------------------------------------------
120 * Local variables:
121 * c-file-style: "linux"
122 * End:
123 */
diff --git a/arch/um/drivers/slip_kern.c b/arch/um/drivers/slip_kern.c
index a62f5ef445cf..163ee0d5f75e 100644
--- a/arch/um/drivers/slip_kern.c
+++ b/arch/um/drivers/slip_kern.c
@@ -93,18 +93,7 @@ static struct transport slip_transport = {
93static int register_slip(void) 93static int register_slip(void)
94{ 94{
95 register_transport(&slip_transport); 95 register_transport(&slip_transport);
96 return(1); 96 return 0;
97} 97}
98 98
99__initcall(register_slip); 99__initcall(register_slip);
100
101/*
102 * Overrides for Emacs so that we follow Linus's tabbing style.
103 * Emacs will notice this stuff at the end of the file and automatically
104 * adjust the settings for this buffer only. This must remain at the end
105 * of the file.
106 * ---------------------------------------------------------------------------
107 * Local variables:
108 * c-file-style: "linux"
109 * End:
110 */
diff --git a/arch/um/drivers/slirp_kern.c b/arch/um/drivers/slirp_kern.c
index 33d7982be5d3..95e50c943e14 100644
--- a/arch/um/drivers/slirp_kern.c
+++ b/arch/um/drivers/slirp_kern.c
@@ -77,7 +77,7 @@ static int slirp_setup(char *str, char **mac_out, void *data)
77 int i=0; 77 int i=0;
78 78
79 *init = ((struct slirp_init) 79 *init = ((struct slirp_init)
80 { argw : { { "slirp", NULL } } }); 80 { .argw = { { "slirp", NULL } } });
81 81
82 str = split_if_spec(str, mac_out, NULL); 82 str = split_if_spec(str, mac_out, NULL);
83 83
@@ -116,18 +116,7 @@ static struct transport slirp_transport = {
116static int register_slirp(void) 116static int register_slirp(void)
117{ 117{
118 register_transport(&slirp_transport); 118 register_transport(&slirp_transport);
119 return(1); 119 return 0;
120} 120}
121 121
122__initcall(register_slirp); 122__initcall(register_slirp);
123
124/*
125 * Overrides for Emacs so that we follow Linus's tabbing style.
126 * Emacs will notice this stuff at the end of the file and automatically
127 * adjust the settings for this buffer only. This must remain at the end
128 * of the file.
129 * ---------------------------------------------------------------------------
130 * Local variables:
131 * c-file-style: "linux"
132 * End:
133 */
diff --git a/arch/um/drivers/ubd_kern.c b/arch/um/drivers/ubd_kern.c
index fa617e0719ab..0897852b09a3 100644
--- a/arch/um/drivers/ubd_kern.c
+++ b/arch/um/drivers/ubd_kern.c
@@ -1,4 +1,4 @@
1/* 1/*
2 * Copyright (C) 2000 Jeff Dike (jdike@karaya.com) 2 * Copyright (C) 2000 Jeff Dike (jdike@karaya.com)
3 * Licensed under the GPL 3 * Licensed under the GPL
4 */ 4 */
@@ -71,7 +71,7 @@ struct io_thread_req {
71 int error; 71 int error;
72}; 72};
73 73
74extern int open_ubd_file(char *file, struct openflags *openflags, 74extern int open_ubd_file(char *file, struct openflags *openflags, int shared,
75 char **backing_file_out, int *bitmap_offset_out, 75 char **backing_file_out, int *bitmap_offset_out,
76 unsigned long *bitmap_len_out, int *data_offset_out, 76 unsigned long *bitmap_len_out, int *data_offset_out,
77 int *create_cow_out); 77 int *create_cow_out);
@@ -137,7 +137,7 @@ static int fake_major = MAJOR_NR;
137 137
138static struct gendisk *ubd_gendisk[MAX_DEV]; 138static struct gendisk *ubd_gendisk[MAX_DEV];
139static struct gendisk *fake_gendisk[MAX_DEV]; 139static struct gendisk *fake_gendisk[MAX_DEV];
140 140
141#ifdef CONFIG_BLK_DEV_UBD_SYNC 141#ifdef CONFIG_BLK_DEV_UBD_SYNC
142#define OPEN_FLAGS ((struct openflags) { .r = 1, .w = 1, .s = 1, .c = 0, \ 142#define OPEN_FLAGS ((struct openflags) { .r = 1, .w = 1, .s = 1, .c = 0, \
143 .cl = 1 }) 143 .cl = 1 })
@@ -168,6 +168,7 @@ struct ubd {
168 __u64 size; 168 __u64 size;
169 struct openflags boot_openflags; 169 struct openflags boot_openflags;
170 struct openflags openflags; 170 struct openflags openflags;
171 int shared;
171 int no_cow; 172 int no_cow;
172 struct cow cow; 173 struct cow cow;
173 struct platform_device pdev; 174 struct platform_device pdev;
@@ -189,6 +190,7 @@ struct ubd {
189 .boot_openflags = OPEN_FLAGS, \ 190 .boot_openflags = OPEN_FLAGS, \
190 .openflags = OPEN_FLAGS, \ 191 .openflags = OPEN_FLAGS, \
191 .no_cow = 0, \ 192 .no_cow = 0, \
193 .shared = 0, \
192 .cow = DEFAULT_COW, \ 194 .cow = DEFAULT_COW, \
193} 195}
194 196
@@ -305,7 +307,7 @@ static int ubd_setup_common(char *str, int *index_out)
305 } 307 }
306 major = simple_strtoul(str, &end, 0); 308 major = simple_strtoul(str, &end, 0);
307 if((*end != '\0') || (end == str)){ 309 if((*end != '\0') || (end == str)){
308 printk(KERN_ERR 310 printk(KERN_ERR
309 "ubd_setup : didn't parse major number\n"); 311 "ubd_setup : didn't parse major number\n");
310 return(1); 312 return(1);
311 } 313 }
@@ -316,7 +318,7 @@ static int ubd_setup_common(char *str, int *index_out)
316 printk(KERN_ERR "Can't assign a fake major twice\n"); 318 printk(KERN_ERR "Can't assign a fake major twice\n");
317 goto out1; 319 goto out1;
318 } 320 }
319 321
320 fake_major = major; 322 fake_major = major;
321 323
322 printk(KERN_INFO "Setting extra ubd major number to %d\n", 324 printk(KERN_INFO "Setting extra ubd major number to %d\n",
@@ -351,7 +353,7 @@ static int ubd_setup_common(char *str, int *index_out)
351 if (index_out) 353 if (index_out)
352 *index_out = n; 354 *index_out = n;
353 355
354 for (i = 0; i < 4; i++) { 356 for (i = 0; i < sizeof("rscd="); i++) {
355 switch (*str) { 357 switch (*str) {
356 case 'r': 358 case 'r':
357 flags.w = 0; 359 flags.w = 0;
@@ -362,11 +364,14 @@ static int ubd_setup_common(char *str, int *index_out)
362 case 'd': 364 case 'd':
363 dev->no_cow = 1; 365 dev->no_cow = 1;
364 break; 366 break;
367 case 'c':
368 dev->shared = 1;
369 break;
365 case '=': 370 case '=':
366 str++; 371 str++;
367 goto break_loop; 372 goto break_loop;
368 default: 373 default:
369 printk(KERN_ERR "ubd_setup : Expected '=' or flag letter (r,s or d)\n"); 374 printk(KERN_ERR "ubd_setup : Expected '=' or flag letter (r, s, c, or d)\n");
370 goto out; 375 goto out;
371 } 376 }
372 str++; 377 str++;
@@ -515,7 +520,7 @@ static void ubd_handler(void)
515 spin_unlock(&ubd_io_lock); 520 spin_unlock(&ubd_io_lock);
516 return; 521 return;
517 } 522 }
518 523
519 ubd_finish(rq, req.error); 524 ubd_finish(rq, req.error);
520 reactivate_fd(thread_fd, UBD_IRQ); 525 reactivate_fd(thread_fd, UBD_IRQ);
521 do_ubd_request(ubd_queue); 526 do_ubd_request(ubd_queue);
@@ -532,7 +537,7 @@ static int io_pid = -1;
532 537
533void kill_io_thread(void) 538void kill_io_thread(void)
534{ 539{
535 if(io_pid != -1) 540 if(io_pid != -1)
536 os_kill_process(io_pid, 1); 541 os_kill_process(io_pid, 1);
537} 542}
538 543
@@ -567,14 +572,15 @@ static int ubd_open_dev(struct ubd *dev)
567 create_cow = 0; 572 create_cow = 0;
568 create_ptr = (dev->cow.file != NULL) ? &create_cow : NULL; 573 create_ptr = (dev->cow.file != NULL) ? &create_cow : NULL;
569 back_ptr = dev->no_cow ? NULL : &dev->cow.file; 574 back_ptr = dev->no_cow ? NULL : &dev->cow.file;
570 dev->fd = open_ubd_file(dev->file, &dev->openflags, back_ptr, 575 dev->fd = open_ubd_file(dev->file, &dev->openflags, dev->shared,
571 &dev->cow.bitmap_offset, &dev->cow.bitmap_len, 576 back_ptr, &dev->cow.bitmap_offset,
572 &dev->cow.data_offset, create_ptr); 577 &dev->cow.bitmap_len, &dev->cow.data_offset,
578 create_ptr);
573 579
574 if((dev->fd == -ENOENT) && create_cow){ 580 if((dev->fd == -ENOENT) && create_cow){
575 dev->fd = create_cow_file(dev->file, dev->cow.file, 581 dev->fd = create_cow_file(dev->file, dev->cow.file,
576 dev->openflags, 1 << 9, PAGE_SIZE, 582 dev->openflags, 1 << 9, PAGE_SIZE,
577 &dev->cow.bitmap_offset, 583 &dev->cow.bitmap_offset,
578 &dev->cow.bitmap_len, 584 &dev->cow.bitmap_len,
579 &dev->cow.data_offset); 585 &dev->cow.data_offset);
580 if(dev->fd >= 0){ 586 if(dev->fd >= 0){
@@ -598,16 +604,16 @@ static int ubd_open_dev(struct ubd *dev)
598 } 604 }
599 flush_tlb_kernel_vm(); 605 flush_tlb_kernel_vm();
600 606
601 err = read_cow_bitmap(dev->fd, dev->cow.bitmap, 607 err = read_cow_bitmap(dev->fd, dev->cow.bitmap,
602 dev->cow.bitmap_offset, 608 dev->cow.bitmap_offset,
603 dev->cow.bitmap_len); 609 dev->cow.bitmap_len);
604 if(err < 0) 610 if(err < 0)
605 goto error; 611 goto error;
606 612
607 flags = dev->openflags; 613 flags = dev->openflags;
608 flags.w = 0; 614 flags.w = 0;
609 err = open_ubd_file(dev->cow.file, &flags, NULL, NULL, NULL, 615 err = open_ubd_file(dev->cow.file, &flags, dev->shared, NULL,
610 NULL, NULL); 616 NULL, NULL, NULL, NULL);
611 if(err < 0) goto error; 617 if(err < 0) goto error;
612 dev->cow.fd = err; 618 dev->cow.fd = err;
613 } 619 }
@@ -685,11 +691,11 @@ static int ubd_add(int n)
685 dev->size = ROUND_BLOCK(dev->size); 691 dev->size = ROUND_BLOCK(dev->size);
686 692
687 err = ubd_new_disk(MAJOR_NR, dev->size, n, &ubd_gendisk[n]); 693 err = ubd_new_disk(MAJOR_NR, dev->size, n, &ubd_gendisk[n]);
688 if(err) 694 if(err)
689 goto out_close; 695 goto out_close;
690 696
691 if(fake_major != MAJOR_NR) 697 if(fake_major != MAJOR_NR)
692 ubd_new_disk(fake_major, dev->size, n, 698 ubd_new_disk(fake_major, dev->size, n,
693 &fake_gendisk[n]); 699 &fake_gendisk[n]);
694 700
695 /* perhaps this should also be under the "if (fake_major)" above */ 701 /* perhaps this should also be under the "if (fake_major)" above */
@@ -854,7 +860,7 @@ int ubd_init(void)
854 return -1; 860 return -1;
855 } 861 }
856 platform_driver_register(&ubd_driver); 862 platform_driver_register(&ubd_driver);
857 for (i = 0; i < MAX_DEV; i++) 863 for (i = 0; i < MAX_DEV; i++)
858 ubd_add(i); 864 ubd_add(i);
859 return 0; 865 return 0;
860} 866}
@@ -872,20 +878,20 @@ int ubd_driver_init(void){
872 * enough. So use anyway the io thread. */ 878 * enough. So use anyway the io thread. */
873 } 879 }
874 stack = alloc_stack(0, 0); 880 stack = alloc_stack(0, 0);
875 io_pid = start_io_thread(stack + PAGE_SIZE - sizeof(void *), 881 io_pid = start_io_thread(stack + PAGE_SIZE - sizeof(void *),
876 &thread_fd); 882 &thread_fd);
877 if(io_pid < 0){ 883 if(io_pid < 0){
878 printk(KERN_ERR 884 printk(KERN_ERR
879 "ubd : Failed to start I/O thread (errno = %d) - " 885 "ubd : Failed to start I/O thread (errno = %d) - "
880 "falling back to synchronous I/O\n", -io_pid); 886 "falling back to synchronous I/O\n", -io_pid);
881 io_pid = -1; 887 io_pid = -1;
882 return(0); 888 return(0);
883 } 889 }
884 err = um_request_irq(UBD_IRQ, thread_fd, IRQ_READ, ubd_intr, 890 err = um_request_irq(UBD_IRQ, thread_fd, IRQ_READ, ubd_intr,
885 SA_INTERRUPT, "ubd", ubd_dev); 891 SA_INTERRUPT, "ubd", ubd_dev);
886 if(err != 0) 892 if(err != 0)
887 printk(KERN_ERR "um_request_irq failed - errno = %d\n", -err); 893 printk(KERN_ERR "um_request_irq failed - errno = %d\n", -err);
888 return(err); 894 return 0;
889} 895}
890 896
891device_initcall(ubd_driver_init); 897device_initcall(ubd_driver_init);
@@ -978,7 +984,7 @@ static void cowify_req(struct io_thread_req *req, unsigned long *bitmap,
978 if(req->op == UBD_READ) { 984 if(req->op == UBD_READ) {
979 for(i = 0; i < req->length >> 9; i++){ 985 for(i = 0; i < req->length >> 9; i++){
980 if(ubd_test_bit(sector + i, (unsigned char *) bitmap)) 986 if(ubd_test_bit(sector + i, (unsigned char *) bitmap))
981 ubd_set_bit(i, (unsigned char *) 987 ubd_set_bit(i, (unsigned char *)
982 &req->sector_mask); 988 &req->sector_mask);
983 } 989 }
984 } 990 }
@@ -999,7 +1005,7 @@ static int prepare_request(struct request *req, struct io_thread_req *io_req)
999 1005
1000 /* This should be impossible now */ 1006 /* This should be impossible now */
1001 if((rq_data_dir(req) == WRITE) && !dev->openflags.w){ 1007 if((rq_data_dir(req) == WRITE) && !dev->openflags.w){
1002 printk("Write attempted on readonly ubd device %s\n", 1008 printk("Write attempted on readonly ubd device %s\n",
1003 disk->disk_name); 1009 disk->disk_name);
1004 end_request(req, 0); 1010 end_request(req, 0);
1005 return(1); 1011 return(1);
@@ -1182,7 +1188,7 @@ int read_cow_bitmap(int fd, void *buf, int offset, int len)
1182 return(0); 1188 return(0);
1183} 1189}
1184 1190
1185int open_ubd_file(char *file, struct openflags *openflags, 1191int open_ubd_file(char *file, struct openflags *openflags, int shared,
1186 char **backing_file_out, int *bitmap_offset_out, 1192 char **backing_file_out, int *bitmap_offset_out,
1187 unsigned long *bitmap_len_out, int *data_offset_out, 1193 unsigned long *bitmap_len_out, int *data_offset_out,
1188 int *create_cow_out) 1194 int *create_cow_out)
@@ -1206,10 +1212,14 @@ int open_ubd_file(char *file, struct openflags *openflags,
1206 return fd; 1212 return fd;
1207 } 1213 }
1208 1214
1209 err = os_lock_file(fd, openflags->w); 1215 if(shared)
1210 if(err < 0){ 1216 printk("Not locking \"%s\" on the host\n", file);
1211 printk("Failed to lock '%s', err = %d\n", file, -err); 1217 else {
1212 goto out_close; 1218 err = os_lock_file(fd, openflags->w);
1219 if(err < 0){
1220 printk("Failed to lock '%s', err = %d\n", file, -err);
1221 goto out_close;
1222 }
1213 } 1223 }
1214 1224
1215 /* Succesful return case! */ 1225 /* Succesful return case! */
@@ -1260,7 +1270,7 @@ int create_cow_file(char *cow_file, char *backing_file, struct openflags flags,
1260 int err, fd; 1270 int err, fd;
1261 1271
1262 flags.c = 1; 1272 flags.c = 1;
1263 fd = open_ubd_file(cow_file, &flags, NULL, NULL, NULL, NULL, NULL); 1273 fd = open_ubd_file(cow_file, &flags, 0, NULL, NULL, NULL, NULL, NULL);
1264 if(fd < 0){ 1274 if(fd < 0){
1265 err = fd; 1275 err = fd;
1266 printk("Open of COW file '%s' failed, errno = %d\n", cow_file, 1276 printk("Open of COW file '%s' failed, errno = %d\n", cow_file,
diff --git a/arch/um/include/irq_user.h b/arch/um/include/irq_user.h
index b61deb8b362a..69a93c804f0e 100644
--- a/arch/um/include/irq_user.h
+++ b/arch/um/include/irq_user.h
@@ -1,4 +1,4 @@
1/* 1/*
2 * Copyright (C) 2001, 2002 Jeff Dike (jdike@karaya.com) 2 * Copyright (C) 2001, 2002 Jeff Dike (jdike@karaya.com)
3 * Licensed under the GPL 3 * Licensed under the GPL
4 */ 4 */
@@ -6,6 +6,17 @@
6#ifndef __IRQ_USER_H__ 6#ifndef __IRQ_USER_H__
7#define __IRQ_USER_H__ 7#define __IRQ_USER_H__
8 8
9struct irq_fd {
10 struct irq_fd *next;
11 void *id;
12 int fd;
13 int type;
14 int irq;
15 int pid;
16 int events;
17 int current_events;
18};
19
9enum { IRQ_READ, IRQ_WRITE }; 20enum { IRQ_READ, IRQ_WRITE };
10 21
11extern void sigio_handler(int sig, union uml_pt_regs *regs); 22extern void sigio_handler(int sig, union uml_pt_regs *regs);
@@ -16,8 +27,6 @@ extern void reactivate_fd(int fd, int irqnum);
16extern void deactivate_fd(int fd, int irqnum); 27extern void deactivate_fd(int fd, int irqnum);
17extern int deactivate_all_fds(void); 28extern int deactivate_all_fds(void);
18extern void forward_interrupts(int pid); 29extern void forward_interrupts(int pid);
19extern void init_irq_signals(int on_sigstack);
20extern void forward_ipi(int fd, int pid);
21extern int activate_ipi(int fd, int pid); 30extern int activate_ipi(int fd, int pid);
22extern unsigned long irq_lock(void); 31extern unsigned long irq_lock(void);
23extern void irq_unlock(unsigned long flags); 32extern void irq_unlock(unsigned long flags);
diff --git a/arch/um/include/kern.h b/arch/um/include/kern.h
index 7d223beccbc0..4ce3fc650e57 100644
--- a/arch/um/include/kern.h
+++ b/arch/um/include/kern.h
@@ -29,7 +29,7 @@ extern int getuid(void);
29extern int getgid(void); 29extern int getgid(void);
30extern int pause(void); 30extern int pause(void);
31extern int write(int, const void *, int); 31extern int write(int, const void *, int);
32extern int exit(int); 32extern void exit(int);
33extern int close(int); 33extern int close(int);
34extern int read(unsigned int, char *, int); 34extern int read(unsigned int, char *, int);
35extern int pipe(int *); 35extern int pipe(int *);
diff --git a/arch/um/include/kern_util.h b/arch/um/include/kern_util.h
index 07176d92e1c9..42557130a408 100644
--- a/arch/um/include/kern_util.h
+++ b/arch/um/include/kern_util.h
@@ -116,7 +116,11 @@ extern void *get_current(void);
116extern struct task_struct *get_task(int pid, int require); 116extern struct task_struct *get_task(int pid, int require);
117extern void machine_halt(void); 117extern void machine_halt(void);
118extern int is_syscall(unsigned long addr); 118extern int is_syscall(unsigned long addr);
119extern void arch_switch(void); 119
120extern void arch_switch_to_tt(struct task_struct *from, struct task_struct *to);
121
122extern void arch_switch_to_skas(struct task_struct *from, struct task_struct *to);
123
120extern void free_irq(unsigned int, void *); 124extern void free_irq(unsigned int, void *);
121extern int cpu(void); 125extern int cpu(void);
122 126
diff --git a/arch/um/include/line.h b/arch/um/include/line.h
index 6f4d680dc1d4..6ac0f8252e21 100644
--- a/arch/um/include/line.h
+++ b/arch/um/include/line.h
@@ -58,23 +58,17 @@ struct line {
58}; 58};
59 59
60#define LINE_INIT(str, d) \ 60#define LINE_INIT(str, d) \
61 { init_str : str, \ 61 { .init_str = str, \
62 init_pri : INIT_STATIC, \ 62 .init_pri = INIT_STATIC, \
63 valid : 1, \ 63 .valid = 1, \
64 throttled : 0, \ 64 .lock = SPIN_LOCK_UNLOCKED, \
65 lock : SPIN_LOCK_UNLOCKED, \ 65 .driver = d }
66 buffer : NULL, \
67 head : NULL, \
68 tail : NULL, \
69 sigio : 0, \
70 driver : d, \
71 have_irq : 0 }
72 66
73struct lines { 67struct lines {
74 int num; 68 int num;
75}; 69};
76 70
77#define LINES_INIT(n) { num : n } 71#define LINES_INIT(n) { .num = n }
78 72
79extern void line_close(struct tty_struct *tty, struct file * filp); 73extern void line_close(struct tty_struct *tty, struct file * filp);
80extern int line_open(struct line *lines, struct tty_struct *tty); 74extern int line_open(struct line *lines, struct tty_struct *tty);
diff --git a/arch/um/include/mem_user.h b/arch/um/include/mem_user.h
index a1064c5823bf..a54514d2cc3a 100644
--- a/arch/um/include/mem_user.h
+++ b/arch/um/include/mem_user.h
@@ -49,7 +49,6 @@ extern int iomem_size;
49extern unsigned long host_task_size; 49extern unsigned long host_task_size;
50extern unsigned long task_size; 50extern unsigned long task_size;
51 51
52extern void check_devanon(void);
53extern int init_mem_user(void); 52extern int init_mem_user(void);
54extern void setup_memory(void *entry); 53extern void setup_memory(void *entry);
55extern unsigned long find_iomem(char *driver, unsigned long *len_out); 54extern unsigned long find_iomem(char *driver, unsigned long *len_out);
diff --git a/arch/um/include/misc_constants.h b/arch/um/include/misc_constants.h
new file mode 100644
index 000000000000..989bc08de36e
--- /dev/null
+++ b/arch/um/include/misc_constants.h
@@ -0,0 +1,6 @@
1#ifndef __MISC_CONSTANT_H_
2#define __MISC_CONSTANT_H_
3
4#include <user_constants.h>
5
6#endif
diff --git a/arch/um/include/os.h b/arch/um/include/os.h
index 2a1c64d8d0bf..f88856c28a66 100644
--- a/arch/um/include/os.h
+++ b/arch/um/include/os.h
@@ -12,6 +12,8 @@
12#include "sysdep/ptrace.h" 12#include "sysdep/ptrace.h"
13#include "kern_util.h" 13#include "kern_util.h"
14#include "skas/mm_id.h" 14#include "skas/mm_id.h"
15#include "irq_user.h"
16#include "sysdep/tls.h"
15 17
16#define OS_TYPE_FILE 1 18#define OS_TYPE_FILE 1
17#define OS_TYPE_DIR 2 19#define OS_TYPE_DIR 2
@@ -121,6 +123,7 @@ static inline struct openflags of_cloexec(struct openflags flags)
121 return(flags); 123 return(flags);
122} 124}
123 125
126/* file.c */
124extern int os_stat_file(const char *file_name, struct uml_stat *buf); 127extern int os_stat_file(const char *file_name, struct uml_stat *buf);
125extern int os_stat_fd(const int fd, struct uml_stat *buf); 128extern int os_stat_fd(const int fd, struct uml_stat *buf);
126extern int os_access(const char *file, int mode); 129extern int os_access(const char *file, int mode);
@@ -156,10 +159,21 @@ extern int os_connect_socket(char *name);
156extern int os_file_type(char *file); 159extern int os_file_type(char *file);
157extern int os_file_mode(char *file, struct openflags *mode_out); 160extern int os_file_mode(char *file, struct openflags *mode_out);
158extern int os_lock_file(int fd, int excl); 161extern int os_lock_file(int fd, int excl);
162extern void os_flush_stdout(void);
163extern int os_stat_filesystem(char *path, long *bsize_out,
164 long long *blocks_out, long long *bfree_out,
165 long long *bavail_out, long long *files_out,
166 long long *ffree_out, void *fsid_out,
167 int fsid_size, long *namelen_out,
168 long *spare_out);
169extern int os_change_dir(char *dir);
170extern int os_fchange_dir(int fd);
159 171
160/* start_up.c */ 172/* start_up.c */
161extern void os_early_checks(void); 173extern void os_early_checks(void);
162extern int can_do_skas(void); 174extern int can_do_skas(void);
175extern void os_check_bugs(void);
176extern void check_host_supports_tls(int *supports_tls, int *tls_min);
163 177
164/* Make sure they are clear when running in TT mode. Required by 178/* Make sure they are clear when running in TT mode. Required by
165 * SEGV_MAYBE_FIXABLE */ 179 * SEGV_MAYBE_FIXABLE */
@@ -193,11 +207,15 @@ extern int os_map_memory(void *virt, int fd, unsigned long long off,
193extern int os_protect_memory(void *addr, unsigned long len, 207extern int os_protect_memory(void *addr, unsigned long len,
194 int r, int w, int x); 208 int r, int w, int x);
195extern int os_unmap_memory(void *addr, int len); 209extern int os_unmap_memory(void *addr, int len);
210extern int os_drop_memory(void *addr, int length);
211extern int can_drop_memory(void);
196extern void os_flush_stdout(void); 212extern void os_flush_stdout(void);
197 213
198/* tt.c 214/* tt.c
199 * for tt mode only (will be deleted in future...) 215 * for tt mode only (will be deleted in future...)
200 */ 216 */
217extern void forward_ipi(int fd, int pid);
218extern void kill_child_dead(int pid);
201extern void stop(void); 219extern void stop(void);
202extern int wait_for_stop(int pid, int sig, int cont_type, void *relay); 220extern int wait_for_stop(int pid, int sig, int cont_type, void *relay);
203extern int protect_memory(unsigned long addr, unsigned long len, 221extern int protect_memory(unsigned long addr, unsigned long len,
@@ -220,8 +238,12 @@ extern int run_helper_thread(int (*proc)(void *), void *arg,
220 int stack_order); 238 int stack_order);
221extern int helper_wait(int pid); 239extern int helper_wait(int pid);
222 240
223/* umid.c */
224 241
242/* tls.c */
243extern int os_set_thread_area(user_desc_t *info, int pid);
244extern int os_get_thread_area(user_desc_t *info, int pid);
245
246/* umid.c */
225extern int umid_file_name(char *name, char *buf, int len); 247extern int umid_file_name(char *name, char *buf, int len);
226extern int set_umid(char *name); 248extern int set_umid(char *name);
227extern char *get_umid(void); 249extern char *get_umid(void);
@@ -294,4 +316,26 @@ extern void initial_thread_cb_skas(void (*proc)(void *),
294extern void halt_skas(void); 316extern void halt_skas(void);
295extern void reboot_skas(void); 317extern void reboot_skas(void);
296 318
319/* irq.c */
320extern int os_waiting_for_events(struct irq_fd *active_fds);
321extern int os_isatty(int fd);
322extern int os_create_pollfd(int fd, int events, void *tmp_pfd, int size_tmpfds);
323extern void os_free_irq_by_cb(int (*test)(struct irq_fd *, void *), void *arg,
324 struct irq_fd *active_fds, struct irq_fd ***last_irq_ptr2);
325extern void os_free_irq_later(struct irq_fd *active_fds,
326 int irq, void *dev_id);
327extern int os_get_pollfd(int i);
328extern void os_set_pollfd(int i, int fd);
329extern void os_set_ioignore(void);
330extern void init_irq_signals(int on_sigstack);
331
332/* sigio.c */
333extern void write_sigio_workaround(void);
334extern int add_sigio_fd(int fd, int read);
335extern int ignore_sigio_fd(int fd);
336
337/* skas/trap */
338extern void sig_handler_common_skas(int sig, void *sc_ptr);
339extern void user_signal(int sig, union uml_pt_regs *regs, int pid);
340
297#endif 341#endif
diff --git a/arch/um/include/sigio.h b/arch/um/include/sigio.h
index 37d76e29a147..fe99ea163c2e 100644
--- a/arch/um/include/sigio.h
+++ b/arch/um/include/sigio.h
@@ -8,9 +8,6 @@
8 8
9extern int write_sigio_irq(int fd); 9extern int write_sigio_irq(int fd);
10extern int register_sigio_fd(int fd); 10extern int register_sigio_fd(int fd);
11extern int read_sigio_fd(int fd);
12extern int add_sigio_fd(int fd, int read);
13extern int ignore_sigio_fd(int fd);
14extern void sigio_lock(void); 11extern void sigio_lock(void);
15extern void sigio_unlock(void); 12extern void sigio_unlock(void);
16 13
diff --git a/arch/um/include/skas/mode-skas.h b/arch/um/include/skas/mode-skas.h
index 260065cfeef1..8bc6916bbbb1 100644
--- a/arch/um/include/skas/mode-skas.h
+++ b/arch/um/include/skas/mode-skas.h
@@ -13,7 +13,6 @@ extern unsigned long exec_fp_regs[];
13extern unsigned long exec_fpx_regs[]; 13extern unsigned long exec_fpx_regs[];
14extern int have_fpx_regs; 14extern int have_fpx_regs;
15 15
16extern void sig_handler_common_skas(int sig, void *sc_ptr);
17extern void kill_off_processes_skas(void); 16extern void kill_off_processes_skas(void);
18 17
19#endif 18#endif
diff --git a/arch/um/include/skas/skas.h b/arch/um/include/skas/skas.h
index 86357282d681..853b26f148c5 100644
--- a/arch/um/include/skas/skas.h
+++ b/arch/um/include/skas/skas.h
@@ -17,7 +17,6 @@ extern int user_thread(unsigned long stack, int flags);
17extern void new_thread_proc(void *stack, void (*handler)(int sig)); 17extern void new_thread_proc(void *stack, void (*handler)(int sig));
18extern void new_thread_handler(int sig); 18extern void new_thread_handler(int sig);
19extern void handle_syscall(union uml_pt_regs *regs); 19extern void handle_syscall(union uml_pt_regs *regs);
20extern void user_signal(int sig, union uml_pt_regs *regs, int pid);
21extern int new_mm(unsigned long stack); 20extern int new_mm(unsigned long stack);
22extern void get_skas_faultinfo(int pid, struct faultinfo * fi); 21extern void get_skas_faultinfo(int pid, struct faultinfo * fi);
23extern long execute_syscall_skas(void *r); 22extern long execute_syscall_skas(void *r);
diff --git a/arch/um/include/sysdep-i386/checksum.h b/arch/um/include/sysdep-i386/checksum.h
index 7d3d202d7fff..052bb061a978 100644
--- a/arch/um/include/sysdep-i386/checksum.h
+++ b/arch/um/include/sysdep-i386/checksum.h
@@ -48,7 +48,8 @@ unsigned int csum_partial_copy_nocheck(const unsigned char *src, unsigned char *
48 */ 48 */
49 49
50static __inline__ 50static __inline__
51unsigned int csum_partial_copy_from_user(const unsigned char *src, unsigned char *dst, 51unsigned int csum_partial_copy_from_user(const unsigned char __user *src,
52 unsigned char *dst,
52 int len, int sum, int *err_ptr) 53 int len, int sum, int *err_ptr)
53{ 54{
54 if(copy_from_user(dst, src, len)){ 55 if(copy_from_user(dst, src, len)){
@@ -192,7 +193,7 @@ static __inline__ unsigned short int csum_ipv6_magic(struct in6_addr *saddr,
192 */ 193 */
193#define HAVE_CSUM_COPY_USER 194#define HAVE_CSUM_COPY_USER
194static __inline__ unsigned int csum_and_copy_to_user(const unsigned char *src, 195static __inline__ unsigned int csum_and_copy_to_user(const unsigned char *src,
195 unsigned char *dst, 196 unsigned char __user *dst,
196 int len, int sum, int *err_ptr) 197 int len, int sum, int *err_ptr)
197{ 198{
198 if (access_ok(VERIFY_WRITE, dst, len)){ 199 if (access_ok(VERIFY_WRITE, dst, len)){
diff --git a/arch/um/include/sysdep-i386/ptrace.h b/arch/um/include/sysdep-i386/ptrace.h
index c8ee9559f3ab..6670cc992ecb 100644
--- a/arch/um/include/sysdep-i386/ptrace.h
+++ b/arch/um/include/sysdep-i386/ptrace.h
@@ -14,7 +14,12 @@
14#define MAX_REG_NR (UM_FRAME_SIZE / sizeof(unsigned long)) 14#define MAX_REG_NR (UM_FRAME_SIZE / sizeof(unsigned long))
15#define MAX_REG_OFFSET (UM_FRAME_SIZE) 15#define MAX_REG_OFFSET (UM_FRAME_SIZE)
16 16
17#ifdef UML_CONFIG_PT_PROXY
17extern void update_debugregs(int seq); 18extern void update_debugregs(int seq);
19#else
20static inline void update_debugregs(int seq) {}
21#endif
22
18 23
19/* syscall emulation path in ptrace */ 24/* syscall emulation path in ptrace */
20 25
diff --git a/arch/um/include/sysdep-i386/tls.h b/arch/um/include/sysdep-i386/tls.h
new file mode 100644
index 000000000000..918fd3c5ff9c
--- /dev/null
+++ b/arch/um/include/sysdep-i386/tls.h
@@ -0,0 +1,32 @@
1#ifndef _SYSDEP_TLS_H
2#define _SYSDEP_TLS_H
3
4# ifndef __KERNEL__
5
6/* Change name to avoid conflicts with the original one from <asm/ldt.h>, which
7 * may be named user_desc (but in 2.4 and in header matching its API was named
8 * modify_ldt_ldt_s). */
9
10typedef struct um_dup_user_desc {
11 unsigned int entry_number;
12 unsigned int base_addr;
13 unsigned int limit;
14 unsigned int seg_32bit:1;
15 unsigned int contents:2;
16 unsigned int read_exec_only:1;
17 unsigned int limit_in_pages:1;
18 unsigned int seg_not_present:1;
19 unsigned int useable:1;
20} user_desc_t;
21
22# else /* __KERNEL__ */
23
24# include <asm/ldt.h>
25typedef struct user_desc user_desc_t;
26
27# endif /* __KERNEL__ */
28
29#define GDT_ENTRY_TLS_MIN_I386 6
30#define GDT_ENTRY_TLS_MIN_X86_64 12
31
32#endif /* _SYSDEP_TLS_H */
diff --git a/arch/um/include/sysdep-x86_64/tls.h b/arch/um/include/sysdep-x86_64/tls.h
new file mode 100644
index 000000000000..35f19f25bd3b
--- /dev/null
+++ b/arch/um/include/sysdep-x86_64/tls.h
@@ -0,0 +1,29 @@
1#ifndef _SYSDEP_TLS_H
2#define _SYSDEP_TLS_H
3
4# ifndef __KERNEL__
5
6/* Change name to avoid conflicts with the original one from <asm/ldt.h>, which
7 * may be named user_desc (but in 2.4 and in header matching its API was named
8 * modify_ldt_ldt_s). */
9
10typedef struct um_dup_user_desc {
11 unsigned int entry_number;
12 unsigned int base_addr;
13 unsigned int limit;
14 unsigned int seg_32bit:1;
15 unsigned int contents:2;
16 unsigned int read_exec_only:1;
17 unsigned int limit_in_pages:1;
18 unsigned int seg_not_present:1;
19 unsigned int useable:1;
20 unsigned int lm:1;
21} user_desc_t;
22
23# else /* __KERNEL__ */
24
25# include <asm/ldt.h>
26typedef struct user_desc user_desc_t;
27
28# endif /* __KERNEL__ */
29#endif /* _SYSDEP_TLS_H */
diff --git a/arch/um/include/user_util.h b/arch/um/include/user_util.h
index a6f1f176cf84..fe0c29b5144d 100644
--- a/arch/um/include/user_util.h
+++ b/arch/um/include/user_util.h
@@ -8,6 +8,9 @@
8 8
9#include "sysdep/ptrace.h" 9#include "sysdep/ptrace.h"
10 10
11/* Copied from kernel.h */
12#define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0]))
13
11#define CATCH_EINTR(expr) while ((errno = 0, ((expr) < 0)) && (errno == EINTR)) 14#define CATCH_EINTR(expr) while ((errno = 0, ((expr) < 0)) && (errno == EINTR))
12 15
13extern int mode_tt; 16extern int mode_tt;
@@ -31,7 +34,7 @@ extern unsigned long uml_physmem;
31extern unsigned long uml_reserved; 34extern unsigned long uml_reserved;
32extern unsigned long end_vm; 35extern unsigned long end_vm;
33extern unsigned long start_vm; 36extern unsigned long start_vm;
34extern unsigned long highmem; 37extern unsigned long long highmem;
35 38
36extern char host_info[]; 39extern char host_info[];
37 40
@@ -58,7 +61,6 @@ extern int attach(int pid);
58extern void kill_child_dead(int pid); 61extern void kill_child_dead(int pid);
59extern int cont(int pid); 62extern int cont(int pid);
60extern void check_sigio(void); 63extern void check_sigio(void);
61extern void write_sigio_workaround(void);
62extern void arch_check_bugs(void); 64extern void arch_check_bugs(void);
63extern int cpu_feature(char *what, char *buf, int len); 65extern int cpu_feature(char *what, char *buf, int len);
64extern int arch_handle_signal(int sig, union uml_pt_regs *regs); 66extern int arch_handle_signal(int sig, union uml_pt_regs *regs);
diff --git a/arch/um/kernel/Makefile b/arch/um/kernel/Makefile
index 693018ba80f1..fe08971b64cf 100644
--- a/arch/um/kernel/Makefile
+++ b/arch/um/kernel/Makefile
@@ -7,23 +7,20 @@ extra-y := vmlinux.lds
7clean-files := 7clean-files :=
8 8
9obj-y = config.o exec_kern.o exitcode.o \ 9obj-y = config.o exec_kern.o exitcode.o \
10 init_task.o irq.o irq_user.o ksyms.o mem.o physmem.o \ 10 init_task.o irq.o ksyms.o mem.o physmem.o \
11 process_kern.o ptrace.o reboot.o resource.o sigio_user.o sigio_kern.o \ 11 process_kern.o ptrace.o reboot.o resource.o sigio_kern.o \
12 signal_kern.o smp.o syscall_kern.o sysrq.o \ 12 signal_kern.o smp.o syscall_kern.o sysrq.o \
13 time_kern.o tlb.o trap_kern.o uaccess.o um_arch.o umid.o 13 time_kern.o tlb.o trap_kern.o uaccess.o um_arch.o umid.o
14 14
15obj-$(CONFIG_BLK_DEV_INITRD) += initrd.o 15obj-$(CONFIG_BLK_DEV_INITRD) += initrd.o
16obj-$(CONFIG_GPROF) += gprof_syms.o 16obj-$(CONFIG_GPROF) += gprof_syms.o
17obj-$(CONFIG_GCOV) += gmon_syms.o 17obj-$(CONFIG_GCOV) += gmon_syms.o
18obj-$(CONFIG_TTY_LOG) += tty_log.o
19obj-$(CONFIG_SYSCALL_DEBUG) += syscall.o 18obj-$(CONFIG_SYSCALL_DEBUG) += syscall.o
20 19
21obj-$(CONFIG_MODE_TT) += tt/ 20obj-$(CONFIG_MODE_TT) += tt/
22obj-$(CONFIG_MODE_SKAS) += skas/ 21obj-$(CONFIG_MODE_SKAS) += skas/
23 22
24user-objs-$(CONFIG_TTY_LOG) += tty_log.o 23USER_OBJS := config.o
25
26USER_OBJS := $(user-objs-y) config.o tty_log.o
27 24
28include arch/um/scripts/Makefile.rules 25include arch/um/scripts/Makefile.rules
29 26
diff --git a/arch/um/kernel/exec_kern.c b/arch/um/kernel/exec_kern.c
index c264e1c05ab3..c0cb627bf594 100644
--- a/arch/um/kernel/exec_kern.c
+++ b/arch/um/kernel/exec_kern.c
@@ -22,6 +22,7 @@
22 22
23void flush_thread(void) 23void flush_thread(void)
24{ 24{
25 arch_flush_thread(&current->thread.arch);
25 CHOOSE_MODE(flush_thread_tt(), flush_thread_skas()); 26 CHOOSE_MODE(flush_thread_tt(), flush_thread_skas());
26} 27}
27 28
@@ -30,8 +31,6 @@ void start_thread(struct pt_regs *regs, unsigned long eip, unsigned long esp)
30 CHOOSE_MODE_PROC(start_thread_tt, start_thread_skas, regs, eip, esp); 31 CHOOSE_MODE_PROC(start_thread_tt, start_thread_skas, regs, eip, esp);
31} 32}
32 33
33extern void log_exec(char **argv, void *tty);
34
35static long execve1(char *file, char __user * __user *argv, 34static long execve1(char *file, char __user * __user *argv,
36 char __user *__user *env) 35 char __user *__user *env)
37{ 36{
@@ -60,14 +59,14 @@ long um_execve(char *file, char __user *__user *argv, char __user *__user *env)
60 return(err); 59 return(err);
61} 60}
62 61
63long sys_execve(char *file, char __user *__user *argv, 62long sys_execve(char __user *file, char __user *__user *argv,
64 char __user *__user *env) 63 char __user *__user *env)
65{ 64{
66 long error; 65 long error;
67 char *filename; 66 char *filename;
68 67
69 lock_kernel(); 68 lock_kernel();
70 filename = getname((char __user *) file); 69 filename = getname(file);
71 error = PTR_ERR(filename); 70 error = PTR_ERR(filename);
72 if (IS_ERR(filename)) goto out; 71 if (IS_ERR(filename)) goto out;
73 error = execve1(filename, argv, env); 72 error = execve1(filename, argv, env);
@@ -76,14 +75,3 @@ long sys_execve(char *file, char __user *__user *argv,
76 unlock_kernel(); 75 unlock_kernel();
77 return(error); 76 return(error);
78} 77}
79
80/*
81 * Overrides for Emacs so that we follow Linus's tabbing style.
82 * Emacs will notice this stuff at the end of the file and automatically
83 * adjust the settings for this buffer only. This must remain at the end
84 * of the file.
85 * ---------------------------------------------------------------------------
86 * Local variables:
87 * c-file-style: "linux"
88 * End:
89 */
diff --git a/arch/um/kernel/irq.c b/arch/um/kernel/irq.c
index bbf94bf2921e..c39ea3abeda4 100644
--- a/arch/um/kernel/irq.c
+++ b/arch/um/kernel/irq.c
@@ -31,6 +31,8 @@
31#include "irq_user.h" 31#include "irq_user.h"
32#include "irq_kern.h" 32#include "irq_kern.h"
33#include "os.h" 33#include "os.h"
34#include "sigio.h"
35#include "misc_constants.h"
34 36
35/* 37/*
36 * Generic, controller-independent functions: 38 * Generic, controller-independent functions:
@@ -77,6 +79,298 @@ skip:
77 return 0; 79 return 0;
78} 80}
79 81
82struct irq_fd *active_fds = NULL;
83static struct irq_fd **last_irq_ptr = &active_fds;
84
85extern void free_irqs(void);
86
87void sigio_handler(int sig, union uml_pt_regs *regs)
88{
89 struct irq_fd *irq_fd;
90 int n;
91
92 if(smp_sigio_handler()) return;
93 while(1){
94 n = os_waiting_for_events(active_fds);
95 if (n <= 0) {
96 if(n == -EINTR) continue;
97 else break;
98 }
99
100 for(irq_fd = active_fds; irq_fd != NULL; irq_fd = irq_fd->next){
101 if(irq_fd->current_events != 0){
102 irq_fd->current_events = 0;
103 do_IRQ(irq_fd->irq, regs);
104 }
105 }
106 }
107
108 free_irqs();
109}
110
111static void maybe_sigio_broken(int fd, int type)
112{
113 if(os_isatty(fd)){
114 if((type == IRQ_WRITE) && !pty_output_sigio){
115 write_sigio_workaround();
116 add_sigio_fd(fd, 0);
117 }
118 else if((type == IRQ_READ) && !pty_close_sigio){
119 write_sigio_workaround();
120 add_sigio_fd(fd, 1);
121 }
122 }
123}
124
125
126int activate_fd(int irq, int fd, int type, void *dev_id)
127{
128 struct pollfd *tmp_pfd;
129 struct irq_fd *new_fd, *irq_fd;
130 unsigned long flags;
131 int pid, events, err, n;
132
133 pid = os_getpid();
134 err = os_set_fd_async(fd, pid);
135 if(err < 0)
136 goto out;
137
138 new_fd = um_kmalloc(sizeof(*new_fd));
139 err = -ENOMEM;
140 if(new_fd == NULL)
141 goto out;
142
143 if(type == IRQ_READ) events = UM_POLLIN | UM_POLLPRI;
144 else events = UM_POLLOUT;
145 *new_fd = ((struct irq_fd) { .next = NULL,
146 .id = dev_id,
147 .fd = fd,
148 .type = type,
149 .irq = irq,
150 .pid = pid,
151 .events = events,
152 .current_events = 0 } );
153
154 /* Critical section - locked by a spinlock because this stuff can
155 * be changed from interrupt handlers. The stuff above is done
156 * outside the lock because it allocates memory.
157 */
158
159 /* Actually, it only looks like it can be called from interrupt
160 * context. The culprit is reactivate_fd, which calls
161 * maybe_sigio_broken, which calls write_sigio_workaround,
162 * which calls activate_fd. However, write_sigio_workaround should
163 * only be called once, at boot time. That would make it clear that
164 * this is called only from process context, and can be locked with
165 * a semaphore.
166 */
167 flags = irq_lock();
168 for(irq_fd = active_fds; irq_fd != NULL; irq_fd = irq_fd->next){
169 if((irq_fd->fd == fd) && (irq_fd->type == type)){
170 printk("Registering fd %d twice\n", fd);
171 printk("Irqs : %d, %d\n", irq_fd->irq, irq);
172 printk("Ids : 0x%p, 0x%p\n", irq_fd->id, dev_id);
173 goto out_unlock;
174 }
175 }
176
177 /*-------------*/
178 if(type == IRQ_WRITE)
179 fd = -1;
180
181 tmp_pfd = NULL;
182 n = 0;
183
184 while(1){
185 n = os_create_pollfd(fd, events, tmp_pfd, n);
186 if (n == 0)
187 break;
188
189 /* n > 0
190 * It means we couldn't put new pollfd to current pollfds
191 * and tmp_fds is NULL or too small for new pollfds array.
192 * Needed size is equal to n as minimum.
193 *
194 * Here we have to drop the lock in order to call
195 * kmalloc, which might sleep.
196 * If something else came in and changed the pollfds array
197 * so we will not be able to put new pollfd struct to pollfds
198 * then we free the buffer tmp_fds and try again.
199 */
200 irq_unlock(flags);
201 if (tmp_pfd != NULL) {
202 kfree(tmp_pfd);
203 tmp_pfd = NULL;
204 }
205
206 tmp_pfd = um_kmalloc(n);
207 if (tmp_pfd == NULL)
208 goto out_kfree;
209
210 flags = irq_lock();
211 }
212 /*-------------*/
213
214 *last_irq_ptr = new_fd;
215 last_irq_ptr = &new_fd->next;
216
217 irq_unlock(flags);
218
219 /* This calls activate_fd, so it has to be outside the critical
220 * section.
221 */
222 maybe_sigio_broken(fd, type);
223
224 return(0);
225
226 out_unlock:
227 irq_unlock(flags);
228 out_kfree:
229 kfree(new_fd);
230 out:
231 return(err);
232}
233
234static void free_irq_by_cb(int (*test)(struct irq_fd *, void *), void *arg)
235{
236 unsigned long flags;
237
238 flags = irq_lock();
239 os_free_irq_by_cb(test, arg, active_fds, &last_irq_ptr);
240 irq_unlock(flags);
241}
242
243struct irq_and_dev {
244 int irq;
245 void *dev;
246};
247
248static int same_irq_and_dev(struct irq_fd *irq, void *d)
249{
250 struct irq_and_dev *data = d;
251
252 return((irq->irq == data->irq) && (irq->id == data->dev));
253}
254
255void free_irq_by_irq_and_dev(unsigned int irq, void *dev)
256{
257 struct irq_and_dev data = ((struct irq_and_dev) { .irq = irq,
258 .dev = dev });
259
260 free_irq_by_cb(same_irq_and_dev, &data);
261}
262
263static int same_fd(struct irq_fd *irq, void *fd)
264{
265 return(irq->fd == *((int *) fd));
266}
267
268void free_irq_by_fd(int fd)
269{
270 free_irq_by_cb(same_fd, &fd);
271}
272
273static struct irq_fd *find_irq_by_fd(int fd, int irqnum, int *index_out)
274{
275 struct irq_fd *irq;
276 int i = 0;
277 int fdi;
278
279 for(irq=active_fds; irq != NULL; irq = irq->next){
280 if((irq->fd == fd) && (irq->irq == irqnum)) break;
281 i++;
282 }
283 if(irq == NULL){
284 printk("find_irq_by_fd doesn't have descriptor %d\n", fd);
285 goto out;
286 }
287 fdi = os_get_pollfd(i);
288 if((fdi != -1) && (fdi != fd)){
289 printk("find_irq_by_fd - mismatch between active_fds and "
290 "pollfds, fd %d vs %d, need %d\n", irq->fd,
291 fdi, fd);
292 irq = NULL;
293 goto out;
294 }
295 *index_out = i;
296 out:
297 return(irq);
298}
299
300void reactivate_fd(int fd, int irqnum)
301{
302 struct irq_fd *irq;
303 unsigned long flags;
304 int i;
305
306 flags = irq_lock();
307 irq = find_irq_by_fd(fd, irqnum, &i);
308 if(irq == NULL){
309 irq_unlock(flags);
310 return;
311 }
312 os_set_pollfd(i, irq->fd);
313 irq_unlock(flags);
314
315 /* This calls activate_fd, so it has to be outside the critical
316 * section.
317 */
318 maybe_sigio_broken(fd, irq->type);
319}
320
321void deactivate_fd(int fd, int irqnum)
322{
323 struct irq_fd *irq;
324 unsigned long flags;
325 int i;
326
327 flags = irq_lock();
328 irq = find_irq_by_fd(fd, irqnum, &i);
329 if(irq == NULL)
330 goto out;
331 os_set_pollfd(i, -1);
332 out:
333 irq_unlock(flags);
334}
335
336int deactivate_all_fds(void)
337{
338 struct irq_fd *irq;
339 int err;
340
341 for(irq=active_fds;irq != NULL;irq = irq->next){
342 err = os_clear_fd_async(irq->fd);
343 if(err)
344 return(err);
345 }
346 /* If there is a signal already queued, after unblocking ignore it */
347 os_set_ioignore();
348
349 return(0);
350}
351
352void forward_interrupts(int pid)
353{
354 struct irq_fd *irq;
355 unsigned long flags;
356 int err;
357
358 flags = irq_lock();
359 for(irq=active_fds;irq != NULL;irq = irq->next){
360 err = os_set_owner(irq->fd, pid);
361 if(err < 0){
362 /* XXX Just remove the irq rather than
363 * print out an infinite stream of these
364 */
365 printk("Failed to forward %d to pid %d, err = %d\n",
366 irq->fd, pid, -err);
367 }
368
369 irq->pid = pid;
370 }
371 irq_unlock(flags);
372}
373
80/* 374/*
81 * do_IRQ handles all normal device IRQ's (the special 375 * do_IRQ handles all normal device IRQ's (the special
82 * SMP cross-CPU interrupts have their own specific 376 * SMP cross-CPU interrupts have their own specific
diff --git a/arch/um/kernel/irq_user.c b/arch/um/kernel/irq_user.c
deleted file mode 100644
index 0e32f5f4a887..000000000000
--- a/arch/um/kernel/irq_user.c
+++ /dev/null
@@ -1,412 +0,0 @@
1/*
2 * Copyright (C) 2000 Jeff Dike (jdike@karaya.com)
3 * Licensed under the GPL
4 */
5
6#include <stdlib.h>
7#include <unistd.h>
8#include <errno.h>
9#include <signal.h>
10#include <string.h>
11#include <sys/poll.h>
12#include <sys/types.h>
13#include <sys/time.h>
14#include "user_util.h"
15#include "kern_util.h"
16#include "user.h"
17#include "process.h"
18#include "sigio.h"
19#include "irq_user.h"
20#include "os.h"
21
22struct irq_fd {
23 struct irq_fd *next;
24 void *id;
25 int fd;
26 int type;
27 int irq;
28 int pid;
29 int events;
30 int current_events;
31};
32
33static struct irq_fd *active_fds = NULL;
34static struct irq_fd **last_irq_ptr = &active_fds;
35
36static struct pollfd *pollfds = NULL;
37static int pollfds_num = 0;
38static int pollfds_size = 0;
39
40extern int io_count, intr_count;
41
42extern void free_irqs(void);
43
44void sigio_handler(int sig, union uml_pt_regs *regs)
45{
46 struct irq_fd *irq_fd;
47 int i, n;
48
49 if(smp_sigio_handler()) return;
50 while(1){
51 n = poll(pollfds, pollfds_num, 0);
52 if(n < 0){
53 if(errno == EINTR) continue;
54 printk("sigio_handler : poll returned %d, "
55 "errno = %d\n", n, errno);
56 break;
57 }
58 if(n == 0) break;
59
60 irq_fd = active_fds;
61 for(i = 0; i < pollfds_num; i++){
62 if(pollfds[i].revents != 0){
63 irq_fd->current_events = pollfds[i].revents;
64 pollfds[i].fd = -1;
65 }
66 irq_fd = irq_fd->next;
67 }
68
69 for(irq_fd = active_fds; irq_fd != NULL; irq_fd = irq_fd->next){
70 if(irq_fd->current_events != 0){
71 irq_fd->current_events = 0;
72 do_IRQ(irq_fd->irq, regs);
73 }
74 }
75 }
76
77 free_irqs();
78}
79
80int activate_ipi(int fd, int pid)
81{
82 return(os_set_fd_async(fd, pid));
83}
84
85static void maybe_sigio_broken(int fd, int type)
86{
87 if(isatty(fd)){
88 if((type == IRQ_WRITE) && !pty_output_sigio){
89 write_sigio_workaround();
90 add_sigio_fd(fd, 0);
91 }
92 else if((type == IRQ_READ) && !pty_close_sigio){
93 write_sigio_workaround();
94 add_sigio_fd(fd, 1);
95 }
96 }
97}
98
99int activate_fd(int irq, int fd, int type, void *dev_id)
100{
101 struct pollfd *tmp_pfd;
102 struct irq_fd *new_fd, *irq_fd;
103 unsigned long flags;
104 int pid, events, err, n, size;
105
106 pid = os_getpid();
107 err = os_set_fd_async(fd, pid);
108 if(err < 0)
109 goto out;
110
111 new_fd = um_kmalloc(sizeof(*new_fd));
112 err = -ENOMEM;
113 if(new_fd == NULL)
114 goto out;
115
116 if(type == IRQ_READ) events = POLLIN | POLLPRI;
117 else events = POLLOUT;
118 *new_fd = ((struct irq_fd) { .next = NULL,
119 .id = dev_id,
120 .fd = fd,
121 .type = type,
122 .irq = irq,
123 .pid = pid,
124 .events = events,
125 .current_events = 0 } );
126
127 /* Critical section - locked by a spinlock because this stuff can
128 * be changed from interrupt handlers. The stuff above is done
129 * outside the lock because it allocates memory.
130 */
131
132 /* Actually, it only looks like it can be called from interrupt
133 * context. The culprit is reactivate_fd, which calls
134 * maybe_sigio_broken, which calls write_sigio_workaround,
135 * which calls activate_fd. However, write_sigio_workaround should
136 * only be called once, at boot time. That would make it clear that
137 * this is called only from process context, and can be locked with
138 * a semaphore.
139 */
140 flags = irq_lock();
141 for(irq_fd = active_fds; irq_fd != NULL; irq_fd = irq_fd->next){
142 if((irq_fd->fd == fd) && (irq_fd->type == type)){
143 printk("Registering fd %d twice\n", fd);
144 printk("Irqs : %d, %d\n", irq_fd->irq, irq);
145 printk("Ids : 0x%x, 0x%x\n", irq_fd->id, dev_id);
146 goto out_unlock;
147 }
148 }
149
150 n = pollfds_num;
151 if(n == pollfds_size){
152 while(1){
153 /* Here we have to drop the lock in order to call
154 * kmalloc, which might sleep. If something else
155 * came in and changed the pollfds array, we free
156 * the buffer and try again.
157 */
158 irq_unlock(flags);
159 size = (pollfds_num + 1) * sizeof(pollfds[0]);
160 tmp_pfd = um_kmalloc(size);
161 flags = irq_lock();
162 if(tmp_pfd == NULL)
163 goto out_unlock;
164 if(n == pollfds_size)
165 break;
166 kfree(tmp_pfd);
167 }
168 if(pollfds != NULL){
169 memcpy(tmp_pfd, pollfds,
170 sizeof(pollfds[0]) * pollfds_size);
171 kfree(pollfds);
172 }
173 pollfds = tmp_pfd;
174 pollfds_size++;
175 }
176
177 if(type == IRQ_WRITE)
178 fd = -1;
179
180 pollfds[pollfds_num] = ((struct pollfd) { .fd = fd,
181 .events = events,
182 .revents = 0 });
183 pollfds_num++;
184
185 *last_irq_ptr = new_fd;
186 last_irq_ptr = &new_fd->next;
187
188 irq_unlock(flags);
189
190 /* This calls activate_fd, so it has to be outside the critical
191 * section.
192 */
193 maybe_sigio_broken(fd, type);
194
195 return(0);
196
197 out_unlock:
198 irq_unlock(flags);
199 kfree(new_fd);
200 out:
201 return(err);
202}
203
204static void free_irq_by_cb(int (*test)(struct irq_fd *, void *), void *arg)
205{
206 struct irq_fd **prev;
207 unsigned long flags;
208 int i = 0;
209
210 flags = irq_lock();
211 prev = &active_fds;
212 while(*prev != NULL){
213 if((*test)(*prev, arg)){
214 struct irq_fd *old_fd = *prev;
215 if((pollfds[i].fd != -1) &&
216 (pollfds[i].fd != (*prev)->fd)){
217 printk("free_irq_by_cb - mismatch between "
218 "active_fds and pollfds, fd %d vs %d\n",
219 (*prev)->fd, pollfds[i].fd);
220 goto out;
221 }
222
223 pollfds_num--;
224
225 /* This moves the *whole* array after pollfds[i] (though
226 * it doesn't spot as such)! */
227
228 memmove(&pollfds[i], &pollfds[i + 1],
229 (pollfds_num - i) * sizeof(pollfds[0]));
230
231 if(last_irq_ptr == &old_fd->next)
232 last_irq_ptr = prev;
233 *prev = (*prev)->next;
234 if(old_fd->type == IRQ_WRITE)
235 ignore_sigio_fd(old_fd->fd);
236 kfree(old_fd);
237 continue;
238 }
239 prev = &(*prev)->next;
240 i++;
241 }
242 out:
243 irq_unlock(flags);
244}
245
246struct irq_and_dev {
247 int irq;
248 void *dev;
249};
250
251static int same_irq_and_dev(struct irq_fd *irq, void *d)
252{
253 struct irq_and_dev *data = d;
254
255 return((irq->irq == data->irq) && (irq->id == data->dev));
256}
257
258void free_irq_by_irq_and_dev(unsigned int irq, void *dev)
259{
260 struct irq_and_dev data = ((struct irq_and_dev) { .irq = irq,
261 .dev = dev });
262
263 free_irq_by_cb(same_irq_and_dev, &data);
264}
265
266static int same_fd(struct irq_fd *irq, void *fd)
267{
268 return(irq->fd == *((int *) fd));
269}
270
271void free_irq_by_fd(int fd)
272{
273 free_irq_by_cb(same_fd, &fd);
274}
275
276static struct irq_fd *find_irq_by_fd(int fd, int irqnum, int *index_out)
277{
278 struct irq_fd *irq;
279 int i = 0;
280
281 for(irq=active_fds; irq != NULL; irq = irq->next){
282 if((irq->fd == fd) && (irq->irq == irqnum)) break;
283 i++;
284 }
285 if(irq == NULL){
286 printk("find_irq_by_fd doesn't have descriptor %d\n", fd);
287 goto out;
288 }
289 if((pollfds[i].fd != -1) && (pollfds[i].fd != fd)){
290 printk("find_irq_by_fd - mismatch between active_fds and "
291 "pollfds, fd %d vs %d, need %d\n", irq->fd,
292 pollfds[i].fd, fd);
293 irq = NULL;
294 goto out;
295 }
296 *index_out = i;
297 out:
298 return(irq);
299}
300
301void reactivate_fd(int fd, int irqnum)
302{
303 struct irq_fd *irq;
304 unsigned long flags;
305 int i;
306
307 flags = irq_lock();
308 irq = find_irq_by_fd(fd, irqnum, &i);
309 if(irq == NULL){
310 irq_unlock(flags);
311 return;
312 }
313
314 pollfds[i].fd = irq->fd;
315
316 irq_unlock(flags);
317
318 /* This calls activate_fd, so it has to be outside the critical
319 * section.
320 */
321 maybe_sigio_broken(fd, irq->type);
322}
323
324void deactivate_fd(int fd, int irqnum)
325{
326 struct irq_fd *irq;
327 unsigned long flags;
328 int i;
329
330 flags = irq_lock();
331 irq = find_irq_by_fd(fd, irqnum, &i);
332 if(irq == NULL)
333 goto out;
334 pollfds[i].fd = -1;
335 out:
336 irq_unlock(flags);
337}
338
339int deactivate_all_fds(void)
340{
341 struct irq_fd *irq;
342 int err;
343
344 for(irq=active_fds;irq != NULL;irq = irq->next){
345 err = os_clear_fd_async(irq->fd);
346 if(err)
347 return(err);
348 }
349 /* If there is a signal already queued, after unblocking ignore it */
350 set_handler(SIGIO, SIG_IGN, 0, -1);
351
352 return(0);
353}
354
355void forward_ipi(int fd, int pid)
356{
357 int err;
358
359 err = os_set_owner(fd, pid);
360 if(err < 0)
361 printk("forward_ipi: set_owner failed, fd = %d, me = %d, "
362 "target = %d, err = %d\n", fd, os_getpid(), pid, -err);
363}
364
365void forward_interrupts(int pid)
366{
367 struct irq_fd *irq;
368 unsigned long flags;
369 int err;
370
371 flags = irq_lock();
372 for(irq=active_fds;irq != NULL;irq = irq->next){
373 err = os_set_owner(irq->fd, pid);
374 if(err < 0){
375 /* XXX Just remove the irq rather than
376 * print out an infinite stream of these
377 */
378 printk("Failed to forward %d to pid %d, err = %d\n",
379 irq->fd, pid, -err);
380 }
381
382 irq->pid = pid;
383 }
384 irq_unlock(flags);
385}
386
387void init_irq_signals(int on_sigstack)
388{
389 __sighandler_t h;
390 int flags;
391
392 flags = on_sigstack ? SA_ONSTACK : 0;
393 if(timer_irq_inited) h = (__sighandler_t) alarm_handler;
394 else h = boot_timer_handler;
395
396 set_handler(SIGVTALRM, h, flags | SA_RESTART,
397 SIGUSR1, SIGIO, SIGWINCH, SIGALRM, -1);
398 set_handler(SIGIO, (__sighandler_t) sig_handler, flags | SA_RESTART,
399 SIGUSR1, SIGIO, SIGWINCH, SIGALRM, SIGVTALRM, -1);
400 signal(SIGWINCH, SIG_IGN);
401}
402
403/*
404 * Overrides for Emacs so that we follow Linus's tabbing style.
405 * Emacs will notice this stuff at the end of the file and automatically
406 * adjust the settings for this buffer only. This must remain at the end
407 * of the file.
408 * ---------------------------------------------------------------------------
409 * Local variables:
410 * c-file-style: "linux"
411 * End:
412 */
diff --git a/arch/um/kernel/mem.c b/arch/um/kernel/mem.c
index fa4f915be5c5..44e41a35f000 100644
--- a/arch/um/kernel/mem.c
+++ b/arch/um/kernel/mem.c
@@ -30,7 +30,7 @@ extern char __binary_start;
30unsigned long *empty_zero_page = NULL; 30unsigned long *empty_zero_page = NULL;
31unsigned long *empty_bad_page = NULL; 31unsigned long *empty_bad_page = NULL;
32pgd_t swapper_pg_dir[PTRS_PER_PGD]; 32pgd_t swapper_pg_dir[PTRS_PER_PGD];
33unsigned long highmem; 33unsigned long long highmem;
34int kmalloc_ok = 0; 34int kmalloc_ok = 0;
35 35
36static unsigned long brk_end; 36static unsigned long brk_end;
@@ -57,7 +57,7 @@ static void setup_highmem(unsigned long highmem_start,
57 for(i = 0; i < highmem_len >> PAGE_SHIFT; i++){ 57 for(i = 0; i < highmem_len >> PAGE_SHIFT; i++){
58 page = &mem_map[highmem_pfn + i]; 58 page = &mem_map[highmem_pfn + i];
59 ClearPageReserved(page); 59 ClearPageReserved(page);
60 set_page_count(page, 1); 60 init_page_count(page);
61 __free_page(page); 61 __free_page(page);
62 } 62 }
63} 63}
@@ -296,7 +296,7 @@ void free_initrd_mem(unsigned long start, unsigned long end)
296 (end - start) >> 10); 296 (end - start) >> 10);
297 for (; start < end; start += PAGE_SIZE) { 297 for (; start < end; start += PAGE_SIZE) {
298 ClearPageReserved(virt_to_page(start)); 298 ClearPageReserved(virt_to_page(start));
299 set_page_count(virt_to_page(start), 1); 299 init_page_count(virt_to_page(start));
300 free_page(start); 300 free_page(start);
301 totalram_pages++; 301 totalram_pages++;
302 } 302 }
diff --git a/arch/um/kernel/physmem.c b/arch/um/kernel/physmem.c
index 544665e04513..0500800df1c1 100644
--- a/arch/um/kernel/physmem.c
+++ b/arch/um/kernel/physmem.c
@@ -9,6 +9,7 @@
9#include "linux/vmalloc.h" 9#include "linux/vmalloc.h"
10#include "linux/bootmem.h" 10#include "linux/bootmem.h"
11#include "linux/module.h" 11#include "linux/module.h"
12#include "linux/pfn.h"
12#include "asm/types.h" 13#include "asm/types.h"
13#include "asm/pgtable.h" 14#include "asm/pgtable.h"
14#include "kern_util.h" 15#include "kern_util.h"
@@ -279,7 +280,7 @@ int init_maps(unsigned long physmem, unsigned long iomem, unsigned long highmem)
279 280
280 for(i = 0; i < total_pages; i++){ 281 for(i = 0; i < total_pages; i++){
281 p = &map[i]; 282 p = &map[i];
282 set_page_count(p, 0); 283 memset(p, 0, sizeof(struct page));
283 SetPageReserved(p); 284 SetPageReserved(p);
284 INIT_LIST_HEAD(&p->lru); 285 INIT_LIST_HEAD(&p->lru);
285 } 286 }
@@ -316,8 +317,6 @@ void map_memory(unsigned long virt, unsigned long phys, unsigned long len,
316 } 317 }
317} 318}
318 319
319#define PFN_UP(x) (((x) + PAGE_SIZE-1) >> PAGE_SHIFT)
320
321extern int __syscall_stub_start, __binary_start; 320extern int __syscall_stub_start, __binary_start;
322 321
323void setup_physmem(unsigned long start, unsigned long reserve_end, 322void setup_physmem(unsigned long start, unsigned long reserve_end,
diff --git a/arch/um/kernel/process_kern.c b/arch/um/kernel/process_kern.c
index 3113cab8675e..f6a5a502120b 100644
--- a/arch/um/kernel/process_kern.c
+++ b/arch/um/kernel/process_kern.c
@@ -156,9 +156,25 @@ int copy_thread(int nr, unsigned long clone_flags, unsigned long sp,
156 unsigned long stack_top, struct task_struct * p, 156 unsigned long stack_top, struct task_struct * p,
157 struct pt_regs *regs) 157 struct pt_regs *regs)
158{ 158{
159 int ret;
160
159 p->thread = (struct thread_struct) INIT_THREAD; 161 p->thread = (struct thread_struct) INIT_THREAD;
160 return(CHOOSE_MODE_PROC(copy_thread_tt, copy_thread_skas, nr, 162 ret = CHOOSE_MODE_PROC(copy_thread_tt, copy_thread_skas, nr,
161 clone_flags, sp, stack_top, p, regs)); 163 clone_flags, sp, stack_top, p, regs);
164
165 if (ret || !current->thread.forking)
166 goto out;
167
168 clear_flushed_tls(p);
169
170 /*
171 * Set a new TLS for the child thread?
172 */
173 if (clone_flags & CLONE_SETTLS)
174 ret = arch_copy_tls(p);
175
176out:
177 return ret;
162} 178}
163 179
164void initial_thread_cb(void (*proc)(void *), void *arg) 180void initial_thread_cb(void (*proc)(void *), void *arg)
@@ -185,10 +201,6 @@ void default_idle(void)
185{ 201{
186 CHOOSE_MODE(uml_idle_timer(), (void) 0); 202 CHOOSE_MODE(uml_idle_timer(), (void) 0);
187 203
188 atomic_inc(&init_mm.mm_count);
189 current->mm = &init_mm;
190 current->active_mm = &init_mm;
191
192 while(1){ 204 while(1){
193 /* endless idle loop with no priority at all */ 205 /* endless idle loop with no priority at all */
194 206
@@ -407,7 +419,7 @@ static int proc_read_sysemu(char *buf, char **start, off_t offset, int size,int
407 return strlen(buf); 419 return strlen(buf);
408} 420}
409 421
410static int proc_write_sysemu(struct file *file,const char *buf, unsigned long count,void *data) 422static int proc_write_sysemu(struct file *file,const char __user *buf, unsigned long count,void *data)
411{ 423{
412 char tmp[2]; 424 char tmp[2];
413 425
diff --git a/arch/um/kernel/ptrace.c b/arch/um/kernel/ptrace.c
index 98e09395c093..60d2eda995c1 100644
--- a/arch/um/kernel/ptrace.c
+++ b/arch/um/kernel/ptrace.c
@@ -46,6 +46,7 @@ extern int poke_user(struct task_struct * child, long addr, long data);
46long arch_ptrace(struct task_struct *child, long request, long addr, long data) 46long arch_ptrace(struct task_struct *child, long request, long addr, long data)
47{ 47{
48 int i, ret; 48 int i, ret;
49 unsigned long __user *p = (void __user *)(unsigned long)data;
49 50
50 switch (request) { 51 switch (request) {
51 /* when I and D space are separate, these will need to be fixed. */ 52 /* when I and D space are separate, these will need to be fixed. */
@@ -58,7 +59,7 @@ long arch_ptrace(struct task_struct *child, long request, long addr, long data)
58 copied = access_process_vm(child, addr, &tmp, sizeof(tmp), 0); 59 copied = access_process_vm(child, addr, &tmp, sizeof(tmp), 0);
59 if (copied != sizeof(tmp)) 60 if (copied != sizeof(tmp))
60 break; 61 break;
61 ret = put_user(tmp, (unsigned long __user *) data); 62 ret = put_user(tmp, p);
62 break; 63 break;
63 } 64 }
64 65
@@ -136,15 +137,13 @@ long arch_ptrace(struct task_struct *child, long request, long addr, long data)
136 137
137#ifdef PTRACE_GETREGS 138#ifdef PTRACE_GETREGS
138 case PTRACE_GETREGS: { /* Get all gp regs from the child. */ 139 case PTRACE_GETREGS: { /* Get all gp regs from the child. */
139 if (!access_ok(VERIFY_WRITE, (unsigned long *)data, 140 if (!access_ok(VERIFY_WRITE, p, MAX_REG_OFFSET)) {
140 MAX_REG_OFFSET)) {
141 ret = -EIO; 141 ret = -EIO;
142 break; 142 break;
143 } 143 }
144 for ( i = 0; i < MAX_REG_OFFSET; i += sizeof(long) ) { 144 for ( i = 0; i < MAX_REG_OFFSET; i += sizeof(long) ) {
145 __put_user(getreg(child, i), 145 __put_user(getreg(child, i), p);
146 (unsigned long __user *) data); 146 p++;
147 data += sizeof(long);
148 } 147 }
149 ret = 0; 148 ret = 0;
150 break; 149 break;
@@ -153,15 +152,14 @@ long arch_ptrace(struct task_struct *child, long request, long addr, long data)
153#ifdef PTRACE_SETREGS 152#ifdef PTRACE_SETREGS
154 case PTRACE_SETREGS: { /* Set all gp regs in the child. */ 153 case PTRACE_SETREGS: { /* Set all gp regs in the child. */
155 unsigned long tmp = 0; 154 unsigned long tmp = 0;
156 if (!access_ok(VERIFY_READ, (unsigned *)data, 155 if (!access_ok(VERIFY_READ, p, MAX_REG_OFFSET)) {
157 MAX_REG_OFFSET)) {
158 ret = -EIO; 156 ret = -EIO;
159 break; 157 break;
160 } 158 }
161 for ( i = 0; i < MAX_REG_OFFSET; i += sizeof(long) ) { 159 for ( i = 0; i < MAX_REG_OFFSET; i += sizeof(long) ) {
162 __get_user(tmp, (unsigned long __user *) data); 160 __get_user(tmp, p);
163 putreg(child, i, tmp); 161 putreg(child, i, tmp);
164 data += sizeof(long); 162 p++;
165 } 163 }
166 ret = 0; 164 ret = 0;
167 break; 165 break;
@@ -187,14 +185,23 @@ long arch_ptrace(struct task_struct *child, long request, long addr, long data)
187 ret = set_fpxregs(data, child); 185 ret = set_fpxregs(data, child);
188 break; 186 break;
189#endif 187#endif
188 case PTRACE_GET_THREAD_AREA:
189 ret = ptrace_get_thread_area(child, addr,
190 (struct user_desc __user *) data);
191 break;
192
193 case PTRACE_SET_THREAD_AREA:
194 ret = ptrace_set_thread_area(child, addr,
195 (struct user_desc __user *) data);
196 break;
197
190 case PTRACE_FAULTINFO: { 198 case PTRACE_FAULTINFO: {
191 /* Take the info from thread->arch->faultinfo, 199 /* Take the info from thread->arch->faultinfo,
192 * but transfer max. sizeof(struct ptrace_faultinfo). 200 * but transfer max. sizeof(struct ptrace_faultinfo).
193 * On i386, ptrace_faultinfo is smaller! 201 * On i386, ptrace_faultinfo is smaller!
194 */ 202 */
195 ret = copy_to_user((unsigned long __user *) data, 203 ret = copy_to_user(p, &child->thread.arch.faultinfo,
196 &child->thread.arch.faultinfo, 204 sizeof(struct ptrace_faultinfo));
197 sizeof(struct ptrace_faultinfo));
198 if(ret) 205 if(ret)
199 break; 206 break;
200 break; 207 break;
@@ -204,8 +211,7 @@ long arch_ptrace(struct task_struct *child, long request, long addr, long data)
204 case PTRACE_LDT: { 211 case PTRACE_LDT: {
205 struct ptrace_ldt ldt; 212 struct ptrace_ldt ldt;
206 213
207 if(copy_from_user(&ldt, (unsigned long __user *) data, 214 if(copy_from_user(&ldt, p, sizeof(ldt))){
208 sizeof(ldt))){
209 ret = -EIO; 215 ret = -EIO;
210 break; 216 break;
211 } 217 }
diff --git a/arch/um/kernel/sigio_kern.c b/arch/um/kernel/sigio_kern.c
index 229988463c4c..1c1300fb1e95 100644
--- a/arch/um/kernel/sigio_kern.c
+++ b/arch/um/kernel/sigio_kern.c
@@ -1,4 +1,4 @@
1/* 1/*
2 * Copyright (C) 2002 - 2003 Jeff Dike (jdike@addtoit.com) 2 * Copyright (C) 2002 - 2003 Jeff Dike (jdike@addtoit.com)
3 * Licensed under the GPL 3 * Licensed under the GPL
4 */ 4 */
@@ -12,13 +12,16 @@
12#include "sigio.h" 12#include "sigio.h"
13#include "irq_user.h" 13#include "irq_user.h"
14#include "irq_kern.h" 14#include "irq_kern.h"
15#include "os.h"
15 16
16/* Protected by sigio_lock() called from write_sigio_workaround */ 17/* Protected by sigio_lock() called from write_sigio_workaround */
17static int sigio_irq_fd = -1; 18static int sigio_irq_fd = -1;
18 19
19static irqreturn_t sigio_interrupt(int irq, void *data, struct pt_regs *unused) 20static irqreturn_t sigio_interrupt(int irq, void *data, struct pt_regs *unused)
20{ 21{
21 read_sigio_fd(sigio_irq_fd); 22 char c;
23
24 os_read_file(sigio_irq_fd, &c, sizeof(c));
22 reactivate_fd(sigio_irq_fd, SIGIO_WRITE_IRQ); 25 reactivate_fd(sigio_irq_fd, SIGIO_WRITE_IRQ);
23 return(IRQ_HANDLED); 26 return(IRQ_HANDLED);
24} 27}
@@ -51,6 +54,9 @@ void sigio_unlock(void)
51 spin_unlock(&sigio_spinlock); 54 spin_unlock(&sigio_spinlock);
52} 55}
53 56
57extern void sigio_cleanup(void);
58__uml_exitcall(sigio_cleanup);
59
54/* 60/*
55 * Overrides for Emacs so that we follow Linus's tabbing style. 61 * Overrides for Emacs so that we follow Linus's tabbing style.
56 * Emacs will notice this stuff at the end of the file and automatically 62 * Emacs will notice this stuff at the end of the file and automatically
diff --git a/arch/um/kernel/skas/process_kern.c b/arch/um/kernel/skas/process_kern.c
index 3f70a2e12f06..2135eaf98a93 100644
--- a/arch/um/kernel/skas/process_kern.c
+++ b/arch/um/kernel/skas/process_kern.c
@@ -35,6 +35,8 @@ void switch_to_skas(void *prev, void *next)
35 switch_threads(&from->thread.mode.skas.switch_buf, 35 switch_threads(&from->thread.mode.skas.switch_buf,
36 to->thread.mode.skas.switch_buf); 36 to->thread.mode.skas.switch_buf);
37 37
38 arch_switch_to_skas(current->thread.prev_sched, current);
39
38 if(current->pid == 0) 40 if(current->pid == 0)
39 switch_timers(1); 41 switch_timers(1);
40} 42}
@@ -89,10 +91,17 @@ void fork_handler(int sig)
89 panic("blech"); 91 panic("blech");
90 92
91 schedule_tail(current->thread.prev_sched); 93 schedule_tail(current->thread.prev_sched);
94
95 /* XXX: if interrupt_end() calls schedule, this call to
96 * arch_switch_to_skas isn't needed. We could want to apply this to
97 * improve performance. -bb */
98 arch_switch_to_skas(current->thread.prev_sched, current);
99
92 current->thread.prev_sched = NULL; 100 current->thread.prev_sched = NULL;
93 101
94/* Handle any immediate reschedules or signals */ 102/* Handle any immediate reschedules or signals */
95 interrupt_end(); 103 interrupt_end();
104
96 userspace(&current->thread.regs.regs); 105 userspace(&current->thread.regs.regs);
97} 106}
98 107
@@ -109,6 +118,8 @@ int copy_thread_skas(int nr, unsigned long clone_flags, unsigned long sp,
109 if(sp != 0) REGS_SP(p->thread.regs.regs.skas.regs) = sp; 118 if(sp != 0) REGS_SP(p->thread.regs.regs.skas.regs) = sp;
110 119
111 handler = fork_handler; 120 handler = fork_handler;
121
122 arch_copy_thread(&current->thread.arch, &p->thread.arch);
112 } 123 }
113 else { 124 else {
114 init_thread_registers(&p->thread.regs.regs); 125 init_thread_registers(&p->thread.regs.regs);
diff --git a/arch/um/kernel/smp.c b/arch/um/kernel/smp.c
index 72113b0a96e7..511116aebaf7 100644
--- a/arch/um/kernel/smp.c
+++ b/arch/um/kernel/smp.c
@@ -1,4 +1,4 @@
1/* 1/*
2 * Copyright (C) 2000 - 2003 Jeff Dike (jdike@addtoit.com) 2 * Copyright (C) 2000 - 2003 Jeff Dike (jdike@addtoit.com)
3 * Licensed under the GPL 3 * Licensed under the GPL
4 */ 4 */
@@ -77,9 +77,9 @@ static int idle_proc(void *cpup)
77 if(err < 0) 77 if(err < 0)
78 panic("CPU#%d failed to create IPI pipe, err = %d", cpu, -err); 78 panic("CPU#%d failed to create IPI pipe, err = %d", cpu, -err);
79 79
80 activate_ipi(cpu_data[cpu].ipi_pipe[0], 80 os_set_fd_async(cpu_data[cpu].ipi_pipe[0],
81 current->thread.mode.tt.extern_pid); 81 current->thread.mode.tt.extern_pid);
82 82
83 wmb(); 83 wmb();
84 if (cpu_test_and_set(cpu, cpu_callin_map)) { 84 if (cpu_test_and_set(cpu, cpu_callin_map)) {
85 printk("huh, CPU#%d already present??\n", cpu); 85 printk("huh, CPU#%d already present??\n", cpu);
@@ -106,7 +106,7 @@ static struct task_struct *idle_thread(int cpu)
106 panic("copy_process failed in idle_thread, error = %ld", 106 panic("copy_process failed in idle_thread, error = %ld",
107 PTR_ERR(new_task)); 107 PTR_ERR(new_task));
108 108
109 cpu_tasks[cpu] = ((struct cpu_task) 109 cpu_tasks[cpu] = ((struct cpu_task)
110 { .pid = new_task->thread.mode.tt.extern_pid, 110 { .pid = new_task->thread.mode.tt.extern_pid,
111 .task = new_task } ); 111 .task = new_task } );
112 idle_threads[cpu] = new_task; 112 idle_threads[cpu] = new_task;
@@ -134,16 +134,15 @@ void smp_prepare_cpus(unsigned int maxcpus)
134 if(err < 0) 134 if(err < 0)
135 panic("CPU#0 failed to create IPI pipe, errno = %d", -err); 135 panic("CPU#0 failed to create IPI pipe, errno = %d", -err);
136 136
137 activate_ipi(cpu_data[me].ipi_pipe[0], 137 os_set_fd_async(cpu_data[me].ipi_pipe[0],
138 current->thread.mode.tt.extern_pid); 138 current->thread.mode.tt.extern_pid);
139 139
140 for(cpu = 1; cpu < ncpus; cpu++){ 140 for(cpu = 1; cpu < ncpus; cpu++){
141 printk("Booting processor %d...\n", cpu); 141 printk("Booting processor %d...\n", cpu);
142 142
143 idle = idle_thread(cpu); 143 idle = idle_thread(cpu);
144 144
145 init_idle(idle, cpu); 145 init_idle(idle, cpu);
146 unhash_process(idle);
147 146
148 waittime = 200000000; 147 waittime = 200000000;
149 while (waittime-- && !cpu_isset(cpu, cpu_callin_map)) 148 while (waittime-- && !cpu_isset(cpu, cpu_callin_map))
@@ -223,7 +222,7 @@ void smp_call_function_slave(int cpu)
223 atomic_inc(&scf_finished); 222 atomic_inc(&scf_finished);
224} 223}
225 224
226int smp_call_function(void (*_func)(void *info), void *_info, int nonatomic, 225int smp_call_function(void (*_func)(void *info), void *_info, int nonatomic,
227 int wait) 226 int wait)
228{ 227{
229 int cpus = num_online_cpus() - 1; 228 int cpus = num_online_cpus() - 1;
diff --git a/arch/um/kernel/syscall_kern.c b/arch/um/kernel/syscall_kern.c
index 8e1a3501ff46..37d3978337d8 100644
--- a/arch/um/kernel/syscall_kern.c
+++ b/arch/um/kernel/syscall_kern.c
@@ -104,7 +104,7 @@ long sys_pipe(unsigned long __user * fildes)
104} 104}
105 105
106 106
107long sys_uname(struct old_utsname * name) 107long sys_uname(struct old_utsname __user * name)
108{ 108{
109 long err; 109 long err;
110 if (!name) 110 if (!name)
@@ -115,7 +115,7 @@ long sys_uname(struct old_utsname * name)
115 return err?-EFAULT:0; 115 return err?-EFAULT:0;
116} 116}
117 117
118long sys_olduname(struct oldold_utsname * name) 118long sys_olduname(struct oldold_utsname __user * name)
119{ 119{
120 long error; 120 long error;
121 121
diff --git a/arch/um/kernel/trap_kern.c b/arch/um/kernel/trap_kern.c
index d56046c2aba2..02f6d4d8dc3a 100644
--- a/arch/um/kernel/trap_kern.c
+++ b/arch/um/kernel/trap_kern.c
@@ -198,7 +198,7 @@ unsigned long segv(struct faultinfo fi, unsigned long ip, int is_user, void *sc)
198 si.si_signo = SIGBUS; 198 si.si_signo = SIGBUS;
199 si.si_errno = 0; 199 si.si_errno = 0;
200 si.si_code = BUS_ADRERR; 200 si.si_code = BUS_ADRERR;
201 si.si_addr = (void *)address; 201 si.si_addr = (void __user *)address;
202 current->thread.arch.faultinfo = fi; 202 current->thread.arch.faultinfo = fi;
203 force_sig_info(SIGBUS, &si, current); 203 force_sig_info(SIGBUS, &si, current);
204 } else if (err == -ENOMEM) { 204 } else if (err == -ENOMEM) {
@@ -207,7 +207,7 @@ unsigned long segv(struct faultinfo fi, unsigned long ip, int is_user, void *sc)
207 } else { 207 } else {
208 BUG_ON(err != -EFAULT); 208 BUG_ON(err != -EFAULT);
209 si.si_signo = SIGSEGV; 209 si.si_signo = SIGSEGV;
210 si.si_addr = (void *) address; 210 si.si_addr = (void __user *) address;
211 current->thread.arch.faultinfo = fi; 211 current->thread.arch.faultinfo = fi;
212 force_sig_info(SIGSEGV, &si, current); 212 force_sig_info(SIGSEGV, &si, current);
213 } 213 }
@@ -220,8 +220,8 @@ void bad_segv(struct faultinfo fi, unsigned long ip)
220 220
221 si.si_signo = SIGSEGV; 221 si.si_signo = SIGSEGV;
222 si.si_code = SEGV_ACCERR; 222 si.si_code = SEGV_ACCERR;
223 si.si_addr = (void *) FAULT_ADDRESS(fi); 223 si.si_addr = (void __user *) FAULT_ADDRESS(fi);
224 current->thread.arch.faultinfo = fi; 224 current->thread.arch.faultinfo = fi;
225 force_sig_info(SIGSEGV, &si, current); 225 force_sig_info(SIGSEGV, &si, current);
226} 226}
227 227
diff --git a/arch/um/kernel/tt/process_kern.c b/arch/um/kernel/tt/process_kern.c
index 295c1ac817b3..a9c1443fc548 100644
--- a/arch/um/kernel/tt/process_kern.c
+++ b/arch/um/kernel/tt/process_kern.c
@@ -51,6 +51,13 @@ void switch_to_tt(void *prev, void *next)
51 51
52 c = 0; 52 c = 0;
53 53
54 /* Notice that here we "up" the semaphore on which "to" is waiting, and
55 * below (the read) we wait on this semaphore (which is implemented by
56 * switch_pipe) and go sleeping. Thus, after that, we have resumed in
57 * "to", and can't use any more the value of "from" (which is outdated),
58 * nor the value in "to" (since it was the task which stole us the CPU,
59 * which we don't care about). */
60
54 err = os_write_file(to->thread.mode.tt.switch_pipe[1], &c, sizeof(c)); 61 err = os_write_file(to->thread.mode.tt.switch_pipe[1], &c, sizeof(c));
55 if(err != sizeof(c)) 62 if(err != sizeof(c))
56 panic("write of switch_pipe failed, err = %d", -err); 63 panic("write of switch_pipe failed, err = %d", -err);
@@ -77,7 +84,7 @@ void switch_to_tt(void *prev, void *next)
77 change_sig(SIGALRM, alrm); 84 change_sig(SIGALRM, alrm);
78 change_sig(SIGPROF, prof); 85 change_sig(SIGPROF, prof);
79 86
80 arch_switch(); 87 arch_switch_to_tt(prev_sched, current);
81 88
82 flush_tlb_all(); 89 flush_tlb_all();
83 local_irq_restore(flags); 90 local_irq_restore(flags);
@@ -141,7 +148,6 @@ static void new_thread_handler(int sig)
141 set_cmdline("(kernel thread)"); 148 set_cmdline("(kernel thread)");
142 149
143 change_sig(SIGUSR1, 1); 150 change_sig(SIGUSR1, 1);
144 change_sig(SIGVTALRM, 1);
145 change_sig(SIGPROF, 1); 151 change_sig(SIGPROF, 1);
146 local_irq_enable(); 152 local_irq_enable();
147 if(!run_kernel_thread(fn, arg, &current->thread.exec_buf)) 153 if(!run_kernel_thread(fn, arg, &current->thread.exec_buf))
diff --git a/arch/um/kernel/um_arch.c b/arch/um/kernel/um_arch.c
index 27cdf9164422..7d51dd7201c3 100644
--- a/arch/um/kernel/um_arch.c
+++ b/arch/um/kernel/um_arch.c
@@ -421,7 +421,7 @@ int linux_main(int argc, char **argv)
421#ifndef CONFIG_HIGHMEM 421#ifndef CONFIG_HIGHMEM
422 highmem = 0; 422 highmem = 0;
423 printf("CONFIG_HIGHMEM not enabled - physical memory shrunk " 423 printf("CONFIG_HIGHMEM not enabled - physical memory shrunk "
424 "to %lu bytes\n", physmem_size); 424 "to %Lu bytes\n", physmem_size);
425#endif 425#endif
426 } 426 }
427 427
@@ -433,8 +433,8 @@ int linux_main(int argc, char **argv)
433 433
434 setup_physmem(uml_physmem, uml_reserved, physmem_size, highmem); 434 setup_physmem(uml_physmem, uml_reserved, physmem_size, highmem);
435 if(init_maps(physmem_size, iomem_size, highmem)){ 435 if(init_maps(physmem_size, iomem_size, highmem)){
436 printf("Failed to allocate mem_map for %lu bytes of physical " 436 printf("Failed to allocate mem_map for %Lu bytes of physical "
437 "memory and %lu bytes of highmem\n", physmem_size, 437 "memory and %Lu bytes of highmem\n", physmem_size,
438 highmem); 438 highmem);
439 exit(1); 439 exit(1);
440 } 440 }
@@ -477,7 +477,8 @@ static struct notifier_block panic_exit_notifier = {
477 477
478void __init setup_arch(char **cmdline_p) 478void __init setup_arch(char **cmdline_p)
479{ 479{
480 notifier_chain_register(&panic_notifier_list, &panic_exit_notifier); 480 atomic_notifier_chain_register(&panic_notifier_list,
481 &panic_exit_notifier);
481 paging_init(); 482 paging_init();
482 strlcpy(saved_command_line, command_line, COMMAND_LINE_SIZE); 483 strlcpy(saved_command_line, command_line, COMMAND_LINE_SIZE);
483 *cmdline_p = command_line; 484 *cmdline_p = command_line;
@@ -487,10 +488,19 @@ void __init setup_arch(char **cmdline_p)
487void __init check_bugs(void) 488void __init check_bugs(void)
488{ 489{
489 arch_check_bugs(); 490 arch_check_bugs();
490 check_sigio(); 491 os_check_bugs();
491 check_devanon();
492} 492}
493 493
494void apply_alternatives(void *start, void *end) 494void apply_alternatives(struct alt_instr *start, struct alt_instr *end)
495{
496}
497
498void alternatives_smp_module_add(struct module *mod, char *name,
499 void *locks, void *locks_end,
500 void *text, void *text_end)
501{
502}
503
504void alternatives_smp_module_del(struct module *mod)
495{ 505{
496} 506}
diff --git a/arch/um/os-Linux/Makefile b/arch/um/os-Linux/Makefile
index 08a4e628b24c..f4bfc4c7ccac 100644
--- a/arch/um/os-Linux/Makefile
+++ b/arch/um/os-Linux/Makefile
@@ -3,17 +3,17 @@
3# Licensed under the GPL 3# Licensed under the GPL
4# 4#
5 5
6obj-y = aio.o elf_aux.o file.o helper.o main.o mem.o process.o signal.o \ 6obj-y = aio.o elf_aux.o file.o helper.o irq.o main.o mem.o process.o sigio.o \
7 start_up.o time.o trap.o tt.o tty.o uaccess.o umid.o user_syms.o \ 7 signal.o start_up.o time.o trap.o tt.o tty.o uaccess.o umid.o tls.o \
8 util.o drivers/ sys-$(SUBARCH)/ 8 user_syms.o util.o drivers/ sys-$(SUBARCH)/
9 9
10obj-$(CONFIG_MODE_SKAS) += skas/ 10obj-$(CONFIG_MODE_SKAS) += skas/
11obj-$(CONFIG_TTY_LOG) += tty_log.o
12user-objs-$(CONFIG_TTY_LOG) += tty_log.o
11 13
12USER_OBJS := aio.o elf_aux.o file.o helper.o main.o mem.o process.o signal.o \ 14USER_OBJS := $(user-objs-y) aio.o elf_aux.o file.o helper.o irq.o main.o mem.o \
13 start_up.o time.o trap.o tt.o tty.o uaccess.o umid.o util.o 15 process.o sigio.o signal.o start_up.o time.o trap.o tt.o tty.o tls.o \
14 16 uaccess.o umid.o util.o
15elf_aux.o: $(ARCH_DIR)/kernel-offsets.h
16CFLAGS_elf_aux.o += -I$(objtree)/arch/um
17 17
18CFLAGS_user_syms.o += -DSUBARCH_$(SUBARCH) 18CFLAGS_user_syms.o += -DSUBARCH_$(SUBARCH)
19 19
diff --git a/arch/um/os-Linux/drivers/ethertap_kern.c b/arch/um/os-Linux/drivers/ethertap_kern.c
index 6ae4b19d9f50..768606bec233 100644
--- a/arch/um/os-Linux/drivers/ethertap_kern.c
+++ b/arch/um/os-Linux/drivers/ethertap_kern.c
@@ -102,18 +102,7 @@ static struct transport ethertap_transport = {
102static int register_ethertap(void) 102static int register_ethertap(void)
103{ 103{
104 register_transport(&ethertap_transport); 104 register_transport(&ethertap_transport);
105 return(1); 105 return 0;
106} 106}
107 107
108__initcall(register_ethertap); 108__initcall(register_ethertap);
109
110/*
111 * Overrides for Emacs so that we follow Linus's tabbing style.
112 * Emacs will notice this stuff at the end of the file and automatically
113 * adjust the settings for this buffer only. This must remain at the end
114 * of the file.
115 * ---------------------------------------------------------------------------
116 * Local variables:
117 * c-file-style: "linux"
118 * End:
119 */
diff --git a/arch/um/os-Linux/drivers/tuntap_kern.c b/arch/um/os-Linux/drivers/tuntap_kern.c
index 4202b9ebad4c..190009a6f89c 100644
--- a/arch/um/os-Linux/drivers/tuntap_kern.c
+++ b/arch/um/os-Linux/drivers/tuntap_kern.c
@@ -87,18 +87,7 @@ static struct transport tuntap_transport = {
87static int register_tuntap(void) 87static int register_tuntap(void)
88{ 88{
89 register_transport(&tuntap_transport); 89 register_transport(&tuntap_transport);
90 return(1); 90 return 0;
91} 91}
92 92
93__initcall(register_tuntap); 93__initcall(register_tuntap);
94
95/*
96 * Overrides for Emacs so that we follow Linus's tabbing style.
97 * Emacs will notice this stuff at the end of the file and automatically
98 * adjust the settings for this buffer only. This must remain at the end
99 * of the file.
100 * ---------------------------------------------------------------------------
101 * Local variables:
102 * c-file-style: "linux"
103 * End:
104 */
diff --git a/arch/um/os-Linux/irq.c b/arch/um/os-Linux/irq.c
new file mode 100644
index 000000000000..e599be423da1
--- /dev/null
+++ b/arch/um/os-Linux/irq.c
@@ -0,0 +1,162 @@
1/*
2 * Copyright (C) 2000, 2001, 2002 Jeff Dike (jdike@karaya.com)
3 * Licensed under the GPL
4 */
5
6#include <stdlib.h>
7#include <unistd.h>
8#include <errno.h>
9#include <signal.h>
10#include <string.h>
11#include <sys/poll.h>
12#include <sys/types.h>
13#include <sys/time.h>
14#include "user_util.h"
15#include "kern_util.h"
16#include "user.h"
17#include "process.h"
18#include "sigio.h"
19#include "irq_user.h"
20#include "os.h"
21
22static struct pollfd *pollfds = NULL;
23static int pollfds_num = 0;
24static int pollfds_size = 0;
25
26int os_waiting_for_events(struct irq_fd *active_fds)
27{
28 struct irq_fd *irq_fd;
29 int i, n, err;
30
31 n = poll(pollfds, pollfds_num, 0);
32 if(n < 0){
33 err = -errno;
34 if(errno != EINTR)
35 printk("sigio_handler: os_waiting_for_events:"
36 " poll returned %d, errno = %d\n", n, errno);
37 return err;
38 }
39
40 if(n == 0)
41 return 0;
42
43 irq_fd = active_fds;
44
45 for(i = 0; i < pollfds_num; i++){
46 if(pollfds[i].revents != 0){
47 irq_fd->current_events = pollfds[i].revents;
48 pollfds[i].fd = -1;
49 }
50 irq_fd = irq_fd->next;
51 }
52 return n;
53}
54
55int os_isatty(int fd)
56{
57 return(isatty(fd));
58}
59
60int os_create_pollfd(int fd, int events, void *tmp_pfd, int size_tmpfds)
61{
62 if (pollfds_num == pollfds_size) {
63 if (size_tmpfds <= pollfds_size * sizeof(pollfds[0])) {
64 /* return min size needed for new pollfds area */
65 return((pollfds_size + 1) * sizeof(pollfds[0]));
66 }
67
68 if(pollfds != NULL){
69 memcpy(tmp_pfd, pollfds,
70 sizeof(pollfds[0]) * pollfds_size);
71 /* remove old pollfds */
72 kfree(pollfds);
73 }
74 pollfds = tmp_pfd;
75 pollfds_size++;
76 } else {
77 /* remove not used tmp_pfd */
78 if (tmp_pfd != NULL)
79 kfree(tmp_pfd);
80 }
81
82 pollfds[pollfds_num] = ((struct pollfd) { .fd = fd,
83 .events = events,
84 .revents = 0 });
85 pollfds_num++;
86
87 return(0);
88}
89
90void os_free_irq_by_cb(int (*test)(struct irq_fd *, void *), void *arg,
91 struct irq_fd *active_fds, struct irq_fd ***last_irq_ptr2)
92{
93 struct irq_fd **prev;
94 int i = 0;
95
96 prev = &active_fds;
97 while(*prev != NULL){
98 if((*test)(*prev, arg)){
99 struct irq_fd *old_fd = *prev;
100 if((pollfds[i].fd != -1) &&
101 (pollfds[i].fd != (*prev)->fd)){
102 printk("os_free_irq_by_cb - mismatch between "
103 "active_fds and pollfds, fd %d vs %d\n",
104 (*prev)->fd, pollfds[i].fd);
105 goto out;
106 }
107
108 pollfds_num--;
109
110 /* This moves the *whole* array after pollfds[i]
111 * (though it doesn't spot as such)!
112 */
113
114 memmove(&pollfds[i], &pollfds[i + 1],
115 (pollfds_num - i) * sizeof(pollfds[0]));
116 if(*last_irq_ptr2 == &old_fd->next)
117 *last_irq_ptr2 = prev;
118
119 *prev = (*prev)->next;
120 if(old_fd->type == IRQ_WRITE)
121 ignore_sigio_fd(old_fd->fd);
122 kfree(old_fd);
123 continue;
124 }
125 prev = &(*prev)->next;
126 i++;
127 }
128 out:
129 return;
130}
131
132
133int os_get_pollfd(int i)
134{
135 return(pollfds[i].fd);
136}
137
138void os_set_pollfd(int i, int fd)
139{
140 pollfds[i].fd = fd;
141}
142
143void os_set_ioignore(void)
144{
145 set_handler(SIGIO, SIG_IGN, 0, -1);
146}
147
148void init_irq_signals(int on_sigstack)
149{
150 __sighandler_t h;
151 int flags;
152
153 flags = on_sigstack ? SA_ONSTACK : 0;
154 if(timer_irq_inited) h = (__sighandler_t) alarm_handler;
155 else h = boot_timer_handler;
156
157 set_handler(SIGVTALRM, h, flags | SA_RESTART,
158 SIGUSR1, SIGIO, SIGWINCH, SIGALRM, -1);
159 set_handler(SIGIO, (__sighandler_t) sig_handler, flags | SA_RESTART,
160 SIGUSR1, SIGIO, SIGWINCH, SIGALRM, SIGVTALRM, -1);
161 signal(SIGWINCH, SIG_IGN);
162}
diff --git a/arch/um/os-Linux/mem.c b/arch/um/os-Linux/mem.c
index 9d7d69a523bb..6ab372da9657 100644
--- a/arch/um/os-Linux/mem.c
+++ b/arch/um/os-Linux/mem.c
@@ -121,36 +121,11 @@ int create_tmp_file(unsigned long long len)
121 return(fd); 121 return(fd);
122} 122}
123 123
124static int create_anon_file(unsigned long long len)
125{
126 void *addr;
127 int fd;
128
129 fd = open("/dev/anon", O_RDWR);
130 if(fd < 0) {
131 perror("opening /dev/anon");
132 exit(1);
133 }
134
135 addr = mmap(NULL, len, PROT_READ | PROT_WRITE, MAP_PRIVATE, fd, 0);
136 if(addr == MAP_FAILED){
137 perror("mapping physmem file");
138 exit(1);
139 }
140 munmap(addr, len);
141
142 return(fd);
143}
144
145extern int have_devanon;
146
147int create_mem_file(unsigned long long len) 124int create_mem_file(unsigned long long len)
148{ 125{
149 int err, fd; 126 int err, fd;
150 127
151 if(have_devanon) 128 fd = create_tmp_file(len);
152 fd = create_anon_file(len);
153 else fd = create_tmp_file(len);
154 129
155 err = os_set_exec_close(fd, 1); 130 err = os_set_exec_close(fd, 1);
156 if(err < 0){ 131 if(err < 0){
diff --git a/arch/um/os-Linux/process.c b/arch/um/os-Linux/process.c
index d261888f39c4..8176b0b52047 100644
--- a/arch/um/os-Linux/process.c
+++ b/arch/um/os-Linux/process.c
@@ -11,6 +11,7 @@
11#include <linux/unistd.h> 11#include <linux/unistd.h>
12#include <sys/mman.h> 12#include <sys/mman.h>
13#include <sys/wait.h> 13#include <sys/wait.h>
14#include <sys/mman.h>
14#include "ptrace_user.h" 15#include "ptrace_user.h"
15#include "os.h" 16#include "os.h"
16#include "user.h" 17#include "user.h"
@@ -20,6 +21,7 @@
20#include "kern_util.h" 21#include "kern_util.h"
21#include "longjmp.h" 22#include "longjmp.h"
22#include "skas_ptrace.h" 23#include "skas_ptrace.h"
24#include "kern_constants.h"
23 25
24#define ARBITRARY_ADDR -1 26#define ARBITRARY_ADDR -1
25#define FAILURE_PID -1 27#define FAILURE_PID -1
@@ -187,6 +189,48 @@ int os_unmap_memory(void *addr, int len)
187 return(0); 189 return(0);
188} 190}
189 191
192#ifndef MADV_REMOVE
193#define MADV_REMOVE 0x5 /* remove these pages & resources */
194#endif
195
196int os_drop_memory(void *addr, int length)
197{
198 int err;
199
200 err = madvise(addr, length, MADV_REMOVE);
201 if(err < 0)
202 err = -errno;
203 return err;
204}
205
206int can_drop_memory(void)
207{
208 void *addr;
209 int fd;
210
211 printk("Checking host MADV_REMOVE support...");
212 fd = create_mem_file(UM_KERN_PAGE_SIZE);
213 if(fd < 0){
214 printk("Creating test memory file failed, err = %d\n", -fd);
215 return 0;
216 }
217
218 addr = mmap64(NULL, UM_KERN_PAGE_SIZE, PROT_READ | PROT_WRITE,
219 MAP_PRIVATE, fd, 0);
220 if(addr == MAP_FAILED){
221 printk("Mapping test memory file failed, err = %d\n", -errno);
222 return 0;
223 }
224
225 if(madvise(addr, UM_KERN_PAGE_SIZE, MADV_REMOVE) != 0){
226 printk("MADV_REMOVE failed, err = %d\n", -errno);
227 return 0;
228 }
229
230 printk("OK\n");
231 return 1;
232}
233
190void init_new_thread_stack(void *sig_stack, void (*usr1_handler)(int)) 234void init_new_thread_stack(void *sig_stack, void (*usr1_handler)(int))
191{ 235{
192 int flags = 0, pages; 236 int flags = 0, pages;
diff --git a/arch/um/kernel/sigio_user.c b/arch/um/os-Linux/sigio.c
index f7b18e157d35..9ba942947146 100644
--- a/arch/um/kernel/sigio_user.c
+++ b/arch/um/os-Linux/sigio.c
@@ -1,4 +1,4 @@
1/* 1/*
2 * Copyright (C) 2002 Jeff Dike (jdike@karaya.com) 2 * Copyright (C) 2002 Jeff Dike (jdike@karaya.com)
3 * Licensed under the GPL 3 * Licensed under the GPL
4 */ 4 */
@@ -20,128 +20,7 @@
20#include "sigio.h" 20#include "sigio.h"
21#include "os.h" 21#include "os.h"
22 22
23/* Changed during early boot */ 23/* Protected by sigio_lock(), also used by sigio_cleanup, which is an
24int pty_output_sigio = 0;
25int pty_close_sigio = 0;
26
27/* Used as a flag during SIGIO testing early in boot */
28static volatile int got_sigio = 0;
29
30void __init handler(int sig)
31{
32 got_sigio = 1;
33}
34
35struct openpty_arg {
36 int master;
37 int slave;
38 int err;
39};
40
41static void openpty_cb(void *arg)
42{
43 struct openpty_arg *info = arg;
44
45 info->err = 0;
46 if(openpty(&info->master, &info->slave, NULL, NULL, NULL))
47 info->err = -errno;
48}
49
50void __init check_one_sigio(void (*proc)(int, int))
51{
52 struct sigaction old, new;
53 struct openpty_arg pty = { .master = -1, .slave = -1 };
54 int master, slave, err;
55
56 initial_thread_cb(openpty_cb, &pty);
57 if(pty.err){
58 printk("openpty failed, errno = %d\n", -pty.err);
59 return;
60 }
61
62 master = pty.master;
63 slave = pty.slave;
64
65 if((master == -1) || (slave == -1)){
66 printk("openpty failed to allocate a pty\n");
67 return;
68 }
69
70 /* Not now, but complain so we now where we failed. */
71 err = raw(master);
72 if (err < 0)
73 panic("check_sigio : __raw failed, errno = %d\n", -err);
74
75 err = os_sigio_async(master, slave);
76 if(err < 0)
77 panic("tty_fds : sigio_async failed, err = %d\n", -err);
78
79 if(sigaction(SIGIO, NULL, &old) < 0)
80 panic("check_sigio : sigaction 1 failed, errno = %d\n", errno);
81 new = old;
82 new.sa_handler = handler;
83 if(sigaction(SIGIO, &new, NULL) < 0)
84 panic("check_sigio : sigaction 2 failed, errno = %d\n", errno);
85
86 got_sigio = 0;
87 (*proc)(master, slave);
88
89 os_close_file(master);
90 os_close_file(slave);
91
92 if(sigaction(SIGIO, &old, NULL) < 0)
93 panic("check_sigio : sigaction 3 failed, errno = %d\n", errno);
94}
95
96static void tty_output(int master, int slave)
97{
98 int n;
99 char buf[512];
100
101 printk("Checking that host ptys support output SIGIO...");
102
103 memset(buf, 0, sizeof(buf));
104
105 while(os_write_file(master, buf, sizeof(buf)) > 0) ;
106 if(errno != EAGAIN)
107 panic("check_sigio : write failed, errno = %d\n", errno);
108 while(((n = os_read_file(slave, buf, sizeof(buf))) > 0) && !got_sigio) ;
109
110 if (got_sigio) {
111 printk("Yes\n");
112 pty_output_sigio = 1;
113 } else if (n == -EAGAIN) {
114 printk("No, enabling workaround\n");
115 } else {
116 panic("check_sigio : read failed, err = %d\n", n);
117 }
118}
119
120static void tty_close(int master, int slave)
121{
122 printk("Checking that host ptys support SIGIO on close...");
123
124 os_close_file(slave);
125 if(got_sigio){
126 printk("Yes\n");
127 pty_close_sigio = 1;
128 }
129 else printk("No, enabling workaround\n");
130}
131
132void __init check_sigio(void)
133{
134 if((os_access("/dev/ptmx", OS_ACC_R_OK) < 0) &&
135 (os_access("/dev/ptyp0", OS_ACC_R_OK) < 0)){
136 printk("No pseudo-terminals available - skipping pty SIGIO "
137 "check\n");
138 return;
139 }
140 check_one_sigio(tty_output);
141 check_one_sigio(tty_close);
142}
143
144/* Protected by sigio_lock(), also used by sigio_cleanup, which is an
145 * exitcall. 24 * exitcall.
146 */ 25 */
147static int write_sigio_pid = -1; 26static int write_sigio_pid = -1;
@@ -150,8 +29,10 @@ static int write_sigio_pid = -1;
150 * the descriptors closed after it is killed. So, it can't see them change. 29 * the descriptors closed after it is killed. So, it can't see them change.
151 * On the UML side, they are changed under the sigio_lock. 30 * On the UML side, they are changed under the sigio_lock.
152 */ 31 */
153static int write_sigio_fds[2] = { -1, -1 }; 32#define SIGIO_FDS_INIT {-1, -1}
154static int sigio_private[2] = { -1, -1 }; 33
34static int write_sigio_fds[2] = SIGIO_FDS_INIT;
35static int sigio_private[2] = SIGIO_FDS_INIT;
155 36
156struct pollfds { 37struct pollfds {
157 struct pollfd *poll; 38 struct pollfd *poll;
@@ -264,13 +145,13 @@ static void update_thread(void)
264 return; 145 return;
265 fail: 146 fail:
266 /* Critical section start */ 147 /* Critical section start */
267 if(write_sigio_pid != -1) 148 if(write_sigio_pid != -1)
268 os_kill_process(write_sigio_pid, 1); 149 os_kill_process(write_sigio_pid, 1);
269 write_sigio_pid = -1; 150 write_sigio_pid = -1;
270 os_close_file(sigio_private[0]); 151 close(sigio_private[0]);
271 os_close_file(sigio_private[1]); 152 close(sigio_private[1]);
272 os_close_file(write_sigio_fds[0]); 153 close(write_sigio_fds[0]);
273 os_close_file(write_sigio_fds[1]); 154 close(write_sigio_fds[1]);
274 /* Critical section end */ 155 /* Critical section end */
275 set_signals(flags); 156 set_signals(flags);
276} 157}
@@ -281,13 +162,13 @@ int add_sigio_fd(int fd, int read)
281 162
282 sigio_lock(); 163 sigio_lock();
283 for(i = 0; i < current_poll.used; i++){ 164 for(i = 0; i < current_poll.used; i++){
284 if(current_poll.poll[i].fd == fd) 165 if(current_poll.poll[i].fd == fd)
285 goto out; 166 goto out;
286 } 167 }
287 168
288 n = current_poll.used + 1; 169 n = current_poll.used + 1;
289 err = need_poll(n); 170 err = need_poll(n);
290 if(err) 171 if(err)
291 goto out; 172 goto out;
292 173
293 for(i = 0; i < current_poll.used; i++) 174 for(i = 0; i < current_poll.used; i++)
@@ -316,7 +197,7 @@ int ignore_sigio_fd(int fd)
316 } 197 }
317 if(i == current_poll.used) 198 if(i == current_poll.used)
318 goto out; 199 goto out;
319 200
320 err = need_poll(current_poll.used - 1); 201 err = need_poll(current_poll.used - 1);
321 if(err) 202 if(err)
322 goto out; 203 goto out;
@@ -337,7 +218,7 @@ int ignore_sigio_fd(int fd)
337 return(err); 218 return(err);
338} 219}
339 220
340static struct pollfd* setup_initial_poll(int fd) 221static struct pollfd *setup_initial_poll(int fd)
341{ 222{
342 struct pollfd *p; 223 struct pollfd *p;
343 224
@@ -377,7 +258,7 @@ void write_sigio_workaround(void)
377 } 258 }
378 err = os_pipe(l_sigio_private, 1, 1); 259 err = os_pipe(l_sigio_private, 1, 1);
379 if(err < 0){ 260 if(err < 0){
380 printk("write_sigio_workaround - os_pipe 1 failed, " 261 printk("write_sigio_workaround - os_pipe 2 failed, "
381 "err = %d\n", -err); 262 "err = %d\n", -err);
382 goto out_close1; 263 goto out_close1;
383 } 264 }
@@ -391,76 +272,52 @@ void write_sigio_workaround(void)
391 /* Did we race? Don't try to optimize this, please, it's not so likely 272 /* Did we race? Don't try to optimize this, please, it's not so likely
392 * to happen, and no more than once at the boot. */ 273 * to happen, and no more than once at the boot. */
393 if(write_sigio_pid != -1) 274 if(write_sigio_pid != -1)
394 goto out_unlock; 275 goto out_free;
395 276
396 write_sigio_pid = run_helper_thread(write_sigio_thread, NULL, 277 current_poll = ((struct pollfds) { .poll = p,
397 CLONE_FILES | CLONE_VM, &stack, 0); 278 .used = 1,
398 279 .size = 1 });
399 if (write_sigio_pid < 0)
400 goto out_clear;
401 280
402 if (write_sigio_irq(l_write_sigio_fds[0])) 281 if (write_sigio_irq(l_write_sigio_fds[0]))
403 goto out_kill; 282 goto out_clear_poll;
404 283
405 /* Success, finally. */
406 memcpy(write_sigio_fds, l_write_sigio_fds, sizeof(l_write_sigio_fds)); 284 memcpy(write_sigio_fds, l_write_sigio_fds, sizeof(l_write_sigio_fds));
407 memcpy(sigio_private, l_sigio_private, sizeof(l_sigio_private)); 285 memcpy(sigio_private, l_sigio_private, sizeof(l_sigio_private));
408 286
409 current_poll = ((struct pollfds) { .poll = p, 287 write_sigio_pid = run_helper_thread(write_sigio_thread, NULL,
410 .used = 1, 288 CLONE_FILES | CLONE_VM, &stack, 0);
411 .size = 1 });
412 289
413 sigio_unlock(); 290 if (write_sigio_pid < 0)
414 return; 291 goto out_clear;
415 292
416 out_kill:
417 l_write_sigio_pid = write_sigio_pid;
418 write_sigio_pid = -1;
419 sigio_unlock(); 293 sigio_unlock();
420 /* Going to call waitpid, avoid holding the lock. */ 294 return;
421 os_kill_process(l_write_sigio_pid, 1);
422 goto out_free;
423 295
424 out_clear: 296out_clear:
425 write_sigio_pid = -1; 297 write_sigio_pid = -1;
426 out_unlock: 298 write_sigio_fds[0] = -1;
427 sigio_unlock(); 299 write_sigio_fds[1] = -1;
428 out_free: 300 sigio_private[0] = -1;
301 sigio_private[1] = -1;
302out_clear_poll:
303 current_poll = ((struct pollfds) { .poll = NULL,
304 .size = 0,
305 .used = 0 });
306out_free:
429 kfree(p); 307 kfree(p);
430 out_close2: 308 sigio_unlock();
431 os_close_file(l_sigio_private[0]); 309out_close2:
432 os_close_file(l_sigio_private[1]); 310 close(l_sigio_private[0]);
433 out_close1: 311 close(l_sigio_private[1]);
434 os_close_file(l_write_sigio_fds[0]); 312out_close1:
435 os_close_file(l_write_sigio_fds[1]); 313 close(l_write_sigio_fds[0]);
436 return; 314 close(l_write_sigio_fds[1]);
437}
438
439int read_sigio_fd(int fd)
440{
441 int n;
442 char c;
443
444 n = os_read_file(fd, &c, sizeof(c));
445 if(n != sizeof(c)){
446 if(n < 0) {
447 printk("read_sigio_fd - read failed, err = %d\n", -n);
448 return(n);
449 }
450 else {
451 printk("read_sigio_fd - short read, bytes = %d\n", n);
452 return(-EIO);
453 }
454 }
455 return(n);
456} 315}
457 316
458static void sigio_cleanup(void) 317void sigio_cleanup(void)
459{ 318{
460 if (write_sigio_pid != -1) { 319 if(write_sigio_pid != -1){
461 os_kill_process(write_sigio_pid, 1); 320 os_kill_process(write_sigio_pid, 1);
462 write_sigio_pid = -1; 321 write_sigio_pid = -1;
463 } 322 }
464} 323}
465
466__uml_exitcall(sigio_cleanup);
diff --git a/arch/um/os-Linux/start_up.c b/arch/um/os-Linux/start_up.c
index 829d6b0d8b02..387e26af301a 100644
--- a/arch/um/os-Linux/start_up.c
+++ b/arch/um/os-Linux/start_up.c
@@ -3,6 +3,7 @@
3 * Licensed under the GPL 3 * Licensed under the GPL
4 */ 4 */
5 5
6#include <pty.h>
6#include <stdio.h> 7#include <stdio.h>
7#include <stddef.h> 8#include <stddef.h>
8#include <stdarg.h> 9#include <stdarg.h>
@@ -469,25 +470,6 @@ int can_do_skas(void)
469} 470}
470#endif 471#endif
471 472
472int have_devanon = 0;
473
474/* Runs on boot kernel stack - already safe to use printk. */
475
476void check_devanon(void)
477{
478 int fd;
479
480 printk("Checking for /dev/anon on the host...");
481 fd = open("/dev/anon", O_RDWR);
482 if(fd < 0){
483 printk("Not available (open failed with errno %d)\n", errno);
484 return;
485 }
486
487 printk("OK\n");
488 have_devanon = 1;
489}
490
491int __init parse_iomem(char *str, int *add) 473int __init parse_iomem(char *str, int *add)
492{ 474{
493 struct iomem_region *new; 475 struct iomem_region *new;
@@ -539,3 +521,129 @@ int __init parse_iomem(char *str, int *add)
539 return(1); 521 return(1);
540} 522}
541 523
524
525/* Changed during early boot */
526int pty_output_sigio = 0;
527int pty_close_sigio = 0;
528
529/* Used as a flag during SIGIO testing early in boot */
530static volatile int got_sigio = 0;
531
532static void __init handler(int sig)
533{
534 got_sigio = 1;
535}
536
537struct openpty_arg {
538 int master;
539 int slave;
540 int err;
541};
542
543static void openpty_cb(void *arg)
544{
545 struct openpty_arg *info = arg;
546
547 info->err = 0;
548 if(openpty(&info->master, &info->slave, NULL, NULL, NULL))
549 info->err = -errno;
550}
551
552static void __init check_one_sigio(void (*proc)(int, int))
553{
554 struct sigaction old, new;
555 struct openpty_arg pty = { .master = -1, .slave = -1 };
556 int master, slave, err;
557
558 initial_thread_cb(openpty_cb, &pty);
559 if(pty.err){
560 printk("openpty failed, errno = %d\n", -pty.err);
561 return;
562 }
563
564 master = pty.master;
565 slave = pty.slave;
566
567 if((master == -1) || (slave == -1)){
568 printk("openpty failed to allocate a pty\n");
569 return;
570 }
571
572 /* Not now, but complain so we now where we failed. */
573 err = raw(master);
574 if (err < 0)
575 panic("check_sigio : __raw failed, errno = %d\n", -err);
576
577 err = os_sigio_async(master, slave);
578 if(err < 0)
579 panic("tty_fds : sigio_async failed, err = %d\n", -err);
580
581 if(sigaction(SIGIO, NULL, &old) < 0)
582 panic("check_sigio : sigaction 1 failed, errno = %d\n", errno);
583 new = old;
584 new.sa_handler = handler;
585 if(sigaction(SIGIO, &new, NULL) < 0)
586 panic("check_sigio : sigaction 2 failed, errno = %d\n", errno);
587
588 got_sigio = 0;
589 (*proc)(master, slave);
590
591 close(master);
592 close(slave);
593
594 if(sigaction(SIGIO, &old, NULL) < 0)
595 panic("check_sigio : sigaction 3 failed, errno = %d\n", errno);
596}
597
598static void tty_output(int master, int slave)
599{
600 int n;
601 char buf[512];
602
603 printk("Checking that host ptys support output SIGIO...");
604
605 memset(buf, 0, sizeof(buf));
606
607 while(os_write_file(master, buf, sizeof(buf)) > 0) ;
608 if(errno != EAGAIN)
609 panic("check_sigio : write failed, errno = %d\n", errno);
610 while(((n = os_read_file(slave, buf, sizeof(buf))) > 0) && !got_sigio) ;
611
612 if(got_sigio){
613 printk("Yes\n");
614 pty_output_sigio = 1;
615 }
616 else if(n == -EAGAIN) printk("No, enabling workaround\n");
617 else panic("check_sigio : read failed, err = %d\n", n);
618}
619
620static void tty_close(int master, int slave)
621{
622 printk("Checking that host ptys support SIGIO on close...");
623
624 close(slave);
625 if(got_sigio){
626 printk("Yes\n");
627 pty_close_sigio = 1;
628 }
629 else printk("No, enabling workaround\n");
630}
631
632void __init check_sigio(void)
633{
634 if((os_access("/dev/ptmx", OS_ACC_R_OK) < 0) &&
635 (os_access("/dev/ptyp0", OS_ACC_R_OK) < 0)){
636 printk("No pseudo-terminals available - skipping pty SIGIO "
637 "check\n");
638 return;
639 }
640 check_one_sigio(tty_output);
641 check_one_sigio(tty_close);
642}
643
644void os_check_bugs(void)
645{
646 check_ptrace();
647 check_sigio();
648}
649
diff --git a/arch/um/os-Linux/sys-i386/Makefile b/arch/um/os-Linux/sys-i386/Makefile
index 340ef26f5944..b3213613c41c 100644
--- a/arch/um/os-Linux/sys-i386/Makefile
+++ b/arch/um/os-Linux/sys-i386/Makefile
@@ -3,7 +3,7 @@
3# Licensed under the GPL 3# Licensed under the GPL
4# 4#
5 5
6obj-$(CONFIG_MODE_SKAS) = registers.o 6obj-$(CONFIG_MODE_SKAS) = registers.o tls.o
7 7
8USER_OBJS := $(obj-y) 8USER_OBJS := $(obj-y)
9 9
diff --git a/arch/um/os-Linux/sys-i386/tls.c b/arch/um/os-Linux/sys-i386/tls.c
new file mode 100644
index 000000000000..ba21f0e04a2f
--- /dev/null
+++ b/arch/um/os-Linux/sys-i386/tls.c
@@ -0,0 +1,33 @@
1#include <linux/unistd.h>
2#include "sysdep/tls.h"
3#include "user_util.h"
4
5static _syscall1(int, get_thread_area, user_desc_t *, u_info);
6
7/* Checks whether host supports TLS, and sets *tls_min according to the value
8 * valid on the host.
9 * i386 host have it == 6; x86_64 host have it == 12, for i386 emulation. */
10void check_host_supports_tls(int *supports_tls, int *tls_min) {
11 /* Values for x86 and x86_64.*/
12 int val[] = {GDT_ENTRY_TLS_MIN_I386, GDT_ENTRY_TLS_MIN_X86_64};
13 int i;
14
15 for (i = 0; i < ARRAY_SIZE(val); i++) {
16 user_desc_t info;
17 info.entry_number = val[i];
18
19 if (get_thread_area(&info) == 0) {
20 *tls_min = val[i];
21 *supports_tls = 1;
22 return;
23 } else {
24 if (errno == EINVAL)
25 continue;
26 else if (errno == ENOSYS)
27 *supports_tls = 0;
28 return;
29 }
30 }
31
32 *supports_tls = 0;
33}
diff --git a/arch/um/os-Linux/tls.c b/arch/um/os-Linux/tls.c
new file mode 100644
index 000000000000..9cb09a45546b
--- /dev/null
+++ b/arch/um/os-Linux/tls.c
@@ -0,0 +1,76 @@
1#include <errno.h>
2#include <sys/ptrace.h>
3#include <asm/ldt.h>
4#include "sysdep/tls.h"
5#include "uml-config.h"
6
7/* TLS support - we basically rely on the host's one.*/
8
9/* In TT mode, this should be called only by the tracing thread, and makes sense
10 * only for PTRACE_SET_THREAD_AREA. In SKAS mode, it's used normally.
11 *
12 */
13
14#ifndef PTRACE_GET_THREAD_AREA
15#define PTRACE_GET_THREAD_AREA 25
16#endif
17
18#ifndef PTRACE_SET_THREAD_AREA
19#define PTRACE_SET_THREAD_AREA 26
20#endif
21
22int os_set_thread_area(user_desc_t *info, int pid)
23{
24 int ret;
25
26 ret = ptrace(PTRACE_SET_THREAD_AREA, pid, info->entry_number,
27 (unsigned long) info);
28 if (ret < 0)
29 ret = -errno;
30 return ret;
31}
32
33#ifdef UML_CONFIG_MODE_SKAS
34
35int os_get_thread_area(user_desc_t *info, int pid)
36{
37 int ret;
38
39 ret = ptrace(PTRACE_GET_THREAD_AREA, pid, info->entry_number,
40 (unsigned long) info);
41 if (ret < 0)
42 ret = -errno;
43 return ret;
44}
45
46#endif
47
48#ifdef UML_CONFIG_MODE_TT
49#include "linux/unistd.h"
50
51static _syscall1(int, get_thread_area, user_desc_t *, u_info);
52static _syscall1(int, set_thread_area, user_desc_t *, u_info);
53
54int do_set_thread_area_tt(user_desc_t *info)
55{
56 int ret;
57
58 ret = set_thread_area(info);
59 if (ret < 0) {
60 ret = -errno;
61 }
62 return ret;
63}
64
65int do_get_thread_area_tt(user_desc_t *info)
66{
67 int ret;
68
69 ret = get_thread_area(info);
70 if (ret < 0) {
71 ret = -errno;
72 }
73 return ret;
74}
75
76#endif /* UML_CONFIG_MODE_TT */
diff --git a/arch/um/os-Linux/tt.c b/arch/um/os-Linux/tt.c
index 919d19f11537..5461a065bbb9 100644
--- a/arch/um/os-Linux/tt.c
+++ b/arch/um/os-Linux/tt.c
@@ -110,6 +110,16 @@ int wait_for_stop(int pid, int sig, int cont_type, void *relay)
110 } 110 }
111} 111}
112 112
113void forward_ipi(int fd, int pid)
114{
115 int err;
116
117 err = os_set_owner(fd, pid);
118 if(err < 0)
119 printk("forward_ipi: set_owner failed, fd = %d, me = %d, "
120 "target = %d, err = %d\n", fd, os_getpid(), pid, -err);
121}
122
113/* 123/*
114 *------------------------- 124 *-------------------------
115 * only for tt mode (will be deleted in future...) 125 * only for tt mode (will be deleted in future...)
diff --git a/arch/um/kernel/tty_log.c b/arch/um/os-Linux/tty_log.c
index 9ada656f68ce..c6ba56c1560f 100644
--- a/arch/um/kernel/tty_log.c
+++ b/arch/um/os-Linux/tty_log.c
@@ -1,5 +1,5 @@
1/* 1/*
2 * Copyright (C) 2002 Jeff Dike (jdike@karaya.com) and 2 * Copyright (C) 2002 Jeff Dike (jdike@karaya.com) and
3 * geoffrey hing <ghing@net.ohio-state.edu> 3 * geoffrey hing <ghing@net.ohio-state.edu>
4 * Licensed under the GPL 4 * Licensed under the GPL
5 */ 5 */
@@ -58,7 +58,7 @@ int open_tty_log(void *tty, void *current_tty)
58 return(tty_log_fd); 58 return(tty_log_fd);
59 } 59 }
60 60
61 sprintf(buf, "%s/%0u-%0u", tty_log_dir, (unsigned int) tv.tv_sec, 61 sprintf(buf, "%s/%0u-%0u", tty_log_dir, (unsigned int) tv.tv_sec,
62 (unsigned int) tv.tv_usec); 62 (unsigned int) tv.tv_usec);
63 63
64 fd = os_open_file(buf, of_append(of_create(of_rdwr(OPENFLAGS()))), 64 fd = os_open_file(buf, of_append(of_create(of_rdwr(OPENFLAGS()))),
@@ -216,15 +216,3 @@ __uml_setup("tty_log_fd=", set_tty_log_fd,
216" tty data will be written. Preconfigure the descriptor with something\n" 216" tty data will be written. Preconfigure the descriptor with something\n"
217" like '10>tty_log tty_log_fd=10'.\n\n" 217" like '10>tty_log tty_log_fd=10'.\n\n"
218); 218);
219
220
221/*
222 * Overrides for Emacs so that we follow Linus's tabbing style.
223 * Emacs will notice this stuff at the end of the file and automatically
224 * adjust the settings for this buffer only. This must remain at the end
225 * of the file.
226 * ---------------------------------------------------------------------------
227 * Local variables:
228 * c-file-style: "linux"
229 * End:
230 */
diff --git a/arch/um/os-Linux/umid.c b/arch/um/os-Linux/umid.c
index ecf107ae5ac8..198e59163288 100644
--- a/arch/um/os-Linux/umid.c
+++ b/arch/um/os-Linux/umid.c
@@ -143,8 +143,10 @@ static int not_dead_yet(char *dir)
143 goto out_close; 143 goto out_close;
144 } 144 }
145 145
146 if((kill(p, 0) == 0) || (errno != ESRCH)) 146 if((kill(p, 0) == 0) || (errno != ESRCH)){
147 printk("umid \"%s\" is already in use by pid %d\n", umid, p);
147 return 1; 148 return 1;
149 }
148 150
149 err = actually_do_remove(dir); 151 err = actually_do_remove(dir);
150 if(err) 152 if(err)
@@ -234,33 +236,44 @@ int __init make_umid(void)
234 err = mkdir(tmp, 0777); 236 err = mkdir(tmp, 0777);
235 if(err < 0){ 237 if(err < 0){
236 err = -errno; 238 err = -errno;
237 if(errno != EEXIST) 239 if(err != -EEXIST)
238 goto err; 240 goto err;
239 241
240 if(not_dead_yet(tmp) < 0) 242 /* 1 -> this umid is already in use
243 * < 0 -> we couldn't remove the umid directory
244 * In either case, we can't use this umid, so return -EEXIST.
245 */
246 if(not_dead_yet(tmp) != 0)
241 goto err; 247 goto err;
242 248
243 err = mkdir(tmp, 0777); 249 err = mkdir(tmp, 0777);
244 } 250 }
245 if(err < 0){ 251 if(err){
246 printk("Failed to create '%s' - err = %d\n", umid, err); 252 err = -errno;
247 goto err_rmdir; 253 printk("Failed to create '%s' - err = %d\n", umid, -errno);
254 goto err;
248 } 255 }
249 256
250 umid_setup = 1; 257 umid_setup = 1;
251 258
252 create_pid_file(); 259 create_pid_file();
253 260
254 return 0; 261 err = 0;
255
256 err_rmdir:
257 rmdir(tmp);
258 err: 262 err:
259 return err; 263 return err;
260} 264}
261 265
262static int __init make_umid_init(void) 266static int __init make_umid_init(void)
263{ 267{
268 if(!make_umid())
269 return 0;
270
271 /* If initializing with the given umid failed, then try again with
272 * a random one.
273 */
274 printk("Failed to initialize umid \"%s\", trying with a random umid\n",
275 umid);
276 *umid = '\0';
264 make_umid(); 277 make_umid();
265 278
266 return 0; 279 return 0;
diff --git a/arch/um/scripts/Makefile.rules b/arch/um/scripts/Makefile.rules
index 2e41cabd3d93..b696b451774c 100644
--- a/arch/um/scripts/Makefile.rules
+++ b/arch/um/scripts/Makefile.rules
@@ -20,25 +20,7 @@ define unprofile
20 $(patsubst -pg,,$(patsubst -fprofile-arcs -ftest-coverage,,$(1))) 20 $(patsubst -pg,,$(patsubst -fprofile-arcs -ftest-coverage,,$(1)))
21endef 21endef
22 22
23 23ifdef subarch-obj-y
24# cmd_make_link checks to see if the $(foo-dir) variable starts with a /. If 24obj-y += subarch.o
25# so, it's considered to be a path relative to $(srcdir) rather than 25subarch-y = $(addprefix ../../$(SUBARCH)/,$(subarch-obj-y))
26# $(srcdir)/arch/$(SUBARCH). This is because x86_64 wants to get ldt.c from 26endif
27# arch/um/sys-i386 rather than arch/i386 like the other borrowed files. So,
28# it sets $(ldt.c-dir) to /arch/um/sys-i386.
29quiet_cmd_make_link = SYMLINK $@
30cmd_make_link = rm -f $@; ln -sf $(srctree)$(if $(filter-out /%,$($(notdir $@)-dir)),/arch/$(SUBARCH))/$($(notdir $@)-dir)/$(notdir $@) $@
31
32# this needs to be before the foreach, because targets does not accept
33# complete paths like $(obj)/$(f). To make sure this works, use a := assignment
34# or we will get $(obj)/$(f) in the "targets" value.
35# Also, this forces you to use the := syntax when assigning to targets.
36# Otherwise the line below will cause an infinite loop (if you don't know why,
37# just do it).
38
39targets := $(targets) $(SYMLINKS)
40
41SYMLINKS := $(foreach f,$(SYMLINKS),$(obj)/$(f))
42
43$(SYMLINKS): FORCE
44 $(call if_changed,make_link)
diff --git a/arch/um/scripts/Makefile.unmap b/arch/um/scripts/Makefile.unmap
deleted file mode 100644
index b2165188d942..000000000000
--- a/arch/um/scripts/Makefile.unmap
+++ /dev/null
@@ -1,22 +0,0 @@
1clean-files += unmap_tmp.o unmap_fin.o unmap.o
2
3ifdef CONFIG_MODE_TT
4
5#Always build unmap_fin.o
6extra-y += unmap_fin.o
7#Do dependency tracking for unmap.o (it will be always built, but won't get the tracking unless we use this).
8targets += unmap.o
9
10#XXX: partially copied from arch/um/scripts/Makefile.rules
11$(obj)/unmap.o: _c_flags = $(call unprofile,$(CFLAGS))
12
13quiet_cmd_wrapld = LD $@
14define cmd_wrapld
15 $(LD) $(LDFLAGS) -r -o $(obj)/unmap_tmp.o $< ; \
16 $(OBJCOPY) $(UML_OBJCOPYFLAGS) $(obj)/unmap_tmp.o $@ -G switcheroo
17endef
18
19$(obj)/unmap_fin.o : $(obj)/unmap.o FORCE
20 $(call if_changed,wrapld)
21
22endif
diff --git a/arch/um/sys-i386/Makefile b/arch/um/sys-i386/Makefile
index f5fd5b0156d0..98b20b7bba4f 100644
--- a/arch/um/sys-i386/Makefile
+++ b/arch/um/sys-i386/Makefile
@@ -1,23 +1,18 @@
1obj-y := bitops.o bugs.o checksum.o delay.o fault.o ksyms.o ldt.o ptrace.o \ 1obj-y = bugs.o checksum.o delay.o fault.o ksyms.o ldt.o ptrace.o \
2 ptrace_user.o semaphore.o signal.o sigcontext.o syscalls.o sysrq.o \ 2 ptrace_user.o signal.o sigcontext.o syscalls.o sysrq.o \
3 sys_call_table.o 3 sys_call_table.o tls.o
4 4
5obj-$(CONFIG_MODE_SKAS) += stub.o stub_segv.o 5obj-$(CONFIG_MODE_SKAS) += stub.o stub_segv.o
6 6
7obj-$(CONFIG_HIGHMEM) += highmem.o 7subarch-obj-y = lib/bitops.o kernel/semaphore.o
8obj-$(CONFIG_MODULES) += module.o 8subarch-obj-$(CONFIG_HIGHMEM) += mm/highmem.o
9subarch-obj-$(CONFIG_MODULES) += kernel/module.o
9 10
10USER_OBJS := bugs.o ptrace_user.o sigcontext.o fault.o stub_segv.o 11USER_OBJS := bugs.o ptrace_user.o sigcontext.o fault.o stub_segv.o
11 12
12SYMLINKS = bitops.c semaphore.c highmem.c module.c
13
14include arch/um/scripts/Makefile.rules 13include arch/um/scripts/Makefile.rules
15 14
16bitops.c-dir = lib 15extra-$(CONFIG_MODE_TT) += unmap.o
17semaphore.c-dir = kernel
18highmem.c-dir = mm
19module.c-dir = kernel
20
21$(obj)/stub_segv.o : _c_flags = $(call unprofile,$(CFLAGS))
22 16
23include arch/um/scripts/Makefile.unmap 17$(obj)/stub_segv.o $(obj)/unmap.o: \
18 _c_flags = $(call unprofile,$(CFLAGS))
diff --git a/arch/um/sys-i386/ptrace.c b/arch/um/sys-i386/ptrace.c
index e839ce65ad28..6028bc7cc01b 100644
--- a/arch/um/sys-i386/ptrace.c
+++ b/arch/um/sys-i386/ptrace.c
@@ -6,6 +6,7 @@
6#include <linux/config.h> 6#include <linux/config.h>
7#include <linux/compiler.h> 7#include <linux/compiler.h>
8#include "linux/sched.h" 8#include "linux/sched.h"
9#include "linux/mm.h"
9#include "asm/elf.h" 10#include "asm/elf.h"
10#include "asm/ptrace.h" 11#include "asm/ptrace.h"
11#include "asm/uaccess.h" 12#include "asm/uaccess.h"
@@ -14,9 +15,22 @@
14#include "sysdep/sigcontext.h" 15#include "sysdep/sigcontext.h"
15#include "sysdep/sc.h" 16#include "sysdep/sc.h"
16 17
17void arch_switch(void) 18void arch_switch_to_tt(struct task_struct *from, struct task_struct *to)
18{ 19{
19 update_debugregs(current->thread.arch.debugregs_seq); 20 update_debugregs(to->thread.arch.debugregs_seq);
21 arch_switch_tls_tt(from, to);
22}
23
24void arch_switch_to_skas(struct task_struct *from, struct task_struct *to)
25{
26 int err = arch_switch_tls_skas(from, to);
27 if (!err)
28 return;
29
30 if (err != -EINVAL)
31 printk(KERN_WARNING "arch_switch_tls_skas failed, errno %d, not EINVAL\n", -err);
32 else
33 printk(KERN_WARNING "arch_switch_tls_skas failed, errno = EINVAL\n");
20} 34}
21 35
22int is_syscall(unsigned long addr) 36int is_syscall(unsigned long addr)
@@ -26,9 +40,17 @@ int is_syscall(unsigned long addr)
26 40
27 n = copy_from_user(&instr, (void __user *) addr, sizeof(instr)); 41 n = copy_from_user(&instr, (void __user *) addr, sizeof(instr));
28 if(n){ 42 if(n){
29 printk("is_syscall : failed to read instruction from 0x%lx\n", 43 /* access_process_vm() grants access to vsyscall and stub,
30 addr); 44 * while copy_from_user doesn't. Maybe access_process_vm is
31 return(0); 45 * slow, but that doesn't matter, since it will be called only
46 * in case of singlestepping, if copy_from_user failed.
47 */
48 n = access_process_vm(current, addr, &instr, sizeof(instr), 0);
49 if(n != sizeof(instr)) {
50 printk("is_syscall : failed to read instruction from "
51 "0x%lx\n", addr);
52 return(1);
53 }
32 } 54 }
33 /* int 0x80 or sysenter */ 55 /* int 0x80 or sysenter */
34 return((instr == 0x80cd) || (instr == 0x340f)); 56 return((instr == 0x80cd) || (instr == 0x340f));
@@ -115,22 +137,22 @@ unsigned long getreg(struct task_struct *child, int regno)
115int peek_user(struct task_struct *child, long addr, long data) 137int peek_user(struct task_struct *child, long addr, long data)
116{ 138{
117/* read the word at location addr in the USER area. */ 139/* read the word at location addr in the USER area. */
118 unsigned long tmp; 140 unsigned long tmp;
119 141
120 if ((addr & 3) || addr < 0) 142 if ((addr & 3) || addr < 0)
121 return -EIO; 143 return -EIO;
122 144
123 tmp = 0; /* Default return condition */ 145 tmp = 0; /* Default return condition */
124 if(addr < MAX_REG_OFFSET){ 146 if(addr < MAX_REG_OFFSET){
125 tmp = getreg(child, addr); 147 tmp = getreg(child, addr);
126 } 148 }
127 else if((addr >= offsetof(struct user, u_debugreg[0])) && 149 else if((addr >= offsetof(struct user, u_debugreg[0])) &&
128 (addr <= offsetof(struct user, u_debugreg[7]))){ 150 (addr <= offsetof(struct user, u_debugreg[7]))){
129 addr -= offsetof(struct user, u_debugreg[0]); 151 addr -= offsetof(struct user, u_debugreg[0]);
130 addr = addr >> 2; 152 addr = addr >> 2;
131 tmp = child->thread.arch.debugregs[addr]; 153 tmp = child->thread.arch.debugregs[addr];
132 } 154 }
133 return put_user(tmp, (unsigned long *) data); 155 return put_user(tmp, (unsigned long __user *) data);
134} 156}
135 157
136struct i387_fxsave_struct { 158struct i387_fxsave_struct {
diff --git a/arch/um/sys-i386/ptrace_user.c b/arch/um/sys-i386/ptrace_user.c
index 7c376c95de50..9f3bd8ed78f5 100644
--- a/arch/um/sys-i386/ptrace_user.c
+++ b/arch/um/sys-i386/ptrace_user.c
@@ -14,6 +14,7 @@
14#include "sysdep/thread.h" 14#include "sysdep/thread.h"
15#include "user.h" 15#include "user.h"
16#include "os.h" 16#include "os.h"
17#include "uml-config.h"
17 18
18int ptrace_getregs(long pid, unsigned long *regs_out) 19int ptrace_getregs(long pid, unsigned long *regs_out)
19{ 20{
@@ -43,6 +44,7 @@ int ptrace_setfpregs(long pid, unsigned long *regs)
43 return 0; 44 return 0;
44} 45}
45 46
47/* All the below stuff is of interest for TT mode only */
46static void write_debugregs(int pid, unsigned long *regs) 48static void write_debugregs(int pid, unsigned long *regs)
47{ 49{
48 struct user *dummy; 50 struct user *dummy;
@@ -75,7 +77,6 @@ static void read_debugregs(int pid, unsigned long *regs)
75 77
76/* Accessed only by the tracing thread */ 78/* Accessed only by the tracing thread */
77static unsigned long kernel_debugregs[8] = { [ 0 ... 7 ] = 0 }; 79static unsigned long kernel_debugregs[8] = { [ 0 ... 7 ] = 0 };
78static int debugregs_seq = 0;
79 80
80void arch_enter_kernel(void *task, int pid) 81void arch_enter_kernel(void *task, int pid)
81{ 82{
@@ -89,6 +90,11 @@ void arch_leave_kernel(void *task, int pid)
89 write_debugregs(pid, TASK_DEBUGREGS(task)); 90 write_debugregs(pid, TASK_DEBUGREGS(task));
90} 91}
91 92
93#ifdef UML_CONFIG_PT_PROXY
94/* Accessed only by the tracing thread */
95static int debugregs_seq;
96
97/* Only called by the ptrace proxy */
92void ptrace_pokeuser(unsigned long addr, unsigned long data) 98void ptrace_pokeuser(unsigned long addr, unsigned long data)
93{ 99{
94 if((addr < offsetof(struct user, u_debugreg[0])) || 100 if((addr < offsetof(struct user, u_debugreg[0])) ||
@@ -109,6 +115,7 @@ static void update_debugregs_cb(void *arg)
109 write_debugregs(pid, kernel_debugregs); 115 write_debugregs(pid, kernel_debugregs);
110} 116}
111 117
118/* Optimized out in its header when not defined */
112void update_debugregs(int seq) 119void update_debugregs(int seq)
113{ 120{
114 int me; 121 int me;
@@ -118,6 +125,7 @@ void update_debugregs(int seq)
118 me = os_getpid(); 125 me = os_getpid();
119 initial_thread_cb(update_debugregs_cb, &me); 126 initial_thread_cb(update_debugregs_cb, &me);
120} 127}
128#endif
121 129
122/* 130/*
123 * Overrides for Emacs so that we follow Linus's tabbing style. 131 * Overrides for Emacs so that we follow Linus's tabbing style.
diff --git a/arch/um/sys-i386/signal.c b/arch/um/sys-i386/signal.c
index 7cd1a82dc8c2..f5d0e1c37ea2 100644
--- a/arch/um/sys-i386/signal.c
+++ b/arch/um/sys-i386/signal.c
@@ -19,7 +19,7 @@
19#include "skas.h" 19#include "skas.h"
20 20
21static int copy_sc_from_user_skas(struct pt_regs *regs, 21static int copy_sc_from_user_skas(struct pt_regs *regs,
22 struct sigcontext *from) 22 struct sigcontext __user *from)
23{ 23{
24 struct sigcontext sc; 24 struct sigcontext sc;
25 unsigned long fpregs[HOST_FP_SIZE]; 25 unsigned long fpregs[HOST_FP_SIZE];
@@ -57,8 +57,8 @@ static int copy_sc_from_user_skas(struct pt_regs *regs,
57 return(0); 57 return(0);
58} 58}
59 59
60int copy_sc_to_user_skas(struct sigcontext *to, struct _fpstate *to_fp, 60int copy_sc_to_user_skas(struct sigcontext *to, struct _fpstate __user *to_fp,
61 struct pt_regs *regs) 61 struct pt_regs *regs, unsigned long sp)
62{ 62{
63 struct sigcontext sc; 63 struct sigcontext sc;
64 unsigned long fpregs[HOST_FP_SIZE]; 64 unsigned long fpregs[HOST_FP_SIZE];
@@ -72,7 +72,7 @@ int copy_sc_to_user_skas(struct sigcontext *to, struct _fpstate *to_fp,
72 sc.edi = REGS_EDI(regs->regs.skas.regs); 72 sc.edi = REGS_EDI(regs->regs.skas.regs);
73 sc.esi = REGS_ESI(regs->regs.skas.regs); 73 sc.esi = REGS_ESI(regs->regs.skas.regs);
74 sc.ebp = REGS_EBP(regs->regs.skas.regs); 74 sc.ebp = REGS_EBP(regs->regs.skas.regs);
75 sc.esp = REGS_SP(regs->regs.skas.regs); 75 sc.esp = sp;
76 sc.ebx = REGS_EBX(regs->regs.skas.regs); 76 sc.ebx = REGS_EBX(regs->regs.skas.regs);
77 sc.edx = REGS_EDX(regs->regs.skas.regs); 77 sc.edx = REGS_EDX(regs->regs.skas.regs);
78 sc.ecx = REGS_ECX(regs->regs.skas.regs); 78 sc.ecx = REGS_ECX(regs->regs.skas.regs);
@@ -92,7 +92,7 @@ int copy_sc_to_user_skas(struct sigcontext *to, struct _fpstate *to_fp,
92 "errno = %d\n", err); 92 "errno = %d\n", err);
93 return(1); 93 return(1);
94 } 94 }
95 to_fp = (to_fp ? to_fp : (struct _fpstate *) (to + 1)); 95 to_fp = (to_fp ? to_fp : (struct _fpstate __user *) (to + 1));
96 sc.fpstate = to_fp; 96 sc.fpstate = to_fp;
97 97
98 if(err) 98 if(err)
@@ -113,10 +113,11 @@ int copy_sc_to_user_skas(struct sigcontext *to, struct _fpstate *to_fp,
113 * saved pointer is in the kernel, but the sigcontext is in userspace, so we 113 * saved pointer is in the kernel, but the sigcontext is in userspace, so we
114 * copy_to_user it. 114 * copy_to_user it.
115 */ 115 */
116int copy_sc_from_user_tt(struct sigcontext *to, struct sigcontext *from, 116int copy_sc_from_user_tt(struct sigcontext *to, struct sigcontext __user *from,
117 int fpsize) 117 int fpsize)
118{ 118{
119 struct _fpstate *to_fp, *from_fp; 119 struct _fpstate *to_fp;
120 struct _fpstate __user *from_fp;
120 unsigned long sigs; 121 unsigned long sigs;
121 int err; 122 int err;
122 123
@@ -131,20 +132,28 @@ int copy_sc_from_user_tt(struct sigcontext *to, struct sigcontext *from,
131 return(err); 132 return(err);
132} 133}
133 134
134int copy_sc_to_user_tt(struct sigcontext *to, struct _fpstate *fp, 135int copy_sc_to_user_tt(struct sigcontext *to, struct _fpstate __user *fp,
135 struct sigcontext *from, int fpsize) 136 struct sigcontext *from, int fpsize, unsigned long sp)
136{ 137{
137 struct _fpstate *to_fp, *from_fp; 138 struct _fpstate __user *to_fp;
139 struct _fpstate *from_fp;
138 int err; 140 int err;
139 141
140 to_fp = (fp ? fp : (struct _fpstate *) (to + 1)); 142 to_fp = (fp ? fp : (struct _fpstate __user *) (to + 1));
141 from_fp = from->fpstate; 143 from_fp = from->fpstate;
142 err = copy_to_user(to, from, sizeof(*to)); 144 err = copy_to_user(to, from, sizeof(*to));
145
146 /* The SP in the sigcontext is the updated one for the signal
147 * delivery. The sp passed in is the original, and this needs
148 * to be restored, so we stick it in separately.
149 */
150 err |= copy_to_user(&SC_SP(to), sp, sizeof(sp));
151
143 if(from_fp != NULL){ 152 if(from_fp != NULL){
144 err |= copy_to_user(&to->fpstate, &to_fp, sizeof(to->fpstate)); 153 err |= copy_to_user(&to->fpstate, &to_fp, sizeof(to->fpstate));
145 err |= copy_to_user(to_fp, from_fp, fpsize); 154 err |= copy_to_user(to_fp, from_fp, fpsize);
146 } 155 }
147 return(err); 156 return err;
148} 157}
149#endif 158#endif
150 159
@@ -158,15 +167,15 @@ static int copy_sc_from_user(struct pt_regs *to, void __user *from)
158 return(ret); 167 return(ret);
159} 168}
160 169
161static int copy_sc_to_user(struct sigcontext *to, struct _fpstate *fp, 170static int copy_sc_to_user(struct sigcontext *to, struct _fpstate __user *fp,
162 struct pt_regs *from) 171 struct pt_regs *from, unsigned long sp)
163{ 172{
164 return(CHOOSE_MODE(copy_sc_to_user_tt(to, fp, UPT_SC(&from->regs), 173 return(CHOOSE_MODE(copy_sc_to_user_tt(to, fp, UPT_SC(&from->regs),
165 sizeof(*fp)), 174 sizeof(*fp), sp),
166 copy_sc_to_user_skas(to, fp, from))); 175 copy_sc_to_user_skas(to, fp, from, sp)));
167} 176}
168 177
169static int copy_ucontext_to_user(struct ucontext *uc, struct _fpstate *fp, 178static int copy_ucontext_to_user(struct ucontext __user *uc, struct _fpstate __user *fp,
170 sigset_t *set, unsigned long sp) 179 sigset_t *set, unsigned long sp)
171{ 180{
172 int err = 0; 181 int err = 0;
@@ -174,14 +183,14 @@ static int copy_ucontext_to_user(struct ucontext *uc, struct _fpstate *fp,
174 err |= put_user(current->sas_ss_sp, &uc->uc_stack.ss_sp); 183 err |= put_user(current->sas_ss_sp, &uc->uc_stack.ss_sp);
175 err |= put_user(sas_ss_flags(sp), &uc->uc_stack.ss_flags); 184 err |= put_user(sas_ss_flags(sp), &uc->uc_stack.ss_flags);
176 err |= put_user(current->sas_ss_size, &uc->uc_stack.ss_size); 185 err |= put_user(current->sas_ss_size, &uc->uc_stack.ss_size);
177 err |= copy_sc_to_user(&uc->uc_mcontext, fp, &current->thread.regs); 186 err |= copy_sc_to_user(&uc->uc_mcontext, fp, &current->thread.regs, sp);
178 err |= copy_to_user(&uc->uc_sigmask, set, sizeof(*set)); 187 err |= copy_to_user(&uc->uc_sigmask, set, sizeof(*set));
179 return(err); 188 return(err);
180} 189}
181 190
182struct sigframe 191struct sigframe
183{ 192{
184 char *pretcode; 193 char __user *pretcode;
185 int sig; 194 int sig;
186 struct sigcontext sc; 195 struct sigcontext sc;
187 struct _fpstate fpstate; 196 struct _fpstate fpstate;
@@ -191,10 +200,10 @@ struct sigframe
191 200
192struct rt_sigframe 201struct rt_sigframe
193{ 202{
194 char *pretcode; 203 char __user *pretcode;
195 int sig; 204 int sig;
196 struct siginfo *pinfo; 205 struct siginfo __user *pinfo;
197 void *puc; 206 void __user *puc;
198 struct siginfo info; 207 struct siginfo info;
199 struct ucontext uc; 208 struct ucontext uc;
200 struct _fpstate fpstate; 209 struct _fpstate fpstate;
@@ -206,21 +215,32 @@ int setup_signal_stack_sc(unsigned long stack_top, int sig,
206 sigset_t *mask) 215 sigset_t *mask)
207{ 216{
208 struct sigframe __user *frame; 217 struct sigframe __user *frame;
209 void *restorer; 218 void __user *restorer;
219 unsigned long save_sp = PT_REGS_SP(regs);
210 int err = 0; 220 int err = 0;
211 221
212 stack_top &= -8UL; 222 stack_top &= -8UL;
213 frame = (struct sigframe *) stack_top - 1; 223 frame = (struct sigframe __user *) stack_top - 1;
214 if (!access_ok(VERIFY_WRITE, frame, sizeof(*frame))) 224 if (!access_ok(VERIFY_WRITE, frame, sizeof(*frame)))
215 return 1; 225 return 1;
216 226
217 restorer = (void *) frame->retcode; 227 restorer = frame->retcode;
218 if(ka->sa.sa_flags & SA_RESTORER) 228 if(ka->sa.sa_flags & SA_RESTORER)
219 restorer = ka->sa.sa_restorer; 229 restorer = ka->sa.sa_restorer;
220 230
231 /* Update SP now because the page fault handler refuses to extend
232 * the stack if the faulting address is too far below the current
233 * SP, which frame now certainly is. If there's an error, the original
234 * value is restored on the way out.
235 * When writing the sigcontext to the stack, we have to write the
236 * original value, so that's passed to copy_sc_to_user, which does
237 * the right thing with it.
238 */
239 PT_REGS_SP(regs) = (unsigned long) frame;
240
221 err |= __put_user(restorer, &frame->pretcode); 241 err |= __put_user(restorer, &frame->pretcode);
222 err |= __put_user(sig, &frame->sig); 242 err |= __put_user(sig, &frame->sig);
223 err |= copy_sc_to_user(&frame->sc, NULL, regs); 243 err |= copy_sc_to_user(&frame->sc, NULL, regs, save_sp);
224 err |= __put_user(mask->sig[0], &frame->sc.oldmask); 244 err |= __put_user(mask->sig[0], &frame->sc.oldmask);
225 if (_NSIG_WORDS > 1) 245 if (_NSIG_WORDS > 1)
226 err |= __copy_to_user(&frame->extramask, &mask->sig[1], 246 err |= __copy_to_user(&frame->extramask, &mask->sig[1],
@@ -238,7 +258,7 @@ int setup_signal_stack_sc(unsigned long stack_top, int sig,
238 err |= __put_user(0x80cd, (short __user *)(frame->retcode+6)); 258 err |= __put_user(0x80cd, (short __user *)(frame->retcode+6));
239 259
240 if(err) 260 if(err)
241 return(err); 261 goto err;
242 262
243 PT_REGS_SP(regs) = (unsigned long) frame; 263 PT_REGS_SP(regs) = (unsigned long) frame;
244 PT_REGS_IP(regs) = (unsigned long) ka->sa.sa_handler; 264 PT_REGS_IP(regs) = (unsigned long) ka->sa.sa_handler;
@@ -248,7 +268,11 @@ int setup_signal_stack_sc(unsigned long stack_top, int sig,
248 268
249 if ((current->ptrace & PT_DTRACE) && (current->ptrace & PT_PTRACED)) 269 if ((current->ptrace & PT_DTRACE) && (current->ptrace & PT_PTRACED))
250 ptrace_notify(SIGTRAP); 270 ptrace_notify(SIGTRAP);
251 return(0); 271 return 0;
272
273err:
274 PT_REGS_SP(regs) = save_sp;
275 return err;
252} 276}
253 277
254int setup_signal_stack_si(unsigned long stack_top, int sig, 278int setup_signal_stack_si(unsigned long stack_top, int sig,
@@ -256,25 +280,29 @@ int setup_signal_stack_si(unsigned long stack_top, int sig,
256 siginfo_t *info, sigset_t *mask) 280 siginfo_t *info, sigset_t *mask)
257{ 281{
258 struct rt_sigframe __user *frame; 282 struct rt_sigframe __user *frame;
259 void *restorer; 283 void __user *restorer;
284 unsigned long save_sp = PT_REGS_SP(regs);
260 int err = 0; 285 int err = 0;
261 286
262 stack_top &= -8UL; 287 stack_top &= -8UL;
263 frame = (struct rt_sigframe *) stack_top - 1; 288 frame = (struct rt_sigframe __user *) stack_top - 1;
264 if (!access_ok(VERIFY_WRITE, frame, sizeof(*frame))) 289 if (!access_ok(VERIFY_WRITE, frame, sizeof(*frame)))
265 return 1; 290 return 1;
266 291
267 restorer = (void *) frame->retcode; 292 restorer = frame->retcode;
268 if(ka->sa.sa_flags & SA_RESTORER) 293 if(ka->sa.sa_flags & SA_RESTORER)
269 restorer = ka->sa.sa_restorer; 294 restorer = ka->sa.sa_restorer;
270 295
296 /* See comment above about why this is here */
297 PT_REGS_SP(regs) = (unsigned long) frame;
298
271 err |= __put_user(restorer, &frame->pretcode); 299 err |= __put_user(restorer, &frame->pretcode);
272 err |= __put_user(sig, &frame->sig); 300 err |= __put_user(sig, &frame->sig);
273 err |= __put_user(&frame->info, &frame->pinfo); 301 err |= __put_user(&frame->info, &frame->pinfo);
274 err |= __put_user(&frame->uc, &frame->puc); 302 err |= __put_user(&frame->uc, &frame->puc);
275 err |= copy_siginfo_to_user(&frame->info, info); 303 err |= copy_siginfo_to_user(&frame->info, info);
276 err |= copy_ucontext_to_user(&frame->uc, &frame->fpstate, mask, 304 err |= copy_ucontext_to_user(&frame->uc, &frame->fpstate, mask,
277 PT_REGS_SP(regs)); 305 save_sp);
278 306
279 /* 307 /*
280 * This is movl $,%eax ; int $0x80 308 * This is movl $,%eax ; int $0x80
@@ -288,9 +316,8 @@ int setup_signal_stack_si(unsigned long stack_top, int sig,
288 err |= __put_user(0x80cd, (short __user *)(frame->retcode+5)); 316 err |= __put_user(0x80cd, (short __user *)(frame->retcode+5));
289 317
290 if(err) 318 if(err)
291 return(err); 319 goto err;
292 320
293 PT_REGS_SP(regs) = (unsigned long) frame;
294 PT_REGS_IP(regs) = (unsigned long) ka->sa.sa_handler; 321 PT_REGS_IP(regs) = (unsigned long) ka->sa.sa_handler;
295 PT_REGS_EAX(regs) = (unsigned long) sig; 322 PT_REGS_EAX(regs) = (unsigned long) sig;
296 PT_REGS_EDX(regs) = (unsigned long) &frame->info; 323 PT_REGS_EDX(regs) = (unsigned long) &frame->info;
@@ -298,13 +325,17 @@ int setup_signal_stack_si(unsigned long stack_top, int sig,
298 325
299 if ((current->ptrace & PT_DTRACE) && (current->ptrace & PT_PTRACED)) 326 if ((current->ptrace & PT_DTRACE) && (current->ptrace & PT_PTRACED))
300 ptrace_notify(SIGTRAP); 327 ptrace_notify(SIGTRAP);
301 return(0); 328 return 0;
329
330err:
331 PT_REGS_SP(regs) = save_sp;
332 return err;
302} 333}
303 334
304long sys_sigreturn(struct pt_regs regs) 335long sys_sigreturn(struct pt_regs regs)
305{ 336{
306 unsigned long sp = PT_REGS_SP(&current->thread.regs); 337 unsigned long sp = PT_REGS_SP(&current->thread.regs);
307 struct sigframe __user *frame = (struct sigframe *)(sp - 8); 338 struct sigframe __user *frame = (struct sigframe __user *)(sp - 8);
308 sigset_t set; 339 sigset_t set;
309 struct sigcontext __user *sc = &frame->sc; 340 struct sigcontext __user *sc = &frame->sc;
310 unsigned long __user *oldmask = &sc->oldmask; 341 unsigned long __user *oldmask = &sc->oldmask;
@@ -336,8 +367,8 @@ long sys_sigreturn(struct pt_regs regs)
336 367
337long sys_rt_sigreturn(struct pt_regs regs) 368long sys_rt_sigreturn(struct pt_regs regs)
338{ 369{
339 unsigned long __user sp = PT_REGS_SP(&current->thread.regs); 370 unsigned long sp = PT_REGS_SP(&current->thread.regs);
340 struct rt_sigframe __user *frame = (struct rt_sigframe *) (sp - 4); 371 struct rt_sigframe __user *frame = (struct rt_sigframe __user *) (sp - 4);
341 sigset_t set; 372 sigset_t set;
342 struct ucontext __user *uc = &frame->uc; 373 struct ucontext __user *uc = &frame->uc;
343 int sig_size = _NSIG_WORDS * sizeof(unsigned long); 374 int sig_size = _NSIG_WORDS * sizeof(unsigned long);
diff --git a/arch/um/sys-i386/sys_call_table.S b/arch/um/sys-i386/sys_call_table.S
index ad75c27afe38..1ff61474b25c 100644
--- a/arch/um/sys-i386/sys_call_table.S
+++ b/arch/um/sys-i386/sys_call_table.S
@@ -6,8 +6,6 @@
6 6
7#define sys_vm86old sys_ni_syscall 7#define sys_vm86old sys_ni_syscall
8#define sys_vm86 sys_ni_syscall 8#define sys_vm86 sys_ni_syscall
9#define sys_set_thread_area sys_ni_syscall
10#define sys_get_thread_area sys_ni_syscall
11 9
12#define sys_stime um_stime 10#define sys_stime um_stime
13#define sys_time um_time 11#define sys_time um_time
diff --git a/arch/um/sys-i386/syscalls.c b/arch/um/sys-i386/syscalls.c
index 83e9be820a86..749dd1bfe60f 100644
--- a/arch/um/sys-i386/syscalls.c
+++ b/arch/um/sys-i386/syscalls.c
@@ -61,21 +61,27 @@ long old_select(struct sel_arg_struct __user *arg)
61 return sys_select(a.n, a.inp, a.outp, a.exp, a.tvp); 61 return sys_select(a.n, a.inp, a.outp, a.exp, a.tvp);
62} 62}
63 63
64/* The i386 version skips reading from %esi, the fourth argument. So we must do 64/*
65 * this, too. 65 * The prototype on i386 is:
66 *
67 * int clone(int flags, void * child_stack, int * parent_tidptr, struct user_desc * newtls, int * child_tidptr)
68 *
69 * and the "newtls" arg. on i386 is read by copy_thread directly from the
70 * register saved on the stack.
66 */ 71 */
67long sys_clone(unsigned long clone_flags, unsigned long newsp, 72long sys_clone(unsigned long clone_flags, unsigned long newsp,
68 int __user *parent_tid, int unused, int __user *child_tid) 73 int __user *parent_tid, void *newtls, int __user *child_tid)
69{ 74{
70 long ret; 75 long ret;
71 76
72 if (!newsp) 77 if (!newsp)
73 newsp = UPT_SP(&current->thread.regs.regs); 78 newsp = UPT_SP(&current->thread.regs.regs);
79
74 current->thread.forking = 1; 80 current->thread.forking = 1;
75 ret = do_fork(clone_flags, newsp, &current->thread.regs, 0, parent_tid, 81 ret = do_fork(clone_flags, newsp, &current->thread.regs, 0, parent_tid,
76 child_tid); 82 child_tid);
77 current->thread.forking = 0; 83 current->thread.forking = 0;
78 return(ret); 84 return ret;
79} 85}
80 86
81/* 87/*
@@ -104,7 +110,7 @@ long sys_ipc (uint call, int first, int second,
104 union semun fourth; 110 union semun fourth;
105 if (!ptr) 111 if (!ptr)
106 return -EINVAL; 112 return -EINVAL;
107 if (get_user(fourth.__pad, (void **) ptr)) 113 if (get_user(fourth.__pad, (void __user * __user *) ptr))
108 return -EFAULT; 114 return -EFAULT;
109 return sys_semctl (first, second, third, fourth); 115 return sys_semctl (first, second, third, fourth);
110 } 116 }
diff --git a/arch/um/sys-i386/tls.c b/arch/um/sys-i386/tls.c
new file mode 100644
index 000000000000..a3188e861cc7
--- /dev/null
+++ b/arch/um/sys-i386/tls.c
@@ -0,0 +1,384 @@
1/*
2 * Copyright (C) 2005 Paolo 'Blaisorblade' Giarrusso <blaisorblade@yahoo.it>
3 * Licensed under the GPL
4 */
5
6#include "linux/config.h"
7#include "linux/kernel.h"
8#include "linux/sched.h"
9#include "linux/slab.h"
10#include "linux/types.h"
11#include "asm/uaccess.h"
12#include "asm/ptrace.h"
13#include "asm/segment.h"
14#include "asm/smp.h"
15#include "asm/desc.h"
16#include "choose-mode.h"
17#include "kern.h"
18#include "kern_util.h"
19#include "mode_kern.h"
20#include "os.h"
21#include "mode.h"
22
23#ifdef CONFIG_MODE_SKAS
24#include "skas.h"
25#endif
26
27/* If needed we can detect when it's uninitialized. */
28static int host_supports_tls = -1;
29int host_gdt_entry_tls_min = -1;
30
31#ifdef CONFIG_MODE_SKAS
32int do_set_thread_area_skas(struct user_desc *info)
33{
34 int ret;
35 u32 cpu;
36
37 cpu = get_cpu();
38 ret = os_set_thread_area(info, userspace_pid[cpu]);
39 put_cpu();
40 return ret;
41}
42
43int do_get_thread_area_skas(struct user_desc *info)
44{
45 int ret;
46 u32 cpu;
47
48 cpu = get_cpu();
49 ret = os_get_thread_area(info, userspace_pid[cpu]);
50 put_cpu();
51 return ret;
52}
53#endif
54
55/*
56 * sys_get_thread_area: get a yet unused TLS descriptor index.
57 * XXX: Consider leaving one free slot for glibc usage at first place. This must
58 * be done here (and by changing GDT_ENTRY_TLS_* macros) and nowhere else.
59 *
60 * Also, this must be tested when compiling in SKAS mode with dinamic linking
61 * and running against NPTL.
62 */
63static int get_free_idx(struct task_struct* task)
64{
65 struct thread_struct *t = &task->thread;
66 int idx;
67
68 if (!t->arch.tls_array)
69 return GDT_ENTRY_TLS_MIN;
70
71 for (idx = 0; idx < GDT_ENTRY_TLS_ENTRIES; idx++)
72 if (!t->arch.tls_array[idx].present)
73 return idx + GDT_ENTRY_TLS_MIN;
74 return -ESRCH;
75}
76
77static inline void clear_user_desc(struct user_desc* info)
78{
79 /* Postcondition: LDT_empty(info) returns true. */
80 memset(info, 0, sizeof(*info));
81
82 /* Check the LDT_empty or the i386 sys_get_thread_area code - we obtain
83 * indeed an empty user_desc.
84 */
85 info->read_exec_only = 1;
86 info->seg_not_present = 1;
87}
88
89#define O_FORCE 1
90
91static int load_TLS(int flags, struct task_struct *to)
92{
93 int ret = 0;
94 int idx;
95
96 for (idx = GDT_ENTRY_TLS_MIN; idx < GDT_ENTRY_TLS_MAX; idx++) {
97 struct uml_tls_struct* curr = &to->thread.arch.tls_array[idx - GDT_ENTRY_TLS_MIN];
98
99 /* Actually, now if it wasn't flushed it gets cleared and
100 * flushed to the host, which will clear it.*/
101 if (!curr->present) {
102 if (!curr->flushed) {
103 clear_user_desc(&curr->tls);
104 curr->tls.entry_number = idx;
105 } else {
106 WARN_ON(!LDT_empty(&curr->tls));
107 continue;
108 }
109 }
110
111 if (!(flags & O_FORCE) && curr->flushed)
112 continue;
113
114 ret = do_set_thread_area(&curr->tls);
115 if (ret)
116 goto out;
117
118 curr->flushed = 1;
119 }
120out:
121 return ret;
122}
123
124/* Verify if we need to do a flush for the new process, i.e. if there are any
125 * present desc's, only if they haven't been flushed.
126 */
127static inline int needs_TLS_update(struct task_struct *task)
128{
129 int i;
130 int ret = 0;
131
132 for (i = GDT_ENTRY_TLS_MIN; i < GDT_ENTRY_TLS_MAX; i++) {
133 struct uml_tls_struct* curr = &task->thread.arch.tls_array[i - GDT_ENTRY_TLS_MIN];
134
135 /* Can't test curr->present, we may need to clear a descriptor
136 * which had a value. */
137 if (curr->flushed)
138 continue;
139 ret = 1;
140 break;
141 }
142 return ret;
143}
144
145/* On a newly forked process, the TLS descriptors haven't yet been flushed. So
146 * we mark them as such and the first switch_to will do the job.
147 */
148void clear_flushed_tls(struct task_struct *task)
149{
150 int i;
151
152 for (i = GDT_ENTRY_TLS_MIN; i < GDT_ENTRY_TLS_MAX; i++) {
153 struct uml_tls_struct* curr = &task->thread.arch.tls_array[i - GDT_ENTRY_TLS_MIN];
154
155 /* Still correct to do this, if it wasn't present on the host it
156 * will remain as flushed as it was. */
157 if (!curr->present)
158 continue;
159
160 curr->flushed = 0;
161 }
162}
163
164/* In SKAS0 mode, currently, multiple guest threads sharing the same ->mm have a
165 * common host process. So this is needed in SKAS0 too.
166 *
167 * However, if each thread had a different host process (and this was discussed
168 * for SMP support) this won't be needed.
169 *
170 * And this will not need be used when (and if) we'll add support to the host
171 * SKAS patch. */
172
173int arch_switch_tls_skas(struct task_struct *from, struct task_struct *to)
174{
175 if (!host_supports_tls)
176 return 0;
177
178 /* We have no need whatsoever to switch TLS for kernel threads; beyond
179 * that, that would also result in us calling os_set_thread_area with
180 * userspace_pid[cpu] == 0, which gives an error. */
181 if (likely(to->mm))
182 return load_TLS(O_FORCE, to);
183
184 return 0;
185}
186
187int arch_switch_tls_tt(struct task_struct *from, struct task_struct *to)
188{
189 if (!host_supports_tls)
190 return 0;
191
192 if (needs_TLS_update(to))
193 return load_TLS(0, to);
194
195 return 0;
196}
197
198static int set_tls_entry(struct task_struct* task, struct user_desc *info,
199 int idx, int flushed)
200{
201 struct thread_struct *t = &task->thread;
202
203 if (idx < GDT_ENTRY_TLS_MIN || idx > GDT_ENTRY_TLS_MAX)
204 return -EINVAL;
205
206 t->arch.tls_array[idx - GDT_ENTRY_TLS_MIN].tls = *info;
207 t->arch.tls_array[idx - GDT_ENTRY_TLS_MIN].present = 1;
208 t->arch.tls_array[idx - GDT_ENTRY_TLS_MIN].flushed = flushed;
209
210 return 0;
211}
212
213int arch_copy_tls(struct task_struct *new)
214{
215 struct user_desc info;
216 int idx, ret = -EFAULT;
217
218 if (copy_from_user(&info,
219 (void __user *) UPT_ESI(&new->thread.regs.regs),
220 sizeof(info)))
221 goto out;
222
223 ret = -EINVAL;
224 if (LDT_empty(&info))
225 goto out;
226
227 idx = info.entry_number;
228
229 ret = set_tls_entry(new, &info, idx, 0);
230out:
231 return ret;
232}
233
234/* XXX: use do_get_thread_area to read the host value? I'm not at all sure! */
235static int get_tls_entry(struct task_struct* task, struct user_desc *info, int idx)
236{
237 struct thread_struct *t = &task->thread;
238
239 if (!t->arch.tls_array)
240 goto clear;
241
242 if (idx < GDT_ENTRY_TLS_MIN || idx > GDT_ENTRY_TLS_MAX)
243 return -EINVAL;
244
245 if (!t->arch.tls_array[idx - GDT_ENTRY_TLS_MIN].present)
246 goto clear;
247
248 *info = t->arch.tls_array[idx - GDT_ENTRY_TLS_MIN].tls;
249
250out:
251 /* Temporary debugging check, to make sure that things have been
252 * flushed. This could be triggered if load_TLS() failed.
253 */
254 if (unlikely(task == current && !t->arch.tls_array[idx - GDT_ENTRY_TLS_MIN].flushed)) {
255 printk(KERN_ERR "get_tls_entry: task with pid %d got here "
256 "without flushed TLS.", current->pid);
257 }
258
259 return 0;
260clear:
261 /* When the TLS entry has not been set, the values read to user in the
262 * tls_array are 0 (because it's cleared at boot, see
263 * arch/i386/kernel/head.S:cpu_gdt_table). Emulate that.
264 */
265 clear_user_desc(info);
266 info->entry_number = idx;
267 goto out;
268}
269
270asmlinkage int sys_set_thread_area(struct user_desc __user *user_desc)
271{
272 struct user_desc info;
273 int idx, ret;
274
275 if (!host_supports_tls)
276 return -ENOSYS;
277
278 if (copy_from_user(&info, user_desc, sizeof(info)))
279 return -EFAULT;
280
281 idx = info.entry_number;
282
283 if (idx == -1) {
284 idx = get_free_idx(current);
285 if (idx < 0)
286 return idx;
287 info.entry_number = idx;
288 /* Tell the user which slot we chose for him.*/
289 if (put_user(idx, &user_desc->entry_number))
290 return -EFAULT;
291 }
292
293 ret = CHOOSE_MODE_PROC(do_set_thread_area_tt, do_set_thread_area_skas, &info);
294 if (ret)
295 return ret;
296 return set_tls_entry(current, &info, idx, 1);
297}
298
299/*
300 * Perform set_thread_area on behalf of the traced child.
301 * Note: error handling is not done on the deferred load, and this differ from
302 * i386. However the only possible error are caused by bugs.
303 */
304int ptrace_set_thread_area(struct task_struct *child, int idx,
305 struct user_desc __user *user_desc)
306{
307 struct user_desc info;
308
309 if (!host_supports_tls)
310 return -EIO;
311
312 if (copy_from_user(&info, user_desc, sizeof(info)))
313 return -EFAULT;
314
315 return set_tls_entry(child, &info, idx, 0);
316}
317
318asmlinkage int sys_get_thread_area(struct user_desc __user *user_desc)
319{
320 struct user_desc info;
321 int idx, ret;
322
323 if (!host_supports_tls)
324 return -ENOSYS;
325
326 if (get_user(idx, &user_desc->entry_number))
327 return -EFAULT;
328
329 ret = get_tls_entry(current, &info, idx);
330 if (ret < 0)
331 goto out;
332
333 if (copy_to_user(user_desc, &info, sizeof(info)))
334 ret = -EFAULT;
335
336out:
337 return ret;
338}
339
340/*
341 * Perform get_thread_area on behalf of the traced child.
342 */
343int ptrace_get_thread_area(struct task_struct *child, int idx,
344 struct user_desc __user *user_desc)
345{
346 struct user_desc info;
347 int ret;
348
349 if (!host_supports_tls)
350 return -EIO;
351
352 ret = get_tls_entry(child, &info, idx);
353 if (ret < 0)
354 goto out;
355
356 if (copy_to_user(user_desc, &info, sizeof(info)))
357 ret = -EFAULT;
358out:
359 return ret;
360}
361
362
363/* XXX: This part is probably common to i386 and x86-64. Don't create a common
364 * file for now, do that when implementing x86-64 support.*/
365static int __init __setup_host_supports_tls(void) {
366 check_host_supports_tls(&host_supports_tls, &host_gdt_entry_tls_min);
367 if (host_supports_tls) {
368 printk(KERN_INFO "Host TLS support detected\n");
369 printk(KERN_INFO "Detected host type: ");
370 switch (host_gdt_entry_tls_min) {
371 case GDT_ENTRY_TLS_MIN_I386:
372 printk("i386\n");
373 break;
374 case GDT_ENTRY_TLS_MIN_X86_64:
375 printk("x86_64\n");
376 break;
377 }
378 } else
379 printk(KERN_ERR " Host TLS support NOT detected! "
380 "TLS support inside UML will not work\n");
381 return 1;
382}
383
384__initcall(__setup_host_supports_tls);
diff --git a/arch/um/sys-i386/user-offsets.c b/arch/um/sys-i386/user-offsets.c
index 26b68675053d..6f4ef2b7fa4a 100644
--- a/arch/um/sys-i386/user-offsets.c
+++ b/arch/um/sys-i386/user-offsets.c
@@ -3,12 +3,13 @@
3#include <asm/ptrace.h> 3#include <asm/ptrace.h>
4#include <asm/user.h> 4#include <asm/user.h>
5#include <linux/stddef.h> 5#include <linux/stddef.h>
6#include <sys/poll.h>
6 7
7#define DEFINE(sym, val) \ 8#define DEFINE(sym, val) \
8 asm volatile("\n->" #sym " %0 " #val : : "i" (val)) 9 asm volatile("\n->" #sym " %0 " #val : : "i" (val))
9 10
10#define DEFINE_LONGS(sym, val) \ 11#define DEFINE_LONGS(sym, val) \
11 asm volatile("\n->" #sym " %0 " #val : : "i" (val/sizeof(unsigned long))) 12 asm volatile("\n->" #sym " %0 " #val : : "i" (val/sizeof(unsigned long)))
12 13
13#define OFFSET(sym, str, mem) \ 14#define OFFSET(sym, str, mem) \
14 DEFINE(sym, offsetof(struct str, mem)); 15 DEFINE(sym, offsetof(struct str, mem));
@@ -67,4 +68,9 @@ void foo(void)
67 DEFINE(HOST_ES, ES); 68 DEFINE(HOST_ES, ES);
68 DEFINE(HOST_GS, GS); 69 DEFINE(HOST_GS, GS);
69 DEFINE(UM_FRAME_SIZE, sizeof(struct user_regs_struct)); 70 DEFINE(UM_FRAME_SIZE, sizeof(struct user_regs_struct));
71
72 /* XXX Duplicated between i386 and x86_64 */
73 DEFINE(UM_POLLIN, POLLIN);
74 DEFINE(UM_POLLPRI, POLLPRI);
75 DEFINE(UM_POLLOUT, POLLOUT);
70} 76}
diff --git a/arch/um/sys-x86_64/Makefile b/arch/um/sys-x86_64/Makefile
index a351091fbd99..b5fc22babddf 100644
--- a/arch/um/sys-x86_64/Makefile
+++ b/arch/um/sys-x86_64/Makefile
@@ -4,31 +4,23 @@
4# Licensed under the GPL 4# Licensed under the GPL
5# 5#
6 6
7#XXX: why into lib-y? 7obj-y = bugs.o delay.o fault.o ldt.o mem.o ptrace.o ptrace_user.o \
8lib-y = bitops.o bugs.o csum-partial.o delay.o fault.o ldt.o mem.o memcpy.o \ 8 sigcontext.o signal.o syscalls.o syscall_table.o sysrq.o ksyms.o \
9 ptrace.o ptrace_user.o sigcontext.o signal.o syscalls.o \ 9 tls.o
10 syscall_table.o sysrq.o thunk.o
11lib-$(CONFIG_MODE_SKAS) += stub.o stub_segv.o
12 10
13obj-y := ksyms.o 11obj-$(CONFIG_MODE_SKAS) += stub.o stub_segv.o
14obj-$(CONFIG_MODULES) += module.o um_module.o 12obj-$(CONFIG_MODULES) += um_module.o
15 13
16USER_OBJS := ptrace_user.o sigcontext.o stub_segv.o 14subarch-obj-y = lib/bitops.o lib/csum-partial.o lib/memcpy.o lib/thunk.o
15subarch-obj-$(CONFIG_MODULES) += kernel/module.o
17 16
18SYMLINKS = bitops.c csum-copy.S csum-partial.c csum-wrappers.c ldt.c memcpy.S \ 17ldt-y = ../sys-i386/ldt.o
19 thunk.S module.c
20 18
21include arch/um/scripts/Makefile.rules 19USER_OBJS := ptrace_user.o sigcontext.o stub_segv.o
22 20
23bitops.c-dir = lib 21include arch/um/scripts/Makefile.rules
24csum-copy.S-dir = lib
25csum-partial.c-dir = lib
26csum-wrappers.c-dir = lib
27ldt.c-dir = /arch/um/sys-i386
28memcpy.S-dir = lib
29thunk.S-dir = lib
30module.c-dir = kernel
31 22
32$(obj)/stub_segv.o: _c_flags = $(call unprofile,$(CFLAGS)) 23extra-$(CONFIG_MODE_TT) += unmap.o
33 24
34include arch/um/scripts/Makefile.unmap 25$(obj)/stub_segv.o $(obj)/unmap.o: \
26 _c_flags = $(call unprofile,$(CFLAGS))
diff --git a/arch/um/sys-x86_64/ptrace.c b/arch/um/sys-x86_64/ptrace.c
index 74eee5c7c6dd..147bbf05cbc2 100644
--- a/arch/um/sys-x86_64/ptrace.c
+++ b/arch/um/sys-x86_64/ptrace.c
@@ -8,6 +8,7 @@
8#include <asm/ptrace.h> 8#include <asm/ptrace.h>
9#include <linux/sched.h> 9#include <linux/sched.h>
10#include <linux/errno.h> 10#include <linux/errno.h>
11#include <linux/mm.h>
11#include <asm/uaccess.h> 12#include <asm/uaccess.h>
12#include <asm/elf.h> 13#include <asm/elf.h>
13 14
@@ -136,9 +137,28 @@ void arch_switch(void)
136*/ 137*/
137} 138}
138 139
140/* XXX Mostly copied from sys-i386 */
139int is_syscall(unsigned long addr) 141int is_syscall(unsigned long addr)
140{ 142{
141 panic("is_syscall"); 143 unsigned short instr;
144 int n;
145
146 n = copy_from_user(&instr, (void __user *) addr, sizeof(instr));
147 if(n){
148 /* access_process_vm() grants access to vsyscall and stub,
149 * while copy_from_user doesn't. Maybe access_process_vm is
150 * slow, but that doesn't matter, since it will be called only
151 * in case of singlestepping, if copy_from_user failed.
152 */
153 n = access_process_vm(current, addr, &instr, sizeof(instr), 0);
154 if(n != sizeof(instr)) {
155 printk("is_syscall : failed to read instruction from "
156 "0x%lx\n", addr);
157 return(1);
158 }
159 }
160 /* sysenter */
161 return(instr == 0x050f);
142} 162}
143 163
144int dump_fpu(struct pt_regs *regs, elf_fpregset_t *fpu ) 164int dump_fpu(struct pt_regs *regs, elf_fpregset_t *fpu )
diff --git a/arch/um/sys-x86_64/signal.c b/arch/um/sys-x86_64/signal.c
index fe1d065332b1..e75c4e1838b0 100644
--- a/arch/um/sys-x86_64/signal.c
+++ b/arch/um/sys-x86_64/signal.c
@@ -55,7 +55,8 @@ static int copy_sc_from_user_skas(struct pt_regs *regs,
55} 55}
56 56
57int copy_sc_to_user_skas(struct sigcontext *to, struct _fpstate *to_fp, 57int copy_sc_to_user_skas(struct sigcontext *to, struct _fpstate *to_fp,
58 struct pt_regs *regs, unsigned long mask) 58 struct pt_regs *regs, unsigned long mask,
59 unsigned long sp)
59{ 60{
60 struct faultinfo * fi = &current->thread.arch.faultinfo; 61 struct faultinfo * fi = &current->thread.arch.faultinfo;
61 int err = 0; 62 int err = 0;
@@ -70,7 +71,11 @@ int copy_sc_to_user_skas(struct sigcontext *to, struct _fpstate *to_fp,
70 err |= PUTREG(regs, RDI, to, rdi); 71 err |= PUTREG(regs, RDI, to, rdi);
71 err |= PUTREG(regs, RSI, to, rsi); 72 err |= PUTREG(regs, RSI, to, rsi);
72 err |= PUTREG(regs, RBP, to, rbp); 73 err |= PUTREG(regs, RBP, to, rbp);
73 err |= PUTREG(regs, RSP, to, rsp); 74 /* Must use orignal RSP, which is passed in, rather than what's in
75 * the pt_regs, because that's already been updated to point at the
76 * signal frame.
77 */
78 err |= __put_user(sp, &to->rsp);
74 err |= PUTREG(regs, RBX, to, rbx); 79 err |= PUTREG(regs, RBX, to, rbx);
75 err |= PUTREG(regs, RDX, to, rdx); 80 err |= PUTREG(regs, RDX, to, rdx);
76 err |= PUTREG(regs, RCX, to, rcx); 81 err |= PUTREG(regs, RCX, to, rcx);
@@ -102,7 +107,7 @@ int copy_sc_to_user_skas(struct sigcontext *to, struct _fpstate *to_fp,
102 107
103#ifdef CONFIG_MODE_TT 108#ifdef CONFIG_MODE_TT
104int copy_sc_from_user_tt(struct sigcontext *to, struct sigcontext *from, 109int copy_sc_from_user_tt(struct sigcontext *to, struct sigcontext *from,
105 int fpsize) 110 int fpsize)
106{ 111{
107 struct _fpstate *to_fp, *from_fp; 112 struct _fpstate *to_fp, *from_fp;
108 unsigned long sigs; 113 unsigned long sigs;
@@ -120,7 +125,7 @@ int copy_sc_from_user_tt(struct sigcontext *to, struct sigcontext *from,
120} 125}
121 126
122int copy_sc_to_user_tt(struct sigcontext *to, struct _fpstate *fp, 127int copy_sc_to_user_tt(struct sigcontext *to, struct _fpstate *fp,
123 struct sigcontext *from, int fpsize) 128 struct sigcontext *from, int fpsize, unsigned long sp)
124{ 129{
125 struct _fpstate *to_fp, *from_fp; 130 struct _fpstate *to_fp, *from_fp;
126 int err; 131 int err;
@@ -128,11 +133,17 @@ int copy_sc_to_user_tt(struct sigcontext *to, struct _fpstate *fp,
128 to_fp = (fp ? fp : (struct _fpstate *) (to + 1)); 133 to_fp = (fp ? fp : (struct _fpstate *) (to + 1));
129 from_fp = from->fpstate; 134 from_fp = from->fpstate;
130 err = copy_to_user(to, from, sizeof(*to)); 135 err = copy_to_user(to, from, sizeof(*to));
136 /* The SP in the sigcontext is the updated one for the signal
137 * delivery. The sp passed in is the original, and this needs
138 * to be restored, so we stick it in separately.
139 */
140 err |= copy_to_user(&SC_SP(to), sp, sizeof(sp));
141
131 if(from_fp != NULL){ 142 if(from_fp != NULL){
132 err |= copy_to_user(&to->fpstate, &to_fp, sizeof(to->fpstate)); 143 err |= copy_to_user(&to->fpstate, &to_fp, sizeof(to->fpstate));
133 err |= copy_to_user(to_fp, from_fp, fpsize); 144 err |= copy_to_user(to_fp, from_fp, fpsize);
134 } 145 }
135 return(err); 146 return err;
136} 147}
137 148
138#endif 149#endif
@@ -148,11 +159,12 @@ static int copy_sc_from_user(struct pt_regs *to, void __user *from)
148} 159}
149 160
150static int copy_sc_to_user(struct sigcontext *to, struct _fpstate *fp, 161static int copy_sc_to_user(struct sigcontext *to, struct _fpstate *fp,
151 struct pt_regs *from, unsigned long mask) 162 struct pt_regs *from, unsigned long mask,
163 unsigned long sp)
152{ 164{
153 return(CHOOSE_MODE(copy_sc_to_user_tt(to, fp, UPT_SC(&from->regs), 165 return(CHOOSE_MODE(copy_sc_to_user_tt(to, fp, UPT_SC(&from->regs),
154 sizeof(*fp)), 166 sizeof(*fp), sp),
155 copy_sc_to_user_skas(to, fp, from, mask))); 167 copy_sc_to_user_skas(to, fp, from, mask, sp)));
156} 168}
157 169
158struct rt_sigframe 170struct rt_sigframe
@@ -170,6 +182,7 @@ int setup_signal_stack_si(unsigned long stack_top, int sig,
170{ 182{
171 struct rt_sigframe __user *frame; 183 struct rt_sigframe __user *frame;
172 struct _fpstate __user *fp = NULL; 184 struct _fpstate __user *fp = NULL;
185 unsigned long save_sp = PT_REGS_RSP(regs);
173 int err = 0; 186 int err = 0;
174 struct task_struct *me = current; 187 struct task_struct *me = current;
175 188
@@ -193,14 +206,25 @@ int setup_signal_stack_si(unsigned long stack_top, int sig,
193 goto out; 206 goto out;
194 } 207 }
195 208
209 /* Update SP now because the page fault handler refuses to extend
210 * the stack if the faulting address is too far below the current
211 * SP, which frame now certainly is. If there's an error, the original
212 * value is restored on the way out.
213 * When writing the sigcontext to the stack, we have to write the
214 * original value, so that's passed to copy_sc_to_user, which does
215 * the right thing with it.
216 */
217 PT_REGS_RSP(regs) = (unsigned long) frame;
218
196 /* Create the ucontext. */ 219 /* Create the ucontext. */
197 err |= __put_user(0, &frame->uc.uc_flags); 220 err |= __put_user(0, &frame->uc.uc_flags);
198 err |= __put_user(0, &frame->uc.uc_link); 221 err |= __put_user(0, &frame->uc.uc_link);
199 err |= __put_user(me->sas_ss_sp, &frame->uc.uc_stack.ss_sp); 222 err |= __put_user(me->sas_ss_sp, &frame->uc.uc_stack.ss_sp);
200 err |= __put_user(sas_ss_flags(PT_REGS_SP(regs)), 223 err |= __put_user(sas_ss_flags(save_sp),
201 &frame->uc.uc_stack.ss_flags); 224 &frame->uc.uc_stack.ss_flags);
202 err |= __put_user(me->sas_ss_size, &frame->uc.uc_stack.ss_size); 225 err |= __put_user(me->sas_ss_size, &frame->uc.uc_stack.ss_size);
203 err |= copy_sc_to_user(&frame->uc.uc_mcontext, fp, regs, set->sig[0]); 226 err |= copy_sc_to_user(&frame->uc.uc_mcontext, fp, regs, set->sig[0],
227 save_sp);
204 err |= __put_user(fp, &frame->uc.uc_mcontext.fpstate); 228 err |= __put_user(fp, &frame->uc.uc_mcontext.fpstate);
205 if (sizeof(*set) == 16) { 229 if (sizeof(*set) == 16) {
206 __put_user(set->sig[0], &frame->uc.uc_sigmask.sig[0]); 230 __put_user(set->sig[0], &frame->uc.uc_sigmask.sig[0]);
@@ -217,10 +241,10 @@ int setup_signal_stack_si(unsigned long stack_top, int sig,
217 err |= __put_user(ka->sa.sa_restorer, &frame->pretcode); 241 err |= __put_user(ka->sa.sa_restorer, &frame->pretcode);
218 else 242 else
219 /* could use a vstub here */ 243 /* could use a vstub here */
220 goto out; 244 goto restore_sp;
221 245
222 if (err) 246 if (err)
223 goto out; 247 goto restore_sp;
224 248
225 /* Set up registers for signal handler */ 249 /* Set up registers for signal handler */
226 { 250 {
@@ -238,10 +262,12 @@ int setup_signal_stack_si(unsigned long stack_top, int sig,
238 PT_REGS_RSI(regs) = (unsigned long) &frame->info; 262 PT_REGS_RSI(regs) = (unsigned long) &frame->info;
239 PT_REGS_RDX(regs) = (unsigned long) &frame->uc; 263 PT_REGS_RDX(regs) = (unsigned long) &frame->uc;
240 PT_REGS_RIP(regs) = (unsigned long) ka->sa.sa_handler; 264 PT_REGS_RIP(regs) = (unsigned long) ka->sa.sa_handler;
241
242 PT_REGS_RSP(regs) = (unsigned long) frame;
243 out: 265 out:
244 return(err); 266 return err;
267
268restore_sp:
269 PT_REGS_RSP(regs) = save_sp;
270 return err;
245} 271}
246 272
247long sys_rt_sigreturn(struct pt_regs *regs) 273long sys_rt_sigreturn(struct pt_regs *regs)
diff --git a/arch/um/sys-x86_64/tls.c b/arch/um/sys-x86_64/tls.c
new file mode 100644
index 000000000000..ce1bf1b81c43
--- /dev/null
+++ b/arch/um/sys-x86_64/tls.c
@@ -0,0 +1,14 @@
1#include "linux/sched.h"
2
3void debug_arch_force_load_TLS(void)
4{
5}
6
7void clear_flushed_tls(struct task_struct *task)
8{
9}
10
11int arch_copy_tls(struct task_struct *t)
12{
13 return 0;
14}
diff --git a/arch/um/sys-x86_64/user-offsets.c b/arch/um/sys-x86_64/user-offsets.c
index 7bd54a921cf7..899cebb57c3f 100644
--- a/arch/um/sys-x86_64/user-offsets.c
+++ b/arch/um/sys-x86_64/user-offsets.c
@@ -1,6 +1,7 @@
1#include <stdio.h> 1#include <stdio.h>
2#include <stddef.h> 2#include <stddef.h>
3#include <signal.h> 3#include <signal.h>
4#include <sys/poll.h>
4#define __FRAME_OFFSETS 5#define __FRAME_OFFSETS
5#include <asm/ptrace.h> 6#include <asm/ptrace.h>
6#include <asm/types.h> 7#include <asm/types.h>
@@ -88,4 +89,9 @@ void foo(void)
88 DEFINE_LONGS(HOST_IP, RIP); 89 DEFINE_LONGS(HOST_IP, RIP);
89 DEFINE_LONGS(HOST_SP, RSP); 90 DEFINE_LONGS(HOST_SP, RSP);
90 DEFINE(UM_FRAME_SIZE, sizeof(struct user_regs_struct)); 91 DEFINE(UM_FRAME_SIZE, sizeof(struct user_regs_struct));
92
93 /* XXX Duplicated between i386 and x86_64 */
94 DEFINE(UM_POLLIN, POLLIN);
95 DEFINE(UM_POLLPRI, POLLPRI);
96 DEFINE(UM_POLLOUT, POLLOUT);
91} 97}
diff --git a/arch/v850/Kconfig b/arch/v850/Kconfig
index e7fc3e500342..37ec644603ab 100644
--- a/arch/v850/Kconfig
+++ b/arch/v850/Kconfig
@@ -16,6 +16,12 @@ config RWSEM_GENERIC_SPINLOCK
16config RWSEM_XCHGADD_ALGORITHM 16config RWSEM_XCHGADD_ALGORITHM
17 bool 17 bool
18 default n 18 default n
19config GENERIC_FIND_NEXT_BIT
20 bool
21 default y
22config GENERIC_HWEIGHT
23 bool
24 default y
19config GENERIC_CALIBRATE_DELAY 25config GENERIC_CALIBRATE_DELAY
20 bool 26 bool
21 default y 27 default y
diff --git a/arch/v850/kernel/process.c b/arch/v850/kernel/process.c
index 621111ddf907..57218c76925c 100644
--- a/arch/v850/kernel/process.c
+++ b/arch/v850/kernel/process.c
@@ -37,7 +37,7 @@ extern void ret_from_fork (void);
37 37
38 38
39/* The idle loop. */ 39/* The idle loop. */
40void default_idle (void) 40static void default_idle (void)
41{ 41{
42 while (! need_resched ()) 42 while (! need_resched ())
43 asm ("halt; nop; nop; nop; nop; nop" ::: "cc"); 43 asm ("halt; nop; nop; nop; nop; nop" ::: "cc");
diff --git a/arch/v850/kernel/vmlinux.lds.S b/arch/v850/kernel/vmlinux.lds.S
index 5be05f47109e..5b2ffcc6e2b2 100644
--- a/arch/v850/kernel/vmlinux.lds.S
+++ b/arch/v850/kernel/vmlinux.lds.S
@@ -64,6 +64,10 @@
64 ___start___ksymtab_gpl = .; \ 64 ___start___ksymtab_gpl = .; \
65 *(__ksymtab_gpl) \ 65 *(__ksymtab_gpl) \
66 ___stop___ksymtab_gpl = .; \ 66 ___stop___ksymtab_gpl = .; \
67 /* Kernel symbol table: GPL-future symbols */ \
68 ___start___ksymtab_gpl_future = .; \
69 *(__ksymtab_gpl_future) \
70 ___stop___ksymtab_gpl_future = .; \
67 /* Kernel symbol table: strings */ \ 71 /* Kernel symbol table: strings */ \
68 *(__ksymtab_strings) \ 72 *(__ksymtab_strings) \
69 /* Kernel symbol table: Normal symbols */ \ 73 /* Kernel symbol table: Normal symbols */ \
@@ -74,6 +78,10 @@
74 ___start___kcrctab_gpl = .; \ 78 ___start___kcrctab_gpl = .; \
75 *(__kcrctab_gpl) \ 79 *(__kcrctab_gpl) \
76 ___stop___kcrctab_gpl = .; \ 80 ___stop___kcrctab_gpl = .; \
81 /* Kernel symbol table: GPL-future symbols */ \
82 ___start___kcrctab_gpl_future = .; \
83 *(__kcrctab_gpl_future) \
84 ___stop___kcrctab_gpl_future = .; \
77 /* Built-in module parameters */ \ 85 /* Built-in module parameters */ \
78 . = ALIGN (4) ; \ 86 . = ALIGN (4) ; \
79 ___start___param = .; \ 87 ___start___param = .; \
diff --git a/arch/x86_64/Kconfig b/arch/x86_64/Kconfig
index e18eb79bf855..4310b4a311a5 100644
--- a/arch/x86_64/Kconfig
+++ b/arch/x86_64/Kconfig
@@ -45,6 +45,10 @@ config RWSEM_GENERIC_SPINLOCK
45config RWSEM_XCHGADD_ALGORITHM 45config RWSEM_XCHGADD_ALGORITHM
46 bool 46 bool
47 47
48config GENERIC_HWEIGHT
49 bool
50 default y
51
48config GENERIC_CALIBRATE_DELAY 52config GENERIC_CALIBRATE_DELAY
49 bool 53 bool
50 default y 54 default y
@@ -246,6 +250,15 @@ config SCHED_SMT
246 cost of slightly increased overhead in some places. If unsure say 250 cost of slightly increased overhead in some places. If unsure say
247 N here. 251 N here.
248 252
253config SCHED_MC
254 bool "Multi-core scheduler support"
255 depends on SMP
256 default y
257 help
258 Multi-core scheduler support improves the CPU scheduler's decision
259 making when dealing with multi-core CPU chips at a cost of slightly
260 increased overhead in some places. If unsure say N here.
261
249source "kernel/Kconfig.preempt" 262source "kernel/Kconfig.preempt"
250 263
251config NUMA 264config NUMA
@@ -321,9 +334,13 @@ config HAVE_ARCH_EARLY_PFN_TO_NID
321 def_bool y 334 def_bool y
322 depends on NUMA 335 depends on NUMA
323 336
337config OUT_OF_LINE_PFN_TO_PAGE
338 def_bool y
339 depends on DISCONTIGMEM
340
324config NR_CPUS 341config NR_CPUS
325 int "Maximum number of CPUs (2-256)" 342 int "Maximum number of CPUs (2-256)"
326 range 2 256 343 range 2 255
327 depends on SMP 344 depends on SMP
328 default "8" 345 default "8"
329 help 346 help
@@ -364,13 +381,15 @@ config GART_IOMMU
364 select SWIOTLB 381 select SWIOTLB
365 depends on PCI 382 depends on PCI
366 help 383 help
367 Support the IOMMU. Needed to run systems with more than 3GB of memory 384 Support for hardware IOMMU in AMD's Opteron/Athlon64 Processors
368 properly with 32-bit PCI devices that do not support DAC (Double Address 385 and for the bounce buffering software IOMMU.
369 Cycle). The IOMMU can be turned off at runtime with the iommu=off parameter. 386 Needed to run systems with more than 3GB of memory properly with
370 Normally the kernel will take the right choice by itself. 387 32-bit PCI devices that do not support DAC (Double Address Cycle).
371 This option includes a driver for the AMD Opteron/Athlon64 northbridge IOMMU 388 The IOMMU can be turned off at runtime with the iommu=off parameter.
372 and a software emulation used on other systems. 389 Normally the kernel will take the right choice by itself.
373 If unsure, say Y. 390 This option includes a driver for the AMD Opteron/Athlon64 IOMMU
391 northbridge and a software emulation used on other systems without
392 hardware IOMMU. If unsure, say Y.
374 393
375# need this always enabled with GART_IOMMU for the VIA workaround 394# need this always enabled with GART_IOMMU for the VIA workaround
376config SWIOTLB 395config SWIOTLB
@@ -429,10 +448,10 @@ config CRASH_DUMP
429config PHYSICAL_START 448config PHYSICAL_START
430 hex "Physical address where the kernel is loaded" if (EMBEDDED || CRASH_DUMP) 449 hex "Physical address where the kernel is loaded" if (EMBEDDED || CRASH_DUMP)
431 default "0x1000000" if CRASH_DUMP 450 default "0x1000000" if CRASH_DUMP
432 default "0x100000" 451 default "0x200000"
433 help 452 help
434 This gives the physical address where the kernel is loaded. Normally 453 This gives the physical address where the kernel is loaded. Normally
435 for regular kernels this value is 0x100000 (1MB). But in the case 454 for regular kernels this value is 0x200000 (2MB). But in the case
436 of kexec on panic the fail safe kernel needs to run at a different 455 of kexec on panic the fail safe kernel needs to run at a different
437 address than the panic-ed kernel. This option is used to set the load 456 address than the panic-ed kernel. This option is used to set the load
438 address for kernels used to capture crash dump on being kexec'ed 457 address for kernels used to capture crash dump on being kexec'ed
@@ -464,6 +483,14 @@ config SECCOMP
464 483
465source kernel/Kconfig.hz 484source kernel/Kconfig.hz
466 485
486config REORDER
487 bool "Function reordering"
488 default n
489 help
490 This option enables the toolchain to reorder functions for a more
491 optimal TLB usage. If you have pretty much any version of binutils,
492 this can increase your kernel build time by roughly one minute.
493
467endmenu 494endmenu
468 495
469# 496#
@@ -512,16 +539,6 @@ config PCI_MMCONFIG
512 bool "Support mmconfig PCI config space access" 539 bool "Support mmconfig PCI config space access"
513 depends on PCI && ACPI 540 depends on PCI && ACPI
514 541
515config UNORDERED_IO
516 bool "Unordered IO mapping access"
517 depends on EXPERIMENTAL
518 help
519 Use unordered stores to access IO memory mappings in device drivers.
520 Still very experimental. When a driver works on IA64/ppc64/pa-risc it should
521 work with this option, but it makes the drivers behave differently
522 from i386. Requires that the driver writer used memory barriers
523 properly.
524
525source "drivers/pci/pcie/Kconfig" 542source "drivers/pci/pcie/Kconfig"
526 543
527source "drivers/pci/Kconfig" 544source "drivers/pci/Kconfig"
diff --git a/arch/x86_64/Makefile b/arch/x86_64/Makefile
index d7fd46479c55..585fd4a559c8 100644
--- a/arch/x86_64/Makefile
+++ b/arch/x86_64/Makefile
@@ -29,12 +29,14 @@ CHECKFLAGS += -D__x86_64__ -m64
29 29
30cflags-$(CONFIG_MK8) += $(call cc-option,-march=k8) 30cflags-$(CONFIG_MK8) += $(call cc-option,-march=k8)
31cflags-$(CONFIG_MPSC) += $(call cc-option,-march=nocona) 31cflags-$(CONFIG_MPSC) += $(call cc-option,-march=nocona)
32cflags-$(CONFIG_GENERIC_CPU) += $(call cc-option,-mtune=generic)
32CFLAGS += $(cflags-y) 33CFLAGS += $(cflags-y)
33 34
34CFLAGS += -m64 35CFLAGS += -m64
35CFLAGS += -mno-red-zone 36CFLAGS += -mno-red-zone
36CFLAGS += -mcmodel=kernel 37CFLAGS += -mcmodel=kernel
37CFLAGS += -pipe 38CFLAGS += -pipe
39cflags-$(CONFIG_REORDER) += -ffunction-sections
38# this makes reading assembly source easier, but produces worse code 40# this makes reading assembly source easier, but produces worse code
39# actually it makes the kernel smaller too. 41# actually it makes the kernel smaller too.
40CFLAGS += -fno-reorder-blocks 42CFLAGS += -fno-reorder-blocks
@@ -67,8 +69,8 @@ drivers-$(CONFIG_OPROFILE) += arch/x86_64/oprofile/
67 69
68boot := arch/x86_64/boot 70boot := arch/x86_64/boot
69 71
70.PHONY: bzImage bzlilo install archmrproper \ 72PHONY += bzImage bzlilo install archmrproper \
71 fdimage fdimage144 fdimage288 archclean 73 fdimage fdimage144 fdimage288 isoimage archclean
72 74
73#Default target when executing "make" 75#Default target when executing "make"
74all: bzImage 76all: bzImage
@@ -85,7 +87,7 @@ bzlilo: vmlinux
85bzdisk: vmlinux 87bzdisk: vmlinux
86 $(Q)$(MAKE) $(build)=$(boot) BOOTIMAGE=$(BOOTIMAGE) zdisk 88 $(Q)$(MAKE) $(build)=$(boot) BOOTIMAGE=$(BOOTIMAGE) zdisk
87 89
88fdimage fdimage144 fdimage288: vmlinux 90fdimage fdimage144 fdimage288 isoimage: vmlinux
89 $(Q)$(MAKE) $(build)=$(boot) BOOTIMAGE=$(BOOTIMAGE) $@ 91 $(Q)$(MAKE) $(build)=$(boot) BOOTIMAGE=$(BOOTIMAGE) $@
90 92
91install: 93install:
@@ -97,11 +99,16 @@ archclean:
97define archhelp 99define archhelp
98 echo '* bzImage - Compressed kernel image (arch/$(ARCH)/boot/bzImage)' 100 echo '* bzImage - Compressed kernel image (arch/$(ARCH)/boot/bzImage)'
99 echo ' install - Install kernel using' 101 echo ' install - Install kernel using'
100 echo ' (your) ~/bin/installkernel or' 102 echo ' (your) ~/bin/installkernel or'
101 echo ' (distribution) /sbin/installkernel or' 103 echo ' (distribution) /sbin/installkernel or'
102 echo ' install to $$(INSTALL_PATH) and run lilo' 104 echo ' install to $$(INSTALL_PATH) and run lilo'
105 echo ' bzdisk - Create a boot floppy in /dev/fd0'
106 echo ' fdimage - Create a boot floppy image'
107 echo ' isoimage - Create a boot CD-ROM image'
103endef 108endef
104 109
105CLEAN_FILES += arch/$(ARCH)/boot/fdimage arch/$(ARCH)/boot/mtools.conf 110CLEAN_FILES += arch/$(ARCH)/boot/fdimage \
111 arch/$(ARCH)/boot/image.iso \
112 arch/$(ARCH)/boot/mtools.conf
106 113
107 114
diff --git a/arch/x86_64/boot/Makefile b/arch/x86_64/boot/Makefile
index 29f8396ed151..43ee6c50c277 100644
--- a/arch/x86_64/boot/Makefile
+++ b/arch/x86_64/boot/Makefile
@@ -60,8 +60,12 @@ $(obj)/setup $(obj)/bootsect: %: %.o FORCE
60$(obj)/compressed/vmlinux: FORCE 60$(obj)/compressed/vmlinux: FORCE
61 $(Q)$(MAKE) $(build)=$(obj)/compressed IMAGE_OFFSET=$(IMAGE_OFFSET) $@ 61 $(Q)$(MAKE) $(build)=$(obj)/compressed IMAGE_OFFSET=$(IMAGE_OFFSET) $@
62 62
63# Set this if you want to pass append arguments to the zdisk/fdimage kernel 63# Set this if you want to pass append arguments to the zdisk/fdimage/isoimage kernel
64FDARGS = 64FDARGS =
65# Set this if you want an initrd included with the zdisk/fdimage/isoimage kernel
66FDINITRD =
67
68image_cmdline = default linux $(FDARGS) $(if $(FDINITRD),initrd=initrd.img,)
65 69
66$(obj)/mtools.conf: $(src)/mtools.conf.in 70$(obj)/mtools.conf: $(src)/mtools.conf.in
67 sed -e 's|@OBJ@|$(obj)|g' < $< > $@ 71 sed -e 's|@OBJ@|$(obj)|g' < $< > $@
@@ -70,8 +74,11 @@ $(obj)/mtools.conf: $(src)/mtools.conf.in
70zdisk: $(BOOTIMAGE) $(obj)/mtools.conf 74zdisk: $(BOOTIMAGE) $(obj)/mtools.conf
71 MTOOLSRC=$(obj)/mtools.conf mformat a: ; sync 75 MTOOLSRC=$(obj)/mtools.conf mformat a: ; sync
72 syslinux /dev/fd0 ; sync 76 syslinux /dev/fd0 ; sync
73 echo 'default linux $(FDARGS)' | \ 77 echo '$(image_cmdline)' | \
74 MTOOLSRC=$(obj)/mtools.conf mcopy - a:syslinux.cfg 78 MTOOLSRC=$(obj)/mtools.conf mcopy - a:syslinux.cfg
79 if [ -f '$(FDINITRD)' ] ; then \
80 MTOOLSRC=$(obj)/mtools.conf mcopy '$(FDINITRD)' a:initrd.img ; \
81 fi
75 MTOOLSRC=$(obj)/mtools.conf mcopy $(BOOTIMAGE) a:linux ; sync 82 MTOOLSRC=$(obj)/mtools.conf mcopy $(BOOTIMAGE) a:linux ; sync
76 83
77# These require being root or having syslinux 2.02 or higher installed 84# These require being root or having syslinux 2.02 or higher installed
@@ -79,18 +86,39 @@ fdimage fdimage144: $(BOOTIMAGE) $(obj)/mtools.conf
79 dd if=/dev/zero of=$(obj)/fdimage bs=1024 count=1440 86 dd if=/dev/zero of=$(obj)/fdimage bs=1024 count=1440
80 MTOOLSRC=$(obj)/mtools.conf mformat v: ; sync 87 MTOOLSRC=$(obj)/mtools.conf mformat v: ; sync
81 syslinux $(obj)/fdimage ; sync 88 syslinux $(obj)/fdimage ; sync
82 echo 'default linux $(FDARGS)' | \ 89 echo '$(image_cmdline)' | \
83 MTOOLSRC=$(obj)/mtools.conf mcopy - v:syslinux.cfg 90 MTOOLSRC=$(obj)/mtools.conf mcopy - v:syslinux.cfg
91 if [ -f '$(FDINITRD)' ] ; then \
92 MTOOLSRC=$(obj)/mtools.conf mcopy '$(FDINITRD)' v:initrd.img ; \
93 fi
84 MTOOLSRC=$(obj)/mtools.conf mcopy $(BOOTIMAGE) v:linux ; sync 94 MTOOLSRC=$(obj)/mtools.conf mcopy $(BOOTIMAGE) v:linux ; sync
85 95
86fdimage288: $(BOOTIMAGE) $(obj)/mtools.conf 96fdimage288: $(BOOTIMAGE) $(obj)/mtools.conf
87 dd if=/dev/zero of=$(obj)/fdimage bs=1024 count=2880 97 dd if=/dev/zero of=$(obj)/fdimage bs=1024 count=2880
88 MTOOLSRC=$(obj)/mtools.conf mformat w: ; sync 98 MTOOLSRC=$(obj)/mtools.conf mformat w: ; sync
89 syslinux $(obj)/fdimage ; sync 99 syslinux $(obj)/fdimage ; sync
90 echo 'default linux $(FDARGS)' | \ 100 echo '$(image_cmdline)' | \
91 MTOOLSRC=$(obj)/mtools.conf mcopy - w:syslinux.cfg 101 MTOOLSRC=$(obj)/mtools.conf mcopy - w:syslinux.cfg
102 if [ -f '$(FDINITRD)' ] ; then \
103 MTOOLSRC=$(obj)/mtools.conf mcopy '$(FDINITRD)' w:initrd.img ; \
104 fi
92 MTOOLSRC=$(obj)/mtools.conf mcopy $(BOOTIMAGE) w:linux ; sync 105 MTOOLSRC=$(obj)/mtools.conf mcopy $(BOOTIMAGE) w:linux ; sync
93 106
107isoimage: $(BOOTIMAGE)
108 -rm -rf $(obj)/isoimage
109 mkdir $(obj)/isoimage
110 cp `echo /usr/lib*/syslinux/isolinux.bin | awk '{ print $1; }'` \
111 $(obj)/isoimage
112 cp $(BOOTIMAGE) $(obj)/isoimage/linux
113 echo '$(image_cmdline)' > $(obj)/isoimage/isolinux.cfg
114 if [ -f '$(FDINITRD)' ] ; then \
115 cp '$(FDINITRD)' $(obj)/isoimage/initrd.img ; \
116 fi
117 mkisofs -J -r -o $(obj)/image.iso -b isolinux.bin -c boot.cat \
118 -no-emul-boot -boot-load-size 4 -boot-info-table \
119 $(obj)/isoimage
120 rm -rf $(obj)/isoimage
121
94zlilo: $(BOOTIMAGE) 122zlilo: $(BOOTIMAGE)
95 if [ -f $(INSTALL_PATH)/vmlinuz ]; then mv $(INSTALL_PATH)/vmlinuz $(INSTALL_PATH)/vmlinuz.old; fi 123 if [ -f $(INSTALL_PATH)/vmlinuz ]; then mv $(INSTALL_PATH)/vmlinuz $(INSTALL_PATH)/vmlinuz.old; fi
96 if [ -f $(INSTALL_PATH)/System.map ]; then mv $(INSTALL_PATH)/System.map $(INSTALL_PATH)/System.old; fi 124 if [ -f $(INSTALL_PATH)/System.map ]; then mv $(INSTALL_PATH)/System.map $(INSTALL_PATH)/System.old; fi
diff --git a/arch/x86_64/crypto/aes.c b/arch/x86_64/crypto/aes.c
index fb1b961a2e2f..6f77e7700d32 100644
--- a/arch/x86_64/crypto/aes.c
+++ b/arch/x86_64/crypto/aes.c
@@ -77,12 +77,11 @@ static inline u8 byte(const u32 x, const unsigned n)
77struct aes_ctx 77struct aes_ctx
78{ 78{
79 u32 key_length; 79 u32 key_length;
80 u32 E[60]; 80 u32 buf[120];
81 u32 D[60];
82}; 81};
83 82
84#define E_KEY ctx->E 83#define E_KEY (&ctx->buf[0])
85#define D_KEY ctx->D 84#define D_KEY (&ctx->buf[60])
86 85
87static u8 pow_tab[256] __initdata; 86static u8 pow_tab[256] __initdata;
88static u8 log_tab[256] __initdata; 87static u8 log_tab[256] __initdata;
diff --git a/arch/x86_64/defconfig b/arch/x86_64/defconfig
index ce4de61ed85d..566ecc97ee5a 100644
--- a/arch/x86_64/defconfig
+++ b/arch/x86_64/defconfig
@@ -1,7 +1,7 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.16-rc3-git9 3# Linux kernel version: 2.6.16-git9
4# Sat Feb 18 00:27:03 2006 4# Sat Mar 25 15:18:40 2006
5# 5#
6CONFIG_X86_64=y 6CONFIG_X86_64=y
7CONFIG_64BIT=y 7CONFIG_64BIT=y
@@ -38,6 +38,7 @@ CONFIG_SYSCTL=y
38CONFIG_IKCONFIG=y 38CONFIG_IKCONFIG=y
39CONFIG_IKCONFIG_PROC=y 39CONFIG_IKCONFIG_PROC=y
40# CONFIG_CPUSETS is not set 40# CONFIG_CPUSETS is not set
41# CONFIG_RELAY is not set
41CONFIG_INITRAMFS_SOURCE="" 42CONFIG_INITRAMFS_SOURCE=""
42CONFIG_UID16=y 43CONFIG_UID16=y
43CONFIG_VM86=y 44CONFIG_VM86=y
@@ -79,6 +80,7 @@ CONFIG_STOP_MACHINE=y
79# Block layer 80# Block layer
80# 81#
81CONFIG_LBD=y 82CONFIG_LBD=y
83# CONFIG_BLK_DEV_IO_TRACE is not set
82 84
83# 85#
84# IO Schedulers 86# IO Schedulers
@@ -139,7 +141,6 @@ CONFIG_HAVE_ARCH_EARLY_PFN_TO_NID=y
139CONFIG_NR_CPUS=32 141CONFIG_NR_CPUS=32
140CONFIG_HOTPLUG_CPU=y 142CONFIG_HOTPLUG_CPU=y
141CONFIG_HPET_TIMER=y 143CONFIG_HPET_TIMER=y
142CONFIG_X86_PM_TIMER=y
143CONFIG_HPET_EMULATE_RTC=y 144CONFIG_HPET_EMULATE_RTC=y
144CONFIG_GART_IOMMU=y 145CONFIG_GART_IOMMU=y
145CONFIG_SWIOTLB=y 146CONFIG_SWIOTLB=y
@@ -148,12 +149,13 @@ CONFIG_X86_MCE_INTEL=y
148CONFIG_X86_MCE_AMD=y 149CONFIG_X86_MCE_AMD=y
149# CONFIG_KEXEC is not set 150# CONFIG_KEXEC is not set
150# CONFIG_CRASH_DUMP is not set 151# CONFIG_CRASH_DUMP is not set
151CONFIG_PHYSICAL_START=0x100000 152CONFIG_PHYSICAL_START=0x200000
152CONFIG_SECCOMP=y 153CONFIG_SECCOMP=y
153# CONFIG_HZ_100 is not set 154# CONFIG_HZ_100 is not set
154CONFIG_HZ_250=y 155CONFIG_HZ_250=y
155# CONFIG_HZ_1000 is not set 156# CONFIG_HZ_1000 is not set
156CONFIG_HZ=250 157CONFIG_HZ=250
158# CONFIG_REORDER is not set
157CONFIG_GENERIC_HARDIRQS=y 159CONFIG_GENERIC_HARDIRQS=y
158CONFIG_GENERIC_IRQ_PROBE=y 160CONFIG_GENERIC_IRQ_PROBE=y
159CONFIG_ISA_DMA_API=y 161CONFIG_ISA_DMA_API=y
@@ -189,12 +191,14 @@ CONFIG_ACPI_NUMA=y
189# CONFIG_ACPI_ASUS is not set 191# CONFIG_ACPI_ASUS is not set
190# CONFIG_ACPI_IBM is not set 192# CONFIG_ACPI_IBM is not set
191CONFIG_ACPI_TOSHIBA=y 193CONFIG_ACPI_TOSHIBA=y
192CONFIG_ACPI_BLACKLIST_YEAR=2001 194CONFIG_ACPI_BLACKLIST_YEAR=0
193# CONFIG_ACPI_DEBUG is not set 195# CONFIG_ACPI_DEBUG is not set
194CONFIG_ACPI_EC=y 196CONFIG_ACPI_EC=y
195CONFIG_ACPI_POWER=y 197CONFIG_ACPI_POWER=y
196CONFIG_ACPI_SYSTEM=y 198CONFIG_ACPI_SYSTEM=y
199CONFIG_X86_PM_TIMER=y
197CONFIG_ACPI_CONTAINER=y 200CONFIG_ACPI_CONTAINER=y
201CONFIG_ACPI_HOTPLUG_MEMORY=y
198 202
199# 203#
200# CPU Frequency scaling 204# CPU Frequency scaling
@@ -232,10 +236,8 @@ CONFIG_X86_ACPI_CPUFREQ_PROC_INTF=y
232CONFIG_PCI=y 236CONFIG_PCI=y
233CONFIG_PCI_DIRECT=y 237CONFIG_PCI_DIRECT=y
234CONFIG_PCI_MMCONFIG=y 238CONFIG_PCI_MMCONFIG=y
235CONFIG_UNORDERED_IO=y
236CONFIG_PCIEPORTBUS=y 239CONFIG_PCIEPORTBUS=y
237CONFIG_PCI_MSI=y 240CONFIG_PCI_MSI=y
238# CONFIG_PCI_LEGACY_PROC is not set
239# CONFIG_PCI_DEBUG is not set 241# CONFIG_PCI_DEBUG is not set
240 242
241# 243#
@@ -294,6 +296,7 @@ CONFIG_INET_TCP_DIAG=y
294CONFIG_TCP_CONG_BIC=y 296CONFIG_TCP_CONG_BIC=y
295CONFIG_IPV6=y 297CONFIG_IPV6=y
296# CONFIG_IPV6_PRIVACY is not set 298# CONFIG_IPV6_PRIVACY is not set
299# CONFIG_IPV6_ROUTER_PREF is not set
297# CONFIG_INET6_AH is not set 300# CONFIG_INET6_AH is not set
298# CONFIG_INET6_ESP is not set 301# CONFIG_INET6_ESP is not set
299# CONFIG_INET6_IPCOMP is not set 302# CONFIG_INET6_IPCOMP is not set
@@ -701,6 +704,7 @@ CONFIG_S2IO=m
701# Wireless LAN (non-hamradio) 704# Wireless LAN (non-hamradio)
702# 705#
703# CONFIG_NET_RADIO is not set 706# CONFIG_NET_RADIO is not set
707# CONFIG_NET_WIRELESS_RTNETLINK is not set
704 708
705# 709#
706# Wan interfaces 710# Wan interfaces
@@ -861,6 +865,8 @@ CONFIG_RTC=y
861CONFIG_AGP=y 865CONFIG_AGP=y
862CONFIG_AGP_AMD64=y 866CONFIG_AGP_AMD64=y
863CONFIG_AGP_INTEL=y 867CONFIG_AGP_INTEL=y
868# CONFIG_AGP_SIS is not set
869# CONFIG_AGP_VIA is not set
864# CONFIG_DRM is not set 870# CONFIG_DRM is not set
865# CONFIG_MWAVE is not set 871# CONFIG_MWAVE is not set
866CONFIG_RAW_DRIVER=y 872CONFIG_RAW_DRIVER=y
@@ -907,10 +913,6 @@ CONFIG_HWMON=y
907# CONFIG_IBM_ASM is not set 913# CONFIG_IBM_ASM is not set
908 914
909# 915#
910# Multimedia Capabilities Port drivers
911#
912
913#
914# Multimedia devices 916# Multimedia devices
915# 917#
916# CONFIG_VIDEO_DEV is not set 918# CONFIG_VIDEO_DEV is not set
@@ -974,6 +976,7 @@ CONFIG_SOUND_ICH=y
974# 976#
975CONFIG_USB_ARCH_HAS_HCD=y 977CONFIG_USB_ARCH_HAS_HCD=y
976CONFIG_USB_ARCH_HAS_OHCI=y 978CONFIG_USB_ARCH_HAS_OHCI=y
979CONFIG_USB_ARCH_HAS_EHCI=y
977CONFIG_USB=y 980CONFIG_USB=y
978# CONFIG_USB_DEBUG is not set 981# CONFIG_USB_DEBUG is not set
979 982
@@ -1002,7 +1005,6 @@ CONFIG_USB_UHCI_HCD=y
1002# 1005#
1003# USB Device Class drivers 1006# USB Device Class drivers
1004# 1007#
1005# CONFIG_OBSOLETE_OSS_USB_DRIVER is not set
1006# CONFIG_USB_ACM is not set 1008# CONFIG_USB_ACM is not set
1007CONFIG_USB_PRINTER=y 1009CONFIG_USB_PRINTER=y
1008 1010
@@ -1121,11 +1123,7 @@ CONFIG_USB_MON=y
1121# CONFIG_INFINIBAND is not set 1123# CONFIG_INFINIBAND is not set
1122 1124
1123# 1125#
1124# SN Devices 1126# EDAC - error detection and reporting (RAS) (EXPERIMENTAL)
1125#
1126
1127#
1128# EDAC - error detection and reporting (RAS)
1129# 1127#
1130# CONFIG_EDAC is not set 1128# CONFIG_EDAC is not set
1131 1129
@@ -1198,7 +1196,6 @@ CONFIG_TMPFS=y
1198CONFIG_HUGETLBFS=y 1196CONFIG_HUGETLBFS=y
1199CONFIG_HUGETLB_PAGE=y 1197CONFIG_HUGETLB_PAGE=y
1200CONFIG_RAMFS=y 1198CONFIG_RAMFS=y
1201CONFIG_RELAYFS_FS=y
1202# CONFIG_CONFIGFS_FS is not set 1199# CONFIG_CONFIGFS_FS is not set
1203 1200
1204# 1201#
@@ -1321,6 +1318,7 @@ CONFIG_DETECT_SOFTLOCKUP=y
1321CONFIG_DEBUG_FS=y 1318CONFIG_DEBUG_FS=y
1322# CONFIG_DEBUG_VM is not set 1319# CONFIG_DEBUG_VM is not set
1323# CONFIG_FRAME_POINTER is not set 1320# CONFIG_FRAME_POINTER is not set
1321# CONFIG_UNWIND_INFO is not set
1324# CONFIG_FORCED_INLINING is not set 1322# CONFIG_FORCED_INLINING is not set
1325# CONFIG_RCU_TORTURE_TEST is not set 1323# CONFIG_RCU_TORTURE_TEST is not set
1326# CONFIG_DEBUG_RODATA is not set 1324# CONFIG_DEBUG_RODATA is not set
diff --git a/arch/x86_64/ia32/ia32_binfmt.c b/arch/x86_64/ia32/ia32_binfmt.c
index 572b3b28772d..e776139afb20 100644
--- a/arch/x86_64/ia32/ia32_binfmt.c
+++ b/arch/x86_64/ia32/ia32_binfmt.c
@@ -58,7 +58,7 @@ struct elf_phdr;
58 58
59#define USE_ELF_CORE_DUMP 1 59#define USE_ELF_CORE_DUMP 1
60 60
61/* Overwrite elfcore.h */ 61/* Override elfcore.h */
62#define _LINUX_ELFCORE_H 1 62#define _LINUX_ELFCORE_H 1
63typedef unsigned int elf_greg_t; 63typedef unsigned int elf_greg_t;
64 64
diff --git a/arch/x86_64/ia32/ia32entry.S b/arch/x86_64/ia32/ia32entry.S
index 00dee176c08e..35b2faccdc6c 100644
--- a/arch/x86_64/ia32/ia32entry.S
+++ b/arch/x86_64/ia32/ia32entry.S
@@ -501,7 +501,7 @@ ia32_sys_call_table:
501 .quad sys_setdomainname 501 .quad sys_setdomainname
502 .quad sys_uname 502 .quad sys_uname
503 .quad sys_modify_ldt 503 .quad sys_modify_ldt
504 .quad sys32_adjtimex 504 .quad compat_sys_adjtimex
505 .quad sys32_mprotect /* 125 */ 505 .quad sys32_mprotect /* 125 */
506 .quad compat_sys_sigprocmask 506 .quad compat_sys_sigprocmask
507 .quad quiet_ni_syscall /* create_module */ 507 .quad quiet_ni_syscall /* create_module */
@@ -688,6 +688,8 @@ ia32_sys_call_table:
688 .quad sys_ni_syscall /* pselect6 for now */ 688 .quad sys_ni_syscall /* pselect6 for now */
689 .quad sys_ni_syscall /* ppoll for now */ 689 .quad sys_ni_syscall /* ppoll for now */
690 .quad sys_unshare /* 310 */ 690 .quad sys_unshare /* 310 */
691 .quad compat_sys_set_robust_list
692 .quad compat_sys_get_robust_list
691ia32_syscall_end: 693ia32_syscall_end:
692 .rept IA32_NR_syscalls-(ia32_syscall_end-ia32_sys_call_table)/8 694 .rept IA32_NR_syscalls-(ia32_syscall_end-ia32_sys_call_table)/8
693 .quad ni_syscall 695 .quad ni_syscall
diff --git a/arch/x86_64/ia32/sys_ia32.c b/arch/x86_64/ia32/sys_ia32.c
index 2bc55af95419..f182b20858e2 100644
--- a/arch/x86_64/ia32/sys_ia32.c
+++ b/arch/x86_64/ia32/sys_ia32.c
@@ -30,7 +30,6 @@
30#include <linux/resource.h> 30#include <linux/resource.h>
31#include <linux/times.h> 31#include <linux/times.h>
32#include <linux/utsname.h> 32#include <linux/utsname.h>
33#include <linux/timex.h>
34#include <linux/smp.h> 33#include <linux/smp.h>
35#include <linux/smp_lock.h> 34#include <linux/smp_lock.h>
36#include <linux/sem.h> 35#include <linux/sem.h>
@@ -430,24 +429,12 @@ put_tv32(struct compat_timeval __user *o, struct timeval *i)
430 return err; 429 return err;
431} 430}
432 431
433extern int do_setitimer(int which, struct itimerval *, struct itimerval *); 432extern unsigned int alarm_setitimer(unsigned int seconds);
434 433
435asmlinkage long 434asmlinkage long
436sys32_alarm(unsigned int seconds) 435sys32_alarm(unsigned int seconds)
437{ 436{
438 struct itimerval it_new, it_old; 437 return alarm_setitimer(seconds);
439 unsigned int oldalarm;
440
441 it_new.it_interval.tv_sec = it_new.it_interval.tv_usec = 0;
442 it_new.it_value.tv_sec = seconds;
443 it_new.it_value.tv_usec = 0;
444 do_setitimer(ITIMER_REAL, &it_new, &it_old);
445 oldalarm = it_old.it_value.tv_sec;
446 /* ehhh.. We can't return 0 if we have an alarm pending.. */
447 /* And we'd better return too much than too little anyway */
448 if (it_old.it_value.tv_usec)
449 oldalarm++;
450 return oldalarm;
451} 438}
452 439
453/* Translations due to time_t size differences. Which affects all 440/* Translations due to time_t size differences. Which affects all
@@ -779,82 +766,6 @@ sys32_sendfile(int out_fd, int in_fd, compat_off_t __user *offset, s32 count)
779 return ret; 766 return ret;
780} 767}
781 768
782/* Handle adjtimex compatibility. */
783
784struct timex32 {
785 u32 modes;
786 s32 offset, freq, maxerror, esterror;
787 s32 status, constant, precision, tolerance;
788 struct compat_timeval time;
789 s32 tick;
790 s32 ppsfreq, jitter, shift, stabil;
791 s32 jitcnt, calcnt, errcnt, stbcnt;
792 s32 :32; s32 :32; s32 :32; s32 :32;
793 s32 :32; s32 :32; s32 :32; s32 :32;
794 s32 :32; s32 :32; s32 :32; s32 :32;
795};
796
797extern int do_adjtimex(struct timex *);
798
799asmlinkage long
800sys32_adjtimex(struct timex32 __user *utp)
801{
802 struct timex txc;
803 int ret;
804
805 memset(&txc, 0, sizeof(struct timex));
806
807 if (!access_ok(VERIFY_READ, utp, sizeof(struct timex32)) ||
808 __get_user(txc.modes, &utp->modes) ||
809 __get_user(txc.offset, &utp->offset) ||
810 __get_user(txc.freq, &utp->freq) ||
811 __get_user(txc.maxerror, &utp->maxerror) ||
812 __get_user(txc.esterror, &utp->esterror) ||
813 __get_user(txc.status, &utp->status) ||
814 __get_user(txc.constant, &utp->constant) ||
815 __get_user(txc.precision, &utp->precision) ||
816 __get_user(txc.tolerance, &utp->tolerance) ||
817 __get_user(txc.time.tv_sec, &utp->time.tv_sec) ||
818 __get_user(txc.time.tv_usec, &utp->time.tv_usec) ||
819 __get_user(txc.tick, &utp->tick) ||
820 __get_user(txc.ppsfreq, &utp->ppsfreq) ||
821 __get_user(txc.jitter, &utp->jitter) ||
822 __get_user(txc.shift, &utp->shift) ||
823 __get_user(txc.stabil, &utp->stabil) ||
824 __get_user(txc.jitcnt, &utp->jitcnt) ||
825 __get_user(txc.calcnt, &utp->calcnt) ||
826 __get_user(txc.errcnt, &utp->errcnt) ||
827 __get_user(txc.stbcnt, &utp->stbcnt))
828 return -EFAULT;
829
830 ret = do_adjtimex(&txc);
831
832 if (!access_ok(VERIFY_WRITE, utp, sizeof(struct timex32)) ||
833 __put_user(txc.modes, &utp->modes) ||
834 __put_user(txc.offset, &utp->offset) ||
835 __put_user(txc.freq, &utp->freq) ||
836 __put_user(txc.maxerror, &utp->maxerror) ||
837 __put_user(txc.esterror, &utp->esterror) ||
838 __put_user(txc.status, &utp->status) ||
839 __put_user(txc.constant, &utp->constant) ||
840 __put_user(txc.precision, &utp->precision) ||
841 __put_user(txc.tolerance, &utp->tolerance) ||
842 __put_user(txc.time.tv_sec, &utp->time.tv_sec) ||
843 __put_user(txc.time.tv_usec, &utp->time.tv_usec) ||
844 __put_user(txc.tick, &utp->tick) ||
845 __put_user(txc.ppsfreq, &utp->ppsfreq) ||
846 __put_user(txc.jitter, &utp->jitter) ||
847 __put_user(txc.shift, &utp->shift) ||
848 __put_user(txc.stabil, &utp->stabil) ||
849 __put_user(txc.jitcnt, &utp->jitcnt) ||
850 __put_user(txc.calcnt, &utp->calcnt) ||
851 __put_user(txc.errcnt, &utp->errcnt) ||
852 __put_user(txc.stbcnt, &utp->stbcnt))
853 ret = -EFAULT;
854
855 return ret;
856}
857
858asmlinkage long sys32_mmap2(unsigned long addr, unsigned long len, 769asmlinkage long sys32_mmap2(unsigned long addr, unsigned long len,
859 unsigned long prot, unsigned long flags, 770 unsigned long prot, unsigned long flags,
860 unsigned long fd, unsigned long pgoff) 771 unsigned long fd, unsigned long pgoff)
diff --git a/arch/x86_64/ia32/vsyscall-sigreturn.S b/arch/x86_64/ia32/vsyscall-sigreturn.S
index d90321fe9bba..1384367cdbe1 100644
--- a/arch/x86_64/ia32/vsyscall-sigreturn.S
+++ b/arch/x86_64/ia32/vsyscall-sigreturn.S
@@ -32,9 +32,28 @@ __kernel_rt_sigreturn:
32 .size __kernel_rt_sigreturn,.-.LSTART_rt_sigreturn 32 .size __kernel_rt_sigreturn,.-.LSTART_rt_sigreturn
33 33
34 .section .eh_frame,"a",@progbits 34 .section .eh_frame,"a",@progbits
35.LSTARTFRAMES:
36 .long .LENDCIES-.LSTARTCIES
37.LSTARTCIES:
38 .long 0 /* CIE ID */
39 .byte 1 /* Version number */
40 .string "zRS" /* NUL-terminated augmentation string */
41 .uleb128 1 /* Code alignment factor */
42 .sleb128 -4 /* Data alignment factor */
43 .byte 8 /* Return address register column */
44 .uleb128 1 /* Augmentation value length */
45 .byte 0x1b /* DW_EH_PE_pcrel|DW_EH_PE_sdata4. */
46 .byte 0x0c /* DW_CFA_def_cfa */
47 .uleb128 4
48 .uleb128 4
49 .byte 0x88 /* DW_CFA_offset, column 0x8 */
50 .uleb128 1
51 .align 4
52.LENDCIES:
53
35 .long .LENDFDE2-.LSTARTFDE2 /* Length FDE */ 54 .long .LENDFDE2-.LSTARTFDE2 /* Length FDE */
36.LSTARTFDE2: 55.LSTARTFDE2:
37 .long .LSTARTFDE2-.LSTARTFRAME /* CIE pointer */ 56 .long .LSTARTFDE2-.LSTARTFRAMES /* CIE pointer */
38 /* HACK: The dwarf2 unwind routines will subtract 1 from the 57 /* HACK: The dwarf2 unwind routines will subtract 1 from the
39 return address to get an address in the middle of the 58 return address to get an address in the middle of the
40 presumed call instruction. Since we didn't get here via 59 presumed call instruction. Since we didn't get here via
@@ -97,7 +116,7 @@ __kernel_rt_sigreturn:
97 116
98 .long .LENDFDE3-.LSTARTFDE3 /* Length FDE */ 117 .long .LENDFDE3-.LSTARTFDE3 /* Length FDE */
99.LSTARTFDE3: 118.LSTARTFDE3:
100 .long .LSTARTFDE3-.LSTARTFRAME /* CIE pointer */ 119 .long .LSTARTFDE3-.LSTARTFRAMES /* CIE pointer */
101 /* HACK: See above wrt unwind library assumptions. */ 120 /* HACK: See above wrt unwind library assumptions. */
102 .long .LSTART_rt_sigreturn-1-. /* PC-relative start address */ 121 .long .LSTART_rt_sigreturn-1-. /* PC-relative start address */
103 .long .LEND_rt_sigreturn-.LSTART_rt_sigreturn+1 122 .long .LEND_rt_sigreturn-.LSTART_rt_sigreturn+1
diff --git a/arch/x86_64/kernel/aperture.c b/arch/x86_64/kernel/aperture.c
index a0f955b9995f..fffd6b0a2fab 100644
--- a/arch/x86_64/kernel/aperture.c
+++ b/arch/x86_64/kernel/aperture.c
@@ -60,7 +60,7 @@ static u32 __init allocate_aperture(void)
60 printk("Cannot allocate aperture memory hole (%p,%uK)\n", 60 printk("Cannot allocate aperture memory hole (%p,%uK)\n",
61 p, aper_size>>10); 61 p, aper_size>>10);
62 if (p) 62 if (p)
63 free_bootmem_node(nd0, (unsigned long)p, aper_size); 63 free_bootmem_node(nd0, __pa(p), aper_size);
64 return 0; 64 return 0;
65 } 65 }
66 printk("Mapping aperture over %d KB of RAM @ %lx\n", 66 printk("Mapping aperture over %d KB of RAM @ %lx\n",
@@ -161,7 +161,7 @@ static __u32 __init search_agp_bridge(u32 *order, int *valid_agp)
161 int num, slot, func; 161 int num, slot, func;
162 162
163 /* Poor man's PCI discovery */ 163 /* Poor man's PCI discovery */
164 for (num = 0; num < 32; num++) { 164 for (num = 0; num < 256; num++) {
165 for (slot = 0; slot < 32; slot++) { 165 for (slot = 0; slot < 32; slot++) {
166 for (func = 0; func < 8; func++) { 166 for (func = 0; func < 8; func++) {
167 u32 class, cap; 167 u32 class, cap;
diff --git a/arch/x86_64/kernel/apic.c b/arch/x86_64/kernel/apic.c
index e5b14c57eaa0..100a30c40044 100644
--- a/arch/x86_64/kernel/apic.c
+++ b/arch/x86_64/kernel/apic.c
@@ -342,6 +342,7 @@ void __init init_bsp_APIC(void)
342void __cpuinit setup_local_APIC (void) 342void __cpuinit setup_local_APIC (void)
343{ 343{
344 unsigned int value, maxlvt; 344 unsigned int value, maxlvt;
345 int i, j;
345 346
346 value = apic_read(APIC_LVR); 347 value = apic_read(APIC_LVR);
347 348
@@ -371,6 +372,25 @@ void __cpuinit setup_local_APIC (void)
371 apic_write(APIC_TASKPRI, value); 372 apic_write(APIC_TASKPRI, value);
372 373
373 /* 374 /*
375 * After a crash, we no longer service the interrupts and a pending
376 * interrupt from previous kernel might still have ISR bit set.
377 *
378 * Most probably by now CPU has serviced that pending interrupt and
379 * it might not have done the ack_APIC_irq() because it thought,
380 * interrupt came from i8259 as ExtInt. LAPIC did not get EOI so it
381 * does not clear the ISR bit and cpu thinks it has already serivced
382 * the interrupt. Hence a vector might get locked. It was noticed
383 * for timer irq (vector 0x31). Issue an extra EOI to clear ISR.
384 */
385 for (i = APIC_ISR_NR - 1; i >= 0; i--) {
386 value = apic_read(APIC_ISR + i*0x10);
387 for (j = 31; j >= 0; j--) {
388 if (value & (1<<j))
389 ack_APIC_irq();
390 }
391 }
392
393 /*
374 * Now that we are all set up, enable the APIC 394 * Now that we are all set up, enable the APIC
375 */ 395 */
376 value = apic_read(APIC_SPIV); 396 value = apic_read(APIC_SPIV);
@@ -595,7 +615,7 @@ static int __init apic_set_verbosity(char *str)
595 printk(KERN_WARNING "APIC Verbosity level %s not recognised" 615 printk(KERN_WARNING "APIC Verbosity level %s not recognised"
596 " use apic=verbose or apic=debug", str); 616 " use apic=verbose or apic=debug", str);
597 617
598 return 0; 618 return 1;
599} 619}
600 620
601__setup("apic=", apic_set_verbosity); 621__setup("apic=", apic_set_verbosity);
@@ -1117,35 +1137,35 @@ int __init APIC_init_uniprocessor (void)
1117static __init int setup_disableapic(char *str) 1137static __init int setup_disableapic(char *str)
1118{ 1138{
1119 disable_apic = 1; 1139 disable_apic = 1;
1120 return 0; 1140 return 1;
1121} 1141}
1122 1142
1123static __init int setup_nolapic(char *str) 1143static __init int setup_nolapic(char *str)
1124{ 1144{
1125 disable_apic = 1; 1145 disable_apic = 1;
1126 return 0; 1146 return 1;
1127} 1147}
1128 1148
1129static __init int setup_noapictimer(char *str) 1149static __init int setup_noapictimer(char *str)
1130{ 1150{
1131 if (str[0] != ' ' && str[0] != 0) 1151 if (str[0] != ' ' && str[0] != 0)
1132 return -1; 1152 return 0;
1133 disable_apic_timer = 1; 1153 disable_apic_timer = 1;
1134 return 0; 1154 return 1;
1135} 1155}
1136 1156
1137static __init int setup_apicmaintimer(char *str) 1157static __init int setup_apicmaintimer(char *str)
1138{ 1158{
1139 apic_runs_main_timer = 1; 1159 apic_runs_main_timer = 1;
1140 nohpet = 1; 1160 nohpet = 1;
1141 return 0; 1161 return 1;
1142} 1162}
1143__setup("apicmaintimer", setup_apicmaintimer); 1163__setup("apicmaintimer", setup_apicmaintimer);
1144 1164
1145static __init int setup_noapicmaintimer(char *str) 1165static __init int setup_noapicmaintimer(char *str)
1146{ 1166{
1147 apic_runs_main_timer = -1; 1167 apic_runs_main_timer = -1;
1148 return 0; 1168 return 1;
1149} 1169}
1150__setup("noapicmaintimer", setup_noapicmaintimer); 1170__setup("noapicmaintimer", setup_noapicmaintimer);
1151 1171
diff --git a/arch/x86_64/kernel/early_printk.c b/arch/x86_64/kernel/early_printk.c
index 6dffb498ccd7..b93ef5b51980 100644
--- a/arch/x86_64/kernel/early_printk.c
+++ b/arch/x86_64/kernel/early_printk.c
@@ -17,11 +17,8 @@
17#define VGABASE ((void __iomem *)0xffffffff800b8000UL) 17#define VGABASE ((void __iomem *)0xffffffff800b8000UL)
18#endif 18#endif
19 19
20#define MAX_YPOS max_ypos
21#define MAX_XPOS max_xpos
22
23static int max_ypos = 25, max_xpos = 80; 20static int max_ypos = 25, max_xpos = 80;
24static int current_ypos = 1, current_xpos = 0; 21static int current_ypos = 25, current_xpos = 0;
25 22
26static void early_vga_write(struct console *con, const char *str, unsigned n) 23static void early_vga_write(struct console *con, const char *str, unsigned n)
27{ 24{
@@ -29,26 +26,26 @@ static void early_vga_write(struct console *con, const char *str, unsigned n)
29 int i, k, j; 26 int i, k, j;
30 27
31 while ((c = *str++) != '\0' && n-- > 0) { 28 while ((c = *str++) != '\0' && n-- > 0) {
32 if (current_ypos >= MAX_YPOS) { 29 if (current_ypos >= max_ypos) {
33 /* scroll 1 line up */ 30 /* scroll 1 line up */
34 for (k = 1, j = 0; k < MAX_YPOS; k++, j++) { 31 for (k = 1, j = 0; k < max_ypos; k++, j++) {
35 for (i = 0; i < MAX_XPOS; i++) { 32 for (i = 0; i < max_xpos; i++) {
36 writew(readw(VGABASE + 2*(MAX_XPOS*k + i)), 33 writew(readw(VGABASE+2*(max_xpos*k+i)),
37 VGABASE + 2*(MAX_XPOS*j + i)); 34 VGABASE + 2*(max_xpos*j + i));
38 } 35 }
39 } 36 }
40 for (i = 0; i < MAX_XPOS; i++) 37 for (i = 0; i < max_xpos; i++)
41 writew(0x720, VGABASE + 2*(MAX_XPOS*j + i)); 38 writew(0x720, VGABASE + 2*(max_xpos*j + i));
42 current_ypos = MAX_YPOS-1; 39 current_ypos = max_ypos-1;
43 } 40 }
44 if (c == '\n') { 41 if (c == '\n') {
45 current_xpos = 0; 42 current_xpos = 0;
46 current_ypos++; 43 current_ypos++;
47 } else if (c != '\r') { 44 } else if (c != '\r') {
48 writew(((0x7 << 8) | (unsigned short) c), 45 writew(((0x7 << 8) | (unsigned short) c),
49 VGABASE + 2*(MAX_XPOS*current_ypos + 46 VGABASE + 2*(max_xpos*current_ypos +
50 current_xpos++)); 47 current_xpos++));
51 if (current_xpos >= MAX_XPOS) { 48 if (current_xpos >= max_xpos) {
52 current_xpos = 0; 49 current_xpos = 0;
53 current_ypos++; 50 current_ypos++;
54 } 51 }
@@ -63,7 +60,7 @@ static struct console early_vga_console = {
63 .index = -1, 60 .index = -1,
64}; 61};
65 62
66/* Serial functions loosely based on a similar package from Klaus P. Gerlicher */ 63/* Serial functions loosely based on a similar package from Klaus P. Gerlicher */
67 64
68static int early_serial_base = 0x3f8; /* ttyS0 */ 65static int early_serial_base = 0x3f8; /* ttyS0 */
69 66
@@ -83,30 +80,30 @@ static int early_serial_base = 0x3f8; /* ttyS0 */
83#define DLL 0 /* Divisor Latch Low */ 80#define DLL 0 /* Divisor Latch Low */
84#define DLH 1 /* Divisor latch High */ 81#define DLH 1 /* Divisor latch High */
85 82
86static int early_serial_putc(unsigned char ch) 83static int early_serial_putc(unsigned char ch)
87{ 84{
88 unsigned timeout = 0xffff; 85 unsigned timeout = 0xffff;
89 while ((inb(early_serial_base + LSR) & XMTRDY) == 0 && --timeout) 86 while ((inb(early_serial_base + LSR) & XMTRDY) == 0 && --timeout)
90 cpu_relax(); 87 cpu_relax();
91 outb(ch, early_serial_base + TXR); 88 outb(ch, early_serial_base + TXR);
92 return timeout ? 0 : -1; 89 return timeout ? 0 : -1;
93} 90}
94 91
95static void early_serial_write(struct console *con, const char *s, unsigned n) 92static void early_serial_write(struct console *con, const char *s, unsigned n)
96{ 93{
97 while (*s && n-- > 0) { 94 while (*s && n-- > 0) {
98 early_serial_putc(*s); 95 early_serial_putc(*s);
99 if (*s == '\n') 96 if (*s == '\n')
100 early_serial_putc('\r'); 97 early_serial_putc('\r');
101 s++; 98 s++;
102 } 99 }
103} 100}
104 101
105#define DEFAULT_BAUD 9600 102#define DEFAULT_BAUD 9600
106 103
107static __init void early_serial_init(char *s) 104static __init void early_serial_init(char *s)
108{ 105{
109 unsigned char c; 106 unsigned char c;
110 unsigned divisor; 107 unsigned divisor;
111 unsigned baud = DEFAULT_BAUD; 108 unsigned baud = DEFAULT_BAUD;
112 char *e; 109 char *e;
@@ -115,7 +112,7 @@ static __init void early_serial_init(char *s)
115 ++s; 112 ++s;
116 113
117 if (*s) { 114 if (*s) {
118 unsigned port; 115 unsigned port;
119 if (!strncmp(s,"0x",2)) { 116 if (!strncmp(s,"0x",2)) {
120 early_serial_base = simple_strtoul(s, &e, 16); 117 early_serial_base = simple_strtoul(s, &e, 16);
121 } else { 118 } else {
@@ -139,16 +136,16 @@ static __init void early_serial_init(char *s)
139 outb(0x3, early_serial_base + MCR); /* DTR + RTS */ 136 outb(0x3, early_serial_base + MCR); /* DTR + RTS */
140 137
141 if (*s) { 138 if (*s) {
142 baud = simple_strtoul(s, &e, 0); 139 baud = simple_strtoul(s, &e, 0);
143 if (baud == 0 || s == e) 140 if (baud == 0 || s == e)
144 baud = DEFAULT_BAUD; 141 baud = DEFAULT_BAUD;
145 } 142 }
146 143
147 divisor = 115200 / baud; 144 divisor = 115200 / baud;
148 c = inb(early_serial_base + LCR); 145 c = inb(early_serial_base + LCR);
149 outb(c | DLAB, early_serial_base + LCR); 146 outb(c | DLAB, early_serial_base + LCR);
150 outb(divisor & 0xff, early_serial_base + DLL); 147 outb(divisor & 0xff, early_serial_base + DLL);
151 outb((divisor >> 8) & 0xff, early_serial_base + DLH); 148 outb((divisor >> 8) & 0xff, early_serial_base + DLH);
152 outb(c & ~DLAB, early_serial_base + LCR); 149 outb(c & ~DLAB, early_serial_base + LCR);
153} 150}
154 151
@@ -205,67 +202,68 @@ struct console *early_console = &early_vga_console;
205static int early_console_initialized = 0; 202static int early_console_initialized = 0;
206 203
207void early_printk(const char *fmt, ...) 204void early_printk(const char *fmt, ...)
208{ 205{
209 char buf[512]; 206 char buf[512];
210 int n; 207 int n;
211 va_list ap; 208 va_list ap;
212 209
213 va_start(ap,fmt); 210 va_start(ap,fmt);
214 n = vscnprintf(buf,512,fmt,ap); 211 n = vscnprintf(buf,512,fmt,ap);
215 early_console->write(early_console,buf,n); 212 early_console->write(early_console,buf,n);
216 va_end(ap); 213 va_end(ap);
217} 214}
218 215
219static int __initdata keep_early; 216static int __initdata keep_early;
220 217
221int __init setup_early_printk(char *opt) 218int __init setup_early_printk(char *opt)
222{ 219{
223 char *space; 220 char *space;
224 char buf[256]; 221 char buf[256];
225 222
226 if (early_console_initialized) 223 if (early_console_initialized)
227 return -1; 224 return 1;
228 225
229 strlcpy(buf,opt,sizeof(buf)); 226 strlcpy(buf,opt,sizeof(buf));
230 space = strchr(buf, ' '); 227 space = strchr(buf, ' ');
231 if (space) 228 if (space)
232 *space = 0; 229 *space = 0;
233 230
234 if (strstr(buf,"keep")) 231 if (strstr(buf,"keep"))
235 keep_early = 1; 232 keep_early = 1;
236 233
237 if (!strncmp(buf, "serial", 6)) { 234 if (!strncmp(buf, "serial", 6)) {
238 early_serial_init(buf + 6); 235 early_serial_init(buf + 6);
239 early_console = &early_serial_console; 236 early_console = &early_serial_console;
240 } else if (!strncmp(buf, "ttyS", 4)) { 237 } else if (!strncmp(buf, "ttyS", 4)) {
241 early_serial_init(buf); 238 early_serial_init(buf);
242 early_console = &early_serial_console; 239 early_console = &early_serial_console;
243 } else if (!strncmp(buf, "vga", 3) 240 } else if (!strncmp(buf, "vga", 3)
244 && SCREEN_INFO.orig_video_isVGA == 1) { 241 && SCREEN_INFO.orig_video_isVGA == 1) {
245 max_xpos = SCREEN_INFO.orig_video_cols; 242 max_xpos = SCREEN_INFO.orig_video_cols;
246 max_ypos = SCREEN_INFO.orig_video_lines; 243 max_ypos = SCREEN_INFO.orig_video_lines;
247 early_console = &early_vga_console; 244 current_ypos = SCREEN_INFO.orig_y;
245 early_console = &early_vga_console;
248 } else if (!strncmp(buf, "simnow", 6)) { 246 } else if (!strncmp(buf, "simnow", 6)) {
249 simnow_init(buf + 6); 247 simnow_init(buf + 6);
250 early_console = &simnow_console; 248 early_console = &simnow_console;
251 keep_early = 1; 249 keep_early = 1;
252 } 250 }
253 early_console_initialized = 1; 251 early_console_initialized = 1;
254 register_console(early_console); 252 register_console(early_console);
255 return 0; 253 return 0;
256} 254}
257 255
258void __init disable_early_printk(void) 256void __init disable_early_printk(void)
259{ 257{
260 if (!early_console_initialized || !early_console) 258 if (!early_console_initialized || !early_console)
261 return; 259 return;
262 if (!keep_early) { 260 if (!keep_early) {
263 printk("disabling early console\n"); 261 printk("disabling early console\n");
264 unregister_console(early_console); 262 unregister_console(early_console);
265 early_console_initialized = 0; 263 early_console_initialized = 0;
266 } else { 264 } else {
267 printk("keeping early console\n"); 265 printk("keeping early console\n");
268 } 266 }
269} 267}
270 268
271__setup("earlyprintk=", setup_early_printk); 269__setup("earlyprintk=", setup_early_printk);
diff --git a/arch/x86_64/kernel/entry.S b/arch/x86_64/kernel/entry.S
index 22cb6ee074b9..8538bfea30e6 100644
--- a/arch/x86_64/kernel/entry.S
+++ b/arch/x86_64/kernel/entry.S
@@ -178,12 +178,6 @@ rff_trace:
178 * Interrupts are off on entry. 178 * Interrupts are off on entry.
179 * Only called from user space. 179 * Only called from user space.
180 * 180 *
181 * EM64T CPUs have somewhat weird error reporting for non canonical RIPs in SYSRET.
182 * We can't handle any exceptions there because the exception handler would
183 * end up running on the user stack which is unsafe. To avoid problems
184 * any code that might end up with a user touched pt_regs should return
185 * using int_ret_from_syscall.
186 *
187 * XXX if we had a free scratch register we could save the RSP into the stack frame 181 * XXX if we had a free scratch register we could save the RSP into the stack frame
188 * and report it properly in ps. Unfortunately we haven't. 182 * and report it properly in ps. Unfortunately we haven't.
189 */ 183 */
@@ -260,9 +254,7 @@ sysret_signal:
260 xorl %esi,%esi # oldset -> arg2 254 xorl %esi,%esi # oldset -> arg2
261 call ptregscall_common 255 call ptregscall_common
2621: movl $_TIF_NEED_RESCHED,%edi 2561: movl $_TIF_NEED_RESCHED,%edi
263 /* Stack frame might have been changed. The IRET path does 257 jmp sysret_check
264 some additional checks to handle this */
265 jmp int_with_check
266 258
267badsys: 259badsys:
268 movq $-ENOSYS,RAX-ARGOFFSET(%rsp) 260 movq $-ENOSYS,RAX-ARGOFFSET(%rsp)
@@ -288,8 +280,7 @@ tracesys:
288 call syscall_trace_leave 280 call syscall_trace_leave
289 RESTORE_TOP_OF_STACK %rbx 281 RESTORE_TOP_OF_STACK %rbx
290 RESTORE_REST 282 RESTORE_REST
291 /* Stack frame might have been changed. Use the more careful IRET path */ 283 jmp ret_from_sys_call
292 jmp int_ret_from_sys_call
293 CFI_ENDPROC 284 CFI_ENDPROC
294 285
295/* 286/*
@@ -417,9 +408,25 @@ ENTRY(stub_execve)
417 CFI_ADJUST_CFA_OFFSET -8 408 CFI_ADJUST_CFA_OFFSET -8
418 CFI_REGISTER rip, r11 409 CFI_REGISTER rip, r11
419 SAVE_REST 410 SAVE_REST
411 movq %r11, %r15
412 CFI_REGISTER rip, r15
420 FIXUP_TOP_OF_STACK %r11 413 FIXUP_TOP_OF_STACK %r11
421 call sys_execve 414 call sys_execve
415 GET_THREAD_INFO(%rcx)
416 bt $TIF_IA32,threadinfo_flags(%rcx)
417 CFI_REMEMBER_STATE
418 jc exec_32bit
422 RESTORE_TOP_OF_STACK %r11 419 RESTORE_TOP_OF_STACK %r11
420 movq %r15, %r11
421 CFI_REGISTER rip, r11
422 RESTORE_REST
423 pushq %r11
424 CFI_ADJUST_CFA_OFFSET 8
425 CFI_REL_OFFSET rip, 0
426 ret
427
428exec_32bit:
429 CFI_RESTORE_STATE
423 movq %rax,RAX(%rsp) 430 movq %rax,RAX(%rsp)
424 RESTORE_REST 431 RESTORE_REST
425 jmp int_ret_from_sys_call 432 jmp int_ret_from_sys_call
@@ -546,7 +553,7 @@ iret_label:
546 /* force a signal here? this matches i386 behaviour */ 553 /* force a signal here? this matches i386 behaviour */
547 /* running with kernel gs */ 554 /* running with kernel gs */
548bad_iret: 555bad_iret:
549 movq $-9999,%rdi /* better code? */ 556 movq $11,%rdi /* SIGSEGV */
550 sti 557 sti
551 jmp do_exit 558 jmp do_exit
552 .previous 559 .previous
diff --git a/arch/x86_64/kernel/functionlist b/arch/x86_64/kernel/functionlist
new file mode 100644
index 000000000000..2bcebdc3eedb
--- /dev/null
+++ b/arch/x86_64/kernel/functionlist
@@ -0,0 +1,1286 @@
1*(.text.flush_thread)
2*(.text.check_poison_obj)
3*(.text.copy_page)
4*(.text.__set_personality)
5*(.text.gart_map_sg)
6*(.text.kmem_cache_free)
7*(.text.find_get_page)
8*(.text._raw_spin_lock)
9*(.text.ide_outb)
10*(.text.unmap_vmas)
11*(.text.copy_page_range)
12*(.text.kprobe_handler)
13*(.text.__handle_mm_fault)
14*(.text.__d_lookup)
15*(.text.copy_user_generic)
16*(.text.__link_path_walk)
17*(.text.get_page_from_freelist)
18*(.text.kmem_cache_alloc)
19*(.text.drive_cmd_intr)
20*(.text.ia32_setup_sigcontext)
21*(.text.huge_pte_offset)
22*(.text.do_page_fault)
23*(.text.page_remove_rmap)
24*(.text.release_pages)
25*(.text.ide_end_request)
26*(.text.__mutex_lock_slowpath)
27*(.text.__find_get_block)
28*(.text.kfree)
29*(.text.vfs_read)
30*(.text._raw_spin_unlock)
31*(.text.free_hot_cold_page)
32*(.text.fget_light)
33*(.text.schedule)
34*(.text.memcmp)
35*(.text.touch_atime)
36*(.text.__might_sleep)
37*(.text.__down_read_trylock)
38*(.text.arch_pick_mmap_layout)
39*(.text.find_vma)
40*(.text.__make_request)
41*(.text.do_generic_mapping_read)
42*(.text.mutex_lock_interruptible)
43*(.text.__generic_file_aio_read)
44*(.text._atomic_dec_and_lock)
45*(.text.__wake_up_bit)
46*(.text.add_to_page_cache)
47*(.text.cache_alloc_debugcheck_after)
48*(.text.vm_normal_page)
49*(.text.mutex_debug_check_no_locks_freed)
50*(.text.net_rx_action)
51*(.text.__find_first_zero_bit)
52*(.text.put_page)
53*(.text._raw_read_lock)
54*(.text.__delay)
55*(.text.dnotify_parent)
56*(.text.do_path_lookup)
57*(.text.do_sync_read)
58*(.text.do_lookup)
59*(.text.bit_waitqueue)
60*(.text.file_read_actor)
61*(.text.strncpy_from_user)
62*(.text.__pagevec_lru_add_active)
63*(.text.fget)
64*(.text.dput)
65*(.text.__strnlen_user)
66*(.text.inotify_inode_queue_event)
67*(.text.rw_verify_area)
68*(.text.ide_intr)
69*(.text.inotify_dentry_parent_queue_event)
70*(.text.permission)
71*(.text.memscan)
72*(.text.hpet_rtc_interrupt)
73*(.text.do_mmap_pgoff)
74*(.text.current_fs_time)
75*(.text.vfs_getattr)
76*(.text.kmem_flagcheck)
77*(.text.mark_page_accessed)
78*(.text.free_pages_and_swap_cache)
79*(.text.generic_fillattr)
80*(.text.__block_prepare_write)
81*(.text.__set_page_dirty_nobuffers)
82*(.text.link_path_walk)
83*(.text.find_get_pages_tag)
84*(.text.ide_do_request)
85*(.text.__alloc_pages)
86*(.text.generic_permission)
87*(.text.mod_page_state_offset)
88*(.text.free_pgd_range)
89*(.text.generic_file_buffered_write)
90*(.text.number)
91*(.text.ide_do_rw_disk)
92*(.text.__brelse)
93*(.text.__mod_page_state_offset)
94*(.text.rotate_reclaimable_page)
95*(.text.find_vma_prepare)
96*(.text.find_vma_prev)
97*(.text.lru_cache_add_active)
98*(.text.__kmalloc_track_caller)
99*(.text.smp_invalidate_interrupt)
100*(.text.handle_IRQ_event)
101*(.text.__find_get_block_slow)
102*(.text.do_wp_page)
103*(.text.do_select)
104*(.text.set_user_nice)
105*(.text.sys_read)
106*(.text.do_munmap)
107*(.text.csum_partial)
108*(.text.__do_softirq)
109*(.text.may_open)
110*(.text.getname)
111*(.text.get_empty_filp)
112*(.text.__fput)
113*(.text.remove_mapping)
114*(.text.filp_ctor)
115*(.text.poison_obj)
116*(.text.unmap_region)
117*(.text.test_set_page_writeback)
118*(.text.__do_page_cache_readahead)
119*(.text.sock_def_readable)
120*(.text.ide_outl)
121*(.text.shrink_zone)
122*(.text.rb_insert_color)
123*(.text.get_request)
124*(.text.sys_pread64)
125*(.text.spin_bug)
126*(.text.ide_outsl)
127*(.text.mask_and_ack_8259A)
128*(.text.filemap_nopage)
129*(.text.page_add_file_rmap)
130*(.text.find_lock_page)
131*(.text.tcp_poll)
132*(.text.__mark_inode_dirty)
133*(.text.file_ra_state_init)
134*(.text.generic_file_llseek)
135*(.text.__pagevec_lru_add)
136*(.text.page_cache_readahead)
137*(.text.n_tty_receive_buf)
138*(.text.zonelist_policy)
139*(.text.vma_adjust)
140*(.text.test_clear_page_dirty)
141*(.text.sync_buffer)
142*(.text.do_exit)
143*(.text.__bitmap_weight)
144*(.text.alloc_pages_current)
145*(.text.get_unused_fd)
146*(.text.zone_watermark_ok)
147*(.text.cpuset_update_task_memory_state)
148*(.text.__bitmap_empty)
149*(.text.sys_munmap)
150*(.text.__inode_dir_notify)
151*(.text.__generic_file_aio_write_nolock)
152*(.text.__pte_alloc)
153*(.text.sys_select)
154*(.text.vm_acct_memory)
155*(.text.vfs_write)
156*(.text.__lru_add_drain)
157*(.text.prio_tree_insert)
158*(.text.generic_file_aio_read)
159*(.text.vma_merge)
160*(.text.block_write_full_page)
161*(.text.__page_set_anon_rmap)
162*(.text.apic_timer_interrupt)
163*(.text.release_console_sem)
164*(.text.sys_write)
165*(.text.sys_brk)
166*(.text.dup_mm)
167*(.text.read_current_timer)
168*(.text.ll_rw_block)
169*(.text.blk_rq_map_sg)
170*(.text.dbg_userword)
171*(.text.__block_commit_write)
172*(.text.cache_grow)
173*(.text.copy_strings)
174*(.text.release_task)
175*(.text.do_sync_write)
176*(.text.unlock_page)
177*(.text.load_elf_binary)
178*(.text.__follow_mount)
179*(.text.__getblk)
180*(.text.do_sys_open)
181*(.text.current_kernel_time)
182*(.text.call_rcu)
183*(.text.write_chan)
184*(.text.vsnprintf)
185*(.text.dummy_inode_setsecurity)
186*(.text.submit_bh)
187*(.text.poll_freewait)
188*(.text.bio_alloc_bioset)
189*(.text.skb_clone)
190*(.text.page_waitqueue)
191*(.text.__mutex_lock_interruptible_slowpath)
192*(.text.get_index)
193*(.text.csum_partial_copy_generic)
194*(.text.bad_range)
195*(.text.remove_vma)
196*(.text.cp_new_stat)
197*(.text.alloc_arraycache)
198*(.text.test_clear_page_writeback)
199*(.text.strsep)
200*(.text.open_namei)
201*(.text._raw_read_unlock)
202*(.text.get_vma_policy)
203*(.text.__down_write_trylock)
204*(.text.find_get_pages)
205*(.text.tcp_rcv_established)
206*(.text.generic_make_request)
207*(.text.__block_write_full_page)
208*(.text.cfq_set_request)
209*(.text.sys_inotify_init)
210*(.text.split_vma)
211*(.text.__mod_timer)
212*(.text.get_options)
213*(.text.vma_link)
214*(.text.mpage_writepages)
215*(.text.truncate_complete_page)
216*(.text.tcp_recvmsg)
217*(.text.sigprocmask)
218*(.text.filemap_populate)
219*(.text.sys_close)
220*(.text.inotify_dev_queue_event)
221*(.text.do_task_stat)
222*(.text.__dentry_open)
223*(.text.unlink_file_vma)
224*(.text.__pollwait)
225*(.text.packet_rcv_spkt)
226*(.text.drop_buffers)
227*(.text.free_pgtables)
228*(.text.generic_file_direct_write)
229*(.text.copy_process)
230*(.text.netif_receive_skb)
231*(.text.dnotify_flush)
232*(.text.print_bad_pte)
233*(.text.anon_vma_unlink)
234*(.text.sys_mprotect)
235*(.text.sync_sb_inodes)
236*(.text.find_inode_fast)
237*(.text.dummy_inode_readlink)
238*(.text.putname)
239*(.text.init_smp_flush)
240*(.text.dbg_redzone2)
241*(.text.sk_run_filter)
242*(.text.may_expand_vm)
243*(.text.generic_file_aio_write)
244*(.text.find_next_zero_bit)
245*(.text.file_kill)
246*(.text.audit_getname)
247*(.text.arch_unmap_area_topdown)
248*(.text.alloc_page_vma)
249*(.text.tcp_transmit_skb)
250*(.text.rb_next)
251*(.text.dbg_redzone1)
252*(.text.generic_file_mmap)
253*(.text.vfs_fstat)
254*(.text.sys_time)
255*(.text.page_lock_anon_vma)
256*(.text.get_unmapped_area)
257*(.text.remote_llseek)
258*(.text.__up_read)
259*(.text.fd_install)
260*(.text.eventpoll_init_file)
261*(.text.dma_alloc_coherent)
262*(.text.create_empty_buffers)
263*(.text.__mutex_unlock_slowpath)
264*(.text.dup_fd)
265*(.text.d_alloc)
266*(.text.tty_ldisc_try)
267*(.text.sys_stime)
268*(.text.__rb_rotate_right)
269*(.text.d_validate)
270*(.text.rb_erase)
271*(.text.path_release)
272*(.text.memmove)
273*(.text.invalidate_complete_page)
274*(.text.clear_inode)
275*(.text.cache_estimate)
276*(.text.alloc_buffer_head)
277*(.text.smp_call_function_interrupt)
278*(.text.flush_tlb_others)
279*(.text.file_move)
280*(.text.balance_dirty_pages_ratelimited)
281*(.text.vma_prio_tree_add)
282*(.text.timespec_trunc)
283*(.text.mempool_alloc)
284*(.text.iget_locked)
285*(.text.d_alloc_root)
286*(.text.cpuset_populate_dir)
287*(.text.anon_vma_prepare)
288*(.text.sys_newstat)
289*(.text.alloc_page_interleave)
290*(.text.__path_lookup_intent_open)
291*(.text.__pagevec_free)
292*(.text.inode_init_once)
293*(.text.free_vfsmnt)
294*(.text.__user_walk_fd)
295*(.text.cfq_idle_slice_timer)
296*(.text.sys_mmap)
297*(.text.sys_llseek)
298*(.text.prio_tree_remove)
299*(.text.filp_close)
300*(.text.file_permission)
301*(.text.vma_prio_tree_remove)
302*(.text.tcp_ack)
303*(.text.nameidata_to_filp)
304*(.text.sys_lseek)
305*(.text.percpu_counter_mod)
306*(.text.igrab)
307*(.text.__bread)
308*(.text.alloc_inode)
309*(.text.filldir)
310*(.text.__rb_rotate_left)
311*(.text.irq_affinity_write_proc)
312*(.text.init_request_from_bio)
313*(.text.find_or_create_page)
314*(.text.tty_poll)
315*(.text.tcp_sendmsg)
316*(.text.ide_wait_stat)
317*(.text.free_buffer_head)
318*(.text.flush_signal_handlers)
319*(.text.tcp_v4_rcv)
320*(.text.nr_blockdev_pages)
321*(.text.locks_remove_flock)
322*(.text.__iowrite32_copy)
323*(.text.do_filp_open)
324*(.text.try_to_release_page)
325*(.text.page_add_new_anon_rmap)
326*(.text.kmem_cache_size)
327*(.text.eth_type_trans)
328*(.text.try_to_free_buffers)
329*(.text.schedule_tail)
330*(.text.proc_lookup)
331*(.text.no_llseek)
332*(.text.kfree_skbmem)
333*(.text.do_wait)
334*(.text.do_mpage_readpage)
335*(.text.vfs_stat_fd)
336*(.text.tty_write)
337*(.text.705)
338*(.text.sync_page)
339*(.text.__remove_shared_vm_struct)
340*(.text.__kfree_skb)
341*(.text.sock_poll)
342*(.text.get_request_wait)
343*(.text.do_sigaction)
344*(.text.do_brk)
345*(.text.tcp_event_data_recv)
346*(.text.read_chan)
347*(.text.pipe_writev)
348*(.text.__emul_lookup_dentry)
349*(.text.rtc_get_rtc_time)
350*(.text.print_objinfo)
351*(.text.file_update_time)
352*(.text.do_signal)
353*(.text.disable_8259A_irq)
354*(.text.blk_queue_bounce)
355*(.text.__anon_vma_link)
356*(.text.__vma_link)
357*(.text.vfs_rename)
358*(.text.sys_newlstat)
359*(.text.sys_newfstat)
360*(.text.sys_mknod)
361*(.text.__show_regs)
362*(.text.iput)
363*(.text.get_signal_to_deliver)
364*(.text.flush_tlb_page)
365*(.text.debug_mutex_wake_waiter)
366*(.text.copy_thread)
367*(.text.clear_page_dirty_for_io)
368*(.text.buffer_io_error)
369*(.text.vfs_permission)
370*(.text.truncate_inode_pages_range)
371*(.text.sys_recvfrom)
372*(.text.remove_suid)
373*(.text.mark_buffer_dirty)
374*(.text.local_bh_enable)
375*(.text.get_zeroed_page)
376*(.text.get_vmalloc_info)
377*(.text.flush_old_exec)
378*(.text.dummy_inode_permission)
379*(.text.__bio_add_page)
380*(.text.prio_tree_replace)
381*(.text.notify_change)
382*(.text.mntput_no_expire)
383*(.text.fput)
384*(.text.__end_that_request_first)
385*(.text.wake_up_bit)
386*(.text.unuse_mm)
387*(.text.skb_release_data)
388*(.text.shrink_icache_memory)
389*(.text.sched_balance_self)
390*(.text.__pmd_alloc)
391*(.text.pipe_poll)
392*(.text.normal_poll)
393*(.text.__free_pages)
394*(.text.follow_mount)
395*(.text.cdrom_start_packet_command)
396*(.text.blk_recount_segments)
397*(.text.bio_put)
398*(.text.__alloc_skb)
399*(.text.__wake_up)
400*(.text.vm_stat_account)
401*(.text.sys_fcntl)
402*(.text.sys_fadvise64)
403*(.text._raw_write_unlock)
404*(.text.__pud_alloc)
405*(.text.alloc_page_buffers)
406*(.text.vfs_llseek)
407*(.text.sockfd_lookup)
408*(.text._raw_write_lock)
409*(.text.put_compound_page)
410*(.text.prune_dcache)
411*(.text.pipe_readv)
412*(.text.mempool_free)
413*(.text.make_ahead_window)
414*(.text.lru_add_drain)
415*(.text.constant_test_bit)
416*(.text.__clear_user)
417*(.text.arch_unmap_area)
418*(.text.anon_vma_link)
419*(.text.sys_chroot)
420*(.text.setup_arg_pages)
421*(.text.radix_tree_preload)
422*(.text.init_rwsem)
423*(.text.generic_osync_inode)
424*(.text.generic_delete_inode)
425*(.text.do_sys_poll)
426*(.text.dev_queue_xmit)
427*(.text.default_llseek)
428*(.text.__writeback_single_inode)
429*(.text.vfs_ioctl)
430*(.text.__up_write)
431*(.text.unix_poll)
432*(.text.sys_rt_sigprocmask)
433*(.text.sock_recvmsg)
434*(.text.recalc_bh_state)
435*(.text.__put_unused_fd)
436*(.text.process_backlog)
437*(.text.locks_remove_posix)
438*(.text.lease_modify)
439*(.text.expand_files)
440*(.text.end_buffer_read_nobh)
441*(.text.d_splice_alias)
442*(.text.debug_mutex_init_waiter)
443*(.text.copy_from_user)
444*(.text.cap_vm_enough_memory)
445*(.text.show_vfsmnt)
446*(.text.release_sock)
447*(.text.pfifo_fast_enqueue)
448*(.text.half_md4_transform)
449*(.text.fs_may_remount_ro)
450*(.text.do_fork)
451*(.text.copy_hugetlb_page_range)
452*(.text.cache_free_debugcheck)
453*(.text.__tcp_select_window)
454*(.text.task_handoff_register)
455*(.text.sys_open)
456*(.text.strlcpy)
457*(.text.skb_copy_datagram_iovec)
458*(.text.set_up_list3s)
459*(.text.release_open_intent)
460*(.text.qdisc_restart)
461*(.text.n_tty_chars_in_buffer)
462*(.text.inode_change_ok)
463*(.text.__downgrade_write)
464*(.text.debug_mutex_unlock)
465*(.text.add_timer_randomness)
466*(.text.sock_common_recvmsg)
467*(.text.set_bh_page)
468*(.text.printk_lock)
469*(.text.path_release_on_umount)
470*(.text.ip_output)
471*(.text.ide_build_dmatable)
472*(.text.__get_user_8)
473*(.text.end_buffer_read_sync)
474*(.text.__d_path)
475*(.text.d_move)
476*(.text.del_timer)
477*(.text.constant_test_bit)
478*(.text.blockable_page_cache_readahead)
479*(.text.tty_read)
480*(.text.sys_readlink)
481*(.text.sys_faccessat)
482*(.text.read_swap_cache_async)
483*(.text.pty_write_room)
484*(.text.page_address_in_vma)
485*(.text.kthread)
486*(.text.cfq_exit_io_context)
487*(.text.__tcp_push_pending_frames)
488*(.text.sys_pipe)
489*(.text.submit_bio)
490*(.text.pid_revalidate)
491*(.text.page_referenced_file)
492*(.text.lock_sock)
493*(.text.get_page_state_node)
494*(.text.generic_block_bmap)
495*(.text.do_setitimer)
496*(.text.dev_queue_xmit_nit)
497*(.text.copy_from_read_buf)
498*(.text.__const_udelay)
499*(.text.console_conditional_schedule)
500*(.text.wake_up_new_task)
501*(.text.wait_for_completion_interruptible)
502*(.text.tcp_rcv_rtt_update)
503*(.text.sys_mlockall)
504*(.text.set_fs_altroot)
505*(.text.schedule_timeout)
506*(.text.nr_free_pagecache_pages)
507*(.text.nf_iterate)
508*(.text.mapping_tagged)
509*(.text.ip_queue_xmit)
510*(.text.ip_local_deliver)
511*(.text.follow_page)
512*(.text.elf_map)
513*(.text.dummy_file_permission)
514*(.text.dispose_list)
515*(.text.dentry_open)
516*(.text.dentry_iput)
517*(.text.bio_alloc)
518*(.text.alloc_skb_from_cache)
519*(.text.wait_on_page_bit)
520*(.text.vfs_readdir)
521*(.text.vfs_lstat)
522*(.text.seq_escape)
523*(.text.__posix_lock_file)
524*(.text.mm_release)
525*(.text.kref_put)
526*(.text.ip_rcv)
527*(.text.__iget)
528*(.text.free_pages)
529*(.text.find_mergeable_anon_vma)
530*(.text.find_extend_vma)
531*(.text.dummy_inode_listsecurity)
532*(.text.bio_add_page)
533*(.text.__vm_enough_memory)
534*(.text.vfs_stat)
535*(.text.tty_paranoia_check)
536*(.text.tcp_read_sock)
537*(.text.tcp_data_queue)
538*(.text.sys_uname)
539*(.text.sys_renameat)
540*(.text.__strncpy_from_user)
541*(.text.__mutex_init)
542*(.text.__lookup_hash)
543*(.text.kref_get)
544*(.text.ip_route_input)
545*(.text.__insert_inode_hash)
546*(.text.do_sock_write)
547*(.text.blk_done_softirq)
548*(.text.__wake_up_sync)
549*(.text.__vma_link_rb)
550*(.text.tty_ioctl)
551*(.text.tracesys)
552*(.text.sys_getdents)
553*(.text.sys_dup)
554*(.text.stub_execve)
555*(.text.sha_transform)
556*(.text.radix_tree_tag_clear)
557*(.text.put_unused_fd)
558*(.text.put_files_struct)
559*(.text.mpage_readpages)
560*(.text.may_delete)
561*(.text.kmem_cache_create)
562*(.text.ip_mc_output)
563*(.text.interleave_nodes)
564*(.text.groups_search)
565*(.text.generic_drop_inode)
566*(.text.generic_commit_write)
567*(.text.fcntl_setlk)
568*(.text.exit_mmap)
569*(.text.end_page_writeback)
570*(.text.__d_rehash)
571*(.text.debug_mutex_free_waiter)
572*(.text.csum_ipv6_magic)
573*(.text.count)
574*(.text.cleanup_rbuf)
575*(.text.check_spinlock_acquired_node)
576*(.text.can_vma_merge_after)
577*(.text.bio_endio)
578*(.text.alloc_pidmap)
579*(.text.write_ldt)
580*(.text.vmtruncate_range)
581*(.text.vfs_create)
582*(.text.__user_walk)
583*(.text.update_send_head)
584*(.text.unmap_underlying_metadata)
585*(.text.tty_ldisc_deref)
586*(.text.tcp_setsockopt)
587*(.text.tcp_send_ack)
588*(.text.sys_pause)
589*(.text.sys_gettimeofday)
590*(.text.sync_dirty_buffer)
591*(.text.strncmp)
592*(.text.release_posix_timer)
593*(.text.proc_file_read)
594*(.text.prepare_to_wait)
595*(.text.locks_mandatory_locked)
596*(.text.interruptible_sleep_on_timeout)
597*(.text.inode_sub_bytes)
598*(.text.in_group_p)
599*(.text.hrtimer_try_to_cancel)
600*(.text.filldir64)
601*(.text.fasync_helper)
602*(.text.dummy_sb_pivotroot)
603*(.text.d_lookup)
604*(.text.d_instantiate)
605*(.text.__d_find_alias)
606*(.text.cpu_idle_wait)
607*(.text.cond_resched_lock)
608*(.text.chown_common)
609*(.text.blk_congestion_wait)
610*(.text.activate_page)
611*(.text.unlock_buffer)
612*(.text.tty_wakeup)
613*(.text.tcp_v4_do_rcv)
614*(.text.tcp_current_mss)
615*(.text.sys_openat)
616*(.text.sys_fchdir)
617*(.text.strnlen_user)
618*(.text.strnlen)
619*(.text.strchr)
620*(.text.sock_common_getsockopt)
621*(.text.skb_checksum)
622*(.text.remove_wait_queue)
623*(.text.rb_replace_node)
624*(.text.radix_tree_node_ctor)
625*(.text.pty_chars_in_buffer)
626*(.text.profile_hit)
627*(.text.prio_tree_left)
628*(.text.pgd_clear_bad)
629*(.text.pfifo_fast_dequeue)
630*(.text.page_referenced)
631*(.text.open_exec)
632*(.text.mmput)
633*(.text.mm_init)
634*(.text.__ide_dma_off_quietly)
635*(.text.ide_dma_intr)
636*(.text.hrtimer_start)
637*(.text.get_io_context)
638*(.text.__get_free_pages)
639*(.text.find_first_zero_bit)
640*(.text.file_free_rcu)
641*(.text.dummy_socket_sendmsg)
642*(.text.do_unlinkat)
643*(.text.do_arch_prctl)
644*(.text.destroy_inode)
645*(.text.can_vma_merge_before)
646*(.text.block_sync_page)
647*(.text.block_prepare_write)
648*(.text.bio_init)
649*(.text.arch_ptrace)
650*(.text.wake_up_inode)
651*(.text.wait_on_retry_sync_kiocb)
652*(.text.vma_prio_tree_next)
653*(.text.tcp_rcv_space_adjust)
654*(.text.__tcp_ack_snd_check)
655*(.text.sys_utime)
656*(.text.sys_recvmsg)
657*(.text.sys_mremap)
658*(.text.sys_bdflush)
659*(.text.sleep_on)
660*(.text.set_page_dirty_lock)
661*(.text.seq_path)
662*(.text.schedule_timeout_interruptible)
663*(.text.sched_fork)
664*(.text.rt_run_flush)
665*(.text.profile_munmap)
666*(.text.prepare_binprm)
667*(.text.__pagevec_release_nonlru)
668*(.text.m_show)
669*(.text.lookup_mnt)
670*(.text.__lookup_mnt)
671*(.text.lock_timer_base)
672*(.text.is_subdir)
673*(.text.invalidate_bh_lru)
674*(.text.init_buffer_head)
675*(.text.ifind_fast)
676*(.text.ide_dma_start)
677*(.text.__get_page_state)
678*(.text.flock_to_posix_lock)
679*(.text.__find_symbol)
680*(.text.do_futex)
681*(.text.do_execve)
682*(.text.dirty_writeback_centisecs_handler)
683*(.text.dev_watchdog)
684*(.text.can_share_swap_page)
685*(.text.blkdev_put)
686*(.text.bio_get_nr_vecs)
687*(.text.xfrm_compile_policy)
688*(.text.vma_prio_tree_insert)
689*(.text.vfs_lstat_fd)
690*(.text.__user_path_lookup_open)
691*(.text.thread_return)
692*(.text.tcp_send_delayed_ack)
693*(.text.sock_def_error_report)
694*(.text.shrink_slab)
695*(.text.serial_out)
696*(.text.seq_read)
697*(.text.secure_ip_id)
698*(.text.search_binary_handler)
699*(.text.proc_pid_unhash)
700*(.text.pagevec_lookup)
701*(.text.new_inode)
702*(.text.memcpy_toiovec)
703*(.text.locks_free_lock)
704*(.text.__lock_page)
705*(.text.__lock_buffer)
706*(.text.load_module)
707*(.text.is_bad_inode)
708*(.text.invalidate_inode_buffers)
709*(.text.insert_vm_struct)
710*(.text.inode_setattr)
711*(.text.inode_add_bytes)
712*(.text.ide_read_24)
713*(.text.ide_get_error_location)
714*(.text.ide_do_drive_cmd)
715*(.text.get_locked_pte)
716*(.text.get_filesystem_list)
717*(.text.generic_file_open)
718*(.text.follow_down)
719*(.text.find_next_bit)
720*(.text.__find_first_bit)
721*(.text.exit_mm)
722*(.text.exec_keys)
723*(.text.end_buffer_write_sync)
724*(.text.end_bio_bh_io_sync)
725*(.text.dummy_socket_shutdown)
726*(.text.d_rehash)
727*(.text.d_path)
728*(.text.do_ioctl)
729*(.text.dget_locked)
730*(.text.copy_thread_group_keys)
731*(.text.cdrom_end_request)
732*(.text.cap_bprm_apply_creds)
733*(.text.blk_rq_bio_prep)
734*(.text.__bitmap_intersects)
735*(.text.bio_phys_segments)
736*(.text.bio_free)
737*(.text.arch_get_unmapped_area_topdown)
738*(.text.writeback_in_progress)
739*(.text.vfs_follow_link)
740*(.text.tcp_rcv_state_process)
741*(.text.tcp_check_space)
742*(.text.sys_stat)
743*(.text.sys_rt_sigreturn)
744*(.text.sys_rt_sigaction)
745*(.text.sys_remap_file_pages)
746*(.text.sys_pwrite64)
747*(.text.sys_fchownat)
748*(.text.sys_fchmodat)
749*(.text.strncat)
750*(.text.strlcat)
751*(.text.strcmp)
752*(.text.steal_locks)
753*(.text.sock_create)
754*(.text.sk_stream_rfree)
755*(.text.sk_stream_mem_schedule)
756*(.text.skip_atoi)
757*(.text.sk_alloc)
758*(.text.show_stat)
759*(.text.set_fs_pwd)
760*(.text.set_binfmt)
761*(.text.pty_unthrottle)
762*(.text.proc_symlink)
763*(.text.pipe_release)
764*(.text.pageout)
765*(.text.n_tty_write_wakeup)
766*(.text.n_tty_ioctl)
767*(.text.nr_free_zone_pages)
768*(.text.migration_thread)
769*(.text.mempool_free_slab)
770*(.text.meminfo_read_proc)
771*(.text.max_sane_readahead)
772*(.text.lru_cache_add)
773*(.text.kill_fasync)
774*(.text.kernel_read)
775*(.text.invalidate_mapping_pages)
776*(.text.inode_has_buffers)
777*(.text.init_once)
778*(.text.inet_sendmsg)
779*(.text.idedisk_issue_flush)
780*(.text.generic_file_write)
781*(.text.free_more_memory)
782*(.text.__free_fdtable)
783*(.text.filp_dtor)
784*(.text.exit_sem)
785*(.text.exit_itimers)
786*(.text.error_interrupt)
787*(.text.end_buffer_async_write)
788*(.text.eligible_child)
789*(.text.elf_map)
790*(.text.dump_task_regs)
791*(.text.dummy_task_setscheduler)
792*(.text.dummy_socket_accept)
793*(.text.dummy_file_free_security)
794*(.text.__down_read)
795*(.text.do_sock_read)
796*(.text.do_sigaltstack)
797*(.text.do_mremap)
798*(.text.current_io_context)
799*(.text.cpu_swap_callback)
800*(.text.copy_vma)
801*(.text.cap_bprm_set_security)
802*(.text.blk_insert_request)
803*(.text.bio_map_kern_endio)
804*(.text.bio_hw_segments)
805*(.text.bictcp_cong_avoid)
806*(.text.add_interrupt_randomness)
807*(.text.wait_for_completion)
808*(.text.version_read_proc)
809*(.text.unix_write_space)
810*(.text.tty_ldisc_ref_wait)
811*(.text.tty_ldisc_put)
812*(.text.try_to_wake_up)
813*(.text.tcp_v4_tw_remember_stamp)
814*(.text.tcp_try_undo_dsack)
815*(.text.tcp_may_send_now)
816*(.text.sys_waitid)
817*(.text.sys_sched_getparam)
818*(.text.sys_getppid)
819*(.text.sys_getcwd)
820*(.text.sys_dup2)
821*(.text.sys_chmod)
822*(.text.sys_chdir)
823*(.text.sprintf)
824*(.text.sock_wfree)
825*(.text.sock_aio_write)
826*(.text.skb_drop_fraglist)
827*(.text.skb_dequeue)
828*(.text.set_close_on_exec)
829*(.text.set_brk)
830*(.text.seq_puts)
831*(.text.SELECT_DRIVE)
832*(.text.sched_exec)
833*(.text.return_EIO)
834*(.text.remove_from_page_cache)
835*(.text.rcu_start_batch)
836*(.text.__put_task_struct)
837*(.text.proc_pid_readdir)
838*(.text.proc_get_inode)
839*(.text.prepare_to_wait_exclusive)
840*(.text.pipe_wait)
841*(.text.pipe_new)
842*(.text.pdflush_operation)
843*(.text.__pagevec_release)
844*(.text.pagevec_lookup_tag)
845*(.text.packet_rcv)
846*(.text.n_tty_set_room)
847*(.text.nr_free_pages)
848*(.text.__net_timestamp)
849*(.text.mpage_end_io_read)
850*(.text.mod_timer)
851*(.text.__memcpy)
852*(.text.mb_cache_shrink_fn)
853*(.text.lock_rename)
854*(.text.kstrdup)
855*(.text.is_ignored)
856*(.text.int_very_careful)
857*(.text.inotify_inode_is_dead)
858*(.text.inotify_get_cookie)
859*(.text.inode_get_bytes)
860*(.text.init_timer)
861*(.text.init_dev)
862*(.text.inet_getname)
863*(.text.ide_map_sg)
864*(.text.__ide_dma_end)
865*(.text.hrtimer_get_remaining)
866*(.text.get_task_mm)
867*(.text.get_random_int)
868*(.text.free_pipe_info)
869*(.text.filemap_write_and_wait_range)
870*(.text.exit_thread)
871*(.text.enter_idle)
872*(.text.end_that_request_first)
873*(.text.end_8259A_irq)
874*(.text.dummy_file_alloc_security)
875*(.text.do_group_exit)
876*(.text.debug_mutex_init)
877*(.text.cpuset_exit)
878*(.text.cpu_idle)
879*(.text.copy_semundo)
880*(.text.copy_files)
881*(.text.chrdev_open)
882*(.text.cdrom_transfer_packet_command)
883*(.text.cdrom_mode_sense)
884*(.text.blk_phys_contig_segment)
885*(.text.blk_get_queue)
886*(.text.bio_split)
887*(.text.audit_alloc)
888*(.text.anon_pipe_buf_release)
889*(.text.add_wait_queue_exclusive)
890*(.text.add_wait_queue)
891*(.text.acct_process)
892*(.text.account)
893*(.text.zeromap_page_range)
894*(.text.yield)
895*(.text.writeback_acquire)
896*(.text.worker_thread)
897*(.text.wait_on_page_writeback_range)
898*(.text.__wait_on_buffer)
899*(.text.vscnprintf)
900*(.text.vmalloc_to_pfn)
901*(.text.vgacon_save_screen)
902*(.text.vfs_unlink)
903*(.text.vfs_rmdir)
904*(.text.unregister_md_personality)
905*(.text.unlock_new_inode)
906*(.text.unix_stream_sendmsg)
907*(.text.unix_stream_recvmsg)
908*(.text.unhash_process)
909*(.text.udp_v4_lookup_longway)
910*(.text.tty_ldisc_flush)
911*(.text.tty_ldisc_enable)
912*(.text.tty_hung_up_p)
913*(.text.tty_buffer_free_all)
914*(.text.tso_fragment)
915*(.text.try_to_del_timer_sync)
916*(.text.tcp_v4_err)
917*(.text.tcp_unhash)
918*(.text.tcp_seq_next)
919*(.text.tcp_select_initial_window)
920*(.text.tcp_sacktag_write_queue)
921*(.text.tcp_cwnd_validate)
922*(.text.sys_vhangup)
923*(.text.sys_uselib)
924*(.text.sys_symlink)
925*(.text.sys_signal)
926*(.text.sys_poll)
927*(.text.sys_mount)
928*(.text.sys_kill)
929*(.text.sys_ioctl)
930*(.text.sys_inotify_add_watch)
931*(.text.sys_getuid)
932*(.text.sys_getrlimit)
933*(.text.sys_getitimer)
934*(.text.sys_getgroups)
935*(.text.sys_ftruncate)
936*(.text.sysfs_lookup)
937*(.text.sys_exit_group)
938*(.text.stub_fork)
939*(.text.sscanf)
940*(.text.sock_map_fd)
941*(.text.sock_get_timestamp)
942*(.text.__sock_create)
943*(.text.smp_call_function_single)
944*(.text.sk_stop_timer)
945*(.text.skb_copy_and_csum_datagram)
946*(.text.__skb_checksum_complete)
947*(.text.single_next)
948*(.text.sigqueue_alloc)
949*(.text.shrink_dcache_parent)
950*(.text.select_idle_routine)
951*(.text.run_workqueue)
952*(.text.run_local_timers)
953*(.text.remove_inode_hash)
954*(.text.remove_dquot_ref)
955*(.text.register_binfmt)
956*(.text.read_cache_pages)
957*(.text.rb_last)
958*(.text.pty_open)
959*(.text.proc_root_readdir)
960*(.text.proc_pid_flush)
961*(.text.proc_pident_lookup)
962*(.text.proc_fill_super)
963*(.text.proc_exe_link)
964*(.text.posix_locks_deadlock)
965*(.text.pipe_iov_copy_from_user)
966*(.text.opost)
967*(.text.nf_register_hook)
968*(.text.netif_rx_ni)
969*(.text.m_start)
970*(.text.mpage_writepage)
971*(.text.mm_alloc)
972*(.text.memory_open)
973*(.text.mark_buffer_async_write)
974*(.text.lru_add_drain_all)
975*(.text.locks_init_lock)
976*(.text.locks_delete_lock)
977*(.text.lock_hrtimer_base)
978*(.text.load_script)
979*(.text.__kill_fasync)
980*(.text.ip_mc_sf_allow)
981*(.text.__ioremap)
982*(.text.int_with_check)
983*(.text.int_sqrt)
984*(.text.install_thread_keyring)
985*(.text.init_page_buffers)
986*(.text.inet_sock_destruct)
987*(.text.idle_notifier_register)
988*(.text.ide_execute_command)
989*(.text.ide_end_drive_cmd)
990*(.text.__ide_dma_host_on)
991*(.text.hrtimer_run_queues)
992*(.text.hpet_mask_rtc_irq_bit)
993*(.text.__get_zone_counts)
994*(.text.get_zone_counts)
995*(.text.get_write_access)
996*(.text.get_fs_struct)
997*(.text.get_dirty_limits)
998*(.text.generic_readlink)
999*(.text.free_hot_page)
1000*(.text.finish_wait)
1001*(.text.find_inode)
1002*(.text.find_first_bit)
1003*(.text.__filemap_fdatawrite_range)
1004*(.text.__filemap_copy_from_user_iovec)
1005*(.text.exit_aio)
1006*(.text.elv_set_request)
1007*(.text.elv_former_request)
1008*(.text.dup_namespace)
1009*(.text.dupfd)
1010*(.text.dummy_socket_getsockopt)
1011*(.text.dummy_sb_post_mountroot)
1012*(.text.dummy_quotactl)
1013*(.text.dummy_inode_rename)
1014*(.text.__do_SAK)
1015*(.text.do_pipe)
1016*(.text.do_fsync)
1017*(.text.d_instantiate_unique)
1018*(.text.d_find_alias)
1019*(.text.deny_write_access)
1020*(.text.dentry_unhash)
1021*(.text.d_delete)
1022*(.text.datagram_poll)
1023*(.text.cpuset_fork)
1024*(.text.cpuid_read)
1025*(.text.copy_namespace)
1026*(.text.cond_resched)
1027*(.text.check_version)
1028*(.text.__change_page_attr)
1029*(.text.cfq_slab_kill)
1030*(.text.cfq_completed_request)
1031*(.text.cdrom_pc_intr)
1032*(.text.cdrom_decode_status)
1033*(.text.cap_capset_check)
1034*(.text.blk_put_request)
1035*(.text.bio_fs_destructor)
1036*(.text.bictcp_min_cwnd)
1037*(.text.alloc_chrdev_region)
1038*(.text.add_element)
1039*(.text.acct_update_integrals)
1040*(.text.write_boundary_block)
1041*(.text.writeback_release)
1042*(.text.writeback_inodes)
1043*(.text.wake_up_state)
1044*(.text.__wake_up_locked)
1045*(.text.wake_futex)
1046*(.text.wait_task_inactive)
1047*(.text.__wait_on_freeing_inode)
1048*(.text.wait_noreap_copyout)
1049*(.text.vmstat_start)
1050*(.text.vgacon_do_font_op)
1051*(.text.vfs_readv)
1052*(.text.vfs_quota_sync)
1053*(.text.update_queue)
1054*(.text.unshare_files)
1055*(.text.unmap_vm_area)
1056*(.text.unix_socketpair)
1057*(.text.unix_release_sock)
1058*(.text.unix_detach_fds)
1059*(.text.unix_create1)
1060*(.text.unix_bind)
1061*(.text.udp_sendmsg)
1062*(.text.udp_rcv)
1063*(.text.udp_queue_rcv_skb)
1064*(.text.uart_write)
1065*(.text.uart_startup)
1066*(.text.uart_open)
1067*(.text.tty_vhangup)
1068*(.text.tty_termios_baud_rate)
1069*(.text.tty_release)
1070*(.text.tty_ldisc_ref)
1071*(.text.throttle_vm_writeout)
1072*(.text.058)
1073*(.text.tcp_xmit_probe_skb)
1074*(.text.tcp_v4_send_check)
1075*(.text.tcp_v4_destroy_sock)
1076*(.text.tcp_sync_mss)
1077*(.text.tcp_snd_test)
1078*(.text.tcp_slow_start)
1079*(.text.tcp_send_fin)
1080*(.text.tcp_rtt_estimator)
1081*(.text.tcp_parse_options)
1082*(.text.tcp_ioctl)
1083*(.text.tcp_init_tso_segs)
1084*(.text.tcp_init_cwnd)
1085*(.text.tcp_getsockopt)
1086*(.text.tcp_fin)
1087*(.text.tcp_connect)
1088*(.text.tcp_cong_avoid)
1089*(.text.__tcp_checksum_complete_user)
1090*(.text.task_dumpable)
1091*(.text.sys_wait4)
1092*(.text.sys_utimes)
1093*(.text.sys_symlinkat)
1094*(.text.sys_socketpair)
1095*(.text.sys_rmdir)
1096*(.text.sys_readahead)
1097*(.text.sys_nanosleep)
1098*(.text.sys_linkat)
1099*(.text.sys_fstat)
1100*(.text.sysfs_readdir)
1101*(.text.sys_execve)
1102*(.text.sysenter_tracesys)
1103*(.text.sys_chown)
1104*(.text.stub_clone)
1105*(.text.strrchr)
1106*(.text.strncpy)
1107*(.text.stopmachine_set_state)
1108*(.text.sock_sendmsg)
1109*(.text.sock_release)
1110*(.text.sock_fasync)
1111*(.text.sock_close)
1112*(.text.sk_stream_write_space)
1113*(.text.sk_reset_timer)
1114*(.text.skb_split)
1115*(.text.skb_recv_datagram)
1116*(.text.skb_queue_tail)
1117*(.text.sk_attach_filter)
1118*(.text.si_swapinfo)
1119*(.text.simple_strtoll)
1120*(.text.set_termios)
1121*(.text.set_task_comm)
1122*(.text.set_shrinker)
1123*(.text.set_normalized_timespec)
1124*(.text.set_brk)
1125*(.text.serial_in)
1126*(.text.seq_printf)
1127*(.text.secure_dccp_sequence_number)
1128*(.text.rwlock_bug)
1129*(.text.rt_hash_code)
1130*(.text.__rta_fill)
1131*(.text.__request_resource)
1132*(.text.relocate_new_kernel)
1133*(.text.release_thread)
1134*(.text.release_mem)
1135*(.text.rb_prev)
1136*(.text.rb_first)
1137*(.text.random_poll)
1138*(.text.__put_super_and_need_restart)
1139*(.text.pty_write)
1140*(.text.ptrace_stop)
1141*(.text.proc_self_readlink)
1142*(.text.proc_root_lookup)
1143*(.text.proc_root_link)
1144*(.text.proc_pid_make_inode)
1145*(.text.proc_pid_attr_write)
1146*(.text.proc_lookupfd)
1147*(.text.proc_delete_inode)
1148*(.text.posix_same_owner)
1149*(.text.posix_block_lock)
1150*(.text.poll_initwait)
1151*(.text.pipe_write)
1152*(.text.pipe_read_fasync)
1153*(.text.pipe_ioctl)
1154*(.text.pdflush)
1155*(.text.pci_user_read_config_dword)
1156*(.text.page_readlink)
1157*(.text.null_lseek)
1158*(.text.nf_hook_slow)
1159*(.text.netlink_sock_destruct)
1160*(.text.netlink_broadcast)
1161*(.text.neigh_resolve_output)
1162*(.text.name_to_int)
1163*(.text.mwait_idle)
1164*(.text.mutex_trylock)
1165*(.text.mutex_debug_check_no_locks_held)
1166*(.text.m_stop)
1167*(.text.mpage_end_io_write)
1168*(.text.mpage_alloc)
1169*(.text.move_page_tables)
1170*(.text.mounts_open)
1171*(.text.__memset)
1172*(.text.memcpy_fromiovec)
1173*(.text.make_8259A_irq)
1174*(.text.lookup_user_key_possessed)
1175*(.text.lookup_create)
1176*(.text.locks_insert_lock)
1177*(.text.locks_alloc_lock)
1178*(.text.kthread_should_stop)
1179*(.text.kswapd)
1180*(.text.kobject_uevent)
1181*(.text.kobject_get_path)
1182*(.text.kobject_get)
1183*(.text.klist_children_put)
1184*(.text.__ip_route_output_key)
1185*(.text.ip_flush_pending_frames)
1186*(.text.ip_compute_csum)
1187*(.text.ip_append_data)
1188*(.text.ioc_set_batching)
1189*(.text.invalidate_inode_pages)
1190*(.text.__invalidate_device)
1191*(.text.install_arg_page)
1192*(.text.in_sched_functions)
1193*(.text.inotify_unmount_inodes)
1194*(.text.init_once)
1195*(.text.init_cdrom_command)
1196*(.text.inet_stream_connect)
1197*(.text.inet_sk_rebuild_header)
1198*(.text.inet_csk_addr2sockaddr)
1199*(.text.inet_create)
1200*(.text.ifind)
1201*(.text.ide_setup_dma)
1202*(.text.ide_outsw)
1203*(.text.ide_fixstring)
1204*(.text.ide_dma_setup)
1205*(.text.ide_cdrom_packet)
1206*(.text.ide_cd_put)
1207*(.text.ide_build_sglist)
1208*(.text.i8259A_shutdown)
1209*(.text.hung_up_tty_ioctl)
1210*(.text.hrtimer_nanosleep)
1211*(.text.hrtimer_init)
1212*(.text.hrtimer_cancel)
1213*(.text.hash_futex)
1214*(.text.group_send_sig_info)
1215*(.text.grab_cache_page_nowait)
1216*(.text.get_wchan)
1217*(.text.get_stack)
1218*(.text.get_page_state)
1219*(.text.getnstimeofday)
1220*(.text.get_node)
1221*(.text.get_kprobe)
1222*(.text.generic_unplug_device)
1223*(.text.free_task)
1224*(.text.frag_show)
1225*(.text.find_next_zero_string)
1226*(.text.filp_open)
1227*(.text.fillonedir)
1228*(.text.exit_io_context)
1229*(.text.exit_idle)
1230*(.text.exact_lock)
1231*(.text.eth_header)
1232*(.text.dummy_unregister_security)
1233*(.text.dummy_socket_post_create)
1234*(.text.dummy_socket_listen)
1235*(.text.dummy_quota_on)
1236*(.text.dummy_inode_follow_link)
1237*(.text.dummy_file_receive)
1238*(.text.dummy_file_mprotect)
1239*(.text.dummy_file_lock)
1240*(.text.dummy_file_ioctl)
1241*(.text.dummy_bprm_post_apply_creds)
1242*(.text.do_writepages)
1243*(.text.__down_interruptible)
1244*(.text.do_notify_resume)
1245*(.text.do_acct_process)
1246*(.text.del_timer_sync)
1247*(.text.default_rebuild_header)
1248*(.text.d_callback)
1249*(.text.dcache_readdir)
1250*(.text.ctrl_dumpfamily)
1251*(.text.cpuset_rmdir)
1252*(.text.copy_strings_kernel)
1253*(.text.con_write_room)
1254*(.text.complete_all)
1255*(.text.collect_sigign_sigcatch)
1256*(.text.clear_user)
1257*(.text.check_unthrottle)
1258*(.text.cdrom_release)
1259*(.text.cdrom_newpc_intr)
1260*(.text.cdrom_ioctl)
1261*(.text.cdrom_check_status)
1262*(.text.cdev_put)
1263*(.text.cdev_add)
1264*(.text.cap_ptrace)
1265*(.text.cap_bprm_secureexec)
1266*(.text.cache_alloc_refill)
1267*(.text.bmap)
1268*(.text.blk_run_queue)
1269*(.text.blk_queue_dma_alignment)
1270*(.text.blk_ordered_req_seq)
1271*(.text.blk_backing_dev_unplug)
1272*(.text.__bitmap_subset)
1273*(.text.__bitmap_and)
1274*(.text.bio_unmap_user)
1275*(.text.__bforget)
1276*(.text.bd_forget)
1277*(.text.bad_pipe_w)
1278*(.text.bad_get_user)
1279*(.text.audit_free)
1280*(.text.anon_vma_ctor)
1281*(.text.anon_pipe_buf_map)
1282*(.text.alloc_sock_iocb)
1283*(.text.alloc_fdset)
1284*(.text.aio_kick_handler)
1285*(.text.__add_entropy_words)
1286*(.text.add_disk_randomness)
diff --git a/arch/x86_64/kernel/head.S b/arch/x86_64/kernel/head.S
index 02fc7fa0ea28..6df05e6034fa 100644
--- a/arch/x86_64/kernel/head.S
+++ b/arch/x86_64/kernel/head.S
@@ -26,6 +26,7 @@
26 */ 26 */
27 27
28 .text 28 .text
29 .section .bootstrap.text
29 .code32 30 .code32
30 .globl startup_32 31 .globl startup_32
31/* %bx: 1 if coming from smp trampoline on secondary cpu */ 32/* %bx: 1 if coming from smp trampoline on secondary cpu */
@@ -192,7 +193,8 @@ startup_64:
192 movq initial_code(%rip),%rax 193 movq initial_code(%rip),%rax
193 jmp *%rax 194 jmp *%rax
194 195
195 /* SMP bootup changes these two */ 196 /* SMP bootup changes these two */
197 .align 8
196 .globl initial_code 198 .globl initial_code
197initial_code: 199initial_code:
198 .quad x86_64_start_kernel 200 .quad x86_64_start_kernel
@@ -237,7 +239,7 @@ ENTRY(no_long_mode)
237.org 0xf00 239.org 0xf00
238 .globl pGDT32 240 .globl pGDT32
239pGDT32: 241pGDT32:
240 .word gdt_end-cpu_gdt_table 242 .word gdt_end-cpu_gdt_table-1
241 .long cpu_gdt_table-__START_KERNEL_map 243 .long cpu_gdt_table-__START_KERNEL_map
242 244
243.org 0xf10 245.org 0xf10
@@ -293,8 +295,6 @@ NEXT_PAGE(level2_kernel_pgt)
293 /* Module mapping starts here */ 295 /* Module mapping starts here */
294 .fill 492,8,0 296 .fill 492,8,0
295 297
296NEXT_PAGE(empty_zero_page)
297
298NEXT_PAGE(level3_physmem_pgt) 298NEXT_PAGE(level3_physmem_pgt)
299 .quad phys_level2_kernel_pgt | 0x007 /* so that __va works even before pagetable_init */ 299 .quad phys_level2_kernel_pgt | 0x007 /* so that __va works even before pagetable_init */
300 .fill 511,8,0 300 .fill 511,8,0
@@ -337,7 +337,7 @@ ENTRY(boot_level4_pgt)
337 .align 16 337 .align 16
338 .globl cpu_gdt_descr 338 .globl cpu_gdt_descr
339cpu_gdt_descr: 339cpu_gdt_descr:
340 .word gdt_end-cpu_gdt_table 340 .word gdt_end-cpu_gdt_table-1
341gdt: 341gdt:
342 .quad cpu_gdt_table 342 .quad cpu_gdt_table
343#ifdef CONFIG_SMP 343#ifdef CONFIG_SMP
@@ -352,7 +352,8 @@ gdt:
352 * Also sysret mandates a special GDT layout 352 * Also sysret mandates a special GDT layout
353 */ 353 */
354 354
355.align PAGE_SIZE 355 .section .data.page_aligned, "aw"
356 .align PAGE_SIZE
356 357
357/* The TLS descriptors are currently at a different place compared to i386. 358/* The TLS descriptors are currently at a different place compared to i386.
358 Hopefully nobody expects them at a fixed place (Wine?) */ 359 Hopefully nobody expects them at a fixed place (Wine?) */
@@ -378,9 +379,12 @@ gdt_end:
378 /* zero the remaining page */ 379 /* zero the remaining page */
379 .fill PAGE_SIZE / 8 - GDT_ENTRIES,8,0 380 .fill PAGE_SIZE / 8 - GDT_ENTRIES,8,0
380 381
381ENTRY(idt_table) 382 .section .bss, "aw", @nobits
382 .rept 256 383 .align L1_CACHE_BYTES
383 .quad 0 384ENTRY(idt_table)
384 .quad 0 385 .skip 256 * 16
385 .endr
386 386
387 .section .bss.page_aligned, "aw", @nobits
388 .align PAGE_SIZE
389ENTRY(empty_zero_page)
390 .skip PAGE_SIZE
diff --git a/arch/x86_64/kernel/io_apic.c b/arch/x86_64/kernel/io_apic.c
index ffed464e6b12..77b4c608cca0 100644
--- a/arch/x86_64/kernel/io_apic.c
+++ b/arch/x86_64/kernel/io_apic.c
@@ -50,7 +50,7 @@ static int no_timer_check;
50 50
51int disable_timer_pin_1 __initdata; 51int disable_timer_pin_1 __initdata;
52 52
53int timer_over_8254 __initdata = 1; 53int timer_over_8254 __initdata = 0;
54 54
55/* Where if anywhere is the i8259 connect in external int mode */ 55/* Where if anywhere is the i8259 connect in external int mode */
56static struct { int pin, apic; } ioapic_i8259 = { -1, -1 }; 56static struct { int pin, apic; } ioapic_i8259 = { -1, -1 };
@@ -310,7 +310,7 @@ void __init check_ioapic(void)
310 force_iommu) && 310 force_iommu) &&
311 !iommu_aperture_allowed) { 311 !iommu_aperture_allowed) {
312 printk(KERN_INFO 312 printk(KERN_INFO
313 "Looks like a VIA chipset. Disabling IOMMU. Overwrite with \"iommu=allowed\"\n"); 313 "Looks like a VIA chipset. Disabling IOMMU. Override with \"iommu=allowed\"\n");
314 iommu_aperture_disabled = 1; 314 iommu_aperture_disabled = 1;
315 } 315 }
316#endif 316#endif
@@ -1848,7 +1848,7 @@ static inline void check_timer(void)
1848 */ 1848 */
1849 setup_ExtINT_IRQ0_pin(apic2, pin2, vector); 1849 setup_ExtINT_IRQ0_pin(apic2, pin2, vector);
1850 if (timer_irq_works()) { 1850 if (timer_irq_works()) {
1851 printk("works.\n"); 1851 apic_printk(APIC_VERBOSE," works.\n");
1852 nmi_watchdog_default(); 1852 nmi_watchdog_default();
1853 if (nmi_watchdog == NMI_IO_APIC) { 1853 if (nmi_watchdog == NMI_IO_APIC) {
1854 setup_nmi(); 1854 setup_nmi();
@@ -1860,7 +1860,7 @@ static inline void check_timer(void)
1860 */ 1860 */
1861 clear_IO_APIC_pin(apic2, pin2); 1861 clear_IO_APIC_pin(apic2, pin2);
1862 } 1862 }
1863 printk(" failed.\n"); 1863 apic_printk(APIC_VERBOSE," failed.\n");
1864 1864
1865 if (nmi_watchdog == NMI_IO_APIC) { 1865 if (nmi_watchdog == NMI_IO_APIC) {
1866 printk(KERN_WARNING "timer doesn't work through the IO-APIC - disabling NMI Watchdog!\n"); 1866 printk(KERN_WARNING "timer doesn't work through the IO-APIC - disabling NMI Watchdog!\n");
@@ -1875,7 +1875,7 @@ static inline void check_timer(void)
1875 enable_8259A_irq(0); 1875 enable_8259A_irq(0);
1876 1876
1877 if (timer_irq_works()) { 1877 if (timer_irq_works()) {
1878 apic_printk(APIC_QUIET, " works.\n"); 1878 apic_printk(APIC_VERBOSE," works.\n");
1879 return; 1879 return;
1880 } 1880 }
1881 apic_write(APIC_LVT0, APIC_LVT_MASKED | APIC_DM_FIXED | vector); 1881 apic_write(APIC_LVT0, APIC_LVT_MASKED | APIC_DM_FIXED | vector);
diff --git a/arch/x86_64/kernel/irq.c b/arch/x86_64/kernel/irq.c
index 30d2a1e545fe..d8bd0b345b1e 100644
--- a/arch/x86_64/kernel/irq.c
+++ b/arch/x86_64/kernel/irq.c
@@ -38,9 +38,8 @@ int show_interrupts(struct seq_file *p, void *v)
38 38
39 if (i == 0) { 39 if (i == 0) {
40 seq_printf(p, " "); 40 seq_printf(p, " ");
41 for (j=0; j<NR_CPUS; j++) 41 for_each_online_cpu(j)
42 if (cpu_online(j)) 42 seq_printf(p, "CPU%d ",j);
43 seq_printf(p, "CPU%d ",j);
44 seq_putc(p, '\n'); 43 seq_putc(p, '\n');
45 } 44 }
46 45
@@ -53,10 +52,8 @@ int show_interrupts(struct seq_file *p, void *v)
53#ifndef CONFIG_SMP 52#ifndef CONFIG_SMP
54 seq_printf(p, "%10u ", kstat_irqs(i)); 53 seq_printf(p, "%10u ", kstat_irqs(i));
55#else 54#else
56 for (j=0; j<NR_CPUS; j++) 55 for_each_online_cpu(j)
57 if (cpu_online(j)) 56 seq_printf(p, "%10u ", kstat_cpu(j).irqs[i]);
58 seq_printf(p, "%10u ",
59 kstat_cpu(j).irqs[i]);
60#endif 57#endif
61 seq_printf(p, " %14s", irq_desc[i].handler->typename); 58 seq_printf(p, " %14s", irq_desc[i].handler->typename);
62 59
@@ -68,15 +65,13 @@ skip:
68 spin_unlock_irqrestore(&irq_desc[i].lock, flags); 65 spin_unlock_irqrestore(&irq_desc[i].lock, flags);
69 } else if (i == NR_IRQS) { 66 } else if (i == NR_IRQS) {
70 seq_printf(p, "NMI: "); 67 seq_printf(p, "NMI: ");
71 for (j = 0; j < NR_CPUS; j++) 68 for_each_online_cpu(j)
72 if (cpu_online(j)) 69 seq_printf(p, "%10u ", cpu_pda(j)->__nmi_count);
73 seq_printf(p, "%10u ", cpu_pda(j)->__nmi_count);
74 seq_putc(p, '\n'); 70 seq_putc(p, '\n');
75#ifdef CONFIG_X86_LOCAL_APIC 71#ifdef CONFIG_X86_LOCAL_APIC
76 seq_printf(p, "LOC: "); 72 seq_printf(p, "LOC: ");
77 for (j = 0; j < NR_CPUS; j++) 73 for_each_online_cpu(j)
78 if (cpu_online(j)) 74 seq_printf(p, "%10u ", cpu_pda(j)->apic_timer_irqs);
79 seq_printf(p, "%10u ", cpu_pda(j)->apic_timer_irqs);
80 seq_putc(p, '\n'); 75 seq_putc(p, '\n');
81#endif 76#endif
82 seq_printf(p, "ERR: %10u\n", atomic_read(&irq_err_count)); 77 seq_printf(p, "ERR: %10u\n", atomic_read(&irq_err_count));
diff --git a/arch/x86_64/kernel/kprobes.c b/arch/x86_64/kernel/kprobes.c
index 8b866a8572cf..accbff3fec49 100644
--- a/arch/x86_64/kernel/kprobes.c
+++ b/arch/x86_64/kernel/kprobes.c
@@ -37,10 +37,12 @@
37#include <linux/string.h> 37#include <linux/string.h>
38#include <linux/slab.h> 38#include <linux/slab.h>
39#include <linux/preempt.h> 39#include <linux/preempt.h>
40#include <linux/module.h>
40 41
41#include <asm/cacheflush.h> 42#include <asm/cacheflush.h>
42#include <asm/pgtable.h> 43#include <asm/pgtable.h>
43#include <asm/kdebug.h> 44#include <asm/kdebug.h>
45#include <asm/uaccess.h>
44 46
45void jprobe_return_end(void); 47void jprobe_return_end(void);
46static void __kprobes arch_copy_kprobe(struct kprobe *p); 48static void __kprobes arch_copy_kprobe(struct kprobe *p);
@@ -222,9 +224,9 @@ void __kprobes arch_disarm_kprobe(struct kprobe *p)
222 224
223void __kprobes arch_remove_kprobe(struct kprobe *p) 225void __kprobes arch_remove_kprobe(struct kprobe *p)
224{ 226{
225 down(&kprobe_mutex); 227 mutex_lock(&kprobe_mutex);
226 free_insn_slot(p->ainsn.insn); 228 free_insn_slot(p->ainsn.insn);
227 up(&kprobe_mutex); 229 mutex_unlock(&kprobe_mutex);
228} 230}
229 231
230static inline void save_previous_kprobe(struct kprobe_ctlblk *kcb) 232static inline void save_previous_kprobe(struct kprobe_ctlblk *kcb)
@@ -578,16 +580,62 @@ int __kprobes kprobe_fault_handler(struct pt_regs *regs, int trapnr)
578{ 580{
579 struct kprobe *cur = kprobe_running(); 581 struct kprobe *cur = kprobe_running();
580 struct kprobe_ctlblk *kcb = get_kprobe_ctlblk(); 582 struct kprobe_ctlblk *kcb = get_kprobe_ctlblk();
583 const struct exception_table_entry *fixup;
581 584
582 if (cur->fault_handler && cur->fault_handler(cur, regs, trapnr)) 585 switch(kcb->kprobe_status) {
583 return 1; 586 case KPROBE_HIT_SS:
584 587 case KPROBE_REENTER:
585 if (kcb->kprobe_status & KPROBE_HIT_SS) { 588 /*
586 resume_execution(cur, regs, kcb); 589 * We are here because the instruction being single
590 * stepped caused a page fault. We reset the current
591 * kprobe and the rip points back to the probe address
592 * and allow the page fault handler to continue as a
593 * normal page fault.
594 */
595 regs->rip = (unsigned long)cur->addr;
587 regs->eflags |= kcb->kprobe_old_rflags; 596 regs->eflags |= kcb->kprobe_old_rflags;
588 597 if (kcb->kprobe_status == KPROBE_REENTER)
589 reset_current_kprobe(); 598 restore_previous_kprobe(kcb);
599 else
600 reset_current_kprobe();
590 preempt_enable_no_resched(); 601 preempt_enable_no_resched();
602 break;
603 case KPROBE_HIT_ACTIVE:
604 case KPROBE_HIT_SSDONE:
605 /*
606 * We increment the nmissed count for accounting,
607 * we can also use npre/npostfault count for accouting
608 * these specific fault cases.
609 */
610 kprobes_inc_nmissed_count(cur);
611
612 /*
613 * We come here because instructions in the pre/post
614 * handler caused the page_fault, this could happen
615 * if handler tries to access user space by
616 * copy_from_user(), get_user() etc. Let the
617 * user-specified handler try to fix it first.
618 */
619 if (cur->fault_handler && cur->fault_handler(cur, regs, trapnr))
620 return 1;
621
622 /*
623 * In case the user-specified fault handler returned
624 * zero, try to fix up.
625 */
626 fixup = search_exception_tables(regs->rip);
627 if (fixup) {
628 regs->rip = fixup->fixup;
629 return 1;
630 }
631
632 /*
633 * fixup() could not handle it,
634 * Let do_page_fault() fix it.
635 */
636 break;
637 default:
638 break;
591 } 639 }
592 return 0; 640 return 0;
593} 641}
@@ -601,6 +649,9 @@ int __kprobes kprobe_exceptions_notify(struct notifier_block *self,
601 struct die_args *args = (struct die_args *)data; 649 struct die_args *args = (struct die_args *)data;
602 int ret = NOTIFY_DONE; 650 int ret = NOTIFY_DONE;
603 651
652 if (args->regs && user_mode(args->regs))
653 return ret;
654
604 switch (val) { 655 switch (val) {
605 case DIE_INT3: 656 case DIE_INT3:
606 if (kprobe_handler(args->regs)) 657 if (kprobe_handler(args->regs))
diff --git a/arch/x86_64/kernel/mce.c b/arch/x86_64/kernel/mce.c
index b8b9529fa89e..10b3e348fc99 100644
--- a/arch/x86_64/kernel/mce.c
+++ b/arch/x86_64/kernel/mce.c
@@ -139,8 +139,7 @@ static void mce_panic(char *msg, struct mce *backup, unsigned long start)
139 139
140static int mce_available(struct cpuinfo_x86 *c) 140static int mce_available(struct cpuinfo_x86 *c)
141{ 141{
142 return test_bit(X86_FEATURE_MCE, &c->x86_capability) && 142 return cpu_has(c, X86_FEATURE_MCE) && cpu_has(c, X86_FEATURE_MCA);
143 test_bit(X86_FEATURE_MCA, &c->x86_capability);
144} 143}
145 144
146static inline void mce_get_rip(struct mce *m, struct pt_regs *regs) 145static inline void mce_get_rip(struct mce *m, struct pt_regs *regs)
@@ -502,7 +501,7 @@ static struct miscdevice mce_log_device = {
502static int __init mcheck_disable(char *str) 501static int __init mcheck_disable(char *str)
503{ 502{
504 mce_dont_init = 1; 503 mce_dont_init = 1;
505 return 0; 504 return 1;
506} 505}
507 506
508/* mce=off disables machine check. Note you can reenable it later 507/* mce=off disables machine check. Note you can reenable it later
@@ -522,7 +521,7 @@ static int __init mcheck_enable(char *str)
522 get_option(&str, &tolerant); 521 get_option(&str, &tolerant);
523 else 522 else
524 printk("mce= argument %s ignored. Please use /sys", str); 523 printk("mce= argument %s ignored. Please use /sys", str);
525 return 0; 524 return 1;
526} 525}
527 526
528__setup("nomce", mcheck_disable); 527__setup("nomce", mcheck_disable);
diff --git a/arch/x86_64/kernel/mpparse.c b/arch/x86_64/kernel/mpparse.c
index 9013a90b5c2e..b17cf3eba359 100644
--- a/arch/x86_64/kernel/mpparse.c
+++ b/arch/x86_64/kernel/mpparse.c
@@ -106,11 +106,11 @@ static int __init mpf_checksum(unsigned char *mp, int len)
106 return sum & 0xFF; 106 return sum & 0xFF;
107} 107}
108 108
109static void __init MP_processor_info (struct mpc_config_processor *m) 109static void __cpuinit MP_processor_info (struct mpc_config_processor *m)
110{ 110{
111 int cpu; 111 int cpu;
112 unsigned char ver; 112 unsigned char ver;
113 static int found_bsp=0; 113 cpumask_t tmp_map;
114 114
115 if (!(m->mpc_cpuflag & CPU_ENABLED)) { 115 if (!(m->mpc_cpuflag & CPU_ENABLED)) {
116 disabled_cpus++; 116 disabled_cpus++;
@@ -133,8 +133,10 @@ static void __init MP_processor_info (struct mpc_config_processor *m)
133 return; 133 return;
134 } 134 }
135 135
136 cpu = num_processors++; 136 num_processors++;
137 137 cpus_complement(tmp_map, cpu_present_map);
138 cpu = first_cpu(tmp_map);
139
138#if MAX_APICS < 255 140#if MAX_APICS < 255
139 if ((int)m->mpc_apicid > MAX_APICS) { 141 if ((int)m->mpc_apicid > MAX_APICS) {
140 printk(KERN_ERR "Processor #%d INVALID. (Max ID: %d).\n", 142 printk(KERN_ERR "Processor #%d INVALID. (Max ID: %d).\n",
@@ -160,12 +162,7 @@ static void __init MP_processor_info (struct mpc_config_processor *m)
160 * entry is BSP, and so on. 162 * entry is BSP, and so on.
161 */ 163 */
162 cpu = 0; 164 cpu = 0;
163 165 }
164 bios_cpu_apicid[0] = m->mpc_apicid;
165 x86_cpu_to_apicid[0] = m->mpc_apicid;
166 found_bsp = 1;
167 } else
168 cpu = num_processors - found_bsp;
169 bios_cpu_apicid[cpu] = m->mpc_apicid; 166 bios_cpu_apicid[cpu] = m->mpc_apicid;
170 x86_cpu_to_apicid[cpu] = m->mpc_apicid; 167 x86_cpu_to_apicid[cpu] = m->mpc_apicid;
171 168
@@ -691,7 +688,7 @@ void __init mp_register_lapic_address (
691} 688}
692 689
693 690
694void __init mp_register_lapic ( 691void __cpuinit mp_register_lapic (
695 u8 id, 692 u8 id,
696 u8 enabled) 693 u8 enabled)
697{ 694{
diff --git a/arch/x86_64/kernel/nmi.c b/arch/x86_64/kernel/nmi.c
index 5bf17e41cd2d..d9e4067faf05 100644
--- a/arch/x86_64/kernel/nmi.c
+++ b/arch/x86_64/kernel/nmi.c
@@ -162,9 +162,7 @@ int __init check_nmi_watchdog (void)
162 local_irq_enable(); 162 local_irq_enable();
163 mdelay((10*1000)/nmi_hz); // wait 10 ticks 163 mdelay((10*1000)/nmi_hz); // wait 10 ticks
164 164
165 for (cpu = 0; cpu < NR_CPUS; cpu++) { 165 for_each_online_cpu(cpu) {
166 if (!cpu_online(cpu))
167 continue;
168 if (cpu_pda(cpu)->__nmi_count - counts[cpu] <= 5) { 166 if (cpu_pda(cpu)->__nmi_count - counts[cpu] <= 5) {
169 endflag = 1; 167 endflag = 1;
170 printk("CPU#%d: NMI appears to be stuck (%d->%d)!\n", 168 printk("CPU#%d: NMI appears to be stuck (%d->%d)!\n",
@@ -536,6 +534,7 @@ asmlinkage __kprobes void do_nmi(struct pt_regs * regs, long error_code)
536 534
537void set_nmi_callback(nmi_callback_t callback) 535void set_nmi_callback(nmi_callback_t callback)
538{ 536{
537 vmalloc_sync_all();
539 rcu_assign_pointer(nmi_callback, callback); 538 rcu_assign_pointer(nmi_callback, callback);
540} 539}
541 540
diff --git a/arch/x86_64/kernel/pci-dma.c b/arch/x86_64/kernel/pci-dma.c
index 4ed391edd47a..03c9eeedb0f3 100644
--- a/arch/x86_64/kernel/pci-dma.c
+++ b/arch/x86_64/kernel/pci-dma.c
@@ -73,6 +73,9 @@ dma_alloc_coherent(struct device *dev, size_t size, dma_addr_t *dma_handle,
73 if (dma_mask == 0) 73 if (dma_mask == 0)
74 dma_mask = 0xffffffff; 74 dma_mask = 0xffffffff;
75 75
76 /* Don't invoke OOM killer */
77 gfp |= __GFP_NORETRY;
78
76 /* Kludge to make it bug-to-bug compatible with i386. i386 79 /* Kludge to make it bug-to-bug compatible with i386. i386
77 uses the normal dma_mask for alloc_coherent. */ 80 uses the normal dma_mask for alloc_coherent. */
78 dma_mask &= *dev->dma_mask; 81 dma_mask &= *dev->dma_mask;
diff --git a/arch/x86_64/kernel/pci-gart.c b/arch/x86_64/kernel/pci-gart.c
index 0c3f052ba6ce..a6c01e121266 100644
--- a/arch/x86_64/kernel/pci-gart.c
+++ b/arch/x86_64/kernel/pci-gart.c
@@ -65,9 +65,7 @@ static u32 gart_unmapped_entry;
65 65
66#define for_all_nb(dev) \ 66#define for_all_nb(dev) \
67 dev = NULL; \ 67 dev = NULL; \
68 while ((dev = pci_get_device(PCI_VENDOR_ID_AMD, 0x1103, dev))!=NULL)\ 68 while ((dev = pci_get_device(PCI_VENDOR_ID_AMD, 0x1103, dev))!=NULL)
69 if (dev->bus->number == 0 && \
70 (PCI_SLOT(dev->devfn) >= 24) && (PCI_SLOT(dev->devfn) <= 31))
71 69
72static struct pci_dev *northbridges[MAX_NB]; 70static struct pci_dev *northbridges[MAX_NB];
73static u32 northbridge_flush_word[MAX_NB]; 71static u32 northbridge_flush_word[MAX_NB];
@@ -148,9 +146,12 @@ static void flush_gart(struct device *dev)
148 if (!northbridges[i]) 146 if (!northbridges[i])
149 continue; 147 continue;
150 /* Make sure the hardware actually executed the flush. */ 148 /* Make sure the hardware actually executed the flush. */
151 do { 149 for (;;) {
152 pci_read_config_dword(northbridges[i], 0x9c, &w); 150 pci_read_config_dword(northbridges[i], 0x9c, &w);
153 } while (w & 1); 151 if (!(w & 1))
152 break;
153 cpu_relax();
154 }
154 } 155 }
155 if (!flushed) 156 if (!flushed)
156 printk("nothing to flush?\n"); 157 printk("nothing to flush?\n");
diff --git a/arch/x86_64/kernel/pmtimer.c b/arch/x86_64/kernel/pmtimer.c
index 5c51d10408a6..b0444a415bd6 100644
--- a/arch/x86_64/kernel/pmtimer.c
+++ b/arch/x86_64/kernel/pmtimer.c
@@ -86,7 +86,7 @@ static unsigned pmtimer_wait_tick(void)
86 for (a = b = inl(pmtmr_ioport) & ACPI_PM_MASK; 86 for (a = b = inl(pmtmr_ioport) & ACPI_PM_MASK;
87 a == b; 87 a == b;
88 b = inl(pmtmr_ioport) & ACPI_PM_MASK) 88 b = inl(pmtmr_ioport) & ACPI_PM_MASK)
89 ; 89 cpu_relax();
90 return b; 90 return b;
91} 91}
92 92
@@ -97,6 +97,7 @@ void pmtimer_wait(unsigned us)
97 a = pmtimer_wait_tick(); 97 a = pmtimer_wait_tick();
98 do { 98 do {
99 b = inl(pmtmr_ioport); 99 b = inl(pmtmr_ioport);
100 cpu_relax();
100 } while (cyc2us(b - a) < us); 101 } while (cyc2us(b - a) < us);
101} 102}
102 103
@@ -120,7 +121,7 @@ unsigned int do_gettimeoffset_pm(void)
120static int __init nopmtimer_setup(char *s) 121static int __init nopmtimer_setup(char *s)
121{ 122{
122 pmtmr_ioport = 0; 123 pmtmr_ioport = 0;
123 return 0; 124 return 1;
124} 125}
125 126
126__setup("nopmtimer", nopmtimer_setup); 127__setup("nopmtimer", nopmtimer_setup);
diff --git a/arch/x86_64/kernel/process.c b/arch/x86_64/kernel/process.c
index 22a05dec81a2..70dd8e5c6889 100644
--- a/arch/x86_64/kernel/process.c
+++ b/arch/x86_64/kernel/process.c
@@ -35,8 +35,8 @@
35#include <linux/ptrace.h> 35#include <linux/ptrace.h>
36#include <linux/utsname.h> 36#include <linux/utsname.h>
37#include <linux/random.h> 37#include <linux/random.h>
38#include <linux/kprobes.h>
39#include <linux/notifier.h> 38#include <linux/notifier.h>
39#include <linux/kprobes.h>
40 40
41#include <asm/uaccess.h> 41#include <asm/uaccess.h>
42#include <asm/pgtable.h> 42#include <asm/pgtable.h>
@@ -66,24 +66,17 @@ EXPORT_SYMBOL(boot_option_idle_override);
66void (*pm_idle)(void); 66void (*pm_idle)(void);
67static DEFINE_PER_CPU(unsigned int, cpu_idle_state); 67static DEFINE_PER_CPU(unsigned int, cpu_idle_state);
68 68
69static struct notifier_block *idle_notifier; 69static ATOMIC_NOTIFIER_HEAD(idle_notifier);
70static DEFINE_SPINLOCK(idle_notifier_lock);
71 70
72void idle_notifier_register(struct notifier_block *n) 71void idle_notifier_register(struct notifier_block *n)
73{ 72{
74 unsigned long flags; 73 atomic_notifier_chain_register(&idle_notifier, n);
75 spin_lock_irqsave(&idle_notifier_lock, flags);
76 notifier_chain_register(&idle_notifier, n);
77 spin_unlock_irqrestore(&idle_notifier_lock, flags);
78} 74}
79EXPORT_SYMBOL_GPL(idle_notifier_register); 75EXPORT_SYMBOL_GPL(idle_notifier_register);
80 76
81void idle_notifier_unregister(struct notifier_block *n) 77void idle_notifier_unregister(struct notifier_block *n)
82{ 78{
83 unsigned long flags; 79 atomic_notifier_chain_unregister(&idle_notifier, n);
84 spin_lock_irqsave(&idle_notifier_lock, flags);
85 notifier_chain_unregister(&idle_notifier, n);
86 spin_unlock_irqrestore(&idle_notifier_lock, flags);
87} 80}
88EXPORT_SYMBOL(idle_notifier_unregister); 81EXPORT_SYMBOL(idle_notifier_unregister);
89 82
@@ -93,13 +86,13 @@ static DEFINE_PER_CPU(enum idle_state, idle_state) = CPU_NOT_IDLE;
93void enter_idle(void) 86void enter_idle(void)
94{ 87{
95 __get_cpu_var(idle_state) = CPU_IDLE; 88 __get_cpu_var(idle_state) = CPU_IDLE;
96 notifier_call_chain(&idle_notifier, IDLE_START, NULL); 89 atomic_notifier_call_chain(&idle_notifier, IDLE_START, NULL);
97} 90}
98 91
99static void __exit_idle(void) 92static void __exit_idle(void)
100{ 93{
101 __get_cpu_var(idle_state) = CPU_NOT_IDLE; 94 __get_cpu_var(idle_state) = CPU_NOT_IDLE;
102 notifier_call_chain(&idle_notifier, IDLE_END, NULL); 95 atomic_notifier_call_chain(&idle_notifier, IDLE_END, NULL);
103} 96}
104 97
105/* Called from interrupts to signify idle end */ 98/* Called from interrupts to signify idle end */
@@ -114,7 +107,7 @@ void exit_idle(void)
114 * We use this if we don't have any better 107 * We use this if we don't have any better
115 * idle routine.. 108 * idle routine..
116 */ 109 */
117void default_idle(void) 110static void default_idle(void)
118{ 111{
119 local_irq_enable(); 112 local_irq_enable();
120 113
@@ -353,13 +346,6 @@ void exit_thread(void)
353 struct task_struct *me = current; 346 struct task_struct *me = current;
354 struct thread_struct *t = &me->thread; 347 struct thread_struct *t = &me->thread;
355 348
356 /*
357 * Remove function-return probe instances associated with this task
358 * and put them back on the free list. Do not insert an exit probe for
359 * this function, it will be disabled by kprobe_flush_task if you do.
360 */
361 kprobe_flush_task(me);
362
363 if (me->thread.io_bitmap_ptr) { 349 if (me->thread.io_bitmap_ptr) {
364 struct tss_struct *tss = &per_cpu(init_tss, get_cpu()); 350 struct tss_struct *tss = &per_cpu(init_tss, get_cpu());
365 351
@@ -508,7 +494,7 @@ out:
508/* 494/*
509 * This special macro can be used to load a debugging register 495 * This special macro can be used to load a debugging register
510 */ 496 */
511#define loaddebug(thread,r) set_debug(thread->debugreg ## r, r) 497#define loaddebug(thread,r) set_debugreg(thread->debugreg ## r, r)
512 498
513/* 499/*
514 * switch_to(x,y) should switch tasks from x to y. 500 * switch_to(x,y) should switch tasks from x to y.
@@ -527,8 +513,6 @@ __switch_to(struct task_struct *prev_p, struct task_struct *next_p)
527 int cpu = smp_processor_id(); 513 int cpu = smp_processor_id();
528 struct tss_struct *tss = &per_cpu(init_tss, cpu); 514 struct tss_struct *tss = &per_cpu(init_tss, cpu);
529 515
530 unlazy_fpu(prev_p);
531
532 /* 516 /*
533 * Reload esp0, LDT and the page table pointer: 517 * Reload esp0, LDT and the page table pointer:
534 */ 518 */
@@ -586,11 +570,14 @@ __switch_to(struct task_struct *prev_p, struct task_struct *next_p)
586 } 570 }
587 571
588 /* 572 /*
589 * Switch the PDA context. 573 * Switch the PDA and FPU contexts.
590 */ 574 */
591 prev->userrsp = read_pda(oldrsp); 575 prev->userrsp = read_pda(oldrsp);
592 write_pda(oldrsp, next->userrsp); 576 write_pda(oldrsp, next->userrsp);
593 write_pda(pcurrent, next_p); 577 write_pda(pcurrent, next_p);
578 /* This must be here to ensure both math_state_restore() and
579 kernel_fpu_begin() work consistently. */
580 unlazy_fpu(prev_p);
594 write_pda(kernelstack, 581 write_pda(kernelstack,
595 task_stack_page(next_p) + THREAD_SIZE - PDA_STACKOFFSET); 582 task_stack_page(next_p) + THREAD_SIZE - PDA_STACKOFFSET);
596 583
diff --git a/arch/x86_64/kernel/ptrace.c b/arch/x86_64/kernel/ptrace.c
index 53205622351c..d44b2c1e63a6 100644
--- a/arch/x86_64/kernel/ptrace.c
+++ b/arch/x86_64/kernel/ptrace.c
@@ -420,9 +420,9 @@ long arch_ptrace(struct task_struct *child, long request, long addr, long data)
420 case offsetof(struct user, u_debugreg[7]): 420 case offsetof(struct user, u_debugreg[7]):
421 /* See arch/i386/kernel/ptrace.c for an explanation of 421 /* See arch/i386/kernel/ptrace.c for an explanation of
422 * this awkward check.*/ 422 * this awkward check.*/
423 data &= ~DR_CONTROL_RESERVED; 423 data &= ~DR_CONTROL_RESERVED;
424 for(i=0; i<4; i++) 424 for(i=0; i<4; i++)
425 if ((0x5454 >> ((data >> (16 + 4*i)) & 0xf)) & 1) 425 if ((0x5554 >> ((data >> (16 + 4*i)) & 0xf)) & 1)
426 break; 426 break;
427 if (i == 4) { 427 if (i == 4) {
428 child->thread.debugreg7 = data; 428 child->thread.debugreg7 = data;
diff --git a/arch/x86_64/kernel/setup.c b/arch/x86_64/kernel/setup.c
index aa55e3cec665..0856ad444f90 100644
--- a/arch/x86_64/kernel/setup.c
+++ b/arch/x86_64/kernel/setup.c
@@ -46,6 +46,7 @@
46#include <linux/cpufreq.h> 46#include <linux/cpufreq.h>
47#include <linux/dmi.h> 47#include <linux/dmi.h>
48#include <linux/dma-mapping.h> 48#include <linux/dma-mapping.h>
49#include <linux/ctype.h>
49 50
50#include <asm/mtrr.h> 51#include <asm/mtrr.h>
51#include <asm/uaccess.h> 52#include <asm/uaccess.h>
@@ -67,6 +68,7 @@
67#include <asm/swiotlb.h> 68#include <asm/swiotlb.h>
68#include <asm/sections.h> 69#include <asm/sections.h>
69#include <asm/gart-mapping.h> 70#include <asm/gart-mapping.h>
71#include <asm/dmi.h>
70 72
71/* 73/*
72 * Machine setup.. 74 * Machine setup..
@@ -91,6 +93,12 @@ int bootloader_type;
91 93
92unsigned long saved_video_mode; 94unsigned long saved_video_mode;
93 95
96/*
97 * Early DMI memory
98 */
99int dmi_alloc_index;
100char dmi_alloc_data[DMI_MAX_DATA];
101
94/* 102/*
95 * Setup options 103 * Setup options
96 */ 104 */
@@ -270,6 +278,13 @@ static void __init probe_roms(void)
270 } 278 }
271} 279}
272 280
281/* Check for full argument with no trailing characters */
282static int fullarg(char *p, char *arg)
283{
284 int l = strlen(arg);
285 return !memcmp(p, arg, l) && (p[l] == 0 || isspace(p[l]));
286}
287
273static __init void parse_cmdline_early (char ** cmdline_p) 288static __init void parse_cmdline_early (char ** cmdline_p)
274{ 289{
275 char c = ' ', *to = command_line, *from = COMMAND_LINE; 290 char c = ' ', *to = command_line, *from = COMMAND_LINE;
@@ -293,10 +308,10 @@ static __init void parse_cmdline_early (char ** cmdline_p)
293#endif 308#endif
294#ifdef CONFIG_ACPI 309#ifdef CONFIG_ACPI
295 /* "acpi=off" disables both ACPI table parsing and interpreter init */ 310 /* "acpi=off" disables both ACPI table parsing and interpreter init */
296 if (!memcmp(from, "acpi=off", 8)) 311 if (fullarg(from,"acpi=off"))
297 disable_acpi(); 312 disable_acpi();
298 313
299 if (!memcmp(from, "acpi=force", 10)) { 314 if (fullarg(from, "acpi=force")) {
300 /* add later when we do DMI horrors: */ 315 /* add later when we do DMI horrors: */
301 acpi_force = 1; 316 acpi_force = 1;
302 acpi_disabled = 0; 317 acpi_disabled = 0;
@@ -304,52 +319,47 @@ static __init void parse_cmdline_early (char ** cmdline_p)
304 319
305 /* acpi=ht just means: do ACPI MADT parsing 320 /* acpi=ht just means: do ACPI MADT parsing
306 at bootup, but don't enable the full ACPI interpreter */ 321 at bootup, but don't enable the full ACPI interpreter */
307 if (!memcmp(from, "acpi=ht", 7)) { 322 if (fullarg(from, "acpi=ht")) {
308 if (!acpi_force) 323 if (!acpi_force)
309 disable_acpi(); 324 disable_acpi();
310 acpi_ht = 1; 325 acpi_ht = 1;
311 } 326 }
312 else if (!memcmp(from, "pci=noacpi", 10)) 327 else if (fullarg(from, "pci=noacpi"))
313 acpi_disable_pci(); 328 acpi_disable_pci();
314 else if (!memcmp(from, "acpi=noirq", 10)) 329 else if (fullarg(from, "acpi=noirq"))
315 acpi_noirq_set(); 330 acpi_noirq_set();
316 331
317 else if (!memcmp(from, "acpi_sci=edge", 13)) 332 else if (fullarg(from, "acpi_sci=edge"))
318 acpi_sci_flags.trigger = 1; 333 acpi_sci_flags.trigger = 1;
319 else if (!memcmp(from, "acpi_sci=level", 14)) 334 else if (fullarg(from, "acpi_sci=level"))
320 acpi_sci_flags.trigger = 3; 335 acpi_sci_flags.trigger = 3;
321 else if (!memcmp(from, "acpi_sci=high", 13)) 336 else if (fullarg(from, "acpi_sci=high"))
322 acpi_sci_flags.polarity = 1; 337 acpi_sci_flags.polarity = 1;
323 else if (!memcmp(from, "acpi_sci=low", 12)) 338 else if (fullarg(from, "acpi_sci=low"))
324 acpi_sci_flags.polarity = 3; 339 acpi_sci_flags.polarity = 3;
325 340
326 /* acpi=strict disables out-of-spec workarounds */ 341 /* acpi=strict disables out-of-spec workarounds */
327 else if (!memcmp(from, "acpi=strict", 11)) { 342 else if (fullarg(from, "acpi=strict")) {
328 acpi_strict = 1; 343 acpi_strict = 1;
329 } 344 }
330#ifdef CONFIG_X86_IO_APIC 345#ifdef CONFIG_X86_IO_APIC
331 else if (!memcmp(from, "acpi_skip_timer_override", 24)) 346 else if (fullarg(from, "acpi_skip_timer_override"))
332 acpi_skip_timer_override = 1; 347 acpi_skip_timer_override = 1;
333#endif 348#endif
334#endif 349#endif
335 350
336 if (!memcmp(from, "disable_timer_pin_1", 19)) 351 if (fullarg(from, "disable_timer_pin_1"))
337 disable_timer_pin_1 = 1; 352 disable_timer_pin_1 = 1;
338 if (!memcmp(from, "enable_timer_pin_1", 18)) 353 if (fullarg(from, "enable_timer_pin_1"))
339 disable_timer_pin_1 = -1; 354 disable_timer_pin_1 = -1;
340 355
341 if (!memcmp(from, "nolapic", 7) || 356 if (fullarg(from, "nolapic") || fullarg(from, "disableapic"))
342 !memcmp(from, "disableapic", 11))
343 disable_apic = 1; 357 disable_apic = 1;
344 358
345 /* Don't confuse with noapictimer */ 359 if (fullarg(from, "noapic"))
346 if (!memcmp(from, "noapic", 6) &&
347 (from[6] == ' ' || from[6] == 0))
348 skip_ioapic_setup = 1; 360 skip_ioapic_setup = 1;
349 361
350 /* Make sure to not confuse with apic= */ 362 if (fullarg(from,"apic")) {
351 if (!memcmp(from, "apic", 4) &&
352 (from[4] == ' ' || from[4] == 0)) {
353 skip_ioapic_setup = 0; 363 skip_ioapic_setup = 0;
354 ioapic_force = 1; 364 ioapic_force = 1;
355 } 365 }
@@ -388,7 +398,7 @@ static __init void parse_cmdline_early (char ** cmdline_p)
388 iommu_setup(from+6); 398 iommu_setup(from+6);
389 } 399 }
390 400
391 if (!memcmp(from,"oops=panic", 10)) 401 if (fullarg(from,"oops=panic"))
392 panic_on_oops = 1; 402 panic_on_oops = 1;
393 403
394 if (!memcmp(from, "noexec=", 7)) 404 if (!memcmp(from, "noexec=", 7))
@@ -530,7 +540,7 @@ void __init alternative_instructions(void)
530static int __init noreplacement_setup(char *s) 540static int __init noreplacement_setup(char *s)
531{ 541{
532 no_replacement = 1; 542 no_replacement = 1;
533 return 0; 543 return 1;
534} 544}
535 545
536__setup("noreplacement", noreplacement_setup); 546__setup("noreplacement", noreplacement_setup);
@@ -611,11 +621,14 @@ void __init setup_arch(char **cmdline_p)
611 * we are rounding upwards: 621 * we are rounding upwards:
612 */ 622 */
613 end_pfn = e820_end_of_ram(); 623 end_pfn = e820_end_of_ram();
624 num_physpages = end_pfn; /* for pfn_valid */
614 625
615 check_efer(); 626 check_efer();
616 627
617 init_memory_mapping(0, (end_pfn_map << PAGE_SHIFT)); 628 init_memory_mapping(0, (end_pfn_map << PAGE_SHIFT));
618 629
630 dmi_scan_machine();
631
619 zap_low_mappings(0); 632 zap_low_mappings(0);
620 633
621#ifdef CONFIG_ACPI 634#ifdef CONFIG_ACPI
@@ -708,6 +721,12 @@ void __init setup_arch(char **cmdline_p)
708 721
709 check_ioapic(); 722 check_ioapic();
710 723
724 /*
725 * set this early, so we dont allocate cpu0
726 * if MADT list doesnt list BSP first
727 * mpparse.c/MP_processor_info() allocates logical cpu numbers.
728 */
729 cpu_set(0, cpu_present_map);
711#ifdef CONFIG_ACPI 730#ifdef CONFIG_ACPI
712 /* 731 /*
713 * Read APIC and some other early information from ACPI tables. 732 * Read APIC and some other early information from ACPI tables.
@@ -836,7 +855,7 @@ static void __init amd_detect_cmp(struct cpuinfo_x86 *c)
836 unsigned bits; 855 unsigned bits;
837#ifdef CONFIG_NUMA 856#ifdef CONFIG_NUMA
838 int node = 0; 857 int node = 0;
839 unsigned apicid = phys_proc_id[cpu]; 858 unsigned apicid = hard_smp_processor_id();
840#endif 859#endif
841 860
842 bits = 0; 861 bits = 0;
@@ -846,7 +865,7 @@ static void __init amd_detect_cmp(struct cpuinfo_x86 *c)
846 /* Low order bits define the core id (index of core in socket) */ 865 /* Low order bits define the core id (index of core in socket) */
847 cpu_core_id[cpu] = phys_proc_id[cpu] & ((1 << bits)-1); 866 cpu_core_id[cpu] = phys_proc_id[cpu] & ((1 << bits)-1);
848 /* Convert the APIC ID into the socket ID */ 867 /* Convert the APIC ID into the socket ID */
849 phys_proc_id[cpu] >>= bits; 868 phys_proc_id[cpu] = phys_pkg_id(bits);
850 869
851#ifdef CONFIG_NUMA 870#ifdef CONFIG_NUMA
852 node = phys_proc_id[cpu]; 871 node = phys_proc_id[cpu];
@@ -872,8 +891,8 @@ static void __init amd_detect_cmp(struct cpuinfo_x86 *c)
872 } 891 }
873 numa_set_node(cpu, node); 892 numa_set_node(cpu, node);
874 893
875 printk(KERN_INFO "CPU %d(%d) -> Node %d -> Core %d\n", 894 printk(KERN_INFO "CPU %d/%x(%d) -> Node %d -> Core %d\n",
876 cpu, c->x86_max_cores, node, cpu_core_id[cpu]); 895 cpu, apicid, c->x86_max_cores, node, cpu_core_id[cpu]);
877#endif 896#endif
878#endif 897#endif
879} 898}
@@ -927,8 +946,6 @@ static int __init init_amd(struct cpuinfo_x86 *c)
927 946
928 if (c->extended_cpuid_level >= 0x80000008) { 947 if (c->extended_cpuid_level >= 0x80000008) {
929 c->x86_max_cores = (cpuid_ecx(0x80000008) & 0xff) + 1; 948 c->x86_max_cores = (cpuid_ecx(0x80000008) & 0xff) + 1;
930 if (c->x86_max_cores & (c->x86_max_cores - 1))
931 c->x86_max_cores = 1;
932 949
933 amd_detect_cmp(c); 950 amd_detect_cmp(c);
934 } 951 }
@@ -945,7 +962,6 @@ static void __cpuinit detect_ht(struct cpuinfo_x86 *c)
945 962
946 cpuid(1, &eax, &ebx, &ecx, &edx); 963 cpuid(1, &eax, &ebx, &ecx, &edx);
947 964
948 c->apicid = phys_pkg_id(0);
949 965
950 if (!cpu_has(c, X86_FEATURE_HT) || cpu_has(c, X86_FEATURE_CMP_LEGACY)) 966 if (!cpu_has(c, X86_FEATURE_HT) || cpu_has(c, X86_FEATURE_CMP_LEGACY))
951 return; 967 return;
@@ -1154,6 +1170,8 @@ void __cpuinit identify_cpu(struct cpuinfo_x86 *c)
1154 c->x86_capability[2] = cpuid_edx(0x80860001); 1170 c->x86_capability[2] = cpuid_edx(0x80860001);
1155 } 1171 }
1156 1172
1173 c->apicid = phys_pkg_id(0);
1174
1157 /* 1175 /*
1158 * Vendor-specific initialization. In this section we 1176 * Vendor-specific initialization. In this section we
1159 * canonicalize the feature flags, meaning if there are 1177 * canonicalize the feature flags, meaning if there are
@@ -1261,7 +1279,7 @@ static int show_cpuinfo(struct seq_file *m, void *v)
1261 NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 1279 NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
1262 1280
1263 /* Intel-defined (#2) */ 1281 /* Intel-defined (#2) */
1264 "pni", NULL, NULL, "monitor", "ds_cpl", "vmx", NULL, "est", 1282 "pni", NULL, NULL, "monitor", "ds_cpl", "vmx", "smx", "est",
1265 "tm2", NULL, "cid", NULL, NULL, "cx16", "xtpr", NULL, 1283 "tm2", NULL, "cid", NULL, NULL, "cx16", "xtpr", NULL,
1266 NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 1284 NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
1267 NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 1285 NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
@@ -1344,8 +1362,7 @@ static int show_cpuinfo(struct seq_file *m, void *v)
1344 { 1362 {
1345 int i; 1363 int i;
1346 for ( i = 0 ; i < 32*NCAPINTS ; i++ ) 1364 for ( i = 0 ; i < 32*NCAPINTS ; i++ )
1347 if ( test_bit(i, &c->x86_capability) && 1365 if (cpu_has(c, i) && x86_cap_flags[i] != NULL)
1348 x86_cap_flags[i] != NULL )
1349 seq_printf(m, " %s", x86_cap_flags[i]); 1366 seq_printf(m, " %s", x86_cap_flags[i]);
1350 } 1367 }
1351 1368
@@ -1403,10 +1420,3 @@ struct seq_operations cpuinfo_op = {
1403 .show = show_cpuinfo, 1420 .show = show_cpuinfo,
1404}; 1421};
1405 1422
1406static int __init run_dmi_scan(void)
1407{
1408 dmi_scan_machine();
1409 return 0;
1410}
1411core_initcall(run_dmi_scan);
1412
diff --git a/arch/x86_64/kernel/setup64.c b/arch/x86_64/kernel/setup64.c
index 70f1bb808a20..8a691fa6d393 100644
--- a/arch/x86_64/kernel/setup64.c
+++ b/arch/x86_64/kernel/setup64.c
@@ -33,7 +33,7 @@ cpumask_t cpu_initialized __cpuinitdata = CPU_MASK_NONE;
33struct x8664_pda *_cpu_pda[NR_CPUS] __read_mostly; 33struct x8664_pda *_cpu_pda[NR_CPUS] __read_mostly;
34struct x8664_pda boot_cpu_pda[NR_CPUS] __cacheline_aligned; 34struct x8664_pda boot_cpu_pda[NR_CPUS] __cacheline_aligned;
35 35
36struct desc_ptr idt_descr = { 256 * 16, (unsigned long) idt_table }; 36struct desc_ptr idt_descr = { 256 * 16 - 1, (unsigned long) idt_table };
37 37
38char boot_cpu_stack[IRQSTACKSIZE] __attribute__((section(".bss.page_aligned"))); 38char boot_cpu_stack[IRQSTACKSIZE] __attribute__((section(".bss.page_aligned")));
39 39
@@ -55,11 +55,11 @@ int __init nonx_setup(char *str)
55 do_not_nx = 1; 55 do_not_nx = 1;
56 __supported_pte_mask &= ~_PAGE_NX; 56 __supported_pte_mask &= ~_PAGE_NX;
57 } 57 }
58 return 0; 58 return 1;
59} 59}
60__setup("noexec=", nonx_setup); /* parsed early actually */ 60__setup("noexec=", nonx_setup); /* parsed early actually */
61 61
62int force_personality32 = READ_IMPLIES_EXEC; 62int force_personality32 = 0;
63 63
64/* noexec32=on|off 64/* noexec32=on|off
65Control non executable heap for 32bit processes. 65Control non executable heap for 32bit processes.
@@ -74,7 +74,7 @@ static int __init nonx32_setup(char *str)
74 force_personality32 &= ~READ_IMPLIES_EXEC; 74 force_personality32 &= ~READ_IMPLIES_EXEC;
75 else if (!strcmp(str, "off")) 75 else if (!strcmp(str, "off"))
76 force_personality32 |= READ_IMPLIES_EXEC; 76 force_personality32 |= READ_IMPLIES_EXEC;
77 return 0; 77 return 1;
78} 78}
79__setup("noexec32=", nonx32_setup); 79__setup("noexec32=", nonx32_setup);
80 80
@@ -248,7 +248,7 @@ void __cpuinit cpu_init (void)
248 switch (v + 1) { 248 switch (v + 1) {
249#if DEBUG_STKSZ > EXCEPTION_STKSZ 249#if DEBUG_STKSZ > EXCEPTION_STKSZ
250 case DEBUG_STACK: 250 case DEBUG_STACK:
251 cpu_pda[cpu].debugstack = (unsigned long)estacks; 251 cpu_pda(cpu)->debugstack = (unsigned long)estacks;
252 estacks += DEBUG_STKSZ; 252 estacks += DEBUG_STKSZ;
253 break; 253 break;
254#endif 254#endif
@@ -281,12 +281,12 @@ void __cpuinit cpu_init (void)
281 * Clear all 6 debug registers: 281 * Clear all 6 debug registers:
282 */ 282 */
283 283
284 set_debug(0UL, 0); 284 set_debugreg(0UL, 0);
285 set_debug(0UL, 1); 285 set_debugreg(0UL, 1);
286 set_debug(0UL, 2); 286 set_debugreg(0UL, 2);
287 set_debug(0UL, 3); 287 set_debugreg(0UL, 3);
288 set_debug(0UL, 6); 288 set_debugreg(0UL, 6);
289 set_debug(0UL, 7); 289 set_debugreg(0UL, 7);
290 290
291 fpu_init(); 291 fpu_init();
292} 292}
diff --git a/arch/x86_64/kernel/signal.c b/arch/x86_64/kernel/signal.c
index 5876df116c92..e5f5ce7909a3 100644
--- a/arch/x86_64/kernel/signal.c
+++ b/arch/x86_64/kernel/signal.c
@@ -443,9 +443,6 @@ int do_signal(struct pt_regs *regs, sigset_t *oldset)
443 if (!user_mode(regs)) 443 if (!user_mode(regs))
444 return 1; 444 return 1;
445 445
446 if (try_to_freeze())
447 goto no_signal;
448
449 if (!oldset) 446 if (!oldset)
450 oldset = &current->blocked; 447 oldset = &current->blocked;
451 448
@@ -463,7 +460,6 @@ int do_signal(struct pt_regs *regs, sigset_t *oldset)
463 return handle_signal(signr, &info, &ka, oldset, regs); 460 return handle_signal(signr, &info, &ka, oldset, regs);
464 } 461 }
465 462
466 no_signal:
467 /* Did we come from a system call? */ 463 /* Did we come from a system call? */
468 if ((long)regs->orig_rax >= 0) { 464 if ((long)regs->orig_rax >= 0) {
469 /* Restart the system call - no handlers present */ 465 /* Restart the system call - no handlers present */
diff --git a/arch/x86_64/kernel/smp.c b/arch/x86_64/kernel/smp.c
index 19ef012b1f17..4a6628b14d99 100644
--- a/arch/x86_64/kernel/smp.c
+++ b/arch/x86_64/kernel/smp.c
@@ -75,7 +75,7 @@ static inline void leave_mm(int cpu)
75{ 75{
76 if (read_pda(mmu_state) == TLBSTATE_OK) 76 if (read_pda(mmu_state) == TLBSTATE_OK)
77 BUG(); 77 BUG();
78 clear_bit(cpu, &read_pda(active_mm)->cpu_vm_mask); 78 cpu_clear(cpu, read_pda(active_mm)->cpu_vm_mask);
79 load_cr3(swapper_pg_dir); 79 load_cr3(swapper_pg_dir);
80} 80}
81 81
@@ -85,7 +85,7 @@ static inline void leave_mm(int cpu)
85 * [cpu0: the cpu that switches] 85 * [cpu0: the cpu that switches]
86 * 1) switch_mm() either 1a) or 1b) 86 * 1) switch_mm() either 1a) or 1b)
87 * 1a) thread switch to a different mm 87 * 1a) thread switch to a different mm
88 * 1a1) clear_bit(cpu, &old_mm->cpu_vm_mask); 88 * 1a1) cpu_clear(cpu, old_mm->cpu_vm_mask);
89 * Stop ipi delivery for the old mm. This is not synchronized with 89 * Stop ipi delivery for the old mm. This is not synchronized with
90 * the other cpus, but smp_invalidate_interrupt ignore flush ipis 90 * the other cpus, but smp_invalidate_interrupt ignore flush ipis
91 * for the wrong mm, and in the worst case we perform a superfluous 91 * for the wrong mm, and in the worst case we perform a superfluous
@@ -95,7 +95,7 @@ static inline void leave_mm(int cpu)
95 * was in lazy tlb mode. 95 * was in lazy tlb mode.
96 * 1a3) update cpu active_mm 96 * 1a3) update cpu active_mm
97 * Now cpu0 accepts tlb flushes for the new mm. 97 * Now cpu0 accepts tlb flushes for the new mm.
98 * 1a4) set_bit(cpu, &new_mm->cpu_vm_mask); 98 * 1a4) cpu_set(cpu, new_mm->cpu_vm_mask);
99 * Now the other cpus will send tlb flush ipis. 99 * Now the other cpus will send tlb flush ipis.
100 * 1a4) change cr3. 100 * 1a4) change cr3.
101 * 1b) thread switch without mm change 101 * 1b) thread switch without mm change
diff --git a/arch/x86_64/kernel/smpboot.c b/arch/x86_64/kernel/smpboot.c
index 66e98659d077..71a7222cf9ce 100644
--- a/arch/x86_64/kernel/smpboot.c
+++ b/arch/x86_64/kernel/smpboot.c
@@ -68,6 +68,9 @@ u8 phys_proc_id[NR_CPUS] __read_mostly = { [0 ... NR_CPUS-1] = BAD_APICID };
68/* core ID of each logical CPU */ 68/* core ID of each logical CPU */
69u8 cpu_core_id[NR_CPUS] __read_mostly = { [0 ... NR_CPUS-1] = BAD_APICID }; 69u8 cpu_core_id[NR_CPUS] __read_mostly = { [0 ... NR_CPUS-1] = BAD_APICID };
70 70
71/* Last level cache ID of each logical CPU */
72u8 cpu_llc_id[NR_CPUS] __cpuinitdata = {[0 ... NR_CPUS-1] = BAD_APICID};
73
71/* Bitmask of currently online CPUs */ 74/* Bitmask of currently online CPUs */
72cpumask_t cpu_online_map __read_mostly; 75cpumask_t cpu_online_map __read_mostly;
73 76
@@ -350,7 +353,7 @@ static void __cpuinit tsc_sync_wait(void)
350static __init int notscsync_setup(char *s) 353static __init int notscsync_setup(char *s)
351{ 354{
352 notscsync = 1; 355 notscsync = 1;
353 return 0; 356 return 1;
354} 357}
355__setup("notscsync", notscsync_setup); 358__setup("notscsync", notscsync_setup);
356 359
@@ -445,6 +448,18 @@ void __cpuinit smp_callin(void)
445 cpu_set(cpuid, cpu_callin_map); 448 cpu_set(cpuid, cpu_callin_map);
446} 449}
447 450
451/* maps the cpu to the sched domain representing multi-core */
452cpumask_t cpu_coregroup_map(int cpu)
453{
454 struct cpuinfo_x86 *c = cpu_data + cpu;
455 /*
456 * For perf, we return last level cache shared map.
457 * TBD: when power saving sched policy is added, we will return
458 * cpu_core_map when power saving policy is enabled
459 */
460 return c->llc_shared_map;
461}
462
448/* representing cpus for which sibling maps can be computed */ 463/* representing cpus for which sibling maps can be computed */
449static cpumask_t cpu_sibling_setup_map; 464static cpumask_t cpu_sibling_setup_map;
450 465
@@ -463,12 +478,16 @@ static inline void set_cpu_sibling_map(int cpu)
463 cpu_set(cpu, cpu_sibling_map[i]); 478 cpu_set(cpu, cpu_sibling_map[i]);
464 cpu_set(i, cpu_core_map[cpu]); 479 cpu_set(i, cpu_core_map[cpu]);
465 cpu_set(cpu, cpu_core_map[i]); 480 cpu_set(cpu, cpu_core_map[i]);
481 cpu_set(i, c[cpu].llc_shared_map);
482 cpu_set(cpu, c[i].llc_shared_map);
466 } 483 }
467 } 484 }
468 } else { 485 } else {
469 cpu_set(cpu, cpu_sibling_map[cpu]); 486 cpu_set(cpu, cpu_sibling_map[cpu]);
470 } 487 }
471 488
489 cpu_set(cpu, c[cpu].llc_shared_map);
490
472 if (current_cpu_data.x86_max_cores == 1) { 491 if (current_cpu_data.x86_max_cores == 1) {
473 cpu_core_map[cpu] = cpu_sibling_map[cpu]; 492 cpu_core_map[cpu] = cpu_sibling_map[cpu];
474 c[cpu].booted_cores = 1; 493 c[cpu].booted_cores = 1;
@@ -476,6 +495,11 @@ static inline void set_cpu_sibling_map(int cpu)
476 } 495 }
477 496
478 for_each_cpu_mask(i, cpu_sibling_setup_map) { 497 for_each_cpu_mask(i, cpu_sibling_setup_map) {
498 if (cpu_llc_id[cpu] != BAD_APICID &&
499 cpu_llc_id[cpu] == cpu_llc_id[i]) {
500 cpu_set(i, c[cpu].llc_shared_map);
501 cpu_set(cpu, c[i].llc_shared_map);
502 }
479 if (phys_proc_id[cpu] == phys_proc_id[i]) { 503 if (phys_proc_id[cpu] == phys_proc_id[i]) {
480 cpu_set(i, cpu_core_map[cpu]); 504 cpu_set(i, cpu_core_map[cpu]);
481 cpu_set(cpu, cpu_core_map[i]); 505 cpu_set(cpu, cpu_core_map[i]);
diff --git a/arch/x86_64/kernel/time.c b/arch/x86_64/kernel/time.c
index 3080f84bf7b7..ef8bc46dc140 100644
--- a/arch/x86_64/kernel/time.c
+++ b/arch/x86_64/kernel/time.c
@@ -88,7 +88,8 @@ static inline unsigned int do_gettimeoffset_tsc(void)
88 unsigned long t; 88 unsigned long t;
89 unsigned long x; 89 unsigned long x;
90 t = get_cycles_sync(); 90 t = get_cycles_sync();
91 if (t < vxtime.last_tsc) t = vxtime.last_tsc; /* hack */ 91 if (t < vxtime.last_tsc)
92 t = vxtime.last_tsc; /* hack */
92 x = ((t - vxtime.last_tsc) * vxtime.tsc_quot) >> 32; 93 x = ((t - vxtime.last_tsc) * vxtime.tsc_quot) >> 32;
93 return x; 94 return x;
94} 95}
@@ -178,8 +179,9 @@ unsigned long profile_pc(struct pt_regs *regs)
178{ 179{
179 unsigned long pc = instruction_pointer(regs); 180 unsigned long pc = instruction_pointer(regs);
180 181
181 /* Assume the lock function has either no stack frame or only a single word. 182 /* Assume the lock function has either no stack frame or only a single
182 This checks if the address on the stack looks like a kernel text address. 183 word. This checks if the address on the stack looks like a kernel
184 text address.
183 There is a small window for false hits, but in that case the tick 185 There is a small window for false hits, but in that case the tick
184 is just accounted to the spinlock function. 186 is just accounted to the spinlock function.
185 Better would be to write these functions in assembler again 187 Better would be to write these functions in assembler again
@@ -242,17 +244,10 @@ static void set_rtc_mmss(unsigned long nowtime)
242 real_minutes += 30; /* correct for half hour time zone */ 244 real_minutes += 30; /* correct for half hour time zone */
243 real_minutes %= 60; 245 real_minutes %= 60;
244 246
245#if 0
246 /* AMD 8111 is a really bad time keeper and hits this regularly.
247 It probably was an attempt to avoid screwing up DST, but ignore
248 that for now. */
249 if (abs(real_minutes - cmos_minutes) >= 30) { 247 if (abs(real_minutes - cmos_minutes) >= 30) {
250 printk(KERN_WARNING "time.c: can't update CMOS clock " 248 printk(KERN_WARNING "time.c: can't update CMOS clock "
251 "from %d to %d\n", cmos_minutes, real_minutes); 249 "from %d to %d\n", cmos_minutes, real_minutes);
252 } else 250 } else {
253#endif
254
255 {
256 BIN_TO_BCD(real_seconds); 251 BIN_TO_BCD(real_seconds);
257 BIN_TO_BCD(real_minutes); 252 BIN_TO_BCD(real_minutes);
258 CMOS_WRITE(real_seconds, RTC_SECONDS); 253 CMOS_WRITE(real_seconds, RTC_SECONDS);
@@ -293,8 +288,7 @@ unsigned long long monotonic_clock(void)
293 this_offset = hpet_readl(HPET_COUNTER); 288 this_offset = hpet_readl(HPET_COUNTER);
294 } while (read_seqretry(&xtime_lock, seq)); 289 } while (read_seqretry(&xtime_lock, seq));
295 offset = (this_offset - last_offset); 290 offset = (this_offset - last_offset);
296 offset *=(NSEC_PER_SEC/HZ)/hpet_tick; 291 offset *= (NSEC_PER_SEC/HZ) / hpet_tick;
297 return base + offset;
298 } else { 292 } else {
299 do { 293 do {
300 seq = read_seqbegin(&xtime_lock); 294 seq = read_seqbegin(&xtime_lock);
@@ -303,50 +297,46 @@ unsigned long long monotonic_clock(void)
303 base = monotonic_base; 297 base = monotonic_base;
304 } while (read_seqretry(&xtime_lock, seq)); 298 } while (read_seqretry(&xtime_lock, seq));
305 this_offset = get_cycles_sync(); 299 this_offset = get_cycles_sync();
306 offset = (this_offset - last_offset)*1000/cpu_khz; 300 offset = (this_offset - last_offset)*1000 / cpu_khz;
307 return base + offset;
308 } 301 }
302 return base + offset;
309} 303}
310EXPORT_SYMBOL(monotonic_clock); 304EXPORT_SYMBOL(monotonic_clock);
311 305
312static noinline void handle_lost_ticks(int lost, struct pt_regs *regs) 306static noinline void handle_lost_ticks(int lost, struct pt_regs *regs)
313{ 307{
314 static long lost_count; 308 static long lost_count;
315 static int warned; 309 static int warned;
316 310 if (report_lost_ticks) {
317 if (report_lost_ticks) { 311 printk(KERN_WARNING "time.c: Lost %d timer tick(s)! ", lost);
318 printk(KERN_WARNING "time.c: Lost %d timer " 312 print_symbol("rip %s)\n", regs->rip);
319 "tick(s)! ", lost); 313 }
320 print_symbol("rip %s)\n", regs->rip); 314
321 } 315 if (lost_count == 1000 && !warned) {
322 316 printk(KERN_WARNING "warning: many lost ticks.\n"
323 if (lost_count == 1000 && !warned) { 317 KERN_WARNING "Your time source seems to be instable or "
324 printk(KERN_WARNING
325 "warning: many lost ticks.\n"
326 KERN_WARNING "Your time source seems to be instable or "
327 "some driver is hogging interupts\n"); 318 "some driver is hogging interupts\n");
328 print_symbol("rip %s\n", regs->rip); 319 print_symbol("rip %s\n", regs->rip);
329 if (vxtime.mode == VXTIME_TSC && vxtime.hpet_address) { 320 if (vxtime.mode == VXTIME_TSC && vxtime.hpet_address) {
330 printk(KERN_WARNING "Falling back to HPET\n"); 321 printk(KERN_WARNING "Falling back to HPET\n");
331 if (hpet_use_timer) 322 if (hpet_use_timer)
332 vxtime.last = hpet_readl(HPET_T0_CMP) - hpet_tick; 323 vxtime.last = hpet_readl(HPET_T0_CMP) -
333 else 324 hpet_tick;
334 vxtime.last = hpet_readl(HPET_COUNTER); 325 else
335 vxtime.mode = VXTIME_HPET; 326 vxtime.last = hpet_readl(HPET_COUNTER);
336 do_gettimeoffset = do_gettimeoffset_hpet; 327 vxtime.mode = VXTIME_HPET;
337 } 328 do_gettimeoffset = do_gettimeoffset_hpet;
338 /* else should fall back to PIT, but code missing. */ 329 }
339 warned = 1; 330 /* else should fall back to PIT, but code missing. */
340 } else 331 warned = 1;
341 lost_count++; 332 } else
333 lost_count++;
342 334
343#ifdef CONFIG_CPU_FREQ 335#ifdef CONFIG_CPU_FREQ
344 /* In some cases the CPU can change frequency without us noticing 336 /* In some cases the CPU can change frequency without us noticing
345 (like going into thermal throttle) 337 Give cpufreq a change to catch up. */
346 Give cpufreq a change to catch up. */ 338 if ((lost_count+1) % 25 == 0)
347 if ((lost_count+1) % 25 == 0) { 339 cpufreq_delayed_get();
348 cpufreq_delayed_get();
349 }
350#endif 340#endif
351} 341}
352 342
@@ -354,7 +344,7 @@ void main_timer_handler(struct pt_regs *regs)
354{ 344{
355 static unsigned long rtc_update = 0; 345 static unsigned long rtc_update = 0;
356 unsigned long tsc; 346 unsigned long tsc;
357 int delay, offset = 0, lost = 0; 347 int delay = 0, offset = 0, lost = 0;
358 348
359/* 349/*
360 * Here we are in the timer irq handler. We have irqs locally disabled (so we 350 * Here we are in the timer irq handler. We have irqs locally disabled (so we
@@ -375,7 +365,7 @@ void main_timer_handler(struct pt_regs *regs)
375 */ 365 */
376 offset = hpet_readl(HPET_T0_CMP) - hpet_tick; 366 offset = hpet_readl(HPET_T0_CMP) - hpet_tick;
377 delay = hpet_readl(HPET_COUNTER) - offset; 367 delay = hpet_readl(HPET_COUNTER) - offset;
378 } else { 368 } else if (!pmtmr_ioport) {
379 spin_lock(&i8253_lock); 369 spin_lock(&i8253_lock);
380 outb_p(0x00, 0x43); 370 outb_p(0x00, 0x43);
381 delay = inb_p(0x40); 371 delay = inb_p(0x40);
@@ -477,7 +467,7 @@ static irqreturn_t timer_interrupt(int irq, void *dev_id, struct pt_regs *regs)
477 return IRQ_HANDLED; 467 return IRQ_HANDLED;
478} 468}
479 469
480static unsigned int cyc2ns_scale; 470static unsigned int cyc2ns_scale __read_mostly;
481#define CYC2NS_SCALE_FACTOR 10 /* 2^10, carefully chosen */ 471#define CYC2NS_SCALE_FACTOR 10 /* 2^10, carefully chosen */
482 472
483static inline void set_cyc2ns_scale(unsigned long cpu_khz) 473static inline void set_cyc2ns_scale(unsigned long cpu_khz)
@@ -514,43 +504,32 @@ unsigned long long sched_clock(void)
514 504
515static unsigned long get_cmos_time(void) 505static unsigned long get_cmos_time(void)
516{ 506{
517 unsigned int timeout = 1000000, year, mon, day, hour, min, sec; 507 unsigned int year, mon, day, hour, min, sec;
518 unsigned char uip = 0, this = 0;
519 unsigned long flags; 508 unsigned long flags;
520 509 unsigned extyear = 0;
521/*
522 * The Linux interpretation of the CMOS clock register contents: When the
523 * Update-In-Progress (UIP) flag goes from 1 to 0, the RTC registers show the
524 * second which has precisely just started. Waiting for this can take up to 1
525 * second, we timeout approximately after 2.4 seconds on a machine with
526 * standard 8.3 MHz ISA bus.
527 */
528 510
529 spin_lock_irqsave(&rtc_lock, flags); 511 spin_lock_irqsave(&rtc_lock, flags);
530 512
531 while (timeout && (!uip || this)) { 513 do {
532 uip |= this; 514 sec = CMOS_READ(RTC_SECONDS);
533 this = CMOS_READ(RTC_FREQ_SELECT) & RTC_UIP; 515 min = CMOS_READ(RTC_MINUTES);
534 timeout--; 516 hour = CMOS_READ(RTC_HOURS);
535 } 517 day = CMOS_READ(RTC_DAY_OF_MONTH);
536 518 mon = CMOS_READ(RTC_MONTH);
537 /* 519 year = CMOS_READ(RTC_YEAR);
538 * Here we are safe to assume the registers won't change for a whole 520#ifdef CONFIG_ACPI
539 * second, so we just go ahead and read them. 521 if (acpi_fadt.revision >= FADT2_REVISION_ID &&
540 */ 522 acpi_fadt.century)
541 sec = CMOS_READ(RTC_SECONDS); 523 extyear = CMOS_READ(acpi_fadt.century);
542 min = CMOS_READ(RTC_MINUTES); 524#endif
543 hour = CMOS_READ(RTC_HOURS); 525 } while (sec != CMOS_READ(RTC_SECONDS));
544 day = CMOS_READ(RTC_DAY_OF_MONTH);
545 mon = CMOS_READ(RTC_MONTH);
546 year = CMOS_READ(RTC_YEAR);
547 526
548 spin_unlock_irqrestore(&rtc_lock, flags); 527 spin_unlock_irqrestore(&rtc_lock, flags);
549 528
550 /* 529 /*
551 * We know that x86-64 always uses BCD format, no need to check the 530 * We know that x86-64 always uses BCD format, no need to check the
552 * config register. 531 * config register.
553 */ 532 */
554 533
555 BCD_TO_BIN(sec); 534 BCD_TO_BIN(sec);
556 BCD_TO_BIN(min); 535 BCD_TO_BIN(min);
@@ -559,11 +538,17 @@ static unsigned long get_cmos_time(void)
559 BCD_TO_BIN(mon); 538 BCD_TO_BIN(mon);
560 BCD_TO_BIN(year); 539 BCD_TO_BIN(year);
561 540
562 /* 541 if (extyear) {
563 * x86-64 systems only exists since 2002. 542 BCD_TO_BIN(extyear);
564 * This will work up to Dec 31, 2100 543 year += extyear;
565 */ 544 printk(KERN_INFO "Extended CMOS year: %d\n", extyear);
566 year += 2000; 545 } else {
546 /*
547 * x86-64 systems only exists since 2002.
548 * This will work up to Dec 31, 2100
549 */
550 year += 2000;
551 }
567 552
568 return mktime(year, mon, day, hour, min, sec); 553 return mktime(year, mon, day, hour, min, sec);
569} 554}
@@ -606,7 +591,8 @@ static void cpufreq_delayed_get(void)
606 cpufreq_delayed_issched = 1; 591 cpufreq_delayed_issched = 1;
607 if (!warned) { 592 if (!warned) {
608 warned = 1; 593 warned = 1;
609 printk(KERN_DEBUG "Losing some ticks... checking if CPU frequency changed.\n"); 594 printk(KERN_DEBUG
595 "Losing some ticks... checking if CPU frequency changed.\n");
610 } 596 }
611 schedule_work(&cpufreq_delayed_get_work); 597 schedule_work(&cpufreq_delayed_get_work);
612 } 598 }
@@ -629,9 +615,9 @@ static int time_cpufreq_notifier(struct notifier_block *nb, unsigned long val,
629 lpj = &dummy; 615 lpj = &dummy;
630 if (!(freq->flags & CPUFREQ_CONST_LOOPS)) 616 if (!(freq->flags & CPUFREQ_CONST_LOOPS))
631#ifdef CONFIG_SMP 617#ifdef CONFIG_SMP
632 lpj = &cpu_data[freq->cpu].loops_per_jiffy; 618 lpj = &cpu_data[freq->cpu].loops_per_jiffy;
633#else 619#else
634 lpj = &boot_cpu_data.loops_per_jiffy; 620 lpj = &boot_cpu_data.loops_per_jiffy;
635#endif 621#endif
636 622
637 if (!ref_freq) { 623 if (!ref_freq) {
@@ -768,9 +754,8 @@ static __init int late_hpet_init(void)
768 int i; 754 int i;
769 755
770 hpet = (struct hpet *) fix_to_virt(FIX_HPET_BASE); 756 hpet = (struct hpet *) fix_to_virt(FIX_HPET_BASE);
771 757 timer = &hpet->hpet_timers[2];
772 for (i = 2, timer = &hpet->hpet_timers[2]; i < ntimer; 758 for (i = 2; i < ntimer; timer++, i++)
773 timer++, i++)
774 hd.hd_irq[i] = (timer->hpet_config & 759 hd.hd_irq[i] = (timer->hpet_config &
775 Tn_INT_ROUTE_CNF_MASK) >> 760 Tn_INT_ROUTE_CNF_MASK) >>
776 Tn_INT_ROUTE_CNF_SHIFT; 761 Tn_INT_ROUTE_CNF_SHIFT;
@@ -927,8 +912,7 @@ void __init time_init(void)
927 -xtime.tv_sec, -xtime.tv_nsec); 912 -xtime.tv_sec, -xtime.tv_nsec);
928 913
929 if (!hpet_init()) 914 if (!hpet_init())
930 vxtime_hz = (1000000000000000L + hpet_period / 2) / 915 vxtime_hz = (1000000000000000L + hpet_period / 2) / hpet_period;
931 hpet_period;
932 else 916 else
933 vxtime.hpet_address = 0; 917 vxtime.hpet_address = 0;
934 918
@@ -1322,7 +1306,7 @@ irqreturn_t hpet_rtc_interrupt(int irq, void *dev_id, struct pt_regs *regs)
1322static int __init nohpet_setup(char *s) 1306static int __init nohpet_setup(char *s)
1323{ 1307{
1324 nohpet = 1; 1308 nohpet = 1;
1325 return 0; 1309 return 1;
1326} 1310}
1327 1311
1328__setup("nohpet", nohpet_setup); 1312__setup("nohpet", nohpet_setup);
@@ -1330,7 +1314,7 @@ __setup("nohpet", nohpet_setup);
1330int __init notsc_setup(char *s) 1314int __init notsc_setup(char *s)
1331{ 1315{
1332 notsc = 1; 1316 notsc = 1;
1333 return 0; 1317 return 1;
1334} 1318}
1335 1319
1336__setup("notsc", notsc_setup); 1320__setup("notsc", notsc_setup);
diff --git a/arch/x86_64/kernel/traps.c b/arch/x86_64/kernel/traps.c
index 28d50dc540e8..6bda322d3caf 100644
--- a/arch/x86_64/kernel/traps.c
+++ b/arch/x86_64/kernel/traps.c
@@ -47,8 +47,6 @@
47#include <asm/proto.h> 47#include <asm/proto.h>
48#include <asm/nmi.h> 48#include <asm/nmi.h>
49 49
50extern struct gate_struct idt_table[256];
51
52asmlinkage void divide_error(void); 50asmlinkage void divide_error(void);
53asmlinkage void debug(void); 51asmlinkage void debug(void);
54asmlinkage void nmi(void); 52asmlinkage void nmi(void);
@@ -71,18 +69,20 @@ asmlinkage void alignment_check(void);
71asmlinkage void machine_check(void); 69asmlinkage void machine_check(void);
72asmlinkage void spurious_interrupt_bug(void); 70asmlinkage void spurious_interrupt_bug(void);
73 71
74struct notifier_block *die_chain; 72ATOMIC_NOTIFIER_HEAD(die_chain);
75static DEFINE_SPINLOCK(die_notifier_lock);
76 73
77int register_die_notifier(struct notifier_block *nb) 74int register_die_notifier(struct notifier_block *nb)
78{ 75{
79 int err = 0; 76 vmalloc_sync_all();
80 unsigned long flags; 77 return atomic_notifier_chain_register(&die_chain, nb);
81 spin_lock_irqsave(&die_notifier_lock, flags);
82 err = notifier_chain_register(&die_chain, nb);
83 spin_unlock_irqrestore(&die_notifier_lock, flags);
84 return err;
85} 78}
79EXPORT_SYMBOL(register_die_notifier);
80
81int unregister_die_notifier(struct notifier_block *nb)
82{
83 return atomic_notifier_chain_unregister(&die_chain, nb);
84}
85EXPORT_SYMBOL(unregister_die_notifier);
86 86
87static inline void conditional_sti(struct pt_regs *regs) 87static inline void conditional_sti(struct pt_regs *regs)
88{ 88{
@@ -122,7 +122,7 @@ int printk_address(unsigned long address)
122 if (!modname) 122 if (!modname)
123 modname = delim = ""; 123 modname = delim = "";
124 return printk("<%016lx>{%s%s%s%s%+ld}", 124 return printk("<%016lx>{%s%s%s%s%+ld}",
125 address,delim,modname,delim,symname,offset); 125 address, delim, modname, delim, symname, offset);
126} 126}
127#else 127#else
128int printk_address(unsigned long address) 128int printk_address(unsigned long address)
@@ -334,13 +334,12 @@ void show_registers(struct pt_regs *regs)
334 show_stack(NULL, (unsigned long*)rsp); 334 show_stack(NULL, (unsigned long*)rsp);
335 335
336 printk("\nCode: "); 336 printk("\nCode: ");
337 if(regs->rip < PAGE_OFFSET) 337 if (regs->rip < PAGE_OFFSET)
338 goto bad; 338 goto bad;
339 339
340 for(i=0;i<20;i++) 340 for (i=0; i<20; i++) {
341 {
342 unsigned char c; 341 unsigned char c;
343 if(__get_user(c, &((unsigned char*)regs->rip)[i])) { 342 if (__get_user(c, &((unsigned char*)regs->rip)[i])) {
344bad: 343bad:
345 printk(" Bad RIP value."); 344 printk(" Bad RIP value.");
346 break; 345 break;
@@ -479,7 +478,7 @@ static void __kprobes do_trap(int trapnr, int signr, char *str,
479 printk(KERN_INFO 478 printk(KERN_INFO
480 "%s[%d] trap %s rip:%lx rsp:%lx error:%lx\n", 479 "%s[%d] trap %s rip:%lx rsp:%lx error:%lx\n",
481 tsk->comm, tsk->pid, str, 480 tsk->comm, tsk->pid, str,
482 regs->rip,regs->rsp,error_code); 481 regs->rip, regs->rsp, error_code);
483 482
484 if (info) 483 if (info)
485 force_sig_info(signr, info, tsk); 484 force_sig_info(signr, info, tsk);
@@ -493,9 +492,9 @@ static void __kprobes do_trap(int trapnr, int signr, char *str,
493 { 492 {
494 const struct exception_table_entry *fixup; 493 const struct exception_table_entry *fixup;
495 fixup = search_exception_tables(regs->rip); 494 fixup = search_exception_tables(regs->rip);
496 if (fixup) { 495 if (fixup)
497 regs->rip = fixup->fixup; 496 regs->rip = fixup->fixup;
498 } else 497 else
499 die(str, regs, error_code); 498 die(str, regs, error_code);
500 return; 499 return;
501 } 500 }
@@ -568,7 +567,7 @@ asmlinkage void __kprobes do_general_protection(struct pt_regs * regs,
568 printk(KERN_INFO 567 printk(KERN_INFO
569 "%s[%d] general protection rip:%lx rsp:%lx error:%lx\n", 568 "%s[%d] general protection rip:%lx rsp:%lx error:%lx\n",
570 tsk->comm, tsk->pid, 569 tsk->comm, tsk->pid,
571 regs->rip,regs->rsp,error_code); 570 regs->rip, regs->rsp, error_code);
572 571
573 force_sig(SIGSEGV, tsk); 572 force_sig(SIGSEGV, tsk);
574 return; 573 return;
@@ -974,14 +973,14 @@ void __init trap_init(void)
974static int __init oops_dummy(char *s) 973static int __init oops_dummy(char *s)
975{ 974{
976 panic_on_oops = 1; 975 panic_on_oops = 1;
977 return -1; 976 return 1;
978} 977}
979__setup("oops=", oops_dummy); 978__setup("oops=", oops_dummy);
980 979
981static int __init kstack_setup(char *s) 980static int __init kstack_setup(char *s)
982{ 981{
983 kstack_depth_to_print = simple_strtoul(s,NULL,0); 982 kstack_depth_to_print = simple_strtoul(s,NULL,0);
984 return 0; 983 return 1;
985} 984}
986__setup("kstack=", kstack_setup); 985__setup("kstack=", kstack_setup);
987 986
diff --git a/arch/x86_64/kernel/vmlinux.lds.S b/arch/x86_64/kernel/vmlinux.lds.S
index 74db0062d4a2..39ff0708f803 100644
--- a/arch/x86_64/kernel/vmlinux.lds.S
+++ b/arch/x86_64/kernel/vmlinux.lds.S
@@ -20,6 +20,12 @@ SECTIONS
20 phys_startup_64 = startup_64 - LOAD_OFFSET; 20 phys_startup_64 = startup_64 - LOAD_OFFSET;
21 _text = .; /* Text and read-only data */ 21 _text = .; /* Text and read-only data */
22 .text : AT(ADDR(.text) - LOAD_OFFSET) { 22 .text : AT(ADDR(.text) - LOAD_OFFSET) {
23 /* First the code that has to be first for bootstrapping */
24 *(.bootstrap.text)
25 /* Then all the functions that are "hot" in profiles, to group them
26 onto the same hugetlb entry */
27 #include "functionlist"
28 /* Then the rest */
23 *(.text) 29 *(.text)
24 SCHED_TEXT 30 SCHED_TEXT
25 LOCK_TEXT 31 LOCK_TEXT
diff --git a/arch/x86_64/kernel/x8664_ksyms.c b/arch/x86_64/kernel/x8664_ksyms.c
index 3496abc8d372..d78f46056bda 100644
--- a/arch/x86_64/kernel/x8664_ksyms.c
+++ b/arch/x86_64/kernel/x8664_ksyms.c
@@ -102,8 +102,6 @@ EXPORT_SYMBOL(cpu_callout_map);
102EXPORT_SYMBOL(screen_info); 102EXPORT_SYMBOL(screen_info);
103#endif 103#endif
104 104
105EXPORT_SYMBOL(get_wchan);
106
107EXPORT_SYMBOL(rtc_lock); 105EXPORT_SYMBOL(rtc_lock);
108 106
109EXPORT_SYMBOL_GPL(set_nmi_callback); 107EXPORT_SYMBOL_GPL(set_nmi_callback);
@@ -124,6 +122,7 @@ extern void * __memcpy(void *,const void *,__kernel_size_t);
124 122
125EXPORT_SYMBOL(memset); 123EXPORT_SYMBOL(memset);
126EXPORT_SYMBOL(strlen); 124EXPORT_SYMBOL(strlen);
125EXPORT_SYMBOL(strpbrk);
127EXPORT_SYMBOL(memmove); 126EXPORT_SYMBOL(memmove);
128EXPORT_SYMBOL(memcpy); 127EXPORT_SYMBOL(memcpy);
129EXPORT_SYMBOL(__memcpy); 128EXPORT_SYMBOL(__memcpy);
@@ -143,16 +142,12 @@ EXPORT_SYMBOL(rwsem_down_write_failed_thunk);
143EXPORT_SYMBOL(empty_zero_page); 142EXPORT_SYMBOL(empty_zero_page);
144 143
145EXPORT_SYMBOL(die_chain); 144EXPORT_SYMBOL(die_chain);
146EXPORT_SYMBOL(register_die_notifier);
147 145
148#ifdef CONFIG_SMP 146#ifdef CONFIG_SMP
149EXPORT_SYMBOL(cpu_sibling_map); 147EXPORT_SYMBOL(cpu_sibling_map);
150EXPORT_SYMBOL(smp_num_siblings); 148EXPORT_SYMBOL(smp_num_siblings);
151#endif 149#endif
152 150
153extern void do_softirq_thunk(void);
154EXPORT_SYMBOL(do_softirq_thunk);
155
156#ifdef CONFIG_BUG 151#ifdef CONFIG_BUG
157EXPORT_SYMBOL(out_of_line_bug); 152EXPORT_SYMBOL(out_of_line_bug);
158#endif 153#endif
diff --git a/arch/x86_64/lib/thunk.S b/arch/x86_64/lib/thunk.S
index acc1e2ca7ed7..e49af0032e94 100644
--- a/arch/x86_64/lib/thunk.S
+++ b/arch/x86_64/lib/thunk.S
@@ -42,7 +42,6 @@
42 thunk rwsem_wake_thunk,rwsem_wake 42 thunk rwsem_wake_thunk,rwsem_wake
43 thunk rwsem_downgrade_thunk,rwsem_downgrade_wake 43 thunk rwsem_downgrade_thunk,rwsem_downgrade_wake
44#endif 44#endif
45 thunk do_softirq_thunk,do_softirq
46 45
47 thunk __down_failed,__down 46 thunk __down_failed,__down
48 thunk_retrax __down_failed_interruptible,__down_interruptible 47 thunk_retrax __down_failed_interruptible,__down_interruptible
diff --git a/arch/x86_64/mm/fault.c b/arch/x86_64/mm/fault.c
index 2e7c3c8ffe03..55250593d8c9 100644
--- a/arch/x86_64/mm/fault.c
+++ b/arch/x86_64/mm/fault.c
@@ -264,6 +264,8 @@ static int vmalloc_fault(unsigned long address)
264 return -1; 264 return -1;
265 if (pgd_none(*pgd)) 265 if (pgd_none(*pgd))
266 set_pgd(pgd, *pgd_ref); 266 set_pgd(pgd, *pgd_ref);
267 else
268 BUG_ON(pgd_page(*pgd) != pgd_page(*pgd_ref));
267 269
268 /* Below here mismatches are bugs because these lower tables 270 /* Below here mismatches are bugs because these lower tables
269 are shared */ 271 are shared */
@@ -312,21 +314,13 @@ asmlinkage void __kprobes do_page_fault(struct pt_regs *regs,
312 unsigned long flags; 314 unsigned long flags;
313 siginfo_t info; 315 siginfo_t info;
314 316
317 tsk = current;
318 mm = tsk->mm;
319 prefetchw(&mm->mmap_sem);
320
315 /* get the address */ 321 /* get the address */
316 __asm__("movq %%cr2,%0":"=r" (address)); 322 __asm__("movq %%cr2,%0":"=r" (address));
317 if (notify_die(DIE_PAGE_FAULT, "page fault", regs, error_code, 14,
318 SIGSEGV) == NOTIFY_STOP)
319 return;
320
321 if (likely(regs->eflags & X86_EFLAGS_IF))
322 local_irq_enable();
323 323
324 if (unlikely(page_fault_trace))
325 printk("pagefault rip:%lx rsp:%lx cs:%lu ss:%lu address %lx error %lx\n",
326 regs->rip,regs->rsp,regs->cs,regs->ss,address,error_code);
327
328 tsk = current;
329 mm = tsk->mm;
330 info.si_code = SEGV_MAPERR; 324 info.si_code = SEGV_MAPERR;
331 325
332 326
@@ -351,10 +345,12 @@ asmlinkage void __kprobes do_page_fault(struct pt_regs *regs,
351 */ 345 */
352 if (!(error_code & (PF_RSVD|PF_USER|PF_PROT)) && 346 if (!(error_code & (PF_RSVD|PF_USER|PF_PROT)) &&
353 ((address >= VMALLOC_START && address < VMALLOC_END))) { 347 ((address >= VMALLOC_START && address < VMALLOC_END))) {
354 if (vmalloc_fault(address) < 0) 348 if (vmalloc_fault(address) >= 0)
355 goto bad_area_nosemaphore; 349 return;
356 return;
357 } 350 }
351 if (notify_die(DIE_PAGE_FAULT, "page fault", regs, error_code, 14,
352 SIGSEGV) == NOTIFY_STOP)
353 return;
358 /* 354 /*
359 * Don't take the mm semaphore here. If we fixup a prefetch 355 * Don't take the mm semaphore here. If we fixup a prefetch
360 * fault we could otherwise deadlock. 356 * fault we could otherwise deadlock.
@@ -362,6 +358,17 @@ asmlinkage void __kprobes do_page_fault(struct pt_regs *regs,
362 goto bad_area_nosemaphore; 358 goto bad_area_nosemaphore;
363 } 359 }
364 360
361 if (notify_die(DIE_PAGE_FAULT, "page fault", regs, error_code, 14,
362 SIGSEGV) == NOTIFY_STOP)
363 return;
364
365 if (likely(regs->eflags & X86_EFLAGS_IF))
366 local_irq_enable();
367
368 if (unlikely(page_fault_trace))
369 printk("pagefault rip:%lx rsp:%lx cs:%lu ss:%lu address %lx error %lx\n",
370 regs->rip,regs->rsp,regs->cs,regs->ss,address,error_code);
371
365 if (unlikely(error_code & PF_RSVD)) 372 if (unlikely(error_code & PF_RSVD))
366 pgtable_bad(address, regs, error_code); 373 pgtable_bad(address, regs, error_code);
367 374
@@ -571,9 +578,51 @@ do_sigbus:
571 return; 578 return;
572} 579}
573 580
581DEFINE_SPINLOCK(pgd_lock);
582struct page *pgd_list;
583
584void vmalloc_sync_all(void)
585{
586 /* Note that races in the updates of insync and start aren't
587 problematic:
588 insync can only get set bits added, and updates to start are only
589 improving performance (without affecting correctness if undone). */
590 static DECLARE_BITMAP(insync, PTRS_PER_PGD);
591 static unsigned long start = VMALLOC_START & PGDIR_MASK;
592 unsigned long address;
593
594 for (address = start; address <= VMALLOC_END; address += PGDIR_SIZE) {
595 if (!test_bit(pgd_index(address), insync)) {
596 const pgd_t *pgd_ref = pgd_offset_k(address);
597 struct page *page;
598
599 if (pgd_none(*pgd_ref))
600 continue;
601 spin_lock(&pgd_lock);
602 for (page = pgd_list; page;
603 page = (struct page *)page->index) {
604 pgd_t *pgd;
605 pgd = (pgd_t *)page_address(page) + pgd_index(address);
606 if (pgd_none(*pgd))
607 set_pgd(pgd, *pgd_ref);
608 else
609 BUG_ON(pgd_page(*pgd) != pgd_page(*pgd_ref));
610 }
611 spin_unlock(&pgd_lock);
612 set_bit(pgd_index(address), insync);
613 }
614 if (address == start)
615 start = address + PGDIR_SIZE;
616 }
617 /* Check that there is no need to do the same for the modules area. */
618 BUILD_BUG_ON(!(MODULES_VADDR > __START_KERNEL));
619 BUILD_BUG_ON(!(((MODULES_END - 1) & PGDIR_MASK) ==
620 (__START_KERNEL & PGDIR_MASK)));
621}
622
574static int __init enable_pagefaulttrace(char *str) 623static int __init enable_pagefaulttrace(char *str)
575{ 624{
576 page_fault_trace = 1; 625 page_fault_trace = 1;
577 return 0; 626 return 1;
578} 627}
579__setup("pagefaulttrace", enable_pagefaulttrace); 628__setup("pagefaulttrace", enable_pagefaulttrace);
diff --git a/arch/x86_64/mm/init.c b/arch/x86_64/mm/init.c
index 7af1742aa958..e5f7f1c34462 100644
--- a/arch/x86_64/mm/init.c
+++ b/arch/x86_64/mm/init.c
@@ -72,7 +72,7 @@ void show_mem(void)
72 show_free_areas(); 72 show_free_areas();
73 printk(KERN_INFO "Free swap: %6ldkB\n", nr_swap_pages<<(PAGE_SHIFT-10)); 73 printk(KERN_INFO "Free swap: %6ldkB\n", nr_swap_pages<<(PAGE_SHIFT-10));
74 74
75 for_each_pgdat(pgdat) { 75 for_each_online_pgdat(pgdat) {
76 for (i = 0; i < pgdat->node_spanned_pages; ++i) { 76 for (i = 0; i < pgdat->node_spanned_pages; ++i) {
77 page = pfn_to_page(pgdat->node_start_pfn + i); 77 page = pfn_to_page(pgdat->node_start_pfn + i);
78 total++; 78 total++;
@@ -94,7 +94,7 @@ void show_mem(void)
94 94
95int after_bootmem; 95int after_bootmem;
96 96
97static void *spp_getpage(void) 97static __init void *spp_getpage(void)
98{ 98{
99 void *ptr; 99 void *ptr;
100 if (after_bootmem) 100 if (after_bootmem)
@@ -108,7 +108,7 @@ static void *spp_getpage(void)
108 return ptr; 108 return ptr;
109} 109}
110 110
111static void set_pte_phys(unsigned long vaddr, 111static __init void set_pte_phys(unsigned long vaddr,
112 unsigned long phys, pgprot_t prot) 112 unsigned long phys, pgprot_t prot)
113{ 113{
114 pgd_t *pgd; 114 pgd_t *pgd;
@@ -157,7 +157,8 @@ static void set_pte_phys(unsigned long vaddr,
157} 157}
158 158
159/* NOTE: this is meant to be run only at boot */ 159/* NOTE: this is meant to be run only at boot */
160void __set_fixmap (enum fixed_addresses idx, unsigned long phys, pgprot_t prot) 160void __init
161__set_fixmap (enum fixed_addresses idx, unsigned long phys, pgprot_t prot)
161{ 162{
162 unsigned long address = __fix_to_virt(idx); 163 unsigned long address = __fix_to_virt(idx);
163 164
@@ -225,6 +226,33 @@ static __meminit void unmap_low_page(int i)
225 ti->allocated = 0; 226 ti->allocated = 0;
226} 227}
227 228
229/* Must run before zap_low_mappings */
230__init void *early_ioremap(unsigned long addr, unsigned long size)
231{
232 unsigned long map = round_down(addr, LARGE_PAGE_SIZE);
233
234 /* actually usually some more */
235 if (size >= LARGE_PAGE_SIZE) {
236 printk("SMBIOS area too long %lu\n", size);
237 return NULL;
238 }
239 set_pmd(temp_mappings[0].pmd, __pmd(map | _KERNPG_TABLE | _PAGE_PSE));
240 map += LARGE_PAGE_SIZE;
241 set_pmd(temp_mappings[1].pmd, __pmd(map | _KERNPG_TABLE | _PAGE_PSE));
242 __flush_tlb();
243 return temp_mappings[0].address + (addr & (LARGE_PAGE_SIZE-1));
244}
245
246/* To avoid virtual aliases later */
247__init void early_iounmap(void *addr, unsigned long size)
248{
249 if ((void *)round_down((unsigned long)addr, LARGE_PAGE_SIZE) != temp_mappings[0].address)
250 printk("early_iounmap: bad address %p\n", addr);
251 set_pmd(temp_mappings[0].pmd, __pmd(0));
252 set_pmd(temp_mappings[1].pmd, __pmd(0));
253 __flush_tlb();
254}
255
228static void __meminit 256static void __meminit
229phys_pmd_init(pmd_t *pmd, unsigned long address, unsigned long end) 257phys_pmd_init(pmd_t *pmd, unsigned long address, unsigned long end)
230{ 258{
@@ -344,7 +372,7 @@ void __meminit init_memory_mapping(unsigned long start, unsigned long end)
344 pud_t *pud; 372 pud_t *pud;
345 373
346 if (after_bootmem) 374 if (after_bootmem)
347 pud = pud_offset_k(pgd, __PAGE_OFFSET); 375 pud = pud_offset_k(pgd, start & PGDIR_MASK);
348 else 376 else
349 pud = alloc_low_page(&map, &pud_phys); 377 pud = alloc_low_page(&map, &pud_phys);
350 378
@@ -486,7 +514,7 @@ void __init clear_kernel_mapping(unsigned long address, unsigned long size)
486void online_page(struct page *page) 514void online_page(struct page *page)
487{ 515{
488 ClearPageReserved(page); 516 ClearPageReserved(page);
489 set_page_count(page, 1); 517 init_page_count(page);
490 __free_page(page); 518 __free_page(page);
491 totalram_pages++; 519 totalram_pages++;
492 num_physpages++; 520 num_physpages++;
@@ -592,7 +620,7 @@ void free_initmem(void)
592 addr = (unsigned long)(&__init_begin); 620 addr = (unsigned long)(&__init_begin);
593 for (; addr < (unsigned long)(&__init_end); addr += PAGE_SIZE) { 621 for (; addr < (unsigned long)(&__init_end); addr += PAGE_SIZE) {
594 ClearPageReserved(virt_to_page(addr)); 622 ClearPageReserved(virt_to_page(addr));
595 set_page_count(virt_to_page(addr), 1); 623 init_page_count(virt_to_page(addr));
596 memset((void *)(addr & ~(PAGE_SIZE-1)), 0xcc, PAGE_SIZE); 624 memset((void *)(addr & ~(PAGE_SIZE-1)), 0xcc, PAGE_SIZE);
597 free_page(addr); 625 free_page(addr);
598 totalram_pages++; 626 totalram_pages++;
@@ -632,7 +660,7 @@ void free_initrd_mem(unsigned long start, unsigned long end)
632 printk ("Freeing initrd memory: %ldk freed\n", (end - start) >> 10); 660 printk ("Freeing initrd memory: %ldk freed\n", (end - start) >> 10);
633 for (; start < end; start += PAGE_SIZE) { 661 for (; start < end; start += PAGE_SIZE) {
634 ClearPageReserved(virt_to_page(start)); 662 ClearPageReserved(virt_to_page(start));
635 set_page_count(virt_to_page(start), 1); 663 init_page_count(virt_to_page(start));
636 free_page(start); 664 free_page(start);
637 totalram_pages++; 665 totalram_pages++;
638 } 666 }
diff --git a/arch/x86_64/mm/k8topology.c b/arch/x86_64/mm/k8topology.c
index dd60e71fdba6..7c45c2d2b8b2 100644
--- a/arch/x86_64/mm/k8topology.c
+++ b/arch/x86_64/mm/k8topology.c
@@ -43,7 +43,7 @@ static __init int find_northbridge(void)
43int __init k8_scan_nodes(unsigned long start, unsigned long end) 43int __init k8_scan_nodes(unsigned long start, unsigned long end)
44{ 44{
45 unsigned long prevbase; 45 unsigned long prevbase;
46 struct node nodes[8]; 46 struct bootnode nodes[8];
47 int nodeid, i, nb; 47 int nodeid, i, nb;
48 unsigned char nodeids[8]; 48 unsigned char nodeids[8];
49 int found = 0; 49 int found = 0;
diff --git a/arch/x86_64/mm/numa.c b/arch/x86_64/mm/numa.c
index 22e51beee8d3..4be82d6e2b48 100644
--- a/arch/x86_64/mm/numa.c
+++ b/arch/x86_64/mm/numa.c
@@ -25,8 +25,7 @@
25struct pglist_data *node_data[MAX_NUMNODES] __read_mostly; 25struct pglist_data *node_data[MAX_NUMNODES] __read_mostly;
26bootmem_data_t plat_node_bdata[MAX_NUMNODES]; 26bootmem_data_t plat_node_bdata[MAX_NUMNODES];
27 27
28int memnode_shift; 28struct memnode memnode;
29u8 memnodemap[NODEMAPSIZE];
30 29
31unsigned char cpu_to_node[NR_CPUS] __read_mostly = { 30unsigned char cpu_to_node[NR_CPUS] __read_mostly = {
32 [0 ... NR_CPUS-1] = NUMA_NO_NODE 31 [0 ... NR_CPUS-1] = NUMA_NO_NODE
@@ -47,7 +46,7 @@ int numa_off __initdata;
47 * -1 if node overlap or lost ram (shift too big) 46 * -1 if node overlap or lost ram (shift too big)
48 */ 47 */
49static int __init 48static int __init
50populate_memnodemap(const struct node *nodes, int numnodes, int shift) 49populate_memnodemap(const struct bootnode *nodes, int numnodes, int shift)
51{ 50{
52 int i; 51 int i;
53 int res = -1; 52 int res = -1;
@@ -74,7 +73,7 @@ populate_memnodemap(const struct node *nodes, int numnodes, int shift)
74 return res; 73 return res;
75} 74}
76 75
77int __init compute_hash_shift(struct node *nodes, int numnodes) 76int __init compute_hash_shift(struct bootnode *nodes, int numnodes)
78{ 77{
79 int shift = 20; 78 int shift = 20;
80 79
@@ -149,7 +148,7 @@ void __init setup_node_bootmem(int nodeid, unsigned long start, unsigned long en
149/* Initialize final allocator for a zone */ 148/* Initialize final allocator for a zone */
150void __init setup_node_zones(int nodeid) 149void __init setup_node_zones(int nodeid)
151{ 150{
152 unsigned long start_pfn, end_pfn; 151 unsigned long start_pfn, end_pfn, memmapsize, limit;
153 unsigned long zones[MAX_NR_ZONES]; 152 unsigned long zones[MAX_NR_ZONES];
154 unsigned long holes[MAX_NR_ZONES]; 153 unsigned long holes[MAX_NR_ZONES];
155 154
@@ -159,6 +158,16 @@ void __init setup_node_zones(int nodeid)
159 Dprintk(KERN_INFO "Setting up node %d %lx-%lx\n", 158 Dprintk(KERN_INFO "Setting up node %d %lx-%lx\n",
160 nodeid, start_pfn, end_pfn); 159 nodeid, start_pfn, end_pfn);
161 160
161 /* Try to allocate mem_map at end to not fill up precious <4GB
162 memory. */
163 memmapsize = sizeof(struct page) * (end_pfn-start_pfn);
164 limit = end_pfn << PAGE_SHIFT;
165 NODE_DATA(nodeid)->node_mem_map =
166 __alloc_bootmem_core(NODE_DATA(nodeid)->bdata,
167 memmapsize, SMP_CACHE_BYTES,
168 round_down(limit - memmapsize, PAGE_SIZE),
169 limit);
170
162 size_zones(zones, holes, start_pfn, end_pfn); 171 size_zones(zones, holes, start_pfn, end_pfn);
163 free_area_init_node(nodeid, NODE_DATA(nodeid), zones, 172 free_area_init_node(nodeid, NODE_DATA(nodeid), zones,
164 start_pfn, holes); 173 start_pfn, holes);
@@ -191,7 +200,7 @@ int numa_fake __initdata = 0;
191static int numa_emulation(unsigned long start_pfn, unsigned long end_pfn) 200static int numa_emulation(unsigned long start_pfn, unsigned long end_pfn)
192{ 201{
193 int i; 202 int i;
194 struct node nodes[MAX_NUMNODES]; 203 struct bootnode nodes[MAX_NUMNODES];
195 unsigned long sz = ((end_pfn - start_pfn)<<PAGE_SHIFT) / numa_fake; 204 unsigned long sz = ((end_pfn - start_pfn)<<PAGE_SHIFT) / numa_fake;
196 205
197 /* Kludge needed for the hash function */ 206 /* Kludge needed for the hash function */
@@ -357,8 +366,7 @@ void __init init_cpu_to_node(void)
357 366
358EXPORT_SYMBOL(cpu_to_node); 367EXPORT_SYMBOL(cpu_to_node);
359EXPORT_SYMBOL(node_to_cpumask); 368EXPORT_SYMBOL(node_to_cpumask);
360EXPORT_SYMBOL(memnode_shift); 369EXPORT_SYMBOL(memnode);
361EXPORT_SYMBOL(memnodemap);
362EXPORT_SYMBOL(node_data); 370EXPORT_SYMBOL(node_data);
363 371
364#ifdef CONFIG_DISCONTIGMEM 372#ifdef CONFIG_DISCONTIGMEM
@@ -369,21 +377,6 @@ EXPORT_SYMBOL(node_data);
369 * Should do that. 377 * Should do that.
370 */ 378 */
371 379
372/* Requires pfn_valid(pfn) to be true */
373struct page *pfn_to_page(unsigned long pfn)
374{
375 int nid = phys_to_nid(((unsigned long)(pfn)) << PAGE_SHIFT);
376 return (pfn - node_start_pfn(nid)) + NODE_DATA(nid)->node_mem_map;
377}
378EXPORT_SYMBOL(pfn_to_page);
379
380unsigned long page_to_pfn(struct page *page)
381{
382 return (long)(((page) - page_zone(page)->zone_mem_map) +
383 page_zone(page)->zone_start_pfn);
384}
385EXPORT_SYMBOL(page_to_pfn);
386
387int pfn_valid(unsigned long pfn) 380int pfn_valid(unsigned long pfn)
388{ 381{
389 unsigned nid; 382 unsigned nid;
diff --git a/arch/x86_64/mm/pageattr.c b/arch/x86_64/mm/pageattr.c
index 35f1f1aab063..531ad21447b1 100644
--- a/arch/x86_64/mm/pageattr.c
+++ b/arch/x86_64/mm/pageattr.c
@@ -45,6 +45,13 @@ static struct page *split_large_page(unsigned long address, pgprot_t prot,
45 pte_t *pbase; 45 pte_t *pbase;
46 if (!base) 46 if (!base)
47 return NULL; 47 return NULL;
48 /*
49 * page_private is used to track the number of entries in
50 * the page table page have non standard attributes.
51 */
52 SetPagePrivate(base);
53 page_private(base) = 0;
54
48 address = __pa(address); 55 address = __pa(address);
49 addr = address & LARGE_PAGE_MASK; 56 addr = address & LARGE_PAGE_MASK;
50 pbase = (pte_t *)page_address(base); 57 pbase = (pte_t *)page_address(base);
@@ -77,26 +84,12 @@ static inline void flush_map(unsigned long address)
77 on_each_cpu(flush_kernel_map, (void *)address, 1, 1); 84 on_each_cpu(flush_kernel_map, (void *)address, 1, 1);
78} 85}
79 86
80struct deferred_page { 87static struct page *deferred_pages; /* protected by init_mm.mmap_sem */
81 struct deferred_page *next;
82 struct page *fpage;
83 unsigned long address;
84};
85static struct deferred_page *df_list; /* protected by init_mm.mmap_sem */
86 88
87static inline void save_page(unsigned long address, struct page *fpage) 89static inline void save_page(struct page *fpage)
88{ 90{
89 struct deferred_page *df; 91 fpage->lru.next = (struct list_head *)deferred_pages;
90 df = kmalloc(sizeof(struct deferred_page), GFP_KERNEL); 92 deferred_pages = fpage;
91 if (!df) {
92 flush_map(address);
93 __free_page(fpage);
94 } else {
95 df->next = df_list;
96 df->fpage = fpage;
97 df->address = address;
98 df_list = df;
99 }
100} 93}
101 94
102/* 95/*
@@ -138,8 +131,8 @@ __change_page_attr(unsigned long address, unsigned long pfn, pgprot_t prot,
138 set_pte(kpte, pfn_pte(pfn, prot)); 131 set_pte(kpte, pfn_pte(pfn, prot));
139 } else { 132 } else {
140 /* 133 /*
141 * split_large_page will take the reference for this change_page_attr 134 * split_large_page will take the reference for this
142 * on the split page. 135 * change_page_attr on the split page.
143 */ 136 */
144 137
145 struct page *split; 138 struct page *split;
@@ -151,23 +144,20 @@ __change_page_attr(unsigned long address, unsigned long pfn, pgprot_t prot,
151 set_pte(kpte,mk_pte(split, ref_prot2)); 144 set_pte(kpte,mk_pte(split, ref_prot2));
152 kpte_page = split; 145 kpte_page = split;
153 } 146 }
154 get_page(kpte_page); 147 page_private(kpte_page)++;
155 } else if ((kpte_flags & _PAGE_PSE) == 0) { 148 } else if ((kpte_flags & _PAGE_PSE) == 0) {
156 set_pte(kpte, pfn_pte(pfn, ref_prot)); 149 set_pte(kpte, pfn_pte(pfn, ref_prot));
157 __put_page(kpte_page); 150 BUG_ON(page_private(kpte_page) == 0);
151 page_private(kpte_page)--;
158 } else 152 } else
159 BUG(); 153 BUG();
160 154
161 /* on x86-64 the direct mapping set at boot is not using 4k pages */ 155 /* on x86-64 the direct mapping set at boot is not using 4k pages */
162 BUG_ON(PageReserved(kpte_page)); 156 BUG_ON(PageReserved(kpte_page));
163 157
164 switch (page_count(kpte_page)) { 158 if (page_private(kpte_page) == 0) {
165 case 1: 159 save_page(kpte_page);
166 save_page(address, kpte_page);
167 revert_page(address, ref_prot); 160 revert_page(address, ref_prot);
168 break;
169 case 0:
170 BUG(); /* memleak and failed 2M page regeneration */
171 } 161 }
172 return 0; 162 return 0;
173} 163}
@@ -220,17 +210,18 @@ int change_page_attr(struct page *page, int numpages, pgprot_t prot)
220 210
221void global_flush_tlb(void) 211void global_flush_tlb(void)
222{ 212{
223 struct deferred_page *df, *next_df; 213 struct page *dpage;
224 214
225 down_read(&init_mm.mmap_sem); 215 down_read(&init_mm.mmap_sem);
226 df = xchg(&df_list, NULL); 216 dpage = xchg(&deferred_pages, NULL);
227 up_read(&init_mm.mmap_sem); 217 up_read(&init_mm.mmap_sem);
228 flush_map((df && !df->next) ? df->address : 0); 218
229 for (; df; df = next_df) { 219 flush_map((dpage && !dpage->lru.next) ? (unsigned long)page_address(dpage) : 0);
230 next_df = df->next; 220 while (dpage) {
231 if (df->fpage) 221 struct page *tmp = dpage;
232 __free_page(df->fpage); 222 dpage = (struct page *)dpage->lru.next;
233 kfree(df); 223 ClearPagePrivate(tmp);
224 __free_page(tmp);
234 } 225 }
235} 226}
236 227
diff --git a/arch/x86_64/mm/srat.c b/arch/x86_64/mm/srat.c
index 482c25767369..2eb879590dc4 100644
--- a/arch/x86_64/mm/srat.c
+++ b/arch/x86_64/mm/srat.c
@@ -23,7 +23,7 @@ static struct acpi_table_slit *acpi_slit;
23 23
24static nodemask_t nodes_parsed __initdata; 24static nodemask_t nodes_parsed __initdata;
25static nodemask_t nodes_found __initdata; 25static nodemask_t nodes_found __initdata;
26static struct node nodes[MAX_NUMNODES] __initdata; 26static struct bootnode nodes[MAX_NUMNODES] __initdata;
27static u8 pxm2node[256] = { [0 ... 255] = 0xff }; 27static u8 pxm2node[256] = { [0 ... 255] = 0xff };
28 28
29/* Too small nodes confuse the VM badly. Usually they result 29/* Too small nodes confuse the VM badly. Usually they result
@@ -57,7 +57,7 @@ static __init int conflicting_nodes(unsigned long start, unsigned long end)
57{ 57{
58 int i; 58 int i;
59 for_each_node_mask(i, nodes_parsed) { 59 for_each_node_mask(i, nodes_parsed) {
60 struct node *nd = &nodes[i]; 60 struct bootnode *nd = &nodes[i];
61 if (nd->start == nd->end) 61 if (nd->start == nd->end)
62 continue; 62 continue;
63 if (nd->end > start && nd->start < end) 63 if (nd->end > start && nd->start < end)
@@ -70,7 +70,7 @@ static __init int conflicting_nodes(unsigned long start, unsigned long end)
70 70
71static __init void cutoff_node(int i, unsigned long start, unsigned long end) 71static __init void cutoff_node(int i, unsigned long start, unsigned long end)
72{ 72{
73 struct node *nd = &nodes[i]; 73 struct bootnode *nd = &nodes[i];
74 if (nd->start < start) { 74 if (nd->start < start) {
75 nd->start = start; 75 nd->start = start;
76 if (nd->end < nd->start) 76 if (nd->end < nd->start)
@@ -159,7 +159,7 @@ acpi_numa_processor_affinity_init(struct acpi_table_processor_affinity *pa)
159void __init 159void __init
160acpi_numa_memory_affinity_init(struct acpi_table_memory_affinity *ma) 160acpi_numa_memory_affinity_init(struct acpi_table_memory_affinity *ma)
161{ 161{
162 struct node *nd; 162 struct bootnode *nd;
163 unsigned long start, end; 163 unsigned long start, end;
164 int node, pxm; 164 int node, pxm;
165 int i; 165 int i;
diff --git a/arch/x86_64/pci/Makefile b/arch/x86_64/pci/Makefile
index a8f75a2a0f6f..a3f6ad570179 100644
--- a/arch/x86_64/pci/Makefile
+++ b/arch/x86_64/pci/Makefile
@@ -7,7 +7,7 @@ CFLAGS += -Iarch/i386/pci
7 7
8obj-y := i386.o 8obj-y := i386.o
9obj-$(CONFIG_PCI_DIRECT)+= direct.o 9obj-$(CONFIG_PCI_DIRECT)+= direct.o
10obj-y += fixup.o 10obj-y += fixup.o init.o
11obj-$(CONFIG_ACPI) += acpi.o 11obj-$(CONFIG_ACPI) += acpi.o
12obj-y += legacy.o irq.o common.o 12obj-y += legacy.o irq.o common.o
13# mmconfig has a 64bit special 13# mmconfig has a 64bit special
@@ -22,3 +22,4 @@ irq-y += ../../i386/pci/irq.o
22common-y += ../../i386/pci/common.o 22common-y += ../../i386/pci/common.o
23fixup-y += ../../i386/pci/fixup.o 23fixup-y += ../../i386/pci/fixup.o
24i386-y += ../../i386/pci/i386.o 24i386-y += ../../i386/pci/i386.o
25init-y += ../../i386/pci/init.o
diff --git a/arch/x86_64/pci/mmconfig.c b/arch/x86_64/pci/mmconfig.c
index 18f371fe37f8..e616500207e4 100644
--- a/arch/x86_64/pci/mmconfig.c
+++ b/arch/x86_64/pci/mmconfig.c
@@ -55,7 +55,7 @@ static char __iomem *get_virt(unsigned int seg, unsigned bus)
55static char __iomem *pci_dev_base(unsigned int seg, unsigned int bus, unsigned int devfn) 55static char __iomem *pci_dev_base(unsigned int seg, unsigned int bus, unsigned int devfn)
56{ 56{
57 char __iomem *addr; 57 char __iomem *addr;
58 if (seg == 0 && bus == 0 && test_bit(PCI_SLOT(devfn), &fallback_slots)) 58 if (seg == 0 && bus == 0 && test_bit(PCI_SLOT(devfn), fallback_slots))
59 return NULL; 59 return NULL;
60 addr = get_virt(seg, bus); 60 addr = get_virt(seg, bus);
61 if (!addr) 61 if (!addr)
@@ -143,29 +143,29 @@ static __init void unreachable_devices(void)
143 continue; 143 continue;
144 addr = pci_dev_base(0, 0, PCI_DEVFN(i, 0)); 144 addr = pci_dev_base(0, 0, PCI_DEVFN(i, 0));
145 if (addr == NULL|| readl(addr) != val1) { 145 if (addr == NULL|| readl(addr) != val1) {
146 set_bit(i, &fallback_slots); 146 set_bit(i, fallback_slots);
147 } 147 }
148 } 148 }
149} 149}
150 150
151static int __init pci_mmcfg_init(void) 151void __init pci_mmcfg_init(void)
152{ 152{
153 int i; 153 int i;
154 154
155 if ((pci_probe & PCI_PROBE_MMCONF) == 0) 155 if ((pci_probe & PCI_PROBE_MMCONF) == 0)
156 return 0; 156 return;
157 157
158 acpi_table_parse(ACPI_MCFG, acpi_parse_mcfg); 158 acpi_table_parse(ACPI_MCFG, acpi_parse_mcfg);
159 if ((pci_mmcfg_config_num == 0) || 159 if ((pci_mmcfg_config_num == 0) ||
160 (pci_mmcfg_config == NULL) || 160 (pci_mmcfg_config == NULL) ||
161 (pci_mmcfg_config[0].base_address == 0)) 161 (pci_mmcfg_config[0].base_address == 0))
162 return 0; 162 return;
163 163
164 /* RED-PEN i386 doesn't do _nocache right now */ 164 /* RED-PEN i386 doesn't do _nocache right now */
165 pci_mmcfg_virt = kmalloc(sizeof(*pci_mmcfg_virt) * pci_mmcfg_config_num, GFP_KERNEL); 165 pci_mmcfg_virt = kmalloc(sizeof(*pci_mmcfg_virt) * pci_mmcfg_config_num, GFP_KERNEL);
166 if (pci_mmcfg_virt == NULL) { 166 if (pci_mmcfg_virt == NULL) {
167 printk("PCI: Can not allocate memory for mmconfig structures\n"); 167 printk("PCI: Can not allocate memory for mmconfig structures\n");
168 return 0; 168 return;
169 } 169 }
170 for (i = 0; i < pci_mmcfg_config_num; ++i) { 170 for (i = 0; i < pci_mmcfg_config_num; ++i) {
171 pci_mmcfg_virt[i].cfg = &pci_mmcfg_config[i]; 171 pci_mmcfg_virt[i].cfg = &pci_mmcfg_config[i];
@@ -173,7 +173,7 @@ static int __init pci_mmcfg_init(void)
173 if (!pci_mmcfg_virt[i].virt) { 173 if (!pci_mmcfg_virt[i].virt) {
174 printk("PCI: Cannot map mmconfig aperture for segment %d\n", 174 printk("PCI: Cannot map mmconfig aperture for segment %d\n",
175 pci_mmcfg_config[i].pci_segment_group_number); 175 pci_mmcfg_config[i].pci_segment_group_number);
176 return 0; 176 return;
177 } 177 }
178 printk(KERN_INFO "PCI: Using MMCONFIG at %x\n", pci_mmcfg_config[i].base_address); 178 printk(KERN_INFO "PCI: Using MMCONFIG at %x\n", pci_mmcfg_config[i].base_address);
179 } 179 }
@@ -182,8 +182,4 @@ static int __init pci_mmcfg_init(void)
182 182
183 raw_pci_ops = &pci_mmcfg; 183 raw_pci_ops = &pci_mmcfg;
184 pci_probe = (pci_probe & ~PCI_PROBE_MASK) | PCI_PROBE_MMCONF; 184 pci_probe = (pci_probe & ~PCI_PROBE_MASK) | PCI_PROBE_MMCONF;
185
186 return 0;
187} 185}
188
189arch_initcall(pci_mmcfg_init);
diff --git a/arch/xtensa/Kconfig b/arch/xtensa/Kconfig
index e90ef5db8913..dbeb3504c3c8 100644
--- a/arch/xtensa/Kconfig
+++ b/arch/xtensa/Kconfig
@@ -22,6 +22,14 @@ config RWSEM_XCHGADD_ALGORITHM
22 bool 22 bool
23 default y 23 default y
24 24
25config GENERIC_FIND_NEXT_BIT
26 bool
27 default y
28
29config GENERIC_HWEIGHT
30 bool
31 default y
32
25config GENERIC_HARDIRQS 33config GENERIC_HARDIRQS
26 bool 34 bool
27 default y 35 default y
diff --git a/arch/xtensa/kernel/irq.c b/arch/xtensa/kernel/irq.c
index 4cbf6d91571f..51f9bed455fa 100644
--- a/arch/xtensa/kernel/irq.c
+++ b/arch/xtensa/kernel/irq.c
@@ -83,9 +83,8 @@ int show_interrupts(struct seq_file *p, void *v)
83 83
84 if (i == 0) { 84 if (i == 0) {
85 seq_printf(p, " "); 85 seq_printf(p, " ");
86 for (j=0; j<NR_CPUS; j++) 86 for_each_online_cpu(j)
87 if (cpu_online(j)) 87 seq_printf(p, "CPU%d ",j);
88 seq_printf(p, "CPU%d ",j);
89 seq_putc(p, '\n'); 88 seq_putc(p, '\n');
90 } 89 }
91 90
@@ -98,9 +97,8 @@ int show_interrupts(struct seq_file *p, void *v)
98#ifndef CONFIG_SMP 97#ifndef CONFIG_SMP
99 seq_printf(p, "%10u ", kstat_irqs(i)); 98 seq_printf(p, "%10u ", kstat_irqs(i));
100#else 99#else
101 for (j = 0; j < NR_CPUS; j++) 100 for_each_online_cpu(j)
102 if (cpu_online(j)) 101 seq_printf(p, "%10u ", kstat_cpu(j).irqs[i]);
103 seq_printf(p, "%10u ", kstat_cpu(j).irqs[i]);
104#endif 102#endif
105 seq_printf(p, " %14s", irq_desc[i].handler->typename); 103 seq_printf(p, " %14s", irq_desc[i].handler->typename);
106 seq_printf(p, " %s", action->name); 104 seq_printf(p, " %s", action->name);
@@ -113,9 +111,8 @@ skip:
113 spin_unlock_irqrestore(&irq_desc[i].lock, flags); 111 spin_unlock_irqrestore(&irq_desc[i].lock, flags);
114 } else if (i == NR_IRQS) { 112 } else if (i == NR_IRQS) {
115 seq_printf(p, "NMI: "); 113 seq_printf(p, "NMI: ");
116 for (j = 0; j < NR_CPUS; j++) 114 for_each_online_cpu(j)
117 if (cpu_online(j)) 115 seq_printf(p, "%10u ", nmi_count(j));
118 seq_printf(p, "%10u ", nmi_count(j));
119 seq_putc(p, '\n'); 116 seq_putc(p, '\n');
120 seq_printf(p, "ERR: %10u\n", atomic_read(&irq_err_count)); 117 seq_printf(p, "ERR: %10u\n", atomic_read(&irq_err_count));
121 } 118 }
diff --git a/arch/xtensa/kernel/xtensa_ksyms.c b/arch/xtensa/kernel/xtensa_ksyms.c
index efae56a51475..152b9370789b 100644
--- a/arch/xtensa/kernel/xtensa_ksyms.c
+++ b/arch/xtensa/kernel/xtensa_ksyms.c
@@ -113,8 +113,6 @@ EXPORT_SYMBOL(__xtensa_copy_user);
113// FIXME EXPORT_SYMBOL(screen_info); 113// FIXME EXPORT_SYMBOL(screen_info);
114#endif 114#endif
115 115
116EXPORT_SYMBOL(get_wchan);
117
118EXPORT_SYMBOL(outsb); 116EXPORT_SYMBOL(outsb);
119EXPORT_SYMBOL(outsw); 117EXPORT_SYMBOL(outsw);
120EXPORT_SYMBOL(outsl); 118EXPORT_SYMBOL(outsl);
diff --git a/arch/xtensa/mm/init.c b/arch/xtensa/mm/init.c
index 5a91d6c9e66d..e1be4235f367 100644
--- a/arch/xtensa/mm/init.c
+++ b/arch/xtensa/mm/init.c
@@ -272,7 +272,7 @@ free_reserved_mem(void *start, void *end)
272{ 272{
273 for (; start < end; start += PAGE_SIZE) { 273 for (; start < end; start += PAGE_SIZE) {
274 ClearPageReserved(virt_to_page(start)); 274 ClearPageReserved(virt_to_page(start));
275 set_page_count(virt_to_page(start), 1); 275 init_page_count(virt_to_page(start));
276 free_page((unsigned long)start); 276 free_page((unsigned long)start);
277 totalram_pages++; 277 totalram_pages++;
278 } 278 }
diff --git a/arch/xtensa/mm/pgtable.c b/arch/xtensa/mm/pgtable.c
index e5e119c820e4..7d28914d11cb 100644
--- a/arch/xtensa/mm/pgtable.c
+++ b/arch/xtensa/mm/pgtable.c
@@ -14,25 +14,21 @@
14 14
15pte_t* pte_alloc_one_kernel(struct mm_struct *mm, unsigned long address) 15pte_t* pte_alloc_one_kernel(struct mm_struct *mm, unsigned long address)
16{ 16{
17 pte_t *pte, p; 17 pte_t *pte = NULL, *p;
18 int color = ADDR_COLOR(address); 18 int color = ADDR_COLOR(address);
19 int i; 19 int i;
20 20
21 p = (pte_t*) __get_free_pages(GFP_KERNEL|__GFP_REPEAT, COLOR_ORDER); 21 p = (pte_t*) __get_free_pages(GFP_KERNEL|__GFP_REPEAT, COLOR_ORDER);
22 22
23 if (likely(p)) { 23 if (likely(p)) {
24 struct page *page; 24 split_page(virt_to_page(p), COLOR_ORDER);
25
26 for (i = 0; i < COLOR_SIZE; i++, p++) {
27 page = virt_to_page(pte);
28
29 set_page_count(page, 1);
30 ClearPageCompound(page);
31 25
26 for (i = 0; i < COLOR_SIZE; i++) {
32 if (ADDR_COLOR(p) == color) 27 if (ADDR_COLOR(p) == color)
33 pte = p; 28 pte = p;
34 else 29 else
35 free_page(p); 30 free_page(p);
31 p += PTRS_PER_PTE;
36 } 32 }
37 clear_page(pte); 33 clear_page(pte);
38 } 34 }
@@ -49,20 +45,20 @@ int flush;
49 45
50struct page* pte_alloc_one(struct mm_struct *mm, unsigned long address) 46struct page* pte_alloc_one(struct mm_struct *mm, unsigned long address)
51{ 47{
52 struct page *page, p; 48 struct page *page = NULL, *p;
53 int color = ADDR_COLOR(address); 49 int color = ADDR_COLOR(address);
54 50
55 p = alloc_pages(GFP_KERNEL | __GFP_REPEAT, PTE_ORDER); 51 p = alloc_pages(GFP_KERNEL | __GFP_REPEAT, PTE_ORDER);
56 52
57 if (likely(p)) { 53 if (likely(p)) {
58 for (i = 0; i < PAGE_ORDER; i++) { 54 split_page(p, COLOR_ORDER);
59 set_page_count(p, 1);
60 ClearPageCompound(p);
61 55
62 if (PADDR_COLOR(page_address(pg)) == color) 56 for (i = 0; i < PAGE_ORDER; i++) {
57 if (PADDR_COLOR(page_address(p)) == color)
63 page = p; 58 page = p;
64 else 59 else
65 free_page(p); 60 __free_page(p);
61 p++;
66 } 62 }
67 clear_highpage(page); 63 clear_highpage(page);
68 } 64 }
diff --git a/arch/xtensa/platform-iss/console.c b/arch/xtensa/platform-iss/console.c
index 94fdfe474ac1..2a580efb58ec 100644
--- a/arch/xtensa/platform-iss/console.c
+++ b/arch/xtensa/platform-iss/console.c
@@ -31,10 +31,6 @@
31#include <linux/tty.h> 31#include <linux/tty.h>
32#include <linux/tty_flip.h> 32#include <linux/tty_flip.h>
33 33
34#ifdef SERIAL_INLINE
35#define _INLINE_ inline
36#endif
37
38#define SERIAL_MAX_NUM_LINES 1 34#define SERIAL_MAX_NUM_LINES 1
39#define SERIAL_TIMER_VALUE (20 * HZ) 35#define SERIAL_TIMER_VALUE (20 * HZ)
40 36
diff --git a/arch/xtensa/platform-iss/setup.c b/arch/xtensa/platform-iss/setup.c
index 2e6dcbf0cc04..23790a5610e2 100644
--- a/arch/xtensa/platform-iss/setup.c
+++ b/arch/xtensa/platform-iss/setup.c
@@ -108,5 +108,5 @@ static struct notifier_block iss_panic_block = {
108 108
109void __init platform_setup(char **p_cmdline) 109void __init platform_setup(char **p_cmdline)
110{ 110{
111 notifier_chain_register(&panic_notifier_list, &iss_panic_block); 111 atomic_notifier_chain_register(&panic_notifier_list, &iss_panic_block);
112} 112}