aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
Diffstat (limited to 'arch')
-rw-r--r--arch/alpha/Kconfig4
-rw-r--r--arch/alpha/kernel/pci.c16
-rw-r--r--arch/alpha/kernel/process.c3
-rw-r--r--arch/alpha/kernel/signal.c11
-rw-r--r--arch/alpha/kernel/smp.c6
-rw-r--r--arch/alpha/kernel/systbls.S5
-rw-r--r--arch/alpha/oprofile/common.c6
-rw-r--r--arch/arm/Kconfig51
-rw-r--r--arch/arm/boot/compressed/head-shark.S42
-rw-r--r--arch/arm/common/Kconfig3
-rw-r--r--arch/arm/common/Makefile1
-rw-r--r--arch/arm/common/gic.c167
-rw-r--r--arch/arm/common/locomo.c24
-rw-r--r--arch/arm/common/sa1111.c8
-rw-r--r--arch/arm/configs/bast_defconfig1
-rw-r--r--arch/arm/configs/s3c2410_defconfig1
-rw-r--r--arch/arm/configs/shark_defconfig85
-rw-r--r--arch/arm/kernel/bios32.c17
-rw-r--r--arch/arm/kernel/calls.S8
-rw-r--r--arch/arm/kernel/ecard.c4
-rw-r--r--arch/arm/kernel/entry-armv.S7
-rw-r--r--arch/arm/kernel/entry-common.S4
-rw-r--r--arch/arm/kernel/irq.c20
-rw-r--r--arch/arm/kernel/process.c4
-rw-r--r--arch/arm/kernel/signal.c5
-rw-r--r--arch/arm/kernel/smp.c16
-rw-r--r--arch/arm/kernel/sys_arm.c10
-rw-r--r--arch/arm/kernel/time.c10
-rw-r--r--arch/arm/kernel/traps.c14
-rw-r--r--arch/arm/lib/bitops.h33
-rw-r--r--arch/arm/lib/io-shark.c70
-rw-r--r--arch/arm/mach-footbridge/isa-irq.c2
-rw-r--r--arch/arm/mach-h720x/common.c2
-rw-r--r--arch/arm/mach-h720x/cpu-h7202.c2
-rw-r--r--arch/arm/mach-imx/irq.c4
-rw-r--r--arch/arm/mach-integrator/integrator_cp.c2
-rw-r--r--arch/arm/mach-integrator/platsmp.c18
-rw-r--r--arch/arm/mach-ixp2000/core.c10
-rw-r--r--arch/arm/mach-ixp2000/ixdp2x00.c2
-rw-r--r--arch/arm/mach-ixp2000/ixdp2x01.c2
-rw-r--r--arch/arm/mach-ixp4xx/common.c155
-rw-r--r--arch/arm/mach-ixp4xx/coyote-pci.c7
-rw-r--r--arch/arm/mach-ixp4xx/coyote-setup.c13
-rw-r--r--arch/arm/mach-ixp4xx/gtwx5715-pci.c28
-rw-r--r--arch/arm/mach-ixp4xx/gtwx5715-setup.c12
-rw-r--r--arch/arm/mach-ixp4xx/ixdp425-pci.c12
-rw-r--r--arch/arm/mach-ixp4xx/ixdp425-setup.c19
-rw-r--r--arch/arm/mach-ixp4xx/ixdpg425-pci.c4
-rw-r--r--arch/arm/mach-lh7a40x/common.h2
-rw-r--r--arch/arm/mach-omap1/fpga.c2
-rw-r--r--arch/arm/mach-omap1/leds-h2p2-debug.c1
-rw-r--r--arch/arm/mach-pxa/irq.c12
-rw-r--r--arch/arm/mach-pxa/lubbock.c2
-rw-r--r--arch/arm/mach-pxa/mainstone.c2
-rw-r--r--arch/arm/mach-pxa/time.c58
-rw-r--r--arch/arm/mach-s3c2410/Makefile2
-rw-r--r--arch/arm/mach-s3c2410/bast-irq.c2
-rw-r--r--arch/arm/mach-s3c2410/clock.c62
-rw-r--r--arch/arm/mach-s3c2410/dma.c2
-rw-r--r--arch/arm/mach-s3c2410/irq.c282
-rw-r--r--arch/arm/mach-s3c2410/irq.h99
-rw-r--r--arch/arm/mach-s3c2410/mach-bast.c64
-rw-r--r--arch/arm/mach-s3c2410/pm.c6
-rw-r--r--arch/arm/mach-s3c2410/s3c2410.c4
-rw-r--r--arch/arm/mach-s3c2410/s3c2440-clock.c118
-rw-r--r--arch/arm/mach-s3c2410/s3c2440-irq.c207
-rw-r--r--arch/arm/mach-s3c2410/usb-simtec.c18
-rw-r--r--arch/arm/mach-sa1100/assabet.c7
-rw-r--r--arch/arm/mach-sa1100/cerf.c7
-rw-r--r--arch/arm/mach-sa1100/generic.c5
-rw-r--r--arch/arm/mach-sa1100/generic.h3
-rw-r--r--arch/arm/mach-sa1100/irq.c10
-rw-r--r--arch/arm/mach-sa1100/jornada720.c1
-rw-r--r--arch/arm/mach-sa1100/lart.c12
-rw-r--r--arch/arm/mach-sa1100/neponset.c6
-rw-r--r--arch/arm/mach-sa1100/shannon.c7
-rw-r--r--arch/arm/mach-sa1100/simpad.c7
-rw-r--r--arch/arm/mach-sa1100/time.c68
-rw-r--r--arch/arm/mach-shark/core.c4
-rw-r--r--arch/arm/mach-versatile/core.c2
-rw-r--r--arch/arm/mm/Kconfig2
-rw-r--r--arch/arm/mm/alignment.c70
-rw-r--r--arch/arm/mm/fault.c6
-rw-r--r--arch/arm/mm/mm-armv.c48
-rw-r--r--arch/arm/mm/proc-arm6_7.S8
-rw-r--r--arch/arm/mm/proc-v6.S24
-rw-r--r--arch/arm/mm/proc-xscale.S136
-rw-r--r--arch/arm/nwfpe/double_cpdo.c24
-rw-r--r--arch/arm/nwfpe/extended_cpdo.c24
-rw-r--r--arch/arm/nwfpe/fpa11.c30
-rw-r--r--arch/arm/nwfpe/fpa11.h15
-rw-r--r--arch/arm/nwfpe/fpa11_cpdo.c28
-rw-r--r--arch/arm/nwfpe/fpa11_cpdt.c22
-rw-r--r--arch/arm/nwfpe/fpa11_cprt.c28
-rw-r--r--arch/arm/nwfpe/fpmodule.c16
-rw-r--r--arch/arm/nwfpe/fpmodule.inl14
-rw-r--r--arch/arm/nwfpe/fpopcode.h6
-rw-r--r--arch/arm/nwfpe/single_cpdo.c24
-rw-r--r--arch/arm/nwfpe/softfloat.c348
-rw-r--r--arch/arm/nwfpe/softfloat.h68
-rw-r--r--arch/arm/oprofile/backtrace.c2
-rw-r--r--arch/arm/plat-omap/gpio.c2
-rw-r--r--arch/arm/plat-omap/ocpi.c1
-rw-r--r--arch/arm/vfp/vfpdouble.c3
-rw-r--r--arch/arm26/Kconfig4
-rw-r--r--arch/arm26/kernel/process.c5
-rw-r--r--arch/arm26/kernel/signal.c13
-rw-r--r--arch/arm26/mm/fault.c17
-rw-r--r--arch/cris/Kconfig4
-rw-r--r--arch/cris/Kconfig.debug26
-rw-r--r--arch/cris/Makefile66
-rw-r--r--arch/cris/arch-v10/Kconfig31
-rw-r--r--arch/cris/arch-v10/boot/Makefile9
-rw-r--r--arch/cris/arch-v10/boot/compressed/Makefile43
-rw-r--r--arch/cris/arch-v10/boot/compressed/head.S22
-rw-r--r--arch/cris/arch-v10/boot/rescue/Makefile45
-rw-r--r--arch/cris/arch-v10/boot/rescue/head.S33
-rw-r--r--arch/cris/arch-v10/drivers/Kconfig250
-rw-r--r--arch/cris/arch-v10/drivers/axisflashmap.c5
-rw-r--r--arch/cris/arch-v10/drivers/ds1302.c71
-rw-r--r--arch/cris/arch-v10/drivers/eeprom.c29
-rw-r--r--arch/cris/arch-v10/drivers/gpio.c201
-rw-r--r--arch/cris/arch-v10/drivers/i2c.c62
-rw-r--r--arch/cris/arch-v10/drivers/pcf8563.c20
-rw-r--r--arch/cris/arch-v10/kernel/Makefile5
-rw-r--r--arch/cris/arch-v10/kernel/debugport.c273
-rw-r--r--arch/cris/arch-v10/kernel/dma.c287
-rw-r--r--arch/cris/arch-v10/kernel/entry.S54
-rw-r--r--arch/cris/arch-v10/kernel/fasttimer.c55
-rw-r--r--arch/cris/arch-v10/kernel/head.S126
-rw-r--r--arch/cris/arch-v10/kernel/io_interface_mux.c879
-rw-r--r--arch/cris/arch-v10/kernel/irq.c76
-rw-r--r--arch/cris/arch-v10/kernel/kgdb.c17
-rw-r--r--arch/cris/arch-v10/kernel/process.c3
-rw-r--r--arch/cris/arch-v10/kernel/ptrace.c9
-rw-r--r--arch/cris/arch-v10/kernel/shadows.c3
-rw-r--r--arch/cris/arch-v10/kernel/signal.c11
-rw-r--r--arch/cris/arch-v10/kernel/traps.c37
-rw-r--r--arch/cris/arch-v10/mm/fault.c26
-rw-r--r--arch/cris/arch-v10/mm/init.c2
-rw-r--r--arch/cris/arch-v10/mm/tlb.c49
-rw-r--r--arch/cris/arch-v32/Kconfig296
-rw-r--r--arch/cris/arch-v32/boot/Makefile14
-rw-r--r--arch/cris/arch-v32/boot/compressed/Makefile41
-rw-r--r--arch/cris/arch-v32/boot/compressed/README25
-rw-r--r--arch/cris/arch-v32/boot/compressed/decompress.ld30
-rw-r--r--arch/cris/arch-v32/boot/compressed/head.S193
-rw-r--r--arch/cris/arch-v32/boot/compressed/misc.c318
-rw-r--r--arch/cris/arch-v32/boot/rescue/Makefile36
-rw-r--r--arch/cris/arch-v32/boot/rescue/head.S39
-rw-r--r--arch/cris/arch-v32/boot/rescue/rescue.ld20
-rw-r--r--arch/cris/arch-v32/drivers/Kconfig625
-rw-r--r--arch/cris/arch-v32/drivers/Makefile13
-rw-r--r--arch/cris/arch-v32/drivers/axisflashmap.c455
-rw-r--r--arch/cris/arch-v32/drivers/cryptocop.c3522
-rw-r--r--arch/cris/arch-v32/drivers/gpio.c766
-rw-r--r--arch/cris/arch-v32/drivers/i2c.c611
-rw-r--r--arch/cris/arch-v32/drivers/i2c.h15
-rw-r--r--arch/cris/arch-v32/drivers/iop_fw_load.c219
-rw-r--r--arch/cris/arch-v32/drivers/nandflash.c157
-rw-r--r--arch/cris/arch-v32/drivers/pcf8563.c341
-rw-r--r--arch/cris/arch-v32/drivers/pci/Makefile5
-rw-r--r--arch/cris/arch-v32/drivers/pci/bios.c131
-rw-r--r--arch/cris/arch-v32/drivers/pci/dma.c149
-rw-r--r--arch/cris/arch-v32/drivers/sync_serial.c1283
-rw-r--r--arch/cris/arch-v32/kernel/Makefile21
-rw-r--r--arch/cris/arch-v32/kernel/arbiter.c297
-rw-r--r--arch/cris/arch-v32/kernel/asm-offsets.c49
-rw-r--r--arch/cris/arch-v32/kernel/crisksyms.c24
-rw-r--r--arch/cris/arch-v32/kernel/debugport.c461
-rw-r--r--arch/cris/arch-v32/kernel/dma.c224
-rw-r--r--arch/cris/arch-v32/kernel/entry.S820
-rw-r--r--arch/cris/arch-v32/kernel/fasttimer.c996
-rw-r--r--arch/cris/arch-v32/kernel/head.S448
-rw-r--r--arch/cris/arch-v32/kernel/io.c154
-rw-r--r--arch/cris/arch-v32/kernel/irq.c413
-rw-r--r--arch/cris/arch-v32/kernel/kgdb.c1660
-rw-r--r--arch/cris/arch-v32/kernel/kgdb_asm.S552
-rw-r--r--arch/cris/arch-v32/kernel/pinmux.c229
-rw-r--r--arch/cris/arch-v32/kernel/process.c270
-rw-r--r--arch/cris/arch-v32/kernel/ptrace.c597
-rw-r--r--arch/cris/arch-v32/kernel/setup.c118
-rw-r--r--arch/cris/arch-v32/kernel/signal.c707
-rw-r--r--arch/cris/arch-v32/kernel/smp.c348
-rw-r--r--arch/cris/arch-v32/kernel/time.c341
-rw-r--r--arch/cris/arch-v32/kernel/traps.c160
-rw-r--r--arch/cris/arch-v32/kernel/vcs_hook.c96
-rw-r--r--arch/cris/arch-v32/kernel/vcs_hook.h42
-rw-r--r--arch/cris/arch-v32/lib/Makefile6
-rw-r--r--arch/cris/arch-v32/lib/checksum.S111
-rw-r--r--arch/cris/arch-v32/lib/checksumcopy.S120
-rw-r--r--arch/cris/arch-v32/lib/csumcpfruser.S69
-rw-r--r--arch/cris/arch-v32/lib/dram_init.S120
-rw-r--r--arch/cris/arch-v32/lib/hw_settings.S73
-rw-r--r--arch/cris/arch-v32/lib/memset.c253
-rw-r--r--arch/cris/arch-v32/lib/nand_init.S179
-rw-r--r--arch/cris/arch-v32/lib/spinlock.S33
-rw-r--r--arch/cris/arch-v32/lib/string.c219
-rw-r--r--arch/cris/arch-v32/lib/usercopy.c470
-rw-r--r--arch/cris/arch-v32/mm/Makefile3
-rw-r--r--arch/cris/arch-v32/mm/init.c174
-rw-r--r--arch/cris/arch-v32/mm/intmem.c139
-rw-r--r--arch/cris/arch-v32/mm/mmu.S141
-rw-r--r--arch/cris/arch-v32/mm/tlb.c208
-rw-r--r--arch/cris/arch-v32/output_arch.ld2
-rw-r--r--arch/cris/arch-v32/vmlinux.lds.S134
-rw-r--r--arch/cris/defconfig376
-rw-r--r--arch/cris/kernel/Makefile3
-rw-r--r--arch/cris/kernel/crisksyms.c21
-rw-r--r--arch/cris/kernel/irq.c263
-rw-r--r--arch/cris/kernel/module.c39
-rw-r--r--arch/cris/kernel/process.c40
-rw-r--r--arch/cris/kernel/profile.c73
-rw-r--r--arch/cris/kernel/ptrace.c37
-rw-r--r--arch/cris/kernel/setup.c26
-rw-r--r--arch/cris/kernel/time.c18
-rw-r--r--arch/cris/kernel/traps.c64
-rw-r--r--arch/cris/mm/fault.c101
-rw-r--r--arch/cris/mm/ioremap.c58
-rw-r--r--arch/cris/mm/tlb.c25
-rw-r--r--arch/frv/Kconfig2
-rw-r--r--arch/frv/kernel/frv_ksyms.c1
-rw-r--r--arch/frv/kernel/signal.c11
-rw-r--r--arch/frv/mb93090-mb00/pci-irq.c2
-rw-r--r--arch/frv/mm/fault.c6
-rw-r--r--arch/h8300/Kconfig6
-rw-r--r--arch/h8300/kernel/process.c6
-rw-r--r--arch/h8300/kernel/signal.c11
-rw-r--r--arch/i386/Kconfig10
-rw-r--r--arch/i386/Kconfig.debug3
-rw-r--r--arch/i386/kernel/Makefile2
-rw-r--r--arch/i386/kernel/acpi/Makefile4
-rw-r--r--arch/i386/kernel/acpi/boot.c3
-rw-r--r--arch/i386/kernel/acpi/cstate.c103
-rw-r--r--arch/i386/kernel/acpi/wakeup.S5
-rw-r--r--arch/i386/kernel/apic.c4
-rw-r--r--arch/i386/kernel/apm.c7
-rw-r--r--arch/i386/kernel/cpu/common.c16
-rw-r--r--arch/i386/kernel/cpu/cpufreq/acpi-cpufreq.c7
-rw-r--r--arch/i386/kernel/cpu/cpufreq/longhaul.c12
-rw-r--r--arch/i386/kernel/cpu/cpufreq/powernow-k8.c43
-rw-r--r--arch/i386/kernel/cpu/cpufreq/powernow-k8.h32
-rw-r--r--arch/i386/kernel/cpu/cpufreq/speedstep-centrino.c2
-rw-r--r--arch/i386/kernel/cpu/cyrix.c6
-rw-r--r--arch/i386/kernel/cpu/intel.c9
-rw-r--r--arch/i386/kernel/cpu/intel_cacheinfo.c29
-rw-r--r--arch/i386/kernel/cpu/mtrr/main.c2
-rw-r--r--arch/i386/kernel/cpu/transmeta.c6
-rw-r--r--arch/i386/kernel/crash.c2
-rw-r--r--arch/i386/kernel/doublefault.c2
-rw-r--r--arch/i386/kernel/efi.c110
-rw-r--r--arch/i386/kernel/entry.S9
-rw-r--r--arch/i386/kernel/head.S48
-rw-r--r--arch/i386/kernel/i387.c11
-rw-r--r--arch/i386/kernel/i8237.c67
-rw-r--r--arch/i386/kernel/ioport.c7
-rw-r--r--arch/i386/kernel/ldt.c7
-rw-r--r--arch/i386/kernel/machine_kexec.c32
-rw-r--r--arch/i386/kernel/microcode.c7
-rw-r--r--arch/i386/kernel/mpparse.c27
-rw-r--r--arch/i386/kernel/msr.c31
-rw-r--r--arch/i386/kernel/nmi.c9
-rw-r--r--arch/i386/kernel/numaq.c9
-rw-r--r--arch/i386/kernel/process.c65
-rw-r--r--arch/i386/kernel/ptrace.c63
-rw-r--r--arch/i386/kernel/reboot.c28
-rw-r--r--arch/i386/kernel/semaphore.c162
-rw-r--r--arch/i386/kernel/setup.c36
-rw-r--r--arch/i386/kernel/signal.c13
-rw-r--r--arch/i386/kernel/smp.c2
-rw-r--r--arch/i386/kernel/smpboot.c7
-rw-r--r--arch/i386/kernel/syscall_table.S5
-rw-r--r--arch/i386/kernel/time.c10
-rw-r--r--arch/i386/kernel/timers/timer_hpet.c19
-rw-r--r--arch/i386/kernel/timers/timer_pit.c27
-rw-r--r--arch/i386/kernel/timers/timer_pm.c9
-rw-r--r--arch/i386/kernel/timers/timer_tsc.c14
-rw-r--r--arch/i386/kernel/traps.c21
-rw-r--r--arch/i386/kernel/vm86.c10
-rw-r--r--arch/i386/kernel/vsyscall-sigreturn.S3
-rw-r--r--arch/i386/mach-es7000/es7000.h5
-rw-r--r--arch/i386/mach-es7000/es7000plat.c45
-rw-r--r--arch/i386/mach-generic/bigsmp.c5
-rw-r--r--arch/i386/mach-generic/probe.c20
-rw-r--r--arch/i386/mach-visws/reboot.c15
-rw-r--r--arch/i386/mach-visws/setup.c2
-rw-r--r--arch/i386/mach-voyager/voyager_basic.c31
-rw-r--r--arch/i386/mach-voyager/voyager_smp.c11
-rw-r--r--arch/i386/math-emu/get_address.c13
-rw-r--r--arch/i386/mm/discontig.c11
-rw-r--r--arch/i386/mm/fault.c37
-rw-r--r--arch/i386/mm/hugetlbpage.c27
-rw-r--r--arch/i386/mm/init.c7
-rw-r--r--arch/i386/mm/pageattr.c7
-rw-r--r--arch/i386/mm/pgtable.c10
-rw-r--r--arch/i386/pci/acpi.c1
-rw-r--r--arch/i386/pci/common.c7
-rw-r--r--arch/i386/pci/i386.c49
-rw-r--r--arch/i386/pci/irq.c24
-rw-r--r--arch/i386/pci/pci.h1
-rw-r--r--arch/i386/pci/visws.c4
-rw-r--r--arch/i386/power/cpu.c43
-rw-r--r--arch/ia64/Kconfig26
-rw-r--r--arch/ia64/configs/sn2_defconfig263
-rw-r--r--arch/ia64/configs/tiger_defconfig149
-rw-r--r--arch/ia64/configs/zx1_defconfig226
-rw-r--r--arch/ia64/hp/sim/boot/boot_head.S2
-rw-r--r--arch/ia64/hp/sim/boot/fw-emu.c11
-rw-r--r--arch/ia64/ia32/ia32_signal.c1
-rw-r--r--arch/ia64/kernel/Makefile1
-rw-r--r--arch/ia64/kernel/acpi.c54
-rw-r--r--arch/ia64/kernel/cpufreq/Kconfig29
-rw-r--r--arch/ia64/kernel/cpufreq/Makefile1
-rw-r--r--arch/ia64/kernel/cpufreq/acpi-cpufreq.c499
-rw-r--r--arch/ia64/kernel/domain.c2
-rw-r--r--arch/ia64/kernel/entry.S6
-rw-r--r--arch/ia64/kernel/mca.c2
-rw-r--r--arch/ia64/kernel/perfmon.c1
-rw-r--r--arch/ia64/kernel/process.c8
-rw-r--r--arch/ia64/kernel/salinfo.c3
-rw-r--r--arch/ia64/kernel/setup.c40
-rw-r--r--arch/ia64/kernel/signal.c15
-rw-r--r--arch/ia64/kernel/sys_ia64.c2
-rw-r--r--arch/ia64/kernel/topology.c9
-rw-r--r--arch/ia64/kernel/uncached.c4
-rw-r--r--arch/ia64/kernel/unwind.c12
-rw-r--r--arch/ia64/lib/Makefile2
-rw-r--r--arch/ia64/lib/flush.S46
-rw-r--r--arch/ia64/lib/swiotlb.c5
-rw-r--r--arch/ia64/mm/hugetlbpage.c8
-rw-r--r--arch/ia64/pci/pci.c14
-rw-r--r--arch/ia64/sn/include/tio.h6
-rw-r--r--arch/ia64/sn/include/xtalk/hubdev.h11
-rw-r--r--arch/ia64/sn/kernel/bte.c83
-rw-r--r--arch/ia64/sn/kernel/huberror.c2
-rw-r--r--arch/ia64/sn/kernel/io_init.c72
-rw-r--r--arch/ia64/sn/kernel/irq.c75
-rw-r--r--arch/ia64/sn/kernel/setup.c7
-rw-r--r--arch/ia64/sn/kernel/sn2/ptc_deadlock.S13
-rw-r--r--arch/ia64/sn/kernel/sn2/sn2_smp.c256
-rw-r--r--arch/ia64/sn/kernel/sn2/sn_hwperf.c313
-rw-r--r--arch/ia64/sn/kernel/sn2/sn_proc_fs.c4
-rw-r--r--arch/ia64/sn/kernel/sn2/timer_interrupt.c22
-rw-r--r--arch/ia64/sn/kernel/xpc_channel.c8
-rw-r--r--arch/ia64/sn/kernel/xpc_main.c2
-rw-r--r--arch/ia64/sn/pci/Makefile2
-rw-r--r--arch/ia64/sn/pci/pci_dma.c16
-rw-r--r--arch/ia64/sn/pci/pcibr/pcibr_dma.c60
-rw-r--r--arch/ia64/sn/pci/pcibr/pcibr_provider.c38
-rw-r--r--arch/ia64/sn/pci/tioca_provider.c11
-rw-r--r--arch/ia64/sn/pci/tioce_provider.c771
-rw-r--r--arch/m32r/Kconfig5
-rw-r--r--arch/m32r/Kconfig.debug5
-rw-r--r--arch/m32r/kernel/process.c6
-rw-r--r--arch/m32r/kernel/setup_m32700ut.c4
-rw-r--r--arch/m32r/kernel/setup_opsput.c4
-rw-r--r--arch/m32r/kernel/signal.c11
-rw-r--r--arch/m32r/kernel/smpboot.c1
-rw-r--r--arch/m32r/kernel/time.c13
-rw-r--r--arch/m32r/lib/csum_partial_copy.c1
-rw-r--r--arch/m32r/mm/discontig.c2
-rw-r--r--arch/m68k/Kconfig2
-rw-r--r--arch/m68k/kernel/m68k_ksyms.c4
-rw-r--r--arch/m68k/kernel/process.c6
-rw-r--r--arch/m68k/kernel/ptrace.c370
-rw-r--r--arch/m68k/lib/Makefile2
-rw-r--r--arch/m68k/lib/memcmp.c11
-rw-r--r--arch/m68k/lib/memcpy.c75
-rw-r--r--arch/m68k/lib/memset.c68
-rw-r--r--arch/m68k/lib/string.c237
-rw-r--r--arch/m68k/mm/Makefile2
-rw-r--r--arch/m68k/mm/cache.c118
-rw-r--r--arch/m68k/mm/fault.c6
-rw-r--r--arch/m68k/mm/memory.c104
-rw-r--r--arch/m68knommu/Kconfig68
-rw-r--r--arch/m68knommu/Makefile5
-rw-r--r--arch/m68knommu/defconfig452
-rw-r--r--arch/m68knommu/kernel/process.c6
-rw-r--r--arch/m68knommu/kernel/setup.c25
-rw-r--r--arch/m68knommu/kernel/signal.c11
-rw-r--r--arch/m68knommu/kernel/traps.c20
-rw-r--r--arch/m68knommu/kernel/vmlinux.lds.S23
-rw-r--r--arch/m68knommu/platform/523x/config.c82
-rw-r--r--arch/m68knommu/platform/5307/head.S15
-rw-r--r--arch/m68knommu/platform/68328/entry.S4
-rw-r--r--arch/m68knommu/platform/68360/entry.S2
-rw-r--r--arch/mips/Kconfig292
-rw-r--r--arch/mips/Makefile46
-rw-r--r--arch/mips/au1000/common/pci.c8
-rw-r--r--arch/mips/au1000/common/setup.c2
-rw-r--r--arch/mips/au1000/common/time.c14
-rw-r--r--arch/mips/au1000/csb250/board_setup.c4
-rw-r--r--arch/mips/au1000/csb250/init.c2
-rw-r--r--arch/mips/au1000/db1x00/init.c2
-rw-r--r--arch/mips/au1000/hydrogen3/init.c2
-rw-r--r--arch/mips/au1000/pb1000/board_setup.c2
-rw-r--r--arch/mips/au1000/xxs1500/board_setup.c6
-rw-r--r--arch/mips/au1000/xxs1500/init.c2
-rw-r--r--arch/mips/au1000/xxs1500/irqmap.c2
-rw-r--r--arch/mips/configs/atlas_defconfig5
-rw-r--r--arch/mips/configs/capcella_defconfig5
-rw-r--r--arch/mips/configs/cobalt_defconfig5
-rw-r--r--arch/mips/configs/db1000_defconfig5
-rw-r--r--arch/mips/configs/db1100_defconfig5
-rw-r--r--arch/mips/configs/db1500_defconfig4
-rw-r--r--arch/mips/configs/db1550_defconfig4
-rw-r--r--arch/mips/configs/ddb5476_defconfig5
-rw-r--r--arch/mips/configs/ddb5477_defconfig5
-rw-r--r--arch/mips/configs/decstation_defconfig5
-rw-r--r--arch/mips/configs/e55_defconfig5
-rw-r--r--arch/mips/configs/ev64120_defconfig5
-rw-r--r--arch/mips/configs/ev96100_defconfig5
-rw-r--r--arch/mips/configs/ip22_defconfig5
-rw-r--r--arch/mips/configs/ip27_defconfig2
-rw-r--r--arch/mips/configs/ip32_defconfig3
-rw-r--r--arch/mips/configs/it8172_defconfig5
-rw-r--r--arch/mips/configs/ivr_defconfig5
-rw-r--r--arch/mips/configs/jaguar-atx_defconfig5
-rw-r--r--arch/mips/configs/jmr3927_defconfig5
-rw-r--r--arch/mips/configs/lasat200_defconfig5
-rw-r--r--arch/mips/configs/malta_defconfig5
-rw-r--r--arch/mips/configs/mpc30x_defconfig5
-rw-r--r--arch/mips/configs/ocelot_3_defconfig5
-rw-r--r--arch/mips/configs/ocelot_c_defconfig3
-rw-r--r--arch/mips/configs/ocelot_defconfig5
-rw-r--r--arch/mips/configs/ocelot_g_defconfig3
-rw-r--r--arch/mips/configs/pb1100_defconfig5
-rw-r--r--arch/mips/configs/pb1500_defconfig4
-rw-r--r--arch/mips/configs/pb1550_defconfig4
-rw-r--r--arch/mips/configs/qemu_defconfig (renamed from arch/mips/configs/osprey_defconfig)405
-rw-r--r--arch/mips/configs/rm200_defconfig5
-rw-r--r--arch/mips/configs/sb1250-swarm_defconfig4
-rw-r--r--arch/mips/configs/sead_defconfig5
-rw-r--r--arch/mips/configs/tb0226_defconfig5
-rw-r--r--arch/mips/configs/tb0229_defconfig5
-rw-r--r--arch/mips/configs/workpad_defconfig5
-rw-r--r--arch/mips/configs/yosemite_defconfig4
-rw-r--r--arch/mips/ddb5xxx/ddb5477/irq.c6
-rw-r--r--arch/mips/ddb5xxx/ddb5477/setup.c22
-rw-r--r--arch/mips/dec/ecc-berr.c2
-rw-r--r--arch/mips/dec/int-handler.S6
-rw-r--r--arch/mips/dec/prom/Makefile4
-rw-r--r--arch/mips/defconfig5
-rw-r--r--arch/mips/ite-boards/generic/it8172_setup.c2
-rw-r--r--arch/mips/ite-boards/generic/time.c16
-rw-r--r--arch/mips/kernel/Makefile10
-rw-r--r--arch/mips/kernel/binfmt_elfn32.c2
-rw-r--r--arch/mips/kernel/binfmt_elfo32.c2
-rw-r--r--arch/mips/kernel/cpu-bugs64.c4
-rw-r--r--arch/mips/kernel/cpu-probe.c6
-rw-r--r--arch/mips/kernel/gdb-low.S4
-rw-r--r--arch/mips/kernel/gdb-stub.c12
-rw-r--r--arch/mips/kernel/genex.S14
-rw-r--r--arch/mips/kernel/head.S6
-rw-r--r--arch/mips/kernel/ioctl32.c2
-rw-r--r--arch/mips/kernel/irixsig.c13
-rw-r--r--arch/mips/kernel/irq.c2
-rw-r--r--arch/mips/kernel/linux32.c22
-rw-r--r--arch/mips/kernel/mips_ksyms.c2
-rw-r--r--arch/mips/kernel/process.c8
-rw-r--r--arch/mips/kernel/ptrace.c12
-rw-r--r--arch/mips/kernel/r2300_switch.S4
-rw-r--r--arch/mips/kernel/r4k_fpu.S4
-rw-r--r--arch/mips/kernel/r4k_switch.S8
-rw-r--r--arch/mips/kernel/reset.c5
-rw-r--r--arch/mips/kernel/setup.c4
-rw-r--r--arch/mips/kernel/signal.c11
-rw-r--r--arch/mips/kernel/signal32.c15
-rw-r--r--arch/mips/kernel/traps.c2
-rw-r--r--arch/mips/kernel/unaligned.c12
-rw-r--r--arch/mips/kernel/vmlinux.lds.S2
-rw-r--r--arch/mips/lasat/at93c.c16
-rw-r--r--arch/mips/lasat/at93c.h4
-rw-r--r--arch/mips/lasat/ds1603.c12
-rw-r--r--arch/mips/lasat/ds1603.h6
-rw-r--r--arch/mips/lasat/image/Makefile2
-rw-r--r--arch/mips/lasat/image/head.S2
-rw-r--r--arch/mips/lasat/interrupt.c4
-rw-r--r--arch/mips/lasat/lasat_board.c8
-rw-r--r--arch/mips/lasat/picvue.c12
-rw-r--r--arch/mips/lasat/picvue.h4
-rw-r--r--arch/mips/lasat/picvue_proc.c10
-rw-r--r--arch/mips/lasat/prom.c2
-rw-r--r--arch/mips/lasat/reset.c2
-rw-r--r--arch/mips/lasat/setup.c4
-rw-r--r--arch/mips/lasat/sysctl.c26
-rw-r--r--arch/mips/lib-32/Makefile2
-rw-r--r--arch/mips/lib-64/Makefile2
-rw-r--r--arch/mips/lib/memcpy.S6
-rw-r--r--arch/mips/math-emu/cp1emu.c12
-rw-r--r--arch/mips/math-emu/kernel_linkage.c2
-rw-r--r--arch/mips/mips-boards/atlas/atlas_int.c2
-rw-r--r--arch/mips/mips-boards/generic/init.c6
-rw-r--r--arch/mips/mips-boards/generic/time.c2
-rw-r--r--arch/mips/mips-boards/malta/malta_setup.c6
-rw-r--r--arch/mips/mm/Makefile4
-rw-r--r--arch/mips/mm/c-r4k.c20
-rw-r--r--arch/mips/mm/c-sb1.c2
-rw-r--r--arch/mips/mm/cerr-sb1.c24
-rw-r--r--arch/mips/mm/dma-noncoherent.c10
-rw-r--r--arch/mips/mm/init.c8
-rw-r--r--arch/mips/mm/pg-sb1.c10
-rw-r--r--arch/mips/mm/tlbex.c30
-rw-r--r--arch/mips/momentum/jaguar_atx/int-handler.S12
-rw-r--r--arch/mips/momentum/jaguar_atx/prom.c12
-rw-r--r--arch/mips/momentum/jaguar_atx/reset.c2
-rw-r--r--arch/mips/momentum/jaguar_atx/setup.c4
-rw-r--r--arch/mips/momentum/ocelot_3/prom.c12
-rw-r--r--arch/mips/momentum/ocelot_c/int-handler.S8
-rw-r--r--arch/mips/momentum/ocelot_c/ocelot_c_fpga.h2
-rw-r--r--arch/mips/momentum/ocelot_c/prom.c14
-rw-r--r--arch/mips/momentum/ocelot_c/reset.c2
-rw-r--r--arch/mips/momentum/ocelot_c/setup.c8
-rw-r--r--arch/mips/pci/fixup-ddb5074.c2
-rw-r--r--arch/mips/pci/fixup-ddb5477.c2
-rw-r--r--arch/mips/pci/fixup-malta.c2
-rw-r--r--arch/mips/pci/fixup-rbtx4927.c2
-rw-r--r--arch/mips/pci/fixup-sni.c2
-rw-r--r--arch/mips/pci/fixup-tb0219.c15
-rw-r--r--arch/mips/pci/ops-ddb5477.c4
-rw-r--r--arch/mips/pci/ops-tx4927.c6
-rw-r--r--arch/mips/pci/pci-ddb5477.c8
-rw-r--r--arch/mips/pci/pci-ip32.c2
-rw-r--r--arch/mips/pci/pci.c21
-rw-r--r--arch/mips/pmc-sierra/yosemite/atmel_read_eeprom.c14
-rw-r--r--arch/mips/pmc-sierra/yosemite/atmel_read_eeprom.h4
-rw-r--r--arch/mips/qemu/Makefile5
-rw-r--r--arch/mips/qemu/q-firmware.c7
-rw-r--r--arch/mips/qemu/q-int.S17
-rw-r--r--arch/mips/qemu/q-irq.c37
-rw-r--r--arch/mips/qemu/q-mem.c6
-rw-r--r--arch/mips/qemu/q-setup.c20
-rw-r--r--arch/mips/sgi-ip22/ip22-eisa.c2
-rw-r--r--arch/mips/sgi-ip22/ip22-hpc.c2
-rw-r--r--arch/mips/sgi-ip22/ip22-int.c12
-rw-r--r--arch/mips/sgi-ip22/ip22-nvram.c8
-rw-r--r--arch/mips/sgi-ip22/ip22-reset.c2
-rw-r--r--arch/mips/sgi-ip22/ip22-time.c2
-rw-r--r--arch/mips/sgi-ip27/ip27-memory.c2
-rw-r--r--arch/mips/sgi-ip32/ip32-reset.c2
-rw-r--r--arch/mips/sibyte/cfe/cfe_error.h10
-rw-r--r--arch/mips/sibyte/cfe/console.c2
-rw-r--r--arch/mips/sibyte/cfe/setup.c4
-rw-r--r--arch/mips/sibyte/cfe/smp.c2
-rw-r--r--arch/mips/sibyte/sb1250/bus_watcher.c6
-rw-r--r--arch/mips/sibyte/sb1250/irq.c4
-rw-r--r--arch/mips/sibyte/swarm/rtc_m41t81.c10
-rw-r--r--arch/mips/sibyte/swarm/setup.c4
-rw-r--r--arch/mips/sni/irq.c2
-rw-r--r--arch/mips/sni/setup.c2
-rw-r--r--arch/mips/tx4927/common/tx4927_irq_handler.S6
-rw-r--r--arch/mips/tx4927/common/tx4927_setup.c2
-rw-r--r--arch/mips/tx4927/toshiba_rbtx4927/Makefile6
-rw-r--r--arch/mips/tx4927/toshiba_rbtx4927/toshiba_rbtx4927_irq.c42
-rw-r--r--arch/mips/tx4927/toshiba_rbtx4927/toshiba_rbtx4927_setup.c2
-rw-r--r--arch/mips/vr4181/common/Makefile7
-rw-r--r--arch/mips/vr4181/common/int_handler.S206
-rw-r--r--arch/mips/vr4181/common/irq.c239
-rw-r--r--arch/mips/vr4181/common/serial.c51
-rw-r--r--arch/mips/vr4181/common/time.c145
-rw-r--r--arch/mips/vr4181/osprey/Makefile7
-rw-r--r--arch/mips/vr4181/osprey/dbg_io.c136
-rw-r--r--arch/mips/vr4181/osprey/prom.c49
-rw-r--r--arch/mips/vr4181/osprey/reset.c40
-rw-r--r--arch/mips/vr4181/osprey/setup.c68
-rw-r--r--arch/mips/vr41xx/casio-e55/setup.c5
-rw-r--r--arch/mips/vr41xx/common/Makefile2
-rw-r--r--arch/mips/vr41xx/common/giu.c455
-rw-r--r--arch/mips/vr41xx/common/icu.c270
-rw-r--r--arch/mips/vr41xx/common/int-handler.S10
-rw-r--r--arch/mips/vr41xx/common/irq.c94
-rw-r--r--arch/mips/vr41xx/common/type.c (renamed from arch/mips/vr41xx/tanbac-tb0226/setup.c)6
-rw-r--r--arch/mips/vr41xx/common/vrc4173.c2
-rw-r--r--arch/mips/vr41xx/ibm-workpad/setup.c5
-rw-r--r--arch/mips/vr41xx/nec-cmbvr4133/init.c12
-rw-r--r--arch/mips/vr41xx/tanbac-tb0226/Makefile5
-rw-r--r--arch/mips/vr41xx/tanbac-tb0229/Makefile5
-rw-r--r--arch/mips/vr41xx/tanbac-tb0229/setup.c27
-rw-r--r--arch/mips/vr41xx/victor-mpc30x/Makefile5
-rw-r--r--arch/mips/vr41xx/victor-mpc30x/setup.c24
-rw-r--r--arch/mips/vr41xx/zao-capcella/Makefile5
-rw-r--r--arch/mips/vr41xx/zao-capcella/setup.c24
-rw-r--r--arch/parisc/Kconfig2
-rw-r--r--arch/parisc/kernel/pci.c18
-rw-r--r--arch/parisc/kernel/process.c6
-rw-r--r--arch/parisc/kernel/signal.c11
-rw-r--r--arch/parisc/mm/fault.c12
-rw-r--r--arch/ppc/8xx_io/Kconfig4
-rw-r--r--arch/ppc/8xx_io/commproc.c20
-rw-r--r--arch/ppc/8xx_io/fec.c43
-rw-r--r--arch/ppc/Kconfig100
-rw-r--r--arch/ppc/Kconfig.debug3
-rw-r--r--arch/ppc/Makefile11
-rw-r--r--arch/ppc/boot/images/Makefile7
-rw-r--r--arch/ppc/boot/simple/Makefile25
-rw-r--r--arch/ppc/boot/simple/embed_config.c55
-rw-r--r--arch/ppc/boot/simple/head.S9
-rw-r--r--arch/ppc/boot/simple/misc-cpci690.c42
-rw-r--r--arch/ppc/boot/simple/misc-ev64360.c44
-rw-r--r--arch/ppc/boot/simple/misc-katana.c8
-rw-r--r--arch/ppc/boot/simple/misc-mv64x60.c27
-rw-r--r--arch/ppc/boot/simple/mv64x60_tty.c7
-rw-r--r--arch/ppc/boot/simple/pibs.c4
-rw-r--r--arch/ppc/boot/utils/addRamDisk.c203
-rw-r--r--arch/ppc/configs/SM850_defconfig522
-rw-r--r--arch/ppc/configs/SPD823TS_defconfig520
-rw-r--r--arch/ppc/configs/adir_defconfig805
-rw-r--r--arch/ppc/configs/ash_defconfig666
-rw-r--r--arch/ppc/configs/bamboo_defconfig (renamed from arch/ppc/configs/pcore_defconfig)593
-rw-r--r--arch/ppc/configs/beech_defconfig615
-rw-r--r--arch/ppc/configs/cedar_defconfig534
-rw-r--r--arch/ppc/configs/common_defconfig781
-rw-r--r--arch/ppc/configs/cpci690_defconfig316
-rw-r--r--arch/ppc/configs/ev64360_defconfig (renamed from arch/ppc/configs/k2_defconfig)616
-rw-r--r--arch/ppc/configs/katana_defconfig336
-rw-r--r--arch/ppc/configs/mcpn765_defconfig579
-rw-r--r--arch/ppc/configs/menf1_defconfig621
-rw-r--r--arch/ppc/configs/mpc8560_ads_defconfig273
-rw-r--r--arch/ppc/configs/oak_defconfig485
-rw-r--r--arch/ppc/configs/pmac_defconfig542
-rw-r--r--arch/ppc/configs/radstone_ppc7d_defconfig234
-rw-r--r--arch/ppc/configs/rainier_defconfig599
-rw-r--r--arch/ppc/configs/redwood_defconfig540
-rw-r--r--arch/ppc/configs/sandpoint_defconfig2
-rw-r--r--arch/ppc/kernel/cpu_setup_6xx.S9
-rw-r--r--arch/ppc/kernel/cputable.c96
-rw-r--r--arch/ppc/kernel/entry.S1
-rw-r--r--arch/ppc/kernel/find_name.c48
-rw-r--r--arch/ppc/kernel/head_44x.S28
-rw-r--r--arch/ppc/kernel/head_4xx.S4
-rw-r--r--arch/ppc/kernel/head_8xx.S12
-rw-r--r--arch/ppc/kernel/head_fsl_booke.S5
-rw-r--r--arch/ppc/kernel/l2cr.S31
-rw-r--r--arch/ppc/kernel/machine_kexec.c6
-rw-r--r--arch/ppc/kernel/misc.S4
-rw-r--r--arch/ppc/kernel/pci.c15
-rw-r--r--arch/ppc/kernel/ppc_ksyms.c6
-rw-r--r--arch/ppc/kernel/setup.c34
-rw-r--r--arch/ppc/kernel/signal.c11
-rw-r--r--arch/ppc/kernel/traps.c19
-rw-r--r--arch/ppc/mm/init.c8
-rw-r--r--arch/ppc/platforms/4xx/Kconfig49
-rw-r--r--arch/ppc/platforms/4xx/Makefile4
-rw-r--r--arch/ppc/platforms/4xx/ash.c250
-rw-r--r--arch/ppc/platforms/4xx/ash.h83
-rw-r--r--arch/ppc/platforms/4xx/bamboo.c456
-rw-r--r--arch/ppc/platforms/4xx/bamboo.h136
-rw-r--r--arch/ppc/platforms/4xx/ebony.c13
-rw-r--r--arch/ppc/platforms/4xx/ebony.h13
-rw-r--r--arch/ppc/platforms/4xx/ibm405ep.c1
-rw-r--r--arch/ppc/platforms/4xx/ibm405gp.c1
-rw-r--r--arch/ppc/platforms/4xx/ibm405gpr.c1
-rw-r--r--arch/ppc/platforms/4xx/ibm440ep.c221
-rw-r--r--arch/ppc/platforms/4xx/ibm440ep.h76
-rw-r--r--arch/ppc/platforms/4xx/ibm440gp.c1
-rw-r--r--arch/ppc/platforms/4xx/ibm440gx.c1
-rw-r--r--arch/ppc/platforms/4xx/ibm440sp.c5
-rw-r--r--arch/ppc/platforms/4xx/ibmnp405h.c7
-rw-r--r--arch/ppc/platforms/4xx/ibmstb4.c52
-rw-r--r--arch/ppc/platforms/4xx/ibmstb4.h4
-rw-r--r--arch/ppc/platforms/4xx/luan.c7
-rw-r--r--arch/ppc/platforms/4xx/luan.h2
-rw-r--r--arch/ppc/platforms/4xx/oak.c255
-rw-r--r--arch/ppc/platforms/4xx/oak.h96
-rw-r--r--arch/ppc/platforms/4xx/oak_setup.h50
-rw-r--r--arch/ppc/platforms/4xx/ocotea.c11
-rw-r--r--arch/ppc/platforms/4xx/ocotea.h13
-rw-r--r--arch/ppc/platforms/4xx/redwood5.c13
-rw-r--r--arch/ppc/platforms/83xx/mpc834x_sys.c35
-rw-r--r--arch/ppc/platforms/83xx/mpc834x_sys.h40
-rw-r--r--arch/ppc/platforms/85xx/mpc8560_ads.c1
-rw-r--r--arch/ppc/platforms/85xx/mpc85xx_cds_common.c2
-rw-r--r--arch/ppc/platforms/85xx/stx_gp3.c3
-rw-r--r--arch/ppc/platforms/Makefile6
-rw-r--r--arch/ppc/platforms/adir.h95
-rw-r--r--arch/ppc/platforms/adir_pci.c247
-rw-r--r--arch/ppc/platforms/adir_pic.c130
-rw-r--r--arch/ppc/platforms/adir_setup.c210
-rw-r--r--arch/ppc/platforms/cpci690.c177
-rw-r--r--arch/ppc/platforms/cpci690.h2
-rw-r--r--arch/ppc/platforms/ev64360.c510
-rw-r--r--arch/ppc/platforms/ev64360.h116
-rw-r--r--arch/ppc/platforms/k2.c613
-rw-r--r--arch/ppc/platforms/k2.h82
-rw-r--r--arch/ppc/platforms/katana.c253
-rw-r--r--arch/ppc/platforms/katana.h16
-rw-r--r--arch/ppc/platforms/mcpn765.c527
-rw-r--r--arch/ppc/platforms/mcpn765.h122
-rw-r--r--arch/ppc/platforms/pcore.c352
-rw-r--r--arch/ppc/platforms/pcore.h39
-rw-r--r--arch/ppc/platforms/pmac_pic.c2
-rw-r--r--arch/ppc/platforms/pmac_setup.c16
-rw-r--r--arch/ppc/platforms/prpmc750.c1
-rw-r--r--arch/ppc/platforms/sandpoint.c17
-rw-r--r--arch/ppc/platforms/spd8xx.h92
-rw-r--r--arch/ppc/platforms/tqm8260_setup.c2
-rw-r--r--arch/ppc/platforms/tqm8xx.h23
-rw-r--r--arch/ppc/syslib/Makefile14
-rw-r--r--arch/ppc/syslib/cpm2_common.c1
-rw-r--r--arch/ppc/syslib/ibm440gx_common.c15
-rw-r--r--arch/ppc/syslib/ibm44x_common.h4
-rw-r--r--arch/ppc/syslib/m8260_setup.c3
-rw-r--r--arch/ppc/syslib/m82xx_pci.c6
-rw-r--r--arch/ppc/syslib/m8xx_setup.c14
-rw-r--r--arch/ppc/syslib/mpc10x_common.c53
-rw-r--r--arch/ppc/syslib/mpc83xx_devices.c8
-rw-r--r--arch/ppc/syslib/mv64360_pic.c31
-rw-r--r--arch/ppc/syslib/mv64x60.c246
-rw-r--r--arch/ppc/syslib/of_device.c2
-rw-r--r--arch/ppc/syslib/open_pic.c2
-rw-r--r--arch/ppc/syslib/ppc4xx_dma.c10
-rw-r--r--arch/ppc/syslib/ppc4xx_setup.c27
-rw-r--r--arch/ppc/syslib/ppc83xx_pci.h151
-rw-r--r--arch/ppc/syslib/ppc83xx_setup.c250
-rw-r--r--arch/ppc/syslib/ppc83xx_setup.h19
-rw-r--r--arch/ppc/syslib/ppc85xx_setup.c4
-rw-r--r--arch/ppc/syslib/ppc_sys.c52
-rw-r--r--arch/ppc/syslib/pq2_devices.c389
-rw-r--r--arch/ppc/syslib/pq2_sys.c200
-rw-r--r--arch/ppc64/Kconfig77
-rw-r--r--arch/ppc64/Kconfig.debug9
-rw-r--r--arch/ppc64/Makefile9
-rw-r--r--arch/ppc64/boot/Makefile4
-rw-r--r--arch/ppc64/boot/addnote.c4
-rw-r--r--arch/ppc64/boot/crt0.S2
-rw-r--r--arch/ppc64/boot/div64.S2
-rw-r--r--arch/ppc64/boot/elf.h149
-rw-r--r--arch/ppc64/boot/main.c55
-rw-r--r--arch/ppc64/boot/page.h34
-rw-r--r--arch/ppc64/boot/ppc32-types.h36
-rw-r--r--arch/ppc64/boot/ppc_asm.h62
-rw-r--r--arch/ppc64/boot/prom.c196
-rw-r--r--arch/ppc64/boot/prom.h18
-rw-r--r--arch/ppc64/boot/stdio.h16
-rw-r--r--arch/ppc64/boot/string.S2
-rw-r--r--arch/ppc64/boot/string.h16
-rw-r--r--arch/ppc64/boot/zlib.c5
-rw-r--r--arch/ppc64/configs/bpa_defconfig987
-rw-r--r--arch/ppc64/configs/g5_defconfig375
-rw-r--r--arch/ppc64/configs/iSeries_defconfig325
-rw-r--r--arch/ppc64/configs/maple_defconfig221
-rw-r--r--arch/ppc64/configs/pSeries_defconfig381
-rw-r--r--arch/ppc64/defconfig386
-rw-r--r--arch/ppc64/kernel/LparData.c50
-rw-r--r--arch/ppc64/kernel/Makefile12
-rw-r--r--arch/ppc64/kernel/asm-offsets.c3
-rw-r--r--arch/ppc64/kernel/cpu_setup_power4.S38
-rw-r--r--arch/ppc64/kernel/cputable.c53
-rw-r--r--arch/ppc64/kernel/firmware.c47
-rw-r--r--arch/ppc64/kernel/head.S557
-rw-r--r--arch/ppc64/kernel/iSeries_htab.c52
-rw-r--r--arch/ppc64/kernel/iSeries_setup.c48
-rw-r--r--arch/ppc64/kernel/iSeries_vio.c155
-rw-r--r--arch/ppc64/kernel/iommu.c7
-rw-r--r--arch/ppc64/kernel/lmb.c151
-rw-r--r--arch/ppc64/kernel/lparcfg.c7
-rw-r--r--arch/ppc64/kernel/lparmap.c31
-rw-r--r--arch/ppc64/kernel/machine_kexec.c12
-rw-r--r--arch/ppc64/kernel/misc.S104
-rw-r--r--arch/ppc64/kernel/mpic.c4
-rw-r--r--arch/ppc64/kernel/mpic.h2
-rw-r--r--arch/ppc64/kernel/of_device.c2
-rw-r--r--arch/ppc64/kernel/pSeries_iommu.c3
-rw-r--r--arch/ppc64/kernel/pSeries_lpar.c53
-rw-r--r--arch/ppc64/kernel/pSeries_setup.c39
-rw-r--r--arch/ppc64/kernel/pSeries_smp.c3
-rw-r--r--arch/ppc64/kernel/pSeries_vio.c273
-rw-r--r--arch/ppc64/kernel/pacaData.c5
-rw-r--r--arch/ppc64/kernel/pci.c20
-rw-r--r--arch/ppc64/kernel/pmac_setup.c14
-rw-r--r--arch/ppc64/kernel/pmc.c21
-rw-r--r--arch/ppc64/kernel/process.c12
-rw-r--r--arch/ppc64/kernel/prom.c186
-rw-r--r--arch/ppc64/kernel/prom_init.c95
-rw-r--r--arch/ppc64/kernel/rtas_pci.c19
-rw-r--r--arch/ppc64/kernel/rtasd.c10
-rw-r--r--arch/ppc64/kernel/rtc.c7
-rw-r--r--arch/ppc64/kernel/scanlog.c17
-rw-r--r--arch/ppc64/kernel/setup.c35
-rw-r--r--arch/ppc64/kernel/signal.c5
-rw-r--r--arch/ppc64/kernel/signal32.c5
-rw-r--r--arch/ppc64/kernel/smp.c15
-rw-r--r--arch/ppc64/kernel/sysfs.c57
-rw-r--r--arch/ppc64/kernel/time.c7
-rw-r--r--arch/ppc64/kernel/udbg.c2
-rw-r--r--arch/ppc64/kernel/vio.c444
-rw-r--r--arch/ppc64/kernel/xics.c31
-rw-r--r--arch/ppc64/mm/hash_low.S12
-rw-r--r--arch/ppc64/mm/hash_native.c130
-rw-r--r--arch/ppc64/mm/hash_utils.c20
-rw-r--r--arch/ppc64/mm/hugetlbpage.c404
-rw-r--r--arch/ppc64/mm/imalloc.c2
-rw-r--r--arch/ppc64/mm/init.c118
-rw-r--r--arch/ppc64/mm/numa.c52
-rw-r--r--arch/ppc64/mm/slb_low.S35
-rw-r--r--arch/ppc64/mm/stab.c35
-rw-r--r--arch/ppc64/mm/tlb.c95
-rw-r--r--arch/ppc64/oprofile/common.c1
-rw-r--r--arch/ppc64/xmon/start.c2
-rw-r--r--arch/ppc64/xmon/xmon.c29
-rw-r--r--arch/s390/Kconfig4
-rw-r--r--arch/s390/appldata/appldata_base.c6
-rw-r--r--arch/s390/defconfig253
-rw-r--r--arch/s390/kernel/compat_linux.c38
-rw-r--r--arch/s390/kernel/compat_signal.c11
-rw-r--r--arch/s390/kernel/compat_wrapper.S30
-rw-r--r--arch/s390/kernel/cpcmd.c8
-rw-r--r--arch/s390/kernel/debug.c52
-rw-r--r--arch/s390/kernel/entry.S122
-rw-r--r--arch/s390/kernel/entry64.S123
-rw-r--r--arch/s390/kernel/head.S16
-rw-r--r--arch/s390/kernel/head64.S12
-rw-r--r--arch/s390/kernel/machine_kexec.c7
-rw-r--r--arch/s390/kernel/relocate_kernel.S41
-rw-r--r--arch/s390/kernel/relocate_kernel64.S45
-rw-r--r--arch/s390/kernel/s390_ext.c16
-rw-r--r--arch/s390/kernel/setup.c12
-rw-r--r--arch/s390/kernel/signal.c11
-rw-r--r--arch/s390/kernel/smp.c16
-rw-r--r--arch/s390/kernel/syscalls.S5
-rw-r--r--arch/s390/kernel/traps.c15
-rw-r--r--arch/s390/lib/Makefile4
-rw-r--r--arch/s390/lib/spinlock.c133
-rw-r--r--arch/s390/mm/fault.c5
-rw-r--r--arch/sh/Kconfig2
-rw-r--r--arch/sh/kernel/entry.S5
-rw-r--r--arch/sh/kernel/process.c6
-rw-r--r--arch/sh/kernel/signal.c13
-rw-r--r--arch/sh64/Kconfig6
-rw-r--r--arch/sh64/kernel/signal.c13
-rw-r--r--arch/sh64/kernel/syscalls.S5
-rw-r--r--arch/sh64/mm/fault.c6
-rw-r--r--arch/sparc/Kconfig2
-rw-r--r--arch/sparc/kernel/process.c6
-rw-r--r--arch/sparc/kernel/setup.c1
-rw-r--r--arch/sparc/kernel/signal.c11
-rw-r--r--arch/sparc/kernel/sparc_ksyms.c6
-rw-r--r--arch/sparc/kernel/systbls.S4
-rw-r--r--arch/sparc/kernel/tick14.c1
-rw-r--r--arch/sparc/kernel/time.c1
-rw-r--r--arch/sparc/mm/fault.c1
-rw-r--r--arch/sparc/mm/generic.c57
-rw-r--r--arch/sparc/mm/init.c1
-rw-r--r--arch/sparc64/Kconfig324
-rw-r--r--arch/sparc64/kernel/Makefile2
-rw-r--r--arch/sparc64/kernel/entry.S619
-rw-r--r--arch/sparc64/kernel/head.S3
-rw-r--r--arch/sparc64/kernel/irq.c20
-rw-r--r--arch/sparc64/kernel/pci.c4
-rw-r--r--arch/sparc64/kernel/pci_iommu.c2
-rw-r--r--arch/sparc64/kernel/power.c2
-rw-r--r--arch/sparc64/kernel/process.c8
-rw-r--r--arch/sparc64/kernel/rtrap.S13
-rw-r--r--arch/sparc64/kernel/sbus.c2
-rw-r--r--arch/sparc64/kernel/setup.c13
-rw-r--r--arch/sparc64/kernel/signal.c11
-rw-r--r--arch/sparc64/kernel/signal32.c33
-rw-r--r--arch/sparc64/kernel/smp.c36
-rw-r--r--arch/sparc64/kernel/sparc64_ksyms.c35
-rw-r--r--arch/sparc64/kernel/systbls.S8
-rw-r--r--arch/sparc64/kernel/traps.c274
-rw-r--r--arch/sparc64/kernel/ttable.S27
-rw-r--r--arch/sparc64/kernel/una_asm.S153
-rw-r--r--arch/sparc64/kernel/unaligned.c279
-rw-r--r--arch/sparc64/kernel/us2e_cpufreq.c36
-rw-r--r--arch/sparc64/kernel/us3_cpufreq.c29
-rw-r--r--arch/sparc64/kernel/winfixup.S6
-rw-r--r--arch/sparc64/lib/Makefile2
-rw-r--r--arch/sparc64/lib/PeeCeeI.c77
-rw-r--r--arch/sparc64/lib/copy_page.S13
-rw-r--r--arch/sparc64/lib/debuglocks.c56
-rw-r--r--arch/sparc64/lib/mb.S73
-rw-r--r--arch/sparc64/mm/generic.c31
-rw-r--r--arch/sparc64/mm/init.c23
-rw-r--r--arch/sparc64/mm/ultra.S39
-rw-r--r--arch/sparc64/solaris/misc.c6
-rw-r--r--arch/sparc64/solaris/socket.c193
-rw-r--r--arch/um/Kconfig14
-rw-r--r--arch/um/Kconfig.char (renamed from arch/um/Kconfig_char)0
-rw-r--r--arch/um/Kconfig.debug11
-rw-r--r--arch/um/Kconfig.i386 (renamed from arch/um/Kconfig_i386)4
-rw-r--r--arch/um/Kconfig.net (renamed from arch/um/Kconfig_net)14
-rw-r--r--arch/um/Kconfig.scsi (renamed from arch/um/Kconfig_scsi)0
-rw-r--r--arch/um/Kconfig.x86_64 (renamed from arch/um/Kconfig_x86_64)8
-rw-r--r--arch/um/Makefile44
-rw-r--r--arch/um/Makefile-i38630
-rw-r--r--arch/um/Makefile-x86_648
-rw-r--r--arch/um/drivers/Makefile21
-rw-r--r--arch/um/drivers/chan_user.c11
-rw-r--r--arch/um/drivers/cow.h4
-rw-r--r--arch/um/drivers/hostaudio_kern.c4
-rw-r--r--arch/um/drivers/mconsole_kern.c2
-rw-r--r--arch/um/drivers/mmapper_kern.c41
-rw-r--r--arch/um/drivers/ubd_kern.c570
-rw-r--r--arch/um/include/aio.h40
-rw-r--r--arch/um/include/init.h10
-rw-r--r--arch/um/include/irq_kern.h3
-rw-r--r--arch/um/include/os.h15
-rw-r--r--arch/um/include/syscall.h12
-rw-r--r--arch/um/include/syscall_user.h23
-rw-r--r--arch/um/include/sysdep-i386/syscalls.h2
-rw-r--r--arch/um/include/sysdep-x86_64/ptrace.h2
-rw-r--r--arch/um/include/sysdep-x86_64/syscalls.h2
-rw-r--r--arch/um/include/tlb.h22
-rw-r--r--arch/um/include/user_util.h8
-rw-r--r--arch/um/kernel/Makefile15
-rw-r--r--arch/um/kernel/exitcode.c2
-rw-r--r--arch/um/kernel/helper.c14
-rw-r--r--arch/um/kernel/irq.c41
-rw-r--r--arch/um/kernel/ksyms.c19
-rw-r--r--arch/um/kernel/main.c2
-rw-r--r--arch/um/kernel/process_kern.c2
-rw-r--r--arch/um/kernel/reboot.c6
-rw-r--r--arch/um/kernel/signal_kern.c6
-rw-r--r--arch/um/kernel/skas/Makefile2
-rw-r--r--arch/um/kernel/skas/include/mmu-skas.h4
-rw-r--r--arch/um/kernel/skas/include/skas.h30
-rw-r--r--arch/um/kernel/skas/mem_user.c224
-rw-r--r--arch/um/kernel/skas/mmu.c61
-rw-r--r--arch/um/kernel/skas/process.c77
-rw-r--r--arch/um/kernel/skas/process_kern.c7
-rw-r--r--arch/um/kernel/skas/syscall.c50
-rw-r--r--arch/um/kernel/skas/syscall_kern.c43
-rw-r--r--arch/um/kernel/skas/syscall_user.c44
-rw-r--r--arch/um/kernel/skas/tlb.c28
-rw-r--r--arch/um/kernel/skas/trap_user.c1
-rw-r--r--arch/um/kernel/syscall.c36
-rw-r--r--arch/um/kernel/syscall_user.c48
-rw-r--r--arch/um/kernel/time_kern.c5
-rw-r--r--arch/um/kernel/tlb.c267
-rw-r--r--arch/um/kernel/trap_kern.c55
-rw-r--r--arch/um/kernel/trap_user.c21
-rw-r--r--arch/um/kernel/tt/syscall_kern.c47
-rw-r--r--arch/um/kernel/tt/syscall_user.c35
-rw-r--r--arch/um/kernel/tt/tlb.c26
-rw-r--r--arch/um/kernel/um_arch.c27
-rw-r--r--arch/um/kernel/uml.lds.S4
-rw-r--r--arch/um/os-Linux/Makefile11
-rw-r--r--arch/um/os-Linux/aio.c414
-rw-r--r--arch/um/os-Linux/elf_aux.c4
-rw-r--r--arch/um/os-Linux/process.c58
-rw-r--r--arch/um/os-Linux/start_up.c (renamed from arch/um/kernel/process.c)279
-rw-r--r--arch/um/os-Linux/tt.c113
-rw-r--r--arch/um/os-Linux/user_syms.c3
-rw-r--r--arch/um/scripts/Makefile.unmap4
-rw-r--r--arch/um/sys-i386/Makefile8
-rw-r--r--arch/um/sys-i386/ldt.c114
-rw-r--r--arch/um/sys-i386/signal.c2
-rw-r--r--arch/um/sys-i386/stub.S47
-rw-r--r--arch/um/sys-i386/stub_segv.c9
-rw-r--r--arch/um/sys-i386/unmap.c2
-rw-r--r--arch/um/sys-x86_64/Makefile13
-rw-r--r--arch/um/sys-x86_64/signal.c43
-rw-r--r--arch/um/sys-x86_64/stub.S51
-rw-r--r--arch/um/sys-x86_64/stub_segv.c3
-rw-r--r--arch/um/sys-x86_64/unmap.c2
-rw-r--r--arch/v850/Kconfig4
-rw-r--r--arch/v850/Makefile7
-rw-r--r--arch/v850/README64
-rw-r--r--arch/v850/configs/rte-ma1-cb_defconfig617
-rw-r--r--arch/v850/configs/rte-me2-cb_defconfig462
-rw-r--r--arch/v850/configs/sim_defconfig451
-rw-r--r--arch/v850/kernel/anna.c6
-rw-r--r--arch/v850/kernel/as85ep1.c6
-rw-r--r--arch/v850/kernel/fpga85e2c.c6
-rw-r--r--arch/v850/kernel/rte_cb.c6
-rw-r--r--arch/v850/kernel/rte_mb_a_pci.c37
-rw-r--r--arch/v850/kernel/setup.c44
-rw-r--r--arch/v850/kernel/signal.c11
-rw-r--r--arch/v850/kernel/sim.c6
-rw-r--r--arch/v850/kernel/sim85e2.c5
-rw-r--r--arch/v850/kernel/vmlinux.lds.S19
-rw-r--r--arch/x86_64/Kconfig11
-rw-r--r--arch/x86_64/Makefile12
-rw-r--r--arch/x86_64/crypto/aes.c1
-rw-r--r--arch/x86_64/defconfig221
-rw-r--r--arch/x86_64/ia32/Makefile4
-rw-r--r--arch/x86_64/ia32/ia32_aout.c6
-rw-r--r--arch/x86_64/ia32/ia32entry.S8
-rw-r--r--arch/x86_64/ia32/ptrace32.c8
-rw-r--r--arch/x86_64/ia32/sys_ia32.c5
-rw-r--r--arch/x86_64/ia32/syscall32.c17
-rw-r--r--arch/x86_64/ia32/syscall32_syscall.S17
-rw-r--r--arch/x86_64/kernel/Makefile5
-rw-r--r--arch/x86_64/kernel/e820.c34
-rw-r--r--arch/x86_64/kernel/entry.S22
-rw-r--r--arch/x86_64/kernel/genapic.c33
-rw-r--r--arch/x86_64/kernel/genapic_flat.c142
-rw-r--r--arch/x86_64/kernel/head.S16
-rw-r--r--arch/x86_64/kernel/irq.c19
-rw-r--r--arch/x86_64/kernel/machine_kexec.c101
-rw-r--r--arch/x86_64/kernel/mce.c109
-rw-r--r--arch/x86_64/kernel/mpparse.c34
-rw-r--r--arch/x86_64/kernel/nmi.c2
-rw-r--r--arch/x86_64/kernel/reboot.c31
-rw-r--r--arch/x86_64/kernel/semaphore.c180
-rw-r--r--arch/x86_64/kernel/setup.c11
-rw-r--r--arch/x86_64/kernel/setup64.c18
-rw-r--r--arch/x86_64/kernel/signal.c5
-rw-r--r--arch/x86_64/kernel/smp.c66
-rw-r--r--arch/x86_64/kernel/smpboot.c109
-rw-r--r--arch/x86_64/kernel/traps.c3
-rw-r--r--arch/x86_64/kernel/vmlinux.lds.S4
-rw-r--r--arch/x86_64/lib/csum-copy.S2
-rw-r--r--arch/x86_64/lib/delay.c2
-rw-r--r--arch/x86_64/mm/fault.c11
-rw-r--r--arch/x86_64/mm/init.c16
-rw-r--r--arch/x86_64/mm/numa.c58
-rw-r--r--arch/x86_64/mm/srat.c22
-rw-r--r--arch/x86_64/pci/k8-bus.c15
-rw-r--r--arch/xtensa/Kconfig2
-rw-r--r--arch/xtensa/kernel/asm-offsets.c1
-rw-r--r--arch/xtensa/kernel/signal.c11
-rw-r--r--arch/xtensa/kernel/syscalls.c4
-rw-r--r--arch/xtensa/kernel/syscalls.h6
-rw-r--r--arch/xtensa/kernel/traps.c4
-rw-r--r--arch/xtensa/kernel/vmlinux.lds.S6
1017 files changed, 47921 insertions, 25555 deletions
diff --git a/arch/alpha/Kconfig b/arch/alpha/Kconfig
index c5739d6309df..189d5eababa8 100644
--- a/arch/alpha/Kconfig
+++ b/arch/alpha/Kconfig
@@ -522,7 +522,7 @@ source "mm/Kconfig"
522 522
523config NUMA 523config NUMA
524 bool "NUMA Support (EXPERIMENTAL)" 524 bool "NUMA Support (EXPERIMENTAL)"
525 depends on DISCONTIGMEM 525 depends on DISCONTIGMEM && BROKEN
526 help 526 help
527 Say Y to compile the kernel to support NUMA (Non-Uniform Memory 527 Say Y to compile the kernel to support NUMA (Non-Uniform Memory
528 Access). This option is for configuring high-end multiprocessor 528 Access). This option is for configuring high-end multiprocessor
@@ -596,6 +596,8 @@ source "fs/Kconfig.binfmt"
596 596
597endmenu 597endmenu
598 598
599source "net/Kconfig"
600
599source "drivers/Kconfig" 601source "drivers/Kconfig"
600 602
601source "fs/Kconfig" 603source "fs/Kconfig"
diff --git a/arch/alpha/kernel/pci.c b/arch/alpha/kernel/pci.c
index 1f36bbd0ed5d..2a8b364c822e 100644
--- a/arch/alpha/kernel/pci.c
+++ b/arch/alpha/kernel/pci.c
@@ -350,8 +350,24 @@ pcibios_resource_to_bus(struct pci_dev *dev, struct pci_bus_region *region,
350 region->end = res->end - offset; 350 region->end = res->end - offset;
351} 351}
352 352
353void pcibios_bus_to_resource(struct pci_dev *dev, struct resource *res,
354 struct pci_bus_region *region)
355{
356 struct pci_controller *hose = (struct pci_controller *)dev->sysdata;
357 unsigned long offset = 0;
358
359 if (res->flags & IORESOURCE_IO)
360 offset = hose->io_space->start;
361 else if (res->flags & IORESOURCE_MEM)
362 offset = hose->mem_space->start;
363
364 res->start = region->start + offset;
365 res->end = region->end + offset;
366}
367
353#ifdef CONFIG_HOTPLUG 368#ifdef CONFIG_HOTPLUG
354EXPORT_SYMBOL(pcibios_resource_to_bus); 369EXPORT_SYMBOL(pcibios_resource_to_bus);
370EXPORT_SYMBOL(pcibios_bus_to_resource);
355#endif 371#endif
356 372
357int 373int
diff --git a/arch/alpha/kernel/process.c b/arch/alpha/kernel/process.c
index 4933f3ce5833..fa98dae3cd98 100644
--- a/arch/alpha/kernel/process.c
+++ b/arch/alpha/kernel/process.c
@@ -165,7 +165,6 @@ machine_restart(char *restart_cmd)
165 common_shutdown(LINUX_REBOOT_CMD_RESTART, restart_cmd); 165 common_shutdown(LINUX_REBOOT_CMD_RESTART, restart_cmd);
166} 166}
167 167
168EXPORT_SYMBOL(machine_restart);
169 168
170void 169void
171machine_halt(void) 170machine_halt(void)
@@ -173,7 +172,6 @@ machine_halt(void)
173 common_shutdown(LINUX_REBOOT_CMD_HALT, NULL); 172 common_shutdown(LINUX_REBOOT_CMD_HALT, NULL);
174} 173}
175 174
176EXPORT_SYMBOL(machine_halt);
177 175
178void 176void
179machine_power_off(void) 177machine_power_off(void)
@@ -181,7 +179,6 @@ machine_power_off(void)
181 common_shutdown(LINUX_REBOOT_CMD_POWER_OFF, NULL); 179 common_shutdown(LINUX_REBOOT_CMD_POWER_OFF, NULL);
182} 180}
183 181
184EXPORT_SYMBOL(machine_power_off);
185 182
186/* Used by sysrq-p, among others. I don't believe r9-r15 are ever 183/* Used by sysrq-p, among others. I don't believe r9-r15 are ever
187 saved in the context it's used. */ 184 saved in the context it's used. */
diff --git a/arch/alpha/kernel/signal.c b/arch/alpha/kernel/signal.c
index 08fe8071a7f8..2e45e8604e32 100644
--- a/arch/alpha/kernel/signal.c
+++ b/arch/alpha/kernel/signal.c
@@ -566,13 +566,12 @@ handle_signal(int sig, struct k_sigaction *ka, siginfo_t *info,
566 if (ka->sa.sa_flags & SA_RESETHAND) 566 if (ka->sa.sa_flags & SA_RESETHAND)
567 ka->sa.sa_handler = SIG_DFL; 567 ka->sa.sa_handler = SIG_DFL;
568 568
569 if (!(ka->sa.sa_flags & SA_NODEFER)) { 569 spin_lock_irq(&current->sighand->siglock);
570 spin_lock_irq(&current->sighand->siglock); 570 sigorsets(&current->blocked,&current->blocked,&ka->sa.sa_mask);
571 sigorsets(&current->blocked,&current->blocked,&ka->sa.sa_mask); 571 if (!(ka->sa.sa_flags & SA_NODEFER))
572 sigaddset(&current->blocked,sig); 572 sigaddset(&current->blocked,sig);
573 recalc_sigpending(); 573 recalc_sigpending();
574 spin_unlock_irq(&current->sighand->siglock); 574 spin_unlock_irq(&current->sighand->siglock);
575 }
576} 575}
577 576
578static inline void 577static inline void
diff --git a/arch/alpha/kernel/smp.c b/arch/alpha/kernel/smp.c
index 8f1e78551b1e..e211aa7404e6 100644
--- a/arch/alpha/kernel/smp.c
+++ b/arch/alpha/kernel/smp.c
@@ -1036,7 +1036,7 @@ debug_spin_lock(spinlock_t * lock, const char *base_file, int line_no)
1036 " br 1b\n" 1036 " br 1b\n"
1037 ".previous" 1037 ".previous"
1038 : "=r" (tmp), "=m" (lock->lock), "=r" (stuck) 1038 : "=r" (tmp), "=m" (lock->lock), "=r" (stuck)
1039 : "1" (lock->lock), "2" (stuck) : "memory"); 1039 : "m" (lock->lock), "2" (stuck) : "memory");
1040 1040
1041 if (stuck < 0) { 1041 if (stuck < 0) {
1042 printk(KERN_WARNING 1042 printk(KERN_WARNING
@@ -1115,7 +1115,7 @@ void _raw_write_lock(rwlock_t * lock)
1115 ".previous" 1115 ".previous"
1116 : "=m" (*(volatile int *)lock), "=&r" (regx), "=&r" (regy), 1116 : "=m" (*(volatile int *)lock), "=&r" (regx), "=&r" (regy),
1117 "=&r" (stuck_lock), "=&r" (stuck_reader) 1117 "=&r" (stuck_lock), "=&r" (stuck_reader)
1118 : "0" (*(volatile int *)lock), "3" (stuck_lock), "4" (stuck_reader) : "memory"); 1118 : "m" (*(volatile int *)lock), "3" (stuck_lock), "4" (stuck_reader) : "memory");
1119 1119
1120 if (stuck_lock < 0) { 1120 if (stuck_lock < 0) {
1121 printk(KERN_WARNING "write_lock stuck at %p\n", inline_pc); 1121 printk(KERN_WARNING "write_lock stuck at %p\n", inline_pc);
@@ -1153,7 +1153,7 @@ void _raw_read_lock(rwlock_t * lock)
1153 " br 1b\n" 1153 " br 1b\n"
1154 ".previous" 1154 ".previous"
1155 : "=m" (*(volatile int *)lock), "=&r" (regx), "=&r" (stuck_lock) 1155 : "=m" (*(volatile int *)lock), "=&r" (regx), "=&r" (stuck_lock)
1156 : "0" (*(volatile int *)lock), "2" (stuck_lock) : "memory"); 1156 : "m" (*(volatile int *)lock), "2" (stuck_lock) : "memory");
1157 1157
1158 if (stuck_lock < 0) { 1158 if (stuck_lock < 0) {
1159 printk(KERN_WARNING "read_lock stuck at %p\n", inline_pc); 1159 printk(KERN_WARNING "read_lock stuck at %p\n", inline_pc);
diff --git a/arch/alpha/kernel/systbls.S b/arch/alpha/kernel/systbls.S
index 052120882876..4342cea1a926 100644
--- a/arch/alpha/kernel/systbls.S
+++ b/arch/alpha/kernel/systbls.S
@@ -461,6 +461,11 @@ sys_call_table:
461 .quad sys_add_key 461 .quad sys_add_key
462 .quad sys_request_key /* 440 */ 462 .quad sys_request_key /* 440 */
463 .quad sys_keyctl 463 .quad sys_keyctl
464 .quad sys_ioprio_set
465 .quad sys_ioprio_get
466 .quad sys_inotify_init
467 .quad sys_inotify_add_watch /* 445 */
468 .quad sys_inotify_rm_watch
464 469
465 .size sys_call_table, . - sys_call_table 470 .size sys_call_table, . - sys_call_table
466 .type sys_call_table, @object 471 .type sys_call_table, @object
diff --git a/arch/alpha/oprofile/common.c b/arch/alpha/oprofile/common.c
index 908eb4af8dec..ba788cfdc3c6 100644
--- a/arch/alpha/oprofile/common.c
+++ b/arch/alpha/oprofile/common.c
@@ -65,7 +65,7 @@ op_axp_setup(void)
65 model->reg_setup(&reg, ctr, &sys); 65 model->reg_setup(&reg, ctr, &sys);
66 66
67 /* Configure the registers on all cpus. */ 67 /* Configure the registers on all cpus. */
68 smp_call_function(model->cpu_setup, &reg, 0, 1); 68 (void)smp_call_function(model->cpu_setup, &reg, 0, 1);
69 model->cpu_setup(&reg); 69 model->cpu_setup(&reg);
70 return 0; 70 return 0;
71} 71}
@@ -86,7 +86,7 @@ op_axp_cpu_start(void *dummy)
86static int 86static int
87op_axp_start(void) 87op_axp_start(void)
88{ 88{
89 smp_call_function(op_axp_cpu_start, NULL, 0, 1); 89 (void)smp_call_function(op_axp_cpu_start, NULL, 0, 1);
90 op_axp_cpu_start(NULL); 90 op_axp_cpu_start(NULL);
91 return 0; 91 return 0;
92} 92}
@@ -101,7 +101,7 @@ op_axp_cpu_stop(void *dummy)
101static void 101static void
102op_axp_stop(void) 102op_axp_stop(void)
103{ 103{
104 smp_call_function(op_axp_cpu_stop, NULL, 0, 1); 104 (void)smp_call_function(op_axp_cpu_stop, NULL, 0, 1);
105 op_axp_cpu_stop(NULL); 105 op_axp_cpu_stop(NULL);
106} 106}
107 107
diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index 8752751f9985..68dfdba71d74 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -310,7 +310,7 @@ menu "Kernel Features"
310 310
311config SMP 311config SMP
312 bool "Symmetric Multi-Processing (EXPERIMENTAL)" 312 bool "Symmetric Multi-Processing (EXPERIMENTAL)"
313 depends on EXPERIMENTAL #&& n 313 depends on EXPERIMENTAL && BROKEN #&& n
314 help 314 help
315 This enables support for systems with more than one CPU. If you have 315 This enables support for systems with more than one CPU. If you have
316 a system with only one CPU, like most personal computers, say N. If 316 a system with only one CPU, like most personal computers, say N. If
@@ -365,8 +365,8 @@ config NO_IDLE_HZ
365 365
366 Please note that dynamic tick may affect the accuracy of 366 Please note that dynamic tick may affect the accuracy of
367 timekeeping on some platforms depending on the implementation. 367 timekeeping on some platforms depending on the implementation.
368 Currently at least OMAP platform is known to have accurate 368 Currently at least OMAP, PXA2xx and SA11x0 platforms are known
369 timekeeping with dynamic tick. 369 to have accurate timekeeping with dynamic tick.
370 370
371config ARCH_DISCONTIGMEM_ENABLE 371config ARCH_DISCONTIGMEM_ENABLE
372 bool 372 bool
@@ -635,10 +635,6 @@ config PM
635 and the Battery Powered Linux mini-HOWTO, available from 635 and the Battery Powered Linux mini-HOWTO, available from
636 <http://www.tldp.org/docs.html#howto>. 636 <http://www.tldp.org/docs.html#howto>.
637 637
638 Note that, even if you say N here, Linux on the x86 architecture
639 will issue the hlt instruction if nothing is to be done, thereby
640 sending the processor to sleep and saving power.
641
642config APM 638config APM
643 tristate "Advanced Power Management Emulation" 639 tristate "Advanced Power Management Emulation"
644 depends on PM 640 depends on PM
@@ -650,12 +646,6 @@ config APM
650 battery status information, and user-space programs will receive 646 battery status information, and user-space programs will receive
651 notification of APM "events" (e.g. battery status change). 647 notification of APM "events" (e.g. battery status change).
652 648
653 If you select "Y" here, you can disable actual use of the APM
654 BIOS by passing the "apm=off" option to the kernel at boot time.
655
656 Note that the APM support is almost completely disabled for
657 machines with more than one CPU.
658
659 In order to use APM, you will need supporting software. For location 649 In order to use APM, you will need supporting software. For location
660 and more information, read <file:Documentation/pm.txt> and the 650 and more information, read <file:Documentation/pm.txt> and the
661 Battery Powered Linux mini-HOWTO, available from 651 Battery Powered Linux mini-HOWTO, available from
@@ -665,41 +655,16 @@ config APM
665 manpage ("man 8 hdparm") for that), and it doesn't turn off 655 manpage ("man 8 hdparm") for that), and it doesn't turn off
666 VESA-compliant "green" monitors. 656 VESA-compliant "green" monitors.
667 657
668 This driver does not support the TI 4000M TravelMate and the ACER
669 486/DX4/75 because they don't have compliant BIOSes. Many "green"
670 desktop machines also don't have compliant BIOSes, and this driver
671 may cause those machines to panic during the boot phase.
672
673 Generally, if you don't have a battery in your machine, there isn't 658 Generally, if you don't have a battery in your machine, there isn't
674 much point in using this driver and you should say N. If you get 659 much point in using this driver and you should say N. If you get
675 random kernel OOPSes or reboots that don't seem to be related to 660 random kernel OOPSes or reboots that don't seem to be related to
676 anything, try disabling/enabling this option (or disabling/enabling 661 anything, try disabling/enabling this option (or disabling/enabling
677 APM in your BIOS). 662 APM in your BIOS).
678 663
679 Some other things you should try when experiencing seemingly random,
680 "weird" problems:
681
682 1) make sure that you have enough swap space and that it is
683 enabled.
684 2) pass the "no-hlt" option to the kernel
685 3) switch on floating point emulation in the kernel and pass
686 the "no387" option to the kernel
687 4) pass the "floppy=nodma" option to the kernel
688 5) pass the "mem=4M" option to the kernel (thereby disabling
689 all but the first 4 MB of RAM)
690 6) make sure that the CPU is not over clocked.
691 7) read the sig11 FAQ at <http://www.bitwizard.nl/sig11/>
692 8) disable the cache from your BIOS settings
693 9) install a fan for the video card or exchange video RAM
694 10) install a better fan for the CPU
695 11) exchange RAM chips
696 12) exchange the motherboard.
697
698 To compile this driver as a module, choose M here: the
699 module will be called apm.
700
701endmenu 664endmenu
702 665
666source "net/Kconfig"
667
703menu "Device Drivers" 668menu "Device Drivers"
704 669
705source "drivers/base/Kconfig" 670source "drivers/base/Kconfig"
@@ -732,7 +697,7 @@ source "drivers/ieee1394/Kconfig"
732 697
733source "drivers/message/i2o/Kconfig" 698source "drivers/message/i2o/Kconfig"
734 699
735source "net/Kconfig" 700source "drivers/net/Kconfig"
736 701
737source "drivers/isdn/Kconfig" 702source "drivers/isdn/Kconfig"
738 703
@@ -744,10 +709,14 @@ source "drivers/char/Kconfig"
744 709
745source "drivers/i2c/Kconfig" 710source "drivers/i2c/Kconfig"
746 711
712source "drivers/hwmon/Kconfig"
713
747#source "drivers/l3/Kconfig" 714#source "drivers/l3/Kconfig"
748 715
749source "drivers/misc/Kconfig" 716source "drivers/misc/Kconfig"
750 717
718source "drivers/mfd/Kconfig"
719
751source "drivers/media/Kconfig" 720source "drivers/media/Kconfig"
752 721
753source "drivers/video/Kconfig" 722source "drivers/video/Kconfig"
diff --git a/arch/arm/boot/compressed/head-shark.S b/arch/arm/boot/compressed/head-shark.S
index 848f60e5429b..089c560e07f1 100644
--- a/arch/arm/boot/compressed/head-shark.S
+++ b/arch/arm/boot/compressed/head-shark.S
@@ -63,8 +63,8 @@ __beginning: mov r4, r0 @ save the entry to the firmware
63 63
64 mov pc, r2 64 mov pc, r2
65 65
66__copy_target: .long 0x08508000 66__copy_target: .long 0x08507FFC
67__copy_end: .long 0x08608000 67__copy_end: .long 0x08607FFC
68 68
69 .word _start 69 .word _start
70 .word __bss_start 70 .word __bss_start
@@ -73,9 +73,10 @@ __copy_end: .long 0x08608000
73__temp_stack: .space 128 73__temp_stack: .space 128
74 74
75__mmu_off: 75__mmu_off:
76 adr r0, __ofw_data 76 adr r0, __ofw_data @ read the 1. entry of the memory map
77 ldr r0, [r0, #4] 77 ldr r0, [r0, #4]
78 orr r0, r0, #0x00600000 78 orr r0, r0, #0x00600000
79 sub r0, r0, #4
79 80
80 ldr r1, __copy_end 81 ldr r1, __copy_end
81 ldr r3, __copy_target 82 ldr r3, __copy_target
@@ -89,20 +90,43 @@ __mmu_off:
89 * from 0x08500000 to 0x08508000 if we have only 8MB 90 * from 0x08500000 to 0x08508000 if we have only 8MB
90 */ 91 */
91 92
93/* As we get more 2.6-kernels it gets more and more
94 * uncomfortable to be bound to kernel images of 1MB only.
95 * So we add a loop here, to be able to copy some more.
96 * Alexander Schulz 2005-07-17
97 */
98
99 mov r4, #3 @ How many megabytes to copy
100
101
102__MoveCode: sub r4, r4, #1
92 103
93__Copy: ldr r2, [r0], #-4 104__Copy: ldr r2, [r0], #-4
94 str r2, [r1], #-4 105 str r2, [r1], #-4
95 teq r1, r3 106 teq r1, r3
96 bne __Copy 107 bne __Copy
108
109 /* The firmware maps us in blocks of 1 MB, the next block is
110 _below_ the last one. So our decrementing source pointer
111 ist right here, but the destination pointer must be increased
112 by 2 MB */
113 add r1, r1, #0x00200000
114 add r3, r3, #0x00100000
115
116 teq r4, #0
117 bne __MoveCode
118
119
97 /* and jump to it */ 120 /* and jump to it */
98 adr r2, __go_on 121 adr r2, __go_on @ where we want to jump
99 adr r0, __ofw_data 122 adr r0, __ofw_data @ read the 1. entry of the memory map
100 ldr r0, [r0, #4] 123 ldr r0, [r0, #4]
101 sub r2, r2, r0 124 sub r2, r2, r0 @ we are mapped add 0e50 now, sub that (-0e00)
102 sub r2, r2, #0x00500000 125 sub r2, r2, #0x00500000 @ -0050
103 ldr r0, __copy_target 126 ldr r0, __copy_target @ and add 0850 8000 instead
127 add r0, r0, #4
104 add r2, r2, r0 128 add r2, r2, r0
105 mov pc, r2 129 mov pc, r2 @ and jump there
106 130
107__go_on: 131__go_on:
108 adr sp, __temp_stack 132 adr sp, __temp_stack
diff --git a/arch/arm/common/Kconfig b/arch/arm/common/Kconfig
index 692af6b5e8ff..666ba393575b 100644
--- a/arch/arm/common/Kconfig
+++ b/arch/arm/common/Kconfig
@@ -1,6 +1,9 @@
1config ICST525 1config ICST525
2 bool 2 bool
3 3
4config ARM_GIC
5 bool
6
4config ICST307 7config ICST307
5 bool 8 bool
6 9
diff --git a/arch/arm/common/Makefile b/arch/arm/common/Makefile
index 11f20a43ee3a..a87886564b19 100644
--- a/arch/arm/common/Makefile
+++ b/arch/arm/common/Makefile
@@ -4,6 +4,7 @@
4 4
5obj-y += rtctime.o 5obj-y += rtctime.o
6obj-$(CONFIG_ARM_AMBA) += amba.o 6obj-$(CONFIG_ARM_AMBA) += amba.o
7obj-$(CONFIG_ARM_GIC) += gic.o
7obj-$(CONFIG_ICST525) += icst525.o 8obj-$(CONFIG_ICST525) += icst525.o
8obj-$(CONFIG_ICST307) += icst307.o 9obj-$(CONFIG_ICST307) += icst307.o
9obj-$(CONFIG_SA1111) += sa1111.o 10obj-$(CONFIG_SA1111) += sa1111.o
diff --git a/arch/arm/common/gic.c b/arch/arm/common/gic.c
new file mode 100644
index 000000000000..d74990717559
--- /dev/null
+++ b/arch/arm/common/gic.c
@@ -0,0 +1,167 @@
1/*
2 * linux/arch/arm/common/gic.c
3 *
4 * Copyright (C) 2002 ARM Limited, All Rights Reserved.
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 * Interrupt architecture for the GIC:
11 *
12 * o There is one Interrupt Distributor, which receives interrupts
13 * from system devices and sends them to the Interrupt Controllers.
14 *
15 * o There is one CPU Interface per CPU, which sends interrupts sent
16 * by the Distributor, and interrupts generated locally, to the
17 * associated CPU.
18 *
19 * Note that IRQs 0-31 are special - they are local to each CPU.
20 * As such, the enable set/clear, pending set/clear and active bit
21 * registers are banked per-cpu for these sources.
22 */
23#include <linux/init.h>
24#include <linux/kernel.h>
25#include <linux/list.h>
26#include <linux/smp.h>
27#include <linux/cpumask.h>
28
29#include <asm/irq.h>
30#include <asm/io.h>
31#include <asm/mach/irq.h>
32#include <asm/hardware/gic.h>
33
34static void __iomem *gic_dist_base;
35static void __iomem *gic_cpu_base;
36
37/*
38 * Routines to acknowledge, disable and enable interrupts
39 *
40 * Linux assumes that when we're done with an interrupt we need to
41 * unmask it, in the same way we need to unmask an interrupt when
42 * we first enable it.
43 *
44 * The GIC has a seperate notion of "end of interrupt" to re-enable
45 * an interrupt after handling, in order to support hardware
46 * prioritisation.
47 *
48 * We can make the GIC behave in the way that Linux expects by making
49 * our "acknowledge" routine disable the interrupt, then mark it as
50 * complete.
51 */
52static void gic_ack_irq(unsigned int irq)
53{
54 u32 mask = 1 << (irq % 32);
55 writel(mask, gic_dist_base + GIC_DIST_ENABLE_CLEAR + (irq / 32) * 4);
56 writel(irq, gic_cpu_base + GIC_CPU_EOI);
57}
58
59static void gic_mask_irq(unsigned int irq)
60{
61 u32 mask = 1 << (irq % 32);
62 writel(mask, gic_dist_base + GIC_DIST_ENABLE_CLEAR + (irq / 32) * 4);
63}
64
65static void gic_unmask_irq(unsigned int irq)
66{
67 u32 mask = 1 << (irq % 32);
68 writel(mask, gic_dist_base + GIC_DIST_ENABLE_SET + (irq / 32) * 4);
69}
70
71static void gic_set_cpu(struct irqdesc *desc, unsigned int irq, unsigned int cpu)
72{
73 void __iomem *reg = gic_dist_base + GIC_DIST_TARGET + (irq & ~3);
74 unsigned int shift = (irq % 4) * 8;
75 u32 val;
76
77 val = readl(reg) & ~(0xff << shift);
78 val |= 1 << (cpu + shift);
79 writel(val, reg);
80}
81
82static struct irqchip gic_chip = {
83 .ack = gic_ack_irq,
84 .mask = gic_mask_irq,
85 .unmask = gic_unmask_irq,
86#ifdef CONFIG_SMP
87 .set_cpu = gic_set_cpu,
88#endif
89};
90
91void __init gic_dist_init(void __iomem *base)
92{
93 unsigned int max_irq, i;
94 u32 cpumask = 1 << smp_processor_id();
95
96 cpumask |= cpumask << 8;
97 cpumask |= cpumask << 16;
98
99 gic_dist_base = base;
100
101 writel(0, base + GIC_DIST_CTRL);
102
103 /*
104 * Find out how many interrupts are supported.
105 */
106 max_irq = readl(base + GIC_DIST_CTR) & 0x1f;
107 max_irq = (max_irq + 1) * 32;
108
109 /*
110 * The GIC only supports up to 1020 interrupt sources.
111 * Limit this to either the architected maximum, or the
112 * platform maximum.
113 */
114 if (max_irq > max(1020, NR_IRQS))
115 max_irq = max(1020, NR_IRQS);
116
117 /*
118 * Set all global interrupts to be level triggered, active low.
119 */
120 for (i = 32; i < max_irq; i += 16)
121 writel(0, base + GIC_DIST_CONFIG + i * 4 / 16);
122
123 /*
124 * Set all global interrupts to this CPU only.
125 */
126 for (i = 32; i < max_irq; i += 4)
127 writel(cpumask, base + GIC_DIST_TARGET + i * 4 / 4);
128
129 /*
130 * Set priority on all interrupts.
131 */
132 for (i = 0; i < max_irq; i += 4)
133 writel(0xa0a0a0a0, base + GIC_DIST_PRI + i * 4 / 4);
134
135 /*
136 * Disable all interrupts.
137 */
138 for (i = 0; i < max_irq; i += 32)
139 writel(0xffffffff, base + GIC_DIST_ENABLE_CLEAR + i * 4 / 32);
140
141 /*
142 * Setup the Linux IRQ subsystem.
143 */
144 for (i = 29; i < max_irq; i++) {
145 set_irq_chip(i, &gic_chip);
146 set_irq_handler(i, do_level_IRQ);
147 set_irq_flags(i, IRQF_VALID | IRQF_PROBE);
148 }
149
150 writel(1, base + GIC_DIST_CTRL);
151}
152
153void __cpuinit gic_cpu_init(void __iomem *base)
154{
155 gic_cpu_base = base;
156 writel(0xf0, base + GIC_CPU_PRIMASK);
157 writel(1, base + GIC_CPU_CTRL);
158}
159
160#ifdef CONFIG_SMP
161void gic_raise_softirq(cpumask_t cpumask, unsigned int irq)
162{
163 unsigned long map = *cpus_addr(cpumask);
164
165 writel(map << 16 | irq, gic_dist_base + GIC_DIST_SOFTINT);
166}
167#endif
diff --git a/arch/arm/common/locomo.c b/arch/arm/common/locomo.c
index 41f12658c8b4..51f430cc2fbf 100644
--- a/arch/arm/common/locomo.c
+++ b/arch/arm/common/locomo.c
@@ -177,7 +177,7 @@ static void locomo_handler(unsigned int irq, struct irqdesc *desc,
177 d = irq_desc + irq; 177 d = irq_desc + irq;
178 for (i = 0; i <= 3; i++, d++, irq++) { 178 for (i = 0; i <= 3; i++, d++, irq++) {
179 if (req & (0x0100 << i)) { 179 if (req & (0x0100 << i)) {
180 d->handle(irq, d, regs); 180 desc_handle_irq(irq, d, regs);
181 } 181 }
182 182
183 } 183 }
@@ -220,7 +220,7 @@ static void locomo_key_handler(unsigned int irq, struct irqdesc *desc,
220 220
221 if (locomo_readl(mapbase + LOCOMO_KEYBOARD + LOCOMO_KIC) & 0x0001) { 221 if (locomo_readl(mapbase + LOCOMO_KEYBOARD + LOCOMO_KIC) & 0x0001) {
222 d = irq_desc + LOCOMO_IRQ_KEY_START; 222 d = irq_desc + LOCOMO_IRQ_KEY_START;
223 d->handle(LOCOMO_IRQ_KEY_START, d, regs); 223 desc_handle_irq(LOCOMO_IRQ_KEY_START, d, regs);
224 } 224 }
225} 225}
226 226
@@ -273,7 +273,7 @@ static void locomo_gpio_handler(unsigned int irq, struct irqdesc *desc,
273 d = irq_desc + LOCOMO_IRQ_GPIO_START; 273 d = irq_desc + LOCOMO_IRQ_GPIO_START;
274 for (i = 0; i <= 15; i++, irq++, d++) { 274 for (i = 0; i <= 15; i++, irq++, d++) {
275 if (req & (0x0001 << i)) { 275 if (req & (0x0001 << i)) {
276 d->handle(irq, d, regs); 276 desc_handle_irq(irq, d, regs);
277 } 277 }
278 } 278 }
279 } 279 }
@@ -328,7 +328,7 @@ static void locomo_lt_handler(unsigned int irq, struct irqdesc *desc,
328 328
329 if (locomo_readl(mapbase + LOCOMO_LTINT) & 0x0001) { 329 if (locomo_readl(mapbase + LOCOMO_LTINT) & 0x0001) {
330 d = irq_desc + LOCOMO_IRQ_LT_START; 330 d = irq_desc + LOCOMO_IRQ_LT_START;
331 d->handle(LOCOMO_IRQ_LT_START, d, regs); 331 desc_handle_irq(LOCOMO_IRQ_LT_START, d, regs);
332 } 332 }
333} 333}
334 334
@@ -379,7 +379,7 @@ static void locomo_spi_handler(unsigned int irq, struct irqdesc *desc,
379 379
380 for (i = 0; i <= 3; i++, irq++, d++) { 380 for (i = 0; i <= 3; i++, irq++, d++) {
381 if (req & (0x0001 << i)) { 381 if (req & (0x0001 << i)) {
382 d->handle(irq, d, regs); 382 desc_handle_irq(irq, d, regs);
383 } 383 }
384 } 384 }
385 } 385 }
@@ -651,15 +651,15 @@ __locomo_probe(struct device *me, struct resource *mem, int irq)
651 return ret; 651 return ret;
652} 652}
653 653
654static void __locomo_remove(struct locomo *lchip) 654static int locomo_remove_child(struct device *dev, void *data)
655{ 655{
656 struct list_head *l, *n; 656 device_unregister(dev);
657 657 return 0;
658 list_for_each_safe(l, n, &lchip->dev->children) { 658}
659 struct device *d = list_to_dev(l);
660 659
661 device_unregister(d); 660static void __locomo_remove(struct locomo *lchip)
662 } 661{
662 device_for_each_child(lchip->dev, NULL, locomo_remove_child);
663 663
664 if (lchip->irq != NO_IRQ) { 664 if (lchip->irq != NO_IRQ) {
665 set_irq_chained_handler(lchip->irq, NULL); 665 set_irq_chained_handler(lchip->irq, NULL);
diff --git a/arch/arm/common/sa1111.c b/arch/arm/common/sa1111.c
index 38c2eb667eb9..1a47fbf9cbbc 100644
--- a/arch/arm/common/sa1111.c
+++ b/arch/arm/common/sa1111.c
@@ -268,8 +268,8 @@ static struct irqchip sa1111_low_chip = {
268 .mask = sa1111_mask_lowirq, 268 .mask = sa1111_mask_lowirq,
269 .unmask = sa1111_unmask_lowirq, 269 .unmask = sa1111_unmask_lowirq,
270 .retrigger = sa1111_retrigger_lowirq, 270 .retrigger = sa1111_retrigger_lowirq,
271 .type = sa1111_type_lowirq, 271 .set_type = sa1111_type_lowirq,
272 .wake = sa1111_wake_lowirq, 272 .set_wake = sa1111_wake_lowirq,
273}; 273};
274 274
275static void sa1111_mask_highirq(unsigned int irq) 275static void sa1111_mask_highirq(unsigned int irq)
@@ -364,8 +364,8 @@ static struct irqchip sa1111_high_chip = {
364 .mask = sa1111_mask_highirq, 364 .mask = sa1111_mask_highirq,
365 .unmask = sa1111_unmask_highirq, 365 .unmask = sa1111_unmask_highirq,
366 .retrigger = sa1111_retrigger_highirq, 366 .retrigger = sa1111_retrigger_highirq,
367 .type = sa1111_type_highirq, 367 .set_type = sa1111_type_highirq,
368 .wake = sa1111_wake_highirq, 368 .set_wake = sa1111_wake_highirq,
369}; 369};
370 370
371static void sa1111_setup_irq(struct sa1111 *sachip) 371static void sa1111_setup_irq(struct sa1111 *sachip)
diff --git a/arch/arm/configs/bast_defconfig b/arch/arm/configs/bast_defconfig
index 2d985e9611cd..35e3a99bcbb6 100644
--- a/arch/arm/configs/bast_defconfig
+++ b/arch/arm/configs/bast_defconfig
@@ -561,7 +561,6 @@ CONFIG_SERIAL_8250_SHARE_IRQ=y
561# 561#
562CONFIG_SERIAL_S3C2410=y 562CONFIG_SERIAL_S3C2410=y
563CONFIG_SERIAL_S3C2410_CONSOLE=y 563CONFIG_SERIAL_S3C2410_CONSOLE=y
564CONFIG_SERIAL_BAST_SIO=y
565CONFIG_SERIAL_CORE=y 564CONFIG_SERIAL_CORE=y
566CONFIG_SERIAL_CORE_CONSOLE=y 565CONFIG_SERIAL_CORE_CONSOLE=y
567CONFIG_UNIX98_PTYS=y 566CONFIG_UNIX98_PTYS=y
diff --git a/arch/arm/configs/s3c2410_defconfig b/arch/arm/configs/s3c2410_defconfig
index 98b72ff38832..96a794d8de84 100644
--- a/arch/arm/configs/s3c2410_defconfig
+++ b/arch/arm/configs/s3c2410_defconfig
@@ -570,7 +570,6 @@ CONFIG_SERIAL_8250_SHARE_IRQ=y
570# 570#
571CONFIG_SERIAL_S3C2410=y 571CONFIG_SERIAL_S3C2410=y
572CONFIG_SERIAL_S3C2410_CONSOLE=y 572CONFIG_SERIAL_S3C2410_CONSOLE=y
573CONFIG_SERIAL_BAST_SIO=y
574CONFIG_SERIAL_CORE=y 573CONFIG_SERIAL_CORE=y
575CONFIG_SERIAL_CORE_CONSOLE=y 574CONFIG_SERIAL_CORE_CONSOLE=y
576CONFIG_UNIX98_PTYS=y 575CONFIG_UNIX98_PTYS=y
diff --git a/arch/arm/configs/shark_defconfig b/arch/arm/configs/shark_defconfig
index 1d9bcbbc8dfc..271823f0d708 100644
--- a/arch/arm/configs/shark_defconfig
+++ b/arch/arm/configs/shark_defconfig
@@ -1,22 +1,21 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.12-rc1-bk2 3# Linux kernel version: 2.6.12-git3
4# Sun Mar 27 23:59:14 2005 4# Sat Jul 16 15:21:47 2005
5# 5#
6CONFIG_ARM=y 6CONFIG_ARM=y
7CONFIG_MMU=y 7CONFIG_MMU=y
8CONFIG_UID16=y 8CONFIG_UID16=y
9CONFIG_RWSEM_GENERIC_SPINLOCK=y 9CONFIG_RWSEM_GENERIC_SPINLOCK=y
10CONFIG_GENERIC_CALIBRATE_DELAY=y 10CONFIG_GENERIC_CALIBRATE_DELAY=y
11CONFIG_GENERIC_IOMAP=y
12 11
13# 12#
14# Code maturity level options 13# Code maturity level options
15# 14#
16CONFIG_EXPERIMENTAL=y 15CONFIG_EXPERIMENTAL=y
17# CONFIG_CLEAN_COMPILE is not set 16CONFIG_CLEAN_COMPILE=y
18CONFIG_BROKEN=y
19CONFIG_BROKEN_ON_SMP=y 17CONFIG_BROKEN_ON_SMP=y
18CONFIG_INIT_ENV_ARG_LIMIT=32
20 19
21# 20#
22# General setup 21# General setup
@@ -33,7 +32,10 @@ CONFIG_KOBJECT_UEVENT=y
33# CONFIG_IKCONFIG is not set 32# CONFIG_IKCONFIG is not set
34# CONFIG_EMBEDDED is not set 33# CONFIG_EMBEDDED is not set
35CONFIG_KALLSYMS=y 34CONFIG_KALLSYMS=y
35# CONFIG_KALLSYMS_ALL is not set
36# CONFIG_KALLSYMS_EXTRA_PASS is not set 36# CONFIG_KALLSYMS_EXTRA_PASS is not set
37CONFIG_PRINTK=y
38CONFIG_BUG=y
37CONFIG_BASE_FULL=y 39CONFIG_BASE_FULL=y
38CONFIG_FUTEX=y 40CONFIG_FUTEX=y
39CONFIG_EPOLL=y 41CONFIG_EPOLL=y
@@ -81,6 +83,7 @@ CONFIG_ARCH_SHARK=y
81# CONFIG_ARCH_VERSATILE is not set 83# CONFIG_ARCH_VERSATILE is not set
82# CONFIG_ARCH_IMX is not set 84# CONFIG_ARCH_IMX is not set
83# CONFIG_ARCH_H720X is not set 85# CONFIG_ARCH_H720X is not set
86# CONFIG_ARCH_AAEC2000 is not set
84 87
85# 88#
86# Processor Type 89# Processor Type
@@ -103,10 +106,12 @@ CONFIG_CPU_TLB_V4WB=y
103# 106#
104CONFIG_ISA=y 107CONFIG_ISA=y
105CONFIG_ISA_DMA=y 108CONFIG_ISA_DMA=y
109CONFIG_ISA_DMA_API=y
106CONFIG_PCI=y 110CONFIG_PCI=y
107CONFIG_PCI_HOST_VIA82C505=y 111CONFIG_PCI_HOST_VIA82C505=y
108CONFIG_PCI_LEGACY_PROC=y 112CONFIG_PCI_LEGACY_PROC=y
109# CONFIG_PCI_NAMES is not set 113# CONFIG_PCI_NAMES is not set
114# CONFIG_PCI_DEBUG is not set
110 115
111# 116#
112# PCCARD (PCMCIA/CardBus) support 117# PCCARD (PCMCIA/CardBus) support
@@ -116,7 +121,9 @@ CONFIG_PCI_LEGACY_PROC=y
116# 121#
117# Kernel Features 122# Kernel Features
118# 123#
124# CONFIG_SMP is not set
119# CONFIG_PREEMPT is not set 125# CONFIG_PREEMPT is not set
126# CONFIG_DISCONTIGMEM is not set
120CONFIG_LEDS=y 127CONFIG_LEDS=y
121CONFIG_LEDS_TIMER=y 128CONFIG_LEDS_TIMER=y
122# CONFIG_LEDS_CPU is not set 129# CONFIG_LEDS_CPU is not set
@@ -163,6 +170,7 @@ CONFIG_BINFMT_ELF=y
163# CONFIG_STANDALONE is not set 170# CONFIG_STANDALONE is not set
164CONFIG_PREVENT_FIRMWARE_BUILD=y 171CONFIG_PREVENT_FIRMWARE_BUILD=y
165# CONFIG_FW_LOADER is not set 172# CONFIG_FW_LOADER is not set
173# CONFIG_DEBUG_DRIVER is not set
166 174
167# 175#
168# Memory Technology Devices (MTD) 176# Memory Technology Devices (MTD)
@@ -172,8 +180,8 @@ CONFIG_PREVENT_FIRMWARE_BUILD=y
172# 180#
173# Parallel port support 181# Parallel port support
174# 182#
175CONFIG_PARPORT=y 183CONFIG_PARPORT=m
176CONFIG_PARPORT_PC=y 184CONFIG_PARPORT_PC=m
177# CONFIG_PARPORT_SERIAL is not set 185# CONFIG_PARPORT_SERIAL is not set
178# CONFIG_PARPORT_PC_FIFO is not set 186# CONFIG_PARPORT_PC_FIFO is not set
179# CONFIG_PARPORT_PC_SUPERIO is not set 187# CONFIG_PARPORT_PC_SUPERIO is not set
@@ -189,7 +197,6 @@ CONFIG_PARPORT_PC=y
189# 197#
190# Block devices 198# Block devices
191# 199#
192# CONFIG_BLK_DEV_FD is not set
193# CONFIG_BLK_DEV_XD is not set 200# CONFIG_BLK_DEV_XD is not set
194# CONFIG_PARIDE is not set 201# CONFIG_PARIDE is not set
195# CONFIG_BLK_CPQ_DA is not set 202# CONFIG_BLK_CPQ_DA is not set
@@ -229,7 +236,7 @@ CONFIG_BLK_DEV_IDE=y
229# CONFIG_BLK_DEV_IDE_SATA is not set 236# CONFIG_BLK_DEV_IDE_SATA is not set
230CONFIG_BLK_DEV_IDEDISK=y 237CONFIG_BLK_DEV_IDEDISK=y
231# CONFIG_IDEDISK_MULTI_MODE is not set 238# CONFIG_IDEDISK_MULTI_MODE is not set
232CONFIG_BLK_DEV_IDECD=y 239CONFIG_BLK_DEV_IDECD=m
233# CONFIG_BLK_DEV_IDETAPE is not set 240# CONFIG_BLK_DEV_IDETAPE is not set
234CONFIG_BLK_DEV_IDEFLOPPY=y 241CONFIG_BLK_DEV_IDEFLOPPY=y
235# CONFIG_BLK_DEV_IDESCSI is not set 242# CONFIG_BLK_DEV_IDESCSI is not set
@@ -261,6 +268,7 @@ CONFIG_CHR_DEV_ST=m
261CONFIG_BLK_DEV_SR=m 268CONFIG_BLK_DEV_SR=m
262# CONFIG_BLK_DEV_SR_VENDOR is not set 269# CONFIG_BLK_DEV_SR_VENDOR is not set
263CONFIG_CHR_DEV_SG=m 270CONFIG_CHR_DEV_SG=m
271# CONFIG_CHR_DEV_SCH is not set
264 272
265# 273#
266# Some SCSI devices (e.g. CD jukebox) support multiple LUNs 274# Some SCSI devices (e.g. CD jukebox) support multiple LUNs
@@ -290,17 +298,14 @@ CONFIG_CHR_DEV_SG=m
290# CONFIG_SCSI_AIC7XXX_OLD is not set 298# CONFIG_SCSI_AIC7XXX_OLD is not set
291# CONFIG_SCSI_AIC79XX is not set 299# CONFIG_SCSI_AIC79XX is not set
292# CONFIG_SCSI_DPT_I2O is not set 300# CONFIG_SCSI_DPT_I2O is not set
293# CONFIG_SCSI_ADVANSYS is not set
294# CONFIG_SCSI_IN2000 is not set 301# CONFIG_SCSI_IN2000 is not set
295# CONFIG_MEGARAID_NEWGEN is not set 302# CONFIG_MEGARAID_NEWGEN is not set
296# CONFIG_MEGARAID_LEGACY is not set 303# CONFIG_MEGARAID_LEGACY is not set
297# CONFIG_SCSI_SATA is not set 304# CONFIG_SCSI_SATA is not set
298# CONFIG_SCSI_BUSLOGIC is not set 305# CONFIG_SCSI_BUSLOGIC is not set
299# CONFIG_SCSI_CPQFCTS is not set
300# CONFIG_SCSI_DMX3191D is not set 306# CONFIG_SCSI_DMX3191D is not set
301# CONFIG_SCSI_DTC3280 is not set 307# CONFIG_SCSI_DTC3280 is not set
302# CONFIG_SCSI_EATA is not set 308# CONFIG_SCSI_EATA is not set
303# CONFIG_SCSI_EATA_PIO is not set
304# CONFIG_SCSI_FUTURE_DOMAIN is not set 309# CONFIG_SCSI_FUTURE_DOMAIN is not set
305# CONFIG_SCSI_GDTH is not set 310# CONFIG_SCSI_GDTH is not set
306# CONFIG_SCSI_GENERIC_NCR5380 is not set 311# CONFIG_SCSI_GENERIC_NCR5380 is not set
@@ -314,11 +319,8 @@ CONFIG_CHR_DEV_SG=m
314# CONFIG_SCSI_SYM53C8XX_2 is not set 319# CONFIG_SCSI_SYM53C8XX_2 is not set
315# CONFIG_SCSI_IPR is not set 320# CONFIG_SCSI_IPR is not set
316# CONFIG_SCSI_PAS16 is not set 321# CONFIG_SCSI_PAS16 is not set
317# CONFIG_SCSI_PCI2000 is not set
318# CONFIG_SCSI_PCI2220I is not set
319# CONFIG_SCSI_PSI240I is not set 322# CONFIG_SCSI_PSI240I is not set
320# CONFIG_SCSI_QLOGIC_FAS is not set 323# CONFIG_SCSI_QLOGIC_FAS is not set
321# CONFIG_SCSI_QLOGIC_ISP is not set
322# CONFIG_SCSI_QLOGIC_FC is not set 324# CONFIG_SCSI_QLOGIC_FC is not set
323# CONFIG_SCSI_QLOGIC_1280 is not set 325# CONFIG_SCSI_QLOGIC_1280 is not set
324CONFIG_SCSI_QLA2XXX=m 326CONFIG_SCSI_QLA2XXX=m
@@ -327,6 +329,7 @@ CONFIG_SCSI_QLA2XXX=m
327# CONFIG_SCSI_QLA2300 is not set 329# CONFIG_SCSI_QLA2300 is not set
328# CONFIG_SCSI_QLA2322 is not set 330# CONFIG_SCSI_QLA2322 is not set
329# CONFIG_SCSI_QLA6312 is not set 331# CONFIG_SCSI_QLA6312 is not set
332# CONFIG_SCSI_LPFC is not set
330# CONFIG_SCSI_SYM53C416 is not set 333# CONFIG_SCSI_SYM53C416 is not set
331# CONFIG_SCSI_DC395x is not set 334# CONFIG_SCSI_DC395x is not set
332# CONFIG_SCSI_DC390T is not set 335# CONFIG_SCSI_DC390T is not set
@@ -344,6 +347,8 @@ CONFIG_SCSI_QLA2XXX=m
344# Fusion MPT device support 347# Fusion MPT device support
345# 348#
346# CONFIG_FUSION is not set 349# CONFIG_FUSION is not set
350# CONFIG_FUSION_SPI is not set
351# CONFIG_FUSION_FC is not set
347 352
348# 353#
349# IEEE 1394 (FireWire) support 354# IEEE 1394 (FireWire) support
@@ -365,7 +370,6 @@ CONFIG_NET=y
365# 370#
366CONFIG_PACKET=y 371CONFIG_PACKET=y
367# CONFIG_PACKET_MMAP is not set 372# CONFIG_PACKET_MMAP is not set
368# CONFIG_NETLINK_DEV is not set
369CONFIG_UNIX=y 373CONFIG_UNIX=y
370# CONFIG_NET_KEY is not set 374# CONFIG_NET_KEY is not set
371CONFIG_INET=y 375CONFIG_INET=y
@@ -380,7 +384,7 @@ CONFIG_INET=y
380# CONFIG_INET_ESP is not set 384# CONFIG_INET_ESP is not set
381# CONFIG_INET_IPCOMP is not set 385# CONFIG_INET_IPCOMP is not set
382# CONFIG_INET_TUNNEL is not set 386# CONFIG_INET_TUNNEL is not set
383# CONFIG_IP_TCPDIAG is not set 387CONFIG_IP_TCPDIAG=y
384# CONFIG_IP_TCPDIAG_IPV6 is not set 388# CONFIG_IP_TCPDIAG_IPV6 is not set
385# CONFIG_IPV6 is not set 389# CONFIG_IPV6 is not set
386# CONFIG_NETFILTER is not set 390# CONFIG_NETFILTER is not set
@@ -439,6 +443,7 @@ CONFIG_NET_ETHERNET=y
439# CONFIG_LANCE is not set 443# CONFIG_LANCE is not set
440# CONFIG_NET_VENDOR_SMC is not set 444# CONFIG_NET_VENDOR_SMC is not set
441# CONFIG_SMC91X is not set 445# CONFIG_SMC91X is not set
446# CONFIG_DM9000 is not set
442# CONFIG_NET_VENDOR_RACAL is not set 447# CONFIG_NET_VENDOR_RACAL is not set
443 448
444# 449#
@@ -483,9 +488,11 @@ CONFIG_CS89x0=y
483# CONFIG_HAMACHI is not set 488# CONFIG_HAMACHI is not set
484# CONFIG_YELLOWFIN is not set 489# CONFIG_YELLOWFIN is not set
485# CONFIG_R8169 is not set 490# CONFIG_R8169 is not set
491# CONFIG_SKGE is not set
486# CONFIG_SK98LIN is not set 492# CONFIG_SK98LIN is not set
487# CONFIG_VIA_VELOCITY is not set 493# CONFIG_VIA_VELOCITY is not set
488# CONFIG_TIGON3 is not set 494# CONFIG_TIGON3 is not set
495# CONFIG_BNX2 is not set
489 496
490# 497#
491# Ethernet (10000 Mbit) 498# Ethernet (10000 Mbit)
@@ -569,7 +576,6 @@ CONFIG_SERIO_I8042=y
569CONFIG_SERIO_LIBPS2=y 576CONFIG_SERIO_LIBPS2=y
570# CONFIG_SERIO_RAW is not set 577# CONFIG_SERIO_RAW is not set
571# CONFIG_GAMEPORT is not set 578# CONFIG_GAMEPORT is not set
572CONFIG_SOUND_GAMEPORT=y
573 579
574# 580#
575# Character devices 581# Character devices
@@ -592,6 +598,7 @@ CONFIG_SERIAL_8250_NR_UARTS=4
592# 598#
593CONFIG_SERIAL_CORE=y 599CONFIG_SERIAL_CORE=y
594CONFIG_SERIAL_CORE_CONSOLE=y 600CONFIG_SERIAL_CORE_CONSOLE=y
601# CONFIG_SERIAL_JSM is not set
595CONFIG_UNIX98_PTYS=y 602CONFIG_UNIX98_PTYS=y
596CONFIG_LEGACY_PTYS=y 603CONFIG_LEGACY_PTYS=y
597CONFIG_LEGACY_PTY_COUNT=256 604CONFIG_LEGACY_PTY_COUNT=256
@@ -653,6 +660,7 @@ CONFIG_FB_CFB_FILLRECT=y
653CONFIG_FB_CFB_COPYAREA=y 660CONFIG_FB_CFB_COPYAREA=y
654CONFIG_FB_CFB_IMAGEBLIT=y 661CONFIG_FB_CFB_IMAGEBLIT=y
655CONFIG_FB_SOFT_CURSOR=y 662CONFIG_FB_SOFT_CURSOR=y
663# CONFIG_FB_MACMODES is not set
656# CONFIG_FB_MODE_HELPERS is not set 664# CONFIG_FB_MODE_HELPERS is not set
657# CONFIG_FB_TILEBLITTING is not set 665# CONFIG_FB_TILEBLITTING is not set
658# CONFIG_FB_CIRRUS is not set 666# CONFIG_FB_CIRRUS is not set
@@ -674,7 +682,7 @@ CONFIG_FB_CYBER2000=y
674# CONFIG_FB_3DFX is not set 682# CONFIG_FB_3DFX is not set
675# CONFIG_FB_VOODOO1 is not set 683# CONFIG_FB_VOODOO1 is not set
676# CONFIG_FB_TRIDENT is not set 684# CONFIG_FB_TRIDENT is not set
677# CONFIG_FB_PM3 is not set 685# CONFIG_FB_S1D13XXX is not set
678# CONFIG_FB_VIRTUAL is not set 686# CONFIG_FB_VIRTUAL is not set
679 687
680# 688#
@@ -808,7 +816,7 @@ CONFIG_DNOTIFY=y
808# 816#
809# CD-ROM/DVD Filesystems 817# CD-ROM/DVD Filesystems
810# 818#
811CONFIG_ISO9660_FS=y 819CONFIG_ISO9660_FS=m
812CONFIG_JOLIET=y 820CONFIG_JOLIET=y
813# CONFIG_ZISOFS is not set 821# CONFIG_ZISOFS is not set
814# CONFIG_UDF_FS is not set 822# CONFIG_UDF_FS is not set
@@ -816,9 +824,9 @@ CONFIG_JOLIET=y
816# 824#
817# DOS/FAT/NT Filesystems 825# DOS/FAT/NT Filesystems
818# 826#
819CONFIG_FAT_FS=y 827CONFIG_FAT_FS=m
820CONFIG_MSDOS_FS=y 828CONFIG_MSDOS_FS=m
821CONFIG_VFAT_FS=y 829CONFIG_VFAT_FS=m
822CONFIG_FAT_DEFAULT_CODEPAGE=437 830CONFIG_FAT_DEFAULT_CODEPAGE=437
823CONFIG_FAT_DEFAULT_IOCHARSET="iso8859-1" 831CONFIG_FAT_DEFAULT_IOCHARSET="iso8859-1"
824# CONFIG_NTFS_FS is not set 832# CONFIG_NTFS_FS is not set
@@ -833,7 +841,6 @@ CONFIG_DEVFS_MOUNT=y
833# CONFIG_DEVFS_DEBUG is not set 841# CONFIG_DEVFS_DEBUG is not set
834# CONFIG_DEVPTS_FS_XATTR is not set 842# CONFIG_DEVPTS_FS_XATTR is not set
835# CONFIG_TMPFS is not set 843# CONFIG_TMPFS is not set
836# CONFIG_HUGETLBFS is not set
837# CONFIG_HUGETLB_PAGE is not set 844# CONFIG_HUGETLB_PAGE is not set
838CONFIG_RAMFS=y 845CONFIG_RAMFS=y
839 846
@@ -857,13 +864,14 @@ CONFIG_RAMFS=y
857# 864#
858# Network File Systems 865# Network File Systems
859# 866#
860CONFIG_NFS_FS=y 867CONFIG_NFS_FS=m
861# CONFIG_NFS_V3 is not set 868CONFIG_NFS_V3=y
862# CONFIG_NFS_V4 is not set 869# CONFIG_NFS_V4 is not set
863# CONFIG_NFS_DIRECTIO is not set 870# CONFIG_NFS_DIRECTIO is not set
864# CONFIG_NFSD is not set 871# CONFIG_NFSD is not set
865CONFIG_LOCKD=y 872CONFIG_LOCKD=m
866CONFIG_SUNRPC=y 873CONFIG_LOCKD_V4=y
874CONFIG_SUNRPC=m
867# CONFIG_RPCSEC_GSS_KRB5 is not set 875# CONFIG_RPCSEC_GSS_KRB5 is not set
868# CONFIG_RPCSEC_GSS_SPKM3 is not set 876# CONFIG_RPCSEC_GSS_SPKM3 is not set
869# CONFIG_SMB_FS is not set 877# CONFIG_SMB_FS is not set
@@ -895,12 +903,12 @@ CONFIG_MSDOS_PARTITION=y
895# 903#
896# Native Language Support 904# Native Language Support
897# 905#
898CONFIG_NLS=y 906CONFIG_NLS=m
899CONFIG_NLS_DEFAULT="iso8859-1" 907CONFIG_NLS_DEFAULT="iso8859-1"
900CONFIG_NLS_CODEPAGE_437=y 908CONFIG_NLS_CODEPAGE_437=m
901# CONFIG_NLS_CODEPAGE_737 is not set 909# CONFIG_NLS_CODEPAGE_737 is not set
902# CONFIG_NLS_CODEPAGE_775 is not set 910# CONFIG_NLS_CODEPAGE_775 is not set
903CONFIG_NLS_CODEPAGE_850=y 911CONFIG_NLS_CODEPAGE_850=m
904# CONFIG_NLS_CODEPAGE_852 is not set 912# CONFIG_NLS_CODEPAGE_852 is not set
905# CONFIG_NLS_CODEPAGE_855 is not set 913# CONFIG_NLS_CODEPAGE_855 is not set
906# CONFIG_NLS_CODEPAGE_857 is not set 914# CONFIG_NLS_CODEPAGE_857 is not set
@@ -921,7 +929,7 @@ CONFIG_NLS_CODEPAGE_850=y
921# CONFIG_NLS_CODEPAGE_1250 is not set 929# CONFIG_NLS_CODEPAGE_1250 is not set
922# CONFIG_NLS_CODEPAGE_1251 is not set 930# CONFIG_NLS_CODEPAGE_1251 is not set
923# CONFIG_NLS_ASCII is not set 931# CONFIG_NLS_ASCII is not set
924CONFIG_NLS_ISO8859_1=y 932CONFIG_NLS_ISO8859_1=m
925# CONFIG_NLS_ISO8859_2 is not set 933# CONFIG_NLS_ISO8859_2 is not set
926# CONFIG_NLS_ISO8859_3 is not set 934# CONFIG_NLS_ISO8859_3 is not set
927# CONFIG_NLS_ISO8859_4 is not set 935# CONFIG_NLS_ISO8859_4 is not set
@@ -945,11 +953,22 @@ CONFIG_NLS_ISO8859_1=y
945# Kernel hacking 953# Kernel hacking
946# 954#
947# CONFIG_PRINTK_TIME is not set 955# CONFIG_PRINTK_TIME is not set
948# CONFIG_DEBUG_KERNEL is not set 956CONFIG_DEBUG_KERNEL=y
957# CONFIG_MAGIC_SYSRQ is not set
949CONFIG_LOG_BUF_SHIFT=14 958CONFIG_LOG_BUF_SHIFT=14
959# CONFIG_SCHEDSTATS is not set
960# CONFIG_DEBUG_SLAB is not set
961# CONFIG_DEBUG_SPINLOCK is not set
962# CONFIG_DEBUG_SPINLOCK_SLEEP is not set
963# CONFIG_DEBUG_KOBJECT is not set
950CONFIG_DEBUG_BUGVERBOSE=y 964CONFIG_DEBUG_BUGVERBOSE=y
965# CONFIG_DEBUG_INFO is not set
966# CONFIG_DEBUG_FS is not set
951CONFIG_FRAME_POINTER=y 967CONFIG_FRAME_POINTER=y
952CONFIG_DEBUG_USER=y 968CONFIG_DEBUG_USER=y
969# CONFIG_DEBUG_WAITQ is not set
970# CONFIG_DEBUG_ERRORS is not set
971# CONFIG_DEBUG_LL is not set
953 972
954# 973#
955# Security options 974# Security options
diff --git a/arch/arm/kernel/bios32.c b/arch/arm/kernel/bios32.c
index ad26e98f1e62..c4923fac8dff 100644
--- a/arch/arm/kernel/bios32.c
+++ b/arch/arm/kernel/bios32.c
@@ -447,9 +447,26 @@ pcibios_resource_to_bus(struct pci_dev *dev, struct pci_bus_region *region,
447 region->end = res->end - offset; 447 region->end = res->end - offset;
448} 448}
449 449
450void __devinit
451pcibios_bus_to_resource(struct pci_dev *dev, struct resource *res,
452 struct pci_bus_region *region)
453{
454 struct pci_sys_data *root = dev->sysdata;
455 unsigned long offset = 0;
456
457 if (res->flags & IORESOURCE_IO)
458 offset = root->io_offset;
459 if (res->flags & IORESOURCE_MEM)
460 offset = root->mem_offset;
461
462 res->start = region->start + offset;
463 res->end = region->end + offset;
464}
465
450#ifdef CONFIG_HOTPLUG 466#ifdef CONFIG_HOTPLUG
451EXPORT_SYMBOL(pcibios_fixup_bus); 467EXPORT_SYMBOL(pcibios_fixup_bus);
452EXPORT_SYMBOL(pcibios_resource_to_bus); 468EXPORT_SYMBOL(pcibios_resource_to_bus);
469EXPORT_SYMBOL(pcibios_bus_to_resource);
453#endif 470#endif
454 471
455/* 472/*
diff --git a/arch/arm/kernel/calls.S b/arch/arm/kernel/calls.S
index e5d370c235d7..db07ce42b3b2 100644
--- a/arch/arm/kernel/calls.S
+++ b/arch/arm/kernel/calls.S
@@ -284,7 +284,7 @@ __syscall_start:
284 .long sys_fstatfs64 284 .long sys_fstatfs64
285 .long sys_tgkill 285 .long sys_tgkill
286 .long sys_utimes 286 .long sys_utimes
287/* 270 */ .long sys_fadvise64_64 287/* 270 */ .long sys_arm_fadvise64_64_wrapper
288 .long sys_pciconfig_iobase 288 .long sys_pciconfig_iobase
289 .long sys_pciconfig_read 289 .long sys_pciconfig_read
290 .long sys_pciconfig_write 290 .long sys_pciconfig_write
@@ -327,6 +327,12 @@ __syscall_start:
327/* 310 */ .long sys_request_key 327/* 310 */ .long sys_request_key
328 .long sys_keyctl 328 .long sys_keyctl
329 .long sys_semtimedop 329 .long sys_semtimedop
330/* vserver */ .long sys_ni_syscall
331 .long sys_ioprio_set
332/* 315 */ .long sys_ioprio_get
333 .long sys_inotify_init
334 .long sys_inotify_add_watch
335 .long sys_inotify_rm_watch
330__syscall_end: 336__syscall_end:
331 337
332 .rept NR_syscalls - (__syscall_end - __syscall_start) / 4 338 .rept NR_syscalls - (__syscall_end - __syscall_start) / 4
diff --git a/arch/arm/kernel/ecard.c b/arch/arm/kernel/ecard.c
index 6540db691338..dceb826bd216 100644
--- a/arch/arm/kernel/ecard.c
+++ b/arch/arm/kernel/ecard.c
@@ -585,7 +585,7 @@ ecard_irq_handler(unsigned int irq, struct irqdesc *desc, struct pt_regs *regs)
585 585
586 if (pending) { 586 if (pending) {
587 struct irqdesc *d = irq_desc + ec->irq; 587 struct irqdesc *d = irq_desc + ec->irq;
588 d->handle(ec->irq, d, regs); 588 desc_handle_irq(ec->irq, d, regs);
589 called ++; 589 called ++;
590 } 590 }
591 } 591 }
@@ -632,7 +632,7 @@ ecard_irqexp_handler(unsigned int irq, struct irqdesc *desc, struct pt_regs *reg
632 * Serial cards should go in 0/1, ethernet/scsi in 2/3 632 * Serial cards should go in 0/1, ethernet/scsi in 2/3
633 * otherwise you will lose serial data at high speeds! 633 * otherwise you will lose serial data at high speeds!
634 */ 634 */
635 d->handle(ec->irq, d, regs); 635 desc_handle_irq(ec->irq, d, regs);
636 } else { 636 } else {
637 printk(KERN_WARNING "card%d: interrupt from unclaimed " 637 printk(KERN_WARNING "card%d: interrupt from unclaimed "
638 "card???\n", slot); 638 "card???\n", slot);
diff --git a/arch/arm/kernel/entry-armv.S b/arch/arm/kernel/entry-armv.S
index 39a6c1b0b9a3..7152bfbee581 100644
--- a/arch/arm/kernel/entry-armv.S
+++ b/arch/arm/kernel/entry-armv.S
@@ -533,6 +533,13 @@ ENTRY(__switch_to)
533 ldr r3, [r2, #TI_TP_VALUE] 533 ldr r3, [r2, #TI_TP_VALUE]
534 stmia ip!, {r4 - sl, fp, sp, lr} @ Store most regs on stack 534 stmia ip!, {r4 - sl, fp, sp, lr} @ Store most regs on stack
535 ldr r6, [r2, #TI_CPU_DOMAIN]! 535 ldr r6, [r2, #TI_CPU_DOMAIN]!
536#if __LINUX_ARM_ARCH__ >= 6
537#ifdef CONFIG_CPU_MPCORE
538 clrex
539#else
540 strex r3, r4, [ip] @ Clear exclusive monitor
541#endif
542#endif
536#if defined(CONFIG_CPU_XSCALE) && !defined(CONFIG_IWMMXT) 543#if defined(CONFIG_CPU_XSCALE) && !defined(CONFIG_IWMMXT)
537 mra r4, r5, acc0 544 mra r4, r5, acc0
538 stmia ip, {r4, r5} 545 stmia ip, {r4, r5}
diff --git a/arch/arm/kernel/entry-common.S b/arch/arm/kernel/entry-common.S
index 3f8d0e3aefab..6281d488ac97 100644
--- a/arch/arm/kernel/entry-common.S
+++ b/arch/arm/kernel/entry-common.S
@@ -265,6 +265,10 @@ sys_futex_wrapper:
265 str r5, [sp, #4] @ push sixth arg 265 str r5, [sp, #4] @ push sixth arg
266 b sys_futex 266 b sys_futex
267 267
268sys_arm_fadvise64_64_wrapper:
269 str r5, [sp, #4] @ push r5 to stack
270 b sys_arm_fadvise64_64
271
268/* 272/*
269 * Note: off_4k (r5) is always units of 4K. If we can't do the requested 273 * Note: off_4k (r5) is always units of 4K. If we can't do the requested
270 * offset, we return EINVAL. 274 * offset, we return EINVAL.
diff --git a/arch/arm/kernel/irq.c b/arch/arm/kernel/irq.c
index 395137a8fad2..3284118f356b 100644
--- a/arch/arm/kernel/irq.c
+++ b/arch/arm/kernel/irq.c
@@ -207,8 +207,8 @@ void enable_irq_wake(unsigned int irq)
207 unsigned long flags; 207 unsigned long flags;
208 208
209 spin_lock_irqsave(&irq_controller_lock, flags); 209 spin_lock_irqsave(&irq_controller_lock, flags);
210 if (desc->chip->wake) 210 if (desc->chip->set_wake)
211 desc->chip->wake(irq, 1); 211 desc->chip->set_wake(irq, 1);
212 spin_unlock_irqrestore(&irq_controller_lock, flags); 212 spin_unlock_irqrestore(&irq_controller_lock, flags);
213} 213}
214EXPORT_SYMBOL(enable_irq_wake); 214EXPORT_SYMBOL(enable_irq_wake);
@@ -219,8 +219,8 @@ void disable_irq_wake(unsigned int irq)
219 unsigned long flags; 219 unsigned long flags;
220 220
221 spin_lock_irqsave(&irq_controller_lock, flags); 221 spin_lock_irqsave(&irq_controller_lock, flags);
222 if (desc->chip->wake) 222 if (desc->chip->set_wake)
223 desc->chip->wake(irq, 0); 223 desc->chip->set_wake(irq, 0);
224 spin_unlock_irqrestore(&irq_controller_lock, flags); 224 spin_unlock_irqrestore(&irq_controller_lock, flags);
225} 225}
226EXPORT_SYMBOL(disable_irq_wake); 226EXPORT_SYMBOL(disable_irq_wake);
@@ -517,7 +517,7 @@ static void do_pending_irqs(struct pt_regs *regs)
517 list_for_each_safe(l, n, &head) { 517 list_for_each_safe(l, n, &head) {
518 desc = list_entry(l, struct irqdesc, pend); 518 desc = list_entry(l, struct irqdesc, pend);
519 list_del_init(&desc->pend); 519 list_del_init(&desc->pend);
520 desc->handle(desc - irq_desc, desc, regs); 520 desc_handle_irq(desc - irq_desc, desc, regs);
521 } 521 }
522 522
523 /* 523 /*
@@ -545,7 +545,7 @@ asmlinkage void asm_do_IRQ(unsigned int irq, struct pt_regs *regs)
545 545
546 irq_enter(); 546 irq_enter();
547 spin_lock(&irq_controller_lock); 547 spin_lock(&irq_controller_lock);
548 desc->handle(irq, desc, regs); 548 desc_handle_irq(irq, desc, regs);
549 549
550 /* 550 /*
551 * Now re-run any pending interrupts. 551 * Now re-run any pending interrupts.
@@ -624,9 +624,9 @@ int set_irq_type(unsigned int irq, unsigned int type)
624 } 624 }
625 625
626 desc = irq_desc + irq; 626 desc = irq_desc + irq;
627 if (desc->chip->type) { 627 if (desc->chip->set_type) {
628 spin_lock_irqsave(&irq_controller_lock, flags); 628 spin_lock_irqsave(&irq_controller_lock, flags);
629 ret = desc->chip->type(irq, type); 629 ret = desc->chip->set_type(irq, type);
630 spin_unlock_irqrestore(&irq_controller_lock, flags); 630 spin_unlock_irqrestore(&irq_controller_lock, flags);
631 } 631 }
632 632
@@ -846,8 +846,8 @@ unsigned long probe_irq_on(void)
846 846
847 irq_desc[i].probing = 1; 847 irq_desc[i].probing = 1;
848 irq_desc[i].triggered = 0; 848 irq_desc[i].triggered = 0;
849 if (irq_desc[i].chip->type) 849 if (irq_desc[i].chip->set_type)
850 irq_desc[i].chip->type(i, IRQT_PROBE); 850 irq_desc[i].chip->set_type(i, IRQT_PROBE);
851 irq_desc[i].chip->unmask(i); 851 irq_desc[i].chip->unmask(i);
852 irqs += 1; 852 irqs += 1;
853 } 853 }
diff --git a/arch/arm/kernel/process.c b/arch/arm/kernel/process.c
index bbea636ff687..409db6d5ec99 100644
--- a/arch/arm/kernel/process.c
+++ b/arch/arm/kernel/process.c
@@ -131,7 +131,6 @@ void machine_halt(void)
131{ 131{
132} 132}
133 133
134EXPORT_SYMBOL(machine_halt);
135 134
136void machine_power_off(void) 135void machine_power_off(void)
137{ 136{
@@ -139,7 +138,6 @@ void machine_power_off(void)
139 pm_power_off(); 138 pm_power_off();
140} 139}
141 140
142EXPORT_SYMBOL(machine_power_off);
143 141
144void machine_restart(char * __unused) 142void machine_restart(char * __unused)
145{ 143{
@@ -169,8 +167,6 @@ void machine_restart(char * __unused)
169 while (1); 167 while (1);
170} 168}
171 169
172EXPORT_SYMBOL(machine_restart);
173
174void __show_regs(struct pt_regs *regs) 170void __show_regs(struct pt_regs *regs)
175{ 171{
176 unsigned long flags = condition_codes(regs); 172 unsigned long flags = condition_codes(regs);
diff --git a/arch/arm/kernel/signal.c b/arch/arm/kernel/signal.c
index 5e435e42dacd..a94d75fef598 100644
--- a/arch/arm/kernel/signal.c
+++ b/arch/arm/kernel/signal.c
@@ -658,11 +658,12 @@ handle_signal(unsigned long sig, struct k_sigaction *ka,
658 /* 658 /*
659 * Block the signal if we were unsuccessful. 659 * Block the signal if we were unsuccessful.
660 */ 660 */
661 if (ret != 0 || !(ka->sa.sa_flags & SA_NODEFER)) { 661 if (ret != 0) {
662 spin_lock_irq(&tsk->sighand->siglock); 662 spin_lock_irq(&tsk->sighand->siglock);
663 sigorsets(&tsk->blocked, &tsk->blocked, 663 sigorsets(&tsk->blocked, &tsk->blocked,
664 &ka->sa.sa_mask); 664 &ka->sa.sa_mask);
665 sigaddset(&tsk->blocked, sig); 665 if (!(ka->sa.sa_flags & SA_NODEFER))
666 sigaddset(&tsk->blocked, sig);
666 recalc_sigpending(); 667 recalc_sigpending();
667 spin_unlock_irq(&tsk->sighand->siglock); 668 spin_unlock_irq(&tsk->sighand->siglock);
668 } 669 }
diff --git a/arch/arm/kernel/smp.c b/arch/arm/kernel/smp.c
index a931409c8fe4..826164945747 100644
--- a/arch/arm/kernel/smp.c
+++ b/arch/arm/kernel/smp.c
@@ -36,7 +36,7 @@
36 * The present bitmask indicates that the CPU is physically present. 36 * The present bitmask indicates that the CPU is physically present.
37 * The online bitmask indicates that the CPU is up and running. 37 * The online bitmask indicates that the CPU is up and running.
38 */ 38 */
39cpumask_t cpu_present_mask; 39cpumask_t cpu_possible_map;
40cpumask_t cpu_online_map; 40cpumask_t cpu_online_map;
41 41
42/* 42/*
@@ -78,7 +78,7 @@ struct smp_call_struct {
78static struct smp_call_struct * volatile smp_call_function_data; 78static struct smp_call_struct * volatile smp_call_function_data;
79static DEFINE_SPINLOCK(smp_call_function_lock); 79static DEFINE_SPINLOCK(smp_call_function_lock);
80 80
81int __init __cpu_up(unsigned int cpu) 81int __cpuinit __cpu_up(unsigned int cpu)
82{ 82{
83 struct task_struct *idle; 83 struct task_struct *idle;
84 pgd_t *pgd; 84 pgd_t *pgd;
@@ -110,7 +110,7 @@ int __init __cpu_up(unsigned int cpu)
110 * We need to tell the secondary core where to find 110 * We need to tell the secondary core where to find
111 * its stack and the page tables. 111 * its stack and the page tables.
112 */ 112 */
113 secondary_data.stack = (void *)idle->thread_info + THREAD_SIZE - 8; 113 secondary_data.stack = (void *)idle->thread_info + THREAD_START_SP;
114 secondary_data.pgdir = virt_to_phys(pgd); 114 secondary_data.pgdir = virt_to_phys(pgd);
115 wmb(); 115 wmb();
116 116
@@ -159,7 +159,7 @@ int __init __cpu_up(unsigned int cpu)
159 * This is the secondary CPU boot entry. We're using this CPUs 159 * This is the secondary CPU boot entry. We're using this CPUs
160 * idle thread stack, but a set of temporary page tables. 160 * idle thread stack, but a set of temporary page tables.
161 */ 161 */
162asmlinkage void __init secondary_start_kernel(void) 162asmlinkage void __cpuinit secondary_start_kernel(void)
163{ 163{
164 struct mm_struct *mm = &init_mm; 164 struct mm_struct *mm = &init_mm;
165 unsigned int cpu = smp_processor_id(); 165 unsigned int cpu = smp_processor_id();
@@ -176,6 +176,7 @@ asmlinkage void __init secondary_start_kernel(void)
176 cpu_set(cpu, mm->cpu_vm_mask); 176 cpu_set(cpu, mm->cpu_vm_mask);
177 cpu_switch_mm(mm->pgd, mm); 177 cpu_switch_mm(mm->pgd, mm);
178 enter_lazy_tlb(mm, current); 178 enter_lazy_tlb(mm, current);
179 local_flush_tlb_all();
179 180
180 cpu_init(); 181 cpu_init();
181 182
@@ -209,7 +210,7 @@ asmlinkage void __init secondary_start_kernel(void)
209 * Called by both boot and secondaries to move global data into 210 * Called by both boot and secondaries to move global data into
210 * per-processor storage. 211 * per-processor storage.
211 */ 212 */
212void __init smp_store_cpu_info(unsigned int cpuid) 213void __cpuinit smp_store_cpu_info(unsigned int cpuid)
213{ 214{
214 struct cpuinfo_arm *cpu_info = &per_cpu(cpu_data, cpuid); 215 struct cpuinfo_arm *cpu_info = &per_cpu(cpu_data, cpuid);
215 216
@@ -235,7 +236,8 @@ void __init smp_prepare_boot_cpu(void)
235{ 236{
236 unsigned int cpu = smp_processor_id(); 237 unsigned int cpu = smp_processor_id();
237 238
238 cpu_set(cpu, cpu_present_mask); 239 cpu_set(cpu, cpu_possible_map);
240 cpu_set(cpu, cpu_present_map);
239 cpu_set(cpu, cpu_online_map); 241 cpu_set(cpu, cpu_online_map);
240} 242}
241 243
@@ -355,7 +357,7 @@ void show_ipi_list(struct seq_file *p)
355 357
356 seq_puts(p, "IPI:"); 358 seq_puts(p, "IPI:");
357 359
358 for_each_online_cpu(cpu) 360 for_each_present_cpu(cpu)
359 seq_printf(p, " %10lu", per_cpu(ipi_data, cpu).ipi_count); 361 seq_printf(p, " %10lu", per_cpu(ipi_data, cpu).ipi_count);
360 362
361 seq_putc(p, '\n'); 363 seq_putc(p, '\n');
diff --git a/arch/arm/kernel/sys_arm.c b/arch/arm/kernel/sys_arm.c
index f897ce2ccf0d..42629ff84f5a 100644
--- a/arch/arm/kernel/sys_arm.c
+++ b/arch/arm/kernel/sys_arm.c
@@ -311,3 +311,13 @@ long execve(const char *filename, char **argv, char **envp)
311 return ret; 311 return ret;
312} 312}
313EXPORT_SYMBOL(execve); 313EXPORT_SYMBOL(execve);
314
315/*
316 * Since loff_t is a 64 bit type we avoid a lot of ABI hastle
317 * with a different argument ordering.
318 */
319asmlinkage long sys_arm_fadvise64_64(int fd, int advice,
320 loff_t offset, loff_t len)
321{
322 return sys_fadvise64_64(fd, offset, len, advice);
323}
diff --git a/arch/arm/kernel/time.c b/arch/arm/kernel/time.c
index 1b7fcd50c3e2..8880482dcbff 100644
--- a/arch/arm/kernel/time.c
+++ b/arch/arm/kernel/time.c
@@ -433,10 +433,12 @@ void timer_dyn_reprogram(void)
433{ 433{
434 struct dyn_tick_timer *dyn_tick = system_timer->dyn_tick; 434 struct dyn_tick_timer *dyn_tick = system_timer->dyn_tick;
435 435
436 write_seqlock(&xtime_lock); 436 if (dyn_tick) {
437 if (dyn_tick->state & DYN_TICK_ENABLED) 437 write_seqlock(&xtime_lock);
438 dyn_tick->reprogram(next_timer_interrupt() - jiffies); 438 if (dyn_tick->state & DYN_TICK_ENABLED)
439 write_sequnlock(&xtime_lock); 439 dyn_tick->reprogram(next_timer_interrupt() - jiffies);
440 write_sequnlock(&xtime_lock);
441 }
440} 442}
441 443
442static ssize_t timer_show_dyn_tick(struct sys_device *dev, char *buf) 444static ssize_t timer_show_dyn_tick(struct sys_device *dev, char *buf)
diff --git a/arch/arm/kernel/traps.c b/arch/arm/kernel/traps.c
index df2cb06ce424..4554c961251c 100644
--- a/arch/arm/kernel/traps.c
+++ b/arch/arm/kernel/traps.c
@@ -248,16 +248,20 @@ static DEFINE_SPINLOCK(undef_lock);
248 248
249void register_undef_hook(struct undef_hook *hook) 249void register_undef_hook(struct undef_hook *hook)
250{ 250{
251 spin_lock_irq(&undef_lock); 251 unsigned long flags;
252
253 spin_lock_irqsave(&undef_lock, flags);
252 list_add(&hook->node, &undef_hook); 254 list_add(&hook->node, &undef_hook);
253 spin_unlock_irq(&undef_lock); 255 spin_unlock_irqrestore(&undef_lock, flags);
254} 256}
255 257
256void unregister_undef_hook(struct undef_hook *hook) 258void unregister_undef_hook(struct undef_hook *hook)
257{ 259{
258 spin_lock_irq(&undef_lock); 260 unsigned long flags;
261
262 spin_lock_irqsave(&undef_lock, flags);
259 list_del(&hook->node); 263 list_del(&hook->node);
260 spin_unlock_irq(&undef_lock); 264 spin_unlock_irqrestore(&undef_lock, flags);
261} 265}
262 266
263asmlinkage void do_undefinstr(struct pt_regs *regs) 267asmlinkage void do_undefinstr(struct pt_regs *regs)
@@ -613,7 +617,7 @@ baddataabort(int code, unsigned long instr, struct pt_regs *regs)
613 notify_die("unknown data abort code", regs, &info, instr, 0); 617 notify_die("unknown data abort code", regs, &info, instr, 0);
614} 618}
615 619
616volatile void __bug(const char *file, int line, void *data) 620void __attribute__((noreturn)) __bug(const char *file, int line, void *data)
617{ 621{
618 printk(KERN_CRIT"kernel BUG at %s:%d!", file, line); 622 printk(KERN_CRIT"kernel BUG at %s:%d!", file, line);
619 if (data) 623 if (data)
diff --git a/arch/arm/lib/bitops.h b/arch/arm/lib/bitops.h
index 4a83ab6cd565..64a988c1ad44 100644
--- a/arch/arm/lib/bitops.h
+++ b/arch/arm/lib/bitops.h
@@ -1,3 +1,35 @@
1#include <linux/config.h>
2
3#if __LINUX_ARM_ARCH__ >= 6 && defined(CONFIG_CPU_MPCORE)
4 .macro bitop, instr
5 mov r2, #1
6 and r3, r0, #7 @ Get bit offset
7 add r1, r1, r0, lsr #3 @ Get byte offset
8 mov r3, r2, lsl r3
91: ldrexb r2, [r1]
10 \instr r2, r2, r3
11 strexb r0, r2, [r1]
12 cmp r0, #0
13 bne 1b
14 mov pc, lr
15 .endm
16
17 .macro testop, instr, store
18 and r3, r0, #7 @ Get bit offset
19 mov r2, #1
20 add r1, r1, r0, lsr #3 @ Get byte offset
21 mov r3, r2, lsl r3 @ create mask
221: ldrexb r2, [r1]
23 ands r0, r2, r3 @ save old value of bit
24 \instr r2, r2, r3 @ toggle bit
25 strexb ip, r2, [r1]
26 cmp ip, #0
27 bne 1b
28 cmp r0, #0
29 movne r0, #1
302: mov pc, lr
31 .endm
32#else
1 .macro bitop, instr 33 .macro bitop, instr
2 and r2, r0, #7 34 and r2, r0, #7
3 mov r3, #1 35 mov r3, #1
@@ -31,3 +63,4 @@
31 moveq r0, #0 63 moveq r0, #0
32 mov pc, lr 64 mov pc, lr
33 .endm 65 .endm
66#endif
diff --git a/arch/arm/lib/io-shark.c b/arch/arm/lib/io-shark.c
index 108d4573e970..824253948f51 100644
--- a/arch/arm/lib/io-shark.c
+++ b/arch/arm/lib/io-shark.c
@@ -11,73 +11,3 @@
11 * it under the terms of the GNU General Public License version 2 as 11 * it under the terms of the GNU General Public License version 2 as
12 * published by the Free Software Foundation. 12 * published by the Free Software Foundation.
13 */ 13 */
14#include <linux/kernel.h>
15
16#include <asm/io.h>
17
18void print_warning(void)
19{
20 printk(KERN_WARNING "ins?/outs? not implemented on this architecture\n");
21}
22
23void insl(unsigned int port, void *to, int len)
24{
25 print_warning();
26}
27
28void insb(unsigned int port, void *to, int len)
29{
30 print_warning();
31}
32
33void outsl(unsigned int port, const void *from, int len)
34{
35 print_warning();
36}
37
38void outsb(unsigned int port, const void *from, int len)
39{
40 print_warning();
41}
42
43/* these should be in assembler again */
44
45/*
46 * Purpose: read a block of data from a hardware register to memory.
47 * Proto : insw(int from_port, void *to, int len_in_words);
48 * Proto : inswb(int from_port, void *to, int len_in_bytes);
49 * Notes : increment to
50 */
51
52void insw(unsigned int port, void *to, int len)
53{
54 int i;
55
56 for (i = 0; i < len; i++)
57 ((unsigned short *) to)[i] = inw(port);
58}
59
60void inswb(unsigned int port, void *to, int len)
61{
62 insw(port, to, len >> 2);
63}
64
65/*
66 * Purpose: write a block of data from memory to a hardware register.
67 * Proto : outsw(int to_reg, void *from, int len_in_words);
68 * Proto : outswb(int to_reg, void *from, int len_in_bytes);
69 * Notes : increments from
70 */
71
72void outsw(unsigned int port, const void *from, int len)
73{
74 int i;
75
76 for (i = 0; i < len; i++)
77 outw(((unsigned short *) from)[i], port);
78}
79
80void outswb(unsigned int port, const void *from, int len)
81{
82 outsw(port, from, len >> 2);
83}
diff --git a/arch/arm/mach-footbridge/isa-irq.c b/arch/arm/mach-footbridge/isa-irq.c
index b21016070ea3..e1c43b331d64 100644
--- a/arch/arm/mach-footbridge/isa-irq.c
+++ b/arch/arm/mach-footbridge/isa-irq.c
@@ -95,7 +95,7 @@ isa_irq_handler(unsigned int irq, struct irqdesc *desc, struct pt_regs *regs)
95 } 95 }
96 96
97 desc = irq_desc + isa_irq; 97 desc = irq_desc + isa_irq;
98 desc->handle(isa_irq, desc, regs); 98 desc_handle_irq(isa_irq, desc, regs);
99} 99}
100 100
101static struct irqaction irq_cascade = { .handler = no_action, .name = "cascade", }; 101static struct irqaction irq_cascade = { .handler = no_action, .name = "cascade", };
diff --git a/arch/arm/mach-h720x/common.c b/arch/arm/mach-h720x/common.c
index 96aa3af70d86..5110e2e65ddd 100644
--- a/arch/arm/mach-h720x/common.c
+++ b/arch/arm/mach-h720x/common.c
@@ -108,7 +108,7 @@ h720x_gpio_handler(unsigned int mask, unsigned int irq,
108 while (mask) { 108 while (mask) {
109 if (mask & 1) { 109 if (mask & 1) {
110 IRQDBG("handling irq %d\n", irq); 110 IRQDBG("handling irq %d\n", irq);
111 desc->handle(irq, desc, regs); 111 desc_handle_irq(irq, desc, regs);
112 } 112 }
113 irq++; 113 irq++;
114 desc++; 114 desc++;
diff --git a/arch/arm/mach-h720x/cpu-h7202.c b/arch/arm/mach-h720x/cpu-h7202.c
index 593b6a2a30e1..4b3199319e68 100644
--- a/arch/arm/mach-h720x/cpu-h7202.c
+++ b/arch/arm/mach-h720x/cpu-h7202.c
@@ -126,7 +126,7 @@ h7202_timerx_demux_handler(unsigned int irq_unused, struct irqdesc *desc,
126 desc = irq_desc + irq; 126 desc = irq_desc + irq;
127 while (mask) { 127 while (mask) {
128 if (mask & 1) 128 if (mask & 1)
129 desc->handle(irq, desc, regs); 129 desc_handle_irq(irq, desc, regs);
130 irq++; 130 irq++;
131 desc++; 131 desc++;
132 mask >>= 1; 132 mask >>= 1;
diff --git a/arch/arm/mach-imx/irq.c b/arch/arm/mach-imx/irq.c
index 0c2713426dfd..eeb8a6d4a399 100644
--- a/arch/arm/mach-imx/irq.c
+++ b/arch/arm/mach-imx/irq.c
@@ -152,7 +152,7 @@ imx_gpio_handler(unsigned int mask, unsigned int irq,
152 while (mask) { 152 while (mask) {
153 if (mask & 1) { 153 if (mask & 1) {
154 DEBUG_IRQ("handling irq %d\n", irq); 154 DEBUG_IRQ("handling irq %d\n", irq);
155 desc->handle(irq, desc, regs); 155 desc_handle_irq(irq, desc, regs);
156 } 156 }
157 irq++; 157 irq++;
158 desc++; 158 desc++;
@@ -214,7 +214,7 @@ static struct irqchip imx_gpio_chip = {
214 .ack = imx_gpio_ack_irq, 214 .ack = imx_gpio_ack_irq,
215 .mask = imx_gpio_mask_irq, 215 .mask = imx_gpio_mask_irq,
216 .unmask = imx_gpio_unmask_irq, 216 .unmask = imx_gpio_unmask_irq,
217 .type = imx_gpio_irq_type, 217 .set_type = imx_gpio_irq_type,
218}; 218};
219 219
220void __init 220void __init
diff --git a/arch/arm/mach-integrator/integrator_cp.c b/arch/arm/mach-integrator/integrator_cp.c
index 569f328c479d..2be5c03ab87f 100644
--- a/arch/arm/mach-integrator/integrator_cp.c
+++ b/arch/arm/mach-integrator/integrator_cp.c
@@ -170,7 +170,7 @@ sic_handle_irq(unsigned int irq, struct irqdesc *desc, struct pt_regs *regs)
170 irq += IRQ_SIC_START; 170 irq += IRQ_SIC_START;
171 171
172 desc = irq_desc + irq; 172 desc = irq_desc + irq;
173 desc->handle(irq, desc, regs); 173 desc_handle_irq(irq, desc, regs);
174 } while (status); 174 } while (status);
175} 175}
176 176
diff --git a/arch/arm/mach-integrator/platsmp.c b/arch/arm/mach-integrator/platsmp.c
index ead15dfcb53d..ea10bd8c972c 100644
--- a/arch/arm/mach-integrator/platsmp.c
+++ b/arch/arm/mach-integrator/platsmp.c
@@ -15,6 +15,7 @@
15#include <linux/mm.h> 15#include <linux/mm.h>
16 16
17#include <asm/atomic.h> 17#include <asm/atomic.h>
18#include <asm/cacheflush.h>
18#include <asm/delay.h> 19#include <asm/delay.h>
19#include <asm/mmu_context.h> 20#include <asm/mmu_context.h>
20#include <asm/procinfo.h> 21#include <asm/procinfo.h>
@@ -27,12 +28,12 @@ extern void integrator_secondary_startup(void);
27 * control for which core is the next to come out of the secondary 28 * control for which core is the next to come out of the secondary
28 * boot "holding pen" 29 * boot "holding pen"
29 */ 30 */
30volatile int __initdata pen_release = -1; 31volatile int __cpuinitdata pen_release = -1;
31unsigned long __initdata phys_pen_release = 0; 32unsigned long __cpuinitdata phys_pen_release = 0;
32 33
33static DEFINE_SPINLOCK(boot_lock); 34static DEFINE_SPINLOCK(boot_lock);
34 35
35void __init platform_secondary_init(unsigned int cpu) 36void __cpuinit platform_secondary_init(unsigned int cpu)
36{ 37{
37 /* 38 /*
38 * the primary core may have used a "cross call" soft interrupt 39 * the primary core may have used a "cross call" soft interrupt
@@ -61,7 +62,7 @@ void __init platform_secondary_init(unsigned int cpu)
61 spin_unlock(&boot_lock); 62 spin_unlock(&boot_lock);
62} 63}
63 64
64int __init boot_secondary(unsigned int cpu, struct task_struct *idle) 65int __cpuinit boot_secondary(unsigned int cpu, struct task_struct *idle)
65{ 66{
66 unsigned long timeout; 67 unsigned long timeout;
67 68
@@ -80,6 +81,7 @@ int __init boot_secondary(unsigned int cpu, struct task_struct *idle)
80 * "cpu" is Linux's internal ID. 81 * "cpu" is Linux's internal ID.
81 */ 82 */
82 pen_release = cpu; 83 pen_release = cpu;
84 flush_cache_all();
83 85
84 /* 86 /*
85 * XXX 87 * XXX
@@ -174,11 +176,13 @@ void __init smp_prepare_cpus(unsigned int max_cpus)
174 max_cpus = ncores; 176 max_cpus = ncores;
175 177
176 /* 178 /*
177 * Initialise the present mask - this tells us which CPUs should 179 * Initialise the possible/present maps.
178 * be present. 180 * cpu_possible_map describes the set of CPUs which may be present
181 * cpu_present_map describes the set of CPUs populated
179 */ 182 */
180 for (i = 0; i < max_cpus; i++) { 183 for (i = 0; i < max_cpus; i++) {
181 cpu_set(i, cpu_present_mask); 184 cpu_set(i, cpu_possible_map);
185 cpu_set(i, cpu_present_map);
182 } 186 }
183 187
184 /* 188 /*
diff --git a/arch/arm/mach-ixp2000/core.c b/arch/arm/mach-ixp2000/core.c
index 45b18658499f..781d10ae00b7 100644
--- a/arch/arm/mach-ixp2000/core.c
+++ b/arch/arm/mach-ixp2000/core.c
@@ -317,7 +317,7 @@ static void ixp2000_GPIO_irq_handler(unsigned int irq, struct irqdesc *desc, str
317 for (i = 0; i <= 7; i++) { 317 for (i = 0; i <= 7; i++) {
318 if (status & (1<<i)) { 318 if (status & (1<<i)) {
319 desc = irq_desc + i + IRQ_IXP2000_GPIO0; 319 desc = irq_desc + i + IRQ_IXP2000_GPIO0;
320 desc->handle(i + IRQ_IXP2000_GPIO0, desc, regs); 320 desc_handle_irq(i + IRQ_IXP2000_GPIO0, desc, regs);
321 } 321 }
322 } 322 }
323} 323}
@@ -380,10 +380,10 @@ static void ixp2000_GPIO_irq_unmask(unsigned int irq)
380} 380}
381 381
382static struct irqchip ixp2000_GPIO_irq_chip = { 382static struct irqchip ixp2000_GPIO_irq_chip = {
383 .type = ixp2000_GPIO_irq_type, 383 .ack = ixp2000_GPIO_irq_mask_ack,
384 .ack = ixp2000_GPIO_irq_mask_ack, 384 .mask = ixp2000_GPIO_irq_mask,
385 .mask = ixp2000_GPIO_irq_mask, 385 .unmask = ixp2000_GPIO_irq_unmask
386 .unmask = ixp2000_GPIO_irq_unmask 386 .set_type = ixp2000_GPIO_irq_type,
387}; 387};
388 388
389static void ixp2000_pci_irq_mask(unsigned int irq) 389static void ixp2000_pci_irq_mask(unsigned int irq)
diff --git a/arch/arm/mach-ixp2000/ixdp2x00.c b/arch/arm/mach-ixp2000/ixdp2x00.c
index a43369ad876c..63ba0191aa65 100644
--- a/arch/arm/mach-ixp2000/ixdp2x00.c
+++ b/arch/arm/mach-ixp2000/ixdp2x00.c
@@ -133,7 +133,7 @@ static void ixdp2x00_irq_handler(unsigned int irq, struct irqdesc *desc, struct
133 struct irqdesc *cpld_desc; 133 struct irqdesc *cpld_desc;
134 int cpld_irq = IXP2000_BOARD_IRQ(0) + i; 134 int cpld_irq = IXP2000_BOARD_IRQ(0) + i;
135 cpld_desc = irq_desc + cpld_irq; 135 cpld_desc = irq_desc + cpld_irq;
136 cpld_desc->handle(cpld_irq, cpld_desc, regs); 136 desc_handle_irq(cpld_irq, cpld_desc, regs);
137 } 137 }
138 } 138 }
139 139
diff --git a/arch/arm/mach-ixp2000/ixdp2x01.c b/arch/arm/mach-ixp2000/ixdp2x01.c
index 43447dad1657..7a5109921287 100644
--- a/arch/arm/mach-ixp2000/ixdp2x01.c
+++ b/arch/arm/mach-ixp2000/ixdp2x01.c
@@ -82,7 +82,7 @@ static void ixdp2x01_irq_handler(unsigned int irq, struct irqdesc *desc, struct
82 struct irqdesc *cpld_desc; 82 struct irqdesc *cpld_desc;
83 int cpld_irq = IXP2000_BOARD_IRQ(0) + i; 83 int cpld_irq = IXP2000_BOARD_IRQ(0) + i;
84 cpld_desc = irq_desc + cpld_irq; 84 cpld_desc = irq_desc + cpld_irq;
85 cpld_desc->handle(cpld_irq, cpld_desc, regs); 85 desc_handle_irq(cpld_irq, cpld_desc, regs);
86 } 86 }
87 } 87 }
88 88
diff --git a/arch/arm/mach-ixp4xx/common.c b/arch/arm/mach-ixp4xx/common.c
index 04490a9f8f6e..0422e906cc9a 100644
--- a/arch/arm/mach-ixp4xx/common.c
+++ b/arch/arm/mach-ixp4xx/common.c
@@ -38,90 +38,6 @@
38#include <asm/mach/irq.h> 38#include <asm/mach/irq.h>
39#include <asm/mach/time.h> 39#include <asm/mach/time.h>
40 40
41enum ixp4xx_irq_type {
42 IXP4XX_IRQ_LEVEL, IXP4XX_IRQ_EDGE
43};
44static void ixp4xx_config_irq(unsigned irq, enum ixp4xx_irq_type type);
45
46/*************************************************************************
47 * GPIO acces functions
48 *************************************************************************/
49
50/*
51 * Configure GPIO line for input, interrupt, or output operation
52 *
53 * TODO: Enable/disable the irq_desc based on interrupt or output mode.
54 * TODO: Should these be named ixp4xx_gpio_?
55 */
56void gpio_line_config(u8 line, u32 style)
57{
58 static const int gpio2irq[] = {
59 6, 7, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29
60 };
61 u32 enable;
62 volatile u32 *int_reg;
63 u32 int_style;
64 enum ixp4xx_irq_type irq_type;
65
66 enable = *IXP4XX_GPIO_GPOER;
67
68 if (style & IXP4XX_GPIO_OUT) {
69 enable &= ~((1) << line);
70 } else if (style & IXP4XX_GPIO_IN) {
71 enable |= ((1) << line);
72
73 switch (style & IXP4XX_GPIO_INTSTYLE_MASK)
74 {
75 case (IXP4XX_GPIO_ACTIVE_HIGH):
76 int_style = IXP4XX_GPIO_STYLE_ACTIVE_HIGH;
77 irq_type = IXP4XX_IRQ_LEVEL;
78 break;
79 case (IXP4XX_GPIO_ACTIVE_LOW):
80 int_style = IXP4XX_GPIO_STYLE_ACTIVE_LOW;
81 irq_type = IXP4XX_IRQ_LEVEL;
82 break;
83 case (IXP4XX_GPIO_RISING_EDGE):
84 int_style = IXP4XX_GPIO_STYLE_RISING_EDGE;
85 irq_type = IXP4XX_IRQ_EDGE;
86 break;
87 case (IXP4XX_GPIO_FALLING_EDGE):
88 int_style = IXP4XX_GPIO_STYLE_FALLING_EDGE;
89 irq_type = IXP4XX_IRQ_EDGE;
90 break;
91 case (IXP4XX_GPIO_TRANSITIONAL):
92 int_style = IXP4XX_GPIO_STYLE_TRANSITIONAL;
93 irq_type = IXP4XX_IRQ_EDGE;
94 break;
95 default:
96 int_style = IXP4XX_GPIO_STYLE_ACTIVE_HIGH;
97 irq_type = IXP4XX_IRQ_LEVEL;
98 break;
99 }
100
101 if (style & IXP4XX_GPIO_INTSTYLE_MASK)
102 ixp4xx_config_irq(gpio2irq[line], irq_type);
103
104 if (line >= 8) { /* pins 8-15 */
105 line -= 8;
106 int_reg = IXP4XX_GPIO_GPIT2R;
107 }
108 else { /* pins 0-7 */
109 int_reg = IXP4XX_GPIO_GPIT1R;
110 }
111
112 /* Clear the style for the appropriate pin */
113 *int_reg &= ~(IXP4XX_GPIO_STYLE_CLEAR <<
114 (line * IXP4XX_GPIO_STYLE_SIZE));
115
116 /* Set the new style */
117 *int_reg |= (int_style << (line * IXP4XX_GPIO_STYLE_SIZE));
118 }
119
120 *IXP4XX_GPIO_GPOER = enable;
121}
122
123EXPORT_SYMBOL(gpio_line_config);
124
125/************************************************************************* 41/*************************************************************************
126 * IXP4xx chipset I/O mapping 42 * IXP4xx chipset I/O mapping
127 *************************************************************************/ 43 *************************************************************************/
@@ -165,6 +81,69 @@ void __init ixp4xx_map_io(void)
165 * (be it PCI or something else) configures that GPIO line 81 * (be it PCI or something else) configures that GPIO line
166 * as an IRQ. 82 * as an IRQ.
167 **************************************************************************/ 83 **************************************************************************/
84enum ixp4xx_irq_type {
85 IXP4XX_IRQ_LEVEL, IXP4XX_IRQ_EDGE
86};
87
88static void ixp4xx_config_irq(unsigned irq, enum ixp4xx_irq_type type);
89
90/*
91 * IRQ -> GPIO mapping table
92 */
93static int irq2gpio[32] = {
94 -1, -1, -1, -1, -1, -1, 0, 1,
95 -1, -1, -1, -1, -1, -1, -1, -1,
96 -1, -1, -1, 2, 3, 4, 5, 6,
97 7, 8, 9, 10, 11, 12, -1, -1,
98};
99
100static int ixp4xx_set_irq_type(unsigned int irq, unsigned int type)
101{
102 int line = irq2gpio[irq];
103 u32 int_style;
104 enum ixp4xx_irq_type irq_type;
105 volatile u32 *int_reg;
106
107 /*
108 * Only for GPIO IRQs
109 */
110 if (line < 0)
111 return -EINVAL;
112
113 if (type & IRQT_BOTHEDGE) {
114 int_style = IXP4XX_GPIO_STYLE_TRANSITIONAL;
115 irq_type = IXP4XX_IRQ_EDGE;
116 } else if (type & IRQT_RISING) {
117 int_style = IXP4XX_GPIO_STYLE_RISING_EDGE;
118 irq_type = IXP4XX_IRQ_EDGE;
119 } else if (type & IRQT_FALLING) {
120 int_style = IXP4XX_GPIO_STYLE_FALLING_EDGE;
121 irq_type = IXP4XX_IRQ_EDGE;
122 } else if (type & IRQT_HIGH) {
123 int_style = IXP4XX_GPIO_STYLE_ACTIVE_HIGH;
124 irq_type = IXP4XX_IRQ_LEVEL;
125 } else if (type & IRQT_LOW) {
126 int_style = IXP4XX_GPIO_STYLE_ACTIVE_LOW;
127 irq_type = IXP4XX_IRQ_LEVEL;
128 }
129
130 ixp4xx_config_irq(irq, irq_type);
131
132 if (line >= 8) { /* pins 8-15 */
133 line -= 8;
134 int_reg = IXP4XX_GPIO_GPIT2R;
135 } else { /* pins 0-7 */
136 int_reg = IXP4XX_GPIO_GPIT1R;
137 }
138
139 /* Clear the style for the appropriate pin */
140 *int_reg &= ~(IXP4XX_GPIO_STYLE_CLEAR <<
141 (line * IXP4XX_GPIO_STYLE_SIZE));
142
143 /* Set the new style */
144 *int_reg |= (int_style << (line * IXP4XX_GPIO_STYLE_SIZE));
145}
146
168static void ixp4xx_irq_mask(unsigned int irq) 147static void ixp4xx_irq_mask(unsigned int irq)
169{ 148{
170 if (cpu_is_ixp46x() && irq >= 32) 149 if (cpu_is_ixp46x() && irq >= 32)
@@ -183,12 +162,6 @@ static void ixp4xx_irq_unmask(unsigned int irq)
183 162
184static void ixp4xx_irq_ack(unsigned int irq) 163static void ixp4xx_irq_ack(unsigned int irq)
185{ 164{
186 static int irq2gpio[32] = {
187 -1, -1, -1, -1, -1, -1, 0, 1,
188 -1, -1, -1, -1, -1, -1, -1, -1,
189 -1, -1, -1, 2, 3, 4, 5, 6,
190 7, 8, 9, 10, 11, 12, -1, -1,
191 };
192 int line = (irq < 32) ? irq2gpio[irq] : -1; 165 int line = (irq < 32) ? irq2gpio[irq] : -1;
193 166
194 if (line >= 0) 167 if (line >= 0)
@@ -209,12 +182,14 @@ static struct irqchip ixp4xx_irq_level_chip = {
209 .ack = ixp4xx_irq_mask, 182 .ack = ixp4xx_irq_mask,
210 .mask = ixp4xx_irq_mask, 183 .mask = ixp4xx_irq_mask,
211 .unmask = ixp4xx_irq_level_unmask, 184 .unmask = ixp4xx_irq_level_unmask,
185 .type = ixp4xx_set_irq_type
212}; 186};
213 187
214static struct irqchip ixp4xx_irq_edge_chip = { 188static struct irqchip ixp4xx_irq_edge_chip = {
215 .ack = ixp4xx_irq_ack, 189 .ack = ixp4xx_irq_ack,
216 .mask = ixp4xx_irq_mask, 190 .mask = ixp4xx_irq_mask,
217 .unmask = ixp4xx_irq_unmask, 191 .unmask = ixp4xx_irq_unmask,
192 .type = ixp4xx_set_irq_type
218}; 193};
219 194
220static void ixp4xx_config_irq(unsigned irq, enum ixp4xx_irq_type type) 195static void ixp4xx_config_irq(unsigned irq, enum ixp4xx_irq_type type)
diff --git a/arch/arm/mach-ixp4xx/coyote-pci.c b/arch/arm/mach-ixp4xx/coyote-pci.c
index afafb42ae129..60de8a94cff5 100644
--- a/arch/arm/mach-ixp4xx/coyote-pci.c
+++ b/arch/arm/mach-ixp4xx/coyote-pci.c
@@ -30,11 +30,8 @@ extern struct pci_bus *ixp4xx_scan_bus(int nr, struct pci_sys_data *sys);
30 30
31void __init coyote_pci_preinit(void) 31void __init coyote_pci_preinit(void)
32{ 32{
33 gpio_line_config(COYOTE_PCI_SLOT0_PIN, 33 set_irq_type(IRQ_COYOTE_PCI_SLOT0, IRQT_LOW);
34 IXP4XX_GPIO_IN | IXP4XX_GPIO_ACTIVE_LOW); 34 set_irq_type(IRQ_COYOTE_PCI_SLOT1, IRQT_LOW);
35
36 gpio_line_config(COYOTE_PCI_SLOT1_PIN,
37 IXP4XX_GPIO_IN | IXP4XX_GPIO_ACTIVE_LOW);
38 35
39 gpio_line_isr_clear(COYOTE_PCI_SLOT0_PIN); 36 gpio_line_isr_clear(COYOTE_PCI_SLOT0_PIN);
40 gpio_line_isr_clear(COYOTE_PCI_SLOT1_PIN); 37 gpio_line_isr_clear(COYOTE_PCI_SLOT1_PIN);
diff --git a/arch/arm/mach-ixp4xx/coyote-setup.c b/arch/arm/mach-ixp4xx/coyote-setup.c
index 4ff4393ef0ea..8b2f25322452 100644
--- a/arch/arm/mach-ixp4xx/coyote-setup.c
+++ b/arch/arm/mach-ixp4xx/coyote-setup.c
@@ -24,11 +24,6 @@
24#include <asm/mach/arch.h> 24#include <asm/mach/arch.h>
25#include <asm/mach/flash.h> 25#include <asm/mach/flash.h>
26 26
27void __init coyote_map_io(void)
28{
29 ixp4xx_map_io();
30}
31
32static struct flash_platform_data coyote_flash_data = { 27static struct flash_platform_data coyote_flash_data = {
33 .map_name = "cfi_probe", 28 .map_name = "cfi_probe",
34 .width = 2, 29 .width = 2,
@@ -36,7 +31,7 @@ static struct flash_platform_data coyote_flash_data = {
36 31
37static struct resource coyote_flash_resource = { 32static struct resource coyote_flash_resource = {
38 .start = COYOTE_FLASH_BASE, 33 .start = COYOTE_FLASH_BASE,
39 .end = COYOTE_FLASH_BASE + COYOTE_FLASH_SIZE, 34 .end = COYOTE_FLASH_BASE + COYOTE_FLASH_SIZE - 1,
40 .flags = IORESOURCE_MEM, 35 .flags = IORESOURCE_MEM,
41}; 36};
42 37
@@ -61,7 +56,7 @@ static struct plat_serial8250_port coyote_uart_data[] = {
61 .mapbase = IXP4XX_UART2_BASE_PHYS, 56 .mapbase = IXP4XX_UART2_BASE_PHYS,
62 .membase = (char *)IXP4XX_UART2_BASE_VIRT + REG_OFFSET, 57 .membase = (char *)IXP4XX_UART2_BASE_VIRT + REG_OFFSET,
63 .irq = IRQ_IXP4XX_UART2, 58 .irq = IRQ_IXP4XX_UART2,
64 .flags = UPF_BOOT_AUTOCONF, 59 .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST,
65 .iotype = UPIO_MEM, 60 .iotype = UPIO_MEM,
66 .regshift = 2, 61 .regshift = 2,
67 .uartclk = IXP4XX_UART_XTAL, 62 .uartclk = IXP4XX_UART_XTAL,
@@ -107,7 +102,7 @@ MACHINE_START(ADI_COYOTE, "ADI Engineering Coyote")
107 .phys_ram = PHYS_OFFSET, 102 .phys_ram = PHYS_OFFSET,
108 .phys_io = IXP4XX_PERIPHERAL_BASE_PHYS, 103 .phys_io = IXP4XX_PERIPHERAL_BASE_PHYS,
109 .io_pg_offst = ((IXP4XX_PERIPHERAL_BASE_VIRT) >> 18) & 0xfffc, 104 .io_pg_offst = ((IXP4XX_PERIPHERAL_BASE_VIRT) >> 18) & 0xfffc,
110 .map_io = coyote_map_io, 105 .map_io = ixp4xx_map_io,
111 .init_irq = ixp4xx_init_irq, 106 .init_irq = ixp4xx_init_irq,
112 .timer = &ixp4xx_timer, 107 .timer = &ixp4xx_timer,
113 .boot_params = 0x0100, 108 .boot_params = 0x0100,
@@ -125,7 +120,7 @@ MACHINE_START(IXDPG425, "Intel IXDPG425")
125 .phys_ram = PHYS_OFFSET, 120 .phys_ram = PHYS_OFFSET,
126 .phys_io = IXP4XX_PERIPHERAL_BASE_PHYS, 121 .phys_io = IXP4XX_PERIPHERAL_BASE_PHYS,
127 .io_pg_offst = ((IXP4XX_PERIPHERAL_BASE_VIRT) >> 18) & 0xfffc, 122 .io_pg_offst = ((IXP4XX_PERIPHERAL_BASE_VIRT) >> 18) & 0xfffc,
128 .map_io = coyote_map_io, 123 .map_io = ixp4xx_map_io,
129 .init_irq = ixp4xx_init_irq, 124 .init_irq = ixp4xx_init_irq,
130 .timer = &ixp4xx_timer, 125 .timer = &ixp4xx_timer,
131 .boot_params = 0x0100, 126 .boot_params = 0x0100,
diff --git a/arch/arm/mach-ixp4xx/gtwx5715-pci.c b/arch/arm/mach-ixp4xx/gtwx5715-pci.c
index b18035824e3e..a66484b63d36 100644
--- a/arch/arm/mach-ixp4xx/gtwx5715-pci.c
+++ b/arch/arm/mach-ixp4xx/gtwx5715-pci.c
@@ -35,26 +35,20 @@ extern void ixp4xx_pci_preinit(void);
35extern int ixp4xx_setup(int nr, struct pci_sys_data *sys); 35extern int ixp4xx_setup(int nr, struct pci_sys_data *sys);
36extern struct pci_bus *ixp4xx_scan_bus(int nr, struct pci_sys_data *sys); 36extern struct pci_bus *ixp4xx_scan_bus(int nr, struct pci_sys_data *sys);
37 37
38 /*
39 * The exact GPIO pins and IRQs are defined in arch-ixp4xx/gtwx5715.h
40 * Slot 0 isn't actually populated with a card connector but
41 * we initialize it anyway in case a future version has the
42 * slot populated or someone with good soldering skills has
43 * some free time.
44 */
45
46
47static void gtwx5715_init_gpio(u8 pin, u32 style)
48{
49 gpio_line_config(pin, style | IXP4XX_GPIO_ACTIVE_LOW);
50
51 if (style & IXP4XX_GPIO_IN) gpio_line_isr_clear(pin);
52}
53 38
39/*
40 * The exact GPIO pins and IRQs are defined in arch-ixp4xx/gtwx5715.h
41 * Slot 0 isn't actually populated with a card connector but
42 * we initialize it anyway in case a future version has the
43 * slot populated or someone with good soldering skills has
44 * some free time.
45 */
54void __init gtwx5715_pci_preinit(void) 46void __init gtwx5715_pci_preinit(void)
55{ 47{
56 gtwx5715_init_gpio(GTWX5715_PCI_SLOT0_INTA_GPIO, IXP4XX_GPIO_IN); 48 set_irq_type(GTWX5715_PCI_SLOT0_INTA_IRQ, IRQT_LOW);
57 gtwx5715_init_gpio(GTWX5715_PCI_SLOT1_INTA_GPIO, IXP4XX_GPIO_IN); 49 set_irq_type(GTWX5715_PCI_SLOT0_INTB_IRQ, IRQT_LOW);
50 set_irq_type(GTWX5715_PCI_SLOT1_INTA_IRQ, IRQT_LOW);
51 set_irq_type(GTWX5715_PCI_SLOT1_INTB_IRQ, IRQT_LOW);
58 52
59 ixp4xx_pci_preinit(); 53 ixp4xx_pci_preinit();
60} 54}
diff --git a/arch/arm/mach-ixp4xx/gtwx5715-setup.c b/arch/arm/mach-ixp4xx/gtwx5715-setup.c
index 8ba1cd9406e7..3fd92c5cbaa8 100644
--- a/arch/arm/mach-ixp4xx/gtwx5715-setup.c
+++ b/arch/arm/mach-ixp4xx/gtwx5715-setup.c
@@ -83,7 +83,7 @@ static struct plat_serial8250_port gtwx5715_uart_platform_data[] = {
83 .mapbase = IXP4XX_UART2_BASE_PHYS, 83 .mapbase = IXP4XX_UART2_BASE_PHYS,
84 .membase = (char *)IXP4XX_UART2_BASE_VIRT + REG_OFFSET, 84 .membase = (char *)IXP4XX_UART2_BASE_VIRT + REG_OFFSET,
85 .irq = IRQ_IXP4XX_UART2, 85 .irq = IRQ_IXP4XX_UART2,
86 .flags = UPF_BOOT_AUTOCONF, 86 .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST,
87 .iotype = UPIO_MEM, 87 .iotype = UPIO_MEM,
88 .regshift = 2, 88 .regshift = 2,
89 .uartclk = IXP4XX_UART_XTAL, 89 .uartclk = IXP4XX_UART_XTAL,
@@ -101,12 +101,6 @@ static struct platform_device gtwx5715_uart_device = {
101 .resource = gtwx5715_uart_resources, 101 .resource = gtwx5715_uart_resources,
102}; 102};
103 103
104
105void __init gtwx5715_map_io(void)
106{
107 ixp4xx_map_io();
108}
109
110static struct flash_platform_data gtwx5715_flash_data = { 104static struct flash_platform_data gtwx5715_flash_data = {
111 .map_name = "cfi_probe", 105 .map_name = "cfi_probe",
112 .width = 2, 106 .width = 2,
@@ -114,7 +108,7 @@ static struct flash_platform_data gtwx5715_flash_data = {
114 108
115static struct resource gtwx5715_flash_resource = { 109static struct resource gtwx5715_flash_resource = {
116 .start = GTWX5715_FLASH_BASE, 110 .start = GTWX5715_FLASH_BASE,
117 .end = GTWX5715_FLASH_BASE + GTWX5715_FLASH_SIZE, 111 .end = GTWX5715_FLASH_BASE + GTWX5715_FLASH_SIZE - 1,
118 .flags = IORESOURCE_MEM, 112 .flags = IORESOURCE_MEM,
119}; 113};
120 114
@@ -144,7 +138,7 @@ MACHINE_START(GTWX5715, "Gemtek GTWX5715 (Linksys WRV54G)")
144 .phys_ram = PHYS_OFFSET, 138 .phys_ram = PHYS_OFFSET,
145 .phys_io = IXP4XX_UART2_BASE_PHYS, 139 .phys_io = IXP4XX_UART2_BASE_PHYS,
146 .io_pg_offst = ((IXP4XX_UART2_BASE_VIRT) >> 18) & 0xfffc, 140 .io_pg_offst = ((IXP4XX_UART2_BASE_VIRT) >> 18) & 0xfffc,
147 .map_io = gtwx5715_map_io, 141 .map_io = ixp4xx_map_io,
148 .init_irq = ixp4xx_init_irq, 142 .init_irq = ixp4xx_init_irq,
149 .timer = &ixp4xx_timer, 143 .timer = &ixp4xx_timer,
150 .boot_params = 0x0100, 144 .boot_params = 0x0100,
diff --git a/arch/arm/mach-ixp4xx/ixdp425-pci.c b/arch/arm/mach-ixp4xx/ixdp425-pci.c
index c2ab9ebb5980..f9a1d3e7d692 100644
--- a/arch/arm/mach-ixp4xx/ixdp425-pci.c
+++ b/arch/arm/mach-ixp4xx/ixdp425-pci.c
@@ -27,14 +27,10 @@
27 27
28void __init ixdp425_pci_preinit(void) 28void __init ixdp425_pci_preinit(void)
29{ 29{
30 gpio_line_config(IXDP425_PCI_INTA_PIN, 30 set_irq_type(IRQ_IXDP425_PCI_INTA, IRQT_LOW);
31 IXP4XX_GPIO_IN | IXP4XX_GPIO_ACTIVE_LOW); 31 set_irq_type(IRQ_IXDP425_PCI_INTB, IRQT_LOW);
32 gpio_line_config(IXDP425_PCI_INTB_PIN, 32 set_irq_type(IRQ_IXDP425_PCI_INTC, IRQT_LOW);
33 IXP4XX_GPIO_IN | IXP4XX_GPIO_ACTIVE_LOW); 33 set_irq_type(IRQ_IXDP425_PCI_INTD, IRQT_LOW);
34 gpio_line_config(IXDP425_PCI_INTC_PIN,
35 IXP4XX_GPIO_IN | IXP4XX_GPIO_ACTIVE_LOW);
36 gpio_line_config(IXDP425_PCI_INTD_PIN,
37 IXP4XX_GPIO_IN | IXP4XX_GPIO_ACTIVE_LOW);
38 34
39 gpio_line_isr_clear(IXDP425_PCI_INTA_PIN); 35 gpio_line_isr_clear(IXDP425_PCI_INTA_PIN);
40 gpio_line_isr_clear(IXDP425_PCI_INTB_PIN); 36 gpio_line_isr_clear(IXDP425_PCI_INTB_PIN);
diff --git a/arch/arm/mach-ixp4xx/ixdp425-setup.c b/arch/arm/mach-ixp4xx/ixdp425-setup.c
index c2ba759e9946..6c14ff3c23a0 100644
--- a/arch/arm/mach-ixp4xx/ixdp425-setup.c
+++ b/arch/arm/mach-ixp4xx/ixdp425-setup.c
@@ -24,11 +24,6 @@
24#include <asm/mach/arch.h> 24#include <asm/mach/arch.h>
25#include <asm/mach/flash.h> 25#include <asm/mach/flash.h>
26 26
27void __init ixdp425_map_io(void)
28{
29 ixp4xx_map_io();
30}
31
32static struct flash_platform_data ixdp425_flash_data = { 27static struct flash_platform_data ixdp425_flash_data = {
33 .map_name = "cfi_probe", 28 .map_name = "cfi_probe",
34 .width = 2, 29 .width = 2,
@@ -36,7 +31,7 @@ static struct flash_platform_data ixdp425_flash_data = {
36 31
37static struct resource ixdp425_flash_resource = { 32static struct resource ixdp425_flash_resource = {
38 .start = IXDP425_FLASH_BASE, 33 .start = IXDP425_FLASH_BASE,
39 .end = IXDP425_FLASH_BASE + IXDP425_FLASH_SIZE, 34 .end = IXDP425_FLASH_BASE + IXDP425_FLASH_SIZE - 1,
40 .flags = IORESOURCE_MEM, 35 .flags = IORESOURCE_MEM,
41}; 36};
42 37
@@ -82,7 +77,7 @@ static struct plat_serial8250_port ixdp425_uart_data[] = {
82 .mapbase = IXP4XX_UART1_BASE_PHYS, 77 .mapbase = IXP4XX_UART1_BASE_PHYS,
83 .membase = (char *)IXP4XX_UART1_BASE_VIRT + REG_OFFSET, 78 .membase = (char *)IXP4XX_UART1_BASE_VIRT + REG_OFFSET,
84 .irq = IRQ_IXP4XX_UART1, 79 .irq = IRQ_IXP4XX_UART1,
85 .flags = UPF_BOOT_AUTOCONF, 80 .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST,
86 .iotype = UPIO_MEM, 81 .iotype = UPIO_MEM,
87 .regshift = 2, 82 .regshift = 2,
88 .uartclk = IXP4XX_UART_XTAL, 83 .uartclk = IXP4XX_UART_XTAL,
@@ -91,7 +86,7 @@ static struct plat_serial8250_port ixdp425_uart_data[] = {
91 .mapbase = IXP4XX_UART2_BASE_PHYS, 86 .mapbase = IXP4XX_UART2_BASE_PHYS,
92 .membase = (char *)IXP4XX_UART2_BASE_VIRT + REG_OFFSET, 87 .membase = (char *)IXP4XX_UART2_BASE_VIRT + REG_OFFSET,
93 .irq = IRQ_IXP4XX_UART1, 88 .irq = IRQ_IXP4XX_UART1,
94 .flags = UPF_BOOT_AUTOCONF, 89 .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST,
95 .iotype = UPIO_MEM, 90 .iotype = UPIO_MEM,
96 .regshift = 2, 91 .regshift = 2,
97 .uartclk = IXP4XX_UART_XTAL, 92 .uartclk = IXP4XX_UART_XTAL,
@@ -133,7 +128,7 @@ MACHINE_START(IXDP425, "Intel IXDP425 Development Platform")
133 .phys_ram = PHYS_OFFSET, 128 .phys_ram = PHYS_OFFSET,
134 .phys_io = IXP4XX_PERIPHERAL_BASE_PHYS, 129 .phys_io = IXP4XX_PERIPHERAL_BASE_PHYS,
135 .io_pg_offst = ((IXP4XX_PERIPHERAL_BASE_VIRT) >> 18) & 0xfffc, 130 .io_pg_offst = ((IXP4XX_PERIPHERAL_BASE_VIRT) >> 18) & 0xfffc,
136 .map_io = ixdp425_map_io, 131 .map_io = ixp4xx_map_io,
137 .init_irq = ixp4xx_init_irq, 132 .init_irq = ixp4xx_init_irq,
138 .timer = &ixp4xx_timer, 133 .timer = &ixp4xx_timer,
139 .boot_params = 0x0100, 134 .boot_params = 0x0100,
@@ -145,7 +140,7 @@ MACHINE_START(IXDP465, "Intel IXDP465 Development Platform")
145 .phys_ram = PHYS_OFFSET, 140 .phys_ram = PHYS_OFFSET,
146 .phys_io = IXP4XX_PERIPHERAL_BASE_PHYS, 141 .phys_io = IXP4XX_PERIPHERAL_BASE_PHYS,
147 .io_pg_offst = ((IXP4XX_PERIPHERAL_BASE_VIRT) >> 18) & 0xfffc, 142 .io_pg_offst = ((IXP4XX_PERIPHERAL_BASE_VIRT) >> 18) & 0xfffc,
148 .map_io = ixdp425_map_io, 143 .map_io = ixp4xx_map_io,
149 .init_irq = ixp4xx_init_irq, 144 .init_irq = ixp4xx_init_irq,
150 .timer = &ixp4xx_timer, 145 .timer = &ixp4xx_timer,
151 .boot_params = 0x0100, 146 .boot_params = 0x0100,
@@ -157,7 +152,7 @@ MACHINE_START(IXCDP1100, "Intel IXCDP1100 Development Platform")
157 .phys_ram = PHYS_OFFSET, 152 .phys_ram = PHYS_OFFSET,
158 .phys_io = IXP4XX_PERIPHERAL_BASE_PHYS, 153 .phys_io = IXP4XX_PERIPHERAL_BASE_PHYS,
159 .io_pg_offst = ((IXP4XX_PERIPHERAL_BASE_VIRT) >> 18) & 0xfffc, 154 .io_pg_offst = ((IXP4XX_PERIPHERAL_BASE_VIRT) >> 18) & 0xfffc,
160 .map_io = ixdp425_map_io, 155 .map_io = ixp4xx_map_io,
161 .init_irq = ixp4xx_init_irq, 156 .init_irq = ixp4xx_init_irq,
162 .timer = &ixp4xx_timer, 157 .timer = &ixp4xx_timer,
163 .boot_params = 0x0100, 158 .boot_params = 0x0100,
@@ -176,7 +171,7 @@ MACHINE_START(AVILA, "Gateworks Avila Network Platform")
176 .phys_ram = PHYS_OFFSET, 171 .phys_ram = PHYS_OFFSET,
177 .phys_io = IXP4XX_PERIPHERAL_BASE_PHYS, 172 .phys_io = IXP4XX_PERIPHERAL_BASE_PHYS,
178 .io_pg_offst = ((IXP4XX_PERIPHERAL_BASE_VIRT) >> 18) & 0xfffc, 173 .io_pg_offst = ((IXP4XX_PERIPHERAL_BASE_VIRT) >> 18) & 0xfffc,
179 .map_io = ixdp425_map_io, 174 .map_io = ixp4xx_map_io,
180 .init_irq = ixp4xx_init_irq, 175 .init_irq = ixp4xx_init_irq,
181 .timer = &ixp4xx_timer, 176 .timer = &ixp4xx_timer,
182 .boot_params = 0x0100, 177 .boot_params = 0x0100,
diff --git a/arch/arm/mach-ixp4xx/ixdpg425-pci.c b/arch/arm/mach-ixp4xx/ixdpg425-pci.c
index ce4563f00676..fe5e7660de1d 100644
--- a/arch/arm/mach-ixp4xx/ixdpg425-pci.c
+++ b/arch/arm/mach-ixp4xx/ixdpg425-pci.c
@@ -29,8 +29,8 @@ extern struct pci_bus *ixp4xx_scan_bus(int nr, struct pci_sys_data *sys);
29 29
30void __init ixdpg425_pci_preinit(void) 30void __init ixdpg425_pci_preinit(void)
31{ 31{
32 gpio_line_config(6, IXP4XX_GPIO_IN | IXP4XX_GPIO_ACTIVE_LOW); 32 set_irq_type(IRQ_IXP4XX_GPIO6, IRQT_LOW);
33 gpio_line_config(7, IXP4XX_GPIO_IN | IXP4XX_GPIO_ACTIVE_LOW); 33 set_irq_type(IRQ_IXP4XX_GPIO7, IRQT_LOW);
34 34
35 gpio_line_isr_clear(6); 35 gpio_line_isr_clear(6);
36 gpio_line_isr_clear(7); 36 gpio_line_isr_clear(7);
diff --git a/arch/arm/mach-lh7a40x/common.h b/arch/arm/mach-lh7a40x/common.h
index beda7c2602fb..578a52461fdb 100644
--- a/arch/arm/mach-lh7a40x/common.h
+++ b/arch/arm/mach-lh7a40x/common.h
@@ -13,4 +13,4 @@ extern struct sys_timer lh7a40x_timer;
13extern void lh7a400_init_irq (void); 13extern void lh7a400_init_irq (void);
14extern void lh7a404_init_irq (void); 14extern void lh7a404_init_irq (void);
15 15
16#define IRQ_DISPATCH(irq) irq_desc[irq].handle ((irq), &irq_desc[irq], regs) 16#define IRQ_DISPATCH(irq) desc_handle_irq((irq),(irq_desc + irq), regs)
diff --git a/arch/arm/mach-omap1/fpga.c b/arch/arm/mach-omap1/fpga.c
index 7c08f6c2e1d0..c12a78335625 100644
--- a/arch/arm/mach-omap1/fpga.c
+++ b/arch/arm/mach-omap1/fpga.c
@@ -102,7 +102,7 @@ void innovator_fpga_IRQ_demux(unsigned int irq, struct irqdesc *desc,
102 fpga_irq++, stat >>= 1) { 102 fpga_irq++, stat >>= 1) {
103 if (stat & 1) { 103 if (stat & 1) {
104 d = irq_desc + fpga_irq; 104 d = irq_desc + fpga_irq;
105 d->handle(fpga_irq, d, regs); 105 desc_handle_irq(fpga_irq, d, regs);
106 } 106 }
107 } 107 }
108} 108}
diff --git a/arch/arm/mach-omap1/leds-h2p2-debug.c b/arch/arm/mach-omap1/leds-h2p2-debug.c
index 6e98290cca5c..ec0d8285f243 100644
--- a/arch/arm/mach-omap1/leds-h2p2-debug.c
+++ b/arch/arm/mach-omap1/leds-h2p2-debug.c
@@ -13,7 +13,6 @@
13#include <linux/init.h> 13#include <linux/init.h>
14#include <linux/kernel_stat.h> 14#include <linux/kernel_stat.h>
15#include <linux/sched.h> 15#include <linux/sched.h>
16#include <linux/version.h>
17 16
18#include <asm/io.h> 17#include <asm/io.h>
19#include <asm/hardware.h> 18#include <asm/hardware.h>
diff --git a/arch/arm/mach-pxa/irq.c b/arch/arm/mach-pxa/irq.c
index f3cac43124a5..539b596005fc 100644
--- a/arch/arm/mach-pxa/irq.c
+++ b/arch/arm/mach-pxa/irq.c
@@ -133,7 +133,7 @@ static struct irqchip pxa_low_gpio_chip = {
133 .ack = pxa_ack_low_gpio, 133 .ack = pxa_ack_low_gpio,
134 .mask = pxa_mask_low_irq, 134 .mask = pxa_mask_low_irq,
135 .unmask = pxa_unmask_low_irq, 135 .unmask = pxa_unmask_low_irq,
136 .type = pxa_gpio_irq_type, 136 .set_type = pxa_gpio_irq_type,
137}; 137};
138 138
139/* 139/*
@@ -157,7 +157,7 @@ static void pxa_gpio_demux_handler(unsigned int irq, struct irqdesc *desc,
157 mask >>= 2; 157 mask >>= 2;
158 do { 158 do {
159 if (mask & 1) 159 if (mask & 1)
160 desc->handle(irq, desc, regs); 160 desc_handle_irq(irq, desc, regs);
161 irq++; 161 irq++;
162 desc++; 162 desc++;
163 mask >>= 1; 163 mask >>= 1;
@@ -172,7 +172,7 @@ static void pxa_gpio_demux_handler(unsigned int irq, struct irqdesc *desc,
172 desc = irq_desc + irq; 172 desc = irq_desc + irq;
173 do { 173 do {
174 if (mask & 1) 174 if (mask & 1)
175 desc->handle(irq, desc, regs); 175 desc_handle_irq(irq, desc, regs);
176 irq++; 176 irq++;
177 desc++; 177 desc++;
178 mask >>= 1; 178 mask >>= 1;
@@ -187,7 +187,7 @@ static void pxa_gpio_demux_handler(unsigned int irq, struct irqdesc *desc,
187 desc = irq_desc + irq; 187 desc = irq_desc + irq;
188 do { 188 do {
189 if (mask & 1) 189 if (mask & 1)
190 desc->handle(irq, desc, regs); 190 desc_handle_irq(irq, desc, regs);
191 irq++; 191 irq++;
192 desc++; 192 desc++;
193 mask >>= 1; 193 mask >>= 1;
@@ -203,7 +203,7 @@ static void pxa_gpio_demux_handler(unsigned int irq, struct irqdesc *desc,
203 desc = irq_desc + irq; 203 desc = irq_desc + irq;
204 do { 204 do {
205 if (mask & 1) 205 if (mask & 1)
206 desc->handle(irq, desc, regs); 206 desc_handle_irq(irq, desc, regs);
207 irq++; 207 irq++;
208 desc++; 208 desc++;
209 mask >>= 1; 209 mask >>= 1;
@@ -241,7 +241,7 @@ static struct irqchip pxa_muxed_gpio_chip = {
241 .ack = pxa_ack_muxed_gpio, 241 .ack = pxa_ack_muxed_gpio,
242 .mask = pxa_mask_muxed_gpio, 242 .mask = pxa_mask_muxed_gpio,
243 .unmask = pxa_unmask_muxed_gpio, 243 .unmask = pxa_unmask_muxed_gpio,
244 .type = pxa_gpio_irq_type, 244 .set_type = pxa_gpio_irq_type,
245}; 245};
246 246
247 247
diff --git a/arch/arm/mach-pxa/lubbock.c b/arch/arm/mach-pxa/lubbock.c
index 6309853b59be..923f6eb774c0 100644
--- a/arch/arm/mach-pxa/lubbock.c
+++ b/arch/arm/mach-pxa/lubbock.c
@@ -84,7 +84,7 @@ static void lubbock_irq_handler(unsigned int irq, struct irqdesc *desc,
84 if (likely(pending)) { 84 if (likely(pending)) {
85 irq = LUBBOCK_IRQ(0) + __ffs(pending); 85 irq = LUBBOCK_IRQ(0) + __ffs(pending);
86 desc = irq_desc + irq; 86 desc = irq_desc + irq;
87 desc->handle(irq, desc, regs); 87 desc_handle_irq(irq, desc, regs);
88 } 88 }
89 pending = LUB_IRQ_SET_CLR & lubbock_irq_enabled; 89 pending = LUB_IRQ_SET_CLR & lubbock_irq_enabled;
90 } while (pending); 90 } while (pending);
diff --git a/arch/arm/mach-pxa/mainstone.c b/arch/arm/mach-pxa/mainstone.c
index 827b7b5a5be8..85fdb5b1470a 100644
--- a/arch/arm/mach-pxa/mainstone.c
+++ b/arch/arm/mach-pxa/mainstone.c
@@ -72,7 +72,7 @@ static void mainstone_irq_handler(unsigned int irq, struct irqdesc *desc,
72 if (likely(pending)) { 72 if (likely(pending)) {
73 irq = MAINSTONE_IRQ(0) + __ffs(pending); 73 irq = MAINSTONE_IRQ(0) + __ffs(pending);
74 desc = irq_desc + irq; 74 desc = irq_desc + irq;
75 desc->handle(irq, desc, regs); 75 desc_handle_irq(irq, desc, regs);
76 } 76 }
77 pending = MST_INTSETCLR & mainstone_irq_enabled; 77 pending = MST_INTSETCLR & mainstone_irq_enabled;
78 } while (pending); 78 } while (pending);
diff --git a/arch/arm/mach-pxa/time.c b/arch/arm/mach-pxa/time.c
index 6e5202154f91..7dad3f1465e0 100644
--- a/arch/arm/mach-pxa/time.c
+++ b/arch/arm/mach-pxa/time.c
@@ -70,6 +70,11 @@ static unsigned long pxa_gettimeoffset (void)
70 return usec; 70 return usec;
71} 71}
72 72
73#ifdef CONFIG_NO_IDLE_HZ
74static unsigned long initial_match;
75static int match_posponed;
76#endif
77
73static irqreturn_t 78static irqreturn_t
74pxa_timer_interrupt(int irq, void *dev_id, struct pt_regs *regs) 79pxa_timer_interrupt(int irq, void *dev_id, struct pt_regs *regs)
75{ 80{
@@ -77,11 +82,19 @@ pxa_timer_interrupt(int irq, void *dev_id, struct pt_regs *regs)
77 82
78 write_seqlock(&xtime_lock); 83 write_seqlock(&xtime_lock);
79 84
85#ifdef CONFIG_NO_IDLE_HZ
86 if (match_posponed) {
87 match_posponed = 0;
88 OSMR0 = initial_match;
89 }
90#endif
91
80 /* Loop until we get ahead of the free running timer. 92 /* Loop until we get ahead of the free running timer.
81 * This ensures an exact clock tick count and time accuracy. 93 * This ensures an exact clock tick count and time accuracy.
82 * IRQs are disabled inside the loop to ensure coherence between 94 * Since IRQs are disabled at this point, coherence between
83 * lost_ticks (updated in do_timer()) and the match reg value, so we 95 * lost_ticks(updated in do_timer()) and the match reg value is
84 * can use do_gettimeofday() from interrupt handlers. 96 * ensured, hence we can use do_gettimeofday() from interrupt
97 * handlers.
85 * 98 *
86 * HACK ALERT: it seems that the PXA timer regs aren't updated right 99 * HACK ALERT: it seems that the PXA timer regs aren't updated right
87 * away in all cases when a write occurs. We therefore compare with 100 * away in all cases when a write occurs. We therefore compare with
@@ -126,6 +139,42 @@ static void __init pxa_timer_init(void)
126 OSCR = 0; /* initialize free-running timer, force first match */ 139 OSCR = 0; /* initialize free-running timer, force first match */
127} 140}
128 141
142#ifdef CONFIG_NO_IDLE_HZ
143static int pxa_dyn_tick_enable_disable(void)
144{
145 /* nothing to do */
146 return 0;
147}
148
149static void pxa_dyn_tick_reprogram(unsigned long ticks)
150{
151 if (ticks > 1) {
152 initial_match = OSMR0;
153 OSMR0 = initial_match + ticks * LATCH;
154 match_posponed = 1;
155 }
156}
157
158static irqreturn_t
159pxa_dyn_tick_handler(int irq, void *dev_id, struct pt_regs *regs)
160{
161 if (match_posponed) {
162 match_posponed = 0;
163 OSMR0 = initial_match;
164 if ( (signed long)(initial_match - OSCR) <= 8 )
165 return pxa_timer_interrupt(irq, dev_id, regs);
166 }
167 return IRQ_NONE;
168}
169
170static struct dyn_tick_timer pxa_dyn_tick = {
171 .enable = pxa_dyn_tick_enable_disable,
172 .disable = pxa_dyn_tick_enable_disable,
173 .reprogram = pxa_dyn_tick_reprogram,
174 .handler = pxa_dyn_tick_handler,
175};
176#endif
177
129#ifdef CONFIG_PM 178#ifdef CONFIG_PM
130static unsigned long osmr[4], oier; 179static unsigned long osmr[4], oier;
131 180
@@ -161,4 +210,7 @@ struct sys_timer pxa_timer = {
161 .suspend = pxa_timer_suspend, 210 .suspend = pxa_timer_suspend,
162 .resume = pxa_timer_resume, 211 .resume = pxa_timer_resume,
163 .offset = pxa_gettimeoffset, 212 .offset = pxa_gettimeoffset,
213#ifdef CONFIG_NO_IDLE_HZ
214 .dyn_tick = &pxa_dyn_tick,
215#endif
164}; 216};
diff --git a/arch/arm/mach-s3c2410/Makefile b/arch/arm/mach-s3c2410/Makefile
index f99b689e4392..55ed7c7e57da 100644
--- a/arch/arm/mach-s3c2410/Makefile
+++ b/arch/arm/mach-s3c2410/Makefile
@@ -23,6 +23,8 @@ obj-$(CONFIG_PM_SIMTEC) += pm-simtec.o
23# S3C2440 support 23# S3C2440 support
24 24
25obj-$(CONFIG_CPU_S3C2440) += s3c2440.o s3c2440-dsc.o 25obj-$(CONFIG_CPU_S3C2440) += s3c2440.o s3c2440-dsc.o
26obj-$(CONFIG_CPU_S3C2440) += s3c2440-irq.o
27obj-$(CONFIG_CPU_S3C2440) += s3c2440-clock.o
26 28
27# machine specific support 29# machine specific support
28 30
diff --git a/arch/arm/mach-s3c2410/bast-irq.c b/arch/arm/mach-s3c2410/bast-irq.c
index 5e5bbe893cbb..49914709fa09 100644
--- a/arch/arm/mach-s3c2410/bast-irq.c
+++ b/arch/arm/mach-s3c2410/bast-irq.c
@@ -124,7 +124,7 @@ bast_irq_pc104_demux(unsigned int irq,
124 irqno = bast_pc104_irqs[i]; 124 irqno = bast_pc104_irqs[i];
125 desc = irq_desc + irqno; 125 desc = irq_desc + irqno;
126 126
127 desc->handle(irqno, desc, regs); 127 desc_handle_irq(irqno, desc, regs);
128 } 128 }
129 129
130 stat >>= 1; 130 stat >>= 1;
diff --git a/arch/arm/mach-s3c2410/clock.c b/arch/arm/mach-s3c2410/clock.c
index 8d986b8401c2..f59608268751 100644
--- a/arch/arm/mach-s3c2410/clock.c
+++ b/arch/arm/mach-s3c2410/clock.c
@@ -388,6 +388,7 @@ int __init s3c24xx_setup_clocks(unsigned long xtal,
388 unsigned long hclk, 388 unsigned long hclk,
389 unsigned long pclk) 389 unsigned long pclk)
390{ 390{
391 unsigned long clkslow = __raw_readl(S3C2410_CLKSLOW);
391 struct clk *clkp = init_clocks; 392 struct clk *clkp = init_clocks;
392 int ptr; 393 int ptr;
393 int ret; 394 int ret;
@@ -446,62 +447,13 @@ int __init s3c24xx_setup_clocks(unsigned long xtal,
446 } 447 }
447 } 448 }
448 449
449 return 0; 450 /* show the clock-slow value */
450}
451 451
452/* S3C2440 extended clock support */ 452 printk("CLOCK: Slow mode (%ld.%ld MHz), %s, MPLL %s, UPLL %s\n",
453 453 print_mhz(xtal / ( 2 * S3C2410_CLKSLOW_GET_SLOWVAL(clkslow))),
454#ifdef CONFIG_CPU_S3C2440 454 (clkslow & S3C2410_CLKSLOW_SLOW) ? "slow" : "fast",
455 455 (clkslow & S3C2410_CLKSLOW_MPLL_OFF) ? "off" : "on",
456static struct clk s3c2440_clk_upll = { 456 (clkslow & S3C2410_CLKSLOW_UCLK_OFF) ? "off" : "on");
457 .name = "upll",
458 .id = -1,
459};
460
461static struct clk s3c2440_clk_cam = {
462 .name = "camif",
463 .parent = &clk_h,
464 .id = -1,
465 .enable = s3c24xx_clkcon_enable,
466 .ctrlbit = S3C2440_CLKCON_CAMERA,
467};
468
469static struct clk s3c2440_clk_ac97 = {
470 .name = "ac97",
471 .parent = &clk_p,
472 .id = -1,
473 .enable = s3c24xx_clkcon_enable,
474 .ctrlbit = S3C2440_CLKCON_CAMERA,
475};
476
477static int s3c2440_clk_add(struct sys_device *sysdev)
478{
479 unsigned long upllcon = __raw_readl(S3C2410_UPLLCON);
480
481 s3c2440_clk_upll.rate = s3c2410_get_pll(upllcon, clk_xtal.rate);
482
483 printk("S3C2440: Clock Support, UPLL %ld.%03ld MHz\n",
484 print_mhz(s3c2440_clk_upll.rate));
485
486 s3c24xx_register_clock(&s3c2440_clk_ac97);
487 s3c24xx_register_clock(&s3c2440_clk_cam);
488 s3c24xx_register_clock(&s3c2440_clk_upll);
489
490 clk_disable(&s3c2440_clk_ac97);
491 clk_disable(&s3c2440_clk_cam);
492 457
493 return 0; 458 return 0;
494} 459}
495
496static struct sysdev_driver s3c2440_clk_driver = {
497 .add = s3c2440_clk_add,
498};
499
500static int s3c24xx_clk_driver(void)
501{
502 return sysdev_driver_register(&s3c2440_sysclass, &s3c2440_clk_driver);
503}
504
505arch_initcall(s3c24xx_clk_driver);
506
507#endif /* CONFIG_CPU_S3C2440 */
diff --git a/arch/arm/mach-s3c2410/dma.c b/arch/arm/mach-s3c2410/dma.c
index c7c28890d406..65feaf20d23e 100644
--- a/arch/arm/mach-s3c2410/dma.c
+++ b/arch/arm/mach-s3c2410/dma.c
@@ -436,7 +436,7 @@ int s3c2410_dma_enqueue(unsigned int channel, void *id,
436 436
437 buf = kmem_cache_alloc(dma_kmem, GFP_ATOMIC); 437 buf = kmem_cache_alloc(dma_kmem, GFP_ATOMIC);
438 if (buf == NULL) { 438 if (buf == NULL) {
439 pr_debug("%s: out of memory (%d alloc)\n", 439 pr_debug("%s: out of memory (%ld alloc)\n",
440 __FUNCTION__, sizeof(*buf)); 440 __FUNCTION__, sizeof(*buf));
441 return -ENOMEM; 441 return -ENOMEM;
442 } 442 }
diff --git a/arch/arm/mach-s3c2410/irq.c b/arch/arm/mach-s3c2410/irq.c
index cf9f46d88061..66d8c068e940 100644
--- a/arch/arm/mach-s3c2410/irq.c
+++ b/arch/arm/mach-s3c2410/irq.c
@@ -45,6 +45,9 @@
45 * 45 *
46 * 28-Jun-2005 Ben Dooks 46 * 28-Jun-2005 Ben Dooks
47 * Mark IRQ_LCD valid 47 * Mark IRQ_LCD valid
48 *
49 * 25-Jul-2005 Ben Dooks
50 * Split the S3C2440 IRQ code to seperate file
48*/ 51*/
49 52
50#include <linux/init.h> 53#include <linux/init.h>
@@ -65,11 +68,7 @@
65 68
66#include "cpu.h" 69#include "cpu.h"
67#include "pm.h" 70#include "pm.h"
68 71#include "irq.h"
69#define irqdbf(x...)
70#define irqdbf2(x...)
71
72#define EXTINT_OFF (IRQ_EINT4 - 4)
73 72
74/* wakeup irq control */ 73/* wakeup irq control */
75 74
@@ -181,18 +180,18 @@ s3c_irq_unmask(unsigned int irqno)
181 __raw_writel(mask, S3C2410_INTMSK); 180 __raw_writel(mask, S3C2410_INTMSK);
182} 181}
183 182
184static struct irqchip s3c_irq_level_chip = { 183struct irqchip s3c_irq_level_chip = {
185 .ack = s3c_irq_maskack, 184 .ack = s3c_irq_maskack,
186 .mask = s3c_irq_mask, 185 .mask = s3c_irq_mask,
187 .unmask = s3c_irq_unmask, 186 .unmask = s3c_irq_unmask,
188 .wake = s3c_irq_wake 187 .set_wake = s3c_irq_wake
189}; 188};
190 189
191static struct irqchip s3c_irq_chip = { 190static struct irqchip s3c_irq_chip = {
192 .ack = s3c_irq_ack, 191 .ack = s3c_irq_ack,
193 .mask = s3c_irq_mask, 192 .mask = s3c_irq_mask,
194 .unmask = s3c_irq_unmask, 193 .unmask = s3c_irq_unmask,
195 .wake = s3c_irq_wake 194 .set_wake = s3c_irq_wake
196}; 195};
197 196
198/* S3C2410_EINTMASK 197/* S3C2410_EINTMASK
@@ -351,16 +350,16 @@ static struct irqchip s3c_irqext_chip = {
351 .mask = s3c_irqext_mask, 350 .mask = s3c_irqext_mask,
352 .unmask = s3c_irqext_unmask, 351 .unmask = s3c_irqext_unmask,
353 .ack = s3c_irqext_ack, 352 .ack = s3c_irqext_ack,
354 .type = s3c_irqext_type, 353 .set_type = s3c_irqext_type,
355 .wake = s3c_irqext_wake 354 .set_wake = s3c_irqext_wake
356}; 355};
357 356
358static struct irqchip s3c_irq_eint0t4 = { 357static struct irqchip s3c_irq_eint0t4 = {
359 .ack = s3c_irq_ack, 358 .ack = s3c_irq_ack,
360 .mask = s3c_irq_mask, 359 .mask = s3c_irq_mask,
361 .unmask = s3c_irq_unmask, 360 .unmask = s3c_irq_unmask,
362 .wake = s3c_irq_wake, 361 .set_wake = s3c_irq_wake,
363 .type = s3c_irqext_type, 362 .set_type = s3c_irqext_type,
364}; 363};
365 364
366/* mask values for the parent registers for each of the interrupt types */ 365/* mask values for the parent registers for each of the interrupt types */
@@ -370,84 +369,6 @@ static struct irqchip s3c_irq_eint0t4 = {
370#define INTMSK_UART2 (1UL << (IRQ_UART2 - IRQ_EINT0)) 369#define INTMSK_UART2 (1UL << (IRQ_UART2 - IRQ_EINT0))
371#define INTMSK_ADCPARENT (1UL << (IRQ_ADCPARENT - IRQ_EINT0)) 370#define INTMSK_ADCPARENT (1UL << (IRQ_ADCPARENT - IRQ_EINT0))
372 371
373static inline void
374s3c_irqsub_mask(unsigned int irqno, unsigned int parentbit,
375 int subcheck)
376{
377 unsigned long mask;
378 unsigned long submask;
379
380 submask = __raw_readl(S3C2410_INTSUBMSK);
381 mask = __raw_readl(S3C2410_INTMSK);
382
383 submask |= (1UL << (irqno - IRQ_S3CUART_RX0));
384
385 /* check to see if we need to mask the parent IRQ */
386
387 if ((submask & subcheck) == subcheck) {
388 __raw_writel(mask | parentbit, S3C2410_INTMSK);
389 }
390
391 /* write back masks */
392 __raw_writel(submask, S3C2410_INTSUBMSK);
393
394}
395
396static inline void
397s3c_irqsub_unmask(unsigned int irqno, unsigned int parentbit)
398{
399 unsigned long mask;
400 unsigned long submask;
401
402 submask = __raw_readl(S3C2410_INTSUBMSK);
403 mask = __raw_readl(S3C2410_INTMSK);
404
405 submask &= ~(1UL << (irqno - IRQ_S3CUART_RX0));
406 mask &= ~parentbit;
407
408 /* write back masks */
409 __raw_writel(submask, S3C2410_INTSUBMSK);
410 __raw_writel(mask, S3C2410_INTMSK);
411}
412
413
414static inline void
415s3c_irqsub_maskack(unsigned int irqno, unsigned int parentmask, unsigned int group)
416{
417 unsigned int bit = 1UL << (irqno - IRQ_S3CUART_RX0);
418
419 s3c_irqsub_mask(irqno, parentmask, group);
420
421 __raw_writel(bit, S3C2410_SUBSRCPND);
422
423 /* only ack parent if we've got all the irqs (seems we must
424 * ack, all and hope that the irq system retriggers ok when
425 * the interrupt goes off again)
426 */
427
428 if (1) {
429 __raw_writel(parentmask, S3C2410_SRCPND);
430 __raw_writel(parentmask, S3C2410_INTPND);
431 }
432}
433
434static inline void
435s3c_irqsub_ack(unsigned int irqno, unsigned int parentmask, unsigned int group)
436{
437 unsigned int bit = 1UL << (irqno - IRQ_S3CUART_RX0);
438
439 __raw_writel(bit, S3C2410_SUBSRCPND);
440
441 /* only ack parent if we've got all the irqs (seems we must
442 * ack, all and hope that the irq system retriggers ok when
443 * the interrupt goes off again)
444 */
445
446 if (1) {
447 __raw_writel(parentmask, S3C2410_SRCPND);
448 __raw_writel(parentmask, S3C2410_INTPND);
449 }
450}
451 372
452/* UART0 */ 373/* UART0 */
453 374
@@ -575,11 +496,11 @@ static void s3c_irq_demux_adc(unsigned int irq,
575 if (subsrc != 0) { 496 if (subsrc != 0) {
576 if (subsrc & 1) { 497 if (subsrc & 1) {
577 mydesc = irq_desc + IRQ_TC; 498 mydesc = irq_desc + IRQ_TC;
578 mydesc->handle( IRQ_TC, mydesc, regs); 499 desc_handle_irq(IRQ_TC, mydesc, regs);
579 } 500 }
580 if (subsrc & 2) { 501 if (subsrc & 2) {
581 mydesc = irq_desc + IRQ_ADC; 502 mydesc = irq_desc + IRQ_ADC;
582 mydesc->handle(IRQ_ADC, mydesc, regs); 503 desc_handle_irq(IRQ_ADC, mydesc, regs);
583 } 504 }
584 } 505 }
585} 506}
@@ -608,17 +529,17 @@ static void s3c_irq_demux_uart(unsigned int start,
608 desc = irq_desc + start; 529 desc = irq_desc + start;
609 530
610 if (subsrc & 1) 531 if (subsrc & 1)
611 desc->handle(start, desc, regs); 532 desc_handle_irq(start, desc, regs);
612 533
613 desc++; 534 desc++;
614 535
615 if (subsrc & 2) 536 if (subsrc & 2)
616 desc->handle(start+1, desc, regs); 537 desc_handle_irq(start+1, desc, regs);
617 538
618 desc++; 539 desc++;
619 540
620 if (subsrc & 4) 541 if (subsrc & 4)
621 desc->handle(start+2, desc, regs); 542 desc_handle_irq(start+2, desc, regs);
622 } 543 }
623} 544}
624 545
@@ -794,174 +715,3 @@ void __init s3c24xx_init_irq(void)
794 715
795 irqdbf("s3c2410: registered interrupt handlers\n"); 716 irqdbf("s3c2410: registered interrupt handlers\n");
796} 717}
797
798/* s3c2440 irq code
799*/
800
801#ifdef CONFIG_CPU_S3C2440
802
803/* WDT/AC97 */
804
805static void s3c_irq_demux_wdtac97(unsigned int irq,
806 struct irqdesc *desc,
807 struct pt_regs *regs)
808{
809 unsigned int subsrc, submsk;
810 struct irqdesc *mydesc;
811
812 /* read the current pending interrupts, and the mask
813 * for what it is available */
814
815 subsrc = __raw_readl(S3C2410_SUBSRCPND);
816 submsk = __raw_readl(S3C2410_INTSUBMSK);
817
818 subsrc &= ~submsk;
819 subsrc >>= 13;
820 subsrc &= 3;
821
822 if (subsrc != 0) {
823 if (subsrc & 1) {
824 mydesc = irq_desc + IRQ_S3C2440_WDT;
825 mydesc->handle( IRQ_S3C2440_WDT, mydesc, regs);
826 }
827 if (subsrc & 2) {
828 mydesc = irq_desc + IRQ_S3C2440_AC97;
829 mydesc->handle(IRQ_S3C2440_AC97, mydesc, regs);
830 }
831 }
832}
833
834
835#define INTMSK_WDT (1UL << (IRQ_WDT - IRQ_EINT0))
836
837static void
838s3c_irq_wdtac97_mask(unsigned int irqno)
839{
840 s3c_irqsub_mask(irqno, INTMSK_WDT, 3<<13);
841}
842
843static void
844s3c_irq_wdtac97_unmask(unsigned int irqno)
845{
846 s3c_irqsub_unmask(irqno, INTMSK_WDT);
847}
848
849static void
850s3c_irq_wdtac97_ack(unsigned int irqno)
851{
852 s3c_irqsub_maskack(irqno, INTMSK_WDT, 3<<13);
853}
854
855static struct irqchip s3c_irq_wdtac97 = {
856 .mask = s3c_irq_wdtac97_mask,
857 .unmask = s3c_irq_wdtac97_unmask,
858 .ack = s3c_irq_wdtac97_ack,
859};
860
861/* camera irq */
862
863static void s3c_irq_demux_cam(unsigned int irq,
864 struct irqdesc *desc,
865 struct pt_regs *regs)
866{
867 unsigned int subsrc, submsk;
868 struct irqdesc *mydesc;
869
870 /* read the current pending interrupts, and the mask
871 * for what it is available */
872
873 subsrc = __raw_readl(S3C2410_SUBSRCPND);
874 submsk = __raw_readl(S3C2410_INTSUBMSK);
875
876 subsrc &= ~submsk;
877 subsrc >>= 11;
878 subsrc &= 3;
879
880 if (subsrc != 0) {
881 if (subsrc & 1) {
882 mydesc = irq_desc + IRQ_S3C2440_CAM_C;
883 mydesc->handle( IRQ_S3C2440_WDT, mydesc, regs);
884 }
885 if (subsrc & 2) {
886 mydesc = irq_desc + IRQ_S3C2440_CAM_P;
887 mydesc->handle(IRQ_S3C2440_AC97, mydesc, regs);
888 }
889 }
890}
891
892#define INTMSK_CAM (1UL << (IRQ_CAM - IRQ_EINT0))
893
894static void
895s3c_irq_cam_mask(unsigned int irqno)
896{
897 s3c_irqsub_mask(irqno, INTMSK_CAM, 3<<11);
898}
899
900static void
901s3c_irq_cam_unmask(unsigned int irqno)
902{
903 s3c_irqsub_unmask(irqno, INTMSK_CAM);
904}
905
906static void
907s3c_irq_cam_ack(unsigned int irqno)
908{
909 s3c_irqsub_maskack(irqno, INTMSK_CAM, 3<<11);
910}
911
912static struct irqchip s3c_irq_cam = {
913 .mask = s3c_irq_cam_mask,
914 .unmask = s3c_irq_cam_unmask,
915 .ack = s3c_irq_cam_ack,
916};
917
918static int s3c2440_irq_add(struct sys_device *sysdev)
919{
920 unsigned int irqno;
921
922 printk("S3C2440: IRQ Support\n");
923
924 set_irq_chip(IRQ_NFCON, &s3c_irq_level_chip);
925 set_irq_handler(IRQ_NFCON, do_level_IRQ);
926 set_irq_flags(IRQ_NFCON, IRQF_VALID);
927
928 /* add new chained handler for wdt, ac7 */
929
930 set_irq_chip(IRQ_WDT, &s3c_irq_level_chip);
931 set_irq_handler(IRQ_WDT, do_level_IRQ);
932 set_irq_chained_handler(IRQ_WDT, s3c_irq_demux_wdtac97);
933
934 for (irqno = IRQ_S3C2440_WDT; irqno <= IRQ_S3C2440_AC97; irqno++) {
935 set_irq_chip(irqno, &s3c_irq_wdtac97);
936 set_irq_handler(irqno, do_level_IRQ);
937 set_irq_flags(irqno, IRQF_VALID);
938 }
939
940 /* add chained handler for camera */
941
942 set_irq_chip(IRQ_CAM, &s3c_irq_level_chip);
943 set_irq_handler(IRQ_CAM, do_level_IRQ);
944 set_irq_chained_handler(IRQ_CAM, s3c_irq_demux_cam);
945
946 for (irqno = IRQ_S3C2440_CAM_C; irqno <= IRQ_S3C2440_CAM_P; irqno++) {
947 set_irq_chip(irqno, &s3c_irq_cam);
948 set_irq_handler(irqno, do_level_IRQ);
949 set_irq_flags(irqno, IRQF_VALID);
950 }
951
952 return 0;
953}
954
955static struct sysdev_driver s3c2440_irq_driver = {
956 .add = s3c2440_irq_add,
957};
958
959static int s3c24xx_irq_driver(void)
960{
961 return sysdev_driver_register(&s3c2440_sysclass, &s3c2440_irq_driver);
962}
963
964arch_initcall(s3c24xx_irq_driver);
965
966#endif /* CONFIG_CPU_S3C2440 */
967
diff --git a/arch/arm/mach-s3c2410/irq.h b/arch/arm/mach-s3c2410/irq.h
new file mode 100644
index 000000000000..4abf0ca14e00
--- /dev/null
+++ b/arch/arm/mach-s3c2410/irq.h
@@ -0,0 +1,99 @@
1/* arch/arm/mach-s3c2410/irq.h
2 *
3 * Copyright (c) 2004-2005 Simtec Electronics
4 * Ben Dooks <ben@simtec.co.uk>
5 *
6 * Header file for S3C24XX CPU IRQ support
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 * Modifications:
13*/
14
15#define irqdbf(x...)
16#define irqdbf2(x...)
17
18#define EXTINT_OFF (IRQ_EINT4 - 4)
19
20extern struct irqchip s3c_irq_level_chip;
21
22static inline void
23s3c_irqsub_mask(unsigned int irqno, unsigned int parentbit,
24 int subcheck)
25{
26 unsigned long mask;
27 unsigned long submask;
28
29 submask = __raw_readl(S3C2410_INTSUBMSK);
30 mask = __raw_readl(S3C2410_INTMSK);
31
32 submask |= (1UL << (irqno - IRQ_S3CUART_RX0));
33
34 /* check to see if we need to mask the parent IRQ */
35
36 if ((submask & subcheck) == subcheck) {
37 __raw_writel(mask | parentbit, S3C2410_INTMSK);
38 }
39
40 /* write back masks */
41 __raw_writel(submask, S3C2410_INTSUBMSK);
42
43}
44
45static inline void
46s3c_irqsub_unmask(unsigned int irqno, unsigned int parentbit)
47{
48 unsigned long mask;
49 unsigned long submask;
50
51 submask = __raw_readl(S3C2410_INTSUBMSK);
52 mask = __raw_readl(S3C2410_INTMSK);
53
54 submask &= ~(1UL << (irqno - IRQ_S3CUART_RX0));
55 mask &= ~parentbit;
56
57 /* write back masks */
58 __raw_writel(submask, S3C2410_INTSUBMSK);
59 __raw_writel(mask, S3C2410_INTMSK);
60}
61
62
63static inline void
64s3c_irqsub_maskack(unsigned int irqno, unsigned int parentmask, unsigned int group)
65{
66 unsigned int bit = 1UL << (irqno - IRQ_S3CUART_RX0);
67
68 s3c_irqsub_mask(irqno, parentmask, group);
69
70 __raw_writel(bit, S3C2410_SUBSRCPND);
71
72 /* only ack parent if we've got all the irqs (seems we must
73 * ack, all and hope that the irq system retriggers ok when
74 * the interrupt goes off again)
75 */
76
77 if (1) {
78 __raw_writel(parentmask, S3C2410_SRCPND);
79 __raw_writel(parentmask, S3C2410_INTPND);
80 }
81}
82
83static inline void
84s3c_irqsub_ack(unsigned int irqno, unsigned int parentmask, unsigned int group)
85{
86 unsigned int bit = 1UL << (irqno - IRQ_S3CUART_RX0);
87
88 __raw_writel(bit, S3C2410_SUBSRCPND);
89
90 /* only ack parent if we've got all the irqs (seems we must
91 * ack, all and hope that the irq system retriggers ok when
92 * the interrupt goes off again)
93 */
94
95 if (1) {
96 __raw_writel(parentmask, S3C2410_SRCPND);
97 __raw_writel(parentmask, S3C2410_INTPND);
98 }
99}
diff --git a/arch/arm/mach-s3c2410/mach-bast.c b/arch/arm/mach-s3c2410/mach-bast.c
index ccb6bcefa46c..e9182242da95 100644
--- a/arch/arm/mach-s3c2410/mach-bast.c
+++ b/arch/arm/mach-s3c2410/mach-bast.c
@@ -25,9 +25,12 @@
25 * 14-Jan-2005 BJD Add support for muitlple NAND devices 25 * 14-Jan-2005 BJD Add support for muitlple NAND devices
26 * 03-Mar-2005 BJD Ensured that bast-cpld.h is included 26 * 03-Mar-2005 BJD Ensured that bast-cpld.h is included
27 * 10-Mar-2005 LCVR Changed S3C2410_VA to S3C24XX_VA 27 * 10-Mar-2005 LCVR Changed S3C2410_VA to S3C24XX_VA
28 * 14-Mar-2006 BJD Updated for __iomem changes 28 * 14-Mar-2005 BJD Updated for __iomem changes
29 * 22-Jun-2006 BJD Added DM9000 platform information 29 * 22-Jun-2005 BJD Added DM9000 platform information
30 * 28-Jun-2006 BJD Moved pm functionality out to common code 30 * 28-Jun-2005 BJD Moved pm functionality out to common code
31 * 17-Jul-2005 BJD Changed to platform device for SuperIO 16550s
32 * 25-Jul-2005 BJD Removed ASIX static mappings
33 * 27-Jul-2005 BJD Ensure maximum frequency of i2c bus
31*/ 34*/
32 35
33#include <linux/kernel.h> 36#include <linux/kernel.h>
@@ -58,12 +61,15 @@
58#include <asm/arch/regs-mem.h> 61#include <asm/arch/regs-mem.h>
59#include <asm/arch/regs-lcd.h> 62#include <asm/arch/regs-lcd.h>
60#include <asm/arch/nand.h> 63#include <asm/arch/nand.h>
64#include <asm/arch/iic.h>
61 65
62#include <linux/mtd/mtd.h> 66#include <linux/mtd/mtd.h>
63#include <linux/mtd/nand.h> 67#include <linux/mtd/nand.h>
64#include <linux/mtd/nand_ecc.h> 68#include <linux/mtd/nand_ecc.h>
65#include <linux/mtd/partitions.h> 69#include <linux/mtd/partitions.h>
66 70
71#include <linux/serial_8250.h>
72
67#include "clock.h" 73#include "clock.h"
68#include "devs.h" 74#include "devs.h"
69#include "cpu.h" 75#include "cpu.h"
@@ -113,7 +119,6 @@ static struct map_desc bast_iodesc[] __initdata = {
113 /* slow, byte */ 119 /* slow, byte */
114 { VA_C2(BAST_VA_ISAIO), PA_CS2(BAST_PA_ISAIO), SZ_16M, MT_DEVICE }, 120 { VA_C2(BAST_VA_ISAIO), PA_CS2(BAST_PA_ISAIO), SZ_16M, MT_DEVICE },
115 { VA_C2(BAST_VA_ISAMEM), PA_CS2(BAST_PA_ISAMEM), SZ_16M, MT_DEVICE }, 121 { VA_C2(BAST_VA_ISAMEM), PA_CS2(BAST_PA_ISAMEM), SZ_16M, MT_DEVICE },
116 { VA_C2(BAST_VA_ASIXNET), PA_CS3(BAST_PA_ASIXNET), SZ_1M, MT_DEVICE },
117 { VA_C2(BAST_VA_SUPERIO), PA_CS2(BAST_PA_SUPERIO), SZ_1M, MT_DEVICE }, 122 { VA_C2(BAST_VA_SUPERIO), PA_CS2(BAST_PA_SUPERIO), SZ_1M, MT_DEVICE },
118 { VA_C2(BAST_VA_IDEPRI), PA_CS3(BAST_PA_IDEPRI), SZ_1M, MT_DEVICE }, 123 { VA_C2(BAST_VA_IDEPRI), PA_CS3(BAST_PA_IDEPRI), SZ_1M, MT_DEVICE },
119 { VA_C2(BAST_VA_IDESEC), PA_CS3(BAST_PA_IDESEC), SZ_1M, MT_DEVICE }, 124 { VA_C2(BAST_VA_IDESEC), PA_CS3(BAST_PA_IDESEC), SZ_1M, MT_DEVICE },
@@ -123,7 +128,6 @@ static struct map_desc bast_iodesc[] __initdata = {
123 /* slow, word */ 128 /* slow, word */
124 { VA_C3(BAST_VA_ISAIO), PA_CS3(BAST_PA_ISAIO), SZ_16M, MT_DEVICE }, 129 { VA_C3(BAST_VA_ISAIO), PA_CS3(BAST_PA_ISAIO), SZ_16M, MT_DEVICE },
125 { VA_C3(BAST_VA_ISAMEM), PA_CS3(BAST_PA_ISAMEM), SZ_16M, MT_DEVICE }, 130 { VA_C3(BAST_VA_ISAMEM), PA_CS3(BAST_PA_ISAMEM), SZ_16M, MT_DEVICE },
126 { VA_C3(BAST_VA_ASIXNET), PA_CS3(BAST_PA_ASIXNET), SZ_1M, MT_DEVICE },
127 { VA_C3(BAST_VA_SUPERIO), PA_CS3(BAST_PA_SUPERIO), SZ_1M, MT_DEVICE }, 131 { VA_C3(BAST_VA_SUPERIO), PA_CS3(BAST_PA_SUPERIO), SZ_1M, MT_DEVICE },
128 { VA_C3(BAST_VA_IDEPRI), PA_CS3(BAST_PA_IDEPRI), SZ_1M, MT_DEVICE }, 132 { VA_C3(BAST_VA_IDEPRI), PA_CS3(BAST_PA_IDEPRI), SZ_1M, MT_DEVICE },
129 { VA_C3(BAST_VA_IDESEC), PA_CS3(BAST_PA_IDESEC), SZ_1M, MT_DEVICE }, 133 { VA_C3(BAST_VA_IDESEC), PA_CS3(BAST_PA_IDESEC), SZ_1M, MT_DEVICE },
@@ -133,7 +137,6 @@ static struct map_desc bast_iodesc[] __initdata = {
133 /* fast, byte */ 137 /* fast, byte */
134 { VA_C4(BAST_VA_ISAIO), PA_CS4(BAST_PA_ISAIO), SZ_16M, MT_DEVICE }, 138 { VA_C4(BAST_VA_ISAIO), PA_CS4(BAST_PA_ISAIO), SZ_16M, MT_DEVICE },
135 { VA_C4(BAST_VA_ISAMEM), PA_CS4(BAST_PA_ISAMEM), SZ_16M, MT_DEVICE }, 139 { VA_C4(BAST_VA_ISAMEM), PA_CS4(BAST_PA_ISAMEM), SZ_16M, MT_DEVICE },
136 { VA_C4(BAST_VA_ASIXNET), PA_CS5(BAST_PA_ASIXNET), SZ_1M, MT_DEVICE },
137 { VA_C4(BAST_VA_SUPERIO), PA_CS4(BAST_PA_SUPERIO), SZ_1M, MT_DEVICE }, 140 { VA_C4(BAST_VA_SUPERIO), PA_CS4(BAST_PA_SUPERIO), SZ_1M, MT_DEVICE },
138 { VA_C4(BAST_VA_IDEPRI), PA_CS5(BAST_PA_IDEPRI), SZ_1M, MT_DEVICE }, 141 { VA_C4(BAST_VA_IDEPRI), PA_CS5(BAST_PA_IDEPRI), SZ_1M, MT_DEVICE },
139 { VA_C4(BAST_VA_IDESEC), PA_CS5(BAST_PA_IDESEC), SZ_1M, MT_DEVICE }, 142 { VA_C4(BAST_VA_IDESEC), PA_CS5(BAST_PA_IDESEC), SZ_1M, MT_DEVICE },
@@ -143,7 +146,6 @@ static struct map_desc bast_iodesc[] __initdata = {
143 /* fast, word */ 146 /* fast, word */
144 { VA_C5(BAST_VA_ISAIO), PA_CS5(BAST_PA_ISAIO), SZ_16M, MT_DEVICE }, 147 { VA_C5(BAST_VA_ISAIO), PA_CS5(BAST_PA_ISAIO), SZ_16M, MT_DEVICE },
145 { VA_C5(BAST_VA_ISAMEM), PA_CS5(BAST_PA_ISAMEM), SZ_16M, MT_DEVICE }, 148 { VA_C5(BAST_VA_ISAMEM), PA_CS5(BAST_PA_ISAMEM), SZ_16M, MT_DEVICE },
146 { VA_C5(BAST_VA_ASIXNET), PA_CS5(BAST_PA_ASIXNET), SZ_1M, MT_DEVICE },
147 { VA_C5(BAST_VA_SUPERIO), PA_CS5(BAST_PA_SUPERIO), SZ_1M, MT_DEVICE }, 149 { VA_C5(BAST_VA_SUPERIO), PA_CS5(BAST_PA_SUPERIO), SZ_1M, MT_DEVICE },
148 { VA_C5(BAST_VA_IDEPRI), PA_CS5(BAST_PA_IDEPRI), SZ_1M, MT_DEVICE }, 150 { VA_C5(BAST_VA_IDEPRI), PA_CS5(BAST_PA_IDEPRI), SZ_1M, MT_DEVICE },
149 { VA_C5(BAST_VA_IDESEC), PA_CS5(BAST_PA_IDESEC), SZ_1M, MT_DEVICE }, 151 { VA_C5(BAST_VA_IDESEC), PA_CS5(BAST_PA_IDESEC), SZ_1M, MT_DEVICE },
@@ -304,7 +306,7 @@ static void bast_nand_select(struct s3c2410_nand_set *set, int slot)
304} 306}
305 307
306static struct s3c2410_platform_nand bast_nand_info = { 308static struct s3c2410_platform_nand bast_nand_info = {
307 .tacls = 80, 309 .tacls = 40,
308 .twrph0 = 80, 310 .twrph0 = 80,
309 .twrph1 = 80, 311 .twrph1 = 80,
310 .nr_sets = ARRAY_SIZE(bast_nand_sets), 312 .nr_sets = ARRAY_SIZE(bast_nand_sets),
@@ -351,6 +353,50 @@ static struct platform_device bast_device_dm9k = {
351 } 353 }
352}; 354};
353 355
356/* serial devices */
357
358#define SERIAL_BASE (S3C2410_CS2 + BAST_PA_SUPERIO)
359#define SERIAL_FLAGS (UPF_BOOT_AUTOCONF | UPF_IOREMAP | UPF_SHARE_IRQ)
360#define SERIAL_CLK (1843200)
361
362static struct plat_serial8250_port bast_sio_data[] = {
363 [0] = {
364 .mapbase = SERIAL_BASE + 0x2f8,
365 .irq = IRQ_PCSERIAL1,
366 .flags = SERIAL_FLAGS,
367 .iotype = UPIO_MEM,
368 .regshift = 0,
369 .uartclk = SERIAL_CLK,
370 },
371 [1] = {
372 .mapbase = SERIAL_BASE + 0x3f8,
373 .irq = IRQ_PCSERIAL2,
374 .flags = SERIAL_FLAGS,
375 .iotype = UPIO_MEM,
376 .regshift = 0,
377 .uartclk = SERIAL_CLK,
378 },
379 { }
380};
381
382static struct platform_device bast_sio = {
383 .name = "serial8250",
384 .id = 0,
385 .dev = {
386 .platform_data = &bast_sio_data,
387 },
388};
389
390/* we have devices on the bus which cannot work much over the
391 * standard 100KHz i2c bus frequency
392*/
393
394static struct s3c2410_platform_i2c bast_i2c_info = {
395 .flags = 0,
396 .slave_addr = 0x10,
397 .bus_freq = 100*1000,
398 .max_freq = 130*1000,
399};
354 400
355/* Standard BAST devices */ 401/* Standard BAST devices */
356 402
@@ -364,6 +410,7 @@ static struct platform_device *bast_devices[] __initdata = {
364 &s3c_device_nand, 410 &s3c_device_nand,
365 &bast_device_nor, 411 &bast_device_nor,
366 &bast_device_dm9k, 412 &bast_device_dm9k,
413 &bast_sio,
367}; 414};
368 415
369static struct clk *bast_clocks[] = { 416static struct clk *bast_clocks[] = {
@@ -397,6 +444,7 @@ void __init bast_map_io(void)
397 s3c24xx_uclk.parent = &s3c24xx_clkout1; 444 s3c24xx_uclk.parent = &s3c24xx_clkout1;
398 445
399 s3c_device_nand.dev.platform_data = &bast_nand_info; 446 s3c_device_nand.dev.platform_data = &bast_nand_info;
447 s3c_device_i2c.dev.platform_data = &bast_i2c_info;
400 448
401 s3c24xx_init_io(bast_iodesc, ARRAY_SIZE(bast_iodesc)); 449 s3c24xx_init_io(bast_iodesc, ARRAY_SIZE(bast_iodesc));
402 s3c24xx_init_clocks(0); 450 s3c24xx_init_clocks(0);
diff --git a/arch/arm/mach-s3c2410/pm.c b/arch/arm/mach-s3c2410/pm.c
index 13a48ee77484..fe57d966a34d 100644
--- a/arch/arm/mach-s3c2410/pm.c
+++ b/arch/arm/mach-s3c2410/pm.c
@@ -585,14 +585,16 @@ static int s3c2410_pm_enter(suspend_state_t state)
585 585
586 s3c2410_pm_check_store(); 586 s3c2410_pm_check_store();
587 587
588 // need to make some form of time-delta
589
590 /* send the cpu to sleep... */ 588 /* send the cpu to sleep... */
591 589
592 __raw_writel(0x00, S3C2410_CLKCON); /* turn off clocks over sleep */ 590 __raw_writel(0x00, S3C2410_CLKCON); /* turn off clocks over sleep */
593 591
594 s3c2410_cpu_suspend(regs_save); 592 s3c2410_cpu_suspend(regs_save);
595 593
594 /* restore the cpu state */
595
596 cpu_init();
597
596 /* unset the return-from-sleep flag, to ensure reset */ 598 /* unset the return-from-sleep flag, to ensure reset */
597 599
598 tmp = __raw_readl(S3C2410_GSTATUS2); 600 tmp = __raw_readl(S3C2410_GSTATUS2);
diff --git a/arch/arm/mach-s3c2410/s3c2410.c b/arch/arm/mach-s3c2410/s3c2410.c
index ff2f25409e44..0b88993dfd27 100644
--- a/arch/arm/mach-s3c2410/s3c2410.c
+++ b/arch/arm/mach-s3c2410/s3c2410.c
@@ -18,6 +18,7 @@
18 * 28-Sep-2004 BJD Updates for new serial port bits 18 * 28-Sep-2004 BJD Updates for new serial port bits
19 * 04-Nov-2004 BJD Updated UART configuration process 19 * 04-Nov-2004 BJD Updated UART configuration process
20 * 10-Jan-2005 BJD Removed s3c2410_clock_tick_rate 20 * 10-Jan-2005 BJD Removed s3c2410_clock_tick_rate
21 * 13-Aug-2005 DA Removed UART from initial I/O mappings
21*/ 22*/
22 23
23#include <linux/kernel.h> 24#include <linux/kernel.h>
@@ -49,10 +50,9 @@ static struct map_desc s3c2410_iodesc[] __initdata = {
49 IODESC_ENT(USBHOST), 50 IODESC_ENT(USBHOST),
50 IODESC_ENT(CLKPWR), 51 IODESC_ENT(CLKPWR),
51 IODESC_ENT(LCD), 52 IODESC_ENT(LCD),
52 IODESC_ENT(UART),
53 IODESC_ENT(TIMER), 53 IODESC_ENT(TIMER),
54 IODESC_ENT(ADC), 54 IODESC_ENT(ADC),
55 IODESC_ENT(WATCHDOG) 55 IODESC_ENT(WATCHDOG),
56}; 56};
57 57
58static struct resource s3c_uart0_resource[] = { 58static struct resource s3c_uart0_resource[] = {
diff --git a/arch/arm/mach-s3c2410/s3c2440-clock.c b/arch/arm/mach-s3c2410/s3c2440-clock.c
new file mode 100644
index 000000000000..c67e0979aec3
--- /dev/null
+++ b/arch/arm/mach-s3c2410/s3c2440-clock.c
@@ -0,0 +1,118 @@
1/* linux/arch/arm/mach-s3c2410/s3c2440-clock.c
2 *
3 * Copyright (c) 2004-2005 Simtec Electronics
4 * http://armlinux.simtec.co.uk/
5 * Ben Dooks <ben@simtec.co.uk>
6 *
7 * S3C2440 Clock support
8 *
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License as published by
11 * the Free Software Foundation; either version 2 of the License, or
12 * (at your option) any later version.
13 *
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
18 *
19 * You should have received a copy of the GNU General Public License
20 * along with this program; if not, write to the Free Software
21 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
22*/
23
24#include <linux/init.h>
25#include <linux/module.h>
26#include <linux/kernel.h>
27#include <linux/list.h>
28#include <linux/errno.h>
29#include <linux/err.h>
30#include <linux/device.h>
31#include <linux/sysdev.h>
32
33#include <linux/interrupt.h>
34#include <linux/ioport.h>
35
36#include <asm/hardware.h>
37#include <asm/atomic.h>
38#include <asm/irq.h>
39#include <asm/io.h>
40
41#include <asm/hardware/clock.h>
42#include <asm/arch/regs-clock.h>
43
44#include "clock.h"
45#include "cpu.h"
46
47/* S3C2440 extended clock support */
48
49static struct clk s3c2440_clk_upll = {
50 .name = "upll",
51 .id = -1,
52};
53
54static struct clk s3c2440_clk_cam = {
55 .name = "camif",
56 .id = -1,
57 .enable = s3c24xx_clkcon_enable,
58 .ctrlbit = S3C2440_CLKCON_CAMERA,
59};
60
61static struct clk s3c2440_clk_ac97 = {
62 .name = "ac97",
63 .id = -1,
64 .enable = s3c24xx_clkcon_enable,
65 .ctrlbit = S3C2440_CLKCON_CAMERA,
66};
67
68static int s3c2440_clk_add(struct sys_device *sysdev)
69{
70 unsigned long upllcon = __raw_readl(S3C2410_UPLLCON);
71 unsigned long camdivn = __raw_readl(S3C2440_CAMDIVN);
72 struct clk *clk_h;
73 struct clk *clk_p;
74 struct clk *clk_xtal;
75
76 clk_xtal = clk_get(NULL, "xtal");
77 if (IS_ERR(clk_xtal)) {
78 printk(KERN_ERR "S3C2440: Failed to get clk_xtal\n");
79 return -EINVAL;
80 }
81
82 s3c2440_clk_upll.rate = s3c2410_get_pll(upllcon, clk_xtal->rate);
83
84 printk("S3C2440: Clock Support, UPLL %ld.%03ld MHz, DVS %s\n",
85 print_mhz(s3c2440_clk_upll.rate),
86 (camdivn & S3C2440_CAMDIVN_DVSEN) ? "on" : "off");
87
88 clk_p = clk_get(NULL, "pclk");
89 clk_h = clk_get(NULL, "hclk");
90
91 if (IS_ERR(clk_p) || IS_ERR(clk_h)) {
92 printk(KERN_ERR "S3C2440: Failed to get parent clocks\n");
93 return -EINVAL;
94 }
95
96 s3c2440_clk_cam.parent = clk_h;
97 s3c2440_clk_ac97.parent = clk_p;
98
99 s3c24xx_register_clock(&s3c2440_clk_ac97);
100 s3c24xx_register_clock(&s3c2440_clk_cam);
101 s3c24xx_register_clock(&s3c2440_clk_upll);
102
103 clk_disable(&s3c2440_clk_ac97);
104 clk_disable(&s3c2440_clk_cam);
105
106 return 0;
107}
108
109static struct sysdev_driver s3c2440_clk_driver = {
110 .add = s3c2440_clk_add,
111};
112
113static __init int s3c24xx_clk_driver(void)
114{
115 return sysdev_driver_register(&s3c2440_sysclass, &s3c2440_clk_driver);
116}
117
118arch_initcall(s3c24xx_clk_driver);
diff --git a/arch/arm/mach-s3c2410/s3c2440-irq.c b/arch/arm/mach-s3c2410/s3c2440-irq.c
new file mode 100644
index 000000000000..278d0044c85d
--- /dev/null
+++ b/arch/arm/mach-s3c2410/s3c2440-irq.c
@@ -0,0 +1,207 @@
1/* linux/arch/arm/mach-s3c2410/s3c2440-irq.c
2 *
3 * Copyright (c) 2003,2004 Simtec Electronics
4 * Ben Dooks <ben@simtec.co.uk>
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 as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 *
20 * Changelog:
21 * 25-Jul-2005 BJD Split from irq.c
22 *
23*/
24
25#include <linux/init.h>
26#include <linux/module.h>
27#include <linux/interrupt.h>
28#include <linux/ioport.h>
29#include <linux/ptrace.h>
30#include <linux/sysdev.h>
31
32#include <asm/hardware.h>
33#include <asm/irq.h>
34#include <asm/io.h>
35
36#include <asm/mach/irq.h>
37
38#include <asm/arch/regs-irq.h>
39#include <asm/arch/regs-gpio.h>
40
41#include "cpu.h"
42#include "pm.h"
43#include "irq.h"
44
45/* WDT/AC97 */
46
47static void s3c_irq_demux_wdtac97(unsigned int irq,
48 struct irqdesc *desc,
49 struct pt_regs *regs)
50{
51 unsigned int subsrc, submsk;
52 struct irqdesc *mydesc;
53
54 /* read the current pending interrupts, and the mask
55 * for what it is available */
56
57 subsrc = __raw_readl(S3C2410_SUBSRCPND);
58 submsk = __raw_readl(S3C2410_INTSUBMSK);
59
60 subsrc &= ~submsk;
61 subsrc >>= 13;
62 subsrc &= 3;
63
64 if (subsrc != 0) {
65 if (subsrc & 1) {
66 mydesc = irq_desc + IRQ_S3C2440_WDT;
67 desc_handle_irq(IRQ_S3C2440_WDT, mydesc, regs);
68 }
69 if (subsrc & 2) {
70 mydesc = irq_desc + IRQ_S3C2440_AC97;
71 desc_handle_irq(IRQ_S3C2440_AC97, mydesc, regs);
72 }
73 }
74}
75
76
77#define INTMSK_WDT (1UL << (IRQ_WDT - IRQ_EINT0))
78
79static void
80s3c_irq_wdtac97_mask(unsigned int irqno)
81{
82 s3c_irqsub_mask(irqno, INTMSK_WDT, 3<<13);
83}
84
85static void
86s3c_irq_wdtac97_unmask(unsigned int irqno)
87{
88 s3c_irqsub_unmask(irqno, INTMSK_WDT);
89}
90
91static void
92s3c_irq_wdtac97_ack(unsigned int irqno)
93{
94 s3c_irqsub_maskack(irqno, INTMSK_WDT, 3<<13);
95}
96
97static struct irqchip s3c_irq_wdtac97 = {
98 .mask = s3c_irq_wdtac97_mask,
99 .unmask = s3c_irq_wdtac97_unmask,
100 .ack = s3c_irq_wdtac97_ack,
101};
102
103/* camera irq */
104
105static void s3c_irq_demux_cam(unsigned int irq,
106 struct irqdesc *desc,
107 struct pt_regs *regs)
108{
109 unsigned int subsrc, submsk;
110 struct irqdesc *mydesc;
111
112 /* read the current pending interrupts, and the mask
113 * for what it is available */
114
115 subsrc = __raw_readl(S3C2410_SUBSRCPND);
116 submsk = __raw_readl(S3C2410_INTSUBMSK);
117
118 subsrc &= ~submsk;
119 subsrc >>= 11;
120 subsrc &= 3;
121
122 if (subsrc != 0) {
123 if (subsrc & 1) {
124 mydesc = irq_desc + IRQ_S3C2440_CAM_C;
125 desc_handle_irq(IRQ_S3C2440_CAM_C, mydesc, regs);
126 }
127 if (subsrc & 2) {
128 mydesc = irq_desc + IRQ_S3C2440_CAM_P;
129 desc_handle_irq(IRQ_S3C2440_CAM_P, mydesc, regs);
130 }
131 }
132}
133
134#define INTMSK_CAM (1UL << (IRQ_CAM - IRQ_EINT0))
135
136static void
137s3c_irq_cam_mask(unsigned int irqno)
138{
139 s3c_irqsub_mask(irqno, INTMSK_CAM, 3<<11);
140}
141
142static void
143s3c_irq_cam_unmask(unsigned int irqno)
144{
145 s3c_irqsub_unmask(irqno, INTMSK_CAM);
146}
147
148static void
149s3c_irq_cam_ack(unsigned int irqno)
150{
151 s3c_irqsub_maskack(irqno, INTMSK_CAM, 3<<11);
152}
153
154static struct irqchip s3c_irq_cam = {
155 .mask = s3c_irq_cam_mask,
156 .unmask = s3c_irq_cam_unmask,
157 .ack = s3c_irq_cam_ack,
158};
159
160static int s3c2440_irq_add(struct sys_device *sysdev)
161{
162 unsigned int irqno;
163
164 printk("S3C2440: IRQ Support\n");
165
166 set_irq_chip(IRQ_NFCON, &s3c_irq_level_chip);
167 set_irq_handler(IRQ_NFCON, do_level_IRQ);
168 set_irq_flags(IRQ_NFCON, IRQF_VALID);
169
170 /* add new chained handler for wdt, ac7 */
171
172 set_irq_chip(IRQ_WDT, &s3c_irq_level_chip);
173 set_irq_handler(IRQ_WDT, do_level_IRQ);
174 set_irq_chained_handler(IRQ_WDT, s3c_irq_demux_wdtac97);
175
176 for (irqno = IRQ_S3C2440_WDT; irqno <= IRQ_S3C2440_AC97; irqno++) {
177 set_irq_chip(irqno, &s3c_irq_wdtac97);
178 set_irq_handler(irqno, do_level_IRQ);
179 set_irq_flags(irqno, IRQF_VALID);
180 }
181
182 /* add chained handler for camera */
183
184 set_irq_chip(IRQ_CAM, &s3c_irq_level_chip);
185 set_irq_handler(IRQ_CAM, do_level_IRQ);
186 set_irq_chained_handler(IRQ_CAM, s3c_irq_demux_cam);
187
188 for (irqno = IRQ_S3C2440_CAM_C; irqno <= IRQ_S3C2440_CAM_P; irqno++) {
189 set_irq_chip(irqno, &s3c_irq_cam);
190 set_irq_handler(irqno, do_level_IRQ);
191 set_irq_flags(irqno, IRQF_VALID);
192 }
193
194 return 0;
195}
196
197static struct sysdev_driver s3c2440_irq_driver = {
198 .add = s3c2440_irq_add,
199};
200
201static int s3c24xx_irq_driver(void)
202{
203 return sysdev_driver_register(&s3c2440_sysclass, &s3c2440_irq_driver);
204}
205
206arch_initcall(s3c24xx_irq_driver);
207
diff --git a/arch/arm/mach-s3c2410/usb-simtec.c b/arch/arm/mach-s3c2410/usb-simtec.c
index 7f2b61362976..f021fd82be52 100644
--- a/arch/arm/mach-s3c2410/usb-simtec.c
+++ b/arch/arm/mach-s3c2410/usb-simtec.c
@@ -1,6 +1,6 @@
1/* linux/arch/arm/mach-s3c2410/usb-simtec.c 1/* linux/arch/arm/mach-s3c2410/usb-simtec.c
2 * 2 *
3 * Copyright (c) 2004 Simtec Electronics 3 * Copyright (c) 2004,2005 Simtec Electronics
4 * Ben Dooks <ben@simtec.co.uk> 4 * Ben Dooks <ben@simtec.co.uk>
5 * 5 *
6 * http://www.simtec.co.uk/products/EB2410ITX/ 6 * http://www.simtec.co.uk/products/EB2410ITX/
@@ -14,6 +14,8 @@
14 * Modifications: 14 * Modifications:
15 * 14-Sep-2004 BJD Created 15 * 14-Sep-2004 BJD Created
16 * 18-Oct-2004 BJD Cleanups, and added code to report OC cleared 16 * 18-Oct-2004 BJD Cleanups, and added code to report OC cleared
17 * 09-Aug-2005 BJD Renamed s3c2410_report_oc to s3c2410_usb_report_oc
18 * 09-Aug-2005 BJD Ports powered only if both are enabled
17*/ 19*/
18 20
19#define DEBUG 21#define DEBUG
@@ -47,13 +49,19 @@
47 * designed boards. 49 * designed boards.
48*/ 50*/
49 51
52static unsigned int power_state[2];
53
50static void 54static void
51usb_simtec_powercontrol(int port, int to) 55usb_simtec_powercontrol(int port, int to)
52{ 56{
53 pr_debug("usb_simtec_powercontrol(%d,%d)\n", port, to); 57 pr_debug("usb_simtec_powercontrol(%d,%d)\n", port, to);
54 58
55 if (port == 1) 59 power_state[port] = to;
56 s3c2410_gpio_setpin(S3C2410_GPB4, to ? 0:1); 60
61 if (power_state[0] && power_state[1])
62 s3c2410_gpio_setpin(S3C2410_GPB4, 0);
63 else
64 s3c2410_gpio_setpin(S3C2410_GPB4, 1);
57} 65}
58 66
59static irqreturn_t 67static irqreturn_t
@@ -63,10 +71,10 @@ usb_simtec_ocirq(int irq, void *pw, struct pt_regs *regs)
63 71
64 if (s3c2410_gpio_getpin(S3C2410_GPG10) == 0) { 72 if (s3c2410_gpio_getpin(S3C2410_GPG10) == 0) {
65 pr_debug("usb_simtec: over-current irq (oc detected)\n"); 73 pr_debug("usb_simtec: over-current irq (oc detected)\n");
66 s3c2410_report_oc(info, 3); 74 s3c2410_usb_report_oc(info, 3);
67 } else { 75 } else {
68 pr_debug("usb_simtec: over-current irq (oc cleared)\n"); 76 pr_debug("usb_simtec: over-current irq (oc cleared)\n");
69 s3c2410_report_oc(info, 0); 77 s3c2410_usb_report_oc(info, 0);
70 } 78 }
71 79
72 return IRQ_HANDLED; 80 return IRQ_HANDLED;
diff --git a/arch/arm/mach-sa1100/assabet.c b/arch/arm/mach-sa1100/assabet.c
index 4d4d303ee3a8..24687f511bf5 100644
--- a/arch/arm/mach-sa1100/assabet.c
+++ b/arch/arm/mach-sa1100/assabet.c
@@ -35,6 +35,7 @@
35#include <asm/mach/map.h> 35#include <asm/mach/map.h>
36#include <asm/mach/serial_sa1100.h> 36#include <asm/mach/serial_sa1100.h>
37#include <asm/arch/assabet.h> 37#include <asm/arch/assabet.h>
38#include <asm/arch/mcp.h>
38 39
39#include "generic.h" 40#include "generic.h"
40 41
@@ -198,6 +199,11 @@ static struct irda_platform_data assabet_irda_data = {
198 .set_speed = assabet_irda_set_speed, 199 .set_speed = assabet_irda_set_speed,
199}; 200};
200 201
202static struct mcp_plat_data assabet_mcp_data = {
203 .mccr0 = MCCR0_ADM,
204 .sclk_rate = 11981000,
205};
206
201static void __init assabet_init(void) 207static void __init assabet_init(void)
202{ 208{
203 /* 209 /*
@@ -246,6 +252,7 @@ static void __init assabet_init(void)
246 sa11x0_set_flash_data(&assabet_flash_data, assabet_flash_resources, 252 sa11x0_set_flash_data(&assabet_flash_data, assabet_flash_resources,
247 ARRAY_SIZE(assabet_flash_resources)); 253 ARRAY_SIZE(assabet_flash_resources));
248 sa11x0_set_irda_data(&assabet_irda_data); 254 sa11x0_set_irda_data(&assabet_irda_data);
255 sa11x0_set_mcp_data(&assabet_mcp_data);
249} 256}
250 257
251/* 258/*
diff --git a/arch/arm/mach-sa1100/cerf.c b/arch/arm/mach-sa1100/cerf.c
index 0aa918e24c31..9484be7dc671 100644
--- a/arch/arm/mach-sa1100/cerf.c
+++ b/arch/arm/mach-sa1100/cerf.c
@@ -29,6 +29,7 @@
29#include <asm/mach/serial_sa1100.h> 29#include <asm/mach/serial_sa1100.h>
30 30
31#include <asm/arch/cerf.h> 31#include <asm/arch/cerf.h>
32#include <asm/arch/mcp.h>
32#include "generic.h" 33#include "generic.h"
33 34
34static struct resource cerfuart2_resources[] = { 35static struct resource cerfuart2_resources[] = {
@@ -116,10 +117,16 @@ static void __init cerf_map_io(void)
116 GPDR |= CERF_GPIO_CF_RESET; 117 GPDR |= CERF_GPIO_CF_RESET;
117} 118}
118 119
120static struct mcp_plat_data cerf_mcp_data = {
121 .mccr0 = MCCR0_ADM,
122 .sclk_rate = 11981000,
123};
124
119static void __init cerf_init(void) 125static void __init cerf_init(void)
120{ 126{
121 platform_add_devices(cerf_devices, ARRAY_SIZE(cerf_devices)); 127 platform_add_devices(cerf_devices, ARRAY_SIZE(cerf_devices));
122 sa11x0_set_flash_data(&cerf_flash_data, &cerf_flash_resource, 1); 128 sa11x0_set_flash_data(&cerf_flash_data, &cerf_flash_resource, 1);
129 sa11x0_set_mcp_data(&cerf_mcp_data);
123} 130}
124 131
125MACHINE_START(CERF, "Intrinsyc CerfBoard/CerfCube") 132MACHINE_START(CERF, "Intrinsyc CerfBoard/CerfCube")
diff --git a/arch/arm/mach-sa1100/generic.c b/arch/arm/mach-sa1100/generic.c
index 95ae217be1bc..3f1e358455e5 100644
--- a/arch/arm/mach-sa1100/generic.c
+++ b/arch/arm/mach-sa1100/generic.c
@@ -221,6 +221,11 @@ static struct platform_device sa11x0mcp_device = {
221 .resource = sa11x0mcp_resources, 221 .resource = sa11x0mcp_resources,
222}; 222};
223 223
224void sa11x0_set_mcp_data(struct mcp_plat_data *data)
225{
226 sa11x0mcp_device.dev.platform_data = data;
227}
228
224static struct resource sa11x0ssp_resources[] = { 229static struct resource sa11x0ssp_resources[] = {
225 [0] = { 230 [0] = {
226 .start = 0x80070000, 231 .start = 0x80070000,
diff --git a/arch/arm/mach-sa1100/generic.h b/arch/arm/mach-sa1100/generic.h
index bfe41da9923e..279e3afa3c39 100644
--- a/arch/arm/mach-sa1100/generic.h
+++ b/arch/arm/mach-sa1100/generic.h
@@ -34,5 +34,8 @@ struct resource;
34extern void sa11x0_set_flash_data(struct flash_platform_data *flash, 34extern void sa11x0_set_flash_data(struct flash_platform_data *flash,
35 struct resource *res, int nr); 35 struct resource *res, int nr);
36 36
37struct sa11x0_ssp_plat_ops;
38extern void sa11x0_set_ssp_data(struct sa11x0_ssp_plat_ops *ops);
39
37struct irda_platform_data; 40struct irda_platform_data;
38void sa11x0_set_irda_data(struct irda_platform_data *irda); 41void sa11x0_set_irda_data(struct irda_platform_data *irda);
diff --git a/arch/arm/mach-sa1100/irq.c b/arch/arm/mach-sa1100/irq.c
index 66a929cb7bc5..c131a5201b5b 100644
--- a/arch/arm/mach-sa1100/irq.c
+++ b/arch/arm/mach-sa1100/irq.c
@@ -98,8 +98,8 @@ static struct irqchip sa1100_low_gpio_chip = {
98 .ack = sa1100_low_gpio_ack, 98 .ack = sa1100_low_gpio_ack,
99 .mask = sa1100_low_gpio_mask, 99 .mask = sa1100_low_gpio_mask,
100 .unmask = sa1100_low_gpio_unmask, 100 .unmask = sa1100_low_gpio_unmask,
101 .type = sa1100_gpio_type, 101 .set_type = sa1100_gpio_type,
102 .wake = sa1100_low_gpio_wake, 102 .set_wake = sa1100_low_gpio_wake,
103}; 103};
104 104
105/* 105/*
@@ -126,7 +126,7 @@ sa1100_high_gpio_handler(unsigned int irq, struct irqdesc *desc,
126 mask >>= 11; 126 mask >>= 11;
127 do { 127 do {
128 if (mask & 1) 128 if (mask & 1)
129 desc->handle(irq, desc, regs); 129 desc_handle_irq(irq, desc, regs);
130 mask >>= 1; 130 mask >>= 1;
131 irq++; 131 irq++;
132 desc++; 132 desc++;
@@ -181,8 +181,8 @@ static struct irqchip sa1100_high_gpio_chip = {
181 .ack = sa1100_high_gpio_ack, 181 .ack = sa1100_high_gpio_ack,
182 .mask = sa1100_high_gpio_mask, 182 .mask = sa1100_high_gpio_mask,
183 .unmask = sa1100_high_gpio_unmask, 183 .unmask = sa1100_high_gpio_unmask,
184 .type = sa1100_gpio_type, 184 .set_type = sa1100_gpio_type,
185 .wake = sa1100_high_gpio_wake, 185 .set_wake = sa1100_high_gpio_wake,
186}; 186};
187 187
188/* 188/*
diff --git a/arch/arm/mach-sa1100/jornada720.c b/arch/arm/mach-sa1100/jornada720.c
index eee3cbc5ec4f..2f497112c96a 100644
--- a/arch/arm/mach-sa1100/jornada720.c
+++ b/arch/arm/mach-sa1100/jornada720.c
@@ -97,6 +97,7 @@ static void __init jornada720_map_io(void)
97} 97}
98 98
99MACHINE_START(JORNADA720, "HP Jornada 720") 99MACHINE_START(JORNADA720, "HP Jornada 720")
100 /* Maintainer: Michael Gernoth <michael@gernoth.net> */
100 .phys_ram = 0xc0000000, 101 .phys_ram = 0xc0000000,
101 .phys_io = 0x80000000, 102 .phys_io = 0x80000000,
102 .io_pg_offst = ((0xf8000000) >> 18) & 0xfffc, 103 .io_pg_offst = ((0xf8000000) >> 18) & 0xfffc,
diff --git a/arch/arm/mach-sa1100/lart.c b/arch/arm/mach-sa1100/lart.c
index 870b488aeda4..ed6744d480af 100644
--- a/arch/arm/mach-sa1100/lart.c
+++ b/arch/arm/mach-sa1100/lart.c
@@ -13,12 +13,23 @@
13#include <asm/mach/arch.h> 13#include <asm/mach/arch.h>
14#include <asm/mach/map.h> 14#include <asm/mach/map.h>
15#include <asm/mach/serial_sa1100.h> 15#include <asm/mach/serial_sa1100.h>
16#include <asm/arch/mcp.h>
16 17
17#include "generic.h" 18#include "generic.h"
18 19
19 20
20#warning "include/asm/arch-sa1100/ide.h needs fixing for lart" 21#warning "include/asm/arch-sa1100/ide.h needs fixing for lart"
21 22
23static struct mcp_plat_data lart_mcp_data = {
24 .mccr0 = MCCR0_ADM,
25 .sclk_rate = 11981000,
26};
27
28static void __init lart_init(void)
29{
30 sa11x0_set_mcp_data(&lart_mcp_data);
31}
32
22static struct map_desc lart_io_desc[] __initdata = { 33static struct map_desc lart_io_desc[] __initdata = {
23 /* virtual physical length type */ 34 /* virtual physical length type */
24 { 0xe8000000, 0x00000000, 0x00400000, MT_DEVICE }, /* main flash memory */ 35 { 0xe8000000, 0x00000000, 0x00400000, MT_DEVICE }, /* main flash memory */
@@ -47,5 +58,6 @@ MACHINE_START(LART, "LART")
47 .boot_params = 0xc0000100, 58 .boot_params = 0xc0000100,
48 .map_io = lart_map_io, 59 .map_io = lart_map_io,
49 .init_irq = sa1100_init_irq, 60 .init_irq = sa1100_init_irq,
61 .init_machine = lart_init,
50 .timer = &sa1100_timer, 62 .timer = &sa1100_timer,
51MACHINE_END 63MACHINE_END
diff --git a/arch/arm/mach-sa1100/neponset.c b/arch/arm/mach-sa1100/neponset.c
index 1405383463ea..fc061641b7be 100644
--- a/arch/arm/mach-sa1100/neponset.c
+++ b/arch/arm/mach-sa1100/neponset.c
@@ -61,12 +61,12 @@ neponset_irq_handler(unsigned int irq, struct irqdesc *desc, struct pt_regs *reg
61 61
62 if (irr & IRR_ETHERNET) { 62 if (irr & IRR_ETHERNET) {
63 d = irq_desc + IRQ_NEPONSET_SMC9196; 63 d = irq_desc + IRQ_NEPONSET_SMC9196;
64 d->handle(IRQ_NEPONSET_SMC9196, d, regs); 64 desc_handle_irq(IRQ_NEPONSET_SMC9196, d, regs);
65 } 65 }
66 66
67 if (irr & IRR_USAR) { 67 if (irr & IRR_USAR) {
68 d = irq_desc + IRQ_NEPONSET_USAR; 68 d = irq_desc + IRQ_NEPONSET_USAR;
69 d->handle(IRQ_NEPONSET_USAR, d, regs); 69 desc_handle_irq(IRQ_NEPONSET_USAR, d, regs);
70 } 70 }
71 71
72 desc->chip->unmask(irq); 72 desc->chip->unmask(irq);
@@ -74,7 +74,7 @@ neponset_irq_handler(unsigned int irq, struct irqdesc *desc, struct pt_regs *reg
74 74
75 if (irr & IRR_SA1111) { 75 if (irr & IRR_SA1111) {
76 d = irq_desc + IRQ_NEPONSET_SA1111; 76 d = irq_desc + IRQ_NEPONSET_SA1111;
77 d->handle(IRQ_NEPONSET_SA1111, d, regs); 77 desc_handle_irq(IRQ_NEPONSET_SA1111, d, regs);
78 } 78 }
79 } 79 }
80} 80}
diff --git a/arch/arm/mach-sa1100/shannon.c b/arch/arm/mach-sa1100/shannon.c
index 43a00359fcdd..7482288278d9 100644
--- a/arch/arm/mach-sa1100/shannon.c
+++ b/arch/arm/mach-sa1100/shannon.c
@@ -18,6 +18,7 @@
18#include <asm/mach/flash.h> 18#include <asm/mach/flash.h>
19#include <asm/mach/map.h> 19#include <asm/mach/map.h>
20#include <asm/mach/serial_sa1100.h> 20#include <asm/mach/serial_sa1100.h>
21#include <asm/arch/mcp.h>
21#include <asm/arch/shannon.h> 22#include <asm/arch/shannon.h>
22 23
23#include "generic.h" 24#include "generic.h"
@@ -52,9 +53,15 @@ static struct resource shannon_flash_resource = {
52 .flags = IORESOURCE_MEM, 53 .flags = IORESOURCE_MEM,
53}; 54};
54 55
56static struct mcp_plat_data shannon_mcp_data = {
57 .mccr0 = MCCR0_ADM,
58 .sclk_rate = 11981000,
59};
60
55static void __init shannon_init(void) 61static void __init shannon_init(void)
56{ 62{
57 sa11x0_set_flash_data(&shannon_flash_data, &shannon_flash_resource, 1); 63 sa11x0_set_flash_data(&shannon_flash_data, &shannon_flash_resource, 1);
64 sa11x0_set_mcp_data(&shannon_mcp_data);
58} 65}
59 66
60static void __init shannon_map_io(void) 67static void __init shannon_map_io(void)
diff --git a/arch/arm/mach-sa1100/simpad.c b/arch/arm/mach-sa1100/simpad.c
index 77978586b126..07f6d5fd7bb0 100644
--- a/arch/arm/mach-sa1100/simpad.c
+++ b/arch/arm/mach-sa1100/simpad.c
@@ -23,6 +23,7 @@
23#include <asm/mach/flash.h> 23#include <asm/mach/flash.h>
24#include <asm/mach/map.h> 24#include <asm/mach/map.h>
25#include <asm/mach/serial_sa1100.h> 25#include <asm/mach/serial_sa1100.h>
26#include <asm/arch/mcp.h>
26#include <asm/arch/simpad.h> 27#include <asm/arch/simpad.h>
27 28
28#include <linux/serial_core.h> 29#include <linux/serial_core.h>
@@ -123,6 +124,11 @@ static struct resource simpad_flash_resources [] = {
123 } 124 }
124}; 125};
125 126
127static struct mcp_plat_data simpad_mcp_data = {
128 .mccr0 = MCCR0_ADM,
129 .sclk_rate = 11981000,
130};
131
126 132
127 133
128static void __init simpad_map_io(void) 134static void __init simpad_map_io(void)
@@ -157,6 +163,7 @@ static void __init simpad_map_io(void)
157 163
158 sa11x0_set_flash_data(&simpad_flash_data, simpad_flash_resources, 164 sa11x0_set_flash_data(&simpad_flash_data, simpad_flash_resources,
159 ARRAY_SIZE(simpad_flash_resources)); 165 ARRAY_SIZE(simpad_flash_resources));
166 sa11x0_set_mcp_data(&simpad_mcp_data);
160} 167}
161 168
162static void simpad_power_off(void) 169static void simpad_power_off(void)
diff --git a/arch/arm/mach-sa1100/time.c b/arch/arm/mach-sa1100/time.c
index 0eeb3616ffea..47e0420623fc 100644
--- a/arch/arm/mach-sa1100/time.c
+++ b/arch/arm/mach-sa1100/time.c
@@ -70,15 +70,11 @@ static unsigned long sa1100_gettimeoffset (void)
70 return usec; 70 return usec;
71} 71}
72 72
73/* 73#ifdef CONFIG_NO_IDLE_HZ
74 * We will be entered with IRQs enabled. 74static unsigned long initial_match;
75 * 75static int match_posponed;
76 * Loop until we get ahead of the free running timer. 76#endif
77 * This ensures an exact clock tick count and time accuracy. 77
78 * IRQs are disabled inside the loop to ensure coherence between
79 * lost_ticks (updated in do_timer()) and the match reg value, so we
80 * can use do_gettimeofday() from interrupt handlers.
81 */
82static irqreturn_t 78static irqreturn_t
83sa1100_timer_interrupt(int irq, void *dev_id, struct pt_regs *regs) 79sa1100_timer_interrupt(int irq, void *dev_id, struct pt_regs *regs)
84{ 80{
@@ -86,6 +82,21 @@ sa1100_timer_interrupt(int irq, void *dev_id, struct pt_regs *regs)
86 82
87 write_seqlock(&xtime_lock); 83 write_seqlock(&xtime_lock);
88 84
85#ifdef CONFIG_NO_IDLE_HZ
86 if (match_posponed) {
87 match_posponed = 0;
88 OSMR0 = initial_match;
89 }
90#endif
91
92 /*
93 * Loop until we get ahead of the free running timer.
94 * This ensures an exact clock tick count and time accuracy.
95 * Since IRQs are disabled at this point, coherence between
96 * lost_ticks(updated in do_timer()) and the match reg value is
97 * ensured, hence we can use do_gettimeofday() from interrupt
98 * handlers.
99 */
89 do { 100 do {
90 timer_tick(regs); 101 timer_tick(regs);
91 OSSR = OSSR_M0; /* Clear match on timer 0 */ 102 OSSR = OSSR_M0; /* Clear match on timer 0 */
@@ -120,6 +131,42 @@ static void __init sa1100_timer_init(void)
120 OSCR = 0; /* initialize free-running timer, force first match */ 131 OSCR = 0; /* initialize free-running timer, force first match */
121} 132}
122 133
134#ifdef CONFIG_NO_IDLE_HZ
135static int sa1100_dyn_tick_enable_disable(void)
136{
137 /* nothing to do */
138 return 0;
139}
140
141static void sa1100_dyn_tick_reprogram(unsigned long ticks)
142{
143 if (ticks > 1) {
144 initial_match = OSMR0;
145 OSMR0 = initial_match + ticks * LATCH;
146 match_posponed = 1;
147 }
148}
149
150static irqreturn_t
151sa1100_dyn_tick_handler(int irq, void *dev_id, struct pt_regs *regs)
152{
153 if (match_posponed) {
154 match_posponed = 0;
155 OSMR0 = initial_match;
156 if ((signed long)(initial_match - OSCR) <= 0)
157 return sa1100_timer_interrupt(irq, dev_id, regs);
158 }
159 return IRQ_NONE;
160}
161
162static struct dyn_tick_timer sa1100_dyn_tick = {
163 .enable = sa1100_dyn_tick_enable_disable,
164 .disable = sa1100_dyn_tick_enable_disable,
165 .reprogram = sa1100_dyn_tick_reprogram,
166 .handler = sa1100_dyn_tick_handler,
167};
168#endif
169
123#ifdef CONFIG_PM 170#ifdef CONFIG_PM
124unsigned long osmr[4], oier; 171unsigned long osmr[4], oier;
125 172
@@ -156,4 +203,7 @@ struct sys_timer sa1100_timer = {
156 .suspend = sa1100_timer_suspend, 203 .suspend = sa1100_timer_suspend,
157 .resume = sa1100_timer_resume, 204 .resume = sa1100_timer_resume,
158 .offset = sa1100_gettimeoffset, 205 .offset = sa1100_gettimeoffset,
206#ifdef CONFIG_NO_IDLE_HZ
207 .dyn_tick = &sa1100_dyn_tick,
208#endif
159}; 209};
diff --git a/arch/arm/mach-shark/core.c b/arch/arm/mach-shark/core.c
index 726445895b5c..e737eae4521f 100644
--- a/arch/arm/mach-shark/core.c
+++ b/arch/arm/mach-shark/core.c
@@ -24,7 +24,7 @@ static struct plat_serial8250_port serial_platform_data[] = {
24 .iobase = 0x3f8, 24 .iobase = 0x3f8,
25 .irq = 4, 25 .irq = 4,
26 .uartclk = 1843200, 26 .uartclk = 1843200,
27 .regshift = 2, 27 .regshift = 0,
28 .iotype = UPIO_PORT, 28 .iotype = UPIO_PORT,
29 .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST, 29 .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST,
30 }, 30 },
@@ -32,7 +32,7 @@ static struct plat_serial8250_port serial_platform_data[] = {
32 .iobase = 0x2f8, 32 .iobase = 0x2f8,
33 .irq = 3, 33 .irq = 3,
34 .uartclk = 1843200, 34 .uartclk = 1843200,
35 .regshift = 2, 35 .regshift = 0,
36 .iotype = UPIO_PORT, 36 .iotype = UPIO_PORT,
37 .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST, 37 .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST,
38 }, 38 },
diff --git a/arch/arm/mach-versatile/core.c b/arch/arm/mach-versatile/core.c
index f01c0f8a2bb3..3c8862fde51a 100644
--- a/arch/arm/mach-versatile/core.c
+++ b/arch/arm/mach-versatile/core.c
@@ -108,7 +108,7 @@ sic_handle_irq(unsigned int irq, struct irqdesc *desc, struct pt_regs *regs)
108 irq += IRQ_SIC_START; 108 irq += IRQ_SIC_START;
109 109
110 desc = irq_desc + irq; 110 desc = irq_desc + irq;
111 desc->handle(irq, desc, regs); 111 desc_handle_irq(irq, desc, regs);
112 } while (status); 112 } while (status);
113} 113}
114 114
diff --git a/arch/arm/mm/Kconfig b/arch/arm/mm/Kconfig
index afbbeb6f4658..db5e47dfc303 100644
--- a/arch/arm/mm/Kconfig
+++ b/arch/arm/mm/Kconfig
@@ -384,7 +384,7 @@ config CPU_DCACHE_DISABLE
384 384
385config CPU_DCACHE_WRITETHROUGH 385config CPU_DCACHE_WRITETHROUGH
386 bool "Force write through D-cache" 386 bool "Force write through D-cache"
387 depends on (CPU_ARM920T || CPU_ARM922T || CPU_ARM925T || CPU_ARM926T || CPU_ARM1020) && !CPU_DISABLE_DCACHE 387 depends on (CPU_ARM920T || CPU_ARM922T || CPU_ARM925T || CPU_ARM926T || CPU_ARM1020) && !CPU_DCACHE_DISABLE
388 default y if CPU_ARM925T 388 default y if CPU_ARM925T
389 help 389 help
390 Say Y here to use the data cache in writethrough mode. Unless you 390 Say Y here to use the data cache in writethrough mode. Unless you
diff --git a/arch/arm/mm/alignment.c b/arch/arm/mm/alignment.c
index 81f4a8a2d34b..4b39d867ac14 100644
--- a/arch/arm/mm/alignment.c
+++ b/arch/arm/mm/alignment.c
@@ -45,7 +45,7 @@
45 45
46#define LDST_P_EQ_U(i) ((((i) ^ ((i) >> 1)) & (1 << 23)) == 0) 46#define LDST_P_EQ_U(i) ((((i) ^ ((i) >> 1)) & (1 << 23)) == 0)
47 47
48#define LDSTH_I_BIT(i) (i & (1 << 22)) /* half-word immed */ 48#define LDSTHD_I_BIT(i) (i & (1 << 22)) /* double/half-word immed */
49#define LDM_S_BIT(i) (i & (1 << 22)) /* write CPSR from SPSR */ 49#define LDM_S_BIT(i) (i & (1 << 22)) /* write CPSR from SPSR */
50 50
51#define RN_BITS(i) ((i >> 16) & 15) /* Rn */ 51#define RN_BITS(i) ((i >> 16) & 15) /* Rn */
@@ -68,6 +68,7 @@ static unsigned long ai_sys;
68static unsigned long ai_skipped; 68static unsigned long ai_skipped;
69static unsigned long ai_half; 69static unsigned long ai_half;
70static unsigned long ai_word; 70static unsigned long ai_word;
71static unsigned long ai_dword;
71static unsigned long ai_multi; 72static unsigned long ai_multi;
72static int ai_usermode; 73static int ai_usermode;
73 74
@@ -93,6 +94,8 @@ proc_alignment_read(char *page, char **start, off_t off, int count, int *eof,
93 p += sprintf(p, "Skipped:\t%lu\n", ai_skipped); 94 p += sprintf(p, "Skipped:\t%lu\n", ai_skipped);
94 p += sprintf(p, "Half:\t\t%lu\n", ai_half); 95 p += sprintf(p, "Half:\t\t%lu\n", ai_half);
95 p += sprintf(p, "Word:\t\t%lu\n", ai_word); 96 p += sprintf(p, "Word:\t\t%lu\n", ai_word);
97 if (cpu_architecture() >= CPU_ARCH_ARMv5TE)
98 p += sprintf(p, "DWord:\t\t%lu\n", ai_dword);
96 p += sprintf(p, "Multi:\t\t%lu\n", ai_multi); 99 p += sprintf(p, "Multi:\t\t%lu\n", ai_multi);
97 p += sprintf(p, "User faults:\t%i (%s)\n", ai_usermode, 100 p += sprintf(p, "User faults:\t%i (%s)\n", ai_usermode,
98 usermode_action[ai_usermode]); 101 usermode_action[ai_usermode]);
@@ -283,12 +286,6 @@ do_alignment_ldrhstrh(unsigned long addr, unsigned long instr, struct pt_regs *r
283{ 286{
284 unsigned int rd = RD_BITS(instr); 287 unsigned int rd = RD_BITS(instr);
285 288
286 if ((instr & 0x01f00ff0) == 0x01000090)
287 goto swp;
288
289 if ((instr & 0x90) != 0x90 || (instr & 0x60) == 0)
290 goto bad;
291
292 ai_half += 1; 289 ai_half += 1;
293 290
294 if (user_mode(regs)) 291 if (user_mode(regs))
@@ -323,10 +320,47 @@ do_alignment_ldrhstrh(unsigned long addr, unsigned long instr, struct pt_regs *r
323 320
324 return TYPE_LDST; 321 return TYPE_LDST;
325 322
326 swp: 323 fault:
327 printk(KERN_ERR "Alignment trap: not handling swp instruction\n"); 324 return TYPE_FAULT;
328 bad: 325}
329 return TYPE_ERROR; 326
327static int
328do_alignment_ldrdstrd(unsigned long addr, unsigned long instr,
329 struct pt_regs *regs)
330{
331 unsigned int rd = RD_BITS(instr);
332
333 ai_dword += 1;
334
335 if (user_mode(regs))
336 goto user;
337
338 if ((instr & 0xf0) == 0xd0) {
339 unsigned long val;
340 get32_unaligned_check(val, addr);
341 regs->uregs[rd] = val;
342 get32_unaligned_check(val, addr+4);
343 regs->uregs[rd+1] = val;
344 } else {
345 put32_unaligned_check(regs->uregs[rd], addr);
346 put32_unaligned_check(regs->uregs[rd+1], addr+4);
347 }
348
349 return TYPE_LDST;
350
351 user:
352 if ((instr & 0xf0) == 0xd0) {
353 unsigned long val;
354 get32t_unaligned_check(val, addr);
355 regs->uregs[rd] = val;
356 get32t_unaligned_check(val, addr+4);
357 regs->uregs[rd+1] = val;
358 } else {
359 put32t_unaligned_check(regs->uregs[rd], addr);
360 put32t_unaligned_check(regs->uregs[rd+1], addr+4);
361 }
362
363 return TYPE_LDST;
330 364
331 fault: 365 fault:
332 return TYPE_FAULT; 366 return TYPE_FAULT;
@@ -617,12 +651,20 @@ do_alignment(unsigned long addr, unsigned int fsr, struct pt_regs *regs)
617 regs->ARM_pc += thumb_mode(regs) ? 2 : 4; 651 regs->ARM_pc += thumb_mode(regs) ? 2 : 4;
618 652
619 switch (CODING_BITS(instr)) { 653 switch (CODING_BITS(instr)) {
620 case 0x00000000: /* ldrh or strh */ 654 case 0x00000000: /* 3.13.4 load/store instruction extensions */
621 if (LDSTH_I_BIT(instr)) 655 if (LDSTHD_I_BIT(instr))
622 offset.un = (instr & 0xf00) >> 4 | (instr & 15); 656 offset.un = (instr & 0xf00) >> 4 | (instr & 15);
623 else 657 else
624 offset.un = regs->uregs[RM_BITS(instr)]; 658 offset.un = regs->uregs[RM_BITS(instr)];
625 handler = do_alignment_ldrhstrh; 659
660 if ((instr & 0x000000f0) == 0x000000b0 || /* LDRH, STRH */
661 (instr & 0x001000f0) == 0x001000f0) /* LDRSH */
662 handler = do_alignment_ldrhstrh;
663 else if ((instr & 0x001000f0) == 0x000000d0 || /* LDRD */
664 (instr & 0x001000f0) == 0x000000f0) /* STRD */
665 handler = do_alignment_ldrdstrd;
666 else
667 goto bad;
626 break; 668 break;
627 669
628 case 0x04000000: /* ldr or str immediate */ 670 case 0x04000000: /* ldr or str immediate */
diff --git a/arch/arm/mm/fault.c b/arch/arm/mm/fault.c
index 65bfe84b6d67..0b6c4db44e08 100644
--- a/arch/arm/mm/fault.c
+++ b/arch/arm/mm/fault.c
@@ -238,9 +238,9 @@ do_page_fault(unsigned long addr, unsigned int fsr, struct pt_regs *regs)
238 up_read(&mm->mmap_sem); 238 up_read(&mm->mmap_sem);
239 239
240 /* 240 /*
241 * Handle the "normal" case first 241 * Handle the "normal" case first - VM_FAULT_MAJOR / VM_FAULT_MINOR
242 */ 242 */
243 if (fault > 0) 243 if (fault >= VM_FAULT_MINOR)
244 return 0; 244 return 0;
245 245
246 /* 246 /*
@@ -261,7 +261,7 @@ do_page_fault(unsigned long addr, unsigned int fsr, struct pt_regs *regs)
261 do_exit(SIGKILL); 261 do_exit(SIGKILL);
262 return 0; 262 return 0;
263 263
264 case 0: 264 case VM_FAULT_SIGBUS:
265 /* 265 /*
266 * We had some memory, but were unable to 266 * We had some memory, but were unable to
267 * successfully fix up this page fault. 267 * successfully fix up this page fault.
diff --git a/arch/arm/mm/mm-armv.c b/arch/arm/mm/mm-armv.c
index b19f00e99a21..d125a3dc061c 100644
--- a/arch/arm/mm/mm-armv.c
+++ b/arch/arm/mm/mm-armv.c
@@ -275,11 +275,9 @@ alloc_init_supersection(unsigned long virt, unsigned long phys, int prot)
275 int i; 275 int i;
276 276
277 for (i = 0; i < 16; i += 1) { 277 for (i = 0; i < 16; i += 1) {
278 alloc_init_section(virt, phys & SUPERSECTION_MASK, 278 alloc_init_section(virt, phys, prot | PMD_SECT_SUPER);
279 prot | PMD_SECT_SUPER);
280 279
281 virt += (PGDIR_SIZE / 2); 280 virt += (PGDIR_SIZE / 2);
282 phys += (PGDIR_SIZE / 2);
283 } 281 }
284} 282}
285 283
@@ -297,14 +295,10 @@ alloc_init_page(unsigned long virt, unsigned long phys, unsigned int prot_l1, pg
297 pte_t *ptep; 295 pte_t *ptep;
298 296
299 if (pmd_none(*pmdp)) { 297 if (pmd_none(*pmdp)) {
300 unsigned long pmdval;
301 ptep = alloc_bootmem_low_pages(2 * PTRS_PER_PTE * 298 ptep = alloc_bootmem_low_pages(2 * PTRS_PER_PTE *
302 sizeof(pte_t)); 299 sizeof(pte_t));
303 300
304 pmdval = __pa(ptep) | prot_l1; 301 __pmd_populate(pmdp, __pa(ptep) | prot_l1);
305 pmdp[0] = __pmd(pmdval);
306 pmdp[1] = __pmd(pmdval + 256 * sizeof(pte_t));
307 flush_pmd_entry(pmdp);
308 } 302 }
309 ptep = pte_offset_kernel(pmdp, virt); 303 ptep = pte_offset_kernel(pmdp, virt);
310 304
@@ -383,6 +377,7 @@ static void __init build_mem_type_table(void)
383{ 377{
384 struct cachepolicy *cp; 378 struct cachepolicy *cp;
385 unsigned int cr = get_cr(); 379 unsigned int cr = get_cr();
380 unsigned int user_pgprot;
386 int cpu_arch = cpu_architecture(); 381 int cpu_arch = cpu_architecture();
387 int i; 382 int i;
388 383
@@ -408,6 +403,9 @@ static void __init build_mem_type_table(void)
408 } 403 }
409 } 404 }
410 405
406 cp = &cache_policies[cachepolicy];
407 user_pgprot = cp->pte;
408
411 /* 409 /*
412 * ARMv6 and above have extended page tables. 410 * ARMv6 and above have extended page tables.
413 */ 411 */
@@ -425,9 +423,19 @@ static void __init build_mem_type_table(void)
425 mem_types[MT_ROM].prot_sect |= PMD_SECT_APX|PMD_SECT_AP_WRITE; 423 mem_types[MT_ROM].prot_sect |= PMD_SECT_APX|PMD_SECT_AP_WRITE;
426 mem_types[MT_MINICLEAN].prot_sect |= PMD_SECT_APX|PMD_SECT_AP_WRITE; 424 mem_types[MT_MINICLEAN].prot_sect |= PMD_SECT_APX|PMD_SECT_AP_WRITE;
427 mem_types[MT_CACHECLEAN].prot_sect |= PMD_SECT_APX|PMD_SECT_AP_WRITE; 425 mem_types[MT_CACHECLEAN].prot_sect |= PMD_SECT_APX|PMD_SECT_AP_WRITE;
428 }
429 426
430 cp = &cache_policies[cachepolicy]; 427 /*
428 * Mark the device area as "shared device"
429 */
430 mem_types[MT_DEVICE].prot_pte |= L_PTE_BUFFERABLE;
431 mem_types[MT_DEVICE].prot_sect |= PMD_SECT_BUFFERED;
432
433 /*
434 * User pages need to be mapped with the ASID
435 * (iow, non-global)
436 */
437 user_pgprot |= L_PTE_ASID;
438 }
431 439
432 if (cpu_arch >= CPU_ARCH_ARMv5) { 440 if (cpu_arch >= CPU_ARCH_ARMv5) {
433 mem_types[MT_LOW_VECTORS].prot_pte |= cp->pte & PTE_CACHEABLE; 441 mem_types[MT_LOW_VECTORS].prot_pte |= cp->pte & PTE_CACHEABLE;
@@ -445,7 +453,7 @@ static void __init build_mem_type_table(void)
445 453
446 for (i = 0; i < 16; i++) { 454 for (i = 0; i < 16; i++) {
447 unsigned long v = pgprot_val(protection_map[i]); 455 unsigned long v = pgprot_val(protection_map[i]);
448 v &= (~(PTE_BUFFERABLE|PTE_CACHEABLE)) | cp->pte; 456 v = (v & ~(PTE_BUFFERABLE|PTE_CACHEABLE)) | user_pgprot;
449 protection_map[i] = __pgprot(v); 457 protection_map[i] = __pgprot(v);
450 } 458 }
451 459
@@ -569,23 +577,23 @@ static void __init create_mapping(struct map_desc *md)
569 */ 577 */
570void setup_mm_for_reboot(char mode) 578void setup_mm_for_reboot(char mode)
571{ 579{
572 unsigned long pmdval; 580 unsigned long base_pmdval;
573 pgd_t *pgd; 581 pgd_t *pgd;
574 pmd_t *pmd;
575 int i; 582 int i;
576 int cpu_arch = cpu_architecture();
577 583
578 if (current->mm && current->mm->pgd) 584 if (current->mm && current->mm->pgd)
579 pgd = current->mm->pgd; 585 pgd = current->mm->pgd;
580 else 586 else
581 pgd = init_mm.pgd; 587 pgd = init_mm.pgd;
582 588
583 for (i = 0; i < FIRST_USER_PGD_NR + USER_PTRS_PER_PGD; i++) { 589 base_pmdval = PMD_SECT_AP_WRITE | PMD_SECT_AP_READ | PMD_TYPE_SECT;
584 pmdval = (i << PGDIR_SHIFT) | 590 if (cpu_architecture() <= CPU_ARCH_ARMv5TEJ)
585 PMD_SECT_AP_WRITE | PMD_SECT_AP_READ | 591 base_pmdval |= PMD_BIT4;
586 PMD_TYPE_SECT; 592
587 if (cpu_arch <= CPU_ARCH_ARMv5TEJ) 593 for (i = 0; i < FIRST_USER_PGD_NR + USER_PTRS_PER_PGD; i++, pgd++) {
588 pmdval |= PMD_BIT4; 594 unsigned long pmdval = (i << PGDIR_SHIFT) | base_pmdval;
595 pmd_t *pmd;
596
589 pmd = pmd_off(pgd, i << PGDIR_SHIFT); 597 pmd = pmd_off(pgd, i << PGDIR_SHIFT);
590 pmd[0] = __pmd(pmdval); 598 pmd[0] = __pmd(pmdval);
591 pmd[1] = __pmd(pmdval + (1 << (PGDIR_SHIFT - 1))); 599 pmd[1] = __pmd(pmdval + (1 << (PGDIR_SHIFT - 1)));
diff --git a/arch/arm/mm/proc-arm6_7.S b/arch/arm/mm/proc-arm6_7.S
index 0ee214b824ff..189ef6a71ba1 100644
--- a/arch/arm/mm/proc-arm6_7.S
+++ b/arch/arm/mm/proc-arm6_7.S
@@ -38,8 +38,8 @@ ENTRY(cpu_arm7_data_abort)
38 mrc p15, 0, r1, c5, c0, 0 @ get FSR 38 mrc p15, 0, r1, c5, c0, 0 @ get FSR
39 mrc p15, 0, r0, c6, c0, 0 @ get FAR 39 mrc p15, 0, r0, c6, c0, 0 @ get FAR
40 ldr r8, [r0] @ read arm instruction 40 ldr r8, [r0] @ read arm instruction
41 tst r8, #1 << 20 @ L = 1 -> write? 41 tst r8, #1 << 20 @ L = 0 -> write?
42 orreq r1, r1, #1 << 8 @ yes. 42 orreq r1, r1, #1 << 11 @ yes.
43 and r7, r8, #15 << 24 43 and r7, r8, #15 << 24
44 add pc, pc, r7, lsr #22 @ Now branch to the relevant processing routine 44 add pc, pc, r7, lsr #22 @ Now branch to the relevant processing routine
45 nop 45 nop
@@ -71,8 +71,8 @@ ENTRY(cpu_arm6_data_abort)
71 mrc p15, 0, r1, c5, c0, 0 @ get FSR 71 mrc p15, 0, r1, c5, c0, 0 @ get FSR
72 mrc p15, 0, r0, c6, c0, 0 @ get FAR 72 mrc p15, 0, r0, c6, c0, 0 @ get FAR
73 ldr r8, [r2] @ read arm instruction 73 ldr r8, [r2] @ read arm instruction
74 tst r8, #1 << 20 @ L = 1 -> write? 74 tst r8, #1 << 20 @ L = 0 -> write?
75 orreq r1, r1, #1 << 8 @ yes. 75 orreq r1, r1, #1 << 11 @ yes.
76 and r7, r8, #14 << 24 76 and r7, r8, #14 << 24
77 teq r7, #8 << 24 @ was it ldm/stm 77 teq r7, #8 << 24 @ was it ldm/stm
78 movne pc, lr 78 movne pc, lr
diff --git a/arch/arm/mm/proc-v6.S b/arch/arm/mm/proc-v6.S
index 352db98ee269..139a38670c5d 100644
--- a/arch/arm/mm/proc-v6.S
+++ b/arch/arm/mm/proc-v6.S
@@ -105,18 +105,12 @@ ENTRY(cpu_v6_dcache_clean_area)
105ENTRY(cpu_v6_switch_mm) 105ENTRY(cpu_v6_switch_mm)
106 mov r2, #0 106 mov r2, #0
107 ldr r1, [r1, #MM_CONTEXT_ID] @ get mm->context.id 107 ldr r1, [r1, #MM_CONTEXT_ID] @ get mm->context.id
108 mcr p15, 0, r2, c7, c5, 6 @ flush BTAC/BTB 108 mcr p15, 0, r2, c7, c5, 6 @ flush BTAC/BTB
109 mcr p15, 0, r2, c7, c10, 4 @ drain write buffer 109 mcr p15, 0, r2, c7, c10, 4 @ drain write buffer
110 mcr p15, 0, r0, c2, c0, 0 @ set TTB 0 110 mcr p15, 0, r0, c2, c0, 0 @ set TTB 0
111 mcr p15, 0, r1, c13, c0, 1 @ set context ID 111 mcr p15, 0, r1, c13, c0, 1 @ set context ID
112 mov pc, lr 112 mov pc, lr
113 113
114#define nG (1 << 11)
115#define APX (1 << 9)
116#define AP1 (1 << 5)
117#define AP0 (1 << 4)
118#define XN (1 << 0)
119
120/* 114/*
121 * cpu_v6_set_pte(ptep, pte) 115 * cpu_v6_set_pte(ptep, pte)
122 * 116 *
@@ -139,24 +133,24 @@ ENTRY(cpu_v6_switch_mm)
139ENTRY(cpu_v6_set_pte) 133ENTRY(cpu_v6_set_pte)
140 str r1, [r0], #-2048 @ linux version 134 str r1, [r0], #-2048 @ linux version
141 135
142 bic r2, r1, #0x00000ff0 136 bic r2, r1, #0x000007f0
143 bic r2, r2, #0x00000003 137 bic r2, r2, #0x00000003
144 orr r2, r2, #AP0 | 2 138 orr r2, r2, #PTE_EXT_AP0 | 2
145 139
146 tst r1, #L_PTE_WRITE 140 tst r1, #L_PTE_WRITE
147 tstne r1, #L_PTE_DIRTY 141 tstne r1, #L_PTE_DIRTY
148 orreq r2, r2, #APX 142 orreq r2, r2, #PTE_EXT_APX
149 143
150 tst r1, #L_PTE_USER 144 tst r1, #L_PTE_USER
151 orrne r2, r2, #AP1 | nG 145 orrne r2, r2, #PTE_EXT_AP1
152 tstne r2, #APX 146 tstne r2, #PTE_EXT_APX
153 bicne r2, r2, #APX | AP0 147 bicne r2, r2, #PTE_EXT_APX | PTE_EXT_AP0
154 148
155 tst r1, #L_PTE_YOUNG 149 tst r1, #L_PTE_YOUNG
156 biceq r2, r2, #APX | AP1 | AP0 150 biceq r2, r2, #PTE_EXT_APX | PTE_EXT_AP_MASK
157 151
158@ tst r1, #L_PTE_EXEC 152@ tst r1, #L_PTE_EXEC
159@ orreq r2, r2, #XN 153@ orreq r2, r2, #PTE_EXT_XN
160 154
161 tst r1, #L_PTE_PRESENT 155 tst r1, #L_PTE_PRESENT
162 moveq r2, #0 156 moveq r2, #0
diff --git a/arch/arm/mm/proc-xscale.S b/arch/arm/mm/proc-xscale.S
index 2d977b4eeeab..b88de2700146 100644
--- a/arch/arm/mm/proc-xscale.S
+++ b/arch/arm/mm/proc-xscale.S
@@ -370,142 +370,6 @@ ENTRY(cpu_xscale_dcache_clean_area)
370 bhi 1b 370 bhi 1b
371 mov pc, lr 371 mov pc, lr
372 372
373/* ================================ CACHE LOCKING============================
374 *
375 * The XScale MicroArchitecture implements support for locking entries into
376 * the data and instruction cache. The following functions implement the core
377 * low level instructions needed to accomplish the locking. The developer's
378 * manual states that the code that performs the locking must be in non-cached
379 * memory. To accomplish this, the code in xscale-cache-lock.c copies the
380 * following functions from the cache into a non-cached memory region that
381 * is allocated through consistent_alloc().
382 *
383 */
384 .align 5
385/*
386 * xscale_icache_lock
387 *
388 * r0: starting address to lock
389 * r1: end address to lock
390 */
391ENTRY(xscale_icache_lock)
392
393iLockLoop:
394 bic r0, r0, #CACHELINESIZE - 1
395 mcr p15, 0, r0, c9, c1, 0 @ lock into cache
396 cmp r0, r1 @ are we done?
397 add r0, r0, #CACHELINESIZE @ advance to next cache line
398 bls iLockLoop
399 mov pc, lr
400
401/*
402 * xscale_icache_unlock
403 */
404ENTRY(xscale_icache_unlock)
405 mcr p15, 0, r0, c9, c1, 1 @ Unlock icache
406 mov pc, lr
407
408/*
409 * xscale_dcache_lock
410 *
411 * r0: starting address to lock
412 * r1: end address to lock
413 */
414ENTRY(xscale_dcache_lock)
415 mcr p15, 0, ip, c7, c10, 4 @ Drain Write (& Fill) Buffer
416 mov r2, #1
417 mcr p15, 0, r2, c9, c2, 0 @ Put dcache in lock mode
418 cpwait ip @ Wait for completion
419
420 mrs r2, cpsr
421 orr r3, r2, #PSR_F_BIT | PSR_I_BIT
422dLockLoop:
423 msr cpsr_c, r3
424 mcr p15, 0, r0, c7, c10, 1 @ Write back line if it is dirty
425 mcr p15, 0, r0, c7, c6, 1 @ Flush/invalidate line
426 msr cpsr_c, r2
427 ldr ip, [r0], #CACHELINESIZE @ Preload 32 bytes into cache from
428 @ location [r0]. Post-increment
429 @ r3 to next cache line
430 cmp r0, r1 @ Are we done?
431 bls dLockLoop
432
433 mcr p15, 0, ip, c7, c10, 4 @ Drain Write (& Fill) Buffer
434 mov r2, #0
435 mcr p15, 0, r2, c9, c2, 0 @ Get out of lock mode
436 cpwait_ret lr, ip
437
438/*
439 * xscale_dcache_unlock
440 */
441ENTRY(xscale_dcache_unlock)
442 mcr p15, 0, ip, c7, c10, 4 @ Drain Write (& Fill) Buffer
443 mcr p15, 0, ip, c9, c2, 1 @ Unlock cache
444 mov pc, lr
445
446/*
447 * Needed to determine the length of the code that needs to be copied.
448 */
449 .align 5
450ENTRY(xscale_cache_dummy)
451 mov pc, lr
452
453/* ================================ TLB LOCKING==============================
454 *
455 * The XScale MicroArchitecture implements support for locking entries into
456 * the Instruction and Data TLBs. The following functions provide the
457 * low level support for supporting these under Linux. xscale-lock.c
458 * implements some higher level management code. Most of the following
459 * is taken straight out of the Developer's Manual.
460 */
461
462/*
463 * Lock I-TLB entry
464 *
465 * r0: Virtual address to translate and lock
466 */
467 .align 5
468ENTRY(xscale_itlb_lock)
469 mrs r2, cpsr
470 orr r3, r2, #PSR_F_BIT | PSR_I_BIT
471 msr cpsr_c, r3 @ Disable interrupts
472 mcr p15, 0, r0, c8, c5, 1 @ Invalidate I-TLB entry
473 mcr p15, 0, r0, c10, c4, 0 @ Translate and lock
474 msr cpsr_c, r2 @ Restore interrupts
475 cpwait_ret lr, ip
476
477/*
478 * Lock D-TLB entry
479 *
480 * r0: Virtual address to translate and lock
481 */
482 .align 5
483ENTRY(xscale_dtlb_lock)
484 mrs r2, cpsr
485 orr r3, r2, #PSR_F_BIT | PSR_I_BIT
486 msr cpsr_c, r3 @ Disable interrupts
487 mcr p15, 0, r0, c8, c6, 1 @ Invalidate D-TLB entry
488 mcr p15, 0, r0, c10, c8, 0 @ Translate and lock
489 msr cpsr_c, r2 @ Restore interrupts
490 cpwait_ret lr, ip
491
492/*
493 * Unlock all I-TLB entries
494 */
495 .align 5
496ENTRY(xscale_itlb_unlock)
497 mcr p15, 0, ip, c10, c4, 1 @ Unlock I-TLB
498 mcr p15, 0, ip, c8, c5, 0 @ Invalidate I-TLB
499 cpwait_ret lr, ip
500
501/*
502 * Unlock all D-TLB entries
503 */
504ENTRY(xscale_dtlb_unlock)
505 mcr p15, 0, ip, c10, c8, 1 @ Unlock D-TBL
506 mcr p15, 0, ip, c8, c6, 0 @ Invalidate D-TLB
507 cpwait_ret lr, ip
508
509/* =============================== PageTable ============================== */ 373/* =============================== PageTable ============================== */
510 374
511#define PTE_CACHE_WRITE_ALLOCATE 0 375#define PTE_CACHE_WRITE_ALLOCATE 0
diff --git a/arch/arm/nwfpe/double_cpdo.c b/arch/arm/nwfpe/double_cpdo.c
index 7ffd8cb9bc96..c51d1386a97c 100644
--- a/arch/arm/nwfpe/double_cpdo.c
+++ b/arch/arm/nwfpe/double_cpdo.c
@@ -40,17 +40,17 @@ float64 float64_arccos(float64 rFm);
40float64 float64_pow(float64 rFn, float64 rFm); 40float64 float64_pow(float64 rFn, float64 rFm);
41float64 float64_pol(float64 rFn, float64 rFm); 41float64 float64_pol(float64 rFn, float64 rFm);
42 42
43static float64 float64_rsf(float64 rFn, float64 rFm) 43static float64 float64_rsf(struct roundingData *roundData, float64 rFn, float64 rFm)
44{ 44{
45 return float64_sub(rFm, rFn); 45 return float64_sub(roundData, rFm, rFn);
46} 46}
47 47
48static float64 float64_rdv(float64 rFn, float64 rFm) 48static float64 float64_rdv(struct roundingData *roundData, float64 rFn, float64 rFm)
49{ 49{
50 return float64_div(rFm, rFn); 50 return float64_div(roundData, rFm, rFn);
51} 51}
52 52
53static float64 (*const dyadic_double[16])(float64 rFn, float64 rFm) = { 53static float64 (*const dyadic_double[16])(struct roundingData*, float64 rFn, float64 rFm) = {
54 [ADF_CODE >> 20] = float64_add, 54 [ADF_CODE >> 20] = float64_add,
55 [MUF_CODE >> 20] = float64_mul, 55 [MUF_CODE >> 20] = float64_mul,
56 [SUF_CODE >> 20] = float64_sub, 56 [SUF_CODE >> 20] = float64_sub,
@@ -65,12 +65,12 @@ static float64 (*const dyadic_double[16])(float64 rFn, float64 rFm) = {
65 [FRD_CODE >> 20] = float64_rdv, 65 [FRD_CODE >> 20] = float64_rdv,
66}; 66};
67 67
68static float64 float64_mvf(float64 rFm) 68static float64 float64_mvf(struct roundingData *roundData,float64 rFm)
69{ 69{
70 return rFm; 70 return rFm;
71} 71}
72 72
73static float64 float64_mnf(float64 rFm) 73static float64 float64_mnf(struct roundingData *roundData,float64 rFm)
74{ 74{
75 union float64_components u; 75 union float64_components u;
76 76
@@ -84,7 +84,7 @@ static float64 float64_mnf(float64 rFm)
84 return u.f64; 84 return u.f64;
85} 85}
86 86
87static float64 float64_abs(float64 rFm) 87static float64 float64_abs(struct roundingData *roundData,float64 rFm)
88{ 88{
89 union float64_components u; 89 union float64_components u;
90 90
@@ -98,7 +98,7 @@ static float64 float64_abs(float64 rFm)
98 return u.f64; 98 return u.f64;
99} 99}
100 100
101static float64 (*const monadic_double[16])(float64 rFm) = { 101static float64 (*const monadic_double[16])(struct roundingData *, float64 rFm) = {
102 [MVF_CODE >> 20] = float64_mvf, 102 [MVF_CODE >> 20] = float64_mvf,
103 [MNF_CODE >> 20] = float64_mnf, 103 [MNF_CODE >> 20] = float64_mnf,
104 [ABS_CODE >> 20] = float64_abs, 104 [ABS_CODE >> 20] = float64_abs,
@@ -108,7 +108,7 @@ static float64 (*const monadic_double[16])(float64 rFm) = {
108 [NRM_CODE >> 20] = float64_mvf, 108 [NRM_CODE >> 20] = float64_mvf,
109}; 109};
110 110
111unsigned int DoubleCPDO(const unsigned int opcode, FPREG * rFd) 111unsigned int DoubleCPDO(struct roundingData *roundData, const unsigned int opcode, FPREG * rFd)
112{ 112{
113 FPA11 *fpa11 = GET_FPA11(); 113 FPA11 *fpa11 = GET_FPA11();
114 float64 rFm; 114 float64 rFm;
@@ -151,13 +151,13 @@ unsigned int DoubleCPDO(const unsigned int opcode, FPREG * rFd)
151 } 151 }
152 152
153 if (dyadic_double[opc_mask_shift]) { 153 if (dyadic_double[opc_mask_shift]) {
154 rFd->fDouble = dyadic_double[opc_mask_shift](rFn, rFm); 154 rFd->fDouble = dyadic_double[opc_mask_shift](roundData, rFn, rFm);
155 } else { 155 } else {
156 return 0; 156 return 0;
157 } 157 }
158 } else { 158 } else {
159 if (monadic_double[opc_mask_shift]) { 159 if (monadic_double[opc_mask_shift]) {
160 rFd->fDouble = monadic_double[opc_mask_shift](rFm); 160 rFd->fDouble = monadic_double[opc_mask_shift](roundData, rFm);
161 } else { 161 } else {
162 return 0; 162 return 0;
163 } 163 }
diff --git a/arch/arm/nwfpe/extended_cpdo.c b/arch/arm/nwfpe/extended_cpdo.c
index c39f68a3449e..65a279ba927f 100644
--- a/arch/arm/nwfpe/extended_cpdo.c
+++ b/arch/arm/nwfpe/extended_cpdo.c
@@ -35,17 +35,17 @@ floatx80 floatx80_arccos(floatx80 rFm);
35floatx80 floatx80_pow(floatx80 rFn, floatx80 rFm); 35floatx80 floatx80_pow(floatx80 rFn, floatx80 rFm);
36floatx80 floatx80_pol(floatx80 rFn, floatx80 rFm); 36floatx80 floatx80_pol(floatx80 rFn, floatx80 rFm);
37 37
38static floatx80 floatx80_rsf(floatx80 rFn, floatx80 rFm) 38static floatx80 floatx80_rsf(struct roundingData *roundData, floatx80 rFn, floatx80 rFm)
39{ 39{
40 return floatx80_sub(rFm, rFn); 40 return floatx80_sub(roundData, rFm, rFn);
41} 41}
42 42
43static floatx80 floatx80_rdv(floatx80 rFn, floatx80 rFm) 43static floatx80 floatx80_rdv(struct roundingData *roundData, floatx80 rFn, floatx80 rFm)
44{ 44{
45 return floatx80_div(rFm, rFn); 45 return floatx80_div(roundData, rFm, rFn);
46} 46}
47 47
48static floatx80 (*const dyadic_extended[16])(floatx80 rFn, floatx80 rFm) = { 48static floatx80 (*const dyadic_extended[16])(struct roundingData*, floatx80 rFn, floatx80 rFm) = {
49 [ADF_CODE >> 20] = floatx80_add, 49 [ADF_CODE >> 20] = floatx80_add,
50 [MUF_CODE >> 20] = floatx80_mul, 50 [MUF_CODE >> 20] = floatx80_mul,
51 [SUF_CODE >> 20] = floatx80_sub, 51 [SUF_CODE >> 20] = floatx80_sub,
@@ -60,24 +60,24 @@ static floatx80 (*const dyadic_extended[16])(floatx80 rFn, floatx80 rFm) = {
60 [FRD_CODE >> 20] = floatx80_rdv, 60 [FRD_CODE >> 20] = floatx80_rdv,
61}; 61};
62 62
63static floatx80 floatx80_mvf(floatx80 rFm) 63static floatx80 floatx80_mvf(struct roundingData *roundData, floatx80 rFm)
64{ 64{
65 return rFm; 65 return rFm;
66} 66}
67 67
68static floatx80 floatx80_mnf(floatx80 rFm) 68static floatx80 floatx80_mnf(struct roundingData *roundData, floatx80 rFm)
69{ 69{
70 rFm.high ^= 0x8000; 70 rFm.high ^= 0x8000;
71 return rFm; 71 return rFm;
72} 72}
73 73
74static floatx80 floatx80_abs(floatx80 rFm) 74static floatx80 floatx80_abs(struct roundingData *roundData, floatx80 rFm)
75{ 75{
76 rFm.high &= 0x7fff; 76 rFm.high &= 0x7fff;
77 return rFm; 77 return rFm;
78} 78}
79 79
80static floatx80 (*const monadic_extended[16])(floatx80 rFm) = { 80static floatx80 (*const monadic_extended[16])(struct roundingData*, floatx80 rFm) = {
81 [MVF_CODE >> 20] = floatx80_mvf, 81 [MVF_CODE >> 20] = floatx80_mvf,
82 [MNF_CODE >> 20] = floatx80_mnf, 82 [MNF_CODE >> 20] = floatx80_mnf,
83 [ABS_CODE >> 20] = floatx80_abs, 83 [ABS_CODE >> 20] = floatx80_abs,
@@ -87,7 +87,7 @@ static floatx80 (*const monadic_extended[16])(floatx80 rFm) = {
87 [NRM_CODE >> 20] = floatx80_mvf, 87 [NRM_CODE >> 20] = floatx80_mvf,
88}; 88};
89 89
90unsigned int ExtendedCPDO(const unsigned int opcode, FPREG * rFd) 90unsigned int ExtendedCPDO(struct roundingData *roundData, const unsigned int opcode, FPREG * rFd)
91{ 91{
92 FPA11 *fpa11 = GET_FPA11(); 92 FPA11 *fpa11 = GET_FPA11();
93 floatx80 rFm; 93 floatx80 rFm;
@@ -138,13 +138,13 @@ unsigned int ExtendedCPDO(const unsigned int opcode, FPREG * rFd)
138 } 138 }
139 139
140 if (dyadic_extended[opc_mask_shift]) { 140 if (dyadic_extended[opc_mask_shift]) {
141 rFd->fExtended = dyadic_extended[opc_mask_shift](rFn, rFm); 141 rFd->fExtended = dyadic_extended[opc_mask_shift](roundData, rFn, rFm);
142 } else { 142 } else {
143 return 0; 143 return 0;
144 } 144 }
145 } else { 145 } else {
146 if (monadic_extended[opc_mask_shift]) { 146 if (monadic_extended[opc_mask_shift]) {
147 rFd->fExtended = monadic_extended[opc_mask_shift](rFm); 147 rFd->fExtended = monadic_extended[opc_mask_shift](roundData, rFm);
148 } else { 148 } else {
149 return 0; 149 return 0;
150 } 150 }
diff --git a/arch/arm/nwfpe/fpa11.c b/arch/arm/nwfpe/fpa11.c
index bf61696865ec..7690f731ee87 100644
--- a/arch/arm/nwfpe/fpa11.c
+++ b/arch/arm/nwfpe/fpa11.c
@@ -51,48 +51,42 @@ static void resetFPA11(void)
51 fpa11->fpsr = FP_EMULATOR | BIT_AC; 51 fpa11->fpsr = FP_EMULATOR | BIT_AC;
52} 52}
53 53
54void SetRoundingMode(const unsigned int opcode) 54int8 SetRoundingMode(const unsigned int opcode)
55{ 55{
56 switch (opcode & MASK_ROUNDING_MODE) { 56 switch (opcode & MASK_ROUNDING_MODE) {
57 default: 57 default:
58 case ROUND_TO_NEAREST: 58 case ROUND_TO_NEAREST:
59 float_rounding_mode = float_round_nearest_even; 59 return float_round_nearest_even;
60 break;
61 60
62 case ROUND_TO_PLUS_INFINITY: 61 case ROUND_TO_PLUS_INFINITY:
63 float_rounding_mode = float_round_up; 62 return float_round_up;
64 break;
65 63
66 case ROUND_TO_MINUS_INFINITY: 64 case ROUND_TO_MINUS_INFINITY:
67 float_rounding_mode = float_round_down; 65 return float_round_down;
68 break;
69 66
70 case ROUND_TO_ZERO: 67 case ROUND_TO_ZERO:
71 float_rounding_mode = float_round_to_zero; 68 return float_round_to_zero;
72 break;
73 } 69 }
74} 70}
75 71
76void SetRoundingPrecision(const unsigned int opcode) 72int8 SetRoundingPrecision(const unsigned int opcode)
77{ 73{
78#ifdef CONFIG_FPE_NWFPE_XP 74#ifdef CONFIG_FPE_NWFPE_XP
79 switch (opcode & MASK_ROUNDING_PRECISION) { 75 switch (opcode & MASK_ROUNDING_PRECISION) {
80 case ROUND_SINGLE: 76 case ROUND_SINGLE:
81 floatx80_rounding_precision = 32; 77 return 32;
82 break;
83 78
84 case ROUND_DOUBLE: 79 case ROUND_DOUBLE:
85 floatx80_rounding_precision = 64; 80 return 64;
86 break;
87 81
88 case ROUND_EXTENDED: 82 case ROUND_EXTENDED:
89 floatx80_rounding_precision = 80; 83 return 80;
90 break;
91 84
92 default: 85 default:
93 floatx80_rounding_precision = 80; 86 return 80;
94 } 87 }
95#endif 88#endif
89 return 80;
96} 90}
97 91
98void nwfpe_init_fpa(union fp_state *fp) 92void nwfpe_init_fpa(union fp_state *fp)
@@ -103,8 +97,6 @@ void nwfpe_init_fpa(union fp_state *fp)
103#endif 97#endif
104 memset(fpa11, 0, sizeof(FPA11)); 98 memset(fpa11, 0, sizeof(FPA11));
105 resetFPA11(); 99 resetFPA11();
106 SetRoundingMode(ROUND_TO_NEAREST);
107 SetRoundingPrecision(ROUND_EXTENDED);
108 fpa11->initflag = 1; 100 fpa11->initflag = 1;
109} 101}
110 102
diff --git a/arch/arm/nwfpe/fpa11.h b/arch/arm/nwfpe/fpa11.h
index 45cc65426a22..93523ae4b7a1 100644
--- a/arch/arm/nwfpe/fpa11.h
+++ b/arch/arm/nwfpe/fpa11.h
@@ -29,9 +29,7 @@
29 * stack+task struct. Use the same method as 'current' uses to 29 * stack+task struct. Use the same method as 'current' uses to
30 * reach them. 30 * reach them.
31 */ 31 */
32register unsigned long *user_registers asm("sl"); 32#define GET_USERREG() ((struct pt_regs *)(THREAD_START_SP + (unsigned long)current_thread_info()) - 1)
33
34#define GET_USERREG() (user_registers)
35 33
36#include <linux/config.h> 34#include <linux/config.h>
37#include <linux/thread_info.h> 35#include <linux/thread_info.h>
@@ -39,6 +37,13 @@ register unsigned long *user_registers asm("sl");
39/* includes */ 37/* includes */
40#include "fpsr.h" /* FP control and status register definitions */ 38#include "fpsr.h" /* FP control and status register definitions */
41#include "milieu.h" 39#include "milieu.h"
40
41struct roundingData {
42 int8 mode;
43 int8 precision;
44 signed char exception;
45};
46
42#include "softfloat.h" 47#include "softfloat.h"
43 48
44#define typeNone 0x00 49#define typeNone 0x00
@@ -86,8 +91,8 @@ typedef struct tagFPA11 {
86 initialised. */ 91 initialised. */
87} FPA11; 92} FPA11;
88 93
89extern void SetRoundingMode(const unsigned int); 94extern int8 SetRoundingMode(const unsigned int);
90extern void SetRoundingPrecision(const unsigned int); 95extern int8 SetRoundingPrecision(const unsigned int);
91extern void nwfpe_init_fpa(union fp_state *fp); 96extern void nwfpe_init_fpa(union fp_state *fp);
92 97
93#endif 98#endif
diff --git a/arch/arm/nwfpe/fpa11_cpdo.c b/arch/arm/nwfpe/fpa11_cpdo.c
index 1bea67437b6f..4a31dfd94068 100644
--- a/arch/arm/nwfpe/fpa11_cpdo.c
+++ b/arch/arm/nwfpe/fpa11_cpdo.c
@@ -24,15 +24,16 @@
24#include "fpa11.h" 24#include "fpa11.h"
25#include "fpopcode.h" 25#include "fpopcode.h"
26 26
27unsigned int SingleCPDO(const unsigned int opcode, FPREG * rFd); 27unsigned int SingleCPDO(struct roundingData *roundData, const unsigned int opcode, FPREG * rFd);
28unsigned int DoubleCPDO(const unsigned int opcode, FPREG * rFd); 28unsigned int DoubleCPDO(struct roundingData *roundData, const unsigned int opcode, FPREG * rFd);
29unsigned int ExtendedCPDO(const unsigned int opcode, FPREG * rFd); 29unsigned int ExtendedCPDO(struct roundingData *roundData, const unsigned int opcode, FPREG * rFd);
30 30
31unsigned int EmulateCPDO(const unsigned int opcode) 31unsigned int EmulateCPDO(const unsigned int opcode)
32{ 32{
33 FPA11 *fpa11 = GET_FPA11(); 33 FPA11 *fpa11 = GET_FPA11();
34 FPREG *rFd; 34 FPREG *rFd;
35 unsigned int nType, nDest, nRc; 35 unsigned int nType, nDest, nRc;
36 struct roundingData roundData;
36 37
37 /* Get the destination size. If not valid let Linux perform 38 /* Get the destination size. If not valid let Linux perform
38 an invalid instruction trap. */ 39 an invalid instruction trap. */
@@ -40,7 +41,9 @@ unsigned int EmulateCPDO(const unsigned int opcode)
40 if (typeNone == nDest) 41 if (typeNone == nDest)
41 return 0; 42 return 0;
42 43
43 SetRoundingMode(opcode); 44 roundData.mode = SetRoundingMode(opcode);
45 roundData.precision = SetRoundingPrecision(opcode);
46 roundData.exception = 0;
44 47
45 /* Compare the size of the operands in Fn and Fm. 48 /* Compare the size of the operands in Fn and Fm.
46 Choose the largest size and perform operations in that size, 49 Choose the largest size and perform operations in that size,
@@ -63,14 +66,14 @@ unsigned int EmulateCPDO(const unsigned int opcode)
63 66
64 switch (nType) { 67 switch (nType) {
65 case typeSingle: 68 case typeSingle:
66 nRc = SingleCPDO(opcode, rFd); 69 nRc = SingleCPDO(&roundData, opcode, rFd);
67 break; 70 break;
68 case typeDouble: 71 case typeDouble:
69 nRc = DoubleCPDO(opcode, rFd); 72 nRc = DoubleCPDO(&roundData, opcode, rFd);
70 break; 73 break;
71#ifdef CONFIG_FPE_NWFPE_XP 74#ifdef CONFIG_FPE_NWFPE_XP
72 case typeExtended: 75 case typeExtended:
73 nRc = ExtendedCPDO(opcode, rFd); 76 nRc = ExtendedCPDO(&roundData, opcode, rFd);
74 break; 77 break;
75#endif 78#endif
76 default: 79 default:
@@ -93,9 +96,9 @@ unsigned int EmulateCPDO(const unsigned int opcode)
93 case typeSingle: 96 case typeSingle:
94 { 97 {
95 if (typeDouble == nType) 98 if (typeDouble == nType)
96 rFd->fSingle = float64_to_float32(rFd->fDouble); 99 rFd->fSingle = float64_to_float32(&roundData, rFd->fDouble);
97 else 100 else
98 rFd->fSingle = floatx80_to_float32(rFd->fExtended); 101 rFd->fSingle = floatx80_to_float32(&roundData, rFd->fExtended);
99 } 102 }
100 break; 103 break;
101 104
@@ -104,7 +107,7 @@ unsigned int EmulateCPDO(const unsigned int opcode)
104 if (typeSingle == nType) 107 if (typeSingle == nType)
105 rFd->fDouble = float32_to_float64(rFd->fSingle); 108 rFd->fDouble = float32_to_float64(rFd->fSingle);
106 else 109 else
107 rFd->fDouble = floatx80_to_float64(rFd->fExtended); 110 rFd->fDouble = floatx80_to_float64(&roundData, rFd->fExtended);
108 } 111 }
109 break; 112 break;
110 113
@@ -121,12 +124,15 @@ unsigned int EmulateCPDO(const unsigned int opcode)
121#else 124#else
122 if (nDest != nType) { 125 if (nDest != nType) {
123 if (nDest == typeSingle) 126 if (nDest == typeSingle)
124 rFd->fSingle = float64_to_float32(rFd->fDouble); 127 rFd->fSingle = float64_to_float32(&roundData, rFd->fDouble);
125 else 128 else
126 rFd->fDouble = float32_to_float64(rFd->fSingle); 129 rFd->fDouble = float32_to_float64(rFd->fSingle);
127 } 130 }
128#endif 131#endif
129 } 132 }
130 133
134 if (roundData.exception)
135 float_raise(roundData.exception);
136
131 return nRc; 137 return nRc;
132} 138}
diff --git a/arch/arm/nwfpe/fpa11_cpdt.c b/arch/arm/nwfpe/fpa11_cpdt.c
index 95fb63fa9d18..b0db5cbcc3b1 100644
--- a/arch/arm/nwfpe/fpa11_cpdt.c
+++ b/arch/arm/nwfpe/fpa11_cpdt.c
@@ -96,7 +96,7 @@ static inline void loadMultiple(const unsigned int Fn, const unsigned int __user
96 } 96 }
97} 97}
98 98
99static inline void storeSingle(const unsigned int Fn, unsigned int __user *pMem) 99static inline void storeSingle(struct roundingData *roundData, const unsigned int Fn, unsigned int __user *pMem)
100{ 100{
101 FPA11 *fpa11 = GET_FPA11(); 101 FPA11 *fpa11 = GET_FPA11();
102 union { 102 union {
@@ -106,12 +106,12 @@ static inline void storeSingle(const unsigned int Fn, unsigned int __user *pMem)
106 106
107 switch (fpa11->fType[Fn]) { 107 switch (fpa11->fType[Fn]) {
108 case typeDouble: 108 case typeDouble:
109 val.f = float64_to_float32(fpa11->fpreg[Fn].fDouble); 109 val.f = float64_to_float32(roundData, fpa11->fpreg[Fn].fDouble);
110 break; 110 break;
111 111
112#ifdef CONFIG_FPE_NWFPE_XP 112#ifdef CONFIG_FPE_NWFPE_XP
113 case typeExtended: 113 case typeExtended:
114 val.f = floatx80_to_float32(fpa11->fpreg[Fn].fExtended); 114 val.f = floatx80_to_float32(roundData, fpa11->fpreg[Fn].fExtended);
115 break; 115 break;
116#endif 116#endif
117 117
@@ -122,7 +122,7 @@ static inline void storeSingle(const unsigned int Fn, unsigned int __user *pMem)
122 put_user(val.i[0], pMem); 122 put_user(val.i[0], pMem);
123} 123}
124 124
125static inline void storeDouble(const unsigned int Fn, unsigned int __user *pMem) 125static inline void storeDouble(struct roundingData *roundData, const unsigned int Fn, unsigned int __user *pMem)
126{ 126{
127 FPA11 *fpa11 = GET_FPA11(); 127 FPA11 *fpa11 = GET_FPA11();
128 union { 128 union {
@@ -137,7 +137,7 @@ static inline void storeDouble(const unsigned int Fn, unsigned int __user *pMem)
137 137
138#ifdef CONFIG_FPE_NWFPE_XP 138#ifdef CONFIG_FPE_NWFPE_XP
139 case typeExtended: 139 case typeExtended:
140 val.f = floatx80_to_float64(fpa11->fpreg[Fn].fExtended); 140 val.f = floatx80_to_float64(roundData, fpa11->fpreg[Fn].fExtended);
141 break; 141 break;
142#endif 142#endif
143 143
@@ -259,8 +259,11 @@ unsigned int PerformSTF(const unsigned int opcode)
259{ 259{
260 unsigned int __user *pBase, *pAddress, *pFinal; 260 unsigned int __user *pBase, *pAddress, *pFinal;
261 unsigned int nRc = 1, write_back = WRITE_BACK(opcode); 261 unsigned int nRc = 1, write_back = WRITE_BACK(opcode);
262 struct roundingData roundData;
262 263
263 SetRoundingMode(ROUND_TO_NEAREST); 264 roundData.mode = SetRoundingMode(opcode);
265 roundData.precision = SetRoundingPrecision(opcode);
266 roundData.exception = 0;
264 267
265 pBase = (unsigned int __user *) readRegister(getRn(opcode)); 268 pBase = (unsigned int __user *) readRegister(getRn(opcode));
266 if (REG_PC == getRn(opcode)) { 269 if (REG_PC == getRn(opcode)) {
@@ -281,10 +284,10 @@ unsigned int PerformSTF(const unsigned int opcode)
281 284
282 switch (opcode & MASK_TRANSFER_LENGTH) { 285 switch (opcode & MASK_TRANSFER_LENGTH) {
283 case TRANSFER_SINGLE: 286 case TRANSFER_SINGLE:
284 storeSingle(getFd(opcode), pAddress); 287 storeSingle(&roundData, getFd(opcode), pAddress);
285 break; 288 break;
286 case TRANSFER_DOUBLE: 289 case TRANSFER_DOUBLE:
287 storeDouble(getFd(opcode), pAddress); 290 storeDouble(&roundData, getFd(opcode), pAddress);
288 break; 291 break;
289#ifdef CONFIG_FPE_NWFPE_XP 292#ifdef CONFIG_FPE_NWFPE_XP
290 case TRANSFER_EXTENDED: 293 case TRANSFER_EXTENDED:
@@ -295,6 +298,9 @@ unsigned int PerformSTF(const unsigned int opcode)
295 nRc = 0; 298 nRc = 0;
296 } 299 }
297 300
301 if (roundData.exception)
302 float_raise(roundData.exception);
303
298 if (write_back) 304 if (write_back)
299 writeRegister(getRn(opcode), (unsigned long) pFinal); 305 writeRegister(getRn(opcode), (unsigned long) pFinal);
300 return nRc; 306 return nRc;
diff --git a/arch/arm/nwfpe/fpa11_cprt.c b/arch/arm/nwfpe/fpa11_cprt.c
index db01fbc97216..adf8d3000540 100644
--- a/arch/arm/nwfpe/fpa11_cprt.c
+++ b/arch/arm/nwfpe/fpa11_cprt.c
@@ -33,8 +33,6 @@ extern flag floatx80_is_nan(floatx80);
33extern flag float64_is_nan(float64); 33extern flag float64_is_nan(float64);
34extern flag float32_is_nan(float32); 34extern flag float32_is_nan(float32);
35 35
36void SetRoundingMode(const unsigned int opcode);
37
38unsigned int PerformFLT(const unsigned int opcode); 36unsigned int PerformFLT(const unsigned int opcode);
39unsigned int PerformFIX(const unsigned int opcode); 37unsigned int PerformFIX(const unsigned int opcode);
40 38
@@ -77,14 +75,17 @@ unsigned int EmulateCPRT(const unsigned int opcode)
77unsigned int PerformFLT(const unsigned int opcode) 75unsigned int PerformFLT(const unsigned int opcode)
78{ 76{
79 FPA11 *fpa11 = GET_FPA11(); 77 FPA11 *fpa11 = GET_FPA11();
80 SetRoundingMode(opcode); 78 struct roundingData roundData;
81 SetRoundingPrecision(opcode); 79
80 roundData.mode = SetRoundingMode(opcode);
81 roundData.precision = SetRoundingPrecision(opcode);
82 roundData.exception = 0;
82 83
83 switch (opcode & MASK_ROUNDING_PRECISION) { 84 switch (opcode & MASK_ROUNDING_PRECISION) {
84 case ROUND_SINGLE: 85 case ROUND_SINGLE:
85 { 86 {
86 fpa11->fType[getFn(opcode)] = typeSingle; 87 fpa11->fType[getFn(opcode)] = typeSingle;
87 fpa11->fpreg[getFn(opcode)].fSingle = int32_to_float32(readRegister(getRd(opcode))); 88 fpa11->fpreg[getFn(opcode)].fSingle = int32_to_float32(&roundData, readRegister(getRd(opcode)));
88 } 89 }
89 break; 90 break;
90 91
@@ -108,6 +109,9 @@ unsigned int PerformFLT(const unsigned int opcode)
108 return 0; 109 return 0;
109 } 110 }
110 111
112 if (roundData.exception)
113 float_raise(roundData.exception);
114
111 return 1; 115 return 1;
112} 116}
113 117
@@ -115,26 +119,29 @@ unsigned int PerformFIX(const unsigned int opcode)
115{ 119{
116 FPA11 *fpa11 = GET_FPA11(); 120 FPA11 *fpa11 = GET_FPA11();
117 unsigned int Fn = getFm(opcode); 121 unsigned int Fn = getFm(opcode);
122 struct roundingData roundData;
118 123
119 SetRoundingMode(opcode); 124 roundData.mode = SetRoundingMode(opcode);
125 roundData.precision = SetRoundingPrecision(opcode);
126 roundData.exception = 0;
120 127
121 switch (fpa11->fType[Fn]) { 128 switch (fpa11->fType[Fn]) {
122 case typeSingle: 129 case typeSingle:
123 { 130 {
124 writeRegister(getRd(opcode), float32_to_int32(fpa11->fpreg[Fn].fSingle)); 131 writeRegister(getRd(opcode), float32_to_int32(&roundData, fpa11->fpreg[Fn].fSingle));
125 } 132 }
126 break; 133 break;
127 134
128 case typeDouble: 135 case typeDouble:
129 { 136 {
130 writeRegister(getRd(opcode), float64_to_int32(fpa11->fpreg[Fn].fDouble)); 137 writeRegister(getRd(opcode), float64_to_int32(&roundData, fpa11->fpreg[Fn].fDouble));
131 } 138 }
132 break; 139 break;
133 140
134#ifdef CONFIG_FPE_NWFPE_XP 141#ifdef CONFIG_FPE_NWFPE_XP
135 case typeExtended: 142 case typeExtended:
136 { 143 {
137 writeRegister(getRd(opcode), floatx80_to_int32(fpa11->fpreg[Fn].fExtended)); 144 writeRegister(getRd(opcode), floatx80_to_int32(&roundData, fpa11->fpreg[Fn].fExtended));
138 } 145 }
139 break; 146 break;
140#endif 147#endif
@@ -143,6 +150,9 @@ unsigned int PerformFIX(const unsigned int opcode)
143 return 0; 150 return 0;
144 } 151 }
145 152
153 if (roundData.exception)
154 float_raise(roundData.exception);
155
146 return 1; 156 return 1;
147} 157}
148 158
diff --git a/arch/arm/nwfpe/fpmodule.c b/arch/arm/nwfpe/fpmodule.c
index a806fea5c3ed..2dfe1ac42ee8 100644
--- a/arch/arm/nwfpe/fpmodule.c
+++ b/arch/arm/nwfpe/fpmodule.c
@@ -24,7 +24,6 @@
24#include "fpa11.h" 24#include "fpa11.h"
25 25
26#include <linux/module.h> 26#include <linux/module.h>
27#include <linux/version.h>
28#include <linux/config.h> 27#include <linux/config.h>
29 28
30/* XXX */ 29/* XXX */
@@ -117,8 +116,6 @@ fpmodule.c to integrate with the NetBSD kernel (I hope!).
117code to access data in user space in some other source files at the 116code to access data in user space in some other source files at the
118moment (grep for get_user / put_user calls). --philb] 117moment (grep for get_user / put_user calls). --philb]
119 118
120float_exception_flags is a global variable in SoftFloat.
121
122This function is called by the SoftFloat routines to raise a floating 119This function is called by the SoftFloat routines to raise a floating
123point exception. We check the trap enable byte in the FPSR, and raise 120point exception. We check the trap enable byte in the FPSR, and raise
124a SIGFPE exception if necessary. If not the relevant bits in the 121a SIGFPE exception if necessary. If not the relevant bits in the
@@ -130,15 +127,14 @@ void float_raise(signed char flags)
130 register unsigned int fpsr, cumulativeTraps; 127 register unsigned int fpsr, cumulativeTraps;
131 128
132#ifdef CONFIG_DEBUG_USER 129#ifdef CONFIG_DEBUG_USER
133 printk(KERN_DEBUG 130 /* Ignore inexact errors as there are far too many of them to log */
134 "NWFPE: %s[%d] takes exception %08x at %p from %08lx\n", 131 if (flags & ~BIT_IXC)
135 current->comm, current->pid, flags, 132 printk(KERN_DEBUG
136 __builtin_return_address(0), GET_USERREG()[15]); 133 "NWFPE: %s[%d] takes exception %08x at %p from %08lx\n",
134 current->comm, current->pid, flags,
135 __builtin_return_address(0), GET_USERREG()->ARM_pc);
137#endif 136#endif
138 137
139 /* Keep SoftFloat exception flags up to date. */
140 float_exception_flags |= flags;
141
142 /* Read fpsr and initialize the cumulativeTraps. */ 138 /* Read fpsr and initialize the cumulativeTraps. */
143 fpsr = readFPSR(); 139 fpsr = readFPSR();
144 cumulativeTraps = 0; 140 cumulativeTraps = 0;
diff --git a/arch/arm/nwfpe/fpmodule.inl b/arch/arm/nwfpe/fpmodule.inl
index e5f59e9a3022..2c39ad408f22 100644
--- a/arch/arm/nwfpe/fpmodule.inl
+++ b/arch/arm/nwfpe/fpmodule.inl
@@ -28,8 +28,8 @@ static inline unsigned long readRegister(const unsigned int nReg)
28 for this in this routine. LDF/STF instructions with Rn = PC 28 for this in this routine. LDF/STF instructions with Rn = PC
29 depend on the PC being correct, as they use PC+8 in their 29 depend on the PC being correct, as they use PC+8 in their
30 address calculations. */ 30 address calculations. */
31 unsigned long *userRegisters = GET_USERREG(); 31 struct pt_regs *regs = GET_USERREG();
32 unsigned int val = userRegisters[nReg]; 32 unsigned int val = regs->uregs[nReg];
33 if (REG_PC == nReg) 33 if (REG_PC == nReg)
34 val -= 4; 34 val -= 4;
35 return val; 35 return val;
@@ -38,8 +38,8 @@ static inline unsigned long readRegister(const unsigned int nReg)
38static inline void 38static inline void
39writeRegister(const unsigned int nReg, const unsigned long val) 39writeRegister(const unsigned int nReg, const unsigned long val)
40{ 40{
41 unsigned long *userRegisters = GET_USERREG(); 41 struct pt_regs *regs = GET_USERREG();
42 userRegisters[nReg] = val; 42 regs->uregs[nReg] = val;
43} 43}
44 44
45static inline unsigned long readCPSR(void) 45static inline unsigned long readCPSR(void)
@@ -63,12 +63,12 @@ static inline unsigned long readConditionCodes(void)
63 63
64static inline void writeConditionCodes(const unsigned long val) 64static inline void writeConditionCodes(const unsigned long val)
65{ 65{
66 unsigned long *userRegisters = GET_USERREG(); 66 struct pt_regs *regs = GET_USERREG();
67 unsigned long rval; 67 unsigned long rval;
68 /* 68 /*
69 * Operate directly on userRegisters since 69 * Operate directly on userRegisters since
70 * the CPSR may be the PC register itself. 70 * the CPSR may be the PC register itself.
71 */ 71 */
72 rval = userRegisters[REG_CPSR] & ~CC_MASK; 72 rval = regs->ARM_cpsr & ~CC_MASK;
73 userRegisters[REG_CPSR] = rval | (val & CC_MASK); 73 regs->ARM_cpsr = rval | (val & CC_MASK);
74} 74}
diff --git a/arch/arm/nwfpe/fpopcode.h b/arch/arm/nwfpe/fpopcode.h
index 8035f4faafbf..1777e92a88e6 100644
--- a/arch/arm/nwfpe/fpopcode.h
+++ b/arch/arm/nwfpe/fpopcode.h
@@ -370,20 +370,20 @@ TABLE 5
370#define getRoundingMode(opcode) ((opcode & MASK_ROUNDING_MODE) >> 5) 370#define getRoundingMode(opcode) ((opcode & MASK_ROUNDING_MODE) >> 5)
371 371
372#ifdef CONFIG_FPE_NWFPE_XP 372#ifdef CONFIG_FPE_NWFPE_XP
373static inline const floatx80 getExtendedConstant(const unsigned int nIndex) 373static inline __attribute_pure__ floatx80 getExtendedConstant(const unsigned int nIndex)
374{ 374{
375 extern const floatx80 floatx80Constant[]; 375 extern const floatx80 floatx80Constant[];
376 return floatx80Constant[nIndex]; 376 return floatx80Constant[nIndex];
377} 377}
378#endif 378#endif
379 379
380static inline const float64 getDoubleConstant(const unsigned int nIndex) 380static inline __attribute_pure__ float64 getDoubleConstant(const unsigned int nIndex)
381{ 381{
382 extern const float64 float64Constant[]; 382 extern const float64 float64Constant[];
383 return float64Constant[nIndex]; 383 return float64Constant[nIndex];
384} 384}
385 385
386static inline const float32 getSingleConstant(const unsigned int nIndex) 386static inline __attribute_pure__ float32 getSingleConstant(const unsigned int nIndex)
387{ 387{
388 extern const float32 float32Constant[]; 388 extern const float32 float32Constant[];
389 return float32Constant[nIndex]; 389 return float32Constant[nIndex];
diff --git a/arch/arm/nwfpe/single_cpdo.c b/arch/arm/nwfpe/single_cpdo.c
index 705808e88d9d..c66981d682cf 100644
--- a/arch/arm/nwfpe/single_cpdo.c
+++ b/arch/arm/nwfpe/single_cpdo.c
@@ -36,17 +36,17 @@ float32 float32_arccos(float32 rFm);
36float32 float32_pow(float32 rFn, float32 rFm); 36float32 float32_pow(float32 rFn, float32 rFm);
37float32 float32_pol(float32 rFn, float32 rFm); 37float32 float32_pol(float32 rFn, float32 rFm);
38 38
39static float32 float32_rsf(float32 rFn, float32 rFm) 39static float32 float32_rsf(struct roundingData *roundData, float32 rFn, float32 rFm)
40{ 40{
41 return float32_sub(rFm, rFn); 41 return float32_sub(roundData, rFm, rFn);
42} 42}
43 43
44static float32 float32_rdv(float32 rFn, float32 rFm) 44static float32 float32_rdv(struct roundingData *roundData, float32 rFn, float32 rFm)
45{ 45{
46 return float32_div(rFm, rFn); 46 return float32_div(roundData, rFm, rFn);
47} 47}
48 48
49static float32 (*const dyadic_single[16])(float32 rFn, float32 rFm) = { 49static float32 (*const dyadic_single[16])(struct roundingData *, float32 rFn, float32 rFm) = {
50 [ADF_CODE >> 20] = float32_add, 50 [ADF_CODE >> 20] = float32_add,
51 [MUF_CODE >> 20] = float32_mul, 51 [MUF_CODE >> 20] = float32_mul,
52 [SUF_CODE >> 20] = float32_sub, 52 [SUF_CODE >> 20] = float32_sub,
@@ -60,22 +60,22 @@ static float32 (*const dyadic_single[16])(float32 rFn, float32 rFm) = {
60 [FRD_CODE >> 20] = float32_rdv, 60 [FRD_CODE >> 20] = float32_rdv,
61}; 61};
62 62
63static float32 float32_mvf(float32 rFm) 63static float32 float32_mvf(struct roundingData *roundData, float32 rFm)
64{ 64{
65 return rFm; 65 return rFm;
66} 66}
67 67
68static float32 float32_mnf(float32 rFm) 68static float32 float32_mnf(struct roundingData *roundData, float32 rFm)
69{ 69{
70 return rFm ^ 0x80000000; 70 return rFm ^ 0x80000000;
71} 71}
72 72
73static float32 float32_abs(float32 rFm) 73static float32 float32_abs(struct roundingData *roundData, float32 rFm)
74{ 74{
75 return rFm & 0x7fffffff; 75 return rFm & 0x7fffffff;
76} 76}
77 77
78static float32 (*const monadic_single[16])(float32 rFm) = { 78static float32 (*const monadic_single[16])(struct roundingData*, float32 rFm) = {
79 [MVF_CODE >> 20] = float32_mvf, 79 [MVF_CODE >> 20] = float32_mvf,
80 [MNF_CODE >> 20] = float32_mnf, 80 [MNF_CODE >> 20] = float32_mnf,
81 [ABS_CODE >> 20] = float32_abs, 81 [ABS_CODE >> 20] = float32_abs,
@@ -85,7 +85,7 @@ static float32 (*const monadic_single[16])(float32 rFm) = {
85 [NRM_CODE >> 20] = float32_mvf, 85 [NRM_CODE >> 20] = float32_mvf,
86}; 86};
87 87
88unsigned int SingleCPDO(const unsigned int opcode, FPREG * rFd) 88unsigned int SingleCPDO(struct roundingData *roundData, const unsigned int opcode, FPREG * rFd)
89{ 89{
90 FPA11 *fpa11 = GET_FPA11(); 90 FPA11 *fpa11 = GET_FPA11();
91 float32 rFm; 91 float32 rFm;
@@ -108,13 +108,13 @@ unsigned int SingleCPDO(const unsigned int opcode, FPREG * rFd)
108 if (fpa11->fType[Fn] == typeSingle && 108 if (fpa11->fType[Fn] == typeSingle &&
109 dyadic_single[opc_mask_shift]) { 109 dyadic_single[opc_mask_shift]) {
110 rFn = fpa11->fpreg[Fn].fSingle; 110 rFn = fpa11->fpreg[Fn].fSingle;
111 rFd->fSingle = dyadic_single[opc_mask_shift](rFn, rFm); 111 rFd->fSingle = dyadic_single[opc_mask_shift](roundData, rFn, rFm);
112 } else { 112 } else {
113 return 0; 113 return 0;
114 } 114 }
115 } else { 115 } else {
116 if (monadic_single[opc_mask_shift]) { 116 if (monadic_single[opc_mask_shift]) {
117 rFd->fSingle = monadic_single[opc_mask_shift](rFm); 117 rFd->fSingle = monadic_single[opc_mask_shift](roundData, rFm);
118 } else { 118 } else {
119 return 0; 119 return 0;
120 } 120 }
diff --git a/arch/arm/nwfpe/softfloat.c b/arch/arm/nwfpe/softfloat.c
index e038dd3be9b3..f9f049132a17 100644
--- a/arch/arm/nwfpe/softfloat.c
+++ b/arch/arm/nwfpe/softfloat.c
@@ -36,16 +36,6 @@ this code that are retained.
36 36
37/* 37/*
38------------------------------------------------------------------------------- 38-------------------------------------------------------------------------------
39Floating-point rounding mode, extended double-precision rounding precision,
40and exception flags.
41-------------------------------------------------------------------------------
42*/
43int8 float_rounding_mode = float_round_nearest_even;
44int8 floatx80_rounding_precision = 80;
45int8 float_exception_flags;
46
47/*
48-------------------------------------------------------------------------------
49Primitive arithmetic functions, including multi-word arithmetic, and 39Primitive arithmetic functions, including multi-word arithmetic, and
50division and square root approximations. (Can be specialized to target if 40division and square root approximations. (Can be specialized to target if
51desired.) 41desired.)
@@ -77,14 +67,14 @@ input is too large, however, the invalid exception is raised and the largest
77positive or negative integer is returned. 67positive or negative integer is returned.
78------------------------------------------------------------------------------- 68-------------------------------------------------------------------------------
79*/ 69*/
80static int32 roundAndPackInt32( flag zSign, bits64 absZ ) 70static int32 roundAndPackInt32( struct roundingData *roundData, flag zSign, bits64 absZ )
81{ 71{
82 int8 roundingMode; 72 int8 roundingMode;
83 flag roundNearestEven; 73 flag roundNearestEven;
84 int8 roundIncrement, roundBits; 74 int8 roundIncrement, roundBits;
85 int32 z; 75 int32 z;
86 76
87 roundingMode = float_rounding_mode; 77 roundingMode = roundData->mode;
88 roundNearestEven = ( roundingMode == float_round_nearest_even ); 78 roundNearestEven = ( roundingMode == float_round_nearest_even );
89 roundIncrement = 0x40; 79 roundIncrement = 0x40;
90 if ( ! roundNearestEven ) { 80 if ( ! roundNearestEven ) {
@@ -107,10 +97,10 @@ static int32 roundAndPackInt32( flag zSign, bits64 absZ )
107 z = absZ; 97 z = absZ;
108 if ( zSign ) z = - z; 98 if ( zSign ) z = - z;
109 if ( ( absZ>>32 ) || ( z && ( ( z < 0 ) ^ zSign ) ) ) { 99 if ( ( absZ>>32 ) || ( z && ( ( z < 0 ) ^ zSign ) ) ) {
110 float_exception_flags |= float_flag_invalid; 100 roundData->exception |= float_flag_invalid;
111 return zSign ? 0x80000000 : 0x7FFFFFFF; 101 return zSign ? 0x80000000 : 0x7FFFFFFF;
112 } 102 }
113 if ( roundBits ) float_exception_flags |= float_flag_inexact; 103 if ( roundBits ) roundData->exception |= float_flag_inexact;
114 return z; 104 return z;
115 105
116} 106}
@@ -224,14 +214,14 @@ The handling of underflow and overflow follows the IEC/IEEE Standard for
224Binary Floating-point Arithmetic. 214Binary Floating-point Arithmetic.
225------------------------------------------------------------------------------- 215-------------------------------------------------------------------------------
226*/ 216*/
227static float32 roundAndPackFloat32( flag zSign, int16 zExp, bits32 zSig ) 217static float32 roundAndPackFloat32( struct roundingData *roundData, flag zSign, int16 zExp, bits32 zSig )
228{ 218{
229 int8 roundingMode; 219 int8 roundingMode;
230 flag roundNearestEven; 220 flag roundNearestEven;
231 int8 roundIncrement, roundBits; 221 int8 roundIncrement, roundBits;
232 flag isTiny; 222 flag isTiny;
233 223
234 roundingMode = float_rounding_mode; 224 roundingMode = roundData->mode;
235 roundNearestEven = ( roundingMode == float_round_nearest_even ); 225 roundNearestEven = ( roundingMode == float_round_nearest_even );
236 roundIncrement = 0x40; 226 roundIncrement = 0x40;
237 if ( ! roundNearestEven ) { 227 if ( ! roundNearestEven ) {
@@ -254,7 +244,7 @@ static float32 roundAndPackFloat32( flag zSign, int16 zExp, bits32 zSig )
254 || ( ( zExp == 0xFD ) 244 || ( ( zExp == 0xFD )
255 && ( (sbits32) ( zSig + roundIncrement ) < 0 ) ) 245 && ( (sbits32) ( zSig + roundIncrement ) < 0 ) )
256 ) { 246 ) {
257 float_raise( float_flag_overflow | float_flag_inexact ); 247 roundData->exception |= float_flag_overflow | float_flag_inexact;
258 return packFloat32( zSign, 0xFF, 0 ) - ( roundIncrement == 0 ); 248 return packFloat32( zSign, 0xFF, 0 ) - ( roundIncrement == 0 );
259 } 249 }
260 if ( zExp < 0 ) { 250 if ( zExp < 0 ) {
@@ -265,10 +255,10 @@ static float32 roundAndPackFloat32( flag zSign, int16 zExp, bits32 zSig )
265 shift32RightJamming( zSig, - zExp, &zSig ); 255 shift32RightJamming( zSig, - zExp, &zSig );
266 zExp = 0; 256 zExp = 0;
267 roundBits = zSig & 0x7F; 257 roundBits = zSig & 0x7F;
268 if ( isTiny && roundBits ) float_raise( float_flag_underflow ); 258 if ( isTiny && roundBits ) roundData->exception |= float_flag_underflow;
269 } 259 }
270 } 260 }
271 if ( roundBits ) float_exception_flags |= float_flag_inexact; 261 if ( roundBits ) roundData->exception |= float_flag_inexact;
272 zSig = ( zSig + roundIncrement )>>7; 262 zSig = ( zSig + roundIncrement )>>7;
273 zSig &= ~ ( ( ( roundBits ^ 0x40 ) == 0 ) & roundNearestEven ); 263 zSig &= ~ ( ( ( roundBits ^ 0x40 ) == 0 ) & roundNearestEven );
274 if ( zSig == 0 ) zExp = 0; 264 if ( zSig == 0 ) zExp = 0;
@@ -287,12 +277,12 @@ point exponent.
287------------------------------------------------------------------------------- 277-------------------------------------------------------------------------------
288*/ 278*/
289static float32 279static float32
290 normalizeRoundAndPackFloat32( flag zSign, int16 zExp, bits32 zSig ) 280 normalizeRoundAndPackFloat32( struct roundingData *roundData, flag zSign, int16 zExp, bits32 zSig )
291{ 281{
292 int8 shiftCount; 282 int8 shiftCount;
293 283
294 shiftCount = countLeadingZeros32( zSig ) - 1; 284 shiftCount = countLeadingZeros32( zSig ) - 1;
295 return roundAndPackFloat32( zSign, zExp - shiftCount, zSig<<shiftCount ); 285 return roundAndPackFloat32( roundData, zSign, zExp - shiftCount, zSig<<shiftCount );
296 286
297} 287}
298 288
@@ -395,14 +385,14 @@ The handling of underflow and overflow follows the IEC/IEEE Standard for
395Binary Floating-point Arithmetic. 385Binary Floating-point Arithmetic.
396------------------------------------------------------------------------------- 386-------------------------------------------------------------------------------
397*/ 387*/
398static float64 roundAndPackFloat64( flag zSign, int16 zExp, bits64 zSig ) 388static float64 roundAndPackFloat64( struct roundingData *roundData, flag zSign, int16 zExp, bits64 zSig )
399{ 389{
400 int8 roundingMode; 390 int8 roundingMode;
401 flag roundNearestEven; 391 flag roundNearestEven;
402 int16 roundIncrement, roundBits; 392 int16 roundIncrement, roundBits;
403 flag isTiny; 393 flag isTiny;
404 394
405 roundingMode = float_rounding_mode; 395 roundingMode = roundData->mode;
406 roundNearestEven = ( roundingMode == float_round_nearest_even ); 396 roundNearestEven = ( roundingMode == float_round_nearest_even );
407 roundIncrement = 0x200; 397 roundIncrement = 0x200;
408 if ( ! roundNearestEven ) { 398 if ( ! roundNearestEven ) {
@@ -427,7 +417,7 @@ static float64 roundAndPackFloat64( flag zSign, int16 zExp, bits64 zSig )
427 ) { 417 ) {
428 //register int lr = __builtin_return_address(0); 418 //register int lr = __builtin_return_address(0);
429 //printk("roundAndPackFloat64 called from 0x%08x\n",lr); 419 //printk("roundAndPackFloat64 called from 0x%08x\n",lr);
430 float_raise( float_flag_overflow | float_flag_inexact ); 420 roundData->exception |= float_flag_overflow | float_flag_inexact;
431 return packFloat64( zSign, 0x7FF, 0 ) - ( roundIncrement == 0 ); 421 return packFloat64( zSign, 0x7FF, 0 ) - ( roundIncrement == 0 );
432 } 422 }
433 if ( zExp < 0 ) { 423 if ( zExp < 0 ) {
@@ -438,10 +428,10 @@ static float64 roundAndPackFloat64( flag zSign, int16 zExp, bits64 zSig )
438 shift64RightJamming( zSig, - zExp, &zSig ); 428 shift64RightJamming( zSig, - zExp, &zSig );
439 zExp = 0; 429 zExp = 0;
440 roundBits = zSig & 0x3FF; 430 roundBits = zSig & 0x3FF;
441 if ( isTiny && roundBits ) float_raise( float_flag_underflow ); 431 if ( isTiny && roundBits ) roundData->exception |= float_flag_underflow;
442 } 432 }
443 } 433 }
444 if ( roundBits ) float_exception_flags |= float_flag_inexact; 434 if ( roundBits ) roundData->exception |= float_flag_inexact;
445 zSig = ( zSig + roundIncrement )>>10; 435 zSig = ( zSig + roundIncrement )>>10;
446 zSig &= ~ ( ( ( roundBits ^ 0x200 ) == 0 ) & roundNearestEven ); 436 zSig &= ~ ( ( ( roundBits ^ 0x200 ) == 0 ) & roundNearestEven );
447 if ( zSig == 0 ) zExp = 0; 437 if ( zSig == 0 ) zExp = 0;
@@ -460,12 +450,12 @@ point exponent.
460------------------------------------------------------------------------------- 450-------------------------------------------------------------------------------
461*/ 451*/
462static float64 452static float64
463 normalizeRoundAndPackFloat64( flag zSign, int16 zExp, bits64 zSig ) 453 normalizeRoundAndPackFloat64( struct roundingData *roundData, flag zSign, int16 zExp, bits64 zSig )
464{ 454{
465 int8 shiftCount; 455 int8 shiftCount;
466 456
467 shiftCount = countLeadingZeros64( zSig ) - 1; 457 shiftCount = countLeadingZeros64( zSig ) - 1;
468 return roundAndPackFloat64( zSign, zExp - shiftCount, zSig<<shiftCount ); 458 return roundAndPackFloat64( roundData, zSign, zExp - shiftCount, zSig<<shiftCount );
469 459
470} 460}
471 461
@@ -572,14 +562,15 @@ Floating-point Arithmetic.
572*/ 562*/
573static floatx80 563static floatx80
574 roundAndPackFloatx80( 564 roundAndPackFloatx80(
575 int8 roundingPrecision, flag zSign, int32 zExp, bits64 zSig0, bits64 zSig1 565 struct roundingData *roundData, flag zSign, int32 zExp, bits64 zSig0, bits64 zSig1
576 ) 566 )
577{ 567{
578 int8 roundingMode; 568 int8 roundingMode, roundingPrecision;
579 flag roundNearestEven, increment, isTiny; 569 flag roundNearestEven, increment, isTiny;
580 int64 roundIncrement, roundMask, roundBits; 570 int64 roundIncrement, roundMask, roundBits;
581 571
582 roundingMode = float_rounding_mode; 572 roundingMode = roundData->mode;
573 roundingPrecision = roundData->precision;
583 roundNearestEven = ( roundingMode == float_round_nearest_even ); 574 roundNearestEven = ( roundingMode == float_round_nearest_even );
584 if ( roundingPrecision == 80 ) goto precision80; 575 if ( roundingPrecision == 80 ) goto precision80;
585 if ( roundingPrecision == 64 ) { 576 if ( roundingPrecision == 64 ) {
@@ -623,8 +614,8 @@ static floatx80
623 shift64RightJamming( zSig0, 1 - zExp, &zSig0 ); 614 shift64RightJamming( zSig0, 1 - zExp, &zSig0 );
624 zExp = 0; 615 zExp = 0;
625 roundBits = zSig0 & roundMask; 616 roundBits = zSig0 & roundMask;
626 if ( isTiny && roundBits ) float_raise( float_flag_underflow ); 617 if ( isTiny && roundBits ) roundData->exception |= float_flag_underflow;
627 if ( roundBits ) float_exception_flags |= float_flag_inexact; 618 if ( roundBits ) roundData->exception |= float_flag_inexact;
628 zSig0 += roundIncrement; 619 zSig0 += roundIncrement;
629 if ( (sbits64) zSig0 < 0 ) zExp = 1; 620 if ( (sbits64) zSig0 < 0 ) zExp = 1;
630 roundIncrement = roundMask + 1; 621 roundIncrement = roundMask + 1;
@@ -635,7 +626,7 @@ static floatx80
635 return packFloatx80( zSign, zExp, zSig0 ); 626 return packFloatx80( zSign, zExp, zSig0 );
636 } 627 }
637 } 628 }
638 if ( roundBits ) float_exception_flags |= float_flag_inexact; 629 if ( roundBits ) roundData->exception |= float_flag_inexact;
639 zSig0 += roundIncrement; 630 zSig0 += roundIncrement;
640 if ( zSig0 < roundIncrement ) { 631 if ( zSig0 < roundIncrement ) {
641 ++zExp; 632 ++zExp;
@@ -672,7 +663,7 @@ static floatx80
672 ) { 663 ) {
673 roundMask = 0; 664 roundMask = 0;
674 overflow: 665 overflow:
675 float_raise( float_flag_overflow | float_flag_inexact ); 666 roundData->exception |= float_flag_overflow | float_flag_inexact;
676 if ( ( roundingMode == float_round_to_zero ) 667 if ( ( roundingMode == float_round_to_zero )
677 || ( zSign && ( roundingMode == float_round_up ) ) 668 || ( zSign && ( roundingMode == float_round_up ) )
678 || ( ! zSign && ( roundingMode == float_round_down ) ) 669 || ( ! zSign && ( roundingMode == float_round_down ) )
@@ -689,8 +680,8 @@ static floatx80
689 || ( zSig0 < LIT64( 0xFFFFFFFFFFFFFFFF ) ); 680 || ( zSig0 < LIT64( 0xFFFFFFFFFFFFFFFF ) );
690 shift64ExtraRightJamming( zSig0, zSig1, 1 - zExp, &zSig0, &zSig1 ); 681 shift64ExtraRightJamming( zSig0, zSig1, 1 - zExp, &zSig0, &zSig1 );
691 zExp = 0; 682 zExp = 0;
692 if ( isTiny && zSig1 ) float_raise( float_flag_underflow ); 683 if ( isTiny && zSig1 ) roundData->exception |= float_flag_underflow;
693 if ( zSig1 ) float_exception_flags |= float_flag_inexact; 684 if ( zSig1 ) roundData->exception |= float_flag_inexact;
694 if ( roundNearestEven ) { 685 if ( roundNearestEven ) {
695 increment = ( (sbits64) zSig1 < 0 ); 686 increment = ( (sbits64) zSig1 < 0 );
696 } 687 }
@@ -710,7 +701,7 @@ static floatx80
710 return packFloatx80( zSign, zExp, zSig0 ); 701 return packFloatx80( zSign, zExp, zSig0 );
711 } 702 }
712 } 703 }
713 if ( zSig1 ) float_exception_flags |= float_flag_inexact; 704 if ( zSig1 ) roundData->exception |= float_flag_inexact;
714 if ( increment ) { 705 if ( increment ) {
715 ++zSig0; 706 ++zSig0;
716 if ( zSig0 == 0 ) { 707 if ( zSig0 == 0 ) {
@@ -740,7 +731,7 @@ normalized.
740*/ 731*/
741static floatx80 732static floatx80
742 normalizeRoundAndPackFloatx80( 733 normalizeRoundAndPackFloatx80(
743 int8 roundingPrecision, flag zSign, int32 zExp, bits64 zSig0, bits64 zSig1 734 struct roundingData *roundData, flag zSign, int32 zExp, bits64 zSig0, bits64 zSig1
744 ) 735 )
745{ 736{
746 int8 shiftCount; 737 int8 shiftCount;
@@ -754,7 +745,7 @@ static floatx80
754 shortShift128Left( zSig0, zSig1, shiftCount, &zSig0, &zSig1 ); 745 shortShift128Left( zSig0, zSig1, shiftCount, &zSig0, &zSig1 );
755 zExp -= shiftCount; 746 zExp -= shiftCount;
756 return 747 return
757 roundAndPackFloatx80( roundingPrecision, zSign, zExp, zSig0, zSig1 ); 748 roundAndPackFloatx80( roundData, zSign, zExp, zSig0, zSig1 );
758 749
759} 750}
760 751
@@ -767,14 +758,14 @@ the single-precision floating-point format. The conversion is performed
767according to the IEC/IEEE Standard for Binary Floating-point Arithmetic. 758according to the IEC/IEEE Standard for Binary Floating-point Arithmetic.
768------------------------------------------------------------------------------- 759-------------------------------------------------------------------------------
769*/ 760*/
770float32 int32_to_float32( int32 a ) 761float32 int32_to_float32(struct roundingData *roundData, int32 a)
771{ 762{
772 flag zSign; 763 flag zSign;
773 764
774 if ( a == 0 ) return 0; 765 if ( a == 0 ) return 0;
775 if ( a == 0x80000000 ) return packFloat32( 1, 0x9E, 0 ); 766 if ( a == 0x80000000 ) return packFloat32( 1, 0x9E, 0 );
776 zSign = ( a < 0 ); 767 zSign = ( a < 0 );
777 return normalizeRoundAndPackFloat32( zSign, 0x9C, zSign ? - a : a ); 768 return normalizeRoundAndPackFloat32( roundData, zSign, 0x9C, zSign ? - a : a );
778 769
779} 770}
780 771
@@ -840,7 +831,7 @@ positive integer is returned. Otherwise, if the conversion overflows, the
840largest integer with the same sign as `a' is returned. 831largest integer with the same sign as `a' is returned.
841------------------------------------------------------------------------------- 832-------------------------------------------------------------------------------
842*/ 833*/
843int32 float32_to_int32( float32 a ) 834int32 float32_to_int32( struct roundingData *roundData, float32 a )
844{ 835{
845 flag aSign; 836 flag aSign;
846 int16 aExp, shiftCount; 837 int16 aExp, shiftCount;
@@ -856,7 +847,7 @@ int32 float32_to_int32( float32 a )
856 zSig = aSig; 847 zSig = aSig;
857 zSig <<= 32; 848 zSig <<= 32;
858 if ( 0 < shiftCount ) shift64RightJamming( zSig, shiftCount, &zSig ); 849 if ( 0 < shiftCount ) shift64RightJamming( zSig, shiftCount, &zSig );
859 return roundAndPackInt32( aSign, zSig ); 850 return roundAndPackInt32( roundData, aSign, zSig );
860 851
861} 852}
862 853
@@ -889,13 +880,13 @@ int32 float32_to_int32_round_to_zero( float32 a )
889 return 0x80000000; 880 return 0x80000000;
890 } 881 }
891 else if ( aExp <= 0x7E ) { 882 else if ( aExp <= 0x7E ) {
892 if ( aExp | aSig ) float_exception_flags |= float_flag_inexact; 883 if ( aExp | aSig ) float_raise( float_flag_inexact );
893 return 0; 884 return 0;
894 } 885 }
895 aSig = ( aSig | 0x00800000 )<<8; 886 aSig = ( aSig | 0x00800000 )<<8;
896 z = aSig>>( - shiftCount ); 887 z = aSig>>( - shiftCount );
897 if ( (bits32) ( aSig<<( shiftCount & 31 ) ) ) { 888 if ( (bits32) ( aSig<<( shiftCount & 31 ) ) ) {
898 float_exception_flags |= float_flag_inexact; 889 float_raise( float_flag_inexact );
899 } 890 }
900 return aSign ? - z : z; 891 return aSign ? - z : z;
901 892
@@ -973,7 +964,7 @@ operation is performed according to the IEC/IEEE Standard for Binary
973Floating-point Arithmetic. 964Floating-point Arithmetic.
974------------------------------------------------------------------------------- 965-------------------------------------------------------------------------------
975*/ 966*/
976float32 float32_round_to_int( float32 a ) 967float32 float32_round_to_int( struct roundingData *roundData, float32 a )
977{ 968{
978 flag aSign; 969 flag aSign;
979 int16 aExp; 970 int16 aExp;
@@ -988,11 +979,12 @@ float32 float32_round_to_int( float32 a )
988 } 979 }
989 return a; 980 return a;
990 } 981 }
982 roundingMode = roundData->mode;
991 if ( aExp <= 0x7E ) { 983 if ( aExp <= 0x7E ) {
992 if ( (bits32) ( a<<1 ) == 0 ) return a; 984 if ( (bits32) ( a<<1 ) == 0 ) return a;
993 float_exception_flags |= float_flag_inexact; 985 roundData->exception |= float_flag_inexact;
994 aSign = extractFloat32Sign( a ); 986 aSign = extractFloat32Sign( a );
995 switch ( float_rounding_mode ) { 987 switch ( roundingMode ) {
996 case float_round_nearest_even: 988 case float_round_nearest_even:
997 if ( ( aExp == 0x7E ) && extractFloat32Frac( a ) ) { 989 if ( ( aExp == 0x7E ) && extractFloat32Frac( a ) ) {
998 return packFloat32( aSign, 0x7F, 0 ); 990 return packFloat32( aSign, 0x7F, 0 );
@@ -1009,7 +1001,6 @@ float32 float32_round_to_int( float32 a )
1009 lastBitMask <<= 0x96 - aExp; 1001 lastBitMask <<= 0x96 - aExp;
1010 roundBitsMask = lastBitMask - 1; 1002 roundBitsMask = lastBitMask - 1;
1011 z = a; 1003 z = a;
1012 roundingMode = float_rounding_mode;
1013 if ( roundingMode == float_round_nearest_even ) { 1004 if ( roundingMode == float_round_nearest_even ) {
1014 z += lastBitMask>>1; 1005 z += lastBitMask>>1;
1015 if ( ( z & roundBitsMask ) == 0 ) z &= ~ lastBitMask; 1006 if ( ( z & roundBitsMask ) == 0 ) z &= ~ lastBitMask;
@@ -1020,7 +1011,7 @@ float32 float32_round_to_int( float32 a )
1020 } 1011 }
1021 } 1012 }
1022 z &= ~ roundBitsMask; 1013 z &= ~ roundBitsMask;
1023 if ( z != a ) float_exception_flags |= float_flag_inexact; 1014 if ( z != a ) roundData->exception |= float_flag_inexact;
1024 return z; 1015 return z;
1025 1016
1026} 1017}
@@ -1034,7 +1025,7 @@ addition is performed according to the IEC/IEEE Standard for Binary
1034Floating-point Arithmetic. 1025Floating-point Arithmetic.
1035------------------------------------------------------------------------------- 1026-------------------------------------------------------------------------------
1036*/ 1027*/
1037static float32 addFloat32Sigs( float32 a, float32 b, flag zSign ) 1028static float32 addFloat32Sigs( struct roundingData *roundData, float32 a, float32 b, flag zSign )
1038{ 1029{
1039 int16 aExp, bExp, zExp; 1030 int16 aExp, bExp, zExp;
1040 bits32 aSig, bSig, zSig; 1031 bits32 aSig, bSig, zSig;
@@ -1093,7 +1084,7 @@ static float32 addFloat32Sigs( float32 a, float32 b, flag zSign )
1093 ++zExp; 1084 ++zExp;
1094 } 1085 }
1095 roundAndPack: 1086 roundAndPack:
1096 return roundAndPackFloat32( zSign, zExp, zSig ); 1087 return roundAndPackFloat32( roundData, zSign, zExp, zSig );
1097 1088
1098} 1089}
1099 1090
@@ -1106,7 +1097,7 @@ result is a NaN. The subtraction is performed according to the IEC/IEEE
1106Standard for Binary Floating-point Arithmetic. 1097Standard for Binary Floating-point Arithmetic.
1107------------------------------------------------------------------------------- 1098-------------------------------------------------------------------------------
1108*/ 1099*/
1109static float32 subFloat32Sigs( float32 a, float32 b, flag zSign ) 1100static float32 subFloat32Sigs( struct roundingData *roundData, float32 a, float32 b, flag zSign )
1110{ 1101{
1111 int16 aExp, bExp, zExp; 1102 int16 aExp, bExp, zExp;
1112 bits32 aSig, bSig, zSig; 1103 bits32 aSig, bSig, zSig;
@@ -1123,7 +1114,7 @@ static float32 subFloat32Sigs( float32 a, float32 b, flag zSign )
1123 if ( expDiff < 0 ) goto bExpBigger; 1114 if ( expDiff < 0 ) goto bExpBigger;
1124 if ( aExp == 0xFF ) { 1115 if ( aExp == 0xFF ) {
1125 if ( aSig | bSig ) return propagateFloat32NaN( a, b ); 1116 if ( aSig | bSig ) return propagateFloat32NaN( a, b );
1126 float_raise( float_flag_invalid ); 1117 roundData->exception |= float_flag_invalid;
1127 return float32_default_nan; 1118 return float32_default_nan;
1128 } 1119 }
1129 if ( aExp == 0 ) { 1120 if ( aExp == 0 ) {
@@ -1132,7 +1123,7 @@ static float32 subFloat32Sigs( float32 a, float32 b, flag zSign )
1132 } 1123 }
1133 if ( bSig < aSig ) goto aBigger; 1124 if ( bSig < aSig ) goto aBigger;
1134 if ( aSig < bSig ) goto bBigger; 1125 if ( aSig < bSig ) goto bBigger;
1135 return packFloat32( float_rounding_mode == float_round_down, 0, 0 ); 1126 return packFloat32( roundData->mode == float_round_down, 0, 0 );
1136 bExpBigger: 1127 bExpBigger:
1137 if ( bExp == 0xFF ) { 1128 if ( bExp == 0xFF ) {
1138 if ( bSig ) return propagateFloat32NaN( a, b ); 1129 if ( bSig ) return propagateFloat32NaN( a, b );
@@ -1169,7 +1160,7 @@ static float32 subFloat32Sigs( float32 a, float32 b, flag zSign )
1169 zExp = aExp; 1160 zExp = aExp;
1170 normalizeRoundAndPack: 1161 normalizeRoundAndPack:
1171 --zExp; 1162 --zExp;
1172 return normalizeRoundAndPackFloat32( zSign, zExp, zSig ); 1163 return normalizeRoundAndPackFloat32( roundData, zSign, zExp, zSig );
1173 1164
1174} 1165}
1175 1166
@@ -1180,17 +1171,17 @@ and `b'. The operation is performed according to the IEC/IEEE Standard for
1180Binary Floating-point Arithmetic. 1171Binary Floating-point Arithmetic.
1181------------------------------------------------------------------------------- 1172-------------------------------------------------------------------------------
1182*/ 1173*/
1183float32 float32_add( float32 a, float32 b ) 1174float32 float32_add( struct roundingData *roundData, float32 a, float32 b )
1184{ 1175{
1185 flag aSign, bSign; 1176 flag aSign, bSign;
1186 1177
1187 aSign = extractFloat32Sign( a ); 1178 aSign = extractFloat32Sign( a );
1188 bSign = extractFloat32Sign( b ); 1179 bSign = extractFloat32Sign( b );
1189 if ( aSign == bSign ) { 1180 if ( aSign == bSign ) {
1190 return addFloat32Sigs( a, b, aSign ); 1181 return addFloat32Sigs( roundData, a, b, aSign );
1191 } 1182 }
1192 else { 1183 else {
1193 return subFloat32Sigs( a, b, aSign ); 1184 return subFloat32Sigs( roundData, a, b, aSign );
1194 } 1185 }
1195 1186
1196} 1187}
@@ -1202,17 +1193,17 @@ Returns the result of subtracting the single-precision floating-point values
1202for Binary Floating-point Arithmetic. 1193for Binary Floating-point Arithmetic.
1203------------------------------------------------------------------------------- 1194-------------------------------------------------------------------------------
1204*/ 1195*/
1205float32 float32_sub( float32 a, float32 b ) 1196float32 float32_sub( struct roundingData *roundData, float32 a, float32 b )
1206{ 1197{
1207 flag aSign, bSign; 1198 flag aSign, bSign;
1208 1199
1209 aSign = extractFloat32Sign( a ); 1200 aSign = extractFloat32Sign( a );
1210 bSign = extractFloat32Sign( b ); 1201 bSign = extractFloat32Sign( b );
1211 if ( aSign == bSign ) { 1202 if ( aSign == bSign ) {
1212 return subFloat32Sigs( a, b, aSign ); 1203 return subFloat32Sigs( roundData, a, b, aSign );
1213 } 1204 }
1214 else { 1205 else {
1215 return addFloat32Sigs( a, b, aSign ); 1206 return addFloat32Sigs( roundData, a, b, aSign );
1216 } 1207 }
1217 1208
1218} 1209}
@@ -1224,7 +1215,7 @@ Returns the result of multiplying the single-precision floating-point values
1224for Binary Floating-point Arithmetic. 1215for Binary Floating-point Arithmetic.
1225------------------------------------------------------------------------------- 1216-------------------------------------------------------------------------------
1226*/ 1217*/
1227float32 float32_mul( float32 a, float32 b ) 1218float32 float32_mul( struct roundingData *roundData, float32 a, float32 b )
1228{ 1219{
1229 flag aSign, bSign, zSign; 1220 flag aSign, bSign, zSign;
1230 int16 aExp, bExp, zExp; 1221 int16 aExp, bExp, zExp;
@@ -1244,7 +1235,7 @@ float32 float32_mul( float32 a, float32 b )
1244 return propagateFloat32NaN( a, b ); 1235 return propagateFloat32NaN( a, b );
1245 } 1236 }
1246 if ( ( bExp | bSig ) == 0 ) { 1237 if ( ( bExp | bSig ) == 0 ) {
1247 float_raise( float_flag_invalid ); 1238 roundData->exception |= float_flag_invalid;
1248 return float32_default_nan; 1239 return float32_default_nan;
1249 } 1240 }
1250 return packFloat32( zSign, 0xFF, 0 ); 1241 return packFloat32( zSign, 0xFF, 0 );
@@ -1252,7 +1243,7 @@ float32 float32_mul( float32 a, float32 b )
1252 if ( bExp == 0xFF ) { 1243 if ( bExp == 0xFF ) {
1253 if ( bSig ) return propagateFloat32NaN( a, b ); 1244 if ( bSig ) return propagateFloat32NaN( a, b );
1254 if ( ( aExp | aSig ) == 0 ) { 1245 if ( ( aExp | aSig ) == 0 ) {
1255 float_raise( float_flag_invalid ); 1246 roundData->exception |= float_flag_invalid;
1256 return float32_default_nan; 1247 return float32_default_nan;
1257 } 1248 }
1258 return packFloat32( zSign, 0xFF, 0 ); 1249 return packFloat32( zSign, 0xFF, 0 );
@@ -1274,7 +1265,7 @@ float32 float32_mul( float32 a, float32 b )
1274 zSig <<= 1; 1265 zSig <<= 1;
1275 --zExp; 1266 --zExp;
1276 } 1267 }
1277 return roundAndPackFloat32( zSign, zExp, zSig ); 1268 return roundAndPackFloat32( roundData, zSign, zExp, zSig );
1278 1269
1279} 1270}
1280 1271
@@ -1285,7 +1276,7 @@ by the corresponding value `b'. The operation is performed according to the
1285IEC/IEEE Standard for Binary Floating-point Arithmetic. 1276IEC/IEEE Standard for Binary Floating-point Arithmetic.
1286------------------------------------------------------------------------------- 1277-------------------------------------------------------------------------------
1287*/ 1278*/
1288float32 float32_div( float32 a, float32 b ) 1279float32 float32_div( struct roundingData *roundData, float32 a, float32 b )
1289{ 1280{
1290 flag aSign, bSign, zSign; 1281 flag aSign, bSign, zSign;
1291 int16 aExp, bExp, zExp; 1282 int16 aExp, bExp, zExp;
@@ -1302,7 +1293,7 @@ float32 float32_div( float32 a, float32 b )
1302 if ( aSig ) return propagateFloat32NaN( a, b ); 1293 if ( aSig ) return propagateFloat32NaN( a, b );
1303 if ( bExp == 0xFF ) { 1294 if ( bExp == 0xFF ) {
1304 if ( bSig ) return propagateFloat32NaN( a, b ); 1295 if ( bSig ) return propagateFloat32NaN( a, b );
1305 float_raise( float_flag_invalid ); 1296 roundData->exception |= float_flag_invalid;
1306 return float32_default_nan; 1297 return float32_default_nan;
1307 } 1298 }
1308 return packFloat32( zSign, 0xFF, 0 ); 1299 return packFloat32( zSign, 0xFF, 0 );
@@ -1314,10 +1305,10 @@ float32 float32_div( float32 a, float32 b )
1314 if ( bExp == 0 ) { 1305 if ( bExp == 0 ) {
1315 if ( bSig == 0 ) { 1306 if ( bSig == 0 ) {
1316 if ( ( aExp | aSig ) == 0 ) { 1307 if ( ( aExp | aSig ) == 0 ) {
1317 float_raise( float_flag_invalid ); 1308 roundData->exception |= float_flag_invalid;
1318 return float32_default_nan; 1309 return float32_default_nan;
1319 } 1310 }
1320 float_raise( float_flag_divbyzero ); 1311 roundData->exception |= float_flag_divbyzero;
1321 return packFloat32( zSign, 0xFF, 0 ); 1312 return packFloat32( zSign, 0xFF, 0 );
1322 } 1313 }
1323 normalizeFloat32Subnormal( bSig, &bExp, &bSig ); 1314 normalizeFloat32Subnormal( bSig, &bExp, &bSig );
@@ -1341,7 +1332,7 @@ float32 float32_div( float32 a, float32 b )
1341 if ( ( zSig & 0x3F ) == 0 ) { 1332 if ( ( zSig & 0x3F ) == 0 ) {
1342 zSig |= ( ( (bits64) bSig ) * zSig != ( (bits64) aSig )<<32 ); 1333 zSig |= ( ( (bits64) bSig ) * zSig != ( (bits64) aSig )<<32 );
1343 } 1334 }
1344 return roundAndPackFloat32( zSign, zExp, zSig ); 1335 return roundAndPackFloat32( roundData, zSign, zExp, zSig );
1345 1336
1346} 1337}
1347 1338
@@ -1352,7 +1343,7 @@ with respect to the corresponding value `b'. The operation is performed
1352according to the IEC/IEEE Standard for Binary Floating-point Arithmetic. 1343according to the IEC/IEEE Standard for Binary Floating-point Arithmetic.
1353------------------------------------------------------------------------------- 1344-------------------------------------------------------------------------------
1354*/ 1345*/
1355float32 float32_rem( float32 a, float32 b ) 1346float32 float32_rem( struct roundingData *roundData, float32 a, float32 b )
1356{ 1347{
1357 flag aSign, bSign, zSign; 1348 flag aSign, bSign, zSign;
1358 int16 aExp, bExp, expDiff; 1349 int16 aExp, bExp, expDiff;
@@ -1372,7 +1363,7 @@ float32 float32_rem( float32 a, float32 b )
1372 if ( aSig || ( ( bExp == 0xFF ) && bSig ) ) { 1363 if ( aSig || ( ( bExp == 0xFF ) && bSig ) ) {
1373 return propagateFloat32NaN( a, b ); 1364 return propagateFloat32NaN( a, b );
1374 } 1365 }
1375 float_raise( float_flag_invalid ); 1366 roundData->exception |= float_flag_invalid;
1376 return float32_default_nan; 1367 return float32_default_nan;
1377 } 1368 }
1378 if ( bExp == 0xFF ) { 1369 if ( bExp == 0xFF ) {
@@ -1381,7 +1372,7 @@ float32 float32_rem( float32 a, float32 b )
1381 } 1372 }
1382 if ( bExp == 0 ) { 1373 if ( bExp == 0 ) {
1383 if ( bSig == 0 ) { 1374 if ( bSig == 0 ) {
1384 float_raise( float_flag_invalid ); 1375 roundData->exception |= float_flag_invalid;
1385 return float32_default_nan; 1376 return float32_default_nan;
1386 } 1377 }
1387 normalizeFloat32Subnormal( bSig, &bExp, &bSig ); 1378 normalizeFloat32Subnormal( bSig, &bExp, &bSig );
@@ -1444,7 +1435,7 @@ float32 float32_rem( float32 a, float32 b )
1444 } 1435 }
1445 zSign = ( (sbits32) aSig < 0 ); 1436 zSign = ( (sbits32) aSig < 0 );
1446 if ( zSign ) aSig = - aSig; 1437 if ( zSign ) aSig = - aSig;
1447 return normalizeRoundAndPackFloat32( aSign ^ zSign, bExp, aSig ); 1438 return normalizeRoundAndPackFloat32( roundData, aSign ^ zSign, bExp, aSig );
1448 1439
1449} 1440}
1450 1441
@@ -1455,7 +1446,7 @@ The operation is performed according to the IEC/IEEE Standard for Binary
1455Floating-point Arithmetic. 1446Floating-point Arithmetic.
1456------------------------------------------------------------------------------- 1447-------------------------------------------------------------------------------
1457*/ 1448*/
1458float32 float32_sqrt( float32 a ) 1449float32 float32_sqrt( struct roundingData *roundData, float32 a )
1459{ 1450{
1460 flag aSign; 1451 flag aSign;
1461 int16 aExp, zExp; 1452 int16 aExp, zExp;
@@ -1468,12 +1459,12 @@ float32 float32_sqrt( float32 a )
1468 if ( aExp == 0xFF ) { 1459 if ( aExp == 0xFF ) {
1469 if ( aSig ) return propagateFloat32NaN( a, 0 ); 1460 if ( aSig ) return propagateFloat32NaN( a, 0 );
1470 if ( ! aSign ) return a; 1461 if ( ! aSign ) return a;
1471 float_raise( float_flag_invalid ); 1462 roundData->exception |= float_flag_invalid;
1472 return float32_default_nan; 1463 return float32_default_nan;
1473 } 1464 }
1474 if ( aSign ) { 1465 if ( aSign ) {
1475 if ( ( aExp | aSig ) == 0 ) return a; 1466 if ( ( aExp | aSig ) == 0 ) return a;
1476 float_raise( float_flag_invalid ); 1467 roundData->exception |= float_flag_invalid;
1477 return float32_default_nan; 1468 return float32_default_nan;
1478 } 1469 }
1479 if ( aExp == 0 ) { 1470 if ( aExp == 0 ) {
@@ -1499,7 +1490,7 @@ float32 float32_sqrt( float32 a )
1499 } 1490 }
1500 } 1491 }
1501 shift32RightJamming( zSig, 1, &zSig ); 1492 shift32RightJamming( zSig, 1, &zSig );
1502 return roundAndPackFloat32( 0, zExp, zSig ); 1493 return roundAndPackFloat32( roundData, 0, zExp, zSig );
1503 1494
1504} 1495}
1505 1496
@@ -1611,9 +1602,7 @@ flag float32_le_quiet( float32 a, float32 b )
1611 if ( ( ( extractFloat32Exp( a ) == 0xFF ) && extractFloat32Frac( a ) ) 1602 if ( ( ( extractFloat32Exp( a ) == 0xFF ) && extractFloat32Frac( a ) )
1612 || ( ( extractFloat32Exp( b ) == 0xFF ) && extractFloat32Frac( b ) ) 1603 || ( ( extractFloat32Exp( b ) == 0xFF ) && extractFloat32Frac( b ) )
1613 ) { 1604 ) {
1614 if ( float32_is_signaling_nan( a ) || float32_is_signaling_nan( b ) ) { 1605 /* Do nothing, even if NaN as we're quiet */
1615 float_raise( float_flag_invalid );
1616 }
1617 return 0; 1606 return 0;
1618 } 1607 }
1619 aSign = extractFloat32Sign( a ); 1608 aSign = extractFloat32Sign( a );
@@ -1638,9 +1627,7 @@ flag float32_lt_quiet( float32 a, float32 b )
1638 if ( ( ( extractFloat32Exp( a ) == 0xFF ) && extractFloat32Frac( a ) ) 1627 if ( ( ( extractFloat32Exp( a ) == 0xFF ) && extractFloat32Frac( a ) )
1639 || ( ( extractFloat32Exp( b ) == 0xFF ) && extractFloat32Frac( b ) ) 1628 || ( ( extractFloat32Exp( b ) == 0xFF ) && extractFloat32Frac( b ) )
1640 ) { 1629 ) {
1641 if ( float32_is_signaling_nan( a ) || float32_is_signaling_nan( b ) ) { 1630 /* Do nothing, even if NaN as we're quiet */
1642 float_raise( float_flag_invalid );
1643 }
1644 return 0; 1631 return 0;
1645 } 1632 }
1646 aSign = extractFloat32Sign( a ); 1633 aSign = extractFloat32Sign( a );
@@ -1661,7 +1648,7 @@ positive integer is returned. Otherwise, if the conversion overflows, the
1661largest integer with the same sign as `a' is returned. 1648largest integer with the same sign as `a' is returned.
1662------------------------------------------------------------------------------- 1649-------------------------------------------------------------------------------
1663*/ 1650*/
1664int32 float64_to_int32( float64 a ) 1651int32 float64_to_int32( struct roundingData *roundData, float64 a )
1665{ 1652{
1666 flag aSign; 1653 flag aSign;
1667 int16 aExp, shiftCount; 1654 int16 aExp, shiftCount;
@@ -1674,7 +1661,7 @@ int32 float64_to_int32( float64 a )
1674 if ( aExp ) aSig |= LIT64( 0x0010000000000000 ); 1661 if ( aExp ) aSig |= LIT64( 0x0010000000000000 );
1675 shiftCount = 0x42C - aExp; 1662 shiftCount = 0x42C - aExp;
1676 if ( 0 < shiftCount ) shift64RightJamming( aSig, shiftCount, &aSig ); 1663 if ( 0 < shiftCount ) shift64RightJamming( aSig, shiftCount, &aSig );
1677 return roundAndPackInt32( aSign, aSig ); 1664 return roundAndPackInt32( roundData, aSign, aSig );
1678 1665
1679} 1666}
1680 1667
@@ -1705,7 +1692,7 @@ int32 float64_to_int32_round_to_zero( float64 a )
1705 goto invalid; 1692 goto invalid;
1706 } 1693 }
1707 else if ( 52 < shiftCount ) { 1694 else if ( 52 < shiftCount ) {
1708 if ( aExp || aSig ) float_exception_flags |= float_flag_inexact; 1695 if ( aExp || aSig ) float_raise( float_flag_inexact );
1709 return 0; 1696 return 0;
1710 } 1697 }
1711 aSig |= LIT64( 0x0010000000000000 ); 1698 aSig |= LIT64( 0x0010000000000000 );
@@ -1715,11 +1702,11 @@ int32 float64_to_int32_round_to_zero( float64 a )
1715 if ( aSign ) z = - z; 1702 if ( aSign ) z = - z;
1716 if ( ( z < 0 ) ^ aSign ) { 1703 if ( ( z < 0 ) ^ aSign ) {
1717 invalid: 1704 invalid:
1718 float_exception_flags |= float_flag_invalid; 1705 float_raise( float_flag_invalid );
1719 return aSign ? 0x80000000 : 0x7FFFFFFF; 1706 return aSign ? 0x80000000 : 0x7FFFFFFF;
1720 } 1707 }
1721 if ( ( aSig<<shiftCount ) != savedASig ) { 1708 if ( ( aSig<<shiftCount ) != savedASig ) {
1722 float_exception_flags |= float_flag_inexact; 1709 float_raise( float_flag_inexact );
1723 } 1710 }
1724 return z; 1711 return z;
1725 1712
@@ -1736,7 +1723,7 @@ positive integer is returned. Otherwise, if the conversion overflows, the
1736largest positive integer is returned. 1723largest positive integer is returned.
1737------------------------------------------------------------------------------- 1724-------------------------------------------------------------------------------
1738*/ 1725*/
1739int32 float64_to_uint32( float64 a ) 1726int32 float64_to_uint32( struct roundingData *roundData, float64 a )
1740{ 1727{
1741 flag aSign; 1728 flag aSign;
1742 int16 aExp, shiftCount; 1729 int16 aExp, shiftCount;
@@ -1749,7 +1736,7 @@ int32 float64_to_uint32( float64 a )
1749 if ( aExp ) aSig |= LIT64( 0x0010000000000000 ); 1736 if ( aExp ) aSig |= LIT64( 0x0010000000000000 );
1750 shiftCount = 0x42C - aExp; 1737 shiftCount = 0x42C - aExp;
1751 if ( 0 < shiftCount ) shift64RightJamming( aSig, shiftCount, &aSig ); 1738 if ( 0 < shiftCount ) shift64RightJamming( aSig, shiftCount, &aSig );
1752 return roundAndPackInt32( aSign, aSig ); 1739 return roundAndPackInt32( roundData, aSign, aSig );
1753} 1740}
1754 1741
1755/* 1742/*
@@ -1778,7 +1765,7 @@ int32 float64_to_uint32_round_to_zero( float64 a )
1778 goto invalid; 1765 goto invalid;
1779 } 1766 }
1780 else if ( 52 < shiftCount ) { 1767 else if ( 52 < shiftCount ) {
1781 if ( aExp || aSig ) float_exception_flags |= float_flag_inexact; 1768 if ( aExp || aSig ) float_raise( float_flag_inexact );
1782 return 0; 1769 return 0;
1783 } 1770 }
1784 aSig |= LIT64( 0x0010000000000000 ); 1771 aSig |= LIT64( 0x0010000000000000 );
@@ -1788,11 +1775,11 @@ int32 float64_to_uint32_round_to_zero( float64 a )
1788 if ( aSign ) z = - z; 1775 if ( aSign ) z = - z;
1789 if ( ( z < 0 ) ^ aSign ) { 1776 if ( ( z < 0 ) ^ aSign ) {
1790 invalid: 1777 invalid:
1791 float_exception_flags |= float_flag_invalid; 1778 float_raise( float_flag_invalid );
1792 return aSign ? 0x80000000 : 0x7FFFFFFF; 1779 return aSign ? 0x80000000 : 0x7FFFFFFF;
1793 } 1780 }
1794 if ( ( aSig<<shiftCount ) != savedASig ) { 1781 if ( ( aSig<<shiftCount ) != savedASig ) {
1795 float_exception_flags |= float_flag_inexact; 1782 float_raise( float_flag_inexact );
1796 } 1783 }
1797 return z; 1784 return z;
1798} 1785}
@@ -1805,7 +1792,7 @@ performed according to the IEC/IEEE Standard for Binary Floating-point
1805Arithmetic. 1792Arithmetic.
1806------------------------------------------------------------------------------- 1793-------------------------------------------------------------------------------
1807*/ 1794*/
1808float32 float64_to_float32( float64 a ) 1795float32 float64_to_float32( struct roundingData *roundData, float64 a )
1809{ 1796{
1810 flag aSign; 1797 flag aSign;
1811 int16 aExp; 1798 int16 aExp;
@@ -1825,7 +1812,7 @@ float32 float64_to_float32( float64 a )
1825 zSig |= 0x40000000; 1812 zSig |= 0x40000000;
1826 aExp -= 0x381; 1813 aExp -= 0x381;
1827 } 1814 }
1828 return roundAndPackFloat32( aSign, aExp, zSig ); 1815 return roundAndPackFloat32( roundData, aSign, aExp, zSig );
1829 1816
1830} 1817}
1831 1818
@@ -1872,7 +1859,7 @@ operation is performed according to the IEC/IEEE Standard for Binary
1872Floating-point Arithmetic. 1859Floating-point Arithmetic.
1873------------------------------------------------------------------------------- 1860-------------------------------------------------------------------------------
1874*/ 1861*/
1875float64 float64_round_to_int( float64 a ) 1862float64 float64_round_to_int( struct roundingData *roundData, float64 a )
1876{ 1863{
1877 flag aSign; 1864 flag aSign;
1878 int16 aExp; 1865 int16 aExp;
@@ -1889,9 +1876,9 @@ float64 float64_round_to_int( float64 a )
1889 } 1876 }
1890 if ( aExp <= 0x3FE ) { 1877 if ( aExp <= 0x3FE ) {
1891 if ( (bits64) ( a<<1 ) == 0 ) return a; 1878 if ( (bits64) ( a<<1 ) == 0 ) return a;
1892 float_exception_flags |= float_flag_inexact; 1879 roundData->exception |= float_flag_inexact;
1893 aSign = extractFloat64Sign( a ); 1880 aSign = extractFloat64Sign( a );
1894 switch ( float_rounding_mode ) { 1881 switch ( roundData->mode ) {
1895 case float_round_nearest_even: 1882 case float_round_nearest_even:
1896 if ( ( aExp == 0x3FE ) && extractFloat64Frac( a ) ) { 1883 if ( ( aExp == 0x3FE ) && extractFloat64Frac( a ) ) {
1897 return packFloat64( aSign, 0x3FF, 0 ); 1884 return packFloat64( aSign, 0x3FF, 0 );
@@ -1909,7 +1896,7 @@ float64 float64_round_to_int( float64 a )
1909 lastBitMask <<= 0x433 - aExp; 1896 lastBitMask <<= 0x433 - aExp;
1910 roundBitsMask = lastBitMask - 1; 1897 roundBitsMask = lastBitMask - 1;
1911 z = a; 1898 z = a;
1912 roundingMode = float_rounding_mode; 1899 roundingMode = roundData->mode;
1913 if ( roundingMode == float_round_nearest_even ) { 1900 if ( roundingMode == float_round_nearest_even ) {
1914 z += lastBitMask>>1; 1901 z += lastBitMask>>1;
1915 if ( ( z & roundBitsMask ) == 0 ) z &= ~ lastBitMask; 1902 if ( ( z & roundBitsMask ) == 0 ) z &= ~ lastBitMask;
@@ -1920,7 +1907,7 @@ float64 float64_round_to_int( float64 a )
1920 } 1907 }
1921 } 1908 }
1922 z &= ~ roundBitsMask; 1909 z &= ~ roundBitsMask;
1923 if ( z != a ) float_exception_flags |= float_flag_inexact; 1910 if ( z != a ) roundData->exception |= float_flag_inexact;
1924 return z; 1911 return z;
1925 1912
1926} 1913}
@@ -1934,7 +1921,7 @@ addition is performed according to the IEC/IEEE Standard for Binary
1934Floating-point Arithmetic. 1921Floating-point Arithmetic.
1935------------------------------------------------------------------------------- 1922-------------------------------------------------------------------------------
1936*/ 1923*/
1937static float64 addFloat64Sigs( float64 a, float64 b, flag zSign ) 1924static float64 addFloat64Sigs( struct roundingData *roundData, float64 a, float64 b, flag zSign )
1938{ 1925{
1939 int16 aExp, bExp, zExp; 1926 int16 aExp, bExp, zExp;
1940 bits64 aSig, bSig, zSig; 1927 bits64 aSig, bSig, zSig;
@@ -1993,7 +1980,7 @@ static float64 addFloat64Sigs( float64 a, float64 b, flag zSign )
1993 ++zExp; 1980 ++zExp;
1994 } 1981 }
1995 roundAndPack: 1982 roundAndPack:
1996 return roundAndPackFloat64( zSign, zExp, zSig ); 1983 return roundAndPackFloat64( roundData, zSign, zExp, zSig );
1997 1984
1998} 1985}
1999 1986
@@ -2006,7 +1993,7 @@ result is a NaN. The subtraction is performed according to the IEC/IEEE
2006Standard for Binary Floating-point Arithmetic. 1993Standard for Binary Floating-point Arithmetic.
2007------------------------------------------------------------------------------- 1994-------------------------------------------------------------------------------
2008*/ 1995*/
2009static float64 subFloat64Sigs( float64 a, float64 b, flag zSign ) 1996static float64 subFloat64Sigs( struct roundingData *roundData, float64 a, float64 b, flag zSign )
2010{ 1997{
2011 int16 aExp, bExp, zExp; 1998 int16 aExp, bExp, zExp;
2012 bits64 aSig, bSig, zSig; 1999 bits64 aSig, bSig, zSig;
@@ -2023,7 +2010,7 @@ static float64 subFloat64Sigs( float64 a, float64 b, flag zSign )
2023 if ( expDiff < 0 ) goto bExpBigger; 2010 if ( expDiff < 0 ) goto bExpBigger;
2024 if ( aExp == 0x7FF ) { 2011 if ( aExp == 0x7FF ) {
2025 if ( aSig | bSig ) return propagateFloat64NaN( a, b ); 2012 if ( aSig | bSig ) return propagateFloat64NaN( a, b );
2026 float_raise( float_flag_invalid ); 2013 roundData->exception |= float_flag_invalid;
2027 return float64_default_nan; 2014 return float64_default_nan;
2028 } 2015 }
2029 if ( aExp == 0 ) { 2016 if ( aExp == 0 ) {
@@ -2032,7 +2019,7 @@ static float64 subFloat64Sigs( float64 a, float64 b, flag zSign )
2032 } 2019 }
2033 if ( bSig < aSig ) goto aBigger; 2020 if ( bSig < aSig ) goto aBigger;
2034 if ( aSig < bSig ) goto bBigger; 2021 if ( aSig < bSig ) goto bBigger;
2035 return packFloat64( float_rounding_mode == float_round_down, 0, 0 ); 2022 return packFloat64( roundData->mode == float_round_down, 0, 0 );
2036 bExpBigger: 2023 bExpBigger:
2037 if ( bExp == 0x7FF ) { 2024 if ( bExp == 0x7FF ) {
2038 if ( bSig ) return propagateFloat64NaN( a, b ); 2025 if ( bSig ) return propagateFloat64NaN( a, b );
@@ -2069,7 +2056,7 @@ static float64 subFloat64Sigs( float64 a, float64 b, flag zSign )
2069 zExp = aExp; 2056 zExp = aExp;
2070 normalizeRoundAndPack: 2057 normalizeRoundAndPack:
2071 --zExp; 2058 --zExp;
2072 return normalizeRoundAndPackFloat64( zSign, zExp, zSig ); 2059 return normalizeRoundAndPackFloat64( roundData, zSign, zExp, zSig );
2073 2060
2074} 2061}
2075 2062
@@ -2080,17 +2067,17 @@ and `b'. The operation is performed according to the IEC/IEEE Standard for
2080Binary Floating-point Arithmetic. 2067Binary Floating-point Arithmetic.
2081------------------------------------------------------------------------------- 2068-------------------------------------------------------------------------------
2082*/ 2069*/
2083float64 float64_add( float64 a, float64 b ) 2070float64 float64_add( struct roundingData *roundData, float64 a, float64 b )
2084{ 2071{
2085 flag aSign, bSign; 2072 flag aSign, bSign;
2086 2073
2087 aSign = extractFloat64Sign( a ); 2074 aSign = extractFloat64Sign( a );
2088 bSign = extractFloat64Sign( b ); 2075 bSign = extractFloat64Sign( b );
2089 if ( aSign == bSign ) { 2076 if ( aSign == bSign ) {
2090 return addFloat64Sigs( a, b, aSign ); 2077 return addFloat64Sigs( roundData, a, b, aSign );
2091 } 2078 }
2092 else { 2079 else {
2093 return subFloat64Sigs( a, b, aSign ); 2080 return subFloat64Sigs( roundData, a, b, aSign );
2094 } 2081 }
2095 2082
2096} 2083}
@@ -2102,17 +2089,17 @@ Returns the result of subtracting the double-precision floating-point values
2102for Binary Floating-point Arithmetic. 2089for Binary Floating-point Arithmetic.
2103------------------------------------------------------------------------------- 2090-------------------------------------------------------------------------------
2104*/ 2091*/
2105float64 float64_sub( float64 a, float64 b ) 2092float64 float64_sub( struct roundingData *roundData, float64 a, float64 b )
2106{ 2093{
2107 flag aSign, bSign; 2094 flag aSign, bSign;
2108 2095
2109 aSign = extractFloat64Sign( a ); 2096 aSign = extractFloat64Sign( a );
2110 bSign = extractFloat64Sign( b ); 2097 bSign = extractFloat64Sign( b );
2111 if ( aSign == bSign ) { 2098 if ( aSign == bSign ) {
2112 return subFloat64Sigs( a, b, aSign ); 2099 return subFloat64Sigs( roundData, a, b, aSign );
2113 } 2100 }
2114 else { 2101 else {
2115 return addFloat64Sigs( a, b, aSign ); 2102 return addFloat64Sigs( roundData, a, b, aSign );
2116 } 2103 }
2117 2104
2118} 2105}
@@ -2124,7 +2111,7 @@ Returns the result of multiplying the double-precision floating-point values
2124for Binary Floating-point Arithmetic. 2111for Binary Floating-point Arithmetic.
2125------------------------------------------------------------------------------- 2112-------------------------------------------------------------------------------
2126*/ 2113*/
2127float64 float64_mul( float64 a, float64 b ) 2114float64 float64_mul( struct roundingData *roundData, float64 a, float64 b )
2128{ 2115{
2129 flag aSign, bSign, zSign; 2116 flag aSign, bSign, zSign;
2130 int16 aExp, bExp, zExp; 2117 int16 aExp, bExp, zExp;
@@ -2142,7 +2129,7 @@ float64 float64_mul( float64 a, float64 b )
2142 return propagateFloat64NaN( a, b ); 2129 return propagateFloat64NaN( a, b );
2143 } 2130 }
2144 if ( ( bExp | bSig ) == 0 ) { 2131 if ( ( bExp | bSig ) == 0 ) {
2145 float_raise( float_flag_invalid ); 2132 roundData->exception |= float_flag_invalid;
2146 return float64_default_nan; 2133 return float64_default_nan;
2147 } 2134 }
2148 return packFloat64( zSign, 0x7FF, 0 ); 2135 return packFloat64( zSign, 0x7FF, 0 );
@@ -2150,7 +2137,7 @@ float64 float64_mul( float64 a, float64 b )
2150 if ( bExp == 0x7FF ) { 2137 if ( bExp == 0x7FF ) {
2151 if ( bSig ) return propagateFloat64NaN( a, b ); 2138 if ( bSig ) return propagateFloat64NaN( a, b );
2152 if ( ( aExp | aSig ) == 0 ) { 2139 if ( ( aExp | aSig ) == 0 ) {
2153 float_raise( float_flag_invalid ); 2140 roundData->exception |= float_flag_invalid;
2154 return float64_default_nan; 2141 return float64_default_nan;
2155 } 2142 }
2156 return packFloat64( zSign, 0x7FF, 0 ); 2143 return packFloat64( zSign, 0x7FF, 0 );
@@ -2172,7 +2159,7 @@ float64 float64_mul( float64 a, float64 b )
2172 zSig0 <<= 1; 2159 zSig0 <<= 1;
2173 --zExp; 2160 --zExp;
2174 } 2161 }
2175 return roundAndPackFloat64( zSign, zExp, zSig0 ); 2162 return roundAndPackFloat64( roundData, zSign, zExp, zSig0 );
2176 2163
2177} 2164}
2178 2165
@@ -2183,7 +2170,7 @@ by the corresponding value `b'. The operation is performed according to
2183the IEC/IEEE Standard for Binary Floating-point Arithmetic. 2170the IEC/IEEE Standard for Binary Floating-point Arithmetic.
2184------------------------------------------------------------------------------- 2171-------------------------------------------------------------------------------
2185*/ 2172*/
2186float64 float64_div( float64 a, float64 b ) 2173float64 float64_div( struct roundingData *roundData, float64 a, float64 b )
2187{ 2174{
2188 flag aSign, bSign, zSign; 2175 flag aSign, bSign, zSign;
2189 int16 aExp, bExp, zExp; 2176 int16 aExp, bExp, zExp;
@@ -2202,7 +2189,7 @@ float64 float64_div( float64 a, float64 b )
2202 if ( aSig ) return propagateFloat64NaN( a, b ); 2189 if ( aSig ) return propagateFloat64NaN( a, b );
2203 if ( bExp == 0x7FF ) { 2190 if ( bExp == 0x7FF ) {
2204 if ( bSig ) return propagateFloat64NaN( a, b ); 2191 if ( bSig ) return propagateFloat64NaN( a, b );
2205 float_raise( float_flag_invalid ); 2192 roundData->exception |= float_flag_invalid;
2206 return float64_default_nan; 2193 return float64_default_nan;
2207 } 2194 }
2208 return packFloat64( zSign, 0x7FF, 0 ); 2195 return packFloat64( zSign, 0x7FF, 0 );
@@ -2214,10 +2201,10 @@ float64 float64_div( float64 a, float64 b )
2214 if ( bExp == 0 ) { 2201 if ( bExp == 0 ) {
2215 if ( bSig == 0 ) { 2202 if ( bSig == 0 ) {
2216 if ( ( aExp | aSig ) == 0 ) { 2203 if ( ( aExp | aSig ) == 0 ) {
2217 float_raise( float_flag_invalid ); 2204 roundData->exception |= float_flag_invalid;
2218 return float64_default_nan; 2205 return float64_default_nan;
2219 } 2206 }
2220 float_raise( float_flag_divbyzero ); 2207 roundData->exception |= float_flag_divbyzero;
2221 return packFloat64( zSign, 0x7FF, 0 ); 2208 return packFloat64( zSign, 0x7FF, 0 );
2222 } 2209 }
2223 normalizeFloat64Subnormal( bSig, &bExp, &bSig ); 2210 normalizeFloat64Subnormal( bSig, &bExp, &bSig );
@@ -2243,7 +2230,7 @@ float64 float64_div( float64 a, float64 b )
2243 } 2230 }
2244 zSig |= ( rem1 != 0 ); 2231 zSig |= ( rem1 != 0 );
2245 } 2232 }
2246 return roundAndPackFloat64( zSign, zExp, zSig ); 2233 return roundAndPackFloat64( roundData, zSign, zExp, zSig );
2247 2234
2248} 2235}
2249 2236
@@ -2254,7 +2241,7 @@ with respect to the corresponding value `b'. The operation is performed
2254according to the IEC/IEEE Standard for Binary Floating-point Arithmetic. 2241according to the IEC/IEEE Standard for Binary Floating-point Arithmetic.
2255------------------------------------------------------------------------------- 2242-------------------------------------------------------------------------------
2256*/ 2243*/
2257float64 float64_rem( float64 a, float64 b ) 2244float64 float64_rem( struct roundingData *roundData, float64 a, float64 b )
2258{ 2245{
2259 flag aSign, bSign, zSign; 2246 flag aSign, bSign, zSign;
2260 int16 aExp, bExp, expDiff; 2247 int16 aExp, bExp, expDiff;
@@ -2272,7 +2259,7 @@ float64 float64_rem( float64 a, float64 b )
2272 if ( aSig || ( ( bExp == 0x7FF ) && bSig ) ) { 2259 if ( aSig || ( ( bExp == 0x7FF ) && bSig ) ) {
2273 return propagateFloat64NaN( a, b ); 2260 return propagateFloat64NaN( a, b );
2274 } 2261 }
2275 float_raise( float_flag_invalid ); 2262 roundData->exception |= float_flag_invalid;
2276 return float64_default_nan; 2263 return float64_default_nan;
2277 } 2264 }
2278 if ( bExp == 0x7FF ) { 2265 if ( bExp == 0x7FF ) {
@@ -2281,7 +2268,7 @@ float64 float64_rem( float64 a, float64 b )
2281 } 2268 }
2282 if ( bExp == 0 ) { 2269 if ( bExp == 0 ) {
2283 if ( bSig == 0 ) { 2270 if ( bSig == 0 ) {
2284 float_raise( float_flag_invalid ); 2271 roundData->exception |= float_flag_invalid;
2285 return float64_default_nan; 2272 return float64_default_nan;
2286 } 2273 }
2287 normalizeFloat64Subnormal( bSig, &bExp, &bSig ); 2274 normalizeFloat64Subnormal( bSig, &bExp, &bSig );
@@ -2329,7 +2316,7 @@ float64 float64_rem( float64 a, float64 b )
2329 } 2316 }
2330 zSign = ( (sbits64) aSig < 0 ); 2317 zSign = ( (sbits64) aSig < 0 );
2331 if ( zSign ) aSig = - aSig; 2318 if ( zSign ) aSig = - aSig;
2332 return normalizeRoundAndPackFloat64( aSign ^ zSign, bExp, aSig ); 2319 return normalizeRoundAndPackFloat64( roundData, aSign ^ zSign, bExp, aSig );
2333 2320
2334} 2321}
2335 2322
@@ -2340,7 +2327,7 @@ The operation is performed according to the IEC/IEEE Standard for Binary
2340Floating-point Arithmetic. 2327Floating-point Arithmetic.
2341------------------------------------------------------------------------------- 2328-------------------------------------------------------------------------------
2342*/ 2329*/
2343float64 float64_sqrt( float64 a ) 2330float64 float64_sqrt( struct roundingData *roundData, float64 a )
2344{ 2331{
2345 flag aSign; 2332 flag aSign;
2346 int16 aExp, zExp; 2333 int16 aExp, zExp;
@@ -2354,12 +2341,12 @@ float64 float64_sqrt( float64 a )
2354 if ( aExp == 0x7FF ) { 2341 if ( aExp == 0x7FF ) {
2355 if ( aSig ) return propagateFloat64NaN( a, a ); 2342 if ( aSig ) return propagateFloat64NaN( a, a );
2356 if ( ! aSign ) return a; 2343 if ( ! aSign ) return a;
2357 float_raise( float_flag_invalid ); 2344 roundData->exception |= float_flag_invalid;
2358 return float64_default_nan; 2345 return float64_default_nan;
2359 } 2346 }
2360 if ( aSign ) { 2347 if ( aSign ) {
2361 if ( ( aExp | aSig ) == 0 ) return a; 2348 if ( ( aExp | aSig ) == 0 ) return a;
2362 float_raise( float_flag_invalid ); 2349 roundData->exception |= float_flag_invalid;
2363 return float64_default_nan; 2350 return float64_default_nan;
2364 } 2351 }
2365 if ( aExp == 0 ) { 2352 if ( aExp == 0 ) {
@@ -2390,7 +2377,7 @@ float64 float64_sqrt( float64 a )
2390 } 2377 }
2391 } 2378 }
2392 shift64RightJamming( zSig, 1, &zSig ); 2379 shift64RightJamming( zSig, 1, &zSig );
2393 return roundAndPackFloat64( 0, zExp, zSig ); 2380 return roundAndPackFloat64( roundData, 0, zExp, zSig );
2394 2381
2395} 2382}
2396 2383
@@ -2502,9 +2489,7 @@ flag float64_le_quiet( float64 a, float64 b )
2502 if ( ( ( extractFloat64Exp( a ) == 0x7FF ) && extractFloat64Frac( a ) ) 2489 if ( ( ( extractFloat64Exp( a ) == 0x7FF ) && extractFloat64Frac( a ) )
2503 || ( ( extractFloat64Exp( b ) == 0x7FF ) && extractFloat64Frac( b ) ) 2490 || ( ( extractFloat64Exp( b ) == 0x7FF ) && extractFloat64Frac( b ) )
2504 ) { 2491 ) {
2505 if ( float64_is_signaling_nan( a ) || float64_is_signaling_nan( b ) ) { 2492 /* Do nothing, even if NaN as we're quiet */
2506 float_raise( float_flag_invalid );
2507 }
2508 return 0; 2493 return 0;
2509 } 2494 }
2510 aSign = extractFloat64Sign( a ); 2495 aSign = extractFloat64Sign( a );
@@ -2529,9 +2514,7 @@ flag float64_lt_quiet( float64 a, float64 b )
2529 if ( ( ( extractFloat64Exp( a ) == 0x7FF ) && extractFloat64Frac( a ) ) 2514 if ( ( ( extractFloat64Exp( a ) == 0x7FF ) && extractFloat64Frac( a ) )
2530 || ( ( extractFloat64Exp( b ) == 0x7FF ) && extractFloat64Frac( b ) ) 2515 || ( ( extractFloat64Exp( b ) == 0x7FF ) && extractFloat64Frac( b ) )
2531 ) { 2516 ) {
2532 if ( float64_is_signaling_nan( a ) || float64_is_signaling_nan( b ) ) { 2517 /* Do nothing, even if NaN as we're quiet */
2533 float_raise( float_flag_invalid );
2534 }
2535 return 0; 2518 return 0;
2536 } 2519 }
2537 aSign = extractFloat64Sign( a ); 2520 aSign = extractFloat64Sign( a );
@@ -2554,7 +2537,7 @@ largest positive integer is returned. Otherwise, if the conversion
2554overflows, the largest integer with the same sign as `a' is returned. 2537overflows, the largest integer with the same sign as `a' is returned.
2555------------------------------------------------------------------------------- 2538-------------------------------------------------------------------------------
2556*/ 2539*/
2557int32 floatx80_to_int32( floatx80 a ) 2540int32 floatx80_to_int32( struct roundingData *roundData, floatx80 a )
2558{ 2541{
2559 flag aSign; 2542 flag aSign;
2560 int32 aExp, shiftCount; 2543 int32 aExp, shiftCount;
@@ -2567,7 +2550,7 @@ int32 floatx80_to_int32( floatx80 a )
2567 shiftCount = 0x4037 - aExp; 2550 shiftCount = 0x4037 - aExp;
2568 if ( shiftCount <= 0 ) shiftCount = 1; 2551 if ( shiftCount <= 0 ) shiftCount = 1;
2569 shift64RightJamming( aSig, shiftCount, &aSig ); 2552 shift64RightJamming( aSig, shiftCount, &aSig );
2570 return roundAndPackInt32( aSign, aSig ); 2553 return roundAndPackInt32( roundData, aSign, aSig );
2571 2554
2572} 2555}
2573 2556
@@ -2598,7 +2581,7 @@ int32 floatx80_to_int32_round_to_zero( floatx80 a )
2598 goto invalid; 2581 goto invalid;
2599 } 2582 }
2600 else if ( 63 < shiftCount ) { 2583 else if ( 63 < shiftCount ) {
2601 if ( aExp || aSig ) float_exception_flags |= float_flag_inexact; 2584 if ( aExp || aSig ) float_raise( float_flag_inexact );
2602 return 0; 2585 return 0;
2603 } 2586 }
2604 savedASig = aSig; 2587 savedASig = aSig;
@@ -2607,11 +2590,11 @@ int32 floatx80_to_int32_round_to_zero( floatx80 a )
2607 if ( aSign ) z = - z; 2590 if ( aSign ) z = - z;
2608 if ( ( z < 0 ) ^ aSign ) { 2591 if ( ( z < 0 ) ^ aSign ) {
2609 invalid: 2592 invalid:
2610 float_exception_flags |= float_flag_invalid; 2593 float_raise( float_flag_invalid );
2611 return aSign ? 0x80000000 : 0x7FFFFFFF; 2594 return aSign ? 0x80000000 : 0x7FFFFFFF;
2612 } 2595 }
2613 if ( ( aSig<<shiftCount ) != savedASig ) { 2596 if ( ( aSig<<shiftCount ) != savedASig ) {
2614 float_exception_flags |= float_flag_inexact; 2597 float_raise( float_flag_inexact );
2615 } 2598 }
2616 return z; 2599 return z;
2617 2600
@@ -2625,7 +2608,7 @@ conversion is performed according to the IEC/IEEE Standard for Binary
2625Floating-point Arithmetic. 2608Floating-point Arithmetic.
2626------------------------------------------------------------------------------- 2609-------------------------------------------------------------------------------
2627*/ 2610*/
2628float32 floatx80_to_float32( floatx80 a ) 2611float32 floatx80_to_float32( struct roundingData *roundData, floatx80 a )
2629{ 2612{
2630 flag aSign; 2613 flag aSign;
2631 int32 aExp; 2614 int32 aExp;
@@ -2642,7 +2625,7 @@ float32 floatx80_to_float32( floatx80 a )
2642 } 2625 }
2643 shift64RightJamming( aSig, 33, &aSig ); 2626 shift64RightJamming( aSig, 33, &aSig );
2644 if ( aExp || aSig ) aExp -= 0x3F81; 2627 if ( aExp || aSig ) aExp -= 0x3F81;
2645 return roundAndPackFloat32( aSign, aExp, aSig ); 2628 return roundAndPackFloat32( roundData, aSign, aExp, aSig );
2646 2629
2647} 2630}
2648 2631
@@ -2654,7 +2637,7 @@ conversion is performed according to the IEC/IEEE Standard for Binary
2654Floating-point Arithmetic. 2637Floating-point Arithmetic.
2655------------------------------------------------------------------------------- 2638-------------------------------------------------------------------------------
2656*/ 2639*/
2657float64 floatx80_to_float64( floatx80 a ) 2640float64 floatx80_to_float64( struct roundingData *roundData, floatx80 a )
2658{ 2641{
2659 flag aSign; 2642 flag aSign;
2660 int32 aExp; 2643 int32 aExp;
@@ -2671,7 +2654,7 @@ float64 floatx80_to_float64( floatx80 a )
2671 } 2654 }
2672 shift64RightJamming( aSig, 1, &zSig ); 2655 shift64RightJamming( aSig, 1, &zSig );
2673 if ( aExp || aSig ) aExp -= 0x3C01; 2656 if ( aExp || aSig ) aExp -= 0x3C01;
2674 return roundAndPackFloat64( aSign, aExp, zSig ); 2657 return roundAndPackFloat64( roundData, aSign, aExp, zSig );
2675 2658
2676} 2659}
2677 2660
@@ -2683,7 +2666,7 @@ value. The operation is performed according to the IEC/IEEE Standard for
2683Binary Floating-point Arithmetic. 2666Binary Floating-point Arithmetic.
2684------------------------------------------------------------------------------- 2667-------------------------------------------------------------------------------
2685*/ 2668*/
2686floatx80 floatx80_round_to_int( floatx80 a ) 2669floatx80 floatx80_round_to_int( struct roundingData *roundData, floatx80 a )
2687{ 2670{
2688 flag aSign; 2671 flag aSign;
2689 int32 aExp; 2672 int32 aExp;
@@ -2703,9 +2686,9 @@ floatx80 floatx80_round_to_int( floatx80 a )
2703 && ( (bits64) ( extractFloatx80Frac( a )<<1 ) == 0 ) ) { 2686 && ( (bits64) ( extractFloatx80Frac( a )<<1 ) == 0 ) ) {
2704 return a; 2687 return a;
2705 } 2688 }
2706 float_exception_flags |= float_flag_inexact; 2689 roundData->exception |= float_flag_inexact;
2707 aSign = extractFloatx80Sign( a ); 2690 aSign = extractFloatx80Sign( a );
2708 switch ( float_rounding_mode ) { 2691 switch ( roundData->mode ) {
2709 case float_round_nearest_even: 2692 case float_round_nearest_even:
2710 if ( ( aExp == 0x3FFE ) && (bits64) ( extractFloatx80Frac( a )<<1 ) 2693 if ( ( aExp == 0x3FFE ) && (bits64) ( extractFloatx80Frac( a )<<1 )
2711 ) { 2694 ) {
@@ -2729,7 +2712,7 @@ floatx80 floatx80_round_to_int( floatx80 a )
2729 lastBitMask <<= 0x403E - aExp; 2712 lastBitMask <<= 0x403E - aExp;
2730 roundBitsMask = lastBitMask - 1; 2713 roundBitsMask = lastBitMask - 1;
2731 z = a; 2714 z = a;
2732 roundingMode = float_rounding_mode; 2715 roundingMode = roundData->mode;
2733 if ( roundingMode == float_round_nearest_even ) { 2716 if ( roundingMode == float_round_nearest_even ) {
2734 z.low += lastBitMask>>1; 2717 z.low += lastBitMask>>1;
2735 if ( ( z.low & roundBitsMask ) == 0 ) z.low &= ~ lastBitMask; 2718 if ( ( z.low & roundBitsMask ) == 0 ) z.low &= ~ lastBitMask;
@@ -2744,7 +2727,7 @@ floatx80 floatx80_round_to_int( floatx80 a )
2744 ++z.high; 2727 ++z.high;
2745 z.low = LIT64( 0x8000000000000000 ); 2728 z.low = LIT64( 0x8000000000000000 );
2746 } 2729 }
2747 if ( z.low != a.low ) float_exception_flags |= float_flag_inexact; 2730 if ( z.low != a.low ) roundData->exception |= float_flag_inexact;
2748 return z; 2731 return z;
2749 2732
2750} 2733}
@@ -2758,7 +2741,7 @@ The addition is performed according to the IEC/IEEE Standard for Binary
2758Floating-point Arithmetic. 2741Floating-point Arithmetic.
2759------------------------------------------------------------------------------- 2742-------------------------------------------------------------------------------
2760*/ 2743*/
2761static floatx80 addFloatx80Sigs( floatx80 a, floatx80 b, flag zSign ) 2744static floatx80 addFloatx80Sigs( struct roundingData *roundData, floatx80 a, floatx80 b, flag zSign )
2762{ 2745{
2763 int32 aExp, bExp, zExp; 2746 int32 aExp, bExp, zExp;
2764 bits64 aSig, bSig, zSig0, zSig1; 2747 bits64 aSig, bSig, zSig0, zSig1;
@@ -2814,7 +2797,7 @@ static floatx80 addFloatx80Sigs( floatx80 a, floatx80 b, flag zSign )
2814 roundAndPack: 2797 roundAndPack:
2815 return 2798 return
2816 roundAndPackFloatx80( 2799 roundAndPackFloatx80(
2817 floatx80_rounding_precision, zSign, zExp, zSig0, zSig1 ); 2800 roundData, zSign, zExp, zSig0, zSig1 );
2818 2801
2819} 2802}
2820 2803
@@ -2827,7 +2810,7 @@ result is a NaN. The subtraction is performed according to the IEC/IEEE
2827Standard for Binary Floating-point Arithmetic. 2810Standard for Binary Floating-point Arithmetic.
2828------------------------------------------------------------------------------- 2811-------------------------------------------------------------------------------
2829*/ 2812*/
2830static floatx80 subFloatx80Sigs( floatx80 a, floatx80 b, flag zSign ) 2813static floatx80 subFloatx80Sigs( struct roundingData *roundData, floatx80 a, floatx80 b, flag zSign )
2831{ 2814{
2832 int32 aExp, bExp, zExp; 2815 int32 aExp, bExp, zExp;
2833 bits64 aSig, bSig, zSig0, zSig1; 2816 bits64 aSig, bSig, zSig0, zSig1;
@@ -2845,7 +2828,7 @@ static floatx80 subFloatx80Sigs( floatx80 a, floatx80 b, flag zSign )
2845 if ( (bits64) ( ( aSig | bSig )<<1 ) ) { 2828 if ( (bits64) ( ( aSig | bSig )<<1 ) ) {
2846 return propagateFloatx80NaN( a, b ); 2829 return propagateFloatx80NaN( a, b );
2847 } 2830 }
2848 float_raise( float_flag_invalid ); 2831 roundData->exception |= float_flag_invalid;
2849 z.low = floatx80_default_nan_low; 2832 z.low = floatx80_default_nan_low;
2850 z.high = floatx80_default_nan_high; 2833 z.high = floatx80_default_nan_high;
2851 return z; 2834 return z;
@@ -2857,7 +2840,7 @@ static floatx80 subFloatx80Sigs( floatx80 a, floatx80 b, flag zSign )
2857 zSig1 = 0; 2840 zSig1 = 0;
2858 if ( bSig < aSig ) goto aBigger; 2841 if ( bSig < aSig ) goto aBigger;
2859 if ( aSig < bSig ) goto bBigger; 2842 if ( aSig < bSig ) goto bBigger;
2860 return packFloatx80( float_rounding_mode == float_round_down, 0, 0 ); 2843 return packFloatx80( roundData->mode == float_round_down, 0, 0 );
2861 bExpBigger: 2844 bExpBigger:
2862 if ( bExp == 0x7FFF ) { 2845 if ( bExp == 0x7FFF ) {
2863 if ( (bits64) ( bSig<<1 ) ) return propagateFloatx80NaN( a, b ); 2846 if ( (bits64) ( bSig<<1 ) ) return propagateFloatx80NaN( a, b );
@@ -2883,7 +2866,7 @@ static floatx80 subFloatx80Sigs( floatx80 a, floatx80 b, flag zSign )
2883 normalizeRoundAndPack: 2866 normalizeRoundAndPack:
2884 return 2867 return
2885 normalizeRoundAndPackFloatx80( 2868 normalizeRoundAndPackFloatx80(
2886 floatx80_rounding_precision, zSign, zExp, zSig0, zSig1 ); 2869 roundData, zSign, zExp, zSig0, zSig1 );
2887 2870
2888} 2871}
2889 2872
@@ -2894,17 +2877,17 @@ values `a' and `b'. The operation is performed according to the IEC/IEEE
2894Standard for Binary Floating-point Arithmetic. 2877Standard for Binary Floating-point Arithmetic.
2895------------------------------------------------------------------------------- 2878-------------------------------------------------------------------------------
2896*/ 2879*/
2897floatx80 floatx80_add( floatx80 a, floatx80 b ) 2880floatx80 floatx80_add( struct roundingData *roundData, floatx80 a, floatx80 b )
2898{ 2881{
2899 flag aSign, bSign; 2882 flag aSign, bSign;
2900 2883
2901 aSign = extractFloatx80Sign( a ); 2884 aSign = extractFloatx80Sign( a );
2902 bSign = extractFloatx80Sign( b ); 2885 bSign = extractFloatx80Sign( b );
2903 if ( aSign == bSign ) { 2886 if ( aSign == bSign ) {
2904 return addFloatx80Sigs( a, b, aSign ); 2887 return addFloatx80Sigs( roundData, a, b, aSign );
2905 } 2888 }
2906 else { 2889 else {
2907 return subFloatx80Sigs( a, b, aSign ); 2890 return subFloatx80Sigs( roundData, a, b, aSign );
2908 } 2891 }
2909 2892
2910} 2893}
@@ -2916,17 +2899,17 @@ point values `a' and `b'. The operation is performed according to the
2916IEC/IEEE Standard for Binary Floating-point Arithmetic. 2899IEC/IEEE Standard for Binary Floating-point Arithmetic.
2917------------------------------------------------------------------------------- 2900-------------------------------------------------------------------------------
2918*/ 2901*/
2919floatx80 floatx80_sub( floatx80 a, floatx80 b ) 2902floatx80 floatx80_sub( struct roundingData *roundData, floatx80 a, floatx80 b )
2920{ 2903{
2921 flag aSign, bSign; 2904 flag aSign, bSign;
2922 2905
2923 aSign = extractFloatx80Sign( a ); 2906 aSign = extractFloatx80Sign( a );
2924 bSign = extractFloatx80Sign( b ); 2907 bSign = extractFloatx80Sign( b );
2925 if ( aSign == bSign ) { 2908 if ( aSign == bSign ) {
2926 return subFloatx80Sigs( a, b, aSign ); 2909 return subFloatx80Sigs( roundData, a, b, aSign );
2927 } 2910 }
2928 else { 2911 else {
2929 return addFloatx80Sigs( a, b, aSign ); 2912 return addFloatx80Sigs( roundData, a, b, aSign );
2930 } 2913 }
2931 2914
2932} 2915}
@@ -2938,7 +2921,7 @@ point values `a' and `b'. The operation is performed according to the
2938IEC/IEEE Standard for Binary Floating-point Arithmetic. 2921IEC/IEEE Standard for Binary Floating-point Arithmetic.
2939------------------------------------------------------------------------------- 2922-------------------------------------------------------------------------------
2940*/ 2923*/
2941floatx80 floatx80_mul( floatx80 a, floatx80 b ) 2924floatx80 floatx80_mul( struct roundingData *roundData, floatx80 a, floatx80 b )
2942{ 2925{
2943 flag aSign, bSign, zSign; 2926 flag aSign, bSign, zSign;
2944 int32 aExp, bExp, zExp; 2927 int32 aExp, bExp, zExp;
@@ -2964,7 +2947,7 @@ floatx80 floatx80_mul( floatx80 a, floatx80 b )
2964 if ( (bits64) ( bSig<<1 ) ) return propagateFloatx80NaN( a, b ); 2947 if ( (bits64) ( bSig<<1 ) ) return propagateFloatx80NaN( a, b );
2965 if ( ( aExp | aSig ) == 0 ) { 2948 if ( ( aExp | aSig ) == 0 ) {
2966 invalid: 2949 invalid:
2967 float_raise( float_flag_invalid ); 2950 roundData->exception |= float_flag_invalid;
2968 z.low = floatx80_default_nan_low; 2951 z.low = floatx80_default_nan_low;
2969 z.high = floatx80_default_nan_high; 2952 z.high = floatx80_default_nan_high;
2970 return z; 2953 return z;
@@ -2987,7 +2970,7 @@ floatx80 floatx80_mul( floatx80 a, floatx80 b )
2987 } 2970 }
2988 return 2971 return
2989 roundAndPackFloatx80( 2972 roundAndPackFloatx80(
2990 floatx80_rounding_precision, zSign, zExp, zSig0, zSig1 ); 2973 roundData, zSign, zExp, zSig0, zSig1 );
2991 2974
2992} 2975}
2993 2976
@@ -2998,7 +2981,7 @@ value `a' by the corresponding value `b'. The operation is performed
2998according to the IEC/IEEE Standard for Binary Floating-point Arithmetic. 2981according to the IEC/IEEE Standard for Binary Floating-point Arithmetic.
2999------------------------------------------------------------------------------- 2982-------------------------------------------------------------------------------
3000*/ 2983*/
3001floatx80 floatx80_div( floatx80 a, floatx80 b ) 2984floatx80 floatx80_div( struct roundingData *roundData, floatx80 a, floatx80 b )
3002{ 2985{
3003 flag aSign, bSign, zSign; 2986 flag aSign, bSign, zSign;
3004 int32 aExp, bExp, zExp; 2987 int32 aExp, bExp, zExp;
@@ -3029,12 +3012,12 @@ floatx80 floatx80_div( floatx80 a, floatx80 b )
3029 if ( bSig == 0 ) { 3012 if ( bSig == 0 ) {
3030 if ( ( aExp | aSig ) == 0 ) { 3013 if ( ( aExp | aSig ) == 0 ) {
3031 invalid: 3014 invalid:
3032 float_raise( float_flag_invalid ); 3015 roundData->exception |= float_flag_invalid;
3033 z.low = floatx80_default_nan_low; 3016 z.low = floatx80_default_nan_low;
3034 z.high = floatx80_default_nan_high; 3017 z.high = floatx80_default_nan_high;
3035 return z; 3018 return z;
3036 } 3019 }
3037 float_raise( float_flag_divbyzero ); 3020 roundData->exception |= float_flag_divbyzero;
3038 return packFloatx80( zSign, 0x7FFF, LIT64( 0x8000000000000000 ) ); 3021 return packFloatx80( zSign, 0x7FFF, LIT64( 0x8000000000000000 ) );
3039 } 3022 }
3040 normalizeFloatx80Subnormal( bSig, &bExp, &bSig ); 3023 normalizeFloatx80Subnormal( bSig, &bExp, &bSig );
@@ -3068,7 +3051,7 @@ floatx80 floatx80_div( floatx80 a, floatx80 b )
3068 } 3051 }
3069 return 3052 return
3070 roundAndPackFloatx80( 3053 roundAndPackFloatx80(
3071 floatx80_rounding_precision, zSign, zExp, zSig0, zSig1 ); 3054 roundData, zSign, zExp, zSig0, zSig1 );
3072 3055
3073} 3056}
3074 3057
@@ -3079,7 +3062,7 @@ Returns the remainder of the extended double-precision floating-point value
3079according to the IEC/IEEE Standard for Binary Floating-point Arithmetic. 3062according to the IEC/IEEE Standard for Binary Floating-point Arithmetic.
3080------------------------------------------------------------------------------- 3063-------------------------------------------------------------------------------
3081*/ 3064*/
3082floatx80 floatx80_rem( floatx80 a, floatx80 b ) 3065floatx80 floatx80_rem( struct roundingData *roundData, floatx80 a, floatx80 b )
3083{ 3066{
3084 flag aSign, bSign, zSign; 3067 flag aSign, bSign, zSign;
3085 int32 aExp, bExp, expDiff; 3068 int32 aExp, bExp, expDiff;
@@ -3107,7 +3090,7 @@ floatx80 floatx80_rem( floatx80 a, floatx80 b )
3107 if ( bExp == 0 ) { 3090 if ( bExp == 0 ) {
3108 if ( bSig == 0 ) { 3091 if ( bSig == 0 ) {
3109 invalid: 3092 invalid:
3110 float_raise( float_flag_invalid ); 3093 roundData->exception |= float_flag_invalid;
3111 z.low = floatx80_default_nan_low; 3094 z.low = floatx80_default_nan_low;
3112 z.high = floatx80_default_nan_high; 3095 z.high = floatx80_default_nan_high;
3113 return z; 3096 return z;
@@ -3164,9 +3147,10 @@ floatx80 floatx80_rem( floatx80 a, floatx80 b )
3164 aSig1 = alternateASig1; 3147 aSig1 = alternateASig1;
3165 zSign = ! zSign; 3148 zSign = ! zSign;
3166 } 3149 }
3150
3167 return 3151 return
3168 normalizeRoundAndPackFloatx80( 3152 normalizeRoundAndPackFloatx80(
3169 80, zSign, bExp + expDiff, aSig0, aSig1 ); 3153 roundData, zSign, bExp + expDiff, aSig0, aSig1 );
3170 3154
3171} 3155}
3172 3156
@@ -3177,7 +3161,7 @@ value `a'. The operation is performed according to the IEC/IEEE Standard
3177for Binary Floating-point Arithmetic. 3161for Binary Floating-point Arithmetic.
3178------------------------------------------------------------------------------- 3162-------------------------------------------------------------------------------
3179*/ 3163*/
3180floatx80 floatx80_sqrt( floatx80 a ) 3164floatx80 floatx80_sqrt( struct roundingData *roundData, floatx80 a )
3181{ 3165{
3182 flag aSign; 3166 flag aSign;
3183 int32 aExp, zExp; 3167 int32 aExp, zExp;
@@ -3197,7 +3181,7 @@ floatx80 floatx80_sqrt( floatx80 a )
3197 if ( aSign ) { 3181 if ( aSign ) {
3198 if ( ( aExp | aSig0 ) == 0 ) return a; 3182 if ( ( aExp | aSig0 ) == 0 ) return a;
3199 invalid: 3183 invalid:
3200 float_raise( float_flag_invalid ); 3184 roundData->exception |= float_flag_invalid;
3201 z.low = floatx80_default_nan_low; 3185 z.low = floatx80_default_nan_low;
3202 z.high = floatx80_default_nan_high; 3186 z.high = floatx80_default_nan_high;
3203 return z; 3187 return z;
@@ -3242,7 +3226,7 @@ floatx80 floatx80_sqrt( floatx80 a )
3242 } 3226 }
3243 return 3227 return
3244 roundAndPackFloatx80( 3228 roundAndPackFloatx80(
3245 floatx80_rounding_precision, 0, zExp, zSig0, zSig1 ); 3229 roundData, 0, zExp, zSig0, zSig1 );
3246 3230
3247} 3231}
3248 3232
@@ -3390,10 +3374,7 @@ flag floatx80_le_quiet( floatx80 a, floatx80 b )
3390 || ( ( extractFloatx80Exp( b ) == 0x7FFF ) 3374 || ( ( extractFloatx80Exp( b ) == 0x7FFF )
3391 && (bits64) ( extractFloatx80Frac( b )<<1 ) ) 3375 && (bits64) ( extractFloatx80Frac( b )<<1 ) )
3392 ) { 3376 ) {
3393 if ( floatx80_is_signaling_nan( a ) 3377 /* Do nothing, even if NaN as we're quiet */
3394 || floatx80_is_signaling_nan( b ) ) {
3395 float_raise( float_flag_invalid );
3396 }
3397 return 0; 3378 return 0;
3398 } 3379 }
3399 aSign = extractFloatx80Sign( a ); 3380 aSign = extractFloatx80Sign( a );
@@ -3427,10 +3408,7 @@ flag floatx80_lt_quiet( floatx80 a, floatx80 b )
3427 || ( ( extractFloatx80Exp( b ) == 0x7FFF ) 3408 || ( ( extractFloatx80Exp( b ) == 0x7FFF )
3428 && (bits64) ( extractFloatx80Frac( b )<<1 ) ) 3409 && (bits64) ( extractFloatx80Frac( b )<<1 ) )
3429 ) { 3410 ) {
3430 if ( floatx80_is_signaling_nan( a ) 3411 /* Do nothing, even if NaN as we're quiet */
3431 || floatx80_is_signaling_nan( b ) ) {
3432 float_raise( float_flag_invalid );
3433 }
3434 return 0; 3412 return 0;
3435 } 3413 }
3436 aSign = extractFloatx80Sign( a ); 3414 aSign = extractFloatx80Sign( a );
diff --git a/arch/arm/nwfpe/softfloat.h b/arch/arm/nwfpe/softfloat.h
index 1e1743173899..1c8799b9ee4d 100644
--- a/arch/arm/nwfpe/softfloat.h
+++ b/arch/arm/nwfpe/softfloat.h
@@ -74,7 +74,7 @@ enum {
74Software IEC/IEEE floating-point rounding mode. 74Software IEC/IEEE floating-point rounding mode.
75------------------------------------------------------------------------------- 75-------------------------------------------------------------------------------
76*/ 76*/
77extern signed char float_rounding_mode; 77//extern int8 float_rounding_mode;
78enum { 78enum {
79 float_round_nearest_even = 0, 79 float_round_nearest_even = 0,
80 float_round_to_zero = 1, 80 float_round_to_zero = 1,
@@ -86,7 +86,6 @@ enum {
86------------------------------------------------------------------------------- 86-------------------------------------------------------------------------------
87Software IEC/IEEE floating-point exception flags. 87Software IEC/IEEE floating-point exception flags.
88------------------------------------------------------------------------------- 88-------------------------------------------------------------------------------
89extern signed char float_exception_flags;
90enum { 89enum {
91 float_flag_inexact = 1, 90 float_flag_inexact = 1,
92 float_flag_underflow = 2, 91 float_flag_underflow = 2,
@@ -99,7 +98,6 @@ ScottB: November 4, 1998
99Changed the enumeration to match the bit order in the FPA11. 98Changed the enumeration to match the bit order in the FPA11.
100*/ 99*/
101 100
102extern signed char float_exception_flags;
103enum { 101enum {
104 float_flag_invalid = 1, 102 float_flag_invalid = 1,
105 float_flag_divbyzero = 2, 103 float_flag_divbyzero = 2,
@@ -121,7 +119,7 @@ void float_raise( signed char );
121Software IEC/IEEE integer-to-floating-point conversion routines. 119Software IEC/IEEE integer-to-floating-point conversion routines.
122------------------------------------------------------------------------------- 120-------------------------------------------------------------------------------
123*/ 121*/
124float32 int32_to_float32( signed int ); 122float32 int32_to_float32( struct roundingData *, signed int );
125float64 int32_to_float64( signed int ); 123float64 int32_to_float64( signed int );
126#ifdef FLOATX80 124#ifdef FLOATX80
127floatx80 int32_to_floatx80( signed int ); 125floatx80 int32_to_floatx80( signed int );
@@ -132,7 +130,7 @@ floatx80 int32_to_floatx80( signed int );
132Software IEC/IEEE single-precision conversion routines. 130Software IEC/IEEE single-precision conversion routines.
133------------------------------------------------------------------------------- 131-------------------------------------------------------------------------------
134*/ 132*/
135signed int float32_to_int32( float32 ); 133signed int float32_to_int32( struct roundingData *, float32 );
136signed int float32_to_int32_round_to_zero( float32 ); 134signed int float32_to_int32_round_to_zero( float32 );
137float64 float32_to_float64( float32 ); 135float64 float32_to_float64( float32 );
138#ifdef FLOATX80 136#ifdef FLOATX80
@@ -144,13 +142,13 @@ floatx80 float32_to_floatx80( float32 );
144Software IEC/IEEE single-precision operations. 142Software IEC/IEEE single-precision operations.
145------------------------------------------------------------------------------- 143-------------------------------------------------------------------------------
146*/ 144*/
147float32 float32_round_to_int( float32 ); 145float32 float32_round_to_int( struct roundingData*, float32 );
148float32 float32_add( float32, float32 ); 146float32 float32_add( struct roundingData *, float32, float32 );
149float32 float32_sub( float32, float32 ); 147float32 float32_sub( struct roundingData *, float32, float32 );
150float32 float32_mul( float32, float32 ); 148float32 float32_mul( struct roundingData *, float32, float32 );
151float32 float32_div( float32, float32 ); 149float32 float32_div( struct roundingData *, float32, float32 );
152float32 float32_rem( float32, float32 ); 150float32 float32_rem( struct roundingData *, float32, float32 );
153float32 float32_sqrt( float32 ); 151float32 float32_sqrt( struct roundingData*, float32 );
154char float32_eq( float32, float32 ); 152char float32_eq( float32, float32 );
155char float32_le( float32, float32 ); 153char float32_le( float32, float32 );
156char float32_lt( float32, float32 ); 154char float32_lt( float32, float32 );
@@ -164,9 +162,9 @@ char float32_is_signaling_nan( float32 );
164Software IEC/IEEE double-precision conversion routines. 162Software IEC/IEEE double-precision conversion routines.
165------------------------------------------------------------------------------- 163-------------------------------------------------------------------------------
166*/ 164*/
167signed int float64_to_int32( float64 ); 165signed int float64_to_int32( struct roundingData *, float64 );
168signed int float64_to_int32_round_to_zero( float64 ); 166signed int float64_to_int32_round_to_zero( float64 );
169float32 float64_to_float32( float64 ); 167float32 float64_to_float32( struct roundingData *, float64 );
170#ifdef FLOATX80 168#ifdef FLOATX80
171floatx80 float64_to_floatx80( float64 ); 169floatx80 float64_to_floatx80( float64 );
172#endif 170#endif
@@ -176,13 +174,13 @@ floatx80 float64_to_floatx80( float64 );
176Software IEC/IEEE double-precision operations. 174Software IEC/IEEE double-precision operations.
177------------------------------------------------------------------------------- 175-------------------------------------------------------------------------------
178*/ 176*/
179float64 float64_round_to_int( float64 ); 177float64 float64_round_to_int( struct roundingData *, float64 );
180float64 float64_add( float64, float64 ); 178float64 float64_add( struct roundingData *, float64, float64 );
181float64 float64_sub( float64, float64 ); 179float64 float64_sub( struct roundingData *, float64, float64 );
182float64 float64_mul( float64, float64 ); 180float64 float64_mul( struct roundingData *, float64, float64 );
183float64 float64_div( float64, float64 ); 181float64 float64_div( struct roundingData *, float64, float64 );
184float64 float64_rem( float64, float64 ); 182float64 float64_rem( struct roundingData *, float64, float64 );
185float64 float64_sqrt( float64 ); 183float64 float64_sqrt( struct roundingData *, float64 );
186char float64_eq( float64, float64 ); 184char float64_eq( float64, float64 );
187char float64_le( float64, float64 ); 185char float64_le( float64, float64 );
188char float64_lt( float64, float64 ); 186char float64_lt( float64, float64 );
@@ -198,31 +196,23 @@ char float64_is_signaling_nan( float64 );
198Software IEC/IEEE extended double-precision conversion routines. 196Software IEC/IEEE extended double-precision conversion routines.
199------------------------------------------------------------------------------- 197-------------------------------------------------------------------------------
200*/ 198*/
201signed int floatx80_to_int32( floatx80 ); 199signed int floatx80_to_int32( struct roundingData *, floatx80 );
202signed int floatx80_to_int32_round_to_zero( floatx80 ); 200signed int floatx80_to_int32_round_to_zero( floatx80 );
203float32 floatx80_to_float32( floatx80 ); 201float32 floatx80_to_float32( struct roundingData *, floatx80 );
204float64 floatx80_to_float64( floatx80 ); 202float64 floatx80_to_float64( struct roundingData *, floatx80 );
205
206/*
207-------------------------------------------------------------------------------
208Software IEC/IEEE extended double-precision rounding precision. Valid
209values are 32, 64, and 80.
210-------------------------------------------------------------------------------
211*/
212extern signed char floatx80_rounding_precision;
213 203
214/* 204/*
215------------------------------------------------------------------------------- 205-------------------------------------------------------------------------------
216Software IEC/IEEE extended double-precision operations. 206Software IEC/IEEE extended double-precision operations.
217------------------------------------------------------------------------------- 207-------------------------------------------------------------------------------
218*/ 208*/
219floatx80 floatx80_round_to_int( floatx80 ); 209floatx80 floatx80_round_to_int( struct roundingData *, floatx80 );
220floatx80 floatx80_add( floatx80, floatx80 ); 210floatx80 floatx80_add( struct roundingData *, floatx80, floatx80 );
221floatx80 floatx80_sub( floatx80, floatx80 ); 211floatx80 floatx80_sub( struct roundingData *, floatx80, floatx80 );
222floatx80 floatx80_mul( floatx80, floatx80 ); 212floatx80 floatx80_mul( struct roundingData *, floatx80, floatx80 );
223floatx80 floatx80_div( floatx80, floatx80 ); 213floatx80 floatx80_div( struct roundingData *, floatx80, floatx80 );
224floatx80 floatx80_rem( floatx80, floatx80 ); 214floatx80 floatx80_rem( struct roundingData *, floatx80, floatx80 );
225floatx80 floatx80_sqrt( floatx80 ); 215floatx80 floatx80_sqrt( struct roundingData *, floatx80 );
226char floatx80_eq( floatx80, floatx80 ); 216char floatx80_eq( floatx80, floatx80 );
227char floatx80_le( floatx80, floatx80 ); 217char floatx80_le( floatx80, floatx80 );
228char floatx80_lt( floatx80, floatx80 ); 218char floatx80_lt( floatx80, floatx80 );
diff --git a/arch/arm/oprofile/backtrace.c b/arch/arm/oprofile/backtrace.c
index ec58d3e2eb8b..df35c452a8bf 100644
--- a/arch/arm/oprofile/backtrace.c
+++ b/arch/arm/oprofile/backtrace.c
@@ -115,7 +115,7 @@ static int valid_kernel_stack(struct frame_tail *tail, struct pt_regs *regs)
115 return (tailaddr > stack) && (tailaddr < stack_base); 115 return (tailaddr > stack) && (tailaddr < stack_base);
116} 116}
117 117
118void arm_backtrace(struct pt_regs const *regs, unsigned int depth) 118void arm_backtrace(struct pt_regs * const regs, unsigned int depth)
119{ 119{
120 struct frame_tail *tail; 120 struct frame_tail *tail;
121 unsigned long last_address = 0; 121 unsigned long last_address = 0;
diff --git a/arch/arm/plat-omap/gpio.c b/arch/arm/plat-omap/gpio.c
index 1c85b4e536c2..aa481ea3d702 100644
--- a/arch/arm/plat-omap/gpio.c
+++ b/arch/arm/plat-omap/gpio.c
@@ -590,7 +590,7 @@ static void gpio_irq_handler(unsigned int irq, struct irqdesc *desc,
590 if (!(isr & 1)) 590 if (!(isr & 1))
591 continue; 591 continue;
592 d = irq_desc + gpio_irq; 592 d = irq_desc + gpio_irq;
593 d->handle(gpio_irq, d, regs); 593 desc_handle_irq(gpio_irq, d, regs);
594 } 594 }
595} 595}
596 596
diff --git a/arch/arm/plat-omap/ocpi.c b/arch/arm/plat-omap/ocpi.c
index 1fb16f9edfd5..2ede2ee8cae4 100644
--- a/arch/arm/plat-omap/ocpi.c
+++ b/arch/arm/plat-omap/ocpi.c
@@ -25,7 +25,6 @@
25 25
26#include <linux/config.h> 26#include <linux/config.h>
27#include <linux/module.h> 27#include <linux/module.h>
28#include <linux/version.h>
29#include <linux/types.h> 28#include <linux/types.h>
30#include <linux/errno.h> 29#include <linux/errno.h>
31#include <linux/kernel.h> 30#include <linux/kernel.h>
diff --git a/arch/arm/vfp/vfpdouble.c b/arch/arm/vfp/vfpdouble.c
index b801cd66b6ea..9b367a65cb4d 100644
--- a/arch/arm/vfp/vfpdouble.c
+++ b/arch/arm/vfp/vfpdouble.c
@@ -770,6 +770,9 @@ vfp_double_add(struct vfp_double *vdd, struct vfp_double *vdn,
770 if ((s64)m_sig < 0) { 770 if ((s64)m_sig < 0) {
771 vdd->sign = vfp_sign_negate(vdd->sign); 771 vdd->sign = vfp_sign_negate(vdd->sign);
772 m_sig = -m_sig; 772 m_sig = -m_sig;
773 } else if (m_sig == 0) {
774 vdd->sign = (fpscr & FPSCR_RMODE_MASK) ==
775 FPSCR_ROUND_MINUSINF ? 0x8000 : 0;
773 } 776 }
774 } else { 777 } else {
775 m_sig += vdn->significand; 778 m_sig += vdn->significand;
diff --git a/arch/arm26/Kconfig b/arch/arm26/Kconfig
index dc0c1936969b..1f0373267306 100644
--- a/arch/arm26/Kconfig
+++ b/arch/arm26/Kconfig
@@ -183,6 +183,8 @@ source "mm/Kconfig"
183 183
184endmenu 184endmenu
185 185
186source "net/Kconfig"
187
186source "drivers/base/Kconfig" 188source "drivers/base/Kconfig"
187 189
188source "drivers/parport/Kconfig" 190source "drivers/parport/Kconfig"
@@ -193,7 +195,7 @@ source "drivers/block/Kconfig"
193 195
194source "drivers/md/Kconfig" 196source "drivers/md/Kconfig"
195 197
196source "net/Kconfig" 198source "drivers/net/Kconfig"
197 199
198source "drivers/ide/Kconfig" 200source "drivers/ide/Kconfig"
199 201
diff --git a/arch/arm26/kernel/process.c b/arch/arm26/kernel/process.c
index 46aea6ac194d..9eb9964d32a7 100644
--- a/arch/arm26/kernel/process.c
+++ b/arch/arm26/kernel/process.c
@@ -103,9 +103,6 @@ void machine_power_off(void)
103{ 103{
104} 104}
105 105
106EXPORT_SYMBOL(machine_halt);
107EXPORT_SYMBOL(machine_power_off);
108
109void machine_restart(char * __unused) 106void machine_restart(char * __unused)
110{ 107{
111 /* 108 /*
@@ -136,8 +133,6 @@ void machine_restart(char * __unused)
136 while (1); 133 while (1);
137} 134}
138 135
139EXPORT_SYMBOL(machine_restart);
140
141void show_regs(struct pt_regs * regs) 136void show_regs(struct pt_regs * regs)
142{ 137{
143 unsigned long flags; 138 unsigned long flags;
diff --git a/arch/arm26/kernel/signal.c b/arch/arm26/kernel/signal.c
index 356d9809cc0b..ce2055bdc9ee 100644
--- a/arch/arm26/kernel/signal.c
+++ b/arch/arm26/kernel/signal.c
@@ -454,14 +454,13 @@ handle_signal(unsigned long sig, siginfo_t *info, sigset_t *oldset,
454 if (ka->sa.sa_flags & SA_ONESHOT) 454 if (ka->sa.sa_flags & SA_ONESHOT)
455 ka->sa.sa_handler = SIG_DFL; 455 ka->sa.sa_handler = SIG_DFL;
456 456
457 if (!(ka->sa.sa_flags & SA_NODEFER)) { 457 spin_lock_irq(&tsk->sighand->siglock);
458 spin_lock_irq(&tsk->sighand->siglock); 458 sigorsets(&tsk->blocked, &tsk->blocked,
459 sigorsets(&tsk->blocked, &tsk->blocked, 459 &ka->sa.sa_mask);
460 &ka->sa.sa_mask); 460 if (!(ka->sa.sa_flags & SA_NODEFER))
461 sigaddset(&tsk->blocked, sig); 461 sigaddset(&tsk->blocked, sig);
462 recalc_sigpending(); 462 recalc_sigpending();
463 spin_unlock_irq(&tsk->sighand->siglock); 463 spin_unlock_irq(&tsk->sighand->siglock);
464 }
465 return; 464 return;
466 } 465 }
467 466
diff --git a/arch/arm26/mm/fault.c b/arch/arm26/mm/fault.c
index dacca8bb7744..bd6f2db608b7 100644
--- a/arch/arm26/mm/fault.c
+++ b/arch/arm26/mm/fault.c
@@ -176,12 +176,12 @@ survive:
176 * Handle the "normal" cases first - successful and sigbus 176 * Handle the "normal" cases first - successful and sigbus
177 */ 177 */
178 switch (fault) { 178 switch (fault) {
179 case 2: 179 case VM_FAULT_MAJOR:
180 tsk->maj_flt++; 180 tsk->maj_flt++;
181 return fault; 181 return fault;
182 case 1: 182 case VM_FAULT_MINOR:
183 tsk->min_flt++; 183 tsk->min_flt++;
184 case 0: 184 case VM_FAULT_SIGBUS:
185 return fault; 185 return fault;
186 } 186 }
187 187
@@ -226,14 +226,11 @@ int do_page_fault(unsigned long addr, unsigned int fsr, struct pt_regs *regs)
226 /* 226 /*
227 * Handle the "normal" case first 227 * Handle the "normal" case first
228 */ 228 */
229 if (fault > 0) 229 switch (fault) {
230 case VM_FAULT_MINOR:
231 case VM_FAULT_MAJOR:
230 return 0; 232 return 0;
231 233 case VM_FAULT_SIGBUS:
232 /*
233 * We had some memory, but were unable to
234 * successfully fix up this page fault.
235 */
236 if (fault == 0){
237 goto do_sigbus; 234 goto do_sigbus;
238 } 235 }
239 236
diff --git a/arch/cris/Kconfig b/arch/cris/Kconfig
index f848e3761491..e5979d68e352 100644
--- a/arch/cris/Kconfig
+++ b/arch/cris/Kconfig
@@ -122,6 +122,8 @@ source arch/cris/arch-v10/Kconfig
122 122
123endmenu 123endmenu
124 124
125source "net/Kconfig"
126
125# bring in ETRAX built-in drivers 127# bring in ETRAX built-in drivers
126menu "Drivers for built-in interfaces" 128menu "Drivers for built-in interfaces"
127source arch/cris/arch-v10/drivers/Kconfig 129source arch/cris/arch-v10/drivers/Kconfig
@@ -149,7 +151,7 @@ source "drivers/ieee1394/Kconfig"
149 151
150source "drivers/message/i2o/Kconfig" 152source "drivers/message/i2o/Kconfig"
151 153
152source "net/Kconfig" 154source "drivers/net/Kconfig"
153 155
154source "drivers/isdn/Kconfig" 156source "drivers/isdn/Kconfig"
155 157
diff --git a/arch/cris/Kconfig.debug b/arch/cris/Kconfig.debug
index f42918bf22a9..0a1d62a23614 100644
--- a/arch/cris/Kconfig.debug
+++ b/arch/cris/Kconfig.debug
@@ -5,10 +5,13 @@ config PROFILING
5 bool "Kernel profiling support" 5 bool "Kernel profiling support"
6 6
7config SYSTEM_PROFILER 7config SYSTEM_PROFILER
8 bool "System profiling support" 8 bool "System profiling support"
9
10source "lib/Kconfig.debug"
9 11
10config ETRAX_KGDB 12config ETRAX_KGDB
11 bool "Use kernel GDB debugger" 13 bool "Use kernel GDB debugger"
14 depends on DEBUG_KERNEL
12 ---help--- 15 ---help---
13 The CRIS version of gdb can be used to remotely debug a running 16 The CRIS version of gdb can be used to remotely debug a running
14 Linux kernel via the serial debug port. Provided you have gdb-cris 17 Linux kernel via the serial debug port. Provided you have gdb-cris
@@ -22,20 +25,11 @@ config ETRAX_KGDB
22 this option is turned on! 25 this option is turned on!
23 26
24 27
25config DEBUG_INFO 28config DEBUG_NMI_OOPS
26 bool "Compile the kernel with debug info" 29 bool "NMI causes oops printout"
27 help 30 depends on DEBUG_KERNEL
28 If you say Y here the resulting kernel image will include 31 help
29 debugging info resulting in a larger kernel image. 32 If the system locks up without any debug information you can say Y
30 Say Y here only if you plan to use gdb to debug the kernel. 33 here to make it possible to dump an OOPS with an external NMI.
31 If you don't debug the kernel, you can say N.
32
33config FRAME_POINTER
34 bool "Compile the kernel with frame pointers"
35 help
36 If you say Y here the resulting kernel image will be slightly larger
37 and slower, but it will give very useful debugging information.
38 If you don't debug the kernel, you can say N, but we may not be able
39 to solve problems without frame pointers.
40 34
41endmenu 35endmenu
diff --git a/arch/cris/Makefile b/arch/cris/Makefile
index 9d28fa8563cc..90ca8730b120 100644
--- a/arch/cris/Makefile
+++ b/arch/cris/Makefile
@@ -1,4 +1,4 @@
1# $Id: Makefile,v 1.23 2004/10/19 13:07:34 starvik Exp $ 1# $Id: Makefile,v 1.28 2005/03/17 10:44:37 larsv Exp $
2# cris/Makefile 2# cris/Makefile
3# 3#
4# This file is included by the global makefile so that you can add your own 4# This file is included by the global makefile so that you can add your own
@@ -15,6 +15,7 @@
15 15
16arch-y := v10 16arch-y := v10
17arch-$(CONFIG_ETRAX_ARCH_V10) := v10 17arch-$(CONFIG_ETRAX_ARCH_V10) := v10
18arch-$(CONFIG_ETRAX_ARCH_V32) := v32
18 19
19# No config avaiable for make clean etc 20# No config avaiable for make clean etc
20ifneq ($(arch-y),) 21ifneq ($(arch-y),)
@@ -46,6 +47,21 @@ core-y += arch/$(ARCH)/$(SARCH)/kernel/ arch/$(ARCH)/$(SARCH)/mm/
46drivers-y += arch/$(ARCH)/$(SARCH)/drivers/ 47drivers-y += arch/$(ARCH)/$(SARCH)/drivers/
47libs-y += arch/$(ARCH)/$(SARCH)/lib/ $(LIBGCC) 48libs-y += arch/$(ARCH)/$(SARCH)/lib/ $(LIBGCC)
48 49
50# cris source path
51SRC_ARCH = $(srctree)/arch/$(ARCH)
52# cris object files path
53OBJ_ARCH = $(objtree)/arch/$(ARCH)
54
55target_boot_arch_dir = $(OBJ_ARCH)/$(SARCH)/boot
56target_boot_dir = $(OBJ_ARCH)/boot
57src_boot_dir = $(SRC_ARCH)/boot
58target_compressed_dir = $(OBJ_ARCH)/boot/compressed
59src_compressed_dir = $(SRC_ARCH)/boot/compressed
60target_rescue_dir = $(OBJ_ARCH)/boot/rescue
61src_rescue_dir = $(SRC_ARCH)/boot/rescue
62
63export target_boot_arch_dir target_boot_dir src_boot_dir target_compressed_dir src_compressed_dir target_rescue_dir src_rescue_dir
64
49vmlinux.bin: vmlinux 65vmlinux.bin: vmlinux
50 $(OBJCOPY) $(OBJCOPYFLAGS) vmlinux vmlinux.bin 66 $(OBJCOPY) $(OBJCOPYFLAGS) vmlinux vmlinux.bin
51 67
@@ -65,44 +81,52 @@ cramfs:
65 81
66clinux: vmlinux.bin decompress.bin rescue.bin 82clinux: vmlinux.bin decompress.bin rescue.bin
67 83
68decompress.bin: FORCE 84decompress.bin: $(target_boot_dir)
69 @make -C arch/$(ARCH)/boot/compressed decompress.bin 85 @$(MAKE) -f $(src_compressed_dir)/Makefile $(target_compressed_dir)/decompress.bin
70 86
71rescue.bin: FORCE 87$(target_rescue_dir)/rescue.bin: $(target_boot_dir)
72 @make -C arch/$(ARCH)/boot/rescue rescue.bin 88 @$(MAKE) -f $(src_rescue_dir)/Makefile $(target_rescue_dir)/rescue.bin
73 89
74zImage: vmlinux.bin rescue.bin 90zImage: $(target_boot_dir) vmlinux.bin $(target_rescue_dir)/rescue.bin
75## zImage - Compressed kernel (gzip) 91## zImage - Compressed kernel (gzip)
76 @make -C arch/$(ARCH)/boot/ zImage 92 @$(MAKE) -f $(src_boot_dir)/Makefile zImage
93
94$(target_boot_dir): $(target_boot_arch_dir)
95 ln -sfn $< $@
96
97$(target_boot_arch_dir):
98 mkdir -p $@
77 99
78compressed: zImage 100compressed: zImage
79 101
80archmrproper: 102archmrproper:
81archclean: 103archclean:
82 $(Q)$(MAKE) $(clean)=arch/$(ARCH)/boot 104 @if [ -d arch/$(ARCH)/boot ]; then \
105 $(MAKE) $(clean)=arch/$(ARCH)/boot ; \
106 fi
83 rm -f timage vmlinux.bin decompress.bin rescue.bin cramfs.img 107 rm -f timage vmlinux.bin decompress.bin rescue.bin cramfs.img
84 rm -rf $(LD_SCRIPT).tmp 108 rm -rf $(LD_SCRIPT).tmp
85 109
86prepare: arch/$(ARCH)/.links include/asm-$(ARCH)/.arch \ 110prepare: $(SRC_ARCH)/.links $(srctree)/include/asm-$(ARCH)/.arch \
87 include/asm-$(ARCH)/$(SARCH)/offset.h 111 include/asm-$(ARCH)/$(SARCH)/offset.h
88 112
89# Create some links to make all tools happy 113# Create some links to make all tools happy
90arch/$(ARCH)/.links: 114$(SRC_ARCH)/.links:
91 @rm -rf arch/$(ARCH)/drivers 115 @rm -rf $(SRC_ARCH)/drivers
92 @ln -sfn $(SARCH)/drivers arch/$(ARCH)/drivers 116 @ln -sfn $(SRC_ARCH)/$(SARCH)/drivers $(SRC_ARCH)/drivers
93 @rm -rf arch/$(ARCH)/boot 117 @rm -rf $(SRC_ARCH)/boot
94 @ln -sfn $(SARCH)/boot arch/$(ARCH)/boot 118 @ln -sfn $(SRC_ARCH)/$(SARCH)/boot $(SRC_ARCH)/boot
95 @rm -rf arch/$(ARCH)/lib 119 @rm -rf $(SRC_ARCH)/lib
96 @ln -sfn $(SARCH)/lib arch/$(ARCH)/lib 120 @ln -sfn $(SRC_ARCH)/$(SARCH)/lib $(SRC_ARCH)/lib
97 @ln -sfn $(SARCH) arch/$(ARCH)/arch 121 @ln -sfn $(SRC_ARCH)/$(SARCH) $(SRC_ARCH)/arch
98 @ln -sfn ../$(SARCH)/vmlinux.lds.S arch/$(ARCH)/kernel/vmlinux.lds.S 122 @ln -sfn $(SRC_ARCH)/$(SARCH)/vmlinux.lds.S $(SRC_ARCH)/kernel/vmlinux.lds.S
99 @touch $@ 123 @touch $@
100 124
101# Create link to sub arch includes 125# Create link to sub arch includes
102include/asm-$(ARCH)/.arch: $(wildcard include/config/arch/*.h) 126$(srctree)/include/asm-$(ARCH)/.arch: $(wildcard include/config/arch/*.h)
103 @echo ' Making asm-$(ARCH)/arch -> asm-$(ARCH)/$(SARCH) symlink' 127 @echo ' Making $(srctree)/include/asm-$(ARCH)/arch -> $(srctree)/include/asm-$(ARCH)/$(SARCH) symlink'
104 @rm -f include/asm-$(ARCH)/arch 128 @rm -f include/asm-$(ARCH)/arch
105 @ln -sf $(SARCH) include/asm-$(ARCH)/arch 129 @ln -sf $(srctree)/include/asm-$(ARCH)/$(SARCH) $(srctree)/include/asm-$(ARCH)/arch
106 @touch $@ 130 @touch $@
107 131
108arch/$(ARCH)/$(SARCH)/kernel/asm-offsets.s: include/asm include/linux/version.h \ 132arch/$(ARCH)/$(SARCH)/kernel/asm-offsets.s: include/asm include/linux/version.h \
diff --git a/arch/cris/arch-v10/Kconfig b/arch/cris/arch-v10/Kconfig
index 2ca64cc40c63..44eb1b9accb3 100644
--- a/arch/cris/arch-v10/Kconfig
+++ b/arch/cris/arch-v10/Kconfig
@@ -260,6 +260,37 @@ config ETRAX_DEBUG_PORT_NULL
260endchoice 260endchoice
261 261
262choice 262choice
263 prompt "Kernel GDB port"
264 depends on ETRAX_KGDB
265 default ETRAX_KGDB_PORT0
266 help
267 Choose a serial port for kernel debugging. NOTE: This port should
268 not be enabled under Drivers for built-in interfaces (as it has its
269 own initialization code) and should not be the same as the debug port.
270
271config ETRAX_KGDB_PORT0
272 bool "Serial-0"
273 help
274 Use serial port 0 for kernel debugging.
275
276config ETRAX_KGDB_PORT1
277 bool "Serial-1"
278 help
279 Use serial port 1 for kernel debugging.
280
281config ETRAX_KGDB_PORT2
282 bool "Serial-2"
283 help
284 Use serial port 2 for kernel debugging.
285
286config ETRAX_KGDB_PORT3
287 bool "Serial-3"
288 help
289 Use serial port 3 for kernel debugging.
290
291endchoice
292
293choice
263 prompt "Product rescue-port" 294 prompt "Product rescue-port"
264 depends on ETRAX_ARCH_V10 295 depends on ETRAX_ARCH_V10
265 default ETRAX_RESCUE_SER0 296 default ETRAX_RESCUE_SER0
diff --git a/arch/cris/arch-v10/boot/Makefile b/arch/cris/arch-v10/boot/Makefile
index fe6650368e6a..e5b105851108 100644
--- a/arch/cris/arch-v10/boot/Makefile
+++ b/arch/cris/arch-v10/boot/Makefile
@@ -1,12 +1,13 @@
1# 1#
2# arch/cris/boot/Makefile 2# arch/cris/boot/Makefile
3# 3#
4target = $(target_boot_dir)
5src = $(src_boot_dir)
4 6
5zImage: compressed/vmlinuz 7zImage: compressed/vmlinuz
6 8
7compressed/vmlinuz: $(TOPDIR)/vmlinux 9compressed/vmlinuz:
8 @$(MAKE) -C compressed vmlinuz 10 @$(MAKE) -f $(src)/compressed/Makefile $(target_compressed_dir)/vmlinuz
9 11
10clean: 12clean:
11 rm -f zImage tools/build compressed/vmlinux.out 13 @$(MAKE) -f $(src)/compressed/Makefile clean
12 @$(MAKE) -C compressed clean
diff --git a/arch/cris/arch-v10/boot/compressed/Makefile b/arch/cris/arch-v10/boot/compressed/Makefile
index 5f71c2c819e6..6584a44820f4 100644
--- a/arch/cris/arch-v10/boot/compressed/Makefile
+++ b/arch/cris/arch-v10/boot/compressed/Makefile
@@ -1,40 +1,45 @@
1# 1#
2# linux/arch/etrax100/boot/compressed/Makefile 2# create a compressed vmlinuz image from the binary vmlinux.bin file
3#
4# create a compressed vmlinux image from the original vmlinux files and romfs
5# 3#
4target = $(target_compressed_dir)
5src = $(src_compressed_dir)
6 6
7CC = gcc-cris -melf -I $(TOPDIR)/include 7CC = gcc-cris -melf $(LINUXINCLUDE)
8CFLAGS = -O2 8CFLAGS = -O2
9LD = ld-cris 9LD = ld-cris
10OBJCOPY = objcopy-cris 10OBJCOPY = objcopy-cris
11OBJCOPYFLAGS = -O binary --remove-section=.bss 11OBJCOPYFLAGS = -O binary --remove-section=.bss
12OBJECTS = head.o misc.o 12OBJECTS = $(target)/head.o $(target)/misc.o
13 13
14# files to compress 14# files to compress
15SYSTEM = $(TOPDIR)/vmlinux.bin 15SYSTEM = $(objtree)/vmlinux.bin
16 16
17all: vmlinuz 17all: $(target_compressed_dir)/vmlinuz
18 18
19decompress.bin: $(OBJECTS) 19$(target)/decompress.bin: $(OBJECTS)
20 $(LD) -T decompress.ld -o decompress.o $(OBJECTS) 20 $(LD) -T $(src)/decompress.ld -o $(target)/decompress.o $(OBJECTS)
21 $(OBJCOPY) $(OBJCOPYFLAGS) decompress.o decompress.bin 21 $(OBJCOPY) $(OBJCOPYFLAGS) $(target)/decompress.o $(target)/decompress.bin
22# save it for mkprod in the topdir.
23 cp decompress.bin $(TOPDIR)
24 22
23# Create vmlinuz image in top-level build directory
24$(target_compressed_dir)/vmlinuz: $(target) piggy.img $(target)/decompress.bin
25 @echo " COMPR vmlinux.bin --> vmlinuz"
26 @cat $(target)/decompress.bin piggy.img > $(target_compressed_dir)/vmlinuz
27 @rm -f piggy.img
25 28
26vmlinuz: piggy.img decompress.bin 29$(target)/head.o: $(src)/head.S
27 cat decompress.bin piggy.img > vmlinuz 30 $(CC) -D__ASSEMBLY__ -traditional -c $< -o $@
28 rm -f piggy.img
29 31
30head.o: head.S 32$(target)/misc.o: $(src)/misc.c
31 $(CC) -D__ASSEMBLY__ -traditional -c head.S -o head.o 33 $(CC) -D__KERNEL__ -c $< -o $@
32 34
33# gzip the kernel image 35# gzip the kernel image
34 36
35piggy.img: $(SYSTEM) 37piggy.img: $(SYSTEM)
36 cat $(SYSTEM) | gzip -f -9 > piggy.img 38 @cat $(SYSTEM) | gzip -f -9 > piggy.img
39
40$(target):
41 mkdir -p $(target)
37 42
38clean: 43clean:
39 rm -f piggy.img vmlinuz vmlinuz.o 44 rm -f piggy.img $(objtree)/vmlinuz
40 45
diff --git a/arch/cris/arch-v10/boot/compressed/head.S b/arch/cris/arch-v10/boot/compressed/head.S
index 4cbdd4b1d9d6..e73f44c998d9 100644
--- a/arch/cris/arch-v10/boot/compressed/head.S
+++ b/arch/cris/arch-v10/boot/compressed/head.S
@@ -13,7 +13,8 @@
13#include <asm/arch/sv_addr_ag.h> 13#include <asm/arch/sv_addr_ag.h>
14 14
15#define RAM_INIT_MAGIC 0x56902387 15#define RAM_INIT_MAGIC 0x56902387
16 16#define COMMAND_LINE_MAGIC 0x87109563
17
17 ;; Exported symbols 18 ;; Exported symbols
18 19
19 .globl _input_data 20 .globl _input_data
@@ -88,6 +89,12 @@ basse: move.d pc, r5
88 cmp.d r2, r1 89 cmp.d r2, r1
89 bcs 1b 90 bcs 1b
90 nop 91 nop
92
93 ;; Save command line magic and address.
94 move.d _cmd_line_magic, $r12
95 move.d $r10, [$r12]
96 move.d _cmd_line_addr, $r12
97 move.d $r11, [$r12]
91 98
92 ;; Do the decompression and save compressed size in _inptr 99 ;; Do the decompression and save compressed size in _inptr
93 100
@@ -98,7 +105,13 @@ basse: move.d pc, r5
98 105
99 move.d [_input_data], r9 ; flash address of compressed kernel 106 move.d [_input_data], r9 ; flash address of compressed kernel
100 add.d [_inptr], r9 ; size of compressed kernel 107 add.d [_inptr], r9 ; size of compressed kernel
101 108
109 ;; Restore command line magic and address.
110 move.d _cmd_line_magic, $r10
111 move.d [$r10], $r10
112 move.d _cmd_line_addr, $r11
113 move.d [$r11], $r11
114
102 ;; Enter the decompressed kernel 115 ;; Enter the decompressed kernel
103 move.d RAM_INIT_MAGIC, r8 ; Tell kernel that DRAM is initialized 116 move.d RAM_INIT_MAGIC, r8 ; Tell kernel that DRAM is initialized
104 jump 0x40004000 ; kernel is linked to this address 117 jump 0x40004000 ; kernel is linked to this address
@@ -107,5 +120,8 @@ basse: move.d pc, r5
107 120
108_input_data: 121_input_data:
109 .dword 0 ; used by the decompressor 122 .dword 0 ; used by the decompressor
110 123_cmd_line_magic:
124 .dword 0
125_cmd_line_addr:
126 .dword 0
111#include "../../lib/hw_settings.S" 127#include "../../lib/hw_settings.S"
diff --git a/arch/cris/arch-v10/boot/rescue/Makefile b/arch/cris/arch-v10/boot/rescue/Makefile
index e9f2ba2ad02c..8be9b3130312 100644
--- a/arch/cris/arch-v10/boot/rescue/Makefile
+++ b/arch/cris/arch-v10/boot/rescue/Makefile
@@ -1,52 +1,53 @@
1# 1#
2# Makefile for rescue code 2# Makefile for rescue code
3# 3#
4ifndef TOPDIR 4target = $(target_rescue_dir)
5TOPDIR = ../../../.. 5src = $(src_rescue_dir)
6endif 6
7CC = gcc-cris -mlinux -I $(TOPDIR)/include 7CC = gcc-cris -mlinux $(LINUXINCLUDE)
8CFLAGS = -O2 8CFLAGS = -O2
9LD = gcc-cris -mlinux -nostdlib 9LD = gcc-cris -mlinux -nostdlib
10OBJCOPY = objcopy-cris 10OBJCOPY = objcopy-cris
11OBJCOPYFLAGS = -O binary --remove-section=.bss 11OBJCOPYFLAGS = -O binary --remove-section=.bss
12 12
13all: rescue.bin testrescue.bin kimagerescue.bin 13all: $(target)/rescue.bin $(target)/testrescue.bin $(target)/kimagerescue.bin
14
15rescue: rescue.bin
16 # do nothing
17 14
18rescue.bin: head.o 15$(target)/rescue.bin: $(target) $(target)/head.o
19 $(LD) -T rescue.ld -o rescue.o head.o 16 $(LD) -T $(src)/rescue.ld -o $(target)/rescue.o $(target)/head.o
20 $(OBJCOPY) $(OBJCOPYFLAGS) rescue.o rescue.bin 17 $(OBJCOPY) $(OBJCOPYFLAGS) $(target)/rescue.o $(target)/rescue.bin
21 cp rescue.bin $(TOPDIR) 18# Place a copy in top-level build directory
19 cp -p $(target)/rescue.bin $(objtree)
22 20
23testrescue.bin: testrescue.o 21$(target)/testrescue.bin: $(target) $(target)/testrescue.o
24 $(OBJCOPY) $(OBJCOPYFLAGS) testrescue.o tr.bin 22 $(OBJCOPY) $(OBJCOPYFLAGS) $(target)/testrescue.o tr.bin
25# Pad it to 784 bytes 23# Pad it to 784 bytes
26 dd if=/dev/zero of=tmp2423 bs=1 count=784 24 dd if=/dev/zero of=tmp2423 bs=1 count=784
27 cat tr.bin tmp2423 >testrescue_tmp.bin 25 cat tr.bin tmp2423 >testrescue_tmp.bin
28 dd if=testrescue_tmp.bin of=testrescue.bin bs=1 count=784 26 dd if=testrescue_tmp.bin of=$(target)/testrescue.bin bs=1 count=784
29 rm tr.bin tmp2423 testrescue_tmp.bin 27 rm tr.bin tmp2423 testrescue_tmp.bin
30 28
31kimagerescue.bin: kimagerescue.o 29$(target)/kimagerescue.bin: $(target) $(target)/kimagerescue.o
32 $(OBJCOPY) $(OBJCOPYFLAGS) kimagerescue.o ktr.bin 30 $(OBJCOPY) $(OBJCOPYFLAGS) $(target)/kimagerescue.o ktr.bin
33# Pad it to 784 bytes, that's what the rescue loader expects 31# Pad it to 784 bytes, that's what the rescue loader expects
34 dd if=/dev/zero of=tmp2423 bs=1 count=784 32 dd if=/dev/zero of=tmp2423 bs=1 count=784
35 cat ktr.bin tmp2423 >kimagerescue_tmp.bin 33 cat ktr.bin tmp2423 >kimagerescue_tmp.bin
36 dd if=kimagerescue_tmp.bin of=kimagerescue.bin bs=1 count=784 34 dd if=kimagerescue_tmp.bin of=$(target)/kimagerescue.bin bs=1 count=784
37 rm ktr.bin tmp2423 kimagerescue_tmp.bin 35 rm ktr.bin tmp2423 kimagerescue_tmp.bin
38 36
39head.o: head.S 37$(target):
38 mkdir -p $(target)
39
40$(target)/head.o: $(src)/head.S
40 $(CC) -D__ASSEMBLY__ -traditional -c $< -o $*.o 41 $(CC) -D__ASSEMBLY__ -traditional -c $< -o $*.o
41 42
42testrescue.o: testrescue.S 43$(target)/testrescue.o: $(src)/testrescue.S
43 $(CC) -D__ASSEMBLY__ -traditional -c $< -o $*.o 44 $(CC) -D__ASSEMBLY__ -traditional -c $< -o $*.o
44 45
45kimagerescue.o: kimagerescue.S 46$(target)/kimagerescue.o: $(src)/kimagerescue.S
46 $(CC) -D__ASSEMBLY__ -traditional -c $< -o $*.o 47 $(CC) -D__ASSEMBLY__ -traditional -c $< -o $*.o
47 48
48clean: 49clean:
49 rm -f *.o *.bin 50 rm -f $(target)/*.o $(target)/*.bin
50 51
51fastdep: 52fastdep:
52 53
diff --git a/arch/cris/arch-v10/boot/rescue/head.S b/arch/cris/arch-v10/boot/rescue/head.S
index 8689ea972c46..addb2194de0f 100644
--- a/arch/cris/arch-v10/boot/rescue/head.S
+++ b/arch/cris/arch-v10/boot/rescue/head.S
@@ -1,4 +1,4 @@
1/* $Id: head.S,v 1.6 2003/04/09 08:12:43 pkj Exp $ 1/* $Id: head.S,v 1.7 2005/03/07 12:11:06 starvik Exp $
2 * 2 *
3 * Rescue code, made to reside at the beginning of the 3 * Rescue code, made to reside at the beginning of the
4 * flash-memory. when it starts, it checks a partition 4 * flash-memory. when it starts, it checks a partition
@@ -121,12 +121,13 @@
121 ;; 0x80000000 if loaded in flash (as it should be) 121 ;; 0x80000000 if loaded in flash (as it should be)
122 ;; since etrax actually starts at address 2 when booting from flash, we 122 ;; since etrax actually starts at address 2 when booting from flash, we
123 ;; put a nop (2 bytes) here first so we dont accidentally skip the di 123 ;; put a nop (2 bytes) here first so we dont accidentally skip the di
124 124
125 nop 125 nop
126 di 126 di
127 127
128 jump in_cache ; enter cached area instead 128 jump in_cache ; enter cached area instead
129in_cache: 129in_cache:
130
130 131
131 ;; first put a jump test to give a possibility of upgrading the rescue code 132 ;; first put a jump test to give a possibility of upgrading the rescue code
132 ;; without erasing/reflashing the sector. we put a longword of -1 here and if 133 ;; without erasing/reflashing the sector. we put a longword of -1 here and if
@@ -325,9 +326,29 @@ flash_ok:
325 ;; result will be in r0 326 ;; result will be in r0
326checksum: 327checksum:
327 moveq 0, $r0 328 moveq 0, $r0
3281: addu.b [$r1+], $r0 329 moveq CONFIG_ETRAX_FLASH1_SIZE, $r6
329 subq 1, $r2 330
330 bne 1b 331 ;; If the first physical flash memory is exceeded wrap to the second one.
332 btstq 26, $r1 ; Are we addressing first flash?
333 bpl 1f
334 nop
335 clear.d $r6
336
3371: test.d $r6 ; 0 = no wrapping
338 beq 2f
339 nop
340 lslq 20, $r6 ; Convert MB to bytes
341 sub.d $r1, $r6
342
3432: addu.b [$r1+], $r0
344 subq 1, $r6 ; Flash memory left
345 beq 3f
346 subq 1, $r2 ; Length left
347 bne 2b
331 nop 348 nop
332 ret 349 ret
333 nop 350 nop
351
3523: move.d MEM_CSE1_START, $r1 ; wrap to second flash
353 ba 2b
354 nop
diff --git a/arch/cris/arch-v10/drivers/Kconfig b/arch/cris/arch-v10/drivers/Kconfig
index 748374f25b87..8b50e8402954 100644
--- a/arch/cris/arch-v10/drivers/Kconfig
+++ b/arch/cris/arch-v10/drivers/Kconfig
@@ -1,17 +1,11 @@
1config ETRAX_ETHERNET 1config ETRAX_ETHERNET
2 bool "Ethernet support" 2 bool "Ethernet support"
3 depends on ETRAX_ARCH_V10 3 depends on ETRAX_ARCH_V10
4 select NET_ETHERNET
4 help 5 help
5 This option enables the ETRAX 100LX built-in 10/100Mbit Ethernet 6 This option enables the ETRAX 100LX built-in 10/100Mbit Ethernet
6 controller. 7 controller.
7 8
8# this is just so that the user does not have to go into the
9# normal ethernet driver section just to enable ethernetworking
10config NET_ETHERNET
11 bool
12 depends on ETRAX_ETHERNET
13 default y
14
15choice 9choice
16 prompt "Network LED behavior" 10 prompt "Network LED behavior"
17 depends on ETRAX_ETHERNET 11 depends on ETRAX_ETHERNET
@@ -20,26 +14,26 @@ choice
20config ETRAX_NETWORK_LED_ON_WHEN_LINK 14config ETRAX_NETWORK_LED_ON_WHEN_LINK
21 bool "LED_on_when_link" 15 bool "LED_on_when_link"
22 help 16 help
23 Selecting LED_on_when_link will light the LED when there is a 17 Selecting LED_on_when_link will light the LED when there is a
24 connection and will flash off when there is activity. 18 connection and will flash off when there is activity.
25 19
26 Selecting LED_on_when_activity will light the LED only when 20 Selecting LED_on_when_activity will light the LED only when
27 there is activity. 21 there is activity.
28 22
29 This setting will also affect the behaviour of other activity LEDs 23 This setting will also affect the behaviour of other activity LEDs
30 e.g. Bluetooth. 24 e.g. Bluetooth.
31 25
32config ETRAX_NETWORK_LED_ON_WHEN_ACTIVITY 26config ETRAX_NETWORK_LED_ON_WHEN_ACTIVITY
33 bool "LED_on_when_activity" 27 bool "LED_on_when_activity"
34 help 28 help
35 Selecting LED_on_when_link will light the LED when there is a 29 Selecting LED_on_when_link will light the LED when there is a
36 connection and will flash off when there is activity. 30 connection and will flash off when there is activity.
37 31
38 Selecting LED_on_when_activity will light the LED only when 32 Selecting LED_on_when_activity will light the LED only when
39 there is activity. 33 there is activity.
40 34
41 This setting will also affect the behaviour of other activity LEDs 35 This setting will also affect the behaviour of other activity LEDs
42 e.g. Bluetooth. 36 e.g. Bluetooth.
43 37
44endchoice 38endchoice
45 39
@@ -91,11 +85,11 @@ choice
91 depends on ETRAX_SERIAL_PORT0 85 depends on ETRAX_SERIAL_PORT0
92 default ETRAX_SERIAL_PORT0_DMA6_OUT 86 default ETRAX_SERIAL_PORT0_DMA6_OUT
93 87
94config CONFIG_ETRAX_SERIAL_PORT0_NO_DMA_OUT 88config ETRAX_SERIAL_PORT0_NO_DMA_OUT
95 bool "No DMA out" 89 bool "No DMA out"
96 90
97config CONFIG_ETRAX_SERIAL_PORT0_DMA6_OUT 91config ETRAX_SERIAL_PORT0_DMA6_OUT
98 bool "DMA 6" 92 bool "DMA 6"
99 93
100endchoice 94endchoice
101 95
@@ -104,11 +98,11 @@ choice
104 depends on ETRAX_SERIAL_PORT0 98 depends on ETRAX_SERIAL_PORT0
105 default ETRAX_SERIAL_PORT0_DMA7_IN 99 default ETRAX_SERIAL_PORT0_DMA7_IN
106 100
107config CONFIG_ETRAX_SERIAL_PORT0_NO_DMA_IN 101config ETRAX_SERIAL_PORT0_NO_DMA_IN
108 bool "No DMA in" 102 bool "No DMA in"
109 103
110config CONFIG_ETRAX_SERIAL_PORT0_DMA7_IN 104config ETRAX_SERIAL_PORT0_DMA7_IN
111 bool "DMA 7" 105 bool "DMA 7"
112 106
113endchoice 107endchoice
114 108
@@ -205,11 +199,11 @@ choice
205 depends on ETRAX_SERIAL_PORT1 199 depends on ETRAX_SERIAL_PORT1
206 default ETRAX_SERIAL_PORT1_DMA8_OUT 200 default ETRAX_SERIAL_PORT1_DMA8_OUT
207 201
208config CONFIG_ETRAX_SERIAL_PORT1_NO_DMA_OUT 202config ETRAX_SERIAL_PORT1_NO_DMA_OUT
209 bool "No DMA out" 203 bool "No DMA out"
210 204
211config CONFIG_ETRAX_SERIAL_PORT1_DMA8_OUT 205config ETRAX_SERIAL_PORT1_DMA8_OUT
212 bool "DMA 8" 206 bool "DMA 8"
213 207
214endchoice 208endchoice
215 209
@@ -218,11 +212,11 @@ choice
218 depends on ETRAX_SERIAL_PORT1 212 depends on ETRAX_SERIAL_PORT1
219 default ETRAX_SERIAL_PORT1_DMA9_IN 213 default ETRAX_SERIAL_PORT1_DMA9_IN
220 214
221config CONFIG_ETRAX_SERIAL_PORT1_NO_DMA_IN 215config ETRAX_SERIAL_PORT1_NO_DMA_IN
222 bool "No DMA in" 216 bool "No DMA in"
223 217
224config CONFIG_ETRAX_SERIAL_PORT1_DMA9_IN 218config ETRAX_SERIAL_PORT1_DMA9_IN
225 bool "DMA 9" 219 bool "DMA 9"
226 220
227endchoice 221endchoice
228 222
@@ -308,7 +302,7 @@ config ETRAX_SER1_CD_ON_PB_BIT
308 Specify the pin of the PB port to carry the CD signal for serial 302 Specify the pin of the PB port to carry the CD signal for serial
309 port 1. 303 port 1.
310 304
311comment "Make sure you dont have the same PB bits more than once!" 305comment "Make sure you do not have the same PB bits more than once!"
312 depends on ETRAX_SERIAL && ETRAX_SER0_DTR_RI_DSR_CD_ON_PB && ETRAX_SER1_DTR_RI_DSR_CD_ON_PB 306 depends on ETRAX_SERIAL && ETRAX_SER0_DTR_RI_DSR_CD_ON_PB && ETRAX_SER1_DTR_RI_DSR_CD_ON_PB
313 307
314config ETRAX_SERIAL_PORT2 308config ETRAX_SERIAL_PORT2
@@ -322,11 +316,11 @@ choice
322 depends on ETRAX_SERIAL_PORT2 316 depends on ETRAX_SERIAL_PORT2
323 default ETRAX_SERIAL_PORT2_DMA2_OUT 317 default ETRAX_SERIAL_PORT2_DMA2_OUT
324 318
325config CONFIG_ETRAX_SERIAL_PORT2_NO_DMA_OUT 319config ETRAX_SERIAL_PORT2_NO_DMA_OUT
326 bool "No DMA out" 320 bool "No DMA out"
327 321
328config CONFIG_ETRAX_SERIAL_PORT2_DMA2_OUT 322config ETRAX_SERIAL_PORT2_DMA2_OUT
329 bool "DMA 2" 323 bool "DMA 2"
330 324
331endchoice 325endchoice
332 326
@@ -335,11 +329,11 @@ choice
335 depends on ETRAX_SERIAL_PORT2 329 depends on ETRAX_SERIAL_PORT2
336 default ETRAX_SERIAL_PORT2_DMA3_IN 330 default ETRAX_SERIAL_PORT2_DMA3_IN
337 331
338config CONFIG_ETRAX_SERIAL_PORT2_NO_DMA_IN 332config ETRAX_SERIAL_PORT2_NO_DMA_IN
339 bool "No DMA in" 333 bool "No DMA in"
340 334
341config CONFIG_ETRAX_SERIAL_PORT2_DMA3_IN 335config ETRAX_SERIAL_PORT2_DMA3_IN
342 bool "DMA 3" 336 bool "DMA 3"
343 337
344endchoice 338endchoice
345 339
@@ -436,11 +430,11 @@ choice
436 depends on ETRAX_SERIAL_PORT3 430 depends on ETRAX_SERIAL_PORT3
437 default ETRAX_SERIAL_PORT3_DMA4_OUT 431 default ETRAX_SERIAL_PORT3_DMA4_OUT
438 432
439config CONFIG_ETRAX_SERIAL_PORT3_NO_DMA_OUT 433config ETRAX_SERIAL_PORT3_NO_DMA_OUT
440 bool "No DMA out" 434 bool "No DMA out"
441 435
442config CONFIG_ETRAX_SERIAL_PORT3_DMA4_OUT 436config ETRAX_SERIAL_PORT3_DMA4_OUT
443 bool "DMA 4" 437 bool "DMA 4"
444 438
445endchoice 439endchoice
446 440
@@ -449,11 +443,11 @@ choice
449 depends on ETRAX_SERIAL_PORT3 443 depends on ETRAX_SERIAL_PORT3
450 default ETRAX_SERIAL_PORT3_DMA5_IN 444 default ETRAX_SERIAL_PORT3_DMA5_IN
451 445
452config CONFIG_ETRAX_SERIAL_PORT3_NO_DMA_IN 446config ETRAX_SERIAL_PORT3_NO_DMA_IN
453 bool "No DMA in" 447 bool "No DMA in"
454 448
455config CONFIG_ETRAX_SERIAL_PORT3_DMA5_IN 449config ETRAX_SERIAL_PORT3_DMA5_IN
456 bool "DMA 5" 450 bool "DMA 5"
457 451
458endchoice 452endchoice
459 453
@@ -554,7 +548,6 @@ config ETRAX_IDE
554 select BLK_DEV_IDEDISK 548 select BLK_DEV_IDEDISK
555 select BLK_DEV_IDECD 549 select BLK_DEV_IDECD
556 select BLK_DEV_IDEDMA 550 select BLK_DEV_IDEDMA
557 select DMA_NONPCI
558 help 551 help
559 Enable this to get support for ATA/IDE. 552 Enable this to get support for ATA/IDE.
560 You can't use paralell ports or SCSI ports 553 You can't use paralell ports or SCSI ports
@@ -579,7 +572,7 @@ config ETRAX_IDE_PB7_RESET
579 IDE reset on pin 7 on port B 572 IDE reset on pin 7 on port B
580 573
581config ETRAX_IDE_G27_RESET 574config ETRAX_IDE_G27_RESET
582 bool "Port_G_Bit_27" 575 bool "Port_G_Bit_27"
583 help 576 help
584 IDE reset on pin 27 on port G 577 IDE reset on pin 27 on port G
585 578
@@ -588,30 +581,36 @@ endchoice
588 581
589config ETRAX_USB_HOST 582config ETRAX_USB_HOST
590 bool "USB host" 583 bool "USB host"
584 select USB
591 help 585 help
592 This option enables the host functionality of the ETRAX 100LX 586 This option enables the host functionality of the ETRAX 100LX
593 built-in USB controller. In host mode the controller is designed 587 built-in USB controller. In host mode the controller is designed
594 for CTRL and BULK traffic only, INTR traffic may work as well 588 for CTRL and BULK traffic only, INTR traffic may work as well
595 however (depending on the requirements of timeliness). 589 however (depending on the requirements of timeliness).
596 590
597config USB
598 tristate
599 depends on ETRAX_USB_HOST
600 default y
601
602config ETRAX_USB_HOST_PORT1 591config ETRAX_USB_HOST_PORT1
603 bool " USB port 1 enabled" 592 bool "USB port 1 enabled"
604 depends on ETRAX_USB_HOST 593 depends on ETRAX_USB_HOST
605 default n 594 default n
606 595
607config ETRAX_USB_HOST_PORT2 596config ETRAX_USB_HOST_PORT2
608 bool " USB port 2 enabled" 597 bool "USB port 2 enabled"
609 depends on ETRAX_USB_HOST 598 depends on ETRAX_USB_HOST
610 default n 599 default n
611 600
612config ETRAX_AXISFLASHMAP 601config ETRAX_AXISFLASHMAP
613 bool "Axis flash-map support" 602 bool "Axis flash-map support"
614 depends on ETRAX_ARCH_V10 603 depends on ETRAX_ARCH_V10
604 select MTD
605 select MTD_CFI
606 select MTD_CFI_AMDSTD
607 select MTD_OBSOLETE_CHIPS
608 select MTD_AMDSTD
609 select MTD_CHAR
610 select MTD_BLOCK
611 select MTD_PARTITIONS
612 select MTD_CONCAT
613 select MTD_COMPLEX_MAPPINGS
615 help 614 help
616 This option enables MTD mapping of flash devices. Needed to use 615 This option enables MTD mapping of flash devices. Needed to use
617 flash memories. If unsure, say Y. 616 flash memories. If unsure, say Y.
@@ -627,119 +626,6 @@ config ETRAX_PTABLE_SECTOR
627 for changing this is when the flash block size is bigger 626 for changing this is when the flash block size is bigger
628 than 64kB (e.g. when using two parallel 16 bit flashes). 627 than 64kB (e.g. when using two parallel 16 bit flashes).
629 628
630# here we define the CONFIG_'s necessary to enable MTD support
631# for the flash
632config MTD
633 tristate
634 depends on ETRAX_AXISFLASHMAP
635 default y
636 help
637 Memory Technology Devices are flash, RAM and similar chips, often
638 used for solid state file systems on embedded devices. This option
639 will provide the generic support for MTD drivers to register
640 themselves with the kernel and for potential users of MTD devices
641 to enumerate the devices which are present and obtain a handle on
642 them. It will also allow you to select individual drivers for
643 particular hardware and users of MTD devices. If unsure, say N.
644
645config MTD_CFI
646 tristate
647 depends on ETRAX_AXISFLASHMAP
648 default y
649 help
650 The Common Flash Interface specification was developed by Intel,
651 AMD and other flash manufactures that provides a universal method
652 for probing the capabilities of flash devices. If you wish to
653 support any device that is CFI-compliant, you need to enable this
654 option. Visit <http://www.amd.com/products/nvd/overview/cfi.html>
655 for more information on CFI.
656
657config MTD_CFI_AMDSTD
658 tristate
659 depends on ETRAX_AXISFLASHMAP
660 default y
661 help
662 The Common Flash Interface defines a number of different command
663 sets which a CFI-compliant chip may claim to implement. This code
664 provides support for one of those command sets, used on chips
665 chips including the AMD Am29LV320.
666
667config MTD_OBSOLETE_CHIPS
668 bool
669 depends on ETRAX_AXISFLASHMAP
670 default y
671 help
672 This option does not enable any code directly, but will allow you to
673 select some other chip drivers which are now considered obsolete,
674 because the generic CONFIG_JEDEC_PROBE code above should now detect
675 the chips which are supported by these drivers, and allow the generic
676 CFI-compatible drivers to drive the chips. Say 'N' here unless you have
677 already tried the CONFIG_JEDEC_PROBE method and reported its failure
678 to the MTD mailing list at <linux-mtd@lists.infradead.org>
679
680config MTD_AMDSTD
681 tristate
682 depends on ETRAX_AXISFLASHMAP
683 default y
684 help
685 This option enables support for flash chips using AMD-compatible
686 commands, including some which are not CFI-compatible and hence
687 cannot be used with the CONFIG_MTD_CFI_AMDSTD option.
688
689 It also works on AMD compatible chips that do conform to CFI.
690
691config MTD_CHAR
692 tristate
693 depends on ETRAX_AXISFLASHMAP
694 default y
695 help
696 This provides a character device for each MTD device present in
697 the system, allowing the user to read and write directly to the
698 memory chips, and also use ioctl() to obtain information about
699 the device, or to erase parts of it.
700
701config MTD_BLOCK
702 tristate
703 depends on ETRAX_AXISFLASHMAP
704 default y
705 ---help---
706 Although most flash chips have an erase size too large to be useful
707 as block devices, it is possible to use MTD devices which are based
708 on RAM chips in this manner. This block device is a user of MTD
709 devices performing that function.
710
711 At the moment, it is also required for the Journalling Flash File
712 System(s) to obtain a handle on the MTD device when it's mounted
713 (although JFFS and JFFS2 don't actually use any of the functionality
714 of the mtdblock device).
715
716 Later, it may be extended to perform read/erase/modify/write cycles
717 on flash chips to emulate a smaller block size. Needless to say,
718 this is very unsafe, but could be useful for file systems which are
719 almost never written to.
720
721 You do not need this option for use with the DiskOnChip devices. For
722 those, enable NFTL support (CONFIG_NFTL) instead.
723
724config MTD_PARTITIONS
725 tristate
726 depends on ETRAX_AXISFLASHMAP
727 default y
728 help
729 If you have a device which needs to divide its flash chip(s) up
730 into multiple 'partitions', each of which appears to the user as
731 a separate MTD device, you require this option to be enabled. If
732 unsure, say 'Y'.
733
734 Note, however, that you don't need this option for the DiskOnChip
735 devices. Partitioning on NFTL 'devices' is a different - that's the
736 'normal' form of partitioning used on a block device.
737
738config MTD_CONCAT
739 tristate
740 depends on ETRAX_AXISFLASHMAP
741 default y
742
743config ETRAX_I2C 629config ETRAX_I2C
744 bool "I2C support" 630 bool "I2C support"
745 depends on ETRAX_ARCH_V10 631 depends on ETRAX_ARCH_V10
@@ -752,7 +638,7 @@ config ETRAX_I2C
752 val = ioctl(fd, _IO(ETRAXI2C_IOCTYPE, I2C_READREG), i2c_arg); 638 val = ioctl(fd, _IO(ETRAXI2C_IOCTYPE, I2C_READREG), i2c_arg);
753 639
754# this is true for most products since PB-I2C seems to be somewhat 640# this is true for most products since PB-I2C seems to be somewhat
755# flawed.. 641# flawed..
756config ETRAX_I2C_USES_PB_NOT_PB_I2C 642config ETRAX_I2C_USES_PB_NOT_PB_I2C
757 bool "I2C uses PB not PB-I2C" 643 bool "I2C uses PB not PB-I2C"
758 depends on ETRAX_I2C 644 depends on ETRAX_I2C
@@ -886,7 +772,7 @@ config ETRAX_RTC
886 bool "Real Time Clock support" 772 bool "Real Time Clock support"
887 depends on ETRAX_ARCH_V10 773 depends on ETRAX_ARCH_V10
888 help 774 help
889 Enables drivers for the Real-Time Clock battery-backed chips on 775 Enables drivers for the Real-Time Clock battery-backed chips on
890 some products. The kernel reads the time when booting, and 776 some products. The kernel reads the time when booting, and
891 the date can be set using ioctl(fd, RTC_SET_TIME, &rt) with rt a 777 the date can be set using ioctl(fd, RTC_SET_TIME, &rt) with rt a
892 rtc_time struct (see <file:include/asm-cris/rtc.h>) on the /dev/rtc 778 rtc_time struct (see <file:include/asm-cris/rtc.h>) on the /dev/rtc
@@ -903,13 +789,13 @@ config ETRAX_DS1302
903 bool "DS1302" 789 bool "DS1302"
904 help 790 help
905 Enables the driver for the DS1302 Real-Time Clock battery-backed 791 Enables the driver for the DS1302 Real-Time Clock battery-backed
906 chip on some products. 792 chip on some products.
907 793
908config ETRAX_PCF8563 794config ETRAX_PCF8563
909 bool "PCF8563" 795 bool "PCF8563"
910 help 796 help
911 Enables the driver for the PCF8563 Real-Time Clock battery-backed 797 Enables the driver for the PCF8563 Real-Time Clock battery-backed
912 chip on some products. 798 chip on some products.
913 799
914endchoice 800endchoice
915 801
@@ -954,10 +840,8 @@ config ETRAX_DS1302_TRICKLE_CHARGE
954 help 840 help
955 This controls the initial value of the trickle charge register. 841 This controls the initial value of the trickle charge register.
956 0 = disabled (use this if you are unsure or have a non rechargable battery) 842 0 = disabled (use this if you are unsure or have a non rechargable battery)
957 Otherwise the following values can be OR:ed together to control the 843 Otherwise the following values can be OR:ed together to control the
958 charge current: 844 charge current:
959 1 = 2kohm, 2 = 4kohm, 3 = 4kohm 845 1 = 2kohm, 2 = 4kohm, 3 = 4kohm
960 4 = 1 diode, 8 = 2 diodes 846 4 = 1 diode, 8 = 2 diodes
961 Allowed values are (increasing current): 0, 11, 10, 9, 7, 6, 5 847 Allowed values are (increasing current): 0, 11, 10, 9, 7, 6, 5
962
963
diff --git a/arch/cris/arch-v10/drivers/axisflashmap.c b/arch/cris/arch-v10/drivers/axisflashmap.c
index fb7d4855ea62..11ab3836aac6 100644
--- a/arch/cris/arch-v10/drivers/axisflashmap.c
+++ b/arch/cris/arch-v10/drivers/axisflashmap.c
@@ -11,6 +11,9 @@
11 * partition split defined below. 11 * partition split defined below.
12 * 12 *
13 * $Log: axisflashmap.c,v $ 13 * $Log: axisflashmap.c,v $
14 * Revision 1.11 2004/11/15 10:27:14 starvik
15 * Corrected typo (Thanks to Milton Miller <miltonm@bga.com>).
16 *
14 * Revision 1.10 2004/08/16 12:37:22 starvik 17 * Revision 1.10 2004/08/16 12:37:22 starvik
15 * Merge of Linux 2.6.8 18 * Merge of Linux 2.6.8
16 * 19 *
@@ -161,7 +164,7 @@
161#elif CONFIG_ETRAX_FLASH_BUSWIDTH==2 164#elif CONFIG_ETRAX_FLASH_BUSWIDTH==2
162#define flash_data __u16 165#define flash_data __u16
163#elif CONFIG_ETRAX_FLASH_BUSWIDTH==4 166#elif CONFIG_ETRAX_FLASH_BUSWIDTH==4
164#define flash_data __u16 167#define flash_data __u32
165#endif 168#endif
166 169
167/* From head.S */ 170/* From head.S */
diff --git a/arch/cris/arch-v10/drivers/ds1302.c b/arch/cris/arch-v10/drivers/ds1302.c
index fba530fcfaeb..10795f67f687 100644
--- a/arch/cris/arch-v10/drivers/ds1302.c
+++ b/arch/cris/arch-v10/drivers/ds1302.c
@@ -7,6 +7,15 @@
7*! Functions exported: ds1302_readreg, ds1302_writereg, ds1302_init 7*! Functions exported: ds1302_readreg, ds1302_writereg, ds1302_init
8*! 8*!
9*! $Log: ds1302.c,v $ 9*! $Log: ds1302.c,v $
10*! Revision 1.18 2005/01/24 09:11:26 mikaelam
11*! Minor changes to get DS1302 RTC chip driver to work
12*!
13*! Revision 1.17 2005/01/05 06:11:22 starvik
14*! No need to do local_irq_disable after local_irq_save.
15*!
16*! Revision 1.16 2004/12/13 12:21:52 starvik
17*! Added I/O and DMA allocators from Linux 2.4
18*!
10*! Revision 1.14 2004/08/24 06:48:43 starvik 19*! Revision 1.14 2004/08/24 06:48:43 starvik
11*! Whitespace cleanup 20*! Whitespace cleanup
12*! 21*!
@@ -124,9 +133,9 @@
124*! 133*!
125*! --------------------------------------------------------------------------- 134*! ---------------------------------------------------------------------------
126*! 135*!
127*! (C) Copyright 1999, 2000, 2001 Axis Communications AB, LUND, SWEDEN 136*! (C) Copyright 1999, 2000, 2001, 2002, 2003, 2004 Axis Communications AB, LUND, SWEDEN
128*! 137*!
129*! $Id: ds1302.c,v 1.14 2004/08/24 06:48:43 starvik Exp $ 138*! $Id: ds1302.c,v 1.18 2005/01/24 09:11:26 mikaelam Exp $
130*! 139*!
131*!***************************************************************************/ 140*!***************************************************************************/
132 141
@@ -145,6 +154,7 @@
145#include <asm/arch/svinto.h> 154#include <asm/arch/svinto.h>
146#include <asm/io.h> 155#include <asm/io.h>
147#include <asm/rtc.h> 156#include <asm/rtc.h>
157#include <asm/arch/io_interface_mux.h>
148 158
149#define RTC_MAJOR_NR 121 /* local major, change later */ 159#define RTC_MAJOR_NR 121 /* local major, change later */
150 160
@@ -320,7 +330,6 @@ get_rtc_time(struct rtc_time *rtc_tm)
320 unsigned long flags; 330 unsigned long flags;
321 331
322 local_irq_save(flags); 332 local_irq_save(flags);
323 local_irq_disable();
324 333
325 rtc_tm->tm_sec = CMOS_READ(RTC_SECONDS); 334 rtc_tm->tm_sec = CMOS_READ(RTC_SECONDS);
326 rtc_tm->tm_min = CMOS_READ(RTC_MINUTES); 335 rtc_tm->tm_min = CMOS_READ(RTC_MINUTES);
@@ -358,7 +367,7 @@ static int
358rtc_ioctl(struct inode *inode, struct file *file, unsigned int cmd, 367rtc_ioctl(struct inode *inode, struct file *file, unsigned int cmd,
359 unsigned long arg) 368 unsigned long arg)
360{ 369{
361 unsigned long flags; 370 unsigned long flags;
362 371
363 switch(cmd) { 372 switch(cmd) {
364 case RTC_RD_TIME: /* read the time/date from RTC */ 373 case RTC_RD_TIME: /* read the time/date from RTC */
@@ -382,7 +391,7 @@ rtc_ioctl(struct inode *inode, struct file *file, unsigned int cmd,
382 return -EPERM; 391 return -EPERM;
383 392
384 if (copy_from_user(&rtc_tm, (struct rtc_time*)arg, sizeof(struct rtc_time))) 393 if (copy_from_user(&rtc_tm, (struct rtc_time*)arg, sizeof(struct rtc_time)))
385 return -EFAULT; 394 return -EFAULT;
386 395
387 yrs = rtc_tm.tm_year + 1900; 396 yrs = rtc_tm.tm_year + 1900;
388 mon = rtc_tm.tm_mon + 1; /* tm_mon starts at zero */ 397 mon = rtc_tm.tm_mon + 1; /* tm_mon starts at zero */
@@ -419,7 +428,6 @@ rtc_ioctl(struct inode *inode, struct file *file, unsigned int cmd,
419 BIN_TO_BCD(yrs); 428 BIN_TO_BCD(yrs);
420 429
421 local_irq_save(flags); 430 local_irq_save(flags);
422 local_irq_disable();
423 CMOS_WRITE(yrs, RTC_YEAR); 431 CMOS_WRITE(yrs, RTC_YEAR);
424 CMOS_WRITE(mon, RTC_MONTH); 432 CMOS_WRITE(mon, RTC_MONTH);
425 CMOS_WRITE(day, RTC_DAY_OF_MONTH); 433 CMOS_WRITE(day, RTC_DAY_OF_MONTH);
@@ -438,7 +446,7 @@ rtc_ioctl(struct inode *inode, struct file *file, unsigned int cmd,
438 446
439 case RTC_SET_CHARGE: /* set the RTC TRICKLE CHARGE register */ 447 case RTC_SET_CHARGE: /* set the RTC TRICKLE CHARGE register */
440 { 448 {
441 int tcs_val; 449 int tcs_val;
442 450
443 if (!capable(CAP_SYS_TIME)) 451 if (!capable(CAP_SYS_TIME))
444 return -EPERM; 452 return -EPERM;
@@ -492,8 +500,8 @@ print_rtc_status(void)
492/* The various file operations we support. */ 500/* The various file operations we support. */
493 501
494static struct file_operations rtc_fops = { 502static struct file_operations rtc_fops = {
495 .owner = THIS_MODULE, 503 .owner = THIS_MODULE,
496 .ioctl = rtc_ioctl, 504 .ioctl = rtc_ioctl,
497}; 505};
498 506
499/* Probe for the chip by writing something to its RAM and try reading it back. */ 507/* Probe for the chip by writing something to its RAM and try reading it back. */
@@ -532,7 +540,7 @@ ds1302_probe(void)
532 "PB", 540 "PB",
533#endif 541#endif
534 CONFIG_ETRAX_DS1302_RSTBIT); 542 CONFIG_ETRAX_DS1302_RSTBIT);
535 print_rtc_status(); 543 print_rtc_status();
536 retval = 1; 544 retval = 1;
537 } else { 545 } else {
538 stop(); 546 stop();
@@ -548,7 +556,9 @@ ds1302_probe(void)
548int __init 556int __init
549ds1302_init(void) 557ds1302_init(void)
550{ 558{
559#ifdef CONFIG_ETRAX_I2C
551 i2c_init(); 560 i2c_init();
561#endif
552 562
553 if (!ds1302_probe()) { 563 if (!ds1302_probe()) {
554#ifdef CONFIG_ETRAX_DS1302_RST_ON_GENERIC_PORT 564#ifdef CONFIG_ETRAX_DS1302_RST_ON_GENERIC_PORT
@@ -558,25 +568,42 @@ ds1302_init(void)
558 * 568 *
559 * Make sure that R_GEN_CONFIG is setup correct. 569 * Make sure that R_GEN_CONFIG is setup correct.
560 */ 570 */
561 genconfig_shadow = ((genconfig_shadow & 571 /* Allocating the ATA interface will grab almost all
562 ~IO_MASK(R_GEN_CONFIG, ata)) | 572 * pins in I/O groups a, b, c and d. A consequence of
563 (IO_STATE(R_GEN_CONFIG, ata, select))); 573 * allocating the ATA interface is that the fixed
564 *R_GEN_CONFIG = genconfig_shadow; 574 * interfaces shared RAM, parallel port 0, parallel
575 * port 1, parallel port W, SCSI-8 port 0, SCSI-8 port
576 * 1, SCSI-W, serial port 2, serial port 3,
577 * synchronous serial port 3 and USB port 2 and almost
578 * all GPIO pins on port g cannot be used.
579 */
580 if (cris_request_io_interface(if_ata, "ds1302/ATA")) {
581 printk(KERN_WARNING "ds1302: Failed to get IO interface\n");
582 return -1;
583 }
584
565#elif CONFIG_ETRAX_DS1302_RSTBIT == 0 585#elif CONFIG_ETRAX_DS1302_RSTBIT == 0
566 586 if (cris_io_interface_allocate_pins(if_gpio_grp_a,
567 /* Set the direction of this bit to out. */ 587 'g',
568 genconfig_shadow = ((genconfig_shadow & 588 CONFIG_ETRAX_DS1302_RSTBIT,
569 ~IO_MASK(R_GEN_CONFIG, g0dir)) | 589 CONFIG_ETRAX_DS1302_RSTBIT)) {
570 (IO_STATE(R_GEN_CONFIG, g0dir, out))); 590 printk(KERN_WARNING "ds1302: Failed to get IO interface\n");
571 *R_GEN_CONFIG = genconfig_shadow; 591 return -1;
592 }
593
594 /* Set the direction of this bit to out. */
595 genconfig_shadow = ((genconfig_shadow &
596 ~IO_MASK(R_GEN_CONFIG, g0dir)) |
597 (IO_STATE(R_GEN_CONFIG, g0dir, out)));
598 *R_GEN_CONFIG = genconfig_shadow;
572#endif 599#endif
573 if (!ds1302_probe()) { 600 if (!ds1302_probe()) {
574 printk(KERN_WARNING "%s: RTC not found.\n", ds1302_name); 601 printk(KERN_WARNING "%s: RTC not found.\n", ds1302_name);
575 return -1; 602 return -1;
576 } 603 }
577#else 604#else
578 printk(KERN_WARNING "%s: RTC not found.\n", ds1302_name); 605 printk(KERN_WARNING "%s: RTC not found.\n", ds1302_name);
579 return -1; 606 return -1;
580#endif 607#endif
581 } 608 }
582 /* Initialise trickle charger */ 609 /* Initialise trickle charger */
diff --git a/arch/cris/arch-v10/drivers/eeprom.c b/arch/cris/arch-v10/drivers/eeprom.c
index 316ca15d6802..512f16dec060 100644
--- a/arch/cris/arch-v10/drivers/eeprom.c
+++ b/arch/cris/arch-v10/drivers/eeprom.c
@@ -20,6 +20,12 @@
20*! in the spin-lock. 20*! in the spin-lock.
21*! 21*!
22*! $Log: eeprom.c,v $ 22*! $Log: eeprom.c,v $
23*! Revision 1.12 2005/06/19 17:06:46 starvik
24*! Merge of Linux 2.6.12.
25*!
26*! Revision 1.11 2005/01/26 07:14:46 starvik
27*! Applied diff from kernel janitors (Nish Aravamudan).
28*!
23*! Revision 1.10 2003/09/11 07:29:48 starvik 29*! Revision 1.10 2003/09/11 07:29:48 starvik
24*! Merge of Linux 2.6.0-test5 30*! Merge of Linux 2.6.0-test5
25*! 31*!
@@ -94,6 +100,7 @@
94#include <linux/init.h> 100#include <linux/init.h>
95#include <linux/delay.h> 101#include <linux/delay.h>
96#include <linux/interrupt.h> 102#include <linux/interrupt.h>
103#include <linux/wait.h>
97#include <asm/uaccess.h> 104#include <asm/uaccess.h>
98#include "i2c.h" 105#include "i2c.h"
99 106
@@ -526,15 +533,10 @@ static ssize_t eeprom_read(struct file * file, char * buf, size_t count, loff_t
526 return -EFAULT; 533 return -EFAULT;
527 } 534 }
528 535
529 while(eeprom.busy) 536 wait_event_interruptible(eeprom.wait_q, !eeprom.busy);
530 { 537 if (signal_pending(current))
531 interruptible_sleep_on(&eeprom.wait_q); 538 return -EINTR;
532 539
533 /* bail out if we get interrupted */
534 if (signal_pending(current))
535 return -EINTR;
536
537 }
538 eeprom.busy++; 540 eeprom.busy++;
539 541
540 page = (unsigned char) (p >> 8); 542 page = (unsigned char) (p >> 8);
@@ -604,13 +606,10 @@ static ssize_t eeprom_write(struct file * file, const char * buf, size_t count,
604 return -EFAULT; 606 return -EFAULT;
605 } 607 }
606 608
607 while(eeprom.busy) 609 wait_event_interruptible(eeprom.wait_q, !eeprom.busy);
608 { 610 /* bail out if we get interrupted */
609 interruptible_sleep_on(&eeprom.wait_q); 611 if (signal_pending(current))
610 /* bail out if we get interrupted */ 612 return -EINTR;
611 if (signal_pending(current))
612 return -EINTR;
613 }
614 eeprom.busy++; 613 eeprom.busy++;
615 for(i = 0; (i < EEPROM_RETRIES) && (restart > 0); i++) 614 for(i = 0; (i < EEPROM_RETRIES) && (restart > 0); i++)
616 { 615 {
diff --git a/arch/cris/arch-v10/drivers/gpio.c b/arch/cris/arch-v10/drivers/gpio.c
index c095de82a0da..09963fe299a7 100644
--- a/arch/cris/arch-v10/drivers/gpio.c
+++ b/arch/cris/arch-v10/drivers/gpio.c
@@ -1,4 +1,4 @@
1/* $Id: gpio.c,v 1.12 2004/08/24 07:19:59 starvik Exp $ 1/* $Id: gpio.c,v 1.17 2005/06/19 17:06:46 starvik Exp $
2 * 2 *
3 * Etrax general port I/O device 3 * Etrax general port I/O device
4 * 4 *
@@ -9,6 +9,18 @@
9 * Johan Adolfsson (read/set directions, write, port G) 9 * Johan Adolfsson (read/set directions, write, port G)
10 * 10 *
11 * $Log: gpio.c,v $ 11 * $Log: gpio.c,v $
12 * Revision 1.17 2005/06/19 17:06:46 starvik
13 * Merge of Linux 2.6.12.
14 *
15 * Revision 1.16 2005/03/07 13:02:29 starvik
16 * Protect driver global states with spinlock
17 *
18 * Revision 1.15 2005/01/05 06:08:55 starvik
19 * No need to do local_irq_disable after local_irq_save.
20 *
21 * Revision 1.14 2004/12/13 12:21:52 starvik
22 * Added I/O and DMA allocators from Linux 2.4
23 *
12 * Revision 1.12 2004/08/24 07:19:59 starvik 24 * Revision 1.12 2004/08/24 07:19:59 starvik
13 * Whitespace cleanup 25 * Whitespace cleanup
14 * 26 *
@@ -142,6 +154,7 @@
142#include <asm/io.h> 154#include <asm/io.h>
143#include <asm/system.h> 155#include <asm/system.h>
144#include <asm/irq.h> 156#include <asm/irq.h>
157#include <asm/arch/io_interface_mux.h>
145 158
146#define GPIO_MAJOR 120 /* experimental MAJOR number */ 159#define GPIO_MAJOR 120 /* experimental MAJOR number */
147 160
@@ -194,6 +207,8 @@ static struct gpio_private *alarmlist = 0;
194static int gpio_some_alarms = 0; /* Set if someone uses alarm */ 207static int gpio_some_alarms = 0; /* Set if someone uses alarm */
195static unsigned long gpio_pa_irq_enabled_mask = 0; 208static unsigned long gpio_pa_irq_enabled_mask = 0;
196 209
210static DEFINE_SPINLOCK(gpio_lock); /* Protect directions etc */
211
197/* Port A and B use 8 bit access, but Port G is 32 bit */ 212/* Port A and B use 8 bit access, but Port G is 32 bit */
198#define NUM_PORTS (GPIO_MINOR_B+1) 213#define NUM_PORTS (GPIO_MINOR_B+1)
199 214
@@ -241,6 +256,9 @@ static volatile unsigned char *dir_shadow[NUM_PORTS] = {
241 &port_pb_dir_shadow 256 &port_pb_dir_shadow
242}; 257};
243 258
259/* All bits in port g that can change dir. */
260static const unsigned long int changeable_dir_g_mask = 0x01FFFF01;
261
244/* Port G is 32 bit, handle it special, some bits are both inputs 262/* Port G is 32 bit, handle it special, some bits are both inputs
245 and outputs at the same time, only some of the bits can change direction 263 and outputs at the same time, only some of the bits can change direction
246 and some of them in groups of 8 bit. */ 264 and some of them in groups of 8 bit. */
@@ -260,6 +278,7 @@ gpio_poll(struct file *file,
260 unsigned int mask = 0; 278 unsigned int mask = 0;
261 struct gpio_private *priv = (struct gpio_private *)file->private_data; 279 struct gpio_private *priv = (struct gpio_private *)file->private_data;
262 unsigned long data; 280 unsigned long data;
281 spin_lock(&gpio_lock);
263 poll_wait(file, &priv->alarm_wq, wait); 282 poll_wait(file, &priv->alarm_wq, wait);
264 if (priv->minor == GPIO_MINOR_A) { 283 if (priv->minor == GPIO_MINOR_A) {
265 unsigned long flags; 284 unsigned long flags;
@@ -270,10 +289,10 @@ gpio_poll(struct file *file,
270 */ 289 */
271 tmp = ~data & priv->highalarm & 0xFF; 290 tmp = ~data & priv->highalarm & 0xFF;
272 tmp = (tmp << R_IRQ_MASK1_SET__pa0__BITNR); 291 tmp = (tmp << R_IRQ_MASK1_SET__pa0__BITNR);
273 save_flags(flags); cli(); 292 local_irq_save(flags);
274 gpio_pa_irq_enabled_mask |= tmp; 293 gpio_pa_irq_enabled_mask |= tmp;
275 *R_IRQ_MASK1_SET = tmp; 294 *R_IRQ_MASK1_SET = tmp;
276 restore_flags(flags); 295 local_irq_restore(flags);
277 296
278 } else if (priv->minor == GPIO_MINOR_B) 297 } else if (priv->minor == GPIO_MINOR_B)
279 data = *R_PORT_PB_DATA; 298 data = *R_PORT_PB_DATA;
@@ -286,8 +305,11 @@ gpio_poll(struct file *file,
286 (~data & priv->lowalarm)) { 305 (~data & priv->lowalarm)) {
287 mask = POLLIN|POLLRDNORM; 306 mask = POLLIN|POLLRDNORM;
288 } 307 }
308
309 spin_unlock(&gpio_lock);
289 310
290 DP(printk("gpio_poll ready: mask 0x%08X\n", mask)); 311 DP(printk("gpio_poll ready: mask 0x%08X\n", mask));
312
291 return mask; 313 return mask;
292} 314}
293 315
@@ -296,6 +318,7 @@ int etrax_gpio_wake_up_check(void)
296 struct gpio_private *priv = alarmlist; 318 struct gpio_private *priv = alarmlist;
297 unsigned long data = 0; 319 unsigned long data = 0;
298 int ret = 0; 320 int ret = 0;
321 spin_lock(&gpio_lock);
299 while (priv) { 322 while (priv) {
300 if (USE_PORTS(priv)) { 323 if (USE_PORTS(priv)) {
301 data = *priv->port; 324 data = *priv->port;
@@ -310,6 +333,7 @@ int etrax_gpio_wake_up_check(void)
310 } 333 }
311 priv = priv->next; 334 priv = priv->next;
312 } 335 }
336 spin_unlock(&gpio_lock);
313 return ret; 337 return ret;
314} 338}
315 339
@@ -327,6 +351,7 @@ static irqreturn_t
327gpio_pa_interrupt(int irq, void *dev_id, struct pt_regs *regs) 351gpio_pa_interrupt(int irq, void *dev_id, struct pt_regs *regs)
328{ 352{
329 unsigned long tmp; 353 unsigned long tmp;
354 spin_lock(&gpio_lock);
330 /* Find what PA interrupts are active */ 355 /* Find what PA interrupts are active */
331 tmp = (*R_IRQ_READ1); 356 tmp = (*R_IRQ_READ1);
332 357
@@ -337,6 +362,8 @@ gpio_pa_interrupt(int irq, void *dev_id, struct pt_regs *regs)
337 *R_IRQ_MASK1_CLR = tmp; 362 *R_IRQ_MASK1_CLR = tmp;
338 gpio_pa_irq_enabled_mask &= ~tmp; 363 gpio_pa_irq_enabled_mask &= ~tmp;
339 364
365 spin_unlock(&gpio_lock);
366
340 if (gpio_some_alarms) { 367 if (gpio_some_alarms) {
341 return IRQ_RETVAL(etrax_gpio_wake_up_check()); 368 return IRQ_RETVAL(etrax_gpio_wake_up_check());
342 } 369 }
@@ -350,6 +377,9 @@ static ssize_t gpio_write(struct file * file, const char * buf, size_t count,
350 struct gpio_private *priv = (struct gpio_private *)file->private_data; 377 struct gpio_private *priv = (struct gpio_private *)file->private_data;
351 unsigned char data, clk_mask, data_mask, write_msb; 378 unsigned char data, clk_mask, data_mask, write_msb;
352 unsigned long flags; 379 unsigned long flags;
380
381 spin_lock(&gpio_lock);
382
353 ssize_t retval = count; 383 ssize_t retval = count;
354 if (priv->minor !=GPIO_MINOR_A && priv->minor != GPIO_MINOR_B) { 384 if (priv->minor !=GPIO_MINOR_A && priv->minor != GPIO_MINOR_B) {
355 return -EFAULT; 385 return -EFAULT;
@@ -372,7 +402,7 @@ static ssize_t gpio_write(struct file * file, const char * buf, size_t count,
372 data = *buf++; 402 data = *buf++;
373 if (priv->write_msb) { 403 if (priv->write_msb) {
374 for (i = 7; i >= 0;i--) { 404 for (i = 7; i >= 0;i--) {
375 local_irq_save(flags); local_irq_disable(); 405 local_irq_save(flags);
376 *priv->port = *priv->shadow &= ~clk_mask; 406 *priv->port = *priv->shadow &= ~clk_mask;
377 if (data & 1<<i) 407 if (data & 1<<i)
378 *priv->port = *priv->shadow |= data_mask; 408 *priv->port = *priv->shadow |= data_mask;
@@ -384,7 +414,7 @@ static ssize_t gpio_write(struct file * file, const char * buf, size_t count,
384 } 414 }
385 } else { 415 } else {
386 for (i = 0; i <= 7;i++) { 416 for (i = 0; i <= 7;i++) {
387 local_irq_save(flags); local_irq_disable(); 417 local_irq_save(flags);
388 *priv->port = *priv->shadow &= ~clk_mask; 418 *priv->port = *priv->shadow &= ~clk_mask;
389 if (data & 1<<i) 419 if (data & 1<<i)
390 *priv->port = *priv->shadow |= data_mask; 420 *priv->port = *priv->shadow |= data_mask;
@@ -396,6 +426,7 @@ static ssize_t gpio_write(struct file * file, const char * buf, size_t count,
396 } 426 }
397 } 427 }
398 } 428 }
429 spin_unlock(&gpio_lock);
399 return retval; 430 return retval;
400} 431}
401 432
@@ -452,9 +483,14 @@ gpio_open(struct inode *inode, struct file *filp)
452static int 483static int
453gpio_release(struct inode *inode, struct file *filp) 484gpio_release(struct inode *inode, struct file *filp)
454{ 485{
455 struct gpio_private *p = alarmlist; 486 struct gpio_private *p;
456 struct gpio_private *todel = (struct gpio_private *)filp->private_data; 487 struct gpio_private *todel;
457 488
489 spin_lock(&gpio_lock);
490
491 p = alarmlist;
492 todel = (struct gpio_private *)filp->private_data;
493
458 /* unlink from alarmlist and free the private structure */ 494 /* unlink from alarmlist and free the private structure */
459 495
460 if (p == todel) { 496 if (p == todel) {
@@ -476,7 +512,7 @@ gpio_release(struct inode *inode, struct file *filp)
476 p = p->next; 512 p = p->next;
477 } 513 }
478 gpio_some_alarms = 0; 514 gpio_some_alarms = 0;
479 515 spin_unlock(&gpio_lock);
480 return 0; 516 return 0;
481} 517}
482 518
@@ -491,14 +527,14 @@ unsigned long inline setget_input(struct gpio_private *priv, unsigned long arg)
491 */ 527 */
492 unsigned long flags; 528 unsigned long flags;
493 if (USE_PORTS(priv)) { 529 if (USE_PORTS(priv)) {
494 local_irq_save(flags); local_irq_disable(); 530 local_irq_save(flags);
495 *priv->dir = *priv->dir_shadow &= 531 *priv->dir = *priv->dir_shadow &=
496 ~((unsigned char)arg & priv->changeable_dir); 532 ~((unsigned char)arg & priv->changeable_dir);
497 local_irq_restore(flags); 533 local_irq_restore(flags);
498 return ~(*priv->dir_shadow) & 0xFF; /* Only 8 bits */ 534 return ~(*priv->dir_shadow) & 0xFF; /* Only 8 bits */
499 } else if (priv->minor == GPIO_MINOR_G) { 535 } else if (priv->minor == GPIO_MINOR_G) {
500 /* We must fiddle with R_GEN_CONFIG to change dir */ 536 /* We must fiddle with R_GEN_CONFIG to change dir */
501 save_flags(flags); cli(); 537 local_irq_save(flags);
502 if (((arg & dir_g_in_bits) != arg) && 538 if (((arg & dir_g_in_bits) != arg) &&
503 (arg & changeable_dir_g)) { 539 (arg & changeable_dir_g)) {
504 arg &= changeable_dir_g; 540 arg &= changeable_dir_g;
@@ -533,7 +569,7 @@ unsigned long inline setget_input(struct gpio_private *priv, unsigned long arg)
533 /* Must be a >120 ns delay before writing this again */ 569 /* Must be a >120 ns delay before writing this again */
534 570
535 } 571 }
536 restore_flags(flags); 572 local_irq_restore(flags);
537 return dir_g_in_bits; 573 return dir_g_in_bits;
538 } 574 }
539 return 0; 575 return 0;
@@ -543,14 +579,14 @@ unsigned long inline setget_output(struct gpio_private *priv, unsigned long arg)
543{ 579{
544 unsigned long flags; 580 unsigned long flags;
545 if (USE_PORTS(priv)) { 581 if (USE_PORTS(priv)) {
546 local_irq_save(flags); local_irq_disable(); 582 local_irq_save(flags);
547 *priv->dir = *priv->dir_shadow |= 583 *priv->dir = *priv->dir_shadow |=
548 ((unsigned char)arg & priv->changeable_dir); 584 ((unsigned char)arg & priv->changeable_dir);
549 local_irq_restore(flags); 585 local_irq_restore(flags);
550 return *priv->dir_shadow; 586 return *priv->dir_shadow;
551 } else if (priv->minor == GPIO_MINOR_G) { 587 } else if (priv->minor == GPIO_MINOR_G) {
552 /* We must fiddle with R_GEN_CONFIG to change dir */ 588 /* We must fiddle with R_GEN_CONFIG to change dir */
553 save_flags(flags); cli(); 589 local_irq_save(flags);
554 if (((arg & dir_g_out_bits) != arg) && 590 if (((arg & dir_g_out_bits) != arg) &&
555 (arg & changeable_dir_g)) { 591 (arg & changeable_dir_g)) {
556 /* Set bits in genconfig to set to output */ 592 /* Set bits in genconfig to set to output */
@@ -583,7 +619,7 @@ unsigned long inline setget_output(struct gpio_private *priv, unsigned long arg)
583 *R_GEN_CONFIG = genconfig_shadow; 619 *R_GEN_CONFIG = genconfig_shadow;
584 /* Must be a >120 ns delay before writing this again */ 620 /* Must be a >120 ns delay before writing this again */
585 } 621 }
586 restore_flags(flags); 622 local_irq_restore(flags);
587 return dir_g_out_bits & 0x7FFFFFFF; 623 return dir_g_out_bits & 0x7FFFFFFF;
588 } 624 }
589 return 0; 625 return 0;
@@ -598,22 +634,26 @@ gpio_ioctl(struct inode *inode, struct file *file,
598{ 634{
599 unsigned long flags; 635 unsigned long flags;
600 unsigned long val; 636 unsigned long val;
637 int ret = 0;
638
601 struct gpio_private *priv = (struct gpio_private *)file->private_data; 639 struct gpio_private *priv = (struct gpio_private *)file->private_data;
602 if (_IOC_TYPE(cmd) != ETRAXGPIO_IOCTYPE) { 640 if (_IOC_TYPE(cmd) != ETRAXGPIO_IOCTYPE) {
603 return -EINVAL; 641 return -EINVAL;
604 } 642 }
605 643
644 spin_lock(&gpio_lock);
645
606 switch (_IOC_NR(cmd)) { 646 switch (_IOC_NR(cmd)) {
607 case IO_READBITS: /* Use IO_READ_INBITS and IO_READ_OUTBITS instead */ 647 case IO_READBITS: /* Use IO_READ_INBITS and IO_READ_OUTBITS instead */
608 // read the port 648 // read the port
609 if (USE_PORTS(priv)) { 649 if (USE_PORTS(priv)) {
610 return *priv->port; 650 ret = *priv->port;
611 } else if (priv->minor == GPIO_MINOR_G) { 651 } else if (priv->minor == GPIO_MINOR_G) {
612 return (*R_PORT_G_DATA) & 0x7FFFFFFF; 652 ret = (*R_PORT_G_DATA) & 0x7FFFFFFF;
613 } 653 }
614 break; 654 break;
615 case IO_SETBITS: 655 case IO_SETBITS:
616 local_irq_save(flags); local_irq_disable(); 656 local_irq_save(flags);
617 // set changeable bits with a 1 in arg 657 // set changeable bits with a 1 in arg
618 if (USE_PORTS(priv)) { 658 if (USE_PORTS(priv)) {
619 *priv->port = *priv->shadow |= 659 *priv->port = *priv->shadow |=
@@ -624,7 +664,7 @@ gpio_ioctl(struct inode *inode, struct file *file,
624 local_irq_restore(flags); 664 local_irq_restore(flags);
625 break; 665 break;
626 case IO_CLRBITS: 666 case IO_CLRBITS:
627 local_irq_save(flags); local_irq_disable(); 667 local_irq_save(flags);
628 // clear changeable bits with a 1 in arg 668 // clear changeable bits with a 1 in arg
629 if (USE_PORTS(priv)) { 669 if (USE_PORTS(priv)) {
630 *priv->port = *priv->shadow &= 670 *priv->port = *priv->shadow &=
@@ -666,33 +706,34 @@ gpio_ioctl(struct inode *inode, struct file *file,
666 case IO_READDIR: /* Use IO_SETGET_INPUT/OUTPUT instead! */ 706 case IO_READDIR: /* Use IO_SETGET_INPUT/OUTPUT instead! */
667 /* Read direction 0=input 1=output */ 707 /* Read direction 0=input 1=output */
668 if (USE_PORTS(priv)) { 708 if (USE_PORTS(priv)) {
669 return *priv->dir_shadow; 709 ret = *priv->dir_shadow;
670 } else if (priv->minor == GPIO_MINOR_G) { 710 } else if (priv->minor == GPIO_MINOR_G) {
671 /* Note: Some bits are both in and out, 711 /* Note: Some bits are both in and out,
672 * Those that are dual is set here as well. 712 * Those that are dual is set here as well.
673 */ 713 */
674 return (dir_g_shadow | dir_g_out_bits) & 0x7FFFFFFF; 714 ret = (dir_g_shadow | dir_g_out_bits) & 0x7FFFFFFF;
675 } 715 }
716 break;
676 case IO_SETINPUT: /* Use IO_SETGET_INPUT instead! */ 717 case IO_SETINPUT: /* Use IO_SETGET_INPUT instead! */
677 /* Set direction 0=unchanged 1=input, 718 /* Set direction 0=unchanged 1=input,
678 * return mask with 1=input 719 * return mask with 1=input
679 */ 720 */
680 return setget_input(priv, arg) & 0x7FFFFFFF; 721 ret = setget_input(priv, arg) & 0x7FFFFFFF;
681 break; 722 break;
682 case IO_SETOUTPUT: /* Use IO_SETGET_OUTPUT instead! */ 723 case IO_SETOUTPUT: /* Use IO_SETGET_OUTPUT instead! */
683 /* Set direction 0=unchanged 1=output, 724 /* Set direction 0=unchanged 1=output,
684 * return mask with 1=output 725 * return mask with 1=output
685 */ 726 */
686 return setget_output(priv, arg) & 0x7FFFFFFF; 727 ret = setget_output(priv, arg) & 0x7FFFFFFF;
687 728 break;
688 case IO_SHUTDOWN: 729 case IO_SHUTDOWN:
689 SOFT_SHUTDOWN(); 730 SOFT_SHUTDOWN();
690 break; 731 break;
691 case IO_GET_PWR_BT: 732 case IO_GET_PWR_BT:
692#if defined (CONFIG_ETRAX_SOFT_SHUTDOWN) 733#if defined (CONFIG_ETRAX_SOFT_SHUTDOWN)
693 return (*R_PORT_G_DATA & ( 1 << CONFIG_ETRAX_POWERBUTTON_BIT)); 734 ret = (*R_PORT_G_DATA & ( 1 << CONFIG_ETRAX_POWERBUTTON_BIT));
694#else 735#else
695 return 0; 736 ret = 0;
696#endif 737#endif
697 break; 738 break;
698 case IO_CFG_WRITE_MODE: 739 case IO_CFG_WRITE_MODE:
@@ -709,7 +750,7 @@ gpio_ioctl(struct inode *inode, struct file *file,
709 { 750 {
710 priv->clk_mask = 0; 751 priv->clk_mask = 0;
711 priv->data_mask = 0; 752 priv->data_mask = 0;
712 return -EPERM; 753 ret = -EPERM;
713 } 754 }
714 break; 755 break;
715 case IO_READ_INBITS: 756 case IO_READ_INBITS:
@@ -720,8 +761,7 @@ gpio_ioctl(struct inode *inode, struct file *file,
720 val = *R_PORT_G_DATA; 761 val = *R_PORT_G_DATA;
721 } 762 }
722 if (copy_to_user((unsigned long*)arg, &val, sizeof(val))) 763 if (copy_to_user((unsigned long*)arg, &val, sizeof(val)))
723 return -EFAULT; 764 ret = -EFAULT;
724 return 0;
725 break; 765 break;
726 case IO_READ_OUTBITS: 766 case IO_READ_OUTBITS:
727 /* *arg is result of reading the output shadow */ 767 /* *arg is result of reading the output shadow */
@@ -731,36 +771,43 @@ gpio_ioctl(struct inode *inode, struct file *file,
731 val = port_g_data_shadow; 771 val = port_g_data_shadow;
732 } 772 }
733 if (copy_to_user((unsigned long*)arg, &val, sizeof(val))) 773 if (copy_to_user((unsigned long*)arg, &val, sizeof(val)))
734 return -EFAULT; 774 ret = -EFAULT;
735 break; 775 break;
736 case IO_SETGET_INPUT: 776 case IO_SETGET_INPUT:
737 /* bits set in *arg is set to input, 777 /* bits set in *arg is set to input,
738 * *arg updated with current input pins. 778 * *arg updated with current input pins.
739 */ 779 */
740 if (copy_from_user(&val, (unsigned long*)arg, sizeof(val))) 780 if (copy_from_user(&val, (unsigned long*)arg, sizeof(val)))
741 return -EFAULT; 781 {
782 ret = -EFAULT;
783 break;
784 }
742 val = setget_input(priv, val); 785 val = setget_input(priv, val);
743 if (copy_to_user((unsigned long*)arg, &val, sizeof(val))) 786 if (copy_to_user((unsigned long*)arg, &val, sizeof(val)))
744 return -EFAULT; 787 ret = -EFAULT;
745 break; 788 break;
746 case IO_SETGET_OUTPUT: 789 case IO_SETGET_OUTPUT:
747 /* bits set in *arg is set to output, 790 /* bits set in *arg is set to output,
748 * *arg updated with current output pins. 791 * *arg updated with current output pins.
749 */ 792 */
750 if (copy_from_user(&val, (unsigned long*)arg, sizeof(val))) 793 if (copy_from_user(&val, (unsigned long*)arg, sizeof(val)))
751 return -EFAULT; 794 {
795 ret = -EFAULT;
796 break;
797 }
752 val = setget_output(priv, val); 798 val = setget_output(priv, val);
753 if (copy_to_user((unsigned long*)arg, &val, sizeof(val))) 799 if (copy_to_user((unsigned long*)arg, &val, sizeof(val)))
754 return -EFAULT; 800 ret = -EFAULT;
755 break; 801 break;
756 default: 802 default:
757 if (priv->minor == GPIO_MINOR_LEDS) 803 if (priv->minor == GPIO_MINOR_LEDS)
758 return gpio_leds_ioctl(cmd, arg); 804 ret = gpio_leds_ioctl(cmd, arg);
759 else 805 else
760 return -EINVAL; 806 ret = -EINVAL;
761 } /* switch */ 807 } /* switch */
762 808
763 return 0; 809 spin_unlock(&gpio_lock);
810 return ret;
764} 811}
765 812
766static int 813static int
@@ -802,60 +849,20 @@ struct file_operations gpio_fops = {
802}; 849};
803 850
804 851
805static void __init gpio_init_port_g(void) 852void ioif_watcher(const unsigned int gpio_in_available,
853 const unsigned int gpio_out_available,
854 const unsigned char pa_available,
855 const unsigned char pb_available)
806{ 856{
807#define GROUPA (0x0000FF3F) 857 unsigned long int flags;
808#define GROUPB (1<<6 | 1<<7) 858 D(printk("gpio.c: ioif_watcher called\n"));
809#define GROUPC (1<<30 | 1<<31) 859 D(printk("gpio.c: G in: 0x%08x G out: 0x%08x PA: 0x%02x PB: 0x%02x\n",
810#define GROUPD (0x3FFF0000) 860 gpio_in_available, gpio_out_available, pa_available, pb_available));
811#define GROUPD_LOW (0x00FF0000)
812 unsigned long used_in_bits = 0;
813 unsigned long used_out_bits = 0;
814 if (genconfig_shadow & IO_STATE(R_GEN_CONFIG, scsi0, select)){
815 used_in_bits |= GROUPA | GROUPB | 0 | 0;
816 used_out_bits |= GROUPA | GROUPB | 0 | 0;
817 }
818 if (genconfig_shadow & IO_STATE(R_GEN_CONFIG, ata, select)) {
819 used_in_bits |= GROUPA | GROUPB | GROUPC | (GROUPD & ~(1<<25|1<<26));
820 used_out_bits |= GROUPA | GROUPB | GROUPC | GROUPD;
821 }
822 861
823 if (genconfig_shadow & IO_STATE(R_GEN_CONFIG, par0, select)) { 862 spin_lock_irqsave(&gpio_lock, flags);
824 used_in_bits |= (GROUPA & ~(1<<0)) | 0 | 0 | 0;
825 used_out_bits |= (GROUPA & ~(1<<0)) | 0 | 0 | 0;
826 }
827 if (genconfig_shadow & IO_STATE(R_GEN_CONFIG, ser2, select)) {
828 used_in_bits |= 0 | GROUPB | 0 | 0;
829 used_out_bits |= 0 | GROUPB | 0 | 0;
830 }
831 /* mio same as shared RAM ? */
832 if (genconfig_shadow & IO_STATE(R_GEN_CONFIG, mio, select)) {
833 used_in_bits |= (GROUPA & ~(1<<0)) | 0 |0 |GROUPD_LOW;
834 used_out_bits |= (GROUPA & ~(1<<0|1<<1|1<<2)) | 0 |0 |GROUPD_LOW;
835 }
836 if (genconfig_shadow & IO_STATE(R_GEN_CONFIG, scsi1, select)) {
837 used_in_bits |= 0 | 0 | GROUPC | GROUPD;
838 used_out_bits |= 0 | 0 | GROUPC | GROUPD;
839 }
840 if (genconfig_shadow & IO_STATE(R_GEN_CONFIG, scsi0w, select)) {
841 used_in_bits |= GROUPA | GROUPB | 0 | (GROUPD_LOW | 1<<24);
842 used_out_bits |= GROUPA | GROUPB | 0 | (GROUPD_LOW | 1<<24 | 1<<25|1<<26);
843 }
844 863
845 if (genconfig_shadow & IO_STATE(R_GEN_CONFIG, par1, select)) { 864 dir_g_in_bits = gpio_in_available;
846 used_in_bits |= 0 | 0 | 0 | (GROUPD & ~(1<<24)); 865 dir_g_out_bits = gpio_out_available;
847 used_out_bits |= 0 | 0 | 0 | (GROUPD & ~(1<<24));
848 }
849 if (genconfig_shadow & IO_STATE(R_GEN_CONFIG, ser3, select)) {
850 used_in_bits |= 0 | 0 | GROUPC | 0;
851 used_out_bits |= 0 | 0 | GROUPC | 0;
852 }
853 /* mio same as shared RAM-W? */
854 if (genconfig_shadow & IO_STATE(R_GEN_CONFIG, mio_w, select)) {
855 used_in_bits |= (GROUPA & ~(1<<0)) | 0 | 0 |GROUPD_LOW;
856 used_out_bits |= (GROUPA & ~(1<<0|1<<1|1<<2)) | 0 | 0 |GROUPD_LOW;
857 }
858 /* TODO: USB p2, parw, sync ser3? */
859 866
860 /* Initialise the dir_g_shadow etc. depending on genconfig */ 867 /* Initialise the dir_g_shadow etc. depending on genconfig */
861 /* 0=input 1=output */ 868 /* 0=input 1=output */
@@ -868,10 +875,7 @@ static void __init gpio_init_port_g(void)
868 if (genconfig_shadow & IO_STATE(R_GEN_CONFIG, g24dir, out)) 875 if (genconfig_shadow & IO_STATE(R_GEN_CONFIG, g24dir, out))
869 dir_g_shadow |= (1 << 24); 876 dir_g_shadow |= (1 << 24);
870 877
871 dir_g_in_bits = ~used_in_bits; 878 changeable_dir_g = changeable_dir_g_mask;
872 dir_g_out_bits = ~used_out_bits;
873
874 changeable_dir_g = 0x01FFFF01; /* all that can change dir */
875 changeable_dir_g &= dir_g_out_bits; 879 changeable_dir_g &= dir_g_out_bits;
876 changeable_dir_g &= dir_g_in_bits; 880 changeable_dir_g &= dir_g_in_bits;
877 /* Correct the bits that can change direction */ 881 /* Correct the bits that can change direction */
@@ -880,6 +884,7 @@ static void __init gpio_init_port_g(void)
880 dir_g_in_bits &= ~changeable_dir_g; 884 dir_g_in_bits &= ~changeable_dir_g;
881 dir_g_in_bits |= (~dir_g_shadow & changeable_dir_g); 885 dir_g_in_bits |= (~dir_g_shadow & changeable_dir_g);
882 886
887 spin_unlock_irqrestore(&gpio_lock, flags);
883 888
884 printk(KERN_INFO "GPIO port G: in_bits: 0x%08lX out_bits: 0x%08lX val: %08lX\n", 889 printk(KERN_INFO "GPIO port G: in_bits: 0x%08lX out_bits: 0x%08lX val: %08lX\n",
885 dir_g_in_bits, dir_g_out_bits, (unsigned long)*R_PORT_G_DATA); 890 dir_g_in_bits, dir_g_out_bits, (unsigned long)*R_PORT_G_DATA);
@@ -896,6 +901,7 @@ gpio_init(void)
896#if defined (CONFIG_ETRAX_CSP0_LEDS) 901#if defined (CONFIG_ETRAX_CSP0_LEDS)
897 int i; 902 int i;
898#endif 903#endif
904 printk("gpio init\n");
899 905
900 /* do the formalities */ 906 /* do the formalities */
901 907
@@ -919,8 +925,13 @@ gpio_init(void)
919#endif 925#endif
920 926
921#endif 927#endif
922 gpio_init_port_g(); 928 /* The I/O interface allocation watcher will be called when
923 printk(KERN_INFO "ETRAX 100LX GPIO driver v2.5, (c) 2001, 2002 Axis Communications AB\n"); 929 * registering it. */
930 if (cris_io_interface_register_watcher(ioif_watcher)){
931 printk(KERN_WARNING "gpio_init: Failed to install IO if allocator watcher\n");
932 }
933
934 printk(KERN_INFO "ETRAX 100LX GPIO driver v2.5, (c) 2001, 2002, 2003, 2004 Axis Communications AB\n");
924 /* We call etrax_gpio_wake_up_check() from timer interrupt and 935 /* We call etrax_gpio_wake_up_check() from timer interrupt and
925 * from cpu_idle() in kernel/process.c 936 * from cpu_idle() in kernel/process.c
926 * The check in cpu_idle() reduces latency from ~15 ms to ~6 ms 937 * The check in cpu_idle() reduces latency from ~15 ms to ~6 ms
diff --git a/arch/cris/arch-v10/drivers/i2c.c b/arch/cris/arch-v10/drivers/i2c.c
index 8bbe233ba7b1..b38267d60d30 100644
--- a/arch/cris/arch-v10/drivers/i2c.c
+++ b/arch/cris/arch-v10/drivers/i2c.c
@@ -12,6 +12,15 @@
12*! don't use PB_I2C if DS1302 uses same bits, 12*! don't use PB_I2C if DS1302 uses same bits,
13*! use PB. 13*! use PB.
14*! $Log: i2c.c,v $ 14*! $Log: i2c.c,v $
15*! Revision 1.13 2005/03/07 13:13:07 starvik
16*! Added spinlocks to protect states etc
17*!
18*! Revision 1.12 2005/01/05 06:11:22 starvik
19*! No need to do local_irq_disable after local_irq_save.
20*!
21*! Revision 1.11 2004/12/13 12:21:52 starvik
22*! Added I/O and DMA allocators from Linux 2.4
23*!
15*! Revision 1.9 2004/08/24 06:49:14 starvik 24*! Revision 1.9 2004/08/24 06:49:14 starvik
16*! Whitespace cleanup 25*! Whitespace cleanup
17*! 26*!
@@ -75,7 +84,7 @@
75*! (C) Copyright 1999-2002 Axis Communications AB, LUND, SWEDEN 84*! (C) Copyright 1999-2002 Axis Communications AB, LUND, SWEDEN
76*! 85*!
77*!***************************************************************************/ 86*!***************************************************************************/
78/* $Id: i2c.c,v 1.9 2004/08/24 06:49:14 starvik Exp $ */ 87/* $Id: i2c.c,v 1.13 2005/03/07 13:13:07 starvik Exp $ */
79 88
80/****************** INCLUDE FILES SECTION ***********************************/ 89/****************** INCLUDE FILES SECTION ***********************************/
81 90
@@ -95,6 +104,7 @@
95#include <asm/arch/svinto.h> 104#include <asm/arch/svinto.h>
96#include <asm/io.h> 105#include <asm/io.h>
97#include <asm/delay.h> 106#include <asm/delay.h>
107#include <asm/arch/io_interface_mux.h>
98 108
99#include "i2c.h" 109#include "i2c.h"
100 110
@@ -184,6 +194,7 @@ static const char i2c_name[] = "i2c";
184 194
185#define i2c_delay(usecs) udelay(usecs) 195#define i2c_delay(usecs) udelay(usecs)
186 196
197static DEFINE_SPINLOCK(i2c_lock); /* Protect directions etc */
187 198
188/****************** FUNCTION DEFINITION SECTION *************************/ 199/****************** FUNCTION DEFINITION SECTION *************************/
189 200
@@ -488,13 +499,14 @@ i2c_writereg(unsigned char theSlave, unsigned char theReg,
488 int error, cntr = 3; 499 int error, cntr = 3;
489 unsigned long flags; 500 unsigned long flags;
490 501
502 spin_lock(&i2c_lock);
503
491 do { 504 do {
492 error = 0; 505 error = 0;
493 /* 506 /*
494 * we don't like to be interrupted 507 * we don't like to be interrupted
495 */ 508 */
496 local_irq_save(flags); 509 local_irq_save(flags);
497 local_irq_disable();
498 510
499 i2c_start(); 511 i2c_start();
500 /* 512 /*
@@ -538,6 +550,8 @@ i2c_writereg(unsigned char theSlave, unsigned char theReg,
538 550
539 i2c_delay(CLOCK_LOW_TIME); 551 i2c_delay(CLOCK_LOW_TIME);
540 552
553 spin_unlock(&i2c_lock);
554
541 return -error; 555 return -error;
542} 556}
543 557
@@ -555,13 +569,14 @@ i2c_readreg(unsigned char theSlave, unsigned char theReg)
555 int error, cntr = 3; 569 int error, cntr = 3;
556 unsigned long flags; 570 unsigned long flags;
557 571
572 spin_lock(&i2c_lock);
573
558 do { 574 do {
559 error = 0; 575 error = 0;
560 /* 576 /*
561 * we don't like to be interrupted 577 * we don't like to be interrupted
562 */ 578 */
563 local_irq_save(flags); 579 local_irq_save(flags);
564 local_irq_disable();
565 /* 580 /*
566 * generate start condition 581 * generate start condition
567 */ 582 */
@@ -620,6 +635,8 @@ i2c_readreg(unsigned char theSlave, unsigned char theReg)
620 635
621 } while(error && cntr--); 636 } while(error && cntr--);
622 637
638 spin_unlock(&i2c_lock);
639
623 return b; 640 return b;
624} 641}
625 642
@@ -686,15 +703,26 @@ static struct file_operations i2c_fops = {
686int __init 703int __init
687i2c_init(void) 704i2c_init(void)
688{ 705{
706 static int res = 0;
707 static int first = 1;
708
709 if (!first) {
710 return res;
711 }
712
689 /* Setup and enable the Port B I2C interface */ 713 /* Setup and enable the Port B I2C interface */
690 714
691#ifndef CONFIG_ETRAX_I2C_USES_PB_NOT_PB_I2C 715#ifndef CONFIG_ETRAX_I2C_USES_PB_NOT_PB_I2C
716 if ((res = cris_request_io_interface(if_i2c, "I2C"))) {
717 printk(KERN_CRIT "i2c_init: Failed to get IO interface\n");
718 return res;
719 }
720
692 *R_PORT_PB_I2C = port_pb_i2c_shadow |= 721 *R_PORT_PB_I2C = port_pb_i2c_shadow |=
693 IO_STATE(R_PORT_PB_I2C, i2c_en, on) | 722 IO_STATE(R_PORT_PB_I2C, i2c_en, on) |
694 IO_FIELD(R_PORT_PB_I2C, i2c_d, 1) | 723 IO_FIELD(R_PORT_PB_I2C, i2c_d, 1) |
695 IO_FIELD(R_PORT_PB_I2C, i2c_clk, 1) | 724 IO_FIELD(R_PORT_PB_I2C, i2c_clk, 1) |
696 IO_STATE(R_PORT_PB_I2C, i2c_oe_, enable); 725 IO_STATE(R_PORT_PB_I2C, i2c_oe_, enable);
697#endif
698 726
699 port_pb_dir_shadow &= ~IO_MASK(R_PORT_PB_DIR, dir0); 727 port_pb_dir_shadow &= ~IO_MASK(R_PORT_PB_DIR, dir0);
700 port_pb_dir_shadow &= ~IO_MASK(R_PORT_PB_DIR, dir1); 728 port_pb_dir_shadow &= ~IO_MASK(R_PORT_PB_DIR, dir1);
@@ -702,8 +730,26 @@ i2c_init(void)
702 *R_PORT_PB_DIR = (port_pb_dir_shadow |= 730 *R_PORT_PB_DIR = (port_pb_dir_shadow |=
703 IO_STATE(R_PORT_PB_DIR, dir0, input) | 731 IO_STATE(R_PORT_PB_DIR, dir0, input) |
704 IO_STATE(R_PORT_PB_DIR, dir1, output)); 732 IO_STATE(R_PORT_PB_DIR, dir1, output));
733#else
734 if ((res = cris_io_interface_allocate_pins(if_i2c,
735 'b',
736 CONFIG_ETRAX_I2C_DATA_PORT,
737 CONFIG_ETRAX_I2C_DATA_PORT))) {
738 printk(KERN_WARNING "i2c_init: Failed to get IO pin for I2C data port\n");
739 return res;
740 } else if ((res = cris_io_interface_allocate_pins(if_i2c,
741 'b',
742 CONFIG_ETRAX_I2C_CLK_PORT,
743 CONFIG_ETRAX_I2C_CLK_PORT))) {
744 cris_io_interface_free_pins(if_i2c,
745 'b',
746 CONFIG_ETRAX_I2C_DATA_PORT,
747 CONFIG_ETRAX_I2C_DATA_PORT);
748 printk(KERN_WARNING "i2c_init: Failed to get IO pin for I2C clk port\n");
749 }
750#endif
705 751
706 return 0; 752 return res;
707} 753}
708 754
709static int __init 755static int __init
@@ -711,14 +757,16 @@ i2c_register(void)
711{ 757{
712 int res; 758 int res;
713 759
714 i2c_init(); 760 res = i2c_init();
761 if (res < 0)
762 return res;
715 res = register_chrdev(I2C_MAJOR, i2c_name, &i2c_fops); 763 res = register_chrdev(I2C_MAJOR, i2c_name, &i2c_fops);
716 if(res < 0) { 764 if(res < 0) {
717 printk(KERN_ERR "i2c: couldn't get a major number.\n"); 765 printk(KERN_ERR "i2c: couldn't get a major number.\n");
718 return res; 766 return res;
719 } 767 }
720 768
721 printk(KERN_INFO "I2C driver v2.2, (c) 1999-2001 Axis Communications AB\n"); 769 printk(KERN_INFO "I2C driver v2.2, (c) 1999-2004 Axis Communications AB\n");
722 770
723 return 0; 771 return 0;
724} 772}
diff --git a/arch/cris/arch-v10/drivers/pcf8563.c b/arch/cris/arch-v10/drivers/pcf8563.c
index b3dfdf7b8fc5..201f4c90d961 100644
--- a/arch/cris/arch-v10/drivers/pcf8563.c
+++ b/arch/cris/arch-v10/drivers/pcf8563.c
@@ -15,7 +15,7 @@
15 * 15 *
16 * Author: Tobias Anderberg <tobiasa@axis.com>. 16 * Author: Tobias Anderberg <tobiasa@axis.com>.
17 * 17 *
18 * $Id: pcf8563.c,v 1.8 2004/08/24 06:42:51 starvik Exp $ 18 * $Id: pcf8563.c,v 1.11 2005/03/07 13:13:07 starvik Exp $
19 */ 19 */
20 20
21#include <linux/config.h> 21#include <linux/config.h>
@@ -40,7 +40,7 @@
40#define PCF8563_MAJOR 121 /* Local major number. */ 40#define PCF8563_MAJOR 121 /* Local major number. */
41#define DEVICE_NAME "rtc" /* Name which is registered in /proc/devices. */ 41#define DEVICE_NAME "rtc" /* Name which is registered in /proc/devices. */
42#define PCF8563_NAME "PCF8563" 42#define PCF8563_NAME "PCF8563"
43#define DRIVER_VERSION "$Revision: 1.8 $" 43#define DRIVER_VERSION "$Revision: 1.11 $"
44 44
45/* I2C bus slave registers. */ 45/* I2C bus slave registers. */
46#define RTC_I2C_READ 0xa3 46#define RTC_I2C_READ 0xa3
@@ -49,6 +49,8 @@
49/* Two simple wrapper macros, saves a few keystrokes. */ 49/* Two simple wrapper macros, saves a few keystrokes. */
50#define rtc_read(x) i2c_readreg(RTC_I2C_READ, x) 50#define rtc_read(x) i2c_readreg(RTC_I2C_READ, x)
51#define rtc_write(x,y) i2c_writereg(RTC_I2C_WRITE, x, y) 51#define rtc_write(x,y) i2c_writereg(RTC_I2C_WRITE, x, y)
52
53static DEFINE_SPINLOCK(rtc_lock); /* Protect state etc */
52 54
53static const unsigned char days_in_month[] = 55static const unsigned char days_in_month[] =
54 { 0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 }; 56 { 0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 };
@@ -125,9 +127,12 @@ get_rtc_time(struct rtc_time *tm)
125int __init 127int __init
126pcf8563_init(void) 128pcf8563_init(void)
127{ 129{
128 unsigned char ret; 130 int ret;
129 131
130 i2c_init(); 132 if ((ret = i2c_init())) {
133 printk(KERN_CRIT "pcf8563_init: failed to init i2c\n");
134 return ret;
135 }
131 136
132 /* 137 /*
133 * First of all we need to reset the chip. This is done by 138 * First of all we need to reset the chip. This is done by
@@ -200,12 +205,15 @@ pcf8563_ioctl(struct inode *inode, struct file *filp, unsigned int cmd, unsigned
200 { 205 {
201 struct rtc_time tm; 206 struct rtc_time tm;
202 207
208 spin_lock(&rtc_lock);
203 get_rtc_time(&tm); 209 get_rtc_time(&tm);
204 210
205 if (copy_to_user((struct rtc_time *) arg, &tm, sizeof(struct rtc_time))) { 211 if (copy_to_user((struct rtc_time *) arg, &tm, sizeof(struct rtc_time))) {
212 spin_unlock(&rtc_lock);
206 return -EFAULT; 213 return -EFAULT;
207 } 214 }
208 215
216 spin_unlock(&rtc_lock);
209 return 0; 217 return 0;
210 } 218 }
211 break; 219 break;
@@ -250,6 +258,8 @@ pcf8563_ioctl(struct inode *inode, struct file *filp, unsigned int cmd, unsigned
250 BIN_TO_BCD(tm.tm_min); 258 BIN_TO_BCD(tm.tm_min);
251 BIN_TO_BCD(tm.tm_sec); 259 BIN_TO_BCD(tm.tm_sec);
252 tm.tm_mon |= century; 260 tm.tm_mon |= century;
261
262 spin_lock(&rtc_lock);
253 263
254 rtc_write(RTC_YEAR, tm.tm_year); 264 rtc_write(RTC_YEAR, tm.tm_year);
255 rtc_write(RTC_MONTH, tm.tm_mon); 265 rtc_write(RTC_MONTH, tm.tm_mon);
@@ -258,6 +268,8 @@ pcf8563_ioctl(struct inode *inode, struct file *filp, unsigned int cmd, unsigned
258 rtc_write(RTC_MINUTES, tm.tm_min); 268 rtc_write(RTC_MINUTES, tm.tm_min);
259 rtc_write(RTC_SECONDS, tm.tm_sec); 269 rtc_write(RTC_SECONDS, tm.tm_sec);
260 270
271 spin_unlock(&rtc_lock);
272
261 return 0; 273 return 0;
262#endif /* !CONFIG_ETRAX_RTC_READONLY */ 274#endif /* !CONFIG_ETRAX_RTC_READONLY */
263 } 275 }
diff --git a/arch/cris/arch-v10/kernel/Makefile b/arch/cris/arch-v10/kernel/Makefile
index 52761603b6a5..dcfec41d3533 100644
--- a/arch/cris/arch-v10/kernel/Makefile
+++ b/arch/cris/arch-v10/kernel/Makefile
@@ -1,4 +1,4 @@
1# $Id: Makefile,v 1.5 2004/06/02 08:24:38 starvik Exp $ 1# $Id: Makefile,v 1.6 2004/12/13 12:21:51 starvik Exp $
2# 2#
3# Makefile for the linux kernel. 3# Makefile for the linux kernel.
4# 4#
@@ -7,7 +7,8 @@ extra-y := head.o
7 7
8 8
9obj-y := entry.o traps.o shadows.o debugport.o irq.o \ 9obj-y := entry.o traps.o shadows.o debugport.o irq.o \
10 process.o setup.o signal.o traps.o time.o ptrace.o 10 process.o setup.o signal.o traps.o time.o ptrace.o \
11 dma.o io_interface_mux.o
11 12
12obj-$(CONFIG_ETRAX_KGDB) += kgdb.o 13obj-$(CONFIG_ETRAX_KGDB) += kgdb.o
13obj-$(CONFIG_ETRAX_FAST_TIMER) += fasttimer.o 14obj-$(CONFIG_ETRAX_FAST_TIMER) += fasttimer.o
diff --git a/arch/cris/arch-v10/kernel/debugport.c b/arch/cris/arch-v10/kernel/debugport.c
index 6cf069e5e7b6..f3a85b77c17e 100644
--- a/arch/cris/arch-v10/kernel/debugport.c
+++ b/arch/cris/arch-v10/kernel/debugport.c
@@ -12,6 +12,31 @@
12 * init_etrax_debug() 12 * init_etrax_debug()
13 * 13 *
14 * $Log: debugport.c,v $ 14 * $Log: debugport.c,v $
15 * Revision 1.27 2005/06/10 10:34:14 starvik
16 * Real console support
17 *
18 * Revision 1.26 2005/06/07 07:06:07 starvik
19 * Added LF->CR translation to make ETRAX customers happy.
20 *
21 * Revision 1.25 2005/03/08 08:56:47 mikaelam
22 * Do only set index as port->index if port is defined, otherwise use the index from the command line
23 *
24 * Revision 1.24 2005/01/19 10:26:33 mikaelam
25 * Return the cris serial driver in console device driver callback function
26 *
27 * Revision 1.23 2005/01/14 10:12:17 starvik
28 * KGDB on separate port.
29 * Console fixes from 2.4.
30 *
31 * Revision 1.22 2005/01/11 16:06:13 starvik
32 * typo
33 *
34 * Revision 1.21 2005/01/11 13:49:14 starvik
35 * Added raw_printk to be used where we don't trust the console.
36 *
37 * Revision 1.20 2004/12/27 11:18:32 starvik
38 * Merge of Linux 2.6.10 (not functional yet).
39 *
15 * Revision 1.19 2004/10/21 07:26:16 starvik 40 * Revision 1.19 2004/10/21 07:26:16 starvik
16 * Made it possible to specify console settings on kernel command line. 41 * Made it possible to specify console settings on kernel command line.
17 * 42 *
@@ -114,7 +139,11 @@ struct dbg_port ports[]=
114 R_SERIAL0_BAUD, 139 R_SERIAL0_BAUD,
115 R_SERIAL0_TR_CTRL, 140 R_SERIAL0_TR_CTRL,
116 R_SERIAL0_REC_CTRL, 141 R_SERIAL0_REC_CTRL,
117 IO_STATE(R_IRQ_MASK1_SET, ser0_data, set) 142 IO_STATE(R_IRQ_MASK1_SET, ser0_data, set),
143 0,
144 115200,
145 'N',
146 8
118 }, 147 },
119 { 148 {
120 1, 149 1,
@@ -124,7 +153,11 @@ struct dbg_port ports[]=
124 R_SERIAL1_BAUD, 153 R_SERIAL1_BAUD,
125 R_SERIAL1_TR_CTRL, 154 R_SERIAL1_TR_CTRL,
126 R_SERIAL1_REC_CTRL, 155 R_SERIAL1_REC_CTRL,
127 IO_STATE(R_IRQ_MASK1_SET, ser1_data, set) 156 IO_STATE(R_IRQ_MASK1_SET, ser1_data, set),
157 0,
158 115200,
159 'N',
160 8
128 }, 161 },
129 { 162 {
130 2, 163 2,
@@ -134,7 +167,11 @@ struct dbg_port ports[]=
134 R_SERIAL2_BAUD, 167 R_SERIAL2_BAUD,
135 R_SERIAL2_TR_CTRL, 168 R_SERIAL2_TR_CTRL,
136 R_SERIAL2_REC_CTRL, 169 R_SERIAL2_REC_CTRL,
137 IO_STATE(R_IRQ_MASK1_SET, ser2_data, set) 170 IO_STATE(R_IRQ_MASK1_SET, ser2_data, set),
171 0,
172 115200,
173 'N',
174 8
138 }, 175 },
139 { 176 {
140 3, 177 3,
@@ -144,11 +181,15 @@ struct dbg_port ports[]=
144 R_SERIAL3_BAUD, 181 R_SERIAL3_BAUD,
145 R_SERIAL3_TR_CTRL, 182 R_SERIAL3_TR_CTRL,
146 R_SERIAL3_REC_CTRL, 183 R_SERIAL3_REC_CTRL,
147 IO_STATE(R_IRQ_MASK1_SET, ser3_data, set) 184 IO_STATE(R_IRQ_MASK1_SET, ser3_data, set),
185 0,
186 115200,
187 'N',
188 8
148 } 189 }
149}; 190};
150 191
151static struct tty_driver *serial_driver; 192extern struct tty_driver *serial_driver;
152 193
153struct dbg_port* port = 194struct dbg_port* port =
154#if defined(CONFIG_ETRAX_DEBUG_PORT0) 195#if defined(CONFIG_ETRAX_DEBUG_PORT0)
@@ -162,37 +203,44 @@ struct dbg_port* port =
162#else 203#else
163 NULL; 204 NULL;
164#endif 205#endif
165/* Used by serial.c to register a debug_write_function so that the normal
166 * serial driver is used for kernel debug output
167 */
168typedef int (*debugport_write_function)(int i, const char *buf, unsigned int len);
169 206
170debugport_write_function debug_write_function = NULL; 207static struct dbg_port* kgdb_port =
208#if defined(CONFIG_ETRAX_KGDB_PORT0)
209 &ports[0];
210#elif defined(CONFIG_ETRAX_KGDB_PORT1)
211 &ports[1];
212#elif defined(CONFIG_ETRAX_KGDB_PORT2)
213 &ports[2];
214#elif defined(CONFIG_ETRAX_KGDB_PORT3)
215 &ports[3];
216#else
217 NULL;
218#endif
171 219
172static void 220static void
173start_port(void) 221start_port(struct dbg_port* p)
174{ 222{
175 unsigned long rec_ctrl = 0; 223 unsigned long rec_ctrl = 0;
176 unsigned long tr_ctrl = 0; 224 unsigned long tr_ctrl = 0;
177 225
178 if (!port) 226 if (!p)
179 return; 227 return;
180 228
181 if (port->started) 229 if (p->started)
182 return; 230 return;
183 port->started = 1; 231 p->started = 1;
184 232
185 if (port->index == 0) 233 if (p->index == 0)
186 { 234 {
187 genconfig_shadow &= ~IO_MASK(R_GEN_CONFIG, dma6); 235 genconfig_shadow &= ~IO_MASK(R_GEN_CONFIG, dma6);
188 genconfig_shadow |= IO_STATE(R_GEN_CONFIG, dma6, unused); 236 genconfig_shadow |= IO_STATE(R_GEN_CONFIG, dma6, unused);
189 } 237 }
190 else if (port->index == 1) 238 else if (p->index == 1)
191 { 239 {
192 genconfig_shadow &= ~IO_MASK(R_GEN_CONFIG, dma8); 240 genconfig_shadow &= ~IO_MASK(R_GEN_CONFIG, dma8);
193 genconfig_shadow |= IO_STATE(R_GEN_CONFIG, dma8, usb); 241 genconfig_shadow |= IO_STATE(R_GEN_CONFIG, dma8, usb);
194 } 242 }
195 else if (port->index == 2) 243 else if (p->index == 2)
196 { 244 {
197 genconfig_shadow &= ~IO_MASK(R_GEN_CONFIG, dma2); 245 genconfig_shadow &= ~IO_MASK(R_GEN_CONFIG, dma2);
198 genconfig_shadow |= IO_STATE(R_GEN_CONFIG, dma2, par0); 246 genconfig_shadow |= IO_STATE(R_GEN_CONFIG, dma2, par0);
@@ -211,69 +259,69 @@ start_port(void)
211 259
212 *R_GEN_CONFIG = genconfig_shadow; 260 *R_GEN_CONFIG = genconfig_shadow;
213 261
214 *port->xoff = 262 *p->xoff =
215 IO_STATE(R_SERIAL0_XOFF, tx_stop, enable) | 263 IO_STATE(R_SERIAL0_XOFF, tx_stop, enable) |
216 IO_STATE(R_SERIAL0_XOFF, auto_xoff, disable) | 264 IO_STATE(R_SERIAL0_XOFF, auto_xoff, disable) |
217 IO_FIELD(R_SERIAL0_XOFF, xoff_char, 0); 265 IO_FIELD(R_SERIAL0_XOFF, xoff_char, 0);
218 266
219 switch (port->baudrate) 267 switch (p->baudrate)
220 { 268 {
221 case 0: 269 case 0:
222 case 115200: 270 case 115200:
223 *port->baud = 271 *p->baud =
224 IO_STATE(R_SERIAL0_BAUD, tr_baud, c115k2Hz) | 272 IO_STATE(R_SERIAL0_BAUD, tr_baud, c115k2Hz) |
225 IO_STATE(R_SERIAL0_BAUD, rec_baud, c115k2Hz); 273 IO_STATE(R_SERIAL0_BAUD, rec_baud, c115k2Hz);
226 break; 274 break;
227 case 1200: 275 case 1200:
228 *port->baud = 276 *p->baud =
229 IO_STATE(R_SERIAL0_BAUD, tr_baud, c1200Hz) | 277 IO_STATE(R_SERIAL0_BAUD, tr_baud, c1200Hz) |
230 IO_STATE(R_SERIAL0_BAUD, rec_baud, c1200Hz); 278 IO_STATE(R_SERIAL0_BAUD, rec_baud, c1200Hz);
231 break; 279 break;
232 case 2400: 280 case 2400:
233 *port->baud = 281 *p->baud =
234 IO_STATE(R_SERIAL0_BAUD, tr_baud, c2400Hz) | 282 IO_STATE(R_SERIAL0_BAUD, tr_baud, c2400Hz) |
235 IO_STATE(R_SERIAL0_BAUD, rec_baud, c2400Hz); 283 IO_STATE(R_SERIAL0_BAUD, rec_baud, c2400Hz);
236 break; 284 break;
237 case 4800: 285 case 4800:
238 *port->baud = 286 *p->baud =
239 IO_STATE(R_SERIAL0_BAUD, tr_baud, c4800Hz) | 287 IO_STATE(R_SERIAL0_BAUD, tr_baud, c4800Hz) |
240 IO_STATE(R_SERIAL0_BAUD, rec_baud, c4800Hz); 288 IO_STATE(R_SERIAL0_BAUD, rec_baud, c4800Hz);
241 break; 289 break;
242 case 9600: 290 case 9600:
243 *port->baud = 291 *p->baud =
244 IO_STATE(R_SERIAL0_BAUD, tr_baud, c9600Hz) | 292 IO_STATE(R_SERIAL0_BAUD, tr_baud, c9600Hz) |
245 IO_STATE(R_SERIAL0_BAUD, rec_baud, c9600Hz); 293 IO_STATE(R_SERIAL0_BAUD, rec_baud, c9600Hz);
246 break; 294 break;
247 case 19200: 295 case 19200:
248 *port->baud = 296 *p->baud =
249 IO_STATE(R_SERIAL0_BAUD, tr_baud, c19k2Hz) | 297 IO_STATE(R_SERIAL0_BAUD, tr_baud, c19k2Hz) |
250 IO_STATE(R_SERIAL0_BAUD, rec_baud, c19k2Hz); 298 IO_STATE(R_SERIAL0_BAUD, rec_baud, c19k2Hz);
251 break; 299 break;
252 case 38400: 300 case 38400:
253 *port->baud = 301 *p->baud =
254 IO_STATE(R_SERIAL0_BAUD, tr_baud, c38k4Hz) | 302 IO_STATE(R_SERIAL0_BAUD, tr_baud, c38k4Hz) |
255 IO_STATE(R_SERIAL0_BAUD, rec_baud, c38k4Hz); 303 IO_STATE(R_SERIAL0_BAUD, rec_baud, c38k4Hz);
256 break; 304 break;
257 case 57600: 305 case 57600:
258 *port->baud = 306 *p->baud =
259 IO_STATE(R_SERIAL0_BAUD, tr_baud, c57k6Hz) | 307 IO_STATE(R_SERIAL0_BAUD, tr_baud, c57k6Hz) |
260 IO_STATE(R_SERIAL0_BAUD, rec_baud, c57k6Hz); 308 IO_STATE(R_SERIAL0_BAUD, rec_baud, c57k6Hz);
261 break; 309 break;
262 default: 310 default:
263 *port->baud = 311 *p->baud =
264 IO_STATE(R_SERIAL0_BAUD, tr_baud, c115k2Hz) | 312 IO_STATE(R_SERIAL0_BAUD, tr_baud, c115k2Hz) |
265 IO_STATE(R_SERIAL0_BAUD, rec_baud, c115k2Hz); 313 IO_STATE(R_SERIAL0_BAUD, rec_baud, c115k2Hz);
266 break; 314 break;
267 } 315 }
268 316
269 if (port->parity == 'E') { 317 if (p->parity == 'E') {
270 rec_ctrl = 318 rec_ctrl =
271 IO_STATE(R_SERIAL0_REC_CTRL, rec_par, even) | 319 IO_STATE(R_SERIAL0_REC_CTRL, rec_par, even) |
272 IO_STATE(R_SERIAL0_REC_CTRL, rec_par_en, enable); 320 IO_STATE(R_SERIAL0_REC_CTRL, rec_par_en, enable);
273 tr_ctrl = 321 tr_ctrl =
274 IO_STATE(R_SERIAL0_TR_CTRL, tr_par, even) | 322 IO_STATE(R_SERIAL0_TR_CTRL, tr_par, even) |
275 IO_STATE(R_SERIAL0_TR_CTRL, tr_par_en, enable); 323 IO_STATE(R_SERIAL0_TR_CTRL, tr_par_en, enable);
276 } else if (port->parity == 'O') { 324 } else if (p->parity == 'O') {
277 rec_ctrl = 325 rec_ctrl =
278 IO_STATE(R_SERIAL0_REC_CTRL, rec_par, odd) | 326 IO_STATE(R_SERIAL0_REC_CTRL, rec_par, odd) |
279 IO_STATE(R_SERIAL0_REC_CTRL, rec_par_en, enable); 327 IO_STATE(R_SERIAL0_REC_CTRL, rec_par_en, enable);
@@ -288,8 +336,7 @@ start_port(void)
288 IO_STATE(R_SERIAL0_TR_CTRL, tr_par, even) | 336 IO_STATE(R_SERIAL0_TR_CTRL, tr_par, even) |
289 IO_STATE(R_SERIAL0_TR_CTRL, tr_par_en, disable); 337 IO_STATE(R_SERIAL0_TR_CTRL, tr_par_en, disable);
290 } 338 }
291 339 if (p->bits == 7)
292 if (port->bits == 7)
293 { 340 {
294 rec_ctrl |= IO_STATE(R_SERIAL0_REC_CTRL, rec_bitnr, rec_7bit); 341 rec_ctrl |= IO_STATE(R_SERIAL0_REC_CTRL, rec_bitnr, rec_7bit);
295 tr_ctrl |= IO_STATE(R_SERIAL0_TR_CTRL, tr_bitnr, tr_7bit); 342 tr_ctrl |= IO_STATE(R_SERIAL0_TR_CTRL, tr_bitnr, tr_7bit);
@@ -300,7 +347,7 @@ start_port(void)
300 tr_ctrl |= IO_STATE(R_SERIAL0_TR_CTRL, tr_bitnr, tr_8bit); 347 tr_ctrl |= IO_STATE(R_SERIAL0_TR_CTRL, tr_bitnr, tr_8bit);
301 } 348 }
302 349
303 *port->rec_ctrl = 350 *p->rec_ctrl =
304 IO_STATE(R_SERIAL0_REC_CTRL, dma_err, stop) | 351 IO_STATE(R_SERIAL0_REC_CTRL, dma_err, stop) |
305 IO_STATE(R_SERIAL0_REC_CTRL, rec_enable, enable) | 352 IO_STATE(R_SERIAL0_REC_CTRL, rec_enable, enable) |
306 IO_STATE(R_SERIAL0_REC_CTRL, rts_, active) | 353 IO_STATE(R_SERIAL0_REC_CTRL, rts_, active) |
@@ -308,7 +355,7 @@ start_port(void)
308 IO_STATE(R_SERIAL0_REC_CTRL, rec_stick_par, normal) | 355 IO_STATE(R_SERIAL0_REC_CTRL, rec_stick_par, normal) |
309 rec_ctrl; 356 rec_ctrl;
310 357
311 *port->tr_ctrl = 358 *p->tr_ctrl =
312 IO_FIELD(R_SERIAL0_TR_CTRL, txd, 0) | 359 IO_FIELD(R_SERIAL0_TR_CTRL, txd, 0) |
313 IO_STATE(R_SERIAL0_TR_CTRL, tr_enable, enable) | 360 IO_STATE(R_SERIAL0_TR_CTRL, tr_enable, enable) |
314 IO_STATE(R_SERIAL0_TR_CTRL, auto_cts, disabled) | 361 IO_STATE(R_SERIAL0_TR_CTRL, auto_cts, disabled) |
@@ -323,8 +370,18 @@ console_write_direct(struct console *co, const char *buf, unsigned int len)
323 int i; 370 int i;
324 unsigned long flags; 371 unsigned long flags;
325 local_irq_save(flags); 372 local_irq_save(flags);
373
374 if (!port)
375 return;
376
326 /* Send data */ 377 /* Send data */
327 for (i = 0; i < len; i++) { 378 for (i = 0; i < len; i++) {
379 /* LF -> CRLF */
380 if (buf[i] == '\n') {
381 while (!(*port->read & IO_MASK(R_SERIAL0_READ, tr_ready)))
382 ;
383 *port->write = '\r';
384 }
328 /* Wait until transmitter is ready and send.*/ 385 /* Wait until transmitter is ready and send.*/
329 while (!(*port->read & IO_MASK(R_SERIAL0_READ, tr_ready))) 386 while (!(*port->read & IO_MASK(R_SERIAL0_READ, tr_ready)))
330 ; 387 ;
@@ -333,6 +390,25 @@ console_write_direct(struct console *co, const char *buf, unsigned int len)
333 local_irq_restore(flags); 390 local_irq_restore(flags);
334} 391}
335 392
393int raw_printk(const char *fmt, ...)
394{
395 static char buf[1024];
396 int printed_len;
397 static int first = 1;
398 if (first) {
399 /* Force reinitialization of the port to get manual mode. */
400 port->started = 0;
401 start_port(port);
402 first = 0;
403 }
404 va_list args;
405 va_start(args, fmt);
406 printed_len = vsnprintf(buf, sizeof(buf), fmt, args);
407 va_end(args);
408 console_write_direct(NULL, buf, strlen(buf));
409 return printed_len;
410}
411
336static void 412static void
337console_write(struct console *co, const char *buf, unsigned int len) 413console_write(struct console *co, const char *buf, unsigned int len)
338{ 414{
@@ -345,18 +421,7 @@ console_write(struct console *co, const char *buf, unsigned int len)
345 return; 421 return;
346#endif 422#endif
347 423
348 start_port(); 424 console_write_direct(co, buf, len);
349
350#ifdef CONFIG_ETRAX_KGDB
351 /* kgdb needs to output debug info using the gdb protocol */
352 putDebugString(buf, len);
353 return;
354#endif
355
356 if (debug_write_function)
357 debug_write_function(co->index, buf, len);
358 else
359 console_write_direct(co, buf, len);
360} 425}
361 426
362/* legacy function */ 427/* legacy function */
@@ -374,8 +439,11 @@ getDebugChar(void)
374{ 439{
375 unsigned long readval; 440 unsigned long readval;
376 441
442 if (!kgdb_port)
443 return 0;
444
377 do { 445 do {
378 readval = *port->read; 446 readval = *kgdb_port->read;
379 } while (!(readval & IO_MASK(R_SERIAL0_READ, data_avail))); 447 } while (!(readval & IO_MASK(R_SERIAL0_READ, data_avail)));
380 448
381 return (readval & IO_MASK(R_SERIAL0_READ, data_in)); 449 return (readval & IO_MASK(R_SERIAL0_READ, data_in));
@@ -386,9 +454,12 @@ getDebugChar(void)
386void 454void
387putDebugChar(int val) 455putDebugChar(int val)
388{ 456{
389 while (!(*port->read & IO_MASK(R_SERIAL0_READ, tr_ready))) 457 if (!kgdb_port)
458 return;
459
460 while (!(*kgdb_port->read & IO_MASK(R_SERIAL0_READ, tr_ready)))
390 ; 461 ;
391 *port->write = val; 462 *kgdb_port->write = val;
392} 463}
393 464
394/* Enable irq for receiving chars on the debug port, used by kgdb */ 465/* Enable irq for receiving chars on the debug port, used by kgdb */
@@ -396,19 +467,16 @@ putDebugChar(int val)
396void 467void
397enableDebugIRQ(void) 468enableDebugIRQ(void)
398{ 469{
399 *R_IRQ_MASK1_SET = port->irq; 470 if (!kgdb_port)
471 return;
472
473 *R_IRQ_MASK1_SET = kgdb_port->irq;
400 /* use R_VECT_MASK directly, since we really bypass Linux normal 474 /* use R_VECT_MASK directly, since we really bypass Linux normal
401 * IRQ handling in kgdb anyway, we don't need to use enable_irq 475 * IRQ handling in kgdb anyway, we don't need to use enable_irq
402 */ 476 */
403 *R_VECT_MASK_SET = IO_STATE(R_VECT_MASK_SET, serial, set); 477 *R_VECT_MASK_SET = IO_STATE(R_VECT_MASK_SET, serial, set);
404 478
405 *port->rec_ctrl = IO_STATE(R_SERIAL0_REC_CTRL, rec_enable, enable); 479 *kgdb_port->rec_ctrl = IO_STATE(R_SERIAL0_REC_CTRL, rec_enable, enable);
406}
407
408static struct tty_driver*
409etrax_console_device(struct console* co, int *index)
410{
411 return serial_driver;
412} 480}
413 481
414static int __init 482static int __init
@@ -428,11 +496,69 @@ console_setup(struct console *co, char *options)
428 if (*s) port->parity = *s++; 496 if (*s) port->parity = *s++;
429 if (*s) port->bits = *s++ - '0'; 497 if (*s) port->bits = *s++ - '0';
430 port->started = 0; 498 port->started = 0;
431 start_port(); 499 start_port(0);
432 } 500 }
433 return 0; 501 return 0;
434} 502}
435 503
504/* This is a dummy serial device that throws away anything written to it.
505 * This is used when no debug output is wanted.
506 */
507static struct tty_driver dummy_driver;
508
509static int dummy_open(struct tty_struct *tty, struct file * filp)
510{
511 return 0;
512}
513
514static void dummy_close(struct tty_struct *tty, struct file * filp)
515{
516}
517
518static int dummy_write(struct tty_struct * tty,
519 const unsigned char *buf, int count)
520{
521 return count;
522}
523
524static int
525dummy_write_room(struct tty_struct *tty)
526{
527 return 8192;
528}
529
530void __init
531init_dummy_console(void)
532{
533 memset(&dummy_driver, 0, sizeof(struct tty_driver));
534 dummy_driver.driver_name = "serial";
535 dummy_driver.name = "ttyS";
536 dummy_driver.major = TTY_MAJOR;
537 dummy_driver.minor_start = 68;
538 dummy_driver.num = 1; /* etrax100 has 4 serial ports */
539 dummy_driver.type = TTY_DRIVER_TYPE_SERIAL;
540 dummy_driver.subtype = SERIAL_TYPE_NORMAL;
541 dummy_driver.init_termios = tty_std_termios;
542 dummy_driver.init_termios.c_cflag =
543 B115200 | CS8 | CREAD | HUPCL | CLOCAL; /* is normally B9600 default... */
544 dummy_driver.flags = TTY_DRIVER_REAL_RAW | TTY_DRIVER_NO_DEVFS;
545
546 dummy_driver.open = dummy_open;
547 dummy_driver.close = dummy_close;
548 dummy_driver.write = dummy_write;
549 dummy_driver.write_room = dummy_write_room;
550 if (tty_register_driver(&dummy_driver))
551 panic("Couldn't register dummy serial driver\n");
552}
553
554static struct tty_driver*
555etrax_console_device(struct console* co, int *index)
556{
557 if (port)
558 *index = port->index;
559 return port ? serial_driver : &dummy_driver;
560}
561
436static struct console sercons = { 562static struct console sercons = {
437 name : "ttyS", 563 name : "ttyS",
438 write: console_write, 564 write: console_write,
@@ -504,28 +630,21 @@ init_etrax_debug(void)
504 static int first = 1; 630 static int first = 1;
505 631
506 if (!first) { 632 if (!first) {
507 if (!port) { 633 unregister_console(&sercons);
508 register_console(&sercons0); 634 register_console(&sercons0);
509 register_console(&sercons1); 635 register_console(&sercons1);
510 register_console(&sercons2); 636 register_console(&sercons2);
511 register_console(&sercons3); 637 register_console(&sercons3);
512 unregister_console(&sercons); 638 init_dummy_console();
513 }
514 return 0; 639 return 0;
515 } 640 }
516 first = 0;
517 if (port)
518 register_console(&sercons);
519 return 0;
520}
521 641
522int __init 642 first = 0;
523init_console(void) 643 register_console(&sercons);
524{ 644 start_port(port);
525 serial_driver = alloc_tty_driver(1); 645#ifdef CONFIG_ETRAX_KGDB
526 if (!serial_driver) 646 start_port(kgdb_port);
527 return -ENOMEM; 647#endif
528 return 0; 648 return 0;
529} 649}
530
531__initcall(init_etrax_debug); 650__initcall(init_etrax_debug);
diff --git a/arch/cris/arch-v10/kernel/dma.c b/arch/cris/arch-v10/kernel/dma.c
new file mode 100644
index 000000000000..e9a0311b141d
--- /dev/null
+++ b/arch/cris/arch-v10/kernel/dma.c
@@ -0,0 +1,287 @@
1/* Wrapper for DMA channel allocator that updates DMA client muxing.
2 * Copyright 2004, Axis Communications AB
3 * $Id: dma.c,v 1.1 2004/12/13 12:21:51 starvik Exp $
4 */
5
6#include <linux/kernel.h>
7#include <linux/module.h>
8#include <linux/errno.h>
9
10#include <asm/dma.h>
11#include <asm/arch/svinto.h>
12
13/* Macro to access ETRAX 100 registers */
14#define SETS(var, reg, field, val) var = (var & ~IO_MASK_(reg##_, field##_)) | \
15 IO_STATE_(reg##_, field##_, _##val)
16
17
18static char used_dma_channels[MAX_DMA_CHANNELS];
19static const char * used_dma_channels_users[MAX_DMA_CHANNELS];
20
21int cris_request_dma(unsigned int dmanr, const char * device_id,
22 unsigned options, enum dma_owner owner)
23{
24 unsigned long flags;
25 unsigned long int gens;
26 int fail = -EINVAL;
27
28 if ((dmanr < 0) || (dmanr >= MAX_DMA_CHANNELS)) {
29 printk(KERN_CRIT "cris_request_dma: invalid DMA channel %u\n", dmanr);
30 return -EINVAL;
31 }
32
33 local_irq_save(flags);
34 if (used_dma_channels[dmanr]) {
35 local_irq_restore(flags);
36 if (options & DMA_VERBOSE_ON_ERROR) {
37 printk(KERN_CRIT "Failed to request DMA %i for %s, already allocated by %s\n", dmanr, device_id, used_dma_channels_users[dmanr]);
38 }
39 if (options & DMA_PANIC_ON_ERROR) {
40 panic("request_dma error!");
41 }
42 return -EBUSY;
43 }
44
45 gens = genconfig_shadow;
46
47 switch(owner)
48 {
49 case dma_eth:
50 if ((dmanr != NETWORK_TX_DMA_NBR) &&
51 (dmanr != NETWORK_RX_DMA_NBR)) {
52 printk(KERN_CRIT "Invalid DMA channel for eth\n");
53 goto bail;
54 }
55 break;
56 case dma_ser0:
57 if (dmanr == SER0_TX_DMA_NBR) {
58 SETS(gens, R_GEN_CONFIG, dma6, serial0);
59 } else if (dmanr == SER0_RX_DMA_NBR) {
60 SETS(gens, R_GEN_CONFIG, dma7, serial0);
61 } else {
62 printk(KERN_CRIT "Invalid DMA channel for ser0\n");
63 goto bail;
64 }
65 break;
66 case dma_ser1:
67 if (dmanr == SER1_TX_DMA_NBR) {
68 SETS(gens, R_GEN_CONFIG, dma8, serial1);
69 } else if (dmanr == SER1_RX_DMA_NBR) {
70 SETS(gens, R_GEN_CONFIG, dma9, serial1);
71 } else {
72 printk(KERN_CRIT "Invalid DMA channel for ser1\n");
73 goto bail;
74 }
75 break;
76 case dma_ser2:
77 if (dmanr == SER2_TX_DMA_NBR) {
78 SETS(gens, R_GEN_CONFIG, dma2, serial2);
79 } else if (dmanr == SER2_RX_DMA_NBR) {
80 SETS(gens, R_GEN_CONFIG, dma3, serial2);
81 } else {
82 printk(KERN_CRIT "Invalid DMA channel for ser2\n");
83 goto bail;
84 }
85 break;
86 case dma_ser3:
87 if (dmanr == SER3_TX_DMA_NBR) {
88 SETS(gens, R_GEN_CONFIG, dma4, serial3);
89 } else if (dmanr == SER3_RX_DMA_NBR) {
90 SETS(gens, R_GEN_CONFIG, dma5, serial3);
91 } else {
92 printk(KERN_CRIT "Invalid DMA channel for ser3\n");
93 goto bail;
94 }
95 break;
96 case dma_ata:
97 if (dmanr == ATA_TX_DMA_NBR) {
98 SETS(gens, R_GEN_CONFIG, dma2, ata);
99 } else if (dmanr == ATA_RX_DMA_NBR) {
100 SETS(gens, R_GEN_CONFIG, dma3, ata);
101 } else {
102 printk(KERN_CRIT "Invalid DMA channel for ata\n");
103 goto bail;
104 }
105 break;
106 case dma_ext0:
107 if (dmanr == EXTDMA0_TX_DMA_NBR) {
108 SETS(gens, R_GEN_CONFIG, dma4, extdma0);
109 } else if (dmanr == EXTDMA0_RX_DMA_NBR) {
110 SETS(gens, R_GEN_CONFIG, dma5, extdma0);
111 } else {
112 printk(KERN_CRIT "Invalid DMA channel for ext0\n");
113 goto bail;
114 }
115 break;
116 case dma_ext1:
117 if (dmanr == EXTDMA1_TX_DMA_NBR) {
118 SETS(gens, R_GEN_CONFIG, dma6, extdma1);
119 } else if (dmanr == EXTDMA1_RX_DMA_NBR) {
120 SETS(gens, R_GEN_CONFIG, dma7, extdma1);
121 } else {
122 printk(KERN_CRIT "Invalid DMA channel for ext1\n");
123 goto bail;
124 }
125 break;
126 case dma_int6:
127 if (dmanr == MEM2MEM_RX_DMA_NBR) {
128 SETS(gens, R_GEN_CONFIG, dma7, intdma6);
129 } else {
130 printk(KERN_CRIT "Invalid DMA channel for int6\n");
131 goto bail;
132 }
133 break;
134 case dma_int7:
135 if (dmanr == MEM2MEM_TX_DMA_NBR) {
136 SETS(gens, R_GEN_CONFIG, dma6, intdma7);
137 } else {
138 printk(KERN_CRIT "Invalid DMA channel for int7\n");
139 goto bail;
140 }
141 break;
142 case dma_usb:
143 if (dmanr == USB_TX_DMA_NBR) {
144 SETS(gens, R_GEN_CONFIG, dma8, usb);
145 } else if (dmanr == USB_RX_DMA_NBR) {
146 SETS(gens, R_GEN_CONFIG, dma9, usb);
147 } else {
148 printk(KERN_CRIT "Invalid DMA channel for usb\n");
149 goto bail;
150 }
151 break;
152 case dma_scsi0:
153 if (dmanr == SCSI0_TX_DMA_NBR) {
154 SETS(gens, R_GEN_CONFIG, dma2, scsi0);
155 } else if (dmanr == SCSI0_RX_DMA_NBR) {
156 SETS(gens, R_GEN_CONFIG, dma3, scsi0);
157 } else {
158 printk(KERN_CRIT "Invalid DMA channel for scsi0\n");
159 goto bail;
160 }
161 break;
162 case dma_scsi1:
163 if (dmanr == SCSI1_TX_DMA_NBR) {
164 SETS(gens, R_GEN_CONFIG, dma4, scsi1);
165 } else if (dmanr == SCSI1_RX_DMA_NBR) {
166 SETS(gens, R_GEN_CONFIG, dma5, scsi1);
167 } else {
168 printk(KERN_CRIT "Invalid DMA channel for scsi1\n");
169 goto bail;
170 }
171 break;
172 case dma_par0:
173 if (dmanr == PAR0_TX_DMA_NBR) {
174 SETS(gens, R_GEN_CONFIG, dma2, par0);
175 } else if (dmanr == PAR0_RX_DMA_NBR) {
176 SETS(gens, R_GEN_CONFIG, dma3, par0);
177 } else {
178 printk(KERN_CRIT "Invalid DMA channel for par0\n");
179 goto bail;
180 }
181 break;
182 case dma_par1:
183 if (dmanr == PAR1_TX_DMA_NBR) {
184 SETS(gens, R_GEN_CONFIG, dma4, par1);
185 } else if (dmanr == PAR1_RX_DMA_NBR) {
186 SETS(gens, R_GEN_CONFIG, dma5, par1);
187 } else {
188 printk(KERN_CRIT "Invalid DMA channel for par1\n");
189 goto bail;
190 }
191 break;
192 default:
193 printk(KERN_CRIT "Invalid DMA owner.\n");
194 goto bail;
195 }
196
197 used_dma_channels[dmanr] = 1;
198 used_dma_channels_users[dmanr] = device_id;
199
200 {
201 volatile int i;
202 genconfig_shadow = gens;
203 *R_GEN_CONFIG = genconfig_shadow;
204 /* Wait 12 cycles before doing any DMA command */
205 for(i = 6; i > 0; i--)
206 nop();
207 }
208 fail = 0;
209 bail:
210 local_irq_restore(flags);
211 return fail;
212}
213
214void cris_free_dma(unsigned int dmanr, const char * device_id)
215{
216 unsigned long flags;
217 if ((dmanr < 0) || (dmanr >= MAX_DMA_CHANNELS)) {
218 printk(KERN_CRIT "cris_free_dma: invalid DMA channel %u\n", dmanr);
219 return;
220 }
221
222 local_irq_save(flags);
223 if (!used_dma_channels[dmanr]) {
224 printk(KERN_CRIT "cris_free_dma: DMA channel %u not allocated\n", dmanr);
225 } else if (device_id != used_dma_channels_users[dmanr]) {
226 printk(KERN_CRIT "cris_free_dma: DMA channel %u not allocated by device\n", dmanr);
227 } else {
228 switch(dmanr)
229 {
230 case 0:
231 *R_DMA_CH0_CMD = IO_STATE(R_DMA_CH0_CMD, cmd, reset);
232 while (IO_EXTRACT(R_DMA_CH0_CMD, cmd, *R_DMA_CH0_CMD) ==
233 IO_STATE_VALUE(R_DMA_CH0_CMD, cmd, reset));
234 break;
235 case 1:
236 *R_DMA_CH1_CMD = IO_STATE(R_DMA_CH1_CMD, cmd, reset);
237 while (IO_EXTRACT(R_DMA_CH1_CMD, cmd, *R_DMA_CH1_CMD) ==
238 IO_STATE_VALUE(R_DMA_CH1_CMD, cmd, reset));
239 break;
240 case 2:
241 *R_DMA_CH2_CMD = IO_STATE(R_DMA_CH2_CMD, cmd, reset);
242 while (IO_EXTRACT(R_DMA_CH2_CMD, cmd, *R_DMA_CH2_CMD) ==
243 IO_STATE_VALUE(R_DMA_CH2_CMD, cmd, reset));
244 break;
245 case 3:
246 *R_DMA_CH3_CMD = IO_STATE(R_DMA_CH3_CMD, cmd, reset);
247 while (IO_EXTRACT(R_DMA_CH3_CMD, cmd, *R_DMA_CH3_CMD) ==
248 IO_STATE_VALUE(R_DMA_CH3_CMD, cmd, reset));
249 break;
250 case 4:
251 *R_DMA_CH4_CMD = IO_STATE(R_DMA_CH4_CMD, cmd, reset);
252 while (IO_EXTRACT(R_DMA_CH4_CMD, cmd, *R_DMA_CH4_CMD) ==
253 IO_STATE_VALUE(R_DMA_CH4_CMD, cmd, reset));
254 break;
255 case 5:
256 *R_DMA_CH5_CMD = IO_STATE(R_DMA_CH5_CMD, cmd, reset);
257 while (IO_EXTRACT(R_DMA_CH5_CMD, cmd, *R_DMA_CH5_CMD) ==
258 IO_STATE_VALUE(R_DMA_CH5_CMD, cmd, reset));
259 break;
260 case 6:
261 *R_DMA_CH6_CMD = IO_STATE(R_DMA_CH6_CMD, cmd, reset);
262 while (IO_EXTRACT(R_DMA_CH6_CMD, cmd, *R_DMA_CH6_CMD) ==
263 IO_STATE_VALUE(R_DMA_CH6_CMD, cmd, reset));
264 break;
265 case 7:
266 *R_DMA_CH7_CMD = IO_STATE(R_DMA_CH7_CMD, cmd, reset);
267 while (IO_EXTRACT(R_DMA_CH7_CMD, cmd, *R_DMA_CH7_CMD) ==
268 IO_STATE_VALUE(R_DMA_CH7_CMD, cmd, reset));
269 break;
270 case 8:
271 *R_DMA_CH8_CMD = IO_STATE(R_DMA_CH8_CMD, cmd, reset);
272 while (IO_EXTRACT(R_DMA_CH8_CMD, cmd, *R_DMA_CH8_CMD) ==
273 IO_STATE_VALUE(R_DMA_CH8_CMD, cmd, reset));
274 break;
275 case 9:
276 *R_DMA_CH9_CMD = IO_STATE(R_DMA_CH9_CMD, cmd, reset);
277 while (IO_EXTRACT(R_DMA_CH9_CMD, cmd, *R_DMA_CH9_CMD) ==
278 IO_STATE_VALUE(R_DMA_CH9_CMD, cmd, reset));
279 break;
280 }
281 used_dma_channels[dmanr] = 0;
282 }
283 local_irq_restore(flags);
284}
285
286EXPORT_SYMBOL(cris_request_dma);
287EXPORT_SYMBOL(cris_free_dma);
diff --git a/arch/cris/arch-v10/kernel/entry.S b/arch/cris/arch-v10/kernel/entry.S
index 1bc44f481c34..c0163bf94a50 100644
--- a/arch/cris/arch-v10/kernel/entry.S
+++ b/arch/cris/arch-v10/kernel/entry.S
@@ -1,4 +1,4 @@
1/* $Id: entry.S,v 1.23 2004/10/19 13:07:37 starvik Exp $ 1/* $Id: entry.S,v 1.28 2005/06/20 05:06:30 starvik Exp $
2 * 2 *
3 * linux/arch/cris/entry.S 3 * linux/arch/cris/entry.S
4 * 4 *
@@ -7,6 +7,22 @@
7 * Authors: Bjorn Wesen (bjornw@axis.com) 7 * Authors: Bjorn Wesen (bjornw@axis.com)
8 * 8 *
9 * $Log: entry.S,v $ 9 * $Log: entry.S,v $
10 * Revision 1.28 2005/06/20 05:06:30 starvik
11 * Remove unnecessary diff to kernel.org tree
12 *
13 * Revision 1.27 2005/03/04 08:16:16 starvik
14 * Merge of Linux 2.6.11.
15 *
16 * Revision 1.26 2005/01/11 13:49:47 starvik
17 * Added NMI handler.
18 *
19 * Revision 1.25 2004/12/27 11:18:32 starvik
20 * Merge of Linux 2.6.10 (not functional yet).
21 *
22 * Revision 1.24 2004/12/22 10:41:23 starvik
23 * Updates to make v10 compile with the latest SMP aware generic code (even
24 * though v10 will never have SMP).
25 *
10 * Revision 1.23 2004/10/19 13:07:37 starvik 26 * Revision 1.23 2004/10/19 13:07:37 starvik
11 * Merge of Linux 2.6.9 27 * Merge of Linux 2.6.9
12 * 28 *
@@ -279,6 +295,7 @@
279#ifdef CONFIG_PREEMPT 295#ifdef CONFIG_PREEMPT
280 ; Check if preemptive kernel scheduling should be done 296 ; Check if preemptive kernel scheduling should be done
281_resume_kernel: 297_resume_kernel:
298 di
282 ; Load current task struct 299 ; Load current task struct
283 movs.w -8192, $r0 ; THREAD_SIZE = 8192 300 movs.w -8192, $r0 ; THREAD_SIZE = 8192
284 and.d $sp, $r0 301 and.d $sp, $r0
@@ -291,12 +308,7 @@ _need_resched:
291 bpl _Rexit 308 bpl _Rexit
292 nop 309 nop
293 ; Ok, lets's do some preemptive kernel scheduling 310 ; Ok, lets's do some preemptive kernel scheduling
294 move.d PREEMPT_ACTIVE, $r10 311 jsr preempt_schedule_irq
295 move.d $r10, [$r0+TI_preempt_count] ; Mark as active
296 ei
297 jsr schedule
298 clear.d [$r0+TI_preempt_count] ; Mark as inactive
299 di
300 ; Load new task struct 312 ; Load new task struct
301 movs.w -8192, $r0 ; THREAD_SIZE = 8192 313 movs.w -8192, $r0 ; THREAD_SIZE = 8192
302 and.d $sp, $r0 314 and.d $sp, $r0
@@ -590,15 +602,15 @@ mmu_bus_fault:
590 move.d $r0, [$sp+16] 602 move.d $r0, [$sp+16]
5911: btstq 12, $r1 ; Refill? 6031: btstq 12, $r1 ; Refill?
592 bpl 2f 604 bpl 2f
593 lsrq PMD_SHIFT, $r1 ; Get PMD index into PGD (bit 24-31) 605 lsrq 24, $r1 ; Get PGD index (bit 24-31)
594 move.d [current_pgd], $r0 ; PGD for the current process 606 move.d [per_cpu__current_pgd], $r0 ; PGD for the current process
595 move.d [$r0+$r1.d], $r0 ; Get PMD 607 move.d [$r0+$r1.d], $r0 ; Get PMD
596 beq 2f 608 beq 2f
597 nop 609 nop
598 and.w PAGE_MASK, $r0 ; Remove PMD flags 610 and.w PAGE_MASK, $r0 ; Remove PMD flags
599 move.d [R_MMU_CAUSE], $r1 611 move.d [R_MMU_CAUSE], $r1
600 lsrq PAGE_SHIFT, $r1 612 lsrq PAGE_SHIFT, $r1
601 and.d 0x7ff, $r1 ; Get PTE index into PMD (bit 13-24) 613 and.d 0x7ff, $r1 ; Get PTE index into PGD (bit 13-23)
602 move.d [$r0+$r1.d], $r1 ; Get PTE 614 move.d [$r0+$r1.d], $r1 ; Get PTE
603 beq 2f 615 beq 2f
604 nop 616 nop
@@ -656,11 +668,6 @@ hwbreakpoint:
656 nop 668 nop
657 669
658IRQ1_interrupt: 670IRQ1_interrupt:
659
660#if defined(CONFIG_ETRAX_WATCHDOG) && !defined(CONFIG_SVINTO_SIM)
661;; If we receive a watchdog interrupt while it is not expected, then set
662;; up a canonical frame and dump register contents before dying.
663
664 ;; this prologue MUST match the one in irq.h and the struct in ptregs.h!!! 671 ;; this prologue MUST match the one in irq.h and the struct in ptregs.h!!!
665 move $brp,[$sp=$sp-16]; instruction pointer and room for a fake SBFS frame 672 move $brp,[$sp=$sp-16]; instruction pointer and room for a fake SBFS frame
666 push $srp 673 push $srp
@@ -672,9 +679,16 @@ IRQ1_interrupt:
672 push $r10 ; push orig_r10 679 push $r10 ; push orig_r10
673 clear.d [$sp=$sp-4] ; frametype == 0, normal frame 680 clear.d [$sp=$sp-4] ; frametype == 0, normal frame
674 681
675;; We don't check that we actually were bit by the watchdog as opposed to 682 move.d [R_IRQ_MASK0_RD], $r1 ; External NMI or watchdog?
676;; an external NMI, since there is currently no handler for external NMI. 683 and.d 0x80000000, $r1
677 684 beq wdog
685 move.d $sp, $r10
686 jsr handle_nmi
687 setf m ; Enable NMI again
688 retb ; Return from NMI
689 nop
690wdog:
691#if defined(CONFIG_ETRAX_WATCHDOG) && !defined(CONFIG_SVINTO_SIM)
678;; Check if we're waiting for reset to happen, as signalled by 692;; Check if we're waiting for reset to happen, as signalled by
679;; hard_reset_now setting cause_of_death to a magic value. If so, just 693;; hard_reset_now setting cause_of_death to a magic value. If so, just
680;; get stuck until reset happens. 694;; get stuck until reset happens.
@@ -1118,6 +1132,10 @@ sys_call_table:
1118 .long sys_mq_getsetattr 1132 .long sys_mq_getsetattr
1119 .long sys_ni_syscall /* reserved for kexec */ 1133 .long sys_ni_syscall /* reserved for kexec */
1120 .long sys_waitid 1134 .long sys_waitid
1135 .long sys_ni_syscall /* 285 */ /* available */
1136 .long sys_add_key
1137 .long sys_request_key
1138 .long sys_keyctl
1121 1139
1122 /* 1140 /*
1123 * NOTE!! This doesn't have to be exact - we just have 1141 * NOTE!! This doesn't have to be exact - we just have
diff --git a/arch/cris/arch-v10/kernel/fasttimer.c b/arch/cris/arch-v10/kernel/fasttimer.c
index 4717f7ae8e51..094ff45ae85b 100644
--- a/arch/cris/arch-v10/kernel/fasttimer.c
+++ b/arch/cris/arch-v10/kernel/fasttimer.c
@@ -1,10 +1,20 @@
1/* $Id: fasttimer.c,v 1.6 2004/05/14 10:18:39 starvik Exp $ 1/* $Id: fasttimer.c,v 1.9 2005/03/04 08:16:16 starvik Exp $
2 * linux/arch/cris/kernel/fasttimer.c 2 * linux/arch/cris/kernel/fasttimer.c
3 * 3 *
4 * Fast timers for ETRAX100/ETRAX100LX 4 * Fast timers for ETRAX100/ETRAX100LX
5 * This may be useful in other OS than Linux so use 2 space indentation... 5 * This may be useful in other OS than Linux so use 2 space indentation...
6 * 6 *
7 * $Log: fasttimer.c,v $ 7 * $Log: fasttimer.c,v $
8 * Revision 1.9 2005/03/04 08:16:16 starvik
9 * Merge of Linux 2.6.11.
10 *
11 * Revision 1.8 2005/01/05 06:09:29 starvik
12 * cli()/sti() will be obsolete in 2.6.11.
13 *
14 * Revision 1.7 2005/01/03 13:35:46 starvik
15 * Removed obsolete stuff.
16 * Mark fast timer IRQ as not shared.
17 *
8 * Revision 1.6 2004/05/14 10:18:39 starvik 18 * Revision 1.6 2004/05/14 10:18:39 starvik
9 * Export fast_timer_list 19 * Export fast_timer_list
10 * 20 *
@@ -148,8 +158,7 @@ static int debug_log_cnt_wrapped = 0;
148#define DEBUG_LOG(string, value) \ 158#define DEBUG_LOG(string, value) \
149{ \ 159{ \
150 unsigned long log_flags; \ 160 unsigned long log_flags; \
151 save_flags(log_flags); \ 161 local_irq_save(log_flags); \
152 cli(); \
153 debug_log_string[debug_log_cnt] = (string); \ 162 debug_log_string[debug_log_cnt] = (string); \
154 debug_log_value[debug_log_cnt] = (unsigned long)(value); \ 163 debug_log_value[debug_log_cnt] = (unsigned long)(value); \
155 if (++debug_log_cnt >= DEBUG_LOG_MAX) \ 164 if (++debug_log_cnt >= DEBUG_LOG_MAX) \
@@ -157,7 +166,7 @@ static int debug_log_cnt_wrapped = 0;
157 debug_log_cnt = debug_log_cnt % DEBUG_LOG_MAX; \ 166 debug_log_cnt = debug_log_cnt % DEBUG_LOG_MAX; \
158 debug_log_cnt_wrapped = 1; \ 167 debug_log_cnt_wrapped = 1; \
159 } \ 168 } \
160 restore_flags(log_flags); \ 169 local_irq_restore(log_flags); \
161} 170}
162#else 171#else
163#define DEBUG_LOG(string, value) 172#define DEBUG_LOG(string, value)
@@ -320,8 +329,7 @@ void start_one_shot_timer(struct fast_timer *t,
320 329
321 D1(printk("sft %s %d us\n", name, delay_us)); 330 D1(printk("sft %s %d us\n", name, delay_us));
322 331
323 save_flags(flags); 332 local_irq_save(flags);
324 cli();
325 333
326 do_gettimeofday_fast(&t->tv_set); 334 do_gettimeofday_fast(&t->tv_set);
327 tmp = fast_timer_list; 335 tmp = fast_timer_list;
@@ -395,7 +403,7 @@ void start_one_shot_timer(struct fast_timer *t,
395 403
396 D2(printk("start_one_shot_timer: %d us done\n", delay_us)); 404 D2(printk("start_one_shot_timer: %d us done\n", delay_us));
397 405
398 restore_flags(flags); 406 local_irq_restore(flags);
399} /* start_one_shot_timer */ 407} /* start_one_shot_timer */
400 408
401static inline int fast_timer_pending (const struct fast_timer * t) 409static inline int fast_timer_pending (const struct fast_timer * t)
@@ -425,11 +433,10 @@ int del_fast_timer(struct fast_timer * t)
425 unsigned long flags; 433 unsigned long flags;
426 int ret; 434 int ret;
427 435
428 save_flags(flags); 436 local_irq_save(flags);
429 cli();
430 ret = detach_fast_timer(t); 437 ret = detach_fast_timer(t);
431 t->next = t->prev = NULL; 438 t->next = t->prev = NULL;
432 restore_flags(flags); 439 local_irq_restore(flags);
433 return ret; 440 return ret;
434} /* del_fast_timer */ 441} /* del_fast_timer */
435 442
@@ -444,8 +451,7 @@ timer1_handler(int irq, void *dev_id, struct pt_regs *regs)
444 struct fast_timer *t; 451 struct fast_timer *t;
445 unsigned long flags; 452 unsigned long flags;
446 453
447 save_flags(flags); 454 local_irq_save(flags);
448 cli();
449 455
450 /* Clear timer1 irq */ 456 /* Clear timer1 irq */
451 *R_IRQ_MASK0_CLR = IO_STATE(R_IRQ_MASK0_CLR, timer1, clr); 457 *R_IRQ_MASK0_CLR = IO_STATE(R_IRQ_MASK0_CLR, timer1, clr);
@@ -462,7 +468,7 @@ timer1_handler(int irq, void *dev_id, struct pt_regs *regs)
462 fast_timer_running = 0; 468 fast_timer_running = 0;
463 fast_timer_ints++; 469 fast_timer_ints++;
464 470
465 restore_flags(flags); 471 local_irq_restore(flags);
466 472
467 t = fast_timer_list; 473 t = fast_timer_list;
468 while (t) 474 while (t)
@@ -482,8 +488,7 @@ timer1_handler(int irq, void *dev_id, struct pt_regs *regs)
482 fast_timers_expired++; 488 fast_timers_expired++;
483 489
484 /* Remove this timer before call, since it may reuse the timer */ 490 /* Remove this timer before call, since it may reuse the timer */
485 save_flags(flags); 491 local_irq_save(flags);
486 cli();
487 if (t->prev) 492 if (t->prev)
488 { 493 {
489 t->prev->next = t->next; 494 t->prev->next = t->next;
@@ -498,7 +503,7 @@ timer1_handler(int irq, void *dev_id, struct pt_regs *regs)
498 } 503 }
499 t->prev = NULL; 504 t->prev = NULL;
500 t->next = NULL; 505 t->next = NULL;
501 restore_flags(flags); 506 local_irq_restore(flags);
502 507
503 if (t->function != NULL) 508 if (t->function != NULL)
504 { 509 {
@@ -515,8 +520,7 @@ timer1_handler(int irq, void *dev_id, struct pt_regs *regs)
515 D1(printk(".\n")); 520 D1(printk(".\n"));
516 } 521 }
517 522
518 save_flags(flags); 523 local_irq_save(flags);
519 cli();
520 if ((t = fast_timer_list) != NULL) 524 if ((t = fast_timer_list) != NULL)
521 { 525 {
522 /* Start next timer.. */ 526 /* Start next timer.. */
@@ -535,7 +539,7 @@ timer1_handler(int irq, void *dev_id, struct pt_regs *regs)
535#endif 539#endif
536 start_timer1(us); 540 start_timer1(us);
537 } 541 }
538 restore_flags(flags); 542 local_irq_restore(flags);
539 break; 543 break;
540 } 544 }
541 else 545 else
@@ -546,7 +550,7 @@ timer1_handler(int irq, void *dev_id, struct pt_regs *regs)
546 D1(printk("e! %d\n", us)); 550 D1(printk("e! %d\n", us));
547 } 551 }
548 } 552 }
549 restore_flags(flags); 553 local_irq_restore(flags);
550 } 554 }
551 555
552 if (!t) 556 if (!t)
@@ -748,13 +752,12 @@ static int proc_fasttimer_read(char *buf, char **start, off_t offset, int len
748#endif 752#endif
749 753
750 used += sprintf(bigbuf + used, "Active timers:\n"); 754 used += sprintf(bigbuf + used, "Active timers:\n");
751 save_flags(flags); 755 local_irq_save(flags);
752 cli();
753 t = fast_timer_list; 756 t = fast_timer_list;
754 while (t != NULL && (used+100 < BIG_BUF_SIZE)) 757 while (t != NULL && (used+100 < BIG_BUF_SIZE))
755 { 758 {
756 nextt = t->next; 759 nextt = t->next;
757 restore_flags(flags); 760 local_irq_restore(flags);
758 used += sprintf(bigbuf + used, "%-14s s: %6lu.%06lu e: %6lu.%06lu " 761 used += sprintf(bigbuf + used, "%-14s s: %6lu.%06lu e: %6lu.%06lu "
759 "d: %6li us data: 0x%08lX" 762 "d: %6li us data: 0x%08lX"
760/* " func: 0x%08lX" */ 763/* " func: 0x%08lX" */
@@ -768,14 +771,14 @@ static int proc_fasttimer_read(char *buf, char **start, off_t offset, int len
768 t->data 771 t->data
769/* , t->function */ 772/* , t->function */
770 ); 773 );
771 cli(); 774 local_irq_disable();
772 if (t->next != nextt) 775 if (t->next != nextt)
773 { 776 {
774 printk(KERN_WARNING "timer removed!\n"); 777 printk(KERN_WARNING "timer removed!\n");
775 } 778 }
776 t = nextt; 779 t = nextt;
777 } 780 }
778 restore_flags(flags); 781 local_irq_restore(flags);
779 } 782 }
780 783
781 if (used - offset < len) 784 if (used - offset < len)
@@ -963,7 +966,7 @@ void fast_timer_init(void)
963 if ((fasttimer_proc_entry = create_proc_entry( "fasttimer", 0, 0 ))) 966 if ((fasttimer_proc_entry = create_proc_entry( "fasttimer", 0, 0 )))
964 fasttimer_proc_entry->read_proc = proc_fasttimer_read; 967 fasttimer_proc_entry->read_proc = proc_fasttimer_read;
965#endif /* PROC_FS */ 968#endif /* PROC_FS */
966 if(request_irq(TIMER1_IRQ_NBR, timer1_handler, SA_SHIRQ, 969 if(request_irq(TIMER1_IRQ_NBR, timer1_handler, 0,
967 "fast timer int", NULL)) 970 "fast timer int", NULL))
968 { 971 {
969 printk("err: timer1 irq\n"); 972 printk("err: timer1 irq\n");
diff --git a/arch/cris/arch-v10/kernel/head.S b/arch/cris/arch-v10/kernel/head.S
index 2c1dd1184a8f..f00c145b43f1 100644
--- a/arch/cris/arch-v10/kernel/head.S
+++ b/arch/cris/arch-v10/kernel/head.S
@@ -1,4 +1,4 @@
1/* $Id: head.S,v 1.7 2004/05/14 07:58:01 starvik Exp $ 1/* $Id: head.S,v 1.10 2005/06/20 05:12:54 starvik Exp $
2 * 2 *
3 * Head of the kernel - alter with care 3 * Head of the kernel - alter with care
4 * 4 *
@@ -7,6 +7,16 @@
7 * Authors: Bjorn Wesen (bjornw@axis.com) 7 * Authors: Bjorn Wesen (bjornw@axis.com)
8 * 8 *
9 * $Log: head.S,v $ 9 * $Log: head.S,v $
10 * Revision 1.10 2005/06/20 05:12:54 starvik
11 * Remove unnecessary diff to kernel.org tree
12 *
13 * Revision 1.9 2004/12/13 12:21:51 starvik
14 * Added I/O and DMA allocators from Linux 2.4
15 *
16 * Revision 1.8 2004/11/22 11:41:14 starvik
17 * Kernel command line may be supplied to kernel. Not used by Axis but may
18 * be used by customers.
19 *
10 * Revision 1.7 2004/05/14 07:58:01 starvik 20 * Revision 1.7 2004/05/14 07:58:01 starvik
11 * Merge of changes from 2.4 21 * Merge of changes from 2.4
12 * 22 *
@@ -181,6 +191,7 @@
181 191
182#define CRAMFS_MAGIC 0x28cd3d45 192#define CRAMFS_MAGIC 0x28cd3d45
183#define RAM_INIT_MAGIC 0x56902387 193#define RAM_INIT_MAGIC 0x56902387
194#define COMMAND_LINE_MAGIC 0x87109563
184 195
185#define START_ETHERNET_CLOCK IO_STATE(R_NETWORK_GEN_CONFIG, enable, on) |\ 196#define START_ETHERNET_CLOCK IO_STATE(R_NETWORK_GEN_CONFIG, enable, on) |\
186 IO_STATE(R_NETWORK_GEN_CONFIG, phy, mii_clk) 197 IO_STATE(R_NETWORK_GEN_CONFIG, phy, mii_clk)
@@ -490,6 +501,23 @@ _no_romfs_in_flash:
490 501
491_start_it: 502_start_it:
492 503
504 ;; Check if kernel command line is supplied
505 cmp.d COMMAND_LINE_MAGIC, $r10
506 bne no_command_line
507 nop
508
509 move.d 256, $r13
510 move.d cris_command_line, $r10
511 or.d 0x80000000, $r11 ; Make it virtual
5121:
513 move.b [$r11+], $r12
514 move.b $r12, [$r10+]
515 subq 1, $r13
516 bne 1b
517 nop
518
519no_command_line:
520
493 ;; the kernel stack is overlayed with the task structure for each 521 ;; the kernel stack is overlayed with the task structure for each
494 ;; task. thus the initial kernel stack is in the same page as the 522 ;; task. thus the initial kernel stack is in the same page as the
495 ;; init_task (but starts in the top of the page, size 8192) 523 ;; init_task (but starts in the top of the page, size 8192)
@@ -567,76 +595,32 @@ _start_it:
567 ;; Etrax product HW genconfig setup 595 ;; Etrax product HW genconfig setup
568 596
569 moveq 0,$r0 597 moveq 0,$r0
570#if (!defined(CONFIG_ETRAX_KGDB) || !defined(CONFIG_ETRAX_DEBUG_PORT0)) \ 598
571 && !defined(CONFIG_DMA_MEMCPY) 599 ;; Init interfaces (disable them).
572 ; DMA channels 6 and 7 to ser0, kgdb doesnt want DMA 600 or.d IO_STATE (R_GEN_CONFIG, scsi0, disable) \
573 or.d IO_STATE (R_GEN_CONFIG, dma7, serial0) \ 601 | IO_STATE (R_GEN_CONFIG, ata, disable) \
574 | IO_STATE (R_GEN_CONFIG, dma6, serial0),$r0 602 | IO_STATE (R_GEN_CONFIG, par0, disable) \
575#endif 603 | IO_STATE (R_GEN_CONFIG, ser2, disable) \
576#if !defined(CONFIG_ETRAX_KGDB) || !defined(CONFIG_ETRAX_DEBUG_PORT1) 604 | IO_STATE (R_GEN_CONFIG, mio, disable) \
577 ; DMA channels 8 and 9 to ser1, kgdb doesnt want DMA 605 | IO_STATE (R_GEN_CONFIG, scsi1, disable) \
578 or.d IO_STATE (R_GEN_CONFIG, dma9, serial1) \ 606 | IO_STATE (R_GEN_CONFIG, scsi0w, disable) \
579 | IO_STATE (R_GEN_CONFIG, dma8, serial1),$r0 607 | IO_STATE (R_GEN_CONFIG, par1, disable) \
580#endif 608 | IO_STATE (R_GEN_CONFIG, ser3, disable) \
581#ifdef CONFIG_DMA_MEMCPY 609 | IO_STATE (R_GEN_CONFIG, mio_w, disable) \
582 ; 6/7 memory-memory DMA 610 | IO_STATE (R_GEN_CONFIG, usb1, disable) \
583 or.d IO_STATE (R_GEN_CONFIG, dma7, intdma6) \ 611 | IO_STATE (R_GEN_CONFIG, usb2, disable) \
584 | IO_STATE (R_GEN_CONFIG, dma6, intdma7),$r0 612 | IO_STATE (R_GEN_CONFIG, par_w, disable),$r0
585#endif 613
586#ifdef CONFIG_ETRAX_SERIAL_PORT2 614 ;; Init DMA channel muxing (set to unused clients).
587 ; Enable serial port 2 615 or.d IO_STATE (R_GEN_CONFIG, dma2, ata) \
588 or.w IO_STATE (R_GEN_CONFIG, ser2, select),$r0 616 | IO_STATE (R_GEN_CONFIG, dma3, ata) \
589#if !defined(CONFIG_ETRAX_KGDB) || !defined(CONFIG_ETRAX_DEBUG_PORT2) 617 | IO_STATE (R_GEN_CONFIG, dma4, scsi1) \
590 ; DMA channels 2 and 3 to ser2, kgdb doesnt want DMA 618 | IO_STATE (R_GEN_CONFIG, dma5, scsi1) \
591 or.d IO_STATE (R_GEN_CONFIG, dma3, serial2) \ 619 | IO_STATE (R_GEN_CONFIG, dma6, unused) \
592 | IO_STATE (R_GEN_CONFIG, dma2, serial2),$r0 620 | IO_STATE (R_GEN_CONFIG, dma7, unused) \
593#endif 621 | IO_STATE (R_GEN_CONFIG, dma8, usb) \
594#endif 622 | IO_STATE (R_GEN_CONFIG, dma9, usb),$r0
595#if defined(CONFIG_ETRAX_SERIAL_PORT3) || defined(CONFIG_ETRAX_SYNCHRONOUS_SERIAL_PORT1) 623
596 ; Enable serial port 3
597 or.w IO_STATE (R_GEN_CONFIG, ser3, select),$r0
598#if !defined(CONFIG_ETRAX_KGDB) || !defined(CONFIG_ETRAX_DEBUG_PORT3)
599 ; DMA channels 4 and 5 to ser3, kgdb doesnt want DMA
600 or.d IO_STATE (R_GEN_CONFIG, dma5, serial3) \
601 | IO_STATE (R_GEN_CONFIG, dma4, serial3),$r0
602#endif
603#endif
604#if defined(CONFIG_ETRAX_PARALLEL_PORT0) || defined(CONFIG_ETRAX_ETHERNET_LPSLAVE)
605 ; parport 0 enabled using DMA 2/3
606 or.w IO_STATE (R_GEN_CONFIG, par0, select),$r0
607#endif
608#if defined(CONFIG_ETRAX_PARALLEL_PORT1) || defined(CONFIG_ETRAX_ETHERNET_LPSLAVE)
609 ; parport 1 enabled using DMA 4/5
610 or.w IO_STATE (R_GEN_CONFIG, par1, select),$r0
611#endif
612#ifdef CONFIG_ETRAX_IDE
613 ; DMA channels 2 and 3 to ATA, ATA enabled
614 or.d IO_STATE (R_GEN_CONFIG, dma3, ata) \
615 | IO_STATE (R_GEN_CONFIG, dma2, ata) \
616 | IO_STATE (R_GEN_CONFIG, ata, select),$r0
617#endif
618
619#ifdef CONFIG_ETRAX_USB_HOST_PORT1
620 ; Set the USB port 1 enable bit
621 or.d IO_STATE (R_GEN_CONFIG, usb1, select),$r0
622#endif
623#ifdef CONFIG_ETRAX_USB_HOST_PORT2
624 ; Set the USB port 2 enable bit
625 or.d IO_STATE (R_GEN_CONFIG, usb2, select),$r0
626#endif
627#ifdef CONFIG_ETRAX_USB_HOST
628 ; Connect DMA channels 8 and 9 to USB
629 and.d (~(IO_MASK (R_GEN_CONFIG, dma9) \
630 | IO_MASK (R_GEN_CONFIG, dma8))) \
631 | IO_STATE (R_GEN_CONFIG, dma9, usb) \
632 | IO_STATE (R_GEN_CONFIG, dma8, usb),$r0
633#endif
634
635#ifdef CONFIG_JULIETTE
636 ; DMA channels 4 and 5 to EXTDMA0, for Juliette
637 or.d IO_STATE (R_GEN_CONFIG, dma5, extdma0) \
638 | IO_STATE (R_GEN_CONFIG, dma4, extdma0),$r0
639#endif
640 624
641#if defined(CONFIG_ETRAX_DEF_R_PORT_G0_DIR_OUT) 625#if defined(CONFIG_ETRAX_DEF_R_PORT_G0_DIR_OUT)
642 or.d IO_STATE (R_GEN_CONFIG, g0dir, out),$r0 626 or.d IO_STATE (R_GEN_CONFIG, g0dir, out),$r0
diff --git a/arch/cris/arch-v10/kernel/io_interface_mux.c b/arch/cris/arch-v10/kernel/io_interface_mux.c
new file mode 100644
index 000000000000..29d48ad00df9
--- /dev/null
+++ b/arch/cris/arch-v10/kernel/io_interface_mux.c
@@ -0,0 +1,879 @@
1/* IO interface mux allocator for ETRAX100LX.
2 * Copyright 2004, Axis Communications AB
3 * $Id: io_interface_mux.c,v 1.2 2004/12/21 12:08:38 starvik Exp $
4 */
5
6
7/* C.f. ETRAX100LX Designer's Reference 20.9 */
8
9#include <linux/kernel.h>
10#include <linux/slab.h>
11#include <linux/errno.h>
12#include <linux/module.h>
13#include <linux/init.h>
14
15#include <asm/arch/svinto.h>
16#include <asm/io.h>
17#include <asm/arch/io_interface_mux.h>
18
19
20#define DBG(s)
21
22/* Macro to access ETRAX 100 registers */
23#define SETS(var, reg, field, val) var = (var & ~IO_MASK_(reg##_, field##_)) | \
24 IO_STATE_(reg##_, field##_, _##val)
25
26enum io_if_group {
27 group_a = (1<<0),
28 group_b = (1<<1),
29 group_c = (1<<2),
30 group_d = (1<<3),
31 group_e = (1<<4),
32 group_f = (1<<5)
33};
34
35struct watcher
36{
37 void (*notify)(const unsigned int gpio_in_available,
38 const unsigned int gpio_out_available,
39 const unsigned char pa_available,
40 const unsigned char pb_available);
41 struct watcher *next;
42};
43
44
45struct if_group
46{
47 enum io_if_group group;
48 unsigned char used;
49 enum cris_io_interface owner;
50};
51
52
53struct interface
54{
55 enum cris_io_interface ioif;
56 unsigned char groups;
57 unsigned char used;
58 char *owner;
59 unsigned int gpio_g_in;
60 unsigned int gpio_g_out;
61 unsigned char gpio_b;
62};
63
64static struct if_group if_groups[6] = {
65 {
66 .group = group_a,
67 .used = 0,
68 },
69 {
70 .group = group_b,
71 .used = 0,
72 },
73 {
74 .group = group_c,
75 .used = 0,
76 },
77 {
78 .group = group_d,
79 .used = 0,
80 },
81 {
82 .group = group_e,
83 .used = 0,
84 },
85 {
86 .group = group_f,
87 .used = 0,
88 }
89};
90
91/* The order in the array must match the order of enum
92 * cris_io_interface in io_interface_mux.h */
93static struct interface interfaces[] = {
94 /* Begin Non-multiplexed interfaces */
95 {
96 .ioif = if_eth,
97 .groups = 0,
98 .gpio_g_in = 0,
99 .gpio_g_out = 0,
100 .gpio_b = 0
101 },
102 {
103 .ioif = if_serial_0,
104 .groups = 0,
105 .gpio_g_in = 0,
106 .gpio_g_out = 0,
107 .gpio_b = 0
108 },
109 /* End Non-multiplexed interfaces */
110 {
111 .ioif = if_serial_1,
112 .groups = group_e,
113 .gpio_g_in = 0x00000000,
114 .gpio_g_out = 0x00000000,
115 .gpio_b = 0x00
116 },
117 {
118 .ioif = if_serial_2,
119 .groups = group_b,
120 .gpio_g_in = 0x000000c0,
121 .gpio_g_out = 0x000000c0,
122 .gpio_b = 0x00
123 },
124 {
125 .ioif = if_serial_3,
126 .groups = group_c,
127 .gpio_g_in = 0xc0000000,
128 .gpio_g_out = 0xc0000000,
129 .gpio_b = 0x00
130 },
131 {
132 .ioif = if_sync_serial_1,
133 .groups = group_e | group_f, /* if_sync_serial_1 and if_sync_serial_3
134 can be used simultaneously */
135 .gpio_g_in = 0x00000000,
136 .gpio_g_out = 0x00000000,
137 .gpio_b = 0x10
138 },
139 {
140 .ioif = if_sync_serial_3,
141 .groups = group_c | group_f,
142 .gpio_g_in = 0xc0000000,
143 .gpio_g_out = 0xc0000000,
144 .gpio_b = 0x80
145 },
146 {
147 .ioif = if_shared_ram,
148 .groups = group_a,
149 .gpio_g_in = 0x0000ff3e,
150 .gpio_g_out = 0x0000ff38,
151 .gpio_b = 0x00
152 },
153 {
154 .ioif = if_shared_ram_w,
155 .groups = group_a | group_d,
156 .gpio_g_in = 0x00ffff3e,
157 .gpio_g_out = 0x00ffff38,
158 .gpio_b = 0x00
159 },
160 {
161 .ioif = if_par_0,
162 .groups = group_a,
163 .gpio_g_in = 0x0000ff3e,
164 .gpio_g_out = 0x0000ff3e,
165 .gpio_b = 0x00
166 },
167 {
168 .ioif = if_par_1,
169 .groups = group_d,
170 .gpio_g_in = 0x3eff0000,
171 .gpio_g_out = 0x3eff0000,
172 .gpio_b = 0x00
173 },
174 {
175 .ioif = if_par_w,
176 .groups = group_a | group_d,
177 .gpio_g_in = 0x00ffff3e,
178 .gpio_g_out = 0x00ffff3e,
179 .gpio_b = 0x00
180 },
181 {
182 .ioif = if_scsi8_0,
183 .groups = group_a | group_b | group_f, /* if_scsi8_0 and if_scsi8_1
184 can be used simultaneously */
185 .gpio_g_in = 0x0000ffff,
186 .gpio_g_out = 0x0000ffff,
187 .gpio_b = 0x10
188 },
189 {
190 .ioif = if_scsi8_1,
191 .groups = group_c | group_d | group_f, /* if_scsi8_0 and if_scsi8_1
192 can be used simultaneously */
193 .gpio_g_in = 0xffff0000,
194 .gpio_g_out = 0xffff0000,
195 .gpio_b = 0x80
196 },
197 {
198 .ioif = if_scsi_w,
199 .groups = group_a | group_b | group_d | group_f,
200 .gpio_g_in = 0x01ffffff,
201 .gpio_g_out = 0x07ffffff,
202 .gpio_b = 0x80
203 },
204 {
205 .ioif = if_ata,
206 .groups = group_a | group_b | group_c | group_d,
207 .gpio_g_in = 0xf9ffffff,
208 .gpio_g_out = 0xffffffff,
209 .gpio_b = 0x80
210 },
211 {
212 .ioif = if_csp,
213 .groups = group_f, /* if_csp and if_i2c can be used simultaneously */
214 .gpio_g_in = 0x00000000,
215 .gpio_g_out = 0x00000000,
216 .gpio_b = 0xfc
217 },
218 {
219 .ioif = if_i2c,
220 .groups = group_f, /* if_csp and if_i2c can be used simultaneously */
221 .gpio_g_in = 0x00000000,
222 .gpio_g_out = 0x00000000,
223 .gpio_b = 0x03
224 },
225 {
226 .ioif = if_usb_1,
227 .groups = group_e | group_f,
228 .gpio_g_in = 0x00000000,
229 .gpio_g_out = 0x00000000,
230 .gpio_b = 0x2c
231 },
232 {
233 .ioif = if_usb_2,
234 .groups = group_d,
235 .gpio_g_in = 0x0e000000,
236 .gpio_g_out = 0x3c000000,
237 .gpio_b = 0x00
238 },
239 /* GPIO pins */
240 {
241 .ioif = if_gpio_grp_a,
242 .groups = group_a,
243 .gpio_g_in = 0x0000ff3f,
244 .gpio_g_out = 0x0000ff3f,
245 .gpio_b = 0x00
246 },
247 {
248 .ioif = if_gpio_grp_b,
249 .groups = group_b,
250 .gpio_g_in = 0x000000c0,
251 .gpio_g_out = 0x000000c0,
252 .gpio_b = 0x00
253 },
254 {
255 .ioif = if_gpio_grp_c,
256 .groups = group_c,
257 .gpio_g_in = 0xc0000000,
258 .gpio_g_out = 0xc0000000,
259 .gpio_b = 0x00
260 },
261 {
262 .ioif = if_gpio_grp_d,
263 .groups = group_d,
264 .gpio_g_in = 0x3fff0000,
265 .gpio_g_out = 0x3fff0000,
266 .gpio_b = 0x00
267 },
268 {
269 .ioif = if_gpio_grp_e,
270 .groups = group_e,
271 .gpio_g_in = 0x00000000,
272 .gpio_g_out = 0x00000000,
273 .gpio_b = 0x00
274 },
275 {
276 .ioif = if_gpio_grp_f,
277 .groups = group_f,
278 .gpio_g_in = 0x00000000,
279 .gpio_g_out = 0x00000000,
280 .gpio_b = 0xff
281 }
282 /* Array end */
283};
284
285static struct watcher *watchers = NULL;
286
287static unsigned int gpio_in_pins = 0xffffffff;
288static unsigned int gpio_out_pins = 0xffffffff;
289static unsigned char gpio_pb_pins = 0xff;
290static unsigned char gpio_pa_pins = 0xff;
291
292static enum cris_io_interface gpio_pa_owners[8];
293static enum cris_io_interface gpio_pb_owners[8];
294static enum cris_io_interface gpio_pg_owners[32];
295
296static int cris_io_interface_init(void);
297
298static unsigned char clear_group_from_set(const unsigned char groups, struct if_group *group)
299{
300 return (groups & ~group->group);
301}
302
303
304static struct if_group *get_group(const unsigned char groups)
305{
306 int i;
307 for (i = 0; i < sizeof(if_groups)/sizeof(struct if_group); i++) {
308 if (groups & if_groups[i].group) {
309 return &if_groups[i];
310 }
311 }
312 return NULL;
313}
314
315
316static void notify_watchers(void)
317{
318 struct watcher *w = watchers;
319
320 DBG(printk("io_interface_mux: notifying watchers\n"));
321
322 while (NULL != w) {
323 w->notify((const unsigned int)gpio_in_pins,
324 (const unsigned int)gpio_out_pins,
325 (const unsigned char)gpio_pa_pins,
326 (const unsigned char)gpio_pb_pins);
327 w = w->next;
328 }
329}
330
331
332int cris_request_io_interface(enum cris_io_interface ioif, const char *device_id)
333{
334 int set_gen_config = 0;
335 int set_gen_config_ii = 0;
336 unsigned long int gens;
337 unsigned long int gens_ii;
338 struct if_group *grp;
339 unsigned char group_set;
340 unsigned long flags;
341
342 (void)cris_io_interface_init();
343
344 DBG(printk("cris_request_io_interface(%d, \"%s\")\n", ioif, device_id));
345
346 if ((ioif >= if_max_interfaces) || (ioif < 0)) {
347 printk(KERN_CRIT "cris_request_io_interface: Bad interface %u submitted for %s\n",
348 ioif,
349 device_id);
350 return -EINVAL;
351 }
352
353 local_irq_save(flags);
354
355 if (interfaces[ioif].used) {
356 local_irq_restore(flags);
357 printk(KERN_CRIT "cris_io_interface: Cannot allocate interface for %s, in use by %s\n",
358 device_id,
359 interfaces[ioif].owner);
360 return -EBUSY;
361 }
362
363 /* Check that all required groups are free before allocating, */
364 group_set = interfaces[ioif].groups;
365 while (NULL != (grp = get_group(group_set))) {
366 if (grp->used) {
367 if (grp->group == group_f) {
368 if ((if_sync_serial_1 == ioif) ||
369 (if_sync_serial_3 == ioif)) {
370 if ((grp->owner != if_sync_serial_1) &&
371 (grp->owner != if_sync_serial_3)) {
372 local_irq_restore(flags);
373 return -EBUSY;
374 }
375 } else if ((if_scsi8_0 == ioif) ||
376 (if_scsi8_1 == ioif)) {
377 if ((grp->owner != if_scsi8_0) &&
378 (grp->owner != if_scsi8_1)) {
379 local_irq_restore(flags);
380 return -EBUSY;
381 }
382 }
383 } else {
384 local_irq_restore(flags);
385 return -EBUSY;
386 }
387 }
388 group_set = clear_group_from_set(group_set, grp);
389 }
390
391 /* Are the required GPIO pins available too? */
392 if (((interfaces[ioif].gpio_g_in & gpio_in_pins) != interfaces[ioif].gpio_g_in) ||
393 ((interfaces[ioif].gpio_g_out & gpio_out_pins) != interfaces[ioif].gpio_g_out) ||
394 ((interfaces[ioif].gpio_b & gpio_pb_pins) != interfaces[ioif].gpio_b)) {
395 printk(KERN_CRIT "cris_request_io_interface: Could not get required pins for interface %u\n",
396 ioif);
397 return -EBUSY;
398 }
399
400 /* All needed I/O pins and pin groups are free, allocate. */
401 group_set = interfaces[ioif].groups;
402 while (NULL != (grp = get_group(group_set))) {
403 grp->used = 1;
404 grp->owner = ioif;
405 group_set = clear_group_from_set(group_set, grp);
406 }
407
408 gens = genconfig_shadow;
409 gens_ii = gen_config_ii_shadow;
410
411 set_gen_config = 1;
412 switch (ioif)
413 {
414 /* Begin Non-multiplexed interfaces */
415 case if_eth:
416 /* fall through */
417 case if_serial_0:
418 set_gen_config = 0;
419 break;
420 /* End Non-multiplexed interfaces */
421 case if_serial_1:
422 set_gen_config_ii = 1;
423 SETS(gens_ii, R_GEN_CONFIG_II, sermode1, async);
424 break;
425 case if_serial_2:
426 SETS(gens, R_GEN_CONFIG, ser2, select);
427 break;
428 case if_serial_3:
429 SETS(gens, R_GEN_CONFIG, ser3, select);
430 set_gen_config_ii = 1;
431 SETS(gens_ii, R_GEN_CONFIG_II, sermode3, async);
432 break;
433 case if_sync_serial_1:
434 set_gen_config_ii = 1;
435 SETS(gens_ii, R_GEN_CONFIG_II, sermode1, sync);
436 break;
437 case if_sync_serial_3:
438 SETS(gens, R_GEN_CONFIG, ser3, select);
439 set_gen_config_ii = 1;
440 SETS(gens_ii, R_GEN_CONFIG_II, sermode3, sync);
441 break;
442 case if_shared_ram:
443 SETS(gens, R_GEN_CONFIG, mio, select);
444 break;
445 case if_shared_ram_w:
446 SETS(gens, R_GEN_CONFIG, mio_w, select);
447 break;
448 case if_par_0:
449 SETS(gens, R_GEN_CONFIG, par0, select);
450 break;
451 case if_par_1:
452 SETS(gens, R_GEN_CONFIG, par1, select);
453 break;
454 case if_par_w:
455 SETS(gens, R_GEN_CONFIG, par0, select);
456 SETS(gens, R_GEN_CONFIG, par_w, select);
457 break;
458 case if_scsi8_0:
459 SETS(gens, R_GEN_CONFIG, scsi0, select);
460 break;
461 case if_scsi8_1:
462 SETS(gens, R_GEN_CONFIG, scsi1, select);
463 break;
464 case if_scsi_w:
465 SETS(gens, R_GEN_CONFIG, scsi0, select);
466 SETS(gens, R_GEN_CONFIG, scsi0w, select);
467 break;
468 case if_ata:
469 SETS(gens, R_GEN_CONFIG, ata, select);
470 break;
471 case if_csp:
472 /* fall through */
473 case if_i2c:
474 set_gen_config = 0;
475 break;
476 case if_usb_1:
477 SETS(gens, R_GEN_CONFIG, usb1, select);
478 break;
479 case if_usb_2:
480 SETS(gens, R_GEN_CONFIG, usb2, select);
481 break;
482 case if_gpio_grp_a:
483 /* GPIO groups are only accounted, don't do configuration changes. */
484 /* fall through */
485 case if_gpio_grp_b:
486 /* fall through */
487 case if_gpio_grp_c:
488 /* fall through */
489 case if_gpio_grp_d:
490 /* fall through */
491 case if_gpio_grp_e:
492 /* fall through */
493 case if_gpio_grp_f:
494 set_gen_config = 0;
495 break;
496 default:
497 panic("cris_request_io_interface: Bad interface %u submitted for %s\n",
498 ioif,
499 device_id);
500 }
501
502 interfaces[ioif].used = 1;
503 interfaces[ioif].owner = (char*)device_id;
504
505 if (set_gen_config) {
506 volatile int i;
507 genconfig_shadow = gens;
508 *R_GEN_CONFIG = genconfig_shadow;
509 /* Wait 12 cycles before doing any DMA command */
510 for(i = 6; i > 0; i--)
511 nop();
512 }
513 if (set_gen_config_ii) {
514 gen_config_ii_shadow = gens_ii;
515 *R_GEN_CONFIG_II = gen_config_ii_shadow;
516 }
517
518 DBG(printk("GPIO pins: available before: g_in=0x%08x g_out=0x%08x pb=0x%02x\n",
519 gpio_in_pins, gpio_out_pins, gpio_pb_pins));
520 DBG(printk("grabbing pins: g_in=0x%08x g_out=0x%08x pb=0x%02x\n",
521 interfaces[ioif].gpio_g_in,
522 interfaces[ioif].gpio_g_out,
523 interfaces[ioif].gpio_b));
524
525 gpio_in_pins &= ~interfaces[ioif].gpio_g_in;
526 gpio_out_pins &= ~interfaces[ioif].gpio_g_out;
527 gpio_pb_pins &= ~interfaces[ioif].gpio_b;
528
529 DBG(printk("GPIO pins: available after: g_in=0x%08x g_out=0x%08x pb=0x%02x\n",
530 gpio_in_pins, gpio_out_pins, gpio_pb_pins));
531
532 local_irq_restore(flags);
533
534 notify_watchers();
535
536 return 0;
537}
538
539
540void cris_free_io_interface(enum cris_io_interface ioif)
541{
542 struct if_group *grp;
543 unsigned char group_set;
544 unsigned long flags;
545
546 (void)cris_io_interface_init();
547
548 if ((ioif >= if_max_interfaces) || (ioif < 0)) {
549 printk(KERN_CRIT "cris_free_io_interface: Bad interface %u\n",
550 ioif);
551 return;
552 }
553 local_irq_save(flags);
554 if (!interfaces[ioif].used) {
555 printk(KERN_CRIT "cris_free_io_interface: Freeing free interface %u\n",
556 ioif);
557 local_irq_restore(flags);
558 return;
559 }
560 group_set = interfaces[ioif].groups;
561 while (NULL != (grp = get_group(group_set))) {
562 if (grp->group == group_f) {
563 switch (ioif)
564 {
565 case if_sync_serial_1:
566 if ((grp->owner == if_sync_serial_1) &&
567 interfaces[if_sync_serial_3].used) {
568 grp->owner = if_sync_serial_3;
569 } else
570 grp->used = 0;
571 break;
572 case if_sync_serial_3:
573 if ((grp->owner == if_sync_serial_3) &&
574 interfaces[if_sync_serial_1].used) {
575 grp->owner = if_sync_serial_1;
576 } else
577 grp->used = 0;
578 break;
579 case if_scsi8_0:
580 if ((grp->owner == if_scsi8_0) &&
581 interfaces[if_scsi8_1].used) {
582 grp->owner = if_scsi8_1;
583 } else
584 grp->used = 0;
585 break;
586 case if_scsi8_1:
587 if ((grp->owner == if_scsi8_1) &&
588 interfaces[if_scsi8_0].used) {
589 grp->owner = if_scsi8_0;
590 } else
591 grp->used = 0;
592 break;
593 default:
594 grp->used = 0;
595 }
596 } else {
597 grp->used = 0;
598 }
599 group_set = clear_group_from_set(group_set, grp);
600 }
601 interfaces[ioif].used = 0;
602 interfaces[ioif].owner = NULL;
603
604 DBG(printk("GPIO pins: available before: g_in=0x%08x g_out=0x%08x pb=0x%02x\n",
605 gpio_in_pins, gpio_out_pins, gpio_pb_pins));
606 DBG(printk("freeing pins: g_in=0x%08x g_out=0x%08x pb=0x%02x\n",
607 interfaces[ioif].gpio_g_in,
608 interfaces[ioif].gpio_g_out,
609 interfaces[ioif].gpio_b));
610
611 gpio_in_pins |= interfaces[ioif].gpio_g_in;
612 gpio_out_pins |= interfaces[ioif].gpio_g_out;
613 gpio_pb_pins |= interfaces[ioif].gpio_b;
614
615 DBG(printk("GPIO pins: available after: g_in=0x%08x g_out=0x%08x pb=0x%02x\n",
616 gpio_in_pins, gpio_out_pins, gpio_pb_pins));
617
618 local_irq_restore(flags);
619
620 notify_watchers();
621}
622
623/* Create a bitmask from bit 0 (inclusive) to bit stop_bit
624 (non-inclusive). stop_bit == 0 returns 0x0 */
625static inline unsigned int create_mask(const unsigned stop_bit)
626{
627 /* Avoid overflow */
628 if (stop_bit >= 32) {
629 return 0xffffffff;
630 }
631 return (1<<stop_bit)-1;
632}
633
634
635/* port can be 'a', 'b' or 'g' */
636int cris_io_interface_allocate_pins(const enum cris_io_interface ioif,
637 const char port,
638 const unsigned start_bit,
639 const unsigned stop_bit)
640{
641 unsigned int i;
642 unsigned int mask = 0;
643 unsigned int tmp_mask;
644 unsigned long int flags;
645 enum cris_io_interface *owners;
646
647 (void)cris_io_interface_init();
648
649 DBG(printk("cris_io_interface_allocate_pins: if=%d port=%c start=%u stop=%u\n",
650 ioif, port, start_bit, stop_bit));
651
652 if (!((start_bit <= stop_bit) &&
653 ((((port == 'a') || (port == 'b')) && (stop_bit < 8)) ||
654 ((port == 'g') && (stop_bit < 32))))) {
655 return -EINVAL;
656 }
657
658 mask = create_mask(stop_bit + 1);
659 tmp_mask = create_mask(start_bit);
660 mask &= ~tmp_mask;
661
662 DBG(printk("cris_io_interface_allocate_pins: port=%c start=%u stop=%u mask=0x%08x\n",
663 port, start_bit, stop_bit, mask));
664
665 local_irq_save(flags);
666
667 switch (port) {
668 case 'a':
669 if ((gpio_pa_pins & mask) != mask) {
670 local_irq_restore(flags);
671 return -EBUSY;
672 }
673 owners = gpio_pa_owners;
674 gpio_pa_pins &= ~mask;
675 break;
676 case 'b':
677 if ((gpio_pb_pins & mask) != mask) {
678 local_irq_restore(flags);
679 return -EBUSY;
680 }
681 owners = gpio_pb_owners;
682 gpio_pb_pins &= ~mask;
683 break;
684 case 'g':
685 if (((gpio_in_pins & mask) != mask) ||
686 ((gpio_out_pins & mask) != mask)) {
687 local_irq_restore(flags);
688 return -EBUSY;
689 }
690 owners = gpio_pg_owners;
691 gpio_in_pins &= ~mask;
692 gpio_out_pins &= ~mask;
693 break;
694 default:
695 local_irq_restore(flags);
696 return -EINVAL;
697 }
698
699 for (i = start_bit; i <= stop_bit; i++) {
700 owners[i] = ioif;
701 }
702 local_irq_restore(flags);
703
704 notify_watchers();
705 return 0;
706}
707
708
709/* port can be 'a', 'b' or 'g' */
710int cris_io_interface_free_pins(const enum cris_io_interface ioif,
711 const char port,
712 const unsigned start_bit,
713 const unsigned stop_bit)
714{
715 unsigned int i;
716 unsigned int mask = 0;
717 unsigned int tmp_mask;
718 unsigned long int flags;
719 enum cris_io_interface *owners;
720
721 (void)cris_io_interface_init();
722
723 if (!((start_bit <= stop_bit) &&
724 ((((port == 'a') || (port == 'b')) && (stop_bit < 8)) ||
725 ((port == 'g') && (stop_bit < 32))))) {
726 return -EINVAL;
727 }
728
729 mask = create_mask(stop_bit + 1);
730 tmp_mask = create_mask(start_bit);
731 mask &= ~tmp_mask;
732
733 DBG(printk("cris_io_interface_free_pins: port=%c start=%u stop=%u mask=0x%08x\n",
734 port, start_bit, stop_bit, mask));
735
736 local_irq_save(flags);
737
738 switch (port) {
739 case 'a':
740 if ((~gpio_pa_pins & mask) != mask) {
741 local_irq_restore(flags);
742 printk(KERN_CRIT "cris_io_interface_free_pins: Freeing free pins");
743 }
744 owners = gpio_pa_owners;
745 break;
746 case 'b':
747 if ((~gpio_pb_pins & mask) != mask) {
748 local_irq_restore(flags);
749 printk(KERN_CRIT "cris_io_interface_free_pins: Freeing free pins");
750 }
751 owners = gpio_pb_owners;
752 break;
753 case 'g':
754 if (((~gpio_in_pins & mask) != mask) ||
755 ((~gpio_out_pins & mask) != mask)) {
756 local_irq_restore(flags);
757 printk(KERN_CRIT "cris_io_interface_free_pins: Freeing free pins");
758 }
759 owners = gpio_pg_owners;
760 break;
761 default:
762 owners = NULL; /* Cannot happen. Shut up, gcc! */
763 }
764
765 for (i = start_bit; i <= stop_bit; i++) {
766 if (owners[i] != ioif) {
767 printk(KERN_CRIT "cris_io_interface_free_pins: Freeing unowned pins");
768 }
769 }
770
771 /* All was ok, change data. */
772 switch (port) {
773 case 'a':
774 gpio_pa_pins |= mask;
775 break;
776 case 'b':
777 gpio_pb_pins |= mask;
778 break;
779 case 'g':
780 gpio_in_pins |= mask;
781 gpio_out_pins |= mask;
782 break;
783 }
784
785 for (i = start_bit; i <= stop_bit; i++) {
786 owners[i] = if_unclaimed;
787 }
788 local_irq_restore(flags);
789 notify_watchers();
790
791 return 0;
792}
793
794
795int cris_io_interface_register_watcher(void (*notify)(const unsigned int gpio_in_available,
796 const unsigned int gpio_out_available,
797 const unsigned char pa_available,
798 const unsigned char pb_available))
799{
800 struct watcher *w;
801
802 (void)cris_io_interface_init();
803
804 if (NULL == notify) {
805 return -EINVAL;
806 }
807 w = kmalloc(sizeof(*w), GFP_KERNEL);
808 if (!w) {
809 return -ENOMEM;
810 }
811 w->notify = notify;
812 w->next = watchers;
813 watchers = w;
814
815 w->notify((const unsigned int)gpio_in_pins,
816 (const unsigned int)gpio_out_pins,
817 (const unsigned char)gpio_pa_pins,
818 (const unsigned char)gpio_pb_pins);
819
820 return 0;
821}
822
823void cris_io_interface_delete_watcher(void (*notify)(const unsigned int gpio_in_available,
824 const unsigned int gpio_out_available,
825 const unsigned char pa_available,
826 const unsigned char pb_available))
827{
828 struct watcher *w = watchers, *prev = NULL;
829
830 (void)cris_io_interface_init();
831
832 while ((NULL != w) && (w->notify != notify)){
833 prev = w;
834 w = w->next;
835 }
836 if (NULL != w) {
837 if (NULL != prev) {
838 prev->next = w->next;
839 } else {
840 watchers = w->next;
841 }
842 kfree(w);
843 return;
844 }
845 printk(KERN_WARNING "cris_io_interface_delete_watcher: Deleting unknown watcher 0x%p\n", notify);
846}
847
848
849static int cris_io_interface_init(void)
850{
851 static int first = 1;
852 int i;
853
854 if (!first) {
855 return 0;
856 }
857 first = 0;
858
859 for (i = 0; i<8; i++) {
860 gpio_pa_owners[i] = if_unclaimed;
861 gpio_pb_owners[i] = if_unclaimed;
862 gpio_pg_owners[i] = if_unclaimed;
863 }
864 for (; i<32; i++) {
865 gpio_pg_owners[i] = if_unclaimed;
866 }
867 return 0;
868}
869
870
871module_init(cris_io_interface_init);
872
873
874EXPORT_SYMBOL(cris_request_io_interface);
875EXPORT_SYMBOL(cris_free_io_interface);
876EXPORT_SYMBOL(cris_io_interface_allocate_pins);
877EXPORT_SYMBOL(cris_io_interface_free_pins);
878EXPORT_SYMBOL(cris_io_interface_register_watcher);
879EXPORT_SYMBOL(cris_io_interface_delete_watcher);
diff --git a/arch/cris/arch-v10/kernel/irq.c b/arch/cris/arch-v10/kernel/irq.c
index b2f16d6fc871..4b368a122015 100644
--- a/arch/cris/arch-v10/kernel/irq.c
+++ b/arch/cris/arch-v10/kernel/irq.c
@@ -1,4 +1,4 @@
1/* $Id: irq.c,v 1.2 2004/06/09 05:30:27 starvik Exp $ 1/* $Id: irq.c,v 1.4 2005/01/04 12:22:28 starvik Exp $
2 * 2 *
3 * linux/arch/cris/kernel/irq.c 3 * linux/arch/cris/kernel/irq.c
4 * 4 *
@@ -12,11 +12,13 @@
12 */ 12 */
13 13
14#include <asm/irq.h> 14#include <asm/irq.h>
15#include <linux/irq.h>
15#include <linux/kernel.h> 16#include <linux/kernel.h>
16#include <linux/init.h> 17#include <linux/init.h>
17#include <linux/config.h> 18#include <linux/config.h>
18 19
19irqvectptr irq_shortcuts[NR_IRQS]; /* vector of shortcut jumps after the irq prologue */ 20#define mask_irq(irq_nr) (*R_VECT_MASK_CLR = 1 << (irq_nr));
21#define unmask_irq(irq_nr) (*R_VECT_MASK_SET = 1 << (irq_nr));
20 22
21/* don't use set_int_vector, it bypasses the linux interrupt handlers. it is 23/* don't use set_int_vector, it bypasses the linux interrupt handlers. it is
22 * global just so that the kernel gdb can use it. 24 * global just so that the kernel gdb can use it.
@@ -102,41 +104,52 @@ static void (*interrupt[NR_IRQS])(void) = {
102 IRQ31_interrupt 104 IRQ31_interrupt
103}; 105};
104 106
105static void (*bad_interrupt[NR_IRQS])(void) = { 107static void enable_crisv10_irq(unsigned int irq);
106 NULL, NULL, 108
107 NULL, bad_IRQ3_interrupt, 109static unsigned int startup_crisv10_irq(unsigned int irq)
108 bad_IRQ4_interrupt, bad_IRQ5_interrupt, 110{
109 bad_IRQ6_interrupt, bad_IRQ7_interrupt, 111 enable_crisv10_irq(irq);
110 bad_IRQ8_interrupt, bad_IRQ9_interrupt, 112 return 0;
111 bad_IRQ10_interrupt, bad_IRQ11_interrupt, 113}
112 bad_IRQ12_interrupt, bad_IRQ13_interrupt, 114
113 NULL, NULL, 115#define shutdown_crisv10_irq disable_crisv10_irq
114 bad_IRQ16_interrupt, bad_IRQ17_interrupt,
115 bad_IRQ18_interrupt, bad_IRQ19_interrupt,
116 bad_IRQ20_interrupt, bad_IRQ21_interrupt,
117 bad_IRQ22_interrupt, bad_IRQ23_interrupt,
118 bad_IRQ24_interrupt, bad_IRQ25_interrupt,
119 NULL, NULL, NULL, NULL, NULL,
120 bad_IRQ31_interrupt
121};
122 116
123void arch_setup_irq(int irq) 117static void enable_crisv10_irq(unsigned int irq)
124{ 118{
125 set_int_vector(irq, interrupt[irq]); 119 unmask_irq(irq);
126} 120}
127 121
128void arch_free_irq(int irq) 122static void disable_crisv10_irq(unsigned int irq)
129{ 123{
130 set_int_vector(irq, bad_interrupt[irq]); 124 mask_irq(irq);
131} 125}
132 126
127static void ack_crisv10_irq(unsigned int irq)
128{
129}
130
131static void end_crisv10_irq(unsigned int irq)
132{
133}
134
135static struct hw_interrupt_type crisv10_irq_type = {
136 .typename = "CRISv10",
137 .startup = startup_crisv10_irq,
138 .shutdown = shutdown_crisv10_irq,
139 .enable = enable_crisv10_irq,
140 .disable = disable_crisv10_irq,
141 .ack = ack_crisv10_irq,
142 .end = end_crisv10_irq,
143 .set_affinity = NULL
144};
145
133void weird_irq(void); 146void weird_irq(void);
134void system_call(void); /* from entry.S */ 147void system_call(void); /* from entry.S */
135void do_sigtrap(void); /* from entry.S */ 148void do_sigtrap(void); /* from entry.S */
136void gdb_handle_breakpoint(void); /* from entry.S */ 149void gdb_handle_breakpoint(void); /* from entry.S */
137 150
138/* init_IRQ() is called by start_kernel and is responsible for fixing IRQ masks and 151/* init_IRQ() is called by start_kernel and is responsible for fixing IRQ masks and
139 setting the irq vector table to point to bad_interrupt ptrs. 152 setting the irq vector table.
140*/ 153*/
141 154
142void __init 155void __init
@@ -154,14 +167,15 @@ init_IRQ(void)
154 167
155 *R_VECT_MASK_CLR = 0xffffffff; 168 *R_VECT_MASK_CLR = 0xffffffff;
156 169
157 /* clear the shortcut entry points */
158
159 for(i = 0; i < NR_IRQS; i++)
160 irq_shortcuts[i] = NULL;
161
162 for (i = 0; i < 256; i++) 170 for (i = 0; i < 256; i++)
163 etrax_irv->v[i] = weird_irq; 171 etrax_irv->v[i] = weird_irq;
164 172
173 /* Initialize IRQ handler descriptiors. */
174 for(i = 2; i < NR_IRQS; i++) {
175 irq_desc[i].handler = &crisv10_irq_type;
176 set_int_vector(i, interrupt[i]);
177 }
178
165 /* the entries in the break vector contain actual code to be 179 /* the entries in the break vector contain actual code to be
166 executed by the associated break handler, rather than just a jump 180 executed by the associated break handler, rather than just a jump
167 address. therefore we need to setup a default breakpoint handler 181 address. therefore we need to setup a default breakpoint handler
@@ -170,10 +184,6 @@ init_IRQ(void)
170 for (i = 0; i < 16; i++) 184 for (i = 0; i < 16; i++)
171 set_break_vector(i, do_sigtrap); 185 set_break_vector(i, do_sigtrap);
172 186
173 /* set all etrax irq's to the bad handlers */
174 for (i = 2; i < NR_IRQS; i++)
175 set_int_vector(i, bad_interrupt[i]);
176
177 /* except IRQ 15 which is the multiple-IRQ handler on Etrax100 */ 187 /* except IRQ 15 which is the multiple-IRQ handler on Etrax100 */
178 188
179 set_int_vector(15, multiple_interrupt); 189 set_int_vector(15, multiple_interrupt);
diff --git a/arch/cris/arch-v10/kernel/kgdb.c b/arch/cris/arch-v10/kernel/kgdb.c
index 7d368c877ee9..b72e6a91a639 100644
--- a/arch/cris/arch-v10/kernel/kgdb.c
+++ b/arch/cris/arch-v10/kernel/kgdb.c
@@ -18,6 +18,10 @@
18*! Jul 21 1999 Bjorn Wesen eLinux port 18*! Jul 21 1999 Bjorn Wesen eLinux port
19*! 19*!
20*! $Log: kgdb.c,v $ 20*! $Log: kgdb.c,v $
21*! Revision 1.6 2005/01/14 10:12:17 starvik
22*! KGDB on separate port.
23*! Console fixes from 2.4.
24*!
21*! Revision 1.5 2004/10/07 13:59:08 starvik 25*! Revision 1.5 2004/10/07 13:59:08 starvik
22*! Corrected call to set_int_vector 26*! Corrected call to set_int_vector
23*! 27*!
@@ -71,7 +75,7 @@
71*! 75*!
72*!--------------------------------------------------------------------------- 76*!---------------------------------------------------------------------------
73*! 77*!
74*! $Id: kgdb.c,v 1.5 2004/10/07 13:59:08 starvik Exp $ 78*! $Id: kgdb.c,v 1.6 2005/01/14 10:12:17 starvik Exp $
75*! 79*!
76*! (C) Copyright 1999, Axis Communications AB, LUND, SWEDEN 80*! (C) Copyright 1999, Axis Communications AB, LUND, SWEDEN
77*! 81*!
@@ -225,6 +229,7 @@
225#include <linux/kernel.h> 229#include <linux/kernel.h>
226#include <linux/delay.h> 230#include <linux/delay.h>
227#include <linux/linkage.h> 231#include <linux/linkage.h>
232#include <linux/reboot.h>
228 233
229#include <asm/setup.h> 234#include <asm/setup.h>
230#include <asm/ptrace.h> 235#include <asm/ptrace.h>
@@ -1344,12 +1349,11 @@ handle_exception (int sigval)
1344 } 1349 }
1345} 1350}
1346 1351
1347/* The jump is to the address 0x00000002. Performs a complete re-start 1352/* Performs a complete re-start from scratch. */
1348 from scratch. */
1349static void 1353static void
1350kill_restart () 1354kill_restart ()
1351{ 1355{
1352 __asm__ volatile ("jump 2"); 1356 machine_restart("");
1353} 1357}
1354 1358
1355/********************************** Breakpoint *******************************/ 1359/********************************** Breakpoint *******************************/
@@ -1506,6 +1510,11 @@ kgdb_handle_serial:
1506 bne goback 1510 bne goback
1507 nop 1511 nop
1508 1512
1513 move.d [reg+0x5E], $r10 ; Get DCCR
1514 btstq 8, $r10 ; Test the U-flag.
1515 bmi goback
1516 nop
1517
1509;; 1518;;
1510;; Handle the communication 1519;; Handle the communication
1511;; 1520;;
diff --git a/arch/cris/arch-v10/kernel/process.c b/arch/cris/arch-v10/kernel/process.c
index 87ff37790827..69e28b4057e8 100644
--- a/arch/cris/arch-v10/kernel/process.c
+++ b/arch/cris/arch-v10/kernel/process.c
@@ -1,4 +1,4 @@
1/* $Id: process.c,v 1.9 2004/10/19 13:07:37 starvik Exp $ 1/* $Id: process.c,v 1.12 2004/12/27 11:18:32 starvik Exp $
2 * 2 *
3 * linux/arch/cris/kernel/process.c 3 * linux/arch/cris/kernel/process.c
4 * 4 *
@@ -101,6 +101,7 @@ int kernel_thread(int (*fn)(void *), void * arg, unsigned long flags)
101 regs.r11 = (unsigned long)fn; 101 regs.r11 = (unsigned long)fn;
102 regs.r12 = (unsigned long)arg; 102 regs.r12 = (unsigned long)arg;
103 regs.irp = (unsigned long)kernel_thread_helper; 103 regs.irp = (unsigned long)kernel_thread_helper;
104 regs.dccr = 1 << I_DCCR_BITNR;
104 105
105 /* Ok, create the new process.. */ 106 /* Ok, create the new process.. */
106 return do_fork(flags | CLONE_VM | CLONE_UNTRACED, 0, &regs, 0, NULL, NULL); 107 return do_fork(flags | CLONE_VM | CLONE_UNTRACED, 0, &regs, 0, NULL, NULL);
diff --git a/arch/cris/arch-v10/kernel/ptrace.c b/arch/cris/arch-v10/kernel/ptrace.c
index 581ecabaae53..130dd214e41d 100644
--- a/arch/cris/arch-v10/kernel/ptrace.c
+++ b/arch/cris/arch-v10/kernel/ptrace.c
@@ -11,6 +11,7 @@
11#include <linux/ptrace.h> 11#include <linux/ptrace.h>
12#include <linux/user.h> 12#include <linux/user.h>
13#include <linux/signal.h> 13#include <linux/signal.h>
14#include <linux/security.h>
14 15
15#include <asm/uaccess.h> 16#include <asm/uaccess.h>
16#include <asm/page.h> 17#include <asm/page.h>
@@ -86,9 +87,13 @@ sys_ptrace(long request, long pid, long addr, long data)
86 ret = -EPERM; 87 ret = -EPERM;
87 88
88 if (request == PTRACE_TRACEME) { 89 if (request == PTRACE_TRACEME) {
90 /* are we already being traced? */
89 if (current->ptrace & PT_PTRACED) 91 if (current->ptrace & PT_PTRACED)
90 goto out; 92 goto out;
91 93 ret = security_ptrace(current->parent, current);
94 if (ret)
95 goto out;
96 /* set the ptrace bit in the process flags. */
92 current->ptrace |= PT_PTRACED; 97 current->ptrace |= PT_PTRACED;
93 ret = 0; 98 ret = 0;
94 goto out; 99 goto out;
@@ -207,7 +212,7 @@ sys_ptrace(long request, long pid, long addr, long data)
207 case PTRACE_KILL: 212 case PTRACE_KILL:
208 ret = 0; 213 ret = 0;
209 214
210 if (child->state == TASK_ZOMBIE) 215 if (child->exit_state == EXIT_ZOMBIE)
211 break; 216 break;
212 217
213 child->exit_code = SIGKILL; 218 child->exit_code = SIGKILL;
diff --git a/arch/cris/arch-v10/kernel/shadows.c b/arch/cris/arch-v10/kernel/shadows.c
index 561a890a8e4c..38fd44dfbc5b 100644
--- a/arch/cris/arch-v10/kernel/shadows.c
+++ b/arch/cris/arch-v10/kernel/shadows.c
@@ -1,4 +1,4 @@
1/* $Id: shadows.c,v 1.1 2001/12/17 13:59:27 bjornw Exp $ 1/* $Id: shadows.c,v 1.2 2004/12/13 12:21:51 starvik Exp $
2 * 2 *
3 * Various shadow registers. Defines for these are in include/asm-etrax100/io.h 3 * Various shadow registers. Defines for these are in include/asm-etrax100/io.h
4 */ 4 */
@@ -6,6 +6,7 @@
6/* Shadows for internal Etrax-registers */ 6/* Shadows for internal Etrax-registers */
7 7
8unsigned long genconfig_shadow; 8unsigned long genconfig_shadow;
9unsigned long gen_config_ii_shadow;
9unsigned long port_g_data_shadow; 10unsigned long port_g_data_shadow;
10unsigned char port_pa_dir_shadow; 11unsigned char port_pa_dir_shadow;
11unsigned char port_pa_data_shadow; 12unsigned char port_pa_data_shadow;
diff --git a/arch/cris/arch-v10/kernel/signal.c b/arch/cris/arch-v10/kernel/signal.c
index 85e0032e664f..693771961f85 100644
--- a/arch/cris/arch-v10/kernel/signal.c
+++ b/arch/cris/arch-v10/kernel/signal.c
@@ -517,13 +517,12 @@ handle_signal(int canrestart, unsigned long sig,
517 if (ka->sa.sa_flags & SA_ONESHOT) 517 if (ka->sa.sa_flags & SA_ONESHOT)
518 ka->sa.sa_handler = SIG_DFL; 518 ka->sa.sa_handler = SIG_DFL;
519 519
520 if (!(ka->sa.sa_flags & SA_NODEFER)) { 520 spin_lock_irq(&current->sighand->siglock);
521 spin_lock_irq(&current->sighand->siglock); 521 sigorsets(&current->blocked,&current->blocked,&ka->sa.sa_mask);
522 sigorsets(&current->blocked,&current->blocked,&ka->sa.sa_mask); 522 if (!(ka->sa.sa_flags & SA_NODEFER))
523 sigaddset(&current->blocked,sig); 523 sigaddset(&current->blocked,sig);
524 recalc_sigpending(); 524 recalc_sigpending();
525 spin_unlock_irq(&current->sighand->siglock); 525 spin_unlock_irq(&current->sighand->siglock);
526 }
527} 526}
528 527
529/* 528/*
diff --git a/arch/cris/arch-v10/kernel/traps.c b/arch/cris/arch-v10/kernel/traps.c
index da491f438a6e..34a27ea2052d 100644
--- a/arch/cris/arch-v10/kernel/traps.c
+++ b/arch/cris/arch-v10/kernel/traps.c
@@ -1,4 +1,4 @@
1/* $Id: traps.c,v 1.2 2003/07/04 08:27:41 starvik Exp $ 1/* $Id: traps.c,v 1.4 2005/04/24 18:47:55 starvik Exp $
2 * 2 *
3 * linux/arch/cris/arch-v10/traps.c 3 * linux/arch/cris/arch-v10/traps.c
4 * 4 *
@@ -16,6 +16,8 @@
16#include <asm/uaccess.h> 16#include <asm/uaccess.h>
17#include <asm/arch/sv_addr_ag.h> 17#include <asm/arch/sv_addr_ag.h>
18 18
19extern int raw_printk(const char *fmt, ...);
20
19void 21void
20show_registers(struct pt_regs * regs) 22show_registers(struct pt_regs * regs)
21{ 23{
@@ -26,18 +28,18 @@ show_registers(struct pt_regs * regs)
26 register. */ 28 register. */
27 unsigned long usp = rdusp(); 29 unsigned long usp = rdusp();
28 30
29 printk("IRP: %08lx SRP: %08lx DCCR: %08lx USP: %08lx MOF: %08lx\n", 31 raw_printk("IRP: %08lx SRP: %08lx DCCR: %08lx USP: %08lx MOF: %08lx\n",
30 regs->irp, regs->srp, regs->dccr, usp, regs->mof ); 32 regs->irp, regs->srp, regs->dccr, usp, regs->mof );
31 printk(" r0: %08lx r1: %08lx r2: %08lx r3: %08lx\n", 33 raw_printk(" r0: %08lx r1: %08lx r2: %08lx r3: %08lx\n",
32 regs->r0, regs->r1, regs->r2, regs->r3); 34 regs->r0, regs->r1, regs->r2, regs->r3);
33 printk(" r4: %08lx r5: %08lx r6: %08lx r7: %08lx\n", 35 raw_printk(" r4: %08lx r5: %08lx r6: %08lx r7: %08lx\n",
34 regs->r4, regs->r5, regs->r6, regs->r7); 36 regs->r4, regs->r5, regs->r6, regs->r7);
35 printk(" r8: %08lx r9: %08lx r10: %08lx r11: %08lx\n", 37 raw_printk(" r8: %08lx r9: %08lx r10: %08lx r11: %08lx\n",
36 regs->r8, regs->r9, regs->r10, regs->r11); 38 regs->r8, regs->r9, regs->r10, regs->r11);
37 printk("r12: %08lx r13: %08lx oR10: %08lx\n", 39 raw_printk("r12: %08lx r13: %08lx oR10: %08lx sp: %08lx\n",
38 regs->r12, regs->r13, regs->orig_r10); 40 regs->r12, regs->r13, regs->orig_r10, regs);
39 printk("R_MMU_CAUSE: %08lx\n", (unsigned long)*R_MMU_CAUSE); 41 raw_printk("R_MMU_CAUSE: %08lx\n", (unsigned long)*R_MMU_CAUSE);
40 printk("Process %s (pid: %d, stackpage=%08lx)\n", 42 raw_printk("Process %s (pid: %d, stackpage=%08lx)\n",
41 current->comm, current->pid, (unsigned long)current); 43 current->comm, current->pid, (unsigned long)current);
42 44
43 /* 45 /*
@@ -53,7 +55,7 @@ show_registers(struct pt_regs * regs)
53 if (usp != 0) 55 if (usp != 0)
54 show_stack (NULL, NULL); 56 show_stack (NULL, NULL);
55 57
56 printk("\nCode: "); 58 raw_printk("\nCode: ");
57 if(regs->irp < PAGE_OFFSET) 59 if(regs->irp < PAGE_OFFSET)
58 goto bad; 60 goto bad;
59 61
@@ -70,16 +72,16 @@ show_registers(struct pt_regs * regs)
70 unsigned char c; 72 unsigned char c;
71 if(__get_user(c, &((unsigned char*)regs->irp)[i])) { 73 if(__get_user(c, &((unsigned char*)regs->irp)[i])) {
72bad: 74bad:
73 printk(" Bad IP value."); 75 raw_printk(" Bad IP value.");
74 break; 76 break;
75 } 77 }
76 78
77 if (i == 0) 79 if (i == 0)
78 printk("(%02x) ", c); 80 raw_printk("(%02x) ", c);
79 else 81 else
80 printk("%02x ", c); 82 raw_printk("%02x ", c);
81 } 83 }
82 printk("\n"); 84 raw_printk("\n");
83 } 85 }
84} 86}
85 87
@@ -121,7 +123,7 @@ die_if_kernel(const char * str, struct pt_regs * regs, long err)
121 stop_watchdog(); 123 stop_watchdog();
122#endif 124#endif
123 125
124 printk("%s: %04lx\n", str, err & 0xffff); 126 raw_printk("%s: %04lx\n", str, err & 0xffff);
125 127
126 show_registers(regs); 128 show_registers(regs);
127 129
@@ -130,3 +132,8 @@ die_if_kernel(const char * str, struct pt_regs * regs, long err)
130#endif 132#endif
131 do_exit(SIGSEGV); 133 do_exit(SIGSEGV);
132} 134}
135
136void arch_enable_nmi(void)
137{
138 asm volatile("setf m");
139}
diff --git a/arch/cris/arch-v10/mm/fault.c b/arch/cris/arch-v10/mm/fault.c
index 6805cdb25a53..fe2615022b97 100644
--- a/arch/cris/arch-v10/mm/fault.c
+++ b/arch/cris/arch-v10/mm/fault.c
@@ -14,6 +14,7 @@
14#include <asm/uaccess.h> 14#include <asm/uaccess.h>
15#include <asm/pgtable.h> 15#include <asm/pgtable.h>
16#include <asm/arch/svinto.h> 16#include <asm/arch/svinto.h>
17#include <asm/mmu_context.h>
17 18
18/* debug of low-level TLB reload */ 19/* debug of low-level TLB reload */
19#undef DEBUG 20#undef DEBUG
@@ -24,8 +25,6 @@
24#define D(x) 25#define D(x)
25#endif 26#endif
26 27
27extern volatile pgd_t *current_pgd;
28
29extern const struct exception_table_entry 28extern const struct exception_table_entry
30 *search_exception_tables(unsigned long addr); 29 *search_exception_tables(unsigned long addr);
31 30
@@ -46,7 +45,7 @@ handle_mmu_bus_fault(struct pt_regs *regs)
46 int page_id; 45 int page_id;
47 int acc, inv; 46 int acc, inv;
48#endif 47#endif
49 pgd_t* pgd = (pgd_t*)current_pgd; 48 pgd_t* pgd = (pgd_t*)per_cpu(current_pgd, smp_processor_id());
50 pmd_t *pmd; 49 pmd_t *pmd;
51 pte_t pte; 50 pte_t pte;
52 int miss, we, writeac; 51 int miss, we, writeac;
@@ -94,24 +93,3 @@ handle_mmu_bus_fault(struct pt_regs *regs)
94 *R_TLB_LO = pte_val(pte); 93 *R_TLB_LO = pte_val(pte);
95 local_irq_restore(flags); 94 local_irq_restore(flags);
96} 95}
97
98/* Called from arch/cris/mm/fault.c to find fixup code. */
99int
100find_fixup_code(struct pt_regs *regs)
101{
102 const struct exception_table_entry *fixup;
103
104 if ((fixup = search_exception_tables(regs->irp)) != 0) {
105 /* Adjust the instruction pointer in the stackframe. */
106 regs->irp = fixup->fixup;
107
108 /*
109 * Don't return by restoring the CPU state, so switch
110 * frame-type.
111 */
112 regs->frametype = CRIS_FRAME_NORMAL;
113 return 1;
114 }
115
116 return 0;
117}
diff --git a/arch/cris/arch-v10/mm/init.c b/arch/cris/arch-v10/mm/init.c
index a9f975a9cfb5..ff3481e76dd4 100644
--- a/arch/cris/arch-v10/mm/init.c
+++ b/arch/cris/arch-v10/mm/init.c
@@ -42,7 +42,7 @@ paging_init(void)
42 * switch_mm) 42 * switch_mm)
43 */ 43 */
44 44
45 current_pgd = init_mm.pgd; 45 per_cpu(current_pgd, smp_processor_id()) = init_mm.pgd;
46 46
47 /* initialise the TLB (tlb.c) */ 47 /* initialise the TLB (tlb.c) */
48 48
diff --git a/arch/cris/arch-v10/mm/tlb.c b/arch/cris/arch-v10/mm/tlb.c
index 9d06125ff5a2..70a5523eff78 100644
--- a/arch/cris/arch-v10/mm/tlb.c
+++ b/arch/cris/arch-v10/mm/tlb.c
@@ -139,53 +139,6 @@ flush_tlb_page(struct vm_area_struct *vma,
139 local_irq_restore(flags); 139 local_irq_restore(flags);
140} 140}
141 141
142/* invalidate a page range */
143
144void
145flush_tlb_range(struct vm_area_struct *vma,
146 unsigned long start,
147 unsigned long end)
148{
149 struct mm_struct *mm = vma->vm_mm;
150 int page_id = mm->context.page_id;
151 int i;
152 unsigned long flags;
153
154 D(printk("tlb: flush range %p<->%p in context %d (%p)\n",
155 start, end, page_id, mm));
156
157 if(page_id == NO_CONTEXT)
158 return;
159
160 start &= PAGE_MASK; /* probably not necessary */
161 end &= PAGE_MASK; /* dito */
162
163 /* invalidate those TLB entries that match both the mm context
164 * and the virtual address range
165 */
166
167 local_save_flags(flags);
168 local_irq_disable();
169 for(i = 0; i < NUM_TLB_ENTRIES; i++) {
170 unsigned long tlb_hi, vpn;
171 *R_TLB_SELECT = IO_FIELD(R_TLB_SELECT, index, i);
172 tlb_hi = *R_TLB_HI;
173 vpn = tlb_hi & PAGE_MASK;
174 if (IO_EXTRACT(R_TLB_HI, page_id, tlb_hi) == page_id &&
175 vpn >= start && vpn < end) {
176 *R_TLB_HI = ( IO_FIELD(R_TLB_HI, page_id, INVALID_PAGEID ) |
177 IO_FIELD(R_TLB_HI, vpn, i & 0xf ) );
178
179 *R_TLB_LO = ( IO_STATE(R_TLB_LO, global,no ) |
180 IO_STATE(R_TLB_LO, valid, no ) |
181 IO_STATE(R_TLB_LO, kernel,no ) |
182 IO_STATE(R_TLB_LO, we, no ) |
183 IO_FIELD(R_TLB_LO, pfn, 0 ) );
184 }
185 }
186 local_irq_restore(flags);
187}
188
189/* dump the entire TLB for debug purposes */ 142/* dump the entire TLB for debug purposes */
190 143
191#if 0 144#if 0
@@ -237,7 +190,7 @@ switch_mm(struct mm_struct *prev, struct mm_struct *next,
237 * the pgd. 190 * the pgd.
238 */ 191 */
239 192
240 current_pgd = next->pgd; 193 per_cpu(current_pgd, smp_processor_id()) = next->pgd;
241 194
242 /* switch context in the MMU */ 195 /* switch context in the MMU */
243 196
diff --git a/arch/cris/arch-v32/Kconfig b/arch/cris/arch-v32/Kconfig
new file mode 100644
index 000000000000..22f0ddc04c50
--- /dev/null
+++ b/arch/cris/arch-v32/Kconfig
@@ -0,0 +1,296 @@
1config ETRAX_DRAM_VIRTUAL_BASE
2 hex
3 depends on ETRAX_ARCH_V32
4 default "c0000000"
5
6config ETRAX_LED1G
7 string "First green LED bit"
8 depends on ETRAX_ARCH_V32
9 default "PA3"
10 help
11 Bit to use for the first green LED (network LED).
12 Most Axis products use bit A3 here.
13
14config ETRAX_LED1R
15 string "First red LED bit"
16 depends on ETRAX_ARCH_V32
17 default "PA4"
18 help
19 Bit to use for the first red LED (network LED).
20 Most Axis products use bit A4 here.
21
22config ETRAX_LED2G
23 string "Second green LED bit"
24 depends on ETRAX_ARCH_V32
25 default "PA5"
26 help
27 Bit to use for the first green LED (status LED).
28 Most Axis products use bit A5 here.
29
30config ETRAX_LED2R
31 string "Second red LED bit"
32 depends on ETRAX_ARCH_V32
33 default "PA6"
34 help
35 Bit to use for the first red LED (network LED).
36 Most Axis products use bit A6 here.
37
38config ETRAX_LED3G
39 string "Third green LED bit"
40 depends on ETRAX_ARCH_V32
41 default "PA7"
42 help
43 Bit to use for the first green LED (drive/power LED).
44 Most Axis products use bit A7 here.
45
46config ETRAX_LED3R
47 string "Third red LED bit"
48 depends on ETRAX_ARCH_V32
49 default "PA7"
50 help
51 Bit to use for the first red LED (drive/power LED).
52 Most Axis products use bit A7 here.
53
54choice
55 prompt "Product debug-port"
56 depends on ETRAX_ARCH_V32
57 default ETRAX_DEBUG_PORT0
58
59config ETRAX_DEBUG_PORT0
60 bool "Serial-0"
61 help
62 Choose a serial port for the ETRAX debug console. Default to
63 port 0.
64
65config ETRAX_DEBUG_PORT1
66 bool "Serial-1"
67 help
68 Use serial port 1 for the console.
69
70config ETRAX_DEBUG_PORT2
71 bool "Serial-2"
72 help
73 Use serial port 2 for the console.
74
75config ETRAX_DEBUG_PORT3
76 bool "Serial-3"
77 help
78 Use serial port 3 for the console.
79
80config ETRAX_DEBUG_PORT_NULL
81 bool "disabled"
82 help
83 Disable serial-port debugging.
84
85endchoice
86
87choice
88 prompt "Kernel GDB port"
89 depends on ETRAX_KGDB
90 default ETRAX_KGDB_PORT0
91 help
92 Choose a serial port for kernel debugging. NOTE: This port should
93 not be enabled under Drivers for built-in interfaces (as it has its
94 own initialization code) and should not be the same as the debug port.
95
96config ETRAX_KGDB_PORT0
97 bool "Serial-0"
98 help
99 Use serial port 0 for kernel debugging.
100
101config ETRAX_KGDB_PORT1
102 bool "Serial-1"
103 help
104 Use serial port 1 for kernel debugging.
105
106config ETRAX_KGDB_PORT2
107 bool "Serial-2"
108 help
109 Use serial port 2 for kernel debugging.
110
111config ETRAX_KGDB_PORT3
112 bool "Serial-3"
113 help
114 Use serial port 3 for kernel debugging.
115
116endchoice
117
118config ETRAX_MEM_GRP1_CONFIG
119 hex "MEM_GRP1_CONFIG"
120 depends on ETRAX_ARCH_V32
121 default "4044a"
122 help
123 Waitstates for flash. The default value is suitable for the
124 standard flashes used in axis products (120 ns).
125
126config ETRAX_MEM_GRP2_CONFIG
127 hex "MEM_GRP2_CONFIG"
128 depends on ETRAX_ARCH_V32
129 default "0"
130 help
131 Waitstates for SRAM. 0 is a good choice for most Axis products.
132
133config ETRAX_MEM_GRP3_CONFIG
134 hex "MEM_GRP3_CONFIG"
135 depends on ETRAX_ARCH_V32
136 default "0"
137 help
138 Waitstates for CSP0-3. 0 is a good choice for most Axis products.
139 It may need to be changed if external devices such as extra
140 register-mapped LEDs are used.
141
142config ETRAX_MEM_GRP4_CONFIG
143 hex "MEM_GRP4_CONFIG"
144 depends on ETRAX_ARCH_V32
145 default "0"
146 help
147 Waitstates for CSP4-6. 0 is a good choice for most Axis products.
148
149config ETRAX_SDRAM_GRP0_CONFIG
150 hex "SDRAM_GRP0_CONFIG"
151 depends on ETRAX_ARCH_V32
152 default "336"
153 help
154 SDRAM configuration for group 0. The value depends on the
155 hardware configuration. The default value is suitable
156 for 32 MB organized as two 16 bits chips (e.g. Axis
157 part number 18550) connected as one 32 bit device (i.e. in
158 the same group).
159
160config ETRAX_SDRAM_GRP1_CONFIG
161 hex "SDRAM_GRP1_CONFIG"
162 depends on ETRAX_ARCH_V32
163 default "0"
164 help
165 SDRAM configuration for group 1. The defult value is 0
166 because group 1 is not used in the default configuration,
167 described in the help for SDRAM_GRP0_CONFIG.
168
169config ETRAX_SDRAM_TIMING
170 hex "SDRAM_TIMING"
171 depends on ETRAX_ARCH_V32
172 default "104a"
173 help
174 SDRAM timing parameters. The default value is ok for
175 most hardwares but large SDRAMs may require a faster
176 refresh (a.k.a 8K refresh). The default value implies
177 100MHz clock and SDR mode.
178
179config ETRAX_SDRAM_COMMAND
180 hex "SDRAM_COMMAND"
181 depends on ETRAX_ARCH_V32
182 default "0"
183 help
184 SDRAM command. Should be 0 unless you really know what
185 you are doing (may be != 0 for unusual address line
186 mappings such as in a MCM)..
187
188config ETRAX_DEF_GIO_PA_OE
189 hex "GIO_PA_OE"
190 depends on ETRAX_ARCH_V32
191 default "1c"
192 help
193 Configures the direction of general port A bits. 1 is out, 0 is in.
194 This is often totally different depending on the product used.
195 There are some guidelines though - if you know that only LED's are
196 connected to port PA, then they are usually connected to bits 2-4
197 and you can therefore use 1c. On other boards which don't have the
198 LED's at the general ports, these bits are used for all kinds of
199 stuff. If you don't know what to use, it is always safe to put all
200 as inputs, although floating inputs isn't good.
201
202config ETRAX_DEF_GIO_PA_OUT
203 hex "GIO_PA_OUT"
204 depends on ETRAX_ARCH_V32
205 default "00"
206 help
207 Configures the initial data for the general port A bits. Most
208 products should use 00 here.
209
210config ETRAX_DEF_GIO_PB_OE
211 hex "GIO_PB_OE"
212 depends on ETRAX_ARCH_V32
213 default "00000"
214 help
215 Configures the direction of general port B bits. 1 is out, 0 is in.
216 This is often totally different depending on the product used.
217 There are some guidelines though - if you know that only LED's are
218 connected to port PA, then they are usually connected to bits 2-4
219 and you can therefore use 1c. On other boards which don't have the
220 LED's at the general ports, these bits are used for all kinds of
221 stuff. If you don't know what to use, it is always safe to put all
222 as inputs, although floating inputs isn't good.
223
224config ETRAX_DEF_GIO_PB_OUT
225 hex "GIO_PB_OUT"
226 depends on ETRAX_ARCH_V32
227 default "00000"
228 help
229 Configures the initial data for the general port B bits. Most
230 products should use 00000 here.
231
232config ETRAX_DEF_GIO_PC_OE
233 hex "GIO_PC_OE"
234 depends on ETRAX_ARCH_V32
235 default "00000"
236 help
237 Configures the direction of general port C bits. 1 is out, 0 is in.
238 This is often totally different depending on the product used.
239 There are some guidelines though - if you know that only LED's are
240 connected to port PA, then they are usually connected to bits 2-4
241 and you can therefore use 1c. On other boards which don't have the
242 LED's at the general ports, these bits are used for all kinds of
243 stuff. If you don't know what to use, it is always safe to put all
244 as inputs, although floating inputs isn't good.
245
246config ETRAX_DEF_GIO_PC_OUT
247 hex "GIO_PC_OUT"
248 depends on ETRAX_ARCH_V32
249 default "00000"
250 help
251 Configures the initial data for the general port C bits. Most
252 products should use 00000 here.
253
254config ETRAX_DEF_GIO_PD_OE
255 hex "GIO_PD_OE"
256 depends on ETRAX_ARCH_V32
257 default "00000"
258 help
259 Configures the direction of general port D bits. 1 is out, 0 is in.
260 This is often totally different depending on the product used.
261 There are some guidelines though - if you know that only LED's are
262 connected to port PA, then they are usually connected to bits 2-4
263 and you can therefore use 1c. On other boards which don't have the
264 LED's at the general ports, these bits are used for all kinds of
265 stuff. If you don't know what to use, it is always safe to put all
266 as inputs, although floating inputs isn't good.
267
268config ETRAX_DEF_GIO_PD_OUT
269 hex "GIO_PD_OUT"
270 depends on ETRAX_ARCH_V32
271 default "00000"
272 help
273 Configures the initial data for the general port D bits. Most
274 products should use 00000 here.
275
276config ETRAX_DEF_GIO_PE_OE
277 hex "GIO_PE_OE"
278 depends on ETRAX_ARCH_V32
279 default "00000"
280 help
281 Configures the direction of general port E bits. 1 is out, 0 is in.
282 This is often totally different depending on the product used.
283 There are some guidelines though - if you know that only LED's are
284 connected to port PA, then they are usually connected to bits 2-4
285 and you can therefore use 1c. On other boards which don't have the
286 LED's at the general ports, these bits are used for all kinds of
287 stuff. If you don't know what to use, it is always safe to put all
288 as inputs, although floating inputs isn't good.
289
290config ETRAX_DEF_GIO_PE_OUT
291 hex "GIO_PE_OUT"
292 depends on ETRAX_ARCH_V32
293 default "00000"
294 help
295 Configures the initial data for the general port E bits. Most
296 products should use 00000 here.
diff --git a/arch/cris/arch-v32/boot/Makefile b/arch/cris/arch-v32/boot/Makefile
new file mode 100644
index 000000000000..26f293ab9617
--- /dev/null
+++ b/arch/cris/arch-v32/boot/Makefile
@@ -0,0 +1,14 @@
1#
2# arch/cris/arch-v32/boot/Makefile
3#
4target = $(target_boot_dir)
5src = $(src_boot_dir)
6
7zImage: compressed/vmlinuz
8
9compressed/vmlinuz: $(objtree)/vmlinux
10 @$(MAKE) -f $(src)/compressed/Makefile $(objtree)/vmlinuz
11
12clean:
13 rm -f zImage tools/build compressed/vmlinux.out
14 @$(MAKE) -f $(src)/compressed/Makefile clean
diff --git a/arch/cris/arch-v32/boot/compressed/Makefile b/arch/cris/arch-v32/boot/compressed/Makefile
new file mode 100644
index 000000000000..9f77eda914ba
--- /dev/null
+++ b/arch/cris/arch-v32/boot/compressed/Makefile
@@ -0,0 +1,41 @@
1#
2# lx25/arch/cris/arch-v32/boot/compressed/Makefile
3#
4# create a compressed vmlinux image from the original vmlinux files and romfs
5#
6
7target = $(target_compressed_dir)
8src = $(src_compressed_dir)
9
10CC = gcc-cris -mlinux -march=v32 -I $(TOPDIR)/include
11CFLAGS = -O2
12LD = gcc-cris -mlinux -march=v32 -nostdlib
13OBJCOPY = objcopy-cris
14OBJCOPYFLAGS = -O binary --remove-section=.bss
15OBJECTS = $(target)/head.o $(target)/misc.o
16
17# files to compress
18SYSTEM = $(objtree)/vmlinux.bin
19
20all: vmlinuz
21
22$(target)/decompress.bin: $(OBJECTS)
23 $(LD) -T $(src)/decompress.ld -o $(target)/decompress.o $(OBJECTS)
24 $(OBJCOPY) $(OBJCOPYFLAGS) $(target)/decompress.o $(target)/decompress.bin
25
26$(objtree)/vmlinuz: $(target) piggy.img $(target)/decompress.bin
27 cat $(target)/decompress.bin piggy.img > $(objtree)/vmlinuz
28 rm -f piggy.img
29 cp $(objtree)/vmlinuz $(src)
30
31$(target)/head.o: $(src)/head.S
32 $(CC) -D__ASSEMBLY__ -c $< -o $@
33
34# gzip the kernel image
35
36piggy.img: $(SYSTEM)
37 cat $(SYSTEM) | gzip -f -9 > piggy.img
38
39clean:
40 rm -f piggy.img $(objtree)/vmlinuz vmlinuz.o decompress.o decompress.bin $(OBJECTS)
41
diff --git a/arch/cris/arch-v32/boot/compressed/README b/arch/cris/arch-v32/boot/compressed/README
new file mode 100644
index 000000000000..e33691d15c57
--- /dev/null
+++ b/arch/cris/arch-v32/boot/compressed/README
@@ -0,0 +1,25 @@
1Creation of the self-extracting compressed kernel image (vmlinuz)
2-----------------------------------------------------------------
3$Id: README,v 1.1 2003/08/21 09:37:03 johana Exp $
4
5This can be slightly confusing because it's a process with many steps.
6
7The kernel object built by the arch/etrax100/Makefile, vmlinux, is split
8by that makefile into text and data binary files, vmlinux.text and
9vmlinux.data.
10
11Those files together with a ROM filesystem can be catted together and
12burned into a flash or executed directly at the DRAM origin.
13
14They can also be catted together and compressed with gzip, which is what
15happens in this makefile. Together they make up piggy.img.
16
17The decompressor is built into the file decompress.o. It is turned into
18the binary file decompress.bin, which is catted together with piggy.img
19into the file vmlinuz. It can be executed in an arbitrary place in flash.
20
21Be careful - it assumes some things about free locations in DRAM. It
22assumes the DRAM starts at 0x40000000 and that it is at least 8 MB,
23so it puts its code at 0x40700000, and initial stack at 0x40800000.
24
25-Bjorn
diff --git a/arch/cris/arch-v32/boot/compressed/decompress.ld b/arch/cris/arch-v32/boot/compressed/decompress.ld
new file mode 100644
index 000000000000..3c837feca3ac
--- /dev/null
+++ b/arch/cris/arch-v32/boot/compressed/decompress.ld
@@ -0,0 +1,30 @@
1/*#OUTPUT_FORMAT(elf32-us-cris) */
2OUTPUT_ARCH (crisv32)
3
4MEMORY
5 {
6 dram : ORIGIN = 0x40700000,
7 LENGTH = 0x00100000
8 }
9
10SECTIONS
11{
12 .text :
13 {
14 _stext = . ;
15 *(.text)
16 *(.rodata)
17 *(.rodata.*)
18 _etext = . ;
19 } > dram
20 .data :
21 {
22 *(.data)
23 _edata = . ;
24 } > dram
25 .bss :
26 {
27 *(.bss)
28 _end = ALIGN( 0x10 ) ;
29 } > dram
30}
diff --git a/arch/cris/arch-v32/boot/compressed/head.S b/arch/cris/arch-v32/boot/compressed/head.S
new file mode 100644
index 000000000000..0c55b83b8287
--- /dev/null
+++ b/arch/cris/arch-v32/boot/compressed/head.S
@@ -0,0 +1,193 @@
1/*
2 * Code that sets up the DRAM registers, calls the
3 * decompressor to unpack the piggybacked kernel, and jumps.
4 *
5 * Copyright (C) 1999 - 2003, Axis Communications AB
6 */
7
8#include <linux/config.h>
9#define ASSEMBLER_MACROS_ONLY
10#include <asm/arch/hwregs/asm/reg_map_asm.h>
11#include <asm/arch/hwregs/asm/gio_defs_asm.h>
12#include <asm/arch/hwregs/asm/config_defs_asm.h>
13
14#define RAM_INIT_MAGIC 0x56902387
15#define COMMAND_LINE_MAGIC 0x87109563
16
17 ;; Exported symbols
18
19 .globl input_data
20
21 .text
22start:
23 di
24
25 ;; Start clocks for used blocks.
26 move.d REG_ADDR(config, regi_config, rw_clk_ctrl), $r1
27 move.d [$r1], $r0
28 or.d REG_STATE(config, rw_clk_ctrl, cpu, yes) | \
29 REG_STATE(config, rw_clk_ctrl, bif, yes) | \
30 REG_STATE(config, rw_clk_ctrl, fix_io, yes), $r0
31 move.d $r0, [$r1]
32
33 ;; If booting from NAND flash we first have to copy some
34 ;; data from NAND flash to internal RAM to get the code
35 ;; that initializes the SDRAM. Lets copy 20 KB. This
36 ;; code executes at 0x38010000 if booting from NAND and
37 ;; we are guaranted that at least 0x200 bytes are good so
38 ;; lets start from there. The first 8192 bytes in the nand
39 ;; flash is spliced with zeroes and is thus 16384 bytes.
40 move.d 0x38010200, $r10
41 move.d 0x14200, $r11 ; Start offset in NAND flash 0x10200 + 16384
42 move.d 0x5000, $r12 ; Length of copy
43
44 ;; Before this code the tools add a partitiontable so the PC
45 ;; has an offset from the linked address.
46offset1:
47 lapcq ., $r13 ; get PC
48 add.d first_copy_complete-offset1, $r13
49
50#include "../../lib/nand_init.S"
51
52first_copy_complete:
53 ;; Initialze the DRAM registers.
54 cmp.d RAM_INIT_MAGIC, $r8 ; Already initialized?
55 beq dram_init_finished
56 nop
57
58#include "../../lib/dram_init.S"
59
60dram_init_finished:
61 lapcq ., $r13 ; get PC
62 add.d second_copy_complete-dram_init_finished, $r13
63
64 move.d REG_ADDR(config, regi_config, r_bootsel), $r0
65 move.d [$r0], $r0
66 and.d REG_MASK(config, r_bootsel, boot_mode), $r0
67 cmp.d REG_STATE(config, r_bootsel, boot_mode, nand), $r0
68 bne second_copy_complete ; No NAND boot
69 nop
70
71 ;; Copy 2MB from NAND flash to SDRAM (at 2-4MB into the SDRAM)
72 move.d 0x40204000, $r10
73 move.d 0x8000, $r11
74 move.d 0x200000, $r12
75 ba copy_nand_to_ram
76 nop
77second_copy_complete:
78
79 ;; Initiate the PA port.
80 move.d CONFIG_ETRAX_DEF_GIO_PA_OUT, $r0
81 move.d REG_ADDR(gio, regi_gio, rw_pa_dout), $r1
82 move.d $r0, [$r1]
83
84 move.d CONFIG_ETRAX_DEF_GIO_PA_OE, $r0
85 move.d REG_ADDR(gio, regi_gio, rw_pa_oe), $r1
86 move.d $r0, [$r1]
87
88 ;; Setup the stack to a suitably high address.
89 ;; We assume 8 MB is the minimum DRAM and put
90 ;; the SP at the top for now.
91
92 move.d 0x40800000, $sp
93
94 ;; Figure out where the compressed piggyback image is
95 ;; in the flash (since we wont try to copy it to DRAM
96 ;; before unpacking). It is at _edata, but in flash.
97 ;; Use (_edata - herami) as offset to the current PC.
98
99 move.d REG_ADDR(config, regi_config, r_bootsel), $r0
100 move.d [$r0], $r0
101 and.d REG_MASK(config, r_bootsel, boot_mode), $r0
102 cmp.d REG_STATE(config, r_bootsel, boot_mode, nand), $r0
103 beq hereami2
104 nop
105hereami:
106 lapcq ., $r5 ; get PC
107 and.d 0x7fffffff, $r5 ; strip any non-cache bit
108 move.d $r5, $r0 ; save for later - flash address of 'herami'
109 add.d _edata, $r5
110 sub.d hereami, $r5 ; r5 = flash address of '_edata'
111 move.d hereami, $r1 ; destination
112 ba 2f
113 nop
114hereami2:
115 lapcq ., $r5 ; get PC
116 and.d 0x00ffffff, $r5 ; strip any non-cache bit
117 move.d $r5, $r6
118 or.d 0x40200000, $r6
119 move.d $r6, $r0 ; save for later - flash address of 'herami'
120 add.d _edata, $r5
121 sub.d hereami2, $r5 ; r5 = flash address of '_edata'
122 add.d 0x40200000, $r5
123 move.d hereami2, $r1 ; destination
1242:
125 ;; Copy text+data to DRAM
126
127 move.d _edata, $r2 ; end destination
1281: move.w [$r0+], $r3
129 move.w $r3, [$r1+]
130 cmp.d $r2, $r1
131 bcs 1b
132 nop
133
134 move.d input_data, $r0 ; for the decompressor
135 move.d $r5, [$r0] ; for the decompressor
136
137 ;; Clear the decompressors BSS (between _edata and _end)
138
139 moveq 0, $r0
140 move.d _edata, $r1
141 move.d _end, $r2
1421: move.w $r0, [$r1+]
143 cmp.d $r2, $r1
144 bcs 1b
145 nop
146
147 ;; Save command line magic and address.
148 move.d _cmd_line_magic, $r12
149 move.d $r10, [$r12]
150 move.d _cmd_line_addr, $r12
151 move.d $r11, [$r12]
152
153 ;; Do the decompression and save compressed size in _inptr
154
155 jsr decompress_kernel
156 nop
157
158 ;; Restore command line magic and address.
159 move.d _cmd_line_magic, $r10
160 move.d [$r10], $r10
161 move.d _cmd_line_addr, $r11
162 move.d [$r11], $r11
163
164 ;; Put start address of root partition in r9 so the kernel can use it
165 ;; when mounting from flash
166 move.d input_data, $r0
167 move.d [$r0], $r9 ; flash address of compressed kernel
168 move.d inptr, $r0
169 add.d [$r0], $r9 ; size of compressed kernel
170 cmp.d 0x40200000, $r9
171 blo enter_kernel
172 nop
173 sub.d 0x40200000, $r9
174 add.d 0x4000, $r9
175
176enter_kernel:
177 ;; Enter the decompressed kernel
178 move.d RAM_INIT_MAGIC, $r8 ; Tell kernel that DRAM is initialized
179 jump 0x40004000 ; kernel is linked to this address
180 nop
181
182 .data
183
184input_data:
185 .dword 0 ; used by the decompressor
186_cmd_line_magic:
187 .dword 0
188_cmd_line_addr:
189 .dword 0
190is_nand_boot:
191 .dword 0
192
193#include "../../lib/hw_settings.S"
diff --git a/arch/cris/arch-v32/boot/compressed/misc.c b/arch/cris/arch-v32/boot/compressed/misc.c
new file mode 100644
index 000000000000..54644238ed59
--- /dev/null
+++ b/arch/cris/arch-v32/boot/compressed/misc.c
@@ -0,0 +1,318 @@
1/*
2 * misc.c
3 *
4 * $Id: misc.c,v 1.8 2005/04/24 18:34:29 starvik Exp $
5 *
6 * This is a collection of several routines from gzip-1.0.3
7 * adapted for Linux.
8 *
9 * malloc by Hannu Savolainen 1993 and Matthias Urlichs 1994
10 * puts by Nick Holloway 1993, better puts by Martin Mares 1995
11 * adoptation for Linux/CRIS Axis Communications AB, 1999
12 *
13 */
14
15/* where the piggybacked kernel image expects itself to live.
16 * it is the same address we use when we network load an uncompressed
17 * image into DRAM, and it is the address the kernel is linked to live
18 * at by vmlinux.lds.S
19 */
20
21#define KERNEL_LOAD_ADR 0x40004000
22
23#include <linux/config.h>
24
25#include <linux/types.h>
26#include <asm/arch/hwregs/reg_rdwr.h>
27#include <asm/arch/hwregs/reg_map.h>
28#include <asm/arch/hwregs/ser_defs.h>
29
30/*
31 * gzip declarations
32 */
33
34#define OF(args) args
35#define STATIC static
36
37void* memset(void* s, int c, size_t n);
38void* memcpy(void* __dest, __const void* __src,
39 size_t __n);
40
41#define memzero(s, n) memset ((s), 0, (n))
42
43
44typedef unsigned char uch;
45typedef unsigned short ush;
46typedef unsigned long ulg;
47
48#define WSIZE 0x8000 /* Window size must be at least 32k, */
49 /* and a power of two */
50
51static uch *inbuf; /* input buffer */
52static uch window[WSIZE]; /* Sliding window buffer */
53
54unsigned inptr = 0; /* index of next byte to be processed in inbuf
55 * After decompression it will contain the
56 * compressed size, and head.S will read it.
57 */
58
59static unsigned outcnt = 0; /* bytes in output buffer */
60
61/* gzip flag byte */
62#define ASCII_FLAG 0x01 /* bit 0 set: file probably ascii text */
63#define CONTINUATION 0x02 /* bit 1 set: continuation of multi-part gzip file */
64#define EXTRA_FIELD 0x04 /* bit 2 set: extra field present */
65#define ORIG_NAME 0x08 /* bit 3 set: original file name present */
66#define COMMENT 0x10 /* bit 4 set: file comment present */
67#define ENCRYPTED 0x20 /* bit 5 set: file is encrypted */
68#define RESERVED 0xC0 /* bit 6,7: reserved */
69
70#define get_byte() inbuf[inptr++]
71
72/* Diagnostic functions */
73#ifdef DEBUG
74# define Assert(cond,msg) {if(!(cond)) error(msg);}
75# define Trace(x) fprintf x
76# define Tracev(x) {if (verbose) fprintf x ;}
77# define Tracevv(x) {if (verbose>1) fprintf x ;}
78# define Tracec(c,x) {if (verbose && (c)) fprintf x ;}
79# define Tracecv(c,x) {if (verbose>1 && (c)) fprintf x ;}
80#else
81# define Assert(cond,msg)
82# define Trace(x)
83# define Tracev(x)
84# define Tracevv(x)
85# define Tracec(c,x)
86# define Tracecv(c,x)
87#endif
88
89static int fill_inbuf(void);
90static void flush_window(void);
91static void error(char *m);
92static void gzip_mark(void **);
93static void gzip_release(void **);
94
95extern char *input_data; /* lives in head.S */
96
97static long bytes_out = 0;
98static uch *output_data;
99static unsigned long output_ptr = 0;
100
101static void *malloc(int size);
102static void free(void *where);
103static void error(char *m);
104static void gzip_mark(void **);
105static void gzip_release(void **);
106
107static void puts(const char *);
108
109/* the "heap" is put directly after the BSS ends, at end */
110
111extern int _end;
112static long free_mem_ptr = (long)&_end;
113
114#include "../../../../../lib/inflate.c"
115
116static void *malloc(int size)
117{
118 void *p;
119
120 if (size <0) error("Malloc error");
121
122 free_mem_ptr = (free_mem_ptr + 3) & ~3; /* Align */
123
124 p = (void *)free_mem_ptr;
125 free_mem_ptr += size;
126
127 return p;
128}
129
130static void free(void *where)
131{ /* Don't care */
132}
133
134static void gzip_mark(void **ptr)
135{
136 *ptr = (void *) free_mem_ptr;
137}
138
139static void gzip_release(void **ptr)
140{
141 free_mem_ptr = (long) *ptr;
142}
143
144/* decompressor info and error messages to serial console */
145
146static inline void
147serout(const char *s, reg_scope_instances regi_ser)
148{
149 reg_ser_rs_stat_din rs;
150 reg_ser_rw_dout dout = {.data = *s};
151
152 do {
153 rs = REG_RD(ser, regi_ser, rs_stat_din);
154 }
155 while (!rs.tr_rdy);/* Wait for tranceiver. */
156
157 REG_WR(ser, regi_ser, rw_dout, dout);
158}
159
160static void
161puts(const char *s)
162{
163#ifndef CONFIG_ETRAX_DEBUG_PORT_NULL
164 while (*s) {
165#ifdef CONFIG_ETRAX_DEBUG_PORT0
166 serout(s, regi_ser0);
167#endif
168#ifdef CONFIG_ETRAX_DEBUG_PORT1
169 serout(s, regi_ser1);
170#endif
171#ifdef CONFIG_ETRAX_DEBUG_PORT2
172 serout(s, regi_ser2);
173#endif
174#ifdef CONFIG_ETRAX_DEBUG_PORT3
175 serout(s, regi_ser3);
176#endif
177 *s++;
178 }
179/* CONFIG_ETRAX_DEBUG_PORT_NULL */
180#endif
181}
182
183void*
184memset(void* s, int c, size_t n)
185{
186 int i;
187 char *ss = (char*)s;
188
189 for (i=0;i<n;i++) ss[i] = c;
190}
191
192void*
193memcpy(void* __dest, __const void* __src,
194 size_t __n)
195{
196 int i;
197 char *d = (char *)__dest, *s = (char *)__src;
198
199 for (i=0;i<__n;i++) d[i] = s[i];
200}
201
202/* ===========================================================================
203 * Write the output window window[0..outcnt-1] and update crc and bytes_out.
204 * (Used for the decompressed data only.)
205 */
206
207static void
208flush_window()
209{
210 ulg c = crc; /* temporary variable */
211 unsigned n;
212 uch *in, *out, ch;
213
214 in = window;
215 out = &output_data[output_ptr];
216 for (n = 0; n < outcnt; n++) {
217 ch = *out++ = *in++;
218 c = crc_32_tab[((int)c ^ ch) & 0xff] ^ (c >> 8);
219 }
220 crc = c;
221 bytes_out += (ulg)outcnt;
222 output_ptr += (ulg)outcnt;
223 outcnt = 0;
224}
225
226static void
227error(char *x)
228{
229 puts("\n\n");
230 puts(x);
231 puts("\n\n -- System halted\n");
232
233 while(1); /* Halt */
234}
235
236void
237setup_normal_output_buffer()
238{
239 output_data = (char *)KERNEL_LOAD_ADR;
240}
241
242static inline void
243serial_setup(reg_scope_instances regi_ser)
244{
245 reg_ser_rw_xoff xoff;
246 reg_ser_rw_tr_ctrl tr_ctrl;
247 reg_ser_rw_rec_ctrl rec_ctrl;
248 reg_ser_rw_tr_baud_div tr_baud;
249 reg_ser_rw_rec_baud_div rec_baud;
250
251 /* Turn off XOFF. */
252 xoff = REG_RD(ser, regi_ser, rw_xoff);
253
254 xoff.chr = 0;
255 xoff.automatic = regk_ser_no;
256
257 REG_WR(ser, regi_ser, rw_xoff, xoff);
258
259 /* Set baudrate and stopbits. */
260 tr_ctrl = REG_RD(ser, regi_ser, rw_tr_ctrl);
261 rec_ctrl = REG_RD(ser, regi_ser, rw_rec_ctrl);
262 tr_baud = REG_RD(ser, regi_ser, rw_tr_baud_div);
263 rec_baud = REG_RD(ser, regi_ser, rw_rec_baud_div);
264
265 tr_ctrl.stop_bits = 1; /* 2 stop bits. */
266
267 /*
268 * The baudrate setup is a bit fishy, but in the end the tranceiver is
269 * set to 4800 and the receiver to 115200. The magic value is
270 * 29.493 MHz.
271 */
272 tr_ctrl.base_freq = regk_ser_f29_493;
273 rec_ctrl.base_freq = regk_ser_f29_493;
274 tr_baud.div = (29493000 / 8) / 4800;
275 rec_baud.div = (29493000 / 8) / 115200;
276
277 REG_WR(ser, regi_ser, rw_tr_ctrl, tr_ctrl);
278 REG_WR(ser, regi_ser, rw_tr_baud_div, tr_baud);
279 REG_WR(ser, regi_ser, rw_rec_ctrl, rec_ctrl);
280 REG_WR(ser, regi_ser, rw_rec_baud_div, rec_baud);
281}
282
283void
284decompress_kernel()
285{
286 char revision;
287
288 /* input_data is set in head.S */
289 inbuf = input_data;
290
291#ifdef CONFIG_ETRAX_DEBUG_PORT0
292 serial_setup(regi_ser0);
293#endif
294#ifdef CONFIG_ETRAX_DEBUG_PORT1
295 serial_setup(regi_ser1);
296#endif
297#ifdef CONFIG_ETRAX_DEBUG_PORT2
298 serial_setup(regi_ser2);
299#endif
300#ifdef CONFIG_ETRAX_DEBUG_PORT3
301 serial_setup(regi_ser3);
302#endif
303
304 setup_normal_output_buffer();
305
306 makecrc();
307
308 __asm__ volatile ("move $vr,%0" : "=rm" (revision));
309 if (revision < 32)
310 {
311 puts("You need an ETRAX FS to run Linux 2.6/crisv32.\n");
312 while(1);
313 }
314
315 puts("Uncompressing Linux...\n");
316 gunzip();
317 puts("Done. Now booting the kernel.\n");
318}
diff --git a/arch/cris/arch-v32/boot/rescue/Makefile b/arch/cris/arch-v32/boot/rescue/Makefile
new file mode 100644
index 000000000000..f668a8198724
--- /dev/null
+++ b/arch/cris/arch-v32/boot/rescue/Makefile
@@ -0,0 +1,36 @@
1#
2# Makefile for rescue code
3#
4target = $(target_rescue_dir)
5src = $(src_rescue_dir)
6
7CC = gcc-cris -mlinux -march=v32 $(LINUXINCLUDE)
8CFLAGS = -O2
9LD = gcc-cris -mlinux -march=v32 -nostdlib
10OBJCOPY = objcopy-cris
11OBJCOPYFLAGS = -O binary --remove-section=.bss
12
13all: $(target)/rescue.bin
14
15rescue: rescue.bin
16 # do nothing
17
18$(target)/rescue.bin: $(target) $(target)/head.o
19 $(LD) -T $(src)/rescue.ld -o $(target)/rescue.o $(target)/head.o
20 $(OBJCOPY) $(OBJCOPYFLAGS) $(target)/rescue.o $(target)/rescue.bin
21 cp -p $(target)/rescue.bin $(objtree)
22
23$(target):
24 mkdir -p $(target)
25
26$(target)/head.o: $(src)/head.S
27 $(CC) -D__ASSEMBLY__ -c $< -o $*.o
28
29clean:
30 rm -f $(target)/*.o $(target)/*.bin
31
32fastdep:
33
34modules:
35
36modules-install:
diff --git a/arch/cris/arch-v32/boot/rescue/head.S b/arch/cris/arch-v32/boot/rescue/head.S
new file mode 100644
index 000000000000..61ede5f30f99
--- /dev/null
+++ b/arch/cris/arch-v32/boot/rescue/head.S
@@ -0,0 +1,39 @@
1/* $Id: head.S,v 1.4 2004/11/01 16:10:28 starvik Exp $
2 *
3 * This used to be the rescue code but now that is handled by the
4 * RedBoot based RFL instead. Nothing to see here, move along.
5 */
6
7#include <linux/config.h>
8#include <asm/arch/hwregs/reg_map_asm.h>
9#include <asm/arch/hwregs/config_defs_asm.h>
10
11 .text
12
13 ;; Start clocks for used blocks.
14 move.d REG_ADDR(config, regi_config, rw_clk_ctrl), $r1
15 move.d [$r1], $r0
16 or.d REG_STATE(config, rw_clk_ctrl, cpu, yes) | \
17 REG_STATE(config, rw_clk_ctrl, bif, yes) | \
18 REG_STATE(config, rw_clk_ctrl, fix_io, yes), $r0
19 move.d $r0, [$r1]
20
21 ;; Copy 68KB NAND flash to Internal RAM (if NAND boot)
22 move.d 0x38004000, $r10
23 move.d 0x8000, $r11
24 move.d 0x11000, $r12
25 move.d copy_complete, $r13
26 and.d 0x000fffff, $r13
27 or.d 0x38000000, $r13
28
29#include "../../lib/nand_init.S"
30
31 ;; No NAND found
32 move.d CONFIG_ETRAX_PTABLE_SECTOR, $r10
33 jump $r10 ; Jump to decompresser
34 nop
35
36copy_complete:
37 move.d 0x38000000 + CONFIG_ETRAX_PTABLE_SECTOR, $r10
38 jump $r10 ; Jump to decompresser
39 nop
diff --git a/arch/cris/arch-v32/boot/rescue/rescue.ld b/arch/cris/arch-v32/boot/rescue/rescue.ld
new file mode 100644
index 000000000000..42b11aa122b2
--- /dev/null
+++ b/arch/cris/arch-v32/boot/rescue/rescue.ld
@@ -0,0 +1,20 @@
1MEMORY
2 {
3 flash : ORIGIN = 0x00000000,
4 LENGTH = 0x00100000
5 }
6
7SECTIONS
8{
9 .text :
10 {
11 stext = . ;
12 *(.text)
13 etext = . ;
14 } > flash
15 .data :
16 {
17 *(.data)
18 edata = . ;
19 } > flash
20}
diff --git a/arch/cris/arch-v32/drivers/Kconfig b/arch/cris/arch-v32/drivers/Kconfig
new file mode 100644
index 000000000000..a33097f95362
--- /dev/null
+++ b/arch/cris/arch-v32/drivers/Kconfig
@@ -0,0 +1,625 @@
1config ETRAX_ETHERNET
2 bool "Ethernet support"
3 depends on ETRAX_ARCH_V32
4 select NET_ETHERNET
5 help
6 This option enables the ETRAX FS built-in 10/100Mbit Ethernet
7 controller.
8
9config ETRAX_ETHERNET_HW_CSUM
10 bool "Hardware accelerated ethernet checksum and scatter/gather"
11 depends on ETRAX_ETHERNET
12 depends on ETRAX_STREAMCOPROC
13 default y
14 help
15 Hardware acceleration of checksumming and scatter/gather
16
17config ETRAX_ETHERNET_IFACE0
18 depends on ETRAX_ETHERNET
19 bool "Enable network interface 0"
20
21config ETRAX_ETHERNET_IFACE1
22 depends on ETRAX_ETHERNET
23 bool "Enable network interface 1 (uses DMA6 and DMA7)"
24
25choice
26 prompt "Network LED behavior"
27 depends on ETRAX_ETHERNET
28 default ETRAX_NETWORK_LED_ON_WHEN_ACTIVITY
29
30config ETRAX_NETWORK_LED_ON_WHEN_LINK
31 bool "LED_on_when_link"
32 help
33 Selecting LED_on_when_link will light the LED when there is a
34 connection and will flash off when there is activity.
35
36 Selecting LED_on_when_activity will light the LED only when
37 there is activity.
38
39 This setting will also affect the behaviour of other activity LEDs
40 e.g. Bluetooth.
41
42config ETRAX_NETWORK_LED_ON_WHEN_ACTIVITY
43 bool "LED_on_when_activity"
44 help
45 Selecting LED_on_when_link will light the LED when there is a
46 connection and will flash off when there is activity.
47
48 Selecting LED_on_when_activity will light the LED only when
49 there is activity.
50
51 This setting will also affect the behaviour of other activity LEDs
52 e.g. Bluetooth.
53
54endchoice
55
56config ETRAXFS_SERIAL
57 bool "Serial-port support"
58 depends on ETRAX_ARCH_V32
59 help
60 Enables the ETRAX FS serial driver for ser0 (ttyS0)
61 You probably want this enabled.
62
63config ETRAX_SERIAL_PORT0
64 bool "Serial port 0 enabled"
65 depends on ETRAXFS_SERIAL
66 help
67 Enables the ETRAX FS serial driver for ser0 (ttyS0)
68 Normally you want this on. You can control what DMA channels to use
69 if you do not need DMA to something else.
70 ser0 can use dma4 or dma6 for output and dma5 or dma7 for input.
71
72choice
73 prompt "Ser0 DMA in channel "
74 depends on ETRAX_SERIAL_PORT0
75 default ETRAX_SERIAL_PORT0_NO_DMA_IN
76 help
77 What DMA channel to use for ser0.
78
79
80config ETRAX_SERIAL_PORT0_NO_DMA_IN
81 bool "Ser0 uses no DMA for input"
82 help
83 Do not use DMA for ser0 input.
84
85config ETRAX_SERIAL_PORT0_DMA7_IN
86 bool "Ser0 uses DMA7 for input"
87 depends on ETRAX_SERIAL_PORT0
88 help
89 Enables the DMA7 input channel for ser0 (ttyS0).
90 If you do not enable DMA, an interrupt for each character will be
91 used when receiveing data.
92 Normally you want to use DMA, unless you use the DMA channel for
93 something else.
94
95endchoice
96
97choice
98 prompt "Ser0 DMA out channel"
99 depends on ETRAX_SERIAL_PORT0
100 default ETRAX_SERIAL_PORT0_NO_DMA_OUT
101
102config ETRAX_SERIAL_PORT0_NO_DMA_OUT
103 bool "Ser0 uses no DMA for output"
104 help
105 Do not use DMA for ser0 output.
106
107config ETRAX_SERIAL_PORT0_DMA6_OUT
108 bool "Ser0 uses DMA6 for output"
109 depends on ETRAX_SERIAL_PORT0
110 help
111 Enables the DMA6 output channel for ser0 (ttyS0).
112 If you do not enable DMA, an interrupt for each character will be
113 used when transmitting data.
114 Normally you want to use DMA, unless you use the DMA channel for
115 something else.
116
117endchoice
118
119config ETRAX_SER0_DTR_BIT
120 string "Ser 0 DTR bit (empty = not used)"
121 depends on ETRAX_SERIAL_PORT0
122
123config ETRAX_SER0_RI_BIT
124 string "Ser 0 RI bit (empty = not used)"
125 depends on ETRAX_SERIAL_PORT0
126
127config ETRAX_SER0_DSR_BIT
128 string "Ser 0 DSR bit (empty = not used)"
129 depends on ETRAX_SERIAL_PORT0
130
131config ETRAX_SER0_CD_BIT
132 string "Ser 0 CD bit (empty = not used)"
133 depends on ETRAX_SERIAL_PORT0
134
135config ETRAX_SERIAL_PORT1
136 bool "Serial port 1 enabled"
137 depends on ETRAXFS_SERIAL
138 help
139 Enables the ETRAX FS serial driver for ser1 (ttyS1).
140
141choice
142 prompt "Ser1 DMA in channel "
143 depends on ETRAX_SERIAL_PORT1
144 default ETRAX_SERIAL_PORT1_NO_DMA_IN
145 help
146 What DMA channel to use for ser1.
147
148
149config ETRAX_SERIAL_PORT1_NO_DMA_IN
150 bool "Ser1 uses no DMA for input"
151 help
152 Do not use DMA for ser1 input.
153
154config ETRAX_SERIAL_PORT1_DMA5_IN
155 bool "Ser1 uses DMA5 for input"
156 depends on ETRAX_SERIAL_PORT1
157 help
158 Enables the DMA5 input channel for ser1 (ttyS1).
159 If you do not enable DMA, an interrupt for each character will be
160 used when receiveing data.
161 Normally you want this on, unless you use the DMA channel for
162 something else.
163
164endchoice
165
166choice
167 prompt "Ser1 DMA out channel "
168 depends on ETRAX_SERIAL_PORT1
169 default ETRAX_SERIAL_PORT1_NO_DMA_OUT
170 help
171 What DMA channel to use for ser1.
172
173config ETRAX_SERIAL_PORT1_NO_DMA_OUT
174 bool "Ser1 uses no DMA for output"
175 help
176 Do not use DMA for ser1 output.
177
178config ETRAX_SERIAL_PORT1_DMA4_OUT
179 bool "Ser1 uses DMA4 for output"
180 depends on ETRAX_SERIAL_PORT1
181 help
182 Enables the DMA4 output channel for ser1 (ttyS1).
183 If you do not enable DMA, an interrupt for each character will be
184 used when transmitting data.
185 Normally you want this on, unless you use the DMA channel for
186 something else.
187
188endchoice
189
190config ETRAX_SER1_DTR_BIT
191 string "Ser 1 DTR bit (empty = not used)"
192 depends on ETRAX_SERIAL_PORT1
193
194config ETRAX_SER1_RI_BIT
195 string "Ser 1 RI bit (empty = not used)"
196 depends on ETRAX_SERIAL_PORT1
197
198config ETRAX_SER1_DSR_BIT
199 string "Ser 1 DSR bit (empty = not used)"
200 depends on ETRAX_SERIAL_PORT1
201
202config ETRAX_SER1_CD_BIT
203 string "Ser 1 CD bit (empty = not used)"
204 depends on ETRAX_SERIAL_PORT1
205
206config ETRAX_SERIAL_PORT2
207 bool "Serial port 2 enabled"
208 depends on ETRAXFS_SERIAL
209 help
210 Enables the ETRAX FS serial driver for ser2 (ttyS2).
211
212choice
213 prompt "Ser2 DMA in channel "
214 depends on ETRAX_SERIAL_PORT2
215 default ETRAX_SERIAL_PORT2_NO_DMA_IN
216 help
217 What DMA channel to use for ser2.
218
219
220config ETRAX_SERIAL_PORT2_NO_DMA_IN
221 bool "Ser2 uses no DMA for input"
222 help
223 Do not use DMA for ser2 input.
224
225config ETRAX_SERIAL_PORT2_DMA3_IN
226 bool "Ser2 uses DMA3 for input"
227 depends on ETRAX_SERIAL_PORT2
228 help
229 Enables the DMA3 input channel for ser2 (ttyS2).
230 If you do not enable DMA, an interrupt for each character will be
231 used when receiveing data.
232 Normally you want to use DMA, unless you use the DMA channel for
233 something else.
234
235endchoice
236
237choice
238 prompt "Ser2 DMA out channel"
239 depends on ETRAX_SERIAL_PORT2
240 default ETRAX_SERIAL_PORT2_NO_DMA_OUT
241
242config ETRAX_SERIAL_PORT2_NO_DMA_OUT
243 bool "Ser2 uses no DMA for output"
244 help
245 Do not use DMA for ser2 output.
246
247config ETRAX_SERIAL_PORT2_DMA2_OUT
248 bool "Ser2 uses DMA2 for output"
249 depends on ETRAX_SERIAL_PORT2
250 help
251 Enables the DMA2 output channel for ser2 (ttyS2).
252 If you do not enable DMA, an interrupt for each character will be
253 used when transmitting data.
254 Normally you want to use DMA, unless you use the DMA channel for
255 something else.
256
257endchoice
258
259config ETRAX_SER2_DTR_BIT
260 string "Ser 2 DTR bit (empty = not used)"
261 depends on ETRAX_SERIAL_PORT2
262
263config ETRAX_SER2_RI_BIT
264 string "Ser 2 RI bit (empty = not used)"
265 depends on ETRAX_SERIAL_PORT2
266
267config ETRAX_SER2_DSR_BIT
268 string "Ser 2 DSR bit (empty = not used)"
269 depends on ETRAX_SERIAL_PORT2
270
271config ETRAX_SER2_CD_BIT
272 string "Ser 2 CD bit (empty = not used)"
273 depends on ETRAX_SERIAL_PORT2
274
275config ETRAX_SERIAL_PORT3
276 bool "Serial port 3 enabled"
277 depends on ETRAXFS_SERIAL
278 help
279 Enables the ETRAX FS serial driver for ser3 (ttyS3).
280
281choice
282 prompt "Ser3 DMA in channel "
283 depends on ETRAX_SERIAL_PORT3
284 default ETRAX_SERIAL_PORT3_NO_DMA_IN
285 help
286 What DMA channel to use for ser3.
287
288
289config ETRAX_SERIAL_PORT3_NO_DMA_IN
290 bool "Ser3 uses no DMA for input"
291 help
292 Do not use DMA for ser3 input.
293
294config ETRAX_SERIAL_PORT3_DMA9_IN
295 bool "Ser3 uses DMA9 for input"
296 depends on ETRAX_SERIAL_PORT3
297 help
298 Enables the DMA9 input channel for ser3 (ttyS3).
299 If you do not enable DMA, an interrupt for each character will be
300 used when receiveing data.
301 Normally you want to use DMA, unless you use the DMA channel for
302 something else.
303
304endchoice
305
306choice
307 prompt "Ser3 DMA out channel"
308 depends on ETRAX_SERIAL_PORT3
309 default ETRAX_SERIAL_PORT3_NO_DMA_OUT
310
311config ETRAX_SERIAL_PORT3_NO_DMA_OUT
312 bool "Ser3 uses no DMA for output"
313 help
314 Do not use DMA for ser3 output.
315
316config ETRAX_SERIAL_PORT3_DMA8_OUT
317 bool "Ser3 uses DMA8 for output"
318 depends on ETRAX_SERIAL_PORT3
319 help
320 Enables the DMA8 output channel for ser3 (ttyS3).
321 If you do not enable DMA, an interrupt for each character will be
322 used when transmitting data.
323 Normally you want to use DMA, unless you use the DMA channel for
324 something else.
325
326endchoice
327
328config ETRAX_SER3_DTR_BIT
329 string "Ser 3 DTR bit (empty = not used)"
330 depends on ETRAX_SERIAL_PORT3
331
332config ETRAX_SER3_RI_BIT
333 string "Ser 3 RI bit (empty = not used)"
334 depends on ETRAX_SERIAL_PORT3
335
336config ETRAX_SER3_DSR_BIT
337 string "Ser 3 DSR bit (empty = not used)"
338 depends on ETRAX_SERIAL_PORT3
339
340config ETRAX_SER3_CD_BIT
341 string "Ser 3 CD bit (empty = not used)"
342 depends on ETRAX_SERIAL_PORT3
343
344config ETRAX_RS485
345 bool "RS-485 support"
346 depends on ETRAX_SERIAL
347 help
348 Enables support for RS-485 serial communication. For a primer on
349 RS-485, see <http://www.hw.cz/english/docs/rs485/rs485.html>.
350
351config ETRAX_RS485_DISABLE_RECEIVER
352 bool "Disable serial receiver"
353 depends on ETRAX_RS485
354 help
355 It is necessary to disable the serial receiver to avoid serial
356 loopback. Not all products are able to do this in software only.
357 Axis 2400/2401 must disable receiver.
358
359config ETRAX_AXISFLASHMAP
360 bool "Axis flash-map support"
361 depends on ETRAX_ARCH_V32
362 select MTD
363 select MTD_CFI
364 select MTD_CFI_AMDSTD
365 select MTD_OBSOLETE_CHIPS
366 select MTD_AMDSTD
367 select MTD_CHAR
368 select MTD_BLOCK
369 select MTD_PARTITIONS
370 select MTD_CONCAT
371 select MTD_COMPLEX_MAPPINGS
372 help
373 This option enables MTD mapping of flash devices. Needed to use
374 flash memories. If unsure, say Y.
375
376config ETRAX_SYNCHRONOUS_SERIAL
377 bool "Synchronous serial-port support"
378 depends on ETRAX_ARCH_V32
379 help
380 Enables the ETRAX FS synchronous serial driver.
381
382config ETRAX_SYNCHRONOUS_SERIAL_PORT0
383 bool "Synchronous serial port 0 enabled"
384 depends on ETRAX_SYNCHRONOUS_SERIAL
385 help
386 Enabled synchronous serial port 0.
387
388config ETRAX_SYNCHRONOUS_SERIAL0_DMA
389 bool "Enable DMA on synchronous serial port 0."
390 depends on ETRAX_SYNCHRONOUS_SERIAL_PORT0
391 help
392 A synchronous serial port can run in manual or DMA mode.
393 Selecting this option will make it run in DMA mode.
394
395config ETRAX_SYNCHRONOUS_SERIAL_PORT1
396 bool "Synchronous serial port 1 enabled"
397 depends on ETRAX_SYNCHRONOUS_SERIAL
398 help
399 Enabled synchronous serial port 1.
400
401config ETRAX_SYNCHRONOUS_SERIAL1_DMA
402 bool "Enable DMA on synchronous serial port 1."
403 depends on ETRAX_SYNCHRONOUS_SERIAL_PORT1
404 help
405 A synchronous serial port can run in manual or DMA mode.
406 Selecting this option will make it run in DMA mode.
407
408config ETRAX_PTABLE_SECTOR
409 int "Byte-offset of partition table sector"
410 depends on ETRAX_AXISFLASHMAP
411 default "65536"
412 help
413 Byte-offset of the partition table in the first flash chip.
414 The default value is 64kB and should not be changed unless
415 you know exactly what you are doing. The only valid reason
416 for changing this is when the flash block size is bigger
417 than 64kB (e.g. when using two parallel 16 bit flashes).
418
419config ETRAX_NANDFLASH
420 bool "NAND flash support"
421 depends on ETRAX_ARCH_V32
422 select MTD_NAND
423 select MTD_NAND_IDS
424 help
425 This option enables MTD mapping of NAND flash devices. Needed to use
426 NAND flash memories. If unsure, say Y.
427
428config ETRAX_I2C
429 bool "I2C driver"
430 depends on ETRAX_ARCH_V32
431 help
432 This option enabled the I2C driver used by e.g. the RTC driver.
433
434config ETRAX_I2C_DATA_PORT
435 string "I2C data pin"
436 depends on ETRAX_I2C
437 help
438 The pin to use for I2C data.
439
440config ETRAX_I2C_CLK_PORT
441 string "I2C clock pin"
442 depends on ETRAX_I2C
443 help
444 The pin to use for I2C clock.
445
446config ETRAX_RTC
447 bool "Real Time Clock support"
448 depends on ETRAX_ARCH_V32
449 help
450 Enabled RTC support.
451
452choice
453 prompt "RTC chip"
454 depends on ETRAX_RTC
455 default ETRAX_PCF8563
456
457config ETRAX_PCF8563
458 bool "PCF8563"
459 help
460 Philips PCF8563 RTC
461
462endchoice
463
464config ETRAX_GPIO
465 bool "GPIO support"
466 depends on ETRAX_ARCH_V32
467 ---help---
468 Enables the ETRAX general port device (major 120, minors 0-4).
469 You can use this driver to access the general port bits. It supports
470 these ioctl's:
471 #include <linux/etraxgpio.h>
472 fd = open("/dev/gpioa", O_RDWR); // or /dev/gpiob
473 ioctl(fd, _IO(ETRAXGPIO_IOCTYPE, IO_SETBITS), bits_to_set);
474 ioctl(fd, _IO(ETRAXGPIO_IOCTYPE, IO_CLRBITS), bits_to_clear);
475 err = ioctl(fd, _IO(ETRAXGPIO_IOCTYPE, IO_READ_INBITS), &val);
476 Remember that you need to setup the port directions appropriately in
477 the General configuration.
478
479config ETRAX_PA_BUTTON_BITMASK
480 hex "PA-buttons bitmask"
481 depends on ETRAX_GPIO
482 default "0x02"
483 help
484 This is a bitmask (8 bits) with information about what bits on PA
485 that are used for buttons.
486 Most products has a so called TEST button on PA1, if that is true
487 use 0x02 here.
488 Use 00 if there are no buttons on PA.
489 If the bitmask is <> 00 a button driver will be included in the gpio
490 driver. ETRAX general I/O support must be enabled.
491
492config ETRAX_PA_CHANGEABLE_DIR
493 hex "PA user changeable dir mask"
494 depends on ETRAX_GPIO
495 default "0x00"
496 help
497 This is a bitmask (8 bits) with information of what bits in PA that a
498 user can change direction on using ioctl's.
499 Bit set = changeable.
500 You probably want 0x00 here, but it depends on your hardware.
501
502config ETRAX_PA_CHANGEABLE_BITS
503 hex "PA user changeable bits mask"
504 depends on ETRAX_GPIO
505 default "0x00"
506 help
507 This is a bitmask (8 bits) with information of what bits in PA
508 that a user can change the value on using ioctl's.
509 Bit set = changeable.
510
511config ETRAX_PB_CHANGEABLE_DIR
512 hex "PB user changeable dir mask"
513 depends on ETRAX_GPIO
514 default "0x00000"
515 help
516 This is a bitmask (18 bits) with information of what bits in PB
517 that a user can change direction on using ioctl's.
518 Bit set = changeable.
519 You probably want 0x00000 here, but it depends on your hardware.
520
521config ETRAX_PB_CHANGEABLE_BITS
522 hex "PB user changeable bits mask"
523 depends on ETRAX_GPIO
524 default "0x00000"
525 help
526 This is a bitmask (18 bits) with information of what bits in PB
527 that a user can change the value on using ioctl's.
528 Bit set = changeable.
529
530config ETRAX_PC_CHANGEABLE_DIR
531 hex "PC user changeable dir mask"
532 depends on ETRAX_GPIO
533 default "0x00000"
534 help
535 This is a bitmask (18 bits) with information of what bits in PC
536 that a user can change direction on using ioctl's.
537 Bit set = changeable.
538 You probably want 0x00000 here, but it depends on your hardware.
539
540config ETRAX_PC_CHANGEABLE_BITS
541 hex "PC user changeable bits mask"
542 depends on ETRAX_GPIO
543 default "0x00000"
544 help
545 This is a bitmask (18 bits) with information of what bits in PC
546 that a user can change the value on using ioctl's.
547 Bit set = changeable.
548
549config ETRAX_PD_CHANGEABLE_DIR
550 hex "PD user changeable dir mask"
551 depends on ETRAX_GPIO
552 default "0x00000"
553 help
554 This is a bitmask (18 bits) with information of what bits in PD
555 that a user can change direction on using ioctl's.
556 Bit set = changeable.
557 You probably want 0x00000 here, but it depends on your hardware.
558
559config ETRAX_PD_CHANGEABLE_BITS
560 hex "PD user changeable bits mask"
561 depends on ETRAX_GPIO
562 default "0x00000"
563 help
564 This is a bitmask (18 bits) with information of what bits in PD
565 that a user can change the value on using ioctl's.
566 Bit set = changeable.
567
568config ETRAX_PE_CHANGEABLE_DIR
569 hex "PE user changeable dir mask"
570 depends on ETRAX_GPIO
571 default "0x00000"
572 help
573 This is a bitmask (18 bits) with information of what bits in PE
574 that a user can change direction on using ioctl's.
575 Bit set = changeable.
576 You probably want 0x00000 here, but it depends on your hardware.
577
578config ETRAX_PE_CHANGEABLE_BITS
579 hex "PE user changeable bits mask"
580 depends on ETRAX_GPIO
581 default "0x00000"
582 help
583 This is a bitmask (18 bits) with information of what bits in PE
584 that a user can change the value on using ioctl's.
585 Bit set = changeable.
586
587config ETRAX_IDE
588 bool "ATA/IDE support"
589 depends on ETRAX_ARCH_V32
590 select IDE
591 select BLK_DEV_IDE
592 select BLK_DEV_IDEDISK
593 select BLK_DEV_IDECD
594 select BLK_DEV_IDEDMA
595 help
596 Enables the ETRAX IDE driver.
597
598config ETRAX_CARDBUS
599 bool "Cardbus support"
600 depends on ETRAX_ARCH_V32
601 select PCCARD
602 select CARDBUS
603 select HOTPLUG
604 select PCCARD_NONSTATIC
605 help
606 Enabled the ETRAX Carbus driver.
607
608config PCI
609 bool
610 depends on ETRAX_CARDBUS
611 default y
612
613config ETRAX_IOP_FW_LOAD
614 tristate "IO-processor hotplug firmware loading support"
615 depends on ETRAX_ARCH_V32
616 select FW_LOADER
617 help
618 Enables IO-processor hotplug firmware loading support.
619
620config ETRAX_STREAMCOPROC
621 tristate "Stream co-processor driver enabled"
622 depends on ETRAX_ARCH_V32
623 help
624 This option enables a driver for the stream co-processor
625 for cryptographic operations.
diff --git a/arch/cris/arch-v32/drivers/Makefile b/arch/cris/arch-v32/drivers/Makefile
new file mode 100644
index 000000000000..a359cd20ae75
--- /dev/null
+++ b/arch/cris/arch-v32/drivers/Makefile
@@ -0,0 +1,13 @@
1#
2# Makefile for Etrax-specific drivers
3#
4
5obj-$(CONFIG_ETRAX_STREAMCOPROC) += cryptocop.o
6obj-$(CONFIG_ETRAX_AXISFLASHMAP) += axisflashmap.o
7obj-$(CONFIG_ETRAX_NANDFLASH) += nandflash.o
8obj-$(CONFIG_ETRAX_GPIO) += gpio.o
9obj-$(CONFIG_ETRAX_IOP_FW_LOAD) += iop_fw_load.o
10obj-$(CONFIG_ETRAX_PCF8563) += pcf8563.o
11obj-$(CONFIG_ETRAX_I2C) += i2c.o
12obj-$(CONFIG_ETRAX_SYNCHRONOUS_SERIAL) += sync_serial.o
13obj-$(CONFIG_PCI) += pci/
diff --git a/arch/cris/arch-v32/drivers/axisflashmap.c b/arch/cris/arch-v32/drivers/axisflashmap.c
new file mode 100644
index 000000000000..78ed52b1cdac
--- /dev/null
+++ b/arch/cris/arch-v32/drivers/axisflashmap.c
@@ -0,0 +1,455 @@
1/*
2 * Physical mapping layer for MTD using the Axis partitiontable format
3 *
4 * Copyright (c) 2001, 2002, 2003 Axis Communications AB
5 *
6 * This file is under the GPL.
7 *
8 * First partition is always sector 0 regardless of if we find a partitiontable
9 * or not. In the start of the next sector, there can be a partitiontable that
10 * tells us what other partitions to define. If there isn't, we use a default
11 * partition split defined below.
12 *
13 * Copy of os/lx25/arch/cris/arch-v10/drivers/axisflashmap.c 1.5
14 * with minor changes.
15 *
16 */
17
18#include <linux/module.h>
19#include <linux/types.h>
20#include <linux/kernel.h>
21#include <linux/config.h>
22#include <linux/init.h>
23
24#include <linux/mtd/concat.h>
25#include <linux/mtd/map.h>
26#include <linux/mtd/mtd.h>
27#include <linux/mtd/mtdram.h>
28#include <linux/mtd/partitions.h>
29
30#include <asm/arch/hwregs/config_defs.h>
31#include <asm/axisflashmap.h>
32#include <asm/mmu.h>
33
34#define MEM_CSE0_SIZE (0x04000000)
35#define MEM_CSE1_SIZE (0x04000000)
36
37#define FLASH_UNCACHED_ADDR KSEG_E
38#define FLASH_CACHED_ADDR KSEG_F
39
40#if CONFIG_ETRAX_FLASH_BUSWIDTH==1
41#define flash_data __u8
42#elif CONFIG_ETRAX_FLASH_BUSWIDTH==2
43#define flash_data __u16
44#elif CONFIG_ETRAX_FLASH_BUSWIDTH==4
45#define flash_data __u16
46#endif
47
48/* From head.S */
49extern unsigned long romfs_start, romfs_length, romfs_in_flash;
50
51/* The master mtd for the entire flash. */
52struct mtd_info* axisflash_mtd = NULL;
53
54/* Map driver functions. */
55
56static map_word flash_read(struct map_info *map, unsigned long ofs)
57{
58 map_word tmp;
59 tmp.x[0] = *(flash_data *)(map->map_priv_1 + ofs);
60 return tmp;
61}
62
63static void flash_copy_from(struct map_info *map, void *to,
64 unsigned long from, ssize_t len)
65{
66 memcpy(to, (void *)(map->map_priv_1 + from), len);
67}
68
69static void flash_write(struct map_info *map, map_word d, unsigned long adr)
70{
71 *(flash_data *)(map->map_priv_1 + adr) = (flash_data)d.x[0];
72}
73
74/*
75 * The map for chip select e0.
76 *
77 * We run into tricky coherence situations if we mix cached with uncached
78 * accesses to we only use the uncached version here.
79 *
80 * The size field is the total size where the flash chips may be mapped on the
81 * chip select. MTD probes should find all devices there and it does not matter
82 * if there are unmapped gaps or aliases (mirrors of flash devices). The MTD
83 * probes will ignore them.
84 *
85 * The start address in map_priv_1 is in virtual memory so we cannot use
86 * MEM_CSE0_START but must rely on that FLASH_UNCACHED_ADDR is the start
87 * address of cse0.
88 */
89static struct map_info map_cse0 = {
90 .name = "cse0",
91 .size = MEM_CSE0_SIZE,
92 .bankwidth = CONFIG_ETRAX_FLASH_BUSWIDTH,
93 .read = flash_read,
94 .copy_from = flash_copy_from,
95 .write = flash_write,
96 .map_priv_1 = FLASH_UNCACHED_ADDR
97};
98
99/*
100 * The map for chip select e1.
101 *
102 * If there was a gap between cse0 and cse1, map_priv_1 would get the wrong
103 * address, but there isn't.
104 */
105static struct map_info map_cse1 = {
106 .name = "cse1",
107 .size = MEM_CSE1_SIZE,
108 .bankwidth = CONFIG_ETRAX_FLASH_BUSWIDTH,
109 .read = flash_read,
110 .copy_from = flash_copy_from,
111 .write = flash_write,
112 .map_priv_1 = FLASH_UNCACHED_ADDR + MEM_CSE0_SIZE
113};
114
115/* If no partition-table was found, we use this default-set. */
116#define MAX_PARTITIONS 7
117#define NUM_DEFAULT_PARTITIONS 3
118
119/*
120 * Default flash size is 2MB. CONFIG_ETRAX_PTABLE_SECTOR is most likely the
121 * size of one flash block and "filesystem"-partition needs 5 blocks to be able
122 * to use JFFS.
123 */
124static struct mtd_partition axis_default_partitions[NUM_DEFAULT_PARTITIONS] = {
125 {
126 .name = "boot firmware",
127 .size = CONFIG_ETRAX_PTABLE_SECTOR,
128 .offset = 0
129 },
130 {
131 .name = "kernel",
132 .size = 0x200000 - (6 * CONFIG_ETRAX_PTABLE_SECTOR),
133 .offset = CONFIG_ETRAX_PTABLE_SECTOR
134 },
135 {
136 .name = "filesystem",
137 .size = 5 * CONFIG_ETRAX_PTABLE_SECTOR,
138 .offset = 0x200000 - (5 * CONFIG_ETRAX_PTABLE_SECTOR)
139 }
140};
141
142/* Initialize the ones normally used. */
143static struct mtd_partition axis_partitions[MAX_PARTITIONS] = {
144 {
145 .name = "part0",
146 .size = CONFIG_ETRAX_PTABLE_SECTOR,
147 .offset = 0
148 },
149 {
150 .name = "part1",
151 .size = 0,
152 .offset = 0
153 },
154 {
155 .name = "part2",
156 .size = 0,
157 .offset = 0
158 },
159 {
160 .name = "part3",
161 .size = 0,
162 .offset = 0
163 },
164 {
165 .name = "part4",
166 .size = 0,
167 .offset = 0
168 },
169 {
170 .name = "part5",
171 .size = 0,
172 .offset = 0
173 },
174 {
175 .name = "part6",
176 .size = 0,
177 .offset = 0
178 },
179};
180
181/*
182 * Probe a chip select for AMD-compatible (JEDEC) or CFI-compatible flash
183 * chips in that order (because the amd_flash-driver is faster).
184 */
185static struct mtd_info *probe_cs(struct map_info *map_cs)
186{
187 struct mtd_info *mtd_cs = NULL;
188
189 printk(KERN_INFO
190 "%s: Probing a 0x%08lx bytes large window at 0x%08lx.\n",
191 map_cs->name, map_cs->size, map_cs->map_priv_1);
192
193#ifdef CONFIG_MTD_AMDSTD
194 mtd_cs = do_map_probe("amd_flash", map_cs);
195#endif
196#ifdef CONFIG_MTD_CFI
197 if (!mtd_cs) {
198 mtd_cs = do_map_probe("cfi_probe", map_cs);
199 }
200#endif
201
202 return mtd_cs;
203}
204
205/*
206 * Probe each chip select individually for flash chips. If there are chips on
207 * both cse0 and cse1, the mtd_info structs will be concatenated to one struct
208 * so that MTD partitions can cross chip boundries.
209 *
210 * The only known restriction to how you can mount your chips is that each
211 * chip select must hold similar flash chips. But you need external hardware
212 * to do that anyway and you can put totally different chips on cse0 and cse1
213 * so it isn't really much of a restriction.
214 */
215extern struct mtd_info* __init crisv32_nand_flash_probe (void);
216static struct mtd_info *flash_probe(void)
217{
218 struct mtd_info *mtd_cse0;
219 struct mtd_info *mtd_cse1;
220 struct mtd_info *mtd_nand = NULL;
221 struct mtd_info *mtd_total;
222 struct mtd_info *mtds[3];
223 int count = 0;
224
225 if ((mtd_cse0 = probe_cs(&map_cse0)) != NULL)
226 mtds[count++] = mtd_cse0;
227 if ((mtd_cse1 = probe_cs(&map_cse1)) != NULL)
228 mtds[count++] = mtd_cse1;
229
230#ifdef CONFIG_ETRAX_NANDFLASH
231 if ((mtd_nand = crisv32_nand_flash_probe()) != NULL)
232 mtds[count++] = mtd_nand;
233#endif
234
235 if (!mtd_cse0 && !mtd_cse1 && !mtd_nand) {
236 /* No chip found. */
237 return NULL;
238 }
239
240 if (count > 1) {
241#ifdef CONFIG_MTD_CONCAT
242 /* Since the concatenation layer adds a small overhead we
243 * could try to figure out if the chips in cse0 and cse1 are
244 * identical and reprobe the whole cse0+cse1 window. But since
245 * flash chips are slow, the overhead is relatively small.
246 * So we use the MTD concatenation layer instead of further
247 * complicating the probing procedure.
248 */
249 mtd_total = mtd_concat_create(mtds,
250 count,
251 "cse0+cse1+nand");
252#else
253 printk(KERN_ERR "%s and %s: Cannot concatenate due to kernel "
254 "(mis)configuration!\n", map_cse0.name, map_cse1.name);
255 mtd_toal = NULL;
256#endif
257 if (!mtd_total) {
258 printk(KERN_ERR "%s and %s: Concatenation failed!\n",
259 map_cse0.name, map_cse1.name);
260
261 /* The best we can do now is to only use what we found
262 * at cse0.
263 */
264 mtd_total = mtd_cse0;
265 map_destroy(mtd_cse1);
266 }
267 } else {
268 mtd_total = mtd_cse0? mtd_cse0 : mtd_cse1 ? mtd_cse1 : mtd_nand;
269
270 }
271
272 return mtd_total;
273}
274
275extern unsigned long crisv32_nand_boot;
276extern unsigned long crisv32_nand_cramfs_offset;
277
278/*
279 * Probe the flash chip(s) and, if it succeeds, read the partition-table
280 * and register the partitions with MTD.
281 */
282static int __init init_axis_flash(void)
283{
284 struct mtd_info *mymtd;
285 int err = 0;
286 int pidx = 0;
287 struct partitiontable_head *ptable_head = NULL;
288 struct partitiontable_entry *ptable;
289 int use_default_ptable = 1; /* Until proven otherwise. */
290 const char *pmsg = KERN_INFO " /dev/flash%d at 0x%08x, size 0x%08x\n";
291 static char page[512];
292 size_t len;
293
294#ifndef CONFIG_ETRAXFS_SIM
295 mymtd = flash_probe();
296 mymtd->read(mymtd, CONFIG_ETRAX_PTABLE_SECTOR, 512, &len, page);
297 ptable_head = (struct partitiontable_head *)(page + PARTITION_TABLE_OFFSET);
298
299 if (!mymtd) {
300 /* There's no reason to use this module if no flash chip can
301 * be identified. Make sure that's understood.
302 */
303 printk(KERN_INFO "axisflashmap: Found no flash chip.\n");
304 } else {
305 printk(KERN_INFO "%s: 0x%08x bytes of flash memory.\n",
306 mymtd->name, mymtd->size);
307 axisflash_mtd = mymtd;
308 }
309
310 if (mymtd) {
311 mymtd->owner = THIS_MODULE;
312 }
313 pidx++; /* First partition is always set to the default. */
314
315 if (ptable_head && (ptable_head->magic == PARTITION_TABLE_MAGIC)
316 && (ptable_head->size <
317 (MAX_PARTITIONS * sizeof(struct partitiontable_entry) +
318 PARTITIONTABLE_END_MARKER_SIZE))
319 && (*(unsigned long*)((void*)ptable_head + sizeof(*ptable_head) +
320 ptable_head->size -
321 PARTITIONTABLE_END_MARKER_SIZE)
322 == PARTITIONTABLE_END_MARKER)) {
323 /* Looks like a start, sane length and end of a
324 * partition table, lets check csum etc.
325 */
326 int ptable_ok = 0;
327 struct partitiontable_entry *max_addr =
328 (struct partitiontable_entry *)
329 ((unsigned long)ptable_head + sizeof(*ptable_head) +
330 ptable_head->size);
331 unsigned long offset = CONFIG_ETRAX_PTABLE_SECTOR;
332 unsigned char *p;
333 unsigned long csum = 0;
334
335 ptable = (struct partitiontable_entry *)
336 ((unsigned long)ptable_head + sizeof(*ptable_head));
337
338 /* Lets be PARANOID, and check the checksum. */
339 p = (unsigned char*) ptable;
340
341 while (p <= (unsigned char*)max_addr) {
342 csum += *p++;
343 csum += *p++;
344 csum += *p++;
345 csum += *p++;
346 }
347 ptable_ok = (csum == ptable_head->checksum);
348
349 /* Read the entries and use/show the info. */
350 printk(KERN_INFO " Found a%s partition table at 0x%p-0x%p.\n",
351 (ptable_ok ? " valid" : "n invalid"), ptable_head,
352 max_addr);
353
354 /* We have found a working bootblock. Now read the
355 * partition table. Scan the table. It ends when
356 * there is 0xffffffff, that is, empty flash.
357 */
358 while (ptable_ok
359 && ptable->offset != 0xffffffff
360 && ptable < max_addr
361 && pidx < MAX_PARTITIONS) {
362
363 axis_partitions[pidx].offset = offset + ptable->offset + (crisv32_nand_boot ? 16384 : 0);
364 axis_partitions[pidx].size = ptable->size;
365
366 printk(pmsg, pidx, axis_partitions[pidx].offset,
367 axis_partitions[pidx].size);
368 pidx++;
369 ptable++;
370 }
371 use_default_ptable = !ptable_ok;
372 }
373
374 if (romfs_in_flash) {
375 /* Add an overlapping device for the root partition (romfs). */
376
377 axis_partitions[pidx].name = "romfs";
378 if (crisv32_nand_boot) {
379 char* data = kmalloc(1024, GFP_KERNEL);
380 int len;
381 int offset = crisv32_nand_cramfs_offset & ~(1024-1);
382 char* tmp;
383
384 mymtd->read(mymtd, offset, 1024, &len, data);
385 tmp = &data[crisv32_nand_cramfs_offset % 512];
386 axis_partitions[pidx].size = *(unsigned*)(tmp + 4);
387 axis_partitions[pidx].offset = crisv32_nand_cramfs_offset;
388 kfree(data);
389 } else {
390 axis_partitions[pidx].size = romfs_length;
391 axis_partitions[pidx].offset = romfs_start - FLASH_CACHED_ADDR;
392 }
393
394 axis_partitions[pidx].mask_flags |= MTD_WRITEABLE;
395
396 printk(KERN_INFO
397 " Adding readonly flash partition for romfs image:\n");
398 printk(pmsg, pidx, axis_partitions[pidx].offset,
399 axis_partitions[pidx].size);
400 pidx++;
401 }
402
403 if (mymtd) {
404 if (use_default_ptable) {
405 printk(KERN_INFO " Using default partition table.\n");
406 err = add_mtd_partitions(mymtd, axis_default_partitions,
407 NUM_DEFAULT_PARTITIONS);
408 } else {
409 err = add_mtd_partitions(mymtd, axis_partitions, pidx);
410 }
411
412 if (err) {
413 panic("axisflashmap could not add MTD partitions!\n");
414 }
415 }
416/* CONFIG_EXTRAXFS_SIM */
417#endif
418
419 if (!romfs_in_flash) {
420 /* Create an RAM device for the root partition (romfs). */
421
422#if !defined(CONFIG_MTD_MTDRAM) || (CONFIG_MTDRAM_TOTAL_SIZE != 0) || (CONFIG_MTDRAM_ABS_POS != 0)
423 /* No use trying to boot this kernel from RAM. Panic! */
424 printk(KERN_EMERG "axisflashmap: Cannot create an MTD RAM "
425 "device due to kernel (mis)configuration!\n");
426 panic("This kernel cannot boot from RAM!\n");
427#else
428 struct mtd_info *mtd_ram;
429
430 mtd_ram = (struct mtd_info *)kmalloc(sizeof(struct mtd_info),
431 GFP_KERNEL);
432 if (!mtd_ram) {
433 panic("axisflashmap couldn't allocate memory for "
434 "mtd_info!\n");
435 }
436
437 printk(KERN_INFO " Adding RAM partition for romfs image:\n");
438 printk(pmsg, pidx, romfs_start, romfs_length);
439
440 err = mtdram_init_device(mtd_ram, (void*)romfs_start,
441 romfs_length, "romfs");
442 if (err) {
443 panic("axisflashmap could not initialize MTD RAM "
444 "device!\n");
445 }
446#endif
447 }
448
449 return err;
450}
451
452/* This adds the above to the kernels init-call chain. */
453module_init(init_axis_flash);
454
455EXPORT_SYMBOL(axisflash_mtd);
diff --git a/arch/cris/arch-v32/drivers/cryptocop.c b/arch/cris/arch-v32/drivers/cryptocop.c
new file mode 100644
index 000000000000..ca72076c630a
--- /dev/null
+++ b/arch/cris/arch-v32/drivers/cryptocop.c
@@ -0,0 +1,3522 @@
1/* $Id: cryptocop.c,v 1.13 2005/04/21 17:27:55 henriken Exp $
2 *
3 * Stream co-processor driver for the ETRAX FS
4 *
5 * Copyright (C) 2003-2005 Axis Communications AB
6 */
7
8#include <linux/init.h>
9#include <linux/sched.h>
10#include <linux/module.h>
11#include <linux/slab.h>
12#include <linux/string.h>
13#include <linux/fs.h>
14#include <linux/mm.h>
15#include <linux/spinlock.h>
16#include <linux/stddef.h>
17
18#include <asm/uaccess.h>
19#include <asm/io.h>
20#include <asm/atomic.h>
21
22#include <linux/list.h>
23#include <linux/interrupt.h>
24
25#include <asm/signal.h>
26#include <asm/irq.h>
27
28#include <asm/arch/dma.h>
29#include <asm/arch/hwregs/dma.h>
30#include <asm/arch/hwregs/reg_map.h>
31#include <asm/arch/hwregs/reg_rdwr.h>
32#include <asm/arch/hwregs/intr_vect_defs.h>
33
34#include <asm/arch/hwregs/strcop.h>
35#include <asm/arch/hwregs/strcop_defs.h>
36#include <asm/arch/cryptocop.h>
37
38
39
40#define DESCR_ALLOC_PAD (31)
41
42struct cryptocop_dma_desc {
43 char *free_buf; /* If non-null will be kfreed in free_cdesc() */
44 dma_descr_data *dma_descr;
45
46 unsigned char dma_descr_buf[sizeof(dma_descr_data) + DESCR_ALLOC_PAD];
47
48 unsigned int from_pool:1; /* If 1 'allocated' from the descriptor pool. */
49 struct cryptocop_dma_desc *next;
50};
51
52
53struct cryptocop_int_operation{
54 void *alloc_ptr;
55 cryptocop_session_id sid;
56
57 dma_descr_context ctx_out;
58 dma_descr_context ctx_in;
59
60 /* DMA descriptors allocated by driver. */
61 struct cryptocop_dma_desc *cdesc_out;
62 struct cryptocop_dma_desc *cdesc_in;
63
64 /* Strcop config to use. */
65 cryptocop_3des_mode tdes_mode;
66 cryptocop_csum_type csum_mode;
67
68 /* DMA descrs provided by consumer. */
69 dma_descr_data *ddesc_out;
70 dma_descr_data *ddesc_in;
71};
72
73
74struct cryptocop_tfrm_ctx {
75 cryptocop_tfrm_id tid;
76 unsigned int blocklength;
77
78 unsigned int start_ix;
79
80 struct cryptocop_tfrm_cfg *tcfg;
81 struct cryptocop_transform_ctx *tctx;
82
83 unsigned char previous_src;
84 unsigned char current_src;
85
86 /* Values to use in metadata out. */
87 unsigned char hash_conf;
88 unsigned char hash_mode;
89 unsigned char ciph_conf;
90 unsigned char cbcmode;
91 unsigned char decrypt;
92
93 unsigned int requires_padding:1;
94 unsigned int strict_block_length:1;
95 unsigned int active:1;
96 unsigned int done:1;
97 size_t consumed;
98 size_t produced;
99
100 /* Pad (input) descriptors to put in the DMA out list when the transform
101 * output is put on the DMA in list. */
102 struct cryptocop_dma_desc *pad_descs;
103
104 struct cryptocop_tfrm_ctx *prev_src;
105 struct cryptocop_tfrm_ctx *curr_src;
106
107 /* Mapping to HW. */
108 unsigned char unit_no;
109};
110
111
112struct cryptocop_private{
113 cryptocop_session_id sid;
114 struct cryptocop_private *next;
115};
116
117/* Session list. */
118
119struct cryptocop_transform_ctx{
120 struct cryptocop_transform_init init;
121 unsigned char dec_key[CRYPTOCOP_MAX_KEY_LENGTH];
122 unsigned int dec_key_set:1;
123
124 struct cryptocop_transform_ctx *next;
125};
126
127
128struct cryptocop_session{
129 cryptocop_session_id sid;
130
131 struct cryptocop_transform_ctx *tfrm_ctx;
132
133 struct cryptocop_session *next;
134};
135
136/* Priority levels for jobs sent to the cryptocop. Checksum operations from
137 kernel have highest priority since TCPIP stack processing must not
138 be a bottleneck. */
139typedef enum {
140 cryptocop_prio_kernel_csum = 0,
141 cryptocop_prio_kernel = 1,
142 cryptocop_prio_user = 2,
143 cryptocop_prio_no_prios = 3
144} cryptocop_queue_priority;
145
146struct cryptocop_prio_queue{
147 struct list_head jobs;
148 cryptocop_queue_priority prio;
149};
150
151struct cryptocop_prio_job{
152 struct list_head node;
153 cryptocop_queue_priority prio;
154
155 struct cryptocop_operation *oper;
156 struct cryptocop_int_operation *iop;
157};
158
159struct ioctl_job_cb_ctx {
160 unsigned int processed:1;
161};
162
163
164static struct cryptocop_session *cryptocop_sessions = NULL;
165spinlock_t cryptocop_sessions_lock;
166
167/* Next Session ID to assign. */
168static cryptocop_session_id next_sid = 1;
169
170/* Pad for checksum. */
171static const char csum_zero_pad[1] = {0x00};
172
173/* Trash buffer for mem2mem operations. */
174#define MEM2MEM_DISCARD_BUF_LENGTH (512)
175static unsigned char mem2mem_discard_buf[MEM2MEM_DISCARD_BUF_LENGTH];
176
177/* Descriptor pool. */
178/* FIXME Tweak this value. */
179#define CRYPTOCOP_DESCRIPTOR_POOL_SIZE (100)
180static struct cryptocop_dma_desc descr_pool[CRYPTOCOP_DESCRIPTOR_POOL_SIZE];
181static struct cryptocop_dma_desc *descr_pool_free_list;
182static int descr_pool_no_free;
183static spinlock_t descr_pool_lock;
184
185/* Lock to stop cryptocop to start processing of a new operation. The holder
186 of this lock MUST call cryptocop_start_job() after it is unlocked. */
187spinlock_t cryptocop_process_lock;
188
189static struct cryptocop_prio_queue cryptocop_job_queues[cryptocop_prio_no_prios];
190static spinlock_t cryptocop_job_queue_lock;
191static struct cryptocop_prio_job *cryptocop_running_job = NULL;
192static spinlock_t running_job_lock;
193
194/* The interrupt handler appends completed jobs to this list. The scehduled
195 * tasklet removes them upon sending the response to the crypto consumer. */
196static struct list_head cryptocop_completed_jobs;
197static spinlock_t cryptocop_completed_jobs_lock;
198
199DECLARE_WAIT_QUEUE_HEAD(cryptocop_ioc_process_wq);
200
201
202/** Local functions. **/
203
204static int cryptocop_open(struct inode *, struct file *);
205
206static int cryptocop_release(struct inode *, struct file *);
207
208static int cryptocop_ioctl(struct inode *inode, struct file *file,
209 unsigned int cmd, unsigned long arg);
210
211static void cryptocop_start_job(void);
212
213static int cryptocop_job_queue_insert(cryptocop_queue_priority prio, struct cryptocop_operation *operation);
214static int cryptocop_job_setup(struct cryptocop_prio_job **pj, struct cryptocop_operation *operation);
215
216static int cryptocop_job_queue_init(void);
217static void cryptocop_job_queue_close(void);
218
219static int create_md5_pad(int alloc_flag, unsigned long long hashed_length, char **pad, size_t *pad_length);
220
221static int create_sha1_pad(int alloc_flag, unsigned long long hashed_length, char **pad, size_t *pad_length);
222
223static int transform_ok(struct cryptocop_transform_init *tinit);
224
225static struct cryptocop_session *get_session(cryptocop_session_id sid);
226
227static struct cryptocop_transform_ctx *get_transform_ctx(struct cryptocop_session *sess, cryptocop_tfrm_id tid);
228
229static void delete_internal_operation(struct cryptocop_int_operation *iop);
230
231static void get_aes_decrypt_key(unsigned char *dec_key, const unsigned char *key, unsigned int keylength);
232
233static int init_stream_coprocessor(void);
234
235static void __exit exit_stream_coprocessor(void);
236
237/*#define LDEBUG*/
238#ifdef LDEBUG
239#define DEBUG(s) s
240#define DEBUG_API(s) s
241static void print_cryptocop_operation(struct cryptocop_operation *cop);
242static void print_dma_descriptors(struct cryptocop_int_operation *iop);
243static void print_strcop_crypto_op(struct strcop_crypto_op *cop);
244static void print_lock_status(void);
245static void print_user_dma_lists(struct cryptocop_dma_list_operation *dma_op);
246#define assert(s) do{if (!(s)) panic(#s);} while(0);
247#else
248#define DEBUG(s)
249#define DEBUG_API(s)
250#define assert(s)
251#endif
252
253
254/* Transform constants. */
255#define DES_BLOCK_LENGTH (8)
256#define AES_BLOCK_LENGTH (16)
257#define MD5_BLOCK_LENGTH (64)
258#define SHA1_BLOCK_LENGTH (64)
259#define CSUM_BLOCK_LENGTH (2)
260#define MD5_STATE_LENGTH (16)
261#define SHA1_STATE_LENGTH (20)
262
263/* The device number. */
264#define CRYPTOCOP_MAJOR (254)
265#define CRYPTOCOP_MINOR (0)
266
267
268
269struct file_operations cryptocop_fops = {
270 owner: THIS_MODULE,
271 open: cryptocop_open,
272 release: cryptocop_release,
273 ioctl: cryptocop_ioctl
274};
275
276
277static void free_cdesc(struct cryptocop_dma_desc *cdesc)
278{
279 DEBUG(printk("free_cdesc: cdesc 0x%p, from_pool=%d\n", cdesc, cdesc->from_pool));
280 if (cdesc->free_buf) kfree(cdesc->free_buf);
281
282 if (cdesc->from_pool) {
283 unsigned long int flags;
284 spin_lock_irqsave(&descr_pool_lock, flags);
285 cdesc->next = descr_pool_free_list;
286 descr_pool_free_list = cdesc;
287 ++descr_pool_no_free;
288 spin_unlock_irqrestore(&descr_pool_lock, flags);
289 } else {
290 kfree(cdesc);
291 }
292}
293
294
295static struct cryptocop_dma_desc *alloc_cdesc(int alloc_flag)
296{
297 int use_pool = (alloc_flag & GFP_ATOMIC) ? 1 : 0;
298 struct cryptocop_dma_desc *cdesc;
299
300 if (use_pool) {
301 unsigned long int flags;
302 spin_lock_irqsave(&descr_pool_lock, flags);
303 if (!descr_pool_free_list) {
304 spin_unlock_irqrestore(&descr_pool_lock, flags);
305 DEBUG_API(printk("alloc_cdesc: pool is empty\n"));
306 return NULL;
307 }
308 cdesc = descr_pool_free_list;
309 descr_pool_free_list = descr_pool_free_list->next;
310 --descr_pool_no_free;
311 spin_unlock_irqrestore(&descr_pool_lock, flags);
312 cdesc->from_pool = 1;
313 } else {
314 cdesc = kmalloc(sizeof(struct cryptocop_dma_desc), alloc_flag);
315 if (!cdesc) {
316 DEBUG_API(printk("alloc_cdesc: kmalloc\n"));
317 return NULL;
318 }
319 cdesc->from_pool = 0;
320 }
321 cdesc->dma_descr = (dma_descr_data*)(((unsigned long int)cdesc + offsetof(struct cryptocop_dma_desc, dma_descr_buf) + DESCR_ALLOC_PAD) & ~0x0000001F);
322
323 cdesc->next = NULL;
324
325 cdesc->free_buf = NULL;
326 cdesc->dma_descr->out_eop = 0;
327 cdesc->dma_descr->in_eop = 0;
328 cdesc->dma_descr->intr = 0;
329 cdesc->dma_descr->eol = 0;
330 cdesc->dma_descr->wait = 0;
331 cdesc->dma_descr->buf = NULL;
332 cdesc->dma_descr->after = NULL;
333
334 DEBUG_API(printk("alloc_cdesc: return 0x%p, cdesc->dma_descr=0x%p, from_pool=%d\n", cdesc, cdesc->dma_descr, cdesc->from_pool));
335 return cdesc;
336}
337
338
339static void setup_descr_chain(struct cryptocop_dma_desc *cd)
340{
341 DEBUG(printk("setup_descr_chain: entering\n"));
342 while (cd) {
343 if (cd->next) {
344 cd->dma_descr->next = (dma_descr_data*)virt_to_phys(cd->next->dma_descr);
345 } else {
346 cd->dma_descr->next = NULL;
347 }
348 cd = cd->next;
349 }
350 DEBUG(printk("setup_descr_chain: exit\n"));
351}
352
353
354/* Create a pad descriptor for the transform.
355 * Return -1 for error, 0 if pad created. */
356static int create_pad_descriptor(struct cryptocop_tfrm_ctx *tc, struct cryptocop_dma_desc **pad_desc, int alloc_flag)
357{
358 struct cryptocop_dma_desc *cdesc = NULL;
359 int error = 0;
360 struct strcop_meta_out mo = {
361 .ciphsel = src_none,
362 .hashsel = src_none,
363 .csumsel = src_none
364 };
365 char *pad;
366 size_t plen;
367
368 DEBUG(printk("create_pad_descriptor: start.\n"));
369 /* Setup pad descriptor. */
370
371 DEBUG(printk("create_pad_descriptor: setting up padding.\n"));
372 cdesc = alloc_cdesc(alloc_flag);
373 if (!cdesc){
374 DEBUG_API(printk("create_pad_descriptor: alloc pad desc\n"));
375 goto error_cleanup;
376 }
377 switch (tc->unit_no) {
378 case src_md5:
379 error = create_md5_pad(alloc_flag, tc->consumed, &pad, &plen);
380 if (error){
381 DEBUG_API(printk("create_pad_descriptor: create_md5_pad_failed\n"));
382 goto error_cleanup;
383 }
384 cdesc->free_buf = pad;
385 mo.hashsel = src_dma;
386 mo.hashconf = tc->hash_conf;
387 mo.hashmode = tc->hash_mode;
388 break;
389 case src_sha1:
390 error = create_sha1_pad(alloc_flag, tc->consumed, &pad, &plen);
391 if (error){
392 DEBUG_API(printk("create_pad_descriptor: create_sha1_pad_failed\n"));
393 goto error_cleanup;
394 }
395 cdesc->free_buf = pad;
396 mo.hashsel = src_dma;
397 mo.hashconf = tc->hash_conf;
398 mo.hashmode = tc->hash_mode;
399 break;
400 case src_csum:
401 if (tc->consumed % tc->blocklength){
402 pad = (char*)csum_zero_pad;
403 plen = 1;
404 } else {
405 pad = (char*)cdesc; /* Use any pointer. */
406 plen = 0;
407 }
408 mo.csumsel = src_dma;
409 break;
410 }
411 cdesc->dma_descr->wait = 1;
412 cdesc->dma_descr->out_eop = 1; /* Since this is a pad output is pushed. EOP is ok here since the padded unit is the only one active. */
413 cdesc->dma_descr->buf = (char*)virt_to_phys((char*)pad);
414 cdesc->dma_descr->after = cdesc->dma_descr->buf + plen;
415
416 cdesc->dma_descr->md = REG_TYPE_CONV(unsigned short int, struct strcop_meta_out, mo);
417 *pad_desc = cdesc;
418
419 return 0;
420
421 error_cleanup:
422 if (cdesc) free_cdesc(cdesc);
423 return -1;
424}
425
426
427static int setup_key_dl_desc(struct cryptocop_tfrm_ctx *tc, struct cryptocop_dma_desc **kd, int alloc_flag)
428{
429 struct cryptocop_dma_desc *key_desc = alloc_cdesc(alloc_flag);
430 struct strcop_meta_out mo = {0};
431
432 DEBUG(printk("setup_key_dl_desc\n"));
433
434 if (!key_desc) {
435 DEBUG_API(printk("setup_key_dl_desc: failed descriptor allocation.\n"));
436 return -ENOMEM;
437 }
438
439 /* Download key. */
440 if ((tc->tctx->init.alg == cryptocop_alg_aes) && (tc->tcfg->flags & CRYPTOCOP_DECRYPT)) {
441 /* Precook the AES decrypt key. */
442 if (!tc->tctx->dec_key_set){
443 get_aes_decrypt_key(tc->tctx->dec_key, tc->tctx->init.key, tc->tctx->init.keylen);
444 tc->tctx->dec_key_set = 1;
445 }
446 key_desc->dma_descr->buf = (char*)virt_to_phys(tc->tctx->dec_key);
447 key_desc->dma_descr->after = key_desc->dma_descr->buf + tc->tctx->init.keylen/8;
448 } else {
449 key_desc->dma_descr->buf = (char*)virt_to_phys(tc->tctx->init.key);
450 key_desc->dma_descr->after = key_desc->dma_descr->buf + tc->tctx->init.keylen/8;
451 }
452 /* Setup metadata. */
453 mo.dlkey = 1;
454 switch (tc->tctx->init.keylen) {
455 case 64:
456 mo.decrypt = 0;
457 mo.hashmode = 0;
458 break;
459 case 128:
460 mo.decrypt = 0;
461 mo.hashmode = 1;
462 break;
463 case 192:
464 mo.decrypt = 1;
465 mo.hashmode = 0;
466 break;
467 case 256:
468 mo.decrypt = 1;
469 mo.hashmode = 1;
470 break;
471 default:
472 break;
473 }
474 mo.ciphsel = mo.hashsel = mo.csumsel = src_none;
475 key_desc->dma_descr->md = REG_TYPE_CONV(unsigned short int, struct strcop_meta_out, mo);
476
477 key_desc->dma_descr->out_eop = 1;
478 key_desc->dma_descr->wait = 1;
479 key_desc->dma_descr->intr = 0;
480
481 *kd = key_desc;
482 return 0;
483}
484
485static int setup_cipher_iv_desc(struct cryptocop_tfrm_ctx *tc, struct cryptocop_dma_desc **id, int alloc_flag)
486{
487 struct cryptocop_dma_desc *iv_desc = alloc_cdesc(alloc_flag);
488 struct strcop_meta_out mo = {0};
489
490 DEBUG(printk("setup_cipher_iv_desc\n"));
491
492 if (!iv_desc) {
493 DEBUG_API(printk("setup_cipher_iv_desc: failed CBC IV descriptor allocation.\n"));
494 return -ENOMEM;
495 }
496 /* Download IV. */
497 iv_desc->dma_descr->buf = (char*)virt_to_phys(tc->tcfg->iv);
498 iv_desc->dma_descr->after = iv_desc->dma_descr->buf + tc->blocklength;
499
500 /* Setup metadata. */
501 mo.hashsel = mo.csumsel = src_none;
502 mo.ciphsel = src_dma;
503 mo.ciphconf = tc->ciph_conf;
504 mo.cbcmode = tc->cbcmode;
505
506 iv_desc->dma_descr->md = REG_TYPE_CONV(unsigned short int, struct strcop_meta_out, mo);
507
508 iv_desc->dma_descr->out_eop = 0;
509 iv_desc->dma_descr->wait = 1;
510 iv_desc->dma_descr->intr = 0;
511
512 *id = iv_desc;
513 return 0;
514}
515
516/* Map the ouput length of the transform to operation output starting on the inject index. */
517static int create_input_descriptors(struct cryptocop_operation *operation, struct cryptocop_tfrm_ctx *tc, struct cryptocop_dma_desc **id, int alloc_flag)
518{
519 int err = 0;
520 struct cryptocop_dma_desc head = {0};
521 struct cryptocop_dma_desc *outdesc = &head;
522 size_t iov_offset = 0;
523 size_t out_ix = 0;
524 int outiov_ix = 0;
525 struct strcop_meta_in mi = {0};
526
527 size_t out_length = tc->produced;
528 int rem_length;
529 int dlength;
530
531 assert(out_length != 0);
532 if (((tc->produced + tc->tcfg->inject_ix) > operation->tfrm_op.outlen) || (tc->produced && (operation->tfrm_op.outlen == 0))) {
533 DEBUG_API(printk("create_input_descriptors: operation outdata too small\n"));
534 return -EINVAL;
535 }
536 /* Traverse the out iovec until the result inject index is reached. */
537 while ((outiov_ix < operation->tfrm_op.outcount) && ((out_ix + operation->tfrm_op.outdata[outiov_ix].iov_len) <= tc->tcfg->inject_ix)){
538 out_ix += operation->tfrm_op.outdata[outiov_ix].iov_len;
539 outiov_ix++;
540 }
541 if (outiov_ix >= operation->tfrm_op.outcount){
542 DEBUG_API(printk("create_input_descriptors: operation outdata too small\n"));
543 return -EINVAL;
544 }
545 iov_offset = tc->tcfg->inject_ix - out_ix;
546 mi.dmasel = tc->unit_no;
547
548 /* Setup the output descriptors. */
549 while ((out_length > 0) && (outiov_ix < operation->tfrm_op.outcount)) {
550 outdesc->next = alloc_cdesc(alloc_flag);
551 if (!outdesc->next) {
552 DEBUG_API(printk("create_input_descriptors: alloc_cdesc\n"));
553 err = -ENOMEM;
554 goto error_cleanup;
555 }
556 outdesc = outdesc->next;
557 rem_length = operation->tfrm_op.outdata[outiov_ix].iov_len - iov_offset;
558 dlength = (out_length < rem_length) ? out_length : rem_length;
559
560 DEBUG(printk("create_input_descriptors:\n"
561 "outiov_ix=%d, rem_length=%d, dlength=%d\n"
562 "iov_offset=%d, outdata[outiov_ix].iov_len=%d\n"
563 "outcount=%d, outiov_ix=%d\n",
564 outiov_ix, rem_length, dlength, iov_offset, operation->tfrm_op.outdata[outiov_ix].iov_len, operation->tfrm_op.outcount, outiov_ix));
565
566 outdesc->dma_descr->buf = (char*)virt_to_phys(operation->tfrm_op.outdata[outiov_ix].iov_base + iov_offset);
567 outdesc->dma_descr->after = outdesc->dma_descr->buf + dlength;
568 outdesc->dma_descr->md = REG_TYPE_CONV(unsigned short int, struct strcop_meta_in, mi);
569
570 out_length -= dlength;
571 iov_offset += dlength;
572 if (iov_offset >= operation->tfrm_op.outdata[outiov_ix].iov_len) {
573 iov_offset = 0;
574 ++outiov_ix;
575 }
576 }
577 if (out_length > 0){
578 DEBUG_API(printk("create_input_descriptors: not enough room for output, %d remained\n", out_length));
579 err = -EINVAL;
580 goto error_cleanup;
581 }
582 /* Set sync in last descriptor. */
583 mi.sync = 1;
584 outdesc->dma_descr->md = REG_TYPE_CONV(unsigned short int, struct strcop_meta_in, mi);
585
586 *id = head.next;
587 return 0;
588
589 error_cleanup:
590 while (head.next) {
591 outdesc = head.next->next;
592 free_cdesc(head.next);
593 head.next = outdesc;
594 }
595 return err;
596}
597
598
599static int create_output_descriptors(struct cryptocop_operation *operation, int *iniov_ix, int *iniov_offset, size_t desc_len, struct cryptocop_dma_desc **current_out_cdesc, struct strcop_meta_out *meta_out, int alloc_flag)
600{
601 while (desc_len != 0) {
602 struct cryptocop_dma_desc *cdesc;
603 int rem_length = operation->tfrm_op.indata[*iniov_ix].iov_len - *iniov_offset;
604 int dlength = (desc_len < rem_length) ? desc_len : rem_length;
605
606 cdesc = alloc_cdesc(alloc_flag);
607 if (!cdesc) {
608 DEBUG_API(printk("create_output_descriptors: alloc_cdesc\n"));
609 return -ENOMEM;
610 }
611 (*current_out_cdesc)->next = cdesc;
612 (*current_out_cdesc) = cdesc;
613
614 cdesc->free_buf = NULL;
615
616 cdesc->dma_descr->buf = (char*)virt_to_phys(operation->tfrm_op.indata[*iniov_ix].iov_base + *iniov_offset);
617 cdesc->dma_descr->after = cdesc->dma_descr->buf + dlength;
618
619 desc_len -= dlength;
620 *iniov_offset += dlength;
621 assert(desc_len >= 0);
622 if (*iniov_offset >= operation->tfrm_op.indata[*iniov_ix].iov_len) {
623 *iniov_offset = 0;
624 ++(*iniov_ix);
625 if (*iniov_ix > operation->tfrm_op.incount) {
626 DEBUG_API(printk("create_output_descriptors: not enough indata in operation."));
627 return -EINVAL;
628 }
629 }
630 cdesc->dma_descr->md = REG_TYPE_CONV(unsigned short int, struct strcop_meta_out, (*meta_out));
631 } /* while (desc_len != 0) */
632 /* Last DMA descriptor gets a 'wait' bit to signal expected change in metadata. */
633 (*current_out_cdesc)->dma_descr->wait = 1; /* This will set extraneous WAIT in some situations, e.g. when padding hashes and checksums. */
634
635 return 0;
636}
637
638
639static int append_input_descriptors(struct cryptocop_operation *operation, struct cryptocop_dma_desc **current_in_cdesc, struct cryptocop_dma_desc **current_out_cdesc, struct cryptocop_tfrm_ctx *tc, int alloc_flag)
640{
641 DEBUG(printk("append_input_descriptors, tc=0x%p, unit_no=%d\n", tc, tc->unit_no));
642 if (tc->tcfg) {
643 int failed = 0;
644 struct cryptocop_dma_desc *idescs = NULL;
645 DEBUG(printk("append_input_descriptors: pushing output, consumed %d produced %d bytes.\n", tc->consumed, tc->produced));
646 if (tc->pad_descs) {
647 DEBUG(printk("append_input_descriptors: append pad descriptors to DMA out list.\n"));
648 while (tc->pad_descs) {
649 DEBUG(printk("append descriptor 0x%p\n", tc->pad_descs));
650 (*current_out_cdesc)->next = tc->pad_descs;
651 tc->pad_descs = tc->pad_descs->next;
652 (*current_out_cdesc) = (*current_out_cdesc)->next;
653 }
654 }
655
656 /* Setup and append output descriptors to DMA in list. */
657 if (tc->unit_no == src_dma){
658 /* mem2mem. Setup DMA in descriptors to discard all input prior to the requested mem2mem data. */
659 struct strcop_meta_in mi = {.sync = 0, .dmasel = src_dma};
660 unsigned int start_ix = tc->start_ix;
661 while (start_ix){
662 unsigned int desclen = start_ix < MEM2MEM_DISCARD_BUF_LENGTH ? start_ix : MEM2MEM_DISCARD_BUF_LENGTH;
663 (*current_in_cdesc)->next = alloc_cdesc(alloc_flag);
664 if (!(*current_in_cdesc)->next){
665 DEBUG_API(printk("append_input_descriptors: alloc_cdesc mem2mem discard failed\n"));
666 return -ENOMEM;
667 }
668 (*current_in_cdesc) = (*current_in_cdesc)->next;
669 (*current_in_cdesc)->dma_descr->buf = (char*)virt_to_phys(mem2mem_discard_buf);
670 (*current_in_cdesc)->dma_descr->after = (*current_in_cdesc)->dma_descr->buf + desclen;
671 (*current_in_cdesc)->dma_descr->md = REG_TYPE_CONV(unsigned short int, struct strcop_meta_in, mi);
672 start_ix -= desclen;
673 }
674 mi.sync = 1;
675 (*current_in_cdesc)->dma_descr->md = REG_TYPE_CONV(unsigned short int, struct strcop_meta_in, mi);
676 }
677
678 failed = create_input_descriptors(operation, tc, &idescs, alloc_flag);
679 if (failed){
680 DEBUG_API(printk("append_input_descriptors: output descriptor setup failed\n"));
681 return failed;
682 }
683 DEBUG(printk("append_input_descriptors: append output descriptors to DMA in list.\n"));
684 while (idescs) {
685 DEBUG(printk("append descriptor 0x%p\n", idescs));
686 (*current_in_cdesc)->next = idescs;
687 idescs = idescs->next;
688 (*current_in_cdesc) = (*current_in_cdesc)->next;
689 }
690 }
691 return 0;
692}
693
694
695
696static int cryptocop_setup_dma_list(struct cryptocop_operation *operation, struct cryptocop_int_operation **int_op, int alloc_flag)
697{
698 struct cryptocop_session *sess;
699 struct cryptocop_transform_ctx *tctx;
700
701 struct cryptocop_tfrm_ctx digest_ctx = {
702 .previous_src = src_none,
703 .current_src = src_none,
704 .start_ix = 0,
705 .requires_padding = 1,
706 .strict_block_length = 0,
707 .hash_conf = 0,
708 .hash_mode = 0,
709 .ciph_conf = 0,
710 .cbcmode = 0,
711 .decrypt = 0,
712 .consumed = 0,
713 .produced = 0,
714 .pad_descs = NULL,
715 .active = 0,
716 .done = 0,
717 .prev_src = NULL,
718 .curr_src = NULL,
719 .tcfg = NULL};
720 struct cryptocop_tfrm_ctx cipher_ctx = {
721 .previous_src = src_none,
722 .current_src = src_none,
723 .start_ix = 0,
724 .requires_padding = 0,
725 .strict_block_length = 1,
726 .hash_conf = 0,
727 .hash_mode = 0,
728 .ciph_conf = 0,
729 .cbcmode = 0,
730 .decrypt = 0,
731 .consumed = 0,
732 .produced = 0,
733 .pad_descs = NULL,
734 .active = 0,
735 .done = 0,
736 .prev_src = NULL,
737 .curr_src = NULL,
738 .tcfg = NULL};
739 struct cryptocop_tfrm_ctx csum_ctx = {
740 .previous_src = src_none,
741 .current_src = src_none,
742 .start_ix = 0,
743 .blocklength = 2,
744 .requires_padding = 1,
745 .strict_block_length = 0,
746 .hash_conf = 0,
747 .hash_mode = 0,
748 .ciph_conf = 0,
749 .cbcmode = 0,
750 .decrypt = 0,
751 .consumed = 0,
752 .produced = 0,
753 .pad_descs = NULL,
754 .active = 0,
755 .done = 0,
756 .tcfg = NULL,
757 .prev_src = NULL,
758 .curr_src = NULL,
759 .unit_no = src_csum};
760 struct cryptocop_tfrm_cfg *tcfg = operation->tfrm_op.tfrm_cfg;
761
762 unsigned int indata_ix = 0;
763
764 /* iovec accounting. */
765 int iniov_ix = 0;
766 int iniov_offset = 0;
767
768 /* Operation descriptor cfg traversal pointer. */
769 struct cryptocop_desc *odsc;
770
771 int failed = 0;
772 /* List heads for allocated descriptors. */
773 struct cryptocop_dma_desc out_cdesc_head = {0};
774 struct cryptocop_dma_desc in_cdesc_head = {0};
775
776 struct cryptocop_dma_desc *current_out_cdesc = &out_cdesc_head;
777 struct cryptocop_dma_desc *current_in_cdesc = &in_cdesc_head;
778
779 struct cryptocop_tfrm_ctx *output_tc = NULL;
780 void *iop_alloc_ptr;
781
782 assert(operation != NULL);
783 assert(int_op != NULL);
784
785 DEBUG(printk("cryptocop_setup_dma_list: start\n"));
786 DEBUG(print_cryptocop_operation(operation));
787
788 sess = get_session(operation->sid);
789 if (!sess) {
790 DEBUG_API(printk("cryptocop_setup_dma_list: no session found for operation.\n"));
791 failed = -EINVAL;
792 goto error_cleanup;
793 }
794 iop_alloc_ptr = kmalloc(DESCR_ALLOC_PAD + sizeof(struct cryptocop_int_operation), alloc_flag);
795 if (!iop_alloc_ptr) {
796 DEBUG_API(printk("cryptocop_setup_dma_list: kmalloc cryptocop_int_operation\n"));
797 failed = -ENOMEM;
798 goto error_cleanup;
799 }
800 (*int_op) = (struct cryptocop_int_operation*)(((unsigned long int)(iop_alloc_ptr + DESCR_ALLOC_PAD + offsetof(struct cryptocop_int_operation, ctx_out)) & ~0x0000001F) - offsetof(struct cryptocop_int_operation, ctx_out));
801 DEBUG(memset((*int_op), 0xff, sizeof(struct cryptocop_int_operation)));
802 (*int_op)->alloc_ptr = iop_alloc_ptr;
803 DEBUG(printk("cryptocop_setup_dma_list: *int_op=0x%p, alloc_ptr=0x%p\n", *int_op, (*int_op)->alloc_ptr));
804
805 (*int_op)->sid = operation->sid;
806 (*int_op)->cdesc_out = NULL;
807 (*int_op)->cdesc_in = NULL;
808 (*int_op)->tdes_mode = cryptocop_3des_ede;
809 (*int_op)->csum_mode = cryptocop_csum_le;
810 (*int_op)->ddesc_out = NULL;
811 (*int_op)->ddesc_in = NULL;
812
813 /* Scan operation->tfrm_op.tfrm_cfg for bad configuration and set up the local contexts. */
814 if (!tcfg) {
815 DEBUG_API(printk("cryptocop_setup_dma_list: no configured transforms in operation.\n"));
816 failed = -EINVAL;
817 goto error_cleanup;
818 }
819 while (tcfg) {
820 tctx = get_transform_ctx(sess, tcfg->tid);
821 if (!tctx) {
822 DEBUG_API(printk("cryptocop_setup_dma_list: no transform id %d in session.\n", tcfg->tid));
823 failed = -EINVAL;
824 goto error_cleanup;
825 }
826 if (tcfg->inject_ix > operation->tfrm_op.outlen){
827 DEBUG_API(printk("cryptocop_setup_dma_list: transform id %d inject_ix (%d) > operation->tfrm_op.outlen(%d)", tcfg->tid, tcfg->inject_ix, operation->tfrm_op.outlen));
828 failed = -EINVAL;
829 goto error_cleanup;
830 }
831 switch (tctx->init.alg){
832 case cryptocop_alg_mem2mem:
833 if (cipher_ctx.tcfg != NULL){
834 DEBUG_API(printk("cryptocop_setup_dma_list: multiple ciphers in operation.\n"));
835 failed = -EINVAL;
836 goto error_cleanup;
837 }
838 /* mem2mem is handled as a NULL cipher. */
839 cipher_ctx.cbcmode = 0;
840 cipher_ctx.decrypt = 0;
841 cipher_ctx.blocklength = 1;
842 cipher_ctx.ciph_conf = 0;
843 cipher_ctx.unit_no = src_dma;
844 cipher_ctx.tcfg = tcfg;
845 cipher_ctx.tctx = tctx;
846 break;
847 case cryptocop_alg_des:
848 case cryptocop_alg_3des:
849 case cryptocop_alg_aes:
850 /* cipher */
851 if (cipher_ctx.tcfg != NULL){
852 DEBUG_API(printk("cryptocop_setup_dma_list: multiple ciphers in operation.\n"));
853 failed = -EINVAL;
854 goto error_cleanup;
855 }
856 cipher_ctx.tcfg = tcfg;
857 cipher_ctx.tctx = tctx;
858 if (cipher_ctx.tcfg->flags & CRYPTOCOP_DECRYPT){
859 cipher_ctx.decrypt = 1;
860 }
861 switch (tctx->init.cipher_mode) {
862 case cryptocop_cipher_mode_ecb:
863 cipher_ctx.cbcmode = 0;
864 break;
865 case cryptocop_cipher_mode_cbc:
866 cipher_ctx.cbcmode = 1;
867 break;
868 default:
869 DEBUG_API(printk("cryptocop_setup_dma_list: cipher_ctx, bad cipher mode==%d\n", tctx->init.cipher_mode));
870 failed = -EINVAL;
871 goto error_cleanup;
872 }
873 DEBUG(printk("cryptocop_setup_dma_list: cipher_ctx, set CBC mode==%d\n", cipher_ctx.cbcmode));
874 switch (tctx->init.alg){
875 case cryptocop_alg_des:
876 cipher_ctx.ciph_conf = 0;
877 cipher_ctx.unit_no = src_des;
878 cipher_ctx.blocklength = DES_BLOCK_LENGTH;
879 break;
880 case cryptocop_alg_3des:
881 cipher_ctx.ciph_conf = 1;
882 cipher_ctx.unit_no = src_des;
883 cipher_ctx.blocklength = DES_BLOCK_LENGTH;
884 break;
885 case cryptocop_alg_aes:
886 cipher_ctx.ciph_conf = 2;
887 cipher_ctx.unit_no = src_aes;
888 cipher_ctx.blocklength = AES_BLOCK_LENGTH;
889 break;
890 default:
891 panic("cryptocop_setup_dma_list: impossible algorithm %d\n", tctx->init.alg);
892 }
893 (*int_op)->tdes_mode = tctx->init.tdes_mode;
894 break;
895 case cryptocop_alg_md5:
896 case cryptocop_alg_sha1:
897 /* digest */
898 if (digest_ctx.tcfg != NULL){
899 DEBUG_API(printk("cryptocop_setup_dma_list: multiple digests in operation.\n"));
900 failed = -EINVAL;
901 goto error_cleanup;
902 }
903 digest_ctx.tcfg = tcfg;
904 digest_ctx.tctx = tctx;
905 digest_ctx.hash_mode = 0; /* Don't use explicit IV in this API. */
906 switch (tctx->init.alg){
907 case cryptocop_alg_md5:
908 digest_ctx.blocklength = MD5_BLOCK_LENGTH;
909 digest_ctx.unit_no = src_md5;
910 digest_ctx.hash_conf = 1; /* 1 => MD-5 */
911 break;
912 case cryptocop_alg_sha1:
913 digest_ctx.blocklength = SHA1_BLOCK_LENGTH;
914 digest_ctx.unit_no = src_sha1;
915 digest_ctx.hash_conf = 0; /* 0 => SHA-1 */
916 break;
917 default:
918 panic("cryptocop_setup_dma_list: impossible digest algorithm\n");
919 }
920 break;
921 case cryptocop_alg_csum:
922 /* digest */
923 if (csum_ctx.tcfg != NULL){
924 DEBUG_API(printk("cryptocop_setup_dma_list: multiple checksums in operation.\n"));
925 failed = -EINVAL;
926 goto error_cleanup;
927 }
928 (*int_op)->csum_mode = tctx->init.csum_mode;
929 csum_ctx.tcfg = tcfg;
930 csum_ctx.tctx = tctx;
931 break;
932 default:
933 /* no algorithm. */
934 DEBUG_API(printk("cryptocop_setup_dma_list: invalid algorithm %d specified in tfrm %d.\n", tctx->init.alg, tcfg->tid));
935 failed = -EINVAL;
936 goto error_cleanup;
937 }
938 tcfg = tcfg->next;
939 }
940 /* Download key if a cipher is used. */
941 if (cipher_ctx.tcfg && (cipher_ctx.tctx->init.alg != cryptocop_alg_mem2mem)){
942 struct cryptocop_dma_desc *key_desc = NULL;
943
944 failed = setup_key_dl_desc(&cipher_ctx, &key_desc, alloc_flag);
945 if (failed) {
946 DEBUG_API(printk("cryptocop_setup_dma_list: setup key dl\n"));
947 goto error_cleanup;
948 }
949 current_out_cdesc->next = key_desc;
950 current_out_cdesc = key_desc;
951 indata_ix += (unsigned int)(key_desc->dma_descr->after - key_desc->dma_descr->buf);
952
953 /* Download explicit IV if a cipher is used and CBC mode and explicit IV selected. */
954 if ((cipher_ctx.tctx->init.cipher_mode == cryptocop_cipher_mode_cbc) && (cipher_ctx.tcfg->flags & CRYPTOCOP_EXPLICIT_IV)) {
955 struct cryptocop_dma_desc *iv_desc = NULL;
956
957 DEBUG(printk("cryptocop_setup_dma_list: setup cipher CBC IV descriptor.\n"));
958
959 failed = setup_cipher_iv_desc(&cipher_ctx, &iv_desc, alloc_flag);
960 if (failed) {
961 DEBUG_API(printk("cryptocop_setup_dma_list: CBC IV descriptor.\n"));
962 goto error_cleanup;
963 }
964 current_out_cdesc->next = iv_desc;
965 current_out_cdesc = iv_desc;
966 indata_ix += (unsigned int)(iv_desc->dma_descr->after - iv_desc->dma_descr->buf);
967 }
968 }
969
970 /* Process descriptors. */
971 odsc = operation->tfrm_op.desc;
972 while (odsc) {
973 struct cryptocop_desc_cfg *dcfg = odsc->cfg;
974 struct strcop_meta_out meta_out = {0};
975 size_t desc_len = odsc->length;
976 int active_count, eop_needed_count;
977
978 output_tc = NULL;
979
980 DEBUG(printk("cryptocop_setup_dma_list: parsing an operation descriptor\n"));
981
982 while (dcfg) {
983 struct cryptocop_tfrm_ctx *tc = NULL;
984
985 DEBUG(printk("cryptocop_setup_dma_list: parsing an operation descriptor configuration.\n"));
986 /* Get the local context for the transform and mark it as the output unit if it produces output. */
987 if (digest_ctx.tcfg && (digest_ctx.tcfg->tid == dcfg->tid)){
988 tc = &digest_ctx;
989 } else if (cipher_ctx.tcfg && (cipher_ctx.tcfg->tid == dcfg->tid)){
990 tc = &cipher_ctx;
991 } else if (csum_ctx.tcfg && (csum_ctx.tcfg->tid == dcfg->tid)){
992 tc = &csum_ctx;
993 }
994 if (!tc) {
995 DEBUG_API(printk("cryptocop_setup_dma_list: invalid transform %d specified in descriptor.\n", dcfg->tid));
996 failed = -EINVAL;
997 goto error_cleanup;
998 }
999 if (tc->done) {
1000 DEBUG_API(printk("cryptocop_setup_dma_list: completed transform %d reused.\n", dcfg->tid));
1001 failed = -EINVAL;
1002 goto error_cleanup;
1003 }
1004 if (!tc->active) {
1005 tc->start_ix = indata_ix;
1006 tc->active = 1;
1007 }
1008
1009 tc->previous_src = tc->current_src;
1010 tc->prev_src = tc->curr_src;
1011 /* Map source unit id to DMA source config. */
1012 switch (dcfg->src){
1013 case cryptocop_source_dma:
1014 tc->current_src = src_dma;
1015 break;
1016 case cryptocop_source_des:
1017 tc->current_src = src_des;
1018 break;
1019 case cryptocop_source_3des:
1020 tc->current_src = src_des;
1021 break;
1022 case cryptocop_source_aes:
1023 tc->current_src = src_aes;
1024 break;
1025 case cryptocop_source_md5:
1026 case cryptocop_source_sha1:
1027 case cryptocop_source_csum:
1028 case cryptocop_source_none:
1029 default:
1030 /* We do not allow using accumulating style units (SHA-1, MD5, checksum) as sources to other units.
1031 */
1032 DEBUG_API(printk("cryptocop_setup_dma_list: bad unit source configured %d.\n", dcfg->src));
1033 failed = -EINVAL;
1034 goto error_cleanup;
1035 }
1036 if (tc->current_src != src_dma) {
1037 /* Find the unit we are sourcing from. */
1038 if (digest_ctx.unit_no == tc->current_src){
1039 tc->curr_src = &digest_ctx;
1040 } else if (cipher_ctx.unit_no == tc->current_src){
1041 tc->curr_src = &cipher_ctx;
1042 } else if (csum_ctx.unit_no == tc->current_src){
1043 tc->curr_src = &csum_ctx;
1044 }
1045 if ((tc->curr_src == tc) && (tc->unit_no != src_dma)){
1046 DEBUG_API(printk("cryptocop_setup_dma_list: unit %d configured to source from itself.\n", tc->unit_no));
1047 failed = -EINVAL;
1048 goto error_cleanup;
1049 }
1050 } else {
1051 tc->curr_src = NULL;
1052 }
1053
1054 /* Detect source switch. */
1055 DEBUG(printk("cryptocop_setup_dma_list: tc->active=%d tc->unit_no=%d tc->current_src=%d tc->previous_src=%d, tc->curr_src=0x%p, tc->prev_srv=0x%p\n", tc->active, tc->unit_no, tc->current_src, tc->previous_src, tc->curr_src, tc->prev_src));
1056 if (tc->active && (tc->current_src != tc->previous_src)) {
1057 /* Only allow source switch when both the old source unit and the new one have
1058 * no pending data to process (i.e. the consumed length must be a multiple of the
1059 * transform blocklength). */
1060 /* Note: if the src == NULL we are actually sourcing from DMA out. */
1061 if (((tc->prev_src != NULL) && (tc->prev_src->consumed % tc->prev_src->blocklength)) ||
1062 ((tc->curr_src != NULL) && (tc->curr_src->consumed % tc->curr_src->blocklength)))
1063 {
1064 DEBUG_API(printk("cryptocop_setup_dma_list: can only disconnect from or connect to a unit on a multiple of the blocklength, old: cons=%d, prod=%d, block=%d, new: cons=%d prod=%d, block=%d.\n", tc->prev_src ? tc->prev_src->consumed : INT_MIN, tc->prev_src ? tc->prev_src->produced : INT_MIN, tc->prev_src ? tc->prev_src->blocklength : INT_MIN, tc->curr_src ? tc->curr_src->consumed : INT_MIN, tc->curr_src ? tc->curr_src->produced : INT_MIN, tc->curr_src ? tc->curr_src->blocklength : INT_MIN));
1065 failed = -EINVAL;
1066 goto error_cleanup;
1067 }
1068 }
1069 /* Detect unit deactivation. */
1070 if (dcfg->last) {
1071 /* Length check of this is handled below. */
1072 tc->done = 1;
1073 }
1074 dcfg = dcfg->next;
1075 } /* while (dcfg) */
1076 DEBUG(printk("cryptocop_setup_dma_list: parsing operation descriptor configuration complete.\n"));
1077
1078 if (cipher_ctx.active && (cipher_ctx.curr_src != NULL) && !cipher_ctx.curr_src->active){
1079 DEBUG_API(printk("cryptocop_setup_dma_list: cipher source from inactive unit %d\n", cipher_ctx.curr_src->unit_no));
1080 failed = -EINVAL;
1081 goto error_cleanup;
1082 }
1083 if (digest_ctx.active && (digest_ctx.curr_src != NULL) && !digest_ctx.curr_src->active){
1084 DEBUG_API(printk("cryptocop_setup_dma_list: digest source from inactive unit %d\n", digest_ctx.curr_src->unit_no));
1085 failed = -EINVAL;
1086 goto error_cleanup;
1087 }
1088 if (csum_ctx.active && (csum_ctx.curr_src != NULL) && !csum_ctx.curr_src->active){
1089 DEBUG_API(printk("cryptocop_setup_dma_list: cipher source from inactive unit %d\n", csum_ctx.curr_src->unit_no));
1090 failed = -EINVAL;
1091 goto error_cleanup;
1092 }
1093
1094 /* Update consumed and produced lengths.
1095
1096 The consumed length accounting here is actually cheating. If a unit source from DMA (or any
1097 other unit that process data in blocks of one octet) it is correct, but if it source from a
1098 block processing unit, i.e. a cipher, it will be temporarily incorrect at some times. However
1099 since it is only allowed--by the HW--to change source to or from a block processing unit at times where that
1100 unit has processed an exact multiple of its block length the end result will be correct.
1101 Beware that if the source change restriction change this code will need to be (much) reworked.
1102 */
1103 DEBUG(printk("cryptocop_setup_dma_list: desc->length=%d, desc_len=%d.\n", odsc->length, desc_len));
1104
1105 if (csum_ctx.active) {
1106 csum_ctx.consumed += desc_len;
1107 if (csum_ctx.done) {
1108 csum_ctx.produced = 2;
1109 }
1110 DEBUG(printk("cryptocop_setup_dma_list: csum_ctx producing: consumed=%d, produced=%d, blocklength=%d.\n", csum_ctx.consumed, csum_ctx.produced, csum_ctx.blocklength));
1111 }
1112 if (digest_ctx.active) {
1113 digest_ctx.consumed += desc_len;
1114 if (digest_ctx.done) {
1115 if (digest_ctx.unit_no == src_md5) {
1116 digest_ctx.produced = MD5_STATE_LENGTH;
1117 } else {
1118 digest_ctx.produced = SHA1_STATE_LENGTH;
1119 }
1120 }
1121 DEBUG(printk("cryptocop_setup_dma_list: digest_ctx producing: consumed=%d, produced=%d, blocklength=%d.\n", digest_ctx.consumed, digest_ctx.produced, digest_ctx.blocklength));
1122 }
1123 if (cipher_ctx.active) {
1124 /* Ciphers are allowed only to source from DMA out. That is filtered above. */
1125 assert(cipher_ctx.current_src == src_dma);
1126 cipher_ctx.consumed += desc_len;
1127 cipher_ctx.produced = cipher_ctx.blocklength * (cipher_ctx.consumed / cipher_ctx.blocklength);
1128 if (cipher_ctx.cbcmode && !(cipher_ctx.tcfg->flags & CRYPTOCOP_EXPLICIT_IV) && cipher_ctx.produced){
1129 cipher_ctx.produced -= cipher_ctx.blocklength; /* Compensate for CBC iv. */
1130 }
1131 DEBUG(printk("cryptocop_setup_dma_list: cipher_ctx producing: consumed=%d, produced=%d, blocklength=%d.\n", cipher_ctx.consumed, cipher_ctx.produced, cipher_ctx.blocklength));
1132 }
1133
1134 /* Setup the DMA out descriptors. */
1135 /* Configure the metadata. */
1136 active_count = 0;
1137 eop_needed_count = 0;
1138 if (cipher_ctx.active) {
1139 ++active_count;
1140 if (cipher_ctx.unit_no == src_dma){
1141 /* mem2mem */
1142 meta_out.ciphsel = src_none;
1143 } else {
1144 meta_out.ciphsel = cipher_ctx.current_src;
1145 }
1146 meta_out.ciphconf = cipher_ctx.ciph_conf;
1147 meta_out.cbcmode = cipher_ctx.cbcmode;
1148 meta_out.decrypt = cipher_ctx.decrypt;
1149 DEBUG(printk("set ciphsel=%d ciphconf=%d cbcmode=%d decrypt=%d\n", meta_out.ciphsel, meta_out.ciphconf, meta_out.cbcmode, meta_out.decrypt));
1150 if (cipher_ctx.done) ++eop_needed_count;
1151 } else {
1152 meta_out.ciphsel = src_none;
1153 }
1154
1155 if (digest_ctx.active) {
1156 ++active_count;
1157 meta_out.hashsel = digest_ctx.current_src;
1158 meta_out.hashconf = digest_ctx.hash_conf;
1159 meta_out.hashmode = 0; /* Explicit mode is not used here. */
1160 DEBUG(printk("set hashsel=%d hashconf=%d hashmode=%d\n", meta_out.hashsel, meta_out.hashconf, meta_out.hashmode));
1161 if (digest_ctx.done) {
1162 assert(digest_ctx.pad_descs == NULL);
1163 failed = create_pad_descriptor(&digest_ctx, &digest_ctx.pad_descs, alloc_flag);
1164 if (failed) {
1165 DEBUG_API(printk("cryptocop_setup_dma_list: failed digest pad creation.\n"));
1166 goto error_cleanup;
1167 }
1168 }
1169 } else {
1170 meta_out.hashsel = src_none;
1171 }
1172
1173 if (csum_ctx.active) {
1174 ++active_count;
1175 meta_out.csumsel = csum_ctx.current_src;
1176 if (csum_ctx.done) {
1177 assert(csum_ctx.pad_descs == NULL);
1178 failed = create_pad_descriptor(&csum_ctx, &csum_ctx.pad_descs, alloc_flag);
1179 if (failed) {
1180 DEBUG_API(printk("cryptocop_setup_dma_list: failed csum pad creation.\n"));
1181 goto error_cleanup;
1182 }
1183 }
1184 } else {
1185 meta_out.csumsel = src_none;
1186 }
1187 DEBUG(printk("cryptocop_setup_dma_list: %d eop needed, %d active units\n", eop_needed_count, active_count));
1188 /* Setup DMA out descriptors for the indata. */
1189 failed = create_output_descriptors(operation, &iniov_ix, &iniov_offset, desc_len, &current_out_cdesc, &meta_out, alloc_flag);
1190 if (failed) {
1191 DEBUG_API(printk("cryptocop_setup_dma_list: create_output_descriptors %d\n", failed));
1192 goto error_cleanup;
1193 }
1194 /* Setup out EOP. If there are active units that are not done here they cannot get an EOP
1195 * so we ust setup a zero length descriptor to DMA to signal EOP only to done units.
1196 * If there is a pad descriptor EOP for the padded unit will be EOPed by it.
1197 */
1198 assert(active_count >= eop_needed_count);
1199 assert((eop_needed_count == 0) || (eop_needed_count == 1));
1200 if (eop_needed_count) {
1201 /* This means that the bulk operation (cipeher/m2m) is terminated. */
1202 if (active_count > 1) {
1203 /* Use zero length EOP descriptor. */
1204 struct cryptocop_dma_desc *ed = alloc_cdesc(alloc_flag);
1205 struct strcop_meta_out ed_mo = {0};
1206 if (!ed) {
1207 DEBUG_API(printk("cryptocop_setup_dma_list: alloc EOP descriptor for cipher\n"));
1208 failed = -ENOMEM;
1209 goto error_cleanup;
1210 }
1211
1212 assert(cipher_ctx.active && cipher_ctx.done);
1213
1214 if (cipher_ctx.unit_no == src_dma){
1215 /* mem2mem */
1216 ed_mo.ciphsel = src_none;
1217 } else {
1218 ed_mo.ciphsel = cipher_ctx.current_src;
1219 }
1220 ed_mo.ciphconf = cipher_ctx.ciph_conf;
1221 ed_mo.cbcmode = cipher_ctx.cbcmode;
1222 ed_mo.decrypt = cipher_ctx.decrypt;
1223
1224 ed->free_buf = NULL;
1225 ed->dma_descr->wait = 1;
1226 ed->dma_descr->out_eop = 1;
1227
1228 ed->dma_descr->buf = (char*)virt_to_phys(&ed); /* Use any valid physical address for zero length descriptor. */
1229 ed->dma_descr->after = ed->dma_descr->buf;
1230 ed->dma_descr->md = REG_TYPE_CONV(unsigned short int, struct strcop_meta_out, ed_mo);
1231 current_out_cdesc->next = ed;
1232 current_out_cdesc = ed;
1233 } else {
1234 /* Set EOP in the current out descriptor since the only active module is
1235 * the one needing the EOP. */
1236
1237 current_out_cdesc->dma_descr->out_eop = 1;
1238 }
1239 }
1240
1241 if (cipher_ctx.done && cipher_ctx.active) cipher_ctx.active = 0;
1242 if (digest_ctx.done && digest_ctx.active) digest_ctx.active = 0;
1243 if (csum_ctx.done && csum_ctx.active) csum_ctx.active = 0;
1244 indata_ix += odsc->length;
1245 odsc = odsc->next;
1246 } /* while (odsc) */ /* Process descriptors. */
1247 DEBUG(printk("cryptocop_setup_dma_list: done parsing operation descriptors\n"));
1248 if (cipher_ctx.tcfg && (cipher_ctx.active || !cipher_ctx.done)){
1249 DEBUG_API(printk("cryptocop_setup_dma_list: cipher operation not terminated.\n"));
1250 failed = -EINVAL;
1251 goto error_cleanup;
1252 }
1253 if (digest_ctx.tcfg && (digest_ctx.active || !digest_ctx.done)){
1254 DEBUG_API(printk("cryptocop_setup_dma_list: digest operation not terminated.\n"));
1255 failed = -EINVAL;
1256 goto error_cleanup;
1257 }
1258 if (csum_ctx.tcfg && (csum_ctx.active || !csum_ctx.done)){
1259 DEBUG_API(printk("cryptocop_setup_dma_list: csum operation not terminated.\n"));
1260 failed = -EINVAL;
1261 goto error_cleanup;
1262 }
1263
1264 failed = append_input_descriptors(operation, &current_in_cdesc, &current_out_cdesc, &cipher_ctx, alloc_flag);
1265 if (failed){
1266 DEBUG_API(printk("cryptocop_setup_dma_list: append_input_descriptors cipher_ctx %d\n", failed));
1267 goto error_cleanup;
1268 }
1269 failed = append_input_descriptors(operation, &current_in_cdesc, &current_out_cdesc, &digest_ctx, alloc_flag);
1270 if (failed){
1271 DEBUG_API(printk("cryptocop_setup_dma_list: append_input_descriptors cipher_ctx %d\n", failed));
1272 goto error_cleanup;
1273 }
1274 failed = append_input_descriptors(operation, &current_in_cdesc, &current_out_cdesc, &csum_ctx, alloc_flag);
1275 if (failed){
1276 DEBUG_API(printk("cryptocop_setup_dma_list: append_input_descriptors cipher_ctx %d\n", failed));
1277 goto error_cleanup;
1278 }
1279
1280 DEBUG(printk("cryptocop_setup_dma_list: int_op=0x%p, *int_op=0x%p\n", int_op, *int_op));
1281 (*int_op)->cdesc_out = out_cdesc_head.next;
1282 (*int_op)->cdesc_in = in_cdesc_head.next;
1283 DEBUG(printk("cryptocop_setup_dma_list: out_cdesc_head=0x%p in_cdesc_head=0x%p\n", (*int_op)->cdesc_out, (*int_op)->cdesc_in));
1284
1285 setup_descr_chain(out_cdesc_head.next);
1286 setup_descr_chain(in_cdesc_head.next);
1287
1288 /* Last but not least: mark the last DMA in descriptor for a INTR and EOL and the the
1289 * last DMA out descriptor for EOL.
1290 */
1291 current_in_cdesc->dma_descr->intr = 1;
1292 current_in_cdesc->dma_descr->eol = 1;
1293 current_out_cdesc->dma_descr->eol = 1;
1294
1295 /* Setup DMA contexts. */
1296 (*int_op)->ctx_out.next = NULL;
1297 (*int_op)->ctx_out.eol = 1;
1298 (*int_op)->ctx_out.intr = 0;
1299 (*int_op)->ctx_out.store_mode = 0;
1300 (*int_op)->ctx_out.en = 0;
1301 (*int_op)->ctx_out.dis = 0;
1302 (*int_op)->ctx_out.md0 = 0;
1303 (*int_op)->ctx_out.md1 = 0;
1304 (*int_op)->ctx_out.md2 = 0;
1305 (*int_op)->ctx_out.md3 = 0;
1306 (*int_op)->ctx_out.md4 = 0;
1307 (*int_op)->ctx_out.saved_data = (dma_descr_data*)virt_to_phys((*int_op)->cdesc_out->dma_descr);
1308 (*int_op)->ctx_out.saved_data_buf = (*int_op)->cdesc_out->dma_descr->buf; /* Already physical address. */
1309
1310 (*int_op)->ctx_in.next = NULL;
1311 (*int_op)->ctx_in.eol = 1;
1312 (*int_op)->ctx_in.intr = 0;
1313 (*int_op)->ctx_in.store_mode = 0;
1314 (*int_op)->ctx_in.en = 0;
1315 (*int_op)->ctx_in.dis = 0;
1316 (*int_op)->ctx_in.md0 = 0;
1317 (*int_op)->ctx_in.md1 = 0;
1318 (*int_op)->ctx_in.md2 = 0;
1319 (*int_op)->ctx_in.md3 = 0;
1320 (*int_op)->ctx_in.md4 = 0;
1321
1322 (*int_op)->ctx_in.saved_data = (dma_descr_data*)virt_to_phys((*int_op)->cdesc_in->dma_descr);
1323 (*int_op)->ctx_in.saved_data_buf = (*int_op)->cdesc_in->dma_descr->buf; /* Already physical address. */
1324
1325 DEBUG(printk("cryptocop_setup_dma_list: done\n"));
1326 return 0;
1327
1328error_cleanup:
1329 {
1330 /* Free all allocated resources. */
1331 struct cryptocop_dma_desc *tmp_cdesc;
1332 while (digest_ctx.pad_descs){
1333 tmp_cdesc = digest_ctx.pad_descs->next;
1334 free_cdesc(digest_ctx.pad_descs);
1335 digest_ctx.pad_descs = tmp_cdesc;
1336 }
1337 while (csum_ctx.pad_descs){
1338 tmp_cdesc = csum_ctx.pad_descs->next;
1339 free_cdesc(csum_ctx.pad_descs);
1340 csum_ctx.pad_descs = tmp_cdesc;
1341 }
1342 assert(cipher_ctx.pad_descs == NULL); /* The ciphers are never padded. */
1343
1344 if (*int_op != NULL) delete_internal_operation(*int_op);
1345 }
1346 DEBUG_API(printk("cryptocop_setup_dma_list: done with error %d\n", failed));
1347 return failed;
1348}
1349
1350
1351static void delete_internal_operation(struct cryptocop_int_operation *iop)
1352{
1353 void *ptr = iop->alloc_ptr;
1354 struct cryptocop_dma_desc *cd = iop->cdesc_out;
1355 struct cryptocop_dma_desc *next;
1356
1357 DEBUG(printk("delete_internal_operation: iop=0x%p, alloc_ptr=0x%p\n", iop, ptr));
1358
1359 while (cd) {
1360 next = cd->next;
1361 free_cdesc(cd);
1362 cd = next;
1363 }
1364 cd = iop->cdesc_in;
1365 while (cd) {
1366 next = cd->next;
1367 free_cdesc(cd);
1368 cd = next;
1369 }
1370 kfree(ptr);
1371}
1372
1373#define MD5_MIN_PAD_LENGTH (9)
1374#define MD5_PAD_LENGTH_FIELD_LENGTH (8)
1375
1376static int create_md5_pad(int alloc_flag, unsigned long long hashed_length, char **pad, size_t *pad_length)
1377{
1378 size_t padlen = MD5_BLOCK_LENGTH - (hashed_length % MD5_BLOCK_LENGTH);
1379 unsigned char *p;
1380 int i;
1381 unsigned long long int bit_length = hashed_length << 3;
1382
1383 if (padlen < MD5_MIN_PAD_LENGTH) padlen += MD5_BLOCK_LENGTH;
1384
1385 p = kmalloc(padlen, alloc_flag);
1386 if (!pad) return -ENOMEM;
1387
1388 *p = 0x80;
1389 memset(p+1, 0, padlen - 1);
1390
1391 DEBUG(printk("create_md5_pad: hashed_length=%lld bits == %lld bytes\n", bit_length, hashed_length));
1392
1393 i = padlen - MD5_PAD_LENGTH_FIELD_LENGTH;
1394 while (bit_length != 0){
1395 p[i++] = bit_length % 0x100;
1396 bit_length >>= 8;
1397 }
1398
1399 *pad = (char*)p;
1400 *pad_length = padlen;
1401
1402 return 0;
1403}
1404
1405#define SHA1_MIN_PAD_LENGTH (9)
1406#define SHA1_PAD_LENGTH_FIELD_LENGTH (8)
1407
1408static int create_sha1_pad(int alloc_flag, unsigned long long hashed_length, char **pad, size_t *pad_length)
1409{
1410 size_t padlen = SHA1_BLOCK_LENGTH - (hashed_length % SHA1_BLOCK_LENGTH);
1411 unsigned char *p;
1412 int i;
1413 unsigned long long int bit_length = hashed_length << 3;
1414
1415 if (padlen < SHA1_MIN_PAD_LENGTH) padlen += SHA1_BLOCK_LENGTH;
1416
1417 p = kmalloc(padlen, alloc_flag);
1418 if (!pad) return -ENOMEM;
1419
1420 *p = 0x80;
1421 memset(p+1, 0, padlen - 1);
1422
1423 DEBUG(printk("create_sha1_pad: hashed_length=%lld bits == %lld bytes\n", bit_length, hashed_length));
1424
1425 i = padlen - 1;
1426 while (bit_length != 0){
1427 p[i--] = bit_length % 0x100;
1428 bit_length >>= 8;
1429 }
1430
1431 *pad = (char*)p;
1432 *pad_length = padlen;
1433
1434 return 0;
1435}
1436
1437
1438static int transform_ok(struct cryptocop_transform_init *tinit)
1439{
1440 switch (tinit->alg){
1441 case cryptocop_alg_csum:
1442 switch (tinit->csum_mode){
1443 case cryptocop_csum_le:
1444 case cryptocop_csum_be:
1445 break;
1446 default:
1447 DEBUG_API(printk("transform_ok: Bad mode set for csum transform\n"));
1448 return -EINVAL;
1449 }
1450 case cryptocop_alg_mem2mem:
1451 case cryptocop_alg_md5:
1452 case cryptocop_alg_sha1:
1453 if (tinit->keylen != 0) {
1454 DEBUG_API(printk("transform_ok: non-zero keylength, %d, for a digest/csum algorithm\n", tinit->keylen));
1455 return -EINVAL; /* This check is a bit strict. */
1456 }
1457 break;
1458 case cryptocop_alg_des:
1459 if (tinit->keylen != 64) {
1460 DEBUG_API(printk("transform_ok: keylen %d invalid for DES\n", tinit->keylen));
1461 return -EINVAL;
1462 }
1463 break;
1464 case cryptocop_alg_3des:
1465 if (tinit->keylen != 192) {
1466 DEBUG_API(printk("transform_ok: keylen %d invalid for 3DES\n", tinit->keylen));
1467 return -EINVAL;
1468 }
1469 break;
1470 case cryptocop_alg_aes:
1471 if (tinit->keylen != 128 && tinit->keylen != 192 && tinit->keylen != 256) {
1472 DEBUG_API(printk("transform_ok: keylen %d invalid for AES\n", tinit->keylen));
1473 return -EINVAL;
1474 }
1475 break;
1476 case cryptocop_no_alg:
1477 default:
1478 DEBUG_API(printk("transform_ok: no such algorithm %d\n", tinit->alg));
1479 return -EINVAL;
1480 }
1481
1482 switch (tinit->alg){
1483 case cryptocop_alg_des:
1484 case cryptocop_alg_3des:
1485 case cryptocop_alg_aes:
1486 if (tinit->cipher_mode != cryptocop_cipher_mode_ecb && tinit->cipher_mode != cryptocop_cipher_mode_cbc) return -EINVAL;
1487 default:
1488 break;
1489 }
1490 return 0;
1491}
1492
1493
1494int cryptocop_new_session(cryptocop_session_id *sid, struct cryptocop_transform_init *tinit, int alloc_flag)
1495{
1496 struct cryptocop_session *sess;
1497 struct cryptocop_transform_init *tfrm_in = tinit;
1498 struct cryptocop_transform_init *tmp_in;
1499 int no_tfrms = 0;
1500 int i;
1501 unsigned long int flags;
1502
1503 init_stream_coprocessor(); /* For safety if we are called early */
1504
1505 while (tfrm_in){
1506 int err;
1507 ++no_tfrms;
1508 if ((err = transform_ok(tfrm_in))) {
1509 DEBUG_API(printk("cryptocop_new_session, bad transform\n"));
1510 return err;
1511 }
1512 tfrm_in = tfrm_in->next;
1513 }
1514 if (0 == no_tfrms) {
1515 DEBUG_API(printk("cryptocop_new_session, no transforms specified\n"));
1516 return -EINVAL;
1517 }
1518
1519 sess = kmalloc(sizeof(struct cryptocop_session), alloc_flag);
1520 if (!sess){
1521 DEBUG_API(printk("cryptocop_new_session, kmalloc cryptocop_session\n"));
1522 return -ENOMEM;
1523 }
1524
1525 sess->tfrm_ctx = kmalloc(no_tfrms * sizeof(struct cryptocop_transform_ctx), alloc_flag);
1526 if (!sess->tfrm_ctx) {
1527 DEBUG_API(printk("cryptocop_new_session, kmalloc cryptocop_transform_ctx\n"));
1528 kfree(sess);
1529 return -ENOMEM;
1530 }
1531
1532 tfrm_in = tinit;
1533 for (i = 0; i < no_tfrms; i++){
1534 tmp_in = tfrm_in->next;
1535 while (tmp_in){
1536 if (tmp_in->tid == tfrm_in->tid) {
1537 DEBUG_API(printk("cryptocop_new_session, duplicate transform ids\n"));
1538 kfree(sess->tfrm_ctx);
1539 kfree(sess);
1540 return -EINVAL;
1541 }
1542 tmp_in = tmp_in->next;
1543 }
1544 memcpy(&sess->tfrm_ctx[i].init, tfrm_in, sizeof(struct cryptocop_transform_init));
1545 sess->tfrm_ctx[i].dec_key_set = 0;
1546 sess->tfrm_ctx[i].next = &sess->tfrm_ctx[i] + 1;
1547
1548 tfrm_in = tfrm_in->next;
1549 }
1550 sess->tfrm_ctx[i-1].next = NULL;
1551
1552 spin_lock_irqsave(&cryptocop_sessions_lock, flags);
1553 sess->sid = next_sid;
1554 next_sid++;
1555 /* TODO If we are really paranoid we should do duplicate check to handle sid wraparound.
1556 * OTOH 2^64 is a really large number of session. */
1557 if (next_sid == 0) next_sid = 1;
1558
1559 /* Prepend to session list. */
1560 sess->next = cryptocop_sessions;
1561 cryptocop_sessions = sess;
1562 spin_unlock_irqrestore(&cryptocop_sessions_lock, flags);
1563 *sid = sess->sid;
1564 return 0;
1565}
1566
1567
1568int cryptocop_free_session(cryptocop_session_id sid)
1569{
1570 struct cryptocop_transform_ctx *tc;
1571 struct cryptocop_session *sess = NULL;
1572 struct cryptocop_session *psess = NULL;
1573 unsigned long int flags;
1574 int i;
1575 LIST_HEAD(remove_list);
1576 struct list_head *node, *tmp;
1577 struct cryptocop_prio_job *pj;
1578
1579 DEBUG(printk("cryptocop_free_session: sid=%lld\n", sid));
1580
1581 spin_lock_irqsave(&cryptocop_sessions_lock, flags);
1582 sess = cryptocop_sessions;
1583 while (sess && sess->sid != sid){
1584 psess = sess;
1585 sess = sess->next;
1586 }
1587 if (sess){
1588 if (psess){
1589 psess->next = sess->next;
1590 } else {
1591 cryptocop_sessions = sess->next;
1592 }
1593 }
1594 spin_unlock_irqrestore(&cryptocop_sessions_lock, flags);
1595
1596 if (!sess) return -EINVAL;
1597
1598 /* Remove queued jobs. */
1599 spin_lock_irqsave(&cryptocop_job_queue_lock, flags);
1600
1601 for (i = 0; i < cryptocop_prio_no_prios; i++){
1602 if (!list_empty(&(cryptocop_job_queues[i].jobs))){
1603 list_for_each_safe(node, tmp, &(cryptocop_job_queues[i].jobs)) {
1604 pj = list_entry(node, struct cryptocop_prio_job, node);
1605 if (pj->oper->sid == sid) {
1606 list_move_tail(node, &remove_list);
1607 }
1608 }
1609 }
1610 }
1611 spin_unlock_irqrestore(&cryptocop_job_queue_lock, flags);
1612
1613 list_for_each_safe(node, tmp, &remove_list) {
1614 list_del(node);
1615 pj = list_entry(node, struct cryptocop_prio_job, node);
1616 pj->oper->operation_status = -EAGAIN; /* EAGAIN is not ideal for job/session terminated but it's the best choice I know of. */
1617 DEBUG(printk("cryptocop_free_session: pj=0x%p, pj->oper=0x%p, pj->iop=0x%p\n", pj, pj->oper, pj->iop));
1618 pj->oper->cb(pj->oper, pj->oper->cb_data);
1619 delete_internal_operation(pj->iop);
1620 kfree(pj);
1621 }
1622
1623 tc = sess->tfrm_ctx;
1624 /* Erase keying data. */
1625 while (tc){
1626 DEBUG(printk("cryptocop_free_session: memset keys, tfrm id=%d\n", tc->init.tid));
1627 memset(tc->init.key, 0xff, CRYPTOCOP_MAX_KEY_LENGTH);
1628 memset(tc->dec_key, 0xff, CRYPTOCOP_MAX_KEY_LENGTH);
1629 tc = tc->next;
1630 }
1631 kfree(sess->tfrm_ctx);
1632 kfree(sess);
1633
1634 return 0;
1635}
1636
1637static struct cryptocop_session *get_session(cryptocop_session_id sid)
1638{
1639 struct cryptocop_session *sess;
1640 unsigned long int flags;
1641
1642 spin_lock_irqsave(&cryptocop_sessions_lock, flags);
1643 sess = cryptocop_sessions;
1644 while (sess && (sess->sid != sid)){
1645 sess = sess->next;
1646 }
1647 spin_unlock_irqrestore(&cryptocop_sessions_lock, flags);
1648
1649 return sess;
1650}
1651
1652static struct cryptocop_transform_ctx *get_transform_ctx(struct cryptocop_session *sess, cryptocop_tfrm_id tid)
1653{
1654 struct cryptocop_transform_ctx *tc = sess->tfrm_ctx;
1655
1656 DEBUG(printk("get_transform_ctx, sess=0x%p, tid=%d\n", sess, tid));
1657 assert(sess != NULL);
1658 while (tc && tc->init.tid != tid){
1659 DEBUG(printk("tc=0x%p, tc->next=0x%p\n", tc, tc->next));
1660 tc = tc->next;
1661 }
1662 DEBUG(printk("get_transform_ctx, returning tc=0x%p\n", tc));
1663 return tc;
1664}
1665
1666
1667
1668/* The AES s-transform matrix (s-box). */
1669static const u8 aes_sbox[256] = {
1670 99, 124, 119, 123, 242, 107, 111, 197, 48, 1, 103, 43, 254, 215, 171, 118,
1671 202, 130, 201, 125, 250, 89, 71, 240, 173, 212, 162, 175, 156, 164, 114, 192,
1672 183, 253, 147, 38, 54, 63, 247, 204, 52, 165, 229, 241, 113, 216, 49, 21,
1673 4, 199, 35, 195, 24, 150, 5, 154, 7, 18, 128, 226, 235, 39, 178, 117,
1674 9, 131, 44, 26, 27, 110, 90, 160, 82, 59, 214, 179, 41, 227, 47, 132,
1675 83, 209, 0, 237, 32, 252, 177, 91, 106, 203, 190, 57, 74, 76, 88, 207,
1676 208, 239, 170, 251, 67, 77, 51, 133, 69, 249, 2, 127, 80, 60, 159, 168,
1677 81, 163, 64, 143, 146, 157, 56, 245, 188, 182, 218, 33, 16, 255, 243, 210,
1678 205, 12, 19, 236, 95, 151, 68, 23, 196, 167, 126, 61, 100, 93, 25, 115,
1679 96, 129, 79, 220, 34, 42, 144, 136, 70, 238, 184, 20, 222, 94, 11, 219,
1680 224, 50, 58, 10, 73, 6, 36, 92, 194, 211, 172, 98, 145, 149, 228, 121,
1681 231, 200, 55, 109, 141, 213, 78, 169, 108, 86, 244, 234, 101, 122, 174, 8,
1682 186, 120, 37, 46, 28, 166, 180, 198, 232, 221, 116, 31, 75, 189, 139, 138,
1683 112, 62, 181, 102, 72, 3, 246, 14, 97, 53, 87, 185, 134, 193, 29, 158,
1684 225, 248, 152, 17, 105, 217, 142, 148, 155, 30, 135, 233, 206, 85, 40, 223,
1685 140, 161, 137, 13, 191, 230, 66, 104, 65, 153, 45, 15, 176, 84, 187, 22
1686};
1687
1688/* AES has a 32 bit word round constants for each round in the
1689 * key schedule. round_constant[i] is really Rcon[i+1] in FIPS187.
1690 */
1691static u32 round_constant[11] = {
1692 0x01000000, 0x02000000, 0x04000000, 0x08000000,
1693 0x10000000, 0x20000000, 0x40000000, 0x80000000,
1694 0x1B000000, 0x36000000, 0x6C000000
1695};
1696
1697/* Apply the s-box to each of the four occtets in w. */
1698static u32 aes_ks_subword(const u32 w)
1699{
1700 u8 bytes[4];
1701
1702 *(u32*)(&bytes[0]) = w;
1703 bytes[0] = aes_sbox[bytes[0]];
1704 bytes[1] = aes_sbox[bytes[1]];
1705 bytes[2] = aes_sbox[bytes[2]];
1706 bytes[3] = aes_sbox[bytes[3]];
1707 return *(u32*)(&bytes[0]);
1708}
1709
1710/* The encrypt (forward) Rijndael key schedule algorithm pseudo code:
1711 * (Note that AES words are 32 bit long)
1712 *
1713 * KeyExpansion(byte key[4*Nk], word w[Nb*(Nr+1)], Nk){
1714 * word temp
1715 * i = 0
1716 * while (i < Nk) {
1717 * w[i] = word(key[4*i, 4*i + 1, 4*i + 2, 4*i + 3])
1718 * i = i + 1
1719 * }
1720 * i = Nk
1721 *
1722 * while (i < (Nb * (Nr + 1))) {
1723 * temp = w[i - 1]
1724 * if ((i mod Nk) == 0) {
1725 * temp = SubWord(RotWord(temp)) xor Rcon[i/Nk]
1726 * }
1727 * else if ((Nk > 6) && ((i mod Nk) == 4)) {
1728 * temp = SubWord(temp)
1729 * }
1730 * w[i] = w[i - Nk] xor temp
1731 * }
1732 * RotWord(t) does a 8 bit cyclic shift left on a 32 bit word.
1733 * SubWord(t) applies the AES s-box individually to each octet
1734 * in a 32 bit word.
1735 *
1736 * For AES Nk can have the values 4, 6, and 8 (corresponding to
1737 * values for Nr of 10, 12, and 14). Nb is always 4.
1738 *
1739 * To construct w[i], w[i - 1] and w[i - Nk] must be
1740 * available. Consequently we must keep a state of the last Nk words
1741 * to be able to create the last round keys.
1742 */
1743static void get_aes_decrypt_key(unsigned char *dec_key, const unsigned char *key, unsigned int keylength)
1744{
1745 u32 temp;
1746 u32 w_ring[8]; /* nk is max 8, use elements 0..(nk - 1) as a ringbuffer */
1747 u8 w_last_ix;
1748 int i;
1749 u8 nr, nk;
1750
1751 switch (keylength){
1752 case 128:
1753 nk = 4;
1754 nr = 10;
1755 break;
1756 case 192:
1757 nk = 6;
1758 nr = 12;
1759 break;
1760 case 256:
1761 nk = 8;
1762 nr = 14;
1763 break;
1764 default:
1765 panic("stream co-processor: bad aes key length in get_aes_decrypt_key\n");
1766 };
1767
1768 /* Need to do host byte order correction here since key is byte oriented and the
1769 * kx algorithm is word (u32) oriented. */
1770 for (i = 0; i < nk; i+=1) {
1771 w_ring[i] = be32_to_cpu(*(u32*)&key[4*i]);
1772 }
1773
1774 i = (int)nk;
1775 w_last_ix = i - 1;
1776 while (i < (4 * (nr + 2))) {
1777 temp = w_ring[w_last_ix];
1778 if (!(i % nk)) {
1779 /* RotWord(temp) */
1780 temp = (temp << 8) | (temp >> 24);
1781 temp = aes_ks_subword(temp);
1782 temp ^= round_constant[i/nk - 1];
1783 } else if ((nk > 6) && ((i % nk) == 4)) {
1784 temp = aes_ks_subword(temp);
1785 }
1786 w_last_ix = (w_last_ix + 1) % nk; /* This is the same as (i-Nk) mod Nk */
1787 temp ^= w_ring[w_last_ix];
1788 w_ring[w_last_ix] = temp;
1789
1790 /* We need the round keys for round Nr+1 and Nr+2 (round key
1791 * Nr+2 is the round key beyond the last one used when
1792 * encrypting). Rounds are numbered starting from 0, Nr=10
1793 * implies 11 rounds are used in encryption/decryption.
1794 */
1795 if (i >= (4 * nr)) {
1796 /* Need to do host byte order correction here, the key
1797 * is byte oriented. */
1798 *(u32*)dec_key = cpu_to_be32(temp);
1799 dec_key += 4;
1800 }
1801 ++i;
1802 }
1803}
1804
1805
1806/**** Job/operation management. ****/
1807
1808int cryptocop_job_queue_insert_csum(struct cryptocop_operation *operation)
1809{
1810 return cryptocop_job_queue_insert(cryptocop_prio_kernel_csum, operation);
1811}
1812
1813int cryptocop_job_queue_insert_crypto(struct cryptocop_operation *operation)
1814{
1815 return cryptocop_job_queue_insert(cryptocop_prio_kernel, operation);
1816}
1817
1818int cryptocop_job_queue_insert_user_job(struct cryptocop_operation *operation)
1819{
1820 return cryptocop_job_queue_insert(cryptocop_prio_user, operation);
1821}
1822
1823static int cryptocop_job_queue_insert(cryptocop_queue_priority prio, struct cryptocop_operation *operation)
1824{
1825 int ret;
1826 struct cryptocop_prio_job *pj = NULL;
1827 unsigned long int flags;
1828
1829 DEBUG(printk("cryptocop_job_queue_insert(%d, 0x%p)\n", prio, operation));
1830
1831 if (!operation || !operation->cb){
1832 DEBUG_API(printk("cryptocop_job_queue_insert oper=0x%p, NULL operation or callback\n", operation));
1833 return -EINVAL;
1834 }
1835
1836 if ((ret = cryptocop_job_setup(&pj, operation)) != 0){
1837 DEBUG_API(printk("cryptocop_job_queue_insert: job setup failed\n"));
1838 return ret;
1839 }
1840 assert(pj != NULL);
1841
1842 spin_lock_irqsave(&cryptocop_job_queue_lock, flags);
1843 list_add_tail(&pj->node, &cryptocop_job_queues[prio].jobs);
1844 spin_unlock_irqrestore(&cryptocop_job_queue_lock, flags);
1845
1846 /* Make sure a job is running */
1847 cryptocop_start_job();
1848 return 0;
1849}
1850
1851static void cryptocop_do_tasklet(unsigned long unused);
1852DECLARE_TASKLET (cryptocop_tasklet, cryptocop_do_tasklet, 0);
1853
1854static void cryptocop_do_tasklet(unsigned long unused)
1855{
1856 struct list_head *node;
1857 struct cryptocop_prio_job *pj = NULL;
1858 unsigned long flags;
1859
1860 DEBUG(printk("cryptocop_do_tasklet: entering\n"));
1861
1862 do {
1863 spin_lock_irqsave(&cryptocop_completed_jobs_lock, flags);
1864 if (!list_empty(&cryptocop_completed_jobs)){
1865 node = cryptocop_completed_jobs.next;
1866 list_del(node);
1867 pj = list_entry(node, struct cryptocop_prio_job, node);
1868 } else {
1869 pj = NULL;
1870 }
1871 spin_unlock_irqrestore(&cryptocop_completed_jobs_lock, flags);
1872 if (pj) {
1873 assert(pj->oper != NULL);
1874
1875 /* Notify consumer of operation completeness. */
1876 DEBUG(printk("cryptocop_do_tasklet: callback 0x%p, data 0x%p\n", pj->oper->cb, pj->oper->cb_data));
1877
1878 pj->oper->operation_status = 0; /* Job is completed. */
1879 pj->oper->cb(pj->oper, pj->oper->cb_data);
1880 delete_internal_operation(pj->iop);
1881 kfree(pj);
1882 }
1883 } while (pj != NULL);
1884
1885 DEBUG(printk("cryptocop_do_tasklet: exiting\n"));
1886}
1887
1888static irqreturn_t
1889dma_done_interrupt(int irq, void *dev_id, struct pt_regs * regs)
1890{
1891 struct cryptocop_prio_job *done_job;
1892 reg_dma_rw_ack_intr ack_intr = {
1893 .data = 1,
1894 };
1895
1896 REG_WR (dma, regi_dma9, rw_ack_intr, ack_intr);
1897
1898 DEBUG(printk("cryptocop DMA done\n"));
1899
1900 spin_lock(&running_job_lock);
1901 if (cryptocop_running_job == NULL){
1902 printk("stream co-processor got interrupt when not busy\n");
1903 spin_unlock(&running_job_lock);
1904 return IRQ_HANDLED;
1905 }
1906 done_job = cryptocop_running_job;
1907 cryptocop_running_job = NULL;
1908 spin_unlock(&running_job_lock);
1909
1910 /* Start processing a job. */
1911 if (!spin_trylock(&cryptocop_process_lock)){
1912 DEBUG(printk("cryptocop irq handler, not starting a job\n"));
1913 } else {
1914 cryptocop_start_job();
1915 spin_unlock(&cryptocop_process_lock);
1916 }
1917
1918 done_job->oper->operation_status = 0; /* Job is completed. */
1919 if (done_job->oper->fast_callback){
1920 /* This operation wants callback from interrupt. */
1921 done_job->oper->cb(done_job->oper, done_job->oper->cb_data);
1922 delete_internal_operation(done_job->iop);
1923 kfree(done_job);
1924 } else {
1925 spin_lock(&cryptocop_completed_jobs_lock);
1926 list_add_tail(&(done_job->node), &cryptocop_completed_jobs);
1927 spin_unlock(&cryptocop_completed_jobs_lock);
1928 tasklet_schedule(&cryptocop_tasklet);
1929 }
1930
1931 DEBUG(printk("cryptocop leave irq handler\n"));
1932 return IRQ_HANDLED;
1933}
1934
1935
1936/* Setup interrupts and DMA channels. */
1937static int init_cryptocop(void)
1938{
1939 unsigned long flags;
1940 reg_intr_vect_rw_mask intr_mask;
1941 reg_dma_rw_cfg dma_cfg = {.en = 1};
1942 reg_dma_rw_intr_mask intr_mask_in = {.data = regk_dma_yes}; /* Only want descriptor interrupts from the DMA in channel. */
1943 reg_dma_rw_ack_intr ack_intr = {.data = 1,.in_eop = 1 };
1944 reg_strcop_rw_cfg strcop_cfg = {
1945 .ipend = regk_strcop_little,
1946 .td1 = regk_strcop_e,
1947 .td2 = regk_strcop_d,
1948 .td3 = regk_strcop_e,
1949 .ignore_sync = 0,
1950 .en = 1
1951 };
1952
1953 if (request_irq(DMA9_INTR_VECT, dma_done_interrupt, 0, "stream co-processor DMA", NULL)) panic("request_irq stream co-processor irq dma9");
1954
1955 (void)crisv32_request_dma(8, "strcop", DMA_PANIC_ON_ERROR, 0, dma_strp);
1956 (void)crisv32_request_dma(9, "strcop", DMA_PANIC_ON_ERROR, 0, dma_strp);
1957
1958 local_irq_save(flags);
1959
1960 /* Reset and enable the cryptocop. */
1961 strcop_cfg.en = 0;
1962 REG_WR(strcop, regi_strcop, rw_cfg, strcop_cfg);
1963 strcop_cfg.en = 1;
1964 REG_WR(strcop, regi_strcop, rw_cfg, strcop_cfg);
1965
1966 /* Enable DMA9 interrupt */
1967 intr_mask = REG_RD(intr_vect, regi_irq, rw_mask);
1968 intr_mask.dma9 = 1;
1969 REG_WR(intr_vect, regi_irq, rw_mask, intr_mask);
1970
1971 /* Enable DMAs. */
1972 REG_WR(dma, regi_dma9, rw_cfg, dma_cfg); /* input DMA */
1973 REG_WR(dma, regi_dma8, rw_cfg, dma_cfg); /* output DMA */
1974
1975 /* Set up wordsize = 4 for DMAs. */
1976 DMA_WR_CMD (regi_dma8, regk_dma_set_w_size4);
1977 DMA_WR_CMD (regi_dma9, regk_dma_set_w_size4);
1978
1979 /* Enable interrupts. */
1980 REG_WR(dma, regi_dma9, rw_intr_mask, intr_mask_in);
1981
1982 /* Clear intr ack. */
1983 REG_WR(dma, regi_dma9, rw_ack_intr, ack_intr);
1984
1985 local_irq_restore(flags);
1986
1987 return 0;
1988}
1989
1990/* Free used cryptocop hw resources (interrupt and DMA channels). */
1991static void release_cryptocop(void)
1992{
1993 unsigned long flags;
1994 reg_intr_vect_rw_mask intr_mask;
1995 reg_dma_rw_cfg dma_cfg = {.en = 0};
1996 reg_dma_rw_intr_mask intr_mask_in = {0};
1997 reg_dma_rw_ack_intr ack_intr = {.data = 1,.in_eop = 1 };
1998
1999 local_irq_save(flags);
2000
2001 /* Clear intr ack. */
2002 REG_WR(dma, regi_dma9, rw_ack_intr, ack_intr);
2003
2004 /* Disable DMA9 interrupt */
2005 intr_mask = REG_RD(intr_vect, regi_irq, rw_mask);
2006 intr_mask.dma9 = 0;
2007 REG_WR(intr_vect, regi_irq, rw_mask, intr_mask);
2008
2009 /* Disable DMAs. */
2010 REG_WR(dma, regi_dma9, rw_cfg, dma_cfg); /* input DMA */
2011 REG_WR(dma, regi_dma8, rw_cfg, dma_cfg); /* output DMA */
2012
2013 /* Disable interrupts. */
2014 REG_WR(dma, regi_dma9, rw_intr_mask, intr_mask_in);
2015
2016 local_irq_restore(flags);
2017
2018 free_irq(DMA9_INTR_VECT, NULL);
2019
2020 (void)crisv32_free_dma(8);
2021 (void)crisv32_free_dma(9);
2022}
2023
2024
2025/* Init job queue. */
2026static int cryptocop_job_queue_init(void)
2027{
2028 int i;
2029
2030 INIT_LIST_HEAD(&cryptocop_completed_jobs);
2031
2032 for (i = 0; i < cryptocop_prio_no_prios; i++){
2033 cryptocop_job_queues[i].prio = (cryptocop_queue_priority)i;
2034 INIT_LIST_HEAD(&cryptocop_job_queues[i].jobs);
2035 }
2036 return 0;
2037}
2038
2039
2040static void cryptocop_job_queue_close(void)
2041{
2042 struct list_head *node, *tmp;
2043 struct cryptocop_prio_job *pj = NULL;
2044 unsigned long int process_flags, flags;
2045 int i;
2046
2047 /* FIXME: This is as yet untested code. */
2048
2049 /* Stop strcop from getting an operation to process while we are closing the
2050 module. */
2051 spin_lock_irqsave(&cryptocop_process_lock, process_flags);
2052
2053 /* Empty the job queue. */
2054 spin_lock_irqsave(&cryptocop_process_lock, process_flags);
2055 for (i = 0; i < cryptocop_prio_no_prios; i++){
2056 if (!list_empty(&(cryptocop_job_queues[i].jobs))){
2057 list_for_each_safe(node, tmp, &(cryptocop_job_queues[i].jobs)) {
2058 pj = list_entry(node, struct cryptocop_prio_job, node);
2059 list_del(node);
2060
2061 /* Call callback to notify consumer of job removal. */
2062 DEBUG(printk("cryptocop_job_queue_close: callback 0x%p, data 0x%p\n", pj->oper->cb, pj->oper->cb_data));
2063 pj->oper->operation_status = -EINTR; /* Job is terminated without completion. */
2064 pj->oper->cb(pj->oper, pj->oper->cb_data);
2065
2066 delete_internal_operation(pj->iop);
2067 kfree(pj);
2068 }
2069 }
2070 }
2071 spin_unlock_irqrestore(&cryptocop_process_lock, process_flags);
2072
2073 /* Remove the running job, if any. */
2074 spin_lock_irqsave(&running_job_lock, flags);
2075 if (cryptocop_running_job){
2076 reg_strcop_rw_cfg rw_cfg;
2077 reg_dma_rw_cfg dma_out_cfg, dma_in_cfg;
2078
2079 /* Stop DMA. */
2080 dma_out_cfg = REG_RD(dma, regi_dma8, rw_cfg);
2081 dma_out_cfg.en = regk_dma_no;
2082 REG_WR(dma, regi_dma8, rw_cfg, dma_out_cfg);
2083
2084 dma_in_cfg = REG_RD(dma, regi_dma9, rw_cfg);
2085 dma_in_cfg.en = regk_dma_no;
2086 REG_WR(dma, regi_dma9, rw_cfg, dma_in_cfg);
2087
2088 /* Disble the cryptocop. */
2089 rw_cfg = REG_RD(strcop, regi_strcop, rw_cfg);
2090 rw_cfg.en = 0;
2091 REG_WR(strcop, regi_strcop, rw_cfg, rw_cfg);
2092
2093 pj = cryptocop_running_job;
2094 cryptocop_running_job = NULL;
2095
2096 /* Call callback to notify consumer of job removal. */
2097 DEBUG(printk("cryptocop_job_queue_close: callback 0x%p, data 0x%p\n", pj->oper->cb, pj->oper->cb_data));
2098 pj->oper->operation_status = -EINTR; /* Job is terminated without completion. */
2099 pj->oper->cb(pj->oper, pj->oper->cb_data);
2100
2101 delete_internal_operation(pj->iop);
2102 kfree(pj);
2103 }
2104 spin_unlock_irqrestore(&running_job_lock, flags);
2105
2106 /* Remove completed jobs, if any. */
2107 spin_lock_irqsave(&cryptocop_completed_jobs_lock, flags);
2108
2109 list_for_each_safe(node, tmp, &cryptocop_completed_jobs) {
2110 pj = list_entry(node, struct cryptocop_prio_job, node);
2111 list_del(node);
2112 /* Call callback to notify consumer of job removal. */
2113 DEBUG(printk("cryptocop_job_queue_close: callback 0x%p, data 0x%p\n", pj->oper->cb, pj->oper->cb_data));
2114 pj->oper->operation_status = -EINTR; /* Job is terminated without completion. */
2115 pj->oper->cb(pj->oper, pj->oper->cb_data);
2116
2117 delete_internal_operation(pj->iop);
2118 kfree(pj);
2119 }
2120 spin_unlock_irqrestore(&cryptocop_completed_jobs_lock, flags);
2121}
2122
2123
2124static void cryptocop_start_job(void)
2125{
2126 int i;
2127 struct cryptocop_prio_job *pj;
2128 unsigned long int flags;
2129 unsigned long int running_job_flags;
2130 reg_strcop_rw_cfg rw_cfg = {.en = 1, .ignore_sync = 0};
2131
2132 DEBUG(printk("cryptocop_start_job: entering\n"));
2133
2134 spin_lock_irqsave(&running_job_lock, running_job_flags);
2135 if (cryptocop_running_job != NULL){
2136 /* Already running. */
2137 DEBUG(printk("cryptocop_start_job: already running, exit\n"));
2138 spin_unlock_irqrestore(&running_job_lock, running_job_flags);
2139 return;
2140 }
2141 spin_lock_irqsave(&cryptocop_job_queue_lock, flags);
2142
2143 /* Check the queues in priority order. */
2144 for (i = cryptocop_prio_kernel_csum; (i < cryptocop_prio_no_prios) && list_empty(&cryptocop_job_queues[i].jobs); i++);
2145 if (i == cryptocop_prio_no_prios) {
2146 spin_unlock_irqrestore(&cryptocop_job_queue_lock, flags);
2147 spin_unlock_irqrestore(&running_job_lock, running_job_flags);
2148 DEBUG(printk("cryptocop_start_job: no jobs to run\n"));
2149 return; /* No jobs to run */
2150 }
2151 DEBUG(printk("starting job for prio %d\n", i));
2152
2153 /* TODO: Do not starve lower priority jobs. Let in a lower
2154 * prio job for every N-th processed higher prio job or some
2155 * other scheduling policy. This could reasonably be
2156 * tweakable since the optimal balance would depend on the
2157 * type of load on the system. */
2158
2159 /* Pull the DMA lists from the job and start the DMA client. */
2160 pj = list_entry(cryptocop_job_queues[i].jobs.next, struct cryptocop_prio_job, node);
2161 list_del(&pj->node);
2162 spin_unlock_irqrestore(&cryptocop_job_queue_lock, flags);
2163 cryptocop_running_job = pj;
2164
2165 /* Set config register (3DES and CSUM modes). */
2166 switch (pj->iop->tdes_mode){
2167 case cryptocop_3des_eee:
2168 rw_cfg.td1 = regk_strcop_e;
2169 rw_cfg.td2 = regk_strcop_e;
2170 rw_cfg.td3 = regk_strcop_e;
2171 break;
2172 case cryptocop_3des_eed:
2173 rw_cfg.td1 = regk_strcop_e;
2174 rw_cfg.td2 = regk_strcop_e;
2175 rw_cfg.td3 = regk_strcop_d;
2176 break;
2177 case cryptocop_3des_ede:
2178 rw_cfg.td1 = regk_strcop_e;
2179 rw_cfg.td2 = regk_strcop_d;
2180 rw_cfg.td3 = regk_strcop_e;
2181 break;
2182 case cryptocop_3des_edd:
2183 rw_cfg.td1 = regk_strcop_e;
2184 rw_cfg.td2 = regk_strcop_d;
2185 rw_cfg.td3 = regk_strcop_d;
2186 break;
2187 case cryptocop_3des_dee:
2188 rw_cfg.td1 = regk_strcop_d;
2189 rw_cfg.td2 = regk_strcop_e;
2190 rw_cfg.td3 = regk_strcop_e;
2191 break;
2192 case cryptocop_3des_ded:
2193 rw_cfg.td1 = regk_strcop_d;
2194 rw_cfg.td2 = regk_strcop_e;
2195 rw_cfg.td3 = regk_strcop_d;
2196 break;
2197 case cryptocop_3des_dde:
2198 rw_cfg.td1 = regk_strcop_d;
2199 rw_cfg.td2 = regk_strcop_d;
2200 rw_cfg.td3 = regk_strcop_e;
2201 break;
2202 case cryptocop_3des_ddd:
2203 rw_cfg.td1 = regk_strcop_d;
2204 rw_cfg.td2 = regk_strcop_d;
2205 rw_cfg.td3 = regk_strcop_d;
2206 break;
2207 default:
2208 DEBUG(printk("cryptocop_setup_dma_list: bad 3DES mode\n"));
2209 }
2210 switch (pj->iop->csum_mode){
2211 case cryptocop_csum_le:
2212 rw_cfg.ipend = regk_strcop_little;
2213 break;
2214 case cryptocop_csum_be:
2215 rw_cfg.ipend = regk_strcop_big;
2216 break;
2217 default:
2218 DEBUG(printk("cryptocop_setup_dma_list: bad checksum mode\n"));
2219 }
2220 REG_WR(strcop, regi_strcop, rw_cfg, rw_cfg);
2221
2222 DEBUG(printk("cryptocop_start_job: starting DMA, new cryptocop_running_job=0x%p\n"
2223 "ctx_in: 0x%p, phys: 0x%p\n"
2224 "ctx_out: 0x%p, phys: 0x%p\n",
2225 pj,
2226 &pj->iop->ctx_in, (char*)virt_to_phys(&pj->iop->ctx_in),
2227 &pj->iop->ctx_out, (char*)virt_to_phys(&pj->iop->ctx_out)));
2228
2229 /* Start input DMA. */
2230 DMA_START_CONTEXT(regi_dma9, virt_to_phys(&pj->iop->ctx_in));
2231
2232 /* Start output DMA. */
2233 DMA_START_CONTEXT(regi_dma8, virt_to_phys(&pj->iop->ctx_out));
2234
2235 spin_unlock_irqrestore(&running_job_lock, running_job_flags);
2236 DEBUG(printk("cryptocop_start_job: exiting\n"));
2237}
2238
2239
2240static int cryptocop_job_setup(struct cryptocop_prio_job **pj, struct cryptocop_operation *operation)
2241{
2242 int err;
2243 int alloc_flag = operation->in_interrupt ? GFP_ATOMIC : GFP_KERNEL;
2244 void *iop_alloc_ptr = NULL;
2245
2246 *pj = kmalloc(sizeof (struct cryptocop_prio_job), alloc_flag);
2247 if (!*pj) return -ENOMEM;
2248
2249 DEBUG(printk("cryptocop_job_setup: operation=0x%p\n", operation));
2250
2251 (*pj)->oper = operation;
2252 DEBUG(printk("cryptocop_job_setup, cb=0x%p cb_data=0x%p\n", (*pj)->oper->cb, (*pj)->oper->cb_data));
2253
2254 if (operation->use_dmalists) {
2255 DEBUG(print_user_dma_lists(&operation->list_op));
2256 if (!operation->list_op.inlist || !operation->list_op.outlist || !operation->list_op.out_data_buf || !operation->list_op.in_data_buf){
2257 DEBUG_API(printk("cryptocop_job_setup: bad indata (use_dmalists)\n"));
2258 kfree(*pj);
2259 return -EINVAL;
2260 }
2261 iop_alloc_ptr = kmalloc(DESCR_ALLOC_PAD + sizeof(struct cryptocop_int_operation), alloc_flag);
2262 if (!iop_alloc_ptr) {
2263 DEBUG_API(printk("cryptocop_job_setup: kmalloc cryptocop_int_operation\n"));
2264 kfree(*pj);
2265 return -ENOMEM;
2266 }
2267 (*pj)->iop = (struct cryptocop_int_operation*)(((unsigned long int)(iop_alloc_ptr + DESCR_ALLOC_PAD + offsetof(struct cryptocop_int_operation, ctx_out)) & ~0x0000001F) - offsetof(struct cryptocop_int_operation, ctx_out));
2268 DEBUG(memset((*pj)->iop, 0xff, sizeof(struct cryptocop_int_operation)));
2269 (*pj)->iop->alloc_ptr = iop_alloc_ptr;
2270 (*pj)->iop->sid = operation->sid;
2271 (*pj)->iop->cdesc_out = NULL;
2272 (*pj)->iop->cdesc_in = NULL;
2273 (*pj)->iop->tdes_mode = operation->list_op.tdes_mode;
2274 (*pj)->iop->csum_mode = operation->list_op.csum_mode;
2275 (*pj)->iop->ddesc_out = operation->list_op.outlist;
2276 (*pj)->iop->ddesc_in = operation->list_op.inlist;
2277
2278 /* Setup DMA contexts. */
2279 (*pj)->iop->ctx_out.next = NULL;
2280 (*pj)->iop->ctx_out.eol = 1;
2281 (*pj)->iop->ctx_out.saved_data = operation->list_op.outlist;
2282 (*pj)->iop->ctx_out.saved_data_buf = operation->list_op.out_data_buf;
2283
2284 (*pj)->iop->ctx_in.next = NULL;
2285 (*pj)->iop->ctx_in.eol = 1;
2286 (*pj)->iop->ctx_in.saved_data = operation->list_op.inlist;
2287 (*pj)->iop->ctx_in.saved_data_buf = operation->list_op.in_data_buf;
2288 } else {
2289 if ((err = cryptocop_setup_dma_list(operation, &(*pj)->iop, alloc_flag))) {
2290 DEBUG_API(printk("cryptocop_job_setup: cryptocop_setup_dma_list failed %d\n", err));
2291 kfree(*pj);
2292 return err;
2293 }
2294 }
2295 DEBUG(print_dma_descriptors((*pj)->iop));
2296
2297 DEBUG(printk("cryptocop_job_setup, DMA list setup successful\n"));
2298
2299 return 0;
2300}
2301
2302
2303static int cryptocop_open(struct inode *inode, struct file *filp)
2304{
2305 int p = MINOR(inode->i_rdev);
2306
2307 if (p != CRYPTOCOP_MINOR) return -EINVAL;
2308
2309 filp->private_data = NULL;
2310 return 0;
2311}
2312
2313
2314static int cryptocop_release(struct inode *inode, struct file *filp)
2315{
2316 struct cryptocop_private *dev = filp->private_data;
2317 struct cryptocop_private *dev_next;
2318
2319 while (dev){
2320 dev_next = dev->next;
2321 if (dev->sid != CRYPTOCOP_SESSION_ID_NONE) {
2322 (void)cryptocop_free_session(dev->sid);
2323 }
2324 kfree(dev);
2325 dev = dev_next;
2326 }
2327
2328 return 0;
2329}
2330
2331
2332static int cryptocop_ioctl_close_session(struct inode *inode, struct file *filp,
2333 unsigned int cmd, unsigned long arg)
2334{
2335 struct cryptocop_private *dev = filp->private_data;
2336 struct cryptocop_private *prev_dev = NULL;
2337 struct strcop_session_op *sess_op = (struct strcop_session_op *)arg;
2338 struct strcop_session_op sop;
2339 int err;
2340
2341 DEBUG(printk("cryptocop_ioctl_close_session\n"));
2342
2343 if (!access_ok(VERIFY_READ, sess_op, sizeof(struct strcop_session_op)))
2344 return -EFAULT;
2345 err = copy_from_user(&sop, sess_op, sizeof(struct strcop_session_op));
2346 if (err) return -EFAULT;
2347
2348 while (dev && (dev->sid != sop.ses_id)) {
2349 prev_dev = dev;
2350 dev = dev->next;
2351 }
2352 if (dev){
2353 if (prev_dev){
2354 prev_dev->next = dev->next;
2355 } else {
2356 filp->private_data = dev->next;
2357 }
2358 err = cryptocop_free_session(dev->sid);
2359 if (err) return -EFAULT;
2360 } else {
2361 DEBUG_API(printk("cryptocop_ioctl_close_session: session %lld not found\n", sop.ses_id));
2362 return -EINVAL;
2363 }
2364 return 0;
2365}
2366
2367
2368static void ioctl_process_job_callback(struct cryptocop_operation *op, void*cb_data)
2369{
2370 struct ioctl_job_cb_ctx *jc = (struct ioctl_job_cb_ctx *)cb_data;
2371
2372 DEBUG(printk("ioctl_process_job_callback: op=0x%p, cb_data=0x%p\n", op, cb_data));
2373
2374 jc->processed = 1;
2375 wake_up(&cryptocop_ioc_process_wq);
2376}
2377
2378
2379#define CRYPTOCOP_IOCTL_CIPHER_TID (1)
2380#define CRYPTOCOP_IOCTL_DIGEST_TID (2)
2381#define CRYPTOCOP_IOCTL_CSUM_TID (3)
2382
2383static size_t first_cfg_change_ix(struct strcop_crypto_op *crp_op)
2384{
2385 size_t ch_ix = 0;
2386
2387 if (crp_op->do_cipher) ch_ix = crp_op->cipher_start;
2388 if (crp_op->do_digest && (crp_op->digest_start < ch_ix)) ch_ix = crp_op->digest_start;
2389 if (crp_op->do_csum && (crp_op->csum_start < ch_ix)) ch_ix = crp_op->csum_start;
2390
2391 DEBUG(printk("first_cfg_change_ix: ix=%d\n", ch_ix));
2392 return ch_ix;
2393}
2394
2395
2396static size_t next_cfg_change_ix(struct strcop_crypto_op *crp_op, size_t ix)
2397{
2398 size_t ch_ix = INT_MAX;
2399 size_t tmp_ix = 0;
2400
2401 if (crp_op->do_cipher && ((crp_op->cipher_start + crp_op->cipher_len) > ix)){
2402 if (crp_op->cipher_start > ix) {
2403 ch_ix = crp_op->cipher_start;
2404 } else {
2405 ch_ix = crp_op->cipher_start + crp_op->cipher_len;
2406 }
2407 }
2408 if (crp_op->do_digest && ((crp_op->digest_start + crp_op->digest_len) > ix)){
2409 if (crp_op->digest_start > ix) {
2410 tmp_ix = crp_op->digest_start;
2411 } else {
2412 tmp_ix = crp_op->digest_start + crp_op->digest_len;
2413 }
2414 if (tmp_ix < ch_ix) ch_ix = tmp_ix;
2415 }
2416 if (crp_op->do_csum && ((crp_op->csum_start + crp_op->csum_len) > ix)){
2417 if (crp_op->csum_start > ix) {
2418 tmp_ix = crp_op->csum_start;
2419 } else {
2420 tmp_ix = crp_op->csum_start + crp_op->csum_len;
2421 }
2422 if (tmp_ix < ch_ix) ch_ix = tmp_ix;
2423 }
2424 if (ch_ix == INT_MAX) ch_ix = ix;
2425 DEBUG(printk("next_cfg_change_ix prev ix=%d, next ix=%d\n", ix, ch_ix));
2426 return ch_ix;
2427}
2428
2429
2430/* Map map_length bytes from the pages starting on *pageix and *pageoffset to iovecs starting on *iovix.
2431 * Return -1 for ok, 0 for fail. */
2432static int map_pages_to_iovec(struct iovec *iov, int iovlen, int *iovix, struct page **pages, int nopages, int *pageix, int *pageoffset, int map_length )
2433{
2434 int tmplen;
2435
2436 assert(iov != NULL);
2437 assert(iovix != NULL);
2438 assert(pages != NULL);
2439 assert(pageix != NULL);
2440 assert(pageoffset != NULL);
2441
2442 DEBUG(printk("map_pages_to_iovec, map_length=%d, iovlen=%d, *iovix=%d, nopages=%d, *pageix=%d, *pageoffset=%d\n", map_length, iovlen, *iovix, nopages, *pageix, *pageoffset));
2443
2444 while (map_length > 0){
2445 DEBUG(printk("map_pages_to_iovec, map_length=%d, iovlen=%d, *iovix=%d, nopages=%d, *pageix=%d, *pageoffset=%d\n", map_length, iovlen, *iovix, nopages, *pageix, *pageoffset));
2446 if (*iovix >= iovlen){
2447 DEBUG_API(printk("map_page_to_iovec: *iovix=%d >= iovlen=%d\n", *iovix, iovlen));
2448 return 0;
2449 }
2450 if (*pageix >= nopages){
2451 DEBUG_API(printk("map_page_to_iovec: *pageix=%d >= nopages=%d\n", *pageix, nopages));
2452 return 0;
2453 }
2454 iov[*iovix].iov_base = (unsigned char*)page_address(pages[*pageix]) + *pageoffset;
2455 tmplen = PAGE_SIZE - *pageoffset;
2456 if (tmplen < map_length){
2457 (*pageoffset) = 0;
2458 (*pageix)++;
2459 } else {
2460 tmplen = map_length;
2461 (*pageoffset) += map_length;
2462 }
2463 DEBUG(printk("mapping %d bytes from page %d (or %d) to iovec %d\n", tmplen, *pageix, *pageix-1, *iovix));
2464 iov[*iovix].iov_len = tmplen;
2465 map_length -= tmplen;
2466 (*iovix)++;
2467 }
2468 DEBUG(printk("map_page_to_iovec, exit, *iovix=%d\n", *iovix));
2469 return -1;
2470}
2471
2472
2473
2474static int cryptocop_ioctl_process(struct inode *inode, struct file *filp, unsigned int cmd, unsigned long arg)
2475{
2476 int i;
2477 struct cryptocop_private *dev = filp->private_data;
2478 struct strcop_crypto_op *crp_oper = (struct strcop_crypto_op *)arg;
2479 struct strcop_crypto_op oper = {0};
2480 int err = 0;
2481 struct cryptocop_operation *cop = NULL;
2482
2483 struct ioctl_job_cb_ctx *jc = NULL;
2484
2485 struct page **inpages = NULL;
2486 struct page **outpages = NULL;
2487 int noinpages = 0;
2488 int nooutpages = 0;
2489
2490 struct cryptocop_desc descs[5]; /* Max 5 descriptors are needed, there are three transforms that
2491 * can get connected/disconnected on different places in the indata. */
2492 struct cryptocop_desc_cfg dcfgs[5*3];
2493 int desc_ix = 0;
2494 int dcfg_ix = 0;
2495 struct cryptocop_tfrm_cfg ciph_tcfg = {0};
2496 struct cryptocop_tfrm_cfg digest_tcfg = {0};
2497 struct cryptocop_tfrm_cfg csum_tcfg = {0};
2498
2499 unsigned char *digest_result = NULL;
2500 int digest_length = 0;
2501 int cblocklen = 0;
2502 unsigned char csum_result[CSUM_BLOCK_LENGTH];
2503 struct cryptocop_session *sess;
2504
2505 int iovlen = 0;
2506 int iovix = 0;
2507 int pageix = 0;
2508 int pageoffset = 0;
2509
2510 size_t prev_ix = 0;
2511 size_t next_ix;
2512
2513 int cipher_active, digest_active, csum_active;
2514 int end_digest, end_csum;
2515 int digest_done = 0;
2516 int cipher_done = 0;
2517 int csum_done = 0;
2518
2519 DEBUG(printk("cryptocop_ioctl_process\n"));
2520
2521 if (!access_ok(VERIFY_WRITE, crp_oper, sizeof(struct strcop_crypto_op))){
2522 DEBUG_API(printk("cryptocop_ioctl_process: !access_ok crp_oper!\n"));
2523 return -EFAULT;
2524 }
2525 if (copy_from_user(&oper, crp_oper, sizeof(struct strcop_crypto_op))) {
2526 DEBUG_API(printk("cryptocop_ioctl_process: copy_from_user\n"));
2527 return -EFAULT;
2528 }
2529 DEBUG(print_strcop_crypto_op(&oper));
2530
2531 while (dev && dev->sid != oper.ses_id) dev = dev->next;
2532 if (!dev){
2533 DEBUG_API(printk("cryptocop_ioctl_process: session %lld not found\n", oper.ses_id));
2534 return -EINVAL;
2535 }
2536
2537 /* Check buffers. */
2538 if (((oper.indata + oper.inlen) < oper.indata) || ((oper.cipher_outdata + oper.cipher_outlen) < oper.cipher_outdata)){
2539 DEBUG_API(printk("cryptocop_ioctl_process: user buffers wrapped around, bad user!\n"));
2540 return -EINVAL;
2541 }
2542
2543 if (!access_ok(VERIFY_WRITE, oper.cipher_outdata, oper.cipher_outlen)){
2544 DEBUG_API(printk("cryptocop_ioctl_process: !access_ok out data!\n"));
2545 return -EFAULT;
2546 }
2547 if (!access_ok(VERIFY_READ, oper.indata, oper.inlen)){
2548 DEBUG_API(printk("cryptocop_ioctl_process: !access_ok in data!\n"));
2549 return -EFAULT;
2550 }
2551
2552 cop = kmalloc(sizeof(struct cryptocop_operation), GFP_KERNEL);
2553 if (!cop) {
2554 DEBUG_API(printk("cryptocop_ioctl_process: kmalloc\n"));
2555 return -ENOMEM;
2556 }
2557 jc = kmalloc(sizeof(struct ioctl_job_cb_ctx), GFP_KERNEL);
2558 if (!jc) {
2559 DEBUG_API(printk("cryptocop_ioctl_process: kmalloc\n"));
2560 err = -ENOMEM;
2561 goto error_cleanup;
2562 }
2563 jc->processed = 0;
2564
2565 cop->cb_data = jc;
2566 cop->cb = ioctl_process_job_callback;
2567 cop->operation_status = 0;
2568 cop->use_dmalists = 0;
2569 cop->in_interrupt = 0;
2570 cop->fast_callback = 0;
2571 cop->tfrm_op.tfrm_cfg = NULL;
2572 cop->tfrm_op.desc = NULL;
2573 cop->tfrm_op.indata = NULL;
2574 cop->tfrm_op.incount = 0;
2575 cop->tfrm_op.inlen = 0;
2576 cop->tfrm_op.outdata = NULL;
2577 cop->tfrm_op.outcount = 0;
2578 cop->tfrm_op.outlen = 0;
2579
2580 sess = get_session(oper.ses_id);
2581 if (!sess){
2582 DEBUG_API(printk("cryptocop_ioctl_process: bad session id.\n"));
2583 kfree(cop);
2584 kfree(jc);
2585 return -EINVAL;
2586 }
2587
2588 if (oper.do_cipher) {
2589 unsigned int cipher_outlen = 0;
2590 struct cryptocop_transform_ctx *tc = get_transform_ctx(sess, CRYPTOCOP_IOCTL_CIPHER_TID);
2591 if (!tc) {
2592 DEBUG_API(printk("cryptocop_ioctl_process: no cipher transform in session.\n"));
2593 err = -EINVAL;
2594 goto error_cleanup;
2595 }
2596 ciph_tcfg.tid = CRYPTOCOP_IOCTL_CIPHER_TID;
2597 ciph_tcfg.inject_ix = 0;
2598 ciph_tcfg.flags = 0;
2599 if ((oper.cipher_start < 0) || (oper.cipher_len <= 0) || (oper.cipher_start > oper.inlen) || ((oper.cipher_start + oper.cipher_len) > oper.inlen)){
2600 DEBUG_API(printk("cryptocop_ioctl_process: bad cipher length\n"));
2601 kfree(cop);
2602 kfree(jc);
2603 return -EINVAL;
2604 }
2605 cblocklen = tc->init.alg == cryptocop_alg_aes ? AES_BLOCK_LENGTH : DES_BLOCK_LENGTH;
2606 if (oper.cipher_len % cblocklen) {
2607 kfree(cop);
2608 kfree(jc);
2609 DEBUG_API(printk("cryptocop_ioctl_process: cipher inlength not multiple of block length.\n"));
2610 return -EINVAL;
2611 }
2612 cipher_outlen = oper.cipher_len;
2613 if (tc->init.cipher_mode == cryptocop_cipher_mode_cbc){
2614 if (oper.cipher_explicit) {
2615 ciph_tcfg.flags |= CRYPTOCOP_EXPLICIT_IV;
2616 memcpy(ciph_tcfg.iv, oper.cipher_iv, cblocklen);
2617 } else {
2618 cipher_outlen = oper.cipher_len - cblocklen;
2619 }
2620 } else {
2621 if (oper.cipher_explicit){
2622 kfree(cop);
2623 kfree(jc);
2624 DEBUG_API(printk("cryptocop_ioctl_process: explicit_iv when not CBC mode\n"));
2625 return -EINVAL;
2626 }
2627 }
2628 if (oper.cipher_outlen != cipher_outlen) {
2629 kfree(cop);
2630 kfree(jc);
2631 DEBUG_API(printk("cryptocop_ioctl_process: cipher_outlen incorrect, should be %d not %d.\n", cipher_outlen, oper.cipher_outlen));
2632 return -EINVAL;
2633 }
2634
2635 if (oper.decrypt){
2636 ciph_tcfg.flags |= CRYPTOCOP_DECRYPT;
2637 } else {
2638 ciph_tcfg.flags |= CRYPTOCOP_ENCRYPT;
2639 }
2640 ciph_tcfg.next = cop->tfrm_op.tfrm_cfg;
2641 cop->tfrm_op.tfrm_cfg = &ciph_tcfg;
2642 }
2643 if (oper.do_digest){
2644 struct cryptocop_transform_ctx *tc = get_transform_ctx(sess, CRYPTOCOP_IOCTL_DIGEST_TID);
2645 if (!tc) {
2646 DEBUG_API(printk("cryptocop_ioctl_process: no digest transform in session.\n"));
2647 err = -EINVAL;
2648 goto error_cleanup;
2649 }
2650 digest_length = tc->init.alg == cryptocop_alg_md5 ? 16 : 20;
2651 digest_result = kmalloc(digest_length, GFP_KERNEL);
2652 if (!digest_result) {
2653 DEBUG_API(printk("cryptocop_ioctl_process: kmalloc digest_result\n"));
2654 err = -EINVAL;
2655 goto error_cleanup;
2656 }
2657 DEBUG(memset(digest_result, 0xff, digest_length));
2658
2659 digest_tcfg.tid = CRYPTOCOP_IOCTL_DIGEST_TID;
2660 digest_tcfg.inject_ix = 0;
2661 ciph_tcfg.inject_ix += digest_length;
2662 if ((oper.digest_start < 0) || (oper.digest_len <= 0) || (oper.digest_start > oper.inlen) || ((oper.digest_start + oper.digest_len) > oper.inlen)){
2663 DEBUG_API(printk("cryptocop_ioctl_process: bad digest length\n"));
2664 err = -EINVAL;
2665 goto error_cleanup;
2666 }
2667
2668 digest_tcfg.next = cop->tfrm_op.tfrm_cfg;
2669 cop->tfrm_op.tfrm_cfg = &digest_tcfg;
2670 }
2671 if (oper.do_csum){
2672 csum_tcfg.tid = CRYPTOCOP_IOCTL_CSUM_TID;
2673 csum_tcfg.inject_ix = digest_length;
2674 ciph_tcfg.inject_ix += 2;
2675
2676 if ((oper.csum_start < 0) || (oper.csum_len <= 0) || (oper.csum_start > oper.inlen) || ((oper.csum_start + oper.csum_len) > oper.inlen)){
2677 DEBUG_API(printk("cryptocop_ioctl_process: bad csum length\n"));
2678 kfree(cop);
2679 kfree(jc);
2680 return -EINVAL;
2681 }
2682
2683 csum_tcfg.next = cop->tfrm_op.tfrm_cfg;
2684 cop->tfrm_op.tfrm_cfg = &csum_tcfg;
2685 }
2686
2687 prev_ix = first_cfg_change_ix(&oper);
2688 if (prev_ix > oper.inlen) {
2689 DEBUG_API(printk("cryptocop_ioctl_process: length mismatch\n"));
2690 nooutpages = noinpages = 0;
2691 err = -EINVAL;
2692 goto error_cleanup;
2693 }
2694 DEBUG(printk("cryptocop_ioctl_process: inlen=%d, cipher_outlen=%d\n", oper.inlen, oper.cipher_outlen));
2695
2696 /* Map user pages for in and out data of the operation. */
2697 noinpages = (((unsigned long int)(oper.indata + prev_ix) & ~PAGE_MASK) + oper.inlen - 1 - prev_ix + ~PAGE_MASK) >> PAGE_SHIFT;
2698 DEBUG(printk("cryptocop_ioctl_process: noinpages=%d\n", noinpages));
2699 inpages = kmalloc(noinpages * sizeof(struct page*), GFP_KERNEL);
2700 if (!inpages){
2701 DEBUG_API(printk("cryptocop_ioctl_process: kmalloc inpages\n"));
2702 nooutpages = noinpages = 0;
2703 err = -ENOMEM;
2704 goto error_cleanup;
2705 }
2706 if (oper.do_cipher){
2707 nooutpages = (((unsigned long int)oper.cipher_outdata & ~PAGE_MASK) + oper.cipher_outlen - 1 + ~PAGE_MASK) >> PAGE_SHIFT;
2708 DEBUG(printk("cryptocop_ioctl_process: nooutpages=%d\n", nooutpages));
2709 outpages = kmalloc(nooutpages * sizeof(struct page*), GFP_KERNEL);
2710 if (!outpages){
2711 DEBUG_API(printk("cryptocop_ioctl_process: kmalloc outpages\n"));
2712 nooutpages = noinpages = 0;
2713 err = -ENOMEM;
2714 goto error_cleanup;
2715 }
2716 }
2717
2718 /* Acquire the mm page semaphore. */
2719 down_read(&current->mm->mmap_sem);
2720
2721 err = get_user_pages(current,
2722 current->mm,
2723 (unsigned long int)(oper.indata + prev_ix),
2724 noinpages,
2725 0, /* read access only for in data */
2726 0, /* no force */
2727 inpages,
2728 NULL);
2729
2730 if (err < 0) {
2731 up_read(&current->mm->mmap_sem);
2732 nooutpages = noinpages = 0;
2733 DEBUG_API(printk("cryptocop_ioctl_process: get_user_pages indata\n"));
2734 goto error_cleanup;
2735 }
2736 noinpages = err;
2737 if (oper.do_cipher){
2738 err = get_user_pages(current,
2739 current->mm,
2740 (unsigned long int)oper.cipher_outdata,
2741 nooutpages,
2742 1, /* write access for out data */
2743 0, /* no force */
2744 outpages,
2745 NULL);
2746 up_read(&current->mm->mmap_sem);
2747 if (err < 0) {
2748 nooutpages = 0;
2749 DEBUG_API(printk("cryptocop_ioctl_process: get_user_pages outdata\n"));
2750 goto error_cleanup;
2751 }
2752 nooutpages = err;
2753 } else {
2754 up_read(&current->mm->mmap_sem);
2755 }
2756
2757 /* Add 6 to nooutpages to make room for possibly inserted buffers for storing digest and
2758 * csum output and splits when units are (dis-)connected. */
2759 cop->tfrm_op.indata = kmalloc((noinpages) * sizeof(struct iovec), GFP_KERNEL);
2760 cop->tfrm_op.outdata = kmalloc((6 + nooutpages) * sizeof(struct iovec), GFP_KERNEL);
2761 if (!cop->tfrm_op.indata || !cop->tfrm_op.outdata) {
2762 DEBUG_API(printk("cryptocop_ioctl_process: kmalloc iovecs\n"));
2763 err = -ENOMEM;
2764 goto error_cleanup;
2765 }
2766
2767 cop->tfrm_op.inlen = oper.inlen - prev_ix;
2768 cop->tfrm_op.outlen = 0;
2769 if (oper.do_cipher) cop->tfrm_op.outlen += oper.cipher_outlen;
2770 if (oper.do_digest) cop->tfrm_op.outlen += digest_length;
2771 if (oper.do_csum) cop->tfrm_op.outlen += 2;
2772
2773 /* Setup the in iovecs. */
2774 cop->tfrm_op.incount = noinpages;
2775 if (noinpages > 1){
2776 size_t tmplen = cop->tfrm_op.inlen;
2777
2778 cop->tfrm_op.indata[0].iov_len = PAGE_SIZE - ((unsigned long int)(oper.indata + prev_ix) & ~PAGE_MASK);
2779 cop->tfrm_op.indata[0].iov_base = (unsigned char*)page_address(inpages[0]) + ((unsigned long int)(oper.indata + prev_ix) & ~PAGE_MASK);
2780 tmplen -= cop->tfrm_op.indata[0].iov_len;
2781 for (i = 1; i<noinpages; i++){
2782 cop->tfrm_op.indata[i].iov_len = tmplen < PAGE_SIZE ? tmplen : PAGE_SIZE;
2783 cop->tfrm_op.indata[i].iov_base = (unsigned char*)page_address(inpages[i]);
2784 tmplen -= PAGE_SIZE;
2785 }
2786 } else {
2787 cop->tfrm_op.indata[0].iov_len = oper.inlen - prev_ix;
2788 cop->tfrm_op.indata[0].iov_base = (unsigned char*)page_address(inpages[0]) + ((unsigned long int)(oper.indata + prev_ix) & ~PAGE_MASK);
2789 }
2790
2791 iovlen = nooutpages + 6;
2792 pageoffset = oper.do_cipher ? ((unsigned long int)oper.cipher_outdata & ~PAGE_MASK) : 0;
2793
2794 next_ix = next_cfg_change_ix(&oper, prev_ix);
2795 if (prev_ix == next_ix){
2796 DEBUG_API(printk("cryptocop_ioctl_process: length configuration broken.\n"));
2797 err = -EINVAL; /* This should be impossible barring bugs. */
2798 goto error_cleanup;
2799 }
2800 while (prev_ix != next_ix){
2801 end_digest = end_csum = cipher_active = digest_active = csum_active = 0;
2802 descs[desc_ix].cfg = NULL;
2803 descs[desc_ix].length = next_ix - prev_ix;
2804
2805 if (oper.do_cipher && (oper.cipher_start < next_ix) && (prev_ix < (oper.cipher_start + oper.cipher_len))) {
2806 dcfgs[dcfg_ix].tid = CRYPTOCOP_IOCTL_CIPHER_TID;
2807 dcfgs[dcfg_ix].src = cryptocop_source_dma;
2808 cipher_active = 1;
2809
2810 if (next_ix == (oper.cipher_start + oper.cipher_len)){
2811 cipher_done = 1;
2812 dcfgs[dcfg_ix].last = 1;
2813 } else {
2814 dcfgs[dcfg_ix].last = 0;
2815 }
2816 dcfgs[dcfg_ix].next = descs[desc_ix].cfg;
2817 descs[desc_ix].cfg = &dcfgs[dcfg_ix];
2818 ++dcfg_ix;
2819 }
2820 if (oper.do_digest && (oper.digest_start < next_ix) && (prev_ix < (oper.digest_start + oper.digest_len))) {
2821 digest_active = 1;
2822 dcfgs[dcfg_ix].tid = CRYPTOCOP_IOCTL_DIGEST_TID;
2823 dcfgs[dcfg_ix].src = cryptocop_source_dma;
2824 if (next_ix == (oper.digest_start + oper.digest_len)){
2825 assert(!digest_done);
2826 digest_done = 1;
2827 dcfgs[dcfg_ix].last = 1;
2828 } else {
2829 dcfgs[dcfg_ix].last = 0;
2830 }
2831 dcfgs[dcfg_ix].next = descs[desc_ix].cfg;
2832 descs[desc_ix].cfg = &dcfgs[dcfg_ix];
2833 ++dcfg_ix;
2834 }
2835 if (oper.do_csum && (oper.csum_start < next_ix) && (prev_ix < (oper.csum_start + oper.csum_len))){
2836 csum_active = 1;
2837 dcfgs[dcfg_ix].tid = CRYPTOCOP_IOCTL_CSUM_TID;
2838 dcfgs[dcfg_ix].src = cryptocop_source_dma;
2839 if (next_ix == (oper.csum_start + oper.csum_len)){
2840 csum_done = 1;
2841 dcfgs[dcfg_ix].last = 1;
2842 } else {
2843 dcfgs[dcfg_ix].last = 0;
2844 }
2845 dcfgs[dcfg_ix].next = descs[desc_ix].cfg;
2846 descs[desc_ix].cfg = &dcfgs[dcfg_ix];
2847 ++dcfg_ix;
2848 }
2849 if (!descs[desc_ix].cfg){
2850 DEBUG_API(printk("cryptocop_ioctl_process: data segment %d (%d to %d) had no active transforms\n", desc_ix, prev_ix, next_ix));
2851 err = -EINVAL;
2852 goto error_cleanup;
2853 }
2854 descs[desc_ix].next = &(descs[desc_ix]) + 1;
2855 ++desc_ix;
2856 prev_ix = next_ix;
2857 next_ix = next_cfg_change_ix(&oper, prev_ix);
2858 }
2859 if (desc_ix > 0){
2860 descs[desc_ix-1].next = NULL;
2861 } else {
2862 descs[0].next = NULL;
2863 }
2864 if (oper.do_digest) {
2865 DEBUG(printk("cryptocop_ioctl_process: mapping %d byte digest output to iovec %d\n", digest_length, iovix));
2866 /* Add outdata iovec, length == <length of type of digest> */
2867 cop->tfrm_op.outdata[iovix].iov_base = digest_result;
2868 cop->tfrm_op.outdata[iovix].iov_len = digest_length;
2869 ++iovix;
2870 }
2871 if (oper.do_csum) {
2872 /* Add outdata iovec, length == 2, the length of csum. */
2873 DEBUG(printk("cryptocop_ioctl_process: mapping 2 byte csum output to iovec %d\n", iovix));
2874 /* Add outdata iovec, length == <length of type of digest> */
2875 cop->tfrm_op.outdata[iovix].iov_base = csum_result;
2876 cop->tfrm_op.outdata[iovix].iov_len = 2;
2877 ++iovix;
2878 }
2879 if (oper.do_cipher) {
2880 if (!map_pages_to_iovec(cop->tfrm_op.outdata, iovlen, &iovix, outpages, nooutpages, &pageix, &pageoffset, oper.cipher_outlen)){
2881 DEBUG_API(printk("cryptocop_ioctl_process: failed to map pages to iovec.\n"));
2882 err = -ENOSYS; /* This should be impossible barring bugs. */
2883 goto error_cleanup;
2884 }
2885 }
2886 DEBUG(printk("cryptocop_ioctl_process: setting cop->tfrm_op.outcount %d\n", iovix));
2887 cop->tfrm_op.outcount = iovix;
2888 assert(iovix <= (nooutpages + 6));
2889
2890 cop->sid = oper.ses_id;
2891 cop->tfrm_op.desc = &descs[0];
2892
2893 DEBUG(printk("cryptocop_ioctl_process: inserting job, cb_data=0x%p\n", cop->cb_data));
2894
2895 if ((err = cryptocop_job_queue_insert_user_job(cop)) != 0) {
2896 DEBUG_API(printk("cryptocop_ioctl_process: insert job %d\n", err));
2897 err = -EINVAL;
2898 goto error_cleanup;
2899 }
2900
2901 DEBUG(printk("cryptocop_ioctl_process: begin wait for result\n"));
2902
2903 wait_event(cryptocop_ioc_process_wq, (jc->processed != 0));
2904 DEBUG(printk("cryptocop_ioctl_process: end wait for result\n"));
2905 if (!jc->processed){
2906 printk(KERN_WARNING "cryptocop_ioctl_process: job not processed at completion\n");
2907 err = -EIO;
2908 goto error_cleanup;
2909 }
2910
2911 /* Job process done. Cipher output should already be correct in job so no post processing of outdata. */
2912 DEBUG(printk("cryptocop_ioctl_process: operation_status = %d\n", cop->operation_status));
2913 if (cop->operation_status == 0){
2914 if (oper.do_digest){
2915 DEBUG(printk("cryptocop_ioctl_process: copy %d bytes digest to user\n", digest_length));
2916 err = copy_to_user((unsigned char*)crp_oper + offsetof(struct strcop_crypto_op, digest), digest_result, digest_length);
2917 if (0 != err){
2918 DEBUG_API(printk("cryptocop_ioctl_process: copy_to_user, digest length %d, err %d\n", digest_length, err));
2919 err = -EFAULT;
2920 goto error_cleanup;
2921 }
2922 }
2923 if (oper.do_csum){
2924 DEBUG(printk("cryptocop_ioctl_process: copy 2 bytes checksum to user\n"));
2925 err = copy_to_user((unsigned char*)crp_oper + offsetof(struct strcop_crypto_op, csum), csum_result, 2);
2926 if (0 != err){
2927 DEBUG_API(printk("cryptocop_ioctl_process: copy_to_user, csum, err %d\n", err));
2928 err = -EFAULT;
2929 goto error_cleanup;
2930 }
2931 }
2932 err = 0;
2933 } else {
2934 DEBUG(printk("cryptocop_ioctl_process: returning err = operation_status = %d\n", cop->operation_status));
2935 err = cop->operation_status;
2936 }
2937
2938 error_cleanup:
2939 /* Release page caches. */
2940 for (i = 0; i < noinpages; i++){
2941 put_page(inpages[i]);
2942 }
2943 for (i = 0; i < nooutpages; i++){
2944 int spdl_err;
2945 /* Mark output pages dirty. */
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));
2948 }
2949 for (i = 0; i < nooutpages; i++){
2950 put_page(outpages[i]);
2951 }
2952
2953 if (digest_result) kfree(digest_result);
2954 if (inpages) kfree(inpages);
2955 if (outpages) kfree(outpages);
2956 if (cop){
2957 if (cop->tfrm_op.indata) kfree(cop->tfrm_op.indata);
2958 if (cop->tfrm_op.outdata) kfree(cop->tfrm_op.outdata);
2959 kfree(cop);
2960 }
2961 if (jc) kfree(jc);
2962
2963 DEBUG(print_lock_status());
2964
2965 return err;
2966}
2967
2968
2969static int cryptocop_ioctl_create_session(struct inode *inode, struct file *filp, unsigned int cmd, unsigned long arg)
2970{
2971 cryptocop_session_id sid;
2972 int err;
2973 struct cryptocop_private *dev;
2974 struct strcop_session_op *sess_op = (struct strcop_session_op *)arg;
2975 struct strcop_session_op sop;
2976 struct cryptocop_transform_init *tis = NULL;
2977 struct cryptocop_transform_init ti_cipher = {0};
2978 struct cryptocop_transform_init ti_digest = {0};
2979 struct cryptocop_transform_init ti_csum = {0};
2980
2981 if (!access_ok(VERIFY_WRITE, sess_op, sizeof(struct strcop_session_op)))
2982 return -EFAULT;
2983 err = copy_from_user(&sop, sess_op, sizeof(struct strcop_session_op));
2984 if (err) return -EFAULT;
2985 if (sop.cipher != cryptocop_cipher_none) {
2986 if (!access_ok(VERIFY_READ, sop.key, sop.keylen)) return -EFAULT;
2987 }
2988 DEBUG(printk("cryptocop_ioctl_create_session, sess_op:\n"));
2989
2990 DEBUG(printk("\tcipher:%d\n"
2991 "\tcipher_mode:%d\n"
2992 "\tdigest:%d\n"
2993 "\tcsum:%d\n",
2994 (int)sop.cipher,
2995 (int)sop.cmode,
2996 (int)sop.digest,
2997 (int)sop.csum));
2998
2999 if (sop.cipher != cryptocop_cipher_none){
3000 /* Init the cipher. */
3001 switch (sop.cipher){
3002 case cryptocop_cipher_des:
3003 ti_cipher.alg = cryptocop_alg_des;
3004 break;
3005 case cryptocop_cipher_3des:
3006 ti_cipher.alg = cryptocop_alg_3des;
3007 break;
3008 case cryptocop_cipher_aes:
3009 ti_cipher.alg = cryptocop_alg_aes;
3010 break;
3011 default:
3012 DEBUG_API(printk("create session, bad cipher algorithm %d\n", sop.cipher));
3013 return -EINVAL;
3014 };
3015 DEBUG(printk("setting cipher transform %d\n", ti_cipher.alg));
3016 copy_from_user(ti_cipher.key, sop.key, sop.keylen/8);
3017 ti_cipher.keylen = sop.keylen;
3018 switch (sop.cmode){
3019 case cryptocop_cipher_mode_cbc:
3020 case cryptocop_cipher_mode_ecb:
3021 ti_cipher.cipher_mode = sop.cmode;
3022 break;
3023 default:
3024 DEBUG_API(printk("create session, bad cipher mode %d\n", sop.cmode));
3025 return -EINVAL;
3026 }
3027 DEBUG(printk("cryptocop_ioctl_create_session: setting CBC mode %d\n", ti_cipher.cipher_mode));
3028 switch (sop.des3_mode){
3029 case cryptocop_3des_eee:
3030 case cryptocop_3des_eed:
3031 case cryptocop_3des_ede:
3032 case cryptocop_3des_edd:
3033 case cryptocop_3des_dee:
3034 case cryptocop_3des_ded:
3035 case cryptocop_3des_dde:
3036 case cryptocop_3des_ddd:
3037 ti_cipher.tdes_mode = sop.des3_mode;
3038 break;
3039 default:
3040 DEBUG_API(printk("create session, bad 3DES mode %d\n", sop.des3_mode));
3041 return -EINVAL;
3042 }
3043 ti_cipher.tid = CRYPTOCOP_IOCTL_CIPHER_TID;
3044 ti_cipher.next = tis;
3045 tis = &ti_cipher;
3046 } /* if (sop.cipher != cryptocop_cipher_none) */
3047 if (sop.digest != cryptocop_digest_none){
3048 DEBUG(printk("setting digest transform\n"));
3049 switch (sop.digest){
3050 case cryptocop_digest_md5:
3051 ti_digest.alg = cryptocop_alg_md5;
3052 break;
3053 case cryptocop_digest_sha1:
3054 ti_digest.alg = cryptocop_alg_sha1;
3055 break;
3056 default:
3057 DEBUG_API(printk("create session, bad digest algorithm %d\n", sop.digest));
3058 return -EINVAL;
3059 }
3060 ti_digest.tid = CRYPTOCOP_IOCTL_DIGEST_TID;
3061 ti_digest.next = tis;
3062 tis = &ti_digest;
3063 } /* if (sop.digest != cryptocop_digest_none) */
3064 if (sop.csum != cryptocop_csum_none){
3065 DEBUG(printk("setting csum transform\n"));
3066 switch (sop.csum){
3067 case cryptocop_csum_le:
3068 case cryptocop_csum_be:
3069 ti_csum.csum_mode = sop.csum;
3070 break;
3071 default:
3072 DEBUG_API(printk("create session, bad checksum algorithm %d\n", sop.csum));
3073 return -EINVAL;
3074 }
3075 ti_csum.alg = cryptocop_alg_csum;
3076 ti_csum.tid = CRYPTOCOP_IOCTL_CSUM_TID;
3077 ti_csum.next = tis;
3078 tis = &ti_csum;
3079 } /* (sop.csum != cryptocop_csum_none) */
3080 dev = kmalloc(sizeof(struct cryptocop_private), GFP_KERNEL);
3081 if (!dev){
3082 DEBUG_API(printk("create session, alloc dev\n"));
3083 return -ENOMEM;
3084 }
3085
3086 err = cryptocop_new_session(&sid, tis, GFP_KERNEL);
3087 DEBUG({ if (err) printk("create session, cryptocop_new_session %d\n", err);});
3088
3089 if (err) {
3090 kfree(dev);
3091 return err;
3092 }
3093 sess_op->ses_id = sid;
3094 dev->sid = sid;
3095 dev->next = filp->private_data;
3096 filp->private_data = dev;
3097
3098 return 0;
3099}
3100
3101static int cryptocop_ioctl(struct inode *inode, struct file *filp, unsigned int cmd, unsigned long arg)
3102{
3103 int err = 0;
3104 if (_IOC_TYPE(cmd) != ETRAXCRYPTOCOP_IOCTYPE) {
3105 DEBUG_API(printk("cryptocop_ioctl: wrong type\n"));
3106 return -ENOTTY;
3107 }
3108 if (_IOC_NR(cmd) > CRYPTOCOP_IO_MAXNR){
3109 return -ENOTTY;
3110 }
3111 /* Access check of the argument. Some commands, e.g. create session and process op,
3112 needs additional checks. Those are handled in the command handling functions. */
3113 if (_IOC_DIR(cmd) & _IOC_READ)
3114 err = !access_ok(VERIFY_WRITE, (void *)arg, _IOC_SIZE(cmd));
3115 else if (_IOC_DIR(cmd) & _IOC_WRITE)
3116 err = !access_ok(VERIFY_READ, (void *)arg, _IOC_SIZE(cmd));
3117 if (err) return -EFAULT;
3118
3119 switch (cmd) {
3120 case CRYPTOCOP_IO_CREATE_SESSION:
3121 return cryptocop_ioctl_create_session(inode, filp, cmd, arg);
3122 case CRYPTOCOP_IO_CLOSE_SESSION:
3123 return cryptocop_ioctl_close_session(inode, filp, cmd, arg);
3124 case CRYPTOCOP_IO_PROCESS_OP:
3125 return cryptocop_ioctl_process(inode, filp, cmd, arg);
3126 default:
3127 DEBUG_API(printk("cryptocop_ioctl: unknown command\n"));
3128 return -ENOTTY;
3129 }
3130 return 0;
3131}
3132
3133
3134#ifdef LDEBUG
3135static void print_dma_descriptors(struct cryptocop_int_operation *iop)
3136{
3137 struct cryptocop_dma_desc *cdesc_out = iop->cdesc_out;
3138 struct cryptocop_dma_desc *cdesc_in = iop->cdesc_in;
3139 int i;
3140
3141 printk("print_dma_descriptors start\n");
3142
3143 printk("iop:\n");
3144 printk("\tsid: 0x%lld\n", iop->sid);
3145
3146 printk("\tcdesc_out: 0x%p\n", iop->cdesc_out);
3147 printk("\tcdesc_in: 0x%p\n", iop->cdesc_in);
3148 printk("\tddesc_out: 0x%p\n", iop->ddesc_out);
3149 printk("\tddesc_in: 0x%p\n", iop->ddesc_in);
3150
3151 printk("\niop->ctx_out: 0x%p phys: 0x%p\n", &iop->ctx_out, (char*)virt_to_phys(&iop->ctx_out));
3152 printk("\tnext: 0x%p\n"
3153 "\tsaved_data: 0x%p\n"
3154 "\tsaved_data_buf: 0x%p\n",
3155 iop->ctx_out.next,
3156 iop->ctx_out.saved_data,
3157 iop->ctx_out.saved_data_buf);
3158
3159 printk("\niop->ctx_in: 0x%p phys: 0x%p\n", &iop->ctx_in, (char*)virt_to_phys(&iop->ctx_in));
3160 printk("\tnext: 0x%p\n"
3161 "\tsaved_data: 0x%p\n"
3162 "\tsaved_data_buf: 0x%p\n",
3163 iop->ctx_in.next,
3164 iop->ctx_in.saved_data,
3165 iop->ctx_in.saved_data_buf);
3166
3167 i = 0;
3168 while (cdesc_out) {
3169 dma_descr_data *td;
3170 printk("cdesc_out %d, desc=0x%p\n", i, cdesc_out->dma_descr);
3171 printk("\n\tvirt_to_phys(desc): 0x%p\n", (char*)virt_to_phys(cdesc_out->dma_descr));
3172 td = cdesc_out->dma_descr;
3173 printk("\n\tbuf: 0x%p\n"
3174 "\tafter: 0x%p\n"
3175 "\tmd: 0x%04x\n"
3176 "\tnext: 0x%p\n",
3177 td->buf,
3178 td->after,
3179 td->md,
3180 td->next);
3181 printk("flags:\n"
3182 "\twait:\t%d\n"
3183 "\teol:\t%d\n"
3184 "\touteop:\t%d\n"
3185 "\tineop:\t%d\n"
3186 "\tintr:\t%d\n",
3187 td->wait,
3188 td->eol,
3189 td->out_eop,
3190 td->in_eop,
3191 td->intr);
3192 cdesc_out = cdesc_out->next;
3193 i++;
3194 }
3195 i = 0;
3196 while (cdesc_in) {
3197 dma_descr_data *td;
3198 printk("cdesc_in %d, desc=0x%p\n", i, cdesc_in->dma_descr);
3199 printk("\n\tvirt_to_phys(desc): 0x%p\n", (char*)virt_to_phys(cdesc_in->dma_descr));
3200 td = cdesc_in->dma_descr;
3201 printk("\n\tbuf: 0x%p\n"
3202 "\tafter: 0x%p\n"
3203 "\tmd: 0x%04x\n"
3204 "\tnext: 0x%p\n",
3205 td->buf,
3206 td->after,
3207 td->md,
3208 td->next);
3209 printk("flags:\n"
3210 "\twait:\t%d\n"
3211 "\teol:\t%d\n"
3212 "\touteop:\t%d\n"
3213 "\tineop:\t%d\n"
3214 "\tintr:\t%d\n",
3215 td->wait,
3216 td->eol,
3217 td->out_eop,
3218 td->in_eop,
3219 td->intr);
3220 cdesc_in = cdesc_in->next;
3221 i++;
3222 }
3223
3224 printk("print_dma_descriptors end\n");
3225}
3226
3227
3228static void print_strcop_crypto_op(struct strcop_crypto_op *cop)
3229{
3230 printk("print_strcop_crypto_op, 0x%p\n", cop);
3231
3232 /* Indata. */
3233 printk("indata=0x%p\n"
3234 "inlen=%d\n"
3235 "do_cipher=%d\n"
3236 "decrypt=%d\n"
3237 "cipher_explicit=%d\n"
3238 "cipher_start=%d\n"
3239 "cipher_len=%d\n"
3240 "outdata=0x%p\n"
3241 "outlen=%d\n",
3242 cop->indata,
3243 cop->inlen,
3244 cop->do_cipher,
3245 cop->decrypt,
3246 cop->cipher_explicit,
3247 cop->cipher_start,
3248 cop->cipher_len,
3249 cop->cipher_outdata,
3250 cop->cipher_outlen);
3251
3252 printk("do_digest=%d\n"
3253 "digest_start=%d\n"
3254 "digest_len=%d\n",
3255 cop->do_digest,
3256 cop->digest_start,
3257 cop->digest_len);
3258
3259 printk("do_csum=%d\n"
3260 "csum_start=%d\n"
3261 "csum_len=%d\n",
3262 cop->do_csum,
3263 cop->csum_start,
3264 cop->csum_len);
3265}
3266
3267static void print_cryptocop_operation(struct cryptocop_operation *cop)
3268{
3269 struct cryptocop_desc *d;
3270 struct cryptocop_tfrm_cfg *tc;
3271 struct cryptocop_desc_cfg *dc;
3272 int i;
3273
3274 printk("print_cryptocop_operation, cop=0x%p\n\n", cop);
3275 printk("sid: %lld\n", cop->sid);
3276 printk("operation_status=%d\n"
3277 "use_dmalists=%d\n"
3278 "in_interrupt=%d\n"
3279 "fast_callback=%d\n",
3280 cop->operation_status,
3281 cop->use_dmalists,
3282 cop->in_interrupt,
3283 cop->fast_callback);
3284
3285 if (cop->use_dmalists){
3286 print_user_dma_lists(&cop->list_op);
3287 } else {
3288 printk("cop->tfrm_op\n"
3289 "tfrm_cfg=0x%p\n"
3290 "desc=0x%p\n"
3291 "indata=0x%p\n"
3292 "incount=%d\n"
3293 "inlen=%d\n"
3294 "outdata=0x%p\n"
3295 "outcount=%d\n"
3296 "outlen=%d\n\n",
3297 cop->tfrm_op.tfrm_cfg,
3298 cop->tfrm_op.desc,
3299 cop->tfrm_op.indata,
3300 cop->tfrm_op.incount,
3301 cop->tfrm_op.inlen,
3302 cop->tfrm_op.outdata,
3303 cop->tfrm_op.outcount,
3304 cop->tfrm_op.outlen);
3305
3306 tc = cop->tfrm_op.tfrm_cfg;
3307 while (tc){
3308 printk("tfrm_cfg, 0x%p\n"
3309 "tid=%d\n"
3310 "flags=%d\n"
3311 "inject_ix=%d\n"
3312 "next=0x%p\n",
3313 tc,
3314 tc->tid,
3315 tc->flags,
3316 tc->inject_ix,
3317 tc->next);
3318 tc = tc->next;
3319 }
3320 d = cop->tfrm_op.desc;
3321 while (d){
3322 printk("\n======================desc, 0x%p\n"
3323 "length=%d\n"
3324 "cfg=0x%p\n"
3325 "next=0x%p\n",
3326 d,
3327 d->length,
3328 d->cfg,
3329 d->next);
3330 dc = d->cfg;
3331 while (dc){
3332 printk("=========desc_cfg, 0x%p\n"
3333 "tid=%d\n"
3334 "src=%d\n"
3335 "last=%d\n"
3336 "next=0x%p\n",
3337 dc,
3338 dc->tid,
3339 dc->src,
3340 dc->last,
3341 dc->next);
3342 dc = dc->next;
3343 }
3344 d = d->next;
3345 }
3346 printk("\n====iniov\n");
3347 for (i = 0; i < cop->tfrm_op.incount; i++){
3348 printk("indata[%d]\n"
3349 "base=0x%p\n"
3350 "len=%d\n",
3351 i,
3352 cop->tfrm_op.indata[i].iov_base,
3353 cop->tfrm_op.indata[i].iov_len);
3354 }
3355 printk("\n====outiov\n");
3356 for (i = 0; i < cop->tfrm_op.outcount; i++){
3357 printk("outdata[%d]\n"
3358 "base=0x%p\n"
3359 "len=%d\n",
3360 i,
3361 cop->tfrm_op.outdata[i].iov_base,
3362 cop->tfrm_op.outdata[i].iov_len);
3363 }
3364 }
3365 printk("------------end print_cryptocop_operation\n");
3366}
3367
3368
3369static void print_user_dma_lists(struct cryptocop_dma_list_operation *dma_op)
3370{
3371 dma_descr_data *dd;
3372 int i;
3373
3374 printk("print_user_dma_lists, dma_op=0x%p\n", dma_op);
3375
3376 printk("out_data_buf = 0x%p, phys_to_virt(out_data_buf) = 0x%p\n", dma_op->out_data_buf, phys_to_virt((unsigned long int)dma_op->out_data_buf));
3377 printk("in_data_buf = 0x%p, phys_to_virt(in_data_buf) = 0x%p\n", dma_op->in_data_buf, phys_to_virt((unsigned long int)dma_op->in_data_buf));
3378
3379 printk("##############outlist\n");
3380 dd = phys_to_virt((unsigned long int)dma_op->outlist);
3381 i = 0;
3382 while (dd != NULL) {
3383 printk("#%d phys_to_virt(desc) 0x%p\n", i, dd);
3384 printk("\n\tbuf: 0x%p\n"
3385 "\tafter: 0x%p\n"
3386 "\tmd: 0x%04x\n"
3387 "\tnext: 0x%p\n",
3388 dd->buf,
3389 dd->after,
3390 dd->md,
3391 dd->next);
3392 printk("flags:\n"
3393 "\twait:\t%d\n"
3394 "\teol:\t%d\n"
3395 "\touteop:\t%d\n"
3396 "\tineop:\t%d\n"
3397 "\tintr:\t%d\n",
3398 dd->wait,
3399 dd->eol,
3400 dd->out_eop,
3401 dd->in_eop,
3402 dd->intr);
3403 if (dd->eol)
3404 dd = NULL;
3405 else
3406 dd = phys_to_virt((unsigned long int)dd->next);
3407 ++i;
3408 }
3409
3410 printk("##############inlist\n");
3411 dd = phys_to_virt((unsigned long int)dma_op->inlist);
3412 i = 0;
3413 while (dd != NULL) {
3414 printk("#%d phys_to_virt(desc) 0x%p\n", i, dd);
3415 printk("\n\tbuf: 0x%p\n"
3416 "\tafter: 0x%p\n"
3417 "\tmd: 0x%04x\n"
3418 "\tnext: 0x%p\n",
3419 dd->buf,
3420 dd->after,
3421 dd->md,
3422 dd->next);
3423 printk("flags:\n"
3424 "\twait:\t%d\n"
3425 "\teol:\t%d\n"
3426 "\touteop:\t%d\n"
3427 "\tineop:\t%d\n"
3428 "\tintr:\t%d\n",
3429 dd->wait,
3430 dd->eol,
3431 dd->out_eop,
3432 dd->in_eop,
3433 dd->intr);
3434 if (dd->eol)
3435 dd = NULL;
3436 else
3437 dd = phys_to_virt((unsigned long int)dd->next);
3438 ++i;
3439 }
3440}
3441
3442
3443static void print_lock_status(void)
3444{
3445 printk("**********************print_lock_status\n");
3446 printk("cryptocop_completed_jobs_lock %d\n", spin_is_locked(&cryptocop_completed_jobs_lock));
3447 printk("cryptocop_job_queue_lock %d\n", spin_is_locked(&cryptocop_job_queue_lock));
3448 printk("descr_pool_lock %d\n", spin_is_locked(&descr_pool_lock));
3449 printk("cryptocop_sessions_lock %d\n", spin_is_locked(cryptocop_sessions_lock));
3450 printk("running_job_lock %d\n", spin_is_locked(running_job_lock));
3451 printk("cryptocop_process_lock %d\n", spin_is_locked(cryptocop_process_lock));
3452}
3453#endif /* LDEBUG */
3454
3455
3456static const char cryptocop_name[] = "ETRAX FS stream co-processor";
3457
3458static int init_stream_coprocessor(void)
3459{
3460 int err;
3461 int i;
3462 static int initialized = 0;
3463
3464 if (initialized)
3465 return 0;
3466
3467 initialized = 1;
3468
3469 printk("ETRAX FS stream co-processor driver v0.01, (c) 2003 Axis Communications AB\n");
3470
3471 err = register_chrdev(CRYPTOCOP_MAJOR, cryptocop_name, &cryptocop_fops);
3472 if (err < 0) {
3473 printk(KERN_ERR "stream co-processor: could not get major number.\n");
3474 return err;
3475 }
3476
3477 err = init_cryptocop();
3478 if (err) {
3479 (void)unregister_chrdev(CRYPTOCOP_MAJOR, cryptocop_name);
3480 return err;
3481 }
3482 err = cryptocop_job_queue_init();
3483 if (err) {
3484 release_cryptocop();
3485 (void)unregister_chrdev(CRYPTOCOP_MAJOR, cryptocop_name);
3486 return err;
3487 }
3488 /* Init the descriptor pool. */
3489 for (i = 0; i < CRYPTOCOP_DESCRIPTOR_POOL_SIZE - 1; i++) {
3490 descr_pool[i].from_pool = 1;
3491 descr_pool[i].next = &descr_pool[i + 1];
3492 }
3493 descr_pool[i].from_pool = 1;
3494 descr_pool[i].next = NULL;
3495 descr_pool_free_list = &descr_pool[0];
3496 descr_pool_no_free = CRYPTOCOP_DESCRIPTOR_POOL_SIZE;
3497
3498 spin_lock_init(&cryptocop_completed_jobs_lock);
3499 spin_lock_init(&cryptocop_job_queue_lock);
3500 spin_lock_init(&descr_pool_lock);
3501 spin_lock_init(&cryptocop_sessions_lock);
3502 spin_lock_init(&running_job_lock);
3503 spin_lock_init(&cryptocop_process_lock);
3504
3505 cryptocop_sessions = NULL;
3506 next_sid = 1;
3507
3508 cryptocop_running_job = NULL;
3509
3510 printk("stream co-processor: init done.\n");
3511 return 0;
3512}
3513
3514static void __exit exit_stream_coprocessor(void)
3515{
3516 release_cryptocop();
3517 cryptocop_job_queue_close();
3518}
3519
3520module_init(init_stream_coprocessor);
3521module_exit(exit_stream_coprocessor);
3522
diff --git a/arch/cris/arch-v32/drivers/gpio.c b/arch/cris/arch-v32/drivers/gpio.c
new file mode 100644
index 000000000000..a551237dcb5e
--- /dev/null
+++ b/arch/cris/arch-v32/drivers/gpio.c
@@ -0,0 +1,766 @@
1/* $Id: gpio.c,v 1.16 2005/06/19 17:06:49 starvik Exp $
2 *
3 * ETRAX CRISv32 general port I/O device
4 *
5 * Copyright (c) 1999, 2000, 2001, 2002, 2003 Axis Communications AB
6 *
7 * Authors: Bjorn Wesen (initial version)
8 * Ola Knutsson (LED handling)
9 * Johan Adolfsson (read/set directions, write, port G,
10 * port to ETRAX FS.
11 *
12 * $Log: gpio.c,v $
13 * Revision 1.16 2005/06/19 17:06:49 starvik
14 * Merge of Linux 2.6.12.
15 *
16 * Revision 1.15 2005/05/25 08:22:20 starvik
17 * Changed GPIO port order to fit packages/devices/axis-2.4.
18 *
19 * Revision 1.14 2005/04/24 18:35:08 starvik
20 * Updated with final register headers.
21 *
22 * Revision 1.13 2005/03/15 15:43:00 starvik
23 * dev_id needs to be supplied for shared IRQs.
24 *
25 * Revision 1.12 2005/03/10 17:12:00 starvik
26 * Protect alarm list with spinlock.
27 *
28 * Revision 1.11 2005/01/05 06:08:59 starvik
29 * No need to do local_irq_disable after local_irq_save.
30 *
31 * Revision 1.10 2004/11/19 08:38:31 starvik
32 * Removed old crap.
33 *
34 * Revision 1.9 2004/05/14 07:58:02 starvik
35 * Merge of changes from 2.4
36 *
37 * Revision 1.8 2003/09/11 07:29:50 starvik
38 * Merge of Linux 2.6.0-test5
39 *
40 * Revision 1.7 2003/07/10 13:25:46 starvik
41 * Compiles for 2.5.74
42 * Lindented ethernet.c
43 *
44 * Revision 1.6 2003/07/04 08:27:46 starvik
45 * Merge of Linux 2.5.74
46 *
47 * Revision 1.5 2003/06/10 08:26:37 johana
48 * Etrax -> ETRAX CRISv32
49 *
50 * Revision 1.4 2003/06/05 14:22:48 johana
51 * Initialise some_alarms.
52 *
53 * Revision 1.3 2003/06/05 10:15:46 johana
54 * New INTR_VECT macros.
55 * Enable interrupts in global config.
56 *
57 * Revision 1.2 2003/06/03 15:52:50 johana
58 * Initial CRIS v32 version.
59 *
60 * Revision 1.1 2003/06/03 08:53:15 johana
61 * Copy of os/lx25/arch/cris/arch-v10/drivers/gpio.c version 1.7.
62 *
63 */
64
65#include <linux/config.h>
66
67#include <linux/module.h>
68#include <linux/sched.h>
69#include <linux/slab.h>
70#include <linux/ioport.h>
71#include <linux/errno.h>
72#include <linux/kernel.h>
73#include <linux/fs.h>
74#include <linux/string.h>
75#include <linux/poll.h>
76#include <linux/init.h>
77#include <linux/interrupt.h>
78#include <linux/spinlock.h>
79
80#include <asm/etraxgpio.h>
81#include <asm/arch/hwregs/reg_map.h>
82#include <asm/arch/hwregs/reg_rdwr.h>
83#include <asm/arch/hwregs/gio_defs.h>
84#include <asm/arch/hwregs/intr_vect_defs.h>
85#include <asm/io.h>
86#include <asm/system.h>
87#include <asm/irq.h>
88
89/* The following gio ports on ETRAX FS is available:
90 * pa 8 bits, supports interrupts off, hi, low, set, posedge, negedge anyedge
91 * pb 18 bits
92 * pc 18 bits
93 * pd 18 bits
94 * pe 18 bits
95 * each port has a rw_px_dout, r_px_din and rw_px_oe register.
96 */
97
98#define GPIO_MAJOR 120 /* experimental MAJOR number */
99
100#define D(x)
101
102#if 0
103static int dp_cnt;
104#define DP(x) do { dp_cnt++; if (dp_cnt % 1000 == 0) x; }while(0)
105#else
106#define DP(x)
107#endif
108
109static char gpio_name[] = "etrax gpio";
110
111#if 0
112static wait_queue_head_t *gpio_wq;
113#endif
114
115static int gpio_ioctl(struct inode *inode, struct file *file,
116 unsigned int cmd, unsigned long arg);
117static ssize_t gpio_write(struct file * file, const char * buf, size_t count,
118 loff_t *off);
119static int gpio_open(struct inode *inode, struct file *filp);
120static int gpio_release(struct inode *inode, struct file *filp);
121static unsigned int gpio_poll(struct file *filp, struct poll_table_struct *wait);
122
123/* private data per open() of this driver */
124
125struct gpio_private {
126 struct gpio_private *next;
127 /* The IO_CFG_WRITE_MODE_VALUE only support 8 bits: */
128 unsigned char clk_mask;
129 unsigned char data_mask;
130 unsigned char write_msb;
131 unsigned char pad1;
132 /* These fields are generic */
133 unsigned long highalarm, lowalarm;
134 wait_queue_head_t alarm_wq;
135 int minor;
136};
137
138/* linked list of alarms to check for */
139
140static struct gpio_private *alarmlist = 0;
141
142static int gpio_some_alarms = 0; /* Set if someone uses alarm */
143static unsigned long gpio_pa_high_alarms = 0;
144static unsigned long gpio_pa_low_alarms = 0;
145
146static DEFINE_SPINLOCK(alarm_lock);
147
148#define NUM_PORTS (GPIO_MINOR_LAST+1)
149#define GIO_REG_RD_ADDR(reg) (volatile unsigned long*) (regi_gio + REG_RD_ADDR_gio_##reg )
150#define GIO_REG_WR_ADDR(reg) (volatile unsigned long*) (regi_gio + REG_RD_ADDR_gio_##reg )
151unsigned long led_dummy;
152
153static volatile unsigned long *data_out[NUM_PORTS] = {
154 GIO_REG_WR_ADDR(rw_pa_dout),
155 GIO_REG_WR_ADDR(rw_pb_dout),
156 &led_dummy,
157 GIO_REG_WR_ADDR(rw_pc_dout),
158 GIO_REG_WR_ADDR(rw_pd_dout),
159 GIO_REG_WR_ADDR(rw_pe_dout),
160};
161
162static volatile unsigned long *data_in[NUM_PORTS] = {
163 GIO_REG_RD_ADDR(r_pa_din),
164 GIO_REG_RD_ADDR(r_pb_din),
165 &led_dummy,
166 GIO_REG_RD_ADDR(r_pc_din),
167 GIO_REG_RD_ADDR(r_pd_din),
168 GIO_REG_RD_ADDR(r_pe_din),
169};
170
171static unsigned long changeable_dir[NUM_PORTS] = {
172 CONFIG_ETRAX_PA_CHANGEABLE_DIR,
173 CONFIG_ETRAX_PB_CHANGEABLE_DIR,
174 0,
175 CONFIG_ETRAX_PC_CHANGEABLE_DIR,
176 CONFIG_ETRAX_PD_CHANGEABLE_DIR,
177 CONFIG_ETRAX_PE_CHANGEABLE_DIR,
178};
179
180static unsigned long changeable_bits[NUM_PORTS] = {
181 CONFIG_ETRAX_PA_CHANGEABLE_BITS,
182 CONFIG_ETRAX_PB_CHANGEABLE_BITS,
183 0,
184 CONFIG_ETRAX_PC_CHANGEABLE_BITS,
185 CONFIG_ETRAX_PD_CHANGEABLE_BITS,
186 CONFIG_ETRAX_PE_CHANGEABLE_BITS,
187};
188
189static volatile unsigned long *dir_oe[NUM_PORTS] = {
190 GIO_REG_WR_ADDR(rw_pa_oe),
191 GIO_REG_WR_ADDR(rw_pb_oe),
192 &led_dummy,
193 GIO_REG_WR_ADDR(rw_pc_oe),
194 GIO_REG_WR_ADDR(rw_pd_oe),
195 GIO_REG_WR_ADDR(rw_pe_oe),
196};
197
198
199
200static unsigned int
201gpio_poll(struct file *file,
202 poll_table *wait)
203{
204 unsigned int mask = 0;
205 struct gpio_private *priv = (struct gpio_private *)file->private_data;
206 unsigned long data;
207 poll_wait(file, &priv->alarm_wq, wait);
208 if (priv->minor == GPIO_MINOR_A) {
209 reg_gio_rw_intr_cfg intr_cfg;
210 unsigned long tmp;
211 unsigned long flags;
212
213 local_irq_save(flags);
214 data = REG_TYPE_CONV(unsigned long, reg_gio_r_pa_din, REG_RD(gio, regi_gio, r_pa_din));
215 /* PA has support for interrupt
216 * lets activate high for those low and with highalarm set
217 */
218 intr_cfg = REG_RD(gio, regi_gio, rw_intr_cfg);
219
220 tmp = ~data & priv->highalarm & 0xFF;
221 if (tmp & (1 << 0)) {
222 intr_cfg.pa0 = regk_gio_hi;
223 }
224 if (tmp & (1 << 1)) {
225 intr_cfg.pa1 = regk_gio_hi;
226 }
227 if (tmp & (1 << 2)) {
228 intr_cfg.pa2 = regk_gio_hi;
229 }
230 if (tmp & (1 << 3)) {
231 intr_cfg.pa3 = regk_gio_hi;
232 }
233 if (tmp & (1 << 4)) {
234 intr_cfg.pa4 = regk_gio_hi;
235 }
236 if (tmp & (1 << 5)) {
237 intr_cfg.pa5 = regk_gio_hi;
238 }
239 if (tmp & (1 << 6)) {
240 intr_cfg.pa6 = regk_gio_hi;
241 }
242 if (tmp & (1 << 7)) {
243 intr_cfg.pa7 = regk_gio_hi;
244 }
245 /*
246 * lets activate low for those high and with lowalarm set
247 */
248 tmp = data & priv->lowalarm & 0xFF;
249 if (tmp & (1 << 0)) {
250 intr_cfg.pa0 = regk_gio_lo;
251 }
252 if (tmp & (1 << 1)) {
253 intr_cfg.pa1 = regk_gio_lo;
254 }
255 if (tmp & (1 << 2)) {
256 intr_cfg.pa2 = regk_gio_lo;
257 }
258 if (tmp & (1 << 3)) {
259 intr_cfg.pa3 = regk_gio_lo;
260 }
261 if (tmp & (1 << 4)) {
262 intr_cfg.pa4 = regk_gio_lo;
263 }
264 if (tmp & (1 << 5)) {
265 intr_cfg.pa5 = regk_gio_lo;
266 }
267 if (tmp & (1 << 6)) {
268 intr_cfg.pa6 = regk_gio_lo;
269 }
270 if (tmp & (1 << 7)) {
271 intr_cfg.pa7 = regk_gio_lo;
272 }
273
274 REG_WR(gio, regi_gio, rw_intr_cfg, intr_cfg);
275 local_irq_restore(flags);
276 } else if (priv->minor <= GPIO_MINOR_E)
277 data = *data_in[priv->minor];
278 else
279 return 0;
280
281 if ((data & priv->highalarm) ||
282 (~data & priv->lowalarm)) {
283 mask = POLLIN|POLLRDNORM;
284 }
285
286 DP(printk("gpio_poll ready: mask 0x%08X\n", mask));
287 return mask;
288}
289
290int etrax_gpio_wake_up_check(void)
291{
292 struct gpio_private *priv = alarmlist;
293 unsigned long data = 0;
294 int ret = 0;
295 while (priv) {
296 data = *data_in[priv->minor];
297 if ((data & priv->highalarm) ||
298 (~data & priv->lowalarm)) {
299 DP(printk("etrax_gpio_wake_up_check %i\n",priv->minor));
300 wake_up_interruptible(&priv->alarm_wq);
301 ret = 1;
302 }
303 priv = priv->next;
304 }
305 return ret;
306}
307
308static irqreturn_t
309gpio_poll_timer_interrupt(int irq, void *dev_id, struct pt_regs *regs)
310{
311 if (gpio_some_alarms) {
312 return IRQ_RETVAL(etrax_gpio_wake_up_check());
313 }
314 return IRQ_NONE;
315}
316
317static irqreturn_t
318gpio_pa_interrupt(int irq, void *dev_id, struct pt_regs *regs)
319{
320 reg_gio_rw_intr_mask intr_mask;
321 reg_gio_r_masked_intr masked_intr;
322 reg_gio_rw_ack_intr ack_intr;
323 unsigned long tmp;
324 unsigned long tmp2;
325
326 /* Find what PA interrupts are active */
327 masked_intr = REG_RD(gio, regi_gio, r_masked_intr);
328 tmp = REG_TYPE_CONV(unsigned long, reg_gio_r_masked_intr, masked_intr);
329
330 /* Find those that we have enabled */
331 spin_lock(&alarm_lock);
332 tmp &= (gpio_pa_high_alarms | gpio_pa_low_alarms);
333 spin_unlock(&alarm_lock);
334
335 /* Ack them */
336 ack_intr = REG_TYPE_CONV(reg_gio_rw_ack_intr, unsigned long, tmp);
337 REG_WR(gio, regi_gio, rw_ack_intr, ack_intr);
338
339 /* Disable those interrupts.. */
340 intr_mask = REG_RD(gio, regi_gio, rw_intr_mask);
341 tmp2 = REG_TYPE_CONV(unsigned long, reg_gio_rw_intr_mask, intr_mask);
342 tmp2 &= ~tmp;
343 intr_mask = REG_TYPE_CONV(reg_gio_rw_intr_mask, unsigned long, tmp2);
344 REG_WR(gio, regi_gio, rw_intr_mask, intr_mask);
345
346 if (gpio_some_alarms) {
347 return IRQ_RETVAL(etrax_gpio_wake_up_check());
348 }
349 return IRQ_NONE;
350}
351
352
353static ssize_t gpio_write(struct file * file, const char * buf, size_t count,
354 loff_t *off)
355{
356 struct gpio_private *priv = (struct gpio_private *)file->private_data;
357 unsigned char data, clk_mask, data_mask, write_msb;
358 unsigned long flags;
359 unsigned long shadow;
360 volatile unsigned long *port;
361 ssize_t retval = count;
362 /* Only bits 0-7 may be used for write operations but allow all
363 devices except leds... */
364 if (priv->minor == GPIO_MINOR_LEDS) {
365 return -EFAULT;
366 }
367
368 if (!access_ok(VERIFY_READ, buf, count)) {
369 return -EFAULT;
370 }
371 clk_mask = priv->clk_mask;
372 data_mask = priv->data_mask;
373 /* It must have been configured using the IO_CFG_WRITE_MODE */
374 /* Perhaps a better error code? */
375 if (clk_mask == 0 || data_mask == 0) {
376 return -EPERM;
377 }
378 write_msb = priv->write_msb;
379 D(printk("gpio_write: %lu to data 0x%02X clk 0x%02X msb: %i\n",count, data_mask, clk_mask, write_msb));
380 port = data_out[priv->minor];
381
382 while (count--) {
383 int i;
384 data = *buf++;
385 if (priv->write_msb) {
386 for (i = 7; i >= 0;i--) {
387 local_irq_save(flags);
388 shadow = *port;
389 *port = shadow &= ~clk_mask;
390 if (data & 1<<i)
391 *port = shadow |= data_mask;
392 else
393 *port = shadow &= ~data_mask;
394 /* For FPGA: min 5.0ns (DCC) before CCLK high */
395 *port = shadow |= clk_mask;
396 local_irq_restore(flags);
397 }
398 } else {
399 for (i = 0; i <= 7;i++) {
400 local_irq_save(flags);
401 shadow = *port;
402 *port = shadow &= ~clk_mask;
403 if (data & 1<<i)
404 *port = shadow |= data_mask;
405 else
406 *port = shadow &= ~data_mask;
407 /* For FPGA: min 5.0ns (DCC) before CCLK high */
408 *port = shadow |= clk_mask;
409 local_irq_restore(flags);
410 }
411 }
412 }
413 return retval;
414}
415
416
417
418static int
419gpio_open(struct inode *inode, struct file *filp)
420{
421 struct gpio_private *priv;
422 int p = MINOR(inode->i_rdev);
423
424 if (p > GPIO_MINOR_LAST)
425 return -EINVAL;
426
427 priv = (struct gpio_private *)kmalloc(sizeof(struct gpio_private),
428 GFP_KERNEL);
429
430 if (!priv)
431 return -ENOMEM;
432
433 priv->minor = p;
434
435 /* initialize the io/alarm struct and link it into our alarmlist */
436
437 priv->next = alarmlist;
438 alarmlist = priv;
439 priv->clk_mask = 0;
440 priv->data_mask = 0;
441 priv->highalarm = 0;
442 priv->lowalarm = 0;
443 init_waitqueue_head(&priv->alarm_wq);
444
445 filp->private_data = (void *)priv;
446
447 return 0;
448}
449
450static int
451gpio_release(struct inode *inode, struct file *filp)
452{
453 struct gpio_private *p = alarmlist;
454 struct gpio_private *todel = (struct gpio_private *)filp->private_data;
455 /* local copies while updating them: */
456 unsigned long a_high, a_low;
457 unsigned long some_alarms;
458
459 /* unlink from alarmlist and free the private structure */
460
461 if (p == todel) {
462 alarmlist = todel->next;
463 } else {
464 while (p->next != todel)
465 p = p->next;
466 p->next = todel->next;
467 }
468
469 kfree(todel);
470 /* Check if there are still any alarms set */
471 p = alarmlist;
472 some_alarms = 0;
473 a_high = 0;
474 a_low = 0;
475 while (p) {
476 if (p->minor == GPIO_MINOR_A) {
477 a_high |= p->highalarm;
478 a_low |= p->lowalarm;
479 }
480
481 if (p->highalarm | p->lowalarm) {
482 some_alarms = 1;
483 }
484 p = p->next;
485 }
486
487 spin_lock(&alarm_lock);
488 gpio_some_alarms = some_alarms;
489 gpio_pa_high_alarms = a_high;
490 gpio_pa_low_alarms = a_low;
491 spin_unlock(&alarm_lock);
492
493 return 0;
494}
495
496/* Main device API. ioctl's to read/set/clear bits, as well as to
497 * set alarms to wait for using a subsequent select().
498 */
499
500unsigned long inline setget_input(struct gpio_private *priv, unsigned long arg)
501{
502 /* Set direction 0=unchanged 1=input,
503 * return mask with 1=input
504 */
505 unsigned long flags;
506 unsigned long dir_shadow;
507
508 local_irq_save(flags);
509 dir_shadow = *dir_oe[priv->minor];
510 dir_shadow &= ~(arg & changeable_dir[priv->minor]);
511 *dir_oe[priv->minor] = dir_shadow;
512 local_irq_restore(flags);
513
514 if (priv->minor == GPIO_MINOR_A)
515 dir_shadow ^= 0xFF; /* Only 8 bits */
516 else
517 dir_shadow ^= 0x3FFFF; /* Only 18 bits */
518 return dir_shadow;
519
520} /* setget_input */
521
522unsigned long inline setget_output(struct gpio_private *priv, unsigned long arg)
523{
524 unsigned long flags;
525 unsigned long dir_shadow;
526
527 local_irq_save(flags);
528 dir_shadow = *dir_oe[priv->minor];
529 dir_shadow |= (arg & changeable_dir[priv->minor]);
530 *dir_oe[priv->minor] = dir_shadow;
531 local_irq_restore(flags);
532 return dir_shadow;
533} /* setget_output */
534
535static int
536gpio_leds_ioctl(unsigned int cmd, unsigned long arg);
537
538static int
539gpio_ioctl(struct inode *inode, struct file *file,
540 unsigned int cmd, unsigned long arg)
541{
542 unsigned long flags;
543 unsigned long val;
544 unsigned long shadow;
545 struct gpio_private *priv = (struct gpio_private *)file->private_data;
546 if (_IOC_TYPE(cmd) != ETRAXGPIO_IOCTYPE) {
547 return -EINVAL;
548 }
549
550 switch (_IOC_NR(cmd)) {
551 case IO_READBITS: /* Use IO_READ_INBITS and IO_READ_OUTBITS instead */
552 // read the port
553 return *data_in[priv->minor];
554 break;
555 case IO_SETBITS:
556 local_irq_save(flags);
557 if (arg & 0x04)
558 printk("GPIO SET 2\n");
559 // set changeable bits with a 1 in arg
560 shadow = *data_out[priv->minor];
561 shadow |= (arg & changeable_bits[priv->minor]);
562 *data_out[priv->minor] = shadow;
563 local_irq_restore(flags);
564 break;
565 case IO_CLRBITS:
566 local_irq_save(flags);
567 if (arg & 0x04)
568 printk("GPIO CLR 2\n");
569 // clear changeable bits with a 1 in arg
570 shadow = *data_out[priv->minor];
571 shadow &= ~(arg & changeable_bits[priv->minor]);
572 *data_out[priv->minor] = shadow;
573 local_irq_restore(flags);
574 break;
575 case IO_HIGHALARM:
576 // set alarm when bits with 1 in arg go high
577 priv->highalarm |= arg;
578 spin_lock(&alarm_lock);
579 gpio_some_alarms = 1;
580 if (priv->minor == GPIO_MINOR_A) {
581 gpio_pa_high_alarms |= arg;
582 }
583 spin_unlock(&alarm_lock);
584 break;
585 case IO_LOWALARM:
586 // set alarm when bits with 1 in arg go low
587 priv->lowalarm |= arg;
588 spin_lock(&alarm_lock);
589 gpio_some_alarms = 1;
590 if (priv->minor == GPIO_MINOR_A) {
591 gpio_pa_low_alarms |= arg;
592 }
593 spin_unlock(&alarm_lock);
594 break;
595 case IO_CLRALARM:
596 // clear alarm for bits with 1 in arg
597 priv->highalarm &= ~arg;
598 priv->lowalarm &= ~arg;
599 spin_lock(&alarm_lock);
600 if (priv->minor == GPIO_MINOR_A) {
601 if (gpio_pa_high_alarms & arg ||
602 gpio_pa_low_alarms & arg) {
603 /* Must update the gpio_pa_*alarms masks */
604 }
605 }
606 spin_unlock(&alarm_lock);
607 break;
608 case IO_READDIR: /* Use IO_SETGET_INPUT/OUTPUT instead! */
609 /* Read direction 0=input 1=output */
610 return *dir_oe[priv->minor];
611 case IO_SETINPUT: /* Use IO_SETGET_INPUT instead! */
612 /* Set direction 0=unchanged 1=input,
613 * return mask with 1=input
614 */
615 return setget_input(priv, arg);
616 break;
617 case IO_SETOUTPUT: /* Use IO_SETGET_OUTPUT instead! */
618 /* Set direction 0=unchanged 1=output,
619 * return mask with 1=output
620 */
621 return setget_output(priv, arg);
622
623 case IO_CFG_WRITE_MODE:
624 {
625 unsigned long dir_shadow;
626 dir_shadow = *dir_oe[priv->minor];
627
628 priv->clk_mask = arg & 0xFF;
629 priv->data_mask = (arg >> 8) & 0xFF;
630 priv->write_msb = (arg >> 16) & 0x01;
631 /* Check if we're allowed to change the bits and
632 * the direction is correct
633 */
634 if (!((priv->clk_mask & changeable_bits[priv->minor]) &&
635 (priv->data_mask & changeable_bits[priv->minor]) &&
636 (priv->clk_mask & dir_shadow) &&
637 (priv->data_mask & dir_shadow)))
638 {
639 priv->clk_mask = 0;
640 priv->data_mask = 0;
641 return -EPERM;
642 }
643 break;
644 }
645 case IO_READ_INBITS:
646 /* *arg is result of reading the input pins */
647 val = *data_in[priv->minor];
648 if (copy_to_user((unsigned long*)arg, &val, sizeof(val)))
649 return -EFAULT;
650 return 0;
651 break;
652 case IO_READ_OUTBITS:
653 /* *arg is result of reading the output shadow */
654 val = *data_out[priv->minor];
655 if (copy_to_user((unsigned long*)arg, &val, sizeof(val)))
656 return -EFAULT;
657 break;
658 case IO_SETGET_INPUT:
659 /* bits set in *arg is set to input,
660 * *arg updated with current input pins.
661 */
662 if (copy_from_user(&val, (unsigned long*)arg, sizeof(val)))
663 return -EFAULT;
664 val = setget_input(priv, val);
665 if (copy_to_user((unsigned long*)arg, &val, sizeof(val)))
666 return -EFAULT;
667 break;
668 case IO_SETGET_OUTPUT:
669 /* bits set in *arg is set to output,
670 * *arg updated with current output pins.
671 */
672 if (copy_from_user(&val, (unsigned long*)arg, sizeof(val)))
673 return -EFAULT;
674 val = setget_output(priv, val);
675 if (copy_to_user((unsigned long*)arg, &val, sizeof(val)))
676 return -EFAULT;
677 break;
678 default:
679 if (priv->minor == GPIO_MINOR_LEDS)
680 return gpio_leds_ioctl(cmd, arg);
681 else
682 return -EINVAL;
683 } /* switch */
684
685 return 0;
686}
687
688static int
689gpio_leds_ioctl(unsigned int cmd, unsigned long arg)
690{
691 unsigned char green;
692 unsigned char red;
693
694 switch (_IOC_NR(cmd)) {
695 case IO_LEDACTIVE_SET:
696 green = ((unsigned char) arg) & 1;
697 red = (((unsigned char) arg) >> 1) & 1;
698 LED_ACTIVE_SET_G(green);
699 LED_ACTIVE_SET_R(red);
700 break;
701
702 default:
703 return -EINVAL;
704 } /* switch */
705
706 return 0;
707}
708
709struct file_operations gpio_fops = {
710 .owner = THIS_MODULE,
711 .poll = gpio_poll,
712 .ioctl = gpio_ioctl,
713 .write = gpio_write,
714 .open = gpio_open,
715 .release = gpio_release,
716};
717
718
719/* main driver initialization routine, called from mem.c */
720
721static __init int
722gpio_init(void)
723{
724 int res;
725 reg_intr_vect_rw_mask intr_mask;
726
727 /* do the formalities */
728
729 res = register_chrdev(GPIO_MAJOR, gpio_name, &gpio_fops);
730 if (res < 0) {
731 printk(KERN_ERR "gpio: couldn't get a major number.\n");
732 return res;
733 }
734
735 /* Clear all leds */
736 LED_NETWORK_SET(0);
737 LED_ACTIVE_SET(0);
738 LED_DISK_READ(0);
739 LED_DISK_WRITE(0);
740
741 printk("ETRAX FS GPIO driver v2.5, (c) 2003-2005 Axis Communications AB\n");
742 /* We call etrax_gpio_wake_up_check() from timer interrupt and
743 * from cpu_idle() in kernel/process.c
744 * The check in cpu_idle() reduces latency from ~15 ms to ~6 ms
745 * in some tests.
746 */
747 if (request_irq(TIMER_INTR_VECT, gpio_poll_timer_interrupt,
748 SA_SHIRQ | SA_INTERRUPT,"gpio poll", &alarmlist)) {
749 printk("err: timer0 irq for gpio\n");
750 }
751 if (request_irq(GEN_IO_INTR_VECT, gpio_pa_interrupt,
752 SA_SHIRQ | SA_INTERRUPT,"gpio PA", &alarmlist)) {
753 printk("err: PA irq for gpio\n");
754 }
755 /* enable the gio and timer irq in global config */
756 intr_mask = REG_RD(intr_vect, regi_irq, rw_mask);
757 intr_mask.timer = 1;
758 intr_mask.gen_io = 1;
759 REG_WR(intr_vect, regi_irq, rw_mask, intr_mask);
760
761 return res;
762}
763
764/* this makes sure that gpio_init is called during kernel boot */
765
766module_init(gpio_init);
diff --git a/arch/cris/arch-v32/drivers/i2c.c b/arch/cris/arch-v32/drivers/i2c.c
new file mode 100644
index 000000000000..440c20a94963
--- /dev/null
+++ b/arch/cris/arch-v32/drivers/i2c.c
@@ -0,0 +1,611 @@
1/*!***************************************************************************
2*!
3*! FILE NAME : i2c.c
4*!
5*! DESCRIPTION: implements an interface for IIC/I2C, both directly from other
6*! kernel modules (i2c_writereg/readreg) and from userspace using
7*! ioctl()'s
8*!
9*! Nov 30 1998 Torbjorn Eliasson Initial version.
10*! Bjorn Wesen Elinux kernel version.
11*! Jan 14 2000 Johan Adolfsson Fixed PB shadow register stuff -
12*! don't use PB_I2C if DS1302 uses same bits,
13*! use PB.
14*| June 23 2003 Pieter Grimmerink Added 'i2c_sendnack'. i2c_readreg now
15*| generates nack on last received byte,
16*| instead of ack.
17*| i2c_getack changed data level while clock
18*| was high, causing DS75 to see a stop condition
19*!
20*! ---------------------------------------------------------------------------
21*!
22*! (C) Copyright 1999-2002 Axis Communications AB, LUND, SWEDEN
23*!
24*!***************************************************************************/
25/* $Id: i2c.c,v 1.2 2005/05/09 15:29:49 starvik Exp $ */
26/****************** INCLUDE FILES SECTION ***********************************/
27
28#include <linux/module.h>
29#include <linux/sched.h>
30#include <linux/slab.h>
31#include <linux/errno.h>
32#include <linux/kernel.h>
33#include <linux/fs.h>
34#include <linux/string.h>
35#include <linux/init.h>
36#include <linux/config.h>
37
38#include <asm/etraxi2c.h>
39
40#include <asm/system.h>
41#include <asm/io.h>
42#include <asm/delay.h>
43
44#include "i2c.h"
45
46/****************** I2C DEFINITION SECTION *************************/
47
48#define D(x)
49
50#define I2C_MAJOR 123 /* LOCAL/EXPERIMENTAL */
51static const char i2c_name[] = "i2c";
52
53#define CLOCK_LOW_TIME 8
54#define CLOCK_HIGH_TIME 8
55#define START_CONDITION_HOLD_TIME 8
56#define STOP_CONDITION_HOLD_TIME 8
57#define ENABLE_OUTPUT 0x01
58#define ENABLE_INPUT 0x00
59#define I2C_CLOCK_HIGH 1
60#define I2C_CLOCK_LOW 0
61#define I2C_DATA_HIGH 1
62#define I2C_DATA_LOW 0
63
64#define i2c_enable()
65#define i2c_disable()
66
67/* enable or disable output-enable, to select output or input on the i2c bus */
68
69#define i2c_dir_out() crisv32_io_set_dir(&cris_i2c_data, crisv32_io_dir_out)
70#define i2c_dir_in() crisv32_io_set_dir(&cris_i2c_data, crisv32_io_dir_in)
71
72/* control the i2c clock and data signals */
73
74#define i2c_clk(x) crisv32_io_set(&cris_i2c_clk, x)
75#define i2c_data(x) crisv32_io_set(&cris_i2c_data, x)
76
77/* read a bit from the i2c interface */
78
79#define i2c_getbit() crisv32_io_rd(&cris_i2c_data)
80
81#define i2c_delay(usecs) udelay(usecs)
82
83/****************** VARIABLE SECTION ************************************/
84
85static struct crisv32_iopin cris_i2c_clk;
86static struct crisv32_iopin cris_i2c_data;
87
88/****************** FUNCTION DEFINITION SECTION *************************/
89
90
91/* generate i2c start condition */
92
93void
94i2c_start(void)
95{
96 /*
97 * SCL=1 SDA=1
98 */
99 i2c_dir_out();
100 i2c_delay(CLOCK_HIGH_TIME/6);
101 i2c_data(I2C_DATA_HIGH);
102 i2c_clk(I2C_CLOCK_HIGH);
103 i2c_delay(CLOCK_HIGH_TIME);
104 /*
105 * SCL=1 SDA=0
106 */
107 i2c_data(I2C_DATA_LOW);
108 i2c_delay(START_CONDITION_HOLD_TIME);
109 /*
110 * SCL=0 SDA=0
111 */
112 i2c_clk(I2C_CLOCK_LOW);
113 i2c_delay(CLOCK_LOW_TIME);
114}
115
116/* generate i2c stop condition */
117
118void
119i2c_stop(void)
120{
121 i2c_dir_out();
122
123 /*
124 * SCL=0 SDA=0
125 */
126 i2c_clk(I2C_CLOCK_LOW);
127 i2c_data(I2C_DATA_LOW);
128 i2c_delay(CLOCK_LOW_TIME*2);
129 /*
130 * SCL=1 SDA=0
131 */
132 i2c_clk(I2C_CLOCK_HIGH);
133 i2c_delay(CLOCK_HIGH_TIME*2);
134 /*
135 * SCL=1 SDA=1
136 */
137 i2c_data(I2C_DATA_HIGH);
138 i2c_delay(STOP_CONDITION_HOLD_TIME);
139
140 i2c_dir_in();
141}
142
143/* write a byte to the i2c interface */
144
145void
146i2c_outbyte(unsigned char x)
147{
148 int i;
149
150 i2c_dir_out();
151
152 for (i = 0; i < 8; i++) {
153 if (x & 0x80) {
154 i2c_data(I2C_DATA_HIGH);
155 } else {
156 i2c_data(I2C_DATA_LOW);
157 }
158
159 i2c_delay(CLOCK_LOW_TIME/2);
160 i2c_clk(I2C_CLOCK_HIGH);
161 i2c_delay(CLOCK_HIGH_TIME);
162 i2c_clk(I2C_CLOCK_LOW);
163 i2c_delay(CLOCK_LOW_TIME/2);
164 x <<= 1;
165 }
166 i2c_data(I2C_DATA_LOW);
167 i2c_delay(CLOCK_LOW_TIME/2);
168
169 /*
170 * enable input
171 */
172 i2c_dir_in();
173}
174
175/* read a byte from the i2c interface */
176
177unsigned char
178i2c_inbyte(void)
179{
180 unsigned char aBitByte = 0;
181 int i;
182
183 /* Switch off I2C to get bit */
184 i2c_disable();
185 i2c_dir_in();
186 i2c_delay(CLOCK_HIGH_TIME/2);
187
188 /* Get bit */
189 aBitByte |= i2c_getbit();
190
191 /* Enable I2C */
192 i2c_enable();
193 i2c_delay(CLOCK_LOW_TIME/2);
194
195 for (i = 1; i < 8; i++) {
196 aBitByte <<= 1;
197 /* Clock pulse */
198 i2c_clk(I2C_CLOCK_HIGH);
199 i2c_delay(CLOCK_HIGH_TIME);
200 i2c_clk(I2C_CLOCK_LOW);
201 i2c_delay(CLOCK_LOW_TIME);
202
203 /* Switch off I2C to get bit */
204 i2c_disable();
205 i2c_dir_in();
206 i2c_delay(CLOCK_HIGH_TIME/2);
207
208 /* Get bit */
209 aBitByte |= i2c_getbit();
210
211 /* Enable I2C */
212 i2c_enable();
213 i2c_delay(CLOCK_LOW_TIME/2);
214 }
215 i2c_clk(I2C_CLOCK_HIGH);
216 i2c_delay(CLOCK_HIGH_TIME);
217
218 /*
219 * we leave the clock low, getbyte is usually followed
220 * by sendack/nack, they assume the clock to be low
221 */
222 i2c_clk(I2C_CLOCK_LOW);
223 return aBitByte;
224}
225
226/*#---------------------------------------------------------------------------
227*#
228*# FUNCTION NAME: i2c_getack
229*#
230*# DESCRIPTION : checks if ack was received from ic2
231*#
232*#--------------------------------------------------------------------------*/
233
234int
235i2c_getack(void)
236{
237 int ack = 1;
238 /*
239 * enable output
240 */
241 i2c_dir_out();
242 /*
243 * Release data bus by setting
244 * data high
245 */
246 i2c_data(I2C_DATA_HIGH);
247 /*
248 * enable input
249 */
250 i2c_dir_in();
251 i2c_delay(CLOCK_HIGH_TIME/4);
252 /*
253 * generate ACK clock pulse
254 */
255 i2c_clk(I2C_CLOCK_HIGH);
256 /*
257 * Use PORT PB instead of I2C
258 * for input. (I2C not working)
259 */
260 i2c_clk(1);
261 i2c_data(1);
262 /*
263 * switch off I2C
264 */
265 i2c_data(1);
266 i2c_disable();
267 i2c_dir_in();
268 /*
269 * now wait for ack
270 */
271 i2c_delay(CLOCK_HIGH_TIME/2);
272 /*
273 * check for ack
274 */
275 if(i2c_getbit())
276 ack = 0;
277 i2c_delay(CLOCK_HIGH_TIME/2);
278 if(!ack){
279 if(!i2c_getbit()) /* receiver pulld SDA low */
280 ack = 1;
281 i2c_delay(CLOCK_HIGH_TIME/2);
282 }
283
284 /*
285 * our clock is high now, make sure data is low
286 * before we enable our output. If we keep data high
287 * and enable output, we would generate a stop condition.
288 */
289 i2c_data(I2C_DATA_LOW);
290
291 /*
292 * end clock pulse
293 */
294 i2c_enable();
295 i2c_dir_out();
296 i2c_clk(I2C_CLOCK_LOW);
297 i2c_delay(CLOCK_HIGH_TIME/4);
298 /*
299 * enable output
300 */
301 i2c_dir_out();
302 /*
303 * remove ACK clock pulse
304 */
305 i2c_data(I2C_DATA_HIGH);
306 i2c_delay(CLOCK_LOW_TIME/2);
307 return ack;
308}
309
310/*#---------------------------------------------------------------------------
311*#
312*# FUNCTION NAME: I2C::sendAck
313*#
314*# DESCRIPTION : Send ACK on received data
315*#
316*#--------------------------------------------------------------------------*/
317void
318i2c_sendack(void)
319{
320 /*
321 * enable output
322 */
323 i2c_delay(CLOCK_LOW_TIME);
324 i2c_dir_out();
325 /*
326 * set ack pulse high
327 */
328 i2c_data(I2C_DATA_LOW);
329 /*
330 * generate clock pulse
331 */
332 i2c_delay(CLOCK_HIGH_TIME/6);
333 i2c_clk(I2C_CLOCK_HIGH);
334 i2c_delay(CLOCK_HIGH_TIME);
335 i2c_clk(I2C_CLOCK_LOW);
336 i2c_delay(CLOCK_LOW_TIME/6);
337 /*
338 * reset data out
339 */
340 i2c_data(I2C_DATA_HIGH);
341 i2c_delay(CLOCK_LOW_TIME);
342
343 i2c_dir_in();
344}
345
346/*#---------------------------------------------------------------------------
347*#
348*# FUNCTION NAME: i2c_sendnack
349*#
350*# DESCRIPTION : Sends NACK on received data
351*#
352*#--------------------------------------------------------------------------*/
353void
354i2c_sendnack(void)
355{
356 /*
357 * enable output
358 */
359 i2c_delay(CLOCK_LOW_TIME);
360 i2c_dir_out();
361 /*
362 * set data high
363 */
364 i2c_data(I2C_DATA_HIGH);
365 /*
366 * generate clock pulse
367 */
368 i2c_delay(CLOCK_HIGH_TIME/6);
369 i2c_clk(I2C_CLOCK_HIGH);
370 i2c_delay(CLOCK_HIGH_TIME);
371 i2c_clk(I2C_CLOCK_LOW);
372 i2c_delay(CLOCK_LOW_TIME);
373
374 i2c_dir_in();
375}
376
377/*#---------------------------------------------------------------------------
378*#
379*# FUNCTION NAME: i2c_writereg
380*#
381*# DESCRIPTION : Writes a value to an I2C device
382*#
383*#--------------------------------------------------------------------------*/
384int
385i2c_writereg(unsigned char theSlave, unsigned char theReg,
386 unsigned char theValue)
387{
388 int error, cntr = 3;
389 unsigned long flags;
390
391 do {
392 error = 0;
393 /*
394 * we don't like to be interrupted
395 */
396 local_irq_save(flags);
397
398 i2c_start();
399 /*
400 * send slave address
401 */
402 i2c_outbyte((theSlave & 0xfe));
403 /*
404 * wait for ack
405 */
406 if(!i2c_getack())
407 error = 1;
408 /*
409 * now select register
410 */
411 i2c_dir_out();
412 i2c_outbyte(theReg);
413 /*
414 * now it's time to wait for ack
415 */
416 if(!i2c_getack())
417 error |= 2;
418 /*
419 * send register register data
420 */
421 i2c_outbyte(theValue);
422 /*
423 * now it's time to wait for ack
424 */
425 if(!i2c_getack())
426 error |= 4;
427 /*
428 * end byte stream
429 */
430 i2c_stop();
431 /*
432 * enable interrupt again
433 */
434 local_irq_restore(flags);
435
436 } while(error && cntr--);
437
438 i2c_delay(CLOCK_LOW_TIME);
439
440 return -error;
441}
442
443/*#---------------------------------------------------------------------------
444*#
445*# FUNCTION NAME: i2c_readreg
446*#
447*# DESCRIPTION : Reads a value from the decoder registers.
448*#
449*#--------------------------------------------------------------------------*/
450unsigned char
451i2c_readreg(unsigned char theSlave, unsigned char theReg)
452{
453 unsigned char b = 0;
454 int error, cntr = 3;
455 unsigned long flags;
456
457 do {
458 error = 0;
459 /*
460 * we don't like to be interrupted
461 */
462 local_irq_save(flags);
463 /*
464 * generate start condition
465 */
466 i2c_start();
467
468 /*
469 * send slave address
470 */
471 i2c_outbyte((theSlave & 0xfe));
472 /*
473 * wait for ack
474 */
475 if(!i2c_getack())
476 error = 1;
477 /*
478 * now select register
479 */
480 i2c_dir_out();
481 i2c_outbyte(theReg);
482 /*
483 * now it's time to wait for ack
484 */
485 if(!i2c_getack())
486 error = 1;
487 /*
488 * repeat start condition
489 */
490 i2c_delay(CLOCK_LOW_TIME);
491 i2c_start();
492 /*
493 * send slave address
494 */
495 i2c_outbyte(theSlave | 0x01);
496 /*
497 * wait for ack
498 */
499 if(!i2c_getack())
500 error = 1;
501 /*
502 * fetch register
503 */
504 b = i2c_inbyte();
505 /*
506 * last received byte needs to be nacked
507 * instead of acked
508 */
509 i2c_sendnack();
510 /*
511 * end sequence
512 */
513 i2c_stop();
514 /*
515 * enable interrupt again
516 */
517 local_irq_restore(flags);
518
519 } while(error && cntr--);
520
521 return b;
522}
523
524static int
525i2c_open(struct inode *inode, struct file *filp)
526{
527 return 0;
528}
529
530static int
531i2c_release(struct inode *inode, struct file *filp)
532{
533 return 0;
534}
535
536/* Main device API. ioctl's to write or read to/from i2c registers.
537 */
538
539static int
540i2c_ioctl(struct inode *inode, struct file *file,
541 unsigned int cmd, unsigned long arg)
542{
543 if(_IOC_TYPE(cmd) != ETRAXI2C_IOCTYPE) {
544 return -EINVAL;
545 }
546
547 switch (_IOC_NR(cmd)) {
548 case I2C_WRITEREG:
549 /* write to an i2c slave */
550 D(printk("i2cw %d %d %d\n",
551 I2C_ARGSLAVE(arg),
552 I2C_ARGREG(arg),
553 I2C_ARGVALUE(arg)));
554
555 return i2c_writereg(I2C_ARGSLAVE(arg),
556 I2C_ARGREG(arg),
557 I2C_ARGVALUE(arg));
558 case I2C_READREG:
559 {
560 unsigned char val;
561 /* read from an i2c slave */
562 D(printk("i2cr %d %d ",
563 I2C_ARGSLAVE(arg),
564 I2C_ARGREG(arg)));
565 val = i2c_readreg(I2C_ARGSLAVE(arg), I2C_ARGREG(arg));
566 D(printk("= %d\n", val));
567 return val;
568 }
569 default:
570 return -EINVAL;
571
572 }
573
574 return 0;
575}
576
577static struct file_operations i2c_fops = {
578 owner: THIS_MODULE,
579 ioctl: i2c_ioctl,
580 open: i2c_open,
581 release: i2c_release,
582};
583
584int __init
585i2c_init(void)
586{
587 int res;
588
589 /* Setup and enable the Port B I2C interface */
590
591 crisv32_io_get_name(&cris_i2c_data, CONFIG_ETRAX_I2C_DATA_PORT);
592 crisv32_io_get_name(&cris_i2c_clk, CONFIG_ETRAX_I2C_CLK_PORT);
593
594 /* register char device */
595
596 res = register_chrdev(I2C_MAJOR, i2c_name, &i2c_fops);
597 if(res < 0) {
598 printk(KERN_ERR "i2c: couldn't get a major number.\n");
599 return res;
600 }
601
602 printk(KERN_INFO "I2C driver v2.2, (c) 1999-2001 Axis Communications AB\n");
603
604 return 0;
605}
606
607/* this makes sure that i2c_init is called during boot */
608
609module_init(i2c_init);
610
611/****************** END OF FILE i2c.c ********************************/
diff --git a/arch/cris/arch-v32/drivers/i2c.h b/arch/cris/arch-v32/drivers/i2c.h
new file mode 100644
index 000000000000..bfe1a13f9f35
--- /dev/null
+++ b/arch/cris/arch-v32/drivers/i2c.h
@@ -0,0 +1,15 @@
1
2#include <linux/init.h>
3
4/* High level I2C actions */
5int __init i2c_init(void);
6int i2c_writereg(unsigned char theSlave, unsigned char theReg, unsigned char theValue);
7unsigned char i2c_readreg(unsigned char theSlave, unsigned char theReg);
8
9/* Low level I2C */
10void i2c_start(void);
11void i2c_stop(void);
12void i2c_outbyte(unsigned char x);
13unsigned char i2c_inbyte(void);
14int i2c_getack(void);
15void i2c_sendack(void);
diff --git a/arch/cris/arch-v32/drivers/iop_fw_load.c b/arch/cris/arch-v32/drivers/iop_fw_load.c
new file mode 100644
index 000000000000..11f9895ded50
--- /dev/null
+++ b/arch/cris/arch-v32/drivers/iop_fw_load.c
@@ -0,0 +1,219 @@
1/* $Id: iop_fw_load.c,v 1.4 2005/04/07 09:27:46 larsv Exp $
2 *
3 * Firmware loader for ETRAX FS IO-Processor
4 *
5 * Copyright (C) 2004 Axis Communications AB
6 */
7
8#include <linux/module.h>
9#include <linux/kernel.h>
10#include <linux/init.h>
11#include <linux/device.h>
12#include <linux/firmware.h>
13
14#include <asm/arch/hwregs/reg_map.h>
15#include <asm/arch/hwregs/iop/iop_reg_space.h>
16#include <asm/arch/hwregs/iop/iop_mpu_macros.h>
17#include <asm/arch/hwregs/iop/iop_mpu_defs.h>
18#include <asm/arch/hwregs/iop/iop_spu_defs.h>
19#include <asm/arch/hwregs/iop/iop_sw_cpu_defs.h>
20
21#define IOP_TIMEOUT 100
22
23static struct device iop_spu_device[2] = {
24 { .bus_id = "iop-spu0", },
25 { .bus_id = "iop-spu1", },
26};
27
28static struct device iop_mpu_device = {
29 .bus_id = "iop-mpu",
30};
31
32static int wait_mpu_idle(void)
33{
34 reg_iop_mpu_r_stat mpu_stat;
35 unsigned int timeout = IOP_TIMEOUT;
36
37 do {
38 mpu_stat = REG_RD(iop_mpu, regi_iop_mpu, r_stat);
39 } while (mpu_stat.instr_reg_busy == regk_iop_mpu_yes && --timeout > 0);
40 if (timeout == 0) {
41 printk(KERN_ERR "Timeout waiting for MPU to be idle\n");
42 return -EBUSY;
43 }
44 return 0;
45}
46
47int iop_fw_load_spu(const unsigned char *fw_name, unsigned int spu_inst)
48{
49 reg_iop_sw_cpu_rw_mc_ctrl mc_ctrl = {
50 .wr_spu0_mem = regk_iop_sw_cpu_no,
51 .wr_spu1_mem = regk_iop_sw_cpu_no,
52 .size = 4,
53 .cmd = regk_iop_sw_cpu_reg_copy,
54 .keep_owner = regk_iop_sw_cpu_yes
55 };
56 reg_iop_spu_rw_ctrl spu_ctrl = {
57 .en = regk_iop_spu_no,
58 .fsm = regk_iop_spu_no,
59 };
60 reg_iop_sw_cpu_r_mc_stat mc_stat;
61 const struct firmware *fw_entry;
62 u32 *data;
63 unsigned int timeout;
64 int retval, i;
65
66 if (spu_inst > 1)
67 return -ENODEV;
68
69 /* get firmware */
70 retval = request_firmware(&fw_entry,
71 fw_name,
72 &iop_spu_device[spu_inst]);
73 if (retval != 0)
74 {
75 printk(KERN_ERR
76 "iop_load_spu: Failed to load firmware \"%s\"\n",
77 fw_name);
78 return retval;
79 }
80 data = (u32 *) fw_entry->data;
81
82 /* acquire ownership of memory controller */
83 switch (spu_inst) {
84 case 0:
85 mc_ctrl.wr_spu0_mem = regk_iop_sw_cpu_yes;
86 REG_WR(iop_spu, regi_iop_spu0, rw_ctrl, spu_ctrl);
87 break;
88 case 1:
89 mc_ctrl.wr_spu1_mem = regk_iop_sw_cpu_yes;
90 REG_WR(iop_spu, regi_iop_spu1, rw_ctrl, spu_ctrl);
91 break;
92 }
93 timeout = IOP_TIMEOUT;
94 do {
95 REG_WR(iop_sw_cpu, regi_iop_sw_cpu, rw_mc_ctrl, mc_ctrl);
96 mc_stat = REG_RD(iop_sw_cpu, regi_iop_sw_cpu, r_mc_stat);
97 } while (mc_stat.owned_by_cpu == regk_iop_sw_cpu_no && --timeout > 0);
98 if (timeout == 0) {
99 printk(KERN_ERR "Timeout waiting to acquire MC\n");
100 retval = -EBUSY;
101 goto out;
102 }
103
104 /* write to SPU memory */
105 for (i = 0; i < (fw_entry->size/4); i++) {
106 switch (spu_inst) {
107 case 0:
108 REG_WR_INT(iop_spu, regi_iop_spu0, rw_seq_pc, (i*4));
109 break;
110 case 1:
111 REG_WR_INT(iop_spu, regi_iop_spu1, rw_seq_pc, (i*4));
112 break;
113 }
114 REG_WR_INT(iop_sw_cpu, regi_iop_sw_cpu, rw_mc_data, *data);
115 data++;
116 }
117
118 /* release ownership of memory controller */
119 (void) REG_RD(iop_sw_cpu, regi_iop_sw_cpu, rs_mc_data);
120
121 out:
122 release_firmware(fw_entry);
123 return retval;
124}
125
126int iop_fw_load_mpu(unsigned char *fw_name)
127{
128 const unsigned int start_addr = 0;
129 reg_iop_mpu_rw_ctrl mpu_ctrl;
130 const struct firmware *fw_entry;
131 u32 *data;
132 int retval, i;
133
134 /* get firmware */
135 retval = request_firmware(&fw_entry, fw_name, &iop_mpu_device);
136 if (retval != 0)
137 {
138 printk(KERN_ERR
139 "iop_load_spu: Failed to load firmware \"%s\"\n",
140 fw_name);
141 return retval;
142 }
143 data = (u32 *) fw_entry->data;
144
145 /* disable MPU */
146 mpu_ctrl.en = regk_iop_mpu_no;
147 REG_WR(iop_mpu, regi_iop_mpu, rw_ctrl, mpu_ctrl);
148 /* put start address in R0 */
149 REG_WR_VECT(iop_mpu, regi_iop_mpu, rw_r, 0, start_addr);
150 /* write to memory by executing 'SWX i, 4, R0' for each word */
151 if ((retval = wait_mpu_idle()) != 0)
152 goto out;
153 REG_WR(iop_mpu, regi_iop_mpu, rw_instr, MPU_SWX_IIR_INSTR(0, 4, 0));
154 for (i = 0; i < (fw_entry->size / 4); i++) {
155 REG_WR_INT(iop_mpu, regi_iop_mpu, rw_immediate, *data);
156 if ((retval = wait_mpu_idle()) != 0)
157 goto out;
158 data++;
159 }
160
161 out:
162 release_firmware(fw_entry);
163 return retval;
164}
165
166int iop_start_mpu(unsigned int start_addr)
167{
168 reg_iop_mpu_rw_ctrl mpu_ctrl = { .en = regk_iop_mpu_yes };
169 int retval;
170
171 /* disable MPU */
172 if ((retval = wait_mpu_idle()) != 0)
173 goto out;
174 REG_WR(iop_mpu, regi_iop_mpu, rw_instr, MPU_HALT());
175 if ((retval = wait_mpu_idle()) != 0)
176 goto out;
177 /* set PC and wait for it to bite */
178 if ((retval = wait_mpu_idle()) != 0)
179 goto out;
180 REG_WR_INT(iop_mpu, regi_iop_mpu, rw_instr, MPU_BA_I(start_addr));
181 if ((retval = wait_mpu_idle()) != 0)
182 goto out;
183 /* make sure the MPU starts executing with interrupts disabled */
184 REG_WR(iop_mpu, regi_iop_mpu, rw_instr, MPU_DI());
185 if ((retval = wait_mpu_idle()) != 0)
186 goto out;
187 /* enable MPU */
188 REG_WR(iop_mpu, regi_iop_mpu, rw_ctrl, mpu_ctrl);
189 out:
190 return retval;
191}
192
193static int __init iop_fw_load_init(void)
194{
195 device_initialize(&iop_spu_device[0]);
196 kobject_set_name(&iop_spu_device[0].kobj, "iop-spu0");
197 kobject_add(&iop_spu_device[0].kobj);
198 device_initialize(&iop_spu_device[1]);
199 kobject_set_name(&iop_spu_device[1].kobj, "iop-spu1");
200 kobject_add(&iop_spu_device[1].kobj);
201 device_initialize(&iop_mpu_device);
202 kobject_set_name(&iop_mpu_device.kobj, "iop-mpu");
203 kobject_add(&iop_mpu_device.kobj);
204 return 0;
205}
206
207static void __exit iop_fw_load_exit(void)
208{
209}
210
211module_init(iop_fw_load_init);
212module_exit(iop_fw_load_exit);
213
214MODULE_DESCRIPTION("ETRAX FS IO-Processor Firmware Loader");
215MODULE_LICENSE("GPL");
216
217EXPORT_SYMBOL(iop_fw_load_spu);
218EXPORT_SYMBOL(iop_fw_load_mpu);
219EXPORT_SYMBOL(iop_start_mpu);
diff --git a/arch/cris/arch-v32/drivers/nandflash.c b/arch/cris/arch-v32/drivers/nandflash.c
new file mode 100644
index 000000000000..fc2a619b035d
--- /dev/null
+++ b/arch/cris/arch-v32/drivers/nandflash.c
@@ -0,0 +1,157 @@
1/*
2 * arch/cris/arch-v32/drivers/nandflash.c
3 *
4 * Copyright (c) 2004
5 *
6 * Derived from drivers/mtd/nand/spia.c
7 * Copyright (C) 2000 Steven J. Hill (sjhill@realitydiluted.com)
8 *
9 * $Id: nandflash.c,v 1.3 2005/06/01 10:57:12 starvik Exp $
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
17#include <linux/version.h>
18#include <linux/slab.h>
19#include <linux/init.h>
20#include <linux/module.h>
21#include <linux/mtd/mtd.h>
22#include <linux/mtd/nand.h>
23#include <linux/mtd/partitions.h>
24#include <asm/arch/memmap.h>
25#include <asm/arch/hwregs/reg_map.h>
26#include <asm/arch/hwregs/reg_rdwr.h>
27#include <asm/arch/hwregs/gio_defs.h>
28#include <asm/arch/hwregs/bif_core_defs.h>
29#include <asm/io.h>
30
31#define CE_BIT 4
32#define CLE_BIT 5
33#define ALE_BIT 6
34#define BY_BIT 7
35
36static struct mtd_info *crisv32_mtd = NULL;
37/*
38 * hardware specific access to control-lines
39*/
40static void crisv32_hwcontrol(struct mtd_info *mtd, int cmd)
41{
42 unsigned long flags;
43 reg_gio_rw_pa_dout dout = REG_RD(gio, regi_gio, rw_pa_dout);
44
45 local_irq_save(flags);
46 switch(cmd){
47 case NAND_CTL_SETCLE:
48 dout.data |= (1<<CLE_BIT);
49 break;
50 case NAND_CTL_CLRCLE:
51 dout.data &= ~(1<<CLE_BIT);
52 break;
53 case NAND_CTL_SETALE:
54 dout.data |= (1<<ALE_BIT);
55 break;
56 case NAND_CTL_CLRALE:
57 dout.data &= ~(1<<ALE_BIT);
58 break;
59 case NAND_CTL_SETNCE:
60 dout.data |= (1<<CE_BIT);
61 break;
62 case NAND_CTL_CLRNCE:
63 dout.data &= ~(1<<CE_BIT);
64 break;
65 }
66 REG_WR(gio, regi_gio, rw_pa_dout, dout);
67 local_irq_restore(flags);
68}
69
70/*
71* read device ready pin
72*/
73int crisv32_device_ready(struct mtd_info *mtd)
74{
75 reg_gio_r_pa_din din = REG_RD(gio, regi_gio, r_pa_din);
76 return ((din.data & (1 << BY_BIT)) >> BY_BIT);
77}
78
79/*
80 * Main initialization routine
81 */
82struct mtd_info* __init crisv32_nand_flash_probe (void)
83{
84 void __iomem *read_cs;
85 void __iomem *write_cs;
86
87 reg_bif_core_rw_grp3_cfg bif_cfg = REG_RD(bif_core, regi_bif_core, rw_grp3_cfg);
88 reg_gio_rw_pa_oe pa_oe = REG_RD(gio, regi_gio, rw_pa_oe);
89 struct nand_chip *this;
90 int err = 0;
91
92 /* Allocate memory for MTD device structure and private data */
93 crisv32_mtd = kmalloc (sizeof(struct mtd_info) + sizeof (struct nand_chip),
94 GFP_KERNEL);
95 if (!crisv32_mtd) {
96 printk ("Unable to allocate CRISv32 NAND MTD device structure.\n");
97 err = -ENOMEM;
98 return NULL;
99 }
100
101 read_cs = ioremap(MEM_CSP0_START | MEM_NON_CACHEABLE, 8192);
102 write_cs = ioremap(MEM_CSP1_START | MEM_NON_CACHEABLE, 8192);
103
104 if (!read_cs || !write_cs) {
105 printk("CRISv32 NAND ioremap failed\n");
106 err = -EIO;
107 goto out_mtd;
108 }
109
110 /* Get pointer to private data */
111 this = (struct nand_chip *) (&crisv32_mtd[1]);
112
113 pa_oe.oe |= 1 << CE_BIT;
114 pa_oe.oe |= 1 << ALE_BIT;
115 pa_oe.oe |= 1 << CLE_BIT;
116 pa_oe.oe &= ~ (1 << BY_BIT);
117 REG_WR(gio, regi_gio, rw_pa_oe, pa_oe);
118
119 bif_cfg.gated_csp0 = regk_bif_core_rd;
120 bif_cfg.gated_csp1 = regk_bif_core_wr;
121 REG_WR(bif_core, regi_bif_core, rw_grp3_cfg, bif_cfg);
122
123 /* Initialize structures */
124 memset((char *) crisv32_mtd, 0, sizeof(struct mtd_info));
125 memset((char *) this, 0, sizeof(struct nand_chip));
126
127 /* Link the private data with the MTD structure */
128 crisv32_mtd->priv = this;
129
130 /* Set address of NAND IO lines */
131 this->IO_ADDR_R = read_cs;
132 this->IO_ADDR_W = write_cs;
133 this->hwcontrol = crisv32_hwcontrol;
134 this->dev_ready = crisv32_device_ready;
135 /* 20 us command delay time */
136 this->chip_delay = 20;
137 this->eccmode = NAND_ECC_SOFT;
138
139 /* Enable the following for a flash based bad block table */
140 this->options = NAND_USE_FLASH_BBT;
141
142 /* Scan to find existance of the device */
143 if (nand_scan (crisv32_mtd, 1)) {
144 err = -ENXIO;
145 goto out_ior;
146 }
147
148 return crisv32_mtd;
149
150out_ior:
151 iounmap((void *)read_cs);
152 iounmap((void *)write_cs);
153out_mtd:
154 kfree (crisv32_mtd);
155 return NULL;
156}
157
diff --git a/arch/cris/arch-v32/drivers/pcf8563.c b/arch/cris/arch-v32/drivers/pcf8563.c
new file mode 100644
index 000000000000..f894580b648b
--- /dev/null
+++ b/arch/cris/arch-v32/drivers/pcf8563.c
@@ -0,0 +1,341 @@
1/*
2 * PCF8563 RTC
3 *
4 * From Phillips' datasheet:
5 *
6 * The PCF8563 is a CMOS real-time clock/calendar optimized for low power
7 * consumption. A programmable clock output, interupt output and voltage
8 * low detector are also provided. All address and data are transferred
9 * serially via two-line bidirectional I2C-bus. Maximum bus speed is
10 * 400 kbits/s. The built-in word address register is incremented
11 * automatically after each written or read byte.
12 *
13 * Copyright (c) 2002-2003, Axis Communications AB
14 * All rights reserved.
15 *
16 * Author: Tobias Anderberg <tobiasa@axis.com>.
17 *
18 */
19
20#include <linux/config.h>
21#include <linux/version.h>
22#include <linux/module.h>
23#include <linux/kernel.h>
24#include <linux/types.h>
25#include <linux/sched.h>
26#include <linux/init.h>
27#include <linux/fs.h>
28#include <linux/ioctl.h>
29#include <linux/delay.h>
30#include <linux/bcd.h>
31
32#include <asm/uaccess.h>
33#include <asm/system.h>
34#include <asm/io.h>
35#include <asm/rtc.h>
36
37#include "i2c.h"
38
39#define PCF8563_MAJOR 121 /* Local major number. */
40#define DEVICE_NAME "rtc" /* Name which is registered in /proc/devices. */
41#define PCF8563_NAME "PCF8563"
42#define DRIVER_VERSION "$Revision: 1.1 $"
43
44/* Two simple wrapper macros, saves a few keystrokes. */
45#define rtc_read(x) i2c_readreg(RTC_I2C_READ, x)
46#define rtc_write(x,y) i2c_writereg(RTC_I2C_WRITE, x, y)
47
48static const unsigned char days_in_month[] =
49 { 0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 };
50
51int pcf8563_ioctl(struct inode *, struct file *, unsigned int, unsigned long);
52int pcf8563_open(struct inode *, struct file *);
53int pcf8563_release(struct inode *, struct file *);
54
55static struct file_operations pcf8563_fops = {
56 owner: THIS_MODULE,
57 ioctl: pcf8563_ioctl,
58 open: pcf8563_open,
59 release: pcf8563_release,
60};
61
62unsigned char
63pcf8563_readreg(int reg)
64{
65 unsigned char res = rtc_read(reg);
66
67 /* The PCF8563 does not return 0 for unimplemented bits */
68 switch (reg) {
69 case RTC_SECONDS:
70 case RTC_MINUTES:
71 res &= 0x7F;
72 break;
73 case RTC_HOURS:
74 case RTC_DAY_OF_MONTH:
75 res &= 0x3F;
76 break;
77 case RTC_WEEKDAY:
78 res &= 0x07;
79 break;
80 case RTC_MONTH:
81 res &= 0x1F;
82 break;
83 case RTC_CONTROL1:
84 res &= 0xA8;
85 break;
86 case RTC_CONTROL2:
87 res &= 0x1F;
88 break;
89 case RTC_CLOCKOUT_FREQ:
90 case RTC_TIMER_CONTROL:
91 res &= 0x83;
92 break;
93 }
94 return res;
95}
96
97void
98pcf8563_writereg(int reg, unsigned char val)
99{
100#ifdef CONFIG_ETRAX_RTC_READONLY
101 if (reg == RTC_CONTROL1 || (reg >= RTC_SECONDS && reg <= RTC_YEAR))
102 return;
103#endif
104
105 rtc_write(reg, val);
106}
107
108void
109get_rtc_time(struct rtc_time *tm)
110{
111 tm->tm_sec = rtc_read(RTC_SECONDS);
112 tm->tm_min = rtc_read(RTC_MINUTES);
113 tm->tm_hour = rtc_read(RTC_HOURS);
114 tm->tm_mday = rtc_read(RTC_DAY_OF_MONTH);
115 tm->tm_wday = rtc_read(RTC_WEEKDAY);
116 tm->tm_mon = rtc_read(RTC_MONTH);
117 tm->tm_year = rtc_read(RTC_YEAR);
118
119 if (tm->tm_sec & 0x80)
120 printk(KERN_WARNING "%s: RTC Voltage Low - reliable date/time "
121 "information is no longer guaranteed!\n", PCF8563_NAME);
122
123 tm->tm_year = BCD_TO_BIN(tm->tm_year) + ((tm->tm_mon & 0x80) ? 100 : 0);
124 tm->tm_sec &= 0x7F;
125 tm->tm_min &= 0x7F;
126 tm->tm_hour &= 0x3F;
127 tm->tm_mday &= 0x3F;
128 tm->tm_wday &= 0x07; /* Not coded in BCD. */
129 tm->tm_mon &= 0x1F;
130
131 BCD_TO_BIN(tm->tm_sec);
132 BCD_TO_BIN(tm->tm_min);
133 BCD_TO_BIN(tm->tm_hour);
134 BCD_TO_BIN(tm->tm_mday);
135 BCD_TO_BIN(tm->tm_mon);
136 tm->tm_mon--; /* Month is 1..12 in RTC but 0..11 in linux */
137}
138
139int __init
140pcf8563_init(void)
141{
142 /* Initiate the i2c protocol. */
143 i2c_init();
144
145 /*
146 * First of all we need to reset the chip. This is done by
147 * clearing control1, control2 and clk freq and resetting
148 * all alarms.
149 */
150 if (rtc_write(RTC_CONTROL1, 0x00) < 0)
151 goto err;
152
153 if (rtc_write(RTC_CONTROL2, 0x00) < 0)
154 goto err;
155
156 if (rtc_write(RTC_CLOCKOUT_FREQ, 0x00) < 0)
157 goto err;
158
159 if (rtc_write(RTC_TIMER_CONTROL, 0x03) < 0)
160 goto err;
161
162 /* Reset the alarms. */
163 if (rtc_write(RTC_MINUTE_ALARM, 0x80) < 0)
164 goto err;
165
166 if (rtc_write(RTC_HOUR_ALARM, 0x80) < 0)
167 goto err;
168
169 if (rtc_write(RTC_DAY_ALARM, 0x80) < 0)
170 goto err;
171
172 if (rtc_write(RTC_WEEKDAY_ALARM, 0x80) < 0)
173 goto err;
174
175 if (register_chrdev(PCF8563_MAJOR, DEVICE_NAME, &pcf8563_fops) < 0) {
176 printk(KERN_INFO "%s: Unable to get major numer %d for RTC device.\n",
177 PCF8563_NAME, PCF8563_MAJOR);
178 return -1;
179 }
180
181 printk(KERN_INFO "%s Real-Time Clock Driver, %s\n", PCF8563_NAME, DRIVER_VERSION);
182
183 /* Check for low voltage, and warn about it.. */
184 if (rtc_read(RTC_SECONDS) & 0x80)
185 printk(KERN_WARNING "%s: RTC Voltage Low - reliable date/time "
186 "information is no longer guaranteed!\n", PCF8563_NAME);
187
188 return 0;
189
190err:
191 printk(KERN_INFO "%s: Error initializing chip.\n", PCF8563_NAME);
192 return -1;
193}
194
195void __exit
196pcf8563_exit(void)
197{
198 if (unregister_chrdev(PCF8563_MAJOR, DEVICE_NAME) < 0) {
199 printk(KERN_INFO "%s: Unable to unregister device.\n", PCF8563_NAME);
200 }
201}
202
203/*
204 * ioctl calls for this driver. Why return -ENOTTY upon error? Because
205 * POSIX says so!
206 */
207int
208pcf8563_ioctl(struct inode *inode, struct file *filp, unsigned int cmd, unsigned long arg)
209{
210 /* Some sanity checks. */
211 if (_IOC_TYPE(cmd) != RTC_MAGIC)
212 return -ENOTTY;
213
214 if (_IOC_NR(cmd) > RTC_MAX_IOCTL)
215 return -ENOTTY;
216
217 switch (cmd) {
218 case RTC_RD_TIME:
219 {
220 struct rtc_time tm;
221
222 memset(&tm, 0, sizeof (struct rtc_time));
223 get_rtc_time(&tm);
224
225 if (copy_to_user((struct rtc_time *) arg, &tm, sizeof tm)) {
226 return -EFAULT;
227 }
228
229 return 0;
230 }
231
232 case RTC_SET_TIME:
233 {
234#ifdef CONFIG_ETRAX_RTC_READONLY
235 return -EPERM;
236#else
237 int leap;
238 int year;
239 int century;
240 struct rtc_time tm;
241
242 if (!capable(CAP_SYS_TIME))
243 return -EPERM;
244
245 if (copy_from_user(&tm, (struct rtc_time *) arg, sizeof tm))
246 return -EFAULT;
247
248 /* Convert from struct tm to struct rtc_time. */
249 tm.tm_year += 1900;
250 tm.tm_mon += 1;
251
252 /*
253 * Check if tm.tm_year is a leap year. A year is a leap
254 * year if it is divisible by 4 but not 100, except
255 * that years divisible by 400 _are_ leap years.
256 */
257 year = tm.tm_year;
258 leap = (tm.tm_mon == 2) && ((year % 4 == 0 && year % 100 != 0) || year % 400 == 0);
259
260 /* Perform some sanity checks. */
261 if ((tm.tm_year < 1970) ||
262 (tm.tm_mon > 12) ||
263 (tm.tm_mday == 0) ||
264 (tm.tm_mday > days_in_month[tm.tm_mon] + leap) ||
265 (tm.tm_wday >= 7) ||
266 (tm.tm_hour >= 24) ||
267 (tm.tm_min >= 60) ||
268 (tm.tm_sec >= 60))
269 return -EINVAL;
270
271 century = (tm.tm_year >= 2000) ? 0x80 : 0;
272 tm.tm_year = tm.tm_year % 100;
273
274 BIN_TO_BCD(tm.tm_year);
275 BIN_TO_BCD(tm.tm_mday);
276 BIN_TO_BCD(tm.tm_hour);
277 BIN_TO_BCD(tm.tm_min);
278 BIN_TO_BCD(tm.tm_sec);
279 tm.tm_mon |= century;
280
281 rtc_write(RTC_YEAR, tm.tm_year);
282 rtc_write(RTC_MONTH, tm.tm_mon);
283 rtc_write(RTC_WEEKDAY, tm.tm_wday); /* Not coded in BCD. */
284 rtc_write(RTC_DAY_OF_MONTH, tm.tm_mday);
285 rtc_write(RTC_HOURS, tm.tm_hour);
286 rtc_write(RTC_MINUTES, tm.tm_min);
287 rtc_write(RTC_SECONDS, tm.tm_sec);
288
289 return 0;
290#endif /* !CONFIG_ETRAX_RTC_READONLY */
291 }
292
293 case RTC_VLOW_RD:
294 {
295 int vl_bit = 0;
296
297 if (rtc_read(RTC_SECONDS) & 0x80) {
298 vl_bit = 1;
299 printk(KERN_WARNING "%s: RTC Voltage Low - reliable "
300 "date/time information is no longer guaranteed!\n",
301 PCF8563_NAME);
302 }
303 if (copy_to_user((int *) arg, &vl_bit, sizeof(int)))
304 return -EFAULT;
305
306 return 0;
307 }
308
309 case RTC_VLOW_SET:
310 {
311 /* Clear the VL bit in the seconds register */
312 int ret = rtc_read(RTC_SECONDS);
313
314 rtc_write(RTC_SECONDS, (ret & 0x7F));
315
316 return 0;
317 }
318
319 default:
320 return -ENOTTY;
321 }
322
323 return 0;
324}
325
326int
327pcf8563_open(struct inode *inode, struct file *filp)
328{
329 MOD_INC_USE_COUNT;
330 return 0;
331}
332
333int
334pcf8563_release(struct inode *inode, struct file *filp)
335{
336 MOD_DEC_USE_COUNT;
337 return 0;
338}
339
340module_init(pcf8563_init);
341module_exit(pcf8563_exit);
diff --git a/arch/cris/arch-v32/drivers/pci/Makefile b/arch/cris/arch-v32/drivers/pci/Makefile
new file mode 100644
index 000000000000..bff7482f2444
--- /dev/null
+++ b/arch/cris/arch-v32/drivers/pci/Makefile
@@ -0,0 +1,5 @@
1#
2# Makefile for Etrax cardbus driver
3#
4
5obj-$(CONFIG_ETRAX_CARDBUS) += bios.o dma.o
diff --git a/arch/cris/arch-v32/drivers/pci/bios.c b/arch/cris/arch-v32/drivers/pci/bios.c
new file mode 100644
index 000000000000..24bc149889b6
--- /dev/null
+++ b/arch/cris/arch-v32/drivers/pci/bios.c
@@ -0,0 +1,131 @@
1#include <linux/pci.h>
2#include <linux/kernel.h>
3#include <asm/arch/hwregs/intr_vect.h>
4
5void __devinit pcibios_fixup_bus(struct pci_bus *b)
6{
7}
8
9char * __devinit pcibios_setup(char *str)
10{
11 return NULL;
12}
13
14void pcibios_set_master(struct pci_dev *dev)
15{
16 u8 lat;
17 pci_read_config_byte(dev, PCI_LATENCY_TIMER, &lat);
18 printk(KERN_DEBUG "PCI: Setting latency timer of device %s to %d\n", pci_name(dev), lat);
19 pci_write_config_byte(dev, PCI_LATENCY_TIMER, lat);
20}
21
22int pci_mmap_page_range(struct pci_dev *dev, struct vm_area_struct *vma,
23 enum pci_mmap_state mmap_state, int write_combine)
24{
25 unsigned long prot;
26
27 /* Leave vm_pgoff as-is, the PCI space address is the physical
28 * address on this platform.
29 */
30 vma->vm_flags |= (VM_SHM | VM_LOCKED | VM_IO);
31
32 prot = pgprot_val(vma->vm_page_prot);
33 vma->vm_page_prot = __pgprot(prot);
34
35 /* Write-combine setting is ignored, it is changed via the mtrr
36 * interfaces on this platform.
37 */
38 if (remap_pfn_range(vma, vma->vm_start, vma->vm_pgoff,
39 vma->vm_end - vma->vm_start,
40 vma->vm_page_prot))
41 return -EAGAIN;
42
43 return 0;
44}
45
46void
47pcibios_align_resource(void *data, struct resource *res,
48 unsigned long size, unsigned long align)
49{
50 if (res->flags & IORESOURCE_IO) {
51 unsigned long start = res->start;
52
53 if (start & 0x300) {
54 start = (start + 0x3ff) & ~0x3ff;
55 res->start = start;
56 }
57 }
58}
59
60int pcibios_enable_resources(struct pci_dev *dev, int mask)
61{
62 u16 cmd, old_cmd;
63 int idx;
64 struct resource *r;
65
66 pci_read_config_word(dev, PCI_COMMAND, &cmd);
67 old_cmd = cmd;
68 for(idx=0; idx<6; idx++) {
69 /* Only set up the requested stuff */
70 if (!(mask & (1<<idx)))
71 continue;
72
73 r = &dev->resource[idx];
74 if (!r->start && r->end) {
75 printk(KERN_ERR "PCI: Device %s not available because of resource collisions\n", pci_name(dev));
76 return -EINVAL;
77 }
78 if (r->flags & IORESOURCE_IO)
79 cmd |= PCI_COMMAND_IO;
80 if (r->flags & IORESOURCE_MEM)
81 cmd |= PCI_COMMAND_MEMORY;
82 }
83 if (dev->resource[PCI_ROM_RESOURCE].start)
84 cmd |= PCI_COMMAND_MEMORY;
85 if (cmd != old_cmd) {
86 printk("PCI: Enabling device %s (%04x -> %04x)\n", pci_name(dev), old_cmd, cmd);
87 pci_write_config_word(dev, PCI_COMMAND, cmd);
88 }
89 return 0;
90}
91
92int pcibios_enable_irq(struct pci_dev *dev)
93{
94 dev->irq = EXT_INTR_VECT;
95 return 0;
96}
97
98int pcibios_enable_device(struct pci_dev *dev, int mask)
99{
100 int err;
101
102 if ((err = pcibios_enable_resources(dev, mask)) < 0)
103 return err;
104
105 return pcibios_enable_irq(dev);
106}
107
108int pcibios_assign_resources(void)
109{
110 struct pci_dev *dev = NULL;
111 int idx;
112 struct resource *r;
113
114 while ((dev = pci_get_device(PCI_ANY_ID, PCI_ANY_ID, dev)) != NULL) {
115 int class = dev->class >> 8;
116
117 /* Don't touch classless devices and host bridges */
118 if (!class || class == PCI_CLASS_BRIDGE_HOST)
119 continue;
120
121 for(idx=0; idx<6; idx++) {
122 r = &dev->resource[idx];
123
124 if (!r->start && r->end)
125 pci_assign_resource(dev, idx);
126 }
127 }
128 return 0;
129}
130
131EXPORT_SYMBOL(pcibios_assign_resources);
diff --git a/arch/cris/arch-v32/drivers/pci/dma.c b/arch/cris/arch-v32/drivers/pci/dma.c
new file mode 100644
index 000000000000..10329306d23c
--- /dev/null
+++ b/arch/cris/arch-v32/drivers/pci/dma.c
@@ -0,0 +1,149 @@
1/*
2 * Dynamic DMA mapping support.
3 *
4 * On cris there is no hardware dynamic DMA address translation,
5 * so consistent alloc/free are merely page allocation/freeing.
6 * The rest of the dynamic DMA mapping interface is implemented
7 * in asm/pci.h.
8 *
9 * Borrowed from i386.
10 */
11
12#include <linux/types.h>
13#include <linux/mm.h>
14#include <linux/string.h>
15#include <linux/pci.h>
16#include <asm/io.h>
17
18struct dma_coherent_mem {
19 void *virt_base;
20 u32 device_base;
21 int size;
22 int flags;
23 unsigned long *bitmap;
24};
25
26void *dma_alloc_coherent(struct device *dev, size_t size,
27 dma_addr_t *dma_handle, unsigned int __nocast gfp)
28{
29 void *ret;
30 struct dma_coherent_mem *mem = dev ? dev->dma_mem : NULL;
31 int order = get_order(size);
32 /* ignore region specifiers */
33 gfp &= ~(__GFP_DMA | __GFP_HIGHMEM);
34
35 if (mem) {
36 int page = bitmap_find_free_region(mem->bitmap, mem->size,
37 order);
38 if (page >= 0) {
39 *dma_handle = mem->device_base + (page << PAGE_SHIFT);
40 ret = mem->virt_base + (page << PAGE_SHIFT);
41 memset(ret, 0, size);
42 return ret;
43 }
44 if (mem->flags & DMA_MEMORY_EXCLUSIVE)
45 return NULL;
46 }
47
48 if (dev == NULL || (dev->coherent_dma_mask < 0xffffffff))
49 gfp |= GFP_DMA;
50
51 ret = (void *)__get_free_pages(gfp, order);
52
53 if (ret != NULL) {
54 memset(ret, 0, size);
55 *dma_handle = virt_to_phys(ret);
56 }
57 return ret;
58}
59
60void dma_free_coherent(struct device *dev, size_t size,
61 void *vaddr, dma_addr_t dma_handle)
62{
63 struct dma_coherent_mem *mem = dev ? dev->dma_mem : NULL;
64 int order = get_order(size);
65
66 if (mem && vaddr >= mem->virt_base && vaddr < (mem->virt_base + (mem->size << PAGE_SHIFT))) {
67 int page = (vaddr - mem->virt_base) >> PAGE_SHIFT;
68
69 bitmap_release_region(mem->bitmap, page, order);
70 } else
71 free_pages((unsigned long)vaddr, order);
72}
73
74int dma_declare_coherent_memory(struct device *dev, dma_addr_t bus_addr,
75 dma_addr_t device_addr, size_t size, int flags)
76{
77 void __iomem *mem_base;
78 int pages = size >> PAGE_SHIFT;
79 int bitmap_size = (pages + 31)/32;
80
81 if ((flags & (DMA_MEMORY_MAP | DMA_MEMORY_IO)) == 0)
82 goto out;
83 if (!size)
84 goto out;
85 if (dev->dma_mem)
86 goto out;
87
88 /* FIXME: this routine just ignores DMA_MEMORY_INCLUDES_CHILDREN */
89
90 mem_base = ioremap(bus_addr, size);
91 if (!mem_base)
92 goto out;
93
94 dev->dma_mem = kmalloc(sizeof(struct dma_coherent_mem), GFP_KERNEL);
95 if (!dev->dma_mem)
96 goto out;
97 memset(dev->dma_mem, 0, sizeof(struct dma_coherent_mem));
98 dev->dma_mem->bitmap = kmalloc(bitmap_size, GFP_KERNEL);
99 if (!dev->dma_mem->bitmap)
100 goto free1_out;
101 memset(dev->dma_mem->bitmap, 0, bitmap_size);
102
103 dev->dma_mem->virt_base = mem_base;
104 dev->dma_mem->device_base = device_addr;
105 dev->dma_mem->size = pages;
106 dev->dma_mem->flags = flags;
107
108 if (flags & DMA_MEMORY_MAP)
109 return DMA_MEMORY_MAP;
110
111 return DMA_MEMORY_IO;
112
113 free1_out:
114 kfree(dev->dma_mem->bitmap);
115 out:
116 return 0;
117}
118EXPORT_SYMBOL(dma_declare_coherent_memory);
119
120void dma_release_declared_memory(struct device *dev)
121{
122 struct dma_coherent_mem *mem = dev->dma_mem;
123
124 if(!mem)
125 return;
126 dev->dma_mem = NULL;
127 iounmap(mem->virt_base);
128 kfree(mem->bitmap);
129 kfree(mem);
130}
131EXPORT_SYMBOL(dma_release_declared_memory);
132
133void *dma_mark_declared_memory_occupied(struct device *dev,
134 dma_addr_t device_addr, size_t size)
135{
136 struct dma_coherent_mem *mem = dev->dma_mem;
137 int pages = (size + (device_addr & ~PAGE_MASK) + PAGE_SIZE - 1) >> PAGE_SHIFT;
138 int pos, err;
139
140 if (!mem)
141 return ERR_PTR(-EINVAL);
142
143 pos = (device_addr - mem->device_base) >> PAGE_SHIFT;
144 err = bitmap_allocate_region(mem->bitmap, pos, get_order(pages));
145 if (err != 0)
146 return ERR_PTR(err);
147 return mem->virt_base + (pos << PAGE_SHIFT);
148}
149EXPORT_SYMBOL(dma_mark_declared_memory_occupied);
diff --git a/arch/cris/arch-v32/drivers/sync_serial.c b/arch/cris/arch-v32/drivers/sync_serial.c
new file mode 100644
index 000000000000..c85a6df8558f
--- /dev/null
+++ b/arch/cris/arch-v32/drivers/sync_serial.c
@@ -0,0 +1,1283 @@
1/*
2 * Simple synchronous serial port driver for ETRAX FS.
3 *
4 * Copyright (c) 2005 Axis Communications AB
5 *
6 * Author: Mikael Starvik
7 *
8 */
9
10#include <linux/module.h>
11#include <linux/kernel.h>
12#include <linux/config.h>
13#include <linux/types.h>
14#include <linux/errno.h>
15#include <linux/major.h>
16#include <linux/sched.h>
17#include <linux/slab.h>
18#include <linux/interrupt.h>
19#include <linux/poll.h>
20#include <linux/init.h>
21#include <linux/timer.h>
22#include <linux/spinlock.h>
23
24#include <asm/io.h>
25#include <asm/arch/dma.h>
26#include <asm/arch/pinmux.h>
27#include <asm/arch/hwregs/reg_rdwr.h>
28#include <asm/arch/hwregs/sser_defs.h>
29#include <asm/arch/hwregs/dma_defs.h>
30#include <asm/arch/hwregs/dma.h>
31#include <asm/arch/hwregs/intr_vect_defs.h>
32#include <asm/arch/hwregs/intr_vect.h>
33#include <asm/arch/hwregs/reg_map.h>
34#include <asm/sync_serial.h>
35
36/* The receiver is a bit tricky beacuse of the continuous stream of data.*/
37/* */
38/* Three DMA descriptors are linked together. Each DMA descriptor is */
39/* responsible for port->bufchunk of a common buffer. */
40/* */
41/* +---------------------------------------------+ */
42/* | +----------+ +----------+ +----------+ | */
43/* +-> | Descr[0] |-->| Descr[1] |-->| Descr[2] |-+ */
44/* +----------+ +----------+ +----------+ */
45/* | | | */
46/* v v v */
47/* +-------------------------------------+ */
48/* | BUFFER | */
49/* +-------------------------------------+ */
50/* |<- data_avail ->| */
51/* readp writep */
52/* */
53/* If the application keeps up the pace readp will be right after writep.*/
54/* If the application can't keep the pace we have to throw away data. */
55/* The idea is that readp should be ready with the data pointed out by */
56/* Descr[i] when the DMA has filled in Descr[i+1]. */
57/* Otherwise we will discard */
58/* the rest of the data pointed out by Descr1 and set readp to the start */
59/* of Descr2 */
60
61#define SYNC_SERIAL_MAJOR 125
62
63/* IN_BUFFER_SIZE should be a multiple of 6 to make sure that 24 bit */
64/* words can be handled */
65#define IN_BUFFER_SIZE 12288
66#define IN_DESCR_SIZE 256
67#define NUM_IN_DESCR (IN_BUFFER_SIZE/IN_DESCR_SIZE)
68#define OUT_BUFFER_SIZE 4096
69
70#define DEFAULT_FRAME_RATE 0
71#define DEFAULT_WORD_RATE 7
72
73/* NOTE: Enabling some debug will likely cause overrun or underrun,
74 * especially if manual mode is use.
75 */
76#define DEBUG(x)
77#define DEBUGREAD(x)
78#define DEBUGWRITE(x)
79#define DEBUGPOLL(x)
80#define DEBUGRXINT(x)
81#define DEBUGTXINT(x)
82
83typedef struct sync_port
84{
85 reg_scope_instances regi_sser;
86 reg_scope_instances regi_dmain;
87 reg_scope_instances regi_dmaout;
88
89 char started; /* 1 if port has been started */
90 char port_nbr; /* Port 0 or 1 */
91 char busy; /* 1 if port is busy */
92
93 char enabled; /* 1 if port is enabled */
94 char use_dma; /* 1 if port uses dma */
95 char tr_running;
96
97 char init_irqs;
98 int output;
99 int input;
100
101 volatile unsigned int out_count; /* Remaining bytes for current transfer */
102 unsigned char* outp; /* Current position in out_buffer */
103 volatile unsigned char* volatile readp; /* Next byte to be read by application */
104 volatile unsigned char* volatile writep; /* Next byte to be written by etrax */
105 unsigned int in_buffer_size;
106 unsigned int inbufchunk;
107 unsigned char out_buffer[OUT_BUFFER_SIZE] __attribute__ ((aligned(32)));
108 unsigned char in_buffer[IN_BUFFER_SIZE]__attribute__ ((aligned(32)));
109 unsigned char flip[IN_BUFFER_SIZE] __attribute__ ((aligned(32)));
110 struct dma_descr_data* next_rx_desc;
111 struct dma_descr_data* prev_rx_desc;
112 int full;
113
114 dma_descr_data in_descr[NUM_IN_DESCR] __attribute__ ((__aligned__(16)));
115 dma_descr_context in_context __attribute__ ((__aligned__(32)));
116 dma_descr_data out_descr __attribute__ ((__aligned__(16)));
117 dma_descr_context out_context __attribute__ ((__aligned__(32)));
118 wait_queue_head_t out_wait_q;
119 wait_queue_head_t in_wait_q;
120
121 spinlock_t lock;
122} sync_port;
123
124static int etrax_sync_serial_init(void);
125static void initialize_port(int portnbr);
126static inline int sync_data_avail(struct sync_port *port);
127
128static int sync_serial_open(struct inode *, struct file*);
129static int sync_serial_release(struct inode*, struct file*);
130static unsigned int sync_serial_poll(struct file *filp, poll_table *wait);
131
132static int sync_serial_ioctl(struct inode*, struct file*,
133 unsigned int cmd, unsigned long arg);
134static ssize_t sync_serial_write(struct file * file, const char * buf,
135 size_t count, loff_t *ppos);
136static ssize_t sync_serial_read(struct file *file, char *buf,
137 size_t count, loff_t *ppos);
138
139#if (defined(CONFIG_ETRAX_SYNCHRONOUS_SERIAL_PORT0) && \
140 defined(CONFIG_ETRAX_SYNCHRONOUS_SERIAL0_DMA)) || \
141 (defined(CONFIG_ETRAX_SYNCHRONOUS_SERIAL_PORT1) && \
142 defined(CONFIG_ETRAX_SYNCHRONOUS_SERIAL1_DMA))
143#define SYNC_SER_DMA
144#endif
145
146static void send_word(sync_port* port);
147static void start_dma(struct sync_port *port, const char* data, int count);
148static void start_dma_in(sync_port* port);
149#ifdef SYNC_SER_DMA
150static irqreturn_t tr_interrupt(int irq, void *dev_id, struct pt_regs * regs);
151static irqreturn_t rx_interrupt(int irq, void *dev_id, struct pt_regs * regs);
152#endif
153
154#if (defined(CONFIG_ETRAX_SYNCHRONOUS_SERIAL_PORT0) && \
155 !defined(CONFIG_ETRAX_SYNCHRONOUS_SERIAL0_DMA)) || \
156 (defined(CONFIG_ETRAX_SYNCHRONOUS_SERIAL_PORT1) && \
157 !defined(CONFIG_ETRAX_SYNCHRONOUS_SERIAL1_DMA))
158#define SYNC_SER_MANUAL
159#endif
160#ifdef SYNC_SER_MANUAL
161static irqreturn_t manual_interrupt(int irq, void *dev_id, struct pt_regs * regs);
162#endif
163
164/* The ports */
165static struct sync_port ports[]=
166{
167 {
168 .regi_sser = regi_sser0,
169 .regi_dmaout = regi_dma4,
170 .regi_dmain = regi_dma5,
171#if defined(CONFIG_ETRAX_SYNCHRONOUS_SERIAL0_DMA)
172 .use_dma = 1,
173#else
174 .use_dma = 0,
175#endif
176 },
177 {
178 .regi_sser = regi_sser1,
179 .regi_dmaout = regi_dma6,
180 .regi_dmain = regi_dma7,
181#if defined(CONFIG_ETRAX_SYNCHRONOUS_SERIAL1_DMA)
182 .use_dma = 1,
183#else
184 .use_dma = 0,
185#endif
186 }
187};
188
189#define NUMBER_OF_PORTS (sizeof(ports)/sizeof(sync_port))
190
191static struct file_operations sync_serial_fops = {
192 .owner = THIS_MODULE,
193 .write = sync_serial_write,
194 .read = sync_serial_read,
195 .poll = sync_serial_poll,
196 .ioctl = sync_serial_ioctl,
197 .open = sync_serial_open,
198 .release = sync_serial_release
199};
200
201static int __init etrax_sync_serial_init(void)
202{
203 ports[0].enabled = 0;
204 ports[1].enabled = 0;
205
206 if (register_chrdev(SYNC_SERIAL_MAJOR,"sync serial", &sync_serial_fops) <0 )
207 {
208 printk("unable to get major for synchronous serial port\n");
209 return -EBUSY;
210 }
211
212 /* Initialize Ports */
213#if defined(CONFIG_ETRAX_SYNCHRONOUS_SERIAL_PORT0)
214 if (crisv32_pinmux_alloc_fixed(pinmux_sser0))
215 {
216 printk("Unable to allocate pins for syncrhronous serial port 0\n");
217 return -EIO;
218 }
219 ports[0].enabled = 1;
220 initialize_port(0);
221#endif
222
223#if defined(CONFIG_ETRAX_SYNCHRONOUS_SERIAL_PORT1)
224 if (crisv32_pinmux_alloc_fixed(pinmux_sser1))
225 {
226 printk("Unable to allocate pins for syncrhronous serial port 0\n");
227 return -EIO;
228 }
229 ports[1].enabled = 1;
230 initialize_port(1);
231#endif
232
233 printk("ETRAX FS synchronous serial port driver\n");
234 return 0;
235}
236
237static void __init initialize_port(int portnbr)
238{
239 struct sync_port* port = &ports[portnbr];
240 reg_sser_rw_cfg cfg = {0};
241 reg_sser_rw_frm_cfg frm_cfg = {0};
242 reg_sser_rw_tr_cfg tr_cfg = {0};
243 reg_sser_rw_rec_cfg rec_cfg = {0};
244
245 DEBUG(printk("Init sync serial port %d\n", portnbr));
246
247 port->port_nbr = portnbr;
248 port->init_irqs = 1;
249
250 port->outp = port->out_buffer;
251 port->output = 1;
252 port->input = 0;
253
254 port->readp = port->flip;
255 port->writep = port->flip;
256 port->in_buffer_size = IN_BUFFER_SIZE;
257 port->inbufchunk = IN_DESCR_SIZE;
258 port->next_rx_desc = &port->in_descr[0];
259 port->prev_rx_desc = &port->in_descr[NUM_IN_DESCR-1];
260 port->prev_rx_desc->eol = 1;
261
262 init_waitqueue_head(&port->out_wait_q);
263 init_waitqueue_head(&port->in_wait_q);
264
265 spin_lock_init(&port->lock);
266
267 cfg.out_clk_src = regk_sser_intern_clk;
268 cfg.out_clk_pol = regk_sser_pos;
269 cfg.clk_od_mode = regk_sser_no;
270 cfg.clk_dir = regk_sser_out;
271 cfg.gate_clk = regk_sser_no;
272 cfg.base_freq = regk_sser_f29_493;
273 cfg.clk_div = 256;
274 REG_WR(sser, port->regi_sser, rw_cfg, cfg);
275
276 frm_cfg.wordrate = DEFAULT_WORD_RATE;
277 frm_cfg.type = regk_sser_edge;
278 frm_cfg.frame_pin_dir = regk_sser_out;
279 frm_cfg.frame_pin_use = regk_sser_frm;
280 frm_cfg.status_pin_dir = regk_sser_in;
281 frm_cfg.status_pin_use = regk_sser_hold;
282 frm_cfg.out_on = regk_sser_tr;
283 frm_cfg.tr_delay = 1;
284 REG_WR(sser, port->regi_sser, rw_frm_cfg, frm_cfg);
285
286 tr_cfg.urun_stop = regk_sser_no;
287 tr_cfg.sample_size = 7;
288 tr_cfg.sh_dir = regk_sser_msbfirst;
289 tr_cfg.use_dma = port->use_dma ? regk_sser_yes : regk_sser_no;
290 tr_cfg.rate_ctrl = regk_sser_bulk;
291 tr_cfg.data_pin_use = regk_sser_dout;
292 tr_cfg.bulk_wspace = 1;
293 REG_WR(sser, port->regi_sser, rw_tr_cfg, tr_cfg);
294
295 rec_cfg.sample_size = 7;
296 rec_cfg.sh_dir = regk_sser_msbfirst;
297 rec_cfg.use_dma = port->use_dma ? regk_sser_yes : regk_sser_no;
298 rec_cfg.fifo_thr = regk_sser_inf;
299 REG_WR(sser, port->regi_sser, rw_rec_cfg, rec_cfg);
300}
301
302static inline int sync_data_avail(struct sync_port *port)
303{
304 int avail;
305 unsigned char *start;
306 unsigned char *end;
307
308 start = (unsigned char*)port->readp; /* cast away volatile */
309 end = (unsigned char*)port->writep; /* cast away volatile */
310 /* 0123456789 0123456789
311 * ----- - -----
312 * ^rp ^wp ^wp ^rp
313 */
314
315 if (end >= start)
316 avail = end - start;
317 else
318 avail = port->in_buffer_size - (start - end);
319 return avail;
320}
321
322static inline int sync_data_avail_to_end(struct sync_port *port)
323{
324 int avail;
325 unsigned char *start;
326 unsigned char *end;
327
328 start = (unsigned char*)port->readp; /* cast away volatile */
329 end = (unsigned char*)port->writep; /* cast away volatile */
330 /* 0123456789 0123456789
331 * ----- -----
332 * ^rp ^wp ^wp ^rp
333 */
334
335 if (end >= start)
336 avail = end - start;
337 else
338 avail = port->flip + port->in_buffer_size - start;
339 return avail;
340}
341
342static int sync_serial_open(struct inode *inode, struct file *file)
343{
344 int dev = MINOR(inode->i_rdev);
345 sync_port* port;
346 reg_dma_rw_cfg cfg = {.en = regk_dma_yes};
347 reg_dma_rw_intr_mask intr_mask = {.data = regk_dma_yes};
348
349 DEBUG(printk("Open sync serial port %d\n", dev));
350
351 if (dev < 0 || dev >= NUMBER_OF_PORTS || !ports[dev].enabled)
352 {
353 DEBUG(printk("Invalid minor %d\n", dev));
354 return -ENODEV;
355 }
356 port = &ports[dev];
357 /* Allow open this device twice (assuming one reader and one writer) */
358 if (port->busy == 2)
359 {
360 DEBUG(printk("Device is busy.. \n"));
361 return -EBUSY;
362 }
363 if (port->init_irqs) {
364 if (port->use_dma) {
365 if (port == &ports[0]){
366#ifdef SYNC_SER_DMA
367 if(request_irq(DMA4_INTR_VECT,
368 tr_interrupt,
369 0,
370 "synchronous serial 0 dma tr",
371 &ports[0])) {
372 printk(KERN_CRIT "Can't allocate sync serial port 0 IRQ");
373 return -EBUSY;
374 } else if(request_irq(DMA5_INTR_VECT,
375 rx_interrupt,
376 0,
377 "synchronous serial 1 dma rx",
378 &ports[0])) {
379 free_irq(DMA4_INTR_VECT, &port[0]);
380 printk(KERN_CRIT "Can't allocate sync serial port 0 IRQ");
381 return -EBUSY;
382 } else if (crisv32_request_dma(SYNC_SER0_TX_DMA_NBR,
383 "synchronous serial 0 dma tr",
384 DMA_VERBOSE_ON_ERROR,
385 0,
386 dma_sser0)) {
387 free_irq(DMA4_INTR_VECT, &port[0]);
388 free_irq(DMA5_INTR_VECT, &port[0]);
389 printk(KERN_CRIT "Can't allocate sync serial port 0 TX DMA channel");
390 return -EBUSY;
391 } else if (crisv32_request_dma(SYNC_SER0_RX_DMA_NBR,
392 "synchronous serial 0 dma rec",
393 DMA_VERBOSE_ON_ERROR,
394 0,
395 dma_sser0)) {
396 crisv32_free_dma(SYNC_SER0_TX_DMA_NBR);
397 free_irq(DMA4_INTR_VECT, &port[0]);
398 free_irq(DMA5_INTR_VECT, &port[0]);
399 printk(KERN_CRIT "Can't allocate sync serial port 1 RX DMA channel");
400 return -EBUSY;
401 }
402#endif
403 }
404 else if (port == &ports[1]){
405#ifdef SYNC_SER_DMA
406 if (request_irq(DMA6_INTR_VECT,
407 tr_interrupt,
408 0,
409 "synchronous serial 1 dma tr",
410 &ports[1])) {
411 printk(KERN_CRIT "Can't allocate sync serial port 1 IRQ");
412 return -EBUSY;
413 } else if (request_irq(DMA7_INTR_VECT,
414 rx_interrupt,
415 0,
416 "synchronous serial 1 dma rx",
417 &ports[1])) {
418 free_irq(DMA6_INTR_VECT, &ports[1]);
419 printk(KERN_CRIT "Can't allocate sync serial port 3 IRQ");
420 return -EBUSY;
421 } else if (crisv32_request_dma(SYNC_SER1_TX_DMA_NBR,
422 "synchronous serial 1 dma tr",
423 DMA_VERBOSE_ON_ERROR,
424 0,
425 dma_sser1)) {
426 free_irq(21, &ports[1]);
427 free_irq(20, &ports[1]);
428 printk(KERN_CRIT "Can't allocate sync serial port 3 TX DMA channel");
429 return -EBUSY;
430 } else if (crisv32_request_dma(SYNC_SER1_RX_DMA_NBR,
431 "synchronous serial 3 dma rec",
432 DMA_VERBOSE_ON_ERROR,
433 0,
434 dma_sser1)) {
435 crisv32_free_dma(SYNC_SER1_TX_DMA_NBR);
436 free_irq(DMA6_INTR_VECT, &ports[1]);
437 free_irq(DMA7_INTR_VECT, &ports[1]);
438 printk(KERN_CRIT "Can't allocate sync serial port 3 RX DMA channel");
439 return -EBUSY;
440 }
441#endif
442 }
443
444 /* Enable DMAs */
445 REG_WR(dma, port->regi_dmain, rw_cfg, cfg);
446 REG_WR(dma, port->regi_dmaout, rw_cfg, cfg);
447 /* Enable DMA IRQs */
448 REG_WR(dma, port->regi_dmain, rw_intr_mask, intr_mask);
449 REG_WR(dma, port->regi_dmaout, rw_intr_mask, intr_mask);
450 /* Set up wordsize = 2 for DMAs. */
451 DMA_WR_CMD (port->regi_dmain, regk_dma_set_w_size1);
452 DMA_WR_CMD (port->regi_dmaout, regk_dma_set_w_size1);
453
454 start_dma_in(port);
455 port->init_irqs = 0;
456 } else { /* !port->use_dma */
457#ifdef SYNC_SER_MANUAL
458 if (port == &ports[0]) {
459 if (request_irq(SSER0_INTR_VECT,
460 manual_interrupt,
461 0,
462 "synchronous serial manual irq",
463 &ports[0])) {
464 printk("Can't allocate sync serial manual irq");
465 return -EBUSY;
466 }
467 } else if (port == &ports[1]) {
468 if (request_irq(SSER1_INTR_VECT,
469 manual_interrupt,
470 0,
471 "synchronous serial manual irq",
472 &ports[1])) {
473 printk(KERN_CRIT "Can't allocate sync serial manual irq");
474 return -EBUSY;
475 }
476 }
477 port->init_irqs = 0;
478#else
479 panic("sync_serial: Manual mode not supported.\n");
480#endif /* SYNC_SER_MANUAL */
481 }
482 } /* port->init_irqs */
483
484 port->busy++;
485 return 0;
486}
487
488static int sync_serial_release(struct inode *inode, struct file *file)
489{
490 int dev = MINOR(inode->i_rdev);
491 sync_port* port;
492
493 if (dev < 0 || dev >= NUMBER_OF_PORTS || !ports[dev].enabled)
494 {
495 DEBUG(printk("Invalid minor %d\n", dev));
496 return -ENODEV;
497 }
498 port = &ports[dev];
499 if (port->busy)
500 port->busy--;
501 if (!port->busy)
502 /* XXX */ ;
503 return 0;
504}
505
506static unsigned int sync_serial_poll(struct file *file, poll_table *wait)
507{
508 int dev = MINOR(file->f_dentry->d_inode->i_rdev);
509 unsigned int mask = 0;
510 sync_port* port;
511 DEBUGPOLL( static unsigned int prev_mask = 0; );
512
513 port = &ports[dev];
514 poll_wait(file, &port->out_wait_q, wait);
515 poll_wait(file, &port->in_wait_q, wait);
516 /* Some room to write */
517 if (port->out_count < OUT_BUFFER_SIZE)
518 mask |= POLLOUT | POLLWRNORM;
519 /* At least an inbufchunk of data */
520 if (sync_data_avail(port) >= port->inbufchunk)
521 mask |= POLLIN | POLLRDNORM;
522
523 DEBUGPOLL(if (mask != prev_mask)
524 printk("sync_serial_poll: mask 0x%08X %s %s\n", mask,
525 mask&POLLOUT?"POLLOUT":"", mask&POLLIN?"POLLIN":"");
526 prev_mask = mask;
527 );
528 return mask;
529}
530
531static int sync_serial_ioctl(struct inode *inode, struct file *file,
532 unsigned int cmd, unsigned long arg)
533{
534 int return_val = 0;
535 int dev = MINOR(file->f_dentry->d_inode->i_rdev);
536 sync_port* port;
537 reg_sser_rw_tr_cfg tr_cfg;
538 reg_sser_rw_rec_cfg rec_cfg;
539 reg_sser_rw_frm_cfg frm_cfg;
540 reg_sser_rw_cfg gen_cfg;
541 reg_sser_rw_intr_mask intr_mask;
542
543 if (dev < 0 || dev >= NUMBER_OF_PORTS || !ports[dev].enabled)
544 {
545 DEBUG(printk("Invalid minor %d\n", dev));
546 return -1;
547 }
548 port = &ports[dev];
549 spin_lock_irq(&port->lock);
550
551 tr_cfg = REG_RD(sser, port->regi_sser, rw_tr_cfg);
552 rec_cfg = REG_RD(sser, port->regi_sser, rw_rec_cfg);
553 frm_cfg = REG_RD(sser, port->regi_sser, rw_frm_cfg);
554 gen_cfg = REG_RD(sser, port->regi_sser, rw_cfg);
555 intr_mask = REG_RD(sser, port->regi_sser, rw_intr_mask);
556
557 switch(cmd)
558 {
559 case SSP_SPEED:
560 if (GET_SPEED(arg) == CODEC)
561 {
562 gen_cfg.base_freq = regk_sser_f32;
563 /* FREQ = 0 => 4 MHz => clk_div = 7*/
564 gen_cfg.clk_div = 6 + (1 << GET_FREQ(arg));
565 }
566 else
567 {
568 gen_cfg.base_freq = regk_sser_f29_493;
569 switch (GET_SPEED(arg))
570 {
571 case SSP150:
572 gen_cfg.clk_div = 29493000 / (150 * 8) - 1;
573 break;
574 case SSP300:
575 gen_cfg.clk_div = 29493000 / (300 * 8) - 1;
576 break;
577 case SSP600:
578 gen_cfg.clk_div = 29493000 / (600 * 8) - 1;
579 break;
580 case SSP1200:
581 gen_cfg.clk_div = 29493000 / (1200 * 8) - 1;
582 break;
583 case SSP2400:
584 gen_cfg.clk_div = 29493000 / (2400 * 8) - 1;
585 break;
586 case SSP4800:
587 gen_cfg.clk_div = 29493000 / (4800 * 8) - 1;
588 break;
589 case SSP9600:
590 gen_cfg.clk_div = 29493000 / (9600 * 8) - 1;
591 break;
592 case SSP19200:
593 gen_cfg.clk_div = 29493000 / (19200 * 8) - 1;
594 break;
595 case SSP28800:
596 gen_cfg.clk_div = 29493000 / (28800 * 8) - 1;
597 break;
598 case SSP57600:
599 gen_cfg.clk_div = 29493000 / (57600 * 8) - 1;
600 break;
601 case SSP115200:
602 gen_cfg.clk_div = 29493000 / (115200 * 8) - 1;
603 break;
604 case SSP230400:
605 gen_cfg.clk_div = 29493000 / (230400 * 8) - 1;
606 break;
607 case SSP460800:
608 gen_cfg.clk_div = 29493000 / (460800 * 8) - 1;
609 break;
610 case SSP921600:
611 gen_cfg.clk_div = 29493000 / (921600 * 8) - 1;
612 break;
613 case SSP3125000:
614 gen_cfg.base_freq = regk_sser_f100;
615 gen_cfg.clk_div = 100000000 / (3125000 * 8) - 1;
616 break;
617
618 }
619 }
620 frm_cfg.wordrate = GET_WORD_RATE(arg);
621
622 break;
623 case SSP_MODE:
624 switch(arg)
625 {
626 case MASTER_OUTPUT:
627 port->output = 1;
628 port->input = 0;
629 gen_cfg.clk_dir = regk_sser_out;
630 break;
631 case SLAVE_OUTPUT:
632 port->output = 1;
633 port->input = 0;
634 gen_cfg.clk_dir = regk_sser_in;
635 break;
636 case MASTER_INPUT:
637 port->output = 0;
638 port->input = 1;
639 gen_cfg.clk_dir = regk_sser_out;
640 break;
641 case SLAVE_INPUT:
642 port->output = 0;
643 port->input = 1;
644 gen_cfg.clk_dir = regk_sser_in;
645 break;
646 case MASTER_BIDIR:
647 port->output = 1;
648 port->input = 1;
649 gen_cfg.clk_dir = regk_sser_out;
650 break;
651 case SLAVE_BIDIR:
652 port->output = 1;
653 port->input = 1;
654 gen_cfg.clk_dir = regk_sser_in;
655 break;
656 default:
657 spin_unlock_irq(&port->lock);
658 return -EINVAL;
659
660 }
661 if (!port->use_dma || (arg == MASTER_OUTPUT || arg == SLAVE_OUTPUT))
662 intr_mask.rdav = regk_sser_yes;
663 break;
664 case SSP_FRAME_SYNC:
665 if (arg & NORMAL_SYNC)
666 frm_cfg.tr_delay = 1;
667 else if (arg & EARLY_SYNC)
668 frm_cfg.tr_delay = 0;
669
670 tr_cfg.bulk_wspace = frm_cfg.tr_delay;
671 frm_cfg.early_wend = regk_sser_yes;
672 if (arg & BIT_SYNC)
673 frm_cfg.type = regk_sser_edge;
674 else if (arg & WORD_SYNC)
675 frm_cfg.type = regk_sser_level;
676 else if (arg & EXTENDED_SYNC)
677 frm_cfg.early_wend = regk_sser_no;
678
679 if (arg & SYNC_ON)
680 frm_cfg.frame_pin_use = regk_sser_frm;
681 else if (arg & SYNC_OFF)
682 frm_cfg.frame_pin_use = regk_sser_gio0;
683
684 if (arg & WORD_SIZE_8)
685 rec_cfg.sample_size = tr_cfg.sample_size = 7;
686 else if (arg & WORD_SIZE_12)
687 rec_cfg.sample_size = tr_cfg.sample_size = 11;
688 else if (arg & WORD_SIZE_16)
689 rec_cfg.sample_size = tr_cfg.sample_size = 15;
690 else if (arg & WORD_SIZE_24)
691 rec_cfg.sample_size = tr_cfg.sample_size = 23;
692 else if (arg & WORD_SIZE_32)
693 rec_cfg.sample_size = tr_cfg.sample_size = 31;
694
695 if (arg & BIT_ORDER_MSB)
696 rec_cfg.sh_dir = tr_cfg.sh_dir = regk_sser_msbfirst;
697 else if (arg & BIT_ORDER_LSB)
698 rec_cfg.sh_dir = tr_cfg.sh_dir = regk_sser_lsbfirst;
699
700 if (arg & FLOW_CONTROL_ENABLE)
701 rec_cfg.fifo_thr = regk_sser_thr16;
702 else if (arg & FLOW_CONTROL_DISABLE)
703 rec_cfg.fifo_thr = regk_sser_inf;
704
705 if (arg & CLOCK_NOT_GATED)
706 gen_cfg.gate_clk = regk_sser_no;
707 else if (arg & CLOCK_GATED)
708 gen_cfg.gate_clk = regk_sser_yes;
709
710 break;
711 case SSP_IPOLARITY:
712 /* NOTE!! negedge is considered NORMAL */
713 if (arg & CLOCK_NORMAL)
714 rec_cfg.clk_pol = regk_sser_neg;
715 else if (arg & CLOCK_INVERT)
716 rec_cfg.clk_pol = regk_sser_pos;
717
718 if (arg & FRAME_NORMAL)
719 frm_cfg.level = regk_sser_pos_hi;
720 else if (arg & FRAME_INVERT)
721 frm_cfg.level = regk_sser_neg_lo;
722
723 if (arg & STATUS_NORMAL)
724 gen_cfg.hold_pol = regk_sser_pos;
725 else if (arg & STATUS_INVERT)
726 gen_cfg.hold_pol = regk_sser_neg;
727 break;
728 case SSP_OPOLARITY:
729 if (arg & CLOCK_NORMAL)
730 gen_cfg.out_clk_pol = regk_sser_neg;
731 else if (arg & CLOCK_INVERT)
732 gen_cfg.out_clk_pol = regk_sser_pos;
733
734 if (arg & FRAME_NORMAL)
735 frm_cfg.level = regk_sser_pos_hi;
736 else if (arg & FRAME_INVERT)
737 frm_cfg.level = regk_sser_neg_lo;
738
739 if (arg & STATUS_NORMAL)
740 gen_cfg.hold_pol = regk_sser_pos;
741 else if (arg & STATUS_INVERT)
742 gen_cfg.hold_pol = regk_sser_neg;
743 break;
744 case SSP_SPI:
745 rec_cfg.fifo_thr = regk_sser_inf;
746 rec_cfg.sh_dir = tr_cfg.sh_dir = regk_sser_msbfirst;
747 rec_cfg.sample_size = tr_cfg.sample_size = 7;
748 frm_cfg.frame_pin_use = regk_sser_frm;
749 frm_cfg.type = regk_sser_level;
750 frm_cfg.tr_delay = 1;
751 frm_cfg.level = regk_sser_neg_lo;
752 if (arg & SPI_SLAVE)
753 {
754 rec_cfg.clk_pol = regk_sser_neg;
755 gen_cfg.clk_dir = regk_sser_in;
756 port->input = 1;
757 port->output = 0;
758 }
759 else
760 {
761 gen_cfg.out_clk_pol = regk_sser_pos;
762 port->input = 0;
763 port->output = 1;
764 gen_cfg.clk_dir = regk_sser_out;
765 }
766 break;
767 case SSP_INBUFCHUNK:
768 break;
769 default:
770 return_val = -1;
771 }
772
773
774 if (port->started)
775 {
776 tr_cfg.tr_en = port->output;
777 rec_cfg.rec_en = port->input;
778 }
779
780 REG_WR(sser, port->regi_sser, rw_tr_cfg, tr_cfg);
781 REG_WR(sser, port->regi_sser, rw_rec_cfg, rec_cfg);
782 REG_WR(sser, port->regi_sser, rw_frm_cfg, frm_cfg);
783 REG_WR(sser, port->regi_sser, rw_intr_mask, intr_mask);
784 REG_WR(sser, port->regi_sser, rw_cfg, gen_cfg);
785
786 spin_unlock_irq(&port->lock);
787 return return_val;
788}
789
790static ssize_t sync_serial_write(struct file * file, const char * buf,
791 size_t count, loff_t *ppos)
792{
793 int dev = MINOR(file->f_dentry->d_inode->i_rdev);
794 DECLARE_WAITQUEUE(wait, current);
795 sync_port *port;
796 unsigned long c, c1;
797 unsigned long free_outp;
798 unsigned long outp;
799 unsigned long out_buffer;
800 unsigned long flags;
801
802 if (dev < 0 || dev >= NUMBER_OF_PORTS || !ports[dev].enabled)
803 {
804 DEBUG(printk("Invalid minor %d\n", dev));
805 return -ENODEV;
806 }
807 port = &ports[dev];
808
809 DEBUGWRITE(printk("W d%d c %lu (%d/%d)\n", port->port_nbr, count, port->out_count, OUT_BUFFER_SIZE));
810 /* Space to end of buffer */
811 /*
812 * out_buffer <c1>012345<- c ->OUT_BUFFER_SIZE
813 * outp^ +out_count
814 ^free_outp
815 * out_buffer 45<- c ->0123OUT_BUFFER_SIZE
816 * +out_count outp^
817 * free_outp
818 *
819 */
820
821 /* Read variables that may be updated by interrupts */
822 spin_lock_irqsave(&port->lock, flags);
823 count = count > OUT_BUFFER_SIZE - port->out_count ? OUT_BUFFER_SIZE - port->out_count : count;
824 outp = (unsigned long)port->outp;
825 free_outp = outp + port->out_count;
826 spin_unlock_irqrestore(&port->lock, flags);
827 out_buffer = (unsigned long)port->out_buffer;
828
829 /* Find out where and how much to write */
830 if (free_outp >= out_buffer + OUT_BUFFER_SIZE)
831 free_outp -= OUT_BUFFER_SIZE;
832 if (free_outp >= outp)
833 c = out_buffer + OUT_BUFFER_SIZE - free_outp;
834 else
835 c = outp - free_outp;
836 if (c > count)
837 c = count;
838
839// DEBUGWRITE(printk("w op %08lX fop %08lX c %lu\n", outp, free_outp, c));
840 if (copy_from_user((void*)free_outp, buf, c))
841 return -EFAULT;
842
843 if (c != count) {
844 buf += c;
845 c1 = count - c;
846 DEBUGWRITE(printk("w2 fi %lu c %lu c1 %lu\n", free_outp-out_buffer, c, c1));
847 if (copy_from_user((void*)out_buffer, buf, c1))
848 return -EFAULT;
849 }
850 spin_lock_irqsave(&port->lock, flags);
851 port->out_count += count;
852 spin_unlock_irqrestore(&port->lock, flags);
853
854 /* Make sure transmitter/receiver is running */
855 if (!port->started)
856 {
857 reg_sser_rw_cfg cfg = REG_RD(sser, port->regi_sser, rw_cfg);
858 reg_sser_rw_tr_cfg tr_cfg = REG_RD(sser, port->regi_sser, rw_tr_cfg);
859 reg_sser_rw_rec_cfg rec_cfg = REG_RD(sser, port->regi_sser, rw_rec_cfg);
860 cfg.en = regk_sser_yes;
861 tr_cfg.tr_en = port->output;
862 rec_cfg.rec_en = port->input;
863 REG_WR(sser, port->regi_sser, rw_cfg, cfg);
864 REG_WR(sser, port->regi_sser, rw_tr_cfg, tr_cfg);
865 REG_WR(sser, port->regi_sser, rw_rec_cfg, rec_cfg);
866 port->started = 1;
867 }
868
869 if (file->f_flags & O_NONBLOCK) {
870 spin_lock_irqsave(&port->lock, flags);
871 if (!port->tr_running) {
872 if (!port->use_dma) {
873 reg_sser_rw_intr_mask intr_mask;
874 intr_mask = REG_RD(sser, port->regi_sser, rw_intr_mask);
875 /* Start sender by writing data */
876 send_word(port);
877 /* and enable transmitter ready IRQ */
878 intr_mask.trdy = 1;
879 REG_WR(sser, port->regi_sser, rw_intr_mask, intr_mask);
880 } else {
881 start_dma(port, (unsigned char* volatile )port->outp, c);
882 }
883 }
884 spin_unlock_irqrestore(&port->lock, flags);
885 DEBUGWRITE(printk("w d%d c %lu NB\n",
886 port->port_nbr, count));
887 return count;
888 }
889
890 /* Sleep until all sent */
891
892 add_wait_queue(&port->out_wait_q, &wait);
893 set_current_state(TASK_INTERRUPTIBLE);
894 spin_lock_irqsave(&port->lock, flags);
895 if (!port->tr_running) {
896 if (!port->use_dma) {
897 reg_sser_rw_intr_mask intr_mask;
898 intr_mask = REG_RD(sser, port->regi_sser, rw_intr_mask);
899 /* Start sender by writing data */
900 send_word(port);
901 /* and enable transmitter ready IRQ */
902 intr_mask.trdy = 1;
903 REG_WR(sser, port->regi_sser, rw_intr_mask, intr_mask);
904 } else {
905 start_dma(port, port->outp, c);
906 }
907 }
908 spin_unlock_irqrestore(&port->lock, flags);
909 schedule();
910 set_current_state(TASK_RUNNING);
911 remove_wait_queue(&port->out_wait_q, &wait);
912 if (signal_pending(current))
913 {
914 return -EINTR;
915 }
916 DEBUGWRITE(printk("w d%d c %lu\n", port->port_nbr, count));
917 return count;
918}
919
920static ssize_t sync_serial_read(struct file * file, char * buf,
921 size_t count, loff_t *ppos)
922{
923 int dev = MINOR(file->f_dentry->d_inode->i_rdev);
924 int avail;
925 sync_port *port;
926 unsigned char* start;
927 unsigned char* end;
928 unsigned long flags;
929
930 if (dev < 0 || dev >= NUMBER_OF_PORTS || !ports[dev].enabled)
931 {
932 DEBUG(printk("Invalid minor %d\n", dev));
933 return -ENODEV;
934 }
935 port = &ports[dev];
936
937 DEBUGREAD(printk("R%d c %d ri %lu wi %lu /%lu\n", dev, count, port->readp - port->flip, port->writep - port->flip, port->in_buffer_size));
938
939 if (!port->started)
940 {
941 reg_sser_rw_cfg cfg = REG_RD(sser, port->regi_sser, rw_cfg);
942 reg_sser_rw_tr_cfg tr_cfg = REG_RD(sser, port->regi_sser, rw_tr_cfg);
943 reg_sser_rw_rec_cfg rec_cfg = REG_RD(sser, port->regi_sser, rw_rec_cfg);
944 cfg.en = regk_sser_yes;
945 tr_cfg.tr_en = regk_sser_yes;
946 rec_cfg.rec_en = regk_sser_yes;
947 REG_WR(sser, port->regi_sser, rw_cfg, cfg);
948 REG_WR(sser, port->regi_sser, rw_tr_cfg, tr_cfg);
949 REG_WR(sser, port->regi_sser, rw_rec_cfg, rec_cfg);
950 port->started = 1;
951 }
952
953
954 /* Calculate number of available bytes */
955 /* Save pointers to avoid that they are modified by interrupt */
956 spin_lock_irqsave(&port->lock, flags);
957 start = (unsigned char*)port->readp; /* cast away volatile */
958 end = (unsigned char*)port->writep; /* cast away volatile */
959 spin_unlock_irqrestore(&port->lock, flags);
960 while ((start == end) && !port->full) /* No data */
961 {
962 if (file->f_flags & O_NONBLOCK)
963 {
964 return -EAGAIN;
965 }
966
967 interruptible_sleep_on(&port->in_wait_q);
968 if (signal_pending(current))
969 {
970 return -EINTR;
971 }
972 spin_lock_irqsave(&port->lock, flags);
973 start = (unsigned char*)port->readp; /* cast away volatile */
974 end = (unsigned char*)port->writep; /* cast away volatile */
975 spin_unlock_irqrestore(&port->lock, flags);
976 }
977
978 /* Lazy read, never return wrapped data. */
979 if (port->full)
980 avail = port->in_buffer_size;
981 else if (end > start)
982 avail = end - start;
983 else
984 avail = port->flip + port->in_buffer_size - start;
985
986 count = count > avail ? avail : count;
987 if (copy_to_user(buf, start, count))
988 return -EFAULT;
989 /* Disable interrupts while updating readp */
990 spin_lock_irqsave(&port->lock, flags);
991 port->readp += count;
992 if (port->readp >= port->flip + port->in_buffer_size) /* Wrap? */
993 port->readp = port->flip;
994 port->full = 0;
995 spin_unlock_irqrestore(&port->lock, flags);
996 DEBUGREAD(printk("r %d\n", count));
997 return count;
998}
999
1000static void send_word(sync_port* port)
1001{
1002 reg_sser_rw_tr_cfg tr_cfg = REG_RD(sser, port->regi_sser, rw_tr_cfg);
1003 reg_sser_rw_tr_data tr_data = {0};
1004
1005 switch(tr_cfg.sample_size)
1006 {
1007 case 8:
1008 port->out_count--;
1009 tr_data.data = *port->outp++;
1010 REG_WR(sser, port->regi_sser, rw_tr_data, tr_data);
1011 if (port->outp >= port->out_buffer + OUT_BUFFER_SIZE)
1012 port->outp = port->out_buffer;
1013 break;
1014 case 12:
1015 {
1016 int data = (*port->outp++) << 8;
1017 data |= *port->outp++;
1018 port->out_count-=2;
1019 tr_data.data = data;
1020 REG_WR(sser, port->regi_sser, rw_tr_data, tr_data);
1021 if (port->outp >= port->out_buffer + OUT_BUFFER_SIZE)
1022 port->outp = port->out_buffer;
1023 }
1024 break;
1025 case 16:
1026 port->out_count-=2;
1027 tr_data.data = *(unsigned short *)port->outp;
1028 REG_WR(sser, port->regi_sser, rw_tr_data, tr_data);
1029 port->outp+=2;
1030 if (port->outp >= port->out_buffer + OUT_BUFFER_SIZE)
1031 port->outp = port->out_buffer;
1032 break;
1033 case 24:
1034 port->out_count-=3;
1035 tr_data.data = *(unsigned short *)port->outp;
1036 REG_WR(sser, port->regi_sser, rw_tr_data, tr_data);
1037 port->outp+=2;
1038 tr_data.data = *port->outp++;
1039 REG_WR(sser, port->regi_sser, rw_tr_data, tr_data);
1040 if (port->outp >= port->out_buffer + OUT_BUFFER_SIZE)
1041 port->outp = port->out_buffer;
1042 break;
1043 case 32:
1044 port->out_count-=4;
1045 tr_data.data = *(unsigned short *)port->outp;
1046 REG_WR(sser, port->regi_sser, rw_tr_data, tr_data);
1047 port->outp+=2;
1048 tr_data.data = *(unsigned short *)port->outp;
1049 REG_WR(sser, port->regi_sser, rw_tr_data, tr_data);
1050 port->outp+=2;
1051 if (port->outp >= port->out_buffer + OUT_BUFFER_SIZE)
1052 port->outp = port->out_buffer;
1053 break;
1054 }
1055}
1056
1057
1058static void start_dma(struct sync_port* port, const char* data, int count)
1059{
1060 port->tr_running = 1;
1061 port->out_descr.buf = (char*)virt_to_phys((char*)data);
1062 port->out_descr.after = port->out_descr.buf + count;
1063 port->out_descr.eol = port->out_descr.intr = 1;
1064
1065 port->out_context.saved_data = (dma_descr_data*)virt_to_phys(&port->out_descr);
1066 port->out_context.saved_data_buf = port->out_descr.buf;
1067
1068 DMA_START_CONTEXT(port->regi_dmaout, virt_to_phys((char*)&port->out_context));
1069 DEBUGTXINT(printk("dma %08lX c %d\n", (unsigned long)data, count));
1070}
1071
1072static void start_dma_in(sync_port* port)
1073{
1074 int i;
1075 char* buf;
1076 port->writep = port->flip;
1077
1078 if (port->writep > port->flip + port->in_buffer_size)
1079 {
1080 panic("Offset too large in sync serial driver\n");
1081 return;
1082 }
1083 buf = (char*)virt_to_phys(port->in_buffer);
1084 for (i = 0; i < NUM_IN_DESCR; i++) {
1085 port->in_descr[i].buf = buf;
1086 port->in_descr[i].after = buf + port->inbufchunk;
1087 port->in_descr[i].intr = 1;
1088 port->in_descr[i].next = (dma_descr_data*)virt_to_phys(&port->in_descr[i+1]);
1089 port->in_descr[i].buf = buf;
1090 buf += port->inbufchunk;
1091 }
1092 /* Link the last descriptor to the first */
1093 port->in_descr[i-1].next = (dma_descr_data*)virt_to_phys(&port->in_descr[0]);
1094 port->in_descr[i-1].eol = regk_sser_yes;
1095 port->next_rx_desc = &port->in_descr[0];
1096 port->prev_rx_desc = &port->in_descr[NUM_IN_DESCR - 1];
1097 port->in_context.saved_data = (dma_descr_data*)virt_to_phys(&port->in_descr[0]);
1098 port->in_context.saved_data_buf = port->in_descr[0].buf;
1099 DMA_START_CONTEXT(port->regi_dmain, virt_to_phys(&port->in_context));
1100}
1101
1102#ifdef SYNC_SER_DMA
1103static irqreturn_t tr_interrupt(int irq, void *dev_id, struct pt_regs * regs)
1104{
1105 reg_dma_r_masked_intr masked;
1106 reg_dma_rw_ack_intr ack_intr = {.data = regk_dma_yes};
1107 int i;
1108 struct dma_descr_data *descr;
1109 unsigned int sentl;
1110 int found = 0;
1111
1112 for (i = 0; i < NUMBER_OF_PORTS; i++)
1113 {
1114 sync_port *port = &ports[i];
1115 if (!port->enabled || !port->use_dma )
1116 continue;
1117
1118 masked = REG_RD(dma, port->regi_dmaout, r_masked_intr);
1119
1120 if (masked.data) /* IRQ active for the port? */
1121 {
1122 found = 1;
1123 /* Clear IRQ */
1124 REG_WR(dma, port->regi_dmaout, rw_ack_intr, ack_intr);
1125 descr = &port->out_descr;
1126 sentl = descr->after - descr->buf;
1127 port->out_count -= sentl;
1128 port->outp += sentl;
1129 if (port->outp >= port->out_buffer + OUT_BUFFER_SIZE)
1130 port->outp = port->out_buffer;
1131 if (port->out_count) {
1132 int c;
1133 c = port->out_buffer + OUT_BUFFER_SIZE - port->outp;
1134 if (c > port->out_count)
1135 c = port->out_count;
1136 DEBUGTXINT(printk("tx_int DMAWRITE %i %i\n", sentl, c));
1137 start_dma(port, port->outp, c);
1138 } else {
1139 DEBUGTXINT(printk("tx_int DMA stop %i\n", sentl));
1140 port->tr_running = 0;
1141 }
1142 wake_up_interruptible(&port->out_wait_q); /* wake up the waiting process */
1143 }
1144 }
1145 return IRQ_RETVAL(found);
1146} /* tr_interrupt */
1147
1148static irqreturn_t rx_interrupt(int irq, void *dev_id, struct pt_regs * regs)
1149{
1150 reg_dma_r_masked_intr masked;
1151 reg_dma_rw_ack_intr ack_intr = {.data = regk_dma_yes};
1152
1153 int i;
1154 int found = 0;
1155
1156 for (i = 0; i < NUMBER_OF_PORTS; i++)
1157 {
1158 sync_port *port = &ports[i];
1159
1160 if (!port->enabled || !port->use_dma )
1161 continue;
1162
1163 masked = REG_RD(dma, port->regi_dmain, r_masked_intr);
1164
1165 if (masked.data) /* Descriptor interrupt */
1166 {
1167 found = 1;
1168 while (REG_RD(dma, port->regi_dmain, rw_data) !=
1169 virt_to_phys(port->next_rx_desc)) {
1170
1171 if (port->writep + port->inbufchunk > port->flip + port->in_buffer_size) {
1172 int first_size = port->flip + port->in_buffer_size - port->writep;
1173 memcpy((char*)port->writep, phys_to_virt((unsigned)port->next_rx_desc->buf), first_size);
1174 memcpy(port->flip, phys_to_virt((unsigned)port->next_rx_desc->buf+first_size), port->inbufchunk - first_size);
1175 port->writep = port->flip + port->inbufchunk - first_size;
1176 } else {
1177 memcpy((char*)port->writep,
1178 phys_to_virt((unsigned)port->next_rx_desc->buf),
1179 port->inbufchunk);
1180 port->writep += port->inbufchunk;
1181 if (port->writep >= port->flip + port->in_buffer_size)
1182 port->writep = port->flip;
1183 }
1184 if (port->writep == port->readp)
1185 {
1186 port->full = 1;
1187 }
1188
1189 port->next_rx_desc->eol = 0;
1190 port->prev_rx_desc->eol = 1;
1191 port->prev_rx_desc = phys_to_virt((unsigned)port->next_rx_desc);
1192 port->next_rx_desc = phys_to_virt((unsigned)port->next_rx_desc->next);
1193 wake_up_interruptible(&port->in_wait_q); /* wake up the waiting process */
1194 DMA_CONTINUE(port->regi_dmain);
1195 REG_WR(dma, port->regi_dmain, rw_ack_intr, ack_intr);
1196
1197 }
1198 }
1199 }
1200 return IRQ_RETVAL(found);
1201} /* rx_interrupt */
1202#endif /* SYNC_SER_DMA */
1203
1204#ifdef SYNC_SER_MANUAL
1205static irqreturn_t manual_interrupt(int irq, void *dev_id, struct pt_regs * regs)
1206{
1207 int i;
1208 int found = 0;
1209 reg_sser_r_masked_intr masked;
1210
1211 for (i = 0; i < NUMBER_OF_PORTS; i++)
1212 {
1213 sync_port* port = &ports[i];
1214
1215 if (!port->enabled || port->use_dma)
1216 {
1217 continue;
1218 }
1219
1220 masked = REG_RD(sser, port->regi_sser, r_masked_intr);
1221 if (masked.rdav) /* Data received? */
1222 {
1223 reg_sser_rw_rec_cfg rec_cfg = REG_RD(sser, port->regi_sser, rw_rec_cfg);
1224 reg_sser_r_rec_data data = REG_RD(sser, port->regi_sser, r_rec_data);
1225 found = 1;
1226 /* Read data */
1227 switch(rec_cfg.sample_size)
1228 {
1229 case 8:
1230 *port->writep++ = data.data & 0xff;
1231 break;
1232 case 12:
1233 *port->writep = (data.data & 0x0ff0) >> 4;
1234 *(port->writep + 1) = data.data & 0x0f;
1235 port->writep+=2;
1236 break;
1237 case 16:
1238 *(unsigned short*)port->writep = data.data;
1239 port->writep+=2;
1240 break;
1241 case 24:
1242 *(unsigned int*)port->writep = data.data;
1243 port->writep+=3;
1244 break;
1245 case 32:
1246 *(unsigned int*)port->writep = data.data;
1247 port->writep+=4;
1248 break;
1249 }
1250
1251 if (port->writep >= port->flip + port->in_buffer_size) /* Wrap? */
1252 port->writep = port->flip;
1253 if (port->writep == port->readp) {
1254 /* receive buffer overrun, discard oldest data
1255 */
1256 port->readp++;
1257 if (port->readp >= port->flip + port->in_buffer_size) /* Wrap? */
1258 port->readp = port->flip;
1259 }
1260 if (sync_data_avail(port) >= port->inbufchunk)
1261 wake_up_interruptible(&port->in_wait_q); /* Wake up application */
1262 }
1263
1264 if (masked.trdy) /* Transmitter ready? */
1265 {
1266 found = 1;
1267 if (port->out_count > 0) /* More data to send */
1268 send_word(port);
1269 else /* transmission finished */
1270 {
1271 reg_sser_rw_intr_mask intr_mask;
1272 intr_mask = REG_RD(sser, port->regi_sser, rw_intr_mask);
1273 intr_mask.trdy = 0;
1274 REG_WR(sser, port->regi_sser, rw_intr_mask, intr_mask);
1275 wake_up_interruptible(&port->out_wait_q); /* Wake up application */
1276 }
1277 }
1278 }
1279 return IRQ_RETVAL(found);
1280}
1281#endif
1282
1283module_init(etrax_sync_serial_init);
diff --git a/arch/cris/arch-v32/kernel/Makefile b/arch/cris/arch-v32/kernel/Makefile
new file mode 100644
index 000000000000..5d5b613cde8c
--- /dev/null
+++ b/arch/cris/arch-v32/kernel/Makefile
@@ -0,0 +1,21 @@
1# $Id: Makefile,v 1.11 2004/12/17 10:16:13 starvik Exp $
2#
3# Makefile for the linux kernel.
4#
5
6extra-y := head.o
7
8
9obj-y := entry.o traps.o irq.o debugport.o dma.o pinmux.o \
10 process.o ptrace.o setup.o signal.o traps.o time.o \
11 arbiter.o io.o
12
13obj-$(CONFIG_ETRAXFS_SIM) += vcs_hook.o
14
15obj-$(CONFIG_SMP) += smp.o
16obj-$(CONFIG_ETRAX_KGDB) += kgdb.o kgdb_asm.o
17obj-$(CONFIG_ETRAX_FAST_TIMER) += fasttimer.o
18obj-$(CONFIG_MODULES) += crisksyms.o
19
20clean:
21
diff --git a/arch/cris/arch-v32/kernel/arbiter.c b/arch/cris/arch-v32/kernel/arbiter.c
new file mode 100644
index 000000000000..3870d2fd5160
--- /dev/null
+++ b/arch/cris/arch-v32/kernel/arbiter.c
@@ -0,0 +1,297 @@
1/*
2 * Memory arbiter functions. Allocates bandwith through the
3 * arbiter and sets up arbiter breakpoints.
4 *
5 * The algorithm first assigns slots to the clients that has specified
6 * bandwith (e.g. ethernet) and then the remaining slots are divided
7 * on all the active clients.
8 *
9 * Copyright (c) 2004, 2005 Axis Communications AB.
10 */
11
12#include <linux/config.h>
13#include <asm/arch/hwregs/reg_map.h>
14#include <asm/arch/hwregs/reg_rdwr.h>
15#include <asm/arch/hwregs/marb_defs.h>
16#include <asm/arch/arbiter.h>
17#include <asm/arch/hwregs/intr_vect.h>
18#include <linux/interrupt.h>
19#include <linux/signal.h>
20#include <linux/errno.h>
21#include <linux/spinlock.h>
22#include <asm/io.h>
23
24struct crisv32_watch_entry
25{
26 unsigned long instance;
27 watch_callback* cb;
28 unsigned long start;
29 unsigned long end;
30 int used;
31};
32
33#define NUMBER_OF_BP 4
34#define NBR_OF_CLIENTS 14
35#define NBR_OF_SLOTS 64
36#define SDRAM_BANDWIDTH 100000000 /* Some kind of expected value */
37#define INTMEM_BANDWIDTH 400000000
38#define NBR_OF_REGIONS 2
39
40static struct crisv32_watch_entry watches[NUMBER_OF_BP] =
41{
42 {regi_marb_bp0},
43 {regi_marb_bp1},
44 {regi_marb_bp2},
45 {regi_marb_bp3}
46};
47
48static int requested_slots[NBR_OF_REGIONS][NBR_OF_CLIENTS];
49static int active_clients[NBR_OF_REGIONS][NBR_OF_CLIENTS];
50static int max_bandwidth[NBR_OF_REGIONS] = {SDRAM_BANDWIDTH, INTMEM_BANDWIDTH};
51
52DEFINE_SPINLOCK(arbiter_lock);
53
54static irqreturn_t
55crisv32_arbiter_irq(int irq, void* dev_id, struct pt_regs* regs);
56
57static void crisv32_arbiter_config(int region)
58{
59 int slot;
60 int client;
61 int interval = 0;
62 int val[NBR_OF_SLOTS];
63
64 for (slot = 0; slot < NBR_OF_SLOTS; slot++)
65 val[slot] = NBR_OF_CLIENTS + 1;
66
67 for (client = 0; client < NBR_OF_CLIENTS; client++)
68 {
69 int pos;
70 if (!requested_slots[region][client])
71 continue;
72 interval = NBR_OF_SLOTS / requested_slots[region][client];
73 pos = 0;
74 while (pos < NBR_OF_SLOTS)
75 {
76 if (val[pos] != NBR_OF_CLIENTS + 1)
77 pos++;
78 else
79 {
80 val[pos] = client;
81 pos += interval;
82 }
83 }
84 }
85
86 client = 0;
87 for (slot = 0; slot < NBR_OF_SLOTS; slot++)
88 {
89 if (val[slot] == NBR_OF_CLIENTS + 1)
90 {
91 int first = client;
92 while(!active_clients[region][client]) {
93 client = (client + 1) % NBR_OF_CLIENTS;
94 if (client == first)
95 break;
96 }
97 val[slot] = client;
98 client = (client + 1) % NBR_OF_CLIENTS;
99 }
100 if (region == EXT_REGION)
101 REG_WR_INT_VECT(marb, regi_marb, rw_ext_slots, slot, val[slot]);
102 else if (region == INT_REGION)
103 REG_WR_INT_VECT(marb, regi_marb, rw_int_slots, slot, val[slot]);
104 }
105}
106
107extern char _stext, _etext;
108
109static void crisv32_arbiter_init(void)
110{
111 static int initialized = 0;
112
113 if (initialized)
114 return;
115
116 initialized = 1;
117
118 /* CPU caches are active. */
119 active_clients[EXT_REGION][10] = active_clients[EXT_REGION][11] = 1;
120 crisv32_arbiter_config(EXT_REGION);
121 crisv32_arbiter_config(INT_REGION);
122
123 if (request_irq(MEMARB_INTR_VECT, crisv32_arbiter_irq, SA_INTERRUPT,
124 "arbiter", NULL))
125 printk(KERN_ERR "Couldn't allocate arbiter IRQ\n");
126
127#ifndef CONFIG_ETRAX_KGDB
128 /* Global watch for writes to kernel text segment. */
129 crisv32_arbiter_watch(virt_to_phys(&_stext), &_etext - &_stext,
130 arbiter_all_clients, arbiter_all_write, NULL);
131#endif
132}
133
134
135
136int crisv32_arbiter_allocate_bandwith(int client, int region,
137 unsigned long bandwidth)
138{
139 int i;
140 int total_assigned = 0;
141 int total_clients = 0;
142 int req;
143
144 crisv32_arbiter_init();
145
146 for (i = 0; i < NBR_OF_CLIENTS; i++)
147 {
148 total_assigned += requested_slots[region][i];
149 total_clients += active_clients[region][i];
150 }
151 req = NBR_OF_SLOTS / (max_bandwidth[region] / bandwidth);
152
153 if (total_assigned + total_clients + req + 1 > NBR_OF_SLOTS)
154 return -ENOMEM;
155
156 active_clients[region][client] = 1;
157 requested_slots[region][client] = req;
158 crisv32_arbiter_config(region);
159
160 return 0;
161}
162
163int crisv32_arbiter_watch(unsigned long start, unsigned long size,
164 unsigned long clients, unsigned long accesses,
165 watch_callback* cb)
166{
167 int i;
168
169 crisv32_arbiter_init();
170
171 if (start > 0x80000000) {
172 printk("Arbiter: %lX doesn't look like a physical address", start);
173 return -EFAULT;
174 }
175
176 spin_lock(&arbiter_lock);
177
178 for (i = 0; i < NUMBER_OF_BP; i++) {
179 if (!watches[i].used) {
180 reg_marb_rw_intr_mask intr_mask = REG_RD(marb, regi_marb, rw_intr_mask);
181
182 watches[i].used = 1;
183 watches[i].start = start;
184 watches[i].end = start + size;
185 watches[i].cb = cb;
186
187 REG_WR_INT(marb_bp, watches[i].instance, rw_first_addr, watches[i].start);
188 REG_WR_INT(marb_bp, watches[i].instance, rw_last_addr, watches[i].end);
189 REG_WR_INT(marb_bp, watches[i].instance, rw_op, accesses);
190 REG_WR_INT(marb_bp, watches[i].instance, rw_clients, clients);
191
192 if (i == 0)
193 intr_mask.bp0 = regk_marb_yes;
194 else if (i == 1)
195 intr_mask.bp1 = regk_marb_yes;
196 else if (i == 2)
197 intr_mask.bp2 = regk_marb_yes;
198 else if (i == 3)
199 intr_mask.bp3 = regk_marb_yes;
200
201 REG_WR(marb, regi_marb, rw_intr_mask, intr_mask);
202 spin_unlock(&arbiter_lock);
203
204 return i;
205 }
206 }
207 spin_unlock(&arbiter_lock);
208 return -ENOMEM;
209}
210
211int crisv32_arbiter_unwatch(int id)
212{
213 reg_marb_rw_intr_mask intr_mask = REG_RD(marb, regi_marb, rw_intr_mask);
214
215 crisv32_arbiter_init();
216
217 spin_lock(&arbiter_lock);
218
219 if ((id < 0) || (id >= NUMBER_OF_BP) || (!watches[id].used)) {
220 spin_unlock(&arbiter_lock);
221 return -EINVAL;
222 }
223
224 memset(&watches[id], 0, sizeof(struct crisv32_watch_entry));
225
226 if (id == 0)
227 intr_mask.bp0 = regk_marb_no;
228 else if (id == 1)
229 intr_mask.bp2 = regk_marb_no;
230 else if (id == 2)
231 intr_mask.bp2 = regk_marb_no;
232 else if (id == 3)
233 intr_mask.bp3 = regk_marb_no;
234
235 REG_WR(marb, regi_marb, rw_intr_mask, intr_mask);
236
237 spin_unlock(&arbiter_lock);
238 return 0;
239}
240
241extern void show_registers(struct pt_regs *regs);
242
243static irqreturn_t
244crisv32_arbiter_irq(int irq, void* dev_id, struct pt_regs* regs)
245{
246 reg_marb_r_masked_intr masked_intr = REG_RD(marb, regi_marb, r_masked_intr);
247 reg_marb_bp_r_brk_clients r_clients;
248 reg_marb_bp_r_brk_addr r_addr;
249 reg_marb_bp_r_brk_op r_op;
250 reg_marb_bp_r_brk_first_client r_first;
251 reg_marb_bp_r_brk_size r_size;
252 reg_marb_bp_rw_ack ack = {0};
253 reg_marb_rw_ack_intr ack_intr = {.bp0=1,.bp1=1,.bp2=1,.bp3=1};
254 struct crisv32_watch_entry* watch;
255
256 if (masked_intr.bp0) {
257 watch = &watches[0];
258 ack_intr.bp0 = regk_marb_yes;
259 } else if (masked_intr.bp1) {
260 watch = &watches[1];
261 ack_intr.bp1 = regk_marb_yes;
262 } else if (masked_intr.bp2) {
263 watch = &watches[2];
264 ack_intr.bp2 = regk_marb_yes;
265 } else if (masked_intr.bp3) {
266 watch = &watches[3];
267 ack_intr.bp3 = regk_marb_yes;
268 } else {
269 return IRQ_NONE;
270 }
271
272 /* Retrieve all useful information and print it. */
273 r_clients = REG_RD(marb_bp, watch->instance, r_brk_clients);
274 r_addr = REG_RD(marb_bp, watch->instance, r_brk_addr);
275 r_op = REG_RD(marb_bp, watch->instance, r_brk_op);
276 r_first = REG_RD(marb_bp, watch->instance, r_brk_first_client);
277 r_size = REG_RD(marb_bp, watch->instance, r_brk_size);
278
279 printk("Arbiter IRQ\n");
280 printk("Clients %X addr %X op %X first %X size %X\n",
281 REG_TYPE_CONV(int, reg_marb_bp_r_brk_clients, r_clients),
282 REG_TYPE_CONV(int, reg_marb_bp_r_brk_addr, r_addr),
283 REG_TYPE_CONV(int, reg_marb_bp_r_brk_op, r_op),
284 REG_TYPE_CONV(int, reg_marb_bp_r_brk_first_client, r_first),
285 REG_TYPE_CONV(int, reg_marb_bp_r_brk_size, r_size));
286
287 REG_WR(marb_bp, watch->instance, rw_ack, ack);
288 REG_WR(marb, regi_marb, rw_ack_intr, ack_intr);
289
290 printk("IRQ occured at %lX\n", regs->erp);
291
292 if (watch->cb)
293 watch->cb();
294
295
296 return IRQ_HANDLED;
297}
diff --git a/arch/cris/arch-v32/kernel/asm-offsets.c b/arch/cris/arch-v32/kernel/asm-offsets.c
new file mode 100644
index 000000000000..15b3d93a0496
--- /dev/null
+++ b/arch/cris/arch-v32/kernel/asm-offsets.c
@@ -0,0 +1,49 @@
1#include <linux/sched.h>
2#include <asm/thread_info.h>
3
4/*
5 * Generate definitions needed by assembly language modules.
6 * This code generates raw asm output which is post-processed to extract
7 * and format the required data.
8 */
9
10#define DEFINE(sym, val) \
11 asm volatile("\n->" #sym " %0 " #val : : "i" (val))
12
13#define BLANK() asm volatile("\n->" : : )
14
15int main(void)
16{
17#define ENTRY(entry) DEFINE(PT_ ## entry, offsetof(struct pt_regs, entry))
18 ENTRY(orig_r10);
19 ENTRY(r13);
20 ENTRY(r12);
21 ENTRY(r11);
22 ENTRY(r10);
23 ENTRY(r9);
24 ENTRY(acr);
25 ENTRY(srs);
26 ENTRY(mof);
27 ENTRY(ccs);
28 ENTRY(srp);
29 BLANK();
30#undef ENTRY
31#define ENTRY(entry) DEFINE(TI_ ## entry, offsetof(struct thread_info, entry))
32 ENTRY(task);
33 ENTRY(flags);
34 ENTRY(preempt_count);
35 BLANK();
36#undef ENTRY
37#define ENTRY(entry) DEFINE(THREAD_ ## entry, offsetof(struct thread_struct, entry))
38 ENTRY(ksp);
39 ENTRY(usp);
40 ENTRY(ccs);
41 BLANK();
42#undef ENTRY
43#define ENTRY(entry) DEFINE(TASK_ ## entry, offsetof(struct task_struct, entry))
44 ENTRY(pid);
45 BLANK();
46 DEFINE(LCLONE_VM, CLONE_VM);
47 DEFINE(LCLONE_UNTRACED, CLONE_UNTRACED);
48 return 0;
49}
diff --git a/arch/cris/arch-v32/kernel/crisksyms.c b/arch/cris/arch-v32/kernel/crisksyms.c
new file mode 100644
index 000000000000..2c3bb9a0afe2
--- /dev/null
+++ b/arch/cris/arch-v32/kernel/crisksyms.c
@@ -0,0 +1,24 @@
1#include <linux/config.h>
2#include <linux/module.h>
3#include <linux/irq.h>
4#include <asm/arch/dma.h>
5#include <asm/arch/intmem.h>
6#include <asm/arch/pinmux.h>
7
8/* Functions for allocating DMA channels */
9EXPORT_SYMBOL(crisv32_request_dma);
10EXPORT_SYMBOL(crisv32_free_dma);
11
12/* Functions for handling internal RAM */
13EXPORT_SYMBOL(crisv32_intmem_alloc);
14EXPORT_SYMBOL(crisv32_intmem_free);
15EXPORT_SYMBOL(crisv32_intmem_phys_to_virt);
16EXPORT_SYMBOL(crisv32_intmem_virt_to_phys);
17
18/* Functions for handling pinmux */
19EXPORT_SYMBOL(crisv32_pinmux_alloc);
20EXPORT_SYMBOL(crisv32_pinmux_dealloc);
21
22/* Functions masking/unmasking interrupts */
23EXPORT_SYMBOL(mask_irq);
24EXPORT_SYMBOL(unmask_irq);
diff --git a/arch/cris/arch-v32/kernel/debugport.c b/arch/cris/arch-v32/kernel/debugport.c
new file mode 100644
index 000000000000..ffc1ebf2dfee
--- /dev/null
+++ b/arch/cris/arch-v32/kernel/debugport.c
@@ -0,0 +1,461 @@
1/*
2 * Copyright (C) 2003, Axis Communications AB.
3 */
4
5#include <linux/config.h>
6#include <linux/console.h>
7#include <linux/init.h>
8#include <linux/major.h>
9#include <linux/delay.h>
10#include <linux/tty.h>
11#include <asm/system.h>
12#include <asm/io.h>
13#include <asm/arch/hwregs/ser_defs.h>
14#include <asm/arch/hwregs/dma_defs.h>
15#include <asm/arch/pinmux.h>
16
17#include <asm/irq.h>
18#include <asm/arch/hwregs/intr_vect_defs.h>
19
20struct dbg_port
21{
22 unsigned char nbr;
23 unsigned long instance;
24 unsigned int started;
25 unsigned long baudrate;
26 unsigned char parity;
27 unsigned int bits;
28};
29
30struct dbg_port ports[] =
31{
32 {
33 0,
34 regi_ser0,
35 0,
36 115200,
37 'N',
38 8
39 },
40 {
41 1,
42 regi_ser1,
43 0,
44 115200,
45 'N',
46 8
47 },
48 {
49 2,
50 regi_ser2,
51 0,
52 115200,
53 'N',
54 8
55 },
56 {
57 3,
58 regi_ser3,
59 0,
60 115200,
61 'N',
62 8
63 }
64};
65static struct dbg_port *port =
66#if defined(CONFIG_ETRAX_DEBUG_PORT0)
67&ports[0];
68#elif defined(CONFIG_ETRAX_DEBUG_PORT1)
69&ports[1];
70#elif defined(CONFIG_ETRAX_DEBUG_PORT2)
71&ports[2];
72#elif defined(CONFIG_ETRAX_DEBUG_PORT3)
73&ports[3];
74#else
75NULL;
76#endif
77
78#ifdef CONFIG_ETRAX_KGDB
79static struct dbg_port *kgdb_port =
80#if defined(CONFIG_ETRAX_KGDB_PORT0)
81&ports[0];
82#elif defined(CONFIG_ETRAX_KGDB_PORT1)
83&ports[1];
84#elif defined(CONFIG_ETRAX_KGDB_PORT2)
85&ports[2];
86#elif defined(CONFIG_ETRAX_KGDB_PORT3)
87&ports[3];
88#else
89NULL;
90#endif
91#endif
92
93#ifdef CONFIG_ETRAXFS_SIM
94extern void print_str( const char *str );
95static char buffer[1024];
96static char msg[] = "Debug: ";
97static int buffer_pos = sizeof(msg) - 1;
98#endif
99
100extern struct tty_driver *serial_driver;
101
102static void
103start_port(struct dbg_port* p)
104{
105 if (!p)
106 return;
107
108 if (p->started)
109 return;
110 p->started = 1;
111
112 if (p->nbr == 1)
113 crisv32_pinmux_alloc_fixed(pinmux_ser1);
114 else if (p->nbr == 2)
115 crisv32_pinmux_alloc_fixed(pinmux_ser2);
116 else if (p->nbr == 3)
117 crisv32_pinmux_alloc_fixed(pinmux_ser3);
118
119 /* Set up serial port registers */
120 reg_ser_rw_tr_ctrl tr_ctrl = {0};
121 reg_ser_rw_tr_dma_en tr_dma_en = {0};
122
123 reg_ser_rw_rec_ctrl rec_ctrl = {0};
124 reg_ser_rw_tr_baud_div tr_baud_div = {0};
125 reg_ser_rw_rec_baud_div rec_baud_div = {0};
126
127 tr_ctrl.base_freq = rec_ctrl.base_freq = regk_ser_f29_493;
128 tr_dma_en.en = rec_ctrl.dma_mode = regk_ser_no;
129 tr_baud_div.div = rec_baud_div.div = 29493000 / p->baudrate / 8;
130 tr_ctrl.en = rec_ctrl.en = 1;
131
132 if (p->parity == 'O')
133 {
134 tr_ctrl.par_en = regk_ser_yes;
135 tr_ctrl.par = regk_ser_odd;
136 rec_ctrl.par_en = regk_ser_yes;
137 rec_ctrl.par = regk_ser_odd;
138 }
139 else if (p->parity == 'E')
140 {
141 tr_ctrl.par_en = regk_ser_yes;
142 tr_ctrl.par = regk_ser_even;
143 rec_ctrl.par_en = regk_ser_yes;
144 rec_ctrl.par = regk_ser_odd;
145 }
146
147 if (p->bits == 7)
148 {
149 tr_ctrl.data_bits = regk_ser_bits7;
150 rec_ctrl.data_bits = regk_ser_bits7;
151 }
152
153 REG_WR (ser, p->instance, rw_tr_baud_div, tr_baud_div);
154 REG_WR (ser, p->instance, rw_rec_baud_div, rec_baud_div);
155 REG_WR (ser, p->instance, rw_tr_dma_en, tr_dma_en);
156 REG_WR (ser, p->instance, rw_tr_ctrl, tr_ctrl);
157 REG_WR (ser, p->instance, rw_rec_ctrl, rec_ctrl);
158}
159
160/* No debug */
161#ifdef CONFIG_ETRAX_DEBUG_PORT_NULL
162
163static void
164console_write(struct console *co, const char *buf, unsigned int len)
165{
166 return;
167}
168
169/* Target debug */
170#elif !defined(CONFIG_ETRAXFS_SIM)
171
172static void
173console_write_direct(struct console *co, const char *buf, unsigned int len)
174{
175 int i;
176 reg_ser_r_stat_din stat;
177 reg_ser_rw_tr_dma_en tr_dma_en, old;
178
179 /* Switch to manual mode */
180 tr_dma_en = old = REG_RD (ser, port->instance, rw_tr_dma_en);
181 if (tr_dma_en.en == regk_ser_yes) {
182 tr_dma_en.en = regk_ser_no;
183 REG_WR(ser, port->instance, rw_tr_dma_en, tr_dma_en);
184 }
185
186 /* Send data */
187 for (i = 0; i < len; i++) {
188 /* LF -> CRLF */
189 if (buf[i] == '\n') {
190 do {
191 stat = REG_RD (ser, port->instance, r_stat_din);
192 } while (!stat.tr_rdy);
193 REG_WR_INT (ser, port->instance, rw_dout, '\r');
194 }
195 /* Wait until transmitter is ready and send.*/
196 do {
197 stat = REG_RD (ser, port->instance, r_stat_din);
198 } while (!stat.tr_rdy);
199 REG_WR_INT (ser, port->instance, rw_dout, buf[i]);
200 }
201
202 /* Restore mode */
203 if (tr_dma_en.en != old.en)
204 REG_WR(ser, port->instance, rw_tr_dma_en, old);
205}
206
207static void
208console_write(struct console *co, const char *buf, unsigned int len)
209{
210 if (!port)
211 return;
212 console_write_direct(co, buf, len);
213}
214
215
216
217#else
218
219/* VCS debug */
220
221static void
222console_write(struct console *co, const char *buf, unsigned int len)
223{
224 char* pos;
225 pos = memchr(buf, '\n', len);
226 if (pos) {
227 int l = ++pos - buf;
228 memcpy(buffer + buffer_pos, buf, l);
229 memcpy(buffer, msg, sizeof(msg) - 1);
230 buffer[buffer_pos + l] = '\0';
231 print_str(buffer);
232 buffer_pos = sizeof(msg) - 1;
233 if (pos - buf != len) {
234 memcpy(buffer + buffer_pos, pos, len - l);
235 buffer_pos += len - l;
236 }
237 } else {
238 memcpy(buffer + buffer_pos, buf, len);
239 buffer_pos += len;
240 }
241}
242
243#endif
244
245int raw_printk(const char *fmt, ...)
246{
247 static char buf[1024];
248 int printed_len;
249 va_list args;
250 va_start(args, fmt);
251 printed_len = vsnprintf(buf, sizeof(buf), fmt, args);
252 va_end(args);
253 console_write(NULL, buf, strlen(buf));
254 return printed_len;
255}
256
257void
258stupid_debug(char* buf)
259{
260 console_write(NULL, buf, strlen(buf));
261}
262
263#ifdef CONFIG_ETRAX_KGDB
264/* Use polling to get a single character from the kernel debug port */
265int
266getDebugChar(void)
267{
268 reg_ser_rs_status_data stat;
269 reg_ser_rw_ack_intr ack_intr = { 0 };
270
271 do {
272 stat = REG_RD(ser, kgdb_instance, rs_status_data);
273 } while (!stat.data_avail);
274
275 /* Ack the data_avail interrupt. */
276 ack_intr.data_avail = 1;
277 REG_WR(ser, kgdb_instance, rw_ack_intr, ack_intr);
278
279 return stat.data;
280}
281
282/* Use polling to put a single character to the kernel debug port */
283void
284putDebugChar(int val)
285{
286 reg_ser_r_status_data stat;
287 do {
288 stat = REG_RD (ser, kgdb_instance, r_status_data);
289 } while (!stat.tr_ready);
290 REG_WR (ser, kgdb_instance, rw_data_out, REG_TYPE_CONV(reg_ser_rw_data_out, int, val));
291}
292#endif /* CONFIG_ETRAX_KGDB */
293
294static int __init
295console_setup(struct console *co, char *options)
296{
297 char* s;
298
299 if (options) {
300 port = &ports[co->index];
301 port->baudrate = 115200;
302 port->parity = 'N';
303 port->bits = 8;
304 port->baudrate = simple_strtoul(options, NULL, 10);
305 s = options;
306 while(*s >= '0' && *s <= '9')
307 s++;
308 if (*s) port->parity = *s++;
309 if (*s) port->bits = *s++ - '0';
310 port->started = 0;
311 start_port(port);
312 }
313 return 0;
314}
315
316/* This is a dummy serial device that throws away anything written to it.
317 * This is used when no debug output is wanted.
318 */
319static struct tty_driver dummy_driver;
320
321static int dummy_open(struct tty_struct *tty, struct file * filp)
322{
323 return 0;
324}
325
326static void dummy_close(struct tty_struct *tty, struct file * filp)
327{
328}
329
330static int dummy_write(struct tty_struct * tty,
331 const unsigned char *buf, int count)
332{
333 return count;
334}
335
336static int
337dummy_write_room(struct tty_struct *tty)
338{
339 return 8192;
340}
341
342void __init
343init_dummy_console(void)
344{
345 memset(&dummy_driver, 0, sizeof(struct tty_driver));
346 dummy_driver.driver_name = "serial";
347 dummy_driver.name = "ttyS";
348 dummy_driver.major = TTY_MAJOR;
349 dummy_driver.minor_start = 68;
350 dummy_driver.num = 1; /* etrax100 has 4 serial ports */
351 dummy_driver.type = TTY_DRIVER_TYPE_SERIAL;
352 dummy_driver.subtype = SERIAL_TYPE_NORMAL;
353 dummy_driver.init_termios = tty_std_termios;
354 dummy_driver.init_termios.c_cflag =
355 B115200 | CS8 | CREAD | HUPCL | CLOCAL; /* is normally B9600 default... */
356 dummy_driver.flags = TTY_DRIVER_REAL_RAW | TTY_DRIVER_NO_DEVFS;
357
358 dummy_driver.open = dummy_open;
359 dummy_driver.close = dummy_close;
360 dummy_driver.write = dummy_write;
361 dummy_driver.write_room = dummy_write_room;
362 if (tty_register_driver(&dummy_driver))
363 panic("Couldn't register dummy serial driver\n");
364}
365
366static struct tty_driver*
367crisv32_console_device(struct console* co, int *index)
368{
369 if (port)
370 *index = port->nbr;
371 return port ? serial_driver : &dummy_driver;
372}
373
374static struct console sercons = {
375 name : "ttyS",
376 write: console_write,
377 read : NULL,
378 device : crisv32_console_device,
379 unblank : NULL,
380 setup : console_setup,
381 flags : CON_PRINTBUFFER,
382 index : -1,
383 cflag : 0,
384 next : NULL
385};
386static struct console sercons0 = {
387 name : "ttyS",
388 write: console_write,
389 read : NULL,
390 device : crisv32_console_device,
391 unblank : NULL,
392 setup : console_setup,
393 flags : CON_PRINTBUFFER,
394 index : 0,
395 cflag : 0,
396 next : NULL
397};
398
399static struct console sercons1 = {
400 name : "ttyS",
401 write: console_write,
402 read : NULL,
403 device : crisv32_console_device,
404 unblank : NULL,
405 setup : console_setup,
406 flags : CON_PRINTBUFFER,
407 index : 1,
408 cflag : 0,
409 next : NULL
410};
411static struct console sercons2 = {
412 name : "ttyS",
413 write: console_write,
414 read : NULL,
415 device : crisv32_console_device,
416 unblank : NULL,
417 setup : console_setup,
418 flags : CON_PRINTBUFFER,
419 index : 2,
420 cflag : 0,
421 next : NULL
422};
423static struct console sercons3 = {
424 name : "ttyS",
425 write: console_write,
426 read : NULL,
427 device : crisv32_console_device,
428 unblank : NULL,
429 setup : console_setup,
430 flags : CON_PRINTBUFFER,
431 index : 3,
432 cflag : 0,
433 next : NULL
434};
435
436/* Register console for printk's, etc. */
437int __init
438init_etrax_debug(void)
439{
440 static int first = 1;
441
442 if (!first) {
443 unregister_console(&sercons);
444 register_console(&sercons0);
445 register_console(&sercons1);
446 register_console(&sercons2);
447 register_console(&sercons3);
448 init_dummy_console();
449 return 0;
450 }
451 first = 0;
452 register_console(&sercons);
453 start_port(port);
454
455#ifdef CONFIG_ETRAX_KGDB
456 start_port(kgdb_port);
457#endif /* CONFIG_ETRAX_KGDB */
458 return 0;
459}
460
461__initcall(init_etrax_debug);
diff --git a/arch/cris/arch-v32/kernel/dma.c b/arch/cris/arch-v32/kernel/dma.c
new file mode 100644
index 000000000000..b92e85799b44
--- /dev/null
+++ b/arch/cris/arch-v32/kernel/dma.c
@@ -0,0 +1,224 @@
1/* Wrapper for DMA channel allocator that starts clocks etc */
2
3#include <linux/kernel.h>
4#include <linux/spinlock.h>
5#include <asm/dma.h>
6#include <asm/arch/hwregs/reg_map.h>
7#include <asm/arch/hwregs/reg_rdwr.h>
8#include <asm/arch/hwregs/marb_defs.h>
9#include <asm/arch/hwregs/config_defs.h>
10#include <asm/arch/hwregs/strmux_defs.h>
11#include <linux/errno.h>
12#include <asm/system.h>
13#include <asm/arch/arbiter.h>
14
15static char used_dma_channels[MAX_DMA_CHANNELS];
16static const char * used_dma_channels_users[MAX_DMA_CHANNELS];
17
18static DEFINE_SPINLOCK(dma_lock);
19
20int crisv32_request_dma(unsigned int dmanr, const char * device_id,
21 unsigned options, unsigned int bandwidth,
22 enum dma_owner owner)
23{
24 unsigned long flags;
25 reg_config_rw_clk_ctrl clk_ctrl;
26 reg_strmux_rw_cfg strmux_cfg;
27
28 if (crisv32_arbiter_allocate_bandwith(dmanr,
29 options & DMA_INT_MEM ? INT_REGION : EXT_REGION,
30 bandwidth))
31 return -ENOMEM;
32
33 spin_lock_irqsave(&dma_lock, flags);
34
35 if (used_dma_channels[dmanr]) {
36 spin_unlock_irqrestore(&dma_lock, flags);
37 if (options & DMA_VERBOSE_ON_ERROR) {
38 printk("Failed to request DMA %i for %s, already allocated by %s\n", dmanr, device_id, used_dma_channels_users[dmanr]);
39 }
40 if (options & DMA_PANIC_ON_ERROR)
41 panic("request_dma error!");
42 return -EBUSY;
43 }
44 clk_ctrl = REG_RD(config, regi_config, rw_clk_ctrl);
45 strmux_cfg = REG_RD(strmux, regi_strmux, rw_cfg);
46
47 switch(dmanr)
48 {
49 case 0:
50 case 1:
51 clk_ctrl.dma01_eth0 = 1;
52 break;
53 case 2:
54 case 3:
55 clk_ctrl.dma23 = 1;
56 break;
57 case 4:
58 case 5:
59 clk_ctrl.dma45 = 1;
60 break;
61 case 6:
62 case 7:
63 clk_ctrl.dma67 = 1;
64 break;
65 case 8:
66 case 9:
67 clk_ctrl.dma89_strcop = 1;
68 break;
69#if MAX_DMA_CHANNELS-1 != 9
70#error Check dma.c
71#endif
72 default:
73 spin_unlock_irqrestore(&dma_lock, flags);
74 if (options & DMA_VERBOSE_ON_ERROR) {
75 printk("Failed to request DMA %i for %s, only 0-%i valid)\n", dmanr, device_id, MAX_DMA_CHANNELS-1);
76 }
77
78 if (options & DMA_PANIC_ON_ERROR)
79 panic("request_dma error!");
80 return -EINVAL;
81 }
82
83 switch(owner)
84 {
85 case dma_eth0:
86 if (dmanr == 0)
87 strmux_cfg.dma0 = regk_strmux_eth0;
88 else if (dmanr == 1)
89 strmux_cfg.dma1 = regk_strmux_eth0;
90 else
91 panic("Invalid DMA channel for eth0\n");
92 break;
93 case dma_eth1:
94 if (dmanr == 6)
95 strmux_cfg.dma6 = regk_strmux_eth1;
96 else if (dmanr == 7)
97 strmux_cfg.dma7 = regk_strmux_eth1;
98 else
99 panic("Invalid DMA channel for eth1\n");
100 break;
101 case dma_iop0:
102 if (dmanr == 2)
103 strmux_cfg.dma2 = regk_strmux_iop0;
104 else if (dmanr == 3)
105 strmux_cfg.dma3 = regk_strmux_iop0;
106 else
107 panic("Invalid DMA channel for iop0\n");
108 break;
109 case dma_iop1:
110 if (dmanr == 4)
111 strmux_cfg.dma4 = regk_strmux_iop1;
112 else if (dmanr == 5)
113 strmux_cfg.dma5 = regk_strmux_iop1;
114 else
115 panic("Invalid DMA channel for iop1\n");
116 break;
117 case dma_ser0:
118 if (dmanr == 6)
119 strmux_cfg.dma6 = regk_strmux_ser0;
120 else if (dmanr == 7)
121 strmux_cfg.dma7 = regk_strmux_ser0;
122 else
123 panic("Invalid DMA channel for ser0\n");
124 break;
125 case dma_ser1:
126 if (dmanr == 4)
127 strmux_cfg.dma4 = regk_strmux_ser1;
128 else if (dmanr == 5)
129 strmux_cfg.dma5 = regk_strmux_ser1;
130 else
131 panic("Invalid DMA channel for ser1\n");
132 break;
133 case dma_ser2:
134 if (dmanr == 2)
135 strmux_cfg.dma2 = regk_strmux_ser2;
136 else if (dmanr == 3)
137 strmux_cfg.dma3 = regk_strmux_ser2;
138 else
139 panic("Invalid DMA channel for ser2\n");
140 break;
141 case dma_ser3:
142 if (dmanr == 8)
143 strmux_cfg.dma8 = regk_strmux_ser3;
144 else if (dmanr == 9)
145 strmux_cfg.dma9 = regk_strmux_ser3;
146 else
147 panic("Invalid DMA channel for ser3\n");
148 break;
149 case dma_sser0:
150 if (dmanr == 4)
151 strmux_cfg.dma4 = regk_strmux_sser0;
152 else if (dmanr == 5)
153 strmux_cfg.dma5 = regk_strmux_sser0;
154 else
155 panic("Invalid DMA channel for sser0\n");
156 break;
157 case dma_sser1:
158 if (dmanr == 6)
159 strmux_cfg.dma6 = regk_strmux_sser1;
160 else if (dmanr == 7)
161 strmux_cfg.dma7 = regk_strmux_sser1;
162 else
163 panic("Invalid DMA channel for sser1\n");
164 break;
165 case dma_ata:
166 if (dmanr == 2)
167 strmux_cfg.dma2 = regk_strmux_ata;
168 else if (dmanr == 3)
169 strmux_cfg.dma3 = regk_strmux_ata;
170 else
171 panic("Invalid DMA channel for ata\n");
172 break;
173 case dma_strp:
174 if (dmanr == 8)
175 strmux_cfg.dma8 = regk_strmux_strcop;
176 else if (dmanr == 9)
177 strmux_cfg.dma9 = regk_strmux_strcop;
178 else
179 panic("Invalid DMA channel for strp\n");
180 break;
181 case dma_ext0:
182 if (dmanr == 6)
183 strmux_cfg.dma6 = regk_strmux_ext0;
184 else
185 panic("Invalid DMA channel for ext0\n");
186 break;
187 case dma_ext1:
188 if (dmanr == 7)
189 strmux_cfg.dma7 = regk_strmux_ext1;
190 else
191 panic("Invalid DMA channel for ext1\n");
192 break;
193 case dma_ext2:
194 if (dmanr == 2)
195 strmux_cfg.dma2 = regk_strmux_ext2;
196 else if (dmanr == 8)
197 strmux_cfg.dma8 = regk_strmux_ext2;
198 else
199 panic("Invalid DMA channel for ext2\n");
200 break;
201 case dma_ext3:
202 if (dmanr == 3)
203 strmux_cfg.dma3 = regk_strmux_ext3;
204 else if (dmanr == 9)
205 strmux_cfg.dma9 = regk_strmux_ext2;
206 else
207 panic("Invalid DMA channel for ext2\n");
208 break;
209 }
210
211 used_dma_channels[dmanr] = 1;
212 used_dma_channels_users[dmanr] = device_id;
213 REG_WR(config, regi_config, rw_clk_ctrl, clk_ctrl);
214 REG_WR(strmux, regi_strmux, rw_cfg, strmux_cfg);
215 spin_unlock_irqrestore(&dma_lock,flags);
216 return 0;
217}
218
219void crisv32_free_dma(unsigned int dmanr)
220{
221 spin_lock(&dma_lock);
222 used_dma_channels[dmanr] = 0;
223 spin_unlock(&dma_lock);
224}
diff --git a/arch/cris/arch-v32/kernel/entry.S b/arch/cris/arch-v32/kernel/entry.S
new file mode 100644
index 000000000000..a8ed55e5b403
--- /dev/null
+++ b/arch/cris/arch-v32/kernel/entry.S
@@ -0,0 +1,820 @@
1/*
2 * Copyright (C) 2000-2003 Axis Communications AB
3 *
4 * Authors: Bjorn Wesen (bjornw@axis.com)
5 * Tobias Anderberg (tobiasa@axis.com), CRISv32 port.
6 *
7 * Code for the system-call and fault low-level handling routines.
8 *
9 * NOTE: This code handles signal-recognition, which happens every time
10 * after a timer-interrupt and after each system call.
11 *
12 * Stack layout in 'ret_from_system_call':
13 * ptrace needs to have all regs on the stack.
14 * if the order here is changed, it needs to be
15 * updated in fork.c:copy_process, signal.c:do_signal,
16 * ptrace.c and ptrace.h
17 *
18 */
19
20#include <linux/config.h>
21#include <linux/linkage.h>
22#include <linux/sys.h>
23#include <asm/unistd.h>
24#include <asm/errno.h>
25#include <asm/thread_info.h>
26#include <asm/arch/offset.h>
27
28#include <asm/arch/hwregs/asm/reg_map_asm.h>
29#include <asm/arch/hwregs/asm/intr_vect_defs_asm.h>
30
31 ;; Exported functions.
32 .globl system_call
33 .globl ret_from_intr
34 .globl ret_from_fork
35 .globl resume
36 .globl multiple_interrupt
37 .globl nmi_interrupt
38 .globl spurious_interrupt
39 .globl do_sigtrap
40 .globl gdb_handle_exception
41 .globl sys_call_table
42
43 ; Check if preemptive kernel scheduling should be done.
44#ifdef CONFIG_PREEMPT
45_resume_kernel:
46 di
47 ; Load current task struct.
48 movs.w -8192, $r0 ; THREAD_SIZE = 8192
49 and.d $sp, $r0
50
51 addoq +TI_preempt_count, $r0, $acr
52 move.d [$acr], $r10 ; Preemption disabled?
53 bne _Rexit
54 nop
55
56_need_resched:
57 addoq +TI_flags, $r0, $acr
58 move.d [$acr], $r10
59 btstq TIF_NEED_RESCHED, $r10 ; Check if need_resched is set.
60 bpl _Rexit
61 nop
62
63 ; Do preemptive kernel scheduling.
64 jsr preempt_schedule_irq
65 nop
66
67 ; Load new task struct.
68 movs.w -8192, $r0 ; THREAD_SIZE = 8192.
69 and.d $sp, $r0
70
71 ; One more time with new task.
72 ba _need_resched
73 nop
74#else
75#define _resume_kernel _Rexit
76#endif
77
78 ; Called at exit from fork. schedule_tail must be called to drop
79 ; spinlock if CONFIG_PREEMPT.
80ret_from_fork:
81 jsr schedule_tail
82 nop
83 ba ret_from_sys_call
84 nop
85
86ret_from_intr:
87 ;; Check for resched if preemptive kernel, or if we're going back to
88 ;; user-mode. This test matches the user_regs(regs) macro. Don't simply
89 ;; test CCS since that doesn't necessarily reflect what mode we'll
90 ;; return into.
91 addoq +PT_ccs, $sp, $acr
92 move.d [$acr], $r0
93 btstq 16, $r0 ; User-mode flag.
94 bpl _resume_kernel
95
96 ; Note that di below is in delay slot.
97
98_resume_userspace:
99 di ; So need_resched and sigpending don't change.
100
101 movs.w -8192, $r0 ; THREAD_SIZE == 8192
102 and.d $sp, $r0
103
104 addoq +TI_flags, $r0, $acr ; current->work
105 move.d [$acr], $r10
106 and.d _TIF_WORK_MASK, $r10 ; Work to be done on return?
107 bne _work_pending
108 nop
109 ba _Rexit
110 nop
111
112 ;; The system_call is called by a BREAK instruction, which looks pretty
113 ;; much like any other exception.
114 ;;
115 ;; System calls can't be made from interrupts but we still stack ERP
116 ;; to have a complete stack frame.
117 ;;
118 ;; In r9 we have the wanted syscall number. Arguments come in r10,r11,r12,
119 ;; r13,mof,srp
120 ;;
121 ;; This function looks on the _surface_ like spaghetti programming, but it's
122 ;; really designed so that the fast-path does not force cache-loading of
123 ;; non-used instructions. Only the non-common cases cause the outlined code
124 ;; to run..
125
126system_call:
127 ;; Stack-frame similar to the irq heads, which is reversed in
128 ;; ret_from_sys_call.
129 subq 12, $sp ; Skip EXS, EDA.
130 move $erp, [$sp]
131 subq 4, $sp
132 move $srp, [$sp]
133 subq 4, $sp
134 move $ccs, [$sp]
135 subq 4, $sp
136 ei ; Allow IRQs while handling system call
137 move $spc, [$sp]
138 subq 4, $sp
139 move $mof, [$sp]
140 subq 4, $sp
141 move $srs, [$sp]
142 subq 4, $sp
143 move.d $acr, [$sp]
144 subq 14*4, $sp ; Make room for R0-R13.
145 movem $r13, [$sp] ; Push R0-R13
146 subq 4, $sp
147 move.d $r10, [$sp] ; Push orig_r10.
148
149; Set S-bit when kernel debugging to keep hardware breakpoints active.
150#ifdef CONFIG_ETRAX_KGDB
151 move $ccs, $r0
152 or.d (1<<9), $r0
153 move $r0, $ccs
154#endif
155
156 movs.w -ENOSYS, $r0
157 addoq +PT_r10, $sp, $acr
158 move.d $r0, [$acr]
159
160 ;; Check if this process is syscall-traced.
161 movs.w -8192, $r0 ; THREAD_SIZE == 8192
162 and.d $sp, $r0
163
164 addoq +TI_flags, $r0, $acr
165 move.d [$acr], $r0
166 btstq TIF_SYSCALL_TRACE, $r0
167 bmi _syscall_trace_entry
168 nop
169
170_syscall_traced:
171 ;; Check for sanity in the requested syscall number.
172 cmpu.w NR_syscalls, $r9
173 bhs ret_from_sys_call
174 lslq 2, $r9 ; Multiply by 4, in the delay slot.
175
176 ;; The location on the stack for the register structure is passed as a
177 ;; seventh argument. Some system calls need this.
178 move.d $sp, $r0
179 subq 4, $sp
180 move.d $r0, [$sp]
181
182 ;; The registers carrying parameters (R10-R13) are intact. The optional
183 ;; fifth and sixth parameters is in MOF and SRP respectivly. Put them
184 ;; back on the stack.
185 subq 4, $sp
186 move $srp, [$sp]
187 subq 4, $sp
188 move $mof, [$sp]
189
190 ;; Actually to the system call.
191 addo.d +sys_call_table, $r9, $acr
192 move.d [$acr], $acr
193 jsr $acr
194 nop
195
196 addq 3*4, $sp ; Pop the mof, srp and regs parameters.
197 addoq +PT_r10, $sp, $acr
198 move.d $r10, [$acr] ; Save the return value.
199
200 moveq 1, $r9 ; "Parameter" to ret_from_sys_call to
201 ; show it was a sys call.
202
203 ;; Fall through into ret_from_sys_call to return.
204
205ret_from_sys_call:
206 ;; R9 is a parameter:
207 ;; >= 1 from syscall
208 ;; 0 from irq
209
210 ;; Get the current task-struct pointer.
211 movs.w -8192, $r0 ; THREAD_SIZE == 8192
212 and.d $sp, $r0
213
214 di ; Make sure need_resched and sigpending don't change.
215
216 addoq +TI_flags, $r0, $acr
217 move.d [$acr], $r1
218 and.d _TIF_ALLWORK_MASK, $r1
219 bne _syscall_exit_work
220 nop
221
222_Rexit:
223 ;; This epilogue MUST match the prologues in multiple_interrupt, irq.h
224 ;; and ptregs.h.
225 addq 4, $sp ; Skip orig_r10.
226 movem [$sp+], $r13 ; Registers R0-R13.
227 move.d [$sp+], $acr
228 move [$sp], $srs
229 addq 4, $sp
230 move [$sp+], $mof
231 move [$sp+], $spc
232 move [$sp+], $ccs
233 move [$sp+], $srp
234 move [$sp+], $erp
235 addq 8, $sp ; Skip EXS, EDA.
236 jump $erp
237 rfe ; Restore condition code stack in delay-slot.
238
239 ;; We get here after doing a syscall if extra work might need to be done
240 ;; perform syscall exit tracing if needed.
241
242_syscall_exit_work:
243 ;; R0 contains current at this point and irq's are disabled.
244
245 addoq +TI_flags, $r0, $acr
246 move.d [$acr], $r1
247 btstq TIF_SYSCALL_TRACE, $r1
248 bpl _work_pending
249 nop
250 ei
251 move.d $r9, $r1 ; Preserve R9.
252 jsr do_syscall_trace
253 nop
254 move.d $r1, $r9
255 ba _resume_userspace
256 nop
257
258_work_pending:
259 addoq +TI_flags, $r0, $acr
260 move.d [$acr], $r10
261 btstq TIF_NEED_RESCHED, $r10 ; Need resched?
262 bpl _work_notifysig ; No, must be signal/notify.
263 nop
264
265_work_resched:
266 move.d $r9, $r1 ; Preserve R9.
267 jsr schedule
268 nop
269 move.d $r1, $r9
270 di
271
272 addoq +TI_flags, $r0, $acr
273 move.d [$acr], $r1
274 and.d _TIF_WORK_MASK, $r1 ; Ignore sycall trace counter.
275 beq _Rexit
276 nop
277 btstq TIF_NEED_RESCHED, $r1
278 bmi _work_resched ; current->work.need_resched.
279 nop
280
281_work_notifysig:
282 ;; Deal with pending signals and notify-resume requests.
283
284 addoq +TI_flags, $r0, $acr
285 move.d [$acr], $r13 ; The thread_info_flags parameter.
286 move.d $r9, $r10 ; do_notify_resume syscall/irq param.
287 moveq 0, $r11 ; oldset param - 0 in this case.
288 move.d $sp, $r12 ; The regs param.
289 jsr do_notify_resume
290 nop
291
292 ba _Rexit
293 nop
294
295 ;; We get here as a sidetrack when we've entered a syscall with the
296 ;; trace-bit set. We need to call do_syscall_trace and then continue
297 ;; with the call.
298
299_syscall_trace_entry:
300 ;; PT_r10 in the frame contains -ENOSYS as required, at this point.
301
302 jsr do_syscall_trace
303 nop
304
305 ;; Now re-enter the syscall code to do the syscall itself. We need to
306 ;; restore R9 here to contain the wanted syscall, and the other
307 ;; parameter-bearing registers.
308 addoq +PT_r9, $sp, $acr
309 move.d [$acr], $r9
310 addoq +PT_orig_r10, $sp, $acr
311 move.d [$acr], $r10 ; PT_r10 is already -ENOSYS.
312 addoq +PT_r11, $sp, $acr
313 move.d [$acr], $r11
314 addoq +PT_r12, $sp, $acr
315 move.d [$acr], $r12
316 addoq +PT_r13, $sp, $acr
317 move.d [$acr], $r13
318 addoq +PT_mof, $sp, $acr
319 move [$acr], $mof
320 addoq +PT_srp, $sp, $acr
321 move [$acr], $srp
322
323 ba _syscall_traced
324 nop
325
326 ;; Resume performs the actual task-switching, by switching stack
327 ;; pointers. Input arguments are:
328 ;;
329 ;; R10 = prev
330 ;; R11 = next
331 ;; R12 = thread offset in task struct.
332 ;;
333 ;; Returns old current in R10.
334
335resume:
336 subq 4, $sp
337 move $srp, [$sp] ; Keep old/new PC on the stack.
338 add.d $r12, $r10 ; R10 = current tasks tss.
339 addoq +THREAD_ccs, $r10, $acr
340 move $ccs, [$acr] ; Save IRQ enable state.
341 di
342
343 addoq +THREAD_usp, $r10, $acr
344 move $usp, [$acr] ; Save user-mode stackpointer.
345
346 ;; See copy_thread for the reason why register R9 is saved.
347 subq 10*4, $sp
348 movem $r9, [$sp] ; Save non-scratch registers and R9.
349
350 addoq +THREAD_ksp, $r10, $acr
351 move.d $sp, [$acr] ; Save kernel SP for old task.
352
353 move.d $sp, $r10 ; Return last running task in R10.
354 and.d -8192, $r10 ; Get thread_info from stackpointer.
355 addoq +TI_task, $r10, $acr
356 move.d [$acr], $r10 ; Get task.
357 add.d $r12, $r11 ; Find the new tasks tss.
358 addoq +THREAD_ksp, $r11, $acr
359 move.d [$acr], $sp ; Switch to new stackframe.
360 movem [$sp+], $r9 ; Restore non-scratch registers and R9.
361
362 addoq +THREAD_usp, $r11, $acr
363 move [$acr], $usp ; Restore user-mode stackpointer.
364
365 addoq +THREAD_ccs, $r11, $acr
366 move [$acr], $ccs ; Restore IRQ enable status.
367 move.d [$sp+], $acr
368 jump $acr ; Restore PC.
369 nop
370
371nmi_interrupt:
372
373;; If we receive a watchdog interrupt while it is not expected, then set
374;; up a canonical frame and dump register contents before dying.
375
376 ;; This prologue MUST match the one in irq.h and the struct in ptregs.h!
377 subq 12, $sp ; Skip EXS, EDA.
378 move $nrp, [$sp]
379 subq 4, $sp
380 move $srp, [$sp]
381 subq 4, $sp
382 move $ccs, [$sp]
383 subq 4, $sp
384 move $spc, [$sp]
385 subq 4, $sp
386 move $mof, [$sp]
387 subq 4, $sp
388 move $srs, [$sp]
389 subq 4, $sp
390 move.d $acr, [$sp]
391 subq 14*4, $sp ; Make room for R0-R13.
392 movem $r13, [$sp] ; Push R0-R13.
393 subq 4, $sp
394 move.d $r10, [$sp] ; Push orig_r10.
395 move.d REG_ADDR(intr_vect, regi_irq, r_nmi), $r0
396 move.d [$r0], $r0
397 btstq REG_BIT(intr_vect, r_nmi, watchdog), $r0
398 bpl 1f
399 nop
400 jsr handle_watchdog_bite ; In time.c.
401 move.d $sp, $r10 ; Pointer to registers
4021: btstq REG_BIT(intr_vect, r_nmi, ext), $r0
403 bpl 1f
404 nop
405 jsr handle_nmi
406 move.d $sp, $r10 ; Pointer to registers
4071: addq 4, $sp ; Skip orig_r10
408 movem [$sp+], $r13
409 move.d [$sp+], $acr
410 move [$sp], $srs
411 addq 4, $sp
412 move [$sp+], $mof
413 move [$sp+], $spc
414 move [$sp+], $ccs
415 move [$sp+], $srp
416 move [$sp+], $nrp
417 addq 8, $sp ; Skip EXS, EDA.
418 jump $nrp
419 rfn
420
421 .comm cause_of_death, 4 ;; Don't declare this anywhere.
422
423spurious_interrupt:
424 di
425 jump hard_reset_now
426 nop
427
428 ;; This handles the case when multiple interrupts arrive at the same
429 ;; time. Jump to the first set interrupt bit in a priotiry fashion. The
430 ;; hardware will call the unserved interrupts after the handler
431 ;; finishes.
432multiple_interrupt:
433 ;; This prologue MUST match the one in irq.h and the struct in ptregs.h!
434 subq 12, $sp ; Skip EXS, EDA.
435 move $erp, [$sp]
436 subq 4, $sp
437 move $srp, [$sp]
438 subq 4, $sp
439 move $ccs, [$sp]
440 subq 4, $sp
441 move $spc, [$sp]
442 subq 4, $sp
443 move $mof, [$sp]
444 subq 4, $sp
445 move $srs, [$sp]
446 subq 4, $sp
447 move.d $acr, [$sp]
448 subq 14*4, $sp ; Make room for R0-R13.
449 movem $r13, [$sp] ; Push R0-R13.
450 subq 4, $sp
451 move.d $r10, [$sp] ; Push orig_r10.
452
453; Set S-bit when kernel debugging to keep hardware breakpoints active.
454#ifdef CONFIG_ETRAX_KGDB
455 move $ccs, $r0
456 or.d (1<<9), $r0
457 move $r0, $ccs
458#endif
459
460 jsr crisv32_do_multiple
461 move.d $sp, $r10
462 jump ret_from_intr
463 nop
464
465do_sigtrap:
466 ;; Sigtraps the process that executed the BREAK instruction. Creates a
467 ;; frame that Rexit expects.
468 subq 4, $sp
469 move $eda, [$sp]
470 subq 4, $sp
471 move $exs, [$sp]
472 subq 4, $sp
473 move $erp, [$sp]
474 subq 4, $sp
475 move $srp, [$sp]
476 subq 4, $sp
477 move $ccs, [$sp]
478 subq 4, $sp
479 move $spc, [$sp]
480 subq 4, $sp
481 move $mof, [$sp]
482 subq 4, $sp
483 move $srs, [$sp]
484 subq 4, $sp
485 move.d $acr, [$sp]
486 di ; Need to disable irq's at this point.
487 subq 14*4, $sp ; Make room for r0-r13.
488 movem $r13, [$sp] ; Push the r0-r13 registers.
489 subq 4, $sp
490 move.d $r10, [$sp] ; Push orig_r10.
491
492 movs.w -8192, $r9 ; THREAD_SIZE == 8192
493 and.d $sp, $r9
494
495 ;; thread_info as first parameter
496 move.d $r9, $r10
497 moveq 5, $r11 ; SIGTRAP as second argument.
498 jsr ugdb_trap_user
499 nop
500 jump ret_from_intr ; Use the return routine for interrupts.
501 nop
502
503gdb_handle_exception:
504 subq 4, $sp
505 move.d $r0, [$sp]
506#ifdef CONFIG_ETRAX_KGDB
507 move $ccs, $r0 ; U-flag not affected by previous insns.
508 btstq 16, $r0 ; Test the U-flag.
509 bmi _ugdb_handle_exception ; Go to user mode debugging.
510 nop ; Empty delay-slot (cannot pop R0 here).
511 ba kgdb_handle_exception ; Go to kernel debugging.
512 move.d [$sp+], $r0 ; Restore R0 in delay slot.
513#endif
514
515_ugdb_handle_exception:
516 ba do_sigtrap ; SIGTRAP the offending process.
517 move.d [$sp+], $r0 ; Restore R0 in delay slot.
518
519 .data
520
521 .section .rodata,"a"
522sys_call_table:
523 .long sys_restart_syscall ; 0 - old "setup()" system call, used
524 ; for restarting.
525 .long sys_exit
526 .long sys_fork
527 .long sys_read
528 .long sys_write
529 .long sys_open /* 5 */
530 .long sys_close
531 .long sys_waitpid
532 .long sys_creat
533 .long sys_link
534 .long sys_unlink /* 10 */
535 .long sys_execve
536 .long sys_chdir
537 .long sys_time
538 .long sys_mknod
539 .long sys_chmod /* 15 */
540 .long sys_lchown16
541 .long sys_ni_syscall /* old break syscall holder */
542 .long sys_stat
543 .long sys_lseek
544 .long sys_getpid /* 20 */
545 .long sys_mount
546 .long sys_oldumount
547 .long sys_setuid16
548 .long sys_getuid16
549 .long sys_stime /* 25 */
550 .long sys_ptrace
551 .long sys_alarm
552 .long sys_fstat
553 .long sys_pause
554 .long sys_utime /* 30 */
555 .long sys_ni_syscall /* old stty syscall holder */
556 .long sys_ni_syscall /* old gtty syscall holder */
557 .long sys_access
558 .long sys_nice
559 .long sys_ni_syscall /* 35 old ftime syscall holder */
560 .long sys_sync
561 .long sys_kill
562 .long sys_rename
563 .long sys_mkdir
564 .long sys_rmdir /* 40 */
565 .long sys_dup
566 .long sys_pipe
567 .long sys_times
568 .long sys_ni_syscall /* old prof syscall holder */
569 .long sys_brk /* 45 */
570 .long sys_setgid16
571 .long sys_getgid16
572 .long sys_signal
573 .long sys_geteuid16
574 .long sys_getegid16 /* 50 */
575 .long sys_acct
576 .long sys_umount /* recycled never used phys( */
577 .long sys_ni_syscall /* old lock syscall holder */
578 .long sys_ioctl
579 .long sys_fcntl /* 55 */
580 .long sys_ni_syscall /* old mpx syscall holder */
581 .long sys_setpgid
582 .long sys_ni_syscall /* old ulimit syscall holder */
583 .long sys_ni_syscall /* old sys_olduname holder */
584 .long sys_umask /* 60 */
585 .long sys_chroot
586 .long sys_ustat
587 .long sys_dup2
588 .long sys_getppid
589 .long sys_getpgrp /* 65 */
590 .long sys_setsid
591 .long sys_sigaction
592 .long sys_sgetmask
593 .long sys_ssetmask
594 .long sys_setreuid16 /* 70 */
595 .long sys_setregid16
596 .long sys_sigsuspend
597 .long sys_sigpending
598 .long sys_sethostname
599 .long sys_setrlimit /* 75 */
600 .long sys_old_getrlimit
601 .long sys_getrusage
602 .long sys_gettimeofday
603 .long sys_settimeofday
604 .long sys_getgroups16 /* 80 */
605 .long sys_setgroups16
606 .long sys_select /* was old_select in Linux/E100 */
607 .long sys_symlink
608 .long sys_lstat
609 .long sys_readlink /* 85 */
610 .long sys_uselib
611 .long sys_swapon
612 .long sys_reboot
613 .long old_readdir
614 .long old_mmap /* 90 */
615 .long sys_munmap
616 .long sys_truncate
617 .long sys_ftruncate
618 .long sys_fchmod
619 .long sys_fchown16 /* 95 */
620 .long sys_getpriority
621 .long sys_setpriority
622 .long sys_ni_syscall /* old profil syscall holder */
623 .long sys_statfs
624 .long sys_fstatfs /* 100 */
625 .long sys_ni_syscall /* sys_ioperm in i386 */
626 .long sys_socketcall
627 .long sys_syslog
628 .long sys_setitimer
629 .long sys_getitimer /* 105 */
630 .long sys_newstat
631 .long sys_newlstat
632 .long sys_newfstat
633 .long sys_ni_syscall /* old sys_uname holder */
634 .long sys_ni_syscall /* sys_iopl in i386 */
635 .long sys_vhangup
636 .long sys_ni_syscall /* old "idle" system call */
637 .long sys_ni_syscall /* vm86old in i386 */
638 .long sys_wait4
639 .long sys_swapoff /* 115 */
640 .long sys_sysinfo
641 .long sys_ipc
642 .long sys_fsync
643 .long sys_sigreturn
644 .long sys_clone /* 120 */
645 .long sys_setdomainname
646 .long sys_newuname
647 .long sys_ni_syscall /* sys_modify_ldt */
648 .long sys_adjtimex
649 .long sys_mprotect /* 125 */
650 .long sys_sigprocmask
651 .long sys_ni_syscall /* old "create_module" */
652 .long sys_init_module
653 .long sys_delete_module
654 .long sys_ni_syscall /* 130: old "get_kernel_syms" */
655 .long sys_quotactl
656 .long sys_getpgid
657 .long sys_fchdir
658 .long sys_bdflush
659 .long sys_sysfs /* 135 */
660 .long sys_personality
661 .long sys_ni_syscall /* for afs_syscall */
662 .long sys_setfsuid16
663 .long sys_setfsgid16
664 .long sys_llseek /* 140 */
665 .long sys_getdents
666 .long sys_select
667 .long sys_flock
668 .long sys_msync
669 .long sys_readv /* 145 */
670 .long sys_writev
671 .long sys_getsid
672 .long sys_fdatasync
673 .long sys_sysctl
674 .long sys_mlock /* 150 */
675 .long sys_munlock
676 .long sys_mlockall
677 .long sys_munlockall
678 .long sys_sched_setparam
679 .long sys_sched_getparam /* 155 */
680 .long sys_sched_setscheduler
681 .long sys_sched_getscheduler
682 .long sys_sched_yield
683 .long sys_sched_get_priority_max
684 .long sys_sched_get_priority_min /* 160 */
685 .long sys_sched_rr_get_interval
686 .long sys_nanosleep
687 .long sys_mremap
688 .long sys_setresuid16
689 .long sys_getresuid16 /* 165 */
690 .long sys_ni_syscall /* sys_vm86 */
691 .long sys_ni_syscall /* Old sys_query_module */
692 .long sys_poll
693 .long sys_nfsservctl
694 .long sys_setresgid16 /* 170 */
695 .long sys_getresgid16
696 .long sys_prctl
697 .long sys_rt_sigreturn
698 .long sys_rt_sigaction
699 .long sys_rt_sigprocmask /* 175 */
700 .long sys_rt_sigpending
701 .long sys_rt_sigtimedwait
702 .long sys_rt_sigqueueinfo
703 .long sys_rt_sigsuspend
704 .long sys_pread64 /* 180 */
705 .long sys_pwrite64
706 .long sys_chown16
707 .long sys_getcwd
708 .long sys_capget
709 .long sys_capset /* 185 */
710 .long sys_sigaltstack
711 .long sys_sendfile
712 .long sys_ni_syscall /* streams1 */
713 .long sys_ni_syscall /* streams2 */
714 .long sys_vfork /* 190 */
715 .long sys_getrlimit
716 .long sys_mmap2
717 .long sys_truncate64
718 .long sys_ftruncate64
719 .long sys_stat64 /* 195 */
720 .long sys_lstat64
721 .long sys_fstat64
722 .long sys_lchown
723 .long sys_getuid
724 .long sys_getgid /* 200 */
725 .long sys_geteuid
726 .long sys_getegid
727 .long sys_setreuid
728 .long sys_setregid
729 .long sys_getgroups /* 205 */
730 .long sys_setgroups
731 .long sys_fchown
732 .long sys_setresuid
733 .long sys_getresuid
734 .long sys_setresgid /* 210 */
735 .long sys_getresgid
736 .long sys_chown
737 .long sys_setuid
738 .long sys_setgid
739 .long sys_setfsuid /* 215 */
740 .long sys_setfsgid
741 .long sys_pivot_root
742 .long sys_mincore
743 .long sys_madvise
744 .long sys_getdents64 /* 220 */
745 .long sys_fcntl64
746 .long sys_ni_syscall /* reserved for TUX */
747 .long sys_ni_syscall
748 .long sys_gettid
749 .long sys_readahead /* 225 */
750 .long sys_setxattr
751 .long sys_lsetxattr
752 .long sys_fsetxattr
753 .long sys_getxattr
754 .long sys_lgetxattr /* 230 */
755 .long sys_fgetxattr
756 .long sys_listxattr
757 .long sys_llistxattr
758 .long sys_flistxattr
759 .long sys_removexattr /* 235 */
760 .long sys_lremovexattr
761 .long sys_fremovexattr
762 .long sys_tkill
763 .long sys_sendfile64
764 .long sys_futex /* 240 */
765 .long sys_sched_setaffinity
766 .long sys_sched_getaffinity
767 .long sys_ni_syscall /* sys_set_thread_area */
768 .long sys_ni_syscall /* sys_get_thread_area */
769 .long sys_io_setup /* 245 */
770 .long sys_io_destroy
771 .long sys_io_getevents
772 .long sys_io_submit
773 .long sys_io_cancel
774 .long sys_fadvise64 /* 250 */
775 .long sys_ni_syscall
776 .long sys_exit_group
777 .long sys_lookup_dcookie
778 .long sys_epoll_create
779 .long sys_epoll_ctl /* 255 */
780 .long sys_epoll_wait
781 .long sys_remap_file_pages
782 .long sys_set_tid_address
783 .long sys_timer_create
784 .long sys_timer_settime /* 260 */
785 .long sys_timer_gettime
786 .long sys_timer_getoverrun
787 .long sys_timer_delete
788 .long sys_clock_settime
789 .long sys_clock_gettime /* 265 */
790 .long sys_clock_getres
791 .long sys_clock_nanosleep
792 .long sys_statfs64
793 .long sys_fstatfs64
794 .long sys_tgkill /* 270 */
795 .long sys_utimes
796 .long sys_fadvise64_64
797 .long sys_ni_syscall /* sys_vserver */
798 .long sys_ni_syscall /* sys_mbind */
799 .long sys_ni_syscall /* 275 sys_get_mempolicy */
800 .long sys_ni_syscall /* sys_set_mempolicy */
801 .long sys_mq_open
802 .long sys_mq_unlink
803 .long sys_mq_timedsend
804 .long sys_mq_timedreceive /* 280 */
805 .long sys_mq_notify
806 .long sys_mq_getsetattr
807 .long sys_ni_syscall /* reserved for kexec */
808 .long sys_waitid
809
810 /*
811 * NOTE!! This doesn't have to be exact - we just have
812 * to make sure we have _enough_ of the "sys_ni_syscall"
813 * entries. Don't panic if you notice that this hasn't
814 * been shrunk every time we add a new system call.
815 */
816
817 .rept NR_syscalls - (.-sys_call_table) / 4
818 .long sys_ni_syscall
819 .endr
820
diff --git a/arch/cris/arch-v32/kernel/fasttimer.c b/arch/cris/arch-v32/kernel/fasttimer.c
new file mode 100644
index 000000000000..ea2b4a97c8c7
--- /dev/null
+++ b/arch/cris/arch-v32/kernel/fasttimer.c
@@ -0,0 +1,996 @@
1/* $Id: fasttimer.c,v 1.11 2005/01/04 11:15:46 starvik Exp $
2 * linux/arch/cris/kernel/fasttimer.c
3 *
4 * Fast timers for ETRAX FS
5 * This may be useful in other OS than Linux so use 2 space indentation...
6 *
7 * $Log: fasttimer.c,v $
8 * Revision 1.11 2005/01/04 11:15:46 starvik
9 * Don't share timer IRQ.
10 *
11 * Revision 1.10 2004/12/07 09:19:38 starvik
12 * Corrected includes.
13 * Use correct interrupt macros.
14 *
15 * Revision 1.9 2004/05/14 10:18:58 starvik
16 * Export fast_timer_list
17 *
18 * Revision 1.8 2004/05/14 07:58:03 starvik
19 * Merge of changes from 2.4
20 *
21 * Revision 1.7 2003/07/10 12:06:14 starvik
22 * Return IRQ_NONE if irq wasn't handled
23 *
24 * Revision 1.6 2003/07/04 08:27:49 starvik
25 * Merge of Linux 2.5.74
26 *
27 * Revision 1.5 2003/06/05 10:16:22 johana
28 * New INTR_VECT macros.
29 *
30 * Revision 1.4 2003/06/03 08:49:45 johana
31 * Fixed typo.
32 *
33 * Revision 1.3 2003/06/02 12:51:27 johana
34 * Now compiles.
35 * Commented some include files that probably can be removed.
36 *
37 * Revision 1.2 2003/06/02 12:09:41 johana
38 * Ported to ETRAX FS using the trig interrupt instead of timer1.
39 *
40 * Revision 1.3 2002/12/12 08:26:32 starvik
41 * Don't use C-comments inside CVS comments
42 *
43 * Revision 1.2 2002/12/11 15:42:02 starvik
44 * Extracted v10 (ETRAX 100LX) specific stuff from arch/cris/kernel/
45 *
46 * Revision 1.1 2002/11/18 07:58:06 starvik
47 * Fast timers (from Linux 2.4)
48 *
49 * Revision 1.5 2002/10/15 06:21:39 starvik
50 * Added call to init_waitqueue_head
51 *
52 * Revision 1.4 2002/05/28 17:47:59 johana
53 * Added del_fast_timer()
54 *
55 * Revision 1.3 2002/05/28 16:16:07 johana
56 * Handle empty fast_timer_list
57 *
58 * Revision 1.2 2002/05/27 15:38:42 johana
59 * Made it compile without warnings on Linux 2.4.
60 * (includes, wait_queue, PROC_FS and snprintf)
61 *
62 * Revision 1.1 2002/05/27 15:32:25 johana
63 * arch/etrax100/kernel/fasttimer.c v1.8 from the elinux tree.
64 *
65 * Revision 1.8 2001/11/27 13:50:40 pkj
66 * Disable interrupts while stopping the timer and while modifying the
67 * list of active timers in timer1_handler() as it may be interrupted
68 * by other interrupts (e.g., the serial interrupt) which may add fast
69 * timers.
70 *
71 * Revision 1.7 2001/11/22 11:50:32 pkj
72 * * Only store information about the last 16 timers.
73 * * proc_fasttimer_read() now uses an allocated buffer, since it
74 * requires more space than just a page even for only writing the
75 * last 16 timers. The buffer is only allocated on request, so
76 * unless /proc/fasttimer is read, it is never allocated.
77 * * Renamed fast_timer_started to fast_timers_started to match
78 * fast_timers_added and fast_timers_expired.
79 * * Some clean-up.
80 *
81 * Revision 1.6 2000/12/13 14:02:08 johana
82 * Removed volatile for fast_timer_list
83 *
84 * Revision 1.5 2000/12/13 13:55:35 johana
85 * Added DEBUG_LOG, added som cli() and cleanup
86 *
87 * Revision 1.4 2000/12/05 13:48:50 johana
88 * Added range check when writing proc file, modified timer int handling
89 *
90 * Revision 1.3 2000/11/23 10:10:20 johana
91 * More debug/logging possibilities.
92 * Moved GET_JIFFIES_USEC() to timex.h and time.c
93 *
94 * Revision 1.2 2000/11/01 13:41:04 johana
95 * Clean up and bugfixes.
96 * Created new do_gettimeofday_fast() that gets a timeval struct
97 * with time based on jiffies and *R_TIMER0_DATA, uses a table
98 * for fast conversion of timer value to microseconds.
99 * (Much faster the standard do_gettimeofday() and we don't really
100 * wan't to use the true time - we wan't the "uptime" so timers don't screw up
101 * when we change the time.
102 * TODO: Add efficient support for continuous timers as well.
103 *
104 * Revision 1.1 2000/10/26 15:49:16 johana
105 * Added fasttimer, highresolution timers.
106 *
107 * Copyright (C) 2000,2001 2002, 2003 Axis Communications AB, Lund, Sweden
108 */
109
110#include <linux/errno.h>
111#include <linux/sched.h>
112#include <linux/kernel.h>
113#include <linux/param.h>
114#include <linux/string.h>
115#include <linux/vmalloc.h>
116#include <linux/interrupt.h>
117#include <linux/time.h>
118#include <linux/delay.h>
119
120#include <asm/irq.h>
121#include <asm/system.h>
122
123#include <linux/config.h>
124#include <linux/version.h>
125
126#include <asm/arch/hwregs/reg_map.h>
127#include <asm/arch/hwregs/reg_rdwr.h>
128#include <asm/arch/hwregs/timer_defs.h>
129#include <asm/fasttimer.h>
130#include <linux/proc_fs.h>
131
132/*
133 * timer0 is running at 100MHz and generating jiffies timer ticks
134 * at 100 or 1000 HZ.
135 * fasttimer gives an API that gives timers that expire "between" the jiffies
136 * giving microsecond resolution (10 ns).
137 * fasttimer uses reg_timer_rw_trig register to get interrupt when
138 * r_time reaches a certain value.
139 */
140
141
142#define DEBUG_LOG_INCLUDED
143#define FAST_TIMER_LOG
144//#define FAST_TIMER_TEST
145
146#define FAST_TIMER_SANITY_CHECKS
147
148#ifdef FAST_TIMER_SANITY_CHECKS
149#define SANITYCHECK(x) x
150static int sanity_failed = 0;
151#else
152#define SANITYCHECK(x)
153#endif
154
155#define D1(x)
156#define D2(x)
157#define DP(x)
158
159#define __INLINE__ inline
160
161static int fast_timer_running = 0;
162static int fast_timers_added = 0;
163static int fast_timers_started = 0;
164static int fast_timers_expired = 0;
165static int fast_timers_deleted = 0;
166static int fast_timer_is_init = 0;
167static int fast_timer_ints = 0;
168
169struct fast_timer *fast_timer_list = NULL;
170
171#ifdef DEBUG_LOG_INCLUDED
172#define DEBUG_LOG_MAX 128
173static const char * debug_log_string[DEBUG_LOG_MAX];
174static unsigned long debug_log_value[DEBUG_LOG_MAX];
175static int debug_log_cnt = 0;
176static int debug_log_cnt_wrapped = 0;
177
178#define DEBUG_LOG(string, value) \
179{ \
180 unsigned long log_flags; \
181 local_irq_save(log_flags); \
182 debug_log_string[debug_log_cnt] = (string); \
183 debug_log_value[debug_log_cnt] = (unsigned long)(value); \
184 if (++debug_log_cnt >= DEBUG_LOG_MAX) \
185 { \
186 debug_log_cnt = debug_log_cnt % DEBUG_LOG_MAX; \
187 debug_log_cnt_wrapped = 1; \
188 } \
189 local_irq_restore(log_flags); \
190}
191#else
192#define DEBUG_LOG(string, value)
193#endif
194
195
196#define NUM_TIMER_STATS 16
197#ifdef FAST_TIMER_LOG
198struct fast_timer timer_added_log[NUM_TIMER_STATS];
199struct fast_timer timer_started_log[NUM_TIMER_STATS];
200struct fast_timer timer_expired_log[NUM_TIMER_STATS];
201#endif
202
203int timer_div_settings[NUM_TIMER_STATS];
204int timer_delay_settings[NUM_TIMER_STATS];
205
206
207static void
208timer_trig_handler(void);
209
210
211
212/* Not true gettimeofday, only checks the jiffies (uptime) + useconds */
213void __INLINE__ do_gettimeofday_fast(struct timeval *tv)
214{
215 unsigned long sec = jiffies;
216 unsigned long usec = GET_JIFFIES_USEC();
217
218 usec += (sec % HZ) * (1000000 / HZ);
219 sec = sec / HZ;
220
221 if (usec > 1000000)
222 {
223 usec -= 1000000;
224 sec++;
225 }
226 tv->tv_sec = sec;
227 tv->tv_usec = usec;
228}
229
230int __INLINE__ timeval_cmp(struct timeval *t0, struct timeval *t1)
231{
232 if (t0->tv_sec < t1->tv_sec)
233 {
234 return -1;
235 }
236 else if (t0->tv_sec > t1->tv_sec)
237 {
238 return 1;
239 }
240 if (t0->tv_usec < t1->tv_usec)
241 {
242 return -1;
243 }
244 else if (t0->tv_usec > t1->tv_usec)
245 {
246 return 1;
247 }
248 return 0;
249}
250
251/* Called with ints off */
252void __INLINE__ start_timer_trig(unsigned long delay_us)
253{
254 reg_timer_rw_ack_intr ack_intr = { 0 };
255 reg_timer_rw_intr_mask intr_mask;
256 reg_timer_rw_trig trig;
257 reg_timer_rw_trig_cfg trig_cfg = { 0 };
258 reg_timer_r_time r_time;
259
260 r_time = REG_RD(timer, regi_timer, r_time);
261
262 D1(printk("start_timer_trig : %d us freq: %i div: %i\n",
263 delay_us, freq_index, div));
264 /* Clear trig irq */
265 intr_mask = REG_RD(timer, regi_timer, rw_intr_mask);
266 intr_mask.trig = 0;
267 REG_WR(timer, regi_timer, rw_intr_mask, intr_mask);
268
269 /* Set timer values */
270 /* r_time is 100MHz (10 ns resolution) */
271 trig = r_time + delay_us*(1000/10);
272
273 timer_div_settings[fast_timers_started % NUM_TIMER_STATS] = trig;
274 timer_delay_settings[fast_timers_started % NUM_TIMER_STATS] = delay_us;
275
276 /* Ack interrupt */
277 ack_intr.trig = 1;
278 REG_WR(timer, regi_timer, rw_ack_intr, ack_intr);
279
280 /* Start timer */
281 REG_WR(timer, regi_timer, rw_trig, trig);
282 trig_cfg.tmr = regk_timer_time;
283 REG_WR(timer, regi_timer, rw_trig_cfg, trig_cfg);
284
285 /* Check if we have already passed the trig time */
286 r_time = REG_RD(timer, regi_timer, r_time);
287 if (r_time < trig) {
288 /* No, Enable trig irq */
289 intr_mask = REG_RD(timer, regi_timer, rw_intr_mask);
290 intr_mask.trig = 1;
291 REG_WR(timer, regi_timer, rw_intr_mask, intr_mask);
292 fast_timers_started++;
293 fast_timer_running = 1;
294 }
295 else
296 {
297 /* We have passed the time, disable trig point, ack intr */
298 trig_cfg.tmr = regk_timer_off;
299 REG_WR(timer, regi_timer, rw_trig_cfg, trig_cfg);
300 REG_WR(timer, regi_timer, rw_ack_intr, ack_intr);
301 /* call the int routine directly */
302 timer_trig_handler();
303 }
304
305}
306
307/* In version 1.4 this function takes 27 - 50 us */
308void start_one_shot_timer(struct fast_timer *t,
309 fast_timer_function_type *function,
310 unsigned long data,
311 unsigned long delay_us,
312 const char *name)
313{
314 unsigned long flags;
315 struct fast_timer *tmp;
316
317 D1(printk("sft %s %d us\n", name, delay_us));
318
319 local_irq_save(flags);
320
321 do_gettimeofday_fast(&t->tv_set);
322 tmp = fast_timer_list;
323
324 SANITYCHECK({ /* Check so this is not in the list already... */
325 while (tmp != NULL)
326 {
327 if (tmp == t)
328 {
329 printk("timer name: %s data: 0x%08lX already in list!\n", name, data);
330 sanity_failed++;
331 return;
332 }
333 else
334 {
335 tmp = tmp->next;
336 }
337 }
338 tmp = fast_timer_list;
339 });
340
341 t->delay_us = delay_us;
342 t->function = function;
343 t->data = data;
344 t->name = name;
345
346 t->tv_expires.tv_usec = t->tv_set.tv_usec + delay_us % 1000000;
347 t->tv_expires.tv_sec = t->tv_set.tv_sec + delay_us / 1000000;
348 if (t->tv_expires.tv_usec > 1000000)
349 {
350 t->tv_expires.tv_usec -= 1000000;
351 t->tv_expires.tv_sec++;
352 }
353#ifdef FAST_TIMER_LOG
354 timer_added_log[fast_timers_added % NUM_TIMER_STATS] = *t;
355#endif
356 fast_timers_added++;
357
358 /* Check if this should timeout before anything else */
359 if (tmp == NULL || timeval_cmp(&t->tv_expires, &tmp->tv_expires) < 0)
360 {
361 /* Put first in list and modify the timer value */
362 t->prev = NULL;
363 t->next = fast_timer_list;
364 if (fast_timer_list)
365 {
366 fast_timer_list->prev = t;
367 }
368 fast_timer_list = t;
369#ifdef FAST_TIMER_LOG
370 timer_started_log[fast_timers_started % NUM_TIMER_STATS] = *t;
371#endif
372 start_timer_trig(delay_us);
373 } else {
374 /* Put in correct place in list */
375 while (tmp->next &&
376 timeval_cmp(&t->tv_expires, &tmp->next->tv_expires) > 0)
377 {
378 tmp = tmp->next;
379 }
380 /* Insert t after tmp */
381 t->prev = tmp;
382 t->next = tmp->next;
383 if (tmp->next)
384 {
385 tmp->next->prev = t;
386 }
387 tmp->next = t;
388 }
389
390 D2(printk("start_one_shot_timer: %d us done\n", delay_us));
391
392 local_irq_restore(flags);
393} /* start_one_shot_timer */
394
395static inline int fast_timer_pending (const struct fast_timer * t)
396{
397 return (t->next != NULL) || (t->prev != NULL) || (t == fast_timer_list);
398}
399
400static inline int detach_fast_timer (struct fast_timer *t)
401{
402 struct fast_timer *next, *prev;
403 if (!fast_timer_pending(t))
404 return 0;
405 next = t->next;
406 prev = t->prev;
407 if (next)
408 next->prev = prev;
409 if (prev)
410 prev->next = next;
411 else
412 fast_timer_list = next;
413 fast_timers_deleted++;
414 return 1;
415}
416
417int del_fast_timer(struct fast_timer * t)
418{
419 unsigned long flags;
420 int ret;
421
422 local_irq_save(flags);
423 ret = detach_fast_timer(t);
424 t->next = t->prev = NULL;
425 local_irq_restore(flags);
426 return ret;
427} /* del_fast_timer */
428
429
430/* Interrupt routines or functions called in interrupt context */
431
432/* Timer interrupt handler for trig interrupts */
433
434static irqreturn_t
435timer_trig_interrupt(int irq, void *dev_id, struct pt_regs *regs)
436{
437 reg_timer_r_masked_intr masked_intr;
438
439 /* Check if the timer interrupt is for us (a trig int) */
440 masked_intr = REG_RD(timer, regi_timer, r_masked_intr);
441 if (!masked_intr.trig)
442 return IRQ_NONE;
443 timer_trig_handler();
444 return IRQ_HANDLED;
445}
446
447static void timer_trig_handler(void)
448{
449 reg_timer_rw_ack_intr ack_intr = { 0 };
450 reg_timer_rw_intr_mask intr_mask;
451 reg_timer_rw_trig_cfg trig_cfg = { 0 };
452 struct fast_timer *t;
453 unsigned long flags;
454
455 local_irq_save(flags);
456
457 /* Clear timer trig interrupt */
458 intr_mask = REG_RD(timer, regi_timer, rw_intr_mask);
459 intr_mask.trig = 0;
460 REG_WR(timer, regi_timer, rw_intr_mask, intr_mask);
461
462 /* First stop timer, then ack interrupt */
463 /* Stop timer */
464 trig_cfg.tmr = regk_timer_off;
465 REG_WR(timer, regi_timer, rw_trig_cfg, trig_cfg);
466
467 /* Ack interrupt */
468 ack_intr.trig = 1;
469 REG_WR(timer, regi_timer, rw_ack_intr, ack_intr);
470
471 fast_timer_running = 0;
472 fast_timer_ints++;
473
474 local_irq_restore(flags);
475
476 t = fast_timer_list;
477 while (t)
478 {
479 struct timeval tv;
480
481 /* Has it really expired? */
482 do_gettimeofday_fast(&tv);
483 D1(printk("t: %is %06ius\n", tv.tv_sec, tv.tv_usec));
484
485 if (timeval_cmp(&t->tv_expires, &tv) <= 0)
486 {
487 /* Yes it has expired */
488#ifdef FAST_TIMER_LOG
489 timer_expired_log[fast_timers_expired % NUM_TIMER_STATS] = *t;
490#endif
491 fast_timers_expired++;
492
493 /* Remove this timer before call, since it may reuse the timer */
494 local_irq_save(flags);
495 if (t->prev)
496 {
497 t->prev->next = t->next;
498 }
499 else
500 {
501 fast_timer_list = t->next;
502 }
503 if (t->next)
504 {
505 t->next->prev = t->prev;
506 }
507 t->prev = NULL;
508 t->next = NULL;
509 local_irq_restore(flags);
510
511 if (t->function != NULL)
512 {
513 t->function(t->data);
514 }
515 else
516 {
517 DEBUG_LOG("!trimertrig %i function==NULL!\n", fast_timer_ints);
518 }
519 }
520 else
521 {
522 /* Timer is to early, let's set it again using the normal routines */
523 D1(printk(".\n"));
524 }
525
526 local_irq_save(flags);
527 if ((t = fast_timer_list) != NULL)
528 {
529 /* Start next timer.. */
530 long us;
531 struct timeval tv;
532
533 do_gettimeofday_fast(&tv);
534 us = ((t->tv_expires.tv_sec - tv.tv_sec) * 1000000 +
535 t->tv_expires.tv_usec - tv.tv_usec);
536 if (us > 0)
537 {
538 if (!fast_timer_running)
539 {
540#ifdef FAST_TIMER_LOG
541 timer_started_log[fast_timers_started % NUM_TIMER_STATS] = *t;
542#endif
543 start_timer_trig(us);
544 }
545 local_irq_restore(flags);
546 break;
547 }
548 else
549 {
550 /* Timer already expired, let's handle it better late than never.
551 * The normal loop handles it
552 */
553 D1(printk("e! %d\n", us));
554 }
555 }
556 local_irq_restore(flags);
557 }
558
559 if (!t)
560 {
561 D1(printk("ttrig stop!\n"));
562 }
563}
564
565static void wake_up_func(unsigned long data)
566{
567#ifdef DECLARE_WAITQUEUE
568 wait_queue_head_t *sleep_wait_p = (wait_queue_head_t*)data;
569#else
570 struct wait_queue **sleep_wait_p = (struct wait_queue **)data;
571#endif
572 wake_up(sleep_wait_p);
573}
574
575
576/* Useful API */
577
578void schedule_usleep(unsigned long us)
579{
580 struct fast_timer t;
581#ifdef DECLARE_WAITQUEUE
582 wait_queue_head_t sleep_wait;
583 init_waitqueue_head(&sleep_wait);
584 {
585 DECLARE_WAITQUEUE(wait, current);
586#else
587 struct wait_queue *sleep_wait = NULL;
588 struct wait_queue wait = { current, NULL };
589#endif
590
591 D1(printk("schedule_usleep(%d)\n", us));
592 add_wait_queue(&sleep_wait, &wait);
593 set_current_state(TASK_INTERRUPTIBLE);
594 start_one_shot_timer(&t, wake_up_func, (unsigned long)&sleep_wait, us,
595 "usleep");
596 schedule();
597 set_current_state(TASK_RUNNING);
598 remove_wait_queue(&sleep_wait, &wait);
599 D1(printk("done schedule_usleep(%d)\n", us));
600#ifdef DECLARE_WAITQUEUE
601 }
602#endif
603}
604
605#ifdef CONFIG_PROC_FS
606static int proc_fasttimer_read(char *buf, char **start, off_t offset, int len
607#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,2,0)
608 ,int *eof, void *data_unused
609#else
610 ,int unused
611#endif
612 );
613#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,2,0)
614static struct proc_dir_entry *fasttimer_proc_entry;
615#else
616static struct proc_dir_entry fasttimer_proc_entry =
617{
618 0, 9, "fasttimer",
619 S_IFREG | S_IRUGO, 1, 0, 0,
620 0, NULL /* ops -- default to array */,
621 &proc_fasttimer_read /* get_info */,
622};
623#endif
624#endif /* CONFIG_PROC_FS */
625
626#ifdef CONFIG_PROC_FS
627
628/* This value is very much based on testing */
629#define BIG_BUF_SIZE (500 + NUM_TIMER_STATS * 300)
630
631static int proc_fasttimer_read(char *buf, char **start, off_t offset, int len
632#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,2,0)
633 ,int *eof, void *data_unused
634#else
635 ,int unused
636#endif
637 )
638{
639 unsigned long flags;
640 int i = 0;
641 int num_to_show;
642 struct timeval tv;
643 struct fast_timer *t, *nextt;
644 static char *bigbuf = NULL;
645 static unsigned long used;
646
647 if (!bigbuf && !(bigbuf = vmalloc(BIG_BUF_SIZE)))
648 {
649 used = 0;
650 bigbuf[0] = '\0';
651 return 0;
652 }
653
654 if (!offset || !used)
655 {
656 do_gettimeofday_fast(&tv);
657
658 used = 0;
659 used += sprintf(bigbuf + used, "Fast timers added: %i\n",
660 fast_timers_added);
661 used += sprintf(bigbuf + used, "Fast timers started: %i\n",
662 fast_timers_started);
663 used += sprintf(bigbuf + used, "Fast timer interrupts: %i\n",
664 fast_timer_ints);
665 used += sprintf(bigbuf + used, "Fast timers expired: %i\n",
666 fast_timers_expired);
667 used += sprintf(bigbuf + used, "Fast timers deleted: %i\n",
668 fast_timers_deleted);
669 used += sprintf(bigbuf + used, "Fast timer running: %s\n",
670 fast_timer_running ? "yes" : "no");
671 used += sprintf(bigbuf + used, "Current time: %lu.%06lu\n",
672 (unsigned long)tv.tv_sec,
673 (unsigned long)tv.tv_usec);
674#ifdef FAST_TIMER_SANITY_CHECKS
675 used += sprintf(bigbuf + used, "Sanity failed: %i\n",
676 sanity_failed);
677#endif
678 used += sprintf(bigbuf + used, "\n");
679
680#ifdef DEBUG_LOG_INCLUDED
681 {
682 int end_i = debug_log_cnt;
683 i = 0;
684
685 if (debug_log_cnt_wrapped)
686 {
687 i = debug_log_cnt;
688 }
689
690 while ((i != end_i || (debug_log_cnt_wrapped && !used)) &&
691 used+100 < BIG_BUF_SIZE)
692 {
693 used += sprintf(bigbuf + used, debug_log_string[i],
694 debug_log_value[i]);
695 i = (i+1) % DEBUG_LOG_MAX;
696 }
697 }
698 used += sprintf(bigbuf + used, "\n");
699#endif
700
701 num_to_show = (fast_timers_started < NUM_TIMER_STATS ? fast_timers_started:
702 NUM_TIMER_STATS);
703 used += sprintf(bigbuf + used, "Timers started: %i\n", fast_timers_started);
704 for (i = 0; i < num_to_show && (used+100 < BIG_BUF_SIZE) ; i++)
705 {
706 int cur = (fast_timers_started - i - 1) % NUM_TIMER_STATS;
707
708#if 1 //ndef FAST_TIMER_LOG
709 used += sprintf(bigbuf + used, "div: %i delay: %i"
710 "\n",
711 timer_div_settings[cur],
712 timer_delay_settings[cur]
713 );
714#endif
715#ifdef FAST_TIMER_LOG
716 t = &timer_started_log[cur];
717 used += sprintf(bigbuf + used, "%-14s s: %6lu.%06lu e: %6lu.%06lu "
718 "d: %6li us data: 0x%08lX"
719 "\n",
720 t->name,
721 (unsigned long)t->tv_set.tv_sec,
722 (unsigned long)t->tv_set.tv_usec,
723 (unsigned long)t->tv_expires.tv_sec,
724 (unsigned long)t->tv_expires.tv_usec,
725 t->delay_us,
726 t->data
727 );
728#endif
729 }
730 used += sprintf(bigbuf + used, "\n");
731
732#ifdef FAST_TIMER_LOG
733 num_to_show = (fast_timers_added < NUM_TIMER_STATS ? fast_timers_added:
734 NUM_TIMER_STATS);
735 used += sprintf(bigbuf + used, "Timers added: %i\n", fast_timers_added);
736 for (i = 0; i < num_to_show && (used+100 < BIG_BUF_SIZE); i++)
737 {
738 t = &timer_added_log[(fast_timers_added - i - 1) % NUM_TIMER_STATS];
739 used += sprintf(bigbuf + used, "%-14s s: %6lu.%06lu e: %6lu.%06lu "
740 "d: %6li us data: 0x%08lX"
741 "\n",
742 t->name,
743 (unsigned long)t->tv_set.tv_sec,
744 (unsigned long)t->tv_set.tv_usec,
745 (unsigned long)t->tv_expires.tv_sec,
746 (unsigned long)t->tv_expires.tv_usec,
747 t->delay_us,
748 t->data
749 );
750 }
751 used += sprintf(bigbuf + used, "\n");
752
753 num_to_show = (fast_timers_expired < NUM_TIMER_STATS ? fast_timers_expired:
754 NUM_TIMER_STATS);
755 used += sprintf(bigbuf + used, "Timers expired: %i\n", fast_timers_expired);
756 for (i = 0; i < num_to_show && (used+100 < BIG_BUF_SIZE); i++)
757 {
758 t = &timer_expired_log[(fast_timers_expired - i - 1) % NUM_TIMER_STATS];
759 used += sprintf(bigbuf + used, "%-14s s: %6lu.%06lu e: %6lu.%06lu "
760 "d: %6li us data: 0x%08lX"
761 "\n",
762 t->name,
763 (unsigned long)t->tv_set.tv_sec,
764 (unsigned long)t->tv_set.tv_usec,
765 (unsigned long)t->tv_expires.tv_sec,
766 (unsigned long)t->tv_expires.tv_usec,
767 t->delay_us,
768 t->data
769 );
770 }
771 used += sprintf(bigbuf + used, "\n");
772#endif
773
774 used += sprintf(bigbuf + used, "Active timers:\n");
775 local_irq_save(flags);
776 local_irq_save(flags);
777 t = fast_timer_list;
778 while (t != NULL && (used+100 < BIG_BUF_SIZE))
779 {
780 nextt = t->next;
781 local_irq_restore(flags);
782 used += sprintf(bigbuf + used, "%-14s s: %6lu.%06lu e: %6lu.%06lu "
783 "d: %6li us data: 0x%08lX"
784/* " func: 0x%08lX" */
785 "\n",
786 t->name,
787 (unsigned long)t->tv_set.tv_sec,
788 (unsigned long)t->tv_set.tv_usec,
789 (unsigned long)t->tv_expires.tv_sec,
790 (unsigned long)t->tv_expires.tv_usec,
791 t->delay_us,
792 t->data
793/* , t->function */
794 );
795 local_irq_disable();
796 if (t->next != nextt)
797 {
798 printk("timer removed!\n");
799 }
800 t = nextt;
801 }
802 local_irq_restore(flags);
803 }
804
805 if (used - offset < len)
806 {
807 len = used - offset;
808 }
809
810 memcpy(buf, bigbuf + offset, len);
811 *start = buf;
812#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,2,0)
813 *eof = 1;
814#endif
815
816 return len;
817}
818#endif /* PROC_FS */
819
820#ifdef FAST_TIMER_TEST
821static volatile unsigned long i = 0;
822static volatile int num_test_timeout = 0;
823static struct fast_timer tr[10];
824static int exp_num[10];
825
826static struct timeval tv_exp[100];
827
828static void test_timeout(unsigned long data)
829{
830 do_gettimeofday_fast(&tv_exp[data]);
831 exp_num[data] = num_test_timeout;
832
833 num_test_timeout++;
834}
835
836static void test_timeout1(unsigned long data)
837{
838 do_gettimeofday_fast(&tv_exp[data]);
839 exp_num[data] = num_test_timeout;
840 if (data < 7)
841 {
842 start_one_shot_timer(&tr[i], test_timeout1, i, 1000, "timeout1");
843 i++;
844 }
845 num_test_timeout++;
846}
847
848DP(
849static char buf0[2000];
850static char buf1[2000];
851static char buf2[2000];
852static char buf3[2000];
853static char buf4[2000];
854);
855
856static char buf5[6000];
857static int j_u[1000];
858
859static void fast_timer_test(void)
860{
861 int prev_num;
862 int j;
863
864 struct timeval tv, tv0, tv1, tv2;
865
866 printk("fast_timer_test() start\n");
867 do_gettimeofday_fast(&tv);
868
869 for (j = 0; j < 1000; j++)
870 {
871 j_u[j] = GET_JIFFIES_USEC();
872 }
873 for (j = 0; j < 100; j++)
874 {
875 do_gettimeofday_fast(&tv_exp[j]);
876 }
877 printk("fast_timer_test() %is %06i\n", tv.tv_sec, tv.tv_usec);
878
879 for (j = 0; j < 1000; j++)
880 {
881 printk("%i %i %i %i %i\n",j_u[j], j_u[j+1], j_u[j+2], j_u[j+3], j_u[j+4]);
882 j += 4;
883 }
884 for (j = 0; j < 100; j++)
885 {
886 printk("%i.%i %i.%i %i.%i %i.%i %i.%i\n",
887 tv_exp[j].tv_sec,tv_exp[j].tv_usec,
888 tv_exp[j+1].tv_sec,tv_exp[j+1].tv_usec,
889 tv_exp[j+2].tv_sec,tv_exp[j+2].tv_usec,
890 tv_exp[j+3].tv_sec,tv_exp[j+3].tv_usec,
891 tv_exp[j+4].tv_sec,tv_exp[j+4].tv_usec);
892 j += 4;
893 }
894 do_gettimeofday_fast(&tv0);
895 start_one_shot_timer(&tr[i], test_timeout, i, 50000, "test0");
896 DP(proc_fasttimer_read(buf0, NULL, 0, 0, 0));
897 i++;
898 start_one_shot_timer(&tr[i], test_timeout, i, 70000, "test1");
899 DP(proc_fasttimer_read(buf1, NULL, 0, 0, 0));
900 i++;
901 start_one_shot_timer(&tr[i], test_timeout, i, 40000, "test2");
902 DP(proc_fasttimer_read(buf2, NULL, 0, 0, 0));
903 i++;
904 start_one_shot_timer(&tr[i], test_timeout, i, 60000, "test3");
905 DP(proc_fasttimer_read(buf3, NULL, 0, 0, 0));
906 i++;
907 start_one_shot_timer(&tr[i], test_timeout1, i, 55000, "test4xx");
908 DP(proc_fasttimer_read(buf4, NULL, 0, 0, 0));
909 i++;
910 do_gettimeofday_fast(&tv1);
911
912 proc_fasttimer_read(buf5, NULL, 0, 0, 0);
913
914 prev_num = num_test_timeout;
915 while (num_test_timeout < i)
916 {
917 if (num_test_timeout != prev_num)
918 {
919 prev_num = num_test_timeout;
920 }
921 }
922 do_gettimeofday_fast(&tv2);
923 printk("Timers started %is %06i\n", tv0.tv_sec, tv0.tv_usec);
924 printk("Timers started at %is %06i\n", tv1.tv_sec, tv1.tv_usec);
925 printk("Timers done %is %06i\n", tv2.tv_sec, tv2.tv_usec);
926 DP(printk("buf0:\n");
927 printk(buf0);
928 printk("buf1:\n");
929 printk(buf1);
930 printk("buf2:\n");
931 printk(buf2);
932 printk("buf3:\n");
933 printk(buf3);
934 printk("buf4:\n");
935 printk(buf4);
936 );
937 printk("buf5:\n");
938 printk(buf5);
939
940 printk("timers set:\n");
941 for(j = 0; j<i; j++)
942 {
943 struct fast_timer *t = &tr[j];
944 printk("%-10s set: %6is %06ius exp: %6is %06ius "
945 "data: 0x%08X func: 0x%08X\n",
946 t->name,
947 t->tv_set.tv_sec,
948 t->tv_set.tv_usec,
949 t->tv_expires.tv_sec,
950 t->tv_expires.tv_usec,
951 t->data,
952 t->function
953 );
954
955 printk(" del: %6ius did exp: %6is %06ius as #%i error: %6li\n",
956 t->delay_us,
957 tv_exp[j].tv_sec,
958 tv_exp[j].tv_usec,
959 exp_num[j],
960 (tv_exp[j].tv_sec - t->tv_expires.tv_sec)*1000000 + tv_exp[j].tv_usec - t->tv_expires.tv_usec);
961 }
962 proc_fasttimer_read(buf5, NULL, 0, 0, 0);
963 printk("buf5 after all done:\n");
964 printk(buf5);
965 printk("fast_timer_test() done\n");
966}
967#endif
968
969
970void fast_timer_init(void)
971{
972 /* For some reason, request_irq() hangs when called froom time_init() */
973 if (!fast_timer_is_init)
974 {
975 printk("fast_timer_init()\n");
976
977#ifdef CONFIG_PROC_FS
978#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,2,0)
979 if ((fasttimer_proc_entry = create_proc_entry( "fasttimer", 0, 0 )))
980 fasttimer_proc_entry->read_proc = proc_fasttimer_read;
981#else
982 proc_register_dynamic(&proc_root, &fasttimer_proc_entry);
983#endif
984#endif /* PROC_FS */
985 if(request_irq(TIMER_INTR_VECT, timer_trig_interrupt, SA_INTERRUPT,
986 "fast timer int", NULL))
987 {
988 printk("err: timer1 irq\n");
989 }
990 fast_timer_is_init = 1;
991#ifdef FAST_TIMER_TEST
992 printk("do test\n");
993 fast_timer_test();
994#endif
995 }
996}
diff --git a/arch/cris/arch-v32/kernel/head.S b/arch/cris/arch-v32/kernel/head.S
new file mode 100644
index 000000000000..3cfe57dc391d
--- /dev/null
+++ b/arch/cris/arch-v32/kernel/head.S
@@ -0,0 +1,448 @@
1/*
2 * CRISv32 kernel startup code.
3 *
4 * Copyright (C) 2003, Axis Communications AB
5 */
6
7#include <linux/config.h>
8
9#define ASSEMBLER_MACROS_ONLY
10
11/*
12 * The macros found in mmu_defs_asm.h uses the ## concatenation operator, so
13 * -traditional must not be used when assembling this file.
14 */
15#include <asm/arch/hwregs/reg_rdwr.h>
16#include <asm/arch/hwregs/asm/mmu_defs_asm.h>
17#include <asm/arch/hwregs/asm/reg_map_asm.h>
18#include <asm/arch/hwregs/asm/config_defs_asm.h>
19#include <asm/arch/hwregs/asm/bif_core_defs_asm.h>
20
21#define CRAMFS_MAGIC 0x28cd3d45
22#define RAM_INIT_MAGIC 0x56902387
23#define COMMAND_LINE_MAGIC 0x87109563
24
25 ;; NOTE: R8 and R9 carry information from the decompressor (if the
26 ;; kernel was compressed). They must not be used in the code below
27 ;; until they are read!
28
29 ;; Exported symbols.
30 .global etrax_irv
31 .global romfs_start
32 .global romfs_length
33 .global romfs_in_flash
34 .global swapper_pg_dir
35 .global crisv32_nand_boot
36 .global crisv32_nand_cramfs_offset
37
38 ;; Dummy section to make it bootable with current VCS simulator
39#ifdef CONFIG_ETRAXFS_SIM
40 .section ".boot", "ax"
41 ba tstart
42 nop
43#endif
44
45 .text
46tstart:
47 ;; This is the entry point of the kernel. The CPU is currently in
48 ;; supervisor mode.
49 ;;
50 ;; 0x00000000 if flash.
51 ;; 0x40004000 if DRAM.
52 ;;
53 di
54
55 ;; Start clocks for used blocks.
56 move.d REG_ADDR(config, regi_config, rw_clk_ctrl), $r1
57 move.d [$r1], $r0
58 or.d REG_STATE(config, rw_clk_ctrl, cpu, yes) | \
59 REG_STATE(config, rw_clk_ctrl, bif, yes) | \
60 REG_STATE(config, rw_clk_ctrl, fix_io, yes), $r0
61 move.d $r0, [$r1]
62
63 ;; Set up waitstates etc
64 move.d REG_ADDR(bif_core, regi_bif_core, rw_grp1_cfg), $r0
65 move.d CONFIG_ETRAX_MEM_GRP1_CONFIG, $r1
66 move.d $r1, [$r0]
67 move.d REG_ADDR(bif_core, regi_bif_core, rw_grp2_cfg), $r0
68 move.d CONFIG_ETRAX_MEM_GRP2_CONFIG, $r1
69 move.d $r1, [$r0]
70 move.d REG_ADDR(bif_core, regi_bif_core, rw_grp3_cfg), $r0
71 move.d CONFIG_ETRAX_MEM_GRP3_CONFIG, $r1
72 move.d $r1, [$r0]
73 move.d REG_ADDR(bif_core, regi_bif_core, rw_grp4_cfg), $r0
74 move.d CONFIG_ETRAX_MEM_GRP4_CONFIG, $r1
75 move.d $r1, [$r0]
76
77#ifdef CONFIG_ETRAXFS_SIM
78 ;; Set up minimal flash waitstates
79 move.d 0, $r10
80 move.d REG_ADDR(bif_core, regi_bif_core, rw_grp1_cfg), $r11
81 move.d $r10, [$r11]
82#endif
83
84 ;; Setup and enable the MMU. Use same configuration for both the data
85 ;; and the instruction MMU.
86 ;;
87 ;; Note; 3 cycles is needed for a bank-select to take effect. Further;
88 ;; bank 1 is the instruction MMU, bank 2 is the data MMU.
89#ifndef CONFIG_ETRAXFS_SIM
90 move.d REG_FIELD(mmu, rw_mm_kbase_hi, base_e, 8) \
91 | REG_FIELD(mmu, rw_mm_kbase_hi, base_c, 4) \
92 | REG_FIELD(mmu, rw_mm_kbase_hi, base_b, 0xb), $r0
93#else
94 ;; Map the virtual DRAM to the RW eprom area at address 0.
95 ;; Also map 0xa for the hook calls,
96 move.d REG_FIELD(mmu, rw_mm_kbase_hi, base_e, 8) \
97 | REG_FIELD(mmu, rw_mm_kbase_hi, base_c, 0) \
98 | REG_FIELD(mmu, rw_mm_kbase_hi, base_b, 0xb) \
99 | REG_FIELD(mmu, rw_mm_kbase_hi, base_a, 0xa), $r0
100#endif
101
102 ;; Temporary map of 0x40 -> 0x40 and 0x00 -> 0x00.
103 move.d REG_FIELD(mmu, rw_mm_kbase_lo, base_4, 4) \
104 | REG_FIELD(mmu, rw_mm_kbase_lo, base_0, 0), $r1
105
106 ;; Enable certain page protections and setup linear mapping
107 ;; for f,e,c,b,4,0.
108#ifndef CONFIG_ETRAXFS_SIM
109 move.d REG_STATE(mmu, rw_mm_cfg, we, on) \
110 | REG_STATE(mmu, rw_mm_cfg, acc, on) \
111 | REG_STATE(mmu, rw_mm_cfg, ex, on) \
112 | REG_STATE(mmu, rw_mm_cfg, inv, on) \
113 | REG_STATE(mmu, rw_mm_cfg, seg_f, linear) \
114 | REG_STATE(mmu, rw_mm_cfg, seg_e, linear) \
115 | REG_STATE(mmu, rw_mm_cfg, seg_d, page) \
116 | REG_STATE(mmu, rw_mm_cfg, seg_c, linear) \
117 | REG_STATE(mmu, rw_mm_cfg, seg_b, linear) \
118 | REG_STATE(mmu, rw_mm_cfg, seg_a, page) \
119 | REG_STATE(mmu, rw_mm_cfg, seg_9, page) \
120 | REG_STATE(mmu, rw_mm_cfg, seg_8, page) \
121 | REG_STATE(mmu, rw_mm_cfg, seg_7, page) \
122 | REG_STATE(mmu, rw_mm_cfg, seg_6, page) \
123 | REG_STATE(mmu, rw_mm_cfg, seg_5, page) \
124 | REG_STATE(mmu, rw_mm_cfg, seg_4, linear) \
125 | REG_STATE(mmu, rw_mm_cfg, seg_3, page) \
126 | REG_STATE(mmu, rw_mm_cfg, seg_2, page) \
127 | REG_STATE(mmu, rw_mm_cfg, seg_1, page) \
128 | REG_STATE(mmu, rw_mm_cfg, seg_0, linear), $r2
129#else
130 move.d REG_STATE(mmu, rw_mm_cfg, we, on) \
131 | REG_STATE(mmu, rw_mm_cfg, acc, on) \
132 | REG_STATE(mmu, rw_mm_cfg, ex, on) \
133 | REG_STATE(mmu, rw_mm_cfg, inv, on) \
134 | REG_STATE(mmu, rw_mm_cfg, seg_f, linear) \
135 | REG_STATE(mmu, rw_mm_cfg, seg_e, linear) \
136 | REG_STATE(mmu, rw_mm_cfg, seg_d, page) \
137 | REG_STATE(mmu, rw_mm_cfg, seg_c, linear) \
138 | REG_STATE(mmu, rw_mm_cfg, seg_b, linear) \
139 | REG_STATE(mmu, rw_mm_cfg, seg_a, linear) \
140 | REG_STATE(mmu, rw_mm_cfg, seg_9, page) \
141 | REG_STATE(mmu, rw_mm_cfg, seg_8, page) \
142 | REG_STATE(mmu, rw_mm_cfg, seg_7, page) \
143 | REG_STATE(mmu, rw_mm_cfg, seg_6, page) \
144 | REG_STATE(mmu, rw_mm_cfg, seg_5, page) \
145 | REG_STATE(mmu, rw_mm_cfg, seg_4, linear) \
146 | REG_STATE(mmu, rw_mm_cfg, seg_3, page) \
147 | REG_STATE(mmu, rw_mm_cfg, seg_2, page) \
148 | REG_STATE(mmu, rw_mm_cfg, seg_1, page) \
149 | REG_STATE(mmu, rw_mm_cfg, seg_0, linear), $r2
150#endif
151
152 ;; Update instruction MMU.
153 move 1, $srs
154 nop
155 nop
156 nop
157 move $r0, $s2 ; kbase_hi.
158 move $r1, $s1 ; kbase_lo.
159 move $r2, $s0 ; mm_cfg, virtual memory configuration.
160
161 ;; Update data MMU.
162 move 2, $srs
163 nop
164 nop
165 nop
166 move $r0, $s2 ; kbase_hi.
167 move $r1, $s1 ; kbase_lo
168 move $r2, $s0 ; mm_cfg, virtual memory configuration.
169
170 ;; Enable data and instruction MMU.
171 move 0, $srs
172 moveq 0xf, $r0 ; IMMU, DMMU, DCache, Icache on
173 nop
174 nop
175 nop
176 move $r0, $s0
177 nop
178 nop
179 nop
180
181#ifdef CONFIG_SMP
182 ;; Read CPU ID
183 move 0, $srs
184 nop
185 nop
186 nop
187 move $s10, $r0
188 cmpq 0, $r0
189 beq master_cpu
190 nop
191slave_cpu:
192 ; A slave waits for cpu_now_booting to be equal to CPU ID.
193 move.d cpu_now_booting, $r1
194slave_wait:
195 cmp.d [$r1], $r0
196 bne slave_wait
197 nop
198 ; Time to boot-up. Get stack location provided by master CPU.
199 move.d smp_init_current_idle_thread, $r1
200 move.d [$r1], $sp
201 add.d 8192, $sp
202 move.d ebp_start, $r0 ; Defined in linker-script.
203 move $r0, $ebp
204 jsr smp_callin
205 nop
206master_cpu:
207#endif
208#ifndef CONFIG_ETRAXFS_SIM
209 ;; Check if starting from DRAM or flash.
210 lapcq ., $r0
211 and.d 0x7fffffff, $r0 ; Mask off the non-cache bit.
212 cmp.d 0x10000, $r0 ; Arbitrary, something above this code.
213 blo _inflash0
214 nop
215#endif
216
217 jump _inram ; Jump to cached RAM.
218 nop
219
220 ;; Jumpgate.
221_inflash0:
222 jump _inflash
223 nop
224
225 ;; Put the following in a section so that storage for it can be
226 ;; reclaimed after init is finished.
227 .section ".init.text", "ax"
228
229_inflash:
230
231 ;; Initialize DRAM.
232 cmp.d RAM_INIT_MAGIC, $r8 ; Already initialized?
233 beq _dram_initialized
234 nop
235
236#include "../lib/dram_init.S"
237
238_dram_initialized:
239 ;; Copy the text and data section to DRAM. This depends on that the
240 ;; variables used below are correctly set up by the linker script.
241 ;; The calculated value stored in R4 is used below.
242 moveq 0, $r0 ; Source.
243 move.d text_start, $r1 ; Destination.
244 move.d __vmlinux_end, $r2
245 move.d $r2, $r4
246 sub.d $r1, $r4
2471: move.w [$r0+], $r3
248 move.w $r3, [$r1+]
249 cmp.d $r2, $r1
250 blo 1b
251 nop
252
253 ;; Keep CRAMFS in flash.
254 moveq 0, $r0
255 move.d romfs_length, $r1
256 move.d $r0, [$r1]
257 move.d [$r4], $r0 ; cramfs_super.magic
258 cmp.d CRAMFS_MAGIC, $r0
259 bne 1f
260 nop
261
262 addoq +4, $r4, $acr
263 move.d [$acr], $r0
264 move.d romfs_length, $r1
265 move.d $r0, [$r1]
266 add.d 0xf0000000, $r4 ; Add cached flash start in virtual memory.
267 move.d romfs_start, $r1
268 move.d $r4, [$r1]
2691: moveq 1, $r0
270 move.d romfs_in_flash, $r1
271 move.d $r0, [$r1]
272
273 jump _start_it ; Jump to cached code.
274 nop
275
276_inram:
277 ;; Check if booting from NAND flash (in that case we just remember the offset
278 ;; into the flash where cramfs should be).
279 move.d REG_ADDR(config, regi_config, r_bootsel), $r0
280 move.d [$r0], $r0
281 and.d REG_MASK(config, r_bootsel, boot_mode), $r0
282 cmp.d REG_STATE(config, r_bootsel, boot_mode, nand), $r0
283 bne move_cramfs
284 moveq 1,$r0
285 move.d crisv32_nand_boot, $r1
286 move.d $r0, [$r1]
287 move.d crisv32_nand_cramfs_offset, $r1
288 move.d $r9, [$r1]
289 moveq 1, $r0
290 move.d romfs_in_flash, $r1
291 move.d $r0, [$r1]
292 jump _start_it
293 nop
294
295move_cramfs:
296 ;; Move the cramfs after BSS.
297 moveq 0, $r0
298 move.d romfs_length, $r1
299 move.d $r0, [$r1]
300
301#ifndef CONFIG_ETRAXFS_SIM
302 ;; The kernel could have been unpacked to DRAM by the loader, but
303 ;; the cramfs image could still be inte the flash immediately
304 ;; following the compressed kernel image. The loaded passes the address
305 ;; of the bute succeeding the last compressed byte in the flash in
306 ;; register R9 when starting the kernel.
307 cmp.d 0x0ffffff8, $r9
308 bhs _no_romfs_in_flash ; R9 points outside the flash area.
309 nop
310#else
311 ba _no_romfs_in_flash
312 nop
313#endif
314 move.d [$r9], $r0 ; cramfs_super.magic
315 cmp.d CRAMFS_MAGIC, $r0
316 bne _no_romfs_in_flash
317 nop
318
319 addoq +4, $r9, $acr
320 move.d [$acr], $r0
321 move.d romfs_length, $r1
322 move.d $r0, [$r1]
323 add.d 0xf0000000, $r9 ; Add cached flash start in virtual memory.
324 move.d romfs_start, $r1
325 move.d $r9, [$r1]
326 moveq 1, $r0
327 move.d romfs_in_flash, $r1
328 move.d $r0, [$r1]
329
330 jump _start_it ; Jump to cached code.
331 nop
332
333_no_romfs_in_flash:
334 ;; Look for cramfs.
335#ifndef CONFIG_ETRAXFS_SIM
336 move.d __vmlinux_end, $r0
337#else
338 move.d __end, $r0
339#endif
340 move.d [$r0], $r1
341 cmp.d CRAMFS_MAGIC, $r1
342 bne 2f
343 nop
344
345 addoq +4, $r0, $acr
346 move.d [$acr], $r2
347 move.d _end, $r1
348 move.d romfs_start, $r3
349 move.d $r1, [$r3]
350 move.d romfs_length, $r3
351 move.d $r2, [$r3]
352
353#ifndef CONFIG_ETRAXFS_SIM
354 add.d $r2, $r0
355 add.d $r2, $r1
356
357 lsrq 1, $r2 ; Size is in bytes, we copy words.
358 addq 1, $r2
3591:
360 move.w [$r0], $r3
361 move.w $r3, [$r1]
362 subq 2, $r0
363 subq 2, $r1
364 subq 1, $r2
365 bne 1b
366 nop
367#endif
368
3692:
370 moveq 0, $r0
371 move.d romfs_in_flash, $r1
372 move.d $r0, [$r1]
373
374 jump _start_it ; Jump to cached code.
375 nop
376
377_start_it:
378
379 ;; Check if kernel command line is supplied
380 cmp.d COMMAND_LINE_MAGIC, $r10
381 bne no_command_line
382 nop
383
384 move.d 256, $r13
385 move.d cris_command_line, $r10
386 or.d 0x80000000, $r11 ; Make it virtual
3871:
388 move.b [$r11+], $r12
389 move.b $r12, [$r10+]
390 subq 1, $r13
391 bne 1b
392 nop
393
394no_command_line:
395
396 ;; The kernel stack contains a task structure for each task. This
397 ;; the initial kernel stack is in the same page as the init_task,
398 ;; but starts at the top of the page, i.e. + 8192 bytes.
399 move.d init_thread_union + 8192, $sp
400 move.d ebp_start, $r0 ; Defined in linker-script.
401 move $r0, $ebp
402 move.d etrax_irv, $r1 ; Set the exception base register and pointer.
403 move.d $r0, [$r1]
404
405#ifndef CONFIG_ETRAXFS_SIM
406 ;; Clear the BSS region from _bss_start to _end.
407 move.d __bss_start, $r0
408 move.d _end, $r1
4091: clear.d [$r0+]
410 cmp.d $r1, $r0
411 blo 1b
412 nop
413#endif
414
415#ifdef CONFIG_ETRAXFS_SIM
416 /* Set the watchdog timeout to something big. Will be removed when */
417 /* watchdog can be disabled with command line option */
418 move.d 0x7fffffff, $r10
419 jsr CPU_WATCHDOG_TIMEOUT
420 nop
421#endif
422
423 ; Initialize registers to increase determinism
424 move.d __bss_start, $r0
425 movem [$r0], $r13
426
427 jump start_kernel ; Jump to start_kernel() in init/main.c.
428 nop
429
430 .data
431etrax_irv:
432 .dword 0
433romfs_start:
434 .dword 0
435romfs_length:
436 .dword 0
437romfs_in_flash:
438 .dword 0
439crisv32_nand_boot:
440 .dword 0
441crisv32_nand_cramfs_offset:
442 .dword 0
443
444swapper_pg_dir = 0xc0002000
445
446 .section ".init.data", "aw"
447
448#include "../lib/hw_settings.S"
diff --git a/arch/cris/arch-v32/kernel/io.c b/arch/cris/arch-v32/kernel/io.c
new file mode 100644
index 000000000000..6bc9f263c3d6
--- /dev/null
+++ b/arch/cris/arch-v32/kernel/io.c
@@ -0,0 +1,154 @@
1/*
2 * Helper functions for I/O pins.
3 *
4 * Copyright (c) 2004 Axis Communications AB.
5 */
6
7#include <linux/config.h>
8#include <linux/types.h>
9#include <linux/errno.h>
10#include <linux/init.h>
11#include <linux/string.h>
12#include <linux/ctype.h>
13#include <linux/kernel.h>
14#include <linux/module.h>
15#include <asm/io.h>
16#include <asm/arch/pinmux.h>
17#include <asm/arch/hwregs/gio_defs.h>
18
19struct crisv32_ioport crisv32_ioports[] =
20{
21 {
22 (unsigned long*)REG_ADDR(gio, regi_gio, rw_pa_oe),
23 (unsigned long*)REG_ADDR(gio, regi_gio, rw_pa_dout),
24 (unsigned long*)REG_ADDR(gio, regi_gio, r_pa_din),
25 8
26 },
27 {
28 (unsigned long*)REG_ADDR(gio, regi_gio, rw_pb_oe),
29 (unsigned long*)REG_ADDR(gio, regi_gio, rw_pb_dout),
30 (unsigned long*)REG_ADDR(gio, regi_gio, r_pb_din),
31 18
32 },
33 {
34 (unsigned long*)REG_ADDR(gio, regi_gio, rw_pc_oe),
35 (unsigned long*)REG_ADDR(gio, regi_gio, rw_pc_dout),
36 (unsigned long*)REG_ADDR(gio, regi_gio, r_pc_din),
37 18
38 },
39 {
40 (unsigned long*)REG_ADDR(gio, regi_gio, rw_pd_oe),
41 (unsigned long*)REG_ADDR(gio, regi_gio, rw_pd_dout),
42 (unsigned long*)REG_ADDR(gio, regi_gio, r_pd_din),
43 18
44 },
45 {
46 (unsigned long*)REG_ADDR(gio, regi_gio, rw_pe_oe),
47 (unsigned long*)REG_ADDR(gio, regi_gio, rw_pe_dout),
48 (unsigned long*)REG_ADDR(gio, regi_gio, r_pe_din),
49 18
50 }
51};
52
53#define NBR_OF_PORTS sizeof(crisv32_ioports)/sizeof(struct crisv32_ioport)
54
55struct crisv32_iopin crisv32_led1_green;
56struct crisv32_iopin crisv32_led1_red;
57struct crisv32_iopin crisv32_led2_green;
58struct crisv32_iopin crisv32_led2_red;
59struct crisv32_iopin crisv32_led3_green;
60struct crisv32_iopin crisv32_led3_red;
61
62/* Dummy port used when green LED and red LED is on the same bit */
63static unsigned long io_dummy;
64static struct crisv32_ioport dummy_port =
65{
66 &io_dummy,
67 &io_dummy,
68 &io_dummy,
69 18
70};
71static struct crisv32_iopin dummy_led =
72{
73 &dummy_port,
74 0
75};
76
77static int __init crisv32_io_init(void)
78{
79 int ret = 0;
80 /* Initialize LEDs */
81 ret += crisv32_io_get_name(&crisv32_led1_green, CONFIG_ETRAX_LED1G);
82 ret += crisv32_io_get_name(&crisv32_led1_red, CONFIG_ETRAX_LED1R);
83 ret += crisv32_io_get_name(&crisv32_led2_green, CONFIG_ETRAX_LED2G);
84 ret += crisv32_io_get_name(&crisv32_led2_red, CONFIG_ETRAX_LED2R);
85 ret += crisv32_io_get_name(&crisv32_led3_green, CONFIG_ETRAX_LED3G);
86 ret += crisv32_io_get_name(&crisv32_led3_red, CONFIG_ETRAX_LED3R);
87 crisv32_io_set_dir(&crisv32_led1_green, crisv32_io_dir_out);
88 crisv32_io_set_dir(&crisv32_led1_red, crisv32_io_dir_out);
89 crisv32_io_set_dir(&crisv32_led2_green, crisv32_io_dir_out);
90 crisv32_io_set_dir(&crisv32_led2_red, crisv32_io_dir_out);
91 crisv32_io_set_dir(&crisv32_led3_green, crisv32_io_dir_out);
92 crisv32_io_set_dir(&crisv32_led3_red, crisv32_io_dir_out);
93
94 if (!strcmp(CONFIG_ETRAX_LED1G, CONFIG_ETRAX_LED1R))
95 crisv32_led1_red = dummy_led;
96 if (!strcmp(CONFIG_ETRAX_LED2G, CONFIG_ETRAX_LED2R))
97 crisv32_led2_red = dummy_led;
98
99 return ret;
100}
101
102__initcall(crisv32_io_init);
103
104int crisv32_io_get(struct crisv32_iopin* iopin,
105 unsigned int port, unsigned int pin)
106{
107 if (port > NBR_OF_PORTS)
108 return -EINVAL;
109 if (port > crisv32_ioports[port].pin_count)
110 return -EINVAL;
111
112 iopin->bit = 1 << pin;
113 iopin->port = &crisv32_ioports[port];
114
115 if (crisv32_pinmux_alloc(port, pin, pin, pinmux_gpio))
116 return -EIO;
117
118 return 0;
119}
120
121int crisv32_io_get_name(struct crisv32_iopin* iopin,
122 char* name)
123{
124 int port;
125 int pin;
126
127 if (toupper(*name) == 'P')
128 name++;
129
130 if (toupper(*name) < 'A' || toupper(*name) > 'E')
131 return -EINVAL;
132
133 port = toupper(*name) - 'A';
134 name++;
135 pin = simple_strtoul(name, NULL, 10);
136
137 if (pin < 0 || pin > crisv32_ioports[port].pin_count)
138 return -EINVAL;
139
140 iopin->bit = 1 << pin;
141 iopin->port = &crisv32_ioports[port];
142
143 if (crisv32_pinmux_alloc(port, pin, pin, pinmux_gpio))
144 return -EIO;
145
146 return 0;
147}
148
149#ifdef CONFIG_PCI
150/* PCI I/O access stuff */
151struct cris_io_operations* cris_iops = NULL;
152EXPORT_SYMBOL(cris_iops);
153#endif
154
diff --git a/arch/cris/arch-v32/kernel/irq.c b/arch/cris/arch-v32/kernel/irq.c
new file mode 100644
index 000000000000..c78cc2685133
--- /dev/null
+++ b/arch/cris/arch-v32/kernel/irq.c
@@ -0,0 +1,413 @@
1/*
2 * Copyright (C) 2003, Axis Communications AB.
3 */
4
5#include <asm/irq.h>
6#include <linux/irq.h>
7#include <linux/interrupt.h>
8#include <linux/smp.h>
9#include <linux/config.h>
10#include <linux/kernel.h>
11#include <linux/errno.h>
12#include <linux/init.h>
13#include <linux/profile.h>
14#include <linux/proc_fs.h>
15#include <linux/seq_file.h>
16#include <linux/threads.h>
17#include <linux/spinlock.h>
18#include <linux/kernel_stat.h>
19#include <asm/arch/hwregs/reg_map.h>
20#include <asm/arch/hwregs/reg_rdwr.h>
21#include <asm/arch/hwregs/intr_vect.h>
22#include <asm/arch/hwregs/intr_vect_defs.h>
23
24#define CPU_FIXED -1
25
26/* IRQ masks (refer to comment for crisv32_do_multiple) */
27#define TIMER_MASK (1 << (TIMER_INTR_VECT - FIRST_IRQ))
28#ifdef CONFIG_ETRAX_KGDB
29#if defined(CONFIG_ETRAX_KGDB_PORT0)
30#define IGNOREMASK (1 << (SER0_INTR_VECT - FIRST_IRQ))
31#elif defined(CONFIG_ETRAX_KGDB_PORT1)
32#define IGNOREMASK (1 << (SER1_INTR_VECT - FIRST_IRQ))
33#elif defined(CONFIG_ETRAX_KGB_PORT2)
34#define IGNOREMASK (1 << (SER2_INTR_VECT - FIRST_IRQ))
35#elif defined(CONFIG_ETRAX_KGDB_PORT3)
36#define IGNOREMASK (1 << (SER3_INTR_VECT - FIRST_IRQ))
37#endif
38#endif
39
40DEFINE_SPINLOCK(irq_lock);
41
42struct cris_irq_allocation
43{
44 int cpu; /* The CPU to which the IRQ is currently allocated. */
45 cpumask_t mask; /* The CPUs to which the IRQ may be allocated. */
46};
47
48struct cris_irq_allocation irq_allocations[NR_IRQS] =
49 {[0 ... NR_IRQS - 1] = {0, CPU_MASK_ALL}};
50
51static unsigned long irq_regs[NR_CPUS] =
52{
53 regi_irq,
54#ifdef CONFIG_SMP
55 regi_irq2,
56#endif
57};
58
59unsigned long cpu_irq_counters[NR_CPUS];
60unsigned long irq_counters[NR_REAL_IRQS];
61
62/* From irq.c. */
63extern void weird_irq(void);
64
65/* From entry.S. */
66extern void system_call(void);
67extern void nmi_interrupt(void);
68extern void multiple_interrupt(void);
69extern void gdb_handle_exception(void);
70extern void i_mmu_refill(void);
71extern void i_mmu_invalid(void);
72extern void i_mmu_access(void);
73extern void i_mmu_execute(void);
74extern void d_mmu_refill(void);
75extern void d_mmu_invalid(void);
76extern void d_mmu_access(void);
77extern void d_mmu_write(void);
78
79/* From kgdb.c. */
80extern void kgdb_init(void);
81extern void breakpoint(void);
82
83/*
84 * Build the IRQ handler stubs using macros from irq.h. First argument is the
85 * IRQ number, the second argument is the corresponding bit in
86 * intr_rw_vect_mask found in asm/arch/hwregs/intr_vect_defs.h.
87 */
88BUILD_IRQ(0x31, (1 << 0)) /* memarb */
89BUILD_IRQ(0x32, (1 << 1)) /* gen_io */
90BUILD_IRQ(0x33, (1 << 2)) /* iop0 */
91BUILD_IRQ(0x34, (1 << 3)) /* iop1 */
92BUILD_IRQ(0x35, (1 << 4)) /* iop2 */
93BUILD_IRQ(0x36, (1 << 5)) /* iop3 */
94BUILD_IRQ(0x37, (1 << 6)) /* dma0 */
95BUILD_IRQ(0x38, (1 << 7)) /* dma1 */
96BUILD_IRQ(0x39, (1 << 8)) /* dma2 */
97BUILD_IRQ(0x3a, (1 << 9)) /* dma3 */
98BUILD_IRQ(0x3b, (1 << 10)) /* dma4 */
99BUILD_IRQ(0x3c, (1 << 11)) /* dma5 */
100BUILD_IRQ(0x3d, (1 << 12)) /* dma6 */
101BUILD_IRQ(0x3e, (1 << 13)) /* dma7 */
102BUILD_IRQ(0x3f, (1 << 14)) /* dma8 */
103BUILD_IRQ(0x40, (1 << 15)) /* dma9 */
104BUILD_IRQ(0x41, (1 << 16)) /* ata */
105BUILD_IRQ(0x42, (1 << 17)) /* sser0 */
106BUILD_IRQ(0x43, (1 << 18)) /* sser1 */
107BUILD_IRQ(0x44, (1 << 19)) /* ser0 */
108BUILD_IRQ(0x45, (1 << 20)) /* ser1 */
109BUILD_IRQ(0x46, (1 << 21)) /* ser2 */
110BUILD_IRQ(0x47, (1 << 22)) /* ser3 */
111BUILD_IRQ(0x48, (1 << 23))
112BUILD_IRQ(0x49, (1 << 24)) /* eth0 */
113BUILD_IRQ(0x4a, (1 << 25)) /* eth1 */
114BUILD_TIMER_IRQ(0x4b, (1 << 26))/* timer */
115BUILD_IRQ(0x4c, (1 << 27)) /* bif_arb */
116BUILD_IRQ(0x4d, (1 << 28)) /* bif_dma */
117BUILD_IRQ(0x4e, (1 << 29)) /* ext */
118BUILD_IRQ(0x4f, (1 << 29)) /* ipi */
119
120/* Pointers to the low-level handlers. */
121static void (*interrupt[NR_IRQS])(void) = {
122 IRQ0x31_interrupt, IRQ0x32_interrupt, IRQ0x33_interrupt,
123 IRQ0x34_interrupt, IRQ0x35_interrupt, IRQ0x36_interrupt,
124 IRQ0x37_interrupt, IRQ0x38_interrupt, IRQ0x39_interrupt,
125 IRQ0x3a_interrupt, IRQ0x3b_interrupt, IRQ0x3c_interrupt,
126 IRQ0x3d_interrupt, IRQ0x3e_interrupt, IRQ0x3f_interrupt,
127 IRQ0x40_interrupt, IRQ0x41_interrupt, IRQ0x42_interrupt,
128 IRQ0x43_interrupt, IRQ0x44_interrupt, IRQ0x45_interrupt,
129 IRQ0x46_interrupt, IRQ0x47_interrupt, IRQ0x48_interrupt,
130 IRQ0x49_interrupt, IRQ0x4a_interrupt, IRQ0x4b_interrupt,
131 IRQ0x4c_interrupt, IRQ0x4d_interrupt, IRQ0x4e_interrupt,
132 IRQ0x4f_interrupt
133};
134
135void
136block_irq(int irq, int cpu)
137{
138 int intr_mask;
139 unsigned long flags;
140
141 spin_lock_irqsave(&irq_lock, flags);
142 intr_mask = REG_RD_INT(intr_vect, irq_regs[cpu], rw_mask);
143
144 /* Remember; 1 let thru, 0 block. */
145 intr_mask &= ~(1 << (irq - FIRST_IRQ));
146
147 REG_WR_INT(intr_vect, irq_regs[cpu], rw_mask, intr_mask);
148 spin_unlock_irqrestore(&irq_lock, flags);
149}
150
151void
152unblock_irq(int irq, int cpu)
153{
154 int intr_mask;
155 unsigned long flags;
156
157 spin_lock_irqsave(&irq_lock, flags);
158 intr_mask = REG_RD_INT(intr_vect, irq_regs[cpu], rw_mask);
159
160 /* Remember; 1 let thru, 0 block. */
161 intr_mask |= (1 << (irq - FIRST_IRQ));
162
163 REG_WR_INT(intr_vect, irq_regs[cpu], rw_mask, intr_mask);
164 spin_unlock_irqrestore(&irq_lock, flags);
165}
166
167/* Find out which CPU the irq should be allocated to. */
168static int irq_cpu(int irq)
169{
170 int cpu;
171 unsigned long flags;
172
173 spin_lock_irqsave(&irq_lock, flags);
174 cpu = irq_allocations[irq - FIRST_IRQ].cpu;
175
176 /* Fixed interrupts stay on the local CPU. */
177 if (cpu == CPU_FIXED)
178 {
179 spin_unlock_irqrestore(&irq_lock, flags);
180 return smp_processor_id();
181 }
182
183
184 /* Let the interrupt stay if possible */
185 if (cpu_isset(cpu, irq_allocations[irq - FIRST_IRQ].mask))
186 goto out;
187
188 /* IRQ must be moved to another CPU. */
189 cpu = first_cpu(irq_allocations[irq - FIRST_IRQ].mask);
190 irq_allocations[irq - FIRST_IRQ].cpu = cpu;
191out:
192 spin_unlock_irqrestore(&irq_lock, flags);
193 return cpu;
194}
195
196void
197mask_irq(int irq)
198{
199 int cpu;
200
201 for (cpu = 0; cpu < NR_CPUS; cpu++)
202 block_irq(irq, cpu);
203}
204
205void
206unmask_irq(int irq)
207{
208 unblock_irq(irq, irq_cpu(irq));
209}
210
211
212static unsigned int startup_crisv32_irq(unsigned int irq)
213{
214 unmask_irq(irq);
215 return 0;
216}
217
218static void shutdown_crisv32_irq(unsigned int irq)
219{
220 mask_irq(irq);
221}
222
223static void enable_crisv32_irq(unsigned int irq)
224{
225 unmask_irq(irq);
226}
227
228static void disable_crisv32_irq(unsigned int irq)
229{
230 mask_irq(irq);
231}
232
233static void ack_crisv32_irq(unsigned int irq)
234{
235}
236
237static void end_crisv32_irq(unsigned int irq)
238{
239}
240
241void set_affinity_crisv32_irq(unsigned int irq, cpumask_t dest)
242{
243 unsigned long flags;
244 spin_lock_irqsave(&irq_lock, flags);
245 irq_allocations[irq - FIRST_IRQ].mask = dest;
246 spin_unlock_irqrestore(&irq_lock, flags);
247}
248
249static struct hw_interrupt_type crisv32_irq_type = {
250 .typename = "CRISv32",
251 .startup = startup_crisv32_irq,
252 .shutdown = shutdown_crisv32_irq,
253 .enable = enable_crisv32_irq,
254 .disable = disable_crisv32_irq,
255 .ack = ack_crisv32_irq,
256 .end = end_crisv32_irq,
257 .set_affinity = set_affinity_crisv32_irq
258};
259
260void
261set_exception_vector(int n, irqvectptr addr)
262{
263 etrax_irv->v[n] = (irqvectptr) addr;
264}
265
266extern void do_IRQ(int irq, struct pt_regs * regs);
267
268void
269crisv32_do_IRQ(int irq, int block, struct pt_regs* regs)
270{
271 /* Interrupts that may not be moved to another CPU and
272 * are SA_INTERRUPT may skip blocking. This is currently
273 * only valid for the timer IRQ and the IPI and is used
274 * for the timer interrupt to avoid watchdog starvation.
275 */
276 if (!block) {
277 do_IRQ(irq, regs);
278 return;
279 }
280
281 block_irq(irq, smp_processor_id());
282 do_IRQ(irq, regs);
283
284 unblock_irq(irq, irq_cpu(irq));
285}
286
287/* If multiple interrupts occur simultaneously we get a multiple
288 * interrupt from the CPU and software has to sort out which
289 * interrupts that happened. There are two special cases here:
290 *
291 * 1. Timer interrupts may never be blocked because of the
292 * watchdog (refer to comment in include/asr/arch/irq.h)
293 * 2. GDB serial port IRQs are unhandled here and will be handled
294 * as a single IRQ when it strikes again because the GDB
295 * stubb wants to save the registers in its own fashion.
296 */
297void
298crisv32_do_multiple(struct pt_regs* regs)
299{
300 int cpu;
301 int mask;
302 int masked;
303 int bit;
304
305 cpu = smp_processor_id();
306
307 /* An extra irq_enter here to prevent softIRQs to run after
308 * each do_IRQ. This will decrease the interrupt latency.
309 */
310 irq_enter();
311
312 /* Get which IRQs that happend. */
313 masked = REG_RD_INT(intr_vect, irq_regs[cpu], r_masked_vect);
314
315 /* Calculate new IRQ mask with these IRQs disabled. */
316 mask = REG_RD_INT(intr_vect, irq_regs[cpu], rw_mask);
317 mask &= ~masked;
318
319 /* Timer IRQ is never masked */
320 if (masked & TIMER_MASK)
321 mask |= TIMER_MASK;
322
323 /* Block all the IRQs */
324 REG_WR_INT(intr_vect, irq_regs[cpu], rw_mask, mask);
325
326 /* Check for timer IRQ and handle it special. */
327 if (masked & TIMER_MASK) {
328 masked &= ~TIMER_MASK;
329 do_IRQ(TIMER_INTR_VECT, regs);
330 }
331
332#ifdef IGNORE_MASK
333 /* Remove IRQs that can't be handled as multiple. */
334 masked &= ~IGNORE_MASK;
335#endif
336
337 /* Handle the rest of the IRQs. */
338 for (bit = 0; bit < 32; bit++)
339 {
340 if (masked & (1 << bit))
341 do_IRQ(bit + FIRST_IRQ, regs);
342 }
343
344 /* Unblock all the IRQs. */
345 mask = REG_RD_INT(intr_vect, irq_regs[cpu], rw_mask);
346 mask |= masked;
347 REG_WR_INT(intr_vect, irq_regs[cpu], rw_mask, mask);
348
349 /* This irq_exit() will trigger the soft IRQs. */
350 irq_exit();
351}
352
353/*
354 * This is called by start_kernel. It fixes the IRQ masks and setup the
355 * interrupt vector table to point to bad_interrupt pointers.
356 */
357void __init
358init_IRQ(void)
359{
360 int i;
361 int j;
362 reg_intr_vect_rw_mask vect_mask = {0};
363
364 /* Clear all interrupts masks. */
365 REG_WR(intr_vect, regi_irq, rw_mask, vect_mask);
366
367 for (i = 0; i < 256; i++)
368 etrax_irv->v[i] = weird_irq;
369
370 /* Point all IRQ's to bad handlers. */
371 for (i = FIRST_IRQ, j = 0; j < NR_IRQS; i++, j++) {
372 irq_desc[j].handler = &crisv32_irq_type;
373 set_exception_vector(i, interrupt[j]);
374 }
375
376 /* Mark Timer and IPI IRQs as CPU local */
377 irq_allocations[TIMER_INTR_VECT - FIRST_IRQ].cpu = CPU_FIXED;
378 irq_desc[TIMER_INTR_VECT].status |= IRQ_PER_CPU;
379 irq_allocations[IPI_INTR_VECT - FIRST_IRQ].cpu = CPU_FIXED;
380 irq_desc[IPI_INTR_VECT].status |= IRQ_PER_CPU;
381
382 set_exception_vector(0x00, nmi_interrupt);
383 set_exception_vector(0x30, multiple_interrupt);
384
385 /* Set up handler for various MMU bus faults. */
386 set_exception_vector(0x04, i_mmu_refill);
387 set_exception_vector(0x05, i_mmu_invalid);
388 set_exception_vector(0x06, i_mmu_access);
389 set_exception_vector(0x07, i_mmu_execute);
390 set_exception_vector(0x08, d_mmu_refill);
391 set_exception_vector(0x09, d_mmu_invalid);
392 set_exception_vector(0x0a, d_mmu_access);
393 set_exception_vector(0x0b, d_mmu_write);
394
395 /* The system-call trap is reached by "break 13". */
396 set_exception_vector(0x1d, system_call);
397
398 /* Exception handlers for debugging, both user-mode and kernel-mode. */
399
400 /* Break 8. */
401 set_exception_vector(0x18, gdb_handle_exception);
402 /* Hardware single step. */
403 set_exception_vector(0x3, gdb_handle_exception);
404 /* Hardware breakpoint. */
405 set_exception_vector(0xc, gdb_handle_exception);
406
407#ifdef CONFIG_ETRAX_KGDB
408 kgdb_init();
409 /* Everything is set up; now trap the kernel. */
410 breakpoint();
411#endif
412}
413
diff --git a/arch/cris/arch-v32/kernel/kgdb.c b/arch/cris/arch-v32/kernel/kgdb.c
new file mode 100644
index 000000000000..480e56348be2
--- /dev/null
+++ b/arch/cris/arch-v32/kernel/kgdb.c
@@ -0,0 +1,1660 @@
1/*
2 * arch/cris/arch-v32/kernel/kgdb.c
3 *
4 * CRIS v32 version by Orjan Friberg, Axis Communications AB.
5 *
6 * S390 version
7 * Copyright (C) 1999 IBM Deutschland Entwicklung GmbH, IBM Corporation
8 * Author(s): Denis Joseph Barrow (djbarrow@de.ibm.com,barrow_dj@yahoo.com),
9 *
10 * Originally written by Glenn Engel, Lake Stevens Instrument Division
11 *
12 * Contributed by HP Systems
13 *
14 * Modified for SPARC by Stu Grossman, Cygnus Support.
15 *
16 * Modified for Linux/MIPS (and MIPS in general) by Andreas Busse
17 * Send complaints, suggestions etc. to <andy@waldorf-gmbh.de>
18 *
19 * Copyright (C) 1995 Andreas Busse
20 */
21
22/* FIXME: Check the documentation. */
23
24/*
25 * kgdb usage notes:
26 * -----------------
27 *
28 * If you select CONFIG_ETRAX_KGDB in the configuration, the kernel will be
29 * built with different gcc flags: "-g" is added to get debug infos, and
30 * "-fomit-frame-pointer" is omitted to make debugging easier. Since the
31 * resulting kernel will be quite big (approx. > 7 MB), it will be stripped
32 * before compresion. Such a kernel will behave just as usually, except if
33 * given a "debug=<device>" command line option. (Only serial devices are
34 * allowed for <device>, i.e. no printers or the like; possible values are
35 * machine depedend and are the same as for the usual debug device, the one
36 * for logging kernel messages.) If that option is given and the device can be
37 * initialized, the kernel will connect to the remote gdb in trap_init(). The
38 * serial parameters are fixed to 8N1 and 115200 bps, for easyness of
39 * implementation.
40 *
41 * To start a debugging session, start that gdb with the debugging kernel
42 * image (the one with the symbols, vmlinux.debug) named on the command line.
43 * This file will be used by gdb to get symbol and debugging infos about the
44 * kernel. Next, select remote debug mode by
45 * target remote <device>
46 * where <device> is the name of the serial device over which the debugged
47 * machine is connected. Maybe you have to adjust the baud rate by
48 * set remotebaud <rate>
49 * or also other parameters with stty:
50 * shell stty ... </dev/...
51 * If the kernel to debug has already booted, it waited for gdb and now
52 * connects, and you'll see a breakpoint being reported. If the kernel isn't
53 * running yet, start it now. The order of gdb and the kernel doesn't matter.
54 * Another thing worth knowing about in the getting-started phase is how to
55 * debug the remote protocol itself. This is activated with
56 * set remotedebug 1
57 * gdb will then print out each packet sent or received. You'll also get some
58 * messages about the gdb stub on the console of the debugged machine.
59 *
60 * If all that works, you can use lots of the usual debugging techniques on
61 * the kernel, e.g. inspecting and changing variables/memory, setting
62 * breakpoints, single stepping and so on. It's also possible to interrupt the
63 * debugged kernel by pressing C-c in gdb. Have fun! :-)
64 *
65 * The gdb stub is entered (and thus the remote gdb gets control) in the
66 * following situations:
67 *
68 * - If breakpoint() is called. This is just after kgdb initialization, or if
69 * a breakpoint() call has been put somewhere into the kernel source.
70 * (Breakpoints can of course also be set the usual way in gdb.)
71 * In eLinux, we call breakpoint() in init/main.c after IRQ initialization.
72 *
73 * - If there is a kernel exception, i.e. bad_super_trap() or die_if_kernel()
74 * are entered. All the CPU exceptions are mapped to (more or less..., see
75 * the hard_trap_info array below) appropriate signal, which are reported
76 * to gdb. die_if_kernel() is usually called after some kind of access
77 * error and thus is reported as SIGSEGV.
78 *
79 * - When panic() is called. This is reported as SIGABRT.
80 *
81 * - If C-c is received over the serial line, which is treated as
82 * SIGINT.
83 *
84 * Of course, all these signals are just faked for gdb, since there is no
85 * signal concept as such for the kernel. It also isn't possible --obviously--
86 * to set signal handlers from inside gdb, or restart the kernel with a
87 * signal.
88 *
89 * Current limitations:
90 *
91 * - While the kernel is stopped, interrupts are disabled for safety reasons
92 * (i.e., variables not changing magically or the like). But this also
93 * means that the clock isn't running anymore, and that interrupts from the
94 * hardware may get lost/not be served in time. This can cause some device
95 * errors...
96 *
97 * - When single-stepping, only one instruction of the current thread is
98 * executed, but interrupts are allowed for that time and will be serviced
99 * if pending. Be prepared for that.
100 *
101 * - All debugging happens in kernel virtual address space. There's no way to
102 * access physical memory not mapped in kernel space, or to access user
103 * space. A way to work around this is using get_user_long & Co. in gdb
104 * expressions, but only for the current process.
105 *
106 * - Interrupting the kernel only works if interrupts are currently allowed,
107 * and the interrupt of the serial line isn't blocked by some other means
108 * (IPL too high, disabled, ...)
109 *
110 * - The gdb stub is currently not reentrant, i.e. errors that happen therein
111 * (e.g. accessing invalid memory) may not be caught correctly. This could
112 * be removed in future by introducing a stack of struct registers.
113 *
114 */
115
116/*
117 * To enable debugger support, two things need to happen. One, a
118 * call to kgdb_init() is necessary in order to allow any breakpoints
119 * or error conditions to be properly intercepted and reported to gdb.
120 * Two, a breakpoint needs to be generated to begin communication. This
121 * is most easily accomplished by a call to breakpoint().
122 *
123 * The following gdb commands are supported:
124 *
125 * command function Return value
126 *
127 * g return the value of the CPU registers hex data or ENN
128 * G set the value of the CPU registers OK or ENN
129 *
130 * mAA..AA,LLLL Read LLLL bytes at address AA..AA hex data or ENN
131 * MAA..AA,LLLL: Write LLLL bytes at address AA.AA OK or ENN
132 *
133 * c Resume at current address SNN ( signal NN)
134 * cAA..AA Continue at address AA..AA SNN
135 *
136 * s Step one instruction SNN
137 * sAA..AA Step one instruction from AA..AA SNN
138 *
139 * k kill
140 *
141 * ? What was the last sigval ? SNN (signal NN)
142 *
143 * bBB..BB Set baud rate to BB..BB OK or BNN, then sets
144 * baud rate
145 *
146 * All commands and responses are sent with a packet which includes a
147 * checksum. A packet consists of
148 *
149 * $<packet info>#<checksum>.
150 *
151 * where
152 * <packet info> :: <characters representing the command or response>
153 * <checksum> :: < two hex digits computed as modulo 256 sum of <packetinfo>>
154 *
155 * When a packet is received, it is first acknowledged with either '+' or '-'.
156 * '+' indicates a successful transfer. '-' indicates a failed transfer.
157 *
158 * Example:
159 *
160 * Host: Reply:
161 * $m0,10#2a +$00010203040506070809101112131415#42
162 *
163 */
164
165
166#include <linux/string.h>
167#include <linux/signal.h>
168#include <linux/kernel.h>
169#include <linux/delay.h>
170#include <linux/linkage.h>
171#include <linux/reboot.h>
172
173#include <asm/setup.h>
174#include <asm/ptrace.h>
175
176#include <asm/irq.h>
177#include <asm/arch/hwregs/reg_map.h>
178#include <asm/arch/hwregs/reg_rdwr.h>
179#include <asm/arch/hwregs/intr_vect_defs.h>
180#include <asm/arch/hwregs/ser_defs.h>
181
182/* From entry.S. */
183extern void gdb_handle_exception(void);
184/* From kgdb_asm.S. */
185extern void kgdb_handle_exception(void);
186
187static int kgdb_started = 0;
188
189/********************************* Register image ****************************/
190
191typedef
192struct register_image
193{
194 /* Offset */
195 unsigned int r0; /* 0x00 */
196 unsigned int r1; /* 0x04 */
197 unsigned int r2; /* 0x08 */
198 unsigned int r3; /* 0x0C */
199 unsigned int r4; /* 0x10 */
200 unsigned int r5; /* 0x14 */
201 unsigned int r6; /* 0x18 */
202 unsigned int r7; /* 0x1C */
203 unsigned int r8; /* 0x20; Frame pointer (if any) */
204 unsigned int r9; /* 0x24 */
205 unsigned int r10; /* 0x28 */
206 unsigned int r11; /* 0x2C */
207 unsigned int r12; /* 0x30 */
208 unsigned int r13; /* 0x34 */
209 unsigned int sp; /* 0x38; R14, Stack pointer */
210 unsigned int acr; /* 0x3C; R15, Address calculation register. */
211
212 unsigned char bz; /* 0x40; P0, 8-bit zero register */
213 unsigned char vr; /* 0x41; P1, Version register (8-bit) */
214 unsigned int pid; /* 0x42; P2, Process ID */
215 unsigned char srs; /* 0x46; P3, Support register select (8-bit) */
216 unsigned short wz; /* 0x47; P4, 16-bit zero register */
217 unsigned int exs; /* 0x49; P5, Exception status */
218 unsigned int eda; /* 0x4D; P6, Exception data address */
219 unsigned int mof; /* 0x51; P7, Multiply overflow register */
220 unsigned int dz; /* 0x55; P8, 32-bit zero register */
221 unsigned int ebp; /* 0x59; P9, Exception base pointer */
222 unsigned int erp; /* 0x5D; P10, Exception return pointer. Contains the PC we are interested in. */
223 unsigned int srp; /* 0x61; P11, Subroutine return pointer */
224 unsigned int nrp; /* 0x65; P12, NMI return pointer */
225 unsigned int ccs; /* 0x69; P13, Condition code stack */
226 unsigned int usp; /* 0x6D; P14, User mode stack pointer */
227 unsigned int spc; /* 0x71; P15, Single step PC */
228 unsigned int pc; /* 0x75; Pseudo register (for the most part set to ERP). */
229
230} registers;
231
232typedef
233struct bp_register_image
234{
235 /* Support register bank 0. */
236 unsigned int s0_0;
237 unsigned int s1_0;
238 unsigned int s2_0;
239 unsigned int s3_0;
240 unsigned int s4_0;
241 unsigned int s5_0;
242 unsigned int s6_0;
243 unsigned int s7_0;
244 unsigned int s8_0;
245 unsigned int s9_0;
246 unsigned int s10_0;
247 unsigned int s11_0;
248 unsigned int s12_0;
249 unsigned int s13_0;
250 unsigned int s14_0;
251 unsigned int s15_0;
252
253 /* Support register bank 1. */
254 unsigned int s0_1;
255 unsigned int s1_1;
256 unsigned int s2_1;
257 unsigned int s3_1;
258 unsigned int s4_1;
259 unsigned int s5_1;
260 unsigned int s6_1;
261 unsigned int s7_1;
262 unsigned int s8_1;
263 unsigned int s9_1;
264 unsigned int s10_1;
265 unsigned int s11_1;
266 unsigned int s12_1;
267 unsigned int s13_1;
268 unsigned int s14_1;
269 unsigned int s15_1;
270
271 /* Support register bank 2. */
272 unsigned int s0_2;
273 unsigned int s1_2;
274 unsigned int s2_2;
275 unsigned int s3_2;
276 unsigned int s4_2;
277 unsigned int s5_2;
278 unsigned int s6_2;
279 unsigned int s7_2;
280 unsigned int s8_2;
281 unsigned int s9_2;
282 unsigned int s10_2;
283 unsigned int s11_2;
284 unsigned int s12_2;
285 unsigned int s13_2;
286 unsigned int s14_2;
287 unsigned int s15_2;
288
289 /* Support register bank 3. */
290 unsigned int s0_3; /* BP_CTRL */
291 unsigned int s1_3; /* BP_I0_START */
292 unsigned int s2_3; /* BP_I0_END */
293 unsigned int s3_3; /* BP_D0_START */
294 unsigned int s4_3; /* BP_D0_END */
295 unsigned int s5_3; /* BP_D1_START */
296 unsigned int s6_3; /* BP_D1_END */
297 unsigned int s7_3; /* BP_D2_START */
298 unsigned int s8_3; /* BP_D2_END */
299 unsigned int s9_3; /* BP_D3_START */
300 unsigned int s10_3; /* BP_D3_END */
301 unsigned int s11_3; /* BP_D4_START */
302 unsigned int s12_3; /* BP_D4_END */
303 unsigned int s13_3; /* BP_D5_START */
304 unsigned int s14_3; /* BP_D5_END */
305 unsigned int s15_3; /* BP_RESERVED */
306
307} support_registers;
308
309enum register_name
310{
311 R0, R1, R2, R3,
312 R4, R5, R6, R7,
313 R8, R9, R10, R11,
314 R12, R13, SP, ACR,
315
316 BZ, VR, PID, SRS,
317 WZ, EXS, EDA, MOF,
318 DZ, EBP, ERP, SRP,
319 NRP, CCS, USP, SPC,
320 PC,
321
322 S0, S1, S2, S3,
323 S4, S5, S6, S7,
324 S8, S9, S10, S11,
325 S12, S13, S14, S15
326
327};
328
329/* The register sizes of the registers in register_name. An unimplemented register
330 is designated by size 0 in this array. */
331static int register_size[] =
332{
333 4, 4, 4, 4,
334 4, 4, 4, 4,
335 4, 4, 4, 4,
336 4, 4, 4, 4,
337
338 1, 1, 4, 1,
339 2, 4, 4, 4,
340 4, 4, 4, 4,
341 4, 4, 4, 4,
342
343 4,
344
345 4, 4, 4, 4,
346 4, 4, 4, 4,
347 4, 4, 4, 4,
348 4, 4, 4
349
350};
351
352/* Contains the register image of the kernel.
353 (Global so that they can be reached from assembler code.) */
354registers reg;
355support_registers sreg;
356
357/************** Prototypes for local library functions ***********************/
358
359/* Copy of strcpy from libc. */
360static char *gdb_cris_strcpy(char *s1, const char *s2);
361
362/* Copy of strlen from libc. */
363static int gdb_cris_strlen(const char *s);
364
365/* Copy of memchr from libc. */
366static void *gdb_cris_memchr(const void *s, int c, int n);
367
368/* Copy of strtol from libc. Does only support base 16. */
369static int gdb_cris_strtol(const char *s, char **endptr, int base);
370
371/********************** Prototypes for local functions. **********************/
372
373/* Write a value to a specified register regno in the register image
374 of the current thread. */
375static int write_register(int regno, char *val);
376
377/* Read a value from a specified register in the register image. Returns the
378 status of the read operation. The register value is returned in valptr. */
379static int read_register(char regno, unsigned int *valptr);
380
381/* Serial port, reads one character. ETRAX 100 specific. from debugport.c */
382int getDebugChar(void);
383
384#ifdef CONFIG_ETRAXFS_SIM
385int getDebugChar(void)
386{
387 return socketread();
388}
389#endif
390
391/* Serial port, writes one character. ETRAX 100 specific. from debugport.c */
392void putDebugChar(int val);
393
394#ifdef CONFIG_ETRAXFS_SIM
395void putDebugChar(int val)
396{
397 socketwrite((char *)&val, 1);
398}
399#endif
400
401/* Returns the character equivalent of a nibble, bit 7, 6, 5, and 4 of a byte,
402 represented by int x. */
403static char highhex(int x);
404
405/* Returns the character equivalent of a nibble, bit 3, 2, 1, and 0 of a byte,
406 represented by int x. */
407static char lowhex(int x);
408
409/* Returns the integer equivalent of a hexadecimal character. */
410static int hex(char ch);
411
412/* Convert the memory, pointed to by mem into hexadecimal representation.
413 Put the result in buf, and return a pointer to the last character
414 in buf (null). */
415static char *mem2hex(char *buf, unsigned char *mem, int count);
416
417/* Convert the array, in hexadecimal representation, pointed to by buf into
418 binary representation. Put the result in mem, and return a pointer to
419 the character after the last byte written. */
420static unsigned char *hex2mem(unsigned char *mem, char *buf, int count);
421
422/* Put the content of the array, in binary representation, pointed to by buf
423 into memory pointed to by mem, and return a pointer to
424 the character after the last byte written. */
425static unsigned char *bin2mem(unsigned char *mem, unsigned char *buf, int count);
426
427/* Await the sequence $<data>#<checksum> and store <data> in the array buffer
428 returned. */
429static void getpacket(char *buffer);
430
431/* Send $<data>#<checksum> from the <data> in the array buffer. */
432static void putpacket(char *buffer);
433
434/* Build and send a response packet in order to inform the host the
435 stub is stopped. */
436static void stub_is_stopped(int sigval);
437
438/* All expected commands are sent from remote.c. Send a response according
439 to the description in remote.c. Not static since it needs to be reached
440 from assembler code. */
441void handle_exception(int sigval);
442
443/* Performs a complete re-start from scratch. ETRAX specific. */
444static void kill_restart(void);
445
446/******************** Prototypes for global functions. ***********************/
447
448/* The string str is prepended with the GDB printout token and sent. */
449void putDebugString(const unsigned char *str, int len);
450
451/* A static breakpoint to be used at startup. */
452void breakpoint(void);
453
454/* Avoid warning as the internal_stack is not used in the C-code. */
455#define USEDVAR(name) { if (name) { ; } }
456#define USEDFUN(name) { void (*pf)(void) = (void *)name; USEDVAR(pf) }
457
458/********************************** Packet I/O ******************************/
459/* BUFMAX defines the maximum number of characters in
460 inbound/outbound buffers */
461/* FIXME: How do we know it's enough? */
462#define BUFMAX 512
463
464/* Run-length encoding maximum length. Send 64 at most. */
465#define RUNLENMAX 64
466
467/* Definition of all valid hexadecimal characters */
468static const char hexchars[] = "0123456789abcdef";
469
470/* The inbound/outbound buffers used in packet I/O */
471static char input_buffer[BUFMAX];
472static char output_buffer[BUFMAX];
473
474/* Error and warning messages. */
475enum error_type
476{
477 SUCCESS, E01, E02, E03, E04, E05, E06,
478};
479
480static char *error_message[] =
481{
482 "",
483 "E01 Set current or general thread - H[c,g] - internal error.",
484 "E02 Change register content - P - cannot change read-only register.",
485 "E03 Thread is not alive.", /* T, not used. */
486 "E04 The command is not supported - [s,C,S,!,R,d,r] - internal error.",
487 "E05 Change register content - P - the register is not implemented..",
488 "E06 Change memory content - M - internal error.",
489};
490
491/********************************** Breakpoint *******************************/
492/* Use an internal stack in the breakpoint and interrupt response routines.
493 FIXME: How do we know the size of this stack is enough?
494 Global so it can be reached from assembler code. */
495#define INTERNAL_STACK_SIZE 1024
496char internal_stack[INTERNAL_STACK_SIZE];
497
498/* Due to the breakpoint return pointer, a state variable is needed to keep
499 track of whether it is a static (compiled) or dynamic (gdb-invoked)
500 breakpoint to be handled. A static breakpoint uses the content of register
501 ERP as it is whereas a dynamic breakpoint requires subtraction with 2
502 in order to execute the instruction. The first breakpoint is static; all
503 following are assumed to be dynamic. */
504static int dynamic_bp = 0;
505
506/********************************* String library ****************************/
507/* Single-step over library functions creates trap loops. */
508
509/* Copy char s2[] to s1[]. */
510static char*
511gdb_cris_strcpy(char *s1, const char *s2)
512{
513 char *s = s1;
514
515 for (s = s1; (*s++ = *s2++) != '\0'; )
516 ;
517 return s1;
518}
519
520/* Find length of s[]. */
521static int
522gdb_cris_strlen(const char *s)
523{
524 const char *sc;
525
526 for (sc = s; *sc != '\0'; sc++)
527 ;
528 return (sc - s);
529}
530
531/* Find first occurrence of c in s[n]. */
532static void*
533gdb_cris_memchr(const void *s, int c, int n)
534{
535 const unsigned char uc = c;
536 const unsigned char *su;
537
538 for (su = s; 0 < n; ++su, --n)
539 if (*su == uc)
540 return (void *)su;
541 return NULL;
542}
543/******************************* Standard library ****************************/
544/* Single-step over library functions creates trap loops. */
545/* Convert string to long. */
546static int
547gdb_cris_strtol(const char *s, char **endptr, int base)
548{
549 char *s1;
550 char *sd;
551 int x = 0;
552
553 for (s1 = (char*)s; (sd = gdb_cris_memchr(hexchars, *s1, base)) != NULL; ++s1)
554 x = x * base + (sd - hexchars);
555
556 if (endptr) {
557 /* Unconverted suffix is stored in endptr unless endptr is NULL. */
558 *endptr = s1;
559 }
560
561 return x;
562}
563
564/********************************* Register image ****************************/
565
566/* Write a value to a specified register in the register image of the current
567 thread. Returns status code SUCCESS, E02 or E05. */
568static int
569write_register(int regno, char *val)
570{
571 int status = SUCCESS;
572
573 if (regno >= R0 && regno <= ACR) {
574 /* Consecutive 32-bit registers. */
575 hex2mem((unsigned char *)&reg.r0 + (regno - R0) * sizeof(unsigned int),
576 val, sizeof(unsigned int));
577
578 } else if (regno == BZ || regno == VR || regno == WZ || regno == DZ) {
579 /* Read-only registers. */
580 status = E02;
581
582 } else if (regno == PID) {
583 /* 32-bit register. (Even though we already checked SRS and WZ, we cannot
584 combine this with the EXS - SPC write since SRS and WZ have different size.) */
585 hex2mem((unsigned char *)&reg.pid, val, sizeof(unsigned int));
586
587 } else if (regno == SRS) {
588 /* 8-bit register. */
589 hex2mem((unsigned char *)&reg.srs, val, sizeof(unsigned char));
590
591 } else if (regno >= EXS && regno <= SPC) {
592 /* Consecutive 32-bit registers. */
593 hex2mem((unsigned char *)&reg.exs + (regno - EXS) * sizeof(unsigned int),
594 val, sizeof(unsigned int));
595
596 } else if (regno == PC) {
597 /* Pseudo-register. Treat as read-only. */
598 status = E02;
599
600 } else if (regno >= S0 && regno <= S15) {
601 /* 32-bit registers. */
602 hex2mem((unsigned char *)&sreg.s0_0 + (reg.srs * 16 * sizeof(unsigned int)) + (regno - S0) * sizeof(unsigned int), val, sizeof(unsigned int));
603 } else {
604 /* Non-existing register. */
605 status = E05;
606 }
607 return status;
608}
609
610/* Read a value from a specified register in the register image. Returns the
611 value in the register or -1 for non-implemented registers. */
612static int
613read_register(char regno, unsigned int *valptr)
614{
615 int status = SUCCESS;
616
617 /* We read the zero registers from the register struct (instead of just returning 0)
618 to catch errors. */
619
620 if (regno >= R0 && regno <= ACR) {
621 /* Consecutive 32-bit registers. */
622 *valptr = *(unsigned int *)((char *)&reg.r0 + (regno - R0) * sizeof(unsigned int));
623
624 } else if (regno == BZ || regno == VR) {
625 /* Consecutive 8-bit registers. */
626 *valptr = (unsigned int)(*(unsigned char *)
627 ((char *)&reg.bz + (regno - BZ) * sizeof(char)));
628
629 } else if (regno == PID) {
630 /* 32-bit register. */
631 *valptr = *(unsigned int *)((char *)&reg.pid);
632
633 } else if (regno == SRS) {
634 /* 8-bit register. */
635 *valptr = (unsigned int)(*(unsigned char *)((char *)&reg.srs));
636
637 } else if (regno == WZ) {
638 /* 16-bit register. */
639 *valptr = (unsigned int)(*(unsigned short *)(char *)&reg.wz);
640
641 } else if (regno >= EXS && regno <= PC) {
642 /* Consecutive 32-bit registers. */
643 *valptr = *(unsigned int *)((char *)&reg.exs + (regno - EXS) * sizeof(unsigned int));
644
645 } else if (regno >= S0 && regno <= S15) {
646 /* Consecutive 32-bit registers, located elsewhere. */
647 *valptr = *(unsigned int *)((char *)&sreg.s0_0 + (reg.srs * 16 * sizeof(unsigned int)) + (regno - S0) * sizeof(unsigned int));
648
649 } else {
650 /* Non-existing register. */
651 status = E05;
652 }
653 return status;
654
655}
656
657/********************************** Packet I/O ******************************/
658/* Returns the character equivalent of a nibble, bit 7, 6, 5, and 4 of a byte,
659 represented by int x. */
660static inline char
661highhex(int x)
662{
663 return hexchars[(x >> 4) & 0xf];
664}
665
666/* Returns the character equivalent of a nibble, bit 3, 2, 1, and 0 of a byte,
667 represented by int x. */
668static inline char
669lowhex(int x)
670{
671 return hexchars[x & 0xf];
672}
673
674/* Returns the integer equivalent of a hexadecimal character. */
675static int
676hex(char ch)
677{
678 if ((ch >= 'a') && (ch <= 'f'))
679 return (ch - 'a' + 10);
680 if ((ch >= '0') && (ch <= '9'))
681 return (ch - '0');
682 if ((ch >= 'A') && (ch <= 'F'))
683 return (ch - 'A' + 10);
684 return -1;
685}
686
687/* Convert the memory, pointed to by mem into hexadecimal representation.
688 Put the result in buf, and return a pointer to the last character
689 in buf (null). */
690
691static char *
692mem2hex(char *buf, unsigned char *mem, int count)
693{
694 int i;
695 int ch;
696
697 if (mem == NULL) {
698 /* Invalid address, caught by 'm' packet handler. */
699 for (i = 0; i < count; i++) {
700 *buf++ = '0';
701 *buf++ = '0';
702 }
703 } else {
704 /* Valid mem address. */
705 for (i = 0; i < count; i++) {
706 ch = *mem++;
707 *buf++ = highhex (ch);
708 *buf++ = lowhex (ch);
709 }
710 }
711 /* Terminate properly. */
712 *buf = '\0';
713 return buf;
714}
715
716/* Same as mem2hex, but puts it in network byte order. */
717static char *
718mem2hex_nbo(char *buf, unsigned char *mem, int count)
719{
720 int i;
721 int ch;
722
723 mem += count - 1;
724 for (i = 0; i < count; i++) {
725 ch = *mem--;
726 *buf++ = highhex (ch);
727 *buf++ = lowhex (ch);
728 }
729
730 /* Terminate properly. */
731 *buf = '\0';
732 return buf;
733}
734
735/* Convert the array, in hexadecimal representation, pointed to by buf into
736 binary representation. Put the result in mem, and return a pointer to
737 the character after the last byte written. */
738static unsigned char*
739hex2mem(unsigned char *mem, char *buf, int count)
740{
741 int i;
742 unsigned char ch;
743 for (i = 0; i < count; i++) {
744 ch = hex (*buf++) << 4;
745 ch = ch + hex (*buf++);
746 *mem++ = ch;
747 }
748 return mem;
749}
750
751/* Put the content of the array, in binary representation, pointed to by buf
752 into memory pointed to by mem, and return a pointer to the character after
753 the last byte written.
754 Gdb will escape $, #, and the escape char (0x7d). */
755static unsigned char*
756bin2mem(unsigned char *mem, unsigned char *buf, int count)
757{
758 int i;
759 unsigned char *next;
760 for (i = 0; i < count; i++) {
761 /* Check for any escaped characters. Be paranoid and
762 only unescape chars that should be escaped. */
763 if (*buf == 0x7d) {
764 next = buf + 1;
765 if (*next == 0x3 || *next == 0x4 || *next == 0x5D) {
766 /* #, $, ESC */
767 buf++;
768 *buf += 0x20;
769 }
770 }
771 *mem++ = *buf++;
772 }
773 return mem;
774}
775
776/* Await the sequence $<data>#<checksum> and store <data> in the array buffer
777 returned. */
778static void
779getpacket(char *buffer)
780{
781 unsigned char checksum;
782 unsigned char xmitcsum;
783 int i;
784 int count;
785 char ch;
786
787 do {
788 while((ch = getDebugChar ()) != '$')
789 /* Wait for the start character $ and ignore all other characters */;
790 checksum = 0;
791 xmitcsum = -1;
792 count = 0;
793 /* Read until a # or the end of the buffer is reached */
794 while (count < BUFMAX) {
795 ch = getDebugChar();
796 if (ch == '#')
797 break;
798 checksum = checksum + ch;
799 buffer[count] = ch;
800 count = count + 1;
801 }
802
803 if (count >= BUFMAX)
804 continue;
805
806 buffer[count] = 0;
807
808 if (ch == '#') {
809 xmitcsum = hex(getDebugChar()) << 4;
810 xmitcsum += hex(getDebugChar());
811 if (checksum != xmitcsum) {
812 /* Wrong checksum */
813 putDebugChar('-');
814 } else {
815 /* Correct checksum */
816 putDebugChar('+');
817 /* If sequence characters are received, reply with them */
818 if (buffer[2] == ':') {
819 putDebugChar(buffer[0]);
820 putDebugChar(buffer[1]);
821 /* Remove the sequence characters from the buffer */
822 count = gdb_cris_strlen(buffer);
823 for (i = 3; i <= count; i++)
824 buffer[i - 3] = buffer[i];
825 }
826 }
827 }
828 } while (checksum != xmitcsum);
829}
830
831/* Send $<data>#<checksum> from the <data> in the array buffer. */
832
833static void
834putpacket(char *buffer)
835{
836 int checksum;
837 int runlen;
838 int encode;
839
840 do {
841 char *src = buffer;
842 putDebugChar('$');
843 checksum = 0;
844 while (*src) {
845 /* Do run length encoding */
846 putDebugChar(*src);
847 checksum += *src;
848 runlen = 0;
849 while (runlen < RUNLENMAX && *src == src[runlen]) {
850 runlen++;
851 }
852 if (runlen > 3) {
853 /* Got a useful amount */
854 putDebugChar ('*');
855 checksum += '*';
856 encode = runlen + ' ' - 4;
857 putDebugChar(encode);
858 checksum += encode;
859 src += runlen;
860 } else {
861 src++;
862 }
863 }
864 putDebugChar('#');
865 putDebugChar(highhex (checksum));
866 putDebugChar(lowhex (checksum));
867 } while(kgdb_started && (getDebugChar() != '+'));
868}
869
870/* The string str is prepended with the GDB printout token and sent. Required
871 in traditional implementations. */
872void
873putDebugString(const unsigned char *str, int len)
874{
875 /* Move SPC forward if we are single-stepping. */
876 asm("spchere:");
877 asm("move $spc, $r10");
878 asm("cmp.d spchere, $r10");
879 asm("bne nosstep");
880 asm("nop");
881 asm("move.d spccont, $r10");
882 asm("move $r10, $spc");
883 asm("nosstep:");
884
885 output_buffer[0] = 'O';
886 mem2hex(&output_buffer[1], (unsigned char *)str, len);
887 putpacket(output_buffer);
888
889 asm("spccont:");
890}
891
892/********************************** Handle exceptions ************************/
893/* Build and send a response packet in order to inform the host the
894 stub is stopped. TAAn...:r...;n...:r...;n...:r...;
895 AA = signal number
896 n... = register number (hex)
897 r... = register contents
898 n... = `thread'
899 r... = thread process ID. This is a hex integer.
900 n... = other string not starting with valid hex digit.
901 gdb should ignore this n,r pair and go on to the next.
902 This way we can extend the protocol. */
903static void
904stub_is_stopped(int sigval)
905{
906 char *ptr = output_buffer;
907 unsigned int reg_cont;
908
909 /* Send trap type (converted to signal) */
910
911 *ptr++ = 'T';
912 *ptr++ = highhex(sigval);
913 *ptr++ = lowhex(sigval);
914
915 if (((reg.exs & 0xff00) >> 8) == 0xc) {
916
917 /* Some kind of hardware watchpoint triggered. Find which one
918 and determine its type (read/write/access). */
919 int S, bp, trig_bits = 0, rw_bits = 0;
920 int trig_mask = 0;
921 unsigned int *bp_d_regs = &sreg.s3_3;
922 /* In a lot of cases, the stopped data address will simply be EDA.
923 In some cases, we adjust it to match the watched data range.
924 (We don't want to change the actual EDA though). */
925 unsigned int stopped_data_address;
926 /* The S field of EXS. */
927 S = (reg.exs & 0xffff0000) >> 16;
928
929 if (S & 1) {
930 /* Instruction watchpoint. */
931 /* FIXME: Check against, and possibly adjust reported EDA. */
932 } else {
933 /* Data watchpoint. Find the one that triggered. */
934 for (bp = 0; bp < 6; bp++) {
935
936 /* Dx_RD, Dx_WR in the S field of EXS for this BP. */
937 int bitpos_trig = 1 + bp * 2;
938 /* Dx_BPRD, Dx_BPWR in BP_CTRL for this BP. */
939 int bitpos_config = 2 + bp * 4;
940
941 /* Get read/write trig bits for this BP. */
942 trig_bits = (S & (3 << bitpos_trig)) >> bitpos_trig;
943
944 /* Read/write config bits for this BP. */
945 rw_bits = (sreg.s0_3 & (3 << bitpos_config)) >> bitpos_config;
946 if (trig_bits) {
947 /* Sanity check: the BP shouldn't trigger for accesses
948 that it isn't configured for. */
949 if ((rw_bits == 0x1 && trig_bits != 0x1) ||
950 (rw_bits == 0x2 && trig_bits != 0x2))
951 panic("Invalid r/w trigging for this BP");
952
953 /* Mark this BP as trigged for future reference. */
954 trig_mask |= (1 << bp);
955
956 if (reg.eda >= bp_d_regs[bp * 2] &&
957 reg.eda <= bp_d_regs[bp * 2 + 1]) {
958 /* EDA withing range for this BP; it must be the one
959 we're looking for. */
960 stopped_data_address = reg.eda;
961 break;
962 }
963 }
964 }
965 if (bp < 6) {
966 /* Found a trigged BP with EDA within its configured data range. */
967 } else if (trig_mask) {
968 /* Something triggered, but EDA doesn't match any BP's range. */
969 for (bp = 0; bp < 6; bp++) {
970 /* Dx_BPRD, Dx_BPWR in BP_CTRL for this BP. */
971 int bitpos_config = 2 + bp * 4;
972
973 /* Read/write config bits for this BP (needed later). */
974 rw_bits = (sreg.s0_3 & (3 << bitpos_config)) >> bitpos_config;
975
976 if (trig_mask & (1 << bp)) {
977 /* EDA within 31 bytes of the configured start address? */
978 if (reg.eda + 31 >= bp_d_regs[bp * 2]) {
979 /* Changing the reported address to match
980 the start address of the first applicable BP. */
981 stopped_data_address = bp_d_regs[bp * 2];
982 break;
983 } else {
984 /* We continue since we might find another useful BP. */
985 printk("EDA doesn't match trigged BP's range");
986 }
987 }
988 }
989 }
990
991 /* No match yet? */
992 BUG_ON(bp >= 6);
993 /* Note that we report the type according to what the BP is configured
994 for (otherwise we'd never report an 'awatch'), not according to how
995 it trigged. We did check that the trigged bits match what the BP is
996 configured for though. */
997 if (rw_bits == 0x1) {
998 /* read */
999 strncpy(ptr, "rwatch", 6);
1000 ptr += 6;
1001 } else if (rw_bits == 0x2) {
1002 /* write */
1003 strncpy(ptr, "watch", 5);
1004 ptr += 5;
1005 } else if (rw_bits == 0x3) {
1006 /* access */
1007 strncpy(ptr, "awatch", 6);
1008 ptr += 6;
1009 } else {
1010 panic("Invalid r/w bits for this BP.");
1011 }
1012
1013 *ptr++ = ':';
1014 /* Note that we don't read_register(EDA, ...) */
1015 ptr = mem2hex_nbo(ptr, (unsigned char *)&stopped_data_address, register_size[EDA]);
1016 *ptr++ = ';';
1017 }
1018 }
1019 /* Only send PC, frame and stack pointer. */
1020 read_register(PC, &reg_cont);
1021 *ptr++ = highhex(PC);
1022 *ptr++ = lowhex(PC);
1023 *ptr++ = ':';
1024 ptr = mem2hex(ptr, (unsigned char *)&reg_cont, register_size[PC]);
1025 *ptr++ = ';';
1026
1027 read_register(R8, &reg_cont);
1028 *ptr++ = highhex(R8);
1029 *ptr++ = lowhex(R8);
1030 *ptr++ = ':';
1031 ptr = mem2hex(ptr, (unsigned char *)&reg_cont, register_size[R8]);
1032 *ptr++ = ';';
1033
1034 read_register(SP, &reg_cont);
1035 *ptr++ = highhex(SP);
1036 *ptr++ = lowhex(SP);
1037 *ptr++ = ':';
1038 ptr = mem2hex(ptr, (unsigned char *)&reg_cont, register_size[SP]);
1039 *ptr++ = ';';
1040
1041 /* Send ERP as well; this will save us an entire register fetch in some cases. */
1042 read_register(ERP, &reg_cont);
1043 *ptr++ = highhex(ERP);
1044 *ptr++ = lowhex(ERP);
1045 *ptr++ = ':';
1046 ptr = mem2hex(ptr, (unsigned char *)&reg_cont, register_size[ERP]);
1047 *ptr++ = ';';
1048
1049 /* null-terminate and send it off */
1050 *ptr = 0;
1051 putpacket(output_buffer);
1052}
1053
1054/* Returns the size of an instruction that has a delay slot. */
1055
1056int insn_size(unsigned long pc)
1057{
1058 unsigned short opcode = *(unsigned short *)pc;
1059 int size = 0;
1060
1061 switch ((opcode & 0x0f00) >> 8) {
1062 case 0x0:
1063 case 0x9:
1064 case 0xb:
1065 size = 2;
1066 break;
1067 case 0xe:
1068 case 0xf:
1069 size = 6;
1070 break;
1071 case 0xd:
1072 /* Could be 4 or 6; check more bits. */
1073 if ((opcode & 0xff) == 0xff)
1074 size = 4;
1075 else
1076 size = 6;
1077 break;
1078 default:
1079 panic("Couldn't find size of opcode 0x%x at 0x%lx\n", opcode, pc);
1080 }
1081
1082 return size;
1083}
1084
1085void register_fixup(int sigval)
1086{
1087 /* Compensate for ACR push at the beginning of exception handler. */
1088 reg.sp += 4;
1089
1090 /* Standard case. */
1091 reg.pc = reg.erp;
1092 if (reg.erp & 0x1) {
1093 /* Delay slot bit set. Report as stopped on proper instruction. */
1094 if (reg.spc) {
1095 /* Rely on SPC if set. */
1096 reg.pc = reg.spc;
1097 } else {
1098 /* Calculate the PC from the size of the instruction
1099 that the delay slot we're in belongs to. */
1100 reg.pc += insn_size(reg.erp & ~1) - 1 ;
1101 }
1102 }
1103
1104 if ((reg.exs & 0x3) == 0x0) {
1105 /* Bits 1 - 0 indicate the type of memory operation performed
1106 by the interrupted instruction. 0 means no memory operation,
1107 and EDA is undefined in that case. We zero it to avoid confusion. */
1108 reg.eda = 0;
1109 }
1110
1111 if (sigval == SIGTRAP) {
1112 /* Break 8, single step or hardware breakpoint exception. */
1113
1114 /* Check IDX field of EXS. */
1115 if (((reg.exs & 0xff00) >> 8) == 0x18) {
1116
1117 /* Break 8. */
1118
1119 /* Static (compiled) breakpoints must return to the next instruction
1120 in order to avoid infinite loops (default value of ERP). Dynamic
1121 (gdb-invoked) must subtract the size of the break instruction from
1122 the ERP so that the instruction that was originally in the break
1123 instruction's place will be run when we return from the exception. */
1124 if (!dynamic_bp) {
1125 /* Assuming that all breakpoints are dynamic from now on. */
1126 dynamic_bp = 1;
1127 } else {
1128
1129 /* Only if not in a delay slot. */
1130 if (!(reg.erp & 0x1)) {
1131 reg.erp -= 2;
1132 reg.pc -= 2;
1133 }
1134 }
1135
1136 } else if (((reg.exs & 0xff00) >> 8) == 0x3) {
1137 /* Single step. */
1138 /* Don't fiddle with S1. */
1139
1140 } else if (((reg.exs & 0xff00) >> 8) == 0xc) {
1141
1142 /* Hardware watchpoint exception. */
1143
1144 /* SPC has been updated so that we will get a single step exception
1145 when we return, but we don't want that. */
1146 reg.spc = 0;
1147
1148 /* Don't fiddle with S1. */
1149 }
1150
1151 } else if (sigval == SIGINT) {
1152 /* Nothing special. */
1153 }
1154}
1155
1156static void insert_watchpoint(char type, int addr, int len)
1157{
1158 /* Breakpoint/watchpoint types (GDB terminology):
1159 0 = memory breakpoint for instructions
1160 (not supported; done via memory write instead)
1161 1 = hardware breakpoint for instructions (supported)
1162 2 = write watchpoint (supported)
1163 3 = read watchpoint (supported)
1164 4 = access watchpoint (supported) */
1165
1166 if (type < '1' || type > '4') {
1167 output_buffer[0] = 0;
1168 return;
1169 }
1170
1171 /* Read watchpoints are set as access watchpoints, because of GDB's
1172 inability to deal with pure read watchpoints. */
1173 if (type == '3')
1174 type = '4';
1175
1176 if (type == '1') {
1177 /* Hardware (instruction) breakpoint. */
1178 /* Bit 0 in BP_CTRL holds the configuration for I0. */
1179 if (sreg.s0_3 & 0x1) {
1180 /* Already in use. */
1181 gdb_cris_strcpy(output_buffer, error_message[E04]);
1182 return;
1183 }
1184 /* Configure. */
1185 sreg.s1_3 = addr;
1186 sreg.s2_3 = (addr + len - 1);
1187 sreg.s0_3 |= 1;
1188 } else {
1189 int bp;
1190 unsigned int *bp_d_regs = &sreg.s3_3;
1191
1192 /* The watchpoint allocation scheme is the simplest possible.
1193 For example, if a region is watched for read and
1194 a write watch is requested, a new watchpoint will
1195 be used. Also, if a watch for a region that is already
1196 covered by one or more existing watchpoints, a new
1197 watchpoint will be used. */
1198
1199 /* First, find a free data watchpoint. */
1200 for (bp = 0; bp < 6; bp++) {
1201 /* Each data watchpoint's control registers occupy 2 bits
1202 (hence the 3), starting at bit 2 for D0 (hence the 2)
1203 with 4 bits between for each watchpoint (yes, the 4). */
1204 if (!(sreg.s0_3 & (0x3 << (2 + (bp * 4))))) {
1205 break;
1206 }
1207 }
1208
1209 if (bp > 5) {
1210 /* We're out of watchpoints. */
1211 gdb_cris_strcpy(output_buffer, error_message[E04]);
1212 return;
1213 }
1214
1215 /* Configure the control register first. */
1216 if (type == '3' || type == '4') {
1217 /* Trigger on read. */
1218 sreg.s0_3 |= (1 << (2 + bp * 4));
1219 }
1220 if (type == '2' || type == '4') {
1221 /* Trigger on write. */
1222 sreg.s0_3 |= (2 << (2 + bp * 4));
1223 }
1224
1225 /* Ugly pointer arithmetics to configure the watched range. */
1226 bp_d_regs[bp * 2] = addr;
1227 bp_d_regs[bp * 2 + 1] = (addr + len - 1);
1228 }
1229
1230 /* Set the S1 flag to enable watchpoints. */
1231 reg.ccs |= (1 << (S_CCS_BITNR + CCS_SHIFT));
1232 gdb_cris_strcpy(output_buffer, "OK");
1233}
1234
1235static void remove_watchpoint(char type, int addr, int len)
1236{
1237 /* Breakpoint/watchpoint types:
1238 0 = memory breakpoint for instructions
1239 (not supported; done via memory write instead)
1240 1 = hardware breakpoint for instructions (supported)
1241 2 = write watchpoint (supported)
1242 3 = read watchpoint (supported)
1243 4 = access watchpoint (supported) */
1244 if (type < '1' || type > '4') {
1245 output_buffer[0] = 0;
1246 return;
1247 }
1248
1249 /* Read watchpoints are set as access watchpoints, because of GDB's
1250 inability to deal with pure read watchpoints. */
1251 if (type == '3')
1252 type = '4';
1253
1254 if (type == '1') {
1255 /* Hardware breakpoint. */
1256 /* Bit 0 in BP_CTRL holds the configuration for I0. */
1257 if (!(sreg.s0_3 & 0x1)) {
1258 /* Not in use. */
1259 gdb_cris_strcpy(output_buffer, error_message[E04]);
1260 return;
1261 }
1262 /* Deconfigure. */
1263 sreg.s1_3 = 0;
1264 sreg.s2_3 = 0;
1265 sreg.s0_3 &= ~1;
1266 } else {
1267 int bp;
1268 unsigned int *bp_d_regs = &sreg.s3_3;
1269 /* Try to find a watchpoint that is configured for the
1270 specified range, then check that read/write also matches. */
1271
1272 /* Ugly pointer arithmetic, since I cannot rely on a
1273 single switch (addr) as there may be several watchpoints with
1274 the same start address for example. */
1275
1276 for (bp = 0; bp < 6; bp++) {
1277 if (bp_d_regs[bp * 2] == addr &&
1278 bp_d_regs[bp * 2 + 1] == (addr + len - 1)) {
1279 /* Matching range. */
1280 int bitpos = 2 + bp * 4;
1281 int rw_bits;
1282
1283 /* Read/write bits for this BP. */
1284 rw_bits = (sreg.s0_3 & (0x3 << bitpos)) >> bitpos;
1285
1286 if ((type == '3' && rw_bits == 0x1) ||
1287 (type == '2' && rw_bits == 0x2) ||
1288 (type == '4' && rw_bits == 0x3)) {
1289 /* Read/write matched. */
1290 break;
1291 }
1292 }
1293 }
1294
1295 if (bp > 5) {
1296 /* No watchpoint matched. */
1297 gdb_cris_strcpy(output_buffer, error_message[E04]);
1298 return;
1299 }
1300
1301 /* Found a matching watchpoint. Now, deconfigure it by
1302 both disabling read/write in bp_ctrl and zeroing its
1303 start/end addresses. */
1304 sreg.s0_3 &= ~(3 << (2 + (bp * 4)));
1305 bp_d_regs[bp * 2] = 0;
1306 bp_d_regs[bp * 2 + 1] = 0;
1307 }
1308
1309 /* Note that we don't clear the S1 flag here. It's done when continuing. */
1310 gdb_cris_strcpy(output_buffer, "OK");
1311}
1312
1313
1314
1315/* All expected commands are sent from remote.c. Send a response according
1316 to the description in remote.c. */
1317void
1318handle_exception(int sigval)
1319{
1320 /* Avoid warning of not used. */
1321
1322 USEDFUN(handle_exception);
1323 USEDVAR(internal_stack[0]);
1324
1325 register_fixup(sigval);
1326
1327 /* Send response. */
1328 stub_is_stopped(sigval);
1329
1330 for (;;) {
1331 output_buffer[0] = '\0';
1332 getpacket(input_buffer);
1333 switch (input_buffer[0]) {
1334 case 'g':
1335 /* Read registers: g
1336 Success: Each byte of register data is described by two hex digits.
1337 Registers are in the internal order for GDB, and the bytes
1338 in a register are in the same order the machine uses.
1339 Failure: void. */
1340 {
1341 char *buf;
1342 /* General and special registers. */
1343 buf = mem2hex(output_buffer, (char *)&reg, sizeof(registers));
1344 /* Support registers. */
1345 /* -1 because of the null termination that mem2hex adds. */
1346 mem2hex(buf,
1347 (char *)&sreg + (reg.srs * 16 * sizeof(unsigned int)),
1348 16 * sizeof(unsigned int));
1349 break;
1350 }
1351 case 'G':
1352 /* Write registers. GXX..XX
1353 Each byte of register data is described by two hex digits.
1354 Success: OK
1355 Failure: void. */
1356 /* General and special registers. */
1357 hex2mem((char *)&reg, &input_buffer[1], sizeof(registers));
1358 /* Support registers. */
1359 hex2mem((char *)&sreg + (reg.srs * 16 * sizeof(unsigned int)),
1360 &input_buffer[1] + sizeof(registers),
1361 16 * sizeof(unsigned int));
1362 gdb_cris_strcpy(output_buffer, "OK");
1363 break;
1364
1365 case 'P':
1366 /* Write register. Pn...=r...
1367 Write register n..., hex value without 0x, with value r...,
1368 which contains a hex value without 0x and two hex digits
1369 for each byte in the register (target byte order). P1f=11223344 means
1370 set register 31 to 44332211.
1371 Success: OK
1372 Failure: E02, E05 */
1373 {
1374 char *suffix;
1375 int regno = gdb_cris_strtol(&input_buffer[1], &suffix, 16);
1376 int status;
1377
1378 status = write_register(regno, suffix+1);
1379
1380 switch (status) {
1381 case E02:
1382 /* Do not support read-only registers. */
1383 gdb_cris_strcpy(output_buffer, error_message[E02]);
1384 break;
1385 case E05:
1386 /* Do not support non-existing registers. */
1387 gdb_cris_strcpy(output_buffer, error_message[E05]);
1388 break;
1389 default:
1390 /* Valid register number. */
1391 gdb_cris_strcpy(output_buffer, "OK");
1392 break;
1393 }
1394 }
1395 break;
1396
1397 case 'm':
1398 /* Read from memory. mAA..AA,LLLL
1399 AA..AA is the address and LLLL is the length.
1400 Success: XX..XX is the memory content. Can be fewer bytes than
1401 requested if only part of the data may be read. m6000120a,6c means
1402 retrieve 108 byte from base address 6000120a.
1403 Failure: void. */
1404 {
1405 char *suffix;
1406 unsigned char *addr = (unsigned char *)gdb_cris_strtol(&input_buffer[1],
1407 &suffix, 16);
1408 int len = gdb_cris_strtol(suffix+1, 0, 16);
1409
1410 /* Bogus read (i.e. outside the kernel's
1411 segment)? . */
1412 if (!((unsigned int)addr >= 0xc0000000 &&
1413 (unsigned int)addr < 0xd0000000))
1414 addr = NULL;
1415
1416 mem2hex(output_buffer, addr, len);
1417 }
1418 break;
1419
1420 case 'X':
1421 /* Write to memory. XAA..AA,LLLL:XX..XX
1422 AA..AA is the start address, LLLL is the number of bytes, and
1423 XX..XX is the binary data.
1424 Success: OK
1425 Failure: void. */
1426 case 'M':
1427 /* Write to memory. MAA..AA,LLLL:XX..XX
1428 AA..AA is the start address, LLLL is the number of bytes, and
1429 XX..XX is the hexadecimal data.
1430 Success: OK
1431 Failure: void. */
1432 {
1433 char *lenptr;
1434 char *dataptr;
1435 unsigned char *addr = (unsigned char *)gdb_cris_strtol(&input_buffer[1],
1436 &lenptr, 16);
1437 int len = gdb_cris_strtol(lenptr+1, &dataptr, 16);
1438 if (*lenptr == ',' && *dataptr == ':') {
1439 if (input_buffer[0] == 'M') {
1440 hex2mem(addr, dataptr + 1, len);
1441 } else /* X */ {
1442 bin2mem(addr, dataptr + 1, len);
1443 }
1444 gdb_cris_strcpy(output_buffer, "OK");
1445 }
1446 else {
1447 gdb_cris_strcpy(output_buffer, error_message[E06]);
1448 }
1449 }
1450 break;
1451
1452 case 'c':
1453 /* Continue execution. cAA..AA
1454 AA..AA is the address where execution is resumed. If AA..AA is
1455 omitted, resume at the present address.
1456 Success: return to the executing thread.
1457 Failure: will never know. */
1458
1459 if (input_buffer[1] != '\0') {
1460 /* FIXME: Doesn't handle address argument. */
1461 gdb_cris_strcpy(output_buffer, error_message[E04]);
1462 break;
1463 }
1464
1465 /* Before continuing, make sure everything is set up correctly. */
1466
1467 /* Set the SPC to some unlikely value. */
1468 reg.spc = 0;
1469 /* Set the S1 flag to 0 unless some watchpoint is enabled (since setting
1470 S1 to 0 would also disable watchpoints). (Note that bits 26-31 in BP_CTRL
1471 are reserved, so don't check against those). */
1472 if ((sreg.s0_3 & 0x3fff) == 0) {
1473 reg.ccs &= ~(1 << (S_CCS_BITNR + CCS_SHIFT));
1474 }
1475
1476 return;
1477
1478 case 's':
1479 /* Step. sAA..AA
1480 AA..AA is the address where execution is resumed. If AA..AA is
1481 omitted, resume at the present address. Success: return to the
1482 executing thread. Failure: will never know. */
1483
1484 if (input_buffer[1] != '\0') {
1485 /* FIXME: Doesn't handle address argument. */
1486 gdb_cris_strcpy(output_buffer, error_message[E04]);
1487 break;
1488 }
1489
1490 /* Set the SPC to PC, which is where we'll return
1491 (deduced previously). */
1492 reg.spc = reg.pc;
1493
1494 /* Set the S1 (first stacked, not current) flag, which will
1495 kick into action when we rfe. */
1496 reg.ccs |= (1 << (S_CCS_BITNR + CCS_SHIFT));
1497 return;
1498
1499 case 'Z':
1500
1501 /* Insert breakpoint or watchpoint, Ztype,addr,length.
1502 Remote protocol says: A remote target shall return an empty string
1503 for an unrecognized breakpoint or watchpoint packet type. */
1504 {
1505 char *lenptr;
1506 char *dataptr;
1507 int addr = gdb_cris_strtol(&input_buffer[3], &lenptr, 16);
1508 int len = gdb_cris_strtol(lenptr + 1, &dataptr, 16);
1509 char type = input_buffer[1];
1510
1511 insert_watchpoint(type, addr, len);
1512 break;
1513 }
1514
1515 case 'z':
1516 /* Remove breakpoint or watchpoint, Ztype,addr,length.
1517 Remote protocol says: A remote target shall return an empty string
1518 for an unrecognized breakpoint or watchpoint packet type. */
1519 {
1520 char *lenptr;
1521 char *dataptr;
1522 int addr = gdb_cris_strtol(&input_buffer[3], &lenptr, 16);
1523 int len = gdb_cris_strtol(lenptr + 1, &dataptr, 16);
1524 char type = input_buffer[1];
1525
1526 remove_watchpoint(type, addr, len);
1527 break;
1528 }
1529
1530
1531 case '?':
1532 /* The last signal which caused a stop. ?
1533 Success: SAA, where AA is the signal number.
1534 Failure: void. */
1535 output_buffer[0] = 'S';
1536 output_buffer[1] = highhex(sigval);
1537 output_buffer[2] = lowhex(sigval);
1538 output_buffer[3] = 0;
1539 break;
1540
1541 case 'D':
1542 /* Detach from host. D
1543 Success: OK, and return to the executing thread.
1544 Failure: will never know */
1545 putpacket("OK");
1546 return;
1547
1548 case 'k':
1549 case 'r':
1550 /* kill request or reset request.
1551 Success: restart of target.
1552 Failure: will never know. */
1553 kill_restart();
1554 break;
1555
1556 case 'C':
1557 case 'S':
1558 case '!':
1559 case 'R':
1560 case 'd':
1561 /* Continue with signal sig. Csig;AA..AA
1562 Step with signal sig. Ssig;AA..AA
1563 Use the extended remote protocol. !
1564 Restart the target system. R0
1565 Toggle debug flag. d
1566 Search backwards. tAA:PP,MM
1567 Not supported: E04 */
1568
1569 /* FIXME: What's the difference between not supported
1570 and ignored (below)? */
1571 gdb_cris_strcpy(output_buffer, error_message[E04]);
1572 break;
1573
1574 default:
1575 /* The stub should ignore other request and send an empty
1576 response ($#<checksum>). This way we can extend the protocol and GDB
1577 can tell whether the stub it is talking to uses the old or the new. */
1578 output_buffer[0] = 0;
1579 break;
1580 }
1581 putpacket(output_buffer);
1582 }
1583}
1584
1585void
1586kgdb_init(void)
1587{
1588 reg_intr_vect_rw_mask intr_mask;
1589 reg_ser_rw_intr_mask ser_intr_mask;
1590
1591 /* Configure the kgdb serial port. */
1592#if defined(CONFIG_ETRAX_KGDB_PORT0)
1593 /* Note: no shortcut registered (not handled by multiple_interrupt).
1594 See entry.S. */
1595 set_exception_vector(SER0_INTR_VECT, kgdb_handle_exception);
1596 /* Enable the ser irq in the global config. */
1597 intr_mask = REG_RD(intr_vect, regi_irq, rw_mask);
1598 intr_mask.ser0 = 1;
1599 REG_WR(intr_vect, regi_irq, rw_mask, intr_mask);
1600
1601 ser_intr_mask = REG_RD(ser, regi_ser0, rw_intr_mask);
1602 ser_intr_mask.data_avail = regk_ser_yes;
1603 REG_WR(ser, regi_ser0, rw_intr_mask, ser_intr_mask);
1604#elif defined(CONFIG_ETRAX_KGDB_PORT1)
1605 /* Note: no shortcut registered (not handled by multiple_interrupt).
1606 See entry.S. */
1607 set_exception_vector(SER1_INTR_VECT, kgdb_handle_exception);
1608 /* Enable the ser irq in the global config. */
1609 intr_mask = REG_RD(intr_vect, regi_irq, rw_mask);
1610 intr_mask.ser1 = 1;
1611 REG_WR(intr_vect, regi_irq, rw_mask, intr_mask);
1612
1613 ser_intr_mask = REG_RD(ser, regi_ser1, rw_intr_mask);
1614 ser_intr_mask.data_avail = regk_ser_yes;
1615 REG_WR(ser, regi_ser1, rw_intr_mask, ser_intr_mask);
1616#elif defined(CONFIG_ETRAX_KGDB_PORT2)
1617 /* Note: no shortcut registered (not handled by multiple_interrupt).
1618 See entry.S. */
1619 set_exception_vector(SER2_INTR_VECT, kgdb_handle_exception);
1620 /* Enable the ser irq in the global config. */
1621 intr_mask = REG_RD(intr_vect, regi_irq, rw_mask);
1622 intr_mask.ser2 = 1;
1623 REG_WR(intr_vect, regi_irq, rw_mask, intr_mask);
1624
1625 ser_intr_mask = REG_RD(ser, regi_ser2, rw_intr_mask);
1626 ser_intr_mask.data_avail = regk_ser_yes;
1627 REG_WR(ser, regi_ser2, rw_intr_mask, ser_intr_mask);
1628#elif defined(CONFIG_ETRAX_KGDB_PORT3)
1629 /* Note: no shortcut registered (not handled by multiple_interrupt).
1630 See entry.S. */
1631 set_exception_vector(SER3_INTR_VECT, kgdb_handle_exception);
1632 /* Enable the ser irq in the global config. */
1633 intr_mask = REG_RD(intr_vect, regi_irq, rw_mask);
1634 intr_mask.ser3 = 1;
1635 REG_WR(intr_vect, regi_irq, rw_mask, intr_mask);
1636
1637 ser_intr_mask = REG_RD(ser, regi_ser3, rw_intr_mask);
1638 ser_intr_mask.data_avail = regk_ser_yes;
1639 REG_WR(ser, regi_ser3, rw_intr_mask, ser_intr_mask);
1640#endif
1641
1642}
1643/* Performs a complete re-start from scratch. */
1644static void
1645kill_restart(void)
1646{
1647 machine_restart("");
1648}
1649
1650/* Use this static breakpoint in the start-up only. */
1651
1652void
1653breakpoint(void)
1654{
1655 kgdb_started = 1;
1656 dynamic_bp = 0; /* This is a static, not a dynamic breakpoint. */
1657 __asm__ volatile ("break 8"); /* Jump to kgdb_handle_breakpoint. */
1658}
1659
1660/****************************** End of file **********************************/
diff --git a/arch/cris/arch-v32/kernel/kgdb_asm.S b/arch/cris/arch-v32/kernel/kgdb_asm.S
new file mode 100644
index 000000000000..b350dd279ed2
--- /dev/null
+++ b/arch/cris/arch-v32/kernel/kgdb_asm.S
@@ -0,0 +1,552 @@
1/*
2 * Copyright (C) 2004 Axis Communications AB
3 *
4 * Code for handling break 8, hardware breakpoint, single step, and serial
5 * port exceptions for kernel debugging purposes.
6 */
7
8#include <linux/config.h>
9#include <asm/arch/hwregs/intr_vect.h>
10
11 ;; Exported functions.
12 .globl kgdb_handle_exception
13
14kgdb_handle_exception:
15
16;; Create a register image of the caller.
17;;
18;; First of all, save the ACR on the stack since we need it for address calculations.
19;; We put it into the register struct later.
20
21 subq 4, $sp
22 move.d $acr, [$sp]
23
24;; Now we are free to use ACR all we want.
25;; If we were running this handler with interrupts on, we would have to be careful
26;; to save and restore CCS manually, but since we aren't we treat it like every other
27;; register.
28
29 move.d reg, $acr
30 move.d $r0, [$acr] ; Save R0 (start of register struct)
31 addq 4, $acr
32 move.d $r1, [$acr] ; Save R1
33 addq 4, $acr
34 move.d $r2, [$acr] ; Save R2
35 addq 4, $acr
36 move.d $r3, [$acr] ; Save R3
37 addq 4, $acr
38 move.d $r4, [$acr] ; Save R4
39 addq 4, $acr
40 move.d $r5, [$acr] ; Save R5
41 addq 4, $acr
42 move.d $r6, [$acr] ; Save R6
43 addq 4, $acr
44 move.d $r7, [$acr] ; Save R7
45 addq 4, $acr
46 move.d $r8, [$acr] ; Save R8
47 addq 4, $acr
48 move.d $r9, [$acr] ; Save R9
49 addq 4, $acr
50 move.d $r10, [$acr] ; Save R10
51 addq 4, $acr
52 move.d $r11, [$acr] ; Save R11
53 addq 4, $acr
54 move.d $r12, [$acr] ; Save R12
55 addq 4, $acr
56 move.d $r13, [$acr] ; Save R13
57 addq 4, $acr
58 move.d $sp, [$acr] ; Save SP (R14)
59 addq 4, $acr
60
61 ;; The ACR register is already saved on the stack, so pop it from there.
62 move.d [$sp],$r0
63 move.d $r0, [$acr]
64 addq 4, $acr
65
66 move $bz, [$acr]
67 addq 1, $acr
68 move $vr, [$acr]
69 addq 1, $acr
70 move $pid, [$acr]
71 addq 4, $acr
72 move $srs, [$acr]
73 addq 1, $acr
74 move $wz, [$acr]
75 addq 2, $acr
76 move $exs, [$acr]
77 addq 4, $acr
78 move $eda, [$acr]
79 addq 4, $acr
80 move $mof, [$acr]
81 addq 4, $acr
82 move $dz, [$acr]
83 addq 4, $acr
84 move $ebp, [$acr]
85 addq 4, $acr
86 move $erp, [$acr]
87 addq 4, $acr
88 move $srp, [$acr]
89 addq 4, $acr
90 move $nrp, [$acr]
91 addq 4, $acr
92 move $ccs, [$acr]
93 addq 4, $acr
94 move $usp, [$acr]
95 addq 4, $acr
96 move $spc, [$acr]
97 addq 4, $acr
98
99;; Skip the pseudo-PC.
100 addq 4, $acr
101
102;; Save the support registers in bank 0 - 3.
103 clear.d $r1 ; Bank counter
104 move.d sreg, $acr
105
106;; Bank 0
107 move $r1, $srs
108 nop
109 nop
110 nop
111 move $s0, $r0
112 move.d $r0, [$acr]
113 addq 4, $acr
114 move $s1, $r0
115 move.d $r0, [$acr]
116 addq 4, $acr
117 move $s2, $r0
118 move.d $r0, [$acr]
119 addq 4, $acr
120 move $s3, $r0
121 move.d $r0, [$acr]
122 addq 4, $acr
123 move $s4, $r0
124 move.d $r0, [$acr]
125 addq 4, $acr
126 move $s5, $r0
127 move.d $r0, [$acr]
128 addq 4, $acr
129 move $s6, $r0
130 move.d $r0, [$acr]
131 addq 4, $acr
132 move $s7, $r0
133 move.d $r0, [$acr]
134 addq 4, $acr
135 move $s8, $r0
136 move.d $r0, [$acr]
137 addq 4, $acr
138 move $s9, $r0
139 move.d $r0, [$acr]
140 addq 4, $acr
141 move $s10, $r0
142 move.d $r0, [$acr]
143 addq 4, $acr
144 move $s11, $r0
145 move.d $r0, [$acr]
146 addq 4, $acr
147 move $s12, $r0
148 move.d $r0, [$acr]
149 addq 4, $acr
150
151 ;; Nothing in S13 - S15, bank 0
152 clear.d [$acr]
153 addq 4, $acr
154 clear.d [$acr]
155 addq 4, $acr
156 clear.d [$acr]
157 addq 4, $acr
158
159;; Bank 1 and bank 2 have the same layout, hence the loop.
160 addq 1, $r1
1611:
162 move $r1, $srs
163 nop
164 nop
165 nop
166 move $s0, $r0
167 move.d $r0, [$acr]
168 addq 4, $acr
169 move $s1, $r0
170 move.d $r0, [$acr]
171 addq 4, $acr
172 move $s2, $r0
173 move.d $r0, [$acr]
174 addq 4, $acr
175 move $s3, $r0
176 move.d $r0, [$acr]
177 addq 4, $acr
178 move $s4, $r0
179 move.d $r0, [$acr]
180 addq 4, $acr
181 move $s5, $r0
182 move.d $r0, [$acr]
183 addq 4, $acr
184 move $s6, $r0
185 move.d $r0, [$acr]
186 addq 4, $acr
187
188 ;; Nothing in S7 - S15, bank 1 and 2
189 clear.d [$acr]
190 addq 4, $acr
191 clear.d [$acr]
192 addq 4, $acr
193 clear.d [$acr]
194 addq 4, $acr
195 clear.d [$acr]
196 addq 4, $acr
197 clear.d [$acr]
198 addq 4, $acr
199 clear.d [$acr]
200 addq 4, $acr
201 clear.d [$acr]
202 addq 4, $acr
203 clear.d [$acr]
204 addq 4, $acr
205 clear.d [$acr]
206 addq 4, $acr
207
208 addq 1, $r1
209 cmpq 3, $r1
210 bne 1b
211 nop
212
213;; Bank 3
214 move $r1, $srs
215 nop
216 nop
217 nop
218 move $s0, $r0
219 move.d $r0, [$acr]
220 addq 4, $acr
221 move $s1, $r0
222 move.d $r0, [$acr]
223 addq 4, $acr
224 move $s2, $r0
225 move.d $r0, [$acr]
226 addq 4, $acr
227 move $s3, $r0
228 move.d $r0, [$acr]
229 addq 4, $acr
230 move $s4, $r0
231 move.d $r0, [$acr]
232 addq 4, $acr
233 move $s5, $r0
234 move.d $r0, [$acr]
235 addq 4, $acr
236 move $s6, $r0
237 move.d $r0, [$acr]
238 addq 4, $acr
239 move $s7, $r0
240 move.d $r0, [$acr]
241 addq 4, $acr
242 move $s8, $r0
243 move.d $r0, [$acr]
244 addq 4, $acr
245 move $s9, $r0
246 move.d $r0, [$acr]
247 addq 4, $acr
248 move $s10, $r0
249 move.d $r0, [$acr]
250 addq 4, $acr
251 move $s11, $r0
252 move.d $r0, [$acr]
253 addq 4, $acr
254 move $s12, $r0
255 move.d $r0, [$acr]
256 addq 4, $acr
257 move $s13, $r0
258 move.d $r0, [$acr]
259 addq 4, $acr
260 move $s14, $r0
261 move.d $r0, [$acr]
262 addq 4, $acr
263;; Nothing in S15, bank 3
264 clear.d [$acr]
265 addq 4, $acr
266
267;; Check what got us here: get IDX field of EXS.
268 move $exs, $r10
269 and.d 0xff00, $r10
270 lsrq 8, $r10
271#if defined(CONFIG_ETRAX_KGDB_PORT0)
272 cmp.d SER0_INTR_VECT, $r10 ; IRQ for serial port 0
273 beq sigint
274 nop
275#elif defined(CONFIG_ETRAX_KGDB_PORT1)
276 cmp.d SER1_INTR_VECT, $r10 ; IRQ for serial port 1
277 beq sigint
278 nop
279#elif defined(CONFIG_ETRAX_KGDB_PORT2)
280 cmp.d SER2_INTR_VECT, $r10 ; IRQ for serial port 2
281 beq sigint
282 nop
283#elif defined(CONFIG_ETRAX_KGDB_PORT3)
284 cmp.d SER3_INTR_VECT, $r10 ; IRQ for serial port 3
285 beq sigint
286 nop
287#endif
288;; Multiple interrupt must be due to serial break.
289 cmp.d 0x30, $r10 ; Multiple interrupt
290 beq sigint
291 nop
292;; Neither of those? Then it's a sigtrap.
293 ba handle_comm
294 moveq 5, $r10 ; Set SIGTRAP (delay slot)
295
296sigint:
297 ;; Serial interrupt; get character
298 jsr getDebugChar
299 nop ; Delay slot
300 cmp.b 3, $r10 ; \003 (Ctrl-C)?
301 bne return ; No, get out of here
302 nop
303 moveq 2, $r10 ; Set SIGINT
304
305;;
306;; Handle the communication
307;;
308handle_comm:
309 move.d internal_stack+1020, $sp ; Use the internal stack which grows upwards
310 jsr handle_exception ; Interactive routine
311 nop
312
313;;
314;; Return to the caller
315;;
316return:
317
318;; First of all, write the support registers.
319 clear.d $r1 ; Bank counter
320 move.d sreg, $acr
321
322;; Bank 0
323 move $r1, $srs
324 nop
325 nop
326 nop
327 move.d [$acr], $r0
328 move $r0, $s0
329 addq 4, $acr
330 move.d [$acr], $r0
331 move $r0, $s1
332 addq 4, $acr
333 move.d [$acr], $r0
334 move $r0, $s2
335 addq 4, $acr
336 move.d [$acr], $r0
337 move $r0, $s3
338 addq 4, $acr
339 move.d [$acr], $r0
340 move $r0, $s4
341 addq 4, $acr
342 move.d [$acr], $r0
343 move $r0, $s5
344 addq 4, $acr
345
346;; Nothing in S6 - S7, bank 0.
347 addq 4, $acr
348 addq 4, $acr
349
350 move.d [$acr], $r0
351 move $r0, $s8
352 addq 4, $acr
353 move.d [$acr], $r0
354 move $r0, $s9
355 addq 4, $acr
356 move.d [$acr], $r0
357 move $r0, $s10
358 addq 4, $acr
359 move.d [$acr], $r0
360 move $r0, $s11
361 addq 4, $acr
362 move.d [$acr], $r0
363 move $r0, $s12
364 addq 4, $acr
365
366;; Nothing in S13 - S15, bank 0
367 addq 4, $acr
368 addq 4, $acr
369 addq 4, $acr
370
371;; Bank 1 and bank 2 have the same layout, hence the loop.
372 addq 1, $r1
3732:
374 move $r1, $srs
375 nop
376 nop
377 nop
378 move.d [$acr], $r0
379 move $r0, $s0
380 addq 4, $acr
381 move.d [$acr], $r0
382 move $r0, $s1
383 addq 4, $acr
384 move.d [$acr], $r0
385 move $r0, $s2
386 addq 4, $acr
387
388;; S3 (MM_CAUSE) is read-only.
389 addq 4, $acr
390
391 move.d [$acr], $r0
392 move $r0, $s4
393 addq 4, $acr
394
395;; FIXME: Actually write S5/S6? (Affects MM_CAUSE.)
396 addq 4, $acr
397 addq 4, $acr
398
399;; Nothing in S7 - S15, bank 1 and 2
400 addq 4, $acr
401 addq 4, $acr
402 addq 4, $acr
403 addq 4, $acr
404 addq 4, $acr
405 addq 4, $acr
406 addq 4, $acr
407 addq 4, $acr
408 addq 4, $acr
409
410 addq 1, $r1
411 cmpq 3, $r1
412 bne 2b
413 nop
414
415;; Bank 3
416 move $r1, $srs
417 nop
418 nop
419 nop
420 move.d [$acr], $r0
421 move $r0, $s0
422 addq 4, $acr
423 move.d [$acr], $r0
424 move $r0, $s1
425 addq 4, $acr
426 move.d [$acr], $r0
427 move $r0, $s2
428 addq 4, $acr
429 move.d [$acr], $r0
430 move $r0, $s3
431 addq 4, $acr
432 move.d [$acr], $r0
433 move $r0, $s4
434 addq 4, $acr
435 move.d [$acr], $r0
436 move $r0, $s5
437 addq 4, $acr
438 move.d [$acr], $r0
439 move $r0, $s6
440 addq 4, $acr
441 move.d [$acr], $r0
442 move $r0, $s7
443 addq 4, $acr
444 move.d [$acr], $r0
445 move $r0, $s8
446 addq 4, $acr
447 move.d [$acr], $r0
448 move $r0, $s9
449 addq 4, $acr
450 move.d [$acr], $r0
451 move $r0, $s10
452 addq 4, $acr
453 move.d [$acr], $r0
454 move $r0, $s11
455 addq 4, $acr
456 move.d [$acr], $r0
457 move $r0, $s12
458 addq 4, $acr
459 move.d [$acr], $r0
460 move $r0, $s13
461 addq 4, $acr
462 move.d [$acr], $r0
463 move $r0, $s14
464 addq 4, $acr
465
466;; Nothing in S15, bank 3
467 addq 4, $acr
468
469;; Now, move on to the regular register restoration process.
470
471 move.d reg, $acr ; Reset ACR to point at the beginning of the register image
472 move.d [$acr], $r0 ; Restore R0
473 addq 4, $acr
474 move.d [$acr], $r1 ; Restore R1
475 addq 4, $acr
476 move.d [$acr], $r2 ; Restore R2
477 addq 4, $acr
478 move.d [$acr], $r3 ; Restore R3
479 addq 4, $acr
480 move.d [$acr], $r4 ; Restore R4
481 addq 4, $acr
482 move.d [$acr], $r5 ; Restore R5
483 addq 4, $acr
484 move.d [$acr], $r6 ; Restore R6
485 addq 4, $acr
486 move.d [$acr], $r7 ; Restore R7
487 addq 4, $acr
488 move.d [$acr], $r8 ; Restore R8
489 addq 4, $acr
490 move.d [$acr], $r9 ; Restore R9
491 addq 4, $acr
492 move.d [$acr], $r10 ; Restore R10
493 addq 4, $acr
494 move.d [$acr], $r11 ; Restore R11
495 addq 4, $acr
496 move.d [$acr], $r12 ; Restore R12
497 addq 4, $acr
498 move.d [$acr], $r13 ; Restore R13
499
500;;
501;; We restore all registers, even though some of them probably haven't changed.
502;;
503
504 addq 4, $acr
505 move.d [$acr], $sp ; Restore SP (R14)
506
507 ;; ACR cannot be restored just yet.
508 addq 8, $acr
509
510 ;; Skip BZ, VR.
511 addq 2, $acr
512
513 move [$acr], $pid ; Restore PID
514 addq 4, $acr
515 move [$acr], $srs ; Restore SRS
516 nop
517 nop
518 nop
519 addq 1, $acr
520
521 ;; Skip WZ.
522 addq 2, $acr
523
524 move [$acr], $exs ; Restore EXS.
525 addq 4, $acr
526 move [$acr], $eda ; Restore EDA.
527 addq 4, $acr
528 move [$acr], $mof ; Restore MOF.
529
530 ;; Skip DZ.
531 addq 8, $acr
532
533 move [$acr], $ebp ; Restore EBP.
534 addq 4, $acr
535 move [$acr], $erp ; Restore ERP.
536 addq 4, $acr
537 move [$acr], $srp ; Restore SRP.
538 addq 4, $acr
539 move [$acr], $nrp ; Restore NRP.
540 addq 4, $acr
541 move [$acr], $ccs ; Restore CCS like an ordinary register.
542 addq 4, $acr
543 move [$acr], $usp ; Restore USP
544 addq 4, $acr
545 move [$acr], $spc ; Restore SPC
546 ; No restoration of pseudo-PC of course.
547
548 move.d reg, $acr ; Reset ACR to point at the beginning of the register image
549 add.d 15*4, $acr
550 move.d [$acr], $acr ; Finally, restore ACR.
551 rete ; Same as jump ERP
552 rfe ; Shifts CCS
diff --git a/arch/cris/arch-v32/kernel/pinmux.c b/arch/cris/arch-v32/kernel/pinmux.c
new file mode 100644
index 000000000000..a2b8aa37c1bf
--- /dev/null
+++ b/arch/cris/arch-v32/kernel/pinmux.c
@@ -0,0 +1,229 @@
1/*
2 * Allocator for I/O pins. All pins are allocated to GPIO at bootup.
3 * Unassigned pins and GPIO pins can be allocated to a fixed interface
4 * or the I/O processor instead.
5 *
6 * Copyright (c) 2004 Axis Communications AB.
7 */
8
9#include <linux/init.h>
10#include <linux/errno.h>
11#include <linux/kernel.h>
12#include <linux/string.h>
13#include <linux/spinlock.h>
14#include <asm/arch/hwregs/reg_map.h>
15#include <asm/arch/hwregs/reg_rdwr.h>
16#include <asm/arch/pinmux.h>
17#include <asm/arch/hwregs/pinmux_defs.h>
18
19#undef DEBUG
20
21#define PORT_PINS 18
22#define PORTS 4
23
24static char pins[PORTS][PORT_PINS];
25static DEFINE_SPINLOCK(pinmux_lock);
26
27static void crisv32_pinmux_set(int port);
28
29int
30crisv32_pinmux_init(void)
31{
32 static int initialized = 0;
33
34 if (!initialized) {
35 reg_pinmux_rw_pa pa = REG_RD(pinmux, regi_pinmux, rw_pa);
36 initialized = 1;
37 pa.pa0 = pa.pa1 = pa.pa2 = pa.pa3 =
38 pa.pa4 = pa.pa5 = pa.pa6 = pa.pa7 = regk_pinmux_yes;
39 REG_WR(pinmux, regi_pinmux, rw_pa, pa);
40 crisv32_pinmux_alloc(PORT_B, 0, PORT_PINS - 1, pinmux_gpio);
41 crisv32_pinmux_alloc(PORT_C, 0, PORT_PINS - 1, pinmux_gpio);
42 crisv32_pinmux_alloc(PORT_D, 0, PORT_PINS - 1, pinmux_gpio);
43 crisv32_pinmux_alloc(PORT_E, 0, PORT_PINS - 1, pinmux_gpio);
44 }
45
46 return 0;
47}
48
49int
50crisv32_pinmux_alloc(int port, int first_pin, int last_pin, enum pin_mode mode)
51{
52 int i;
53 unsigned long flags;
54
55 crisv32_pinmux_init();
56
57 if (port > PORTS)
58 return -EINVAL;
59
60 spin_lock_irqsave(&pinmux_lock, flags);
61
62 for (i = first_pin; i <= last_pin; i++)
63 {
64 if ((pins[port][i] != pinmux_none) && (pins[port][i] != pinmux_gpio) &&
65 (pins[port][i] != mode))
66 {
67 spin_unlock_irqrestore(&pinmux_lock, flags);
68#ifdef DEBUG
69 panic("Pinmux alloc failed!\n");
70#endif
71 return -EPERM;
72 }
73 }
74
75 for (i = first_pin; i <= last_pin; i++)
76 pins[port][i] = mode;
77
78 crisv32_pinmux_set(port);
79
80 spin_unlock_irqrestore(&pinmux_lock, flags);
81
82 return 0;
83}
84
85int
86crisv32_pinmux_alloc_fixed(enum fixed_function function)
87{
88 int ret = -EINVAL;
89 char saved[sizeof pins];
90 unsigned long flags;
91
92 spin_lock_irqsave(&pinmux_lock, flags);
93
94 /* Save internal data for recovery */
95 memcpy(saved, pins, sizeof pins);
96
97 reg_pinmux_rw_hwprot hwprot = REG_RD(pinmux, regi_pinmux, rw_hwprot);
98
99 switch(function)
100 {
101 case pinmux_ser1:
102 ret = crisv32_pinmux_alloc(PORT_C, 4, 7, pinmux_fixed);
103 hwprot.ser1 = regk_pinmux_yes;
104 break;
105 case pinmux_ser2:
106 ret = crisv32_pinmux_alloc(PORT_C, 8, 11, pinmux_fixed);
107 hwprot.ser2 = regk_pinmux_yes;
108 break;
109 case pinmux_ser3:
110 ret = crisv32_pinmux_alloc(PORT_C, 12, 15, pinmux_fixed);
111 hwprot.ser3 = regk_pinmux_yes;
112 break;
113 case pinmux_sser0:
114 ret = crisv32_pinmux_alloc(PORT_C, 0, 3, pinmux_fixed);
115 ret |= crisv32_pinmux_alloc(PORT_C, 16, 16, pinmux_fixed);
116 hwprot.sser0 = regk_pinmux_yes;
117 break;
118 case pinmux_sser1:
119 ret = crisv32_pinmux_alloc(PORT_D, 0, 4, pinmux_fixed);
120 hwprot.sser1 = regk_pinmux_yes;
121 break;
122 case pinmux_ata0:
123 ret = crisv32_pinmux_alloc(PORT_D, 5, 7, pinmux_fixed);
124 ret |= crisv32_pinmux_alloc(PORT_D, 15, 17, pinmux_fixed);
125 hwprot.ata0 = regk_pinmux_yes;
126 break;
127 case pinmux_ata1:
128 ret = crisv32_pinmux_alloc(PORT_D, 0, 4, pinmux_fixed);
129 ret |= crisv32_pinmux_alloc(PORT_E, 17, 17, pinmux_fixed);
130 hwprot.ata1 = regk_pinmux_yes;
131 break;
132 case pinmux_ata2:
133 ret = crisv32_pinmux_alloc(PORT_C, 11, 15, pinmux_fixed);
134 ret |= crisv32_pinmux_alloc(PORT_E, 3, 3, pinmux_fixed);
135 hwprot.ata2 = regk_pinmux_yes;
136 break;
137 case pinmux_ata3:
138 ret = crisv32_pinmux_alloc(PORT_C, 8, 10, pinmux_fixed);
139 ret |= crisv32_pinmux_alloc(PORT_C, 0, 2, pinmux_fixed);
140 hwprot.ata2 = regk_pinmux_yes;
141 break;
142 case pinmux_ata:
143 ret = crisv32_pinmux_alloc(PORT_B, 0, 15, pinmux_fixed);
144 ret |= crisv32_pinmux_alloc(PORT_D, 8, 15, pinmux_fixed);
145 hwprot.ata = regk_pinmux_yes;
146 break;
147 case pinmux_eth1:
148 ret = crisv32_pinmux_alloc(PORT_E, 0, 17, pinmux_fixed);
149 hwprot.eth1 = regk_pinmux_yes;
150 hwprot.eth1_mgm = regk_pinmux_yes;
151 break;
152 case pinmux_timer:
153 ret = crisv32_pinmux_alloc(PORT_C, 16, 16, pinmux_fixed);
154 hwprot.timer = regk_pinmux_yes;
155 spin_unlock_irqrestore(&pinmux_lock, flags);
156 return ret;
157 }
158
159 if (!ret)
160 REG_WR(pinmux, regi_pinmux, rw_hwprot, hwprot);
161 else
162 memcpy(pins, saved, sizeof pins);
163
164 spin_unlock_irqrestore(&pinmux_lock, flags);
165
166 return ret;
167}
168
169void
170crisv32_pinmux_set(int port)
171{
172 int i;
173 int gpio_val = 0;
174 int iop_val = 0;
175
176 for (i = 0; i < PORT_PINS; i++)
177 {
178 if (pins[port][i] == pinmux_gpio)
179 gpio_val |= (1 << i);
180 else if (pins[port][i] == pinmux_iop)
181 iop_val |= (1 << i);
182 }
183
184 REG_WRITE(int, regi_pinmux + REG_RD_ADDR_pinmux_rw_pb_gio + 8*port, gpio_val);
185 REG_WRITE(int, regi_pinmux + REG_RD_ADDR_pinmux_rw_pb_iop + 8*port, iop_val);
186
187#ifdef DEBUG
188 crisv32_pinmux_dump();
189#endif
190}
191
192int
193crisv32_pinmux_dealloc(int port, int first_pin, int last_pin)
194{
195 int i;
196 unsigned long flags;
197
198 crisv32_pinmux_init();
199
200 if (port > PORTS)
201 return -EINVAL;
202
203 spin_lock_irqsave(&pinmux_lock, flags);
204
205 for (i = first_pin; i <= last_pin; i++)
206 pins[port][i] = pinmux_none;
207
208 crisv32_pinmux_set(port);
209 spin_unlock_irqrestore(&pinmux_lock, flags);
210
211 return 0;
212}
213
214void
215crisv32_pinmux_dump(void)
216{
217 int i, j;
218
219 crisv32_pinmux_init();
220
221 for (i = 0; i < PORTS; i++)
222 {
223 printk("Port %c\n", 'B'+i);
224 for (j = 0; j < PORT_PINS; j++)
225 printk(" Pin %d = %d\n", j, pins[i][j]);
226 }
227}
228
229__initcall(crisv32_pinmux_init);
diff --git a/arch/cris/arch-v32/kernel/process.c b/arch/cris/arch-v32/kernel/process.c
new file mode 100644
index 000000000000..882be42114f7
--- /dev/null
+++ b/arch/cris/arch-v32/kernel/process.c
@@ -0,0 +1,270 @@
1/*
2 * Copyright (C) 2000-2003 Axis Communications AB
3 *
4 * Authors: Bjorn Wesen (bjornw@axis.com)
5 * Mikael Starvik (starvik@axis.com)
6 * Tobias Anderberg (tobiasa@axis.com), CRISv32 port.
7 *
8 * This file handles the architecture-dependent parts of process handling..
9 */
10
11#include <linux/config.h>
12#include <linux/sched.h>
13#include <linux/err.h>
14#include <linux/fs.h>
15#include <linux/slab.h>
16#include <asm/arch/hwregs/reg_rdwr.h>
17#include <asm/arch/hwregs/reg_map.h>
18#include <asm/arch/hwregs/timer_defs.h>
19#include <asm/arch/hwregs/intr_vect_defs.h>
20
21extern void stop_watchdog(void);
22
23#ifdef CONFIG_ETRAX_GPIO
24extern void etrax_gpio_wake_up_check(void); /* Defined in drivers/gpio.c. */
25#endif
26
27extern int cris_hlt_counter;
28
29/* We use this if we don't have any better idle routine. */
30void default_idle(void)
31{
32 local_irq_disable();
33 if (!need_resched() && !cris_hlt_counter) {
34 /* Halt until exception. */
35 __asm__ volatile("ei \n\t"
36 "halt ");
37 }
38 local_irq_enable();
39}
40
41/*
42 * Free current thread data structures etc..
43 */
44
45extern void deconfigure_bp(long pid);
46void exit_thread(void)
47{
48 deconfigure_bp(current->pid);
49}
50
51/*
52 * If the watchdog is enabled, disable interrupts and enter an infinite loop.
53 * The watchdog will reset the CPU after 0.1s. If the watchdog isn't enabled
54 * then enable it and wait.
55 */
56extern void arch_enable_nmi(void);
57
58void
59hard_reset_now(void)
60{
61 /*
62 * Don't declare this variable elsewhere. We don't want any other
63 * code to know about it than the watchdog handler in entry.S and
64 * this code, implementing hard reset through the watchdog.
65 */
66#if defined(CONFIG_ETRAX_WATCHDOG)
67 extern int cause_of_death;
68#endif
69
70 printk("*** HARD RESET ***\n");
71 local_irq_disable();
72
73#if defined(CONFIG_ETRAX_WATCHDOG)
74 cause_of_death = 0xbedead;
75#else
76{
77 reg_timer_rw_wd_ctrl wd_ctrl = {0};
78
79 stop_watchdog();
80
81 wd_ctrl.key = 16; /* Arbitrary key. */
82 wd_ctrl.cnt = 1; /* Minimum time. */
83 wd_ctrl.cmd = regk_timer_start;
84
85 arch_enable_nmi();
86 REG_WR(timer, regi_timer, rw_wd_ctrl, wd_ctrl);
87}
88#endif
89
90 while (1)
91 ; /* Wait for reset. */
92}
93
94/*
95 * Return saved PC of a blocked thread.
96 */
97unsigned long thread_saved_pc(struct task_struct *t)
98{
99 return (unsigned long)user_regs(t->thread_info)->erp;
100}
101
102static void
103kernel_thread_helper(void* dummy, int (*fn)(void *), void * arg)
104{
105 fn(arg);
106 do_exit(-1); /* Should never be called, return bad exit value. */
107}
108
109/* Create a kernel thread. */
110int
111kernel_thread(int (*fn)(void *), void * arg, unsigned long flags)
112{
113 struct pt_regs regs;
114
115 memset(&regs, 0, sizeof(regs));
116
117 /* Don't use r10 since that is set to 0 in copy_thread. */
118 regs.r11 = (unsigned long) fn;
119 regs.r12 = (unsigned long) arg;
120 regs.erp = (unsigned long) kernel_thread_helper;
121 regs.ccs = 1 << (I_CCS_BITNR + CCS_SHIFT);
122
123 /* Create the new process. */
124 return do_fork(flags | CLONE_VM | CLONE_UNTRACED, 0, &regs, 0, NULL, NULL);
125}
126
127/*
128 * Setup the child's kernel stack with a pt_regs and call switch_stack() on it.
129 * It will be unnested during _resume and _ret_from_sys_call when the new thread
130 * is scheduled.
131 *
132 * Also setup the thread switching structure which is used to keep
133 * thread-specific data during _resumes.
134 */
135
136extern asmlinkage void ret_from_fork(void);
137
138int
139copy_thread(int nr, unsigned long clone_flags, unsigned long usp,
140 unsigned long unused,
141 struct task_struct *p, struct pt_regs *regs)
142{
143 struct pt_regs *childregs;
144 struct switch_stack *swstack;
145
146 /*
147 * Put the pt_regs structure at the end of the new kernel stack page and
148 * fix it up. Note: the task_struct doubles as the kernel stack for the
149 * task.
150 */
151 childregs = user_regs(p->thread_info);
152 *childregs = *regs; /* Struct copy of pt_regs. */
153 p->set_child_tid = p->clear_child_tid = NULL;
154 childregs->r10 = 0; /* Child returns 0 after a fork/clone. */
155
156 /* Set a new TLS ?
157 * The TLS is in $mof beacuse it is the 5th argument to sys_clone.
158 */
159 if (p->mm && (clone_flags & CLONE_SETTLS)) {
160 p->thread_info->tls = regs->mof;
161 }
162
163 /* Put the switch stack right below the pt_regs. */
164 swstack = ((struct switch_stack *) childregs) - 1;
165
166 /* Paramater to ret_from_sys_call. 0 is don't restart the syscall. */
167 swstack->r9 = 0;
168
169 /*
170 * We want to return into ret_from_sys_call after the _resume.
171 * ret_from_fork will call ret_from_sys_call.
172 */
173 swstack->return_ip = (unsigned long) ret_from_fork;
174
175 /* Fix the user-mode and kernel-mode stackpointer. */
176 p->thread.usp = usp;
177 p->thread.ksp = (unsigned long) swstack;
178
179 return 0;
180}
181
182/*
183 * Be aware of the "magic" 7th argument in the four system-calls below.
184 * They need the latest stackframe, which is put as the 7th argument by
185 * entry.S. The previous arguments are dummies or actually used, but need
186 * to be defined to reach the 7th argument.
187 *
188 * N.B.: Another method to get the stackframe is to use current_regs(). But
189 * it returns the latest stack-frame stacked when going from _user mode_ and
190 * some of these (at least sys_clone) are called from kernel-mode sometimes
191 * (for example during kernel_thread, above) and thus cannot use it. Thus,
192 * to be sure not to get any surprises, we use the method for the other calls
193 * as well.
194 */
195asmlinkage int
196sys_fork(long r10, long r11, long r12, long r13, long mof, long srp,
197 struct pt_regs *regs)
198{
199 return do_fork(SIGCHLD, rdusp(), regs, 0, NULL, NULL);
200}
201
202/* FIXME: Is parent_tid/child_tid really third/fourth argument? Update lib? */
203asmlinkage int
204sys_clone(unsigned long newusp, unsigned long flags, int *parent_tid, int *child_tid,
205 unsigned long tls, long srp, struct pt_regs *regs)
206{
207 if (!newusp)
208 newusp = rdusp();
209
210 return do_fork(flags, newusp, regs, 0, parent_tid, child_tid);
211}
212
213/*
214 * vfork is a system call in i386 because of register-pressure - maybe
215 * we can remove it and handle it in libc but we put it here until then.
216 */
217asmlinkage int
218sys_vfork(long r10, long r11, long r12, long r13, long mof, long srp,
219 struct pt_regs *regs)
220{
221 return do_fork(CLONE_VFORK | CLONE_VM | SIGCHLD, rdusp(), regs, 0, NULL, NULL);
222}
223
224/* sys_execve() executes a new program. */
225asmlinkage int
226sys_execve(const char *fname, char **argv, char **envp, long r13, long mof, long srp,
227 struct pt_regs *regs)
228{
229 int error;
230 char *filename;
231
232 filename = getname(fname);
233 error = PTR_ERR(filename);
234
235 if (IS_ERR(filename))
236 goto out;
237
238 error = do_execve(filename, argv, envp, regs);
239 putname(filename);
240 out:
241 return error;
242}
243
244unsigned long
245get_wchan(struct task_struct *p)
246{
247 /* TODO */
248 return 0;
249}
250#undef last_sched
251#undef first_sched
252
253void show_regs(struct pt_regs * regs)
254{
255 unsigned long usp = rdusp();
256 printk("ERP: %08lx SRP: %08lx CCS: %08lx USP: %08lx MOF: %08lx\n",
257 regs->erp, regs->srp, regs->ccs, usp, regs->mof);
258
259 printk(" r0: %08lx r1: %08lx r2: %08lx r3: %08lx\n",
260 regs->r0, regs->r1, regs->r2, regs->r3);
261
262 printk(" r4: %08lx r5: %08lx r6: %08lx r7: %08lx\n",
263 regs->r4, regs->r5, regs->r6, regs->r7);
264
265 printk(" r8: %08lx r9: %08lx r10: %08lx r11: %08lx\n",
266 regs->r8, regs->r9, regs->r10, regs->r11);
267
268 printk("r12: %08lx r13: %08lx oR10: %08lx\n",
269 regs->r12, regs->r13, regs->orig_r10);
270}
diff --git a/arch/cris/arch-v32/kernel/ptrace.c b/arch/cris/arch-v32/kernel/ptrace.c
new file mode 100644
index 000000000000..208489da2a87
--- /dev/null
+++ b/arch/cris/arch-v32/kernel/ptrace.c
@@ -0,0 +1,597 @@
1/*
2 * Copyright (C) 2000-2003, Axis Communications AB.
3 */
4
5#include <linux/kernel.h>
6#include <linux/sched.h>
7#include <linux/mm.h>
8#include <linux/smp.h>
9#include <linux/smp_lock.h>
10#include <linux/errno.h>
11#include <linux/ptrace.h>
12#include <linux/user.h>
13#include <linux/signal.h>
14#include <linux/security.h>
15
16#include <asm/uaccess.h>
17#include <asm/page.h>
18#include <asm/pgtable.h>
19#include <asm/system.h>
20#include <asm/processor.h>
21#include <asm/arch/hwregs/supp_reg.h>
22
23/*
24 * Determines which bits in CCS the user has access to.
25 * 1 = access, 0 = no access.
26 */
27#define CCS_MASK 0x00087c00 /* SXNZVC */
28
29#define SBIT_USER (1 << (S_CCS_BITNR + CCS_SHIFT))
30
31static int put_debugreg(long pid, unsigned int regno, long data);
32static long get_debugreg(long pid, unsigned int regno);
33static unsigned long get_pseudo_pc(struct task_struct *child);
34void deconfigure_bp(long pid);
35
36extern unsigned long cris_signal_return_page;
37
38/*
39 * Get contents of register REGNO in task TASK.
40 */
41long get_reg(struct task_struct *task, unsigned int regno)
42{
43 /* USP is a special case, it's not in the pt_regs struct but
44 * in the tasks thread struct
45 */
46 unsigned long ret;
47
48 if (regno <= PT_EDA)
49 ret = ((unsigned long *)user_regs(task->thread_info))[regno];
50 else if (regno == PT_USP)
51 ret = task->thread.usp;
52 else if (regno == PT_PPC)
53 ret = get_pseudo_pc(task);
54 else if (regno <= PT_MAX)
55 ret = get_debugreg(task->pid, regno);
56 else
57 ret = 0;
58
59 return ret;
60}
61
62/*
63 * Write contents of register REGNO in task TASK.
64 */
65int put_reg(struct task_struct *task, unsigned int regno, unsigned long data)
66{
67 if (regno <= PT_EDA)
68 ((unsigned long *)user_regs(task->thread_info))[regno] = data;
69 else if (regno == PT_USP)
70 task->thread.usp = data;
71 else if (regno == PT_PPC) {
72 /* Write pseudo-PC to ERP only if changed. */
73 if (data != get_pseudo_pc(task))
74 ((unsigned long *)user_regs(task->thread_info))[PT_ERP] = data;
75 } else if (regno <= PT_MAX)
76 return put_debugreg(task->pid, regno, data);
77 else
78 return -1;
79 return 0;
80}
81
82/*
83 * Called by kernel/ptrace.c when detaching.
84 *
85 * Make sure the single step bit is not set.
86 */
87void
88ptrace_disable(struct task_struct *child)
89{
90 unsigned long tmp;
91
92 /* Deconfigure SPC and S-bit. */
93 tmp = get_reg(child, PT_CCS) & ~SBIT_USER;
94 put_reg(child, PT_CCS, tmp);
95 put_reg(child, PT_SPC, 0);
96
97 /* Deconfigure any watchpoints associated with the child. */
98 deconfigure_bp(child->pid);
99}
100
101
102asmlinkage int
103sys_ptrace(long request, long pid, long addr, long data)
104{
105 struct task_struct *child;
106 int ret;
107 unsigned long __user *datap = (unsigned long __user *)data;
108
109 lock_kernel();
110 ret = -EPERM;
111
112 if (request == PTRACE_TRACEME) {
113 /* are we already being traced? */
114 if (current->ptrace & PT_PTRACED)
115 goto out;
116 ret = security_ptrace(current->parent, current);
117 if (ret)
118 goto out;
119 /* set the ptrace bit in the process flags. */
120 current->ptrace |= PT_PTRACED;
121 ret = 0;
122 goto out;
123 }
124
125 ret = -ESRCH;
126 read_lock(&tasklist_lock);
127 child = find_task_by_pid(pid);
128
129 if (child)
130 get_task_struct(child);
131
132 read_unlock(&tasklist_lock);
133
134 if (!child)
135 goto out;
136
137 ret = -EPERM;
138
139 if (pid == 1) /* Leave the init process alone! */
140 goto out_tsk;
141
142 if (request == PTRACE_ATTACH) {
143 ret = ptrace_attach(child);
144 goto out_tsk;
145 }
146
147 ret = ptrace_check_attach(child, request == PTRACE_KILL);
148 if (ret < 0)
149 goto out_tsk;
150
151 switch (request) {
152 /* Read word at location address. */
153 case PTRACE_PEEKTEXT:
154 case PTRACE_PEEKDATA: {
155 unsigned long tmp;
156 int copied;
157
158 ret = -EIO;
159
160 /* The signal trampoline page is outside the normal user-addressable
161 * space but still accessible. This is hack to make it possible to
162 * access the signal handler code in GDB.
163 */
164 if ((addr & PAGE_MASK) == cris_signal_return_page) {
165 /* The trampoline page is globally mapped, no page table to traverse.*/
166 tmp = *(unsigned long*)addr;
167 } else {
168 copied = access_process_vm(child, addr, &tmp, sizeof(tmp), 0);
169
170 if (copied != sizeof(tmp))
171 break;
172 }
173
174 ret = put_user(tmp,datap);
175 break;
176 }
177
178 /* Read the word at location address in the USER area. */
179 case PTRACE_PEEKUSR: {
180 unsigned long tmp;
181
182 ret = -EIO;
183 if ((addr & 3) || addr < 0 || addr > PT_MAX << 2)
184 break;
185
186 tmp = get_reg(child, addr >> 2);
187 ret = put_user(tmp, datap);
188 break;
189 }
190
191 /* Write the word at location address. */
192 case PTRACE_POKETEXT:
193 case PTRACE_POKEDATA:
194 ret = 0;
195
196 if (access_process_vm(child, addr, &data, sizeof(data), 1) == sizeof(data))
197 break;
198
199 ret = -EIO;
200 break;
201
202 /* Write the word at location address in the USER area. */
203 case PTRACE_POKEUSR:
204 ret = -EIO;
205 if ((addr & 3) || addr < 0 || addr > PT_MAX << 2)
206 break;
207
208 addr >>= 2;
209
210 if (addr == PT_CCS) {
211 /* don't allow the tracing process to change stuff like
212 * interrupt enable, kernel/user bit, dma enables etc.
213 */
214 data &= CCS_MASK;
215 data |= get_reg(child, PT_CCS) & ~CCS_MASK;
216 }
217 if (put_reg(child, addr, data))
218 break;
219 ret = 0;
220 break;
221
222 case PTRACE_SYSCALL:
223 case PTRACE_CONT:
224 ret = -EIO;
225
226 if (!valid_signal(data))
227 break;
228
229 /* Continue means no single-step. */
230 put_reg(child, PT_SPC, 0);
231
232 if (!get_debugreg(child->pid, PT_BP_CTRL)) {
233 unsigned long tmp;
234 /* If no h/w bp configured, disable S bit. */
235 tmp = get_reg(child, PT_CCS) & ~SBIT_USER;
236 put_reg(child, PT_CCS, tmp);
237 }
238
239 if (request == PTRACE_SYSCALL) {
240 set_tsk_thread_flag(child, TIF_SYSCALL_TRACE);
241 }
242 else {
243 clear_tsk_thread_flag(child, TIF_SYSCALL_TRACE);
244 }
245
246 child->exit_code = data;
247
248 /* TODO: make sure any pending breakpoint is killed */
249 wake_up_process(child);
250 ret = 0;
251
252 break;
253
254 /* Make the child exit by sending it a sigkill. */
255 case PTRACE_KILL:
256 ret = 0;
257
258 if (child->exit_state == EXIT_ZOMBIE)
259 break;
260
261 child->exit_code = SIGKILL;
262
263 /* Deconfigure single-step and h/w bp. */
264 ptrace_disable(child);
265
266 /* TODO: make sure any pending breakpoint is killed */
267 wake_up_process(child);
268 break;
269
270 /* Set the trap flag. */
271 case PTRACE_SINGLESTEP: {
272 unsigned long tmp;
273 ret = -EIO;
274
275 /* Set up SPC if not set already (in which case we have
276 no other choice but to trust it). */
277 if (!get_reg(child, PT_SPC)) {
278 /* In case we're stopped in a delay slot. */
279 tmp = get_reg(child, PT_ERP) & ~1;
280 put_reg(child, PT_SPC, tmp);
281 }
282 tmp = get_reg(child, PT_CCS) | SBIT_USER;
283 put_reg(child, PT_CCS, tmp);
284
285 if (!valid_signal(data))
286 break;
287
288 clear_tsk_thread_flag(child, TIF_SYSCALL_TRACE);
289
290 /* TODO: set some clever breakpoint mechanism... */
291
292 child->exit_code = data;
293 wake_up_process(child);
294 ret = 0;
295 break;
296
297 }
298 case PTRACE_DETACH:
299 ret = ptrace_detach(child, data);
300 break;
301
302 /* Get all GP registers from the child. */
303 case PTRACE_GETREGS: {
304 int i;
305 unsigned long tmp;
306
307 for (i = 0; i <= PT_MAX; i++) {
308 tmp = get_reg(child, i);
309
310 if (put_user(tmp, datap)) {
311 ret = -EFAULT;
312 goto out_tsk;
313 }
314
315 datap++;
316 }
317
318 ret = 0;
319 break;
320 }
321
322 /* Set all GP registers in the child. */
323 case PTRACE_SETREGS: {
324 int i;
325 unsigned long tmp;
326
327 for (i = 0; i <= PT_MAX; i++) {
328 if (get_user(tmp, datap)) {
329 ret = -EFAULT;
330 goto out_tsk;
331 }
332
333 if (i == PT_CCS) {
334 tmp &= CCS_MASK;
335 tmp |= get_reg(child, PT_CCS) & ~CCS_MASK;
336 }
337
338 put_reg(child, i, tmp);
339 datap++;
340 }
341
342 ret = 0;
343 break;
344 }
345
346 default:
347 ret = ptrace_request(child, request, addr, data);
348 break;
349 }
350out_tsk:
351 put_task_struct(child);
352out:
353 unlock_kernel();
354 return ret;
355}
356
357void do_syscall_trace(void)
358{
359 if (!test_thread_flag(TIF_SYSCALL_TRACE))
360 return;
361
362 if (!(current->ptrace & PT_PTRACED))
363 return;
364
365 /* the 0x80 provides a way for the tracing parent to distinguish
366 between a syscall stop and SIGTRAP delivery */
367 ptrace_notify(SIGTRAP | ((current->ptrace & PT_TRACESYSGOOD)
368 ? 0x80 : 0));
369
370 /*
371 * This isn't the same as continuing with a signal, but it will do for
372 * normal use.
373 */
374 if (current->exit_code) {
375 send_sig(current->exit_code, current, 1);
376 current->exit_code = 0;
377 }
378}
379
380/* Returns the size of an instruction that has a delay slot. */
381
382static int insn_size(struct task_struct *child, unsigned long pc)
383{
384 unsigned long opcode;
385 int copied;
386 int opsize = 0;
387
388 /* Read the opcode at pc (do what PTRACE_PEEKTEXT would do). */
389 copied = access_process_vm(child, pc, &opcode, sizeof(opcode), 0);
390 if (copied != sizeof(opcode))
391 return 0;
392
393 switch ((opcode & 0x0f00) >> 8) {
394 case 0x0:
395 case 0x9:
396 case 0xb:
397 opsize = 2;
398 break;
399 case 0xe:
400 case 0xf:
401 opsize = 6;
402 break;
403 case 0xd:
404 /* Could be 4 or 6; check more bits. */
405 if ((opcode & 0xff) == 0xff)
406 opsize = 4;
407 else
408 opsize = 6;
409 break;
410 default:
411 panic("ERROR: Couldn't find size of opcode 0x%lx at 0x%lx\n",
412 opcode, pc);
413 }
414
415 return opsize;
416}
417
418static unsigned long get_pseudo_pc(struct task_struct *child)
419{
420 /* Default value for PC is ERP. */
421 unsigned long pc = get_reg(child, PT_ERP);
422
423 if (pc & 0x1) {
424 unsigned long spc = get_reg(child, PT_SPC);
425 /* Delay slot bit set. Report as stopped on proper
426 instruction. */
427 if (spc) {
428 /* Rely on SPC if set. FIXME: We might want to check
429 that EXS indicates we stopped due to a single-step
430 exception. */
431 pc = spc;
432 } else {
433 /* Calculate the PC from the size of the instruction
434 that the delay slot we're in belongs to. */
435 pc += insn_size(child, pc & ~1) - 1;
436 }
437 }
438 return pc;
439}
440
441static long bp_owner = 0;
442
443/* Reachable from exit_thread in signal.c, so not static. */
444void deconfigure_bp(long pid)
445{
446 int bp;
447
448 /* Only deconfigure if the pid is the owner. */
449 if (bp_owner != pid)
450 return;
451
452 for (bp = 0; bp < 6; bp++) {
453 unsigned long tmp;
454 /* Deconfigure start and end address (also gets rid of ownership). */
455 put_debugreg(pid, PT_BP + 3 + (bp * 2), 0);
456 put_debugreg(pid, PT_BP + 4 + (bp * 2), 0);
457
458 /* Deconfigure relevant bits in control register. */
459 tmp = get_debugreg(pid, PT_BP_CTRL) & ~(3 << (2 + (bp * 4)));
460 put_debugreg(pid, PT_BP_CTRL, tmp);
461 }
462 /* No owner now. */
463 bp_owner = 0;
464}
465
466static int put_debugreg(long pid, unsigned int regno, long data)
467{
468 int ret = 0;
469 register int old_srs;
470
471#ifdef CONFIG_ETRAX_KGDB
472 /* Ignore write, but pretend it was ok if value is 0
473 (we don't want POKEUSR/SETREGS failing unnessecarily). */
474 return (data == 0) ? ret : -1;
475#endif
476
477 /* Simple owner management. */
478 if (!bp_owner)
479 bp_owner = pid;
480 else if (bp_owner != pid) {
481 /* Ignore write, but pretend it was ok if value is 0
482 (we don't want POKEUSR/SETREGS failing unnessecarily). */
483 return (data == 0) ? ret : -1;
484 }
485
486 /* Remember old SRS. */
487 SPEC_REG_RD(SPEC_REG_SRS, old_srs);
488 /* Switch to BP bank. */
489 SUPP_BANK_SEL(BANK_BP);
490
491 switch (regno - PT_BP) {
492 case 0:
493 SUPP_REG_WR(0, data); break;
494 case 1:
495 case 2:
496 if (data)
497 ret = -1;
498 break;
499 case 3:
500 SUPP_REG_WR(3, data); break;
501 case 4:
502 SUPP_REG_WR(4, data); break;
503 case 5:
504 SUPP_REG_WR(5, data); break;
505 case 6:
506 SUPP_REG_WR(6, data); break;
507 case 7:
508 SUPP_REG_WR(7, data); break;
509 case 8:
510 SUPP_REG_WR(8, data); break;
511 case 9:
512 SUPP_REG_WR(9, data); break;
513 case 10:
514 SUPP_REG_WR(10, data); break;
515 case 11:
516 SUPP_REG_WR(11, data); break;
517 case 12:
518 SUPP_REG_WR(12, data); break;
519 case 13:
520 SUPP_REG_WR(13, data); break;
521 case 14:
522 SUPP_REG_WR(14, data); break;
523 default:
524 ret = -1;
525 break;
526 }
527
528 /* Restore SRS. */
529 SPEC_REG_WR(SPEC_REG_SRS, old_srs);
530 /* Just for show. */
531 NOP();
532 NOP();
533 NOP();
534
535 return ret;
536}
537
538static long get_debugreg(long pid, unsigned int regno)
539{
540 register int old_srs;
541 register long data;
542
543 if (pid != bp_owner) {
544 return 0;
545 }
546
547 /* Remember old SRS. */
548 SPEC_REG_RD(SPEC_REG_SRS, old_srs);
549 /* Switch to BP bank. */
550 SUPP_BANK_SEL(BANK_BP);
551
552 switch (regno - PT_BP) {
553 case 0:
554 SUPP_REG_RD(0, data); break;
555 case 1:
556 case 2:
557 /* error return value? */
558 data = 0;
559 break;
560 case 3:
561 SUPP_REG_RD(3, data); break;
562 case 4:
563 SUPP_REG_RD(4, data); break;
564 case 5:
565 SUPP_REG_RD(5, data); break;
566 case 6:
567 SUPP_REG_RD(6, data); break;
568 case 7:
569 SUPP_REG_RD(7, data); break;
570 case 8:
571 SUPP_REG_RD(8, data); break;
572 case 9:
573 SUPP_REG_RD(9, data); break;
574 case 10:
575 SUPP_REG_RD(10, data); break;
576 case 11:
577 SUPP_REG_RD(11, data); break;
578 case 12:
579 SUPP_REG_RD(12, data); break;
580 case 13:
581 SUPP_REG_RD(13, data); break;
582 case 14:
583 SUPP_REG_RD(14, data); break;
584 default:
585 /* error return value? */
586 data = 0;
587 }
588
589 /* Restore SRS. */
590 SPEC_REG_WR(SPEC_REG_SRS, old_srs);
591 /* Just for show. */
592 NOP();
593 NOP();
594 NOP();
595
596 return data;
597}
diff --git a/arch/cris/arch-v32/kernel/setup.c b/arch/cris/arch-v32/kernel/setup.c
new file mode 100644
index 000000000000..b17a39a2e164
--- /dev/null
+++ b/arch/cris/arch-v32/kernel/setup.c
@@ -0,0 +1,118 @@
1/*
2 * Display CPU info in /proc/cpuinfo.
3 *
4 * Copyright (C) 2003, Axis Communications AB.
5 */
6
7#include <linux/config.h>
8#include <linux/seq_file.h>
9#include <linux/proc_fs.h>
10#include <linux/delay.h>
11#include <linux/param.h>
12
13#ifdef CONFIG_PROC_FS
14
15#define HAS_FPU 0x0001
16#define HAS_MMU 0x0002
17#define HAS_ETHERNET100 0x0004
18#define HAS_TOKENRING 0x0008
19#define HAS_SCSI 0x0010
20#define HAS_ATA 0x0020
21#define HAS_USB 0x0040
22#define HAS_IRQ_BUG 0x0080
23#define HAS_MMU_BUG 0x0100
24
25struct cpu_info {
26 char *cpu_model;
27 unsigned short rev;
28 unsigned short cache_size;
29 unsigned short flags;
30};
31
32/* Some of these model are here for historical reasons only. */
33static struct cpu_info cpinfo[] = {
34 {"ETRAX 1", 0, 0, 0},
35 {"ETRAX 2", 1, 0, 0},
36 {"ETRAX 3", 2, 0, 0},
37 {"ETRAX 4", 3, 0, 0},
38 {"Simulator", 7, 8, HAS_ETHERNET100 | HAS_SCSI | HAS_ATA},
39 {"ETRAX 100", 8, 8, HAS_ETHERNET100 | HAS_SCSI | HAS_ATA | HAS_IRQ_BUG},
40 {"ETRAX 100", 9, 8, HAS_ETHERNET100 | HAS_SCSI | HAS_ATA},
41
42 {"ETRAX 100LX", 10, 8, HAS_ETHERNET100 | HAS_SCSI | HAS_ATA | HAS_USB
43 | HAS_MMU | HAS_MMU_BUG},
44
45 {"ETRAX 100LX v2", 11, 8, HAS_ETHERNET100 | HAS_SCSI | HAS_ATA | HAS_USB
46 | HAS_MMU},
47
48 {"ETRAX FS", 32, 32, HAS_ETHERNET100 | HAS_ATA | HAS_MMU},
49
50 {"Unknown", 0, 0, 0}
51};
52
53int
54show_cpuinfo(struct seq_file *m, void *v)
55{
56 int i;
57 int cpu = (int)v - 1;
58 int entries;
59 unsigned long revision;
60 struct cpu_info *info;
61
62 entries = sizeof cpinfo / sizeof(struct cpu_info);
63 info = &cpinfo[entries - 1];
64
65#ifdef CONFIG_SMP
66 if (!cpu_online(cpu))
67 return 0;
68#endif
69
70 revision = rdvr();
71
72 for (i = 0; i < entries; i++) {
73 if (cpinfo[i].rev == revision) {
74 info = &cpinfo[i];
75 break;
76 }
77 }
78
79 return seq_printf(m,
80 "processor\t: %d\n"
81 "cpu\t\t: CRIS\n"
82 "cpu revision\t: %lu\n"
83 "cpu model\t: %s\n"
84 "cache size\t: %d KB\n"
85 "fpu\t\t: %s\n"
86 "mmu\t\t: %s\n"
87 "mmu DMA bug\t: %s\n"
88 "ethernet\t: %s Mbps\n"
89 "token ring\t: %s\n"
90 "scsi\t\t: %s\n"
91 "ata\t\t: %s\n"
92 "usb\t\t: %s\n"
93 "bogomips\t: %lu.%02lu\n\n",
94
95 cpu,
96 revision,
97 info->cpu_model,
98 info->cache_size,
99 info->flags & HAS_FPU ? "yes" : "no",
100 info->flags & HAS_MMU ? "yes" : "no",
101 info->flags & HAS_MMU_BUG ? "yes" : "no",
102 info->flags & HAS_ETHERNET100 ? "10/100" : "10",
103 info->flags & HAS_TOKENRING ? "4/16 Mbps" : "no",
104 info->flags & HAS_SCSI ? "yes" : "no",
105 info->flags & HAS_ATA ? "yes" : "no",
106 info->flags & HAS_USB ? "yes" : "no",
107 (loops_per_jiffy * HZ + 500) / 500000,
108 ((loops_per_jiffy * HZ + 500) / 5000) % 100);
109}
110
111#endif /* CONFIG_PROC_FS */
112
113void
114show_etrax_copyright(void)
115{
116 printk(KERN_INFO
117 "Linux/CRISv32 port on ETRAX FS (C) 2003, 2004 Axis Communications AB\n");
118}
diff --git a/arch/cris/arch-v32/kernel/signal.c b/arch/cris/arch-v32/kernel/signal.c
new file mode 100644
index 000000000000..0a3614dab887
--- /dev/null
+++ b/arch/cris/arch-v32/kernel/signal.c
@@ -0,0 +1,707 @@
1/*
2 * Copyright (C) 2003, Axis Communications AB.
3 */
4
5#include <linux/sched.h>
6#include <linux/mm.h>
7#include <linux/kernel.h>
8#include <linux/signal.h>
9#include <linux/errno.h>
10#include <linux/wait.h>
11#include <linux/ptrace.h>
12#include <linux/unistd.h>
13#include <linux/stddef.h>
14#include <linux/syscalls.h>
15#include <linux/vmalloc.h>
16
17#include <asm/io.h>
18#include <asm/processor.h>
19#include <asm/ucontext.h>
20#include <asm/uaccess.h>
21#include <asm/arch/ptrace.h>
22#include <asm/arch/hwregs/cpu_vect.h>
23
24extern unsigned long cris_signal_return_page;
25
26/* Flag to check if a signal is blockable. */
27#define _BLOCKABLE (~(sigmask(SIGKILL) | sigmask(SIGSTOP)))
28
29/*
30 * A syscall in CRIS is really a "break 13" instruction, which is 2
31 * bytes. The registers is manipulated so upon return the instruction
32 * will be executed again.
33 *
34 * This relies on that PC points to the instruction after the break call.
35 */
36#define RESTART_CRIS_SYS(regs) regs->r10 = regs->orig_r10; regs->erp -= 2;
37
38/* Signal frames. */
39struct signal_frame {
40 struct sigcontext sc;
41 unsigned long extramask[_NSIG_WORDS - 1];
42 unsigned char retcode[8]; /* Trampoline code. */
43};
44
45struct rt_signal_frame {
46 struct siginfo *pinfo;
47 void *puc;
48 struct siginfo info;
49 struct ucontext uc;
50 unsigned char retcode[8]; /* Trampoline code. */
51};
52
53int do_signal(int restart, sigset_t *oldset, struct pt_regs *regs);
54void keep_debug_flags(unsigned long oldccs, unsigned long oldspc,
55 struct pt_regs *regs);
56/*
57 * Swap in the new signal mask, and wait for a signal. Define some
58 * dummy arguments to be able to reach the regs argument.
59 */
60int
61sys_sigsuspend(old_sigset_t mask, long r11, long r12, long r13, long mof,
62 long srp, struct pt_regs *regs)
63{
64 sigset_t saveset;
65
66 mask &= _BLOCKABLE;
67
68 spin_lock_irq(&current->sighand->siglock);
69
70 saveset = current->blocked;
71
72 siginitset(&current->blocked, mask);
73
74 recalc_sigpending();
75 spin_unlock_irq(&current->sighand->siglock);
76
77 regs->r10 = -EINTR;
78
79 while (1) {
80 current->state = TASK_INTERRUPTIBLE;
81 schedule();
82
83 if (do_signal(0, &saveset, regs)) {
84 /*
85 * This point is reached twice: once to call
86 * the signal handler, then again to return
87 * from the sigsuspend system call. When
88 * calling the signal handler, R10 hold the
89 * signal number as set by do_signal(). The
90 * sigsuspend call will always return with
91 * the restored value above; -EINTR.
92 */
93 return regs->r10;
94 }
95 }
96}
97
98/* Define some dummy arguments to be able to reach the regs argument. */
99int
100sys_rt_sigsuspend(sigset_t *unewset, size_t sigsetsize, long r12, long r13,
101 long mof, long srp, struct pt_regs *regs)
102{
103 sigset_t saveset;
104 sigset_t newset;
105
106 if (sigsetsize != sizeof(sigset_t))
107 return -EINVAL;
108
109 if (copy_from_user(&newset, unewset, sizeof(newset)))
110 return -EFAULT;
111
112 sigdelsetmask(&newset, ~_BLOCKABLE);
113 spin_lock_irq(&current->sighand->siglock);
114
115 saveset = current->blocked;
116 current->blocked = newset;
117
118 recalc_sigpending();
119 spin_unlock_irq(&current->sighand->siglock);
120
121 regs->r10 = -EINTR;
122
123 while (1) {
124 current->state = TASK_INTERRUPTIBLE;
125 schedule();
126
127 if (do_signal(0, &saveset, regs)) {
128 /* See comment in function above. */
129 return regs->r10;
130 }
131 }
132}
133
134int
135sys_sigaction(int signal, const struct old_sigaction *act,
136 struct old_sigaction *oact)
137{
138 int retval;
139 struct k_sigaction newk;
140 struct k_sigaction oldk;
141
142 if (act) {
143 old_sigset_t mask;
144
145 if (!access_ok(VERIFY_READ, act, sizeof(*act)) ||
146 __get_user(newk.sa.sa_handler, &act->sa_handler) ||
147 __get_user(newk.sa.sa_restorer, &act->sa_restorer))
148 return -EFAULT;
149
150 __get_user(newk.sa.sa_flags, &act->sa_flags);
151 __get_user(mask, &act->sa_mask);
152 siginitset(&newk.sa.sa_mask, mask);
153 }
154
155 retval = do_sigaction(signal, act ? &newk : NULL, oact ? &oldk : NULL);
156
157 if (!retval && oact) {
158 if (!access_ok(VERIFY_WRITE, oact, sizeof(*oact)) ||
159 __put_user(oldk.sa.sa_handler, &oact->sa_handler) ||
160 __put_user(oldk.sa.sa_restorer, &oact->sa_restorer))
161 return -EFAULT;
162
163 __put_user(oldk.sa.sa_flags, &oact->sa_flags);
164 __put_user(oldk.sa.sa_mask.sig[0], &oact->sa_mask);
165 }
166
167 return retval;
168}
169
170int
171sys_sigaltstack(const stack_t __user *uss, stack_t __user *uoss)
172{
173 return do_sigaltstack(uss, uoss, rdusp());
174}
175
176static int
177restore_sigcontext(struct pt_regs *regs, struct sigcontext __user *sc)
178{
179 unsigned int err = 0;
180 unsigned long old_usp;
181
182 /* Always make any pending restarted system calls return -EINTR */
183 current_thread_info()->restart_block.fn = do_no_restart_syscall;
184
185 /*
186 * Restore the registers from &sc->regs. sc is already checked
187 * for VERIFY_READ since the signal_frame was previously
188 * checked in sys_sigreturn().
189 */
190 if (__copy_from_user(regs, sc, sizeof(struct pt_regs)))
191 goto badframe;
192
193 /* Make that the user-mode flag is set. */
194 regs->ccs |= (1 << (U_CCS_BITNR + CCS_SHIFT));
195
196 /* Restore the old USP. */
197 err |= __get_user(old_usp, &sc->usp);
198 wrusp(old_usp);
199
200 return err;
201
202badframe:
203 return 1;
204}
205
206/* Define some dummy arguments to be able to reach the regs argument. */
207asmlinkage int
208sys_sigreturn(long r10, long r11, long r12, long r13, long mof, long srp,
209 struct pt_regs *regs)
210{
211 sigset_t set;
212 struct signal_frame __user *frame;
213 unsigned long oldspc = regs->spc;
214 unsigned long oldccs = regs->ccs;
215
216 frame = (struct signal_frame *) rdusp();
217
218 /*
219 * Since the signal is stacked on a dword boundary, the frame
220 * should be dword aligned here as well. It it's not, then the
221 * user is trying some funny business.
222 */
223 if (((long)frame) & 3)
224 goto badframe;
225
226 if (!access_ok(VERIFY_READ, frame, sizeof(*frame)))
227 goto badframe;
228
229 if (__get_user(set.sig[0], &frame->sc.oldmask) ||
230 (_NSIG_WORDS > 1 && __copy_from_user(&set.sig[1],
231 frame->extramask,
232 sizeof(frame->extramask))))
233 goto badframe;
234
235 sigdelsetmask(&set, ~_BLOCKABLE);
236 spin_lock_irq(&current->sighand->siglock);
237
238 current->blocked = set;
239
240 recalc_sigpending();
241 spin_unlock_irq(&current->sighand->siglock);
242
243 if (restore_sigcontext(regs, &frame->sc))
244 goto badframe;
245
246 keep_debug_flags(oldccs, oldspc, regs);
247
248 return regs->r10;
249
250badframe:
251 force_sig(SIGSEGV, current);
252 return 0;
253}
254
255/* Define some dummy variables to be able to reach the regs argument. */
256asmlinkage int
257sys_rt_sigreturn(long r10, long r11, long r12, long r13, long mof, long srp,
258 struct pt_regs *regs)
259{
260 sigset_t set;
261 struct rt_signal_frame __user *frame;
262 unsigned long oldspc = regs->spc;
263 unsigned long oldccs = regs->ccs;
264
265 frame = (struct rt_signal_frame *) rdusp();
266
267 /*
268 * Since the signal is stacked on a dword boundary, the frame
269 * should be dword aligned here as well. It it's not, then the
270 * user is trying some funny business.
271 */
272 if (((long)frame) & 3)
273 goto badframe;
274
275 if (!access_ok(VERIFY_READ, frame, sizeof(*frame)))
276 goto badframe;
277
278 if (__copy_from_user(&set, &frame->uc.uc_sigmask, sizeof(set)))
279 goto badframe;
280
281 sigdelsetmask(&set, ~_BLOCKABLE);
282 spin_lock_irq(&current->sighand->siglock);
283
284 current->blocked = set;
285
286 recalc_sigpending();
287 spin_unlock_irq(&current->sighand->siglock);
288
289 if (restore_sigcontext(regs, &frame->uc.uc_mcontext))
290 goto badframe;
291
292 if (do_sigaltstack(&frame->uc.uc_stack, NULL, rdusp()) == -EFAULT)
293 goto badframe;
294
295 keep_debug_flags(oldccs, oldspc, regs);
296
297 return regs->r10;
298
299badframe:
300 force_sig(SIGSEGV, current);
301 return 0;
302}
303
304/* Setup a signal frame. */
305static int
306setup_sigcontext(struct sigcontext __user *sc, struct pt_regs *regs,
307 unsigned long mask)
308{
309 int err;
310 unsigned long usp;
311
312 err = 0;
313 usp = rdusp();
314
315 /*
316 * Copy the registers. They are located first in sc, so it's
317 * possible to use sc directly.
318 */
319 err |= __copy_to_user(sc, regs, sizeof(struct pt_regs));
320
321 err |= __put_user(mask, &sc->oldmask);
322 err |= __put_user(usp, &sc->usp);
323
324 return err;
325}
326
327/* Figure out where to put the new signal frame - usually on the stack. */
328static inline void __user *
329get_sigframe(struct k_sigaction *ka, struct pt_regs * regs, size_t frame_size)
330{
331 unsigned long sp;
332
333 sp = rdusp();
334
335 /* This is the X/Open sanctioned signal stack switching. */
336 if (ka->sa.sa_flags & SA_ONSTACK) {
337 if (!on_sig_stack(sp))
338 sp = current->sas_ss_sp + current->sas_ss_size;
339 }
340
341 /* Make sure the frame is dword-aligned. */
342 sp &= ~3;
343
344 return (void __user *)(sp - frame_size);
345}
346
347/* Grab and setup a signal frame.
348 *
349 * Basically a lot of state-info is stacked, and arranged for the
350 * user-mode program to return to the kernel using either a trampiline
351 * which performs the syscall sigreturn(), or a provided user-mode
352 * trampoline.
353 */
354static void
355setup_frame(int sig, struct k_sigaction *ka, sigset_t *set,
356 struct pt_regs * regs)
357{
358 int err;
359 unsigned long return_ip;
360 struct signal_frame __user *frame;
361
362 err = 0;
363 frame = get_sigframe(ka, regs, sizeof(*frame));
364
365 if (!access_ok(VERIFY_WRITE, frame, sizeof(*frame)))
366 goto give_sigsegv;
367
368 err |= setup_sigcontext(&frame->sc, regs, set->sig[0]);
369
370 if (err)
371 goto give_sigsegv;
372
373 if (_NSIG_WORDS > 1) {
374 err |= __copy_to_user(frame->extramask, &set->sig[1],
375 sizeof(frame->extramask));
376 }
377
378 if (err)
379 goto give_sigsegv;
380
381 /*
382 * Set up to return from user-space. If provided, use a stub
383 * already located in user-space.
384 */
385 if (ka->sa.sa_flags & SA_RESTORER) {
386 return_ip = (unsigned long)ka->sa.sa_restorer;
387 } else {
388 /* Trampoline - the desired return ip is in the signal return page. */
389 return_ip = cris_signal_return_page;
390
391 /*
392 * This is movu.w __NR_sigreturn, r9; break 13;
393 *
394 * WE DO NOT USE IT ANY MORE! It's only left here for historical
395 * reasons and because gdb uses it as a signature to notice
396 * signal handler stack frames.
397 */
398 err |= __put_user(0x9c5f, (short __user*)(frame->retcode+0));
399 err |= __put_user(__NR_sigreturn, (short __user*)(frame->retcode+2));
400 err |= __put_user(0xe93d, (short __user*)(frame->retcode+4));
401 }
402
403 if (err)
404 goto give_sigsegv;
405
406 /*
407 * Set up registers for signal handler.
408 *
409 * Where the code enters now.
410 * Where the code enter later.
411 * First argument, signo.
412 */
413 regs->erp = (unsigned long) ka->sa.sa_handler;
414 regs->srp = return_ip;
415 regs->r10 = sig;
416
417 /* Actually move the USP to reflect the stacked frame. */
418 wrusp((unsigned long)frame);
419
420 return;
421
422give_sigsegv:
423 if (sig == SIGSEGV)
424 ka->sa.sa_handler = SIG_DFL;
425
426 force_sig(SIGSEGV, current);
427}
428
429static void
430setup_rt_frame(int sig, struct k_sigaction *ka, siginfo_t *info,
431 sigset_t *set, struct pt_regs * regs)
432{
433 int err;
434 unsigned long return_ip;
435 struct rt_signal_frame __user *frame;
436
437 err = 0;
438 frame = get_sigframe(ka, regs, sizeof(*frame));
439
440 if (!access_ok(VERIFY_WRITE, frame, sizeof(*frame)))
441 goto give_sigsegv;
442
443 /* TODO: what is the current->exec_domain stuff and invmap ? */
444
445 err |= __put_user(&frame->info, &frame->pinfo);
446 err |= __put_user(&frame->uc, &frame->puc);
447 err |= copy_siginfo_to_user(&frame->info, info);
448
449 if (err)
450 goto give_sigsegv;
451
452 /* Clear all the bits of the ucontext we don't use. */
453 err |= __clear_user(&frame->uc, offsetof(struct ucontext, uc_mcontext));
454 err |= setup_sigcontext(&frame->uc.uc_mcontext, regs, set->sig[0]);
455 err |= __copy_to_user(&frame->uc.uc_sigmask, set, sizeof(*set));
456
457 if (err)
458 goto give_sigsegv;
459
460 /*
461 * Set up to return from user-space. If provided, use a stub
462 * already located in user-space.
463 */
464 if (ka->sa.sa_flags & SA_RESTORER) {
465 return_ip = (unsigned long) ka->sa.sa_restorer;
466 } else {
467 /* Trampoline - the desired return ip is in the signal return page. */
468 return_ip = cris_signal_return_page + 6;
469
470 /*
471 * This is movu.w __NR_rt_sigreturn, r9; break 13;
472 *
473 * WE DO NOT USE IT ANY MORE! It's only left here for historical
474 * reasons and because gdb uses it as a signature to notice
475 * signal handler stack frames.
476 */
477 err |= __put_user(0x9c5f, (short __user*)(frame->retcode+0));
478
479 err |= __put_user(__NR_rt_sigreturn,
480 (short __user*)(frame->retcode+2));
481
482 err |= __put_user(0xe93d, (short __user*)(frame->retcode+4));
483 }
484
485 if (err)
486 goto give_sigsegv;
487
488 /*
489 * Set up registers for signal handler.
490 *
491 * Where the code enters now.
492 * Where the code enters later.
493 * First argument is signo.
494 * Second argument is (siginfo_t *).
495 * Third argument is unused.
496 */
497 regs->erp = (unsigned long) ka->sa.sa_handler;
498 regs->srp = return_ip;
499 regs->r10 = sig;
500 regs->r11 = (unsigned long) &frame->info;
501 regs->r12 = 0;
502
503 /* Actually move the usp to reflect the stacked frame. */
504 wrusp((unsigned long)frame);
505
506 return;
507
508give_sigsegv:
509 if (sig == SIGSEGV)
510 ka->sa.sa_handler = SIG_DFL;
511
512 force_sig(SIGSEGV, current);
513}
514
515/* Invoke a singal handler to, well, handle the signal. */
516extern inline void
517handle_signal(int canrestart, unsigned long sig,
518 siginfo_t *info, struct k_sigaction *ka,
519 sigset_t *oldset, struct pt_regs * regs)
520{
521 /* Check if this got called from a system call. */
522 if (canrestart) {
523 /* If so, check system call restarting. */
524 switch (regs->r10) {
525 case -ERESTART_RESTARTBLOCK:
526 case -ERESTARTNOHAND:
527 /*
528 * This means that the syscall should
529 * only be restarted if there was no
530 * handler for the signal, and since
531 * this point isn't reached unless
532 * there is a handler, there's no need
533 * to restart.
534 */
535 regs->r10 = -EINTR;
536 break;
537
538 case -ERESTARTSYS:
539 /*
540 * This means restart the syscall if
541 * there is no handler, or the handler
542 * was registered with SA_RESTART.
543 */
544 if (!(ka->sa.sa_flags & SA_RESTART)) {
545 regs->r10 = -EINTR;
546 break;
547 }
548
549 /* Fall through. */
550
551 case -ERESTARTNOINTR:
552 /*
553 * This means that the syscall should
554 * be called again after the signal
555 * handler returns.
556 */
557 RESTART_CRIS_SYS(regs);
558 break;
559 }
560 }
561
562 /* Set up the stack frame. */
563 if (ka->sa.sa_flags & SA_SIGINFO)
564 setup_rt_frame(sig, ka, info, oldset, regs);
565 else
566 setup_frame(sig, ka, oldset, regs);
567
568 if (ka->sa.sa_flags & SA_ONESHOT)
569 ka->sa.sa_handler = SIG_DFL;
570
571 spin_lock_irq(&current->sighand->siglock);
572 sigorsets(&current->blocked,&current->blocked,&ka->sa.sa_mask);
573 if (!(ka->sa.sa_flags & SA_NODEFER))
574 sigaddset(&current->blocked,sig);
575 recalc_sigpending();
576 spin_unlock_irq(&current->sighand->siglock);
577}
578
579/*
580 * Note that 'init' is a special process: it doesn't get signals it doesn't
581 * want to handle. Thus you cannot kill init even with a SIGKILL even by
582 * mistake.
583 *
584 * Also note that the regs structure given here as an argument, is the latest
585 * pushed pt_regs. It may or may not be the same as the first pushed registers
586 * when the initial usermode->kernelmode transition took place. Therefore
587 * we can use user_mode(regs) to see if we came directly from kernel or user
588 * mode below.
589 */
590int
591do_signal(int canrestart, sigset_t *oldset, struct pt_regs *regs)
592{
593 int signr;
594 siginfo_t info;
595 struct k_sigaction ka;
596
597 /*
598 * The common case should go fast, which is why this point is
599 * reached from kernel-mode. If that's the case, just return
600 * without doing anything.
601 */
602 if (!user_mode(regs))
603 return 1;
604
605 if (!oldset)
606 oldset = &current->blocked;
607
608 signr = get_signal_to_deliver(&info, &ka, regs, NULL);
609
610 if (signr > 0) {
611 /* Deliver the signal. */
612 handle_signal(canrestart, signr, &info, &ka, oldset, regs);
613 return 1;
614 }
615
616 /* Got here from a system call? */
617 if (canrestart) {
618 /* Restart the system call - no handlers present. */
619 if (regs->r10 == -ERESTARTNOHAND ||
620 regs->r10 == -ERESTARTSYS ||
621 regs->r10 == -ERESTARTNOINTR) {
622 RESTART_CRIS_SYS(regs);
623 }
624
625 if (regs->r10 == -ERESTART_RESTARTBLOCK){
626 regs->r10 = __NR_restart_syscall;
627 regs->erp -= 2;
628 }
629 }
630
631 return 0;
632}
633
634asmlinkage void
635ugdb_trap_user(struct thread_info *ti, int sig)
636{
637 if (((user_regs(ti)->exs & 0xff00) >> 8) != SINGLE_STEP_INTR_VECT) {
638 /* Zero single-step PC if the reason we stopped wasn't a single
639 step exception. This is to avoid relying on it when it isn't
640 reliable. */
641 user_regs(ti)->spc = 0;
642 }
643 /* FIXME: Filter out false h/w breakpoint hits (i.e. EDA
644 not withing any configured h/w breakpoint range). Synchronize with
645 what already exists for kernel debugging. */
646 if (((user_regs(ti)->exs & 0xff00) >> 8) == BREAK_8_INTR_VECT) {
647 /* Break 8: subtract 2 from ERP unless in a delay slot. */
648 if (!(user_regs(ti)->erp & 0x1))
649 user_regs(ti)->erp -= 2;
650 }
651 sys_kill(ti->task->pid, sig);
652}
653
654void
655keep_debug_flags(unsigned long oldccs, unsigned long oldspc,
656 struct pt_regs *regs)
657{
658 if (oldccs & (1 << Q_CCS_BITNR)) {
659 /* Pending single step due to single-stepping the break 13
660 in the signal trampoline: keep the Q flag. */
661 regs->ccs |= (1 << Q_CCS_BITNR);
662 /* S flag should be set - complain if it's not. */
663 if (!(oldccs & (1 << (S_CCS_BITNR + CCS_SHIFT)))) {
664 printk("Q flag but no S flag?");
665 }
666 regs->ccs |= (1 << (S_CCS_BITNR + CCS_SHIFT));
667 /* Assume the SPC is valid and interesting. */
668 regs->spc = oldspc;
669
670 } else if (oldccs & (1 << (S_CCS_BITNR + CCS_SHIFT))) {
671 /* If a h/w bp was set in the signal handler we need
672 to keep the S flag. */
673 regs->ccs |= (1 << (S_CCS_BITNR + CCS_SHIFT));
674 /* Don't keep the old SPC though; if we got here due to
675 a single-step, the Q flag should have been set. */
676 } else if (regs->spc) {
677 /* If we were single-stepping *before* the signal was taken,
678 we don't want to restore that state now, because GDB will
679 have forgotten all about it. */
680 regs->spc = 0;
681 regs->ccs &= ~(1 << (S_CCS_BITNR + CCS_SHIFT));
682 }
683}
684
685/* Set up the trampolines on the signal return page. */
686int __init
687cris_init_signal(void)
688{
689 u16* data = (u16*)kmalloc(PAGE_SIZE, GFP_KERNEL);
690
691 /* This is movu.w __NR_sigreturn, r9; break 13; */
692 data[0] = 0x9c5f;
693 data[1] = __NR_sigreturn;
694 data[2] = 0xe93d;
695 /* This is movu.w __NR_rt_sigreturn, r9; break 13; */
696 data[3] = 0x9c5f;
697 data[4] = __NR_rt_sigreturn;
698 data[5] = 0xe93d;
699
700 /* Map to userspace with appropriate permissions (no write access...) */
701 cris_signal_return_page = (unsigned long)
702 __ioremap_prot(virt_to_phys(data), PAGE_SIZE, PAGE_SIGNAL_TRAMPOLINE);
703
704 return 0;
705}
706
707__initcall(cris_init_signal);
diff --git a/arch/cris/arch-v32/kernel/smp.c b/arch/cris/arch-v32/kernel/smp.c
new file mode 100644
index 000000000000..2c5cae04a95c
--- /dev/null
+++ b/arch/cris/arch-v32/kernel/smp.c
@@ -0,0 +1,348 @@
1#include <asm/delay.h>
2#include <asm/arch/irq.h>
3#include <asm/arch/hwregs/intr_vect.h>
4#include <asm/arch/hwregs/intr_vect_defs.h>
5#include <asm/tlbflush.h>
6#include <asm/mmu_context.h>
7#include <asm/arch/hwregs/mmu_defs_asm.h>
8#include <asm/arch/hwregs/supp_reg.h>
9#include <asm/atomic.h>
10
11#include <linux/err.h>
12#include <linux/init.h>
13#include <linux/timex.h>
14#include <linux/sched.h>
15#include <linux/kernel.h>
16#include <linux/cpumask.h>
17#include <linux/interrupt.h>
18
19#define IPI_SCHEDULE 1
20#define IPI_CALL 2
21#define IPI_FLUSH_TLB 4
22
23#define FLUSH_ALL (void*)0xffffffff
24
25/* Vector of locks used for various atomic operations */
26spinlock_t cris_atomic_locks[] = { [0 ... LOCK_COUNT - 1] = SPIN_LOCK_UNLOCKED};
27
28/* CPU masks */
29cpumask_t cpu_online_map = CPU_MASK_NONE;
30cpumask_t phys_cpu_present_map = CPU_MASK_NONE;
31
32/* Variables used during SMP boot */
33volatile int cpu_now_booting = 0;
34volatile struct thread_info *smp_init_current_idle_thread;
35
36/* Variables used during IPI */
37static DEFINE_SPINLOCK(call_lock);
38static DEFINE_SPINLOCK(tlbstate_lock);
39
40struct call_data_struct {
41 void (*func) (void *info);
42 void *info;
43 int wait;
44};
45
46static struct call_data_struct * call_data;
47
48static struct mm_struct* flush_mm;
49static struct vm_area_struct* flush_vma;
50static unsigned long flush_addr;
51
52extern int setup_irq(int, struct irqaction *);
53
54/* Mode registers */
55static unsigned long irq_regs[NR_CPUS] =
56{
57 regi_irq,
58 regi_irq2
59};
60
61static irqreturn_t crisv32_ipi_interrupt(int irq, void *dev_id, struct pt_regs *regs);
62static int send_ipi(int vector, int wait, cpumask_t cpu_mask);
63static struct irqaction irq_ipi = { crisv32_ipi_interrupt, SA_INTERRUPT,
64 CPU_MASK_NONE, "ipi", NULL, NULL};
65
66extern void cris_mmu_init(void);
67extern void cris_timer_init(void);
68
69/* SMP initialization */
70void __init smp_prepare_cpus(unsigned int max_cpus)
71{
72 int i;
73
74 /* From now on we can expect IPIs so set them up */
75 setup_irq(IPI_INTR_VECT, &irq_ipi);
76
77 /* Mark all possible CPUs as present */
78 for (i = 0; i < max_cpus; i++)
79 cpu_set(i, phys_cpu_present_map);
80}
81
82void __devinit smp_prepare_boot_cpu(void)
83{
84 /* PGD pointer has moved after per_cpu initialization so
85 * update the MMU.
86 */
87 pgd_t **pgd;
88 pgd = (pgd_t**)&per_cpu(current_pgd, smp_processor_id());
89
90 SUPP_BANK_SEL(1);
91 SUPP_REG_WR(RW_MM_TLB_PGD, pgd);
92 SUPP_BANK_SEL(2);
93 SUPP_REG_WR(RW_MM_TLB_PGD, pgd);
94
95 cpu_set(0, cpu_online_map);
96 cpu_set(0, phys_cpu_present_map);
97}
98
99void __init smp_cpus_done(unsigned int max_cpus)
100{
101}
102
103/* Bring one cpu online.*/
104static int __init
105smp_boot_one_cpu(int cpuid)
106{
107 unsigned timeout;
108 struct task_struct *idle;
109
110 idle = fork_idle(cpuid);
111 if (IS_ERR(idle))
112 panic("SMP: fork failed for CPU:%d", cpuid);
113
114 idle->thread_info->cpu = cpuid;
115
116 /* Information to the CPU that is about to boot */
117 smp_init_current_idle_thread = idle->thread_info;
118 cpu_now_booting = cpuid;
119
120 /* Wait for CPU to come online */
121 for (timeout = 0; timeout < 10000; timeout++) {
122 if(cpu_online(cpuid)) {
123 cpu_now_booting = 0;
124 smp_init_current_idle_thread = NULL;
125 return 0; /* CPU online */
126 }
127 udelay(100);
128 barrier();
129 }
130
131 put_task_struct(idle);
132 idle = NULL;
133
134 printk(KERN_CRIT "SMP: CPU:%d is stuck.\n", cpuid);
135 return -1;
136}
137
138/* Secondary CPUs starts uing C here. Here we need to setup CPU
139 * specific stuff such as the local timer and the MMU. */
140void __init smp_callin(void)
141{
142 extern void cpu_idle(void);
143
144 int cpu = cpu_now_booting;
145 reg_intr_vect_rw_mask vect_mask = {0};
146
147 /* Initialise the idle task for this CPU */
148 atomic_inc(&init_mm.mm_count);
149 current->active_mm = &init_mm;
150
151 /* Set up MMU */
152 cris_mmu_init();
153 __flush_tlb_all();
154
155 /* Setup local timer. */
156 cris_timer_init();
157
158 /* Enable IRQ and idle */
159 REG_WR(intr_vect, irq_regs[cpu], rw_mask, vect_mask);
160 unmask_irq(IPI_INTR_VECT);
161 unmask_irq(TIMER_INTR_VECT);
162 local_irq_enable();
163
164 cpu_set(cpu, cpu_online_map);
165 cpu_idle();
166}
167
168/* Stop execution on this CPU.*/
169void stop_this_cpu(void* dummy)
170{
171 local_irq_disable();
172 asm volatile("halt");
173}
174
175/* Other calls */
176void smp_send_stop(void)
177{
178 smp_call_function(stop_this_cpu, NULL, 1, 0);
179}
180
181int setup_profiling_timer(unsigned int multiplier)
182{
183 return -EINVAL;
184}
185
186
187/* cache_decay_ticks is used by the scheduler to decide if a process
188 * is "hot" on one CPU. A higher value means a higher penalty to move
189 * a process to another CPU. Our cache is rather small so we report
190 * 1 tick.
191 */
192unsigned long cache_decay_ticks = 1;
193
194int __devinit __cpu_up(unsigned int cpu)
195{
196 smp_boot_one_cpu(cpu);
197 return cpu_online(cpu) ? 0 : -ENOSYS;
198}
199
200void smp_send_reschedule(int cpu)
201{
202 cpumask_t cpu_mask = CPU_MASK_NONE;
203 cpu_set(cpu, cpu_mask);
204 send_ipi(IPI_SCHEDULE, 0, cpu_mask);
205}
206
207/* TLB flushing
208 *
209 * Flush needs to be done on the local CPU and on any other CPU that
210 * may have the same mapping. The mm->cpu_vm_mask is used to keep track
211 * of which CPUs that a specific process has been executed on.
212 */
213void flush_tlb_common(struct mm_struct* mm, struct vm_area_struct* vma, unsigned long addr)
214{
215 unsigned long flags;
216 cpumask_t cpu_mask;
217
218 spin_lock_irqsave(&tlbstate_lock, flags);
219 cpu_mask = (mm == FLUSH_ALL ? CPU_MASK_ALL : mm->cpu_vm_mask);
220 cpu_clear(smp_processor_id(), cpu_mask);
221 flush_mm = mm;
222 flush_vma = vma;
223 flush_addr = addr;
224 send_ipi(IPI_FLUSH_TLB, 1, cpu_mask);
225 spin_unlock_irqrestore(&tlbstate_lock, flags);
226}
227
228void flush_tlb_all(void)
229{
230 __flush_tlb_all();
231 flush_tlb_common(FLUSH_ALL, FLUSH_ALL, 0);
232}
233
234void flush_tlb_mm(struct mm_struct *mm)
235{
236 __flush_tlb_mm(mm);
237 flush_tlb_common(mm, FLUSH_ALL, 0);
238 /* No more mappings in other CPUs */
239 cpus_clear(mm->cpu_vm_mask);
240 cpu_set(smp_processor_id(), mm->cpu_vm_mask);
241}
242
243void flush_tlb_page(struct vm_area_struct *vma,
244 unsigned long addr)
245{
246 __flush_tlb_page(vma, addr);
247 flush_tlb_common(vma->vm_mm, vma, addr);
248}
249
250/* Inter processor interrupts
251 *
252 * The IPIs are used for:
253 * * Force a schedule on a CPU
254 * * FLush TLB on other CPUs
255 * * Call a function on other CPUs
256 */
257
258int send_ipi(int vector, int wait, cpumask_t cpu_mask)
259{
260 int i = 0;
261 reg_intr_vect_rw_ipi ipi = REG_RD(intr_vect, irq_regs[i], rw_ipi);
262 int ret = 0;
263
264 /* Calculate CPUs to send to. */
265 cpus_and(cpu_mask, cpu_mask, cpu_online_map);
266
267 /* Send the IPI. */
268 for_each_cpu_mask(i, cpu_mask)
269 {
270 ipi.vector |= vector;
271 REG_WR(intr_vect, irq_regs[i], rw_ipi, ipi);
272 }
273
274 /* Wait for IPI to finish on other CPUS */
275 if (wait) {
276 for_each_cpu_mask(i, cpu_mask) {
277 int j;
278 for (j = 0 ; j < 1000; j++) {
279 ipi = REG_RD(intr_vect, irq_regs[i], rw_ipi);
280 if (!ipi.vector)
281 break;
282 udelay(100);
283 }
284
285 /* Timeout? */
286 if (ipi.vector) {
287 printk("SMP call timeout from %d to %d\n", smp_processor_id(), i);
288 ret = -ETIMEDOUT;
289 dump_stack();
290 }
291 }
292 }
293 return ret;
294}
295
296/*
297 * You must not call this function with disabled interrupts or from a
298 * hardware interrupt handler or from a bottom half handler.
299 */
300int smp_call_function(void (*func)(void *info), void *info,
301 int nonatomic, int wait)
302{
303 cpumask_t cpu_mask = CPU_MASK_ALL;
304 struct call_data_struct data;
305 int ret;
306
307 cpu_clear(smp_processor_id(), cpu_mask);
308
309 WARN_ON(irqs_disabled());
310
311 data.func = func;
312 data.info = info;
313 data.wait = wait;
314
315 spin_lock(&call_lock);
316 call_data = &data;
317 ret = send_ipi(IPI_CALL, wait, cpu_mask);
318 spin_unlock(&call_lock);
319
320 return ret;
321}
322
323irqreturn_t crisv32_ipi_interrupt(int irq, void *dev_id, struct pt_regs *regs)
324{
325 void (*func) (void *info) = call_data->func;
326 void *info = call_data->info;
327 reg_intr_vect_rw_ipi ipi;
328
329 ipi = REG_RD(intr_vect, irq_regs[smp_processor_id()], rw_ipi);
330
331 if (ipi.vector & IPI_CALL) {
332 func(info);
333 }
334 if (ipi.vector & IPI_FLUSH_TLB) {
335 if (flush_mm == FLUSH_ALL)
336 __flush_tlb_all();
337 else if (flush_vma == FLUSH_ALL)
338 __flush_tlb_mm(flush_mm);
339 else
340 __flush_tlb_page(flush_vma, flush_addr);
341 }
342
343 ipi.vector = 0;
344 REG_WR(intr_vect, irq_regs[smp_processor_id()], rw_ipi, ipi);
345
346 return IRQ_HANDLED;
347}
348
diff --git a/arch/cris/arch-v32/kernel/time.c b/arch/cris/arch-v32/kernel/time.c
new file mode 100644
index 000000000000..d48e397f5fa4
--- /dev/null
+++ b/arch/cris/arch-v32/kernel/time.c
@@ -0,0 +1,341 @@
1/* $Id: time.c,v 1.19 2005/04/29 05:40:09 starvik Exp $
2 *
3 * linux/arch/cris/arch-v32/kernel/time.c
4 *
5 * Copyright (C) 2003 Axis Communications AB
6 *
7 */
8
9#include <linux/config.h>
10#include <linux/timex.h>
11#include <linux/time.h>
12#include <linux/jiffies.h>
13#include <linux/interrupt.h>
14#include <linux/swap.h>
15#include <linux/sched.h>
16#include <linux/init.h>
17#include <linux/threads.h>
18#include <asm/types.h>
19#include <asm/signal.h>
20#include <asm/io.h>
21#include <asm/delay.h>
22#include <asm/rtc.h>
23#include <asm/irq.h>
24
25#include <asm/arch/hwregs/reg_map.h>
26#include <asm/arch/hwregs/reg_rdwr.h>
27#include <asm/arch/hwregs/timer_defs.h>
28#include <asm/arch/hwregs/intr_vect_defs.h>
29
30/* Watchdog defines */
31#define ETRAX_WD_KEY_MASK 0x7F /* key is 7 bit */
32#define ETRAX_WD_HZ 763 /* watchdog counts at 763 Hz */
33#define ETRAX_WD_CNT ((2*ETRAX_WD_HZ)/HZ + 1) /* Number of 763 counts before watchdog bites */
34
35unsigned long timer_regs[NR_CPUS] =
36{
37 regi_timer,
38#ifdef CONFIG_SMP
39 regi_timer2
40#endif
41};
42
43extern void update_xtime_from_cmos(void);
44extern int set_rtc_mmss(unsigned long nowtime);
45extern int setup_irq(int, struct irqaction *);
46extern int have_rtc;
47
48unsigned long get_ns_in_jiffie(void)
49{
50 reg_timer_r_tmr0_data data;
51 unsigned long ns;
52
53 data = REG_RD(timer, regi_timer, r_tmr0_data);
54 ns = (TIMER0_DIV - data) * 10;
55 return ns;
56}
57
58unsigned long do_slow_gettimeoffset(void)
59{
60 unsigned long count;
61 unsigned long usec_count = 0;
62
63 static unsigned long count_p = TIMER0_DIV;/* for the first call after boot */
64 static unsigned long jiffies_p = 0;
65
66 /*
67 * cache volatile jiffies temporarily; we have IRQs turned off.
68 */
69 unsigned long jiffies_t;
70
71 /* The timer interrupt comes from Etrax timer 0. In order to get
72 * better precision, we check the current value. It might have
73 * underflowed already though.
74 */
75
76 count = REG_RD(timer, regi_timer, r_tmr0_data);
77 jiffies_t = jiffies;
78
79 /*
80 * avoiding timer inconsistencies (they are rare, but they happen)...
81 * there are one problem that must be avoided here:
82 * 1. the timer counter underflows
83 */
84 if( jiffies_t == jiffies_p ) {
85 if( count > count_p ) {
86 /* Timer wrapped, use new count and prescale
87 * increase the time corresponding to one jiffie
88 */
89 usec_count = 1000000/HZ;
90 }
91 } else
92 jiffies_p = jiffies_t;
93 count_p = count;
94 /* Convert timer value to usec */
95 /* 100 MHz timer, divide by 100 to get usec */
96 usec_count += (TIMER0_DIV - count) / 100;
97 return usec_count;
98}
99
100/* From timer MDS describing the hardware watchdog:
101 * 4.3.1 Watchdog Operation
102 * The watchdog timer is an 8-bit timer with a configurable start value.
103 * Once started the whatchdog counts downwards with a frequency of 763 Hz
104 * (100/131072 MHz). When the watchdog counts down to 1, it generates an
105 * NMI (Non Maskable Interrupt), and when it counts down to 0, it resets the
106 * chip.
107 */
108/* This gives us 1.3 ms to do something useful when the NMI comes */
109
110/* right now, starting the watchdog is the same as resetting it */
111#define start_watchdog reset_watchdog
112
113#if defined(CONFIG_ETRAX_WATCHDOG)
114static short int watchdog_key = 42; /* arbitrary 7 bit number */
115#endif
116
117/* number of pages to consider "out of memory". it is normal that the memory
118 * is used though, so put this really low.
119 */
120
121#define WATCHDOG_MIN_FREE_PAGES 8
122
123void
124reset_watchdog(void)
125{
126#if defined(CONFIG_ETRAX_WATCHDOG)
127 reg_timer_rw_wd_ctrl wd_ctrl = { 0 };
128
129 /* only keep watchdog happy as long as we have memory left! */
130 if(nr_free_pages() > WATCHDOG_MIN_FREE_PAGES) {
131 /* reset the watchdog with the inverse of the old key */
132 watchdog_key ^= ETRAX_WD_KEY_MASK; /* invert key, which is 7 bits */
133 wd_ctrl.cnt = ETRAX_WD_CNT;
134 wd_ctrl.cmd = regk_timer_start;
135 wd_ctrl.key = watchdog_key;
136 REG_WR(timer, regi_timer, rw_wd_ctrl, wd_ctrl);
137 }
138#endif
139}
140
141/* stop the watchdog - we still need the correct key */
142
143void
144stop_watchdog(void)
145{
146#if defined(CONFIG_ETRAX_WATCHDOG)
147 reg_timer_rw_wd_ctrl wd_ctrl = { 0 };
148 watchdog_key ^= ETRAX_WD_KEY_MASK; /* invert key, which is 7 bits */
149 wd_ctrl.cnt = ETRAX_WD_CNT;
150 wd_ctrl.cmd = regk_timer_stop;
151 wd_ctrl.key = watchdog_key;
152 REG_WR(timer, regi_timer, rw_wd_ctrl, wd_ctrl);
153#endif
154}
155
156extern void show_registers(struct pt_regs *regs);
157
158void
159handle_watchdog_bite(struct pt_regs* regs)
160{
161#if defined(CONFIG_ETRAX_WATCHDOG)
162 extern int cause_of_death;
163
164 raw_printk("Watchdog bite\n");
165
166 /* Check if forced restart or unexpected watchdog */
167 if (cause_of_death == 0xbedead) {
168 while(1);
169 }
170
171 /* Unexpected watchdog, stop the watchdog and dump registers*/
172 stop_watchdog();
173 raw_printk("Oops: bitten by watchdog\n");
174 show_registers(regs);
175#ifndef CONFIG_ETRAX_WATCHDOG_NICE_DOGGY
176 reset_watchdog();
177#endif
178 while(1) /* nothing */;
179#endif
180}
181
182/* last time the cmos clock got updated */
183static long last_rtc_update = 0;
184
185/*
186 * timer_interrupt() needs to keep up the real-time clock,
187 * as well as call the "do_timer()" routine every clocktick
188 */
189
190//static unsigned short myjiff; /* used by our debug routine print_timestamp */
191
192extern void cris_do_profile(struct pt_regs *regs);
193
194static inline irqreturn_t
195timer_interrupt(int irq, void *dev_id, struct pt_regs *regs)
196{
197 int cpu = smp_processor_id();
198 reg_timer_r_masked_intr masked_intr;
199 reg_timer_rw_ack_intr ack_intr = { 0 };
200
201 /* Check if the timer interrupt is for us (a tmr0 int) */
202 masked_intr = REG_RD(timer, timer_regs[cpu], r_masked_intr);
203 if (!masked_intr.tmr0)
204 return IRQ_NONE;
205
206 /* acknowledge the timer irq */
207 ack_intr.tmr0 = 1;
208 REG_WR(timer, timer_regs[cpu], rw_ack_intr, ack_intr);
209
210 /* reset watchdog otherwise it resets us! */
211 reset_watchdog();
212
213 /* Update statistics. */
214 update_process_times(user_mode(regs));
215
216 cris_do_profile(regs); /* Save profiling information */
217
218 /* The master CPU is responsible for the time keeping. */
219 if (cpu != 0)
220 return IRQ_HANDLED;
221
222 /* call the real timer interrupt handler */
223 do_timer(regs);
224
225 /*
226 * If we have an externally synchronized Linux clock, then update
227 * CMOS clock accordingly every ~11 minutes. Set_rtc_mmss() has to be
228 * called as close as possible to 500 ms before the new second starts.
229 *
230 * The division here is not time critical since it will run once in
231 * 11 minutes
232 */
233 if ((time_status & STA_UNSYNC) == 0 &&
234 xtime.tv_sec > last_rtc_update + 660 &&
235 (xtime.tv_nsec / 1000) >= 500000 - (tick_nsec / 1000) / 2 &&
236 (xtime.tv_nsec / 1000) <= 500000 + (tick_nsec / 1000) / 2) {
237 if (set_rtc_mmss(xtime.tv_sec) == 0)
238 last_rtc_update = xtime.tv_sec;
239 else
240 last_rtc_update = xtime.tv_sec - 600; /* do it again in 60 s */
241 }
242 return IRQ_HANDLED;
243}
244
245/* timer is SA_SHIRQ so drivers can add stuff to the timer irq chain
246 * it needs to be SA_INTERRUPT to make the jiffies update work properly
247 */
248
249static struct irqaction irq_timer = { timer_interrupt, SA_SHIRQ | SA_INTERRUPT,
250 CPU_MASK_NONE, "timer", NULL, NULL};
251
252void __init
253cris_timer_init(void)
254{
255 int cpu = smp_processor_id();
256 reg_timer_rw_tmr0_ctrl tmr0_ctrl = { 0 };
257 reg_timer_rw_tmr0_div tmr0_div = TIMER0_DIV;
258 reg_timer_rw_intr_mask timer_intr_mask;
259
260 /* Setup the etrax timers
261 * Base frequency is 100MHz, divider 1000000 -> 100 HZ
262 * We use timer0, so timer1 is free.
263 * The trig timer is used by the fasttimer API if enabled.
264 */
265
266 tmr0_ctrl.op = regk_timer_ld;
267 tmr0_ctrl.freq = regk_timer_f100;
268 REG_WR(timer, timer_regs[cpu], rw_tmr0_div, tmr0_div);
269 REG_WR(timer, timer_regs[cpu], rw_tmr0_ctrl, tmr0_ctrl); /* Load */
270 tmr0_ctrl.op = regk_timer_run;
271 REG_WR(timer, timer_regs[cpu], rw_tmr0_ctrl, tmr0_ctrl); /* Start */
272
273 /* enable the timer irq */
274 timer_intr_mask = REG_RD(timer, timer_regs[cpu], rw_intr_mask);
275 timer_intr_mask.tmr0 = 1;
276 REG_WR(timer, timer_regs[cpu], rw_intr_mask, timer_intr_mask);
277}
278
279void __init
280time_init(void)
281{
282 reg_intr_vect_rw_mask intr_mask;
283
284 /* probe for the RTC and read it if it exists
285 * Before the RTC can be probed the loops_per_usec variable needs
286 * to be initialized to make usleep work. A better value for
287 * loops_per_usec is calculated by the kernel later once the
288 * clock has started.
289 */
290 loops_per_usec = 50;
291
292 if(RTC_INIT() < 0) {
293 /* no RTC, start at 1980 */
294 xtime.tv_sec = 0;
295 xtime.tv_nsec = 0;
296 have_rtc = 0;
297 } else {
298 /* get the current time */
299 have_rtc = 1;
300 update_xtime_from_cmos();
301 }
302
303 /*
304 * Initialize wall_to_monotonic such that adding it to xtime will yield zero, the
305 * tv_nsec field must be normalized (i.e., 0 <= nsec < NSEC_PER_SEC).
306 */
307 set_normalized_timespec(&wall_to_monotonic, -xtime.tv_sec, -xtime.tv_nsec);
308
309 /* Start CPU local timer */
310 cris_timer_init();
311
312 /* enable the timer irq in global config */
313 intr_mask = REG_RD(intr_vect, regi_irq, rw_mask);
314 intr_mask.timer = 1;
315 REG_WR(intr_vect, regi_irq, rw_mask, intr_mask);
316
317 /* now actually register the timer irq handler that calls timer_interrupt() */
318
319 setup_irq(TIMER_INTR_VECT, &irq_timer);
320
321 /* enable watchdog if we should use one */
322
323#if defined(CONFIG_ETRAX_WATCHDOG)
324 printk("Enabling watchdog...\n");
325 start_watchdog();
326
327 /* If we use the hardware watchdog, we want to trap it as an NMI
328 and dump registers before it resets us. For this to happen, we
329 must set the "m" NMI enable flag (which once set, is unset only
330 when an NMI is taken).
331
332 The same goes for the external NMI, but that doesn't have any
333 driver or infrastructure support yet. */
334 {
335 unsigned long flags;
336 local_save_flags(flags);
337 flags |= (1<<30); /* NMI M flag is at bit 30 */
338 local_irq_restore(flags);
339 }
340#endif
341}
diff --git a/arch/cris/arch-v32/kernel/traps.c b/arch/cris/arch-v32/kernel/traps.c
new file mode 100644
index 000000000000..6e3787045560
--- /dev/null
+++ b/arch/cris/arch-v32/kernel/traps.c
@@ -0,0 +1,160 @@
1/*
2 * Copyright (C) 2003, Axis Communications AB.
3 */
4
5#include <linux/config.h>
6#include <linux/ptrace.h>
7#include <asm/uaccess.h>
8
9#include <asm/arch/hwregs/supp_reg.h>
10
11extern void reset_watchdog(void);
12extern void stop_watchdog(void);
13
14extern int raw_printk(const char *fmt, ...);
15
16void
17show_registers(struct pt_regs *regs)
18{
19 /*
20 * It's possible to use either the USP register or current->thread.usp.
21 * USP might not correspond to the current proccess for all cases this
22 * function is called, and current->thread.usp isn't up to date for the
23 * current proccess. Experience shows that using USP is the way to go.
24 */
25 unsigned long usp;
26 unsigned long d_mmu_cause;
27 unsigned long i_mmu_cause;
28
29 usp = rdusp();
30
31 raw_printk("CPU: %d\n", smp_processor_id());
32
33 raw_printk("ERP: %08lx SRP: %08lx CCS: %08lx USP: %08lx MOF: %08lx\n",
34 regs->erp, regs->srp, regs->ccs, usp, regs->mof);
35
36 raw_printk(" r0: %08lx r1: %08lx r2: %08lx r3: %08lx\n",
37 regs->r0, regs->r1, regs->r2, regs->r3);
38
39 raw_printk(" r4: %08lx r5: %08lx r6: %08lx r7: %08lx\n",
40 regs->r4, regs->r5, regs->r6, regs->r7);
41
42 raw_printk(" r8: %08lx r9: %08lx r10: %08lx r11: %08lx\n",
43 regs->r8, regs->r9, regs->r10, regs->r11);
44
45 raw_printk("r12: %08lx r13: %08lx oR10: %08lx acr: %08lx\n",
46 regs->r12, regs->r13, regs->orig_r10, regs->acr);
47
48 raw_printk("sp: %08lx\n", regs);
49
50 SUPP_BANK_SEL(BANK_IM);
51 SUPP_REG_RD(RW_MM_CAUSE, i_mmu_cause);
52
53 SUPP_BANK_SEL(BANK_DM);
54 SUPP_REG_RD(RW_MM_CAUSE, d_mmu_cause);
55
56 raw_printk(" Data MMU Cause: %08lx\n", d_mmu_cause);
57 raw_printk("Instruction MMU Cause: %08lx\n", i_mmu_cause);
58
59 raw_printk("Process %s (pid: %d, stackpage: %08lx)\n",
60 current->comm, current->pid, (unsigned long) current);
61
62 /* Show additional info if in kernel-mode. */
63 if (!user_mode(regs)) {
64 int i;
65 unsigned char c;
66
67 show_stack(NULL, (unsigned long *) usp);
68
69 /*
70 * If the previous stack-dump wasn't a kernel one, dump the
71 * kernel stack now.
72 */
73 if (usp != 0)
74 show_stack(NULL, NULL);
75
76 raw_printk("\nCode: ");
77
78 if (regs->erp < PAGE_OFFSET)
79 goto bad_value;
80
81 /*
82 * Quite often the value at regs->erp doesn't point to the
83 * interesting instruction, which often is the previous
84 * instruction. So dump at an offset large enough that the
85 * instruction decoding should be in sync at the interesting
86 * point, but small enough to fit on a row. The regs->erp
87 * location is pointed out in a ksymoops-friendly way by
88 * wrapping the byte for that address in parenthesis.
89 */
90 for (i = -12; i < 12; i++) {
91 if (__get_user(c, &((unsigned char *) regs->erp)[i])) {
92bad_value:
93 raw_printk(" Bad IP value.");
94 break;
95 }
96
97 if (i == 0)
98 raw_printk("(%02x) ", c);
99 else
100 raw_printk("%02x ", c);
101 }
102
103 raw_printk("\n");
104 }
105}
106
107/*
108 * This gets called from entry.S when the watchdog has bitten. Show something
109 * similiar to an Oops dump, and if the kernel if configured to be a nice doggy;
110 * halt instead of reboot.
111 */
112void
113watchdog_bite_hook(struct pt_regs *regs)
114{
115#ifdef CONFIG_ETRAX_WATCHDOG_NICE_DOGGY
116 local_irq_disable();
117 stop_watchdog();
118 show_registers(regs);
119
120 while (1)
121 ; /* Do nothing. */
122#else
123 show_registers(regs);
124#endif
125}
126
127/* This is normally the Oops function. */
128void
129die_if_kernel(const char *str, struct pt_regs *regs, long err)
130{
131 if (user_mode(regs))
132 return;
133
134#ifdef CONFIG_ETRAX_WATCHDOG_NICE_DOGGY
135 /*
136 * This printout might take too long and could trigger
137 * the watchdog normally. If NICE_DOGGY is set, simply
138 * stop the watchdog during the printout.
139 */
140 stop_watchdog();
141#endif
142
143 raw_printk("%s: %04lx\n", str, err & 0xffff);
144
145 show_registers(regs);
146
147#ifdef CONFIG_ETRAX_WATCHDOG_NICE_DOGGY
148 reset_watchdog();
149#endif
150
151 do_exit(SIGSEGV);
152}
153
154void arch_enable_nmi(void)
155{
156 unsigned long flags;
157 local_save_flags(flags);
158 flags |= (1<<30); /* NMI M flag is at bit 30 */
159 local_irq_restore(flags);
160}
diff --git a/arch/cris/arch-v32/kernel/vcs_hook.c b/arch/cris/arch-v32/kernel/vcs_hook.c
new file mode 100644
index 000000000000..64d71c54c22c
--- /dev/null
+++ b/arch/cris/arch-v32/kernel/vcs_hook.c
@@ -0,0 +1,96 @@
1// $Id: vcs_hook.c,v 1.2 2003/08/12 12:01:06 starvik Exp $
2//
3// Call simulator hook. This is the part running in the
4// simulated program.
5//
6
7#include "vcs_hook.h"
8#include <stdarg.h>
9#include <asm/arch-v32/hwregs/reg_map.h>
10#include <asm/arch-v32/hwregs/intr_vect_defs.h>
11
12#define HOOK_TRIG_ADDR 0xb7000000 /* hook cvlog model reg address */
13#define HOOK_MEM_BASE_ADDR 0xa0000000 /* csp4 (shared mem) base addr */
14
15#define HOOK_DATA(offset) ((unsigned*) HOOK_MEM_BASE_ADDR)[offset]
16#define VHOOK_DATA(offset) ((volatile unsigned*) HOOK_MEM_BASE_ADDR)[offset]
17#define HOOK_TRIG(funcid) do { *((unsigned *) HOOK_TRIG_ADDR) = funcid; } while(0)
18#define HOOK_DATA_BYTE(offset) ((unsigned char*) HOOK_MEM_BASE_ADDR)[offset]
19
20
21// ------------------------------------------------------------------ hook_call
22int hook_call( unsigned id, unsigned pcnt, ...) {
23 va_list ap;
24 unsigned i;
25 unsigned ret;
26#ifdef USING_SOS
27 PREEMPT_OFF_SAVE();
28#endif
29
30 // pass parameters
31 HOOK_DATA(0) = id;
32
33 /* Have to make hook_print_str a special case since we call with a
34 parameter of byte type. Should perhaps be a separate
35 hook_call. */
36
37 if (id == hook_print_str) {
38 int i;
39 char *str;
40
41 HOOK_DATA(1) = pcnt;
42
43 va_start(ap, pcnt);
44 str = (char*)va_arg(ap,unsigned);
45
46 for (i=0; i!=pcnt; i++) {
47 HOOK_DATA_BYTE(8+i) = str[i];
48 }
49 HOOK_DATA_BYTE(8+i) = 0; /* null byte */
50 }
51 else {
52 va_start(ap, pcnt);
53 for( i = 1; i <= pcnt; i++ ) HOOK_DATA(i) = va_arg(ap,unsigned);
54 va_end(ap);
55 }
56
57 // read from mem to make sure data has propagated to memory before trigging
58 *((volatile unsigned*) HOOK_MEM_BASE_ADDR);
59
60 // trigger hook
61 HOOK_TRIG(id);
62
63 // wait for call to finish
64 while( VHOOK_DATA(0) > 0 ) {}
65
66 // extract return value
67
68 ret = VHOOK_DATA(1);
69
70#ifdef USING_SOS
71 PREEMPT_RESTORE();
72#endif
73 return ret;
74}
75
76unsigned
77hook_buf(unsigned i)
78{
79 return (HOOK_DATA(i));
80}
81
82void print_str( const char *str ) {
83 int i;
84 for (i=1; str[i]; i++); /* find null at end of string */
85 hook_call(hook_print_str, i, str);
86}
87
88// --------------------------------------------------------------- CPU_KICK_DOG
89void CPU_KICK_DOG(void) {
90 (void) hook_call( hook_kick_dog, 0 );
91}
92
93// ------------------------------------------------------- CPU_WATCHDOG_TIMEOUT
94void CPU_WATCHDOG_TIMEOUT( unsigned t ) {
95 (void) hook_call( hook_dog_timeout, 1, t );
96}
diff --git a/arch/cris/arch-v32/kernel/vcs_hook.h b/arch/cris/arch-v32/kernel/vcs_hook.h
new file mode 100644
index 000000000000..7d73709e3cc6
--- /dev/null
+++ b/arch/cris/arch-v32/kernel/vcs_hook.h
@@ -0,0 +1,42 @@
1// $Id: vcs_hook.h,v 1.1 2003/08/12 12:01:06 starvik Exp $
2//
3// Call simulator hook functions
4
5#ifndef HOOK_H
6#define HOOK_H
7
8int hook_call( unsigned id, unsigned pcnt, ...);
9
10enum hook_ids {
11 hook_debug_on = 1,
12 hook_debug_off,
13 hook_stop_sim_ok,
14 hook_stop_sim_fail,
15 hook_alloc_shared,
16 hook_ptr_shared,
17 hook_free_shared,
18 hook_file2shared,
19 hook_cmp_shared,
20 hook_print_params,
21 hook_sim_time,
22 hook_stop_sim,
23 hook_kick_dog,
24 hook_dog_timeout,
25 hook_rand,
26 hook_srand,
27 hook_rand_range,
28 hook_print_str,
29 hook_print_hex,
30 hook_cmp_offset_shared,
31 hook_fill_random_shared,
32 hook_alloc_random_data,
33 hook_calloc_random_data,
34 hook_print_int,
35 hook_print_uint,
36 hook_fputc,
37 hook_init_fd,
38 hook_sbrk
39
40};
41
42#endif
diff --git a/arch/cris/arch-v32/lib/Makefile b/arch/cris/arch-v32/lib/Makefile
new file mode 100644
index 000000000000..05b3ec6978d6
--- /dev/null
+++ b/arch/cris/arch-v32/lib/Makefile
@@ -0,0 +1,6 @@
1#
2# Makefile for Etrax-specific library files..
3#
4
5lib-y = checksum.o checksumcopy.o string.o usercopy.o memset.o csumcpfruser.o spinlock.o
6
diff --git a/arch/cris/arch-v32/lib/checksum.S b/arch/cris/arch-v32/lib/checksum.S
new file mode 100644
index 000000000000..32e66181b826
--- /dev/null
+++ b/arch/cris/arch-v32/lib/checksum.S
@@ -0,0 +1,111 @@
1/*
2 * A fast checksum routine using movem
3 * Copyright (c) 1998-2001, 2003 Axis Communications AB
4 *
5 * csum_partial(const unsigned char * buff, int len, unsigned int sum)
6 */
7
8 .globl csum_partial
9csum_partial:
10
11 ;; r10 - src
12 ;; r11 - length
13 ;; r12 - checksum
14
15 ;; check for breakeven length between movem and normal word looping versions
16 ;; we also do _NOT_ want to compute a checksum over more than the
17 ;; actual length when length < 40
18
19 cmpu.w 80,$r11
20 blo _word_loop
21 nop
22
23 ;; need to save the registers we use below in the movem loop
24 ;; this overhead is why we have a check above for breakeven length
25 ;; only r0 - r8 have to be saved, the other ones are clobber-able
26 ;; according to the ABI
27
28 subq 9*4,$sp
29 subq 10*4,$r11 ; update length for the first loop
30 movem $r8,[$sp]
31
32 ;; do a movem checksum
33
34_mloop: movem [$r10+],$r9 ; read 10 longwords
35
36 ;; perform dword checksumming on the 10 longwords
37
38 add.d $r0,$r12
39 addc $r1,$r12
40 addc $r2,$r12
41 addc $r3,$r12
42 addc $r4,$r12
43 addc $r5,$r12
44 addc $r6,$r12
45 addc $r7,$r12
46 addc $r8,$r12
47 addc $r9,$r12
48
49 ;; fold the carry into the checksum, to avoid having to loop the carry
50 ;; back into the top
51
52 addc 0,$r12
53 addc 0,$r12 ; do it again, since we might have generated a carry
54
55 subq 10*4,$r11
56 bge _mloop
57 nop
58
59 addq 10*4,$r11 ; compensate for last loop underflowing length
60
61 movem [$sp+],$r8 ; restore regs
62
63_word_loop:
64 ;; only fold if there is anything to fold.
65
66 cmpq 0,$r12
67 beq _no_fold
68
69 ;; fold 32-bit checksum into a 16-bit checksum, to avoid carries below.
70 ;; r9 and r13 can be used as temporaries.
71
72 moveq -1,$r9 ; put 0xffff in r9, faster than move.d 0xffff,r9
73 lsrq 16,$r9
74
75 move.d $r12,$r13
76 lsrq 16,$r13 ; r13 = checksum >> 16
77 and.d $r9,$r12 ; checksum = checksum & 0xffff
78 add.d $r13,$r12 ; checksum += r13
79 move.d $r12,$r13 ; do the same again, maybe we got a carry last add
80 lsrq 16,$r13
81 and.d $r9,$r12
82 add.d $r13,$r12
83
84_no_fold:
85 cmpq 2,$r11
86 blt _no_words
87 nop
88
89 ;; checksum the rest of the words
90
91 subq 2,$r11
92
93_wloop: subq 2,$r11
94 bge _wloop
95 addu.w [$r10+],$r12
96
97 addq 2,$r11
98
99_no_words:
100 ;; see if we have one odd byte more
101 cmpq 1,$r11
102 beq _do_byte
103 nop
104 ret
105 move.d $r12,$r10
106
107_do_byte:
108 ;; copy and checksum the last byte
109 addu.b [$r10],$r12
110 ret
111 move.d $r12,$r10
diff --git a/arch/cris/arch-v32/lib/checksumcopy.S b/arch/cris/arch-v32/lib/checksumcopy.S
new file mode 100644
index 000000000000..9303ccbadc6d
--- /dev/null
+++ b/arch/cris/arch-v32/lib/checksumcopy.S
@@ -0,0 +1,120 @@
1/*
2 * A fast checksum+copy routine using movem
3 * Copyright (c) 1998, 2001, 2003 Axis Communications AB
4 *
5 * Authors: Bjorn Wesen
6 *
7 * csum_partial_copy_nocheck(const char *src, char *dst,
8 * int len, unsigned int sum)
9 */
10
11 .globl csum_partial_copy_nocheck
12csum_partial_copy_nocheck:
13
14 ;; r10 - src
15 ;; r11 - dst
16 ;; r12 - length
17 ;; r13 - checksum
18
19 ;; check for breakeven length between movem and normal word looping versions
20 ;; we also do _NOT_ want to compute a checksum over more than the
21 ;; actual length when length < 40
22
23 cmpu.w 80,$r12
24 blo _word_loop
25 nop
26
27 ;; need to save the registers we use below in the movem loop
28 ;; this overhead is why we have a check above for breakeven length
29 ;; only r0 - r8 have to be saved, the other ones are clobber-able
30 ;; according to the ABI
31
32 subq 9*4,$sp
33 subq 10*4,$r12 ; update length for the first loop
34 movem $r8,[$sp]
35
36 ;; do a movem copy and checksum
37
381: ;; A failing userspace access (the read) will have this as PC.
39_mloop: movem [$r10+],$r9 ; read 10 longwords
40 movem $r9,[$r11+] ; write 10 longwords
41
42 ;; perform dword checksumming on the 10 longwords
43
44 add.d $r0,$r13
45 addc $r1,$r13
46 addc $r2,$r13
47 addc $r3,$r13
48 addc $r4,$r13
49 addc $r5,$r13
50 addc $r6,$r13
51 addc $r7,$r13
52 addc $r8,$r13
53 addc $r9,$r13
54
55 ;; fold the carry into the checksum, to avoid having to loop the carry
56 ;; back into the top
57
58 addc 0,$r13
59 addc 0,$r13 ; do it again, since we might have generated a carry
60
61 subq 10*4,$r12
62 bge _mloop
63 nop
64
65 addq 10*4,$r12 ; compensate for last loop underflowing length
66
67 movem [$sp+],$r8 ; restore regs
68
69_word_loop:
70 ;; only fold if there is anything to fold.
71
72 cmpq 0,$r13
73 beq _no_fold
74
75 ;; fold 32-bit checksum into a 16-bit checksum, to avoid carries below
76 ;; r9 can be used as temporary.
77
78 move.d $r13,$r9
79 lsrq 16,$r9 ; r0 = checksum >> 16
80 and.d 0xffff,$r13 ; checksum = checksum & 0xffff
81 add.d $r9,$r13 ; checksum += r0
82 move.d $r13,$r9 ; do the same again, maybe we got a carry last add
83 lsrq 16,$r9
84 and.d 0xffff,$r13
85 add.d $r9,$r13
86
87_no_fold:
88 cmpq 2,$r12
89 blt _no_words
90 nop
91
92 ;; copy and checksum the rest of the words
93
94 subq 2,$r12
95
962: ;; A failing userspace access for the read below will have this as PC.
97_wloop: move.w [$r10+],$r9
98 addu.w $r9,$r13
99 subq 2,$r12
100 bge _wloop
101 move.w $r9,[$r11+]
102
103 addq 2,$r12
104
105_no_words:
106 ;; see if we have one odd byte more
107 cmpq 1,$r12
108 beq _do_byte
109 nop
110 ret
111 move.d $r13,$r10
112
113_do_byte:
114 ;; copy and checksum the last byte
1153: ;; A failing userspace access for the read below will have this as PC.
116 move.b [$r10],$r9
117 addu.b $r9,$r13
118 move.b $r9,[$r11]
119 ret
120 move.d $r13,$r10
diff --git a/arch/cris/arch-v32/lib/csumcpfruser.S b/arch/cris/arch-v32/lib/csumcpfruser.S
new file mode 100644
index 000000000000..600ec16b9f28
--- /dev/null
+++ b/arch/cris/arch-v32/lib/csumcpfruser.S
@@ -0,0 +1,69 @@
1/*
2 * Add-on to transform csum_partial_copy_nocheck in checksumcopy.S into
3 * csum_partial_copy_from_user by adding exception records.
4 *
5 * Copyright (C) 2001, 2003 Axis Communications AB.
6 *
7 * Author: Hans-Peter Nilsson.
8 */
9
10#include <asm/errno.h>
11
12/* Same function body, but a different name. If we just added exception
13 records to _csum_partial_copy_nocheck and made it generic, we wouldn't
14 know a user fault from a kernel fault and we would have overhead in
15 each kernel caller for the error-pointer argument.
16
17 unsigned int csum_partial_copy_from_user
18 (const char *src, char *dst, int len, unsigned int sum, int *errptr);
19
20 Note that the errptr argument is only set if we encounter an error.
21 It is conveniently located on the stack, so the normal function body
22 does not have to handle it. */
23
24#define csum_partial_copy_nocheck csum_partial_copy_from_user
25
26/* There are local labels numbered 1, 2 and 3 present to mark the
27 different from-user accesses. */
28#include "checksumcopy.S"
29
30 .section .fixup,"ax"
31
32;; Here from the movem loop; restore stack.
334:
34 movem [$sp+],$r8
35;; r12 is already decremented. Add back chunk_size-2.
36 addq 40-2,$r12
37
38;; Here from the word loop; r12 is off by 2; add it back.
395:
40 addq 2,$r12
41
42;; Here from a failing single byte.
436:
44
45;; Signal in *errptr that we had a failing access.
46 move.d [$sp],$acr
47 moveq -EFAULT,$r9
48 subq 4,$sp
49 move.d $r9,[$acr]
50
51;; Clear the rest of the destination area using memset. Preserve the
52;; checksum for the readable bytes.
53 move.d $r13,[$sp]
54 subq 4,$sp
55 move.d $r11,$r10
56 move $srp,[$sp]
57 jsr memset
58 clear.d $r11
59
60 move [$sp+],$srp
61 ret
62 move.d [$sp+],$r10
63
64 .previous
65 .section __ex_table,"a"
66 .dword 1b,4b
67 .dword 2b,5b
68 .dword 3b,6b
69 .previous
diff --git a/arch/cris/arch-v32/lib/dram_init.S b/arch/cris/arch-v32/lib/dram_init.S
new file mode 100644
index 000000000000..47b6cf5f4afd
--- /dev/null
+++ b/arch/cris/arch-v32/lib/dram_init.S
@@ -0,0 +1,120 @@
1/* $Id: dram_init.S,v 1.4 2005/04/24 18:48:32 starvik Exp $
2 *
3 * DRAM/SDRAM initialization - alter with care
4 * This file is intended to be included from other assembler files
5 *
6 * Note: This file may not modify r8 or r9 because they are used to
7 * carry information from the decompresser to the kernel
8 *
9 * Copyright (C) 2000-2003 Axis Communications AB
10 *
11 * Authors: Mikael Starvik (starvik@axis.com)
12 */
13
14/* Just to be certain the config file is included, we include it here
15 * explicitely instead of depending on it being included in the file that
16 * uses this code.
17 */
18
19#include <linux/config.h>
20#include <asm/arch/hwregs/asm/reg_map_asm.h>
21#include <asm/arch/hwregs/asm/bif_core_defs_asm.h>
22
23 ;; WARNING! The registers r8 and r9 are used as parameters carrying
24 ;; information from the decompressor (if the kernel was compressed).
25 ;; They should not be used in the code below.
26
27 ; Refer to BIF MDS for a description of SDRAM initialization
28
29 ; Bank configuration
30 move.d REG_ADDR(bif_core, regi_bif_core, rw_sdram_cfg_grp0), $r0
31 move.d CONFIG_ETRAX_SDRAM_GRP0_CONFIG, $r1
32 move.d $r1, [$r0]
33 move.d REG_ADDR(bif_core, regi_bif_core, rw_sdram_cfg_grp1), $r0
34 move.d CONFIG_ETRAX_SDRAM_GRP1_CONFIG, $r1
35 move.d $r1, [$r0]
36
37 ; Calculate value of mrs_data
38 ; CAS latency = 2 && bus_width = 32 => 0x40
39 ; CAS latency = 3 && bus_width = 32 => 0x60
40 ; CAS latency = 2 && bus_width = 16 => 0x20
41 ; CAS latency = 3 && bus_width = 16 => 0x30
42
43 ; Check if value is already supplied in kernel config
44 move.d CONFIG_ETRAX_SDRAM_COMMAND, $r2
45 bne _set_timing
46 nop
47
48 move.d 0x40, $r4 ; Assume 32 bits and CAS latency = 2
49 move.d CONFIG_ETRAX_SDRAM_TIMING, $r1
50 and.d 0x07, $r1 ; Get CAS latency
51 cmpq 2, $r1 ; CL = 2 ?
52 beq _bw_check
53 nop
54 move.d 0x60, $r4
55
56_bw_check:
57 ; Assume that group 0 width is equal to group 1. This assumption
58 ; is wrong for a group 1 only hardware (such as the grand old
59 ; StorPoint+).
60 move.d CONFIG_ETRAX_SDRAM_GRP0_CONFIG, $r1
61 and.d 0x200, $r1 ; DRAM width is bit 9
62 beq _set_timing
63 lslq 2, $r4 ; mrs_data starts at bit 2
64 lsrq 1, $r4 ; 16 bits. Shift down value.
65
66 ; Set timing parameters (refresh off to avoid Guinness TR 83)
67_set_timing:
68 move.d CONFIG_ETRAX_SDRAM_TIMING, $r1
69 and.d ~(3 << reg_bif_core_rw_sdram_timing___ref___lsb), $r1
70 move.d REG_ADDR(bif_core, regi_bif_core, rw_sdram_timing), $r0
71 move.d $r1, [$r0]
72
73 ; Issue NOP command
74 move.d REG_ADDR(bif_core, regi_bif_core, rw_sdram_cmd), $r5
75 moveq regk_bif_core_nop, $r1
76 move.d $r1, [$r5]
77
78 ; Wait 200us
79 move.d 10000, $r2
801: bne 1b
81 subq 1, $r2
82
83 ; Issue initialization command sequence
84 move.d _sdram_commands_start, $r2
85 and.d 0x000fffff, $r2 ; Make sure commands are read from flash
86 move.d _sdram_commands_end, $r3
87 and.d 0x000fffff, $r3
881: clear.d $r6
89 move.b [$r2+], $r6 ; Load command
90 or.d $r4, $r6 ; Add calculated mrs
91 move.d $r6, [$r5] ; Write rw_sdram_cmd
92 ; Wait 80 ns between each command
93 move.d 4000, $r7
942: bne 2b
95 subq 1, $r7
96 cmp.d $r2, $r3 ; Last command?
97 bne 1b
98 nop
99
100 ; Start refresh
101 move.d CONFIG_ETRAX_SDRAM_TIMING, $r1
102 move.d REG_ADDR(bif_core, regi_bif_core, rw_sdram_timing), $r0
103 move.d $r1, [$r0]
104
105 ; Initialization finished
106 ba _sdram_commands_end
107 nop
108
109_sdram_commands_start:
110 .byte regk_bif_core_pre ; Precharge
111 .byte regk_bif_core_ref ; refresh
112 .byte regk_bif_core_ref ; refresh
113 .byte regk_bif_core_ref ; refresh
114 .byte regk_bif_core_ref ; refresh
115 .byte regk_bif_core_ref ; refresh
116 .byte regk_bif_core_ref ; refresh
117 .byte regk_bif_core_ref ; refresh
118 .byte regk_bif_core_ref ; refresh
119 .byte regk_bif_core_mrs ; mrs
120_sdram_commands_end:
diff --git a/arch/cris/arch-v32/lib/hw_settings.S b/arch/cris/arch-v32/lib/hw_settings.S
new file mode 100644
index 000000000000..5182e8c2cff2
--- /dev/null
+++ b/arch/cris/arch-v32/lib/hw_settings.S
@@ -0,0 +1,73 @@
1/*
2 * $Id: hw_settings.S,v 1.3 2005/04/24 18:36:57 starvik Exp $
3 *
4 * This table is used by some tools to extract hardware parameters.
5 * The table should be included in the kernel and the decompressor.
6 * Don't forget to update the tools if you change this table.
7 *
8 * Copyright (C) 2001 Axis Communications AB
9 *
10 * Authors: Mikael Starvik (starvik@axis.com)
11 */
12
13#include <linux/config.h>
14#include <asm/arch/hwregs/asm/reg_map_asm.h>
15#include <asm/arch/hwregs/asm/bif_core_defs_asm.h>
16#include <asm/arch/hwregs/asm/gio_defs_asm.h>
17
18 .ascii "HW_PARAM_MAGIC" ; Magic number
19 .dword 0xc0004000 ; Kernel start address
20
21 ; Debug port
22#ifdef CONFIG_ETRAX_DEBUG_PORT0
23 .dword 0
24#elif defined(CONFIG_ETRAX_DEBUG_PORT1)
25 .dword 1
26#elif defined(CONFIG_ETRAX_DEBUG_PORT2)
27 .dword 2
28#elif defined(CONFIG_ETRAX_DEBUG_PORT3)
29 .dword 3
30#else
31 .dword 4 ; No debug
32#endif
33
34 ; Register values
35 .dword REG_ADDR(bif_core, regi_bif_core, rw_grp1_cfg)
36 .dword CONFIG_ETRAX_MEM_GRP1_CONFIG
37 .dword REG_ADDR(bif_core, regi_bif_core, rw_grp2_cfg)
38 .dword CONFIG_ETRAX_MEM_GRP2_CONFIG
39 .dword REG_ADDR(bif_core, regi_bif_core, rw_grp3_cfg)
40 .dword CONFIG_ETRAX_MEM_GRP3_CONFIG
41 .dword REG_ADDR(bif_core, regi_bif_core, rw_grp4_cfg)
42 .dword CONFIG_ETRAX_MEM_GRP4_CONFIG
43 .dword REG_ADDR(bif_core, regi_bif_core, rw_sdram_cfg_grp0)
44 .dword CONFIG_ETRAX_SDRAM_GRP0_CONFIG
45 .dword REG_ADDR(bif_core, regi_bif_core, rw_sdram_cfg_grp1)
46 .dword CONFIG_ETRAX_SDRAM_GRP1_CONFIG
47 .dword REG_ADDR(bif_core, regi_bif_core, rw_sdram_timing)
48 .dword CONFIG_ETRAX_SDRAM_TIMING
49 .dword REG_ADDR(bif_core, regi_bif_core, rw_sdram_cmd)
50 .dword CONFIG_ETRAX_SDRAM_COMMAND
51
52 .dword REG_ADDR(gio, regi_gio, rw_pa_dout)
53 .dword CONFIG_ETRAX_DEF_GIO_PA_OUT
54 .dword REG_ADDR(gio, regi_gio, rw_pa_oe)
55 .dword CONFIG_ETRAX_DEF_GIO_PA_OE
56 .dword REG_ADDR(gio, regi_gio, rw_pb_dout)
57 .dword CONFIG_ETRAX_DEF_GIO_PB_OUT
58 .dword REG_ADDR(gio, regi_gio, rw_pb_oe)
59 .dword CONFIG_ETRAX_DEF_GIO_PB_OE
60 .dword REG_ADDR(gio, regi_gio, rw_pc_dout)
61 .dword CONFIG_ETRAX_DEF_GIO_PC_OUT
62 .dword REG_ADDR(gio, regi_gio, rw_pc_oe)
63 .dword CONFIG_ETRAX_DEF_GIO_PC_OE
64 .dword REG_ADDR(gio, regi_gio, rw_pd_dout)
65 .dword CONFIG_ETRAX_DEF_GIO_PD_OUT
66 .dword REG_ADDR(gio, regi_gio, rw_pd_oe)
67 .dword CONFIG_ETRAX_DEF_GIO_PD_OE
68 .dword REG_ADDR(gio, regi_gio, rw_pe_dout)
69 .dword CONFIG_ETRAX_DEF_GIO_PE_OUT
70 .dword REG_ADDR(gio, regi_gio, rw_pe_oe)
71 .dword CONFIG_ETRAX_DEF_GIO_PE_OE
72
73 .dword 0 ; No more register values
diff --git a/arch/cris/arch-v32/lib/memset.c b/arch/cris/arch-v32/lib/memset.c
new file mode 100644
index 000000000000..ffca1214674e
--- /dev/null
+++ b/arch/cris/arch-v32/lib/memset.c
@@ -0,0 +1,253 @@
1/*#************************************************************************#*/
2/*#-------------------------------------------------------------------------*/
3/*# */
4/*# FUNCTION NAME: memset() */
5/*# */
6/*# PARAMETERS: void* dst; Destination address. */
7/*# int c; Value of byte to write. */
8/*# int len; Number of bytes to write. */
9/*# */
10/*# RETURNS: dst. */
11/*# */
12/*# DESCRIPTION: Sets the memory dst of length len bytes to c, as standard. */
13/*# Framework taken from memcpy. This routine is */
14/*# very sensitive to compiler changes in register allocation. */
15/*# Should really be rewritten to avoid this problem. */
16/*# */
17/*#-------------------------------------------------------------------------*/
18/*# */
19/*# HISTORY */
20/*# */
21/*# DATE NAME CHANGES */
22/*# ---- ---- ------- */
23/*# 990713 HP Tired of watching this function (or */
24/*# really, the nonoptimized generic */
25/*# implementation) take up 90% of simulator */
26/*# output. Measurements needed. */
27/*# */
28/*#-------------------------------------------------------------------------*/
29
30#include <linux/types.h>
31
32/* No, there's no macro saying 12*4, since it is "hard" to get it into
33 the asm in a good way. Thus better to expose the problem everywhere.
34 */
35
36/* Assuming 1 cycle per dword written or read (ok, not really true), and
37 one per instruction, then 43+3*(n/48-1) <= 24+24*(n/48-1)
38 so n >= 45.7; n >= 0.9; we win on the first full 48-byte block to set. */
39
40#define ZERO_BLOCK_SIZE (1*12*4)
41
42void *memset(void *pdst,
43 int c,
44 size_t plen)
45{
46 /* Ok. Now we want the parameters put in special registers.
47 Make sure the compiler is able to make something useful of this. */
48
49 register char *return_dst __asm__ ("r10") = pdst;
50 register int n __asm__ ("r12") = plen;
51 register int lc __asm__ ("r11") = c;
52
53 /* Most apps use memset sanely. Only those memsetting about 3..4
54 bytes or less get penalized compared to the generic implementation
55 - and that's not really sane use. */
56
57 /* Ugh. This is fragile at best. Check with newer GCC releases, if
58 they compile cascaded "x |= x << 8" sanely! */
59 __asm__("movu.b %0,$r13 \n\
60 lslq 8,$r13 \n\
61 move.b %0,$r13 \n\
62 move.d $r13,%0 \n\
63 lslq 16,$r13 \n\
64 or.d $r13,%0"
65 : "=r" (lc) : "0" (lc) : "r13");
66
67 {
68 register char *dst __asm__ ("r13") = pdst;
69
70 /* This is NONPORTABLE, but since this whole routine is */
71 /* grossly nonportable that doesn't matter. */
72
73 if (((unsigned long) pdst & 3) != 0
74 /* Oops! n=0 must be a legal call, regardless of alignment. */
75 && n >= 3)
76 {
77 if ((unsigned long)dst & 1)
78 {
79 *dst = (char) lc;
80 n--;
81 dst++;
82 }
83
84 if ((unsigned long)dst & 2)
85 {
86 *(short *)dst = lc;
87 n -= 2;
88 dst += 2;
89 }
90 }
91
92 /* Now the fun part. For the threshold value of this, check the equation
93 above. */
94 /* Decide which copying method to use. */
95 if (n >= ZERO_BLOCK_SIZE)
96 {
97 /* For large copies we use 'movem' */
98
99 /* It is not optimal to tell the compiler about clobbering any
100 registers; that will move the saving/restoring of those registers
101 to the function prologue/epilogue, and make non-movem sizes
102 suboptimal.
103
104 This method is not foolproof; it assumes that the "asm reg"
105 declarations at the beginning of the function really are used
106 here (beware: they may be moved to temporary registers).
107 This way, we do not have to save/move the registers around into
108 temporaries; we can safely use them straight away.
109
110 If you want to check that the allocation was right; then
111 check the equalities in the first comment. It should say
112 "r13=r13, r12=r12, r11=r11" */
113 __asm__ volatile (" \n\
114 ;; Check that the register asm declaration got right. \n\
115 ;; The GCC manual says it will work, but there *has* been bugs. \n\
116 .ifnc %0-%1-%4,$r13-$r12-$r11 \n\
117 .err \n\
118 .endif \n\
119 \n\
120 ;; Save the registers we'll clobber in the movem process \n\
121 ;; on the stack. Don't mention them to gcc, it will only be \n\
122 ;; upset. \n\
123 subq 11*4,$sp \n\
124 movem $r10,[$sp] \n\
125 \n\
126 move.d $r11,$r0 \n\
127 move.d $r11,$r1 \n\
128 move.d $r11,$r2 \n\
129 move.d $r11,$r3 \n\
130 move.d $r11,$r4 \n\
131 move.d $r11,$r5 \n\
132 move.d $r11,$r6 \n\
133 move.d $r11,$r7 \n\
134 move.d $r11,$r8 \n\
135 move.d $r11,$r9 \n\
136 move.d $r11,$r10 \n\
137 \n\
138 ;; Now we've got this: \n\
139 ;; r13 - dst \n\
140 ;; r12 - n \n\
141 \n\
142 ;; Update n for the first loop \n\
143 subq 12*4,$r12 \n\
1440: \n\
145 subq 12*4,$r12 \n\
146 bge 0b \n\
147 movem $r11,[$r13+] \n\
148 \n\
149 addq 12*4,$r12 ;; compensate for last loop underflowing n \n\
150 \n\
151 ;; Restore registers from stack \n\
152 movem [$sp+],$r10"
153
154 /* Outputs */ : "=r" (dst), "=r" (n)
155 /* Inputs */ : "0" (dst), "1" (n), "r" (lc));
156 }
157
158 /* Either we directly starts copying, using dword copying
159 in a loop, or we copy as much as possible with 'movem'
160 and then the last block (<44 bytes) is copied here.
161 This will work since 'movem' will have updated src,dst,n. */
162
163 while ( n >= 16 )
164 {
165 *((long*)dst)++ = lc;
166 *((long*)dst)++ = lc;
167 *((long*)dst)++ = lc;
168 *((long*)dst)++ = lc;
169 n -= 16;
170 }
171
172 /* A switch() is definitely the fastest although it takes a LOT of code.
173 * Particularly if you inline code this.
174 */
175 switch (n)
176 {
177 case 0:
178 break;
179 case 1:
180 *(char*)dst = (char) lc;
181 break;
182 case 2:
183 *(short*)dst = (short) lc;
184 break;
185 case 3:
186 *((short*)dst)++ = (short) lc;
187 *(char*)dst = (char) lc;
188 break;
189 case 4:
190 *((long*)dst)++ = lc;
191 break;
192 case 5:
193 *((long*)dst)++ = lc;
194 *(char*)dst = (char) lc;
195 break;
196 case 6:
197 *((long*)dst)++ = lc;
198 *(short*)dst = (short) lc;
199 break;
200 case 7:
201 *((long*)dst)++ = lc;
202 *((short*)dst)++ = (short) lc;
203 *(char*)dst = (char) lc;
204 break;
205 case 8:
206 *((long*)dst)++ = lc;
207 *((long*)dst)++ = lc;
208 break;
209 case 9:
210 *((long*)dst)++ = lc;
211 *((long*)dst)++ = lc;
212 *(char*)dst = (char) lc;
213 break;
214 case 10:
215 *((long*)dst)++ = lc;
216 *((long*)dst)++ = lc;
217 *(short*)dst = (short) lc;
218 break;
219 case 11:
220 *((long*)dst)++ = lc;
221 *((long*)dst)++ = lc;
222 *((short*)dst)++ = (short) lc;
223 *(char*)dst = (char) lc;
224 break;
225 case 12:
226 *((long*)dst)++ = lc;
227 *((long*)dst)++ = lc;
228 *((long*)dst)++ = lc;
229 break;
230 case 13:
231 *((long*)dst)++ = lc;
232 *((long*)dst)++ = lc;
233 *((long*)dst)++ = lc;
234 *(char*)dst = (char) lc;
235 break;
236 case 14:
237 *((long*)dst)++ = lc;
238 *((long*)dst)++ = lc;
239 *((long*)dst)++ = lc;
240 *(short*)dst = (short) lc;
241 break;
242 case 15:
243 *((long*)dst)++ = lc;
244 *((long*)dst)++ = lc;
245 *((long*)dst)++ = lc;
246 *((short*)dst)++ = (short) lc;
247 *(char*)dst = (char) lc;
248 break;
249 }
250 }
251
252 return return_dst; /* destination pointer. */
253} /* memset() */
diff --git a/arch/cris/arch-v32/lib/nand_init.S b/arch/cris/arch-v32/lib/nand_init.S
new file mode 100644
index 000000000000..aba5c751c282
--- /dev/null
+++ b/arch/cris/arch-v32/lib/nand_init.S
@@ -0,0 +1,179 @@
1##=============================================================================
2##
3## nand_init.S
4##
5## The bootrom copies data from the NAND flash to the internal RAM but
6## due to a bug/feature we can only trust the 256 first bytes. So this
7## code copies more data from NAND flash to internal RAM. Obvioulsy this
8## code must fit in the first 256 bytes so alter with care.
9##
10## Some notes about the bug/feature for future reference:
11## The bootrom copies the first 127 KB from NAND flash to internal
12## memory. The problem is that it does a bytewise copy. NAND flashes
13## does autoincrement on the address so for a 16-bite device each
14## read/write increases the address by two. So the copy loop in the
15## bootrom will discard every second byte. This is solved by inserting
16## zeroes in every second byte in the first erase block.
17##
18## The bootrom also incorrectly assumes that it can read the flash
19## linear with only one read command but the flash will actually
20## switch between normal area and spare area if you do that so we
21## can't trust more than the first 256 bytes.
22##
23##=============================================================================
24
25#include <asm/arch/hwregs/asm/reg_map_asm.h>
26#include <asm/arch/hwregs/asm/gio_defs_asm.h>
27#include <asm/arch/hwregs/asm/pinmux_defs_asm.h>
28#include <asm/arch/hwregs/asm/bif_core_defs_asm.h>
29#include <asm/arch/hwregs/asm/config_defs_asm.h>
30#include <linux/config.h>
31
32;; There are 8-bit NAND flashes and 16-bit NAND flashes.
33;; We need to treat them slightly different.
34#if CONFIG_ETRAX_FLASH_BUSWIDTH==2
35#define PAGE_SIZE 256
36#else
37#error 2
38#define PAGE_SIZE 512
39#endif
40#define ERASE_BLOCK 16384
41
42;; GPIO pins connected to NAND flash
43#define CE 4
44#define CLE 5
45#define ALE 6
46#define BY 7
47
48;; Address space for NAND flash
49#define NAND_RD_ADDR 0x90000000
50#define NAND_WR_ADDR 0x94000000
51
52#define READ_CMD 0x00
53
54;; Readability macros
55#define CSP_MASK \
56 REG_MASK(bif_core, rw_grp3_cfg, gated_csp0) | \
57 REG_MASK(bif_core, rw_grp3_cfg, gated_csp1)
58#define CSP_VAL \
59 REG_STATE(bif_core, rw_grp3_cfg, gated_csp0, rd) | \
60 REG_STATE(bif_core, rw_grp3_cfg, gated_csp1, wr)
61
62;;----------------------------------------------------------------------------
63;; Macros to set/clear GPIO bits
64
65.macro SET x
66 or.b (1<<\x),$r9
67 move.d $r9, [$r2]
68.endm
69
70.macro CLR x
71 and.b ~(1<<\x),$r9
72 move.d $r9, [$r2]
73.endm
74
75;;----------------------------------------------------------------------------
76
77nand_boot:
78 ;; Check if nand boot was selected
79 move.d REG_ADDR(config, regi_config, r_bootsel), $r0
80 move.d [$r0], $r0
81 and.d REG_MASK(config, r_bootsel, boot_mode), $r0
82 cmp.d REG_STATE(config, r_bootsel, boot_mode, nand), $r0
83 bne normal_boot ; No NAND boot
84 nop
85
86copy_nand_to_ram:
87 ;; copy_nand_to_ram
88 ;; Arguments
89 ;; r10 - destination
90 ;; r11 - source offset
91 ;; r12 - size
92 ;; r13 - Address to jump to after completion
93 ;; Note : r10-r12 are clobbered on return
94 ;; Registers used:
95 ;; r0 - NAND_RD_ADDR
96 ;; r1 - NAND_WR_ADDR
97 ;; r2 - reg_gio_rw_pa_dout
98 ;; r3 - reg_gio_r_pa_din
99 ;; r4 - tmp
100 ;; r5 - byte counter within a page
101 ;; r6 - reg_pinmux_rw_pa
102 ;; r7 - reg_gio_rw_pa_oe
103 ;; r8 - reg_bif_core_rw_grp3_cfg
104 ;; r9 - reg_gio_rw_pa_dout shadow
105 move.d 0x90000000, $r0
106 move.d 0x94000000, $r1
107 move.d REG_ADDR(gio, regi_gio, rw_pa_dout), $r2
108 move.d REG_ADDR(gio, regi_gio, r_pa_din), $r3
109 move.d REG_ADDR(pinmux, regi_pinmux, rw_pa), $r6
110 move.d REG_ADDR(gio, regi_gio, rw_pa_oe), $r7
111 move.d REG_ADDR(bif_core, regi_bif_core, rw_grp3_cfg), $r8
112
113#if CONFIG_ETRAX_FLASH_BUSWIDTH==2
114 lsrq 1, $r11
115#endif
116 ;; Set up GPIO
117 move.d [$r2], $r9
118 move.d [$r7], $r4
119 or.b (1<<ALE) | (1 << CLE) | (1<<CE), $r4
120 move.d $r4, [$r7]
121
122 ;; Set up bif
123 move.d [$r8], $r4
124 and.d CSP_MASK, $r4
125 or.d CSP_VAL, $r4
126 move.d $r4, [$r8]
127
1281: ;; Copy one page
129 CLR CE
130 SET CLE
131 moveq READ_CMD, $r4
132 move.b $r4, [$r1]
133 moveq 20, $r4
1342: bne 2b
135 subq 1, $r4
136 CLR CLE
137 SET ALE
138 clear.w [$r1] ; Column address = 0
139 move.d $r11, $r4
140 lsrq 8, $r4
141 move.b $r4, [$r1] ; Row address
142 lsrq 8, $r4
143 move.b $r4, [$r1] ; Row adddress
144 moveq 20, $r4
1452: bne 2b
146 subq 1, $r4
147 CLR ALE
1482: move.d [$r3], $r4
149 and.d 1 << BY, $r4
150 beq 2b
151 movu.w PAGE_SIZE, $r5
1522: ; Copy one byte/word
153#if CONFIG_ETRAX_FLASH_BUSWIDTH==2
154 move.w [$r0], $r4
155#else
156 move.b [$r0], $r4
157#endif
158 subq 1, $r5
159 bne 2b
160#if CONFIG_ETRAX_FLASH_BUSWIDTH==2
161 move.w $r4, [$r10+]
162 subu.w PAGE_SIZE*2, $r12
163#else
164 move.b $r4, [$r10+]
165 subu.w PAGE_SIZE, $r12
166#endif
167 bpl 1b
168 addu.w PAGE_SIZE, $r11
169
170 ;; End of copy
171 jump $r13
172 nop
173
174 ;; This will warn if the code above is too large. If you consider
175 ;; to remove this you don't understand the bug/feature.
176 .org 256
177 .org ERASE_BLOCK
178
179normal_boot:
diff --git a/arch/cris/arch-v32/lib/spinlock.S b/arch/cris/arch-v32/lib/spinlock.S
new file mode 100644
index 000000000000..2437ae7f6ed2
--- /dev/null
+++ b/arch/cris/arch-v32/lib/spinlock.S
@@ -0,0 +1,33 @@
1;; Core of the spinlock implementation
2;;
3;; Copyright (C) 2004 Axis Communications AB.
4;;
5;; Author: Mikael Starvik
6
7
8 .global cris_spin_lock
9 .global cris_spin_trylock
10
11 .text
12
13cris_spin_lock:
14 clearf p
151: test.d [$r10]
16 beq 1b
17 clearf p
18 ax
19 clear.d [$r10]
20 bcs 1b
21 clearf p
22 ret
23 nop
24
25cris_spin_trylock:
26 clearf p
271: move.d [$r10], $r11
28 ax
29 clear.d [$r10]
30 bcs 1b
31 clearf p
32 ret
33 move.d $r11,$r10
diff --git a/arch/cris/arch-v32/lib/string.c b/arch/cris/arch-v32/lib/string.c
new file mode 100644
index 000000000000..98e282ac824a
--- /dev/null
+++ b/arch/cris/arch-v32/lib/string.c
@@ -0,0 +1,219 @@
1/*#************************************************************************#*/
2/*#-------------------------------------------------------------------------*/
3/*# */
4/*# FUNCTION NAME: memcpy() */
5/*# */
6/*# PARAMETERS: void* dst; Destination address. */
7/*# void* src; Source address. */
8/*# int len; Number of bytes to copy. */
9/*# */
10/*# RETURNS: dst. */
11/*# */
12/*# DESCRIPTION: Copies len bytes of memory from src to dst. No guarantees */
13/*# about copying of overlapping memory areas. This routine is */
14/*# very sensitive to compiler changes in register allocation. */
15/*# Should really be rewritten to avoid this problem. */
16/*# */
17/*#-------------------------------------------------------------------------*/
18/*# */
19/*# HISTORY */
20/*# */
21/*# DATE NAME CHANGES */
22/*# ---- ---- ------- */
23/*# 941007 Kenny R Creation */
24/*# 941011 Kenny R Lots of optimizations and inlining. */
25/*# 941129 Ulf A Adapted for use in libc. */
26/*# 950216 HP N==0 forgotten if non-aligned src/dst. */
27/*# Added some optimizations. */
28/*# 001025 HP Make src and dst char *. Align dst to */
29/*# dword, not just word-if-both-src-and-dst- */
30/*# are-misaligned. */
31/*# */
32/*#-------------------------------------------------------------------------*/
33
34#include <linux/types.h>
35
36void *memcpy(void *pdst,
37 const void *psrc,
38 size_t pn)
39{
40 /* Ok. Now we want the parameters put in special registers.
41 Make sure the compiler is able to make something useful of this.
42 As it is now: r10 -> r13; r11 -> r11 (nop); r12 -> r12 (nop).
43
44 If gcc was allright, it really would need no temporaries, and no
45 stack space to save stuff on. */
46
47 register void *return_dst __asm__ ("r10") = pdst;
48 register char *dst __asm__ ("r13") = pdst;
49 register const char *src __asm__ ("r11") = psrc;
50 register int n __asm__ ("r12") = pn;
51
52
53 /* When src is aligned but not dst, this makes a few extra needless
54 cycles. I believe it would take as many to check that the
55 re-alignment was unnecessary. */
56 if (((unsigned long) dst & 3) != 0
57 /* Don't align if we wouldn't copy more than a few bytes; so we
58 don't have to check further for overflows. */
59 && n >= 3)
60 {
61 if ((unsigned long) dst & 1)
62 {
63 n--;
64 *(char*)dst = *(char*)src;
65 src++;
66 dst++;
67 }
68
69 if ((unsigned long) dst & 2)
70 {
71 n -= 2;
72 *(short*)dst = *(short*)src;
73 src += 2;
74 dst += 2;
75 }
76 }
77
78 /* Decide which copying method to use. Movem is dirt cheap, so the
79 overheap is low enough to always use the minimum block size as the
80 threshold. */
81 if (n >= 44)
82 {
83 /* For large copies we use 'movem' */
84
85 /* It is not optimal to tell the compiler about clobbering any
86 registers; that will move the saving/restoring of those registers
87 to the function prologue/epilogue, and make non-movem sizes
88 suboptimal. */
89 __asm__ volatile (" \n\
90 ;; Check that the register asm declaration got right. \n\
91 ;; The GCC manual explicitly says TRT will happen. \n\
92 .ifnc %0-%1-%2,$r13-$r11-$r12 \n\
93 .err \n\
94 .endif \n\
95 \n\
96 ;; Save the registers we'll use in the movem process \n\
97 \n\
98 ;; on the stack. \n\
99 subq 11*4,$sp \n\
100 movem $r10,[$sp] \n\
101 \n\
102 ;; Now we've got this: \n\
103 ;; r11 - src \n\
104 ;; r13 - dst \n\
105 ;; r12 - n \n\
106 \n\
107 ;; Update n for the first loop \n\
108 subq 44,$r12 \n\
1090: \n\
110 movem [$r11+],$r10 \n\
111 subq 44,$r12 \n\
112 bge 0b \n\
113 movem $r10,[$r13+] \n\
114 \n\
115 addq 44,$r12 ;; compensate for last loop underflowing n \n\
116 \n\
117 ;; Restore registers from stack \n\
118 movem [$sp+],$r10"
119
120 /* Outputs */ : "=r" (dst), "=r" (src), "=r" (n)
121 /* Inputs */ : "0" (dst), "1" (src), "2" (n));
122
123 }
124
125 /* Either we directly starts copying, using dword copying
126 in a loop, or we copy as much as possible with 'movem'
127 and then the last block (<44 bytes) is copied here.
128 This will work since 'movem' will have updated src,dst,n. */
129
130 while ( n >= 16 )
131 {
132 *((long*)dst)++ = *((long*)src)++;
133 *((long*)dst)++ = *((long*)src)++;
134 *((long*)dst)++ = *((long*)src)++;
135 *((long*)dst)++ = *((long*)src)++;
136 n -= 16;
137 }
138
139 /* A switch() is definitely the fastest although it takes a LOT of code.
140 * Particularly if you inline code this.
141 */
142 switch (n)
143 {
144 case 0:
145 break;
146 case 1:
147 *(char*)dst = *(char*)src;
148 break;
149 case 2:
150 *(short*)dst = *(short*)src;
151 break;
152 case 3:
153 *((short*)dst)++ = *((short*)src)++;
154 *(char*)dst = *(char*)src;
155 break;
156 case 4:
157 *((long*)dst)++ = *((long*)src)++;
158 break;
159 case 5:
160 *((long*)dst)++ = *((long*)src)++;
161 *(char*)dst = *(char*)src;
162 break;
163 case 6:
164 *((long*)dst)++ = *((long*)src)++;
165 *(short*)dst = *(short*)src;
166 break;
167 case 7:
168 *((long*)dst)++ = *((long*)src)++;
169 *((short*)dst)++ = *((short*)src)++;
170 *(char*)dst = *(char*)src;
171 break;
172 case 8:
173 *((long*)dst)++ = *((long*)src)++;
174 *((long*)dst)++ = *((long*)src)++;
175 break;
176 case 9:
177 *((long*)dst)++ = *((long*)src)++;
178 *((long*)dst)++ = *((long*)src)++;
179 *(char*)dst = *(char*)src;
180 break;
181 case 10:
182 *((long*)dst)++ = *((long*)src)++;
183 *((long*)dst)++ = *((long*)src)++;
184 *(short*)dst = *(short*)src;
185 break;
186 case 11:
187 *((long*)dst)++ = *((long*)src)++;
188 *((long*)dst)++ = *((long*)src)++;
189 *((short*)dst)++ = *((short*)src)++;
190 *(char*)dst = *(char*)src;
191 break;
192 case 12:
193 *((long*)dst)++ = *((long*)src)++;
194 *((long*)dst)++ = *((long*)src)++;
195 *((long*)dst)++ = *((long*)src)++;
196 break;
197 case 13:
198 *((long*)dst)++ = *((long*)src)++;
199 *((long*)dst)++ = *((long*)src)++;
200 *((long*)dst)++ = *((long*)src)++;
201 *(char*)dst = *(char*)src;
202 break;
203 case 14:
204 *((long*)dst)++ = *((long*)src)++;
205 *((long*)dst)++ = *((long*)src)++;
206 *((long*)dst)++ = *((long*)src)++;
207 *(short*)dst = *(short*)src;
208 break;
209 case 15:
210 *((long*)dst)++ = *((long*)src)++;
211 *((long*)dst)++ = *((long*)src)++;
212 *((long*)dst)++ = *((long*)src)++;
213 *((short*)dst)++ = *((short*)src)++;
214 *(char*)dst = *(char*)src;
215 break;
216 }
217
218 return return_dst; /* destination pointer. */
219} /* memcpy() */
diff --git a/arch/cris/arch-v32/lib/usercopy.c b/arch/cris/arch-v32/lib/usercopy.c
new file mode 100644
index 000000000000..f0b08460c1be
--- /dev/null
+++ b/arch/cris/arch-v32/lib/usercopy.c
@@ -0,0 +1,470 @@
1/*
2 * User address space access functions.
3 * The non-inlined parts of asm-cris/uaccess.h are here.
4 *
5 * Copyright (C) 2000, 2003 Axis Communications AB.
6 *
7 * Written by Hans-Peter Nilsson.
8 * Pieces used from memcpy, originally by Kenny Ranerup long time ago.
9 */
10
11#include <asm/uaccess.h>
12
13/* Asm:s have been tweaked (within the domain of correctness) to give
14 satisfactory results for "gcc version 3.2.1 Axis release R53/1.53-v32".
15
16 Check regularly...
17
18 Note that for CRISv32, the PC saved at a bus-fault is the address
19 *at* the faulting instruction, with a special case for instructions
20 in delay slots: then it's the address of the branch. Note also that
21 in contrast to v10, a postincrement in the instruction is *not*
22 performed at a bus-fault; the register is seen having the original
23 value in fault handlers. */
24
25
26/* Copy to userspace. This is based on the memcpy used for
27 kernel-to-kernel copying; see "string.c". */
28
29unsigned long
30__copy_user (void __user *pdst, const void *psrc, unsigned long pn)
31{
32 /* We want the parameters put in special registers.
33 Make sure the compiler is able to make something useful of this.
34 As it is now: r10 -> r13; r11 -> r11 (nop); r12 -> r12 (nop).
35
36 FIXME: Comment for old gcc version. Check.
37 If gcc was allright, it really would need no temporaries, and no
38 stack space to save stuff on. */
39
40 register char *dst __asm__ ("r13") = pdst;
41 register const char *src __asm__ ("r11") = psrc;
42 register int n __asm__ ("r12") = pn;
43 register int retn __asm__ ("r10") = 0;
44
45
46 /* When src is aligned but not dst, this makes a few extra needless
47 cycles. I believe it would take as many to check that the
48 re-alignment was unnecessary. */
49 if (((unsigned long) dst & 3) != 0
50 /* Don't align if we wouldn't copy more than a few bytes; so we
51 don't have to check further for overflows. */
52 && n >= 3)
53 {
54 if ((unsigned long) dst & 1)
55 {
56 __asm_copy_to_user_1 (dst, src, retn);
57 n--;
58 }
59
60 if ((unsigned long) dst & 2)
61 {
62 __asm_copy_to_user_2 (dst, src, retn);
63 n -= 2;
64 }
65 }
66
67 /* Movem is dirt cheap. The overheap is low enough to always use the
68 minimum possible block size as the threshold. */
69 if (n >= 44)
70 {
71 /* For large copies we use 'movem'. */
72
73 /* It is not optimal to tell the compiler about clobbering any
74 registers; that will move the saving/restoring of those registers
75 to the function prologue/epilogue, and make non-movem sizes
76 suboptimal. */
77 __asm__ volatile ("\
78 ;; Check that the register asm declaration got right. \n\
79 ;; The GCC manual explicitly says TRT will happen. \n\
80 .ifnc %0%1%2%3,$r13$r11$r12$r10 \n\
81 .err \n\
82 .endif \n\
83 \n\
84 ;; Save the registers we'll use in the movem process \n\
85 ;; on the stack. \n\
86 subq 11*4,$sp \n\
87 movem $r10,[$sp] \n\
88 \n\
89 ;; Now we've got this: \n\
90 ;; r11 - src \n\
91 ;; r13 - dst \n\
92 ;; r12 - n \n\
93 \n\
94 ;; Update n for the first loop \n\
95 subq 44,$r12 \n\
960: \n\
97 movem [$r11+],$r10 \n\
98 subq 44,$r12 \n\
991: bge 0b \n\
100 movem $r10,[$r13+] \n\
1013: \n\
102 addq 44,$r12 ;; compensate for last loop underflowing n \n\
103 \n\
104 ;; Restore registers from stack \n\
105 movem [$sp+],$r10 \n\
1062: \n\
107 .section .fixup,\"ax\" \n\
1084: \n\
109; When failing on any of the 1..44 bytes in a chunk, we adjust back the \n\
110; source pointer and just drop through to the by-16 and by-4 loops to \n\
111; get the correct number of failing bytes. This necessarily means a \n\
112; few extra exceptions, but invalid user pointers shouldn't happen in \n\
113; time-critical code anyway. \n\
114 jump 3b \n\
115 subq 44,$r11 \n\
116 \n\
117 .previous \n\
118 .section __ex_table,\"a\" \n\
119 .dword 1b,4b \n\
120 .previous"
121
122 /* Outputs */ : "=r" (dst), "=r" (src), "=r" (n), "=r" (retn)
123 /* Inputs */ : "0" (dst), "1" (src), "2" (n), "3" (retn));
124
125 }
126
127 while (n >= 16)
128 {
129 __asm_copy_to_user_16 (dst, src, retn);
130 n -= 16;
131 }
132
133 /* Having a separate by-four loops cuts down on cache footprint.
134 FIXME: Test with and without; increasing switch to be 0..15. */
135 while (n >= 4)
136 {
137 __asm_copy_to_user_4 (dst, src, retn);
138 n -= 4;
139 }
140
141 switch (n)
142 {
143 case 0:
144 break;
145 case 1:
146 __asm_copy_to_user_1 (dst, src, retn);
147 break;
148 case 2:
149 __asm_copy_to_user_2 (dst, src, retn);
150 break;
151 case 3:
152 __asm_copy_to_user_3 (dst, src, retn);
153 break;
154 }
155
156 return retn;
157}
158
159/* Copy from user to kernel, zeroing the bytes that were inaccessible in
160 userland. The return-value is the number of bytes that were
161 inaccessible. */
162
163unsigned long
164__copy_user_zeroing (void __user *pdst, const void *psrc, unsigned long pn)
165{
166 /* We want the parameters put in special registers.
167 Make sure the compiler is able to make something useful of this.
168 As it is now: r10 -> r13; r11 -> r11 (nop); r12 -> r12 (nop).
169
170 FIXME: Comment for old gcc version. Check.
171 If gcc was allright, it really would need no temporaries, and no
172 stack space to save stuff on. */
173
174 register char *dst __asm__ ("r13") = pdst;
175 register const char *src __asm__ ("r11") = psrc;
176 register int n __asm__ ("r12") = pn;
177 register int retn __asm__ ("r10") = 0;
178
179 /* The best reason to align src is that we then know that a read-fault
180 was for aligned bytes; there's no 1..3 remaining good bytes to
181 pickle. */
182 if (((unsigned long) src & 3) != 0)
183 {
184 if (((unsigned long) src & 1) && n != 0)
185 {
186 __asm_copy_from_user_1 (dst, src, retn);
187 n--;
188 }
189
190 if (((unsigned long) src & 2) && n >= 2)
191 {
192 __asm_copy_from_user_2 (dst, src, retn);
193 n -= 2;
194 }
195
196 /* We only need one check after the unalignment-adjustments, because
197 if both adjustments were done, either both or neither reference
198 had an exception. */
199 if (retn != 0)
200 goto copy_exception_bytes;
201 }
202
203 /* Movem is dirt cheap. The overheap is low enough to always use the
204 minimum possible block size as the threshold. */
205 if (n >= 44)
206 {
207 /* It is not optimal to tell the compiler about clobbering any
208 registers; that will move the saving/restoring of those registers
209 to the function prologue/epilogue, and make non-movem sizes
210 suboptimal. */
211 __asm__ volatile ("\
212 .ifnc %0%1%2%3,$r13$r11$r12$r10 \n\
213 .err \n\
214 .endif \n\
215 \n\
216 ;; Save the registers we'll use in the movem process \n\
217 ;; on the stack. \n\
218 subq 11*4,$sp \n\
219 movem $r10,[$sp] \n\
220 \n\
221 ;; Now we've got this: \n\
222 ;; r11 - src \n\
223 ;; r13 - dst \n\
224 ;; r12 - n \n\
225 \n\
226 ;; Update n for the first loop \n\
227 subq 44,$r12 \n\
2280: \n\
229 movem [$r11+],$r10 \n\
230 \n\
231 subq 44,$r12 \n\
232 bge 0b \n\
233 movem $r10,[$r13+] \n\
234 \n\
2354: \n\
236 addq 44,$r12 ;; compensate for last loop underflowing n \n\
237 \n\
238 ;; Restore registers from stack \n\
239 movem [$sp+],$r10 \n\
240 .section .fixup,\"ax\" \n\
241 \n\
242;; Do not jump back into the loop if we fail. For some uses, we get a \n\
243;; page fault somewhere on the line. Without checking for page limits, \n\
244;; we don't know where, but we need to copy accurately and keep an \n\
245;; accurate count; not just clear the whole line. To do that, we fall \n\
246;; down in the code below, proceeding with smaller amounts. It should \n\
247;; be kept in mind that we have to cater to code like what at one time \n\
248;; was in fs/super.c: \n\
249;; i = size - copy_from_user((void *)page, data, size); \n\
250;; which would cause repeated faults while clearing the remainder of \n\
251;; the SIZE bytes at PAGE after the first fault. \n\
252;; A caveat here is that we must not fall through from a failing page \n\
253;; to a valid page. \n\
254 \n\
2553: \n\
256 jump 4b ;; Fall through, pretending the fault didn't happen. \n\
257 nop \n\
258 \n\
259 .previous \n\
260 .section __ex_table,\"a\" \n\
261 .dword 0b,3b \n\
262 .previous"
263
264 /* Outputs */ : "=r" (dst), "=r" (src), "=r" (n), "=r" (retn)
265 /* Inputs */ : "0" (dst), "1" (src), "2" (n), "3" (retn));
266 }
267
268 /* Either we directly start copying here, using dword copying in a loop,
269 or we copy as much as possible with 'movem' and then the last block
270 (<44 bytes) is copied here. This will work since 'movem' will have
271 updated src, dst and n. (Except with failing src.)
272
273 Since we want to keep src accurate, we can't use
274 __asm_copy_from_user_N with N != (1, 2, 4); it updates dst and
275 retn, but not src (by design; it's value is ignored elsewhere). */
276
277 while (n >= 4)
278 {
279 __asm_copy_from_user_4 (dst, src, retn);
280 n -= 4;
281
282 if (retn)
283 goto copy_exception_bytes;
284 }
285
286 /* If we get here, there were no memory read faults. */
287 switch (n)
288 {
289 /* These copies are at least "naturally aligned" (so we don't have
290 to check each byte), due to the src alignment code before the
291 movem loop. The *_3 case *will* get the correct count for retn. */
292 case 0:
293 /* This case deliberately left in (if you have doubts check the
294 generated assembly code). */
295 break;
296 case 1:
297 __asm_copy_from_user_1 (dst, src, retn);
298 break;
299 case 2:
300 __asm_copy_from_user_2 (dst, src, retn);
301 break;
302 case 3:
303 __asm_copy_from_user_3 (dst, src, retn);
304 break;
305 }
306
307 /* If we get here, retn correctly reflects the number of failing
308 bytes. */
309 return retn;
310
311copy_exception_bytes:
312 /* We already have "retn" bytes cleared, and need to clear the
313 remaining "n" bytes. A non-optimized simple byte-for-byte in-line
314 memset is preferred here, since this isn't speed-critical code and
315 we'd rather have this a leaf-function than calling memset. */
316 {
317 char *endp;
318 for (endp = dst + n; dst < endp; dst++)
319 *dst = 0;
320 }
321
322 return retn + n;
323}
324
325/* Zero userspace. */
326
327unsigned long
328__do_clear_user (void __user *pto, unsigned long pn)
329{
330 /* We want the parameters put in special registers.
331 Make sure the compiler is able to make something useful of this.
332 As it is now: r10 -> r13; r11 -> r11 (nop); r12 -> r12 (nop).
333
334 FIXME: Comment for old gcc version. Check.
335 If gcc was allright, it really would need no temporaries, and no
336 stack space to save stuff on. */
337
338 register char *dst __asm__ ("r13") = pto;
339 register int n __asm__ ("r12") = pn;
340 register int retn __asm__ ("r10") = 0;
341
342
343 if (((unsigned long) dst & 3) != 0
344 /* Don't align if we wouldn't copy more than a few bytes. */
345 && n >= 3)
346 {
347 if ((unsigned long) dst & 1)
348 {
349 __asm_clear_1 (dst, retn);
350 n--;
351 }
352
353 if ((unsigned long) dst & 2)
354 {
355 __asm_clear_2 (dst, retn);
356 n -= 2;
357 }
358 }
359
360 /* Decide which copying method to use.
361 FIXME: This number is from the "ordinary" kernel memset. */
362 if (n >= 48)
363 {
364 /* For large clears we use 'movem' */
365
366 /* It is not optimal to tell the compiler about clobbering any
367 call-saved registers; that will move the saving/restoring of
368 those registers to the function prologue/epilogue, and make
369 non-movem sizes suboptimal.
370
371 This method is not foolproof; it assumes that the "asm reg"
372 declarations at the beginning of the function really are used
373 here (beware: they may be moved to temporary registers).
374 This way, we do not have to save/move the registers around into
375 temporaries; we can safely use them straight away.
376
377 If you want to check that the allocation was right; then
378 check the equalities in the first comment. It should say
379 something like "r13=r13, r11=r11, r12=r12". */
380 __asm__ volatile ("\
381 .ifnc %0%1%2,$r13$r12$r10 \n\
382 .err \n\
383 .endif \n\
384 \n\
385 ;; Save the registers we'll clobber in the movem process \n\
386 ;; on the stack. Don't mention them to gcc, it will only be \n\
387 ;; upset. \n\
388 subq 11*4,$sp \n\
389 movem $r10,[$sp] \n\
390 \n\
391 clear.d $r0 \n\
392 clear.d $r1 \n\
393 clear.d $r2 \n\
394 clear.d $r3 \n\
395 clear.d $r4 \n\
396 clear.d $r5 \n\
397 clear.d $r6 \n\
398 clear.d $r7 \n\
399 clear.d $r8 \n\
400 clear.d $r9 \n\
401 clear.d $r10 \n\
402 clear.d $r11 \n\
403 \n\
404 ;; Now we've got this: \n\
405 ;; r13 - dst \n\
406 ;; r12 - n \n\
407 \n\
408 ;; Update n for the first loop \n\
409 subq 12*4,$r12 \n\
4100: \n\
411 subq 12*4,$r12 \n\
4121: \n\
413 bge 0b \n\
414 movem $r11,[$r13+] \n\
415 \n\
416 addq 12*4,$r12 ;; compensate for last loop underflowing n \n\
417 \n\
418 ;; Restore registers from stack \n\
419 movem [$sp+],$r10 \n\
4202: \n\
421 .section .fixup,\"ax\" \n\
4223: \n\
423 movem [$sp],$r10 \n\
424 addq 12*4,$r10 \n\
425 addq 12*4,$r13 \n\
426 movem $r10,[$sp] \n\
427 jump 0b \n\
428 clear.d $r10 \n\
429 \n\
430 .previous \n\
431 .section __ex_table,\"a\" \n\
432 .dword 1b,3b \n\
433 .previous"
434
435 /* Outputs */ : "=r" (dst), "=r" (n), "=r" (retn)
436 /* Inputs */ : "0" (dst), "1" (n), "2" (retn)
437 /* Clobber */ : "r11");
438 }
439
440 while (n >= 16)
441 {
442 __asm_clear_16 (dst, retn);
443 n -= 16;
444 }
445
446 /* Having a separate by-four loops cuts down on cache footprint.
447 FIXME: Test with and without; increasing switch to be 0..15. */
448 while (n >= 4)
449 {
450 __asm_clear_4 (dst, retn);
451 n -= 4;
452 }
453
454 switch (n)
455 {
456 case 0:
457 break;
458 case 1:
459 __asm_clear_1 (dst, retn);
460 break;
461 case 2:
462 __asm_clear_2 (dst, retn);
463 break;
464 case 3:
465 __asm_clear_3 (dst, retn);
466 break;
467 }
468
469 return retn;
470}
diff --git a/arch/cris/arch-v32/mm/Makefile b/arch/cris/arch-v32/mm/Makefile
new file mode 100644
index 000000000000..9146f88484b1
--- /dev/null
+++ b/arch/cris/arch-v32/mm/Makefile
@@ -0,0 +1,3 @@
1# Makefile for the Linux/cris parts of the memory manager.
2
3obj-y := mmu.o init.o tlb.o intmem.o
diff --git a/arch/cris/arch-v32/mm/init.c b/arch/cris/arch-v32/mm/init.c
new file mode 100644
index 000000000000..f2fba27d822c
--- /dev/null
+++ b/arch/cris/arch-v32/mm/init.c
@@ -0,0 +1,174 @@
1/*
2 * Set up paging and the MMU.
3 *
4 * Copyright (C) 2000-2003, Axis Communications AB.
5 *
6 * Authors: Bjorn Wesen <bjornw@axis.com>
7 * Tobias Anderberg <tobiasa@axis.com>, CRISv32 port.
8 */
9#include <linux/config.h>
10#include <linux/mmzone.h>
11#include <linux/init.h>
12#include <linux/bootmem.h>
13#include <linux/mm.h>
14#include <linux/config.h>
15#include <asm/pgtable.h>
16#include <asm/page.h>
17#include <asm/types.h>
18#include <asm/mmu.h>
19#include <asm/io.h>
20#include <asm/mmu_context.h>
21#include <asm/arch/hwregs/asm/mmu_defs_asm.h>
22#include <asm/arch/hwregs/supp_reg.h>
23
24extern void tlb_init(void);
25
26/*
27 * The kernel is already mapped with linear mapping at kseg_c so there's no
28 * need to map it with a page table. However, head.S also temporarily mapped it
29 * at kseg_4 thus the ksegs are set up again. Also clear the TLB and do various
30 * other paging stuff.
31 */
32void __init
33cris_mmu_init(void)
34{
35 unsigned long mmu_config;
36 unsigned long mmu_kbase_hi;
37 unsigned long mmu_kbase_lo;
38 unsigned short mmu_page_id;
39
40 /*
41 * Make sure the current pgd table points to something sane, even if it
42 * is most probably not used until the next switch_mm.
43 */
44 per_cpu(current_pgd, smp_processor_id()) = init_mm.pgd;
45
46#ifdef CONFIG_SMP
47 {
48 pgd_t **pgd;
49 pgd = (pgd_t**)&per_cpu(current_pgd, smp_processor_id());
50 SUPP_BANK_SEL(1);
51 SUPP_REG_WR(RW_MM_TLB_PGD, pgd);
52 SUPP_BANK_SEL(2);
53 SUPP_REG_WR(RW_MM_TLB_PGD, pgd);
54 }
55#endif
56
57 /* Initialise the TLB. Function found in tlb.c. */
58 tlb_init();
59
60 /* Enable exceptions and initialize the kernel segments. */
61 mmu_config = ( REG_STATE(mmu, rw_mm_cfg, we, on) |
62 REG_STATE(mmu, rw_mm_cfg, acc, on) |
63 REG_STATE(mmu, rw_mm_cfg, ex, on) |
64 REG_STATE(mmu, rw_mm_cfg, inv, on) |
65 REG_STATE(mmu, rw_mm_cfg, seg_f, linear) |
66 REG_STATE(mmu, rw_mm_cfg, seg_e, linear) |
67 REG_STATE(mmu, rw_mm_cfg, seg_d, page) |
68 REG_STATE(mmu, rw_mm_cfg, seg_c, linear) |
69 REG_STATE(mmu, rw_mm_cfg, seg_b, linear) |
70#ifndef CONFIG_ETRAXFS_SIM
71 REG_STATE(mmu, rw_mm_cfg, seg_a, page) |
72#else
73 REG_STATE(mmu, rw_mm_cfg, seg_a, linear) |
74#endif
75 REG_STATE(mmu, rw_mm_cfg, seg_9, page) |
76 REG_STATE(mmu, rw_mm_cfg, seg_8, page) |
77 REG_STATE(mmu, rw_mm_cfg, seg_7, page) |
78 REG_STATE(mmu, rw_mm_cfg, seg_6, page) |
79 REG_STATE(mmu, rw_mm_cfg, seg_5, page) |
80 REG_STATE(mmu, rw_mm_cfg, seg_4, page) |
81 REG_STATE(mmu, rw_mm_cfg, seg_3, page) |
82 REG_STATE(mmu, rw_mm_cfg, seg_2, page) |
83 REG_STATE(mmu, rw_mm_cfg, seg_1, page) |
84 REG_STATE(mmu, rw_mm_cfg, seg_0, page));
85
86 mmu_kbase_hi = ( REG_FIELD(mmu, rw_mm_kbase_hi, base_f, 0x0) |
87 REG_FIELD(mmu, rw_mm_kbase_hi, base_e, 0x8) |
88 REG_FIELD(mmu, rw_mm_kbase_hi, base_d, 0x0) |
89#ifndef CONFIG_ETRAXFS_SIM
90 REG_FIELD(mmu, rw_mm_kbase_hi, base_c, 0x4) |
91#else
92 REG_FIELD(mmu, rw_mm_kbase_hi, base_c, 0x0) |
93#endif
94 REG_FIELD(mmu, rw_mm_kbase_hi, base_b, 0xb) |
95#ifndef CONFIG_ETRAXFS_SIM
96 REG_FIELD(mmu, rw_mm_kbase_hi, base_a, 0x0) |
97#else
98 REG_FIELD(mmu, rw_mm_kbase_hi, base_a, 0xa) |
99#endif
100 REG_FIELD(mmu, rw_mm_kbase_hi, base_9, 0x0) |
101 REG_FIELD(mmu, rw_mm_kbase_hi, base_8, 0x0));
102
103 mmu_kbase_lo = ( REG_FIELD(mmu, rw_mm_kbase_lo, base_7, 0x0) |
104 REG_FIELD(mmu, rw_mm_kbase_lo, base_6, 0x0) |
105 REG_FIELD(mmu, rw_mm_kbase_lo, base_5, 0x0) |
106 REG_FIELD(mmu, rw_mm_kbase_lo, base_4, 0x0) |
107 REG_FIELD(mmu, rw_mm_kbase_lo, base_3, 0x0) |
108 REG_FIELD(mmu, rw_mm_kbase_lo, base_2, 0x0) |
109 REG_FIELD(mmu, rw_mm_kbase_lo, base_1, 0x0) |
110 REG_FIELD(mmu, rw_mm_kbase_lo, base_0, 0x0));
111
112 mmu_page_id = REG_FIELD(mmu, rw_mm_tlb_hi, pid, 0);
113
114 /* Update the instruction MMU. */
115 SUPP_BANK_SEL(BANK_IM);
116 SUPP_REG_WR(RW_MM_CFG, mmu_config);
117 SUPP_REG_WR(RW_MM_KBASE_HI, mmu_kbase_hi);
118 SUPP_REG_WR(RW_MM_KBASE_LO, mmu_kbase_lo);
119 SUPP_REG_WR(RW_MM_TLB_HI, mmu_page_id);
120
121 /* Update the data MMU. */
122 SUPP_BANK_SEL(BANK_DM);
123 SUPP_REG_WR(RW_MM_CFG, mmu_config);
124 SUPP_REG_WR(RW_MM_KBASE_HI, mmu_kbase_hi);
125 SUPP_REG_WR(RW_MM_KBASE_LO, mmu_kbase_lo);
126 SUPP_REG_WR(RW_MM_TLB_HI, mmu_page_id);
127
128 SPEC_REG_WR(SPEC_REG_PID, 0);
129
130 /*
131 * The MMU has been enabled ever since head.S but just to make it
132 * totally obvious enable it here as well.
133 */
134 SUPP_BANK_SEL(BANK_GC);
135 SUPP_REG_WR(RW_GC_CFG, 0xf); /* IMMU, DMMU, ICache, DCache on */
136}
137
138void __init
139paging_init(void)
140{
141 int i;
142 unsigned long zones_size[MAX_NR_ZONES];
143
144 printk("Setting up paging and the MMU.\n");
145
146 /* Clear out the init_mm.pgd that will contain the kernel's mappings. */
147 for(i = 0; i < PTRS_PER_PGD; i++)
148 swapper_pg_dir[i] = __pgd(0);
149
150 cris_mmu_init();
151
152 /*
153 * Initialize the bad page table and bad page to point to a couple of
154 * allocated pages.
155 */
156 empty_zero_page = (unsigned long) alloc_bootmem_pages(PAGE_SIZE);
157 memset((void *) empty_zero_page, 0, PAGE_SIZE);
158
159 /* All pages are DMA'able in Etrax, so put all in the DMA'able zone. */
160 zones_size[0] = ((unsigned long) high_memory - PAGE_OFFSET) >> PAGE_SHIFT;
161
162 for (i = 1; i < MAX_NR_ZONES; i++)
163 zones_size[i] = 0;
164
165 /*
166 * Use free_area_init_node instead of free_area_init, because it is
167 * designed for systems where the DRAM starts at an address
168 * substantially higher than 0, like us (we start at PAGE_OFFSET). This
169 * saves space in the mem_map page array.
170 */
171 free_area_init_node(0, &contig_page_data, zones_size, PAGE_OFFSET >> PAGE_SHIFT, 0);
172
173 mem_map = contig_page_data.node_mem_map;
174}
diff --git a/arch/cris/arch-v32/mm/intmem.c b/arch/cris/arch-v32/mm/intmem.c
new file mode 100644
index 000000000000..41ee7f7997fd
--- /dev/null
+++ b/arch/cris/arch-v32/mm/intmem.c
@@ -0,0 +1,139 @@
1/*
2 * Simple allocator for internal RAM in ETRAX FS
3 *
4 * Copyright (c) 2004 Axis Communications AB.
5 */
6
7#include <linux/list.h>
8#include <linux/slab.h>
9#include <asm/io.h>
10#include <asm/arch/memmap.h>
11
12#define STATUS_FREE 0
13#define STATUS_ALLOCATED 1
14
15struct intmem_allocation {
16 struct list_head entry;
17 unsigned int size;
18 unsigned offset;
19 char status;
20};
21
22
23static struct list_head intmem_allocations;
24static void* intmem_virtual;
25
26static void crisv32_intmem_init(void)
27{
28 static int initiated = 0;
29 if (!initiated) {
30 struct intmem_allocation* alloc =
31 (struct intmem_allocation*)kmalloc(sizeof *alloc, GFP_KERNEL);
32 INIT_LIST_HEAD(&intmem_allocations);
33 intmem_virtual = ioremap(MEM_INTMEM_START, MEM_INTMEM_SIZE);
34 initiated = 1;
35 alloc->size = MEM_INTMEM_SIZE;
36 alloc->offset = 0;
37 alloc->status = STATUS_FREE;
38 list_add_tail(&alloc->entry, &intmem_allocations);
39 }
40}
41
42void* crisv32_intmem_alloc(unsigned size, unsigned align)
43{
44 struct intmem_allocation* allocation;
45 struct intmem_allocation* tmp;
46 void* ret = NULL;
47
48 preempt_disable();
49 crisv32_intmem_init();
50
51 list_for_each_entry_safe(allocation, tmp, &intmem_allocations, entry) {
52 int alignment = allocation->offset % align;
53 alignment = alignment ? align - alignment : alignment;
54
55 if (allocation->status == STATUS_FREE &&
56 allocation->size >= size + alignment) {
57 if (allocation->size > size + alignment) {
58 struct intmem_allocation* alloc =
59 (struct intmem_allocation*)
60 kmalloc(sizeof *alloc, GFP_ATOMIC);
61 alloc->status = STATUS_FREE;
62 alloc->size = allocation->size - size - alignment;
63 alloc->offset = allocation->offset + size;
64 list_add(&alloc->entry, &allocation->entry);
65
66 if (alignment) {
67 struct intmem_allocation* tmp;
68 tmp = (struct intmem_allocation*)
69 kmalloc(sizeof *tmp, GFP_ATOMIC);
70 tmp->offset = allocation->offset;
71 tmp->size = alignment;
72 tmp->status = STATUS_FREE;
73 allocation->offset += alignment;
74 list_add_tail(&tmp->entry, &allocation->entry);
75 }
76 }
77 allocation->status = STATUS_ALLOCATED;
78 allocation->size = size;
79 ret = (void*)((int)intmem_virtual + allocation->offset);
80 }
81 }
82 preempt_enable();
83 return ret;
84}
85
86void crisv32_intmem_free(void* addr)
87{
88 struct intmem_allocation* allocation;
89 struct intmem_allocation* tmp;
90
91 if (addr == NULL)
92 return;
93
94 preempt_disable();
95 crisv32_intmem_init();
96
97 list_for_each_entry_safe(allocation, tmp, &intmem_allocations, entry) {
98 if (allocation->offset == (int)(addr - intmem_virtual)) {
99 struct intmem_allocation* prev =
100 list_entry(allocation->entry.prev,
101 struct intmem_allocation, entry);
102 struct intmem_allocation* next =
103 list_entry(allocation->entry.next,
104 struct intmem_allocation, entry);
105
106 allocation->status = STATUS_FREE;
107 /* Join with prev and/or next if also free */
108 if (prev->status == STATUS_FREE) {
109 prev->size += allocation->size;
110 list_del(&allocation->entry);
111 kfree(allocation);
112 allocation = prev;
113 }
114 if (next->status == STATUS_FREE) {
115 allocation->size += next->size;
116 list_del(&next->entry);
117 kfree(next);
118 }
119 preempt_enable();
120 return;
121 }
122 }
123 preempt_enable();
124}
125
126void* crisv32_intmem_phys_to_virt(unsigned long addr)
127{
128 return (void*)(addr - MEM_INTMEM_START+
129 (unsigned long)intmem_virtual);
130}
131
132unsigned long crisv32_intmem_virt_to_phys(void* addr)
133{
134 return (unsigned long)((unsigned long )addr -
135 (unsigned long)intmem_virtual + MEM_INTMEM_START);
136}
137
138
139
diff --git a/arch/cris/arch-v32/mm/mmu.S b/arch/cris/arch-v32/mm/mmu.S
new file mode 100644
index 000000000000..27b70e5006af
--- /dev/null
+++ b/arch/cris/arch-v32/mm/mmu.S
@@ -0,0 +1,141 @@
1/*
2 * Copyright (C) 2003 Axis Communications AB
3 *
4 * Authors: Mikael Starvik (starvik@axis.com)
5 *
6 * Code for the fault low-level handling routines.
7 *
8 */
9
10#include <asm/page.h>
11#include <asm/pgtable.h>
12
13; Save all register. Must save in same order as struct pt_regs.
14.macro SAVE_ALL
15 subq 12, $sp
16 move $erp, [$sp]
17 subq 4, $sp
18 move $srp, [$sp]
19 subq 4, $sp
20 move $ccs, [$sp]
21 subq 4, $sp
22 move $spc, [$sp]
23 subq 4, $sp
24 move $mof, [$sp]
25 subq 4, $sp
26 move $srs, [$sp]
27 subq 4, $sp
28 move.d $acr, [$sp]
29 subq 14*4, $sp
30 movem $r13, [$sp]
31 subq 4, $sp
32 move.d $r10, [$sp]
33.endm
34
35; Bus fault handler. Extracts relevant information and calls mm subsystem
36; to handle the fault.
37.macro MMU_BUS_FAULT_HANDLER handler, mmu, we, ex
38 .globl \handler
39\handler:
40 SAVE_ALL
41 move \mmu, $srs ; Select MMU support register bank
42 move.d $sp, $r11 ; regs
43 moveq 1, $r12 ; protection fault
44 moveq \we, $r13 ; write exception?
45 orq \ex << 1, $r13 ; execute?
46 move $s3, $r10 ; rw_mm_cause
47 and.d ~8191, $r10 ; Get faulting page start address
48
49 jsr do_page_fault
50 nop
51 ba ret_from_intr
52 nop
53.endm
54
55; Refill handler. Three cases may occur:
56; 1. PMD and PTE exists in mm subsystem but not in TLB
57; 2. PMD exists but not PTE
58; 3. PMD doesn't exist
59; The code below handles case 1 and calls the mm subsystem for case 2 and 3.
60; Do not touch this code without very good reasons and extensive testing.
61; Note that the code is optimized to minimize stalls (makes the code harder
62; to read).
63;
64; Each page is 8 KB. Each PMD holds 8192/4 PTEs (each PTE is 4 bytes) so each
65; PMD holds 16 MB of virtual memory.
66; Bits 0-12 : Offset within a page
67; Bits 13-23 : PTE offset within a PMD
68; Bits 24-31 : PMD offset within the PGD
69
70.macro MMU_REFILL_HANDLER handler, mmu
71 .globl \handler
72\handler:
73 subq 4, $sp
74; (The pipeline stalls for one cycle; $sp used as address in the next cycle.)
75 move $srs, [$sp]
76 subq 4, $sp
77 move \mmu, $srs ; Select MMU support register bank
78 move.d $acr, [$sp]
79 subq 4, $sp
80 move.d $r0, [$sp]
81#ifdef CONFIG_SMP
82 move $s7, $acr ; PGD
83#else
84 move.d per_cpu__current_pgd, $acr ; PGD
85#endif
86 ; Look up PMD in PGD
87 move $s3, $r0 ; rw_mm_cause
88 lsrq 24, $r0 ; Get PMD index into PGD (bit 24-31)
89 move.d [$acr], $acr ; PGD for the current process
90 addi $r0.d, $acr, $acr
91 move $s3, $r0 ; rw_mm_cause
92 move.d [$acr], $acr ; Get PMD
93 beq 1f
94 ; Look up PTE in PMD
95 lsrq PAGE_SHIFT, $r0
96 and.w PAGE_MASK, $acr ; Remove PMD flags
97 and.d 0x7ff, $r0 ; Get PTE index into PMD (bit 13-23)
98 addi $r0.d, $acr, $acr
99 move.d [$acr], $acr ; Get PTE
100 beq 2f
101 move.d [$sp+], $r0 ; Pop r0 in delayslot
102 ; Store in TLB
103 move $acr, $s5
104 ; Return
105 move.d [$sp+], $acr
106 move [$sp], $srs
107 addq 4, $sp
108 rete
109 rfe
1101: ; PMD missing, let the mm subsystem fix it up.
111 move.d [$sp+], $r0 ; Pop r0
1122: ; PTE missing, let the mm subsystem fix it up.
113 move.d [$sp+], $acr
114 move [$sp], $srs
115 addq 4, $sp
116 SAVE_ALL
117 move \mmu, $srs
118 move.d $sp, $r11 ; regs
119 clear.d $r12 ; Not a protection fault
120 move.w PAGE_MASK, $acr
121 move $s3, $r10 ; rw_mm_cause
122 btstq 9, $r10 ; Check if write access
123 smi $r13
124 and.w PAGE_MASK, $r10 ; Get VPN (virtual address)
125 jsr do_page_fault
126 and.w $acr, $r10
127 ; Return
128 ba ret_from_intr
129 nop
130.endm
131
132 ; This is the MMU bus fault handlers.
133
134MMU_REFILL_HANDLER i_mmu_refill, 1
135MMU_BUS_FAULT_HANDLER i_mmu_invalid, 1, 0, 0
136MMU_BUS_FAULT_HANDLER i_mmu_access, 1, 0, 0
137MMU_BUS_FAULT_HANDLER i_mmu_execute, 1, 0, 1
138MMU_REFILL_HANDLER d_mmu_refill, 2
139MMU_BUS_FAULT_HANDLER d_mmu_invalid, 2, 0, 0
140MMU_BUS_FAULT_HANDLER d_mmu_access, 2, 0, 0
141MMU_BUS_FAULT_HANDLER d_mmu_write, 2, 1, 0
diff --git a/arch/cris/arch-v32/mm/tlb.c b/arch/cris/arch-v32/mm/tlb.c
new file mode 100644
index 000000000000..8233406798d3
--- /dev/null
+++ b/arch/cris/arch-v32/mm/tlb.c
@@ -0,0 +1,208 @@
1/*
2 * Low level TLB handling.
3 *
4 * Copyright (C) 2000-2003, Axis Communications AB.
5 *
6 * Authors: Bjorn Wesen <bjornw@axis.com>
7 * Tobias Anderberg <tobiasa@axis.com>, CRISv32 port.
8 */
9
10#include <asm/tlb.h>
11#include <asm/mmu_context.h>
12#include <asm/arch/hwregs/asm/mmu_defs_asm.h>
13#include <asm/arch/hwregs/supp_reg.h>
14
15#define UPDATE_TLB_SEL_IDX(val) \
16do { \
17 unsigned long tlb_sel; \
18 \
19 tlb_sel = REG_FIELD(mmu, rw_mm_tlb_sel, idx, val); \
20 SUPP_REG_WR(RW_MM_TLB_SEL, tlb_sel); \
21} while(0)
22
23#define UPDATE_TLB_HILO(tlb_hi, tlb_lo) \
24do { \
25 SUPP_REG_WR(RW_MM_TLB_HI, tlb_hi); \
26 SUPP_REG_WR(RW_MM_TLB_LO, tlb_lo); \
27} while(0)
28
29/*
30 * The TLB can host up to 256 different mm contexts at the same time. The running
31 * context is found in the PID register. Each TLB entry contains a page_id that
32 * has to match the PID register to give a hit. page_id_map keeps track of which
33 * mm's is assigned to which page_id's, making sure it's known when to
34 * invalidate TLB entries.
35 *
36 * The last page_id is never running, it is used as an invalid page_id so that
37 * it's possible to make TLB entries that will nerver match.
38 *
39 * Note; the flushes needs to be atomic otherwise an interrupt hander that uses
40 * vmalloc'ed memory might cause a TLB load in the middle of a flush.
41 */
42
43/* Flush all TLB entries. */
44void
45__flush_tlb_all(void)
46{
47 int i;
48 int mmu;
49 unsigned long flags;
50 unsigned long mmu_tlb_hi;
51 unsigned long mmu_tlb_sel;
52
53 /*
54 * Mask with 0xf so similar TLB entries aren't written in the same 4-way
55 * entry group.
56 */
57 local_save_flags(flags);
58 local_irq_disable();
59
60 for (mmu = 1; mmu <= 2; mmu++) {
61 SUPP_BANK_SEL(mmu); /* Select the MMU */
62 for (i = 0; i < NUM_TLB_ENTRIES; i++) {
63 /* Store invalid entry */
64 mmu_tlb_sel = REG_FIELD(mmu, rw_mm_tlb_sel, idx, i);
65
66 mmu_tlb_hi = (REG_FIELD(mmu, rw_mm_tlb_hi, pid, INVALID_PAGEID)
67 | REG_FIELD(mmu, rw_mm_tlb_hi, vpn, i & 0xf));
68
69 SUPP_REG_WR(RW_MM_TLB_SEL, mmu_tlb_sel);
70 SUPP_REG_WR(RW_MM_TLB_HI, mmu_tlb_hi);
71 SUPP_REG_WR(RW_MM_TLB_LO, 0);
72 }
73 }
74
75 local_irq_restore(flags);
76}
77
78/* Flush an entire user address space. */
79void
80__flush_tlb_mm(struct mm_struct *mm)
81{
82 int i;
83 int mmu;
84 unsigned long flags;
85 unsigned long page_id;
86 unsigned long tlb_hi;
87 unsigned long mmu_tlb_hi;
88
89 page_id = mm->context.page_id;
90
91 if (page_id == NO_CONTEXT)
92 return;
93
94 /* Mark the TLB entries that match the page_id as invalid. */
95 local_save_flags(flags);
96 local_irq_disable();
97
98 for (mmu = 1; mmu <= 2; mmu++) {
99 SUPP_BANK_SEL(mmu);
100 for (i = 0; i < NUM_TLB_ENTRIES; i++) {
101 UPDATE_TLB_SEL_IDX(i);
102
103 /* Get the page_id */
104 SUPP_REG_RD(RW_MM_TLB_HI, tlb_hi);
105
106 /* Check if the page_id match. */
107 if ((tlb_hi & 0xff) == page_id) {
108 mmu_tlb_hi = (REG_FIELD(mmu, rw_mm_tlb_hi, pid,
109 INVALID_PAGEID)
110 | REG_FIELD(mmu, rw_mm_tlb_hi, vpn,
111 i & 0xf));
112
113 UPDATE_TLB_HILO(mmu_tlb_hi, 0);
114 }
115 }
116 }
117
118 local_irq_restore(flags);
119}
120
121/* Invalidate a single page. */
122void
123__flush_tlb_page(struct vm_area_struct *vma, unsigned long addr)
124{
125 int i;
126 int mmu;
127 unsigned long page_id;
128 unsigned long flags;
129 unsigned long tlb_hi;
130 unsigned long mmu_tlb_hi;
131
132 page_id = vma->vm_mm->context.page_id;
133
134 if (page_id == NO_CONTEXT)
135 return;
136
137 addr &= PAGE_MASK;
138
139 /*
140 * Invalidate those TLB entries that match both the mm context and the
141 * requested virtual address.
142 */
143 local_save_flags(flags);
144 local_irq_disable();
145
146 for (mmu = 1; mmu <= 2; mmu++) {
147 SUPP_BANK_SEL(mmu);
148 for (i = 0; i < NUM_TLB_ENTRIES; i++) {
149 UPDATE_TLB_SEL_IDX(i);
150 SUPP_REG_RD(RW_MM_TLB_HI, tlb_hi);
151
152 /* Check if page_id and address matches */
153 if (((tlb_hi & 0xff) == page_id) &&
154 ((tlb_hi & PAGE_MASK) == addr)) {
155 mmu_tlb_hi = REG_FIELD(mmu, rw_mm_tlb_hi, pid,
156 INVALID_PAGEID) | addr;
157
158 UPDATE_TLB_HILO(mmu_tlb_hi, 0);
159 }
160 }
161 }
162
163 local_irq_restore(flags);
164}
165
166/*
167 * Initialize the context related info for a new mm_struct
168 * instance.
169 */
170
171int
172init_new_context(struct task_struct *tsk, struct mm_struct *mm)
173{
174 mm->context.page_id = NO_CONTEXT;
175 return 0;
176}
177
178/* Called in schedule() just before actually doing the switch_to. */
179void
180switch_mm(struct mm_struct *prev, struct mm_struct *next,
181 struct task_struct *tsk)
182{
183 int cpu = smp_processor_id();
184
185 /* Make sure there is a MMU context. */
186 spin_lock(&next->page_table_lock);
187 get_mmu_context(next);
188 cpu_set(cpu, next->cpu_vm_mask);
189 spin_unlock(&next->page_table_lock);
190
191 /*
192 * Remember the pgd for the fault handlers. Keep a seperate copy of it
193 * because current and active_mm might be invalid at points where
194 * there's still a need to derefer the pgd.
195 */
196 per_cpu(current_pgd, cpu) = next->pgd;
197
198 /* Switch context in the MMU. */
199 if (tsk && tsk->thread_info)
200 {
201 SPEC_REG_WR(SPEC_REG_PID, next->context.page_id | tsk->thread_info->tls);
202 }
203 else
204 {
205 SPEC_REG_WR(SPEC_REG_PID, next->context.page_id);
206 }
207}
208
diff --git a/arch/cris/arch-v32/output_arch.ld b/arch/cris/arch-v32/output_arch.ld
new file mode 100644
index 000000000000..d60a57db0ec2
--- /dev/null
+++ b/arch/cris/arch-v32/output_arch.ld
@@ -0,0 +1,2 @@
1/* At the time of this writing, there's no equivalent ld option. */
2OUTPUT_ARCH (crisv32)
diff --git a/arch/cris/arch-v32/vmlinux.lds.S b/arch/cris/arch-v32/vmlinux.lds.S
new file mode 100644
index 000000000000..adb94605d92a
--- /dev/null
+++ b/arch/cris/arch-v32/vmlinux.lds.S
@@ -0,0 +1,134 @@
1/* ld script to make the Linux/CRIS kernel
2 * Authors: Bjorn Wesen (bjornw@axis.com)
3 *
4 * It is VERY DANGEROUS to fiddle around with the symbols in this
5 * script. It is for example quite vital that all generated sections
6 * that are used are actually named here, otherwise the linker will
7 * put them at the end, where the init stuff is which is FREED after
8 * the kernel has booted.
9 */
10
11#include <linux/config.h>
12#include <asm-generic/vmlinux.lds.h>
13
14jiffies = jiffies_64;
15SECTIONS
16{
17 . = DRAM_VIRTUAL_BASE;
18 dram_start = .;
19 ebp_start = .;
20
21 /* The boot section is only necessary until the VCS top level testbench */
22 /* includes both flash and DRAM. */
23 .boot : { *(.boot) }
24
25 . = DRAM_VIRTUAL_BASE + 0x4000; /* See head.S and pages reserved at the start. */
26
27 _text = .; /* Text and read-only data. */
28 text_start = .; /* Lots of aliases. */
29 _stext = .;
30 __stext = .;
31 .text : {
32 *(.text)
33 SCHED_TEXT
34 LOCK_TEXT
35 *(.fixup)
36 *(.text.__*)
37 }
38
39 _etext = . ; /* End of text section. */
40 __etext = .;
41
42 . = ALIGN(4); /* Exception table. */
43 __start___ex_table = .;
44 __ex_table : { *(__ex_table) }
45 __stop___ex_table = .;
46
47 RODATA
48
49 . = ALIGN (4);
50 ___data_start = . ;
51 __Sdata = . ;
52 .data : { /* Data */
53 *(.data)
54 }
55 __edata = . ; /* End of data section. */
56 _edata = . ;
57
58 . = ALIGN(8192); /* init_task and stack, must be aligned. */
59 .data.init_task : { *(.data.init_task) }
60
61 . = ALIGN(8192); /* Init code and data. */
62 __init_begin = .;
63 .init.text : {
64 _sinittext = .;
65 *(.init.text)
66 _einittext = .;
67 }
68 .init.data : { *(.init.data) }
69 . = ALIGN(16);
70 __setup_start = .;
71 .init.setup : { *(.init.setup) }
72 __setup_end = .;
73 __start___param = .;
74 __param : { *(__param) }
75 __stop___param = .;
76 .initcall.init : {
77 __initcall_start = .;
78 *(.initcall1.init);
79 *(.initcall2.init);
80 *(.initcall3.init);
81 *(.initcall4.init);
82 *(.initcall5.init);
83 *(.initcall6.init);
84 *(.initcall7.init);
85 __initcall_end = .;
86 }
87
88 .con_initcall.init : {
89 __con_initcall_start = .;
90 *(.con_initcall.init)
91 __con_initcall_end = .;
92 }
93 SECURITY_INIT
94
95 __per_cpu_start = .;
96 .data.percpu : { *(.data.percpu) }
97 __per_cpu_end = .;
98
99 .init.ramfs : {
100 __initramfs_start = .;
101 *(.init.ramfs)
102 __initramfs_end = .;
103 /*
104 * We fill to the next page, so we can discard all init
105 * pages without needing to consider what payload might be
106 * appended to the kernel image.
107 */
108 FILL (0);
109 . = ALIGN (8192);
110 }
111
112 __vmlinux_end = .; /* Last address of the physical file. */
113 __init_end = .;
114
115 __data_end = . ; /* Move to _edata? */
116 __bss_start = .; /* BSS. */
117 .bss : {
118 *(COMMON)
119 *(.bss)
120 }
121
122 . = ALIGN (0x20);
123 _end = .;
124 __end = .;
125
126 /* Sections to be discarded */
127 /DISCARD/ : {
128 *(.text.exit)
129 *(.data.exit)
130 *(.exitcall.exit)
131 }
132
133 dram_end = dram_start + CONFIG_ETRAX_DRAM_SIZE*1024*1024;
134}
diff --git a/arch/cris/defconfig b/arch/cris/defconfig
index 32c9c987dbaa..142a10818af3 100644
--- a/arch/cris/defconfig
+++ b/arch/cris/defconfig
@@ -1,22 +1,27 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.11
4# Mon Jun 20 13:42:02 2005
3# 5#
4CONFIG_MMU=y 6CONFIG_MMU=y
5CONFIG_UID16=y 7CONFIG_UID16=y
6CONFIG_RWSEM_GENERIC_SPINLOCK=y 8CONFIG_RWSEM_GENERIC_SPINLOCK=y
9CONFIG_GENERIC_IOMAP=y
10CONFIG_GENERIC_CALIBRATE_DELAY=y
11CONFIG_CRIS=y
7 12
8# 13#
9# Code maturity level options 14# Code maturity level options
10# 15#
11CONFIG_EXPERIMENTAL=y 16CONFIG_EXPERIMENTAL=y
12CONFIG_CLEAN_COMPILE=y 17CONFIG_CLEAN_COMPILE=y
13CONFIG_STANDALONE=y
14CONFIG_BROKEN_ON_SMP=y 18CONFIG_BROKEN_ON_SMP=y
15 19
16# 20#
17# General setup 21# General setup
18# 22#
19CONFIG_SWAP=y 23CONFIG_LOCALVERSION=""
24# CONFIG_SWAP is not set
20# CONFIG_SYSVIPC is not set 25# CONFIG_SYSVIPC is not set
21# CONFIG_POSIX_MQUEUE is not set 26# CONFIG_POSIX_MQUEUE is not set
22# CONFIG_BSD_PROCESS_ACCT is not set 27# CONFIG_BSD_PROCESS_ACCT is not set
@@ -24,16 +29,19 @@ CONFIG_SYSCTL=y
24# CONFIG_AUDIT is not set 29# CONFIG_AUDIT is not set
25CONFIG_LOG_BUF_SHIFT=14 30CONFIG_LOG_BUF_SHIFT=14
26# CONFIG_HOTPLUG is not set 31# CONFIG_HOTPLUG is not set
32CONFIG_KOBJECT_UEVENT=y
27# CONFIG_IKCONFIG is not set 33# CONFIG_IKCONFIG is not set
28CONFIG_EMBEDDED=y 34CONFIG_EMBEDDED=y
29# CONFIG_KALLSYMS is not set 35# CONFIG_KALLSYMS is not set
30CONFIG_FUTEX=y 36CONFIG_FUTEX=y
31CONFIG_EPOLL=y 37CONFIG_EPOLL=y
32CONFIG_IOSCHED_NOOP=y
33CONFIG_IOSCHED_AS=y
34CONFIG_IOSCHED_DEADLINE=y
35CONFIG_IOSCHED_CFQ=y
36# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set 38# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
39CONFIG_SHMEM=y
40CONFIG_CC_ALIGN_FUNCTIONS=0
41CONFIG_CC_ALIGN_LABELS=0
42CONFIG_CC_ALIGN_LOOPS=0
43CONFIG_CC_ALIGN_JUMPS=0
44# CONFIG_TINY_SHMEM is not set
37 45
38# 46#
39# Loadable module support 47# Loadable module support
@@ -45,23 +53,28 @@ CONFIG_IOSCHED_CFQ=y
45# 53#
46CONFIG_BINFMT_ELF=y 54CONFIG_BINFMT_ELF=y
47# CONFIG_BINFMT_MISC is not set 55# CONFIG_BINFMT_MISC is not set
56CONFIG_GENERIC_HARDIRQS=y
57# CONFIG_SMP is not set
48CONFIG_ETRAX_CMDLINE="root=/dev/mtdblock3 init=/linuxrc" 58CONFIG_ETRAX_CMDLINE="root=/dev/mtdblock3 init=/linuxrc"
49CONFIG_ETRAX_WATCHDOG=y 59# CONFIG_ETRAX_WATCHDOG is not set
50CONFIG_ETRAX_WATCHDOG_NICE_DOGGY=y
51CONFIG_ETRAX_FAST_TIMER=y 60CONFIG_ETRAX_FAST_TIMER=y
52# CONFIG_PREEMPT is not set 61# CONFIG_PREEMPT is not set
62# CONFIG_OOM_REBOOT is not set
53 63
54# 64#
55# Hardware setup 65# Hardware setup
56# 66#
57CONFIG_ETRAX100LX=y 67# CONFIG_ETRAX100LX is not set
58# CONFIG_ETRAX100LX_V2 is not set 68CONFIG_ETRAX100LX_V2=y
59# CONFIG_SVINTO_SIM is not set 69# CONFIG_SVINTO_SIM is not set
70# CONFIG_ETRAXFS is not set
71# CONFIG_ETRAXFS_SIM is not set
60CONFIG_ETRAX_ARCH_V10=y 72CONFIG_ETRAX_ARCH_V10=y
61CONFIG_ETRAX_DRAM_SIZE=16 73# CONFIG_ETRAX_ARCH_V32 is not set
74CONFIG_ETRAX_DRAM_SIZE=32
62CONFIG_ETRAX_FLASH_BUSWIDTH=2 75CONFIG_ETRAX_FLASH_BUSWIDTH=2
63CONFIG_CRIS_LOW_MAP=y 76CONFIG_ETRAX_FLASH1_SIZE=4
64CONFIG_ETRAX_DRAM_VIRTUAL_BASE=60000000 77CONFIG_ETRAX_DRAM_VIRTUAL_BASE=c0000000
65CONFIG_ETRAX_PA_LEDS=y 78CONFIG_ETRAX_PA_LEDS=y
66# CONFIG_ETRAX_PB_LEDS is not set 79# CONFIG_ETRAX_PB_LEDS is not set
67# CONFIG_ETRAX_CSP0_LEDS is not set 80# CONFIG_ETRAX_CSP0_LEDS is not set
@@ -81,13 +94,13 @@ CONFIG_ETRAX_RESCUE_SER0=y
81# CONFIG_ETRAX_RESCUE_SER1 is not set 94# CONFIG_ETRAX_RESCUE_SER1 is not set
82# CONFIG_ETRAX_RESCUE_SER2 is not set 95# CONFIG_ETRAX_RESCUE_SER2 is not set
83# CONFIG_ETRAX_RESCUE_SER3 is not set 96# CONFIG_ETRAX_RESCUE_SER3 is not set
84CONFIG_ETRAX_DEF_R_WAITSTATES=0x95f8 97CONFIG_ETRAX_DEF_R_WAITSTATES=0x95a6
85CONFIG_ETRAX_DEF_R_BUS_CONFIG=0x104 98CONFIG_ETRAX_DEF_R_BUS_CONFIG=0x4
86CONFIG_ETRAX_SDRAM=y 99CONFIG_ETRAX_SDRAM=y
87CONFIG_ETRAX_DEF_R_SDRAM_CONFIG=0x00e03636 100CONFIG_ETRAX_DEF_R_SDRAM_CONFIG=0x09e05757
88CONFIG_ETRAX_DEF_R_SDRAM_TIMING=0x80008002 101CONFIG_ETRAX_DEF_R_SDRAM_TIMING=0x80008002
89CONFIG_ETRAX_DEF_R_PORT_PA_DIR=0x1d 102CONFIG_ETRAX_DEF_R_PORT_PA_DIR=0x1d
90CONFIG_ETRAX_DEF_R_PORT_PA_DATA=0xf0 103CONFIG_ETRAX_DEF_R_PORT_PA_DATA=0x00
91CONFIG_ETRAX_DEF_R_PORT_PB_CONFIG=0x00 104CONFIG_ETRAX_DEF_R_PORT_PB_CONFIG=0x00
92CONFIG_ETRAX_DEF_R_PORT_PB_DIR=0x1e 105CONFIG_ETRAX_DEF_R_PORT_PB_DIR=0x1e
93CONFIG_ETRAX_DEF_R_PORT_PB_DATA=0xf3 106CONFIG_ETRAX_DEF_R_PORT_PB_DATA=0xf3
@@ -97,16 +110,17 @@ CONFIG_ETRAX_DEF_R_PORT_PB_DATA=0xf3
97# Drivers for built-in interfaces 110# Drivers for built-in interfaces
98# 111#
99CONFIG_ETRAX_ETHERNET=y 112CONFIG_ETRAX_ETHERNET=y
100CONFIG_NET_ETHERNET=y
101# CONFIG_ETRAX_NETWORK_LED_ON_WHEN_LINK is not set 113# CONFIG_ETRAX_NETWORK_LED_ON_WHEN_LINK is not set
102CONFIG_ETRAX_NETWORK_LED_ON_WHEN_ACTIVITY=y 114CONFIG_ETRAX_NETWORK_LED_ON_WHEN_ACTIVITY=y
103CONFIG_ETRAX_SERIAL=y 115CONFIG_ETRAX_SERIAL=y
104CONFIG_ETRAX_SERIAL_FAST_TIMER=y 116# CONFIG_ETRAX_SERIAL_FAST_TIMER is not set
117# CONFIG_ETRAX_SERIAL_FLUSH_DMA_FAST is not set
118CONFIG_ETRAX_SERIAL_RX_TIMEOUT_TICKS=5
105CONFIG_ETRAX_SERIAL_PORT0=y 119CONFIG_ETRAX_SERIAL_PORT0=y
106# CONFIG_CONFIG_ETRAX_SERIAL_PORT0_NO_DMA_OUT is not set 120# CONFIG_ETRAX_SERIAL_PORT0_NO_DMA_OUT is not set
107CONFIG_CONFIG_ETRAX_SERIAL_PORT0_DMA6_OUT=y 121CONFIG_ETRAX_SERIAL_PORT0_DMA6_OUT=y
108# CONFIG_CONFIG_ETRAX_SERIAL_PORT0_NO_DMA_IN is not set 122# CONFIG_ETRAX_SERIAL_PORT0_NO_DMA_IN is not set
109CONFIG_CONFIG_ETRAX_SERIAL_PORT0_DMA7_IN=y 123CONFIG_ETRAX_SERIAL_PORT0_DMA7_IN=y
110CONFIG_ETRAX_SER0_DTR_RI_DSR_CD_ON_NONE=y 124CONFIG_ETRAX_SER0_DTR_RI_DSR_CD_ON_NONE=y
111# CONFIG_ETRAX_SER0_DTR_RI_DSR_CD_ON_PA is not set 125# CONFIG_ETRAX_SER0_DTR_RI_DSR_CD_ON_PA is not set
112# CONFIG_ETRAX_SER0_DTR_RI_DSR_CD_ON_PB is not set 126# CONFIG_ETRAX_SER0_DTR_RI_DSR_CD_ON_PB is not set
@@ -121,10 +135,10 @@ CONFIG_ETRAX_SER0_DSR_ON_PB_BIT=-1
121CONFIG_ETRAX_SER0_CD_ON_PB_BIT=-1 135CONFIG_ETRAX_SER0_CD_ON_PB_BIT=-1
122# CONFIG_ETRAX_SERIAL_PORT1 is not set 136# CONFIG_ETRAX_SERIAL_PORT1 is not set
123CONFIG_ETRAX_SERIAL_PORT2=y 137CONFIG_ETRAX_SERIAL_PORT2=y
124# CONFIG_CONFIG_ETRAX_SERIAL_PORT2_NO_DMA_OUT is not set 138# CONFIG_ETRAX_SERIAL_PORT2_NO_DMA_OUT is not set
125CONFIG_CONFIG_ETRAX_SERIAL_PORT2_DMA2_OUT=y 139CONFIG_ETRAX_SERIAL_PORT2_DMA2_OUT=y
126# CONFIG_CONFIG_ETRAX_SERIAL_PORT2_NO_DMA_IN is not set 140# CONFIG_ETRAX_SERIAL_PORT2_NO_DMA_IN is not set
127CONFIG_CONFIG_ETRAX_SERIAL_PORT2_DMA3_IN=y 141CONFIG_ETRAX_SERIAL_PORT2_DMA3_IN=y
128CONFIG_ETRAX_SER2_DTR_RI_DSR_CD_ON_NONE=y 142CONFIG_ETRAX_SER2_DTR_RI_DSR_CD_ON_NONE=y
129# CONFIG_ETRAX_SER2_DTR_RI_DSR_CD_ON_PA is not set 143# CONFIG_ETRAX_SER2_DTR_RI_DSR_CD_ON_PA is not set
130# CONFIG_ETRAX_SER2_DTR_RI_DSR_CD_ON_PB is not set 144# CONFIG_ETRAX_SER2_DTR_RI_DSR_CD_ON_PB is not set
@@ -138,44 +152,51 @@ CONFIG_ETRAX_SER2_RI_ON_PB_BIT=-1
138CONFIG_ETRAX_SER2_DSR_ON_PB_BIT=-1 152CONFIG_ETRAX_SER2_DSR_ON_PB_BIT=-1
139CONFIG_ETRAX_SER2_CD_ON_PB_BIT=-1 153CONFIG_ETRAX_SER2_CD_ON_PB_BIT=-1
140# CONFIG_ETRAX_SERIAL_PORT3 is not set 154# CONFIG_ETRAX_SERIAL_PORT3 is not set
141# CONFIG_ETRAX_RS485 is not set 155CONFIG_ETRAX_RS485=y
142# CONFIG_ETRAX_IDE is not set 156# CONFIG_ETRAX_RS485_ON_PA is not set
143# CONFIG_IDE is not set 157# CONFIG_ETRAX_RS485_DISABLE_RECEIVER is not set
144# CONFIG_ETRAX_USB_HOST is not set 158CONFIG_ETRAX_IDE=y
159CONFIG_ETRAX_IDE_DELAY=15
160CONFIG_ETRAX_IDE_PB7_RESET=y
161# CONFIG_ETRAX_IDE_G27_RESET is not set
162CONFIG_ETRAX_USB_HOST=y
163CONFIG_ETRAX_USB_HOST_PORT1=y
164CONFIG_ETRAX_USB_HOST_PORT2=y
145CONFIG_ETRAX_AXISFLASHMAP=y 165CONFIG_ETRAX_AXISFLASHMAP=y
146CONFIG_ETRAX_PTABLE_SECTOR=65536 166CONFIG_ETRAX_PTABLE_SECTOR=65536
147CONFIG_MTD=y
148CONFIG_MTD_CFI=y
149CONFIG_MTD_CFI_AMDSTD=y
150CONFIG_MTD_OBSOLETE_CHIPS=y
151CONFIG_MTD_AMDSTD=y
152CONFIG_MTD_CHAR=y
153CONFIG_MTD_BLOCK=y
154CONFIG_MTD_PARTITIONS=y
155CONFIG_MTD_CONCAT=y
156# CONFIG_ETRAX_I2C is not set 167# CONFIG_ETRAX_I2C is not set
157CONFIG_ETRAX_GPIO=y 168# CONFIG_ETRAX_GPIO is not set
158CONFIG_ETRAX_PA_BUTTON_BITMASK=0x02 169CONFIG_ETRAX_RTC=y
159CONFIG_ETRAX_PA_CHANGEABLE_DIR=0x00 170CONFIG_ETRAX_DS1302=y
160CONFIG_ETRAX_PA_CHANGEABLE_BITS=0xFF 171# CONFIG_ETRAX_PCF8563 is not set
161CONFIG_ETRAX_PB_CHANGEABLE_DIR=0x00 172CONFIG_ETRAX_DS1302_RST_ON_GENERIC_PORT=y
162CONFIG_ETRAX_PB_CHANGEABLE_BITS=0xFF 173CONFIG_ETRAX_DS1302_RSTBIT=0
163# CONFIG_ETRAX_RTC is not set 174CONFIG_ETRAX_DS1302_SCLBIT=1
175CONFIG_ETRAX_DS1302_SDABIT=0
176CONFIG_ETRAX_DS1302_TRICKLE_CHARGE=0
164 177
165# 178#
166# Generic Driver Options 179# Generic Driver Options
167# 180#
181CONFIG_STANDALONE=y
182CONFIG_PREVENT_FIRMWARE_BUILD=y
183# CONFIG_FW_LOADER is not set
168 184
169# 185#
170# Memory Technology Devices (MTD) 186# Memory Technology Devices (MTD)
171# 187#
188CONFIG_MTD=y
172# CONFIG_MTD_DEBUG is not set 189# CONFIG_MTD_DEBUG is not set
190CONFIG_MTD_PARTITIONS=y
191CONFIG_MTD_CONCAT=y
173# CONFIG_MTD_REDBOOT_PARTS is not set 192# CONFIG_MTD_REDBOOT_PARTS is not set
174# CONFIG_MTD_CMDLINE_PARTS is not set 193# CONFIG_MTD_CMDLINE_PARTS is not set
175 194
176# 195#
177# User Modules And Translation Layers 196# User Modules And Translation Layers
178# 197#
198CONFIG_MTD_CHAR=y
199CONFIG_MTD_BLOCK=y
179# CONFIG_FTL is not set 200# CONFIG_FTL is not set
180# CONFIG_NFTL is not set 201# CONFIG_NFTL is not set
181# CONFIG_INFTL is not set 202# CONFIG_INFTL is not set
@@ -183,14 +204,30 @@ CONFIG_ETRAX_PB_CHANGEABLE_BITS=0xFF
183# 204#
184# RAM/ROM/Flash chip drivers 205# RAM/ROM/Flash chip drivers
185# 206#
207CONFIG_MTD_CFI=y
186# CONFIG_MTD_JEDECPROBE is not set 208# CONFIG_MTD_JEDECPROBE is not set
187CONFIG_MTD_GEN_PROBE=y 209CONFIG_MTD_GEN_PROBE=y
188# CONFIG_MTD_CFI_ADV_OPTIONS is not set 210# CONFIG_MTD_CFI_ADV_OPTIONS is not set
211CONFIG_MTD_MAP_BANK_WIDTH_1=y
212CONFIG_MTD_MAP_BANK_WIDTH_2=y
213CONFIG_MTD_MAP_BANK_WIDTH_4=y
214# CONFIG_MTD_MAP_BANK_WIDTH_8 is not set
215# CONFIG_MTD_MAP_BANK_WIDTH_16 is not set
216# CONFIG_MTD_MAP_BANK_WIDTH_32 is not set
217CONFIG_MTD_CFI_I1=y
218CONFIG_MTD_CFI_I2=y
219# CONFIG_MTD_CFI_I4 is not set
220# CONFIG_MTD_CFI_I8 is not set
189# CONFIG_MTD_CFI_INTELEXT is not set 221# CONFIG_MTD_CFI_INTELEXT is not set
222CONFIG_MTD_CFI_AMDSTD=y
223CONFIG_MTD_CFI_AMDSTD_RETRY=0
190# CONFIG_MTD_CFI_STAA is not set 224# CONFIG_MTD_CFI_STAA is not set
225CONFIG_MTD_CFI_UTIL=y
191CONFIG_MTD_RAM=y 226CONFIG_MTD_RAM=y
192# CONFIG_MTD_ROM is not set 227# CONFIG_MTD_ROM is not set
193# CONFIG_MTD_ABSENT is not set 228# CONFIG_MTD_ABSENT is not set
229CONFIG_MTD_OBSOLETE_CHIPS=y
230CONFIG_MTD_AMDSTD=y
194# CONFIG_MTD_SHARP is not set 231# CONFIG_MTD_SHARP is not set
195# CONFIG_MTD_JEDEC is not set 232# CONFIG_MTD_JEDEC is not set
196 233
@@ -204,11 +241,13 @@ CONFIG_MTD_COMPLEX_MAPPINGS=y
204# Self-contained MTD device drivers 241# Self-contained MTD device drivers
205# 242#
206# CONFIG_MTD_SLRAM is not set 243# CONFIG_MTD_SLRAM is not set
244# CONFIG_MTD_PHRAM is not set
207CONFIG_MTD_MTDRAM=y 245CONFIG_MTD_MTDRAM=y
208CONFIG_MTDRAM_TOTAL_SIZE=0 246CONFIG_MTDRAM_TOTAL_SIZE=0
209CONFIG_MTDRAM_ERASE_SIZE=64 247CONFIG_MTDRAM_ERASE_SIZE=64
210CONFIG_MTDRAM_ABS_POS=0x0 248CONFIG_MTDRAM_ABS_POS=0x0
211# CONFIG_MTD_BLKMTD is not set 249# CONFIG_MTD_BLKMTD is not set
250# CONFIG_MTD_BLOCK2MTD is not set
212 251
213# 252#
214# Disk-On-Chip Device Drivers 253# Disk-On-Chip Device Drivers
@@ -235,11 +274,25 @@ CONFIG_MTDRAM_ABS_POS=0x0
235# Block devices 274# Block devices
236# 275#
237# CONFIG_BLK_DEV_FD is not set 276# CONFIG_BLK_DEV_FD is not set
277# CONFIG_BLK_DEV_COW_COMMON is not set
238# CONFIG_BLK_DEV_LOOP is not set 278# CONFIG_BLK_DEV_LOOP is not set
239# CONFIG_BLK_DEV_NBD is not set 279# CONFIG_BLK_DEV_NBD is not set
280# CONFIG_BLK_DEV_UB is not set
240CONFIG_BLK_DEV_RAM=y 281CONFIG_BLK_DEV_RAM=y
282CONFIG_BLK_DEV_RAM_COUNT=16
241CONFIG_BLK_DEV_RAM_SIZE=4096 283CONFIG_BLK_DEV_RAM_SIZE=4096
242# CONFIG_BLK_DEV_INITRD is not set 284# CONFIG_BLK_DEV_INITRD is not set
285CONFIG_INITRAMFS_SOURCE=""
286# CONFIG_CDROM_PKTCDVD is not set
287
288#
289# IO Schedulers
290#
291CONFIG_IOSCHED_NOOP=y
292# CONFIG_IOSCHED_AS is not set
293# CONFIG_IOSCHED_DEADLINE is not set
294CONFIG_IOSCHED_CFQ=y
295# CONFIG_ATA_OVER_ETH is not set
243 296
244# 297#
245# Multi-device support (RAID and LVM) 298# Multi-device support (RAID and LVM)
@@ -249,6 +302,28 @@ CONFIG_BLK_DEV_RAM_SIZE=4096
249# 302#
250# ATA/ATAPI/MFM/RLL support 303# ATA/ATAPI/MFM/RLL support
251# 304#
305CONFIG_IDE=y
306CONFIG_BLK_DEV_IDE=y
307
308#
309# Please see Documentation/ide.txt for help/info on IDE drives
310#
311# CONFIG_BLK_DEV_IDE_SATA is not set
312CONFIG_BLK_DEV_IDEDISK=y
313# CONFIG_IDEDISK_MULTI_MODE is not set
314CONFIG_BLK_DEV_IDECD=y
315# CONFIG_BLK_DEV_IDETAPE is not set
316# CONFIG_BLK_DEV_IDEFLOPPY is not set
317# CONFIG_IDE_TASK_IOCTL is not set
318
319#
320# IDE chipset support/bugfixes
321#
322# CONFIG_IDE_GENERIC is not set
323# CONFIG_IDE_ARM is not set
324CONFIG_BLK_DEV_IDEDMA=y
325# CONFIG_IDEDMA_AUTO is not set
326# CONFIG_BLK_DEV_HD is not set
252 327
253# 328#
254# SCSI device support 329# SCSI device support
@@ -258,7 +333,6 @@ CONFIG_BLK_DEV_RAM_SIZE=4096
258# 333#
259# IEEE 1394 (FireWire) support 334# IEEE 1394 (FireWire) support
260# 335#
261# CONFIG_IEEE1394 is not set
262 336
263# 337#
264# I2O device support 338# I2O device support
@@ -288,6 +362,9 @@ CONFIG_INET=y
288# CONFIG_INET_AH is not set 362# CONFIG_INET_AH is not set
289# CONFIG_INET_ESP is not set 363# CONFIG_INET_ESP is not set
290# CONFIG_INET_IPCOMP is not set 364# CONFIG_INET_IPCOMP is not set
365# CONFIG_INET_TUNNEL is not set
366CONFIG_IP_TCPDIAG=y
367# CONFIG_IP_TCPDIAG_IPV6 is not set
291 368
292# 369#
293# IP: Virtual Server Configuration 370# IP: Virtual Server Configuration
@@ -301,11 +378,10 @@ CONFIG_NETFILTER=y
301# IP: Netfilter Configuration 378# IP: Netfilter Configuration
302# 379#
303# CONFIG_IP_NF_CONNTRACK is not set 380# CONFIG_IP_NF_CONNTRACK is not set
381# CONFIG_IP_NF_CONNTRACK_MARK is not set
304# CONFIG_IP_NF_QUEUE is not set 382# CONFIG_IP_NF_QUEUE is not set
305# CONFIG_IP_NF_IPTABLES is not set 383# CONFIG_IP_NF_IPTABLES is not set
306# CONFIG_IP_NF_ARPTABLES is not set 384# CONFIG_IP_NF_ARPTABLES is not set
307# CONFIG_IP_NF_COMPAT_IPCHAINS is not set
308# CONFIG_IP_NF_COMPAT_IPFWADM is not set
309 385
310# 386#
311# SCTP Configuration (EXPERIMENTAL) 387# SCTP Configuration (EXPERIMENTAL)
@@ -323,12 +399,12 @@ CONFIG_NETFILTER=y
323# CONFIG_NET_DIVERT is not set 399# CONFIG_NET_DIVERT is not set
324# CONFIG_ECONET is not set 400# CONFIG_ECONET is not set
325# CONFIG_WAN_ROUTER is not set 401# CONFIG_WAN_ROUTER is not set
326# CONFIG_NET_HW_FLOWCONTROL is not set
327 402
328# 403#
329# QoS and/or fair queueing 404# QoS and/or fair queueing
330# 405#
331# CONFIG_NET_SCHED is not set 406# CONFIG_NET_SCHED is not set
407# CONFIG_NET_CLS_ROUTE is not set
332 408
333# 409#
334# Network testing 410# Network testing
@@ -338,7 +414,26 @@ CONFIG_NETFILTER=y
338# CONFIG_NET_POLL_CONTROLLER is not set 414# CONFIG_NET_POLL_CONTROLLER is not set
339# CONFIG_HAMRADIO is not set 415# CONFIG_HAMRADIO is not set
340# CONFIG_IRDA is not set 416# CONFIG_IRDA is not set
341# CONFIG_BT is not set 417CONFIG_BT=y
418CONFIG_BT_L2CAP=y
419# CONFIG_BT_SCO is not set
420CONFIG_BT_RFCOMM=y
421# CONFIG_BT_RFCOMM_TTY is not set
422CONFIG_BT_BNEP=y
423# CONFIG_BT_BNEP_MC_FILTER is not set
424# CONFIG_BT_BNEP_PROTO_FILTER is not set
425# CONFIG_BT_HIDP is not set
426
427#
428# Bluetooth device drivers
429#
430CONFIG_BT_HCIUSB=y
431# CONFIG_BT_HCIUSB_SCO is not set
432# CONFIG_BT_HCIUART is not set
433# CONFIG_BT_HCIBCM203X is not set
434# CONFIG_BT_HCIBPA10X is not set
435# CONFIG_BT_HCIBFUSB is not set
436# CONFIG_BT_HCIVHCI is not set
342CONFIG_NETDEVICES=y 437CONFIG_NETDEVICES=y
343# CONFIG_DUMMY is not set 438# CONFIG_DUMMY is not set
344# CONFIG_BONDING is not set 439# CONFIG_BONDING is not set
@@ -348,6 +443,7 @@ CONFIG_NETDEVICES=y
348# 443#
349# Ethernet (10 or 100Mbit) 444# Ethernet (10 or 100Mbit)
350# 445#
446CONFIG_NET_ETHERNET=y
351# CONFIG_MII is not set 447# CONFIG_MII is not set
352 448
353# 449#
@@ -389,11 +485,19 @@ CONFIG_NETDEVICES=y
389# 485#
390# Input device support 486# Input device support
391# 487#
392# CONFIG_INPUT is not set 488CONFIG_INPUT=y
393 489
394# 490#
395# Userland interfaces 491# Userland interfaces
396# 492#
493CONFIG_INPUT_MOUSEDEV=y
494CONFIG_INPUT_MOUSEDEV_PSAUX=y
495CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024
496CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768
497# CONFIG_INPUT_JOYDEV is not set
498# CONFIG_INPUT_TSDEV is not set
499# CONFIG_INPUT_EVDEV is not set
500# CONFIG_INPUT_EVBUG is not set
397 501
398# 502#
399# Input I/O drivers 503# Input I/O drivers
@@ -404,10 +508,25 @@ CONFIG_SERIO=y
404# CONFIG_SERIO_I8042 is not set 508# CONFIG_SERIO_I8042 is not set
405# CONFIG_SERIO_SERPORT is not set 509# CONFIG_SERIO_SERPORT is not set
406# CONFIG_SERIO_CT82C710 is not set 510# CONFIG_SERIO_CT82C710 is not set
511CONFIG_SERIO_LIBPS2=y
512# CONFIG_SERIO_RAW is not set
407 513
408# 514#
409# Input Device Drivers 515# Input Device Drivers
410# 516#
517CONFIG_INPUT_KEYBOARD=y
518CONFIG_KEYBOARD_ATKBD=y
519# CONFIG_KEYBOARD_SUNKBD is not set
520# CONFIG_KEYBOARD_LKKBD is not set
521# CONFIG_KEYBOARD_XTKBD is not set
522# CONFIG_KEYBOARD_NEWTON is not set
523CONFIG_INPUT_MOUSE=y
524CONFIG_MOUSE_PS2=y
525# CONFIG_MOUSE_SERIAL is not set
526# CONFIG_MOUSE_VSXXXAA is not set
527# CONFIG_INPUT_JOYSTICK is not set
528# CONFIG_INPUT_TOUCHSCREEN is not set
529# CONFIG_INPUT_MISC is not set
411 530
412# 531#
413# Character devices 532# Character devices
@@ -426,7 +545,6 @@ CONFIG_SERIO=y
426CONFIG_UNIX98_PTYS=y 545CONFIG_UNIX98_PTYS=y
427CONFIG_LEGACY_PTYS=y 546CONFIG_LEGACY_PTYS=y
428CONFIG_LEGACY_PTY_COUNT=256 547CONFIG_LEGACY_PTY_COUNT=256
429# CONFIG_QIC02_TAPE is not set
430 548
431# 549#
432# IPMI 550# IPMI
@@ -441,13 +559,10 @@ CONFIG_LEGACY_PTY_COUNT=256
441# CONFIG_GEN_RTC is not set 559# CONFIG_GEN_RTC is not set
442# CONFIG_DTLK is not set 560# CONFIG_DTLK is not set
443# CONFIG_R3964 is not set 561# CONFIG_R3964 is not set
444# CONFIG_APPLICOM is not set
445 562
446# 563#
447# Ftape, the floppy tape device driver 564# Ftape, the floppy tape device driver
448# 565#
449# CONFIG_FTAPE is not set
450# CONFIG_AGP is not set
451# CONFIG_DRM is not set 566# CONFIG_DRM is not set
452# CONFIG_RAW_DRIVER is not set 567# CONFIG_RAW_DRIVER is not set
453 568
@@ -469,10 +584,15 @@ CONFIG_LEGACY_PTY_COUNT=256
469# CONFIG_JBD is not set 584# CONFIG_JBD is not set
470# CONFIG_REISERFS_FS is not set 585# CONFIG_REISERFS_FS is not set
471# CONFIG_JFS_FS is not set 586# CONFIG_JFS_FS is not set
587
588#
589# XFS support
590#
472# CONFIG_XFS_FS is not set 591# CONFIG_XFS_FS is not set
473# CONFIG_MINIX_FS is not set 592# CONFIG_MINIX_FS is not set
474# CONFIG_ROMFS_FS is not set 593# CONFIG_ROMFS_FS is not set
475# CONFIG_QUOTA is not set 594# CONFIG_QUOTA is not set
595CONFIG_DNOTIFY=y
476# CONFIG_AUTOFS_FS is not set 596# CONFIG_AUTOFS_FS is not set
477# CONFIG_AUTOFS4_FS is not set 597# CONFIG_AUTOFS4_FS is not set
478 598
@@ -485,7 +605,8 @@ CONFIG_LEGACY_PTY_COUNT=256
485# 605#
486# DOS/FAT/NT Filesystems 606# DOS/FAT/NT Filesystems
487# 607#
488# CONFIG_FAT_FS is not set 608# CONFIG_MSDOS_FS is not set
609# CONFIG_VFAT_FS is not set
489# CONFIG_NTFS_FS is not set 610# CONFIG_NTFS_FS is not set
490 611
491# 612#
@@ -497,6 +618,7 @@ CONFIG_SYSFS=y
497# CONFIG_DEVFS_FS is not set 618# CONFIG_DEVFS_FS is not set
498# CONFIG_DEVPTS_FS_XATTR is not set 619# CONFIG_DEVPTS_FS_XATTR is not set
499CONFIG_TMPFS=y 620CONFIG_TMPFS=y
621# CONFIG_TMPFS_XATTR is not set
500# CONFIG_HUGETLB_PAGE is not set 622# CONFIG_HUGETLB_PAGE is not set
501CONFIG_RAMFS=y 623CONFIG_RAMFS=y
502 624
@@ -512,7 +634,15 @@ CONFIG_RAMFS=y
512# CONFIG_EFS_FS is not set 634# CONFIG_EFS_FS is not set
513CONFIG_JFFS_FS=y 635CONFIG_JFFS_FS=y
514CONFIG_JFFS_FS_VERBOSE=0 636CONFIG_JFFS_FS_VERBOSE=0
515# CONFIG_JFFS2_FS is not set 637# CONFIG_JFFS_PROC_FS is not set
638CONFIG_JFFS2_FS=y
639CONFIG_JFFS2_FS_DEBUG=0
640# CONFIG_JFFS2_FS_NAND is not set
641# CONFIG_JFFS2_FS_NOR_ECC is not set
642# CONFIG_JFFS2_COMPRESSION_OPTIONS is not set
643CONFIG_JFFS2_ZLIB=y
644CONFIG_JFFS2_RTIME=y
645# CONFIG_JFFS2_RUBIN is not set
516CONFIG_CRAMFS=y 646CONFIG_CRAMFS=y
517# CONFIG_VXFS_FS is not set 647# CONFIG_VXFS_FS is not set
518# CONFIG_HPFS_FS is not set 648# CONFIG_HPFS_FS is not set
@@ -530,14 +660,13 @@ CONFIG_NFS_V3=y
530# CONFIG_NFSD is not set 660# CONFIG_NFSD is not set
531CONFIG_LOCKD=y 661CONFIG_LOCKD=y
532CONFIG_LOCKD_V4=y 662CONFIG_LOCKD_V4=y
533# CONFIG_EXPORTFS is not set
534CONFIG_SUNRPC=y 663CONFIG_SUNRPC=y
535# CONFIG_RPCSEC_GSS_KRB5 is not set 664# CONFIG_RPCSEC_GSS_KRB5 is not set
665# CONFIG_RPCSEC_GSS_SPKM3 is not set
536# CONFIG_SMB_FS is not set 666# CONFIG_SMB_FS is not set
537# CONFIG_CIFS is not set 667# CONFIG_CIFS is not set
538# CONFIG_NCP_FS is not set 668# CONFIG_NCP_FS is not set
539# CONFIG_CODA_FS is not set 669# CONFIG_CODA_FS is not set
540# CONFIG_INTERMEZZO_FS is not set
541# CONFIG_AFS_FS is not set 670# CONFIG_AFS_FS is not set
542 671
543# 672#
@@ -557,8 +686,120 @@ CONFIG_MSDOS_PARTITION=y
557# CONFIG_SOUND is not set 686# CONFIG_SOUND is not set
558 687
559# 688#
689# PCCARD (PCMCIA/CardBus) support
690#
691# CONFIG_PCCARD is not set
692
693#
694# PC-card bridges
695#
696
697#
560# USB support 698# USB support
561# 699#
700CONFIG_USB=y
701# CONFIG_USB_DEBUG is not set
702
703#
704# Miscellaneous USB options
705#
706CONFIG_USB_DEVICEFS=y
707# CONFIG_USB_BANDWIDTH is not set
708# CONFIG_USB_DYNAMIC_MINORS is not set
709# CONFIG_USB_OTG is not set
710# CONFIG_USB_ARCH_HAS_HCD is not set
711# CONFIG_USB_ARCH_HAS_OHCI is not set
712
713#
714# USB Host Controller Drivers
715#
716# CONFIG_USB_SL811_HCD is not set
717
718#
719# USB Device Class drivers
720#
721
722#
723# USB Bluetooth TTY can only be used with disabled Bluetooth subsystem
724#
725# CONFIG_USB_ACM is not set
726# CONFIG_USB_PRINTER is not set
727
728#
729# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support' may also be needed; see USB_STORAGE Help for more information
730#
731# CONFIG_USB_STORAGE is not set
732
733#
734# USB Input Devices
735#
736# CONFIG_USB_HID is not set
737
738#
739# USB HID Boot Protocol drivers
740#
741# CONFIG_USB_KBD is not set
742# CONFIG_USB_MOUSE is not set
743# CONFIG_USB_AIPTEK is not set
744# CONFIG_USB_WACOM is not set
745# CONFIG_USB_KBTAB is not set
746# CONFIG_USB_POWERMATE is not set
747# CONFIG_USB_MTOUCH is not set
748# CONFIG_USB_EGALAX is not set
749# CONFIG_USB_XPAD is not set
750# CONFIG_USB_ATI_REMOTE is not set
751
752#
753# USB Imaging devices
754#
755# CONFIG_USB_MDC800 is not set
756
757#
758# USB Multimedia devices
759#
760# CONFIG_USB_DABUSB is not set
761
762#
763# Video4Linux support is needed for USB Multimedia device support
764#
765
766#
767# USB Network Adapters
768#
769# CONFIG_USB_CATC is not set
770# CONFIG_USB_KAWETH is not set
771# CONFIG_USB_PEGASUS is not set
772CONFIG_USB_RTL8150=y
773# CONFIG_USB_USBNET is not set
774
775#
776# USB port drivers
777#
778
779#
780# USB Serial Converter support
781#
782# CONFIG_USB_SERIAL is not set
783
784#
785# USB Miscellaneous drivers
786#
787# CONFIG_USB_EMI62 is not set
788# CONFIG_USB_EMI26 is not set
789# CONFIG_USB_AUERSWALD is not set
790# CONFIG_USB_RIO500 is not set
791# CONFIG_USB_LEGOTOWER is not set
792# CONFIG_USB_LCD is not set
793# CONFIG_USB_LED is not set
794# CONFIG_USB_CYTHERM is not set
795# CONFIG_USB_PHIDGETKIT is not set
796# CONFIG_USB_PHIDGETSERVO is not set
797# CONFIG_USB_IDMOUSE is not set
798# CONFIG_USB_TEST is not set
799
800#
801# USB ATM/DSL drivers
802#
562 803
563# 804#
564# USB Gadget Support 805# USB Gadget Support
@@ -568,14 +809,17 @@ CONFIG_MSDOS_PARTITION=y
568# 809#
569# Kernel hacking 810# Kernel hacking
570# 811#
571# CONFIG_PROFILE is not set 812# CONFIG_PROFILING is not set
813# CONFIG_SYSTEM_PROFILER is not set
572# CONFIG_ETRAX_KGDB is not set 814# CONFIG_ETRAX_KGDB is not set
573# CONFIG_DEBUG_INFO is not set 815# CONFIG_DEBUG_INFO is not set
574# CONFIG_FRAME_POINTER is not set 816# CONFIG_FRAME_POINTER is not set
817# CONFIG_DEBUG_NMI_OOPS is not set
575 818
576# 819#
577# Security options 820# Security options
578# 821#
822# CONFIG_KEYS is not set
579# CONFIG_SECURITY is not set 823# CONFIG_SECURITY is not set
580 824
581# 825#
@@ -584,8 +828,14 @@ CONFIG_MSDOS_PARTITION=y
584# CONFIG_CRYPTO is not set 828# CONFIG_CRYPTO is not set
585 829
586# 830#
831# Hardware crypto devices
832#
833
834#
587# Library routines 835# Library routines
588# 836#
589# CONFIG_CRC32 is not set 837# CONFIG_CRC_CCITT is not set
838CONFIG_CRC32=y
590# CONFIG_LIBCRC32C is not set 839# CONFIG_LIBCRC32C is not set
591CONFIG_ZLIB_INFLATE=y 840CONFIG_ZLIB_INFLATE=y
841CONFIG_ZLIB_DEFLATE=y
diff --git a/arch/cris/kernel/Makefile b/arch/cris/kernel/Makefile
index 1546a0e74047..c8e8ea570989 100644
--- a/arch/cris/kernel/Makefile
+++ b/arch/cris/kernel/Makefile
@@ -1,4 +1,4 @@
1# $Id: Makefile,v 1.10 2004/05/14 10:18:12 starvik Exp $ 1# $Id: Makefile,v 1.12 2004/10/19 13:07:43 starvik Exp $
2# 2#
3# Makefile for the linux kernel. 3# Makefile for the linux kernel.
4# 4#
@@ -10,6 +10,7 @@ obj-y := process.o traps.o irq.o ptrace.o setup.o \
10 10
11obj-$(CONFIG_MODULES) += crisksyms.o 11obj-$(CONFIG_MODULES) += crisksyms.o
12obj-$(CONFIG_MODULES) += module.o 12obj-$(CONFIG_MODULES) += module.o
13obj-$(CONFIG_SYSTEM_PROFILER) += profile.o
13 14
14clean: 15clean:
15 16
diff --git a/arch/cris/kernel/crisksyms.c b/arch/cris/kernel/crisksyms.c
index 7141bbecd7e4..85833d704ebb 100644
--- a/arch/cris/kernel/crisksyms.c
+++ b/arch/cris/kernel/crisksyms.c
@@ -27,13 +27,13 @@ extern void __Udiv(void);
27extern void __Umod(void); 27extern void __Umod(void);
28extern void __Div(void); 28extern void __Div(void);
29extern void __Mod(void); 29extern void __Mod(void);
30extern void __ashldi3(void);
30extern void __ashrdi3(void); 31extern void __ashrdi3(void);
31extern void iounmap(void *addr); 32extern void __lshrdi3(void);
33extern void iounmap(volatile void * __iomem);
32 34
33/* Platform dependent support */ 35/* Platform dependent support */
34EXPORT_SYMBOL(dump_thread); 36EXPORT_SYMBOL(dump_thread);
35EXPORT_SYMBOL(enable_irq);
36EXPORT_SYMBOL(disable_irq);
37EXPORT_SYMBOL(kernel_thread); 37EXPORT_SYMBOL(kernel_thread);
38EXPORT_SYMBOL(get_cmos_time); 38EXPORT_SYMBOL(get_cmos_time);
39EXPORT_SYMBOL(loops_per_usec); 39EXPORT_SYMBOL(loops_per_usec);
@@ -57,7 +57,9 @@ EXPORT_SYMBOL(__Udiv);
57EXPORT_SYMBOL(__Umod); 57EXPORT_SYMBOL(__Umod);
58EXPORT_SYMBOL(__Div); 58EXPORT_SYMBOL(__Div);
59EXPORT_SYMBOL(__Mod); 59EXPORT_SYMBOL(__Mod);
60EXPORT_SYMBOL(__ashldi3);
60EXPORT_SYMBOL(__ashrdi3); 61EXPORT_SYMBOL(__ashrdi3);
62EXPORT_SYMBOL(__lshrdi3);
61 63
62/* Memory functions */ 64/* Memory functions */
63EXPORT_SYMBOL(__ioremap); 65EXPORT_SYMBOL(__ioremap);
@@ -69,23 +71,10 @@ EXPORT_SYMBOL(__down);
69EXPORT_SYMBOL(__down_interruptible); 71EXPORT_SYMBOL(__down_interruptible);
70EXPORT_SYMBOL(__down_trylock); 72EXPORT_SYMBOL(__down_trylock);
71 73
72/* Export shadow registers for the CPU I/O pins */
73EXPORT_SYMBOL(genconfig_shadow);
74EXPORT_SYMBOL(port_pa_data_shadow);
75EXPORT_SYMBOL(port_pa_dir_shadow);
76EXPORT_SYMBOL(port_pb_data_shadow);
77EXPORT_SYMBOL(port_pb_dir_shadow);
78EXPORT_SYMBOL(port_pb_config_shadow);
79EXPORT_SYMBOL(port_g_data_shadow);
80
81/* Userspace access functions */ 74/* Userspace access functions */
82EXPORT_SYMBOL(__copy_user_zeroing); 75EXPORT_SYMBOL(__copy_user_zeroing);
83EXPORT_SYMBOL(__copy_user); 76EXPORT_SYMBOL(__copy_user);
84 77
85/* Cache flush functions */
86EXPORT_SYMBOL(flush_etrax_cache);
87EXPORT_SYMBOL(prepare_rx_descriptor);
88
89#undef memcpy 78#undef memcpy
90#undef memset 79#undef memset
91extern void * memset(void *, int, __kernel_size_t); 80extern void * memset(void *, int, __kernel_size_t);
diff --git a/arch/cris/kernel/irq.c b/arch/cris/kernel/irq.c
index d848b9407457..30deaf1b728a 100644
--- a/arch/cris/kernel/irq.c
+++ b/arch/cris/kernel/irq.c
@@ -12,8 +12,6 @@
12 * shouldn't result in any weird surprises, and installing new handlers 12 * shouldn't result in any weird surprises, and installing new handlers
13 * should be easier. 13 * should be easier.
14 * 14 *
15 * Notice Linux/CRIS: these routines do not care about SMP
16 *
17 */ 15 */
18 16
19/* 17/*
@@ -24,6 +22,7 @@
24#include <linux/config.h> 22#include <linux/config.h>
25#include <linux/module.h> 23#include <linux/module.h>
26#include <linux/ptrace.h> 24#include <linux/ptrace.h>
25#include <linux/irq.h>
27 26
28#include <linux/kernel_stat.h> 27#include <linux/kernel_stat.h>
29#include <linux/signal.h> 28#include <linux/signal.h>
@@ -36,84 +35,56 @@
36#include <linux/init.h> 35#include <linux/init.h>
37#include <linux/seq_file.h> 36#include <linux/seq_file.h>
38#include <linux/errno.h> 37#include <linux/errno.h>
39#include <linux/bitops.h> 38#include <linux/spinlock.h>
40 39
41#include <asm/io.h> 40#include <asm/io.h>
42 41
43/* Defined in arch specific irq.c */ 42void ack_bad_irq(unsigned int irq)
44extern void arch_setup_irq(int irq);
45extern void arch_free_irq(int irq);
46
47void
48disable_irq(unsigned int irq_nr)
49{
50 unsigned long flags;
51
52 local_save_flags(flags);
53 local_irq_disable();
54 mask_irq(irq_nr);
55 local_irq_restore(flags);
56}
57
58void
59enable_irq(unsigned int irq_nr)
60{ 43{
61 unsigned long flags; 44 printk("unexpected IRQ trap at vector %02x\n", irq);
62 local_save_flags(flags);
63 local_irq_disable();
64 unmask_irq(irq_nr);
65 local_irq_restore(flags);
66} 45}
67 46
68unsigned long
69probe_irq_on()
70{
71 return 0;
72}
73
74EXPORT_SYMBOL(probe_irq_on);
75
76int
77probe_irq_off(unsigned long x)
78{
79 return 0;
80}
81
82EXPORT_SYMBOL(probe_irq_off);
83
84/*
85 * Initial irq handlers.
86 */
87
88static struct irqaction *irq_action[NR_IRQS];
89
90int show_interrupts(struct seq_file *p, void *v) 47int show_interrupts(struct seq_file *p, void *v)
91{ 48{
92 int i = *(loff_t *) v; 49 int i = *(loff_t *) v, j;
93 struct irqaction * action; 50 struct irqaction * action;
94 unsigned long flags; 51 unsigned long flags;
95 52
53 if (i == 0) {
54 seq_printf(p, " ");
55 for (j=0; j<NR_CPUS; j++)
56 if (cpu_online(j))
57 seq_printf(p, "CPU%d ",j);
58 seq_putc(p, '\n');
59 }
60
96 if (i < NR_IRQS) { 61 if (i < NR_IRQS) {
97 local_irq_save(flags); 62 spin_lock_irqsave(&irq_desc[i].lock, flags);
98 action = irq_action[i]; 63 action = irq_desc[i].action;
99 if (!action) 64 if (!action)
100 goto skip; 65 goto skip;
101 seq_printf(p, "%2d: %10u %c %s", 66 seq_printf(p, "%3d: ",i);
102 i, kstat_this_cpu.irqs[i], 67#ifndef CONFIG_SMP
103 (action->flags & SA_INTERRUPT) ? '+' : ' ', 68 seq_printf(p, "%10u ", kstat_irqs(i));
104 action->name); 69#else
105 for (action = action->next; action; action = action->next) { 70 for (j = 0; j < NR_CPUS; j++)
106 seq_printf(p, ",%s %s", 71 if (cpu_online(j))
107 (action->flags & SA_INTERRUPT) ? " +" : "", 72 seq_printf(p, "%10u ", kstat_cpu(j).irqs[i]);
108 action->name); 73#endif
109 } 74 seq_printf(p, " %14s", irq_desc[i].handler->typename);
75 seq_printf(p, " %s", action->name);
76
77 for (action=action->next; action; action = action->next)
78 seq_printf(p, ", %s", action->name);
79
110 seq_putc(p, '\n'); 80 seq_putc(p, '\n');
111skip: 81skip:
112 local_irq_restore(flags); 82 spin_unlock_irqrestore(&irq_desc[i].lock, flags);
113 } 83 }
114 return 0; 84 return 0;
115} 85}
116 86
87
117/* called by the assembler IRQ entry functions defined in irq.h 88/* called by the assembler IRQ entry functions defined in irq.h
118 * to dispatch the interrupts to registred handlers 89 * to dispatch the interrupts to registred handlers
119 * interrupts are disabled upon entry - depending on if the 90 * interrupts are disabled upon entry - depending on if the
@@ -123,164 +94,17 @@ skip:
123 94
124asmlinkage void do_IRQ(int irq, struct pt_regs * regs) 95asmlinkage void do_IRQ(int irq, struct pt_regs * regs)
125{ 96{
126 struct irqaction *action; 97 unsigned long sp;
127 int do_random, cpu; 98 irq_enter();
128 int ret, retval = 0; 99 sp = rdsp();
129 100 if (unlikely((sp & (PAGE_SIZE - 1)) < (PAGE_SIZE/8))) {
130 cpu = smp_processor_id(); 101 printk("do_IRQ: stack overflow: %lX\n", sp);
131 irq_enter(); 102 show_stack(NULL, (unsigned long *)sp);
132 kstat_cpu(cpu).irqs[irq - FIRST_IRQ]++;
133 action = irq_action[irq - FIRST_IRQ];
134
135 if (action) {
136 if (!(action->flags & SA_INTERRUPT))
137 local_irq_enable();
138 do_random = 0;
139 do {
140 ret = action->handler(irq, action->dev_id, regs);
141 if (ret == IRQ_HANDLED)
142 do_random |= action->flags;
143 retval |= ret;
144 action = action->next;
145 } while (action);
146
147 if (retval != 1) {
148 if (retval) {
149 printk("irq event %d: bogus retval mask %x\n",
150 irq, retval);
151 } else {
152 printk("irq %d: nobody cared\n", irq);
153 }
154 }
155
156 if (do_random & SA_SAMPLE_RANDOM)
157 add_interrupt_randomness(irq);
158 local_irq_disable();
159 }
160 irq_exit();
161}
162
163/* this function links in a handler into the chain of handlers for the
164 given irq, and if the irq has never been registred, the appropriate
165 handler is entered into the interrupt vector
166*/
167
168int setup_irq(int irq, struct irqaction * new)
169{
170 int shared = 0;
171 struct irqaction *old, **p;
172 unsigned long flags;
173
174 p = irq_action + irq - FIRST_IRQ;
175 if ((old = *p) != NULL) {
176 /* Can't share interrupts unless both agree to */
177 if (!(old->flags & new->flags & SA_SHIRQ))
178 return -EBUSY;
179
180 /* Can't share interrupts unless both are same type */
181 if ((old->flags ^ new->flags) & SA_INTERRUPT)
182 return -EBUSY;
183
184 /* add new interrupt at end of irq queue */
185 do {
186 p = &old->next;
187 old = *p;
188 } while (old);
189 shared = 1;
190 }
191
192 if (new->flags & SA_SAMPLE_RANDOM)
193 rand_initialize_irq(irq);
194
195 local_save_flags(flags);
196 local_irq_disable();
197 *p = new;
198
199 if (!shared) {
200 /* if the irq wasn't registred before, enter it into the vector table
201 and unmask it physically
202 */
203 arch_setup_irq(irq);
204 unmask_irq(irq);
205 }
206
207 local_irq_restore(flags);
208 return 0;
209}
210
211/* this function is called by a driver to register an irq handler
212 Valid flags:
213 SA_INTERRUPT -> it's a fast interrupt, handler called with irq disabled and
214 no signal checking etc is performed upon exit
215 SA_SHIRQ -> the interrupt can be shared between different handlers, the handler
216 is required to check if the irq was "aimed" at it explicitely
217 SA_RANDOM -> the interrupt will add to the random generators entropy
218*/
219
220int request_irq(unsigned int irq,
221 irqreturn_t (*handler)(int, void *, struct pt_regs *),
222 unsigned long irqflags,
223 const char * devname,
224 void *dev_id)
225{
226 int retval;
227 struct irqaction * action;
228
229 if(!handler)
230 return -EINVAL;
231
232 /* allocate and fill in a handler structure and setup the irq */
233
234 action = (struct irqaction *)kmalloc(sizeof(struct irqaction), GFP_KERNEL);
235 if (!action)
236 return -ENOMEM;
237
238 action->handler = handler;
239 action->flags = irqflags;
240 cpus_clear(action->mask);
241 action->name = devname;
242 action->next = NULL;
243 action->dev_id = dev_id;
244
245 retval = setup_irq(irq, action);
246
247 if (retval)
248 kfree(action);
249 return retval;
250}
251
252EXPORT_SYMBOL(request_irq);
253
254void free_irq(unsigned int irq, void *dev_id)
255{
256 struct irqaction * action, **p;
257 unsigned long flags;
258
259 if (irq >= NR_IRQS) {
260 printk("Trying to free IRQ%d\n",irq);
261 return;
262 } 103 }
263 for (p = irq - FIRST_IRQ + irq_action; (action = *p) != NULL; p = &action->next) { 104 __do_IRQ(irq, regs);
264 if (action->dev_id != dev_id) 105 irq_exit();
265 continue;
266
267 /* Found it - now free it */
268 local_save_flags(flags);
269 local_irq_disable();
270 *p = action->next;
271 if (!irq_action[irq - FIRST_IRQ]) {
272 mask_irq(irq);
273 arch_free_irq(irq);
274 }
275 local_irq_restore(flags);
276 kfree(action);
277 return;
278 }
279 printk("Trying to free free IRQ%d\n",irq);
280} 106}
281 107
282EXPORT_SYMBOL(free_irq);
283
284void weird_irq(void) 108void weird_irq(void)
285{ 109{
286 local_irq_disable(); 110 local_irq_disable();
@@ -288,10 +112,3 @@ void weird_irq(void)
288 while(1); 112 while(1);
289} 113}
290 114
291#if defined(CONFIG_PROC_FS) && defined(CONFIG_SYSCTL)
292/* Used by other archs to show/control IRQ steering during SMP */
293void __init
294init_irq_proc(void)
295{
296}
297#endif
diff --git a/arch/cris/kernel/module.c b/arch/cris/kernel/module.c
index f1d3e784f30c..11b867df8617 100644
--- a/arch/cris/kernel/module.c
+++ b/arch/cris/kernel/module.c
@@ -32,7 +32,7 @@ void *module_alloc(unsigned long size)
32{ 32{
33 if (size == 0) 33 if (size == 0)
34 return NULL; 34 return NULL;
35 return vmalloc(size); 35 return vmalloc_exec(size);
36} 36}
37 37
38 38
@@ -59,26 +59,8 @@ int apply_relocate(Elf32_Shdr *sechdrs,
59 unsigned int relsec, 59 unsigned int relsec,
60 struct module *me) 60 struct module *me)
61{ 61{
62 unsigned int i; 62 printk(KERN_ERR "module %s: REL relocation unsupported\n", me->name);
63 Elf32_Rel *rel = (void *)sechdrs[relsec].sh_addr; 63 return -ENOEXEC;
64 Elf32_Sym *sym;
65 uint32_t *location;
66
67 DEBUGP("Applying relocate section %u to %u\n", relsec,
68 sechdrs[relsec].sh_info);
69 for (i = 0; i < sechdrs[relsec].sh_size / sizeof(*rel); i++) {
70 /* This is where to make the change */
71 location = (void *)sechdrs[sechdrs[relsec].sh_info].sh_offset
72 + rel[i].r_offset;
73 /* This is the symbol it is referring to. Note that all
74 undefined symbols have been resolved. */
75 sym = (Elf32_Sym *)sechdrs[symindex].sh_addr
76 + ELF32_R_SYM(rel[i].r_info);
77
78 /* We add the value into the location given */
79 *location += sym->st_value;
80 }
81 return 0;
82} 64}
83 65
84int apply_relocate_add(Elf32_Shdr *sechdrs, 66int apply_relocate_add(Elf32_Shdr *sechdrs,
@@ -90,7 +72,7 @@ int apply_relocate_add(Elf32_Shdr *sechdrs,
90 unsigned int i; 72 unsigned int i;
91 Elf32_Rela *rela = (void *)sechdrs[relsec].sh_addr; 73 Elf32_Rela *rela = (void *)sechdrs[relsec].sh_addr;
92 74
93 DEBUGP ("Applying relocate section %u to %u\n", relsec, 75 DEBUGP ("Applying add relocate section %u to %u\n", relsec,
94 sechdrs[relsec].sh_info); 76 sechdrs[relsec].sh_info);
95 77
96 for (i = 0; i < sechdrs[relsec].sh_size / sizeof (*rela); i++) { 78 for (i = 0; i < sechdrs[relsec].sh_size / sizeof (*rela); i++) {
@@ -103,7 +85,18 @@ int apply_relocate_add(Elf32_Shdr *sechdrs,
103 Elf32_Sym *sym 85 Elf32_Sym *sym
104 = ((Elf32_Sym *)sechdrs[symindex].sh_addr 86 = ((Elf32_Sym *)sechdrs[symindex].sh_addr
105 + ELF32_R_SYM (rela[i].r_info)); 87 + ELF32_R_SYM (rela[i].r_info));
106 *loc = sym->st_value + rela[i].r_addend; 88 switch (ELF32_R_TYPE(rela[i].r_info)) {
89 case R_CRIS_32:
90 *loc = sym->st_value + rela[i].r_addend;
91 break;
92 case R_CRIS_32_PCREL:
93 *loc = sym->st_value - (unsigned)loc + rela[i].r_addend - 4;
94 break;
95 default:
96 printk(KERN_ERR "module %s: Unknown relocation: %u\n",
97 me->name, ELF32_R_TYPE(rela[i].r_info));
98 return -ENOEXEC;
99 }
107 } 100 }
108 101
109 return 0; 102 return 0;
diff --git a/arch/cris/kernel/process.c b/arch/cris/kernel/process.c
index 9f7cad7c7849..949a0e40e03c 100644
--- a/arch/cris/kernel/process.c
+++ b/arch/cris/kernel/process.c
@@ -1,4 +1,4 @@
1/* $Id: process.c,v 1.17 2004/04/05 13:53:48 starvik Exp $ 1/* $Id: process.c,v 1.21 2005/03/04 08:16:17 starvik Exp $
2 * 2 *
3 * linux/arch/cris/kernel/process.c 3 * linux/arch/cris/kernel/process.c
4 * 4 *
@@ -8,6 +8,18 @@
8 * Authors: Bjorn Wesen (bjornw@axis.com) 8 * Authors: Bjorn Wesen (bjornw@axis.com)
9 * 9 *
10 * $Log: process.c,v $ 10 * $Log: process.c,v $
11 * Revision 1.21 2005/03/04 08:16:17 starvik
12 * Merge of Linux 2.6.11.
13 *
14 * Revision 1.20 2005/01/18 05:57:22 starvik
15 * Renamed hlt_counter to cris_hlt_counter and made it global.
16 *
17 * Revision 1.19 2004/10/19 13:07:43 starvik
18 * Merge of Linux 2.6.9
19 *
20 * Revision 1.18 2004/08/16 12:37:23 starvik
21 * Merge of Linux 2.6.8
22 *
11 * Revision 1.17 2004/04/05 13:53:48 starvik 23 * Revision 1.17 2004/04/05 13:53:48 starvik
12 * Merge of Linux 2.6.5 24 * Merge of Linux 2.6.5
13 * 25 *
@@ -113,6 +125,7 @@
113#include <linux/user.h> 125#include <linux/user.h>
114#include <linux/elfcore.h> 126#include <linux/elfcore.h>
115#include <linux/mqueue.h> 127#include <linux/mqueue.h>
128#include <linux/reboot.h>
116 129
117//#define DEBUG 130//#define DEBUG
118 131
@@ -160,18 +173,18 @@ EXPORT_SYMBOL(init_task);
160 * region by enable_hlt/disable_hlt. 173 * region by enable_hlt/disable_hlt.
161 */ 174 */
162 175
163static int hlt_counter=0; 176int cris_hlt_counter=0;
164 177
165void disable_hlt(void) 178void disable_hlt(void)
166{ 179{
167 hlt_counter++; 180 cris_hlt_counter++;
168} 181}
169 182
170EXPORT_SYMBOL(disable_hlt); 183EXPORT_SYMBOL(disable_hlt);
171 184
172void enable_hlt(void) 185void enable_hlt(void)
173{ 186{
174 hlt_counter--; 187 cris_hlt_counter--;
175} 188}
176 189
177EXPORT_SYMBOL(enable_hlt); 190EXPORT_SYMBOL(enable_hlt);
@@ -194,27 +207,28 @@ void cpu_idle (void)
194 /* endless idle loop with no priority at all */ 207 /* endless idle loop with no priority at all */
195 while (1) { 208 while (1) {
196 while (!need_resched()) { 209 while (!need_resched()) {
197 void (*idle)(void) = pm_idle; 210 void (*idle)(void);
198 211 /*
212 * Mark this as an RCU critical section so that
213 * synchronize_kernel() in the unload path waits
214 * for our completion.
215 */
216 idle = pm_idle;
199 if (!idle) 217 if (!idle)
200 idle = default_idle; 218 idle = default_idle;
201
202 idle(); 219 idle();
203 } 220 }
204 schedule(); 221 schedule();
205 } 222 }
206
207} 223}
208 224
209void hard_reset_now (void); 225void hard_reset_now (void);
210 226
211void machine_restart(void) 227void machine_restart(char *cmd)
212{ 228{
213 hard_reset_now(); 229 hard_reset_now();
214} 230}
215 231
216EXPORT_SYMBOL(machine_restart);
217
218/* 232/*
219 * Similar to machine_power_off, but don't shut off power. Add code 233 * Similar to machine_power_off, but don't shut off power. Add code
220 * here to freeze the system for e.g. post-mortem debug purpose when 234 * here to freeze the system for e.g. post-mortem debug purpose when
@@ -225,16 +239,12 @@ void machine_halt(void)
225{ 239{
226} 240}
227 241
228EXPORT_SYMBOL(machine_halt);
229
230/* If or when software power-off is implemented, add code here. */ 242/* If or when software power-off is implemented, add code here. */
231 243
232void machine_power_off(void) 244void machine_power_off(void)
233{ 245{
234} 246}
235 247
236EXPORT_SYMBOL(machine_power_off);
237
238/* 248/*
239 * When a process does an "exec", machine state like FPU and debug 249 * When a process does an "exec", machine state like FPU and debug
240 * registers need to be reset. This is a hook function for that. 250 * registers need to be reset. This is a hook function for that.
diff --git a/arch/cris/kernel/profile.c b/arch/cris/kernel/profile.c
new file mode 100644
index 000000000000..69c52189f044
--- /dev/null
+++ b/arch/cris/kernel/profile.c
@@ -0,0 +1,73 @@
1#include <linux/init.h>
2#include <linux/errno.h>
3#include <linux/kernel.h>
4#include <linux/proc_fs.h>
5#include <linux/types.h>
6#include <asm/ptrace.h>
7#include <asm/uaccess.h>
8
9#define SAMPLE_BUFFER_SIZE 8192
10
11static char* sample_buffer;
12static char* sample_buffer_pos;
13static int prof_running = 0;
14
15void
16cris_profile_sample(struct pt_regs* regs)
17{
18 if (!prof_running)
19 return;
20 if (user_mode(regs))
21 *(unsigned int*)sample_buffer_pos = current->pid;
22 else
23 *(unsigned int*)sample_buffer_pos = 0;
24 *(unsigned int*)(sample_buffer_pos + 4) = instruction_pointer(regs);
25 sample_buffer_pos += 8;
26 if (sample_buffer_pos == sample_buffer + SAMPLE_BUFFER_SIZE)
27 sample_buffer_pos = sample_buffer;
28}
29
30static ssize_t
31read_cris_profile(struct file *file, char __user *buf, size_t count, loff_t *ppos)
32{
33 unsigned long p = *ppos;
34 if (p > SAMPLE_BUFFER_SIZE)
35 return 0;
36 if (p + count > SAMPLE_BUFFER_SIZE)
37 count = SAMPLE_BUFFER_SIZE - p;
38 if (copy_to_user(buf, sample_buffer + p,count))
39 return -EFAULT;
40 memset(sample_buffer + p, 0, count);
41 *ppos += count;
42 return count;
43}
44
45static ssize_t
46write_cris_profile(struct file *file, const char __user *buf,
47 size_t count, loff_t *ppos)
48{
49 sample_buffer_pos = sample_buffer;
50 memset(sample_buffer, 0, SAMPLE_BUFFER_SIZE);
51}
52
53static struct file_operations cris_proc_profile_operations = {
54 .read = read_cris_profile,
55 .write = write_cris_profile,
56};
57
58static int
59__init init_cris_profile(void)
60{
61 struct proc_dir_entry *entry;
62 sample_buffer = (char*)kmalloc(SAMPLE_BUFFER_SIZE, GFP_KERNEL);
63 sample_buffer_pos = sample_buffer;
64 entry = create_proc_entry("system_profile", S_IWUSR | S_IRUGO, NULL);
65 if (entry) {
66 entry->proc_fops = &cris_proc_profile_operations;
67 entry->size = SAMPLE_BUFFER_SIZE;
68 }
69 prof_running = 1;
70 return 0;
71}
72
73__initcall(init_cris_profile);
diff --git a/arch/cris/kernel/ptrace.c b/arch/cris/kernel/ptrace.c
index e85a2fdd9acf..2b6363cbe985 100644
--- a/arch/cris/kernel/ptrace.c
+++ b/arch/cris/kernel/ptrace.c
@@ -8,6 +8,12 @@
8 * Authors: Bjorn Wesen 8 * Authors: Bjorn Wesen
9 * 9 *
10 * $Log: ptrace.c,v $ 10 * $Log: ptrace.c,v $
11 * Revision 1.10 2004/09/22 11:50:01 orjanf
12 * * Moved get_reg/put_reg to arch-specific files.
13 * * Added functions to access debug registers (CRISv32).
14 * * Added support for PTRACE_SINGLESTEP (CRISv32).
15 * * Added S flag to CCS_MASK (CRISv32).
16 *
11 * Revision 1.9 2003/07/04 12:56:11 tobiasa 17 * Revision 1.9 2003/07/04 12:56:11 tobiasa
12 * Moved arch-specific code to arch-specific files. 18 * Moved arch-specific code to arch-specific files.
13 * 19 *
@@ -72,37 +78,6 @@
72#include <asm/system.h> 78#include <asm/system.h>
73#include <asm/processor.h> 79#include <asm/processor.h>
74 80
75/*
76 * Get contents of register REGNO in task TASK.
77 */
78inline long get_reg(struct task_struct *task, unsigned int regno)
79{
80 /* USP is a special case, it's not in the pt_regs struct but
81 * in the tasks thread struct
82 */
83
84 if (regno == PT_USP)
85 return task->thread.usp;
86 else if (regno < PT_MAX)
87 return ((unsigned long *)user_regs(task->thread_info))[regno];
88 else
89 return 0;
90}
91
92/*
93 * Write contents of register REGNO in task TASK.
94 */
95inline int put_reg(struct task_struct *task, unsigned int regno,
96 unsigned long data)
97{
98 if (regno == PT_USP)
99 task->thread.usp = data;
100 else if (regno < PT_MAX)
101 ((unsigned long *)user_regs(task->thread_info))[regno] = data;
102 else
103 return -1;
104 return 0;
105}
106 81
107/* notification of userspace execution resumption 82/* notification of userspace execution resumption
108 * - triggered by current->work.notify_resume 83 * - triggered by current->work.notify_resume
diff --git a/arch/cris/kernel/setup.c b/arch/cris/kernel/setup.c
index 6ec2671078bf..d11206e467ab 100644
--- a/arch/cris/kernel/setup.c
+++ b/arch/cris/kernel/setup.c
@@ -17,6 +17,7 @@
17#include <asm/pgtable.h> 17#include <asm/pgtable.h>
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 21
21#include <asm/setup.h> 22#include <asm/setup.h>
22 23
@@ -29,7 +30,7 @@ struct screen_info screen_info;
29extern int root_mountflags; 30extern int root_mountflags;
30extern char _etext, _edata, _end; 31extern char _etext, _edata, _end;
31 32
32static char command_line[COMMAND_LINE_SIZE] = { 0, }; 33char cris_command_line[COMMAND_LINE_SIZE] = { 0, };
33 34
34extern const unsigned long text_start, edata; /* set by the linker script */ 35extern const unsigned long text_start, edata; /* set by the linker script */
35extern unsigned long dram_start, dram_end; 36extern unsigned long dram_start, dram_end;
@@ -147,34 +148,35 @@ setup_arch(char **cmdline_p)
147 148
148 paging_init(); 149 paging_init();
149 150
150 /* We don't use a command line yet, so just re-initialize it without 151 *cmdline_p = cris_command_line;
151 saving anything that might be there. */
152
153 *cmdline_p = command_line;
154 152
155#ifdef CONFIG_ETRAX_CMDLINE 153#ifdef CONFIG_ETRAX_CMDLINE
156 strlcpy(command_line, CONFIG_ETRAX_CMDLINE, COMMAND_LINE_SIZE); 154 if (!strcmp(cris_command_line, "")) {
157 command_line[COMMAND_LINE_SIZE - 1] = '\0'; 155 strlcpy(cris_command_line, CONFIG_ETRAX_CMDLINE, COMMAND_LINE_SIZE);
156 cris_command_line[COMMAND_LINE_SIZE - 1] = '\0';
157 }
158#endif
158 159
159 /* Save command line for future references. */ 160 /* Save command line for future references. */
160 memcpy(saved_command_line, command_line, COMMAND_LINE_SIZE); 161 memcpy(saved_command_line, cris_command_line, COMMAND_LINE_SIZE);
161 saved_command_line[COMMAND_LINE_SIZE - 1] = '\0'; 162 saved_command_line[COMMAND_LINE_SIZE - 1] = '\0';
162#endif
163 163
164 /* give credit for the CRIS port */ 164 /* give credit for the CRIS port */
165 show_etrax_copyright(); 165 show_etrax_copyright();
166
167 /* Setup utsname */
168 strcpy(system_utsname.machine, cris_machine_name);
166} 169}
167 170
168static void *c_start(struct seq_file *m, loff_t *pos) 171static void *c_start(struct seq_file *m, loff_t *pos)
169{ 172{
170 /* We only got one CPU... */ 173 return *pos < NR_CPUS ? (void *)(int)(*pos + 1): NULL;
171 return *pos < 1 ? (void *)1 : NULL;
172} 174}
173 175
174static void *c_next(struct seq_file *m, void *v, loff_t *pos) 176static void *c_next(struct seq_file *m, void *v, loff_t *pos)
175{ 177{
176 ++*pos; 178 ++*pos;
177 return NULL; 179 return c_start(m, pos);
178} 180}
179 181
180static void c_stop(struct seq_file *m, void *v) 182static void c_stop(struct seq_file *m, void *v)
diff --git a/arch/cris/kernel/time.c b/arch/cris/kernel/time.c
index 6c28b0e7f7b4..fa2d4323da25 100644
--- a/arch/cris/kernel/time.c
+++ b/arch/cris/kernel/time.c
@@ -1,4 +1,4 @@
1/* $Id: time.c,v 1.14 2004/06/01 05:38:11 starvik Exp $ 1/* $Id: time.c,v 1.18 2005/03/04 08:16:17 starvik Exp $
2 * 2 *
3 * linux/arch/cris/kernel/time.c 3 * linux/arch/cris/kernel/time.c
4 * 4 *
@@ -30,6 +30,7 @@
30#include <linux/bcd.h> 30#include <linux/bcd.h>
31#include <linux/timex.h> 31#include <linux/timex.h>
32#include <linux/init.h> 32#include <linux/init.h>
33#include <linux/profile.h>
33 34
34u64 jiffies_64 = INITIAL_JIFFIES; 35u64 jiffies_64 = INITIAL_JIFFIES;
35 36
@@ -214,6 +215,21 @@ update_xtime_from_cmos(void)
214 } 215 }
215} 216}
216 217
218extern void cris_profile_sample(struct pt_regs* regs);
219
220void
221cris_do_profile(struct pt_regs* regs)
222{
223
224#if CONFIG_SYSTEM_PROFILER
225 cris_profile_sample(regs);
226#endif
227
228#if CONFIG_PROFILING
229 profile_tick(CPU_PROFILING, regs);
230#endif
231}
232
217/* 233/*
218 * Scheduler clock - returns current time in nanosec units. 234 * Scheduler clock - returns current time in nanosec units.
219 */ 235 */
diff --git a/arch/cris/kernel/traps.c b/arch/cris/kernel/traps.c
index d4dfa050e3a5..520d92205fed 100644
--- a/arch/cris/kernel/traps.c
+++ b/arch/cris/kernel/traps.c
@@ -1,4 +1,4 @@
1/* $Id: traps.c,v 1.9 2004/05/11 12:28:26 starvik Exp $ 1/* $Id: traps.c,v 1.11 2005/01/24 16:03:19 orjanf Exp $
2 * 2 *
3 * linux/arch/cris/traps.c 3 * linux/arch/cris/traps.c
4 * 4 *
@@ -20,13 +20,15 @@
20 20
21static int kstack_depth_to_print = 24; 21static int kstack_depth_to_print = 24;
22 22
23extern int raw_printk(const char *fmt, ...);
24
23void show_trace(unsigned long * stack) 25void show_trace(unsigned long * stack)
24{ 26{
25 unsigned long addr, module_start, module_end; 27 unsigned long addr, module_start, module_end;
26 extern char _stext, _etext; 28 extern char _stext, _etext;
27 int i; 29 int i;
28 30
29 printk("\nCall Trace: "); 31 raw_printk("\nCall Trace: ");
30 32
31 i = 1; 33 i = 1;
32 module_start = VMALLOC_START; 34 module_start = VMALLOC_START;
@@ -37,7 +39,7 @@ void show_trace(unsigned long * stack)
37 /* This message matches "failing address" marked 39 /* This message matches "failing address" marked
38 s390 in ksymoops, so lines containing it will 40 s390 in ksymoops, so lines containing it will
39 not be filtered out by ksymoops. */ 41 not be filtered out by ksymoops. */
40 printk ("Failing address 0x%lx\n", (unsigned long)stack); 42 raw_printk ("Failing address 0x%lx\n", (unsigned long)stack);
41 break; 43 break;
42 } 44 }
43 stack++; 45 stack++;
@@ -54,8 +56,8 @@ void show_trace(unsigned long * stack)
54 (addr <= (unsigned long) &_etext)) || 56 (addr <= (unsigned long) &_etext)) ||
55 ((addr >= module_start) && (addr <= module_end))) { 57 ((addr >= module_start) && (addr <= module_end))) {
56 if (i && ((i % 8) == 0)) 58 if (i && ((i % 8) == 0))
57 printk("\n "); 59 raw_printk("\n ");
58 printk("[<%08lx>] ", addr); 60 raw_printk("[<%08lx>] ", addr);
59 i++; 61 i++;
60 } 62 }
61 } 63 }
@@ -96,25 +98,59 @@ show_stack(struct task_struct *task, unsigned long *sp)
96 98
97 stack = sp; 99 stack = sp;
98 100
99 printk("\nStack from %08lx:\n ", (unsigned long)stack); 101 raw_printk("\nStack from %08lx:\n ", (unsigned long)stack);
100 for(i = 0; i < kstack_depth_to_print; i++) { 102 for(i = 0; i < kstack_depth_to_print; i++) {
101 if (((long) stack & (THREAD_SIZE-1)) == 0) 103 if (((long) stack & (THREAD_SIZE-1)) == 0)
102 break; 104 break;
103 if (i && ((i % 8) == 0)) 105 if (i && ((i % 8) == 0))
104 printk("\n "); 106 raw_printk("\n ");
105 if (__get_user (addr, stack)) { 107 if (__get_user (addr, stack)) {
106 /* This message matches "failing address" marked 108 /* This message matches "failing address" marked
107 s390 in ksymoops, so lines containing it will 109 s390 in ksymoops, so lines containing it will
108 not be filtered out by ksymoops. */ 110 not be filtered out by ksymoops. */
109 printk ("Failing address 0x%lx\n", (unsigned long)stack); 111 raw_printk ("Failing address 0x%lx\n", (unsigned long)stack);
110 break; 112 break;
111 } 113 }
112 stack++; 114 stack++;
113 printk("%08lx ", addr); 115 raw_printk("%08lx ", addr);
114 } 116 }
115 show_trace(sp); 117 show_trace(sp);
116} 118}
117 119
120static void (*nmi_handler)(struct pt_regs*);
121extern void arch_enable_nmi(void);
122
123void set_nmi_handler(void (*handler)(struct pt_regs*))
124{
125 nmi_handler = handler;
126 arch_enable_nmi();
127}
128
129void handle_nmi(struct pt_regs* regs)
130{
131 if (nmi_handler)
132 nmi_handler(regs);
133}
134
135#ifdef CONFIG_DEBUG_NMI_OOPS
136void oops_nmi_handler(struct pt_regs* regs)
137{
138 stop_watchdog();
139 raw_printk("NMI!\n");
140 show_registers(regs);
141}
142
143static int
144__init oops_nmi_register(void)
145{
146 set_nmi_handler(oops_nmi_handler);
147 return 0;
148}
149
150__initcall(oops_nmi_register);
151
152#endif
153
118#if 0 154#if 0
119/* displays a short stack trace */ 155/* displays a short stack trace */
120 156
@@ -123,9 +159,9 @@ show_stack()
123{ 159{
124 unsigned long *sp = (unsigned long *)rdusp(); 160 unsigned long *sp = (unsigned long *)rdusp();
125 int i; 161 int i;
126 printk("Stack dump [0x%08lx]:\n", (unsigned long)sp); 162 raw_printk("Stack dump [0x%08lx]:\n", (unsigned long)sp);
127 for(i = 0; i < 16; i++) 163 for(i = 0; i < 16; i++)
128 printk("sp + %d: 0x%08lx\n", i*4, sp[i]); 164 raw_printk("sp + %d: 0x%08lx\n", i*4, sp[i]);
129 return 0; 165 return 0;
130} 166}
131#endif 167#endif
@@ -142,3 +178,9 @@ trap_init(void)
142{ 178{
143 /* Nothing needs to be done */ 179 /* Nothing needs to be done */
144} 180}
181
182void spinning_cpu(void* addr)
183{
184 raw_printk("CPU %d spinning on %X\n", smp_processor_id(), addr);
185 dump_stack();
186}
diff --git a/arch/cris/mm/fault.c b/arch/cris/mm/fault.c
index 03254b9eded1..934c51078cce 100644
--- a/arch/cris/mm/fault.c
+++ b/arch/cris/mm/fault.c
@@ -6,6 +6,38 @@
6 * Authors: Bjorn Wesen 6 * Authors: Bjorn Wesen
7 * 7 *
8 * $Log: fault.c,v $ 8 * $Log: fault.c,v $
9 * Revision 1.20 2005/03/04 08:16:18 starvik
10 * Merge of Linux 2.6.11.
11 *
12 * Revision 1.19 2005/01/14 10:07:59 starvik
13 * Fixed warning.
14 *
15 * Revision 1.18 2005/01/12 08:10:14 starvik
16 * Readded the change of frametype when handling kernel page fault fixup
17 * for v10. This is necessary to avoid that the CPU remakes the faulting
18 * access.
19 *
20 * Revision 1.17 2005/01/11 13:53:05 starvik
21 * Use raw_printk.
22 *
23 * Revision 1.16 2004/12/17 11:39:41 starvik
24 * SMP support.
25 *
26 * Revision 1.15 2004/11/23 18:36:18 starvik
27 * Stack is now non-executable.
28 * Signal handler trampolines are placed in a reserved page mapped into all
29 * processes.
30 *
31 * Revision 1.14 2004/11/23 07:10:21 starvik
32 * Moved find_fixup_code to generic code.
33 *
34 * Revision 1.13 2004/11/23 07:00:54 starvik
35 * Actually use the execute permission bit in the MMU. This makes it possible
36 * to prevent e.g. attacks where executable code is put on the stack.
37 *
38 * Revision 1.12 2004/09/29 06:16:04 starvik
39 * Use instruction_pointer
40 *
9 * Revision 1.11 2004/05/14 07:58:05 starvik 41 * Revision 1.11 2004/05/14 07:58:05 starvik
10 * Merge of changes from 2.4 42 * Merge of changes from 2.4
11 * 43 *
@@ -103,6 +135,7 @@
103 135
104extern int find_fixup_code(struct pt_regs *); 136extern int find_fixup_code(struct pt_regs *);
105extern void die_if_kernel(const char *, struct pt_regs *, long); 137extern void die_if_kernel(const char *, struct pt_regs *, long);
138extern int raw_printk(const char *fmt, ...);
106 139
107/* debug of low-level TLB reload */ 140/* debug of low-level TLB reload */
108#undef DEBUG 141#undef DEBUG
@@ -118,7 +151,8 @@ extern void die_if_kernel(const char *, struct pt_regs *, long);
118 151
119/* current active page directory */ 152/* current active page directory */
120 153
121volatile pgd_t *current_pgd; 154volatile DEFINE_PER_CPU(pgd_t *,current_pgd);
155unsigned long cris_signal_return_page;
122 156
123/* 157/*
124 * This routine handles page faults. It determines the address, 158 * This routine handles page faults. It determines the address,
@@ -146,8 +180,9 @@ do_page_fault(unsigned long address, struct pt_regs *regs,
146 struct vm_area_struct * vma; 180 struct vm_area_struct * vma;
147 siginfo_t info; 181 siginfo_t info;
148 182
149 D(printk("Page fault for %X at %X, prot %d write %d\n", 183 D(printk("Page fault for %lX on %X at %lX, prot %d write %d\n",
150 address, regs->erp, protection, writeaccess)); 184 address, smp_processor_id(), instruction_pointer(regs),
185 protection, writeaccess));
151 186
152 tsk = current; 187 tsk = current;
153 188
@@ -175,8 +210,19 @@ do_page_fault(unsigned long address, struct pt_regs *regs,
175 !user_mode(regs)) 210 !user_mode(regs))
176 goto vmalloc_fault; 211 goto vmalloc_fault;
177 212
213 /* When stack execution is not allowed we store the signal
214 * trampolines in the reserved cris_signal_return_page.
215 * Handle this in the exact same way as vmalloc (we know
216 * that the mapping is there and is valid so no need to
217 * call handle_mm_fault).
218 */
219 if (cris_signal_return_page &&
220 address == cris_signal_return_page &&
221 !protection && user_mode(regs))
222 goto vmalloc_fault;
223
178 /* we can and should enable interrupts at this point */ 224 /* we can and should enable interrupts at this point */
179 sti(); 225 local_irq_enable();
180 226
181 mm = tsk->mm; 227 mm = tsk->mm;
182 info.si_code = SEGV_MAPERR; 228 info.si_code = SEGV_MAPERR;
@@ -220,7 +266,10 @@ do_page_fault(unsigned long address, struct pt_regs *regs,
220 266
221 /* first do some preliminary protection checks */ 267 /* first do some preliminary protection checks */
222 268
223 if (writeaccess) { 269 if (writeaccess == 2){
270 if (!(vma->vm_flags & VM_EXEC))
271 goto bad_area;
272 } else if (writeaccess == 1) {
224 if (!(vma->vm_flags & VM_WRITE)) 273 if (!(vma->vm_flags & VM_WRITE))
225 goto bad_area; 274 goto bad_area;
226 } else { 275 } else {
@@ -234,14 +283,14 @@ do_page_fault(unsigned long address, struct pt_regs *regs,
234 * the fault. 283 * the fault.
235 */ 284 */
236 285
237 switch (handle_mm_fault(mm, vma, address, writeaccess)) { 286 switch (handle_mm_fault(mm, vma, address, writeaccess & 1)) {
238 case 1: 287 case VM_FAULT_MINOR:
239 tsk->min_flt++; 288 tsk->min_flt++;
240 break; 289 break;
241 case 2: 290 case VM_FAULT_MAJOR:
242 tsk->maj_flt++; 291 tsk->maj_flt++;
243 break; 292 break;
244 case 0: 293 case VM_FAULT_SIGBUS:
245 goto do_sigbus; 294 goto do_sigbus;
246 default: 295 default:
247 goto out_of_memory; 296 goto out_of_memory;
@@ -292,10 +341,10 @@ do_page_fault(unsigned long address, struct pt_regs *regs,
292 */ 341 */
293 342
294 if ((unsigned long) (address) < PAGE_SIZE) 343 if ((unsigned long) (address) < PAGE_SIZE)
295 printk(KERN_ALERT "Unable to handle kernel NULL pointer dereference"); 344 raw_printk(KERN_ALERT "Unable to handle kernel NULL pointer dereference");
296 else 345 else
297 printk(KERN_ALERT "Unable to handle kernel access"); 346 raw_printk(KERN_ALERT "Unable to handle kernel access");
298 printk(" at virtual address %08lx\n",address); 347 raw_printk(" at virtual address %08lx\n",address);
299 348
300 die_if_kernel("Oops", regs, (writeaccess << 1) | protection); 349 die_if_kernel("Oops", regs, (writeaccess << 1) | protection);
301 350
@@ -346,10 +395,11 @@ vmalloc_fault:
346 395
347 int offset = pgd_index(address); 396 int offset = pgd_index(address);
348 pgd_t *pgd, *pgd_k; 397 pgd_t *pgd, *pgd_k;
398 pud_t *pud, *pud_k;
349 pmd_t *pmd, *pmd_k; 399 pmd_t *pmd, *pmd_k;
350 pte_t *pte_k; 400 pte_t *pte_k;
351 401
352 pgd = (pgd_t *)current_pgd + offset; 402 pgd = (pgd_t *)per_cpu(current_pgd, smp_processor_id()) + offset;
353 pgd_k = init_mm.pgd + offset; 403 pgd_k = init_mm.pgd + offset;
354 404
355 /* Since we're two-level, we don't need to do both 405 /* Since we're two-level, we don't need to do both
@@ -364,8 +414,13 @@ vmalloc_fault:
364 * it exists. 414 * it exists.
365 */ 415 */
366 416
367 pmd = pmd_offset(pgd, address); 417 pud = pud_offset(pgd, address);
368 pmd_k = pmd_offset(pgd_k, address); 418 pud_k = pud_offset(pgd_k, address);
419 if (!pud_present(*pud_k))
420 goto no_context;
421
422 pmd = pmd_offset(pud, address);
423 pmd_k = pmd_offset(pud_k, address);
369 424
370 if (!pmd_present(*pmd_k)) 425 if (!pmd_present(*pmd_k))
371 goto bad_area_nosemaphore; 426 goto bad_area_nosemaphore;
@@ -385,3 +440,19 @@ vmalloc_fault:
385 return; 440 return;
386 } 441 }
387} 442}
443
444/* Find fixup code. */
445int
446find_fixup_code(struct pt_regs *regs)
447{
448 const struct exception_table_entry *fixup;
449
450 if ((fixup = search_exception_tables(instruction_pointer(regs))) != 0) {
451 /* Adjust the instruction pointer in the stackframe. */
452 instruction_pointer(regs) = fixup->fixup;
453 arch_fixup(regs);
454 return 1;
455 }
456
457 return 0;
458}
diff --git a/arch/cris/mm/ioremap.c b/arch/cris/mm/ioremap.c
index 6b9130bfb6c1..ebba11e270fa 100644
--- a/arch/cris/mm/ioremap.c
+++ b/arch/cris/mm/ioremap.c
@@ -14,9 +14,10 @@
14#include <asm/pgalloc.h> 14#include <asm/pgalloc.h>
15#include <asm/cacheflush.h> 15#include <asm/cacheflush.h>
16#include <asm/tlbflush.h> 16#include <asm/tlbflush.h>
17#include <asm/arch/memmap.h>
17 18
18extern inline void remap_area_pte(pte_t * pte, unsigned long address, unsigned long size, 19extern inline void remap_area_pte(pte_t * pte, unsigned long address, unsigned long size,
19 unsigned long phys_addr, unsigned long flags) 20 unsigned long phys_addr, pgprot_t prot)
20{ 21{
21 unsigned long end; 22 unsigned long end;
22 23
@@ -31,9 +32,7 @@ extern inline void remap_area_pte(pte_t * pte, unsigned long address, unsigned l
31 printk("remap_area_pte: page already exists\n"); 32 printk("remap_area_pte: page already exists\n");
32 BUG(); 33 BUG();
33 } 34 }
34 set_pte(pte, mk_pte_phys(phys_addr, __pgprot(_PAGE_PRESENT | __READABLE | 35 set_pte(pte, mk_pte_phys(phys_addr, prot));
35 __WRITEABLE | _PAGE_GLOBAL |
36 _PAGE_KERNEL | flags)));
37 address += PAGE_SIZE; 36 address += PAGE_SIZE;
38 phys_addr += PAGE_SIZE; 37 phys_addr += PAGE_SIZE;
39 pte++; 38 pte++;
@@ -41,7 +40,7 @@ extern inline void remap_area_pte(pte_t * pte, unsigned long address, unsigned l
41} 40}
42 41
43static inline int remap_area_pmd(pmd_t * pmd, unsigned long address, unsigned long size, 42static inline int remap_area_pmd(pmd_t * pmd, unsigned long address, unsigned long size,
44 unsigned long phys_addr, unsigned long flags) 43 unsigned long phys_addr, pgprot_t prot)
45{ 44{
46 unsigned long end; 45 unsigned long end;
47 46
@@ -56,7 +55,7 @@ static inline int remap_area_pmd(pmd_t * pmd, unsigned long address, unsigned lo
56 pte_t * pte = pte_alloc_kernel(&init_mm, pmd, address); 55 pte_t * pte = pte_alloc_kernel(&init_mm, pmd, address);
57 if (!pte) 56 if (!pte)
58 return -ENOMEM; 57 return -ENOMEM;
59 remap_area_pte(pte, address, end - address, address + phys_addr, flags); 58 remap_area_pte(pte, address, end - address, address + phys_addr, prot);
60 address = (address + PMD_SIZE) & PMD_MASK; 59 address = (address + PMD_SIZE) & PMD_MASK;
61 pmd++; 60 pmd++;
62 } while (address && (address < end)); 61 } while (address && (address < end));
@@ -64,7 +63,7 @@ static inline int remap_area_pmd(pmd_t * pmd, unsigned long address, unsigned lo
64} 63}
65 64
66static int remap_area_pages(unsigned long address, unsigned long phys_addr, 65static int remap_area_pages(unsigned long address, unsigned long phys_addr,
67 unsigned long size, unsigned long flags) 66 unsigned long size, pgprot_t prot)
68{ 67{
69 int error; 68 int error;
70 pgd_t * dir; 69 pgd_t * dir;
@@ -77,13 +76,19 @@ static int remap_area_pages(unsigned long address, unsigned long phys_addr,
77 BUG(); 76 BUG();
78 spin_lock(&init_mm.page_table_lock); 77 spin_lock(&init_mm.page_table_lock);
79 do { 78 do {
79 pud_t *pud;
80 pmd_t *pmd; 80 pmd_t *pmd;
81 pmd = pmd_alloc(&init_mm, dir, address); 81
82 error = -ENOMEM; 82 error = -ENOMEM;
83 pud = pud_alloc(&init_mm, dir, address);
84 if (!pud)
85 break;
86 pmd = pmd_alloc(&init_mm, pud, address);
87
83 if (!pmd) 88 if (!pmd)
84 break; 89 break;
85 if (remap_area_pmd(pmd, address, end - address, 90 if (remap_area_pmd(pmd, address, end - address,
86 phys_addr + address, flags)) 91 phys_addr + address, prot))
87 break; 92 break;
88 error = 0; 93 error = 0;
89 address = (address + PGDIR_SIZE) & PGDIR_MASK; 94 address = (address + PGDIR_SIZE) & PGDIR_MASK;
@@ -107,9 +112,9 @@ static int remap_area_pages(unsigned long address, unsigned long phys_addr,
107 * have to convert them into an offset in a page-aligned mapping, but the 112 * have to convert them into an offset in a page-aligned mapping, but the
108 * caller shouldn't need to know that small detail. 113 * caller shouldn't need to know that small detail.
109 */ 114 */
110void * __ioremap(unsigned long phys_addr, unsigned long size, unsigned long flags) 115void __iomem * __ioremap_prot(unsigned long phys_addr, unsigned long size, pgprot_t prot)
111{ 116{
112 void * addr; 117 void __iomem * addr;
113 struct vm_struct * area; 118 struct vm_struct * area;
114 unsigned long offset, last_addr; 119 unsigned long offset, last_addr;
115 120
@@ -131,15 +136,36 @@ void * __ioremap(unsigned long phys_addr, unsigned long size, unsigned long flag
131 area = get_vm_area(size, VM_IOREMAP); 136 area = get_vm_area(size, VM_IOREMAP);
132 if (!area) 137 if (!area)
133 return NULL; 138 return NULL;
134 addr = area->addr; 139 addr = (void __iomem *)area->addr;
135 if (remap_area_pages((unsigned long) addr, phys_addr, size, flags)) { 140 if (remap_area_pages((unsigned long) addr, phys_addr, size, prot)) {
136 vfree(addr); 141 vfree((void __force *)addr);
137 return NULL; 142 return NULL;
138 } 143 }
139 return (void *) (offset + (char *)addr); 144 return (void __iomem *) (offset + (char __iomem *)addr);
145}
146
147void __iomem * __ioremap(unsigned long phys_addr, unsigned long size, unsigned long flags)
148{
149 return __ioremap_prot(phys_addr, size,
150 __pgprot(_PAGE_PRESENT | __READABLE |
151 __WRITEABLE | _PAGE_GLOBAL |
152 _PAGE_KERNEL | flags));
153}
154
155/**
156 * ioremap_nocache - map bus memory into CPU space
157 * @offset: bus address of the memory
158 * @size: size of the resource to map
159 *
160 * Must be freed with iounmap.
161 */
162
163void __iomem *ioremap_nocache (unsigned long phys_addr, unsigned long size)
164{
165 return __ioremap(phys_addr | MEM_NON_CACHEABLE, size, 0);
140} 166}
141 167
142void iounmap(void *addr) 168void iounmap(volatile void __iomem *addr)
143{ 169{
144 if (addr > high_memory) 170 if (addr > high_memory)
145 return vfree((void *) (PAGE_MASK & (unsigned long) addr)); 171 return vfree((void *) (PAGE_MASK & (unsigned long) addr));
diff --git a/arch/cris/mm/tlb.c b/arch/cris/mm/tlb.c
index 23eca5ad7389..0df390a656cd 100644
--- a/arch/cris/mm/tlb.c
+++ b/arch/cris/mm/tlb.c
@@ -29,18 +29,6 @@
29struct mm_struct *page_id_map[NUM_PAGEID]; 29struct mm_struct *page_id_map[NUM_PAGEID];
30static int map_replace_ptr = 1; /* which page_id_map entry to replace next */ 30static int map_replace_ptr = 1; /* which page_id_map entry to replace next */
31 31
32/*
33 * Initialize the context related info for a new mm_struct
34 * instance.
35 */
36
37int
38init_new_context(struct task_struct *tsk, struct mm_struct *mm)
39{
40 mm->context = NO_CONTEXT;
41 return 0;
42}
43
44/* the following functions are similar to those used in the PPC port */ 32/* the following functions are similar to those used in the PPC port */
45 33
46static inline void 34static inline void
@@ -60,12 +48,12 @@ alloc_context(struct mm_struct *mm)
60 */ 48 */
61 flush_tlb_mm(old_mm); 49 flush_tlb_mm(old_mm);
62 50
63 old_mm->context = NO_CONTEXT; 51 old_mm->context.page_id = NO_CONTEXT;
64 } 52 }
65 53
66 /* insert it into the page_id_map */ 54 /* insert it into the page_id_map */
67 55
68 mm->context = map_replace_ptr; 56 mm->context.page_id = map_replace_ptr;
69 page_id_map[map_replace_ptr] = mm; 57 page_id_map[map_replace_ptr] = mm;
70 58
71 map_replace_ptr++; 59 map_replace_ptr++;
@@ -81,7 +69,7 @@ alloc_context(struct mm_struct *mm)
81void 69void
82get_mmu_context(struct mm_struct *mm) 70get_mmu_context(struct mm_struct *mm)
83{ 71{
84 if(mm->context == NO_CONTEXT) 72 if(mm->context.page_id == NO_CONTEXT)
85 alloc_context(mm); 73 alloc_context(mm);
86} 74}
87 75
@@ -96,11 +84,10 @@ get_mmu_context(struct mm_struct *mm)
96void 84void
97destroy_context(struct mm_struct *mm) 85destroy_context(struct mm_struct *mm)
98{ 86{
99 if(mm->context != NO_CONTEXT) { 87 if(mm->context.page_id != NO_CONTEXT) {
100 D(printk("destroy_context %d (%p)\n", mm->context, mm)); 88 D(printk("destroy_context %d (%p)\n", mm->context.page_id, mm));
101 flush_tlb_mm(mm); /* TODO this might be redundant ? */ 89 flush_tlb_mm(mm); /* TODO this might be redundant ? */
102 page_id_map[mm->context] = NULL; 90 page_id_map[mm->context.page_id] = NULL;
103 /* mm->context = NO_CONTEXT; redundant.. mm will be freed */
104 } 91 }
105} 92}
106 93
diff --git a/arch/frv/Kconfig b/arch/frv/Kconfig
index c93f95146cc2..ec85c0d6c6da 100644
--- a/arch/frv/Kconfig
+++ b/arch/frv/Kconfig
@@ -346,6 +346,8 @@ source "fs/Kconfig.binfmt"
346 346
347endmenu 347endmenu
348 348
349source "net/Kconfig"
350
349source "drivers/Kconfig" 351source "drivers/Kconfig"
350 352
351source "fs/Kconfig" 353source "fs/Kconfig"
diff --git a/arch/frv/kernel/frv_ksyms.c b/arch/frv/kernel/frv_ksyms.c
index 62cfbd9b4f98..1a76d5247190 100644
--- a/arch/frv/kernel/frv_ksyms.c
+++ b/arch/frv/kernel/frv_ksyms.c
@@ -71,7 +71,6 @@ EXPORT_SYMBOL(memset);
71EXPORT_SYMBOL(memcmp); 71EXPORT_SYMBOL(memcmp);
72EXPORT_SYMBOL(memscan); 72EXPORT_SYMBOL(memscan);
73EXPORT_SYMBOL(memmove); 73EXPORT_SYMBOL(memmove);
74EXPORT_SYMBOL(strtok);
75 74
76EXPORT_SYMBOL(get_wchan); 75EXPORT_SYMBOL(get_wchan);
77 76
diff --git a/arch/frv/kernel/signal.c b/arch/frv/kernel/signal.c
index 36a2dffc8ebd..d4ccc0728dfe 100644
--- a/arch/frv/kernel/signal.c
+++ b/arch/frv/kernel/signal.c
@@ -506,13 +506,12 @@ static void handle_signal(unsigned long sig, siginfo_t *info,
506 else 506 else
507 setup_frame(sig, ka, oldset, regs); 507 setup_frame(sig, ka, oldset, regs);
508 508
509 if (!(ka->sa.sa_flags & SA_NODEFER)) { 509 spin_lock_irq(&current->sighand->siglock);
510 spin_lock_irq(&current->sighand->siglock); 510 sigorsets(&current->blocked, &current->blocked, &ka->sa.sa_mask);
511 sigorsets(&current->blocked, &current->blocked, &ka->sa.sa_mask); 511 if (!(ka->sa.sa_flags & SA_NODEFER))
512 sigaddset(&current->blocked, sig); 512 sigaddset(&current->blocked, sig);
513 recalc_sigpending(); 513 recalc_sigpending();
514 spin_unlock_irq(&current->sighand->siglock); 514 spin_unlock_irq(&current->sighand->siglock);
515 }
516} /* end handle_signal() */ 515} /* end handle_signal() */
517 516
518/*****************************************************************************/ 517/*****************************************************************************/
diff --git a/arch/frv/mb93090-mb00/pci-irq.c b/arch/frv/mb93090-mb00/pci-irq.c
index 24622d89b1ca..af981bda015c 100644
--- a/arch/frv/mb93090-mb00/pci-irq.c
+++ b/arch/frv/mb93090-mb00/pci-irq.c
@@ -60,7 +60,7 @@ void __init pcibios_fixup_irqs(void)
60 } 60 }
61} 61}
62 62
63void __init pcibios_penalize_isa_irq(int irq) 63void __init pcibios_penalize_isa_irq(int irq, int active)
64{ 64{
65} 65}
66 66
diff --git a/arch/frv/mm/fault.c b/arch/frv/mm/fault.c
index 41d02ac48233..8b3eb50c5105 100644
--- a/arch/frv/mm/fault.c
+++ b/arch/frv/mm/fault.c
@@ -163,13 +163,13 @@ asmlinkage void do_page_fault(int datammu, unsigned long esr0, unsigned long ear
163 * the fault. 163 * the fault.
164 */ 164 */
165 switch (handle_mm_fault(mm, vma, ear0, write)) { 165 switch (handle_mm_fault(mm, vma, ear0, write)) {
166 case 1: 166 case VM_FAULT_MINOR:
167 current->min_flt++; 167 current->min_flt++;
168 break; 168 break;
169 case 2: 169 case VM_FAULT_MAJOR:
170 current->maj_flt++; 170 current->maj_flt++;
171 break; 171 break;
172 case 0: 172 case VM_FAULT_SIGBUS:
173 goto do_sigbus; 173 goto do_sigbus;
174 default: 174 default:
175 goto out_of_memory; 175 goto out_of_memory;
diff --git a/arch/h8300/Kconfig b/arch/h8300/Kconfig
index 62a89e812e3e..26698a49f153 100644
--- a/arch/h8300/Kconfig
+++ b/arch/h8300/Kconfig
@@ -55,6 +55,8 @@ source "fs/Kconfig.binfmt"
55 55
56endmenu 56endmenu
57 57
58source "net/Kconfig"
59
58source "drivers/base/Kconfig" 60source "drivers/base/Kconfig"
59 61
60source "drivers/mtd/Kconfig" 62source "drivers/mtd/Kconfig"
@@ -65,7 +67,7 @@ source "drivers/ide/Kconfig"
65 67
66source "arch/h8300/Kconfig.ide" 68source "arch/h8300/Kconfig.ide"
67 69
68source "net/Kconfig" 70source "drivers/net/Kconfig"
69 71
70# 72#
71# input - input/joystick depends on it. As does USB. 73# input - input/joystick depends on it. As does USB.
@@ -179,6 +181,8 @@ source "drivers/serial/Kconfig"
179 181
180source "drivers/i2c/Kconfig" 182source "drivers/i2c/Kconfig"
181 183
184source "drivers/hwmon/Kconfig"
185
182source "drivers/usb/Kconfig" 186source "drivers/usb/Kconfig"
183 187
184endmenu 188endmenu
diff --git a/arch/h8300/kernel/process.c b/arch/h8300/kernel/process.c
index b5f83e9f04db..27f1fce64ce4 100644
--- a/arch/h8300/kernel/process.c
+++ b/arch/h8300/kernel/process.c
@@ -90,8 +90,6 @@ void machine_restart(char * __unused)
90 __asm__("jmp @@0"); 90 __asm__("jmp @@0");
91} 91}
92 92
93EXPORT_SYMBOL(machine_restart);
94
95void machine_halt(void) 93void machine_halt(void)
96{ 94{
97 local_irq_disable(); 95 local_irq_disable();
@@ -99,8 +97,6 @@ void machine_halt(void)
99 for (;;); 97 for (;;);
100} 98}
101 99
102EXPORT_SYMBOL(machine_halt);
103
104void machine_power_off(void) 100void machine_power_off(void)
105{ 101{
106 local_irq_disable(); 102 local_irq_disable();
@@ -108,8 +104,6 @@ void machine_power_off(void)
108 for (;;); 104 for (;;);
109} 105}
110 106
111EXPORT_SYMBOL(machine_power_off);
112
113void show_regs(struct pt_regs * regs) 107void show_regs(struct pt_regs * regs)
114{ 108{
115 printk("\nPC: %08lx Status: %02x", 109 printk("\nPC: %08lx Status: %02x",
diff --git a/arch/h8300/kernel/signal.c b/arch/h8300/kernel/signal.c
index 5aab87eae1f9..f13d5e82d4b9 100644
--- a/arch/h8300/kernel/signal.c
+++ b/arch/h8300/kernel/signal.c
@@ -488,13 +488,12 @@ handle_signal(unsigned long sig, siginfo_t *info, struct k_sigaction *ka,
488 else 488 else
489 setup_frame(sig, ka, oldset, regs); 489 setup_frame(sig, ka, oldset, regs);
490 490
491 if (!(ka->sa.sa_flags & SA_NODEFER)) { 491 spin_lock_irq(&current->sighand->siglock);
492 spin_lock_irq(&current->sighand->siglock); 492 sigorsets(&current->blocked,&current->blocked,&ka->sa.sa_mask);
493 sigorsets(&current->blocked,&current->blocked,&ka->sa.sa_mask); 493 if (!(ka->sa.sa_flags & SA_NODEFER))
494 sigaddset(&current->blocked,sig); 494 sigaddset(&current->blocked,sig);
495 recalc_sigpending(); 495 recalc_sigpending();
496 spin_unlock_irq(&current->sighand->siglock); 496 spin_unlock_irq(&current->sighand->siglock);
497 }
498} 497}
499 498
500/* 499/*
diff --git a/arch/i386/Kconfig b/arch/i386/Kconfig
index 6c02336fe2e4..3b3b017e1c15 100644
--- a/arch/i386/Kconfig
+++ b/arch/i386/Kconfig
@@ -14,6 +14,10 @@ config X86
14 486, 586, Pentiums, and various instruction-set-compatible chips by 14 486, 586, Pentiums, and various instruction-set-compatible chips by
15 AMD, Cyrix, and others. 15 AMD, Cyrix, and others.
16 16
17config SEMAPHORE_SLEEPERS
18 bool
19 default y
20
17config MMU 21config MMU
18 bool 22 bool
19 default y 23 default y
@@ -454,8 +458,9 @@ config HPET_TIMER
454 Choose N to continue using the legacy 8254 timer. 458 Choose N to continue using the legacy 8254 timer.
455 459
456config HPET_EMULATE_RTC 460config HPET_EMULATE_RTC
457 bool "Provide RTC interrupt" 461 bool
458 depends on HPET_TIMER && RTC=y 462 depends on HPET_TIMER && RTC=y
463 default y
459 464
460config SMP 465config SMP
461 bool "Symmetric multi-processing support" 466 bool "Symmetric multi-processing support"
@@ -753,6 +758,7 @@ config NUMA
753 depends on SMP && HIGHMEM64G && (X86_NUMAQ || X86_GENERICARCH || (X86_SUMMIT && ACPI)) 758 depends on SMP && HIGHMEM64G && (X86_NUMAQ || X86_GENERICARCH || (X86_SUMMIT && ACPI))
754 default n if X86_PC 759 default n if X86_PC
755 default y if (X86_NUMAQ || X86_SUMMIT) 760 default y if (X86_NUMAQ || X86_SUMMIT)
761 select SPARSEMEM_STATIC
756 762
757# Need comments to help the hapless user trying to turn on NUMA support 763# Need comments to help the hapless user trying to turn on NUMA support
758comment "NUMA (NUMA-Q) requires SMP, 64GB highmem support" 764comment "NUMA (NUMA-Q) requires SMP, 64GB highmem support"
@@ -1285,6 +1291,8 @@ source "fs/Kconfig.binfmt"
1285 1291
1286endmenu 1292endmenu
1287 1293
1294source "net/Kconfig"
1295
1288source "drivers/Kconfig" 1296source "drivers/Kconfig"
1289 1297
1290source "fs/Kconfig" 1298source "fs/Kconfig"
diff --git a/arch/i386/Kconfig.debug b/arch/i386/Kconfig.debug
index bfb2064f7104..5228c40a6fb2 100644
--- a/arch/i386/Kconfig.debug
+++ b/arch/i386/Kconfig.debug
@@ -18,6 +18,9 @@ config EARLY_PRINTK
18config DEBUG_STACKOVERFLOW 18config DEBUG_STACKOVERFLOW
19 bool "Check for stack overflows" 19 bool "Check for stack overflows"
20 depends on DEBUG_KERNEL 20 depends on DEBUG_KERNEL
21 help
22 This option will cause messages to be printed if free stack space
23 drops below a certain limit.
21 24
22config KPROBES 25config KPROBES
23 bool "Kprobes" 26 bool "Kprobes"
diff --git a/arch/i386/kernel/Makefile b/arch/i386/kernel/Makefile
index 4cc83b322b36..64682a0edacf 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 vm86.o \ 7obj-y := process.o semaphore.o signal.o entry.o traps.o irq.o vm86.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 doublefault.o quirks.o 10 doublefault.o quirks.o i8237.o
11 11
12obj-y += cpu/ 12obj-y += cpu/
13obj-y += timers/ 13obj-y += timers/
diff --git a/arch/i386/kernel/acpi/Makefile b/arch/i386/kernel/acpi/Makefile
index ee75cb286cfe..5e291a20c03d 100644
--- a/arch/i386/kernel/acpi/Makefile
+++ b/arch/i386/kernel/acpi/Makefile
@@ -2,3 +2,7 @@ obj-$(CONFIG_ACPI_BOOT) := boot.o
2obj-$(CONFIG_X86_IO_APIC) += earlyquirk.o 2obj-$(CONFIG_X86_IO_APIC) += earlyquirk.o
3obj-$(CONFIG_ACPI_SLEEP) += sleep.o wakeup.o 3obj-$(CONFIG_ACPI_SLEEP) += sleep.o wakeup.o
4 4
5ifneq ($(CONFIG_ACPI_PROCESSOR),)
6obj-y += cstate.o
7endif
8
diff --git a/arch/i386/kernel/acpi/boot.c b/arch/i386/kernel/acpi/boot.c
index b7808a89d945..34ee500c26e5 100644
--- a/arch/i386/kernel/acpi/boot.c
+++ b/arch/i386/kernel/acpi/boot.c
@@ -833,6 +833,9 @@ acpi_process_madt(void)
833 if (!error) { 833 if (!error) {
834 acpi_lapic = 1; 834 acpi_lapic = 1;
835 835
836#ifdef CONFIG_X86_GENERICARCH
837 generic_bigsmp_probe();
838#endif
836 /* 839 /*
837 * Parse MADT IO-APIC entries 840 * Parse MADT IO-APIC entries
838 */ 841 */
diff --git a/arch/i386/kernel/acpi/cstate.c b/arch/i386/kernel/acpi/cstate.c
new file mode 100644
index 000000000000..4c3036ba65df
--- /dev/null
+++ b/arch/i386/kernel/acpi/cstate.c
@@ -0,0 +1,103 @@
1/*
2 * arch/i386/kernel/acpi/cstate.c
3 *
4 * Copyright (C) 2005 Intel Corporation
5 * Venkatesh Pallipadi <venkatesh.pallipadi@intel.com>
6 * - Added _PDC for SMP C-states on Intel CPUs
7 */
8
9#include <linux/kernel.h>
10#include <linux/module.h>
11#include <linux/init.h>
12#include <linux/acpi.h>
13
14#include <acpi/processor.h>
15#include <asm/acpi.h>
16
17static void acpi_processor_power_init_intel_pdc(struct acpi_processor_power
18 *pow)
19{
20 struct acpi_object_list *obj_list;
21 union acpi_object *obj;
22 u32 *buf;
23
24 /* allocate and initialize pdc. It will be used later. */
25 obj_list = kmalloc(sizeof(struct acpi_object_list), GFP_KERNEL);
26 if (!obj_list) {
27 printk(KERN_ERR "Memory allocation error\n");
28 return;
29 }
30
31 obj = kmalloc(sizeof(union acpi_object), GFP_KERNEL);
32 if (!obj) {
33 printk(KERN_ERR "Memory allocation error\n");
34 kfree(obj_list);
35 return;
36 }
37
38 buf = kmalloc(12, GFP_KERNEL);
39 if (!buf) {
40 printk(KERN_ERR "Memory allocation error\n");
41 kfree(obj);
42 kfree(obj_list);
43 return;
44 }
45
46 buf[0] = ACPI_PDC_REVISION_ID;
47 buf[1] = 1;
48 buf[2] = ACPI_PDC_C_CAPABILITY_SMP;
49
50 obj->type = ACPI_TYPE_BUFFER;
51 obj->buffer.length = 12;
52 obj->buffer.pointer = (u8 *) buf;
53 obj_list->count = 1;
54 obj_list->pointer = obj;
55 pow->pdc = obj_list;
56
57 return;
58}
59
60/* Initialize _PDC data based on the CPU vendor */
61void acpi_processor_power_init_pdc(struct acpi_processor_power *pow,
62 unsigned int cpu)
63{
64 struct cpuinfo_x86 *c = cpu_data + cpu;
65
66 pow->pdc = NULL;
67 if (c->x86_vendor == X86_VENDOR_INTEL)
68 acpi_processor_power_init_intel_pdc(pow);
69
70 return;
71}
72
73EXPORT_SYMBOL(acpi_processor_power_init_pdc);
74
75/*
76 * Initialize bm_flags based on the CPU cache properties
77 * On SMP it depends on cache configuration
78 * - When cache is not shared among all CPUs, we flush cache
79 * before entering C3.
80 * - When cache is shared among all CPUs, we use bm_check
81 * mechanism as in UP case
82 *
83 * This routine is called only after all the CPUs are online
84 */
85void acpi_processor_power_init_bm_check(struct acpi_processor_flags *flags,
86 unsigned int cpu)
87{
88 struct cpuinfo_x86 *c = cpu_data + cpu;
89
90 flags->bm_check = 0;
91 if (num_online_cpus() == 1)
92 flags->bm_check = 1;
93 else if (c->x86_vendor == X86_VENDOR_INTEL) {
94 /*
95 * Today all CPUs that support C3 share cache.
96 * TBD: This needs to look at cache shared map, once
97 * multi-core detection patch makes to the base.
98 */
99 flags->bm_check = 1;
100 }
101}
102
103EXPORT_SYMBOL(acpi_processor_power_init_bm_check);
diff --git a/arch/i386/kernel/acpi/wakeup.S b/arch/i386/kernel/acpi/wakeup.S
index 39d32484f6f5..44d886c745ec 100644
--- a/arch/i386/kernel/acpi/wakeup.S
+++ b/arch/i386/kernel/acpi/wakeup.S
@@ -74,8 +74,9 @@ wakeup_code:
74 movw %ax,%fs 74 movw %ax,%fs
75 movw $0x0e00 + 'i', %fs:(0x12) 75 movw $0x0e00 + 'i', %fs:(0x12)
76 76
77 # need a gdt 77 # need a gdt -- use lgdtl to force 32-bit operands, in case
78 lgdt real_save_gdt - wakeup_code 78 # the GDT is located past 16 megabytes.
79 lgdtl real_save_gdt - wakeup_code
79 80
80 movl real_save_cr0 - wakeup_code, %eax 81 movl real_save_cr0 - wakeup_code, %eax
81 movl %eax, %cr0 82 movl %eax, %cr0
diff --git a/arch/i386/kernel/apic.c b/arch/i386/kernel/apic.c
index bd1dbf3bd223..a22a866de8f9 100644
--- a/arch/i386/kernel/apic.c
+++ b/arch/i386/kernel/apic.c
@@ -726,15 +726,11 @@ __setup("apic=", apic_set_verbosity);
726static int __init detect_init_APIC (void) 726static int __init detect_init_APIC (void)
727{ 727{
728 u32 h, l, features; 728 u32 h, l, features;
729 extern void get_cpu_vendor(struct cpuinfo_x86*);
730 729
731 /* Disabled by kernel option? */ 730 /* Disabled by kernel option? */
732 if (enable_local_apic < 0) 731 if (enable_local_apic < 0)
733 return -1; 732 return -1;
734 733
735 /* Workaround for us being called before identify_cpu(). */
736 get_cpu_vendor(&boot_cpu_data);
737
738 switch (boot_cpu_data.x86_vendor) { 734 switch (boot_cpu_data.x86_vendor) {
739 case X86_VENDOR_AMD: 735 case X86_VENDOR_AMD:
740 if ((boot_cpu_data.x86 == 6 && boot_cpu_data.x86_model > 1) || 736 if ((boot_cpu_data.x86 == 6 && boot_cpu_data.x86_model > 1) ||
diff --git a/arch/i386/kernel/apm.c b/arch/i386/kernel/apm.c
index 064211d5f41b..d7811c4e8b50 100644
--- a/arch/i386/kernel/apm.c
+++ b/arch/i386/kernel/apm.c
@@ -911,14 +911,7 @@ static void apm_power_off(void)
911 0xcd, 0x15 /* int $0x15 */ 911 0xcd, 0x15 /* int $0x15 */
912 }; 912 };
913 913
914 /*
915 * This may be called on an SMP machine.
916 */
917#ifdef CONFIG_SMP
918 /* Some bioses don't like being called from CPU != 0 */ 914 /* Some bioses don't like being called from CPU != 0 */
919 set_cpus_allowed(current, cpumask_of_cpu(0));
920 BUG_ON(smp_processor_id() != 0);
921#endif
922 if (apm_info.realmode_power_off) 915 if (apm_info.realmode_power_off)
923 { 916 {
924 (void)apm_save_cpus(); 917 (void)apm_save_cpus();
diff --git a/arch/i386/kernel/cpu/common.c b/arch/i386/kernel/cpu/common.c
index 4553ffd94b1f..46ce9b248f55 100644
--- a/arch/i386/kernel/cpu/common.c
+++ b/arch/i386/kernel/cpu/common.c
@@ -613,8 +613,8 @@ void __devinit cpu_init(void)
613 memcpy(thread->tls_array, &per_cpu(cpu_gdt_table, cpu), 613 memcpy(thread->tls_array, &per_cpu(cpu_gdt_table, cpu),
614 GDT_ENTRY_TLS_ENTRIES * 8); 614 GDT_ENTRY_TLS_ENTRIES * 8);
615 615
616 __asm__ __volatile__("lgdt %0" : : "m" (cpu_gdt_descr[cpu])); 616 load_gdt(&cpu_gdt_descr[cpu]);
617 __asm__ __volatile__("lidt %0" : : "m" (idt_descr)); 617 load_idt(&idt_descr);
618 618
619 /* 619 /*
620 * Delete NT 620 * Delete NT
@@ -642,12 +642,12 @@ void __devinit cpu_init(void)
642 asm volatile ("xorl %eax, %eax; movl %eax, %fs; movl %eax, %gs"); 642 asm volatile ("xorl %eax, %eax; movl %eax, %fs; movl %eax, %gs");
643 643
644 /* Clear all 6 debug registers: */ 644 /* Clear all 6 debug registers: */
645 645 set_debugreg(0, 0);
646#define CD(register) set_debugreg(0, register) 646 set_debugreg(0, 1);
647 647 set_debugreg(0, 2);
648 CD(0); CD(1); CD(2); CD(3); /* no db4 and db5 */; CD(6); CD(7); 648 set_debugreg(0, 3);
649 649 set_debugreg(0, 6);
650#undef CD 650 set_debugreg(0, 7);
651 651
652 /* 652 /*
653 * Force FPU initialization: 653 * Force FPU initialization:
diff --git a/arch/i386/kernel/cpu/cpufreq/acpi-cpufreq.c b/arch/i386/kernel/cpu/cpufreq/acpi-cpufreq.c
index 963e17aa205d..60a9e54dd20e 100644
--- a/arch/i386/kernel/cpu/cpufreq/acpi-cpufreq.c
+++ b/arch/i386/kernel/cpu/cpufreq/acpi-cpufreq.c
@@ -442,6 +442,13 @@ acpi_cpufreq_cpu_init (
442 (u32) data->acpi_data.states[i].transition_latency); 442 (u32) data->acpi_data.states[i].transition_latency);
443 443
444 cpufreq_frequency_table_get_attr(data->freq_table, policy->cpu); 444 cpufreq_frequency_table_get_attr(data->freq_table, policy->cpu);
445
446 /*
447 * the first call to ->target() should result in us actually
448 * writing something to the appropriate registers.
449 */
450 data->resume = 1;
451
445 return (result); 452 return (result);
446 453
447 err_freqfree: 454 err_freqfree:
diff --git a/arch/i386/kernel/cpu/cpufreq/longhaul.c b/arch/i386/kernel/cpu/cpufreq/longhaul.c
index 04e3563da4fe..bf02b5026e62 100644
--- a/arch/i386/kernel/cpu/cpufreq/longhaul.c
+++ b/arch/i386/kernel/cpu/cpufreq/longhaul.c
@@ -64,8 +64,6 @@ static int dont_scale_voltage;
64#define dprintk(msg...) cpufreq_debug_printk(CPUFREQ_DEBUG_DRIVER, "longhaul", msg) 64#define dprintk(msg...) cpufreq_debug_printk(CPUFREQ_DEBUG_DRIVER, "longhaul", msg)
65 65
66 66
67#define __hlt() __asm__ __volatile__("hlt": : :"memory")
68
69/* Clock ratios multiplied by 10 */ 67/* Clock ratios multiplied by 10 */
70static int clock_ratio[32]; 68static int clock_ratio[32];
71static int eblcr_table[32]; 69static int eblcr_table[32];
@@ -168,11 +166,9 @@ static void do_powersaver(union msr_longhaul *longhaul,
168 outb(0xFE,0x21); /* TMR0 only */ 166 outb(0xFE,0x21); /* TMR0 only */
169 outb(0xFF,0x80); /* delay */ 167 outb(0xFF,0x80); /* delay */
170 168
171 local_irq_enable(); 169 safe_halt();
172
173 __hlt();
174 wrmsrl(MSR_VIA_LONGHAUL, longhaul->val); 170 wrmsrl(MSR_VIA_LONGHAUL, longhaul->val);
175 __hlt(); 171 halt();
176 172
177 local_irq_disable(); 173 local_irq_disable();
178 174
@@ -251,9 +247,7 @@ static void longhaul_setstate(unsigned int clock_ratio_index)
251 bcr2.bits.CLOCKMUL = clock_ratio_index; 247 bcr2.bits.CLOCKMUL = clock_ratio_index;
252 local_irq_disable(); 248 local_irq_disable();
253 wrmsrl (MSR_VIA_BCR2, bcr2.val); 249 wrmsrl (MSR_VIA_BCR2, bcr2.val);
254 local_irq_enable(); 250 safe_halt();
255
256 __hlt();
257 251
258 /* Disable software clock multiplier */ 252 /* Disable software clock multiplier */
259 rdmsrl (MSR_VIA_BCR2, bcr2.val); 253 rdmsrl (MSR_VIA_BCR2, bcr2.val);
diff --git a/arch/i386/kernel/cpu/cpufreq/powernow-k8.c b/arch/i386/kernel/cpu/cpufreq/powernow-k8.c
index 10cc096c0ade..ab6e0611303d 100644
--- a/arch/i386/kernel/cpu/cpufreq/powernow-k8.c
+++ b/arch/i386/kernel/cpu/cpufreq/powernow-k8.c
@@ -1,5 +1,5 @@
1/* 1/*
2 * (c) 2003, 2004 Advanced Micro Devices, Inc. 2 * (c) 2003, 2004, 2005 Advanced Micro Devices, Inc.
3 * Your use of this code is subject to the terms and conditions of the 3 * Your use of this code is subject to the terms and conditions of the
4 * GNU general public license version 2. See "COPYING" or 4 * GNU general public license version 2. See "COPYING" or
5 * http://www.gnu.org/licenses/gpl.html 5 * http://www.gnu.org/licenses/gpl.html
@@ -44,7 +44,7 @@
44 44
45#define PFX "powernow-k8: " 45#define PFX "powernow-k8: "
46#define BFX PFX "BIOS error: " 46#define BFX PFX "BIOS error: "
47#define VERSION "version 1.40.2" 47#define VERSION "version 1.50.3"
48#include "powernow-k8.h" 48#include "powernow-k8.h"
49 49
50/* serialize freq changes */ 50/* serialize freq changes */
@@ -110,14 +110,13 @@ static int query_current_values_with_pending_wait(struct powernow_k8_data *data)
110 u32 lo, hi; 110 u32 lo, hi;
111 u32 i = 0; 111 u32 i = 0;
112 112
113 lo = MSR_S_LO_CHANGE_PENDING; 113 do {
114 while (lo & MSR_S_LO_CHANGE_PENDING) {
115 if (i++ > 0x1000000) { 114 if (i++ > 0x1000000) {
116 printk(KERN_ERR PFX "detected change pending stuck\n"); 115 printk(KERN_ERR PFX "detected change pending stuck\n");
117 return 1; 116 return 1;
118 } 117 }
119 rdmsr(MSR_FIDVID_STATUS, lo, hi); 118 rdmsr(MSR_FIDVID_STATUS, lo, hi);
120 } 119 } while (lo & MSR_S_LO_CHANGE_PENDING);
121 120
122 data->currvid = hi & MSR_S_HI_CURRENT_VID; 121 data->currvid = hi & MSR_S_HI_CURRENT_VID;
123 data->currfid = lo & MSR_S_LO_CURRENT_FID; 122 data->currfid = lo & MSR_S_LO_CURRENT_FID;
@@ -232,7 +231,7 @@ static int write_new_vid(struct powernow_k8_data *data, u32 vid)
232/* 231/*
233 * Reduce the vid by the max of step or reqvid. 232 * Reduce the vid by the max of step or reqvid.
234 * Decreasing vid codes represent increasing voltages: 233 * Decreasing vid codes represent increasing voltages:
235 * vid of 0 is 1.550V, vid of 0x1e is 0.800V, vid of 0x1f is off. 234 * vid of 0 is 1.550V, vid of 0x1e is 0.800V, vid of VID_OFF is off.
236 */ 235 */
237static int decrease_vid_code_by_step(struct powernow_k8_data *data, u32 reqvid, u32 step) 236static int decrease_vid_code_by_step(struct powernow_k8_data *data, u32 reqvid, u32 step)
238{ 237{
@@ -467,7 +466,7 @@ static int check_supported_cpu(unsigned int cpu)
467 eax = cpuid_eax(CPUID_PROCESSOR_SIGNATURE); 466 eax = cpuid_eax(CPUID_PROCESSOR_SIGNATURE);
468 if (((eax & CPUID_USE_XFAM_XMOD) != CPUID_USE_XFAM_XMOD) || 467 if (((eax & CPUID_USE_XFAM_XMOD) != CPUID_USE_XFAM_XMOD) ||
469 ((eax & CPUID_XFAM) != CPUID_XFAM_K8) || 468 ((eax & CPUID_XFAM) != CPUID_XFAM_K8) ||
470 ((eax & CPUID_XMOD) > CPUID_XMOD_REV_E)) { 469 ((eax & CPUID_XMOD) > CPUID_XMOD_REV_F)) {
471 printk(KERN_INFO PFX "Processor cpuid %x not supported\n", eax); 470 printk(KERN_INFO PFX "Processor cpuid %x not supported\n", eax);
472 goto out; 471 goto out;
473 } 472 }
@@ -696,6 +695,7 @@ static void powernow_k8_acpi_pst_values(struct powernow_k8_data *data, unsigned
696 695
697 data->irt = (data->acpi_data.states[index].control >> IRT_SHIFT) & IRT_MASK; 696 data->irt = (data->acpi_data.states[index].control >> IRT_SHIFT) & IRT_MASK;
698 data->rvo = (data->acpi_data.states[index].control >> RVO_SHIFT) & RVO_MASK; 697 data->rvo = (data->acpi_data.states[index].control >> RVO_SHIFT) & RVO_MASK;
698 data->exttype = (data->acpi_data.states[index].control >> EXT_TYPE_SHIFT) & EXT_TYPE_MASK;
699 data->plllock = (data->acpi_data.states[index].control >> PLL_L_SHIFT) & PLL_L_MASK; 699 data->plllock = (data->acpi_data.states[index].control >> PLL_L_SHIFT) & PLL_L_MASK;
700 data->vidmvs = 1 << ((data->acpi_data.states[index].control >> MVS_SHIFT) & MVS_MASK); 700 data->vidmvs = 1 << ((data->acpi_data.states[index].control >> MVS_SHIFT) & MVS_MASK);
701 data->vstable = (data->acpi_data.states[index].control >> VST_SHIFT) & VST_MASK; 701 data->vstable = (data->acpi_data.states[index].control >> VST_SHIFT) & VST_MASK;
@@ -735,8 +735,16 @@ static int powernow_k8_cpu_init_acpi(struct powernow_k8_data *data)
735 } 735 }
736 736
737 for (i = 0; i < data->acpi_data.state_count; i++) { 737 for (i = 0; i < data->acpi_data.state_count; i++) {
738 u32 fid = data->acpi_data.states[i].control & FID_MASK; 738 u32 fid;
739 u32 vid = (data->acpi_data.states[i].control >> VID_SHIFT) & VID_MASK; 739 u32 vid;
740
741 if (data->exttype) {
742 fid = data->acpi_data.states[i].status & FID_MASK;
743 vid = (data->acpi_data.states[i].status >> VID_SHIFT) & VID_MASK;
744 } else {
745 fid = data->acpi_data.states[i].control & FID_MASK;
746 vid = (data->acpi_data.states[i].control >> VID_SHIFT) & VID_MASK;
747 }
740 748
741 dprintk(" %d : fid 0x%x, vid 0x%x\n", i, fid, vid); 749 dprintk(" %d : fid 0x%x, vid 0x%x\n", i, fid, vid);
742 750
@@ -753,7 +761,7 @@ static int powernow_k8_cpu_init_acpi(struct powernow_k8_data *data)
753 } 761 }
754 762
755 /* verify voltage is OK - BIOSs are using "off" to indicate invalid */ 763 /* verify voltage is OK - BIOSs are using "off" to indicate invalid */
756 if (vid == 0x1f) { 764 if (vid == VID_OFF) {
757 dprintk("invalid vid %u, ignoring\n", vid); 765 dprintk("invalid vid %u, ignoring\n", vid);
758 powernow_table[i].frequency = CPUFREQ_ENTRY_INVALID; 766 powernow_table[i].frequency = CPUFREQ_ENTRY_INVALID;
759 continue; 767 continue;
@@ -930,15 +938,6 @@ static int powernowk8_target(struct cpufreq_policy *pol, unsigned targfreq, unsi
930 938
931 down(&fidvid_sem); 939 down(&fidvid_sem);
932 940
933 for_each_cpu_mask(i, cpu_core_map[pol->cpu]) {
934 /* make sure the sibling is initialized */
935 if (!powernow_data[i]) {
936 ret = 0;
937 up(&fidvid_sem);
938 goto err_out;
939 }
940 }
941
942 powernow_k8_acpi_pst_values(data, newstate); 941 powernow_k8_acpi_pst_values(data, newstate);
943 942
944 if (transition_frequency(data, newstate)) { 943 if (transition_frequency(data, newstate)) {
@@ -978,7 +977,7 @@ static int __init powernowk8_cpu_init(struct cpufreq_policy *pol)
978{ 977{
979 struct powernow_k8_data *data; 978 struct powernow_k8_data *data;
980 cpumask_t oldmask = CPU_MASK_ALL; 979 cpumask_t oldmask = CPU_MASK_ALL;
981 int rc; 980 int rc, i;
982 981
983 if (!check_supported_cpu(pol->cpu)) 982 if (!check_supported_cpu(pol->cpu))
984 return -ENODEV; 983 return -ENODEV;
@@ -1064,7 +1063,9 @@ static int __init powernowk8_cpu_init(struct cpufreq_policy *pol)
1064 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",
1065 data->currfid, data->currvid); 1064 data->currfid, data->currvid);
1066 1065
1067 powernow_data[pol->cpu] = data; 1066 for_each_cpu_mask(i, cpu_core_map[pol->cpu]) {
1067 powernow_data[i] = data;
1068 }
1068 1069
1069 return 0; 1070 return 0;
1070 1071
diff --git a/arch/i386/kernel/cpu/cpufreq/powernow-k8.h b/arch/i386/kernel/cpu/cpufreq/powernow-k8.h
index 9ed5bf221cb7..b1e85bb36396 100644
--- a/arch/i386/kernel/cpu/cpufreq/powernow-k8.h
+++ b/arch/i386/kernel/cpu/cpufreq/powernow-k8.h
@@ -1,5 +1,5 @@
1/* 1/*
2 * (c) 2003, 2004 Advanced Micro Devices, Inc. 2 * (c) 2003, 2004, 2005 Advanced Micro Devices, Inc.
3 * Your use of this code is subject to the terms and conditions of the 3 * Your use of this code is subject to the terms and conditions of the
4 * GNU general public license version 2. See "COPYING" or 4 * GNU general public license version 2. See "COPYING" or
5 * http://www.gnu.org/licenses/gpl.html 5 * http://www.gnu.org/licenses/gpl.html
@@ -19,6 +19,7 @@ struct powernow_k8_data {
19 u32 vidmvs; /* usable value calculated from mvs */ 19 u32 vidmvs; /* usable value calculated from mvs */
20 u32 vstable; /* voltage stabilization time, units 20 us */ 20 u32 vstable; /* voltage stabilization time, units 20 us */
21 u32 plllock; /* pll lock time, units 1 us */ 21 u32 plllock; /* pll lock time, units 1 us */
22 u32 exttype; /* extended interface = 1 */
22 23
23 /* keep track of the current fid / vid */ 24 /* keep track of the current fid / vid */
24 u32 currvid, currfid; 25 u32 currvid, currfid;
@@ -41,7 +42,7 @@ struct powernow_k8_data {
41#define CPUID_XFAM 0x0ff00000 /* extended family */ 42#define CPUID_XFAM 0x0ff00000 /* extended family */
42#define CPUID_XFAM_K8 0 43#define CPUID_XFAM_K8 0
43#define CPUID_XMOD 0x000f0000 /* extended model */ 44#define CPUID_XMOD 0x000f0000 /* extended model */
44#define CPUID_XMOD_REV_E 0x00020000 45#define CPUID_XMOD_REV_F 0x00040000
45#define CPUID_USE_XFAM_XMOD 0x00000f00 46#define CPUID_USE_XFAM_XMOD 0x00000f00
46#define CPUID_GET_MAX_CAPABILITIES 0x80000000 47#define CPUID_GET_MAX_CAPABILITIES 0x80000000
47#define CPUID_FREQ_VOLT_CAPABILITIES 0x80000007 48#define CPUID_FREQ_VOLT_CAPABILITIES 0x80000007
@@ -57,25 +58,26 @@ struct powernow_k8_data {
57 58
58/* Field definitions within the FID VID Low Control MSR : */ 59/* Field definitions within the FID VID Low Control MSR : */
59#define MSR_C_LO_INIT_FID_VID 0x00010000 60#define MSR_C_LO_INIT_FID_VID 0x00010000
60#define MSR_C_LO_NEW_VID 0x00001f00 61#define MSR_C_LO_NEW_VID 0x00003f00
61#define MSR_C_LO_NEW_FID 0x0000002f 62#define MSR_C_LO_NEW_FID 0x0000003f
62#define MSR_C_LO_VID_SHIFT 8 63#define MSR_C_LO_VID_SHIFT 8
63 64
64/* Field definitions within the FID VID High Control MSR : */ 65/* Field definitions within the FID VID High Control MSR : */
65#define MSR_C_HI_STP_GNT_TO 0x000fffff 66#define MSR_C_HI_STP_GNT_TO 0x000fffff
66 67
67/* Field definitions within the FID VID Low Status MSR : */ 68/* Field definitions within the FID VID Low Status MSR : */
68#define MSR_S_LO_CHANGE_PENDING 0x80000000 /* cleared when completed */ 69#define MSR_S_LO_CHANGE_PENDING 0x80000000 /* cleared when completed */
69#define MSR_S_LO_MAX_RAMP_VID 0x1f000000 70#define MSR_S_LO_MAX_RAMP_VID 0x3f000000
70#define MSR_S_LO_MAX_FID 0x003f0000 71#define MSR_S_LO_MAX_FID 0x003f0000
71#define MSR_S_LO_START_FID 0x00003f00 72#define MSR_S_LO_START_FID 0x00003f00
72#define MSR_S_LO_CURRENT_FID 0x0000003f 73#define MSR_S_LO_CURRENT_FID 0x0000003f
73 74
74/* Field definitions within the FID VID High Status MSR : */ 75/* Field definitions within the FID VID High Status MSR : */
75#define MSR_S_HI_MAX_WORKING_VID 0x001f0000 76#define MSR_S_HI_MIN_WORKING_VID 0x3f000000
76#define MSR_S_HI_START_VID 0x00001f00 77#define MSR_S_HI_MAX_WORKING_VID 0x003f0000
77#define MSR_S_HI_CURRENT_VID 0x0000001f 78#define MSR_S_HI_START_VID 0x00003f00
78#define MSR_C_HI_STP_GNT_BENIGN 0x00000001 79#define MSR_S_HI_CURRENT_VID 0x0000003f
80#define MSR_C_HI_STP_GNT_BENIGN 0x00000001
79 81
80/* 82/*
81 * There are restrictions frequencies have to follow: 83 * There are restrictions frequencies have to follow:
@@ -99,13 +101,15 @@ struct powernow_k8_data {
99#define MIN_FREQ_RESOLUTION 200 /* fids jump by 2 matching freq jumps by 200 */ 101#define MIN_FREQ_RESOLUTION 200 /* fids jump by 2 matching freq jumps by 200 */
100 102
101#define MAX_FID 0x2a /* Spec only gives FID values as far as 5 GHz */ 103#define MAX_FID 0x2a /* Spec only gives FID values as far as 5 GHz */
102#define LEAST_VID 0x1e /* Lowest (numerically highest) useful vid value */ 104#define LEAST_VID 0x3e /* Lowest (numerically highest) useful vid value */
103 105
104#define MIN_FREQ 800 /* Min and max freqs, per spec */ 106#define MIN_FREQ 800 /* Min and max freqs, per spec */
105#define MAX_FREQ 5000 107#define MAX_FREQ 5000
106 108
107#define INVALID_FID_MASK 0xffffffc1 /* not a valid fid if these bits are set */ 109#define INVALID_FID_MASK 0xffffffc1 /* not a valid fid if these bits are set */
108#define INVALID_VID_MASK 0xffffffe0 /* not a valid vid if these bits are set */ 110#define INVALID_VID_MASK 0xffffffc0 /* not a valid vid if these bits are set */
111
112#define VID_OFF 0x3f
109 113
110#define STOP_GRANT_5NS 1 /* min poss memory access latency for voltage change */ 114#define STOP_GRANT_5NS 1 /* min poss memory access latency for voltage change */
111 115
@@ -121,12 +125,14 @@ struct powernow_k8_data {
121 125
122#define IRT_SHIFT 30 126#define IRT_SHIFT 30
123#define RVO_SHIFT 28 127#define RVO_SHIFT 28
128#define EXT_TYPE_SHIFT 27
124#define PLL_L_SHIFT 20 129#define PLL_L_SHIFT 20
125#define MVS_SHIFT 18 130#define MVS_SHIFT 18
126#define VST_SHIFT 11 131#define VST_SHIFT 11
127#define VID_SHIFT 6 132#define VID_SHIFT 6
128#define IRT_MASK 3 133#define IRT_MASK 3
129#define RVO_MASK 3 134#define RVO_MASK 3
135#define EXT_TYPE_MASK 1
130#define PLL_L_MASK 0x7f 136#define PLL_L_MASK 0x7f
131#define MVS_MASK 3 137#define MVS_MASK 3
132#define VST_MASK 0x7f 138#define VST_MASK 0x7f
diff --git a/arch/i386/kernel/cpu/cpufreq/speedstep-centrino.c b/arch/i386/kernel/cpu/cpufreq/speedstep-centrino.c
index 7dcbf70fc16f..327a55d4d1c6 100644
--- a/arch/i386/kernel/cpu/cpufreq/speedstep-centrino.c
+++ b/arch/i386/kernel/cpu/cpufreq/speedstep-centrino.c
@@ -375,7 +375,7 @@ static int centrino_cpu_init_acpi(struct cpufreq_policy *policy)
375 arg0.buffer.pointer = (u8 *) arg0_buf; 375 arg0.buffer.pointer = (u8 *) arg0_buf;
376 arg0_buf[0] = ACPI_PDC_REVISION_ID; 376 arg0_buf[0] = ACPI_PDC_REVISION_ID;
377 arg0_buf[1] = 1; 377 arg0_buf[1] = 1;
378 arg0_buf[2] = ACPI_PDC_EST_CAPABILITY_SMP | ACPI_PDC_EST_CAPABILITY_MSR; 378 arg0_buf[2] = ACPI_PDC_EST_CAPABILITY_SMP_MSR;
379 379
380 p.pdc = &arg_list; 380 p.pdc = &arg_list;
381 381
diff --git a/arch/i386/kernel/cpu/cyrix.c b/arch/i386/kernel/cpu/cyrix.c
index ba4b01138c8f..ff87cc22b323 100644
--- a/arch/i386/kernel/cpu/cyrix.c
+++ b/arch/i386/kernel/cpu/cyrix.c
@@ -132,11 +132,7 @@ static void __init set_cx86_memwb(void)
132 setCx86(CX86_CCR2, getCx86(CX86_CCR2) & ~0x04); 132 setCx86(CX86_CCR2, getCx86(CX86_CCR2) & ~0x04);
133 /* set 'Not Write-through' */ 133 /* set 'Not Write-through' */
134 cr0 = 0x20000000; 134 cr0 = 0x20000000;
135 __asm__("movl %%cr0,%%eax\n\t" 135 write_cr0(read_cr0() | cr0);
136 "orl %0,%%eax\n\t"
137 "movl %%eax,%%cr0\n"
138 : : "r" (cr0)
139 :"ax");
140 /* CCR2 bit 2: lock NW bit and set WT1 */ 136 /* CCR2 bit 2: lock NW bit and set WT1 */
141 setCx86(CX86_CCR2, getCx86(CX86_CCR2) | 0x14 ); 137 setCx86(CX86_CCR2, getCx86(CX86_CCR2) | 0x14 );
142} 138}
diff --git a/arch/i386/kernel/cpu/intel.c b/arch/i386/kernel/cpu/intel.c
index a2c33c1a46c5..43601de0f633 100644
--- a/arch/i386/kernel/cpu/intel.c
+++ b/arch/i386/kernel/cpu/intel.c
@@ -82,16 +82,13 @@ static void __devinit Intel_errata_workarounds(struct cpuinfo_x86 *c)
82 */ 82 */
83static int __devinit num_cpu_cores(struct cpuinfo_x86 *c) 83static int __devinit num_cpu_cores(struct cpuinfo_x86 *c)
84{ 84{
85 unsigned int eax; 85 unsigned int eax, ebx, ecx, edx;
86 86
87 if (c->cpuid_level < 4) 87 if (c->cpuid_level < 4)
88 return 1; 88 return 1;
89 89
90 __asm__("cpuid" 90 /* Intel has a non-standard dependency on %ecx for this CPUID level. */
91 : "=a" (eax) 91 cpuid_count(4, 0, &eax, &ebx, &ecx, &edx);
92 : "0" (4), "c" (0)
93 : "bx", "dx");
94
95 if (eax & 0x1f) 92 if (eax & 0x1f)
96 return ((eax >> 26) + 1); 93 return ((eax >> 26) + 1);
97 else 94 else
diff --git a/arch/i386/kernel/cpu/intel_cacheinfo.c b/arch/i386/kernel/cpu/intel_cacheinfo.c
index 1d768b263269..9e0d5f83cb9f 100644
--- a/arch/i386/kernel/cpu/intel_cacheinfo.c
+++ b/arch/i386/kernel/cpu/intel_cacheinfo.c
@@ -128,7 +128,7 @@ static int __devinit cpuid4_cache_lookup(int index, struct _cpuid4_info *this_le
128 cpuid_count(4, index, &eax, &ebx, &ecx, &edx); 128 cpuid_count(4, index, &eax, &ebx, &ecx, &edx);
129 cache_eax.full = eax; 129 cache_eax.full = eax;
130 if (cache_eax.split.type == CACHE_TYPE_NULL) 130 if (cache_eax.split.type == CACHE_TYPE_NULL)
131 return -1; 131 return -EIO; /* better error ? */
132 132
133 this_leaf->eax.full = eax; 133 this_leaf->eax.full = eax;
134 this_leaf->ebx.full = ebx; 134 this_leaf->ebx.full = ebx;
@@ -305,6 +305,9 @@ static void __devinit cache_shared_cpu_map_setup(unsigned int cpu, int index)
305{ 305{
306 struct _cpuid4_info *this_leaf; 306 struct _cpuid4_info *this_leaf;
307 unsigned long num_threads_sharing; 307 unsigned long num_threads_sharing;
308#ifdef CONFIG_X86_HT
309 struct cpuinfo_x86 *c = cpu_data + cpu;
310#endif
308 311
309 this_leaf = CPUID4_INFO_IDX(cpu, index); 312 this_leaf = CPUID4_INFO_IDX(cpu, index);
310 num_threads_sharing = 1 + this_leaf->eax.split.num_threads_sharing; 313 num_threads_sharing = 1 + this_leaf->eax.split.num_threads_sharing;
@@ -314,10 +317,12 @@ static void __devinit cache_shared_cpu_map_setup(unsigned int cpu, int index)
314#ifdef CONFIG_X86_HT 317#ifdef CONFIG_X86_HT
315 else if (num_threads_sharing == smp_num_siblings) 318 else if (num_threads_sharing == smp_num_siblings)
316 this_leaf->shared_cpu_map = cpu_sibling_map[cpu]; 319 this_leaf->shared_cpu_map = cpu_sibling_map[cpu];
317#endif 320 else if (num_threads_sharing == (c->x86_num_cores * smp_num_siblings))
321 this_leaf->shared_cpu_map = cpu_core_map[cpu];
318 else 322 else
319 printk(KERN_INFO "Number of CPUs sharing cache didn't match " 323 printk(KERN_DEBUG "Number of CPUs sharing cache didn't match "
320 "any known set of CPUs\n"); 324 "any known set of CPUs\n");
325#endif
321} 326}
322#else 327#else
323static void __init cache_shared_cpu_map_setup(unsigned int cpu, int index) {} 328static void __init cache_shared_cpu_map_setup(unsigned int cpu, int index) {}
@@ -334,6 +339,7 @@ static int __devinit detect_cache_attributes(unsigned int cpu)
334 struct _cpuid4_info *this_leaf; 339 struct _cpuid4_info *this_leaf;
335 unsigned long j; 340 unsigned long j;
336 int retval; 341 int retval;
342 cpumask_t oldmask;
337 343
338 if (num_cache_leaves == 0) 344 if (num_cache_leaves == 0)
339 return -ENOENT; 345 return -ENOENT;
@@ -345,19 +351,26 @@ static int __devinit detect_cache_attributes(unsigned int cpu)
345 memset(cpuid4_info[cpu], 0, 351 memset(cpuid4_info[cpu], 0,
346 sizeof(struct _cpuid4_info) * num_cache_leaves); 352 sizeof(struct _cpuid4_info) * num_cache_leaves);
347 353
354 oldmask = current->cpus_allowed;
355 retval = set_cpus_allowed(current, cpumask_of_cpu(cpu));
356 if (retval)
357 goto out;
358
348 /* Do cpuid and store the results */ 359 /* Do cpuid and store the results */
360 retval = 0;
349 for (j = 0; j < num_cache_leaves; j++) { 361 for (j = 0; j < num_cache_leaves; j++) {
350 this_leaf = CPUID4_INFO_IDX(cpu, j); 362 this_leaf = CPUID4_INFO_IDX(cpu, j);
351 retval = cpuid4_cache_lookup(j, this_leaf); 363 retval = cpuid4_cache_lookup(j, this_leaf);
352 if (unlikely(retval < 0)) 364 if (unlikely(retval < 0))
353 goto err_out; 365 break;
354 cache_shared_cpu_map_setup(cpu, j); 366 cache_shared_cpu_map_setup(cpu, j);
355 } 367 }
356 return 0; 368 set_cpus_allowed(current, oldmask);
357 369
358err_out: 370out:
359 free_cache_attributes(cpu); 371 if (retval)
360 return -ENOMEM; 372 free_cache_attributes(cpu);
373 return retval;
361} 374}
362 375
363#ifdef CONFIG_SYSFS 376#ifdef CONFIG_SYSFS
diff --git a/arch/i386/kernel/cpu/mtrr/main.c b/arch/i386/kernel/cpu/mtrr/main.c
index 764cac64e211..dd4ebd6af7e4 100644
--- a/arch/i386/kernel/cpu/mtrr/main.c
+++ b/arch/i386/kernel/cpu/mtrr/main.c
@@ -561,7 +561,7 @@ struct mtrr_value {
561 561
562static struct mtrr_value * mtrr_state; 562static struct mtrr_value * mtrr_state;
563 563
564static int mtrr_save(struct sys_device * sysdev, u32 state) 564static int mtrr_save(struct sys_device * sysdev, pm_message_t state)
565{ 565{
566 int i; 566 int i;
567 int size = num_var_ranges * sizeof(struct mtrr_value); 567 int size = num_var_ranges * sizeof(struct mtrr_value);
diff --git a/arch/i386/kernel/cpu/transmeta.c b/arch/i386/kernel/cpu/transmeta.c
index f57e5ee94943..fc426380366b 100644
--- a/arch/i386/kernel/cpu/transmeta.c
+++ b/arch/i386/kernel/cpu/transmeta.c
@@ -76,6 +76,12 @@ static void __init init_transmeta(struct cpuinfo_x86 *c)
76#define USER686 (X86_FEATURE_TSC|X86_FEATURE_CX8|X86_FEATURE_CMOV) 76#define USER686 (X86_FEATURE_TSC|X86_FEATURE_CX8|X86_FEATURE_CMOV)
77 if ( c->x86 == 5 && (c->x86_capability[0] & USER686) == USER686 ) 77 if ( c->x86 == 5 && (c->x86_capability[0] & USER686) == USER686 )
78 c->x86 = 6; 78 c->x86 = 6;
79
80#ifdef CONFIG_SYSCTL
81 /* randomize_va_space slows us down enormously;
82 it probably triggers retranslation of x86->native bytecode */
83 randomize_va_space = 0;
84#endif
79} 85}
80 86
81static void transmeta_identify(struct cpuinfo_x86 * c) 87static void transmeta_identify(struct cpuinfo_x86 * c)
diff --git a/arch/i386/kernel/crash.c b/arch/i386/kernel/crash.c
index e5fab12f7926..913be77bb844 100644
--- a/arch/i386/kernel/crash.c
+++ b/arch/i386/kernel/crash.c
@@ -153,7 +153,7 @@ static int crash_nmi_callback(struct pt_regs *regs, int cpu)
153 disable_local_APIC(); 153 disable_local_APIC();
154 atomic_dec(&waiting_for_crash_ipi); 154 atomic_dec(&waiting_for_crash_ipi);
155 /* Assume hlt works */ 155 /* Assume hlt works */
156 __asm__("hlt"); 156 halt();
157 for(;;); 157 for(;;);
158 158
159 return 1; 159 return 1;
diff --git a/arch/i386/kernel/doublefault.c b/arch/i386/kernel/doublefault.c
index 789af3e9fb1f..5edb1d379add 100644
--- a/arch/i386/kernel/doublefault.c
+++ b/arch/i386/kernel/doublefault.c
@@ -20,7 +20,7 @@ static void doublefault_fn(void)
20 struct Xgt_desc_struct gdt_desc = {0, 0}; 20 struct Xgt_desc_struct gdt_desc = {0, 0};
21 unsigned long gdt, tss; 21 unsigned long gdt, tss;
22 22
23 __asm__ __volatile__("sgdt %0": "=m" (gdt_desc): :"memory"); 23 store_gdt(&gdt_desc);
24 gdt = gdt_desc.address; 24 gdt = gdt_desc.address;
25 25
26 printk("double fault, gdt at %08lx [%d bytes]\n", gdt, gdt_desc.size); 26 printk("double fault, gdt at %08lx [%d bytes]\n", gdt, gdt_desc.size);
diff --git a/arch/i386/kernel/efi.c b/arch/i386/kernel/efi.c
index 385883ea8c19..ecad519fd395 100644
--- a/arch/i386/kernel/efi.c
+++ b/arch/i386/kernel/efi.c
@@ -79,7 +79,7 @@ static void efi_call_phys_prelog(void)
79 * directory. If I have PSE, I just need to duplicate one entry in 79 * directory. If I have PSE, I just need to duplicate one entry in
80 * page directory. 80 * page directory.
81 */ 81 */
82 __asm__ __volatile__("movl %%cr4, %0":"=r"(cr4)); 82 cr4 = read_cr4();
83 83
84 if (cr4 & X86_CR4_PSE) { 84 if (cr4 & X86_CR4_PSE) {
85 efi_bak_pg_dir_pointer[0].pgd = 85 efi_bak_pg_dir_pointer[0].pgd =
@@ -104,8 +104,7 @@ static void efi_call_phys_prelog(void)
104 local_flush_tlb(); 104 local_flush_tlb();
105 105
106 cpu_gdt_descr[0].address = __pa(cpu_gdt_descr[0].address); 106 cpu_gdt_descr[0].address = __pa(cpu_gdt_descr[0].address);
107 __asm__ __volatile__("lgdt %0":"=m" 107 load_gdt((struct Xgt_desc_struct *) __pa(&cpu_gdt_descr[0]));
108 (*(struct Xgt_desc_struct *) __pa(&cpu_gdt_descr[0])));
109} 108}
110 109
111static void efi_call_phys_epilog(void) 110static void efi_call_phys_epilog(void)
@@ -114,8 +113,8 @@ static void efi_call_phys_epilog(void)
114 113
115 cpu_gdt_descr[0].address = 114 cpu_gdt_descr[0].address =
116 (unsigned long) __va(cpu_gdt_descr[0].address); 115 (unsigned long) __va(cpu_gdt_descr[0].address);
117 __asm__ __volatile__("lgdt %0":"=m"(cpu_gdt_descr)); 116 load_gdt(&cpu_gdt_descr[0]);
118 __asm__ __volatile__("movl %%cr4, %0":"=r"(cr4)); 117 cr4 = read_cr4();
119 118
120 if (cr4 & X86_CR4_PSE) { 119 if (cr4 & X86_CR4_PSE) {
121 swapper_pg_dir[pgd_index(0)].pgd = 120 swapper_pg_dir[pgd_index(0)].pgd =
@@ -233,22 +232,23 @@ void __init efi_map_memmap(void)
233{ 232{
234 memmap.map = NULL; 233 memmap.map = NULL;
235 234
236 memmap.map = (efi_memory_desc_t *) 235 memmap.map = bt_ioremap((unsigned long) memmap.phys_map,
237 bt_ioremap((unsigned long) memmap.phys_map, 236 (memmap.nr_map * memmap.desc_size));
238 (memmap.nr_map * sizeof(efi_memory_desc_t)));
239
240 if (memmap.map == NULL) 237 if (memmap.map == NULL)
241 printk(KERN_ERR PFX "Could not remap the EFI memmap!\n"); 238 printk(KERN_ERR PFX "Could not remap the EFI memmap!\n");
239
240 memmap.map_end = memmap.map + (memmap.nr_map * memmap.desc_size);
242} 241}
243 242
244#if EFI_DEBUG 243#if EFI_DEBUG
245static void __init print_efi_memmap(void) 244static void __init print_efi_memmap(void)
246{ 245{
247 efi_memory_desc_t *md; 246 efi_memory_desc_t *md;
247 void *p;
248 int i; 248 int i;
249 249
250 for (i = 0; i < memmap.nr_map; i++) { 250 for (p = memmap.map, i = 0; p < memmap.map_end; p += memmap.desc_size, i++) {
251 md = &memmap.map[i]; 251 md = p;
252 printk(KERN_INFO "mem%02u: type=%u, attr=0x%llx, " 252 printk(KERN_INFO "mem%02u: type=%u, attr=0x%llx, "
253 "range=[0x%016llx-0x%016llx) (%lluMB)\n", 253 "range=[0x%016llx-0x%016llx) (%lluMB)\n",
254 i, md->type, md->attribute, md->phys_addr, 254 i, md->type, md->attribute, md->phys_addr,
@@ -271,10 +271,10 @@ void efi_memmap_walk(efi_freemem_callback_t callback, void *arg)
271 } prev, curr; 271 } prev, curr;
272 efi_memory_desc_t *md; 272 efi_memory_desc_t *md;
273 unsigned long start, end; 273 unsigned long start, end;
274 int i; 274 void *p;
275 275
276 for (i = 0; i < memmap.nr_map; i++) { 276 for (p = memmap.map; p < memmap.map_end; p += memmap.desc_size) {
277 md = &memmap.map[i]; 277 md = p;
278 278
279 if ((md->num_pages == 0) || (!is_available_memory(md))) 279 if ((md->num_pages == 0) || (!is_available_memory(md)))
280 continue; 280 continue;
@@ -325,6 +325,7 @@ void __init efi_init(void)
325 memmap.phys_map = EFI_MEMMAP; 325 memmap.phys_map = EFI_MEMMAP;
326 memmap.nr_map = EFI_MEMMAP_SIZE/EFI_MEMDESC_SIZE; 326 memmap.nr_map = EFI_MEMMAP_SIZE/EFI_MEMDESC_SIZE;
327 memmap.desc_version = EFI_MEMDESC_VERSION; 327 memmap.desc_version = EFI_MEMDESC_VERSION;
328 memmap.desc_size = EFI_MEMDESC_SIZE;
328 329
329 efi.systab = (efi_system_table_t *) 330 efi.systab = (efi_system_table_t *)
330 boot_ioremap((unsigned long) efi_phys.systab, 331 boot_ioremap((unsigned long) efi_phys.systab,
@@ -428,22 +429,30 @@ void __init efi_init(void)
428 printk(KERN_ERR PFX "Could not map the runtime service table!\n"); 429 printk(KERN_ERR PFX "Could not map the runtime service table!\n");
429 430
430 /* Map the EFI memory map for use until paging_init() */ 431 /* Map the EFI memory map for use until paging_init() */
431 432 memmap.map = boot_ioremap((unsigned long) EFI_MEMMAP, EFI_MEMMAP_SIZE);
432 memmap.map = (efi_memory_desc_t *)
433 boot_ioremap((unsigned long) EFI_MEMMAP, EFI_MEMMAP_SIZE);
434
435 if (memmap.map == NULL) 433 if (memmap.map == NULL)
436 printk(KERN_ERR PFX "Could not map the EFI memory map!\n"); 434 printk(KERN_ERR PFX "Could not map the EFI memory map!\n");
437 435
438 if (EFI_MEMDESC_SIZE != sizeof(efi_memory_desc_t)) { 436 memmap.map_end = memmap.map + (memmap.nr_map * memmap.desc_size);
439 printk(KERN_WARNING PFX "Warning! Kernel-defined memdesc doesn't " 437
440 "match the one from EFI!\n");
441 }
442#if EFI_DEBUG 438#if EFI_DEBUG
443 print_efi_memmap(); 439 print_efi_memmap();
444#endif 440#endif
445} 441}
446 442
443static inline void __init check_range_for_systab(efi_memory_desc_t *md)
444{
445 if (((unsigned long)md->phys_addr <= (unsigned long)efi_phys.systab) &&
446 ((unsigned long)efi_phys.systab < md->phys_addr +
447 ((unsigned long)md->num_pages << EFI_PAGE_SHIFT))) {
448 unsigned long addr;
449
450 addr = md->virt_addr - md->phys_addr +
451 (unsigned long)efi_phys.systab;
452 efi.systab = (efi_system_table_t *)addr;
453 }
454}
455
447/* 456/*
448 * This function will switch the EFI runtime services to virtual mode. 457 * This function will switch the EFI runtime services to virtual mode.
449 * Essentially, look through the EFI memmap and map every region that 458 * Essentially, look through the EFI memmap and map every region that
@@ -457,43 +466,32 @@ void __init efi_enter_virtual_mode(void)
457{ 466{
458 efi_memory_desc_t *md; 467 efi_memory_desc_t *md;
459 efi_status_t status; 468 efi_status_t status;
460 int i; 469 void *p;
461 470
462 efi.systab = NULL; 471 efi.systab = NULL;
463 472
464 for (i = 0; i < memmap.nr_map; i++) { 473 for (p = memmap.map; p < memmap.map_end; p += memmap.desc_size) {
465 md = &memmap.map[i]; 474 md = p;
466 475
467 if (md->attribute & EFI_MEMORY_RUNTIME) { 476 if (!(md->attribute & EFI_MEMORY_RUNTIME))
468 md->virt_addr = 477 continue;
469 (unsigned long)ioremap(md->phys_addr,
470 md->num_pages << EFI_PAGE_SHIFT);
471 if (!(unsigned long)md->virt_addr) {
472 printk(KERN_ERR PFX "ioremap of 0x%lX failed\n",
473 (unsigned long)md->phys_addr);
474 }
475 478
476 if (((unsigned long)md->phys_addr <= 479 md->virt_addr = (unsigned long)ioremap(md->phys_addr,
477 (unsigned long)efi_phys.systab) && 480 md->num_pages << EFI_PAGE_SHIFT);
478 ((unsigned long)efi_phys.systab < 481 if (!(unsigned long)md->virt_addr) {
479 md->phys_addr + 482 printk(KERN_ERR PFX "ioremap of 0x%lX failed\n",
480 ((unsigned long)md->num_pages << 483 (unsigned long)md->phys_addr);
481 EFI_PAGE_SHIFT))) {
482 unsigned long addr;
483
484 addr = md->virt_addr - md->phys_addr +
485 (unsigned long)efi_phys.systab;
486 efi.systab = (efi_system_table_t *)addr;
487 }
488 } 484 }
485 /* update the virtual address of the EFI system table */
486 check_range_for_systab(md);
489 } 487 }
490 488
491 if (!efi.systab) 489 if (!efi.systab)
492 BUG(); 490 BUG();
493 491
494 status = phys_efi_set_virtual_address_map( 492 status = phys_efi_set_virtual_address_map(
495 sizeof(efi_memory_desc_t) * memmap.nr_map, 493 memmap.desc_size * memmap.nr_map,
496 sizeof(efi_memory_desc_t), 494 memmap.desc_size,
497 memmap.desc_version, 495 memmap.desc_version,
498 memmap.phys_map); 496 memmap.phys_map);
499 497
@@ -533,10 +531,10 @@ efi_initialize_iomem_resources(struct resource *code_resource,
533{ 531{
534 struct resource *res; 532 struct resource *res;
535 efi_memory_desc_t *md; 533 efi_memory_desc_t *md;
536 int i; 534 void *p;
537 535
538 for (i = 0; i < memmap.nr_map; i++) { 536 for (p = memmap.map; p < memmap.map_end; p += memmap.desc_size) {
539 md = &memmap.map[i]; 537 md = p;
540 538
541 if ((md->phys_addr + (md->num_pages << EFI_PAGE_SHIFT)) > 539 if ((md->phys_addr + (md->num_pages << EFI_PAGE_SHIFT)) >
542 0x100000000ULL) 540 0x100000000ULL)
@@ -613,10 +611,10 @@ efi_initialize_iomem_resources(struct resource *code_resource,
613u32 efi_mem_type(unsigned long phys_addr) 611u32 efi_mem_type(unsigned long phys_addr)
614{ 612{
615 efi_memory_desc_t *md; 613 efi_memory_desc_t *md;
616 int i; 614 void *p;
617 615
618 for (i = 0; i < memmap.nr_map; i++) { 616 for (p = memmap.map; p < memmap.map_end; p += memmap.desc_size) {
619 md = &memmap.map[i]; 617 md = p;
620 if ((md->phys_addr <= phys_addr) && (phys_addr < 618 if ((md->phys_addr <= phys_addr) && (phys_addr <
621 (md->phys_addr + (md-> num_pages << EFI_PAGE_SHIFT)) )) 619 (md->phys_addr + (md-> num_pages << EFI_PAGE_SHIFT)) ))
622 return md->type; 620 return md->type;
@@ -627,10 +625,10 @@ u32 efi_mem_type(unsigned long phys_addr)
627u64 efi_mem_attributes(unsigned long phys_addr) 625u64 efi_mem_attributes(unsigned long phys_addr)
628{ 626{
629 efi_memory_desc_t *md; 627 efi_memory_desc_t *md;
630 int i; 628 void *p;
631 629
632 for (i = 0; i < memmap.nr_map; i++) { 630 for (p = memmap.map; p < memmap.map_end; p += memmap.desc_size) {
633 md = &memmap.map[i]; 631 md = p;
634 if ((md->phys_addr <= phys_addr) && (phys_addr < 632 if ((md->phys_addr <= phys_addr) && (phys_addr <
635 (md->phys_addr + (md-> num_pages << EFI_PAGE_SHIFT)) )) 633 (md->phys_addr + (md-> num_pages << EFI_PAGE_SHIFT)) ))
636 return md->attribute; 634 return md->attribute;
diff --git a/arch/i386/kernel/entry.S b/arch/i386/kernel/entry.S
index a991d4e5edd2..abb909793efc 100644
--- a/arch/i386/kernel/entry.S
+++ b/arch/i386/kernel/entry.S
@@ -203,7 +203,7 @@ sysenter_past_esp:
203 GET_THREAD_INFO(%ebp) 203 GET_THREAD_INFO(%ebp)
204 204
205 /* Note, _TIF_SECCOMP is bit number 8, and so it needs testw and not testb */ 205 /* Note, _TIF_SECCOMP is bit number 8, and so it needs testw and not testb */
206 testw $(_TIF_SYSCALL_TRACE|_TIF_SYSCALL_AUDIT|_TIF_SECCOMP),TI_flags(%ebp) 206 testw $(_TIF_SYSCALL_EMU|_TIF_SYSCALL_TRACE|_TIF_SECCOMP|_TIF_SYSCALL_AUDIT),TI_flags(%ebp)
207 jnz syscall_trace_entry 207 jnz syscall_trace_entry
208 cmpl $(nr_syscalls), %eax 208 cmpl $(nr_syscalls), %eax
209 jae syscall_badsys 209 jae syscall_badsys
@@ -226,9 +226,9 @@ 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 # system call tracing in operation 229 # system call tracing in operation / emulation
230 /* Note, _TIF_SECCOMP is bit number 8, and so it needs testw and not testb */ 230 /* Note, _TIF_SECCOMP is bit number 8, and so it needs testw and not testb */
231 testw $(_TIF_SYSCALL_TRACE|_TIF_SYSCALL_AUDIT|_TIF_SECCOMP),TI_flags(%ebp) 231 testw $(_TIF_SYSCALL_EMU|_TIF_SYSCALL_TRACE|_TIF_SECCOMP|_TIF_SYSCALL_AUDIT),TI_flags(%ebp)
232 jnz syscall_trace_entry 232 jnz syscall_trace_entry
233 cmpl $(nr_syscalls), %eax 233 cmpl $(nr_syscalls), %eax
234 jae syscall_badsys 234 jae syscall_badsys
@@ -338,6 +338,9 @@ syscall_trace_entry:
338 movl %esp, %eax 338 movl %esp, %eax
339 xorl %edx,%edx 339 xorl %edx,%edx
340 call do_syscall_trace 340 call do_syscall_trace
341 cmpl $0, %eax
342 jne resume_userspace # ret != 0 -> running under PTRACE_SYSEMU,
343 # so must skip actual syscall
341 movl ORIG_EAX(%esp), %eax 344 movl ORIG_EAX(%esp), %eax
342 cmpl $(nr_syscalls), %eax 345 cmpl $(nr_syscalls), %eax
343 jnae syscall_call 346 jnae syscall_call
diff --git a/arch/i386/kernel/head.S b/arch/i386/kernel/head.S
index 4477bb107098..0480ca9e9e57 100644
--- a/arch/i386/kernel/head.S
+++ b/arch/i386/kernel/head.S
@@ -77,6 +77,32 @@ ENTRY(startup_32)
77 subl %edi,%ecx 77 subl %edi,%ecx
78 shrl $2,%ecx 78 shrl $2,%ecx
79 rep ; stosl 79 rep ; stosl
80/*
81 * Copy bootup parameters out of the way.
82 * Note: %esi still has the pointer to the real-mode data.
83 * With the kexec as boot loader, parameter segment might be loaded beyond
84 * kernel image and might not even be addressable by early boot page tables.
85 * (kexec on panic case). Hence copy out the parameters before initializing
86 * page tables.
87 */
88 movl $(boot_params - __PAGE_OFFSET),%edi
89 movl $(PARAM_SIZE/4),%ecx
90 cld
91 rep
92 movsl
93 movl boot_params - __PAGE_OFFSET + NEW_CL_POINTER,%esi
94 andl %esi,%esi
95 jnz 2f # New command line protocol
96 cmpw $(OLD_CL_MAGIC),OLD_CL_MAGIC_ADDR
97 jne 1f
98 movzwl OLD_CL_OFFSET,%esi
99 addl $(OLD_CL_BASE_ADDR),%esi
1002:
101 movl $(saved_command_line - __PAGE_OFFSET),%edi
102 movl $(COMMAND_LINE_SIZE/4),%ecx
103 rep
104 movsl
1051:
80 106
81/* 107/*
82 * Initialize page tables. This creates a PDE and a set of page 108 * Initialize page tables. This creates a PDE and a set of page
@@ -214,28 +240,6 @@ ENTRY(startup_32_smp)
214 */ 240 */
215 call setup_idt 241 call setup_idt
216 242
217/*
218 * Copy bootup parameters out of the way.
219 * Note: %esi still has the pointer to the real-mode data.
220 */
221 movl $boot_params,%edi
222 movl $(PARAM_SIZE/4),%ecx
223 cld
224 rep
225 movsl
226 movl boot_params+NEW_CL_POINTER,%esi
227 andl %esi,%esi
228 jnz 2f # New command line protocol
229 cmpw $(OLD_CL_MAGIC),OLD_CL_MAGIC_ADDR
230 jne 1f
231 movzwl OLD_CL_OFFSET,%esi
232 addl $(OLD_CL_BASE_ADDR),%esi
2332:
234 movl $saved_command_line,%edi
235 movl $(COMMAND_LINE_SIZE/4),%ecx
236 rep
237 movsl
2381:
239checkCPUtype: 243checkCPUtype:
240 244
241 movl $-1,X86_CPUID # -1 for no CPUID initially 245 movl $-1,X86_CPUID # -1 for no CPUID initially
diff --git a/arch/i386/kernel/i387.c b/arch/i386/kernel/i387.c
index b817168d9c62..d75524758daf 100644
--- a/arch/i386/kernel/i387.c
+++ b/arch/i386/kernel/i387.c
@@ -82,17 +82,6 @@ void kernel_fpu_begin(void)
82} 82}
83EXPORT_SYMBOL_GPL(kernel_fpu_begin); 83EXPORT_SYMBOL_GPL(kernel_fpu_begin);
84 84
85void restore_fpu( struct task_struct *tsk )
86{
87 if ( cpu_has_fxsr ) {
88 asm volatile( "fxrstor %0"
89 : : "m" (tsk->thread.i387.fxsave) );
90 } else {
91 asm volatile( "frstor %0"
92 : : "m" (tsk->thread.i387.fsave) );
93 }
94}
95
96/* 85/*
97 * FPU tag word conversions. 86 * FPU tag word conversions.
98 */ 87 */
diff --git a/arch/i386/kernel/i8237.c b/arch/i386/kernel/i8237.c
new file mode 100644
index 000000000000..c36d1c006c2f
--- /dev/null
+++ b/arch/i386/kernel/i8237.c
@@ -0,0 +1,67 @@
1/*
2 * i8237.c: 8237A DMA controller suspend functions.
3 *
4 * Written by Pierre Ossman, 2005.
5 */
6
7#include <linux/init.h>
8#include <linux/sysdev.h>
9
10#include <asm/dma.h>
11
12/*
13 * This module just handles suspend/resume issues with the
14 * 8237A DMA controller (used for ISA and LPC).
15 * Allocation is handled in kernel/dma.c and normal usage is
16 * in asm/dma.h.
17 */
18
19static int i8237A_resume(struct sys_device *dev)
20{
21 unsigned long flags;
22 int i;
23
24 flags = claim_dma_lock();
25
26 dma_outb(DMA1_RESET_REG, 0);
27 dma_outb(DMA2_RESET_REG, 0);
28
29 for (i = 0;i < 8;i++) {
30 set_dma_addr(i, 0x000000);
31 /* DMA count is a bit weird so this is not 0 */
32 set_dma_count(i, 1);
33 }
34
35 /* Enable cascade DMA or channel 0-3 won't work */
36 enable_dma(4);
37
38 release_dma_lock(flags);
39
40 return 0;
41}
42
43static int i8237A_suspend(struct sys_device *dev, pm_message_t state)
44{
45 return 0;
46}
47
48static struct sysdev_class i8237_sysdev_class = {
49 set_kset_name("i8237"),
50 .suspend = i8237A_suspend,
51 .resume = i8237A_resume,
52};
53
54static struct sys_device device_i8237A = {
55 .id = 0,
56 .cls = &i8237_sysdev_class,
57};
58
59static int __init i8237A_init_sysfs(void)
60{
61 int error = sysdev_class_register(&i8237_sysdev_class);
62 if (!error)
63 error = sysdev_register(&device_i8237A);
64 return error;
65}
66
67device_initcall(i8237A_init_sysfs);
diff --git a/arch/i386/kernel/ioport.c b/arch/i386/kernel/ioport.c
index 8b25160393c1..f2b37654777f 100644
--- a/arch/i386/kernel/ioport.c
+++ b/arch/i386/kernel/ioport.c
@@ -132,6 +132,7 @@ asmlinkage long sys_iopl(unsigned long unused)
132 volatile struct pt_regs * regs = (struct pt_regs *) &unused; 132 volatile struct pt_regs * regs = (struct pt_regs *) &unused;
133 unsigned int level = regs->ebx; 133 unsigned int level = regs->ebx;
134 unsigned int old = (regs->eflags >> 12) & 3; 134 unsigned int old = (regs->eflags >> 12) & 3;
135 struct thread_struct *t = &current->thread;
135 136
136 if (level > 3) 137 if (level > 3)
137 return -EINVAL; 138 return -EINVAL;
@@ -140,8 +141,8 @@ asmlinkage long sys_iopl(unsigned long unused)
140 if (!capable(CAP_SYS_RAWIO)) 141 if (!capable(CAP_SYS_RAWIO))
141 return -EPERM; 142 return -EPERM;
142 } 143 }
143 regs->eflags = (regs->eflags &~ 0x3000UL) | (level << 12); 144 t->iopl = level << 12;
144 /* Make sure we return the long way (not sysenter) */ 145 regs->eflags = (regs->eflags & ~X86_EFLAGS_IOPL) | t->iopl;
145 set_thread_flag(TIF_IRET); 146 set_iopl_mask(t->iopl);
146 return 0; 147 return 0;
147} 148}
diff --git a/arch/i386/kernel/ldt.c b/arch/i386/kernel/ldt.c
index bb50afbee921..fe1ffa55587d 100644
--- a/arch/i386/kernel/ldt.c
+++ b/arch/i386/kernel/ldt.c
@@ -177,7 +177,7 @@ static int read_default_ldt(void __user * ptr, unsigned long bytecount)
177static int write_ldt(void __user * ptr, unsigned long bytecount, int oldmode) 177static int write_ldt(void __user * ptr, unsigned long bytecount, int oldmode)
178{ 178{
179 struct mm_struct * mm = current->mm; 179 struct mm_struct * mm = current->mm;
180 __u32 entry_1, entry_2, *lp; 180 __u32 entry_1, entry_2;
181 int error; 181 int error;
182 struct user_desc ldt_info; 182 struct user_desc ldt_info;
183 183
@@ -205,8 +205,6 @@ static int write_ldt(void __user * ptr, unsigned long bytecount, int oldmode)
205 goto out_unlock; 205 goto out_unlock;
206 } 206 }
207 207
208 lp = (__u32 *) ((ldt_info.entry_number << 3) + (char *) mm->context.ldt);
209
210 /* Allow LDTs to be cleared by the user. */ 208 /* Allow LDTs to be cleared by the user. */
211 if (ldt_info.base_addr == 0 && ldt_info.limit == 0) { 209 if (ldt_info.base_addr == 0 && ldt_info.limit == 0) {
212 if (oldmode || LDT_empty(&ldt_info)) { 210 if (oldmode || LDT_empty(&ldt_info)) {
@@ -223,8 +221,7 @@ static int write_ldt(void __user * ptr, unsigned long bytecount, int oldmode)
223 221
224 /* Install the new entry ... */ 222 /* Install the new entry ... */
225install: 223install:
226 *lp = entry_1; 224 write_ldt_entry(mm->context.ldt, ldt_info.entry_number, entry_1, entry_2);
227 *(lp+1) = entry_2;
228 error = 0; 225 error = 0;
229 226
230out_unlock: 227out_unlock:
diff --git a/arch/i386/kernel/machine_kexec.c b/arch/i386/kernel/machine_kexec.c
index 52ed18d8b511..a912fed48482 100644
--- a/arch/i386/kernel/machine_kexec.c
+++ b/arch/i386/kernel/machine_kexec.c
@@ -16,13 +16,8 @@
16#include <asm/io.h> 16#include <asm/io.h>
17#include <asm/apic.h> 17#include <asm/apic.h>
18#include <asm/cpufeature.h> 18#include <asm/cpufeature.h>
19 19#include <asm/desc.h>
20static inline unsigned long read_cr3(void) 20#include <asm/system.h>
21{
22 unsigned long cr3;
23 asm volatile("movl %%cr3,%0": "=r"(cr3));
24 return cr3;
25}
26 21
27#define PAGE_ALIGNED __attribute__ ((__aligned__(PAGE_SIZE))) 22#define PAGE_ALIGNED __attribute__ ((__aligned__(PAGE_SIZE)))
28 23
@@ -90,34 +85,27 @@ static void identity_map_page(unsigned long address)
90} 85}
91#endif 86#endif
92 87
93
94static void set_idt(void *newidt, __u16 limit) 88static void set_idt(void *newidt, __u16 limit)
95{ 89{
96 unsigned char curidt[6]; 90 struct Xgt_desc_struct curidt;
97 91
98 /* ia32 supports unaliged loads & stores */ 92 /* ia32 supports unaliged loads & stores */
99 (*(__u16 *)(curidt)) = limit; 93 curidt.size = limit;
100 (*(__u32 *)(curidt +2)) = (unsigned long)(newidt); 94 curidt.address = (unsigned long)newidt;
101 95
102 __asm__ __volatile__ ( 96 load_idt(&curidt);
103 "lidt %0\n"
104 : "=m" (curidt)
105 );
106}; 97};
107 98
108 99
109static void set_gdt(void *newgdt, __u16 limit) 100static void set_gdt(void *newgdt, __u16 limit)
110{ 101{
111 unsigned char curgdt[6]; 102 struct Xgt_desc_struct curgdt;
112 103
113 /* ia32 supports unaligned loads & stores */ 104 /* ia32 supports unaligned loads & stores */
114 (*(__u16 *)(curgdt)) = limit; 105 curgdt.size = limit;
115 (*(__u32 *)(curgdt +2)) = (unsigned long)(newgdt); 106 curgdt.address = (unsigned long)newgdt;
116 107
117 __asm__ __volatile__ ( 108 load_gdt(&curgdt);
118 "lgdt %0\n"
119 : "=m" (curgdt)
120 );
121}; 109};
122 110
123static void load_segments(void) 111static void load_segments(void)
diff --git a/arch/i386/kernel/microcode.c b/arch/i386/kernel/microcode.c
index a77c612aad00..165f13158c60 100644
--- a/arch/i386/kernel/microcode.c
+++ b/arch/i386/kernel/microcode.c
@@ -164,7 +164,8 @@ static void collect_cpu_info (void *unused)
164 } 164 }
165 165
166 wrmsr(MSR_IA32_UCODE_REV, 0, 0); 166 wrmsr(MSR_IA32_UCODE_REV, 0, 0);
167 __asm__ __volatile__ ("cpuid" : : : "ax", "bx", "cx", "dx"); 167 /* see notes above for revision 1.07. Apparent chip bug */
168 serialize_cpu();
168 /* get the current revision from MSR 0x8B */ 169 /* get the current revision from MSR 0x8B */
169 rdmsr(MSR_IA32_UCODE_REV, val[0], uci->rev); 170 rdmsr(MSR_IA32_UCODE_REV, val[0], uci->rev);
170 pr_debug("microcode: collect_cpu_info : sig=0x%x, pf=0x%x, rev=0x%x\n", 171 pr_debug("microcode: collect_cpu_info : sig=0x%x, pf=0x%x, rev=0x%x\n",
@@ -377,7 +378,9 @@ static void do_update_one (void * unused)
377 (unsigned long) uci->mc->bits >> 16 >> 16); 378 (unsigned long) uci->mc->bits >> 16 >> 16);
378 wrmsr(MSR_IA32_UCODE_REV, 0, 0); 379 wrmsr(MSR_IA32_UCODE_REV, 0, 0);
379 380
380 __asm__ __volatile__ ("cpuid" : : : "ax", "bx", "cx", "dx"); 381 /* see notes above for revision 1.07. Apparent chip bug */
382 serialize_cpu();
383
381 /* get the current revision from MSR 0x8B */ 384 /* get the current revision from MSR 0x8B */
382 rdmsr(MSR_IA32_UCODE_REV, val[0], val[1]); 385 rdmsr(MSR_IA32_UCODE_REV, val[0], val[1]);
383 386
diff --git a/arch/i386/kernel/mpparse.c b/arch/i386/kernel/mpparse.c
index af917f609c7d..5d0b9a8fc43d 100644
--- a/arch/i386/kernel/mpparse.c
+++ b/arch/i386/kernel/mpparse.c
@@ -65,6 +65,8 @@ int nr_ioapics;
65int pic_mode; 65int pic_mode;
66unsigned long mp_lapic_addr; 66unsigned long mp_lapic_addr;
67 67
68unsigned int def_to_bigsmp = 0;
69
68/* Processor that is doing the boot up */ 70/* Processor that is doing the boot up */
69unsigned int boot_cpu_physical_apicid = -1U; 71unsigned int boot_cpu_physical_apicid = -1U;
70/* Internal processor count */ 72/* Internal processor count */
@@ -120,7 +122,7 @@ static int MP_valid_apicid(int apicid, int version)
120 122
121static void __init MP_processor_info (struct mpc_config_processor *m) 123static void __init MP_processor_info (struct mpc_config_processor *m)
122{ 124{
123 int ver, apicid; 125 int ver, apicid, cpu, found_bsp = 0;
124 physid_mask_t tmp; 126 physid_mask_t tmp;
125 127
126 if (!(m->mpc_cpuflag & CPU_ENABLED)) 128 if (!(m->mpc_cpuflag & CPU_ENABLED))
@@ -179,6 +181,7 @@ static void __init MP_processor_info (struct mpc_config_processor *m)
179 if (m->mpc_cpuflag & CPU_BOOTPROCESSOR) { 181 if (m->mpc_cpuflag & CPU_BOOTPROCESSOR) {
180 Dprintk(" Bootup CPU\n"); 182 Dprintk(" Bootup CPU\n");
181 boot_cpu_physical_apicid = m->mpc_apicid; 183 boot_cpu_physical_apicid = m->mpc_apicid;
184 found_bsp = 1;
182 } 185 }
183 186
184 if (num_processors >= NR_CPUS) { 187 if (num_processors >= NR_CPUS) {
@@ -202,6 +205,11 @@ static void __init MP_processor_info (struct mpc_config_processor *m)
202 return; 205 return;
203 } 206 }
204 207
208 if (found_bsp)
209 cpu = 0;
210 else
211 cpu = num_processors - 1;
212 cpu_set(cpu, cpu_possible_map);
205 tmp = apicid_to_cpu_present(apicid); 213 tmp = apicid_to_cpu_present(apicid);
206 physids_or(phys_cpu_present_map, phys_cpu_present_map, tmp); 214 physids_or(phys_cpu_present_map, phys_cpu_present_map, tmp);
207 215
@@ -213,6 +221,13 @@ static void __init MP_processor_info (struct mpc_config_processor *m)
213 ver = 0x10; 221 ver = 0x10;
214 } 222 }
215 apic_version[m->mpc_apicid] = ver; 223 apic_version[m->mpc_apicid] = ver;
224 if ((num_processors > 8) &&
225 APIC_XAPIC(ver) &&
226 (boot_cpu_data.x86_vendor == X86_VENDOR_INTEL))
227 def_to_bigsmp = 1;
228 else
229 def_to_bigsmp = 0;
230
216 bios_cpu_apicid[num_processors - 1] = m->mpc_apicid; 231 bios_cpu_apicid[num_processors - 1] = m->mpc_apicid;
217} 232}
218 233
@@ -1116,7 +1131,15 @@ int mp_register_gsi (u32 gsi, int edge_level, int active_high_low)
1116 */ 1131 */
1117 int irq = gsi; 1132 int irq = gsi;
1118 if (gsi < MAX_GSI_NUM) { 1133 if (gsi < MAX_GSI_NUM) {
1119 gsi = pci_irq++; 1134 if (gsi > 15)
1135 gsi = pci_irq++;
1136#ifdef CONFIG_ACPI_BUS
1137 /*
1138 * Don't assign IRQ used by ACPI SCI
1139 */
1140 if (gsi == acpi_fadt.sci_int)
1141 gsi = pci_irq++;
1142#endif
1120 gsi_to_irq[irq] = gsi; 1143 gsi_to_irq[irq] = gsi;
1121 } else { 1144 } else {
1122 printk(KERN_ERR "GSI %u is too high\n", gsi); 1145 printk(KERN_ERR "GSI %u is too high\n", gsi);
diff --git a/arch/i386/kernel/msr.c b/arch/i386/kernel/msr.c
index b2f03c39a6fe..03100d6fc5d6 100644
--- a/arch/i386/kernel/msr.c
+++ b/arch/i386/kernel/msr.c
@@ -46,23 +46,13 @@
46 46
47static struct class *msr_class; 47static struct class *msr_class;
48 48
49/* Note: "err" is handled in a funny way below. Otherwise one version
50 of gcc or another breaks. */
51
52static inline int wrmsr_eio(u32 reg, u32 eax, u32 edx) 49static inline int wrmsr_eio(u32 reg, u32 eax, u32 edx)
53{ 50{
54 int err; 51 int err;
55 52
56 asm volatile ("1: wrmsr\n" 53 err = wrmsr_safe(reg, eax, edx);
57 "2:\n" 54 if (err)
58 ".section .fixup,\"ax\"\n" 55 err = -EIO;
59 "3: movl %4,%0\n"
60 " jmp 2b\n"
61 ".previous\n"
62 ".section __ex_table,\"a\"\n"
63 " .align 4\n" " .long 1b,3b\n" ".previous":"=&bDS" (err)
64 :"a"(eax), "d"(edx), "c"(reg), "i"(-EIO), "0"(0));
65
66 return err; 56 return err;
67} 57}
68 58
@@ -70,18 +60,9 @@ static inline int rdmsr_eio(u32 reg, u32 *eax, u32 *edx)
70{ 60{
71 int err; 61 int err;
72 62
73 asm volatile ("1: rdmsr\n" 63 err = rdmsr_safe(reg, eax, edx);
74 "2:\n" 64 if (err)
75 ".section .fixup,\"ax\"\n" 65 err = -EIO;
76 "3: movl %4,%0\n"
77 " jmp 2b\n"
78 ".previous\n"
79 ".section __ex_table,\"a\"\n"
80 " .align 4\n"
81 " .long 1b,3b\n"
82 ".previous":"=&bDS" (err), "=a"(*eax), "=d"(*edx)
83 :"c"(reg), "i"(-EIO), "0"(0));
84
85 return err; 66 return err;
86} 67}
87 68
diff --git a/arch/i386/kernel/nmi.c b/arch/i386/kernel/nmi.c
index da6c46d667cb..8bbdbda07a2d 100644
--- a/arch/i386/kernel/nmi.c
+++ b/arch/i386/kernel/nmi.c
@@ -195,7 +195,7 @@ static void disable_lapic_nmi_watchdog(void)
195 wrmsr(MSR_P6_EVNTSEL0, 0, 0); 195 wrmsr(MSR_P6_EVNTSEL0, 0, 0);
196 break; 196 break;
197 case 15: 197 case 15:
198 if (boot_cpu_data.x86_model > 0x3) 198 if (boot_cpu_data.x86_model > 0x4)
199 break; 199 break;
200 200
201 wrmsr(MSR_P4_IQ_CCCR0, 0, 0); 201 wrmsr(MSR_P4_IQ_CCCR0, 0, 0);
@@ -432,7 +432,7 @@ void setup_apic_nmi_watchdog (void)
432 setup_p6_watchdog(); 432 setup_p6_watchdog();
433 break; 433 break;
434 case 15: 434 case 15:
435 if (boot_cpu_data.x86_model > 0x3) 435 if (boot_cpu_data.x86_model > 0x4)
436 return; 436 return;
437 437
438 if (!setup_p4_watchdog()) 438 if (!setup_p4_watchdog())
@@ -501,8 +501,11 @@ void nmi_watchdog_tick (struct pt_regs * regs)
501 */ 501 */
502 alert_counter[cpu]++; 502 alert_counter[cpu]++;
503 if (alert_counter[cpu] == 5*nmi_hz) 503 if (alert_counter[cpu] == 5*nmi_hz)
504 /*
505 * die_nmi will return ONLY if NOTIFY_STOP happens..
506 */
504 die_nmi(regs, "NMI Watchdog detected LOCKUP"); 507 die_nmi(regs, "NMI Watchdog detected LOCKUP");
505 } else { 508
506 last_irq_sums[cpu] = sum; 509 last_irq_sums[cpu] = sum;
507 alert_counter[cpu] = 0; 510 alert_counter[cpu] = 0;
508 } 511 }
diff --git a/arch/i386/kernel/numaq.c b/arch/i386/kernel/numaq.c
index e51edf0a6564..5f5b075f860a 100644
--- a/arch/i386/kernel/numaq.c
+++ b/arch/i386/kernel/numaq.c
@@ -31,6 +31,7 @@
31#include <linux/nodemask.h> 31#include <linux/nodemask.h>
32#include <asm/numaq.h> 32#include <asm/numaq.h>
33#include <asm/topology.h> 33#include <asm/topology.h>
34#include <asm/processor.h>
34 35
35#define MB_TO_PAGES(addr) ((addr) << (20 - PAGE_SHIFT)) 36#define MB_TO_PAGES(addr) ((addr) << (20 - PAGE_SHIFT))
36 37
@@ -77,3 +78,11 @@ int __init get_memcfg_numaq(void)
77 smp_dump_qct(); 78 smp_dump_qct();
78 return 1; 79 return 1;
79} 80}
81
82static int __init numaq_dsc_disable(void)
83{
84 printk(KERN_DEBUG "NUMAQ: disabling TSC\n");
85 tsc_disable = 1;
86 return 0;
87}
88core_initcall(numaq_dsc_disable);
diff --git a/arch/i386/kernel/process.c b/arch/i386/kernel/process.c
index ba243a4cc119..b45cbf93d439 100644
--- a/arch/i386/kernel/process.c
+++ b/arch/i386/kernel/process.c
@@ -164,7 +164,7 @@ static inline void play_dead(void)
164 */ 164 */
165 local_irq_disable(); 165 local_irq_disable();
166 while (1) 166 while (1)
167 __asm__ __volatile__("hlt":::"memory"); 167 halt();
168} 168}
169#else 169#else
170static inline void play_dead(void) 170static inline void play_dead(void)
@@ -313,16 +313,12 @@ void show_regs(struct pt_regs * regs)
313 printk(" DS: %04x ES: %04x\n", 313 printk(" DS: %04x ES: %04x\n",
314 0xffff & regs->xds,0xffff & regs->xes); 314 0xffff & regs->xds,0xffff & regs->xes);
315 315
316 __asm__("movl %%cr0, %0": "=r" (cr0)); 316 cr0 = read_cr0();
317 __asm__("movl %%cr2, %0": "=r" (cr2)); 317 cr2 = read_cr2();
318 __asm__("movl %%cr3, %0": "=r" (cr3)); 318 cr3 = read_cr3();
319 /* This could fault if %cr4 does not exist */ 319 if (current_cpu_data.x86 > 4) {
320 __asm__("1: movl %%cr4, %0 \n" 320 cr4 = read_cr4();
321 "2: \n" 321 }
322 ".section __ex_table,\"a\" \n"
323 ".long 1b,2b \n"
324 ".previous \n"
325 : "=r" (cr4): "0" (0));
326 printk("CR0: %08lx CR2: %08lx CR3: %08lx CR4: %08lx\n", cr0, cr2, cr3, cr4); 322 printk("CR0: %08lx CR2: %08lx CR3: %08lx CR4: %08lx\n", cr0, cr2, cr3, cr4);
327 show_trace(NULL, &regs->esp); 323 show_trace(NULL, &regs->esp);
328} 324}
@@ -682,41 +678,56 @@ struct task_struct fastcall * __switch_to(struct task_struct *prev_p, struct tas
682 __unlazy_fpu(prev_p); 678 __unlazy_fpu(prev_p);
683 679
684 /* 680 /*
685 * Reload esp0, LDT and the page table pointer: 681 * Reload esp0.
686 */ 682 */
687 load_esp0(tss, next); 683 load_esp0(tss, next);
688 684
689 /* 685 /*
690 * Load the per-thread Thread-Local Storage descriptor. 686 * Save away %fs and %gs. No need to save %es and %ds, as
687 * those are always kernel segments while inside the kernel.
688 * Doing this before setting the new TLS descriptors avoids
689 * the situation where we temporarily have non-reloadable
690 * segments in %fs and %gs. This could be an issue if the
691 * NMI handler ever used %fs or %gs (it does not today), or
692 * if the kernel is running inside of a hypervisor layer.
691 */ 693 */
692 load_TLS(next, cpu); 694 savesegment(fs, prev->fs);
695 savesegment(gs, prev->gs);
693 696
694 /* 697 /*
695 * Save away %fs and %gs. No need to save %es and %ds, as 698 * Load the per-thread Thread-Local Storage descriptor.
696 * those are always kernel segments while inside the kernel.
697 */ 699 */
698 asm volatile("mov %%fs,%0":"=m" (prev->fs)); 700 load_TLS(next, cpu);
699 asm volatile("mov %%gs,%0":"=m" (prev->gs));
700 701
701 /* 702 /*
702 * Restore %fs and %gs if needed. 703 * Restore %fs and %gs if needed.
704 *
705 * Glibc normally makes %fs be zero, and %gs is one of
706 * the TLS segments.
703 */ 707 */
704 if (unlikely(prev->fs | prev->gs | next->fs | next->gs)) { 708 if (unlikely(prev->fs | next->fs))
705 loadsegment(fs, next->fs); 709 loadsegment(fs, next->fs);
710
711 if (prev->gs | next->gs)
706 loadsegment(gs, next->gs); 712 loadsegment(gs, next->gs);
707 } 713
714 /*
715 * Restore IOPL if needed.
716 */
717 if (unlikely(prev->iopl != next->iopl))
718 set_iopl_mask(next->iopl);
708 719
709 /* 720 /*
710 * Now maybe reload the debug registers 721 * Now maybe reload the debug registers
711 */ 722 */
712 if (unlikely(next->debugreg[7])) { 723 if (unlikely(next->debugreg[7])) {
713 set_debugreg(current->thread.debugreg[0], 0); 724 set_debugreg(next->debugreg[0], 0);
714 set_debugreg(current->thread.debugreg[1], 1); 725 set_debugreg(next->debugreg[1], 1);
715 set_debugreg(current->thread.debugreg[2], 2); 726 set_debugreg(next->debugreg[2], 2);
716 set_debugreg(current->thread.debugreg[3], 3); 727 set_debugreg(next->debugreg[3], 3);
717 /* no 4 and 5 */ 728 /* no 4 and 5 */
718 set_debugreg(current->thread.debugreg[6], 6); 729 set_debugreg(next->debugreg[6], 6);
719 set_debugreg(current->thread.debugreg[7], 7); 730 set_debugreg(next->debugreg[7], 7);
720 } 731 }
721 732
722 if (unlikely(prev->io_bitmap_ptr || next->io_bitmap_ptr)) 733 if (unlikely(prev->io_bitmap_ptr || next->io_bitmap_ptr))
@@ -913,6 +924,8 @@ asmlinkage int sys_get_thread_area(struct user_desc __user *u_info)
913 if (idx < GDT_ENTRY_TLS_MIN || idx > GDT_ENTRY_TLS_MAX) 924 if (idx < GDT_ENTRY_TLS_MIN || idx > GDT_ENTRY_TLS_MAX)
914 return -EINVAL; 925 return -EINVAL;
915 926
927 memset(&info, 0, sizeof(info));
928
916 desc = current->thread.tls_array + idx - GDT_ENTRY_TLS_MIN; 929 desc = current->thread.tls_array + idx - GDT_ENTRY_TLS_MIN;
917 930
918 info.entry_number = idx; 931 info.entry_number = idx;
diff --git a/arch/i386/kernel/ptrace.c b/arch/i386/kernel/ptrace.c
index 0da59b42843c..340980203b09 100644
--- a/arch/i386/kernel/ptrace.c
+++ b/arch/i386/kernel/ptrace.c
@@ -271,6 +271,8 @@ static void clear_singlestep(struct task_struct *child)
271void ptrace_disable(struct task_struct *child) 271void ptrace_disable(struct task_struct *child)
272{ 272{
273 clear_singlestep(child); 273 clear_singlestep(child);
274 clear_tsk_thread_flag(child, TIF_SYSCALL_TRACE);
275 clear_tsk_thread_flag(child, TIF_SYSCALL_EMU);
274} 276}
275 277
276/* 278/*
@@ -509,15 +511,20 @@ asmlinkage int sys_ptrace(long request, long pid, long addr, long data)
509 } 511 }
510 break; 512 break;
511 513
514 case PTRACE_SYSEMU: /* continue and stop at next syscall, which will not be executed */
512 case PTRACE_SYSCALL: /* continue and stop at next (return from) syscall */ 515 case PTRACE_SYSCALL: /* continue and stop at next (return from) syscall */
513 case PTRACE_CONT: /* restart after signal. */ 516 case PTRACE_CONT: /* restart after signal. */
514 ret = -EIO; 517 ret = -EIO;
515 if (!valid_signal(data)) 518 if (!valid_signal(data))
516 break; 519 break;
517 if (request == PTRACE_SYSCALL) { 520 if (request == PTRACE_SYSEMU) {
521 set_tsk_thread_flag(child, TIF_SYSCALL_EMU);
522 clear_tsk_thread_flag(child, TIF_SYSCALL_TRACE);
523 } else if (request == PTRACE_SYSCALL) {
518 set_tsk_thread_flag(child, TIF_SYSCALL_TRACE); 524 set_tsk_thread_flag(child, TIF_SYSCALL_TRACE);
519 } 525 clear_tsk_thread_flag(child, TIF_SYSCALL_EMU);
520 else { 526 } else {
527 clear_tsk_thread_flag(child, TIF_SYSCALL_EMU);
521 clear_tsk_thread_flag(child, TIF_SYSCALL_TRACE); 528 clear_tsk_thread_flag(child, TIF_SYSCALL_TRACE);
522 } 529 }
523 child->exit_code = data; 530 child->exit_code = data;
@@ -542,10 +549,17 @@ asmlinkage int sys_ptrace(long request, long pid, long addr, long data)
542 wake_up_process(child); 549 wake_up_process(child);
543 break; 550 break;
544 551
552 case PTRACE_SYSEMU_SINGLESTEP: /* Same as SYSEMU, but singlestep if not syscall */
545 case PTRACE_SINGLESTEP: /* set the trap flag. */ 553 case PTRACE_SINGLESTEP: /* set the trap flag. */
546 ret = -EIO; 554 ret = -EIO;
547 if (!valid_signal(data)) 555 if (!valid_signal(data))
548 break; 556 break;
557
558 if (request == PTRACE_SYSEMU_SINGLESTEP)
559 set_tsk_thread_flag(child, TIF_SYSCALL_EMU);
560 else
561 clear_tsk_thread_flag(child, TIF_SYSCALL_EMU);
562
549 clear_tsk_thread_flag(child, TIF_SYSCALL_TRACE); 563 clear_tsk_thread_flag(child, TIF_SYSCALL_TRACE);
550 set_singlestep(child); 564 set_singlestep(child);
551 child->exit_code = data; 565 child->exit_code = data;
@@ -678,26 +692,52 @@ void send_sigtrap(struct task_struct *tsk, struct pt_regs *regs, int error_code)
678 * - triggered by current->work.syscall_trace 692 * - triggered by current->work.syscall_trace
679 */ 693 */
680__attribute__((regparm(3))) 694__attribute__((regparm(3)))
681void do_syscall_trace(struct pt_regs *regs, int entryexit) 695int do_syscall_trace(struct pt_regs *regs, int entryexit)
682{ 696{
697 int is_sysemu = test_thread_flag(TIF_SYSCALL_EMU), ret = 0;
698 /* With TIF_SYSCALL_EMU set we want to ignore TIF_SINGLESTEP for syscall
699 * interception. */
700 int is_singlestep = !is_sysemu && test_thread_flag(TIF_SINGLESTEP);
701
683 /* do the secure computing check first */ 702 /* do the secure computing check first */
684 secure_computing(regs->orig_eax); 703 secure_computing(regs->orig_eax);
685 704
686 if (unlikely(current->audit_context) && entryexit) 705 if (unlikely(current->audit_context)) {
687 audit_syscall_exit(current, AUDITSC_RESULT(regs->eax), regs->eax); 706 if (entryexit)
707 audit_syscall_exit(current, AUDITSC_RESULT(regs->eax), regs->eax);
708 /* Debug traps, when using PTRACE_SINGLESTEP, must be sent only
709 * on the syscall exit path. Normally, when TIF_SYSCALL_AUDIT is
710 * not used, entry.S will call us only on syscall exit, not
711 * entry; so when TIF_SYSCALL_AUDIT is used we must avoid
712 * calling send_sigtrap() on syscall entry.
713 *
714 * Note that when PTRACE_SYSEMU_SINGLESTEP is used,
715 * is_singlestep is false, despite his name, so we will still do
716 * the correct thing.
717 */
718 else if (is_singlestep)
719 goto out;
720 }
688 721
689 if (!(current->ptrace & PT_PTRACED)) 722 if (!(current->ptrace & PT_PTRACED))
690 goto out; 723 goto out;
691 724
725 /* If a process stops on the 1st tracepoint with SYSCALL_TRACE
726 * and then is resumed with SYSEMU_SINGLESTEP, it will come in
727 * here. We have to check this and return */
728 if (is_sysemu && entryexit)
729 return 0;
730
692 /* Fake a debug trap */ 731 /* Fake a debug trap */
693 if (test_thread_flag(TIF_SINGLESTEP)) 732 if (is_singlestep)
694 send_sigtrap(current, regs, 0); 733 send_sigtrap(current, regs, 0);
695 734
696 if (!test_thread_flag(TIF_SYSCALL_TRACE)) 735 if (!test_thread_flag(TIF_SYSCALL_TRACE) && !is_sysemu)
697 goto out; 736 goto out;
698 737
699 /* the 0x80 provides a way for the tracing parent to distinguish 738 /* the 0x80 provides a way for the tracing parent to distinguish
700 between a syscall stop and SIGTRAP delivery */ 739 between a syscall stop and SIGTRAP delivery */
740 /* Note that the debugger could change the result of test_thread_flag!*/
701 ptrace_notify(SIGTRAP | ((current->ptrace & PT_TRACESYSGOOD) ? 0x80 : 0)); 741 ptrace_notify(SIGTRAP | ((current->ptrace & PT_TRACESYSGOOD) ? 0x80 : 0));
702 742
703 /* 743 /*
@@ -709,9 +749,16 @@ void do_syscall_trace(struct pt_regs *regs, int entryexit)
709 send_sig(current->exit_code, current, 1); 749 send_sig(current->exit_code, current, 1);
710 current->exit_code = 0; 750 current->exit_code = 0;
711 } 751 }
752 ret = is_sysemu;
712 out: 753 out:
713 if (unlikely(current->audit_context) && !entryexit) 754 if (unlikely(current->audit_context) && !entryexit)
714 audit_syscall_entry(current, AUDIT_ARCH_I386, regs->orig_eax, 755 audit_syscall_entry(current, AUDIT_ARCH_I386, regs->orig_eax,
715 regs->ebx, regs->ecx, regs->edx, regs->esi); 756 regs->ebx, regs->ecx, regs->edx, regs->esi);
757 if (ret == 0)
758 return 0;
716 759
760 regs->orig_eax = -1; /* force skip of syscall restarting */
761 if (unlikely(current->audit_context))
762 audit_syscall_exit(current, AUDITSC_RESULT(regs->eax), regs->eax);
763 return 1;
717} 764}
diff --git a/arch/i386/kernel/reboot.c b/arch/i386/kernel/reboot.c
index b3e584849961..1cbb9c0f4704 100644
--- a/arch/i386/kernel/reboot.c
+++ b/arch/i386/kernel/reboot.c
@@ -13,6 +13,7 @@
13#include <linux/dmi.h> 13#include <linux/dmi.h>
14#include <asm/uaccess.h> 14#include <asm/uaccess.h>
15#include <asm/apic.h> 15#include <asm/apic.h>
16#include <asm/desc.h>
16#include "mach_reboot.h" 17#include "mach_reboot.h"
17#include <linux/reboot_fixups.h> 18#include <linux/reboot_fixups.h>
18 19
@@ -242,13 +243,13 @@ void machine_real_restart(unsigned char *code, int length)
242 243
243 /* Set up the IDT for real mode. */ 244 /* Set up the IDT for real mode. */
244 245
245 __asm__ __volatile__ ("lidt %0" : : "m" (real_mode_idt)); 246 load_idt(&real_mode_idt);
246 247
247 /* Set up a GDT from which we can load segment descriptors for real 248 /* Set up a GDT from which we can load segment descriptors for real
248 mode. The GDT is not used in real mode; it is just needed here to 249 mode. The GDT is not used in real mode; it is just needed here to
249 prepare the descriptors. */ 250 prepare the descriptors. */
250 251
251 __asm__ __volatile__ ("lgdt %0" : : "m" (real_mode_gdt)); 252 load_gdt(&real_mode_gdt);
252 253
253 /* Load the data segment registers, and thus the descriptors ready for 254 /* Load the data segment registers, and thus the descriptors ready for
254 real mode. The base address of each segment is 0x100, 16 times the 255 real mode. The base address of each segment is 0x100, 16 times the
@@ -284,7 +285,7 @@ void machine_shutdown(void)
284 reboot_cpu_id = 0; 285 reboot_cpu_id = 0;
285 286
286 /* See if there has been given a command line override */ 287 /* See if there has been given a command line override */
287 if ((reboot_cpu_id != -1) && (reboot_cpu < NR_CPUS) && 288 if ((reboot_cpu != -1) && (reboot_cpu < NR_CPUS) &&
288 cpu_isset(reboot_cpu, cpu_online_map)) { 289 cpu_isset(reboot_cpu, cpu_online_map)) {
289 reboot_cpu_id = reboot_cpu; 290 reboot_cpu_id = reboot_cpu;
290 } 291 }
@@ -311,14 +312,12 @@ void machine_shutdown(void)
311#endif 312#endif
312} 313}
313 314
314void machine_restart(char * __unused) 315void machine_emergency_restart(void)
315{ 316{
316 machine_shutdown();
317
318 if (!reboot_thru_bios) { 317 if (!reboot_thru_bios) {
319 if (efi_enabled) { 318 if (efi_enabled) {
320 efi.reset_system(EFI_RESET_COLD, EFI_SUCCESS, 0, NULL); 319 efi.reset_system(EFI_RESET_COLD, EFI_SUCCESS, 0, NULL);
321 __asm__ __volatile__("lidt %0": :"m" (no_idt)); 320 load_idt(&no_idt);
322 __asm__ __volatile__("int3"); 321 __asm__ __volatile__("int3");
323 } 322 }
324 /* rebooting needs to touch the page at absolute addr 0 */ 323 /* rebooting needs to touch the page at absolute addr 0 */
@@ -327,7 +326,7 @@ void machine_restart(char * __unused)
327 mach_reboot_fixups(); /* for board specific fixups */ 326 mach_reboot_fixups(); /* for board specific fixups */
328 mach_reboot(); 327 mach_reboot();
329 /* That didn't work - force a triple fault.. */ 328 /* That didn't work - force a triple fault.. */
330 __asm__ __volatile__("lidt %0": :"m" (no_idt)); 329 load_idt(&no_idt);
331 __asm__ __volatile__("int3"); 330 __asm__ __volatile__("int3");
332 } 331 }
333 } 332 }
@@ -337,23 +336,22 @@ void machine_restart(char * __unused)
337 machine_real_restart(jump_to_bios, sizeof(jump_to_bios)); 336 machine_real_restart(jump_to_bios, sizeof(jump_to_bios));
338} 337}
339 338
340EXPORT_SYMBOL(machine_restart); 339void machine_restart(char * __unused)
340{
341 machine_shutdown();
342 machine_emergency_restart();
343}
341 344
342void machine_halt(void) 345void machine_halt(void)
343{ 346{
344} 347}
345 348
346EXPORT_SYMBOL(machine_halt);
347
348void machine_power_off(void) 349void machine_power_off(void)
349{ 350{
350 lapic_shutdown(); 351 machine_shutdown();
351 352
352 if (efi_enabled)
353 efi.reset_system(EFI_RESET_SHUTDOWN, EFI_SUCCESS, 0, NULL);
354 if (pm_power_off) 353 if (pm_power_off)
355 pm_power_off(); 354 pm_power_off();
356} 355}
357 356
358EXPORT_SYMBOL(machine_power_off);
359 357
diff --git a/arch/i386/kernel/semaphore.c b/arch/i386/kernel/semaphore.c
index 469f496e55c0..7455ab643943 100644
--- a/arch/i386/kernel/semaphore.c
+++ b/arch/i386/kernel/semaphore.c
@@ -13,171 +13,9 @@
13 * rw semaphores implemented November 1999 by Benjamin LaHaise <bcrl@kvack.org> 13 * rw semaphores implemented November 1999 by Benjamin LaHaise <bcrl@kvack.org>
14 */ 14 */
15#include <linux/config.h> 15#include <linux/config.h>
16#include <linux/sched.h>
17#include <linux/err.h>
18#include <linux/init.h>
19#include <asm/semaphore.h> 16#include <asm/semaphore.h>
20 17
21/* 18/*
22 * Semaphores are implemented using a two-way counter:
23 * The "count" variable is decremented for each process
24 * that tries to acquire the semaphore, while the "sleeping"
25 * variable is a count of such acquires.
26 *
27 * Notably, the inline "up()" and "down()" functions can
28 * efficiently test if they need to do any extra work (up
29 * needs to do something only if count was negative before
30 * the increment operation.
31 *
32 * "sleeping" and the contention routine ordering is protected
33 * by the spinlock in the semaphore's waitqueue head.
34 *
35 * Note that these functions are only called when there is
36 * contention on the lock, and as such all this is the
37 * "non-critical" part of the whole semaphore business. The
38 * critical part is the inline stuff in <asm/semaphore.h>
39 * where we want to avoid any extra jumps and calls.
40 */
41
42/*
43 * Logic:
44 * - only on a boundary condition do we need to care. When we go
45 * from a negative count to a non-negative, we wake people up.
46 * - when we go from a non-negative count to a negative do we
47 * (a) synchronize with the "sleeper" count and (b) make sure
48 * that we're on the wakeup list before we synchronize so that
49 * we cannot lose wakeup events.
50 */
51
52static fastcall void __attribute_used__ __up(struct semaphore *sem)
53{
54 wake_up(&sem->wait);
55}
56
57static fastcall void __attribute_used__ __sched __down(struct semaphore * sem)
58{
59 struct task_struct *tsk = current;
60 DECLARE_WAITQUEUE(wait, tsk);
61 unsigned long flags;
62
63 tsk->state = TASK_UNINTERRUPTIBLE;
64 spin_lock_irqsave(&sem->wait.lock, flags);
65 add_wait_queue_exclusive_locked(&sem->wait, &wait);
66
67 sem->sleepers++;
68 for (;;) {
69 int sleepers = sem->sleepers;
70
71 /*
72 * Add "everybody else" into it. They aren't
73 * playing, because we own the spinlock in
74 * the wait_queue_head.
75 */
76 if (!atomic_add_negative(sleepers - 1, &sem->count)) {
77 sem->sleepers = 0;
78 break;
79 }
80 sem->sleepers = 1; /* us - see -1 above */
81 spin_unlock_irqrestore(&sem->wait.lock, flags);
82
83 schedule();
84
85 spin_lock_irqsave(&sem->wait.lock, flags);
86 tsk->state = TASK_UNINTERRUPTIBLE;
87 }
88 remove_wait_queue_locked(&sem->wait, &wait);
89 wake_up_locked(&sem->wait);
90 spin_unlock_irqrestore(&sem->wait.lock, flags);
91 tsk->state = TASK_RUNNING;
92}
93
94static fastcall int __attribute_used__ __sched __down_interruptible(struct semaphore * sem)
95{
96 int retval = 0;
97 struct task_struct *tsk = current;
98 DECLARE_WAITQUEUE(wait, tsk);
99 unsigned long flags;
100
101 tsk->state = TASK_INTERRUPTIBLE;
102 spin_lock_irqsave(&sem->wait.lock, flags);
103 add_wait_queue_exclusive_locked(&sem->wait, &wait);
104
105 sem->sleepers++;
106 for (;;) {
107 int sleepers = sem->sleepers;
108
109 /*
110 * With signals pending, this turns into
111 * the trylock failure case - we won't be
112 * sleeping, and we* can't get the lock as
113 * it has contention. Just correct the count
114 * and exit.
115 */
116 if (signal_pending(current)) {
117 retval = -EINTR;
118 sem->sleepers = 0;
119 atomic_add(sleepers, &sem->count);
120 break;
121 }
122
123 /*
124 * Add "everybody else" into it. They aren't
125 * playing, because we own the spinlock in
126 * wait_queue_head. The "-1" is because we're
127 * still hoping to get the semaphore.
128 */
129 if (!atomic_add_negative(sleepers - 1, &sem->count)) {
130 sem->sleepers = 0;
131 break;
132 }
133 sem->sleepers = 1; /* us - see -1 above */
134 spin_unlock_irqrestore(&sem->wait.lock, flags);
135
136 schedule();
137
138 spin_lock_irqsave(&sem->wait.lock, flags);
139 tsk->state = TASK_INTERRUPTIBLE;
140 }
141 remove_wait_queue_locked(&sem->wait, &wait);
142 wake_up_locked(&sem->wait);
143 spin_unlock_irqrestore(&sem->wait.lock, flags);
144
145 tsk->state = TASK_RUNNING;
146 return retval;
147}
148
149/*
150 * Trylock failed - make sure we correct for
151 * having decremented the count.
152 *
153 * We could have done the trylock with a
154 * single "cmpxchg" without failure cases,
155 * but then it wouldn't work on a 386.
156 */
157static fastcall int __attribute_used__ __down_trylock(struct semaphore * sem)
158{
159 int sleepers;
160 unsigned long flags;
161
162 spin_lock_irqsave(&sem->wait.lock, flags);
163 sleepers = sem->sleepers + 1;
164 sem->sleepers = 0;
165
166 /*
167 * Add "everybody else" and us into it. They aren't
168 * playing, because we own the spinlock in the
169 * wait_queue_head.
170 */
171 if (!atomic_add_negative(sleepers, &sem->count)) {
172 wake_up_locked(&sem->wait);
173 }
174
175 spin_unlock_irqrestore(&sem->wait.lock, flags);
176 return 1;
177}
178
179
180/*
181 * The semaphore operations have a special calling sequence that 19 * The semaphore operations have a special calling sequence that
182 * allow us to do a simpler in-line version of them. These routines 20 * allow us to do a simpler in-line version of them. These routines
183 * need to convert that sequence back into the C sequence when 21 * need to convert that sequence back into the C sequence when
diff --git a/arch/i386/kernel/setup.c b/arch/i386/kernel/setup.c
index 7306353c520e..294bcca985ab 100644
--- a/arch/i386/kernel/setup.c
+++ b/arch/i386/kernel/setup.c
@@ -370,12 +370,16 @@ static void __init limit_regions(unsigned long long size)
370 int i; 370 int i;
371 371
372 if (efi_enabled) { 372 if (efi_enabled) {
373 for (i = 0; i < memmap.nr_map; i++) { 373 efi_memory_desc_t *md;
374 current_addr = memmap.map[i].phys_addr + 374 void *p;
375 (memmap.map[i].num_pages << 12); 375
376 if (memmap.map[i].type == EFI_CONVENTIONAL_MEMORY) { 376 for (p = memmap.map, i = 0; p < memmap.map_end;
377 p += memmap.desc_size, i++) {
378 md = p;
379 current_addr = md->phys_addr + (md->num_pages << 12);
380 if (md->type == EFI_CONVENTIONAL_MEMORY) {
377 if (current_addr >= size) { 381 if (current_addr >= size) {
378 memmap.map[i].num_pages -= 382 md->num_pages -=
379 (((current_addr-size) + PAGE_SIZE-1) >> PAGE_SHIFT); 383 (((current_addr-size) + PAGE_SIZE-1) >> PAGE_SHIFT);
380 memmap.nr_map = i + 1; 384 memmap.nr_map = i + 1;
381 return; 385 return;
@@ -1414,7 +1418,7 @@ static struct nop {
1414 This runs before SMP is initialized to avoid SMP problems with 1418 This runs before SMP is initialized to avoid SMP problems with
1415 self modifying code. This implies that assymetric systems where 1419 self modifying code. This implies that assymetric systems where
1416 APs have less capabilities than the boot processor are not handled. 1420 APs have less capabilities than the boot processor are not handled.
1417 In this case boot with "noreplacement". */ 1421 Tough. Make sure you disable such features by hand. */
1418void apply_alternatives(void *start, void *end) 1422void apply_alternatives(void *start, void *end)
1419{ 1423{
1420 struct alt_instr *a; 1424 struct alt_instr *a;
@@ -1442,24 +1446,12 @@ void apply_alternatives(void *start, void *end)
1442 } 1446 }
1443} 1447}
1444 1448
1445static int no_replacement __initdata = 0;
1446
1447void __init alternative_instructions(void) 1449void __init alternative_instructions(void)
1448{ 1450{
1449 extern struct alt_instr __alt_instructions[], __alt_instructions_end[]; 1451 extern struct alt_instr __alt_instructions[], __alt_instructions_end[];
1450 if (no_replacement)
1451 return;
1452 apply_alternatives(__alt_instructions, __alt_instructions_end); 1452 apply_alternatives(__alt_instructions, __alt_instructions_end);
1453} 1453}
1454 1454
1455static int __init noreplacement_setup(char *s)
1456{
1457 no_replacement = 1;
1458 return 0;
1459}
1460
1461__setup("noreplacement", noreplacement_setup);
1462
1463static char * __init machine_specific_memory_setup(void); 1455static char * __init machine_specific_memory_setup(void);
1464 1456
1465#ifdef CONFIG_MCA 1457#ifdef CONFIG_MCA
@@ -1593,8 +1585,14 @@ void __init setup_arch(char **cmdline_p)
1593 */ 1585 */
1594 acpi_boot_table_init(); 1586 acpi_boot_table_init();
1595 acpi_boot_init(); 1587 acpi_boot_init();
1596#endif
1597 1588
1589#if defined(CONFIG_SMP) && defined(CONFIG_X86_PC)
1590 if (def_to_bigsmp)
1591 printk(KERN_WARNING "More than 8 CPUs detected and "
1592 "CONFIG_X86_PC cannot handle it.\nUse "
1593 "CONFIG_X86_GENERICARCH or CONFIG_X86_BIGSMP.\n");
1594#endif
1595#endif
1598#ifdef CONFIG_X86_LOCAL_APIC 1596#ifdef CONFIG_X86_LOCAL_APIC
1599 if (smp_found_config) 1597 if (smp_found_config)
1600 get_smp_config(); 1598 get_smp_config();
diff --git a/arch/i386/kernel/signal.c b/arch/i386/kernel/signal.c
index 89ef7adc63a4..61eb0c8a6e47 100644
--- a/arch/i386/kernel/signal.c
+++ b/arch/i386/kernel/signal.c
@@ -278,9 +278,9 @@ setup_sigcontext(struct sigcontext __user *sc, struct _fpstate __user *fpstate,
278 int tmp, err = 0; 278 int tmp, err = 0;
279 279
280 tmp = 0; 280 tmp = 0;
281 __asm__("movl %%gs,%0" : "=r"(tmp): "0"(tmp)); 281 savesegment(gs, tmp);
282 err |= __put_user(tmp, (unsigned int __user *)&sc->gs); 282 err |= __put_user(tmp, (unsigned int __user *)&sc->gs);
283 __asm__("movl %%fs,%0" : "=r"(tmp): "0"(tmp)); 283 savesegment(fs, tmp);
284 err |= __put_user(tmp, (unsigned int __user *)&sc->fs); 284 err |= __put_user(tmp, (unsigned int __user *)&sc->fs);
285 285
286 err |= __put_user(regs->xes, (unsigned int __user *)&sc->es); 286 err |= __put_user(regs->xes, (unsigned int __user *)&sc->es);
@@ -577,10 +577,11 @@ handle_signal(unsigned long sig, siginfo_t *info, struct k_sigaction *ka,
577 else 577 else
578 ret = setup_frame(sig, ka, oldset, regs); 578 ret = setup_frame(sig, ka, oldset, regs);
579 579
580 if (ret && !(ka->sa.sa_flags & SA_NODEFER)) { 580 if (ret) {
581 spin_lock_irq(&current->sighand->siglock); 581 spin_lock_irq(&current->sighand->siglock);
582 sigorsets(&current->blocked,&current->blocked,&ka->sa.sa_mask); 582 sigorsets(&current->blocked,&current->blocked,&ka->sa.sa_mask);
583 sigaddset(&current->blocked,sig); 583 if (!(ka->sa.sa_flags & SA_NODEFER))
584 sigaddset(&current->blocked,sig);
584 recalc_sigpending(); 585 recalc_sigpending();
585 spin_unlock_irq(&current->sighand->siglock); 586 spin_unlock_irq(&current->sighand->siglock);
586 } 587 }
@@ -603,7 +604,9 @@ int fastcall do_signal(struct pt_regs *regs, sigset_t *oldset)
603 * We want the common case to go fast, which 604 * We want the common case to go fast, which
604 * is why we may in certain cases get here from 605 * is why we may in certain cases get here from
605 * kernel mode. Just return without doing anything 606 * kernel mode. Just return without doing anything
606 * if so. 607 * if so. vm86 regs switched out by assembly code
608 * before reaching here, so testing against kernel
609 * CS suffices.
607 */ 610 */
608 if (!user_mode(regs)) 611 if (!user_mode(regs))
609 return 1; 612 return 1;
diff --git a/arch/i386/kernel/smp.c b/arch/i386/kernel/smp.c
index cec4bde67161..48b55db3680f 100644
--- a/arch/i386/kernel/smp.c
+++ b/arch/i386/kernel/smp.c
@@ -576,7 +576,7 @@ static void stop_this_cpu (void * dummy)
576 local_irq_disable(); 576 local_irq_disable();
577 disable_local_APIC(); 577 disable_local_APIC();
578 if (cpu_data[smp_processor_id()].hlt_works_ok) 578 if (cpu_data[smp_processor_id()].hlt_works_ok)
579 for(;;) __asm__("hlt"); 579 for(;;) halt();
580 for (;;); 580 for (;;);
581} 581}
582 582
diff --git a/arch/i386/kernel/smpboot.c b/arch/i386/kernel/smpboot.c
index 8ac8e9fd5614..5e4893d2b9f2 100644
--- a/arch/i386/kernel/smpboot.c
+++ b/arch/i386/kernel/smpboot.c
@@ -88,6 +88,8 @@ EXPORT_SYMBOL(cpu_online_map);
88cpumask_t cpu_callin_map; 88cpumask_t cpu_callin_map;
89cpumask_t cpu_callout_map; 89cpumask_t cpu_callout_map;
90EXPORT_SYMBOL(cpu_callout_map); 90EXPORT_SYMBOL(cpu_callout_map);
91cpumask_t cpu_possible_map;
92EXPORT_SYMBOL(cpu_possible_map);
91static cpumask_t smp_commenced_mask; 93static cpumask_t smp_commenced_mask;
92 94
93/* TSC's upper 32 bits can't be written in eariler CPU (before prescott), there 95/* TSC's upper 32 bits can't be written in eariler CPU (before prescott), there
@@ -1017,8 +1019,8 @@ int __devinit smp_prepare_cpu(int cpu)
1017 tsc_sync_disabled = 1; 1019 tsc_sync_disabled = 1;
1018 1020
1019 /* init low mem mapping */ 1021 /* init low mem mapping */
1020 memcpy(swapper_pg_dir, swapper_pg_dir + USER_PGD_PTRS, 1022 clone_pgd_range(swapper_pg_dir, swapper_pg_dir + USER_PGD_PTRS,
1021 sizeof(swapper_pg_dir[0]) * KERNEL_PGD_PTRS); 1023 KERNEL_PGD_PTRS);
1022 flush_tlb_all(); 1024 flush_tlb_all();
1023 schedule_work(&task); 1025 schedule_work(&task);
1024 wait_for_completion(&done); 1026 wait_for_completion(&done);
@@ -1265,6 +1267,7 @@ void __devinit smp_prepare_boot_cpu(void)
1265 cpu_set(smp_processor_id(), cpu_online_map); 1267 cpu_set(smp_processor_id(), cpu_online_map);
1266 cpu_set(smp_processor_id(), cpu_callout_map); 1268 cpu_set(smp_processor_id(), cpu_callout_map);
1267 cpu_set(smp_processor_id(), cpu_present_map); 1269 cpu_set(smp_processor_id(), cpu_present_map);
1270 cpu_set(smp_processor_id(), cpu_possible_map);
1268 per_cpu(cpu_state, smp_processor_id()) = CPU_ONLINE; 1271 per_cpu(cpu_state, smp_processor_id()) = CPU_ONLINE;
1269} 1272}
1270 1273
diff --git a/arch/i386/kernel/syscall_table.S b/arch/i386/kernel/syscall_table.S
index 3db9a04aec6e..9b21a31d4f4e 100644
--- a/arch/i386/kernel/syscall_table.S
+++ b/arch/i386/kernel/syscall_table.S
@@ -251,7 +251,7 @@ ENTRY(sys_call_table)
251 .long sys_io_submit 251 .long sys_io_submit
252 .long sys_io_cancel 252 .long sys_io_cancel
253 .long sys_fadvise64 /* 250 */ 253 .long sys_fadvise64 /* 250 */
254 .long sys_set_zone_reclaim 254 .long sys_ni_syscall
255 .long sys_exit_group 255 .long sys_exit_group
256 .long sys_lookup_dcookie 256 .long sys_lookup_dcookie
257 .long sys_epoll_create 257 .long sys_epoll_create
@@ -291,3 +291,6 @@ ENTRY(sys_call_table)
291 .long sys_keyctl 291 .long sys_keyctl
292 .long sys_ioprio_set 292 .long sys_ioprio_set
293 .long sys_ioprio_get /* 290 */ 293 .long sys_ioprio_get /* 290 */
294 .long sys_inotify_init
295 .long sys_inotify_add_watch
296 .long sys_inotify_rm_watch
diff --git a/arch/i386/kernel/time.c b/arch/i386/kernel/time.c
index 0ee9dee8af06..6f794a78ee1e 100644
--- a/arch/i386/kernel/time.c
+++ b/arch/i386/kernel/time.c
@@ -383,6 +383,7 @@ void notify_arch_cmos_timer(void)
383 383
384static long clock_cmos_diff, sleep_start; 384static long clock_cmos_diff, sleep_start;
385 385
386static struct timer_opts *last_timer;
386static int timer_suspend(struct sys_device *dev, pm_message_t state) 387static int timer_suspend(struct sys_device *dev, pm_message_t state)
387{ 388{
388 /* 389 /*
@@ -391,6 +392,10 @@ static int timer_suspend(struct sys_device *dev, pm_message_t state)
391 clock_cmos_diff = -get_cmos_time(); 392 clock_cmos_diff = -get_cmos_time();
392 clock_cmos_diff += get_seconds(); 393 clock_cmos_diff += get_seconds();
393 sleep_start = get_cmos_time(); 394 sleep_start = get_cmos_time();
395 last_timer = cur_timer;
396 cur_timer = &timer_none;
397 if (last_timer->suspend)
398 last_timer->suspend(state);
394 return 0; 399 return 0;
395} 400}
396 401
@@ -404,6 +409,7 @@ static int timer_resume(struct sys_device *dev)
404 if (is_hpet_enabled()) 409 if (is_hpet_enabled())
405 hpet_reenable(); 410 hpet_reenable();
406#endif 411#endif
412 setup_pit_timer();
407 sec = get_cmos_time() + clock_cmos_diff; 413 sec = get_cmos_time() + clock_cmos_diff;
408 sleep_length = (get_cmos_time() - sleep_start) * HZ; 414 sleep_length = (get_cmos_time() - sleep_start) * HZ;
409 write_seqlock_irqsave(&xtime_lock, flags); 415 write_seqlock_irqsave(&xtime_lock, flags);
@@ -412,6 +418,10 @@ static int timer_resume(struct sys_device *dev)
412 write_sequnlock_irqrestore(&xtime_lock, flags); 418 write_sequnlock_irqrestore(&xtime_lock, flags);
413 jiffies += sleep_length; 419 jiffies += sleep_length;
414 wall_jiffies += sleep_length; 420 wall_jiffies += sleep_length;
421 if (last_timer->resume)
422 last_timer->resume();
423 cur_timer = last_timer;
424 last_timer = NULL;
415 return 0; 425 return 0;
416} 426}
417 427
diff --git a/arch/i386/kernel/timers/timer_hpet.c b/arch/i386/kernel/timers/timer_hpet.c
index ef8dac5dd33b..001de97c9e4a 100644
--- a/arch/i386/kernel/timers/timer_hpet.c
+++ b/arch/i386/kernel/timers/timer_hpet.c
@@ -136,6 +136,8 @@ static void delay_hpet(unsigned long loops)
136 } while ((hpet_end - hpet_start) < (loops)); 136 } while ((hpet_end - hpet_start) < (loops));
137} 137}
138 138
139static struct timer_opts timer_hpet;
140
139static int __init init_hpet(char* override) 141static int __init init_hpet(char* override)
140{ 142{
141 unsigned long result, remain; 143 unsigned long result, remain;
@@ -163,6 +165,8 @@ static int __init init_hpet(char* override)
163 } 165 }
164 set_cyc2ns_scale(cpu_khz/1000); 166 set_cyc2ns_scale(cpu_khz/1000);
165 } 167 }
168 /* set this only when cpu_has_tsc */
169 timer_hpet.read_timer = read_timer_tsc;
166 } 170 }
167 171
168 /* 172 /*
@@ -177,6 +181,19 @@ static int __init init_hpet(char* override)
177 return 0; 181 return 0;
178} 182}
179 183
184static int hpet_resume(void)
185{
186 write_seqlock(&monotonic_lock);
187 /* Assume this is the last mark offset time */
188 rdtsc(last_tsc_low, last_tsc_high);
189
190 if (hpet_use_timer)
191 hpet_last = hpet_readl(HPET_T0_CMP) - hpet_tick;
192 else
193 hpet_last = hpet_readl(HPET_COUNTER);
194 write_sequnlock(&monotonic_lock);
195 return 0;
196}
180/************************************************************/ 197/************************************************************/
181 198
182/* tsc timer_opts struct */ 199/* tsc timer_opts struct */
@@ -186,7 +203,7 @@ static struct timer_opts timer_hpet __read_mostly = {
186 .get_offset = get_offset_hpet, 203 .get_offset = get_offset_hpet,
187 .monotonic_clock = monotonic_clock_hpet, 204 .monotonic_clock = monotonic_clock_hpet,
188 .delay = delay_hpet, 205 .delay = delay_hpet,
189 .read_timer = read_timer_tsc, 206 .resume = hpet_resume,
190}; 207};
191 208
192struct init_timer_opts __initdata timer_hpet_init = { 209struct init_timer_opts __initdata timer_hpet_init = {
diff --git a/arch/i386/kernel/timers/timer_pit.c b/arch/i386/kernel/timers/timer_pit.c
index 06de036a820c..eddb64038234 100644
--- a/arch/i386/kernel/timers/timer_pit.c
+++ b/arch/i386/kernel/timers/timer_pit.c
@@ -175,30 +175,3 @@ void setup_pit_timer(void)
175 outb(LATCH >> 8 , PIT_CH0); /* MSB */ 175 outb(LATCH >> 8 , PIT_CH0); /* MSB */
176 spin_unlock_irqrestore(&i8253_lock, flags); 176 spin_unlock_irqrestore(&i8253_lock, flags);
177} 177}
178
179static int timer_resume(struct sys_device *dev)
180{
181 setup_pit_timer();
182 return 0;
183}
184
185static struct sysdev_class timer_sysclass = {
186 set_kset_name("timer_pit"),
187 .resume = timer_resume,
188};
189
190static struct sys_device device_timer = {
191 .id = 0,
192 .cls = &timer_sysclass,
193};
194
195static int __init init_timer_sysfs(void)
196{
197 int error = sysdev_class_register(&timer_sysclass);
198 if (!error)
199 error = sysdev_register(&device_timer);
200 return error;
201}
202
203device_initcall(init_timer_sysfs);
204
diff --git a/arch/i386/kernel/timers/timer_pm.c b/arch/i386/kernel/timers/timer_pm.c
index 4ef20e663498..264edaaac315 100644
--- a/arch/i386/kernel/timers/timer_pm.c
+++ b/arch/i386/kernel/timers/timer_pm.c
@@ -186,6 +186,14 @@ static void mark_offset_pmtmr(void)
186 } 186 }
187} 187}
188 188
189static int pmtmr_resume(void)
190{
191 write_seqlock(&monotonic_lock);
192 /* Assume this is the last mark offset time */
193 offset_tick = read_pmtmr();
194 write_sequnlock(&monotonic_lock);
195 return 0;
196}
189 197
190static unsigned long long monotonic_clock_pmtmr(void) 198static unsigned long long monotonic_clock_pmtmr(void)
191{ 199{
@@ -247,6 +255,7 @@ static struct timer_opts timer_pmtmr = {
247 .monotonic_clock = monotonic_clock_pmtmr, 255 .monotonic_clock = monotonic_clock_pmtmr,
248 .delay = delay_pmtmr, 256 .delay = delay_pmtmr,
249 .read_timer = read_timer_tsc, 257 .read_timer = read_timer_tsc,
258 .resume = pmtmr_resume,
250}; 259};
251 260
252struct init_timer_opts __initdata timer_pmtmr_init = { 261struct init_timer_opts __initdata timer_pmtmr_init = {
diff --git a/arch/i386/kernel/timers/timer_tsc.c b/arch/i386/kernel/timers/timer_tsc.c
index 8f4e4d5bc560..6dd470cc9f72 100644
--- a/arch/i386/kernel/timers/timer_tsc.c
+++ b/arch/i386/kernel/timers/timer_tsc.c
@@ -543,6 +543,19 @@ static int __init init_tsc(char* override)
543 return -ENODEV; 543 return -ENODEV;
544} 544}
545 545
546static int tsc_resume(void)
547{
548 write_seqlock(&monotonic_lock);
549 /* Assume this is the last mark offset time */
550 rdtsc(last_tsc_low, last_tsc_high);
551#ifdef CONFIG_HPET_TIMER
552 if (is_hpet_enabled() && hpet_use_timer)
553 hpet_last = hpet_readl(HPET_COUNTER);
554#endif
555 write_sequnlock(&monotonic_lock);
556 return 0;
557}
558
546#ifndef CONFIG_X86_TSC 559#ifndef CONFIG_X86_TSC
547/* disable flag for tsc. Takes effect by clearing the TSC cpu flag 560/* disable flag for tsc. Takes effect by clearing the TSC cpu flag
548 * in cpu/common.c */ 561 * in cpu/common.c */
@@ -573,6 +586,7 @@ static struct timer_opts timer_tsc = {
573 .monotonic_clock = monotonic_clock_tsc, 586 .monotonic_clock = monotonic_clock_tsc,
574 .delay = delay_tsc, 587 .delay = delay_tsc,
575 .read_timer = read_timer_tsc, 588 .read_timer = read_timer_tsc,
589 .resume = tsc_resume,
576}; 590};
577 591
578struct init_timer_opts __initdata timer_tsc_init = { 592struct init_timer_opts __initdata timer_tsc_init = {
diff --git a/arch/i386/kernel/traps.c b/arch/i386/kernel/traps.c
index a61f33d06ea3..54629bb5893a 100644
--- a/arch/i386/kernel/traps.c
+++ b/arch/i386/kernel/traps.c
@@ -210,7 +210,7 @@ void show_registers(struct pt_regs *regs)
210 unsigned short ss; 210 unsigned short ss;
211 211
212 esp = (unsigned long) (&regs->esp); 212 esp = (unsigned long) (&regs->esp);
213 ss = __KERNEL_DS; 213 savesegment(ss, ss);
214 if (user_mode(regs)) { 214 if (user_mode(regs)) {
215 in_kernel = 0; 215 in_kernel = 0;
216 esp = regs->esp; 216 esp = regs->esp;
@@ -267,9 +267,6 @@ static void handle_BUG(struct pt_regs *regs)
267 char c; 267 char c;
268 unsigned long eip; 268 unsigned long eip;
269 269
270 if (user_mode(regs))
271 goto no_bug; /* Not in kernel */
272
273 eip = regs->eip; 270 eip = regs->eip;
274 271
275 if (eip < PAGE_OFFSET) 272 if (eip < PAGE_OFFSET)
@@ -568,6 +565,10 @@ static DEFINE_SPINLOCK(nmi_print_lock);
568 565
569void die_nmi (struct pt_regs *regs, const char *msg) 566void die_nmi (struct pt_regs *regs, const char *msg)
570{ 567{
568 if (notify_die(DIE_NMIWATCHDOG, msg, regs, 0, 0, SIGINT) ==
569 NOTIFY_STOP)
570 return;
571
571 spin_lock(&nmi_print_lock); 572 spin_lock(&nmi_print_lock);
572 /* 573 /*
573 * We are in trouble anyway, lets at least try 574 * We are in trouble anyway, lets at least try
@@ -803,15 +804,17 @@ void math_error(void __user *eip)
803 */ 804 */
804 cwd = get_fpu_cwd(task); 805 cwd = get_fpu_cwd(task);
805 swd = get_fpu_swd(task); 806 swd = get_fpu_swd(task);
806 switch (((~cwd) & swd & 0x3f) | (swd & 0x240)) { 807 switch (swd & ~cwd & 0x3f) {
807 case 0x000: 808 case 0x000:
808 default: 809 default:
809 break; 810 break;
810 case 0x001: /* Invalid Op */ 811 case 0x001: /* Invalid Op */
811 case 0x041: /* Stack Fault */ 812 /*
812 case 0x241: /* Stack Fault | Direction */ 813 * swd & 0x240 == 0x040: Stack Underflow
814 * swd & 0x240 == 0x240: Stack Overflow
815 * User must clear the SF bit (0x40) if set
816 */
813 info.si_code = FPE_FLTINV; 817 info.si_code = FPE_FLTINV;
814 /* Should we clear the SF or let user space do it ???? */
815 break; 818 break;
816 case 0x002: /* Denormalize */ 819 case 0x002: /* Denormalize */
817 case 0x010: /* Underflow */ 820 case 0x010: /* Underflow */
@@ -1006,7 +1009,7 @@ void __init trap_init_f00f_bug(void)
1006 * it uses the read-only mapped virtual address. 1009 * it uses the read-only mapped virtual address.
1007 */ 1010 */
1008 idt_descr.address = fix_to_virt(FIX_F00F_IDT); 1011 idt_descr.address = fix_to_virt(FIX_F00F_IDT);
1009 __asm__ __volatile__("lidt %0" : : "m" (idt_descr)); 1012 load_idt(&idt_descr);
1010} 1013}
1011#endif 1014#endif
1012 1015
diff --git a/arch/i386/kernel/vm86.c b/arch/i386/kernel/vm86.c
index ec0f68ce6886..16b485009622 100644
--- a/arch/i386/kernel/vm86.c
+++ b/arch/i386/kernel/vm86.c
@@ -294,8 +294,8 @@ static void do_sys_vm86(struct kernel_vm86_struct *info, struct task_struct *tsk
294 */ 294 */
295 info->regs32->eax = 0; 295 info->regs32->eax = 0;
296 tsk->thread.saved_esp0 = tsk->thread.esp0; 296 tsk->thread.saved_esp0 = tsk->thread.esp0;
297 asm volatile("mov %%fs,%0":"=m" (tsk->thread.saved_fs)); 297 savesegment(fs, tsk->thread.saved_fs);
298 asm volatile("mov %%gs,%0":"=m" (tsk->thread.saved_gs)); 298 savesegment(gs, tsk->thread.saved_gs);
299 299
300 tss = &per_cpu(init_tss, get_cpu()); 300 tss = &per_cpu(init_tss, get_cpu());
301 tsk->thread.esp0 = (unsigned long) &info->VM86_TSS_ESP0; 301 tsk->thread.esp0 = (unsigned long) &info->VM86_TSS_ESP0;
@@ -542,7 +542,7 @@ void handle_vm86_fault(struct kernel_vm86_regs * regs, long error_code)
542 unsigned char opcode; 542 unsigned char opcode;
543 unsigned char __user *csp; 543 unsigned char __user *csp;
544 unsigned char __user *ssp; 544 unsigned char __user *ssp;
545 unsigned short ip, sp; 545 unsigned short ip, sp, orig_flags;
546 int data32, pref_done; 546 int data32, pref_done;
547 547
548#define CHECK_IF_IN_TRAP \ 548#define CHECK_IF_IN_TRAP \
@@ -551,8 +551,12 @@ void handle_vm86_fault(struct kernel_vm86_regs * regs, long error_code)
551#define VM86_FAULT_RETURN do { \ 551#define VM86_FAULT_RETURN do { \
552 if (VMPI.force_return_for_pic && (VEFLAGS & (IF_MASK | VIF_MASK))) \ 552 if (VMPI.force_return_for_pic && (VEFLAGS & (IF_MASK | VIF_MASK))) \
553 return_to_32bit(regs, VM86_PICRETURN); \ 553 return_to_32bit(regs, VM86_PICRETURN); \
554 if (orig_flags & TF_MASK) \
555 handle_vm86_trap(regs, 0, 1); \
554 return; } while (0) 556 return; } while (0)
555 557
558 orig_flags = *(unsigned short *)&regs->eflags;
559
556 csp = (unsigned char __user *) (regs->cs << 4); 560 csp = (unsigned char __user *) (regs->cs << 4);
557 ssp = (unsigned char __user *) (regs->ss << 4); 561 ssp = (unsigned char __user *) (regs->ss << 4);
558 sp = SP(regs); 562 sp = SP(regs);
diff --git a/arch/i386/kernel/vsyscall-sigreturn.S b/arch/i386/kernel/vsyscall-sigreturn.S
index c8fcf75b9be3..68afa50dd7cf 100644
--- a/arch/i386/kernel/vsyscall-sigreturn.S
+++ b/arch/i386/kernel/vsyscall-sigreturn.S
@@ -15,7 +15,7 @@
15*/ 15*/
16 16
17 .text 17 .text
18 .org __kernel_vsyscall+32 18 .org __kernel_vsyscall+32,0x90
19 .globl __kernel_sigreturn 19 .globl __kernel_sigreturn
20 .type __kernel_sigreturn,@function 20 .type __kernel_sigreturn,@function
21__kernel_sigreturn: 21__kernel_sigreturn:
@@ -35,6 +35,7 @@ __kernel_rt_sigreturn:
35 int $0x80 35 int $0x80
36.LEND_rt_sigreturn: 36.LEND_rt_sigreturn:
37 .size __kernel_rt_sigreturn,.-.LSTART_rt_sigreturn 37 .size __kernel_rt_sigreturn,.-.LSTART_rt_sigreturn
38 .balign 32
38 .previous 39 .previous
39 40
40 .section .eh_frame,"a",@progbits 41 .section .eh_frame,"a",@progbits
diff --git a/arch/i386/mach-es7000/es7000.h b/arch/i386/mach-es7000/es7000.h
index 70691f0c4ce2..898ed905e119 100644
--- a/arch/i386/mach-es7000/es7000.h
+++ b/arch/i386/mach-es7000/es7000.h
@@ -104,7 +104,8 @@ struct mip_reg {
104#define MIP_SW_APIC 0x1020b 104#define MIP_SW_APIC 0x1020b
105#define MIP_FUNC(VALUE) (VALUE & 0xff) 105#define MIP_FUNC(VALUE) (VALUE & 0xff)
106 106
107extern int parse_unisys_oem (char *oemptr, int oem_entries); 107extern int parse_unisys_oem (char *oemptr);
108extern int find_unisys_acpi_oem_table(unsigned long *oem_addr, int *length); 108extern int find_unisys_acpi_oem_table(unsigned long *oem_addr);
109extern void setup_unisys ();
109extern int es7000_start_cpu(int cpu, unsigned long eip); 110extern int es7000_start_cpu(int cpu, unsigned long eip);
110extern void es7000_sw_apic(void); 111extern void es7000_sw_apic(void);
diff --git a/arch/i386/mach-es7000/es7000plat.c b/arch/i386/mach-es7000/es7000plat.c
index d5936d500479..2000bdca2fc2 100644
--- a/arch/i386/mach-es7000/es7000plat.c
+++ b/arch/i386/mach-es7000/es7000plat.c
@@ -75,12 +75,29 @@ es7000_rename_gsi(int ioapic, int gsi)
75 75
76#endif // (CONFIG_X86_IO_APIC) && (CONFIG_ACPI_INTERPRETER || CONFIG_ACPI_BOOT) 76#endif // (CONFIG_X86_IO_APIC) && (CONFIG_ACPI_INTERPRETER || CONFIG_ACPI_BOOT)
77 77
78void __init
79setup_unisys ()
80{
81 /*
82 * Determine the generation of the ES7000 currently running.
83 *
84 * es7000_plat = 1 if the machine is a 5xx ES7000 box
85 * es7000_plat = 2 if the machine is a x86_64 ES7000 box
86 *
87 */
88 if (!(boot_cpu_data.x86 <= 15 && boot_cpu_data.x86_model <= 2))
89 es7000_plat = 2;
90 else
91 es7000_plat = 1;
92 ioapic_renumber_irq = es7000_rename_gsi;
93}
94
78/* 95/*
79 * Parse the OEM Table 96 * Parse the OEM Table
80 */ 97 */
81 98
82int __init 99int __init
83parse_unisys_oem (char *oemptr, int oem_entries) 100parse_unisys_oem (char *oemptr)
84{ 101{
85 int i; 102 int i;
86 int success = 0; 103 int success = 0;
@@ -95,7 +112,7 @@ parse_unisys_oem (char *oemptr, int oem_entries)
95 112
96 tp += 8; 113 tp += 8;
97 114
98 for (i=0; i <= oem_entries; i++) { 115 for (i=0; i <= 6; i++) {
99 type = *tp++; 116 type = *tp++;
100 size = *tp++; 117 size = *tp++;
101 tp -= 2; 118 tp -= 2;
@@ -130,34 +147,18 @@ parse_unisys_oem (char *oemptr, int oem_entries)
130 default: 147 default:
131 break; 148 break;
132 } 149 }
133 if (i == 6) break;
134 tp += size; 150 tp += size;
135 } 151 }
136 152
137 if (success < 2) { 153 if (success < 2) {
138 es7000_plat = 0; 154 es7000_plat = 0;
139 } else { 155 } else
140 printk("\nEnabling ES7000 specific features...\n"); 156 setup_unisys();
141 /*
142 * Determine the generation of the ES7000 currently running.
143 *
144 * es7000_plat = 0 if the machine is NOT a Unisys ES7000 box
145 * es7000_plat = 1 if the machine is a 5xx ES7000 box
146 * es7000_plat = 2 if the machine is a x86_64 ES7000 box
147 *
148 */
149 if (!(boot_cpu_data.x86 <= 15 && boot_cpu_data.x86_model <= 2))
150 es7000_plat = 2;
151 else
152 es7000_plat = 1;
153
154 ioapic_renumber_irq = es7000_rename_gsi;
155 }
156 return es7000_plat; 157 return es7000_plat;
157} 158}
158 159
159int __init 160int __init
160find_unisys_acpi_oem_table(unsigned long *oem_addr, int *length) 161find_unisys_acpi_oem_table(unsigned long *oem_addr)
161{ 162{
162 struct acpi_table_rsdp *rsdp = NULL; 163 struct acpi_table_rsdp *rsdp = NULL;
163 unsigned long rsdp_phys = 0; 164 unsigned long rsdp_phys = 0;
@@ -201,13 +202,11 @@ find_unisys_acpi_oem_table(unsigned long *oem_addr, int *length)
201 acpi_table_print(header, sdt.entry[i].pa); 202 acpi_table_print(header, sdt.entry[i].pa);
202 t = (struct oem_table *) __acpi_map_table(sdt.entry[i].pa, header->length); 203 t = (struct oem_table *) __acpi_map_table(sdt.entry[i].pa, header->length);
203 addr = (void *) __acpi_map_table(t->OEMTableAddr, t->OEMTableSize); 204 addr = (void *) __acpi_map_table(t->OEMTableAddr, t->OEMTableSize);
204 *length = header->length;
205 *oem_addr = (unsigned long) addr; 205 *oem_addr = (unsigned long) addr;
206 return 0; 206 return 0;
207 } 207 }
208 } 208 }
209 } 209 }
210 Dprintk("ES7000: did not find Unisys ACPI OEM table!\n");
211 return -1; 210 return -1;
212} 211}
213 212
diff --git a/arch/i386/mach-generic/bigsmp.c b/arch/i386/mach-generic/bigsmp.c
index 25883b44f625..037b2af1a1f4 100644
--- a/arch/i386/mach-generic/bigsmp.c
+++ b/arch/i386/mach-generic/bigsmp.c
@@ -47,7 +47,10 @@ static struct dmi_system_id __initdata bigsmp_dmi_table[] = {
47 47
48static __init int probe_bigsmp(void) 48static __init int probe_bigsmp(void)
49{ 49{
50 dmi_check_system(bigsmp_dmi_table); 50 if (def_to_bigsmp)
51 dmi_bigsmp = 1;
52 else
53 dmi_check_system(bigsmp_dmi_table);
51 return dmi_bigsmp; 54 return dmi_bigsmp;
52} 55}
53 56
diff --git a/arch/i386/mach-generic/probe.c b/arch/i386/mach-generic/probe.c
index 5497c65a8790..cea5b3ce4b57 100644
--- a/arch/i386/mach-generic/probe.c
+++ b/arch/i386/mach-generic/probe.c
@@ -30,6 +30,25 @@ struct genapic *apic_probe[] __initdata = {
30 NULL, 30 NULL,
31}; 31};
32 32
33static int cmdline_apic;
34
35void __init generic_bigsmp_probe(void)
36{
37 /*
38 * This routine is used to switch to bigsmp mode when
39 * - There is no apic= option specified by the user
40 * - generic_apic_probe() has choosen apic_default as the sub_arch
41 * - we find more than 8 CPUs in acpi LAPIC listing with xAPIC support
42 */
43
44 if (!cmdline_apic && genapic == &apic_default)
45 if (apic_bigsmp.probe()) {
46 genapic = &apic_bigsmp;
47 printk(KERN_INFO "Overriding APIC driver with %s\n",
48 genapic->name);
49 }
50}
51
33void __init generic_apic_probe(char *command_line) 52void __init generic_apic_probe(char *command_line)
34{ 53{
35 char *s; 54 char *s;
@@ -52,6 +71,7 @@ void __init generic_apic_probe(char *command_line)
52 if (!changed) 71 if (!changed)
53 printk(KERN_ERR "Unknown genapic `%s' specified.\n", s); 72 printk(KERN_ERR "Unknown genapic `%s' specified.\n", s);
54 *p = old; 73 *p = old;
74 cmdline_apic = changed;
55 } 75 }
56 for (i = 0; !changed && apic_probe[i]; i++) { 76 for (i = 0; !changed && apic_probe[i]; i++) {
57 if (apic_probe[i]->probe()) { 77 if (apic_probe[i]->probe()) {
diff --git a/arch/i386/mach-visws/reboot.c b/arch/i386/mach-visws/reboot.c
index 3a81e904a7b8..5d73e042ed0a 100644
--- a/arch/i386/mach-visws/reboot.c
+++ b/arch/i386/mach-visws/reboot.c
@@ -7,13 +7,17 @@
7#include "piix4.h" 7#include "piix4.h"
8 8
9void (*pm_power_off)(void); 9void (*pm_power_off)(void);
10EXPORT_SYMBOL(pm_power_off);
10 11
11void machine_restart(char * __unused) 12void machine_shutdown(void)
12{ 13{
13#ifdef CONFIG_SMP 14#ifdef CONFIG_SMP
14 smp_send_stop(); 15 smp_send_stop();
15#endif 16#endif
17}
16 18
19void machine_emergency_restart(void)
20{
17 /* 21 /*
18 * Visual Workstations restart after this 22 * Visual Workstations restart after this
19 * register is poked on the PIIX4 23 * register is poked on the PIIX4
@@ -21,7 +25,11 @@ void machine_restart(char * __unused)
21 outb(PIIX4_RESET_VAL, PIIX4_RESET_PORT); 25 outb(PIIX4_RESET_VAL, PIIX4_RESET_PORT);
22} 26}
23 27
24EXPORT_SYMBOL(machine_restart); 28void machine_restart(char * __unused)
29{
30 machine_shutdown();
31 machine_emergency_restart();
32}
25 33
26void machine_power_off(void) 34void machine_power_off(void)
27{ 35{
@@ -42,10 +50,7 @@ void machine_power_off(void)
42 outl(PIIX_SPECIAL_STOP, 0xCFC); 50 outl(PIIX_SPECIAL_STOP, 0xCFC);
43} 51}
44 52
45EXPORT_SYMBOL(machine_power_off);
46
47void machine_halt(void) 53void machine_halt(void)
48{ 54{
49} 55}
50 56
51EXPORT_SYMBOL(machine_halt);
diff --git a/arch/i386/mach-visws/setup.c b/arch/i386/mach-visws/setup.c
index 9f6d2d9b1be7..26ada6fc0d77 100644
--- a/arch/i386/mach-visws/setup.c
+++ b/arch/i386/mach-visws/setup.c
@@ -14,6 +14,8 @@
14#include "cobalt.h" 14#include "cobalt.h"
15#include "piix4.h" 15#include "piix4.h"
16 16
17int no_broadcast;
18
17char visws_board_type = -1; 19char visws_board_type = -1;
18char visws_board_rev = -1; 20char visws_board_rev = -1;
19 21
diff --git a/arch/i386/mach-voyager/voyager_basic.c b/arch/i386/mach-voyager/voyager_basic.c
index 3e439ce5e1b2..cc69875d979b 100644
--- a/arch/i386/mach-voyager/voyager_basic.c
+++ b/arch/i386/mach-voyager/voyager_basic.c
@@ -36,6 +36,7 @@
36 * Power off function, if any 36 * Power off function, if any
37 */ 37 */
38void (*pm_power_off)(void); 38void (*pm_power_off)(void);
39EXPORT_SYMBOL(pm_power_off);
39 40
40int voyager_level = 0; 41int voyager_level = 0;
41 42
@@ -233,10 +234,9 @@ voyager_power_off(void)
233#endif 234#endif
234 } 235 }
235 /* and wait for it to happen */ 236 /* and wait for it to happen */
236 for(;;) { 237 local_irq_disable();
237 __asm("cli"); 238 for(;;)
238 __asm("hlt"); 239 halt();
239 }
240} 240}
241 241
242/* copied from process.c */ 242/* copied from process.c */
@@ -251,6 +251,12 @@ kb_wait(void)
251} 251}
252 252
253void 253void
254machine_shutdown(void)
255{
256 /* Architecture specific shutdown needed before a kexec */
257}
258
259void
254machine_restart(char *cmd) 260machine_restart(char *cmd)
255{ 261{
256 printk("Voyager Warm Restart\n"); 262 printk("Voyager Warm Restart\n");
@@ -271,13 +277,17 @@ machine_restart(char *cmd)
271 outb(basebd | 0x08, VOYAGER_MC_SETUP); 277 outb(basebd | 0x08, VOYAGER_MC_SETUP);
272 outb(0x02, catbase + 0x21); 278 outb(0x02, catbase + 0x21);
273 } 279 }
274 for(;;) { 280 local_irq_disable();
275 asm("cli"); 281 for(;;)
276 asm("hlt"); 282 halt();
277 }
278} 283}
279 284
280EXPORT_SYMBOL(machine_restart); 285void
286machine_emergency_restart(void)
287{
288 /*for now, just hook this to a warm restart */
289 machine_restart(NULL);
290}
281 291
282void 292void
283mca_nmi_hook(void) 293mca_nmi_hook(void)
@@ -314,12 +324,9 @@ machine_halt(void)
314 machine_power_off(); 324 machine_power_off();
315} 325}
316 326
317EXPORT_SYMBOL(machine_halt);
318
319void machine_power_off(void) 327void machine_power_off(void)
320{ 328{
321 if (pm_power_off) 329 if (pm_power_off)
322 pm_power_off(); 330 pm_power_off();
323} 331}
324 332
325EXPORT_SYMBOL(machine_power_off);
diff --git a/arch/i386/mach-voyager/voyager_smp.c b/arch/i386/mach-voyager/voyager_smp.c
index 8c8527593da0..46b0cf4a31e0 100644
--- a/arch/i386/mach-voyager/voyager_smp.c
+++ b/arch/i386/mach-voyager/voyager_smp.c
@@ -10,6 +10,7 @@
10 * the voyager hal to provide the functionality 10 * the voyager hal to provide the functionality
11 */ 11 */
12#include <linux/config.h> 12#include <linux/config.h>
13#include <linux/module.h>
13#include <linux/mm.h> 14#include <linux/mm.h>
14#include <linux/kernel_stat.h> 15#include <linux/kernel_stat.h>
15#include <linux/delay.h> 16#include <linux/delay.h>
@@ -40,6 +41,7 @@ static unsigned long cpu_irq_affinity[NR_CPUS] __cacheline_aligned = { [0 ... NR
40/* per CPU data structure (for /proc/cpuinfo et al), visible externally 41/* per CPU data structure (for /proc/cpuinfo et al), visible externally
41 * indexed physically */ 42 * indexed physically */
42struct cpuinfo_x86 cpu_data[NR_CPUS] __cacheline_aligned; 43struct cpuinfo_x86 cpu_data[NR_CPUS] __cacheline_aligned;
44EXPORT_SYMBOL(cpu_data);
43 45
44/* physical ID of the CPU used to boot the system */ 46/* physical ID of the CPU used to boot the system */
45unsigned char boot_cpu_id; 47unsigned char boot_cpu_id;
@@ -72,6 +74,7 @@ static volatile unsigned long smp_invalidate_needed;
72/* Bitmask of currently online CPUs - used by setup.c for 74/* Bitmask of currently online CPUs - used by setup.c for
73 /proc/cpuinfo, visible externally but still physical */ 75 /proc/cpuinfo, visible externally but still physical */
74cpumask_t cpu_online_map = CPU_MASK_NONE; 76cpumask_t cpu_online_map = CPU_MASK_NONE;
77EXPORT_SYMBOL(cpu_online_map);
75 78
76/* Bitmask of CPUs present in the system - exported by i386_syms.c, used 79/* Bitmask of CPUs present in the system - exported by i386_syms.c, used
77 * by scheduler but indexed physically */ 80 * by scheduler but indexed physically */
@@ -238,6 +241,9 @@ static cpumask_t smp_commenced_mask = CPU_MASK_NONE;
238/* This is for the new dynamic CPU boot code */ 241/* This is for the new dynamic CPU boot code */
239cpumask_t cpu_callin_map = CPU_MASK_NONE; 242cpumask_t cpu_callin_map = CPU_MASK_NONE;
240cpumask_t cpu_callout_map = CPU_MASK_NONE; 243cpumask_t cpu_callout_map = CPU_MASK_NONE;
244EXPORT_SYMBOL(cpu_callout_map);
245cpumask_t cpu_possible_map = CPU_MASK_ALL;
246EXPORT_SYMBOL(cpu_possible_map);
241 247
242/* The per processor IRQ masks (these are usually kept in sync) */ 248/* The per processor IRQ masks (these are usually kept in sync) */
243static __u16 vic_irq_mask[NR_CPUS] __cacheline_aligned; 249static __u16 vic_irq_mask[NR_CPUS] __cacheline_aligned;
@@ -978,6 +984,7 @@ void flush_tlb_page(struct vm_area_struct * vma, unsigned long va)
978 984
979 preempt_enable(); 985 preempt_enable();
980} 986}
987EXPORT_SYMBOL(flush_tlb_page);
981 988
982/* enable the requested IRQs */ 989/* enable the requested IRQs */
983static void 990static void
@@ -1010,7 +1017,7 @@ smp_stop_cpu_function(void *dummy)
1010 cpu_clear(smp_processor_id(), cpu_online_map); 1017 cpu_clear(smp_processor_id(), cpu_online_map);
1011 local_irq_disable(); 1018 local_irq_disable();
1012 for(;;) 1019 for(;;)
1013 __asm__("hlt"); 1020 halt();
1014} 1021}
1015 1022
1016static DEFINE_SPINLOCK(call_lock); 1023static DEFINE_SPINLOCK(call_lock);
@@ -1109,6 +1116,7 @@ smp_call_function (void (*func) (void *info), void *info, int retry,
1109 1116
1110 return 0; 1117 return 0;
1111} 1118}
1119EXPORT_SYMBOL(smp_call_function);
1112 1120
1113/* Sorry about the name. In an APIC based system, the APICs 1121/* Sorry about the name. In an APIC based system, the APICs
1114 * themselves are programmed to send a timer interrupt. This is used 1122 * themselves are programmed to send a timer interrupt. This is used
@@ -1904,6 +1912,7 @@ void __devinit smp_prepare_boot_cpu(void)
1904{ 1912{
1905 cpu_set(smp_processor_id(), cpu_online_map); 1913 cpu_set(smp_processor_id(), cpu_online_map);
1906 cpu_set(smp_processor_id(), cpu_callout_map); 1914 cpu_set(smp_processor_id(), cpu_callout_map);
1915 cpu_set(smp_processor_id(), cpu_possible_map);
1907} 1916}
1908 1917
1909int __devinit 1918int __devinit
diff --git a/arch/i386/math-emu/get_address.c b/arch/i386/math-emu/get_address.c
index 91175738e948..9819b705efa4 100644
--- a/arch/i386/math-emu/get_address.c
+++ b/arch/i386/math-emu/get_address.c
@@ -155,7 +155,6 @@ static long pm_address(u_char FPU_modrm, u_char segment,
155{ 155{
156 struct desc_struct descriptor; 156 struct desc_struct descriptor;
157 unsigned long base_address, limit, address, seg_top; 157 unsigned long base_address, limit, address, seg_top;
158 unsigned short selector;
159 158
160 segment--; 159 segment--;
161 160
@@ -173,17 +172,11 @@ static long pm_address(u_char FPU_modrm, u_char segment,
173 /* fs and gs aren't used by the kernel, so they still have their 172 /* fs and gs aren't used by the kernel, so they still have their
174 user-space values. */ 173 user-space values. */
175 case PREFIX_FS_-1: 174 case PREFIX_FS_-1:
176 /* The cast is needed here to get gcc 2.8.0 to use a 16 bit register 175 /* N.B. - movl %seg, mem is a 2 byte write regardless of prefix */
177 in the assembler statement. */ 176 savesegment(fs, addr->selector);
178
179 __asm__("mov %%fs,%0":"=r" (selector));
180 addr->selector = selector;
181 break; 177 break;
182 case PREFIX_GS_-1: 178 case PREFIX_GS_-1:
183 /* The cast is needed here to get gcc 2.8.0 to use a 16 bit register 179 savesegment(gs, addr->selector);
184 in the assembler statement. */
185 __asm__("mov %%gs,%0":"=r" (selector));
186 addr->selector = selector;
187 break; 180 break;
188 default: 181 default:
189 addr->selector = PM_REG_(segment); 182 addr->selector = PM_REG_(segment);
diff --git a/arch/i386/mm/discontig.c b/arch/i386/mm/discontig.c
index b358f0702a44..6711ce3f6916 100644
--- a/arch/i386/mm/discontig.c
+++ b/arch/i386/mm/discontig.c
@@ -262,6 +262,17 @@ static unsigned long calculate_numa_remap_pages(void)
262 reserve_pages += size; 262 reserve_pages += size;
263 printk("Shrinking node %d from %ld pages to %ld pages\n", 263 printk("Shrinking node %d from %ld pages to %ld pages\n",
264 nid, node_end_pfn[nid], node_end_pfn[nid] - size); 264 nid, node_end_pfn[nid], node_end_pfn[nid] - size);
265
266 if (node_end_pfn[nid] & (PTRS_PER_PTE-1)) {
267 /*
268 * Align node_end_pfn[] and node_remap_start_pfn[] to
269 * pmd boundary. remap_numa_kva will barf otherwise.
270 */
271 printk("Shrinking node %d further by %ld pages for proper alignment\n",
272 nid, node_end_pfn[nid] & (PTRS_PER_PTE-1));
273 size += node_end_pfn[nid] & (PTRS_PER_PTE-1);
274 }
275
265 node_end_pfn[nid] -= size; 276 node_end_pfn[nid] -= size;
266 node_remap_start_pfn[nid] = node_end_pfn[nid]; 277 node_remap_start_pfn[nid] = node_end_pfn[nid];
267 } 278 }
diff --git a/arch/i386/mm/fault.c b/arch/i386/mm/fault.c
index 8e90339d6eaa..411b8500ad1b 100644
--- a/arch/i386/mm/fault.c
+++ b/arch/i386/mm/fault.c
@@ -199,6 +199,18 @@ static inline int is_prefetch(struct pt_regs *regs, unsigned long addr,
199 return 0; 199 return 0;
200} 200}
201 201
202static noinline void force_sig_info_fault(int si_signo, int si_code,
203 unsigned long address, struct task_struct *tsk)
204{
205 siginfo_t info;
206
207 info.si_signo = si_signo;
208 info.si_errno = 0;
209 info.si_code = si_code;
210 info.si_addr = (void __user *)address;
211 force_sig_info(si_signo, &info, tsk);
212}
213
202fastcall void do_invalid_op(struct pt_regs *, unsigned long); 214fastcall void do_invalid_op(struct pt_regs *, unsigned long);
203 215
204/* 216/*
@@ -218,11 +230,10 @@ fastcall void do_page_fault(struct pt_regs *regs, unsigned long error_code)
218 struct vm_area_struct * vma; 230 struct vm_area_struct * vma;
219 unsigned long address; 231 unsigned long address;
220 unsigned long page; 232 unsigned long page;
221 int write; 233 int write, si_code;
222 siginfo_t info;
223 234
224 /* get the address */ 235 /* get the address */
225 __asm__("movl %%cr2,%0":"=r" (address)); 236 address = read_cr2();
226 237
227 if (notify_die(DIE_PAGE_FAULT, "page fault", regs, error_code, 14, 238 if (notify_die(DIE_PAGE_FAULT, "page fault", regs, error_code, 14,
228 SIGSEGV) == NOTIFY_STOP) 239 SIGSEGV) == NOTIFY_STOP)
@@ -233,7 +244,7 @@ fastcall void do_page_fault(struct pt_regs *regs, unsigned long error_code)
233 244
234 tsk = current; 245 tsk = current;
235 246
236 info.si_code = SEGV_MAPERR; 247 si_code = SEGV_MAPERR;
237 248
238 /* 249 /*
239 * We fault-in kernel-space virtual memory on-demand. The 250 * We fault-in kernel-space virtual memory on-demand. The
@@ -313,7 +324,7 @@ fastcall void do_page_fault(struct pt_regs *regs, unsigned long error_code)
313 * we can handle it.. 324 * we can handle it..
314 */ 325 */
315good_area: 326good_area:
316 info.si_code = SEGV_ACCERR; 327 si_code = SEGV_ACCERR;
317 write = 0; 328 write = 0;
318 switch (error_code & 3) { 329 switch (error_code & 3) {
319 default: /* 3: write, present */ 330 default: /* 3: write, present */
@@ -387,11 +398,7 @@ bad_area_nosemaphore:
387 /* Kernel addresses are always protection faults */ 398 /* Kernel addresses are always protection faults */
388 tsk->thread.error_code = error_code | (address >= TASK_SIZE); 399 tsk->thread.error_code = error_code | (address >= TASK_SIZE);
389 tsk->thread.trap_no = 14; 400 tsk->thread.trap_no = 14;
390 info.si_signo = SIGSEGV; 401 force_sig_info_fault(SIGSEGV, si_code, address, tsk);
391 info.si_errno = 0;
392 /* info.si_code has been set above */
393 info.si_addr = (void __user *)address;
394 force_sig_info(SIGSEGV, &info, tsk);
395 return; 402 return;
396 } 403 }
397 404
@@ -446,7 +453,7 @@ no_context:
446 printk(" at virtual address %08lx\n",address); 453 printk(" at virtual address %08lx\n",address);
447 printk(KERN_ALERT " printing eip:\n"); 454 printk(KERN_ALERT " printing eip:\n");
448 printk("%08lx\n", regs->eip); 455 printk("%08lx\n", regs->eip);
449 asm("movl %%cr3,%0":"=r" (page)); 456 page = read_cr3();
450 page = ((unsigned long *) __va(page))[address >> 22]; 457 page = ((unsigned long *) __va(page))[address >> 22];
451 printk(KERN_ALERT "*pde = %08lx\n", page); 458 printk(KERN_ALERT "*pde = %08lx\n", page);
452 /* 459 /*
@@ -500,11 +507,7 @@ do_sigbus:
500 tsk->thread.cr2 = address; 507 tsk->thread.cr2 = address;
501 tsk->thread.error_code = error_code; 508 tsk->thread.error_code = error_code;
502 tsk->thread.trap_no = 14; 509 tsk->thread.trap_no = 14;
503 info.si_signo = SIGBUS; 510 force_sig_info_fault(SIGBUS, BUS_ADRERR, address, tsk);
504 info.si_errno = 0;
505 info.si_code = BUS_ADRERR;
506 info.si_addr = (void __user *)address;
507 force_sig_info(SIGBUS, &info, tsk);
508 return; 511 return;
509 512
510vmalloc_fault: 513vmalloc_fault:
@@ -523,7 +526,7 @@ vmalloc_fault:
523 pmd_t *pmd, *pmd_k; 526 pmd_t *pmd, *pmd_k;
524 pte_t *pte_k; 527 pte_t *pte_k;
525 528
526 asm("movl %%cr3,%0":"=r" (pgd_paddr)); 529 pgd_paddr = read_cr3();
527 pgd = index + (pgd_t *)__va(pgd_paddr); 530 pgd = index + (pgd_t *)__va(pgd_paddr);
528 pgd_k = init_mm.pgd + index; 531 pgd_k = init_mm.pgd + index;
529 532
diff --git a/arch/i386/mm/hugetlbpage.c b/arch/i386/mm/hugetlbpage.c
index 3b099f32b948..d524127c9afc 100644
--- a/arch/i386/mm/hugetlbpage.c
+++ b/arch/i386/mm/hugetlbpage.c
@@ -22,12 +22,15 @@ pte_t *huge_pte_alloc(struct mm_struct *mm, unsigned long addr)
22{ 22{
23 pgd_t *pgd; 23 pgd_t *pgd;
24 pud_t *pud; 24 pud_t *pud;
25 pmd_t *pmd = NULL; 25 pte_t *pte = NULL;
26 26
27 pgd = pgd_offset(mm, addr); 27 pgd = pgd_offset(mm, addr);
28 pud = pud_alloc(mm, pgd, addr); 28 pud = pud_alloc(mm, pgd, addr);
29 pmd = pmd_alloc(mm, pud, addr); 29 if (pud)
30 return (pte_t *) pmd; 30 pte = (pte_t *) pmd_alloc(mm, pud, addr);
31 BUG_ON(pte && !pte_none(*pte) && !pte_huge(*pte));
32
33 return pte;
31} 34}
32 35
33pte_t *huge_pte_offset(struct mm_struct *mm, unsigned long addr) 36pte_t *huge_pte_offset(struct mm_struct *mm, unsigned long addr)
@@ -37,8 +40,11 @@ pte_t *huge_pte_offset(struct mm_struct *mm, unsigned long addr)
37 pmd_t *pmd = NULL; 40 pmd_t *pmd = NULL;
38 41
39 pgd = pgd_offset(mm, addr); 42 pgd = pgd_offset(mm, addr);
40 pud = pud_offset(pgd, addr); 43 if (pgd_present(*pgd)) {
41 pmd = pmd_offset(pud, addr); 44 pud = pud_offset(pgd, addr);
45 if (pud_present(*pud))
46 pmd = pmd_offset(pud, addr);
47 }
42 return (pte_t *) pmd; 48 return (pte_t *) pmd;
43} 49}
44 50
@@ -118,17 +124,6 @@ follow_huge_pmd(struct mm_struct *mm, unsigned long address,
118} 124}
119#endif 125#endif
120 126
121void hugetlb_clean_stale_pgtable(pte_t *pte)
122{
123 pmd_t *pmd = (pmd_t *) pte;
124 struct page *page;
125
126 page = pmd_page(*pmd);
127 pmd_clear(pmd);
128 dec_page_state(nr_page_table_pages);
129 page_cache_release(page);
130}
131
132/* x86_64 also uses this file */ 127/* x86_64 also uses this file */
133 128
134#ifdef HAVE_ARCH_HUGETLB_UNMAPPED_AREA 129#ifdef HAVE_ARCH_HUGETLB_UNMAPPED_AREA
diff --git a/arch/i386/mm/init.c b/arch/i386/mm/init.c
index 12216b52e28b..9edfc058b894 100644
--- a/arch/i386/mm/init.c
+++ b/arch/i386/mm/init.c
@@ -198,9 +198,10 @@ int page_is_ram(unsigned long pagenr)
198 198
199 if (efi_enabled) { 199 if (efi_enabled) {
200 efi_memory_desc_t *md; 200 efi_memory_desc_t *md;
201 void *p;
201 202
202 for (i = 0; i < memmap.nr_map; i++) { 203 for (p = memmap.map; p < memmap.map_end; p += memmap.desc_size) {
203 md = &memmap.map[i]; 204 md = p;
204 if (!is_available_memory(md)) 205 if (!is_available_memory(md))
205 continue; 206 continue;
206 addr = (md->phys_addr+PAGE_SIZE-1) >> PAGE_SHIFT; 207 addr = (md->phys_addr+PAGE_SIZE-1) >> PAGE_SHIFT;
@@ -348,7 +349,7 @@ static void __init pagetable_init (void)
348 * All user-space mappings are explicitly cleared after 349 * All user-space mappings are explicitly cleared after
349 * SMP startup. 350 * SMP startup.
350 */ 351 */
351 pgd_base[0] = pgd_base[USER_PTRS_PER_PGD]; 352 set_pgd(&pgd_base[0], pgd_base[USER_PTRS_PER_PGD]);
352#endif 353#endif
353} 354}
354 355
diff --git a/arch/i386/mm/pageattr.c b/arch/i386/mm/pageattr.c
index cb3da6baa704..f600fc244f02 100644
--- a/arch/i386/mm/pageattr.c
+++ b/arch/i386/mm/pageattr.c
@@ -12,6 +12,7 @@
12#include <asm/uaccess.h> 12#include <asm/uaccess.h>
13#include <asm/processor.h> 13#include <asm/processor.h>
14#include <asm/tlbflush.h> 14#include <asm/tlbflush.h>
15#include <asm/pgalloc.h>
15 16
16static DEFINE_SPINLOCK(cpa_lock); 17static DEFINE_SPINLOCK(cpa_lock);
17static struct list_head df_list = LIST_HEAD_INIT(df_list); 18static struct list_head df_list = LIST_HEAD_INIT(df_list);
@@ -52,8 +53,8 @@ static struct page *split_large_page(unsigned long address, pgprot_t prot)
52 addr = address & LARGE_PAGE_MASK; 53 addr = address & LARGE_PAGE_MASK;
53 pbase = (pte_t *)page_address(base); 54 pbase = (pte_t *)page_address(base);
54 for (i = 0; i < PTRS_PER_PTE; i++, addr += PAGE_SIZE) { 55 for (i = 0; i < PTRS_PER_PTE; i++, addr += PAGE_SIZE) {
55 pbase[i] = pfn_pte(addr >> PAGE_SHIFT, 56 set_pte(&pbase[i], pfn_pte(addr >> PAGE_SHIFT,
56 addr == address ? prot : PAGE_KERNEL); 57 addr == address ? prot : PAGE_KERNEL));
57 } 58 }
58 return base; 59 return base;
59} 60}
@@ -62,7 +63,7 @@ static void flush_kernel_map(void *dummy)
62{ 63{
63 /* Could use CLFLUSH here if the CPU supports it (Hammer,P4) */ 64 /* Could use CLFLUSH here if the CPU supports it (Hammer,P4) */
64 if (boot_cpu_data.x86_model >= 4) 65 if (boot_cpu_data.x86_model >= 4)
65 asm volatile("wbinvd":::"memory"); 66 wbinvd();
66 /* Flush all to work around Errata in early athlons regarding 67 /* Flush all to work around Errata in early athlons regarding
67 * large page flushing. 68 * large page flushing.
68 */ 69 */
diff --git a/arch/i386/mm/pgtable.c b/arch/i386/mm/pgtable.c
index bd2f7afc7a2a..dcdce2c6c532 100644
--- a/arch/i386/mm/pgtable.c
+++ b/arch/i386/mm/pgtable.c
@@ -207,19 +207,19 @@ void pgd_ctor(void *pgd, kmem_cache_t *cache, unsigned long unused)
207{ 207{
208 unsigned long flags; 208 unsigned long flags;
209 209
210 if (PTRS_PER_PMD == 1) 210 if (PTRS_PER_PMD == 1) {
211 memset(pgd, 0, USER_PTRS_PER_PGD*sizeof(pgd_t));
211 spin_lock_irqsave(&pgd_lock, flags); 212 spin_lock_irqsave(&pgd_lock, flags);
213 }
212 214
213 memcpy((pgd_t *)pgd + USER_PTRS_PER_PGD, 215 clone_pgd_range((pgd_t *)pgd + USER_PTRS_PER_PGD,
214 swapper_pg_dir + USER_PTRS_PER_PGD, 216 swapper_pg_dir + USER_PTRS_PER_PGD,
215 (PTRS_PER_PGD - USER_PTRS_PER_PGD) * sizeof(pgd_t)); 217 KERNEL_PGD_PTRS);
216
217 if (PTRS_PER_PMD > 1) 218 if (PTRS_PER_PMD > 1)
218 return; 219 return;
219 220
220 pgd_list_add(pgd); 221 pgd_list_add(pgd);
221 spin_unlock_irqrestore(&pgd_lock, flags); 222 spin_unlock_irqrestore(&pgd_lock, flags);
222 memset(pgd, 0, USER_PTRS_PER_PGD*sizeof(pgd_t));
223} 223}
224 224
225/* never called when PTRS_PER_PMD > 1 */ 225/* never called when PTRS_PER_PMD > 1 */
diff --git a/arch/i386/pci/acpi.c b/arch/i386/pci/acpi.c
index 2db65ec45dc3..42913f43feb0 100644
--- a/arch/i386/pci/acpi.c
+++ b/arch/i386/pci/acpi.c
@@ -30,6 +30,7 @@ static int __init pci_acpi_init(void)
30 acpi_irq_penalty_init(); 30 acpi_irq_penalty_init();
31 pcibios_scanned++; 31 pcibios_scanned++;
32 pcibios_enable_irq = acpi_pci_irq_enable; 32 pcibios_enable_irq = acpi_pci_irq_enable;
33 pcibios_disable_irq = acpi_pci_irq_disable;
33 34
34 if (pci_routeirq) { 35 if (pci_routeirq) {
35 /* 36 /*
diff --git a/arch/i386/pci/common.c b/arch/i386/pci/common.c
index 70bcd53451f6..c96bea14b98f 100644
--- a/arch/i386/pci/common.c
+++ b/arch/i386/pci/common.c
@@ -165,7 +165,6 @@ static int __init pcibios_init(void)
165 if ((pci_probe & PCI_BIOS_SORT) && !(pci_probe & PCI_NO_SORT)) 165 if ((pci_probe & PCI_BIOS_SORT) && !(pci_probe & PCI_NO_SORT))
166 pcibios_sort(); 166 pcibios_sort();
167#endif 167#endif
168 pci_assign_unassigned_resources();
169 return 0; 168 return 0;
170} 169}
171 170
@@ -254,3 +253,9 @@ int pcibios_enable_device(struct pci_dev *dev, int mask)
254 253
255 return pcibios_enable_irq(dev); 254 return pcibios_enable_irq(dev);
256} 255}
256
257void pcibios_disable_device (struct pci_dev *dev)
258{
259 if (pcibios_disable_irq)
260 pcibios_disable_irq(dev);
261}
diff --git a/arch/i386/pci/i386.c b/arch/i386/pci/i386.c
index 93a364c82150..3cc480998a47 100644
--- a/arch/i386/pci/i386.c
+++ b/arch/i386/pci/i386.c
@@ -170,43 +170,26 @@ static void __init pcibios_allocate_resources(int pass)
170static int __init pcibios_assign_resources(void) 170static int __init pcibios_assign_resources(void)
171{ 171{
172 struct pci_dev *dev = NULL; 172 struct pci_dev *dev = NULL;
173 int idx; 173 struct resource *r, *pr;
174 struct resource *r;
175
176 for_each_pci_dev(dev) {
177 int class = dev->class >> 8;
178
179 /* Don't touch classless devices and host bridges */
180 if (!class || class == PCI_CLASS_BRIDGE_HOST)
181 continue;
182
183 for(idx=0; idx<6; idx++) {
184 r = &dev->resource[idx];
185
186 /*
187 * Don't touch IDE controllers and I/O ports of video cards!
188 */
189 if ((class == PCI_CLASS_STORAGE_IDE && idx < 4) ||
190 (class == PCI_CLASS_DISPLAY_VGA && (r->flags & IORESOURCE_IO)))
191 continue;
192
193 /*
194 * We shall assign a new address to this resource, either because
195 * the BIOS forgot to do so or because we have decided the old
196 * address was unusable for some reason.
197 */
198 if (!r->start && r->end)
199 pci_assign_resource(dev, idx);
200 }
201 174
202 if (pci_probe & PCI_ASSIGN_ROMS) { 175 if (!(pci_probe & PCI_ASSIGN_ROMS)) {
176 /* Try to use BIOS settings for ROMs, otherwise let
177 pci_assign_unassigned_resources() allocate the new
178 addresses. */
179 for_each_pci_dev(dev) {
203 r = &dev->resource[PCI_ROM_RESOURCE]; 180 r = &dev->resource[PCI_ROM_RESOURCE];
204 r->end -= r->start; 181 if (!r->flags || !r->start)
205 r->start = 0; 182 continue;
206 if (r->end) 183 pr = pci_find_parent_resource(dev, r);
207 pci_assign_resource(dev, PCI_ROM_RESOURCE); 184 if (!pr || request_resource(pr, r) < 0) {
185 r->end -= r->start;
186 r->start = 0;
187 }
208 } 188 }
209 } 189 }
190
191 pci_assign_unassigned_resources();
192
210 return 0; 193 return 0;
211} 194}
212 195
diff --git a/arch/i386/pci/irq.c b/arch/i386/pci/irq.c
index 78ca1ecbb907..86348b68fda1 100644
--- a/arch/i386/pci/irq.c
+++ b/arch/i386/pci/irq.c
@@ -56,6 +56,7 @@ struct irq_router_handler {
56}; 56};
57 57
58int (*pcibios_enable_irq)(struct pci_dev *dev) = NULL; 58int (*pcibios_enable_irq)(struct pci_dev *dev) = NULL;
59void (*pcibios_disable_irq)(struct pci_dev *dev) = NULL;
59 60
60/* 61/*
61 * Check passed address for the PCI IRQ Routing Table signature 62 * Check passed address for the PCI IRQ Routing Table signature
@@ -550,6 +551,13 @@ static __init int intel_router_probe(struct irq_router *r, struct pci_dev *route
550static __init int via_router_probe(struct irq_router *r, struct pci_dev *router, u16 device) 551static __init int via_router_probe(struct irq_router *r, struct pci_dev *router, u16 device)
551{ 552{
552 /* FIXME: We should move some of the quirk fixup stuff here */ 553 /* FIXME: We should move some of the quirk fixup stuff here */
554
555 if (router->device == PCI_DEVICE_ID_VIA_82C686 &&
556 device == PCI_DEVICE_ID_VIA_82C586_0) {
557 /* Asus k7m bios wrongly reports 82C686A as 586-compatible */
558 device = PCI_DEVICE_ID_VIA_82C686;
559 }
560
553 switch(device) 561 switch(device)
554 { 562 {
555 case PCI_DEVICE_ID_VIA_82C586_0: 563 case PCI_DEVICE_ID_VIA_82C586_0:
@@ -1051,24 +1059,28 @@ static int __init pcibios_irq_init(void)
1051subsys_initcall(pcibios_irq_init); 1059subsys_initcall(pcibios_irq_init);
1052 1060
1053 1061
1054static void pirq_penalize_isa_irq(int irq) 1062static void pirq_penalize_isa_irq(int irq, int active)
1055{ 1063{
1056 /* 1064 /*
1057 * If any ISAPnP device reports an IRQ in its list of possible 1065 * If any ISAPnP device reports an IRQ in its list of possible
1058 * IRQ's, we try to avoid assigning it to PCI devices. 1066 * IRQ's, we try to avoid assigning it to PCI devices.
1059 */ 1067 */
1060 if (irq < 16) 1068 if (irq < 16) {
1061 pirq_penalty[irq] += 100; 1069 if (active)
1070 pirq_penalty[irq] += 1000;
1071 else
1072 pirq_penalty[irq] += 100;
1073 }
1062} 1074}
1063 1075
1064void pcibios_penalize_isa_irq(int irq) 1076void pcibios_penalize_isa_irq(int irq, int active)
1065{ 1077{
1066#ifdef CONFIG_ACPI_PCI 1078#ifdef CONFIG_ACPI_PCI
1067 if (!acpi_noirq) 1079 if (!acpi_noirq)
1068 acpi_penalize_isa_irq(irq); 1080 acpi_penalize_isa_irq(irq, active);
1069 else 1081 else
1070#endif 1082#endif
1071 pirq_penalize_isa_irq(irq); 1083 pirq_penalize_isa_irq(irq, active);
1072} 1084}
1073 1085
1074static int pirq_enable_irq(struct pci_dev *dev) 1086static int pirq_enable_irq(struct pci_dev *dev)
diff --git a/arch/i386/pci/pci.h b/arch/i386/pci/pci.h
index a80f0f55ff51..127d53ad16be 100644
--- a/arch/i386/pci/pci.h
+++ b/arch/i386/pci/pci.h
@@ -73,3 +73,4 @@ extern int pcibios_scanned;
73extern spinlock_t pci_config_lock; 73extern spinlock_t pci_config_lock;
74 74
75extern int (*pcibios_enable_irq)(struct pci_dev *dev); 75extern int (*pcibios_enable_irq)(struct pci_dev *dev);
76extern void (*pcibios_disable_irq)(struct pci_dev *dev);
diff --git a/arch/i386/pci/visws.c b/arch/i386/pci/visws.c
index 6a9248784439..6c17433fdf7d 100644
--- a/arch/i386/pci/visws.c
+++ b/arch/i386/pci/visws.c
@@ -18,10 +18,12 @@
18extern struct pci_raw_ops pci_direct_conf1; 18extern struct pci_raw_ops pci_direct_conf1;
19 19
20static int pci_visws_enable_irq(struct pci_dev *dev) { return 0; } 20static int pci_visws_enable_irq(struct pci_dev *dev) { return 0; }
21static void pci_visws_disable_irq(struct pci_dev *dev) { }
21 22
22int (*pcibios_enable_irq)(struct pci_dev *dev) = &pci_visws_enable_irq; 23int (*pcibios_enable_irq)(struct pci_dev *dev) = &pci_visws_enable_irq;
24void (*pcibios_disable_irq)(struct pci_dev *dev) = &pci_visws_disable_irq;
23 25
24void __init pcibios_penalize_isa_irq(int irq) {} 26void __init pcibios_penalize_isa_irq(int irq, int active) {}
25 27
26 28
27unsigned int pci_bus0, pci_bus1; 29unsigned int pci_bus0, pci_bus1;
diff --git a/arch/i386/power/cpu.c b/arch/i386/power/cpu.c
index c547c1af6fa1..7b0b9ad848e5 100644
--- a/arch/i386/power/cpu.c
+++ b/arch/i386/power/cpu.c
@@ -42,25 +42,25 @@ void __save_processor_state(struct saved_context *ctxt)
42 /* 42 /*
43 * descriptor tables 43 * descriptor tables
44 */ 44 */
45 asm volatile ("sgdt %0" : "=m" (ctxt->gdt_limit)); 45 store_gdt(&ctxt->gdt_limit);
46 asm volatile ("sidt %0" : "=m" (ctxt->idt_limit)); 46 store_idt(&ctxt->idt_limit);
47 asm volatile ("str %0" : "=m" (ctxt->tr)); 47 store_tr(ctxt->tr);
48 48
49 /* 49 /*
50 * segment registers 50 * segment registers
51 */ 51 */
52 asm volatile ("movw %%es, %0" : "=m" (ctxt->es)); 52 savesegment(es, ctxt->es);
53 asm volatile ("movw %%fs, %0" : "=m" (ctxt->fs)); 53 savesegment(fs, ctxt->fs);
54 asm volatile ("movw %%gs, %0" : "=m" (ctxt->gs)); 54 savesegment(gs, ctxt->gs);
55 asm volatile ("movw %%ss, %0" : "=m" (ctxt->ss)); 55 savesegment(ss, ctxt->ss);
56 56
57 /* 57 /*
58 * control registers 58 * control registers
59 */ 59 */
60 asm volatile ("movl %%cr0, %0" : "=r" (ctxt->cr0)); 60 ctxt->cr0 = read_cr0();
61 asm volatile ("movl %%cr2, %0" : "=r" (ctxt->cr2)); 61 ctxt->cr2 = read_cr2();
62 asm volatile ("movl %%cr3, %0" : "=r" (ctxt->cr3)); 62 ctxt->cr3 = read_cr3();
63 asm volatile ("movl %%cr4, %0" : "=r" (ctxt->cr4)); 63 ctxt->cr4 = read_cr4();
64} 64}
65 65
66void save_processor_state(void) 66void save_processor_state(void)
@@ -84,7 +84,6 @@ static void fix_processor_context(void)
84 struct tss_struct * t = &per_cpu(init_tss, cpu); 84 struct tss_struct * t = &per_cpu(init_tss, cpu);
85 85
86 set_tss_desc(cpu,t); /* This just modifies memory; should not be necessary. But... This is necessary, because 386 hardware has concept of busy TSS or some similar stupidity. */ 86 set_tss_desc(cpu,t); /* This just modifies memory; should not be necessary. But... This is necessary, because 386 hardware has concept of busy TSS or some similar stupidity. */
87 per_cpu(cpu_gdt_table, cpu)[GDT_ENTRY_TSS].b &= 0xfffffdff;
88 87
89 load_TR_desc(); /* This does ltr */ 88 load_TR_desc(); /* This does ltr */
90 load_LDT(&current->active_mm->context); /* This does lldt */ 89 load_LDT(&current->active_mm->context); /* This does lldt */
@@ -109,25 +108,25 @@ void __restore_processor_state(struct saved_context *ctxt)
109 /* 108 /*
110 * control registers 109 * control registers
111 */ 110 */
112 asm volatile ("movl %0, %%cr4" :: "r" (ctxt->cr4)); 111 write_cr4(ctxt->cr4);
113 asm volatile ("movl %0, %%cr3" :: "r" (ctxt->cr3)); 112 write_cr3(ctxt->cr3);
114 asm volatile ("movl %0, %%cr2" :: "r" (ctxt->cr2)); 113 write_cr2(ctxt->cr2);
115 asm volatile ("movl %0, %%cr0" :: "r" (ctxt->cr0)); 114 write_cr2(ctxt->cr0);
116 115
117 /* 116 /*
118 * now restore the descriptor tables to their proper values 117 * now restore the descriptor tables to their proper values
119 * ltr is done i fix_processor_context(). 118 * ltr is done i fix_processor_context().
120 */ 119 */
121 asm volatile ("lgdt %0" :: "m" (ctxt->gdt_limit)); 120 load_gdt(&ctxt->gdt_limit);
122 asm volatile ("lidt %0" :: "m" (ctxt->idt_limit)); 121 load_idt(&ctxt->idt_limit);
123 122
124 /* 123 /*
125 * segment registers 124 * segment registers
126 */ 125 */
127 asm volatile ("movw %0, %%es" :: "r" (ctxt->es)); 126 loadsegment(es, ctxt->es);
128 asm volatile ("movw %0, %%fs" :: "r" (ctxt->fs)); 127 loadsegment(fs, ctxt->fs);
129 asm volatile ("movw %0, %%gs" :: "r" (ctxt->gs)); 128 loadsegment(gs, ctxt->gs);
130 asm volatile ("movw %0, %%ss" :: "r" (ctxt->ss)); 129 loadsegment(ss, ctxt->ss);
131 130
132 /* 131 /*
133 * sysenter MSRs 132 * sysenter MSRs
diff --git a/arch/ia64/Kconfig b/arch/ia64/Kconfig
index 01b78e7f992e..3deced637f07 100644
--- a/arch/ia64/Kconfig
+++ b/arch/ia64/Kconfig
@@ -220,13 +220,6 @@ config IOSAPIC
220 depends on !IA64_HP_SIM 220 depends on !IA64_HP_SIM
221 default y 221 default y
222 222
223config IA64_SGI_SN_SIM
224 bool "SGI Medusa Simulator Support"
225 depends on IA64_SGI_SN2 || IA64_GENERIC
226 help
227 If you are compiling a kernel that will run under SGI's IA-64
228 simulator (Medusa) then say Y, otherwise say N.
229
230config IA64_SGI_SN_XP 223config IA64_SGI_SN_XP
231 tristate "Support communication between SGI SSIs" 224 tristate "Support communication between SGI SSIs"
232 select IA64_UNCACHED_ALLOCATOR 225 select IA64_UNCACHED_ALLOCATOR
@@ -390,6 +383,12 @@ source "drivers/acpi/Kconfig"
390 383
391endif 384endif
392 385
386if PM
387
388source "arch/ia64/kernel/cpufreq/Kconfig"
389
390endif
391
393endmenu 392endmenu
394 393
395if !IA64_HP_SIM 394if !IA64_HP_SIM
@@ -399,15 +398,8 @@ menu "Bus options (PCI, PCMCIA)"
399config PCI 398config PCI
400 bool "PCI support" 399 bool "PCI support"
401 help 400 help
402 Find out whether you have a PCI motherboard. PCI is the name of a 401 Real IA-64 machines all have PCI/PCI-X/PCI Express busses. Say Y
403 bus system, i.e. the way the CPU talks to the other stuff inside 402 here unless you are using a simulator without PCI support.
404 your box. Other bus systems are ISA, EISA, MicroChannel (MCA) or
405 VESA. If you have PCI, say Y, otherwise N.
406
407 The PCI-HOWTO, available from
408 <http://www.tldp.org/docs.html#howto>, contains valuable
409 information about which PCI hardware does work under Linux and which
410 doesn't.
411 403
412config PCI_DOMAINS 404config PCI_DOMAINS
413 bool 405 bool
@@ -423,6 +415,8 @@ endmenu
423 415
424endif 416endif
425 417
418source "net/Kconfig"
419
426source "drivers/Kconfig" 420source "drivers/Kconfig"
427 421
428source "fs/Kconfig" 422source "fs/Kconfig"
diff --git a/arch/ia64/configs/sn2_defconfig b/arch/ia64/configs/sn2_defconfig
index c05613980300..dccf35c60b94 100644
--- a/arch/ia64/configs/sn2_defconfig
+++ b/arch/ia64/configs/sn2_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.10 3# Linux kernel version: 2.6.13-rc6
4# Mon Jan 10 13:57:35 2005 4# Tue Aug 16 14:40:41 2005
5# 5#
6 6
7# 7#
@@ -10,6 +10,7 @@
10CONFIG_EXPERIMENTAL=y 10CONFIG_EXPERIMENTAL=y
11CONFIG_CLEAN_COMPILE=y 11CONFIG_CLEAN_COMPILE=y
12CONFIG_LOCK_KERNEL=y 12CONFIG_LOCK_KERNEL=y
13CONFIG_INIT_ENV_ARG_LIMIT=32
13 14
14# 15#
15# General setup 16# General setup
@@ -21,24 +22,26 @@ CONFIG_POSIX_MQUEUE=y
21# CONFIG_BSD_PROCESS_ACCT is not set 22# CONFIG_BSD_PROCESS_ACCT is not set
22CONFIG_SYSCTL=y 23CONFIG_SYSCTL=y
23# CONFIG_AUDIT is not set 24# CONFIG_AUDIT is not set
24CONFIG_LOG_BUF_SHIFT=20
25CONFIG_HOTPLUG=y 25CONFIG_HOTPLUG=y
26CONFIG_KOBJECT_UEVENT=y 26CONFIG_KOBJECT_UEVENT=y
27# CONFIG_IKCONFIG is not set 27# CONFIG_IKCONFIG is not set
28CONFIG_CPUSETS=y
28# CONFIG_EMBEDDED is not set 29# CONFIG_EMBEDDED is not set
29CONFIG_KALLSYMS=y 30CONFIG_KALLSYMS=y
30CONFIG_KALLSYMS_ALL=y 31CONFIG_KALLSYMS_ALL=y
31# CONFIG_KALLSYMS_EXTRA_PASS is not set 32# CONFIG_KALLSYMS_EXTRA_PASS is not set
33CONFIG_PRINTK=y
34CONFIG_BUG=y
35CONFIG_BASE_FULL=y
32CONFIG_FUTEX=y 36CONFIG_FUTEX=y
33CONFIG_EPOLL=y 37CONFIG_EPOLL=y
34CONFIG_CPUSETS=y
35# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
36CONFIG_SHMEM=y 38CONFIG_SHMEM=y
37CONFIG_CC_ALIGN_FUNCTIONS=0 39CONFIG_CC_ALIGN_FUNCTIONS=0
38CONFIG_CC_ALIGN_LABELS=0 40CONFIG_CC_ALIGN_LABELS=0
39CONFIG_CC_ALIGN_LOOPS=0 41CONFIG_CC_ALIGN_LOOPS=0
40CONFIG_CC_ALIGN_JUMPS=0 42CONFIG_CC_ALIGN_JUMPS=0
41# CONFIG_TINY_SHMEM is not set 43# CONFIG_TINY_SHMEM is not set
44CONFIG_BASE_SMALL=0
42 45
43# 46#
44# Loadable module support 47# Loadable module support
@@ -63,9 +66,12 @@ CONFIG_GENERIC_CALIBRATE_DELAY=y
63CONFIG_TIME_INTERPOLATION=y 66CONFIG_TIME_INTERPOLATION=y
64CONFIG_EFI=y 67CONFIG_EFI=y
65CONFIG_GENERIC_IOMAP=y 68CONFIG_GENERIC_IOMAP=y
69CONFIG_SCHED_NO_NO_OMIT_FRAME_POINTER=y
70CONFIG_IA64_UNCACHED_ALLOCATOR=y
66# CONFIG_IA64_GENERIC is not set 71# CONFIG_IA64_GENERIC is not set
67# CONFIG_IA64_DIG is not set 72# CONFIG_IA64_DIG is not set
68# CONFIG_IA64_HP_ZX1 is not set 73# CONFIG_IA64_HP_ZX1 is not set
74# CONFIG_IA64_HP_ZX1_SWIOTLB is not set
69CONFIG_IA64_SGI_SN2=y 75CONFIG_IA64_SGI_SN2=y
70# CONFIG_IA64_HP_SIM is not set 76# CONFIG_IA64_HP_SIM is not set
71# CONFIG_ITANIUM is not set 77# CONFIG_ITANIUM is not set
@@ -74,6 +80,10 @@ CONFIG_MCKINLEY=y
74# CONFIG_IA64_PAGE_SIZE_8KB is not set 80# CONFIG_IA64_PAGE_SIZE_8KB is not set
75CONFIG_IA64_PAGE_SIZE_16KB=y 81CONFIG_IA64_PAGE_SIZE_16KB=y
76# CONFIG_IA64_PAGE_SIZE_64KB is not set 82# CONFIG_IA64_PAGE_SIZE_64KB is not set
83# CONFIG_HZ_100 is not set
84CONFIG_HZ_250=y
85# CONFIG_HZ_1000 is not set
86CONFIG_HZ=250
77CONFIG_IA64_L1_CACHE_SHIFT=7 87CONFIG_IA64_L1_CACHE_SHIFT=7
78CONFIG_NUMA=y 88CONFIG_NUMA=y
79CONFIG_VIRTUAL_MEM_MAP=y 89CONFIG_VIRTUAL_MEM_MAP=y
@@ -81,12 +91,20 @@ CONFIG_HOLES_IN_ZONE=y
81CONFIG_ARCH_DISCONTIGMEM_ENABLE=y 91CONFIG_ARCH_DISCONTIGMEM_ENABLE=y
82# CONFIG_IA64_CYCLONE is not set 92# CONFIG_IA64_CYCLONE is not set
83CONFIG_IOSAPIC=y 93CONFIG_IOSAPIC=y
84CONFIG_IA64_SGI_SN_SIM=y 94CONFIG_IA64_SGI_SN_XP=m
85CONFIG_FORCE_MAX_ZONEORDER=18 95CONFIG_FORCE_MAX_ZONEORDER=18
86CONFIG_SMP=y 96CONFIG_SMP=y
87CONFIG_NR_CPUS=512 97CONFIG_NR_CPUS=512
88# CONFIG_HOTPLUG_CPU is not set 98# CONFIG_HOTPLUG_CPU is not set
99CONFIG_SCHED_SMT=y
89CONFIG_PREEMPT=y 100CONFIG_PREEMPT=y
101CONFIG_SELECT_MEMORY_MODEL=y
102# CONFIG_FLATMEM_MANUAL is not set
103CONFIG_DISCONTIGMEM_MANUAL=y
104# CONFIG_SPARSEMEM_MANUAL is not set
105CONFIG_DISCONTIGMEM=y
106CONFIG_FLAT_NODE_MEM_MAP=y
107CONFIG_NEED_MULTIPLE_NODES=y
90CONFIG_HAVE_DEC_LOCK=y 108CONFIG_HAVE_DEC_LOCK=y
91CONFIG_IA32_SUPPORT=y 109CONFIG_IA32_SUPPORT=y
92CONFIG_COMPAT=y 110CONFIG_COMPAT=y
@@ -106,6 +124,7 @@ CONFIG_BINFMT_ELF=y
106# 124#
107# Power management and ACPI 125# Power management and ACPI
108# 126#
127CONFIG_PM=y
109CONFIG_ACPI=y 128CONFIG_ACPI=y
110 129
111# 130#
@@ -115,6 +134,7 @@ CONFIG_ACPI_BOOT=y
115CONFIG_ACPI_INTERPRETER=y 134CONFIG_ACPI_INTERPRETER=y
116# CONFIG_ACPI_BUTTON is not set 135# CONFIG_ACPI_BUTTON is not set
117CONFIG_ACPI_VIDEO=m 136CONFIG_ACPI_VIDEO=m
137CONFIG_ACPI_HOTKEY=m
118# CONFIG_ACPI_FAN is not set 138# CONFIG_ACPI_FAN is not set
119# CONFIG_ACPI_PROCESSOR is not set 139# CONFIG_ACPI_PROCESSOR is not set
120CONFIG_ACPI_NUMA=y 140CONFIG_ACPI_NUMA=y
@@ -134,6 +154,7 @@ CONFIG_PCI_DOMAINS=y
134# CONFIG_PCI_MSI is not set 154# CONFIG_PCI_MSI is not set
135CONFIG_PCI_LEGACY_PROC=y 155CONFIG_PCI_LEGACY_PROC=y
136CONFIG_PCI_NAMES=y 156CONFIG_PCI_NAMES=y
157# CONFIG_PCI_DEBUG is not set
137 158
138# 159#
139# PCI Hotplug Support 160# PCI Hotplug Support
@@ -142,7 +163,6 @@ CONFIG_HOTPLUG_PCI=y
142# CONFIG_HOTPLUG_PCI_FAKE is not set 163# CONFIG_HOTPLUG_PCI_FAKE is not set
143# CONFIG_HOTPLUG_PCI_ACPI is not set 164# CONFIG_HOTPLUG_PCI_ACPI is not set
144# CONFIG_HOTPLUG_PCI_CPCI is not set 165# CONFIG_HOTPLUG_PCI_CPCI is not set
145# CONFIG_HOTPLUG_PCI_PCIE is not set
146# CONFIG_HOTPLUG_PCI_SHPC is not set 166# CONFIG_HOTPLUG_PCI_SHPC is not set
147CONFIG_HOTPLUG_PCI_SGI=y 167CONFIG_HOTPLUG_PCI_SGI=y
148 168
@@ -152,8 +172,70 @@ CONFIG_HOTPLUG_PCI_SGI=y
152# CONFIG_PCCARD is not set 172# CONFIG_PCCARD is not set
153 173
154# 174#
155# PC-card bridges 175# Networking
176#
177CONFIG_NET=y
178
179#
180# Networking options
181#
182CONFIG_PACKET=y
183CONFIG_PACKET_MMAP=y
184CONFIG_UNIX=y
185# CONFIG_NET_KEY is not set
186CONFIG_INET=y
187CONFIG_IP_MULTICAST=y
188# CONFIG_IP_ADVANCED_ROUTER is not set
189CONFIG_IP_FIB_HASH=y
190# CONFIG_IP_PNP is not set
191# CONFIG_NET_IPIP is not set
192# CONFIG_NET_IPGRE is not set
193# CONFIG_IP_MROUTE is not set
194# CONFIG_ARPD is not set
195CONFIG_SYN_COOKIES=y
196# CONFIG_INET_AH is not set
197# CONFIG_INET_ESP is not set
198# CONFIG_INET_IPCOMP is not set
199# CONFIG_INET_TUNNEL is not set
200CONFIG_IP_TCPDIAG=y
201# CONFIG_IP_TCPDIAG_IPV6 is not set
202# CONFIG_TCP_CONG_ADVANCED is not set
203CONFIG_TCP_CONG_BIC=y
204CONFIG_IPV6=m
205# CONFIG_IPV6_PRIVACY is not set
206# CONFIG_INET6_AH is not set
207# CONFIG_INET6_ESP is not set
208# CONFIG_INET6_IPCOMP is not set
209# CONFIG_INET6_TUNNEL is not set
210# CONFIG_IPV6_TUNNEL is not set
211# CONFIG_NETFILTER is not set
212
213#
214# SCTP Configuration (EXPERIMENTAL)
215#
216# CONFIG_IP_SCTP is not set
217# CONFIG_ATM is not set
218# CONFIG_BRIDGE is not set
219# CONFIG_VLAN_8021Q is not set
220# CONFIG_DECNET is not set
221# CONFIG_LLC2 is not set
222# CONFIG_IPX is not set
223# CONFIG_ATALK is not set
224# CONFIG_X25 is not set
225# CONFIG_LAPB is not set
226# CONFIG_NET_DIVERT is not set
227# CONFIG_ECONET is not set
228# CONFIG_WAN_ROUTER is not set
229# CONFIG_NET_SCHED is not set
230# CONFIG_NET_CLS_ROUTE is not set
231
232#
233# Network testing
156# 234#
235# CONFIG_NET_PKTGEN is not set
236# CONFIG_HAMRADIO is not set
237# CONFIG_IRDA is not set
238# CONFIG_BT is not set
157 239
158# 240#
159# Device Drivers 241# Device Drivers
@@ -164,7 +246,7 @@ CONFIG_HOTPLUG_PCI_SGI=y
164# 246#
165CONFIG_STANDALONE=y 247CONFIG_STANDALONE=y
166CONFIG_PREVENT_FIRMWARE_BUILD=y 248CONFIG_PREVENT_FIRMWARE_BUILD=y
167CONFIG_FW_LOADER=m 249CONFIG_FW_LOADER=y
168# CONFIG_DEBUG_DRIVER is not set 250# CONFIG_DEBUG_DRIVER is not set
169 251
170# 252#
@@ -189,6 +271,7 @@ CONFIG_FW_LOADER=m
189# CONFIG_BLK_CPQ_CISS_DA is not set 271# CONFIG_BLK_CPQ_CISS_DA is not set
190# CONFIG_BLK_DEV_DAC960 is not set 272# CONFIG_BLK_DEV_DAC960 is not set
191# CONFIG_BLK_DEV_UMEM is not set 273# CONFIG_BLK_DEV_UMEM is not set
274# CONFIG_BLK_DEV_COW_COMMON is not set
192CONFIG_BLK_DEV_LOOP=y 275CONFIG_BLK_DEV_LOOP=y
193CONFIG_BLK_DEV_CRYPTOLOOP=m 276CONFIG_BLK_DEV_CRYPTOLOOP=m
194CONFIG_BLK_DEV_NBD=m 277CONFIG_BLK_DEV_NBD=m
@@ -253,6 +336,7 @@ CONFIG_IDEDMA_PCI_AUTO=y
253# CONFIG_BLK_DEV_HPT366 is not set 336# CONFIG_BLK_DEV_HPT366 is not set
254# CONFIG_BLK_DEV_SC1200 is not set 337# CONFIG_BLK_DEV_SC1200 is not set
255# CONFIG_BLK_DEV_PIIX is not set 338# CONFIG_BLK_DEV_PIIX is not set
339# CONFIG_BLK_DEV_IT821X is not set
256# CONFIG_BLK_DEV_NS87415 is not set 340# CONFIG_BLK_DEV_NS87415 is not set
257# CONFIG_BLK_DEV_PDC202XX_OLD is not set 341# CONFIG_BLK_DEV_PDC202XX_OLD is not set
258# CONFIG_BLK_DEV_PDC202XX_NEW is not set 342# CONFIG_BLK_DEV_PDC202XX_NEW is not set
@@ -283,6 +367,7 @@ CONFIG_CHR_DEV_ST=m
283CONFIG_BLK_DEV_SR=m 367CONFIG_BLK_DEV_SR=m
284# CONFIG_BLK_DEV_SR_VENDOR is not set 368# CONFIG_BLK_DEV_SR_VENDOR is not set
285CONFIG_CHR_DEV_SG=m 369CONFIG_CHR_DEV_SG=m
370CONFIG_CHR_DEV_SCH=m
286 371
287# 372#
288# Some SCSI devices (e.g. CD jukebox) support multiple LUNs 373# Some SCSI devices (e.g. CD jukebox) support multiple LUNs
@@ -316,24 +401,20 @@ CONFIG_SCSI_SATA=y
316# CONFIG_SCSI_ATA_PIIX is not set 401# CONFIG_SCSI_ATA_PIIX is not set
317# CONFIG_SCSI_SATA_NV is not set 402# CONFIG_SCSI_SATA_NV is not set
318# CONFIG_SCSI_SATA_PROMISE is not set 403# CONFIG_SCSI_SATA_PROMISE is not set
404# CONFIG_SCSI_SATA_QSTOR is not set
319# CONFIG_SCSI_SATA_SX4 is not set 405# CONFIG_SCSI_SATA_SX4 is not set
320# CONFIG_SCSI_SATA_SIL is not set 406# CONFIG_SCSI_SATA_SIL is not set
321# CONFIG_SCSI_SATA_SIS is not set 407# CONFIG_SCSI_SATA_SIS is not set
322# CONFIG_SCSI_SATA_ULI is not set 408# CONFIG_SCSI_SATA_ULI is not set
323# CONFIG_SCSI_SATA_VIA is not set 409# CONFIG_SCSI_SATA_VIA is not set
324CONFIG_SCSI_SATA_VITESSE=y 410CONFIG_SCSI_SATA_VITESSE=y
325# CONFIG_SCSI_BUSLOGIC is not set
326# CONFIG_SCSI_DMX3191D is not set 411# CONFIG_SCSI_DMX3191D is not set
327# CONFIG_SCSI_EATA is not set
328# CONFIG_SCSI_EATA_PIO is not set
329# CONFIG_SCSI_FUTURE_DOMAIN is not set 412# CONFIG_SCSI_FUTURE_DOMAIN is not set
330# CONFIG_SCSI_GDTH is not set
331# CONFIG_SCSI_IPS is not set 413# CONFIG_SCSI_IPS is not set
332# CONFIG_SCSI_INITIO is not set 414# CONFIG_SCSI_INITIO is not set
333# CONFIG_SCSI_INIA100 is not set 415# CONFIG_SCSI_INIA100 is not set
334# CONFIG_SCSI_SYM53C8XX_2 is not set 416# CONFIG_SCSI_SYM53C8XX_2 is not set
335# CONFIG_SCSI_IPR is not set 417# CONFIG_SCSI_IPR is not set
336# CONFIG_SCSI_QLOGIC_ISP is not set
337# CONFIG_SCSI_QLOGIC_FC is not set 418# CONFIG_SCSI_QLOGIC_FC is not set
338CONFIG_SCSI_QLOGIC_1280=y 419CONFIG_SCSI_QLOGIC_1280=y
339# CONFIG_SCSI_QLOGIC_1280_1040 is not set 420# CONFIG_SCSI_QLOGIC_1280_1040 is not set
@@ -343,6 +424,8 @@ CONFIG_SCSI_QLA22XX=y
343CONFIG_SCSI_QLA2300=y 424CONFIG_SCSI_QLA2300=y
344CONFIG_SCSI_QLA2322=y 425CONFIG_SCSI_QLA2322=y
345# CONFIG_SCSI_QLA6312 is not set 426# CONFIG_SCSI_QLA6312 is not set
427# CONFIG_SCSI_QLA24XX is not set
428# CONFIG_SCSI_LPFC is not set
346# CONFIG_SCSI_DC395x is not set 429# CONFIG_SCSI_DC395x is not set
347# CONFIG_SCSI_DC390T is not set 430# CONFIG_SCSI_DC390T is not set
348# CONFIG_SCSI_DEBUG is not set 431# CONFIG_SCSI_DEBUG is not set
@@ -365,11 +448,15 @@ CONFIG_DM_CRYPT=m
365CONFIG_DM_SNAPSHOT=m 448CONFIG_DM_SNAPSHOT=m
366CONFIG_DM_MIRROR=m 449CONFIG_DM_MIRROR=m
367CONFIG_DM_ZERO=m 450CONFIG_DM_ZERO=m
451CONFIG_DM_MULTIPATH=m
452CONFIG_DM_MULTIPATH_EMC=m
368 453
369# 454#
370# Fusion MPT device support 455# Fusion MPT device support
371# 456#
372CONFIG_FUSION=y 457CONFIG_FUSION=y
458CONFIG_FUSION_SPI=y
459CONFIG_FUSION_FC=y
373CONFIG_FUSION_MAX_SGE=128 460CONFIG_FUSION_MAX_SGE=128
374CONFIG_FUSION_CTL=m 461CONFIG_FUSION_CTL=m
375 462
@@ -384,82 +471,13 @@ CONFIG_FUSION_CTL=m
384# CONFIG_I2O is not set 471# CONFIG_I2O is not set
385 472
386# 473#
387# Networking support 474# Network device support
388#
389CONFIG_NET=y
390
391#
392# Networking options
393#
394CONFIG_PACKET=y
395CONFIG_PACKET_MMAP=y
396CONFIG_NETLINK_DEV=y
397CONFIG_UNIX=y
398# CONFIG_NET_KEY is not set
399CONFIG_INET=y
400CONFIG_IP_MULTICAST=y
401# CONFIG_IP_ADVANCED_ROUTER is not set
402# CONFIG_IP_PNP is not set
403# CONFIG_NET_IPIP is not set
404# CONFIG_NET_IPGRE is not set
405# CONFIG_IP_MROUTE is not set
406# CONFIG_ARPD is not set
407CONFIG_SYN_COOKIES=y
408# CONFIG_INET_AH is not set
409# CONFIG_INET_ESP is not set
410# CONFIG_INET_IPCOMP is not set
411# CONFIG_INET_TUNNEL is not set
412CONFIG_IP_TCPDIAG=y
413# CONFIG_IP_TCPDIAG_IPV6 is not set
414CONFIG_IPV6=m
415# CONFIG_IPV6_PRIVACY is not set
416# CONFIG_INET6_AH is not set
417# CONFIG_INET6_ESP is not set
418# CONFIG_INET6_IPCOMP is not set
419# CONFIG_INET6_TUNNEL is not set
420# CONFIG_IPV6_TUNNEL is not set
421# CONFIG_NETFILTER is not set
422
423#
424# SCTP Configuration (EXPERIMENTAL)
425#
426# CONFIG_IP_SCTP is not set
427# CONFIG_ATM is not set
428# CONFIG_BRIDGE is not set
429# CONFIG_VLAN_8021Q is not set
430# CONFIG_DECNET is not set
431# CONFIG_LLC2 is not set
432# CONFIG_IPX is not set
433# CONFIG_ATALK is not set
434# CONFIG_X25 is not set
435# CONFIG_LAPB is not set
436# CONFIG_NET_DIVERT is not set
437# CONFIG_ECONET is not set
438# CONFIG_WAN_ROUTER is not set
439
440#
441# QoS and/or fair queueing
442#
443# CONFIG_NET_SCHED is not set
444# CONFIG_NET_CLS_ROUTE is not set
445
446#
447# Network testing
448# 475#
449# CONFIG_NET_PKTGEN is not set
450CONFIG_NETPOLL=y
451# CONFIG_NETPOLL_RX is not set
452# CONFIG_NETPOLL_TRAP is not set
453CONFIG_NET_POLL_CONTROLLER=y
454# CONFIG_HAMRADIO is not set
455# CONFIG_IRDA is not set
456# CONFIG_BT is not set
457CONFIG_NETDEVICES=y 476CONFIG_NETDEVICES=y
458# CONFIG_DUMMY is not set 477# CONFIG_DUMMY is not set
459# CONFIG_BONDING is not set 478# CONFIG_BONDING is not set
460# CONFIG_EQUALIZER is not set 479# CONFIG_EQUALIZER is not set
461# CONFIG_TUN is not set 480# CONFIG_TUN is not set
462# CONFIG_ETHERTAP is not set
463 481
464# 482#
465# ARCnet devices 483# ARCnet devices
@@ -481,8 +499,10 @@ CONFIG_NETDEVICES=y
481# CONFIG_HAMACHI is not set 499# CONFIG_HAMACHI is not set
482# CONFIG_YELLOWFIN is not set 500# CONFIG_YELLOWFIN is not set
483# CONFIG_R8169 is not set 501# CONFIG_R8169 is not set
502# CONFIG_SKGE is not set
484# CONFIG_SK98LIN is not set 503# CONFIG_SK98LIN is not set
485CONFIG_TIGON3=y 504CONFIG_TIGON3=y
505# CONFIG_BNX2 is not set
486 506
487# 507#
488# Ethernet (10000 Mbit) 508# Ethernet (10000 Mbit)
@@ -513,6 +533,10 @@ CONFIG_S2IO=m
513# CONFIG_NET_FC is not set 533# CONFIG_NET_FC is not set
514# CONFIG_SHAPER is not set 534# CONFIG_SHAPER is not set
515CONFIG_NETCONSOLE=y 535CONFIG_NETCONSOLE=y
536CONFIG_NETPOLL=y
537# CONFIG_NETPOLL_RX is not set
538# CONFIG_NETPOLL_TRAP is not set
539CONFIG_NET_POLL_CONTROLLER=y
516 540
517# 541#
518# ISDN subsystem 542# ISDN subsystem
@@ -542,14 +566,6 @@ CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768
542# CONFIG_INPUT_EVBUG is not set 566# CONFIG_INPUT_EVBUG is not set
543 567
544# 568#
545# Input I/O drivers
546#
547# CONFIG_GAMEPORT is not set
548CONFIG_SOUND_GAMEPORT=y
549# CONFIG_SERIO is not set
550# CONFIG_SERIO_I8042 is not set
551
552#
553# Input Device Drivers 569# Input Device Drivers
554# 570#
555# CONFIG_INPUT_KEYBOARD is not set 571# CONFIG_INPUT_KEYBOARD is not set
@@ -559,6 +575,12 @@ CONFIG_SOUND_GAMEPORT=y
559# CONFIG_INPUT_MISC is not set 575# CONFIG_INPUT_MISC is not set
560 576
561# 577#
578# Hardware I/O ports
579#
580# CONFIG_SERIO is not set
581# CONFIG_GAMEPORT is not set
582
583#
562# Character devices 584# Character devices
563# 585#
564CONFIG_VT=y 586CONFIG_VT=y
@@ -569,9 +591,10 @@ CONFIG_SERIAL_NONSTANDARD=y
569# CONFIG_CYCLADES is not set 591# CONFIG_CYCLADES is not set
570# CONFIG_MOXA_SMARTIO is not set 592# CONFIG_MOXA_SMARTIO is not set
571# CONFIG_ISI is not set 593# CONFIG_ISI is not set
572# CONFIG_SYNCLINK is not set
573# CONFIG_SYNCLINKMP is not set 594# CONFIG_SYNCLINKMP is not set
574# CONFIG_N_HDLC is not set 595# CONFIG_N_HDLC is not set
596# CONFIG_SPECIALIX is not set
597# CONFIG_SX is not set
575# CONFIG_STALDRV is not set 598# CONFIG_STALDRV is not set
576CONFIG_SGI_SNSC=y 599CONFIG_SGI_SNSC=y
577CONFIG_SGI_TIOCX=y 600CONFIG_SGI_TIOCX=y
@@ -588,6 +611,7 @@ CONFIG_SGI_MBCS=m
588CONFIG_SERIAL_CORE=y 611CONFIG_SERIAL_CORE=y
589CONFIG_SERIAL_CORE_CONSOLE=y 612CONFIG_SERIAL_CORE_CONSOLE=y
590CONFIG_SERIAL_SGI_L1_CONSOLE=y 613CONFIG_SERIAL_SGI_L1_CONSOLE=y
614# CONFIG_SERIAL_JSM is not set
591CONFIG_SERIAL_SGI_IOC4=y 615CONFIG_SERIAL_SGI_IOC4=y
592CONFIG_UNIX98_PTYS=y 616CONFIG_UNIX98_PTYS=y
593CONFIG_LEGACY_PTYS=y 617CONFIG_LEGACY_PTYS=y
@@ -616,12 +640,19 @@ CONFIG_EFI_RTC=y
616CONFIG_RAW_DRIVER=m 640CONFIG_RAW_DRIVER=m
617# CONFIG_HPET is not set 641# CONFIG_HPET is not set
618CONFIG_MAX_RAW_DEVS=256 642CONFIG_MAX_RAW_DEVS=256
643# CONFIG_HANGCHECK_TIMER is not set
619CONFIG_MMTIMER=y 644CONFIG_MMTIMER=y
620 645
621# 646#
647# TPM devices
648#
649# CONFIG_TCG_TPM is not set
650
651#
622# I2C support 652# I2C support
623# 653#
624# CONFIG_I2C is not set 654# CONFIG_I2C is not set
655# CONFIG_I2C_SENSOR is not set
625 656
626# 657#
627# Dallas's 1-wire bus 658# Dallas's 1-wire bus
@@ -629,6 +660,11 @@ CONFIG_MMTIMER=y
629# CONFIG_W1 is not set 660# CONFIG_W1 is not set
630 661
631# 662#
663# Hardware Monitoring support
664#
665# CONFIG_HWMON is not set
666
667#
632# Misc devices 668# Misc devices
633# 669#
634 670
@@ -661,6 +697,8 @@ CONFIG_DUMMY_CONSOLE=y
661# 697#
662# USB support 698# USB support
663# 699#
700CONFIG_USB_ARCH_HAS_HCD=y
701CONFIG_USB_ARCH_HAS_OHCI=y
664CONFIG_USB=m 702CONFIG_USB=m
665# CONFIG_USB_DEBUG is not set 703# CONFIG_USB_DEBUG is not set
666 704
@@ -670,9 +708,8 @@ CONFIG_USB=m
670# CONFIG_USB_DEVICEFS is not set 708# CONFIG_USB_DEVICEFS is not set
671# CONFIG_USB_BANDWIDTH is not set 709# CONFIG_USB_BANDWIDTH is not set
672# CONFIG_USB_DYNAMIC_MINORS is not set 710# CONFIG_USB_DYNAMIC_MINORS is not set
711# CONFIG_USB_SUSPEND is not set
673# CONFIG_USB_OTG is not set 712# CONFIG_USB_OTG is not set
674CONFIG_USB_ARCH_HAS_HCD=y
675CONFIG_USB_ARCH_HAS_OHCI=y
676 713
677# 714#
678# USB Host Controller Drivers 715# USB Host Controller Drivers
@@ -680,7 +717,10 @@ CONFIG_USB_ARCH_HAS_OHCI=y
680CONFIG_USB_EHCI_HCD=m 717CONFIG_USB_EHCI_HCD=m
681# CONFIG_USB_EHCI_SPLIT_ISO is not set 718# CONFIG_USB_EHCI_SPLIT_ISO is not set
682# CONFIG_USB_EHCI_ROOT_HUB_TT is not set 719# CONFIG_USB_EHCI_ROOT_HUB_TT is not set
720# CONFIG_USB_ISP116X_HCD is not set
683CONFIG_USB_OHCI_HCD=m 721CONFIG_USB_OHCI_HCD=m
722# CONFIG_USB_OHCI_BIG_ENDIAN is not set
723CONFIG_USB_OHCI_LITTLE_ENDIAN=y
684CONFIG_USB_UHCI_HCD=m 724CONFIG_USB_UHCI_HCD=m
685# CONFIG_USB_SL811_HCD is not set 725# CONFIG_USB_SL811_HCD is not set
686 726
@@ -711,12 +751,15 @@ CONFIG_USB_HIDINPUT=y
711# CONFIG_USB_MOUSE is not set 751# CONFIG_USB_MOUSE is not set
712# CONFIG_USB_AIPTEK is not set 752# CONFIG_USB_AIPTEK is not set
713# CONFIG_USB_WACOM is not set 753# CONFIG_USB_WACOM is not set
754# CONFIG_USB_ACECAD is not set
714# CONFIG_USB_KBTAB is not set 755# CONFIG_USB_KBTAB is not set
715# CONFIG_USB_POWERMATE is not set 756# CONFIG_USB_POWERMATE is not set
716# CONFIG_USB_MTOUCH is not set 757# CONFIG_USB_MTOUCH is not set
758# CONFIG_USB_ITMTOUCH is not set
717# CONFIG_USB_EGALAX is not set 759# CONFIG_USB_EGALAX is not set
718# CONFIG_USB_XPAD is not set 760# CONFIG_USB_XPAD is not set
719# CONFIG_USB_ATI_REMOTE is not set 761# CONFIG_USB_ATI_REMOTE is not set
762# CONFIG_USB_KEYSPAN_REMOTE is not set
720 763
721# 764#
722# USB Imaging devices 765# USB Imaging devices
@@ -741,6 +784,7 @@ CONFIG_USB_HIDINPUT=y
741# CONFIG_USB_PEGASUS is not set 784# CONFIG_USB_PEGASUS is not set
742# CONFIG_USB_RTL8150 is not set 785# CONFIG_USB_RTL8150 is not set
743# CONFIG_USB_USBNET is not set 786# CONFIG_USB_USBNET is not set
787CONFIG_USB_MON=y
744 788
745# 789#
746# USB port drivers 790# USB port drivers
@@ -764,9 +808,12 @@ CONFIG_USB_HIDINPUT=y
764# CONFIG_USB_CYTHERM is not set 808# CONFIG_USB_CYTHERM is not set
765# CONFIG_USB_PHIDGETKIT is not set 809# CONFIG_USB_PHIDGETKIT is not set
766# CONFIG_USB_PHIDGETSERVO is not set 810# CONFIG_USB_PHIDGETSERVO is not set
811# CONFIG_USB_IDMOUSE is not set
812# CONFIG_USB_SISUSBVGA is not set
813# CONFIG_USB_LD is not set
767 814
768# 815#
769# USB ATM/DSL drivers 816# USB DSL modem support
770# 817#
771 818
772# 819#
@@ -783,6 +830,7 @@ CONFIG_USB_HIDINPUT=y
783# InfiniBand support 830# InfiniBand support
784# 831#
785CONFIG_INFINIBAND=m 832CONFIG_INFINIBAND=m
833CONFIG_INFINIBAND_USER_VERBS=m
786CONFIG_INFINIBAND_MTHCA=m 834CONFIG_INFINIBAND_MTHCA=m
787# CONFIG_INFINIBAND_MTHCA_DEBUG is not set 835# CONFIG_INFINIBAND_MTHCA_DEBUG is not set
788CONFIG_INFINIBAND_IPOIB=m 836CONFIG_INFINIBAND_IPOIB=m
@@ -800,6 +848,7 @@ CONFIG_EXT2_FS=y
800CONFIG_EXT2_FS_XATTR=y 848CONFIG_EXT2_FS_XATTR=y
801CONFIG_EXT2_FS_POSIX_ACL=y 849CONFIG_EXT2_FS_POSIX_ACL=y
802CONFIG_EXT2_FS_SECURITY=y 850CONFIG_EXT2_FS_SECURITY=y
851# CONFIG_EXT2_FS_XIP is not set
803CONFIG_EXT3_FS=y 852CONFIG_EXT3_FS=y
804CONFIG_EXT3_FS_XATTR=y 853CONFIG_EXT3_FS_XATTR=y
805CONFIG_EXT3_FS_POSIX_ACL=y 854CONFIG_EXT3_FS_POSIX_ACL=y
@@ -815,13 +864,19 @@ CONFIG_REISERFS_FS_POSIX_ACL=y
815CONFIG_REISERFS_FS_SECURITY=y 864CONFIG_REISERFS_FS_SECURITY=y
816# CONFIG_JFS_FS is not set 865# CONFIG_JFS_FS is not set
817CONFIG_FS_POSIX_ACL=y 866CONFIG_FS_POSIX_ACL=y
867
868#
869# XFS support
870#
818CONFIG_XFS_FS=y 871CONFIG_XFS_FS=y
872CONFIG_XFS_EXPORT=y
819CONFIG_XFS_RT=y 873CONFIG_XFS_RT=y
820CONFIG_XFS_QUOTA=y 874CONFIG_XFS_QUOTA=y
821# CONFIG_XFS_SECURITY is not set 875# CONFIG_XFS_SECURITY is not set
822CONFIG_XFS_POSIX_ACL=y 876CONFIG_XFS_POSIX_ACL=y
823# CONFIG_MINIX_FS is not set 877# CONFIG_MINIX_FS is not set
824# CONFIG_ROMFS_FS is not set 878# CONFIG_ROMFS_FS is not set
879CONFIG_INOTIFY=y
825CONFIG_QUOTA=y 880CONFIG_QUOTA=y
826# CONFIG_QFMT_V1 is not set 881# CONFIG_QFMT_V1 is not set
827# CONFIG_QFMT_V2 is not set 882# CONFIG_QFMT_V2 is not set
@@ -855,7 +910,6 @@ CONFIG_FAT_DEFAULT_IOCHARSET="iso8859-1"
855CONFIG_PROC_FS=y 910CONFIG_PROC_FS=y
856CONFIG_PROC_KCORE=y 911CONFIG_PROC_KCORE=y
857CONFIG_SYSFS=y 912CONFIG_SYSFS=y
858# CONFIG_DEVFS_FS is not set
859# CONFIG_DEVPTS_FS_XATTR is not set 913# CONFIG_DEVPTS_FS_XATTR is not set
860CONFIG_TMPFS=y 914CONFIG_TMPFS=y
861CONFIG_TMPFS_XATTR=y 915CONFIG_TMPFS_XATTR=y
@@ -886,15 +940,18 @@ CONFIG_RAMFS=y
886# 940#
887CONFIG_NFS_FS=m 941CONFIG_NFS_FS=m
888CONFIG_NFS_V3=y 942CONFIG_NFS_V3=y
943# CONFIG_NFS_V3_ACL is not set
889CONFIG_NFS_V4=y 944CONFIG_NFS_V4=y
890CONFIG_NFS_DIRECTIO=y 945CONFIG_NFS_DIRECTIO=y
891CONFIG_NFSD=m 946CONFIG_NFSD=m
892CONFIG_NFSD_V3=y 947CONFIG_NFSD_V3=y
948# CONFIG_NFSD_V3_ACL is not set
893CONFIG_NFSD_V4=y 949CONFIG_NFSD_V4=y
894CONFIG_NFSD_TCP=y 950CONFIG_NFSD_TCP=y
895CONFIG_LOCKD=m 951CONFIG_LOCKD=m
896CONFIG_LOCKD_V4=y 952CONFIG_LOCKD_V4=y
897CONFIG_EXPORTFS=m 953CONFIG_EXPORTFS=y
954CONFIG_NFS_COMMON=y
898CONFIG_SUNRPC=m 955CONFIG_SUNRPC=m
899CONFIG_SUNRPC_GSS=m 956CONFIG_SUNRPC_GSS=m
900CONFIG_RPCSEC_GSS_KRB5=m 957CONFIG_RPCSEC_GSS_KRB5=m
@@ -981,6 +1038,9 @@ CONFIG_CRC32=y
981# CONFIG_LIBCRC32C is not set 1038# CONFIG_LIBCRC32C is not set
982CONFIG_ZLIB_INFLATE=m 1039CONFIG_ZLIB_INFLATE=m
983CONFIG_ZLIB_DEFLATE=m 1040CONFIG_ZLIB_DEFLATE=m
1041CONFIG_GENERIC_ALLOCATOR=y
1042CONFIG_GENERIC_HARDIRQS=y
1043CONFIG_GENERIC_IRQ_PROBE=y
984 1044
985# 1045#
986# Profiling support 1046# Profiling support
@@ -990,15 +1050,19 @@ CONFIG_ZLIB_DEFLATE=m
990# 1050#
991# Kernel hacking 1051# Kernel hacking
992# 1052#
1053# CONFIG_PRINTK_TIME is not set
993CONFIG_DEBUG_KERNEL=y 1054CONFIG_DEBUG_KERNEL=y
994CONFIG_MAGIC_SYSRQ=y 1055CONFIG_MAGIC_SYSRQ=y
1056CONFIG_LOG_BUF_SHIFT=20
995# CONFIG_SCHEDSTATS is not set 1057# CONFIG_SCHEDSTATS is not set
996# CONFIG_DEBUG_SLAB is not set 1058# CONFIG_DEBUG_SLAB is not set
1059CONFIG_DEBUG_PREEMPT=y
997# CONFIG_DEBUG_SPINLOCK is not set 1060# CONFIG_DEBUG_SPINLOCK is not set
998# CONFIG_DEBUG_SPINLOCK_SLEEP is not set 1061# CONFIG_DEBUG_SPINLOCK_SLEEP is not set
999# CONFIG_DEBUG_KOBJECT is not set 1062# CONFIG_DEBUG_KOBJECT is not set
1000CONFIG_DEBUG_INFO=y 1063CONFIG_DEBUG_INFO=y
1001# CONFIG_DEBUG_FS is not set 1064# CONFIG_DEBUG_FS is not set
1065# CONFIG_KPROBES is not set
1002CONFIG_IA64_GRANULE_16MB=y 1066CONFIG_IA64_GRANULE_16MB=y
1003# CONFIG_IA64_GRANULE_64MB is not set 1067# CONFIG_IA64_GRANULE_64MB is not set
1004# CONFIG_IA64_PRINT_HAZARDS is not set 1068# CONFIG_IA64_PRINT_HAZARDS is not set
@@ -1020,11 +1084,12 @@ CONFIG_CRYPTO=y
1020CONFIG_CRYPTO_HMAC=y 1084CONFIG_CRYPTO_HMAC=y
1021# CONFIG_CRYPTO_NULL is not set 1085# CONFIG_CRYPTO_NULL is not set
1022# CONFIG_CRYPTO_MD4 is not set 1086# CONFIG_CRYPTO_MD4 is not set
1023CONFIG_CRYPTO_MD5=m 1087CONFIG_CRYPTO_MD5=y
1024CONFIG_CRYPTO_SHA1=m 1088CONFIG_CRYPTO_SHA1=m
1025# CONFIG_CRYPTO_SHA256 is not set 1089# CONFIG_CRYPTO_SHA256 is not set
1026# CONFIG_CRYPTO_SHA512 is not set 1090# CONFIG_CRYPTO_SHA512 is not set
1027# CONFIG_CRYPTO_WP512 is not set 1091# CONFIG_CRYPTO_WP512 is not set
1092# CONFIG_CRYPTO_TGR192 is not set
1028CONFIG_CRYPTO_DES=m 1093CONFIG_CRYPTO_DES=m
1029# CONFIG_CRYPTO_BLOWFISH is not set 1094# CONFIG_CRYPTO_BLOWFISH is not set
1030# CONFIG_CRYPTO_TWOFISH is not set 1095# CONFIG_CRYPTO_TWOFISH is not set
diff --git a/arch/ia64/configs/tiger_defconfig b/arch/ia64/configs/tiger_defconfig
index 73454eee26f1..c853cfcd2d11 100644
--- a/arch/ia64/configs/tiger_defconfig
+++ b/arch/ia64/configs/tiger_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.13-rc1-20050629 3# Linux kernel version: 2.6.13-rc6-tiger-smp
4# Wed Jun 29 15:28:12 2005 4# Wed Aug 17 10:19:51 2005
5# 5#
6 6
7# 7#
@@ -132,6 +132,7 @@ CONFIG_ACPI_BOOT=y
132CONFIG_ACPI_INTERPRETER=y 132CONFIG_ACPI_INTERPRETER=y
133CONFIG_ACPI_BUTTON=m 133CONFIG_ACPI_BUTTON=m
134# CONFIG_ACPI_VIDEO is not set 134# CONFIG_ACPI_VIDEO is not set
135# CONFIG_ACPI_HOTKEY is not set
135CONFIG_ACPI_FAN=m 136CONFIG_ACPI_FAN=m
136CONFIG_ACPI_PROCESSOR=m 137CONFIG_ACPI_PROCESSOR=m
137# CONFIG_ACPI_HOTPLUG_CPU is not set 138# CONFIG_ACPI_HOTPLUG_CPU is not set
@@ -170,6 +171,66 @@ CONFIG_HOTPLUG_PCI_ACPI=m
170# CONFIG_PCCARD is not set 171# CONFIG_PCCARD is not set
171 172
172# 173#
174# Networking
175#
176CONFIG_NET=y
177
178#
179# Networking options
180#
181CONFIG_PACKET=y
182# CONFIG_PACKET_MMAP is not set
183CONFIG_UNIX=y
184# CONFIG_NET_KEY is not set
185CONFIG_INET=y
186CONFIG_IP_MULTICAST=y
187# CONFIG_IP_ADVANCED_ROUTER is not set
188CONFIG_IP_FIB_HASH=y
189# CONFIG_IP_PNP is not set
190# CONFIG_NET_IPIP is not set
191# CONFIG_NET_IPGRE is not set
192# CONFIG_IP_MROUTE is not set
193CONFIG_ARPD=y
194CONFIG_SYN_COOKIES=y
195# CONFIG_INET_AH is not set
196# CONFIG_INET_ESP is not set
197# CONFIG_INET_IPCOMP is not set
198# CONFIG_INET_TUNNEL is not set
199CONFIG_IP_TCPDIAG=y
200# CONFIG_IP_TCPDIAG_IPV6 is not set
201# CONFIG_TCP_CONG_ADVANCED is not set
202CONFIG_TCP_CONG_BIC=y
203# CONFIG_IPV6 is not set
204# CONFIG_NETFILTER is not set
205
206#
207# SCTP Configuration (EXPERIMENTAL)
208#
209# CONFIG_IP_SCTP is not set
210# CONFIG_ATM is not set
211# CONFIG_BRIDGE is not set
212# CONFIG_VLAN_8021Q is not set
213# CONFIG_DECNET is not set
214# CONFIG_LLC2 is not set
215# CONFIG_IPX is not set
216# CONFIG_ATALK is not set
217# CONFIG_X25 is not set
218# CONFIG_LAPB is not set
219# CONFIG_NET_DIVERT is not set
220# CONFIG_ECONET is not set
221# CONFIG_WAN_ROUTER is not set
222# CONFIG_NET_SCHED is not set
223# CONFIG_NET_CLS_ROUTE is not set
224
225#
226# Network testing
227#
228# CONFIG_NET_PKTGEN is not set
229# CONFIG_HAMRADIO is not set
230# CONFIG_IRDA is not set
231# CONFIG_BT is not set
232
233#
173# Device Drivers 234# Device Drivers
174# 235#
175 236
@@ -178,7 +239,7 @@ CONFIG_HOTPLUG_PCI_ACPI=m
178# 239#
179CONFIG_STANDALONE=y 240CONFIG_STANDALONE=y
180CONFIG_PREVENT_FIRMWARE_BUILD=y 241CONFIG_PREVENT_FIRMWARE_BUILD=y
181# CONFIG_FW_LOADER is not set 242CONFIG_FW_LOADER=m
182# CONFIG_DEBUG_DRIVER is not set 243# CONFIG_DEBUG_DRIVER is not set
183 244
184# 245#
@@ -348,6 +409,7 @@ CONFIG_SCSI_QLA22XX=m
348CONFIG_SCSI_QLA2300=m 409CONFIG_SCSI_QLA2300=m
349CONFIG_SCSI_QLA2322=m 410CONFIG_SCSI_QLA2322=m
350# CONFIG_SCSI_QLA6312 is not set 411# CONFIG_SCSI_QLA6312 is not set
412# CONFIG_SCSI_QLA24XX is not set
351# CONFIG_SCSI_LPFC is not set 413# CONFIG_SCSI_LPFC is not set
352# CONFIG_SCSI_DC395x is not set 414# CONFIG_SCSI_DC395x is not set
353# CONFIG_SCSI_DC390T is not set 415# CONFIG_SCSI_DC390T is not set
@@ -393,72 +455,8 @@ CONFIG_FUSION_CTL=y
393# CONFIG_I2O is not set 455# CONFIG_I2O is not set
394 456
395# 457#
396# Networking support 458# Network device support
397#
398CONFIG_NET=y
399
400#
401# Networking options
402# 459#
403CONFIG_PACKET=y
404# CONFIG_PACKET_MMAP is not set
405CONFIG_UNIX=y
406# CONFIG_NET_KEY is not set
407CONFIG_INET=y
408CONFIG_IP_MULTICAST=y
409# CONFIG_IP_ADVANCED_ROUTER is not set
410CONFIG_IP_FIB_HASH=y
411# CONFIG_IP_PNP is not set
412# CONFIG_NET_IPIP is not set
413# CONFIG_NET_IPGRE is not set
414# CONFIG_IP_MROUTE is not set
415CONFIG_ARPD=y
416CONFIG_SYN_COOKIES=y
417# CONFIG_INET_AH is not set
418# CONFIG_INET_ESP is not set
419# CONFIG_INET_IPCOMP is not set
420# CONFIG_INET_TUNNEL is not set
421CONFIG_IP_TCPDIAG=y
422# CONFIG_IP_TCPDIAG_IPV6 is not set
423# CONFIG_TCP_CONG_ADVANCED is not set
424CONFIG_TCP_CONG_BIC=y
425# CONFIG_IPV6 is not set
426# CONFIG_NETFILTER is not set
427
428#
429# SCTP Configuration (EXPERIMENTAL)
430#
431# CONFIG_IP_SCTP is not set
432# CONFIG_ATM is not set
433# CONFIG_BRIDGE is not set
434# CONFIG_VLAN_8021Q is not set
435# CONFIG_DECNET is not set
436# CONFIG_LLC2 is not set
437# CONFIG_IPX is not set
438# CONFIG_ATALK is not set
439# CONFIG_X25 is not set
440# CONFIG_LAPB is not set
441# CONFIG_NET_DIVERT is not set
442# CONFIG_ECONET is not set
443# CONFIG_WAN_ROUTER is not set
444
445#
446# QoS and/or fair queueing
447#
448# CONFIG_NET_SCHED is not set
449# CONFIG_NET_CLS_ROUTE is not set
450
451#
452# Network testing
453#
454# CONFIG_NET_PKTGEN is not set
455CONFIG_NETPOLL=y
456# CONFIG_NETPOLL_RX is not set
457# CONFIG_NETPOLL_TRAP is not set
458CONFIG_NET_POLL_CONTROLLER=y
459# CONFIG_HAMRADIO is not set
460# CONFIG_IRDA is not set
461# CONFIG_BT is not set
462CONFIG_NETDEVICES=y 460CONFIG_NETDEVICES=y
463CONFIG_DUMMY=m 461CONFIG_DUMMY=m
464# CONFIG_BONDING is not set 462# CONFIG_BONDING is not set
@@ -555,6 +553,10 @@ CONFIG_TIGON3=y
555# CONFIG_NET_FC is not set 553# CONFIG_NET_FC is not set
556# CONFIG_SHAPER is not set 554# CONFIG_SHAPER is not set
557CONFIG_NETCONSOLE=y 555CONFIG_NETCONSOLE=y
556CONFIG_NETPOLL=y
557# CONFIG_NETPOLL_RX is not set
558# CONFIG_NETPOLL_TRAP is not set
559CONFIG_NET_POLL_CONTROLLER=y
558 560
559# 561#
560# ISDN subsystem 562# ISDN subsystem
@@ -680,6 +682,7 @@ CONFIG_DRM_R128=m
680CONFIG_DRM_RADEON=m 682CONFIG_DRM_RADEON=m
681CONFIG_DRM_MGA=m 683CONFIG_DRM_MGA=m
682CONFIG_DRM_SIS=m 684CONFIG_DRM_SIS=m
685# CONFIG_DRM_VIA is not set
683CONFIG_RAW_DRIVER=m 686CONFIG_RAW_DRIVER=m
684CONFIG_HPET=y 687CONFIG_HPET=y
685# CONFIG_HPET_RTC_IRQ is not set 688# CONFIG_HPET_RTC_IRQ is not set
@@ -696,6 +699,7 @@ CONFIG_MAX_RAW_DEVS=256
696# I2C support 699# I2C support
697# 700#
698# CONFIG_I2C is not set 701# CONFIG_I2C is not set
702# CONFIG_I2C_SENSOR is not set
699 703
700# 704#
701# Dallas's 1-wire bus 705# Dallas's 1-wire bus
@@ -703,6 +707,12 @@ CONFIG_MAX_RAW_DEVS=256
703# CONFIG_W1 is not set 707# CONFIG_W1 is not set
704 708
705# 709#
710# Hardware Monitoring support
711#
712CONFIG_HWMON=y
713# CONFIG_HWMON_DEBUG_CHIP is not set
714
715#
706# Misc devices 716# Misc devices
707# 717#
708 718
@@ -800,6 +810,7 @@ CONFIG_USB_HIDINPUT=y
800# CONFIG_USB_EGALAX is not set 810# CONFIG_USB_EGALAX is not set
801# CONFIG_USB_XPAD is not set 811# CONFIG_USB_XPAD is not set
802# CONFIG_USB_ATI_REMOTE is not set 812# CONFIG_USB_ATI_REMOTE is not set
813# CONFIG_USB_KEYSPAN_REMOTE is not set
803 814
804# 815#
805# USB Imaging devices 816# USB Imaging devices
@@ -850,6 +861,7 @@ CONFIG_USB_HIDINPUT=y
850# CONFIG_USB_PHIDGETSERVO is not set 861# CONFIG_USB_PHIDGETSERVO is not set
851# CONFIG_USB_IDMOUSE is not set 862# CONFIG_USB_IDMOUSE is not set
852# CONFIG_USB_SISUSBVGA is not set 863# CONFIG_USB_SISUSBVGA is not set
864# CONFIG_USB_LD is not set
853# CONFIG_USB_TEST is not set 865# CONFIG_USB_TEST is not set
854 866
855# 867#
@@ -910,6 +922,7 @@ CONFIG_XFS_EXPORT=y
910# CONFIG_XFS_POSIX_ACL is not set 922# CONFIG_XFS_POSIX_ACL is not set
911# CONFIG_MINIX_FS is not set 923# CONFIG_MINIX_FS is not set
912# CONFIG_ROMFS_FS is not set 924# CONFIG_ROMFS_FS is not set
925CONFIG_INOTIFY=y
913# CONFIG_QUOTA is not set 926# CONFIG_QUOTA is not set
914CONFIG_DNOTIFY=y 927CONFIG_DNOTIFY=y
915CONFIG_AUTOFS_FS=y 928CONFIG_AUTOFS_FS=y
diff --git a/arch/ia64/configs/zx1_defconfig b/arch/ia64/configs/zx1_defconfig
index b7755e4436d2..88e8867fa8e8 100644
--- a/arch/ia64/configs/zx1_defconfig
+++ b/arch/ia64/configs/zx1_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.13-rc1-20050629 3# Linux kernel version: 2.6.13-rc6
4# Wed Jun 29 15:31:11 2005 4# Wed Aug 17 10:02:43 2005
5# 5#
6 6
7# 7#
@@ -132,6 +132,7 @@ CONFIG_ACPI_BOOT=y
132CONFIG_ACPI_INTERPRETER=y 132CONFIG_ACPI_INTERPRETER=y
133CONFIG_ACPI_BUTTON=y 133CONFIG_ACPI_BUTTON=y
134CONFIG_ACPI_VIDEO=m 134CONFIG_ACPI_VIDEO=m
135CONFIG_ACPI_HOTKEY=m
135CONFIG_ACPI_FAN=y 136CONFIG_ACPI_FAN=y
136CONFIG_ACPI_PROCESSOR=y 137CONFIG_ACPI_PROCESSOR=y
137CONFIG_ACPI_THERMAL=y 138CONFIG_ACPI_THERMAL=y
@@ -169,6 +170,83 @@ CONFIG_HOTPLUG_PCI_ACPI=y
169# CONFIG_PCCARD is not set 170# CONFIG_PCCARD is not set
170 171
171# 172#
173# Networking
174#
175CONFIG_NET=y
176
177#
178# Networking options
179#
180CONFIG_PACKET=y
181# CONFIG_PACKET_MMAP is not set
182CONFIG_UNIX=y
183# CONFIG_NET_KEY is not set
184CONFIG_INET=y
185CONFIG_IP_MULTICAST=y
186# CONFIG_IP_ADVANCED_ROUTER is not set
187CONFIG_IP_FIB_HASH=y
188# CONFIG_IP_PNP is not set
189# CONFIG_NET_IPIP is not set
190# CONFIG_NET_IPGRE is not set
191# CONFIG_IP_MROUTE is not set
192# CONFIG_ARPD is not set
193# CONFIG_SYN_COOKIES is not set
194# CONFIG_INET_AH is not set
195# CONFIG_INET_ESP is not set
196# CONFIG_INET_IPCOMP is not set
197# CONFIG_INET_TUNNEL is not set
198# CONFIG_IP_TCPDIAG is not set
199# CONFIG_IP_TCPDIAG_IPV6 is not set
200# CONFIG_TCP_CONG_ADVANCED is not set
201CONFIG_TCP_CONG_BIC=y
202
203#
204# IP: Virtual Server Configuration
205#
206# CONFIG_IP_VS is not set
207# CONFIG_IPV6 is not set
208CONFIG_NETFILTER=y
209# CONFIG_NETFILTER_DEBUG is not set
210
211#
212# IP: Netfilter Configuration
213#
214# CONFIG_IP_NF_CONNTRACK is not set
215# CONFIG_IP_NF_CONNTRACK_MARK is not set
216# CONFIG_IP_NF_QUEUE is not set
217# CONFIG_IP_NF_IPTABLES is not set
218CONFIG_IP_NF_ARPTABLES=y
219# CONFIG_IP_NF_ARPFILTER is not set
220# CONFIG_IP_NF_ARP_MANGLE is not set
221
222#
223# SCTP Configuration (EXPERIMENTAL)
224#
225# CONFIG_IP_SCTP is not set
226# CONFIG_ATM is not set
227# CONFIG_BRIDGE is not set
228# CONFIG_VLAN_8021Q is not set
229# CONFIG_DECNET is not set
230# CONFIG_LLC2 is not set
231# CONFIG_IPX is not set
232# CONFIG_ATALK is not set
233# CONFIG_X25 is not set
234# CONFIG_LAPB is not set
235# CONFIG_NET_DIVERT is not set
236# CONFIG_ECONET is not set
237# CONFIG_WAN_ROUTER is not set
238# CONFIG_NET_SCHED is not set
239# CONFIG_NET_CLS_ROUTE is not set
240
241#
242# Network testing
243#
244# CONFIG_NET_PKTGEN is not set
245# CONFIG_HAMRADIO is not set
246# CONFIG_IRDA is not set
247# CONFIG_BT is not set
248
249#
172# Device Drivers 250# Device Drivers
173# 251#
174 252
@@ -349,6 +427,7 @@ CONFIG_SCSI_QLA2XXX=y
349# CONFIG_SCSI_QLA2300 is not set 427# CONFIG_SCSI_QLA2300 is not set
350# CONFIG_SCSI_QLA2322 is not set 428# CONFIG_SCSI_QLA2322 is not set
351# CONFIG_SCSI_QLA6312 is not set 429# CONFIG_SCSI_QLA6312 is not set
430# CONFIG_SCSI_QLA24XX is not set
352# CONFIG_SCSI_LPFC is not set 431# CONFIG_SCSI_LPFC is not set
353# CONFIG_SCSI_DC395x is not set 432# CONFIG_SCSI_DC395x is not set
354# CONFIG_SCSI_DC390T is not set 433# CONFIG_SCSI_DC390T is not set
@@ -362,9 +441,11 @@ CONFIG_SCSI_QLA2XXX=y
362# 441#
363# Fusion MPT device support 442# Fusion MPT device support
364# 443#
365# CONFIG_FUSION is not set 444CONFIG_FUSION=y
366# CONFIG_FUSION_SPI is not set 445CONFIG_FUSION_SPI=y
367# CONFIG_FUSION_FC is not set 446CONFIG_FUSION_FC=y
447CONFIG_FUSION_MAX_SGE=128
448CONFIG_FUSION_CTL=m
368 449
369# 450#
370# IEEE 1394 (FireWire) support 451# IEEE 1394 (FireWire) support
@@ -377,87 +458,8 @@ CONFIG_SCSI_QLA2XXX=y
377# CONFIG_I2O is not set 458# CONFIG_I2O is not set
378 459
379# 460#
380# Networking support 461# Network device support
381#
382CONFIG_NET=y
383
384#
385# Networking options
386#
387CONFIG_PACKET=y
388# CONFIG_PACKET_MMAP is not set
389CONFIG_UNIX=y
390# CONFIG_NET_KEY is not set
391CONFIG_INET=y
392CONFIG_IP_MULTICAST=y
393# CONFIG_IP_ADVANCED_ROUTER is not set
394CONFIG_IP_FIB_HASH=y
395# CONFIG_IP_PNP is not set
396# CONFIG_NET_IPIP is not set
397# CONFIG_NET_IPGRE is not set
398# CONFIG_IP_MROUTE is not set
399# CONFIG_ARPD is not set
400# CONFIG_SYN_COOKIES is not set
401# CONFIG_INET_AH is not set
402# CONFIG_INET_ESP is not set
403# CONFIG_INET_IPCOMP is not set
404# CONFIG_INET_TUNNEL is not set
405# CONFIG_IP_TCPDIAG is not set
406# CONFIG_IP_TCPDIAG_IPV6 is not set
407# CONFIG_TCP_CONG_ADVANCED is not set
408CONFIG_TCP_CONG_BIC=y
409
410#
411# IP: Virtual Server Configuration
412#
413# CONFIG_IP_VS is not set
414# CONFIG_IPV6 is not set
415CONFIG_NETFILTER=y
416# CONFIG_NETFILTER_DEBUG is not set
417
418#
419# IP: Netfilter Configuration
420# 462#
421# CONFIG_IP_NF_CONNTRACK is not set
422# CONFIG_IP_NF_CONNTRACK_MARK is not set
423# CONFIG_IP_NF_QUEUE is not set
424# CONFIG_IP_NF_IPTABLES is not set
425CONFIG_IP_NF_ARPTABLES=y
426# CONFIG_IP_NF_ARPFILTER is not set
427# CONFIG_IP_NF_ARP_MANGLE is not set
428
429#
430# SCTP Configuration (EXPERIMENTAL)
431#
432# CONFIG_IP_SCTP is not set
433# CONFIG_ATM is not set
434# CONFIG_BRIDGE is not set
435# CONFIG_VLAN_8021Q is not set
436# CONFIG_DECNET is not set
437# CONFIG_LLC2 is not set
438# CONFIG_IPX is not set
439# CONFIG_ATALK is not set
440# CONFIG_X25 is not set
441# CONFIG_LAPB is not set
442# CONFIG_NET_DIVERT is not set
443# CONFIG_ECONET is not set
444# CONFIG_WAN_ROUTER is not set
445
446#
447# QoS and/or fair queueing
448#
449# CONFIG_NET_SCHED is not set
450# CONFIG_NET_CLS_ROUTE is not set
451
452#
453# Network testing
454#
455# CONFIG_NET_PKTGEN is not set
456# CONFIG_NETPOLL is not set
457# CONFIG_NET_POLL_CONTROLLER is not set
458# CONFIG_HAMRADIO is not set
459# CONFIG_IRDA is not set
460# CONFIG_BT is not set
461CONFIG_NETDEVICES=y 463CONFIG_NETDEVICES=y
462CONFIG_DUMMY=y 464CONFIG_DUMMY=y
463# CONFIG_BONDING is not set 465# CONFIG_BONDING is not set
@@ -555,6 +557,8 @@ CONFIG_TIGON3=y
555# CONFIG_NET_FC is not set 557# CONFIG_NET_FC is not set
556# CONFIG_SHAPER is not set 558# CONFIG_SHAPER is not set
557# CONFIG_NETCONSOLE is not set 559# CONFIG_NETCONSOLE is not set
560# CONFIG_NETPOLL is not set
561# CONFIG_NET_POLL_CONTROLLER is not set
558 562
559# 563#
560# ISDN subsystem 564# ISDN subsystem
@@ -659,6 +663,7 @@ CONFIG_DRM=y
659CONFIG_DRM_RADEON=y 663CONFIG_DRM_RADEON=y
660# CONFIG_DRM_MGA is not set 664# CONFIG_DRM_MGA is not set
661# CONFIG_DRM_SIS is not set 665# CONFIG_DRM_SIS is not set
666# CONFIG_DRM_VIA is not set
662# CONFIG_RAW_DRIVER is not set 667# CONFIG_RAW_DRIVER is not set
663# CONFIG_HPET is not set 668# CONFIG_HPET is not set
664# CONFIG_HANGCHECK_TIMER is not set 669# CONFIG_HANGCHECK_TIMER is not set
@@ -706,47 +711,10 @@ CONFIG_I2C_ALGOPCF=y
706# CONFIG_I2C_VIAPRO is not set 711# CONFIG_I2C_VIAPRO is not set
707# CONFIG_I2C_VOODOO3 is not set 712# CONFIG_I2C_VOODOO3 is not set
708# CONFIG_I2C_PCA_ISA is not set 713# CONFIG_I2C_PCA_ISA is not set
714# CONFIG_I2C_SENSOR is not set
709 715
710# 716#
711# Hardware Sensors Chip support 717# Miscellaneous I2C Chip support
712#
713# CONFIG_I2C_SENSOR is not set
714# CONFIG_SENSORS_ADM1021 is not set
715# CONFIG_SENSORS_ADM1025 is not set
716# CONFIG_SENSORS_ADM1026 is not set
717# CONFIG_SENSORS_ADM1031 is not set
718# CONFIG_SENSORS_ADM9240 is not set
719# CONFIG_SENSORS_ASB100 is not set
720# CONFIG_SENSORS_ATXP1 is not set
721# CONFIG_SENSORS_DS1621 is not set
722# CONFIG_SENSORS_FSCHER is not set
723# CONFIG_SENSORS_FSCPOS is not set
724# CONFIG_SENSORS_GL518SM is not set
725# CONFIG_SENSORS_GL520SM is not set
726# CONFIG_SENSORS_IT87 is not set
727# CONFIG_SENSORS_LM63 is not set
728# CONFIG_SENSORS_LM75 is not set
729# CONFIG_SENSORS_LM77 is not set
730# CONFIG_SENSORS_LM78 is not set
731# CONFIG_SENSORS_LM80 is not set
732# CONFIG_SENSORS_LM83 is not set
733# CONFIG_SENSORS_LM85 is not set
734# CONFIG_SENSORS_LM87 is not set
735# CONFIG_SENSORS_LM90 is not set
736# CONFIG_SENSORS_LM92 is not set
737# CONFIG_SENSORS_MAX1619 is not set
738# CONFIG_SENSORS_PC87360 is not set
739# CONFIG_SENSORS_SMSC47B397 is not set
740# CONFIG_SENSORS_SIS5595 is not set
741# CONFIG_SENSORS_SMSC47M1 is not set
742# CONFIG_SENSORS_VIA686A is not set
743# CONFIG_SENSORS_W83781D 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
748#
749# Other I2C Chip support
750# 718#
751# CONFIG_SENSORS_DS1337 is not set 719# CONFIG_SENSORS_DS1337 is not set
752# CONFIG_SENSORS_DS1374 is not set 720# CONFIG_SENSORS_DS1374 is not set
@@ -767,6 +735,11 @@ CONFIG_I2C_ALGOPCF=y
767# CONFIG_W1 is not set 735# CONFIG_W1 is not set
768 736
769# 737#
738# Hardware Monitoring support
739#
740# CONFIG_HWMON is not set
741
742#
770# Misc devices 743# Misc devices
771# 744#
772 745
@@ -782,7 +755,6 @@ CONFIG_VIDEO_DEV=y
782# 755#
783# Video Adapters 756# Video Adapters
784# 757#
785# CONFIG_TUNER_MULTI_I2C is not set
786# CONFIG_VIDEO_BT848 is not set 758# CONFIG_VIDEO_BT848 is not set
787# CONFIG_VIDEO_CPIA is not set 759# CONFIG_VIDEO_CPIA is not set
788# CONFIG_VIDEO_SAA5246A is not set 760# CONFIG_VIDEO_SAA5246A is not set
@@ -1025,6 +997,7 @@ CONFIG_USB_HIDDEV=y
1025# CONFIG_USB_EGALAX is not set 997# CONFIG_USB_EGALAX is not set
1026# CONFIG_USB_XPAD is not set 998# CONFIG_USB_XPAD is not set
1027# CONFIG_USB_ATI_REMOTE is not set 999# CONFIG_USB_ATI_REMOTE is not set
1000# CONFIG_USB_KEYSPAN_REMOTE is not set
1028 1001
1029# 1002#
1030# USB Imaging devices 1003# USB Imaging devices
@@ -1080,6 +1053,7 @@ CONFIG_USB_MON=y
1080# CONFIG_USB_PHIDGETSERVO is not set 1053# CONFIG_USB_PHIDGETSERVO is not set
1081# CONFIG_USB_IDMOUSE is not set 1054# CONFIG_USB_IDMOUSE is not set
1082# CONFIG_USB_SISUSBVGA is not set 1055# CONFIG_USB_SISUSBVGA is not set
1056# CONFIG_USB_LD is not set
1083 1057
1084# 1058#
1085# USB DSL modem support 1059# USB DSL modem support
@@ -1121,6 +1095,7 @@ CONFIG_JBD=y
1121CONFIG_FS_MBCACHE=y 1095CONFIG_FS_MBCACHE=y
1122# CONFIG_REISERFS_FS is not set 1096# CONFIG_REISERFS_FS is not set
1123# CONFIG_JFS_FS is not set 1097# CONFIG_JFS_FS is not set
1098# CONFIG_FS_POSIX_ACL is not set
1124 1099
1125# 1100#
1126# XFS support 1101# XFS support
@@ -1128,6 +1103,7 @@ CONFIG_FS_MBCACHE=y
1128# CONFIG_XFS_FS is not set 1103# CONFIG_XFS_FS is not set
1129# CONFIG_MINIX_FS is not set 1104# CONFIG_MINIX_FS is not set
1130# CONFIG_ROMFS_FS is not set 1105# CONFIG_ROMFS_FS is not set
1106# CONFIG_INOTIFY is not set
1131# CONFIG_QUOTA is not set 1107# CONFIG_QUOTA is not set
1132CONFIG_DNOTIFY=y 1108CONFIG_DNOTIFY=y
1133CONFIG_AUTOFS_FS=y 1109CONFIG_AUTOFS_FS=y
diff --git a/arch/ia64/hp/sim/boot/boot_head.S b/arch/ia64/hp/sim/boot/boot_head.S
index 9364199e5632..1c8c7e6a9a5e 100644
--- a/arch/ia64/hp/sim/boot/boot_head.S
+++ b/arch/ia64/hp/sim/boot/boot_head.S
@@ -22,7 +22,7 @@ GLOBAL_ENTRY(_start)
22 .save rp, r0 22 .save rp, r0
23 .body 23 .body
24 movl gp = __gp 24 movl gp = __gp
25 movl sp = stack_mem 25 movl sp = stack_mem+16384-16
26 bsw.1 26 bsw.1
27 br.call.sptk.many rp=start_bootloader 27 br.call.sptk.many rp=start_bootloader
28END(_start) 28END(_start)
diff --git a/arch/ia64/hp/sim/boot/fw-emu.c b/arch/ia64/hp/sim/boot/fw-emu.c
index 5c46928e3dc6..30fdfb1d0a53 100644
--- a/arch/ia64/hp/sim/boot/fw-emu.c
+++ b/arch/ia64/hp/sim/boot/fw-emu.c
@@ -237,17 +237,6 @@ sal_emulator (long index, unsigned long in1, unsigned long in2,
237 return ((struct sal_ret_values) {status, r9, r10, r11}); 237 return ((struct sal_ret_values) {status, r9, r10, r11});
238} 238}
239 239
240
241/*
242 * This is here to work around a bug in egcs-1.1.1b that causes the
243 * compiler to crash (seems like a bug in the new alias analysis code.
244 */
245void *
246id (long addr)
247{
248 return (void *) addr;
249}
250
251struct ia64_boot_param * 240struct ia64_boot_param *
252sys_fw_init (const char *args, int arglen) 241sys_fw_init (const char *args, int arglen)
253{ 242{
diff --git a/arch/ia64/ia32/ia32_signal.c b/arch/ia64/ia32/ia32_signal.c
index ebb89be2aa2d..aa891c9bc9b6 100644
--- a/arch/ia64/ia32/ia32_signal.c
+++ b/arch/ia64/ia32/ia32_signal.c
@@ -29,7 +29,6 @@
29#include <asm/uaccess.h> 29#include <asm/uaccess.h>
30#include <asm/rse.h> 30#include <asm/rse.h>
31#include <asm/sigcontext.h> 31#include <asm/sigcontext.h>
32#include <asm/segment.h>
33 32
34#include "ia32priv.h" 33#include "ia32priv.h"
35 34
diff --git a/arch/ia64/kernel/Makefile b/arch/ia64/kernel/Makefile
index e1fb68ddec26..b242594be55b 100644
--- a/arch/ia64/kernel/Makefile
+++ b/arch/ia64/kernel/Makefile
@@ -20,6 +20,7 @@ obj-$(CONFIG_SMP) += smp.o smpboot.o domain.o
20obj-$(CONFIG_NUMA) += numa.o 20obj-$(CONFIG_NUMA) += numa.o
21obj-$(CONFIG_PERFMON) += perfmon_default_smpl.o 21obj-$(CONFIG_PERFMON) += perfmon_default_smpl.o
22obj-$(CONFIG_IA64_CYCLONE) += cyclone.o 22obj-$(CONFIG_IA64_CYCLONE) += cyclone.o
23obj-$(CONFIG_CPU_FREQ) += cpufreq/
23obj-$(CONFIG_IA64_MCA_RECOVERY) += mca_recovery.o 24obj-$(CONFIG_IA64_MCA_RECOVERY) += mca_recovery.o
24obj-$(CONFIG_KPROBES) += kprobes.o jprobes.o 25obj-$(CONFIG_KPROBES) += kprobes.o jprobes.o
25obj-$(CONFIG_IA64_UNCACHED_ALLOCATOR) += uncached.o 26obj-$(CONFIG_IA64_UNCACHED_ALLOCATOR) += uncached.o
diff --git a/arch/ia64/kernel/acpi.c b/arch/ia64/kernel/acpi.c
index 542256e98e60..9609f243e5d0 100644
--- a/arch/ia64/kernel/acpi.c
+++ b/arch/ia64/kernel/acpi.c
@@ -11,6 +11,7 @@
11 * Copyright (C) 2001 Jenna Hall <jenna.s.hall@intel.com> 11 * Copyright (C) 2001 Jenna Hall <jenna.s.hall@intel.com>
12 * Copyright (C) 2001 Takayoshi Kochi <t-kochi@bq.jp.nec.com> 12 * Copyright (C) 2001 Takayoshi Kochi <t-kochi@bq.jp.nec.com>
13 * Copyright (C) 2002 Erich Focht <efocht@ess.nec.de> 13 * Copyright (C) 2002 Erich Focht <efocht@ess.nec.de>
14 * Copyright (C) 2004 Ashok Raj <ashok.raj@intel.com>
14 * 15 *
15 * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 16 * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
16 * 17 *
@@ -67,6 +68,11 @@ EXPORT_SYMBOL(pm_power_off);
67unsigned char acpi_kbd_controller_present = 1; 68unsigned char acpi_kbd_controller_present = 1;
68unsigned char acpi_legacy_devices; 69unsigned char acpi_legacy_devices;
69 70
71static unsigned int __initdata acpi_madt_rev;
72
73unsigned int acpi_cpei_override;
74unsigned int acpi_cpei_phys_cpuid;
75
70#define MAX_SAPICS 256 76#define MAX_SAPICS 256
71u16 ia64_acpiid_to_sapicid[MAX_SAPICS] = 77u16 ia64_acpiid_to_sapicid[MAX_SAPICS] =
72 { [0 ... MAX_SAPICS - 1] = -1 }; 78 { [0 ... MAX_SAPICS - 1] = -1 };
@@ -265,10 +271,56 @@ acpi_parse_plat_int_src (
265 (plintsrc->flags.trigger == 1) ? IOSAPIC_EDGE : IOSAPIC_LEVEL); 271 (plintsrc->flags.trigger == 1) ? IOSAPIC_EDGE : IOSAPIC_LEVEL);
266 272
267 platform_intr_list[plintsrc->type] = vector; 273 platform_intr_list[plintsrc->type] = vector;
274 if (acpi_madt_rev > 1) {
275 acpi_cpei_override = plintsrc->plint_flags.cpei_override_flag;
276 }
277
278 /*
279 * Save the physical id, so we can check when its being removed
280 */
281 acpi_cpei_phys_cpuid = ((plintsrc->id << 8) | (plintsrc->eid)) & 0xffff;
282
268 return 0; 283 return 0;
269} 284}
270 285
271 286
287unsigned int can_cpei_retarget(void)
288{
289 extern int cpe_vector;
290
291 /*
292 * Only if CPEI is supported and the override flag
293 * is present, otherwise return that its re-targettable
294 * if we are in polling mode.
295 */
296 if (cpe_vector > 0 && !acpi_cpei_override)
297 return 0;
298 else
299 return 1;
300}
301
302unsigned int is_cpu_cpei_target(unsigned int cpu)
303{
304 unsigned int logical_id;
305
306 logical_id = cpu_logical_id(acpi_cpei_phys_cpuid);
307
308 if (logical_id == cpu)
309 return 1;
310 else
311 return 0;
312}
313
314void set_cpei_target_cpu(unsigned int cpu)
315{
316 acpi_cpei_phys_cpuid = cpu_physical_id(cpu);
317}
318
319unsigned int get_cpei_target_cpu(void)
320{
321 return acpi_cpei_phys_cpuid;
322}
323
272static int __init 324static int __init
273acpi_parse_int_src_ovr ( 325acpi_parse_int_src_ovr (
274 acpi_table_entry_header *header, const unsigned long end) 326 acpi_table_entry_header *header, const unsigned long end)
@@ -326,6 +378,8 @@ acpi_parse_madt (unsigned long phys_addr, unsigned long size)
326 378
327 acpi_madt = (struct acpi_table_madt *) __va(phys_addr); 379 acpi_madt = (struct acpi_table_madt *) __va(phys_addr);
328 380
381 acpi_madt_rev = acpi_madt->header.revision;
382
329 /* remember the value for reference after free_initmem() */ 383 /* remember the value for reference after free_initmem() */
330#ifdef CONFIG_ITANIUM 384#ifdef CONFIG_ITANIUM
331 has_8259 = 1; /* Firmware on old Itanium systems is broken */ 385 has_8259 = 1; /* Firmware on old Itanium systems is broken */
diff --git a/arch/ia64/kernel/cpufreq/Kconfig b/arch/ia64/kernel/cpufreq/Kconfig
new file mode 100644
index 000000000000..2d9d5279b981
--- /dev/null
+++ b/arch/ia64/kernel/cpufreq/Kconfig
@@ -0,0 +1,29 @@
1
2#
3# CPU Frequency scaling
4#
5
6menu "CPU Frequency scaling"
7
8source "drivers/cpufreq/Kconfig"
9
10if CPU_FREQ
11
12comment "CPUFreq processor drivers"
13
14config IA64_ACPI_CPUFREQ
15 tristate "ACPI Processor P-States driver"
16 select CPU_FREQ_TABLE
17 depends on ACPI_PROCESSOR
18 help
19 This driver adds a CPUFreq driver which utilizes the ACPI
20 Processor Performance States.
21
22 For details, take a look at <file:Documentation/cpu-freq/>.
23
24 If in doubt, say N.
25
26endif # CPU_FREQ
27
28endmenu
29
diff --git a/arch/ia64/kernel/cpufreq/Makefile b/arch/ia64/kernel/cpufreq/Makefile
new file mode 100644
index 000000000000..f748d34c02f0
--- /dev/null
+++ b/arch/ia64/kernel/cpufreq/Makefile
@@ -0,0 +1 @@
obj-$(CONFIG_IA64_ACPI_CPUFREQ) += acpi-cpufreq.o
diff --git a/arch/ia64/kernel/cpufreq/acpi-cpufreq.c b/arch/ia64/kernel/cpufreq/acpi-cpufreq.c
new file mode 100644
index 000000000000..da4d5cf80a48
--- /dev/null
+++ b/arch/ia64/kernel/cpufreq/acpi-cpufreq.c
@@ -0,0 +1,499 @@
1/*
2 * arch/ia64/kernel/cpufreq/acpi-cpufreq.c
3 * This file provides the ACPI based P-state support. This
4 * module works with generic cpufreq infrastructure. Most of
5 * the code is based on i386 version
6 * (arch/i386/kernel/cpu/cpufreq/acpi-cpufreq.c)
7 *
8 * Copyright (C) 2005 Intel Corp
9 * Venkatesh Pallipadi <venkatesh.pallipadi@intel.com>
10 */
11
12#include <linux/config.h>
13#include <linux/kernel.h>
14#include <linux/module.h>
15#include <linux/init.h>
16#include <linux/cpufreq.h>
17#include <linux/proc_fs.h>
18#include <linux/seq_file.h>
19#include <asm/io.h>
20#include <asm/uaccess.h>
21#include <asm/pal.h>
22
23#include <linux/acpi.h>
24#include <acpi/processor.h>
25
26#define dprintk(msg...) cpufreq_debug_printk(CPUFREQ_DEBUG_DRIVER, "acpi-cpufreq", msg)
27
28MODULE_AUTHOR("Venkatesh Pallipadi");
29MODULE_DESCRIPTION("ACPI Processor P-States Driver");
30MODULE_LICENSE("GPL");
31
32
33struct cpufreq_acpi_io {
34 struct acpi_processor_performance acpi_data;
35 struct cpufreq_frequency_table *freq_table;
36 unsigned int resume;
37};
38
39static struct cpufreq_acpi_io *acpi_io_data[NR_CPUS];
40
41static struct cpufreq_driver acpi_cpufreq_driver;
42
43
44static int
45processor_set_pstate (
46 u32 value)
47{
48 s64 retval;
49
50 dprintk("processor_set_pstate\n");
51
52 retval = ia64_pal_set_pstate((u64)value);
53
54 if (retval) {
55 dprintk("Failed to set freq to 0x%x, with error 0x%x\n",
56 value, retval);
57 return -ENODEV;
58 }
59 return (int)retval;
60}
61
62
63static int
64processor_get_pstate (
65 u32 *value)
66{
67 u64 pstate_index = 0;
68 s64 retval;
69
70 dprintk("processor_get_pstate\n");
71
72 retval = ia64_pal_get_pstate(&pstate_index);
73 *value = (u32) pstate_index;
74
75 if (retval)
76 dprintk("Failed to get current freq with "
77 "error 0x%x, idx 0x%x\n", retval, *value);
78
79 return (int)retval;
80}
81
82
83/* To be used only after data->acpi_data is initialized */
84static unsigned
85extract_clock (
86 struct cpufreq_acpi_io *data,
87 unsigned value,
88 unsigned int cpu)
89{
90 unsigned long i;
91
92 dprintk("extract_clock\n");
93
94 for (i = 0; i < data->acpi_data.state_count; i++) {
95 if (value >= data->acpi_data.states[i].control)
96 return data->acpi_data.states[i].core_frequency;
97 }
98 return data->acpi_data.states[i-1].core_frequency;
99}
100
101
102static unsigned int
103processor_get_freq (
104 struct cpufreq_acpi_io *data,
105 unsigned int cpu)
106{
107 int ret = 0;
108 u32 value = 0;
109 cpumask_t saved_mask;
110 unsigned long clock_freq;
111
112 dprintk("processor_get_freq\n");
113
114 saved_mask = current->cpus_allowed;
115 set_cpus_allowed(current, cpumask_of_cpu(cpu));
116 if (smp_processor_id() != cpu) {
117 ret = -EAGAIN;
118 goto migrate_end;
119 }
120
121 /*
122 * processor_get_pstate gets the average frequency since the
123 * last get. So, do two PAL_get_freq()...
124 */
125 ret = processor_get_pstate(&value);
126 ret = processor_get_pstate(&value);
127
128 if (ret) {
129 set_cpus_allowed(current, saved_mask);
130 printk(KERN_WARNING "get performance failed with error %d\n",
131 ret);
132 ret = -EAGAIN;
133 goto migrate_end;
134 }
135 clock_freq = extract_clock(data, value, cpu);
136 ret = (clock_freq*1000);
137
138migrate_end:
139 set_cpus_allowed(current, saved_mask);
140 return ret;
141}
142
143
144static int
145processor_set_freq (
146 struct cpufreq_acpi_io *data,
147 unsigned int cpu,
148 int state)
149{
150 int ret = 0;
151 u32 value = 0;
152 struct cpufreq_freqs cpufreq_freqs;
153 cpumask_t saved_mask;
154 int retval;
155
156 dprintk("processor_set_freq\n");
157
158 saved_mask = current->cpus_allowed;
159 set_cpus_allowed(current, cpumask_of_cpu(cpu));
160 if (smp_processor_id() != cpu) {
161 retval = -EAGAIN;
162 goto migrate_end;
163 }
164
165 if (state == data->acpi_data.state) {
166 if (unlikely(data->resume)) {
167 dprintk("Called after resume, resetting to P%d\n", state);
168 data->resume = 0;
169 } else {
170 dprintk("Already at target state (P%d)\n", state);
171 retval = 0;
172 goto migrate_end;
173 }
174 }
175
176 dprintk("Transitioning from P%d to P%d\n",
177 data->acpi_data.state, state);
178
179 /* cpufreq frequency struct */
180 cpufreq_freqs.cpu = cpu;
181 cpufreq_freqs.old = data->freq_table[data->acpi_data.state].frequency;
182 cpufreq_freqs.new = data->freq_table[state].frequency;
183
184 /* notify cpufreq */
185 cpufreq_notify_transition(&cpufreq_freqs, CPUFREQ_PRECHANGE);
186
187 /*
188 * First we write the target state's 'control' value to the
189 * control_register.
190 */
191
192 value = (u32) data->acpi_data.states[state].control;
193
194 dprintk("Transitioning to state: 0x%08x\n", value);
195
196 ret = processor_set_pstate(value);
197 if (ret) {
198 unsigned int tmp = cpufreq_freqs.new;
199 cpufreq_notify_transition(&cpufreq_freqs, CPUFREQ_POSTCHANGE);
200 cpufreq_freqs.new = cpufreq_freqs.old;
201 cpufreq_freqs.old = tmp;
202 cpufreq_notify_transition(&cpufreq_freqs, CPUFREQ_PRECHANGE);
203 cpufreq_notify_transition(&cpufreq_freqs, CPUFREQ_POSTCHANGE);
204 printk(KERN_WARNING "Transition failed with error %d\n", ret);
205 retval = -ENODEV;
206 goto migrate_end;
207 }
208
209 cpufreq_notify_transition(&cpufreq_freqs, CPUFREQ_POSTCHANGE);
210
211 data->acpi_data.state = state;
212
213 retval = 0;
214
215migrate_end:
216 set_cpus_allowed(current, saved_mask);
217 return (retval);
218}
219
220
221static unsigned int
222acpi_cpufreq_get (
223 unsigned int cpu)
224{
225 struct cpufreq_acpi_io *data = acpi_io_data[cpu];
226
227 dprintk("acpi_cpufreq_get\n");
228
229 return processor_get_freq(data, cpu);
230}
231
232
233static int
234acpi_cpufreq_target (
235 struct cpufreq_policy *policy,
236 unsigned int target_freq,
237 unsigned int relation)
238{
239 struct cpufreq_acpi_io *data = acpi_io_data[policy->cpu];
240 unsigned int next_state = 0;
241 unsigned int result = 0;
242
243 dprintk("acpi_cpufreq_setpolicy\n");
244
245 result = cpufreq_frequency_table_target(policy,
246 data->freq_table, target_freq, relation, &next_state);
247 if (result)
248 return (result);
249
250 result = processor_set_freq(data, policy->cpu, next_state);
251
252 return (result);
253}
254
255
256static int
257acpi_cpufreq_verify (
258 struct cpufreq_policy *policy)
259{
260 unsigned int result = 0;
261 struct cpufreq_acpi_io *data = acpi_io_data[policy->cpu];
262
263 dprintk("acpi_cpufreq_verify\n");
264
265 result = cpufreq_frequency_table_verify(policy,
266 data->freq_table);
267
268 return (result);
269}
270
271
272/*
273 * processor_init_pdc - let BIOS know about the SMP capabilities
274 * of this driver
275 * @perf: processor-specific acpi_io_data struct
276 * @cpu: CPU being initialized
277 *
278 * To avoid issues with legacy OSes, some BIOSes require to be informed of
279 * the SMP capabilities of OS P-state driver. Here we set the bits in _PDC
280 * accordingly. Actual call to _PDC is done in driver/acpi/processor.c
281 */
282static void
283processor_init_pdc (
284 struct acpi_processor_performance *perf,
285 unsigned int cpu,
286 struct acpi_object_list *obj_list
287 )
288{
289 union acpi_object *obj;
290 u32 *buf;
291
292 dprintk("processor_init_pdc\n");
293
294 perf->pdc = NULL;
295 /* Initialize pdc. It will be used later. */
296 if (!obj_list)
297 return;
298
299 if (!(obj_list->count && obj_list->pointer))
300 return;
301
302 obj = obj_list->pointer;
303 if ((obj->buffer.length == 12) && obj->buffer.pointer) {
304 buf = (u32 *)obj->buffer.pointer;
305 buf[0] = ACPI_PDC_REVISION_ID;
306 buf[1] = 1;
307 buf[2] = ACPI_PDC_EST_CAPABILITY_SMP;
308 perf->pdc = obj_list;
309 }
310 return;
311}
312
313
314static int
315acpi_cpufreq_cpu_init (
316 struct cpufreq_policy *policy)
317{
318 unsigned int i;
319 unsigned int cpu = policy->cpu;
320 struct cpufreq_acpi_io *data;
321 unsigned int result = 0;
322
323 union acpi_object arg0 = {ACPI_TYPE_BUFFER};
324 u32 arg0_buf[3];
325 struct acpi_object_list arg_list = {1, &arg0};
326
327 dprintk("acpi_cpufreq_cpu_init\n");
328 /* setup arg_list for _PDC settings */
329 arg0.buffer.length = 12;
330 arg0.buffer.pointer = (u8 *) arg0_buf;
331
332 data = kmalloc(sizeof(struct cpufreq_acpi_io), GFP_KERNEL);
333 if (!data)
334 return (-ENOMEM);
335
336 memset(data, 0, sizeof(struct cpufreq_acpi_io));
337
338 acpi_io_data[cpu] = data;
339
340 processor_init_pdc(&data->acpi_data, cpu, &arg_list);
341 result = acpi_processor_register_performance(&data->acpi_data, cpu);
342 data->acpi_data.pdc = NULL;
343
344 if (result)
345 goto err_free;
346
347 /* capability check */
348 if (data->acpi_data.state_count <= 1) {
349 dprintk("No P-States\n");
350 result = -ENODEV;
351 goto err_unreg;
352 }
353
354 if ((data->acpi_data.control_register.space_id !=
355 ACPI_ADR_SPACE_FIXED_HARDWARE) ||
356 (data->acpi_data.status_register.space_id !=
357 ACPI_ADR_SPACE_FIXED_HARDWARE)) {
358 dprintk("Unsupported address space [%d, %d]\n",
359 (u32) (data->acpi_data.control_register.space_id),
360 (u32) (data->acpi_data.status_register.space_id));
361 result = -ENODEV;
362 goto err_unreg;
363 }
364
365 /* alloc freq_table */
366 data->freq_table = kmalloc(sizeof(struct cpufreq_frequency_table) *
367 (data->acpi_data.state_count + 1),
368 GFP_KERNEL);
369 if (!data->freq_table) {
370 result = -ENOMEM;
371 goto err_unreg;
372 }
373
374 /* detect transition latency */
375 policy->cpuinfo.transition_latency = 0;
376 for (i=0; i<data->acpi_data.state_count; i++) {
377 if ((data->acpi_data.states[i].transition_latency * 1000) >
378 policy->cpuinfo.transition_latency) {
379 policy->cpuinfo.transition_latency =
380 data->acpi_data.states[i].transition_latency * 1000;
381 }
382 }
383 policy->governor = CPUFREQ_DEFAULT_GOVERNOR;
384
385 policy->cur = processor_get_freq(data, policy->cpu);
386
387 /* table init */
388 for (i = 0; i <= data->acpi_data.state_count; i++)
389 {
390 data->freq_table[i].index = i;
391 if (i < data->acpi_data.state_count) {
392 data->freq_table[i].frequency =
393 data->acpi_data.states[i].core_frequency * 1000;
394 } else {
395 data->freq_table[i].frequency = CPUFREQ_TABLE_END;
396 }
397 }
398
399 result = cpufreq_frequency_table_cpuinfo(policy, data->freq_table);
400 if (result) {
401 goto err_freqfree;
402 }
403
404 /* notify BIOS that we exist */
405 acpi_processor_notify_smm(THIS_MODULE);
406
407 printk(KERN_INFO "acpi-cpufreq: CPU%u - ACPI performance management "
408 "activated.\n", cpu);
409
410 for (i = 0; i < data->acpi_data.state_count; i++)
411 dprintk(" %cP%d: %d MHz, %d mW, %d uS, %d uS, 0x%x 0x%x\n",
412 (i == data->acpi_data.state?'*':' '), i,
413 (u32) data->acpi_data.states[i].core_frequency,
414 (u32) data->acpi_data.states[i].power,
415 (u32) data->acpi_data.states[i].transition_latency,
416 (u32) data->acpi_data.states[i].bus_master_latency,
417 (u32) data->acpi_data.states[i].status,
418 (u32) data->acpi_data.states[i].control);
419
420 cpufreq_frequency_table_get_attr(data->freq_table, policy->cpu);
421
422 /* the first call to ->target() should result in us actually
423 * writing something to the appropriate registers. */
424 data->resume = 1;
425
426 return (result);
427
428 err_freqfree:
429 kfree(data->freq_table);
430 err_unreg:
431 acpi_processor_unregister_performance(&data->acpi_data, cpu);
432 err_free:
433 kfree(data);
434 acpi_io_data[cpu] = NULL;
435
436 return (result);
437}
438
439
440static int
441acpi_cpufreq_cpu_exit (
442 struct cpufreq_policy *policy)
443{
444 struct cpufreq_acpi_io *data = acpi_io_data[policy->cpu];
445
446 dprintk("acpi_cpufreq_cpu_exit\n");
447
448 if (data) {
449 cpufreq_frequency_table_put_attr(policy->cpu);
450 acpi_io_data[policy->cpu] = NULL;
451 acpi_processor_unregister_performance(&data->acpi_data,
452 policy->cpu);
453 kfree(data);
454 }
455
456 return (0);
457}
458
459
460static struct freq_attr* acpi_cpufreq_attr[] = {
461 &cpufreq_freq_attr_scaling_available_freqs,
462 NULL,
463};
464
465
466static struct cpufreq_driver acpi_cpufreq_driver = {
467 .verify = acpi_cpufreq_verify,
468 .target = acpi_cpufreq_target,
469 .get = acpi_cpufreq_get,
470 .init = acpi_cpufreq_cpu_init,
471 .exit = acpi_cpufreq_cpu_exit,
472 .name = "acpi-cpufreq",
473 .owner = THIS_MODULE,
474 .attr = acpi_cpufreq_attr,
475};
476
477
478static int __init
479acpi_cpufreq_init (void)
480{
481 dprintk("acpi_cpufreq_init\n");
482
483 return cpufreq_register_driver(&acpi_cpufreq_driver);
484}
485
486
487static void __exit
488acpi_cpufreq_exit (void)
489{
490 dprintk("acpi_cpufreq_exit\n");
491
492 cpufreq_unregister_driver(&acpi_cpufreq_driver);
493 return;
494}
495
496
497late_initcall(acpi_cpufreq_init);
498module_exit(acpi_cpufreq_exit);
499
diff --git a/arch/ia64/kernel/domain.c b/arch/ia64/kernel/domain.c
index d65e87b6394f..bbb8efe126b7 100644
--- a/arch/ia64/kernel/domain.c
+++ b/arch/ia64/kernel/domain.c
@@ -341,7 +341,7 @@ next_sg:
341#endif 341#endif
342 342
343 /* Attach the domains */ 343 /* Attach the domains */
344 for_each_online_cpu(i) { 344 for_each_cpu_mask(i, *cpu_map) {
345 struct sched_domain *sd; 345 struct sched_domain *sd;
346#ifdef CONFIG_SCHED_SMT 346#ifdef CONFIG_SCHED_SMT
347 sd = &per_cpu(cpu_domains, i); 347 sd = &per_cpu(cpu_domains, i);
diff --git a/arch/ia64/kernel/entry.S b/arch/ia64/kernel/entry.S
index bb9a506deb78..9be53e1ea404 100644
--- a/arch/ia64/kernel/entry.S
+++ b/arch/ia64/kernel/entry.S
@@ -1573,9 +1573,9 @@ sys_call_table:
1573 data8 sys_keyctl 1573 data8 sys_keyctl
1574 data8 sys_ioprio_set 1574 data8 sys_ioprio_set
1575 data8 sys_ioprio_get // 1275 1575 data8 sys_ioprio_get // 1275
1576 data8 sys_set_zone_reclaim
1577 data8 sys_ni_syscall
1578 data8 sys_ni_syscall
1579 data8 sys_ni_syscall 1576 data8 sys_ni_syscall
1577 data8 sys_inotify_init
1578 data8 sys_inotify_add_watch
1579 data8 sys_inotify_rm_watch
1580 1580
1581 .org sys_call_table + 8*NR_syscalls // guard against failures to increase NR_syscalls 1581 .org sys_call_table + 8*NR_syscalls // guard against failures to increase NR_syscalls
diff --git a/arch/ia64/kernel/mca.c b/arch/ia64/kernel/mca.c
index 736e328b5e61..4ebbf3974381 100644
--- a/arch/ia64/kernel/mca.c
+++ b/arch/ia64/kernel/mca.c
@@ -271,7 +271,7 @@ ia64_mca_log_sal_error_record(int sal_info_type)
271 271
272#ifdef CONFIG_ACPI 272#ifdef CONFIG_ACPI
273 273
274static int cpe_vector = -1; 274int cpe_vector = -1;
275 275
276static irqreturn_t 276static irqreturn_t
277ia64_mca_cpe_int_handler (int cpe_irq, void *arg, struct pt_regs *ptregs) 277ia64_mca_cpe_int_handler (int cpe_irq, void *arg, struct pt_regs *ptregs)
diff --git a/arch/ia64/kernel/perfmon.c b/arch/ia64/kernel/perfmon.c
index b8ebb8e427ef..f1201ac8a116 100644
--- a/arch/ia64/kernel/perfmon.c
+++ b/arch/ia64/kernel/perfmon.c
@@ -4312,6 +4312,7 @@ pfm_context_load(pfm_context_t *ctx, void *arg, int count, struct pt_regs *regs)
4312 DPRINT(("before cmpxchg() old_ctx=%p new_ctx=%p\n", 4312 DPRINT(("before cmpxchg() old_ctx=%p new_ctx=%p\n",
4313 thread->pfm_context, ctx)); 4313 thread->pfm_context, ctx));
4314 4314
4315 ret = -EBUSY;
4315 old = ia64_cmpxchg(acq, &thread->pfm_context, NULL, ctx, sizeof(pfm_context_t *)); 4316 old = ia64_cmpxchg(acq, &thread->pfm_context, NULL, ctx, sizeof(pfm_context_t *));
4316 if (old != NULL) { 4317 if (old != NULL) {
4317 DPRINT(("load_pid [%d] already has a context\n", req->load_pid)); 4318 DPRINT(("load_pid [%d] already has a context\n", req->load_pid));
diff --git a/arch/ia64/kernel/process.c b/arch/ia64/kernel/process.c
index 6e35bff05d59..051e050359e4 100644
--- a/arch/ia64/kernel/process.c
+++ b/arch/ia64/kernel/process.c
@@ -179,7 +179,7 @@ static int can_do_pal_halt = 1;
179 179
180static int __init nohalt_setup(char * str) 180static int __init nohalt_setup(char * str)
181{ 181{
182 pal_halt = 0; 182 pal_halt = can_do_pal_halt = 0;
183 return 1; 183 return 1;
184} 184}
185__setup("nohalt", nohalt_setup); 185__setup("nohalt", nohalt_setup);
@@ -196,6 +196,7 @@ update_pal_halt_status(int status)
196void 196void
197default_idle (void) 197default_idle (void)
198{ 198{
199 local_irq_enable();
199 while (!need_resched()) 200 while (!need_resched())
200 if (can_do_pal_halt) 201 if (can_do_pal_halt)
201 safe_halt(); 202 safe_halt();
@@ -806,16 +807,12 @@ machine_restart (char *restart_cmd)
806 (*efi.reset_system)(EFI_RESET_WARM, 0, 0, NULL); 807 (*efi.reset_system)(EFI_RESET_WARM, 0, 0, NULL);
807} 808}
808 809
809EXPORT_SYMBOL(machine_restart);
810
811void 810void
812machine_halt (void) 811machine_halt (void)
813{ 812{
814 cpu_halt(); 813 cpu_halt();
815} 814}
816 815
817EXPORT_SYMBOL(machine_halt);
818
819void 816void
820machine_power_off (void) 817machine_power_off (void)
821{ 818{
@@ -824,4 +821,3 @@ machine_power_off (void)
824 machine_halt(); 821 machine_halt();
825} 822}
826 823
827EXPORT_SYMBOL(machine_power_off);
diff --git a/arch/ia64/kernel/salinfo.c b/arch/ia64/kernel/salinfo.c
index d227fabecd02..6f0cc7a6634e 100644
--- a/arch/ia64/kernel/salinfo.c
+++ b/arch/ia64/kernel/salinfo.c
@@ -143,7 +143,8 @@ struct salinfo_data {
143 143
144static struct salinfo_data salinfo_data[ARRAY_SIZE(salinfo_log_name)]; 144static struct salinfo_data salinfo_data[ARRAY_SIZE(salinfo_log_name)];
145 145
146static spinlock_t data_lock, data_saved_lock; 146static DEFINE_SPINLOCK(data_lock);
147static DEFINE_SPINLOCK(data_saved_lock);
147 148
148/** salinfo_platform_oemdata - optional callback to decode oemdata from an error 149/** salinfo_platform_oemdata - optional callback to decode oemdata from an error
149 * record. 150 * record.
diff --git a/arch/ia64/kernel/setup.c b/arch/ia64/kernel/setup.c
index 2693e1522d7c..84f89da7c640 100644
--- a/arch/ia64/kernel/setup.c
+++ b/arch/ia64/kernel/setup.c
@@ -20,6 +20,7 @@
20 * 02/01/00 R.Seth fixed get_cpuinfo for SMP 20 * 02/01/00 R.Seth fixed get_cpuinfo for SMP
21 * 01/07/99 S.Eranian added the support for command line argument 21 * 01/07/99 S.Eranian added the support for command line argument
22 * 06/24/99 W.Drummond added boot_cpu_data. 22 * 06/24/99 W.Drummond added boot_cpu_data.
23 * 05/28/05 Z. Menyhart Dynamic stride size for "flush_icache_range()"
23 */ 24 */
24#include <linux/config.h> 25#include <linux/config.h>
25#include <linux/module.h> 26#include <linux/module.h>
@@ -40,6 +41,8 @@
40#include <linux/serial_core.h> 41#include <linux/serial_core.h>
41#include <linux/efi.h> 42#include <linux/efi.h>
42#include <linux/initrd.h> 43#include <linux/initrd.h>
44#include <linux/platform.h>
45#include <linux/pm.h>
43 46
44#include <asm/ia32.h> 47#include <asm/ia32.h>
45#include <asm/machvec.h> 48#include <asm/machvec.h>
@@ -83,6 +86,13 @@ EXPORT_SYMBOL(io_space);
83unsigned int num_io_spaces; 86unsigned int num_io_spaces;
84 87
85/* 88/*
89 * "flush_icache_range()" needs to know what processor dependent stride size to use
90 * when it makes i-cache(s) coherent with d-caches.
91 */
92#define I_CACHE_STRIDE_SHIFT 5 /* Safest way to go: 32 bytes by 32 bytes */
93unsigned long ia64_i_cache_stride_shift = ~0;
94
95/*
86 * The merge_mask variable needs to be set to (max(iommu_page_size(iommu)) - 1). This 96 * The merge_mask variable needs to be set to (max(iommu_page_size(iommu)) - 1). This
87 * mask specifies a mask of address bits that must be 0 in order for two buffers to be 97 * mask specifies a mask of address bits that must be 0 in order for two buffers to be
88 * mergeable by the I/O MMU (i.e., the end address of the first buffer and the start 98 * mergeable by the I/O MMU (i.e., the end address of the first buffer and the start
@@ -626,6 +636,12 @@ setup_per_cpu_areas (void)
626 /* start_kernel() requires this... */ 636 /* start_kernel() requires this... */
627} 637}
628 638
639/*
640 * Calculate the max. cache line size.
641 *
642 * In addition, the minimum of the i-cache stride sizes is calculated for
643 * "flush_icache_range()".
644 */
629static void 645static void
630get_max_cacheline_size (void) 646get_max_cacheline_size (void)
631{ 647{
@@ -639,6 +655,8 @@ get_max_cacheline_size (void)
639 printk(KERN_ERR "%s: ia64_pal_cache_summary() failed (status=%ld)\n", 655 printk(KERN_ERR "%s: ia64_pal_cache_summary() failed (status=%ld)\n",
640 __FUNCTION__, status); 656 __FUNCTION__, status);
641 max = SMP_CACHE_BYTES; 657 max = SMP_CACHE_BYTES;
658 /* Safest setup for "flush_icache_range()" */
659 ia64_i_cache_stride_shift = I_CACHE_STRIDE_SHIFT;
642 goto out; 660 goto out;
643 } 661 }
644 662
@@ -647,14 +665,31 @@ get_max_cacheline_size (void)
647 &cci); 665 &cci);
648 if (status != 0) { 666 if (status != 0) {
649 printk(KERN_ERR 667 printk(KERN_ERR
650 "%s: ia64_pal_cache_config_info(l=%lu) failed (status=%ld)\n", 668 "%s: ia64_pal_cache_config_info(l=%lu, 2) failed (status=%ld)\n",
651 __FUNCTION__, l, status); 669 __FUNCTION__, l, status);
652 max = SMP_CACHE_BYTES; 670 max = SMP_CACHE_BYTES;
671 /* The safest setup for "flush_icache_range()" */
672 cci.pcci_stride = I_CACHE_STRIDE_SHIFT;
673 cci.pcci_unified = 1;
653 } 674 }
654 line_size = 1 << cci.pcci_line_size; 675 line_size = 1 << cci.pcci_line_size;
655 if (line_size > max) 676 if (line_size > max)
656 max = line_size; 677 max = line_size;
657 } 678 if (!cci.pcci_unified) {
679 status = ia64_pal_cache_config_info(l,
680 /* cache_type (instruction)= */ 1,
681 &cci);
682 if (status != 0) {
683 printk(KERN_ERR
684 "%s: ia64_pal_cache_config_info(l=%lu, 1) failed (status=%ld)\n",
685 __FUNCTION__, l, status);
686 /* The safest setup for "flush_icache_range()" */
687 cci.pcci_stride = I_CACHE_STRIDE_SHIFT;
688 }
689 }
690 if (cci.pcci_stride < ia64_i_cache_stride_shift)
691 ia64_i_cache_stride_shift = cci.pcci_stride;
692 }
658 out: 693 out:
659 if (max > ia64_max_cacheline_size) 694 if (max > ia64_max_cacheline_size)
660 ia64_max_cacheline_size = max; 695 ia64_max_cacheline_size = max;
@@ -783,6 +818,7 @@ cpu_init (void)
783 /* size of physical stacked register partition plus 8 bytes: */ 818 /* size of physical stacked register partition plus 8 bytes: */
784 __get_cpu_var(ia64_phys_stacked_size_p8) = num_phys_stacked*8 + 8; 819 __get_cpu_var(ia64_phys_stacked_size_p8) = num_phys_stacked*8 + 8;
785 platform_cpu_init(); 820 platform_cpu_init();
821 pm_idle = default_idle;
786} 822}
787 823
788void 824void
diff --git a/arch/ia64/kernel/signal.c b/arch/ia64/kernel/signal.c
index b8a0a7d257a9..774f34b675cf 100644
--- a/arch/ia64/kernel/signal.c
+++ b/arch/ia64/kernel/signal.c
@@ -467,15 +467,12 @@ handle_signal (unsigned long sig, struct k_sigaction *ka, siginfo_t *info, sigse
467 if (!setup_frame(sig, ka, info, oldset, scr)) 467 if (!setup_frame(sig, ka, info, oldset, scr))
468 return 0; 468 return 0;
469 469
470 if (!(ka->sa.sa_flags & SA_NODEFER)) { 470 spin_lock_irq(&current->sighand->siglock);
471 spin_lock_irq(&current->sighand->siglock); 471 sigorsets(&current->blocked, &current->blocked, &ka->sa.sa_mask);
472 { 472 if (!(ka->sa.sa_flags & SA_NODEFER))
473 sigorsets(&current->blocked, &current->blocked, &ka->sa.sa_mask); 473 sigaddset(&current->blocked, sig);
474 sigaddset(&current->blocked, sig); 474 recalc_sigpending();
475 recalc_sigpending(); 475 spin_unlock_irq(&current->sighand->siglock);
476 }
477 spin_unlock_irq(&current->sighand->siglock);
478 }
479 return 1; 476 return 1;
480} 477}
481 478
diff --git a/arch/ia64/kernel/sys_ia64.c b/arch/ia64/kernel/sys_ia64.c
index 770fab37928e..f2dbcd1db0d4 100644
--- a/arch/ia64/kernel/sys_ia64.c
+++ b/arch/ia64/kernel/sys_ia64.c
@@ -35,7 +35,7 @@ arch_get_unmapped_area (struct file *filp, unsigned long addr, unsigned long len
35 return -ENOMEM; 35 return -ENOMEM;
36 36
37#ifdef CONFIG_HUGETLB_PAGE 37#ifdef CONFIG_HUGETLB_PAGE
38 if (REGION_NUMBER(addr) == REGION_HPAGE) 38 if (REGION_NUMBER(addr) == RGN_HPAGE)
39 addr = 0; 39 addr = 0;
40#endif 40#endif
41 if (!addr) 41 if (!addr)
diff --git a/arch/ia64/kernel/topology.c b/arch/ia64/kernel/topology.c
index f1aafd4c05f9..92ff46ad21e2 100644
--- a/arch/ia64/kernel/topology.c
+++ b/arch/ia64/kernel/topology.c
@@ -36,6 +36,15 @@ int arch_register_cpu(int num)
36 parent = &sysfs_nodes[cpu_to_node(num)]; 36 parent = &sysfs_nodes[cpu_to_node(num)];
37#endif /* CONFIG_NUMA */ 37#endif /* CONFIG_NUMA */
38 38
39#ifdef CONFIG_ACPI_BOOT
40 /*
41 * If CPEI cannot be re-targetted, and this is
42 * CPEI target, then dont create the control file
43 */
44 if (!can_cpei_retarget() && is_cpu_cpei_target(num))
45 sysfs_cpus[num].cpu.no_control = 1;
46#endif
47
39 return register_cpu(&sysfs_cpus[num].cpu, num, parent); 48 return register_cpu(&sysfs_cpus[num].cpu, num, parent);
40} 49}
41 50
diff --git a/arch/ia64/kernel/uncached.c b/arch/ia64/kernel/uncached.c
index 490dfc9ab47f..4e9d06c48a8b 100644
--- a/arch/ia64/kernel/uncached.c
+++ b/arch/ia64/kernel/uncached.c
@@ -184,7 +184,7 @@ uncached_free_page(unsigned long maddr)
184{ 184{
185 int node; 185 int node;
186 186
187 node = nasid_to_cnodeid(NASID_GET(maddr)); 187 node = paddr_to_nid(maddr - __IA64_UNCACHED_OFFSET);
188 188
189 dprintk(KERN_DEBUG "uncached_free_page(%lx) on node %i\n", maddr, node); 189 dprintk(KERN_DEBUG "uncached_free_page(%lx) on node %i\n", maddr, node);
190 190
@@ -217,7 +217,7 @@ uncached_build_memmap(unsigned long start, unsigned long end, void *arg)
217 217
218 memset((char *)vstart, 0, length); 218 memset((char *)vstart, 0, length);
219 219
220 node = nasid_to_cnodeid(NASID_GET(start)); 220 node = paddr_to_nid(start);
221 221
222 for (; vstart < vend ; vstart += PAGE_SIZE) { 222 for (; vstart < vend ; vstart += PAGE_SIZE) {
223 dprintk(KERN_INFO "sticking %lx into the pool!\n", vstart); 223 dprintk(KERN_INFO "sticking %lx into the pool!\n", vstart);
diff --git a/arch/ia64/kernel/unwind.c b/arch/ia64/kernel/unwind.c
index 2776a074c6f1..3288be47bc75 100644
--- a/arch/ia64/kernel/unwind.c
+++ b/arch/ia64/kernel/unwind.c
@@ -362,7 +362,7 @@ unw_access_gr (struct unw_frame_info *info, int regnum, unsigned long *val, char
362 if (info->pri_unat_loc) 362 if (info->pri_unat_loc)
363 nat_addr = info->pri_unat_loc; 363 nat_addr = info->pri_unat_loc;
364 else 364 else
365 nat_addr = &info->sw->ar_unat; 365 nat_addr = &info->sw->caller_unat;
366 nat_mask = (1UL << ((long) addr & 0x1f8)/8); 366 nat_mask = (1UL << ((long) addr & 0x1f8)/8);
367 } 367 }
368 } else { 368 } else {
@@ -524,7 +524,7 @@ unw_access_ar (struct unw_frame_info *info, int regnum, unsigned long *val, int
524 case UNW_AR_UNAT: 524 case UNW_AR_UNAT:
525 addr = info->unat_loc; 525 addr = info->unat_loc;
526 if (!addr) 526 if (!addr)
527 addr = &info->sw->ar_unat; 527 addr = &info->sw->caller_unat;
528 break; 528 break;
529 529
530 case UNW_AR_LC: 530 case UNW_AR_LC:
@@ -1775,7 +1775,7 @@ run_script (struct unw_script *script, struct unw_frame_info *state)
1775 1775
1776 case UNW_INSN_SETNAT_MEMSTK: 1776 case UNW_INSN_SETNAT_MEMSTK:
1777 if (!state->pri_unat_loc) 1777 if (!state->pri_unat_loc)
1778 state->pri_unat_loc = &state->sw->ar_unat; 1778 state->pri_unat_loc = &state->sw->caller_unat;
1779 /* register off. is a multiple of 8, so the least 3 bits (type) are 0 */ 1779 /* register off. is a multiple of 8, so the least 3 bits (type) are 0 */
1780 s[dst+1] = ((unsigned long) state->pri_unat_loc - s[dst]) | UNW_NAT_MEMSTK; 1780 s[dst+1] = ((unsigned long) state->pri_unat_loc - s[dst]) | UNW_NAT_MEMSTK;
1781 break; 1781 break;
@@ -2243,11 +2243,11 @@ unw_init (void)
2243 if (8*sizeof(unw_hash_index_t) < UNW_LOG_HASH_SIZE) 2243 if (8*sizeof(unw_hash_index_t) < UNW_LOG_HASH_SIZE)
2244 unw_hash_index_t_is_too_narrow(); 2244 unw_hash_index_t_is_too_narrow();
2245 2245
2246 unw.sw_off[unw.preg_index[UNW_REG_PRI_UNAT_GR]] = SW(AR_UNAT); 2246 unw.sw_off[unw.preg_index[UNW_REG_PRI_UNAT_GR]] = SW(CALLER_UNAT);
2247 unw.sw_off[unw.preg_index[UNW_REG_BSPSTORE]] = SW(AR_BSPSTORE); 2247 unw.sw_off[unw.preg_index[UNW_REG_BSPSTORE]] = SW(AR_BSPSTORE);
2248 unw.sw_off[unw.preg_index[UNW_REG_PFS]] = SW(AR_UNAT); 2248 unw.sw_off[unw.preg_index[UNW_REG_PFS]] = SW(AR_PFS);
2249 unw.sw_off[unw.preg_index[UNW_REG_RP]] = SW(B0); 2249 unw.sw_off[unw.preg_index[UNW_REG_RP]] = SW(B0);
2250 unw.sw_off[unw.preg_index[UNW_REG_UNAT]] = SW(AR_UNAT); 2250 unw.sw_off[unw.preg_index[UNW_REG_UNAT]] = SW(CALLER_UNAT);
2251 unw.sw_off[unw.preg_index[UNW_REG_PR]] = SW(PR); 2251 unw.sw_off[unw.preg_index[UNW_REG_PR]] = SW(PR);
2252 unw.sw_off[unw.preg_index[UNW_REG_LC]] = SW(AR_LC); 2252 unw.sw_off[unw.preg_index[UNW_REG_LC]] = SW(AR_LC);
2253 unw.sw_off[unw.preg_index[UNW_REG_FPSR]] = SW(AR_FPSR); 2253 unw.sw_off[unw.preg_index[UNW_REG_FPSR]] = SW(AR_FPSR);
diff --git a/arch/ia64/lib/Makefile b/arch/ia64/lib/Makefile
index 1902c3c2ef92..799407e7726f 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 copy_page.o \ 9 bitop.o 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 swiotlb.o 12 memset.o strlen.o swiotlb.o
diff --git a/arch/ia64/lib/flush.S b/arch/ia64/lib/flush.S
index a1af9146cfdb..3e2cfa2c6d39 100644
--- a/arch/ia64/lib/flush.S
+++ b/arch/ia64/lib/flush.S
@@ -3,37 +3,59 @@
3 * 3 *
4 * Copyright (C) 1999-2001, 2005 Hewlett-Packard Co 4 * Copyright (C) 1999-2001, 2005 Hewlett-Packard Co
5 * David Mosberger-Tang <davidm@hpl.hp.com> 5 * David Mosberger-Tang <davidm@hpl.hp.com>
6 *
7 * 05/28/05 Zoltan Menyhart Dynamic stride size
6 */ 8 */
9
7#include <asm/asmmacro.h> 10#include <asm/asmmacro.h>
8#include <asm/page.h> 11
9 12
10 /* 13 /*
11 * flush_icache_range(start,end) 14 * flush_icache_range(start,end)
12 * Must flush range from start to end-1 but nothing else (need to 15 *
16 * Make i-cache(s) coherent with d-caches.
17 *
18 * Must deal with range from start to end-1 but nothing else (need to
13 * be careful not to touch addresses that may be unmapped). 19 * be careful not to touch addresses that may be unmapped).
20 *
21 * Note: "in0" and "in1" are preserved for debugging purposes.
14 */ 22 */
15GLOBAL_ENTRY(flush_icache_range) 23GLOBAL_ENTRY(flush_icache_range)
24
16 .prologue 25 .prologue
17 alloc r2=ar.pfs,2,0,0,0 26 alloc r2=ar.pfs,2,0,0,0
18 sub r8=in1,in0,1 27 movl r3=ia64_i_cache_stride_shift
28 mov r21=1
29 ;;
30 ld8 r20=[r3] // r20: stride shift
31 sub r22=in1,r0,1 // last byte address
19 ;; 32 ;;
20 shr.u r8=r8,5 // we flush 32 bytes per iteration 33 shr.u r23=in0,r20 // start / (stride size)
21 .save ar.lc, r3 34 shr.u r22=r22,r20 // (last byte address) / (stride size)
22 mov r3=ar.lc // save ar.lc 35 shl r21=r21,r20 // r21: stride size of the i-cache(s)
36 ;;
37 sub r8=r22,r23 // number of strides - 1
38 shl r24=r23,r20 // r24: addresses for "fc.i" =
39 // "start" rounded down to stride boundary
40 .save ar.lc,r3
41 mov r3=ar.lc // save ar.lc
23 ;; 42 ;;
24 43
25 .body 44 .body
26 45 mov ar.lc=r8
27 mov ar.lc=r8
28 ;; 46 ;;
29.Loop: fc.i in0 // issuable on M2 only 47 /*
30 add in0=32,in0 48 * 32 byte aligned loop, even number of (actually 2) bundles
49 */
50.Loop: fc.i r24 // issuable on M0 only
51 add r24=r21,r24 // we flush "stride size" bytes per iteration
52 nop.i 0
31 br.cloop.sptk.few .Loop 53 br.cloop.sptk.few .Loop
32 ;; 54 ;;
33 sync.i 55 sync.i
34 ;; 56 ;;
35 srlz.i 57 srlz.i
36 ;; 58 ;;
37 mov ar.lc=r3 // restore ar.lc 59 mov ar.lc=r3 // restore ar.lc
38 br.ret.sptk.many rp 60 br.ret.sptk.many rp
39END(flush_icache_range) 61END(flush_icache_range)
diff --git a/arch/ia64/lib/swiotlb.c b/arch/ia64/lib/swiotlb.c
index ab7b3ad99a7f..dbc0b3e449c5 100644
--- a/arch/ia64/lib/swiotlb.c
+++ b/arch/ia64/lib/swiotlb.c
@@ -93,8 +93,7 @@ static int __init
93setup_io_tlb_npages(char *str) 93setup_io_tlb_npages(char *str)
94{ 94{
95 if (isdigit(*str)) { 95 if (isdigit(*str)) {
96 io_tlb_nslabs = simple_strtoul(str, &str, 0) << 96 io_tlb_nslabs = simple_strtoul(str, &str, 0);
97 (PAGE_SHIFT - IO_TLB_SHIFT);
98 /* avoid tail segment of size < IO_TLB_SEGSIZE */ 97 /* avoid tail segment of size < IO_TLB_SEGSIZE */
99 io_tlb_nslabs = ALIGN(io_tlb_nslabs, IO_TLB_SEGSIZE); 98 io_tlb_nslabs = ALIGN(io_tlb_nslabs, IO_TLB_SEGSIZE);
100 } 99 }
@@ -117,7 +116,7 @@ swiotlb_init_with_default_size (size_t default_size)
117 unsigned long i; 116 unsigned long i;
118 117
119 if (!io_tlb_nslabs) { 118 if (!io_tlb_nslabs) {
120 io_tlb_nslabs = (default_size >> PAGE_SHIFT); 119 io_tlb_nslabs = (default_size >> IO_TLB_SHIFT);
121 io_tlb_nslabs = ALIGN(io_tlb_nslabs, IO_TLB_SEGSIZE); 120 io_tlb_nslabs = ALIGN(io_tlb_nslabs, IO_TLB_SEGSIZE);
122 } 121 }
123 122
diff --git a/arch/ia64/mm/hugetlbpage.c b/arch/ia64/mm/hugetlbpage.c
index e0a776a3044c..2d13889d0a99 100644
--- a/arch/ia64/mm/hugetlbpage.c
+++ b/arch/ia64/mm/hugetlbpage.c
@@ -76,7 +76,7 @@ int is_aligned_hugepage_range(unsigned long addr, unsigned long len)
76 return -EINVAL; 76 return -EINVAL;
77 if (addr & ~HPAGE_MASK) 77 if (addr & ~HPAGE_MASK)
78 return -EINVAL; 78 return -EINVAL;
79 if (REGION_NUMBER(addr) != REGION_HPAGE) 79 if (REGION_NUMBER(addr) != RGN_HPAGE)
80 return -EINVAL; 80 return -EINVAL;
81 81
82 return 0; 82 return 0;
@@ -87,7 +87,7 @@ struct page *follow_huge_addr(struct mm_struct *mm, unsigned long addr, int writ
87 struct page *page; 87 struct page *page;
88 pte_t *ptep; 88 pte_t *ptep;
89 89
90 if (REGION_NUMBER(addr) != REGION_HPAGE) 90 if (REGION_NUMBER(addr) != RGN_HPAGE)
91 return ERR_PTR(-EINVAL); 91 return ERR_PTR(-EINVAL);
92 92
93 ptep = huge_pte_offset(mm, addr); 93 ptep = huge_pte_offset(mm, addr);
@@ -142,8 +142,8 @@ unsigned long hugetlb_get_unmapped_area(struct file *file, unsigned long addr, u
142 return -ENOMEM; 142 return -ENOMEM;
143 if (len & ~HPAGE_MASK) 143 if (len & ~HPAGE_MASK)
144 return -EINVAL; 144 return -EINVAL;
145 /* This code assumes that REGION_HPAGE != 0. */ 145 /* This code assumes that RGN_HPAGE != 0. */
146 if ((REGION_NUMBER(addr) != REGION_HPAGE) || (addr & (HPAGE_SIZE - 1))) 146 if ((REGION_NUMBER(addr) != RGN_HPAGE) || (addr & (HPAGE_SIZE - 1)))
147 addr = HPAGE_REGION_BASE; 147 addr = HPAGE_REGION_BASE;
148 else 148 else
149 addr = ALIGN(addr, HPAGE_SIZE); 149 addr = ALIGN(addr, HPAGE_SIZE);
diff --git a/arch/ia64/pci/pci.c b/arch/ia64/pci/pci.c
index 720a861f88be..9977c122e9fa 100644
--- a/arch/ia64/pci/pci.c
+++ b/arch/ia64/pci/pci.c
@@ -24,7 +24,6 @@
24 24
25#include <asm/machvec.h> 25#include <asm/machvec.h>
26#include <asm/page.h> 26#include <asm/page.h>
27#include <asm/segment.h>
28#include <asm/system.h> 27#include <asm/system.h>
29#include <asm/io.h> 28#include <asm/io.h>
30#include <asm/sal.h> 29#include <asm/sal.h>
@@ -157,6 +156,7 @@ alloc_pci_controller (int seg)
157 156
158 memset(controller, 0, sizeof(*controller)); 157 memset(controller, 0, sizeof(*controller));
159 controller->segment = seg; 158 controller->segment = seg;
159 controller->node = -1;
160 return controller; 160 return controller;
161} 161}
162 162
@@ -288,6 +288,7 @@ pci_acpi_scan_root(struct acpi_device *device, int domain, int bus)
288 unsigned int windows = 0; 288 unsigned int windows = 0;
289 struct pci_bus *pbus; 289 struct pci_bus *pbus;
290 char *name; 290 char *name;
291 int pxm;
291 292
292 controller = alloc_pci_controller(domain); 293 controller = alloc_pci_controller(domain);
293 if (!controller) 294 if (!controller)
@@ -295,10 +296,16 @@ pci_acpi_scan_root(struct acpi_device *device, int domain, int bus)
295 296
296 controller->acpi_handle = device->handle; 297 controller->acpi_handle = device->handle;
297 298
299 pxm = acpi_get_pxm(controller->acpi_handle);
300#ifdef CONFIG_NUMA
301 if (pxm >= 0)
302 controller->node = pxm_to_nid_map[pxm];
303#endif
304
298 acpi_walk_resources(device->handle, METHOD_NAME__CRS, count_window, 305 acpi_walk_resources(device->handle, METHOD_NAME__CRS, count_window,
299 &windows); 306 &windows);
300 controller->window = kmalloc(sizeof(*controller->window) * windows, 307 controller->window = kmalloc_node(sizeof(*controller->window) * windows,
301 GFP_KERNEL); 308 GFP_KERNEL, controller->node);
302 if (!controller->window) 309 if (!controller->window)
303 goto out2; 310 goto out2;
304 311
@@ -372,6 +379,7 @@ void pcibios_bus_to_resource(struct pci_dev *dev,
372 res->start = region->start + offset; 379 res->start = region->start + offset;
373 res->end = region->end + offset; 380 res->end = region->end + offset;
374} 381}
382EXPORT_SYMBOL(pcibios_bus_to_resource);
375 383
376static int __devinit is_valid_resource(struct pci_dev *dev, int idx) 384static int __devinit is_valid_resource(struct pci_dev *dev, int idx)
377{ 385{
diff --git a/arch/ia64/sn/include/tio.h b/arch/ia64/sn/include/tio.h
index 0139124dd54a..6b2e7b75eb19 100644
--- a/arch/ia64/sn/include/tio.h
+++ b/arch/ia64/sn/include/tio.h
@@ -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) 2000-2004 Silicon Graphics, Inc. All rights reserved. 6 * Copyright (C) 2000-2005 Silicon Graphics, Inc. All rights reserved.
7 */ 7 */
8 8
9#ifndef _ASM_IA64_SN_TIO_H 9#ifndef _ASM_IA64_SN_TIO_H
@@ -26,6 +26,10 @@
26#define TIO_ITTE_VALID_MASK 0x1 26#define TIO_ITTE_VALID_MASK 0x1
27#define TIO_ITTE_VALID_SHIFT 16 27#define TIO_ITTE_VALID_SHIFT 16
28 28
29#define TIO_ITTE_WIDGET(itte) \
30 (((itte) >> TIO_ITTE_WIDGET_SHIFT) & TIO_ITTE_WIDGET_MASK)
31#define TIO_ITTE_VALID(itte) \
32 (((itte) >> TIO_ITTE_VALID_SHIFT) & TIO_ITTE_VALID_MASK)
29 33
30#define TIO_ITTE_PUT(nasid, bigwin, widget, addr, valid) \ 34#define TIO_ITTE_PUT(nasid, bigwin, widget, addr, valid) \
31 REMOTE_HUB_S((nasid), TIO_ITTE(bigwin), \ 35 REMOTE_HUB_S((nasid), TIO_ITTE(bigwin), \
diff --git a/arch/ia64/sn/include/xtalk/hubdev.h b/arch/ia64/sn/include/xtalk/hubdev.h
index 580a1c0403a7..71c2b271b4c6 100644
--- a/arch/ia64/sn/include/xtalk/hubdev.h
+++ b/arch/ia64/sn/include/xtalk/hubdev.h
@@ -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) 1992 - 1997, 2000-2004 Silicon Graphics, Inc. All rights reserved. 6 * Copyright (C) 1992 - 1997, 2000-2005 Silicon Graphics, Inc. All rights reserved.
7 */ 7 */
8#ifndef _ASM_IA64_SN_XTALK_HUBDEV_H 8#ifndef _ASM_IA64_SN_XTALK_HUBDEV_H
9#define _ASM_IA64_SN_XTALK_HUBDEV_H 9#define _ASM_IA64_SN_XTALK_HUBDEV_H
@@ -16,6 +16,9 @@
16#define IIO_ITTE_WIDGET_MASK ((1<<IIO_ITTE_WIDGET_BITS)-1) 16#define IIO_ITTE_WIDGET_MASK ((1<<IIO_ITTE_WIDGET_BITS)-1)
17#define IIO_ITTE_WIDGET_SHIFT 8 17#define IIO_ITTE_WIDGET_SHIFT 8
18 18
19#define IIO_ITTE_WIDGET(itte) \
20 (((itte) >> IIO_ITTE_WIDGET_SHIFT) & IIO_ITTE_WIDGET_MASK)
21
19/* 22/*
20 * Use the top big window as a surrogate for the first small window 23 * Use the top big window as a surrogate for the first small window
21 */ 24 */
@@ -34,7 +37,8 @@ struct sn_flush_device_list {
34 unsigned long sfdl_force_int_addr; 37 unsigned long sfdl_force_int_addr;
35 unsigned long sfdl_flush_value; 38 unsigned long sfdl_flush_value;
36 volatile unsigned long *sfdl_flush_addr; 39 volatile unsigned long *sfdl_flush_addr;
37 uint64_t sfdl_persistent_busnum; 40 uint32_t sfdl_persistent_busnum;
41 uint32_t sfdl_persistent_segment;
38 struct pcibus_info *sfdl_pcibus_info; 42 struct pcibus_info *sfdl_pcibus_info;
39 spinlock_t sfdl_flush_lock; 43 spinlock_t sfdl_flush_lock;
40}; 44};
@@ -58,7 +62,8 @@ struct hubdev_info {
58 62
59 void *hdi_nodepda; 63 void *hdi_nodepda;
60 void *hdi_node_vertex; 64 void *hdi_node_vertex;
61 void *hdi_xtalk_vertex; 65 uint32_t max_segment_number;
66 uint32_t max_pcibus_number;
62}; 67};
63 68
64extern void hubdev_init_node(nodepda_t *, cnodeid_t); 69extern void hubdev_init_node(nodepda_t *, cnodeid_t);
diff --git a/arch/ia64/sn/kernel/bte.c b/arch/ia64/sn/kernel/bte.c
index 647deae9bfcd..45854c637e9c 100644
--- a/arch/ia64/sn/kernel/bte.c
+++ b/arch/ia64/sn/kernel/bte.c
@@ -29,16 +29,30 @@
29 29
30/* two interfaces on two btes */ 30/* two interfaces on two btes */
31#define MAX_INTERFACES_TO_TRY 4 31#define MAX_INTERFACES_TO_TRY 4
32#define MAX_NODES_TO_TRY 2
32 33
33static struct bteinfo_s *bte_if_on_node(nasid_t nasid, int interface) 34static struct bteinfo_s *bte_if_on_node(nasid_t nasid, int interface)
34{ 35{
35 nodepda_t *tmp_nodepda; 36 nodepda_t *tmp_nodepda;
36 37
38 if (nasid_to_cnodeid(nasid) == -1)
39 return (struct bteinfo_s *)NULL;;
40
37 tmp_nodepda = NODEPDA(nasid_to_cnodeid(nasid)); 41 tmp_nodepda = NODEPDA(nasid_to_cnodeid(nasid));
38 return &tmp_nodepda->bte_if[interface]; 42 return &tmp_nodepda->bte_if[interface];
39 43
40} 44}
41 45
46static inline void bte_start_transfer(struct bteinfo_s *bte, u64 len, u64 mode)
47{
48 if (is_shub2()) {
49 BTE_CTRL_STORE(bte, (IBLS_BUSY | ((len) | (mode) << 24)));
50 } else {
51 BTE_LNSTAT_STORE(bte, len);
52 BTE_CTRL_STORE(bte, mode);
53 }
54}
55
42/************************************************************************ 56/************************************************************************
43 * Block Transfer Engine copy related functions. 57 * Block Transfer Engine copy related functions.
44 * 58 *
@@ -67,13 +81,15 @@ bte_result_t bte_copy(u64 src, u64 dest, u64 len, u64 mode, void *notification)
67{ 81{
68 u64 transfer_size; 82 u64 transfer_size;
69 u64 transfer_stat; 83 u64 transfer_stat;
84 u64 notif_phys_addr;
70 struct bteinfo_s *bte; 85 struct bteinfo_s *bte;
71 bte_result_t bte_status; 86 bte_result_t bte_status;
72 unsigned long irq_flags; 87 unsigned long irq_flags;
73 unsigned long itc_end = 0; 88 unsigned long itc_end = 0;
74 struct bteinfo_s *btes_to_try[MAX_INTERFACES_TO_TRY]; 89 int nasid_to_try[MAX_NODES_TO_TRY];
75 int bte_if_index; 90 int my_nasid = get_nasid();
76 int bte_pri, bte_sec; 91 int bte_if_index, nasid_index;
92 int bte_first, btes_per_node = BTES_PER_NODE;
77 93
78 BTE_PRINTK(("bte_copy(0x%lx, 0x%lx, 0x%lx, 0x%lx, 0x%p)\n", 94 BTE_PRINTK(("bte_copy(0x%lx, 0x%lx, 0x%lx, 0x%lx, 0x%p)\n",
79 src, dest, len, mode, notification)); 95 src, dest, len, mode, notification));
@@ -86,36 +102,26 @@ bte_result_t bte_copy(u64 src, u64 dest, u64 len, u64 mode, void *notification)
86 (src & L1_CACHE_MASK) || (dest & L1_CACHE_MASK)); 102 (src & L1_CACHE_MASK) || (dest & L1_CACHE_MASK));
87 BUG_ON(!(len < ((BTE_LEN_MASK + 1) << L1_CACHE_SHIFT))); 103 BUG_ON(!(len < ((BTE_LEN_MASK + 1) << L1_CACHE_SHIFT)));
88 104
89 /* CPU 0 (per node) tries bte0 first, CPU 1 try bte1 first */ 105 /*
90 if (cpuid_to_subnode(smp_processor_id()) == 0) { 106 * Start with interface corresponding to cpu number
91 bte_pri = 0; 107 */
92 bte_sec = 1; 108 bte_first = raw_smp_processor_id() % btes_per_node;
93 } else {
94 bte_pri = 1;
95 bte_sec = 0;
96 }
97 109
98 if (mode & BTE_USE_DEST) { 110 if (mode & BTE_USE_DEST) {
99 /* try remote then local */ 111 /* try remote then local */
100 btes_to_try[0] = bte_if_on_node(NASID_GET(dest), bte_pri); 112 nasid_to_try[0] = NASID_GET(dest);
101 btes_to_try[1] = bte_if_on_node(NASID_GET(dest), bte_sec);
102 if (mode & BTE_USE_ANY) { 113 if (mode & BTE_USE_ANY) {
103 btes_to_try[2] = bte_if_on_node(get_nasid(), bte_pri); 114 nasid_to_try[1] = my_nasid;
104 btes_to_try[3] = bte_if_on_node(get_nasid(), bte_sec);
105 } else { 115 } else {
106 btes_to_try[2] = NULL; 116 nasid_to_try[1] = (int)NULL;
107 btes_to_try[3] = NULL;
108 } 117 }
109 } else { 118 } else {
110 /* try local then remote */ 119 /* try local then remote */
111 btes_to_try[0] = bte_if_on_node(get_nasid(), bte_pri); 120 nasid_to_try[0] = my_nasid;
112 btes_to_try[1] = bte_if_on_node(get_nasid(), bte_sec);
113 if (mode & BTE_USE_ANY) { 121 if (mode & BTE_USE_ANY) {
114 btes_to_try[2] = bte_if_on_node(NASID_GET(dest), bte_pri); 122 nasid_to_try[1] = NASID_GET(dest);
115 btes_to_try[3] = bte_if_on_node(NASID_GET(dest), bte_sec);
116 } else { 123 } else {
117 btes_to_try[2] = NULL; 124 nasid_to_try[1] = (int)NULL;
118 btes_to_try[3] = NULL;
119 } 125 }
120 } 126 }
121 127
@@ -123,11 +129,12 @@ retry_bteop:
123 do { 129 do {
124 local_irq_save(irq_flags); 130 local_irq_save(irq_flags);
125 131
126 bte_if_index = 0; 132 bte_if_index = bte_first;
133 nasid_index = 0;
127 134
128 /* Attempt to lock one of the BTE interfaces. */ 135 /* Attempt to lock one of the BTE interfaces. */
129 while (bte_if_index < MAX_INTERFACES_TO_TRY) { 136 while (nasid_index < MAX_NODES_TO_TRY) {
130 bte = btes_to_try[bte_if_index++]; 137 bte = bte_if_on_node(nasid_to_try[nasid_index],bte_if_index);
131 138
132 if (bte == NULL) { 139 if (bte == NULL) {
133 continue; 140 continue;
@@ -143,6 +150,15 @@ retry_bteop:
143 break; 150 break;
144 } 151 }
145 } 152 }
153
154 bte_if_index = (bte_if_index + 1) % btes_per_node; /* Next interface */
155 if (bte_if_index == bte_first) {
156 /*
157 * We've tried all interfaces on this node
158 */
159 nasid_index++;
160 }
161
146 bte = NULL; 162 bte = NULL;
147 } 163 }
148 164
@@ -169,7 +185,13 @@ retry_bteop:
169 185
170 /* Initialize the notification to a known value. */ 186 /* Initialize the notification to a known value. */
171 *bte->most_rcnt_na = BTE_WORD_BUSY; 187 *bte->most_rcnt_na = BTE_WORD_BUSY;
188 notif_phys_addr = TO_PHYS(ia64_tpa((unsigned long)bte->most_rcnt_na));
172 189
190 if (is_shub2()) {
191 src = SH2_TIO_PHYS_TO_DMA(src);
192 dest = SH2_TIO_PHYS_TO_DMA(dest);
193 notif_phys_addr = SH2_TIO_PHYS_TO_DMA(notif_phys_addr);
194 }
173 /* Set the source and destination registers */ 195 /* Set the source and destination registers */
174 BTE_PRINTKV(("IBSA = 0x%lx)\n", (TO_PHYS(src)))); 196 BTE_PRINTKV(("IBSA = 0x%lx)\n", (TO_PHYS(src))));
175 BTE_SRC_STORE(bte, TO_PHYS(src)); 197 BTE_SRC_STORE(bte, TO_PHYS(src));
@@ -177,14 +199,12 @@ retry_bteop:
177 BTE_DEST_STORE(bte, TO_PHYS(dest)); 199 BTE_DEST_STORE(bte, TO_PHYS(dest));
178 200
179 /* Set the notification register */ 201 /* Set the notification register */
180 BTE_PRINTKV(("IBNA = 0x%lx)\n", 202 BTE_PRINTKV(("IBNA = 0x%lx)\n", notif_phys_addr));
181 TO_PHYS(ia64_tpa((unsigned long)bte->most_rcnt_na)))); 203 BTE_NOTIF_STORE(bte, notif_phys_addr);
182 BTE_NOTIF_STORE(bte,
183 TO_PHYS(ia64_tpa((unsigned long)bte->most_rcnt_na)));
184 204
185 /* Initiate the transfer */ 205 /* Initiate the transfer */
186 BTE_PRINTK(("IBCT = 0x%lx)\n", BTE_VALID_MODE(mode))); 206 BTE_PRINTK(("IBCT = 0x%lx)\n", BTE_VALID_MODE(mode)));
187 BTE_START_TRANSFER(bte, transfer_size, BTE_VALID_MODE(mode)); 207 bte_start_transfer(bte, transfer_size, BTE_VALID_MODE(mode));
188 208
189 itc_end = ia64_get_itc() + (40000000 * local_cpu_data->cyc_per_usec); 209 itc_end = ia64_get_itc() + (40000000 * local_cpu_data->cyc_per_usec);
190 210
@@ -195,6 +215,7 @@ retry_bteop:
195 } 215 }
196 216
197 while ((transfer_stat = *bte->most_rcnt_na) == BTE_WORD_BUSY) { 217 while ((transfer_stat = *bte->most_rcnt_na) == BTE_WORD_BUSY) {
218 cpu_relax();
198 if (ia64_get_itc() > itc_end) { 219 if (ia64_get_itc() > itc_end) {
199 BTE_PRINTK(("BTE timeout nasid 0x%x bte%d IBLS = 0x%lx na 0x%lx\n", 220 BTE_PRINTK(("BTE timeout nasid 0x%x bte%d IBLS = 0x%lx na 0x%lx\n",
200 NASID_GET(bte->bte_base_addr), bte->bte_num, 221 NASID_GET(bte->bte_base_addr), bte->bte_num,
diff --git a/arch/ia64/sn/kernel/huberror.c b/arch/ia64/sn/kernel/huberror.c
index 5c39b43ba3c0..5c5eb01c50f0 100644
--- a/arch/ia64/sn/kernel/huberror.c
+++ b/arch/ia64/sn/kernel/huberror.c
@@ -76,7 +76,7 @@ void hubiio_crb_free(struct hubdev_info *hubdev_info, int crbnum)
76 */ 76 */
77 REMOTE_HUB_S(hubdev_info->hdi_nasid, IIO_ICDR, (IIO_ICDR_PND | crbnum)); 77 REMOTE_HUB_S(hubdev_info->hdi_nasid, IIO_ICDR, (IIO_ICDR_PND | crbnum));
78 while (REMOTE_HUB_L(hubdev_info->hdi_nasid, IIO_ICDR) & IIO_ICDR_PND) 78 while (REMOTE_HUB_L(hubdev_info->hdi_nasid, IIO_ICDR) & IIO_ICDR_PND)
79 udelay(1); 79 cpu_relax();
80 80
81} 81}
82 82
diff --git a/arch/ia64/sn/kernel/io_init.c b/arch/ia64/sn/kernel/io_init.c
index a67f39e448cb..4564ed0b5ff3 100644
--- a/arch/ia64/sn/kernel/io_init.c
+++ b/arch/ia64/sn/kernel/io_init.c
@@ -18,6 +18,7 @@
18#include <asm/sn/simulator.h> 18#include <asm/sn/simulator.h>
19#include <asm/sn/sn_sal.h> 19#include <asm/sn/sn_sal.h>
20#include <asm/sn/tioca_provider.h> 20#include <asm/sn/tioca_provider.h>
21#include <asm/sn/tioce_provider.h>
21#include "xtalk/hubdev.h" 22#include "xtalk/hubdev.h"
22#include "xtalk/xwidgetdev.h" 23#include "xtalk/xwidgetdev.h"
23 24
@@ -44,6 +45,9 @@ int sn_ioif_inited = 0; /* SN I/O infrastructure initialized? */
44 45
45struct sn_pcibus_provider *sn_pci_provider[PCIIO_ASIC_MAX_TYPES]; /* indexed by asic type */ 46struct sn_pcibus_provider *sn_pci_provider[PCIIO_ASIC_MAX_TYPES]; /* indexed by asic type */
46 47
48static int max_segment_number = 0; /* Default highest segment number */
49static int max_pcibus_number = 255; /* Default highest pci bus number */
50
47/* 51/*
48 * Hooks and struct for unsupported pci providers 52 * Hooks and struct for unsupported pci providers
49 */ 53 */
@@ -61,7 +65,7 @@ sn_default_pci_unmap(struct pci_dev *pdev, dma_addr_t addr, int direction)
61} 65}
62 66
63static void * 67static void *
64sn_default_pci_bus_fixup(struct pcibus_bussoft *soft) 68sn_default_pci_bus_fixup(struct pcibus_bussoft *soft, struct pci_controller *controller)
65{ 69{
66 return NULL; 70 return NULL;
67} 71}
@@ -157,13 +161,28 @@ static void sn_fixup_ionodes(void)
157 uint64_t nasid; 161 uint64_t nasid;
158 int i, widget; 162 int i, widget;
159 163
164 /*
165 * Get SGI Specific HUB chipset information.
166 * Inform Prom that this kernel can support domain bus numbering.
167 */
160 for (i = 0; i < numionodes; i++) { 168 for (i = 0; i < numionodes; i++) {
161 hubdev = (struct hubdev_info *)(NODEPDA(i)->pdinfo); 169 hubdev = (struct hubdev_info *)(NODEPDA(i)->pdinfo);
162 nasid = cnodeid_to_nasid(i); 170 nasid = cnodeid_to_nasid(i);
171 hubdev->max_segment_number = 0xffffffff;
172 hubdev->max_pcibus_number = 0xff;
163 status = sal_get_hubdev_info(nasid, (uint64_t) __pa(hubdev)); 173 status = sal_get_hubdev_info(nasid, (uint64_t) __pa(hubdev));
164 if (status) 174 if (status)
165 continue; 175 continue;
166 176
177 /* Save the largest Domain and pcibus numbers found. */
178 if (hubdev->max_segment_number) {
179 /*
180 * Dealing with a Prom that supports segments.
181 */
182 max_segment_number = hubdev->max_segment_number;
183 max_pcibus_number = hubdev->max_pcibus_number;
184 }
185
167 /* Attach the error interrupt handlers */ 186 /* Attach the error interrupt handlers */
168 if (nasid & 1) 187 if (nasid & 1)
169 ice_error_init(hubdev); 188 ice_error_init(hubdev);
@@ -203,6 +222,7 @@ static void sn_fixup_ionodes(void)
203 continue; 222 continue;
204 } 223 }
205 224
225 spin_lock_init(&sn_flush_device_list->sfdl_flush_lock);
206 hubdev->hdi_flush_nasid_list.widget_p[widget] = 226 hubdev->hdi_flush_nasid_list.widget_p[widget] =
207 sn_flush_device_list; 227 sn_flush_device_list;
208 } 228 }
@@ -229,7 +249,7 @@ void sn_pci_unfixup_slot(struct pci_dev *dev)
229void sn_pci_fixup_slot(struct pci_dev *dev) 249void sn_pci_fixup_slot(struct pci_dev *dev)
230{ 250{
231 int idx; 251 int idx;
232 int segment = 0; 252 int segment = pci_domain_nr(dev->bus);
233 int status = 0; 253 int status = 0;
234 struct pcibus_bussoft *bs; 254 struct pcibus_bussoft *bs;
235 struct pci_bus *host_pci_bus; 255 struct pci_bus *host_pci_bus;
@@ -282,9 +302,9 @@ void sn_pci_fixup_slot(struct pci_dev *dev)
282 * PCI host_pci_dev struct and set up host bus linkages 302 * PCI host_pci_dev struct and set up host bus linkages
283 */ 303 */
284 304
285 bus_no = SN_PCIDEV_INFO(dev)->pdi_slot_host_handle >> 32; 305 bus_no = (SN_PCIDEV_INFO(dev)->pdi_slot_host_handle >> 32) & 0xff;
286 devfn = SN_PCIDEV_INFO(dev)->pdi_slot_host_handle & 0xffffffff; 306 devfn = SN_PCIDEV_INFO(dev)->pdi_slot_host_handle & 0xffffffff;
287 host_pci_bus = pci_find_bus(pci_domain_nr(dev->bus), bus_no); 307 host_pci_bus = pci_find_bus(segment, bus_no);
288 host_pci_dev = pci_get_slot(host_pci_bus, devfn); 308 host_pci_dev = pci_get_slot(host_pci_bus, devfn);
289 309
290 SN_PCIDEV_INFO(dev)->host_pci_dev = host_pci_dev; 310 SN_PCIDEV_INFO(dev)->host_pci_dev = host_pci_dev;
@@ -322,7 +342,7 @@ void sn_pci_controller_fixup(int segment, int busnum, struct pci_bus *bus)
322 struct pci_controller *controller; 342 struct pci_controller *controller;
323 struct pcibus_bussoft *prom_bussoft_ptr; 343 struct pcibus_bussoft *prom_bussoft_ptr;
324 struct hubdev_info *hubdev_info; 344 struct hubdev_info *hubdev_info;
325 void *provider_soft; 345 void *provider_soft = NULL;
326 struct sn_pcibus_provider *provider; 346 struct sn_pcibus_provider *provider;
327 347
328 status = sal_get_pcibus_info((u64) segment, (u64) busnum, 348 status = sal_get_pcibus_info((u64) segment, (u64) busnum,
@@ -332,13 +352,14 @@ void sn_pci_controller_fixup(int segment, int busnum, struct pci_bus *bus)
332 prom_bussoft_ptr = __va(prom_bussoft_ptr); 352 prom_bussoft_ptr = __va(prom_bussoft_ptr);
333 353
334 controller = kcalloc(1,sizeof(struct pci_controller), GFP_KERNEL); 354 controller = kcalloc(1,sizeof(struct pci_controller), GFP_KERNEL);
355 controller->segment = segment;
335 if (!controller) 356 if (!controller)
336 BUG(); 357 BUG();
337 358
338 if (bus == NULL) { 359 if (bus == NULL) {
339 bus = pci_scan_bus(busnum, &pci_root_ops, controller); 360 bus = pci_scan_bus(busnum, &pci_root_ops, controller);
340 if (bus == NULL) 361 if (bus == NULL)
341 return; /* error, or bus already scanned */ 362 goto error_return; /* error, or bus already scanned */
342 bus->sysdata = NULL; 363 bus->sysdata = NULL;
343 } 364 }
344 365
@@ -351,28 +372,30 @@ void sn_pci_controller_fixup(int segment, int busnum, struct pci_bus *bus)
351 */ 372 */
352 373
353 if (prom_bussoft_ptr->bs_asic_type >= PCIIO_ASIC_MAX_TYPES) 374 if (prom_bussoft_ptr->bs_asic_type >= PCIIO_ASIC_MAX_TYPES)
354 return; /* unsupported asic type */ 375 goto error_return; /* unsupported asic type */
355 376
356 if (prom_bussoft_ptr->bs_asic_type == PCIIO_ASIC_TYPE_PPB) 377 if (prom_bussoft_ptr->bs_asic_type == PCIIO_ASIC_TYPE_PPB)
357 goto error_return; /* no further fixup necessary */ 378 goto error_return; /* no further fixup necessary */
358 379
359 provider = sn_pci_provider[prom_bussoft_ptr->bs_asic_type]; 380 provider = sn_pci_provider[prom_bussoft_ptr->bs_asic_type];
360 if (provider == NULL) 381 if (provider == NULL)
361 return; /* no provider registerd for this asic */ 382 goto error_return; /* no provider registerd for this asic */
362 383
363 provider_soft = NULL; 384 bus->sysdata = controller;
364 if (provider->bus_fixup) 385 if (provider->bus_fixup)
365 provider_soft = (*provider->bus_fixup) (prom_bussoft_ptr); 386 provider_soft = (*provider->bus_fixup) (prom_bussoft_ptr, controller);
366 387
367 if (provider_soft == NULL) 388 if (provider_soft == NULL) {
368 return; /* fixup failed or not applicable */ 389 /* fixup failed or not applicable */
390 bus->sysdata = NULL;
391 goto error_return;
392 }
369 393
370 /* 394 /*
371 * Generic bus fixup goes here. Don't reference prom_bussoft_ptr 395 * Generic bus fixup goes here. Don't reference prom_bussoft_ptr
372 * after this point. 396 * after this point.
373 */ 397 */
374 398
375 bus->sysdata = controller;
376 PCI_CONTROLLER(bus)->platform_data = provider_soft; 399 PCI_CONTROLLER(bus)->platform_data = provider_soft;
377 nasid = NASID_GET(SN_PCIBUS_BUSSOFT(bus)->bs_base); 400 nasid = NASID_GET(SN_PCIBUS_BUSSOFT(bus)->bs_base);
378 cnode = nasid_to_cnodeid(nasid); 401 cnode = nasid_to_cnodeid(nasid);
@@ -380,6 +403,22 @@ void sn_pci_controller_fixup(int segment, int busnum, struct pci_bus *bus)
380 SN_PCIBUS_BUSSOFT(bus)->bs_xwidget_info = 403 SN_PCIBUS_BUSSOFT(bus)->bs_xwidget_info =
381 &(hubdev_info->hdi_xwidget_info[SN_PCIBUS_BUSSOFT(bus)->bs_xid]); 404 &(hubdev_info->hdi_xwidget_info[SN_PCIBUS_BUSSOFT(bus)->bs_xid]);
382 405
406 /*
407 * If the node information we obtained during the fixup phase is invalid
408 * then set controller->node to -1 (undetermined)
409 */
410 if (controller->node >= num_online_nodes()) {
411 struct pcibus_bussoft *b = SN_PCIBUS_BUSSOFT(bus);
412
413 printk(KERN_WARNING "Device ASIC=%u XID=%u PBUSNUM=%u"
414 "L_IO=%lx L_MEM=%lx BASE=%lx\n",
415 b->bs_asic_type, b->bs_xid, b->bs_persist_busnum,
416 b->bs_legacy_io, b->bs_legacy_mem, b->bs_base);
417 printk(KERN_WARNING "on node %d but only %d nodes online."
418 "Association set to undetermined.\n",
419 controller->node, num_online_nodes());
420 controller->node = -1;
421 }
383 return; 422 return;
384 423
385error_return: 424error_return:
@@ -426,6 +465,7 @@ sn_sysdata_free_start:
426static int __init sn_pci_init(void) 465static int __init sn_pci_init(void)
427{ 466{
428 int i = 0; 467 int i = 0;
468 int j = 0;
429 struct pci_dev *pci_dev = NULL; 469 struct pci_dev *pci_dev = NULL;
430 extern void sn_init_cpei_timer(void); 470 extern void sn_init_cpei_timer(void);
431#ifdef CONFIG_PROC_FS 471#ifdef CONFIG_PROC_FS
@@ -445,6 +485,7 @@ static int __init sn_pci_init(void)
445 485
446 pcibr_init_provider(); 486 pcibr_init_provider();
447 tioca_init_provider(); 487 tioca_init_provider();
488 tioce_init_provider();
448 489
449 /* 490 /*
450 * This is needed to avoid bounce limit checks in the blk layer 491 * This is needed to avoid bounce limit checks in the blk layer
@@ -460,8 +501,9 @@ static int __init sn_pci_init(void)
460#endif 501#endif
461 502
462 /* busses are not known yet ... */ 503 /* busses are not known yet ... */
463 for (i = 0; i < PCI_BUSES_TO_SCAN; i++) 504 for (i = 0; i <= max_segment_number; i++)
464 sn_pci_controller_fixup(0, i, NULL); 505 for (j = 0; j <= max_pcibus_number; j++)
506 sn_pci_controller_fixup(i, j, NULL);
465 507
466 /* 508 /*
467 * Generic Linux PCI Layer has created the pci_bus and pci_dev 509 * Generic Linux PCI Layer has created the pci_bus and pci_dev
diff --git a/arch/ia64/sn/kernel/irq.c b/arch/ia64/sn/kernel/irq.c
index 84d276a14ecb..9fc74631ba8a 100644
--- a/arch/ia64/sn/kernel/irq.c
+++ b/arch/ia64/sn/kernel/irq.c
@@ -5,7 +5,7 @@
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
6 * for more details. 6 * for more details.
7 * 7 *
8 * Copyright (c) 2000-2004 Silicon Graphics, Inc. All Rights Reserved. 8 * Copyright (c) 2000-2005 Silicon Graphics, Inc. All Rights Reserved.
9 */ 9 */
10 10
11#include <linux/irq.h> 11#include <linux/irq.h>
@@ -76,16 +76,14 @@ static void sn_enable_irq(unsigned int irq)
76 76
77static void sn_ack_irq(unsigned int irq) 77static void sn_ack_irq(unsigned int irq)
78{ 78{
79 uint64_t event_occurred, mask = 0; 79 u64 event_occurred, mask = 0;
80 int nasid;
81 80
82 irq = irq & 0xff; 81 irq = irq & 0xff;
83 nasid = get_nasid();
84 event_occurred = 82 event_occurred =
85 HUB_L((uint64_t *) GLOBAL_MMR_ADDR(nasid, SH_EVENT_OCCURRED)); 83 HUB_L((u64*)LOCAL_MMR_ADDR(SH_EVENT_OCCURRED));
86 mask = event_occurred & SH_ALL_INT_MASK; 84 mask = event_occurred & SH_ALL_INT_MASK;
87 HUB_S((uint64_t *) GLOBAL_MMR_ADDR(nasid, SH_EVENT_OCCURRED_ALIAS), 85 HUB_S((u64*)LOCAL_MMR_ADDR(SH_EVENT_OCCURRED_ALIAS),
88 mask); 86 mask);
89 __set_bit(irq, (volatile void *)pda->sn_in_service_ivecs); 87 __set_bit(irq, (volatile void *)pda->sn_in_service_ivecs);
90 88
91 move_irq(irq); 89 move_irq(irq);
@@ -93,15 +91,12 @@ static void sn_ack_irq(unsigned int irq)
93 91
94static void sn_end_irq(unsigned int irq) 92static void sn_end_irq(unsigned int irq)
95{ 93{
96 int nasid;
97 int ivec; 94 int ivec;
98 uint64_t event_occurred; 95 u64 event_occurred;
99 96
100 ivec = irq & 0xff; 97 ivec = irq & 0xff;
101 if (ivec == SGI_UART_VECTOR) { 98 if (ivec == SGI_UART_VECTOR) {
102 nasid = get_nasid(); 99 event_occurred = HUB_L((u64*)LOCAL_MMR_ADDR (SH_EVENT_OCCURRED));
103 event_occurred = HUB_L((uint64_t *) GLOBAL_MMR_ADDR
104 (nasid, SH_EVENT_OCCURRED));
105 /* If the UART bit is set here, we may have received an 100 /* If the UART bit is set here, we may have received an
106 * interrupt from the UART that the driver missed. To 101 * interrupt from the UART that the driver missed. To
107 * make sure, we IPI ourselves to force us to look again. 102 * make sure, we IPI ourselves to force us to look again.
@@ -132,6 +127,7 @@ static void sn_set_affinity_irq(unsigned int irq, cpumask_t mask)
132 int local_widget, status; 127 int local_widget, status;
133 nasid_t local_nasid; 128 nasid_t local_nasid;
134 struct sn_irq_info *new_irq_info; 129 struct sn_irq_info *new_irq_info;
130 struct sn_pcibus_provider *pci_provider;
135 131
136 new_irq_info = kmalloc(sizeof(struct sn_irq_info), GFP_ATOMIC); 132 new_irq_info = kmalloc(sizeof(struct sn_irq_info), GFP_ATOMIC);
137 if (new_irq_info == NULL) 133 if (new_irq_info == NULL)
@@ -171,8 +167,9 @@ static void sn_set_affinity_irq(unsigned int irq, cpumask_t mask)
171 new_irq_info->irq_cpuid = cpuid; 167 new_irq_info->irq_cpuid = cpuid;
172 register_intr_pda(new_irq_info); 168 register_intr_pda(new_irq_info);
173 169
174 if (IS_PCI_BRIDGE_ASIC(new_irq_info->irq_bridge_type)) 170 pci_provider = sn_pci_provider[new_irq_info->irq_bridge_type];
175 pcibr_change_devices_irq(new_irq_info); 171 if (pci_provider && pci_provider->target_interrupt)
172 (pci_provider->target_interrupt)(new_irq_info);
176 173
177 spin_lock(&sn_irq_info_lock); 174 spin_lock(&sn_irq_info_lock);
178 list_replace_rcu(&sn_irq_info->list, &new_irq_info->list); 175 list_replace_rcu(&sn_irq_info->list, &new_irq_info->list);
@@ -317,6 +314,16 @@ void sn_irq_unfixup(struct pci_dev *pci_dev)
317 pci_dev_put(pci_dev); 314 pci_dev_put(pci_dev);
318} 315}
319 316
317static inline void
318sn_call_force_intr_provider(struct sn_irq_info *sn_irq_info)
319{
320 struct sn_pcibus_provider *pci_provider;
321
322 pci_provider = sn_pci_provider[sn_irq_info->irq_bridge_type];
323 if (pci_provider && pci_provider->force_interrupt)
324 (*pci_provider->force_interrupt)(sn_irq_info);
325}
326
320static void force_interrupt(int irq) 327static void force_interrupt(int irq)
321{ 328{
322 struct sn_irq_info *sn_irq_info; 329 struct sn_irq_info *sn_irq_info;
@@ -325,11 +332,9 @@ static void force_interrupt(int irq)
325 return; 332 return;
326 333
327 rcu_read_lock(); 334 rcu_read_lock();
328 list_for_each_entry_rcu(sn_irq_info, sn_irq_lh[irq], list) { 335 list_for_each_entry_rcu(sn_irq_info, sn_irq_lh[irq], list)
329 if (IS_PCI_BRIDGE_ASIC(sn_irq_info->irq_bridge_type) && 336 sn_call_force_intr_provider(sn_irq_info);
330 (sn_irq_info->irq_bridge != NULL)) 337
331 pcibr_force_interrupt(sn_irq_info);
332 }
333 rcu_read_unlock(); 338 rcu_read_unlock();
334} 339}
335 340
@@ -351,6 +356,14 @@ static void sn_check_intr(int irq, struct sn_irq_info *sn_irq_info)
351 struct pcidev_info *pcidev_info; 356 struct pcidev_info *pcidev_info;
352 struct pcibus_info *pcibus_info; 357 struct pcibus_info *pcibus_info;
353 358
359 /*
360 * Bridge types attached to TIO (anything but PIC) do not need this WAR
361 * since they do not target Shub II interrupt registers. If that
362 * ever changes, this check needs to accomodate.
363 */
364 if (sn_irq_info->irq_bridge_type != PCIIO_ASIC_TYPE_PIC)
365 return;
366
354 pcidev_info = (struct pcidev_info *)sn_irq_info->irq_pciioinfo; 367 pcidev_info = (struct pcidev_info *)sn_irq_info->irq_pciioinfo;
355 if (!pcidev_info) 368 if (!pcidev_info)
356 return; 369 return;
@@ -377,16 +390,12 @@ static void sn_check_intr(int irq, struct sn_irq_info *sn_irq_info)
377 break; 390 break;
378 } 391 }
379 if (!test_bit(irr_bit, &irr_reg)) { 392 if (!test_bit(irr_bit, &irr_reg)) {
380 if (!test_bit(irq, pda->sn_soft_irr)) { 393 if (!test_bit(irq, pda->sn_in_service_ivecs)) {
381 if (!test_bit(irq, pda->sn_in_service_ivecs)) { 394 regval &= 0xff;
382 regval &= 0xff; 395 if (sn_irq_info->irq_int_bit & regval &
383 if (sn_irq_info->irq_int_bit & regval & 396 sn_irq_info->irq_last_intr) {
384 sn_irq_info->irq_last_intr) { 397 regval &= ~(sn_irq_info->irq_int_bit & regval);
385 regval &= 398 sn_call_force_intr_provider(sn_irq_info);
386 ~(sn_irq_info->
387 irq_int_bit & regval);
388 pcibr_force_interrupt(sn_irq_info);
389 }
390 } 399 }
391 } 400 }
392 } 401 }
@@ -404,13 +413,7 @@ void sn_lb_int_war_check(void)
404 rcu_read_lock(); 413 rcu_read_lock();
405 for (i = pda->sn_first_irq; i <= pda->sn_last_irq; i++) { 414 for (i = pda->sn_first_irq; i <= pda->sn_last_irq; i++) {
406 list_for_each_entry_rcu(sn_irq_info, sn_irq_lh[i], list) { 415 list_for_each_entry_rcu(sn_irq_info, sn_irq_lh[i], list) {
407 /* 416 sn_check_intr(i, sn_irq_info);
408 * Only call for PCI bridges that are fully
409 * initialized.
410 */
411 if (IS_PCI_BRIDGE_ASIC(sn_irq_info->irq_bridge_type) &&
412 (sn_irq_info->irq_bridge != NULL))
413 sn_check_intr(i, sn_irq_info);
414 } 417 }
415 } 418 }
416 rcu_read_unlock(); 419 rcu_read_unlock();
diff --git a/arch/ia64/sn/kernel/setup.c b/arch/ia64/sn/kernel/setup.c
index 7c7fe441d623..a594aca959e6 100644
--- a/arch/ia64/sn/kernel/setup.c
+++ b/arch/ia64/sn/kernel/setup.c
@@ -80,8 +80,6 @@ EXPORT_PER_CPU_SYMBOL(__sn_cnodeid_to_nasid);
80DEFINE_PER_CPU(struct nodepda_s *, __sn_nodepda); 80DEFINE_PER_CPU(struct nodepda_s *, __sn_nodepda);
81EXPORT_PER_CPU_SYMBOL(__sn_nodepda); 81EXPORT_PER_CPU_SYMBOL(__sn_nodepda);
82 82
83partid_t sn_partid = -1;
84EXPORT_SYMBOL(sn_partid);
85char sn_system_serial_number_string[128]; 83char sn_system_serial_number_string[128];
86EXPORT_SYMBOL(sn_system_serial_number_string); 84EXPORT_SYMBOL(sn_system_serial_number_string);
87u64 sn_partition_serial_number; 85u64 sn_partition_serial_number;
@@ -403,6 +401,7 @@ static void __init sn_init_pdas(char **cmdline_p)
403 memset(nodepdaindr[cnode], 0, sizeof(nodepda_t)); 401 memset(nodepdaindr[cnode], 0, sizeof(nodepda_t));
404 memset(nodepdaindr[cnode]->phys_cpuid, -1, 402 memset(nodepdaindr[cnode]->phys_cpuid, -1,
405 sizeof(nodepdaindr[cnode]->phys_cpuid)); 403 sizeof(nodepdaindr[cnode]->phys_cpuid));
404 spin_lock_init(&nodepdaindr[cnode]->ptc_lock);
406 } 405 }
407 406
408 /* 407 /*
@@ -532,8 +531,8 @@ void __init sn_cpu_init(void)
532 */ 531 */
533 { 532 {
534 u64 pio1[] = {SH1_PIO_WRITE_STATUS_0, 0, SH1_PIO_WRITE_STATUS_1, 0}; 533 u64 pio1[] = {SH1_PIO_WRITE_STATUS_0, 0, SH1_PIO_WRITE_STATUS_1, 0};
535 u64 pio2[] = {SH2_PIO_WRITE_STATUS_0, SH2_PIO_WRITE_STATUS_1, 534 u64 pio2[] = {SH2_PIO_WRITE_STATUS_0, SH2_PIO_WRITE_STATUS_2,
536 SH2_PIO_WRITE_STATUS_2, SH2_PIO_WRITE_STATUS_3}; 535 SH2_PIO_WRITE_STATUS_1, SH2_PIO_WRITE_STATUS_3};
537 u64 *pio; 536 u64 *pio;
538 pio = is_shub1() ? pio1 : pio2; 537 pio = is_shub1() ? pio1 : pio2;
539 pda->pio_write_status_addr = (volatile unsigned long *) LOCAL_MMR_ADDR(pio[slice]); 538 pda->pio_write_status_addr = (volatile unsigned long *) LOCAL_MMR_ADDR(pio[slice]);
diff --git a/arch/ia64/sn/kernel/sn2/ptc_deadlock.S b/arch/ia64/sn/kernel/sn2/ptc_deadlock.S
index 96cb71d15682..3fa95065a446 100644
--- a/arch/ia64/sn/kernel/sn2/ptc_deadlock.S
+++ b/arch/ia64/sn/kernel/sn2/ptc_deadlock.S
@@ -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) 2000-2004 Silicon Graphics, Inc. All rights reserved. 6 * Copyright (C) 2000-2005 Silicon Graphics, Inc. All rights reserved.
7 */ 7 */
8 8
9#include <asm/types.h> 9#include <asm/types.h>
@@ -11,7 +11,7 @@
11 11
12#define DEADLOCKBIT SH_PIO_WRITE_STATUS_WRITE_DEADLOCK_SHFT 12#define DEADLOCKBIT SH_PIO_WRITE_STATUS_WRITE_DEADLOCK_SHFT
13#define WRITECOUNTMASK SH_PIO_WRITE_STATUS_PENDING_WRITE_COUNT_MASK 13#define WRITECOUNTMASK SH_PIO_WRITE_STATUS_PENDING_WRITE_COUNT_MASK
14#define ALIAS_OFFSET (SH1_PIO_WRITE_STATUS_0_ALIAS-SH1_PIO_WRITE_STATUS_0) 14#define ALIAS_OFFSET 8
15 15
16 16
17 .global sn2_ptc_deadlock_recovery_core 17 .global sn2_ptc_deadlock_recovery_core
@@ -36,13 +36,15 @@ sn2_ptc_deadlock_recovery_core:
36 extr.u piowcphy=piowc,0,61;; // Convert piowc to uncached physical address 36 extr.u piowcphy=piowc,0,61;; // Convert piowc to uncached physical address
37 dep piowcphy=-1,piowcphy,63,1 37 dep piowcphy=-1,piowcphy,63,1
38 movl mask=WRITECOUNTMASK 38 movl mask=WRITECOUNTMASK
39 mov r8=r0
39 40
401: 411:
41 add scr2=ALIAS_OFFSET,piowc // Address of WRITE_STATUS alias register 42 add scr2=ALIAS_OFFSET,piowc // Address of WRITE_STATUS alias register
42 mov scr1=7;; // Clear DEADLOCK, WRITE_ERROR, MULTI_WRITE_ERROR 43 ;;
43 st8.rel [scr2]=scr1;; 44 ld8.acq scr1=[scr2];;
44 45
455: ld8.acq scr1=[piowc];; // Wait for PIOs to complete. 465: ld8.acq scr1=[piowc];; // Wait for PIOs to complete.
47 hint @pause
46 and scr2=scr1,mask;; // mask of writecount bits 48 and scr2=scr1,mask;; // mask of writecount bits
47 cmp.ne p6,p0=zeroval,scr2 49 cmp.ne p6,p0=zeroval,scr2
48(p6) br.cond.sptk 5b 50(p6) br.cond.sptk 5b
@@ -57,6 +59,7 @@ sn2_ptc_deadlock_recovery_core:
57 st8.rel [ptc0]=data0 // Write PTC0 & wait for completion. 59 st8.rel [ptc0]=data0 // Write PTC0 & wait for completion.
58 60
595: ld8.acq scr1=[piowcphy];; // Wait for PIOs to complete. 615: ld8.acq scr1=[piowcphy];; // Wait for PIOs to complete.
62 hint @pause
60 and scr2=scr1,mask;; // mask of writecount bits 63 and scr2=scr1,mask;; // mask of writecount bits
61 cmp.ne p6,p0=zeroval,scr2 64 cmp.ne p6,p0=zeroval,scr2
62(p6) br.cond.sptk 5b;; 65(p6) br.cond.sptk 5b;;
@@ -67,6 +70,7 @@ sn2_ptc_deadlock_recovery_core:
67(p7) st8.rel [ptc1]=data1;; // Now write PTC1. 70(p7) st8.rel [ptc1]=data1;; // Now write PTC1.
68 71
695: ld8.acq scr1=[piowcphy];; // Wait for PIOs to complete. 725: ld8.acq scr1=[piowcphy];; // Wait for PIOs to complete.
73 hint @pause
70 and scr2=scr1,mask;; // mask of writecount bits 74 and scr2=scr1,mask;; // mask of writecount bits
71 cmp.ne p6,p0=zeroval,scr2 75 cmp.ne p6,p0=zeroval,scr2
72(p6) br.cond.sptk 5b 76(p6) br.cond.sptk 5b
@@ -77,6 +81,7 @@ sn2_ptc_deadlock_recovery_core:
77 srlz.i;; 81 srlz.i;;
78 ////////////// END PHYSICAL MODE //////////////////// 82 ////////////// END PHYSICAL MODE ////////////////////
79 83
84(p8) add r8=1,r8
80(p8) br.cond.spnt 1b;; // Repeat if DEADLOCK occurred. 85(p8) br.cond.spnt 1b;; // Repeat if DEADLOCK occurred.
81 86
82 br.ret.sptk rp 87 br.ret.sptk rp
diff --git a/arch/ia64/sn/kernel/sn2/sn2_smp.c b/arch/ia64/sn/kernel/sn2/sn2_smp.c
index 7af05a7ac743..0a4ee50c302f 100644
--- a/arch/ia64/sn/kernel/sn2/sn2_smp.c
+++ b/arch/ia64/sn/kernel/sn2/sn2_smp.c
@@ -5,7 +5,7 @@
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
6 * for more details. 6 * for more details.
7 * 7 *
8 * Copyright (C) 2000-2004 Silicon Graphics, Inc. All rights reserved. 8 * Copyright (C) 2000-2005 Silicon Graphics, Inc. All rights reserved.
9 */ 9 */
10 10
11#include <linux/init.h> 11#include <linux/init.h>
@@ -20,6 +20,8 @@
20#include <linux/module.h> 20#include <linux/module.h>
21#include <linux/bitops.h> 21#include <linux/bitops.h>
22#include <linux/nodemask.h> 22#include <linux/nodemask.h>
23#include <linux/proc_fs.h>
24#include <linux/seq_file.h>
23 25
24#include <asm/processor.h> 26#include <asm/processor.h>
25#include <asm/irq.h> 27#include <asm/irq.h>
@@ -39,12 +41,120 @@
39#include <asm/sn/nodepda.h> 41#include <asm/sn/nodepda.h>
40#include <asm/sn/rw_mmr.h> 42#include <asm/sn/rw_mmr.h>
41 43
42void sn2_ptc_deadlock_recovery(volatile unsigned long *, unsigned long data0, 44DEFINE_PER_CPU(struct ptc_stats, ptcstats);
43 volatile unsigned long *, unsigned long data1); 45DECLARE_PER_CPU(struct ptc_stats, ptcstats);
44 46
45static __cacheline_aligned DEFINE_SPINLOCK(sn2_global_ptc_lock); 47static __cacheline_aligned DEFINE_SPINLOCK(sn2_global_ptc_lock);
46 48
47static unsigned long sn2_ptc_deadlock_count; 49void sn2_ptc_deadlock_recovery(short *, short, int, volatile unsigned long *, unsigned long data0,
50 volatile unsigned long *, unsigned long data1);
51
52#ifdef DEBUG_PTC
53/*
54 * ptctest:
55 *
56 * xyz - 3 digit hex number:
57 * x - Force PTC purges to use shub:
58 * 0 - no force
59 * 1 - force
60 * y - interupt enable
61 * 0 - disable interrupts
62 * 1 - leave interuupts enabled
63 * z - type of lock:
64 * 0 - global lock
65 * 1 - node local lock
66 * 2 - no lock
67 *
68 * Note: on shub1, only ptctest == 0 is supported. Don't try other values!
69 */
70
71static unsigned int sn2_ptctest = 0;
72
73static int __init ptc_test(char *str)
74{
75 get_option(&str, &sn2_ptctest);
76 return 1;
77}
78__setup("ptctest=", ptc_test);
79
80static inline int ptc_lock(unsigned long *flagp)
81{
82 unsigned long opt = sn2_ptctest & 255;
83
84 switch (opt) {
85 case 0x00:
86 spin_lock_irqsave(&sn2_global_ptc_lock, *flagp);
87 break;
88 case 0x01:
89 spin_lock_irqsave(&sn_nodepda->ptc_lock, *flagp);
90 break;
91 case 0x02:
92 local_irq_save(*flagp);
93 break;
94 case 0x10:
95 spin_lock(&sn2_global_ptc_lock);
96 break;
97 case 0x11:
98 spin_lock(&sn_nodepda->ptc_lock);
99 break;
100 case 0x12:
101 break;
102 default:
103 BUG();
104 }
105 return opt;
106}
107
108static inline void ptc_unlock(unsigned long flags, int opt)
109{
110 switch (opt) {
111 case 0x00:
112 spin_unlock_irqrestore(&sn2_global_ptc_lock, flags);
113 break;
114 case 0x01:
115 spin_unlock_irqrestore(&sn_nodepda->ptc_lock, flags);
116 break;
117 case 0x02:
118 local_irq_restore(flags);
119 break;
120 case 0x10:
121 spin_unlock(&sn2_global_ptc_lock);
122 break;
123 case 0x11:
124 spin_unlock(&sn_nodepda->ptc_lock);
125 break;
126 case 0x12:
127 break;
128 default:
129 BUG();
130 }
131}
132#else
133
134#define sn2_ptctest 0
135
136static inline int ptc_lock(unsigned long *flagp)
137{
138 spin_lock_irqsave(&sn2_global_ptc_lock, *flagp);
139 return 0;
140}
141
142static inline void ptc_unlock(unsigned long flags, int opt)
143{
144 spin_unlock_irqrestore(&sn2_global_ptc_lock, flags);
145}
146#endif
147
148struct ptc_stats {
149 unsigned long ptc_l;
150 unsigned long change_rid;
151 unsigned long shub_ptc_flushes;
152 unsigned long nodes_flushed;
153 unsigned long deadlocks;
154 unsigned long lock_itc_clocks;
155 unsigned long shub_itc_clocks;
156 unsigned long shub_itc_clocks_max;
157};
48 158
49static inline unsigned long wait_piowc(void) 159static inline unsigned long wait_piowc(void)
50{ 160{
@@ -89,9 +199,9 @@ void
89sn2_global_tlb_purge(unsigned long start, unsigned long end, 199sn2_global_tlb_purge(unsigned long start, unsigned long end,
90 unsigned long nbits) 200 unsigned long nbits)
91{ 201{
92 int i, shub1, cnode, mynasid, cpu, lcpu = 0, nasid, flushed = 0; 202 int i, opt, shub1, cnode, mynasid, cpu, lcpu = 0, nasid, flushed = 0;
93 volatile unsigned long *ptc0, *ptc1; 203 volatile unsigned long *ptc0, *ptc1;
94 unsigned long flags = 0, data0 = 0, data1 = 0; 204 unsigned long itc, itc2, flags, data0 = 0, data1 = 0;
95 struct mm_struct *mm = current->active_mm; 205 struct mm_struct *mm = current->active_mm;
96 short nasids[MAX_NUMNODES], nix; 206 short nasids[MAX_NUMNODES], nix;
97 nodemask_t nodes_flushed; 207 nodemask_t nodes_flushed;
@@ -114,16 +224,19 @@ sn2_global_tlb_purge(unsigned long start, unsigned long end,
114 start += (1UL << nbits); 224 start += (1UL << nbits);
115 } while (start < end); 225 } while (start < end);
116 ia64_srlz_i(); 226 ia64_srlz_i();
227 __get_cpu_var(ptcstats).ptc_l++;
117 preempt_enable(); 228 preempt_enable();
118 return; 229 return;
119 } 230 }
120 231
121 if (atomic_read(&mm->mm_users) == 1) { 232 if (atomic_read(&mm->mm_users) == 1) {
122 flush_tlb_mm(mm); 233 flush_tlb_mm(mm);
234 __get_cpu_var(ptcstats).change_rid++;
123 preempt_enable(); 235 preempt_enable();
124 return; 236 return;
125 } 237 }
126 238
239 itc = ia64_get_itc();
127 nix = 0; 240 nix = 0;
128 for_each_node_mask(cnode, nodes_flushed) 241 for_each_node_mask(cnode, nodes_flushed)
129 nasids[nix++] = cnodeid_to_nasid(cnode); 242 nasids[nix++] = cnodeid_to_nasid(cnode);
@@ -148,7 +261,12 @@ sn2_global_tlb_purge(unsigned long start, unsigned long end,
148 261
149 mynasid = get_nasid(); 262 mynasid = get_nasid();
150 263
151 spin_lock_irqsave(&sn2_global_ptc_lock, flags); 264 itc = ia64_get_itc();
265 opt = ptc_lock(&flags);
266 itc2 = ia64_get_itc();
267 __get_cpu_var(ptcstats).lock_itc_clocks += itc2 - itc;
268 __get_cpu_var(ptcstats).shub_ptc_flushes++;
269 __get_cpu_var(ptcstats).nodes_flushed += nix;
152 270
153 do { 271 do {
154 if (shub1) 272 if (shub1)
@@ -157,7 +275,7 @@ sn2_global_tlb_purge(unsigned long start, unsigned long end,
157 data0 = (data0 & ~SH2_PTC_ADDR_MASK) | (start & SH2_PTC_ADDR_MASK); 275 data0 = (data0 & ~SH2_PTC_ADDR_MASK) | (start & SH2_PTC_ADDR_MASK);
158 for (i = 0; i < nix; i++) { 276 for (i = 0; i < nix; i++) {
159 nasid = nasids[i]; 277 nasid = nasids[i];
160 if (unlikely(nasid == mynasid)) { 278 if ((!(sn2_ptctest & 3)) && unlikely(nasid == mynasid)) {
161 ia64_ptcga(start, nbits << 2); 279 ia64_ptcga(start, nbits << 2);
162 ia64_srlz_i(); 280 ia64_srlz_i();
163 } else { 281 } else {
@@ -169,18 +287,22 @@ sn2_global_tlb_purge(unsigned long start, unsigned long end,
169 flushed = 1; 287 flushed = 1;
170 } 288 }
171 } 289 }
172
173 if (flushed 290 if (flushed
174 && (wait_piowc() & 291 && (wait_piowc() &
175 SH_PIO_WRITE_STATUS_WRITE_DEADLOCK_MASK)) { 292 (SH_PIO_WRITE_STATUS_WRITE_DEADLOCK_MASK))) {
176 sn2_ptc_deadlock_recovery(ptc0, data0, ptc1, data1); 293 sn2_ptc_deadlock_recovery(nasids, nix, mynasid, ptc0, data0, ptc1, data1);
177 } 294 }
178 295
179 start += (1UL << nbits); 296 start += (1UL << nbits);
180 297
181 } while (start < end); 298 } while (start < end);
182 299
183 spin_unlock_irqrestore(&sn2_global_ptc_lock, flags); 300 itc2 = ia64_get_itc() - itc2;
301 __get_cpu_var(ptcstats).shub_itc_clocks += itc2;
302 if (itc2 > __get_cpu_var(ptcstats).shub_itc_clocks_max)
303 __get_cpu_var(ptcstats).shub_itc_clocks_max = itc2;
304
305 ptc_unlock(flags, opt);
184 306
185 preempt_enable(); 307 preempt_enable();
186} 308}
@@ -192,31 +314,29 @@ sn2_global_tlb_purge(unsigned long start, unsigned long end,
192 * TLB flush transaction. The recovery sequence is somewhat tricky & is 314 * TLB flush transaction. The recovery sequence is somewhat tricky & is
193 * coded in assembly language. 315 * coded in assembly language.
194 */ 316 */
195void sn2_ptc_deadlock_recovery(volatile unsigned long *ptc0, unsigned long data0, 317void sn2_ptc_deadlock_recovery(short *nasids, short nix, int mynasid, volatile unsigned long *ptc0, unsigned long data0,
196 volatile unsigned long *ptc1, unsigned long data1) 318 volatile unsigned long *ptc1, unsigned long data1)
197{ 319{
198 extern void sn2_ptc_deadlock_recovery_core(volatile unsigned long *, unsigned long, 320 extern void sn2_ptc_deadlock_recovery_core(volatile unsigned long *, unsigned long,
199 volatile unsigned long *, unsigned long, volatile unsigned long *, unsigned long); 321 volatile unsigned long *, unsigned long, volatile unsigned long *, unsigned long);
200 int cnode, mycnode, nasid; 322 short nasid, i;
201 volatile unsigned long *piows; 323 unsigned long *piows, zeroval;
202 volatile unsigned long zeroval;
203 324
204 sn2_ptc_deadlock_count++; 325 __get_cpu_var(ptcstats).deadlocks++;
205 326
206 piows = pda->pio_write_status_addr; 327 piows = (unsigned long *) pda->pio_write_status_addr;
207 zeroval = pda->pio_write_status_val; 328 zeroval = pda->pio_write_status_val;
208 329
209 mycnode = numa_node_id(); 330 for (i=0; i < nix; i++) {
210 331 nasid = nasids[i];
211 for_each_online_node(cnode) { 332 if (!(sn2_ptctest & 3) && nasid == mynasid)
212 if (is_headless_node(cnode) || cnode == mycnode)
213 continue; 333 continue;
214 nasid = cnodeid_to_nasid(cnode);
215 ptc0 = CHANGE_NASID(nasid, ptc0); 334 ptc0 = CHANGE_NASID(nasid, ptc0);
216 if (ptc1) 335 if (ptc1)
217 ptc1 = CHANGE_NASID(nasid, ptc1); 336 ptc1 = CHANGE_NASID(nasid, ptc1);
218 sn2_ptc_deadlock_recovery_core(ptc0, data0, ptc1, data1, piows, zeroval); 337 sn2_ptc_deadlock_recovery_core(ptc0, data0, ptc1, data1, piows, zeroval);
219 } 338 }
339
220} 340}
221 341
222/** 342/**
@@ -293,3 +413,93 @@ void sn2_send_IPI(int cpuid, int vector, int delivery_mode, int redirect)
293 413
294 sn_send_IPI_phys(nasid, physid, vector, delivery_mode); 414 sn_send_IPI_phys(nasid, physid, vector, delivery_mode);
295} 415}
416
417#ifdef CONFIG_PROC_FS
418
419#define PTC_BASENAME "sgi_sn/ptc_statistics"
420
421static void *sn2_ptc_seq_start(struct seq_file *file, loff_t * offset)
422{
423 if (*offset < NR_CPUS)
424 return offset;
425 return NULL;
426}
427
428static void *sn2_ptc_seq_next(struct seq_file *file, void *data, loff_t * offset)
429{
430 (*offset)++;
431 if (*offset < NR_CPUS)
432 return offset;
433 return NULL;
434}
435
436static void sn2_ptc_seq_stop(struct seq_file *file, void *data)
437{
438}
439
440static int sn2_ptc_seq_show(struct seq_file *file, void *data)
441{
442 struct ptc_stats *stat;
443 int cpu;
444
445 cpu = *(loff_t *) data;
446
447 if (!cpu) {
448 seq_printf(file, "# ptc_l change_rid shub_ptc_flushes shub_nodes_flushed deadlocks lock_nsec shub_nsec shub_nsec_max\n");
449 seq_printf(file, "# ptctest %d\n", sn2_ptctest);
450 }
451
452 if (cpu < NR_CPUS && cpu_online(cpu)) {
453 stat = &per_cpu(ptcstats, cpu);
454 seq_printf(file, "cpu %d %ld %ld %ld %ld %ld %ld %ld %ld\n", cpu, stat->ptc_l,
455 stat->change_rid, stat->shub_ptc_flushes, stat->nodes_flushed,
456 stat->deadlocks,
457 1000 * stat->lock_itc_clocks / per_cpu(cpu_info, cpu).cyc_per_usec,
458 1000 * stat->shub_itc_clocks / per_cpu(cpu_info, cpu).cyc_per_usec,
459 1000 * stat->shub_itc_clocks_max / per_cpu(cpu_info, cpu).cyc_per_usec);
460 }
461
462 return 0;
463}
464
465static struct seq_operations sn2_ptc_seq_ops = {
466 .start = sn2_ptc_seq_start,
467 .next = sn2_ptc_seq_next,
468 .stop = sn2_ptc_seq_stop,
469 .show = sn2_ptc_seq_show
470};
471
472int sn2_ptc_proc_open(struct inode *inode, struct file *file)
473{
474 return seq_open(file, &sn2_ptc_seq_ops);
475}
476
477static struct file_operations proc_sn2_ptc_operations = {
478 .open = sn2_ptc_proc_open,
479 .read = seq_read,
480 .llseek = seq_lseek,
481 .release = seq_release,
482};
483
484static struct proc_dir_entry *proc_sn2_ptc;
485
486static int __init sn2_ptc_init(void)
487{
488 if (!(proc_sn2_ptc = create_proc_entry(PTC_BASENAME, 0444, NULL))) {
489 printk(KERN_ERR "unable to create %s proc entry", PTC_BASENAME);
490 return -EINVAL;
491 }
492 proc_sn2_ptc->proc_fops = &proc_sn2_ptc_operations;
493 spin_lock_init(&sn2_global_ptc_lock);
494 return 0;
495}
496
497static void __exit sn2_ptc_exit(void)
498{
499 remove_proc_entry(PTC_BASENAME, NULL);
500}
501
502module_init(sn2_ptc_init);
503module_exit(sn2_ptc_exit);
504#endif /* CONFIG_PROC_FS */
505
diff --git a/arch/ia64/sn/kernel/sn2/sn_hwperf.c b/arch/ia64/sn/kernel/sn2/sn_hwperf.c
index 833e700fdac9..0513aacac8c1 100644
--- a/arch/ia64/sn/kernel/sn2/sn_hwperf.c
+++ b/arch/ia64/sn/kernel/sn2/sn_hwperf.c
@@ -36,7 +36,6 @@
36#include <asm/topology.h> 36#include <asm/topology.h>
37#include <asm/smp.h> 37#include <asm/smp.h>
38#include <asm/semaphore.h> 38#include <asm/semaphore.h>
39#include <asm/segment.h>
40#include <asm/uaccess.h> 39#include <asm/uaccess.h>
41#include <asm/sal.h> 40#include <asm/sal.h>
42#include <asm/sn/io.h> 41#include <asm/sn/io.h>
@@ -59,7 +58,7 @@ static int sn_hwperf_enum_objects(int *nobj, struct sn_hwperf_object_info **ret)
59 struct sn_hwperf_object_info *objbuf = NULL; 58 struct sn_hwperf_object_info *objbuf = NULL;
60 59
61 if ((e = sn_hwperf_init()) < 0) { 60 if ((e = sn_hwperf_init()) < 0) {
62 printk("sn_hwperf_init failed: err %d\n", e); 61 printk(KERN_ERR "sn_hwperf_init failed: err %d\n", e);
63 goto out; 62 goto out;
64 } 63 }
65 64
@@ -111,7 +110,7 @@ static int sn_hwperf_geoid_to_cnode(char *location)
111 if (sn_hwperf_location_to_bpos(location, &rack, &bay, &slot, &slab)) 110 if (sn_hwperf_location_to_bpos(location, &rack, &bay, &slot, &slab))
112 return -1; 111 return -1;
113 112
114 for (cnode = 0; cnode < numionodes; cnode++) { 113 for_each_node(cnode) {
115 geoid = cnodeid_get_geoid(cnode); 114 geoid = cnodeid_get_geoid(cnode);
116 module_id = geo_module(geoid); 115 module_id = geo_module(geoid);
117 this_rack = MODULE_GET_RACK(module_id); 116 this_rack = MODULE_GET_RACK(module_id);
@@ -124,11 +123,13 @@ static int sn_hwperf_geoid_to_cnode(char *location)
124 } 123 }
125 } 124 }
126 125
127 return cnode < numionodes ? cnode : -1; 126 return node_possible(cnode) ? cnode : -1;
128} 127}
129 128
130static int sn_hwperf_obj_to_cnode(struct sn_hwperf_object_info * obj) 129static int sn_hwperf_obj_to_cnode(struct sn_hwperf_object_info * obj)
131{ 130{
131 if (!SN_HWPERF_IS_NODE(obj) && !SN_HWPERF_IS_IONODE(obj))
132 BUG();
132 if (!obj->sn_hwp_this_part) 133 if (!obj->sn_hwp_this_part)
133 return -1; 134 return -1;
134 return sn_hwperf_geoid_to_cnode(obj->location); 135 return sn_hwperf_geoid_to_cnode(obj->location);
@@ -174,31 +175,199 @@ static const char *sn_hwperf_get_slabname(struct sn_hwperf_object_info *obj,
174 return slabname; 175 return slabname;
175} 176}
176 177
177static void print_pci_topology(struct seq_file *s, 178static void print_pci_topology(struct seq_file *s)
178 struct sn_hwperf_object_info *obj, int *ordinal, 179{
179 u64 rack, u64 bay, u64 slot, u64 slab) 180 char *p;
181 size_t sz;
182 int e;
183
184 for (sz = PAGE_SIZE; sz < 16 * PAGE_SIZE; sz += PAGE_SIZE) {
185 if (!(p = (char *)kmalloc(sz, GFP_KERNEL)))
186 break;
187 e = ia64_sn_ioif_get_pci_topology(__pa(p), sz);
188 if (e == SALRET_OK)
189 seq_puts(s, p);
190 kfree(p);
191 if (e == SALRET_OK || e == SALRET_NOT_IMPLEMENTED)
192 break;
193 }
194}
195
196static inline int sn_hwperf_has_cpus(cnodeid_t node)
197{
198 return node_online(node) && nr_cpus_node(node);
199}
200
201static inline int sn_hwperf_has_mem(cnodeid_t node)
202{
203 return node_online(node) && NODE_DATA(node)->node_present_pages;
204}
205
206static struct sn_hwperf_object_info *
207sn_hwperf_findobj_id(struct sn_hwperf_object_info *objbuf,
208 int nobj, int id)
180{ 209{
181 char *p1; 210 int i;
182 char *p2; 211 struct sn_hwperf_object_info *p = objbuf;
183 char *pg; 212
184 213 for (i=0; i < nobj; i++, p++) {
185 if (!(pg = (char *)get_zeroed_page(GFP_KERNEL))) 214 if (p->id == id)
186 return; /* ignore */ 215 return p;
187 if (ia64_sn_ioif_get_pci_topology(rack, bay, slot, slab, 216 }
188 __pa(pg), PAGE_SIZE) == SN_HWPERF_OP_OK) { 217
189 for (p1=pg; *p1 && p1 < pg + PAGE_SIZE;) { 218 return NULL;
190 if (!(p2 = strchr(p1, '\n'))) 219
220}
221
222static int sn_hwperf_get_nearest_node_objdata(struct sn_hwperf_object_info *objbuf,
223 int nobj, cnodeid_t node, cnodeid_t *near_mem_node, cnodeid_t *near_cpu_node)
224{
225 int e;
226 struct sn_hwperf_object_info *nodeobj = NULL;
227 struct sn_hwperf_object_info *op;
228 struct sn_hwperf_object_info *dest;
229 struct sn_hwperf_object_info *router;
230 struct sn_hwperf_port_info ptdata[16];
231 int sz, i, j;
232 cnodeid_t c;
233 int found_mem = 0;
234 int found_cpu = 0;
235
236 if (!node_possible(node))
237 return -EINVAL;
238
239 if (sn_hwperf_has_cpus(node)) {
240 if (near_cpu_node)
241 *near_cpu_node = node;
242 found_cpu++;
243 }
244
245 if (sn_hwperf_has_mem(node)) {
246 if (near_mem_node)
247 *near_mem_node = node;
248 found_mem++;
249 }
250
251 if (found_cpu && found_mem)
252 return 0; /* trivially successful */
253
254 /* find the argument node object */
255 for (i=0, op=objbuf; i < nobj; i++, op++) {
256 if (!SN_HWPERF_IS_NODE(op) && !SN_HWPERF_IS_IONODE(op))
257 continue;
258 if (node == sn_hwperf_obj_to_cnode(op)) {
259 nodeobj = op;
260 break;
261 }
262 }
263 if (!nodeobj) {
264 e = -ENOENT;
265 goto err;
266 }
267
268 /* get it's interconnect topology */
269 sz = op->ports * sizeof(struct sn_hwperf_port_info);
270 if (sz > sizeof(ptdata))
271 BUG();
272 e = ia64_sn_hwperf_op(sn_hwperf_master_nasid,
273 SN_HWPERF_ENUM_PORTS, nodeobj->id, sz,
274 (u64)&ptdata, 0, 0, NULL);
275 if (e != SN_HWPERF_OP_OK) {
276 e = -EINVAL;
277 goto err;
278 }
279
280 /* find nearest node with cpus and nearest memory */
281 for (router=NULL, j=0; j < op->ports; j++) {
282 dest = sn_hwperf_findobj_id(objbuf, nobj, ptdata[j].conn_id);
283 if (!dest || SN_HWPERF_FOREIGN(dest) ||
284 !SN_HWPERF_IS_NODE(dest) || SN_HWPERF_IS_IONODE(dest)) {
285 continue;
286 }
287 c = sn_hwperf_obj_to_cnode(dest);
288 if (!found_cpu && sn_hwperf_has_cpus(c)) {
289 if (near_cpu_node)
290 *near_cpu_node = c;
291 found_cpu++;
292 }
293 if (!found_mem && sn_hwperf_has_mem(c)) {
294 if (near_mem_node)
295 *near_mem_node = c;
296 found_mem++;
297 }
298 if (SN_HWPERF_IS_ROUTER(dest))
299 router = dest;
300 }
301
302 if (router && (!found_cpu || !found_mem)) {
303 /* search for a node connected to the same router */
304 sz = router->ports * sizeof(struct sn_hwperf_port_info);
305 if (sz > sizeof(ptdata))
306 BUG();
307 e = ia64_sn_hwperf_op(sn_hwperf_master_nasid,
308 SN_HWPERF_ENUM_PORTS, router->id, sz,
309 (u64)&ptdata, 0, 0, NULL);
310 if (e != SN_HWPERF_OP_OK) {
311 e = -EINVAL;
312 goto err;
313 }
314 for (j=0; j < router->ports; j++) {
315 dest = sn_hwperf_findobj_id(objbuf, nobj,
316 ptdata[j].conn_id);
317 if (!dest || dest->id == node ||
318 SN_HWPERF_FOREIGN(dest) ||
319 !SN_HWPERF_IS_NODE(dest) ||
320 SN_HWPERF_IS_IONODE(dest)) {
321 continue;
322 }
323 c = sn_hwperf_obj_to_cnode(dest);
324 if (!found_cpu && sn_hwperf_has_cpus(c)) {
325 if (near_cpu_node)
326 *near_cpu_node = c;
327 found_cpu++;
328 }
329 if (!found_mem && sn_hwperf_has_mem(c)) {
330 if (near_mem_node)
331 *near_mem_node = c;
332 found_mem++;
333 }
334 if (found_cpu && found_mem)
335 break;
336 }
337 }
338
339 if (!found_cpu || !found_mem) {
340 /* resort to _any_ node with CPUs and memory */
341 for (i=0, op=objbuf; i < nobj; i++, op++) {
342 if (SN_HWPERF_FOREIGN(op) ||
343 SN_HWPERF_IS_IONODE(op) ||
344 !SN_HWPERF_IS_NODE(op)) {
345 continue;
346 }
347 c = sn_hwperf_obj_to_cnode(op);
348 if (!found_cpu && sn_hwperf_has_cpus(c)) {
349 if (near_cpu_node)
350 *near_cpu_node = c;
351 found_cpu++;
352 }
353 if (!found_mem && sn_hwperf_has_mem(c)) {
354 if (near_mem_node)
355 *near_mem_node = c;
356 found_mem++;
357 }
358 if (found_cpu && found_mem)
191 break; 359 break;
192 *p2 = '\0';
193 seq_printf(s, "pcibus %d %s-%s\n",
194 *ordinal, obj->location, p1);
195 (*ordinal)++;
196 p1 = p2 + 1;
197 } 360 }
198 } 361 }
199 free_page((unsigned long)pg); 362
363 if (!found_cpu || !found_mem)
364 e = -ENODATA;
365
366err:
367 return e;
200} 368}
201 369
370
202static int sn_topology_show(struct seq_file *s, void *d) 371static int sn_topology_show(struct seq_file *s, void *d)
203{ 372{
204 int sz; 373 int sz;
@@ -215,7 +384,6 @@ static int sn_topology_show(struct seq_file *s, void *d)
215 struct sn_hwperf_object_info *p; 384 struct sn_hwperf_object_info *p;
216 struct sn_hwperf_object_info *obj = d; /* this object */ 385 struct sn_hwperf_object_info *obj = d; /* this object */
217 struct sn_hwperf_object_info *objs = s->private; /* all objects */ 386 struct sn_hwperf_object_info *objs = s->private; /* all objects */
218 int rack, bay, slot, slab;
219 u8 shubtype; 387 u8 shubtype;
220 u8 system_size; 388 u8 system_size;
221 u8 sharing_size; 389 u8 sharing_size;
@@ -225,7 +393,6 @@ static int sn_topology_show(struct seq_file *s, void *d)
225 u8 region_size; 393 u8 region_size;
226 u16 nasid_mask; 394 u16 nasid_mask;
227 int nasid_msb; 395 int nasid_msb;
228 int pci_bus_ordinal = 0;
229 396
230 if (obj == objs) { 397 if (obj == objs) {
231 seq_printf(s, "# sn_topology version 2\n"); 398 seq_printf(s, "# sn_topology version 2\n");
@@ -253,6 +420,8 @@ static int sn_topology_show(struct seq_file *s, void *d)
253 shubtype ? "shub2" : "shub1", 420 shubtype ? "shub2" : "shub1",
254 (u64)nasid_mask << nasid_shift, nasid_msb, nasid_shift, 421 (u64)nasid_mask << nasid_shift, nasid_msb, nasid_shift,
255 system_size, sharing_size, coher, region_size); 422 system_size, sharing_size, coher, region_size);
423
424 print_pci_topology(s);
256 } 425 }
257 426
258 if (SN_HWPERF_FOREIGN(obj)) { 427 if (SN_HWPERF_FOREIGN(obj)) {
@@ -272,11 +441,24 @@ static int sn_topology_show(struct seq_file *s, void *d)
272 if (!SN_HWPERF_IS_NODE(obj) && !SN_HWPERF_IS_IONODE(obj)) 441 if (!SN_HWPERF_IS_NODE(obj) && !SN_HWPERF_IS_IONODE(obj))
273 seq_putc(s, '\n'); 442 seq_putc(s, '\n');
274 else { 443 else {
444 cnodeid_t near_mem = -1;
445 cnodeid_t near_cpu = -1;
446
275 seq_printf(s, ", nasid 0x%x", cnodeid_to_nasid(ordinal)); 447 seq_printf(s, ", nasid 0x%x", cnodeid_to_nasid(ordinal));
276 for (i=0; i < numionodes; i++) { 448
277 seq_printf(s, i ? ":%d" : ", dist %d", 449 if (sn_hwperf_get_nearest_node_objdata(objs, sn_hwperf_obj_cnt,
278 node_distance(ordinal, i)); 450 ordinal, &near_mem, &near_cpu) == 0) {
451 seq_printf(s, ", near_mem_nodeid %d, near_cpu_nodeid %d",
452 near_mem, near_cpu);
453 }
454
455 if (!SN_HWPERF_IS_IONODE(obj)) {
456 for_each_online_node(i) {
457 seq_printf(s, i ? ":%d" : ", dist %d",
458 node_distance(ordinal, i));
459 }
279 } 460 }
461
280 seq_putc(s, '\n'); 462 seq_putc(s, '\n');
281 463
282 /* 464 /*
@@ -300,17 +482,6 @@ static int sn_topology_show(struct seq_file *s, void *d)
300 seq_putc(s, '\n'); 482 seq_putc(s, '\n');
301 } 483 }
302 } 484 }
303
304 /*
305 * PCI busses attached to this node, if any
306 */
307 if (sn_hwperf_location_to_bpos(obj->location,
308 &rack, &bay, &slot, &slab)) {
309 /* export pci bus info */
310 print_pci_topology(s, obj, &pci_bus_ordinal,
311 rack, bay, slot, slab);
312
313 }
314 } 485 }
315 486
316 if (obj->ports) { 487 if (obj->ports) {
@@ -572,6 +743,8 @@ sn_hwperf_ioctl(struct inode *in, struct file *fp, u32 op, u64 arg)
572 if ((r = sn_hwperf_enum_objects(&nobj, &objs)) == 0) { 743 if ((r = sn_hwperf_enum_objects(&nobj, &objs)) == 0) {
573 memset(p, 0, a.sz); 744 memset(p, 0, a.sz);
574 for (i = 0; i < nobj; i++) { 745 for (i = 0; i < nobj; i++) {
746 if (!SN_HWPERF_IS_NODE(objs + i))
747 continue;
575 node = sn_hwperf_obj_to_cnode(objs + i); 748 node = sn_hwperf_obj_to_cnode(objs + i);
576 for_each_online_cpu(j) { 749 for_each_online_cpu(j) {
577 if (node != cpu_to_node(j)) 750 if (node != cpu_to_node(j))
@@ -598,7 +771,7 @@ sn_hwperf_ioctl(struct inode *in, struct file *fp, u32 op, u64 arg)
598 771
599 case SN_HWPERF_GET_NODE_NASID: 772 case SN_HWPERF_GET_NODE_NASID:
600 if (a.sz != sizeof(u64) || 773 if (a.sz != sizeof(u64) ||
601 (node = a.arg) < 0 || node >= numionodes) { 774 (node = a.arg) < 0 || !node_possible(node)) {
602 r = -EINVAL; 775 r = -EINVAL;
603 goto error; 776 goto error;
604 } 777 }
@@ -627,6 +800,14 @@ sn_hwperf_ioctl(struct inode *in, struct file *fp, u32 op, u64 arg)
627 vfree(objs); 800 vfree(objs);
628 goto error; 801 goto error;
629 } 802 }
803
804 if (!SN_HWPERF_IS_NODE(objs + i) &&
805 !SN_HWPERF_IS_IONODE(objs + i)) {
806 r = -ENOENT;
807 vfree(objs);
808 goto error;
809 }
810
630 *(u64 *)p = (u64)sn_hwperf_obj_to_cnode(objs + i); 811 *(u64 *)p = (u64)sn_hwperf_obj_to_cnode(objs + i);
631 vfree(objs); 812 vfree(objs);
632 } 813 }
@@ -692,6 +873,7 @@ static int sn_hwperf_init(void)
692 873
693 /* single threaded, once-only initialization */ 874 /* single threaded, once-only initialization */
694 down(&sn_hwperf_init_mutex); 875 down(&sn_hwperf_init_mutex);
876
695 if (sn_hwperf_salheap) { 877 if (sn_hwperf_salheap) {
696 up(&sn_hwperf_init_mutex); 878 up(&sn_hwperf_init_mutex);
697 return e; 879 return e;
@@ -742,19 +924,6 @@ out:
742 sn_hwperf_salheap = NULL; 924 sn_hwperf_salheap = NULL;
743 sn_hwperf_obj_cnt = 0; 925 sn_hwperf_obj_cnt = 0;
744 } 926 }
745
746 if (!e) {
747 /*
748 * Register a dynamic misc device for ioctl. Platforms
749 * supporting hotplug will create /dev/sn_hwperf, else
750 * user can to look up the minor number in /proc/misc.
751 */
752 if ((e = misc_register(&sn_hwperf_dev)) != 0) {
753 printk(KERN_ERR "sn_hwperf_init: misc register "
754 "for \"sn_hwperf\" failed, err %d\n", e);
755 }
756 }
757
758 up(&sn_hwperf_init_mutex); 927 up(&sn_hwperf_init_mutex);
759 return e; 928 return e;
760} 929}
@@ -782,3 +951,41 @@ int sn_topology_release(struct inode *inode, struct file *file)
782 vfree(seq->private); 951 vfree(seq->private);
783 return seq_release(inode, file); 952 return seq_release(inode, file);
784} 953}
954
955int sn_hwperf_get_nearest_node(cnodeid_t node,
956 cnodeid_t *near_mem_node, cnodeid_t *near_cpu_node)
957{
958 int e;
959 int nobj;
960 struct sn_hwperf_object_info *objbuf;
961
962 if ((e = sn_hwperf_enum_objects(&nobj, &objbuf)) == 0) {
963 e = sn_hwperf_get_nearest_node_objdata(objbuf, nobj,
964 node, near_mem_node, near_cpu_node);
965 vfree(objbuf);
966 }
967
968 return e;
969}
970
971static int __devinit sn_hwperf_misc_register_init(void)
972{
973 int e;
974
975 sn_hwperf_init();
976
977 /*
978 * Register a dynamic misc device for hwperf ioctls. Platforms
979 * supporting hotplug will create /dev/sn_hwperf, else user
980 * can to look up the minor number in /proc/misc.
981 */
982 if ((e = misc_register(&sn_hwperf_dev)) != 0) {
983 printk(KERN_ERR "sn_hwperf_misc_register_init: failed to "
984 "register misc device for \"%s\"\n", sn_hwperf_dev.name);
985 }
986
987 return e;
988}
989
990device_initcall(sn_hwperf_misc_register_init); /* after misc_init() */
991EXPORT_SYMBOL(sn_hwperf_get_nearest_node);
diff --git a/arch/ia64/sn/kernel/sn2/sn_proc_fs.c b/arch/ia64/sn/kernel/sn2/sn_proc_fs.c
index 6a80fca807b9..51bf82720d99 100644
--- a/arch/ia64/sn/kernel/sn2/sn_proc_fs.c
+++ b/arch/ia64/sn/kernel/sn2/sn_proc_fs.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) 2000-2004 Silicon Graphics, Inc. All rights reserved. 6 * Copyright (C) 2000-2005 Silicon Graphics, Inc. All rights reserved.
7 */ 7 */
8#include <linux/config.h> 8#include <linux/config.h>
9#include <asm/uaccess.h> 9#include <asm/uaccess.h>
@@ -15,7 +15,7 @@
15 15
16static int partition_id_show(struct seq_file *s, void *p) 16static int partition_id_show(struct seq_file *s, void *p)
17{ 17{
18 seq_printf(s, "%d\n", sn_local_partid()); 18 seq_printf(s, "%d\n", sn_partition_id);
19 return 0; 19 return 0;
20} 20}
21 21
diff --git a/arch/ia64/sn/kernel/sn2/timer_interrupt.c b/arch/ia64/sn/kernel/sn2/timer_interrupt.c
index cde7375390b0..adf5db2e2afe 100644
--- a/arch/ia64/sn/kernel/sn2/timer_interrupt.c
+++ b/arch/ia64/sn/kernel/sn2/timer_interrupt.c
@@ -1,7 +1,7 @@
1/* 1/*
2 * 2 *
3 * 3 *
4 * Copyright (c) 2003 Silicon Graphics, Inc. All Rights Reserved. 4 * Copyright (c) 2005 Silicon Graphics, Inc. All Rights Reserved.
5 * 5 *
6 * This program is free software; you can redistribute it and/or modify it 6 * This program is free software; you can redistribute it and/or modify it
7 * under the terms of version 2 of the GNU General Public License 7 * under the terms of version 2 of the GNU General Public License
@@ -50,14 +50,16 @@ void sn_timer_interrupt(int irq, void *dev_id, struct pt_regs *regs)
50 LED_CPU_HEARTBEAT, LED_CPU_HEARTBEAT); 50 LED_CPU_HEARTBEAT, LED_CPU_HEARTBEAT);
51 } 51 }
52 52
53 if (enable_shub_wars_1_1()) { 53 if (is_shub1()) {
54 /* Bugfix code for SHUB 1.1 */ 54 if (enable_shub_wars_1_1()) {
55 if (pda->pio_shub_war_cam_addr) 55 /* Bugfix code for SHUB 1.1 */
56 *pda->pio_shub_war_cam_addr = 0x8000000000000010UL; 56 if (pda->pio_shub_war_cam_addr)
57 *pda->pio_shub_war_cam_addr = 0x8000000000000010UL;
58 }
59 if (pda->sn_lb_int_war_ticks == 0)
60 sn_lb_int_war_check();
61 pda->sn_lb_int_war_ticks++;
62 if (pda->sn_lb_int_war_ticks >= SN_LB_INT_WAR_INTERVAL)
63 pda->sn_lb_int_war_ticks = 0;
57 } 64 }
58 if (pda->sn_lb_int_war_ticks == 0)
59 sn_lb_int_war_check();
60 pda->sn_lb_int_war_ticks++;
61 if (pda->sn_lb_int_war_ticks >= SN_LB_INT_WAR_INTERVAL)
62 pda->sn_lb_int_war_ticks = 0;
63} 65}
diff --git a/arch/ia64/sn/kernel/xpc_channel.c b/arch/ia64/sn/kernel/xpc_channel.c
index 6d02dac8056f..94698bea7be0 100644
--- a/arch/ia64/sn/kernel/xpc_channel.c
+++ b/arch/ia64/sn/kernel/xpc_channel.c
@@ -72,7 +72,7 @@ xpc_initialize_channels(struct xpc_partition *part, partid_t partid)
72enum xpc_retval 72enum xpc_retval
73xpc_setup_infrastructure(struct xpc_partition *part) 73xpc_setup_infrastructure(struct xpc_partition *part)
74{ 74{
75 int ret; 75 int ret, cpuid;
76 struct timer_list *timer; 76 struct timer_list *timer;
77 partid_t partid = XPC_PARTID(part); 77 partid_t partid = XPC_PARTID(part);
78 78
@@ -223,9 +223,9 @@ xpc_setup_infrastructure(struct xpc_partition *part)
223 xpc_vars_part[partid].openclose_args_pa = 223 xpc_vars_part[partid].openclose_args_pa =
224 __pa(part->local_openclose_args); 224 __pa(part->local_openclose_args);
225 xpc_vars_part[partid].IPI_amo_pa = __pa(part->local_IPI_amo_va); 225 xpc_vars_part[partid].IPI_amo_pa = __pa(part->local_IPI_amo_va);
226 xpc_vars_part[partid].IPI_nasid = cpuid_to_nasid(smp_processor_id()); 226 cpuid = raw_smp_processor_id(); /* any CPU in this partition will do */
227 xpc_vars_part[partid].IPI_phys_cpuid = 227 xpc_vars_part[partid].IPI_nasid = cpuid_to_nasid(cpuid);
228 cpu_physical_id(smp_processor_id()); 228 xpc_vars_part[partid].IPI_phys_cpuid = cpu_physical_id(cpuid);
229 xpc_vars_part[partid].nchannels = part->nchannels; 229 xpc_vars_part[partid].nchannels = part->nchannels;
230 xpc_vars_part[partid].magic = XPC_VP_MAGIC1; 230 xpc_vars_part[partid].magic = XPC_VP_MAGIC1;
231 231
diff --git a/arch/ia64/sn/kernel/xpc_main.c b/arch/ia64/sn/kernel/xpc_main.c
index d580adcad927..bb1d5cf30440 100644
--- a/arch/ia64/sn/kernel/xpc_main.c
+++ b/arch/ia64/sn/kernel/xpc_main.c
@@ -420,7 +420,7 @@ xpc_activating(void *__partid)
420 partid_t partid = (u64) __partid; 420 partid_t partid = (u64) __partid;
421 struct xpc_partition *part = &xpc_partitions[partid]; 421 struct xpc_partition *part = &xpc_partitions[partid];
422 unsigned long irq_flags; 422 unsigned long irq_flags;
423 struct sched_param param = { sched_priority: MAX_USER_RT_PRIO - 1 }; 423 struct sched_param param = { sched_priority: MAX_RT_PRIO - 1 };
424 int ret; 424 int ret;
425 425
426 426
diff --git a/arch/ia64/sn/pci/Makefile b/arch/ia64/sn/pci/Makefile
index 2f915bce25f9..321576b1b425 100644
--- a/arch/ia64/sn/pci/Makefile
+++ b/arch/ia64/sn/pci/Makefile
@@ -7,4 +7,4 @@
7# 7#
8# Makefile for the sn pci general routines. 8# Makefile for the sn pci general routines.
9 9
10obj-y := pci_dma.o tioca_provider.o pcibr/ 10obj-y := pci_dma.o tioca_provider.o tioce_provider.o pcibr/
diff --git a/arch/ia64/sn/pci/pci_dma.c b/arch/ia64/sn/pci/pci_dma.c
index a2f7a88aefbb..0e4b9ad9ef02 100644
--- a/arch/ia64/sn/pci/pci_dma.c
+++ b/arch/ia64/sn/pci/pci_dma.c
@@ -79,6 +79,7 @@ void *sn_dma_alloc_coherent(struct device *dev, size_t size,
79{ 79{
80 void *cpuaddr; 80 void *cpuaddr;
81 unsigned long phys_addr; 81 unsigned long phys_addr;
82 int node;
82 struct pci_dev *pdev = to_pci_dev(dev); 83 struct pci_dev *pdev = to_pci_dev(dev);
83 struct sn_pcibus_provider *provider = SN_PCIDEV_BUSPROVIDER(pdev); 84 struct sn_pcibus_provider *provider = SN_PCIDEV_BUSPROVIDER(pdev);
84 85
@@ -86,10 +87,19 @@ void *sn_dma_alloc_coherent(struct device *dev, size_t size,
86 87
87 /* 88 /*
88 * Allocate the memory. 89 * Allocate the memory.
89 * FIXME: We should be doing alloc_pages_node for the node closest
90 * to the PCI device.
91 */ 90 */
92 if (!(cpuaddr = (void *)__get_free_pages(GFP_ATOMIC, get_order(size)))) 91 node = pcibus_to_node(pdev->bus);
92 if (likely(node >=0)) {
93 struct page *p = alloc_pages_node(node, GFP_ATOMIC, get_order(size));
94
95 if (likely(p))
96 cpuaddr = page_address(p);
97 else
98 return NULL;
99 } else
100 cpuaddr = (void *)__get_free_pages(GFP_ATOMIC, get_order(size));
101
102 if (unlikely(!cpuaddr))
93 return NULL; 103 return NULL;
94 104
95 memset(cpuaddr, 0x0, size); 105 memset(cpuaddr, 0x0, size);
diff --git a/arch/ia64/sn/pci/pcibr/pcibr_dma.c b/arch/ia64/sn/pci/pcibr/pcibr_dma.c
index b058dc2a0b9d..34093476e965 100644
--- a/arch/ia64/sn/pci/pcibr/pcibr_dma.c
+++ b/arch/ia64/sn/pci/pcibr/pcibr_dma.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) 2001-2004 Silicon Graphics, Inc. All rights reserved. 6 * Copyright (C) 2001-2005 Silicon Graphics, Inc. All rights reserved.
7 */ 7 */
8 8
9#include <linux/types.h> 9#include <linux/types.h>
@@ -215,8 +215,8 @@ void sn_dma_flush(uint64_t addr)
215 int is_tio; 215 int is_tio;
216 int wid_num; 216 int wid_num;
217 int i, j; 217 int i, j;
218 int bwin;
219 uint64_t flags; 218 uint64_t flags;
219 uint64_t itte;
220 struct hubdev_info *hubinfo; 220 struct hubdev_info *hubinfo;
221 volatile struct sn_flush_device_list *p; 221 volatile struct sn_flush_device_list *p;
222 struct sn_flush_nasid_entry *flush_nasid_list; 222 struct sn_flush_nasid_entry *flush_nasid_list;
@@ -233,31 +233,36 @@ void sn_dma_flush(uint64_t addr)
233 if (!hubinfo) { 233 if (!hubinfo) {
234 BUG(); 234 BUG();
235 } 235 }
236 is_tio = (nasid & 1);
237 if (is_tio) {
238 wid_num = TIO_SWIN_WIDGETNUM(addr);
239 bwin = TIO_BWIN_WINDOWNUM(addr);
240 } else {
241 wid_num = SWIN_WIDGETNUM(addr);
242 bwin = BWIN_WINDOWNUM(addr);
243 }
244 236
245 flush_nasid_list = &hubinfo->hdi_flush_nasid_list; 237 flush_nasid_list = &hubinfo->hdi_flush_nasid_list;
246 if (flush_nasid_list->widget_p == NULL) 238 if (flush_nasid_list->widget_p == NULL)
247 return; 239 return;
248 if (bwin > 0) {
249 uint64_t itte = flush_nasid_list->iio_itte[bwin];
250 240
251 if (is_tio) { 241 is_tio = (nasid & 1);
252 wid_num = (itte >> TIO_ITTE_WIDGET_SHIFT) & 242 if (is_tio) {
253 TIO_ITTE_WIDGET_MASK; 243 int itte_index;
254 } else { 244
255 wid_num = (itte >> IIO_ITTE_WIDGET_SHIFT) & 245 if (TIO_HWIN(addr))
256 IIO_ITTE_WIDGET_MASK; 246 itte_index = 0;
257 } 247 else if (TIO_BWIN_WINDOWNUM(addr))
248 itte_index = TIO_BWIN_WINDOWNUM(addr);
249 else
250 itte_index = -1;
251
252 if (itte_index >= 0) {
253 itte = flush_nasid_list->iio_itte[itte_index];
254 if (! TIO_ITTE_VALID(itte))
255 return;
256 wid_num = TIO_ITTE_WIDGET(itte);
257 } else
258 wid_num = TIO_SWIN_WIDGETNUM(addr);
259 } else {
260 if (BWIN_WINDOWNUM(addr)) {
261 itte = flush_nasid_list->iio_itte[BWIN_WINDOWNUM(addr)];
262 wid_num = IIO_ITTE_WIDGET(itte);
263 } else
264 wid_num = SWIN_WIDGETNUM(addr);
258 } 265 }
259 if (flush_nasid_list->widget_p == NULL)
260 return;
261 if (flush_nasid_list->widget_p[wid_num] == NULL) 266 if (flush_nasid_list->widget_p[wid_num] == NULL)
262 return; 267 return;
263 p = &flush_nasid_list->widget_p[wid_num][0]; 268 p = &flush_nasid_list->widget_p[wid_num][0];
@@ -283,10 +288,16 @@ void sn_dma_flush(uint64_t addr)
283 /* 288 /*
284 * For TIOCP use the Device(x) Write Request Buffer Flush Bridge 289 * For TIOCP use the Device(x) Write Request Buffer Flush Bridge
285 * register since it ensures the data has entered the coherence 290 * register since it ensures the data has entered the coherence
286 * domain, unlike PIC 291 * domain, unlike PIC.
287 */ 292 */
288 if (is_tio) { 293 if (is_tio) {
289 uint32_t tio_id = REMOTE_HUB_L(nasid, TIO_NODE_ID); 294 /*
295 * Note: devices behind TIOCE should never be matched in the
296 * above code, and so the following code is PIC/CP centric.
297 * If CE ever needs the sn_dma_flush mechanism, we will have
298 * to account for that here and in tioce_bus_fixup().
299 */
300 uint32_t tio_id = HUB_L(TIO_IOSPACE_ADDR(nasid, TIO_NODE_ID));
290 uint32_t revnum = XWIDGET_PART_REV_NUM(tio_id); 301 uint32_t revnum = XWIDGET_PART_REV_NUM(tio_id);
291 302
292 /* TIOCP BRINGUP WAR (PV907516): Don't write buffer flush reg */ 303 /* TIOCP BRINGUP WAR (PV907516): Don't write buffer flush reg */
@@ -306,7 +317,8 @@ void sn_dma_flush(uint64_t addr)
306 *(volatile uint32_t *)(p->sfdl_force_int_addr) = 1; 317 *(volatile uint32_t *)(p->sfdl_force_int_addr) = 1;
307 318
308 /* wait for the interrupt to come back. */ 319 /* wait for the interrupt to come back. */
309 while (*(p->sfdl_flush_addr) != 0x10f) ; 320 while (*(p->sfdl_flush_addr) != 0x10f)
321 cpu_relax();
310 322
311 /* okay, everything is synched up. */ 323 /* okay, everything is synched up. */
312 spin_unlock_irqrestore((spinlock_t *)&p->sfdl_flush_lock, flags); 324 spin_unlock_irqrestore((spinlock_t *)&p->sfdl_flush_lock, flags);
diff --git a/arch/ia64/sn/pci/pcibr/pcibr_provider.c b/arch/ia64/sn/pci/pcibr/pcibr_provider.c
index 9813da56d311..7b03b8084ffc 100644
--- a/arch/ia64/sn/pci/pcibr/pcibr_provider.c
+++ b/arch/ia64/sn/pci/pcibr/pcibr_provider.c
@@ -15,6 +15,7 @@
15#include <asm/sn/pcibus_provider_defs.h> 15#include <asm/sn/pcibus_provider_defs.h>
16#include <asm/sn/pcidev.h> 16#include <asm/sn/pcidev.h>
17#include <asm/sn/sn_sal.h> 17#include <asm/sn/sn_sal.h>
18#include <asm/sn/sn2/sn_hwperf.h>
18#include "xtalk/xwidgetdev.h" 19#include "xtalk/xwidgetdev.h"
19#include "xtalk/hubdev.h" 20#include "xtalk/hubdev.h"
20 21
@@ -60,7 +61,7 @@ static int sal_pcibr_error_interrupt(struct pcibus_info *soft)
60 ret_stuff.status = 0; 61 ret_stuff.status = 0;
61 ret_stuff.v0 = 0; 62 ret_stuff.v0 = 0;
62 63
63 segment = 0; 64 segment = soft->pbi_buscommon.bs_persist_segment;
64 busnum = soft->pbi_buscommon.bs_persist_busnum; 65 busnum = soft->pbi_buscommon.bs_persist_busnum;
65 SAL_CALL_NOLOCK(ret_stuff, 66 SAL_CALL_NOLOCK(ret_stuff,
66 (u64) SN_SAL_IOIF_ERROR_INTERRUPT, 67 (u64) SN_SAL_IOIF_ERROR_INTERRUPT,
@@ -85,9 +86,10 @@ pcibr_error_intr_handler(int irq, void *arg, struct pt_regs *regs)
85} 86}
86 87
87void * 88void *
88pcibr_bus_fixup(struct pcibus_bussoft *prom_bussoft) 89pcibr_bus_fixup(struct pcibus_bussoft *prom_bussoft, struct pci_controller *controller)
89{ 90{
90 int nasid, cnode, j; 91 int nasid, cnode, j;
92 cnodeid_t near_cnode;
91 struct hubdev_info *hubdev_info; 93 struct hubdev_info *hubdev_info;
92 struct pcibus_info *soft; 94 struct pcibus_info *soft;
93 struct sn_flush_device_list *sn_flush_device_list; 95 struct sn_flush_device_list *sn_flush_device_list;
@@ -115,7 +117,7 @@ pcibr_bus_fixup(struct pcibus_bussoft *prom_bussoft)
115 /* 117 /*
116 * register the bridge's error interrupt handler 118 * register the bridge's error interrupt handler
117 */ 119 */
118 if (request_irq(SGI_PCIBR_ERROR, (void *)pcibr_error_intr_handler, 120 if (request_irq(SGI_PCIASIC_ERROR, (void *)pcibr_error_intr_handler,
119 SA_SHIRQ, "PCIBR error", (void *)(soft))) { 121 SA_SHIRQ, "PCIBR error", (void *)(soft))) {
120 printk(KERN_WARNING 122 printk(KERN_WARNING
121 "pcibr cannot allocate interrupt for error handler\n"); 123 "pcibr cannot allocate interrupt for error handler\n");
@@ -142,9 +144,12 @@ pcibr_bus_fixup(struct pcibus_bussoft *prom_bussoft)
142 j++, sn_flush_device_list++) { 144 j++, sn_flush_device_list++) {
143 if (sn_flush_device_list->sfdl_slot == -1) 145 if (sn_flush_device_list->sfdl_slot == -1)
144 continue; 146 continue;
145 if (sn_flush_device_list-> 147 if ((sn_flush_device_list->
146 sfdl_persistent_busnum == 148 sfdl_persistent_segment ==
147 soft->pbi_buscommon.bs_persist_busnum) 149 soft->pbi_buscommon.bs_persist_segment) &&
150 (sn_flush_device_list->
151 sfdl_persistent_busnum ==
152 soft->pbi_buscommon.bs_persist_busnum))
148 sn_flush_device_list->sfdl_pcibus_info = 153 sn_flush_device_list->sfdl_pcibus_info =
149 soft; 154 soft;
150 } 155 }
@@ -158,6 +163,20 @@ pcibr_bus_fixup(struct pcibus_bussoft *prom_bussoft)
158 memset(soft->pbi_int_ate_resource.ate, 0, 163 memset(soft->pbi_int_ate_resource.ate, 0,
159 (soft->pbi_int_ate_size * sizeof(uint64_t))); 164 (soft->pbi_int_ate_size * sizeof(uint64_t)));
160 165
166 if (prom_bussoft->bs_asic_type == PCIIO_ASIC_TYPE_TIOCP) {
167 /* TIO PCI Bridge: find nearest node with CPUs */
168 int e = sn_hwperf_get_nearest_node(cnode, NULL, &near_cnode);
169
170 if (e < 0) {
171 near_cnode = (cnodeid_t)-1; /* use any node */
172 printk(KERN_WARNING "pcibr_bus_fixup: failed to find "
173 "near node with CPUs to TIO node %d, err=%d\n",
174 cnode, e);
175 }
176 controller->node = near_cnode;
177 }
178 else
179 controller->node = cnode;
161 return soft; 180 return soft;
162} 181}
163 182
@@ -167,6 +186,9 @@ void pcibr_force_interrupt(struct sn_irq_info *sn_irq_info)
167 struct pcibus_info *pcibus_info; 186 struct pcibus_info *pcibus_info;
168 int bit = sn_irq_info->irq_int_bit; 187 int bit = sn_irq_info->irq_int_bit;
169 188
189 if (! sn_irq_info->irq_bridge)
190 return;
191
170 pcidev_info = (struct pcidev_info *)sn_irq_info->irq_pciioinfo; 192 pcidev_info = (struct pcidev_info *)sn_irq_info->irq_pciioinfo;
171 if (pcidev_info) { 193 if (pcidev_info) {
172 pcibus_info = 194 pcibus_info =
@@ -176,7 +198,7 @@ void pcibr_force_interrupt(struct sn_irq_info *sn_irq_info)
176 } 198 }
177} 199}
178 200
179void pcibr_change_devices_irq(struct sn_irq_info *sn_irq_info) 201void pcibr_target_interrupt(struct sn_irq_info *sn_irq_info)
180{ 202{
181 struct pcidev_info *pcidev_info; 203 struct pcidev_info *pcidev_info;
182 struct pcibus_info *pcibus_info; 204 struct pcibus_info *pcibus_info;
@@ -211,6 +233,8 @@ struct sn_pcibus_provider pcibr_provider = {
211 .dma_map_consistent = pcibr_dma_map_consistent, 233 .dma_map_consistent = pcibr_dma_map_consistent,
212 .dma_unmap = pcibr_dma_unmap, 234 .dma_unmap = pcibr_dma_unmap,
213 .bus_fixup = pcibr_bus_fixup, 235 .bus_fixup = pcibr_bus_fixup,
236 .force_interrupt = pcibr_force_interrupt,
237 .target_interrupt = pcibr_target_interrupt
214}; 238};
215 239
216int 240int
diff --git a/arch/ia64/sn/pci/tioca_provider.c b/arch/ia64/sn/pci/tioca_provider.c
index 51cc4e63092c..ea09c12f0258 100644
--- a/arch/ia64/sn/pci/tioca_provider.c
+++ b/arch/ia64/sn/pci/tioca_provider.c
@@ -559,7 +559,7 @@ tioca_error_intr_handler(int irq, void *arg, struct pt_regs *pt)
559 ret_stuff.status = 0; 559 ret_stuff.status = 0;
560 ret_stuff.v0 = 0; 560 ret_stuff.v0 = 0;
561 561
562 segment = 0; 562 segment = soft->ca_common.bs_persist_segment;
563 busnum = soft->ca_common.bs_persist_busnum; 563 busnum = soft->ca_common.bs_persist_busnum;
564 564
565 SAL_CALL_NOLOCK(ret_stuff, 565 SAL_CALL_NOLOCK(ret_stuff,
@@ -581,7 +581,7 @@ tioca_error_intr_handler(int irq, void *arg, struct pt_regs *pt)
581 * the caller. 581 * the caller.
582 */ 582 */
583static void * 583static void *
584tioca_bus_fixup(struct pcibus_bussoft *prom_bussoft) 584tioca_bus_fixup(struct pcibus_bussoft *prom_bussoft, struct pci_controller *controller)
585{ 585{
586 struct tioca_common *tioca_common; 586 struct tioca_common *tioca_common;
587 struct tioca_kernel *tioca_kern; 587 struct tioca_kernel *tioca_kern;
@@ -622,7 +622,8 @@ tioca_bus_fixup(struct pcibus_bussoft *prom_bussoft)
622 nasid_to_cnodeid(tioca_common->ca_closest_nasid); 622 nasid_to_cnodeid(tioca_common->ca_closest_nasid);
623 tioca_common->ca_kernel_private = (uint64_t) tioca_kern; 623 tioca_common->ca_kernel_private = (uint64_t) tioca_kern;
624 624
625 bus = pci_find_bus(0, tioca_common->ca_common.bs_persist_busnum); 625 bus = pci_find_bus(tioca_common->ca_common.bs_persist_segment,
626 tioca_common->ca_common.bs_persist_busnum);
626 BUG_ON(!bus); 627 BUG_ON(!bus);
627 tioca_kern->ca_devices = &bus->devices; 628 tioca_kern->ca_devices = &bus->devices;
628 629
@@ -646,6 +647,8 @@ tioca_bus_fixup(struct pcibus_bussoft *prom_bussoft)
646 __FUNCTION__, SGI_TIOCA_ERROR, 647 __FUNCTION__, SGI_TIOCA_ERROR,
647 (int)tioca_common->ca_common.bs_persist_busnum); 648 (int)tioca_common->ca_common.bs_persist_busnum);
648 649
650 /* Setup locality information */
651 controller->node = tioca_kern->ca_closest_node;
649 return tioca_common; 652 return tioca_common;
650} 653}
651 654
@@ -654,6 +657,8 @@ static struct sn_pcibus_provider tioca_pci_interfaces = {
654 .dma_map_consistent = tioca_dma_map, 657 .dma_map_consistent = tioca_dma_map,
655 .dma_unmap = tioca_dma_unmap, 658 .dma_unmap = tioca_dma_unmap,
656 .bus_fixup = tioca_bus_fixup, 659 .bus_fixup = tioca_bus_fixup,
660 .force_interrupt = NULL,
661 .target_interrupt = NULL
657}; 662};
658 663
659/** 664/**
diff --git a/arch/ia64/sn/pci/tioce_provider.c b/arch/ia64/sn/pci/tioce_provider.c
new file mode 100644
index 000000000000..8e75db2b825d
--- /dev/null
+++ b/arch/ia64/sn/pci/tioce_provider.c
@@ -0,0 +1,771 @@
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) 2003-2005 Silicon Graphics, Inc. All Rights Reserved.
7 */
8
9#include <linux/types.h>
10#include <linux/interrupt.h>
11#include <linux/pci.h>
12#include <asm/sn/sn_sal.h>
13#include <asm/sn/addrs.h>
14#include <asm/sn/pcidev.h>
15#include <asm/sn/pcibus_provider_defs.h>
16#include <asm/sn/tioce_provider.h>
17
18/**
19 * Bus address ranges for the 5 flavors of TIOCE DMA
20 */
21
22#define TIOCE_D64_MIN 0x8000000000000000UL
23#define TIOCE_D64_MAX 0xffffffffffffffffUL
24#define TIOCE_D64_ADDR(a) ((a) >= TIOCE_D64_MIN)
25
26#define TIOCE_D32_MIN 0x0000000080000000UL
27#define TIOCE_D32_MAX 0x00000000ffffffffUL
28#define TIOCE_D32_ADDR(a) ((a) >= TIOCE_D32_MIN && (a) <= TIOCE_D32_MAX)
29
30#define TIOCE_M32_MIN 0x0000000000000000UL
31#define TIOCE_M32_MAX 0x000000007fffffffUL
32#define TIOCE_M32_ADDR(a) ((a) >= TIOCE_M32_MIN && (a) <= TIOCE_M32_MAX)
33
34#define TIOCE_M40_MIN 0x0000004000000000UL
35#define TIOCE_M40_MAX 0x0000007fffffffffUL
36#define TIOCE_M40_ADDR(a) ((a) >= TIOCE_M40_MIN && (a) <= TIOCE_M40_MAX)
37
38#define TIOCE_M40S_MIN 0x0000008000000000UL
39#define TIOCE_M40S_MAX 0x000000ffffffffffUL
40#define TIOCE_M40S_ADDR(a) ((a) >= TIOCE_M40S_MIN && (a) <= TIOCE_M40S_MAX)
41
42/*
43 * ATE manipulation macros.
44 */
45
46#define ATE_PAGESHIFT(ps) (__ffs(ps))
47#define ATE_PAGEMASK(ps) ((ps)-1)
48
49#define ATE_PAGE(x, ps) ((x) >> ATE_PAGESHIFT(ps))
50#define ATE_NPAGES(start, len, pagesize) \
51 (ATE_PAGE((start)+(len)-1, pagesize) - ATE_PAGE(start, pagesize) + 1)
52
53#define ATE_VALID(ate) ((ate) & (1UL << 63))
54#define ATE_MAKE(addr, ps) (((addr) & ~ATE_PAGEMASK(ps)) | (1UL << 63))
55
56/*
57 * Flavors of ate-based mapping supported by tioce_alloc_map()
58 */
59
60#define TIOCE_ATE_M32 1
61#define TIOCE_ATE_M40 2
62#define TIOCE_ATE_M40S 3
63
64#define KB(x) ((x) << 10)
65#define MB(x) ((x) << 20)
66#define GB(x) ((x) << 30)
67
68/**
69 * tioce_dma_d64 - create a DMA mapping using 64-bit direct mode
70 * @ct_addr: system coretalk address
71 *
72 * Map @ct_addr into 64-bit CE bus space. No device context is necessary
73 * and no CE mapping are consumed.
74 *
75 * Bits 53:0 come from the coretalk address. The remaining bits are set as
76 * follows:
77 *
78 * 63 - must be 1 to indicate d64 mode to CE hardware
79 * 62 - barrier bit ... controlled with tioce_dma_barrier()
80 * 61 - 0 since this is not an MSI transaction
81 * 60:54 - reserved, MBZ
82 */
83static uint64_t
84tioce_dma_d64(unsigned long ct_addr)
85{
86 uint64_t bus_addr;
87
88 bus_addr = ct_addr | (1UL << 63);
89
90 return bus_addr;
91}
92
93/**
94 * pcidev_to_tioce - return misc ce related pointers given a pci_dev
95 * @pci_dev: pci device context
96 * @base: ptr to store struct tioce_mmr * for the CE holding this device
97 * @kernel: ptr to store struct tioce_kernel * for the CE holding this device
98 * @port: ptr to store the CE port number that this device is on
99 *
100 * Return pointers to various CE-related structures for the CE upstream of
101 * @pci_dev.
102 */
103static inline void
104pcidev_to_tioce(struct pci_dev *pdev, struct tioce **base,
105 struct tioce_kernel **kernel, int *port)
106{
107 struct pcidev_info *pcidev_info;
108 struct tioce_common *ce_common;
109 struct tioce_kernel *ce_kernel;
110
111 pcidev_info = SN_PCIDEV_INFO(pdev);
112 ce_common = (struct tioce_common *)pcidev_info->pdi_pcibus_info;
113 ce_kernel = (struct tioce_kernel *)ce_common->ce_kernel_private;
114
115 if (base)
116 *base = (struct tioce *)ce_common->ce_pcibus.bs_base;
117 if (kernel)
118 *kernel = ce_kernel;
119
120 /*
121 * we use port as a zero-based value internally, even though the
122 * documentation is 1-based.
123 */
124 if (port)
125 *port =
126 (pdev->bus->number < ce_kernel->ce_port1_secondary) ? 0 : 1;
127}
128
129/**
130 * tioce_alloc_map - Given a coretalk address, map it to pcie bus address
131 * space using one of the various ATE-based address modes.
132 * @ce_kern: tioce context
133 * @type: map mode to use
134 * @port: 0-based port that the requesting device is downstream of
135 * @ct_addr: the coretalk address to map
136 * @len: number of bytes to map
137 *
138 * Given the addressing type, set up various paramaters that define the
139 * ATE pool to use. Search for a contiguous block of entries to cover the
140 * length, and if enough resources exist, fill in the ATE's and construct a
141 * tioce_dmamap struct to track the mapping.
142 */
143static uint64_t
144tioce_alloc_map(struct tioce_kernel *ce_kern, int type, int port,
145 uint64_t ct_addr, int len)
146{
147 int i;
148 int j;
149 int first;
150 int last;
151 int entries;
152 int nates;
153 int pagesize;
154 uint64_t *ate_shadow;
155 uint64_t *ate_reg;
156 uint64_t addr;
157 struct tioce *ce_mmr;
158 uint64_t bus_base;
159 struct tioce_dmamap *map;
160
161 ce_mmr = (struct tioce *)ce_kern->ce_common->ce_pcibus.bs_base;
162
163 switch (type) {
164 case TIOCE_ATE_M32:
165 /*
166 * The first 64 entries of the ate3240 pool are dedicated to
167 * super-page (TIOCE_ATE_M40S) mode.
168 */
169 first = 64;
170 entries = TIOCE_NUM_M3240_ATES - 64;
171 ate_shadow = ce_kern->ce_ate3240_shadow;
172 ate_reg = ce_mmr->ce_ure_ate3240;
173 pagesize = ce_kern->ce_ate3240_pagesize;
174 bus_base = TIOCE_M32_MIN;
175 break;
176 case TIOCE_ATE_M40:
177 first = 0;
178 entries = TIOCE_NUM_M40_ATES;
179 ate_shadow = ce_kern->ce_ate40_shadow;
180 ate_reg = ce_mmr->ce_ure_ate40;
181 pagesize = MB(64);
182 bus_base = TIOCE_M40_MIN;
183 break;
184 case TIOCE_ATE_M40S:
185 /*
186 * ate3240 entries 0-31 are dedicated to port1 super-page
187 * mappings. ate3240 entries 32-63 are dedicated to port2.
188 */
189 first = port * 32;
190 entries = 32;
191 ate_shadow = ce_kern->ce_ate3240_shadow;
192 ate_reg = ce_mmr->ce_ure_ate3240;
193 pagesize = GB(16);
194 bus_base = TIOCE_M40S_MIN;
195 break;
196 default:
197 return 0;
198 }
199
200 nates = ATE_NPAGES(ct_addr, len, pagesize);
201 if (nates > entries)
202 return 0;
203
204 last = first + entries - nates;
205 for (i = first; i <= last; i++) {
206 if (ATE_VALID(ate_shadow[i]))
207 continue;
208
209 for (j = i; j < i + nates; j++)
210 if (ATE_VALID(ate_shadow[j]))
211 break;
212
213 if (j >= i + nates)
214 break;
215 }
216
217 if (i > last)
218 return 0;
219
220 map = kcalloc(1, sizeof(struct tioce_dmamap), GFP_ATOMIC);
221 if (!map)
222 return 0;
223
224 addr = ct_addr;
225 for (j = 0; j < nates; j++) {
226 uint64_t ate;
227
228 ate = ATE_MAKE(addr, pagesize);
229 ate_shadow[i + j] = ate;
230 ate_reg[i + j] = ate;
231 addr += pagesize;
232 }
233
234 map->refcnt = 1;
235 map->nbytes = nates * pagesize;
236 map->ct_start = ct_addr & ~ATE_PAGEMASK(pagesize);
237 map->pci_start = bus_base + (i * pagesize);
238 map->ate_hw = &ate_reg[i];
239 map->ate_shadow = &ate_shadow[i];
240 map->ate_count = nates;
241
242 list_add(&map->ce_dmamap_list, &ce_kern->ce_dmamap_list);
243
244 return (map->pci_start + (ct_addr - map->ct_start));
245}
246
247/**
248 * tioce_dma_d32 - create a DMA mapping using 32-bit direct mode
249 * @pdev: linux pci_dev representing the function
250 * @paddr: system physical address
251 *
252 * Map @paddr into 32-bit bus space of the CE associated with @pcidev_info.
253 */
254static uint64_t
255tioce_dma_d32(struct pci_dev *pdev, uint64_t ct_addr)
256{
257 int dma_ok;
258 int port;
259 struct tioce *ce_mmr;
260 struct tioce_kernel *ce_kern;
261 uint64_t ct_upper;
262 uint64_t ct_lower;
263 dma_addr_t bus_addr;
264
265 ct_upper = ct_addr & ~0x3fffffffUL;
266 ct_lower = ct_addr & 0x3fffffffUL;
267
268 pcidev_to_tioce(pdev, &ce_mmr, &ce_kern, &port);
269
270 if (ce_kern->ce_port[port].dirmap_refcnt == 0) {
271 volatile uint64_t tmp;
272
273 ce_kern->ce_port[port].dirmap_shadow = ct_upper;
274 ce_mmr->ce_ure_dir_map[port] = ct_upper;
275 tmp = ce_mmr->ce_ure_dir_map[port];
276 dma_ok = 1;
277 } else
278 dma_ok = (ce_kern->ce_port[port].dirmap_shadow == ct_upper);
279
280 if (dma_ok) {
281 ce_kern->ce_port[port].dirmap_refcnt++;
282 bus_addr = TIOCE_D32_MIN + ct_lower;
283 } else
284 bus_addr = 0;
285
286 return bus_addr;
287}
288
289/**
290 * tioce_dma_barrier - swizzle a TIOCE bus address to include or exclude
291 * the barrier bit.
292 * @bus_addr: bus address to swizzle
293 *
294 * Given a TIOCE bus address, set the appropriate bit to indicate barrier
295 * attributes.
296 */
297static uint64_t
298tioce_dma_barrier(uint64_t bus_addr, int on)
299{
300 uint64_t barrier_bit;
301
302 /* barrier not supported in M40/M40S mode */
303 if (TIOCE_M40_ADDR(bus_addr) || TIOCE_M40S_ADDR(bus_addr))
304 return bus_addr;
305
306 if (TIOCE_D64_ADDR(bus_addr))
307 barrier_bit = (1UL << 62);
308 else /* must be m32 or d32 */
309 barrier_bit = (1UL << 30);
310
311 return (on) ? (bus_addr | barrier_bit) : (bus_addr & ~barrier_bit);
312}
313
314/**
315 * tioce_dma_unmap - release CE mapping resources
316 * @pdev: linux pci_dev representing the function
317 * @bus_addr: bus address returned by an earlier tioce_dma_map
318 * @dir: mapping direction (unused)
319 *
320 * Locate mapping resources associated with @bus_addr and release them.
321 * For mappings created using the direct modes there are no resources
322 * to release.
323 */
324void
325tioce_dma_unmap(struct pci_dev *pdev, dma_addr_t bus_addr, int dir)
326{
327 int i;
328 int port;
329 struct tioce_kernel *ce_kern;
330 struct tioce *ce_mmr;
331 unsigned long flags;
332
333 bus_addr = tioce_dma_barrier(bus_addr, 0);
334 pcidev_to_tioce(pdev, &ce_mmr, &ce_kern, &port);
335
336 /* nothing to do for D64 */
337
338 if (TIOCE_D64_ADDR(bus_addr))
339 return;
340
341 spin_lock_irqsave(&ce_kern->ce_lock, flags);
342
343 if (TIOCE_D32_ADDR(bus_addr)) {
344 if (--ce_kern->ce_port[port].dirmap_refcnt == 0) {
345 ce_kern->ce_port[port].dirmap_shadow = 0;
346 ce_mmr->ce_ure_dir_map[port] = 0;
347 }
348 } else {
349 struct tioce_dmamap *map;
350
351 list_for_each_entry(map, &ce_kern->ce_dmamap_list,
352 ce_dmamap_list) {
353 uint64_t last;
354
355 last = map->pci_start + map->nbytes - 1;
356 if (bus_addr >= map->pci_start && bus_addr <= last)
357 break;
358 }
359
360 if (&map->ce_dmamap_list == &ce_kern->ce_dmamap_list) {
361 printk(KERN_WARNING
362 "%s: %s - no map found for bus_addr 0x%lx\n",
363 __FUNCTION__, pci_name(pdev), bus_addr);
364 } else if (--map->refcnt == 0) {
365 for (i = 0; i < map->ate_count; i++) {
366 map->ate_shadow[i] = 0;
367 map->ate_hw[i] = 0;
368 }
369
370 list_del(&map->ce_dmamap_list);
371 kfree(map);
372 }
373 }
374
375 spin_unlock_irqrestore(&ce_kern->ce_lock, flags);
376}
377
378/**
379 * tioce_do_dma_map - map pages for PCI DMA
380 * @pdev: linux pci_dev representing the function
381 * @paddr: host physical address to map
382 * @byte_count: bytes to map
383 *
384 * This is the main wrapper for mapping host physical pages to CE PCI space.
385 * The mapping mode used is based on the device's dma_mask.
386 */
387static uint64_t
388tioce_do_dma_map(struct pci_dev *pdev, uint64_t paddr, size_t byte_count,
389 int barrier)
390{
391 unsigned long flags;
392 uint64_t ct_addr;
393 uint64_t mapaddr = 0;
394 struct tioce_kernel *ce_kern;
395 struct tioce_dmamap *map;
396 int port;
397 uint64_t dma_mask;
398
399 dma_mask = (barrier) ? pdev->dev.coherent_dma_mask : pdev->dma_mask;
400
401 /* cards must be able to address at least 31 bits */
402 if (dma_mask < 0x7fffffffUL)
403 return 0;
404
405 ct_addr = PHYS_TO_TIODMA(paddr);
406
407 /*
408 * If the device can generate 64 bit addresses, create a D64 map.
409 * Since this should never fail, bypass the rest of the checks.
410 */
411 if (dma_mask == ~0UL) {
412 mapaddr = tioce_dma_d64(ct_addr);
413 goto dma_map_done;
414 }
415
416 pcidev_to_tioce(pdev, NULL, &ce_kern, &port);
417
418 spin_lock_irqsave(&ce_kern->ce_lock, flags);
419
420 /*
421 * D64 didn't work ... See if we have an existing map that covers
422 * this address range. Must account for devices dma_mask here since
423 * an existing map might have been done in a mode using more pci
424 * address bits than this device can support.
425 */
426 list_for_each_entry(map, &ce_kern->ce_dmamap_list, ce_dmamap_list) {
427 uint64_t last;
428
429 last = map->ct_start + map->nbytes - 1;
430 if (ct_addr >= map->ct_start &&
431 ct_addr + byte_count - 1 <= last &&
432 map->pci_start <= dma_mask) {
433 map->refcnt++;
434 mapaddr = map->pci_start + (ct_addr - map->ct_start);
435 break;
436 }
437 }
438
439 /*
440 * If we don't have a map yet, and the card can generate 40
441 * bit addresses, try the M40/M40S modes. Note these modes do not
442 * support a barrier bit, so if we need a consistent map these
443 * won't work.
444 */
445 if (!mapaddr && !barrier && dma_mask >= 0xffffffffffUL) {
446 /*
447 * We have two options for 40-bit mappings: 16GB "super" ATE's
448 * and 64MB "regular" ATE's. We'll try both if needed for a
449 * given mapping but which one we try first depends on the
450 * size. For requests >64MB, prefer to use a super page with
451 * regular as the fallback. Otherwise, try in the reverse order.
452 */
453
454 if (byte_count > MB(64)) {
455 mapaddr = tioce_alloc_map(ce_kern, TIOCE_ATE_M40S,
456 port, ct_addr, byte_count);
457 if (!mapaddr)
458 mapaddr =
459 tioce_alloc_map(ce_kern, TIOCE_ATE_M40, -1,
460 ct_addr, byte_count);
461 } else {
462 mapaddr = tioce_alloc_map(ce_kern, TIOCE_ATE_M40, -1,
463 ct_addr, byte_count);
464 if (!mapaddr)
465 mapaddr =
466 tioce_alloc_map(ce_kern, TIOCE_ATE_M40S,
467 port, ct_addr, byte_count);
468 }
469 }
470
471 /*
472 * 32-bit direct is the next mode to try
473 */
474 if (!mapaddr && dma_mask >= 0xffffffffUL)
475 mapaddr = tioce_dma_d32(pdev, ct_addr);
476
477 /*
478 * Last resort, try 32-bit ATE-based map.
479 */
480 if (!mapaddr)
481 mapaddr =
482 tioce_alloc_map(ce_kern, TIOCE_ATE_M32, -1, ct_addr,
483 byte_count);
484
485 spin_unlock_irqrestore(&ce_kern->ce_lock, flags);
486
487dma_map_done:
488 if (mapaddr & barrier)
489 mapaddr = tioce_dma_barrier(mapaddr, 1);
490
491 return mapaddr;
492}
493
494/**
495 * tioce_dma - standard pci dma map interface
496 * @pdev: pci device requesting the map
497 * @paddr: system physical address to map into pci space
498 * @byte_count: # bytes to map
499 *
500 * Simply call tioce_do_dma_map() to create a map with the barrier bit clear
501 * in the address.
502 */
503static uint64_t
504tioce_dma(struct pci_dev *pdev, uint64_t paddr, size_t byte_count)
505{
506 return tioce_do_dma_map(pdev, paddr, byte_count, 0);
507}
508
509/**
510 * tioce_dma_consistent - consistent pci dma map interface
511 * @pdev: pci device requesting the map
512 * @paddr: system physical address to map into pci space
513 * @byte_count: # bytes to map
514 *
515 * Simply call tioce_do_dma_map() to create a map with the barrier bit set
516 * in the address.
517 */ static uint64_t
518tioce_dma_consistent(struct pci_dev *pdev, uint64_t paddr, size_t byte_count)
519{
520 return tioce_do_dma_map(pdev, paddr, byte_count, 1);
521}
522
523/**
524 * tioce_error_intr_handler - SGI TIO CE error interrupt handler
525 * @irq: unused
526 * @arg: pointer to tioce_common struct for the given CE
527 * @pt: unused
528 *
529 * Handle a CE error interrupt. Simply a wrapper around a SAL call which
530 * defers processing to the SGI prom.
531 */ static irqreturn_t
532tioce_error_intr_handler(int irq, void *arg, struct pt_regs *pt)
533{
534 struct tioce_common *soft = arg;
535 struct ia64_sal_retval ret_stuff;
536 ret_stuff.status = 0;
537 ret_stuff.v0 = 0;
538
539 SAL_CALL_NOLOCK(ret_stuff, (u64) SN_SAL_IOIF_ERROR_INTERRUPT,
540 soft->ce_pcibus.bs_persist_segment,
541 soft->ce_pcibus.bs_persist_busnum, 0, 0, 0, 0, 0);
542
543 return IRQ_HANDLED;
544}
545
546/**
547 * tioce_kern_init - init kernel structures related to a given TIOCE
548 * @tioce_common: ptr to a cached tioce_common struct that originated in prom
549 */ static struct tioce_kernel *
550tioce_kern_init(struct tioce_common *tioce_common)
551{
552 int i;
553 uint32_t tmp;
554 struct tioce *tioce_mmr;
555 struct tioce_kernel *tioce_kern;
556
557 tioce_kern = kcalloc(1, sizeof(struct tioce_kernel), GFP_KERNEL);
558 if (!tioce_kern) {
559 return NULL;
560 }
561
562 tioce_kern->ce_common = tioce_common;
563 spin_lock_init(&tioce_kern->ce_lock);
564 INIT_LIST_HEAD(&tioce_kern->ce_dmamap_list);
565 tioce_common->ce_kernel_private = (uint64_t) tioce_kern;
566
567 /*
568 * Determine the secondary bus number of the port2 logical PPB.
569 * This is used to decide whether a given pci device resides on
570 * port1 or port2. Note: We don't have enough plumbing set up
571 * here to use pci_read_config_xxx() so use the raw_pci_ops vector.
572 */
573
574 raw_pci_ops->read(tioce_common->ce_pcibus.bs_persist_segment,
575 tioce_common->ce_pcibus.bs_persist_busnum,
576 PCI_DEVFN(2, 0), PCI_SECONDARY_BUS, 1, &tmp);
577 tioce_kern->ce_port1_secondary = (uint8_t) tmp;
578
579 /*
580 * Set PMU pagesize to the largest size available, and zero out
581 * the ate's.
582 */
583
584 tioce_mmr = (struct tioce *)tioce_common->ce_pcibus.bs_base;
585 tioce_mmr->ce_ure_page_map &= ~CE_URE_PAGESIZE_MASK;
586 tioce_mmr->ce_ure_page_map |= CE_URE_256K_PAGESIZE;
587 tioce_kern->ce_ate3240_pagesize = KB(256);
588
589 for (i = 0; i < TIOCE_NUM_M40_ATES; i++) {
590 tioce_kern->ce_ate40_shadow[i] = 0;
591 tioce_mmr->ce_ure_ate40[i] = 0;
592 }
593
594 for (i = 0; i < TIOCE_NUM_M3240_ATES; i++) {
595 tioce_kern->ce_ate3240_shadow[i] = 0;
596 tioce_mmr->ce_ure_ate3240[i] = 0;
597 }
598
599 return tioce_kern;
600}
601
602/**
603 * tioce_force_interrupt - implement altix force_interrupt() backend for CE
604 * @sn_irq_info: sn asic irq that we need an interrupt generated for
605 *
606 * Given an sn_irq_info struct, set the proper bit in ce_adm_force_int to
607 * force a secondary interrupt to be generated. This is to work around an
608 * asic issue where there is a small window of opportunity for a legacy device
609 * interrupt to be lost.
610 */
611static void
612tioce_force_interrupt(struct sn_irq_info *sn_irq_info)
613{
614 struct pcidev_info *pcidev_info;
615 struct tioce_common *ce_common;
616 struct tioce *ce_mmr;
617 uint64_t force_int_val;
618
619 if (!sn_irq_info->irq_bridge)
620 return;
621
622 if (sn_irq_info->irq_bridge_type != PCIIO_ASIC_TYPE_TIOCE)
623 return;
624
625 pcidev_info = (struct pcidev_info *)sn_irq_info->irq_pciioinfo;
626 if (!pcidev_info)
627 return;
628
629 ce_common = (struct tioce_common *)pcidev_info->pdi_pcibus_info;
630 ce_mmr = (struct tioce *)ce_common->ce_pcibus.bs_base;
631
632 /*
633 * irq_int_bit is originally set up by prom, and holds the interrupt
634 * bit shift (not mask) as defined by the bit definitions in the
635 * ce_adm_int mmr. These shifts are not the same for the
636 * ce_adm_force_int register, so do an explicit mapping here to make
637 * things clearer.
638 */
639
640 switch (sn_irq_info->irq_int_bit) {
641 case CE_ADM_INT_PCIE_PORT1_DEV_A_SHFT:
642 force_int_val = 1UL << CE_ADM_FORCE_INT_PCIE_PORT1_DEV_A_SHFT;
643 break;
644 case CE_ADM_INT_PCIE_PORT1_DEV_B_SHFT:
645 force_int_val = 1UL << CE_ADM_FORCE_INT_PCIE_PORT1_DEV_B_SHFT;
646 break;
647 case CE_ADM_INT_PCIE_PORT1_DEV_C_SHFT:
648 force_int_val = 1UL << CE_ADM_FORCE_INT_PCIE_PORT1_DEV_C_SHFT;
649 break;
650 case CE_ADM_INT_PCIE_PORT1_DEV_D_SHFT:
651 force_int_val = 1UL << CE_ADM_FORCE_INT_PCIE_PORT1_DEV_D_SHFT;
652 break;
653 case CE_ADM_INT_PCIE_PORT2_DEV_A_SHFT:
654 force_int_val = 1UL << CE_ADM_FORCE_INT_PCIE_PORT2_DEV_A_SHFT;
655 break;
656 case CE_ADM_INT_PCIE_PORT2_DEV_B_SHFT:
657 force_int_val = 1UL << CE_ADM_FORCE_INT_PCIE_PORT2_DEV_B_SHFT;
658 break;
659 case CE_ADM_INT_PCIE_PORT2_DEV_C_SHFT:
660 force_int_val = 1UL << CE_ADM_FORCE_INT_PCIE_PORT2_DEV_C_SHFT;
661 break;
662 case CE_ADM_INT_PCIE_PORT2_DEV_D_SHFT:
663 force_int_val = 1UL << CE_ADM_FORCE_INT_PCIE_PORT2_DEV_D_SHFT;
664 break;
665 default:
666 return;
667 }
668 ce_mmr->ce_adm_force_int = force_int_val;
669}
670
671/**
672 * tioce_target_interrupt - implement set_irq_affinity for tioce resident
673 * functions. Note: only applies to line interrupts, not MSI's.
674 *
675 * @sn_irq_info: SN IRQ context
676 *
677 * Given an sn_irq_info, set the associated CE device's interrupt destination
678 * register. Since the interrupt destination registers are on a per-ce-slot
679 * basis, this will retarget line interrupts for all functions downstream of
680 * the slot.
681 */
682static void
683tioce_target_interrupt(struct sn_irq_info *sn_irq_info)
684{
685 struct pcidev_info *pcidev_info;
686 struct tioce_common *ce_common;
687 struct tioce *ce_mmr;
688 int bit;
689
690 pcidev_info = (struct pcidev_info *)sn_irq_info->irq_pciioinfo;
691 if (!pcidev_info)
692 return;
693
694 ce_common = (struct tioce_common *)pcidev_info->pdi_pcibus_info;
695 ce_mmr = (struct tioce *)ce_common->ce_pcibus.bs_base;
696
697 bit = sn_irq_info->irq_int_bit;
698
699 ce_mmr->ce_adm_int_mask |= (1UL << bit);
700 ce_mmr->ce_adm_int_dest[bit] =
701 ((uint64_t)sn_irq_info->irq_irq << INTR_VECTOR_SHFT) |
702 sn_irq_info->irq_xtalkaddr;
703 ce_mmr->ce_adm_int_mask &= ~(1UL << bit);
704
705 tioce_force_interrupt(sn_irq_info);
706}
707
708/**
709 * tioce_bus_fixup - perform final PCI fixup for a TIO CE bus
710 * @prom_bussoft: Common prom/kernel struct representing the bus
711 *
712 * Replicates the tioce_common pointed to by @prom_bussoft in kernel
713 * space. Allocates and initializes a kernel-only area for a given CE,
714 * and sets up an irq for handling CE error interrupts.
715 *
716 * On successful setup, returns the kernel version of tioce_common back to
717 * the caller.
718 */
719static void *
720tioce_bus_fixup(struct pcibus_bussoft *prom_bussoft, struct pci_controller *controller)
721{
722 struct tioce_common *tioce_common;
723
724 /*
725 * Allocate kernel bus soft and copy from prom.
726 */
727
728 tioce_common = kcalloc(1, sizeof(struct tioce_common), GFP_KERNEL);
729 if (!tioce_common)
730 return NULL;
731
732 memcpy(tioce_common, prom_bussoft, sizeof(struct tioce_common));
733 tioce_common->ce_pcibus.bs_base |= __IA64_UNCACHED_OFFSET;
734
735 if (tioce_kern_init(tioce_common) == NULL) {
736 kfree(tioce_common);
737 return NULL;
738 }
739
740 if (request_irq(SGI_PCIASIC_ERROR,
741 tioce_error_intr_handler,
742 SA_SHIRQ, "TIOCE error", (void *)tioce_common))
743 printk(KERN_WARNING
744 "%s: Unable to get irq %d. "
745 "Error interrupts won't be routed for "
746 "TIOCE bus %04x:%02x\n",
747 __FUNCTION__, SGI_PCIASIC_ERROR,
748 tioce_common->ce_pcibus.bs_persist_segment,
749 tioce_common->ce_pcibus.bs_persist_busnum);
750
751 return tioce_common;
752}
753
754static struct sn_pcibus_provider tioce_pci_interfaces = {
755 .dma_map = tioce_dma,
756 .dma_map_consistent = tioce_dma_consistent,
757 .dma_unmap = tioce_dma_unmap,
758 .bus_fixup = tioce_bus_fixup,
759 .force_interrupt = tioce_force_interrupt,
760 .target_interrupt = tioce_target_interrupt
761};
762
763/**
764 * tioce_init_provider - init SN PCI provider ops for TIO CE
765 */
766int
767tioce_init_provider(void)
768{
769 sn_pci_provider[PCIIO_ASIC_TYPE_TIOCE] = &tioce_pci_interfaces;
770 return 0;
771}
diff --git a/arch/m32r/Kconfig b/arch/m32r/Kconfig
index 42ca8a39798d..7622d4ec5f08 100644
--- a/arch/m32r/Kconfig
+++ b/arch/m32r/Kconfig
@@ -269,7 +269,7 @@ config NR_CPUS
269# Common NUMA Features 269# Common NUMA Features
270config NUMA 270config NUMA
271 bool "Numa Memory Allocation Support" 271 bool "Numa Memory Allocation Support"
272 depends on SMP 272 depends on SMP && BROKEN
273 default n 273 default n
274 274
275# turning this on wastes a bunch of space. 275# turning this on wastes a bunch of space.
@@ -286,6 +286,7 @@ menu "Bus options (PCI, PCMCIA, EISA, MCA, ISA)"
286 286
287config PCI 287config PCI
288 bool "PCI support" 288 bool "PCI support"
289 depends on BROKEN
289 default n 290 default n
290 help 291 help
291 Find out whether you have a PCI motherboard. PCI is the name of a 292 Find out whether you have a PCI motherboard. PCI is the name of a
@@ -359,6 +360,8 @@ source "fs/Kconfig.binfmt"
359 360
360endmenu 361endmenu
361 362
363source "net/Kconfig"
364
362source "drivers/Kconfig" 365source "drivers/Kconfig"
363 366
364source "fs/Kconfig" 367source "fs/Kconfig"
diff --git a/arch/m32r/Kconfig.debug b/arch/m32r/Kconfig.debug
index 36788c2c310d..bbf711bab69e 100644
--- a/arch/m32r/Kconfig.debug
+++ b/arch/m32r/Kconfig.debug
@@ -5,6 +5,9 @@ source "lib/Kconfig.debug"
5config DEBUG_STACKOVERFLOW 5config DEBUG_STACKOVERFLOW
6 bool "Check for stack overflows" 6 bool "Check for stack overflows"
7 depends on DEBUG_KERNEL 7 depends on DEBUG_KERNEL
8 help
9 This option will cause messages to be printed if free stack space
10 drops below a certain limit.
8 11
9config DEBUG_STACK_USAGE 12config DEBUG_STACK_USAGE
10 bool "Stack utilization instrumentation" 13 bool "Stack utilization instrumentation"
@@ -17,7 +20,7 @@ config DEBUG_STACK_USAGE
17 20
18config DEBUG_PAGEALLOC 21config DEBUG_PAGEALLOC
19 bool "Page alloc debugging" 22 bool "Page alloc debugging"
20 depends on DEBUG_KERNEL 23 depends on DEBUG_KERNEL && BROKEN
21 help 24 help
22 Unmap pages from the kernel linear mapping after free_pages(). 25 Unmap pages from the kernel linear mapping after free_pages().
23 This results in a large slowdown, but helps to find certain types 26 This results in a large slowdown, but helps to find certain types
diff --git a/arch/m32r/kernel/process.c b/arch/m32r/kernel/process.c
index b556c3cf6495..ea13a8f4d8b0 100644
--- a/arch/m32r/kernel/process.c
+++ b/arch/m32r/kernel/process.c
@@ -115,8 +115,6 @@ void machine_restart(char *__unused)
115 cpu_relax(); 115 cpu_relax();
116} 116}
117 117
118EXPORT_SYMBOL(machine_restart);
119
120void machine_halt(void) 118void machine_halt(void)
121{ 119{
122 printk("Please push reset button!\n"); 120 printk("Please push reset button!\n");
@@ -124,15 +122,11 @@ void machine_halt(void)
124 cpu_relax(); 122 cpu_relax();
125} 123}
126 124
127EXPORT_SYMBOL(machine_halt);
128
129void machine_power_off(void) 125void machine_power_off(void)
130{ 126{
131 /* M32R_FIXME */ 127 /* M32R_FIXME */
132} 128}
133 129
134EXPORT_SYMBOL(machine_power_off);
135
136static int __init idle_setup (char *str) 130static int __init idle_setup (char *str)
137{ 131{
138 if (!strncmp(str, "poll", 4)) { 132 if (!strncmp(str, "poll", 4)) {
diff --git a/arch/m32r/kernel/setup_m32700ut.c b/arch/m32r/kernel/setup_m32700ut.c
index a146b24a556b..708634b685e4 100644
--- a/arch/m32r/kernel/setup_m32700ut.c
+++ b/arch/m32r/kernel/setup_m32700ut.c
@@ -30,9 +30,11 @@
30typedef struct { 30typedef struct {
31 unsigned long icucr; /* ICU Control Register */ 31 unsigned long icucr; /* ICU Control Register */
32} icu_data_t; 32} icu_data_t;
33static icu_data_t icu_data[M32700UT_NUM_CPU_IRQ];
34#else
35icu_data_t icu_data[M32700UT_NUM_CPU_IRQ];
33#endif /* CONFIG_SMP */ 36#endif /* CONFIG_SMP */
34 37
35static icu_data_t icu_data[M32700UT_NUM_CPU_IRQ];
36 38
37static void disable_m32700ut_irq(unsigned int irq) 39static void disable_m32700ut_irq(unsigned int irq)
38{ 40{
diff --git a/arch/m32r/kernel/setup_opsput.c b/arch/m32r/kernel/setup_opsput.c
index f0301f58bcce..d7b7ec6d30f8 100644
--- a/arch/m32r/kernel/setup_opsput.c
+++ b/arch/m32r/kernel/setup_opsput.c
@@ -31,9 +31,11 @@
31typedef struct { 31typedef struct {
32 unsigned long icucr; /* ICU Control Register */ 32 unsigned long icucr; /* ICU Control Register */
33} icu_data_t; 33} icu_data_t;
34static icu_data_t icu_data[OPSPUT_NUM_CPU_IRQ];
35#else
36icu_data_t icu_data[OPSPUT_NUM_CPU_IRQ];
34#endif /* CONFIG_SMP */ 37#endif /* CONFIG_SMP */
35 38
36static icu_data_t icu_data[OPSPUT_NUM_CPU_IRQ];
37 39
38static void disable_opsput_irq(unsigned int irq) 40static void disable_opsput_irq(unsigned int irq)
39{ 41{
diff --git a/arch/m32r/kernel/signal.c b/arch/m32r/kernel/signal.c
index 5aef7e406ef5..71763f7a1d19 100644
--- a/arch/m32r/kernel/signal.c
+++ b/arch/m32r/kernel/signal.c
@@ -341,13 +341,12 @@ handle_signal(unsigned long sig, struct k_sigaction *ka, siginfo_t *info,
341 /* Set up the stack frame */ 341 /* Set up the stack frame */
342 setup_rt_frame(sig, ka, info, oldset, regs); 342 setup_rt_frame(sig, ka, info, oldset, regs);
343 343
344 if (!(ka->sa.sa_flags & SA_NODEFER)) { 344 spin_lock_irq(&current->sighand->siglock);
345 spin_lock_irq(&current->sighand->siglock); 345 sigorsets(&current->blocked,&current->blocked,&ka->sa.sa_mask);
346 sigorsets(&current->blocked,&current->blocked,&ka->sa.sa_mask); 346 if (!(ka->sa.sa_flags & SA_NODEFER))
347 sigaddset(&current->blocked,sig); 347 sigaddset(&current->blocked,sig);
348 recalc_sigpending(); 348 recalc_sigpending();
349 spin_unlock_irq(&current->sighand->siglock); 349 spin_unlock_irq(&current->sighand->siglock);
350 }
351} 350}
352 351
353/* 352/*
diff --git a/arch/m32r/kernel/smpboot.c b/arch/m32r/kernel/smpboot.c
index f9a0e723478d..640d592ea072 100644
--- a/arch/m32r/kernel/smpboot.c
+++ b/arch/m32r/kernel/smpboot.c
@@ -91,6 +91,7 @@ extern struct {
91 91
92/* which physical physical ID maps to which logical CPU number */ 92/* which physical physical ID maps to which logical CPU number */
93static volatile int physid_2_cpu[NR_CPUS]; 93static volatile int physid_2_cpu[NR_CPUS];
94#define physid_to_cpu(physid) physid_2_cpu[physid]
94 95
95/* which logical CPU number maps to which physical ID */ 96/* which logical CPU number maps to which physical ID */
96volatile int cpu_2_physid[NR_CPUS]; 97volatile int cpu_2_physid[NR_CPUS];
diff --git a/arch/m32r/kernel/time.c b/arch/m32r/kernel/time.c
index 3c4707280a52..8a2b77bc5749 100644
--- a/arch/m32r/kernel/time.c
+++ b/arch/m32r/kernel/time.c
@@ -205,8 +205,7 @@ static long last_rtc_update = 0;
205 * timer_interrupt() needs to keep up the real-time clock, 205 * timer_interrupt() needs to keep up the real-time clock,
206 * as well as call the "do_timer()" routine every clocktick 206 * as well as call the "do_timer()" routine every clocktick
207 */ 207 */
208static inline void 208irqreturn_t timer_interrupt(int irq, void *dev_id, struct pt_regs *regs)
209do_timer_interrupt(int irq, void *dev_id, struct pt_regs * regs)
210{ 209{
211#ifndef CONFIG_SMP 210#ifndef CONFIG_SMP
212 profile_tick(CPU_PROFILING, regs); 211 profile_tick(CPU_PROFILING, regs);
@@ -221,6 +220,7 @@ do_timer_interrupt(int irq, void *dev_id, struct pt_regs * regs)
221 * CMOS clock accordingly every ~11 minutes. Set_rtc_mmss() has to be 220 * CMOS clock accordingly every ~11 minutes. Set_rtc_mmss() has to be
222 * called as close as possible to 500 ms before the new second starts. 221 * called as close as possible to 500 ms before the new second starts.
223 */ 222 */
223 write_seqlock(&xtime_lock);
224 if ((time_status & STA_UNSYNC) == 0 224 if ((time_status & STA_UNSYNC) == 0
225 && xtime.tv_sec > last_rtc_update + 660 225 && xtime.tv_sec > last_rtc_update + 660
226 && (xtime.tv_nsec / 1000) >= 500000 - ((unsigned)TICK_SIZE) / 2 226 && (xtime.tv_nsec / 1000) >= 500000 - ((unsigned)TICK_SIZE) / 2
@@ -231,6 +231,7 @@ do_timer_interrupt(int irq, void *dev_id, struct pt_regs * regs)
231 else /* do it again in 60 s */ 231 else /* do it again in 60 s */
232 last_rtc_update = xtime.tv_sec - 600; 232 last_rtc_update = xtime.tv_sec - 600;
233 } 233 }
234 write_sequnlock(&xtime_lock);
234 /* As we return to user mode fire off the other CPU schedulers.. 235 /* As we return to user mode fire off the other CPU schedulers..
235 this is basically because we don't yet share IRQ's around. 236 this is basically because we don't yet share IRQ's around.
236 This message is rigged to be safe on the 386 - basically it's 237 This message is rigged to be safe on the 386 - basically it's
@@ -238,14 +239,8 @@ do_timer_interrupt(int irq, void *dev_id, struct pt_regs * regs)
238 239
239#ifdef CONFIG_SMP 240#ifdef CONFIG_SMP
240 smp_local_timer_interrupt(regs); 241 smp_local_timer_interrupt(regs);
242 smp_send_timer();
241#endif 243#endif
242}
243
244irqreturn_t timer_interrupt(int irq, void *dev_id, struct pt_regs *regs)
245{
246 write_seqlock(&xtime_lock);
247 do_timer_interrupt(irq, NULL, regs);
248 write_sequnlock(&xtime_lock);
249 244
250 return IRQ_HANDLED; 245 return IRQ_HANDLED;
251} 246}
diff --git a/arch/m32r/lib/csum_partial_copy.c b/arch/m32r/lib/csum_partial_copy.c
index c871b4606b07..ddb16a83a8ce 100644
--- a/arch/m32r/lib/csum_partial_copy.c
+++ b/arch/m32r/lib/csum_partial_copy.c
@@ -58,3 +58,4 @@ csum_partial_copy_from_user (const unsigned char __user *src,
58 return csum_partial(dst, len-missing, sum); 58 return csum_partial(dst, len-missing, sum);
59} 59}
60EXPORT_SYMBOL(csum_partial_copy_from_user); 60EXPORT_SYMBOL(csum_partial_copy_from_user);
61EXPORT_SYMBOL(csum_partial);
diff --git a/arch/m32r/mm/discontig.c b/arch/m32r/mm/discontig.c
index 1d1a01e54b3f..08e727955555 100644
--- a/arch/m32r/mm/discontig.c
+++ b/arch/m32r/mm/discontig.c
@@ -12,12 +12,14 @@
12#include <linux/mmzone.h> 12#include <linux/mmzone.h>
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 16
16#include <asm/setup.h> 17#include <asm/setup.h>
17 18
18extern char _end[]; 19extern char _end[];
19 20
20struct pglist_data *node_data[MAX_NUMNODES]; 21struct pglist_data *node_data[MAX_NUMNODES];
22EXPORT_SYMBOL(node_data);
21static bootmem_data_t node_bdata[MAX_NUMNODES] __initdata; 23static bootmem_data_t node_bdata[MAX_NUMNODES] __initdata;
22 24
23pg_data_t m32r_node_data[MAX_NUMNODES]; 25pg_data_t m32r_node_data[MAX_NUMNODES];
diff --git a/arch/m68k/Kconfig b/arch/m68k/Kconfig
index 691a2469ff36..178c4a3fbb72 100644
--- a/arch/m68k/Kconfig
+++ b/arch/m68k/Kconfig
@@ -450,6 +450,8 @@ source "drivers/zorro/Kconfig"
450 450
451endmenu 451endmenu
452 452
453source "net/Kconfig"
454
453source "drivers/Kconfig" 455source "drivers/Kconfig"
454 456
455menu "Character devices" 457menu "Character devices"
diff --git a/arch/m68k/kernel/m68k_ksyms.c b/arch/m68k/kernel/m68k_ksyms.c
index fe837e31afbf..73e2f5e168dd 100644
--- a/arch/m68k/kernel/m68k_ksyms.c
+++ b/arch/m68k/kernel/m68k_ksyms.c
@@ -74,10 +74,6 @@ EXPORT_SYMBOL(vme_brdtype);
74EXPORT_SYMBOL(__ashldi3); 74EXPORT_SYMBOL(__ashldi3);
75EXPORT_SYMBOL(__ashrdi3); 75EXPORT_SYMBOL(__ashrdi3);
76EXPORT_SYMBOL(__lshrdi3); 76EXPORT_SYMBOL(__lshrdi3);
77EXPORT_SYMBOL(memcpy);
78EXPORT_SYMBOL(memset);
79EXPORT_SYMBOL(memcmp);
80EXPORT_SYMBOL(memscan);
81EXPORT_SYMBOL(__muldi3); 77EXPORT_SYMBOL(__muldi3);
82 78
83EXPORT_SYMBOL(__down_failed); 79EXPORT_SYMBOL(__down_failed);
diff --git a/arch/m68k/kernel/process.c b/arch/m68k/kernel/process.c
index 93b043e2a435..11b1b90ba6ba 100644
--- a/arch/m68k/kernel/process.c
+++ b/arch/m68k/kernel/process.c
@@ -113,8 +113,6 @@ void machine_restart(char * __unused)
113 for (;;); 113 for (;;);
114} 114}
115 115
116EXPORT_SYMBOL(machine_restart);
117
118void machine_halt(void) 116void machine_halt(void)
119{ 117{
120 if (mach_halt) 118 if (mach_halt)
@@ -122,8 +120,6 @@ void machine_halt(void)
122 for (;;); 120 for (;;);
123} 121}
124 122
125EXPORT_SYMBOL(machine_halt);
126
127void machine_power_off(void) 123void machine_power_off(void)
128{ 124{
129 if (mach_power_off) 125 if (mach_power_off)
@@ -131,8 +127,6 @@ void machine_power_off(void)
131 for (;;); 127 for (;;);
132} 128}
133 129
134EXPORT_SYMBOL(machine_power_off);
135
136void show_regs(struct pt_regs * regs) 130void show_regs(struct pt_regs * regs)
137{ 131{
138 printk("\n"); 132 printk("\n");
diff --git a/arch/m68k/kernel/ptrace.c b/arch/m68k/kernel/ptrace.c
index f4e1e5eb8e12..8ed1b01a6a87 100644
--- a/arch/m68k/kernel/ptrace.c
+++ b/arch/m68k/kernel/ptrace.c
@@ -95,7 +95,7 @@ static inline int put_reg(struct task_struct *task, int regno,
95 if (regno == PT_USP) 95 if (regno == PT_USP)
96 addr = &task->thread.usp; 96 addr = &task->thread.usp;
97 else if (regno < sizeof(regoff)/sizeof(regoff[0])) 97 else if (regno < sizeof(regoff)/sizeof(regoff[0]))
98 addr = (unsigned long *) (task->thread.esp0 + regoff[regno]); 98 addr = (unsigned long *)(task->thread.esp0 + regoff[regno]);
99 else 99 else
100 return -1; 100 return -1;
101 *addr = data; 101 *addr = data;
@@ -103,48 +103,56 @@ static inline int put_reg(struct task_struct *task, int regno,
103} 103}
104 104
105/* 105/*
106 * Called by kernel/ptrace.c when detaching..
107 *
108 * Make sure the single step bit is not set. 106 * Make sure the single step bit is not set.
109 */ 107 */
110void ptrace_disable(struct task_struct *child) 108static inline void singlestep_disable(struct task_struct *child)
111{ 109{
112 unsigned long tmp; 110 unsigned long tmp = get_reg(child, PT_SR) & ~(TRACE_BITS << 16);
113 /* make sure the single step bit is not set. */
114 tmp = get_reg(child, PT_SR) & ~(TRACE_BITS << 16);
115 put_reg(child, PT_SR, tmp); 111 put_reg(child, PT_SR, tmp);
116 child->thread.work.delayed_trace = 0; 112 child->thread.work.delayed_trace = 0;
113}
114
115/*
116 * Called by kernel/ptrace.c when detaching..
117 */
118void ptrace_disable(struct task_struct *child)
119{
120 singlestep_disable(child);
117 child->thread.work.syscall_trace = 0; 121 child->thread.work.syscall_trace = 0;
118} 122}
119 123
120asmlinkage int sys_ptrace(long request, long pid, long addr, long data) 124asmlinkage int sys_ptrace(long request, long pid, long addr, long data)
121{ 125{
122 struct task_struct *child; 126 struct task_struct *child;
123 int ret; 127 unsigned long tmp;
128 int i, ret = 0;
124 129
125 lock_kernel(); 130 lock_kernel();
126 ret = -EPERM;
127 if (request == PTRACE_TRACEME) { 131 if (request == PTRACE_TRACEME) {
128 /* are we already being traced? */ 132 /* are we already being traced? */
129 if (current->ptrace & PT_PTRACED) 133 if (current->ptrace & PT_PTRACED) {
134 ret = -EPERM;
130 goto out; 135 goto out;
136 }
131 /* set the ptrace bit in the process flags. */ 137 /* set the ptrace bit in the process flags. */
132 current->ptrace |= PT_PTRACED; 138 current->ptrace |= PT_PTRACED;
133 ret = 0;
134 goto out; 139 goto out;
135 } 140 }
136 ret = -ESRCH;
137 read_lock(&tasklist_lock); 141 read_lock(&tasklist_lock);
138 child = find_task_by_pid(pid); 142 child = find_task_by_pid(pid);
139 if (child) 143 if (child)
140 get_task_struct(child); 144 get_task_struct(child);
141 read_unlock(&tasklist_lock); 145 read_unlock(&tasklist_lock);
142 if (!child) 146 if (unlikely(!child)) {
147 ret = -ESRCH;
143 goto out; 148 goto out;
149 }
144 150
145 ret = -EPERM; 151 /* you may not mess with init */
146 if (pid == 1) /* you may not mess with init */ 152 if (unlikely(pid == 1)) {
153 ret = -EPERM;
147 goto out_tsk; 154 goto out_tsk;
155 }
148 156
149 if (request == PTRACE_ATTACH) { 157 if (request == PTRACE_ATTACH) {
150 ret = ptrace_attach(child); 158 ret = ptrace_attach(child);
@@ -152,227 +160,171 @@ asmlinkage int sys_ptrace(long request, long pid, long addr, long data)
152 } 160 }
153 161
154 ret = ptrace_check_attach(child, request == PTRACE_KILL); 162 ret = ptrace_check_attach(child, request == PTRACE_KILL);
155 if (ret < 0) 163 if (ret)
156 goto out_tsk; 164 goto out_tsk;
157 165
158 switch (request) { 166 switch (request) {
159 /* when I and D space are separate, these will need to be fixed. */ 167 /* when I and D space are separate, these will need to be fixed. */
160 case PTRACE_PEEKTEXT: /* read word at location addr. */ 168 case PTRACE_PEEKTEXT: /* read word at location addr. */
161 case PTRACE_PEEKDATA: { 169 case PTRACE_PEEKDATA:
162 unsigned long tmp; 170 i = access_process_vm(child, addr, &tmp, sizeof(tmp), 0);
163 int copied; 171 if (i != sizeof(tmp))
164 172 goto out_eio;
165 copied = access_process_vm(child, addr, &tmp, sizeof(tmp), 0); 173 ret = put_user(tmp, (unsigned long *)data);
166 ret = -EIO; 174 break;
167 if (copied != sizeof(tmp))
168 break;
169 ret = put_user(tmp,(unsigned long *) data);
170 break;
171 }
172 175
173 /* read the word at location addr in the USER area. */ 176 /* read the word at location addr in the USER area. */
174 case PTRACE_PEEKUSR: { 177 case PTRACE_PEEKUSR:
175 unsigned long tmp; 178 if (addr & 3)
176 179 goto out_eio;
177 ret = -EIO; 180 addr >>= 2; /* temporary hack. */
178 if ((addr & 3) || addr < 0 || 181
179 addr > sizeof(struct user) - 3) 182 if (addr >= 0 && addr < 19) {
180 break; 183 tmp = get_reg(child, addr);
181 184 if (addr == PT_SR)
182 tmp = 0; /* Default return condition */ 185 tmp >>= 16;
183 addr = addr >> 2; /* temporary hack. */ 186 } else if (addr >= 21 && addr < 49) {
184 ret = -EIO; 187 tmp = child->thread.fp[addr - 21];
185 if (addr < 19) { 188 /* Convert internal fpu reg representation
186 tmp = get_reg(child, addr); 189 * into long double format
187 if (addr == PT_SR) 190 */
188 tmp >>= 16; 191 if (FPU_IS_EMU && (addr < 45) && !(addr % 3))
189 } else if (addr >= 21 && addr < 49) { 192 tmp = ((tmp & 0xffff0000) << 15) |
190 tmp = child->thread.fp[addr - 21]; 193 ((tmp & 0x0000ffff) << 16);
191#ifdef CONFIG_M68KFPU_EMU 194 } else
192 /* Convert internal fpu reg representation
193 * into long double format
194 */
195 if (FPU_IS_EMU && (addr < 45) && !(addr % 3))
196 tmp = ((tmp & 0xffff0000) << 15) |
197 ((tmp & 0x0000ffff) << 16);
198#endif
199 } else
200 break;
201 ret = put_user(tmp,(unsigned long *) data);
202 break;
203 }
204
205 /* when I and D space are separate, this will have to be fixed. */
206 case PTRACE_POKETEXT: /* write the word at location addr. */
207 case PTRACE_POKEDATA:
208 ret = 0;
209 if (access_process_vm(child, addr, &data, sizeof(data), 1) == sizeof(data))
210 break;
211 ret = -EIO;
212 break;
213
214 case PTRACE_POKEUSR: /* write the word at location addr in the USER area */
215 ret = -EIO;
216 if ((addr & 3) || addr < 0 ||
217 addr > sizeof(struct user) - 3)
218 break;
219
220 addr = addr >> 2; /* temporary hack. */
221
222 if (addr == PT_SR) {
223 data &= SR_MASK;
224 data <<= 16;
225 data |= get_reg(child, PT_SR) & ~(SR_MASK << 16);
226 }
227 if (addr < 19) {
228 if (put_reg(child, addr, data))
229 break;
230 ret = 0;
231 break;
232 }
233 if (addr >= 21 && addr < 48)
234 {
235#ifdef CONFIG_M68KFPU_EMU
236 /* Convert long double format
237 * into internal fpu reg representation
238 */
239 if (FPU_IS_EMU && (addr < 45) && !(addr % 3)) {
240 data = (unsigned long)data << 15;
241 data = (data & 0xffff0000) |
242 ((data & 0x0000ffff) >> 1);
243 }
244#endif
245 child->thread.fp[addr - 21] = data;
246 ret = 0;
247 }
248 break; 195 break;
249 196 ret = put_user(tmp, (unsigned long *)data);
250 case PTRACE_SYSCALL: /* continue and stop at next (return from) syscall */ 197 break;
251 case PTRACE_CONT: { /* restart after signal. */ 198
252 long tmp; 199 /* when I and D space are separate, this will have to be fixed. */
253 200 case PTRACE_POKETEXT: /* write the word at location addr. */
254 ret = -EIO; 201 case PTRACE_POKEDATA:
255 if (!valid_signal(data)) 202 if (access_process_vm(child, addr, &data, sizeof(data), 1) != sizeof(data))
256 break; 203 goto out_eio;
257 if (request == PTRACE_SYSCALL) { 204 break;
258 child->thread.work.syscall_trace = ~0; 205
259 } else { 206 case PTRACE_POKEUSR: /* write the word at location addr in the USER area */
260 child->thread.work.syscall_trace = 0; 207 if (addr & 3)
208 goto out_eio;
209 addr >>= 2; /* temporary hack. */
210
211 if (addr == PT_SR) {
212 data &= SR_MASK;
213 data <<= 16;
214 data |= get_reg(child, PT_SR) & ~(SR_MASK << 16);
215 } else if (addr >= 0 && addr < 19) {
216 if (put_reg(child, addr, data))
217 goto out_eio;
218 } else if (addr >= 21 && addr < 48) {
219 /* Convert long double format
220 * into internal fpu reg representation
221 */
222 if (FPU_IS_EMU && (addr < 45) && !(addr % 3)) {
223 data = (unsigned long)data << 15;
224 data = (data & 0xffff0000) |
225 ((data & 0x0000ffff) >> 1);
261 } 226 }
262 child->exit_code = data; 227 child->thread.fp[addr - 21] = data;
263 /* make sure the single step bit is not set. */ 228 } else
264 tmp = get_reg(child, PT_SR) & ~(TRACE_BITS << 16); 229 goto out_eio;
265 put_reg(child, PT_SR, tmp); 230 break;
266 child->thread.work.delayed_trace = 0; 231
267 wake_up_process(child); 232 case PTRACE_SYSCALL: /* continue and stop at next (return from) syscall */
268 ret = 0; 233 case PTRACE_CONT: /* restart after signal. */
269 break; 234 if (!valid_signal(data))
270 } 235 goto out_eio;
271 236
272/* 237 if (request == PTRACE_SYSCALL)
273 * make the child exit. Best I can do is send it a sigkill. 238 child->thread.work.syscall_trace = ~0;
274 * perhaps it should be put in the status that it wants to 239 else
275 * exit.
276 */
277 case PTRACE_KILL: {
278 long tmp;
279
280 ret = 0;
281 if (child->exit_state == EXIT_ZOMBIE) /* already dead */
282 break;
283 child->exit_code = SIGKILL;
284 /* make sure the single step bit is not set. */
285 tmp = get_reg(child, PT_SR) & ~(TRACE_BITS << 16);
286 put_reg(child, PT_SR, tmp);
287 child->thread.work.delayed_trace = 0;
288 wake_up_process(child);
289 break;
290 }
291
292 case PTRACE_SINGLESTEP: { /* set the trap flag. */
293 long tmp;
294
295 ret = -EIO;
296 if (!valid_signal(data))
297 break;
298 child->thread.work.syscall_trace = 0; 240 child->thread.work.syscall_trace = 0;
299 tmp = get_reg(child, PT_SR) | (TRACE_BITS << 16); 241 child->exit_code = data;
300 put_reg(child, PT_SR, tmp); 242 singlestep_disable(child);
301 child->thread.work.delayed_trace = 1; 243 wake_up_process(child);
302 244 break;
303 child->exit_code = data;
304 /* give it a chance to run. */
305 wake_up_process(child);
306 ret = 0;
307 break;
308 }
309 245
310 case PTRACE_DETACH: /* detach a process that was attached. */ 246 /*
311 ret = ptrace_detach(child, data); 247 * make the child exit. Best I can do is send it a sigkill.
248 * perhaps it should be put in the status that it wants to
249 * exit.
250 */
251 case PTRACE_KILL:
252 if (child->exit_state == EXIT_ZOMBIE) /* already dead */
312 break; 253 break;
313 254 child->exit_code = SIGKILL;
314 case PTRACE_GETREGS: { /* Get all gp regs from the child. */ 255 singlestep_disable(child);
315 int i; 256 wake_up_process(child);
316 unsigned long tmp; 257 break;
317 for (i = 0; i < 19; i++) { 258
318 tmp = get_reg(child, i); 259 case PTRACE_SINGLESTEP: /* set the trap flag. */
319 if (i == PT_SR) 260 if (!valid_signal(data))
261 goto out_eio;
262
263 child->thread.work.syscall_trace = 0;
264 tmp = get_reg(child, PT_SR) | (TRACE_BITS << 16);
265 put_reg(child, PT_SR, tmp);
266 child->thread.work.delayed_trace = 1;
267
268 child->exit_code = data;
269 /* give it a chance to run. */
270 wake_up_process(child);
271 break;
272
273 case PTRACE_DETACH: /* detach a process that was attached. */
274 ret = ptrace_detach(child, data);
275 break;
276
277 case PTRACE_GETREGS: /* Get all gp regs from the child. */
278 for (i = 0; i < 19; i++) {
279 tmp = get_reg(child, i);
280 if (i == PT_SR)
320 tmp >>= 16; 281 tmp >>= 16;
321 if (put_user(tmp, (unsigned long *) data)) { 282 ret = put_user(tmp, (unsigned long *)data);
322 ret = -EFAULT; 283 if (ret)
323 break; 284 break;
324 } 285 data += sizeof(long);
325 data += sizeof(long);
326 }
327 ret = 0;
328 break;
329 } 286 }
287 break;
330 288
331 case PTRACE_SETREGS: { /* Set all gp regs in the child. */ 289 case PTRACE_SETREGS: /* Set all gp regs in the child. */
332 int i; 290 for (i = 0; i < 19; i++) {
333 unsigned long tmp; 291 ret = get_user(tmp, (unsigned long *)data);
334 for (i = 0; i < 19; i++) { 292 if (ret)
335 if (get_user(tmp, (unsigned long *) data)) {
336 ret = -EFAULT;
337 break; 293 break;
338 } 294 if (i == PT_SR) {
339 if (i == PT_SR) {
340 tmp &= SR_MASK; 295 tmp &= SR_MASK;
341 tmp <<= 16; 296 tmp <<= 16;
342 tmp |= get_reg(child, PT_SR) & ~(SR_MASK << 16); 297 tmp |= get_reg(child, PT_SR) & ~(SR_MASK << 16);
343 }
344 put_reg(child, i, tmp);
345 data += sizeof(long);
346 } 298 }
347 ret = 0; 299 put_reg(child, i, tmp);
348 break; 300 data += sizeof(long);
349 } 301 }
350 302 break;
351 case PTRACE_GETFPREGS: { /* Get the child FPU state. */ 303
352 ret = 0; 304 case PTRACE_GETFPREGS: /* Get the child FPU state. */
353 if (copy_to_user((void *)data, &child->thread.fp, 305 if (copy_to_user((void *)data, &child->thread.fp,
354 sizeof(struct user_m68kfp_struct))) 306 sizeof(struct user_m68kfp_struct)))
355 ret = -EFAULT; 307 ret = -EFAULT;
356 break; 308 break;
357 } 309
358 310 case PTRACE_SETFPREGS: /* Set the child FPU state. */
359 case PTRACE_SETFPREGS: { /* Set the child FPU state. */ 311 if (copy_from_user(&child->thread.fp, (void *)data,
360 ret = 0; 312 sizeof(struct user_m68kfp_struct)))
361 if (copy_from_user(&child->thread.fp, (void *)data, 313 ret = -EFAULT;
362 sizeof(struct user_m68kfp_struct))) 314 break;
363 ret = -EFAULT; 315
364 break; 316 default:
365 } 317 ret = ptrace_request(child, request, addr, data);
366 318 break;
367 default:
368 ret = ptrace_request(child, request, addr, data);
369 break;
370 } 319 }
371out_tsk: 320out_tsk:
372 put_task_struct(child); 321 put_task_struct(child);
373out: 322out:
374 unlock_kernel(); 323 unlock_kernel();
375 return ret; 324 return ret;
325out_eio:
326 ret = -EIO;
327 goto out_tsk;
376} 328}
377 329
378asmlinkage void syscall_trace(void) 330asmlinkage void syscall_trace(void)
diff --git a/arch/m68k/lib/Makefile b/arch/m68k/lib/Makefile
index 34b6dbc29c85..ebe51a513817 100644
--- a/arch/m68k/lib/Makefile
+++ b/arch/m68k/lib/Makefile
@@ -5,4 +5,4 @@
5EXTRA_AFLAGS := -traditional 5EXTRA_AFLAGS := -traditional
6 6
7lib-y := ashldi3.o ashrdi3.o lshrdi3.o muldi3.o \ 7lib-y := ashldi3.o ashrdi3.o lshrdi3.o muldi3.o \
8 checksum.o memcmp.o memcpy.o memset.o semaphore.o 8 checksum.o string.o semaphore.o
diff --git a/arch/m68k/lib/memcmp.c b/arch/m68k/lib/memcmp.c
deleted file mode 100644
index f4796febb773..000000000000
--- a/arch/m68k/lib/memcmp.c
+++ /dev/null
@@ -1,11 +0,0 @@
1#include <linux/types.h>
2
3int memcmp(const void * cs,const void * ct,size_t count)
4{
5 const unsigned char *su1, *su2;
6
7 for( su1 = cs, su2 = ct; 0 < count; ++su1, ++su2, count--)
8 if (*su1 != *su2)
9 return((*su1 < *su2) ? -1 : +1);
10 return(0);
11}
diff --git a/arch/m68k/lib/memcpy.c b/arch/m68k/lib/memcpy.c
deleted file mode 100644
index 73e181823d9b..000000000000
--- a/arch/m68k/lib/memcpy.c
+++ /dev/null
@@ -1,75 +0,0 @@
1#include <linux/types.h>
2
3void * memcpy(void * to, const void * from, size_t n)
4{
5 void *xto = to;
6 size_t temp, temp1;
7
8 if (!n)
9 return xto;
10 if ((long) to & 1)
11 {
12 char *cto = to;
13 const char *cfrom = from;
14 *cto++ = *cfrom++;
15 to = cto;
16 from = cfrom;
17 n--;
18 }
19 if (n > 2 && (long) to & 2)
20 {
21 short *sto = to;
22 const short *sfrom = from;
23 *sto++ = *sfrom++;
24 to = sto;
25 from = sfrom;
26 n -= 2;
27 }
28 temp = n >> 2;
29 if (temp)
30 {
31 long *lto = to;
32 const long *lfrom = from;
33
34 __asm__ __volatile__("movel %2,%3\n\t"
35 "andw #7,%3\n\t"
36 "lsrl #3,%2\n\t"
37 "negw %3\n\t"
38 "jmp %%pc@(1f,%3:w:2)\n\t"
39 "4:\t"
40 "movel %0@+,%1@+\n\t"
41 "movel %0@+,%1@+\n\t"
42 "movel %0@+,%1@+\n\t"
43 "movel %0@+,%1@+\n\t"
44 "movel %0@+,%1@+\n\t"
45 "movel %0@+,%1@+\n\t"
46 "movel %0@+,%1@+\n\t"
47 "movel %0@+,%1@+\n\t"
48 "1:\t"
49 "dbra %2,4b\n\t"
50 "clrw %2\n\t"
51 "subql #1,%2\n\t"
52 "jpl 4b\n\t"
53 : "=a" (lfrom), "=a" (lto), "=d" (temp),
54 "=&d" (temp1)
55 : "0" (lfrom), "1" (lto), "2" (temp)
56 );
57 to = lto;
58 from = lfrom;
59 }
60 if (n & 2)
61 {
62 short *sto = to;
63 const short *sfrom = from;
64 *sto++ = *sfrom++;
65 to = sto;
66 from = sfrom;
67 }
68 if (n & 1)
69 {
70 char *cto = to;
71 const char *cfrom = from;
72 *cto = *cfrom;
73 }
74 return xto;
75}
diff --git a/arch/m68k/lib/memset.c b/arch/m68k/lib/memset.c
deleted file mode 100644
index d55fdb2ee9d3..000000000000
--- a/arch/m68k/lib/memset.c
+++ /dev/null
@@ -1,68 +0,0 @@
1#include <linux/types.h>
2
3void * memset(void * s, int c, size_t count)
4{
5 void *xs = s;
6 size_t temp, temp1;
7
8 if (!count)
9 return xs;
10 c &= 0xff;
11 c |= c << 8;
12 c |= c << 16;
13 if ((long) s & 1)
14 {
15 char *cs = s;
16 *cs++ = c;
17 s = cs;
18 count--;
19 }
20 if (count > 2 && (long) s & 2)
21 {
22 short *ss = s;
23 *ss++ = c;
24 s = ss;
25 count -= 2;
26 }
27 temp = count >> 2;
28 if (temp)
29 {
30 long *ls = s;
31
32 __asm__ __volatile__("movel %1,%2\n\t"
33 "andw #7,%2\n\t"
34 "lsrl #3,%1\n\t"
35 "negw %2\n\t"
36 "jmp %%pc@(2f,%2:w:2)\n\t"
37 "1:\t"
38 "movel %3,%0@+\n\t"
39 "movel %3,%0@+\n\t"
40 "movel %3,%0@+\n\t"
41 "movel %3,%0@+\n\t"
42 "movel %3,%0@+\n\t"
43 "movel %3,%0@+\n\t"
44 "movel %3,%0@+\n\t"
45 "movel %3,%0@+\n\t"
46 "2:\t"
47 "dbra %1,1b\n\t"
48 "clrw %1\n\t"
49 "subql #1,%1\n\t"
50 "jpl 1b\n\t"
51 : "=a" (ls), "=d" (temp), "=&d" (temp1)
52 : "d" (c), "0" (ls), "1" (temp)
53 );
54 s = ls;
55 }
56 if (count & 2)
57 {
58 short *ss = s;
59 *ss++ = c;
60 s = ss;
61 }
62 if (count & 1)
63 {
64 char *cs = s;
65 *cs = c;
66 }
67 return xs;
68}
diff --git a/arch/m68k/lib/string.c b/arch/m68k/lib/string.c
new file mode 100644
index 000000000000..b92b89e1ea0c
--- /dev/null
+++ b/arch/m68k/lib/string.c
@@ -0,0 +1,237 @@
1
2#include <linux/types.h>
3#include <linux/module.h>
4
5void *memset(void *s, int c, size_t count)
6{
7 void *xs = s;
8 size_t temp, temp1;
9
10 if (!count)
11 return xs;
12 c &= 0xff;
13 c |= c << 8;
14 c |= c << 16;
15 if ((long)s & 1) {
16 char *cs = s;
17 *cs++ = c;
18 s = cs;
19 count--;
20 }
21 if (count > 2 && (long)s & 2) {
22 short *ss = s;
23 *ss++ = c;
24 s = ss;
25 count -= 2;
26 }
27 temp = count >> 2;
28 if (temp) {
29 long *ls = s;
30
31 asm volatile (
32 " movel %1,%2\n"
33 " andw #7,%2\n"
34 " lsrl #3,%1\n"
35 " negw %2\n"
36 " jmp %%pc@(2f,%2:w:2)\n"
37 "1: movel %3,%0@+\n"
38 " movel %3,%0@+\n"
39 " movel %3,%0@+\n"
40 " movel %3,%0@+\n"
41 " movel %3,%0@+\n"
42 " movel %3,%0@+\n"
43 " movel %3,%0@+\n"
44 " movel %3,%0@+\n"
45 "2: dbra %1,1b\n"
46 " clrw %1\n"
47 " subql #1,%1\n"
48 " jpl 1b"
49 : "=a" (ls), "=d" (temp), "=&d" (temp1)
50 : "d" (c), "0" (ls), "1" (temp));
51 s = ls;
52 }
53 if (count & 2) {
54 short *ss = s;
55 *ss++ = c;
56 s = ss;
57 }
58 if (count & 1) {
59 char *cs = s;
60 *cs = c;
61 }
62 return xs;
63}
64EXPORT_SYMBOL(memset);
65
66void *memcpy(void *to, const void *from, size_t n)
67{
68 void *xto = to;
69 size_t temp, temp1;
70
71 if (!n)
72 return xto;
73 if ((long)to & 1) {
74 char *cto = to;
75 const char *cfrom = from;
76 *cto++ = *cfrom++;
77 to = cto;
78 from = cfrom;
79 n--;
80 }
81 if (n > 2 && (long)to & 2) {
82 short *sto = to;
83 const short *sfrom = from;
84 *sto++ = *sfrom++;
85 to = sto;
86 from = sfrom;
87 n -= 2;
88 }
89 temp = n >> 2;
90 if (temp) {
91 long *lto = to;
92 const long *lfrom = from;
93
94 asm volatile (
95 " movel %2,%3\n"
96 " andw #7,%3\n"
97 " lsrl #3,%2\n"
98 " negw %3\n"
99 " jmp %%pc@(1f,%3:w:2)\n"
100 "4: movel %0@+,%1@+\n"
101 " movel %0@+,%1@+\n"
102 " movel %0@+,%1@+\n"
103 " movel %0@+,%1@+\n"
104 " movel %0@+,%1@+\n"
105 " movel %0@+,%1@+\n"
106 " movel %0@+,%1@+\n"
107 " movel %0@+,%1@+\n"
108 "1: dbra %2,4b\n"
109 " clrw %2\n"
110 " subql #1,%2\n"
111 " jpl 4b"
112 : "=a" (lfrom), "=a" (lto), "=d" (temp), "=&d" (temp1)
113 : "0" (lfrom), "1" (lto), "2" (temp));
114 to = lto;
115 from = lfrom;
116 }
117 if (n & 2) {
118 short *sto = to;
119 const short *sfrom = from;
120 *sto++ = *sfrom++;
121 to = sto;
122 from = sfrom;
123 }
124 if (n & 1) {
125 char *cto = to;
126 const char *cfrom = from;
127 *cto = *cfrom;
128 }
129 return xto;
130}
131EXPORT_SYMBOL(memcpy);
132
133void *memmove(void *dest, const void *src, size_t n)
134{
135 void *xdest = dest;
136 size_t temp;
137
138 if (!n)
139 return xdest;
140
141 if (dest < src) {
142 if ((long)dest & 1) {
143 char *cdest = dest;
144 const char *csrc = src;
145 *cdest++ = *csrc++;
146 dest = cdest;
147 src = csrc;
148 n--;
149 }
150 if (n > 2 && (long)dest & 2) {
151 short *sdest = dest;
152 const short *ssrc = src;
153 *sdest++ = *ssrc++;
154 dest = sdest;
155 src = ssrc;
156 n -= 2;
157 }
158 temp = n >> 2;
159 if (temp) {
160 long *ldest = dest;
161 const long *lsrc = src;
162 temp--;
163 do
164 *ldest++ = *lsrc++;
165 while (temp--);
166 dest = ldest;
167 src = lsrc;
168 }
169 if (n & 2) {
170 short *sdest = dest;
171 const short *ssrc = src;
172 *sdest++ = *ssrc++;
173 dest = sdest;
174 src = ssrc;
175 }
176 if (n & 1) {
177 char *cdest = dest;
178 const char *csrc = src;
179 *cdest = *csrc;
180 }
181 } else {
182 dest = (char *)dest + n;
183 src = (const char *)src + n;
184 if ((long)dest & 1) {
185 char *cdest = dest;
186 const char *csrc = src;
187 *--cdest = *--csrc;
188 dest = cdest;
189 src = csrc;
190 n--;
191 }
192 if (n > 2 && (long)dest & 2) {
193 short *sdest = dest;
194 const short *ssrc = src;
195 *--sdest = *--ssrc;
196 dest = sdest;
197 src = ssrc;
198 n -= 2;
199 }
200 temp = n >> 2;
201 if (temp) {
202 long *ldest = dest;
203 const long *lsrc = src;
204 temp--;
205 do
206 *--ldest = *--lsrc;
207 while (temp--);
208 dest = ldest;
209 src = lsrc;
210 }
211 if (n & 2) {
212 short *sdest = dest;
213 const short *ssrc = src;
214 *--sdest = *--ssrc;
215 dest = sdest;
216 src = ssrc;
217 }
218 if (n & 1) {
219 char *cdest = dest;
220 const char *csrc = src;
221 *--cdest = *--csrc;
222 }
223 }
224 return xdest;
225}
226EXPORT_SYMBOL(memmove);
227
228int memcmp(const void *cs, const void *ct, size_t count)
229{
230 const unsigned char *su1, *su2;
231
232 for (su1 = cs, su2 = ct; count > 0; ++su1, ++su2, count--)
233 if (*su1 != *su2)
234 return *su1 < *su2 ? -1 : +1;
235 return 0;
236}
237EXPORT_SYMBOL(memcmp);
diff --git a/arch/m68k/mm/Makefile b/arch/m68k/mm/Makefile
index 90f1c735c110..5eaa43c4cb3c 100644
--- a/arch/m68k/mm/Makefile
+++ b/arch/m68k/mm/Makefile
@@ -2,7 +2,7 @@
2# Makefile for the linux m68k-specific parts of the memory manager. 2# Makefile for the linux m68k-specific parts of the memory manager.
3# 3#
4 4
5obj-y := init.o fault.o hwtest.o 5obj-y := cache.o init.o fault.o hwtest.o
6 6
7obj-$(CONFIG_MMU_MOTOROLA) += kmap.o memory.o motorola.o 7obj-$(CONFIG_MMU_MOTOROLA) += kmap.o memory.o motorola.o
8obj-$(CONFIG_MMU_SUN3) += sun3kmap.o sun3mmu.o 8obj-$(CONFIG_MMU_SUN3) += sun3kmap.o sun3mmu.o
diff --git a/arch/m68k/mm/cache.c b/arch/m68k/mm/cache.c
new file mode 100644
index 000000000000..5437fff5fe07
--- /dev/null
+++ b/arch/m68k/mm/cache.c
@@ -0,0 +1,118 @@
1/*
2 * linux/arch/m68k/mm/cache.c
3 *
4 * Instruction cache handling
5 *
6 * Copyright (C) 1995 Hamish Macdonald
7 */
8
9#include <linux/module.h>
10#include <asm/pgalloc.h>
11#include <asm/traps.h>
12
13
14static unsigned long virt_to_phys_slow(unsigned long vaddr)
15{
16 if (CPU_IS_060) {
17 unsigned long paddr;
18
19 /* The PLPAR instruction causes an access error if the translation
20 * is not possible. To catch this we use the same exception mechanism
21 * as for user space accesses in <asm/uaccess.h>. */
22 asm volatile (".chip 68060\n"
23 "1: plpar (%0)\n"
24 ".chip 68k\n"
25 "2:\n"
26 ".section .fixup,\"ax\"\n"
27 " .even\n"
28 "3: sub.l %0,%0\n"
29 " jra 2b\n"
30 ".previous\n"
31 ".section __ex_table,\"a\"\n"
32 " .align 4\n"
33 " .long 1b,3b\n"
34 ".previous"
35 : "=a" (paddr)
36 : "0" (vaddr));
37 return paddr;
38 } else if (CPU_IS_040) {
39 unsigned long mmusr;
40
41 asm volatile (".chip 68040\n\t"
42 "ptestr (%1)\n\t"
43 "movec %%mmusr, %0\n\t"
44 ".chip 68k"
45 : "=r" (mmusr)
46 : "a" (vaddr));
47
48 if (mmusr & MMU_R_040)
49 return (mmusr & PAGE_MASK) | (vaddr & ~PAGE_MASK);
50 } else {
51 unsigned short mmusr;
52 unsigned long *descaddr;
53
54 asm volatile ("ptestr %3,%2@,#7,%0\n\t"
55 "pmove %%psr,%1@"
56 : "=a&" (descaddr)
57 : "a" (&mmusr), "a" (vaddr), "d" (get_fs().seg));
58 if (mmusr & (MMU_I|MMU_B|MMU_L))
59 return 0;
60 descaddr = phys_to_virt((unsigned long)descaddr);
61 switch (mmusr & MMU_NUM) {
62 case 1:
63 return (*descaddr & 0xfe000000) | (vaddr & 0x01ffffff);
64 case 2:
65 return (*descaddr & 0xfffc0000) | (vaddr & 0x0003ffff);
66 case 3:
67 return (*descaddr & PAGE_MASK) | (vaddr & ~PAGE_MASK);
68 }
69 }
70 return 0;
71}
72
73/* Push n pages at kernel virtual address and clear the icache */
74/* RZ: use cpush %bc instead of cpush %dc, cinv %ic */
75void flush_icache_range(unsigned long address, unsigned long endaddr)
76{
77
78 if (CPU_IS_040_OR_060) {
79 address &= PAGE_MASK;
80
81 do {
82 asm volatile ("nop\n\t"
83 ".chip 68040\n\t"
84 "cpushp %%bc,(%0)\n\t"
85 ".chip 68k"
86 : : "a" (virt_to_phys_slow(address)));
87 address += PAGE_SIZE;
88 } while (address < endaddr);
89 } else {
90 unsigned long tmp;
91 asm volatile ("movec %%cacr,%0\n\t"
92 "orw %1,%0\n\t"
93 "movec %0,%%cacr"
94 : "=&d" (tmp)
95 : "di" (FLUSH_I));
96 }
97}
98EXPORT_SYMBOL(flush_icache_range);
99
100void flush_icache_user_range(struct vm_area_struct *vma, struct page *page,
101 unsigned long addr, int len)
102{
103 if (CPU_IS_040_OR_060) {
104 asm volatile ("nop\n\t"
105 ".chip 68040\n\t"
106 "cpushp %%bc,(%0)\n\t"
107 ".chip 68k"
108 : : "a" (page_to_phys(page)));
109 } else {
110 unsigned long tmp;
111 asm volatile ("movec %%cacr,%0\n\t"
112 "orw %1,%0\n\t"
113 "movec %0,%%cacr"
114 : "=&d" (tmp)
115 : "di" (FLUSH_I));
116 }
117}
118
diff --git a/arch/m68k/mm/fault.c b/arch/m68k/mm/fault.c
index ac48b6d2aff6..aec15270d334 100644
--- a/arch/m68k/mm/fault.c
+++ b/arch/m68k/mm/fault.c
@@ -160,13 +160,13 @@ good_area:
160 printk("handle_mm_fault returns %d\n",fault); 160 printk("handle_mm_fault returns %d\n",fault);
161#endif 161#endif
162 switch (fault) { 162 switch (fault) {
163 case 1: 163 case VM_FAULT_MINOR:
164 current->min_flt++; 164 current->min_flt++;
165 break; 165 break;
166 case 2: 166 case VM_FAULT_MAJOR:
167 current->maj_flt++; 167 current->maj_flt++;
168 break; 168 break;
169 case 0: 169 case VM_FAULT_SIGBUS:
170 goto bus_err; 170 goto bus_err;
171 default: 171 default:
172 goto out_of_memory; 172 goto out_of_memory;
diff --git a/arch/m68k/mm/memory.c b/arch/m68k/mm/memory.c
index 1453a6013721..559942ce0e1e 100644
--- a/arch/m68k/mm/memory.c
+++ b/arch/m68k/mm/memory.c
@@ -354,110 +354,6 @@ void cache_push (unsigned long paddr, int len)
354#endif 354#endif
355} 355}
356 356
357static unsigned long virt_to_phys_slow(unsigned long vaddr)
358{
359 if (CPU_IS_060) {
360 mm_segment_t fs = get_fs();
361 unsigned long paddr;
362
363 set_fs(get_ds());
364
365 /* The PLPAR instruction causes an access error if the translation
366 * is not possible. To catch this we use the same exception mechanism
367 * as for user space accesses in <asm/uaccess.h>. */
368 asm volatile (".chip 68060\n"
369 "1: plpar (%0)\n"
370 ".chip 68k\n"
371 "2:\n"
372 ".section .fixup,\"ax\"\n"
373 " .even\n"
374 "3: sub.l %0,%0\n"
375 " jra 2b\n"
376 ".previous\n"
377 ".section __ex_table,\"a\"\n"
378 " .align 4\n"
379 " .long 1b,3b\n"
380 ".previous"
381 : "=a" (paddr)
382 : "0" (vaddr));
383 set_fs(fs);
384 return paddr;
385 } else if (CPU_IS_040) {
386 mm_segment_t fs = get_fs();
387 unsigned long mmusr;
388
389 set_fs(get_ds());
390
391 asm volatile (".chip 68040\n\t"
392 "ptestr (%1)\n\t"
393 "movec %%mmusr, %0\n\t"
394 ".chip 68k"
395 : "=r" (mmusr)
396 : "a" (vaddr));
397 set_fs(fs);
398
399 if (mmusr & MMU_R_040)
400 return (mmusr & PAGE_MASK) | (vaddr & ~PAGE_MASK);
401 } else {
402 unsigned short mmusr;
403 unsigned long *descaddr;
404
405 asm volatile ("ptestr #5,%2@,#7,%0\n\t"
406 "pmove %%psr,%1@"
407 : "=a&" (descaddr)
408 : "a" (&mmusr), "a" (vaddr));
409 if (mmusr & (MMU_I|MMU_B|MMU_L))
410 return 0;
411 descaddr = phys_to_virt((unsigned long)descaddr);
412 switch (mmusr & MMU_NUM) {
413 case 1:
414 return (*descaddr & 0xfe000000) | (vaddr & 0x01ffffff);
415 case 2:
416 return (*descaddr & 0xfffc0000) | (vaddr & 0x0003ffff);
417 case 3:
418 return (*descaddr & PAGE_MASK) | (vaddr & ~PAGE_MASK);
419 }
420 }
421 return 0;
422}
423
424/* Push n pages at kernel virtual address and clear the icache */
425/* RZ: use cpush %bc instead of cpush %dc, cinv %ic */
426void flush_icache_range(unsigned long address, unsigned long endaddr)
427{
428 if (CPU_IS_040_OR_060) {
429 address &= PAGE_MASK;
430
431 if (address >= PAGE_OFFSET && address < (unsigned long)high_memory) {
432 do {
433 asm volatile ("nop\n\t"
434 ".chip 68040\n\t"
435 "cpushp %%bc,(%0)\n\t"
436 ".chip 68k"
437 : : "a" (virt_to_phys((void *)address)));
438 address += PAGE_SIZE;
439 } while (address < endaddr);
440 } else {
441 do {
442 asm volatile ("nop\n\t"
443 ".chip 68040\n\t"
444 "cpushp %%bc,(%0)\n\t"
445 ".chip 68k"
446 : : "a" (virt_to_phys_slow(address)));
447 address += PAGE_SIZE;
448 } while (address < endaddr);
449 }
450 } else {
451 unsigned long tmp;
452 asm volatile ("movec %%cacr,%0\n\t"
453 "orw %1,%0\n\t"
454 "movec %0,%%cacr"
455 : "=&d" (tmp)
456 : "di" (FLUSH_I));
457 }
458}
459
460
461#ifndef CONFIG_SINGLE_MEMORY_CHUNK 357#ifndef CONFIG_SINGLE_MEMORY_CHUNK
462int mm_end_of_chunk (unsigned long addr, int len) 358int mm_end_of_chunk (unsigned long addr, int len)
463{ 359{
diff --git a/arch/m68knommu/Kconfig b/arch/m68knommu/Kconfig
index dbfcdc8e6087..8520df9cee6d 100644
--- a/arch/m68knommu/Kconfig
+++ b/arch/m68knommu/Kconfig
@@ -71,21 +71,31 @@ config M5206e
71 help 71 help
72 Motorola ColdFire 5206e processor support. 72 Motorola ColdFire 5206e processor support.
73 73
74config M523x
75 bool "MCF523x"
76 help
77 Freescale Coldfire 5230/1/2/4/5 processor support
78
74config M5249 79config M5249
75 bool "MCF5249" 80 bool "MCF5249"
76 help 81 help
77 Motorola ColdFire 5249 processor support. 82 Motorola ColdFire 5249 processor support.
78 83
79config M527x 84config M5271
80 bool "MCF527x" 85 bool "MCF5271"
81 help 86 help
82 Freescale (Motorola) ColdFire 5270/5271/5274/5275 processor support. 87 Freescale (Motorola) ColdFire 5270/5271 processor support.
83 88
84config M5272 89config M5272
85 bool "MCF5272" 90 bool "MCF5272"
86 help 91 help
87 Motorola ColdFire 5272 processor support. 92 Motorola ColdFire 5272 processor support.
88 93
94config M5275
95 bool "MCF5275"
96 help
97 Freescale (Motorola) ColdFire 5274/5275 processor support.
98
89config M528x 99config M528x
90 bool "MCF528x" 100 bool "MCF528x"
91 help 101 help
@@ -103,9 +113,14 @@ config M5407
103 113
104endchoice 114endchoice
105 115
116config M527x
117 bool
118 depends on (M5271 || M5275)
119 default y
120
106config COLDFIRE 121config COLDFIRE
107 bool 122 bool
108 depends on (M5206 || M5206e || M5249 || M527x || M5272 || M528x || M5307 || M5407) 123 depends on (M5206 || M5206e || M523x || M5249 || M527x || M5272 || M528x || M5307 || M5407)
109 default y 124 default y
110 125
111choice 126choice
@@ -183,6 +198,11 @@ config CLOCK_60MHz
183 help 198 help
184 Select a 60MHz CPU clock frequency. 199 Select a 60MHz CPU clock frequency.
185 200
201config CLOCK_62_5MHz
202 bool "62.5MHz"
203 help
204 Select a 62.5MHz CPU clock frequency.
205
186config CLOCK_64MHz 206config CLOCK_64MHz
187 bool "64MHz" 207 bool "64MHz"
188 help 208 help
@@ -302,6 +322,12 @@ config ELITE
302 help 322 help
303 Support for the Motorola M5206eLITE board. 323 Support for the Motorola M5206eLITE board.
304 324
325config M5235EVB
326 bool "Freescale M5235EVB support"
327 depends on M523x
328 help
329 Support for the Freescale M5235EVB board.
330
305config M5249C3 331config M5249C3
306 bool "Motorola M5249C3 board support" 332 bool "Motorola M5249C3 board support"
307 depends on M5249 333 depends on M5249
@@ -310,13 +336,13 @@ config M5249C3
310 336
311config M5271EVB 337config M5271EVB
312 bool "Freescale (Motorola) M5271EVB board support" 338 bool "Freescale (Motorola) M5271EVB board support"
313 depends on M527x 339 depends on M5271
314 help 340 help
315 Support for the Freescale (Motorola) M5271EVB board. 341 Support for the Freescale (Motorola) M5271EVB board.
316 342
317config M5275EVB 343config M5275EVB
318 bool "Freescale (Motorola) M5275EVB board support" 344 bool "Freescale (Motorola) M5275EVB board support"
319 depends on M527x 345 depends on M5275
320 help 346 help
321 Support for the Freescale (Motorola) M5275EVB board. 347 Support for the Freescale (Motorola) M5275EVB board.
322 348
@@ -343,6 +369,12 @@ config COBRA5282
343 depends on M528x 369 depends on M528x
344 help 370 help
345 Support for the senTec COBRA5282 board. 371 Support for the senTec COBRA5282 board.
372
373config SOM5282EM
374 bool "EMAC.Inc SOM5282EM board support"
375 depends on M528x
376 help
377 Support for the EMAC.Inc SOM5282EM module.
346 378
347config ARN5307 379config ARN5307
348 bool "Arnewsh 5307 board support" 380 bool "Arnewsh 5307 board support"
@@ -410,6 +442,12 @@ config CPU16B
410 help 442 help
411 Support for the SNEHA CPU16B board. 443 Support for the SNEHA CPU16B board.
412 444
445config MOD5272
446 bool "Netburner MOD-5272 board support"
447 depends on M5272
448 help
449 Support for the Netburner MOD-5272 board.
450
413config ROMFS_FROM_ROM 451config ROMFS_FROM_ROM
414 bool " ROMFS image not RAM resident" 452 bool " ROMFS image not RAM resident"
415 depends on (NETtel || SNAPGEAR) 453 depends on (NETtel || SNAPGEAR)
@@ -430,7 +468,7 @@ config ARNEWSH
430config MOTOROLA 468config MOTOROLA
431 bool 469 bool
432 default y 470 default y
433 depends on (M5206eC3 || M5249C3 || M5271EVB || M5272C3 || M5275EVB || M5282EVB || M5307C3 || M5407C3) 471 depends on (M5206eC3 || M5235EVB || M5249C3 || M5271EVB || M5272C3 || M5275EVB || M5282EVB || M5307C3 || M5407C3)
434 472
435config HW_FEITH 473config HW_FEITH
436 bool 474 bool
@@ -441,6 +479,11 @@ config senTec
441 bool 479 bool
442 default y 480 default y
443 depends on (COBRA5272 || COBRA5282) 481 depends on (COBRA5272 || COBRA5282)
482
483config EMAC_INC
484 bool
485 default y
486 depends on (SOM5282EM)
444 487
445config SNEHA 488config SNEHA
446 bool 489 bool
@@ -455,6 +498,15 @@ config LARGE_ALLOCS
455 a lot of RAM, and you need to able to allocate very large 498 a lot of RAM, and you need to able to allocate very large
456 contiguous chunks. If unsure, say N. 499 contiguous chunks. If unsure, say N.
457 500
501config 4KSTACKS
502 bool "Use 4Kb for kernel stacks instead of 8Kb"
503 default y
504 help
505 If you say Y here the kernel will use a 4Kb stacksize for the
506 kernel stack attached to each process/thread. This facilitates
507 running more threads on a system and also reduces the pressure
508 on the VM subsystem for higher order allocations.
509
458choice 510choice
459 prompt "RAM size" 511 prompt "RAM size"
460 default AUTO 512 default AUTO
@@ -575,6 +627,8 @@ config PM
575 627
576endmenu 628endmenu
577 629
630source "net/Kconfig"
631
578source "drivers/Kconfig" 632source "drivers/Kconfig"
579 633
580source "fs/Kconfig" 634source "fs/Kconfig"
diff --git a/arch/m68knommu/Makefile b/arch/m68knommu/Makefile
index 58c9fa57ca67..7ce5e55b2401 100644
--- a/arch/m68knommu/Makefile
+++ b/arch/m68knommu/Makefile
@@ -14,6 +14,7 @@ platform-$(CONFIG_M68VZ328) := 68VZ328
14platform-$(CONFIG_M68360) := 68360 14platform-$(CONFIG_M68360) := 68360
15platform-$(CONFIG_M5206) := 5206 15platform-$(CONFIG_M5206) := 5206
16platform-$(CONFIG_M5206e) := 5206e 16platform-$(CONFIG_M5206e) := 5206e
17platform-$(CONFIG_M523x) := 523x
17platform-$(CONFIG_M5249) := 5249 18platform-$(CONFIG_M5249) := 5249
18platform-$(CONFIG_M527x) := 527x 19platform-$(CONFIG_M527x) := 527x
19platform-$(CONFIG_M5272) := 5272 20platform-$(CONFIG_M5272) := 5272
@@ -29,6 +30,7 @@ board-$(CONFIG_UCQUICC) := uCquicc
29board-$(CONFIG_DRAGEN2) := de2 30board-$(CONFIG_DRAGEN2) := de2
30board-$(CONFIG_ARNEWSH) := ARNEWSH 31board-$(CONFIG_ARNEWSH) := ARNEWSH
31board-$(CONFIG_MOTOROLA) := MOTOROLA 32board-$(CONFIG_MOTOROLA) := MOTOROLA
33board-$(CONFIG_M5235EVB) := M5235EVB
32board-$(CONFIG_M5271EVB) := M5271EVB 34board-$(CONFIG_M5271EVB) := M5271EVB
33board-$(CONFIG_M5275EVB) := M5275EVB 35board-$(CONFIG_M5275EVB) := M5275EVB
34board-$(CONFIG_M5282EVB) := M5282EVB 36board-$(CONFIG_M5282EVB) := M5282EVB
@@ -39,6 +41,7 @@ board-$(CONFIG_SECUREEDGEMP3) := MP3
39board-$(CONFIG_CLEOPATRA) := CLEOPATRA 41board-$(CONFIG_CLEOPATRA) := CLEOPATRA
40board-$(CONFIG_senTec) := senTec 42board-$(CONFIG_senTec) := senTec
41board-$(CONFIG_SNEHA) := SNEHA 43board-$(CONFIG_SNEHA) := SNEHA
44board-$(CONFIG_MOD5272) := MOD5272
42BOARD := $(board-y) 45BOARD := $(board-y)
43 46
44model-$(CONFIG_RAMKERNEL) := ram 47model-$(CONFIG_RAMKERNEL) := ram
@@ -53,6 +56,7 @@ MODEL := $(model-y)
53# 56#
54cpuclass-$(CONFIG_M5206) := 5307 57cpuclass-$(CONFIG_M5206) := 5307
55cpuclass-$(CONFIG_M5206e) := 5307 58cpuclass-$(CONFIG_M5206e) := 5307
59cpuclass-$(CONFIG_M523x) := 5307
56cpuclass-$(CONFIG_M5249) := 5307 60cpuclass-$(CONFIG_M5249) := 5307
57cpuclass-$(CONFIG_M527x) := 5307 61cpuclass-$(CONFIG_M527x) := 5307
58cpuclass-$(CONFIG_M5272) := 5307 62cpuclass-$(CONFIG_M5272) := 5307
@@ -76,6 +80,7 @@ export PLATFORM BOARD MODEL CPUCLASS
76# 80#
77cflags-$(CONFIG_M5206) := -m5200 -Wa,-S -Wa,-m5200 81cflags-$(CONFIG_M5206) := -m5200 -Wa,-S -Wa,-m5200
78cflags-$(CONFIG_M5206e) := -m5200 -Wa,-S -Wa,-m5200 82cflags-$(CONFIG_M5206e) := -m5200 -Wa,-S -Wa,-m5200
83cflags-$(CONFIG_M523x) := -m5307 -Wa,-S -Wa,-m5307
79cflags-$(CONFIG_M5249) := -m5200 -Wa,-S -Wa,-m5200 84cflags-$(CONFIG_M5249) := -m5200 -Wa,-S -Wa,-m5200
80cflags-$(CONFIG_M527x) := -m5307 -Wa,-S -Wa,-m5307 85cflags-$(CONFIG_M527x) := -m5307 -Wa,-S -Wa,-m5307
81cflags-$(CONFIG_M5272) := -m5307 -Wa,-S -Wa,-m5307 86cflags-$(CONFIG_M5272) := -m5307 -Wa,-S -Wa,-m5307
diff --git a/arch/m68knommu/defconfig b/arch/m68knommu/defconfig
index e4bd31be966a..87f2d6587c56 100644
--- a/arch/m68knommu/defconfig
+++ b/arch/m68knommu/defconfig
@@ -1,24 +1,48 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.13-uc0
4# Wed Aug 31 15:03:26 2005
3# 5#
6CONFIG_M68KNOMMU=y
4# CONFIG_MMU is not set 7# CONFIG_MMU is not set
5# CONFIG_FPU is not set 8# CONFIG_FPU is not set
6CONFIG_UID16=y 9CONFIG_UID16=y
7CONFIG_RWSEM_GENERIC_SPINLOCK=y 10CONFIG_RWSEM_GENERIC_SPINLOCK=y
8# CONFIG_RWSEM_XCHGADD_ALGORITHM is not set 11# CONFIG_RWSEM_XCHGADD_ALGORITHM is not set
12CONFIG_GENERIC_CALIBRATE_DELAY=y
9 13
10# 14#
11# Code maturity level options 15# Code maturity level options
12# 16#
13CONFIG_EXPERIMENTAL=y 17CONFIG_EXPERIMENTAL=y
18CONFIG_CLEAN_COMPILE=y
19CONFIG_BROKEN_ON_SMP=y
20CONFIG_INIT_ENV_ARG_LIMIT=32
14 21
15# 22#
16# General setup 23# General setup
17# 24#
18# CONFIG_SYSVIPC is not set 25CONFIG_LOCALVERSION=""
26# CONFIG_POSIX_MQUEUE is not set
19# CONFIG_BSD_PROCESS_ACCT is not set 27# CONFIG_BSD_PROCESS_ACCT is not set
20# CONFIG_SYSCTL is not set 28# CONFIG_SYSCTL is not set
21CONFIG_LOG_BUF_SHIFT=14 29# CONFIG_AUDIT is not set
30# CONFIG_HOTPLUG is not set
31# CONFIG_KOBJECT_UEVENT is not set
32# CONFIG_IKCONFIG is not set
33CONFIG_EMBEDDED=y
34# CONFIG_KALLSYMS is not set
35CONFIG_PRINTK=y
36CONFIG_BUG=y
37CONFIG_BASE_FULL=y
38# CONFIG_FUTEX is not set
39# CONFIG_EPOLL is not set
40# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
41CONFIG_CC_ALIGN_FUNCTIONS=0
42CONFIG_CC_ALIGN_LABELS=0
43CONFIG_CC_ALIGN_LOOPS=0
44CONFIG_CC_ALIGN_JUMPS=0
45CONFIG_BASE_SMALL=0
22 46
23# 47#
24# Loadable module support 48# Loadable module support
@@ -34,9 +58,11 @@ CONFIG_LOG_BUF_SHIFT=14
34# CONFIG_M68360 is not set 58# CONFIG_M68360 is not set
35# CONFIG_M5206 is not set 59# CONFIG_M5206 is not set
36# CONFIG_M5206e is not set 60# CONFIG_M5206e is not set
61# CONFIG_M523x is not set
37# CONFIG_M5249 is not set 62# CONFIG_M5249 is not set
38# CONFIG_M527x is not set 63# CONFIG_M5271 is not set
39CONFIG_M5272=y 64CONFIG_M5272=y
65# CONFIG_M5275 is not set
40# CONFIG_M528x is not set 66# CONFIG_M528x is not set
41# CONFIG_M5307 is not set 67# CONFIG_M5307 is not set
42# CONFIG_M5407 is not set 68# CONFIG_M5407 is not set
@@ -54,6 +80,8 @@ CONFIG_COLDFIRE=y
54# CONFIG_CLOCK_50MHz is not set 80# CONFIG_CLOCK_50MHz is not set
55# CONFIG_CLOCK_54MHz is not set 81# CONFIG_CLOCK_54MHz is not set
56# CONFIG_CLOCK_60MHz is not set 82# CONFIG_CLOCK_60MHz is not set
83# CONFIG_CLOCK_62_5MHz is not set
84# CONFIG_CLOCK_64MHz is not set
57CONFIG_CLOCK_66MHz=y 85CONFIG_CLOCK_66MHz=y
58# CONFIG_CLOCK_70MHz is not set 86# CONFIG_CLOCK_70MHz is not set
59# CONFIG_CLOCK_100MHz is not set 87# CONFIG_CLOCK_100MHz is not set
@@ -65,13 +93,19 @@ CONFIG_CLOCK_66MHz=y
65# Platform 93# Platform
66# 94#
67CONFIG_M5272C3=y 95CONFIG_M5272C3=y
96# CONFIG_COBRA5272 is not set
97# CONFIG_CANCam is not set
98# CONFIG_SCALES is not set
68# CONFIG_NETtel is not set 99# CONFIG_NETtel is not set
100# CONFIG_CPU16B is not set
101# CONFIG_MOD5272 is not set
69CONFIG_MOTOROLA=y 102CONFIG_MOTOROLA=y
70# CONFIG_LARGE_ALLOCS is not set 103# CONFIG_LARGE_ALLOCS is not set
71# CONFIG_RAMAUTO is not set 104CONFIG_4KSTACKS=y
105CONFIG_RAMAUTO=y
72# CONFIG_RAM4MB is not set 106# CONFIG_RAM4MB is not set
73# CONFIG_RAM8MB is not set 107# CONFIG_RAM8MB is not set
74CONFIG_RAM16MB=y 108# CONFIG_RAM16MB is not set
75# CONFIG_RAM32MB is not set 109# CONFIG_RAM32MB is not set
76CONFIG_RAMAUTOBIT=y 110CONFIG_RAMAUTOBIT=y
77# CONFIG_RAM8BIT is not set 111# CONFIG_RAM8BIT is not set
@@ -79,20 +113,34 @@ CONFIG_RAMAUTOBIT=y
79# CONFIG_RAM32BIT is not set 113# CONFIG_RAM32BIT is not set
80CONFIG_RAMKERNEL=y 114CONFIG_RAMKERNEL=y
81# CONFIG_ROMKERNEL is not set 115# CONFIG_ROMKERNEL is not set
82# CONFIG_HIMEMKERNEL is not set 116CONFIG_SELECT_MEMORY_MODEL=y
117CONFIG_FLATMEM_MANUAL=y
118# CONFIG_DISCONTIGMEM_MANUAL is not set
119# CONFIG_SPARSEMEM_MANUAL is not set
120CONFIG_FLATMEM=y
121CONFIG_FLAT_NODE_MEM_MAP=y
83 122
84# 123#
85# Bus options (PCI, PCMCIA, EISA, MCA, ISA) 124# Bus options (PCI, PCMCIA, EISA, MCA, ISA)
86# 125#
87# CONFIG_PCI is not set 126# CONFIG_PCI is not set
88# CONFIG_HOTPLUG is not set 127
128#
129# PCCARD (PCMCIA/CardBus) support
130#
131# CONFIG_PCCARD is not set
132
133#
134# PCI Hotplug Support
135#
89 136
90# 137#
91# Executable file formats 138# Executable file formats
92# 139#
93CONFIG_KCORE_AOUT=y
94CONFIG_BINFMT_FLAT=y 140CONFIG_BINFMT_FLAT=y
95# CONFIG_BINFMT_ZFLAT is not set 141# CONFIG_BINFMT_ZFLAT is not set
142# CONFIG_BINFMT_SHARED_FLAT is not set
143# CONFIG_BINFMT_MISC is not set
96 144
97# 145#
98# Power management options 146# Power management options
@@ -100,12 +148,82 @@ CONFIG_BINFMT_FLAT=y
100# CONFIG_PM is not set 148# CONFIG_PM is not set
101 149
102# 150#
151# Networking
152#
153CONFIG_NET=y
154
155#
156# Networking options
157#
158CONFIG_PACKET=y
159# CONFIG_PACKET_MMAP is not set
160CONFIG_UNIX=y
161# CONFIG_NET_KEY is not set
162CONFIG_INET=y
163# CONFIG_IP_MULTICAST is not set
164# CONFIG_IP_ADVANCED_ROUTER is not set
165CONFIG_IP_FIB_HASH=y
166# CONFIG_IP_PNP is not set
167# CONFIG_NET_IPIP is not set
168# CONFIG_NET_IPGRE is not set
169# CONFIG_ARPD is not set
170# CONFIG_SYN_COOKIES is not set
171# CONFIG_INET_AH is not set
172# CONFIG_INET_ESP is not set
173# CONFIG_INET_IPCOMP is not set
174# CONFIG_INET_TUNNEL is not set
175# CONFIG_IP_TCPDIAG is not set
176# CONFIG_IP_TCPDIAG_IPV6 is not set
177# CONFIG_TCP_CONG_ADVANCED is not set
178CONFIG_TCP_CONG_BIC=y
179# CONFIG_IPV6 is not set
180# CONFIG_NETFILTER is not set
181
182#
183# SCTP Configuration (EXPERIMENTAL)
184#
185# CONFIG_IP_SCTP is not set
186# CONFIG_ATM is not set
187# CONFIG_BRIDGE is not set
188# CONFIG_VLAN_8021Q is not set
189# CONFIG_DECNET is not set
190# CONFIG_LLC2 is not set
191# CONFIG_IPX is not set
192# CONFIG_ATALK is not set
193# CONFIG_X25 is not set
194# CONFIG_LAPB is not set
195# CONFIG_NET_DIVERT is not set
196# CONFIG_ECONET is not set
197# CONFIG_WAN_ROUTER is not set
198# CONFIG_NET_SCHED is not set
199# CONFIG_NET_CLS_ROUTE is not set
200
201#
202# Network testing
203#
204# CONFIG_NET_PKTGEN is not set
205# CONFIG_HAMRADIO is not set
206# CONFIG_IRDA is not set
207# CONFIG_BT is not set
208
209#
210# Device Drivers
211#
212
213#
214# Generic Driver Options
215#
216CONFIG_STANDALONE=y
217CONFIG_PREVENT_FIRMWARE_BUILD=y
218# CONFIG_FW_LOADER is not set
219
220#
103# Memory Technology Devices (MTD) 221# Memory Technology Devices (MTD)
104# 222#
105CONFIG_MTD=y 223CONFIG_MTD=y
106# CONFIG_MTD_DEBUG is not set 224# CONFIG_MTD_DEBUG is not set
107CONFIG_MTD_PARTITIONS=y
108# CONFIG_MTD_CONCAT is not set 225# CONFIG_MTD_CONCAT is not set
226CONFIG_MTD_PARTITIONS=y
109# CONFIG_MTD_REDBOOT_PARTS is not set 227# CONFIG_MTD_REDBOOT_PARTS is not set
110# CONFIG_MTD_CMDLINE_PARTS is not set 228# CONFIG_MTD_CMDLINE_PARTS is not set
111 229
@@ -116,35 +234,50 @@ CONFIG_MTD_CHAR=y
116CONFIG_MTD_BLOCK=y 234CONFIG_MTD_BLOCK=y
117# CONFIG_FTL is not set 235# CONFIG_FTL is not set
118# CONFIG_NFTL is not set 236# CONFIG_NFTL is not set
237# CONFIG_INFTL is not set
119 238
120# 239#
121# RAM/ROM/Flash chip drivers 240# RAM/ROM/Flash chip drivers
122# 241#
123# CONFIG_MTD_CFI is not set 242# CONFIG_MTD_CFI is not set
124# CONFIG_MTD_JEDECPROBE is not set 243# CONFIG_MTD_JEDECPROBE is not set
244CONFIG_MTD_MAP_BANK_WIDTH_1=y
245CONFIG_MTD_MAP_BANK_WIDTH_2=y
246CONFIG_MTD_MAP_BANK_WIDTH_4=y
247# CONFIG_MTD_MAP_BANK_WIDTH_8 is not set
248# CONFIG_MTD_MAP_BANK_WIDTH_16 is not set
249# CONFIG_MTD_MAP_BANK_WIDTH_32 is not set
250CONFIG_MTD_CFI_I1=y
251CONFIG_MTD_CFI_I2=y
252# CONFIG_MTD_CFI_I4 is not set
253# CONFIG_MTD_CFI_I8 is not set
125CONFIG_MTD_RAM=y 254CONFIG_MTD_RAM=y
126# CONFIG_MTD_ROM is not set 255# CONFIG_MTD_ROM is not set
127# CONFIG_MTD_ABSENT is not set 256# CONFIG_MTD_ABSENT is not set
128# CONFIG_MTD_OBSOLETE_CHIPS is not set
129 257
130# 258#
131# Mapping drivers for chip access 259# Mapping drivers for chip access
132# 260#
261# CONFIG_MTD_COMPLEX_MAPPINGS is not set
133CONFIG_MTD_UCLINUX=y 262CONFIG_MTD_UCLINUX=y
263# CONFIG_MTD_SNAPGEARuC is not set
264# CONFIG_MTD_PLATRAM is not set
134 265
135# 266#
136# Self-contained MTD device drivers 267# Self-contained MTD device drivers
137# 268#
138# CONFIG_MTD_SLRAM is not set 269# CONFIG_MTD_SLRAM is not set
270# CONFIG_MTD_PHRAM is not set
139# CONFIG_MTD_MTDRAM is not set 271# CONFIG_MTD_MTDRAM is not set
140# CONFIG_MTD_BLKMTD is not set 272# CONFIG_MTD_BLKMTD is not set
273# CONFIG_MTD_BLOCK2MTD is not set
141 274
142# 275#
143# Disk-On-Chip Device Drivers 276# Disk-On-Chip Device Drivers
144# 277#
145# CONFIG_MTD_DOC1000 is not set
146# CONFIG_MTD_DOC2000 is not set 278# CONFIG_MTD_DOC2000 is not set
147# CONFIG_MTD_DOC2001 is not set 279# CONFIG_MTD_DOC2001 is not set
280# CONFIG_MTD_DOC2001PLUS is not set
148 281
149# 282#
150# NAND Flash Device Drivers 283# NAND Flash Device Drivers
@@ -159,21 +292,32 @@ CONFIG_MTD_UCLINUX=y
159# 292#
160# Plug and Play support 293# Plug and Play support
161# 294#
162# CONFIG_PNP is not set
163 295
164# 296#
165# Block devices 297# Block devices
166# 298#
167# CONFIG_BLK_DEV_FD is not set 299# CONFIG_BLK_DEV_FD is not set
300# CONFIG_BLK_DEV_COW_COMMON is not set
168# CONFIG_BLK_DEV_LOOP is not set 301# CONFIG_BLK_DEV_LOOP is not set
169# CONFIG_BLK_DEV_NBD is not set 302# CONFIG_BLK_DEV_NBD is not set
170CONFIG_BLK_DEV_RAM=y 303CONFIG_BLK_DEV_RAM=y
304CONFIG_BLK_DEV_RAM_COUNT=16
171CONFIG_BLK_DEV_RAM_SIZE=4096 305CONFIG_BLK_DEV_RAM_SIZE=4096
172# CONFIG_BLK_DEV_INITRD is not set 306# CONFIG_BLK_DEV_INITRD is not set
173# CONFIG_BLK_DEV_BLKMEM is not set 307CONFIG_INITRAMFS_SOURCE=""
308# CONFIG_CDROM_PKTCDVD is not set
174 309
175# 310#
176# ATA/IDE/MFM/RLL support 311# IO Schedulers
312#
313CONFIG_IOSCHED_NOOP=y
314# CONFIG_IOSCHED_AS is not set
315# CONFIG_IOSCHED_DEADLINE is not set
316# CONFIG_IOSCHED_CFQ is not set
317# CONFIG_ATA_OVER_ETH is not set
318
319#
320# ATA/ATAPI/MFM/RLL support
177# 321#
178# CONFIG_IDE is not set 322# CONFIG_IDE is not set
179 323
@@ -190,249 +334,230 @@ CONFIG_BLK_DEV_RAM_SIZE=4096
190# 334#
191# Fusion MPT device support 335# Fusion MPT device support
192# 336#
337# CONFIG_FUSION is not set
193 338
194# 339#
195# I2O device support 340# IEEE 1394 (FireWire) support
196#
197
198#
199# Networking support
200#
201CONFIG_NET=y
202
203#
204# Networking options
205#
206CONFIG_PACKET=y
207# CONFIG_PACKET_MMAP is not set
208# CONFIG_NETLINK_DEV is not set
209# CONFIG_NETFILTER is not set
210# CONFIG_FILTER is not set
211CONFIG_UNIX=y
212# CONFIG_NET_KEY is not set
213CONFIG_INET=y
214# CONFIG_IP_MULTICAST is not set
215# CONFIG_IP_ADVANCED_ROUTER is not set
216# CONFIG_IP_PNP is not set
217# CONFIG_NET_IPIP is not set
218# CONFIG_NET_IPGRE is not set
219# CONFIG_ARPD is not set
220# CONFIG_INET_ECN is not set
221# CONFIG_SYN_COOKIES is not set
222# CONFIG_INET_AH is not set
223# CONFIG_INET_ESP is not set
224# CONFIG_XFRM_USER is not set
225# CONFIG_IPV6 is not set
226
227#
228# SCTP Configuration (EXPERIMENTAL)
229# 341#
230CONFIG_IPV6_SCTP__=y
231# CONFIG_IP_SCTP is not set
232# CONFIG_ATM is not set
233# CONFIG_VLAN_8021Q is not set
234# CONFIG_LLC is not set
235# CONFIG_DECNET is not set
236# CONFIG_BRIDGE is not set
237# CONFIG_X25 is not set
238# CONFIG_LAPB is not set
239# CONFIG_NET_DIVERT is not set
240# CONFIG_ECONET is not set
241# CONFIG_WAN_ROUTER is not set
242# CONFIG_NET_HW_FLOWCONTROL is not set
243 342
244# 343#
245# QoS and/or fair queueing 344# I2O device support
246# 345#
247# CONFIG_NET_SCHED is not set
248 346
249# 347#
250# Network testing 348# Network device support
251# 349#
252# CONFIG_NET_PKTGEN is not set
253CONFIG_NETDEVICES=y 350CONFIG_NETDEVICES=y
254# CONFIG_DUMMY is not set 351# CONFIG_DUMMY is not set
255# CONFIG_BONDING is not set 352# CONFIG_BONDING is not set
256# CONFIG_EQUALIZER is not set 353# CONFIG_EQUALIZER is not set
257# CONFIG_TUN is not set 354# CONFIG_TUN is not set
258# CONFIG_ETHERTAP is not set
259 355
260# 356#
261# Ethernet (10 or 100Mbit) 357# Ethernet (10 or 100Mbit)
262# 358#
263CONFIG_NET_ETHERNET=y 359CONFIG_NET_ETHERNET=y
264# CONFIG_MII is not set 360# CONFIG_MII is not set
361# CONFIG_NET_VENDOR_SMC is not set
362# CONFIG_NE2000 is not set
363# CONFIG_NET_PCI is not set
265CONFIG_FEC=y 364CONFIG_FEC=y
365# CONFIG_FEC2 is not set
266 366
267# 367#
268# Ethernet (1000 Mbit) 368# Ethernet (1000 Mbit)
269# 369#
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
270CONFIG_PPP=y 388CONFIG_PPP=y
271# CONFIG_PPP_MULTILINK is not set 389# CONFIG_PPP_MULTILINK is not set
390# CONFIG_PPP_FILTER is not set
272# CONFIG_PPP_ASYNC is not set 391# CONFIG_PPP_ASYNC is not set
273# CONFIG_PPP_SYNC_TTY is not set 392# CONFIG_PPP_SYNC_TTY is not set
274# CONFIG_PPP_DEFLATE is not set 393# CONFIG_PPP_DEFLATE is not set
275# CONFIG_PPP_BSDCOMP is not set 394# CONFIG_PPP_BSDCOMP is not set
276# CONFIG_PPPOE is not set 395# CONFIG_PPPOE is not set
277# CONFIG_SLIP is not set 396# CONFIG_SLIP is not set
397# CONFIG_SHAPER is not set
398# CONFIG_NETCONSOLE is not set
399# CONFIG_NETPOLL is not set
400# CONFIG_NET_POLL_CONTROLLER is not set
278 401
279# 402#
280# Wireless LAN (non-hamradio) 403# ISDN subsystem
281# 404#
282# CONFIG_NET_RADIO is not set 405# CONFIG_ISDN is not set
283 406
284# 407#
285# Token Ring devices (depends on LLC=y) 408# Telephony Support
286# 409#
287# CONFIG_SHAPER is not set 410# CONFIG_PHONE is not set
288 411
289# 412#
290# Wan interfaces 413# Input device support
291# 414#
292# CONFIG_WAN is not set 415# CONFIG_INPUT is not set
293 416
294# 417#
295# Amateur Radio support 418# Hardware I/O ports
296# 419#
297# CONFIG_HAMRADIO is not set 420# CONFIG_SERIO is not set
421# CONFIG_GAMEPORT is not set
298 422
299# 423#
300# IrDA (infrared) support 424# Character devices
301# 425#
302# CONFIG_IRDA is not set 426# CONFIG_VT is not set
427# CONFIG_SERIAL_NONSTANDARD is not set
428# CONFIG_LEDMAN is not set
429# CONFIG_RESETSWITCH is not set
303 430
304# 431#
305# ISDN subsystem 432# Serial drivers
306# 433#
307# CONFIG_ISDN_BOOL is not set 434# CONFIG_SERIAL_8250 is not set
308 435
309# 436#
310# Telephony Support 437# Non-8250 serial port support
311# 438#
312# CONFIG_PHONE is not set 439CONFIG_SERIAL_COLDFIRE=y
440# CONFIG_UNIX98_PTYS is not set
441CONFIG_LEGACY_PTYS=y
442CONFIG_LEGACY_PTY_COUNT=256
313 443
314# 444#
315# Input device support 445# IPMI
316# 446#
317CONFIG_INPUT=y 447# CONFIG_IPMI_HANDLER is not set
318 448
319# 449#
320# Userland interfaces 450# Watchdog Cards
321# 451#
322CONFIG_INPUT_MOUSEDEV=y 452# CONFIG_WATCHDOG is not set
323CONFIG_INPUT_MOUSEDEV_PSAUX=y 453# CONFIG_MCFWATCHDOG is not set
324CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024 454# CONFIG_RTC is not set
325CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768 455# CONFIG_GEN_RTC is not set
326# CONFIG_INPUT_JOYDEV is not set 456# CONFIG_DTLK is not set
327# CONFIG_INPUT_TSDEV is not set 457# CONFIG_R3964 is not set
328# CONFIG_INPUT_EVDEV is not set
329# CONFIG_INPUT_EVBUG is not set
330 458
331# 459#
332# Input I/O drivers 460# Ftape, the floppy tape device driver
333# 461#
334# CONFIG_GAMEPORT is not set 462# CONFIG_RAW_DRIVER is not set
335CONFIG_SOUND_GAMEPORT=y
336CONFIG_SERIO=y
337CONFIG_SERIO_I8042=y
338CONFIG_SERIO_SERPORT=y
339# CONFIG_SERIO_CT82C710 is not set
340 463
341# 464#
342# Input Device Drivers 465# TPM devices
343# 466#
344CONFIG_INPUT_KEYBOARD=y 467# CONFIG_MCF_QSPI is not set
345CONFIG_KEYBOARD_ATKBD=y 468# CONFIG_M41T11M6 is not set
346# CONFIG_KEYBOARD_SUNKBD is not set
347# CONFIG_KEYBOARD_XTKBD is not set
348# CONFIG_KEYBOARD_NEWTON is not set
349CONFIG_INPUT_MOUSE=y
350CONFIG_MOUSE_PS2=y
351# CONFIG_MOUSE_SERIAL is not set
352# CONFIG_INPUT_JOYSTICK is not set
353# CONFIG_INPUT_TOUCHSCREEN is not set
354# CONFIG_INPUT_MISC is not set
355 469
356# 470#
357# Character devices 471# I2C support
358# 472#
359# CONFIG_VT is not set 473# CONFIG_I2C is not set
360# CONFIG_SERIAL_NONSTANDARD is not set 474# CONFIG_I2C_SENSOR is not set
361# CONFIG_RESETSWITCH is not set
362 475
363# 476#
364# Serial drivers 477# Dallas's 1-wire bus
365# 478#
366# CONFIG_SERIAL_8250 is not set 479# CONFIG_W1 is not set
367 480
368# 481#
369# Non-8250 serial port support 482# Hardware Monitoring support
370# 483#
371CONFIG_SERIAL_COLDFIRE=y 484# CONFIG_HWMON is not set
372# CONFIG_UNIX98_PTYS is not set
373 485
374# 486#
375# I2C support 487# Misc devices
376# 488#
377# CONFIG_I2C is not set
378 489
379# 490#
380# I2C Hardware Sensors Mainboard support 491# Multimedia devices
381# 492#
493# CONFIG_VIDEO_DEV is not set
382 494
383# 495#
384# I2C Hardware Sensors Chip support 496# Digital Video Broadcasting Devices
385# 497#
498# CONFIG_DVB is not set
386 499
387# 500#
388# Mice 501# Graphics support
389# 502#
390# CONFIG_BUSMOUSE is not set 503# CONFIG_FB is not set
391# CONFIG_QIC02_TAPE is not set
392 504
393# 505#
394# IPMI 506# SPI support
395# 507#
396# CONFIG_IPMI_HANDLER is not set 508# CONFIG_SPI is not set
397 509
398# 510#
399# Watchdog Cards 511# Sound
400# 512#
401# CONFIG_WATCHDOG is not set 513# CONFIG_SOUND is not set
402# CONFIG_NVRAM is not set
403# CONFIG_RTC is not set
404# CONFIG_GEN_RTC is not set
405# CONFIG_DTLK is not set
406# CONFIG_R3964 is not set
407# CONFIG_APPLICOM is not set
408 514
409# 515#
410# Ftape, the floppy tape device driver 516# USB support
411# 517#
412# CONFIG_FTAPE is not set 518# CONFIG_USB_ARCH_HAS_HCD is not set
413# CONFIG_AGP is not set 519# CONFIG_USB_ARCH_HAS_OHCI is not set
414# CONFIG_DRM is not set
415# CONFIG_RAW_DRIVER is not set
416# CONFIG_HANGCHECK_TIMER is not set
417 520
418# 521#
419# Multimedia devices 522# USB Gadget Support
523#
524# CONFIG_USB_GADGET is not set
525
526#
527# MMC/SD Card support
528#
529# CONFIG_MMC is not set
530
531#
532# InfiniBand support
533#
534
535#
536# SN Devices
420# 537#
421# CONFIG_VIDEO_DEV is not set
422 538
423# 539#
424# File systems 540# File systems
425# 541#
426CONFIG_EXT2_FS=y 542CONFIG_EXT2_FS=y
427# CONFIG_EXT2_FS_XATTR is not set 543# CONFIG_EXT2_FS_XATTR is not set
544# CONFIG_EXT2_FS_XIP is not set
428# CONFIG_EXT3_FS is not set 545# CONFIG_EXT3_FS is not set
429# CONFIG_JBD is not set 546# CONFIG_JBD is not set
430# CONFIG_REISERFS_FS is not set 547# CONFIG_REISERFS_FS is not set
431# CONFIG_JFS_FS is not set 548# CONFIG_JFS_FS is not set
549# CONFIG_FS_POSIX_ACL is not set
550
551#
552# XFS support
553#
432# CONFIG_XFS_FS is not set 554# CONFIG_XFS_FS is not set
433# CONFIG_MINIX_FS is not set 555# CONFIG_MINIX_FS is not set
434CONFIG_ROMFS_FS=y 556CONFIG_ROMFS_FS=y
557CONFIG_MAGIC_ROM_PTR=y
558# CONFIG_INOTIFY is not set
435# CONFIG_QUOTA is not set 559# CONFIG_QUOTA is not set
560# CONFIG_DNOTIFY is not set
436# CONFIG_AUTOFS_FS is not set 561# CONFIG_AUTOFS_FS is not set
437# CONFIG_AUTOFS4_FS is not set 562# CONFIG_AUTOFS4_FS is not set
438 563
@@ -445,15 +570,17 @@ CONFIG_ROMFS_FS=y
445# 570#
446# DOS/FAT/NT Filesystems 571# DOS/FAT/NT Filesystems
447# 572#
448# CONFIG_FAT_FS is not set 573# CONFIG_MSDOS_FS is not set
574# CONFIG_VFAT_FS is not set
449# CONFIG_NTFS_FS is not set 575# CONFIG_NTFS_FS is not set
450 576
451# 577#
452# Pseudo filesystems 578# Pseudo filesystems
453# 579#
454CONFIG_PROC_FS=y 580CONFIG_PROC_FS=y
455# CONFIG_DEVFS_FS is not set 581CONFIG_SYSFS=y
456# CONFIG_TMPFS is not set 582# CONFIG_TMPFS is not set
583# CONFIG_HUGETLB_PAGE is not set
457CONFIG_RAMFS=y 584CONFIG_RAMFS=y
458 585
459# 586#
@@ -462,6 +589,7 @@ CONFIG_RAMFS=y
462# CONFIG_ADFS_FS is not set 589# CONFIG_ADFS_FS is not set
463# CONFIG_AFFS_FS is not set 590# CONFIG_AFFS_FS is not set
464# CONFIG_HFS_FS is not set 591# CONFIG_HFS_FS is not set
592# CONFIG_HFSPLUS_FS is not set
465# CONFIG_BEFS_FS is not set 593# CONFIG_BEFS_FS is not set
466# CONFIG_BFS_FS is not set 594# CONFIG_BFS_FS is not set
467# CONFIG_EFS_FS is not set 595# CONFIG_EFS_FS is not set
@@ -479,12 +607,10 @@ CONFIG_RAMFS=y
479# 607#
480# CONFIG_NFS_FS is not set 608# CONFIG_NFS_FS is not set
481# CONFIG_NFSD is not set 609# CONFIG_NFSD is not set
482# CONFIG_EXPORTFS is not set
483# CONFIG_SMB_FS is not set 610# CONFIG_SMB_FS is not set
484# CONFIG_CIFS is not set 611# CONFIG_CIFS is not set
485# CONFIG_NCP_FS is not set 612# CONFIG_NCP_FS is not set
486# CONFIG_CODA_FS is not set 613# CONFIG_CODA_FS is not set
487# CONFIG_INTERMEZZO_FS is not set
488# CONFIG_AFS_FS is not set 614# CONFIG_AFS_FS is not set
489 615
490# 616#
@@ -494,30 +620,19 @@ CONFIG_RAMFS=y
494CONFIG_MSDOS_PARTITION=y 620CONFIG_MSDOS_PARTITION=y
495 621
496# 622#
497# Graphics support 623# Native Language Support
498#
499# CONFIG_FB is not set
500
501#
502# Sound
503#
504# CONFIG_SOUND is not set
505
506#
507# USB support
508#
509
510#
511# Bluetooth support
512# 624#
513# CONFIG_BT is not set 625# CONFIG_NLS is not set
514 626
515# 627#
516# Kernel hacking 628# Kernel hacking
517# 629#
630# CONFIG_PRINTK_TIME is not set
631# CONFIG_DEBUG_KERNEL is not set
632CONFIG_LOG_BUF_SHIFT=14
518# CONFIG_FULLDEBUG is not set 633# CONFIG_FULLDEBUG is not set
519# CONFIG_MAGIC_SYSRQ is not set
520# CONFIG_HIGHPROFILE is not set 634# CONFIG_HIGHPROFILE is not set
635# CONFIG_BOOTPARAM is not set
521# CONFIG_DUMPTOFLASH is not set 636# CONFIG_DUMPTOFLASH is not set
522# CONFIG_NO_KERNEL_MSG is not set 637# CONFIG_NO_KERNEL_MSG is not set
523# CONFIG_BDM_DISABLE is not set 638# CONFIG_BDM_DISABLE is not set
@@ -525,6 +640,7 @@ CONFIG_MSDOS_PARTITION=y
525# 640#
526# Security options 641# Security options
527# 642#
643# CONFIG_KEYS is not set
528# CONFIG_SECURITY is not set 644# CONFIG_SECURITY is not set
529 645
530# 646#
@@ -533,6 +649,12 @@ CONFIG_MSDOS_PARTITION=y
533# CONFIG_CRYPTO is not set 649# CONFIG_CRYPTO is not set
534 650
535# 651#
652# Hardware crypto devices
653#
654
655#
536# Library routines 656# Library routines
537# 657#
658# CONFIG_CRC_CCITT is not set
538# CONFIG_CRC32 is not set 659# CONFIG_CRC32 is not set
660# CONFIG_LIBCRC32C is not set
diff --git a/arch/m68knommu/kernel/process.c b/arch/m68knommu/kernel/process.c
index c4a33f265dc0..82e7ec888806 100644
--- a/arch/m68knommu/kernel/process.c
+++ b/arch/m68knommu/kernel/process.c
@@ -80,8 +80,6 @@ void machine_restart(char * __unused)
80 for (;;); 80 for (;;);
81} 81}
82 82
83EXPORT_SYMBOL(machine_restart);
84
85void machine_halt(void) 83void machine_halt(void)
86{ 84{
87 if (mach_halt) 85 if (mach_halt)
@@ -89,8 +87,6 @@ void machine_halt(void)
89 for (;;); 87 for (;;);
90} 88}
91 89
92EXPORT_SYMBOL(machine_halt);
93
94void machine_power_off(void) 90void machine_power_off(void)
95{ 91{
96 if (mach_power_off) 92 if (mach_power_off)
@@ -98,8 +94,6 @@ void machine_power_off(void)
98 for (;;); 94 for (;;);
99} 95}
100 96
101EXPORT_SYMBOL(machine_power_off);
102
103void show_regs(struct pt_regs * regs) 97void show_regs(struct pt_regs * regs)
104{ 98{
105 printk(KERN_NOTICE "\n"); 99 printk(KERN_NOTICE "\n");
diff --git a/arch/m68knommu/kernel/setup.c b/arch/m68knommu/kernel/setup.c
index 557238596dcb..a220345e9746 100644
--- a/arch/m68knommu/kernel/setup.c
+++ b/arch/m68knommu/kernel/setup.c
@@ -6,7 +6,7 @@
6 * Copyleft ()) 2000 James D. Schettine {james@telos-systems.com} 6 * Copyleft ()) 2000 James D. Schettine {james@telos-systems.com}
7 * Copyright (C) 1998 Kenneth Albanowski <kjahds@kjahds.com> 7 * Copyright (C) 1998 Kenneth Albanowski <kjahds@kjahds.com>
8 * Copyright (C) 1995 Hamish Macdonald 8 * Copyright (C) 1995 Hamish Macdonald
9 * Copyright (C) 2000 Lineo Inc. (www.lineo.com) 9 * Copyright (C) 2000 Lineo Inc. (www.lineo.com)
10 * Copyright (C) 2001 Lineo, Inc. <www.lineo.com> 10 * Copyright (C) 2001 Lineo, Inc. <www.lineo.com>
11 * 11 *
12 * 68VZ328 Fixes/support Evan Stawnyczy <e@lineo.ca> 12 * 68VZ328 Fixes/support Evan Stawnyczy <e@lineo.ca>
@@ -23,6 +23,7 @@
23#include <linux/interrupt.h> 23#include <linux/interrupt.h>
24#include <linux/fs.h> 24#include <linux/fs.h>
25#include <linux/fb.h> 25#include <linux/fb.h>
26#include <linux/module.h>
26#include <linux/console.h> 27#include <linux/console.h>
27#include <linux/genhd.h> 28#include <linux/genhd.h>
28#include <linux/errno.h> 29#include <linux/errno.h>
@@ -45,6 +46,9 @@ unsigned long rom_length;
45unsigned long memory_start; 46unsigned long memory_start;
46unsigned long memory_end; 47unsigned long memory_end;
47 48
49EXPORT_SYMBOL(memory_start);
50EXPORT_SYMBOL(memory_end);
51
48char command_line[COMMAND_LINE_SIZE]; 52char command_line[COMMAND_LINE_SIZE];
49 53
50/* setup some dummy routines */ 54/* setup some dummy routines */
@@ -103,15 +107,21 @@ void (*mach_power_off)( void ) = NULL;
103#if defined(CONFIG_M5206e) 107#if defined(CONFIG_M5206e)
104 #define CPU "COLDFIRE(m5206e)" 108 #define CPU "COLDFIRE(m5206e)"
105#endif 109#endif
110#if defined(CONFIG_M523x)
111 #define CPU "COLDFIRE(m523x)"
112#endif
106#if defined(CONFIG_M5249) 113#if defined(CONFIG_M5249)
107 #define CPU "COLDFIRE(m5249)" 114 #define CPU "COLDFIRE(m5249)"
108#endif 115#endif
109#if defined(CONFIG_M527x) 116#if defined(CONFIG_M5271)
110 #define CPU "COLDFIRE(m5270/5271/5274/5275)" 117 #define CPU "COLDFIRE(m5270/5271)"
111#endif 118#endif
112#if defined(CONFIG_M5272) 119#if defined(CONFIG_M5272)
113 #define CPU "COLDFIRE(m5272)" 120 #define CPU "COLDFIRE(m5272)"
114#endif 121#endif
122#if defined(CONFIG_M5275)
123 #define CPU "COLDFIRE(m5274/5275)"
124#endif
115#if defined(CONFIG_M528x) 125#if defined(CONFIG_M528x)
116 #define CPU "COLDFIRE(m5280/5282)" 126 #define CPU "COLDFIRE(m5280/5282)"
117#endif 127#endif
@@ -152,7 +162,7 @@ void setup_arch(char **cmdline_p)
152 init_mm.start_code = (unsigned long) &_stext; 162 init_mm.start_code = (unsigned long) &_stext;
153 init_mm.end_code = (unsigned long) &_etext; 163 init_mm.end_code = (unsigned long) &_etext;
154 init_mm.end_data = (unsigned long) &_edata; 164 init_mm.end_data = (unsigned long) &_edata;
155 init_mm.brk = (unsigned long) 0; 165 init_mm.brk = (unsigned long) 0;
156 166
157 config_BSP(&command_line[0], sizeof(command_line)); 167 config_BSP(&command_line[0], sizeof(command_line));
158 168
@@ -171,7 +181,7 @@ void setup_arch(char **cmdline_p)
171#endif 181#endif
172#ifdef CONFIG_ELITE 182#ifdef CONFIG_ELITE
173 printk(KERN_INFO "Modified for M5206eLITE by Rob Scott, rscott@mtrob.fdns.net\n"); 183 printk(KERN_INFO "Modified for M5206eLITE by Rob Scott, rscott@mtrob.fdns.net\n");
174#endif 184#endif
175#ifdef CONFIG_TELOS 185#ifdef CONFIG_TELOS
176 printk(KERN_INFO "Modified for Omnia ToolVox by James D. Schettine, james@telos-systems.com\n"); 186 printk(KERN_INFO "Modified for Omnia ToolVox by James D. Schettine, james@telos-systems.com\n");
177#endif 187#endif
@@ -200,6 +210,9 @@ void setup_arch(char **cmdline_p)
200#ifdef CONFIG_DRAGEN2 210#ifdef CONFIG_DRAGEN2
201 printk(KERN_INFO "DragonEngine II board support by Georges Menie\n"); 211 printk(KERN_INFO "DragonEngine II board support by Georges Menie\n");
202#endif 212#endif
213#ifdef CONFIG_M5235EVB
214 printk(KERN_INFO "Motorola M5235EVB support (C)2005 Syn-tech Systems, Inc. (Jate Sujjavanich)");
215#endif
203 216
204#ifdef DEBUG 217#ifdef DEBUG
205 printk(KERN_DEBUG "KERNEL -> TEXT=0x%06x-0x%06x DATA=0x%06x-0x%06x " 218 printk(KERN_DEBUG "KERNEL -> TEXT=0x%06x-0x%06x DATA=0x%06x-0x%06x "
@@ -223,7 +236,7 @@ void setup_arch(char **cmdline_p)
223 saved_command_line[COMMAND_LINE_SIZE-1] = 0; 236 saved_command_line[COMMAND_LINE_SIZE-1] = 0;
224 237
225#ifdef DEBUG 238#ifdef DEBUG
226 if (strlen(*cmdline_p)) 239 if (strlen(*cmdline_p))
227 printk(KERN_DEBUG "Command line: '%s'\n", *cmdline_p); 240 printk(KERN_DEBUG "Command line: '%s'\n", *cmdline_p);
228#endif 241#endif
229 242
diff --git a/arch/m68knommu/kernel/signal.c b/arch/m68knommu/kernel/signal.c
index 30dceb59a462..43a2726c0d0a 100644
--- a/arch/m68knommu/kernel/signal.c
+++ b/arch/m68knommu/kernel/signal.c
@@ -732,13 +732,12 @@ handle_signal(int sig, struct k_sigaction *ka, siginfo_t *info,
732 if (ka->sa.sa_flags & SA_ONESHOT) 732 if (ka->sa.sa_flags & SA_ONESHOT)
733 ka->sa.sa_handler = SIG_DFL; 733 ka->sa.sa_handler = SIG_DFL;
734 734
735 if (!(ka->sa.sa_flags & SA_NODEFER)) { 735 spin_lock_irq(&current->sighand->siglock);
736 spin_lock_irq(&current->sighand->siglock); 736 sigorsets(&current->blocked,&current->blocked,&ka->sa.sa_mask);
737 sigorsets(&current->blocked,&current->blocked,&ka->sa.sa_mask); 737 if (!(ka->sa.sa_flags & SA_NODEFER))
738 sigaddset(&current->blocked,sig); 738 sigaddset(&current->blocked,sig);
739 recalc_sigpending(); 739 recalc_sigpending();
740 spin_unlock_irq(&current->sighand->siglock); 740 spin_unlock_irq(&current->sighand->siglock);
741 }
742} 741}
743 742
744/* 743/*
diff --git a/arch/m68knommu/kernel/traps.c b/arch/m68knommu/kernel/traps.c
index ad7dc6347f19..5bc068462864 100644
--- a/arch/m68knommu/kernel/traps.c
+++ b/arch/m68knommu/kernel/traps.c
@@ -21,6 +21,7 @@
21#include <linux/signal.h> 21#include <linux/signal.h>
22#include <linux/kernel.h> 22#include <linux/kernel.h>
23#include <linux/mm.h> 23#include <linux/mm.h>
24#include <linux/module.h>
24#include <linux/types.h> 25#include <linux/types.h>
25#include <linux/a.out.h> 26#include <linux/a.out.h>
26#include <linux/user.h> 27#include <linux/user.h>
@@ -38,7 +39,7 @@
38#include <asm/machdep.h> 39#include <asm/machdep.h>
39#include <asm/siginfo.h> 40#include <asm/siginfo.h>
40 41
41static char *vec_names[] = { 42static char const * const vec_names[] = {
42 "RESET SP", "RESET PC", "BUS ERROR", "ADDRESS ERROR", 43 "RESET SP", "RESET PC", "BUS ERROR", "ADDRESS ERROR",
43 "ILLEGAL INSTRUCTION", "ZERO DIVIDE", "CHK", "TRAPcc", 44 "ILLEGAL INSTRUCTION", "ZERO DIVIDE", "CHK", "TRAPcc",
44 "PRIVILEGE VIOLATION", "TRACE", "LINE 1010", "LINE 1111", 45 "PRIVILEGE VIOLATION", "TRACE", "LINE 1010", "LINE 1111",
@@ -106,17 +107,20 @@ asmlinkage void buserr_c(struct frame *fp)
106 107
107int kstack_depth_to_print = 48; 108int kstack_depth_to_print = 48;
108 109
109void show_stack(struct task_struct *task, unsigned long *esp) 110void show_stack(struct task_struct *task, unsigned long *stack)
110{ 111{
111 unsigned long *stack, *endstack, addr; 112 unsigned long *endstack, addr;
112 extern char _start, _etext; 113 extern char _start, _etext;
113 int i; 114 int i;
114 115
115 if (esp == NULL) 116 if (!stack) {
116 esp = (unsigned long *) &esp; 117 if (task)
118 stack = (unsigned long *)task->thread.ksp;
119 else
120 stack = (unsigned long *)&stack;
121 }
117 122
118 stack = esp; 123 addr = (unsigned long) stack;
119 addr = (unsigned long) esp;
120 endstack = (unsigned long *) PAGE_ALIGN(addr); 124 endstack = (unsigned long *) PAGE_ALIGN(addr);
121 125
122 printk(KERN_EMERG "Stack from %08lx:", (unsigned long)stack); 126 printk(KERN_EMERG "Stack from %08lx:", (unsigned long)stack);
@@ -306,6 +310,8 @@ void dump_stack(void)
306 show_stack(current, &stack); 310 show_stack(current, &stack);
307} 311}
308 312
313EXPORT_SYMBOL(dump_stack);
314
309#ifdef CONFIG_M68KFPU_EMU 315#ifdef CONFIG_M68KFPU_EMU
310asmlinkage void fpemu_signal(int signal, int code, void *addr) 316asmlinkage void fpemu_signal(int signal, int code, void *addr)
311{ 317{
diff --git a/arch/m68knommu/kernel/vmlinux.lds.S b/arch/m68knommu/kernel/vmlinux.lds.S
index 31cb12892da5..47f06787190d 100644
--- a/arch/m68knommu/kernel/vmlinux.lds.S
+++ b/arch/m68knommu/kernel/vmlinux.lds.S
@@ -107,7 +107,7 @@
107 */ 107 */
108#if defined(CONFIG_ELITE) 108#if defined(CONFIG_ELITE)
109#define RAM_START 0x30020000 109#define RAM_START 0x30020000
110#define RAM_END 0xe0000 110#define RAM_LENGTH 0xe0000
111#endif 111#endif
112 112
113/* 113/*
@@ -118,7 +118,8 @@
118#if defined(CONFIG_M5206eC3) || defined(CONFIG_M5249C3) || \ 118#if defined(CONFIG_M5206eC3) || defined(CONFIG_M5249C3) || \
119 defined(CONFIG_M5272C3) || defined(CONFIG_M5307C3) || \ 119 defined(CONFIG_M5272C3) || defined(CONFIG_M5307C3) || \
120 defined(CONFIG_ARN5307) || defined(CONFIG_M5407C3) || \ 120 defined(CONFIG_ARN5307) || defined(CONFIG_M5407C3) || \
121 defined(CONFIG_M5271EVB) || defined(CONFIG_M5275EVB) 121 defined(CONFIG_M5271EVB) || defined(CONFIG_M5275EVB) || \
122 defined(CONFIG_M5235EVB)
122#define RAM_START 0x20000 123#define RAM_START 0x20000
123#define RAM_LENGTH 0x3e0000 124#define RAM_LENGTH 0x3e0000
124#endif 125#endif
@@ -145,6 +146,16 @@
145#define RAM_LENGTH 0x3f0000 146#define RAM_LENGTH 0x3f0000
146#endif 147#endif
147 148
149
150/*
151 * The EMAC SoM-5282EM module.
152 */
153#if defined(CONFIG_SOM5282EM)
154#define RAM_START 0x10000
155#define RAM_LENGTH 0xff0000
156#endif
157
158
148/* 159/*
149 * These flash boot boards use all of ram for operation. Again the 160 * These flash boot boards use all of ram for operation. Again the
150 * actual memory size is not important here, assume at least 4MiB. 161 * actual memory size is not important here, assume at least 4MiB.
@@ -158,7 +169,7 @@
158#endif 169#endif
159 170
160/* 171/*
161 * Sneha Boards mimimun memmory 172 * Sneha Boards mimimun memory
162 * The end of RAM will vary depending on how much ram is fitted, 173 * The end of RAM will vary depending on how much ram is fitted,
163 * but this isn't important here, we assume at least 4MiB. 174 * but this isn't important here, we assume at least 4MiB.
164 */ 175 */
@@ -167,6 +178,12 @@
167#define RAM_LENGTH 0x3e0000 178#define RAM_LENGTH 0x3e0000
168#endif 179#endif
169 180
181#if defined(CONFIG_MOD5272)
182#define RAM_START 0x02000000
183#define RAM_LENGTH 0x00800000
184#define RAMVEC_START 0x20000000
185#define RAMVEC_LENGTH 0x00000400
186#endif
170 187
171#if defined(CONFIG_RAMKERNEL) 188#if defined(CONFIG_RAMKERNEL)
172#define TEXT ram 189#define TEXT ram
diff --git a/arch/m68knommu/platform/523x/config.c b/arch/m68knommu/platform/523x/config.c
new file mode 100644
index 000000000000..22767ce506e0
--- /dev/null
+++ b/arch/m68knommu/platform/523x/config.c
@@ -0,0 +1,82 @@
1/***************************************************************************/
2
3/*
4 * linux/arch/m68knommu/platform/523x/config.c
5 *
6 * Sub-architcture dependant initialization code for the Freescale
7 * 523x CPUs.
8 *
9 * Copyright (C) 1999-2005, Greg Ungerer (gerg@snapgear.com)
10 * Copyright (C) 2001-2003, SnapGear Inc. (www.snapgear.com)
11 */
12
13/***************************************************************************/
14
15#include <linux/config.h>
16#include <linux/kernel.h>
17#include <linux/sched.h>
18#include <linux/param.h>
19#include <linux/init.h>
20#include <linux/interrupt.h>
21#include <asm/dma.h>
22#include <asm/traps.h>
23#include <asm/machdep.h>
24#include <asm/coldfire.h>
25#include <asm/mcfsim.h>
26#include <asm/mcfdma.h>
27
28/***************************************************************************/
29
30void coldfire_pit_tick(void);
31void coldfire_pit_init(irqreturn_t (*handler)(int, void *, struct pt_regs *));
32unsigned long coldfire_pit_offset(void);
33void coldfire_trap_init(void);
34void coldfire_reset(void);
35
36/***************************************************************************/
37
38/*
39 * DMA channel base address table.
40 */
41unsigned int dma_base_addr[MAX_M68K_DMA_CHANNELS] = {
42 MCF_MBAR + MCFDMA_BASE0,
43};
44
45unsigned int dma_device_address[MAX_M68K_DMA_CHANNELS];
46
47/***************************************************************************/
48
49void mcf_disableall(void)
50{
51 *((volatile unsigned long *) (MCF_IPSBAR + MCFICM_INTC0 + MCFINTC_IMRH)) = 0xffffffff;
52 *((volatile unsigned long *) (MCF_IPSBAR + MCFICM_INTC0 + MCFINTC_IMRL)) = 0xffffffff;
53}
54
55/***************************************************************************/
56
57void mcf_autovector(unsigned int vec)
58{
59 /* Everything is auto-vectored on the 5272 */
60}
61
62/***************************************************************************/
63
64void config_BSP(char *commandp, int size)
65{
66 mcf_disableall();
67
68#ifdef CONFIG_BOOTPARAM
69 strncpy(commandp, CONFIG_BOOTPARAM_STRING, size);
70 commandp[size-1] = 0;
71#else
72 memset(commandp, 0, size);
73#endif
74
75 mach_sched_init = coldfire_pit_init;
76 mach_tick = coldfire_pit_tick;
77 mach_gettimeoffset = coldfire_pit_offset;
78 mach_trap_init = coldfire_trap_init;
79 mach_reset = coldfire_reset;
80}
81
82/***************************************************************************/
diff --git a/arch/m68knommu/platform/5307/head.S b/arch/m68knommu/platform/5307/head.S
index c7d7a395c4cc..7f4ba837901f 100644
--- a/arch/m68knommu/platform/5307/head.S
+++ b/arch/m68knommu/platform/5307/head.S
@@ -39,14 +39,18 @@
39 * Memory size exceptions for special cases. Some boards may be set 39 * Memory size exceptions for special cases. Some boards may be set
40 * for auto memory sizing, but we can't do it that way for some reason. 40 * for auto memory sizing, but we can't do it that way for some reason.
41 * For example the 5206eLITE board has static RAM, and auto-detecting 41 * For example the 5206eLITE board has static RAM, and auto-detecting
42 * the SDRAM will do you no good at all. 42 * the SDRAM will do you no good at all. Same goes for the MOD5272.
43 */ 43 */
44#ifdef CONFIG_RAMAUTO 44#ifdef CONFIG_RAMAUTO
45#if defined(CONFIG_M5206eLITE) 45#if defined(CONFIG_M5206eLITE)
46#define MEM_SIZE 0x00100000 /* 1MiB default memory */ 46#define MEM_SIZE 0x00100000 /* 1MiB default memory */
47#endif
48#if defined(CONFIG_MOD5272)
49#define MEM_SIZE 0x00800000 /* 8MiB default memory */
47#endif 50#endif
48#endif /* CONFIG_RAMAUTO */ 51#endif /* CONFIG_RAMAUTO */
49 52
53
50/* 54/*
51 * If we don't have a fixed memory size now, then lets build in code 55 * If we don't have a fixed memory size now, then lets build in code
52 * to auto detect the DRAM size. Obviously this is the prefered 56 * to auto detect the DRAM size. Obviously this is the prefered
@@ -100,11 +104,15 @@
100 104
101/* 105/*
102 * Most ColdFire boards have their DRAM starting at address 0. 106 * Most ColdFire boards have their DRAM starting at address 0.
103 * Notable exception is the 5206eLITE board. 107 * Notable exception is the 5206eLITE board, another is the MOD5272.
104 */ 108 */
105#if defined(CONFIG_M5206eLITE) 109#if defined(CONFIG_M5206eLITE)
106#define MEM_BASE 0x30000000 110#define MEM_BASE 0x30000000
107#endif 111#endif
112#if defined(CONFIG_MOD5272)
113#define MEM_BASE 0x02000000
114#define VBR_BASE 0x20000000 /* vectors in SRAM */
115#endif
108 116
109#ifndef MEM_BASE 117#ifndef MEM_BASE
110#define MEM_BASE 0x00000000 /* memory base at address 0 */ 118#define MEM_BASE 0x00000000 /* memory base at address 0 */
@@ -188,6 +196,7 @@ _start:
188 movel %a7,_rambase 196 movel %a7,_rambase
189 197
190 GET_MEM_SIZE /* macro code determines size */ 198 GET_MEM_SIZE /* macro code determines size */
199 addl %a7,%d0
191 movel %d0,_ramend /* set end ram addr */ 200 movel %d0,_ramend /* set end ram addr */
192 201
193 /* 202 /*
diff --git a/arch/m68knommu/platform/68328/entry.S b/arch/m68knommu/platform/68328/entry.S
index 0f5d1fe8eb5f..7d8990d784a2 100644
--- a/arch/m68knommu/platform/68328/entry.S
+++ b/arch/m68knommu/platform/68328/entry.S
@@ -79,7 +79,7 @@ ENTRY(system_call)
79 movel %sp@(PT_ORIG_D0),%d0 79 movel %sp@(PT_ORIG_D0),%d0
80 80
81 movel %sp,%d1 /* get thread_info pointer */ 81 movel %sp,%d1 /* get thread_info pointer */
82 andl #0xffffe000,%d1 82 andl #-THREAD_SIZE,%d1
83 movel %d1,%a2 83 movel %d1,%a2
84 btst #TIF_SYSCALL_TRACE,%a2@(TI_FLAGS) 84 btst #TIF_SYSCALL_TRACE,%a2@(TI_FLAGS)
85 jne do_trace 85 jne do_trace
@@ -105,7 +105,7 @@ Luser_return:
105 andw #ALLOWINT,%sr 105 andw #ALLOWINT,%sr
106 106
107 movel %sp,%d1 /* get thread_info pointer */ 107 movel %sp,%d1 /* get thread_info pointer */
108 andl #0xffffe000,%d1 108 andl #-THREAD_SIZE,%d1
109 movel %d1,%a2 109 movel %d1,%a2
110 move %a2@(TI_FLAGS),%d1 /* thread_info->flags */ 110 move %a2@(TI_FLAGS),%d1 /* thread_info->flags */
111 andl #_TIF_WORK_MASK,%d1 111 andl #_TIF_WORK_MASK,%d1
diff --git a/arch/m68knommu/platform/68360/entry.S b/arch/m68knommu/platform/68360/entry.S
index f7bc80a60e0f..8ff48adf24ab 100644
--- a/arch/m68knommu/platform/68360/entry.S
+++ b/arch/m68knommu/platform/68360/entry.S
@@ -96,7 +96,7 @@ Luser_return:
96 andw #ALLOWINT,%sr 96 andw #ALLOWINT,%sr
97 97
98 movel %sp,%d1 /* get thread_info pointer */ 98 movel %sp,%d1 /* get thread_info pointer */
99 andl #0xffffe000,%d1 99 andl #-THREAD_SIZE,%d1
100 movel %d1,%a2 100 movel %d1,%a2
101 move %a2@(TI_FLAGS),%d1 /* thread_info->flags */ 101 move %a2@(TI_FLAGS),%d1 /* thread_info->flags */
102 andl #_TIF_WORK_MASK,%d1 102 andl #_TIF_WORK_MASK,%d1
diff --git a/arch/mips/Kconfig b/arch/mips/Kconfig
index bd9de7b00c0a..d79fba0aa8bf 100644
--- a/arch/mips/Kconfig
+++ b/arch/mips/Kconfig
@@ -4,26 +4,46 @@ config MIPS
4 # Horrible source of confusion. Die, die, die ... 4 # Horrible source of confusion. Die, die, die ...
5 select EMBEDDED 5 select EMBEDDED
6 6
7config MIPS64 7mainmenu "Linux/MIPS Kernel Configuration"
8 bool "64-bit kernel"
9 help
10 Select this option if you want to build a 64-bit kernel. You should
11 only select this option if you have hardware that actually has a
12 64-bit processor and if your application will actually benefit from
13 64-bit processing, otherwise say N. You must say Y for kernels for
14 SGI IP27 (Origin 200 and 2000) and SGI IP32 (O2). If in doubt say N.
15 8
16config 64BIT 9source "init/Kconfig"
17 def_bool MIPS64
18 10
19config MIPS32 11config SYS_SUPPORTS_32BIT_KERNEL
12 bool
13config SYS_SUPPORTS_64BIT_KERNEL
14 bool
15config CPU_SUPPORTS_32BIT_KERNEL
16 bool
17config CPU_SUPPORTS_64BIT_KERNEL
20 bool 18 bool
21 depends on MIPS64 = 'n'
22 default y
23 19
24mainmenu "Linux/MIPS Kernel Configuration" 20menu "Kernel type"
25 21
26source "init/Kconfig" 22choice
23
24 prompt "Kernel code model"
25 help
26 You should only select this option if you have a workload that
27 actually benefits from 64-bit processing or if your machine has
28 large memory. You will only be presented a single option in this
29 menu if your system does not support both 32-bit and 64-bit kernels.
30
31config 32BIT
32 bool "32-bit kernel"
33 depends on CPU_SUPPORTS_32BIT_KERNEL && SYS_SUPPORTS_32BIT_KERNEL
34 select TRAD_SIGNALS
35 help
36 Select this option if you want to build a 32-bit kernel.
37
38config 64BIT
39 bool "64-bit kernel"
40 depends on CPU_SUPPORTS_64BIT_KERNEL && SYS_SUPPORTS_64BIT_KERNEL
41 help
42 Select this option if you want to build a 64-bit kernel.
43
44endchoice
45
46endmenu
27 47
28menu "Machine selection" 48menu "Machine selection"
29 49
@@ -34,6 +54,8 @@ config MACH_JAZZ
34 select GENERIC_ISA_DMA 54 select GENERIC_ISA_DMA
35 select I8259 55 select I8259
36 select ISA 56 select ISA
57 select SYS_SUPPORTS_32BIT_KERNEL
58 select SYS_SUPPORTS_64BIT_KERNEL if EXPERIMENTAL
37 help 59 help
38 This a family of machines based on the MIPS R4030 chipset which was 60 This a family of machines based on the MIPS R4030 chipset which was
39 used by several vendors to build RISC/os and Windows NT workstations. 61 used by several vendors to build RISC/os and Windows NT workstations.
@@ -71,7 +93,9 @@ config OLIVETTI_M700
71 <http://www.linux-mips.org/>. 93 <http://www.linux-mips.org/>.
72 94
73config MACH_VR41XX 95config MACH_VR41XX
74 bool "Support for NEC VR41XX-based machines" 96 bool "Support for NEC VR4100 series based machines"
97 select SYS_SUPPORTS_32BIT_KERNEL
98 select SYS_SUPPORTS_64BIT_KERNEL if EXPERIMENTAL
75 99
76config NEC_CMBVR4133 100config NEC_CMBVR4133
77 bool "Support for NEC CMB-VR4133" 101 bool "Support for NEC CMB-VR4133"
@@ -80,7 +104,6 @@ config NEC_CMBVR4133
80 select DMA_NONCOHERENT 104 select DMA_NONCOHERENT
81 select IRQ_CPU 105 select IRQ_CPU
82 select HW_HAS_PCI 106 select HW_HAS_PCI
83 select PCI_VR41XX
84 107
85config ROCKHOPPER 108config ROCKHOPPER
86 bool "Support for Rockhopper baseboard" 109 bool "Support for Rockhopper baseboard"
@@ -91,6 +114,7 @@ config ROCKHOPPER
91config CASIO_E55 114config CASIO_E55
92 bool "Support for CASIO CASSIOPEIA E-10/15/55/65" 115 bool "Support for CASIO CASSIOPEIA E-10/15/55/65"
93 depends on MACH_VR41XX 116 depends on MACH_VR41XX
117 select CPU_LITTLE_ENDIAN
94 select DMA_NONCOHERENT 118 select DMA_NONCOHERENT
95 select IRQ_CPU 119 select IRQ_CPU
96 select ISA 120 select ISA
@@ -98,53 +122,54 @@ config CASIO_E55
98config IBM_WORKPAD 122config IBM_WORKPAD
99 bool "Support for IBM WorkPad z50" 123 bool "Support for IBM WorkPad z50"
100 depends on MACH_VR41XX 124 depends on MACH_VR41XX
125 select CPU_LITTLE_ENDIAN
101 select DMA_NONCOHERENT 126 select DMA_NONCOHERENT
102 select IRQ_CPU 127 select IRQ_CPU
103 select ISA 128 select ISA
104 129
105config TANBAC_TB0226 130config TANBAC_TB022X
106 bool "Support for TANBAC TB0226 (Mbase)" 131 bool "Support for TANBAC VR4131 multichip module and TANBAC VR4131DIMM"
107 depends on MACH_VR41XX 132 depends on MACH_VR41XX
133 select CPU_LITTLE_ENDIAN
108 select DMA_NONCOHERENT 134 select DMA_NONCOHERENT
109 select HW_HAS_PCI
110 select IRQ_CPU 135 select IRQ_CPU
136 select HW_HAS_PCI
111 help 137 help
112 The TANBAC TB0226 (Mbase) is a MIPS-based platform manufactured by TANBAC. 138 The TANBAC VR4131 multichip module(TB0225) and
113 Please refer to <http://www.tanbac.co.jp/> about Mbase. 139 the TANBAC VR4131DIMM(TB0229) are MIPS-based platforms
140 manufactured by TANBAC.
141 Please refer to <http://www.tanbac.co.jp/>
142 about VR4131 multichip module and VR4131DIMM.
114 143
115config TANBAC_TB0229 144config TANBAC_TB0226
116 bool "Support for TANBAC TB0229 (VR4131DIMM)" 145 bool "Support for TANBAC Mbase(TB0226)"
117 depends on MACH_VR41XX 146 depends on TANBAC_TB022X
118 select DMA_NONCOHERENT 147 select GPIO_VR41XX
119 select HW_HAS_PCI
120 select IRQ_CPU
121 help 148 help
122 The TANBAC TB0229 (VR4131DIMM) is a MIPS-based platform manufactured by TANBAC. 149 The TANBAC Mbase(TB0226) is a MIPS-based platform manufactured by TANBAC.
123 Please refer to <http://www.tanbac.co.jp/> about VR4131DIMM. 150 Please refer to <http://www.tanbac.co.jp/> about Mbase.
124 151
125config VICTOR_MPC30X 152config VICTOR_MPC30X
126 bool "Support for Victor MP-C303/304" 153 bool "Support for Victor MP-C303/304"
154 depends on MACH_VR41XX
155 select CPU_LITTLE_ENDIAN
127 select DMA_NONCOHERENT 156 select DMA_NONCOHERENT
128 select HW_HAS_PCI
129 select IRQ_CPU 157 select IRQ_CPU
130 depends on MACH_VR41XX 158 select HW_HAS_PCI
131 159
132config ZAO_CAPCELLA 160config ZAO_CAPCELLA
133 bool "Support for ZAO Networks Capcella" 161 bool "Support for ZAO Networks Capcella"
134 depends on MACH_VR41XX 162 depends on MACH_VR41XX
163 select CPU_LITTLE_ENDIAN
135 select DMA_NONCOHERENT 164 select DMA_NONCOHERENT
136 select HW_HAS_PCI
137 select IRQ_CPU 165 select IRQ_CPU
166 select HW_HAS_PCI
138 167
139config PCI_VR41XX 168config PCI_VR41XX
140 bool "Add PCI control unit support of NEC VR4100 series" 169 bool "Add PCI control unit support of NEC VR4100 series"
141 depends on MACH_VR41XX && PCI 170 depends on MACH_VR41XX && HW_HAS_PCI
142 171 default y
143config VRC4171 172 select PCI
144 tristate "Add NEC VRC4171 companion chip support"
145 depends on MACH_VR41XX && ISA
146 ---help---
147 The NEC VRC4171/4171A is a companion chip for NEC VR4111/VR4121.
148 173
149config VRC4173 174config VRC4173
150 tristate "Add NEC VRC4173 companion chip support" 175 tristate "Add NEC VRC4173 companion chip support"
@@ -154,25 +179,28 @@ config VRC4173
154 179
155config TOSHIBA_JMR3927 180config TOSHIBA_JMR3927
156 bool "Support for Toshiba JMR-TX3927 board" 181 bool "Support for Toshiba JMR-TX3927 board"
157 depends on MIPS32
158 select DMA_NONCOHERENT 182 select DMA_NONCOHERENT
159 select HW_HAS_PCI 183 select HW_HAS_PCI
160 select SWAP_IO_SPACE 184 select SWAP_IO_SPACE
185 select SYS_SUPPORTS_32BIT_KERNEL
161 186
162config MIPS_COBALT 187config MIPS_COBALT
163 bool "Support for Cobalt Server (EXPERIMENTAL)" 188 bool "Support for Cobalt Server"
164 depends on EXPERIMENTAL 189 depends on EXPERIMENTAL
165 select DMA_NONCOHERENT 190 select DMA_NONCOHERENT
166 select HW_HAS_PCI 191 select HW_HAS_PCI
167 select I8259 192 select I8259
168 select IRQ_CPU 193 select IRQ_CPU
194 select SYS_SUPPORTS_32BIT_KERNEL
195 select SYS_SUPPORTS_64BIT_KERNEL if EXPERIMENTAL
169 196
170config MACH_DECSTATION 197config MACH_DECSTATION
171 bool "Support for DECstations" 198 bool "Support for DECstations"
172 select BOOT_ELF32 199 select BOOT_ELF32
173 select DMA_NONCOHERENT 200 select DMA_NONCOHERENT
174 select IRQ_CPU 201 select IRQ_CPU
175 depends on MIPS32 || EXPERIMENTAL 202 select SYS_SUPPORTS_32BIT_KERNEL
203 select SYS_SUPPORTS_64BIT_KERNEL if EXPERIMENTAL
176 ---help--- 204 ---help---
177 This enables support for DEC's MIPS based workstations. For details 205 This enables support for DEC's MIPS based workstations. For details
178 see the Linux/MIPS FAQ on <http://www.linux-mips.org/> and the 206 see the Linux/MIPS FAQ on <http://www.linux-mips.org/> and the
@@ -194,6 +222,8 @@ config MIPS_EV64120
194 select DMA_NONCOHERENT 222 select DMA_NONCOHERENT
195 select HW_HAS_PCI 223 select HW_HAS_PCI
196 select MIPS_GT64120 224 select MIPS_GT64120
225 select SYS_SUPPORTS_32BIT_KERNEL
226 select SYS_SUPPORTS_64BIT_KERNEL
197 help 227 help
198 This is an evaluation board based on the Galileo GT-64120 228 This is an evaluation board based on the Galileo GT-64120
199 single-chip system controller that contains a MIPS R5000 compatible 229 single-chip system controller that contains a MIPS R5000 compatible
@@ -214,6 +244,8 @@ config MIPS_EV96100
214 select MIPS_GT96100 244 select MIPS_GT96100
215 select RM7000_CPU_SCACHE 245 select RM7000_CPU_SCACHE
216 select SWAP_IO_SPACE 246 select SWAP_IO_SPACE
247 select SYS_SUPPORTS_32BIT_KERNEL
248 select SYS_SUPPORTS_64BIT_KERNEL
217 help 249 help
218 This is an evaluation board based on the Galileo GT-96100 LAN/WAN 250 This is an evaluation board based on the Galileo GT-96100 LAN/WAN
219 communications controllers containing a MIPS R5000 compatible core 251 communications controllers containing a MIPS R5000 compatible core
@@ -224,6 +256,8 @@ config MIPS_IVR
224 bool "Support for Globespan IVR board" 256 bool "Support for Globespan IVR board"
225 select DMA_NONCOHERENT 257 select DMA_NONCOHERENT
226 select HW_HAS_PCI 258 select HW_HAS_PCI
259 select SYS_SUPPORTS_32BIT_KERNEL
260 select SYS_SUPPORTS_64BIT_KERNEL if EXPERIMENTAL
227 help 261 help
228 This is an evaluation board built by Globespan to showcase thir 262 This is an evaluation board built by Globespan to showcase thir
229 iVR (Internet Video Recorder) design. It utilizes a QED RM5231 263 iVR (Internet Video Recorder) design. It utilizes a QED RM5231
@@ -237,6 +271,8 @@ config LASAT
237 select HW_HAS_PCI 271 select HW_HAS_PCI
238 select MIPS_GT64120 272 select MIPS_GT64120
239 select R5000_CPU_SCACHE 273 select R5000_CPU_SCACHE
274 select SYS_SUPPORTS_32BIT_KERNEL
275 select SYS_SUPPORTS_64BIT_KERNEL if EXPERIMENTAL
240 276
241config PICVUE 277config PICVUE
242 tristate "PICVUE LCD display driver" 278 tristate "PICVUE LCD display driver"
@@ -258,6 +294,8 @@ config MIPS_ITE8172
258 bool "Support for ITE 8172G board" 294 bool "Support for ITE 8172G board"
259 select DMA_NONCOHERENT 295 select DMA_NONCOHERENT
260 select HW_HAS_PCI 296 select HW_HAS_PCI
297 select SYS_SUPPORTS_32BIT_KERNEL
298 select SYS_SUPPORTS_64BIT_KERNEL if EXPERIMENTAL
261 help 299 help
262 Ths is an evaluation board made by ITE <http://www.ite.com.tw/> 300 Ths is an evaluation board made by ITE <http://www.ite.com.tw/>
263 with ATX form factor that utilizes a MIPS R5000 to work with its 301 with ATX form factor that utilizes a MIPS R5000 to work with its
@@ -281,6 +319,8 @@ config MIPS_ATLAS
281 select HW_HAS_PCI 319 select HW_HAS_PCI
282 select MIPS_GT64120 320 select MIPS_GT64120
283 select SWAP_IO_SPACE 321 select SWAP_IO_SPACE
322 select SYS_SUPPORTS_32BIT_KERNEL
323 select SYS_SUPPORTS_64BIT_KERNEL
284 help 324 help
285 This enables support for the QED R5231-based MIPS Atlas evaluation 325 This enables support for the QED R5231-based MIPS Atlas evaluation
286 board. 326 board.
@@ -295,6 +335,8 @@ config MIPS_MALTA
295 select I8259 335 select I8259
296 select MIPS_GT64120 336 select MIPS_GT64120
297 select SWAP_IO_SPACE 337 select SWAP_IO_SPACE
338 select SYS_SUPPORTS_32BIT_KERNEL
339 select SYS_SUPPORTS_64BIT_KERNEL
298 help 340 help
299 This enables support for the VR5000-based MIPS Malta evaluation 341 This enables support for the VR5000-based MIPS Malta evaluation
300 board. 342 board.
@@ -304,6 +346,8 @@ config MIPS_SEAD
304 depends on EXPERIMENTAL 346 depends on EXPERIMENTAL
305 select IRQ_CPU 347 select IRQ_CPU
306 select DMA_NONCOHERENT 348 select DMA_NONCOHERENT
349 select SYS_SUPPORTS_32BIT_KERNEL
350 select SYS_SUPPORTS_64BIT_KERNEL
307 351
308config MOMENCO_OCELOT 352config MOMENCO_OCELOT
309 bool "Support for Momentum Ocelot board" 353 bool "Support for Momentum Ocelot board"
@@ -314,6 +358,8 @@ config MOMENCO_OCELOT
314 select MIPS_GT64120 358 select MIPS_GT64120
315 select RM7000_CPU_SCACHE 359 select RM7000_CPU_SCACHE
316 select SWAP_IO_SPACE 360 select SWAP_IO_SPACE
361 select SYS_SUPPORTS_32BIT_KERNEL
362 select SYS_SUPPORTS_64BIT_KERNEL
317 help 363 help
318 The Ocelot is a MIPS-based Single Board Computer (SBC) made by 364 The Ocelot is a MIPS-based Single Board Computer (SBC) made by
319 Momentum Computer <http://www.momenco.com/>. 365 Momentum Computer <http://www.momenco.com/>.
@@ -327,6 +373,8 @@ config MOMENCO_OCELOT_G
327 select PCI_MARVELL 373 select PCI_MARVELL
328 select RM7000_CPU_SCACHE 374 select RM7000_CPU_SCACHE
329 select SWAP_IO_SPACE 375 select SWAP_IO_SPACE
376 select SYS_SUPPORTS_32BIT_KERNEL
377 select SYS_SUPPORTS_64BIT_KERNEL
330 help 378 help
331 The Ocelot is a MIPS-based Single Board Computer (SBC) made by 379 The Ocelot is a MIPS-based Single Board Computer (SBC) made by
332 Momentum Computer <http://www.momenco.com/>. 380 Momentum Computer <http://www.momenco.com/>.
@@ -340,6 +388,8 @@ config MOMENCO_OCELOT_C
340 select PCI_MARVELL 388 select PCI_MARVELL
341 select RM7000_CPU_SCACHE 389 select RM7000_CPU_SCACHE
342 select SWAP_IO_SPACE 390 select SWAP_IO_SPACE
391 select SYS_SUPPORTS_32BIT_KERNEL
392 select SYS_SUPPORTS_64BIT_KERNEL
343 help 393 help
344 The Ocelot is a MIPS-based Single Board Computer (SBC) made by 394 The Ocelot is a MIPS-based Single Board Computer (SBC) made by
345 Momentum Computer <http://www.momenco.com/>. 395 Momentum Computer <http://www.momenco.com/>.
@@ -355,6 +405,8 @@ config MOMENCO_OCELOT_3
355 select PCI_MARVELL 405 select PCI_MARVELL
356 select RM7000_CPU_SCACHE 406 select RM7000_CPU_SCACHE
357 select SWAP_IO_SPACE 407 select SWAP_IO_SPACE
408 select SYS_SUPPORTS_32BIT_KERNEL
409 select SYS_SUPPORTS_64BIT_KERNEL
358 help 410 help
359 The Ocelot-3 is based off Discovery III System Controller and 411 The Ocelot-3 is based off Discovery III System Controller and
360 PMC-Sierra Rm79000 core. 412 PMC-Sierra Rm79000 core.
@@ -371,6 +423,8 @@ config MOMENCO_JAGUAR_ATX
371 select PCI_MARVELL 423 select PCI_MARVELL
372 select RM7000_CPU_SCACHE 424 select RM7000_CPU_SCACHE
373 select SWAP_IO_SPACE 425 select SWAP_IO_SPACE
426 select SYS_SUPPORTS_32BIT_KERNEL
427 select SYS_SUPPORTS_64BIT_KERNEL
374 help 428 help
375 The Jaguar ATX is a MIPS-based Single Board Computer (SBC) made by 429 The Jaguar ATX is a MIPS-based Single Board Computer (SBC) made by
376 Momentum Computer <http://www.momenco.com/>. 430 Momentum Computer <http://www.momenco.com/>.
@@ -390,6 +444,8 @@ config PMC_YOSEMITE
390 select IRQ_CPU_RM7K 444 select IRQ_CPU_RM7K
391 select IRQ_CPU_RM9K 445 select IRQ_CPU_RM9K
392 select SWAP_IO_SPACE 446 select SWAP_IO_SPACE
447 select SYS_SUPPORTS_32BIT_KERNEL
448 select SYS_SUPPORTS_64BIT_KERNEL
393 help 449 help
394 Yosemite is an evaluation board for the RM9000x2 processor 450 Yosemite is an evaluation board for the RM9000x2 processor
395 manufactured by PMC-Sierra 451 manufactured by PMC-Sierra
@@ -407,6 +463,8 @@ config DDB5074
407 select IRQ_CPU 463 select IRQ_CPU
408 select I8259 464 select I8259
409 select ISA 465 select ISA
466 select SYS_SUPPORTS_32BIT_KERNEL
467 select SYS_SUPPORTS_64BIT_KERNEL
410 help 468 help
411 This enables support for the VR5000-based NEC DDB Vrc-5074 469 This enables support for the VR5000-based NEC DDB Vrc-5074
412 evaluation board. 470 evaluation board.
@@ -419,6 +477,8 @@ config DDB5476
419 select IRQ_CPU 477 select IRQ_CPU
420 select I8259 478 select I8259
421 select ISA 479 select ISA
480 select SYS_SUPPORTS_32BIT_KERNEL
481 select SYS_SUPPORTS_64BIT_KERNEL if EXPERIMENTAL
422 help 482 help
423 This enables support for the R5432-based NEC DDB Vrc-5476 483 This enables support for the R5432-based NEC DDB Vrc-5476
424 evaluation board. 484 evaluation board.
@@ -433,6 +493,8 @@ config DDB5477
433 select HW_HAS_PCI 493 select HW_HAS_PCI
434 select I8259 494 select I8259
435 select IRQ_CPU 495 select IRQ_CPU
496 select SYS_SUPPORTS_32BIT_KERNEL
497 select SYS_SUPPORTS_64BIT_KERNEL if EXPERIMENTAL
436 help 498 help
437 This enables support for the R5432-based NEC DDB Vrc-5477, 499 This enables support for the R5432-based NEC DDB Vrc-5477,
438 or Rockhopper/SolutionGear boards with R5432/R5500 CPUs. 500 or Rockhopper/SolutionGear boards with R5432/R5500 CPUs.
@@ -445,10 +507,23 @@ config DDB5477_BUS_FREQUENCY
445 depends on DDB5477 507 depends on DDB5477
446 default 0 508 default 0
447 509
448config NEC_OSPREY 510config QEMU
449 bool "Support for NEC Osprey board" 511 bool "Support for Qemu"
450 select DMA_NONCOHERENT 512 select DMA_COHERENT
451 select IRQ_CPU 513 select GENERIC_ISA_DMA
514 select HAVE_STD_PC_SERIAL_PORT
515 select I8259
516 select ISA
517 select SWAP_IO_SPACE
518 select SYS_SUPPORTS_32BIT_KERNEL
519 select SYS_SUPPORTS_BIG_ENDIAN
520 help
521 Qemu is a software emulator which among other architectures also
522 can simulate a MIPS32 4Kc system. This patch adds support for the
523 system architecture that currently is being simulated by Qemu. It
524 will eventually be removed again when Qemu has the capability to
525 simulate actual MIPS hardware platforms. More information on Qemu
526 can be found at http://www.linux-mips.org/wiki/Qemu.
452 527
453config SGI_IP22 528config SGI_IP22
454 bool "Support for SGI IP22 (Indy/Indigo2)" 529 bool "Support for SGI IP22 (Indy/Indigo2)"
@@ -459,6 +534,8 @@ config SGI_IP22
459 select IP22_CPU_SCACHE 534 select IP22_CPU_SCACHE
460 select IRQ_CPU 535 select IRQ_CPU
461 select SWAP_IO_SPACE 536 select SWAP_IO_SPACE
537 select SYS_SUPPORTS_32BIT_KERNEL
538 select SYS_SUPPORTS_64BIT_KERNEL
462 help 539 help
463 This are the SGI Indy, Challenge S and Indigo2, as well as certain 540 This are the SGI Indy, Challenge S and Indigo2, as well as certain
464 OEM variants like the Tandem CMN B006S. To compile a Linux kernel 541 OEM variants like the Tandem CMN B006S. To compile a Linux kernel
@@ -466,12 +543,12 @@ config SGI_IP22
466 543
467config SGI_IP27 544config SGI_IP27
468 bool "Support for SGI IP27 (Origin200/2000)" 545 bool "Support for SGI IP27 (Origin200/2000)"
469 depends on MIPS64
470 select ARC 546 select ARC
471 select ARC64 547 select ARC64
472 select DMA_IP27 548 select DMA_IP27
473 select HW_HAS_PCI 549 select HW_HAS_PCI
474 select PCI_DOMAINS 550 select PCI_DOMAINS
551 select SYS_SUPPORTS_64BIT_KERNEL
475 help 552 help
476 This are the SGI Origin 200, Origin 2000 and Onyx 2 Graphics 553 This are the SGI Origin 200, Origin 2000 and Onyx 2 Graphics
477 workstations. To compile a Linux kernel that runs on these, say Y 554 workstations. To compile a Linux kernel that runs on these, say Y
@@ -534,7 +611,7 @@ config REPLICATE_EXHANDLERS
534 611
535config SGI_IP32 612config SGI_IP32
536 bool "Support for SGI IP32 (O2) (EXPERIMENTAL)" 613 bool "Support for SGI IP32 (O2) (EXPERIMENTAL)"
537 depends on MIPS64 && EXPERIMENTAL 614 depends on EXPERIMENTAL
538 select ARC 615 select ARC
539 select ARC32 616 select ARC32
540 select BOOT_ELF32 617 select BOOT_ELF32
@@ -544,12 +621,13 @@ config SGI_IP32
544 select HW_HAS_PCI 621 select HW_HAS_PCI
545 select R5000_CPU_SCACHE 622 select R5000_CPU_SCACHE
546 select RM7000_CPU_SCACHE 623 select RM7000_CPU_SCACHE
624 select SYS_SUPPORTS_64BIT_KERNEL
547 help 625 help
548 If you want this kernel to run on SGI O2 workstation, say Y here. 626 If you want this kernel to run on SGI O2 workstation, say Y here.
549 627
550config SOC_AU1X00 628config SOC_AU1X00
551 depends on MIPS32
552 bool "Support for AMD/Alchemy Au1X00 SOCs" 629 bool "Support for AMD/Alchemy Au1X00 SOCs"
630 select SYS_SUPPORTS_32BIT_KERNEL
553 631
554choice 632choice
555 prompt "Au1X00 SOC Type" 633 prompt "Au1X00 SOC Type"
@@ -661,6 +739,8 @@ config SIBYTE_SB1xxx_SOC
661 select BOOT_ELF32 739 select BOOT_ELF32
662 select DMA_COHERENT 740 select DMA_COHERENT
663 select SWAP_IO_SPACE 741 select SWAP_IO_SPACE
742 select SYS_SUPPORTS_32BIT_KERNEL
743 select SYS_SUPPORTS_64BIT_KERNEL
664 744
665choice 745choice
666 prompt "BCM1xxx SOC-based board" 746 prompt "BCM1xxx SOC-based board"
@@ -880,6 +960,8 @@ config SNI_RM200_PCI
880 select HW_HAS_PCI 960 select HW_HAS_PCI
881 select I8259 961 select I8259
882 select ISA 962 select ISA
963 select SYS_SUPPORTS_32BIT_KERNEL
964 select SYS_SUPPORTS_64BIT_KERNEL if EXPERIMENTAL
883 help 965 help
884 The SNI RM200 PCI was a MIPS-based platform manufactured by Siemens 966 The SNI RM200 PCI was a MIPS-based platform manufactured by Siemens
885 Nixdorf Informationssysteme (SNI), parent company of Pyramid 967 Nixdorf Informationssysteme (SNI), parent company of Pyramid
@@ -888,13 +970,14 @@ config SNI_RM200_PCI
888 970
889config TOSHIBA_RBTX4927 971config TOSHIBA_RBTX4927
890 bool "Support for Toshiba TBTX49[23]7 board" 972 bool "Support for Toshiba TBTX49[23]7 board"
891 depends on MIPS32
892 select DMA_NONCOHERENT 973 select DMA_NONCOHERENT
893 select HAS_TXX9_SERIAL 974 select HAS_TXX9_SERIAL
894 select HW_HAS_PCI 975 select HW_HAS_PCI
895 select I8259 976 select I8259
896 select ISA 977 select ISA
897 select SWAP_IO_SPACE 978 select SWAP_IO_SPACE
979 select SYS_SUPPORTS_32BIT_KERNEL
980 select SYS_SUPPORTS_64BIT_KERNEL
898 help 981 help
899 This Toshiba board is based on the TX4927 processor. Say Y here to 982 This Toshiba board is based on the TX4927 processor. Say Y here to
900 support this machine type 983 support this machine type
@@ -926,13 +1009,21 @@ config ARC
926 depends on SNI_RM200_PCI || SGI_IP32 || SGI_IP27 || SGI_IP22 || MIPS_MAGNUM_4000 || OLIVETTI_M700 || ACER_PICA_61 1009 depends on SNI_RM200_PCI || SGI_IP32 || SGI_IP27 || SGI_IP22 || MIPS_MAGNUM_4000 || OLIVETTI_M700 || ACER_PICA_61
927 default y 1010 default y
928 1011
929config DMA_COHERENT 1012config DMA_COHERENT
1013 bool
1014
1015config DMA_IP27
930 bool 1016 bool
931 1017
932config DMA_IP27 1018config DMA_IP32
933 bool 1019 bool
1020 select DMA_NEED_PCI_MAP_STATE
934 1021
935config DMA_NONCOHERENT 1022config DMA_NONCOHERENT
1023 bool
1024 select DMA_NEED_PCI_MAP_STATE
1025
1026config DMA_NEED_PCI_MAP_STATE
936 bool 1027 bool
937 1028
938config EARLY_PRINTK 1029config EARLY_PRINTK
@@ -974,7 +1065,7 @@ config MIPS_DISABLE_OBSOLETE_IDE
974 1065
975config CPU_LITTLE_ENDIAN 1066config CPU_LITTLE_ENDIAN
976 bool "Generate little endian code" 1067 bool "Generate little endian code"
977 default y if ACER_PICA_61 || CASIO_E55 || DDB5074 || DDB5476 || DDB5477 || MACH_DECSTATION || IBM_WORKPAD || LASAT || MIPS_COBALT || MIPS_ITE8172 || MIPS_IVR || SOC_AU1X00 || NEC_OSPREY || OLIVETTI_M700 || SNI_RM200_PCI || VICTOR_MPC30X || ZAO_CAPCELLA 1068 default y if ACER_PICA_61 || CASIO_E55 || DDB5074 || DDB5476 || DDB5477 || MACH_DECSTATION || IBM_WORKPAD || LASAT || MIPS_COBALT || MIPS_ITE8172 || MIPS_IVR || SOC_AU1X00 || OLIVETTI_M700 || SNI_RM200_PCI || VICTOR_MPC30X || ZAO_CAPCELLA
978 default n if MIPS_EV64120 || MIPS_EV96100 || MOMENCO_OCELOT || MOMENCO_OCELOT_G || SGI_IP22 || SGI_IP27 || SGI_IP32 || TOSHIBA_JMR3927 1069 default n if MIPS_EV64120 || MIPS_EV96100 || MOMENCO_OCELOT || MOMENCO_OCELOT_G || SGI_IP22 || SGI_IP27 || SGI_IP32 || TOSHIBA_JMR3927
979 help 1070 help
980 Some MIPS machines can be configured for either little or big endian 1071 Some MIPS machines can be configured for either little or big endian
@@ -1088,49 +1179,9 @@ config ARC32
1088 depends on MACH_JAZZ || SNI_RM200_PCI || SGI_IP22 || SGI_IP32 1179 depends on MACH_JAZZ || SNI_RM200_PCI || SGI_IP22 || SGI_IP32
1089 default y 1180 default y
1090 1181
1091config FB
1092 bool
1093 depends on MIPS_MAGNUM_4000 || OLIVETTI_M700
1094 default y
1095 ---help---
1096 The frame buffer device provides an abstraction for the graphics
1097 hardware. It represents the frame buffer of some video hardware and
1098 allows application software to access the graphics hardware through
1099 a well-defined interface, so the software doesn't need to know
1100 anything about the low-level (hardware register) stuff.
1101
1102 Frame buffer devices work identically across the different
1103 architectures supported by Linux and make the implementation of
1104 application programs easier and more portable; at this point, an X
1105 server exists which uses the frame buffer device exclusively.
1106 On several non-X86 architectures, the frame buffer device is the
1107 only way to use the graphics hardware.
1108
1109 The device is accessed through special device nodes, usually located
1110 in the /dev directory, i.e. /dev/fb*.
1111
1112 You need an utility program called fbset to make full use of frame
1113 buffer devices. Please read <file:Documentation/fb/framebuffer.txt>
1114 and the Framebuffer-HOWTO at <http://www.tldp.org/docs.html#howto>
1115 for more information.
1116
1117 Say Y here and to the driver for your graphics board below if you
1118 are compiling a kernel for a non-x86 architecture.
1119
1120 If you are compiling for the x86 architecture, you can say Y if you
1121 want to play with it, but it is not essential. Please note that
1122 running graphical applications that directly touch the hardware
1123 (e.g. an accelerated X server) and that are not frame buffer
1124 device-aware may cause unexpected results. If unsure, say N.
1125
1126config HAVE_STD_PC_SERIAL_PORT 1182config HAVE_STD_PC_SERIAL_PORT
1127 bool 1183 bool
1128 1184
1129config VR4181
1130 bool
1131 depends on NEC_OSPREY
1132 default y
1133
1134config ARC_CONSOLE 1185config ARC_CONSOLE
1135 bool "ARC console support" 1186 bool "ARC console support"
1136 depends on SGI_IP22 || SNI_RM200_PCI 1187 depends on SGI_IP22 || SNI_RM200_PCI
@@ -1180,13 +1231,16 @@ choice
1180 1231
1181config CPU_MIPS32 1232config CPU_MIPS32
1182 bool "MIPS32" 1233 bool "MIPS32"
1234 select CPU_SUPPORTS_32BIT_KERNEL
1183 1235
1184config CPU_MIPS64 1236config CPU_MIPS64
1185 bool "MIPS64" 1237 bool "MIPS64"
1238 select CPU_SUPPORTS_32BIT_KERNEL
1239 select CPU_SUPPORTS_64BIT_KERNEL
1186 1240
1187config CPU_R3000 1241config CPU_R3000
1188 bool "R3000" 1242 bool "R3000"
1189 depends on MIPS32 1243 select CPU_SUPPORTS_32BIT_KERNEL
1190 help 1244 help
1191 Please make sure to pick the right CPU type. Linux/MIPS is not 1245 Please make sure to pick the right CPU type. Linux/MIPS is not
1192 designed to be generic, i.e. Kernels compiled for R3000 CPUs will 1246 designed to be generic, i.e. Kernels compiled for R3000 CPUs will
@@ -1197,10 +1251,12 @@ config CPU_R3000
1197 1251
1198config CPU_TX39XX 1252config CPU_TX39XX
1199 bool "R39XX" 1253 bool "R39XX"
1200 depends on MIPS32 1254 select CPU_SUPPORTS_32BIT_KERNEL
1201 1255
1202config CPU_VR41XX 1256config CPU_VR41XX
1203 bool "R41xx" 1257 bool "R41xx"
1258 select CPU_SUPPORTS_32BIT_KERNEL
1259 select CPU_SUPPORTS_64BIT_KERNEL
1204 help 1260 help
1205 The options selects support for the NEC VR41xx series of processors. 1261 The options selects support for the NEC VR41xx series of processors.
1206 Only choose this option if you have one of these processors as a 1262 Only choose this option if you have one of these processors as a
@@ -1209,20 +1265,28 @@ config CPU_VR41XX
1209 1265
1210config CPU_R4300 1266config CPU_R4300
1211 bool "R4300" 1267 bool "R4300"
1268 select CPU_SUPPORTS_32BIT_KERNEL
1269 select CPU_SUPPORTS_64BIT_KERNEL
1212 help 1270 help
1213 MIPS Technologies R4300-series processors. 1271 MIPS Technologies R4300-series processors.
1214 1272
1215config CPU_R4X00 1273config CPU_R4X00
1216 bool "R4x00" 1274 bool "R4x00"
1275 select CPU_SUPPORTS_32BIT_KERNEL
1276 select CPU_SUPPORTS_64BIT_KERNEL
1217 help 1277 help
1218 MIPS Technologies R4000-series processors other than 4300, including 1278 MIPS Technologies R4000-series processors other than 4300, including
1219 the R4000, R4400, R4600, and 4700. 1279 the R4000, R4400, R4600, and 4700.
1220 1280
1221config CPU_TX49XX 1281config CPU_TX49XX
1222 bool "R49XX" 1282 bool "R49XX"
1283 select CPU_SUPPORTS_32BIT_KERNEL
1284 select CPU_SUPPORTS_64BIT_KERNEL
1223 1285
1224config CPU_R5000 1286config CPU_R5000
1225 bool "R5000" 1287 bool "R5000"
1288 select CPU_SUPPORTS_32BIT_KERNEL
1289 select CPU_SUPPORTS_64BIT_KERNEL
1226 help 1290 help
1227 MIPS Technologies R5000-series processors other than the Nevada. 1291 MIPS Technologies R5000-series processors other than the Nevada.
1228 1292
@@ -1231,36 +1295,48 @@ config CPU_R5432
1231 1295
1232config CPU_R6000 1296config CPU_R6000
1233 bool "R6000" 1297 bool "R6000"
1234 depends on MIPS32 && EXPERIMENTAL 1298 depends on EXPERIMENTAL
1299 select CPU_SUPPORTS_32BIT_KERNEL
1235 help 1300 help
1236 MIPS Technologies R6000 and R6000A series processors. Note these 1301 MIPS Technologies R6000 and R6000A series processors. Note these
1237 processors are extremly rare and the support for them is incomplete. 1302 processors are extremly rare and the support for them is incomplete.
1238 1303
1239config CPU_NEVADA 1304config CPU_NEVADA
1240 bool "RM52xx" 1305 bool "RM52xx"
1306 select CPU_SUPPORTS_32BIT_KERNEL
1307 select CPU_SUPPORTS_64BIT_KERNEL
1241 help 1308 help
1242 QED / PMC-Sierra RM52xx-series ("Nevada") processors. 1309 QED / PMC-Sierra RM52xx-series ("Nevada") processors.
1243 1310
1244config CPU_R8000 1311config CPU_R8000
1245 bool "R8000" 1312 bool "R8000"
1246 depends on MIPS64 && EXPERIMENTAL 1313 depends on EXPERIMENTAL
1314 select CPU_SUPPORTS_64BIT_KERNEL
1247 help 1315 help
1248 MIPS Technologies R8000 processors. Note these processors are 1316 MIPS Technologies R8000 processors. Note these processors are
1249 uncommon and the support for them is incomplete. 1317 uncommon and the support for them is incomplete.
1250 1318
1251config CPU_R10000 1319config CPU_R10000
1252 bool "R10000" 1320 bool "R10000"
1321 select CPU_SUPPORTS_32BIT_KERNEL
1322 select CPU_SUPPORTS_64BIT_KERNEL
1253 help 1323 help
1254 MIPS Technologies R10000-series processors. 1324 MIPS Technologies R10000-series processors.
1255 1325
1256config CPU_RM7000 1326config CPU_RM7000
1257 bool "RM7000" 1327 bool "RM7000"
1328 select CPU_SUPPORTS_32BIT_KERNEL
1329 select CPU_SUPPORTS_64BIT_KERNEL
1258 1330
1259config CPU_RM9000 1331config CPU_RM9000
1260 bool "RM9000" 1332 bool "RM9000"
1333 select CPU_SUPPORTS_32BIT_KERNEL
1334 select CPU_SUPPORTS_64BIT_KERNEL
1261 1335
1262config CPU_SB1 1336config CPU_SB1
1263 bool "SB1" 1337 bool "SB1"
1338 select CPU_SUPPORTS_32BIT_KERNEL
1339 select CPU_SUPPORTS_64BIT_KERNEL
1264 1340
1265endchoice 1341endchoice
1266 1342
@@ -1356,11 +1432,11 @@ config SB1_PASS_2_1_WORKAROUNDS
1356 1432
1357config 64BIT_PHYS_ADDR 1433config 64BIT_PHYS_ADDR
1358 bool "Support for 64-bit physical address space" 1434 bool "Support for 64-bit physical address space"
1359 depends on (CPU_R4X00 || CPU_R5000 || CPU_RM7000 || CPU_RM9000 || CPU_R10000 || CPU_SB1 || CPU_MIPS32 || CPU_MIPS64) && MIPS32 1435 depends on (CPU_R4X00 || CPU_R5000 || CPU_RM7000 || CPU_RM9000 || CPU_R10000 || CPU_SB1 || CPU_MIPS32 || CPU_MIPS64) && 32BIT
1360 1436
1361config CPU_ADVANCED 1437config CPU_ADVANCED
1362 bool "Override CPU Options" 1438 bool "Override CPU Options"
1363 depends on MIPS32 1439 depends on 32BIT
1364 help 1440 help
1365 Saying yes here allows you to select support for various features 1441 Saying yes here allows you to select support for various features
1366 your CPU may or may not have. Most people should say N here. 1442 your CPU may or may not have. Most people should say N here.
@@ -1414,7 +1490,7 @@ config CPU_HAS_SYNC
1414# 1490#
1415config HIGHMEM 1491config HIGHMEM
1416 bool "High Memory Support" 1492 bool "High Memory Support"
1417 depends on MIPS32 && (CPU_R3000 || CPU_SB1 || CPU_R7000 || CPU_RM9000 || CPU_R10000) && !(MACH_DECSTATION || MOMENCO_JAGUAR_ATX) 1493 depends on 32BIT && (CPU_R3000 || CPU_SB1 || CPU_R7000 || CPU_RM9000 || CPU_R10000) && !(MACH_DECSTATION || MOMENCO_JAGUAR_ATX)
1418 1494
1419config ARCH_FLATMEM_ENABLE 1495config ARCH_FLATMEM_ENABLE
1420 def_bool y 1496 def_bool y
@@ -1474,7 +1550,7 @@ config RTC_DS1742
1474 1550
1475config MIPS_INSANE_LARGE 1551config MIPS_INSANE_LARGE
1476 bool "Support for large 64-bit configurations" 1552 bool "Support for large 64-bit configurations"
1477 depends on CPU_R10000 && MIPS64 1553 depends on CPU_R10000 && 64BIT
1478 help 1554 help
1479 MIPS R10000 does support a 44 bit / 16TB address space as opposed to 1555 MIPS R10000 does support a 44 bit / 16TB address space as opposed to
1480 previous 64-bit processors which only supported 40 bit / 1TB. If you 1556 previous 64-bit processors which only supported 40 bit / 1TB. If you
@@ -1575,11 +1651,11 @@ source "fs/Kconfig.binfmt"
1575 1651
1576config TRAD_SIGNALS 1652config TRAD_SIGNALS
1577 bool 1653 bool
1578 default y if MIPS32 1654 default y if 32BIT
1579 1655
1580config BUILD_ELF64 1656config BUILD_ELF64
1581 bool "Use 64-bit ELF format for building" 1657 bool "Use 64-bit ELF format for building"
1582 depends on MIPS64 1658 depends on 64BIT
1583 help 1659 help
1584 A 64-bit kernel is usually built using the 64-bit ELF binary object 1660 A 64-bit kernel is usually built using the 64-bit ELF binary object
1585 format as it's one that allows arbitrary 64-bit constructs. For 1661 format as it's one that allows arbitrary 64-bit constructs. For
@@ -1594,11 +1670,11 @@ config BUILD_ELF64
1594 1670
1595config BINFMT_IRIX 1671config BINFMT_IRIX
1596 bool "Include IRIX binary compatibility" 1672 bool "Include IRIX binary compatibility"
1597 depends on !CPU_LITTLE_ENDIAN && MIPS32 && BROKEN 1673 depends on !CPU_LITTLE_ENDIAN && 32BIT && BROKEN
1598 1674
1599config MIPS32_COMPAT 1675config MIPS32_COMPAT
1600 bool "Kernel support for Linux/MIPS 32-bit binary compatibility" 1676 bool "Kernel support for Linux/MIPS 32-bit binary compatibility"
1601 depends on MIPS64 1677 depends on 64BIT
1602 help 1678 help
1603 Select this option if you want Linux/MIPS 32-bit binary 1679 Select this option if you want Linux/MIPS 32-bit binary
1604 compatibility. Since all software available for Linux/MIPS is 1680 compatibility. Since all software available for Linux/MIPS is
@@ -1640,6 +1716,8 @@ config PM
1640 1716
1641endmenu 1717endmenu
1642 1718
1719source "net/Kconfig"
1720
1643source "drivers/Kconfig" 1721source "drivers/Kconfig"
1644 1722
1645source "fs/Kconfig" 1723source "fs/Kconfig"
diff --git a/arch/mips/Makefile b/arch/mips/Makefile
index 26528b600b97..b0fdaee8d8d9 100644
--- a/arch/mips/Makefile
+++ b/arch/mips/Makefile
@@ -37,12 +37,12 @@ else
3764bit-emul = elf64btsmip 3764bit-emul = elf64btsmip
38endif 38endif
39 39
40ifdef CONFIG_MIPS32 40ifdef CONFIG_32BIT
41gcc-abi = 32 41gcc-abi = 32
42tool-prefix = $(32bit-tool-prefix) 42tool-prefix = $(32bit-tool-prefix)
43UTS_MACHINE := mips 43UTS_MACHINE := mips
44endif 44endif
45ifdef CONFIG_MIPS64 45ifdef CONFIG_64BIT
46gcc-abi = 64 46gcc-abi = 64
47tool-prefix = $(64bit-tool-prefix) 47tool-prefix = $(64bit-tool-prefix)
48UTS_MACHINE := mips64 48UTS_MACHINE := mips64
@@ -63,7 +63,7 @@ ld-emul = $(32bit-emul)
63vmlinux-32 = vmlinux 63vmlinux-32 = vmlinux
64vmlinux-64 = vmlinux.64 64vmlinux-64 = vmlinux.64
65 65
66cflags-$(CONFIG_MIPS64) += $(call cc-option,-mno-explicit-relocs) 66cflags-$(CONFIG_64BIT) += $(call cc-option,-mno-explicit-relocs)
67endif 67endif
68 68
69# 69#
@@ -177,7 +177,7 @@ cflags-$(CONFIG_CPU_MIPS64) += \
177 177
178cflags-$(CONFIG_CPU_R5000) += \ 178cflags-$(CONFIG_CPU_R5000) += \
179 $(call set_gccflags,r5000,mips4,r5000,mips4,mips2) \ 179 $(call set_gccflags,r5000,mips4,r5000,mips4,mips2) \
180 -Wa,--trap 180 -Wa,--trap
181 181
182cflags-$(CONFIG_CPU_R5432) += \ 182cflags-$(CONFIG_CPU_R5432) += \
183 $(call set_gccflags,r5400,mips4,r5000,mips4,mips2) \ 183 $(call set_gccflags,r5400,mips4,r5000,mips4,mips2) \
@@ -423,6 +423,12 @@ core-$(CONFIG_PMC_YOSEMITE) += arch/mips/pmc-sierra/yosemite/
423cflags-$(CONFIG_PMC_YOSEMITE) += -Iinclude/asm-mips/mach-yosemite 423cflags-$(CONFIG_PMC_YOSEMITE) += -Iinclude/asm-mips/mach-yosemite
424load-$(CONFIG_PMC_YOSEMITE) += 0xffffffff80100000 424load-$(CONFIG_PMC_YOSEMITE) += 0xffffffff80100000
425 425
426# Qemu simulating MIPS32 4Kc
427#
428core-$(CONFIG_QEMU) += arch/mips/qemu/
429cflags-$(CONFIG_QEMU) += -Iinclude/asm-mips/mach-qemu
430load-$(CONFIG_QEMU) += 0xffffffff80010000
431
426# 432#
427# Momentum Ocelot-3 433# Momentum Ocelot-3
428# 434#
@@ -469,13 +475,6 @@ cflags-$(CONFIG_LASAT) += -Iinclude/asm-mips/mach-lasat
469load-$(CONFIG_LASAT) += 0xffffffff80000000 475load-$(CONFIG_LASAT) += 0xffffffff80000000
470 476
471# 477#
472# NEC Osprey (vr4181) board
473#
474core-$(CONFIG_NEC_OSPREY) += arch/mips/vr4181/common/ \
475 arch/mips/vr4181/osprey/
476load-$(CONFIG_NEC_OSPREY) += 0xffffffff80002000
477
478#
479# Common VR41xx 478# Common VR41xx
480# 479#
481core-$(CONFIG_MACH_VR41XX) += arch/mips/vr41xx/common/ 480core-$(CONFIG_MACH_VR41XX) += arch/mips/vr41xx/common/
@@ -490,13 +489,11 @@ load-$(CONFIG_NEC_CMBVR4133) += 0xffffffff80100000
490# 489#
491# ZAO Networks Capcella (VR4131) 490# ZAO Networks Capcella (VR4131)
492# 491#
493core-$(CONFIG_ZAO_CAPCELLA) += arch/mips/vr41xx/zao-capcella/
494load-$(CONFIG_ZAO_CAPCELLA) += 0xffffffff80000000 492load-$(CONFIG_ZAO_CAPCELLA) += 0xffffffff80000000
495 493
496# 494#
497# Victor MP-C303/304 (VR4122) 495# Victor MP-C303/304 (VR4122)
498# 496#
499core-$(CONFIG_VICTOR_MPC30X) += arch/mips/vr41xx/victor-mpc30x/
500load-$(CONFIG_VICTOR_MPC30X) += 0xffffffff80001000 497load-$(CONFIG_VICTOR_MPC30X) += 0xffffffff80001000
501 498
502# 499#
@@ -512,16 +509,9 @@ core-$(CONFIG_CASIO_E55) += arch/mips/vr41xx/casio-e55/
512load-$(CONFIG_CASIO_E55) += 0xffffffff80004000 509load-$(CONFIG_CASIO_E55) += 0xffffffff80004000
513 510
514# 511#
515# TANBAC TB0226 Mbase (VR4131) 512# TANBAC VR4131 multichip module(TB0225) and TANBAC VR4131DIMM(TB0229) (VR4131)
516#
517core-$(CONFIG_TANBAC_TB0226) += arch/mips/vr41xx/tanbac-tb0226/
518load-$(CONFIG_TANBAC_TB0226) += 0xffffffff80000000
519
520#
521# TANBAC TB0229 VR4131DIMM (VR4131)
522# 513#
523core-$(CONFIG_TANBAC_TB0229) += arch/mips/vr41xx/tanbac-tb0229/ 514load-$(CONFIG_TANBAC_TB022X) += 0xffffffff80000000
524load-$(CONFIG_TANBAC_TB0229) += 0xffffffff80000000
525 515
526# 516#
527# SGI IP22 (Indy/Indigo2) 517# SGI IP22 (Indy/Indigo2)
@@ -534,10 +524,10 @@ load-$(CONFIG_TANBAC_TB0229) += 0xffffffff80000000
534# 524#
535core-$(CONFIG_SGI_IP22) += arch/mips/sgi-ip22/ 525core-$(CONFIG_SGI_IP22) += arch/mips/sgi-ip22/
536cflags-$(CONFIG_SGI_IP22) += -Iinclude/asm-mips/mach-ip22 526cflags-$(CONFIG_SGI_IP22) += -Iinclude/asm-mips/mach-ip22
537ifdef CONFIG_MIPS32 527ifdef CONFIG_32BIT
538load-$(CONFIG_SGI_IP22) += 0xffffffff88002000 528load-$(CONFIG_SGI_IP22) += 0xffffffff88002000
539endif 529endif
540ifdef CONFIG_MIPS64 530ifdef CONFIG_64BIT
541load-$(CONFIG_SGI_IP22) += 0xffffffff88004000 531load-$(CONFIG_SGI_IP22) += 0xffffffff88004000
542endif 532endif
543 533
@@ -642,7 +632,7 @@ load-$(CONFIG_TOSHIBA_RBTX4927) += 0xffffffff80020000
642cflags-y += -Iinclude/asm-mips/mach-generic 632cflags-y += -Iinclude/asm-mips/mach-generic
643drivers-$(CONFIG_PCI) += arch/mips/pci/ 633drivers-$(CONFIG_PCI) += arch/mips/pci/
644 634
645ifdef CONFIG_MIPS32 635ifdef CONFIG_32BIT
646ifdef CONFIG_CPU_LITTLE_ENDIAN 636ifdef CONFIG_CPU_LITTLE_ENDIAN
647JIFFIES = jiffies_64 637JIFFIES = jiffies_64
648else 638else
@@ -674,8 +664,8 @@ CPPFLAGS_vmlinux.lds := \
674head-y := arch/mips/kernel/head.o arch/mips/kernel/init_task.o 664head-y := arch/mips/kernel/head.o arch/mips/kernel/init_task.o
675 665
676libs-y += arch/mips/lib/ 666libs-y += arch/mips/lib/
677libs-$(CONFIG_MIPS32) += arch/mips/lib-32/ 667libs-$(CONFIG_32BIT) += arch/mips/lib-32/
678libs-$(CONFIG_MIPS64) += arch/mips/lib-64/ 668libs-$(CONFIG_64BIT) += arch/mips/lib-64/
679 669
680core-y += arch/mips/kernel/ arch/mips/mm/ arch/mips/math-emu/ 670core-y += arch/mips/kernel/ arch/mips/mm/ arch/mips/math-emu/
681 671
@@ -730,7 +720,7 @@ archclean:
730 @$(MAKE) $(clean)=arch/mips/boot 720 @$(MAKE) $(clean)=arch/mips/boot
731 @$(MAKE) $(clean)=arch/mips/lasat 721 @$(MAKE) $(clean)=arch/mips/lasat
732 722
733# Generate <asm/offset.h 723# Generate <asm/offset.h
734# 724#
735# The default rule is suffering from funny problems on MIPS so we using our 725# The default rule is suffering from funny problems on MIPS so we using our
736# own ... 726# own ...
diff --git a/arch/mips/au1000/common/pci.c b/arch/mips/au1000/common/pci.c
index 533721eef6ae..4e5a6e1a9a6e 100644
--- a/arch/mips/au1000/common/pci.c
+++ b/arch/mips/au1000/common/pci.c
@@ -40,14 +40,14 @@
40 40
41/* TBD */ 41/* TBD */
42static struct resource pci_io_resource = { 42static struct resource pci_io_resource = {
43 "pci IO space", 43 "pci IO space",
44 (u32)PCI_IO_START, 44 (u32)PCI_IO_START,
45 (u32)PCI_IO_END, 45 (u32)PCI_IO_END,
46 IORESOURCE_IO 46 IORESOURCE_IO
47}; 47};
48 48
49static struct resource pci_mem_resource = { 49static struct resource pci_mem_resource = {
50 "pci memory space", 50 "pci memory space",
51 (u32)PCI_MEM_START, 51 (u32)PCI_MEM_START,
52 (u32)PCI_MEM_END, 52 (u32)PCI_MEM_END,
53 IORESOURCE_MEM 53 IORESOURCE_MEM
@@ -68,7 +68,7 @@ static unsigned long virt_io_addr;
68static int __init au1x_pci_setup(void) 68static int __init au1x_pci_setup(void)
69{ 69{
70#if defined(CONFIG_SOC_AU1500) || defined(CONFIG_SOC_AU1550) 70#if defined(CONFIG_SOC_AU1500) || defined(CONFIG_SOC_AU1550)
71 virt_io_addr = (unsigned long)ioremap(Au1500_PCI_IO_START, 71 virt_io_addr = (unsigned long)ioremap(Au1500_PCI_IO_START,
72 Au1500_PCI_IO_END - Au1500_PCI_IO_START + 1); 72 Au1500_PCI_IO_END - Au1500_PCI_IO_START + 1);
73 73
74 if (!virt_io_addr) { 74 if (!virt_io_addr) {
@@ -77,7 +77,7 @@ static int __init au1x_pci_setup(void)
77 } 77 }
78 78
79#ifdef CONFIG_DMA_NONCOHERENT 79#ifdef CONFIG_DMA_NONCOHERENT
80 /* 80 /*
81 * Set the NC bit in controller for Au1500 pre-AC silicon 81 * Set the NC bit in controller for Au1500 pre-AC silicon
82 */ 82 */
83 u32 prid = read_c0_prid(); 83 u32 prid = read_c0_prid();
diff --git a/arch/mips/au1000/common/setup.c b/arch/mips/au1000/common/setup.c
index dbc8b1bda963..eff89e109ce6 100644
--- a/arch/mips/au1000/common/setup.c
+++ b/arch/mips/au1000/common/setup.c
@@ -97,7 +97,7 @@ static int __init au1x00_setup(void)
97 argptr = prom_getcmdline(); 97 argptr = prom_getcmdline();
98 strcat(argptr, " console=ttyS0,115200"); 98 strcat(argptr, " console=ttyS0,115200");
99 } 99 }
100#endif 100#endif
101 101
102#ifdef CONFIG_FB_AU1100 102#ifdef CONFIG_FB_AU1100
103 if ((argptr = strstr(argptr, "video=")) == NULL) { 103 if ((argptr = strstr(argptr, "video=")) == NULL) {
diff --git a/arch/mips/au1000/common/time.c b/arch/mips/au1000/common/time.c
index fe418f1620c3..57675b41480e 100644
--- a/arch/mips/au1000/common/time.c
+++ b/arch/mips/au1000/common/time.c
@@ -281,7 +281,7 @@ unsigned long cal_r4koff(void)
281 cpu_speed = count * 2; 281 cpu_speed = count * 2;
282 } 282 }
283#else 283#else
284 cpu_speed = (au_readl(SYS_CPUPLL) & 0x0000003f) * 284 cpu_speed = (au_readl(SYS_CPUPLL) & 0x0000003f) *
285 AU1000_SRC_CLK; 285 AU1000_SRC_CLK;
286 count = cpu_speed / 2; 286 count = cpu_speed / 2;
287#endif 287#endif
@@ -356,7 +356,7 @@ static unsigned long do_fast_cp0_gettimeoffset(void)
356 : "hi", "lo", GCC_REG_ACCUM); 356 : "hi", "lo", GCC_REG_ACCUM);
357 357
358 /* 358 /*
359 * Due to possible jiffies inconsistencies, we need to check 359 * Due to possible jiffies inconsistencies, we need to check
360 * the result so that we'll get a timer that is monotonic. 360 * the result so that we'll get a timer that is monotonic.
361 */ 361 */
362 if (res >= USECS_PER_JIFFY) 362 if (res >= USECS_PER_JIFFY)
@@ -375,8 +375,8 @@ static unsigned long do_fast_pm_gettimeoffset(void)
375 au_sync(); 375 au_sync();
376 offset = pc0 - last_pc0; 376 offset = pc0 - last_pc0;
377 if (offset > 2*MATCH20_INC) { 377 if (offset > 2*MATCH20_INC) {
378 printk("huge offset %x, last_pc0 %x last_match20 %x pc0 %x\n", 378 printk("huge offset %x, last_pc0 %x last_match20 %x pc0 %x\n",
379 (unsigned)offset, (unsigned)last_pc0, 379 (unsigned)offset, (unsigned)last_pc0,
380 (unsigned)last_match20, (unsigned)pc0); 380 (unsigned)last_match20, (unsigned)pc0);
381 } 381 }
382 offset = (unsigned long)((offset * 305) / 10); 382 offset = (unsigned long)((offset * 305) / 10);
@@ -394,11 +394,11 @@ void au1xxx_timer_setup(struct irqaction *irq)
394 r4k_offset = cal_r4koff(); 394 r4k_offset = cal_r4koff();
395 printk("%08lx(%d)\n", r4k_offset, (int) r4k_offset); 395 printk("%08lx(%d)\n", r4k_offset, (int) r4k_offset);
396 396
397 //est_freq = 2*r4k_offset*HZ; 397 //est_freq = 2*r4k_offset*HZ;
398 est_freq = r4k_offset*HZ; 398 est_freq = r4k_offset*HZ;
399 est_freq += 5000; /* round */ 399 est_freq += 5000; /* round */
400 est_freq -= est_freq%10000; 400 est_freq -= est_freq%10000;
401 printk("CPU frequency %d.%02d MHz\n", est_freq/1000000, 401 printk("CPU frequency %d.%02d MHz\n", est_freq/1000000,
402 (est_freq%1000000)*100/1000000); 402 (est_freq%1000000)*100/1000000);
403 set_au1x00_speed(est_freq); 403 set_au1x00_speed(est_freq);
404 set_au1x00_lcd_clock(); // program the LCD clock 404 set_au1x00_lcd_clock(); // program the LCD clock
diff --git a/arch/mips/au1000/csb250/board_setup.c b/arch/mips/au1000/csb250/board_setup.c
index 90426eaffb23..1c55c5f59d75 100644
--- a/arch/mips/au1000/csb250/board_setup.c
+++ b/arch/mips/au1000/csb250/board_setup.c
@@ -182,7 +182,7 @@ void __init board_setup(void)
182 au_writel(0xf0000000, Au1500_PCI_MWMASK_DEV); 182 au_writel(0xf0000000, Au1500_PCI_MWMASK_DEV);
183 au_writel(0, Au1500_PCI_MWBASE_REV_CCL); 183 au_writel(0, Au1500_PCI_MWBASE_REV_CCL);
184 au_writel(0x02a00356, Au1500_PCI_STATCMD); 184 au_writel(0x02a00356, Au1500_PCI_STATCMD);
185 au_writel(0x00003c04, Au1500_PCI_HDRTYPE); 185 au_writel(0x00003c04, Au1500_PCI_HDRTYPE);
186 au_writel(0x00000008, Au1500_PCI_MBAR); 186 au_writel(0x00000008, Au1500_PCI_MBAR);
187 au_sync(); 187 au_sync();
188 188
@@ -216,7 +216,7 @@ csb250_pci_idsel(unsigned int devsel, int assert)
216 unsigned int gpio2_pins; 216 unsigned int gpio2_pins;
217 217
218 retval = 1; 218 retval = 1;
219 219
220 /* First, disable both selects, then assert the one requested. 220 /* First, disable both selects, then assert the one requested.
221 */ 221 */
222 au_writel(0xc000c000, GPIO2_OUTPUT); 222 au_writel(0xc000c000, GPIO2_OUTPUT);
diff --git a/arch/mips/au1000/csb250/init.c b/arch/mips/au1000/csb250/init.c
index 4320057fc439..bd99733abc0b 100644
--- a/arch/mips/au1000/csb250/init.c
+++ b/arch/mips/au1000/csb250/init.c
@@ -81,7 +81,7 @@ int __init prom_init(int argc, char **argv, char **envp, int *prom_vec)
81 csb_env[0] = env1; 81 csb_env[0] = env1;
82 82
83 mips_machgroup = MACH_GROUP_ALCHEMY; 83 mips_machgroup = MACH_GROUP_ALCHEMY;
84 mips_machtype = MACH_CSB250; 84 mips_machtype = MACH_CSB250;
85 85
86 prom_init_cmdline(); 86 prom_init_cmdline();
87 memsize_str = prom_getenv("memsize"); 87 memsize_str = prom_getenv("memsize");
diff --git a/arch/mips/au1000/db1x00/init.c b/arch/mips/au1000/db1x00/init.c
index 51eee94a5e82..4b9d5e46edbb 100644
--- a/arch/mips/au1000/db1x00/init.c
+++ b/arch/mips/au1000/db1x00/init.c
@@ -61,7 +61,7 @@ void __init prom_init(void)
61 prom_envp = (char **) fw_arg2; 61 prom_envp = (char **) fw_arg2;
62 62
63 mips_machgroup = MACH_GROUP_ALCHEMY; 63 mips_machgroup = MACH_GROUP_ALCHEMY;
64 mips_machtype = MACH_DB1000; /* set the platform # */ 64 mips_machtype = MACH_DB1000; /* set the platform # */
65 65
66 prom_init_cmdline(); 66 prom_init_cmdline();
67 67
diff --git a/arch/mips/au1000/hydrogen3/init.c b/arch/mips/au1000/hydrogen3/init.c
index eee4adf98711..8cc9879dd582 100644
--- a/arch/mips/au1000/hydrogen3/init.c
+++ b/arch/mips/au1000/hydrogen3/init.c
@@ -63,7 +63,7 @@ int __init prom_init(int argc, char **argv, char **envp, int *prom_vec)
63 prom_envp = envp; 63 prom_envp = envp;
64 64
65 mips_machgroup = MACH_GROUP_ALCHEMY; 65 mips_machgroup = MACH_GROUP_ALCHEMY;
66 mips_machtype = MACH_DB1000; /* set the platform # */ 66 mips_machtype = MACH_DB1000; /* set the platform # */
67 prom_init_cmdline(); 67 prom_init_cmdline();
68 68
69 memsize_str = prom_getenv("memsize"); 69 memsize_str = prom_getenv("memsize");
diff --git a/arch/mips/au1000/pb1000/board_setup.c b/arch/mips/au1000/pb1000/board_setup.c
index 2fa211b69329..0b4807dc9f44 100644
--- a/arch/mips/au1000/pb1000/board_setup.c
+++ b/arch/mips/au1000/pb1000/board_setup.c
@@ -174,7 +174,7 @@ void __init board_setup(void)
174 case 0x02: /* HB */ 174 case 0x02: /* HB */
175 break; 175 break;
176 default: /* HC and newer */ 176 default: /* HC and newer */
177 /* Enable sys bus clock divider when IDLE state or no bus 177 /* Enable sys bus clock divider when IDLE state or no bus
178 activity. */ 178 activity. */
179 au_writel(au_readl(SYS_POWERCTRL) | (0x3 << 5), SYS_POWERCTRL); 179 au_writel(au_readl(SYS_POWERCTRL) | (0x3 << 5), SYS_POWERCTRL);
180 break; 180 break;
diff --git a/arch/mips/au1000/xxs1500/board_setup.c b/arch/mips/au1000/xxs1500/board_setup.c
index 9dadc82536f4..1e59433dfd66 100644
--- a/arch/mips/au1000/xxs1500/board_setup.c
+++ b/arch/mips/au1000/xxs1500/board_setup.c
@@ -49,7 +49,7 @@ void board_reset (void)
49void __init board_setup(void) 49void __init board_setup(void)
50{ 50{
51 u32 pin_func; 51 u32 pin_func;
52 52
53 // set multiple use pins (UART3/GPIO) to UART (it's used as UART too) 53 // set multiple use pins (UART3/GPIO) to UART (it's used as UART too)
54 pin_func = au_readl(SYS_PINFUNC) & (u32)(~SYS_PF_UR3); 54 pin_func = au_readl(SYS_PINFUNC) & (u32)(~SYS_PF_UR3);
55 pin_func |= SYS_PF_UR3; 55 pin_func |= SYS_PF_UR3;
@@ -75,11 +75,11 @@ void __init board_setup(void)
75 au_writel(1, GPIO2_ENABLE); 75 au_writel(1, GPIO2_ENABLE);
76 /* gpio2 208/9/10/11 are inputs */ 76 /* gpio2 208/9/10/11 are inputs */
77 au_writel((1<<8) | (1<<9) | (1<<10) | (1<<11), GPIO2_DIR); 77 au_writel((1<<8) | (1<<9) | (1<<10) | (1<<11), GPIO2_DIR);
78 78
79 /* turn off power */ 79 /* turn off power */
80 au_writel((au_readl(GPIO2_PINSTATE) & ~(1<<14))|(1<<30), GPIO2_OUTPUT); 80 au_writel((au_readl(GPIO2_PINSTATE) & ~(1<<14))|(1<<30), GPIO2_OUTPUT);
81#endif 81#endif
82 82
83 83
84#ifdef CONFIG_PCI 84#ifdef CONFIG_PCI
85#if defined(__MIPSEB__) 85#if defined(__MIPSEB__)
diff --git a/arch/mips/au1000/xxs1500/init.c b/arch/mips/au1000/xxs1500/init.c
index 03f755291b51..f1c76533b6fc 100644
--- a/arch/mips/au1000/xxs1500/init.c
+++ b/arch/mips/au1000/xxs1500/init.c
@@ -55,7 +55,7 @@ void __init prom_init(void)
55 prom_envp = (char **) fw_arg2; 55 prom_envp = (char **) fw_arg2;
56 56
57 mips_machgroup = MACH_GROUP_ALCHEMY; 57 mips_machgroup = MACH_GROUP_ALCHEMY;
58 mips_machtype = MACH_XXS1500; /* set the platform # */ 58 mips_machtype = MACH_XXS1500; /* set the platform # */
59 59
60 prom_init_cmdline(); 60 prom_init_cmdline();
61 61
diff --git a/arch/mips/au1000/xxs1500/irqmap.c b/arch/mips/au1000/xxs1500/irqmap.c
index 954800a0ab52..52f2f7daeb05 100644
--- a/arch/mips/au1000/xxs1500/irqmap.c
+++ b/arch/mips/au1000/xxs1500/irqmap.c
@@ -56,7 +56,7 @@ au1xxx_irq_map_t au1xxx_irq_map[] = {
56 { AU1500_GPIO_207, INTC_INT_LOW_LEVEL, 0 }, 56 { AU1500_GPIO_207, INTC_INT_LOW_LEVEL, 0 },
57 57
58 { AU1000_GPIO_0, INTC_INT_LOW_LEVEL, 0 }, 58 { AU1000_GPIO_0, INTC_INT_LOW_LEVEL, 0 },
59 { AU1000_GPIO_1, INTC_INT_LOW_LEVEL, 0 }, 59 { AU1000_GPIO_1, INTC_INT_LOW_LEVEL, 0 },
60 { AU1000_GPIO_2, INTC_INT_LOW_LEVEL, 0 }, 60 { AU1000_GPIO_2, INTC_INT_LOW_LEVEL, 0 },
61 { AU1000_GPIO_3, INTC_INT_LOW_LEVEL, 0 }, 61 { AU1000_GPIO_3, INTC_INT_LOW_LEVEL, 0 },
62 { AU1000_GPIO_4, INTC_INT_LOW_LEVEL, 0 }, /* CF interrupt */ 62 { AU1000_GPIO_4, INTC_INT_LOW_LEVEL, 0 }, /* CF interrupt */
diff --git a/arch/mips/configs/atlas_defconfig b/arch/mips/configs/atlas_defconfig
index caad7ca27abd..3120a02b8670 100644
--- a/arch/mips/configs/atlas_defconfig
+++ b/arch/mips/configs/atlas_defconfig
@@ -4,9 +4,9 @@
4# Wed Jan 26 02:49:00 2005 4# Wed Jan 26 02:49:00 2005
5# 5#
6CONFIG_MIPS=y 6CONFIG_MIPS=y
7# CONFIG_MIPS64 is not set
8# CONFIG_64BIT is not set 7# CONFIG_64BIT is not set
9CONFIG_MIPS32=y 8# CONFIG_64BIT is not set
9CONFIG_32BIT=y
10 10
11# 11#
12# Code maturity level options 12# Code maturity level options
@@ -88,6 +88,7 @@ CONFIG_RWSEM_GENERIC_SPINLOCK=y
88CONFIG_GENERIC_CALIBRATE_DELAY=y 88CONFIG_GENERIC_CALIBRATE_DELAY=y
89CONFIG_HAVE_DEC_LOCK=y 89CONFIG_HAVE_DEC_LOCK=y
90CONFIG_DMA_NONCOHERENT=y 90CONFIG_DMA_NONCOHERENT=y
91CONFIG_DMA_NEED_PCI_MAP_STATE=y
91CONFIG_MIPS_BONITO64=y 92CONFIG_MIPS_BONITO64=y
92CONFIG_MIPS_MSC=y 93CONFIG_MIPS_MSC=y
93# CONFIG_CPU_LITTLE_ENDIAN is not set 94# CONFIG_CPU_LITTLE_ENDIAN is not set
diff --git a/arch/mips/configs/capcella_defconfig b/arch/mips/configs/capcella_defconfig
index 1b7f8a702d06..158e7165f4e3 100644
--- a/arch/mips/configs/capcella_defconfig
+++ b/arch/mips/configs/capcella_defconfig
@@ -4,9 +4,9 @@
4# Wed Jan 26 02:49:00 2005 4# Wed Jan 26 02:49:00 2005
5# 5#
6CONFIG_MIPS=y 6CONFIG_MIPS=y
7# CONFIG_MIPS64 is not set
8# CONFIG_64BIT is not set 7# CONFIG_64BIT is not set
9CONFIG_MIPS32=y 8# CONFIG_64BIT is not set
9CONFIG_32BIT=y
10 10
11# 11#
12# Code maturity level options 12# Code maturity level options
@@ -97,6 +97,7 @@ CONFIG_RWSEM_GENERIC_SPINLOCK=y
97CONFIG_GENERIC_CALIBRATE_DELAY=y 97CONFIG_GENERIC_CALIBRATE_DELAY=y
98CONFIG_HAVE_DEC_LOCK=y 98CONFIG_HAVE_DEC_LOCK=y
99CONFIG_DMA_NONCOHERENT=y 99CONFIG_DMA_NONCOHERENT=y
100CONFIG_DMA_NEED_PCI_MAP_STATE=y
100CONFIG_CPU_LITTLE_ENDIAN=y 101CONFIG_CPU_LITTLE_ENDIAN=y
101CONFIG_IRQ_CPU=y 102CONFIG_IRQ_CPU=y
102CONFIG_MIPS_L1_CACHE_SHIFT=5 103CONFIG_MIPS_L1_CACHE_SHIFT=5
diff --git a/arch/mips/configs/cobalt_defconfig b/arch/mips/configs/cobalt_defconfig
index 8861854561e5..4302c6f914f5 100644
--- a/arch/mips/configs/cobalt_defconfig
+++ b/arch/mips/configs/cobalt_defconfig
@@ -4,9 +4,9 @@
4# Wed Jan 26 02:49:00 2005 4# Wed Jan 26 02:49:00 2005
5# 5#
6CONFIG_MIPS=y 6CONFIG_MIPS=y
7# CONFIG_MIPS64 is not set
8# CONFIG_64BIT is not set 7# CONFIG_64BIT is not set
9CONFIG_MIPS32=y 8# CONFIG_64BIT is not set
9CONFIG_32BIT=y
10 10
11# 11#
12# Code maturity level options 12# Code maturity level options
@@ -82,6 +82,7 @@ CONFIG_RWSEM_GENERIC_SPINLOCK=y
82CONFIG_GENERIC_CALIBRATE_DELAY=y 82CONFIG_GENERIC_CALIBRATE_DELAY=y
83CONFIG_HAVE_DEC_LOCK=y 83CONFIG_HAVE_DEC_LOCK=y
84CONFIG_DMA_NONCOHERENT=y 84CONFIG_DMA_NONCOHERENT=y
85CONFIG_DMA_NEED_PCI_MAP_STATE=y
85CONFIG_I8259=y 86CONFIG_I8259=y
86CONFIG_CPU_LITTLE_ENDIAN=y 87CONFIG_CPU_LITTLE_ENDIAN=y
87CONFIG_IRQ_CPU=y 88CONFIG_IRQ_CPU=y
diff --git a/arch/mips/configs/db1000_defconfig b/arch/mips/configs/db1000_defconfig
index 19cac1bf4f01..962fc14b58c2 100644
--- a/arch/mips/configs/db1000_defconfig
+++ b/arch/mips/configs/db1000_defconfig
@@ -4,9 +4,9 @@
4# Wed Jan 26 02:49:01 2005 4# Wed Jan 26 02:49:01 2005
5# 5#
6CONFIG_MIPS=y 6CONFIG_MIPS=y
7# CONFIG_MIPS64 is not set
8# CONFIG_64BIT is not set 7# CONFIG_64BIT is not set
9CONFIG_MIPS32=y 8# CONFIG_64BIT is not set
9CONFIG_32BIT=y
10 10
11# 11#
12# Code maturity level options 12# Code maturity level options
@@ -104,6 +104,7 @@ CONFIG_RWSEM_GENERIC_SPINLOCK=y
104CONFIG_GENERIC_CALIBRATE_DELAY=y 104CONFIG_GENERIC_CALIBRATE_DELAY=y
105CONFIG_HAVE_DEC_LOCK=y 105CONFIG_HAVE_DEC_LOCK=y
106CONFIG_DMA_NONCOHERENT=y 106CONFIG_DMA_NONCOHERENT=y
107CONFIG_DMA_NEED_PCI_MAP_STATE=y
107CONFIG_CPU_LITTLE_ENDIAN=y 108CONFIG_CPU_LITTLE_ENDIAN=y
108CONFIG_MIPS_L1_CACHE_SHIFT=5 109CONFIG_MIPS_L1_CACHE_SHIFT=5
109 110
diff --git a/arch/mips/configs/db1100_defconfig b/arch/mips/configs/db1100_defconfig
index 035ac95d197e..6a528d479d70 100644
--- a/arch/mips/configs/db1100_defconfig
+++ b/arch/mips/configs/db1100_defconfig
@@ -4,9 +4,9 @@
4# Wed Jan 26 02:49:01 2005 4# Wed Jan 26 02:49:01 2005
5# 5#
6CONFIG_MIPS=y 6CONFIG_MIPS=y
7# CONFIG_MIPS64 is not set
8# CONFIG_64BIT is not set 7# CONFIG_64BIT is not set
9CONFIG_MIPS32=y 8# CONFIG_64BIT is not set
9CONFIG_32BIT=y
10 10
11# 11#
12# Code maturity level options 12# Code maturity level options
@@ -104,6 +104,7 @@ CONFIG_RWSEM_GENERIC_SPINLOCK=y
104CONFIG_GENERIC_CALIBRATE_DELAY=y 104CONFIG_GENERIC_CALIBRATE_DELAY=y
105CONFIG_HAVE_DEC_LOCK=y 105CONFIG_HAVE_DEC_LOCK=y
106CONFIG_DMA_NONCOHERENT=y 106CONFIG_DMA_NONCOHERENT=y
107CONFIG_DMA_NEED_PCI_MAP_STATE=y
107CONFIG_CPU_LITTLE_ENDIAN=y 108CONFIG_CPU_LITTLE_ENDIAN=y
108CONFIG_MIPS_L1_CACHE_SHIFT=5 109CONFIG_MIPS_L1_CACHE_SHIFT=5
109 110
diff --git a/arch/mips/configs/db1500_defconfig b/arch/mips/configs/db1500_defconfig
index c38c4ed18fe7..fed6f2fab48b 100644
--- a/arch/mips/configs/db1500_defconfig
+++ b/arch/mips/configs/db1500_defconfig
@@ -4,9 +4,9 @@
4# Wed Jan 26 02:49:01 2005 4# Wed Jan 26 02:49:01 2005
5# 5#
6CONFIG_MIPS=y 6CONFIG_MIPS=y
7# CONFIG_MIPS64 is not set
8# CONFIG_64BIT is not set 7# CONFIG_64BIT is not set
9CONFIG_MIPS32=y 8# CONFIG_64BIT is not set
9CONFIG_32BIT=y
10 10
11# 11#
12# Code maturity level options 12# Code maturity level options
diff --git a/arch/mips/configs/db1550_defconfig b/arch/mips/configs/db1550_defconfig
index ee81309ae3a5..178c0ad1af75 100644
--- a/arch/mips/configs/db1550_defconfig
+++ b/arch/mips/configs/db1550_defconfig
@@ -4,9 +4,9 @@
4# Wed Jan 26 02:49:02 2005 4# Wed Jan 26 02:49:02 2005
5# 5#
6CONFIG_MIPS=y 6CONFIG_MIPS=y
7# CONFIG_MIPS64 is not set
8# CONFIG_64BIT is not set 7# CONFIG_64BIT is not set
9CONFIG_MIPS32=y 8# CONFIG_64BIT is not set
9CONFIG_32BIT=y
10 10
11# 11#
12# Code maturity level options 12# Code maturity level options
diff --git a/arch/mips/configs/ddb5476_defconfig b/arch/mips/configs/ddb5476_defconfig
index d43ed57c4b4e..70addc73f699 100644
--- a/arch/mips/configs/ddb5476_defconfig
+++ b/arch/mips/configs/ddb5476_defconfig
@@ -4,9 +4,9 @@
4# Wed Jan 26 02:49:02 2005 4# Wed Jan 26 02:49:02 2005
5# 5#
6CONFIG_MIPS=y 6CONFIG_MIPS=y
7# CONFIG_MIPS64 is not set
8# CONFIG_64BIT is not set 7# CONFIG_64BIT is not set
9CONFIG_MIPS32=y 8# CONFIG_64BIT is not set
9CONFIG_32BIT=y
10 10
11# 11#
12# Code maturity level options 12# Code maturity level options
@@ -82,6 +82,7 @@ CONFIG_RWSEM_GENERIC_SPINLOCK=y
82CONFIG_GENERIC_CALIBRATE_DELAY=y 82CONFIG_GENERIC_CALIBRATE_DELAY=y
83CONFIG_HAVE_DEC_LOCK=y 83CONFIG_HAVE_DEC_LOCK=y
84CONFIG_DMA_NONCOHERENT=y 84CONFIG_DMA_NONCOHERENT=y
85CONFIG_DMA_NEED_PCI_MAP_STATE=y
85CONFIG_I8259=y 86CONFIG_I8259=y
86CONFIG_CPU_LITTLE_ENDIAN=y 87CONFIG_CPU_LITTLE_ENDIAN=y
87CONFIG_IRQ_CPU=y 88CONFIG_IRQ_CPU=y
diff --git a/arch/mips/configs/ddb5477_defconfig b/arch/mips/configs/ddb5477_defconfig
index 5a032cdefd63..60292808b384 100644
--- a/arch/mips/configs/ddb5477_defconfig
+++ b/arch/mips/configs/ddb5477_defconfig
@@ -4,9 +4,9 @@
4# Wed Jan 26 02:49:02 2005 4# Wed Jan 26 02:49:02 2005
5# 5#
6CONFIG_MIPS=y 6CONFIG_MIPS=y
7# CONFIG_MIPS64 is not set
8# CONFIG_64BIT is not set 7# CONFIG_64BIT is not set
9CONFIG_MIPS32=y 8# CONFIG_64BIT is not set
9CONFIG_32BIT=y
10 10
11# 11#
12# Code maturity level options 12# Code maturity level options
@@ -83,6 +83,7 @@ CONFIG_RWSEM_GENERIC_SPINLOCK=y
83CONFIG_GENERIC_CALIBRATE_DELAY=y 83CONFIG_GENERIC_CALIBRATE_DELAY=y
84CONFIG_HAVE_DEC_LOCK=y 84CONFIG_HAVE_DEC_LOCK=y
85CONFIG_DMA_NONCOHERENT=y 85CONFIG_DMA_NONCOHERENT=y
86CONFIG_DMA_NEED_PCI_MAP_STATE=y
86CONFIG_I8259=y 87CONFIG_I8259=y
87CONFIG_CPU_LITTLE_ENDIAN=y 88CONFIG_CPU_LITTLE_ENDIAN=y
88CONFIG_IRQ_CPU=y 89CONFIG_IRQ_CPU=y
diff --git a/arch/mips/configs/decstation_defconfig b/arch/mips/configs/decstation_defconfig
index 32ada79da9d8..66ec1f41d122 100644
--- a/arch/mips/configs/decstation_defconfig
+++ b/arch/mips/configs/decstation_defconfig
@@ -4,9 +4,9 @@
4# Wed Jan 26 02:49:03 2005 4# Wed Jan 26 02:49:03 2005
5# 5#
6CONFIG_MIPS=y 6CONFIG_MIPS=y
7# CONFIG_MIPS64 is not set
8# CONFIG_64BIT is not set 7# CONFIG_64BIT is not set
9CONFIG_MIPS32=y 8# CONFIG_64BIT is not set
9CONFIG_32BIT=y
10 10
11# 11#
12# Code maturity level options 12# Code maturity level options
@@ -88,6 +88,7 @@ CONFIG_RWSEM_GENERIC_SPINLOCK=y
88CONFIG_GENERIC_CALIBRATE_DELAY=y 88CONFIG_GENERIC_CALIBRATE_DELAY=y
89CONFIG_HAVE_DEC_LOCK=y 89CONFIG_HAVE_DEC_LOCK=y
90CONFIG_DMA_NONCOHERENT=y 90CONFIG_DMA_NONCOHERENT=y
91CONFIG_DMA_NEED_PCI_MAP_STATE=y
91CONFIG_EARLY_PRINTK=y 92CONFIG_EARLY_PRINTK=y
92CONFIG_CPU_LITTLE_ENDIAN=y 93CONFIG_CPU_LITTLE_ENDIAN=y
93CONFIG_IRQ_CPU=y 94CONFIG_IRQ_CPU=y
diff --git a/arch/mips/configs/e55_defconfig b/arch/mips/configs/e55_defconfig
index 52074a2085fb..ba2ec01defb1 100644
--- a/arch/mips/configs/e55_defconfig
+++ b/arch/mips/configs/e55_defconfig
@@ -4,9 +4,9 @@
4# Wed Jan 26 02:49:03 2005 4# Wed Jan 26 02:49:03 2005
5# 5#
6CONFIG_MIPS=y 6CONFIG_MIPS=y
7# CONFIG_MIPS64 is not set
8# CONFIG_64BIT is not set 7# CONFIG_64BIT is not set
9CONFIG_MIPS32=y 8# CONFIG_64BIT is not set
9CONFIG_32BIT=y
10 10
11# 11#
12# Code maturity level options 12# Code maturity level options
@@ -96,6 +96,7 @@ CONFIG_RWSEM_GENERIC_SPINLOCK=y
96CONFIG_GENERIC_CALIBRATE_DELAY=y 96CONFIG_GENERIC_CALIBRATE_DELAY=y
97CONFIG_HAVE_DEC_LOCK=y 97CONFIG_HAVE_DEC_LOCK=y
98CONFIG_DMA_NONCOHERENT=y 98CONFIG_DMA_NONCOHERENT=y
99CONFIG_DMA_NEED_PCI_MAP_STATE=y
99CONFIG_CPU_LITTLE_ENDIAN=y 100CONFIG_CPU_LITTLE_ENDIAN=y
100CONFIG_IRQ_CPU=y 101CONFIG_IRQ_CPU=y
101CONFIG_MIPS_L1_CACHE_SHIFT=5 102CONFIG_MIPS_L1_CACHE_SHIFT=5
diff --git a/arch/mips/configs/ev64120_defconfig b/arch/mips/configs/ev64120_defconfig
index 360e842fd4be..17e87f70f602 100644
--- a/arch/mips/configs/ev64120_defconfig
+++ b/arch/mips/configs/ev64120_defconfig
@@ -4,9 +4,9 @@
4# Wed Jan 26 02:49:03 2005 4# Wed Jan 26 02:49:03 2005
5# 5#
6CONFIG_MIPS=y 6CONFIG_MIPS=y
7# CONFIG_MIPS64 is not set
8# CONFIG_64BIT is not set 7# CONFIG_64BIT is not set
9CONFIG_MIPS32=y 8# CONFIG_64BIT is not set
9CONFIG_32BIT=y
10 10
11# 11#
12# Code maturity level options 12# Code maturity level options
@@ -89,6 +89,7 @@ CONFIG_RWSEM_GENERIC_SPINLOCK=y
89CONFIG_GENERIC_CALIBRATE_DELAY=y 89CONFIG_GENERIC_CALIBRATE_DELAY=y
90CONFIG_HAVE_DEC_LOCK=y 90CONFIG_HAVE_DEC_LOCK=y
91CONFIG_DMA_NONCOHERENT=y 91CONFIG_DMA_NONCOHERENT=y
92CONFIG_DMA_NEED_PCI_MAP_STATE=y
92# CONFIG_CPU_LITTLE_ENDIAN is not set 93# CONFIG_CPU_LITTLE_ENDIAN is not set
93CONFIG_MIPS_GT64120=y 94CONFIG_MIPS_GT64120=y
94# CONFIG_SYSCLK_75 is not set 95# CONFIG_SYSCLK_75 is not set
diff --git a/arch/mips/configs/ev96100_defconfig b/arch/mips/configs/ev96100_defconfig
index 657a9508d31a..9da4140eae00 100644
--- a/arch/mips/configs/ev96100_defconfig
+++ b/arch/mips/configs/ev96100_defconfig
@@ -4,9 +4,9 @@
4# Wed Jan 26 02:49:03 2005 4# Wed Jan 26 02:49:03 2005
5# 5#
6CONFIG_MIPS=y 6CONFIG_MIPS=y
7# CONFIG_MIPS64 is not set
8# CONFIG_64BIT is not set 7# CONFIG_64BIT is not set
9CONFIG_MIPS32=y 8# CONFIG_64BIT is not set
9CONFIG_32BIT=y
10 10
11# 11#
12# Code maturity level options 12# Code maturity level options
@@ -88,6 +88,7 @@ CONFIG_RWSEM_GENERIC_SPINLOCK=y
88CONFIG_GENERIC_CALIBRATE_DELAY=y 88CONFIG_GENERIC_CALIBRATE_DELAY=y
89CONFIG_HAVE_DEC_LOCK=y 89CONFIG_HAVE_DEC_LOCK=y
90CONFIG_DMA_NONCOHERENT=y 90CONFIG_DMA_NONCOHERENT=y
91CONFIG_DMA_NEED_PCI_MAP_STATE=y
91# CONFIG_CPU_LITTLE_ENDIAN is not set 92# CONFIG_CPU_LITTLE_ENDIAN is not set
92CONFIG_IRQ_CPU=y 93CONFIG_IRQ_CPU=y
93CONFIG_MIPS_GT64120=y 94CONFIG_MIPS_GT64120=y
diff --git a/arch/mips/configs/ip22_defconfig b/arch/mips/configs/ip22_defconfig
index 3fb102e6a7f7..17fa5c4e3ad1 100644
--- a/arch/mips/configs/ip22_defconfig
+++ b/arch/mips/configs/ip22_defconfig
@@ -4,9 +4,9 @@
4# Wed Jan 26 02:49:04 2005 4# Wed Jan 26 02:49:04 2005
5# 5#
6CONFIG_MIPS=y 6CONFIG_MIPS=y
7# CONFIG_MIPS64 is not set
8# CONFIG_64BIT is not set 7# CONFIG_64BIT is not set
9CONFIG_MIPS32=y 8# CONFIG_64BIT is not set
9CONFIG_32BIT=y
10 10
11# 11#
12# Code maturity level options 12# Code maturity level options
@@ -90,6 +90,7 @@ CONFIG_GENERIC_CALIBRATE_DELAY=y
90CONFIG_HAVE_DEC_LOCK=y 90CONFIG_HAVE_DEC_LOCK=y
91CONFIG_ARC=y 91CONFIG_ARC=y
92CONFIG_DMA_NONCOHERENT=y 92CONFIG_DMA_NONCOHERENT=y
93CONFIG_DMA_NEED_PCI_MAP_STATE=y
93# CONFIG_CPU_LITTLE_ENDIAN is not set 94# CONFIG_CPU_LITTLE_ENDIAN is not set
94CONFIG_IRQ_CPU=y 95CONFIG_IRQ_CPU=y
95CONFIG_SWAP_IO_SPACE=y 96CONFIG_SWAP_IO_SPACE=y
diff --git a/arch/mips/configs/ip27_defconfig b/arch/mips/configs/ip27_defconfig
index b5bab3a42fc4..b2a67da1e031 100644
--- a/arch/mips/configs/ip27_defconfig
+++ b/arch/mips/configs/ip27_defconfig
@@ -4,7 +4,7 @@
4# Wed Jan 26 02:49:04 2005 4# Wed Jan 26 02:49:04 2005
5# 5#
6CONFIG_MIPS=y 6CONFIG_MIPS=y
7CONFIG_MIPS64=y 7CONFIG_64BIT=y
8CONFIG_64BIT=y 8CONFIG_64BIT=y
9 9
10# 10#
diff --git a/arch/mips/configs/ip32_defconfig b/arch/mips/configs/ip32_defconfig
index bdf1415475ff..b26e1173365d 100644
--- a/arch/mips/configs/ip32_defconfig
+++ b/arch/mips/configs/ip32_defconfig
@@ -4,7 +4,7 @@
4# Wed Jan 26 02:49:04 2005 4# Wed Jan 26 02:49:04 2005
5# 5#
6CONFIG_MIPS=y 6CONFIG_MIPS=y
7CONFIG_MIPS64=y 7CONFIG_64BIT=y
8CONFIG_64BIT=y 8CONFIG_64BIT=y
9 9
10# 10#
@@ -84,6 +84,7 @@ CONFIG_ARC=y
84CONFIG_DMA_IP32=y 84CONFIG_DMA_IP32=y
85CONFIG_OWN_DMA=y 85CONFIG_OWN_DMA=y
86CONFIG_DMA_NONCOHERENT=y 86CONFIG_DMA_NONCOHERENT=y
87CONFIG_DMA_NEED_PCI_MAP_STATE=y
87# CONFIG_CPU_LITTLE_ENDIAN is not set 88# CONFIG_CPU_LITTLE_ENDIAN is not set
88CONFIG_ARC32=y 89CONFIG_ARC32=y
89CONFIG_BOOT_ELF32=y 90CONFIG_BOOT_ELF32=y
diff --git a/arch/mips/configs/it8172_defconfig b/arch/mips/configs/it8172_defconfig
index 1ca7746388f0..08bd3ad64761 100644
--- a/arch/mips/configs/it8172_defconfig
+++ b/arch/mips/configs/it8172_defconfig
@@ -4,9 +4,9 @@
4# Wed Jan 26 02:49:05 2005 4# Wed Jan 26 02:49:05 2005
5# 5#
6CONFIG_MIPS=y 6CONFIG_MIPS=y
7# CONFIG_MIPS64 is not set
8# CONFIG_64BIT is not set 7# CONFIG_64BIT is not set
9CONFIG_MIPS32=y 8# CONFIG_64BIT is not set
9CONFIG_32BIT=y
10 10
11# 11#
12# Code maturity level options 12# Code maturity level options
@@ -90,6 +90,7 @@ CONFIG_RWSEM_GENERIC_SPINLOCK=y
90CONFIG_GENERIC_CALIBRATE_DELAY=y 90CONFIG_GENERIC_CALIBRATE_DELAY=y
91CONFIG_HAVE_DEC_LOCK=y 91CONFIG_HAVE_DEC_LOCK=y
92CONFIG_DMA_NONCOHERENT=y 92CONFIG_DMA_NONCOHERENT=y
93CONFIG_DMA_NEED_PCI_MAP_STATE=y
93CONFIG_CPU_LITTLE_ENDIAN=y 94CONFIG_CPU_LITTLE_ENDIAN=y
94CONFIG_ITE_BOARD_GEN=y 95CONFIG_ITE_BOARD_GEN=y
95CONFIG_IT8172_CIR=y 96CONFIG_IT8172_CIR=y
diff --git a/arch/mips/configs/ivr_defconfig b/arch/mips/configs/ivr_defconfig
index c6eef708be1e..583ef5c5b1cd 100644
--- a/arch/mips/configs/ivr_defconfig
+++ b/arch/mips/configs/ivr_defconfig
@@ -4,9 +4,9 @@
4# Wed Jan 26 02:49:05 2005 4# Wed Jan 26 02:49:05 2005
5# 5#
6CONFIG_MIPS=y 6CONFIG_MIPS=y
7# CONFIG_MIPS64 is not set
8# CONFIG_64BIT is not set 7# CONFIG_64BIT is not set
9CONFIG_MIPS32=y 8# CONFIG_64BIT is not set
9CONFIG_32BIT=y
10 10
11# 11#
12# Code maturity level options 12# Code maturity level options
@@ -89,6 +89,7 @@ CONFIG_RWSEM_GENERIC_SPINLOCK=y
89CONFIG_GENERIC_CALIBRATE_DELAY=y 89CONFIG_GENERIC_CALIBRATE_DELAY=y
90CONFIG_HAVE_DEC_LOCK=y 90CONFIG_HAVE_DEC_LOCK=y
91CONFIG_DMA_NONCOHERENT=y 91CONFIG_DMA_NONCOHERENT=y
92CONFIG_DMA_NEED_PCI_MAP_STATE=y
92CONFIG_CPU_LITTLE_ENDIAN=y 93CONFIG_CPU_LITTLE_ENDIAN=y
93CONFIG_ITE_BOARD_GEN=y 94CONFIG_ITE_BOARD_GEN=y
94CONFIG_IT8172_CIR=y 95CONFIG_IT8172_CIR=y
diff --git a/arch/mips/configs/jaguar-atx_defconfig b/arch/mips/configs/jaguar-atx_defconfig
index 757c4e88cc00..8abb5a0c6c12 100644
--- a/arch/mips/configs/jaguar-atx_defconfig
+++ b/arch/mips/configs/jaguar-atx_defconfig
@@ -4,9 +4,9 @@
4# Wed Jan 26 02:49:05 2005 4# Wed Jan 26 02:49:05 2005
5# 5#
6CONFIG_MIPS=y 6CONFIG_MIPS=y
7# CONFIG_MIPS64 is not set
8# CONFIG_64BIT is not set 7# CONFIG_64BIT is not set
9CONFIG_MIPS32=y 8# CONFIG_64BIT is not set
9CONFIG_32BIT=y
10 10
11# 11#
12# Code maturity level options 12# Code maturity level options
@@ -81,6 +81,7 @@ CONFIG_RWSEM_GENERIC_SPINLOCK=y
81CONFIG_GENERIC_CALIBRATE_DELAY=y 81CONFIG_GENERIC_CALIBRATE_DELAY=y
82CONFIG_HAVE_DEC_LOCK=y 82CONFIG_HAVE_DEC_LOCK=y
83CONFIG_DMA_NONCOHERENT=y 83CONFIG_DMA_NONCOHERENT=y
84CONFIG_DMA_NEED_PCI_MAP_STATE=y
84CONFIG_LIMITED_DMA=y 85CONFIG_LIMITED_DMA=y
85# CONFIG_CPU_LITTLE_ENDIAN is not set 86# CONFIG_CPU_LITTLE_ENDIAN is not set
86CONFIG_IRQ_CPU=y 87CONFIG_IRQ_CPU=y
diff --git a/arch/mips/configs/jmr3927_defconfig b/arch/mips/configs/jmr3927_defconfig
index e5a613906554..da5d9ee2ecce 100644
--- a/arch/mips/configs/jmr3927_defconfig
+++ b/arch/mips/configs/jmr3927_defconfig
@@ -4,9 +4,9 @@
4# Wed Jan 26 02:49:06 2005 4# Wed Jan 26 02:49:06 2005
5# 5#
6CONFIG_MIPS=y 6CONFIG_MIPS=y
7# CONFIG_MIPS64 is not set
8# CONFIG_64BIT is not set 7# CONFIG_64BIT is not set
9CONFIG_MIPS32=y 8# CONFIG_64BIT is not set
9CONFIG_32BIT=y
10 10
11# 11#
12# Code maturity level options 12# Code maturity level options
@@ -82,6 +82,7 @@ CONFIG_RWSEM_GENERIC_SPINLOCK=y
82CONFIG_GENERIC_CALIBRATE_DELAY=y 82CONFIG_GENERIC_CALIBRATE_DELAY=y
83CONFIG_HAVE_DEC_LOCK=y 83CONFIG_HAVE_DEC_LOCK=y
84CONFIG_DMA_NONCOHERENT=y 84CONFIG_DMA_NONCOHERENT=y
85CONFIG_DMA_NEED_PCI_MAP_STATE=y
85# CONFIG_CPU_LITTLE_ENDIAN is not set 86# CONFIG_CPU_LITTLE_ENDIAN is not set
86CONFIG_MIPS_TX3927=y 87CONFIG_MIPS_TX3927=y
87CONFIG_SWAP_IO_SPACE=y 88CONFIG_SWAP_IO_SPACE=y
diff --git a/arch/mips/configs/lasat200_defconfig b/arch/mips/configs/lasat200_defconfig
index 1e7697834e90..8d600ae890f4 100644
--- a/arch/mips/configs/lasat200_defconfig
+++ b/arch/mips/configs/lasat200_defconfig
@@ -4,9 +4,9 @@
4# Wed Jan 26 02:49:06 2005 4# Wed Jan 26 02:49:06 2005
5# 5#
6CONFIG_MIPS=y 6CONFIG_MIPS=y
7# CONFIG_MIPS64 is not set
8# CONFIG_64BIT is not set 7# CONFIG_64BIT is not set
9CONFIG_MIPS32=y 8# CONFIG_64BIT is not set
9CONFIG_32BIT=y
10 10
11# 11#
12# Code maturity level options 12# Code maturity level options
@@ -92,6 +92,7 @@ CONFIG_RWSEM_GENERIC_SPINLOCK=y
92CONFIG_GENERIC_CALIBRATE_DELAY=y 92CONFIG_GENERIC_CALIBRATE_DELAY=y
93CONFIG_HAVE_DEC_LOCK=y 93CONFIG_HAVE_DEC_LOCK=y
94CONFIG_DMA_NONCOHERENT=y 94CONFIG_DMA_NONCOHERENT=y
95CONFIG_DMA_NEED_PCI_MAP_STATE=y
95CONFIG_MIPS_NILE4=y 96CONFIG_MIPS_NILE4=y
96CONFIG_CPU_LITTLE_ENDIAN=y 97CONFIG_CPU_LITTLE_ENDIAN=y
97CONFIG_MIPS_GT64120=y 98CONFIG_MIPS_GT64120=y
diff --git a/arch/mips/configs/malta_defconfig b/arch/mips/configs/malta_defconfig
index 61fb9fb97e6e..79519ac5af4a 100644
--- a/arch/mips/configs/malta_defconfig
+++ b/arch/mips/configs/malta_defconfig
@@ -4,9 +4,9 @@
4# Wed Jan 26 02:53:14 2005 4# Wed Jan 26 02:53:14 2005
5# 5#
6CONFIG_MIPS=y 6CONFIG_MIPS=y
7# CONFIG_MIPS64 is not set
8# CONFIG_64BIT is not set 7# CONFIG_64BIT is not set
9CONFIG_MIPS32=y 8# CONFIG_64BIT is not set
9CONFIG_32BIT=y
10 10
11# 11#
12# Code maturity level options 12# Code maturity level options
@@ -88,6 +88,7 @@ CONFIG_RWSEM_GENERIC_SPINLOCK=y
88CONFIG_GENERIC_CALIBRATE_DELAY=y 88CONFIG_GENERIC_CALIBRATE_DELAY=y
89CONFIG_HAVE_DEC_LOCK=y 89CONFIG_HAVE_DEC_LOCK=y
90CONFIG_DMA_NONCOHERENT=y 90CONFIG_DMA_NONCOHERENT=y
91CONFIG_DMA_NEED_PCI_MAP_STATE=y
91CONFIG_GENERIC_ISA_DMA=y 92CONFIG_GENERIC_ISA_DMA=y
92CONFIG_I8259=y 93CONFIG_I8259=y
93CONFIG_MIPS_BONITO64=y 94CONFIG_MIPS_BONITO64=y
diff --git a/arch/mips/configs/mpc30x_defconfig b/arch/mips/configs/mpc30x_defconfig
index 31b8f2ad7338..0fea57ef18f2 100644
--- a/arch/mips/configs/mpc30x_defconfig
+++ b/arch/mips/configs/mpc30x_defconfig
@@ -4,9 +4,9 @@
4# Wed Jan 26 02:49:07 2005 4# Wed Jan 26 02:49:07 2005
5# 5#
6CONFIG_MIPS=y 6CONFIG_MIPS=y
7# CONFIG_MIPS64 is not set
8# CONFIG_64BIT is not set 7# CONFIG_64BIT is not set
9CONFIG_MIPS32=y 8# CONFIG_64BIT is not set
9CONFIG_32BIT=y
10 10
11# 11#
12# Code maturity level options 12# Code maturity level options
@@ -97,6 +97,7 @@ CONFIG_RWSEM_GENERIC_SPINLOCK=y
97CONFIG_GENERIC_CALIBRATE_DELAY=y 97CONFIG_GENERIC_CALIBRATE_DELAY=y
98CONFIG_HAVE_DEC_LOCK=y 98CONFIG_HAVE_DEC_LOCK=y
99CONFIG_DMA_NONCOHERENT=y 99CONFIG_DMA_NONCOHERENT=y
100CONFIG_DMA_NEED_PCI_MAP_STATE=y
100CONFIG_CPU_LITTLE_ENDIAN=y 101CONFIG_CPU_LITTLE_ENDIAN=y
101CONFIG_IRQ_CPU=y 102CONFIG_IRQ_CPU=y
102CONFIG_MIPS_L1_CACHE_SHIFT=5 103CONFIG_MIPS_L1_CACHE_SHIFT=5
diff --git a/arch/mips/configs/ocelot_3_defconfig b/arch/mips/configs/ocelot_3_defconfig
index 2cce682fffcf..b4cf97a732bc 100644
--- a/arch/mips/configs/ocelot_3_defconfig
+++ b/arch/mips/configs/ocelot_3_defconfig
@@ -4,9 +4,9 @@
4# Wed Jan 26 02:49:07 2005 4# Wed Jan 26 02:49:07 2005
5# 5#
6CONFIG_MIPS=y 6CONFIG_MIPS=y
7# CONFIG_MIPS64 is not set
8# CONFIG_64BIT is not set 7# CONFIG_64BIT is not set
9CONFIG_MIPS32=y 8# CONFIG_64BIT is not set
9CONFIG_32BIT=y
10 10
11# 11#
12# Code maturity level options 12# Code maturity level options
@@ -89,6 +89,7 @@ CONFIG_RWSEM_GENERIC_SPINLOCK=y
89CONFIG_GENERIC_CALIBRATE_DELAY=y 89CONFIG_GENERIC_CALIBRATE_DELAY=y
90CONFIG_HAVE_DEC_LOCK=y 90CONFIG_HAVE_DEC_LOCK=y
91CONFIG_DMA_NONCOHERENT=y 91CONFIG_DMA_NONCOHERENT=y
92CONFIG_DMA_NEED_PCI_MAP_STATE=y
92# CONFIG_CPU_LITTLE_ENDIAN is not set 93# CONFIG_CPU_LITTLE_ENDIAN is not set
93CONFIG_IRQ_CPU=y 94CONFIG_IRQ_CPU=y
94CONFIG_IRQ_CPU_RM7K=y 95CONFIG_IRQ_CPU_RM7K=y
diff --git a/arch/mips/configs/ocelot_c_defconfig b/arch/mips/configs/ocelot_c_defconfig
index 0cbf48a62e02..a38903db85a0 100644
--- a/arch/mips/configs/ocelot_c_defconfig
+++ b/arch/mips/configs/ocelot_c_defconfig
@@ -4,7 +4,7 @@
4# Wed Jan 26 02:49:07 2005 4# Wed Jan 26 02:49:07 2005
5# 5#
6CONFIG_MIPS=y 6CONFIG_MIPS=y
7CONFIG_MIPS64=y 7CONFIG_64BIT=y
8CONFIG_64BIT=y 8CONFIG_64BIT=y
9 9
10# 10#
@@ -80,6 +80,7 @@ CONFIG_RWSEM_GENERIC_SPINLOCK=y
80CONFIG_GENERIC_CALIBRATE_DELAY=y 80CONFIG_GENERIC_CALIBRATE_DELAY=y
81CONFIG_HAVE_DEC_LOCK=y 81CONFIG_HAVE_DEC_LOCK=y
82CONFIG_DMA_NONCOHERENT=y 82CONFIG_DMA_NONCOHERENT=y
83CONFIG_DMA_NEED_PCI_MAP_STATE=y
83# CONFIG_CPU_LITTLE_ENDIAN is not set 84# CONFIG_CPU_LITTLE_ENDIAN is not set
84CONFIG_IRQ_CPU=y 85CONFIG_IRQ_CPU=y
85CONFIG_IRQ_MV64340=y 86CONFIG_IRQ_MV64340=y
diff --git a/arch/mips/configs/ocelot_defconfig b/arch/mips/configs/ocelot_defconfig
index 4043950d360a..920d59b56a4e 100644
--- a/arch/mips/configs/ocelot_defconfig
+++ b/arch/mips/configs/ocelot_defconfig
@@ -4,9 +4,9 @@
4# Wed Jan 26 02:49:08 2005 4# Wed Jan 26 02:49:08 2005
5# 5#
6CONFIG_MIPS=y 6CONFIG_MIPS=y
7# CONFIG_MIPS64 is not set
8# CONFIG_64BIT is not set 7# CONFIG_64BIT is not set
9CONFIG_MIPS32=y 8# CONFIG_64BIT is not set
9CONFIG_32BIT=y
10 10
11# 11#
12# Code maturity level options 12# Code maturity level options
@@ -82,6 +82,7 @@ CONFIG_RWSEM_GENERIC_SPINLOCK=y
82CONFIG_GENERIC_CALIBRATE_DELAY=y 82CONFIG_GENERIC_CALIBRATE_DELAY=y
83CONFIG_HAVE_DEC_LOCK=y 83CONFIG_HAVE_DEC_LOCK=y
84CONFIG_DMA_NONCOHERENT=y 84CONFIG_DMA_NONCOHERENT=y
85CONFIG_DMA_NEED_PCI_MAP_STATE=y
85# CONFIG_CPU_LITTLE_ENDIAN is not set 86# CONFIG_CPU_LITTLE_ENDIAN is not set
86CONFIG_IRQ_CPU=y 87CONFIG_IRQ_CPU=y
87CONFIG_IRQ_CPU_RM7K=y 88CONFIG_IRQ_CPU_RM7K=y
diff --git a/arch/mips/configs/ocelot_g_defconfig b/arch/mips/configs/ocelot_g_defconfig
index 3870af4537ad..ef5ea50893d1 100644
--- a/arch/mips/configs/ocelot_g_defconfig
+++ b/arch/mips/configs/ocelot_g_defconfig
@@ -4,7 +4,7 @@
4# Wed Jan 26 02:49:08 2005 4# Wed Jan 26 02:49:08 2005
5# 5#
6CONFIG_MIPS=y 6CONFIG_MIPS=y
7CONFIG_MIPS64=y 7CONFIG_64BIT=y
8CONFIG_64BIT=y 8CONFIG_64BIT=y
9 9
10# 10#
@@ -80,6 +80,7 @@ CONFIG_RWSEM_GENERIC_SPINLOCK=y
80CONFIG_GENERIC_CALIBRATE_DELAY=y 80CONFIG_GENERIC_CALIBRATE_DELAY=y
81CONFIG_HAVE_DEC_LOCK=y 81CONFIG_HAVE_DEC_LOCK=y
82CONFIG_DMA_NONCOHERENT=y 82CONFIG_DMA_NONCOHERENT=y
83CONFIG_DMA_NEED_PCI_MAP_STATE=y
83# CONFIG_CPU_LITTLE_ENDIAN is not set 84# CONFIG_CPU_LITTLE_ENDIAN is not set
84CONFIG_IRQ_CPU=y 85CONFIG_IRQ_CPU=y
85CONFIG_IRQ_CPU_RM7K=y 86CONFIG_IRQ_CPU_RM7K=y
diff --git a/arch/mips/configs/pb1100_defconfig b/arch/mips/configs/pb1100_defconfig
index 6cdabd550300..813e3a8b480b 100644
--- a/arch/mips/configs/pb1100_defconfig
+++ b/arch/mips/configs/pb1100_defconfig
@@ -4,9 +4,9 @@
4# Wed Jan 26 02:49:08 2005 4# Wed Jan 26 02:49:08 2005
5# 5#
6CONFIG_MIPS=y 6CONFIG_MIPS=y
7# CONFIG_MIPS64 is not set
8# CONFIG_64BIT is not set 7# CONFIG_64BIT is not set
9CONFIG_MIPS32=y 8# CONFIG_64BIT is not set
9CONFIG_32BIT=y
10 10
11# 11#
12# Code maturity level options 12# Code maturity level options
@@ -104,6 +104,7 @@ CONFIG_RWSEM_GENERIC_SPINLOCK=y
104CONFIG_GENERIC_CALIBRATE_DELAY=y 104CONFIG_GENERIC_CALIBRATE_DELAY=y
105CONFIG_HAVE_DEC_LOCK=y 105CONFIG_HAVE_DEC_LOCK=y
106CONFIG_DMA_NONCOHERENT=y 106CONFIG_DMA_NONCOHERENT=y
107CONFIG_DMA_NEED_PCI_MAP_STATE=y
107CONFIG_CPU_LITTLE_ENDIAN=y 108CONFIG_CPU_LITTLE_ENDIAN=y
108CONFIG_SWAP_IO_SPACE=y 109CONFIG_SWAP_IO_SPACE=y
109# CONFIG_AU1X00_USB_DEVICE is not set 110# CONFIG_AU1X00_USB_DEVICE is not set
diff --git a/arch/mips/configs/pb1500_defconfig b/arch/mips/configs/pb1500_defconfig
index 2aebbd2e82b3..49e528340a39 100644
--- a/arch/mips/configs/pb1500_defconfig
+++ b/arch/mips/configs/pb1500_defconfig
@@ -4,9 +4,9 @@
4# Wed Jan 26 02:49:09 2005 4# Wed Jan 26 02:49:09 2005
5# 5#
6CONFIG_MIPS=y 6CONFIG_MIPS=y
7# CONFIG_MIPS64 is not set
8# CONFIG_64BIT is not set 7# CONFIG_64BIT is not set
9CONFIG_MIPS32=y 8# CONFIG_64BIT is not set
9CONFIG_32BIT=y
10 10
11# 11#
12# Code maturity level options 12# Code maturity level options
diff --git a/arch/mips/configs/pb1550_defconfig b/arch/mips/configs/pb1550_defconfig
index 9e21edc28280..8e426776c098 100644
--- a/arch/mips/configs/pb1550_defconfig
+++ b/arch/mips/configs/pb1550_defconfig
@@ -4,9 +4,9 @@
4# Wed Jan 26 02:49:09 2005 4# Wed Jan 26 02:49:09 2005
5# 5#
6CONFIG_MIPS=y 6CONFIG_MIPS=y
7# CONFIG_MIPS64 is not set
8# CONFIG_64BIT is not set 7# CONFIG_64BIT is not set
9CONFIG_MIPS32=y 8# CONFIG_64BIT is not set
9CONFIG_32BIT=y
10 10
11# 11#
12# Code maturity level options 12# Code maturity level options
diff --git a/arch/mips/configs/osprey_defconfig b/arch/mips/configs/qemu_defconfig
index 989cb9e7ae83..b6568e421b99 100644
--- a/arch/mips/configs/osprey_defconfig
+++ b/arch/mips/configs/qemu_defconfig
@@ -1,108 +1,133 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.11-rc2 3# Linux kernel version: 2.6.13-rc6
4# Wed Jan 26 02:49:08 2005 4# Mon Aug 8 11:49:54 2005
5# 5#
6CONFIG_MIPS=y 6CONFIG_MIPS=y
7# CONFIG_MIPS64 is not set
8# CONFIG_64BIT is not set
9CONFIG_MIPS32=y
10 7
11# 8#
12# Code maturity level options 9# Code maturity level options
13# 10#
14CONFIG_EXPERIMENTAL=y 11# CONFIG_EXPERIMENTAL is not set
15CONFIG_CLEAN_COMPILE=y 12CONFIG_CLEAN_COMPILE=y
16CONFIG_BROKEN_ON_SMP=y 13CONFIG_BROKEN_ON_SMP=y
14CONFIG_INIT_ENV_ARG_LIMIT=32
17 15
18# 16#
19# General setup 17# General setup
20# 18#
21CONFIG_LOCALVERSION="" 19CONFIG_LOCALVERSION=""
22CONFIG_SWAP=y 20# CONFIG_SWAP is not set
23CONFIG_SYSVIPC=y 21# CONFIG_SYSVIPC is not set
24# CONFIG_POSIX_MQUEUE is not set
25# CONFIG_BSD_PROCESS_ACCT is not set 22# CONFIG_BSD_PROCESS_ACCT is not set
26CONFIG_SYSCTL=y 23# CONFIG_SYSCTL is not set
27# CONFIG_AUDIT is not set 24# CONFIG_AUDIT is not set
28CONFIG_LOG_BUF_SHIFT=14
29# CONFIG_HOTPLUG is not set 25# CONFIG_HOTPLUG is not set
30CONFIG_KOBJECT_UEVENT=y 26CONFIG_KOBJECT_UEVENT=y
31# CONFIG_IKCONFIG is not set 27# CONFIG_IKCONFIG is not set
32CONFIG_EMBEDDED=y 28CONFIG_EMBEDDED=y
33CONFIG_KALLSYMS=y 29CONFIG_KALLSYMS=y
34# CONFIG_KALLSYMS_EXTRA_PASS is not set 30# CONFIG_KALLSYMS_EXTRA_PASS is not set
35CONFIG_FUTEX=y 31CONFIG_PRINTK=y
36CONFIG_EPOLL=y 32# CONFIG_BUG is not set
33# CONFIG_BASE_FULL is not set
34# CONFIG_FUTEX is not set
35# CONFIG_EPOLL is not set
37# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set 36# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
38CONFIG_SHMEM=y 37# CONFIG_SHMEM is not set
39CONFIG_CC_ALIGN_FUNCTIONS=0 38CONFIG_CC_ALIGN_FUNCTIONS=0
40CONFIG_CC_ALIGN_LABELS=0 39CONFIG_CC_ALIGN_LABELS=0
41CONFIG_CC_ALIGN_LOOPS=0 40CONFIG_CC_ALIGN_LOOPS=0
42CONFIG_CC_ALIGN_JUMPS=0 41CONFIG_CC_ALIGN_JUMPS=0
43# CONFIG_TINY_SHMEM is not set 42CONFIG_TINY_SHMEM=y
43CONFIG_BASE_SMALL=1
44 44
45# 45#
46# Loadable module support 46# Loadable module support
47# 47#
48CONFIG_MODULES=y 48# CONFIG_MODULES is not set
49CONFIG_MODULE_UNLOAD=y
50# CONFIG_MODULE_FORCE_UNLOAD is not set
51CONFIG_OBSOLETE_MODPARM=y
52CONFIG_MODVERSIONS=y
53CONFIG_MODULE_SRCVERSION_ALL=y
54CONFIG_KMOD=y
55 49
56# 50#
57# Machine selection 51# Machine selection
58# 52#
59# CONFIG_MACH_JAZZ is not set 53# CONFIG_MIPS_MTX1 is not set
60# CONFIG_MACH_VR41XX is not set 54# CONFIG_MIPS_BOSPORUS is not set
61# CONFIG_TOSHIBA_JMR3927 is not set 55# CONFIG_MIPS_PB1000 is not set
56# CONFIG_MIPS_PB1100 is not set
57# CONFIG_MIPS_PB1500 is not set
58# CONFIG_MIPS_PB1550 is not set
59# CONFIG_MIPS_PB1200 is not set
60# CONFIG_MIPS_DB1000 is not set
61# CONFIG_MIPS_DB1100 is not set
62# CONFIG_MIPS_DB1500 is not set
63# CONFIG_MIPS_DB1550 is not set
64# CONFIG_MIPS_DB1200 is not set
65# CONFIG_MIPS_MIRAGE is not set
62# CONFIG_MIPS_COBALT is not set 66# CONFIG_MIPS_COBALT is not set
63# CONFIG_MACH_DECSTATION is not set 67# CONFIG_MACH_DECSTATION is not set
64# CONFIG_MIPS_EV64120 is not set 68# CONFIG_MIPS_EV64120 is not set
65# CONFIG_MIPS_EV96100 is not set 69# CONFIG_MIPS_EV96100 is not set
66# CONFIG_MIPS_IVR is not set 70# CONFIG_MIPS_IVR is not set
67# CONFIG_LASAT is not set
68# CONFIG_MIPS_ITE8172 is not set 71# CONFIG_MIPS_ITE8172 is not set
72# CONFIG_MACH_JAZZ is not set
73# CONFIG_LASAT is not set
69# CONFIG_MIPS_ATLAS is not set 74# CONFIG_MIPS_ATLAS is not set
70# CONFIG_MIPS_MALTA is not set 75# CONFIG_MIPS_MALTA is not set
71# CONFIG_MIPS_SEAD is not set 76# CONFIG_MIPS_SEAD is not set
77# CONFIG_MOMENCO_JAGUAR_ATX is not set
72# CONFIG_MOMENCO_OCELOT is not set 78# CONFIG_MOMENCO_OCELOT is not set
73# CONFIG_MOMENCO_OCELOT_G is not set
74# CONFIG_MOMENCO_OCELOT_C is not set
75# CONFIG_MOMENCO_OCELOT_3 is not set 79# CONFIG_MOMENCO_OCELOT_3 is not set
76# CONFIG_MOMENCO_JAGUAR_ATX is not set 80# CONFIG_MOMENCO_OCELOT_C is not set
77# CONFIG_PMC_YOSEMITE is not set 81# CONFIG_MOMENCO_OCELOT_G is not set
82# CONFIG_MIPS_XXS1500 is not set
83# CONFIG_PNX8550_V2PCI is not set
84# CONFIG_PNX8550_JBS is not set
78# CONFIG_DDB5074 is not set 85# CONFIG_DDB5074 is not set
79# CONFIG_DDB5476 is not set 86# CONFIG_DDB5476 is not set
80# CONFIG_DDB5477 is not set 87# CONFIG_DDB5477 is not set
81CONFIG_NEC_OSPREY=y 88# CONFIG_MACH_VR41XX is not set
89# CONFIG_PMC_YOSEMITE is not set
90CONFIG_QEMU=y
82# CONFIG_SGI_IP22 is not set 91# CONFIG_SGI_IP22 is not set
83# CONFIG_SOC_AU1X00 is not set 92# CONFIG_SGI_IP27 is not set
84# CONFIG_SIBYTE_SB1xxx_SOC is not set 93# CONFIG_SGI_IP32 is not set
94# CONFIG_SIBYTE_SWARM is not set
95# CONFIG_SIBYTE_SENTOSA is not set
96# CONFIG_SIBYTE_RHONE is not set
97# CONFIG_SIBYTE_CARMEL is not set
98# CONFIG_SIBYTE_PTSWARM is not set
99# CONFIG_SIBYTE_LITTLESUR is not set
100# CONFIG_SIBYTE_CRHINE is not set
101# CONFIG_SIBYTE_CRHONE is not set
85# CONFIG_SNI_RM200_PCI is not set 102# CONFIG_SNI_RM200_PCI is not set
103# CONFIG_TOSHIBA_JMR3927 is not set
86# CONFIG_TOSHIBA_RBTX4927 is not set 104# CONFIG_TOSHIBA_RBTX4927 is not set
105# CONFIG_TOSHIBA_RBTX4938 is not set
87CONFIG_RWSEM_GENERIC_SPINLOCK=y 106CONFIG_RWSEM_GENERIC_SPINLOCK=y
88CONFIG_GENERIC_CALIBRATE_DELAY=y 107CONFIG_GENERIC_CALIBRATE_DELAY=y
89CONFIG_HAVE_DEC_LOCK=y 108CONFIG_HAVE_DEC_LOCK=y
90CONFIG_DMA_NONCOHERENT=y 109CONFIG_DMA_COHERENT=y
91CONFIG_CPU_LITTLE_ENDIAN=y 110CONFIG_GENERIC_ISA_DMA=y
92CONFIG_IRQ_CPU=y 111CONFIG_I8259=y
112CONFIG_CPU_BIG_ENDIAN=y
113# CONFIG_CPU_LITTLE_ENDIAN is not set
114CONFIG_SYS_SUPPORTS_BIG_ENDIAN=y
115CONFIG_SWAP_IO_SPACE=y
93CONFIG_MIPS_L1_CACHE_SHIFT=5 116CONFIG_MIPS_L1_CACHE_SHIFT=5
94CONFIG_VR4181=y 117CONFIG_HAVE_STD_PC_SERIAL_PORT=y
95 118
96# 119#
97# CPU selection 120# CPU selection
98# 121#
99# CONFIG_CPU_MIPS32 is not set 122# CONFIG_CPU_MIPS32_R1 is not set
100# CONFIG_CPU_MIPS64 is not set 123# CONFIG_CPU_MIPS32_R2 is not set
124# CONFIG_CPU_MIPS64_R1 is not set
125# CONFIG_CPU_MIPS64_R2 is not set
101# CONFIG_CPU_R3000 is not set 126# CONFIG_CPU_R3000 is not set
102# CONFIG_CPU_TX39XX is not set 127# CONFIG_CPU_TX39XX is not set
103CONFIG_CPU_VR41XX=y 128# CONFIG_CPU_VR41XX is not set
104# CONFIG_CPU_R4300 is not set 129# CONFIG_CPU_R4300 is not set
105# CONFIG_CPU_R4X00 is not set 130CONFIG_CPU_R4X00=y
106# CONFIG_CPU_TX49XX is not set 131# CONFIG_CPU_TX49XX is not set
107# CONFIG_CPU_R5000 is not set 132# CONFIG_CPU_R5000 is not set
108# CONFIG_CPU_R5432 is not set 133# CONFIG_CPU_R5432 is not set
@@ -113,17 +138,36 @@ CONFIG_CPU_VR41XX=y
113# CONFIG_CPU_RM7000 is not set 138# CONFIG_CPU_RM7000 is not set
114# CONFIG_CPU_RM9000 is not set 139# CONFIG_CPU_RM9000 is not set
115# CONFIG_CPU_SB1 is not set 140# CONFIG_CPU_SB1 is not set
141CONFIG_SYS_SUPPORTS_32BIT_KERNEL=y
142CONFIG_CPU_SUPPORTS_32BIT_KERNEL=y
143CONFIG_CPU_SUPPORTS_64BIT_KERNEL=y
144
145#
146# Kernel type
147#
148CONFIG_32BIT=y
149# CONFIG_64BIT is not set
116CONFIG_PAGE_SIZE_4KB=y 150CONFIG_PAGE_SIZE_4KB=y
117# CONFIG_PAGE_SIZE_8KB is not set 151# CONFIG_PAGE_SIZE_8KB is not set
118# CONFIG_PAGE_SIZE_16KB is not set 152# CONFIG_PAGE_SIZE_16KB is not set
119# CONFIG_PAGE_SIZE_64KB is not set 153# CONFIG_PAGE_SIZE_64KB is not set
154# CONFIG_MIPS_MT is not set
155# CONFIG_64BIT_PHYS_ADDR is not set
120# CONFIG_CPU_ADVANCED is not set 156# CONFIG_CPU_ADVANCED is not set
157CONFIG_CPU_HAS_LLSC=y
158CONFIG_CPU_HAS_LLDSCD=y
121CONFIG_CPU_HAS_SYNC=y 159CONFIG_CPU_HAS_SYNC=y
160CONFIG_ARCH_FLATMEM_ENABLE=y
161CONFIG_FLATMEM=y
162CONFIG_FLAT_NODE_MEM_MAP=y
163CONFIG_PREEMPT_NONE=y
164# CONFIG_PREEMPT_VOLUNTARY is not set
122# CONFIG_PREEMPT is not set 165# CONFIG_PREEMPT is not set
123 166
124# 167#
125# Bus options (PCI, PCMCIA, EISA, ISA, TC) 168# Bus options (PCI, PCMCIA, EISA, ISA, TC)
126# 169#
170CONFIG_ISA=y
127CONFIG_MMU=y 171CONFIG_MMU=y
128 172
129# 173#
@@ -132,10 +176,6 @@ CONFIG_MMU=y
132# CONFIG_PCCARD is not set 176# CONFIG_PCCARD is not set
133 177
134# 178#
135# PC-card bridges
136#
137
138#
139# PCI Hotplug Support 179# PCI Hotplug Support
140# 180#
141 181
@@ -147,6 +187,56 @@ CONFIG_BINFMT_ELF=y
147CONFIG_TRAD_SIGNALS=y 187CONFIG_TRAD_SIGNALS=y
148 188
149# 189#
190# Networking
191#
192CONFIG_NET=y
193
194#
195# Networking options
196#
197CONFIG_PACKET=y
198CONFIG_PACKET_MMAP=y
199CONFIG_UNIX=y
200# CONFIG_NET_KEY is not set
201CONFIG_INET=y
202CONFIG_IP_MULTICAST=y
203# CONFIG_IP_ADVANCED_ROUTER is not set
204CONFIG_IP_FIB_HASH=y
205CONFIG_IP_PNP=y
206CONFIG_IP_PNP_DHCP=y
207CONFIG_IP_PNP_BOOTP=y
208# CONFIG_IP_PNP_RARP is not set
209# CONFIG_NET_IPIP is not set
210# CONFIG_NET_IPGRE is not set
211# CONFIG_IP_MROUTE is not set
212# CONFIG_SYN_COOKIES is not set
213# CONFIG_INET_AH is not set
214# CONFIG_INET_ESP is not set
215# CONFIG_INET_IPCOMP is not set
216# CONFIG_INET_TUNNEL is not set
217CONFIG_IP_TCPDIAG=y
218# CONFIG_IP_TCPDIAG_IPV6 is not set
219# CONFIG_TCP_CONG_ADVANCED is not set
220CONFIG_TCP_CONG_BIC=y
221# CONFIG_IPV6 is not set
222# CONFIG_NETFILTER is not set
223# CONFIG_BRIDGE is not set
224# CONFIG_VLAN_8021Q is not set
225# CONFIG_DECNET is not set
226# CONFIG_LLC2 is not set
227# CONFIG_IPX is not set
228# CONFIG_ATALK is not set
229# CONFIG_NET_SCHED is not set
230# CONFIG_NET_CLS_ROUTE is not set
231
232#
233# Network testing
234#
235# CONFIG_HAMRADIO is not set
236# CONFIG_IRDA is not set
237# CONFIG_BT is not set
238
239#
150# Device Drivers 240# Device Drivers
151# 241#
152 242
@@ -154,7 +244,7 @@ CONFIG_TRAD_SIGNALS=y
154# Generic Driver Options 244# Generic Driver Options
155# 245#
156CONFIG_STANDALONE=y 246CONFIG_STANDALONE=y
157CONFIG_PREVENT_FIRMWARE_BUILD=y 247# CONFIG_PREVENT_FIRMWARE_BUILD is not set
158# CONFIG_FW_LOADER is not set 248# CONFIG_FW_LOADER is not set
159 249
160# 250#
@@ -170,6 +260,7 @@ CONFIG_PREVENT_FIRMWARE_BUILD=y
170# 260#
171# Plug and Play support 261# Plug and Play support
172# 262#
263# CONFIG_PNP is not set
173 264
174# 265#
175# Block devices 266# Block devices
@@ -181,19 +272,16 @@ CONFIG_PREVENT_FIRMWARE_BUILD=y
181# CONFIG_BLK_DEV_RAM is not set 272# CONFIG_BLK_DEV_RAM is not set
182CONFIG_BLK_DEV_RAM_COUNT=16 273CONFIG_BLK_DEV_RAM_COUNT=16
183CONFIG_INITRAMFS_SOURCE="" 274CONFIG_INITRAMFS_SOURCE=""
184# CONFIG_LBD is not set 275# CONFIG_CDROM_PKTCDVD is not set
185CONFIG_CDROM_PKTCDVD=m
186CONFIG_CDROM_PKTCDVD_BUFFERS=8
187# CONFIG_CDROM_PKTCDVD_WCACHE is not set
188 276
189# 277#
190# IO Schedulers 278# IO Schedulers
191# 279#
192CONFIG_IOSCHED_NOOP=y 280CONFIG_IOSCHED_NOOP=y
193CONFIG_IOSCHED_AS=y 281# CONFIG_IOSCHED_AS is not set
194CONFIG_IOSCHED_DEADLINE=y 282# CONFIG_IOSCHED_DEADLINE is not set
195CONFIG_IOSCHED_CFQ=y 283# CONFIG_IOSCHED_CFQ is not set
196CONFIG_ATA_OVER_ETH=m 284# CONFIG_ATA_OVER_ETH is not set
197 285
198# 286#
199# ATA/ATAPI/MFM/RLL support 287# ATA/ATAPI/MFM/RLL support
@@ -206,6 +294,11 @@ CONFIG_ATA_OVER_ETH=m
206# CONFIG_SCSI is not set 294# CONFIG_SCSI is not set
207 295
208# 296#
297# Old CD-ROM drivers (not SCSI, not IDE)
298#
299# CONFIG_CD_NO_IDESCSI is not set
300
301#
209# Multi-device support (RAID and LVM) 302# Multi-device support (RAID and LVM)
210# 303#
211# CONFIG_MD is not set 304# CONFIG_MD is not set
@@ -213,6 +306,7 @@ CONFIG_ATA_OVER_ETH=m
213# 306#
214# Fusion MPT device support 307# Fusion MPT device support
215# 308#
309# CONFIG_FUSION is not set
216 310
217# 311#
218# IEEE 1394 (FireWire) support 312# IEEE 1394 (FireWire) support
@@ -223,84 +317,41 @@ CONFIG_ATA_OVER_ETH=m
223# 317#
224 318
225# 319#
226# Networking support 320# Network device support
227#
228CONFIG_NET=y
229
230#
231# Networking options
232# 321#
233CONFIG_PACKET=y
234# CONFIG_PACKET_MMAP is not set
235CONFIG_NETLINK_DEV=y
236CONFIG_UNIX=y
237CONFIG_NET_KEY=y
238CONFIG_INET=y
239# CONFIG_IP_MULTICAST is not set
240# CONFIG_IP_ADVANCED_ROUTER is not set
241CONFIG_IP_PNP=y
242# CONFIG_IP_PNP_DHCP is not set
243CONFIG_IP_PNP_BOOTP=y
244# CONFIG_IP_PNP_RARP is not set
245# CONFIG_NET_IPIP is not set
246# CONFIG_NET_IPGRE is not set
247# CONFIG_ARPD is not set
248# CONFIG_SYN_COOKIES is not set
249# CONFIG_INET_AH is not set
250# CONFIG_INET_ESP is not set
251# CONFIG_INET_IPCOMP is not set
252CONFIG_INET_TUNNEL=m
253CONFIG_IP_TCPDIAG=m
254# CONFIG_IP_TCPDIAG_IPV6 is not set
255# CONFIG_IPV6 is not set
256# CONFIG_NETFILTER is not set
257CONFIG_XFRM=y
258CONFIG_XFRM_USER=m
259
260#
261# SCTP Configuration (EXPERIMENTAL)
262#
263# CONFIG_IP_SCTP is not set
264# CONFIG_ATM is not set
265# CONFIG_BRIDGE is not set
266# CONFIG_VLAN_8021Q is not set
267# CONFIG_DECNET is not set
268# CONFIG_LLC2 is not set
269# CONFIG_IPX is not set
270# CONFIG_ATALK is not set
271# CONFIG_X25 is not set
272# CONFIG_LAPB is not set
273# CONFIG_NET_DIVERT is not set
274# CONFIG_ECONET is not set
275# CONFIG_WAN_ROUTER is not set
276
277#
278# QoS and/or fair queueing
279#
280# CONFIG_NET_SCHED is not set
281# CONFIG_NET_CLS_ROUTE is not set
282
283#
284# Network testing
285#
286# CONFIG_NET_PKTGEN is not set
287# CONFIG_NETPOLL is not set
288# CONFIG_NET_POLL_CONTROLLER is not set
289# CONFIG_HAMRADIO is not set
290# CONFIG_IRDA is not set
291# CONFIG_BT is not set
292CONFIG_NETDEVICES=y 322CONFIG_NETDEVICES=y
293# CONFIG_DUMMY is not set 323# CONFIG_DUMMY is not set
294# CONFIG_BONDING is not set 324# CONFIG_BONDING is not set
295# CONFIG_EQUALIZER is not set 325# CONFIG_EQUALIZER is not set
296# CONFIG_TUN is not set 326# CONFIG_TUN is not set
297# CONFIG_ETHERTAP is not set 327
328#
329# ARCnet devices
330#
331# CONFIG_ARCNET is not set
298 332
299# 333#
300# Ethernet (10 or 100Mbit) 334# Ethernet (10 or 100Mbit)
301# 335#
302CONFIG_NET_ETHERNET=y 336CONFIG_NET_ETHERNET=y
303# CONFIG_MII is not set 337CONFIG_MII=y
338# CONFIG_NET_VENDOR_3COM is not set
339# CONFIG_NET_VENDOR_SMC is not set
340# CONFIG_NET_VENDOR_RACAL is not set
341# CONFIG_DEPCA is not set
342# CONFIG_HP100 is not set
343CONFIG_NET_ISA=y
344# CONFIG_E2100 is not set
345# CONFIG_EWRK3 is not set
346# CONFIG_EEXPRESS is not set
347# CONFIG_EEXPRESS_PRO is not set
348# CONFIG_HPLAN_PLUS is not set
349# CONFIG_HPLAN is not set
350# CONFIG_LP486E is not set
351# CONFIG_ETH16I is not set
352CONFIG_NE2000=y
353# CONFIG_NET_PCI is not set
354# CONFIG_NET_POCKET is not set
304 355
305# 356#
306# Ethernet (1000 Mbit) 357# Ethernet (1000 Mbit)
@@ -313,6 +364,7 @@ CONFIG_NET_ETHERNET=y
313# 364#
314# Token Ring devices 365# Token Ring devices
315# 366#
367# CONFIG_TR is not set
316 368
317# 369#
318# Wireless LAN (non-hamradio) 370# Wireless LAN (non-hamradio)
@@ -325,8 +377,8 @@ CONFIG_NET_ETHERNET=y
325# CONFIG_WAN is not set 377# CONFIG_WAN is not set
326# CONFIG_PPP is not set 378# CONFIG_PPP is not set
327# CONFIG_SLIP is not set 379# CONFIG_SLIP is not set
328# CONFIG_SHAPER is not set 380# CONFIG_NETPOLL is not set
329# CONFIG_NETCONSOLE is not set 381# CONFIG_NET_POLL_CONTROLLER is not set
330 382
331# 383#
332# ISDN subsystem 384# ISDN subsystem
@@ -346,28 +398,13 @@ CONFIG_INPUT=y
346# 398#
347# Userland interfaces 399# Userland interfaces
348# 400#
349CONFIG_INPUT_MOUSEDEV=y 401# CONFIG_INPUT_MOUSEDEV is not set
350CONFIG_INPUT_MOUSEDEV_PSAUX=y
351CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024
352CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768
353# CONFIG_INPUT_JOYDEV is not set 402# CONFIG_INPUT_JOYDEV is not set
354# CONFIG_INPUT_TSDEV is not set 403# CONFIG_INPUT_TSDEV is not set
355# CONFIG_INPUT_EVDEV is not set 404# CONFIG_INPUT_EVDEV is not set
356# CONFIG_INPUT_EVBUG is not set 405# CONFIG_INPUT_EVBUG is not set
357 406
358# 407#
359# Input I/O drivers
360#
361# CONFIG_GAMEPORT is not set
362CONFIG_SOUND_GAMEPORT=y
363CONFIG_SERIO=y
364# CONFIG_SERIO_I8042 is not set
365CONFIG_SERIO_SERPORT=y
366# CONFIG_SERIO_CT82C710 is not set
367# CONFIG_SERIO_LIBPS2 is not set
368CONFIG_SERIO_RAW=m
369
370#
371# Input Device Drivers 408# Input Device Drivers
372# 409#
373# CONFIG_INPUT_KEYBOARD is not set 410# CONFIG_INPUT_KEYBOARD is not set
@@ -377,6 +414,12 @@ CONFIG_SERIO_RAW=m
377# CONFIG_INPUT_MISC is not set 414# CONFIG_INPUT_MISC is not set
378 415
379# 416#
417# Hardware I/O ports
418#
419# CONFIG_SERIO is not set
420# CONFIG_GAMEPORT is not set
421
422#
380# Character devices 423# Character devices
381# 424#
382CONFIG_VT=y 425CONFIG_VT=y
@@ -397,9 +440,8 @@ CONFIG_SERIAL_8250_NR_UARTS=4
397# 440#
398CONFIG_SERIAL_CORE=y 441CONFIG_SERIAL_CORE=y
399CONFIG_SERIAL_CORE_CONSOLE=y 442CONFIG_SERIAL_CORE_CONSOLE=y
400CONFIG_UNIX98_PTYS=y 443# CONFIG_UNIX98_PTYS is not set
401CONFIG_LEGACY_PTYS=y 444# CONFIG_LEGACY_PTYS is not set
402CONFIG_LEGACY_PTY_COUNT=256
403 445
404# 446#
405# IPMI 447# IPMI
@@ -418,13 +460,17 @@ CONFIG_LEGACY_PTY_COUNT=256
418# 460#
419# Ftape, the floppy tape device driver 461# Ftape, the floppy tape device driver
420# 462#
421# CONFIG_DRM is not set
422# CONFIG_RAW_DRIVER is not set 463# CONFIG_RAW_DRIVER is not set
423 464
424# 465#
466# TPM devices
467#
468
469#
425# I2C support 470# I2C support
426# 471#
427# CONFIG_I2C is not set 472# CONFIG_I2C is not set
473# CONFIG_I2C_SENSOR is not set
428 474
429# 475#
430# Dallas's 1-wire bus 476# Dallas's 1-wire bus
@@ -432,6 +478,11 @@ CONFIG_LEGACY_PTY_COUNT=256
432# CONFIG_W1 is not set 478# CONFIG_W1 is not set
433 479
434# 480#
481# Hardware Monitoring support
482#
483# CONFIG_HWMON is not set
484
485#
435# Misc devices 486# Misc devices
436# 487#
437 488
@@ -453,9 +504,9 @@ CONFIG_LEGACY_PTY_COUNT=256
453# 504#
454# Console display driver support 505# Console display driver support
455# 506#
456# CONFIG_VGA_CONSOLE is not set 507CONFIG_VGA_CONSOLE=y
508# CONFIG_MDA_CONSOLE is not set
457CONFIG_DUMMY_CONSOLE=y 509CONFIG_DUMMY_CONSOLE=y
458# CONFIG_BACKLIGHT_LCD_SUPPORT is not set
459 510
460# 511#
461# Sound 512# Sound
@@ -469,10 +520,6 @@ CONFIG_DUMMY_CONSOLE=y
469# CONFIG_USB_ARCH_HAS_OHCI is not set 520# CONFIG_USB_ARCH_HAS_OHCI is not set
470 521
471# 522#
472# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support' may also be needed; see USB_STORAGE Help for more information
473#
474
475#
476# USB Gadget Support 523# USB Gadget Support
477# 524#
478# CONFIG_USB_GADGET is not set 525# CONFIG_USB_GADGET is not set
@@ -488,19 +535,28 @@ CONFIG_DUMMY_CONSOLE=y
488# CONFIG_INFINIBAND is not set 535# CONFIG_INFINIBAND is not set
489 536
490# 537#
538# SN Devices
539#
540
541#
491# File systems 542# File systems
492# 543#
493CONFIG_EXT2_FS=y 544# CONFIG_EXT2_FS is not set
494# CONFIG_EXT2_FS_XATTR is not set
495# CONFIG_EXT3_FS is not set 545# CONFIG_EXT3_FS is not set
496# CONFIG_JBD is not set 546# CONFIG_JBD is not set
497# CONFIG_REISERFS_FS is not set 547# CONFIG_REISERFS_FS is not set
498# CONFIG_JFS_FS is not set 548# CONFIG_JFS_FS is not set
549# CONFIG_FS_POSIX_ACL is not set
550
551#
552# XFS support
553#
499# CONFIG_XFS_FS is not set 554# CONFIG_XFS_FS is not set
500# CONFIG_MINIX_FS is not set 555# CONFIG_MINIX_FS is not set
501# CONFIG_ROMFS_FS is not set 556# CONFIG_ROMFS_FS is not set
557CONFIG_INOTIFY=y
502# CONFIG_QUOTA is not set 558# CONFIG_QUOTA is not set
503CONFIG_DNOTIFY=y 559# CONFIG_DNOTIFY is not set
504# CONFIG_AUTOFS_FS is not set 560# CONFIG_AUTOFS_FS is not set
505# CONFIG_AUTOFS4_FS is not set 561# CONFIG_AUTOFS4_FS is not set
506 562
@@ -520,12 +576,8 @@ CONFIG_DNOTIFY=y
520# 576#
521# Pseudo filesystems 577# Pseudo filesystems
522# 578#
523CONFIG_PROC_FS=y 579# CONFIG_PROC_FS is not set
524CONFIG_PROC_KCORE=y 580# CONFIG_SYSFS is not set
525CONFIG_SYSFS=y
526# CONFIG_DEVFS_FS is not set
527CONFIG_DEVPTS_FS_XATTR=y
528CONFIG_DEVPTS_FS_SECURITY=y
529# CONFIG_TMPFS is not set 581# CONFIG_TMPFS is not set
530# CONFIG_HUGETLB_PAGE is not set 582# CONFIG_HUGETLB_PAGE is not set
531CONFIG_RAMFS=y 583CONFIG_RAMFS=y
@@ -533,13 +585,7 @@ CONFIG_RAMFS=y
533# 585#
534# Miscellaneous filesystems 586# Miscellaneous filesystems
535# 587#
536# CONFIG_ADFS_FS is not set
537# CONFIG_AFFS_FS is not set
538# CONFIG_HFS_FS is not set
539# CONFIG_HFSPLUS_FS is not set 588# CONFIG_HFSPLUS_FS is not set
540# CONFIG_BEFS_FS is not set
541# CONFIG_BFS_FS is not set
542# CONFIG_EFS_FS is not set
543# CONFIG_CRAMFS is not set 589# CONFIG_CRAMFS is not set
544# CONFIG_VXFS_FS is not set 590# CONFIG_VXFS_FS is not set
545# CONFIG_HPFS_FS is not set 591# CONFIG_HPFS_FS is not set
@@ -551,23 +597,18 @@ CONFIG_RAMFS=y
551# Network File Systems 597# Network File Systems
552# 598#
553CONFIG_NFS_FS=y 599CONFIG_NFS_FS=y
554# CONFIG_NFS_V3 is not set 600CONFIG_NFS_V3=y
555# CONFIG_NFS_V4 is not set 601# CONFIG_NFS_V3_ACL is not set
556# CONFIG_NFS_DIRECTIO is not set 602# CONFIG_NFSD is not set
557CONFIG_NFSD=y
558# CONFIG_NFSD_V3 is not set
559# CONFIG_NFSD_TCP is not set
560CONFIG_ROOT_NFS=y 603CONFIG_ROOT_NFS=y
561CONFIG_LOCKD=y 604CONFIG_LOCKD=y
562CONFIG_EXPORTFS=y 605CONFIG_LOCKD_V4=y
606CONFIG_NFS_COMMON=y
563CONFIG_SUNRPC=y 607CONFIG_SUNRPC=y
564# CONFIG_RPCSEC_GSS_KRB5 is not set
565# CONFIG_RPCSEC_GSS_SPKM3 is not set
566# CONFIG_SMB_FS is not set 608# CONFIG_SMB_FS is not set
567# CONFIG_CIFS is not set 609# CONFIG_CIFS is not set
568# CONFIG_NCP_FS is not set 610# CONFIG_NCP_FS is not set
569# CONFIG_CODA_FS is not set 611# CONFIG_CODA_FS is not set
570# CONFIG_AFS_FS is not set
571 612
572# 613#
573# Partition Types 614# Partition Types
@@ -581,22 +622,18 @@ CONFIG_MSDOS_PARTITION=y
581# CONFIG_NLS is not set 622# CONFIG_NLS is not set
582 623
583# 624#
584# Profiling support
585#
586# CONFIG_PROFILING is not set
587
588#
589# Kernel hacking 625# Kernel hacking
590# 626#
627# CONFIG_PRINTK_TIME is not set
591# CONFIG_DEBUG_KERNEL is not set 628# CONFIG_DEBUG_KERNEL is not set
629CONFIG_LOG_BUF_SHIFT=14
592CONFIG_CROSSCOMPILE=y 630CONFIG_CROSSCOMPILE=y
593CONFIG_CMDLINE="ip=bootp ether=46,0x03fe0300,eth0" 631CONFIG_CMDLINE="console=ttyS0 debug ip=172.20.0.2:172.20.0.1::255.255.0.0"
594 632
595# 633#
596# Security options 634# Security options
597# 635#
598CONFIG_KEYS=y 636# CONFIG_KEYS is not set
599CONFIG_KEYS_DEBUG_PROC_KEYS=y
600# CONFIG_SECURITY is not set 637# CONFIG_SECURITY is not set
601 638
602# 639#
@@ -612,7 +649,7 @@ CONFIG_KEYS_DEBUG_PROC_KEYS=y
612# Library routines 649# Library routines
613# 650#
614# CONFIG_CRC_CCITT is not set 651# CONFIG_CRC_CCITT is not set
615# CONFIG_CRC32 is not set 652CONFIG_CRC32=y
616CONFIG_LIBCRC32C=m 653# CONFIG_LIBCRC32C is not set
617CONFIG_GENERIC_HARDIRQS=y 654CONFIG_GENERIC_HARDIRQS=y
618CONFIG_GENERIC_IRQ_PROBE=y 655CONFIG_GENERIC_IRQ_PROBE=y
diff --git a/arch/mips/configs/rm200_defconfig b/arch/mips/configs/rm200_defconfig
index d0c85a4009d6..17d4fce6c4c6 100644
--- a/arch/mips/configs/rm200_defconfig
+++ b/arch/mips/configs/rm200_defconfig
@@ -4,9 +4,9 @@
4# Wed Jan 26 02:49:09 2005 4# Wed Jan 26 02:49:09 2005
5# 5#
6CONFIG_MIPS=y 6CONFIG_MIPS=y
7# CONFIG_MIPS64 is not set
8# CONFIG_64BIT is not set 7# CONFIG_64BIT is not set
9CONFIG_MIPS32=y 8# CONFIG_64BIT is not set
9CONFIG_32BIT=y
10 10
11# 11#
12# Code maturity level options 12# Code maturity level options
@@ -91,6 +91,7 @@ CONFIG_GENERIC_CALIBRATE_DELAY=y
91CONFIG_HAVE_DEC_LOCK=y 91CONFIG_HAVE_DEC_LOCK=y
92CONFIG_ARC=y 92CONFIG_ARC=y
93CONFIG_DMA_NONCOHERENT=y 93CONFIG_DMA_NONCOHERENT=y
94CONFIG_DMA_NEED_PCI_MAP_STATE=y
94CONFIG_GENERIC_ISA_DMA=y 95CONFIG_GENERIC_ISA_DMA=y
95CONFIG_I8259=y 96CONFIG_I8259=y
96CONFIG_CPU_LITTLE_ENDIAN=y 97CONFIG_CPU_LITTLE_ENDIAN=y
diff --git a/arch/mips/configs/sb1250-swarm_defconfig b/arch/mips/configs/sb1250-swarm_defconfig
index 84978b70714b..1dc935f37582 100644
--- a/arch/mips/configs/sb1250-swarm_defconfig
+++ b/arch/mips/configs/sb1250-swarm_defconfig
@@ -4,9 +4,9 @@
4# Wed Jan 26 02:49:10 2005 4# Wed Jan 26 02:49:10 2005
5# 5#
6CONFIG_MIPS=y 6CONFIG_MIPS=y
7# CONFIG_MIPS64 is not set
8# CONFIG_64BIT is not set 7# CONFIG_64BIT is not set
9CONFIG_MIPS32=y 8# CONFIG_64BIT is not set
9CONFIG_32BIT=y
10 10
11# 11#
12# Code maturity level options 12# Code maturity level options
diff --git a/arch/mips/configs/sead_defconfig b/arch/mips/configs/sead_defconfig
index 7c718a429b04..dd07e866b128 100644
--- a/arch/mips/configs/sead_defconfig
+++ b/arch/mips/configs/sead_defconfig
@@ -4,9 +4,9 @@
4# Wed Jan 26 02:49:10 2005 4# Wed Jan 26 02:49:10 2005
5# 5#
6CONFIG_MIPS=y 6CONFIG_MIPS=y
7# CONFIG_MIPS64 is not set
8# CONFIG_64BIT is not set 7# CONFIG_64BIT is not set
9CONFIG_MIPS32=y 8# CONFIG_64BIT is not set
9CONFIG_32BIT=y
10 10
11# 11#
12# Code maturity level options 12# Code maturity level options
@@ -80,6 +80,7 @@ CONFIG_RWSEM_GENERIC_SPINLOCK=y
80CONFIG_GENERIC_CALIBRATE_DELAY=y 80CONFIG_GENERIC_CALIBRATE_DELAY=y
81CONFIG_HAVE_DEC_LOCK=y 81CONFIG_HAVE_DEC_LOCK=y
82CONFIG_DMA_NONCOHERENT=y 82CONFIG_DMA_NONCOHERENT=y
83CONFIG_DMA_NEED_PCI_MAP_STATE=y
83CONFIG_CPU_LITTLE_ENDIAN=y 84CONFIG_CPU_LITTLE_ENDIAN=y
84CONFIG_IRQ_CPU=y 85CONFIG_IRQ_CPU=y
85CONFIG_MIPS_BOARDS_GEN=y 86CONFIG_MIPS_BOARDS_GEN=y
diff --git a/arch/mips/configs/tb0226_defconfig b/arch/mips/configs/tb0226_defconfig
index e01727cd0fe9..c9d3f83caf0f 100644
--- a/arch/mips/configs/tb0226_defconfig
+++ b/arch/mips/configs/tb0226_defconfig
@@ -4,9 +4,9 @@
4# Wed Jan 26 02:49:12 2005 4# Wed Jan 26 02:49:12 2005
5# 5#
6CONFIG_MIPS=y 6CONFIG_MIPS=y
7# CONFIG_MIPS64 is not set
8# CONFIG_64BIT is not set 7# CONFIG_64BIT is not set
9CONFIG_MIPS32=y 8# CONFIG_64BIT is not set
9CONFIG_32BIT=y
10 10
11# 11#
12# Code maturity level options 12# Code maturity level options
@@ -95,6 +95,7 @@ CONFIG_RWSEM_GENERIC_SPINLOCK=y
95CONFIG_GENERIC_CALIBRATE_DELAY=y 95CONFIG_GENERIC_CALIBRATE_DELAY=y
96CONFIG_HAVE_DEC_LOCK=y 96CONFIG_HAVE_DEC_LOCK=y
97CONFIG_DMA_NONCOHERENT=y 97CONFIG_DMA_NONCOHERENT=y
98CONFIG_DMA_NEED_PCI_MAP_STATE=y
98CONFIG_CPU_LITTLE_ENDIAN=y 99CONFIG_CPU_LITTLE_ENDIAN=y
99CONFIG_IRQ_CPU=y 100CONFIG_IRQ_CPU=y
100CONFIG_MIPS_L1_CACHE_SHIFT=5 101CONFIG_MIPS_L1_CACHE_SHIFT=5
diff --git a/arch/mips/configs/tb0229_defconfig b/arch/mips/configs/tb0229_defconfig
index c6ba3de27614..2cb669188aa9 100644
--- a/arch/mips/configs/tb0229_defconfig
+++ b/arch/mips/configs/tb0229_defconfig
@@ -4,9 +4,9 @@
4# Wed Jan 26 02:49:12 2005 4# Wed Jan 26 02:49:12 2005
5# 5#
6CONFIG_MIPS=y 6CONFIG_MIPS=y
7# CONFIG_MIPS64 is not set
8# CONFIG_64BIT is not set 7# CONFIG_64BIT is not set
9CONFIG_MIPS32=y 8# CONFIG_64BIT is not set
9CONFIG_32BIT=y
10 10
11# 11#
12# Code maturity level options 12# Code maturity level options
@@ -98,6 +98,7 @@ CONFIG_RWSEM_GENERIC_SPINLOCK=y
98CONFIG_GENERIC_CALIBRATE_DELAY=y 98CONFIG_GENERIC_CALIBRATE_DELAY=y
99CONFIG_HAVE_DEC_LOCK=y 99CONFIG_HAVE_DEC_LOCK=y
100CONFIG_DMA_NONCOHERENT=y 100CONFIG_DMA_NONCOHERENT=y
101CONFIG_DMA_NEED_PCI_MAP_STATE=y
101CONFIG_CPU_LITTLE_ENDIAN=y 102CONFIG_CPU_LITTLE_ENDIAN=y
102CONFIG_IRQ_CPU=y 103CONFIG_IRQ_CPU=y
103CONFIG_MIPS_L1_CACHE_SHIFT=5 104CONFIG_MIPS_L1_CACHE_SHIFT=5
diff --git a/arch/mips/configs/workpad_defconfig b/arch/mips/configs/workpad_defconfig
index 915c43b6e2d9..16e07fca446f 100644
--- a/arch/mips/configs/workpad_defconfig
+++ b/arch/mips/configs/workpad_defconfig
@@ -4,9 +4,9 @@
4# Wed Jan 26 02:49:12 2005 4# Wed Jan 26 02:49:12 2005
5# 5#
6CONFIG_MIPS=y 6CONFIG_MIPS=y
7# CONFIG_MIPS64 is not set
8# CONFIG_64BIT is not set 7# CONFIG_64BIT is not set
9CONFIG_MIPS32=y 8# CONFIG_64BIT is not set
9CONFIG_32BIT=y
10 10
11# 11#
12# Code maturity level options 12# Code maturity level options
@@ -96,6 +96,7 @@ CONFIG_RWSEM_GENERIC_SPINLOCK=y
96CONFIG_GENERIC_CALIBRATE_DELAY=y 96CONFIG_GENERIC_CALIBRATE_DELAY=y
97CONFIG_HAVE_DEC_LOCK=y 97CONFIG_HAVE_DEC_LOCK=y
98CONFIG_DMA_NONCOHERENT=y 98CONFIG_DMA_NONCOHERENT=y
99CONFIG_DMA_NEED_PCI_MAP_STATE=y
99CONFIG_CPU_LITTLE_ENDIAN=y 100CONFIG_CPU_LITTLE_ENDIAN=y
100CONFIG_IRQ_CPU=y 101CONFIG_IRQ_CPU=y
101CONFIG_MIPS_L1_CACHE_SHIFT=5 102CONFIG_MIPS_L1_CACHE_SHIFT=5
diff --git a/arch/mips/configs/yosemite_defconfig b/arch/mips/configs/yosemite_defconfig
index 562f2b8043ac..6d2290777ad7 100644
--- a/arch/mips/configs/yosemite_defconfig
+++ b/arch/mips/configs/yosemite_defconfig
@@ -4,9 +4,9 @@
4# Wed Jan 26 02:49:13 2005 4# Wed Jan 26 02:49:13 2005
5# 5#
6CONFIG_MIPS=y 6CONFIG_MIPS=y
7# CONFIG_MIPS64 is not set
8# CONFIG_64BIT is not set 7# CONFIG_64BIT is not set
9CONFIG_MIPS32=y 8# CONFIG_64BIT is not set
9CONFIG_32BIT=y
10 10
11# 11#
12# Code maturity level options 12# Code maturity level options
diff --git a/arch/mips/ddb5xxx/ddb5477/irq.c b/arch/mips/ddb5xxx/ddb5477/irq.c
index 5f027bfa4af8..9ffe1a9142ca 100644
--- a/arch/mips/ddb5xxx/ddb5477/irq.c
+++ b/arch/mips/ddb5xxx/ddb5477/irq.c
@@ -76,7 +76,7 @@ set_pci_int_attr(u32 pci, u32 intn, u32 active, u32 trigger)
76extern void vrc5477_irq_init(u32 base); 76extern void vrc5477_irq_init(u32 base);
77extern void mips_cpu_irq_init(u32 base); 77extern void mips_cpu_irq_init(u32 base);
78extern asmlinkage void ddb5477_handle_int(void); 78extern asmlinkage void ddb5477_handle_int(void);
79extern int setup_irq(unsigned int irq, struct irqaction *irqaction); 79extern int setup_irq(unsigned int irq, struct irqaction *irqaction);
80static struct irqaction irq_cascade = { no_action, 0, CPU_MASK_NONE, "cascade", NULL, NULL }; 80static struct irqaction irq_cascade = { no_action, 0, CPU_MASK_NONE, "cascade", NULL, NULL };
81 81
82void __init arch_init_irq(void) 82void __init arch_init_irq(void)
@@ -94,7 +94,7 @@ void __init arch_init_irq(void)
94 /* setup PCI interrupt attributes */ 94 /* setup PCI interrupt attributes */
95 set_pci_int_attr(PCI0, INTA, ACTIVE_LOW, LEVEL_SENSE); 95 set_pci_int_attr(PCI0, INTA, ACTIVE_LOW, LEVEL_SENSE);
96 set_pci_int_attr(PCI0, INTB, ACTIVE_LOW, LEVEL_SENSE); 96 set_pci_int_attr(PCI0, INTB, ACTIVE_LOW, LEVEL_SENSE);
97 if (mips_machtype == MACH_NEC_ROCKHOPPERII) 97 if (mips_machtype == MACH_NEC_ROCKHOPPERII)
98 set_pci_int_attr(PCI0, INTC, ACTIVE_HIGH, LEVEL_SENSE); 98 set_pci_int_attr(PCI0, INTC, ACTIVE_HIGH, LEVEL_SENSE);
99 else 99 else
100 set_pci_int_attr(PCI0, INTC, ACTIVE_LOW, LEVEL_SENSE); 100 set_pci_int_attr(PCI0, INTC, ACTIVE_LOW, LEVEL_SENSE);
@@ -134,7 +134,7 @@ void __init arch_init_irq(void)
134 134
135 /* setup cascade interrupts */ 135 /* setup cascade interrupts */
136 setup_irq(VRC5477_IRQ_BASE + VRC5477_I8259_CASCADE, &irq_cascade); 136 setup_irq(VRC5477_IRQ_BASE + VRC5477_I8259_CASCADE, &irq_cascade);
137 setup_irq(CPU_IRQ_BASE + CPU_VRC5477_CASCADE, &irq_cascade); 137 setup_irq(CPU_IRQ_BASE + CPU_VRC5477_CASCADE, &irq_cascade);
138 138
139 /* hook up the first-level interrupt handler */ 139 /* hook up the first-level interrupt handler */
140 set_except_vector(0, ddb5477_handle_int); 140 set_except_vector(0, ddb5477_handle_int);
diff --git a/arch/mips/ddb5xxx/ddb5477/setup.c b/arch/mips/ddb5xxx/ddb5477/setup.c
index 15c6e543b56f..d62f5a789b05 100644
--- a/arch/mips/ddb5xxx/ddb5477/setup.c
+++ b/arch/mips/ddb5xxx/ddb5477/setup.c
@@ -141,7 +141,7 @@ static void __init ddb_time_init(void)
141 141
142 /* mips_hpt_frequency is 1/2 of the cpu core freq */ 142 /* mips_hpt_frequency is 1/2 of the cpu core freq */
143 i = (read_c0_config() >> 28 ) & 7; 143 i = (read_c0_config() >> 28 ) & 7;
144 if ((current_cpu_data.cputype == CPU_R5432) && (i == 3)) 144 if ((current_cpu_data.cputype == CPU_R5432) && (i == 3))
145 i = 4; 145 i = 4;
146 mips_hpt_frequency = bus_frequency*(i+4)/4; 146 mips_hpt_frequency = bus_frequency*(i+4)/4;
147} 147}
@@ -298,11 +298,11 @@ static void __init ddb5477_board_init(void)
298 298
299 if (mips_machtype == MACH_NEC_ROCKHOPPER 299 if (mips_machtype == MACH_NEC_ROCKHOPPER
300 || mips_machtype == MACH_NEC_ROCKHOPPERII) { 300 || mips_machtype == MACH_NEC_ROCKHOPPERII) {
301 /* Disable bus diagnostics. */ 301 /* Disable bus diagnostics. */
302 ddb_out32(DDB_PCICTL0_L, 0); 302 ddb_out32(DDB_PCICTL0_L, 0);
303 ddb_out32(DDB_PCICTL0_H, 0); 303 ddb_out32(DDB_PCICTL0_H, 0);
304 ddb_out32(DDB_PCICTL1_L, 0); 304 ddb_out32(DDB_PCICTL1_L, 0);
305 ddb_out32(DDB_PCICTL1_H, 0); 305 ddb_out32(DDB_PCICTL1_H, 0);
306 } 306 }
307 307
308 if (mips_machtype == MACH_NEC_ROCKHOPPER) { 308 if (mips_machtype == MACH_NEC_ROCKHOPPER) {
@@ -354,7 +354,7 @@ static void __init ddb5477_board_init(void)
354 */ 354 */
355 pci_write_config_byte(&dev_m1533, 0x58, 0x74); 355 pci_write_config_byte(&dev_m1533, 0x58, 0x74);
356 356
357 /* 357 /*
358 * positive decode (bit6 -0) 358 * positive decode (bit6 -0)
359 * enable IDE controler interrupt (bit 4 -1) 359 * enable IDE controler interrupt (bit 4 -1)
360 * setup SIRQ to point to IRQ 14 (bit 3:0 - 1101) 360 * setup SIRQ to point to IRQ 14 (bit 3:0 - 1101)
@@ -364,31 +364,31 @@ static void __init ddb5477_board_init(void)
364 /* Setup M5229 registers */ 364 /* Setup M5229 registers */
365 dev_m5229.bus = &bus; 365 dev_m5229.bus = &bus;
366 dev_m5229.sysdata = NULL; 366 dev_m5229.sysdata = NULL;
367 dev_m5229.devfn = 4*8; // slot 4 (AD15): M5229 IDE 367 dev_m5229.devfn = 4*8; // slot 4 (AD15): M5229 IDE
368 368
369 /* 369 /*
370 * enable IDE in the M5229 config register 0x50 (bit 0 - 1) 370 * enable IDE in the M5229 config register 0x50 (bit 0 - 1)
371 * M5229 IDSEL is addr:15; see above setting 371 * M5229 IDSEL is addr:15; see above setting
372 */ 372 */
373 pci_read_config_byte(&dev_m5229, 0x50, &temp8); 373 pci_read_config_byte(&dev_m5229, 0x50, &temp8);
374 pci_write_config_byte(&dev_m5229, 0x50, temp8 | 0x1); 374 pci_write_config_byte(&dev_m5229, 0x50, temp8 | 0x1);
375 375
376 /* 376 /*
377 * enable bus master (bit 2) and IO decoding (bit 0) 377 * enable bus master (bit 2) and IO decoding (bit 0)
378 */ 378 */
379 pci_read_config_byte(&dev_m5229, 0x04, &temp8); 379 pci_read_config_byte(&dev_m5229, 0x04, &temp8);
380 pci_write_config_byte(&dev_m5229, 0x04, temp8 | 0x5); 380 pci_write_config_byte(&dev_m5229, 0x04, temp8 | 0x5);
381 381
382 /* 382 /*
383 * enable native, copied from arch/ppc/k2boot/head.S 383 * enable native, copied from arch/ppc/k2boot/head.S
384 * TODO - need volatile, need to be portable 384 * TODO - need volatile, need to be portable
385 */ 385 */
386 pci_write_config_byte(&dev_m5229, 0x09, 0xef); 386 pci_write_config_byte(&dev_m5229, 0x09, 0xef);
387 387
388 /* Set Primary Channel Command Block Timing */ 388 /* Set Primary Channel Command Block Timing */
389 pci_write_config_byte(&dev_m5229, 0x59, 0x31); 389 pci_write_config_byte(&dev_m5229, 0x59, 0x31);
390 390
391 /* 391 /*
392 * Enable primary channel 40-pin cable 392 * Enable primary channel 40-pin cable
393 * M5229 register 0x4a (bit 0) 393 * M5229 register 0x4a (bit 0)
394 */ 394 */
diff --git a/arch/mips/dec/ecc-berr.c b/arch/mips/dec/ecc-berr.c
index 133fb7c48e6c..6dbce92eb068 100644
--- a/arch/mips/dec/ecc-berr.c
+++ b/arch/mips/dec/ecc-berr.c
@@ -253,7 +253,7 @@ static inline void dec_kn03_be_init(void)
253 253
254 kn0x_erraddr = (void *)(KN03_SLOT_BASE + IOASIC_ERRADDR); 254 kn0x_erraddr = (void *)(KN03_SLOT_BASE + IOASIC_ERRADDR);
255 kn0x_chksyn = (void *)(KN03_SLOT_BASE + IOASIC_CHKSYN); 255 kn0x_chksyn = (void *)(KN03_SLOT_BASE + IOASIC_CHKSYN);
256 256
257 /* 257 /*
258 * Set normal ECC detection and generation, enable ECC correction. 258 * Set normal ECC detection and generation, enable ECC correction.
259 * For KN05 we also need to make sure EE (?) is enabled in the MB. 259 * For KN05 we also need to make sure EE (?) is enabled in the MB.
diff --git a/arch/mips/dec/int-handler.S b/arch/mips/dec/int-handler.S
index 3b3790993219..c89768d5c4e5 100644
--- a/arch/mips/dec/int-handler.S
+++ b/arch/mips/dec/int-handler.S
@@ -133,7 +133,7 @@
133 */ 133 */
134 mfc0 t0,CP0_CAUSE # get pending interrupts 134 mfc0 t0,CP0_CAUSE # get pending interrupts
135 mfc0 t1,CP0_STATUS 135 mfc0 t1,CP0_STATUS
136#ifdef CONFIG_MIPS32 136#ifdef CONFIG_32BIT
137 lw t2,cpu_fpu_mask 137 lw t2,cpu_fpu_mask
138#endif 138#endif
139 andi t0,ST0_IM # CAUSE.CE may be non-zero! 139 andi t0,ST0_IM # CAUSE.CE may be non-zero!
@@ -141,7 +141,7 @@
141 141
142 beqz t0,spurious 142 beqz t0,spurious
143 143
144#ifdef CONFIG_MIPS32 144#ifdef CONFIG_32BIT
145 and t2,t0 145 and t2,t0
146 bnez t2,fpu # handle FPU immediately 146 bnez t2,fpu # handle FPU immediately
147#endif 147#endif
@@ -271,7 +271,7 @@ handle_it:
271 j ret_from_irq 271 j ret_from_irq
272 nop 272 nop
273 273
274#ifdef CONFIG_MIPS32 274#ifdef CONFIG_32BIT
275fpu: 275fpu:
276 j handle_fpe_int 276 j handle_fpe_int
277 nop 277 nop
diff --git a/arch/mips/dec/prom/Makefile b/arch/mips/dec/prom/Makefile
index 373822ec2d8c..bcd0247b3a66 100644
--- a/arch/mips/dec/prom/Makefile
+++ b/arch/mips/dec/prom/Makefile
@@ -5,7 +5,7 @@
5 5
6lib-y += init.o memory.o cmdline.o identify.o console.o 6lib-y += init.o memory.o cmdline.o identify.o console.o
7 7
8lib-$(CONFIG_MIPS32) += locore.o 8lib-$(CONFIG_32BIT) += locore.o
9lib-$(CONFIG_MIPS64) += call_o32.o 9lib-$(CONFIG_64BIT) += call_o32.o
10 10
11EXTRA_AFLAGS := $(CFLAGS) 11EXTRA_AFLAGS := $(CFLAGS)
diff --git a/arch/mips/defconfig b/arch/mips/defconfig
index d55fe665926f..20f84b119b4c 100644
--- a/arch/mips/defconfig
+++ b/arch/mips/defconfig
@@ -4,9 +4,9 @@
4# Wed Jan 26 02:48:59 2005 4# Wed Jan 26 02:48:59 2005
5# 5#
6CONFIG_MIPS=y 6CONFIG_MIPS=y
7# CONFIG_MIPS64 is not set
8# CONFIG_64BIT is not set 7# CONFIG_64BIT is not set
9CONFIG_MIPS32=y 8# CONFIG_64BIT is not set
9CONFIG_32BIT=y
10 10
11# 11#
12# Code maturity level options 12# Code maturity level options
@@ -90,6 +90,7 @@ CONFIG_GENERIC_CALIBRATE_DELAY=y
90CONFIG_HAVE_DEC_LOCK=y 90CONFIG_HAVE_DEC_LOCK=y
91CONFIG_ARC=y 91CONFIG_ARC=y
92CONFIG_DMA_NONCOHERENT=y 92CONFIG_DMA_NONCOHERENT=y
93CONFIG_DMA_NEED_PCI_MAP_STATE=y
93# CONFIG_CPU_LITTLE_ENDIAN is not set 94# CONFIG_CPU_LITTLE_ENDIAN is not set
94CONFIG_IRQ_CPU=y 95CONFIG_IRQ_CPU=y
95CONFIG_SWAP_IO_SPACE=y 96CONFIG_SWAP_IO_SPACE=y
diff --git a/arch/mips/ite-boards/generic/it8172_setup.c b/arch/mips/ite-boards/generic/it8172_setup.c
index d808a67294b8..a5f6d84bc181 100644
--- a/arch/mips/ite-boards/generic/it8172_setup.c
+++ b/arch/mips/ite-boards/generic/it8172_setup.c
@@ -129,7 +129,7 @@ static void __init it8172_setup(void)
129 129
130 /* 130 /*
131 * IO/MEM resources. 131 * IO/MEM resources.
132 * 132 *
133 * revisit this area. 133 * revisit this area.
134 */ 134 */
135 set_io_port_base(KSEG1); 135 set_io_port_base(KSEG1);
diff --git a/arch/mips/ite-boards/generic/time.c b/arch/mips/ite-boards/generic/time.c
index 30a6c0d5fc50..f5d67ee21ac6 100644
--- a/arch/mips/ite-boards/generic/time.c
+++ b/arch/mips/ite-boards/generic/time.c
@@ -72,7 +72,7 @@ static inline int rtc_dm_binary(void) { return saved_control & RTC_DM_BINARY; }
72static inline unsigned char 72static inline unsigned char
73bin_to_hw(unsigned char c) 73bin_to_hw(unsigned char c)
74{ 74{
75 if (rtc_dm_binary()) 75 if (rtc_dm_binary())
76 return c; 76 return c;
77 else 77 else
78 return ((c/10) << 4) + (c%10); 78 return ((c/10) << 4) + (c%10);
@@ -91,9 +91,9 @@ hw_to_bin(unsigned char c)
91static inline unsigned char 91static inline unsigned char
92hour_bin_to_hw(unsigned char c) 92hour_bin_to_hw(unsigned char c)
93{ 93{
94 if (rtc_24h()) 94 if (rtc_24h())
95 return bin_to_hw(c); 95 return bin_to_hw(c);
96 if (c >= 12) 96 if (c >= 12)
97 return 0x80 | bin_to_hw((c==12)?12:c-12); /* 12 is 12pm */ 97 return 0x80 | bin_to_hw((c==12)?12:c-12); /* 12 is 12pm */
98 else 98 else
99 return bin_to_hw((c==0)?12:c); /* 0 is 12 AM, not 0 am */ 99 return bin_to_hw((c==0)?12:c); /* 0 is 12 AM, not 0 am */
@@ -105,9 +105,9 @@ hour_hw_to_bin(unsigned char c)
105 unsigned char tmp = hw_to_bin(c&0x3f); 105 unsigned char tmp = hw_to_bin(c&0x3f);
106 if (rtc_24h()) 106 if (rtc_24h())
107 return tmp; 107 return tmp;
108 if (c & 0x80) 108 if (c & 0x80)
109 return (tmp==12)?12:tmp+12; /* 12pm is 12, not 24 */ 109 return (tmp==12)?12:tmp+12; /* 12pm is 12, not 24 */
110 else 110 else
111 return (tmp==12)?0:tmp; /* 12am is 0 */ 111 return (tmp==12)?0:tmp; /* 12am is 0 */
112} 112}
113 113
@@ -145,7 +145,7 @@ static unsigned long __init cal_r4koff(void)
145 return (mips_hpt_frequency / HZ); 145 return (mips_hpt_frequency / HZ);
146} 146}
147 147
148static unsigned long 148static unsigned long
149it8172_rtc_get_time(void) 149it8172_rtc_get_time(void)
150{ 150{
151 unsigned int year, mon, day, hour, min, sec; 151 unsigned int year, mon, day, hour, min, sec;
@@ -166,12 +166,12 @@ it8172_rtc_get_time(void)
166 hour = hour_hw_to_bin(CMOS_READ(RTC_HOURS)); 166 hour = hour_hw_to_bin(CMOS_READ(RTC_HOURS));
167 day = hw_to_bin(CMOS_READ(RTC_DAY_OF_MONTH)); 167 day = hw_to_bin(CMOS_READ(RTC_DAY_OF_MONTH));
168 mon = hw_to_bin(CMOS_READ(RTC_MONTH)); 168 mon = hw_to_bin(CMOS_READ(RTC_MONTH));
169 year = hw_to_bin(CMOS_READ(RTC_YEAR)) + 169 year = hw_to_bin(CMOS_READ(RTC_YEAR)) +
170 hw_to_bin(*rtc_century_reg) * 100; 170 hw_to_bin(*rtc_century_reg) * 100;
171 171
172 /* restore interrupts */ 172 /* restore interrupts */
173 local_irq_restore(flags); 173 local_irq_restore(flags);
174 174
175 return mktime(year, mon, day, hour, min, sec); 175 return mktime(year, mon, day, hour, min, sec);
176} 176}
177 177
diff --git a/arch/mips/kernel/Makefile b/arch/mips/kernel/Makefile
index a0230ee0f7f4..d3303584fbd1 100644
--- a/arch/mips/kernel/Makefile
+++ b/arch/mips/kernel/Makefile
@@ -13,8 +13,8 @@ binfmt_irix-objs := irixelf.o irixinv.o irixioctl.o irixsig.o \
13 13
14ifdef CONFIG_MODULES 14ifdef CONFIG_MODULES
15obj-y += mips_ksyms.o module.o 15obj-y += mips_ksyms.o module.o
16obj-$(CONFIG_MIPS32) += module-elf32.o 16obj-$(CONFIG_32BIT) += module-elf32.o
17obj-$(CONFIG_MIPS64) += module-elf64.o 17obj-$(CONFIG_64BIT) += module-elf64.o
18endif 18endif
19 19
20obj-$(CONFIG_CPU_R3000) += r2300_fpu.o r2300_switch.o 20obj-$(CONFIG_CPU_R3000) += r2300_fpu.o r2300_switch.o
@@ -45,8 +45,8 @@ obj-$(CONFIG_IRQ_CPU_RM7K) += irq-rm7000.o
45obj-$(CONFIG_IRQ_CPU_RM9K) += irq-rm9000.o 45obj-$(CONFIG_IRQ_CPU_RM9K) += irq-rm9000.o
46obj-$(CONFIG_IRQ_MV64340) += irq-mv6434x.o 46obj-$(CONFIG_IRQ_MV64340) += irq-mv6434x.o
47 47
48obj-$(CONFIG_MIPS32) += scall32-o32.o 48obj-$(CONFIG_32BIT) += scall32-o32.o
49obj-$(CONFIG_MIPS64) += scall64-64.o 49obj-$(CONFIG_64BIT) += scall64-64.o
50obj-$(CONFIG_BINFMT_IRIX) += binfmt_irix.o 50obj-$(CONFIG_BINFMT_IRIX) += binfmt_irix.o
51obj-$(CONFIG_MIPS32_COMPAT) += ioctl32.o linux32.o signal32.o 51obj-$(CONFIG_MIPS32_COMPAT) += ioctl32.o linux32.o signal32.o
52obj-$(CONFIG_MIPS32_N32) += binfmt_elfn32.o scall64-n32.o signal_n32.o 52obj-$(CONFIG_MIPS32_N32) += binfmt_elfn32.o scall64-n32.o signal_n32.o
@@ -55,7 +55,7 @@ obj-$(CONFIG_MIPS32_O32) += binfmt_elfo32.o scall64-o32.o ptrace32.o
55obj-$(CONFIG_KGDB) += gdb-low.o gdb-stub.o 55obj-$(CONFIG_KGDB) += gdb-low.o gdb-stub.o
56obj-$(CONFIG_PROC_FS) += proc.o 56obj-$(CONFIG_PROC_FS) += proc.o
57 57
58obj-$(CONFIG_MIPS64) += cpu-bugs64.o 58obj-$(CONFIG_64BIT) += cpu-bugs64.o
59 59
60obj-$(CONFIG_GEN_RTC) += genrtc.o 60obj-$(CONFIG_GEN_RTC) += genrtc.o
61 61
diff --git a/arch/mips/kernel/binfmt_elfn32.c b/arch/mips/kernel/binfmt_elfn32.c
index ed47041f3030..6b645fbb1ddc 100644
--- a/arch/mips/kernel/binfmt_elfn32.c
+++ b/arch/mips/kernel/binfmt_elfn32.c
@@ -103,7 +103,7 @@ jiffies_to_compat_timeval(unsigned long jiffies, struct compat_timeval *value)
103 * Convert jiffies to nanoseconds and seperate with 103 * Convert jiffies to nanoseconds and seperate with
104 * one divide. 104 * one divide.
105 */ 105 */
106 u64 nsec = (u64)jiffies * TICK_NSEC; 106 u64 nsec = (u64)jiffies * TICK_NSEC;
107 value->tv_sec = div_long_long_rem(nsec, NSEC_PER_SEC, &value->tv_usec); 107 value->tv_sec = div_long_long_rem(nsec, NSEC_PER_SEC, &value->tv_usec);
108 value->tv_usec /= NSEC_PER_USEC; 108 value->tv_usec /= NSEC_PER_USEC;
109} 109}
diff --git a/arch/mips/kernel/binfmt_elfo32.c b/arch/mips/kernel/binfmt_elfo32.c
index ee21b18c37a8..b4075e99c452 100644
--- a/arch/mips/kernel/binfmt_elfo32.c
+++ b/arch/mips/kernel/binfmt_elfo32.c
@@ -105,7 +105,7 @@ jiffies_to_compat_timeval(unsigned long jiffies, struct compat_timeval *value)
105 * Convert jiffies to nanoseconds and seperate with 105 * Convert jiffies to nanoseconds and seperate with
106 * one divide. 106 * one divide.
107 */ 107 */
108 u64 nsec = (u64)jiffies * TICK_NSEC; 108 u64 nsec = (u64)jiffies * TICK_NSEC;
109 value->tv_sec = div_long_long_rem(nsec, NSEC_PER_SEC, &value->tv_usec); 109 value->tv_sec = div_long_long_rem(nsec, NSEC_PER_SEC, &value->tv_usec);
110 value->tv_usec /= NSEC_PER_USEC; 110 value->tv_usec /= NSEC_PER_USEC;
111} 111}
diff --git a/arch/mips/kernel/cpu-bugs64.c b/arch/mips/kernel/cpu-bugs64.c
index 11ebe5d4c446..47a087b6c11b 100644
--- a/arch/mips/kernel/cpu-bugs64.c
+++ b/arch/mips/kernel/cpu-bugs64.c
@@ -137,7 +137,7 @@ static inline void check_mult_sh(void)
137 for (i = 0; i < 8; i++) 137 for (i = 0; i < 8; i++)
138 if (v1[i] != w[i]) 138 if (v1[i] != w[i])
139 bug = 1; 139 bug = 1;
140 140
141 if (bug == 0) { 141 if (bug == 0) {
142 printk("no.\n"); 142 printk("no.\n");
143 return; 143 return;
@@ -149,7 +149,7 @@ static inline void check_mult_sh(void)
149 for (i = 0; i < 8; i++) 149 for (i = 0; i < 8; i++)
150 if (v2[i] != w[i]) 150 if (v2[i] != w[i])
151 fix = 0; 151 fix = 0;
152 152
153 if (fix == 1) { 153 if (fix == 1) {
154 printk("yes.\n"); 154 printk("yes.\n");
155 return; 155 return;
diff --git a/arch/mips/kernel/cpu-probe.c b/arch/mips/kernel/cpu-probe.c
index 4bb849582314..7685f8baf3f0 100644
--- a/arch/mips/kernel/cpu-probe.c
+++ b/arch/mips/kernel/cpu-probe.c
@@ -229,15 +229,9 @@ static inline void cpu_probe_legacy(struct cpuinfo_mips *c)
229 break; 229 break;
230 case PRID_IMP_VR41XX: 230 case PRID_IMP_VR41XX:
231 switch (c->processor_id & 0xf0) { 231 switch (c->processor_id & 0xf0) {
232#ifndef CONFIG_VR4181
233 case PRID_REV_VR4111: 232 case PRID_REV_VR4111:
234 c->cputype = CPU_VR4111; 233 c->cputype = CPU_VR4111;
235 break; 234 break;
236#else
237 case PRID_REV_VR4181:
238 c->cputype = CPU_VR4181;
239 break;
240#endif
241 case PRID_REV_VR4121: 235 case PRID_REV_VR4121:
242 c->cputype = CPU_VR4121; 236 c->cputype = CPU_VR4121;
243 break; 237 break;
diff --git a/arch/mips/kernel/gdb-low.S b/arch/mips/kernel/gdb-low.S
index ece6ddaf7011..512bedbfa7b9 100644
--- a/arch/mips/kernel/gdb-low.S
+++ b/arch/mips/kernel/gdb-low.S
@@ -13,13 +13,13 @@
13#include <asm/stackframe.h> 13#include <asm/stackframe.h>
14#include <asm/gdb-stub.h> 14#include <asm/gdb-stub.h>
15 15
16#ifdef CONFIG_MIPS32 16#ifdef CONFIG_32BIT
17#define DMFC0 mfc0 17#define DMFC0 mfc0
18#define DMTC0 mtc0 18#define DMTC0 mtc0
19#define LDC1 lwc1 19#define LDC1 lwc1
20#define SDC1 lwc1 20#define SDC1 lwc1
21#endif 21#endif
22#ifdef CONFIG_MIPS64 22#ifdef CONFIG_64BIT
23#define DMFC0 dmfc0 23#define DMFC0 dmfc0
24#define DMTC0 dmtc0 24#define DMTC0 dmtc0
25#define LDC1 ldc1 25#define LDC1 ldc1
diff --git a/arch/mips/kernel/gdb-stub.c b/arch/mips/kernel/gdb-stub.c
index 269889302a27..d3fd1ab14274 100644
--- a/arch/mips/kernel/gdb-stub.c
+++ b/arch/mips/kernel/gdb-stub.c
@@ -687,8 +687,8 @@ void handle_exception (struct gdb_regs *regs)
687 * acquire the big kgdb spinlock 687 * acquire the big kgdb spinlock
688 */ 688 */
689 if (!spin_trylock(&kgdb_lock)) { 689 if (!spin_trylock(&kgdb_lock)) {
690 /* 690 /*
691 * some other CPU has the lock, we should go back to 691 * some other CPU has the lock, we should go back to
692 * receive the gdb_wait IPC 692 * receive the gdb_wait IPC
693 */ 693 */
694 return; 694 return;
@@ -703,7 +703,7 @@ void handle_exception (struct gdb_regs *regs)
703 async_bp.addr = 0; 703 async_bp.addr = 0;
704 } 704 }
705 705
706 /* 706 /*
707 * acquire the CPU spinlocks 707 * acquire the CPU spinlocks
708 */ 708 */
709 for (i = num_online_cpus()-1; i >= 0; i--) 709 for (i = num_online_cpus()-1; i >= 0; i--)
@@ -894,7 +894,7 @@ void handle_exception (struct gdb_regs *regs)
894 ptr = &input_buffer[1]; 894 ptr = &input_buffer[1];
895 if (hexToLong(&ptr, &addr)) 895 if (hexToLong(&ptr, &addr))
896 regs->cp0_epc = addr; 896 regs->cp0_epc = addr;
897 897
898 goto exit_kgdb_exception; 898 goto exit_kgdb_exception;
899 break; 899 break;
900 900
@@ -1001,7 +1001,7 @@ void breakpoint(void)
1001 return; 1001 return;
1002 1002
1003 __asm__ __volatile__( 1003 __asm__ __volatile__(
1004 ".globl breakinst\n\t" 1004 ".globl breakinst\n\t"
1005 ".set\tnoreorder\n\t" 1005 ".set\tnoreorder\n\t"
1006 "nop\n" 1006 "nop\n"
1007 "breakinst:\tbreak\n\t" 1007 "breakinst:\tbreak\n\t"
@@ -1014,7 +1014,7 @@ void breakpoint(void)
1014void async_breakpoint(void) 1014void async_breakpoint(void)
1015{ 1015{
1016 __asm__ __volatile__( 1016 __asm__ __volatile__(
1017 ".globl async_breakinst\n\t" 1017 ".globl async_breakinst\n\t"
1018 ".set\tnoreorder\n\t" 1018 ".set\tnoreorder\n\t"
1019 "nop\n" 1019 "nop\n"
1020 "async_breakinst:\tbreak\n\t" 1020 "async_breakinst:\tbreak\n\t"
diff --git a/arch/mips/kernel/genex.S b/arch/mips/kernel/genex.S
index a5b0a389b063..e7f6c1b90806 100644
--- a/arch/mips/kernel/genex.S
+++ b/arch/mips/kernel/genex.S
@@ -54,7 +54,7 @@ NESTED(except_vec3_generic, 0, sp)
54#endif 54#endif
55 mfc0 k1, CP0_CAUSE 55 mfc0 k1, CP0_CAUSE
56 andi k1, k1, 0x7c 56 andi k1, k1, 0x7c
57#ifdef CONFIG_MIPS64 57#ifdef CONFIG_64BIT
58 dsll k1, k1, 1 58 dsll k1, k1, 1
59#endif 59#endif
60 PTR_L k0, exception_handlers(k1) 60 PTR_L k0, exception_handlers(k1)
@@ -81,7 +81,7 @@ NESTED(except_vec3_r4000, 0, sp)
81 beq k1, k0, handle_vced 81 beq k1, k0, handle_vced
82 li k0, 14<<2 82 li k0, 14<<2
83 beq k1, k0, handle_vcei 83 beq k1, k0, handle_vcei
84#ifdef CONFIG_MIPS64 84#ifdef CONFIG_64BIT
85 dsll k1, k1, 1 85 dsll k1, k1, 1
86#endif 86#endif
87 .set pop 87 .set pop
@@ -244,12 +244,12 @@ NESTED(nmi_handler, PT_SIZE, sp)
244 start with an n and gas will believe \n is ok ... */ 244 start with an n and gas will believe \n is ok ... */
245 .macro __BUILD_verbose nexception 245 .macro __BUILD_verbose nexception
246 LONG_L a1, PT_EPC(sp) 246 LONG_L a1, PT_EPC(sp)
247#if CONFIG_MIPS32 247#ifdef CONFIG_32BIT
248 PRINT("Got \nexception at %08lx\012") 248 PRINT("Got \nexception at %08lx\012")
249#endif 249#endif
250#if CONFIG_MIPS64 250#ifdef CONFIG_64BIT
251 PRINT("Got \nexception at %016lx\012") 251 PRINT("Got \nexception at %016lx\012")
252#endif 252#endif
253 .endm 253 .endm
254 254
255 .macro __BUILD_count exception 255 .macro __BUILD_count exception
@@ -293,7 +293,7 @@ NESTED(nmi_handler, PT_SIZE, sp)
293 BUILD_HANDLER mcheck mcheck cli verbose /* #24 */ 293 BUILD_HANDLER mcheck mcheck cli verbose /* #24 */
294 BUILD_HANDLER reserved reserved sti verbose /* others */ 294 BUILD_HANDLER reserved reserved sti verbose /* others */
295 295
296#ifdef CONFIG_MIPS64 296#ifdef CONFIG_64BIT
297/* A temporary overflow handler used by check_daddi(). */ 297/* A temporary overflow handler used by check_daddi(). */
298 298
299 __INIT 299 __INIT
diff --git a/arch/mips/kernel/head.S b/arch/mips/kernel/head.S
index a64e87d22014..2a1b45d66f04 100644
--- a/arch/mips/kernel/head.S
+++ b/arch/mips/kernel/head.S
@@ -107,7 +107,7 @@
107 .endm 107 .endm
108 108
109 .macro setup_c0_status_pri 109 .macro setup_c0_status_pri
110#ifdef CONFIG_MIPS64 110#ifdef CONFIG_64BIT
111 setup_c0_status ST0_KX 0 111 setup_c0_status ST0_KX 0
112#else 112#else
113 setup_c0_status 0 0 113 setup_c0_status 0 0
@@ -115,7 +115,7 @@
115 .endm 115 .endm
116 116
117 .macro setup_c0_status_sec 117 .macro setup_c0_status_sec
118#ifdef CONFIG_MIPS64 118#ifdef CONFIG_64BIT
119 setup_c0_status ST0_KX ST0_BEV 119 setup_c0_status ST0_KX ST0_BEV
120#else 120#else
121 setup_c0_status 0 ST0_BEV 121 setup_c0_status 0 ST0_BEV
@@ -215,7 +215,7 @@ NESTED(smp_bootstrap, 16, sp)
215 * slightly different layout ... 215 * slightly different layout ...
216 */ 216 */
217 page swapper_pg_dir, _PGD_ORDER 217 page swapper_pg_dir, _PGD_ORDER
218#ifdef CONFIG_MIPS64 218#ifdef CONFIG_64BIT
219 page invalid_pmd_table, _PMD_ORDER 219 page invalid_pmd_table, _PMD_ORDER
220#endif 220#endif
221 page invalid_pte_table, _PTE_ORDER 221 page invalid_pte_table, _PTE_ORDER
diff --git a/arch/mips/kernel/ioctl32.c b/arch/mips/kernel/ioctl32.c
index 519cd5d0aebb..c069719ff0d8 100644
--- a/arch/mips/kernel/ioctl32.c
+++ b/arch/mips/kernel/ioctl32.c
@@ -27,7 +27,7 @@ long sys_ioctl(unsigned int fd, unsigned int cmd, unsigned long arg);
27#include "compat_ioctl.c" 27#include "compat_ioctl.c"
28 28
29typedef int (* ioctl32_handler_t)(unsigned int, unsigned int, unsigned long, struct file *); 29typedef int (* ioctl32_handler_t)(unsigned int, unsigned int, unsigned long, struct file *);
30 30
31#define COMPATIBLE_IOCTL(cmd) HANDLE_IOCTL((cmd),sys_ioctl) 31#define COMPATIBLE_IOCTL(cmd) HANDLE_IOCTL((cmd),sys_ioctl)
32#define HANDLE_IOCTL(cmd,handler) { (cmd), (ioctl32_handler_t)(handler), NULL }, 32#define HANDLE_IOCTL(cmd,handler) { (cmd), (ioctl32_handler_t)(handler), NULL },
33#define IOCTL_TABLE_START \ 33#define IOCTL_TABLE_START \
diff --git a/arch/mips/kernel/irixsig.c b/arch/mips/kernel/irixsig.c
index 3f956f809fa4..4c114ae21793 100644
--- a/arch/mips/kernel/irixsig.c
+++ b/arch/mips/kernel/irixsig.c
@@ -155,13 +155,12 @@ static inline void handle_signal(unsigned long sig, siginfo_t *info,
155 else 155 else
156 setup_irix_frame(ka, regs, sig, oldset); 156 setup_irix_frame(ka, regs, sig, oldset);
157 157
158 if (!(ka->sa.sa_flags & SA_NODEFER)) { 158 spin_lock_irq(&current->sighand->siglock);
159 spin_lock_irq(&current->sighand->siglock); 159 sigorsets(&current->blocked,&current->blocked,&ka->sa.sa_mask);
160 sigorsets(&current->blocked,&current->blocked,&ka->sa.sa_mask); 160 if (!(ka->sa.sa_flags & SA_NODEFER))
161 sigaddset(&current->blocked,sig); 161 sigaddset(&current->blocked,sig);
162 recalc_sigpending(); 162 recalc_sigpending();
163 spin_unlock_irq(&current->sighand->siglock); 163 spin_unlock_irq(&current->sighand->siglock);
164 }
165} 164}
166 165
167asmlinkage int do_irix_signal(sigset_t *oldset, struct pt_regs *regs) 166asmlinkage int do_irix_signal(sigset_t *oldset, struct pt_regs *regs)
@@ -178,7 +177,7 @@ asmlinkage int do_irix_signal(sigset_t *oldset, struct pt_regs *regs)
178 if (!user_mode(regs)) 177 if (!user_mode(regs))
179 return 1; 178 return 1;
180 179
181 if (try_to_freeze(0)) 180 if (try_to_freeze())
182 goto no_signal; 181 goto no_signal;
183 182
184 if (!oldset) 183 if (!oldset)
diff --git a/arch/mips/kernel/irq.c b/arch/mips/kernel/irq.c
index 441157a1f994..7d93992e462c 100644
--- a/arch/mips/kernel/irq.c
+++ b/arch/mips/kernel/irq.c
@@ -77,7 +77,7 @@ int show_interrupts(struct seq_file *p, void *v)
77 if (i < NR_IRQS) { 77 if (i < NR_IRQS) {
78 spin_lock_irqsave(&irq_desc[i].lock, flags); 78 spin_lock_irqsave(&irq_desc[i].lock, flags);
79 action = irq_desc[i].action; 79 action = irq_desc[i].action;
80 if (!action) 80 if (!action)
81 goto skip; 81 goto skip;
82 seq_printf(p, "%3d: ",i); 82 seq_printf(p, "%3d: ",i);
83#ifndef CONFIG_SMP 83#ifndef CONFIG_SMP
diff --git a/arch/mips/kernel/linux32.c b/arch/mips/kernel/linux32.c
index 993abc868e54..4613219dd73e 100644
--- a/arch/mips/kernel/linux32.c
+++ b/arch/mips/kernel/linux32.c
@@ -313,7 +313,7 @@ asmlinkage int sys32_sysinfo(struct sysinfo32 *info)
313 struct sysinfo s; 313 struct sysinfo s;
314 int ret, err; 314 int ret, err;
315 mm_segment_t old_fs = get_fs (); 315 mm_segment_t old_fs = get_fs ();
316 316
317 set_fs (KERNEL_DS); 317 set_fs (KERNEL_DS);
318 ret = sys_sysinfo(&s); 318 ret = sys_sysinfo(&s);
319 set_fs (old_fs); 319 set_fs (old_fs);
@@ -560,7 +560,7 @@ struct ipc64_perm32 {
560 compat_gid_t gid; 560 compat_gid_t gid;
561 compat_uid_t cuid; 561 compat_uid_t cuid;
562 compat_gid_t cgid; 562 compat_gid_t cgid;
563 compat_mode_t mode; 563 compat_mode_t mode;
564 unsigned short seq; 564 unsigned short seq;
565 unsigned short __pad1; 565 unsigned short __pad1;
566 unsigned int __unused1; 566 unsigned int __unused1;
@@ -1334,17 +1334,17 @@ asmlinkage int sys32_sendfile(int out_fd, int in_fd, compat_off_t *offset,
1334 mm_segment_t old_fs = get_fs(); 1334 mm_segment_t old_fs = get_fs();
1335 int ret; 1335 int ret;
1336 off_t of; 1336 off_t of;
1337 1337
1338 if (offset && get_user(of, offset)) 1338 if (offset && get_user(of, offset))
1339 return -EFAULT; 1339 return -EFAULT;
1340 1340
1341 set_fs(KERNEL_DS); 1341 set_fs(KERNEL_DS);
1342 ret = sys_sendfile(out_fd, in_fd, offset ? &of : NULL, count); 1342 ret = sys_sendfile(out_fd, in_fd, offset ? &of : NULL, count);
1343 set_fs(old_fs); 1343 set_fs(old_fs);
1344 1344
1345 if (offset && put_user(of, offset)) 1345 if (offset && put_user(of, offset))
1346 return -EFAULT; 1346 return -EFAULT;
1347 1347
1348 return ret; 1348 return ret;
1349} 1349}
1350 1350
@@ -1362,11 +1362,11 @@ static unsigned char socketcall_nargs[18]={AL(0),AL(3),AL(3),AL(3),AL(2),AL(3),
1362#undef AL 1362#undef AL
1363 1363
1364/* 1364/*
1365 * System call vectors. 1365 * System call vectors.
1366 * 1366 *
1367 * Argument checking cleaned up. Saved 20% in size. 1367 * Argument checking cleaned up. Saved 20% in size.
1368 * This function doesn't need to set the kernel lock because 1368 * This function doesn't need to set the kernel lock because
1369 * it is set by the callees. 1369 * it is set by the callees.
1370 */ 1370 */
1371 1371
1372asmlinkage long sys32_socketcall(int call, unsigned int *args32) 1372asmlinkage long sys32_socketcall(int call, unsigned int *args32)
@@ -1402,11 +1402,11 @@ asmlinkage long sys32_socketcall(int call, unsigned int *args32)
1402 /* copy_from_user should be SMP safe. */ 1402 /* copy_from_user should be SMP safe. */
1403 if (copy_from_user(a, args32, socketcall_nargs[call])) 1403 if (copy_from_user(a, args32, socketcall_nargs[call]))
1404 return -EFAULT; 1404 return -EFAULT;
1405 1405
1406 a0=a[0]; 1406 a0=a[0];
1407 a1=a[1]; 1407 a1=a[1];
1408 1408
1409 switch(call) 1409 switch(call)
1410 { 1410 {
1411 case SYS_SOCKET: 1411 case SYS_SOCKET:
1412 err = sys_socket(a0,a1,a[2]); 1412 err = sys_socket(a0,a1,a[2]);
diff --git a/arch/mips/kernel/mips_ksyms.c b/arch/mips/kernel/mips_ksyms.c
index eed29fc9dc82..86e42c633f73 100644
--- a/arch/mips/kernel/mips_ksyms.c
+++ b/arch/mips/kernel/mips_ksyms.c
@@ -35,7 +35,7 @@ EXPORT_SYMBOL(memcpy);
35EXPORT_SYMBOL(memmove); 35EXPORT_SYMBOL(memmove);
36EXPORT_SYMBOL(strcat); 36EXPORT_SYMBOL(strcat);
37EXPORT_SYMBOL(strchr); 37EXPORT_SYMBOL(strchr);
38#ifdef CONFIG_MIPS64 38#ifdef CONFIG_64BIT
39EXPORT_SYMBOL(strncmp); 39EXPORT_SYMBOL(strncmp);
40#endif 40#endif
41EXPORT_SYMBOL(strlen); 41EXPORT_SYMBOL(strlen);
diff --git a/arch/mips/kernel/process.c b/arch/mips/kernel/process.c
index 6e70c42c2058..e4f2f8011387 100644
--- a/arch/mips/kernel/process.c
+++ b/arch/mips/kernel/process.c
@@ -70,7 +70,7 @@ void start_thread(struct pt_regs * regs, unsigned long pc, unsigned long sp)
70 70
71 /* New thread loses kernel privileges. */ 71 /* New thread loses kernel privileges. */
72 status = regs->cp0_status & ~(ST0_CU0|ST0_CU1|KU_MASK); 72 status = regs->cp0_status & ~(ST0_CU0|ST0_CU1|KU_MASK);
73#ifdef CONFIG_MIPS64 73#ifdef CONFIG_64BIT
74 status &= ~ST0_FR; 74 status &= ~ST0_FR;
75 status |= (current->thread.mflags & MF_32BIT_REGS) ? 0 : ST0_FR; 75 status |= (current->thread.mflags & MF_32BIT_REGS) ? 0 : ST0_FR;
76#endif 76#endif
@@ -236,10 +236,10 @@ static int __init get_frame_info(struct mips_frame_info *info, void *func)
236 break; 236 break;
237 237
238 if ( 238 if (
239#ifdef CONFIG_MIPS32 239#ifdef CONFIG_32BIT
240 ip->i_format.opcode == sw_op && 240 ip->i_format.opcode == sw_op &&
241#endif 241#endif
242#ifdef CONFIG_MIPS64 242#ifdef CONFIG_64BIT
243 ip->i_format.opcode == sd_op && 243 ip->i_format.opcode == sd_op &&
244#endif 244#endif
245 ip->i_format.rs == 29) 245 ip->i_format.rs == 29)
@@ -353,7 +353,7 @@ schedule_timeout_caller:
353 353
354out: 354out:
355 355
356#ifdef CONFIG_MIPS64 356#ifdef CONFIG_64BIT
357 if (current->thread.mflags & MF_32BIT_REGS) /* Kludge for 32-bit ps */ 357 if (current->thread.mflags & MF_32BIT_REGS) /* Kludge for 32-bit ps */
358 pc &= 0xffffffffUL; 358 pc &= 0xffffffffUL;
359#endif 359#endif
diff --git a/arch/mips/kernel/ptrace.c b/arch/mips/kernel/ptrace.c
index 92e70ca3bff9..0b571a5b4b83 100644
--- a/arch/mips/kernel/ptrace.c
+++ b/arch/mips/kernel/ptrace.c
@@ -124,7 +124,7 @@ asmlinkage int sys_ptrace(long request, long pid, long addr, long data)
124 if (tsk_used_math(child)) { 124 if (tsk_used_math(child)) {
125 fpureg_t *fregs = get_fpu_regs(child); 125 fpureg_t *fregs = get_fpu_regs(child);
126 126
127#ifdef CONFIG_MIPS32 127#ifdef CONFIG_32BIT
128 /* 128 /*
129 * The odd registers are actually the high 129 * The odd registers are actually the high
130 * order bits of the values stored in the even 130 * order bits of the values stored in the even
@@ -135,7 +135,7 @@ asmlinkage int sys_ptrace(long request, long pid, long addr, long data)
135 else 135 else
136 tmp = (unsigned long) (fregs[(addr - 32)] & 0xffffffff); 136 tmp = (unsigned long) (fregs[(addr - 32)] & 0xffffffff);
137#endif 137#endif
138#ifdef CONFIG_MIPS64 138#ifdef CONFIG_64BIT
139 tmp = fregs[addr - FPR_BASE]; 139 tmp = fregs[addr - FPR_BASE];
140#endif 140#endif
141 } else { 141 } else {
@@ -213,7 +213,7 @@ asmlinkage int sys_ptrace(long request, long pid, long addr, long data)
213 sizeof(child->thread.fpu.hard)); 213 sizeof(child->thread.fpu.hard));
214 child->thread.fpu.hard.fcr31 = 0; 214 child->thread.fpu.hard.fcr31 = 0;
215 } 215 }
216#ifdef CONFIG_MIPS32 216#ifdef CONFIG_32BIT
217 /* 217 /*
218 * The odd registers are actually the high order bits 218 * The odd registers are actually the high order bits
219 * of the values stored in the even registers - unless 219 * of the values stored in the even registers - unless
@@ -227,7 +227,7 @@ asmlinkage int sys_ptrace(long request, long pid, long addr, long data)
227 fregs[addr - FPR_BASE] |= data; 227 fregs[addr - FPR_BASE] |= data;
228 } 228 }
229#endif 229#endif
230#ifdef CONFIG_MIPS64 230#ifdef CONFIG_64BIT
231 fregs[addr - FPR_BASE] = data; 231 fregs[addr - FPR_BASE] = data;
232#endif 232#endif
233 break; 233 break;
@@ -304,14 +304,14 @@ out:
304static inline int audit_arch(void) 304static inline int audit_arch(void)
305{ 305{
306#ifdef CONFIG_CPU_LITTLE_ENDIAN 306#ifdef CONFIG_CPU_LITTLE_ENDIAN
307#ifdef CONFIG_MIPS64 307#ifdef CONFIG_64BIT
308 if (!(current->thread.mflags & MF_32BIT_REGS)) 308 if (!(current->thread.mflags & MF_32BIT_REGS))
309 return AUDIT_ARCH_MIPSEL64; 309 return AUDIT_ARCH_MIPSEL64;
310#endif /* MIPS64 */ 310#endif /* MIPS64 */
311 return AUDIT_ARCH_MIPSEL; 311 return AUDIT_ARCH_MIPSEL;
312 312
313#else /* big endian... */ 313#else /* big endian... */
314#ifdef CONFIG_MIPS64 314#ifdef CONFIG_64BIT
315 if (!(current->thread.mflags & MF_32BIT_REGS)) 315 if (!(current->thread.mflags & MF_32BIT_REGS))
316 return AUDIT_ARCH_MIPS64; 316 return AUDIT_ARCH_MIPS64;
317#endif /* MIPS64 */ 317#endif /* MIPS64 */
diff --git a/arch/mips/kernel/r2300_switch.S b/arch/mips/kernel/r2300_switch.S
index 243e7b629af6..f10019640ee9 100644
--- a/arch/mips/kernel/r2300_switch.S
+++ b/arch/mips/kernel/r2300_switch.S
@@ -35,7 +35,7 @@
35/* 35/*
36 * FPU context is saved iff the process has used it's FPU in the current 36 * FPU context is saved iff the process has used it's FPU in the current
37 * time slice as indicated by TIF_USEDFPU. In any case, the CU1 bit for user 37 * time slice as indicated by TIF_USEDFPU. In any case, the CU1 bit for user
38 * space STATUS register should be 0, so that a process *always* starts its 38 * space STATUS register should be 0, so that a process *always* starts its
39 * userland with FPU disabled after each context switch. 39 * userland with FPU disabled after each context switch.
40 * 40 *
41 * FPU will be enabled as soon as the process accesses FPU again, through 41 * FPU will be enabled as soon as the process accesses FPU again, through
@@ -55,7 +55,7 @@ LEAF(resume)
55 cpu_save_nonscratch a0 55 cpu_save_nonscratch a0
56 sw ra, THREAD_REG31(a0) 56 sw ra, THREAD_REG31(a0)
57 57
58 /* 58 /*
59 * check if we need to save FPU registers 59 * check if we need to save FPU registers
60 */ 60 */
61 lw t3, TASK_THREAD_INFO(a0) 61 lw t3, TASK_THREAD_INFO(a0)
diff --git a/arch/mips/kernel/r4k_fpu.S b/arch/mips/kernel/r4k_fpu.S
index ebb643d8d14c..aba665bcb386 100644
--- a/arch/mips/kernel/r4k_fpu.S
+++ b/arch/mips/kernel/r4k_fpu.S
@@ -36,7 +36,7 @@
36LEAF(_save_fp_context) 36LEAF(_save_fp_context)
37 cfc1 t1, fcr31 37 cfc1 t1, fcr31
38 38
39#ifdef CONFIG_MIPS64 39#ifdef CONFIG_64BIT
40 /* Store the 16 odd double precision registers */ 40 /* Store the 16 odd double precision registers */
41 EX sdc1 $f1, SC_FPREGS+8(a0) 41 EX sdc1 $f1, SC_FPREGS+8(a0)
42 EX sdc1 $f3, SC_FPREGS+24(a0) 42 EX sdc1 $f3, SC_FPREGS+24(a0)
@@ -118,7 +118,7 @@ LEAF(_save_fp_context32)
118 */ 118 */
119LEAF(_restore_fp_context) 119LEAF(_restore_fp_context)
120 EX lw t0, SC_FPC_CSR(a0) 120 EX lw t0, SC_FPC_CSR(a0)
121#ifdef CONFIG_MIPS64 121#ifdef CONFIG_64BIT
122 EX ldc1 $f1, SC_FPREGS+8(a0) 122 EX ldc1 $f1, SC_FPREGS+8(a0)
123 EX ldc1 $f3, SC_FPREGS+24(a0) 123 EX ldc1 $f3, SC_FPREGS+24(a0)
124 EX ldc1 $f5, SC_FPREGS+40(a0) 124 EX ldc1 $f5, SC_FPREGS+40(a0)
diff --git a/arch/mips/kernel/r4k_switch.S b/arch/mips/kernel/r4k_switch.S
index 1fc3b2eb12bd..e02b7722ccb8 100644
--- a/arch/mips/kernel/r4k_switch.S
+++ b/arch/mips/kernel/r4k_switch.S
@@ -33,7 +33,7 @@
33/* 33/*
34 * FPU context is saved iff the process has used it's FPU in the current 34 * FPU context is saved iff the process has used it's FPU in the current
35 * time slice as indicated by _TIF_USEDFPU. In any case, the CU1 bit for user 35 * time slice as indicated by _TIF_USEDFPU. In any case, the CU1 bit for user
36 * space STATUS register should be 0, so that a process *always* starts its 36 * space STATUS register should be 0, so that a process *always* starts its
37 * userland with FPU disabled after each context switch. 37 * userland with FPU disabled after each context switch.
38 * 38 *
39 * FPU will be enabled as soon as the process accesses FPU again, through 39 * FPU will be enabled as soon as the process accesses FPU again, through
@@ -105,7 +105,7 @@
105 * Save a thread's fp context. 105 * Save a thread's fp context.
106 */ 106 */
107LEAF(_save_fp) 107LEAF(_save_fp)
108#ifdef CONFIG_MIPS64 108#ifdef CONFIG_64BIT
109 mfc0 t1, CP0_STATUS 109 mfc0 t1, CP0_STATUS
110#endif 110#endif
111 fpu_save_double a0 t1 t0 t2 # clobbers t1 111 fpu_save_double a0 t1 t0 t2 # clobbers t1
@@ -142,7 +142,7 @@ LEAF(_init_fpu)
142 142
143 li t1, -1 # SNaN 143 li t1, -1 # SNaN
144 144
145#ifdef CONFIG_MIPS64 145#ifdef CONFIG_64BIT
146 sll t0, t0, 5 146 sll t0, t0, 5
147 bgez t0, 1f # 16 / 32 register mode? 147 bgez t0, 1f # 16 / 32 register mode?
148 148
@@ -164,7 +164,7 @@ LEAF(_init_fpu)
164 dmtc1 t1, $f31 164 dmtc1 t1, $f31
1651: 1651:
166#endif 166#endif
167 167
168#ifdef CONFIG_CPU_MIPS32 168#ifdef CONFIG_CPU_MIPS32
169 mtc1 t1, $f0 169 mtc1 t1, $f0
170 mtc1 t1, $f1 170 mtc1 t1, $f1
diff --git a/arch/mips/kernel/reset.c b/arch/mips/kernel/reset.c
index 7e0a9821931a..ae2ba67b7ef6 100644
--- a/arch/mips/kernel/reset.c
+++ b/arch/mips/kernel/reset.c
@@ -26,18 +26,13 @@ void machine_restart(char *command)
26 _machine_restart(command); 26 _machine_restart(command);
27} 27}
28 28
29EXPORT_SYMBOL(machine_restart);
30
31void machine_halt(void) 29void machine_halt(void)
32{ 30{
33 _machine_halt(); 31 _machine_halt();
34} 32}
35 33
36EXPORT_SYMBOL(machine_halt);
37
38void machine_power_off(void) 34void machine_power_off(void)
39{ 35{
40 _machine_power_off(); 36 _machine_power_off();
41} 37}
42 38
43EXPORT_SYMBOL(machine_power_off);
diff --git a/arch/mips/kernel/setup.c b/arch/mips/kernel/setup.c
index 3a240e3e004c..12b531c295c4 100644
--- a/arch/mips/kernel/setup.c
+++ b/arch/mips/kernel/setup.c
@@ -241,7 +241,7 @@ static inline int parse_rd_cmdline(unsigned long* rd_start, unsigned long* rd_en
241 if (*tmp) 241 if (*tmp)
242 strcat(command_line, tmp); 242 strcat(command_line, tmp);
243 243
244#ifdef CONFIG_MIPS64 244#ifdef CONFIG_64BIT
245 /* HACK: Guess if the sign extension was forgotten */ 245 /* HACK: Guess if the sign extension was forgotten */
246 if (start > 0x0000000080000000 && start < 0x00000000ffffffff) 246 if (start > 0x0000000080000000 && start < 0x00000000ffffffff)
247 start |= 0xffffffff00000000; 247 start |= 0xffffffff00000000;
@@ -446,7 +446,7 @@ static inline void resource_init(void)
446{ 446{
447 int i; 447 int i;
448 448
449#if defined(CONFIG_MIPS64) && !defined(CONFIG_BUILD_ELF64) 449#if defined(CONFIG_64BIT) && !defined(CONFIG_BUILD_ELF64)
450 /* 450 /*
451 * The 64bit code in 32bit object format trick can't represent 451 * The 64bit code in 32bit object format trick can't represent
452 * 64bit wide relocations for linker script symbols. 452 * 64bit wide relocations for linker script symbols.
diff --git a/arch/mips/kernel/signal.c b/arch/mips/kernel/signal.c
index 65ee15396ffd..0209c1dd1429 100644
--- a/arch/mips/kernel/signal.c
+++ b/arch/mips/kernel/signal.c
@@ -425,13 +425,12 @@ static inline void handle_signal(unsigned long sig, siginfo_t *info,
425 setup_frame(ka, regs, sig, oldset); 425 setup_frame(ka, regs, sig, oldset);
426#endif 426#endif
427 427
428 if (!(ka->sa.sa_flags & SA_NODEFER)) { 428 spin_lock_irq(&current->sighand->siglock);
429 spin_lock_irq(&current->sighand->siglock); 429 sigorsets(&current->blocked,&current->blocked,&ka->sa.sa_mask);
430 sigorsets(&current->blocked,&current->blocked,&ka->sa.sa_mask); 430 if (!(ka->sa.sa_flags & SA_NODEFER))
431 sigaddset(&current->blocked,sig); 431 sigaddset(&current->blocked,sig);
432 recalc_sigpending(); 432 recalc_sigpending();
433 spin_unlock_irq(&current->sighand->siglock); 433 spin_unlock_irq(&current->sighand->siglock);
434 }
435} 434}
436 435
437extern int do_signal32(sigset_t *oldset, struct pt_regs *regs); 436extern int do_signal32(sigset_t *oldset, struct pt_regs *regs);
diff --git a/arch/mips/kernel/signal32.c b/arch/mips/kernel/signal32.c
index 1f3b19124c01..8ddfbd8d425a 100644
--- a/arch/mips/kernel/signal32.c
+++ b/arch/mips/kernel/signal32.c
@@ -558,7 +558,7 @@ static inline int setup_sigcontext32(struct pt_regs *regs,
558 if (!used_math()) 558 if (!used_math())
559 goto out; 559 goto out;
560 560
561 /* 561 /*
562 * Save FPU state to signal context. Signal handler will "inherit" 562 * Save FPU state to signal context. Signal handler will "inherit"
563 * current FPU state. 563 * current FPU state.
564 */ 564 */
@@ -751,13 +751,12 @@ static inline void handle_signal(unsigned long sig, siginfo_t *info,
751 else 751 else
752 setup_frame(ka, regs, sig, oldset); 752 setup_frame(ka, regs, sig, oldset);
753 753
754 if (!(ka->sa.sa_flags & SA_NODEFER)) { 754 spin_lock_irq(&current->sighand->siglock);
755 spin_lock_irq(&current->sighand->siglock); 755 sigorsets(&current->blocked,&current->blocked,&ka->sa.sa_mask);
756 sigorsets(&current->blocked,&current->blocked,&ka->sa.sa_mask); 756 if (!(ka->sa.sa_flags & SA_NODEFER))
757 sigaddset(&current->blocked,sig); 757 sigaddset(&current->blocked,sig);
758 recalc_sigpending(); 758 recalc_sigpending();
759 spin_unlock_irq(&current->sighand->siglock); 759 spin_unlock_irq(&current->sighand->siglock);
760 }
761} 760}
762 761
763int do_signal32(sigset_t *oldset, struct pt_regs *regs) 762int do_signal32(sigset_t *oldset, struct pt_regs *regs)
@@ -774,7 +773,7 @@ int do_signal32(sigset_t *oldset, struct pt_regs *regs)
774 if (!user_mode(regs)) 773 if (!user_mode(regs))
775 return 1; 774 return 1;
776 775
777 if (try_to_freeze(0)) 776 if (try_to_freeze())
778 goto no_signal; 777 goto no_signal;
779 778
780 if (!oldset) 779 if (!oldset)
diff --git a/arch/mips/kernel/traps.c b/arch/mips/kernel/traps.c
index 56c36e42e0a6..a53b1ed7b386 100644
--- a/arch/mips/kernel/traps.c
+++ b/arch/mips/kernel/traps.c
@@ -924,7 +924,7 @@ void __init per_cpu_trap_init(void)
924 * flag that some firmware may have left set and the TS bit (for 924 * flag that some firmware may have left set and the TS bit (for
925 * IP27). Set XX for ISA IV code to work. 925 * IP27). Set XX for ISA IV code to work.
926 */ 926 */
927#ifdef CONFIG_MIPS64 927#ifdef CONFIG_64BIT
928 status_set |= ST0_FR|ST0_KX|ST0_SX|ST0_UX; 928 status_set |= ST0_FR|ST0_KX|ST0_SX|ST0_UX;
929#endif 929#endif
930 if (current_cpu_data.isa_level == MIPS_CPU_ISA_IV) 930 if (current_cpu_data.isa_level == MIPS_CPU_ISA_IV)
diff --git a/arch/mips/kernel/unaligned.c b/arch/mips/kernel/unaligned.c
index 3f24a1d45865..36c5212e0928 100644
--- a/arch/mips/kernel/unaligned.c
+++ b/arch/mips/kernel/unaligned.c
@@ -240,7 +240,7 @@ static inline int emulate_load_store_insn(struct pt_regs *regs,
240 break; 240 break;
241 241
242 case lwu_op: 242 case lwu_op:
243#ifdef CONFIG_MIPS64 243#ifdef CONFIG_64BIT
244 /* 244 /*
245 * A 32-bit kernel might be running on a 64-bit processor. But 245 * A 32-bit kernel might be running on a 64-bit processor. But
246 * if we're on a 32-bit processor and an i-cache incoherency 246 * if we're on a 32-bit processor and an i-cache incoherency
@@ -278,13 +278,13 @@ static inline int emulate_load_store_insn(struct pt_regs *regs,
278 *newvalue = value; 278 *newvalue = value;
279 *regptr = &regs->regs[insn.i_format.rt]; 279 *regptr = &regs->regs[insn.i_format.rt];
280 break; 280 break;
281#endif /* CONFIG_MIPS64 */ 281#endif /* CONFIG_64BIT */
282 282
283 /* Cannot handle 64-bit instructions in 32-bit kernel */ 283 /* Cannot handle 64-bit instructions in 32-bit kernel */
284 goto sigill; 284 goto sigill;
285 285
286 case ld_op: 286 case ld_op:
287#ifdef CONFIG_MIPS64 287#ifdef CONFIG_64BIT
288 /* 288 /*
289 * A 32-bit kernel might be running on a 64-bit processor. But 289 * A 32-bit kernel might be running on a 64-bit processor. But
290 * if we're on a 32-bit processor and an i-cache incoherency 290 * if we're on a 32-bit processor and an i-cache incoherency
@@ -320,7 +320,7 @@ static inline int emulate_load_store_insn(struct pt_regs *regs,
320 *newvalue = value; 320 *newvalue = value;
321 *regptr = &regs->regs[insn.i_format.rt]; 321 *regptr = &regs->regs[insn.i_format.rt];
322 break; 322 break;
323#endif /* CONFIG_MIPS64 */ 323#endif /* CONFIG_64BIT */
324 324
325 /* Cannot handle 64-bit instructions in 32-bit kernel */ 325 /* Cannot handle 64-bit instructions in 32-bit kernel */
326 goto sigill; 326 goto sigill;
@@ -392,7 +392,7 @@ static inline int emulate_load_store_insn(struct pt_regs *regs,
392 break; 392 break;
393 393
394 case sd_op: 394 case sd_op:
395#ifdef CONFIG_MIPS64 395#ifdef CONFIG_64BIT
396 /* 396 /*
397 * A 32-bit kernel might be running on a 64-bit processor. But 397 * A 32-bit kernel might be running on a 64-bit processor. But
398 * if we're on a 32-bit processor and an i-cache incoherency 398 * if we're on a 32-bit processor and an i-cache incoherency
@@ -428,7 +428,7 @@ static inline int emulate_load_store_insn(struct pt_regs *regs,
428 if (res) 428 if (res)
429 goto fault; 429 goto fault;
430 break; 430 break;
431#endif /* CONFIG_MIPS64 */ 431#endif /* CONFIG_64BIT */
432 432
433 /* Cannot handle 64-bit instructions in 32-bit kernel */ 433 /* Cannot handle 64-bit instructions in 32-bit kernel */
434 goto sigill; 434 goto sigill;
diff --git a/arch/mips/kernel/vmlinux.lds.S b/arch/mips/kernel/vmlinux.lds.S
index e830d788c106..482ac310c937 100644
--- a/arch/mips/kernel/vmlinux.lds.S
+++ b/arch/mips/kernel/vmlinux.lds.S
@@ -15,7 +15,7 @@ SECTIONS
15 /* This is the value for an Origin kernel, taken from an IRIX kernel. */ 15 /* This is the value for an Origin kernel, taken from an IRIX kernel. */
16 /* . = 0xc00000000001c000; */ 16 /* . = 0xc00000000001c000; */
17 17
18 /* Set the vaddr for the text segment to a value 18 /* Set the vaddr for the text segment to a value
19 >= 0xa800 0000 0001 9000 if no symmon is going to configured 19 >= 0xa800 0000 0001 9000 if no symmon is going to configured
20 >= 0xa800 0000 0030 0000 otherwise */ 20 >= 0xa800 0000 0030 0000 otherwise */
21 21
diff --git a/arch/mips/lasat/at93c.c b/arch/mips/lasat/at93c.c
index f6add041ebec..ca26e554615e 100644
--- a/arch/mips/lasat/at93c.c
+++ b/arch/mips/lasat/at93c.c
@@ -1,7 +1,7 @@
1/* 1/*
2 * Atmel AT93C46 serial eeprom driver 2 * Atmel AT93C46 serial eeprom driver
3 * 3 *
4 * Brian Murphy <brian.murphy@eicon.com> 4 * Brian Murphy <brian.murphy@eicon.com>
5 * 5 *
6 */ 6 */
7#include <linux/kernel.h> 7#include <linux/kernel.h>
@@ -21,12 +21,12 @@
21 21
22struct at93c_defs *at93c; 22struct at93c_defs *at93c;
23 23
24static void at93c_reg_write(u32 val) 24static void at93c_reg_write(u32 val)
25{ 25{
26 *at93c->reg = val; 26 *at93c->reg = val;
27} 27}
28 28
29static u32 at93c_reg_read(void) 29static u32 at93c_reg_read(void)
30{ 30{
31 u32 tmp = *at93c->reg; 31 u32 tmp = *at93c->reg;
32 return tmp; 32 return tmp;
@@ -81,7 +81,7 @@ static u8 at93c_read_byte(void)
81} 81}
82 82
83static void at93c_write_bits(u32 data, int size) 83static void at93c_write_bits(u32 data, int size)
84{ 84{
85 int i; 85 int i;
86 int shift = size - 1; 86 int shift = size - 1;
87 u32 mask = (1 << shift); 87 u32 mask = (1 << shift);
@@ -90,7 +90,7 @@ static void at93c_write_bits(u32 data, int size)
90 at93c_write_databit((data & mask) >> shift); 90 at93c_write_databit((data & mask) >> shift);
91 data <<= 1; 91 data <<= 1;
92 } 92 }
93} 93}
94 94
95static void at93c_init_op(void) 95static void at93c_init_op(void)
96{ 96{
@@ -104,8 +104,8 @@ static void at93c_end_op(void)
104 lasat_ndelay(250); 104 lasat_ndelay(250);
105} 105}
106 106
107static void at93c_wait(void) 107static void at93c_wait(void)
108{ 108{
109 at93c_init_op(); 109 at93c_init_op();
110 while (!at93c_read_databit()) 110 while (!at93c_read_databit())
111 ; 111 ;
diff --git a/arch/mips/lasat/at93c.h b/arch/mips/lasat/at93c.h
index a912ac2171b0..cfe2f99b1d44 100644
--- a/arch/mips/lasat/at93c.h
+++ b/arch/mips/lasat/at93c.h
@@ -1,7 +1,7 @@
1/* 1/*
2 * Atmel AT93C46 serial eeprom driver 2 * Atmel AT93C46 serial eeprom driver
3 * 3 *
4 * Brian Murphy <brian.murphy@eicon.com> 4 * Brian Murphy <brian.murphy@eicon.com>
5 * 5 *
6 */ 6 */
7 7
diff --git a/arch/mips/lasat/ds1603.c b/arch/mips/lasat/ds1603.c
index 7bbf6cf923c9..9d7812e03dcd 100644
--- a/arch/mips/lasat/ds1603.c
+++ b/arch/mips/lasat/ds1603.c
@@ -1,7 +1,7 @@
1/* 1/*
2 * Dallas Semiconductors 1603 RTC driver 2 * Dallas Semiconductors 1603 RTC driver
3 * 3 *
4 * Brian Murphy <brian@murphy.dk> 4 * Brian Murphy <brian@murphy.dk>
5 * 5 *
6 */ 6 */
7#include <linux/kernel.h> 7#include <linux/kernel.h>
@@ -20,12 +20,12 @@
20struct ds_defs *ds1603 = NULL; 20struct ds_defs *ds1603 = NULL;
21 21
22/* HW specific register functions */ 22/* HW specific register functions */
23static void rtc_reg_write(unsigned long val) 23static void rtc_reg_write(unsigned long val)
24{ 24{
25 *ds1603->reg = val; 25 *ds1603->reg = val;
26} 26}
27 27
28static unsigned long rtc_reg_read(void) 28static unsigned long rtc_reg_read(void)
29{ 29{
30 unsigned long tmp = *ds1603->reg; 30 unsigned long tmp = *ds1603->reg;
31 return tmp; 31 return tmp;
@@ -80,7 +80,7 @@ static unsigned int rtc_read_databit(void)
80{ 80{
81 unsigned int data; 81 unsigned int data;
82 82
83 data = (rtc_datareg_read() & (1 << ds1603->data_read_shift)) 83 data = (rtc_datareg_read() & (1 << ds1603->data_read_shift))
84 >> ds1603->data_read_shift; 84 >> ds1603->data_read_shift;
85 rtc_cycle_clock(rtc_reg_read()); 85 rtc_cycle_clock(rtc_reg_read());
86 return data; 86 return data;
diff --git a/arch/mips/lasat/ds1603.h b/arch/mips/lasat/ds1603.h
index 55f3b0423c20..c2e5c76a379d 100644
--- a/arch/mips/lasat/ds1603.h
+++ b/arch/mips/lasat/ds1603.h
@@ -1,7 +1,7 @@
1/* 1/*
2 * Dallas Semiconductors 1603 RTC driver 2 * Dallas Semiconductors 1603 RTC driver
3 * 3 *
4 * Brian Murphy <brian@murphy.dk> 4 * Brian Murphy <brian@murphy.dk>
5 * 5 *
6 */ 6 */
7#ifndef __DS1603_H 7#ifndef __DS1603_H
diff --git a/arch/mips/lasat/image/Makefile b/arch/mips/lasat/image/Makefile
index 18b6430f11be..35ecd6483ef6 100644
--- a/arch/mips/lasat/image/Makefile
+++ b/arch/mips/lasat/image/Makefile
@@ -21,7 +21,7 @@ LDSCRIPT= -L$(obj) -Tromscript.normal
21HEAD_DEFINES := -D_kernel_start=0x$(KERNEL_START) \ 21HEAD_DEFINES := -D_kernel_start=0x$(KERNEL_START) \
22 -D_kernel_entry=0x$(KERNEL_ENTRY) \ 22 -D_kernel_entry=0x$(KERNEL_ENTRY) \
23 -D VERSION="\"$(Version)\"" \ 23 -D VERSION="\"$(Version)\"" \
24 -D TIMESTAMP=$(shell date +%s) 24 -D TIMESTAMP=$(shell date +%s)
25 25
26$(obj)/head.o: $(obj)/head.S $(KERNEL_IMAGE) 26$(obj)/head.o: $(obj)/head.S $(KERNEL_IMAGE)
27 $(CC) -fno-pic $(HEAD_DEFINES) -I$(TOPDIR)/include -c -o $@ $< 27 $(CC) -fno-pic $(HEAD_DEFINES) -I$(TOPDIR)/include -c -o $@ $<
diff --git a/arch/mips/lasat/image/head.S b/arch/mips/lasat/image/head.S
index 426bd7de17bb..efb95f2609c2 100644
--- a/arch/mips/lasat/image/head.S
+++ b/arch/mips/lasat/image/head.S
@@ -27,5 +27,5 @@ reldate:
27 .word TIMESTAMP 27 .word TIMESTAMP
28 28
29 .org 0x50 29 .org 0x50
30release: 30release:
31 .string VERSION 31 .string VERSION
diff --git a/arch/mips/lasat/interrupt.c b/arch/mips/lasat/interrupt.c
index 1148a2d20aa7..c90da1639440 100644
--- a/arch/mips/lasat/interrupt.c
+++ b/arch/mips/lasat/interrupt.c
@@ -15,7 +15,7 @@
15 * with this program; if not, write to the Free Software Foundation, Inc., 15 * with this program; if not, write to the Free Software Foundation, Inc.,
16 * 59 Temple Place - Suite 330, Boston MA 02111-1307, USA. 16 * 59 Temple Place - Suite 330, Boston MA 02111-1307, USA.
17 * 17 *
18 * Routines for generic manipulation of the interrupts found on the 18 * Routines for generic manipulation of the interrupts found on the
19 * Lasat boards. 19 * Lasat boards.
20 */ 20 */
21#include <linux/init.h> 21#include <linux/init.h>
@@ -101,7 +101,7 @@ static unsigned long get_int_status_100(void)
101 return *lasat_int_status & *lasat_int_mask; 101 return *lasat_int_status & *lasat_int_mask;
102} 102}
103 103
104static unsigned long get_int_status_200(void) 104static unsigned long get_int_status_200(void)
105{ 105{
106 unsigned long int_status; 106 unsigned long int_status;
107 107
diff --git a/arch/mips/lasat/lasat_board.c b/arch/mips/lasat/lasat_board.c
index 8c784bcf1111..fc9b0e2a6be1 100644
--- a/arch/mips/lasat/lasat_board.c
+++ b/arch/mips/lasat/lasat_board.c
@@ -67,7 +67,7 @@ static void init_flash_sizes(void)
67 67
68 if (mips_machtype == MACH_LASAT_100) { 68 if (mips_machtype == MACH_LASAT_100) {
69 lasat_board_info.li_flash_base = 0x1e000000; 69 lasat_board_info.li_flash_base = 0x1e000000;
70 70
71 lb[LASAT_MTD_BOOTLOADER] = 0x1e400000; 71 lb[LASAT_MTD_BOOTLOADER] = 0x1e400000;
72 72
73 if (lasat_board_info.li_flash_size > 0x200000) { 73 if (lasat_board_info.li_flash_size > 0x200000) {
@@ -103,7 +103,7 @@ int lasat_init_board_info(void)
103 memset(&lasat_board_info, 0, sizeof(lasat_board_info)); 103 memset(&lasat_board_info, 0, sizeof(lasat_board_info));
104 104
105 /* First read the EEPROM info */ 105 /* First read the EEPROM info */
106 EEPROMRead(0, (unsigned char *)&lasat_board_info.li_eeprom_info, 106 EEPROMRead(0, (unsigned char *)&lasat_board_info.li_eeprom_info,
107 sizeof(struct lasat_eeprom_struct)); 107 sizeof(struct lasat_eeprom_struct));
108 108
109 /* Check the CRC */ 109 /* Check the CRC */
@@ -188,7 +188,7 @@ int lasat_init_board_info(void)
188 case 0x1: 188 case 0x1:
189 lasat_board_info.li_cpu_hz = 189 lasat_board_info.li_cpu_hz =
190 lasat_board_info.li_bus_hz + 190 lasat_board_info.li_bus_hz +
191 (lasat_board_info.li_bus_hz >> 1); 191 (lasat_board_info.li_bus_hz >> 1);
192 break; 192 break;
193 case 0x2: 193 case 0x2:
194 lasat_board_info.li_cpu_hz = 194 lasat_board_info.li_cpu_hz =
@@ -271,7 +271,7 @@ void lasat_write_eeprom_info(void)
271 lasat_board_info.li_eeprom_info.crc32 = crc; 271 lasat_board_info.li_eeprom_info.crc32 = crc;
272 272
273 /* Write the EEPROM info */ 273 /* Write the EEPROM info */
274 EEPROMWrite(0, (unsigned char *)&lasat_board_info.li_eeprom_info, 274 EEPROMWrite(0, (unsigned char *)&lasat_board_info.li_eeprom_info,
275 sizeof(struct lasat_eeprom_struct)); 275 sizeof(struct lasat_eeprom_struct));
276} 276}
277 277
diff --git a/arch/mips/lasat/picvue.c b/arch/mips/lasat/picvue.c
index 5637cd153926..9ae82c3ffb07 100644
--- a/arch/mips/lasat/picvue.c
+++ b/arch/mips/lasat/picvue.c
@@ -1,7 +1,7 @@
1/* 1/*
2 * Picvue PVC160206 display driver 2 * Picvue PVC160206 display driver
3 * 3 *
4 * Brian Murphy <brian@murphy.dk> 4 * Brian Murphy <brian@murphy.dk>
5 * 5 *
6 */ 6 */
7#include <linux/kernel.h> 7#include <linux/kernel.h>
@@ -24,12 +24,12 @@ struct pvc_defs *picvue = NULL;
24 24
25DECLARE_MUTEX(pvc_sem); 25DECLARE_MUTEX(pvc_sem);
26 26
27static void pvc_reg_write(u32 val) 27static void pvc_reg_write(u32 val)
28{ 28{
29 *picvue->reg = val; 29 *picvue->reg = val;
30} 30}
31 31
32static u32 pvc_reg_read(void) 32static u32 pvc_reg_read(void)
33{ 33{
34 u32 tmp = *picvue->reg; 34 u32 tmp = *picvue->reg;
35 return tmp; 35 return tmp;
@@ -65,12 +65,12 @@ static u8 pvc_read_data(void)
65{ 65{
66 u32 data = pvc_reg_read(); 66 u32 data = pvc_reg_read();
67 u8 byte; 67 u8 byte;
68 data |= picvue->rw; 68 data |= picvue->rw;
69 data &= ~picvue->rs; 69 data &= ~picvue->rs;
70 pvc_reg_write(data); 70 pvc_reg_write(data);
71 ndelay(40); 71 ndelay(40);
72 byte = pvc_read_byte(data); 72 byte = pvc_read_byte(data);
73 data |= picvue->rs; 73 data |= picvue->rs;
74 pvc_reg_write(data); 74 pvc_reg_write(data);
75 return byte; 75 return byte;
76} 76}
diff --git a/arch/mips/lasat/picvue.h b/arch/mips/lasat/picvue.h
index 74a39039135d..2a96bf971897 100644
--- a/arch/mips/lasat/picvue.h
+++ b/arch/mips/lasat/picvue.h
@@ -1,7 +1,7 @@
1/* 1/*
2 * Picvue PVC160206 display driver 2 * Picvue PVC160206 display driver
3 * 3 *
4 * Brian Murphy <brian.murphy@eicon.com> 4 * Brian Murphy <brian.murphy@eicon.com>
5 * 5 *
6 */ 6 */
7#include <asm/semaphore.h> 7#include <asm/semaphore.h>
diff --git a/arch/mips/lasat/picvue_proc.c b/arch/mips/lasat/picvue_proc.c
index eaa2b4625124..cce7cddcdb08 100644
--- a/arch/mips/lasat/picvue_proc.c
+++ b/arch/mips/lasat/picvue_proc.c
@@ -1,7 +1,7 @@
1/* 1/*
2 * Picvue PVC160206 display driver 2 * Picvue PVC160206 display driver
3 * 3 *
4 * Brian Murphy <brian.murphy@eicon.com> 4 * Brian Murphy <brian.murphy@eicon.com>
5 * 5 *
6 */ 6 */
7#include <linux/kernel.h> 7#include <linux/kernel.h>
@@ -51,10 +51,10 @@ static int pvc_proc_read_line(char *page, char **start,
51 page += sprintf(page, "%s\n", pvc_lines[lineno]); 51 page += sprintf(page, "%s\n", pvc_lines[lineno]);
52 up(&pvc_sem); 52 up(&pvc_sem);
53 53
54 return page - origpage; 54 return page - origpage;
55} 55}
56 56
57static int pvc_proc_write_line(struct file *file, const char *buffer, 57static int pvc_proc_write_line(struct file *file, const char *buffer,
58 unsigned long count, void *data) 58 unsigned long count, void *data)
59{ 59{
60 int origcount = count; 60 int origcount = count;
@@ -119,7 +119,7 @@ static int pvc_proc_read_scroll(char *page, char **start,
119 page += sprintf(page, "%d\n", scroll_dir * scroll_interval); 119 page += sprintf(page, "%d\n", scroll_dir * scroll_interval);
120 up(&pvc_sem); 120 up(&pvc_sem);
121 121
122 return page - origpage; 122 return page - origpage;
123} 123}
124 124
125 125
diff --git a/arch/mips/lasat/prom.c b/arch/mips/lasat/prom.c
index ca62881c9e52..88c7ab871ec4 100644
--- a/arch/mips/lasat/prom.c
+++ b/arch/mips/lasat/prom.c
@@ -42,7 +42,7 @@ static void null_prom_putc(char c)
42/* these are functions provided by the bootloader */ 42/* these are functions provided by the bootloader */
43static void (* prom_putc)(char c) = null_prom_putc; 43static void (* prom_putc)(char c) = null_prom_putc;
44void (* prom_printf)(const char * fmt, ...) = null_prom_printf; 44void (* prom_printf)(const char * fmt, ...) = null_prom_printf;
45void (* prom_display)(const char *string, int pos, int clear) = 45void (* prom_display)(const char *string, int pos, int clear) =
46 null_prom_display; 46 null_prom_display;
47void (* prom_monitor)(void) = null_prom_monitor; 47void (* prom_monitor)(void) = null_prom_monitor;
48 48
diff --git a/arch/mips/lasat/reset.c b/arch/mips/lasat/reset.c
index 37e4912ee1c8..8d7d7a454f9a 100644
--- a/arch/mips/lasat/reset.c
+++ b/arch/mips/lasat/reset.c
@@ -1,4 +1,4 @@
1/* 1/*
2 * Thomas Horsten <thh@lasat.com> 2 * Thomas Horsten <thh@lasat.com>
3 * Copyright (C) 2000 LASAT Networks A/S. 3 * Copyright (C) 2000 LASAT Networks A/S.
4 * 4 *
diff --git a/arch/mips/lasat/setup.c b/arch/mips/lasat/setup.c
index e371ed5cbe34..f2604fab9a99 100644
--- a/arch/mips/lasat/setup.c
+++ b/arch/mips/lasat/setup.c
@@ -105,7 +105,7 @@ static int lasat_panic_prom_monitor(struct notifier_block *this,
105 return NOTIFY_DONE; 105 return NOTIFY_DONE;
106} 106}
107 107
108static struct notifier_block lasat_panic_block[] = 108static struct notifier_block lasat_panic_block[] =
109{ 109{
110 { lasat_panic_display, NULL, INT_MAX }, 110 { lasat_panic_display, NULL, INT_MAX },
111 { lasat_panic_prom_monitor, NULL, INT_MIN } 111 { lasat_panic_prom_monitor, NULL, INT_MIN }
@@ -120,7 +120,7 @@ static void lasat_timer_setup(struct irqaction *irq)
120{ 120{
121 121
122 write_c0_compare( 122 write_c0_compare(
123 read_c0_count() + 123 read_c0_count() +
124 mips_hpt_frequency / HZ); 124 mips_hpt_frequency / HZ);
125 change_c0_status(ST0_IM, IE_IRQ0 | IE_IRQ5); 125 change_c0_status(ST0_IM, IE_IRQ0 | IE_IRQ5);
126} 126}
diff --git a/arch/mips/lasat/sysctl.c b/arch/mips/lasat/sysctl.c
index 1c0cc620a43f..8ff43a1c1e99 100644
--- a/arch/mips/lasat/sysctl.c
+++ b/arch/mips/lasat/sysctl.c
@@ -37,14 +37,14 @@
37 37
38static DECLARE_MUTEX(lasat_info_sem); 38static DECLARE_MUTEX(lasat_info_sem);
39 39
40/* Strategy function to write EEPROM after changing string entry */ 40/* Strategy function to write EEPROM after changing string entry */
41int sysctl_lasatstring(ctl_table *table, int *name, int nlen, 41int sysctl_lasatstring(ctl_table *table, int *name, int nlen,
42 void *oldval, size_t *oldlenp, 42 void *oldval, size_t *oldlenp,
43 void *newval, size_t newlen, void **context) 43 void *newval, size_t newlen, void **context)
44{ 44{
45 int r; 45 int r;
46 down(&lasat_info_sem); 46 down(&lasat_info_sem);
47 r = sysctl_string(table, name, 47 r = sysctl_string(table, name,
48 nlen, oldval, oldlenp, newval, newlen, context); 48 nlen, oldval, oldlenp, newval, newlen, context);
49 if (r < 0) { 49 if (r < 0) {
50 up(&lasat_info_sem); 50 up(&lasat_info_sem);
@@ -74,7 +74,7 @@ int proc_dolasatstring(ctl_table *table, int write, struct file *filp,
74 return 0; 74 return 0;
75} 75}
76 76
77/* proc function to write EEPROM after changing int entry */ 77/* proc function to write EEPROM after changing int entry */
78int proc_dolasatint(ctl_table *table, int write, struct file *filp, 78int proc_dolasatint(ctl_table *table, int write, struct file *filp,
79 void *buffer, size_t *lenp, loff_t *ppos) 79 void *buffer, size_t *lenp, loff_t *ppos)
80{ 80{
@@ -93,7 +93,7 @@ int proc_dolasatint(ctl_table *table, int write, struct file *filp,
93static int rtctmp; 93static int rtctmp;
94 94
95#ifdef CONFIG_DS1603 95#ifdef CONFIG_DS1603
96/* proc function to read/write RealTime Clock */ 96/* proc function to read/write RealTime Clock */
97int proc_dolasatrtc(ctl_table *table, int write, struct file *filp, 97int proc_dolasatrtc(ctl_table *table, int write, struct file *filp,
98 void *buffer, size_t *lenp, loff_t *ppos) 98 void *buffer, size_t *lenp, loff_t *ppos)
99{ 99{
@@ -165,9 +165,9 @@ static char lasat_bcastaddr[16];
165void update_bcastaddr(void) 165void update_bcastaddr(void)
166{ 166{
167 unsigned int ip; 167 unsigned int ip;
168 168
169 ip = (lasat_board_info.li_eeprom_info.ipaddr & 169 ip = (lasat_board_info.li_eeprom_info.ipaddr &
170 lasat_board_info.li_eeprom_info.netmask) | 170 lasat_board_info.li_eeprom_info.netmask) |
171 ~lasat_board_info.li_eeprom_info.netmask; 171 ~lasat_board_info.li_eeprom_info.netmask;
172 172
173 sprintf(lasat_bcastaddr, "%d.%d.%d.%d", 173 sprintf(lasat_bcastaddr, "%d.%d.%d.%d",
@@ -205,7 +205,7 @@ int proc_lasat_ip(ctl_table *table, int write, struct file *filp,
205 break; 205 break;
206 len++; 206 len++;
207 } 207 }
208 if (len >= sizeof(proc_lasat_ipbuf)-1) 208 if (len >= sizeof(proc_lasat_ipbuf)-1)
209 len = sizeof(proc_lasat_ipbuf) - 1; 209 len = sizeof(proc_lasat_ipbuf) - 1;
210 if (copy_from_user(proc_lasat_ipbuf, buffer, len)) 210 if (copy_from_user(proc_lasat_ipbuf, buffer, len))
211 { 211 {
@@ -249,8 +249,8 @@ int proc_lasat_ip(ctl_table *table, int write, struct file *filp,
249} 249}
250#endif /* defined(CONFIG_INET) */ 250#endif /* defined(CONFIG_INET) */
251 251
252static int sysctl_lasat_eeprom_value(ctl_table *table, int *name, int nlen, 252static int sysctl_lasat_eeprom_value(ctl_table *table, int *name, int nlen,
253 void *oldval, size_t *oldlenp, 253 void *oldval, size_t *oldlenp,
254 void *newval, size_t newlen, 254 void *newval, size_t newlen,
255 void **context) 255 void **context)
256{ 256{
@@ -293,7 +293,7 @@ int proc_lasat_eeprom_value(ctl_table *table, int write, struct file *filp,
293 if (!strcmp(filp->f_dentry->d_name.name, "debugaccess")) 293 if (!strcmp(filp->f_dentry->d_name.name, "debugaccess"))
294 lasat_board_info.li_eeprom_info.debugaccess = lasat_board_info.li_debugaccess; 294 lasat_board_info.li_eeprom_info.debugaccess = lasat_board_info.li_debugaccess;
295 } 295 }
296 lasat_write_eeprom_info(); 296 lasat_write_eeprom_info();
297 up(&lasat_info_sem); 297 up(&lasat_info_sem);
298 return 0; 298 return 0;
299} 299}
@@ -316,8 +316,8 @@ static ctl_table lasat_table[] = {
316 0644, NULL, &proc_lasat_ip, &sysctl_lasat_intvec}, 316 0644, NULL, &proc_lasat_ip, &sysctl_lasat_intvec},
317 {LASAT_NETMASK, "netmask", &lasat_board_info.li_eeprom_info.netmask, sizeof(int), 317 {LASAT_NETMASK, "netmask", &lasat_board_info.li_eeprom_info.netmask, sizeof(int),
318 0644, NULL, &proc_lasat_ip, &sysctl_lasat_intvec}, 318 0644, NULL, &proc_lasat_ip, &sysctl_lasat_intvec},
319 {LASAT_BCAST, "bcastaddr", &lasat_bcastaddr, 319 {LASAT_BCAST, "bcastaddr", &lasat_bcastaddr,
320 sizeof(lasat_bcastaddr), 0600, NULL, 320 sizeof(lasat_bcastaddr), 0600, NULL,
321 &proc_dostring, &sysctl_string}, 321 &proc_dostring, &sysctl_string},
322#endif 322#endif
323 {LASAT_PASSWORD, "passwd_hash", &lasat_board_info.li_eeprom_info.passwd_hash, sizeof(lasat_board_info.li_eeprom_info.passwd_hash), 323 {LASAT_PASSWORD, "passwd_hash", &lasat_board_info.li_eeprom_info.passwd_hash, sizeof(lasat_board_info.li_eeprom_info.passwd_hash),
diff --git a/arch/mips/lib-32/Makefile b/arch/mips/lib-32/Makefile
index fd6a2bafdfcf..ad285786e74b 100644
--- a/arch/mips/lib-32/Makefile
+++ b/arch/mips/lib-32/Makefile
@@ -2,7 +2,7 @@
2# Makefile for MIPS-specific library files.. 2# Makefile for MIPS-specific library files..
3# 3#
4 4
5lib-y += csum_partial.o memset.o watch.o 5lib-y += csum_partial.o memset.o watch.o
6 6
7obj-$(CONFIG_CPU_MIPS32) += dump_tlb.o 7obj-$(CONFIG_CPU_MIPS32) += dump_tlb.o
8obj-$(CONFIG_CPU_MIPS64) += dump_tlb.o 8obj-$(CONFIG_CPU_MIPS64) += dump_tlb.o
diff --git a/arch/mips/lib-64/Makefile b/arch/mips/lib-64/Makefile
index fd6a2bafdfcf..ad285786e74b 100644
--- a/arch/mips/lib-64/Makefile
+++ b/arch/mips/lib-64/Makefile
@@ -2,7 +2,7 @@
2# Makefile for MIPS-specific library files.. 2# Makefile for MIPS-specific library files..
3# 3#
4 4
5lib-y += csum_partial.o memset.o watch.o 5lib-y += csum_partial.o memset.o watch.o
6 6
7obj-$(CONFIG_CPU_MIPS32) += dump_tlb.o 7obj-$(CONFIG_CPU_MIPS32) += dump_tlb.o
8obj-$(CONFIG_CPU_MIPS64) += dump_tlb.o 8obj-$(CONFIG_CPU_MIPS64) += dump_tlb.o
diff --git a/arch/mips/lib/memcpy.S b/arch/mips/lib/memcpy.S
index afa8eae18ff6..90ee8d43261f 100644
--- a/arch/mips/lib/memcpy.S
+++ b/arch/mips/lib/memcpy.S
@@ -79,7 +79,7 @@
79/* 79/*
80 * Only on the 64-bit kernel we can made use of 64-bit registers. 80 * Only on the 64-bit kernel we can made use of 64-bit registers.
81 */ 81 */
82#ifdef CONFIG_MIPS64 82#ifdef CONFIG_64BIT
83#define USE_DOUBLE 83#define USE_DOUBLE
84#endif 84#endif
85 85
@@ -101,7 +101,7 @@
101#define NBYTES 8 101#define NBYTES 8
102#define LOG_NBYTES 3 102#define LOG_NBYTES 3
103 103
104/* 104/*
105 * As we are sharing code base with the mips32 tree (which use the o32 ABI 105 * As we are sharing code base with the mips32 tree (which use the o32 ABI
106 * register definitions). We need to redefine the register definitions from 106 * register definitions). We need to redefine the register definitions from
107 * the n64 ABI register naming to the o32 ABI register naming. 107 * the n64 ABI register naming to the o32 ABI register naming.
@@ -118,7 +118,7 @@
118#define t5 $13 118#define t5 $13
119#define t6 $14 119#define t6 $14
120#define t7 $15 120#define t7 $15
121 121
122#else 122#else
123 123
124#define LOAD lw 124#define LOAD lw
diff --git a/arch/mips/math-emu/cp1emu.c b/arch/mips/math-emu/cp1emu.c
index 20a552be02ee..99c550632d44 100644
--- a/arch/mips/math-emu/cp1emu.c
+++ b/arch/mips/math-emu/cp1emu.c
@@ -320,7 +320,7 @@ static int cop1Emulate(struct pt_regs *xcp, struct mips_fpu_soft_struct *ctx)
320 case cop1_op: 320 case cop1_op:
321 switch (MIPSInst_RS(ir)) { 321 switch (MIPSInst_RS(ir)) {
322 322
323#if __mips64 && !defined(SINGLE_ONLY_FPU) 323#if defined(__mips64) && !defined(SINGLE_ONLY_FPU)
324 case dmfc_op: 324 case dmfc_op:
325 /* copregister fs -> gpr[rt] */ 325 /* copregister fs -> gpr[rt] */
326 if (MIPSInst_RT(ir) != 0) { 326 if (MIPSInst_RT(ir) != 0) {
@@ -805,7 +805,7 @@ static int fpu_emu(struct pt_regs *xcp, struct mips_fpu_soft_struct *ctx,
805 ieee754dp d; 805 ieee754dp d;
806 ieee754sp s; 806 ieee754sp s;
807 int w; 807 int w;
808#if __mips64 808#ifdef __mips64
809 s64 l; 809 s64 l;
810#endif 810#endif
811 } rv; /* resulting value */ 811 } rv; /* resulting value */
@@ -950,7 +950,7 @@ static int fpu_emu(struct pt_regs *xcp, struct mips_fpu_soft_struct *ctx,
950 } 950 }
951#endif /* __mips >= 2 */ 951#endif /* __mips >= 2 */
952 952
953#if __mips64 && !defined(SINGLE_ONLY_FPU) 953#if defined(__mips64) && !defined(SINGLE_ONLY_FPU)
954 case fcvtl_op:{ 954 case fcvtl_op:{
955 ieee754sp fs; 955 ieee754sp fs;
956 956
@@ -1125,7 +1125,7 @@ static int fpu_emu(struct pt_regs *xcp, struct mips_fpu_soft_struct *ctx,
1125 } 1125 }
1126#endif 1126#endif
1127 1127
1128#if __mips64 && !defined(SINGLE_ONLY_FPU) 1128#if defined(__mips64) && !defined(SINGLE_ONLY_FPU)
1129 case fcvtl_op:{ 1129 case fcvtl_op:{
1130 ieee754dp fs; 1130 ieee754dp fs;
1131 1131
@@ -1203,7 +1203,7 @@ static int fpu_emu(struct pt_regs *xcp, struct mips_fpu_soft_struct *ctx,
1203 break; 1203 break;
1204 } 1204 }
1205 1205
1206#if __mips64 && !defined(SINGLE_ONLY_FPU) 1206#if defined(__mips64) && !defined(SINGLE_ONLY_FPU)
1207 case l_fmt:{ 1207 case l_fmt:{
1208 switch (MIPSInst_FUNC(ir)) { 1208 switch (MIPSInst_FUNC(ir)) {
1209 case fcvts_op: 1209 case fcvts_op:
@@ -1267,7 +1267,7 @@ static int fpu_emu(struct pt_regs *xcp, struct mips_fpu_soft_struct *ctx,
1267 case w_fmt: 1267 case w_fmt:
1268 SITOREG(rv.w, MIPSInst_FD(ir)); 1268 SITOREG(rv.w, MIPSInst_FD(ir));
1269 break; 1269 break;
1270#if __mips64 && !defined(SINGLE_ONLY_FPU) 1270#if defined(__mips64) && !defined(SINGLE_ONLY_FPU)
1271 case l_fmt: 1271 case l_fmt:
1272 DITOREG(rv.l, MIPSInst_FD(ir)); 1272 DITOREG(rv.l, MIPSInst_FD(ir));
1273 break; 1273 break;
diff --git a/arch/mips/math-emu/kernel_linkage.c b/arch/mips/math-emu/kernel_linkage.c
index 04397fec30fc..4002f0cf79f3 100644
--- a/arch/mips/math-emu/kernel_linkage.c
+++ b/arch/mips/math-emu/kernel_linkage.c
@@ -86,7 +86,7 @@ int fpu_emulator_restore_context(struct sigcontext *sc)
86 return err; 86 return err;
87} 87}
88 88
89#ifdef CONFIG_MIPS64 89#ifdef CONFIG_64BIT
90/* 90/*
91 * This is the o32 version 91 * This is the o32 version
92 */ 92 */
diff --git a/arch/mips/mips-boards/atlas/atlas_int.c b/arch/mips/mips-boards/atlas/atlas_int.c
index 8f1d875217a2..19d4b0792460 100644
--- a/arch/mips/mips-boards/atlas/atlas_int.c
+++ b/arch/mips/mips-boards/atlas/atlas_int.c
@@ -122,7 +122,7 @@ void __init arch_init_irq(void)
122 int i; 122 int i;
123 123
124 atlas_hw0_icregs = (struct atlas_ictrl_regs *)ioremap (ATLAS_ICTRL_REGS_BASE, sizeof(struct atlas_ictrl_regs *)); 124 atlas_hw0_icregs = (struct atlas_ictrl_regs *)ioremap (ATLAS_ICTRL_REGS_BASE, sizeof(struct atlas_ictrl_regs *));
125 125
126 /* 126 /*
127 * Mask out all interrupt by writing "1" to all bit position in 127 * Mask out all interrupt by writing "1" to all bit position in
128 * the interrupt reset reg. 128 * the interrupt reset reg.
diff --git a/arch/mips/mips-boards/generic/init.c b/arch/mips/mips-boards/generic/init.c
index 31caf0603a3f..311155d1d3ed 100644
--- a/arch/mips/mips-boards/generic/init.c
+++ b/arch/mips/mips-boards/generic/init.c
@@ -200,7 +200,7 @@ void __init kgdb_config (void)
200 generic_putDebugChar = saa9730_putDebugChar; 200 generic_putDebugChar = saa9730_putDebugChar;
201 generic_getDebugChar = saa9730_getDebugChar; 201 generic_getDebugChar = saa9730_getDebugChar;
202 } 202 }
203 else 203 else
204#endif 204#endif
205 { 205 {
206 speed = rs_kgdb_hook(line, speed); 206 speed = rs_kgdb_hook(line, speed);
@@ -243,7 +243,7 @@ void __init prom_init(void)
243 mips_revision_corid = MIPS_REVISION_CORID; 243 mips_revision_corid = MIPS_REVISION_CORID;
244 244
245 if (mips_revision_corid == MIPS_REVISION_CORID_CORE_EMUL) { 245 if (mips_revision_corid == MIPS_REVISION_CORID_CORE_EMUL) {
246 if (BONITO_PCIDID == 0x0001df53 || 246 if (BONITO_PCIDID == 0x0001df53 ||
247 BONITO_PCIDID == 0x0003df53) 247 BONITO_PCIDID == 0x0003df53)
248 mips_revision_corid = MIPS_REVISION_CORID_CORE_EMUL_BON; 248 mips_revision_corid = MIPS_REVISION_CORID_CORE_EMUL_BON;
249 else 249 else
@@ -310,7 +310,7 @@ void __init prom_init(void)
310 case MIPS_REVISION_CORID_CORE_MSC: 310 case MIPS_REVISION_CORID_CORE_MSC:
311 case MIPS_REVISION_CORID_CORE_FPGA2: 311 case MIPS_REVISION_CORID_CORE_FPGA2:
312 case MIPS_REVISION_CORID_CORE_EMUL_MSC: 312 case MIPS_REVISION_CORID_CORE_EMUL_MSC:
313 _pcictrl_msc = (unsigned long)ioremap(MIPS_MSC01_PCI_REG_BASE, 0x2000); 313 _pcictrl_msc = (unsigned long)ioremap(MIPS_MSC01_PCI_REG_BASE, 0x2000);
314 314
315#ifdef CONFIG_CPU_LITTLE_ENDIAN 315#ifdef CONFIG_CPU_LITTLE_ENDIAN
316 MSC_WRITE(MSC01_PCI_SWAP, MSC01_PCI_SWAP_NOSWAP); 316 MSC_WRITE(MSC01_PCI_SWAP, MSC01_PCI_SWAP_NOSWAP);
diff --git a/arch/mips/mips-boards/generic/time.c b/arch/mips/mips-boards/generic/time.c
index fe7fc17305a6..16315444dd5a 100644
--- a/arch/mips/mips-boards/generic/time.c
+++ b/arch/mips/mips-boards/generic/time.c
@@ -89,7 +89,7 @@ static unsigned int __init estimate_cpu_frequency(void)
89 * really calculate the timer frequency 89 * really calculate the timer frequency
90 * For now we hardwire the SEAD board frequency to 12MHz. 90 * For now we hardwire the SEAD board frequency to 12MHz.
91 */ 91 */
92 92
93 if ((prid == (PRID_COMP_MIPS | PRID_IMP_20KC)) || 93 if ((prid == (PRID_COMP_MIPS | PRID_IMP_20KC)) ||
94 (prid == (PRID_COMP_MIPS | PRID_IMP_25KF))) 94 (prid == (PRID_COMP_MIPS | PRID_IMP_25KF)))
95 count = 12000000; 95 count = 12000000;
diff --git a/arch/mips/mips-boards/malta/malta_setup.c b/arch/mips/mips-boards/malta/malta_setup.c
index 3377e66de9eb..df6db6419ae9 100644
--- a/arch/mips/mips-boards/malta/malta_setup.c
+++ b/arch/mips/mips-boards/malta/malta_setup.c
@@ -149,15 +149,15 @@ static int __init malta_setup(void)
149 argptr = prom_getcmdline(); 149 argptr = prom_getcmdline();
150 if (strstr(argptr, "iobcuncached")) { 150 if (strstr(argptr, "iobcuncached")) {
151 BONITO_PCICACHECTRL &= ~BONITO_PCICACHECTRL_IOBCCOH_EN; 151 BONITO_PCICACHECTRL &= ~BONITO_PCICACHECTRL_IOBCCOH_EN;
152 BONITO_PCIMEMBASECFG = BONITO_PCIMEMBASECFG & 152 BONITO_PCIMEMBASECFG = BONITO_PCIMEMBASECFG &
153 ~(BONITO_PCIMEMBASECFG_MEMBASE0_CACHED | 153 ~(BONITO_PCIMEMBASECFG_MEMBASE0_CACHED |
154 BONITO_PCIMEMBASECFG_MEMBASE1_CACHED); 154 BONITO_PCIMEMBASECFG_MEMBASE1_CACHED);
155 printk("Disabled Bonito IOBC coherency\n"); 155 printk("Disabled Bonito IOBC coherency\n");
156 } 156 }
157 else { 157 else {
158 BONITO_PCICACHECTRL |= BONITO_PCICACHECTRL_IOBCCOH_EN; 158 BONITO_PCICACHECTRL |= BONITO_PCICACHECTRL_IOBCCOH_EN;
159 BONITO_PCIMEMBASECFG |= 159 BONITO_PCIMEMBASECFG |=
160 (BONITO_PCIMEMBASECFG_MEMBASE0_CACHED | 160 (BONITO_PCIMEMBASECFG_MEMBASE0_CACHED |
161 BONITO_PCIMEMBASECFG_MEMBASE1_CACHED); 161 BONITO_PCIMEMBASECFG_MEMBASE1_CACHED);
162 printk("Disabled Bonito IOBC coherency\n"); 162 printk("Disabled Bonito IOBC coherency\n");
163 } 163 }
diff --git a/arch/mips/mm/Makefile b/arch/mips/mm/Makefile
index f61e038b4440..b56a0abdc3d4 100644
--- a/arch/mips/mm/Makefile
+++ b/arch/mips/mm/Makefile
@@ -5,8 +5,8 @@
5obj-y += cache.o extable.o fault.o init.o pgtable.o \ 5obj-y += cache.o extable.o fault.o init.o pgtable.o \
6 tlbex.o tlbex-fault.o 6 tlbex.o tlbex-fault.o
7 7
8obj-$(CONFIG_MIPS32) += ioremap.o pgtable-32.o 8obj-$(CONFIG_32BIT) += ioremap.o pgtable-32.o
9obj-$(CONFIG_MIPS64) += pgtable-64.o 9obj-$(CONFIG_64BIT) += pgtable-64.o
10obj-$(CONFIG_HIGHMEM) += highmem.o 10obj-$(CONFIG_HIGHMEM) += highmem.o
11 11
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
diff --git a/arch/mips/mm/c-r4k.c b/arch/mips/mm/c-r4k.c
index a03ebb2cba67..5ea84bc98c6a 100644
--- a/arch/mips/mm/c-r4k.c
+++ b/arch/mips/mm/c-r4k.c
@@ -126,13 +126,13 @@ static inline void tx49_blast_icache32(void)
126 126
127 CACHE32_UNROLL32_ALIGN2; 127 CACHE32_UNROLL32_ALIGN2;
128 /* I'm in even chunk. blast odd chunks */ 128 /* I'm in even chunk. blast odd chunks */
129 for (ws = 0; ws < ws_end; ws += ws_inc) 129 for (ws = 0; ws < ws_end; ws += ws_inc)
130 for (addr = start + 0x400; addr < end; addr += 0x400 * 2) 130 for (addr = start + 0x400; addr < end; addr += 0x400 * 2)
131 cache32_unroll32(addr|ws,Index_Invalidate_I); 131 cache32_unroll32(addr|ws,Index_Invalidate_I);
132 CACHE32_UNROLL32_ALIGN; 132 CACHE32_UNROLL32_ALIGN;
133 /* I'm in odd chunk. blast even chunks */ 133 /* I'm in odd chunk. blast even chunks */
134 for (ws = 0; ws < ws_end; ws += ws_inc) 134 for (ws = 0; ws < ws_end; ws += ws_inc)
135 for (addr = start; addr < end; addr += 0x400 * 2) 135 for (addr = start; addr < end; addr += 0x400 * 2)
136 cache32_unroll32(addr|ws,Index_Invalidate_I); 136 cache32_unroll32(addr|ws,Index_Invalidate_I);
137} 137}
138 138
@@ -156,13 +156,13 @@ static inline void tx49_blast_icache32_page_indexed(unsigned long page)
156 156
157 CACHE32_UNROLL32_ALIGN2; 157 CACHE32_UNROLL32_ALIGN2;
158 /* I'm in even chunk. blast odd chunks */ 158 /* I'm in even chunk. blast odd chunks */
159 for (ws = 0; ws < ws_end; ws += ws_inc) 159 for (ws = 0; ws < ws_end; ws += ws_inc)
160 for (addr = start + 0x400; addr < end; addr += 0x400 * 2) 160 for (addr = start + 0x400; addr < end; addr += 0x400 * 2)
161 cache32_unroll32(addr|ws,Index_Invalidate_I); 161 cache32_unroll32(addr|ws,Index_Invalidate_I);
162 CACHE32_UNROLL32_ALIGN; 162 CACHE32_UNROLL32_ALIGN;
163 /* I'm in odd chunk. blast even chunks */ 163 /* I'm in odd chunk. blast even chunks */
164 for (ws = 0; ws < ws_end; ws += ws_inc) 164 for (ws = 0; ws < ws_end; ws += ws_inc)
165 for (addr = start; addr < end; addr += 0x400 * 2) 165 for (addr = start; addr < end; addr += 0x400 * 2)
166 cache32_unroll32(addr|ws,Index_Invalidate_I); 166 cache32_unroll32(addr|ws,Index_Invalidate_I);
167} 167}
168 168
@@ -723,10 +723,10 @@ static void local_r4k_flush_cache_sigtramp(void * arg)
723 ".set push\n\t" 723 ".set push\n\t"
724 ".set noat\n\t" 724 ".set noat\n\t"
725 ".set mips3\n\t" 725 ".set mips3\n\t"
726#ifdef CONFIG_MIPS32 726#ifdef CONFIG_32BIT
727 "la $at,1f\n\t" 727 "la $at,1f\n\t"
728#endif 728#endif
729#ifdef CONFIG_MIPS64 729#ifdef CONFIG_64BIT
730 "dla $at,1f\n\t" 730 "dla $at,1f\n\t"
731#endif 731#endif
732 "cache %0,($at)\n\t" 732 "cache %0,($at)\n\t"
diff --git a/arch/mips/mm/c-sb1.c b/arch/mips/mm/c-sb1.c
index ab30afd63b32..502f68c664b2 100644
--- a/arch/mips/mm/c-sb1.c
+++ b/arch/mips/mm/c-sb1.c
@@ -270,7 +270,7 @@ static void local_sb1_flush_icache_range(unsigned long start,
270 __sb1_writeback_inv_dcache_all(); 270 __sb1_writeback_inv_dcache_all();
271 else 271 else
272 __sb1_writeback_inv_dcache_range(start, end); 272 __sb1_writeback_inv_dcache_range(start, end);
273 273
274 /* Just flush the whole icache if the range is big enough */ 274 /* Just flush the whole icache if the range is big enough */
275 if ((end - start) > icache_range_cutoff) 275 if ((end - start) > icache_range_cutoff)
276 __sb1_flush_icache_all(); 276 __sb1_flush_icache_all();
diff --git a/arch/mips/mm/cerr-sb1.c b/arch/mips/mm/cerr-sb1.c
index 13d96d62764e..7166ffe63502 100644
--- a/arch/mips/mm/cerr-sb1.c
+++ b/arch/mips/mm/cerr-sb1.c
@@ -25,7 +25,7 @@
25#include <asm/sibyte/sb1250_regs.h> 25#include <asm/sibyte/sb1250_regs.h>
26#include <asm/sibyte/sb1250_scd.h> 26#include <asm/sibyte/sb1250_scd.h>
27#endif 27#endif
28 28
29/* SB1 definitions */ 29/* SB1 definitions */
30 30
31/* XXX should come from config1 XXX */ 31/* XXX should come from config1 XXX */
@@ -136,14 +136,14 @@ static inline void breakout_cerrd(unsigned int val)
136 136
137#ifndef CONFIG_SIBYTE_BUS_WATCHER 137#ifndef CONFIG_SIBYTE_BUS_WATCHER
138 138
139static void check_bus_watcher(void) 139static void check_bus_watcher(void)
140{ 140{
141 uint32_t status, l2_err, memio_err; 141 uint32_t status, l2_err, memio_err;
142 142
143 /* Destructive read, clears register and interrupt */ 143 /* Destructive read, clears register and interrupt */
144 status = csr_in32(IOADDR(A_SCD_BUS_ERR_STATUS)); 144 status = csr_in32(IOADDR(A_SCD_BUS_ERR_STATUS));
145 /* Bit 31 is always on, but there's no #define for that */ 145 /* Bit 31 is always on, but there's no #define for that */
146 if (status & ~(1UL << 31)) { 146 if (status & ~(1UL << 31)) {
147 l2_err = csr_in32(IOADDR(A_BUS_L2_ERRORS)); 147 l2_err = csr_in32(IOADDR(A_BUS_L2_ERRORS));
148 memio_err = csr_in32(IOADDR(A_BUS_MEM_IO_ERRORS)); 148 memio_err = csr_in32(IOADDR(A_BUS_MEM_IO_ERRORS));
149 prom_printf("Bus watcher error counters: %08x %08x\n", l2_err, memio_err); 149 prom_printf("Bus watcher error counters: %08x %08x\n", l2_err, memio_err);
@@ -153,14 +153,14 @@ static void check_bus_watcher(void)
153 (int)(G_SCD_BERR_TID(status) >> 6), 153 (int)(G_SCD_BERR_TID(status) >> 6),
154 (int)G_SCD_BERR_RID(status), 154 (int)G_SCD_BERR_RID(status),
155 (int)G_SCD_BERR_DCODE(status)); 155 (int)G_SCD_BERR_DCODE(status));
156 } else { 156 } else {
157 prom_printf("Bus watcher indicates no error\n"); 157 prom_printf("Bus watcher indicates no error\n");
158 } 158 }
159} 159}
160#else 160#else
161extern void check_bus_watcher(void); 161extern void check_bus_watcher(void);
162#endif 162#endif
163 163
164asmlinkage void sb1_cache_error(void) 164asmlinkage void sb1_cache_error(void)
165{ 165{
166 uint64_t cerr_dpa; 166 uint64_t cerr_dpa;
diff --git a/arch/mips/mm/dma-noncoherent.c b/arch/mips/mm/dma-noncoherent.c
index 9895e32b0fce..59e54f12212e 100644
--- a/arch/mips/mm/dma-noncoherent.c
+++ b/arch/mips/mm/dma-noncoherent.c
@@ -162,7 +162,7 @@ int dma_map_sg(struct device *dev, struct scatterlist *sg, int nents,
162 162
163 for (i = 0; i < nents; i++, sg++) { 163 for (i = 0; i < nents; i++, sg++) {
164 unsigned long addr; 164 unsigned long addr;
165 165
166 addr = (unsigned long) page_address(sg->page); 166 addr = (unsigned long) page_address(sg->page);
167 if (addr) 167 if (addr)
168 __dma_sync(addr + sg->offset, sg->length, direction); 168 __dma_sync(addr + sg->offset, sg->length, direction);
@@ -230,9 +230,9 @@ void dma_sync_single_for_cpu(struct device *dev, dma_addr_t dma_handle,
230 size_t size, enum dma_data_direction direction) 230 size_t size, enum dma_data_direction direction)
231{ 231{
232 unsigned long addr; 232 unsigned long addr;
233 233
234 BUG_ON(direction == DMA_NONE); 234 BUG_ON(direction == DMA_NONE);
235 235
236 addr = dma_handle + PAGE_OFFSET; 236 addr = dma_handle + PAGE_OFFSET;
237 __dma_sync(addr, size, direction); 237 __dma_sync(addr, size, direction);
238} 238}
@@ -282,9 +282,9 @@ void dma_sync_sg_for_cpu(struct device *dev, struct scatterlist *sg, int nelems,
282 enum dma_data_direction direction) 282 enum dma_data_direction direction)
283{ 283{
284 int i; 284 int i;
285 285
286 BUG_ON(direction == DMA_NONE); 286 BUG_ON(direction == DMA_NONE);
287 287
288 /* Make sure that gcc doesn't leave the empty loop body. */ 288 /* Make sure that gcc doesn't leave the empty loop body. */
289 for (i = 0; i < nelems; i++, sg++) 289 for (i = 0; i < nelems; i++, sg++)
290 __dma_sync((unsigned long)page_address(sg->page), 290 __dma_sync((unsigned long)page_address(sg->page),
diff --git a/arch/mips/mm/init.c b/arch/mips/mm/init.c
index 9c9a271c8a3a..dc6830b10fab 100644
--- a/arch/mips/mm/init.c
+++ b/arch/mips/mm/init.c
@@ -96,7 +96,7 @@ static void __init kmap_init(void)
96 kmap_prot = PAGE_KERNEL; 96 kmap_prot = PAGE_KERNEL;
97} 97}
98 98
99#ifdef CONFIG_MIPS64 99#ifdef CONFIG_64BIT
100static void __init fixrange_init(unsigned long start, unsigned long end, 100static void __init fixrange_init(unsigned long start, unsigned long end,
101 pgd_t *pgd_base) 101 pgd_t *pgd_base)
102{ 102{
@@ -125,7 +125,7 @@ static void __init fixrange_init(unsigned long start, unsigned long end,
125 j = 0; 125 j = 0;
126 } 126 }
127} 127}
128#endif /* CONFIG_MIPS64 */ 128#endif /* CONFIG_64BIT */
129#endif /* CONFIG_HIGHMEM */ 129#endif /* CONFIG_HIGHMEM */
130 130
131#ifndef CONFIG_NEED_MULTIPLE_NODES 131#ifndef CONFIG_NEED_MULTIPLE_NODES
@@ -258,7 +258,7 @@ void __init mem_init(void)
258#ifdef CONFIG_BLK_DEV_INITRD 258#ifdef CONFIG_BLK_DEV_INITRD
259void free_initrd_mem(unsigned long start, unsigned long end) 259void free_initrd_mem(unsigned long start, unsigned long end)
260{ 260{
261#ifdef CONFIG_MIPS64 261#ifdef CONFIG_64BIT
262 /* Switch from KSEG0 to XKPHYS addresses */ 262 /* Switch from KSEG0 to XKPHYS addresses */
263 start = (unsigned long)phys_to_virt(CPHYSADDR(start)); 263 start = (unsigned long)phys_to_virt(CPHYSADDR(start));
264 end = (unsigned long)phys_to_virt(CPHYSADDR(end)); 264 end = (unsigned long)phys_to_virt(CPHYSADDR(end));
@@ -286,7 +286,7 @@ void free_initmem(void)
286 286
287 addr = (unsigned long) &__init_begin; 287 addr = (unsigned long) &__init_begin;
288 while (addr < (unsigned long) &__init_end) { 288 while (addr < (unsigned long) &__init_end) {
289#ifdef CONFIG_MIPS64 289#ifdef CONFIG_64BIT
290 page = PAGE_OFFSET | CPHYSADDR(addr); 290 page = PAGE_OFFSET | CPHYSADDR(addr);
291#else 291#else
292 page = addr; 292 page = addr;
diff --git a/arch/mips/mm/pg-sb1.c b/arch/mips/mm/pg-sb1.c
index 59d131b5e536..1b6df7133c1e 100644
--- a/arch/mips/mm/pg-sb1.c
+++ b/arch/mips/mm/pg-sb1.c
@@ -114,7 +114,7 @@ static inline void copy_page_cpu(void *to, void *from)
114 " pref " SB1_PREF_STORE_STREAMED_HINT ", -64(%1)\n" 114 " pref " SB1_PREF_STORE_STREAMED_HINT ", -64(%1)\n"
115 " pref " SB1_PREF_LOAD_STREAMED_HINT ", -32(%0)\n" 115 " pref " SB1_PREF_LOAD_STREAMED_HINT ", -32(%0)\n"
116 "1: pref " SB1_PREF_STORE_STREAMED_HINT ", -32(%1)\n" 116 "1: pref " SB1_PREF_STORE_STREAMED_HINT ", -32(%1)\n"
117# ifdef CONFIG_MIPS64 117# ifdef CONFIG_64BIT
118 " ld $8, -128(%0) \n" /* Block copy a cacheline */ 118 " ld $8, -128(%0) \n" /* Block copy a cacheline */
119 " ld $9, -120(%0) \n" 119 " ld $9, -120(%0) \n"
120 " ld $10, -112(%0) \n" 120 " ld $10, -112(%0) \n"
@@ -148,7 +148,7 @@ static inline void copy_page_cpu(void *to, void *from)
148 " daddiu %0, %0, -128 \n" 148 " daddiu %0, %0, -128 \n"
149 " daddiu %1, %1, -128 \n" 149 " daddiu %1, %1, -128 \n"
150#endif 150#endif
151#ifdef CONFIG_MIPS64 151#ifdef CONFIG_64BIT
152 " ld $8, 0(%0) \n" /* Block copy a cacheline */ 152 " ld $8, 0(%0) \n" /* Block copy a cacheline */
153 "1: ld $9, 8(%0) \n" 153 "1: ld $9, 8(%0) \n"
154 " ld $10, 16(%0) \n" 154 " ld $10, 16(%0) \n"
@@ -178,7 +178,7 @@ static inline void copy_page_cpu(void *to, void *from)
178 " daddiu %0, %0, 32 \n" 178 " daddiu %0, %0, 32 \n"
179 " daddiu %1, %1, 32 \n" 179 " daddiu %1, %1, 32 \n"
180 " bnel %0, %2, 1b \n" 180 " bnel %0, %2, 1b \n"
181#ifdef CONFIG_MIPS64 181#ifdef CONFIG_64BIT
182 " ld $8, 0(%0) \n" 182 " ld $8, 0(%0) \n"
183#else 183#else
184 " lw $2, 0(%0) \n" 184 " lw $2, 0(%0) \n"
@@ -186,7 +186,7 @@ static inline void copy_page_cpu(void *to, void *from)
186 " .set pop \n" 186 " .set pop \n"
187 : "+r" (src), "+r" (dst) 187 : "+r" (src), "+r" (dst)
188 : "r" (end) 188 : "r" (end)
189#ifdef CONFIG_MIPS64 189#ifdef CONFIG_64BIT
190 : "$8","$9","$10","$11","memory"); 190 : "$8","$9","$10","$11","memory");
191#else 191#else
192 : "$2","$3","$6","$7","$8","$9","$10","$11","memory"); 192 : "$2","$3","$6","$7","$8","$9","$10","$11","memory");
@@ -198,7 +198,7 @@ static inline void copy_page_cpu(void *to, void *from)
198 198
199/* 199/*
200 * Pad descriptors to cacheline, since each is exclusively owned by a 200 * Pad descriptors to cacheline, since each is exclusively owned by a
201 * particular CPU. 201 * particular CPU.
202 */ 202 */
203typedef struct dmadscr_s { 203typedef struct dmadscr_s {
204 u64 dscr_a; 204 u64 dscr_a;
diff --git a/arch/mips/mm/tlbex.c b/arch/mips/mm/tlbex.c
index 87e229f4d3d5..6569be3983c7 100644
--- a/arch/mips/mm/tlbex.c
+++ b/arch/mips/mm/tlbex.c
@@ -448,7 +448,7 @@ L_LA(_r3000_write_probe_fail)
448L_LA(_r3000_write_probe_ok) 448L_LA(_r3000_write_probe_ok)
449 449
450/* convenience macros for instructions */ 450/* convenience macros for instructions */
451#ifdef CONFIG_MIPS64 451#ifdef CONFIG_64BIT
452# define i_LW(buf, rs, rt, off) i_ld(buf, rs, rt, off) 452# define i_LW(buf, rs, rt, off) i_ld(buf, rs, rt, off)
453# define i_SW(buf, rs, rt, off) i_sd(buf, rs, rt, off) 453# define i_SW(buf, rs, rt, off) i_sd(buf, rs, rt, off)
454# define i_SLL(buf, rs, rt, sh) i_dsll(buf, rs, rt, sh) 454# define i_SLL(buf, rs, rt, sh) i_dsll(buf, rs, rt, sh)
@@ -486,7 +486,7 @@ L_LA(_r3000_write_probe_ok)
486#define i_ssnop(buf) i_sll(buf, 0, 0, 1) 486#define i_ssnop(buf) i_sll(buf, 0, 0, 1)
487#define i_ehb(buf) i_sll(buf, 0, 0, 3) 487#define i_ehb(buf) i_sll(buf, 0, 0, 3)
488 488
489#ifdef CONFIG_MIPS64 489#ifdef CONFIG_64BIT
490static __init int __attribute__((unused)) in_compat_space_p(long addr) 490static __init int __attribute__((unused)) in_compat_space_p(long addr)
491{ 491{
492 /* Is this address in 32bit compat space? */ 492 /* Is this address in 32bit compat space? */
@@ -516,7 +516,7 @@ static __init int rel_lo(long val)
516 516
517static __init void i_LA_mostly(u32 **buf, unsigned int rs, long addr) 517static __init void i_LA_mostly(u32 **buf, unsigned int rs, long addr)
518{ 518{
519#if CONFIG_MIPS64 519#ifdef CONFIG_64BIT
520 if (!in_compat_space_p(addr)) { 520 if (!in_compat_space_p(addr)) {
521 i_lui(buf, rs, rel_highest(addr)); 521 i_lui(buf, rs, rel_highest(addr));
522 if (rel_higher(addr)) 522 if (rel_higher(addr))
@@ -682,7 +682,7 @@ static void il_bgezl(u32 **p, struct reloc **r, unsigned int reg,
682#define C0_EPC 14 682#define C0_EPC 14
683#define C0_XCONTEXT 20 683#define C0_XCONTEXT 20
684 684
685#ifdef CONFIG_MIPS64 685#ifdef CONFIG_64BIT
686# define GET_CONTEXT(buf, reg) i_MFC0(buf, reg, C0_XCONTEXT) 686# define GET_CONTEXT(buf, reg) i_MFC0(buf, reg, C0_XCONTEXT)
687#else 687#else
688# define GET_CONTEXT(buf, reg) i_MFC0(buf, reg, C0_CONTEXT) 688# define GET_CONTEXT(buf, reg) i_MFC0(buf, reg, C0_CONTEXT)
@@ -923,7 +923,7 @@ static __init void build_tlb_write_entry(u32 **p, struct label **l,
923 } 923 }
924} 924}
925 925
926#ifdef CONFIG_MIPS64 926#ifdef CONFIG_64BIT
927/* 927/*
928 * TMP and PTR are scratch. 928 * TMP and PTR are scratch.
929 * TMP will be clobbered, PTR will hold the pmd entry. 929 * TMP will be clobbered, PTR will hold the pmd entry.
@@ -1010,7 +1010,7 @@ build_get_pgd_vmalloc64(u32 **p, struct label **l, struct reloc **r,
1010 } 1010 }
1011} 1011}
1012 1012
1013#else /* !CONFIG_MIPS64 */ 1013#else /* !CONFIG_64BIT */
1014 1014
1015/* 1015/*
1016 * TMP and PTR are scratch. 1016 * TMP and PTR are scratch.
@@ -1038,7 +1038,7 @@ build_get_pgde32(u32 **p, unsigned int tmp, unsigned int ptr)
1038 i_addu(p, ptr, ptr, tmp); /* add in pgd offset */ 1038 i_addu(p, ptr, ptr, tmp); /* add in pgd offset */
1039} 1039}
1040 1040
1041#endif /* !CONFIG_MIPS64 */ 1041#endif /* !CONFIG_64BIT */
1042 1042
1043static __init void build_adjust_context(u32 **p, unsigned int ctx) 1043static __init void build_adjust_context(u32 **p, unsigned int ctx)
1044{ 1044{
@@ -1159,7 +1159,7 @@ static void __init build_r4000_tlb_refill_handler(void)
1159 /* No need for i_nop */ 1159 /* No need for i_nop */
1160 } 1160 }
1161 1161
1162#ifdef CONFIG_MIPS64 1162#ifdef CONFIG_64BIT
1163 build_get_pmde64(&p, &l, &r, K0, K1); /* get pmd in K1 */ 1163 build_get_pmde64(&p, &l, &r, K0, K1); /* get pmd in K1 */
1164#else 1164#else
1165 build_get_pgde32(&p, K0, K1); /* get pgd in K1 */ 1165 build_get_pgde32(&p, K0, K1); /* get pgd in K1 */
@@ -1171,7 +1171,7 @@ static void __init build_r4000_tlb_refill_handler(void)
1171 l_leave(&l, p); 1171 l_leave(&l, p);
1172 i_eret(&p); /* return from trap */ 1172 i_eret(&p); /* return from trap */
1173 1173
1174#ifdef CONFIG_MIPS64 1174#ifdef CONFIG_64BIT
1175 build_get_pgd_vmalloc64(&p, &l, &r, K0, K1); 1175 build_get_pgd_vmalloc64(&p, &l, &r, K0, K1);
1176#endif 1176#endif
1177 1177
@@ -1182,7 +1182,7 @@ static void __init build_r4000_tlb_refill_handler(void)
1182 * need three, with the the second nop'ed and the third being 1182 * need three, with the the second nop'ed and the third being
1183 * unused. 1183 * unused.
1184 */ 1184 */
1185#ifdef CONFIG_MIPS32 1185#ifdef CONFIG_32BIT
1186 if ((p - tlb_handler) > 64) 1186 if ((p - tlb_handler) > 64)
1187 panic("TLB refill handler space exceeded"); 1187 panic("TLB refill handler space exceeded");
1188#else 1188#else
@@ -1195,12 +1195,12 @@ static void __init build_r4000_tlb_refill_handler(void)
1195 /* 1195 /*
1196 * Now fold the handler in the TLB refill handler space. 1196 * Now fold the handler in the TLB refill handler space.
1197 */ 1197 */
1198#ifdef CONFIG_MIPS32 1198#ifdef CONFIG_32BIT
1199 f = final_handler; 1199 f = final_handler;
1200 /* Simplest case, just copy the handler. */ 1200 /* Simplest case, just copy the handler. */
1201 copy_handler(relocs, labels, tlb_handler, p, f); 1201 copy_handler(relocs, labels, tlb_handler, p, f);
1202 final_len = p - tlb_handler; 1202 final_len = p - tlb_handler;
1203#else /* CONFIG_MIPS64 */ 1203#else /* CONFIG_64BIT */
1204 f = final_handler + 32; 1204 f = final_handler + 32;
1205 if ((p - tlb_handler) <= 32) { 1205 if ((p - tlb_handler) <= 32) {
1206 /* Just copy the handler. */ 1206 /* Just copy the handler. */
@@ -1235,7 +1235,7 @@ static void __init build_r4000_tlb_refill_handler(void)
1235 copy_handler(relocs, labels, split, p, final_handler); 1235 copy_handler(relocs, labels, split, p, final_handler);
1236 final_len = (f - (final_handler + 32)) + (p - split); 1236 final_len = (f - (final_handler + 32)) + (p - split);
1237 } 1237 }
1238#endif /* CONFIG_MIPS64 */ 1238#endif /* CONFIG_64BIT */
1239 1239
1240 resolve_relocs(relocs, labels); 1240 resolve_relocs(relocs, labels);
1241 printk("Synthesized TLB refill handler (%u instructions).\n", 1241 printk("Synthesized TLB refill handler (%u instructions).\n",
@@ -1605,7 +1605,7 @@ build_r4000_tlbchange_handler_head(u32 **p, struct label **l,
1605 struct reloc **r, unsigned int pte, 1605 struct reloc **r, unsigned int pte,
1606 unsigned int ptr) 1606 unsigned int ptr)
1607{ 1607{
1608#ifdef CONFIG_MIPS64 1608#ifdef CONFIG_64BIT
1609 build_get_pmde64(p, l, r, pte, ptr); /* get pmd in ptr */ 1609 build_get_pmde64(p, l, r, pte, ptr); /* get pmd in ptr */
1610#else 1610#else
1611 build_get_pgde32(p, pte, ptr); /* get pgd in ptr */ 1611 build_get_pgde32(p, pte, ptr); /* get pgd in ptr */
@@ -1636,7 +1636,7 @@ build_r4000_tlbchange_handler_tail(u32 **p, struct label **l,
1636 l_leave(l, *p); 1636 l_leave(l, *p);
1637 i_eret(p); /* return from trap */ 1637 i_eret(p); /* return from trap */
1638 1638
1639#ifdef CONFIG_MIPS64 1639#ifdef CONFIG_64BIT
1640 build_get_pgd_vmalloc64(p, l, r, tmp, ptr); 1640 build_get_pgd_vmalloc64(p, l, r, tmp, ptr);
1641#endif 1641#endif
1642} 1642}
diff --git a/arch/mips/momentum/jaguar_atx/int-handler.S b/arch/mips/momentum/jaguar_atx/int-handler.S
index 43fd5a58077c..55bc789733f2 100644
--- a/arch/mips/momentum/jaguar_atx/int-handler.S
+++ b/arch/mips/momentum/jaguar_atx/int-handler.S
@@ -27,11 +27,11 @@
27 SAVE_ALL 27 SAVE_ALL
28 CLI 28 CLI
29 .set at 29 .set at
30 mfc0 t0, CP0_CAUSE 30 mfc0 t0, CP0_CAUSE
31 mfc0 t2, CP0_STATUS 31 mfc0 t2, CP0_STATUS
32 32
33 and t0, t2 33 and t0, t2
34 34
35 andi t1, t0, STATUSF_IP0 /* sw0 software interrupt */ 35 andi t1, t0, STATUSF_IP0 /* sw0 software interrupt */
36 bnez t1, ll_sw0_irq 36 bnez t1, ll_sw0_irq
37 andi t1, t0, STATUSF_IP1 /* sw1 software interrupt */ 37 andi t1, t0, STATUSF_IP1 /* sw1 software interrupt */
@@ -103,25 +103,25 @@ ll_pcia_irq:
103 move a1, sp 103 move a1, sp
104 jal do_IRQ 104 jal do_IRQ
105 j ret_from_irq 105 j ret_from_irq
106 106
107ll_pcib_irq: 107ll_pcib_irq:
108 li a0, 5 108 li a0, 5
109 move a1, sp 109 move a1, sp
110 jal do_IRQ 110 jal do_IRQ
111 j ret_from_irq 111 j ret_from_irq
112 112
113ll_uart_irq: 113ll_uart_irq:
114 li a0, 6 114 li a0, 6
115 move a1, sp 115 move a1, sp
116 jal do_IRQ 116 jal do_IRQ
117 j ret_from_irq 117 j ret_from_irq
118 118
119ll_cputimer_irq: 119ll_cputimer_irq:
120 li a0, 7 120 li a0, 7
121 move a1, sp 121 move a1, sp
122 jal ll_timer_interrupt 122 jal ll_timer_interrupt
123 j ret_from_irq 123 j ret_from_irq
124 124
125ll_mv64340_decode_irq: 125ll_mv64340_decode_irq:
126 move a0, sp 126 move a0, sp
127 jal ll_mv64340_irq 127 jal ll_mv64340_irq
diff --git a/arch/mips/momentum/jaguar_atx/prom.c b/arch/mips/momentum/jaguar_atx/prom.c
index fa5982ac0ac6..14ae2e713585 100644
--- a/arch/mips/momentum/jaguar_atx/prom.c
+++ b/arch/mips/momentum/jaguar_atx/prom.c
@@ -64,7 +64,7 @@ static u8 exchange_bit(u8 val, u8 cs)
64 64
65 /* turn the clock off and read-strobe */ 65 /* turn the clock off and read-strobe */
66 JAGUAR_FPGA_WRITE((val << 2) | cs | 0x10, EEPROM_MODE); 66 JAGUAR_FPGA_WRITE((val << 2) | cs | 0x10, EEPROM_MODE);
67 67
68 /* return the data */ 68 /* return the data */
69 return ((JAGUAR_FPGA_READ(EEPROM_MODE) >> 3) & 0x1); 69 return ((JAGUAR_FPGA_READ(EEPROM_MODE) >> 3) & 0x1);
70} 70}
@@ -90,7 +90,7 @@ void get_mac(char dest[6])
90} 90}
91#endif 91#endif
92 92
93#ifdef CONFIG_MIPS64 93#ifdef CONFIG_64BIT
94 94
95unsigned long signext(unsigned long addr) 95unsigned long signext(unsigned long addr)
96{ 96{
@@ -143,7 +143,7 @@ char *arg64(unsigned long addrin, int arg_index)
143 143
144 return p; 144 return p;
145} 145}
146#endif /* CONFIG_MIPS64 */ 146#endif /* CONFIG_64BIT */
147 147
148/* PMON passes arguments in C main() style */ 148/* PMON passes arguments in C main() style */
149void __init prom_init(void) 149void __init prom_init(void)
@@ -158,7 +158,7 @@ void __init prom_init(void)
158// ja_setup_console(); /* The very first thing. */ 158// ja_setup_console(); /* The very first thing. */
159#endif 159#endif
160 160
161#ifdef CONFIG_MIPS64 161#ifdef CONFIG_64BIT
162 char *ptr; 162 char *ptr;
163 163
164 printk("Mips64 Jaguar-ATX\n"); 164 printk("Mips64 Jaguar-ATX\n");
@@ -201,7 +201,7 @@ void __init prom_init(void)
201 } 201 }
202 printk("arcs_cmdline: %s\n", arcs_cmdline); 202 printk("arcs_cmdline: %s\n", arcs_cmdline);
203 203
204#else /* CONFIG_MIPS64 */ 204#else /* CONFIG_64BIT */
205 /* save the PROM vectors for debugging use */ 205 /* save the PROM vectors for debugging use */
206 debug_vectors = cv; 206 debug_vectors = cv;
207 207
@@ -226,7 +226,7 @@ void __init prom_init(void)
226 } 226 }
227 env++; 227 env++;
228 } 228 }
229#endif /* CONFIG_MIPS64 */ 229#endif /* CONFIG_64BIT */
230 mips_machgroup = MACH_GROUP_MOMENCO; 230 mips_machgroup = MACH_GROUP_MOMENCO;
231 mips_machtype = MACH_MOMENCO_JAGUAR_ATX; 231 mips_machtype = MACH_MOMENCO_JAGUAR_ATX;
232 232
diff --git a/arch/mips/momentum/jaguar_atx/reset.c b/arch/mips/momentum/jaguar_atx/reset.c
index 48039484cdf9..c4236b1e59fa 100644
--- a/arch/mips/momentum/jaguar_atx/reset.c
+++ b/arch/mips/momentum/jaguar_atx/reset.c
@@ -27,7 +27,7 @@
27void momenco_jaguar_restart(char *command) 27void momenco_jaguar_restart(char *command)
28{ 28{
29 /* base address of timekeeper portion of part */ 29 /* base address of timekeeper portion of part */
30#ifdef CONFIG_MIPS64 30#ifdef CONFIG_64BIT
31 void *nvram = (void*) 0xfffffffffc807000; 31 void *nvram = (void*) 0xfffffffffc807000;
32#else 32#else
33 void *nvram = (void*) 0xfc807000; 33 void *nvram = (void*) 0xfc807000;
diff --git a/arch/mips/momentum/jaguar_atx/setup.c b/arch/mips/momentum/jaguar_atx/setup.c
index 30462e715066..90288cf2b1e0 100644
--- a/arch/mips/momentum/jaguar_atx/setup.c
+++ b/arch/mips/momentum/jaguar_atx/setup.c
@@ -105,7 +105,7 @@ void __init bus_error_init(void) { /* nothing */ }
105 105
106static __init void wire_stupidity_into_tlb(void) 106static __init void wire_stupidity_into_tlb(void)
107{ 107{
108#ifdef CONFIG_MIPS32 108#ifdef CONFIG_32BIT
109 write_c0_wired(0); 109 write_c0_wired(0);
110 local_flush_tlb_all(); 110 local_flush_tlb_all();
111 111
@@ -451,7 +451,7 @@ static int __init momenco_jaguar_atx_setup(void)
451#ifdef GEMDEBUG_TRACEBUFFER 451#ifdef GEMDEBUG_TRACEBUFFER
452 { 452 {
453 unsigned int tbControl; 453 unsigned int tbControl;
454 tbControl = 454 tbControl =
455 0 << 26 | /* post trigger delay 0 */ 455 0 << 26 | /* post trigger delay 0 */
456 0x2 << 16 | /* sequential trace mode */ 456 0x2 << 16 | /* sequential trace mode */
457 // 0x0 << 16 | /* non-sequential trace mode */ 457 // 0x0 << 16 | /* non-sequential trace mode */
diff --git a/arch/mips/momentum/ocelot_3/prom.c b/arch/mips/momentum/ocelot_3/prom.c
index 89c17a0c0bed..c4fa9c525faa 100644
--- a/arch/mips/momentum/ocelot_3/prom.c
+++ b/arch/mips/momentum/ocelot_3/prom.c
@@ -93,7 +93,7 @@ void get_mac(char dest[6])
93#endif 93#endif
94 94
95 95
96#ifdef CONFIG_MIPS64 96#ifdef CONFIG_64BIT
97 97
98unsigned long signext(unsigned long addr) 98unsigned long signext(unsigned long addr)
99{ 99{
@@ -145,7 +145,7 @@ char *arg64(unsigned long addrin, int arg_index)
145 145
146 return p; 146 return p;
147} 147}
148#endif /* CONFIG_MIPS64 */ 148#endif /* CONFIG_64BIT */
149 149
150void __init prom_init(void) 150void __init prom_init(void)
151{ 151{
@@ -155,7 +155,7 @@ void __init prom_init(void)
155 struct callvectors *cv = (struct callvectors *) fw_arg3; 155 struct callvectors *cv = (struct callvectors *) fw_arg3;
156 int i; 156 int i;
157 157
158#ifdef CONFIG_MIPS64 158#ifdef CONFIG_64BIT
159 char *ptr; 159 char *ptr;
160 printk("prom_init - MIPS64\n"); 160 printk("prom_init - MIPS64\n");
161 161
@@ -198,7 +198,7 @@ void __init prom_init(void)
198 } 198 }
199 printk("arcs_cmdline: %s\n", arcs_cmdline); 199 printk("arcs_cmdline: %s\n", arcs_cmdline);
200 200
201#else /* CONFIG_MIPS64 */ 201#else /* CONFIG_64BIT */
202 202
203 /* save the PROM vectors for debugging use */ 203 /* save the PROM vectors for debugging use */
204 debug_vectors = cv; 204 debug_vectors = cv;
@@ -224,7 +224,7 @@ void __init prom_init(void)
224 } 224 }
225 env++; 225 env++;
226 } 226 }
227#endif /* CONFIG_MIPS64 */ 227#endif /* CONFIG_64BIT */
228 228
229 mips_machgroup = MACH_GROUP_MOMENCO; 229 mips_machgroup = MACH_GROUP_MOMENCO;
230 mips_machtype = MACH_MOMENCO_OCELOT_3; 230 mips_machtype = MACH_MOMENCO_OCELOT_3;
@@ -234,7 +234,7 @@ void __init prom_init(void)
234 get_mac(prom_mac_addr_base); 234 get_mac(prom_mac_addr_base);
235#endif 235#endif
236 236
237#ifndef CONFIG_MIPS64 237#ifndef CONFIG_64BIT
238 debug_vectors->printf("Booting Linux kernel...\n"); 238 debug_vectors->printf("Booting Linux kernel...\n");
239#endif 239#endif
240} 240}
diff --git a/arch/mips/momentum/ocelot_c/int-handler.S b/arch/mips/momentum/ocelot_c/int-handler.S
index 2f2430648abc..52349d9bf1be 100644
--- a/arch/mips/momentum/ocelot_c/int-handler.S
+++ b/arch/mips/momentum/ocelot_c/int-handler.S
@@ -27,11 +27,11 @@
27 SAVE_ALL 27 SAVE_ALL
28 CLI 28 CLI
29 .set at 29 .set at
30 mfc0 t0, CP0_CAUSE 30 mfc0 t0, CP0_CAUSE
31 mfc0 t2, CP0_STATUS 31 mfc0 t2, CP0_STATUS
32 32
33 and t0, t2 33 and t0, t2
34 34
35 andi t1, t0, STATUSF_IP0 /* sw0 software interrupt */ 35 andi t1, t0, STATUSF_IP0 /* sw0 software interrupt */
36 bnez t1, ll_sw0_irq 36 bnez t1, ll_sw0_irq
37 andi t1, t0, STATUSF_IP1 /* sw1 software interrupt */ 37 andi t1, t0, STATUSF_IP1 /* sw1 software interrupt */
@@ -83,7 +83,7 @@ ll_pmc_irq:
83 move a1, sp 83 move a1, sp
84 jal do_IRQ 84 jal do_IRQ
85 j ret_from_irq 85 j ret_from_irq
86 86
87ll_cpci_decode_irq: 87ll_cpci_decode_irq:
88 move a0, sp 88 move a0, sp
89 jal ll_cpci_irq 89 jal ll_cpci_irq
@@ -99,4 +99,4 @@ ll_cputimer_irq:
99 move a1, sp 99 move a1, sp
100 jal do_IRQ 100 jal do_IRQ
101 j ret_from_irq 101 j ret_from_irq
102 102
diff --git a/arch/mips/momentum/ocelot_c/ocelot_c_fpga.h b/arch/mips/momentum/ocelot_c/ocelot_c_fpga.h
index a6cf7a7959b3..97fb77dad723 100644
--- a/arch/mips/momentum/ocelot_c/ocelot_c_fpga.h
+++ b/arch/mips/momentum/ocelot_c/ocelot_c_fpga.h
@@ -32,7 +32,7 @@
32 32
33#include <linux/config.h> 33#include <linux/config.h>
34 34
35#ifdef CONFIG_MIPS64 35#ifdef CONFIG_64BIT
36#define OCELOT_C_CS0_ADDR (0xfffffffffc000000) 36#define OCELOT_C_CS0_ADDR (0xfffffffffc000000)
37#else 37#else
38#define OCELOT_C_CS0_ADDR (0xfc000000) 38#define OCELOT_C_CS0_ADDR (0xfc000000)
diff --git a/arch/mips/momentum/ocelot_c/prom.c b/arch/mips/momentum/ocelot_c/prom.c
index 49ac302d8901..5b6809724b15 100644
--- a/arch/mips/momentum/ocelot_c/prom.c
+++ b/arch/mips/momentum/ocelot_c/prom.c
@@ -67,7 +67,7 @@ static u8 exchange_bit(u8 val, u8 cs)
67 67
68 /* turn the clock off and read-strobe */ 68 /* turn the clock off and read-strobe */
69 OCELOT_FPGA_WRITE((val << 2) | cs | 0x10, EEPROM_MODE); 69 OCELOT_FPGA_WRITE((val << 2) | cs | 0x10, EEPROM_MODE);
70 70
71 /* return the data */ 71 /* return the data */
72 return ((OCELOT_FPGA_READ(EEPROM_MODE) >> 3) & 0x1); 72 return ((OCELOT_FPGA_READ(EEPROM_MODE) >> 3) & 0x1);
73} 73}
@@ -94,7 +94,7 @@ void get_mac(char dest[6])
94#endif 94#endif
95 95
96 96
97#ifdef CONFIG_MIPS64 97#ifdef CONFIG_64BIT
98 98
99unsigned long signext(unsigned long addr) 99unsigned long signext(unsigned long addr)
100{ 100{
@@ -144,7 +144,7 @@ char *arg64(unsigned long addrin, int arg_index)
144 p = (char *)get_arg(args, arg_index); 144 p = (char *)get_arg(args, arg_index);
145 return p; 145 return p;
146} 146}
147#endif /* CONFIG_MIPS64 */ 147#endif /* CONFIG_64BIT */
148 148
149 149
150void __init prom_init(void) 150void __init prom_init(void)
@@ -155,7 +155,7 @@ void __init prom_init(void)
155 struct callvectors *cv = (struct callvectors *) fw_arg3; 155 struct callvectors *cv = (struct callvectors *) fw_arg3;
156 int i; 156 int i;
157 157
158#ifdef CONFIG_MIPS64 158#ifdef CONFIG_64BIT
159 char *ptr; 159 char *ptr;
160 160
161 printk("prom_init - MIPS64\n"); 161 printk("prom_init - MIPS64\n");
@@ -197,7 +197,7 @@ void __init prom_init(void)
197 } 197 }
198 printk("arcs_cmdline: %s\n", arcs_cmdline); 198 printk("arcs_cmdline: %s\n", arcs_cmdline);
199 199
200#else /* CONFIG_MIPS64 */ 200#else /* CONFIG_64BIT */
201 /* save the PROM vectors for debugging use */ 201 /* save the PROM vectors for debugging use */
202 debug_vectors = cv; 202 debug_vectors = cv;
203 203
@@ -222,7 +222,7 @@ void __init prom_init(void)
222 } 222 }
223 env++; 223 env++;
224 } 224 }
225#endif /* CONFIG_MIPS64 */ 225#endif /* CONFIG_64BIT */
226 226
227 mips_machgroup = MACH_GROUP_MOMENCO; 227 mips_machgroup = MACH_GROUP_MOMENCO;
228 mips_machtype = MACH_MOMENCO_OCELOT_C; 228 mips_machtype = MACH_MOMENCO_OCELOT_C;
@@ -232,7 +232,7 @@ void __init prom_init(void)
232 get_mac(prom_mac_addr_base); 232 get_mac(prom_mac_addr_base);
233#endif 233#endif
234 234
235#ifndef CONFIG_MIPS64 235#ifndef CONFIG_64BIT
236 debug_vectors->printf("Booting Linux kernel...\n"); 236 debug_vectors->printf("Booting Linux kernel...\n");
237#endif 237#endif
238} 238}
diff --git a/arch/mips/momentum/ocelot_c/reset.c b/arch/mips/momentum/ocelot_c/reset.c
index 1f2b4263cc8c..6a2489f3b9a0 100644
--- a/arch/mips/momentum/ocelot_c/reset.c
+++ b/arch/mips/momentum/ocelot_c/reset.c
@@ -28,7 +28,7 @@ void momenco_ocelot_restart(char *command)
28{ 28{
29 /* base address of timekeeper portion of part */ 29 /* base address of timekeeper portion of part */
30 void *nvram = (void *) 30 void *nvram = (void *)
31#ifdef CONFIG_MIPS64 31#ifdef CONFIG_64BIT
32 0xfffffffffc807000; 32 0xfffffffffc807000;
33#else 33#else
34 0xfc807000; 34 0xfc807000;
diff --git a/arch/mips/momentum/ocelot_c/setup.c b/arch/mips/momentum/ocelot_c/setup.c
index 021c00e3c07c..844ddd06349b 100644
--- a/arch/mips/momentum/ocelot_c/setup.c
+++ b/arch/mips/momentum/ocelot_c/setup.c
@@ -109,7 +109,7 @@ void PMON_v2_setup(void)
109 */ 109 */
110 printk("PMON_v2_setup\n"); 110 printk("PMON_v2_setup\n");
111 111
112#ifdef CONFIG_MIPS64 112#ifdef CONFIG_64BIT
113 /* marvell and extra space */ 113 /* marvell and extra space */
114 add_wired_entry(ENTRYLO(0xf4000000), ENTRYLO(0xf4010000), 0xfffffffff4000000, PM_64K); 114 add_wired_entry(ENTRYLO(0xf4000000), ENTRYLO(0xf4010000), 0xfffffffff4000000, PM_64K);
115 /* fpga, rtc, and uart */ 115 /* fpga, rtc, and uart */
@@ -134,7 +134,7 @@ void PMON_v2_setup(void)
134 134
135unsigned long m48t37y_get_time(void) 135unsigned long m48t37y_get_time(void)
136{ 136{
137#ifdef CONFIG_MIPS64 137#ifdef CONFIG_64BIT
138 unsigned char *rtc_base = (unsigned char*)0xfffffffffc800000; 138 unsigned char *rtc_base = (unsigned char*)0xfffffffffc800000;
139#else 139#else
140 unsigned char* rtc_base = (unsigned char*)0xfc800000; 140 unsigned char* rtc_base = (unsigned char*)0xfc800000;
@@ -163,7 +163,7 @@ unsigned long m48t37y_get_time(void)
163 163
164int m48t37y_set_time(unsigned long sec) 164int m48t37y_set_time(unsigned long sec)
165{ 165{
166#ifdef CONFIG_MIPS64 166#ifdef CONFIG_64BIT
167 unsigned char* rtc_base = (unsigned char*)0xfffffffffc800000; 167 unsigned char* rtc_base = (unsigned char*)0xfffffffffc800000;
168#else 168#else
169 unsigned char* rtc_base = (unsigned char*)0xfc800000; 169 unsigned char* rtc_base = (unsigned char*)0xfc800000;
@@ -342,7 +342,7 @@ static void __init momenco_ocelot_c_setup(void)
342 342
343early_initcall(momenco_ocelot_c_setup); 343early_initcall(momenco_ocelot_c_setup);
344 344
345#ifndef CONFIG_MIPS64 345#ifndef CONFIG_64BIT
346/* This needs to be one of the first initcalls, because no I/O port access 346/* This needs to be one of the first initcalls, because no I/O port access
347 can work before this */ 347 can work before this */
348static int io_base_ioremap(void) 348static int io_base_ioremap(void)
diff --git a/arch/mips/pci/fixup-ddb5074.c b/arch/mips/pci/fixup-ddb5074.c
index b345e528a53c..5a4a7c239c42 100644
--- a/arch/mips/pci/fixup-ddb5074.c
+++ b/arch/mips/pci/fixup-ddb5074.c
@@ -5,7 +5,7 @@ static void ddb5074_fixup(struct pci_dev *dev)
5{ 5{
6 extern struct pci_dev *pci_pmu; 6 extern struct pci_dev *pci_pmu;
7 u8 t8; 7 u8 t8;
8 8
9 pci_pmu = dev; /* for LEDs D2 and D3 */ 9 pci_pmu = dev; /* for LEDs D2 and D3 */
10 /* Program the lines for LEDs D2 and D3 to output */ 10 /* Program the lines for LEDs D2 and D3 to output */
11 pci_read_config_byte(dev, 0x7d, &t8); 11 pci_read_config_byte(dev, 0x7d, &t8);
diff --git a/arch/mips/pci/fixup-ddb5477.c b/arch/mips/pci/fixup-ddb5477.c
index 6abdc88bab1e..2f1444e60654 100644
--- a/arch/mips/pci/fixup-ddb5477.c
+++ b/arch/mips/pci/fixup-ddb5477.c
@@ -65,7 +65,7 @@ static void ddb5477_amd_lance_fixup(struct pci_dev *dev)
65 ioaddr = pci_resource_start(dev, 0); 65 ioaddr = pci_resource_start(dev, 0);
66 66
67 inw(ioaddr + PCNET32_WIO_RESET); /* reset chip */ 67 inw(ioaddr + PCNET32_WIO_RESET); /* reset chip */
68 68
69 /* bcr_18 |= 0x0800 */ 69 /* bcr_18 |= 0x0800 */
70 outw(18, ioaddr + PCNET32_WIO_RAP); 70 outw(18, ioaddr + PCNET32_WIO_RAP);
71 temp = inw(ioaddr + PCNET32_WIO_BDP); 71 temp = inw(ioaddr + PCNET32_WIO_BDP);
diff --git a/arch/mips/pci/fixup-malta.c b/arch/mips/pci/fixup-malta.c
index b9296d9942b3..bf2c41d1e9c5 100644
--- a/arch/mips/pci/fixup-malta.c
+++ b/arch/mips/pci/fixup-malta.c
@@ -56,7 +56,7 @@ static void __init malta_piix_func0_fixup(struct pci_dev *pdev)
56 0, 0, 0, 3, 56 0, 0, 0, 3,
57 4, 5, 6, 7, 57 4, 5, 6, 7,
58 0, 9, 10, 11, 58 0, 9, 10, 11,
59 12, 0, 14, 15 59 12, 0, 14, 15
60 }; 60 };
61 int i; 61 int i;
62 62
diff --git a/arch/mips/pci/fixup-rbtx4927.c b/arch/mips/pci/fixup-rbtx4927.c
index de4e443da208..ceeb1860895a 100644
--- a/arch/mips/pci/fixup-rbtx4927.c
+++ b/arch/mips/pci/fixup-rbtx4927.c
@@ -7,7 +7,7 @@
7 * Author: MontaVista Software, Inc. 7 * Author: MontaVista Software, Inc.
8 * ppopov@mvista.com or source@mvista.com 8 * ppopov@mvista.com or source@mvista.com
9 * 9 *
10 * Copyright (C) 2000-2001 Toshiba Corporation 10 * Copyright (C) 2000-2001 Toshiba Corporation
11 * 11 *
12 * Copyright (C) 2004 MontaVista Software Inc. 12 * Copyright (C) 2004 MontaVista Software Inc.
13 * Author: Manish Lachwani (mlachwani@mvista.com) 13 * Author: Manish Lachwani (mlachwani@mvista.com)
diff --git a/arch/mips/pci/fixup-sni.c b/arch/mips/pci/fixup-sni.c
index c8ef01a017cc..a176f2ca8656 100644
--- a/arch/mips/pci/fixup-sni.c
+++ b/arch/mips/pci/fixup-sni.c
@@ -32,7 +32,7 @@
32 * Device 4: Unused 32 * Device 4: Unused
33 * Device 5: Slot 2 33 * Device 5: Slot 2
34 * Device 6: Slot 3 34 * Device 6: Slot 3
35 * Device 7: Slot 4 35 * Device 7: Slot 4
36 * 36 *
37 * Documentation says the VGA is device 5 and device 3 is unused but that 37 * Documentation says the VGA is device 5 and device 3 is unused but that
38 * seem to be a documentation error. At least on my RM200C the Cirrus 38 * seem to be a documentation error. At least on my RM200C the Cirrus
diff --git a/arch/mips/pci/fixup-tb0219.c b/arch/mips/pci/fixup-tb0219.c
index 850a900f0eb4..bc55b06e1904 100644
--- a/arch/mips/pci/fixup-tb0219.c
+++ b/arch/mips/pci/fixup-tb0219.c
@@ -29,27 +29,12 @@ int __init pcibios_map_irq(struct pci_dev *dev, u8 slot, u8 pin)
29 29
30 switch (slot) { 30 switch (slot) {
31 case 12: 31 case 12:
32 vr41xx_set_irq_trigger(TB0219_PCI_SLOT1_PIN,
33 TRIGGER_LEVEL,
34 SIGNAL_THROUGH);
35 vr41xx_set_irq_level(TB0219_PCI_SLOT1_PIN,
36 LEVEL_LOW);
37 irq = TB0219_PCI_SLOT1_IRQ; 32 irq = TB0219_PCI_SLOT1_IRQ;
38 break; 33 break;
39 case 13: 34 case 13:
40 vr41xx_set_irq_trigger(TB0219_PCI_SLOT2_PIN,
41 TRIGGER_LEVEL,
42 SIGNAL_THROUGH);
43 vr41xx_set_irq_level(TB0219_PCI_SLOT2_PIN,
44 LEVEL_LOW);
45 irq = TB0219_PCI_SLOT2_IRQ; 35 irq = TB0219_PCI_SLOT2_IRQ;
46 break; 36 break;
47 case 14: 37 case 14:
48 vr41xx_set_irq_trigger(TB0219_PCI_SLOT3_PIN,
49 TRIGGER_LEVEL,
50 SIGNAL_THROUGH);
51 vr41xx_set_irq_level(TB0219_PCI_SLOT3_PIN,
52 LEVEL_LOW);
53 irq = TB0219_PCI_SLOT3_IRQ; 38 irq = TB0219_PCI_SLOT3_IRQ;
54 break; 39 break;
55 default: 40 default:
diff --git a/arch/mips/pci/ops-ddb5477.c b/arch/mips/pci/ops-ddb5477.c
index e955443fedf9..0406b50a37d8 100644
--- a/arch/mips/pci/ops-ddb5477.c
+++ b/arch/mips/pci/ops-ddb5477.c
@@ -127,7 +127,7 @@ static inline void ddb_close_config_base(struct pci_config_swap *swap)
127} 127}
128 128
129static int read_config_dword(struct pci_config_swap *swap, 129static int read_config_dword(struct pci_config_swap *swap,
130 struct pci_bus *bus, u32 devfn, u32 where, 130 struct pci_bus *bus, u32 devfn, u32 where,
131 u32 * val) 131 u32 * val)
132{ 132{
133 u32 bus_num, slot_num, func_num; 133 u32 bus_num, slot_num, func_num;
@@ -153,7 +153,7 @@ static int read_config_dword(struct pci_config_swap *swap,
153} 153}
154 154
155static int read_config_word(struct pci_config_swap *swap, 155static int read_config_word(struct pci_config_swap *swap,
156 struct pci_bus *bus, u32 devfn, u32 where, 156 struct pci_bus *bus, u32 devfn, u32 where,
157 u16 * val) 157 u16 * val)
158{ 158{
159 int status; 159 int status;
diff --git a/arch/mips/pci/ops-tx4927.c b/arch/mips/pci/ops-tx4927.c
index 2a9d7227fe87..7688b7711329 100644
--- a/arch/mips/pci/ops-tx4927.c
+++ b/arch/mips/pci/ops-tx4927.c
@@ -1,16 +1,16 @@
1/* 1/*
2 * Copyright 2001 MontaVista Software Inc. 2 * Copyright 2001 MontaVista Software Inc.
3 * Author: MontaVista Software, Inc. 3 * Author: MontaVista Software, Inc.
4 * ahennessy@mvista.com 4 * ahennessy@mvista.com
5 * 5 *
6 * Copyright (C) 2000-2001 Toshiba Corporation 6 * Copyright (C) 2000-2001 Toshiba Corporation
7 * Copyright (C) 2004 by Ralf Baechle (ralf@linux-mips.org) 7 * Copyright (C) 2004 by Ralf Baechle (ralf@linux-mips.org)
8 * 8 *
9 * Based on arch/mips/ddb5xxx/ddb5477/pci_ops.c 9 * Based on arch/mips/ddb5xxx/ddb5477/pci_ops.c
10 * 10 *
11 * Define the pci_ops for the Toshiba rbtx4927 11 * Define the pci_ops for the Toshiba rbtx4927
12 * 12 *
13 * Much of the code is derived from the original DDB5074 port by 13 * Much of the code is derived from the original DDB5074 port by
14 * Geert Uytterhoeven <geert@sonycom.com> 14 * Geert Uytterhoeven <geert@sonycom.com>
15 * 15 *
16 * Copyright 2004 MontaVista Software Inc. 16 * Copyright 2004 MontaVista Software Inc.
diff --git a/arch/mips/pci/pci-ddb5477.c b/arch/mips/pci/pci-ddb5477.c
index 4ddd53eaf656..826d653184e5 100644
--- a/arch/mips/pci/pci-ddb5477.c
+++ b/arch/mips/pci/pci-ddb5477.c
@@ -76,7 +76,7 @@ struct pci_controller ddb5477_io_controller = {
76 */ 76 */
77 77
78/* 78/*
79 * irq mapping : device -> pci int # -> vrc4377 irq# , 79 * irq mapping : device -> pci int # -> vrc4377 irq# ,
80 * ddb5477 board manual page 4 and vrc5477 manual page 46 80 * ddb5477 board manual page 4 and vrc5477 manual page 46
81 */ 81 */
82 82
@@ -137,9 +137,9 @@ int __init pcibios_map_irq(struct pci_dev *dev, u8 slot, u8 pin)
137 unsigned char *slot_irq_map; 137 unsigned char *slot_irq_map;
138 unsigned char irq; 138 unsigned char irq;
139 139
140 /* 140 /*
141 * We ignore the swizzled slot and pin values. The original 141 * We ignore the swizzled slot and pin values. The original
142 * pci_fixup_irq() codes largely base irq number on the dev slot 142 * pci_fixup_irq() codes largely base irq number on the dev slot
143 * numbers because except for one case they are unique even 143 * numbers because except for one case they are unique even
144 * though there are multiple pci buses. 144 * though there are multiple pci buses.
145 */ 145 */
@@ -160,7 +160,7 @@ int __init pcibios_map_irq(struct pci_dev *dev, u8 slot, u8 pin)
160 160
161 if (mips_machtype == MACH_NEC_ROCKHOPPERII) { 161 if (mips_machtype == MACH_NEC_ROCKHOPPERII) {
162 /* hack to distinquish overlapping slot 20s, one 162 /* hack to distinquish overlapping slot 20s, one
163 * on bus 0 (ALI USB on the M1535 on the backplane), 163 * on bus 0 (ALI USB on the M1535 on the backplane),
164 * and one on bus 2 (NEC USB controller on the CPU board) 164 * and one on bus 2 (NEC USB controller on the CPU board)
165 * Make the M1535 USB - ISA IRQ number 9. 165 * Make the M1535 USB - ISA IRQ number 9.
166 */ 166 */
diff --git a/arch/mips/pci/pci-ip32.c b/arch/mips/pci/pci-ip32.c
index 1faeb034f06e..000dc6af6cd3 100644
--- a/arch/mips/pci/pci-ip32.c
+++ b/arch/mips/pci/pci-ip32.c
@@ -84,7 +84,7 @@ static irqreturn_t macepci_error(int irq, void *dev, struct pt_regs *regs)
84 84
85 85
86extern struct pci_ops mace_pci_ops; 86extern struct pci_ops mace_pci_ops;
87#ifdef CONFIG_MIPS64 87#ifdef CONFIG_64BIT
88static struct resource mace_pci_mem_resource = { 88static struct resource mace_pci_mem_resource = {
89 .name = "SGI O2 PCI MEM", 89 .name = "SGI O2 PCI MEM",
90 .start = MACEPCI_HI_MEMORY, 90 .start = MACEPCI_HI_MEMORY,
diff --git a/arch/mips/pci/pci.c b/arch/mips/pci/pci.c
index 8141dffac241..a8d499b0a36f 100644
--- a/arch/mips/pci/pci.c
+++ b/arch/mips/pci/pci.c
@@ -132,7 +132,7 @@ static int __init pcibios_init(void)
132 hose->need_domain_info = need_domain_info; 132 hose->need_domain_info = need_domain_info;
133 next_busno = bus->subordinate + 1; 133 next_busno = bus->subordinate + 1;
134 /* Don't allow 8-bit bus number overflow inside the hose - 134 /* Don't allow 8-bit bus number overflow inside the hose -
135 reserve some space for bridges. */ 135 reserve some space for bridges. */
136 if (next_busno > 224) { 136 if (next_busno > 224) {
137 next_busno = 0; 137 next_busno = 0;
138 need_domain_info = 1; 138 need_domain_info = 1;
@@ -260,7 +260,7 @@ void __devinit pcibios_fixup_bus(struct pci_bus *bus)
260 (dev->class >> 8) == PCI_CLASS_BRIDGE_PCI) { 260 (dev->class >> 8) == PCI_CLASS_BRIDGE_PCI) {
261 pci_read_bridge_bases(bus); 261 pci_read_bridge_bases(bus);
262 pcibios_fixup_device_resources(dev, bus); 262 pcibios_fixup_device_resources(dev, bus);
263 } 263 }
264 264
265 for (ln = bus->devices.next; ln != &bus->devices; ln = ln->next) { 265 for (ln = bus->devices.next; ln != &bus->devices; ln = ln->next) {
266 struct pci_dev *dev = pci_dev_b(ln); 266 struct pci_dev *dev = pci_dev_b(ln);
@@ -292,8 +292,25 @@ pcibios_resource_to_bus(struct pci_dev *dev, struct pci_bus_region *region,
292 region->end = res->end - offset; 292 region->end = res->end - offset;
293} 293}
294 294
295void __devinit
296pcibios_bus_to_resource(struct pci_dev *dev, struct resource *res,
297 struct pci_bus_region *region)
298{
299 struct pci_controller *hose = (struct pci_controller *)dev->sysdata;
300 unsigned long offset = 0;
301
302 if (res->flags & IORESOURCE_IO)
303 offset = hose->io_offset;
304 else if (res->flags & IORESOURCE_MEM)
305 offset = hose->mem_offset;
306
307 res->start = region->start + offset;
308 res->end = region->end + offset;
309}
310
295#ifdef CONFIG_HOTPLUG 311#ifdef CONFIG_HOTPLUG
296EXPORT_SYMBOL(pcibios_resource_to_bus); 312EXPORT_SYMBOL(pcibios_resource_to_bus);
313EXPORT_SYMBOL(pcibios_bus_to_resource);
297EXPORT_SYMBOL(PCIBIOS_MIN_IO); 314EXPORT_SYMBOL(PCIBIOS_MIN_IO);
298EXPORT_SYMBOL(PCIBIOS_MIN_MEM); 315EXPORT_SYMBOL(PCIBIOS_MIN_MEM);
299#endif 316#endif
diff --git a/arch/mips/pmc-sierra/yosemite/atmel_read_eeprom.c b/arch/mips/pmc-sierra/yosemite/atmel_read_eeprom.c
index b067988614c3..97862f45496d 100644
--- a/arch/mips/pmc-sierra/yosemite/atmel_read_eeprom.c
+++ b/arch/mips/pmc-sierra/yosemite/atmel_read_eeprom.c
@@ -30,7 +30,7 @@
30 * 30 *
31 * This code reads the ATMEL 24CXX EEPROM. The PMC-Sierra Yosemite board uses the ATMEL 31 * This code reads the ATMEL 24CXX EEPROM. The PMC-Sierra Yosemite board uses the ATMEL
32 * 24C32/24C64 which uses two byte addressing as compared to 24C16. Note that this program 32 * 24C32/24C64 which uses two byte addressing as compared to 24C16. Note that this program
33 * uses the serial port like /dev/ttyS0, to communicate with the EEPROM. Hence, you are 33 * uses the serial port like /dev/ttyS0, to communicate with the EEPROM. Hence, you are
34 * expected to have a connectivity from the EEPROM to the serial port. This program does 34 * expected to have a connectivity from the EEPROM to the serial port. This program does
35 * __not__ communicate using the I2C protocol 35 * __not__ communicate using the I2C protocol
36 */ 36 */
@@ -64,14 +64,14 @@ static void send_ack(void)
64static void send_byte(unsigned char byte) 64static void send_byte(unsigned char byte)
65{ 65{
66 int i = 0; 66 int i = 0;
67 67
68 for (i = 7; i >= 0; i--) 68 for (i = 7; i >= 0; i--)
69 send_bit((byte >> i) & 0x01); 69 send_bit((byte >> i) & 0x01);
70} 70}
71 71
72static void send_start(void) 72static void send_start(void)
73{ 73{
74 sda_hi; 74 sda_hi;
75 delay(TXX); 75 delay(TXX);
76 scl_hi; 76 scl_hi;
77 delay(TXX); 77 delay(TXX);
@@ -114,9 +114,9 @@ static unsigned char recv_byte(void) {
114 int i; 114 int i;
115 unsigned char byte=0; 115 unsigned char byte=0;
116 116
117 for (i=7;i>=0;i--) 117 for (i=7;i>=0;i--)
118 byte |= (recv_bit() << i); 118 byte |= (recv_bit() << i);
119 119
120 return byte; 120 return byte;
121} 121}
122 122
diff --git a/arch/mips/pmc-sierra/yosemite/atmel_read_eeprom.h b/arch/mips/pmc-sierra/yosemite/atmel_read_eeprom.h
index d27566d99ffc..c19f01a32045 100644
--- a/arch/mips/pmc-sierra/yosemite/atmel_read_eeprom.h
+++ b/arch/mips/pmc-sierra/yosemite/atmel_read_eeprom.h
@@ -27,7 +27,7 @@
27 */ 27 */
28 28
29/* 29/*
30 * Header file for atmel_read_eeprom.c 30 * Header file for atmel_read_eeprom.c
31 */ 31 */
32 32
33#include <linux/types.h> 33#include <linux/types.h>
@@ -46,7 +46,7 @@
46#define DEFAULT_PORT "/dev/ttyS0" /* Port to open */ 46#define DEFAULT_PORT "/dev/ttyS0" /* Port to open */
47#define TXX 0 /* Dummy loop for spinning */ 47#define TXX 0 /* Dummy loop for spinning */
48 48
49#define BLOCK_SEL 0x00 49#define BLOCK_SEL 0x00
50#define SLAVE_ADDR 0xa0 50#define SLAVE_ADDR 0xa0
51#define READ_BIT 0x01 51#define READ_BIT 0x01
52#define WRITE_BIT 0x00 52#define WRITE_BIT 0x00
diff --git a/arch/mips/qemu/Makefile b/arch/mips/qemu/Makefile
new file mode 100644
index 000000000000..934944ab9e85
--- /dev/null
+++ b/arch/mips/qemu/Makefile
@@ -0,0 +1,5 @@
1#
2# Makefile for Qemu specific kernel interface routines under Linux.
3#
4
5obj-y = q-firmware.o q-int.o q-irq.o q-mem.o q-setup.o
diff --git a/arch/mips/qemu/q-firmware.c b/arch/mips/qemu/q-firmware.c
new file mode 100644
index 000000000000..5980f02b2df9
--- /dev/null
+++ b/arch/mips/qemu/q-firmware.c
@@ -0,0 +1,7 @@
1#include <linux/init.h>
2#include <asm/bootinfo.h>
3
4void __init prom_init(void)
5{
6 add_memory_region(0x0<<20, 0x10<<20, BOOT_MEM_RAM);
7}
diff --git a/arch/mips/qemu/q-int.S b/arch/mips/qemu/q-int.S
new file mode 100644
index 000000000000..6e3dfe5eb14b
--- /dev/null
+++ b/arch/mips/qemu/q-int.S
@@ -0,0 +1,17 @@
1/*
2 * Qemu interrupt handler code.
3 *
4 * Copyright (C) 2005 by Ralf Baechle
5 */
6#include <asm/asm.h>
7#include <asm/regdef.h>
8#include <asm/stackframe.h>
9
10 .align 5
11 NESTED(qemu_handle_int, PT_SIZE, sp)
12 SAVE_ALL
13 CLI
14 move a0, sp
15 PTR_LA ra, ret_from_irq
16 j do_qemu_int
17 END(qemu_handle_int)
diff --git a/arch/mips/qemu/q-irq.c b/arch/mips/qemu/q-irq.c
new file mode 100644
index 000000000000..2c4e0704ff10
--- /dev/null
+++ b/arch/mips/qemu/q-irq.c
@@ -0,0 +1,37 @@
1#include <linux/init.h>
2#include <linux/linkage.h>
3
4#include <asm/i8259.h>
5#include <asm/mipsregs.h>
6#include <asm/qemu.h>
7#include <asm/system.h>
8#include <asm/time.h>
9
10extern asmlinkage void qemu_handle_int(void);
11
12asmlinkage void do_qemu_int(struct pt_regs *regs)
13{
14 unsigned int pending = read_c0_status() & read_c0_cause();
15
16 if (pending & 0x8000) {
17 ll_timer_interrupt(Q_COUNT_COMPARE_IRQ, regs);
18 return;
19 }
20 if (pending & 0x0400) {
21 int irq = i8259_irq();
22
23 if (likely(irq >= 0))
24 do_IRQ(irq, regs);
25
26 return;
27 }
28}
29
30void __init arch_init_irq(void)
31{
32 set_except_vector(0, qemu_handle_int);
33 mips_hpt_frequency = QEMU_C0_COUNTER_CLOCK; /* 100MHz */
34
35 init_i8259_irqs();
36 set_c0_status(0x8400);
37}
diff --git a/arch/mips/qemu/q-mem.c b/arch/mips/qemu/q-mem.c
new file mode 100644
index 000000000000..d174fac43031
--- /dev/null
+++ b/arch/mips/qemu/q-mem.c
@@ -0,0 +1,6 @@
1#include <linux/init.h>
2
3unsigned long __init prom_free_prom_memory(void)
4{
5 return 0UL;
6}
diff --git a/arch/mips/qemu/q-setup.c b/arch/mips/qemu/q-setup.c
new file mode 100644
index 000000000000..1a80eee8cd35
--- /dev/null
+++ b/arch/mips/qemu/q-setup.c
@@ -0,0 +1,20 @@
1#include <linux/init.h>
2#include <asm/io.h>
3#include <asm/time.h>
4
5#define QEMU_PORT_BASE 0xb4000000
6
7static void __init qemu_timer_setup(struct irqaction *irq)
8{
9 /* set the clock to 100 Hz */
10 outb_p(0x34,0x43); /* binary, mode 2, LSB/MSB, ch 0 */
11 outb_p(LATCH & 0xff , 0x40); /* LSB */
12 outb(LATCH >> 8 , 0x40); /* MSB */
13 setup_irq(0, irq);
14}
15
16void __init plat_setup(void)
17{
18 set_io_port_base(QEMU_PORT_BASE);
19 board_timer_setup = qemu_timer_setup;
20}
diff --git a/arch/mips/sgi-ip22/ip22-eisa.c b/arch/mips/sgi-ip22/ip22-eisa.c
index 0ab4abf65d58..fa0e719c5bd1 100644
--- a/arch/mips/sgi-ip22/ip22-eisa.c
+++ b/arch/mips/sgi-ip22/ip22-eisa.c
@@ -242,7 +242,7 @@ int __init ip22_eisa_init(void)
242 int i, c; 242 int i, c;
243 char *str; 243 char *str;
244 u8 *slot_addr; 244 u8 *slot_addr;
245 245
246 if (!(sgimc->systemid & SGIMC_SYSID_EPRESENT)) { 246 if (!(sgimc->systemid & SGIMC_SYSID_EPRESENT)) {
247 printk(KERN_INFO "EISA: bus not present.\n"); 247 printk(KERN_INFO "EISA: bus not present.\n");
248 return 1; 248 return 1;
diff --git a/arch/mips/sgi-ip22/ip22-hpc.c b/arch/mips/sgi-ip22/ip22-hpc.c
index c0afeccb08c4..5c00cdd20d8e 100644
--- a/arch/mips/sgi-ip22/ip22-hpc.c
+++ b/arch/mips/sgi-ip22/ip22-hpc.c
@@ -49,7 +49,7 @@ void __init sgihpc_init(void)
49 sgint = &sgioc->int3; 49 sgint = &sgioc->int3;
50 system_type = "SGI Indy"; 50 system_type = "SGI Indy";
51 } 51 }
52 52
53 sgi_ioc_reset = (SGIOC_RESET_PPORT | SGIOC_RESET_KBDMOUSE | 53 sgi_ioc_reset = (SGIOC_RESET_PPORT | SGIOC_RESET_KBDMOUSE |
54 SGIOC_RESET_EISA | SGIOC_RESET_ISDN | 54 SGIOC_RESET_EISA | SGIOC_RESET_ISDN |
55 SGIOC_RESET_LC0OFF); 55 SGIOC_RESET_LC0OFF);
diff --git a/arch/mips/sgi-ip22/ip22-int.c b/arch/mips/sgi-ip22/ip22-int.c
index ea2844d29e6e..d16fb43b1a93 100644
--- a/arch/mips/sgi-ip22/ip22-int.c
+++ b/arch/mips/sgi-ip22/ip22-int.c
@@ -28,7 +28,7 @@
28/* #define DEBUG_SGINT */ 28/* #define DEBUG_SGINT */
29 29
30/* So far nothing hangs here */ 30/* So far nothing hangs here */
31#undef USE_LIO3_IRQ 31#undef USE_LIO3_IRQ
32 32
33struct sgint_regs *sgint; 33struct sgint_regs *sgint;
34 34
@@ -272,32 +272,32 @@ void indy_buserror_irq(struct pt_regs *regs)
272 irq_exit(); 272 irq_exit();
273} 273}
274 274
275static struct irqaction local0_cascade = { 275static struct irqaction local0_cascade = {
276 .handler = no_action, 276 .handler = no_action,
277 .flags = SA_INTERRUPT, 277 .flags = SA_INTERRUPT,
278 .name = "local0 cascade", 278 .name = "local0 cascade",
279}; 279};
280 280
281static struct irqaction local1_cascade = { 281static struct irqaction local1_cascade = {
282 .handler = no_action, 282 .handler = no_action,
283 .flags = SA_INTERRUPT, 283 .flags = SA_INTERRUPT,
284 .name = "local1 cascade", 284 .name = "local1 cascade",
285}; 285};
286 286
287static struct irqaction buserr = { 287static struct irqaction buserr = {
288 .handler = no_action, 288 .handler = no_action,
289 .flags = SA_INTERRUPT, 289 .flags = SA_INTERRUPT,
290 .name = "Bus Error", 290 .name = "Bus Error",
291}; 291};
292 292
293static struct irqaction map0_cascade = { 293static struct irqaction map0_cascade = {
294 .handler = no_action, 294 .handler = no_action,
295 .flags = SA_INTERRUPT, 295 .flags = SA_INTERRUPT,
296 .name = "mapable0 cascade", 296 .name = "mapable0 cascade",
297}; 297};
298 298
299#ifdef USE_LIO3_IRQ 299#ifdef USE_LIO3_IRQ
300static struct irqaction map1_cascade = { 300static struct irqaction map1_cascade = {
301 .handler = no_action, 301 .handler = no_action,
302 .flags = SA_INTERRUPT, 302 .flags = SA_INTERRUPT,
303 .name = "mapable1 cascade", 303 .name = "mapable1 cascade",
diff --git a/arch/mips/sgi-ip22/ip22-nvram.c b/arch/mips/sgi-ip22/ip22-nvram.c
index de43e86fa17c..fd29fd407ae8 100644
--- a/arch/mips/sgi-ip22/ip22-nvram.c
+++ b/arch/mips/sgi-ip22/ip22-nvram.c
@@ -39,7 +39,7 @@
39 *ptr |= EEPROM_CSEL; \ 39 *ptr |= EEPROM_CSEL; \
40 *ptr |= EEPROM_ECLK; }) 40 *ptr |= EEPROM_ECLK; })
41 41
42 42
43#define eeprom_cs_off(ptr) ({ \ 43#define eeprom_cs_off(ptr) ({ \
44 *ptr &= ~EEPROM_ECLK; \ 44 *ptr &= ~EEPROM_ECLK; \
45 *ptr &= ~EEPROM_CSEL; \ 45 *ptr &= ~EEPROM_CSEL; \
@@ -50,7 +50,7 @@
50/* 50/*
51 * clock in the nvram command and the register number. For the 51 * clock in the nvram command and the register number. For the
52 * national semiconductor nv ram chip the op code is 3 bits and 52 * national semiconductor nv ram chip the op code is 3 bits and
53 * the address is 6/8 bits. 53 * the address is 6/8 bits.
54 */ 54 */
55static inline void eeprom_cmd(volatile unsigned int *ctrl, unsigned cmd, 55static inline void eeprom_cmd(volatile unsigned int *ctrl, unsigned cmd,
56 unsigned reg) 56 unsigned reg)
@@ -90,7 +90,7 @@ unsigned short ip22_eeprom_read(volatile unsigned int *ctrl, int reg)
90 if (*ctrl & EEPROM_DATI) 90 if (*ctrl & EEPROM_DATI)
91 res |= 1; 91 res |= 1;
92 } 92 }
93 93
94 eeprom_cs_off(ctrl); 94 eeprom_cs_off(ctrl);
95 95
96 return res; 96 return res;
@@ -113,7 +113,7 @@ unsigned short ip22_nvram_read(int reg)
113 reg <<= 1; 113 reg <<= 1;
114 tmp = hpc3c0->bbram[reg++] & 0xff; 114 tmp = hpc3c0->bbram[reg++] & 0xff;
115 return (tmp << 8) | (hpc3c0->bbram[reg] & 0xff); 115 return (tmp << 8) | (hpc3c0->bbram[reg] & 0xff);
116 } 116 }
117} 117}
118 118
119EXPORT_SYMBOL(ip22_nvram_read); 119EXPORT_SYMBOL(ip22_nvram_read);
diff --git a/arch/mips/sgi-ip22/ip22-reset.c b/arch/mips/sgi-ip22/ip22-reset.c
index ed5c60adce63..214ffd2e98a3 100644
--- a/arch/mips/sgi-ip22/ip22-reset.c
+++ b/arch/mips/sgi-ip22/ip22-reset.c
@@ -185,7 +185,7 @@ static irqreturn_t panel_int(int irq, void *dev_id, struct pt_regs *regs)
185 add_timer(&debounce_timer); 185 add_timer(&debounce_timer);
186 } 186 }
187 187
188 /* Power button was pressed 188 /* Power button was pressed
189 * ioc.ps page 22: "The Panel Register is called Power Control by Full 189 * ioc.ps page 22: "The Panel Register is called Power Control by Full
190 * House. Only lowest 2 bits are used. Guiness uses upper four bits 190 * House. Only lowest 2 bits are used. Guiness uses upper four bits
191 * for volume control". This is not true, all bits are pulled high 191 * for volume control". This is not true, all bits are pulled high
diff --git a/arch/mips/sgi-ip22/ip22-time.c b/arch/mips/sgi-ip22/ip22-time.c
index 173f76805ea3..df9b5694328a 100644
--- a/arch/mips/sgi-ip22/ip22-time.c
+++ b/arch/mips/sgi-ip22/ip22-time.c
@@ -126,7 +126,7 @@ static __init void indy_time_init(void)
126 unsigned long r4k_ticks[3]; 126 unsigned long r4k_ticks[3];
127 unsigned long r4k_tick; 127 unsigned long r4k_tick;
128 128
129 /* 129 /*
130 * Figure out the r4k offset, the algorithm is very simple and works in 130 * Figure out the r4k offset, the algorithm is very simple and works in
131 * _all_ cases as long as the 8254 counter register itself works ok (as 131 * _all_ cases as long as the 8254 counter register itself works ok (as
132 * an interrupt driving timer it does not because of bug, this is why 132 * an interrupt driving timer it does not because of bug, this is why
diff --git a/arch/mips/sgi-ip27/ip27-memory.c b/arch/mips/sgi-ip27/ip27-memory.c
index a160d04f7dbe..ef20d9ac0ba3 100644
--- a/arch/mips/sgi-ip27/ip27-memory.c
+++ b/arch/mips/sgi-ip27/ip27-memory.c
@@ -538,7 +538,7 @@ void __init mem_init(void)
538 for_each_online_node(node) { 538 for_each_online_node(node) {
539 unsigned slot, numslots; 539 unsigned slot, numslots;
540 struct page *end, *p; 540 struct page *end, *p;
541 541
542 /* 542 /*
543 * This will free up the bootmem, ie, slot 0 memory. 543 * This will free up the bootmem, ie, slot 0 memory.
544 */ 544 */
diff --git a/arch/mips/sgi-ip32/ip32-reset.c b/arch/mips/sgi-ip32/ip32-reset.c
index 281f090e48a4..88e1f52059ff 100644
--- a/arch/mips/sgi-ip32/ip32-reset.c
+++ b/arch/mips/sgi-ip32/ip32-reset.c
@@ -140,7 +140,7 @@ static irqreturn_t ip32_rtc_int(int irq, void *dev_id, struct pt_regs *regs)
140 140
141 reg_c = CMOS_READ(RTC_INTR_FLAGS); 141 reg_c = CMOS_READ(RTC_INTR_FLAGS);
142 if (!(reg_c & RTC_IRQF)) { 142 if (!(reg_c & RTC_IRQF)) {
143 printk(KERN_WARNING 143 printk(KERN_WARNING
144 "%s: RTC IRQ without RTC_IRQF\n", __FUNCTION__); 144 "%s: RTC IRQ without RTC_IRQF\n", __FUNCTION__);
145 } 145 }
146 /* Wait until interrupt goes away */ 146 /* Wait until interrupt goes away */
diff --git a/arch/mips/sibyte/cfe/cfe_error.h b/arch/mips/sibyte/cfe/cfe_error.h
index 77eb4935bfb4..975f00002cbe 100644
--- a/arch/mips/sibyte/cfe/cfe_error.h
+++ b/arch/mips/sibyte/cfe/cfe_error.h
@@ -17,15 +17,15 @@
17 */ 17 */
18 18
19/* ********************************************************************* 19/* *********************************************************************
20 * 20 *
21 * Broadcom Common Firmware Environment (CFE) 21 * Broadcom Common Firmware Environment (CFE)
22 * 22 *
23 * Error codes File: cfe_error.h 23 * Error codes File: cfe_error.h
24 * 24 *
25 * CFE's global error code list is here. 25 * CFE's global error code list is here.
26 * 26 *
27 * Author: Mitch Lichtenberg 27 * Author: Mitch Lichtenberg
28 * 28 *
29 ********************************************************************* */ 29 ********************************************************************* */
30 30
31 31
diff --git a/arch/mips/sibyte/cfe/console.c b/arch/mips/sibyte/cfe/console.c
index 53a5c1eb5611..7721100d0275 100644
--- a/arch/mips/sibyte/cfe/console.c
+++ b/arch/mips/sibyte/cfe/console.c
@@ -38,7 +38,7 @@ static void cfe_console_write(struct console *cons, const char *str,
38 last += written; 38 last += written;
39 } while (last < count); 39 } while (last < count);
40 } 40 }
41 41
42} 42}
43 43
44static int cfe_console_setup(struct console *cons, char *str) 44static int cfe_console_setup(struct console *cons, char *str)
diff --git a/arch/mips/sibyte/cfe/setup.c b/arch/mips/sibyte/cfe/setup.c
index d6d0364fa760..7a2c7a8510d4 100644
--- a/arch/mips/sibyte/cfe/setup.c
+++ b/arch/mips/sibyte/cfe/setup.c
@@ -33,7 +33,7 @@
33#include "cfe_error.h" 33#include "cfe_error.h"
34 34
35/* Max ram addressable in 32-bit segments */ 35/* Max ram addressable in 32-bit segments */
36#ifdef CONFIG_MIPS64 36#ifdef CONFIG_64BIT
37#define MAX_RAM_SIZE (~0ULL) 37#define MAX_RAM_SIZE (~0ULL)
38#else 38#else
39#ifdef CONFIG_HIGHMEM 39#ifdef CONFIG_HIGHMEM
@@ -285,7 +285,7 @@ void __init prom_init(void)
285 while (1) ; 285 while (1) ;
286 } 286 }
287 cfe_init(cfe_handle, cfe_ept); 287 cfe_init(cfe_handle, cfe_ept);
288 /* 288 /*
289 * Get the handle for (at least) prom_putchar, possibly for 289 * Get the handle for (at least) prom_putchar, possibly for
290 * boot console 290 * boot console
291 */ 291 */
diff --git a/arch/mips/sibyte/cfe/smp.c b/arch/mips/sibyte/cfe/smp.c
index 73392190d2b1..e44ce1a9eea9 100644
--- a/arch/mips/sibyte/cfe/smp.c
+++ b/arch/mips/sibyte/cfe/smp.c
@@ -57,7 +57,7 @@ void __init prom_prepare_cpus(unsigned int max_cpus)
57void prom_boot_secondary(int cpu, struct task_struct *idle) 57void prom_boot_secondary(int cpu, struct task_struct *idle)
58{ 58{
59 int retval; 59 int retval;
60 60
61 retval = cfe_cpu_start(cpu_logical_map(cpu), &smp_bootstrap, 61 retval = cfe_cpu_start(cpu_logical_map(cpu), &smp_bootstrap,
62 __KSTK_TOS(idle), 62 __KSTK_TOS(idle),
63 (unsigned long)idle->thread_info, 0); 63 (unsigned long)idle->thread_info, 0);
diff --git a/arch/mips/sibyte/sb1250/bus_watcher.c b/arch/mips/sibyte/sb1250/bus_watcher.c
index 182a16f42e2d..1a97e3127aeb 100644
--- a/arch/mips/sibyte/sb1250/bus_watcher.c
+++ b/arch/mips/sibyte/sb1250/bus_watcher.c
@@ -10,13 +10,13 @@
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details. 12 * GNU General Public License for more details.
13 * 13 *
14 * You should have received a copy of the GNU General Public License 14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software 15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 16 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
17 */ 17 */
18 18
19/* 19/*
20 * The Bus Watcher monitors internal bus transactions and maintains 20 * The Bus Watcher monitors internal bus transactions and maintains
21 * counts of transactions with error status, logging details and 21 * counts of transactions with error status, logging details and
22 * causing one of several interrupts. This driver provides a handler 22 * causing one of several interrupts. This driver provides a handler
@@ -155,7 +155,7 @@ static int bw_read_proc(char *page, char **start, off_t off,
155static void create_proc_decoder(struct bw_stats_struct *stats) 155static void create_proc_decoder(struct bw_stats_struct *stats)
156{ 156{
157 struct proc_dir_entry *ent; 157 struct proc_dir_entry *ent;
158 158
159 ent = create_proc_read_entry("bus_watcher", S_IWUSR | S_IRUGO, NULL, 159 ent = create_proc_read_entry("bus_watcher", S_IWUSR | S_IRUGO, NULL,
160 bw_read_proc, stats); 160 bw_read_proc, stats);
161 if (!ent) { 161 if (!ent) {
diff --git a/arch/mips/sibyte/sb1250/irq.c b/arch/mips/sibyte/sb1250/irq.c
index 2728abbc94d2..2725b263cced 100644
--- a/arch/mips/sibyte/sb1250/irq.c
+++ b/arch/mips/sibyte/sb1250/irq.c
@@ -377,7 +377,7 @@ void __init arch_init_irq(void)
377 377
378 /* 378 /*
379 * Note that the timer interrupts are also mapped, but this is 379 * Note that the timer interrupts are also mapped, but this is
380 * done in sb1250_time_init(). Also, the profiling driver 380 * done in sb1250_time_init(). Also, the profiling driver
381 * does its own management of IP7. 381 * does its own management of IP7.
382 */ 382 */
383 383
@@ -392,7 +392,7 @@ void __init arch_init_irq(void)
392 if (kgdb_flag) { 392 if (kgdb_flag) {
393 kgdb_irq = K_INT_UART_0 + kgdb_port; 393 kgdb_irq = K_INT_UART_0 + kgdb_port;
394 394
395#ifdef CONFIG_SIBYTE_SB1250_DUART 395#ifdef CONFIG_SIBYTE_SB1250_DUART
396 sb1250_duart_present[kgdb_port] = 0; 396 sb1250_duart_present[kgdb_port] = 0;
397#endif 397#endif
398 /* Setup uart 1 settings, mapper */ 398 /* Setup uart 1 settings, mapper */
diff --git a/arch/mips/sibyte/swarm/rtc_m41t81.c b/arch/mips/sibyte/swarm/rtc_m41t81.c
index 0e633ee8d83c..a686bb716ec6 100644
--- a/arch/mips/sibyte/swarm/rtc_m41t81.c
+++ b/arch/mips/sibyte/swarm/rtc_m41t81.c
@@ -128,7 +128,7 @@ static int m41t81_write(uint8_t addr, int b)
128 /* Clear error bit by writing a 1 */ 128 /* Clear error bit by writing a 1 */
129 bus_writeq(M_SMB_ERROR, SMB_CSR(R_SMB_STATUS)); 129 bus_writeq(M_SMB_ERROR, SMB_CSR(R_SMB_STATUS));
130 return -1; 130 return -1;
131 } 131 }
132 132
133 /* read the same byte again to make sure it is written */ 133 /* read the same byte again to make sure it is written */
134 bus_writeq(V_SMB_ADDR(M41T81_CCR_ADDRESS) | V_SMB_TT_RD1BYTE, 134 bus_writeq(V_SMB_ADDR(M41T81_CCR_ADDRESS) | V_SMB_TT_RD1BYTE,
@@ -136,7 +136,7 @@ static int m41t81_write(uint8_t addr, int b)
136 136
137 while (bus_readq(SMB_CSR(R_SMB_STATUS)) & M_SMB_BUSY) 137 while (bus_readq(SMB_CSR(R_SMB_STATUS)) & M_SMB_BUSY)
138 ; 138 ;
139 139
140 return 0; 140 return 0;
141} 141}
142 142
@@ -148,13 +148,13 @@ int m41t81_set_time(unsigned long t)
148 148
149 /* 149 /*
150 * Note the write order matters as it ensures the correctness. 150 * Note the write order matters as it ensures the correctness.
151 * When we write sec, 10th sec is clear. It is reasonable to 151 * When we write sec, 10th sec is clear. It is reasonable to
152 * believe we should finish writing min within a second. 152 * believe we should finish writing min within a second.
153 */ 153 */
154 154
155 tm.tm_sec = BIN2BCD(tm.tm_sec); 155 tm.tm_sec = BIN2BCD(tm.tm_sec);
156 m41t81_write(M41T81REG_SC, tm.tm_sec); 156 m41t81_write(M41T81REG_SC, tm.tm_sec);
157 157
158 tm.tm_min = BIN2BCD(tm.tm_min); 158 tm.tm_min = BIN2BCD(tm.tm_min);
159 m41t81_write(M41T81REG_MN, tm.tm_min); 159 m41t81_write(M41T81REG_MN, tm.tm_min);
160 160
@@ -187,7 +187,7 @@ unsigned long m41t81_get_time(void)
187{ 187{
188 unsigned int year, mon, day, hour, min, sec; 188 unsigned int year, mon, day, hour, min, sec;
189 189
190 /* 190 /*
191 * min is valid if two reads of sec are the same. 191 * min is valid if two reads of sec are the same.
192 */ 192 */
193 for (;;) { 193 for (;;) {
diff --git a/arch/mips/sibyte/swarm/setup.c b/arch/mips/sibyte/swarm/setup.c
index 457aeb7be858..4daeaa413def 100644
--- a/arch/mips/sibyte/swarm/setup.c
+++ b/arch/mips/sibyte/swarm/setup.c
@@ -73,7 +73,7 @@ int swarm_be_handler(struct pt_regs *regs, int is_fixup)
73{ 73{
74 if (!is_fixup && (regs->cp0_cause & 4)) { 74 if (!is_fixup && (regs->cp0_cause & 4)) {
75 /* Data bus error - print PA */ 75 /* Data bus error - print PA */
76#ifdef CONFIG_MIPS64 76#ifdef CONFIG_64BIT
77 printk("DBE physical address: %010lx\n", 77 printk("DBE physical address: %010lx\n",
78 __read_64bit_c0_register($26, 1)); 78 __read_64bit_c0_register($26, 1));
79#else 79#else
@@ -98,7 +98,7 @@ static int __init swarm_setup(void)
98 rtc_get_time = xicor_get_time; 98 rtc_get_time = xicor_get_time;
99 rtc_set_time = xicor_set_time; 99 rtc_set_time = xicor_set_time;
100 } 100 }
101 101
102 if (m41t81_probe()) { 102 if (m41t81_probe()) {
103 printk("swarm setup: M41T81 RTC detected.\n"); 103 printk("swarm setup: M41T81 RTC detected.\n");
104 rtc_get_time = m41t81_get_time; 104 rtc_get_time = m41t81_get_time;
diff --git a/arch/mips/sni/irq.c b/arch/mips/sni/irq.c
index 62c760f14674..141a310d74d8 100644
--- a/arch/mips/sni/irq.c
+++ b/arch/mips/sni/irq.c
@@ -103,7 +103,7 @@ static unsigned int ls1bit8(unsigned int x)
103 103
104/* 104/*
105 * hwint 1 deals with EISA and SCSI interrupts, 105 * hwint 1 deals with EISA and SCSI interrupts,
106 * 106 *
107 * The EISA_INT bit in CSITPEND is high active, all others are low active. 107 * The EISA_INT bit in CSITPEND is high active, all others are low active.
108 */ 108 */
109void pciasic_hwint1(struct pt_regs *regs) 109void pciasic_hwint1(struct pt_regs *regs)
diff --git a/arch/mips/sni/setup.c b/arch/mips/sni/setup.c
index 8f67cee4317b..1b3f8a0903e1 100644
--- a/arch/mips/sni/setup.c
+++ b/arch/mips/sni/setup.c
@@ -111,7 +111,7 @@ static struct resource sni_mem_resource = {
111 * The RM200/RM300 has a few holes in it's PCI/EISA memory address space used 111 * The RM200/RM300 has a few holes in it's PCI/EISA memory address space used
112 * for other purposes. Be paranoid and allocate all of the before the PCI 112 * for other purposes. Be paranoid and allocate all of the before the PCI
113 * code gets a chance to to map anything else there ... 113 * code gets a chance to to map anything else there ...
114 * 114 *
115 * This leaves the following areas available: 115 * This leaves the following areas available:
116 * 116 *
117 * 0x10000000 - 0x1009ffff (640kB) PCI/EISA/ISA Bus Memory 117 * 0x10000000 - 0x1009ffff (640kB) PCI/EISA/ISA Bus Memory
diff --git a/arch/mips/tx4927/common/tx4927_irq_handler.S b/arch/mips/tx4927/common/tx4927_irq_handler.S
index ca123e28d1ef..dd3ceda9d712 100644
--- a/arch/mips/tx4927/common/tx4927_irq_handler.S
+++ b/arch/mips/tx4927/common/tx4927_irq_handler.S
@@ -42,13 +42,13 @@
42 CLI 42 CLI
43 .set at 43 .set at
44 44
45 mfc0 t0, CP0_CAUSE 45 mfc0 t0, CP0_CAUSE
46 mfc0 t1, CP0_STATUS 46 mfc0 t1, CP0_STATUS
47 and t0, t1 47 and t0, t1
48 48
49 andi t1, t0, STATUSF_IP7 /* cpu timer */ 49 andi t1, t0, STATUSF_IP7 /* cpu timer */
50 bnez t1, ll_ip7 50 bnez t1, ll_ip7
51 51
52 /* IP6..IP3 multiplexed -- do not use */ 52 /* IP6..IP3 multiplexed -- do not use */
53 53
54 andi t1, t0, STATUSF_IP2 /* tx4927 pic */ 54 andi t1, t0, STATUSF_IP2 /* tx4927 pic */
diff --git a/arch/mips/tx4927/common/tx4927_setup.c b/arch/mips/tx4927/common/tx4927_setup.c
index 16bcbdc6d1cc..26d7c53612a8 100644
--- a/arch/mips/tx4927/common/tx4927_setup.c
+++ b/arch/mips/tx4927/common/tx4927_setup.c
@@ -152,7 +152,7 @@ dump_cp0(char *key)
152 print_cp0(key, 16, "CONFIG ", read_c0_config()); 152 print_cp0(key, 16, "CONFIG ", read_c0_config());
153 return; 153 return;
154} 154}
155 155
156void print_pic(char *key, u32 reg, char *name) 156void print_pic(char *key, u32 reg, char *name)
157{ 157{
158 printk("%s pic:0x%08x:%s=0x%08x\n", key, reg, name, 158 printk("%s pic:0x%08x:%s=0x%08x\n", key, reg, name,
diff --git a/arch/mips/tx4927/toshiba_rbtx4927/Makefile b/arch/mips/tx4927/toshiba_rbtx4927/Makefile
index 86ca4cf2d587..c1a377a80a5d 100644
--- a/arch/mips/tx4927/toshiba_rbtx4927/Makefile
+++ b/arch/mips/tx4927/toshiba_rbtx4927/Makefile
@@ -1,5 +1,5 @@
1obj-y += toshiba_rbtx4927_prom.o 1obj-y += toshiba_rbtx4927_prom.o
2obj-y += toshiba_rbtx4927_setup.o 2obj-y += toshiba_rbtx4927_setup.o
3obj-y += toshiba_rbtx4927_irq.o 3obj-y += toshiba_rbtx4927_irq.o
4 4
5EXTRA_AFLAGS := $(CFLAGS) 5EXTRA_AFLAGS := $(CFLAGS)
diff --git a/arch/mips/tx4927/toshiba_rbtx4927/toshiba_rbtx4927_irq.c b/arch/mips/tx4927/toshiba_rbtx4927/toshiba_rbtx4927_irq.c
index fd5b433f83b7..aee07ff2212a 100644
--- a/arch/mips/tx4927/toshiba_rbtx4927/toshiba_rbtx4927_irq.c
+++ b/arch/mips/tx4927/toshiba_rbtx4927/toshiba_rbtx4927_irq.c
@@ -31,7 +31,7 @@
31 31
32 32
33/* 33/*
34IRQ Device 34IRQ Device
3500 RBTX4927-ISA/00 3500 RBTX4927-ISA/00
3601 RBTX4927-ISA/01 PS2/Keyboard 3601 RBTX4927-ISA/01 PS2/Keyboard
3702 RBTX4927-ISA/02 Cascade RBTX4927-ISA (irqs 8-15) 3702 RBTX4927-ISA/02 Cascade RBTX4927-ISA (irqs 8-15)
@@ -52,15 +52,15 @@ IRQ Device
5216 TX4927-CP0/00 Software 0 5216 TX4927-CP0/00 Software 0
5317 TX4927-CP0/01 Software 1 5317 TX4927-CP0/01 Software 1
5418 TX4927-CP0/02 Cascade TX4927-CP0 5418 TX4927-CP0/02 Cascade TX4927-CP0
5519 TX4927-CP0/03 Multiplexed -- do not use 5519 TX4927-CP0/03 Multiplexed -- do not use
5620 TX4927-CP0/04 Multiplexed -- do not use 5620 TX4927-CP0/04 Multiplexed -- do not use
5721 TX4927-CP0/05 Multiplexed -- do not use 5721 TX4927-CP0/05 Multiplexed -- do not use
5822 TX4927-CP0/06 Multiplexed -- do not use 5822 TX4927-CP0/06 Multiplexed -- do not use
5923 TX4927-CP0/07 CPU TIMER 5923 TX4927-CP0/07 CPU TIMER
60 60
6124 TX4927-PIC/00 6124 TX4927-PIC/00
6225 TX4927-PIC/01 6225 TX4927-PIC/01
6326 TX4927-PIC/02 6326 TX4927-PIC/02
6427 TX4927-PIC/03 Cascade RBTX4927-IOC 6427 TX4927-PIC/03 Cascade RBTX4927-IOC
6528 TX4927-PIC/04 6528 TX4927-PIC/04
6629 TX4927-PIC/05 RBTX4927 RTL-8019AS ethernet 6629 TX4927-PIC/05 RBTX4927 RTL-8019AS ethernet
@@ -80,7 +80,7 @@ IRQ Device
8043 TX4927-PIC/19 8043 TX4927-PIC/19
8144 TX4927-PIC/20 8144 TX4927-PIC/20
8245 TX4927-PIC/21 8245 TX4927-PIC/21
8346 TX4927-PIC/22 TX4927 PCI PCI-ERR 8346 TX4927-PIC/22 TX4927 PCI PCI-ERR
8447 TX4927-PIC/23 TX4927 PCI PCI-PMA (not used) 8447 TX4927-PIC/23 TX4927 PCI PCI-PMA (not used)
8548 TX4927-PIC/24 8548 TX4927-PIC/24
8649 TX4927-PIC/25 8649 TX4927-PIC/25
@@ -100,7 +100,7 @@ IRQ Device
10062 RBTX4927-IOC/06 10062 RBTX4927-IOC/06
10163 RBTX4927-IOC/07 10163 RBTX4927-IOC/07
102 102
103NOTES: 103NOTES:
104SouthBridge/INTR is mapped to SouthBridge/A=PCI-B/#58 104SouthBridge/INTR is mapped to SouthBridge/A=PCI-B/#58
105SouthBridge/ISA/pin=0 no pci irq used by this device 105SouthBridge/ISA/pin=0 no pci irq used by this device
106SouthBridge/IDE/pin=1 no pci irq used by this device, using INTR via ISA IRQ14 106SouthBridge/IDE/pin=1 no pci irq used by this device, using INTR via ISA IRQ14
@@ -175,19 +175,19 @@ JP7 is not bus master -- do NOT use -- only 4 pci bus master's allowed -- SouthB
175static const u32 toshiba_rbtx4927_irq_debug_flag = 175static const u32 toshiba_rbtx4927_irq_debug_flag =
176 (TOSHIBA_RBTX4927_IRQ_NONE | TOSHIBA_RBTX4927_IRQ_INFO | 176 (TOSHIBA_RBTX4927_IRQ_NONE | TOSHIBA_RBTX4927_IRQ_INFO |
177 TOSHIBA_RBTX4927_IRQ_WARN | TOSHIBA_RBTX4927_IRQ_EROR 177 TOSHIBA_RBTX4927_IRQ_WARN | TOSHIBA_RBTX4927_IRQ_EROR
178// | TOSHIBA_RBTX4927_IRQ_IOC_INIT 178// | TOSHIBA_RBTX4927_IRQ_IOC_INIT
179// | TOSHIBA_RBTX4927_IRQ_IOC_STARTUP 179// | TOSHIBA_RBTX4927_IRQ_IOC_STARTUP
180// | TOSHIBA_RBTX4927_IRQ_IOC_SHUTDOWN 180// | TOSHIBA_RBTX4927_IRQ_IOC_SHUTDOWN
181// | TOSHIBA_RBTX4927_IRQ_IOC_ENABLE 181// | TOSHIBA_RBTX4927_IRQ_IOC_ENABLE
182// | TOSHIBA_RBTX4927_IRQ_IOC_DISABLE 182// | TOSHIBA_RBTX4927_IRQ_IOC_DISABLE
183// | TOSHIBA_RBTX4927_IRQ_IOC_MASK 183// | TOSHIBA_RBTX4927_IRQ_IOC_MASK
184// | TOSHIBA_RBTX4927_IRQ_IOC_ENDIRQ 184// | TOSHIBA_RBTX4927_IRQ_IOC_ENDIRQ
185// | TOSHIBA_RBTX4927_IRQ_ISA_INIT 185// | TOSHIBA_RBTX4927_IRQ_ISA_INIT
186// | TOSHIBA_RBTX4927_IRQ_ISA_STARTUP 186// | TOSHIBA_RBTX4927_IRQ_ISA_STARTUP
187// | TOSHIBA_RBTX4927_IRQ_ISA_SHUTDOWN 187// | TOSHIBA_RBTX4927_IRQ_ISA_SHUTDOWN
188// | TOSHIBA_RBTX4927_IRQ_ISA_ENABLE 188// | TOSHIBA_RBTX4927_IRQ_ISA_ENABLE
189// | TOSHIBA_RBTX4927_IRQ_ISA_DISABLE 189// | TOSHIBA_RBTX4927_IRQ_ISA_DISABLE
190// | TOSHIBA_RBTX4927_IRQ_ISA_MASK 190// | TOSHIBA_RBTX4927_IRQ_ISA_MASK
191// | TOSHIBA_RBTX4927_IRQ_ISA_ENDIRQ 191// | TOSHIBA_RBTX4927_IRQ_ISA_ENDIRQ
192 ); 192 );
193#endif 193#endif
diff --git a/arch/mips/tx4927/toshiba_rbtx4927/toshiba_rbtx4927_setup.c b/arch/mips/tx4927/toshiba_rbtx4927/toshiba_rbtx4927_setup.c
index 8724ea3ae04e..fc0720599fd9 100644
--- a/arch/mips/tx4927/toshiba_rbtx4927/toshiba_rbtx4927_setup.c
+++ b/arch/mips/tx4927/toshiba_rbtx4927/toshiba_rbtx4927_setup.c
@@ -395,7 +395,7 @@ static int __init tx4927_pcibios_init(void)
395 /* enable secondary ide */ 395 /* enable secondary ide */
396 v08_43 |= 0x80; 396 v08_43 |= 0x80;
397 397
398 /* 398 /*
399 * !!! DO NOT REMOVE THIS COMMENT IT IS REQUIRED BY SMSC !!! 399 * !!! DO NOT REMOVE THIS COMMENT IT IS REQUIRED BY SMSC !!!
400 * 400 *
401 * This line of code is intended to provide the user with a work 401 * This line of code is intended to provide the user with a work
diff --git a/arch/mips/vr4181/common/Makefile b/arch/mips/vr4181/common/Makefile
deleted file mode 100644
index f7587ca64ead..000000000000
--- a/arch/mips/vr4181/common/Makefile
+++ /dev/null
@@ -1,7 +0,0 @@
1#
2# Makefile for common code of NEC vr4181 based boards
3#
4
5obj-y := irq.o int_handler.o serial.o time.o
6
7EXTRA_AFLAGS := $(CFLAGS)
diff --git a/arch/mips/vr4181/common/int_handler.S b/arch/mips/vr4181/common/int_handler.S
deleted file mode 100644
index 2c041b8ee52b..000000000000
--- a/arch/mips/vr4181/common/int_handler.S
+++ /dev/null
@@ -1,206 +0,0 @@
1/*
2 * arch/mips/vr4181/common/int_handler.S
3 *
4 * Adapted to the VR4181 and almost entirely rewritten:
5 * Copyright (C) 1999 Bradley D. LaRonde and Michael Klar
6 *
7 * Clean up to conform to the new IRQ
8 * Copyright (C) 2001 MontaVista Software Inc.
9 * Author: Jun Sun, jsun@mvista.com or jsun@junsun.net
10 *
11 * This file is subject to the terms and conditions of the GNU General Public
12 * License. See the file "COPYING" in the main directory of this archive
13 * for more details.
14 *
15 */
16
17#include <asm/asm.h>
18#include <asm/regdef.h>
19#include <asm/mipsregs.h>
20#include <asm/stackframe.h>
21
22#include <asm/vr4181/vr4181.h>
23
24/*
25 * [jsun]
26 * See include/asm/vr4181/irq.h for IRQ assignment and strategy.
27 */
28
29 .text
30 .set noreorder
31
32 .align 5
33 NESTED(vr4181_handle_irq, PT_SIZE, ra)
34
35 .set noat
36 SAVE_ALL
37 CLI
38
39 .set at
40 .set noreorder
41
42 mfc0 t0, CP0_CAUSE
43 mfc0 t2, CP0_STATUS
44
45 and t0, t2
46
47 /* we check IP3 first; it happens most frequently */
48 andi t1, t0, STATUSF_IP3
49 bnez t1, ll_cpu_ip3
50 andi t1, t0, STATUSF_IP2
51 bnez t1, ll_cpu_ip2
52 andi t1, t0, STATUSF_IP7 /* cpu timer */
53 bnez t1, ll_cputimer_irq
54 andi t1, t0, STATUSF_IP4
55 bnez t1, ll_cpu_ip4
56 andi t1, t0, STATUSF_IP5
57 bnez t1, ll_cpu_ip5
58 andi t1, t0, STATUSF_IP6
59 bnez t1, ll_cpu_ip6
60 andi t1, t0, STATUSF_IP0 /* software int 0 */
61 bnez t1, ll_cpu_ip0
62 andi t1, t0, STATUSF_IP1 /* software int 1 */
63 bnez t1, ll_cpu_ip1
64 nop
65
66 .set reorder
67do_spurious:
68 j spurious_interrupt
69
70/*
71 * regular CPU irqs
72 */
73ll_cputimer_irq:
74 li a0, VR4181_IRQ_TIMER
75 move a1, sp
76 jal do_IRQ
77 j ret_from_irq
78
79
80ll_cpu_ip0:
81 li a0, VR4181_IRQ_SW1
82 move a1, sp
83 jal do_IRQ
84 j ret_from_irq
85
86ll_cpu_ip1:
87 li a0, VR4181_IRQ_SW2
88 move a1, sp
89 jal do_IRQ
90 j ret_from_irq
91
92ll_cpu_ip3:
93 li a0, VR4181_IRQ_INT1
94 move a1, sp
95 jal do_IRQ
96 j ret_from_irq
97
98ll_cpu_ip4:
99 li a0, VR4181_IRQ_INT2
100 move a1, sp
101 jal do_IRQ
102 j ret_from_irq
103
104ll_cpu_ip5:
105 li a0, VR4181_IRQ_INT3
106 move a1, sp
107 jal do_IRQ
108 j ret_from_irq
109
110ll_cpu_ip6:
111 li a0, VR4181_IRQ_INT4
112 move a1, sp
113 jal do_IRQ
114 j ret_from_irq
115
116/*
117 * One of the sys irq has happend.
118 *
119 * In the interest of speed, we first determine in the following order
120 * which 16-irq block have pending interrupts:
121 * sysint1 (16 sources, including cascading intrs from GPIO)
122 * sysint2
123 * gpio (16 intr sources)
124 *
125 * Then we do binary search to find the exact interrupt source.
126 */
127ll_cpu_ip2:
128
129 lui t3,%hi(VR4181_SYSINT1REG)
130 lhu t0,%lo(VR4181_SYSINT1REG)(t3)
131 lhu t2,%lo(VR4181_MSYSINT1REG)(t3)
132 and t0, 0xfffb /* hack - remove RTC Long 1 intr */
133 and t0, t2
134 beqz t0, check_sysint2
135
136 /* check for GPIO interrupts */
137 andi t1, t0, 0x0100
138 bnez t1, check_gpio_int
139
140 /* so we have an interrupt in sysint1 which is not gpio int */
141 li a0, VR4181_SYS_IRQ_BASE - 1
142 j check_16
143
144check_sysint2:
145
146 lhu t0,%lo(VR4181_SYSINT2REG)(t3)
147 lhu t2,%lo(VR4181_MSYSINT2REG)(t3)
148 and t0, 0xfffe /* hack - remove RTC Long 2 intr */
149 and t0, t2
150 li a0, VR4181_SYS_IRQ_BASE + 16 - 1
151 j check_16
152
153check_gpio_int:
154 lui t3,%hi(VR4181_GPINTMSK)
155 lhu t0,%lo(VR4181_GPINTMSK)(t3)
156 lhu t2,%lo(VR4181_GPINTSTAT)(t3)
157 xori t0, 0xffff /* why? reverse logic? */
158 and t0, t2
159 li a0, VR4181_GPIO_IRQ_BASE - 1
160 j check_16
161
162/*
163 * When we reach check_16, we have 16-bit status in t0 and base irq number
164 * in a0.
165 */
166check_16:
167 andi t1, t0, 0xff
168 bnez t1, check_8
169
170 srl t0, 8
171 addi a0, 8
172 j check_8
173
174/*
175 * When we reach check_8, we have 8-bit status in t0 and base irq number
176 * in a0.
177 */
178check_8:
179 andi t1, t0, 0xf
180 bnez t1, check_4
181
182 srl t0, 4
183 addi a0, 4
184 j check_4
185
186/*
187 * When we reach check_4, we have 4-bit status in t0 and base irq number
188 * in a0.
189 */
190check_4:
191 andi t0, t0, 0xf
192 beqz t0, do_spurious
193
194loop:
195 andi t2, t0, 0x1
196 srl t0, 1
197 addi a0, 1
198 beqz t2, loop
199
200found_it:
201 move a1, sp
202 jal do_IRQ
203
204 j ret_from_irq
205
206 END(vr4181_handle_irq)
diff --git a/arch/mips/vr4181/common/irq.c b/arch/mips/vr4181/common/irq.c
deleted file mode 100644
index 2cdf77c5cb3e..000000000000
--- a/arch/mips/vr4181/common/irq.c
+++ /dev/null
@@ -1,239 +0,0 @@
1/*
2 * Copyright (C) 2001 MontaVista Software Inc.
3 * Author: Jun Sun, jsun@mvista.com or jsun@junsun.net
4 * Copyright (C) 2005 Ralf Baechle (ralf@linux-mips.org)
5 *
6 * linux/arch/mips/vr4181/common/irq.c
7 * Completely re-written to use the new irq.c
8 *
9 * Credits to Bradley D. LaRonde and Michael Klar for writing the original
10 * irq.c file which was derived from the common irq.c file.
11 *
12 * This file is subject to the terms and conditions of the GNU General Public
13 * License. See the file "COPYING" in the main directory of this archive
14 * for more details.
15 */
16#include <linux/types.h>
17#include <linux/init.h>
18#include <linux/kernel_stat.h>
19#include <linux/signal.h>
20#include <linux/sched.h>
21#include <linux/interrupt.h>
22#include <linux/slab.h>
23#include <linux/random.h>
24
25#include <asm/irq.h>
26#include <asm/mipsregs.h>
27#include <asm/gdb-stub.h>
28
29#include <asm/vr4181/vr4181.h>
30
31/*
32 * Strategy:
33 *
34 * We essentially have three irq controllers, CPU, system, and gpio.
35 *
36 * CPU irq controller is taken care by arch/mips/kernel/irq_cpu.c and
37 * CONFIG_IRQ_CPU config option.
38 *
39 * We here provide sys_irq and gpio_irq controller code.
40 */
41
42static int sys_irq_base;
43static int gpio_irq_base;
44
45/* ---------------------- sys irq ------------------------ */
46static void
47sys_irq_enable(unsigned int irq)
48{
49 irq -= sys_irq_base;
50 if (irq < 16) {
51 *VR4181_MSYSINT1REG |= (u16)(1 << irq);
52 } else {
53 irq -= 16;
54 *VR4181_MSYSINT2REG |= (u16)(1 << irq);
55 }
56}
57
58static void
59sys_irq_disable(unsigned int irq)
60{
61 irq -= sys_irq_base;
62 if (irq < 16) {
63 *VR4181_MSYSINT1REG &= ~((u16)(1 << irq));
64 } else {
65 irq -= 16;
66 *VR4181_MSYSINT2REG &= ~((u16)(1 << irq));
67 }
68
69}
70
71static unsigned int
72sys_irq_startup(unsigned int irq)
73{
74 sys_irq_enable(irq);
75 return 0;
76}
77
78#define sys_irq_shutdown sys_irq_disable
79#define sys_irq_ack sys_irq_disable
80
81static void
82sys_irq_end(unsigned int irq)
83{
84 if(!(irq_desc[irq].status & (IRQ_DISABLED | IRQ_INPROGRESS)))
85 sys_irq_enable(irq);
86}
87
88static hw_irq_controller sys_irq_controller = {
89 "vr4181_sys_irq",
90 sys_irq_startup,
91 sys_irq_shutdown,
92 sys_irq_enable,
93 sys_irq_disable,
94 sys_irq_ack,
95 sys_irq_end,
96 NULL /* no affinity stuff for UP */
97};
98
99/* ---------------------- gpio irq ------------------------ */
100/* gpio irq lines use reverse logic */
101static void
102gpio_irq_enable(unsigned int irq)
103{
104 irq -= gpio_irq_base;
105 *VR4181_GPINTMSK &= ~((u16)(1 << irq));
106}
107
108static void
109gpio_irq_disable(unsigned int irq)
110{
111 irq -= gpio_irq_base;
112 *VR4181_GPINTMSK |= (u16)(1 << irq);
113}
114
115static unsigned int
116gpio_irq_startup(unsigned int irq)
117{
118 gpio_irq_enable(irq);
119
120 irq -= gpio_irq_base;
121 *VR4181_GPINTEN |= (u16)(1 << irq );
122
123 return 0;
124}
125
126static void
127gpio_irq_shutdown(unsigned int irq)
128{
129 gpio_irq_disable(irq);
130
131 irq -= gpio_irq_base;
132 *VR4181_GPINTEN &= ~((u16)(1 << irq ));
133}
134
135static void
136gpio_irq_ack(unsigned int irq)
137{
138 u16 irqtype;
139 u16 irqshift;
140
141 gpio_irq_disable(irq);
142
143 /* we clear interrupt if it is edge triggered */
144 irq -= gpio_irq_base;
145 if (irq < 8) {
146 irqtype = *VR4181_GPINTTYPL;
147 irqshift = 2 << (irq*2);
148 } else {
149 irqtype = *VR4181_GPINTTYPH;
150 irqshift = 2 << ((irq-8)*2);
151 }
152 if ( ! (irqtype & irqshift) ) {
153 *VR4181_GPINTSTAT = (u16) (1 << irq);
154 }
155}
156
157static void
158gpio_irq_end(unsigned int irq)
159{
160 if(!(irq_desc[irq].status & (IRQ_DISABLED | IRQ_INPROGRESS)))
161 gpio_irq_enable(irq);
162}
163
164static hw_irq_controller gpio_irq_controller = {
165 "vr4181_gpio_irq",
166 gpio_irq_startup,
167 gpio_irq_shutdown,
168 gpio_irq_enable,
169 gpio_irq_disable,
170 gpio_irq_ack,
171 gpio_irq_end,
172 NULL /* no affinity stuff for UP */
173};
174
175/* --------------------- IRQ init stuff ---------------------- */
176
177extern asmlinkage void vr4181_handle_irq(void);
178extern void breakpoint(void);
179extern int setup_irq(unsigned int irq, struct irqaction *irqaction);
180extern void mips_cpu_irq_init(u32 irq_base);
181
182static struct irqaction cascade =
183 { no_action, SA_INTERRUPT, CPU_MASK_NONE, "cascade", NULL, NULL };
184static struct irqaction reserved =
185 { no_action, SA_INTERRUPT, CPU_MASK_NONE, "cascade", NULL, NULL };
186
187void __init arch_init_irq(void)
188{
189 int i;
190
191 set_except_vector(0, vr4181_handle_irq);
192
193 /* init CPU irqs */
194 mips_cpu_irq_init(VR4181_CPU_IRQ_BASE);
195
196 /* init sys irqs */
197 sys_irq_base = VR4181_SYS_IRQ_BASE;
198 for (i=sys_irq_base; i < sys_irq_base + VR4181_NUM_SYS_IRQ; i++) {
199 irq_desc[i].status = IRQ_DISABLED;
200 irq_desc[i].action = NULL;
201 irq_desc[i].depth = 1;
202 irq_desc[i].handler = &sys_irq_controller;
203 }
204
205 /* init gpio irqs */
206 gpio_irq_base = VR4181_GPIO_IRQ_BASE;
207 for (i=gpio_irq_base; i < gpio_irq_base + VR4181_NUM_GPIO_IRQ; i++) {
208 irq_desc[i].status = IRQ_DISABLED;
209 irq_desc[i].action = NULL;
210 irq_desc[i].depth = 1;
211 irq_desc[i].handler = &gpio_irq_controller;
212 }
213
214 /* Default all ICU IRQs to off ... */
215 *VR4181_MSYSINT1REG = 0;
216 *VR4181_MSYSINT2REG = 0;
217
218 /* We initialize the level 2 ICU registers to all bits disabled. */
219 *VR4181_MPIUINTREG = 0;
220 *VR4181_MAIUINTREG = 0;
221 *VR4181_MKIUINTREG = 0;
222
223 /* disable all GPIO intrs */
224 *VR4181_GPINTMSK = 0xffff;
225
226 /* vector handler. What these do is register the IRQ as non-sharable */
227 setup_irq(VR4181_IRQ_INT0, &cascade);
228 setup_irq(VR4181_IRQ_GIU, &cascade);
229
230 /*
231 * RTC interrupts are interesting. They have two destinations.
232 * One is at sys irq controller, and the other is at CPU IP3 and IP4.
233 * RTC timer is used as system timer.
234 * We enable them here, but timer routine will register later
235 * with CPU IP3/IP4.
236 */
237 setup_irq(VR4181_IRQ_RTCL1, &reserved);
238 setup_irq(VR4181_IRQ_RTCL2, &reserved);
239}
diff --git a/arch/mips/vr4181/common/serial.c b/arch/mips/vr4181/common/serial.c
deleted file mode 100644
index 3f62c62b107f..000000000000
--- a/arch/mips/vr4181/common/serial.c
+++ /dev/null
@@ -1,51 +0,0 @@
1/*
2 * Copyright 2001 MontaVista Software Inc.
3 * Author: Jun Sun, jsun@mvista.com or jsun@junsun.net
4 *
5 * arch/mips/vr4181/common/serial.c
6 * initialize serial port on vr4181.
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
15/*
16 * [jsun, 010925]
17 * You need to make sure rs_table has at least one element in
18 * drivers/char/serial.c file. There is no good way to do it right
19 * now. A workaround is to include CONFIG_SERIAL_MANY_PORTS in your
20 * configure file, which would gives you 64 ports and wastes 11K ram.
21 */
22
23#include <linux/types.h>
24#include <linux/kernel.h>
25#include <linux/init.h>
26#include <linux/serial.h>
27
28#include <asm/vr4181/vr4181.h>
29
30void __init vr4181_init_serial(void)
31{
32 struct serial_struct s;
33
34 /* turn on UART clock */
35 *VR4181_CMUCLKMSK |= VR4181_CMUCLKMSK_MSKSIU;
36
37 /* clear memory */
38 memset(&s, 0, sizeof(s));
39
40 s.line = 0; /* we set the first one */
41 s.baud_base = 1152000;
42 s.irq = VR4181_IRQ_SIU;
43 s.flags = ASYNC_BOOT_AUTOCONF | ASYNC_SKIP_TEST; /* STD_COM_FLAGS */
44 s.iomem_base = (u8*)VR4181_SIURB;
45 s.iomem_reg_shift = 0;
46 s.io_type = SERIAL_IO_MEM;
47 if (early_serial_setup(&s) != 0) {
48 panic("vr4181_init_serial() failed!");
49 }
50}
51
diff --git a/arch/mips/vr4181/common/time.c b/arch/mips/vr4181/common/time.c
deleted file mode 100644
index 17814076b6f4..000000000000
--- a/arch/mips/vr4181/common/time.c
+++ /dev/null
@@ -1,145 +0,0 @@
1/*
2 * Copyright 2001 MontaVista Software Inc.
3 * Author: jsun@mvista.com or jsun@junsun.net
4 *
5 * rtc and time ops for vr4181. Part of code is drived from
6 * linux-vr, originally written by Bradley D. LaRonde & Michael Klar.
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
15#include <linux/kernel.h>
16#include <linux/spinlock.h>
17#include <linux/param.h> /* for HZ */
18#include <linux/time.h>
19#include <linux/interrupt.h>
20
21#include <asm/system.h>
22#include <asm/time.h>
23
24#include <asm/vr4181/vr4181.h>
25
26#define COUNTS_PER_JIFFY ((32768 + HZ/2) / HZ)
27
28/*
29 * RTC ops
30 */
31
32DEFINE_SPINLOCK(rtc_lock);
33
34/* per VR41xx docs, bad data can be read if between 2 counts */
35static inline unsigned short
36read_time_reg(volatile unsigned short *reg)
37{
38 unsigned short value;
39 do {
40 value = *reg;
41 barrier();
42 } while (value != *reg);
43 return value;
44}
45
46static unsigned long
47vr4181_rtc_get_time(void)
48{
49 unsigned short regh, regm, regl;
50
51 // why this crazy order, you ask? to guarantee that neither m
52 // nor l wrap before all 3 read
53 do {
54 regm = read_time_reg(VR4181_ETIMEMREG);
55 barrier();
56 regh = read_time_reg(VR4181_ETIMEHREG);
57 barrier();
58 regl = read_time_reg(VR4181_ETIMELREG);
59 } while (regm != read_time_reg(VR4181_ETIMEMREG));
60 return ((regh << 17) | (regm << 1) | (regl >> 15));
61}
62
63static int
64vr4181_rtc_set_time(unsigned long timeval)
65{
66 unsigned short intreg;
67 unsigned long flags;
68
69 spin_lock_irqsave(&rtc_lock, flags);
70 intreg = *VR4181_RTCINTREG & 0x05;
71 barrier();
72 *VR4181_ETIMELREG = timeval << 15;
73 *VR4181_ETIMEMREG = timeval >> 1;
74 *VR4181_ETIMEHREG = timeval >> 17;
75 barrier();
76 // assume that any ints that just triggered are invalid, since the
77 // time value is written non-atomically in 3 separate regs
78 *VR4181_RTCINTREG = 0x05 ^ intreg;
79 spin_unlock_irqrestore(&rtc_lock, flags);
80
81 return 0;
82}
83
84
85/*
86 * timer interrupt routine (wrapper)
87 *
88 * we need our own interrupt routine because we need to clear
89 * RTC1 interrupt.
90 */
91static void
92vr4181_timer_interrupt(int irq, void *dev_id, struct pt_regs *regs)
93{
94 /* Clear the interrupt. */
95 *VR4181_RTCINTREG = 0x2;
96
97 /* call the generic one */
98 timer_interrupt(irq, dev_id, regs);
99}
100
101
102/*
103 * vr4181_time_init:
104 *
105 * We pick the following choices:
106 * . we use elapsed timer as the RTC. We set some reasonable init data since
107 * it does not persist across reset
108 * . we use RTC1 as the system timer interrupt source.
109 * . we use CPU counter for fast_gettimeoffset and we calivrate the cpu
110 * frequency. In other words, we use calibrate_div64_gettimeoffset().
111 * . we use our own timer interrupt routine which clears the interrupt
112 * and then calls the generic high-level timer interrupt routine.
113 *
114 */
115
116extern int setup_irq(unsigned int irq, struct irqaction *irqaction);
117
118static void
119vr4181_timer_setup(struct irqaction *irq)
120{
121 /* over-write the handler to be our own one */
122 irq->handler = vr4181_timer_interrupt;
123
124 /* sets up the frequency */
125 *VR4181_RTCL1LREG = COUNTS_PER_JIFFY;
126 *VR4181_RTCL1HREG = 0;
127
128 /* and ack any pending ints */
129 *VR4181_RTCINTREG = 0x2;
130
131 /* setup irqaction */
132 setup_irq(VR4181_IRQ_INT1, irq);
133
134}
135
136void
137vr4181_init_time(void)
138{
139 /* setup hookup functions */
140 rtc_get_time = vr4181_rtc_get_time;
141 rtc_set_time = vr4181_rtc_set_time;
142
143 board_timer_setup = vr4181_timer_setup;
144}
145
diff --git a/arch/mips/vr4181/osprey/Makefile b/arch/mips/vr4181/osprey/Makefile
deleted file mode 100644
index 34be05790883..000000000000
--- a/arch/mips/vr4181/osprey/Makefile
+++ /dev/null
@@ -1,7 +0,0 @@
1#
2# Makefile for common code of NEC Osprey board
3#
4
5obj-y := setup.o prom.o reset.o
6
7obj-$(CONFIG_KGDB) += dbg_io.o
diff --git a/arch/mips/vr4181/osprey/dbg_io.c b/arch/mips/vr4181/osprey/dbg_io.c
deleted file mode 100644
index 5e8a84072d5b..000000000000
--- a/arch/mips/vr4181/osprey/dbg_io.c
+++ /dev/null
@@ -1,136 +0,0 @@
1/*
2 * kgdb io functions for osprey. We use the serial port on debug board.
3 *
4 * Copyright (C) 2001 MontaVista Software Inc.
5 * Author: jsun@mvista.com or jsun@junsun.net
6 *
7 * This program is free software; you can redistribute it and/or modify it
8 * under the terms of the GNU General Public License as published by the
9 * Free Software Foundation; either version 2 of the License, or (at your
10 * option) any later version.
11 *
12 */
13
14/* ======================= CONFIG ======================== */
15
16/* [jsun] we use the second serial port for kdb */
17#define BASE 0xb7fffff0
18#define MAX_BAUD 115200
19
20/* distance in bytes between two serial registers */
21#define REG_OFFSET 1
22
23/*
24 * 0 - kgdb does serial init
25 * 1 - kgdb skip serial init
26 */
27static int remoteDebugInitialized = 1;
28
29/*
30 * the default baud rate *if* kgdb does serial init
31 */
32#define BAUD_DEFAULT UART16550_BAUD_38400
33
34/* ======================= END OF CONFIG ======================== */
35
36typedef unsigned char uint8;
37typedef unsigned int uint32;
38
39#define UART16550_BAUD_2400 2400
40#define UART16550_BAUD_4800 4800
41#define UART16550_BAUD_9600 9600
42#define UART16550_BAUD_19200 19200
43#define UART16550_BAUD_38400 38400
44#define UART16550_BAUD_57600 57600
45#define UART16550_BAUD_115200 115200
46
47#define UART16550_PARITY_NONE 0
48#define UART16550_PARITY_ODD 0x08
49#define UART16550_PARITY_EVEN 0x18
50#define UART16550_PARITY_MARK 0x28
51#define UART16550_PARITY_SPACE 0x38
52
53#define UART16550_DATA_5BIT 0x0
54#define UART16550_DATA_6BIT 0x1
55#define UART16550_DATA_7BIT 0x2
56#define UART16550_DATA_8BIT 0x3
57
58#define UART16550_STOP_1BIT 0x0
59#define UART16550_STOP_2BIT 0x4
60
61/* register offset */
62#define OFS_RCV_BUFFER 0
63#define OFS_TRANS_HOLD 0
64#define OFS_SEND_BUFFER 0
65#define OFS_INTR_ENABLE (1*REG_OFFSET)
66#define OFS_INTR_ID (2*REG_OFFSET)
67#define OFS_DATA_FORMAT (3*REG_OFFSET)
68#define OFS_LINE_CONTROL (3*REG_OFFSET)
69#define OFS_MODEM_CONTROL (4*REG_OFFSET)
70#define OFS_RS232_OUTPUT (4*REG_OFFSET)
71#define OFS_LINE_STATUS (5*REG_OFFSET)
72#define OFS_MODEM_STATUS (6*REG_OFFSET)
73#define OFS_RS232_INPUT (6*REG_OFFSET)
74#define OFS_SCRATCH_PAD (7*REG_OFFSET)
75
76#define OFS_DIVISOR_LSB (0*REG_OFFSET)
77#define OFS_DIVISOR_MSB (1*REG_OFFSET)
78
79
80/* memory-mapped read/write of the port */
81#define UART16550_READ(y) (*((volatile uint8*)(BASE + y)))
82#define UART16550_WRITE(y, z) ((*((volatile uint8*)(BASE + y))) = z)
83
84void debugInit(uint32 baud, uint8 data, uint8 parity, uint8 stop)
85{
86 /* disable interrupts */
87 UART16550_WRITE(OFS_INTR_ENABLE, 0);
88
89 /* set up buad rate */
90 {
91 uint32 divisor;
92
93 /* set DIAB bit */
94 UART16550_WRITE(OFS_LINE_CONTROL, 0x80);
95
96 /* set divisor */
97 divisor = MAX_BAUD / baud;
98 UART16550_WRITE(OFS_DIVISOR_LSB, divisor & 0xff);
99 UART16550_WRITE(OFS_DIVISOR_MSB, (divisor & 0xff00) >> 8);
100
101 /* clear DIAB bit */
102 UART16550_WRITE(OFS_LINE_CONTROL, 0x0);
103 }
104
105 /* set data format */
106 UART16550_WRITE(OFS_DATA_FORMAT, data | parity | stop);
107}
108
109
110uint8 getDebugChar(void)
111{
112 if (!remoteDebugInitialized) {
113 remoteDebugInitialized = 1;
114 debugInit(BAUD_DEFAULT,
115 UART16550_DATA_8BIT,
116 UART16550_PARITY_NONE, UART16550_STOP_1BIT);
117 }
118
119 while ((UART16550_READ(OFS_LINE_STATUS) & 0x1) == 0);
120 return UART16550_READ(OFS_RCV_BUFFER);
121}
122
123
124int putDebugChar(uint8 byte)
125{
126 if (!remoteDebugInitialized) {
127 remoteDebugInitialized = 1;
128 debugInit(BAUD_DEFAULT,
129 UART16550_DATA_8BIT,
130 UART16550_PARITY_NONE, UART16550_STOP_1BIT);
131 }
132
133 while ((UART16550_READ(OFS_LINE_STATUS) & 0x20) == 0);
134 UART16550_WRITE(OFS_SEND_BUFFER, byte);
135 return 1;
136}
diff --git a/arch/mips/vr4181/osprey/prom.c b/arch/mips/vr4181/osprey/prom.c
deleted file mode 100644
index af0d14561619..000000000000
--- a/arch/mips/vr4181/osprey/prom.c
+++ /dev/null
@@ -1,49 +0,0 @@
1/*
2 * Copyright 2001 MontaVista Software Inc.
3 * Author: jsun@mvista.com or jsun@junsun.net
4 *
5 * arch/mips/vr4181/osprey/prom.c
6 * prom code for osprey.
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/init.h>
15#include <linux/kernel.h>
16#include <linux/string.h>
17#include <linux/mm.h>
18#include <linux/bootmem.h>
19#include <asm/bootinfo.h>
20#include <asm/addrspace.h>
21
22const char *get_system_type(void)
23{
24 return "NEC_Vr41xx Osprey";
25}
26
27/*
28 * [jsun] right now we assume it is the nec debug monitor, which does
29 * not pass any arguments.
30 */
31void __init prom_init(void)
32{
33 // cmdline is now set in default config
34 // strcpy(arcs_cmdline, "ip=bootp ");
35 // strcat(arcs_cmdline, "ether=46,0x03fe0300,eth0 ");
36 // strcpy(arcs_cmdline, "ether=0,0x0300,eth0 "
37 // strcat(arcs_cmdline, "video=vr4181fb:xres:240,yres:320,bpp:8 ");
38
39 mips_machgroup = MACH_GROUP_NEC_VR41XX;
40 mips_machtype = MACH_NEC_OSPREY;
41
42 /* 16MB fixed */
43 add_memory_region(0, 16 << 20, BOOT_MEM_RAM);
44}
45
46unsigned long __init prom_free_prom_memory(void)
47{
48 return 0;
49}
diff --git a/arch/mips/vr4181/osprey/reset.c b/arch/mips/vr4181/osprey/reset.c
deleted file mode 100644
index 036ae83d89d6..000000000000
--- a/arch/mips/vr4181/osprey/reset.c
+++ /dev/null
@@ -1,40 +0,0 @@
1/*
2 * This program is free software; you can redistribute it and/or modify it
3 * under the terms of the GNU General Public License as published by the
4 * Free Software Foundation; either version 2 of the License, or (at your
5 * option) any later version.
6 *
7 * Copyright (C) 1997, 2001 Ralf Baechle
8 * Copyright 2001 MontaVista Software Inc.
9 * Author: jsun@mvista.com or jsun@junsun.net
10 */
11#include <linux/sched.h>
12#include <linux/mm.h>
13#include <asm/io.h>
14#include <asm/cacheflush.h>
15#include <asm/processor.h>
16#include <asm/reboot.h>
17#include <asm/system.h>
18
19void nec_osprey_restart(char *command)
20{
21 set_c0_status(ST0_ERL);
22 change_c0_config(CONF_CM_CMASK, CONF_CM_UNCACHED);
23 flush_cache_all();
24 write_c0_wired(0);
25 __asm__ __volatile__("jr\t%0"::"r"(0xbfc00000));
26}
27
28void nec_osprey_halt(void)
29{
30 printk(KERN_NOTICE "\n** You can safely turn off the power\n");
31 while (1)
32 __asm__(".set\tmips3\n\t"
33 "wait\n\t"
34 ".set\tmips0");
35}
36
37void nec_osprey_power_off(void)
38{
39 nec_osprey_halt();
40}
diff --git a/arch/mips/vr4181/osprey/setup.c b/arch/mips/vr4181/osprey/setup.c
deleted file mode 100644
index 2ff7140e7ed7..000000000000
--- a/arch/mips/vr4181/osprey/setup.c
+++ /dev/null
@@ -1,68 +0,0 @@
1/*
2 * linux/arch/mips/vr4181/setup.c
3 *
4 * VR41xx setup routines
5 *
6 * Copyright (C) 1999 Bradley D. LaRonde
7 * Copyright (C) 1999, 2000 Michael Klar
8 *
9 * Copyright 2001 MontaVista Software Inc.
10 * Author: jsun@mvista.com or jsun@junsun.net
11 * Copyright (C) 2005 Ralf Baechle (ralf@linux-mips.org)
12 *
13 * This file is subject to the terms and conditions of the GNU General Public
14 * License. See the file "COPYING" in the main directory of this archive
15 * for more details.
16 *
17 */
18
19#include <linux/ide.h>
20#include <linux/init.h>
21#include <linux/delay.h>
22#include <asm/reboot.h>
23#include <asm/vr4181/vr4181.h>
24#include <asm/io.h>
25
26
27extern void nec_osprey_restart(char* c);
28extern void nec_osprey_halt(void);
29extern void nec_osprey_power_off(void);
30
31extern void vr4181_init_serial(void);
32extern void vr4181_init_time(void);
33
34static void __init nec_osprey_setup(void)
35{
36 set_io_port_base(VR4181_PORT_BASE);
37 isa_slot_offset = VR4181_ISAMEM_BASE;
38
39 vr4181_init_serial();
40 vr4181_init_time();
41
42 _machine_restart = nec_osprey_restart;
43 _machine_halt = nec_osprey_halt;
44 _machine_power_off = nec_osprey_power_off;
45
46 /* setup resource limit */
47 ioport_resource.end = 0xffffffff;
48 iomem_resource.end = 0xffffffff;
49
50 /* [jsun] hack */
51 /*
52 printk("[jsun] hack to change external ISA control register, %x -> %x\n",
53 (*VR4181_XISACTL),
54 (*VR4181_XISACTL) | 0x2);
55 *VR4181_XISACTL |= 0x2;
56 */
57
58 // *VR4181_GPHIBSTH = 0x2000;
59 // *VR4181_GPMD0REG = 0x00c0;
60 // *VR4181_GPINTEN = 1<<6;
61
62 /* [jsun] I believe this will get the interrupt type right
63 * for the ether port.
64 */
65 *VR4181_GPINTTYPL = 0x3000;
66}
67
68early_initcall(nec_osprey_setup);
diff --git a/arch/mips/vr41xx/casio-e55/setup.c b/arch/mips/vr41xx/casio-e55/setup.c
index aa8605ab76ff..d29201acc4f3 100644
--- a/arch/mips/vr41xx/casio-e55/setup.c
+++ b/arch/mips/vr41xx/casio-e55/setup.c
@@ -23,11 +23,6 @@
23#include <asm/io.h> 23#include <asm/io.h>
24#include <asm/vr41xx/e55.h> 24#include <asm/vr41xx/e55.h>
25 25
26const char *get_system_type(void)
27{
28 return "CASIO CASSIOPEIA E-11/15/55/65";
29}
30
31static int __init casio_e55_setup(void) 26static int __init casio_e55_setup(void)
32{ 27{
33 set_io_port_base(IO_PORT_BASE); 28 set_io_port_base(IO_PORT_BASE);
diff --git a/arch/mips/vr41xx/common/Makefile b/arch/mips/vr41xx/common/Makefile
index 92c11e9bbb3f..9096302a7ecc 100644
--- a/arch/mips/vr41xx/common/Makefile
+++ b/arch/mips/vr41xx/common/Makefile
@@ -2,7 +2,7 @@
2# Makefile for common code of the NEC VR4100 series. 2# Makefile for common code of the NEC VR4100 series.
3# 3#
4 4
5obj-y += bcu.o cmu.o giu.o icu.o init.o int-handler.o pmu.o 5obj-y += bcu.o cmu.o icu.o init.o int-handler.o irq.o pmu.o type.o
6obj-$(CONFIG_VRC4173) += vrc4173.o 6obj-$(CONFIG_VRC4173) += vrc4173.o
7 7
8EXTRA_AFLAGS := $(CFLAGS) 8EXTRA_AFLAGS := $(CFLAGS)
diff --git a/arch/mips/vr41xx/common/giu.c b/arch/mips/vr41xx/common/giu.c
deleted file mode 100644
index 9c6b21a79e8f..000000000000
--- a/arch/mips/vr41xx/common/giu.c
+++ /dev/null
@@ -1,455 +0,0 @@
1/*
2 * giu.c, General-purpose I/O Unit Interrupt routines for NEC VR4100 series.
3 *
4 * Copyright (C) 2002 MontaVista Software Inc.
5 * Author: Yoichi Yuasa <yyuasa@mvista.com or source@mvista.com>
6 * Copyright (C) 2003-2004 Yoichi Yuasa <yuasa@hh.iij4u.or.jp>
7 * Copyright (C) 2005 Ralf Baechle (ralf@linux-mips.org)
8 *
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License as published by
11 * the Free Software Foundation; either version 2 of the License, or
12 * (at your option) any later version.
13 *
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
18 *
19 * You should have received a copy of the GNU General Public License
20 * along with this program; if not, write to the Free Software
21 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
22 */
23/*
24 * Changes:
25 * MontaVista Software Inc. <yyuasa@mvista.com> or <source@mvista.com>
26 * - New creation, NEC VR4111, VR4121, VR4122 and VR4131 are supported.
27 *
28 * Yoichi Yuasa <yuasa@hh.iij4u.or.jp>
29 * - Added support for NEC VR4133.
30 * - Removed board_irq_init.
31 */
32#include <linux/errno.h>
33#include <linux/init.h>
34#include <linux/irq.h>
35#include <linux/kernel.h>
36#include <linux/module.h>
37#include <linux/smp.h>
38#include <linux/types.h>
39
40#include <asm/cpu.h>
41#include <asm/io.h>
42#include <asm/vr41xx/vr41xx.h>
43
44#define GIUIOSELL_TYPE1 KSEG1ADDR(0x0b000100)
45#define GIUIOSELL_TYPE2 KSEG1ADDR(0x0f000140)
46
47#define GIUIOSELL 0x00
48#define GIUIOSELH 0x02
49#define GIUINTSTATL 0x08
50#define GIUINTSTATH 0x0a
51#define GIUINTENL 0x0c
52#define GIUINTENH 0x0e
53#define GIUINTTYPL 0x10
54#define GIUINTTYPH 0x12
55#define GIUINTALSELL 0x14
56#define GIUINTALSELH 0x16
57#define GIUINTHTSELL 0x18
58#define GIUINTHTSELH 0x1a
59#define GIUFEDGEINHL 0x20
60#define GIUFEDGEINHH 0x22
61#define GIUREDGEINHL 0x24
62#define GIUREDGEINHH 0x26
63
64static uint32_t giu_base;
65
66static struct irqaction giu_cascade = {
67 .handler = no_action,
68 .mask = CPU_MASK_NONE,
69 .name = "cascade",
70};
71
72#define read_giuint(offset) readw(giu_base + (offset))
73#define write_giuint(val, offset) writew((val), giu_base + (offset))
74
75#define GIUINT_HIGH_OFFSET 16
76
77static inline uint16_t set_giuint(uint8_t offset, uint16_t set)
78{
79 uint16_t res;
80
81 res = read_giuint(offset);
82 res |= set;
83 write_giuint(res, offset);
84
85 return res;
86}
87
88static inline uint16_t clear_giuint(uint8_t offset, uint16_t clear)
89{
90 uint16_t res;
91
92 res = read_giuint(offset);
93 res &= ~clear;
94 write_giuint(res, offset);
95
96 return res;
97}
98
99static unsigned int startup_giuint_low_irq(unsigned int irq)
100{
101 unsigned int pin;
102
103 pin = GIU_IRQ_TO_PIN(irq);
104 write_giuint((uint16_t)1 << pin, GIUINTSTATL);
105 set_giuint(GIUINTENL, (uint16_t)1 << pin);
106
107 return 0;
108}
109
110static void shutdown_giuint_low_irq(unsigned int irq)
111{
112 clear_giuint(GIUINTENL, (uint16_t)1 << GIU_IRQ_TO_PIN(irq));
113}
114
115static void enable_giuint_low_irq(unsigned int irq)
116{
117 set_giuint(GIUINTENL, (uint16_t)1 << GIU_IRQ_TO_PIN(irq));
118}
119
120#define disable_giuint_low_irq shutdown_giuint_low_irq
121
122static void ack_giuint_low_irq(unsigned int irq)
123{
124 unsigned int pin;
125
126 pin = GIU_IRQ_TO_PIN(irq);
127 clear_giuint(GIUINTENL, (uint16_t)1 << pin);
128 write_giuint((uint16_t)1 << pin, GIUINTSTATL);
129}
130
131static void end_giuint_low_irq(unsigned int irq)
132{
133 if (!(irq_desc[irq].status & (IRQ_DISABLED | IRQ_INPROGRESS)))
134 set_giuint(GIUINTENL, (uint16_t)1 << GIU_IRQ_TO_PIN(irq));
135}
136
137static struct hw_interrupt_type giuint_low_irq_type = {
138 .typename = "GIUINTL",
139 .startup = startup_giuint_low_irq,
140 .shutdown = shutdown_giuint_low_irq,
141 .enable = enable_giuint_low_irq,
142 .disable = disable_giuint_low_irq,
143 .ack = ack_giuint_low_irq,
144 .end = end_giuint_low_irq,
145};
146
147static unsigned int startup_giuint_high_irq(unsigned int irq)
148{
149 unsigned int pin;
150
151 pin = GIU_IRQ_TO_PIN(irq - GIUINT_HIGH_OFFSET);
152 write_giuint((uint16_t)1 << pin, GIUINTSTATH);
153 set_giuint(GIUINTENH, (uint16_t)1 << pin);
154
155 return 0;
156}
157
158static void shutdown_giuint_high_irq(unsigned int irq)
159{
160 clear_giuint(GIUINTENH, (uint16_t)1 << GIU_IRQ_TO_PIN(irq - GIUINT_HIGH_OFFSET));
161}
162
163static void enable_giuint_high_irq(unsigned int irq)
164{
165 set_giuint(GIUINTENH, (uint16_t)1 << GIU_IRQ_TO_PIN(irq - GIUINT_HIGH_OFFSET));
166}
167
168#define disable_giuint_high_irq shutdown_giuint_high_irq
169
170static void ack_giuint_high_irq(unsigned int irq)
171{
172 unsigned int pin;
173
174 pin = GIU_IRQ_TO_PIN(irq - GIUINT_HIGH_OFFSET);
175 clear_giuint(GIUINTENH, (uint16_t)1 << pin);
176 write_giuint((uint16_t)1 << pin, GIUINTSTATH);
177}
178
179static void end_giuint_high_irq(unsigned int irq)
180{
181 if (!(irq_desc[irq].status & (IRQ_DISABLED | IRQ_INPROGRESS)))
182 set_giuint(GIUINTENH, (uint16_t)1 << GIU_IRQ_TO_PIN(irq - GIUINT_HIGH_OFFSET));
183}
184
185static struct hw_interrupt_type giuint_high_irq_type = {
186 .typename = "GIUINTH",
187 .startup = startup_giuint_high_irq,
188 .shutdown = shutdown_giuint_high_irq,
189 .enable = enable_giuint_high_irq,
190 .disable = disable_giuint_high_irq,
191 .ack = ack_giuint_high_irq,
192 .end = end_giuint_high_irq,
193};
194
195void __init init_vr41xx_giuint_irq(void)
196{
197 int i;
198
199 for (i = GIU_IRQ_BASE; i <= GIU_IRQ_LAST; i++) {
200 if (i < (GIU_IRQ_BASE + GIUINT_HIGH_OFFSET))
201 irq_desc[i].handler = &giuint_low_irq_type;
202 else
203 irq_desc[i].handler = &giuint_high_irq_type;
204 }
205
206 setup_irq(GIUINT_CASCADE_IRQ, &giu_cascade);
207}
208
209void vr41xx_set_irq_trigger(int pin, int trigger, int hold)
210{
211 uint16_t mask;
212
213 if (pin < GIUINT_HIGH_OFFSET) {
214 mask = (uint16_t)1 << pin;
215 if (trigger != TRIGGER_LEVEL) {
216 set_giuint(GIUINTTYPL, mask);
217 if (hold == SIGNAL_HOLD)
218 set_giuint(GIUINTHTSELL, mask);
219 else
220 clear_giuint(GIUINTHTSELL, mask);
221 if (current_cpu_data.cputype == CPU_VR4133) {
222 switch (trigger) {
223 case TRIGGER_EDGE_FALLING:
224 set_giuint(GIUFEDGEINHL, mask);
225 clear_giuint(GIUREDGEINHL, mask);
226 break;
227 case TRIGGER_EDGE_RISING:
228 clear_giuint(GIUFEDGEINHL, mask);
229 set_giuint(GIUREDGEINHL, mask);
230 break;
231 default:
232 set_giuint(GIUFEDGEINHL, mask);
233 set_giuint(GIUREDGEINHL, mask);
234 break;
235 }
236 }
237 } else {
238 clear_giuint(GIUINTTYPL, mask);
239 clear_giuint(GIUINTHTSELL, mask);
240 }
241 write_giuint(mask, GIUINTSTATL);
242 } else {
243 mask = (uint16_t)1 << (pin - GIUINT_HIGH_OFFSET);
244 if (trigger != TRIGGER_LEVEL) {
245 set_giuint(GIUINTTYPH, mask);
246 if (hold == SIGNAL_HOLD)
247 set_giuint(GIUINTHTSELH, mask);
248 else
249 clear_giuint(GIUINTHTSELH, mask);
250 if (current_cpu_data.cputype == CPU_VR4133) {
251 switch (trigger) {
252 case TRIGGER_EDGE_FALLING:
253 set_giuint(GIUFEDGEINHH, mask);
254 clear_giuint(GIUREDGEINHH, mask);
255 break;
256 case TRIGGER_EDGE_RISING:
257 clear_giuint(GIUFEDGEINHH, mask);
258 set_giuint(GIUREDGEINHH, mask);
259 break;
260 default:
261 set_giuint(GIUFEDGEINHH, mask);
262 set_giuint(GIUREDGEINHH, mask);
263 break;
264 }
265 }
266 } else {
267 clear_giuint(GIUINTTYPH, mask);
268 clear_giuint(GIUINTHTSELH, mask);
269 }
270 write_giuint(mask, GIUINTSTATH);
271 }
272}
273
274EXPORT_SYMBOL(vr41xx_set_irq_trigger);
275
276void vr41xx_set_irq_level(int pin, int level)
277{
278 uint16_t mask;
279
280 if (pin < GIUINT_HIGH_OFFSET) {
281 mask = (uint16_t)1 << pin;
282 if (level == LEVEL_HIGH)
283 set_giuint(GIUINTALSELL, mask);
284 else
285 clear_giuint(GIUINTALSELL, mask);
286 write_giuint(mask, GIUINTSTATL);
287 } else {
288 mask = (uint16_t)1 << (pin - GIUINT_HIGH_OFFSET);
289 if (level == LEVEL_HIGH)
290 set_giuint(GIUINTALSELH, mask);
291 else
292 clear_giuint(GIUINTALSELH, mask);
293 write_giuint(mask, GIUINTSTATH);
294 }
295}
296
297EXPORT_SYMBOL(vr41xx_set_irq_level);
298
299#define GIUINT_NR_IRQS 32
300
301enum {
302 GIUINT_NO_CASCADE,
303 GIUINT_CASCADE
304};
305
306struct vr41xx_giuint_cascade {
307 unsigned int flag;
308 int (*get_irq_number)(int irq);
309};
310
311static struct vr41xx_giuint_cascade giuint_cascade[GIUINT_NR_IRQS];
312
313static int no_irq_number(int irq)
314{
315 return -EINVAL;
316}
317
318int vr41xx_cascade_irq(unsigned int irq, int (*get_irq_number)(int irq))
319{
320 unsigned int pin;
321 int retval;
322
323 if (irq < GIU_IRQ(0) || irq > GIU_IRQ(31))
324 return -EINVAL;
325
326 if(!get_irq_number)
327 return -EINVAL;
328
329 pin = GIU_IRQ_TO_PIN(irq);
330 giuint_cascade[pin].flag = GIUINT_CASCADE;
331 giuint_cascade[pin].get_irq_number = get_irq_number;
332
333 retval = setup_irq(irq, &giu_cascade);
334 if (retval != 0) {
335 giuint_cascade[pin].flag = GIUINT_NO_CASCADE;
336 giuint_cascade[pin].get_irq_number = no_irq_number;
337 }
338
339 return retval;
340}
341
342EXPORT_SYMBOL(vr41xx_cascade_irq);
343
344static inline int get_irq_pin_number(void)
345{
346 uint16_t pendl, pendh, maskl, maskh;
347 int i;
348
349 pendl = read_giuint(GIUINTSTATL);
350 pendh = read_giuint(GIUINTSTATH);
351 maskl = read_giuint(GIUINTENL);
352 maskh = read_giuint(GIUINTENH);
353
354 maskl &= pendl;
355 maskh &= pendh;
356
357 if (maskl) {
358 for (i = 0; i < 16; i++) {
359 if (maskl & ((uint16_t)1 << i))
360 return i;
361 }
362 } else if (maskh) {
363 for (i = 0; i < 16; i++) {
364 if (maskh & ((uint16_t)1 << i))
365 return i + GIUINT_HIGH_OFFSET;
366 }
367 }
368
369 printk(KERN_ERR "spurious GIU interrupt: %04x(%04x),%04x(%04x)\n",
370 maskl, pendl, maskh, pendh);
371
372 atomic_inc(&irq_err_count);
373
374 return -1;
375}
376
377static inline void ack_giuint_irq(int pin)
378{
379 if (pin < GIUINT_HIGH_OFFSET) {
380 clear_giuint(GIUINTENL, (uint16_t)1 << pin);
381 write_giuint((uint16_t)1 << pin, GIUINTSTATL);
382 } else {
383 pin -= GIUINT_HIGH_OFFSET;
384 clear_giuint(GIUINTENH, (uint16_t)1 << pin);
385 write_giuint((uint16_t)1 << pin, GIUINTSTATH);
386 }
387}
388
389static inline void end_giuint_irq(int pin)
390{
391 if (pin < GIUINT_HIGH_OFFSET)
392 set_giuint(GIUINTENL, (uint16_t)1 << pin);
393 else
394 set_giuint(GIUINTENH, (uint16_t)1 << (pin - GIUINT_HIGH_OFFSET));
395}
396
397void giuint_irq_dispatch(struct pt_regs *regs)
398{
399 struct vr41xx_giuint_cascade *cascade;
400 unsigned int giuint_irq;
401 int pin;
402
403 pin = get_irq_pin_number();
404 if (pin < 0)
405 return;
406
407 disable_irq(GIUINT_CASCADE_IRQ);
408
409 cascade = &giuint_cascade[pin];
410 giuint_irq = GIU_IRQ(pin);
411 if (cascade->flag == GIUINT_CASCADE) {
412 int irq = cascade->get_irq_number(giuint_irq);
413 ack_giuint_irq(pin);
414 if (irq >= 0)
415 do_IRQ(irq, regs);
416 end_giuint_irq(pin);
417 } else {
418 do_IRQ(giuint_irq, regs);
419 }
420
421 enable_irq(GIUINT_CASCADE_IRQ);
422}
423
424static int __init vr41xx_giu_init(void)
425{
426 int i;
427
428 switch (current_cpu_data.cputype) {
429 case CPU_VR4111:
430 case CPU_VR4121:
431 giu_base = GIUIOSELL_TYPE1;
432 break;
433 case CPU_VR4122:
434 case CPU_VR4131:
435 case CPU_VR4133:
436 giu_base = GIUIOSELL_TYPE2;
437 break;
438 default:
439 printk(KERN_ERR "GIU: Unexpected CPU of NEC VR4100 series\n");
440 return -EINVAL;
441 }
442
443 for (i = 0; i < GIUINT_NR_IRQS; i++) {
444 if (i < GIUINT_HIGH_OFFSET)
445 clear_giuint(GIUINTENL, (uint16_t)1 << i);
446 else
447 clear_giuint(GIUINTENH, (uint16_t)1 << (i - GIUINT_HIGH_OFFSET));
448 giuint_cascade[i].flag = GIUINT_NO_CASCADE;
449 giuint_cascade[i].get_irq_number = no_irq_number;
450 }
451
452 return 0;
453}
454
455early_initcall(vr41xx_giu_init);
diff --git a/arch/mips/vr41xx/common/icu.c b/arch/mips/vr41xx/common/icu.c
index c842661144cb..0b73c5ab3c0c 100644
--- a/arch/mips/vr41xx/common/icu.c
+++ b/arch/mips/vr41xx/common/icu.c
@@ -3,8 +3,7 @@
3 * 3 *
4 * Copyright (C) 2001-2002 MontaVista Software Inc. 4 * Copyright (C) 2001-2002 MontaVista Software Inc.
5 * Author: Yoichi Yuasa <yyuasa@mvista.com or source@mvista.com> 5 * Author: Yoichi Yuasa <yyuasa@mvista.com or source@mvista.com>
6 * Copyright (C) 2003-2004 Yoichi Yuasa <yuasa@hh.iij4u.or.jp> 6 * Copyright (C) 2003-2005 Yoichi Yuasa <yuasa@hh.iij4u.or.jp>
7 * Copyright (C) 2005 Ralf Baechle (ralf@linux-mips.org)
8 * 7 *
9 * This program is free software; you can redistribute it and/or modify 8 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License as published by 9 * it under the terms of the GNU General Public License as published by
@@ -31,7 +30,7 @@
31 */ 30 */
32#include <linux/errno.h> 31#include <linux/errno.h>
33#include <linux/init.h> 32#include <linux/init.h>
34#include <linux/interrupt.h> 33#include <linux/ioport.h>
35#include <linux/irq.h> 34#include <linux/irq.h>
36#include <linux/module.h> 35#include <linux/module.h>
37#include <linux/smp.h> 36#include <linux/smp.h>
@@ -39,34 +38,24 @@
39 38
40#include <asm/cpu.h> 39#include <asm/cpu.h>
41#include <asm/io.h> 40#include <asm/io.h>
42#include <asm/irq.h>
43#include <asm/irq_cpu.h>
44#include <asm/vr41xx/vr41xx.h> 41#include <asm/vr41xx/vr41xx.h>
45 42
46extern asmlinkage void vr41xx_handle_interrupt(void); 43static void __iomem *icu1_base;
47 44static void __iomem *icu2_base;
48extern void init_vr41xx_giuint_irq(void);
49extern void giuint_irq_dispatch(struct pt_regs *regs);
50
51static uint32_t icu1_base;
52static uint32_t icu2_base;
53
54static struct irqaction icu_cascade = {
55 .handler = no_action,
56 .mask = CPU_MASK_NONE,
57 .name = "cascade",
58};
59 45
60static unsigned char sysint1_assign[16] = { 46static unsigned char sysint1_assign[16] = {
61 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; 47 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
62static unsigned char sysint2_assign[16] = { 48static unsigned char sysint2_assign[16] = {
63 2, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; 49 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
64 50
65#define SYSINT1REG_TYPE1 KSEG1ADDR(0x0b000080) 51#define ICU1_TYPE1_BASE 0x0b000080UL
66#define SYSINT2REG_TYPE1 KSEG1ADDR(0x0b000200) 52#define ICU2_TYPE1_BASE 0x0b000200UL
67 53
68#define SYSINT1REG_TYPE2 KSEG1ADDR(0x0f000080) 54#define ICU1_TYPE2_BASE 0x0f000080UL
69#define SYSINT2REG_TYPE2 KSEG1ADDR(0x0f0000a0) 55#define ICU2_TYPE2_BASE 0x0f0000a0UL
56
57#define ICU1_SIZE 0x20
58#define ICU2_SIZE 0x1c
70 59
71#define SYSINT1REG 0x00 60#define SYSINT1REG 0x00
72#define PIUINTREG 0x02 61#define PIUINTREG 0x02
@@ -106,61 +95,61 @@ static unsigned char sysint2_assign[16] = {
106#define SYSINT1_IRQ_TO_PIN(x) ((x) - SYSINT1_IRQ_BASE) /* Pin 0-15 */ 95#define SYSINT1_IRQ_TO_PIN(x) ((x) - SYSINT1_IRQ_BASE) /* Pin 0-15 */
107#define SYSINT2_IRQ_TO_PIN(x) ((x) - SYSINT2_IRQ_BASE) /* Pin 0-15 */ 96#define SYSINT2_IRQ_TO_PIN(x) ((x) - SYSINT2_IRQ_BASE) /* Pin 0-15 */
108 97
109#define read_icu1(offset) readw(icu1_base + (offset)) 98#define INT_TO_IRQ(x) ((x) + 2) /* Int0-4 -> IRQ2-6 */
110#define write_icu1(val, offset) writew((val), icu1_base + (offset)) 99
100#define icu1_read(offset) readw(icu1_base + (offset))
101#define icu1_write(offset, value) writew((value), icu1_base + (offset))
111 102
112#define read_icu2(offset) readw(icu2_base + (offset)) 103#define icu2_read(offset) readw(icu2_base + (offset))
113#define write_icu2(val, offset) writew((val), icu2_base + (offset)) 104#define icu2_write(offset, value) writew((value), icu2_base + (offset))
114 105
115#define INTASSIGN_MAX 4 106#define INTASSIGN_MAX 4
116#define INTASSIGN_MASK 0x0007 107#define INTASSIGN_MASK 0x0007
117 108
118static inline uint16_t set_icu1(uint8_t offset, uint16_t set) 109static inline uint16_t icu1_set(uint8_t offset, uint16_t set)
119{ 110{
120 uint16_t res; 111 uint16_t data;
121 112
122 res = read_icu1(offset); 113 data = icu1_read(offset);
123 res |= set; 114 data |= set;
124 write_icu1(res, offset); 115 icu1_write(offset, data);
125 116
126 return res; 117 return data;
127} 118}
128 119
129static inline uint16_t clear_icu1(uint8_t offset, uint16_t clear) 120static inline uint16_t icu1_clear(uint8_t offset, uint16_t clear)
130{ 121{
131 uint16_t res; 122 uint16_t data;
132 123
133 res = read_icu1(offset); 124 data = icu1_read(offset);
134 res &= ~clear; 125 data &= ~clear;
135 write_icu1(res, offset); 126 icu1_write(offset, data);
136 127
137 return res; 128 return data;
138} 129}
139 130
140static inline uint16_t set_icu2(uint8_t offset, uint16_t set) 131static inline uint16_t icu2_set(uint8_t offset, uint16_t set)
141{ 132{
142 uint16_t res; 133 uint16_t data;
143 134
144 res = read_icu2(offset); 135 data = icu2_read(offset);
145 res |= set; 136 data |= set;
146 write_icu2(res, offset); 137 icu2_write(offset, data);
147 138
148 return res; 139 return data;
149} 140}
150 141
151static inline uint16_t clear_icu2(uint8_t offset, uint16_t clear) 142static inline uint16_t icu2_clear(uint8_t offset, uint16_t clear)
152{ 143{
153 uint16_t res; 144 uint16_t data;
154 145
155 res = read_icu2(offset); 146 data = icu2_read(offset);
156 res &= ~clear; 147 data &= ~clear;
157 write_icu2(res, offset); 148 icu2_write(offset, data);
158 149
159 return res; 150 return data;
160} 151}
161 152
162/*=======================================================================*/
163
164void vr41xx_enable_piuint(uint16_t mask) 153void vr41xx_enable_piuint(uint16_t mask)
165{ 154{
166 irq_desc_t *desc = irq_desc + PIU_IRQ; 155 irq_desc_t *desc = irq_desc + PIU_IRQ;
@@ -169,7 +158,7 @@ void vr41xx_enable_piuint(uint16_t mask)
169 if (current_cpu_data.cputype == CPU_VR4111 || 158 if (current_cpu_data.cputype == CPU_VR4111 ||
170 current_cpu_data.cputype == CPU_VR4121) { 159 current_cpu_data.cputype == CPU_VR4121) {
171 spin_lock_irqsave(&desc->lock, flags); 160 spin_lock_irqsave(&desc->lock, flags);
172 set_icu1(MPIUINTREG, mask); 161 icu1_set(MPIUINTREG, mask);
173 spin_unlock_irqrestore(&desc->lock, flags); 162 spin_unlock_irqrestore(&desc->lock, flags);
174 } 163 }
175} 164}
@@ -184,7 +173,7 @@ void vr41xx_disable_piuint(uint16_t mask)
184 if (current_cpu_data.cputype == CPU_VR4111 || 173 if (current_cpu_data.cputype == CPU_VR4111 ||
185 current_cpu_data.cputype == CPU_VR4121) { 174 current_cpu_data.cputype == CPU_VR4121) {
186 spin_lock_irqsave(&desc->lock, flags); 175 spin_lock_irqsave(&desc->lock, flags);
187 clear_icu1(MPIUINTREG, mask); 176 icu1_clear(MPIUINTREG, mask);
188 spin_unlock_irqrestore(&desc->lock, flags); 177 spin_unlock_irqrestore(&desc->lock, flags);
189 } 178 }
190} 179}
@@ -199,7 +188,7 @@ void vr41xx_enable_aiuint(uint16_t mask)
199 if (current_cpu_data.cputype == CPU_VR4111 || 188 if (current_cpu_data.cputype == CPU_VR4111 ||
200 current_cpu_data.cputype == CPU_VR4121) { 189 current_cpu_data.cputype == CPU_VR4121) {
201 spin_lock_irqsave(&desc->lock, flags); 190 spin_lock_irqsave(&desc->lock, flags);
202 set_icu1(MAIUINTREG, mask); 191 icu1_set(MAIUINTREG, mask);
203 spin_unlock_irqrestore(&desc->lock, flags); 192 spin_unlock_irqrestore(&desc->lock, flags);
204 } 193 }
205} 194}
@@ -214,7 +203,7 @@ void vr41xx_disable_aiuint(uint16_t mask)
214 if (current_cpu_data.cputype == CPU_VR4111 || 203 if (current_cpu_data.cputype == CPU_VR4111 ||
215 current_cpu_data.cputype == CPU_VR4121) { 204 current_cpu_data.cputype == CPU_VR4121) {
216 spin_lock_irqsave(&desc->lock, flags); 205 spin_lock_irqsave(&desc->lock, flags);
217 clear_icu1(MAIUINTREG, mask); 206 icu1_clear(MAIUINTREG, mask);
218 spin_unlock_irqrestore(&desc->lock, flags); 207 spin_unlock_irqrestore(&desc->lock, flags);
219 } 208 }
220} 209}
@@ -229,7 +218,7 @@ void vr41xx_enable_kiuint(uint16_t mask)
229 if (current_cpu_data.cputype == CPU_VR4111 || 218 if (current_cpu_data.cputype == CPU_VR4111 ||
230 current_cpu_data.cputype == CPU_VR4121) { 219 current_cpu_data.cputype == CPU_VR4121) {
231 spin_lock_irqsave(&desc->lock, flags); 220 spin_lock_irqsave(&desc->lock, flags);
232 set_icu1(MKIUINTREG, mask); 221 icu1_set(MKIUINTREG, mask);
233 spin_unlock_irqrestore(&desc->lock, flags); 222 spin_unlock_irqrestore(&desc->lock, flags);
234 } 223 }
235} 224}
@@ -244,7 +233,7 @@ void vr41xx_disable_kiuint(uint16_t mask)
244 if (current_cpu_data.cputype == CPU_VR4111 || 233 if (current_cpu_data.cputype == CPU_VR4111 ||
245 current_cpu_data.cputype == CPU_VR4121) { 234 current_cpu_data.cputype == CPU_VR4121) {
246 spin_lock_irqsave(&desc->lock, flags); 235 spin_lock_irqsave(&desc->lock, flags);
247 clear_icu1(MKIUINTREG, mask); 236 icu1_clear(MKIUINTREG, mask);
248 spin_unlock_irqrestore(&desc->lock, flags); 237 spin_unlock_irqrestore(&desc->lock, flags);
249 } 238 }
250} 239}
@@ -257,7 +246,7 @@ void vr41xx_enable_dsiuint(uint16_t mask)
257 unsigned long flags; 246 unsigned long flags;
258 247
259 spin_lock_irqsave(&desc->lock, flags); 248 spin_lock_irqsave(&desc->lock, flags);
260 set_icu1(MDSIUINTREG, mask); 249 icu1_set(MDSIUINTREG, mask);
261 spin_unlock_irqrestore(&desc->lock, flags); 250 spin_unlock_irqrestore(&desc->lock, flags);
262} 251}
263 252
@@ -269,7 +258,7 @@ void vr41xx_disable_dsiuint(uint16_t mask)
269 unsigned long flags; 258 unsigned long flags;
270 259
271 spin_lock_irqsave(&desc->lock, flags); 260 spin_lock_irqsave(&desc->lock, flags);
272 clear_icu1(MDSIUINTREG, mask); 261 icu1_clear(MDSIUINTREG, mask);
273 spin_unlock_irqrestore(&desc->lock, flags); 262 spin_unlock_irqrestore(&desc->lock, flags);
274} 263}
275 264
@@ -281,7 +270,7 @@ void vr41xx_enable_firint(uint16_t mask)
281 unsigned long flags; 270 unsigned long flags;
282 271
283 spin_lock_irqsave(&desc->lock, flags); 272 spin_lock_irqsave(&desc->lock, flags);
284 set_icu2(MFIRINTREG, mask); 273 icu2_set(MFIRINTREG, mask);
285 spin_unlock_irqrestore(&desc->lock, flags); 274 spin_unlock_irqrestore(&desc->lock, flags);
286} 275}
287 276
@@ -293,7 +282,7 @@ void vr41xx_disable_firint(uint16_t mask)
293 unsigned long flags; 282 unsigned long flags;
294 283
295 spin_lock_irqsave(&desc->lock, flags); 284 spin_lock_irqsave(&desc->lock, flags);
296 clear_icu2(MFIRINTREG, mask); 285 icu2_clear(MFIRINTREG, mask);
297 spin_unlock_irqrestore(&desc->lock, flags); 286 spin_unlock_irqrestore(&desc->lock, flags);
298} 287}
299 288
@@ -308,7 +297,7 @@ void vr41xx_enable_pciint(void)
308 current_cpu_data.cputype == CPU_VR4131 || 297 current_cpu_data.cputype == CPU_VR4131 ||
309 current_cpu_data.cputype == CPU_VR4133) { 298 current_cpu_data.cputype == CPU_VR4133) {
310 spin_lock_irqsave(&desc->lock, flags); 299 spin_lock_irqsave(&desc->lock, flags);
311 write_icu2(PCIINT0, MPCIINTREG); 300 icu2_write(MPCIINTREG, PCIINT0);
312 spin_unlock_irqrestore(&desc->lock, flags); 301 spin_unlock_irqrestore(&desc->lock, flags);
313 } 302 }
314} 303}
@@ -324,7 +313,7 @@ void vr41xx_disable_pciint(void)
324 current_cpu_data.cputype == CPU_VR4131 || 313 current_cpu_data.cputype == CPU_VR4131 ||
325 current_cpu_data.cputype == CPU_VR4133) { 314 current_cpu_data.cputype == CPU_VR4133) {
326 spin_lock_irqsave(&desc->lock, flags); 315 spin_lock_irqsave(&desc->lock, flags);
327 write_icu2(0, MPCIINTREG); 316 icu2_write(MPCIINTREG, 0);
328 spin_unlock_irqrestore(&desc->lock, flags); 317 spin_unlock_irqrestore(&desc->lock, flags);
329 } 318 }
330} 319}
@@ -340,7 +329,7 @@ void vr41xx_enable_scuint(void)
340 current_cpu_data.cputype == CPU_VR4131 || 329 current_cpu_data.cputype == CPU_VR4131 ||
341 current_cpu_data.cputype == CPU_VR4133) { 330 current_cpu_data.cputype == CPU_VR4133) {
342 spin_lock_irqsave(&desc->lock, flags); 331 spin_lock_irqsave(&desc->lock, flags);
343 write_icu2(SCUINT0, MSCUINTREG); 332 icu2_write(MSCUINTREG, SCUINT0);
344 spin_unlock_irqrestore(&desc->lock, flags); 333 spin_unlock_irqrestore(&desc->lock, flags);
345 } 334 }
346} 335}
@@ -356,7 +345,7 @@ void vr41xx_disable_scuint(void)
356 current_cpu_data.cputype == CPU_VR4131 || 345 current_cpu_data.cputype == CPU_VR4131 ||
357 current_cpu_data.cputype == CPU_VR4133) { 346 current_cpu_data.cputype == CPU_VR4133) {
358 spin_lock_irqsave(&desc->lock, flags); 347 spin_lock_irqsave(&desc->lock, flags);
359 write_icu2(0, MSCUINTREG); 348 icu2_write(MSCUINTREG, 0);
360 spin_unlock_irqrestore(&desc->lock, flags); 349 spin_unlock_irqrestore(&desc->lock, flags);
361 } 350 }
362} 351}
@@ -372,7 +361,7 @@ void vr41xx_enable_csiint(uint16_t mask)
372 current_cpu_data.cputype == CPU_VR4131 || 361 current_cpu_data.cputype == CPU_VR4131 ||
373 current_cpu_data.cputype == CPU_VR4133) { 362 current_cpu_data.cputype == CPU_VR4133) {
374 spin_lock_irqsave(&desc->lock, flags); 363 spin_lock_irqsave(&desc->lock, flags);
375 set_icu2(MCSIINTREG, mask); 364 icu2_set(MCSIINTREG, mask);
376 spin_unlock_irqrestore(&desc->lock, flags); 365 spin_unlock_irqrestore(&desc->lock, flags);
377 } 366 }
378} 367}
@@ -388,7 +377,7 @@ void vr41xx_disable_csiint(uint16_t mask)
388 current_cpu_data.cputype == CPU_VR4131 || 377 current_cpu_data.cputype == CPU_VR4131 ||
389 current_cpu_data.cputype == CPU_VR4133) { 378 current_cpu_data.cputype == CPU_VR4133) {
390 spin_lock_irqsave(&desc->lock, flags); 379 spin_lock_irqsave(&desc->lock, flags);
391 clear_icu2(MCSIINTREG, mask); 380 icu2_clear(MCSIINTREG, mask);
392 spin_unlock_irqrestore(&desc->lock, flags); 381 spin_unlock_irqrestore(&desc->lock, flags);
393 } 382 }
394} 383}
@@ -404,7 +393,7 @@ void vr41xx_enable_bcuint(void)
404 current_cpu_data.cputype == CPU_VR4131 || 393 current_cpu_data.cputype == CPU_VR4131 ||
405 current_cpu_data.cputype == CPU_VR4133) { 394 current_cpu_data.cputype == CPU_VR4133) {
406 spin_lock_irqsave(&desc->lock, flags); 395 spin_lock_irqsave(&desc->lock, flags);
407 write_icu2(BCUINTR, MBCUINTREG); 396 icu2_write(MBCUINTREG, BCUINTR);
408 spin_unlock_irqrestore(&desc->lock, flags); 397 spin_unlock_irqrestore(&desc->lock, flags);
409 } 398 }
410} 399}
@@ -420,30 +409,28 @@ void vr41xx_disable_bcuint(void)
420 current_cpu_data.cputype == CPU_VR4131 || 409 current_cpu_data.cputype == CPU_VR4131 ||
421 current_cpu_data.cputype == CPU_VR4133) { 410 current_cpu_data.cputype == CPU_VR4133) {
422 spin_lock_irqsave(&desc->lock, flags); 411 spin_lock_irqsave(&desc->lock, flags);
423 write_icu2(0, MBCUINTREG); 412 icu2_write(MBCUINTREG, 0);
424 spin_unlock_irqrestore(&desc->lock, flags); 413 spin_unlock_irqrestore(&desc->lock, flags);
425 } 414 }
426} 415}
427 416
428EXPORT_SYMBOL(vr41xx_disable_bcuint); 417EXPORT_SYMBOL(vr41xx_disable_bcuint);
429 418
430/*=======================================================================*/
431
432static unsigned int startup_sysint1_irq(unsigned int irq) 419static unsigned int startup_sysint1_irq(unsigned int irq)
433{ 420{
434 set_icu1(MSYSINT1REG, (uint16_t)1 << SYSINT1_IRQ_TO_PIN(irq)); 421 icu1_set(MSYSINT1REG, 1 << SYSINT1_IRQ_TO_PIN(irq));
435 422
436 return 0; /* never anything pending */ 423 return 0; /* never anything pending */
437} 424}
438 425
439static void shutdown_sysint1_irq(unsigned int irq) 426static void shutdown_sysint1_irq(unsigned int irq)
440{ 427{
441 clear_icu1(MSYSINT1REG, (uint16_t)1 << SYSINT1_IRQ_TO_PIN(irq)); 428 icu1_clear(MSYSINT1REG, 1 << SYSINT1_IRQ_TO_PIN(irq));
442} 429}
443 430
444static void enable_sysint1_irq(unsigned int irq) 431static void enable_sysint1_irq(unsigned int irq)
445{ 432{
446 set_icu1(MSYSINT1REG, (uint16_t)1 << SYSINT1_IRQ_TO_PIN(irq)); 433 icu1_set(MSYSINT1REG, 1 << SYSINT1_IRQ_TO_PIN(irq));
447} 434}
448 435
449#define disable_sysint1_irq shutdown_sysint1_irq 436#define disable_sysint1_irq shutdown_sysint1_irq
@@ -452,7 +439,7 @@ static void enable_sysint1_irq(unsigned int irq)
452static void end_sysint1_irq(unsigned int irq) 439static void end_sysint1_irq(unsigned int irq)
453{ 440{
454 if (!(irq_desc[irq].status & (IRQ_DISABLED | IRQ_INPROGRESS))) 441 if (!(irq_desc[irq].status & (IRQ_DISABLED | IRQ_INPROGRESS)))
455 set_icu1(MSYSINT1REG, (uint16_t)1 << SYSINT1_IRQ_TO_PIN(irq)); 442 icu1_set(MSYSINT1REG, 1 << SYSINT1_IRQ_TO_PIN(irq));
456} 443}
457 444
458static struct hw_interrupt_type sysint1_irq_type = { 445static struct hw_interrupt_type sysint1_irq_type = {
@@ -465,23 +452,21 @@ static struct hw_interrupt_type sysint1_irq_type = {
465 .end = end_sysint1_irq, 452 .end = end_sysint1_irq,
466}; 453};
467 454
468/*=======================================================================*/
469
470static unsigned int startup_sysint2_irq(unsigned int irq) 455static unsigned int startup_sysint2_irq(unsigned int irq)
471{ 456{
472 set_icu2(MSYSINT2REG, (uint16_t)1 << SYSINT2_IRQ_TO_PIN(irq)); 457 icu2_set(MSYSINT2REG, 1 << SYSINT2_IRQ_TO_PIN(irq));
473 458
474 return 0; /* never anything pending */ 459 return 0; /* never anything pending */
475} 460}
476 461
477static void shutdown_sysint2_irq(unsigned int irq) 462static void shutdown_sysint2_irq(unsigned int irq)
478{ 463{
479 clear_icu2(MSYSINT2REG, (uint16_t)1 << SYSINT2_IRQ_TO_PIN(irq)); 464 icu2_clear(MSYSINT2REG, 1 << SYSINT2_IRQ_TO_PIN(irq));
480} 465}
481 466
482static void enable_sysint2_irq(unsigned int irq) 467static void enable_sysint2_irq(unsigned int irq)
483{ 468{
484 set_icu2(MSYSINT2REG, (uint16_t)1 << SYSINT2_IRQ_TO_PIN(irq)); 469 icu2_set(MSYSINT2REG, 1 << SYSINT2_IRQ_TO_PIN(irq));
485} 470}
486 471
487#define disable_sysint2_irq shutdown_sysint2_irq 472#define disable_sysint2_irq shutdown_sysint2_irq
@@ -490,7 +475,7 @@ static void enable_sysint2_irq(unsigned int irq)
490static void end_sysint2_irq(unsigned int irq) 475static void end_sysint2_irq(unsigned int irq)
491{ 476{
492 if (!(irq_desc[irq].status & (IRQ_DISABLED | IRQ_INPROGRESS))) 477 if (!(irq_desc[irq].status & (IRQ_DISABLED | IRQ_INPROGRESS)))
493 set_icu2(MSYSINT2REG, (uint16_t)1 << SYSINT2_IRQ_TO_PIN(irq)); 478 icu2_set(MSYSINT2REG, 1 << SYSINT2_IRQ_TO_PIN(irq));
494} 479}
495 480
496static struct hw_interrupt_type sysint2_irq_type = { 481static struct hw_interrupt_type sysint2_irq_type = {
@@ -503,8 +488,6 @@ static struct hw_interrupt_type sysint2_irq_type = {
503 .end = end_sysint2_irq, 488 .end = end_sysint2_irq,
504}; 489};
505 490
506/*=======================================================================*/
507
508static inline int set_sysint1_assign(unsigned int irq, unsigned char assign) 491static inline int set_sysint1_assign(unsigned int irq, unsigned char assign)
509{ 492{
510 irq_desc_t *desc = irq_desc + irq; 493 irq_desc_t *desc = irq_desc + irq;
@@ -515,8 +498,8 @@ static inline int set_sysint1_assign(unsigned int irq, unsigned char assign)
515 498
516 spin_lock_irq(&desc->lock); 499 spin_lock_irq(&desc->lock);
517 500
518 intassign0 = read_icu1(INTASSIGN0); 501 intassign0 = icu1_read(INTASSIGN0);
519 intassign1 = read_icu1(INTASSIGN1); 502 intassign1 = icu1_read(INTASSIGN1);
520 503
521 switch (pin) { 504 switch (pin) {
522 case 0: 505 case 0:
@@ -556,8 +539,8 @@ static inline int set_sysint1_assign(unsigned int irq, unsigned char assign)
556 } 539 }
557 540
558 sysint1_assign[pin] = assign; 541 sysint1_assign[pin] = assign;
559 write_icu1(intassign0, INTASSIGN0); 542 icu1_write(INTASSIGN0, intassign0);
560 write_icu1(intassign1, INTASSIGN1); 543 icu1_write(INTASSIGN1, intassign1);
561 544
562 spin_unlock_irq(&desc->lock); 545 spin_unlock_irq(&desc->lock);
563 546
@@ -574,8 +557,8 @@ static inline int set_sysint2_assign(unsigned int irq, unsigned char assign)
574 557
575 spin_lock_irq(&desc->lock); 558 spin_lock_irq(&desc->lock);
576 559
577 intassign2 = read_icu1(INTASSIGN2); 560 intassign2 = icu1_read(INTASSIGN2);
578 intassign3 = read_icu1(INTASSIGN3); 561 intassign3 = icu1_read(INTASSIGN3);
579 562
580 switch (pin) { 563 switch (pin) {
581 case 0: 564 case 0:
@@ -623,8 +606,8 @@ static inline int set_sysint2_assign(unsigned int irq, unsigned char assign)
623 } 606 }
624 607
625 sysint2_assign[pin] = assign; 608 sysint2_assign[pin] = assign;
626 write_icu1(intassign2, INTASSIGN2); 609 icu1_write(INTASSIGN2, intassign2);
627 write_icu1(intassign3, INTASSIGN3); 610 icu1_write(INTASSIGN3, intassign3);
628 611
629 spin_unlock_irq(&desc->lock); 612 spin_unlock_irq(&desc->lock);
630 613
@@ -651,88 +634,92 @@ int vr41xx_set_intassign(unsigned int irq, unsigned char intassign)
651 634
652EXPORT_SYMBOL(vr41xx_set_intassign); 635EXPORT_SYMBOL(vr41xx_set_intassign);
653 636
654/*=======================================================================*/ 637static int icu_get_irq(unsigned int irq, struct pt_regs *regs)
655
656asmlinkage void irq_dispatch(unsigned char intnum, struct pt_regs *regs)
657{ 638{
658 uint16_t pend1, pend2; 639 uint16_t pend1, pend2;
659 uint16_t mask1, mask2; 640 uint16_t mask1, mask2;
660 int i; 641 int i;
661 642
662 pend1 = read_icu1(SYSINT1REG); 643 pend1 = icu1_read(SYSINT1REG);
663 mask1 = read_icu1(MSYSINT1REG); 644 mask1 = icu1_read(MSYSINT1REG);
664 645
665 pend2 = read_icu2(SYSINT2REG); 646 pend2 = icu2_read(SYSINT2REG);
666 mask2 = read_icu2(MSYSINT2REG); 647 mask2 = icu2_read(MSYSINT2REG);
667 648
668 mask1 &= pend1; 649 mask1 &= pend1;
669 mask2 &= pend2; 650 mask2 &= pend2;
670 651
671 if (mask1) { 652 if (mask1) {
672 for (i = 0; i < 16; i++) { 653 for (i = 0; i < 16; i++) {
673 if (intnum == sysint1_assign[i] && 654 if (irq == INT_TO_IRQ(sysint1_assign[i]) && (mask1 & (1 << i)))
674 (mask1 & ((uint16_t)1 << i))) { 655 return SYSINT1_IRQ(i);
675 if (i == 8)
676 giuint_irq_dispatch(regs);
677 else
678 do_IRQ(SYSINT1_IRQ(i), regs);
679 return;
680 }
681 } 656 }
682 } 657 }
683 658
684 if (mask2) { 659 if (mask2) {
685 for (i = 0; i < 16; i++) { 660 for (i = 0; i < 16; i++) {
686 if (intnum == sysint2_assign[i] && 661 if (irq == INT_TO_IRQ(sysint2_assign[i]) && (mask2 & (1 << i)))
687 (mask2 & ((uint16_t)1 << i))) { 662 return SYSINT2_IRQ(i);
688 do_IRQ(SYSINT2_IRQ(i), regs);
689 return;
690 }
691 } 663 }
692 } 664 }
693 665
694 printk(KERN_ERR "spurious ICU interrupt: %04x,%04x\n", pend1, pend2); 666 printk(KERN_ERR "spurious ICU interrupt: %04x,%04x\n", pend1, pend2);
695 667
696 atomic_inc(&irq_err_count); 668 atomic_inc(&irq_err_count);
697}
698 669
699/*=======================================================================*/ 670 return -1;
671}
700 672
701static int __init vr41xx_icu_init(void) 673static int __init vr41xx_icu_init(void)
702{ 674{
675 unsigned long icu1_start, icu2_start;
676 int i;
677
703 switch (current_cpu_data.cputype) { 678 switch (current_cpu_data.cputype) {
704 case CPU_VR4111: 679 case CPU_VR4111:
705 case CPU_VR4121: 680 case CPU_VR4121:
706 icu1_base = SYSINT1REG_TYPE1; 681 icu1_start = ICU1_TYPE1_BASE;
707 icu2_base = SYSINT2REG_TYPE1; 682 icu2_start = ICU2_TYPE1_BASE;
708 break; 683 break;
709 case CPU_VR4122: 684 case CPU_VR4122:
710 case CPU_VR4131: 685 case CPU_VR4131:
711 case CPU_VR4133: 686 case CPU_VR4133:
712 icu1_base = SYSINT1REG_TYPE2; 687 icu1_start = ICU1_TYPE2_BASE;
713 icu2_base = SYSINT2REG_TYPE2; 688 icu2_start = ICU2_TYPE2_BASE;
714 break; 689 break;
715 default: 690 default:
716 printk(KERN_ERR "ICU: Unexpected CPU of NEC VR4100 series\n"); 691 printk(KERN_ERR "ICU: Unexpected CPU of NEC VR4100 series\n");
717 return -EINVAL; 692 return -ENODEV;
718 } 693 }
719 694
720 write_icu1(0, MSYSINT1REG); 695 if (request_mem_region(icu1_start, ICU1_SIZE, "ICU") == NULL)
721 write_icu1(0xffff, MGIUINTLREG); 696 return -EBUSY;
722 697
723 write_icu2(0, MSYSINT2REG); 698 if (request_mem_region(icu2_start, ICU2_SIZE, "ICU") == NULL) {
724 write_icu2(0xffff, MGIUINTHREG); 699 release_mem_region(icu1_start, ICU1_SIZE);
700 return -EBUSY;
701 }
725 702
726 return 0; 703 icu1_base = ioremap(icu1_start, ICU1_SIZE);
727} 704 if (icu1_base == NULL) {
705 release_mem_region(icu1_start, ICU1_SIZE);
706 release_mem_region(icu2_start, ICU2_SIZE);
707 return -ENOMEM;
708 }
728 709
729early_initcall(vr41xx_icu_init); 710 icu2_base = ioremap(icu2_start, ICU2_SIZE);
711 if (icu2_base == NULL) {
712 iounmap(icu1_base);
713 release_mem_region(icu1_start, ICU1_SIZE);
714 release_mem_region(icu2_start, ICU2_SIZE);
715 return -ENOMEM;
716 }
730 717
731/*=======================================================================*/ 718 icu1_write(MSYSINT1REG, 0);
719 icu1_write(MGIUINTLREG, 0xffff);
732 720
733static inline void init_vr41xx_icu_irq(void) 721 icu2_write(MSYSINT2REG, 0);
734{ 722 icu2_write(MGIUINTHREG, 0xffff);
735 int i;
736 723
737 for (i = SYSINT1_IRQ_BASE; i <= SYSINT1_IRQ_LAST; i++) 724 for (i = SYSINT1_IRQ_BASE; i <= SYSINT1_IRQ_LAST; i++)
738 irq_desc[i].handler = &sysint1_irq_type; 725 irq_desc[i].handler = &sysint1_irq_type;
@@ -740,18 +727,13 @@ static inline void init_vr41xx_icu_irq(void)
740 for (i = SYSINT2_IRQ_BASE; i <= SYSINT2_IRQ_LAST; i++) 727 for (i = SYSINT2_IRQ_BASE; i <= SYSINT2_IRQ_LAST; i++)
741 irq_desc[i].handler = &sysint2_irq_type; 728 irq_desc[i].handler = &sysint2_irq_type;
742 729
743 setup_irq(INT0_CASCADE_IRQ, &icu_cascade); 730 cascade_irq(INT0_IRQ, icu_get_irq);
744 setup_irq(INT1_CASCADE_IRQ, &icu_cascade); 731 cascade_irq(INT1_IRQ, icu_get_irq);
745 setup_irq(INT2_CASCADE_IRQ, &icu_cascade); 732 cascade_irq(INT2_IRQ, icu_get_irq);
746 setup_irq(INT3_CASCADE_IRQ, &icu_cascade); 733 cascade_irq(INT3_IRQ, icu_get_irq);
747 setup_irq(INT4_CASCADE_IRQ, &icu_cascade); 734 cascade_irq(INT4_IRQ, icu_get_irq);
748}
749 735
750void __init arch_init_irq(void) 736 return 0;
751{
752 mips_cpu_irq_init(MIPS_CPU_IRQ_BASE);
753 init_vr41xx_icu_irq();
754 init_vr41xx_giuint_irq();
755
756 set_except_vector(0, vr41xx_handle_interrupt);
757} 737}
738
739core_initcall(vr41xx_icu_init);
diff --git a/arch/mips/vr41xx/common/int-handler.S b/arch/mips/vr41xx/common/int-handler.S
index 38ff89b505f2..272c13aee4fd 100644
--- a/arch/mips/vr41xx/common/int-handler.S
+++ b/arch/mips/vr41xx/common/int-handler.S
@@ -71,24 +71,24 @@
71 71
72 andi t1, t0, CAUSEF_IP3 # check for Int1 72 andi t1, t0, CAUSEF_IP3 # check for Int1
73 bnez t1, handle_int 73 bnez t1, handle_int
74 li a0, 1 74 li a0, 3
75 75
76 andi t1, t0, CAUSEF_IP4 # check for Int2 76 andi t1, t0, CAUSEF_IP4 # check for Int2
77 bnez t1, handle_int 77 bnez t1, handle_int
78 li a0, 2 78 li a0, 4
79 79
80 andi t1, t0, CAUSEF_IP5 # check for Int3 80 andi t1, t0, CAUSEF_IP5 # check for Int3
81 bnez t1, handle_int 81 bnez t1, handle_int
82 li a0, 3 82 li a0, 5
83 83
84 andi t1, t0, CAUSEF_IP6 # check for Int4 84 andi t1, t0, CAUSEF_IP6 # check for Int4
85 bnez t1, handle_int 85 bnez t1, handle_int
86 li a0, 4 86 li a0, 6
87 87
881: 881:
89 andi t1, t0, CAUSEF_IP2 # check for Int0 89 andi t1, t0, CAUSEF_IP2 # check for Int0
90 bnez t1, handle_int 90 bnez t1, handle_int
91 li a0, 0 91 li a0, 2
92 92
93 andi t1, t0, CAUSEF_IP0 # check for IP0 93 andi t1, t0, CAUSEF_IP0 # check for IP0
94 bnez t1, handle_irq 94 bnez t1, handle_irq
diff --git a/arch/mips/vr41xx/common/irq.c b/arch/mips/vr41xx/common/irq.c
new file mode 100644
index 000000000000..43b214d39438
--- /dev/null
+++ b/arch/mips/vr41xx/common/irq.c
@@ -0,0 +1,94 @@
1/*
2 * Interrupt handing routines for NEC VR4100 series.
3 *
4 * Copyright (C) 2005 Yoichi Yuasa <yuasa@hh.iij4u.or.jp>
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 as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 */
20#include <linux/interrupt.h>
21#include <linux/module.h>
22
23#include <asm/irq_cpu.h>
24#include <asm/system.h>
25#include <asm/vr41xx/vr41xx.h>
26
27typedef struct irq_cascade {
28 int (*get_irq)(unsigned int, struct pt_regs *);
29} irq_cascade_t;
30
31static irq_cascade_t irq_cascade[NR_IRQS] __cacheline_aligned;
32
33static struct irqaction cascade_irqaction = {
34 .handler = no_action,
35 .mask = CPU_MASK_NONE,
36 .name = "cascade",
37};
38
39int cascade_irq(unsigned int irq, int (*get_irq)(unsigned int, struct pt_regs *))
40{
41 int retval = 0;
42
43 if (irq >= NR_IRQS)
44 return -EINVAL;
45
46 if (irq_cascade[irq].get_irq != NULL)
47 free_irq(irq, NULL);
48
49 irq_cascade[irq].get_irq = get_irq;
50
51 if (get_irq != NULL) {
52 retval = setup_irq(irq, &cascade_irqaction);
53 if (retval < 0)
54 irq_cascade[irq].get_irq = NULL;
55 }
56
57 return retval;
58}
59
60EXPORT_SYMBOL_GPL(cascade_irq);
61
62asmlinkage void irq_dispatch(unsigned int irq, struct pt_regs *regs)
63{
64 irq_cascade_t *cascade;
65 irq_desc_t *desc;
66
67 if (irq >= NR_IRQS) {
68 atomic_inc(&irq_err_count);
69 return;
70 }
71
72 cascade = irq_cascade + irq;
73 if (cascade->get_irq != NULL) {
74 unsigned int source_irq = irq;
75 desc = irq_desc + source_irq;
76 desc->handler->ack(source_irq);
77 irq = cascade->get_irq(irq, regs);
78 if (irq < 0)
79 atomic_inc(&irq_err_count);
80 else
81 irq_dispatch(irq, regs);
82 desc->handler->end(source_irq);
83 } else
84 do_IRQ(irq, regs);
85}
86
87extern asmlinkage void vr41xx_handle_interrupt(void);
88
89void __init arch_init_irq(void)
90{
91 mips_cpu_irq_init(MIPS_CPU_IRQ_BASE);
92
93 set_except_vector(0, vr41xx_handle_interrupt);
94}
diff --git a/arch/mips/vr41xx/tanbac-tb0226/setup.c b/arch/mips/vr41xx/common/type.c
index 60027e5dea25..bcb5f71b5026 100644
--- a/arch/mips/vr41xx/tanbac-tb0226/setup.c
+++ b/arch/mips/vr41xx/common/type.c
@@ -1,7 +1,7 @@
1/* 1/*
2 * setup.c, Setup for the TANBAC TB0226. 2 * type.c, System type for NEC VR4100 series.
3 * 3 *
4 * Copyright (C) 2002-2005 Yoichi Yuasa <yuasa@hh.iij4u.or.jp> 4 * Copyright (C) 2005 Yoichi Yuasa <yuasa@hh.iij4u.or.jp>
5 * 5 *
6 * This program is free software; you can redistribute it and/or modify 6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by 7 * it under the terms of the GNU General Public License as published by
@@ -20,5 +20,5 @@
20 20
21const char *get_system_type(void) 21const char *get_system_type(void)
22{ 22{
23 return "TANBAC TB0226"; 23 return "NEC VR4100 series";
24} 24}
diff --git a/arch/mips/vr41xx/common/vrc4173.c b/arch/mips/vr41xx/common/vrc4173.c
index 5475dd72e264..ba58764ef8ea 100644
--- a/arch/mips/vr41xx/common/vrc4173.c
+++ b/arch/mips/vr41xx/common/vrc4173.c
@@ -476,7 +476,7 @@ static inline int vrc4173_icu_init(int cascade_irq)
476 476
477 if (cascade_irq < GIU_IRQ(0) || cascade_irq > GIU_IRQ(15)) 477 if (cascade_irq < GIU_IRQ(0) || cascade_irq > GIU_IRQ(15))
478 return -EINVAL; 478 return -EINVAL;
479 479
480 vrc4173_outw(0, VRC4173_MSYSINT1REG); 480 vrc4173_outw(0, VRC4173_MSYSINT1REG);
481 481
482 vr41xx_set_irq_trigger(GIU_IRQ_TO_PIN(cascade_irq), TRIGGER_LEVEL, SIGNAL_THROUGH); 482 vr41xx_set_irq_trigger(GIU_IRQ_TO_PIN(cascade_irq), TRIGGER_LEVEL, SIGNAL_THROUGH);
diff --git a/arch/mips/vr41xx/ibm-workpad/setup.c b/arch/mips/vr41xx/ibm-workpad/setup.c
index cff44602d3d4..e4b34ad6ea61 100644
--- a/arch/mips/vr41xx/ibm-workpad/setup.c
+++ b/arch/mips/vr41xx/ibm-workpad/setup.c
@@ -23,11 +23,6 @@
23#include <asm/io.h> 23#include <asm/io.h>
24#include <asm/vr41xx/workpad.h> 24#include <asm/vr41xx/workpad.h>
25 25
26const char *get_system_type(void)
27{
28 return "IBM WorkPad z50";
29}
30
31static int __init ibm_workpad_setup(void) 26static int __init ibm_workpad_setup(void)
32{ 27{
33 set_io_port_base(IO_PORT_BASE); 28 set_io_port_base(IO_PORT_BASE);
diff --git a/arch/mips/vr41xx/nec-cmbvr4133/init.c b/arch/mips/vr41xx/nec-cmbvr4133/init.c
index 87f06b3f5a9c..be590edb0b83 100644
--- a/arch/mips/vr41xx/nec-cmbvr4133/init.c
+++ b/arch/mips/vr41xx/nec-cmbvr4133/init.c
@@ -16,11 +16,6 @@
16 * Manish Lachwani (mlachwani@mvista.com) 16 * Manish Lachwani (mlachwani@mvista.com)
17 */ 17 */
18#include <linux/config.h> 18#include <linux/config.h>
19#include <linux/init.h>
20#include <linux/kernel.h>
21#include <linux/string.h>
22
23#include <asm/bootinfo.h>
24 19
25#ifdef CONFIG_ROCKHOPPER 20#ifdef CONFIG_ROCKHOPPER
26#include <asm/io.h> 21#include <asm/io.h>
@@ -28,14 +23,7 @@
28 23
29#define PCICONFDREG 0xaf000c14 24#define PCICONFDREG 0xaf000c14
30#define PCICONFAREG 0xaf000c18 25#define PCICONFAREG 0xaf000c18
31#endif
32
33const char *get_system_type(void)
34{
35 return "NEC CMB-VR4133";
36}
37 26
38#ifdef CONFIG_ROCKHOPPER
39void disable_pcnet(void) 27void disable_pcnet(void)
40{ 28{
41 u32 data; 29 u32 data;
diff --git a/arch/mips/vr41xx/tanbac-tb0226/Makefile b/arch/mips/vr41xx/tanbac-tb0226/Makefile
deleted file mode 100644
index 372f953d240b..000000000000
--- a/arch/mips/vr41xx/tanbac-tb0226/Makefile
+++ /dev/null
@@ -1,5 +0,0 @@
1#
2# Makefile for the TANBAC TB0226 specific parts of the kernel
3#
4
5obj-y += setup.o
diff --git a/arch/mips/vr41xx/tanbac-tb0229/Makefile b/arch/mips/vr41xx/tanbac-tb0229/Makefile
deleted file mode 100644
index 9c6b864ef2ef..000000000000
--- a/arch/mips/vr41xx/tanbac-tb0229/Makefile
+++ /dev/null
@@ -1,5 +0,0 @@
1#
2# Makefile for the TANBAC TB0229(VR4131DIMM) specific parts of the kernel
3#
4
5obj-y := setup.o
diff --git a/arch/mips/vr41xx/tanbac-tb0229/setup.c b/arch/mips/vr41xx/tanbac-tb0229/setup.c
deleted file mode 100644
index 5c1b757bfb0c..000000000000
--- a/arch/mips/vr41xx/tanbac-tb0229/setup.c
+++ /dev/null
@@ -1,27 +0,0 @@
1/*
2 * setup.c, Setup for the TANBAC TB0229 (VR4131DIMM)
3 *
4 * Copyright (C) 2002-2005 Yoichi Yuasa <yuasa@hh.iij4u.or.jp>
5 *
6 * Modified for TANBAC TB0229:
7 * Copyright (C) 2003 Megasolution Inc. <matsu@megasolution.jp>
8 *
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License as published by
11 * the Free Software Foundation; either version 2 of the License, or
12 * (at your option) any later version.
13 *
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
18 *
19 * You should have received a copy of the GNU General Public License
20 * along with this program; if not, write to the Free Software
21 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
22 */
23
24const char *get_system_type(void)
25{
26 return "TANBAC TB0229";
27}
diff --git a/arch/mips/vr41xx/victor-mpc30x/Makefile b/arch/mips/vr41xx/victor-mpc30x/Makefile
deleted file mode 100644
index a2e8086a31a6..000000000000
--- a/arch/mips/vr41xx/victor-mpc30x/Makefile
+++ /dev/null
@@ -1,5 +0,0 @@
1#
2# Makefile for the Victor MP-C303/304 specific parts of the kernel
3#
4
5obj-y += setup.o
diff --git a/arch/mips/vr41xx/victor-mpc30x/setup.c b/arch/mips/vr41xx/victor-mpc30x/setup.c
deleted file mode 100644
index f591e36726e6..000000000000
--- a/arch/mips/vr41xx/victor-mpc30x/setup.c
+++ /dev/null
@@ -1,24 +0,0 @@
1/*
2 * setup.c, Setup for the Victor MP-C303/304.
3 *
4 * Copyright (C) 2002-2005 Yoichi Yuasa <yuasa@hh.iij4u.or.jp>
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 as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 */
20
21const char *get_system_type(void)
22{
23 return "Victor MP-C303/304";
24}
diff --git a/arch/mips/vr41xx/zao-capcella/Makefile b/arch/mips/vr41xx/zao-capcella/Makefile
deleted file mode 100644
index cf420197cd23..000000000000
--- a/arch/mips/vr41xx/zao-capcella/Makefile
+++ /dev/null
@@ -1,5 +0,0 @@
1#
2# Makefile for the ZAO Networks Capcella specific parts of the kernel
3#
4
5obj-y += setup.o
diff --git a/arch/mips/vr41xx/zao-capcella/setup.c b/arch/mips/vr41xx/zao-capcella/setup.c
deleted file mode 100644
index 17bade241fe2..000000000000
--- a/arch/mips/vr41xx/zao-capcella/setup.c
+++ /dev/null
@@ -1,24 +0,0 @@
1/*
2 * setup.c, Setup for the ZAO Networks Capcella.
3 *
4 * Copyright (C) 2002-2005 Yoichi Yuasa <yuasa@hh.iij4u.or.jp>
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 as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 */
20
21const char *get_system_type(void)
22{
23 return "ZAO Networks Capcella";
24}
diff --git a/arch/parisc/Kconfig b/arch/parisc/Kconfig
index ce327c799b44..1c2d87435233 100644
--- a/arch/parisc/Kconfig
+++ b/arch/parisc/Kconfig
@@ -190,6 +190,8 @@ source "fs/Kconfig.binfmt"
190 190
191endmenu 191endmenu
192 192
193source "net/Kconfig"
194
193source "drivers/Kconfig" 195source "drivers/Kconfig"
194 196
195source "fs/Kconfig" 197source "fs/Kconfig"
diff --git a/arch/parisc/kernel/pci.c b/arch/parisc/kernel/pci.c
index 3cb08a4a513a..e6a891a0cad0 100644
--- a/arch/parisc/kernel/pci.c
+++ b/arch/parisc/kernel/pci.c
@@ -255,8 +255,26 @@ void __devinit pcibios_resource_to_bus(struct pci_dev *dev,
255 pcibios_link_hba_resources(&hba->lmmio_space, bus->resource[1]); 255 pcibios_link_hba_resources(&hba->lmmio_space, bus->resource[1]);
256} 256}
257 257
258void pcibios_bus_to_resource(struct pci_dev *dev, struct resource *res,
259 struct pci_bus_region *region)
260{
261 struct pci_bus *bus = dev->bus;
262 struct pci_hba_data *hba = HBA_DATA(bus->bridge->platform_data);
263
264 if (res->flags & IORESOURCE_MEM) {
265 res->start = PCI_HOST_ADDR(hba, region->start);
266 res->end = PCI_HOST_ADDR(hba, region->end);
267 }
268
269 if (res->flags & IORESOURCE_IO) {
270 res->start = region->start;
271 res->end = region->end;
272 }
273}
274
258#ifdef CONFIG_HOTPLUG 275#ifdef CONFIG_HOTPLUG
259EXPORT_SYMBOL(pcibios_resource_to_bus); 276EXPORT_SYMBOL(pcibios_resource_to_bus);
277EXPORT_SYMBOL(pcibios_bus_to_resource);
260#endif 278#endif
261 279
262/* 280/*
diff --git a/arch/parisc/kernel/process.c b/arch/parisc/kernel/process.c
index 46e4a6881f11..4fc04501d5e5 100644
--- a/arch/parisc/kernel/process.c
+++ b/arch/parisc/kernel/process.c
@@ -150,8 +150,6 @@ void machine_restart(char *cmd)
150 150
151} 151}
152 152
153EXPORT_SYMBOL(machine_restart);
154
155void machine_halt(void) 153void machine_halt(void)
156{ 154{
157 /* 155 /*
@@ -160,8 +158,6 @@ void machine_halt(void)
160 */ 158 */
161} 159}
162 160
163EXPORT_SYMBOL(machine_halt);
164
165 161
166/* 162/*
167 * This routine is called from sys_reboot to actually turn off the 163 * This routine is called from sys_reboot to actually turn off the
@@ -187,8 +183,6 @@ void machine_power_off(void)
187 KERN_EMERG "Please power this system off now."); 183 KERN_EMERG "Please power this system off now.");
188} 184}
189 185
190EXPORT_SYMBOL(machine_power_off);
191
192 186
193/* 187/*
194 * Create a kernel thread 188 * Create a kernel thread
diff --git a/arch/parisc/kernel/signal.c b/arch/parisc/kernel/signal.c
index 9421bb98ea63..55d71c15e1f7 100644
--- a/arch/parisc/kernel/signal.c
+++ b/arch/parisc/kernel/signal.c
@@ -517,13 +517,12 @@ handle_signal(unsigned long sig, siginfo_t *info, struct k_sigaction *ka,
517 if (!setup_rt_frame(sig, ka, info, oldset, regs, in_syscall)) 517 if (!setup_rt_frame(sig, ka, info, oldset, regs, in_syscall))
518 return 0; 518 return 0;
519 519
520 if (!(ka->sa.sa_flags & SA_NODEFER)) { 520 spin_lock_irq(&current->sighand->siglock);
521 spin_lock_irq(&current->sighand->siglock); 521 sigorsets(&current->blocked,&current->blocked,&ka->sa.sa_mask);
522 sigorsets(&current->blocked,&current->blocked,&ka->sa.sa_mask); 522 if (!(ka->sa.sa_flags & SA_NODEFER))
523 sigaddset(&current->blocked,sig); 523 sigaddset(&current->blocked,sig);
524 recalc_sigpending(); 524 recalc_sigpending();
525 spin_unlock_irq(&current->sighand->siglock); 525 spin_unlock_irq(&current->sighand->siglock);
526 }
527 return 1; 526 return 1;
528} 527}
529 528
diff --git a/arch/parisc/mm/fault.c b/arch/parisc/mm/fault.c
index eaa701479f5f..0ad945d4c0a4 100644
--- a/arch/parisc/mm/fault.c
+++ b/arch/parisc/mm/fault.c
@@ -178,17 +178,17 @@ good_area:
178 */ 178 */
179 179
180 switch (handle_mm_fault(mm, vma, address, (acc_type & VM_WRITE) != 0)) { 180 switch (handle_mm_fault(mm, vma, address, (acc_type & VM_WRITE) != 0)) {
181 case 1: 181 case VM_FAULT_MINOR:
182 ++current->min_flt; 182 ++current->min_flt;
183 break; 183 break;
184 case 2: 184 case VM_FAULT_MAJOR:
185 ++current->maj_flt; 185 ++current->maj_flt;
186 break; 186 break;
187 case 0: 187 case VM_FAULT_SIGBUS:
188 /* 188 /*
189 * We ran out of memory, or some other thing happened 189 * We hit a hared mapping outside of the file, or some
190 * to us that made us unable to handle the page fault 190 * other thing happened to us that made us unable to
191 * gracefully. 191 * handle the page fault gracefully.
192 */ 192 */
193 goto bad_area; 193 goto bad_area;
194 default: 194 default:
diff --git a/arch/ppc/8xx_io/Kconfig b/arch/ppc/8xx_io/Kconfig
index 9e2227ec3b34..57dacf978532 100644
--- a/arch/ppc/8xx_io/Kconfig
+++ b/arch/ppc/8xx_io/Kconfig
@@ -69,9 +69,9 @@ config FEC_QS6612
69 69
70config ENET_BIG_BUFFERS 70config ENET_BIG_BUFFERS
71 bool "Use Big CPM Ethernet Buffers" 71 bool "Use Big CPM Ethernet Buffers"
72 depends on NET_ETHERNET 72 depends on SCC_ENET || FEC_ENET
73 help 73 help
74 Allocate large buffers for MPC8xx Etherenet. Increases throughput 74 Allocate large buffers for MPC8xx Ethernet. Increases throughput
75 and decreases the likelihood of dropped packets, but costs memory. 75 and decreases the likelihood of dropped packets, but costs memory.
76 76
77config HTDMSOUND 77config HTDMSOUND
diff --git a/arch/ppc/8xx_io/commproc.c b/arch/ppc/8xx_io/commproc.c
index 0cc2e7a9cb11..11726e2a4ec8 100644
--- a/arch/ppc/8xx_io/commproc.c
+++ b/arch/ppc/8xx_io/commproc.c
@@ -39,8 +39,6 @@
39#include <asm/tlbflush.h> 39#include <asm/tlbflush.h>
40#include <asm/rheap.h> 40#include <asm/rheap.h>
41 41
42extern int get_pteptr(struct mm_struct *mm, unsigned long addr, pte_t **ptep);
43
44static void m8xx_cpm_dpinit(void); 42static void m8xx_cpm_dpinit(void);
45static uint host_buffer; /* One page of host buffer */ 43static uint host_buffer; /* One page of host buffer */
46static uint host_end; /* end + 1 */ 44static uint host_end; /* end + 1 */
@@ -108,14 +106,11 @@ struct hw_interrupt_type cpm_pic = {
108 .end = cpm_eoi, 106 .end = cpm_eoi,
109}; 107};
110 108
111extern void flush_tlb_page(struct vm_area_struct *vma, unsigned long vmaddr);
112
113void 109void
114m8xx_cpm_reset(uint bootpage) 110m8xx_cpm_reset(void)
115{ 111{
116 volatile immap_t *imp; 112 volatile immap_t *imp;
117 volatile cpm8xx_t *commproc; 113 volatile cpm8xx_t *commproc;
118 pte_t *pte;
119 114
120 imp = (immap_t *)IMAP_ADDR; 115 imp = (immap_t *)IMAP_ADDR;
121 commproc = (cpm8xx_t *)&imp->im_cpm; 116 commproc = (cpm8xx_t *)&imp->im_cpm;
@@ -143,17 +138,6 @@ m8xx_cpm_reset(uint bootpage)
143 /* Reclaim the DP memory for our use. */ 138 /* Reclaim the DP memory for our use. */
144 m8xx_cpm_dpinit(); 139 m8xx_cpm_dpinit();
145 140
146 /* get the PTE for the bootpage */
147 if (!get_pteptr(&init_mm, bootpage, &pte))
148 panic("get_pteptr failed\n");
149
150 /* and make it uncachable */
151 pte_val(*pte) |= _PAGE_NO_CACHE;
152 _tlbie(bootpage);
153
154 host_buffer = bootpage;
155 host_end = host_buffer + PAGE_SIZE;
156
157 /* Tell everyone where the comm processor resides. 141 /* Tell everyone where the comm processor resides.
158 */ 142 */
159 cpmp = (cpm8xx_t *)commproc; 143 cpmp = (cpm8xx_t *)commproc;
@@ -384,8 +368,6 @@ static rh_info_t cpm_dpmem_info;
384 368
385void m8xx_cpm_dpinit(void) 369void m8xx_cpm_dpinit(void)
386{ 370{
387 cpm8xx_t *cp = &((immap_t *)IMAP_ADDR)->im_cpm;
388
389 spin_lock_init(&cpm_dpmem_lock); 371 spin_lock_init(&cpm_dpmem_lock);
390 372
391 /* Initialize the info header */ 373 /* Initialize the info header */
diff --git a/arch/ppc/8xx_io/fec.c b/arch/ppc/8xx_io/fec.c
index 0730392dcc20..62f68d6181c6 100644
--- a/arch/ppc/8xx_io/fec.c
+++ b/arch/ppc/8xx_io/fec.c
@@ -173,7 +173,7 @@ struct fec_enet_private {
173 uint phy_status; 173 uint phy_status;
174 uint phy_speed; 174 uint phy_speed;
175 phy_info_t *phy; 175 phy_info_t *phy;
176 struct tq_struct phy_task; 176 struct work_struct phy_task;
177 177
178 uint sequence_done; 178 uint sequence_done;
179 179
@@ -199,7 +199,8 @@ static int fec_enet_start_xmit(struct sk_buff *skb, struct net_device *dev);
199#ifdef CONFIG_USE_MDIO 199#ifdef CONFIG_USE_MDIO
200static void fec_enet_mii(struct net_device *dev); 200static void fec_enet_mii(struct net_device *dev);
201#endif /* CONFIG_USE_MDIO */ 201#endif /* CONFIG_USE_MDIO */
202static void fec_enet_interrupt(int irq, void * dev_id, struct pt_regs * regs); 202static irqreturn_t fec_enet_interrupt(int irq, void * dev_id,
203 struct pt_regs * regs);
203#ifdef CONFIG_FEC_PACKETHOOK 204#ifdef CONFIG_FEC_PACKETHOOK
204static void fec_enet_tx(struct net_device *dev, __u32 regval); 205static void fec_enet_tx(struct net_device *dev, __u32 regval);
205static void fec_enet_rx(struct net_device *dev, __u32 regval); 206static void fec_enet_rx(struct net_device *dev, __u32 regval);
@@ -471,7 +472,7 @@ fec_timeout(struct net_device *dev)
471/* The interrupt handler. 472/* The interrupt handler.
472 * This is called from the MPC core interrupt. 473 * This is called from the MPC core interrupt.
473 */ 474 */
474static void 475static irqreturn_t
475fec_enet_interrupt(int irq, void * dev_id, struct pt_regs * regs) 476fec_enet_interrupt(int irq, void * dev_id, struct pt_regs * regs)
476{ 477{
477 struct net_device *dev = dev_id; 478 struct net_device *dev = dev_id;
@@ -525,6 +526,7 @@ printk("%s[%d] %s: unexpected FEC_ENET_MII event\n", __FILE__,__LINE__,__FUNCTIO
525 } 526 }
526 527
527 } 528 }
529 return IRQ_RETVAL(IRQ_HANDLED);
528} 530}
529 531
530 532
@@ -1263,8 +1265,9 @@ static void mii_display_status(struct net_device *dev)
1263 printk(".\n"); 1265 printk(".\n");
1264} 1266}
1265 1267
1266static void mii_display_config(struct net_device *dev) 1268static void mii_display_config(void *priv)
1267{ 1269{
1270 struct net_device *dev = (struct net_device *)priv;
1268 struct fec_enet_private *fep = dev->priv; 1271 struct fec_enet_private *fep = dev->priv;
1269 volatile uint *s = &(fep->phy_status); 1272 volatile uint *s = &(fep->phy_status);
1270 1273
@@ -1294,8 +1297,9 @@ static void mii_display_config(struct net_device *dev)
1294 fep->sequence_done = 1; 1297 fep->sequence_done = 1;
1295} 1298}
1296 1299
1297static void mii_relink(struct net_device *dev) 1300static void mii_relink(void *priv)
1298{ 1301{
1302 struct net_device *dev = (struct net_device *)priv;
1299 struct fec_enet_private *fep = dev->priv; 1303 struct fec_enet_private *fep = dev->priv;
1300 int duplex; 1304 int duplex;
1301 1305
@@ -1323,18 +1327,16 @@ static void mii_queue_relink(uint mii_reg, struct net_device *dev)
1323{ 1327{
1324 struct fec_enet_private *fep = dev->priv; 1328 struct fec_enet_private *fep = dev->priv;
1325 1329
1326 fep->phy_task.routine = (void *)mii_relink; 1330 INIT_WORK(&fep->phy_task, mii_relink, (void *)dev);
1327 fep->phy_task.data = dev; 1331 schedule_work(&fep->phy_task);
1328 schedule_task(&fep->phy_task);
1329} 1332}
1330 1333
1331static void mii_queue_config(uint mii_reg, struct net_device *dev) 1334static void mii_queue_config(uint mii_reg, struct net_device *dev)
1332{ 1335{
1333 struct fec_enet_private *fep = dev->priv; 1336 struct fec_enet_private *fep = dev->priv;
1334 1337
1335 fep->phy_task.routine = (void *)mii_display_config; 1338 INIT_WORK(&fep->phy_task, mii_display_config, (void *)dev);
1336 fep->phy_task.data = dev; 1339 schedule_work(&fep->phy_task);
1337 schedule_task(&fep->phy_task);
1338} 1340}
1339 1341
1340 1342
@@ -1403,11 +1405,11 @@ mii_discover_phy(uint mii_reg, struct net_device *dev)
1403 1405
1404/* This interrupt occurs when the PHY detects a link change. 1406/* This interrupt occurs when the PHY detects a link change.
1405*/ 1407*/
1406static void 1408static
1407#ifdef CONFIG_RPXCLASSIC 1409#ifdef CONFIG_RPXCLASSIC
1408mii_link_interrupt(void *dev_id) 1410void mii_link_interrupt(void *dev_id)
1409#else 1411#else
1410mii_link_interrupt(int irq, void * dev_id, struct pt_regs * regs) 1412irqreturn_t mii_link_interrupt(int irq, void * dev_id, struct pt_regs * regs)
1411#endif 1413#endif
1412{ 1414{
1413#ifdef CONFIG_USE_MDIO 1415#ifdef CONFIG_USE_MDIO
@@ -1440,6 +1442,9 @@ mii_link_interrupt(int irq, void * dev_id, struct pt_regs * regs)
1440printk("%s[%d] %s: unexpected Link interrupt\n", __FILE__,__LINE__,__FUNCTION__); 1442printk("%s[%d] %s: unexpected Link interrupt\n", __FILE__,__LINE__,__FUNCTION__);
1441#endif /* CONFIG_USE_MDIO */ 1443#endif /* CONFIG_USE_MDIO */
1442 1444
1445#ifndef CONFIG_RPXCLASSIC
1446 return IRQ_RETVAL(IRQ_HANDLED);
1447#endif /* CONFIG_RPXCLASSIC */
1443} 1448}
1444 1449
1445static int 1450static int
@@ -1575,7 +1580,7 @@ static int __init fec_enet_init(void)
1575 struct fec_enet_private *fep; 1580 struct fec_enet_private *fep;
1576 int i, j, k, err; 1581 int i, j, k, err;
1577 unsigned char *eap, *iap, *ba; 1582 unsigned char *eap, *iap, *ba;
1578 unsigned long mem_addr; 1583 dma_addr_t mem_addr;
1579 volatile cbd_t *bdp; 1584 volatile cbd_t *bdp;
1580 cbd_t *cbd_base; 1585 cbd_t *cbd_base;
1581 volatile immap_t *immap; 1586 volatile immap_t *immap;
@@ -1640,7 +1645,8 @@ static int __init fec_enet_init(void)
1640 printk("FEC initialization failed.\n"); 1645 printk("FEC initialization failed.\n");
1641 return 1; 1646 return 1;
1642 } 1647 }
1643 cbd_base = (cbd_t *)consistent_alloc(GFP_KERNEL, PAGE_SIZE, &mem_addr); 1648 cbd_base = (cbd_t *)dma_alloc_coherent(dev->class_dev.dev, PAGE_SIZE,
1649 &mem_addr, GFP_KERNEL);
1644 1650
1645 /* Set receive and transmit descriptor base. 1651 /* Set receive and transmit descriptor base.
1646 */ 1652 */
@@ -1657,7 +1663,10 @@ static int __init fec_enet_init(void)
1657 1663
1658 /* Allocate a page. 1664 /* Allocate a page.
1659 */ 1665 */
1660 ba = (unsigned char *)consistent_alloc(GFP_KERNEL, PAGE_SIZE, &mem_addr); 1666 ba = (unsigned char *)dma_alloc_coherent(dev->class_dev.dev,
1667 PAGE_SIZE,
1668 &mem_addr,
1669 GFP_KERNEL);
1661 /* BUG: no check for failure */ 1670 /* BUG: no check for failure */
1662 1671
1663 /* Initialize the BD for every fragment in the page. 1672 /* Initialize the BD for every fragment in the page.
diff --git a/arch/ppc/Kconfig b/arch/ppc/Kconfig
index 23b0d2f662c5..36dee0ff5ca0 100644
--- a/arch/ppc/Kconfig
+++ b/arch/ppc/Kconfig
@@ -85,7 +85,6 @@ config POWER4
85 bool "POWER4 and 970 (G5)" 85 bool "POWER4 and 970 (G5)"
86 86
87config 8xx 87config 8xx
88 depends on BROKEN
89 bool "8xx" 88 bool "8xx"
90 89
91config E200 90config E200
@@ -331,14 +330,6 @@ config RPXLITE
331 End of life: end 2000 ? 330 End of life: end 2000 ?
332 URL: see TQM850L 331 URL: see TQM850L
333 332
334 SPD823TS:
335 MPC823 based board used in the "Tele Server" product
336 Manufacturer: Speech Design, <http://www.speech-design.de/>
337 Date of Release: Mid 2000 (?)
338 End of life: -
339 URL: <http://www.speech-design.de/>
340 select "English", then "Teleteam Solutions", then "TeleServer"
341
342 IVMS8: 333 IVMS8:
343 MPC860 based board used in the "Integrated Voice Mail System", 334 MPC860 based board used in the "Integrated Voice Mail System",
344 Small Version (8 voice channels) 335 Small Version (8 voice channels)
@@ -355,13 +346,6 @@ config RPXLITE
355 End of life: - 346 End of life: -
356 URL: <http://www.speech-design.de/> 347 URL: <http://www.speech-design.de/>
357 348
358 SM850:
359 Service Module (based on TQM850L)
360 Manufacturer: Dependable Computer Systems, <http://www.decomsys.com/>
361 Date of Release: end 2000 (?)
362 End of life: mid 2001 (?)
363 URL: <http://www.tz-mikroelektronik.de/ServiceModule/index.html>
364
365 HERMES: 349 HERMES:
366 Hermes-Pro ISDN/LAN router with integrated 8 x hub 350 Hermes-Pro ISDN/LAN router with integrated 8 x hub
367 Manufacturer: Multidata Gesellschaft fur Datentechnik und Informatik 351 Manufacturer: Multidata Gesellschaft fur Datentechnik und Informatik
@@ -465,13 +449,6 @@ config TQM860L
465config FPS850L 449config FPS850L
466 bool "FPS850L" 450 bool "FPS850L"
467 451
468config SPD823TS
469 bool "SPD823TS"
470 help
471 Say Y here to support the Speech Design 823 Tele-Server from Speech
472 Design, released in 2000. The manufacturer's website is at
473 <http://www.speech-design.de/>.
474
475config IVMS8 452config IVMS8
476 bool "IVMS8" 453 bool "IVMS8"
477 help 454 help
@@ -486,14 +463,6 @@ config IVML24
486 from Speech Design, released March 2001. The manufacturer's website 463 from Speech Design, released March 2001. The manufacturer's website
487 is at <http://www.speech-design.de/>. 464 is at <http://www.speech-design.de/>.
488 465
489config SM850
490 bool "SM850"
491 help
492 Say Y here to support the Service Module 850 from Dependable
493 Computer Systems, an SBC based on the TQM850L module by TQ
494 Components. This board is no longer in production. The
495 manufacturer's website is at <http://www.decomsys.com/>.
496
497config HERMES_PRO 466config HERMES_PRO
498 bool "HERMES" 467 bool "HERMES"
499 468
@@ -526,6 +495,11 @@ config WINCEPT
526 MPC821 PowerPC, introduced in 1998 and designed to be used in 495 MPC821 PowerPC, introduced in 1998 and designed to be used in
527 thin-client machines. Say Y to support it directly. 496 thin-client machines. Say Y to support it directly.
528 497
498 Be aware that PCI buses can only function when SYS board is plugged
499 into the PIB (Platform IO Board) board from Freescale which provide
500 3 PCI slots. The PIBs PCI initialization is the bootloader's
501 responsiblilty.
502
529endchoice 503endchoice
530 504
531choice 505choice
@@ -559,6 +533,7 @@ config PPC_MULTIPLATFORM
559 533
560config APUS 534config APUS
561 bool "Amiga-APUS" 535 bool "Amiga-APUS"
536 depends on BROKEN
562 help 537 help
563 Select APUS if configuring for a PowerUP Amiga. 538 Select APUS if configuring for a PowerUP Amiga.
564 More information is available at: 539 More information is available at:
@@ -578,9 +553,6 @@ config CPCI690
578 help 553 help
579 Select CPCI690 if configuring a Force CPCI690 cPCI board. 554 Select CPCI690 if configuring a Force CPCI690 cPCI board.
580 555
581config PCORE
582 bool "Force-PowerCore"
583
584config POWERPMC250 556config POWERPMC250
585 bool "Force-PowerPMC250" 557 bool "Force-PowerPMC250"
586 558
@@ -613,9 +585,6 @@ config EV64260
613config LOPEC 585config LOPEC
614 bool "Motorola-LoPEC" 586 bool "Motorola-LoPEC"
615 587
616config MCPN765
617 bool "Motorola-MCPN765"
618
619config MVME5100 588config MVME5100
620 bool "Motorola-MVME5100" 589 bool "Motorola-MVME5100"
621 590
@@ -637,17 +606,12 @@ config SANDPOINT
637config RADSTONE_PPC7D 606config RADSTONE_PPC7D
638 bool "Radstone Technology PPC7D board" 607 bool "Radstone Technology PPC7D board"
639 608
640config ADIR
641 bool "SBS-Adirondack"
642
643config K2
644 bool "SBS-K2"
645
646config PAL4 609config PAL4
647 bool "SBS-Palomar4" 610 bool "SBS-Palomar4"
648 611
649config GEMINI 612config GEMINI
650 bool "Synergy-Gemini" 613 bool "Synergy-Gemini"
614 depends on BROKEN
651 help 615 help
652 Select Gemini if configuring for a Synergy Microsystems' Gemini 616 Select Gemini if configuring for a Synergy Microsystems' Gemini
653 series Single Board Computer. More information is available at: 617 series Single Board Computer. More information is available at:
@@ -712,6 +676,11 @@ config MPC834x_SYS
712 help 676 help
713 This option enables support for the MPC 834x SYS evaluation board. 677 This option enables support for the MPC 834x SYS evaluation board.
714 678
679config EV64360
680 bool "Marvell-EV64360BP"
681 help
682 Select EV64360 if configuring a Marvell EV64360BP Evaluation
683 platform.
715endchoice 684endchoice
716 685
717config PQ2ADS 686config PQ2ADS
@@ -721,7 +690,7 @@ config PQ2ADS
721 690
722config TQM8xxL 691config TQM8xxL
723 bool 692 bool
724 depends on 8xx && (TQM823L || TQM850L || FPS850L || TQM855L || TQM860L || SM850) 693 depends on 8xx && (TQM823L || TQM850L || FPS850L || TQM855L || TQM860L)
725 default y 694 default y
726 695
727config EMBEDDEDBOOT 696config EMBEDDEDBOOT
@@ -795,15 +764,15 @@ config PPC_OF
795 764
796config PPC_GEN550 765config PPC_GEN550
797 bool 766 bool
798 depends on SANDPOINT || MCPN765 || SPRUCE || PPLUS || PCORE || \ 767 depends on SANDPOINT || SPRUCE || PPLUS || \
799 PRPMC750 || K2 || PRPMC800 || LOPEC || \ 768 PRPMC750 || PRPMC800 || LOPEC || \
800 (EV64260 && !SERIAL_MPSC) || CHESTNUT || RADSTONE_PPC7D || \ 769 (EV64260 && !SERIAL_MPSC) || CHESTNUT || RADSTONE_PPC7D || \
801 83xx 770 83xx
802 default y 771 default y
803 772
804config FORCE 773config FORCE
805 bool 774 bool
806 depends on 6xx && (PCORE || POWERPMC250) 775 depends on 6xx && POWERPMC250
807 default y 776 default y
808 777
809config GT64260 778config GT64260
@@ -813,7 +782,7 @@ config GT64260
813 782
814config MV64360 # Really MV64360 & MV64460 783config MV64360 # Really MV64360 & MV64460
815 bool 784 bool
816 depends on CHESTNUT || KATANA || RADSTONE_PPC7D || HDPU 785 depends on CHESTNUT || KATANA || RADSTONE_PPC7D || HDPU || EV64360
817 default y 786 default y
818 787
819config MV64X60 788config MV64X60
@@ -866,7 +835,7 @@ config EPIC_SERIAL_MODE
866 835
867config MPC10X_BRIDGE 836config MPC10X_BRIDGE
868 bool 837 bool
869 depends on PCORE || POWERPMC250 || LOPEC || SANDPOINT 838 depends on POWERPMC250 || LOPEC || SANDPOINT
870 default y 839 default y
871 840
872config MPC10X_OPENPIC 841config MPC10X_OPENPIC
@@ -878,9 +847,12 @@ config MPC10X_STORE_GATHERING
878 bool "Enable MPC10x store gathering" 847 bool "Enable MPC10x store gathering"
879 depends on MPC10X_BRIDGE 848 depends on MPC10X_BRIDGE
880 849
881config CPC710_DATA_GATHERING 850config SANDPOINT_ENABLE_UART1
882 bool "Enable CPC710 data gathering" 851 bool "Enable DUART mode on Sandpoint"
883 depends on K2 852 depends on SANDPOINT
853 help
854 If this option is enabled then the MPC824x processor will run
855 in DUART mode instead of UART mode.
884 856
885config HARRIER_STORE_GATHERING 857config HARRIER_STORE_GATHERING
886 bool "Enable Harrier store gathering" 858 bool "Enable Harrier store gathering"
@@ -903,6 +875,7 @@ config PPCBUG_NVRAM
903 default y if PPC_PREP 875 default y if PPC_PREP
904 876
905config SMP 877config SMP
878 depends on PPC_STD_MMU
906 bool "Symmetric multi-processing support" 879 bool "Symmetric multi-processing support"
907 ---help--- 880 ---help---
908 This enables support for systems with more than one CPU. If you have 881 This enables support for systems with more than one CPU. If you have
@@ -922,7 +895,7 @@ config SMP
922 895
923config IRQ_ALL_CPUS 896config IRQ_ALL_CPUS
924 bool "Distribute interrupts on all CPUs by default" 897 bool "Distribute interrupts on all CPUs by default"
925 depends on SMP 898 depends on SMP && !MV64360
926 help 899 help
927 This option gives the kernel permission to distribute IRQs across 900 This option gives the kernel permission to distribute IRQs across
928 multiple CPUs. Saying N here will route all IRQs to the first 901 multiple CPUs. Saying N here will route all IRQs to the first
@@ -935,19 +908,11 @@ config NR_CPUS
935 depends on SMP 908 depends on SMP
936 default "4" 909 default "4"
937 910
938config PREEMPT
939 bool "Preemptible Kernel"
940 help
941 This option reduces the latency of the kernel when reacting to
942 real-time or interactive events by allowing a low priority process to
943 be preempted even if it is in kernel mode executing a system call.
944
945 Say Y here if you are building a kernel for a desktop, embedded
946 or real-time system. Say N if you are unsure.
947
948config HIGHMEM 911config HIGHMEM
949 bool "High memory support" 912 bool "High memory support"
950 913
914source kernel/Kconfig.hz
915source kernel/Kconfig.preempt
951source "mm/Kconfig" 916source "mm/Kconfig"
952 917
953source "fs/Kconfig.binfmt" 918source "fs/Kconfig.binfmt"
@@ -1121,7 +1086,9 @@ config PROC_HARDWARE
1121 1086
1122source "drivers/zorro/Kconfig" 1087source "drivers/zorro/Kconfig"
1123 1088
1089if !44x || BROKEN
1124source kernel/power/Kconfig 1090source kernel/power/Kconfig
1091endif
1125 1092
1126config SECCOMP 1093config SECCOMP
1127 bool "Enable seccomp to safely compute untrusted bytecode" 1094 bool "Enable seccomp to safely compute untrusted bytecode"
@@ -1191,6 +1158,11 @@ config PCI_DOMAINS
1191 bool 1158 bool
1192 default PCI 1159 default PCI
1193 1160
1161config MPC83xx_PCI2
1162 bool " Supprt for 2nd PCI host controller"
1163 depends on PCI && MPC834x
1164 default y if MPC834x_SYS
1165
1194config PCI_QSPAN 1166config PCI_QSPAN
1195 bool "QSpan PCI" 1167 bool "QSpan PCI"
1196 depends on !4xx && !CPM2 && 8xx 1168 depends on !4xx && !CPM2 && 8xx
@@ -1355,6 +1327,8 @@ config PIN_TLB
1355 depends on ADVANCED_OPTIONS && 8xx 1327 depends on ADVANCED_OPTIONS && 8xx
1356endmenu 1328endmenu
1357 1329
1330source "net/Kconfig"
1331
1358source "drivers/Kconfig" 1332source "drivers/Kconfig"
1359 1333
1360source "fs/Kconfig" 1334source "fs/Kconfig"
diff --git a/arch/ppc/Kconfig.debug b/arch/ppc/Kconfig.debug
index e16c7710d4be..61653cb60c4e 100644
--- a/arch/ppc/Kconfig.debug
+++ b/arch/ppc/Kconfig.debug
@@ -62,7 +62,8 @@ config BOOTX_TEXT
62 62
63config SERIAL_TEXT_DEBUG 63config SERIAL_TEXT_DEBUG
64 bool "Support for early boot texts over serial port" 64 bool "Support for early boot texts over serial port"
65 depends on 4xx || GT64260 || LOPEC || PPLUS || PRPMC800 || PPC_GEN550 || PPC_MPC52xx 65 depends on 4xx || LOPEC || MV64X60 || PPLUS || PRPMC800 || \
66 PPC_GEN550 || PPC_MPC52xx
66 67
67config PPC_OCP 68config PPC_OCP
68 bool 69 bool
diff --git a/arch/ppc/Makefile b/arch/ppc/Makefile
index f9b0d778dd82..d1b6e6dcb504 100644
--- a/arch/ppc/Makefile
+++ b/arch/ppc/Makefile
@@ -21,11 +21,13 @@ CC := $(CC) -m32
21endif 21endif
22 22
23LDFLAGS_vmlinux := -Ttext $(KERNELLOAD) -Bstatic 23LDFLAGS_vmlinux := -Ttext $(KERNELLOAD) -Bstatic
24CPPFLAGS += -Iarch/$(ARCH) 24CPPFLAGS += -Iarch/$(ARCH) -Iinclude3
25AFLAGS += -Iarch/$(ARCH) 25AFLAGS += -Iarch/$(ARCH)
26CFLAGS += -Iarch/$(ARCH) -msoft-float -pipe \ 26CFLAGS += -Iarch/$(ARCH) -msoft-float -pipe \
27 -ffixed-r2 -mmultiple 27 -ffixed-r2 -mmultiple
28CPP = $(CC) -E $(CFLAGS) 28CPP = $(CC) -E $(CFLAGS)
29# Temporary hack until we have migrated to asm-powerpc
30LINUXINCLUDE += -Iinclude3
29 31
30CHECKFLAGS += -D__powerpc__ 32CHECKFLAGS += -D__powerpc__
31 33
@@ -101,6 +103,7 @@ endef
101 103
102archclean: 104archclean:
103 $(Q)$(MAKE) $(clean)=arch/ppc/boot 105 $(Q)$(MAKE) $(clean)=arch/ppc/boot
106 $(Q)rm -rf include3
104 107
105prepare: include/asm-$(ARCH)/offsets.h checkbin 108prepare: include/asm-$(ARCH)/offsets.h checkbin
106 109
@@ -110,6 +113,12 @@ arch/$(ARCH)/kernel/asm-offsets.s: include/asm include/linux/version.h \
110include/asm-$(ARCH)/offsets.h: arch/$(ARCH)/kernel/asm-offsets.s 113include/asm-$(ARCH)/offsets.h: arch/$(ARCH)/kernel/asm-offsets.s
111 $(call filechk,gen-asm-offsets) 114 $(call filechk,gen-asm-offsets)
112 115
116# Temporary hack until we have migrated to asm-powerpc
117include/asm: include3/asm
118include3/asm:
119 $(Q)if [ ! -d include3 ]; then mkdir -p include3; fi
120 $(Q)ln -fsn $(srctree)/include/asm-powerpc include3/asm
121
113# Use the file '.tmp_gas_check' for binutils tests, as gas won't output 122# Use the file '.tmp_gas_check' for binutils tests, as gas won't output
114# to stdout and these checks are run even on install targets. 123# to stdout and these checks are run even on install targets.
115TOUT := .tmp_gas_check 124TOUT := .tmp_gas_check
diff --git a/arch/ppc/boot/images/Makefile b/arch/ppc/boot/images/Makefile
index c9ac5f5fa9e4..532e7ef1edb6 100644
--- a/arch/ppc/boot/images/Makefile
+++ b/arch/ppc/boot/images/Makefile
@@ -6,12 +6,17 @@ MKIMAGE := $(srctree)/scripts/mkuboot.sh
6 6
7extra-y := vmlinux.bin vmlinux.gz 7extra-y := vmlinux.bin vmlinux.gz
8 8
9# two make processes may write to vmlinux.gz at the same time with make -j
10quiet_cmd_mygzip = GZIP $@
11cmd_mygzip = gzip -f -9 < $< > $@.$$$$ && mv $@.$$$$ $@
12
13
9OBJCOPYFLAGS_vmlinux.bin := -O binary 14OBJCOPYFLAGS_vmlinux.bin := -O binary
10$(obj)/vmlinux.bin: vmlinux FORCE 15$(obj)/vmlinux.bin: vmlinux FORCE
11 $(call if_changed,objcopy) 16 $(call if_changed,objcopy)
12 17
13$(obj)/vmlinux.gz: $(obj)/vmlinux.bin FORCE 18$(obj)/vmlinux.gz: $(obj)/vmlinux.bin FORCE
14 $(call if_changed,gzip) 19 $(call if_changed,mygzip)
15 20
16quiet_cmd_uimage = UIMAGE $@ 21quiet_cmd_uimage = UIMAGE $@
17 cmd_uimage = $(CONFIG_SHELL) $(MKIMAGE) -A ppc -O linux -T kernel \ 22 cmd_uimage = $(CONFIG_SHELL) $(MKIMAGE) -A ppc -O linux -T kernel \
diff --git a/arch/ppc/boot/simple/Makefile b/arch/ppc/boot/simple/Makefile
index 991b4cbb83c8..b7bd8f61a4ad 100644
--- a/arch/ppc/boot/simple/Makefile
+++ b/arch/ppc/boot/simple/Makefile
@@ -61,6 +61,12 @@ zimageinitrd-$(CONFIG_IBM_OPENBIOS) := zImage.initrd-TREE
61 end-$(CONFIG_EMBEDDEDBOOT) := embedded 61 end-$(CONFIG_EMBEDDEDBOOT) := embedded
62 misc-$(CONFIG_EMBEDDEDBOOT) := misc-embedded.o 62 misc-$(CONFIG_EMBEDDEDBOOT) := misc-embedded.o
63 63
64 zimage-$(CONFIG_BAMBOO) := zImage-TREE
65zimageinitrd-$(CONFIG_BAMBOO) := zImage.initrd-TREE
66 end-$(CONFIG_BAMBOO) := bamboo
67 entrypoint-$(CONFIG_BAMBOO) := 0x01000000
68 extra.o-$(CONFIG_BAMBOO) := pibs.o
69
64 zimage-$(CONFIG_EBONY) := zImage-TREE 70 zimage-$(CONFIG_EBONY) := zImage-TREE
65zimageinitrd-$(CONFIG_EBONY) := zImage.initrd-TREE 71zimageinitrd-$(CONFIG_EBONY) := zImage.initrd-TREE
66 end-$(CONFIG_EBONY) := ebony 72 end-$(CONFIG_EBONY) := ebony
@@ -90,10 +96,6 @@ zimageinitrd-$(CONFIG_OCOTEA) := zImage.initrd-TREE
90zimageinitrd-$(CONFIG_GEMINI) := zImage.initrd-STRIPELF 96zimageinitrd-$(CONFIG_GEMINI) := zImage.initrd-STRIPELF
91 end-$(CONFIG_GEMINI) := gemini 97 end-$(CONFIG_GEMINI) := gemini
92 98
93 extra.o-$(CONFIG_K2) := prepmap.o
94 end-$(CONFIG_K2) := k2
95 cacheflag-$(CONFIG_K2) := -include $(clear_L2_L3)
96
97 extra.o-$(CONFIG_KATANA) := misc-katana.o 99 extra.o-$(CONFIG_KATANA) := misc-katana.o
98 end-$(CONFIG_KATANA) := katana 100 end-$(CONFIG_KATANA) := katana
99 cacheflag-$(CONFIG_KATANA) := -include $(clear_L2_L3) 101 cacheflag-$(CONFIG_KATANA) := -include $(clear_L2_L3)
@@ -102,12 +104,15 @@ zimageinitrd-$(CONFIG_GEMINI) := zImage.initrd-STRIPELF
102 end-$(CONFIG_RADSTONE_PPC7D) := radstone_ppc7d 104 end-$(CONFIG_RADSTONE_PPC7D) := radstone_ppc7d
103 cacheflag-$(CONFIG_RADSTONE_PPC7D) := -include $(clear_L2_L3) 105 cacheflag-$(CONFIG_RADSTONE_PPC7D) := -include $(clear_L2_L3)
104 106
107 extra.o-$(CONFIG_EV64360) := misc-ev64360.o
108 end-$(CONFIG_EV64360) := ev64360
109 cacheflag-$(CONFIG_EV64360) := -include $(clear_L2_L3)
110
105# kconfig 'feature', only one of these will ever be 'y' at a time. 111# kconfig 'feature', only one of these will ever be 'y' at a time.
106# The rest will be unset. 112# The rest will be unset.
107motorola := $(CONFIG_MCPN765)$(CONFIG_MVME5100)$(CONFIG_PRPMC750) \ 113motorola := $(CONFIG_MVME5100)$(CONFIG_PRPMC750) \
108$(CONFIG_PRPMC800)$(CONFIG_LOPEC)$(CONFIG_PPLUS) 114$(CONFIG_PRPMC800)$(CONFIG_LOPEC)$(CONFIG_PPLUS)
109motorola := $(strip $(motorola)) 115motorola := $(strip $(motorola))
110pcore := $(CONFIG_PCORE)$(CONFIG_POWERPMC250)
111 116
112 zimage-$(motorola) := zImage-PPLUS 117 zimage-$(motorola) := zImage-PPLUS
113zimageinitrd-$(motorola) := zImage.initrd-PPLUS 118zimageinitrd-$(motorola) := zImage.initrd-PPLUS
@@ -117,12 +122,6 @@ zimageinitrd-$(motorola) := zImage.initrd-PPLUS
117 extra.o-$(CONFIG_PPLUS) := prepmap.o 122 extra.o-$(CONFIG_PPLUS) := prepmap.o
118 extra.o-$(CONFIG_LOPEC) := mpc10x_memory.o 123 extra.o-$(CONFIG_LOPEC) := mpc10x_memory.o
119 124
120 zimage-$(pcore) := zImage-STRIPELF
121zimageinitrd-$(pcore) := zImage.initrd-STRIPELF
122 extra.o-$(pcore) := chrpmap.o
123 end-$(pcore) := pcore
124 cacheflag-$(pcore) := -include $(clear_L2_L3)
125
126# Really only valid if CONFIG_6xx=y 125# Really only valid if CONFIG_6xx=y
127 zimage-$(CONFIG_PPC_PREP) := zImage-PPLUS 126 zimage-$(CONFIG_PPC_PREP) := zImage-PPLUS
128zimageinitrd-$(CONFIG_PPC_PREP) := zImage.initrd-PPLUS 127zimageinitrd-$(CONFIG_PPC_PREP) := zImage.initrd-PPLUS
@@ -152,8 +151,6 @@ zimageinitrd-$(CONFIG_LITE5200) := zImage.initrd-STRIPELF
152 151
153# This is a treeboot that needs init functions until the 152# This is a treeboot that needs init functions until the
154# boot rom is sorted out (i.e. this is short lived) 153# boot rom is sorted out (i.e. this is short lived)
155extra-aflags-$(CONFIG_REDWOOD_4) := -Wa,-m405
156extra.o-$(CONFIG_REDWOOD_4) := rw4/rw4_init.o rw4/rw4_init_brd.o
157EXTRA_AFLAGS := $(extra-aflags-y) 154EXTRA_AFLAGS := $(extra-aflags-y)
158# head.o needs to get the cacheflags defined. 155# head.o needs to get the cacheflags defined.
159AFLAGS_head.o += $(cacheflag-y) 156AFLAGS_head.o += $(cacheflag-y)
diff --git a/arch/ppc/boot/simple/embed_config.c b/arch/ppc/boot/simple/embed_config.c
index c342b47e763e..491a691d10cc 100644
--- a/arch/ppc/boot/simple/embed_config.c
+++ b/arch/ppc/boot/simple/embed_config.c
@@ -784,28 +784,12 @@ embed_config(bd_t ** bdp)
784#ifdef CONFIG_IBM_OPENBIOS 784#ifdef CONFIG_IBM_OPENBIOS
785/* This could possibly work for all treeboot roms. 785/* This could possibly work for all treeboot roms.
786*/ 786*/
787#if defined(CONFIG_ASH) || defined(CONFIG_BEECH) || defined(CONFIG_BUBINGA) 787#if defined(CONFIG_BUBINGA)
788#define BOARD_INFO_VECTOR 0xFFF80B50 /* openbios 1.19 moved this vector down - armin */ 788#define BOARD_INFO_VECTOR 0xFFF80B50 /* openbios 1.19 moved this vector down - armin */
789#else 789#else
790#define BOARD_INFO_VECTOR 0xFFFE0B50 790#define BOARD_INFO_VECTOR 0xFFFE0B50
791#endif 791#endif
792 792
793#ifdef CONFIG_BEECH
794static void
795get_board_info(bd_t **bdp)
796{
797 typedef void (*PFV)(bd_t *bd);
798 ((PFV)(*(unsigned long *)BOARD_INFO_VECTOR))(*bdp);
799 return;
800}
801
802void
803embed_config(bd_t **bdp)
804{
805 *bdp = &bdinfo;
806 get_board_info(bdp);
807}
808#else /* !CONFIG_BEECH */
809void 793void
810embed_config(bd_t **bdp) 794embed_config(bd_t **bdp)
811{ 795{
@@ -860,7 +844,6 @@ embed_config(bd_t **bdp)
860#endif 844#endif
861 timebase_period_ns = 1000000000 / bd->bi_tbfreq; 845 timebase_period_ns = 1000000000 / bd->bi_tbfreq;
862} 846}
863#endif /* CONFIG_BEECH */
864#endif /* CONFIG_IBM_OPENBIOS */ 847#endif /* CONFIG_IBM_OPENBIOS */
865 848
866#ifdef CONFIG_EP405 849#ifdef CONFIG_EP405
@@ -943,39 +926,3 @@ embed_config(bd_t **bdp)
943#endif 926#endif
944} 927}
945#endif 928#endif
946
947#ifdef CONFIG_RAINIER
948/* Rainier uses vxworks bootrom */
949void
950embed_config(bd_t **bdp)
951{
952 u_char *cp;
953 int i;
954 bd_t *bd;
955
956 bd = &bdinfo;
957 *bdp = bd;
958
959 for(i=0;i<8192;i+=32) {
960 __asm__("dccci 0,%0" :: "r" (i));
961 }
962 __asm__("iccci 0,0");
963 __asm__("sync;isync");
964
965 /* init ram for parity */
966 memset(0, 0,0x400000); /* Lo memory */
967
968
969 bd->bi_memsize = (32 * 1024 * 1024) ;
970 bd->bi_intfreq = 133000000; //the internal clock is 133 MHz
971 bd->bi_busfreq = 100000000;
972 bd->bi_pci_busfreq= 33000000;
973
974 cp = (u_char *)def_enet_addr;
975 for (i=0; i<6; i++) {
976 bd->bi_enetaddr[i] = *cp++;
977 }
978
979}
980#endif
981
diff --git a/arch/ppc/boot/simple/head.S b/arch/ppc/boot/simple/head.S
index 524053202bb4..5e4adc298bf9 100644
--- a/arch/ppc/boot/simple/head.S
+++ b/arch/ppc/boot/simple/head.S
@@ -120,15 +120,6 @@ haveOF:
120 mtspr SPRN_DER,r4 120 mtspr SPRN_DER,r4
121#endif 121#endif
122 122
123#ifdef CONFIG_REDWOOD_4
124 /* All of this Redwood 4 stuff will soon disappear when the
125 * boot rom is straightened out.
126 */
127 mr r29, r3 /* Easier than changing the other code */
128 bl HdwInit
129 mr r3, r29
130#endif
131
132#if defined(CONFIG_MBX) || defined(CONFIG_RPX8260) || defined(CONFIG_PPC_PREP) 123#if defined(CONFIG_MBX) || defined(CONFIG_RPX8260) || defined(CONFIG_PPC_PREP)
133 mr r4,r29 /* put the board info pointer where the relocate 124 mr r4,r29 /* put the board info pointer where the relocate
134 * routine will find it 125 * routine will find it
diff --git a/arch/ppc/boot/simple/misc-cpci690.c b/arch/ppc/boot/simple/misc-cpci690.c
index ef08e86c9b25..26860300fa09 100644
--- a/arch/ppc/boot/simple/misc-cpci690.c
+++ b/arch/ppc/boot/simple/misc-cpci690.c
@@ -12,16 +12,56 @@
12 */ 12 */
13 13
14#include <linux/types.h> 14#include <linux/types.h>
15#include <asm/io.h>
15#include <platforms/cpci690.h> 16#include <platforms/cpci690.h>
16 17
18#define KB (1024UL)
19#define MB (1024UL*KB)
20#define GB (1024UL*MB)
21
17extern u32 mv64x60_console_baud; 22extern u32 mv64x60_console_baud;
18extern u32 mv64x60_mpsc_clk_src; 23extern u32 mv64x60_mpsc_clk_src;
19extern u32 mv64x60_mpsc_clk_freq; 24extern u32 mv64x60_mpsc_clk_freq;
20 25
26u32 mag = 0xffff;
27
28unsigned long
29get_mem_size(void)
30{
31 u32 size;
32
33 switch (in_8(((void __iomem *)CPCI690_BR_BASE + CPCI690_BR_MEM_CTLR))
34 & 0x07) {
35 case 0x01:
36 size = 256*MB;
37 break;
38 case 0x02:
39 size = 512*MB;
40 break;
41 case 0x03:
42 size = 768*MB;
43 break;
44 case 0x04:
45 size = 1*GB;
46 break;
47 case 0x05:
48 size = 1*GB + 512*MB;
49 break;
50 case 0x06:
51 size = 2*GB;
52 break;
53 default:
54 size = 0;
55 }
56
57 return size;
58}
59
21void 60void
22mv64x60_board_init(void __iomem *old_base, void __iomem *new_base) 61mv64x60_board_init(void __iomem *old_base, void __iomem *new_base)
23{ 62{
24 mv64x60_console_baud = CPCI690_MPSC_BAUD; 63 mv64x60_console_baud = CPCI690_MPSC_BAUD;
25 mv64x60_mpsc_clk_src = CPCI690_MPSC_CLK_SRC; 64 mv64x60_mpsc_clk_src = CPCI690_MPSC_CLK_SRC;
26 mv64x60_mpsc_clk_freq = CPCI690_BUS_FREQ; 65 mv64x60_mpsc_clk_freq =
66 (get_mem_size() >= (1*GB)) ? 100000000 : 133333333;
27} 67}
diff --git a/arch/ppc/boot/simple/misc-ev64360.c b/arch/ppc/boot/simple/misc-ev64360.c
new file mode 100644
index 000000000000..cd1ccf2a1582
--- /dev/null
+++ b/arch/ppc/boot/simple/misc-ev64360.c
@@ -0,0 +1,44 @@
1/*
2 * arch/ppc/boot/simple/misc-ev64360.c
3 * Copyright (C) 2005 Lee Nicks <allinux@gmail.com>
4 *
5 * Based on arch/ppc/boot/simple/misc-katana.c from:
6 * Mark A. Greer <source@mvista.com>
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 2
11 * of the License, or (at your option) any later version.
12 *
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
17 *
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, write to the Free Software
20 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
21 */
22
23#include <linux/config.h>
24#include <linux/types.h>
25#include <asm/io.h>
26#include <asm/mv64x60_defs.h>
27#include <platforms/ev64360.h>
28
29extern u32 mv64x60_console_baud;
30extern u32 mv64x60_mpsc_clk_src;
31extern u32 mv64x60_mpsc_clk_freq;
32
33/* Not in the kernel so won't include kernel.h to get its 'min' definition */
34#ifndef min
35#define min(a,b) (((a) < (b)) ? (a) : (b))
36#endif
37
38void
39mv64x60_board_init(void __iomem *old_base, void __iomem *new_base)
40{
41 mv64x60_console_baud = EV64360_DEFAULT_BAUD;
42 mv64x60_mpsc_clk_src = EV64360_MPSC_CLK_SRC;
43 mv64x60_mpsc_clk_freq = EV64360_MPSC_CLK_FREQ;
44}
diff --git a/arch/ppc/boot/simple/misc-katana.c b/arch/ppc/boot/simple/misc-katana.c
index b6e1bb833157..ec94a11bacac 100644
--- a/arch/ppc/boot/simple/misc-katana.c
+++ b/arch/ppc/boot/simple/misc-katana.c
@@ -26,6 +26,8 @@ extern u32 mv64x60_mpsc_clk_freq;
26#define min(a,b) (((a) < (b)) ? (a) : (b)) 26#define min(a,b) (((a) < (b)) ? (a) : (b))
27#endif 27#endif
28 28
29unsigned long mv64360_get_mem_size(void);
30
29void 31void
30mv64x60_board_init(void __iomem *old_base, void __iomem *new_base) 32mv64x60_board_init(void __iomem *old_base, void __iomem *new_base)
31{ 33{
@@ -35,3 +37,9 @@ mv64x60_board_init(void __iomem *old_base, void __iomem *new_base)
35 min(katana_bus_freq((void __iomem *)KATANA_CPLD_BASE), 37 min(katana_bus_freq((void __iomem *)KATANA_CPLD_BASE),
36 MV64x60_TCLK_FREQ_MAX); 38 MV64x60_TCLK_FREQ_MAX);
37} 39}
40
41unsigned long
42get_mem_size(void)
43{
44 return mv64360_get_mem_size();
45}
diff --git a/arch/ppc/boot/simple/misc-mv64x60.c b/arch/ppc/boot/simple/misc-mv64x60.c
index 7e88fc6d207d..258d4599fadc 100644
--- a/arch/ppc/boot/simple/misc-mv64x60.c
+++ b/arch/ppc/boot/simple/misc-mv64x60.c
@@ -19,6 +19,33 @@
19extern struct bi_record *decompress_kernel(unsigned long load_addr, 19extern struct bi_record *decompress_kernel(unsigned long load_addr,
20 int num_words, unsigned long cksum); 20 int num_words, unsigned long cksum);
21 21
22
23u32 size_reg[MV64x60_CPU2MEM_WINDOWS] = {
24 MV64x60_CPU2MEM_0_SIZE, MV64x60_CPU2MEM_1_SIZE,
25 MV64x60_CPU2MEM_2_SIZE, MV64x60_CPU2MEM_3_SIZE
26};
27
28/* Read mem ctlr to get the amount of mem in system */
29unsigned long
30mv64360_get_mem_size(void)
31{
32 u32 enables, i, v;
33 u32 mem = 0;
34
35 enables = in_le32((void __iomem *)CONFIG_MV64X60_NEW_BASE +
36 MV64360_CPU_BAR_ENABLE) & 0xf;
37
38 for (i=0; i<MV64x60_CPU2MEM_WINDOWS; i++)
39 if (!(enables & (1<<i))) {
40 v = in_le32((void __iomem *)CONFIG_MV64X60_NEW_BASE
41 + size_reg[i]) & 0xffff;
42 v = (v + 1) << 16;
43 mem += v;
44 }
45
46 return mem;
47}
48
22void 49void
23mv64x60_move_base(void __iomem *old_base, void __iomem *new_base) 50mv64x60_move_base(void __iomem *old_base, void __iomem *new_base)
24{ 51{
diff --git a/arch/ppc/boot/simple/mv64x60_tty.c b/arch/ppc/boot/simple/mv64x60_tty.c
index 5b45eb46b669..b9c24d4c738b 100644
--- a/arch/ppc/boot/simple/mv64x60_tty.c
+++ b/arch/ppc/boot/simple/mv64x60_tty.c
@@ -22,9 +22,16 @@
22#include <asm/mv64x60_defs.h> 22#include <asm/mv64x60_defs.h>
23#include <mpsc_defs.h> 23#include <mpsc_defs.h>
24 24
25#ifdef CONFIG_EV64360
26#include <platforms/ev64360.h>
27u32 mv64x60_console_baud = EV64360_DEFAULT_BAUD;
28u32 mv64x60_mpsc_clk_src = EV64360_MPSC_CLK_SRC; /* TCLK */
29u32 mv64x60_mpsc_clk_freq = EV64360_MPSC_CLK_FREQ;
30#else
25u32 mv64x60_console_baud = 9600; 31u32 mv64x60_console_baud = 9600;
26u32 mv64x60_mpsc_clk_src = 8; /* TCLK */ 32u32 mv64x60_mpsc_clk_src = 8; /* TCLK */
27u32 mv64x60_mpsc_clk_freq = 100000000; 33u32 mv64x60_mpsc_clk_freq = 100000000;
34#endif
28 35
29extern void udelay(long); 36extern void udelay(long);
30static void stop_dma(int chan); 37static void stop_dma(int chan);
diff --git a/arch/ppc/boot/simple/pibs.c b/arch/ppc/boot/simple/pibs.c
index 1348740e503f..67222d57c345 100644
--- a/arch/ppc/boot/simple/pibs.c
+++ b/arch/ppc/boot/simple/pibs.c
@@ -91,9 +91,11 @@ load_kernel(unsigned long load_addr, int num_words, unsigned long cksum,
91 91
92 mac64 = simple_strtoull((char *)PIBS_MAC_BASE, 0, 16); 92 mac64 = simple_strtoull((char *)PIBS_MAC_BASE, 0, 16);
93 memcpy(hold_residual->bi_enetaddr, (char *)&mac64+2, 6); 93 memcpy(hold_residual->bi_enetaddr, (char *)&mac64+2, 6);
94#ifdef CONFIG_440GX 94#if defined(CONFIG_440GX) || defined(CONFIG_440EP)
95 mac64 = simple_strtoull((char *)(PIBS_MAC_BASE+PIBS_MAC_OFFSET), 0, 16); 95 mac64 = simple_strtoull((char *)(PIBS_MAC_BASE+PIBS_MAC_OFFSET), 0, 16);
96 memcpy(hold_residual->bi_enet1addr, (char *)&mac64+2, 6); 96 memcpy(hold_residual->bi_enet1addr, (char *)&mac64+2, 6);
97#endif
98#ifdef CONFIG_440GX
97 mac64 = simple_strtoull((char *)(PIBS_MAC_BASE+PIBS_MAC_OFFSET*2), 0, 16); 99 mac64 = simple_strtoull((char *)(PIBS_MAC_BASE+PIBS_MAC_OFFSET*2), 0, 16);
98 memcpy(hold_residual->bi_enet2addr, (char *)&mac64+2, 6); 100 memcpy(hold_residual->bi_enet2addr, (char *)&mac64+2, 6);
99 mac64 = simple_strtoull((char *)(PIBS_MAC_BASE+PIBS_MAC_OFFSET*3), 0, 16); 101 mac64 = simple_strtoull((char *)(PIBS_MAC_BASE+PIBS_MAC_OFFSET*3), 0, 16);
diff --git a/arch/ppc/boot/utils/addRamDisk.c b/arch/ppc/boot/utils/addRamDisk.c
deleted file mode 100644
index 93400dfcce7f..000000000000
--- a/arch/ppc/boot/utils/addRamDisk.c
+++ /dev/null
@@ -1,203 +0,0 @@
1#include <stdio.h>
2#include <stdlib.h>
3#include <netinet/in.h>
4#include <unistd.h>
5#include <sys/types.h>
6#include <sys/stat.h>
7#include <string.h>
8
9#define ElfHeaderSize (64 * 1024)
10#define ElfPages (ElfHeaderSize / 4096)
11#define KERNELBASE (0xc0000000)
12
13void get4k(FILE *file, char *buf )
14{
15 unsigned j;
16 unsigned num = fread(buf, 1, 4096, file);
17 for ( j=num; j<4096; ++j )
18 buf[j] = 0;
19}
20
21void put4k(FILE *file, char *buf )
22{
23 fwrite(buf, 1, 4096, file);
24}
25
26void death(const char *msg, FILE *fdesc, const char *fname)
27{
28 printf(msg);
29 fclose(fdesc);
30 unlink(fname);
31 exit(1);
32}
33
34int main(int argc, char **argv)
35{
36 char inbuf[4096];
37 FILE *ramDisk = NULL;
38 FILE *inputVmlinux = NULL;
39 FILE *outputVmlinux = NULL;
40 unsigned i = 0;
41 u_int32_t ramFileLen = 0;
42 u_int32_t ramLen = 0;
43 u_int32_t roundR = 0;
44 u_int32_t kernelLen = 0;
45 u_int32_t actualKernelLen = 0;
46 u_int32_t round = 0;
47 u_int32_t roundedKernelLen = 0;
48 u_int32_t ramStartOffs = 0;
49 u_int32_t ramPages = 0;
50 u_int32_t roundedKernelPages = 0;
51 u_int32_t hvReleaseData = 0;
52 u_int32_t eyeCatcher = 0xc8a5d9c4;
53 u_int32_t naca = 0;
54 u_int32_t xRamDisk = 0;
55 u_int32_t xRamDiskSize = 0;
56 if ( argc < 2 ) {
57 printf("Name of RAM disk file missing.\n");
58 exit(1);
59 }
60
61 if ( argc < 3 ) {
62 printf("Name of vmlinux file missing.\n");
63 exit(1);
64 }
65
66 if ( argc < 4 ) {
67 printf("Name of vmlinux output file missing.\n");
68 exit(1);
69 }
70
71 ramDisk = fopen(argv[1], "r");
72 if ( ! ramDisk ) {
73 printf("RAM disk file \"%s\" failed to open.\n", argv[1]);
74 exit(1);
75 }
76 inputVmlinux = fopen(argv[2], "r");
77 if ( ! inputVmlinux ) {
78 printf("vmlinux file \"%s\" failed to open.\n", argv[2]);
79 exit(1);
80 }
81 outputVmlinux = fopen(argv[3], "w+");
82 if ( ! outputVmlinux ) {
83 printf("output vmlinux file \"%s\" failed to open.\n", argv[3]);
84 exit(1);
85 }
86 fseek(ramDisk, 0, SEEK_END);
87 ramFileLen = ftell(ramDisk);
88 fseek(ramDisk, 0, SEEK_SET);
89 printf("%s file size = %d\n", argv[1], ramFileLen);
90
91 ramLen = ramFileLen;
92
93 roundR = 4096 - (ramLen % 4096);
94 if ( roundR ) {
95 printf("Rounding RAM disk file up to a multiple of 4096, adding %d\n", roundR);
96 ramLen += roundR;
97 }
98
99 printf("Rounded RAM disk size is %d\n", ramLen);
100 fseek(inputVmlinux, 0, SEEK_END);
101 kernelLen = ftell(inputVmlinux);
102 fseek(inputVmlinux, 0, SEEK_SET);
103 printf("kernel file size = %d\n", kernelLen);
104 if ( kernelLen == 0 ) {
105 printf("You must have a linux kernel specified as argv[2]\n");
106 exit(1);
107 }
108
109 actualKernelLen = kernelLen - ElfHeaderSize;
110
111 printf("actual kernel length (minus ELF header) = %d\n", actualKernelLen);
112
113 round = actualKernelLen % 4096;
114 roundedKernelLen = actualKernelLen;
115 if ( round )
116 roundedKernelLen += (4096 - round);
117
118 printf("actual kernel length rounded up to a 4k multiple = %d\n", roundedKernelLen);
119
120 ramStartOffs = roundedKernelLen;
121 ramPages = ramLen / 4096;
122
123 printf("RAM disk pages to copy = %d\n", ramPages);
124
125 // Copy 64K ELF header
126 for (i=0; i<(ElfPages); ++i) {
127 get4k( inputVmlinux, inbuf );
128 put4k( outputVmlinux, inbuf );
129 }
130
131 roundedKernelPages = roundedKernelLen / 4096;
132
133 fseek(inputVmlinux, ElfHeaderSize, SEEK_SET);
134
135 for ( i=0; i<roundedKernelPages; ++i ) {
136 get4k( inputVmlinux, inbuf );
137 put4k( outputVmlinux, inbuf );
138 }
139
140 for ( i=0; i<ramPages; ++i ) {
141 get4k( ramDisk, inbuf );
142 put4k( outputVmlinux, inbuf );
143 }
144
145 /* Close the input files */
146 fclose(ramDisk);
147 fclose(inputVmlinux);
148 /* And flush the written output file */
149 fflush(outputVmlinux);
150
151 /* fseek to the hvReleaseData pointer */
152 fseek(outputVmlinux, ElfHeaderSize + 0x24, SEEK_SET);
153 if (fread(&hvReleaseData, 4, 1, outputVmlinux) != 1) {
154 death("Could not read hvReleaseData pointer\n", outputVmlinux, argv[3]);
155 }
156 hvReleaseData = ntohl(hvReleaseData); /* Convert to native int */
157 printf("hvReleaseData is at %08x\n", hvReleaseData);
158
159 /* fseek to the hvReleaseData */
160 fseek(outputVmlinux, ElfHeaderSize + hvReleaseData, SEEK_SET);
161 if (fread(inbuf, 0x40, 1, outputVmlinux) != 1) {
162 death("Could not read hvReleaseData\n", outputVmlinux, argv[3]);
163 }
164 /* Check hvReleaseData sanity */
165 if (memcmp(inbuf, &eyeCatcher, 4) != 0) {
166 death("hvReleaseData is invalid\n", outputVmlinux, argv[3]);
167 }
168 /* Get the naca pointer */
169 naca = ntohl(*((u_int32_t *) &inbuf[0x0c])) - KERNELBASE;
170 printf("naca is at %08x\n", naca);
171
172 /* fseek to the naca */
173 fseek(outputVmlinux, ElfHeaderSize + naca, SEEK_SET);
174 if (fread(inbuf, 0x18, 1, outputVmlinux) != 1) {
175 death("Could not read naca\n", outputVmlinux, argv[3]);
176 }
177 xRamDisk = ntohl(*((u_int32_t *) &inbuf[0x0c]));
178 xRamDiskSize = ntohl(*((u_int32_t *) &inbuf[0x14]));
179 /* Make sure a RAM disk isn't already present */
180 if ((xRamDisk != 0) || (xRamDiskSize != 0)) {
181 death("RAM disk is already attached to this kernel\n", outputVmlinux, argv[3]);
182 }
183 /* Fill in the values */
184 *((u_int32_t *) &inbuf[0x0c]) = htonl(ramStartOffs);
185 *((u_int32_t *) &inbuf[0x14]) = htonl(ramPages);
186
187 /* Write out the new naca */
188 fflush(outputVmlinux);
189 fseek(outputVmlinux, ElfHeaderSize + naca, SEEK_SET);
190 if (fwrite(inbuf, 0x18, 1, outputVmlinux) != 1) {
191 death("Could not write naca\n", outputVmlinux, argv[3]);
192 }
193 printf("RAM Disk of 0x%x pages size is attached to the kernel at offset 0x%08x\n",
194 ramPages, ramStartOffs);
195
196 /* Done */
197 fclose(outputVmlinux);
198 /* Set permission to executable */
199 chmod(argv[3], S_IRUSR|S_IWUSR|S_IXUSR|S_IRGRP|S_IXGRP|S_IROTH|S_IXOTH);
200
201 return 0;
202}
203
diff --git a/arch/ppc/configs/SM850_defconfig b/arch/ppc/configs/SM850_defconfig
deleted file mode 100644
index 021884b43029..000000000000
--- a/arch/ppc/configs/SM850_defconfig
+++ /dev/null
@@ -1,522 +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
7
8#
9# Code maturity level options
10#
11CONFIG_EXPERIMENTAL=y
12
13#
14# General setup
15#
16CONFIG_SWAP=y
17CONFIG_SYSVIPC=y
18# CONFIG_BSD_PROCESS_ACCT is not set
19CONFIG_SYSCTL=y
20CONFIG_LOG_BUF_SHIFT=14
21CONFIG_EMBEDDED=y
22CONFIG_FUTEX=y
23# CONFIG_EPOLL is not set
24
25#
26# Loadable module support
27#
28CONFIG_MODULES=y
29CONFIG_MODULE_UNLOAD=y
30# CONFIG_MODULE_FORCE_UNLOAD is not set
31CONFIG_OBSOLETE_MODPARM=y
32# CONFIG_MODVERSIONS is not set
33CONFIG_KMOD=y
34
35#
36# Platform support
37#
38CONFIG_PPC=y
39CONFIG_PPC32=y
40# CONFIG_6xx is not set
41# CONFIG_40x is not set
42# CONFIG_POWER3 is not set
43CONFIG_8xx=y
44
45#
46# IBM 4xx options
47#
48CONFIG_EMBEDDEDBOOT=y
49CONFIG_SERIAL_CONSOLE=y
50CONFIG_NOT_COHERENT_CACHE=y
51# CONFIG_RPXLITE is not set
52# CONFIG_RPXCLASSIC is not set
53# CONFIG_BSEIP is not set
54# CONFIG_FADS is not set
55# CONFIG_TQM823L is not set
56# CONFIG_TQM850L is not set
57# CONFIG_TQM855L is not set
58# CONFIG_TQM860L is not set
59# CONFIG_FPS850L is not set
60# CONFIG_SPD823TS is not set
61# CONFIG_IVMS8 is not set
62# CONFIG_IVML24 is not set
63CONFIG_SM850=y
64# CONFIG_HERMES_PRO is not set
65# CONFIG_IP860 is not set
66# CONFIG_LWMON is not set
67# CONFIG_PCU_E is not set
68# CONFIG_CCM is not set
69# CONFIG_LANTEC is not set
70# CONFIG_MBX is not set
71# CONFIG_WINCEPT is not set
72CONFIG_TQM8xxL=y
73# CONFIG_SMP is not set
74# CONFIG_PREEMPT is not set
75CONFIG_MATH_EMULATION=y
76# CONFIG_CPU_FREQ is not set
77
78#
79# General setup
80#
81# CONFIG_HIGHMEM is not set
82# CONFIG_PCI is not set
83# CONFIG_PCI_DOMAINS is not set
84# CONFIG_PCI_QSPAN is not set
85CONFIG_KCORE_ELF=y
86CONFIG_BINFMT_ELF=y
87CONFIG_KERNEL_ELF=y
88# CONFIG_BINFMT_MISC is not set
89# CONFIG_HOTPLUG is not set
90
91#
92# Parallel port support
93#
94# CONFIG_PARPORT is not set
95CONFIG_CMDLINE_BOOL=y
96CONFIG_CMDLINE="console=ttyCPM1"
97
98#
99# Advanced setup
100#
101# CONFIG_ADVANCED_OPTIONS is not set
102
103#
104# Default settings for advanced configuration options are used
105#
106CONFIG_HIGHMEM_START=0xfe000000
107CONFIG_LOWMEM_SIZE=0x30000000
108CONFIG_KERNEL_START=0xc0000000
109CONFIG_TASK_SIZE=0x80000000
110CONFIG_BOOT_LOAD=0x00400000
111
112#
113# Memory Technology Devices (MTD)
114#
115# CONFIG_MTD is not set
116
117#
118# Plug and Play support
119#
120# CONFIG_PNP is not set
121
122#
123# Block devices
124#
125# CONFIG_BLK_DEV_FD is not set
126# CONFIG_BLK_DEV_LOOP is not set
127# CONFIG_BLK_DEV_NBD is not set
128# CONFIG_BLK_DEV_RAM is not set
129# CONFIG_BLK_DEV_INITRD is not set
130
131#
132# Multi-device support (RAID and LVM)
133#
134# CONFIG_MD is not set
135
136#
137# ATA/IDE/MFM/RLL support
138#
139# CONFIG_IDE is not set
140
141#
142# SCSI support
143#
144# CONFIG_SCSI is not set
145
146#
147# Fusion MPT device support
148#
149
150#
151# I2O device support
152#
153
154#
155# Networking support
156#
157CONFIG_NET=y
158
159#
160# Networking options
161#
162CONFIG_PACKET=y
163# CONFIG_PACKET_MMAP is not set
164# CONFIG_NETLINK_DEV is not set
165# CONFIG_NETFILTER is not set
166CONFIG_UNIX=y
167# CONFIG_NET_KEY is not set
168CONFIG_INET=y
169# CONFIG_IP_MULTICAST is not set
170# CONFIG_IP_ADVANCED_ROUTER is not set
171CONFIG_IP_PNP=y
172CONFIG_IP_PNP_DHCP=y
173# CONFIG_IP_PNP_BOOTP is not set
174# CONFIG_IP_PNP_RARP is not set
175# CONFIG_NET_IPIP is not set
176# CONFIG_NET_IPGRE is not set
177# CONFIG_ARPD is not set
178# CONFIG_INET_ECN is not set
179# CONFIG_SYN_COOKIES is not set
180# CONFIG_INET_AH is not set
181# CONFIG_INET_ESP is not set
182# CONFIG_INET_IPCOMP is not set
183# CONFIG_IPV6 is not set
184# CONFIG_XFRM_USER is not set
185
186#
187# SCTP Configuration (EXPERIMENTAL)
188#
189CONFIG_IPV6_SCTP__=y
190# CONFIG_IP_SCTP is not set
191# CONFIG_ATM is not set
192# CONFIG_VLAN_8021Q is not set
193# CONFIG_LLC is not set
194# CONFIG_DECNET is not set
195# CONFIG_BRIDGE is not set
196# CONFIG_X25 is not set
197# CONFIG_LAPB is not set
198# CONFIG_NET_DIVERT is not set
199# CONFIG_ECONET is not set
200# CONFIG_WAN_ROUTER is not set
201# CONFIG_NET_HW_FLOWCONTROL is not set
202
203#
204# QoS and/or fair queueing
205#
206# CONFIG_NET_SCHED is not set
207
208#
209# Network testing
210#
211# CONFIG_NET_PKTGEN is not set
212CONFIG_NETDEVICES=y
213# CONFIG_DUMMY is not set
214# CONFIG_BONDING is not set
215# CONFIG_EQUALIZER is not set
216# CONFIG_TUN is not set
217# CONFIG_ETHERTAP is not set
218
219#
220# Ethernet (10 or 100Mbit)
221#
222CONFIG_NET_ETHERNET=y
223# CONFIG_MII is not set
224# CONFIG_OAKNET is not set
225
226#
227# Ethernet (1000 Mbit)
228#
229
230#
231# Ethernet (10000 Mbit)
232#
233# CONFIG_PPP is not set
234# CONFIG_SLIP is not set
235
236#
237# Wireless LAN (non-hamradio)
238#
239# CONFIG_NET_RADIO is not set
240
241#
242# Token Ring devices (depends on LLC=y)
243#
244# CONFIG_SHAPER is not set
245
246#
247# Wan interfaces
248#
249# CONFIG_WAN is not set
250
251#
252# Amateur Radio support
253#
254# CONFIG_HAMRADIO is not set
255
256#
257# IrDA (infrared) support
258#
259# CONFIG_IRDA is not set
260
261#
262# ISDN subsystem
263#
264# CONFIG_ISDN_BOOL is not set
265
266#
267# Graphics support
268#
269# CONFIG_FB is not set
270
271#
272# Old CD-ROM drivers (not SCSI, not IDE)
273#
274# CONFIG_CD_NO_IDESCSI is not set
275
276#
277# Input device support
278#
279# CONFIG_INPUT is not set
280
281#
282# Userland interfaces
283#
284
285#
286# Input I/O drivers
287#
288# CONFIG_GAMEPORT is not set
289CONFIG_SOUND_GAMEPORT=y
290# CONFIG_SERIO is not set
291
292#
293# Input Device Drivers
294#
295
296#
297# Macintosh device drivers
298#
299
300#
301# Serial drivers
302#
303# CONFIG_SERIAL_8250 is not set
304
305#
306# Non-8250 serial port support
307#
308CONFIG_SERIAL_CORE=y
309CONFIG_SERIAL_CORE_CONSOLE=y
310CONFIG_SERIAL_CPM=y
311CONFIG_SERIAL_CPM_CONSOLE=y
312# CONFIG_SERIAL_CPM_SCC1 is not set
313# CONFIG_SERIAL_CPM_SCC2 is not set
314# CONFIG_SERIAL_CPM_SCC3 is not set
315# CONFIG_SERIAL_CPM_SCC4 is not set
316CONFIG_SERIAL_CPM_SMC1=y
317CONFIG_SERIAL_CPM_SMC2=y
318CONFIG_SERIAL_CPM_ALT_SMC2=y
319CONFIG_UNIX98_PTYS=y
320# CONFIG_LEGACY_PTYS is not set
321
322#
323# I2C support
324#
325# CONFIG_I2C is not set
326
327#
328# I2C Hardware Sensors Mainboard support
329#
330
331#
332# I2C Hardware Sensors Chip support
333#
334# CONFIG_I2C_SENSOR is not set
335
336#
337# Mice
338#
339# CONFIG_BUSMOUSE is not set
340# CONFIG_QIC02_TAPE is not set
341
342#
343# IPMI
344#
345# CONFIG_IPMI_HANDLER is not set
346
347#
348# Watchdog Cards
349#
350# CONFIG_WATCHDOG is not set
351# CONFIG_NVRAM is not set
352CONFIG_GEN_RTC=y
353# CONFIG_GEN_RTC_X is not set
354# CONFIG_DTLK is not set
355# CONFIG_R3964 is not set
356# CONFIG_APPLICOM is not set
357
358#
359# Ftape, the floppy tape device driver
360#
361# CONFIG_FTAPE is not set
362# CONFIG_AGP is not set
363# CONFIG_DRM is not set
364# CONFIG_RAW_DRIVER is not set
365# CONFIG_HANGCHECK_TIMER is not set
366
367#
368# Multimedia devices
369#
370# CONFIG_VIDEO_DEV is not set
371
372#
373# Digital Video Broadcasting Devices
374#
375# CONFIG_DVB is not set
376
377#
378# File systems
379#
380# CONFIG_EXT2_FS is not set
381CONFIG_EXT3_FS=y
382CONFIG_EXT3_FS_XATTR=y
383# CONFIG_EXT3_FS_POSIX_ACL is not set
384# CONFIG_EXT3_FS_SECURITY is not set
385CONFIG_JBD=y
386# CONFIG_JBD_DEBUG is not set
387CONFIG_FS_MBCACHE=y
388# CONFIG_REISERFS_FS is not set
389# CONFIG_JFS_FS is not set
390# CONFIG_XFS_FS is not set
391# CONFIG_MINIX_FS is not set
392# CONFIG_ROMFS_FS is not set
393# CONFIG_QUOTA is not set
394# CONFIG_AUTOFS_FS is not set
395# CONFIG_AUTOFS4_FS is not set
396
397#
398# CD-ROM/DVD Filesystems
399#
400# CONFIG_ISO9660_FS is not set
401# CONFIG_UDF_FS is not set
402
403#
404# DOS/FAT/NT Filesystems
405#
406# CONFIG_FAT_FS is not set
407# CONFIG_NTFS_FS is not set
408
409#
410# Pseudo filesystems
411#
412CONFIG_PROC_FS=y
413# CONFIG_DEVFS_FS is not set
414CONFIG_DEVPTS_FS=y
415# CONFIG_DEVPTS_FS_XATTR is not set
416CONFIG_TMPFS=y
417CONFIG_RAMFS=y
418
419#
420# Miscellaneous filesystems
421#
422# CONFIG_ADFS_FS is not set
423# CONFIG_AFFS_FS is not set
424# CONFIG_HFS_FS is not set
425# CONFIG_BEFS_FS is not set
426# CONFIG_BFS_FS is not set
427# CONFIG_EFS_FS is not set
428# CONFIG_CRAMFS is not set
429# CONFIG_VXFS_FS is not set
430# CONFIG_HPFS_FS is not set
431# CONFIG_QNX4FS_FS is not set
432# CONFIG_SYSV_FS is not set
433# CONFIG_UFS_FS is not set
434
435#
436# Network File Systems
437#
438CONFIG_NFS_FS=y
439# CONFIG_NFS_V3 is not set
440# CONFIG_NFS_V4 is not set
441# CONFIG_NFSD is not set
442CONFIG_ROOT_NFS=y
443CONFIG_LOCKD=y
444# CONFIG_EXPORTFS is not set
445CONFIG_SUNRPC=y
446# CONFIG_SUNRPC_GSS is not set
447# CONFIG_SMB_FS is not set
448# CONFIG_CIFS is not set
449# CONFIG_NCP_FS is not set
450# CONFIG_CODA_FS is not set
451# CONFIG_INTERMEZZO_FS is not set
452# CONFIG_AFS_FS is not set
453
454#
455# Partition Types
456#
457CONFIG_PARTITION_ADVANCED=y
458# CONFIG_ACORN_PARTITION is not set
459# CONFIG_OSF_PARTITION is not set
460# CONFIG_AMIGA_PARTITION is not set
461# CONFIG_ATARI_PARTITION is not set
462# CONFIG_MAC_PARTITION is not set
463# CONFIG_MSDOS_PARTITION is not set
464# CONFIG_LDM_PARTITION is not set
465# CONFIG_NEC98_PARTITION is not set
466# CONFIG_SGI_PARTITION is not set
467# CONFIG_ULTRIX_PARTITION is not set
468# CONFIG_SUN_PARTITION is not set
469# CONFIG_EFI_PARTITION is not set
470
471#
472# Sound
473#
474# CONFIG_SOUND is not set
475
476#
477# MPC8xx CPM Options
478#
479CONFIG_SCC_ENET=y
480# CONFIG_SCC1_ENET is not set
481# CONFIG_SCC2_ENET is not set
482CONFIG_SCC3_ENET=y
483# CONFIG_FEC_ENET is not set
484CONFIG_ENET_BIG_BUFFERS=y
485
486#
487# Generic MPC8xx Options
488#
489CONFIG_8xx_COPYBACK=y
490CONFIG_8xx_CPU6=y
491# CONFIG_UCODE_PATCH is not set
492
493#
494# USB support
495#
496# CONFIG_USB_GADGET is not set
497
498#
499# Bluetooth support
500#
501# CONFIG_BT is not set
502
503#
504# Library routines
505#
506# CONFIG_CRC32 is not set
507
508#
509# Kernel hacking
510#
511# CONFIG_DEBUG_KERNEL is not set
512# CONFIG_KALLSYMS is not set
513
514#
515# Security options
516#
517# CONFIG_SECURITY is not set
518
519#
520# Cryptographic options
521#
522# CONFIG_CRYPTO is not set
diff --git a/arch/ppc/configs/SPD823TS_defconfig b/arch/ppc/configs/SPD823TS_defconfig
deleted file mode 100644
index ba60fea2b834..000000000000
--- a/arch/ppc/configs/SPD823TS_defconfig
+++ /dev/null
@@ -1,520 +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
7
8#
9# Code maturity level options
10#
11CONFIG_EXPERIMENTAL=y
12
13#
14# General setup
15#
16CONFIG_SWAP=y
17CONFIG_SYSVIPC=y
18# CONFIG_BSD_PROCESS_ACCT is not set
19CONFIG_SYSCTL=y
20CONFIG_LOG_BUF_SHIFT=14
21CONFIG_EMBEDDED=y
22CONFIG_FUTEX=y
23# CONFIG_EPOLL is not set
24
25#
26# Loadable module support
27#
28CONFIG_MODULES=y
29CONFIG_MODULE_UNLOAD=y
30# CONFIG_MODULE_FORCE_UNLOAD is not set
31CONFIG_OBSOLETE_MODPARM=y
32# CONFIG_MODVERSIONS is not set
33CONFIG_KMOD=y
34
35#
36# Platform support
37#
38CONFIG_PPC=y
39CONFIG_PPC32=y
40# CONFIG_6xx is not set
41# CONFIG_40x is not set
42# CONFIG_POWER3 is not set
43CONFIG_8xx=y
44
45#
46# IBM 4xx options
47#
48CONFIG_EMBEDDEDBOOT=y
49CONFIG_SERIAL_CONSOLE=y
50CONFIG_NOT_COHERENT_CACHE=y
51# CONFIG_RPXLITE is not set
52# CONFIG_RPXCLASSIC is not set
53# CONFIG_BSEIP is not set
54# CONFIG_FADS is not set
55# CONFIG_TQM823L is not set
56# CONFIG_TQM850L is not set
57# CONFIG_TQM855L is not set
58# CONFIG_TQM860L is not set
59# CONFIG_FPS850L is not set
60CONFIG_SPD823TS=y
61# CONFIG_IVMS8 is not set
62# CONFIG_IVML24 is not set
63# CONFIG_SM850 is not set
64# CONFIG_HERMES_PRO is not set
65# CONFIG_IP860 is not set
66# CONFIG_LWMON is not set
67# CONFIG_PCU_E is not set
68# CONFIG_CCM is not set
69# CONFIG_LANTEC is not set
70# CONFIG_MBX is not set
71# CONFIG_WINCEPT is not set
72# CONFIG_SMP is not set
73# CONFIG_PREEMPT is not set
74CONFIG_MATH_EMULATION=y
75# CONFIG_CPU_FREQ is not set
76
77#
78# General setup
79#
80# CONFIG_HIGHMEM is not set
81# CONFIG_PCI is not set
82# CONFIG_PCI_DOMAINS is not set
83# CONFIG_PCI_QSPAN is not set
84CONFIG_KCORE_ELF=y
85CONFIG_BINFMT_ELF=y
86CONFIG_KERNEL_ELF=y
87# CONFIG_BINFMT_MISC is not set
88# CONFIG_HOTPLUG is not set
89
90#
91# Parallel port support
92#
93# CONFIG_PARPORT is not set
94# CONFIG_CMDLINE_BOOL is not set
95
96#
97# Advanced setup
98#
99# CONFIG_ADVANCED_OPTIONS is not set
100
101#
102# Default settings for advanced configuration options are used
103#
104CONFIG_HIGHMEM_START=0xfe000000
105CONFIG_LOWMEM_SIZE=0x30000000
106CONFIG_KERNEL_START=0xc0000000
107CONFIG_TASK_SIZE=0x80000000
108CONFIG_BOOT_LOAD=0x00400000
109
110#
111# Memory Technology Devices (MTD)
112#
113# CONFIG_MTD is not set
114
115#
116# Plug and Play support
117#
118# CONFIG_PNP is not set
119
120#
121# Block devices
122#
123# CONFIG_BLK_DEV_FD is not set
124# CONFIG_BLK_DEV_LOOP is not set
125# CONFIG_BLK_DEV_NBD is not set
126# CONFIG_BLK_DEV_RAM is not set
127# CONFIG_BLK_DEV_INITRD is not set
128
129#
130# Multi-device support (RAID and LVM)
131#
132# CONFIG_MD is not set
133
134#
135# ATA/IDE/MFM/RLL support
136#
137# CONFIG_IDE is not set
138
139#
140# SCSI support
141#
142# CONFIG_SCSI is not set
143
144#
145# Fusion MPT device support
146#
147
148#
149# I2O device support
150#
151
152#
153# Networking support
154#
155CONFIG_NET=y
156
157#
158# Networking options
159#
160CONFIG_PACKET=y
161# CONFIG_PACKET_MMAP is not set
162# CONFIG_NETLINK_DEV is not set
163# CONFIG_NETFILTER is not set
164CONFIG_UNIX=y
165# CONFIG_NET_KEY is not set
166CONFIG_INET=y
167# CONFIG_IP_MULTICAST is not set
168# CONFIG_IP_ADVANCED_ROUTER is not set
169CONFIG_IP_PNP=y
170CONFIG_IP_PNP_DHCP=y
171# CONFIG_IP_PNP_BOOTP is not set
172# CONFIG_IP_PNP_RARP is not set
173# CONFIG_NET_IPIP is not set
174# CONFIG_NET_IPGRE is not set
175# CONFIG_ARPD is not set
176# CONFIG_INET_ECN is not set
177# CONFIG_SYN_COOKIES is not set
178# CONFIG_INET_AH is not set
179# CONFIG_INET_ESP is not set
180# CONFIG_INET_IPCOMP is not set
181# CONFIG_IPV6 is not set
182# CONFIG_XFRM_USER is not set
183
184#
185# SCTP Configuration (EXPERIMENTAL)
186#
187CONFIG_IPV6_SCTP__=y
188# CONFIG_IP_SCTP is not set
189# CONFIG_ATM is not set
190# CONFIG_VLAN_8021Q is not set
191# CONFIG_LLC is not set
192# CONFIG_DECNET is not set
193# CONFIG_BRIDGE is not set
194# CONFIG_X25 is not set
195# CONFIG_LAPB is not set
196# CONFIG_NET_DIVERT is not set
197# CONFIG_ECONET is not set
198# CONFIG_WAN_ROUTER is not set
199# CONFIG_NET_HW_FLOWCONTROL is not set
200
201#
202# QoS and/or fair queueing
203#
204# CONFIG_NET_SCHED is not set
205
206#
207# Network testing
208#
209# CONFIG_NET_PKTGEN is not set
210CONFIG_NETDEVICES=y
211# CONFIG_DUMMY is not set
212# CONFIG_BONDING is not set
213# CONFIG_EQUALIZER is not set
214# CONFIG_TUN is not set
215# CONFIG_ETHERTAP is not set
216
217#
218# Ethernet (10 or 100Mbit)
219#
220CONFIG_NET_ETHERNET=y
221# CONFIG_MII is not set
222# CONFIG_OAKNET is not set
223
224#
225# Ethernet (1000 Mbit)
226#
227
228#
229# Ethernet (10000 Mbit)
230#
231# CONFIG_PPP is not set
232# CONFIG_SLIP is not set
233
234#
235# Wireless LAN (non-hamradio)
236#
237# CONFIG_NET_RADIO is not set
238
239#
240# Token Ring devices (depends on LLC=y)
241#
242# CONFIG_SHAPER is not set
243
244#
245# Wan interfaces
246#
247# CONFIG_WAN is not set
248
249#
250# Amateur Radio support
251#
252# CONFIG_HAMRADIO is not set
253
254#
255# IrDA (infrared) support
256#
257# CONFIG_IRDA is not set
258
259#
260# ISDN subsystem
261#
262# CONFIG_ISDN_BOOL is not set
263
264#
265# Graphics support
266#
267# CONFIG_FB is not set
268
269#
270# Old CD-ROM drivers (not SCSI, not IDE)
271#
272# CONFIG_CD_NO_IDESCSI is not set
273
274#
275# Input device support
276#
277# CONFIG_INPUT is not set
278
279#
280# Userland interfaces
281#
282
283#
284# Input I/O drivers
285#
286# CONFIG_GAMEPORT is not set
287CONFIG_SOUND_GAMEPORT=y
288# CONFIG_SERIO is not set
289
290#
291# Input Device Drivers
292#
293
294#
295# Macintosh device drivers
296#
297
298#
299# Serial drivers
300#
301# CONFIG_SERIAL_8250 is not set
302
303#
304# Non-8250 serial port support
305#
306CONFIG_SERIAL_CORE=y
307CONFIG_SERIAL_CORE_CONSOLE=y
308CONFIG_SERIAL_CPM=y
309CONFIG_SERIAL_CPM_CONSOLE=y
310# CONFIG_SERIAL_CPM_SCC1 is not set
311# CONFIG_SERIAL_CPM_SCC2 is not set
312# CONFIG_SERIAL_CPM_SCC3 is not set
313# CONFIG_SERIAL_CPM_SCC4 is not set
314CONFIG_SERIAL_CPM_SMC1=y
315# CONFIG_SERIAL_CPM_SMC2 is not set
316CONFIG_SERIAL_CPM_ALT_SMC2=y
317CONFIG_UNIX98_PTYS=y
318# CONFIG_LEGACY_PTYS is not set
319
320#
321# I2C support
322#
323# CONFIG_I2C is not set
324
325#
326# I2C Hardware Sensors Mainboard support
327#
328
329#
330# I2C Hardware Sensors Chip support
331#
332# CONFIG_I2C_SENSOR is not set
333
334#
335# Mice
336#
337# CONFIG_BUSMOUSE is not set
338# CONFIG_QIC02_TAPE is not set
339
340#
341# IPMI
342#
343# CONFIG_IPMI_HANDLER is not set
344
345#
346# Watchdog Cards
347#
348# CONFIG_WATCHDOG is not set
349# CONFIG_NVRAM is not set
350CONFIG_GEN_RTC=y
351# CONFIG_GEN_RTC_X is not set
352# CONFIG_DTLK is not set
353# CONFIG_R3964 is not set
354# CONFIG_APPLICOM is not set
355
356#
357# Ftape, the floppy tape device driver
358#
359# CONFIG_FTAPE is not set
360# CONFIG_AGP is not set
361# CONFIG_DRM is not set
362# CONFIG_RAW_DRIVER is not set
363# CONFIG_HANGCHECK_TIMER is not set
364
365#
366# Multimedia devices
367#
368# CONFIG_VIDEO_DEV is not set
369
370#
371# Digital Video Broadcasting Devices
372#
373# CONFIG_DVB is not set
374
375#
376# File systems
377#
378# CONFIG_EXT2_FS is not set
379CONFIG_EXT3_FS=y
380CONFIG_EXT3_FS_XATTR=y
381# CONFIG_EXT3_FS_POSIX_ACL is not set
382# CONFIG_EXT3_FS_SECURITY is not set
383CONFIG_JBD=y
384# CONFIG_JBD_DEBUG is not set
385CONFIG_FS_MBCACHE=y
386# CONFIG_REISERFS_FS is not set
387# CONFIG_JFS_FS is not set
388# CONFIG_XFS_FS is not set
389# CONFIG_MINIX_FS is not set
390# CONFIG_ROMFS_FS is not set
391# CONFIG_QUOTA is not set
392# CONFIG_AUTOFS_FS is not set
393# CONFIG_AUTOFS4_FS is not set
394
395#
396# CD-ROM/DVD Filesystems
397#
398# CONFIG_ISO9660_FS is not set
399# CONFIG_UDF_FS is not set
400
401#
402# DOS/FAT/NT Filesystems
403#
404# CONFIG_FAT_FS is not set
405# CONFIG_NTFS_FS is not set
406
407#
408# Pseudo filesystems
409#
410CONFIG_PROC_FS=y
411# CONFIG_DEVFS_FS is not set
412CONFIG_DEVPTS_FS=y
413# CONFIG_DEVPTS_FS_XATTR is not set
414CONFIG_TMPFS=y
415CONFIG_RAMFS=y
416
417#
418# Miscellaneous filesystems
419#
420# CONFIG_ADFS_FS is not set
421# CONFIG_AFFS_FS is not set
422# CONFIG_HFS_FS is not set
423# CONFIG_BEFS_FS is not set
424# CONFIG_BFS_FS is not set
425# CONFIG_EFS_FS is not set
426# CONFIG_CRAMFS is not set
427# CONFIG_VXFS_FS is not set
428# CONFIG_HPFS_FS is not set
429# CONFIG_QNX4FS_FS is not set
430# CONFIG_SYSV_FS is not set
431# CONFIG_UFS_FS is not set
432
433#
434# Network File Systems
435#
436CONFIG_NFS_FS=y
437# CONFIG_NFS_V3 is not set
438# CONFIG_NFS_V4 is not set
439# CONFIG_NFSD is not set
440CONFIG_ROOT_NFS=y
441CONFIG_LOCKD=y
442# CONFIG_EXPORTFS is not set
443CONFIG_SUNRPC=y
444# CONFIG_SUNRPC_GSS is not set
445# CONFIG_SMB_FS is not set
446# CONFIG_CIFS is not set
447# CONFIG_NCP_FS is not set
448# CONFIG_CODA_FS is not set
449# CONFIG_INTERMEZZO_FS is not set
450# CONFIG_AFS_FS is not set
451
452#
453# Partition Types
454#
455CONFIG_PARTITION_ADVANCED=y
456# CONFIG_ACORN_PARTITION is not set
457# CONFIG_OSF_PARTITION is not set
458# CONFIG_AMIGA_PARTITION is not set
459# CONFIG_ATARI_PARTITION is not set
460# CONFIG_MAC_PARTITION is not set
461# CONFIG_MSDOS_PARTITION is not set
462# CONFIG_LDM_PARTITION is not set
463# CONFIG_NEC98_PARTITION is not set
464# CONFIG_SGI_PARTITION is not set
465# CONFIG_ULTRIX_PARTITION is not set
466# CONFIG_SUN_PARTITION is not set
467# CONFIG_EFI_PARTITION is not set
468
469#
470# Sound
471#
472# CONFIG_SOUND is not set
473
474#
475# MPC8xx CPM Options
476#
477CONFIG_SCC_ENET=y
478# CONFIG_SCC1_ENET is not set
479CONFIG_SCC2_ENET=y
480# CONFIG_SCC3_ENET is not set
481# CONFIG_FEC_ENET is not set
482CONFIG_ENET_BIG_BUFFERS=y
483
484#
485# Generic MPC8xx Options
486#
487CONFIG_8xx_COPYBACK=y
488# CONFIG_8xx_CPU6 is not set
489# CONFIG_UCODE_PATCH is not set
490
491#
492# USB support
493#
494# CONFIG_USB_GADGET is not set
495
496#
497# Bluetooth support
498#
499# CONFIG_BT is not set
500
501#
502# Library routines
503#
504# CONFIG_CRC32 is not set
505
506#
507# Kernel hacking
508#
509# CONFIG_DEBUG_KERNEL is not set
510# CONFIG_KALLSYMS is not set
511
512#
513# Security options
514#
515# CONFIG_SECURITY is not set
516
517#
518# Cryptographic options
519#
520# CONFIG_CRYPTO is not set
diff --git a/arch/ppc/configs/adir_defconfig b/arch/ppc/configs/adir_defconfig
deleted file mode 100644
index f20e6533dc79..000000000000
--- a/arch/ppc/configs/adir_defconfig
+++ /dev/null
@@ -1,805 +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
7
8#
9# Code maturity level options
10#
11CONFIG_EXPERIMENTAL=y
12
13#
14# General setup
15#
16CONFIG_SWAP=y
17CONFIG_SYSVIPC=y
18# CONFIG_BSD_PROCESS_ACCT is not set
19CONFIG_SYSCTL=y
20CONFIG_LOG_BUF_SHIFT=14
21# CONFIG_EMBEDDED is not set
22CONFIG_FUTEX=y
23CONFIG_EPOLL=y
24
25#
26# Loadable module support
27#
28CONFIG_MODULES=y
29CONFIG_MODULE_UNLOAD=y
30# CONFIG_MODULE_FORCE_UNLOAD is not set
31CONFIG_OBSOLETE_MODPARM=y
32# CONFIG_MODVERSIONS is not set
33CONFIG_KMOD=y
34
35#
36# Platform support
37#
38CONFIG_PPC=y
39CONFIG_PPC32=y
40CONFIG_6xx=y
41# CONFIG_40x is not set
42# CONFIG_POWER3 is not set
43# CONFIG_8xx is not set
44
45#
46# IBM 4xx options
47#
48# CONFIG_8260 is not set
49CONFIG_GENERIC_ISA_DMA=y
50CONFIG_PPC_STD_MMU=y
51# CONFIG_PPC_MULTIPLATFORM is not set
52# CONFIG_APUS is not set
53# CONFIG_WILLOW_2 is not set
54# CONFIG_PCORE is not set
55# CONFIG_POWERPMC250 is not set
56# CONFIG_EV64260 is not set
57# CONFIG_SPRUCE is not set
58# CONFIG_LOPEC is not set
59# CONFIG_MCPN765 is not set
60# CONFIG_MVME5100 is not set
61# CONFIG_PPLUS is not set
62# CONFIG_PRPMC750 is not set
63# CONFIG_PRPMC800 is not set
64# CONFIG_SANDPOINT is not set
65CONFIG_ADIR=y
66# CONFIG_K2 is not set
67# CONFIG_PAL4 is not set
68# CONFIG_GEMINI is not set
69# CONFIG_SMP is not set
70# CONFIG_PREEMPT is not set
71# CONFIG_ALTIVEC is not set
72# CONFIG_TAU is not set
73# CONFIG_CPU_FREQ is not set
74
75#
76# General setup
77#
78# CONFIG_HIGHMEM is not set
79CONFIG_PCI=y
80CONFIG_PCI_DOMAINS=y
81CONFIG_KCORE_ELF=y
82CONFIG_BINFMT_ELF=y
83CONFIG_KERNEL_ELF=y
84# CONFIG_BINFMT_MISC is not set
85CONFIG_PCI_LEGACY_PROC=y
86# CONFIG_PCI_NAMES is not set
87# CONFIG_HOTPLUG is not set
88
89#
90# Parallel port support
91#
92CONFIG_PARPORT=y
93CONFIG_PARPORT_PC=y
94CONFIG_PARPORT_PC_CML1=y
95# CONFIG_PARPORT_SERIAL is not set
96CONFIG_PARPORT_PC_FIFO=y
97CONFIG_PARPORT_PC_SUPERIO=y
98# CONFIG_PARPORT_OTHER is not set
99CONFIG_PARPORT_1284=y
100# CONFIG_PPC601_SYNC_FIX is not set
101CONFIG_CMDLINE_BOOL=y
102CONFIG_CMDLINE="ip=on"
103
104#
105# Advanced setup
106#
107# CONFIG_ADVANCED_OPTIONS is not set
108
109#
110# Default settings for advanced configuration options are used
111#
112CONFIG_HIGHMEM_START=0xfe000000
113CONFIG_LOWMEM_SIZE=0x30000000
114CONFIG_KERNEL_START=0xc0000000
115CONFIG_TASK_SIZE=0x80000000
116CONFIG_BOOT_LOAD=0x00800000
117
118#
119# Memory Technology Devices (MTD)
120#
121# CONFIG_MTD is not set
122
123#
124# Plug and Play support
125#
126# CONFIG_PNP is not set
127
128#
129# Block devices
130#
131CONFIG_BLK_DEV_FD=y
132# CONFIG_PARIDE is not set
133# CONFIG_BLK_CPQ_DA is not set
134# CONFIG_BLK_CPQ_CISS_DA is not set
135# CONFIG_BLK_DEV_DAC960 is not set
136# CONFIG_BLK_DEV_UMEM is not set
137CONFIG_BLK_DEV_LOOP=y
138# CONFIG_BLK_DEV_NBD is not set
139CONFIG_BLK_DEV_RAM=y
140CONFIG_BLK_DEV_RAM_SIZE=4096
141CONFIG_BLK_DEV_INITRD=y
142
143#
144# Multi-device support (RAID and LVM)
145#
146# CONFIG_MD is not set
147
148#
149# ATA/IDE/MFM/RLL support
150#
151# CONFIG_IDE is not set
152
153#
154# SCSI support
155#
156CONFIG_SCSI=y
157
158#
159# SCSI support type (disk, tape, CD-ROM)
160#
161CONFIG_BLK_DEV_SD=y
162CONFIG_CHR_DEV_ST=y
163# CONFIG_CHR_DEV_OSST is not set
164CONFIG_BLK_DEV_SR=y
165CONFIG_BLK_DEV_SR_VENDOR=y
166CONFIG_CHR_DEV_SG=y
167
168#
169# Some SCSI devices (e.g. CD jukebox) support multiple LUNs
170#
171# CONFIG_SCSI_MULTI_LUN is not set
172# CONFIG_SCSI_REPORT_LUNS is not set
173CONFIG_SCSI_CONSTANTS=y
174# CONFIG_SCSI_LOGGING is not set
175
176#
177# SCSI low-level drivers
178#
179# CONFIG_BLK_DEV_3W_XXXX_RAID is not set
180# CONFIG_SCSI_ACARD is not set
181# CONFIG_SCSI_AACRAID is not set
182# CONFIG_SCSI_AIC7XXX is not set
183# CONFIG_SCSI_AIC7XXX_OLD is not set
184# CONFIG_SCSI_AIC79XX is not set
185# CONFIG_SCSI_DPT_I2O is not set
186# CONFIG_SCSI_ADVANSYS is not set
187# CONFIG_SCSI_IN2000 is not set
188# CONFIG_SCSI_AM53C974 is not set
189# CONFIG_SCSI_MEGARAID is not set
190# CONFIG_SCSI_BUSLOGIC is not set
191# CONFIG_SCSI_CPQFCTS is not set
192# CONFIG_SCSI_DMX3191D is not set
193# CONFIG_SCSI_EATA is not set
194# CONFIG_SCSI_EATA_PIO is not set
195# CONFIG_SCSI_FUTURE_DOMAIN is not set
196# CONFIG_SCSI_GDTH is not set
197# CONFIG_SCSI_GENERIC_NCR5380 is not set
198# CONFIG_SCSI_GENERIC_NCR5380_MMIO is not set
199# CONFIG_SCSI_INITIO is not set
200# CONFIG_SCSI_INIA100 is not set
201# CONFIG_SCSI_PPA is not set
202# CONFIG_SCSI_IMM is not set
203# CONFIG_SCSI_NCR53C7xx is not set
204# CONFIG_SCSI_SYM53C8XX_2 is not set
205CONFIG_SCSI_NCR53C8XX=y
206CONFIG_SCSI_SYM53C8XX=y
207CONFIG_SCSI_NCR53C8XX_DEFAULT_TAGS=8
208CONFIG_SCSI_NCR53C8XX_MAX_TAGS=32
209CONFIG_SCSI_NCR53C8XX_SYNC=20
210# CONFIG_SCSI_NCR53C8XX_PROFILE is not set
211# CONFIG_SCSI_NCR53C8XX_IOMAPPED is not set
212# CONFIG_SCSI_NCR53C8XX_PQS_PDS is not set
213# CONFIG_SCSI_NCR53C8XX_SYMBIOS_COMPAT is not set
214# CONFIG_SCSI_PCI2000 is not set
215# CONFIG_SCSI_PCI2220I is not set
216# CONFIG_SCSI_QLOGIC_ISP is not set
217# CONFIG_SCSI_QLOGIC_FC is not set
218# CONFIG_SCSI_QLOGIC_1280 is not set
219# CONFIG_SCSI_DC395x is not set
220# CONFIG_SCSI_DC390T is not set
221# CONFIG_SCSI_U14_34F is not set
222# CONFIG_SCSI_NSP32 is not set
223# CONFIG_SCSI_DEBUG is not set
224
225#
226# Fusion MPT device support
227#
228# CONFIG_FUSION is not set
229
230#
231# IEEE 1394 (FireWire) support (EXPERIMENTAL)
232#
233# CONFIG_IEEE1394 is not set
234
235#
236# I2O device support
237#
238# CONFIG_I2O is not set
239
240#
241# Networking support
242#
243CONFIG_NET=y
244
245#
246# Networking options
247#
248CONFIG_PACKET=y
249# CONFIG_PACKET_MMAP is not set
250# CONFIG_NETLINK_DEV is not set
251CONFIG_NETFILTER=y
252# CONFIG_NETFILTER_DEBUG is not set
253CONFIG_UNIX=y
254# CONFIG_NET_KEY is not set
255CONFIG_INET=y
256# CONFIG_IP_MULTICAST is not set
257# CONFIG_IP_ADVANCED_ROUTER is not set
258CONFIG_IP_PNP=y
259CONFIG_IP_PNP_DHCP=y
260# CONFIG_IP_PNP_BOOTP is not set
261# CONFIG_IP_PNP_RARP is not set
262# CONFIG_NET_IPIP is not set
263# CONFIG_NET_IPGRE is not set
264# CONFIG_ARPD is not set
265# CONFIG_INET_ECN is not set
266# CONFIG_SYN_COOKIES is not set
267# CONFIG_INET_AH is not set
268# CONFIG_INET_ESP is not set
269# CONFIG_INET_IPCOMP is not set
270
271#
272# IP: Netfilter Configuration
273#
274CONFIG_IP_NF_CONNTRACK=m
275CONFIG_IP_NF_FTP=m
276CONFIG_IP_NF_IRC=m
277CONFIG_IP_NF_TFTP=m
278CONFIG_IP_NF_AMANDA=m
279# CONFIG_IP_NF_QUEUE is not set
280CONFIG_IP_NF_IPTABLES=m
281CONFIG_IP_NF_MATCH_LIMIT=m
282CONFIG_IP_NF_MATCH_MAC=m
283CONFIG_IP_NF_MATCH_PKTTYPE=m
284CONFIG_IP_NF_MATCH_MARK=m
285CONFIG_IP_NF_MATCH_MULTIPORT=m
286CONFIG_IP_NF_MATCH_TOS=m
287CONFIG_IP_NF_MATCH_ECN=m
288CONFIG_IP_NF_MATCH_DSCP=m
289CONFIG_IP_NF_MATCH_AH_ESP=m
290CONFIG_IP_NF_MATCH_LENGTH=m
291CONFIG_IP_NF_MATCH_TTL=m
292CONFIG_IP_NF_MATCH_TCPMSS=m
293CONFIG_IP_NF_MATCH_HELPER=m
294CONFIG_IP_NF_MATCH_STATE=m
295CONFIG_IP_NF_MATCH_CONNTRACK=m
296CONFIG_IP_NF_MATCH_UNCLEAN=m
297CONFIG_IP_NF_MATCH_OWNER=m
298CONFIG_IP_NF_FILTER=m
299CONFIG_IP_NF_TARGET_REJECT=m
300CONFIG_IP_NF_TARGET_MIRROR=m
301CONFIG_IP_NF_NAT=m
302CONFIG_IP_NF_NAT_NEEDED=y
303CONFIG_IP_NF_TARGET_MASQUERADE=m
304CONFIG_IP_NF_TARGET_REDIRECT=m
305CONFIG_IP_NF_NAT_SNMP_BASIC=m
306CONFIG_IP_NF_NAT_IRC=m
307CONFIG_IP_NF_NAT_FTP=m
308CONFIG_IP_NF_NAT_TFTP=m
309CONFIG_IP_NF_NAT_AMANDA=m
310# CONFIG_IP_NF_MANGLE is not set
311# CONFIG_IP_NF_TARGET_LOG is not set
312# CONFIG_IP_NF_TARGET_ULOG is not set
313CONFIG_IP_NF_TARGET_TCPMSS=m
314CONFIG_IP_NF_ARPTABLES=m
315CONFIG_IP_NF_ARPFILTER=m
316CONFIG_IP_NF_COMPAT_IPCHAINS=m
317# CONFIG_IP_NF_COMPAT_IPFWADM is not set
318# CONFIG_IPV6 is not set
319# CONFIG_XFRM_USER is not set
320
321#
322# SCTP Configuration (EXPERIMENTAL)
323#
324CONFIG_IPV6_SCTP__=y
325# CONFIG_IP_SCTP is not set
326# CONFIG_ATM is not set
327# CONFIG_VLAN_8021Q is not set
328# CONFIG_LLC is not set
329# CONFIG_DECNET is not set
330# CONFIG_BRIDGE is not set
331# CONFIG_X25 is not set
332# CONFIG_LAPB is not set
333# CONFIG_NET_DIVERT is not set
334# CONFIG_ECONET is not set
335# CONFIG_WAN_ROUTER is not set
336# CONFIG_NET_HW_FLOWCONTROL is not set
337
338#
339# QoS and/or fair queueing
340#
341# CONFIG_NET_SCHED is not set
342
343#
344# Network testing
345#
346# CONFIG_NET_PKTGEN is not set
347CONFIG_NETDEVICES=y
348
349#
350# ARCnet devices
351#
352# CONFIG_ARCNET is not set
353# CONFIG_DUMMY is not set
354# CONFIG_BONDING is not set
355# CONFIG_EQUALIZER is not set
356# CONFIG_TUN is not set
357# CONFIG_ETHERTAP is not set
358
359#
360# Ethernet (10 or 100Mbit)
361#
362CONFIG_NET_ETHERNET=y
363CONFIG_MII=y
364# CONFIG_OAKNET is not set
365# CONFIG_HAPPYMEAL is not set
366# CONFIG_SUNGEM is not set
367# CONFIG_NET_VENDOR_3COM is not set
368
369#
370# Tulip family network device support
371#
372# CONFIG_NET_TULIP is not set
373# CONFIG_HP100 is not set
374CONFIG_NET_PCI=y
375# CONFIG_PCNET32 is not set
376# CONFIG_AMD8111_ETH is not set
377# CONFIG_ADAPTEC_STARFIRE is not set
378# CONFIG_B44 is not set
379# CONFIG_DGRS is not set
380CONFIG_EEPRO100=y
381# CONFIG_EEPRO100_PIO is not set
382# CONFIG_E100 is not set
383# CONFIG_FEALNX is not set
384# CONFIG_NATSEMI is not set
385# CONFIG_NE2K_PCI is not set
386# CONFIG_8139CP is not set
387# CONFIG_8139TOO is not set
388# CONFIG_SIS900 is not set
389# CONFIG_EPIC100 is not set
390# CONFIG_SUNDANCE is not set
391# CONFIG_TLAN is not set
392# CONFIG_VIA_RHINE is not set
393
394#
395# Ethernet (1000 Mbit)
396#
397# CONFIG_ACENIC is not set
398# CONFIG_DL2K is not set
399# CONFIG_E1000 is not set
400# CONFIG_NS83820 is not set
401# CONFIG_HAMACHI is not set
402# CONFIG_YELLOWFIN is not set
403# CONFIG_R8169 is not set
404# CONFIG_SK98LIN is not set
405# CONFIG_TIGON3 is not set
406
407#
408# Ethernet (10000 Mbit)
409#
410# CONFIG_IXGB is not set
411# CONFIG_FDDI is not set
412# CONFIG_HIPPI is not set
413# CONFIG_PLIP is not set
414# CONFIG_PPP is not set
415# CONFIG_SLIP is not set
416
417#
418# Wireless LAN (non-hamradio)
419#
420# CONFIG_NET_RADIO is not set
421
422#
423# Token Ring devices (depends on LLC=y)
424#
425# CONFIG_NET_FC is not set
426# CONFIG_RCPCI is not set
427# CONFIG_SHAPER is not set
428
429#
430# Wan interfaces
431#
432# CONFIG_WAN is not set
433
434#
435# Amateur Radio support
436#
437# CONFIG_HAMRADIO is not set
438
439#
440# IrDA (infrared) support
441#
442# CONFIG_IRDA is not set
443
444#
445# ISDN subsystem
446#
447# CONFIG_ISDN_BOOL is not set
448
449#
450# Graphics support
451#
452# CONFIG_FB is not set
453
454#
455# Old CD-ROM drivers (not SCSI, not IDE)
456#
457# CONFIG_CD_NO_IDESCSI is not set
458
459#
460# Input device support
461#
462# CONFIG_INPUT is not set
463
464#
465# Userland interfaces
466#
467
468#
469# Input I/O drivers
470#
471# CONFIG_GAMEPORT is not set
472CONFIG_SOUND_GAMEPORT=y
473# CONFIG_SERIO is not set
474
475#
476# Input Device Drivers
477#
478
479#
480# Macintosh device drivers
481#
482
483#
484# Character devices
485#
486# CONFIG_SERIAL_NONSTANDARD is not set
487
488#
489# Serial drivers
490#
491CONFIG_SERIAL_8250=y
492CONFIG_SERIAL_8250_CONSOLE=y
493# CONFIG_SERIAL_8250_EXTENDED is not set
494
495#
496# Non-8250 serial port support
497#
498CONFIG_SERIAL_CORE=y
499CONFIG_SERIAL_CORE_CONSOLE=y
500CONFIG_UNIX98_PTYS=y
501CONFIG_UNIX98_PTY_COUNT=256
502# CONFIG_PRINTER is not set
503# CONFIG_PPDEV is not set
504# CONFIG_TIPAR is not set
505
506#
507# I2C support
508#
509# CONFIG_I2C is not set
510
511#
512# I2C Hardware Sensors Mainboard support
513#
514
515#
516# I2C Hardware Sensors Chip support
517#
518# CONFIG_I2C_SENSOR is not set
519
520#
521# Mice
522#
523# CONFIG_BUSMOUSE is not set
524# CONFIG_QIC02_TAPE is not set
525
526#
527# IPMI
528#
529# CONFIG_IPMI_HANDLER is not set
530
531#
532# Watchdog Cards
533#
534# CONFIG_WATCHDOG is not set
535# CONFIG_NVRAM is not set
536CONFIG_GEN_RTC=y
537# CONFIG_GEN_RTC_X is not set
538# CONFIG_DTLK is not set
539# CONFIG_R3964 is not set
540# CONFIG_APPLICOM is not set
541
542#
543# Ftape, the floppy tape device driver
544#
545# CONFIG_FTAPE is not set
546# CONFIG_AGP is not set
547# CONFIG_DRM is not set
548# CONFIG_RAW_DRIVER is not set
549# CONFIG_HANGCHECK_TIMER is not set
550
551#
552# Multimedia devices
553#
554# CONFIG_VIDEO_DEV is not set
555
556#
557# Digital Video Broadcasting Devices
558#
559# CONFIG_DVB is not set
560
561#
562# File systems
563#
564CONFIG_EXT2_FS=y
565# CONFIG_EXT2_FS_XATTR is not set
566CONFIG_EXT3_FS=y
567CONFIG_EXT3_FS_XATTR=y
568# CONFIG_EXT3_FS_POSIX_ACL is not set
569# CONFIG_EXT3_FS_SECURITY is not set
570CONFIG_JBD=y
571# CONFIG_JBD_DEBUG is not set
572CONFIG_FS_MBCACHE=y
573# CONFIG_REISERFS_FS is not set
574# CONFIG_JFS_FS is not set
575# CONFIG_XFS_FS is not set
576# CONFIG_MINIX_FS is not set
577# CONFIG_ROMFS_FS is not set
578# CONFIG_QUOTA is not set
579# CONFIG_AUTOFS_FS is not set
580# CONFIG_AUTOFS4_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#
591# CONFIG_FAT_FS is not set
592# CONFIG_NTFS_FS is not set
593
594#
595# Pseudo filesystems
596#
597CONFIG_PROC_FS=y
598# CONFIG_DEVFS_FS is not set
599CONFIG_DEVPTS_FS=y
600# CONFIG_DEVPTS_FS_XATTR is not set
601CONFIG_TMPFS=y
602CONFIG_RAMFS=y
603
604#
605# Miscellaneous filesystems
606#
607# CONFIG_ADFS_FS is not set
608# CONFIG_AFFS_FS is not set
609# CONFIG_HFS_FS is not set
610# CONFIG_BEFS_FS is not set
611# CONFIG_BFS_FS is not set
612# CONFIG_EFS_FS is not set
613# CONFIG_CRAMFS is not set
614# CONFIG_VXFS_FS is not set
615# CONFIG_HPFS_FS is not set
616# CONFIG_QNX4FS_FS is not set
617# CONFIG_SYSV_FS is not set
618# CONFIG_UFS_FS is not set
619
620#
621# Network File Systems
622#
623CONFIG_NFS_FS=y
624# CONFIG_NFS_V3 is not set
625# CONFIG_NFS_V4 is not set
626# CONFIG_NFSD is not set
627CONFIG_ROOT_NFS=y
628CONFIG_LOCKD=y
629# CONFIG_EXPORTFS is not set
630CONFIG_SUNRPC=y
631# CONFIG_SUNRPC_GSS 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_INTERMEZZO_FS is not set
637# CONFIG_AFS_FS is not set
638
639#
640# Partition Types
641#
642# CONFIG_PARTITION_ADVANCED is not set
643CONFIG_MSDOS_PARTITION=y
644
645#
646# Sound
647#
648# CONFIG_SOUND is not set
649
650#
651# USB support
652#
653CONFIG_USB=y
654# CONFIG_USB_DEBUG is not set
655
656#
657# Miscellaneous USB options
658#
659CONFIG_USB_DEVICEFS=y
660# CONFIG_USB_BANDWIDTH is not set
661CONFIG_USB_DYNAMIC_MINORS=y
662
663#
664# USB Host Controller Drivers
665#
666# CONFIG_USB_EHCI_HCD is not set
667CONFIG_USB_OHCI_HCD=y
668# CONFIG_USB_UHCI_HCD is not set
669
670#
671# USB Device Class drivers
672#
673# CONFIG_USB_BLUETOOTH_TTY is not set
674CONFIG_USB_ACM=m
675# CONFIG_USB_PRINTER is not set
676CONFIG_USB_STORAGE=m
677# CONFIG_USB_STORAGE_DEBUG is not set
678# CONFIG_USB_STORAGE_DATAFAB is not set
679CONFIG_USB_STORAGE_FREECOM=y
680# CONFIG_USB_STORAGE_ISD200 is not set
681CONFIG_USB_STORAGE_DPCM=y
682# CONFIG_USB_STORAGE_HP8200e is not set
683# CONFIG_USB_STORAGE_SDDR09 is not set
684# CONFIG_USB_STORAGE_SDDR55 is not set
685# CONFIG_USB_STORAGE_JUMPSHOT is not set
686
687#
688# USB Human Interface Devices (HID)
689#
690CONFIG_USB_HID=m
691
692#
693# Input core support is needed for USB HID input layer or HIDBP support
694#
695CONFIG_USB_HIDDEV=y
696
697#
698# USB HID Boot Protocol drivers
699#
700
701#
702# USB Imaging devices
703#
704# CONFIG_USB_MDC800 is not set
705# CONFIG_USB_SCANNER is not set
706# CONFIG_USB_MICROTEK is not set
707# CONFIG_USB_HPUSBSCSI is not set
708
709#
710# USB Multimedia devices
711#
712# CONFIG_USB_DABUSB is not set
713
714#
715# Video4Linux support is needed for USB Multimedia device support
716#
717
718#
719# USB Network adaptors
720#
721# CONFIG_USB_CATC is not set
722# CONFIG_USB_KAWETH is not set
723# CONFIG_USB_PEGASUS is not set
724# CONFIG_USB_RTL8150 is not set
725# CONFIG_USB_USBNET is not set
726
727#
728# USB port drivers
729#
730# CONFIG_USB_USS720 is not set
731
732#
733# USB Serial Converter support
734#
735CONFIG_USB_SERIAL=m
736# CONFIG_USB_SERIAL_GENERIC is not set
737# CONFIG_USB_SERIAL_BELKIN is not set
738# CONFIG_USB_SERIAL_WHITEHEAT is not set
739# CONFIG_USB_SERIAL_DIGI_ACCELEPORT is not set
740# CONFIG_USB_SERIAL_EMPEG is not set
741# CONFIG_USB_SERIAL_FTDI_SIO is not set
742CONFIG_USB_SERIAL_VISOR=m
743# CONFIG_USB_SERIAL_IPAQ is not set
744# CONFIG_USB_SERIAL_IR is not set
745# CONFIG_USB_SERIAL_EDGEPORT is not set
746# CONFIG_USB_SERIAL_EDGEPORT_TI is not set
747# CONFIG_USB_SERIAL_KEYSPAN_PDA is not set
748CONFIG_USB_SERIAL_KEYSPAN=m
749# CONFIG_USB_SERIAL_KEYSPAN_MPR is not set
750CONFIG_USB_SERIAL_KEYSPAN_USA28=y
751CONFIG_USB_SERIAL_KEYSPAN_USA28X=y
752# CONFIG_USB_SERIAL_KEYSPAN_USA28XA is not set
753# CONFIG_USB_SERIAL_KEYSPAN_USA28XB is not set
754CONFIG_USB_SERIAL_KEYSPAN_USA19=y
755CONFIG_USB_SERIAL_KEYSPAN_USA18X=y
756CONFIG_USB_SERIAL_KEYSPAN_USA19W=y
757CONFIG_USB_SERIAL_KEYSPAN_USA19QW=y
758CONFIG_USB_SERIAL_KEYSPAN_USA19QI=y
759CONFIG_USB_SERIAL_KEYSPAN_USA49W=y
760# CONFIG_USB_SERIAL_KEYSPAN_USA49WLC is not set
761# CONFIG_USB_SERIAL_KLSI is not set
762# CONFIG_USB_SERIAL_KOBIL_SCT is not set
763# CONFIG_USB_SERIAL_MCT_U232 is not set
764# CONFIG_USB_SERIAL_PL2303 is not set
765# CONFIG_USB_SERIAL_SAFE is not set
766# CONFIG_USB_SERIAL_CYBERJACK is not set
767# CONFIG_USB_SERIAL_XIRCOM is not set
768# CONFIG_USB_SERIAL_OMNINET is not set
769CONFIG_USB_EZUSB=y
770
771#
772# USB Miscellaneous drivers
773#
774# CONFIG_USB_TIGL is not set
775# CONFIG_USB_AUERSWALD is not set
776# CONFIG_USB_RIO500 is not set
777# CONFIG_USB_LCD is not set
778# CONFIG_USB_TEST is not set
779# CONFIG_USB_GADGET is not set
780
781#
782# Bluetooth support
783#
784# CONFIG_BT is not set
785
786#
787# Library routines
788#
789# CONFIG_CRC32 is not set
790
791#
792# Kernel hacking
793#
794# CONFIG_DEBUG_KERNEL is not set
795# CONFIG_KALLSYMS is not set
796
797#
798# Security options
799#
800# CONFIG_SECURITY is not set
801
802#
803# Cryptographic options
804#
805# CONFIG_CRYPTO is not set
diff --git a/arch/ppc/configs/ash_defconfig b/arch/ppc/configs/ash_defconfig
deleted file mode 100644
index c4a73cc16cf6..000000000000
--- a/arch/ppc/configs/ash_defconfig
+++ /dev/null
@@ -1,666 +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
16CONFIG_STANDALONE=y
17CONFIG_BROKEN_ON_SMP=y
18
19#
20# General setup
21#
22CONFIG_SWAP=y
23CONFIG_SYSVIPC=y
24# CONFIG_BSD_PROCESS_ACCT is not set
25CONFIG_SYSCTL=y
26CONFIG_LOG_BUF_SHIFT=14
27# CONFIG_HOTPLUG is not set
28# CONFIG_IKCONFIG is not set
29CONFIG_EMBEDDED=y
30# CONFIG_KALLSYMS is not set
31CONFIG_FUTEX=y
32# CONFIG_EPOLL is not set
33CONFIG_IOSCHED_NOOP=y
34CONFIG_IOSCHED_AS=y
35CONFIG_IOSCHED_DEADLINE=y
36# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
37
38#
39# Loadable module support
40#
41CONFIG_MODULES=y
42CONFIG_MODULE_UNLOAD=y
43# CONFIG_MODULE_FORCE_UNLOAD is not set
44CONFIG_OBSOLETE_MODPARM=y
45# CONFIG_MODVERSIONS is not set
46CONFIG_KMOD=y
47
48#
49# Processor
50#
51# CONFIG_6xx is not set
52CONFIG_40x=y
53# CONFIG_44x is not set
54# CONFIG_POWER3 is not set
55# CONFIG_POWER4 is not set
56# CONFIG_8xx is not set
57# CONFIG_MATH_EMULATION is not set
58# CONFIG_CPU_FREQ is not set
59CONFIG_4xx=y
60
61#
62# IBM 4xx options
63#
64CONFIG_ASH=y
65# CONFIG_CPCI405 is not set
66# CONFIG_EP405 is not set
67# CONFIG_EVB405EP is not set
68# CONFIG_OAK is not set
69# CONFIG_REDWOOD_5 is not set
70# CONFIG_REDWOOD_6 is not set
71# CONFIG_SYCAMORE is not set
72# CONFIG_WALNUT is not set
73CONFIG_NP405H=y
74CONFIG_IBM405_ERR77=y
75CONFIG_IBM405_ERR51=y
76CONFIG_IBM_OCP=y
77CONFIG_PPC_OCP=y
78CONFIG_IBM_OPENBIOS=y
79# CONFIG_PM is not set
80CONFIG_UART0_TTYS0=y
81# CONFIG_UART0_TTYS1 is not set
82CONFIG_NOT_COHERENT_CACHE=y
83
84#
85# Platform options
86#
87# CONFIG_PC_KEYBOARD is not set
88# CONFIG_SMP is not set
89# CONFIG_PREEMPT is not set
90# CONFIG_HIGHMEM is not set
91CONFIG_KERNEL_ELF=y
92CONFIG_BINFMT_ELF=y
93# CONFIG_BINFMT_MISC is not set
94CONFIG_CMDLINE_BOOL=y
95CONFIG_CMDLINE="ip=on"
96
97#
98# Bus options
99#
100CONFIG_PCI=y
101CONFIG_PCI_DOMAINS=y
102CONFIG_PCI_LEGACY_PROC=y
103# CONFIG_PCI_NAMES is not set
104
105#
106# Advanced setup
107#
108# CONFIG_ADVANCED_OPTIONS is not set
109
110#
111# Default settings for advanced configuration options are used
112#
113CONFIG_HIGHMEM_START=0xfe000000
114CONFIG_LOWMEM_SIZE=0x30000000
115CONFIG_KERNEL_START=0xc0000000
116CONFIG_TASK_SIZE=0x80000000
117CONFIG_BOOT_LOAD=0x00400000
118
119#
120# Device Drivers
121#
122
123#
124# Generic Driver Options
125#
126
127#
128# Memory Technology Devices (MTD)
129#
130# CONFIG_MTD is not set
131
132#
133# Parallel port support
134#
135# CONFIG_PARPORT is not set
136
137#
138# Plug and Play support
139#
140
141#
142# Block devices
143#
144# CONFIG_BLK_DEV_FD is not set
145# CONFIG_BLK_CPQ_DA is not set
146# CONFIG_BLK_CPQ_CISS_DA is not set
147# CONFIG_BLK_DEV_DAC960 is not set
148# CONFIG_BLK_DEV_UMEM is not set
149CONFIG_BLK_DEV_LOOP=y
150# CONFIG_BLK_DEV_CRYPTOLOOP is not set
151# CONFIG_BLK_DEV_NBD is not set
152# CONFIG_BLK_DEV_CARMEL is not set
153CONFIG_BLK_DEV_RAM=y
154CONFIG_BLK_DEV_RAM_SIZE=4096
155CONFIG_BLK_DEV_INITRD=y
156# CONFIG_LBD is not set
157
158#
159# ATA/ATAPI/MFM/RLL support
160#
161# CONFIG_IDE is not set
162
163#
164# SCSI device support
165#
166# CONFIG_SCSI is not set
167
168#
169# Multi-device support (RAID and LVM)
170#
171# CONFIG_MD is not set
172
173#
174# Fusion MPT device support
175#
176# CONFIG_FUSION is not set
177
178#
179# IEEE 1394 (FireWire) support
180#
181# CONFIG_IEEE1394 is not set
182
183#
184# I2O device support
185#
186# CONFIG_I2O is not set
187
188#
189# Macintosh device drivers
190#
191
192#
193# Networking support
194#
195CONFIG_NET=y
196
197#
198# Networking options
199#
200# CONFIG_PACKET is not set
201# CONFIG_NETLINK_DEV is not set
202CONFIG_UNIX=y
203# CONFIG_NET_KEY is not set
204CONFIG_INET=y
205CONFIG_IP_MULTICAST=y
206# CONFIG_IP_ADVANCED_ROUTER is not set
207CONFIG_IP_PNP=y
208# CONFIG_IP_PNP_DHCP is not set
209CONFIG_IP_PNP_BOOTP=y
210# CONFIG_IP_PNP_RARP is not set
211# CONFIG_NET_IPIP is not set
212# CONFIG_NET_IPGRE is not set
213# CONFIG_IP_MROUTE is not set
214# CONFIG_ARPD is not set
215CONFIG_SYN_COOKIES=y
216# CONFIG_INET_AH is not set
217# CONFIG_INET_ESP is not set
218# CONFIG_INET_IPCOMP is not set
219# CONFIG_IPV6 is not set
220# CONFIG_DECNET is not set
221# CONFIG_BRIDGE is not set
222# CONFIG_NETFILTER 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_VLAN_8021Q is not set
230# CONFIG_LLC2 is not set
231# CONFIG_IPX is not set
232# CONFIG_ATALK is not set
233# CONFIG_X25 is not set
234# CONFIG_LAPB is not set
235# CONFIG_NET_DIVERT is not set
236# CONFIG_ECONET is not set
237# CONFIG_WAN_ROUTER is not set
238# CONFIG_NET_HW_FLOWCONTROL is not set
239
240#
241# QoS and/or fair queueing
242#
243# CONFIG_NET_SCHED is not set
244
245#
246# Network testing
247#
248# CONFIG_NET_PKTGEN is not set
249CONFIG_NETDEVICES=y
250
251#
252# ARCnet devices
253#
254# CONFIG_ARCNET is not set
255# CONFIG_DUMMY is not set
256# CONFIG_BONDING is not set
257# CONFIG_EQUALIZER is not set
258# CONFIG_TUN is not set
259
260#
261# Ethernet (10 or 100Mbit)
262#
263# CONFIG_NET_ETHERNET is not set
264
265#
266# Ethernet (1000 Mbit)
267#
268# CONFIG_ACENIC is not set
269# CONFIG_DL2K is not set
270# CONFIG_E1000 is not set
271# CONFIG_NS83820 is not set
272# CONFIG_HAMACHI is not set
273# CONFIG_YELLOWFIN is not set
274# CONFIG_R8169 is not set
275# CONFIG_SIS190 is not set
276# CONFIG_SK98LIN is not set
277# CONFIG_TIGON3 is not set
278
279#
280# Ethernet (10000 Mbit)
281#
282# CONFIG_IXGB is not set
283CONFIG_IBM_EMAC=y
284# CONFIG_IBM_EMAC_ERRMSG is not set
285CONFIG_IBM_EMAC_RXB=64
286CONFIG_IBM_EMAC_TXB=8
287CONFIG_IBM_EMAC_FGAP=8
288CONFIG_IBM_EMAC_SKBRES=0
289# CONFIG_FDDI is not set
290# CONFIG_HIPPI is not set
291# CONFIG_PPP is not set
292# CONFIG_SLIP is not set
293
294#
295# Wireless LAN (non-hamradio)
296#
297# CONFIG_NET_RADIO is not set
298
299#
300# Token Ring devices
301#
302# CONFIG_TR is not set
303# CONFIG_RCPCI is not set
304# CONFIG_SHAPER is not set
305# CONFIG_NETCONSOLE is not set
306
307#
308# Wan interfaces
309#
310# CONFIG_WAN is not set
311
312#
313# Amateur Radio support
314#
315# CONFIG_HAMRADIO is not set
316
317#
318# IrDA (infrared) support
319#
320# CONFIG_IRDA is not set
321
322#
323# Bluetooth support
324#
325# CONFIG_BT is not set
326# CONFIG_NETPOLL is not set
327# CONFIG_NET_POLL_CONTROLLER is not set
328
329#
330# ISDN subsystem
331#
332# CONFIG_ISDN is not set
333
334#
335# Telephony Support
336#
337# CONFIG_PHONE is not set
338
339#
340# Input device support
341#
342CONFIG_INPUT=y
343
344#
345# Userland interfaces
346#
347CONFIG_INPUT_MOUSEDEV=y
348CONFIG_INPUT_MOUSEDEV_PSAUX=y
349CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024
350CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768
351# CONFIG_INPUT_JOYDEV is not set
352# CONFIG_INPUT_TSDEV is not set
353# CONFIG_INPUT_EVDEV is not set
354# CONFIG_INPUT_EVBUG is not set
355
356#
357# Input I/O drivers
358#
359# CONFIG_GAMEPORT is not set
360CONFIG_SOUND_GAMEPORT=y
361CONFIG_SERIO=y
362CONFIG_SERIO_I8042=y
363CONFIG_SERIO_SERPORT=y
364# CONFIG_SERIO_CT82C710 is not set
365# CONFIG_SERIO_PCIPS2 is not set
366
367#
368# Input Device Drivers
369#
370CONFIG_INPUT_KEYBOARD=y
371CONFIG_KEYBOARD_ATKBD=y
372# CONFIG_KEYBOARD_SUNKBD is not set
373# CONFIG_KEYBOARD_LKKBD is not set
374# CONFIG_KEYBOARD_XTKBD is not set
375# CONFIG_KEYBOARD_NEWTON is not set
376CONFIG_INPUT_MOUSE=y
377CONFIG_MOUSE_PS2=y
378# CONFIG_MOUSE_SERIAL is not set
379# CONFIG_MOUSE_VSXXXAA is not set
380# CONFIG_INPUT_JOYSTICK is not set
381# CONFIG_INPUT_TOUCHSCREEN is not set
382# CONFIG_INPUT_MISC is not set
383
384#
385# Character devices
386#
387# CONFIG_VT is not set
388# CONFIG_SERIAL_NONSTANDARD is not set
389
390#
391# Serial drivers
392#
393CONFIG_SERIAL_8250=y
394CONFIG_SERIAL_8250_CONSOLE=y
395CONFIG_SERIAL_8250_NR_UARTS=4
396# CONFIG_SERIAL_8250_EXTENDED is not set
397
398#
399# Non-8250 serial port support
400#
401CONFIG_SERIAL_CORE=y
402CONFIG_SERIAL_CORE_CONSOLE=y
403CONFIG_UNIX98_PTYS=y
404CONFIG_LEGACY_PTYS=y
405CONFIG_LEGACY_PTY_COUNT=256
406# CONFIG_QIC02_TAPE is not set
407
408#
409# IPMI
410#
411# CONFIG_IPMI_HANDLER is not set
412
413#
414# Watchdog Cards
415#
416CONFIG_WATCHDOG=y
417# CONFIG_WATCHDOG_NOWAYOUT is not set
418
419#
420# Watchdog Device Drivers
421#
422# CONFIG_SOFT_WATCHDOG is not set
423
424#
425# PCI-based Watchdog Cards
426#
427# CONFIG_PCIPCWATCHDOG is not set
428# CONFIG_WDTPCI is not set
429# CONFIG_NVRAM is not set
430CONFIG_GEN_RTC=y
431# CONFIG_GEN_RTC_X is not set
432# CONFIG_DTLK is not set
433# CONFIG_R3964 is not set
434# CONFIG_APPLICOM is not set
435
436#
437# Ftape, the floppy tape device driver
438#
439# CONFIG_FTAPE is not set
440# CONFIG_AGP is not set
441# CONFIG_DRM is not set
442# CONFIG_RAW_DRIVER is not set
443
444#
445# I2C support
446#
447CONFIG_I2C=y
448# CONFIG_I2C_CHARDEV is not set
449
450#
451# I2C Algorithms
452#
453# CONFIG_I2C_ALGOBIT is not set
454# CONFIG_I2C_ALGOPCF is not set
455
456#
457# I2C Hardware Bus support
458#
459# CONFIG_I2C_ALI1535 is not set
460# CONFIG_I2C_ALI15X3 is not set
461# CONFIG_I2C_AMD756 is not set
462# CONFIG_I2C_AMD8111 is not set
463# CONFIG_I2C_I801 is not set
464# CONFIG_I2C_I810 is not set
465# CONFIG_I2C_IBM_IIC is not set
466# CONFIG_I2C_ISA is not set
467# CONFIG_I2C_NFORCE2 is not set
468# CONFIG_I2C_PARPORT_LIGHT is not set
469# CONFIG_I2C_PIIX4 is not set
470# CONFIG_I2C_PROSAVAGE is not set
471# CONFIG_I2C_SAVAGE4 is not set
472# CONFIG_SCx200_ACB is not set
473# CONFIG_I2C_SIS5595 is not set
474# CONFIG_I2C_SIS630 is not set
475# CONFIG_I2C_SIS96X is not set
476# CONFIG_I2C_VIA is not set
477# CONFIG_I2C_VIAPRO is not set
478# CONFIG_I2C_VOODOO3 is not set
479
480#
481# Hardware Sensors Chip support
482#
483# CONFIG_I2C_SENSOR is not set
484# CONFIG_SENSORS_ADM1021 is not set
485# CONFIG_SENSORS_ASB100 is not set
486# CONFIG_SENSORS_DS1621 is not set
487# CONFIG_SENSORS_FSCHER is not set
488# CONFIG_SENSORS_GL518SM is not set
489# CONFIG_SENSORS_IT87 is not set
490# CONFIG_SENSORS_LM75 is not set
491# CONFIG_SENSORS_LM78 is not set
492# CONFIG_SENSORS_LM80 is not set
493# CONFIG_SENSORS_LM83 is not set
494# CONFIG_SENSORS_LM85 is not set
495# CONFIG_SENSORS_LM90 is not set
496# CONFIG_SENSORS_VIA686A is not set
497# CONFIG_SENSORS_W83781D is not set
498# CONFIG_SENSORS_W83L785TS is not set
499# CONFIG_SENSORS_W83627HF is not set
500
501#
502# Other I2C Chip support
503#
504# CONFIG_SENSORS_EEPROM is not set
505# CONFIG_I2C_DEBUG_CORE is not set
506# CONFIG_I2C_DEBUG_ALGO is not set
507# CONFIG_I2C_DEBUG_BUS is not set
508# CONFIG_I2C_DEBUG_CHIP is not set
509
510#
511# Misc devices
512#
513
514#
515# Multimedia devices
516#
517# CONFIG_VIDEO_DEV is not set
518
519#
520# Digital Video Broadcasting Devices
521#
522# CONFIG_DVB is not set
523
524#
525# Graphics support
526#
527# CONFIG_FB is not set
528
529#
530# Sound
531#
532# CONFIG_SOUND is not set
533
534#
535# USB support
536#
537# CONFIG_USB is not set
538
539#
540# USB Gadget Support
541#
542# CONFIG_USB_GADGET is not set
543
544#
545# File systems
546#
547CONFIG_EXT2_FS=y
548# CONFIG_EXT2_FS_XATTR is not set
549# CONFIG_EXT3_FS is not set
550# CONFIG_JBD is not set
551# CONFIG_REISERFS_FS is not set
552# CONFIG_JFS_FS is not set
553# CONFIG_XFS_FS is not set
554# CONFIG_MINIX_FS is not set
555# CONFIG_ROMFS_FS is not set
556# CONFIG_QUOTA is not set
557# CONFIG_AUTOFS_FS is not set
558# CONFIG_AUTOFS4_FS is not set
559
560#
561# CD-ROM/DVD Filesystems
562#
563# CONFIG_ISO9660_FS is not set
564# CONFIG_UDF_FS is not set
565
566#
567# DOS/FAT/NT Filesystems
568#
569# CONFIG_FAT_FS is not set
570# CONFIG_NTFS_FS is not set
571
572#
573# Pseudo filesystems
574#
575CONFIG_PROC_FS=y
576CONFIG_PROC_KCORE=y
577# CONFIG_DEVFS_FS is not set
578# CONFIG_DEVPTS_FS_XATTR is not set
579CONFIG_TMPFS=y
580# CONFIG_HUGETLB_PAGE is not set
581CONFIG_RAMFS=y
582
583#
584# Miscellaneous filesystems
585#
586# CONFIG_ADFS_FS is not set
587# CONFIG_AFFS_FS is not set
588# CONFIG_HFS_FS is not set
589# CONFIG_HFSPLUS_FS is not set
590# CONFIG_BEFS_FS is not set
591# CONFIG_BFS_FS is not set
592# CONFIG_EFS_FS is not set
593# CONFIG_CRAMFS is not set
594# CONFIG_VXFS_FS is not set
595# CONFIG_HPFS_FS is not set
596# CONFIG_QNX4FS_FS is not set
597# CONFIG_SYSV_FS is not set
598# CONFIG_UFS_FS is not set
599
600#
601# Network File Systems
602#
603CONFIG_NFS_FS=y
604# CONFIG_NFS_V3 is not set
605# CONFIG_NFS_V4 is not set
606# CONFIG_NFS_DIRECTIO is not set
607# CONFIG_NFSD is not set
608CONFIG_ROOT_NFS=y
609CONFIG_LOCKD=y
610# CONFIG_EXPORTFS is not set
611CONFIG_SUNRPC=y
612# CONFIG_RPCSEC_GSS_KRB5 is not set
613# CONFIG_SMB_FS is not set
614# CONFIG_CIFS is not set
615# CONFIG_NCP_FS is not set
616# CONFIG_CODA_FS is not set
617# CONFIG_INTERMEZZO_FS is not set
618# CONFIG_AFS_FS is not set
619
620#
621# Partition Types
622#
623CONFIG_PARTITION_ADVANCED=y
624# CONFIG_ACORN_PARTITION is not set
625# CONFIG_OSF_PARTITION is not set
626# CONFIG_AMIGA_PARTITION is not set
627# CONFIG_ATARI_PARTITION is not set
628# CONFIG_MAC_PARTITION is not set
629# CONFIG_MSDOS_PARTITION is not set
630# CONFIG_LDM_PARTITION is not set
631# CONFIG_NEC98_PARTITION is not set
632# CONFIG_SGI_PARTITION is not set
633# CONFIG_ULTRIX_PARTITION is not set
634# CONFIG_SUN_PARTITION is not set
635# CONFIG_EFI_PARTITION is not set
636
637#
638# Native Language Support
639#
640# CONFIG_NLS is not set
641
642#
643# IBM 40x options
644#
645
646#
647# Library routines
648#
649CONFIG_CRC32=y
650
651#
652# Kernel hacking
653#
654# CONFIG_DEBUG_KERNEL is not set
655# CONFIG_SERIAL_TEXT_DEBUG is not set
656CONFIG_OCP=y
657
658#
659# Security options
660#
661# CONFIG_SECURITY is not set
662
663#
664# Cryptographic options
665#
666# CONFIG_CRYPTO is not set
diff --git a/arch/ppc/configs/pcore_defconfig b/arch/ppc/configs/bamboo_defconfig
index ed34405a7574..0ba4e70d50b6 100644
--- a/arch/ppc/configs/pcore_defconfig
+++ b/arch/ppc/configs/bamboo_defconfig
@@ -1,39 +1,56 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.12
4# Tue Jun 28 15:24:25 2005
3# 5#
4CONFIG_MMU=y 6CONFIG_MMU=y
7CONFIG_GENERIC_HARDIRQS=y
5CONFIG_RWSEM_XCHGADD_ALGORITHM=y 8CONFIG_RWSEM_XCHGADD_ALGORITHM=y
9CONFIG_GENERIC_CALIBRATE_DELAY=y
6CONFIG_HAVE_DEC_LOCK=y 10CONFIG_HAVE_DEC_LOCK=y
7CONFIG_PPC=y 11CONFIG_PPC=y
8CONFIG_PPC32=y 12CONFIG_PPC32=y
9CONFIG_GENERIC_NVRAM=y 13CONFIG_GENERIC_NVRAM=y
14CONFIG_SCHED_NO_NO_OMIT_FRAME_POINTER=y
10 15
11# 16#
12# Code maturity level options 17# Code maturity level options
13# 18#
14CONFIG_EXPERIMENTAL=y 19CONFIG_EXPERIMENTAL=y
15CONFIG_CLEAN_COMPILE=y 20CONFIG_CLEAN_COMPILE=y
16CONFIG_STANDALONE=y
17CONFIG_BROKEN_ON_SMP=y 21CONFIG_BROKEN_ON_SMP=y
22CONFIG_INIT_ENV_ARG_LIMIT=32
18 23
19# 24#
20# General setup 25# General setup
21# 26#
27CONFIG_LOCALVERSION=""
22CONFIG_SWAP=y 28CONFIG_SWAP=y
23CONFIG_SYSVIPC=y 29CONFIG_SYSVIPC=y
30# CONFIG_POSIX_MQUEUE is not set
24# CONFIG_BSD_PROCESS_ACCT is not set 31# CONFIG_BSD_PROCESS_ACCT is not set
25CONFIG_SYSCTL=y 32CONFIG_SYSCTL=y
26CONFIG_LOG_BUF_SHIFT=14 33# CONFIG_AUDIT is not set
27# CONFIG_HOTPLUG is not set 34# CONFIG_HOTPLUG is not set
35CONFIG_KOBJECT_UEVENT=y
28# CONFIG_IKCONFIG is not set 36# CONFIG_IKCONFIG is not set
29CONFIG_EMBEDDED=y 37CONFIG_EMBEDDED=y
30CONFIG_KALLSYMS=y 38CONFIG_KALLSYMS=y
39# CONFIG_KALLSYMS_ALL is not set
40# CONFIG_KALLSYMS_EXTRA_PASS is not set
41CONFIG_PRINTK=y
42CONFIG_BUG=y
43CONFIG_BASE_FULL=y
31CONFIG_FUTEX=y 44CONFIG_FUTEX=y
32CONFIG_EPOLL=y 45CONFIG_EPOLL=y
33CONFIG_IOSCHED_NOOP=y
34CONFIG_IOSCHED_AS=y
35CONFIG_IOSCHED_DEADLINE=y
36# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set 46# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
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
37 54
38# 55#
39# Loadable module support 56# Loadable module support
@@ -43,67 +60,78 @@ CONFIG_MODULE_UNLOAD=y
43# CONFIG_MODULE_FORCE_UNLOAD is not set 60# CONFIG_MODULE_FORCE_UNLOAD is not set
44CONFIG_OBSOLETE_MODPARM=y 61CONFIG_OBSOLETE_MODPARM=y
45# CONFIG_MODVERSIONS is not set 62# CONFIG_MODVERSIONS is not set
63# CONFIG_MODULE_SRCVERSION_ALL is not set
46CONFIG_KMOD=y 64CONFIG_KMOD=y
47 65
48# 66#
49# Processor 67# Processor
50# 68#
51CONFIG_6xx=y 69# CONFIG_6xx is not set
52# CONFIG_40x is not set 70# CONFIG_40x is not set
53# CONFIG_44x is not set 71CONFIG_44x=y
54# CONFIG_POWER3 is not set 72# CONFIG_POWER3 is not set
55# CONFIG_POWER4 is not set 73# CONFIG_POWER4 is not set
56# CONFIG_8xx is not set 74# CONFIG_8xx is not set
57CONFIG_ALTIVEC=y 75# CONFIG_E200 is not set
58# CONFIG_TAU is not set 76# CONFIG_E500 is not set
77CONFIG_PPC_FPU=y
78CONFIG_BOOKE=y
79CONFIG_PTE_64BIT=y
80CONFIG_PHYS_64BIT=y
81# CONFIG_MATH_EMULATION is not set
82# CONFIG_KEXEC is not set
59# CONFIG_CPU_FREQ is not set 83# CONFIG_CPU_FREQ is not set
60CONFIG_PPC_STD_MMU=y 84CONFIG_4xx=y
61 85
62# 86#
63# Platform options 87# IBM 4xx options
64# 88#
65# CONFIG_PPC_MULTIPLATFORM is not set 89CONFIG_BAMBOO=y
66# CONFIG_APUS is not set 90# CONFIG_EBONY is not set
67# CONFIG_WILLOW is not set 91# CONFIG_LUAN is not set
68CONFIG_PCORE=y 92# CONFIG_OCOTEA is not set
69# CONFIG_POWERPMC250 is not set 93CONFIG_440EP=y
70# CONFIG_EV64260 is not set 94CONFIG_440=y
71# CONFIG_SPRUCE is not set 95CONFIG_IBM440EP_ERR42=y
72# CONFIG_LOPEC is not set 96CONFIG_IBM_OCP=y
73# CONFIG_MCPN765 is not set 97# CONFIG_PPC4xx_DMA is not set
74# CONFIG_MVME5100 is not set
75# CONFIG_PPLUS is not set
76# CONFIG_PRPMC750 is not set
77# CONFIG_PRPMC800 is not set
78# CONFIG_SANDPOINT is not set
79# CONFIG_ADIR is not set
80# CONFIG_K2 is not set
81# CONFIG_PAL4 is not set
82# CONFIG_GEMINI is not set
83# CONFIG_EST8260 is not set
84# CONFIG_SBS8260 is not set
85# CONFIG_RPX6 is not set
86# CONFIG_TQM8260 is not set
87CONFIG_PPC_GEN550=y 98CONFIG_PPC_GEN550=y
88CONFIG_FORCE=y 99# CONFIG_PM is not set
89# CONFIG_MPC10X_STORE_GATHERING is not set 100CONFIG_NOT_COHERENT_CACHE=y
101
102#
103# Platform options
104#
105# CONFIG_PC_KEYBOARD is not set
90# CONFIG_SMP is not set 106# CONFIG_SMP is not set
91# CONFIG_PREEMPT is not set 107# CONFIG_PREEMPT is not set
92# CONFIG_HIGHMEM is not set 108# CONFIG_HIGHMEM is not set
93CONFIG_KERNEL_ELF=y 109CONFIG_SELECT_MEMORY_MODEL=y
110CONFIG_FLATMEM_MANUAL=y
111# CONFIG_DISCONTIGMEM_MANUAL is not set
112# CONFIG_SPARSEMEM_MANUAL is not set
113CONFIG_FLATMEM=y
114CONFIG_FLAT_NODE_MEM_MAP=y
94CONFIG_BINFMT_ELF=y 115CONFIG_BINFMT_ELF=y
95# CONFIG_BINFMT_MISC is not set 116# CONFIG_BINFMT_MISC is not set
96CONFIG_CMDLINE_BOOL=y 117CONFIG_CMDLINE_BOOL=y
97CONFIG_CMDLINE="ip=on" 118CONFIG_CMDLINE="ip=on"
119CONFIG_SECCOMP=y
120CONFIG_ISA_DMA_API=y
98 121
99# 122#
100# Bus options 123# Bus options
101# 124#
102CONFIG_GENERIC_ISA_DMA=y
103CONFIG_PCI=y 125CONFIG_PCI=y
104CONFIG_PCI_DOMAINS=y 126CONFIG_PCI_DOMAINS=y
105# CONFIG_PCI_LEGACY_PROC is not set 127# CONFIG_PCI_LEGACY_PROC is not set
106# CONFIG_PCI_NAMES is not set 128# CONFIG_PCI_NAMES is not set
129# CONFIG_PCI_DEBUG is not set
130
131#
132# PCCARD (PCMCIA/CardBus) support
133#
134# CONFIG_PCCARD is not set
107 135
108# 136#
109# Advanced setup 137# Advanced setup
@@ -117,7 +145,9 @@ CONFIG_HIGHMEM_START=0xfe000000
117CONFIG_LOWMEM_SIZE=0x30000000 145CONFIG_LOWMEM_SIZE=0x30000000
118CONFIG_KERNEL_START=0xc0000000 146CONFIG_KERNEL_START=0xc0000000
119CONFIG_TASK_SIZE=0x80000000 147CONFIG_TASK_SIZE=0x80000000
120CONFIG_BOOT_LOAD=0x00800000 148CONFIG_CONSISTENT_START=0xff100000
149CONFIG_CONSISTENT_SIZE=0x00200000
150CONFIG_BOOT_LOAD=0x01000000
121 151
122# 152#
123# Device Drivers 153# Device Drivers
@@ -126,6 +156,10 @@ CONFIG_BOOT_LOAD=0x00800000
126# 156#
127# Generic Driver Options 157# Generic Driver Options
128# 158#
159# CONFIG_STANDALONE is not set
160CONFIG_PREVENT_FIRMWARE_BUILD=y
161# CONFIG_FW_LOADER is not set
162# CONFIG_DEBUG_DRIVER is not set
129 163
130# 164#
131# Memory Technology Devices (MTD) 165# Memory Technology Devices (MTD)
@@ -149,18 +183,83 @@ CONFIG_BOOT_LOAD=0x00800000
149# CONFIG_BLK_CPQ_CISS_DA is not set 183# CONFIG_BLK_CPQ_CISS_DA is not set
150# CONFIG_BLK_DEV_DAC960 is not set 184# CONFIG_BLK_DEV_DAC960 is not set
151# CONFIG_BLK_DEV_UMEM is not set 185# CONFIG_BLK_DEV_UMEM is not set
186# CONFIG_BLK_DEV_COW_COMMON is not set
152# CONFIG_BLK_DEV_LOOP is not set 187# CONFIG_BLK_DEV_LOOP is not set
153# CONFIG_BLK_DEV_NBD is not set 188# CONFIG_BLK_DEV_NBD is not set
154# CONFIG_BLK_DEV_CARMEL is not set 189# CONFIG_BLK_DEV_SX8 is not set
155CONFIG_BLK_DEV_RAM=y 190# CONFIG_BLK_DEV_UB is not set
156CONFIG_BLK_DEV_RAM_SIZE=4096 191# CONFIG_BLK_DEV_RAM is not set
157CONFIG_BLK_DEV_INITRD=y 192CONFIG_BLK_DEV_RAM_COUNT=16
193CONFIG_INITRAMFS_SOURCE=""
158# CONFIG_LBD is not set 194# CONFIG_LBD is not set
195# CONFIG_CDROM_PKTCDVD is not set
196
197#
198# IO Schedulers
199#
200CONFIG_IOSCHED_NOOP=y
201CONFIG_IOSCHED_AS=y
202CONFIG_IOSCHED_DEADLINE=y
203CONFIG_IOSCHED_CFQ=y
204# CONFIG_ATA_OVER_ETH is not set
159 205
160# 206#
161# ATA/ATAPI/MFM/RLL support 207# ATA/ATAPI/MFM/RLL support
162# 208#
163# CONFIG_IDE is not set 209CONFIG_IDE=y
210CONFIG_BLK_DEV_IDE=y
211
212#
213# Please see Documentation/ide.txt for help/info on IDE drives
214#
215# CONFIG_BLK_DEV_IDE_SATA is not set
216CONFIG_BLK_DEV_IDEDISK=y
217# CONFIG_IDEDISK_MULTI_MODE is not set
218# CONFIG_BLK_DEV_IDECD is not set
219# CONFIG_BLK_DEV_IDETAPE is not set
220# CONFIG_BLK_DEV_IDEFLOPPY is not set
221# CONFIG_BLK_DEV_IDESCSI is not set
222# CONFIG_IDE_TASK_IOCTL is not set
223
224#
225# IDE chipset support/bugfixes
226#
227CONFIG_IDE_GENERIC=y
228CONFIG_BLK_DEV_IDEPCI=y
229# CONFIG_IDEPCI_SHARE_IRQ is not set
230# CONFIG_BLK_DEV_OFFBOARD is not set
231# CONFIG_BLK_DEV_GENERIC is not set
232# CONFIG_BLK_DEV_OPTI621 is not set
233# CONFIG_BLK_DEV_SL82C105 is not set
234CONFIG_BLK_DEV_IDEDMA_PCI=y
235# CONFIG_BLK_DEV_IDEDMA_FORCED is not set
236# CONFIG_IDEDMA_PCI_AUTO is not set
237# CONFIG_BLK_DEV_AEC62XX is not set
238# CONFIG_BLK_DEV_ALI15X3 is not set
239# CONFIG_BLK_DEV_AMD74XX is not set
240CONFIG_BLK_DEV_CMD64X=y
241# CONFIG_BLK_DEV_TRIFLEX is not set
242# CONFIG_BLK_DEV_CY82C693 is not set
243# CONFIG_BLK_DEV_CS5520 is not set
244# CONFIG_BLK_DEV_CS5530 is not set
245# CONFIG_BLK_DEV_HPT34X is not set
246# CONFIG_BLK_DEV_HPT366 is not set
247# CONFIG_BLK_DEV_SC1200 is not set
248# CONFIG_BLK_DEV_PIIX is not set
249# CONFIG_BLK_DEV_IT821X is not set
250# CONFIG_BLK_DEV_NS87415 is not set
251# CONFIG_BLK_DEV_PDC202XX_OLD is not set
252# CONFIG_BLK_DEV_PDC202XX_NEW is not set
253# CONFIG_BLK_DEV_SVWKS is not set
254# CONFIG_BLK_DEV_SIIMAGE is not set
255# CONFIG_BLK_DEV_SLC90E66 is not set
256# CONFIG_BLK_DEV_TRM290 is not set
257# CONFIG_BLK_DEV_VIA82CXXX is not set
258# CONFIG_IDE_ARM is not set
259CONFIG_BLK_DEV_IDEDMA=y
260# CONFIG_IDEDMA_IVB is not set
261# CONFIG_IDEDMA_AUTO is not set
262# CONFIG_BLK_DEV_HD is not set
164 263
165# 264#
166# SCSI device support 265# SCSI device support
@@ -171,54 +270,55 @@ CONFIG_SCSI_PROC_FS=y
171# 270#
172# SCSI support type (disk, tape, CD-ROM) 271# SCSI support type (disk, tape, CD-ROM)
173# 272#
174CONFIG_BLK_DEV_SD=y 273# CONFIG_BLK_DEV_SD is not set
175# CONFIG_CHR_DEV_ST is not set 274CONFIG_CHR_DEV_ST=y
176# CONFIG_CHR_DEV_OSST is not set 275# CONFIG_CHR_DEV_OSST is not set
177CONFIG_BLK_DEV_SR=y 276# CONFIG_BLK_DEV_SR is not set
178# CONFIG_BLK_DEV_SR_VENDOR is not set
179# CONFIG_CHR_DEV_SG is not set 277# CONFIG_CHR_DEV_SG is not set
278# CONFIG_CHR_DEV_SCH is not set
180 279
181# 280#
182# Some SCSI devices (e.g. CD jukebox) support multiple LUNs 281# Some SCSI devices (e.g. CD jukebox) support multiple LUNs
183# 282#
184# CONFIG_SCSI_MULTI_LUN is not set 283# CONFIG_SCSI_MULTI_LUN is not set
185# CONFIG_SCSI_REPORT_LUNS is not set
186# CONFIG_SCSI_CONSTANTS is not set 284# CONFIG_SCSI_CONSTANTS is not set
187# CONFIG_SCSI_LOGGING is not set 285# CONFIG_SCSI_LOGGING is not set
188 286
189# 287#
190# SCSI Transport Attributes 288# SCSI Transport Attributes
191# 289#
192# CONFIG_SCSI_SPI_ATTRS is not set 290CONFIG_SCSI_SPI_ATTRS=y
193# CONFIG_SCSI_FC_ATTRS is not set 291# CONFIG_SCSI_FC_ATTRS is not set
292# CONFIG_SCSI_ISCSI_ATTRS is not set
194 293
195# 294#
196# SCSI low-level drivers 295# SCSI low-level drivers
197# 296#
198# CONFIG_BLK_DEV_3W_XXXX_RAID is not set 297# CONFIG_BLK_DEV_3W_XXXX_RAID is not set
298# CONFIG_SCSI_3W_9XXX is not set
199# CONFIG_SCSI_ACARD is not set 299# CONFIG_SCSI_ACARD is not set
200# CONFIG_SCSI_AACRAID is not set 300# CONFIG_SCSI_AACRAID is not set
201# CONFIG_SCSI_AIC7XXX is not set 301# CONFIG_SCSI_AIC7XXX is not set
202# CONFIG_SCSI_AIC7XXX_OLD is not set 302# CONFIG_SCSI_AIC7XXX_OLD is not set
203# CONFIG_SCSI_AIC79XX is not set 303# CONFIG_SCSI_AIC79XX is not set
204# CONFIG_SCSI_ADVANSYS is not set 304# CONFIG_SCSI_DPT_I2O is not set
205# CONFIG_SCSI_MEGARAID is not set 305# CONFIG_MEGARAID_NEWGEN is not set
306# CONFIG_MEGARAID_LEGACY is not set
206# CONFIG_SCSI_SATA is not set 307# CONFIG_SCSI_SATA is not set
207# CONFIG_SCSI_BUSLOGIC is not set 308# CONFIG_SCSI_BUSLOGIC is not set
208# CONFIG_SCSI_CPQFCTS is not set
209# CONFIG_SCSI_DMX3191D is not set 309# CONFIG_SCSI_DMX3191D is not set
210# CONFIG_SCSI_EATA is not set 310# CONFIG_SCSI_EATA is not set
211# CONFIG_SCSI_EATA_PIO is not set
212# CONFIG_SCSI_FUTURE_DOMAIN is not set 311# CONFIG_SCSI_FUTURE_DOMAIN is not set
213# CONFIG_SCSI_GDTH is not set 312# CONFIG_SCSI_GDTH is not set
214# CONFIG_SCSI_IPS is not set 313# CONFIG_SCSI_IPS is not set
314# CONFIG_SCSI_INITIO is not set
215# CONFIG_SCSI_INIA100 is not set 315# CONFIG_SCSI_INIA100 is not set
216CONFIG_SCSI_SYM53C8XX_2=y 316CONFIG_SCSI_SYM53C8XX_2=y
217CONFIG_SCSI_SYM53C8XX_DMA_ADDRESSING_MODE=1 317CONFIG_SCSI_SYM53C8XX_DMA_ADDRESSING_MODE=1
218CONFIG_SCSI_SYM53C8XX_DEFAULT_TAGS=16 318CONFIG_SCSI_SYM53C8XX_DEFAULT_TAGS=16
219CONFIG_SCSI_SYM53C8XX_MAX_TAGS=64 319CONFIG_SCSI_SYM53C8XX_MAX_TAGS=64
220# CONFIG_SCSI_SYM53C8XX_IOMAPPED is not set 320# CONFIG_SCSI_SYM53C8XX_IOMAPPED is not set
221# CONFIG_SCSI_QLOGIC_ISP is not set 321# CONFIG_SCSI_IPR is not set
222# CONFIG_SCSI_QLOGIC_FC is not set 322# CONFIG_SCSI_QLOGIC_FC is not set
223# CONFIG_SCSI_QLOGIC_1280 is not set 323# CONFIG_SCSI_QLOGIC_1280 is not set
224CONFIG_SCSI_QLA2XXX=y 324CONFIG_SCSI_QLA2XXX=y
@@ -227,7 +327,7 @@ CONFIG_SCSI_QLA2XXX=y
227# CONFIG_SCSI_QLA2300 is not set 327# CONFIG_SCSI_QLA2300 is not set
228# CONFIG_SCSI_QLA2322 is not set 328# CONFIG_SCSI_QLA2322 is not set
229# CONFIG_SCSI_QLA6312 is not set 329# CONFIG_SCSI_QLA6312 is not set
230# CONFIG_SCSI_QLA6322 is not set 330# CONFIG_SCSI_LPFC is not set
231# CONFIG_SCSI_DC395x is not set 331# CONFIG_SCSI_DC395x is not set
232# CONFIG_SCSI_DC390T is not set 332# CONFIG_SCSI_DC390T is not set
233# CONFIG_SCSI_NSP32 is not set 333# CONFIG_SCSI_NSP32 is not set
@@ -242,6 +342,8 @@ CONFIG_SCSI_QLA2XXX=y
242# Fusion MPT device support 342# Fusion MPT device support
243# 343#
244# CONFIG_FUSION is not set 344# CONFIG_FUSION is not set
345# CONFIG_FUSION_SPI is not set
346# CONFIG_FUSION_FC is not set
245 347
246# 348#
247# IEEE 1394 (FireWire) support 349# IEEE 1394 (FireWire) support
@@ -267,90 +369,54 @@ CONFIG_NET=y
267# 369#
268CONFIG_PACKET=y 370CONFIG_PACKET=y
269# CONFIG_PACKET_MMAP is not set 371# CONFIG_PACKET_MMAP is not set
270# CONFIG_NETLINK_DEV is not set
271CONFIG_UNIX=y 372CONFIG_UNIX=y
272# CONFIG_NET_KEY is not set 373# CONFIG_NET_KEY is not set
273CONFIG_INET=y 374CONFIG_INET=y
274CONFIG_IP_MULTICAST=y 375# CONFIG_IP_MULTICAST is not set
275# CONFIG_IP_ADVANCED_ROUTER is not set 376# CONFIG_IP_ADVANCED_ROUTER is not set
377CONFIG_IP_FIB_HASH=y
276CONFIG_IP_PNP=y 378CONFIG_IP_PNP=y
277CONFIG_IP_PNP_DHCP=y 379# CONFIG_IP_PNP_DHCP is not set
278# CONFIG_IP_PNP_BOOTP is not set 380CONFIG_IP_PNP_BOOTP=y
279# CONFIG_IP_PNP_RARP is not set 381# CONFIG_IP_PNP_RARP is not set
280# CONFIG_NET_IPIP is not set 382# CONFIG_NET_IPIP is not set
281# CONFIG_NET_IPGRE is not set 383# CONFIG_NET_IPGRE is not set
282# CONFIG_IP_MROUTE is not set
283# CONFIG_ARPD is not set 384# CONFIG_ARPD is not set
284# CONFIG_SYN_COOKIES is not set 385# CONFIG_SYN_COOKIES is not set
285# CONFIG_INET_AH is not set 386# CONFIG_INET_AH is not set
286# CONFIG_INET_ESP is not set 387# CONFIG_INET_ESP is not set
287# CONFIG_INET_IPCOMP is not set 388# CONFIG_INET_IPCOMP is not set
389# CONFIG_INET_TUNNEL is not set
390CONFIG_IP_TCPDIAG=y
391# CONFIG_IP_TCPDIAG_IPV6 is not set
392# CONFIG_TCP_CONG_ADVANCED is not set
393CONFIG_TCP_CONG_BIC=y
288 394
289# 395#
290# IP: Virtual Server Configuration 396# IP: Virtual Server Configuration
291# 397#
292# CONFIG_IP_VS is not set 398# CONFIG_IP_VS is not set
293# CONFIG_IPV6 is not set 399# CONFIG_IPV6 is not set
294# CONFIG_DECNET is not set
295# CONFIG_BRIDGE is not set
296CONFIG_NETFILTER=y 400CONFIG_NETFILTER=y
297# CONFIG_NETFILTER_DEBUG is not set 401# CONFIG_NETFILTER_DEBUG is not set
298 402
299# 403#
300# IP: Netfilter Configuration 404# IP: Netfilter Configuration
301# 405#
302CONFIG_IP_NF_CONNTRACK=m 406# CONFIG_IP_NF_CONNTRACK is not set
303CONFIG_IP_NF_FTP=m 407# CONFIG_IP_NF_CONNTRACK_MARK is not set
304CONFIG_IP_NF_IRC=m
305# CONFIG_IP_NF_TFTP is not set
306# CONFIG_IP_NF_AMANDA is not set
307# CONFIG_IP_NF_QUEUE is not set 408# CONFIG_IP_NF_QUEUE is not set
308CONFIG_IP_NF_IPTABLES=m 409# CONFIG_IP_NF_IPTABLES is not set
309CONFIG_IP_NF_MATCH_LIMIT=m 410# CONFIG_IP_NF_ARPTABLES is not set
310# CONFIG_IP_NF_MATCH_IPRANGE is not set
311CONFIG_IP_NF_MATCH_MAC=m
312CONFIG_IP_NF_MATCH_PKTTYPE=m
313CONFIG_IP_NF_MATCH_MARK=m
314CONFIG_IP_NF_MATCH_MULTIPORT=m
315CONFIG_IP_NF_MATCH_TOS=m
316# CONFIG_IP_NF_MATCH_RECENT is not set
317CONFIG_IP_NF_MATCH_ECN=m
318CONFIG_IP_NF_MATCH_DSCP=m
319CONFIG_IP_NF_MATCH_AH_ESP=m
320CONFIG_IP_NF_MATCH_LENGTH=m
321CONFIG_IP_NF_MATCH_TTL=m
322CONFIG_IP_NF_MATCH_TCPMSS=m
323CONFIG_IP_NF_MATCH_HELPER=m
324CONFIG_IP_NF_MATCH_STATE=m
325CONFIG_IP_NF_MATCH_CONNTRACK=m
326CONFIG_IP_NF_MATCH_OWNER=m
327CONFIG_IP_NF_FILTER=m
328CONFIG_IP_NF_TARGET_REJECT=m
329CONFIG_IP_NF_NAT=m
330CONFIG_IP_NF_NAT_NEEDED=y
331CONFIG_IP_NF_TARGET_MASQUERADE=m
332CONFIG_IP_NF_TARGET_REDIRECT=m
333# CONFIG_IP_NF_TARGET_NETMAP is not set
334# CONFIG_IP_NF_TARGET_SAME is not set
335# CONFIG_IP_NF_NAT_SNMP_BASIC is not set
336CONFIG_IP_NF_NAT_IRC=m
337CONFIG_IP_NF_NAT_FTP=m
338# CONFIG_IP_NF_MANGLE is not set
339# CONFIG_IP_NF_TARGET_LOG is not set
340CONFIG_IP_NF_TARGET_ULOG=m
341CONFIG_IP_NF_TARGET_TCPMSS=m
342CONFIG_IP_NF_ARPTABLES=m
343CONFIG_IP_NF_ARPFILTER=m
344# CONFIG_IP_NF_ARP_MANGLE is not set
345CONFIG_IP_NF_COMPAT_IPCHAINS=m
346# CONFIG_IP_NF_COMPAT_IPFWADM is not set
347 411
348# 412#
349# SCTP Configuration (EXPERIMENTAL) 413# SCTP Configuration (EXPERIMENTAL)
350# 414#
351# CONFIG_IP_SCTP is not set 415# CONFIG_IP_SCTP is not set
352# CONFIG_ATM is not set 416# CONFIG_ATM is not set
417# CONFIG_BRIDGE is not set
353# CONFIG_VLAN_8021Q is not set 418# CONFIG_VLAN_8021Q is not set
419# CONFIG_DECNET is not set
354# CONFIG_LLC2 is not set 420# CONFIG_LLC2 is not set
355# CONFIG_IPX is not set 421# CONFIG_IPX is not set
356# CONFIG_ATALK is not set 422# CONFIG_ATALK is not set
@@ -359,34 +425,38 @@ CONFIG_IP_NF_COMPAT_IPCHAINS=m
359# CONFIG_NET_DIVERT is not set 425# CONFIG_NET_DIVERT is not set
360# CONFIG_ECONET is not set 426# CONFIG_ECONET is not set
361# CONFIG_WAN_ROUTER is not set 427# CONFIG_WAN_ROUTER is not set
362# CONFIG_NET_HW_FLOWCONTROL is not set
363 428
364# 429#
365# QoS and/or fair queueing 430# QoS and/or fair queueing
366# 431#
367# CONFIG_NET_SCHED is not set 432# CONFIG_NET_SCHED is not set
433# CONFIG_NET_CLS_ROUTE is not set
368 434
369# 435#
370# Network testing 436# Network testing
371# 437#
372# CONFIG_NET_PKTGEN is not set 438# CONFIG_NET_PKTGEN is not set
439# CONFIG_NETPOLL is not set
440# CONFIG_NET_POLL_CONTROLLER is not set
441# CONFIG_HAMRADIO is not set
442# CONFIG_IRDA is not set
443# CONFIG_BT is not set
373CONFIG_NETDEVICES=y 444CONFIG_NETDEVICES=y
445# CONFIG_DUMMY is not set
446# CONFIG_BONDING is not set
447# CONFIG_EQUALIZER is not set
448# CONFIG_TUN is not set
374 449
375# 450#
376# ARCnet devices 451# ARCnet devices
377# 452#
378# CONFIG_ARCNET is not set 453# CONFIG_ARCNET is not set
379# CONFIG_DUMMY is not set
380# CONFIG_BONDING is not set
381# CONFIG_EQUALIZER is not set
382# CONFIG_TUN is not set
383 454
384# 455#
385# Ethernet (10 or 100Mbit) 456# Ethernet (10 or 100Mbit)
386# 457#
387CONFIG_NET_ETHERNET=y 458CONFIG_NET_ETHERNET=y
388CONFIG_MII=y 459CONFIG_MII=y
389# CONFIG_OAKNET is not set
390# CONFIG_HAPPYMEAL is not set 460# CONFIG_HAPPYMEAL is not set
391# CONFIG_SUNGEM is not set 461# CONFIG_SUNGEM is not set
392# CONFIG_NET_VENDOR_3COM is not set 462# CONFIG_NET_VENDOR_3COM is not set
@@ -394,16 +464,14 @@ CONFIG_MII=y
394# 464#
395# Tulip family network device support 465# Tulip family network device support
396# 466#
397CONFIG_NET_TULIP=y 467# CONFIG_NET_TULIP is not set
398# CONFIG_DE2104X is not set
399CONFIG_TULIP=y
400# CONFIG_TULIP_MWI is not set
401# CONFIG_TULIP_MMIO is not set
402# CONFIG_TULIP_NAPI is not set
403# CONFIG_DE4X5 is not set
404# CONFIG_WINBOND_840 is not set
405# CONFIG_DM9102 is not set
406# CONFIG_HP100 is not set 468# CONFIG_HP100 is not set
469CONFIG_IBM_EMAC=y
470# CONFIG_IBM_EMAC_ERRMSG is not set
471CONFIG_IBM_EMAC_RXB=64
472CONFIG_IBM_EMAC_TXB=8
473CONFIG_IBM_EMAC_FGAP=8
474CONFIG_IBM_EMAC_SKBRES=0
407CONFIG_NET_PCI=y 475CONFIG_NET_PCI=y
408# CONFIG_PCNET32 is not set 476# CONFIG_PCNET32 is not set
409# CONFIG_AMD8111_ETH is not set 477# CONFIG_AMD8111_ETH is not set
@@ -412,10 +480,9 @@ CONFIG_NET_PCI=y
412# CONFIG_FORCEDETH is not set 480# CONFIG_FORCEDETH is not set
413# CONFIG_DGRS is not set 481# CONFIG_DGRS is not set
414CONFIG_EEPRO100=y 482CONFIG_EEPRO100=y
415# CONFIG_EEPRO100_PIO is not set
416# CONFIG_E100 is not set 483# CONFIG_E100 is not set
417# CONFIG_FEALNX is not set 484# CONFIG_FEALNX is not set
418# CONFIG_NATSEMI is not set 485CONFIG_NATSEMI=y
419# CONFIG_NE2K_PCI is not set 486# CONFIG_NE2K_PCI is not set
420# CONFIG_8139CP is not set 487# CONFIG_8139CP is not set
421# CONFIG_8139TOO is not set 488# CONFIG_8139TOO is not set
@@ -430,59 +497,45 @@ CONFIG_EEPRO100=y
430# 497#
431# CONFIG_ACENIC is not set 498# CONFIG_ACENIC is not set
432# CONFIG_DL2K is not set 499# CONFIG_DL2K is not set
433# CONFIG_E1000 is not set 500CONFIG_E1000=y
501# CONFIG_E1000_NAPI is not set
434# CONFIG_NS83820 is not set 502# CONFIG_NS83820 is not set
435# CONFIG_HAMACHI is not set 503# CONFIG_HAMACHI is not set
436# CONFIG_YELLOWFIN is not set 504# CONFIG_YELLOWFIN is not set
437# CONFIG_R8169 is not set 505# CONFIG_R8169 is not set
438# CONFIG_SIS190 is not set 506# CONFIG_SKGE is not set
439# CONFIG_SK98LIN is not set 507# CONFIG_SK98LIN is not set
508# CONFIG_VIA_VELOCITY is not set
440# CONFIG_TIGON3 is not set 509# CONFIG_TIGON3 is not set
510# CONFIG_BNX2 is not set
441 511
442# 512#
443# Ethernet (10000 Mbit) 513# Ethernet (10000 Mbit)
444# 514#
445# CONFIG_IXGB is not set 515# CONFIG_IXGB is not set
446# CONFIG_FDDI is not set 516# CONFIG_S2IO is not set
447# CONFIG_HIPPI is not set
448# CONFIG_PPP is not set
449# CONFIG_SLIP is not set
450
451#
452# Wireless LAN (non-hamradio)
453#
454# CONFIG_NET_RADIO is not set
455 517
456# 518#
457# Token Ring devices 519# Token Ring devices
458# 520#
459# CONFIG_TR is not set 521# CONFIG_TR is not set
460# CONFIG_NET_FC is not set
461# CONFIG_RCPCI is not set
462# CONFIG_SHAPER is not set
463# CONFIG_NETCONSOLE is not set
464
465#
466# Wan interfaces
467#
468# CONFIG_WAN is not set
469
470#
471# Amateur Radio support
472#
473# CONFIG_HAMRADIO is not set
474 522
475# 523#
476# IrDA (infrared) support 524# Wireless LAN (non-hamradio)
477# 525#
478# CONFIG_IRDA is not set 526# CONFIG_NET_RADIO is not set
479 527
480# 528#
481# Bluetooth support 529# Wan interfaces
482# 530#
483# CONFIG_BT is not set 531# CONFIG_WAN is not set
484# CONFIG_NETPOLL is not set 532# CONFIG_FDDI is not set
485# CONFIG_NET_POLL_CONTROLLER is not set 533# CONFIG_HIPPI is not set
534# CONFIG_PPP is not set
535# CONFIG_SLIP is not set
536# CONFIG_NET_FC is not set
537# CONFIG_SHAPER is not set
538# CONFIG_NETCONSOLE is not set
486 539
487# 540#
488# ISDN subsystem 541# ISDN subsystem
@@ -497,23 +550,39 @@ CONFIG_EEPRO100=y
497# 550#
498# Input device support 551# Input device support
499# 552#
500# CONFIG_INPUT is not set 553CONFIG_INPUT=y
501 554
502# 555#
503# Userland interfaces 556# Userland interfaces
504# 557#
558CONFIG_INPUT_MOUSEDEV=y
559CONFIG_INPUT_MOUSEDEV_PSAUX=y
560CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024
561CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768
562# CONFIG_INPUT_JOYDEV is not set
563# CONFIG_INPUT_TSDEV is not set
564# CONFIG_INPUT_EVDEV is not set
565# CONFIG_INPUT_EVBUG is not set
505 566
506# 567#
507# Input I/O drivers 568# Input Device Drivers
508# 569#
509# CONFIG_GAMEPORT is not set 570# CONFIG_INPUT_KEYBOARD is not set
510CONFIG_SOUND_GAMEPORT=y 571# CONFIG_INPUT_MOUSE is not set
511# CONFIG_SERIO is not set 572# CONFIG_INPUT_JOYSTICK is not set
512# CONFIG_SERIO_I8042 is not set 573# CONFIG_INPUT_TOUCHSCREEN is not set
574# CONFIG_INPUT_MISC is not set
513 575
514# 576#
515# Input Device Drivers 577# Hardware I/O ports
516# 578#
579CONFIG_SERIO=y
580# CONFIG_SERIO_I8042 is not set
581# CONFIG_SERIO_SERPORT is not set
582# CONFIG_SERIO_PCIPS2 is not set
583# CONFIG_SERIO_LIBPS2 is not set
584# CONFIG_SERIO_RAW is not set
585# CONFIG_GAMEPORT is not set
517 586
518# 587#
519# Character devices 588# Character devices
@@ -526,18 +595,22 @@ CONFIG_SOUND_GAMEPORT=y
526# 595#
527CONFIG_SERIAL_8250=y 596CONFIG_SERIAL_8250=y
528CONFIG_SERIAL_8250_CONSOLE=y 597CONFIG_SERIAL_8250_CONSOLE=y
529CONFIG_SERIAL_8250_NR_UARTS=2 598CONFIG_SERIAL_8250_NR_UARTS=4
530# CONFIG_SERIAL_8250_EXTENDED is not set 599CONFIG_SERIAL_8250_EXTENDED=y
600# CONFIG_SERIAL_8250_MANY_PORTS is not set
601CONFIG_SERIAL_8250_SHARE_IRQ=y
602# CONFIG_SERIAL_8250_DETECT_IRQ is not set
603# CONFIG_SERIAL_8250_RSA is not set
531 604
532# 605#
533# Non-8250 serial port support 606# Non-8250 serial port support
534# 607#
535CONFIG_SERIAL_CORE=y 608CONFIG_SERIAL_CORE=y
536CONFIG_SERIAL_CORE_CONSOLE=y 609CONFIG_SERIAL_CORE_CONSOLE=y
610# CONFIG_SERIAL_JSM is not set
537CONFIG_UNIX98_PTYS=y 611CONFIG_UNIX98_PTYS=y
538CONFIG_LEGACY_PTYS=y 612CONFIG_LEGACY_PTYS=y
539CONFIG_LEGACY_PTY_COUNT=256 613CONFIG_LEGACY_PTY_COUNT=256
540# CONFIG_QIC02_TAPE is not set
541 614
542# 615#
543# IPMI 616# IPMI
@@ -549,8 +622,7 @@ CONFIG_LEGACY_PTY_COUNT=256
549# 622#
550# CONFIG_WATCHDOG is not set 623# CONFIG_WATCHDOG is not set
551# CONFIG_NVRAM is not set 624# CONFIG_NVRAM is not set
552CONFIG_GEN_RTC=y 625# CONFIG_GEN_RTC is not set
553# CONFIG_GEN_RTC_X is not set
554# CONFIG_DTLK is not set 626# CONFIG_DTLK is not set
555# CONFIG_R3964 is not set 627# CONFIG_R3964 is not set
556# CONFIG_APPLICOM is not set 628# CONFIG_APPLICOM is not set
@@ -558,17 +630,26 @@ CONFIG_GEN_RTC=y
558# 630#
559# Ftape, the floppy tape device driver 631# Ftape, the floppy tape device driver
560# 632#
561# CONFIG_FTAPE is not set
562# CONFIG_AGP is not set 633# CONFIG_AGP is not set
563# CONFIG_DRM is not set 634# CONFIG_DRM is not set
564# CONFIG_RAW_DRIVER is not set 635# CONFIG_RAW_DRIVER is not set
565 636
566# 637#
638# TPM devices
639#
640# CONFIG_TCG_TPM is not set
641
642#
567# I2C support 643# I2C support
568# 644#
569# CONFIG_I2C is not set 645# CONFIG_I2C is not set
570 646
571# 647#
648# Dallas's 1-wire bus
649#
650# CONFIG_W1 is not set
651
652#
572# Misc devices 653# Misc devices
573# 654#
574 655
@@ -595,7 +676,113 @@ CONFIG_GEN_RTC=y
595# 676#
596# USB support 677# USB support
597# 678#
598# CONFIG_USB is not set 679CONFIG_USB_ARCH_HAS_HCD=y
680CONFIG_USB_ARCH_HAS_OHCI=y
681CONFIG_USB=y
682CONFIG_USB_DEBUG=y
683
684#
685# Miscellaneous USB options
686#
687# CONFIG_USB_DEVICEFS is not set
688# CONFIG_USB_BANDWIDTH is not set
689# CONFIG_USB_DYNAMIC_MINORS is not set
690# CONFIG_USB_OTG is not set
691
692#
693# USB Host Controller Drivers
694#
695# CONFIG_USB_EHCI_HCD is not set
696# CONFIG_USB_ISP116X_HCD is not set
697# CONFIG_USB_OHCI_HCD is not set
698# CONFIG_USB_UHCI_HCD is not set
699# CONFIG_USB_SL811_HCD is not set
700
701#
702# USB Device Class drivers
703#
704# CONFIG_USB_BLUETOOTH_TTY is not set
705# CONFIG_USB_ACM is not set
706# CONFIG_USB_PRINTER is not set
707
708#
709# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support' may also be needed; see USB_STORAGE Help for more information
710#
711# CONFIG_USB_STORAGE is not set
712
713#
714# USB Input Devices
715#
716# CONFIG_USB_HID is not set
717
718#
719# USB HID Boot Protocol drivers
720#
721# CONFIG_USB_KBD is not set
722# CONFIG_USB_MOUSE is not set
723# CONFIG_USB_AIPTEK is not set
724# CONFIG_USB_WACOM is not set
725# CONFIG_USB_ACECAD is not set
726# CONFIG_USB_KBTAB is not set
727# CONFIG_USB_POWERMATE is not set
728# CONFIG_USB_MTOUCH is not set
729# CONFIG_USB_ITMTOUCH is not set
730# CONFIG_USB_EGALAX is not set
731# CONFIG_USB_XPAD is not set
732# CONFIG_USB_ATI_REMOTE is not set
733
734#
735# USB Imaging devices
736#
737# CONFIG_USB_MDC800 is not set
738# CONFIG_USB_MICROTEK is not set
739
740#
741# USB Multimedia devices
742#
743# CONFIG_USB_DABUSB is not set
744
745#
746# Video4Linux support is needed for USB Multimedia device support
747#
748
749#
750# USB Network Adapters
751#
752# CONFIG_USB_CATC is not set
753# CONFIG_USB_KAWETH is not set
754CONFIG_USB_PEGASUS=y
755# CONFIG_USB_RTL8150 is not set
756# CONFIG_USB_USBNET is not set
757CONFIG_USB_MON=y
758
759#
760# USB port drivers
761#
762
763#
764# USB Serial Converter support
765#
766# CONFIG_USB_SERIAL is not set
767
768#
769# USB Miscellaneous drivers
770#
771# CONFIG_USB_EMI62 is not set
772# CONFIG_USB_EMI26 is not set
773# CONFIG_USB_AUERSWALD is not set
774# CONFIG_USB_RIO500 is not set
775# CONFIG_USB_LEGOTOWER is not set
776# CONFIG_USB_LCD is not set
777# CONFIG_USB_LED is not set
778# CONFIG_USB_CYTHERM is not set
779# CONFIG_USB_PHIDGETKIT is not set
780# CONFIG_USB_PHIDGETSERVO is not set
781# CONFIG_USB_IDMOUSE is not set
782
783#
784# USB DSL modem support
785#
599 786
600# 787#
601# USB Gadget Support 788# USB Gadget Support
@@ -603,23 +790,36 @@ CONFIG_GEN_RTC=y
603# CONFIG_USB_GADGET is not set 790# CONFIG_USB_GADGET is not set
604 791
605# 792#
793# MMC/SD Card support
794#
795# CONFIG_MMC is not set
796
797#
798# InfiniBand support
799#
800# CONFIG_INFINIBAND is not set
801
802#
803# SN Devices
804#
805
806#
606# File systems 807# File systems
607# 808#
608CONFIG_EXT2_FS=y 809# CONFIG_EXT2_FS is not set
609# CONFIG_EXT2_FS_XATTR is not set 810# CONFIG_EXT3_FS is not set
610CONFIG_EXT3_FS=y 811# CONFIG_JBD is not set
611CONFIG_EXT3_FS_XATTR=y
612# CONFIG_EXT3_FS_POSIX_ACL is not set
613# CONFIG_EXT3_FS_SECURITY is not set
614CONFIG_JBD=y
615# CONFIG_JBD_DEBUG is not set
616CONFIG_FS_MBCACHE=y
617# CONFIG_REISERFS_FS is not set 812# CONFIG_REISERFS_FS is not set
618# CONFIG_JFS_FS is not set 813# CONFIG_JFS_FS is not set
814
815#
816# XFS support
817#
619# CONFIG_XFS_FS is not set 818# CONFIG_XFS_FS is not set
620# CONFIG_MINIX_FS is not set 819# CONFIG_MINIX_FS is not set
621# CONFIG_ROMFS_FS is not set 820# CONFIG_ROMFS_FS is not set
622# CONFIG_QUOTA is not set 821# CONFIG_QUOTA is not set
822CONFIG_DNOTIFY=y
623# CONFIG_AUTOFS_FS is not set 823# CONFIG_AUTOFS_FS is not set
624# CONFIG_AUTOFS4_FS is not set 824# CONFIG_AUTOFS4_FS is not set
625 825
@@ -632,7 +832,8 @@ CONFIG_FS_MBCACHE=y
632# 832#
633# DOS/FAT/NT Filesystems 833# DOS/FAT/NT Filesystems
634# 834#
635# CONFIG_FAT_FS is not set 835# CONFIG_MSDOS_FS is not set
836# CONFIG_VFAT_FS is not set
636# CONFIG_NTFS_FS is not set 837# CONFIG_NTFS_FS is not set
637 838
638# 839#
@@ -640,9 +841,9 @@ CONFIG_FS_MBCACHE=y
640# 841#
641CONFIG_PROC_FS=y 842CONFIG_PROC_FS=y
642CONFIG_PROC_KCORE=y 843CONFIG_PROC_KCORE=y
643# CONFIG_DEVFS_FS is not set 844CONFIG_SYSFS=y
644# CONFIG_DEVPTS_FS_XATTR is not set 845# CONFIG_DEVPTS_FS_XATTR is not set
645CONFIG_TMPFS=y 846# CONFIG_TMPFS is not set
646# CONFIG_HUGETLB_PAGE is not set 847# CONFIG_HUGETLB_PAGE is not set
647CONFIG_RAMFS=y 848CONFIG_RAMFS=y
648 849
@@ -673,14 +874,14 @@ CONFIG_NFS_FS=y
673# CONFIG_NFSD is not set 874# CONFIG_NFSD is not set
674CONFIG_ROOT_NFS=y 875CONFIG_ROOT_NFS=y
675CONFIG_LOCKD=y 876CONFIG_LOCKD=y
676# CONFIG_EXPORTFS is not set 877CONFIG_NFS_COMMON=y
677CONFIG_SUNRPC=y 878CONFIG_SUNRPC=y
678# CONFIG_RPCSEC_GSS_KRB5 is not set 879# CONFIG_RPCSEC_GSS_KRB5 is not set
880# CONFIG_RPCSEC_GSS_SPKM3 is not set
679# CONFIG_SMB_FS is not set 881# CONFIG_SMB_FS is not set
680# CONFIG_CIFS is not set 882# CONFIG_CIFS is not set
681# CONFIG_NCP_FS is not set 883# CONFIG_NCP_FS is not set
682# CONFIG_CODA_FS is not set 884# CONFIG_CODA_FS is not set
683# CONFIG_INTERMEZZO_FS is not set
684# CONFIG_AFS_FS is not set 885# CONFIG_AFS_FS is not set
685 886
686# 887#
@@ -697,20 +898,46 @@ CONFIG_MSDOS_PARTITION=y
697# 898#
698# Library routines 899# Library routines
699# 900#
901# CONFIG_CRC_CCITT is not set
700CONFIG_CRC32=y 902CONFIG_CRC32=y
903# CONFIG_LIBCRC32C is not set
904
905#
906# Profiling support
907#
908# CONFIG_PROFILING is not set
701 909
702# 910#
703# Kernel hacking 911# Kernel hacking
704# 912#
705# CONFIG_DEBUG_KERNEL is not set 913# CONFIG_PRINTK_TIME is not set
914CONFIG_DEBUG_KERNEL=y
915CONFIG_MAGIC_SYSRQ=y
916CONFIG_LOG_BUF_SHIFT=14
917# CONFIG_SCHEDSTATS is not set
918# CONFIG_DEBUG_SLAB is not set
919# CONFIG_DEBUG_SPINLOCK is not set
920# CONFIG_DEBUG_SPINLOCK_SLEEP is not set
921# CONFIG_DEBUG_KOBJECT is not set
922CONFIG_DEBUG_INFO=y
923# CONFIG_DEBUG_FS is not set
924# CONFIG_KGDB is not set
925# CONFIG_XMON is not set
926CONFIG_BDI_SWITCH=y
706# CONFIG_SERIAL_TEXT_DEBUG is not set 927# CONFIG_SERIAL_TEXT_DEBUG is not set
928CONFIG_PPC_OCP=y
707 929
708# 930#
709# Security options 931# Security options
710# 932#
933# CONFIG_KEYS is not set
711# CONFIG_SECURITY is not set 934# CONFIG_SECURITY is not set
712 935
713# 936#
714# Cryptographic options 937# Cryptographic options
715# 938#
716# CONFIG_CRYPTO is not set 939# CONFIG_CRYPTO is not set
940
941#
942# Hardware crypto devices
943#
diff --git a/arch/ppc/configs/beech_defconfig b/arch/ppc/configs/beech_defconfig
deleted file mode 100644
index 0bd671bdceb4..000000000000
--- a/arch/ppc/configs/beech_defconfig
+++ /dev/null
@@ -1,615 +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
9
10#
11# Code maturity level options
12#
13CONFIG_EXPERIMENTAL=y
14CONFIG_CLEAN_COMPILE=y
15# CONFIG_STANDALONE is not set
16CONFIG_BROKEN_ON_SMP=y
17
18#
19# General setup
20#
21# CONFIG_SWAP is not set
22CONFIG_SYSVIPC=y
23# CONFIG_BSD_PROCESS_ACCT is not set
24CONFIG_SYSCTL=y
25CONFIG_LOG_BUF_SHIFT=14
26# CONFIG_IKCONFIG is not set
27CONFIG_EMBEDDED=y
28# CONFIG_KALLSYMS is not set
29CONFIG_FUTEX=y
30# CONFIG_EPOLL is not set
31CONFIG_IOSCHED_NOOP=y
32CONFIG_IOSCHED_AS=y
33CONFIG_IOSCHED_DEADLINE=y
34
35#
36# Loadable module support
37#
38CONFIG_MODULES=y
39CONFIG_MODULE_UNLOAD=y
40# CONFIG_MODULE_FORCE_UNLOAD is not set
41CONFIG_OBSOLETE_MODPARM=y
42CONFIG_MODVERSIONS=y
43CONFIG_KMOD=y
44
45#
46# Processor
47#
48# CONFIG_6xx is not set
49CONFIG_40x=y
50# CONFIG_44x is not set
51# CONFIG_POWER3 is not set
52# CONFIG_POWER4 is not set
53# CONFIG_8xx is not set
54# CONFIG_MATH_EMULATION is not set
55# CONFIG_CPU_FREQ is not set
56CONFIG_4xx=y
57
58#
59# IBM 4xx options
60#
61# CONFIG_ASH is not set
62CONFIG_BEECH=y
63# CONFIG_CEDAR is not set
64# CONFIG_CPCI405 is not set
65# CONFIG_EP405 is not set
66# CONFIG_OAK is not set
67# CONFIG_REDWOOD_4 is not set
68# CONFIG_REDWOOD_5 is not set
69# CONFIG_REDWOOD_6 is not set
70# CONFIG_SYCAMORE is not set
71# CONFIG_TIVO is not set
72# CONFIG_WALNUT is not set
73CONFIG_IBM405_ERR77=y
74CONFIG_IBM405_ERR51=y
75CONFIG_IBM_OCP=y
76CONFIG_IBM_OPENBIOS=y
77CONFIG_405_DMA=y
78# CONFIG_PM is not set
79CONFIG_UART0_TTYS0=y
80# CONFIG_UART0_TTYS1 is not set
81CONFIG_NOT_COHERENT_CACHE=y
82
83#
84# Platform options
85#
86# CONFIG_PC_KEYBOARD is not set
87# CONFIG_SMP is not set
88# CONFIG_PREEMPT is not set
89# CONFIG_HIGHMEM is not set
90CONFIG_KERNEL_ELF=y
91CONFIG_BINFMT_ELF=y
92# CONFIG_BINFMT_MISC is not set
93# CONFIG_CMDLINE_BOOL is not set
94
95#
96# Bus options
97#
98# CONFIG_PCI is not set
99# CONFIG_PCI_DOMAINS is not set
100# CONFIG_HOTPLUG is not set
101
102#
103# Parallel port support
104#
105# CONFIG_PARPORT is not set
106
107#
108# Advanced setup
109#
110# CONFIG_ADVANCED_OPTIONS is not set
111
112#
113# Default settings for advanced configuration options are used
114#
115CONFIG_HIGHMEM_START=0xfe000000
116CONFIG_LOWMEM_SIZE=0x30000000
117CONFIG_KERNEL_START=0xc0000000
118CONFIG_TASK_SIZE=0x80000000
119CONFIG_BOOT_LOAD=0x00400000
120
121#
122# Generic Driver Options
123#
124
125#
126# Memory Technology Devices (MTD)
127#
128CONFIG_MTD=y
129# CONFIG_MTD_DEBUG is not set
130CONFIG_MTD_PARTITIONS=y
131# CONFIG_MTD_CONCAT is not set
132# CONFIG_MTD_REDBOOT_PARTS is not set
133# CONFIG_MTD_CMDLINE_PARTS is not set
134
135#
136# User Modules And Translation Layers
137#
138CONFIG_MTD_CHAR=y
139CONFIG_MTD_BLOCK=y
140# CONFIG_FTL is not set
141# CONFIG_NFTL is not set
142# CONFIG_INFTL is not set
143
144#
145# RAM/ROM/Flash chip drivers
146#
147CONFIG_MTD_CFI=y
148CONFIG_MTD_JEDECPROBE=y
149CONFIG_MTD_GEN_PROBE=y
150# CONFIG_MTD_CFI_ADV_OPTIONS is not set
151# CONFIG_MTD_CFI_INTELEXT is not set
152CONFIG_MTD_CFI_AMDSTD=y
153# CONFIG_MTD_CFI_STAA is not set
154# CONFIG_MTD_RAM is not set
155# CONFIG_MTD_ROM is not set
156# CONFIG_MTD_ABSENT is not set
157# CONFIG_MTD_OBSOLETE_CHIPS is not set
158
159#
160# Mapping drivers for chip access
161#
162# CONFIG_MTD_COMPLEX_MAPPINGS is not set
163# CONFIG_MTD_PHYSMAP is not set
164CONFIG_MTD_BEECH=y
165
166#
167# Self-contained MTD device drivers
168#
169# CONFIG_MTD_SLRAM is not set
170# CONFIG_MTD_MTDRAM is not set
171# CONFIG_MTD_BLKMTD is not set
172
173#
174# Disk-On-Chip Device Drivers
175#
176# CONFIG_MTD_DOC2000 is not set
177# CONFIG_MTD_DOC2001 is not set
178# CONFIG_MTD_DOC2001PLUS is not set
179
180#
181# NAND Flash Device Drivers
182#
183# CONFIG_MTD_NAND is not set
184
185#
186# Plug and Play support
187#
188# CONFIG_PNP is not set
189
190#
191# Block devices
192#
193CONFIG_BLK_DEV_LOOP=y
194# CONFIG_BLK_DEV_CRYPTOLOOP is not set
195# CONFIG_BLK_DEV_NBD is not set
196CONFIG_BLK_DEV_RAM=y
197CONFIG_BLK_DEV_RAM_SIZE=4096
198CONFIG_BLK_DEV_INITRD=y
199# CONFIG_LBD is not set
200
201#
202# Multi-device support (RAID and LVM)
203#
204# CONFIG_MD is not set
205
206#
207# ATA/ATAPI/MFM/RLL support
208#
209# CONFIG_IDE is not set
210
211#
212# SCSI device support
213#
214# CONFIG_SCSI is not set
215
216#
217# Fusion MPT device support
218#
219
220#
221# I2O device support
222#
223
224#
225# Networking support
226#
227CONFIG_NET=y
228
229#
230# Networking options
231#
232# CONFIG_PACKET is not set
233# CONFIG_NETLINK_DEV is not set
234CONFIG_UNIX=y
235# CONFIG_NET_KEY is not set
236CONFIG_INET=y
237CONFIG_IP_MULTICAST=y
238# CONFIG_IP_ADVANCED_ROUTER is not set
239CONFIG_IP_PNP=y
240# CONFIG_IP_PNP_DHCP is not set
241CONFIG_IP_PNP_BOOTP=y
242CONFIG_IP_PNP_RARP=y
243# CONFIG_NET_IPIP is not set
244# CONFIG_NET_IPGRE is not set
245# CONFIG_IP_MROUTE is not set
246# CONFIG_ARPD is not set
247# CONFIG_INET_ECN is not set
248CONFIG_SYN_COOKIES=y
249# CONFIG_INET_AH is not set
250# CONFIG_INET_ESP is not set
251# CONFIG_INET_IPCOMP is not set
252# CONFIG_IPV6 is not set
253# CONFIG_DECNET is not set
254# CONFIG_BRIDGE is not set
255# CONFIG_NETFILTER is not set
256
257#
258# SCTP Configuration (EXPERIMENTAL)
259#
260CONFIG_IPV6_SCTP__=y
261# CONFIG_IP_SCTP is not set
262# CONFIG_ATM is not set
263# CONFIG_VLAN_8021Q is not set
264# CONFIG_LLC2 is not set
265# CONFIG_IPX is not set
266# CONFIG_ATALK is not set
267# CONFIG_X25 is not set
268# CONFIG_LAPB is not set
269# CONFIG_NET_DIVERT is not set
270# CONFIG_ECONET is not set
271# CONFIG_WAN_ROUTER is not set
272# CONFIG_NET_HW_FLOWCONTROL is not set
273
274#
275# QoS and/or fair queueing
276#
277# CONFIG_NET_SCHED is not set
278
279#
280# Network testing
281#
282# CONFIG_NET_PKTGEN is not set
283CONFIG_NETDEVICES=y
284# CONFIG_DUMMY is not set
285# CONFIG_BONDING is not set
286# CONFIG_EQUALIZER is not set
287# CONFIG_TUN is not set
288
289#
290# Ethernet (10 or 100Mbit)
291#
292CONFIG_NET_ETHERNET=y
293# CONFIG_MII is not set
294# CONFIG_OAKNET is not set
295
296#
297# Ethernet (1000 Mbit)
298#
299
300#
301# Ethernet (10000 Mbit)
302#
303# CONFIG_PPP is not set
304# CONFIG_SLIP is not set
305
306#
307# Wireless LAN (non-hamradio)
308#
309# CONFIG_NET_RADIO is not set
310
311#
312# Token Ring devices
313#
314# CONFIG_SHAPER is not set
315
316#
317# Wan interfaces
318#
319# CONFIG_WAN is not set
320
321#
322# Amateur Radio support
323#
324# CONFIG_HAMRADIO is not set
325
326#
327# IrDA (infrared) support
328#
329# CONFIG_IRDA is not set
330
331#
332# Bluetooth support
333#
334# CONFIG_BT is not set
335
336#
337# ISDN subsystem
338#
339# CONFIG_ISDN_BOOL is not set
340
341#
342# Graphics support
343#
344CONFIG_FB=y
345# CONFIG_FB_CT65550 is not set
346# CONFIG_FB_S3TRIO is not set
347# CONFIG_FB_VGA16 is not set
348# CONFIG_FB_VIRTUAL is not set
349
350#
351# Logo configuration
352#
353# CONFIG_LOGO is not set
354
355#
356# Input device support
357#
358CONFIG_INPUT=y
359
360#
361# Userland interfaces
362#
363# CONFIG_INPUT_MOUSEDEV is not set
364# CONFIG_INPUT_JOYDEV is not set
365# CONFIG_INPUT_TSDEV is not set
366# CONFIG_INPUT_EVDEV is not set
367# CONFIG_INPUT_EVBUG is not set
368
369#
370# Input I/O drivers
371#
372# CONFIG_GAMEPORT is not set
373CONFIG_SOUND_GAMEPORT=y
374CONFIG_SERIO=y
375# CONFIG_SERIO_I8042 is not set
376# CONFIG_SERIO_SERPORT is not set
377# CONFIG_SERIO_CT82C710 is not set
378
379#
380# Input Device Drivers
381#
382# CONFIG_INPUT_KEYBOARD is not set
383# CONFIG_INPUT_MOUSE is not set
384# CONFIG_INPUT_JOYSTICK is not set
385# CONFIG_INPUT_TOUCHSCREEN is not set
386# CONFIG_INPUT_MISC is not set
387
388#
389# Macintosh device drivers
390#
391
392#
393# Character devices
394#
395# CONFIG_VT is not set
396# CONFIG_SERIAL_NONSTANDARD is not set
397
398#
399# Serial drivers
400#
401CONFIG_SERIAL_8250=y
402CONFIG_SERIAL_8250_CONSOLE=y
403CONFIG_SERIAL_8250_NR_UARTS=4
404# CONFIG_SERIAL_8250_EXTENDED is not set
405
406#
407# Non-8250 serial port support
408#
409CONFIG_SERIAL_CORE=y
410CONFIG_SERIAL_CORE_CONSOLE=y
411CONFIG_UNIX98_PTYS=y
412CONFIG_UNIX98_PTY_COUNT=256
413
414#
415# I2C support
416#
417CONFIG_I2C=y
418# CONFIG_I2C_CHARDEV is not set
419
420#
421# I2C Algorithms
422#
423# CONFIG_I2C_ALGOBIT is not set
424# CONFIG_I2C_ALGOPCF is not set
425
426#
427# I2C Hardware Bus support
428#
429# CONFIG_I2C_AMD756 is not set
430# CONFIG_I2C_AMD8111 is not set
431CONFIG_I2C_IBM_IIC=y
432
433#
434# I2C Hardware Sensors Chip support
435#
436# CONFIG_I2C_SENSOR is not set
437# CONFIG_SENSORS_ADM1021 is not set
438# CONFIG_SENSORS_EEPROM is not set
439# CONFIG_SENSORS_IT87 is not set
440# CONFIG_SENSORS_LM75 is not set
441# CONFIG_SENSORS_LM78 is not set
442# CONFIG_SENSORS_LM85 is not set
443# CONFIG_SENSORS_VIA686A is not set
444# CONFIG_SENSORS_W83781D is not set
445
446#
447# Mice
448#
449# CONFIG_BUSMOUSE is not set
450# CONFIG_QIC02_TAPE 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
462CONFIG_GEN_RTC=y
463# CONFIG_GEN_RTC_X is not set
464# CONFIG_DTLK is not set
465# CONFIG_R3964 is not set
466# CONFIG_APPLICOM is not set
467
468#
469# Ftape, the floppy tape device driver
470#
471# CONFIG_FTAPE is not set
472# CONFIG_AGP is not set
473# CONFIG_DRM is not set
474# CONFIG_RAW_DRIVER is not set
475
476#
477# Multimedia devices
478#
479# CONFIG_VIDEO_DEV is not set
480
481#
482# Digital Video Broadcasting Devices
483#
484# CONFIG_DVB is not set
485
486#
487# File systems
488#
489CONFIG_EXT2_FS=y
490# CONFIG_EXT2_FS_XATTR is not set
491# CONFIG_EXT3_FS is not set
492# CONFIG_JBD is not set
493# CONFIG_REISERFS_FS is not set
494# CONFIG_JFS_FS is not set
495# CONFIG_XFS_FS is not set
496# CONFIG_MINIX_FS is not set
497# CONFIG_ROMFS_FS is not set
498# CONFIG_QUOTA is not set
499# CONFIG_AUTOFS_FS is not set
500# CONFIG_AUTOFS4_FS is not set
501
502#
503# CD-ROM/DVD Filesystems
504#
505# CONFIG_ISO9660_FS is not set
506# CONFIG_UDF_FS is not set
507
508#
509# DOS/FAT/NT Filesystems
510#
511# CONFIG_FAT_FS is not set
512# CONFIG_NTFS_FS is not set
513
514#
515# Pseudo filesystems
516#
517CONFIG_PROC_FS=y
518CONFIG_PROC_KCORE=y
519CONFIG_DEVFS_FS=y
520# CONFIG_DEVFS_MOUNT is not set
521# CONFIG_DEVFS_DEBUG is not set
522CONFIG_DEVPTS_FS=y
523# CONFIG_DEVPTS_FS_XATTR is not set
524CONFIG_TMPFS=y
525# CONFIG_HUGETLB_PAGE is not set
526CONFIG_RAMFS=y
527
528#
529# Miscellaneous filesystems
530#
531# CONFIG_ADFS_FS is not set
532# CONFIG_AFFS_FS is not set
533# CONFIG_HFS_FS is not set
534# CONFIG_BEFS_FS is not set
535# CONFIG_BFS_FS is not set
536# CONFIG_EFS_FS is not set
537# CONFIG_JFFS_FS is not set
538# CONFIG_JFFS2_FS is not set
539# CONFIG_CRAMFS is not set
540# CONFIG_VXFS_FS is not set
541# CONFIG_HPFS_FS is not set
542# CONFIG_QNX4FS_FS is not set
543# CONFIG_SYSV_FS is not set
544# CONFIG_UFS_FS is not set
545
546#
547# Network File Systems
548#
549CONFIG_NFS_FS=y
550# CONFIG_NFS_V3 is not set
551# CONFIG_NFS_V4 is not set
552# CONFIG_NFSD is not set
553CONFIG_ROOT_NFS=y
554CONFIG_LOCKD=y
555# CONFIG_EXPORTFS is not set
556CONFIG_SUNRPC=y
557# CONFIG_SUNRPC_GSS is not set
558# CONFIG_SMB_FS is not set
559# CONFIG_CIFS is not set
560# CONFIG_NCP_FS is not set
561# CONFIG_CODA_FS is not set
562# CONFIG_INTERMEZZO_FS is not set
563# CONFIG_AFS_FS is not set
564
565#
566# Partition Types
567#
568# CONFIG_PARTITION_ADVANCED is not set
569CONFIG_MSDOS_PARTITION=y
570
571#
572# Sound
573#
574CONFIG_SOUND=y
575
576#
577# Advanced Linux Sound Architecture
578#
579# CONFIG_SND is not set
580
581#
582# Open Sound System
583#
584# CONFIG_SOUND_PRIME is not set
585
586#
587# IBM 40x options
588#
589
590#
591# USB support
592#
593# CONFIG_USB_GADGET is not set
594
595#
596# Library routines
597#
598# CONFIG_CRC32 is not set
599
600#
601# Kernel hacking
602#
603# CONFIG_DEBUG_KERNEL is not set
604# CONFIG_SERIAL_TEXT_DEBUG is not set
605CONFIG_OCP=y
606
607#
608# Security options
609#
610# CONFIG_SECURITY is not set
611
612#
613# Cryptographic options
614#
615# CONFIG_CRYPTO is not set
diff --git a/arch/ppc/configs/cedar_defconfig b/arch/ppc/configs/cedar_defconfig
deleted file mode 100644
index 5de8288a0673..000000000000
--- a/arch/ppc/configs/cedar_defconfig
+++ /dev/null
@@ -1,534 +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
7
8#
9# Code maturity level options
10#
11CONFIG_EXPERIMENTAL=y
12
13#
14# General setup
15#
16CONFIG_SWAP=y
17CONFIG_SYSVIPC=y
18# CONFIG_BSD_PROCESS_ACCT is not set
19CONFIG_SYSCTL=y
20CONFIG_LOG_BUF_SHIFT=14
21CONFIG_EMBEDDED=y
22CONFIG_FUTEX=y
23# CONFIG_EPOLL is not set
24
25#
26# Loadable module support
27#
28CONFIG_MODULES=y
29CONFIG_MODULE_UNLOAD=y
30# CONFIG_MODULE_FORCE_UNLOAD is not set
31CONFIG_OBSOLETE_MODPARM=y
32# CONFIG_MODVERSIONS is not set
33CONFIG_KMOD=y
34
35#
36# Platform support
37#
38CONFIG_PPC=y
39CONFIG_PPC32=y
40# CONFIG_6xx is not set
41CONFIG_40x=y
42# CONFIG_POWER3 is not set
43# CONFIG_8xx is not set
44CONFIG_4xx=y
45
46#
47# IBM 4xx options
48#
49# CONFIG_ASH is not set
50# CONFIG_BEECH is not set
51CONFIG_CEDAR=y
52# CONFIG_CPCI405 is not set
53# CONFIG_EP405 is not set
54# CONFIG_OAK is not set
55# CONFIG_REDWOOD_4 is not set
56# CONFIG_REDWOOD_5 is not set
57# CONFIG_REDWOOD_6 is not set
58# CONFIG_SYCAMORE is not set
59# CONFIG_TIVO is not set
60# CONFIG_WALNUT is not set
61CONFIG_IBM405_ERR77=y
62CONFIG_IBM405_ERR51=y
63CONFIG_IBM_OCP=y
64CONFIG_NP405L=y
65CONFIG_BIOS_FIXUP=y
66CONFIG_IBM_OPENBIOS=y
67# CONFIG_405_DMA is not set
68# CONFIG_PM is not set
69CONFIG_UART0_TTYS0=y
70# CONFIG_UART0_TTYS1 is not set
71CONFIG_NOT_COHERENT_CACHE=y
72# CONFIG_SMP is not set
73# CONFIG_PREEMPT is not set
74# CONFIG_MATH_EMULATION is not set
75# CONFIG_CPU_FREQ is not set
76
77#
78# General setup
79#
80# CONFIG_HIGHMEM is not set
81# CONFIG_PCI is not set
82# CONFIG_PCI_DOMAINS is not set
83# CONFIG_PC_KEYBOARD is not set
84CONFIG_KCORE_ELF=y
85CONFIG_BINFMT_ELF=y
86CONFIG_KERNEL_ELF=y
87# CONFIG_BINFMT_MISC is not set
88# CONFIG_HOTPLUG is not set
89
90#
91# Parallel port support
92#
93# CONFIG_PARPORT is not set
94# CONFIG_CMDLINE_BOOL is not set
95
96#
97# Advanced setup
98#
99# CONFIG_ADVANCED_OPTIONS is not set
100
101#
102# Default settings for advanced configuration options are used
103#
104CONFIG_HIGHMEM_START=0xfe000000
105CONFIG_LOWMEM_SIZE=0x30000000
106CONFIG_KERNEL_START=0xc0000000
107CONFIG_TASK_SIZE=0x80000000
108CONFIG_BOOT_LOAD=0x00400000
109
110#
111# Memory Technology Devices (MTD)
112#
113# CONFIG_MTD is not set
114
115#
116# Plug and Play support
117#
118# CONFIG_PNP is not set
119
120#
121# Block devices
122#
123# CONFIG_BLK_DEV_FD is not set
124CONFIG_BLK_DEV_LOOP=y
125# CONFIG_BLK_DEV_NBD is not set
126CONFIG_BLK_DEV_RAM=y
127CONFIG_BLK_DEV_RAM_SIZE=4096
128CONFIG_BLK_DEV_INITRD=y
129
130#
131# Multi-device support (RAID and LVM)
132#
133# CONFIG_MD is not set
134
135#
136# ATA/IDE/MFM/RLL support
137#
138# CONFIG_IDE is not set
139
140#
141# SCSI support
142#
143# CONFIG_SCSI is not set
144
145#
146# Fusion MPT device support
147#
148
149#
150# I2O device support
151#
152
153#
154# Networking support
155#
156CONFIG_NET=y
157
158#
159# Networking options
160#
161# CONFIG_PACKET is not set
162# CONFIG_NETLINK_DEV is not set
163# CONFIG_NETFILTER is not set
164CONFIG_UNIX=y
165# CONFIG_NET_KEY is not set
166CONFIG_INET=y
167CONFIG_IP_MULTICAST=y
168# CONFIG_IP_ADVANCED_ROUTER is not set
169CONFIG_IP_PNP=y
170CONFIG_IP_PNP_DHCP=y
171CONFIG_IP_PNP_BOOTP=y
172CONFIG_IP_PNP_RARP=y
173# CONFIG_NET_IPIP is not set
174# CONFIG_NET_IPGRE is not set
175# CONFIG_IP_MROUTE is not set
176# CONFIG_ARPD is not set
177# CONFIG_INET_ECN is not set
178CONFIG_SYN_COOKIES=y
179# CONFIG_INET_AH is not set
180# CONFIG_INET_ESP is not set
181# CONFIG_INET_IPCOMP is not set
182# CONFIG_IPV6 is not set
183# CONFIG_XFRM_USER is not set
184
185#
186# SCTP Configuration (EXPERIMENTAL)
187#
188CONFIG_IPV6_SCTP__=y
189# CONFIG_IP_SCTP is not set
190# CONFIG_ATM is not set
191# CONFIG_VLAN_8021Q is not set
192# CONFIG_LLC is not set
193# CONFIG_DECNET is not set
194# CONFIG_BRIDGE is not set
195# CONFIG_X25 is not set
196# CONFIG_LAPB is not set
197# CONFIG_NET_DIVERT is not set
198# CONFIG_ECONET is not set
199# CONFIG_WAN_ROUTER is not set
200# CONFIG_NET_HW_FLOWCONTROL is not set
201
202#
203# QoS and/or fair queueing
204#
205# CONFIG_NET_SCHED is not set
206
207#
208# Network testing
209#
210# CONFIG_NET_PKTGEN is not set
211CONFIG_NETDEVICES=y
212# CONFIG_DUMMY is not set
213# CONFIG_BONDING is not set
214# CONFIG_EQUALIZER is not set
215# CONFIG_TUN is not set
216# CONFIG_ETHERTAP is not set
217
218#
219# Ethernet (10 or 100Mbit)
220#
221# CONFIG_NET_ETHERNET is not set
222
223#
224# Ethernet (1000 Mbit)
225#
226
227#
228# Ethernet (10000 Mbit)
229#
230# CONFIG_PPP is not set
231# CONFIG_SLIP is not set
232
233#
234# Wireless LAN (non-hamradio)
235#
236# CONFIG_NET_RADIO is not set
237
238#
239# Token Ring devices (depends on LLC=y)
240#
241# CONFIG_SHAPER is not set
242
243#
244# Wan interfaces
245#
246# CONFIG_WAN is not set
247
248#
249# Amateur Radio support
250#
251# CONFIG_HAMRADIO is not set
252
253#
254# IrDA (infrared) support
255#
256# CONFIG_IRDA is not set
257
258#
259# ISDN subsystem
260#
261# CONFIG_ISDN_BOOL is not set
262
263#
264# Graphics support
265#
266# CONFIG_FB is not set
267
268#
269# Old CD-ROM drivers (not SCSI, not IDE)
270#
271# CONFIG_CD_NO_IDESCSI is not set
272
273#
274# Input device support
275#
276# CONFIG_INPUT is not set
277
278#
279# Userland interfaces
280#
281
282#
283# Input I/O drivers
284#
285# CONFIG_GAMEPORT is not set
286CONFIG_SOUND_GAMEPORT=y
287# CONFIG_SERIO is not set
288
289#
290# Input Device Drivers
291#
292
293#
294# Macintosh device drivers
295#
296
297#
298# Character devices
299#
300# CONFIG_SERIAL_NONSTANDARD is not set
301
302#
303# Serial drivers
304#
305CONFIG_SERIAL_8250=y
306CONFIG_SERIAL_8250_CONSOLE=y
307# CONFIG_SERIAL_8250_EXTENDED is not set
308
309#
310# Non-8250 serial port support
311#
312CONFIG_SERIAL_CORE=y
313CONFIG_SERIAL_CORE_CONSOLE=y
314CONFIG_UNIX98_PTYS=y
315CONFIG_UNIX98_PTY_COUNT=256
316
317#
318# I2C support
319#
320CONFIG_I2C=y
321# CONFIG_I2C_ALGOBIT is not set
322# CONFIG_I2C_ALGOPCF is not set
323CONFIG_I2C_IBM_OCP_ALGO=y
324CONFIG_I2C_IBM_OCP_ADAP=y
325# CONFIG_I2C_CHARDEV is not set
326
327#
328# I2C Hardware Sensors Mainboard support
329#
330# CONFIG_I2C_AMD756 is not set
331# CONFIG_I2C_AMD8111 is not set
332
333#
334# I2C Hardware Sensors Chip support
335#
336# CONFIG_SENSORS_ADM1021 is not set
337# CONFIG_SENSORS_IT87 is not set
338# CONFIG_SENSORS_LM75 is not set
339# CONFIG_SENSORS_LM85 is not set
340# CONFIG_SENSORS_VIA686A is not set
341# CONFIG_SENSORS_W83781D is not set
342# CONFIG_I2C_SENSOR is not set
343
344#
345# Mice
346#
347# CONFIG_BUSMOUSE is not set
348# CONFIG_QIC02_TAPE is not set
349
350#
351# IPMI
352#
353# CONFIG_IPMI_HANDLER is not set
354
355#
356# Watchdog Cards
357#
358CONFIG_WATCHDOG=y
359# CONFIG_WATCHDOG_NOWAYOUT is not set
360# CONFIG_SOFT_WATCHDOG is not set
361# CONFIG_WDT is not set
362# CONFIG_WDTPCI is not set
363# CONFIG_PCWATCHDOG is not set
364# CONFIG_ACQUIRE_WDT is not set
365# CONFIG_ADVANTECH_WDT is not set
366# CONFIG_EUROTECH_WDT is not set
367# CONFIG_IB700_WDT is not set
368# CONFIG_MIXCOMWD is not set
369# CONFIG_SCx200_WDT is not set
370# CONFIG_60XX_WDT is not set
371# CONFIG_W83877F_WDT is not set
372# CONFIG_MACHZ_WDT is not set
373# CONFIG_SC520_WDT is not set
374# CONFIG_AMD7XX_TCO is not set
375# CONFIG_ALIM7101_WDT is not set
376# CONFIG_SC1200_WDT is not set
377# CONFIG_WAFER_WDT is not set
378# CONFIG_CPU5_WDT is not set
379# CONFIG_NVRAM is not set
380# CONFIG_GEN_RTC is not set
381# CONFIG_DTLK is not set
382# CONFIG_R3964 is not set
383# CONFIG_APPLICOM is not set
384
385#
386# Ftape, the floppy tape device driver
387#
388# CONFIG_FTAPE is not set
389# CONFIG_AGP is not set
390# CONFIG_DRM is not set
391# CONFIG_RAW_DRIVER is not set
392# CONFIG_HANGCHECK_TIMER is not set
393
394#
395# Multimedia devices
396#
397# CONFIG_VIDEO_DEV is not set
398
399#
400# Digital Video Broadcasting Devices
401#
402# CONFIG_DVB is not set
403
404#
405# File systems
406#
407CONFIG_EXT2_FS=y
408# CONFIG_EXT2_FS_XATTR is not set
409# CONFIG_EXT3_FS is not set
410# CONFIG_JBD is not set
411# CONFIG_REISERFS_FS is not set
412# CONFIG_JFS_FS is not set
413# CONFIG_XFS_FS is not set
414# CONFIG_MINIX_FS is not set
415# CONFIG_ROMFS_FS is not set
416# CONFIG_QUOTA is not set
417# CONFIG_AUTOFS_FS is not set
418# CONFIG_AUTOFS4_FS is not set
419
420#
421# CD-ROM/DVD Filesystems
422#
423# CONFIG_ISO9660_FS is not set
424# CONFIG_UDF_FS is not set
425
426#
427# DOS/FAT/NT Filesystems
428#
429# CONFIG_FAT_FS is not set
430# CONFIG_NTFS_FS is not set
431
432#
433# Pseudo filesystems
434#
435CONFIG_PROC_FS=y
436# CONFIG_DEVFS_FS is not set
437CONFIG_DEVPTS_FS=y
438# CONFIG_DEVPTS_FS_XATTR is not set
439CONFIG_TMPFS=y
440CONFIG_RAMFS=y
441
442#
443# Miscellaneous filesystems
444#
445# CONFIG_ADFS_FS is not set
446# CONFIG_AFFS_FS is not set
447# CONFIG_HFS_FS is not set
448# CONFIG_BEFS_FS is not set
449# CONFIG_BFS_FS is not set
450# CONFIG_EFS_FS is not set
451# CONFIG_CRAMFS is not set
452# CONFIG_VXFS_FS is not set
453# CONFIG_HPFS_FS is not set
454# CONFIG_QNX4FS_FS is not set
455# CONFIG_SYSV_FS is not set
456# CONFIG_UFS_FS is not set
457
458#
459# Network File Systems
460#
461CONFIG_NFS_FS=y
462# CONFIG_NFS_V3 is not set
463# CONFIG_NFS_V4 is not set
464# CONFIG_NFSD is not set
465CONFIG_ROOT_NFS=y
466CONFIG_LOCKD=y
467# CONFIG_EXPORTFS is not set
468CONFIG_SUNRPC=y
469# CONFIG_SUNRPC_GSS is not set
470# CONFIG_SMB_FS is not set
471# CONFIG_CIFS is not set
472# CONFIG_NCP_FS is not set
473# CONFIG_CODA_FS is not set
474# CONFIG_INTERMEZZO_FS is not set
475# CONFIG_AFS_FS is not set
476
477#
478# Partition Types
479#
480CONFIG_PARTITION_ADVANCED=y
481# CONFIG_ACORN_PARTITION is not set
482# CONFIG_OSF_PARTITION is not set
483# CONFIG_AMIGA_PARTITION is not set
484# CONFIG_ATARI_PARTITION is not set
485# CONFIG_MAC_PARTITION is not set
486# CONFIG_MSDOS_PARTITION is not set
487# CONFIG_LDM_PARTITION is not set
488# CONFIG_NEC98_PARTITION is not set
489# CONFIG_SGI_PARTITION is not set
490# CONFIG_ULTRIX_PARTITION is not set
491# CONFIG_SUN_PARTITION is not set
492# CONFIG_EFI_PARTITION is not set
493
494#
495# Sound
496#
497# CONFIG_SOUND is not set
498
499#
500# IBM 40x options
501#
502
503#
504# USB support
505#
506# CONFIG_USB_GADGET is not set
507
508#
509# Bluetooth support
510#
511# CONFIG_BT is not set
512
513#
514# Library routines
515#
516CONFIG_CRC32=y
517
518#
519# Kernel hacking
520#
521# CONFIG_DEBUG_KERNEL is not set
522# CONFIG_KALLSYMS is not set
523# CONFIG_SERIAL_TEXT_DEBUG is not set
524CONFIG_OCP=y
525
526#
527# Security options
528#
529# CONFIG_SECURITY is not set
530
531#
532# Cryptographic options
533#
534# CONFIG_CRYPTO is not set
diff --git a/arch/ppc/configs/common_defconfig b/arch/ppc/configs/common_defconfig
index 95ead3f1b1cf..4d33bee23a89 100644
--- a/arch/ppc/configs/common_defconfig
+++ b/arch/ppc/configs/common_defconfig
@@ -1,15 +1,17 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.10-rc2 3# Linux kernel version: 2.6.13-rc3
4# Thu Nov 18 08:22:35 2004 4# Wed Jul 13 13:34:24 2005
5# 5#
6CONFIG_MMU=y 6CONFIG_MMU=y
7CONFIG_GENERIC_HARDIRQS=y 7CONFIG_GENERIC_HARDIRQS=y
8CONFIG_RWSEM_XCHGADD_ALGORITHM=y 8CONFIG_RWSEM_XCHGADD_ALGORITHM=y
9CONFIG_GENERIC_CALIBRATE_DELAY=y
9CONFIG_HAVE_DEC_LOCK=y 10CONFIG_HAVE_DEC_LOCK=y
10CONFIG_PPC=y 11CONFIG_PPC=y
11CONFIG_PPC32=y 12CONFIG_PPC32=y
12CONFIG_GENERIC_NVRAM=y 13CONFIG_GENERIC_NVRAM=y
14CONFIG_SCHED_NO_NO_OMIT_FRAME_POINTER=y
13 15
14# 16#
15# Code maturity level options 17# Code maturity level options
@@ -17,6 +19,7 @@ CONFIG_GENERIC_NVRAM=y
17CONFIG_EXPERIMENTAL=y 19CONFIG_EXPERIMENTAL=y
18CONFIG_CLEAN_COMPILE=y 20CONFIG_CLEAN_COMPILE=y
19CONFIG_BROKEN_ON_SMP=y 21CONFIG_BROKEN_ON_SMP=y
22CONFIG_INIT_ENV_ARG_LIMIT=32
20 23
21# 24#
22# General setup 25# General setup
@@ -28,30 +31,33 @@ CONFIG_POSIX_MQUEUE=y
28# CONFIG_BSD_PROCESS_ACCT is not set 31# CONFIG_BSD_PROCESS_ACCT is not set
29CONFIG_SYSCTL=y 32CONFIG_SYSCTL=y
30# CONFIG_AUDIT is not set 33# CONFIG_AUDIT is not set
31CONFIG_LOG_BUF_SHIFT=14
32CONFIG_HOTPLUG=y 34CONFIG_HOTPLUG=y
33CONFIG_KOBJECT_UEVENT=y 35CONFIG_KOBJECT_UEVENT=y
34CONFIG_IKCONFIG=y 36CONFIG_IKCONFIG=y
35CONFIG_IKCONFIG_PROC=y 37CONFIG_IKCONFIG_PROC=y
36# CONFIG_EMBEDDED is not set 38# CONFIG_EMBEDDED is not set
37CONFIG_KALLSYMS=y 39CONFIG_KALLSYMS=y
40# CONFIG_KALLSYMS_ALL is not set
38# CONFIG_KALLSYMS_EXTRA_PASS is not set 41# CONFIG_KALLSYMS_EXTRA_PASS is not set
42CONFIG_PRINTK=y
43CONFIG_BUG=y
44CONFIG_BASE_FULL=y
39CONFIG_FUTEX=y 45CONFIG_FUTEX=y
40CONFIG_EPOLL=y 46CONFIG_EPOLL=y
41# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
42CONFIG_SHMEM=y 47CONFIG_SHMEM=y
43CONFIG_CC_ALIGN_FUNCTIONS=0 48CONFIG_CC_ALIGN_FUNCTIONS=0
44CONFIG_CC_ALIGN_LABELS=0 49CONFIG_CC_ALIGN_LABELS=0
45CONFIG_CC_ALIGN_LOOPS=0 50CONFIG_CC_ALIGN_LOOPS=0
46CONFIG_CC_ALIGN_JUMPS=0 51CONFIG_CC_ALIGN_JUMPS=0
47# CONFIG_TINY_SHMEM is not set 52# CONFIG_TINY_SHMEM is not set
53CONFIG_BASE_SMALL=0
48 54
49# 55#
50# Loadable module support 56# Loadable module support
51# 57#
52CONFIG_MODULES=y 58CONFIG_MODULES=y
53CONFIG_MODULE_UNLOAD=y 59CONFIG_MODULE_UNLOAD=y
54CONFIG_MODULE_FORCE_UNLOAD=y 60# CONFIG_MODULE_FORCE_UNLOAD is not set
55CONFIG_OBSOLETE_MODPARM=y 61CONFIG_OBSOLETE_MODPARM=y
56CONFIG_MODVERSIONS=y 62CONFIG_MODVERSIONS=y
57# CONFIG_MODULE_SRCVERSION_ALL is not set 63# CONFIG_MODULE_SRCVERSION_ALL is not set
@@ -66,22 +72,27 @@ CONFIG_6xx=y
66# CONFIG_POWER3 is not set 72# CONFIG_POWER3 is not set
67# CONFIG_POWER4 is not set 73# CONFIG_POWER4 is not set
68# CONFIG_8xx is not set 74# CONFIG_8xx is not set
75# CONFIG_E200 is not set
69# CONFIG_E500 is not set 76# CONFIG_E500 is not set
77CONFIG_PPC_FPU=y
70CONFIG_ALTIVEC=y 78CONFIG_ALTIVEC=y
71CONFIG_TAU=y 79CONFIG_TAU=y
72# CONFIG_TAU_INT is not set 80# CONFIG_TAU_INT is not set
73# CONFIG_TAU_AVERAGE is not set 81# CONFIG_TAU_AVERAGE is not set
82# CONFIG_KEXEC is not set
74CONFIG_CPU_FREQ=y 83CONFIG_CPU_FREQ=y
84CONFIG_CPU_FREQ_TABLE=y
75# CONFIG_CPU_FREQ_DEBUG is not set 85# CONFIG_CPU_FREQ_DEBUG is not set
76CONFIG_CPU_FREQ_PROC_INTF=y 86CONFIG_CPU_FREQ_STAT=m
87CONFIG_CPU_FREQ_STAT_DETAILS=y
77CONFIG_CPU_FREQ_DEFAULT_GOV_PERFORMANCE=y 88CONFIG_CPU_FREQ_DEFAULT_GOV_PERFORMANCE=y
78# CONFIG_CPU_FREQ_DEFAULT_GOV_USERSPACE is not set 89# CONFIG_CPU_FREQ_DEFAULT_GOV_USERSPACE is not set
79CONFIG_CPU_FREQ_GOV_PERFORMANCE=y 90CONFIG_CPU_FREQ_GOV_PERFORMANCE=y
80# CONFIG_CPU_FREQ_GOV_POWERSAVE is not set 91CONFIG_CPU_FREQ_GOV_POWERSAVE=m
81# CONFIG_CPU_FREQ_GOV_USERSPACE is not set 92CONFIG_CPU_FREQ_GOV_USERSPACE=m
82# CONFIG_CPU_FREQ_GOV_ONDEMAND is not set 93CONFIG_CPU_FREQ_GOV_ONDEMAND=m
94CONFIG_CPU_FREQ_GOV_CONSERVATIVE=m
83CONFIG_CPU_FREQ_PMAC=y 95CONFIG_CPU_FREQ_PMAC=y
84CONFIG_CPU_FREQ_TABLE=y
85CONFIG_PPC601_SYNC_FIX=y 96CONFIG_PPC601_SYNC_FIX=y
86CONFIG_PM=y 97CONFIG_PM=y
87CONFIG_PPC_STD_MMU=y 98CONFIG_PPC_STD_MMU=y
@@ -91,11 +102,15 @@ CONFIG_PPC_STD_MMU=y
91# 102#
92CONFIG_PPC_MULTIPLATFORM=y 103CONFIG_PPC_MULTIPLATFORM=y
93# CONFIG_APUS is not set 104# CONFIG_APUS is not set
105# CONFIG_KATANA is not set
94# CONFIG_WILLOW is not set 106# CONFIG_WILLOW is not set
107# CONFIG_CPCI690 is not set
95# CONFIG_PCORE is not set 108# CONFIG_PCORE is not set
96# CONFIG_POWERPMC250 is not set 109# CONFIG_POWERPMC250 is not set
97# CONFIG_EV64260 is not set 110# CONFIG_CHESTNUT is not set
98# CONFIG_SPRUCE is not set 111# CONFIG_SPRUCE is not set
112# CONFIG_HDPU is not set
113# CONFIG_EV64260 is not set
99# CONFIG_LOPEC is not set 114# CONFIG_LOPEC is not set
100# CONFIG_MCPN765 is not set 115# CONFIG_MCPN765 is not set
101# CONFIG_MVME5100 is not set 116# CONFIG_MVME5100 is not set
@@ -103,6 +118,7 @@ CONFIG_PPC_MULTIPLATFORM=y
103# CONFIG_PRPMC750 is not set 118# CONFIG_PRPMC750 is not set
104# CONFIG_PRPMC800 is not set 119# CONFIG_PRPMC800 is not set
105# CONFIG_SANDPOINT is not set 120# CONFIG_SANDPOINT is not set
121# CONFIG_RADSTONE_PPC7D is not set
106# CONFIG_ADIR is not set 122# CONFIG_ADIR is not set
107# CONFIG_K2 is not set 123# CONFIG_K2 is not set
108# CONFIG_PAL4 is not set 124# CONFIG_PAL4 is not set
@@ -113,22 +129,40 @@ CONFIG_PPC_MULTIPLATFORM=y
113# CONFIG_RPX8260 is not set 129# CONFIG_RPX8260 is not set
114# CONFIG_TQM8260 is not set 130# CONFIG_TQM8260 is not set
115# CONFIG_ADS8272 is not set 131# CONFIG_ADS8272 is not set
132# CONFIG_PQ2FADS is not set
116# CONFIG_LITE5200 is not set 133# CONFIG_LITE5200 is not set
134# CONFIG_MPC834x_SYS is not set
117CONFIG_PPC_CHRP=y 135CONFIG_PPC_CHRP=y
118CONFIG_PPC_PMAC=y 136CONFIG_PPC_PMAC=y
119CONFIG_PPC_PREP=y 137CONFIG_PPC_PREP=y
120CONFIG_PPC_OF=y 138CONFIG_PPC_OF=y
121CONFIG_PPCBUG_NVRAM=y 139CONFIG_PPCBUG_NVRAM=y
122# CONFIG_SMP is not set 140# CONFIG_SMP is not set
123# CONFIG_PREEMPT is not set
124# CONFIG_HIGHMEM 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
125CONFIG_BINFMT_ELF=y 155CONFIG_BINFMT_ELF=y
126CONFIG_BINFMT_MISC=m 156CONFIG_BINFMT_MISC=m
127CONFIG_PROC_DEVICETREE=y 157CONFIG_PROC_DEVICETREE=y
128CONFIG_PREP_RESIDUAL=y 158CONFIG_PREP_RESIDUAL=y
129CONFIG_PROC_PREPRESIDUAL=y 159CONFIG_PROC_PREPRESIDUAL=y
130CONFIG_CMDLINE_BOOL=y 160# CONFIG_CMDLINE_BOOL is not set
131CONFIG_CMDLINE="console=ttyS0,9600 console=tty0 root=/dev/sda2" 161# CONFIG_PM_DEBUG is not set
162CONFIG_SOFTWARE_SUSPEND=y
163CONFIG_PM_STD_PARTITION=""
164# CONFIG_SECCOMP is not set
165CONFIG_ISA_DMA_API=y
132 166
133# 167#
134# Bus options 168# Bus options
@@ -137,18 +171,24 @@ CONFIG_ISA=y
137CONFIG_GENERIC_ISA_DMA=y 171CONFIG_GENERIC_ISA_DMA=y
138CONFIG_PCI=y 172CONFIG_PCI=y
139CONFIG_PCI_DOMAINS=y 173CONFIG_PCI_DOMAINS=y
140CONFIG_PCI_LEGACY_PROC=y 174# CONFIG_PCI_LEGACY_PROC is not set
141CONFIG_PCI_NAMES=y 175# CONFIG_PCI_NAMES is not set
176# CONFIG_PCI_DEBUG is not set
142 177
143# 178#
144# PCCARD (PCMCIA/CardBus) support 179# PCCARD (PCMCIA/CardBus) support
145# 180#
146# CONFIG_PCCARD is not set 181CONFIG_PCCARD=m
182# CONFIG_PCMCIA_DEBUG is not set
183# CONFIG_PCMCIA is not set
184CONFIG_CARDBUS=y
147 185
148# 186#
149# PC-card bridges 187# PC-card bridges
150# 188#
189CONFIG_YENTA=m
151CONFIG_PCMCIA_PROBE=y 190CONFIG_PCMCIA_PROBE=y
191CONFIG_PCCARD_NONSTATIC=m
152 192
153# 193#
154# Advanced setup 194# Advanced setup
@@ -165,6 +205,143 @@ CONFIG_TASK_SIZE=0x80000000
165CONFIG_BOOT_LOAD=0x00800000 205CONFIG_BOOT_LOAD=0x00800000
166 206
167# 207#
208# Networking
209#
210CONFIG_NET=y
211
212#
213# Networking options
214#
215CONFIG_PACKET=y
216# CONFIG_PACKET_MMAP is not set
217CONFIG_UNIX=y
218# CONFIG_NET_KEY is not set
219CONFIG_INET=y
220CONFIG_IP_MULTICAST=y
221# CONFIG_IP_ADVANCED_ROUTER is not set
222CONFIG_IP_FIB_HASH=y
223# CONFIG_IP_PNP is not set
224# CONFIG_NET_IPIP is not set
225# CONFIG_NET_IPGRE is not set
226# CONFIG_IP_MROUTE is not set
227# CONFIG_ARPD is not set
228CONFIG_SYN_COOKIES=y
229# CONFIG_INET_AH is not set
230# CONFIG_INET_ESP is not set
231# CONFIG_INET_IPCOMP is not set
232# CONFIG_INET_TUNNEL is not set
233CONFIG_IP_TCPDIAG=y
234# CONFIG_IP_TCPDIAG_IPV6 is not set
235# CONFIG_TCP_CONG_ADVANCED is not set
236CONFIG_TCP_CONG_BIC=y
237
238#
239# IP: Virtual Server Configuration
240#
241# CONFIG_IP_VS is not set
242# CONFIG_IPV6 is not set
243CONFIG_NETFILTER=y
244# CONFIG_NETFILTER_DEBUG is not set
245
246#
247# IP: Netfilter Configuration
248#
249CONFIG_IP_NF_CONNTRACK=m
250# CONFIG_IP_NF_CT_ACCT is not set
251CONFIG_IP_NF_CONNTRACK_MARK=y
252# CONFIG_IP_NF_CT_PROTO_SCTP is not set
253CONFIG_IP_NF_FTP=m
254CONFIG_IP_NF_IRC=m
255CONFIG_IP_NF_TFTP=m
256CONFIG_IP_NF_AMANDA=m
257CONFIG_IP_NF_QUEUE=m
258CONFIG_IP_NF_IPTABLES=m
259CONFIG_IP_NF_MATCH_LIMIT=m
260CONFIG_IP_NF_MATCH_IPRANGE=m
261CONFIG_IP_NF_MATCH_MAC=m
262CONFIG_IP_NF_MATCH_PKTTYPE=m
263CONFIG_IP_NF_MATCH_MARK=m
264CONFIG_IP_NF_MATCH_MULTIPORT=m
265CONFIG_IP_NF_MATCH_TOS=m
266CONFIG_IP_NF_MATCH_RECENT=m
267CONFIG_IP_NF_MATCH_ECN=m
268CONFIG_IP_NF_MATCH_DSCP=m
269CONFIG_IP_NF_MATCH_AH_ESP=m
270CONFIG_IP_NF_MATCH_LENGTH=m
271CONFIG_IP_NF_MATCH_TTL=m
272CONFIG_IP_NF_MATCH_TCPMSS=m
273CONFIG_IP_NF_MATCH_HELPER=m
274CONFIG_IP_NF_MATCH_STATE=m
275CONFIG_IP_NF_MATCH_CONNTRACK=m
276CONFIG_IP_NF_MATCH_OWNER=m
277CONFIG_IP_NF_MATCH_ADDRTYPE=m
278CONFIG_IP_NF_MATCH_REALM=m
279CONFIG_IP_NF_MATCH_SCTP=m
280CONFIG_IP_NF_MATCH_COMMENT=m
281CONFIG_IP_NF_MATCH_CONNMARK=m
282CONFIG_IP_NF_MATCH_HASHLIMIT=m
283CONFIG_IP_NF_FILTER=m
284CONFIG_IP_NF_TARGET_REJECT=m
285CONFIG_IP_NF_TARGET_LOG=m
286CONFIG_IP_NF_TARGET_ULOG=m
287CONFIG_IP_NF_TARGET_TCPMSS=m
288CONFIG_IP_NF_NAT=m
289CONFIG_IP_NF_NAT_NEEDED=y
290CONFIG_IP_NF_TARGET_MASQUERADE=m
291CONFIG_IP_NF_TARGET_REDIRECT=m
292CONFIG_IP_NF_TARGET_NETMAP=m
293CONFIG_IP_NF_TARGET_SAME=m
294CONFIG_IP_NF_NAT_SNMP_BASIC=m
295CONFIG_IP_NF_NAT_IRC=m
296CONFIG_IP_NF_NAT_FTP=m
297CONFIG_IP_NF_NAT_TFTP=m
298CONFIG_IP_NF_NAT_AMANDA=m
299CONFIG_IP_NF_MANGLE=m
300CONFIG_IP_NF_TARGET_TOS=m
301CONFIG_IP_NF_TARGET_ECN=m
302CONFIG_IP_NF_TARGET_DSCP=m
303CONFIG_IP_NF_TARGET_MARK=m
304CONFIG_IP_NF_TARGET_CLASSIFY=m
305CONFIG_IP_NF_TARGET_CONNMARK=m
306CONFIG_IP_NF_TARGET_CLUSTERIP=m
307CONFIG_IP_NF_RAW=m
308CONFIG_IP_NF_TARGET_NOTRACK=m
309CONFIG_IP_NF_ARPTABLES=m
310# CONFIG_IP_NF_ARPFILTER is not set
311# CONFIG_IP_NF_ARP_MANGLE is not set
312
313#
314# SCTP Configuration (EXPERIMENTAL)
315#
316# CONFIG_IP_SCTP is not set
317# CONFIG_ATM is not set
318# CONFIG_BRIDGE is not set
319# CONFIG_VLAN_8021Q is not set
320# CONFIG_DECNET is not set
321# CONFIG_LLC2 is not set
322# CONFIG_IPX is not set
323# CONFIG_ATALK is not set
324# CONFIG_X25 is not set
325# CONFIG_LAPB is not set
326# CONFIG_NET_DIVERT is not set
327# CONFIG_ECONET is not set
328# CONFIG_WAN_ROUTER is not set
329# CONFIG_NET_SCHED is not set
330CONFIG_NET_CLS_ROUTE=y
331
332#
333# Network testing
334#
335# CONFIG_NET_PKTGEN is not set
336CONFIG_NETPOLL=y
337# CONFIG_NETPOLL_RX is not set
338# CONFIG_NETPOLL_TRAP is not set
339CONFIG_NET_POLL_CONTROLLER=y
340# CONFIG_HAMRADIO is not set
341# CONFIG_IRDA is not set
342# CONFIG_BT is not set
343
344#
168# Device Drivers 345# Device Drivers
169# 346#
170 347
@@ -173,7 +350,8 @@ CONFIG_BOOT_LOAD=0x00800000
173# 350#
174# CONFIG_STANDALONE is not set 351# CONFIG_STANDALONE is not set
175CONFIG_PREVENT_FIRMWARE_BUILD=y 352CONFIG_PREVENT_FIRMWARE_BUILD=y
176# CONFIG_FW_LOADER is not set 353CONFIG_FW_LOADER=m
354# CONFIG_DEBUG_DRIVER is not set
177 355
178# 356#
179# Memory Technology Devices (MTD) 357# Memory Technology Devices (MTD)
@@ -183,7 +361,13 @@ CONFIG_PREVENT_FIRMWARE_BUILD=y
183# 361#
184# Parallel port support 362# Parallel port support
185# 363#
186# CONFIG_PARPORT is not set 364CONFIG_PARPORT=m
365CONFIG_PARPORT_PC=m
366CONFIG_PARPORT_SERIAL=m
367CONFIG_PARPORT_PC_FIFO=y
368CONFIG_PARPORT_PC_SUPERIO=y
369# CONFIG_PARPORT_GSC is not set
370CONFIG_PARPORT_1284=y
187 371
188# 372#
189# Plug and Play support 373# Plug and Play support
@@ -194,18 +378,21 @@ CONFIG_PREVENT_FIRMWARE_BUILD=y
194# Block devices 378# Block devices
195# 379#
196CONFIG_BLK_DEV_FD=m 380CONFIG_BLK_DEV_FD=m
197# CONFIG_MAC_FLOPPY is not set 381CONFIG_MAC_FLOPPY=m
198# CONFIG_BLK_DEV_XD is not set 382# CONFIG_BLK_DEV_XD is not set
383# CONFIG_PARIDE is not set
199# CONFIG_BLK_CPQ_DA is not set 384# CONFIG_BLK_CPQ_DA is not set
200# CONFIG_BLK_CPQ_CISS_DA is not set 385# CONFIG_BLK_CPQ_CISS_DA is not set
201# CONFIG_BLK_DEV_DAC960 is not set 386# CONFIG_BLK_DEV_DAC960 is not set
202# CONFIG_BLK_DEV_UMEM is not set 387# CONFIG_BLK_DEV_UMEM is not set
388# CONFIG_BLK_DEV_COW_COMMON is not set
203CONFIG_BLK_DEV_LOOP=y 389CONFIG_BLK_DEV_LOOP=y
204# CONFIG_BLK_DEV_CRYPTOLOOP is not set 390# CONFIG_BLK_DEV_CRYPTOLOOP is not set
205# CONFIG_BLK_DEV_NBD is not set 391# CONFIG_BLK_DEV_NBD is not set
206# CONFIG_BLK_DEV_SX8 is not set 392# CONFIG_BLK_DEV_SX8 is not set
207# CONFIG_BLK_DEV_UB is not set 393# CONFIG_BLK_DEV_UB is not set
208CONFIG_BLK_DEV_RAM=y 394CONFIG_BLK_DEV_RAM=y
395CONFIG_BLK_DEV_RAM_COUNT=16
209CONFIG_BLK_DEV_RAM_SIZE=4096 396CONFIG_BLK_DEV_RAM_SIZE=4096
210CONFIG_BLK_DEV_INITRD=y 397CONFIG_BLK_DEV_INITRD=y
211CONFIG_INITRAMFS_SOURCE="" 398CONFIG_INITRAMFS_SOURCE=""
@@ -219,6 +406,7 @@ CONFIG_IOSCHED_NOOP=y
219CONFIG_IOSCHED_AS=y 406CONFIG_IOSCHED_AS=y
220CONFIG_IOSCHED_DEADLINE=y 407CONFIG_IOSCHED_DEADLINE=y
221CONFIG_IOSCHED_CFQ=y 408CONFIG_IOSCHED_CFQ=y
409# CONFIG_ATA_OVER_ETH is not set
222 410
223# 411#
224# ATA/ATAPI/MFM/RLL support 412# ATA/ATAPI/MFM/RLL support
@@ -247,7 +435,7 @@ CONFIG_IDEPCI_SHARE_IRQ=y
247# CONFIG_BLK_DEV_OFFBOARD is not set 435# CONFIG_BLK_DEV_OFFBOARD is not set
248CONFIG_BLK_DEV_GENERIC=y 436CONFIG_BLK_DEV_GENERIC=y
249# CONFIG_BLK_DEV_OPTI621 is not set 437# CONFIG_BLK_DEV_OPTI621 is not set
250CONFIG_BLK_DEV_SL82C105=y 438# CONFIG_BLK_DEV_SL82C105 is not set
251CONFIG_BLK_DEV_IDEDMA_PCI=y 439CONFIG_BLK_DEV_IDEDMA_PCI=y
252# CONFIG_BLK_DEV_IDEDMA_FORCED is not set 440# CONFIG_BLK_DEV_IDEDMA_FORCED is not set
253CONFIG_IDEDMA_PCI_AUTO=y 441CONFIG_IDEDMA_PCI_AUTO=y
@@ -264,6 +452,7 @@ CONFIG_BLK_DEV_CMD64X=y
264# CONFIG_BLK_DEV_HPT366 is not set 452# CONFIG_BLK_DEV_HPT366 is not set
265# CONFIG_BLK_DEV_SC1200 is not set 453# CONFIG_BLK_DEV_SC1200 is not set
266# CONFIG_BLK_DEV_PIIX is not set 454# CONFIG_BLK_DEV_PIIX is not set
455# CONFIG_BLK_DEV_IT821X is not set
267# CONFIG_BLK_DEV_NS87415 is not set 456# CONFIG_BLK_DEV_NS87415 is not set
268# CONFIG_BLK_DEV_PDC202XX_OLD is not set 457# CONFIG_BLK_DEV_PDC202XX_OLD is not set
269CONFIG_BLK_DEV_PDC202XX_NEW=y 458CONFIG_BLK_DEV_PDC202XX_NEW=y
@@ -299,19 +488,21 @@ CONFIG_CHR_DEV_ST=y
299CONFIG_BLK_DEV_SR=y 488CONFIG_BLK_DEV_SR=y
300CONFIG_BLK_DEV_SR_VENDOR=y 489CONFIG_BLK_DEV_SR_VENDOR=y
301CONFIG_CHR_DEV_SG=y 490CONFIG_CHR_DEV_SG=y
491# CONFIG_CHR_DEV_SCH is not set
302 492
303# 493#
304# Some SCSI devices (e.g. CD jukebox) support multiple LUNs 494# Some SCSI devices (e.g. CD jukebox) support multiple LUNs
305# 495#
306# CONFIG_SCSI_MULTI_LUN is not set 496# CONFIG_SCSI_MULTI_LUN is not set
307CONFIG_SCSI_CONSTANTS=y 497CONFIG_SCSI_CONSTANTS=y
308# CONFIG_SCSI_LOGGING is not set 498CONFIG_SCSI_LOGGING=y
309 499
310# 500#
311# SCSI Transport Attributes 501# SCSI Transport Attributes
312# 502#
313CONFIG_SCSI_SPI_ATTRS=y 503CONFIG_SCSI_SPI_ATTRS=y
314# CONFIG_SCSI_FC_ATTRS is not set 504# CONFIG_SCSI_FC_ATTRS is not set
505# CONFIG_SCSI_ISCSI_ATTRS is not set
315 506
316# 507#
317# SCSI low-level drivers 508# SCSI low-level drivers
@@ -340,7 +531,6 @@ CONFIG_SCSI_AIC7XXX_OLD=m
340# CONFIG_SCSI_DMX3191D is not set 531# CONFIG_SCSI_DMX3191D is not set
341# CONFIG_SCSI_DTC3280 is not set 532# CONFIG_SCSI_DTC3280 is not set
342# CONFIG_SCSI_EATA is not set 533# CONFIG_SCSI_EATA is not set
343# CONFIG_SCSI_EATA_PIO is not set
344# CONFIG_SCSI_FUTURE_DOMAIN is not set 534# CONFIG_SCSI_FUTURE_DOMAIN is not set
345# CONFIG_SCSI_GDTH is not set 535# CONFIG_SCSI_GDTH is not set
346# CONFIG_SCSI_GENERIC_NCR5380 is not set 536# CONFIG_SCSI_GENERIC_NCR5380 is not set
@@ -348,6 +538,8 @@ CONFIG_SCSI_AIC7XXX_OLD=m
348# CONFIG_SCSI_IPS is not set 538# CONFIG_SCSI_IPS is not set
349# CONFIG_SCSI_INITIO is not set 539# CONFIG_SCSI_INITIO is not set
350# CONFIG_SCSI_INIA100 is not set 540# CONFIG_SCSI_INIA100 is not set
541# CONFIG_SCSI_PPA is not set
542# CONFIG_SCSI_IMM is not set
351# CONFIG_SCSI_NCR53C406A is not set 543# CONFIG_SCSI_NCR53C406A is not set
352CONFIG_SCSI_SYM53C8XX_2=y 544CONFIG_SCSI_SYM53C8XX_2=y
353CONFIG_SCSI_SYM53C8XX_DMA_ADDRESSING_MODE=0 545CONFIG_SCSI_SYM53C8XX_DMA_ADDRESSING_MODE=0
@@ -358,17 +550,15 @@ CONFIG_SCSI_SYM53C8XX_MAX_TAGS=64
358# CONFIG_SCSI_PAS16 is not set 550# CONFIG_SCSI_PAS16 is not set
359# CONFIG_SCSI_PSI240I is not set 551# CONFIG_SCSI_PSI240I is not set
360# CONFIG_SCSI_QLOGIC_FAS is not set 552# CONFIG_SCSI_QLOGIC_FAS is not set
361# CONFIG_SCSI_QLOGIC_ISP is not set
362# CONFIG_SCSI_QLOGIC_FC is not set 553# CONFIG_SCSI_QLOGIC_FC is not set
363# CONFIG_SCSI_QLOGIC_1280 is not set 554# CONFIG_SCSI_QLOGIC_1280 is not set
364# CONFIG_SCSI_QLOGIC_1280_1040 is not set
365CONFIG_SCSI_QLA2XXX=y 555CONFIG_SCSI_QLA2XXX=y
366# CONFIG_SCSI_QLA21XX is not set 556# CONFIG_SCSI_QLA21XX is not set
367# CONFIG_SCSI_QLA22XX is not set 557# CONFIG_SCSI_QLA22XX is not set
368# CONFIG_SCSI_QLA2300 is not set 558# CONFIG_SCSI_QLA2300 is not set
369# CONFIG_SCSI_QLA2322 is not set 559# CONFIG_SCSI_QLA2322 is not set
370# CONFIG_SCSI_QLA6312 is not set 560# CONFIG_SCSI_QLA6312 is not set
371# CONFIG_SCSI_QLA6322 is not set 561# CONFIG_SCSI_LPFC is not set
372# CONFIG_SCSI_SYM53C416 is not set 562# CONFIG_SCSI_SYM53C416 is not set
373# CONFIG_SCSI_DC395x is not set 563# CONFIG_SCSI_DC395x is not set
374# CONFIG_SCSI_DC390T is not set 564# CONFIG_SCSI_DC390T is not set
@@ -395,11 +585,40 @@ CONFIG_SCSI_MAC53C94=y
395# Fusion MPT device support 585# Fusion MPT device support
396# 586#
397# CONFIG_FUSION is not set 587# CONFIG_FUSION is not set
588# CONFIG_FUSION_SPI is not set
589# CONFIG_FUSION_FC is not set
398 590
399# 591#
400# IEEE 1394 (FireWire) support 592# IEEE 1394 (FireWire) support
401# 593#
402# CONFIG_IEEE1394 is not set 594CONFIG_IEEE1394=m
595
596#
597# Subsystem Options
598#
599# CONFIG_IEEE1394_VERBOSEDEBUG is not set
600CONFIG_IEEE1394_OUI_DB=y
601CONFIG_IEEE1394_EXTRA_CONFIG_ROMS=y
602CONFIG_IEEE1394_CONFIG_ROM_IP1394=y
603# CONFIG_IEEE1394_EXPORT_FULL_API is not set
604
605#
606# Device Drivers
607#
608# CONFIG_IEEE1394_PCILYNX is not set
609CONFIG_IEEE1394_OHCI1394=m
610
611#
612# Protocol Drivers
613#
614CONFIG_IEEE1394_VIDEO1394=m
615CONFIG_IEEE1394_SBP2=m
616# CONFIG_IEEE1394_SBP2_PHYS_DMA is not set
617CONFIG_IEEE1394_ETH1394=m
618CONFIG_IEEE1394_DV1394=m
619CONFIG_IEEE1394_RAWIO=m
620CONFIG_IEEE1394_CMP=m
621CONFIG_IEEE1394_AMDTP=m
403 622
404# 623#
405# I2O device support 624# I2O device support
@@ -412,8 +631,8 @@ CONFIG_SCSI_MAC53C94=y
412CONFIG_ADB=y 631CONFIG_ADB=y
413CONFIG_ADB_CUDA=y 632CONFIG_ADB_CUDA=y
414CONFIG_ADB_PMU=y 633CONFIG_ADB_PMU=y
415CONFIG_PMAC_PBOOK=y
416CONFIG_PMAC_APM_EMU=y 634CONFIG_PMAC_APM_EMU=y
635CONFIG_PMAC_MEDIABAY=y
417CONFIG_PMAC_BACKLIGHT=y 636CONFIG_PMAC_BACKLIGHT=y
418CONFIG_ADB_MACIO=y 637CONFIG_ADB_MACIO=y
419CONFIG_INPUT_ADBHID=y 638CONFIG_INPUT_ADBHID=y
@@ -423,138 +642,13 @@ CONFIG_THERM_ADT746X=m
423# CONFIG_ANSLCD is not set 642# CONFIG_ANSLCD is not set
424 643
425# 644#
426# Networking support 645# Network device support
427#
428CONFIG_NET=y
429
430#
431# Networking options
432#
433CONFIG_PACKET=y
434# CONFIG_PACKET_MMAP is not set
435# CONFIG_NETLINK_DEV is not set
436CONFIG_UNIX=y
437# CONFIG_NET_KEY is not set
438CONFIG_INET=y
439CONFIG_IP_MULTICAST=y
440# CONFIG_IP_ADVANCED_ROUTER is not set
441# CONFIG_IP_PNP is not set
442# CONFIG_NET_IPIP is not set
443# CONFIG_NET_IPGRE is not set
444# CONFIG_IP_MROUTE is not set
445# CONFIG_ARPD is not set
446CONFIG_SYN_COOKIES=y
447# CONFIG_INET_AH is not set
448# CONFIG_INET_ESP is not set
449# CONFIG_INET_IPCOMP is not set
450# CONFIG_INET_TUNNEL is not set
451CONFIG_IP_TCPDIAG=y
452# CONFIG_IP_TCPDIAG_IPV6 is not set
453
454#
455# IP: Virtual Server Configuration
456#
457# CONFIG_IP_VS is not set
458# CONFIG_IPV6 is not set
459CONFIG_NETFILTER=y
460# CONFIG_NETFILTER_DEBUG is not set
461
462#
463# IP: Netfilter Configuration
464# 646#
465CONFIG_IP_NF_CONNTRACK=m
466# CONFIG_IP_NF_CT_ACCT is not set
467# CONFIG_IP_NF_CONNTRACK_MARK is not set
468# CONFIG_IP_NF_CT_PROTO_SCTP is not set
469CONFIG_IP_NF_FTP=m
470CONFIG_IP_NF_IRC=m
471CONFIG_IP_NF_TFTP=m
472CONFIG_IP_NF_AMANDA=m
473# CONFIG_IP_NF_QUEUE is not set
474CONFIG_IP_NF_IPTABLES=m
475CONFIG_IP_NF_MATCH_LIMIT=m
476CONFIG_IP_NF_MATCH_IPRANGE=m
477CONFIG_IP_NF_MATCH_MAC=m
478CONFIG_IP_NF_MATCH_PKTTYPE=m
479CONFIG_IP_NF_MATCH_MARK=m
480CONFIG_IP_NF_MATCH_MULTIPORT=m
481CONFIG_IP_NF_MATCH_TOS=m
482CONFIG_IP_NF_MATCH_RECENT=m
483CONFIG_IP_NF_MATCH_ECN=m
484CONFIG_IP_NF_MATCH_DSCP=m
485CONFIG_IP_NF_MATCH_AH_ESP=m
486CONFIG_IP_NF_MATCH_LENGTH=m
487CONFIG_IP_NF_MATCH_TTL=m
488CONFIG_IP_NF_MATCH_TCPMSS=m
489CONFIG_IP_NF_MATCH_HELPER=m
490CONFIG_IP_NF_MATCH_STATE=m
491CONFIG_IP_NF_MATCH_CONNTRACK=m
492CONFIG_IP_NF_MATCH_OWNER=m
493# CONFIG_IP_NF_MATCH_ADDRTYPE is not set
494# CONFIG_IP_NF_MATCH_REALM is not set
495# CONFIG_IP_NF_MATCH_SCTP is not set
496# CONFIG_IP_NF_MATCH_COMMENT is not set
497# CONFIG_IP_NF_MATCH_HASHLIMIT is not set
498CONFIG_IP_NF_FILTER=m
499CONFIG_IP_NF_TARGET_REJECT=m
500# CONFIG_IP_NF_TARGET_LOG is not set
501CONFIG_IP_NF_TARGET_ULOG=m
502CONFIG_IP_NF_TARGET_TCPMSS=m
503CONFIG_IP_NF_NAT=m
504CONFIG_IP_NF_NAT_NEEDED=y
505CONFIG_IP_NF_TARGET_MASQUERADE=m
506CONFIG_IP_NF_TARGET_REDIRECT=m
507CONFIG_IP_NF_TARGET_NETMAP=m
508CONFIG_IP_NF_TARGET_SAME=m
509CONFIG_IP_NF_NAT_SNMP_BASIC=m
510CONFIG_IP_NF_NAT_IRC=m
511CONFIG_IP_NF_NAT_FTP=m
512CONFIG_IP_NF_NAT_TFTP=m
513CONFIG_IP_NF_NAT_AMANDA=m
514# CONFIG_IP_NF_MANGLE is not set
515CONFIG_IP_NF_RAW=m
516CONFIG_IP_NF_TARGET_NOTRACK=m
517# CONFIG_IP_NF_ARPTABLES is not set
518CONFIG_IP_NF_COMPAT_IPCHAINS=m
519# CONFIG_IP_NF_COMPAT_IPFWADM is not set
520
521#
522# SCTP Configuration (EXPERIMENTAL)
523#
524# CONFIG_IP_SCTP is not set
525# CONFIG_ATM is not set
526# CONFIG_BRIDGE is not set
527# CONFIG_VLAN_8021Q is not set
528# CONFIG_DECNET is not set
529# CONFIG_LLC2 is not set
530# CONFIG_IPX is not set
531# CONFIG_ATALK is not set
532# CONFIG_X25 is not set
533# CONFIG_LAPB is not set
534# CONFIG_NET_DIVERT is not set
535# CONFIG_ECONET is not set
536# CONFIG_WAN_ROUTER is not set
537
538#
539# QoS and/or fair queueing
540#
541# CONFIG_NET_SCHED is not set
542# CONFIG_NET_CLS_ROUTE is not set
543
544#
545# Network testing
546#
547# CONFIG_NET_PKTGEN is not set
548# CONFIG_NETPOLL is not set
549# CONFIG_NET_POLL_CONTROLLER is not set
550# CONFIG_HAMRADIO is not set
551# CONFIG_IRDA is not set
552# CONFIG_BT is not set
553CONFIG_NETDEVICES=y 647CONFIG_NETDEVICES=y
554# CONFIG_DUMMY is not set 648# CONFIG_DUMMY is not set
555# CONFIG_BONDING is not set 649# CONFIG_BONDING is not set
556# CONFIG_EQUALIZER is not set 650# CONFIG_EQUALIZER is not set
557# CONFIG_TUN is not set 651CONFIG_TUN=m
558 652
559# 653#
560# ARCnet devices 654# ARCnet devices
@@ -588,6 +682,8 @@ CONFIG_TULIP_MMIO=y
588CONFIG_DE4X5=m 682CONFIG_DE4X5=m
589# CONFIG_WINBOND_840 is not set 683# CONFIG_WINBOND_840 is not set
590# CONFIG_DM9102 is not set 684# CONFIG_DM9102 is not set
685# CONFIG_PCMCIA_XIRCOM is not set
686# CONFIG_PCMCIA_XIRTULIP is not set
591# CONFIG_AT1700 is not set 687# CONFIG_AT1700 is not set
592# CONFIG_DEPCA is not set 688# CONFIG_DEPCA is not set
593# CONFIG_HP100 is not set 689# CONFIG_HP100 is not set
@@ -626,9 +722,12 @@ CONFIG_PCNET32=y
626# CONFIG_HAMACHI is not set 722# CONFIG_HAMACHI is not set
627# CONFIG_YELLOWFIN is not set 723# CONFIG_YELLOWFIN is not set
628# CONFIG_R8169 is not set 724# CONFIG_R8169 is not set
725# CONFIG_SKGE is not set
629# CONFIG_SK98LIN is not set 726# CONFIG_SK98LIN is not set
630# CONFIG_VIA_VELOCITY is not set 727# CONFIG_VIA_VELOCITY is not set
631# CONFIG_TIGON3 is not set 728# CONFIG_TIGON3 is not set
729# CONFIG_BNX2 is not set
730# CONFIG_MV643XX_ETH is not set
632 731
633# 732#
634# Ethernet (10000 Mbit) 733# Ethernet (10000 Mbit)
@@ -676,18 +775,19 @@ CONFIG_NET_WIRELESS=y
676# CONFIG_WAN is not set 775# CONFIG_WAN is not set
677# CONFIG_FDDI is not set 776# CONFIG_FDDI is not set
678# CONFIG_HIPPI is not set 777# CONFIG_HIPPI is not set
778# CONFIG_PLIP is not set
679CONFIG_PPP=y 779CONFIG_PPP=y
680CONFIG_PPP_MULTILINK=y 780CONFIG_PPP_MULTILINK=y
681CONFIG_PPP_FILTER=y 781CONFIG_PPP_FILTER=y
682CONFIG_PPP_ASYNC=y 782CONFIG_PPP_ASYNC=y
683# CONFIG_PPP_SYNC_TTY is not set 783# CONFIG_PPP_SYNC_TTY is not set
684CONFIG_PPP_DEFLATE=y 784CONFIG_PPP_DEFLATE=y
685# CONFIG_PPP_BSDCOMP is not set 785CONFIG_PPP_BSDCOMP=m
686# CONFIG_PPPOE is not set 786CONFIG_PPPOE=m
687# CONFIG_SLIP is not set 787# CONFIG_SLIP is not set
688# CONFIG_NET_FC is not set 788# CONFIG_NET_FC is not set
689# CONFIG_SHAPER is not set 789# CONFIG_SHAPER is not set
690# CONFIG_NETCONSOLE is not set 790CONFIG_NETCONSOLE=m
691 791
692# 792#
693# ISDN subsystem 793# ISDN subsystem
@@ -708,7 +808,7 @@ CONFIG_INPUT=y
708# Userland interfaces 808# Userland interfaces
709# 809#
710CONFIG_INPUT_MOUSEDEV=y 810CONFIG_INPUT_MOUSEDEV=y
711CONFIG_INPUT_MOUSEDEV_PSAUX=y 811# CONFIG_INPUT_MOUSEDEV_PSAUX is not set
712CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024 812CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024
713CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768 813CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768
714# CONFIG_INPUT_JOYDEV is not set 814# CONFIG_INPUT_JOYDEV is not set
@@ -717,18 +817,6 @@ CONFIG_INPUT_EVDEV=y
717CONFIG_INPUT_EVBUG=m 817CONFIG_INPUT_EVBUG=m
718 818
719# 819#
720# Input I/O drivers
721#
722# CONFIG_GAMEPORT is not set
723CONFIG_SOUND_GAMEPORT=y
724CONFIG_SERIO=y
725CONFIG_SERIO_I8042=y
726# CONFIG_SERIO_SERPORT is not set
727# CONFIG_SERIO_CT82C710 is not set
728# CONFIG_SERIO_PCIPS2 is not set
729# CONFIG_SERIO_RAW is not set
730
731#
732# Input Device Drivers 820# Input Device Drivers
733# 821#
734CONFIG_INPUT_KEYBOARD=y 822CONFIG_INPUT_KEYBOARD=y
@@ -751,6 +839,18 @@ CONFIG_INPUT_MISC=y
751CONFIG_INPUT_UINPUT=m 839CONFIG_INPUT_UINPUT=m
752 840
753# 841#
842# Hardware I/O ports
843#
844CONFIG_SERIO=y
845CONFIG_SERIO_I8042=y
846# CONFIG_SERIO_SERPORT is not set
847# CONFIG_SERIO_PARKBD is not set
848# CONFIG_SERIO_PCIPS2 is not set
849CONFIG_SERIO_LIBPS2=y
850# CONFIG_SERIO_RAW is not set
851# CONFIG_GAMEPORT is not set
852
853#
754# Character devices 854# Character devices
755# 855#
756CONFIG_VT=y 856CONFIG_VT=y
@@ -761,7 +861,8 @@ CONFIG_HW_CONSOLE=y
761# 861#
762# Serial drivers 862# Serial drivers
763# 863#
764CONFIG_SERIAL_8250=m 864CONFIG_SERIAL_8250=y
865CONFIG_SERIAL_8250_CONSOLE=y
765CONFIG_SERIAL_8250_NR_UARTS=4 866CONFIG_SERIAL_8250_NR_UARTS=4
766# CONFIG_SERIAL_8250_EXTENDED is not set 867# CONFIG_SERIAL_8250_EXTENDED is not set
767 868
@@ -769,11 +870,16 @@ CONFIG_SERIAL_8250_NR_UARTS=4
769# Non-8250 serial port support 870# Non-8250 serial port support
770# 871#
771CONFIG_SERIAL_CORE=y 872CONFIG_SERIAL_CORE=y
873CONFIG_SERIAL_CORE_CONSOLE=y
772CONFIG_SERIAL_PMACZILOG=y 874CONFIG_SERIAL_PMACZILOG=y
773# CONFIG_SERIAL_PMACZILOG_CONSOLE is not set 875CONFIG_SERIAL_PMACZILOG_CONSOLE=y
876# CONFIG_SERIAL_JSM is not set
774CONFIG_UNIX98_PTYS=y 877CONFIG_UNIX98_PTYS=y
775CONFIG_LEGACY_PTYS=y 878CONFIG_LEGACY_PTYS=y
776CONFIG_LEGACY_PTY_COUNT=256 879CONFIG_LEGACY_PTY_COUNT=256
880# CONFIG_PRINTER is not set
881# CONFIG_PPDEV is not set
882# CONFIG_TIPAR is not set
777 883
778# 884#
779# IPMI 885# IPMI
@@ -794,11 +900,23 @@ CONFIG_GEN_RTC=y
794# 900#
795# Ftape, the floppy tape device driver 901# Ftape, the floppy tape device driver
796# 902#
797# CONFIG_AGP is not set 903CONFIG_AGP=m
798# CONFIG_DRM is not set 904CONFIG_AGP_UNINORTH=m
905CONFIG_DRM=m
906# CONFIG_DRM_TDFX is not set
907CONFIG_DRM_R128=m
908CONFIG_DRM_RADEON=m
909# CONFIG_DRM_MGA is not set
910# CONFIG_DRM_SIS is not set
911# CONFIG_DRM_VIA is not set
799# CONFIG_RAW_DRIVER is not set 912# CONFIG_RAW_DRIVER is not set
800 913
801# 914#
915# TPM devices
916#
917# CONFIG_TCG_TPM is not set
918
919#
802# I2C support 920# I2C support
803# 921#
804CONFIG_I2C=y 922CONFIG_I2C=y
@@ -823,11 +941,13 @@ CONFIG_I2C_ALGOBIT=y
823CONFIG_I2C_HYDRA=y 941CONFIG_I2C_HYDRA=y
824# CONFIG_I2C_I801 is not set 942# CONFIG_I2C_I801 is not set
825# CONFIG_I2C_I810 is not set 943# CONFIG_I2C_I810 is not set
944# CONFIG_I2C_PIIX4 is not set
826# CONFIG_I2C_ISA is not set 945# CONFIG_I2C_ISA is not set
827CONFIG_I2C_KEYWEST=m 946CONFIG_I2C_KEYWEST=m
947# CONFIG_I2C_MPC is not set
828# CONFIG_I2C_NFORCE2 is not set 948# CONFIG_I2C_NFORCE2 is not set
949# CONFIG_I2C_PARPORT is not set
829# CONFIG_I2C_PARPORT_LIGHT is not set 950# CONFIG_I2C_PARPORT_LIGHT is not set
830# CONFIG_I2C_PIIX4 is not set
831# CONFIG_I2C_PROSAVAGE is not set 951# CONFIG_I2C_PROSAVAGE is not set
832# CONFIG_I2C_SAVAGE4 is not set 952# CONFIG_I2C_SAVAGE4 is not set
833# CONFIG_SCx200_ACB is not set 953# CONFIG_SCx200_ACB is not set
@@ -839,43 +959,20 @@ CONFIG_I2C_KEYWEST=m
839# CONFIG_I2C_VIAPRO is not set 959# CONFIG_I2C_VIAPRO is not set
840# CONFIG_I2C_VOODOO3 is not set 960# CONFIG_I2C_VOODOO3 is not set
841# CONFIG_I2C_PCA_ISA is not set 961# CONFIG_I2C_PCA_ISA is not set
962# CONFIG_I2C_SENSOR is not set
842 963
843# 964#
844# Hardware Sensors Chip support 965# Miscellaneous I2C Chip support
845#
846# CONFIG_I2C_SENSOR is not set
847# CONFIG_SENSORS_ADM1021 is not set
848# CONFIG_SENSORS_ADM1025 is not set
849# CONFIG_SENSORS_ADM1031 is not set
850# CONFIG_SENSORS_ASB100 is not set
851# CONFIG_SENSORS_DS1621 is not set
852# CONFIG_SENSORS_FSCHER is not set
853# CONFIG_SENSORS_GL518SM is not set
854# CONFIG_SENSORS_IT87 is not set
855# CONFIG_SENSORS_LM63 is not set
856# CONFIG_SENSORS_LM75 is not set
857# CONFIG_SENSORS_LM77 is not set
858# CONFIG_SENSORS_LM78 is not set
859# CONFIG_SENSORS_LM80 is not set
860# CONFIG_SENSORS_LM83 is not set
861# CONFIG_SENSORS_LM85 is not set
862# CONFIG_SENSORS_LM87 is not set
863# CONFIG_SENSORS_LM90 is not set
864# CONFIG_SENSORS_MAX1619 is not set
865# CONFIG_SENSORS_PC87360 is not set
866# CONFIG_SENSORS_SMSC47M1 is not set
867# CONFIG_SENSORS_VIA686A is not set
868# CONFIG_SENSORS_W83781D is not set
869# CONFIG_SENSORS_W83L785TS is not set
870# CONFIG_SENSORS_W83627HF is not set
871
872#
873# Other I2C Chip support
874# 966#
967# CONFIG_SENSORS_DS1337 is not set
968# CONFIG_SENSORS_DS1374 is not set
875# CONFIG_SENSORS_EEPROM is not set 969# CONFIG_SENSORS_EEPROM is not set
876# CONFIG_SENSORS_PCF8574 is not set 970# CONFIG_SENSORS_PCF8574 is not set
971# CONFIG_SENSORS_PCA9539 is not set
877# CONFIG_SENSORS_PCF8591 is not set 972# CONFIG_SENSORS_PCF8591 is not set
878# CONFIG_SENSORS_RTC8564 is not set 973# CONFIG_SENSORS_RTC8564 is not set
974# CONFIG_SENSORS_M41T00 is not set
975# CONFIG_SENSORS_MAX6875 is not set
879# CONFIG_I2C_DEBUG_CORE is not set 976# CONFIG_I2C_DEBUG_CORE is not set
880# CONFIG_I2C_DEBUG_ALGO is not set 977# CONFIG_I2C_DEBUG_ALGO is not set
881# CONFIG_I2C_DEBUG_BUS is not set 978# CONFIG_I2C_DEBUG_BUS is not set
@@ -887,6 +984,11 @@ CONFIG_I2C_KEYWEST=m
887# CONFIG_W1 is not set 984# CONFIG_W1 is not set
888 985
889# 986#
987# Hardware Monitoring support
988#
989# CONFIG_HWMON is not set
990
991#
890# Misc devices 992# Misc devices
891# 993#
892 994
@@ -904,8 +1006,13 @@ CONFIG_I2C_KEYWEST=m
904# Graphics support 1006# Graphics support
905# 1007#
906CONFIG_FB=y 1008CONFIG_FB=y
1009CONFIG_FB_CFB_FILLRECT=y
1010CONFIG_FB_CFB_COPYAREA=y
1011CONFIG_FB_CFB_IMAGEBLIT=y
1012CONFIG_FB_SOFT_CURSOR=y
1013CONFIG_FB_MACMODES=y
907CONFIG_FB_MODE_HELPERS=y 1014CONFIG_FB_MODE_HELPERS=y
908# CONFIG_FB_TILEBLITTING is not set 1015CONFIG_FB_TILEBLITTING=y
909# CONFIG_FB_CIRRUS is not set 1016# CONFIG_FB_CIRRUS is not set
910# CONFIG_FB_PM2 is not set 1017# CONFIG_FB_PM2 is not set
911# CONFIG_FB_CYBER2000 is not set 1018# CONFIG_FB_CYBER2000 is not set
@@ -917,13 +1024,16 @@ CONFIG_FB_CT65550=y
917# CONFIG_FB_ASILIANT is not set 1024# CONFIG_FB_ASILIANT is not set
918CONFIG_FB_IMSTT=y 1025CONFIG_FB_IMSTT=y
919# CONFIG_FB_VGA16 is not set 1026# CONFIG_FB_VGA16 is not set
920# CONFIG_FB_RIVA is not set 1027# CONFIG_FB_NVIDIA is not set
1028CONFIG_FB_RIVA=y
1029CONFIG_FB_RIVA_I2C=y
1030# CONFIG_FB_RIVA_DEBUG is not set
921CONFIG_FB_MATROX=y 1031CONFIG_FB_MATROX=y
922CONFIG_FB_MATROX_MILLENIUM=y 1032CONFIG_FB_MATROX_MILLENIUM=y
923CONFIG_FB_MATROX_MYSTIQUE=y 1033CONFIG_FB_MATROX_MYSTIQUE=y
924# CONFIG_FB_MATROX_G450 is not set 1034CONFIG_FB_MATROX_G=y
925# CONFIG_FB_MATROX_G100A is not set
926CONFIG_FB_MATROX_I2C=y 1035CONFIG_FB_MATROX_I2C=y
1036CONFIG_FB_MATROX_MAVEN=m
927# CONFIG_FB_MATROX_MULTIHEAD is not set 1037# CONFIG_FB_MATROX_MULTIHEAD is not set
928# CONFIG_FB_RADEON_OLD is not set 1038# CONFIG_FB_RADEON_OLD is not set
929CONFIG_FB_RADEON=y 1039CONFIG_FB_RADEON=y
@@ -932,8 +1042,8 @@ CONFIG_FB_RADEON_I2C=y
932CONFIG_FB_ATY128=y 1042CONFIG_FB_ATY128=y
933CONFIG_FB_ATY=y 1043CONFIG_FB_ATY=y
934CONFIG_FB_ATY_CT=y 1044CONFIG_FB_ATY_CT=y
935# CONFIG_FB_ATY_GENERIC_LCD is not set 1045CONFIG_FB_ATY_GENERIC_LCD=y
936# CONFIG_FB_ATY_XL_INIT is not set 1046CONFIG_FB_ATY_XL_INIT=y
937CONFIG_FB_ATY_GX=y 1047CONFIG_FB_ATY_GX=y
938# CONFIG_FB_SAVAGE is not set 1048# CONFIG_FB_SAVAGE is not set
939# CONFIG_FB_SIS is not set 1049# CONFIG_FB_SIS is not set
@@ -943,6 +1053,7 @@ CONFIG_FB_3DFX=y
943# CONFIG_FB_3DFX_ACCEL is not set 1053# CONFIG_FB_3DFX_ACCEL is not set
944# CONFIG_FB_VOODOO1 is not set 1054# CONFIG_FB_VOODOO1 is not set
945# CONFIG_FB_TRIDENT is not set 1055# CONFIG_FB_TRIDENT is not set
1056# CONFIG_FB_S1D13XXX is not set
946# CONFIG_FB_VIRTUAL is not set 1057# CONFIG_FB_VIRTUAL is not set
947 1058
948# 1059#
@@ -960,9 +1071,10 @@ CONFIG_FONT_8x16=y
960# Logo configuration 1071# Logo configuration
961# 1072#
962CONFIG_LOGO=y 1073CONFIG_LOGO=y
963CONFIG_LOGO_LINUX_MONO=y 1074# CONFIG_LOGO_LINUX_MONO is not set
964CONFIG_LOGO_LINUX_VGA16=y 1075# CONFIG_LOGO_LINUX_VGA16 is not set
965CONFIG_LOGO_LINUX_CLUT224=y 1076CONFIG_LOGO_LINUX_CLUT224=y
1077# CONFIG_BACKLIGHT_LCD_SUPPORT is not set
966 1078
967# 1079#
968# Sound 1080# Sound
@@ -987,6 +1099,7 @@ CONFIG_SND_PCM_OSS=m
987CONFIG_SND_SEQUENCER_OSS=y 1099CONFIG_SND_SEQUENCER_OSS=y
988# CONFIG_SND_VERBOSE_PRINTK is not set 1100# CONFIG_SND_VERBOSE_PRINTK is not set
989# CONFIG_SND_DEBUG is not set 1101# CONFIG_SND_DEBUG is not set
1102CONFIG_SND_GENERIC_PM=y
990 1103
991# 1104#
992# Generic devices 1105# Generic devices
@@ -1002,6 +1115,7 @@ CONFIG_SND_OPL3_LIB=m
1002# 1115#
1003# ISA devices 1116# ISA devices
1004# 1117#
1118CONFIG_SND_CS4231_LIB=m
1005# CONFIG_SND_AD1848 is not set 1119# CONFIG_SND_AD1848 is not set
1006# CONFIG_SND_CS4231 is not set 1120# CONFIG_SND_CS4231 is not set
1007CONFIG_SND_CS4232=m 1121CONFIG_SND_CS4232=m
@@ -1039,6 +1153,8 @@ CONFIG_SND_CS4232=m
1039# CONFIG_SND_CS46XX is not set 1153# CONFIG_SND_CS46XX is not set
1040# CONFIG_SND_CS4281 is not set 1154# CONFIG_SND_CS4281 is not set
1041# CONFIG_SND_EMU10K1 is not set 1155# CONFIG_SND_EMU10K1 is not set
1156# CONFIG_SND_EMU10K1X is not set
1157# CONFIG_SND_CA0106 is not set
1042# CONFIG_SND_KORG1212 is not set 1158# CONFIG_SND_KORG1212 is not set
1043# CONFIG_SND_MIXART is not set 1159# CONFIG_SND_MIXART is not set
1044# CONFIG_SND_NM256 is not set 1160# CONFIG_SND_NM256 is not set
@@ -1046,6 +1162,7 @@ CONFIG_SND_CS4232=m
1046# CONFIG_SND_RME96 is not set 1162# CONFIG_SND_RME96 is not set
1047# CONFIG_SND_RME9652 is not set 1163# CONFIG_SND_RME9652 is not set
1048# CONFIG_SND_HDSP is not set 1164# CONFIG_SND_HDSP is not set
1165# CONFIG_SND_HDSPM is not set
1049# CONFIG_SND_TRIDENT is not set 1166# CONFIG_SND_TRIDENT is not set
1050# CONFIG_SND_YMFPCI is not set 1167# CONFIG_SND_YMFPCI is not set
1051# CONFIG_SND_ALS4000 is not set 1168# CONFIG_SND_ALS4000 is not set
@@ -1062,7 +1179,9 @@ CONFIG_SND_CS4232=m
1062# CONFIG_SND_INTEL8X0M is not set 1179# CONFIG_SND_INTEL8X0M is not set
1063# CONFIG_SND_SONICVIBES is not set 1180# CONFIG_SND_SONICVIBES is not set
1064# CONFIG_SND_VIA82XX is not set 1181# CONFIG_SND_VIA82XX is not set
1182# CONFIG_SND_VIA82XX_MODEM is not set
1065# CONFIG_SND_VX222 is not set 1183# CONFIG_SND_VX222 is not set
1184# CONFIG_SND_HDA_INTEL is not set
1066 1185
1067# 1186#
1068# ALSA PowerMac devices 1187# ALSA PowerMac devices
@@ -1083,6 +1202,8 @@ CONFIG_SND_USB_AUDIO=m
1083# 1202#
1084# USB support 1203# USB support
1085# 1204#
1205CONFIG_USB_ARCH_HAS_HCD=y
1206CONFIG_USB_ARCH_HAS_OHCI=y
1086CONFIG_USB=y 1207CONFIG_USB=y
1087# CONFIG_USB_DEBUG is not set 1208# CONFIG_USB_DEBUG is not set
1088 1209
@@ -1094,15 +1215,19 @@ CONFIG_USB_DEVICEFS=y
1094# CONFIG_USB_DYNAMIC_MINORS is not set 1215# CONFIG_USB_DYNAMIC_MINORS is not set
1095# CONFIG_USB_SUSPEND is not set 1216# CONFIG_USB_SUSPEND is not set
1096# CONFIG_USB_OTG is not set 1217# CONFIG_USB_OTG is not set
1097CONFIG_USB_ARCH_HAS_HCD=y
1098CONFIG_USB_ARCH_HAS_OHCI=y
1099 1218
1100# 1219#
1101# USB Host Controller Drivers 1220# USB Host Controller Drivers
1102# 1221#
1103# CONFIG_USB_EHCI_HCD is not set 1222CONFIG_USB_EHCI_HCD=m
1223CONFIG_USB_EHCI_SPLIT_ISO=y
1224CONFIG_USB_EHCI_ROOT_HUB_TT=y
1225# CONFIG_USB_ISP116X_HCD is not set
1104CONFIG_USB_OHCI_HCD=y 1226CONFIG_USB_OHCI_HCD=y
1105# CONFIG_USB_UHCI_HCD is not set 1227# CONFIG_USB_OHCI_BIG_ENDIAN is not set
1228CONFIG_USB_OHCI_LITTLE_ENDIAN=y
1229CONFIG_USB_UHCI_HCD=m
1230# CONFIG_USB_SL811_HCD is not set
1106 1231
1107# 1232#
1108# USB Device Class drivers 1233# USB Device Class drivers
@@ -1112,17 +1237,20 @@ CONFIG_USB_OHCI_HCD=y
1112# CONFIG_USB_MIDI is not set 1237# CONFIG_USB_MIDI is not set
1113CONFIG_USB_ACM=m 1238CONFIG_USB_ACM=m
1114CONFIG_USB_PRINTER=m 1239CONFIG_USB_PRINTER=m
1240
1241#
1242# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support' may also be needed; see USB_STORAGE Help for more information
1243#
1115CONFIG_USB_STORAGE=m 1244CONFIG_USB_STORAGE=m
1116# CONFIG_USB_STORAGE_DEBUG is not set 1245# CONFIG_USB_STORAGE_DEBUG is not set
1117# CONFIG_USB_STORAGE_RW_DETECT is not set 1246CONFIG_USB_STORAGE_DATAFAB=y
1118# CONFIG_USB_STORAGE_DATAFAB is not set
1119CONFIG_USB_STORAGE_FREECOM=y 1247CONFIG_USB_STORAGE_FREECOM=y
1120# CONFIG_USB_STORAGE_ISD200 is not set 1248CONFIG_USB_STORAGE_ISD200=y
1121CONFIG_USB_STORAGE_DPCM=y 1249CONFIG_USB_STORAGE_DPCM=y
1122# CONFIG_USB_STORAGE_HP8200e is not set 1250CONFIG_USB_STORAGE_USBAT=y
1123# CONFIG_USB_STORAGE_SDDR09 is not set 1251CONFIG_USB_STORAGE_SDDR09=y
1124# CONFIG_USB_STORAGE_SDDR55 is not set 1252CONFIG_USB_STORAGE_SDDR55=y
1125# CONFIG_USB_STORAGE_JUMPSHOT is not set 1253CONFIG_USB_STORAGE_JUMPSHOT=y
1126 1254
1127# 1255#
1128# USB Input Devices 1256# USB Input Devices
@@ -1130,22 +1258,24 @@ CONFIG_USB_STORAGE_DPCM=y
1130CONFIG_USB_HID=y 1258CONFIG_USB_HID=y
1131CONFIG_USB_HIDINPUT=y 1259CONFIG_USB_HIDINPUT=y
1132# CONFIG_HID_FF is not set 1260# CONFIG_HID_FF is not set
1133# CONFIG_USB_HIDDEV is not set 1261CONFIG_USB_HIDDEV=y
1134# CONFIG_USB_AIPTEK is not set 1262# CONFIG_USB_AIPTEK is not set
1135# CONFIG_USB_WACOM is not set 1263# CONFIG_USB_WACOM is not set
1264# CONFIG_USB_ACECAD is not set
1136# CONFIG_USB_KBTAB is not set 1265# CONFIG_USB_KBTAB is not set
1137# CONFIG_USB_POWERMATE is not set 1266# CONFIG_USB_POWERMATE is not set
1138# CONFIG_USB_MTOUCH is not set 1267# CONFIG_USB_MTOUCH is not set
1268# CONFIG_USB_ITMTOUCH is not set
1139# CONFIG_USB_EGALAX is not set 1269# CONFIG_USB_EGALAX is not set
1140# CONFIG_USB_XPAD is not set 1270# CONFIG_USB_XPAD is not set
1141# CONFIG_USB_ATI_REMOTE is not set 1271# CONFIG_USB_ATI_REMOTE is not set
1272# CONFIG_USB_KEYSPAN_REMOTE is not set
1142 1273
1143# 1274#
1144# USB Imaging devices 1275# USB Imaging devices
1145# 1276#
1146# CONFIG_USB_MDC800 is not set 1277# CONFIG_USB_MDC800 is not set
1147# CONFIG_USB_MICROTEK is not set 1278# CONFIG_USB_MICROTEK is not set
1148# CONFIG_USB_HPUSBSCSI is not set
1149 1279
1150# 1280#
1151# USB Multimedia devices 1281# USB Multimedia devices
@@ -1161,22 +1291,27 @@ CONFIG_USB_HIDINPUT=y
1161# 1291#
1162# CONFIG_USB_CATC is not set 1292# CONFIG_USB_CATC is not set
1163# CONFIG_USB_KAWETH is not set 1293# CONFIG_USB_KAWETH is not set
1164# CONFIG_USB_PEGASUS is not set 1294CONFIG_USB_PEGASUS=m
1165# CONFIG_USB_RTL8150 is not set 1295# CONFIG_USB_RTL8150 is not set
1166# CONFIG_USB_USBNET is not set 1296# CONFIG_USB_USBNET is not set
1297# CONFIG_USB_ZD1201 is not set
1298# CONFIG_USB_MON is not set
1167 1299
1168# 1300#
1169# USB port drivers 1301# USB port drivers
1170# 1302#
1303# CONFIG_USB_USS720 is not set
1171 1304
1172# 1305#
1173# USB Serial Converter support 1306# USB Serial Converter support
1174# 1307#
1175CONFIG_USB_SERIAL=m 1308CONFIG_USB_SERIAL=m
1176# CONFIG_USB_SERIAL_GENERIC is not set 1309# CONFIG_USB_SERIAL_GENERIC is not set
1310# CONFIG_USB_SERIAL_AIRPRIME is not set
1177# CONFIG_USB_SERIAL_BELKIN is not set 1311# CONFIG_USB_SERIAL_BELKIN is not set
1178# CONFIG_USB_SERIAL_WHITEHEAT is not set 1312# CONFIG_USB_SERIAL_WHITEHEAT is not set
1179# CONFIG_USB_SERIAL_DIGI_ACCELEPORT is not set 1313# CONFIG_USB_SERIAL_DIGI_ACCELEPORT is not set
1314# CONFIG_USB_SERIAL_CP2101 is not set
1180# CONFIG_USB_SERIAL_CYPRESS_M8 is not set 1315# CONFIG_USB_SERIAL_CYPRESS_M8 is not set
1181# CONFIG_USB_SERIAL_EMPEG is not set 1316# CONFIG_USB_SERIAL_EMPEG is not set
1182# CONFIG_USB_SERIAL_FTDI_SIO is not set 1317# CONFIG_USB_SERIAL_FTDI_SIO is not set
@@ -1185,28 +1320,32 @@ CONFIG_USB_SERIAL_VISOR=m
1185# CONFIG_USB_SERIAL_IR is not set 1320# CONFIG_USB_SERIAL_IR is not set
1186# CONFIG_USB_SERIAL_EDGEPORT is not set 1321# CONFIG_USB_SERIAL_EDGEPORT is not set
1187# CONFIG_USB_SERIAL_EDGEPORT_TI is not set 1322# CONFIG_USB_SERIAL_EDGEPORT_TI is not set
1323# CONFIG_USB_SERIAL_GARMIN is not set
1188# CONFIG_USB_SERIAL_IPW is not set 1324# CONFIG_USB_SERIAL_IPW is not set
1189# CONFIG_USB_SERIAL_KEYSPAN_PDA is not set 1325# CONFIG_USB_SERIAL_KEYSPAN_PDA is not set
1190CONFIG_USB_SERIAL_KEYSPAN=m 1326CONFIG_USB_SERIAL_KEYSPAN=m
1191# CONFIG_USB_SERIAL_KEYSPAN_MPR is not set 1327CONFIG_USB_SERIAL_KEYSPAN_MPR=y
1192CONFIG_USB_SERIAL_KEYSPAN_USA28=y 1328CONFIG_USB_SERIAL_KEYSPAN_USA28=y
1193CONFIG_USB_SERIAL_KEYSPAN_USA28X=y 1329CONFIG_USB_SERIAL_KEYSPAN_USA28X=y
1194# CONFIG_USB_SERIAL_KEYSPAN_USA28XA is not set 1330CONFIG_USB_SERIAL_KEYSPAN_USA28XA=y
1195# CONFIG_USB_SERIAL_KEYSPAN_USA28XB is not set 1331CONFIG_USB_SERIAL_KEYSPAN_USA28XB=y
1196CONFIG_USB_SERIAL_KEYSPAN_USA19=y 1332CONFIG_USB_SERIAL_KEYSPAN_USA19=y
1197CONFIG_USB_SERIAL_KEYSPAN_USA18X=y 1333CONFIG_USB_SERIAL_KEYSPAN_USA18X=y
1198CONFIG_USB_SERIAL_KEYSPAN_USA19W=y 1334CONFIG_USB_SERIAL_KEYSPAN_USA19W=y
1199CONFIG_USB_SERIAL_KEYSPAN_USA19QW=y 1335CONFIG_USB_SERIAL_KEYSPAN_USA19QW=y
1200CONFIG_USB_SERIAL_KEYSPAN_USA19QI=y 1336CONFIG_USB_SERIAL_KEYSPAN_USA19QI=y
1201CONFIG_USB_SERIAL_KEYSPAN_USA49W=y 1337CONFIG_USB_SERIAL_KEYSPAN_USA49W=y
1202# CONFIG_USB_SERIAL_KEYSPAN_USA49WLC is not set 1338CONFIG_USB_SERIAL_KEYSPAN_USA49WLC=y
1203# CONFIG_USB_SERIAL_KLSI is not set 1339# CONFIG_USB_SERIAL_KLSI is not set
1204# CONFIG_USB_SERIAL_KOBIL_SCT is not set 1340# CONFIG_USB_SERIAL_KOBIL_SCT is not set
1205# CONFIG_USB_SERIAL_MCT_U232 is not set 1341# CONFIG_USB_SERIAL_MCT_U232 is not set
1206# CONFIG_USB_SERIAL_PL2303 is not set 1342# CONFIG_USB_SERIAL_PL2303 is not set
1343# CONFIG_USB_SERIAL_HP4X is not set
1207# CONFIG_USB_SERIAL_SAFE is not set 1344# CONFIG_USB_SERIAL_SAFE is not set
1345# CONFIG_USB_SERIAL_TI is not set
1208# CONFIG_USB_SERIAL_CYBERJACK is not set 1346# CONFIG_USB_SERIAL_CYBERJACK is not set
1209# CONFIG_USB_SERIAL_XIRCOM is not set 1347# CONFIG_USB_SERIAL_XIRCOM is not set
1348# CONFIG_USB_SERIAL_OPTION is not set
1210# CONFIG_USB_SERIAL_OMNINET is not set 1349# CONFIG_USB_SERIAL_OMNINET is not set
1211CONFIG_USB_EZUSB=y 1350CONFIG_USB_EZUSB=y
1212 1351
@@ -1215,7 +1354,6 @@ CONFIG_USB_EZUSB=y
1215# 1354#
1216# CONFIG_USB_EMI62 is not set 1355# CONFIG_USB_EMI62 is not set
1217# CONFIG_USB_EMI26 is not set 1356# CONFIG_USB_EMI26 is not set
1218# CONFIG_USB_TIGL is not set
1219# CONFIG_USB_AUERSWALD is not set 1357# CONFIG_USB_AUERSWALD is not set
1220# CONFIG_USB_RIO500 is not set 1358# CONFIG_USB_RIO500 is not set
1221# CONFIG_USB_LEGOTOWER is not set 1359# CONFIG_USB_LEGOTOWER is not set
@@ -1224,10 +1362,13 @@ CONFIG_USB_EZUSB=y
1224# CONFIG_USB_CYTHERM is not set 1362# CONFIG_USB_CYTHERM is not set
1225# CONFIG_USB_PHIDGETKIT is not set 1363# CONFIG_USB_PHIDGETKIT is not set
1226# CONFIG_USB_PHIDGETSERVO is not set 1364# CONFIG_USB_PHIDGETSERVO is not set
1365# CONFIG_USB_IDMOUSE is not set
1366# CONFIG_USB_SISUSBVGA is not set
1367# CONFIG_USB_LD is not set
1227# CONFIG_USB_TEST is not set 1368# CONFIG_USB_TEST is not set
1228 1369
1229# 1370#
1230# USB ATM/DSL drivers 1371# USB DSL modem support
1231# 1372#
1232 1373
1233# 1374#
@@ -1236,21 +1377,63 @@ CONFIG_USB_EZUSB=y
1236# CONFIG_USB_GADGET is not set 1377# CONFIG_USB_GADGET is not set
1237 1378
1238# 1379#
1380# MMC/SD Card support
1381#
1382# CONFIG_MMC is not set
1383
1384#
1385# InfiniBand support
1386#
1387# CONFIG_INFINIBAND is not set
1388
1389#
1390# SN Devices
1391#
1392
1393#
1239# File systems 1394# File systems
1240# 1395#
1241CONFIG_EXT2_FS=y 1396CONFIG_EXT2_FS=y
1242# CONFIG_EXT2_FS_XATTR is not set 1397CONFIG_EXT2_FS_XATTR=y
1243# CONFIG_EXT3_FS is not set 1398CONFIG_EXT2_FS_POSIX_ACL=y
1244# CONFIG_JBD is not set 1399CONFIG_EXT2_FS_SECURITY=y
1245# CONFIG_REISERFS_FS is not set 1400# CONFIG_EXT2_FS_XIP is not set
1246# CONFIG_JFS_FS is not set 1401CONFIG_EXT3_FS=y
1247# CONFIG_XFS_FS is not set 1402CONFIG_EXT3_FS_XATTR=y
1403CONFIG_EXT3_FS_POSIX_ACL=y
1404CONFIG_EXT3_FS_SECURITY=y
1405CONFIG_JBD=y
1406# CONFIG_JBD_DEBUG is not set
1407CONFIG_FS_MBCACHE=y
1408CONFIG_REISERFS_FS=y
1409# CONFIG_REISERFS_CHECK is not set
1410# CONFIG_REISERFS_PROC_INFO is not set
1411CONFIG_REISERFS_FS_XATTR=y
1412CONFIG_REISERFS_FS_POSIX_ACL=y
1413CONFIG_REISERFS_FS_SECURITY=y
1414CONFIG_JFS_FS=m
1415CONFIG_JFS_POSIX_ACL=y
1416CONFIG_JFS_SECURITY=y
1417# CONFIG_JFS_DEBUG is not set
1418# CONFIG_JFS_STATISTICS is not set
1419CONFIG_FS_POSIX_ACL=y
1420
1421#
1422# XFS support
1423#
1424CONFIG_XFS_FS=m
1425CONFIG_XFS_EXPORT=y
1426# CONFIG_XFS_RT is not set
1427# CONFIG_XFS_QUOTA is not set
1428CONFIG_XFS_SECURITY=y
1429CONFIG_XFS_POSIX_ACL=y
1248# CONFIG_MINIX_FS is not set 1430# CONFIG_MINIX_FS is not set
1249# CONFIG_ROMFS_FS is not set 1431# CONFIG_ROMFS_FS is not set
1432CONFIG_INOTIFY=y
1250# CONFIG_QUOTA is not set 1433# CONFIG_QUOTA is not set
1251CONFIG_DNOTIFY=y 1434CONFIG_DNOTIFY=y
1252# CONFIG_AUTOFS_FS is not set 1435# CONFIG_AUTOFS_FS is not set
1253# CONFIG_AUTOFS4_FS is not set 1436CONFIG_AUTOFS4_FS=m
1254 1437
1255# 1438#
1256# CD-ROM/DVD Filesystems 1439# CD-ROM/DVD Filesystems
@@ -1258,7 +1441,8 @@ CONFIG_DNOTIFY=y
1258CONFIG_ISO9660_FS=y 1441CONFIG_ISO9660_FS=y
1259# CONFIG_JOLIET is not set 1442# CONFIG_JOLIET is not set
1260# CONFIG_ZISOFS is not set 1443# CONFIG_ZISOFS is not set
1261# CONFIG_UDF_FS is not set 1444CONFIG_UDF_FS=m
1445CONFIG_UDF_NLS=y
1262 1446
1263# 1447#
1264# DOS/FAT/NT Filesystems 1448# DOS/FAT/NT Filesystems
@@ -1276,12 +1460,11 @@ CONFIG_FAT_DEFAULT_IOCHARSET="iso8859-1"
1276CONFIG_PROC_FS=y 1460CONFIG_PROC_FS=y
1277CONFIG_PROC_KCORE=y 1461CONFIG_PROC_KCORE=y
1278CONFIG_SYSFS=y 1462CONFIG_SYSFS=y
1279CONFIG_DEVFS_FS=y 1463CONFIG_DEVPTS_FS_XATTR=y
1280# CONFIG_DEVFS_MOUNT is not set 1464CONFIG_DEVPTS_FS_SECURITY=y
1281# CONFIG_DEVFS_DEBUG is not set
1282# CONFIG_DEVPTS_FS_XATTR is not set
1283CONFIG_TMPFS=y 1465CONFIG_TMPFS=y
1284# CONFIG_TMPFS_XATTR is not set 1466CONFIG_TMPFS_XATTR=y
1467CONFIG_TMPFS_SECURITY=y
1285# CONFIG_HUGETLB_PAGE is not set 1468# CONFIG_HUGETLB_PAGE is not set
1286CONFIG_RAMFS=y 1469CONFIG_RAMFS=y
1287 1470
@@ -1295,27 +1478,33 @@ CONFIG_HFSPLUS_FS=m
1295# CONFIG_BEFS_FS is not set 1478# CONFIG_BEFS_FS is not set
1296# CONFIG_BFS_FS is not set 1479# CONFIG_BFS_FS is not set
1297# CONFIG_EFS_FS is not set 1480# CONFIG_EFS_FS is not set
1298# CONFIG_CRAMFS is not set 1481CONFIG_CRAMFS=m
1299# CONFIG_VXFS_FS is not set 1482# CONFIG_VXFS_FS is not set
1300# CONFIG_HPFS_FS is not set 1483# CONFIG_HPFS_FS is not set
1301# CONFIG_QNX4FS_FS is not set 1484# CONFIG_QNX4FS_FS is not set
1302# CONFIG_SYSV_FS is not set 1485# CONFIG_SYSV_FS is not set
1303# CONFIG_UFS_FS is not set 1486CONFIG_UFS_FS=m
1487# CONFIG_UFS_FS_WRITE is not set
1304 1488
1305# 1489#
1306# Network File Systems 1490# Network File Systems
1307# 1491#
1308CONFIG_NFS_FS=y 1492CONFIG_NFS_FS=y
1309CONFIG_NFS_V3=y 1493CONFIG_NFS_V3=y
1494CONFIG_NFS_V3_ACL=y
1310# CONFIG_NFS_V4 is not set 1495# CONFIG_NFS_V4 is not set
1311# CONFIG_NFS_DIRECTIO is not set 1496# CONFIG_NFS_DIRECTIO is not set
1312CONFIG_NFSD=y 1497CONFIG_NFSD=y
1498CONFIG_NFSD_V2_ACL=y
1313CONFIG_NFSD_V3=y 1499CONFIG_NFSD_V3=y
1500CONFIG_NFSD_V3_ACL=y
1314# CONFIG_NFSD_V4 is not set 1501# CONFIG_NFSD_V4 is not set
1315CONFIG_NFSD_TCP=y 1502CONFIG_NFSD_TCP=y
1316CONFIG_LOCKD=y 1503CONFIG_LOCKD=y
1317CONFIG_LOCKD_V4=y 1504CONFIG_LOCKD_V4=y
1318CONFIG_EXPORTFS=y 1505CONFIG_EXPORTFS=y
1506CONFIG_NFS_ACL_SUPPORT=y
1507CONFIG_NFS_COMMON=y
1319CONFIG_SUNRPC=y 1508CONFIG_SUNRPC=y
1320# CONFIG_RPCSEC_GSS_KRB5 is not set 1509# CONFIG_RPCSEC_GSS_KRB5 is not set
1321# CONFIG_RPCSEC_GSS_SPKM3 is not set 1510# CONFIG_RPCSEC_GSS_SPKM3 is not set
@@ -1348,46 +1537,46 @@ CONFIG_MSDOS_PARTITION=y
1348# 1537#
1349# Native Language Support 1538# Native Language Support
1350# 1539#
1351CONFIG_NLS=y 1540CONFIG_NLS=m
1352CONFIG_NLS_DEFAULT="iso8859-1" 1541CONFIG_NLS_DEFAULT="iso8859-1"
1353# CONFIG_NLS_CODEPAGE_437 is not set 1542CONFIG_NLS_CODEPAGE_437=m
1354# CONFIG_NLS_CODEPAGE_737 is not set 1543CONFIG_NLS_CODEPAGE_737=m
1355# CONFIG_NLS_CODEPAGE_775 is not set 1544CONFIG_NLS_CODEPAGE_775=m
1356# CONFIG_NLS_CODEPAGE_850 is not set 1545CONFIG_NLS_CODEPAGE_850=m
1357# CONFIG_NLS_CODEPAGE_852 is not set 1546CONFIG_NLS_CODEPAGE_852=m
1358# CONFIG_NLS_CODEPAGE_855 is not set 1547CONFIG_NLS_CODEPAGE_855=m
1359# CONFIG_NLS_CODEPAGE_857 is not set 1548CONFIG_NLS_CODEPAGE_857=m
1360# CONFIG_NLS_CODEPAGE_860 is not set 1549CONFIG_NLS_CODEPAGE_860=m
1361# CONFIG_NLS_CODEPAGE_861 is not set 1550CONFIG_NLS_CODEPAGE_861=m
1362# CONFIG_NLS_CODEPAGE_862 is not set 1551CONFIG_NLS_CODEPAGE_862=m
1363# CONFIG_NLS_CODEPAGE_863 is not set 1552CONFIG_NLS_CODEPAGE_863=m
1364# CONFIG_NLS_CODEPAGE_864 is not set 1553CONFIG_NLS_CODEPAGE_864=m
1365# CONFIG_NLS_CODEPAGE_865 is not set 1554CONFIG_NLS_CODEPAGE_865=m
1366# CONFIG_NLS_CODEPAGE_866 is not set 1555CONFIG_NLS_CODEPAGE_866=m
1367# CONFIG_NLS_CODEPAGE_869 is not set 1556CONFIG_NLS_CODEPAGE_869=m
1368# CONFIG_NLS_CODEPAGE_936 is not set 1557CONFIG_NLS_CODEPAGE_936=m
1369# CONFIG_NLS_CODEPAGE_950 is not set 1558CONFIG_NLS_CODEPAGE_950=m
1370# CONFIG_NLS_CODEPAGE_932 is not set 1559CONFIG_NLS_CODEPAGE_932=m
1371# CONFIG_NLS_CODEPAGE_949 is not set 1560CONFIG_NLS_CODEPAGE_949=m
1372# CONFIG_NLS_CODEPAGE_874 is not set 1561CONFIG_NLS_CODEPAGE_874=m
1373# CONFIG_NLS_ISO8859_8 is not set 1562CONFIG_NLS_ISO8859_8=m
1374# CONFIG_NLS_CODEPAGE_1250 is not set 1563CONFIG_NLS_CODEPAGE_1250=m
1375# CONFIG_NLS_CODEPAGE_1251 is not set 1564CONFIG_NLS_CODEPAGE_1251=m
1376# CONFIG_NLS_ASCII is not set 1565CONFIG_NLS_ASCII=m
1377CONFIG_NLS_ISO8859_1=m 1566CONFIG_NLS_ISO8859_1=m
1378# CONFIG_NLS_ISO8859_2 is not set 1567CONFIG_NLS_ISO8859_2=m
1379# CONFIG_NLS_ISO8859_3 is not set 1568CONFIG_NLS_ISO8859_3=m
1380# CONFIG_NLS_ISO8859_4 is not set 1569CONFIG_NLS_ISO8859_4=m
1381# CONFIG_NLS_ISO8859_5 is not set 1570CONFIG_NLS_ISO8859_5=m
1382# CONFIG_NLS_ISO8859_6 is not set 1571CONFIG_NLS_ISO8859_6=m
1383# CONFIG_NLS_ISO8859_7 is not set 1572CONFIG_NLS_ISO8859_7=m
1384# CONFIG_NLS_ISO8859_9 is not set 1573CONFIG_NLS_ISO8859_9=m
1385# CONFIG_NLS_ISO8859_13 is not set 1574CONFIG_NLS_ISO8859_13=m
1386# CONFIG_NLS_ISO8859_14 is not set 1575CONFIG_NLS_ISO8859_14=m
1387# CONFIG_NLS_ISO8859_15 is not set 1576CONFIG_NLS_ISO8859_15=m
1388# CONFIG_NLS_KOI8_R is not set 1577CONFIG_NLS_KOI8_R=m
1389# CONFIG_NLS_KOI8_U is not set 1578CONFIG_NLS_KOI8_U=m
1390# CONFIG_NLS_UTF8 is not set 1579CONFIG_NLS_UTF8=m
1391 1580
1392# 1581#
1393# Library routines 1582# Library routines
@@ -1406,7 +1595,19 @@ CONFIG_ZLIB_DEFLATE=y
1406# 1595#
1407# Kernel hacking 1596# Kernel hacking
1408# 1597#
1409# CONFIG_DEBUG_KERNEL is not set 1598# CONFIG_PRINTK_TIME is not set
1599CONFIG_DEBUG_KERNEL=y
1600CONFIG_MAGIC_SYSRQ=y
1601CONFIG_LOG_BUF_SHIFT=14
1602# CONFIG_SCHEDSTATS is not set
1603# CONFIG_DEBUG_SLAB is not set
1604# CONFIG_DEBUG_SPINLOCK is not set
1605# CONFIG_DEBUG_SPINLOCK_SLEEP is not set
1606# CONFIG_DEBUG_KOBJECT is not set
1607# CONFIG_DEBUG_INFO is not set
1608# CONFIG_DEBUG_FS is not set
1609# CONFIG_XMON is not set
1610# CONFIG_BDI_SWITCH is not set
1410CONFIG_BOOTX_TEXT=y 1611CONFIG_BOOTX_TEXT=y
1411 1612
1412# 1613#
@@ -1419,3 +1620,7 @@ CONFIG_BOOTX_TEXT=y
1419# Cryptographic options 1620# Cryptographic options
1420# 1621#
1421# CONFIG_CRYPTO is not set 1622# CONFIG_CRYPTO is not set
1623
1624#
1625# Hardware crypto devices
1626#
diff --git a/arch/ppc/configs/cpci690_defconfig b/arch/ppc/configs/cpci690_defconfig
index 53948793d9af..ff3f7e02ab0f 100644
--- a/arch/ppc/configs/cpci690_defconfig
+++ b/arch/ppc/configs/cpci690_defconfig
@@ -1,15 +1,17 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.10-rc2 3# Linux kernel version: 2.6.13-mm1
4# Fri Dec 3 15:56:10 2004 4# Thu Sep 1 17:10:37 2005
5# 5#
6CONFIG_MMU=y 6CONFIG_MMU=y
7CONFIG_GENERIC_HARDIRQS=y 7CONFIG_GENERIC_HARDIRQS=y
8CONFIG_RWSEM_XCHGADD_ALGORITHM=y 8CONFIG_RWSEM_XCHGADD_ALGORITHM=y
9CONFIG_GENERIC_CALIBRATE_DELAY=y
9CONFIG_HAVE_DEC_LOCK=y 10CONFIG_HAVE_DEC_LOCK=y
10CONFIG_PPC=y 11CONFIG_PPC=y
11CONFIG_PPC32=y 12CONFIG_PPC32=y
12CONFIG_GENERIC_NVRAM=y 13CONFIG_GENERIC_NVRAM=y
14CONFIG_SCHED_NO_NO_OMIT_FRAME_POINTER=y
13 15
14# 16#
15# Code maturity level options 17# Code maturity level options
@@ -17,33 +19,38 @@ CONFIG_GENERIC_NVRAM=y
17CONFIG_EXPERIMENTAL=y 19CONFIG_EXPERIMENTAL=y
18CONFIG_CLEAN_COMPILE=y 20CONFIG_CLEAN_COMPILE=y
19CONFIG_BROKEN_ON_SMP=y 21CONFIG_BROKEN_ON_SMP=y
22CONFIG_INIT_ENV_ARG_LIMIT=32
20 23
21# 24#
22# General setup 25# General setup
23# 26#
24CONFIG_LOCALVERSION="" 27CONFIG_LOCALVERSION=""
28CONFIG_LOCALVERSION_AUTO=y
25# CONFIG_SWAP is not set 29# CONFIG_SWAP is not set
26CONFIG_SYSVIPC=y 30CONFIG_SYSVIPC=y
27# CONFIG_POSIX_MQUEUE is not set 31# CONFIG_POSIX_MQUEUE is not set
28# CONFIG_BSD_PROCESS_ACCT is not set 32# CONFIG_BSD_PROCESS_ACCT is not set
29CONFIG_SYSCTL=y 33CONFIG_SYSCTL=y
30# CONFIG_AUDIT is not set 34# CONFIG_AUDIT is not set
31CONFIG_LOG_BUF_SHIFT=14
32# CONFIG_HOTPLUG is not set 35# CONFIG_HOTPLUG is not set
33CONFIG_KOBJECT_UEVENT=y 36CONFIG_KOBJECT_UEVENT=y
34# CONFIG_IKCONFIG is not set 37# CONFIG_IKCONFIG is not set
38CONFIG_INITRAMFS_SOURCE=""
35# CONFIG_EMBEDDED is not set 39# CONFIG_EMBEDDED is not set
36CONFIG_KALLSYMS=y 40CONFIG_KALLSYMS=y
37# CONFIG_KALLSYMS_EXTRA_PASS is not set 41# CONFIG_KALLSYMS_EXTRA_PASS is not set
42CONFIG_PRINTK=y
43CONFIG_BUG=y
44CONFIG_BASE_FULL=y
38CONFIG_FUTEX=y 45CONFIG_FUTEX=y
39CONFIG_EPOLL=y 46CONFIG_EPOLL=y
40# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
41CONFIG_SHMEM=y 47CONFIG_SHMEM=y
42CONFIG_CC_ALIGN_FUNCTIONS=0 48CONFIG_CC_ALIGN_FUNCTIONS=0
43CONFIG_CC_ALIGN_LABELS=0 49CONFIG_CC_ALIGN_LABELS=0
44CONFIG_CC_ALIGN_LOOPS=0 50CONFIG_CC_ALIGN_LOOPS=0
45CONFIG_CC_ALIGN_JUMPS=0 51CONFIG_CC_ALIGN_JUMPS=0
46# CONFIG_TINY_SHMEM is not set 52# CONFIG_TINY_SHMEM is not set
53CONFIG_BASE_SMALL=0
47 54
48# 55#
49# Loadable module support 56# Loadable module support
@@ -65,38 +72,42 @@ CONFIG_6xx=y
65# CONFIG_POWER3 is not set 72# CONFIG_POWER3 is not set
66# CONFIG_POWER4 is not set 73# CONFIG_POWER4 is not set
67# CONFIG_8xx is not set 74# CONFIG_8xx is not set
75# CONFIG_E200 is not set
68# CONFIG_E500 is not set 76# CONFIG_E500 is not set
77CONFIG_PPC_FPU=y
69CONFIG_ALTIVEC=y 78CONFIG_ALTIVEC=y
70# CONFIG_TAU is not set 79# CONFIG_TAU is not set
80# CONFIG_KEXEC is not set
71# CONFIG_CPU_FREQ is not set 81# CONFIG_CPU_FREQ is not set
82# CONFIG_WANT_EARLY_SERIAL is not set
72CONFIG_PPC_STD_MMU=y 83CONFIG_PPC_STD_MMU=y
73# CONFIG_NOT_COHERENT_CACHE is not set 84# CONFIG_NOT_COHERENT_CACHE is not set
74 85
75# 86#
87# Performance-monitoring counters support
88#
89# CONFIG_PERFCTR is not set
90
91#
76# Platform options 92# Platform options
77# 93#
78# CONFIG_PPC_MULTIPLATFORM is not set 94# CONFIG_PPC_MULTIPLATFORM is not set
79# CONFIG_APUS is not set 95# CONFIG_APUS is not set
80# CONFIG_KATANA is not set 96# CONFIG_KATANA is not set
81# CONFIG_DMV182 is not set
82# CONFIG_WILLOW is not set 97# CONFIG_WILLOW is not set
83CONFIG_CPCI690=y 98CONFIG_CPCI690=y
84# CONFIG_PCORE is not set
85# CONFIG_POWERPMC250 is not set 99# CONFIG_POWERPMC250 is not set
86# CONFIG_EV64260 is not set
87# CONFIG_DB64360 is not set
88# CONFIG_CHESTNUT is not set 100# CONFIG_CHESTNUT is not set
89# CONFIG_SPRUCE is not set 101# CONFIG_SPRUCE is not set
102# CONFIG_HDPU is not set
103# CONFIG_EV64260 is not set
90# CONFIG_LOPEC is not set 104# CONFIG_LOPEC is not set
91# CONFIG_MCPN765 is not set
92# CONFIG_MVME5100 is not set 105# CONFIG_MVME5100 is not set
93# CONFIG_PPLUS is not set 106# CONFIG_PPLUS is not set
94# CONFIG_PRPMC750 is not set 107# CONFIG_PRPMC750 is not set
95# CONFIG_PRPMC800 is not set 108# CONFIG_PRPMC800 is not set
96# CONFIG_PRPMC880 is not set
97# CONFIG_SANDPOINT is not set 109# CONFIG_SANDPOINT is not set
98# CONFIG_ADIR is not set 110# CONFIG_RADSTONE_PPC7D is not set
99# CONFIG_K2 is not set
100# CONFIG_PAL4 is not set 111# CONFIG_PAL4 is not set
101# CONFIG_GEMINI is not set 112# CONFIG_GEMINI is not set
102# CONFIG_EST8260 is not set 113# CONFIG_EST8260 is not set
@@ -105,22 +116,41 @@ CONFIG_CPCI690=y
105# CONFIG_RPX8260 is not set 116# CONFIG_RPX8260 is not set
106# CONFIG_TQM8260 is not set 117# CONFIG_TQM8260 is not set
107# CONFIG_ADS8272 is not set 118# CONFIG_ADS8272 is not set
119# CONFIG_PQ2FADS is not set
108# CONFIG_LITE5200 is not set 120# CONFIG_LITE5200 is not set
121# CONFIG_MPC834x_SYS is not set
122# CONFIG_EV64360 is not set
123CONFIG_GT64260=y
124CONFIG_MV64X60=y
109 125
110# 126#
111# Set bridge options 127# Set bridge options
112# 128#
113CONFIG_MV64X60_BASE=0xf1000000 129CONFIG_MV64X60_BASE=0xf1000000
114CONFIG_MV64X60_NEW_BASE=0xf1000000 130CONFIG_MV64X60_NEW_BASE=0xf1000000
115CONFIG_GT64260=y
116CONFIG_MV64X60=y
117# CONFIG_SMP is not set 131# CONFIG_SMP is not set
132CONFIG_HIGHMEM=y
133CONFIG_HZ_100=y
134# CONFIG_HZ_250 is not set
135# CONFIG_HZ_1000 is not set
136CONFIG_HZ=100
137CONFIG_PREEMPT_NONE=y
138# CONFIG_PREEMPT_VOLUNTARY is not set
118# CONFIG_PREEMPT is not set 139# CONFIG_PREEMPT is not set
119# CONFIG_HIGHMEM is not set 140CONFIG_SELECT_MEMORY_MODEL=y
141CONFIG_FLATMEM_MANUAL=y
142# CONFIG_DISCONTIGMEM_MANUAL is not set
143# CONFIG_SPARSEMEM_MANUAL is not set
144CONFIG_FLATMEM=y
145CONFIG_FLAT_NODE_MEM_MAP=y
146# CONFIG_SPARSEMEM_STATIC is not set
120CONFIG_BINFMT_ELF=y 147CONFIG_BINFMT_ELF=y
121CONFIG_BINFMT_MISC=y 148CONFIG_BINFMT_MISC=y
122CONFIG_CMDLINE_BOOL=y 149CONFIG_CMDLINE_BOOL=y
123CONFIG_CMDLINE="console=ttyMM0,9600 ip=on" 150CONFIG_CMDLINE="console=ttyMM0 ip=on"
151# CONFIG_PM is not set
152CONFIG_SECCOMP=y
153CONFIG_ISA_DMA_API=y
124 154
125# 155#
126# Bus options 156# Bus options
@@ -129,7 +159,11 @@ CONFIG_GENERIC_ISA_DMA=y
129CONFIG_PCI=y 159CONFIG_PCI=y
130CONFIG_PCI_DOMAINS=y 160CONFIG_PCI_DOMAINS=y
131CONFIG_PCI_LEGACY_PROC=y 161CONFIG_PCI_LEGACY_PROC=y
132CONFIG_PCI_NAMES=y 162
163#
164# PCCARD (PCMCIA/CardBus) support
165#
166# CONFIG_PCCARD is not set
133 167
134# 168#
135# Advanced setup 169# Advanced setup
@@ -146,6 +180,76 @@ CONFIG_TASK_SIZE=0x80000000
146CONFIG_BOOT_LOAD=0x00800000 180CONFIG_BOOT_LOAD=0x00800000
147 181
148# 182#
183# Networking
184#
185CONFIG_NET=y
186
187#
188# Networking options
189#
190CONFIG_PACKET=y
191# CONFIG_PACKET_MMAP is not set
192CONFIG_UNIX=y
193# CONFIG_NET_KEY is not set
194CONFIG_INET=y
195CONFIG_IP_MULTICAST=y
196# CONFIG_IP_ADVANCED_ROUTER is not set
197CONFIG_IP_FIB_HASH=y
198CONFIG_IP_PNP=y
199CONFIG_IP_PNP_DHCP=y
200# CONFIG_IP_PNP_BOOTP is not set
201# CONFIG_IP_PNP_RARP is not set
202# CONFIG_NET_IPIP is not set
203# CONFIG_NET_IPGRE is not set
204# CONFIG_IP_MROUTE is not set
205# CONFIG_ARPD is not set
206CONFIG_SYN_COOKIES=y
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# CONFIG_NET_DIVERT is not set
237# CONFIG_ECONET is not set
238# CONFIG_WAN_ROUTER is not set
239# CONFIG_NET_SCHED is not set
240# CONFIG_NET_CLS_ROUTE is not set
241
242#
243# Network testing
244#
245# CONFIG_NET_PKTGEN is not set
246# CONFIG_NETFILTER_NETLINK is not set
247# CONFIG_HAMRADIO is not set
248# CONFIG_IRDA is not set
249# CONFIG_BT is not set
250# CONFIG_IEEE80211 is not set
251
252#
149# Device Drivers 253# Device Drivers
150# 254#
151 255
@@ -154,6 +258,7 @@ CONFIG_BOOT_LOAD=0x00800000
154# 258#
155CONFIG_STANDALONE=y 259CONFIG_STANDALONE=y
156CONFIG_PREVENT_FIRMWARE_BUILD=y 260CONFIG_PREVENT_FIRMWARE_BUILD=y
261# CONFIG_FW_LOADER is not set
157 262
158# 263#
159# Memory Technology Devices (MTD) 264# Memory Technology Devices (MTD)
@@ -177,6 +282,7 @@ CONFIG_PREVENT_FIRMWARE_BUILD=y
177# CONFIG_BLK_CPQ_CISS_DA is not set 282# CONFIG_BLK_CPQ_CISS_DA is not set
178# CONFIG_BLK_DEV_DAC960 is not set 283# CONFIG_BLK_DEV_DAC960 is not set
179# CONFIG_BLK_DEV_UMEM is not set 284# CONFIG_BLK_DEV_UMEM is not set
285# CONFIG_BLK_DEV_COW_COMMON is not set
180CONFIG_BLK_DEV_LOOP=y 286CONFIG_BLK_DEV_LOOP=y
181# CONFIG_BLK_DEV_CRYPTOLOOP is not set 287# CONFIG_BLK_DEV_CRYPTOLOOP is not set
182# CONFIG_BLK_DEV_NBD is not set 288# CONFIG_BLK_DEV_NBD is not set
@@ -185,7 +291,6 @@ CONFIG_BLK_DEV_RAM=y
185CONFIG_BLK_DEV_RAM_COUNT=16 291CONFIG_BLK_DEV_RAM_COUNT=16
186CONFIG_BLK_DEV_RAM_SIZE=4096 292CONFIG_BLK_DEV_RAM_SIZE=4096
187CONFIG_BLK_DEV_INITRD=y 293CONFIG_BLK_DEV_INITRD=y
188CONFIG_INITRAMFS_SOURCE=""
189# CONFIG_LBD is not set 294# CONFIG_LBD is not set
190# CONFIG_CDROM_PKTCDVD is not set 295# CONFIG_CDROM_PKTCDVD is not set
191 296
@@ -196,6 +301,7 @@ CONFIG_IOSCHED_NOOP=y
196CONFIG_IOSCHED_AS=y 301CONFIG_IOSCHED_AS=y
197CONFIG_IOSCHED_DEADLINE=y 302CONFIG_IOSCHED_DEADLINE=y
198CONFIG_IOSCHED_CFQ=y 303CONFIG_IOSCHED_CFQ=y
304# CONFIG_ATA_OVER_ETH is not set
199 305
200# 306#
201# ATA/ATAPI/MFM/RLL support 307# ATA/ATAPI/MFM/RLL support
@@ -205,6 +311,7 @@ CONFIG_IOSCHED_CFQ=y
205# 311#
206# SCSI device support 312# SCSI device support
207# 313#
314# CONFIG_RAID_ATTRS is not set
208# CONFIG_SCSI is not set 315# CONFIG_SCSI is not set
209 316
210# 317#
@@ -215,6 +322,7 @@ CONFIG_IOSCHED_CFQ=y
215# 322#
216# Fusion MPT device support 323# Fusion MPT device support
217# 324#
325# CONFIG_FUSION is not set
218 326
219# 327#
220# IEEE 1394 (FireWire) support 328# IEEE 1394 (FireWire) support
@@ -231,71 +339,8 @@ CONFIG_IOSCHED_CFQ=y
231# 339#
232 340
233# 341#
234# Networking support 342# Network device support
235# 343#
236CONFIG_NET=y
237
238#
239# Networking options
240#
241CONFIG_PACKET=y
242# CONFIG_PACKET_MMAP is not set
243# CONFIG_NETLINK_DEV is not set
244CONFIG_UNIX=y
245# CONFIG_NET_KEY is not set
246CONFIG_INET=y
247CONFIG_IP_MULTICAST=y
248# CONFIG_IP_ADVANCED_ROUTER is not set
249CONFIG_IP_PNP=y
250CONFIG_IP_PNP_DHCP=y
251# CONFIG_IP_PNP_BOOTP is not set
252# CONFIG_IP_PNP_RARP is not set
253# CONFIG_NET_IPIP is not set
254# CONFIG_NET_IPGRE is not set
255# CONFIG_IP_MROUTE is not set
256# CONFIG_ARPD is not set
257CONFIG_SYN_COOKIES=y
258# CONFIG_INET_AH is not set
259# CONFIG_INET_ESP is not set
260# CONFIG_INET_IPCOMP is not set
261# CONFIG_INET_TUNNEL is not set
262CONFIG_IP_TCPDIAG=y
263# CONFIG_IP_TCPDIAG_IPV6 is not set
264# CONFIG_IPV6 is not set
265# CONFIG_NETFILTER is not set
266
267#
268# SCTP Configuration (EXPERIMENTAL)
269#
270# CONFIG_IP_SCTP is not set
271# CONFIG_ATM is not set
272# CONFIG_BRIDGE is not set
273# CONFIG_VLAN_8021Q is not set
274# CONFIG_DECNET is not set
275# CONFIG_LLC2 is not set
276# CONFIG_IPX is not set
277# CONFIG_ATALK is not set
278# CONFIG_X25 is not set
279# CONFIG_LAPB is not set
280# CONFIG_NET_DIVERT is not set
281# CONFIG_ECONET is not set
282# CONFIG_WAN_ROUTER is not set
283
284#
285# QoS and/or fair queueing
286#
287# CONFIG_NET_SCHED is not set
288# CONFIG_NET_CLS_ROUTE is not set
289
290#
291# Network testing
292#
293# CONFIG_NET_PKTGEN is not set
294# CONFIG_NETPOLL is not set
295# CONFIG_NET_POLL_CONTROLLER is not set
296# CONFIG_HAMRADIO is not set
297# CONFIG_IRDA is not set
298# CONFIG_BT is not set
299CONFIG_NETDEVICES=y 344CONFIG_NETDEVICES=y
300# CONFIG_DUMMY is not set 345# CONFIG_DUMMY is not set
301# CONFIG_BONDING is not set 346# CONFIG_BONDING is not set
@@ -308,6 +353,11 @@ CONFIG_NETDEVICES=y
308# CONFIG_ARCNET is not set 353# CONFIG_ARCNET is not set
309 354
310# 355#
356# PHY device support
357#
358# CONFIG_PHYLIB is not set
359
360#
311# Ethernet (10 or 100Mbit) 361# Ethernet (10 or 100Mbit)
312# 362#
313CONFIG_NET_ETHERNET=y 363CONFIG_NET_ETHERNET=y
@@ -328,6 +378,7 @@ CONFIG_TULIP=y
328# CONFIG_DE4X5 is not set 378# CONFIG_DE4X5 is not set
329# CONFIG_WINBOND_840 is not set 379# CONFIG_WINBOND_840 is not set
330# CONFIG_DM9102 is not set 380# CONFIG_DM9102 is not set
381# CONFIG_ULI526X is not set
331# CONFIG_HP100 is not set 382# CONFIG_HP100 is not set
332CONFIG_NET_PCI=y 383CONFIG_NET_PCI=y
333# CONFIG_PCNET32 is not set 384# CONFIG_PCNET32 is not set
@@ -337,7 +388,6 @@ CONFIG_NET_PCI=y
337# CONFIG_FORCEDETH is not set 388# CONFIG_FORCEDETH is not set
338# CONFIG_DGRS is not set 389# CONFIG_DGRS is not set
339CONFIG_EEPRO100=y 390CONFIG_EEPRO100=y
340# CONFIG_EEPRO100_PIO is not set
341# CONFIG_E100 is not set 391# CONFIG_E100 is not set
342# CONFIG_FEALNX is not set 392# CONFIG_FEALNX is not set
343# CONFIG_NATSEMI is not set 393# CONFIG_NATSEMI is not set
@@ -360,13 +410,18 @@ CONFIG_EEPRO100=y
360# CONFIG_HAMACHI is not set 410# CONFIG_HAMACHI is not set
361# CONFIG_YELLOWFIN is not set 411# CONFIG_YELLOWFIN is not set
362# CONFIG_R8169 is not set 412# CONFIG_R8169 is not set
413# CONFIG_SIS190 is not set
414# CONFIG_SKGE is not set
415# CONFIG_SKY2 is not set
363# CONFIG_SK98LIN is not set 416# CONFIG_SK98LIN is not set
364# CONFIG_VIA_VELOCITY is not set 417# CONFIG_VIA_VELOCITY is not set
365# CONFIG_TIGON3 is not set 418# CONFIG_TIGON3 is not set
419# CONFIG_BNX2 is not set
366 420
367# 421#
368# Ethernet (10000 Mbit) 422# Ethernet (10000 Mbit)
369# 423#
424# CONFIG_CHELSIO_T1 is not set
370# CONFIG_IXGB is not set 425# CONFIG_IXGB is not set
371# CONFIG_S2IO is not set 426# CONFIG_S2IO is not set
372 427
@@ -390,6 +445,11 @@ CONFIG_EEPRO100=y
390# CONFIG_SLIP is not set 445# CONFIG_SLIP is not set
391# CONFIG_SHAPER is not set 446# CONFIG_SHAPER is not set
392# CONFIG_NETCONSOLE is not set 447# CONFIG_NETCONSOLE is not set
448# CONFIG_KGDBOE is not set
449# CONFIG_NETPOLL is not set
450# CONFIG_NETPOLL_RX is not set
451# CONFIG_NETPOLL_TRAP is not set
452# CONFIG_NET_POLL_CONTROLLER is not set
393 453
394# 454#
395# ISDN subsystem 455# ISDN subsystem
@@ -419,14 +479,6 @@ CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768
419# CONFIG_INPUT_EVBUG is not set 479# CONFIG_INPUT_EVBUG is not set
420 480
421# 481#
422# Input I/O drivers
423#
424# CONFIG_GAMEPORT is not set
425CONFIG_SOUND_GAMEPORT=y
426# CONFIG_SERIO is not set
427# CONFIG_SERIO_I8042 is not set
428
429#
430# Input Device Drivers 482# Input Device Drivers
431# 483#
432# CONFIG_INPUT_KEYBOARD is not set 484# CONFIG_INPUT_KEYBOARD is not set
@@ -436,6 +488,12 @@ CONFIG_SOUND_GAMEPORT=y
436# CONFIG_INPUT_MISC is not set 488# CONFIG_INPUT_MISC is not set
437 489
438# 490#
491# Hardware I/O ports
492#
493# CONFIG_SERIO is not set
494# CONFIG_GAMEPORT is not set
495
496#
439# Character devices 497# Character devices
440# 498#
441CONFIG_VT=y 499CONFIG_VT=y
@@ -455,6 +513,7 @@ CONFIG_SERIAL_MPSC=y
455CONFIG_SERIAL_MPSC_CONSOLE=y 513CONFIG_SERIAL_MPSC_CONSOLE=y
456CONFIG_SERIAL_CORE=y 514CONFIG_SERIAL_CORE=y
457CONFIG_SERIAL_CORE_CONSOLE=y 515CONFIG_SERIAL_CORE_CONSOLE=y
516# CONFIG_SERIAL_JSM is not set
458CONFIG_UNIX98_PTYS=y 517CONFIG_UNIX98_PTYS=y
459CONFIG_LEGACY_PTYS=y 518CONFIG_LEGACY_PTYS=y
460CONFIG_LEGACY_PTY_COUNT=256 519CONFIG_LEGACY_PTY_COUNT=256
@@ -483,6 +542,11 @@ CONFIG_GEN_RTC=y
483# CONFIG_RAW_DRIVER is not set 542# CONFIG_RAW_DRIVER is not set
484 543
485# 544#
545# TPM devices
546#
547# CONFIG_TCG_TPM is not set
548
549#
486# I2C support 550# I2C support
487# 551#
488# CONFIG_I2C is not set 552# CONFIG_I2C is not set
@@ -493,10 +557,21 @@ CONFIG_GEN_RTC=y
493# CONFIG_W1 is not set 557# CONFIG_W1 is not set
494 558
495# 559#
560# Hardware Monitoring support
561#
562CONFIG_HWMON=y
563# CONFIG_HWMON_VID is not set
564# CONFIG_HWMON_DEBUG_CHIP is not set
565
566#
496# Misc devices 567# Misc devices
497# 568#
498 569
499# 570#
571# Multimedia Capabilities Port drivers
572#
573
574#
500# Multimedia devices 575# Multimedia devices
501# 576#
502# CONFIG_VIDEO_DEV is not set 577# CONFIG_VIDEO_DEV is not set
@@ -518,6 +593,11 @@ CONFIG_GEN_RTC=y
518CONFIG_DUMMY_CONSOLE=y 593CONFIG_DUMMY_CONSOLE=y
519 594
520# 595#
596# Speakup console speech
597#
598# CONFIG_SPEAKUP is not set
599
600#
521# Sound 601# Sound
522# 602#
523# CONFIG_SOUND is not set 603# CONFIG_SOUND is not set
@@ -525,35 +605,59 @@ CONFIG_DUMMY_CONSOLE=y
525# 605#
526# USB support 606# USB support
527# 607#
528# CONFIG_USB is not set
529CONFIG_USB_ARCH_HAS_HCD=y 608CONFIG_USB_ARCH_HAS_HCD=y
530CONFIG_USB_ARCH_HAS_OHCI=y 609CONFIG_USB_ARCH_HAS_OHCI=y
610# CONFIG_USB is not set
531 611
532# 612#
533# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support' may also be needed; see USB_STORAGE Help for more information 613# USB Gadget Support
534# 614#
615# CONFIG_USB_GADGET is not set
535 616
536# 617#
537# USB Gadget Support 618# MMC/SD Card support
538# 619#
539# CONFIG_USB_GADGET is not set 620# CONFIG_MMC is not set
621
622#
623# InfiniBand support
624#
625# CONFIG_INFINIBAND is not set
626
627#
628# SN Devices
629#
630
631#
632# Distributed Lock Manager
633#
634# CONFIG_DLM is not set
540 635
541# 636#
542# File systems 637# File systems
543# 638#
544CONFIG_EXT2_FS=y 639CONFIG_EXT2_FS=y
545# CONFIG_EXT2_FS_XATTR is not set 640# CONFIG_EXT2_FS_XATTR is not set
641# CONFIG_EXT2_FS_XIP is not set
546# CONFIG_EXT3_FS is not set 642# CONFIG_EXT3_FS is not set
547# CONFIG_JBD is not set 643# CONFIG_REISER4_FS is not set
548# CONFIG_REISERFS_FS is not set 644# CONFIG_REISERFS_FS is not set
549# CONFIG_JFS_FS is not set 645# CONFIG_JFS_FS is not set
646# CONFIG_FS_POSIX_ACL is not set
647
648#
649# XFS support
650#
550# CONFIG_XFS_FS is not set 651# CONFIG_XFS_FS is not set
652# CONFIG_OCFS2_FS is not set
551# CONFIG_MINIX_FS is not set 653# CONFIG_MINIX_FS is not set
552# CONFIG_ROMFS_FS is not set 654# CONFIG_ROMFS_FS is not set
655CONFIG_INOTIFY=y
553# CONFIG_QUOTA is not set 656# CONFIG_QUOTA is not set
554CONFIG_DNOTIFY=y 657CONFIG_DNOTIFY=y
555# CONFIG_AUTOFS_FS is not set 658# CONFIG_AUTOFS_FS is not set
556# CONFIG_AUTOFS4_FS is not set 659# CONFIG_AUTOFS4_FS is not set
660# CONFIG_FUSE_FS is not set
557 661
558# 662#
559# CD-ROM/DVD Filesystems 663# CD-ROM/DVD Filesystems
@@ -574,20 +678,18 @@ CONFIG_DNOTIFY=y
574CONFIG_PROC_FS=y 678CONFIG_PROC_FS=y
575CONFIG_PROC_KCORE=y 679CONFIG_PROC_KCORE=y
576CONFIG_SYSFS=y 680CONFIG_SYSFS=y
577CONFIG_DEVFS_FS=y
578# CONFIG_DEVFS_MOUNT is not set
579# CONFIG_DEVFS_DEBUG is not set
580# CONFIG_DEVPTS_FS_XATTR is not set
581CONFIG_TMPFS=y 681CONFIG_TMPFS=y
582# CONFIG_TMPFS_XATTR is not set
583# CONFIG_HUGETLB_PAGE is not set 682# CONFIG_HUGETLB_PAGE is not set
584CONFIG_RAMFS=y 683CONFIG_RAMFS=y
684# CONFIG_CONFIGFS_FS is not set
685# CONFIG_RELAYFS_FS is not set
585 686
586# 687#
587# Miscellaneous filesystems 688# Miscellaneous filesystems
588# 689#
589# CONFIG_ADFS_FS is not set 690# CONFIG_ADFS_FS is not set
590# CONFIG_AFFS_FS is not set 691# CONFIG_AFFS_FS is not set
692# CONFIG_ASFS_FS is not set
591# CONFIG_HFS_FS is not set 693# CONFIG_HFS_FS is not set
592# CONFIG_HFSPLUS_FS is not set 694# CONFIG_HFSPLUS_FS is not set
593# CONFIG_BEFS_FS is not set 695# CONFIG_BEFS_FS is not set
@@ -605,13 +707,14 @@ CONFIG_RAMFS=y
605# 707#
606CONFIG_NFS_FS=y 708CONFIG_NFS_FS=y
607CONFIG_NFS_V3=y 709CONFIG_NFS_V3=y
710# CONFIG_NFS_V3_ACL is not set
608CONFIG_NFS_V4=y 711CONFIG_NFS_V4=y
609# CONFIG_NFS_DIRECTIO is not set 712# CONFIG_NFS_DIRECTIO is not set
610# CONFIG_NFSD is not set 713# CONFIG_NFSD is not set
611CONFIG_ROOT_NFS=y 714CONFIG_ROOT_NFS=y
612CONFIG_LOCKD=y 715CONFIG_LOCKD=y
613CONFIG_LOCKD_V4=y 716CONFIG_LOCKD_V4=y
614# CONFIG_EXPORTFS is not set 717CONFIG_NFS_COMMON=y
615CONFIG_SUNRPC=y 718CONFIG_SUNRPC=y
616CONFIG_SUNRPC_GSS=y 719CONFIG_SUNRPC_GSS=y
617CONFIG_RPCSEC_GSS_KRB5=y 720CONFIG_RPCSEC_GSS_KRB5=y
@@ -621,6 +724,7 @@ CONFIG_RPCSEC_GSS_KRB5=y
621# CONFIG_NCP_FS is not set 724# CONFIG_NCP_FS is not set
622# CONFIG_CODA_FS is not set 725# CONFIG_CODA_FS is not set
623# CONFIG_AFS_FS is not set 726# CONFIG_AFS_FS is not set
727# CONFIG_9P_FS is not set
624 728
625# 729#
626# Partition Types 730# Partition Types
@@ -637,6 +741,7 @@ CONFIG_MSDOS_PARTITION=y
637# Library routines 741# Library routines
638# 742#
639# CONFIG_CRC_CCITT is not set 743# CONFIG_CRC_CCITT is not set
744# CONFIG_CRC16 is not set
640CONFIG_CRC32=y 745CONFIG_CRC32=y
641# CONFIG_LIBCRC32C is not set 746# CONFIG_LIBCRC32C is not set
642 747
@@ -648,7 +753,9 @@ CONFIG_CRC32=y
648# 753#
649# Kernel hacking 754# Kernel hacking
650# 755#
756# CONFIG_PRINTK_TIME is not set
651# CONFIG_DEBUG_KERNEL is not set 757# CONFIG_DEBUG_KERNEL is not set
758CONFIG_LOG_BUF_SHIFT=14
652# CONFIG_SERIAL_TEXT_DEBUG is not set 759# CONFIG_SERIAL_TEXT_DEBUG is not set
653 760
654# 761#
@@ -669,6 +776,7 @@ CONFIG_CRYPTO_MD5=y
669# CONFIG_CRYPTO_SHA256 is not set 776# CONFIG_CRYPTO_SHA256 is not set
670# CONFIG_CRYPTO_SHA512 is not set 777# CONFIG_CRYPTO_SHA512 is not set
671# CONFIG_CRYPTO_WP512 is not set 778# CONFIG_CRYPTO_WP512 is not set
779# CONFIG_CRYPTO_TGR192 is not set
672CONFIG_CRYPTO_DES=y 780CONFIG_CRYPTO_DES=y
673# CONFIG_CRYPTO_BLOWFISH is not set 781# CONFIG_CRYPTO_BLOWFISH is not set
674# CONFIG_CRYPTO_TWOFISH is not set 782# CONFIG_CRYPTO_TWOFISH is not set
@@ -684,3 +792,7 @@ CONFIG_CRYPTO_DES=y
684# CONFIG_CRYPTO_MICHAEL_MIC is not set 792# CONFIG_CRYPTO_MICHAEL_MIC is not set
685# CONFIG_CRYPTO_CRC32C is not set 793# CONFIG_CRYPTO_CRC32C is not set
686# CONFIG_CRYPTO_TEST is not set 794# CONFIG_CRYPTO_TEST is not set
795
796#
797# Hardware crypto devices
798#
diff --git a/arch/ppc/configs/k2_defconfig b/arch/ppc/configs/ev64360_defconfig
index f10f5a6d2dae..de9bbb791db9 100644
--- a/arch/ppc/configs/k2_defconfig
+++ b/arch/ppc/configs/ev64360_defconfig
@@ -1,52 +1,60 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.13-rc5
4# Fri Aug 5 15:18:23 2005
3# 5#
4CONFIG_MMU=y 6CONFIG_MMU=y
7CONFIG_GENERIC_HARDIRQS=y
5CONFIG_RWSEM_XCHGADD_ALGORITHM=y 8CONFIG_RWSEM_XCHGADD_ALGORITHM=y
9CONFIG_GENERIC_CALIBRATE_DELAY=y
6CONFIG_HAVE_DEC_LOCK=y 10CONFIG_HAVE_DEC_LOCK=y
7CONFIG_PPC=y 11CONFIG_PPC=y
8CONFIG_PPC32=y 12CONFIG_PPC32=y
9CONFIG_GENERIC_NVRAM=y 13CONFIG_GENERIC_NVRAM=y
14CONFIG_SCHED_NO_NO_OMIT_FRAME_POINTER=y
10 15
11# 16#
12# Code maturity level options 17# Code maturity level options
13# 18#
14CONFIG_EXPERIMENTAL=y 19CONFIG_EXPERIMENTAL=y
15CONFIG_CLEAN_COMPILE=y 20CONFIG_CLEAN_COMPILE=y
16CONFIG_STANDALONE=y
17CONFIG_BROKEN_ON_SMP=y 21CONFIG_BROKEN_ON_SMP=y
22CONFIG_LOCK_KERNEL=y
23CONFIG_INIT_ENV_ARG_LIMIT=32
18 24
19# 25#
20# General setup 26# General setup
21# 27#
28CONFIG_LOCALVERSION=""
22CONFIG_SWAP=y 29CONFIG_SWAP=y
23CONFIG_SYSVIPC=y 30CONFIG_SYSVIPC=y
24# CONFIG_POSIX_MQUEUE is not set 31CONFIG_POSIX_MQUEUE=y
25# CONFIG_BSD_PROCESS_ACCT is not set 32# CONFIG_BSD_PROCESS_ACCT is not set
26CONFIG_SYSCTL=y 33CONFIG_SYSCTL=y
27# CONFIG_AUDIT is not set 34# CONFIG_AUDIT is not set
28CONFIG_LOG_BUF_SHIFT=14 35CONFIG_HOTPLUG=y
29# CONFIG_HOTPLUG is not set 36CONFIG_KOBJECT_UEVENT=y
30# CONFIG_IKCONFIG is not set 37# CONFIG_IKCONFIG is not set
31CONFIG_EMBEDDED=y 38# CONFIG_EMBEDDED is not set
32CONFIG_KALLSYMS=y 39CONFIG_KALLSYMS=y
40# CONFIG_KALLSYMS_EXTRA_PASS is not set
41CONFIG_PRINTK=y
42CONFIG_BUG=y
43CONFIG_BASE_FULL=y
33CONFIG_FUTEX=y 44CONFIG_FUTEX=y
34CONFIG_EPOLL=y 45CONFIG_EPOLL=y
35CONFIG_IOSCHED_NOOP=y 46CONFIG_SHMEM=y
36CONFIG_IOSCHED_AS=y 47CONFIG_CC_ALIGN_FUNCTIONS=0
37CONFIG_IOSCHED_DEADLINE=y 48CONFIG_CC_ALIGN_LABELS=0
38CONFIG_IOSCHED_CFQ=y 49CONFIG_CC_ALIGN_LOOPS=0
39# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set 50CONFIG_CC_ALIGN_JUMPS=0
51# CONFIG_TINY_SHMEM is not set
52CONFIG_BASE_SMALL=0
40 53
41# 54#
42# Loadable module support 55# Loadable module support
43# 56#
44CONFIG_MODULES=y 57# CONFIG_MODULES is not set
45CONFIG_MODULE_UNLOAD=y
46# CONFIG_MODULE_FORCE_UNLOAD is not set
47CONFIG_OBSOLETE_MODPARM=y
48# CONFIG_MODVERSIONS is not set
49CONFIG_KMOD=y
50 58
51# 59#
52# Processor 60# Processor
@@ -57,21 +65,33 @@ CONFIG_6xx=y
57# CONFIG_POWER3 is not set 65# CONFIG_POWER3 is not set
58# CONFIG_POWER4 is not set 66# CONFIG_POWER4 is not set
59# CONFIG_8xx is not set 67# CONFIG_8xx is not set
60# CONFIG_ALTIVEC is not set 68# CONFIG_E200 is not set
61# CONFIG_TAU is not set 69# CONFIG_E500 is not set
70CONFIG_PPC_FPU=y
71CONFIG_ALTIVEC=y
72CONFIG_TAU=y
73# CONFIG_TAU_INT is not set
74# CONFIG_TAU_AVERAGE is not set
75# CONFIG_KEXEC is not set
62# CONFIG_CPU_FREQ is not set 76# CONFIG_CPU_FREQ is not set
77# CONFIG_PM is not set
63CONFIG_PPC_STD_MMU=y 78CONFIG_PPC_STD_MMU=y
79CONFIG_NOT_COHERENT_CACHE=y
64 80
65# 81#
66# Platform options 82# Platform options
67# 83#
68# CONFIG_PPC_MULTIPLATFORM is not set 84# CONFIG_PPC_MULTIPLATFORM is not set
69# CONFIG_APUS is not set 85# CONFIG_APUS is not set
86# CONFIG_KATANA is not set
70# CONFIG_WILLOW is not set 87# CONFIG_WILLOW is not set
88# CONFIG_CPCI690 is not set
71# CONFIG_PCORE is not set 89# CONFIG_PCORE is not set
72# CONFIG_POWERPMC250 is not set 90# CONFIG_POWERPMC250 is not set
73# CONFIG_EV64260 is not set 91# CONFIG_CHESTNUT is not set
74# CONFIG_SPRUCE is not set 92# CONFIG_SPRUCE is not set
93# CONFIG_HDPU is not set
94# CONFIG_EV64260 is not set
75# CONFIG_LOPEC is not set 95# CONFIG_LOPEC is not set
76# CONFIG_MCPN765 is not set 96# CONFIG_MCPN765 is not set
77# CONFIG_MVME5100 is not set 97# CONFIG_MVME5100 is not set
@@ -79,24 +99,51 @@ CONFIG_PPC_STD_MMU=y
79# CONFIG_PRPMC750 is not set 99# CONFIG_PRPMC750 is not set
80# CONFIG_PRPMC800 is not set 100# CONFIG_PRPMC800 is not set
81# CONFIG_SANDPOINT is not set 101# CONFIG_SANDPOINT is not set
102# CONFIG_RADSTONE_PPC7D is not set
82# CONFIG_ADIR is not set 103# CONFIG_ADIR is not set
83CONFIG_K2=y 104# CONFIG_K2 is not set
84# CONFIG_PAL4 is not set 105# CONFIG_PAL4 is not set
85# CONFIG_GEMINI is not set 106# CONFIG_GEMINI is not set
86# CONFIG_EST8260 is not set 107# CONFIG_EST8260 is not set
108# CONFIG_SBC82xx is not set
87# CONFIG_SBS8260 is not set 109# CONFIG_SBS8260 is not set
88# CONFIG_RPX6 is not set 110# CONFIG_RPX8260 is not set
89# CONFIG_TQM8260 is not set 111# CONFIG_TQM8260 is not set
90CONFIG_PPC_GEN550=y 112# CONFIG_ADS8272 is not set
91# CONFIG_CPC710_DATA_GATHERING is not set 113# CONFIG_PQ2FADS is not set
114# CONFIG_LITE5200 is not set
115# CONFIG_MPC834x_SYS is not set
116CONFIG_EV64360=y
117CONFIG_MV64360=y
118CONFIG_MV64X60=y
119
120#
121# Set bridge options
122#
123CONFIG_MV64X60_BASE=0xf1000000
124CONFIG_MV64X60_NEW_BASE=0xf1000000
92# CONFIG_SMP is not set 125# CONFIG_SMP is not set
93# CONFIG_PREEMPT is not set
94# CONFIG_HIGHMEM is not set 126# CONFIG_HIGHMEM is not set
95CONFIG_KERNEL_ELF=y 127# CONFIG_HZ_100 is not set
128CONFIG_HZ_250=y
129# CONFIG_HZ_1000 is not set
130CONFIG_HZ=250
131# CONFIG_PREEMPT_NONE is not set
132# CONFIG_PREEMPT_VOLUNTARY is not set
133CONFIG_PREEMPT=y
134CONFIG_PREEMPT_BKL=y
135CONFIG_SELECT_MEMORY_MODEL=y
136CONFIG_FLATMEM_MANUAL=y
137# CONFIG_DISCONTIGMEM_MANUAL is not set
138# CONFIG_SPARSEMEM_MANUAL is not set
139CONFIG_FLATMEM=y
140CONFIG_FLAT_NODE_MEM_MAP=y
96CONFIG_BINFMT_ELF=y 141CONFIG_BINFMT_ELF=y
97# CONFIG_BINFMT_MISC is not set 142CONFIG_BINFMT_MISC=y
98CONFIG_CMDLINE_BOOL=y 143CONFIG_CMDLINE_BOOL=y
99CONFIG_CMDLINE="ip=on" 144CONFIG_CMDLINE="console=ttyMM0,115200 root=/dev/mtdblock1 rw rootfstype=jffs2"
145CONFIG_SECCOMP=y
146CONFIG_ISA_DMA_API=y
100 147
101# 148#
102# Bus options 149# Bus options
@@ -108,31 +155,182 @@ CONFIG_PCI_DOMAINS=y
108# CONFIG_PCI_NAMES is not set 155# CONFIG_PCI_NAMES is not set
109 156
110# 157#
111# Advanced setup 158# PCCARD (PCMCIA/CardBus) support
112# 159#
113# CONFIG_ADVANCED_OPTIONS is not set 160# CONFIG_PCCARD is not set
114 161
115# 162#
116# Default settings for advanced configuration options are used 163# Advanced setup
117# 164#
165CONFIG_ADVANCED_OPTIONS=y
118CONFIG_HIGHMEM_START=0xfe000000 166CONFIG_HIGHMEM_START=0xfe000000
167# CONFIG_LOWMEM_SIZE_BOOL is not set
119CONFIG_LOWMEM_SIZE=0x30000000 168CONFIG_LOWMEM_SIZE=0x30000000
169# CONFIG_KERNEL_START_BOOL is not set
120CONFIG_KERNEL_START=0xc0000000 170CONFIG_KERNEL_START=0xc0000000
171# CONFIG_TASK_SIZE_BOOL is not set
121CONFIG_TASK_SIZE=0x80000000 172CONFIG_TASK_SIZE=0x80000000
173# CONFIG_CONSISTENT_START_BOOL is not set
174CONFIG_CONSISTENT_START=0xff100000
175# CONFIG_CONSISTENT_SIZE_BOOL is not set
176CONFIG_CONSISTENT_SIZE=0x00200000
177# CONFIG_BOOT_LOAD_BOOL is not set
122CONFIG_BOOT_LOAD=0x00800000 178CONFIG_BOOT_LOAD=0x00800000
123 179
124# 180#
181# Networking
182#
183CONFIG_NET=y
184
185#
186# Networking options
187#
188CONFIG_PACKET=y
189# CONFIG_PACKET_MMAP is not set
190CONFIG_UNIX=y
191# CONFIG_NET_KEY is not set
192CONFIG_INET=y
193CONFIG_IP_MULTICAST=y
194# CONFIG_IP_ADVANCED_ROUTER is not set
195CONFIG_IP_FIB_HASH=y
196CONFIG_IP_PNP=y
197CONFIG_IP_PNP_DHCP=y
198# CONFIG_IP_PNP_BOOTP is not set
199# CONFIG_IP_PNP_RARP is not set
200# CONFIG_NET_IPIP is not set
201# CONFIG_NET_IPGRE is not set
202# CONFIG_IP_MROUTE is not set
203# CONFIG_ARPD is not set
204CONFIG_SYN_COOKIES=y
205# CONFIG_INET_AH is not set
206# CONFIG_INET_ESP is not set
207# CONFIG_INET_IPCOMP is not set
208# CONFIG_INET_TUNNEL is not set
209CONFIG_IP_TCPDIAG=y
210# CONFIG_IP_TCPDIAG_IPV6 is not set
211# CONFIG_TCP_CONG_ADVANCED is not set
212CONFIG_TCP_CONG_BIC=y
213# CONFIG_IPV6 is not set
214# CONFIG_NETFILTER is not set
215
216#
217# SCTP Configuration (EXPERIMENTAL)
218#
219# CONFIG_IP_SCTP is not set
220# CONFIG_ATM is not set
221# CONFIG_BRIDGE is not set
222# CONFIG_VLAN_8021Q is not set
223# CONFIG_DECNET is not set
224# CONFIG_LLC2 is not set
225# CONFIG_IPX is not set
226# CONFIG_ATALK is not set
227# CONFIG_X25 is not set
228# CONFIG_LAPB is not set
229# CONFIG_NET_DIVERT is not set
230# CONFIG_ECONET is not set
231# CONFIG_WAN_ROUTER is not set
232# CONFIG_NET_SCHED is not set
233# CONFIG_NET_CLS_ROUTE is not set
234
235#
236# Network testing
237#
238# CONFIG_NET_PKTGEN is not set
239# CONFIG_HAMRADIO is not set
240# CONFIG_IRDA is not set
241# CONFIG_BT is not set
242
243#
125# Device Drivers 244# Device Drivers
126# 245#
127 246
128# 247#
129# Generic Driver Options 248# Generic Driver Options
130# 249#
250CONFIG_STANDALONE=y
251CONFIG_PREVENT_FIRMWARE_BUILD=y
252# CONFIG_FW_LOADER is not set
131 253
132# 254#
133# Memory Technology Devices (MTD) 255# Memory Technology Devices (MTD)
134# 256#
135# CONFIG_MTD is not set 257CONFIG_MTD=y
258# CONFIG_MTD_DEBUG is not set
259CONFIG_MTD_CONCAT=y
260CONFIG_MTD_PARTITIONS=y
261# CONFIG_MTD_REDBOOT_PARTS is not set
262# CONFIG_MTD_CMDLINE_PARTS is not set
263
264#
265# User Modules And Translation Layers
266#
267CONFIG_MTD_CHAR=y
268CONFIG_MTD_BLOCK=y
269# CONFIG_FTL is not set
270# CONFIG_NFTL is not set
271# CONFIG_INFTL is not set
272
273#
274# RAM/ROM/Flash chip drivers
275#
276CONFIG_MTD_CFI=y
277# CONFIG_MTD_JEDECPROBE is not set
278CONFIG_MTD_GEN_PROBE=y
279CONFIG_MTD_CFI_ADV_OPTIONS=y
280CONFIG_MTD_CFI_NOSWAP=y
281# CONFIG_MTD_CFI_BE_BYTE_SWAP is not set
282# CONFIG_MTD_CFI_LE_BYTE_SWAP is not set
283CONFIG_MTD_CFI_GEOMETRY=y
284# CONFIG_MTD_MAP_BANK_WIDTH_1 is not set
285# CONFIG_MTD_MAP_BANK_WIDTH_2 is not set
286CONFIG_MTD_MAP_BANK_WIDTH_4=y
287# CONFIG_MTD_MAP_BANK_WIDTH_8 is not set
288# CONFIG_MTD_MAP_BANK_WIDTH_16 is not set
289# CONFIG_MTD_MAP_BANK_WIDTH_32 is not set
290# CONFIG_MTD_CFI_I1 is not set
291CONFIG_MTD_CFI_I2=y
292# CONFIG_MTD_CFI_I4 is not set
293# CONFIG_MTD_CFI_I8 is not set
294# CONFIG_MTD_OTP is not set
295CONFIG_MTD_CFI_INTELEXT=y
296# CONFIG_MTD_CFI_AMDSTD is not set
297# CONFIG_MTD_CFI_STAA is not set
298CONFIG_MTD_CFI_UTIL=y
299# CONFIG_MTD_RAM is not set
300# CONFIG_MTD_ROM is not set
301# CONFIG_MTD_ABSENT is not set
302
303#
304# Mapping drivers for chip access
305#
306# CONFIG_MTD_COMPLEX_MAPPINGS is not set
307CONFIG_MTD_PHYSMAP=y
308CONFIG_MTD_PHYSMAP_START=0xff000000
309CONFIG_MTD_PHYSMAP_LEN=0x01000000
310CONFIG_MTD_PHYSMAP_BANKWIDTH=4
311# CONFIG_MTD_PLATRAM is not set
312
313#
314# Self-contained MTD device drivers
315#
316# CONFIG_MTD_PMC551 is not set
317# CONFIG_MTD_SLRAM is not set
318CONFIG_MTD_PHRAM=y
319# CONFIG_MTD_MTDRAM is not set
320# CONFIG_MTD_BLKMTD is not set
321# CONFIG_MTD_BLOCK2MTD is not set
322
323#
324# Disk-On-Chip Device Drivers
325#
326# CONFIG_MTD_DOC2000 is not set
327# CONFIG_MTD_DOC2001 is not set
328# CONFIG_MTD_DOC2001PLUS is not set
329
330#
331# NAND Flash Device Drivers
332#
333# CONFIG_MTD_NAND is not set
136 334
137# 335#
138# Parallel port support 336# Parallel port support
@@ -151,72 +349,32 @@ CONFIG_BOOT_LOAD=0x00800000
151# CONFIG_BLK_CPQ_CISS_DA is not set 349# CONFIG_BLK_CPQ_CISS_DA is not set
152# CONFIG_BLK_DEV_DAC960 is not set 350# CONFIG_BLK_DEV_DAC960 is not set
153# CONFIG_BLK_DEV_UMEM is not set 351# CONFIG_BLK_DEV_UMEM is not set
352# CONFIG_BLK_DEV_COW_COMMON is not set
154CONFIG_BLK_DEV_LOOP=y 353CONFIG_BLK_DEV_LOOP=y
155# CONFIG_BLK_DEV_CRYPTOLOOP is not set 354# CONFIG_BLK_DEV_CRYPTOLOOP is not set
156# CONFIG_BLK_DEV_NBD is not set 355# CONFIG_BLK_DEV_NBD is not set
157# CONFIG_BLK_DEV_CARMEL is not set 356# CONFIG_BLK_DEV_SX8 is not set
158CONFIG_BLK_DEV_RAM=y 357CONFIG_BLK_DEV_RAM=y
159CONFIG_BLK_DEV_RAM_SIZE=4096 358CONFIG_BLK_DEV_RAM_COUNT=16
359CONFIG_BLK_DEV_RAM_SIZE=32768
160CONFIG_BLK_DEV_INITRD=y 360CONFIG_BLK_DEV_INITRD=y
361CONFIG_INITRAMFS_SOURCE=""
161# CONFIG_LBD is not set 362# CONFIG_LBD is not set
363# CONFIG_CDROM_PKTCDVD is not set
364
365#
366# IO Schedulers
367#
368CONFIG_IOSCHED_NOOP=y
369CONFIG_IOSCHED_AS=y
370CONFIG_IOSCHED_DEADLINE=y
371CONFIG_IOSCHED_CFQ=y
372# CONFIG_ATA_OVER_ETH is not set
162 373
163# 374#
164# ATA/ATAPI/MFM/RLL support 375# ATA/ATAPI/MFM/RLL support
165# 376#
166CONFIG_IDE=y 377# CONFIG_IDE is not set
167CONFIG_BLK_DEV_IDE=y
168
169#
170# Please see Documentation/ide.txt for help/info on IDE drives
171#
172CONFIG_BLK_DEV_IDEDISK=y
173# CONFIG_IDEDISK_MULTI_MODE is not set
174# CONFIG_IDEDISK_STROKE is not set
175# CONFIG_BLK_DEV_IDECD is not set
176# CONFIG_BLK_DEV_IDETAPE is not set
177# CONFIG_BLK_DEV_IDEFLOPPY is not set
178# CONFIG_IDE_TASK_IOCTL is not set
179# CONFIG_IDE_TASKFILE_IO is not set
180
181#
182# IDE chipset support/bugfixes
183#
184# CONFIG_IDE_GENERIC is not set
185CONFIG_BLK_DEV_IDEPCI=y
186# CONFIG_IDEPCI_SHARE_IRQ is not set
187# CONFIG_BLK_DEV_OFFBOARD is not set
188# CONFIG_BLK_DEV_GENERIC is not set
189# CONFIG_BLK_DEV_OPTI621 is not set
190# CONFIG_BLK_DEV_SL82C105 is not set
191CONFIG_BLK_DEV_IDEDMA_PCI=y
192# CONFIG_BLK_DEV_IDEDMA_FORCED is not set
193# CONFIG_IDEDMA_PCI_AUTO is not set
194CONFIG_BLK_DEV_ADMA=y
195# CONFIG_BLK_DEV_AEC62XX is not set
196CONFIG_BLK_DEV_ALI15X3=y
197# CONFIG_WDC_ALI15X3 is not set
198# CONFIG_BLK_DEV_AMD74XX is not set
199# CONFIG_BLK_DEV_CMD64X is not set
200# CONFIG_BLK_DEV_TRIFLEX is not set
201# CONFIG_BLK_DEV_CY82C693 is not set
202# CONFIG_BLK_DEV_CS5520 is not set
203# CONFIG_BLK_DEV_CS5530 is not set
204# CONFIG_BLK_DEV_HPT34X is not set
205# CONFIG_BLK_DEV_HPT366 is not set
206# CONFIG_BLK_DEV_SC1200 is not set
207# CONFIG_BLK_DEV_PIIX is not set
208# CONFIG_BLK_DEV_NS87415 is not set
209# CONFIG_BLK_DEV_PDC202XX_OLD is not set
210# CONFIG_BLK_DEV_PDC202XX_NEW is not set
211# CONFIG_BLK_DEV_SVWKS is not set
212# CONFIG_BLK_DEV_SIIMAGE is not set
213# CONFIG_BLK_DEV_SLC90E66 is not set
214# CONFIG_BLK_DEV_TRM290 is not set
215# CONFIG_BLK_DEV_VIA82CXXX is not set
216CONFIG_BLK_DEV_IDEDMA=y
217# CONFIG_IDEDMA_IVB is not set
218# CONFIG_IDEDMA_AUTO is not set
219# CONFIG_BLK_DEV_HD is not set
220 378
221# 379#
222# SCSI device support 380# SCSI device support
@@ -248,122 +406,8 @@ CONFIG_BLK_DEV_IDEDMA=y
248# 406#
249 407
250# 408#
251# Networking support 409# Network device support
252#
253CONFIG_NET=y
254
255# 410#
256# Networking options
257#
258CONFIG_PACKET=y
259# CONFIG_PACKET_MMAP is not set
260# CONFIG_NETLINK_DEV is not set
261CONFIG_UNIX=y
262# CONFIG_NET_KEY is not set
263CONFIG_INET=y
264# CONFIG_IP_MULTICAST is not set
265# CONFIG_IP_ADVANCED_ROUTER is not set
266CONFIG_IP_PNP=y
267CONFIG_IP_PNP_DHCP=y
268# CONFIG_IP_PNP_BOOTP is not set
269# CONFIG_IP_PNP_RARP is not set
270# CONFIG_NET_IPIP is not set
271# CONFIG_NET_IPGRE is not set
272# CONFIG_ARPD is not set
273# CONFIG_SYN_COOKIES is not set
274# CONFIG_INET_AH is not set
275# CONFIG_INET_ESP is not set
276# CONFIG_INET_IPCOMP is not set
277
278#
279# IP: Virtual Server Configuration
280#
281# CONFIG_IP_VS is not set
282# CONFIG_IPV6 is not set
283CONFIG_NETFILTER=y
284# CONFIG_NETFILTER_DEBUG is not set
285
286#
287# IP: Netfilter Configuration
288#
289CONFIG_IP_NF_CONNTRACK=m
290CONFIG_IP_NF_FTP=m
291# CONFIG_IP_NF_IRC is not set
292# CONFIG_IP_NF_TFTP is not set
293# CONFIG_IP_NF_AMANDA is not set
294# CONFIG_IP_NF_QUEUE is not set
295CONFIG_IP_NF_IPTABLES=m
296CONFIG_IP_NF_MATCH_LIMIT=m
297# CONFIG_IP_NF_MATCH_IPRANGE is not set
298CONFIG_IP_NF_MATCH_MAC=m
299CONFIG_IP_NF_MATCH_PKTTYPE=m
300CONFIG_IP_NF_MATCH_MARK=m
301CONFIG_IP_NF_MATCH_MULTIPORT=m
302CONFIG_IP_NF_MATCH_TOS=m
303# CONFIG_IP_NF_MATCH_RECENT is not set
304CONFIG_IP_NF_MATCH_ECN=m
305CONFIG_IP_NF_MATCH_DSCP=m
306CONFIG_IP_NF_MATCH_AH_ESP=m
307# CONFIG_IP_NF_MATCH_LENGTH is not set
308# CONFIG_IP_NF_MATCH_TTL is not set
309CONFIG_IP_NF_MATCH_TCPMSS=m
310CONFIG_IP_NF_MATCH_HELPER=m
311CONFIG_IP_NF_MATCH_STATE=m
312CONFIG_IP_NF_MATCH_CONNTRACK=m
313CONFIG_IP_NF_MATCH_OWNER=m
314CONFIG_IP_NF_FILTER=m
315CONFIG_IP_NF_TARGET_REJECT=m
316CONFIG_IP_NF_NAT=m
317CONFIG_IP_NF_NAT_NEEDED=y
318CONFIG_IP_NF_TARGET_MASQUERADE=m
319CONFIG_IP_NF_TARGET_REDIRECT=m
320# CONFIG_IP_NF_TARGET_NETMAP is not set
321# CONFIG_IP_NF_TARGET_SAME is not set
322# CONFIG_IP_NF_NAT_SNMP_BASIC is not set
323CONFIG_IP_NF_NAT_FTP=m
324# CONFIG_IP_NF_MANGLE is not set
325# CONFIG_IP_NF_TARGET_LOG is not set
326CONFIG_IP_NF_TARGET_ULOG=m
327CONFIG_IP_NF_TARGET_TCPMSS=m
328CONFIG_IP_NF_ARPTABLES=m
329CONFIG_IP_NF_ARPFILTER=m
330# CONFIG_IP_NF_ARP_MANGLE is not set
331CONFIG_IP_NF_COMPAT_IPCHAINS=m
332# CONFIG_IP_NF_COMPAT_IPFWADM is not set
333# CONFIG_IP_NF_RAW is not set
334
335#
336# SCTP Configuration (EXPERIMENTAL)
337#
338# CONFIG_IP_SCTP is not set
339# CONFIG_ATM is not set
340# CONFIG_BRIDGE is not set
341# CONFIG_VLAN_8021Q is not set
342# CONFIG_DECNET is not set
343# CONFIG_LLC2 is not set
344# CONFIG_IPX is not set
345# CONFIG_ATALK is not set
346# CONFIG_X25 is not set
347# CONFIG_LAPB is not set
348# CONFIG_NET_DIVERT is not set
349# CONFIG_ECONET is not set
350# CONFIG_WAN_ROUTER is not set
351# CONFIG_NET_HW_FLOWCONTROL is not set
352
353#
354# QoS and/or fair queueing
355#
356# CONFIG_NET_SCHED is not set
357
358#
359# Network testing
360#
361# CONFIG_NET_PKTGEN is not set
362# CONFIG_NETPOLL is not set
363# CONFIG_NET_POLL_CONTROLLER is not set
364# CONFIG_HAMRADIO is not set
365# CONFIG_IRDA is not set
366# CONFIG_BT is not set
367CONFIG_NETDEVICES=y 411CONFIG_NETDEVICES=y
368# CONFIG_DUMMY is not set 412# CONFIG_DUMMY is not set
369# CONFIG_BONDING is not set 413# CONFIG_BONDING is not set
@@ -378,38 +422,7 @@ CONFIG_NETDEVICES=y
378# 422#
379# Ethernet (10 or 100Mbit) 423# Ethernet (10 or 100Mbit)
380# 424#
381CONFIG_NET_ETHERNET=y 425# CONFIG_NET_ETHERNET is not set
382CONFIG_MII=y
383# CONFIG_OAKNET is not set
384# CONFIG_HAPPYMEAL is not set
385# CONFIG_SUNGEM is not set
386# CONFIG_NET_VENDOR_3COM is not set
387
388#
389# Tulip family network device support
390#
391# CONFIG_NET_TULIP is not set
392# CONFIG_HP100 is not set
393CONFIG_NET_PCI=y
394# CONFIG_PCNET32 is not set
395# CONFIG_AMD8111_ETH is not set
396# CONFIG_ADAPTEC_STARFIRE is not set
397# CONFIG_B44 is not set
398# CONFIG_FORCEDETH is not set
399# CONFIG_DGRS is not set
400CONFIG_EEPRO100=y
401# CONFIG_EEPRO100_PIO is not set
402# CONFIG_E100 is not set
403# CONFIG_FEALNX is not set
404# CONFIG_NATSEMI is not set
405# CONFIG_NE2K_PCI is not set
406# CONFIG_8139CP is not set
407# CONFIG_8139TOO is not set
408# CONFIG_SIS900 is not set
409# CONFIG_EPIC100 is not set
410# CONFIG_SUNDANCE is not set
411# CONFIG_TLAN is not set
412# CONFIG_VIA_RHINE is not set
413 426
414# 427#
415# Ethernet (1000 Mbit) 428# Ethernet (1000 Mbit)
@@ -421,8 +434,14 @@ CONFIG_EEPRO100=y
421# CONFIG_HAMACHI is not set 434# CONFIG_HAMACHI is not set
422# CONFIG_YELLOWFIN is not set 435# CONFIG_YELLOWFIN is not set
423# CONFIG_R8169 is not set 436# CONFIG_R8169 is not set
437# CONFIG_SKGE is not set
424# CONFIG_SK98LIN is not set 438# CONFIG_SK98LIN is not set
425# CONFIG_TIGON3 is not set 439# CONFIG_TIGON3 is not set
440# CONFIG_BNX2 is not set
441CONFIG_MV643XX_ETH=y
442CONFIG_MV643XX_ETH_0=y
443# CONFIG_MV643XX_ETH_1 is not set
444# CONFIG_MV643XX_ETH_2 is not set
426 445
427# 446#
428# Ethernet (10000 Mbit) 447# Ethernet (10000 Mbit)
@@ -448,9 +467,10 @@ CONFIG_EEPRO100=y
448# CONFIG_HIPPI is not set 467# CONFIG_HIPPI is not set
449# CONFIG_PPP is not set 468# CONFIG_PPP is not set
450# CONFIG_SLIP is not set 469# CONFIG_SLIP is not set
451# CONFIG_RCPCI is not set
452# CONFIG_SHAPER is not set 470# CONFIG_SHAPER is not set
453# CONFIG_NETCONSOLE is not set 471# CONFIG_NETCONSOLE is not set
472# CONFIG_NETPOLL is not set
473# CONFIG_NET_POLL_CONTROLLER is not set
454 474
455# 475#
456# ISDN subsystem 476# ISDN subsystem
@@ -465,47 +485,59 @@ CONFIG_EEPRO100=y
465# 485#
466# Input device support 486# Input device support
467# 487#
468# CONFIG_INPUT is not set 488CONFIG_INPUT=y
469 489
470# 490#
471# Userland interfaces 491# Userland interfaces
472# 492#
493CONFIG_INPUT_MOUSEDEV=y
494# CONFIG_INPUT_MOUSEDEV_PSAUX is not set
495CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024
496CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768
497# CONFIG_INPUT_JOYDEV is not set
498# CONFIG_INPUT_TSDEV is not set
499# CONFIG_INPUT_EVDEV is not set
500# CONFIG_INPUT_EVBUG is not set
473 501
474# 502#
475# Input I/O drivers 503# Input Device Drivers
476# 504#
477# CONFIG_GAMEPORT is not set 505# CONFIG_INPUT_KEYBOARD is not set
478CONFIG_SOUND_GAMEPORT=y 506# CONFIG_INPUT_MOUSE is not set
479# CONFIG_SERIO is not set 507# CONFIG_INPUT_JOYSTICK is not set
480# CONFIG_SERIO_I8042 is not set 508# CONFIG_INPUT_TOUCHSCREEN is not set
509# CONFIG_INPUT_MISC is not set
481 510
482# 511#
483# Input Device Drivers 512# Hardware I/O ports
484# 513#
514# CONFIG_SERIO is not set
515# CONFIG_GAMEPORT is not set
485 516
486# 517#
487# Character devices 518# Character devices
488# 519#
489# CONFIG_VT is not set 520CONFIG_VT=y
521CONFIG_VT_CONSOLE=y
522CONFIG_HW_CONSOLE=y
490# CONFIG_SERIAL_NONSTANDARD is not set 523# CONFIG_SERIAL_NONSTANDARD is not set
491 524
492# 525#
493# Serial drivers 526# Serial drivers
494# 527#
495CONFIG_SERIAL_8250=y 528# CONFIG_SERIAL_8250 is not set
496CONFIG_SERIAL_8250_CONSOLE=y
497CONFIG_SERIAL_8250_NR_UARTS=2
498# CONFIG_SERIAL_8250_EXTENDED is not set
499 529
500# 530#
501# Non-8250 serial port support 531# Non-8250 serial port support
502# 532#
533CONFIG_SERIAL_MPSC=y
534CONFIG_SERIAL_MPSC_CONSOLE=y
503CONFIG_SERIAL_CORE=y 535CONFIG_SERIAL_CORE=y
504CONFIG_SERIAL_CORE_CONSOLE=y 536CONFIG_SERIAL_CORE_CONSOLE=y
537# CONFIG_SERIAL_JSM is not set
505CONFIG_UNIX98_PTYS=y 538CONFIG_UNIX98_PTYS=y
506CONFIG_LEGACY_PTYS=y 539CONFIG_LEGACY_PTYS=y
507CONFIG_LEGACY_PTY_COUNT=256 540CONFIG_LEGACY_PTY_COUNT=256
508# CONFIG_QIC02_TAPE is not set
509 541
510# 542#
511# IPMI 543# IPMI
@@ -526,15 +558,31 @@ CONFIG_GEN_RTC=y
526# 558#
527# Ftape, the floppy tape device driver 559# Ftape, the floppy tape device driver
528# 560#
529# CONFIG_FTAPE is not set
530# CONFIG_AGP is not set 561# CONFIG_AGP is not set
531# CONFIG_DRM is not set 562# CONFIG_DRM is not set
532# CONFIG_RAW_DRIVER is not set 563# CONFIG_RAW_DRIVER is not set
533 564
534# 565#
566# TPM devices
567#
568# CONFIG_TCG_TPM is not set
569
570#
535# I2C support 571# I2C support
536# 572#
537# CONFIG_I2C is not set 573# CONFIG_I2C is not set
574# CONFIG_I2C_SENSOR is not set
575
576#
577# Dallas's 1-wire bus
578#
579# CONFIG_W1 is not set
580
581#
582# Hardware Monitoring support
583#
584CONFIG_HWMON=y
585# CONFIG_HWMON_DEBUG_CHIP is not set
538 586
539# 587#
540# Misc devices 588# Misc devices
@@ -556,6 +604,12 @@ CONFIG_GEN_RTC=y
556# CONFIG_FB is not set 604# CONFIG_FB is not set
557 605
558# 606#
607# Console display driver support
608#
609# CONFIG_VGA_CONSOLE is not set
610CONFIG_DUMMY_CONSOLE=y
611
612#
559# Sound 613# Sound
560# 614#
561# CONFIG_SOUND is not set 615# CONFIG_SOUND is not set
@@ -563,6 +617,8 @@ CONFIG_GEN_RTC=y
563# 617#
564# USB support 618# USB support
565# 619#
620CONFIG_USB_ARCH_HAS_HCD=y
621CONFIG_USB_ARCH_HAS_OHCI=y
566# CONFIG_USB is not set 622# CONFIG_USB is not set
567 623
568# 624#
@@ -571,18 +627,40 @@ CONFIG_GEN_RTC=y
571# CONFIG_USB_GADGET is not set 627# CONFIG_USB_GADGET is not set
572 628
573# 629#
630# MMC/SD Card support
631#
632# CONFIG_MMC is not set
633
634#
635# InfiniBand support
636#
637# CONFIG_INFINIBAND is not set
638
639#
640# SN Devices
641#
642
643#
574# File systems 644# File systems
575# 645#
576CONFIG_EXT2_FS=y 646CONFIG_EXT2_FS=y
577# CONFIG_EXT2_FS_XATTR is not set 647# CONFIG_EXT2_FS_XATTR is not set
648# CONFIG_EXT2_FS_XIP is not set
578# CONFIG_EXT3_FS is not set 649# CONFIG_EXT3_FS is not set
579# CONFIG_JBD is not set 650# CONFIG_JBD is not set
580# CONFIG_REISERFS_FS is not set 651# CONFIG_REISERFS_FS is not set
581# CONFIG_JFS_FS is not set 652# CONFIG_JFS_FS is not set
653# CONFIG_FS_POSIX_ACL is not set
654
655#
656# XFS support
657#
582# CONFIG_XFS_FS is not set 658# CONFIG_XFS_FS is not set
583# CONFIG_MINIX_FS is not set 659# CONFIG_MINIX_FS is not set
584# CONFIG_ROMFS_FS is not set 660# CONFIG_ROMFS_FS is not set
661CONFIG_INOTIFY=y
585# CONFIG_QUOTA is not set 662# CONFIG_QUOTA is not set
663CONFIG_DNOTIFY=y
586# CONFIG_AUTOFS_FS is not set 664# CONFIG_AUTOFS_FS is not set
587# CONFIG_AUTOFS4_FS is not set 665# CONFIG_AUTOFS4_FS is not set
588 666
@@ -595,7 +673,8 @@ CONFIG_EXT2_FS=y
595# 673#
596# DOS/FAT/NT Filesystems 674# DOS/FAT/NT Filesystems
597# 675#
598# CONFIG_FAT_FS is not set 676# CONFIG_MSDOS_FS is not set
677# CONFIG_VFAT_FS is not set
599# CONFIG_NTFS_FS is not set 678# CONFIG_NTFS_FS is not set
600 679
601# 680#
@@ -604,9 +683,9 @@ CONFIG_EXT2_FS=y
604CONFIG_PROC_FS=y 683CONFIG_PROC_FS=y
605CONFIG_PROC_KCORE=y 684CONFIG_PROC_KCORE=y
606CONFIG_SYSFS=y 685CONFIG_SYSFS=y
607# CONFIG_DEVFS_FS is not set
608# CONFIG_DEVPTS_FS_XATTR is not set 686# CONFIG_DEVPTS_FS_XATTR is not set
609CONFIG_TMPFS=y 687CONFIG_TMPFS=y
688# CONFIG_TMPFS_XATTR is not set
610# CONFIG_HUGETLB_PAGE is not set 689# CONFIG_HUGETLB_PAGE is not set
611CONFIG_RAMFS=y 690CONFIG_RAMFS=y
612 691
@@ -620,6 +699,14 @@ CONFIG_RAMFS=y
620# CONFIG_BEFS_FS is not set 699# CONFIG_BEFS_FS is not set
621# CONFIG_BFS_FS is not set 700# CONFIG_BFS_FS is not set
622# CONFIG_EFS_FS is not set 701# CONFIG_EFS_FS is not set
702# CONFIG_JFFS_FS is not set
703CONFIG_JFFS2_FS=y
704CONFIG_JFFS2_FS_DEBUG=0
705CONFIG_JFFS2_FS_WRITEBUFFER=y
706# CONFIG_JFFS2_COMPRESSION_OPTIONS is not set
707CONFIG_JFFS2_ZLIB=y
708CONFIG_JFFS2_RTIME=y
709# CONFIG_JFFS2_RUBIN is not set
623# CONFIG_CRAMFS is not set 710# CONFIG_CRAMFS is not set
624# CONFIG_VXFS_FS is not set 711# CONFIG_VXFS_FS is not set
625# CONFIG_HPFS_FS is not set 712# CONFIG_HPFS_FS is not set
@@ -631,20 +718,22 @@ CONFIG_RAMFS=y
631# Network File Systems 718# Network File Systems
632# 719#
633CONFIG_NFS_FS=y 720CONFIG_NFS_FS=y
634# CONFIG_NFS_V3 is not set 721CONFIG_NFS_V3=y
722# CONFIG_NFS_V3_ACL is not set
635# CONFIG_NFS_V4 is not set 723# CONFIG_NFS_V4 is not set
636# CONFIG_NFS_DIRECTIO is not set 724# CONFIG_NFS_DIRECTIO is not set
637# CONFIG_NFSD is not set 725# CONFIG_NFSD is not set
638CONFIG_ROOT_NFS=y 726CONFIG_ROOT_NFS=y
639CONFIG_LOCKD=y 727CONFIG_LOCKD=y
640# CONFIG_EXPORTFS is not set 728CONFIG_LOCKD_V4=y
729CONFIG_NFS_COMMON=y
641CONFIG_SUNRPC=y 730CONFIG_SUNRPC=y
642# CONFIG_RPCSEC_GSS_KRB5 is not set 731# CONFIG_RPCSEC_GSS_KRB5 is not set
732# CONFIG_RPCSEC_GSS_SPKM3 is not set
643# CONFIG_SMB_FS is not set 733# CONFIG_SMB_FS is not set
644# CONFIG_CIFS is not set 734# CONFIG_CIFS is not set
645# CONFIG_NCP_FS is not set 735# CONFIG_NCP_FS is not set
646# CONFIG_CODA_FS is not set 736# CONFIG_CODA_FS is not set
647# CONFIG_INTERMEZZO_FS is not set
648# CONFIG_AFS_FS is not set 737# CONFIG_AFS_FS is not set
649 738
650# 739#
@@ -661,20 +750,35 @@ CONFIG_MSDOS_PARTITION=y
661# 750#
662# Library routines 751# Library routines
663# 752#
664# CONFIG_CRC32 is not set 753# CONFIG_CRC_CCITT is not set
754CONFIG_CRC32=y
755# CONFIG_LIBCRC32C is not set
756CONFIG_ZLIB_INFLATE=y
757CONFIG_ZLIB_DEFLATE=y
758
759#
760# Profiling support
761#
762# CONFIG_PROFILING is not set
665 763
666# 764#
667# Kernel hacking 765# Kernel hacking
668# 766#
767# CONFIG_PRINTK_TIME is not set
669# CONFIG_DEBUG_KERNEL is not set 768# CONFIG_DEBUG_KERNEL is not set
670# CONFIG_SERIAL_TEXT_DEBUG is not set 769CONFIG_LOG_BUF_SHIFT=14
671 770
672# 771#
673# Security options 772# Security options
674# 773#
774# CONFIG_KEYS is not set
675# CONFIG_SECURITY is not set 775# CONFIG_SECURITY is not set
676 776
677# 777#
678# Cryptographic options 778# Cryptographic options
679# 779#
680# CONFIG_CRYPTO is not set 780# CONFIG_CRYPTO is not set
781
782#
783# Hardware crypto devices
784#
diff --git a/arch/ppc/configs/katana_defconfig b/arch/ppc/configs/katana_defconfig
index f0b0d5720154..0f3bb9af9c22 100644
--- a/arch/ppc/configs/katana_defconfig
+++ b/arch/ppc/configs/katana_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.11 3# Linux kernel version: 2.6.13-mm1
4# Tue Mar 8 17:31:00 2005 4# Thu Sep 1 17:16:03 2005
5# 5#
6CONFIG_MMU=y 6CONFIG_MMU=y
7CONFIG_GENERIC_HARDIRQS=y 7CONFIG_GENERIC_HARDIRQS=y
@@ -11,6 +11,7 @@ CONFIG_HAVE_DEC_LOCK=y
11CONFIG_PPC=y 11CONFIG_PPC=y
12CONFIG_PPC32=y 12CONFIG_PPC32=y
13CONFIG_GENERIC_NVRAM=y 13CONFIG_GENERIC_NVRAM=y
14CONFIG_SCHED_NO_NO_OMIT_FRAME_POINTER=y
14 15
15# 16#
16# Code maturity level options 17# Code maturity level options
@@ -18,28 +19,31 @@ CONFIG_GENERIC_NVRAM=y
18CONFIG_EXPERIMENTAL=y 19CONFIG_EXPERIMENTAL=y
19CONFIG_CLEAN_COMPILE=y 20CONFIG_CLEAN_COMPILE=y
20CONFIG_BROKEN_ON_SMP=y 21CONFIG_BROKEN_ON_SMP=y
22CONFIG_INIT_ENV_ARG_LIMIT=32
21 23
22# 24#
23# General setup 25# General setup
24# 26#
25CONFIG_LOCALVERSION="" 27CONFIG_LOCALVERSION=""
28CONFIG_LOCALVERSION_AUTO=y
26CONFIG_SWAP=y 29CONFIG_SWAP=y
27CONFIG_SYSVIPC=y 30CONFIG_SYSVIPC=y
28# CONFIG_POSIX_MQUEUE is not set 31# CONFIG_POSIX_MQUEUE is not set
29# CONFIG_BSD_PROCESS_ACCT is not set 32# CONFIG_BSD_PROCESS_ACCT is not set
30CONFIG_SYSCTL=y 33CONFIG_SYSCTL=y
31# CONFIG_AUDIT is not set 34# CONFIG_AUDIT is not set
32CONFIG_LOG_BUF_SHIFT=14
33# CONFIG_HOTPLUG is not set 35# CONFIG_HOTPLUG is not set
34CONFIG_KOBJECT_UEVENT=y 36CONFIG_KOBJECT_UEVENT=y
35# CONFIG_IKCONFIG is not set 37# CONFIG_IKCONFIG is not set
38CONFIG_INITRAMFS_SOURCE=""
36# CONFIG_EMBEDDED is not set 39# CONFIG_EMBEDDED is not set
37CONFIG_KALLSYMS=y 40CONFIG_KALLSYMS=y
38# CONFIG_KALLSYMS_EXTRA_PASS is not set 41# CONFIG_KALLSYMS_EXTRA_PASS is not set
42CONFIG_PRINTK=y
43CONFIG_BUG=y
39CONFIG_BASE_FULL=y 44CONFIG_BASE_FULL=y
40CONFIG_FUTEX=y 45CONFIG_FUTEX=y
41CONFIG_EPOLL=y 46CONFIG_EPOLL=y
42# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
43CONFIG_SHMEM=y 47CONFIG_SHMEM=y
44CONFIG_CC_ALIGN_FUNCTIONS=0 48CONFIG_CC_ALIGN_FUNCTIONS=0
45CONFIG_CC_ALIGN_LABELS=0 49CONFIG_CC_ALIGN_LABELS=0
@@ -68,15 +72,23 @@ CONFIG_6xx=y
68# CONFIG_POWER3 is not set 72# CONFIG_POWER3 is not set
69# CONFIG_POWER4 is not set 73# CONFIG_POWER4 is not set
70# CONFIG_8xx is not set 74# CONFIG_8xx is not set
75# CONFIG_E200 is not set
71# CONFIG_E500 is not set 76# CONFIG_E500 is not set
77CONFIG_PPC_FPU=y
72CONFIG_ALTIVEC=y 78CONFIG_ALTIVEC=y
73# CONFIG_TAU is not set 79# CONFIG_TAU is not set
80# CONFIG_KEXEC is not set
74# CONFIG_CPU_FREQ is not set 81# CONFIG_CPU_FREQ is not set
75# CONFIG_83xx is not set 82# CONFIG_WANT_EARLY_SERIAL is not set
76CONFIG_PPC_STD_MMU=y 83CONFIG_PPC_STD_MMU=y
77CONFIG_NOT_COHERENT_CACHE=y 84CONFIG_NOT_COHERENT_CACHE=y
78 85
79# 86#
87# Performance-monitoring counters support
88#
89# CONFIG_PERFCTR is not set
90
91#
80# Platform options 92# Platform options
81# 93#
82# CONFIG_PPC_MULTIPLATFORM is not set 94# CONFIG_PPC_MULTIPLATFORM is not set
@@ -84,21 +96,18 @@ CONFIG_NOT_COHERENT_CACHE=y
84CONFIG_KATANA=y 96CONFIG_KATANA=y
85# CONFIG_WILLOW is not set 97# CONFIG_WILLOW is not set
86# CONFIG_CPCI690 is not set 98# CONFIG_CPCI690 is not set
87# CONFIG_PCORE is not set
88# CONFIG_POWERPMC250 is not set 99# CONFIG_POWERPMC250 is not set
89# CONFIG_CHESTNUT is not set 100# CONFIG_CHESTNUT is not set
90# CONFIG_SPRUCE is not set 101# CONFIG_SPRUCE is not set
102# CONFIG_HDPU is not set
91# CONFIG_EV64260 is not set 103# CONFIG_EV64260 is not set
92# CONFIG_LOPEC is not set 104# CONFIG_LOPEC is not set
93# CONFIG_MCPN765 is not set
94# CONFIG_MVME5100 is not set 105# CONFIG_MVME5100 is not set
95# CONFIG_PPLUS is not set 106# CONFIG_PPLUS is not set
96# CONFIG_PRPMC750 is not set 107# CONFIG_PRPMC750 is not set
97# CONFIG_PRPMC800 is not set 108# CONFIG_PRPMC800 is not set
98# CONFIG_SANDPOINT is not set 109# CONFIG_SANDPOINT is not set
99# CONFIG_RADSTONE_PPC7D is not set 110# CONFIG_RADSTONE_PPC7D is not set
100# CONFIG_ADIR is not set
101# CONFIG_K2 is not set
102# CONFIG_PAL4 is not set 111# CONFIG_PAL4 is not set
103# CONFIG_GEMINI is not set 112# CONFIG_GEMINI is not set
104# CONFIG_EST8260 is not set 113# CONFIG_EST8260 is not set
@@ -109,6 +118,8 @@ CONFIG_KATANA=y
109# CONFIG_ADS8272 is not set 118# CONFIG_ADS8272 is not set
110# CONFIG_PQ2FADS is not set 119# CONFIG_PQ2FADS is not set
111# CONFIG_LITE5200 is not set 120# CONFIG_LITE5200 is not set
121# CONFIG_MPC834x_SYS is not set
122# CONFIG_EV64360 is not set
112CONFIG_MV64360=y 123CONFIG_MV64360=y
113CONFIG_MV64X60=y 124CONFIG_MV64X60=y
114 125
@@ -118,12 +129,28 @@ CONFIG_MV64X60=y
118CONFIG_MV64X60_BASE=0xf8100000 129CONFIG_MV64X60_BASE=0xf8100000
119CONFIG_MV64X60_NEW_BASE=0xf8100000 130CONFIG_MV64X60_NEW_BASE=0xf8100000
120# CONFIG_SMP is not set 131# CONFIG_SMP is not set
132CONFIG_HIGHMEM=y
133# CONFIG_HZ_100 is not set
134CONFIG_HZ_250=y
135# CONFIG_HZ_1000 is not set
136CONFIG_HZ=250
137CONFIG_PREEMPT_NONE=y
138# CONFIG_PREEMPT_VOLUNTARY is not set
121# CONFIG_PREEMPT is not set 139# CONFIG_PREEMPT is not set
122# CONFIG_HIGHMEM is not set 140CONFIG_SELECT_MEMORY_MODEL=y
141CONFIG_FLATMEM_MANUAL=y
142# CONFIG_DISCONTIGMEM_MANUAL is not set
143# CONFIG_SPARSEMEM_MANUAL is not set
144CONFIG_FLATMEM=y
145CONFIG_FLAT_NODE_MEM_MAP=y
146# CONFIG_SPARSEMEM_STATIC is not set
123CONFIG_BINFMT_ELF=y 147CONFIG_BINFMT_ELF=y
124CONFIG_BINFMT_MISC=y 148CONFIG_BINFMT_MISC=y
125CONFIG_CMDLINE_BOOL=y 149CONFIG_CMDLINE_BOOL=y
126CONFIG_CMDLINE="console=ttyMM0,9600 ip=on" 150CONFIG_CMDLINE="console=ttyMM0 ip=on"
151# CONFIG_PM is not set
152CONFIG_SECCOMP=y
153CONFIG_ISA_DMA_API=y
127 154
128# 155#
129# Bus options 156# Bus options
@@ -132,7 +159,6 @@ CONFIG_GENERIC_ISA_DMA=y
132CONFIG_PCI=y 159CONFIG_PCI=y
133CONFIG_PCI_DOMAINS=y 160CONFIG_PCI_DOMAINS=y
134CONFIG_PCI_LEGACY_PROC=y 161CONFIG_PCI_LEGACY_PROC=y
135CONFIG_PCI_NAMES=y
136 162
137# 163#
138# PCCARD (PCMCIA/CardBus) support 164# PCCARD (PCMCIA/CardBus) support
@@ -140,13 +166,10 @@ CONFIG_PCI_NAMES=y
140# CONFIG_PCCARD is not set 166# CONFIG_PCCARD is not set
141 167
142# 168#
143# PC-card bridges
144#
145
146#
147# Advanced setup 169# Advanced setup
148# 170#
149CONFIG_ADVANCED_OPTIONS=y 171CONFIG_ADVANCED_OPTIONS=y
172# CONFIG_HIGHMEM_START_BOOL is not set
150CONFIG_HIGHMEM_START=0xfe000000 173CONFIG_HIGHMEM_START=0xfe000000
151# CONFIG_LOWMEM_SIZE_BOOL is not set 174# CONFIG_LOWMEM_SIZE_BOOL is not set
152CONFIG_LOWMEM_SIZE=0x30000000 175CONFIG_LOWMEM_SIZE=0x30000000
@@ -162,6 +185,76 @@ CONFIG_CONSISTENT_SIZE=0x00400000
162CONFIG_BOOT_LOAD=0x00800000 185CONFIG_BOOT_LOAD=0x00800000
163 186
164# 187#
188# Networking
189#
190CONFIG_NET=y
191
192#
193# Networking options
194#
195CONFIG_PACKET=y
196# CONFIG_PACKET_MMAP is not set
197CONFIG_UNIX=y
198# CONFIG_NET_KEY is not set
199CONFIG_INET=y
200CONFIG_IP_MULTICAST=y
201# CONFIG_IP_ADVANCED_ROUTER is not set
202CONFIG_IP_FIB_HASH=y
203CONFIG_IP_PNP=y
204CONFIG_IP_PNP_DHCP=y
205# CONFIG_IP_PNP_BOOTP is not set
206# CONFIG_IP_PNP_RARP is not set
207# CONFIG_NET_IPIP is not set
208# CONFIG_NET_IPGRE is not set
209# CONFIG_IP_MROUTE is not set
210# CONFIG_ARPD is not set
211CONFIG_SYN_COOKIES=y
212# CONFIG_INET_AH is not set
213# CONFIG_INET_ESP is not set
214# CONFIG_INET_IPCOMP is not set
215# CONFIG_INET_TUNNEL is not set
216CONFIG_INET_DIAG=y
217CONFIG_INET_TCP_DIAG=y
218# CONFIG_TCP_CONG_ADVANCED is not set
219CONFIG_TCP_CONG_BIC=y
220# CONFIG_IPV6 is not set
221# CONFIG_NETFILTER is not set
222
223#
224# DCCP Configuration (EXPERIMENTAL)
225#
226# CONFIG_IP_DCCP is not set
227
228#
229# SCTP Configuration (EXPERIMENTAL)
230#
231# CONFIG_IP_SCTP is not set
232# CONFIG_ATM is not set
233# CONFIG_BRIDGE is not set
234# CONFIG_VLAN_8021Q is not set
235# CONFIG_DECNET is not set
236# CONFIG_LLC2 is not set
237# CONFIG_IPX is not set
238# CONFIG_ATALK is not set
239# CONFIG_X25 is not set
240# CONFIG_LAPB is not set
241# CONFIG_NET_DIVERT is not set
242# CONFIG_ECONET is not set
243# CONFIG_WAN_ROUTER is not set
244# CONFIG_NET_SCHED is not set
245# CONFIG_NET_CLS_ROUTE is not set
246
247#
248# Network testing
249#
250# CONFIG_NET_PKTGEN is not set
251# CONFIG_NETFILTER_NETLINK is not set
252# CONFIG_HAMRADIO is not set
253# CONFIG_IRDA is not set
254# CONFIG_BT is not set
255# CONFIG_IEEE80211 is not set
256
257#
165# Device Drivers 258# Device Drivers
166# 259#
167 260
@@ -177,8 +270,8 @@ CONFIG_PREVENT_FIRMWARE_BUILD=y
177# 270#
178CONFIG_MTD=y 271CONFIG_MTD=y
179# CONFIG_MTD_DEBUG is not set 272# CONFIG_MTD_DEBUG is not set
180CONFIG_MTD_PARTITIONS=y
181CONFIG_MTD_CONCAT=y 273CONFIG_MTD_CONCAT=y
274CONFIG_MTD_PARTITIONS=y
182# CONFIG_MTD_REDBOOT_PARTS is not set 275# CONFIG_MTD_REDBOOT_PARTS is not set
183# CONFIG_MTD_CMDLINE_PARTS is not set 276# CONFIG_MTD_CMDLINE_PARTS is not set
184 277
@@ -212,6 +305,7 @@ CONFIG_MTD_MAP_BANK_WIDTH_4=y
212CONFIG_MTD_CFI_I2=y 305CONFIG_MTD_CFI_I2=y
213# CONFIG_MTD_CFI_I4 is not set 306# CONFIG_MTD_CFI_I4 is not set
214# CONFIG_MTD_CFI_I8 is not set 307# CONFIG_MTD_CFI_I8 is not set
308# CONFIG_MTD_OTP is not set
215CONFIG_MTD_CFI_INTELEXT=y 309CONFIG_MTD_CFI_INTELEXT=y
216# CONFIG_MTD_CFI_AMDSTD is not set 310# CONFIG_MTD_CFI_AMDSTD is not set
217# CONFIG_MTD_CFI_STAA is not set 311# CONFIG_MTD_CFI_STAA is not set
@@ -219,7 +313,6 @@ CONFIG_MTD_CFI_UTIL=y
219# CONFIG_MTD_RAM is not set 313# CONFIG_MTD_RAM is not set
220# CONFIG_MTD_ROM is not set 314# CONFIG_MTD_ROM is not set
221# CONFIG_MTD_ABSENT is not set 315# CONFIG_MTD_ABSENT is not set
222# CONFIG_MTD_XIP is not set
223 316
224# 317#
225# Mapping drivers for chip access 318# Mapping drivers for chip access
@@ -229,6 +322,7 @@ CONFIG_MTD_PHYSMAP=y
229CONFIG_MTD_PHYSMAP_START=0xe0000000 322CONFIG_MTD_PHYSMAP_START=0xe0000000
230CONFIG_MTD_PHYSMAP_LEN=0x0 323CONFIG_MTD_PHYSMAP_LEN=0x0
231CONFIG_MTD_PHYSMAP_BANKWIDTH=4 324CONFIG_MTD_PHYSMAP_BANKWIDTH=4
325# CONFIG_MTD_PLATRAM is not set
232 326
233# 327#
234# Self-contained MTD device drivers 328# Self-contained MTD device drivers
@@ -278,7 +372,6 @@ CONFIG_BLK_DEV_RAM=y
278CONFIG_BLK_DEV_RAM_COUNT=16 372CONFIG_BLK_DEV_RAM_COUNT=16
279CONFIG_BLK_DEV_RAM_SIZE=4096 373CONFIG_BLK_DEV_RAM_SIZE=4096
280CONFIG_BLK_DEV_INITRD=y 374CONFIG_BLK_DEV_INITRD=y
281CONFIG_INITRAMFS_SOURCE=""
282# CONFIG_LBD is not set 375# CONFIG_LBD is not set
283# CONFIG_CDROM_PKTCDVD is not set 376# CONFIG_CDROM_PKTCDVD is not set
284 377
@@ -299,6 +392,7 @@ CONFIG_IOSCHED_CFQ=y
299# 392#
300# SCSI device support 393# SCSI device support
301# 394#
395# CONFIG_RAID_ATTRS is not set
302# CONFIG_SCSI is not set 396# CONFIG_SCSI is not set
303 397
304# 398#
@@ -309,6 +403,7 @@ CONFIG_IOSCHED_CFQ=y
309# 403#
310# Fusion MPT device support 404# Fusion MPT device support
311# 405#
406# CONFIG_FUSION is not set
312 407
313# 408#
314# IEEE 1394 (FireWire) support 409# IEEE 1394 (FireWire) support
@@ -325,71 +420,8 @@ CONFIG_IOSCHED_CFQ=y
325# 420#
326 421
327# 422#
328# Networking support 423# Network device support
329#
330CONFIG_NET=y
331
332#
333# Networking options
334#
335CONFIG_PACKET=y
336# CONFIG_PACKET_MMAP is not set
337# CONFIG_NETLINK_DEV is not set
338CONFIG_UNIX=y
339# CONFIG_NET_KEY is not set
340CONFIG_INET=y
341CONFIG_IP_MULTICAST=y
342# CONFIG_IP_ADVANCED_ROUTER is not set
343CONFIG_IP_PNP=y
344CONFIG_IP_PNP_DHCP=y
345# CONFIG_IP_PNP_BOOTP is not set
346# CONFIG_IP_PNP_RARP is not set
347# CONFIG_NET_IPIP is not set
348# CONFIG_NET_IPGRE is not set
349# CONFIG_IP_MROUTE is not set
350# CONFIG_ARPD is not set
351CONFIG_SYN_COOKIES=y
352# CONFIG_INET_AH is not set
353# CONFIG_INET_ESP is not set
354# CONFIG_INET_IPCOMP is not set
355# CONFIG_INET_TUNNEL is not set
356CONFIG_IP_TCPDIAG=y
357# CONFIG_IP_TCPDIAG_IPV6 is not set
358# CONFIG_IPV6 is not set
359# CONFIG_NETFILTER is not set
360
361#
362# SCTP Configuration (EXPERIMENTAL)
363#
364# CONFIG_IP_SCTP is not set
365# CONFIG_ATM is not set
366# CONFIG_BRIDGE is not set
367# CONFIG_VLAN_8021Q is not set
368# CONFIG_DECNET is not set
369# CONFIG_LLC2 is not set
370# CONFIG_IPX is not set
371# CONFIG_ATALK is not set
372# CONFIG_X25 is not set
373# CONFIG_LAPB is not set
374# CONFIG_NET_DIVERT is not set
375# CONFIG_ECONET is not set
376# CONFIG_WAN_ROUTER is not set
377
378#
379# QoS and/or fair queueing
380#
381# CONFIG_NET_SCHED is not set
382# CONFIG_NET_CLS_ROUTE is not set
383
384#
385# Network testing
386# 424#
387# CONFIG_NET_PKTGEN is not set
388# CONFIG_NETPOLL is not set
389# CONFIG_NET_POLL_CONTROLLER is not set
390# CONFIG_HAMRADIO is not set
391# CONFIG_IRDA is not set
392# CONFIG_BT is not set
393CONFIG_NETDEVICES=y 425CONFIG_NETDEVICES=y
394# CONFIG_DUMMY is not set 426# CONFIG_DUMMY is not set
395# CONFIG_BONDING is not set 427# CONFIG_BONDING is not set
@@ -402,6 +434,11 @@ CONFIG_NETDEVICES=y
402# CONFIG_ARCNET is not set 434# CONFIG_ARCNET is not set
403 435
404# 436#
437# PHY device support
438#
439# CONFIG_PHYLIB is not set
440
441#
405# Ethernet (10 or 100Mbit) 442# Ethernet (10 or 100Mbit)
406# 443#
407CONFIG_NET_ETHERNET=y 444CONFIG_NET_ETHERNET=y
@@ -422,6 +459,7 @@ CONFIG_TULIP=y
422# CONFIG_DE4X5 is not set 459# CONFIG_DE4X5 is not set
423# CONFIG_WINBOND_840 is not set 460# CONFIG_WINBOND_840 is not set
424# CONFIG_DM9102 is not set 461# CONFIG_DM9102 is not set
462# CONFIG_ULI526X is not set
425# CONFIG_HP100 is not set 463# CONFIG_HP100 is not set
426CONFIG_NET_PCI=y 464CONFIG_NET_PCI=y
427# CONFIG_PCNET32 is not set 465# CONFIG_PCNET32 is not set
@@ -448,14 +486,19 @@ CONFIG_E100=y
448# 486#
449# CONFIG_ACENIC is not set 487# CONFIG_ACENIC is not set
450# CONFIG_DL2K is not set 488# CONFIG_DL2K is not set
451# CONFIG_E1000 is not set 489CONFIG_E1000=y
490# CONFIG_E1000_NAPI is not set
452# CONFIG_NS83820 is not set 491# CONFIG_NS83820 is not set
453# CONFIG_HAMACHI is not set 492# CONFIG_HAMACHI is not set
454# CONFIG_YELLOWFIN is not set 493# CONFIG_YELLOWFIN is not set
455# CONFIG_R8169 is not set 494# CONFIG_R8169 is not set
495# CONFIG_SIS190 is not set
496# CONFIG_SKGE is not set
497# CONFIG_SKY2 is not set
456# CONFIG_SK98LIN is not set 498# CONFIG_SK98LIN is not set
457# CONFIG_VIA_VELOCITY is not set 499# CONFIG_VIA_VELOCITY is not set
458# CONFIG_TIGON3 is not set 500# CONFIG_TIGON3 is not set
501# CONFIG_BNX2 is not set
459CONFIG_MV643XX_ETH=y 502CONFIG_MV643XX_ETH=y
460CONFIG_MV643XX_ETH_0=y 503CONFIG_MV643XX_ETH_0=y
461CONFIG_MV643XX_ETH_1=y 504CONFIG_MV643XX_ETH_1=y
@@ -464,6 +507,7 @@ CONFIG_MV643XX_ETH_2=y
464# 507#
465# Ethernet (10000 Mbit) 508# Ethernet (10000 Mbit)
466# 509#
510# CONFIG_CHELSIO_T1 is not set
467# CONFIG_IXGB is not set 511# CONFIG_IXGB is not set
468# CONFIG_S2IO is not set 512# CONFIG_S2IO is not set
469 513
@@ -487,6 +531,11 @@ CONFIG_MV643XX_ETH_2=y
487# CONFIG_SLIP is not set 531# CONFIG_SLIP is not set
488# CONFIG_SHAPER is not set 532# CONFIG_SHAPER is not set
489# CONFIG_NETCONSOLE is not set 533# CONFIG_NETCONSOLE is not set
534# CONFIG_KGDBOE is not set
535# CONFIG_NETPOLL is not set
536# CONFIG_NETPOLL_RX is not set
537# CONFIG_NETPOLL_TRAP is not set
538# CONFIG_NET_POLL_CONTROLLER is not set
490 539
491# 540#
492# ISDN subsystem 541# ISDN subsystem
@@ -516,14 +565,6 @@ CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768
516# CONFIG_INPUT_EVBUG is not set 565# CONFIG_INPUT_EVBUG is not set
517 566
518# 567#
519# Input I/O drivers
520#
521# CONFIG_GAMEPORT is not set
522CONFIG_SOUND_GAMEPORT=y
523# CONFIG_SERIO is not set
524# CONFIG_SERIO_I8042 is not set
525
526#
527# Input Device Drivers 568# Input Device Drivers
528# 569#
529# CONFIG_INPUT_KEYBOARD is not set 570# CONFIG_INPUT_KEYBOARD is not set
@@ -533,6 +574,12 @@ CONFIG_SOUND_GAMEPORT=y
533# CONFIG_INPUT_MISC is not set 574# CONFIG_INPUT_MISC is not set
534 575
535# 576#
577# Hardware I/O ports
578#
579# CONFIG_SERIO is not set
580# CONFIG_GAMEPORT is not set
581
582#
536# Character devices 583# Character devices
537# 584#
538CONFIG_VT=y 585CONFIG_VT=y
@@ -552,6 +599,7 @@ CONFIG_SERIAL_MPSC=y
552CONFIG_SERIAL_MPSC_CONSOLE=y 599CONFIG_SERIAL_MPSC_CONSOLE=y
553CONFIG_SERIAL_CORE=y 600CONFIG_SERIAL_CORE=y
554CONFIG_SERIAL_CORE_CONSOLE=y 601CONFIG_SERIAL_CORE_CONSOLE=y
602# CONFIG_SERIAL_JSM is not set
555CONFIG_UNIX98_PTYS=y 603CONFIG_UNIX98_PTYS=y
556CONFIG_LEGACY_PTYS=y 604CONFIG_LEGACY_PTYS=y
557CONFIG_LEGACY_PTY_COUNT=256 605CONFIG_LEGACY_PTY_COUNT=256
@@ -580,6 +628,11 @@ CONFIG_GEN_RTC=y
580# CONFIG_RAW_DRIVER is not set 628# CONFIG_RAW_DRIVER is not set
581 629
582# 630#
631# TPM devices
632#
633# CONFIG_TCG_TPM is not set
634
635#
583# I2C support 636# I2C support
584# 637#
585CONFIG_I2C=y 638CONFIG_I2C=y
@@ -602,11 +655,10 @@ CONFIG_I2C_CHARDEV=y
602# CONFIG_I2C_AMD8111 is not set 655# CONFIG_I2C_AMD8111 is not set
603# CONFIG_I2C_I801 is not set 656# CONFIG_I2C_I801 is not set
604# CONFIG_I2C_I810 is not set 657# CONFIG_I2C_I810 is not set
605# CONFIG_I2C_ISA is not set 658# CONFIG_I2C_PIIX4 is not set
606# CONFIG_I2C_MPC is not set 659# CONFIG_I2C_MPC is not set
607# CONFIG_I2C_NFORCE2 is not set 660# CONFIG_I2C_NFORCE2 is not set
608# CONFIG_I2C_PARPORT_LIGHT is not set 661# CONFIG_I2C_PARPORT_LIGHT is not set
609# CONFIG_I2C_PIIX4 is not set
610# CONFIG_I2C_PROSAVAGE is not set 662# CONFIG_I2C_PROSAVAGE is not set
611# CONFIG_I2C_SAVAGE4 is not set 663# CONFIG_I2C_SAVAGE4 is not set
612# CONFIG_SCx200_ACB is not set 664# CONFIG_SCx200_ACB is not set
@@ -621,14 +673,39 @@ CONFIG_I2C_CHARDEV=y
621CONFIG_I2C_MV64XXX=y 673CONFIG_I2C_MV64XXX=y
622 674
623# 675#
624# Hardware Sensors Chip support 676# Miscellaneous I2C Chip support
625# 677#
626# CONFIG_I2C_SENSOR is not set 678# CONFIG_SENSORS_DS1337 is not set
679# CONFIG_SENSORS_DS1374 is not set
680# CONFIG_SENSORS_EEPROM is not set
681# CONFIG_SENSORS_PCF8574 is not set
682# CONFIG_SENSORS_PCA9539 is not set
683# CONFIG_SENSORS_PCF8591 is not set
684# CONFIG_SENSORS_RTC8564 is not set
685CONFIG_SENSORS_M41T00=y
686# CONFIG_SENSORS_MAX6875 is not set
687# CONFIG_I2C_DEBUG_CORE is not set
688# CONFIG_I2C_DEBUG_ALGO is not set
689# CONFIG_I2C_DEBUG_BUS is not set
690# CONFIG_I2C_DEBUG_CHIP is not set
691
692#
693# Dallas's 1-wire bus
694#
695# CONFIG_W1 is not set
696
697#
698# Hardware Monitoring support
699#
700CONFIG_HWMON=y
701# CONFIG_HWMON_VID is not set
627# CONFIG_SENSORS_ADM1021 is not set 702# CONFIG_SENSORS_ADM1021 is not set
628# CONFIG_SENSORS_ADM1025 is not set 703# CONFIG_SENSORS_ADM1025 is not set
629# CONFIG_SENSORS_ADM1026 is not set 704# CONFIG_SENSORS_ADM1026 is not set
630# CONFIG_SENSORS_ADM1031 is not set 705# CONFIG_SENSORS_ADM1031 is not set
706# CONFIG_SENSORS_ADM9240 is not set
631# CONFIG_SENSORS_ASB100 is not set 707# CONFIG_SENSORS_ASB100 is not set
708# CONFIG_SENSORS_ATXP1 is not set
632# CONFIG_SENSORS_DS1621 is not set 709# CONFIG_SENSORS_DS1621 is not set
633# CONFIG_SENSORS_FSCHER is not set 710# CONFIG_SENSORS_FSCHER is not set
634# CONFIG_SENSORS_FSCPOS is not set 711# CONFIG_SENSORS_FSCPOS is not set
@@ -644,36 +721,26 @@ CONFIG_I2C_MV64XXX=y
644# CONFIG_SENSORS_LM85 is not set 721# CONFIG_SENSORS_LM85 is not set
645# CONFIG_SENSORS_LM87 is not set 722# CONFIG_SENSORS_LM87 is not set
646# CONFIG_SENSORS_LM90 is not set 723# CONFIG_SENSORS_LM90 is not set
724# CONFIG_SENSORS_LM92 is not set
647# CONFIG_SENSORS_MAX1619 is not set 725# CONFIG_SENSORS_MAX1619 is not set
648# CONFIG_SENSORS_PC87360 is not set 726# CONFIG_SENSORS_PC87360 is not set
649# CONFIG_SENSORS_SMSC47B397 is not set
650# CONFIG_SENSORS_SIS5595 is not set 727# CONFIG_SENSORS_SIS5595 is not set
651# CONFIG_SENSORS_SMSC47M1 is not set 728# CONFIG_SENSORS_SMSC47M1 is not set
729# CONFIG_SENSORS_SMSC47B397 is not set
652# CONFIG_SENSORS_VIA686A is not set 730# CONFIG_SENSORS_VIA686A is not set
653# CONFIG_SENSORS_W83781D is not set 731# CONFIG_SENSORS_W83781D is not set
732# CONFIG_SENSORS_W83792D is not set
654# CONFIG_SENSORS_W83L785TS is not set 733# CONFIG_SENSORS_W83L785TS is not set
655# CONFIG_SENSORS_W83627HF is not set 734# CONFIG_SENSORS_W83627HF is not set
735# CONFIG_SENSORS_W83627EHF is not set
736# CONFIG_HWMON_DEBUG_CHIP is not set
656 737
657# 738#
658# Other I2C Chip support 739# Misc devices
659#
660# CONFIG_SENSORS_EEPROM is not set
661# CONFIG_SENSORS_PCF8574 is not set
662# CONFIG_SENSORS_PCF8591 is not set
663# CONFIG_SENSORS_RTC8564 is not set
664CONFIG_SENSORS_M41T00=y
665# CONFIG_I2C_DEBUG_CORE is not set
666# CONFIG_I2C_DEBUG_ALGO is not set
667# CONFIG_I2C_DEBUG_BUS is not set
668# CONFIG_I2C_DEBUG_CHIP is not set
669
670#
671# Dallas's 1-wire bus
672# 740#
673# CONFIG_W1 is not set
674 741
675# 742#
676# Misc devices 743# Multimedia Capabilities Port drivers
677# 744#
678 745
679# 746#
@@ -698,6 +765,11 @@ CONFIG_SENSORS_M41T00=y
698CONFIG_DUMMY_CONSOLE=y 765CONFIG_DUMMY_CONSOLE=y
699 766
700# 767#
768# Speakup console speech
769#
770# CONFIG_SPEAKUP is not set
771
772#
701# Sound 773# Sound
702# 774#
703# CONFIG_SOUND is not set 775# CONFIG_SOUND is not set
@@ -705,13 +777,9 @@ CONFIG_DUMMY_CONSOLE=y
705# 777#
706# USB support 778# USB support
707# 779#
708# CONFIG_USB is not set
709CONFIG_USB_ARCH_HAS_HCD=y 780CONFIG_USB_ARCH_HAS_HCD=y
710CONFIG_USB_ARCH_HAS_OHCI=y 781CONFIG_USB_ARCH_HAS_OHCI=y
711 782# CONFIG_USB is not set
712#
713# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support' may also be needed; see USB_STORAGE Help for more information
714#
715 783
716# 784#
717# USB Gadget Support 785# USB Gadget Support
@@ -729,25 +797,39 @@ CONFIG_USB_ARCH_HAS_OHCI=y
729# CONFIG_INFINIBAND is not set 797# CONFIG_INFINIBAND is not set
730 798
731# 799#
800# SN Devices
801#
802
803#
804# Distributed Lock Manager
805#
806# CONFIG_DLM is not set
807
808#
732# File systems 809# File systems
733# 810#
734CONFIG_EXT2_FS=y 811CONFIG_EXT2_FS=y
735# CONFIG_EXT2_FS_XATTR is not set 812# CONFIG_EXT2_FS_XATTR is not set
813# CONFIG_EXT2_FS_XIP is not set
736# CONFIG_EXT3_FS is not set 814# CONFIG_EXT3_FS is not set
737# CONFIG_JBD is not set 815# CONFIG_REISER4_FS is not set
738# CONFIG_REISERFS_FS is not set 816# CONFIG_REISERFS_FS is not set
739# CONFIG_JFS_FS is not set 817# CONFIG_JFS_FS is not set
818# CONFIG_FS_POSIX_ACL is not set
740 819
741# 820#
742# XFS support 821# XFS support
743# 822#
744# CONFIG_XFS_FS is not set 823# CONFIG_XFS_FS is not set
824# CONFIG_OCFS2_FS is not set
745# CONFIG_MINIX_FS is not set 825# CONFIG_MINIX_FS is not set
746# CONFIG_ROMFS_FS is not set 826# CONFIG_ROMFS_FS is not set
827CONFIG_INOTIFY=y
747# CONFIG_QUOTA is not set 828# CONFIG_QUOTA is not set
748CONFIG_DNOTIFY=y 829CONFIG_DNOTIFY=y
749# CONFIG_AUTOFS_FS is not set 830# CONFIG_AUTOFS_FS is not set
750# CONFIG_AUTOFS4_FS is not set 831# CONFIG_AUTOFS4_FS is not set
832# CONFIG_FUSE_FS is not set
751 833
752# 834#
753# CD-ROM/DVD Filesystems 835# CD-ROM/DVD Filesystems
@@ -768,20 +850,18 @@ CONFIG_DNOTIFY=y
768CONFIG_PROC_FS=y 850CONFIG_PROC_FS=y
769CONFIG_PROC_KCORE=y 851CONFIG_PROC_KCORE=y
770CONFIG_SYSFS=y 852CONFIG_SYSFS=y
771CONFIG_DEVFS_FS=y
772# CONFIG_DEVFS_MOUNT is not set
773# CONFIG_DEVFS_DEBUG is not set
774# CONFIG_DEVPTS_FS_XATTR is not set
775CONFIG_TMPFS=y 853CONFIG_TMPFS=y
776# CONFIG_TMPFS_XATTR is not set
777# CONFIG_HUGETLB_PAGE is not set 854# CONFIG_HUGETLB_PAGE is not set
778CONFIG_RAMFS=y 855CONFIG_RAMFS=y
856# CONFIG_CONFIGFS_FS is not set
857# CONFIG_RELAYFS_FS is not set
779 858
780# 859#
781# Miscellaneous filesystems 860# Miscellaneous filesystems
782# 861#
783# CONFIG_ADFS_FS is not set 862# CONFIG_ADFS_FS is not set
784# CONFIG_AFFS_FS is not set 863# CONFIG_AFFS_FS is not set
864# CONFIG_ASFS_FS is not set
785# CONFIG_HFS_FS is not set 865# CONFIG_HFS_FS is not set
786# CONFIG_HFSPLUS_FS is not set 866# CONFIG_HFSPLUS_FS is not set
787# CONFIG_BEFS_FS is not set 867# CONFIG_BEFS_FS is not set
@@ -801,12 +881,14 @@ CONFIG_RAMFS=y
801# 881#
802CONFIG_NFS_FS=y 882CONFIG_NFS_FS=y
803CONFIG_NFS_V3=y 883CONFIG_NFS_V3=y
884# CONFIG_NFS_V3_ACL is not set
804# CONFIG_NFS_V4 is not set 885# CONFIG_NFS_V4 is not set
805# CONFIG_NFS_DIRECTIO is not set 886# CONFIG_NFS_DIRECTIO is not set
806# CONFIG_NFSD is not set 887# CONFIG_NFSD is not set
807CONFIG_ROOT_NFS=y 888CONFIG_ROOT_NFS=y
808CONFIG_LOCKD=y 889CONFIG_LOCKD=y
809CONFIG_LOCKD_V4=y 890CONFIG_LOCKD_V4=y
891CONFIG_NFS_COMMON=y
810CONFIG_SUNRPC=y 892CONFIG_SUNRPC=y
811# CONFIG_RPCSEC_GSS_KRB5 is not set 893# CONFIG_RPCSEC_GSS_KRB5 is not set
812# CONFIG_RPCSEC_GSS_SPKM3 is not set 894# CONFIG_RPCSEC_GSS_SPKM3 is not set
@@ -815,6 +897,7 @@ CONFIG_SUNRPC=y
815# CONFIG_NCP_FS is not set 897# CONFIG_NCP_FS is not set
816# CONFIG_CODA_FS is not set 898# CONFIG_CODA_FS is not set
817# CONFIG_AFS_FS is not set 899# CONFIG_AFS_FS is not set
900# CONFIG_9P_FS is not set
818 901
819# 902#
820# Partition Types 903# Partition Types
@@ -831,6 +914,7 @@ CONFIG_MSDOS_PARTITION=y
831# Library routines 914# Library routines
832# 915#
833# CONFIG_CRC_CCITT is not set 916# CONFIG_CRC_CCITT is not set
917# CONFIG_CRC16 is not set
834CONFIG_CRC32=y 918CONFIG_CRC32=y
835# CONFIG_LIBCRC32C is not set 919# CONFIG_LIBCRC32C is not set
836 920
@@ -842,8 +926,10 @@ CONFIG_CRC32=y
842# 926#
843# Kernel hacking 927# Kernel hacking
844# 928#
845# CONFIG_DEBUG_KERNEL is not set
846# CONFIG_PRINTK_TIME is not set 929# CONFIG_PRINTK_TIME is not set
930# CONFIG_DEBUG_KERNEL is not set
931CONFIG_LOG_BUF_SHIFT=14
932# CONFIG_SERIAL_TEXT_DEBUG is not set
847 933
848# 934#
849# Security options 935# Security options
diff --git a/arch/ppc/configs/mcpn765_defconfig b/arch/ppc/configs/mcpn765_defconfig
deleted file mode 100644
index 899e89a9ea6a..000000000000
--- a/arch/ppc/configs/mcpn765_defconfig
+++ /dev/null
@@ -1,579 +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#
14# CONFIG_EXPERIMENTAL is not set
15CONFIG_CLEAN_COMPILE=y
16CONFIG_STANDALONE=y
17CONFIG_BROKEN_ON_SMP=y
18
19#
20# General setup
21#
22# CONFIG_SWAP is not set
23CONFIG_SYSVIPC=y
24# CONFIG_BSD_PROCESS_ACCT is not set
25CONFIG_SYSCTL=y
26CONFIG_LOG_BUF_SHIFT=14
27# CONFIG_HOTPLUG is not set
28# CONFIG_IKCONFIG is not set
29CONFIG_EMBEDDED=y
30CONFIG_KALLSYMS=y
31CONFIG_FUTEX=y
32CONFIG_EPOLL=y
33CONFIG_IOSCHED_NOOP=y
34CONFIG_IOSCHED_AS=y
35CONFIG_IOSCHED_DEADLINE=y
36# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
37
38#
39# Loadable module support
40#
41CONFIG_MODULES=y
42# CONFIG_MODULE_UNLOAD is not set
43CONFIG_OBSOLETE_MODPARM=y
44# CONFIG_KMOD is not set
45
46#
47# Processor
48#
49CONFIG_6xx=y
50# CONFIG_40x is not set
51# CONFIG_44x is not set
52# CONFIG_POWER3 is not set
53# CONFIG_POWER4 is not set
54# CONFIG_8xx is not set
55CONFIG_ALTIVEC=y
56# CONFIG_TAU is not set
57# CONFIG_CPU_FREQ is not set
58CONFIG_PPC_STD_MMU=y
59
60#
61# Platform options
62#
63# CONFIG_PPC_MULTIPLATFORM is not set
64# CONFIG_APUS is not set
65# CONFIG_WILLOW is not set
66# CONFIG_PCORE is not set
67# CONFIG_POWERPMC250 is not set
68# CONFIG_EV64260 is not set
69# CONFIG_SPRUCE is not set
70# CONFIG_LOPEC is not set
71CONFIG_MCPN765=y
72# CONFIG_MVME5100 is not set
73# CONFIG_PPLUS is not set
74# CONFIG_PRPMC750 is not set
75# CONFIG_PRPMC800 is not set
76# CONFIG_SANDPOINT is not set
77# CONFIG_ADIR is not set
78# CONFIG_K2 is not set
79# CONFIG_PAL4 is not set
80# CONFIG_GEMINI is not set
81# CONFIG_EST8260 is not set
82# CONFIG_SBS8260 is not set
83# CONFIG_RPX6 is not set
84# CONFIG_TQM8260 is not set
85CONFIG_PPC_GEN550=y
86# CONFIG_SMP is not set
87# CONFIG_PREEMPT is not set
88CONFIG_HIGHMEM=y
89CONFIG_KERNEL_ELF=y
90CONFIG_BINFMT_ELF=y
91# CONFIG_BINFMT_MISC is not set
92CONFIG_CMDLINE_BOOL=y
93CONFIG_CMDLINE="ip=on"
94
95#
96# Bus options
97#
98CONFIG_GENERIC_ISA_DMA=y
99CONFIG_PCI=y
100CONFIG_PCI_DOMAINS=y
101# CONFIG_PCI_LEGACY_PROC is not set
102# CONFIG_PCI_NAMES is not set
103
104#
105# Advanced setup
106#
107# CONFIG_ADVANCED_OPTIONS is not set
108
109#
110# Default settings for advanced configuration options are used
111#
112CONFIG_HIGHMEM_START=0xfe000000
113CONFIG_LOWMEM_SIZE=0x30000000
114CONFIG_KERNEL_START=0xc0000000
115CONFIG_TASK_SIZE=0x80000000
116CONFIG_BOOT_LOAD=0x00800000
117
118#
119# Device Drivers
120#
121
122#
123# Generic Driver Options
124#
125
126#
127# Memory Technology Devices (MTD)
128#
129# CONFIG_MTD is not set
130
131#
132# Parallel port support
133#
134# CONFIG_PARPORT is not set
135
136#
137# Plug and Play support
138#
139
140#
141# Block devices
142#
143# CONFIG_BLK_DEV_FD is not set
144# CONFIG_BLK_CPQ_DA is not set
145# CONFIG_BLK_CPQ_CISS_DA is not set
146# CONFIG_BLK_DEV_DAC960 is not set
147CONFIG_BLK_DEV_LOOP=y
148# CONFIG_BLK_DEV_CRYPTOLOOP is not set
149# CONFIG_BLK_DEV_NBD is not set
150# CONFIG_BLK_DEV_CARMEL is not set
151CONFIG_BLK_DEV_RAM=y
152CONFIG_BLK_DEV_RAM_SIZE=4096
153CONFIG_BLK_DEV_INITRD=y
154# CONFIG_LBD is not set
155
156#
157# ATA/ATAPI/MFM/RLL support
158#
159CONFIG_IDE=y
160CONFIG_BLK_DEV_IDE=y
161
162#
163# Please see Documentation/ide.txt for help/info on IDE drives
164#
165CONFIG_BLK_DEV_IDEDISK=y
166# CONFIG_IDEDISK_MULTI_MODE is not set
167# CONFIG_IDEDISK_STROKE is not set
168# CONFIG_BLK_DEV_IDECD is not set
169# CONFIG_BLK_DEV_IDEFLOPPY is not set
170# CONFIG_IDE_TASK_IOCTL is not set
171
172#
173# IDE chipset support/bugfixes
174#
175# CONFIG_IDE_GENERIC is not set
176CONFIG_BLK_DEV_IDEPCI=y
177# CONFIG_IDEPCI_SHARE_IRQ is not set
178# CONFIG_BLK_DEV_OFFBOARD is not set
179# CONFIG_BLK_DEV_GENERIC is not set
180# CONFIG_BLK_DEV_SL82C105 is not set
181CONFIG_BLK_DEV_IDEDMA_PCI=y
182# CONFIG_BLK_DEV_IDEDMA_FORCED is not set
183# CONFIG_IDEDMA_PCI_AUTO is not set
184CONFIG_BLK_DEV_ADMA=y
185# CONFIG_BLK_DEV_AEC62XX is not set
186# CONFIG_BLK_DEV_ALI15X3 is not set
187# CONFIG_BLK_DEV_AMD74XX is not set
188# CONFIG_BLK_DEV_CMD64X is not set
189# CONFIG_BLK_DEV_TRIFLEX is not set
190# CONFIG_BLK_DEV_CY82C693 is not set
191# CONFIG_BLK_DEV_CS5530 is not set
192# CONFIG_BLK_DEV_HPT34X is not set
193# CONFIG_BLK_DEV_HPT366 is not set
194# CONFIG_BLK_DEV_SC1200 is not set
195# CONFIG_BLK_DEV_PIIX is not set
196# CONFIG_BLK_DEV_NS87415 is not set
197# CONFIG_BLK_DEV_PDC202XX_OLD is not set
198# CONFIG_BLK_DEV_PDC202XX_NEW is not set
199# CONFIG_BLK_DEV_SVWKS is not set
200# CONFIG_BLK_DEV_SIIMAGE is not set
201# CONFIG_BLK_DEV_SLC90E66 is not set
202# CONFIG_BLK_DEV_TRM290 is not set
203CONFIG_BLK_DEV_VIA82CXXX=y
204CONFIG_BLK_DEV_IDEDMA=y
205# CONFIG_IDEDMA_IVB is not set
206# CONFIG_IDEDMA_AUTO is not set
207# CONFIG_BLK_DEV_HD is not set
208
209#
210# SCSI device support
211#
212# CONFIG_SCSI is not set
213
214#
215# Multi-device support (RAID and LVM)
216#
217# CONFIG_MD is not set
218
219#
220# Fusion MPT device support
221#
222# CONFIG_FUSION is not set
223
224#
225# IEEE 1394 (FireWire) support
226#
227# CONFIG_IEEE1394 is not set
228
229#
230# I2O device support
231#
232# CONFIG_I2O is not set
233
234#
235# Macintosh device drivers
236#
237
238#
239# Networking support
240#
241CONFIG_NET=y
242
243#
244# Networking options
245#
246CONFIG_PACKET=y
247# CONFIG_PACKET_MMAP is not set
248# CONFIG_NETLINK_DEV is not set
249CONFIG_UNIX=y
250# CONFIG_NET_KEY is not set
251CONFIG_INET=y
252# CONFIG_IP_MULTICAST is not set
253# CONFIG_IP_ADVANCED_ROUTER is not set
254CONFIG_IP_PNP=y
255CONFIG_IP_PNP_DHCP=y
256# CONFIG_IP_PNP_BOOTP is not set
257# CONFIG_IP_PNP_RARP is not set
258# CONFIG_NET_IPIP is not set
259# CONFIG_NET_IPGRE is not set
260# CONFIG_SYN_COOKIES is not set
261# CONFIG_INET_AH is not set
262# CONFIG_INET_ESP is not set
263# CONFIG_INET_IPCOMP is not set
264# CONFIG_DECNET is not set
265# CONFIG_BRIDGE is not set
266# CONFIG_NETFILTER is not set
267# CONFIG_VLAN_8021Q is not set
268# CONFIG_LLC2 is not set
269# CONFIG_IPX is not set
270# CONFIG_ATALK is not set
271
272#
273# QoS and/or fair queueing
274#
275# CONFIG_NET_SCHED is not set
276
277#
278# Network testing
279#
280# CONFIG_NET_PKTGEN is not set
281CONFIG_NETDEVICES=y
282
283#
284# ARCnet devices
285#
286# CONFIG_ARCNET is not set
287# CONFIG_DUMMY is not set
288# CONFIG_BONDING is not set
289# CONFIG_EQUALIZER is not set
290# CONFIG_TUN is not set
291
292#
293# Ethernet (10 or 100Mbit)
294#
295CONFIG_NET_ETHERNET=y
296CONFIG_MII=y
297# CONFIG_OAKNET is not set
298# CONFIG_HAPPYMEAL is not set
299# CONFIG_SUNGEM is not set
300# CONFIG_NET_VENDOR_3COM is not set
301
302#
303# Tulip family network device support
304#
305CONFIG_NET_TULIP=y
306CONFIG_TULIP=y
307# CONFIG_TULIP_MMIO is not set
308# CONFIG_TULIP_NAPI is not set
309# CONFIG_DE4X5 is not set
310# CONFIG_WINBOND_840 is not set
311# CONFIG_DM9102 is not set
312# CONFIG_HP100 is not set
313# CONFIG_NET_PCI is not set
314
315#
316# Ethernet (1000 Mbit)
317#
318# CONFIG_ACENIC is not set
319# CONFIG_DL2K is not set
320# CONFIG_E1000 is not set
321# CONFIG_NS83820 is not set
322# CONFIG_HAMACHI is not set
323# CONFIG_R8169 is not set
324# CONFIG_SK98LIN is not set
325# CONFIG_TIGON3 is not set
326
327#
328# Ethernet (10000 Mbit)
329#
330# CONFIG_IXGB is not set
331# CONFIG_FDDI is not set
332# CONFIG_PPP is not set
333# CONFIG_SLIP is not set
334
335#
336# Wireless LAN (non-hamradio)
337#
338# CONFIG_NET_RADIO is not set
339
340#
341# Token Ring devices
342#
343# CONFIG_TR is not set
344
345#
346# Wan interfaces
347#
348# CONFIG_WAN is not set
349
350#
351# Amateur Radio support
352#
353# CONFIG_HAMRADIO is not set
354
355#
356# IrDA (infrared) support
357#
358# CONFIG_IRDA is not set
359
360#
361# Bluetooth support
362#
363# CONFIG_BT is not set
364# CONFIG_NETPOLL is not set
365# CONFIG_NET_POLL_CONTROLLER is not set
366
367#
368# ISDN subsystem
369#
370# CONFIG_ISDN is not set
371
372#
373# Telephony Support
374#
375# CONFIG_PHONE is not set
376
377#
378# Input device support
379#
380# CONFIG_INPUT is not set
381
382#
383# Userland interfaces
384#
385
386#
387# Input I/O drivers
388#
389# CONFIG_GAMEPORT is not set
390CONFIG_SOUND_GAMEPORT=y
391# CONFIG_SERIO is not set
392# CONFIG_SERIO_I8042 is not set
393
394#
395# Input Device Drivers
396#
397
398#
399# Character devices
400#
401# CONFIG_VT is not set
402# CONFIG_SERIAL_NONSTANDARD is not set
403
404#
405# Serial drivers
406#
407CONFIG_SERIAL_8250=y
408CONFIG_SERIAL_8250_CONSOLE=y
409CONFIG_SERIAL_8250_NR_UARTS=4
410# CONFIG_SERIAL_8250_EXTENDED is not set
411
412#
413# Non-8250 serial port support
414#
415CONFIG_SERIAL_CORE=y
416CONFIG_SERIAL_CORE_CONSOLE=y
417CONFIG_UNIX98_PTYS=y
418CONFIG_LEGACY_PTYS=y
419CONFIG_LEGACY_PTY_COUNT=256
420# CONFIG_QIC02_TAPE is not set
421
422#
423# IPMI
424#
425# CONFIG_IPMI_HANDLER is not set
426
427#
428# Watchdog Cards
429#
430# CONFIG_WATCHDOG is not set
431# CONFIG_NVRAM is not set
432CONFIG_GEN_RTC=y
433# CONFIG_GEN_RTC_X is not set
434# CONFIG_DTLK is not set
435# CONFIG_R3964 is not set
436# CONFIG_APPLICOM is not set
437
438#
439# Ftape, the floppy tape device driver
440#
441# CONFIG_FTAPE is not set
442# CONFIG_AGP is not set
443# CONFIG_DRM is not set
444# CONFIG_RAW_DRIVER is not set
445
446#
447# I2C support
448#
449# CONFIG_I2C is not set
450
451#
452# Misc devices
453#
454
455#
456# Multimedia devices
457#
458# CONFIG_VIDEO_DEV is not set
459
460#
461# Digital Video Broadcasting Devices
462#
463# CONFIG_DVB is not set
464
465#
466# Graphics support
467#
468# CONFIG_FB is not set
469
470#
471# Sound
472#
473# CONFIG_SOUND is not set
474
475#
476# USB support
477#
478# CONFIG_USB is not set
479
480#
481# USB Gadget Support
482#
483# CONFIG_USB_GADGET is not set
484
485#
486# File systems
487#
488CONFIG_EXT2_FS=y
489# CONFIG_EXT2_FS_XATTR is not set
490# CONFIG_EXT3_FS is not set
491# CONFIG_JBD is not set
492# CONFIG_REISERFS_FS is not set
493# CONFIG_JFS_FS is not set
494# CONFIG_XFS_FS is not set
495# CONFIG_MINIX_FS is not set
496# CONFIG_ROMFS_FS is not set
497# CONFIG_QUOTA is not set
498# CONFIG_AUTOFS_FS is not set
499# CONFIG_AUTOFS4_FS is not set
500
501#
502# CD-ROM/DVD Filesystems
503#
504# CONFIG_ISO9660_FS is not set
505# CONFIG_UDF_FS is not set
506
507#
508# DOS/FAT/NT Filesystems
509#
510# CONFIG_FAT_FS is not set
511# CONFIG_NTFS_FS is not set
512
513#
514# Pseudo filesystems
515#
516CONFIG_PROC_FS=y
517CONFIG_PROC_KCORE=y
518# CONFIG_DEVPTS_FS_XATTR is not set
519CONFIG_TMPFS=y
520# CONFIG_HUGETLB_PAGE is not set
521CONFIG_RAMFS=y
522
523#
524# Miscellaneous filesystems
525#
526# CONFIG_HFSPLUS_FS is not set
527# CONFIG_CRAMFS is not set
528# CONFIG_VXFS_FS is not set
529# CONFIG_HPFS_FS is not set
530# CONFIG_QNX4FS_FS is not set
531# CONFIG_SYSV_FS is not set
532# CONFIG_UFS_FS is not set
533
534#
535# Network File Systems
536#
537CONFIG_NFS_FS=y
538# CONFIG_NFS_V3 is not set
539# CONFIG_NFSD is not set
540CONFIG_ROOT_NFS=y
541CONFIG_LOCKD=y
542# CONFIG_EXPORTFS is not set
543CONFIG_SUNRPC=y
544# CONFIG_SMB_FS is not set
545# CONFIG_CIFS is not set
546# CONFIG_NCP_FS is not set
547# CONFIG_CODA_FS is not set
548
549#
550# Partition Types
551#
552# CONFIG_PARTITION_ADVANCED is not set
553CONFIG_MSDOS_PARTITION=y
554
555#
556# Native Language Support
557#
558# CONFIG_NLS is not set
559
560#
561# Library routines
562#
563CONFIG_CRC32=y
564
565#
566# Kernel hacking
567#
568# CONFIG_DEBUG_KERNEL is not set
569# CONFIG_SERIAL_TEXT_DEBUG is not set
570
571#
572# Security options
573#
574# CONFIG_SECURITY is not set
575
576#
577# Cryptographic options
578#
579# CONFIG_CRYPTO is not set
diff --git a/arch/ppc/configs/menf1_defconfig b/arch/ppc/configs/menf1_defconfig
deleted file mode 100644
index 321659b5505f..000000000000
--- a/arch/ppc/configs/menf1_defconfig
+++ /dev/null
@@ -1,621 +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
7
8#
9# Code maturity level options
10#
11CONFIG_EXPERIMENTAL=y
12
13#
14# General setup
15#
16CONFIG_SWAP=y
17CONFIG_SYSVIPC=y
18# CONFIG_BSD_PROCESS_ACCT is not set
19CONFIG_SYSCTL=y
20CONFIG_LOG_BUF_SHIFT=14
21# CONFIG_EMBEDDED is not set
22CONFIG_FUTEX=y
23CONFIG_EPOLL=y
24
25#
26# Loadable module support
27#
28CONFIG_MODULES=y
29CONFIG_MODULE_UNLOAD=y
30# CONFIG_MODULE_FORCE_UNLOAD is not set
31CONFIG_OBSOLETE_MODPARM=y
32# CONFIG_MODVERSIONS is not set
33CONFIG_KMOD=y
34
35#
36# Platform support
37#
38CONFIG_PPC=y
39CONFIG_PPC32=y
40CONFIG_6xx=y
41# CONFIG_40x is not set
42# CONFIG_POWER3 is not set
43# CONFIG_8xx is not set
44
45#
46# IBM 4xx options
47#
48# CONFIG_8260 is not set
49CONFIG_GENERIC_ISA_DMA=y
50CONFIG_PPC_STD_MMU=y
51# CONFIG_PPC_MULTIPLATFORM is not set
52# CONFIG_APUS is not set
53# CONFIG_WILLOW_2 is not set
54# CONFIG_PCORE is not set
55# CONFIG_POWERPMC250 is not set
56# CONFIG_EV64260 is not set
57# CONFIG_SPRUCE is not set
58CONFIG_MENF1=y
59# CONFIG_LOPEC is not set
60# CONFIG_MCPN765 is not set
61# CONFIG_MVME5100 is not set
62# CONFIG_PPLUS is not set
63# CONFIG_PRPMC750 is not set
64# CONFIG_PRPMC800 is not set
65# CONFIG_SANDPOINT is not set
66# CONFIG_ADIR is not set
67# CONFIG_K2 is not set
68# CONFIG_PAL4 is not set
69# CONFIG_GEMINI is not set
70CONFIG_MPC10X_STORE_GATHERING=y
71# CONFIG_SMP is not set
72# CONFIG_PREEMPT is not set
73# CONFIG_ALTIVEC is not set
74# CONFIG_TAU is not set
75# CONFIG_CPU_FREQ is not set
76
77#
78# General setup
79#
80# CONFIG_HIGHMEM is not set
81CONFIG_PCI=y
82CONFIG_PCI_DOMAINS=y
83CONFIG_KCORE_ELF=y
84CONFIG_BINFMT_ELF=y
85CONFIG_KERNEL_ELF=y
86# CONFIG_BINFMT_MISC is not set
87# CONFIG_PCI_LEGACY_PROC is not set
88# CONFIG_PCI_NAMES is not set
89# CONFIG_HOTPLUG is not set
90
91#
92# Parallel port support
93#
94# CONFIG_PARPORT is not set
95# CONFIG_PPC601_SYNC_FIX is not set
96CONFIG_CMDLINE_BOOL=y
97CONFIG_CMDLINE="ip=on"
98
99#
100# Advanced setup
101#
102# CONFIG_ADVANCED_OPTIONS is not set
103
104#
105# Default settings for advanced configuration options are used
106#
107CONFIG_HIGHMEM_START=0xfe000000
108CONFIG_LOWMEM_SIZE=0x30000000
109CONFIG_KERNEL_START=0xc0000000
110CONFIG_TASK_SIZE=0x80000000
111CONFIG_BOOT_LOAD=0x00800000
112
113#
114# Memory Technology Devices (MTD)
115#
116# CONFIG_MTD is not set
117
118#
119# Plug and Play support
120#
121# CONFIG_PNP is not set
122
123#
124# Block devices
125#
126# CONFIG_BLK_DEV_FD is not set
127# CONFIG_BLK_CPQ_DA is not set
128# CONFIG_BLK_CPQ_CISS_DA is not set
129# CONFIG_BLK_DEV_DAC960 is not set
130# CONFIG_BLK_DEV_UMEM is not set
131# CONFIG_BLK_DEV_LOOP is not set
132# CONFIG_BLK_DEV_NBD is not set
133# CONFIG_BLK_DEV_RAM is not set
134# CONFIG_BLK_DEV_INITRD is not set
135
136#
137# Multi-device support (RAID and LVM)
138#
139# CONFIG_MD is not set
140
141#
142# ATA/IDE/MFM/RLL support
143#
144CONFIG_IDE=y
145
146#
147# IDE, ATA and ATAPI Block devices
148#
149CONFIG_BLK_DEV_IDE=y
150
151#
152# Please see Documentation/ide.txt for help/info on IDE drives
153#
154# CONFIG_BLK_DEV_HD is not set
155CONFIG_BLK_DEV_IDEDISK=y
156# CONFIG_IDEDISK_MULTI_MODE is not set
157# CONFIG_IDEDISK_STROKE is not set
158CONFIG_BLK_DEV_IDECD=y
159# CONFIG_BLK_DEV_IDEFLOPPY is not set
160# CONFIG_IDE_TASK_IOCTL is not set
161
162#
163# IDE chipset support/bugfixes
164#
165# CONFIG_BLK_DEV_IDEPCI is not set
166
167#
168# SCSI support
169#
170# CONFIG_SCSI is not set
171
172#
173# Fusion MPT device support
174#
175
176#
177# IEEE 1394 (FireWire) support (EXPERIMENTAL)
178#
179# CONFIG_IEEE1394 is not set
180
181#
182# I2O device support
183#
184# CONFIG_I2O is not set
185
186#
187# Networking support
188#
189CONFIG_NET=y
190
191#
192# Networking options
193#
194CONFIG_PACKET=y
195# CONFIG_PACKET_MMAP is not set
196# CONFIG_NETLINK_DEV is not set
197CONFIG_NETFILTER=y
198# CONFIG_NETFILTER_DEBUG is not set
199CONFIG_UNIX=y
200# CONFIG_NET_KEY is not set
201CONFIG_INET=y
202CONFIG_IP_MULTICAST=y
203# CONFIG_IP_ADVANCED_ROUTER is not set
204CONFIG_IP_PNP=y
205CONFIG_IP_PNP_DHCP=y
206# CONFIG_IP_PNP_BOOTP is not set
207# CONFIG_IP_PNP_RARP is not set
208# CONFIG_NET_IPIP is not set
209# CONFIG_NET_IPGRE is not set
210# CONFIG_IP_MROUTE is not set
211# CONFIG_ARPD is not set
212# CONFIG_INET_ECN is not set
213# CONFIG_SYN_COOKIES is not set
214# CONFIG_INET_AH is not set
215# CONFIG_INET_ESP is not set
216# CONFIG_INET_IPCOMP is not set
217
218#
219# IP: Netfilter Configuration
220#
221CONFIG_IP_NF_CONNTRACK=m
222CONFIG_IP_NF_FTP=m
223CONFIG_IP_NF_IRC=m
224# CONFIG_IP_NF_TFTP is not set
225# CONFIG_IP_NF_AMANDA is not set
226# CONFIG_IP_NF_QUEUE is not set
227CONFIG_IP_NF_IPTABLES=m
228CONFIG_IP_NF_MATCH_LIMIT=m
229CONFIG_IP_NF_MATCH_MAC=m
230CONFIG_IP_NF_MATCH_PKTTYPE=m
231CONFIG_IP_NF_MATCH_MARK=m
232CONFIG_IP_NF_MATCH_MULTIPORT=m
233CONFIG_IP_NF_MATCH_TOS=m
234CONFIG_IP_NF_MATCH_ECN=m
235CONFIG_IP_NF_MATCH_DSCP=m
236CONFIG_IP_NF_MATCH_AH_ESP=m
237CONFIG_IP_NF_MATCH_LENGTH=m
238CONFIG_IP_NF_MATCH_TTL=m
239CONFIG_IP_NF_MATCH_TCPMSS=m
240CONFIG_IP_NF_MATCH_HELPER=m
241CONFIG_IP_NF_MATCH_STATE=m
242CONFIG_IP_NF_MATCH_CONNTRACK=m
243CONFIG_IP_NF_MATCH_UNCLEAN=m
244CONFIG_IP_NF_MATCH_OWNER=m
245CONFIG_IP_NF_FILTER=m
246CONFIG_IP_NF_TARGET_REJECT=m
247CONFIG_IP_NF_TARGET_MIRROR=m
248CONFIG_IP_NF_NAT=m
249CONFIG_IP_NF_NAT_NEEDED=y
250CONFIG_IP_NF_TARGET_MASQUERADE=m
251CONFIG_IP_NF_TARGET_REDIRECT=m
252# CONFIG_IP_NF_NAT_SNMP_BASIC is not set
253CONFIG_IP_NF_NAT_IRC=m
254CONFIG_IP_NF_NAT_FTP=m
255# CONFIG_IP_NF_MANGLE is not set
256# CONFIG_IP_NF_TARGET_LOG is not set
257CONFIG_IP_NF_TARGET_ULOG=m
258CONFIG_IP_NF_TARGET_TCPMSS=m
259CONFIG_IP_NF_ARPTABLES=m
260CONFIG_IP_NF_ARPFILTER=m
261CONFIG_IP_NF_COMPAT_IPCHAINS=m
262# CONFIG_IP_NF_COMPAT_IPFWADM is not set
263# CONFIG_IPV6 is not set
264# CONFIG_XFRM_USER is not set
265
266#
267# SCTP Configuration (EXPERIMENTAL)
268#
269CONFIG_IPV6_SCTP__=y
270# CONFIG_IP_SCTP is not set
271# CONFIG_ATM is not set
272# CONFIG_VLAN_8021Q is not set
273# CONFIG_LLC is not set
274# CONFIG_DECNET is not set
275# CONFIG_BRIDGE is not set
276# CONFIG_X25 is not set
277# CONFIG_LAPB is not set
278# CONFIG_NET_DIVERT is not set
279# CONFIG_ECONET is not set
280# CONFIG_WAN_ROUTER is not set
281# CONFIG_NET_HW_FLOWCONTROL is not set
282
283#
284# QoS and/or fair queueing
285#
286# CONFIG_NET_SCHED is not set
287
288#
289# Network testing
290#
291# CONFIG_NET_PKTGEN is not set
292CONFIG_NETDEVICES=y
293
294#
295# ARCnet devices
296#
297# CONFIG_ARCNET is not set
298# CONFIG_DUMMY is not set
299# CONFIG_BONDING is not set
300# CONFIG_EQUALIZER is not set
301# CONFIG_TUN is not set
302# CONFIG_ETHERTAP is not set
303
304#
305# Ethernet (10 or 100Mbit)
306#
307CONFIG_NET_ETHERNET=y
308CONFIG_MII=y
309# CONFIG_OAKNET is not set
310# CONFIG_HAPPYMEAL is not set
311# CONFIG_SUNGEM is not set
312# CONFIG_NET_VENDOR_3COM is not set
313
314#
315# Tulip family network device support
316#
317# CONFIG_NET_TULIP is not set
318# CONFIG_HP100 is not set
319CONFIG_NET_PCI=y
320# CONFIG_PCNET32 is not set
321# CONFIG_AMD8111_ETH is not set
322# CONFIG_ADAPTEC_STARFIRE is not set
323# CONFIG_B44 is not set
324# CONFIG_DGRS is not set
325# CONFIG_EEPRO100 is not set
326# CONFIG_E100 is not set
327# CONFIG_FEALNX is not set
328# CONFIG_NATSEMI is not set
329# CONFIG_NE2K_PCI is not set
330# CONFIG_8139CP is not set
331# CONFIG_8139TOO is not set
332# CONFIG_SIS900 is not set
333# CONFIG_EPIC100 is not set
334# CONFIG_SUNDANCE is not set
335# CONFIG_TLAN is not set
336# CONFIG_VIA_RHINE is not set
337
338#
339# Ethernet (1000 Mbit)
340#
341# CONFIG_ACENIC is not set
342# CONFIG_DL2K is not set
343# CONFIG_E1000 is not set
344# CONFIG_NS83820 is not set
345# CONFIG_HAMACHI is not set
346# CONFIG_YELLOWFIN is not set
347# CONFIG_R8169 is not set
348# CONFIG_SK98LIN is not set
349# CONFIG_TIGON3 is not set
350
351#
352# Ethernet (10000 Mbit)
353#
354# CONFIG_IXGB is not set
355# CONFIG_FDDI is not set
356# CONFIG_HIPPI is not set
357# CONFIG_PPP is not set
358# CONFIG_SLIP is not set
359
360#
361# Wireless LAN (non-hamradio)
362#
363# CONFIG_NET_RADIO is not set
364
365#
366# Token Ring devices (depends on LLC=y)
367#
368# CONFIG_RCPCI is not set
369# CONFIG_SHAPER is not set
370
371#
372# Wan interfaces
373#
374# CONFIG_WAN is not set
375
376#
377# Amateur Radio support
378#
379# CONFIG_HAMRADIO is not set
380
381#
382# IrDA (infrared) support
383#
384# CONFIG_IRDA is not set
385
386#
387# ISDN subsystem
388#
389# CONFIG_ISDN_BOOL is not set
390
391#
392# Graphics support
393#
394# CONFIG_FB is not set
395
396#
397# Old CD-ROM drivers (not SCSI, not IDE)
398#
399# CONFIG_CD_NO_IDESCSI is not set
400
401#
402# Input device support
403#
404# CONFIG_INPUT is not set
405
406#
407# Userland interfaces
408#
409
410#
411# Input I/O drivers
412#
413# CONFIG_GAMEPORT is not set
414CONFIG_SOUND_GAMEPORT=y
415# CONFIG_SERIO is not set
416
417#
418# Input Device Drivers
419#
420
421#
422# Macintosh device drivers
423#
424
425#
426# Character devices
427#
428# CONFIG_SERIAL_NONSTANDARD is not set
429
430#
431# Serial drivers
432#
433CONFIG_SERIAL_8250=y
434CONFIG_SERIAL_8250_CONSOLE=y
435# CONFIG_SERIAL_8250_EXTENDED is not set
436
437#
438# Non-8250 serial port support
439#
440CONFIG_SERIAL_CORE=y
441CONFIG_SERIAL_CORE_CONSOLE=y
442CONFIG_UNIX98_PTYS=y
443CONFIG_UNIX98_PTY_COUNT=256
444
445#
446# I2C support
447#
448# CONFIG_I2C is not set
449
450#
451# I2C Hardware Sensors Mainboard support
452#
453
454#
455# I2C Hardware Sensors Chip support
456#
457# CONFIG_I2C_SENSOR is not set
458
459#
460# Mice
461#
462# CONFIG_BUSMOUSE is not set
463# CONFIG_QIC02_TAPE is not set
464
465#
466# IPMI
467#
468# CONFIG_IPMI_HANDLER is not set
469
470#
471# Watchdog Cards
472#
473# CONFIG_WATCHDOG is not set
474# CONFIG_NVRAM is not set
475CONFIG_GEN_RTC=y
476# CONFIG_GEN_RTC_X is not set
477# CONFIG_DTLK is not set
478# CONFIG_R3964 is not set
479# CONFIG_APPLICOM is not set
480
481#
482# Ftape, the floppy tape device driver
483#
484# CONFIG_FTAPE is not set
485# CONFIG_AGP is not set
486# CONFIG_DRM is not set
487# CONFIG_RAW_DRIVER is not set
488# CONFIG_HANGCHECK_TIMER is not set
489
490#
491# Multimedia devices
492#
493# CONFIG_VIDEO_DEV is not set
494
495#
496# Digital Video Broadcasting Devices
497#
498# CONFIG_DVB is not set
499
500#
501# File systems
502#
503CONFIG_EXT2_FS=y
504# CONFIG_EXT2_FS_XATTR is not set
505CONFIG_EXT3_FS=y
506CONFIG_EXT3_FS_XATTR=y
507# CONFIG_EXT3_FS_POSIX_ACL is not set
508# CONFIG_EXT3_FS_SECURITY is not set
509CONFIG_JBD=y
510# CONFIG_JBD_DEBUG is not set
511CONFIG_FS_MBCACHE=y
512# CONFIG_REISERFS_FS is not set
513# CONFIG_JFS_FS is not set
514# CONFIG_XFS_FS is not set
515# CONFIG_MINIX_FS is not set
516# CONFIG_ROMFS_FS is not set
517# CONFIG_QUOTA is not set
518# CONFIG_AUTOFS_FS is not set
519# CONFIG_AUTOFS4_FS is not set
520
521#
522# CD-ROM/DVD Filesystems
523#
524CONFIG_ISO9660_FS=y
525# CONFIG_JOLIET is not set
526# CONFIG_ZISOFS is not set
527# CONFIG_UDF_FS is not set
528
529#
530# DOS/FAT/NT Filesystems
531#
532# CONFIG_FAT_FS is not set
533# CONFIG_NTFS_FS is not set
534
535#
536# Pseudo filesystems
537#
538CONFIG_PROC_FS=y
539# CONFIG_DEVFS_FS is not set
540CONFIG_DEVPTS_FS=y
541# CONFIG_DEVPTS_FS_XATTR is not set
542CONFIG_TMPFS=y
543CONFIG_RAMFS=y
544
545#
546# Miscellaneous filesystems
547#
548# CONFIG_ADFS_FS is not set
549# CONFIG_AFFS_FS is not set
550# CONFIG_HFS_FS is not set
551# CONFIG_BEFS_FS is not set
552# CONFIG_BFS_FS is not set
553# CONFIG_EFS_FS is not set
554# CONFIG_CRAMFS is not set
555# CONFIG_VXFS_FS is not set
556# CONFIG_HPFS_FS is not set
557# CONFIG_QNX4FS_FS is not set
558# CONFIG_SYSV_FS is not set
559# CONFIG_UFS_FS is not set
560
561#
562# Network File Systems
563#
564CONFIG_NFS_FS=y
565# CONFIG_NFS_V3 is not set
566# CONFIG_NFS_V4 is not set
567# CONFIG_NFSD is not set
568CONFIG_ROOT_NFS=y
569CONFIG_LOCKD=y
570# CONFIG_EXPORTFS is not set
571CONFIG_SUNRPC=y
572# CONFIG_SUNRPC_GSS is not set
573# CONFIG_SMB_FS is not set
574# CONFIG_CIFS is not set
575# CONFIG_NCP_FS is not set
576# CONFIG_CODA_FS is not set
577# CONFIG_INTERMEZZO_FS is not set
578# CONFIG_AFS_FS is not set
579
580#
581# Partition Types
582#
583# CONFIG_PARTITION_ADVANCED is not set
584CONFIG_MSDOS_PARTITION=y
585
586#
587# Sound
588#
589# CONFIG_SOUND is not set
590
591#
592# USB support
593#
594# CONFIG_USB is not set
595# CONFIG_USB_GADGET is not set
596
597#
598# Bluetooth support
599#
600# CONFIG_BT is not set
601
602#
603# Library routines
604#
605# CONFIG_CRC32 is not set
606
607#
608# Kernel hacking
609#
610# CONFIG_DEBUG_KERNEL is not set
611# CONFIG_KALLSYMS is not set
612
613#
614# Security options
615#
616# CONFIG_SECURITY is not set
617
618#
619# Cryptographic options
620#
621# CONFIG_CRYPTO is not set
diff --git a/arch/ppc/configs/mpc8560_ads_defconfig b/arch/ppc/configs/mpc8560_ads_defconfig
index 38a343c9056a..f834fb541ad5 100644
--- a/arch/ppc/configs/mpc8560_ads_defconfig
+++ b/arch/ppc/configs/mpc8560_ads_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.11-rc1 3# Linux kernel version: 2.6.13-rc6
4# Thu Jan 20 01:24:56 2005 4# Thu Aug 11 18:14:45 2005
5# 5#
6CONFIG_MMU=y 6CONFIG_MMU=y
7CONFIG_GENERIC_HARDIRQS=y 7CONFIG_GENERIC_HARDIRQS=y
@@ -11,6 +11,7 @@ CONFIG_HAVE_DEC_LOCK=y
11CONFIG_PPC=y 11CONFIG_PPC=y
12CONFIG_PPC32=y 12CONFIG_PPC32=y
13CONFIG_GENERIC_NVRAM=y 13CONFIG_GENERIC_NVRAM=y
14CONFIG_SCHED_NO_NO_OMIT_FRAME_POINTER=y
14 15
15# 16#
16# Code maturity level options 17# Code maturity level options
@@ -18,6 +19,7 @@ CONFIG_GENERIC_NVRAM=y
18CONFIG_EXPERIMENTAL=y 19CONFIG_EXPERIMENTAL=y
19CONFIG_CLEAN_COMPILE=y 20CONFIG_CLEAN_COMPILE=y
20CONFIG_BROKEN_ON_SMP=y 21CONFIG_BROKEN_ON_SMP=y
22CONFIG_INIT_ENV_ARG_LIMIT=32
21 23
22# 24#
23# General setup 25# General setup
@@ -29,12 +31,14 @@ CONFIG_SYSVIPC=y
29# CONFIG_BSD_PROCESS_ACCT is not set 31# CONFIG_BSD_PROCESS_ACCT is not set
30CONFIG_SYSCTL=y 32CONFIG_SYSCTL=y
31# CONFIG_AUDIT is not set 33# CONFIG_AUDIT is not set
32CONFIG_LOG_BUF_SHIFT=14
33# CONFIG_HOTPLUG is not set 34# CONFIG_HOTPLUG is not set
34CONFIG_KOBJECT_UEVENT=y 35CONFIG_KOBJECT_UEVENT=y
35# CONFIG_IKCONFIG is not set 36# CONFIG_IKCONFIG is not set
36CONFIG_EMBEDDED=y 37CONFIG_EMBEDDED=y
37# CONFIG_KALLSYMS is not set 38# CONFIG_KALLSYMS is not set
39CONFIG_PRINTK=y
40CONFIG_BUG=y
41CONFIG_BASE_FULL=y
38CONFIG_FUTEX=y 42CONFIG_FUTEX=y
39# CONFIG_EPOLL is not set 43# CONFIG_EPOLL is not set
40# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set 44# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
@@ -44,6 +48,7 @@ CONFIG_CC_ALIGN_LABELS=0
44CONFIG_CC_ALIGN_LOOPS=0 48CONFIG_CC_ALIGN_LOOPS=0
45CONFIG_CC_ALIGN_JUMPS=0 49CONFIG_CC_ALIGN_JUMPS=0
46# CONFIG_TINY_SHMEM is not set 50# CONFIG_TINY_SHMEM is not set
51CONFIG_BASE_SMALL=0
47 52
48# 53#
49# Loadable module support 54# Loadable module support
@@ -59,12 +64,16 @@ CONFIG_CC_ALIGN_JUMPS=0
59# CONFIG_POWER3 is not set 64# CONFIG_POWER3 is not set
60# CONFIG_POWER4 is not set 65# CONFIG_POWER4 is not set
61# CONFIG_8xx is not set 66# CONFIG_8xx is not set
67# CONFIG_E200 is not set
62CONFIG_E500=y 68CONFIG_E500=y
63CONFIG_BOOKE=y 69CONFIG_BOOKE=y
64CONFIG_FSL_BOOKE=y 70CONFIG_FSL_BOOKE=y
71# CONFIG_PHYS_64BIT is not set
65CONFIG_SPE=y 72CONFIG_SPE=y
66CONFIG_MATH_EMULATION=y 73CONFIG_MATH_EMULATION=y
74# CONFIG_KEXEC is not set
67# CONFIG_CPU_FREQ is not set 75# CONFIG_CPU_FREQ is not set
76# CONFIG_PM is not set
68CONFIG_85xx=y 77CONFIG_85xx=y
69CONFIG_PPC_INDIRECT_PCI_BE=y 78CONFIG_PPC_INDIRECT_PCI_BE=y
70 79
@@ -72,9 +81,11 @@ CONFIG_PPC_INDIRECT_PCI_BE=y
72# Freescale 85xx options 81# Freescale 85xx options
73# 82#
74# CONFIG_MPC8540_ADS is not set 83# CONFIG_MPC8540_ADS is not set
84# CONFIG_MPC8548_CDS is not set
75# CONFIG_MPC8555_CDS is not set 85# CONFIG_MPC8555_CDS is not set
76CONFIG_MPC8560_ADS=y 86CONFIG_MPC8560_ADS=y
77# CONFIG_SBC8560 is not set 87# CONFIG_SBC8560 is not set
88# CONFIG_STX_GP3 is not set
78CONFIG_MPC8560=y 89CONFIG_MPC8560=y
79 90
80# 91#
@@ -83,11 +94,25 @@ CONFIG_MPC8560=y
83CONFIG_CPM2=y 94CONFIG_CPM2=y
84# CONFIG_PC_KEYBOARD is not set 95# CONFIG_PC_KEYBOARD is not set
85# CONFIG_SMP is not set 96# CONFIG_SMP is not set
86# CONFIG_PREEMPT is not set
87# CONFIG_HIGHMEM is not set 97# CONFIG_HIGHMEM is not set
98# CONFIG_HZ_100 is not set
99CONFIG_HZ_250=y
100# CONFIG_HZ_1000 is not set
101CONFIG_HZ=250
102CONFIG_PREEMPT_NONE=y
103# CONFIG_PREEMPT_VOLUNTARY is not set
104# CONFIG_PREEMPT is not set
105CONFIG_SELECT_MEMORY_MODEL=y
106CONFIG_FLATMEM_MANUAL=y
107# CONFIG_DISCONTIGMEM_MANUAL is not set
108# CONFIG_SPARSEMEM_MANUAL is not set
109CONFIG_FLATMEM=y
110CONFIG_FLAT_NODE_MEM_MAP=y
88CONFIG_BINFMT_ELF=y 111CONFIG_BINFMT_ELF=y
89# CONFIG_BINFMT_MISC is not set 112# CONFIG_BINFMT_MISC is not set
90# CONFIG_CMDLINE_BOOL is not set 113# CONFIG_CMDLINE_BOOL is not set
114CONFIG_SECCOMP=y
115CONFIG_ISA_DMA_API=y
91 116
92# 117#
93# Bus options 118# Bus options
@@ -103,10 +128,6 @@ CONFIG_PCI_NAMES=y
103# CONFIG_PCCARD is not set 128# CONFIG_PCCARD is not set
104 129
105# 130#
106# PC-card bridges
107#
108
109#
110# Advanced setup 131# Advanced setup
111# 132#
112# CONFIG_ADVANCED_OPTIONS is not set 133# CONFIG_ADVANCED_OPTIONS is not set
@@ -121,6 +142,69 @@ CONFIG_TASK_SIZE=0x80000000
121CONFIG_BOOT_LOAD=0x00800000 142CONFIG_BOOT_LOAD=0x00800000
122 143
123# 144#
145# Networking
146#
147CONFIG_NET=y
148
149#
150# Networking options
151#
152CONFIG_PACKET=y
153# CONFIG_PACKET_MMAP is not set
154CONFIG_UNIX=y
155# CONFIG_NET_KEY is not set
156CONFIG_INET=y
157CONFIG_IP_MULTICAST=y
158# CONFIG_IP_ADVANCED_ROUTER is not set
159CONFIG_IP_FIB_HASH=y
160CONFIG_IP_PNP=y
161CONFIG_IP_PNP_DHCP=y
162CONFIG_IP_PNP_BOOTP=y
163# CONFIG_IP_PNP_RARP is not set
164# CONFIG_NET_IPIP is not set
165# CONFIG_NET_IPGRE is not set
166# CONFIG_IP_MROUTE is not set
167# CONFIG_ARPD is not set
168CONFIG_SYN_COOKIES=y
169# CONFIG_INET_AH is not set
170# CONFIG_INET_ESP is not set
171# CONFIG_INET_IPCOMP is not set
172# CONFIG_INET_TUNNEL is not set
173CONFIG_IP_TCPDIAG=y
174# CONFIG_IP_TCPDIAG_IPV6 is not set
175# CONFIG_TCP_CONG_ADVANCED is not set
176CONFIG_TCP_CONG_BIC=y
177# CONFIG_IPV6 is not set
178# CONFIG_NETFILTER is not set
179
180#
181# SCTP Configuration (EXPERIMENTAL)
182#
183# CONFIG_IP_SCTP is not set
184# CONFIG_ATM is not set
185# CONFIG_BRIDGE is not set
186# CONFIG_VLAN_8021Q is not set
187# CONFIG_DECNET is not set
188# CONFIG_LLC2 is not set
189# CONFIG_IPX is not set
190# CONFIG_ATALK is not set
191# CONFIG_X25 is not set
192# CONFIG_LAPB is not set
193# CONFIG_NET_DIVERT is not set
194# CONFIG_ECONET is not set
195# CONFIG_WAN_ROUTER is not set
196# CONFIG_NET_SCHED is not set
197# CONFIG_NET_CLS_ROUTE is not set
198
199#
200# Network testing
201#
202# CONFIG_NET_PKTGEN is not set
203# CONFIG_HAMRADIO is not set
204# CONFIG_IRDA is not set
205# CONFIG_BT is not set
206
207#
124# Device Drivers 208# Device Drivers
125# 209#
126 210
@@ -193,6 +277,7 @@ CONFIG_IOSCHED_CFQ=y
193# 277#
194# Fusion MPT device support 278# Fusion MPT device support
195# 279#
280# CONFIG_FUSION is not set
196 281
197# 282#
198# IEEE 1394 (FireWire) support 283# IEEE 1394 (FireWire) support
@@ -209,71 +294,8 @@ CONFIG_IOSCHED_CFQ=y
209# 294#
210 295
211# 296#
212# Networking support 297# Network device support
213#
214CONFIG_NET=y
215
216#
217# Networking options
218#
219CONFIG_PACKET=y
220# CONFIG_PACKET_MMAP is not set
221# CONFIG_NETLINK_DEV is not set
222CONFIG_UNIX=y
223# CONFIG_NET_KEY is not set
224CONFIG_INET=y
225CONFIG_IP_MULTICAST=y
226# CONFIG_IP_ADVANCED_ROUTER is not set
227CONFIG_IP_PNP=y
228CONFIG_IP_PNP_DHCP=y
229CONFIG_IP_PNP_BOOTP=y
230# CONFIG_IP_PNP_RARP is not set
231# CONFIG_NET_IPIP is not set
232# CONFIG_NET_IPGRE is not set
233# CONFIG_IP_MROUTE is not set
234# CONFIG_ARPD is not set
235CONFIG_SYN_COOKIES=y
236# CONFIG_INET_AH is not set
237# CONFIG_INET_ESP is not set
238# CONFIG_INET_IPCOMP is not set
239# CONFIG_INET_TUNNEL is not set
240CONFIG_IP_TCPDIAG=y
241# CONFIG_IP_TCPDIAG_IPV6 is not set
242# CONFIG_IPV6 is not set
243# CONFIG_NETFILTER is not set
244
245# 298#
246# SCTP Configuration (EXPERIMENTAL)
247#
248# CONFIG_IP_SCTP is not set
249# CONFIG_ATM is not set
250# CONFIG_BRIDGE is not set
251# CONFIG_VLAN_8021Q is not set
252# CONFIG_DECNET is not set
253# CONFIG_LLC2 is not set
254# CONFIG_IPX is not set
255# CONFIG_ATALK is not set
256# CONFIG_X25 is not set
257# CONFIG_LAPB is not set
258# CONFIG_NET_DIVERT is not set
259# CONFIG_ECONET is not set
260# CONFIG_WAN_ROUTER is not set
261
262#
263# QoS and/or fair queueing
264#
265# CONFIG_NET_SCHED is not set
266# CONFIG_NET_CLS_ROUTE is not set
267
268#
269# Network testing
270#
271# CONFIG_NET_PKTGEN is not set
272# CONFIG_NETPOLL is not set
273# CONFIG_NET_POLL_CONTROLLER is not set
274# CONFIG_HAMRADIO is not set
275# CONFIG_IRDA is not set
276# CONFIG_BT is not set
277CONFIG_NETDEVICES=y 299CONFIG_NETDEVICES=y
278# CONFIG_DUMMY is not set 300# CONFIG_DUMMY is not set
279# CONFIG_BONDING is not set 301# CONFIG_BONDING is not set
@@ -311,8 +333,10 @@ CONFIG_MII=y
311# CONFIG_HAMACHI is not set 333# CONFIG_HAMACHI is not set
312# CONFIG_YELLOWFIN is not set 334# CONFIG_YELLOWFIN is not set
313# CONFIG_R8169 is not set 335# CONFIG_R8169 is not set
336# CONFIG_SKGE is not set
314# CONFIG_SK98LIN is not set 337# CONFIG_SK98LIN is not set
315# CONFIG_TIGON3 is not set 338# CONFIG_TIGON3 is not set
339# CONFIG_BNX2 is not set
316CONFIG_GIANFAR=y 340CONFIG_GIANFAR=y
317CONFIG_GFAR_NAPI=y 341CONFIG_GFAR_NAPI=y
318 342
@@ -342,6 +366,8 @@ CONFIG_GFAR_NAPI=y
342# CONFIG_SLIP is not set 366# CONFIG_SLIP is not set
343# CONFIG_SHAPER is not set 367# CONFIG_SHAPER is not set
344# CONFIG_NETCONSOLE is not set 368# CONFIG_NETCONSOLE is not set
369# CONFIG_NETPOLL is not set
370# CONFIG_NET_POLL_CONTROLLER is not set
345 371
346# 372#
347# ISDN subsystem 373# ISDN subsystem
@@ -368,14 +394,6 @@ CONFIG_INPUT=y
368# CONFIG_INPUT_EVBUG is not set 394# CONFIG_INPUT_EVBUG is not set
369 395
370# 396#
371# Input I/O drivers
372#
373# CONFIG_GAMEPORT is not set
374CONFIG_SOUND_GAMEPORT=y
375# CONFIG_SERIO is not set
376# CONFIG_SERIO_I8042 is not set
377
378#
379# Input Device Drivers 397# Input Device Drivers
380# 398#
381# CONFIG_INPUT_KEYBOARD is not set 399# CONFIG_INPUT_KEYBOARD is not set
@@ -385,6 +403,12 @@ CONFIG_SOUND_GAMEPORT=y
385# CONFIG_INPUT_MISC is not set 403# CONFIG_INPUT_MISC is not set
386 404
387# 405#
406# Hardware I/O ports
407#
408# CONFIG_SERIO is not set
409# CONFIG_GAMEPORT is not set
410
411#
388# Character devices 412# Character devices
389# 413#
390# CONFIG_VT is not set 414# CONFIG_VT is not set
@@ -403,11 +427,12 @@ CONFIG_SERIAL_CORE_CONSOLE=y
403CONFIG_SERIAL_CPM=y 427CONFIG_SERIAL_CPM=y
404CONFIG_SERIAL_CPM_CONSOLE=y 428CONFIG_SERIAL_CPM_CONSOLE=y
405CONFIG_SERIAL_CPM_SCC1=y 429CONFIG_SERIAL_CPM_SCC1=y
406# CONFIG_SERIAL_CPM_SCC2 is not set 430CONFIG_SERIAL_CPM_SCC2=y
407# CONFIG_SERIAL_CPM_SCC3 is not set 431# CONFIG_SERIAL_CPM_SCC3 is not set
408CONFIG_SERIAL_CPM_SCC4=y 432# CONFIG_SERIAL_CPM_SCC4 is not set
409# CONFIG_SERIAL_CPM_SMC1 is not set 433# CONFIG_SERIAL_CPM_SMC1 is not set
410# CONFIG_SERIAL_CPM_SMC2 is not set 434# CONFIG_SERIAL_CPM_SMC2 is not set
435# CONFIG_SERIAL_JSM is not set
411CONFIG_UNIX98_PTYS=y 436CONFIG_UNIX98_PTYS=y
412CONFIG_LEGACY_PTYS=y 437CONFIG_LEGACY_PTYS=y
413CONFIG_LEGACY_PTY_COUNT=256 438CONFIG_LEGACY_PTY_COUNT=256
@@ -436,6 +461,11 @@ CONFIG_GEN_RTC=y
436# CONFIG_RAW_DRIVER is not set 461# CONFIG_RAW_DRIVER is not set
437 462
438# 463#
464# TPM devices
465#
466# CONFIG_TCG_TPM is not set
467
468#
439# I2C support 469# I2C support
440# 470#
441CONFIG_I2C=y 471CONFIG_I2C=y
@@ -458,11 +488,11 @@ CONFIG_I2C_CHARDEV=y
458# CONFIG_I2C_AMD8111 is not set 488# CONFIG_I2C_AMD8111 is not set
459# CONFIG_I2C_I801 is not set 489# CONFIG_I2C_I801 is not set
460# CONFIG_I2C_I810 is not set 490# CONFIG_I2C_I810 is not set
491# CONFIG_I2C_PIIX4 is not set
461# CONFIG_I2C_ISA is not set 492# CONFIG_I2C_ISA is not set
462CONFIG_I2C_MPC=y 493CONFIG_I2C_MPC=y
463# CONFIG_I2C_NFORCE2 is not set 494# CONFIG_I2C_NFORCE2 is not set
464# CONFIG_I2C_PARPORT_LIGHT is not set 495# CONFIG_I2C_PARPORT_LIGHT is not set
465# CONFIG_I2C_PIIX4 is not set
466# CONFIG_I2C_PROSAVAGE is not set 496# CONFIG_I2C_PROSAVAGE is not set
467# CONFIG_I2C_SAVAGE4 is not set 497# CONFIG_I2C_SAVAGE4 is not set
468# CONFIG_SCx200_ACB is not set 498# CONFIG_SCx200_ACB is not set
@@ -473,19 +503,46 @@ CONFIG_I2C_MPC=y
473# CONFIG_I2C_VIAPRO is not set 503# CONFIG_I2C_VIAPRO is not set
474# CONFIG_I2C_VOODOO3 is not set 504# CONFIG_I2C_VOODOO3 is not set
475# CONFIG_I2C_PCA_ISA is not set 505# CONFIG_I2C_PCA_ISA is not set
506# CONFIG_I2C_SENSOR is not set
476 507
477# 508#
478# Hardware Sensors Chip support 509# Miscellaneous I2C Chip support
479# 510#
480# CONFIG_I2C_SENSOR is not set 511# CONFIG_SENSORS_DS1337 is not set
512# CONFIG_SENSORS_DS1374 is not set
513# CONFIG_SENSORS_EEPROM is not set
514# CONFIG_SENSORS_PCF8574 is not set
515# CONFIG_SENSORS_PCA9539 is not set
516# CONFIG_SENSORS_PCF8591 is not set
517# CONFIG_SENSORS_RTC8564 is not set
518# CONFIG_SENSORS_M41T00 is not set
519# CONFIG_SENSORS_MAX6875 is not set
520# CONFIG_I2C_DEBUG_CORE is not set
521# CONFIG_I2C_DEBUG_ALGO is not set
522# CONFIG_I2C_DEBUG_BUS is not set
523# CONFIG_I2C_DEBUG_CHIP is not set
524
525#
526# Dallas's 1-wire bus
527#
528# CONFIG_W1 is not set
529
530#
531# Hardware Monitoring support
532#
533CONFIG_HWMON=y
481# CONFIG_SENSORS_ADM1021 is not set 534# CONFIG_SENSORS_ADM1021 is not set
482# CONFIG_SENSORS_ADM1025 is not set 535# CONFIG_SENSORS_ADM1025 is not set
483# CONFIG_SENSORS_ADM1026 is not set 536# CONFIG_SENSORS_ADM1026 is not set
484# CONFIG_SENSORS_ADM1031 is not set 537# CONFIG_SENSORS_ADM1031 is not set
538# CONFIG_SENSORS_ADM9240 is not set
485# CONFIG_SENSORS_ASB100 is not set 539# CONFIG_SENSORS_ASB100 is not set
540# CONFIG_SENSORS_ATXP1 is not set
486# CONFIG_SENSORS_DS1621 is not set 541# CONFIG_SENSORS_DS1621 is not set
487# CONFIG_SENSORS_FSCHER is not set 542# CONFIG_SENSORS_FSCHER is not set
543# CONFIG_SENSORS_FSCPOS is not set
488# CONFIG_SENSORS_GL518SM is not set 544# CONFIG_SENSORS_GL518SM is not set
545# CONFIG_SENSORS_GL520SM is not set
489# CONFIG_SENSORS_IT87 is not set 546# CONFIG_SENSORS_IT87 is not set
490# CONFIG_SENSORS_LM63 is not set 547# CONFIG_SENSORS_LM63 is not set
491# CONFIG_SENSORS_LM75 is not set 548# CONFIG_SENSORS_LM75 is not set
@@ -496,31 +553,18 @@ CONFIG_I2C_MPC=y
496# CONFIG_SENSORS_LM85 is not set 553# CONFIG_SENSORS_LM85 is not set
497# CONFIG_SENSORS_LM87 is not set 554# CONFIG_SENSORS_LM87 is not set
498# CONFIG_SENSORS_LM90 is not set 555# CONFIG_SENSORS_LM90 is not set
556# CONFIG_SENSORS_LM92 is not set
499# CONFIG_SENSORS_MAX1619 is not set 557# CONFIG_SENSORS_MAX1619 is not set
500# CONFIG_SENSORS_PC87360 is not set 558# CONFIG_SENSORS_PC87360 is not set
501# CONFIG_SENSORS_SMSC47B397 is not set 559# CONFIG_SENSORS_SIS5595 is not set
502# CONFIG_SENSORS_SMSC47M1 is not set 560# CONFIG_SENSORS_SMSC47M1 is not set
561# CONFIG_SENSORS_SMSC47B397 is not set
503# CONFIG_SENSORS_VIA686A is not set 562# CONFIG_SENSORS_VIA686A is not set
504# CONFIG_SENSORS_W83781D is not set 563# CONFIG_SENSORS_W83781D is not set
505# CONFIG_SENSORS_W83L785TS is not set 564# CONFIG_SENSORS_W83L785TS is not set
506# CONFIG_SENSORS_W83627HF is not set 565# CONFIG_SENSORS_W83627HF is not set
507 566# CONFIG_SENSORS_W83627EHF is not set
508# 567# CONFIG_HWMON_DEBUG_CHIP is not set
509# Other I2C Chip support
510#
511# CONFIG_SENSORS_EEPROM is not set
512# CONFIG_SENSORS_PCF8574 is not set
513# CONFIG_SENSORS_PCF8591 is not set
514# CONFIG_SENSORS_RTC8564 is not set
515# CONFIG_I2C_DEBUG_CORE is not set
516# CONFIG_I2C_DEBUG_ALGO is not set
517# CONFIG_I2C_DEBUG_BUS is not set
518# CONFIG_I2C_DEBUG_CHIP is not set
519
520#
521# Dallas's 1-wire bus
522#
523# CONFIG_W1 is not set
524 568
525# 569#
526# Misc devices 570# Misc devices
@@ -540,7 +584,6 @@ CONFIG_I2C_MPC=y
540# Graphics support 584# Graphics support
541# 585#
542# CONFIG_FB is not set 586# CONFIG_FB is not set
543# CONFIG_BACKLIGHT_LCD_SUPPORT is not set
544 587
545# 588#
546# Sound 589# Sound
@@ -550,13 +593,9 @@ CONFIG_I2C_MPC=y
550# 593#
551# USB support 594# USB support
552# 595#
553# CONFIG_USB is not set
554CONFIG_USB_ARCH_HAS_HCD=y 596CONFIG_USB_ARCH_HAS_HCD=y
555CONFIG_USB_ARCH_HAS_OHCI=y 597CONFIG_USB_ARCH_HAS_OHCI=y
556 598# CONFIG_USB is not set
557#
558# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support' may also be needed; see USB_STORAGE Help for more information
559#
560 599
561# 600#
562# USB Gadget Support 601# USB Gadget Support
@@ -574,10 +613,15 @@ CONFIG_USB_ARCH_HAS_OHCI=y
574# CONFIG_INFINIBAND is not set 613# CONFIG_INFINIBAND is not set
575 614
576# 615#
616# SN Devices
617#
618
619#
577# File systems 620# File systems
578# 621#
579CONFIG_EXT2_FS=y 622CONFIG_EXT2_FS=y
580# CONFIG_EXT2_FS_XATTR is not set 623# CONFIG_EXT2_FS_XATTR is not set
624# CONFIG_EXT2_FS_XIP is not set
581CONFIG_EXT3_FS=y 625CONFIG_EXT3_FS=y
582CONFIG_EXT3_FS_XATTR=y 626CONFIG_EXT3_FS_XATTR=y
583# CONFIG_EXT3_FS_POSIX_ACL is not set 627# CONFIG_EXT3_FS_POSIX_ACL is not set
@@ -587,9 +631,15 @@ CONFIG_JBD=y
587CONFIG_FS_MBCACHE=y 631CONFIG_FS_MBCACHE=y
588# CONFIG_REISERFS_FS is not set 632# CONFIG_REISERFS_FS is not set
589# CONFIG_JFS_FS is not set 633# CONFIG_JFS_FS is not set
634# CONFIG_FS_POSIX_ACL is not set
635
636#
637# XFS support
638#
590# CONFIG_XFS_FS is not set 639# CONFIG_XFS_FS is not set
591# CONFIG_MINIX_FS is not set 640# CONFIG_MINIX_FS is not set
592# CONFIG_ROMFS_FS is not set 641# CONFIG_ROMFS_FS is not set
642CONFIG_INOTIFY=y
593# CONFIG_QUOTA is not set 643# CONFIG_QUOTA is not set
594CONFIG_DNOTIFY=y 644CONFIG_DNOTIFY=y
595# CONFIG_AUTOFS_FS is not set 645# CONFIG_AUTOFS_FS is not set
@@ -614,7 +664,6 @@ CONFIG_DNOTIFY=y
614CONFIG_PROC_FS=y 664CONFIG_PROC_FS=y
615CONFIG_PROC_KCORE=y 665CONFIG_PROC_KCORE=y
616CONFIG_SYSFS=y 666CONFIG_SYSFS=y
617# CONFIG_DEVFS_FS is not set
618# CONFIG_DEVPTS_FS_XATTR is not set 667# CONFIG_DEVPTS_FS_XATTR is not set
619CONFIG_TMPFS=y 668CONFIG_TMPFS=y
620# CONFIG_TMPFS_XATTR is not set 669# CONFIG_TMPFS_XATTR is not set
@@ -648,7 +697,7 @@ CONFIG_NFS_FS=y
648# CONFIG_NFSD is not set 697# CONFIG_NFSD is not set
649CONFIG_ROOT_NFS=y 698CONFIG_ROOT_NFS=y
650CONFIG_LOCKD=y 699CONFIG_LOCKD=y
651# CONFIG_EXPORTFS is not set 700CONFIG_NFS_COMMON=y
652CONFIG_SUNRPC=y 701CONFIG_SUNRPC=y
653# CONFIG_RPCSEC_GSS_KRB5 is not set 702# CONFIG_RPCSEC_GSS_KRB5 is not set
654# CONFIG_RPCSEC_GSS_SPKM3 is not set 703# CONFIG_RPCSEC_GSS_SPKM3 is not set
@@ -700,7 +749,9 @@ CONFIG_CRC32=y
700# 749#
701# Kernel hacking 750# Kernel hacking
702# 751#
752# CONFIG_PRINTK_TIME is not set
703# CONFIG_DEBUG_KERNEL is not set 753# CONFIG_DEBUG_KERNEL is not set
754CONFIG_LOG_BUF_SHIFT=14
704# CONFIG_KGDB_CONSOLE is not set 755# CONFIG_KGDB_CONSOLE is not set
705 756
706# 757#
diff --git a/arch/ppc/configs/oak_defconfig b/arch/ppc/configs/oak_defconfig
deleted file mode 100644
index 366cc480cea3..000000000000
--- a/arch/ppc/configs/oak_defconfig
+++ /dev/null
@@ -1,485 +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
7
8#
9# Code maturity level options
10#
11CONFIG_EXPERIMENTAL=y
12
13#
14# General setup
15#
16CONFIG_SWAP=y
17CONFIG_SYSVIPC=y
18# CONFIG_BSD_PROCESS_ACCT is not set
19CONFIG_SYSCTL=y
20CONFIG_LOG_BUF_SHIFT=14
21CONFIG_EMBEDDED=y
22CONFIG_FUTEX=y
23# CONFIG_EPOLL is not set
24
25#
26# Loadable module support
27#
28CONFIG_MODULES=y
29CONFIG_MODULE_UNLOAD=y
30# CONFIG_MODULE_FORCE_UNLOAD is not set
31CONFIG_OBSOLETE_MODPARM=y
32# CONFIG_MODVERSIONS is not set
33CONFIG_KMOD=y
34
35#
36# Platform support
37#
38CONFIG_PPC=y
39CONFIG_PPC32=y
40# CONFIG_6xx is not set
41CONFIG_40x=y
42# CONFIG_POWER3 is not set
43# CONFIG_8xx is not set
44CONFIG_4xx=y
45
46#
47# IBM 4xx options
48#
49# CONFIG_ASH is not set
50# CONFIG_BEECH is not set
51# CONFIG_CEDAR is not set
52# CONFIG_CPCI405 is not set
53# CONFIG_EP405 is not set
54CONFIG_OAK=y
55# CONFIG_REDWOOD_4 is not set
56# CONFIG_REDWOOD_5 is not set
57# CONFIG_REDWOOD_6 is not set
58# CONFIG_SYCAMORE is not set
59# CONFIG_TIVO is not set
60# CONFIG_WALNUT is not set
61CONFIG_IBM405_ERR51=y
62CONFIG_403GCX=y
63# CONFIG_405_DMA is not set
64# CONFIG_PM is not set
65CONFIG_UART0_TTYS0=y
66# CONFIG_UART0_TTYS1 is not set
67CONFIG_NOT_COHERENT_CACHE=y
68# CONFIG_SMP is not set
69# CONFIG_PREEMPT is not set
70# CONFIG_MATH_EMULATION is not set
71# CONFIG_CPU_FREQ is not set
72
73#
74# General setup
75#
76# CONFIG_HIGHMEM is not set
77# CONFIG_PCI is not set
78# CONFIG_PCI_DOMAINS is not set
79# CONFIG_PC_KEYBOARD is not set
80CONFIG_KCORE_ELF=y
81CONFIG_BINFMT_ELF=y
82CONFIG_KERNEL_ELF=y
83# CONFIG_BINFMT_MISC is not set
84# CONFIG_HOTPLUG is not set
85
86#
87# Parallel port support
88#
89# CONFIG_PARPORT is not set
90# CONFIG_CMDLINE_BOOL is not set
91
92#
93# Advanced setup
94#
95# CONFIG_ADVANCED_OPTIONS is not set
96
97#
98# Default settings for advanced configuration options are used
99#
100CONFIG_HIGHMEM_START=0xfe000000
101CONFIG_LOWMEM_SIZE=0x30000000
102CONFIG_KERNEL_START=0xc0000000
103CONFIG_TASK_SIZE=0x80000000
104CONFIG_BOOT_LOAD=0x00400000
105
106#
107# Memory Technology Devices (MTD)
108#
109# CONFIG_MTD is not set
110
111#
112# Plug and Play support
113#
114# CONFIG_PNP is not set
115
116#
117# Block devices
118#
119# CONFIG_BLK_DEV_FD is not set
120CONFIG_BLK_DEV_LOOP=y
121# CONFIG_BLK_DEV_NBD is not set
122CONFIG_BLK_DEV_RAM=y
123CONFIG_BLK_DEV_RAM_SIZE=4096
124CONFIG_BLK_DEV_INITRD=y
125
126#
127# Multi-device support (RAID and LVM)
128#
129# CONFIG_MD is not set
130
131#
132# ATA/IDE/MFM/RLL support
133#
134# CONFIG_IDE is not set
135
136#
137# SCSI support
138#
139# CONFIG_SCSI is not set
140
141#
142# Fusion MPT device support
143#
144
145#
146# I2O device support
147#
148
149#
150# Networking support
151#
152CONFIG_NET=y
153
154#
155# Networking options
156#
157# CONFIG_PACKET is not set
158# CONFIG_NETLINK_DEV is not set
159# CONFIG_NETFILTER is not set
160CONFIG_UNIX=y
161# CONFIG_NET_KEY is not set
162CONFIG_INET=y
163CONFIG_IP_MULTICAST=y
164# CONFIG_IP_ADVANCED_ROUTER is not set
165CONFIG_IP_PNP=y
166# CONFIG_IP_PNP_DHCP is not set
167CONFIG_IP_PNP_BOOTP=y
168CONFIG_IP_PNP_RARP=y
169# CONFIG_NET_IPIP is not set
170# CONFIG_NET_IPGRE is not set
171# CONFIG_IP_MROUTE is not set
172# CONFIG_ARPD is not set
173# CONFIG_INET_ECN is not set
174CONFIG_SYN_COOKIES=y
175# CONFIG_INET_AH is not set
176# CONFIG_INET_ESP is not set
177# CONFIG_INET_IPCOMP is not set
178# CONFIG_IPV6 is not set
179# CONFIG_XFRM_USER is not set
180
181#
182# SCTP Configuration (EXPERIMENTAL)
183#
184CONFIG_IPV6_SCTP__=y
185# CONFIG_IP_SCTP is not set
186# CONFIG_ATM is not set
187# CONFIG_VLAN_8021Q is not set
188# CONFIG_LLC is not set
189# CONFIG_DECNET is not set
190# CONFIG_BRIDGE is not set
191# CONFIG_X25 is not set
192# CONFIG_LAPB is not set
193# CONFIG_NET_DIVERT is not set
194# CONFIG_ECONET is not set
195# CONFIG_WAN_ROUTER is not set
196# CONFIG_NET_HW_FLOWCONTROL is not set
197
198#
199# QoS and/or fair queueing
200#
201# CONFIG_NET_SCHED is not set
202
203#
204# Network testing
205#
206# CONFIG_NET_PKTGEN is not set
207CONFIG_NETDEVICES=y
208# CONFIG_DUMMY is not set
209# CONFIG_BONDING is not set
210# CONFIG_EQUALIZER is not set
211# CONFIG_TUN is not set
212# CONFIG_ETHERTAP is not set
213
214#
215# Ethernet (10 or 100Mbit)
216#
217CONFIG_NET_ETHERNET=y
218# CONFIG_MII is not set
219CONFIG_OAKNET=y
220
221#
222# Ethernet (1000 Mbit)
223#
224
225#
226# Ethernet (10000 Mbit)
227#
228# CONFIG_PPP is not set
229# CONFIG_SLIP is not set
230
231#
232# Wireless LAN (non-hamradio)
233#
234# CONFIG_NET_RADIO is not set
235
236#
237# Token Ring devices (depends on LLC=y)
238#
239# CONFIG_SHAPER is not set
240
241#
242# Wan interfaces
243#
244# CONFIG_WAN is not set
245
246#
247# Amateur Radio support
248#
249# CONFIG_HAMRADIO is not set
250
251#
252# IrDA (infrared) support
253#
254# CONFIG_IRDA is not set
255
256#
257# ISDN subsystem
258#
259# CONFIG_ISDN_BOOL is not set
260
261#
262# Graphics support
263#
264# CONFIG_FB 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# Input device support
273#
274# CONFIG_INPUT is not set
275
276#
277# Userland interfaces
278#
279
280#
281# Input I/O drivers
282#
283# CONFIG_GAMEPORT is not set
284CONFIG_SOUND_GAMEPORT=y
285# CONFIG_SERIO is not set
286
287#
288# Input Device Drivers
289#
290
291#
292# Macintosh device drivers
293#
294
295#
296# Character devices
297#
298# CONFIG_SERIAL_NONSTANDARD is not set
299
300#
301# Serial drivers
302#
303CONFIG_SERIAL_8250=y
304CONFIG_SERIAL_8250_CONSOLE=y
305# CONFIG_SERIAL_8250_EXTENDED is not set
306
307#
308# Non-8250 serial port support
309#
310CONFIG_SERIAL_CORE=y
311CONFIG_SERIAL_CORE_CONSOLE=y
312# CONFIG_UNIX98_PTYS is not set
313
314#
315# I2C support
316#
317# CONFIG_I2C is not set
318
319#
320# I2C Hardware Sensors Mainboard support
321#
322
323#
324# I2C Hardware Sensors Chip support
325#
326# CONFIG_I2C_SENSOR is not set
327
328#
329# Mice
330#
331# CONFIG_BUSMOUSE is not set
332# CONFIG_QIC02_TAPE is not set
333
334#
335# IPMI
336#
337# CONFIG_IPMI_HANDLER is not set
338
339#
340# Watchdog Cards
341#
342# CONFIG_WATCHDOG is not set
343# CONFIG_NVRAM is not set
344CONFIG_GEN_RTC=y
345# CONFIG_GEN_RTC_X is not set
346# CONFIG_DTLK is not set
347# CONFIG_R3964 is not set
348# CONFIG_APPLICOM is not set
349
350#
351# Ftape, the floppy tape device driver
352#
353# CONFIG_FTAPE is not set
354# CONFIG_AGP is not set
355# CONFIG_DRM is not set
356# CONFIG_RAW_DRIVER is not set
357# CONFIG_HANGCHECK_TIMER is not set
358
359#
360# Multimedia devices
361#
362# CONFIG_VIDEO_DEV is not set
363
364#
365# Digital Video Broadcasting Devices
366#
367# CONFIG_DVB is not set
368
369#
370# File systems
371#
372CONFIG_EXT2_FS=y
373# CONFIG_EXT2_FS_XATTR is not set
374# CONFIG_EXT3_FS is not set
375# CONFIG_JBD is not set
376# CONFIG_REISERFS_FS is not set
377# CONFIG_JFS_FS is not set
378# CONFIG_XFS_FS is not set
379# CONFIG_MINIX_FS is not set
380# CONFIG_ROMFS_FS is not set
381# CONFIG_QUOTA is not set
382# CONFIG_AUTOFS_FS is not set
383# CONFIG_AUTOFS4_FS is not set
384
385#
386# CD-ROM/DVD Filesystems
387#
388# CONFIG_ISO9660_FS is not set
389# CONFIG_UDF_FS is not set
390
391#
392# DOS/FAT/NT Filesystems
393#
394# CONFIG_FAT_FS is not set
395# CONFIG_NTFS_FS is not set
396
397#
398# Pseudo filesystems
399#
400CONFIG_PROC_FS=y
401# CONFIG_DEVFS_FS is not set
402CONFIG_TMPFS=y
403CONFIG_RAMFS=y
404
405#
406# Miscellaneous filesystems
407#
408# CONFIG_ADFS_FS is not set
409# CONFIG_AFFS_FS is not set
410# CONFIG_HFS_FS is not set
411# CONFIG_BEFS_FS is not set
412# CONFIG_BFS_FS is not set
413# CONFIG_EFS_FS is not set
414# CONFIG_CRAMFS is not set
415# CONFIG_VXFS_FS is not set
416# CONFIG_HPFS_FS is not set
417# CONFIG_QNX4FS_FS is not set
418# CONFIG_SYSV_FS is not set
419# CONFIG_UFS_FS is not set
420
421#
422# Network File Systems
423#
424CONFIG_NFS_FS=y
425# CONFIG_NFS_V3 is not set
426# CONFIG_NFS_V4 is not set
427# CONFIG_NFSD is not set
428CONFIG_ROOT_NFS=y
429CONFIG_LOCKD=y
430# CONFIG_EXPORTFS is not set
431CONFIG_SUNRPC=y
432# CONFIG_SUNRPC_GSS is not set
433# CONFIG_SMB_FS is not set
434# CONFIG_CIFS is not set
435# CONFIG_NCP_FS is not set
436# CONFIG_CODA_FS is not set
437# CONFIG_INTERMEZZO_FS is not set
438# CONFIG_AFS_FS is not set
439
440#
441# Partition Types
442#
443# CONFIG_PARTITION_ADVANCED is not set
444CONFIG_MSDOS_PARTITION=y
445
446#
447# Sound
448#
449# CONFIG_SOUND is not set
450
451#
452# IBM 40x options
453#
454
455#
456# USB support
457#
458# CONFIG_USB_GADGET is not set
459
460#
461# Bluetooth support
462#
463# CONFIG_BT is not set
464
465#
466# Library routines
467#
468# CONFIG_CRC32 is not set
469
470#
471# Kernel hacking
472#
473# CONFIG_DEBUG_KERNEL is not set
474# CONFIG_KALLSYMS is not set
475# CONFIG_SERIAL_TEXT_DEBUG is not set
476
477#
478# Security options
479#
480# CONFIG_SECURITY is not set
481
482#
483# Cryptographic options
484#
485# CONFIG_CRYPTO is not set
diff --git a/arch/ppc/configs/pmac_defconfig b/arch/ppc/configs/pmac_defconfig
index 8eebb0455766..a2db8b541c9b 100644
--- a/arch/ppc/configs/pmac_defconfig
+++ b/arch/ppc/configs/pmac_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.11-rc4 3# Linux kernel version: 2.6.13-rc3
4# Sun Feb 13 14:56:58 2005 4# Wed Jul 13 14:13:13 2005
5# 5#
6CONFIG_MMU=y 6CONFIG_MMU=y
7CONFIG_GENERIC_HARDIRQS=y 7CONFIG_GENERIC_HARDIRQS=y
@@ -11,6 +11,7 @@ CONFIG_HAVE_DEC_LOCK=y
11CONFIG_PPC=y 11CONFIG_PPC=y
12CONFIG_PPC32=y 12CONFIG_PPC32=y
13CONFIG_GENERIC_NVRAM=y 13CONFIG_GENERIC_NVRAM=y
14CONFIG_SCHED_NO_NO_OMIT_FRAME_POINTER=y
14 15
15# 16#
16# Code maturity level options 17# Code maturity level options
@@ -18,6 +19,7 @@ CONFIG_GENERIC_NVRAM=y
18CONFIG_EXPERIMENTAL=y 19CONFIG_EXPERIMENTAL=y
19CONFIG_CLEAN_COMPILE=y 20CONFIG_CLEAN_COMPILE=y
20CONFIG_BROKEN_ON_SMP=y 21CONFIG_BROKEN_ON_SMP=y
22CONFIG_INIT_ENV_ARG_LIMIT=32
21 23
22# 24#
23# General setup 25# General setup
@@ -28,7 +30,7 @@ CONFIG_SYSVIPC=y
28CONFIG_POSIX_MQUEUE=y 30CONFIG_POSIX_MQUEUE=y
29# CONFIG_BSD_PROCESS_ACCT is not set 31# CONFIG_BSD_PROCESS_ACCT is not set
30CONFIG_SYSCTL=y 32CONFIG_SYSCTL=y
31CONFIG_LOG_BUF_SHIFT=16 33# CONFIG_AUDIT is not set
32CONFIG_HOTPLUG=y 34CONFIG_HOTPLUG=y
33CONFIG_KOBJECT_UEVENT=y 35CONFIG_KOBJECT_UEVENT=y
34CONFIG_IKCONFIG=y 36CONFIG_IKCONFIG=y
@@ -37,15 +39,18 @@ CONFIG_IKCONFIG_PROC=y
37CONFIG_KALLSYMS=y 39CONFIG_KALLSYMS=y
38# CONFIG_KALLSYMS_ALL is not set 40# CONFIG_KALLSYMS_ALL is not set
39# CONFIG_KALLSYMS_EXTRA_PASS is not set 41# CONFIG_KALLSYMS_EXTRA_PASS is not set
42CONFIG_PRINTK=y
43CONFIG_BUG=y
44CONFIG_BASE_FULL=y
40CONFIG_FUTEX=y 45CONFIG_FUTEX=y
41CONFIG_EPOLL=y 46CONFIG_EPOLL=y
42# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
43CONFIG_SHMEM=y 47CONFIG_SHMEM=y
44CONFIG_CC_ALIGN_FUNCTIONS=0 48CONFIG_CC_ALIGN_FUNCTIONS=0
45CONFIG_CC_ALIGN_LABELS=0 49CONFIG_CC_ALIGN_LABELS=0
46CONFIG_CC_ALIGN_LOOPS=0 50CONFIG_CC_ALIGN_LOOPS=0
47CONFIG_CC_ALIGN_JUMPS=0 51CONFIG_CC_ALIGN_JUMPS=0
48# CONFIG_TINY_SHMEM is not set 52# CONFIG_TINY_SHMEM is not set
53CONFIG_BASE_SMALL=0
49 54
50# 55#
51# Loadable module support 56# Loadable module support
@@ -67,12 +72,16 @@ CONFIG_6xx=y
67# CONFIG_POWER3 is not set 72# CONFIG_POWER3 is not set
68# CONFIG_POWER4 is not set 73# CONFIG_POWER4 is not set
69# CONFIG_8xx is not set 74# CONFIG_8xx is not set
75# CONFIG_E200 is not set
70# CONFIG_E500 is not set 76# CONFIG_E500 is not set
77CONFIG_PPC_FPU=y
71CONFIG_ALTIVEC=y 78CONFIG_ALTIVEC=y
72CONFIG_TAU=y 79CONFIG_TAU=y
73# CONFIG_TAU_INT is not set 80# CONFIG_TAU_INT is not set
74# CONFIG_TAU_AVERAGE is not set 81# CONFIG_TAU_AVERAGE is not set
82# CONFIG_KEXEC is not set
75CONFIG_CPU_FREQ=y 83CONFIG_CPU_FREQ=y
84CONFIG_CPU_FREQ_TABLE=y
76# CONFIG_CPU_FREQ_DEBUG is not set 85# CONFIG_CPU_FREQ_DEBUG is not set
77CONFIG_CPU_FREQ_STAT=m 86CONFIG_CPU_FREQ_STAT=m
78CONFIG_CPU_FREQ_STAT_DETAILS=y 87CONFIG_CPU_FREQ_STAT_DETAILS=y
@@ -82,8 +91,8 @@ CONFIG_CPU_FREQ_GOV_PERFORMANCE=y
82CONFIG_CPU_FREQ_GOV_POWERSAVE=m 91CONFIG_CPU_FREQ_GOV_POWERSAVE=m
83CONFIG_CPU_FREQ_GOV_USERSPACE=m 92CONFIG_CPU_FREQ_GOV_USERSPACE=m
84CONFIG_CPU_FREQ_GOV_ONDEMAND=m 93CONFIG_CPU_FREQ_GOV_ONDEMAND=m
94CONFIG_CPU_FREQ_GOV_CONSERVATIVE=m
85CONFIG_CPU_FREQ_PMAC=y 95CONFIG_CPU_FREQ_PMAC=y
86CONFIG_CPU_FREQ_TABLE=y
87CONFIG_PPC601_SYNC_FIX=y 96CONFIG_PPC601_SYNC_FIX=y
88CONFIG_PM=y 97CONFIG_PM=y
89CONFIG_PPC_STD_MMU=y 98CONFIG_PPC_STD_MMU=y
@@ -100,6 +109,7 @@ CONFIG_PPC_MULTIPLATFORM=y
100# CONFIG_POWERPMC250 is not set 109# CONFIG_POWERPMC250 is not set
101# CONFIG_CHESTNUT is not set 110# CONFIG_CHESTNUT is not set
102# CONFIG_SPRUCE is not set 111# CONFIG_SPRUCE is not set
112# CONFIG_HDPU is not set
103# CONFIG_EV64260 is not set 113# CONFIG_EV64260 is not set
104# CONFIG_LOPEC is not set 114# CONFIG_LOPEC is not set
105# CONFIG_MCPN765 is not set 115# CONFIG_MCPN765 is not set
@@ -108,6 +118,7 @@ CONFIG_PPC_MULTIPLATFORM=y
108# CONFIG_PRPMC750 is not set 118# CONFIG_PRPMC750 is not set
109# CONFIG_PRPMC800 is not set 119# CONFIG_PRPMC800 is not set
110# CONFIG_SANDPOINT is not set 120# CONFIG_SANDPOINT is not set
121# CONFIG_RADSTONE_PPC7D is not set
111# CONFIG_ADIR is not set 122# CONFIG_ADIR is not set
112# CONFIG_K2 is not set 123# CONFIG_K2 is not set
113# CONFIG_PAL4 is not set 124# CONFIG_PAL4 is not set
@@ -120,19 +131,37 @@ CONFIG_PPC_MULTIPLATFORM=y
120# CONFIG_ADS8272 is not set 131# CONFIG_ADS8272 is not set
121# CONFIG_PQ2FADS is not set 132# CONFIG_PQ2FADS is not set
122# CONFIG_LITE5200 is not set 133# CONFIG_LITE5200 is not set
134# CONFIG_MPC834x_SYS is not set
123CONFIG_PPC_CHRP=y 135CONFIG_PPC_CHRP=y
124CONFIG_PPC_PMAC=y 136CONFIG_PPC_PMAC=y
125CONFIG_PPC_PREP=y 137CONFIG_PPC_PREP=y
126CONFIG_PPC_OF=y 138CONFIG_PPC_OF=y
127CONFIG_PPCBUG_NVRAM=y 139CONFIG_PPCBUG_NVRAM=y
128# CONFIG_SMP is not set 140# CONFIG_SMP is not set
129# CONFIG_PREEMPT is not set
130# CONFIG_HIGHMEM 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
131CONFIG_BINFMT_ELF=y 155CONFIG_BINFMT_ELF=y
132CONFIG_BINFMT_MISC=m 156CONFIG_BINFMT_MISC=m
133CONFIG_PROC_DEVICETREE=y 157CONFIG_PROC_DEVICETREE=y
134# CONFIG_PREP_RESIDUAL is not set 158# CONFIG_PREP_RESIDUAL is not set
135# CONFIG_CMDLINE_BOOL 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
136 165
137# 166#
138# Bus options 167# Bus options
@@ -143,6 +172,7 @@ CONFIG_PCI=y
143CONFIG_PCI_DOMAINS=y 172CONFIG_PCI_DOMAINS=y
144CONFIG_PCI_LEGACY_PROC=y 173CONFIG_PCI_LEGACY_PROC=y
145CONFIG_PCI_NAMES=y 174CONFIG_PCI_NAMES=y
175# CONFIG_PCI_DEBUG is not set
146 176
147# 177#
148# PCCARD (PCMCIA/CardBus) support 178# PCCARD (PCMCIA/CardBus) support
@@ -150,6 +180,8 @@ CONFIG_PCI_NAMES=y
150CONFIG_PCCARD=m 180CONFIG_PCCARD=m
151# CONFIG_PCMCIA_DEBUG is not set 181# CONFIG_PCMCIA_DEBUG is not set
152CONFIG_PCMCIA=m 182CONFIG_PCMCIA=m
183# CONFIG_PCMCIA_LOAD_CIS is not set
184# CONFIG_PCMCIA_IOCTL is not set
153CONFIG_CARDBUS=y 185CONFIG_CARDBUS=y
154 186
155# 187#
@@ -175,6 +207,194 @@ CONFIG_TASK_SIZE=0xc0000000
175CONFIG_BOOT_LOAD=0x00800000 207CONFIG_BOOT_LOAD=0x00800000
176 208
177# 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#
178# Device Drivers 398# Device Drivers
179# 399#
180 400
@@ -183,7 +403,7 @@ CONFIG_BOOT_LOAD=0x00800000
183# 403#
184# CONFIG_STANDALONE is not set 404# CONFIG_STANDALONE is not set
185CONFIG_PREVENT_FIRMWARE_BUILD=y 405CONFIG_PREVENT_FIRMWARE_BUILD=y
186# CONFIG_FW_LOADER is not set 406CONFIG_FW_LOADER=m
187# CONFIG_DEBUG_DRIVER is not set 407# CONFIG_DEBUG_DRIVER is not set
188 408
189# 409#
@@ -279,6 +499,7 @@ CONFIG_BLK_DEV_CMD64X=y
279# CONFIG_BLK_DEV_HPT366 is not set 499# CONFIG_BLK_DEV_HPT366 is not set
280# CONFIG_BLK_DEV_SC1200 is not set 500# CONFIG_BLK_DEV_SC1200 is not set
281# CONFIG_BLK_DEV_PIIX is not set 501# CONFIG_BLK_DEV_PIIX is not set
502# CONFIG_BLK_DEV_IT821X is not set
282# CONFIG_BLK_DEV_NS87415 is not set 503# CONFIG_BLK_DEV_NS87415 is not set
283# CONFIG_BLK_DEV_PDC202XX_OLD is not set 504# CONFIG_BLK_DEV_PDC202XX_OLD is not set
284CONFIG_BLK_DEV_PDC202XX_NEW=y 505CONFIG_BLK_DEV_PDC202XX_NEW=y
@@ -313,6 +534,7 @@ CONFIG_CHR_DEV_ST=y
313CONFIG_BLK_DEV_SR=y 534CONFIG_BLK_DEV_SR=y
314CONFIG_BLK_DEV_SR_VENDOR=y 535CONFIG_BLK_DEV_SR_VENDOR=y
315CONFIG_CHR_DEV_SG=y 536CONFIG_CHR_DEV_SG=y
537# CONFIG_CHR_DEV_SCH is not set
316 538
317# 539#
318# Some SCSI devices (e.g. CD jukebox) support multiple LUNs 540# Some SCSI devices (e.g. CD jukebox) support multiple LUNs
@@ -350,7 +572,6 @@ CONFIG_SCSI_AIC7XXX_OLD=m
350# CONFIG_SCSI_BUSLOGIC is not set 572# CONFIG_SCSI_BUSLOGIC is not set
351# CONFIG_SCSI_DMX3191D is not set 573# CONFIG_SCSI_DMX3191D is not set
352# CONFIG_SCSI_EATA is not set 574# CONFIG_SCSI_EATA is not set
353# CONFIG_SCSI_EATA_PIO is not set
354# CONFIG_SCSI_FUTURE_DOMAIN is not set 575# CONFIG_SCSI_FUTURE_DOMAIN is not set
355# CONFIG_SCSI_GDTH is not set 576# CONFIG_SCSI_GDTH is not set
356# CONFIG_SCSI_IPS is not set 577# CONFIG_SCSI_IPS is not set
@@ -362,7 +583,6 @@ CONFIG_SCSI_SYM53C8XX_DEFAULT_TAGS=16
362CONFIG_SCSI_SYM53C8XX_MAX_TAGS=64 583CONFIG_SCSI_SYM53C8XX_MAX_TAGS=64
363# CONFIG_SCSI_SYM53C8XX_IOMAPPED is not set 584# CONFIG_SCSI_SYM53C8XX_IOMAPPED is not set
364# CONFIG_SCSI_IPR is not set 585# CONFIG_SCSI_IPR is not set
365# CONFIG_SCSI_QLOGIC_ISP is not set
366# CONFIG_SCSI_QLOGIC_FC is not set 586# CONFIG_SCSI_QLOGIC_FC is not set
367# CONFIG_SCSI_QLOGIC_1280 is not set 587# CONFIG_SCSI_QLOGIC_1280 is not set
368CONFIG_SCSI_QLA2XXX=y 588CONFIG_SCSI_QLA2XXX=y
@@ -371,6 +591,7 @@ CONFIG_SCSI_QLA2XXX=y
371# CONFIG_SCSI_QLA2300 is not set 591# CONFIG_SCSI_QLA2300 is not set
372# CONFIG_SCSI_QLA2322 is not set 592# CONFIG_SCSI_QLA2322 is not set
373# CONFIG_SCSI_QLA6312 is not set 593# CONFIG_SCSI_QLA6312 is not set
594# CONFIG_SCSI_LPFC is not set
374# CONFIG_SCSI_DC395x is not set 595# CONFIG_SCSI_DC395x is not set
375# CONFIG_SCSI_DC390T is not set 596# CONFIG_SCSI_DC390T is not set
376# CONFIG_SCSI_NSP32 is not set 597# CONFIG_SCSI_NSP32 is not set
@@ -398,6 +619,8 @@ CONFIG_SCSI_MAC53C94=y
398# Fusion MPT device support 619# Fusion MPT device support
399# 620#
400# CONFIG_FUSION is not set 621# CONFIG_FUSION is not set
622# CONFIG_FUSION_SPI is not set
623# CONFIG_FUSION_FC is not set
401 624
402# 625#
403# IEEE 1394 (FireWire) support 626# IEEE 1394 (FireWire) support
@@ -411,6 +634,7 @@ CONFIG_IEEE1394=m
411# CONFIG_IEEE1394_OUI_DB is not set 634# CONFIG_IEEE1394_OUI_DB is not set
412CONFIG_IEEE1394_EXTRA_CONFIG_ROMS=y 635CONFIG_IEEE1394_EXTRA_CONFIG_ROMS=y
413CONFIG_IEEE1394_CONFIG_ROM_IP1394=y 636CONFIG_IEEE1394_CONFIG_ROM_IP1394=y
637# CONFIG_IEEE1394_EXPORT_FULL_API is not set
414 638
415# 639#
416# Device Drivers 640# Device Drivers
@@ -441,8 +665,8 @@ CONFIG_IEEE1394_AMDTP=m
441CONFIG_ADB=y 665CONFIG_ADB=y
442CONFIG_ADB_CUDA=y 666CONFIG_ADB_CUDA=y
443CONFIG_ADB_PMU=y 667CONFIG_ADB_PMU=y
444CONFIG_PMAC_PBOOK=y
445CONFIG_PMAC_APM_EMU=y 668CONFIG_PMAC_APM_EMU=y
669CONFIG_PMAC_MEDIABAY=y
446CONFIG_PMAC_BACKLIGHT=y 670CONFIG_PMAC_BACKLIGHT=y
447CONFIG_ADB_MACIO=y 671CONFIG_ADB_MACIO=y
448CONFIG_INPUT_ADBHID=y 672CONFIG_INPUT_ADBHID=y
@@ -452,192 +676,13 @@ CONFIG_THERM_ADT746X=m
452# CONFIG_ANSLCD is not set 676# CONFIG_ANSLCD is not set
453 677
454# 678#
455# Networking support 679# Network device support
456#
457CONFIG_NET=y
458
459#
460# Networking options
461#
462CONFIG_PACKET=y
463# CONFIG_PACKET_MMAP is not set
464# CONFIG_NETLINK_DEV is not set
465CONFIG_UNIX=y
466# CONFIG_NET_KEY is not set
467CONFIG_INET=y
468CONFIG_IP_MULTICAST=y
469# CONFIG_IP_ADVANCED_ROUTER is not set
470# CONFIG_IP_PNP is not set
471# CONFIG_NET_IPIP is not set
472# CONFIG_NET_IPGRE is not set
473# CONFIG_IP_MROUTE is not set
474# CONFIG_ARPD is not set
475CONFIG_SYN_COOKIES=y
476# CONFIG_INET_AH is not set
477# CONFIG_INET_ESP is not set
478# CONFIG_INET_IPCOMP is not set
479# CONFIG_INET_TUNNEL is not set
480CONFIG_IP_TCPDIAG=y
481# CONFIG_IP_TCPDIAG_IPV6 is not set
482
483#
484# IP: Virtual Server Configuration
485#
486# CONFIG_IP_VS is not set
487# CONFIG_IPV6 is not set
488CONFIG_NETFILTER=y
489# CONFIG_NETFILTER_DEBUG is not set
490
491#
492# IP: Netfilter Configuration
493#
494CONFIG_IP_NF_CONNTRACK=m
495CONFIG_IP_NF_CT_ACCT=y
496CONFIG_IP_NF_CONNTRACK_MARK=y
497CONFIG_IP_NF_CT_PROTO_SCTP=m
498CONFIG_IP_NF_FTP=m
499CONFIG_IP_NF_IRC=m
500CONFIG_IP_NF_TFTP=m
501CONFIG_IP_NF_AMANDA=m
502CONFIG_IP_NF_QUEUE=m
503CONFIG_IP_NF_IPTABLES=m
504CONFIG_IP_NF_MATCH_LIMIT=m
505CONFIG_IP_NF_MATCH_IPRANGE=m
506CONFIG_IP_NF_MATCH_MAC=m
507CONFIG_IP_NF_MATCH_PKTTYPE=m
508CONFIG_IP_NF_MATCH_MARK=m
509CONFIG_IP_NF_MATCH_MULTIPORT=m
510CONFIG_IP_NF_MATCH_TOS=m
511CONFIG_IP_NF_MATCH_RECENT=m
512CONFIG_IP_NF_MATCH_ECN=m
513CONFIG_IP_NF_MATCH_DSCP=m
514CONFIG_IP_NF_MATCH_AH_ESP=m
515CONFIG_IP_NF_MATCH_LENGTH=m
516CONFIG_IP_NF_MATCH_TTL=m
517CONFIG_IP_NF_MATCH_TCPMSS=m
518CONFIG_IP_NF_MATCH_HELPER=m
519CONFIG_IP_NF_MATCH_STATE=m
520CONFIG_IP_NF_MATCH_CONNTRACK=m
521CONFIG_IP_NF_MATCH_OWNER=m
522CONFIG_IP_NF_MATCH_ADDRTYPE=m
523CONFIG_IP_NF_MATCH_REALM=m
524CONFIG_IP_NF_MATCH_SCTP=m
525CONFIG_IP_NF_MATCH_COMMENT=m
526CONFIG_IP_NF_MATCH_CONNMARK=m
527CONFIG_IP_NF_MATCH_HASHLIMIT=m
528CONFIG_IP_NF_FILTER=m
529CONFIG_IP_NF_TARGET_REJECT=m
530CONFIG_IP_NF_TARGET_LOG=m
531CONFIG_IP_NF_TARGET_ULOG=m
532CONFIG_IP_NF_TARGET_TCPMSS=m
533CONFIG_IP_NF_NAT=m
534CONFIG_IP_NF_NAT_NEEDED=y
535CONFIG_IP_NF_TARGET_MASQUERADE=m
536CONFIG_IP_NF_TARGET_REDIRECT=m
537CONFIG_IP_NF_TARGET_NETMAP=m
538CONFIG_IP_NF_TARGET_SAME=m
539CONFIG_IP_NF_NAT_SNMP_BASIC=m
540CONFIG_IP_NF_NAT_IRC=m
541CONFIG_IP_NF_NAT_FTP=m
542CONFIG_IP_NF_NAT_TFTP=m
543CONFIG_IP_NF_NAT_AMANDA=m
544CONFIG_IP_NF_MANGLE=m
545CONFIG_IP_NF_TARGET_TOS=m
546CONFIG_IP_NF_TARGET_ECN=m
547CONFIG_IP_NF_TARGET_DSCP=m
548CONFIG_IP_NF_TARGET_MARK=m
549CONFIG_IP_NF_TARGET_CLASSIFY=m
550CONFIG_IP_NF_TARGET_CONNMARK=m
551CONFIG_IP_NF_TARGET_CLUSTERIP=m
552CONFIG_IP_NF_RAW=m
553CONFIG_IP_NF_TARGET_NOTRACK=m
554CONFIG_IP_NF_ARPTABLES=m
555CONFIG_IP_NF_ARPFILTER=m
556CONFIG_IP_NF_ARP_MANGLE=m
557
558#
559# SCTP Configuration (EXPERIMENTAL)
560#
561# CONFIG_IP_SCTP is not set
562# CONFIG_ATM is not set
563# CONFIG_BRIDGE is not set
564# CONFIG_VLAN_8021Q is not set
565# CONFIG_DECNET is not set
566# CONFIG_LLC2 is not set
567# CONFIG_IPX is not set
568# CONFIG_ATALK is not set
569# CONFIG_X25 is not set
570# CONFIG_LAPB is not set
571# CONFIG_NET_DIVERT is not set
572# CONFIG_ECONET is not set
573# CONFIG_WAN_ROUTER is not set
574
575#
576# QoS and/or fair queueing
577#
578# CONFIG_NET_SCHED is not set
579CONFIG_NET_CLS_ROUTE=y
580
581#
582# Network testing
583#
584# CONFIG_NET_PKTGEN is not set
585# CONFIG_NETPOLL is not set
586# CONFIG_NET_POLL_CONTROLLER is not set
587# CONFIG_HAMRADIO is not set
588CONFIG_IRDA=m
589
590#
591# IrDA protocols
592#
593CONFIG_IRLAN=m
594CONFIG_IRNET=m
595CONFIG_IRCOMM=m
596# CONFIG_IRDA_ULTRA is not set
597
598#
599# IrDA options
600#
601CONFIG_IRDA_CACHE_LAST_LSAP=y
602CONFIG_IRDA_FAST_RR=y
603# CONFIG_IRDA_DEBUG is not set
604
605#
606# Infrared-port device drivers
607#
608
609#
610# SIR device drivers
611#
612CONFIG_IRTTY_SIR=m
613
614#
615# Dongle support
616#
617# CONFIG_DONGLE is not set
618
619#
620# Old SIR device drivers
621#
622# CONFIG_IRPORT_SIR is not set
623
624#
625# Old Serial dongle support
626#
627
628#
629# FIR device drivers
630# 680#
631# CONFIG_USB_IRDA is not set
632# CONFIG_SIGMATEL_FIR is not set
633# CONFIG_TOSHIBA_FIR is not set
634# CONFIG_VLSI_FIR is not set
635# CONFIG_BT is not set
636CONFIG_NETDEVICES=y 681CONFIG_NETDEVICES=y
637# CONFIG_DUMMY is not set 682# CONFIG_DUMMY is not set
638# CONFIG_BONDING is not set 683# CONFIG_BONDING is not set
639# CONFIG_EQUALIZER is not set 684# CONFIG_EQUALIZER is not set
640# CONFIG_TUN is not set 685CONFIG_TUN=m
641 686
642# 687#
643# ARCnet devices 688# ARCnet devices
@@ -691,9 +736,12 @@ CONFIG_PCNET32=y
691# CONFIG_HAMACHI is not set 736# CONFIG_HAMACHI is not set
692# CONFIG_YELLOWFIN is not set 737# CONFIG_YELLOWFIN is not set
693# CONFIG_R8169 is not set 738# CONFIG_R8169 is not set
739# CONFIG_SKGE is not set
694# CONFIG_SK98LIN is not set 740# CONFIG_SK98LIN is not set
695# CONFIG_VIA_VELOCITY is not set 741# CONFIG_VIA_VELOCITY is not set
696# CONFIG_TIGON3 is not set 742# CONFIG_TIGON3 is not set
743# CONFIG_BNX2 is not set
744# CONFIG_MV643XX_ETH is not set
697 745
698# 746#
699# Ethernet (10000 Mbit) 747# Ethernet (10000 Mbit)
@@ -768,7 +816,7 @@ CONFIG_PPPOE=m
768# CONFIG_SLIP is not set 816# CONFIG_SLIP is not set
769# CONFIG_NET_FC is not set 817# CONFIG_NET_FC is not set
770# CONFIG_SHAPER is not set 818# CONFIG_SHAPER is not set
771# CONFIG_NETCONSOLE is not set 819CONFIG_NETCONSOLE=m
772 820
773# 821#
774# ISDN subsystem 822# ISDN subsystem
@@ -798,14 +846,6 @@ CONFIG_INPUT_EVDEV=y
798# CONFIG_INPUT_EVBUG is not set 846# CONFIG_INPUT_EVBUG is not set
799 847
800# 848#
801# Input I/O drivers
802#
803# CONFIG_GAMEPORT is not set
804CONFIG_SOUND_GAMEPORT=y
805# CONFIG_SERIO is not set
806# CONFIG_SERIO_I8042 is not set
807
808#
809# Input Device Drivers 849# Input Device Drivers
810# 850#
811CONFIG_INPUT_KEYBOARD=y 851CONFIG_INPUT_KEYBOARD=y
@@ -823,6 +863,12 @@ CONFIG_INPUT_MOUSE=y
823# CONFIG_INPUT_MISC is not set 863# CONFIG_INPUT_MISC is not set
824 864
825# 865#
866# Hardware I/O ports
867#
868# CONFIG_SERIO is not set
869# CONFIG_GAMEPORT is not set
870
871#
826# Character devices 872# Character devices
827# 873#
828CONFIG_VT=y 874CONFIG_VT=y
@@ -845,6 +891,7 @@ CONFIG_SERIAL_CORE=y
845CONFIG_SERIAL_CORE_CONSOLE=y 891CONFIG_SERIAL_CORE_CONSOLE=y
846CONFIG_SERIAL_PMACZILOG=y 892CONFIG_SERIAL_PMACZILOG=y
847CONFIG_SERIAL_PMACZILOG_CONSOLE=y 893CONFIG_SERIAL_PMACZILOG_CONSOLE=y
894# CONFIG_SERIAL_JSM is not set
848CONFIG_UNIX98_PTYS=y 895CONFIG_UNIX98_PTYS=y
849CONFIG_LEGACY_PTYS=y 896CONFIG_LEGACY_PTYS=y
850CONFIG_LEGACY_PTY_COUNT=256 897CONFIG_LEGACY_PTY_COUNT=256
@@ -876,6 +923,7 @@ CONFIG_DRM_R128=m
876CONFIG_DRM_RADEON=m 923CONFIG_DRM_RADEON=m
877# CONFIG_DRM_MGA is not set 924# CONFIG_DRM_MGA is not set
878# CONFIG_DRM_SIS is not set 925# CONFIG_DRM_SIS is not set
926# CONFIG_DRM_VIA is not set
879 927
880# 928#
881# PCMCIA character devices 929# PCMCIA character devices
@@ -884,6 +932,11 @@ CONFIG_DRM_RADEON=m
884# CONFIG_RAW_DRIVER is not set 932# CONFIG_RAW_DRIVER is not set
885 933
886# 934#
935# TPM devices
936#
937# CONFIG_TCG_TPM is not set
938
939#
887# I2C support 940# I2C support
888# 941#
889CONFIG_I2C=y 942CONFIG_I2C=y
@@ -907,12 +960,12 @@ CONFIG_I2C_ALGOBIT=y
907# CONFIG_I2C_HYDRA is not set 960# CONFIG_I2C_HYDRA is not set
908# CONFIG_I2C_I801 is not set 961# CONFIG_I2C_I801 is not set
909# CONFIG_I2C_I810 is not set 962# CONFIG_I2C_I810 is not set
963# CONFIG_I2C_PIIX4 is not set
910# CONFIG_I2C_ISA is not set 964# CONFIG_I2C_ISA is not set
911CONFIG_I2C_KEYWEST=m 965CONFIG_I2C_KEYWEST=m
912# CONFIG_I2C_MPC is not set 966# CONFIG_I2C_MPC is not set
913# CONFIG_I2C_NFORCE2 is not set 967# CONFIG_I2C_NFORCE2 is not set
914# CONFIG_I2C_PARPORT_LIGHT is not set 968# CONFIG_I2C_PARPORT_LIGHT is not set
915# CONFIG_I2C_PIIX4 is not set
916# CONFIG_I2C_PROSAVAGE is not set 969# CONFIG_I2C_PROSAVAGE is not set
917# CONFIG_I2C_SAVAGE4 is not set 970# CONFIG_I2C_SAVAGE4 is not set
918# CONFIG_SCx200_ACB is not set 971# CONFIG_SCx200_ACB is not set
@@ -924,45 +977,20 @@ CONFIG_I2C_KEYWEST=m
924# CONFIG_I2C_VIAPRO is not set 977# CONFIG_I2C_VIAPRO is not set
925# CONFIG_I2C_VOODOO3 is not set 978# CONFIG_I2C_VOODOO3 is not set
926# CONFIG_I2C_PCA_ISA is not set 979# CONFIG_I2C_PCA_ISA is not set
980# CONFIG_I2C_SENSOR is not set
927 981
928# 982#
929# Hardware Sensors Chip support 983# Miscellaneous I2C Chip support
930#
931# CONFIG_I2C_SENSOR is not set
932# CONFIG_SENSORS_ADM1021 is not set
933# CONFIG_SENSORS_ADM1025 is not set
934# CONFIG_SENSORS_ADM1026 is not set
935# CONFIG_SENSORS_ADM1031 is not set
936# CONFIG_SENSORS_ASB100 is not set
937# CONFIG_SENSORS_DS1621 is not set
938# CONFIG_SENSORS_FSCHER is not set
939# CONFIG_SENSORS_GL518SM is not set
940# CONFIG_SENSORS_IT87 is not set
941# CONFIG_SENSORS_LM63 is not set
942# CONFIG_SENSORS_LM75 is not set
943# CONFIG_SENSORS_LM77 is not set
944# CONFIG_SENSORS_LM78 is not set
945# CONFIG_SENSORS_LM80 is not set
946# CONFIG_SENSORS_LM83 is not set
947# CONFIG_SENSORS_LM85 is not set
948# CONFIG_SENSORS_LM87 is not set
949# CONFIG_SENSORS_LM90 is not set
950# CONFIG_SENSORS_MAX1619 is not set
951# CONFIG_SENSORS_PC87360 is not set
952# CONFIG_SENSORS_SMSC47B397 is not set
953# CONFIG_SENSORS_SMSC47M1 is not set
954# CONFIG_SENSORS_VIA686A is not set
955# CONFIG_SENSORS_W83781D is not set
956# CONFIG_SENSORS_W83L785TS is not set
957# CONFIG_SENSORS_W83627HF is not set
958
959#
960# Other I2C Chip support
961# 984#
985# CONFIG_SENSORS_DS1337 is not set
986# CONFIG_SENSORS_DS1374 is not set
962# CONFIG_SENSORS_EEPROM is not set 987# CONFIG_SENSORS_EEPROM is not set
963# CONFIG_SENSORS_PCF8574 is not set 988# CONFIG_SENSORS_PCF8574 is not set
989# CONFIG_SENSORS_PCA9539 is not set
964# CONFIG_SENSORS_PCF8591 is not set 990# CONFIG_SENSORS_PCF8591 is not set
965# CONFIG_SENSORS_RTC8564 is not set 991# CONFIG_SENSORS_RTC8564 is not set
992# CONFIG_SENSORS_M41T00 is not set
993# CONFIG_SENSORS_MAX6875 is not set
966# CONFIG_I2C_DEBUG_CORE is not set 994# CONFIG_I2C_DEBUG_CORE is not set
967# CONFIG_I2C_DEBUG_ALGO is not set 995# CONFIG_I2C_DEBUG_ALGO is not set
968# CONFIG_I2C_DEBUG_BUS is not set 996# CONFIG_I2C_DEBUG_BUS is not set
@@ -974,6 +1002,11 @@ CONFIG_I2C_KEYWEST=m
974# CONFIG_W1 is not set 1002# CONFIG_W1 is not set
975 1003
976# 1004#
1005# Hardware Monitoring support
1006#
1007# CONFIG_HWMON is not set
1008
1009#
977# Misc devices 1010# Misc devices
978# 1011#
979 1012
@@ -991,6 +1024,11 @@ CONFIG_I2C_KEYWEST=m
991# Graphics support 1024# Graphics support
992# 1025#
993CONFIG_FB=y 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
994CONFIG_FB_MODE_HELPERS=y 1032CONFIG_FB_MODE_HELPERS=y
995CONFIG_FB_TILEBLITTING=y 1033CONFIG_FB_TILEBLITTING=y
996# CONFIG_FB_CIRRUS is not set 1034# CONFIG_FB_CIRRUS is not set
@@ -1004,6 +1042,7 @@ CONFIG_FB_CT65550=y
1004# CONFIG_FB_ASILIANT is not set 1042# CONFIG_FB_ASILIANT is not set
1005CONFIG_FB_IMSTT=y 1043CONFIG_FB_IMSTT=y
1006# CONFIG_FB_VGA16 is not set 1044# CONFIG_FB_VGA16 is not set
1045# CONFIG_FB_NVIDIA is not set
1007# CONFIG_FB_RIVA is not set 1046# CONFIG_FB_RIVA is not set
1008CONFIG_FB_MATROX=y 1047CONFIG_FB_MATROX=y
1009CONFIG_FB_MATROX_MILLENIUM=y 1048CONFIG_FB_MATROX_MILLENIUM=y
@@ -1029,6 +1068,7 @@ CONFIG_FB_3DFX=y
1029CONFIG_FB_3DFX_ACCEL=y 1068CONFIG_FB_3DFX_ACCEL=y
1030# CONFIG_FB_VOODOO1 is not set 1069# CONFIG_FB_VOODOO1 is not set
1031# CONFIG_FB_TRIDENT is not set 1070# CONFIG_FB_TRIDENT is not set
1071# CONFIG_FB_S1D13XXX is not set
1032# CONFIG_FB_VIRTUAL is not set 1072# CONFIG_FB_VIRTUAL is not set
1033 1073
1034# 1074#
@@ -1110,6 +1150,7 @@ CONFIG_SND_DUMMY=m
1110# CONFIG_SND_RME96 is not set 1150# CONFIG_SND_RME96 is not set
1111# CONFIG_SND_RME9652 is not set 1151# CONFIG_SND_RME9652 is not set
1112# CONFIG_SND_HDSP is not set 1152# CONFIG_SND_HDSP is not set
1153# CONFIG_SND_HDSPM is not set
1113# CONFIG_SND_TRIDENT is not set 1154# CONFIG_SND_TRIDENT is not set
1114# CONFIG_SND_YMFPCI is not set 1155# CONFIG_SND_YMFPCI is not set
1115# CONFIG_SND_ALS4000 is not set 1156# CONFIG_SND_ALS4000 is not set
@@ -1128,6 +1169,7 @@ CONFIG_SND_DUMMY=m
1128# CONFIG_SND_VIA82XX is not set 1169# CONFIG_SND_VIA82XX is not set
1129# CONFIG_SND_VIA82XX_MODEM is not set 1170# CONFIG_SND_VIA82XX_MODEM is not set
1130# CONFIG_SND_VX222 is not set 1171# CONFIG_SND_VX222 is not set
1172# CONFIG_SND_HDA_INTEL is not set
1131 1173
1132# 1174#
1133# ALSA PowerMac devices 1175# ALSA PowerMac devices
@@ -1152,6 +1194,8 @@ CONFIG_SND_USB_USX2Y=m
1152# 1194#
1153# USB support 1195# USB support
1154# 1196#
1197CONFIG_USB_ARCH_HAS_HCD=y
1198CONFIG_USB_ARCH_HAS_OHCI=y
1155CONFIG_USB=y 1199CONFIG_USB=y
1156# CONFIG_USB_DEBUG is not set 1200# CONFIG_USB_DEBUG is not set
1157 1201
@@ -1163,14 +1207,15 @@ CONFIG_USB_DEVICEFS=y
1163CONFIG_USB_DYNAMIC_MINORS=y 1207CONFIG_USB_DYNAMIC_MINORS=y
1164CONFIG_USB_SUSPEND=y 1208CONFIG_USB_SUSPEND=y
1165# CONFIG_USB_OTG is not set 1209# CONFIG_USB_OTG is not set
1166CONFIG_USB_ARCH_HAS_HCD=y
1167CONFIG_USB_ARCH_HAS_OHCI=y
1168 1210
1169# 1211#
1170# USB Host Controller Drivers 1212# USB Host Controller Drivers
1171# 1213#
1172# CONFIG_USB_EHCI_HCD is not set 1214# CONFIG_USB_EHCI_HCD is not set
1215# CONFIG_USB_ISP116X_HCD is not set
1173CONFIG_USB_OHCI_HCD=y 1216CONFIG_USB_OHCI_HCD=y
1217# CONFIG_USB_OHCI_BIG_ENDIAN is not set
1218CONFIG_USB_OHCI_LITTLE_ENDIAN=y
1174# CONFIG_USB_UHCI_HCD is not set 1219# CONFIG_USB_UHCI_HCD is not set
1175# CONFIG_USB_SL811_HCD is not set 1220# CONFIG_USB_SL811_HCD is not set
1176 1221
@@ -1197,12 +1242,15 @@ CONFIG_USB_HIDINPUT=y
1197CONFIG_USB_HIDDEV=y 1242CONFIG_USB_HIDDEV=y
1198# CONFIG_USB_AIPTEK is not set 1243# CONFIG_USB_AIPTEK is not set
1199# CONFIG_USB_WACOM is not set 1244# CONFIG_USB_WACOM is not set
1245# CONFIG_USB_ACECAD is not set
1200# CONFIG_USB_KBTAB is not set 1246# CONFIG_USB_KBTAB is not set
1201# CONFIG_USB_POWERMATE is not set 1247# CONFIG_USB_POWERMATE is not set
1202# CONFIG_USB_MTOUCH is not set 1248# CONFIG_USB_MTOUCH is not set
1249# CONFIG_USB_ITMTOUCH is not set
1203# CONFIG_USB_EGALAX is not set 1250# CONFIG_USB_EGALAX is not set
1204# CONFIG_USB_XPAD is not set 1251# CONFIG_USB_XPAD is not set
1205# CONFIG_USB_ATI_REMOTE is not set 1252# CONFIG_USB_ATI_REMOTE is not set
1253# CONFIG_USB_KEYSPAN_REMOTE is not set
1206 1254
1207# 1255#
1208# USB Imaging devices 1256# USB Imaging devices
@@ -1227,6 +1275,8 @@ CONFIG_USB_HIDDEV=y
1227CONFIG_USB_PEGASUS=m 1275CONFIG_USB_PEGASUS=m
1228# CONFIG_USB_RTL8150 is not set 1276# CONFIG_USB_RTL8150 is not set
1229# CONFIG_USB_USBNET is not set 1277# CONFIG_USB_USBNET is not set
1278# CONFIG_USB_ZD1201 is not set
1279# CONFIG_USB_MON is not set
1230 1280
1231# 1281#
1232# USB port drivers 1282# USB port drivers
@@ -1237,9 +1287,11 @@ CONFIG_USB_PEGASUS=m
1237# 1287#
1238CONFIG_USB_SERIAL=m 1288CONFIG_USB_SERIAL=m
1239# CONFIG_USB_SERIAL_GENERIC is not set 1289# CONFIG_USB_SERIAL_GENERIC is not set
1290# CONFIG_USB_SERIAL_AIRPRIME is not set
1240# CONFIG_USB_SERIAL_BELKIN is not set 1291# CONFIG_USB_SERIAL_BELKIN is not set
1241# CONFIG_USB_SERIAL_WHITEHEAT is not set 1292# CONFIG_USB_SERIAL_WHITEHEAT is not set
1242# CONFIG_USB_SERIAL_DIGI_ACCELEPORT is not set 1293# CONFIG_USB_SERIAL_DIGI_ACCELEPORT is not set
1294# CONFIG_USB_SERIAL_CP2101 is not set
1243# CONFIG_USB_SERIAL_CYPRESS_M8 is not set 1295# CONFIG_USB_SERIAL_CYPRESS_M8 is not set
1244# CONFIG_USB_SERIAL_EMPEG is not set 1296# CONFIG_USB_SERIAL_EMPEG is not set
1245# CONFIG_USB_SERIAL_FTDI_SIO is not set 1297# CONFIG_USB_SERIAL_FTDI_SIO is not set
@@ -1268,10 +1320,12 @@ CONFIG_USB_SERIAL_KEYSPAN_USA49WLC=y
1268# CONFIG_USB_SERIAL_KOBIL_SCT is not set 1320# CONFIG_USB_SERIAL_KOBIL_SCT is not set
1269# CONFIG_USB_SERIAL_MCT_U232 is not set 1321# CONFIG_USB_SERIAL_MCT_U232 is not set
1270# CONFIG_USB_SERIAL_PL2303 is not set 1322# CONFIG_USB_SERIAL_PL2303 is not set
1323# CONFIG_USB_SERIAL_HP4X is not set
1271# CONFIG_USB_SERIAL_SAFE is not set 1324# CONFIG_USB_SERIAL_SAFE is not set
1272# CONFIG_USB_SERIAL_TI is not set 1325# CONFIG_USB_SERIAL_TI is not set
1273# CONFIG_USB_SERIAL_CYBERJACK is not set 1326# CONFIG_USB_SERIAL_CYBERJACK is not set
1274# CONFIG_USB_SERIAL_XIRCOM is not set 1327# CONFIG_USB_SERIAL_XIRCOM is not set
1328# CONFIG_USB_SERIAL_OPTION is not set
1275# CONFIG_USB_SERIAL_OMNINET is not set 1329# CONFIG_USB_SERIAL_OMNINET is not set
1276CONFIG_USB_EZUSB=y 1330CONFIG_USB_EZUSB=y
1277 1331
@@ -1289,10 +1343,11 @@ CONFIG_USB_EZUSB=y
1289# CONFIG_USB_PHIDGETKIT is not set 1343# CONFIG_USB_PHIDGETKIT is not set
1290# CONFIG_USB_PHIDGETSERVO is not set 1344# CONFIG_USB_PHIDGETSERVO is not set
1291# CONFIG_USB_IDMOUSE is not set 1345# CONFIG_USB_IDMOUSE is not set
1346# CONFIG_USB_LD is not set
1292# CONFIG_USB_TEST is not set 1347# CONFIG_USB_TEST is not set
1293 1348
1294# 1349#
1295# USB ATM/DSL drivers 1350# USB DSL modem support
1296# 1351#
1297 1352
1298# 1353#
@@ -1311,12 +1366,17 @@ CONFIG_USB_EZUSB=y
1311# CONFIG_INFINIBAND is not set 1366# CONFIG_INFINIBAND is not set
1312 1367
1313# 1368#
1369# SN Devices
1370#
1371
1372#
1314# File systems 1373# File systems
1315# 1374#
1316CONFIG_EXT2_FS=y 1375CONFIG_EXT2_FS=y
1317CONFIG_EXT2_FS_XATTR=y 1376CONFIG_EXT2_FS_XATTR=y
1318# CONFIG_EXT2_FS_POSIX_ACL is not set 1377# CONFIG_EXT2_FS_POSIX_ACL is not set
1319# CONFIG_EXT2_FS_SECURITY is not set 1378# CONFIG_EXT2_FS_SECURITY is not set
1379# CONFIG_EXT2_FS_XIP is not set
1320CONFIG_EXT3_FS=y 1380CONFIG_EXT3_FS=y
1321CONFIG_EXT3_FS_XATTR=y 1381CONFIG_EXT3_FS_XATTR=y
1322# CONFIG_EXT3_FS_POSIX_ACL is not set 1382# CONFIG_EXT3_FS_POSIX_ACL is not set
@@ -1326,6 +1386,7 @@ CONFIG_JBD=y
1326CONFIG_FS_MBCACHE=y 1386CONFIG_FS_MBCACHE=y
1327# CONFIG_REISERFS_FS is not set 1387# CONFIG_REISERFS_FS is not set
1328# CONFIG_JFS_FS is not set 1388# CONFIG_JFS_FS is not set
1389CONFIG_FS_POSIX_ACL=y
1329 1390
1330# 1391#
1331# XFS support 1392# XFS support
@@ -1333,6 +1394,7 @@ CONFIG_FS_MBCACHE=y
1333# CONFIG_XFS_FS is not set 1394# CONFIG_XFS_FS is not set
1334# CONFIG_MINIX_FS is not set 1395# CONFIG_MINIX_FS is not set
1335# CONFIG_ROMFS_FS is not set 1396# CONFIG_ROMFS_FS is not set
1397CONFIG_INOTIFY=y
1336# CONFIG_QUOTA is not set 1398# CONFIG_QUOTA is not set
1337CONFIG_DNOTIFY=y 1399CONFIG_DNOTIFY=y
1338# CONFIG_AUTOFS_FS is not set 1400# CONFIG_AUTOFS_FS is not set
@@ -1363,7 +1425,6 @@ CONFIG_FAT_DEFAULT_IOCHARSET="iso8859-1"
1363CONFIG_PROC_FS=y 1425CONFIG_PROC_FS=y
1364CONFIG_PROC_KCORE=y 1426CONFIG_PROC_KCORE=y
1365CONFIG_SYSFS=y 1427CONFIG_SYSFS=y
1366# CONFIG_DEVFS_FS is not set
1367CONFIG_DEVPTS_FS_XATTR=y 1428CONFIG_DEVPTS_FS_XATTR=y
1368CONFIG_DEVPTS_FS_SECURITY=y 1429CONFIG_DEVPTS_FS_SECURITY=y
1369CONFIG_TMPFS=y 1430CONFIG_TMPFS=y
@@ -1394,15 +1455,20 @@ CONFIG_CRAMFS=m
1394# 1455#
1395CONFIG_NFS_FS=y 1456CONFIG_NFS_FS=y
1396CONFIG_NFS_V3=y 1457CONFIG_NFS_V3=y
1458CONFIG_NFS_V3_ACL=y
1397# CONFIG_NFS_V4 is not set 1459# CONFIG_NFS_V4 is not set
1398# CONFIG_NFS_DIRECTIO is not set 1460# CONFIG_NFS_DIRECTIO is not set
1399CONFIG_NFSD=y 1461CONFIG_NFSD=y
1462CONFIG_NFSD_V2_ACL=y
1400CONFIG_NFSD_V3=y 1463CONFIG_NFSD_V3=y
1464CONFIG_NFSD_V3_ACL=y
1401# CONFIG_NFSD_V4 is not set 1465# CONFIG_NFSD_V4 is not set
1402CONFIG_NFSD_TCP=y 1466CONFIG_NFSD_TCP=y
1403CONFIG_LOCKD=y 1467CONFIG_LOCKD=y
1404CONFIG_LOCKD_V4=y 1468CONFIG_LOCKD_V4=y
1405CONFIG_EXPORTFS=y 1469CONFIG_EXPORTFS=y
1470CONFIG_NFS_ACL_SUPPORT=y
1471CONFIG_NFS_COMMON=y
1406CONFIG_SUNRPC=y 1472CONFIG_SUNRPC=y
1407# CONFIG_RPCSEC_GSS_KRB5 is not set 1473# CONFIG_RPCSEC_GSS_KRB5 is not set
1408# CONFIG_RPCSEC_GSS_SPKM3 is not set 1474# CONFIG_RPCSEC_GSS_SPKM3 is not set
@@ -1494,8 +1560,10 @@ CONFIG_ZLIB_DEFLATE=y
1494# 1560#
1495# Kernel hacking 1561# Kernel hacking
1496# 1562#
1563# CONFIG_PRINTK_TIME is not set
1497CONFIG_DEBUG_KERNEL=y 1564CONFIG_DEBUG_KERNEL=y
1498CONFIG_MAGIC_SYSRQ=y 1565CONFIG_MAGIC_SYSRQ=y
1566CONFIG_LOG_BUF_SHIFT=16
1499# CONFIG_SCHEDSTATS is not set 1567# CONFIG_SCHEDSTATS is not set
1500# CONFIG_DEBUG_SLAB is not set 1568# CONFIG_DEBUG_SLAB is not set
1501# CONFIG_DEBUG_SPINLOCK is not set 1569# CONFIG_DEBUG_SPINLOCK is not set
diff --git a/arch/ppc/configs/radstone_ppc7d_defconfig b/arch/ppc/configs/radstone_ppc7d_defconfig
index 7f6467e77949..ca4d1fd0ca05 100644
--- a/arch/ppc/configs/radstone_ppc7d_defconfig
+++ b/arch/ppc/configs/radstone_ppc7d_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.11 3# Linux kernel version: 2.6.13-rc3
4# Tue Mar 15 14:31:19 2005 4# Tue Jul 26 00:02:09 2005
5# 5#
6CONFIG_MMU=y 6CONFIG_MMU=y
7CONFIG_GENERIC_HARDIRQS=y 7CONFIG_GENERIC_HARDIRQS=y
@@ -11,6 +11,7 @@ CONFIG_HAVE_DEC_LOCK=y
11CONFIG_PPC=y 11CONFIG_PPC=y
12CONFIG_PPC32=y 12CONFIG_PPC32=y
13CONFIG_GENERIC_NVRAM=y 13CONFIG_GENERIC_NVRAM=y
14CONFIG_SCHED_NO_NO_OMIT_FRAME_POINTER=y
14 15
15# 16#
16# Code maturity level options 17# Code maturity level options
@@ -18,6 +19,7 @@ CONFIG_GENERIC_NVRAM=y
18CONFIG_EXPERIMENTAL=y 19CONFIG_EXPERIMENTAL=y
19CONFIG_CLEAN_COMPILE=y 20CONFIG_CLEAN_COMPILE=y
20CONFIG_BROKEN_ON_SMP=y 21CONFIG_BROKEN_ON_SMP=y
22CONFIG_INIT_ENV_ARG_LIMIT=32
21 23
22# 24#
23# General setup 25# General setup
@@ -35,6 +37,8 @@ CONFIG_KOBJECT_UEVENT=y
35CONFIG_EMBEDDED=y 37CONFIG_EMBEDDED=y
36CONFIG_KALLSYMS=y 38CONFIG_KALLSYMS=y
37CONFIG_KALLSYMS_EXTRA_PASS=y 39CONFIG_KALLSYMS_EXTRA_PASS=y
40CONFIG_PRINTK=y
41CONFIG_BUG=y
38CONFIG_BASE_FULL=y 42CONFIG_BASE_FULL=y
39CONFIG_FUTEX=y 43CONFIG_FUTEX=y
40CONFIG_EPOLL=y 44CONFIG_EPOLL=y
@@ -67,9 +71,12 @@ CONFIG_6xx=y
67# CONFIG_POWER3 is not set 71# CONFIG_POWER3 is not set
68# CONFIG_POWER4 is not set 72# CONFIG_POWER4 is not set
69# CONFIG_8xx is not set 73# CONFIG_8xx is not set
74# CONFIG_E200 is not set
70# CONFIG_E500 is not set 75# CONFIG_E500 is not set
76CONFIG_PPC_FPU=y
71CONFIG_ALTIVEC=y 77CONFIG_ALTIVEC=y
72# CONFIG_TAU is not set 78# CONFIG_TAU is not set
79# CONFIG_KEXEC is not set
73# CONFIG_CPU_FREQ is not set 80# CONFIG_CPU_FREQ is not set
74CONFIG_PPC_GEN550=y 81CONFIG_PPC_GEN550=y
75# CONFIG_PM is not set 82# CONFIG_PM is not set
@@ -84,21 +91,18 @@ CONFIG_PPC_STD_MMU=y
84# CONFIG_KATANA is not set 91# CONFIG_KATANA is not set
85# CONFIG_WILLOW is not set 92# CONFIG_WILLOW is not set
86# CONFIG_CPCI690 is not set 93# CONFIG_CPCI690 is not set
87# CONFIG_PCORE is not set
88# CONFIG_POWERPMC250 is not set 94# CONFIG_POWERPMC250 is not set
89# CONFIG_CHESTNUT is not set 95# CONFIG_CHESTNUT is not set
90# CONFIG_SPRUCE is not set 96# CONFIG_SPRUCE is not set
97# CONFIG_HDPU is not set
91# CONFIG_EV64260 is not set 98# CONFIG_EV64260 is not set
92# CONFIG_LOPEC is not set 99# CONFIG_LOPEC is not set
93# CONFIG_MCPN765 is not set
94# CONFIG_MVME5100 is not set 100# CONFIG_MVME5100 is not set
95# CONFIG_PPLUS is not set 101# CONFIG_PPLUS is not set
96# CONFIG_PRPMC750 is not set 102# CONFIG_PRPMC750 is not set
97# CONFIG_PRPMC800 is not set 103# CONFIG_PRPMC800 is not set
98# CONFIG_SANDPOINT is not set 104# CONFIG_SANDPOINT is not set
99CONFIG_RADSTONE_PPC7D=y 105CONFIG_RADSTONE_PPC7D=y
100# CONFIG_ADIR is not set
101# CONFIG_K2 is not set
102# CONFIG_PAL4 is not set 106# CONFIG_PAL4 is not set
103# CONFIG_GEMINI is not set 107# CONFIG_GEMINI is not set
104# CONFIG_EST8260 is not set 108# CONFIG_EST8260 is not set
@@ -121,10 +125,18 @@ CONFIG_MV64X60_NEW_BASE=0xfef00000
121# CONFIG_SMP is not set 125# CONFIG_SMP is not set
122# CONFIG_PREEMPT is not set 126# CONFIG_PREEMPT is not set
123# CONFIG_HIGHMEM is not set 127# CONFIG_HIGHMEM is not set
128CONFIG_SELECT_MEMORY_MODEL=y
129CONFIG_FLATMEM_MANUAL=y
130# CONFIG_DISCONTIGMEM_MANUAL is not set
131# CONFIG_SPARSEMEM_MANUAL is not set
132CONFIG_FLATMEM=y
133CONFIG_FLAT_NODE_MEM_MAP=y
124CONFIG_BINFMT_ELF=y 134CONFIG_BINFMT_ELF=y
125CONFIG_BINFMT_MISC=y 135CONFIG_BINFMT_MISC=y
126CONFIG_CMDLINE_BOOL=y 136CONFIG_CMDLINE_BOOL=y
127CONFIG_CMDLINE="console=ttyS0,9600" 137CONFIG_CMDLINE="console=ttyS0,9600"
138CONFIG_SECCOMP=y
139CONFIG_ISA_DMA_API=y
128 140
129# 141#
130# Bus options 142# Bus options
@@ -155,6 +167,69 @@ CONFIG_TASK_SIZE=0x80000000
155CONFIG_BOOT_LOAD=0x00800000 167CONFIG_BOOT_LOAD=0x00800000
156 168
157# 169#
170# Networking
171#
172CONFIG_NET=y
173
174#
175# Networking options
176#
177CONFIG_PACKET=y
178# CONFIG_PACKET_MMAP is not set
179CONFIG_UNIX=y
180# CONFIG_NET_KEY is not set
181CONFIG_INET=y
182CONFIG_IP_MULTICAST=y
183# CONFIG_IP_ADVANCED_ROUTER is not set
184CONFIG_IP_FIB_HASH=y
185CONFIG_IP_PNP=y
186CONFIG_IP_PNP_DHCP=y
187CONFIG_IP_PNP_BOOTP=y
188# CONFIG_IP_PNP_RARP is not set
189# CONFIG_NET_IPIP is not set
190# CONFIG_NET_IPGRE is not set
191# CONFIG_IP_MROUTE is not set
192# CONFIG_ARPD is not set
193CONFIG_SYN_COOKIES=y
194# CONFIG_INET_AH is not set
195# CONFIG_INET_ESP is not set
196# CONFIG_INET_IPCOMP is not set
197# CONFIG_INET_TUNNEL is not set
198CONFIG_IP_TCPDIAG=y
199# CONFIG_IP_TCPDIAG_IPV6 is not set
200# CONFIG_TCP_CONG_ADVANCED is not set
201CONFIG_TCP_CONG_BIC=y
202# CONFIG_IPV6 is not set
203# CONFIG_NETFILTER is not set
204
205#
206# SCTP Configuration (EXPERIMENTAL)
207#
208# CONFIG_IP_SCTP is not set
209# CONFIG_ATM is not set
210CONFIG_BRIDGE=y
211# CONFIG_VLAN_8021Q is not set
212# CONFIG_DECNET is not set
213# CONFIG_LLC2 is not set
214# CONFIG_IPX is not set
215# CONFIG_ATALK is not set
216# CONFIG_X25 is not set
217# CONFIG_LAPB is not set
218# CONFIG_NET_DIVERT is not set
219# CONFIG_ECONET is not set
220# CONFIG_WAN_ROUTER is not set
221# CONFIG_NET_SCHED is not set
222# CONFIG_NET_CLS_ROUTE is not set
223
224#
225# Network testing
226#
227# CONFIG_NET_PKTGEN is not set
228# CONFIG_HAMRADIO is not set
229# CONFIG_IRDA is not set
230# CONFIG_BT is not set
231
232#
158# Device Drivers 233# Device Drivers
159# 234#
160 235
@@ -203,6 +278,7 @@ CONFIG_MTD_CFI_I1=y
203CONFIG_MTD_CFI_I2=y 278CONFIG_MTD_CFI_I2=y
204# CONFIG_MTD_CFI_I4 is not set 279# CONFIG_MTD_CFI_I4 is not set
205# CONFIG_MTD_CFI_I8 is not set 280# CONFIG_MTD_CFI_I8 is not set
281# CONFIG_MTD_OTP is not set
206CONFIG_MTD_CFI_INTELEXT=y 282CONFIG_MTD_CFI_INTELEXT=y
207# CONFIG_MTD_CFI_AMDSTD is not set 283# CONFIG_MTD_CFI_AMDSTD is not set
208# CONFIG_MTD_CFI_STAA is not set 284# CONFIG_MTD_CFI_STAA is not set
@@ -210,13 +286,13 @@ CONFIG_MTD_CFI_UTIL=y
210# CONFIG_MTD_RAM is not set 286# CONFIG_MTD_RAM is not set
211# CONFIG_MTD_ROM is not set 287# CONFIG_MTD_ROM is not set
212# CONFIG_MTD_ABSENT is not set 288# CONFIG_MTD_ABSENT is not set
213# CONFIG_MTD_XIP is not set
214 289
215# 290#
216# Mapping drivers for chip access 291# Mapping drivers for chip access
217# 292#
218# CONFIG_MTD_COMPLEX_MAPPINGS is not set 293# CONFIG_MTD_COMPLEX_MAPPINGS is not set
219# CONFIG_MTD_PHYSMAP is not set 294# CONFIG_MTD_PHYSMAP is not set
295# CONFIG_MTD_PLATRAM is not set
220 296
221# 297#
222# Self-contained MTD device drivers 298# Self-contained MTD device drivers
@@ -299,6 +375,7 @@ CONFIG_BLK_DEV_SD=y
299CONFIG_BLK_DEV_SR=y 375CONFIG_BLK_DEV_SR=y
300CONFIG_BLK_DEV_SR_VENDOR=y 376CONFIG_BLK_DEV_SR_VENDOR=y
301CONFIG_CHR_DEV_SG=y 377CONFIG_CHR_DEV_SG=y
378# CONFIG_CHR_DEV_SCH is not set
302 379
303# 380#
304# Some SCSI devices (e.g. CD jukebox) support multiple LUNs 381# Some SCSI devices (e.g. CD jukebox) support multiple LUNs
@@ -331,7 +408,6 @@ CONFIG_SCSI_SPI_ATTRS=y
331# CONFIG_SCSI_BUSLOGIC is not set 408# CONFIG_SCSI_BUSLOGIC is not set
332# CONFIG_SCSI_DMX3191D is not set 409# CONFIG_SCSI_DMX3191D is not set
333# CONFIG_SCSI_EATA is not set 410# CONFIG_SCSI_EATA is not set
334# CONFIG_SCSI_EATA_PIO is not set
335# CONFIG_SCSI_FUTURE_DOMAIN is not set 411# CONFIG_SCSI_FUTURE_DOMAIN is not set
336# CONFIG_SCSI_GDTH is not set 412# CONFIG_SCSI_GDTH is not set
337# CONFIG_SCSI_IPS is not set 413# CONFIG_SCSI_IPS is not set
@@ -343,7 +419,6 @@ CONFIG_SCSI_SYM53C8XX_DEFAULT_TAGS=16
343CONFIG_SCSI_SYM53C8XX_MAX_TAGS=64 419CONFIG_SCSI_SYM53C8XX_MAX_TAGS=64
344# CONFIG_SCSI_SYM53C8XX_IOMAPPED is not set 420# CONFIG_SCSI_SYM53C8XX_IOMAPPED is not set
345# CONFIG_SCSI_IPR is not set 421# CONFIG_SCSI_IPR is not set
346# CONFIG_SCSI_QLOGIC_ISP is not set
347# CONFIG_SCSI_QLOGIC_FC is not set 422# CONFIG_SCSI_QLOGIC_FC is not set
348# CONFIG_SCSI_QLOGIC_1280 is not set 423# CONFIG_SCSI_QLOGIC_1280 is not set
349CONFIG_SCSI_QLA2XXX=y 424CONFIG_SCSI_QLA2XXX=y
@@ -352,6 +427,7 @@ CONFIG_SCSI_QLA2XXX=y
352# CONFIG_SCSI_QLA2300 is not set 427# CONFIG_SCSI_QLA2300 is not set
353# CONFIG_SCSI_QLA2322 is not set 428# CONFIG_SCSI_QLA2322 is not set
354# CONFIG_SCSI_QLA6312 is not set 429# CONFIG_SCSI_QLA6312 is not set
430# CONFIG_SCSI_LPFC is not set
355# CONFIG_SCSI_DC395x is not set 431# CONFIG_SCSI_DC395x is not set
356# CONFIG_SCSI_DC390T is not set 432# CONFIG_SCSI_DC390T is not set
357# CONFIG_SCSI_NSP32 is not set 433# CONFIG_SCSI_NSP32 is not set
@@ -366,6 +442,8 @@ CONFIG_SCSI_QLA2XXX=y
366# Fusion MPT device support 442# Fusion MPT device support
367# 443#
368# CONFIG_FUSION is not set 444# CONFIG_FUSION is not set
445# CONFIG_FUSION_SPI is not set
446# CONFIG_FUSION_FC is not set
369 447
370# 448#
371# IEEE 1394 (FireWire) support 449# IEEE 1394 (FireWire) support
@@ -382,71 +460,8 @@ CONFIG_SCSI_QLA2XXX=y
382# 460#
383 461
384# 462#
385# Networking support 463# Network device support
386# 464#
387CONFIG_NET=y
388
389#
390# Networking options
391#
392CONFIG_PACKET=y
393# CONFIG_PACKET_MMAP is not set
394# CONFIG_NETLINK_DEV is not set
395CONFIG_UNIX=y
396# CONFIG_NET_KEY is not set
397CONFIG_INET=y
398CONFIG_IP_MULTICAST=y
399# CONFIG_IP_ADVANCED_ROUTER is not set
400CONFIG_IP_PNP=y
401CONFIG_IP_PNP_DHCP=y
402CONFIG_IP_PNP_BOOTP=y
403# CONFIG_IP_PNP_RARP is not set
404# CONFIG_NET_IPIP is not set
405# CONFIG_NET_IPGRE is not set
406# CONFIG_IP_MROUTE is not set
407# CONFIG_ARPD is not set
408CONFIG_SYN_COOKIES=y
409# CONFIG_INET_AH is not set
410# CONFIG_INET_ESP is not set
411# CONFIG_INET_IPCOMP is not set
412# CONFIG_INET_TUNNEL is not set
413CONFIG_IP_TCPDIAG=y
414# CONFIG_IP_TCPDIAG_IPV6 is not set
415# CONFIG_IPV6 is not set
416# CONFIG_NETFILTER is not set
417
418#
419# SCTP Configuration (EXPERIMENTAL)
420#
421# CONFIG_IP_SCTP is not set
422# CONFIG_ATM is not set
423CONFIG_BRIDGE=y
424# CONFIG_VLAN_8021Q is not set
425# CONFIG_DECNET is not set
426# CONFIG_LLC2 is not set
427# CONFIG_IPX is not set
428# CONFIG_ATALK is not set
429# CONFIG_X25 is not set
430# CONFIG_LAPB is not set
431# CONFIG_NET_DIVERT is not set
432# CONFIG_ECONET is not set
433# CONFIG_WAN_ROUTER is not set
434
435#
436# QoS and/or fair queueing
437#
438# CONFIG_NET_SCHED is not set
439# CONFIG_NET_CLS_ROUTE is not set
440
441#
442# Network testing
443#
444# CONFIG_NET_PKTGEN is not set
445# CONFIG_NETPOLL is not set
446# CONFIG_NET_POLL_CONTROLLER is not set
447# CONFIG_HAMRADIO is not set
448# CONFIG_IRDA is not set
449# CONFIG_BT is not set
450CONFIG_NETDEVICES=y 465CONFIG_NETDEVICES=y
451# CONFIG_DUMMY is not set 466# CONFIG_DUMMY is not set
452# CONFIG_BONDING is not set 467# CONFIG_BONDING is not set
@@ -511,9 +526,11 @@ CONFIG_E100=y
511# CONFIG_YELLOWFIN is not set 526# CONFIG_YELLOWFIN is not set
512CONFIG_R8169=y 527CONFIG_R8169=y
513CONFIG_R8169_NAPI=y 528CONFIG_R8169_NAPI=y
529# CONFIG_SKGE is not set
514CONFIG_SK98LIN=y 530CONFIG_SK98LIN=y
515# CONFIG_VIA_VELOCITY is not set 531# CONFIG_VIA_VELOCITY is not set
516CONFIG_TIGON3=y 532CONFIG_TIGON3=y
533# CONFIG_BNX2 is not set
517CONFIG_MV643XX_ETH=y 534CONFIG_MV643XX_ETH=y
518CONFIG_MV643XX_ETH_0=y 535CONFIG_MV643XX_ETH_0=y
519CONFIG_MV643XX_ETH_1=y 536CONFIG_MV643XX_ETH_1=y
@@ -546,6 +563,8 @@ CONFIG_MV643XX_ETH_1=y
546# CONFIG_NET_FC is not set 563# CONFIG_NET_FC is not set
547# CONFIG_SHAPER is not set 564# CONFIG_SHAPER is not set
548# CONFIG_NETCONSOLE is not set 565# CONFIG_NETCONSOLE is not set
566# CONFIG_NETPOLL is not set
567# CONFIG_NET_POLL_CONTROLLER is not set
549 568
550# 569#
551# ISDN subsystem 570# ISDN subsystem
@@ -598,7 +617,6 @@ CONFIG_SERIO_SERPORT=y
598CONFIG_SERIO_LIBPS2=y 617CONFIG_SERIO_LIBPS2=y
599# CONFIG_SERIO_RAW is not set 618# CONFIG_SERIO_RAW is not set
600# CONFIG_GAMEPORT is not set 619# CONFIG_GAMEPORT is not set
601CONFIG_SOUND_GAMEPORT=y
602 620
603# 621#
604# Character devices 622# Character devices
@@ -623,6 +641,7 @@ CONFIG_SERIAL_MPSC=y
623# CONFIG_SERIAL_MPSC_CONSOLE is not set 641# CONFIG_SERIAL_MPSC_CONSOLE is not set
624CONFIG_SERIAL_CORE=y 642CONFIG_SERIAL_CORE=y
625CONFIG_SERIAL_CORE_CONSOLE=y 643CONFIG_SERIAL_CORE_CONSOLE=y
644# CONFIG_SERIAL_JSM is not set
626CONFIG_UNIX98_PTYS=y 645CONFIG_UNIX98_PTYS=y
627CONFIG_LEGACY_PTYS=y 646CONFIG_LEGACY_PTYS=y
628CONFIG_LEGACY_PTY_COUNT=256 647CONFIG_LEGACY_PTY_COUNT=256
@@ -690,11 +709,11 @@ CONFIG_I2C_CHARDEV=y
690# CONFIG_I2C_AMD8111 is not set 709# CONFIG_I2C_AMD8111 is not set
691# CONFIG_I2C_I801 is not set 710# CONFIG_I2C_I801 is not set
692# CONFIG_I2C_I810 is not set 711# CONFIG_I2C_I810 is not set
712# CONFIG_I2C_PIIX4 is not set
693# CONFIG_I2C_ISA is not set 713# CONFIG_I2C_ISA is not set
694# CONFIG_I2C_MPC is not set 714# CONFIG_I2C_MPC is not set
695# CONFIG_I2C_NFORCE2 is not set 715# CONFIG_I2C_NFORCE2 is not set
696# CONFIG_I2C_PARPORT_LIGHT is not set 716# CONFIG_I2C_PARPORT_LIGHT is not set
697# CONFIG_I2C_PIIX4 is not set
698# CONFIG_I2C_PROSAVAGE is not set 717# CONFIG_I2C_PROSAVAGE is not set
699# CONFIG_I2C_SAVAGE4 is not set 718# CONFIG_I2C_SAVAGE4 is not set
700# CONFIG_SCx200_ACB is not set 719# CONFIG_SCx200_ACB is not set
@@ -707,16 +726,41 @@ CONFIG_I2C_CHARDEV=y
707# CONFIG_I2C_VOODOO3 is not set 726# CONFIG_I2C_VOODOO3 is not set
708# CONFIG_I2C_PCA_ISA is not set 727# CONFIG_I2C_PCA_ISA is not set
709CONFIG_I2C_MV64XXX=y 728CONFIG_I2C_MV64XXX=y
729CONFIG_I2C_SENSOR=y
710 730
711# 731#
712# Hardware Sensors Chip support 732# Miscellaneous I2C Chip support
713# 733#
714CONFIG_I2C_SENSOR=y 734CONFIG_SENSORS_DS1337=y
735# CONFIG_SENSORS_DS1374 is not set
736# CONFIG_SENSORS_EEPROM is not set
737# CONFIG_SENSORS_PCF8574 is not set
738# CONFIG_SENSORS_PCA9539 is not set
739# CONFIG_SENSORS_PCF8591 is not set
740# CONFIG_SENSORS_RTC8564 is not set
741# CONFIG_SENSORS_M41T00 is not set
742# CONFIG_SENSORS_MAX6875 is not set
743# CONFIG_I2C_DEBUG_CORE is not set
744# CONFIG_I2C_DEBUG_ALGO is not set
745# CONFIG_I2C_DEBUG_BUS is not set
746# CONFIG_I2C_DEBUG_CHIP is not set
747
748#
749# Dallas's 1-wire bus
750#
751# CONFIG_W1 is not set
752
753#
754# Hardware Monitoring support
755#
756CONFIG_HWMON=y
715# CONFIG_SENSORS_ADM1021 is not set 757# CONFIG_SENSORS_ADM1021 is not set
716# CONFIG_SENSORS_ADM1025 is not set 758# CONFIG_SENSORS_ADM1025 is not set
717# CONFIG_SENSORS_ADM1026 is not set 759# CONFIG_SENSORS_ADM1026 is not set
718# CONFIG_SENSORS_ADM1031 is not set 760# CONFIG_SENSORS_ADM1031 is not set
761# CONFIG_SENSORS_ADM9240 is not set
719# CONFIG_SENSORS_ASB100 is not set 762# CONFIG_SENSORS_ASB100 is not set
763# CONFIG_SENSORS_ATXP1 is not set
720# CONFIG_SENSORS_DS1621 is not set 764# CONFIG_SENSORS_DS1621 is not set
721# CONFIG_SENSORS_FSCHER is not set 765# CONFIG_SENSORS_FSCHER is not set
722# CONFIG_SENSORS_FSCPOS is not set 766# CONFIG_SENSORS_FSCPOS is not set
@@ -732,33 +776,18 @@ CONFIG_I2C_SENSOR=y
732# CONFIG_SENSORS_LM85 is not set 776# CONFIG_SENSORS_LM85 is not set
733# CONFIG_SENSORS_LM87 is not set 777# CONFIG_SENSORS_LM87 is not set
734CONFIG_SENSORS_LM90=y 778CONFIG_SENSORS_LM90=y
779# CONFIG_SENSORS_LM92 is not set
735# CONFIG_SENSORS_MAX1619 is not set 780# CONFIG_SENSORS_MAX1619 is not set
736# CONFIG_SENSORS_PC87360 is not set 781# CONFIG_SENSORS_PC87360 is not set
737# CONFIG_SENSORS_SMSC47B397 is not set
738# CONFIG_SENSORS_SIS5595 is not set 782# CONFIG_SENSORS_SIS5595 is not set
739# CONFIG_SENSORS_SMSC47M1 is not set 783# CONFIG_SENSORS_SMSC47M1 is not set
784# CONFIG_SENSORS_SMSC47B397 is not set
740# CONFIG_SENSORS_VIA686A is not set 785# CONFIG_SENSORS_VIA686A is not set
741# CONFIG_SENSORS_W83781D is not set 786# CONFIG_SENSORS_W83781D is not set
742# CONFIG_SENSORS_W83L785TS is not set 787# CONFIG_SENSORS_W83L785TS is not set
743# CONFIG_SENSORS_W83627HF is not set 788# CONFIG_SENSORS_W83627HF is not set
744 789# CONFIG_SENSORS_W83627EHF is not set
745# 790# CONFIG_HWMON_DEBUG_CHIP is not set
746# Other I2C Chip support
747#
748# CONFIG_SENSORS_EEPROM is not set
749# CONFIG_SENSORS_PCF8574 is not set
750# CONFIG_SENSORS_PCF8591 is not set
751# CONFIG_SENSORS_RTC8564 is not set
752# CONFIG_SENSORS_M41T00 is not set
753# CONFIG_I2C_DEBUG_CORE is not set
754# CONFIG_I2C_DEBUG_ALGO is not set
755# CONFIG_I2C_DEBUG_BUS is not set
756# CONFIG_I2C_DEBUG_CHIP is not set
757
758#
759# Dallas's 1-wire bus
760#
761# CONFIG_W1 is not set
762 791
763# 792#
764# Misc devices 793# Misc devices
@@ -813,14 +842,20 @@ CONFIG_USB_ARCH_HAS_OHCI=y
813# CONFIG_INFINIBAND is not set 842# CONFIG_INFINIBAND is not set
814 843
815# 844#
845# SN Devices
846#
847
848#
816# File systems 849# File systems
817# 850#
818CONFIG_EXT2_FS=y 851CONFIG_EXT2_FS=y
819# CONFIG_EXT2_FS_XATTR is not set 852# CONFIG_EXT2_FS_XATTR is not set
853# CONFIG_EXT2_FS_XIP is not set
820# CONFIG_EXT3_FS is not set 854# CONFIG_EXT3_FS is not set
821# CONFIG_JBD is not set 855# CONFIG_JBD is not set
822# CONFIG_REISERFS_FS is not set 856# CONFIG_REISERFS_FS is not set
823# CONFIG_JFS_FS is not set 857# CONFIG_JFS_FS is not set
858# CONFIG_FS_POSIX_ACL is not set
824 859
825# 860#
826# XFS support 861# XFS support
@@ -828,6 +863,7 @@ CONFIG_EXT2_FS=y
828# CONFIG_XFS_FS is not set 863# CONFIG_XFS_FS is not set
829# CONFIG_MINIX_FS is not set 864# CONFIG_MINIX_FS is not set
830# CONFIG_ROMFS_FS is not set 865# CONFIG_ROMFS_FS is not set
866CONFIG_INOTIFY=y
831# CONFIG_QUOTA is not set 867# CONFIG_QUOTA is not set
832CONFIG_DNOTIFY=y 868CONFIG_DNOTIFY=y
833# CONFIG_AUTOFS_FS is not set 869# CONFIG_AUTOFS_FS is not set
@@ -854,7 +890,6 @@ CONFIG_ISO9660_FS=y
854CONFIG_PROC_FS=y 890CONFIG_PROC_FS=y
855CONFIG_PROC_KCORE=y 891CONFIG_PROC_KCORE=y
856CONFIG_SYSFS=y 892CONFIG_SYSFS=y
857# CONFIG_DEVFS_FS is not set
858# CONFIG_DEVPTS_FS_XATTR is not set 893# CONFIG_DEVPTS_FS_XATTR is not set
859CONFIG_TMPFS=y 894CONFIG_TMPFS=y
860# CONFIG_TMPFS_XATTR is not set 895# CONFIG_TMPFS_XATTR is not set
@@ -874,8 +909,7 @@ CONFIG_RAMFS=y
874# CONFIG_JFFS_FS is not set 909# CONFIG_JFFS_FS is not set
875CONFIG_JFFS2_FS=y 910CONFIG_JFFS2_FS=y
876CONFIG_JFFS2_FS_DEBUG=0 911CONFIG_JFFS2_FS_DEBUG=0
877# CONFIG_JFFS2_FS_NAND is not set 912CONFIG_JFFS2_FS_WRITEBUFFER=y
878# CONFIG_JFFS2_FS_NOR_ECC is not set
879# CONFIG_JFFS2_COMPRESSION_OPTIONS is not set 913# CONFIG_JFFS2_COMPRESSION_OPTIONS is not set
880CONFIG_JFFS2_ZLIB=y 914CONFIG_JFFS2_ZLIB=y
881CONFIG_JFFS2_RTIME=y 915CONFIG_JFFS2_RTIME=y
@@ -892,12 +926,14 @@ CONFIG_JFFS2_RTIME=y
892# 926#
893CONFIG_NFS_FS=y 927CONFIG_NFS_FS=y
894CONFIG_NFS_V3=y 928CONFIG_NFS_V3=y
929# CONFIG_NFS_V3_ACL is not set
895# CONFIG_NFS_V4 is not set 930# CONFIG_NFS_V4 is not set
896# CONFIG_NFS_DIRECTIO is not set 931# CONFIG_NFS_DIRECTIO is not set
897# CONFIG_NFSD is not set 932# CONFIG_NFSD is not set
898CONFIG_ROOT_NFS=y 933CONFIG_ROOT_NFS=y
899CONFIG_LOCKD=y 934CONFIG_LOCKD=y
900CONFIG_LOCKD_V4=y 935CONFIG_LOCKD_V4=y
936CONFIG_NFS_COMMON=y
901CONFIG_SUNRPC=y 937CONFIG_SUNRPC=y
902# CONFIG_RPCSEC_GSS_KRB5 is not set 938# CONFIG_RPCSEC_GSS_KRB5 is not set
903# CONFIG_RPCSEC_GSS_SPKM3 is not set 939# CONFIG_RPCSEC_GSS_SPKM3 is not set
diff --git a/arch/ppc/configs/rainier_defconfig b/arch/ppc/configs/rainier_defconfig
deleted file mode 100644
index 4d4fcdc61bb7..000000000000
--- a/arch/ppc/configs/rainier_defconfig
+++ /dev/null
@@ -1,599 +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
7
8#
9# Code maturity level options
10#
11CONFIG_EXPERIMENTAL=y
12
13#
14# General setup
15#
16# CONFIG_SWAP is not set
17CONFIG_SYSVIPC=y
18# CONFIG_BSD_PROCESS_ACCT is not set
19CONFIG_SYSCTL=y
20CONFIG_LOG_BUF_SHIFT=14
21CONFIG_EMBEDDED=y
22CONFIG_FUTEX=y
23# CONFIG_EPOLL is not set
24
25#
26# Loadable module support
27#
28CONFIG_MODULES=y
29# CONFIG_MODULE_UNLOAD is not set
30CONFIG_OBSOLETE_MODPARM=y
31CONFIG_MODVERSIONS=y
32CONFIG_KMOD=y
33
34#
35# Platform support
36#
37CONFIG_PPC=y
38CONFIG_PPC32=y
39# CONFIG_6xx is not set
40CONFIG_40x=y
41# CONFIG_POWER3 is not set
42# CONFIG_8xx is not set
43CONFIG_4xx=y
44
45#
46# IBM 4xx options
47#
48# CONFIG_ASH is not set
49# CONFIG_BEECH is not set
50# CONFIG_CEDAR is not set
51# CONFIG_CPCI405 is not set
52# CONFIG_EP405 is not set
53# CONFIG_OAK is not set
54# CONFIG_REDWOOD_4 is not set
55# CONFIG_REDWOOD_5 is not set
56# CONFIG_REDWOOD_6 is not set
57# CONFIG_SYCAMORE is not set
58# CONFIG_TIVO is not set
59CONFIG_WALNUT=y
60CONFIG_IBM405_ERR77=y
61CONFIG_IBM405_ERR51=y
62CONFIG_IBM_OCP=y
63CONFIG_BIOS_FIXUP=y
64CONFIG_405GP=y
65CONFIG_IBM_OPENBIOS=y
66CONFIG_405_DMA=y
67# CONFIG_PM is not set
68CONFIG_UART0_TTYS0=y
69# CONFIG_UART0_TTYS1 is not set
70CONFIG_NOT_COHERENT_CACHE=y
71# CONFIG_SMP is not set
72# CONFIG_PREEMPT is not set
73# CONFIG_MATH_EMULATION is not set
74# CONFIG_CPU_FREQ is not set
75
76#
77# General setup
78#
79# CONFIG_HIGHMEM is not set
80CONFIG_PCI=y
81CONFIG_PCI_DOMAINS=y
82# CONFIG_PC_KEYBOARD is not set
83CONFIG_KCORE_ELF=y
84CONFIG_BINFMT_ELF=y
85CONFIG_KERNEL_ELF=y
86# CONFIG_BINFMT_MISC is not set
87# CONFIG_PCI_LEGACY_PROC is not set
88CONFIG_PCI_NAMES=y
89# CONFIG_HOTPLUG is not set
90
91#
92# Parallel port support
93#
94# CONFIG_PARPORT is not set
95# CONFIG_CMDLINE_BOOL is not set
96
97#
98# Advanced setup
99#
100# CONFIG_ADVANCED_OPTIONS is not set
101
102#
103# Default settings for advanced configuration options are used
104#
105CONFIG_HIGHMEM_START=0xfe000000
106CONFIG_LOWMEM_SIZE=0x30000000
107CONFIG_KERNEL_START=0xc0000000
108CONFIG_TASK_SIZE=0x80000000
109CONFIG_BOOT_LOAD=0x00400000
110
111#
112# Memory Technology Devices (MTD)
113#
114# CONFIG_MTD is not set
115
116#
117# Plug and Play support
118#
119# CONFIG_PNP is not set
120
121#
122# Block devices
123#
124# CONFIG_BLK_DEV_FD is not set
125# CONFIG_BLK_CPQ_DA is not set
126# CONFIG_BLK_CPQ_CISS_DA is not set
127# CONFIG_BLK_DEV_DAC960 is not set
128# CONFIG_BLK_DEV_UMEM is not set
129CONFIG_BLK_DEV_LOOP=y
130CONFIG_BLK_DEV_NBD=y
131CONFIG_BLK_DEV_RAM=y
132CONFIG_BLK_DEV_RAM_SIZE=4096
133CONFIG_BLK_DEV_INITRD=y
134
135#
136# Multi-device support (RAID and LVM)
137#
138# CONFIG_MD is not set
139
140#
141# ATA/IDE/MFM/RLL support
142#
143# CONFIG_IDE is not set
144
145#
146# SCSI support
147#
148# CONFIG_SCSI is not set
149
150#
151# Fusion MPT device support
152#
153
154#
155# IEEE 1394 (FireWire) support (EXPERIMENTAL)
156#
157# CONFIG_IEEE1394 is not set
158
159#
160# I2O device support
161#
162# CONFIG_I2O is not set
163
164#
165# Networking support
166#
167CONFIG_NET=y
168
169#
170# Networking options
171#
172CONFIG_PACKET=y
173# CONFIG_PACKET_MMAP is not set
174# CONFIG_NETLINK_DEV is not set
175# CONFIG_NETFILTER is not set
176CONFIG_UNIX=y
177# CONFIG_NET_KEY is not set
178CONFIG_INET=y
179CONFIG_IP_MULTICAST=y
180# CONFIG_IP_ADVANCED_ROUTER is not set
181CONFIG_IP_PNP=y
182# CONFIG_IP_PNP_DHCP is not set
183CONFIG_IP_PNP_BOOTP=y
184CONFIG_IP_PNP_RARP=y
185# CONFIG_NET_IPIP is not set
186# CONFIG_NET_IPGRE is not set
187# CONFIG_IP_MROUTE is not set
188# CONFIG_ARPD is not set
189# CONFIG_INET_ECN is not set
190CONFIG_SYN_COOKIES=y
191# CONFIG_INET_AH is not set
192# CONFIG_INET_ESP is not set
193# CONFIG_INET_IPCOMP is not set
194# CONFIG_IPV6 is not set
195# CONFIG_XFRM_USER is not set
196
197#
198# SCTP Configuration (EXPERIMENTAL)
199#
200CONFIG_IPV6_SCTP__=y
201# CONFIG_IP_SCTP is not set
202# CONFIG_ATM is not set
203# CONFIG_VLAN_8021Q is not set
204# CONFIG_LLC is not set
205# CONFIG_DECNET is not set
206# CONFIG_BRIDGE is not set
207# CONFIG_X25 is not set
208# CONFIG_LAPB is not set
209# CONFIG_NET_DIVERT is not set
210# CONFIG_ECONET is not set
211# CONFIG_WAN_ROUTER is not set
212# CONFIG_NET_HW_FLOWCONTROL is not set
213
214#
215# QoS and/or fair queueing
216#
217# CONFIG_NET_SCHED is not set
218
219#
220# Network testing
221#
222# CONFIG_NET_PKTGEN is not set
223CONFIG_NETDEVICES=y
224
225#
226# ARCnet devices
227#
228# CONFIG_ARCNET is not set
229# CONFIG_DUMMY is not set
230# CONFIG_BONDING is not set
231# CONFIG_EQUALIZER is not set
232# CONFIG_TUN is not set
233# CONFIG_ETHERTAP is not set
234
235#
236# Ethernet (10 or 100Mbit)
237#
238CONFIG_NET_ETHERNET=y
239CONFIG_MII=y
240# CONFIG_OAKNET is not set
241# CONFIG_HAPPYMEAL is not set
242# CONFIG_SUNGEM is not set
243# CONFIG_NET_VENDOR_3COM is not set
244
245#
246# Tulip family network device support
247#
248# CONFIG_NET_TULIP is not set
249# CONFIG_HP100 is not set
250CONFIG_NET_PCI=y
251CONFIG_PCNET32=y
252# CONFIG_AMD8111_ETH is not set
253# CONFIG_ADAPTEC_STARFIRE is not set
254# CONFIG_B44 is not set
255# CONFIG_DGRS is not set
256CONFIG_EEPRO100=y
257# CONFIG_EEPRO100_PIO is not set
258# CONFIG_E100 is not set
259# CONFIG_FEALNX is not set
260# CONFIG_NATSEMI is not set
261# CONFIG_NE2K_PCI is not set
262# CONFIG_8139CP is not set
263# CONFIG_8139TOO is not set
264# CONFIG_SIS900 is not set
265# CONFIG_EPIC100 is not set
266# CONFIG_SUNDANCE is not set
267# CONFIG_TLAN is not set
268# CONFIG_VIA_RHINE is not set
269
270#
271# Ethernet (1000 Mbit)
272#
273# CONFIG_ACENIC is not set
274# CONFIG_DL2K is not set
275# CONFIG_E1000 is not set
276# CONFIG_NS83820 is not set
277# CONFIG_HAMACHI is not set
278# CONFIG_YELLOWFIN is not set
279# CONFIG_R8169 is not set
280# CONFIG_SK98LIN is not set
281# CONFIG_TIGON3 is not set
282
283#
284# Ethernet (10000 Mbit)
285#
286# CONFIG_IXGB is not set
287# CONFIG_FDDI is not set
288# CONFIG_HIPPI is not set
289CONFIG_PPP=y
290# CONFIG_PPP_MULTILINK is not set
291# CONFIG_PPP_FILTER is not set
292# CONFIG_PPP_ASYNC is not set
293# CONFIG_PPP_SYNC_TTY is not set
294# CONFIG_PPP_DEFLATE is not set
295# CONFIG_PPP_BSDCOMP is not set
296# CONFIG_PPPOE is not set
297# CONFIG_SLIP is not set
298
299#
300# Wireless LAN (non-hamradio)
301#
302# CONFIG_NET_RADIO is not set
303
304#
305# Token Ring devices (depends on LLC=y)
306#
307# CONFIG_RCPCI is not set
308# CONFIG_SHAPER is not set
309
310#
311# Wan interfaces
312#
313# CONFIG_WAN is not set
314
315#
316# Amateur Radio support
317#
318# CONFIG_HAMRADIO is not set
319
320#
321# IrDA (infrared) support
322#
323# CONFIG_IRDA is not set
324
325#
326# ISDN subsystem
327#
328# CONFIG_ISDN_BOOL is not set
329
330#
331# Graphics support
332#
333# CONFIG_FB is not set
334
335#
336# Old CD-ROM drivers (not SCSI, not IDE)
337#
338# CONFIG_CD_NO_IDESCSI is not set
339
340#
341# Input device support
342#
343# CONFIG_INPUT is not set
344
345#
346# Userland interfaces
347#
348
349#
350# Input I/O drivers
351#
352# CONFIG_GAMEPORT is not set
353CONFIG_SOUND_GAMEPORT=y
354CONFIG_SERIO=y
355CONFIG_SERIO_I8042=y
356CONFIG_SERIO_SERPORT=y
357# CONFIG_SERIO_CT82C710 is not set
358
359#
360# Input Device Drivers
361#
362
363#
364# Macintosh device drivers
365#
366
367#
368# Character devices
369#
370# CONFIG_SERIAL_NONSTANDARD is not set
371
372#
373# Serial drivers
374#
375# CONFIG_SERIAL_8250 is not set
376
377#
378# Non-8250 serial port support
379#
380CONFIG_UNIX98_PTYS=y
381CONFIG_UNIX98_PTY_COUNT=256
382
383#
384# I2C support
385#
386CONFIG_I2C=y
387# CONFIG_I2C_ALGOBIT is not set
388# CONFIG_I2C_ALGOPCF is not set
389# CONFIG_I2C_IBM_OCP_ALGO is not set
390CONFIG_I2C_CHARDEV=y
391
392#
393# I2C Hardware Sensors Mainboard support
394#
395# CONFIG_I2C_ALI15X3 is not set
396# CONFIG_I2C_AMD756 is not set
397# CONFIG_I2C_AMD8111 is not set
398# CONFIG_I2C_I801 is not set
399# CONFIG_I2C_PIIX4 is not set
400# CONFIG_I2C_SIS96X is not set
401# CONFIG_I2C_VIAPRO is not set
402
403#
404# I2C Hardware Sensors Chip support
405#
406# CONFIG_SENSORS_ADM1021 is not set
407# CONFIG_SENSORS_IT87 is not set
408# CONFIG_SENSORS_LM75 is not set
409# CONFIG_SENSORS_LM85 is not set
410# CONFIG_SENSORS_VIA686A is not set
411# CONFIG_SENSORS_W83781D is not set
412# CONFIG_I2C_SENSOR is not set
413
414#
415# Mice
416#
417CONFIG_BUSMOUSE=y
418# CONFIG_QIC02_TAPE is not set
419
420#
421# IPMI
422#
423# CONFIG_IPMI_HANDLER is not set
424
425#
426# Watchdog Cards
427#
428CONFIG_WATCHDOG=y
429# CONFIG_WATCHDOG_NOWAYOUT is not set
430# CONFIG_SOFT_WATCHDOG is not set
431# CONFIG_WDT is not set
432# CONFIG_WDTPCI is not set
433# CONFIG_PCWATCHDOG is not set
434# CONFIG_ACQUIRE_WDT is not set
435# CONFIG_ADVANTECH_WDT is not set
436# CONFIG_EUROTECH_WDT is not set
437# CONFIG_IB700_WDT is not set
438# CONFIG_MIXCOMWD is not set
439# CONFIG_SCx200_WDT is not set
440# CONFIG_60XX_WDT is not set
441# CONFIG_W83877F_WDT is not set
442# CONFIG_MACHZ_WDT is not set
443# CONFIG_SC520_WDT is not set
444# CONFIG_AMD7XX_TCO is not set
445# CONFIG_ALIM7101_WDT is not set
446# CONFIG_SC1200_WDT is not set
447# CONFIG_WAFER_WDT is not set
448# CONFIG_CPU5_WDT is not set
449# CONFIG_NVRAM is not set
450CONFIG_GEN_RTC=y
451# CONFIG_GEN_RTC_X is not set
452# CONFIG_DTLK is not set
453# CONFIG_R3964 is not set
454# CONFIG_APPLICOM is not set
455
456#
457# Ftape, the floppy tape device driver
458#
459# CONFIG_FTAPE is not set
460# CONFIG_AGP is not set
461# CONFIG_DRM is not set
462# CONFIG_RAW_DRIVER is not set
463# CONFIG_HANGCHECK_TIMER is not set
464
465#
466# Multimedia devices
467#
468# CONFIG_VIDEO_DEV is not set
469
470#
471# Digital Video Broadcasting Devices
472#
473# CONFIG_DVB is not set
474
475#
476# File systems
477#
478CONFIG_EXT2_FS=y
479# CONFIG_EXT2_FS_XATTR is not set
480# CONFIG_EXT3_FS is not set
481# CONFIG_JBD is not set
482# CONFIG_REISERFS_FS is not set
483# CONFIG_JFS_FS is not set
484# CONFIG_XFS_FS is not set
485# CONFIG_MINIX_FS is not set
486# CONFIG_ROMFS_FS is not set
487# CONFIG_QUOTA is not set
488CONFIG_AUTOFS_FS=y
489# CONFIG_AUTOFS4_FS is not set
490
491#
492# CD-ROM/DVD Filesystems
493#
494CONFIG_ISO9660_FS=y
495# CONFIG_JOLIET is not set
496# CONFIG_ZISOFS is not set
497# CONFIG_UDF_FS is not set
498
499#
500# DOS/FAT/NT Filesystems
501#
502# CONFIG_FAT_FS is not set
503# CONFIG_NTFS_FS is not set
504
505#
506# Pseudo filesystems
507#
508CONFIG_PROC_FS=y
509# CONFIG_DEVFS_FS is not set
510CONFIG_DEVPTS_FS=y
511# CONFIG_DEVPTS_FS_XATTR is not set
512CONFIG_TMPFS=y
513CONFIG_RAMFS=y
514
515#
516# Miscellaneous filesystems
517#
518# CONFIG_ADFS_FS is not set
519# CONFIG_AFFS_FS is not set
520# CONFIG_HFS_FS is not set
521# CONFIG_BEFS_FS is not set
522# CONFIG_BFS_FS is not set
523# CONFIG_EFS_FS is not set
524# CONFIG_CRAMFS is not set
525# CONFIG_VXFS_FS is not set
526# CONFIG_HPFS_FS is not set
527# CONFIG_QNX4FS_FS is not set
528# CONFIG_SYSV_FS is not set
529# CONFIG_UFS_FS is not set
530
531#
532# Network File Systems
533#
534CONFIG_NFS_FS=y
535# CONFIG_NFS_V3 is not set
536# CONFIG_NFS_V4 is not set
537CONFIG_NFSD=y
538# CONFIG_NFSD_V3 is not set
539# CONFIG_NFSD_TCP is not set
540CONFIG_ROOT_NFS=y
541CONFIG_LOCKD=y
542CONFIG_EXPORTFS=y
543CONFIG_SUNRPC=y
544# CONFIG_SUNRPC_GSS is not set
545# CONFIG_SMB_FS is not set
546# CONFIG_CIFS is not set
547# CONFIG_NCP_FS is not set
548# CONFIG_CODA_FS is not set
549# CONFIG_INTERMEZZO_FS is not set
550# CONFIG_AFS_FS is not set
551
552#
553# Partition Types
554#
555# CONFIG_PARTITION_ADVANCED is not set
556CONFIG_MSDOS_PARTITION=y
557
558#
559# Sound
560#
561# CONFIG_SOUND is not set
562
563#
564# IBM 40x options
565#
566
567#
568# USB support
569#
570# CONFIG_USB is not set
571# CONFIG_USB_GADGET is not set
572
573#
574# Bluetooth support
575#
576# CONFIG_BT is not set
577
578#
579# Library routines
580#
581# CONFIG_CRC32 is not set
582
583#
584# Kernel hacking
585#
586# CONFIG_DEBUG_KERNEL is not set
587# CONFIG_KALLSYMS is not set
588# CONFIG_SERIAL_TEXT_DEBUG is not set
589CONFIG_OCP=y
590
591#
592# Security options
593#
594# CONFIG_SECURITY is not set
595
596#
597# Cryptographic options
598#
599# CONFIG_CRYPTO is not set
diff --git a/arch/ppc/configs/redwood_defconfig b/arch/ppc/configs/redwood_defconfig
deleted file mode 100644
index 4aa348dcf22c..000000000000
--- a/arch/ppc/configs/redwood_defconfig
+++ /dev/null
@@ -1,540 +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
9
10#
11# Code maturity level options
12#
13CONFIG_EXPERIMENTAL=y
14CONFIG_CLEAN_COMPILE=y
15# CONFIG_STANDALONE is not set
16CONFIG_BROKEN_ON_SMP=y
17
18#
19# General setup
20#
21CONFIG_SWAP=y
22CONFIG_SYSVIPC=y
23# CONFIG_BSD_PROCESS_ACCT is not set
24CONFIG_SYSCTL=y
25CONFIG_LOG_BUF_SHIFT=14
26# CONFIG_IKCONFIG is not set
27CONFIG_EMBEDDED=y
28# CONFIG_KALLSYMS is not set
29CONFIG_FUTEX=y
30# CONFIG_EPOLL is not set
31CONFIG_IOSCHED_NOOP=y
32CONFIG_IOSCHED_AS=y
33CONFIG_IOSCHED_DEADLINE=y
34
35#
36# Loadable module support
37#
38CONFIG_MODULES=y
39# CONFIG_MODULE_UNLOAD is not set
40CONFIG_OBSOLETE_MODPARM=y
41# CONFIG_MODVERSIONS is not set
42CONFIG_KMOD=y
43
44#
45# Processor
46#
47# CONFIG_6xx is not set
48CONFIG_40x=y
49# CONFIG_44x is not set
50# CONFIG_POWER3 is not set
51# CONFIG_POWER4 is not set
52# CONFIG_8xx is not set
53# CONFIG_MATH_EMULATION is not set
54# CONFIG_CPU_FREQ is not set
55CONFIG_4xx=y
56
57#
58# IBM 4xx options
59#
60# CONFIG_ASH is not set
61# CONFIG_BEECH is not set
62# CONFIG_CEDAR is not set
63# CONFIG_CPCI405 is not set
64# CONFIG_EP405 is not set
65# CONFIG_OAK is not set
66CONFIG_REDWOOD_4=y
67# CONFIG_REDWOOD_5 is not set
68# CONFIG_REDWOOD_6 is not set
69# CONFIG_SYCAMORE is not set
70# CONFIG_TIVO is not set
71# CONFIG_WALNUT is not set
72CONFIG_IBM405_ERR77=y
73CONFIG_IBM405_ERR51=y
74CONFIG_IBM_OCP=y
75CONFIG_STB03xxx=y
76CONFIG_IBM_OPENBIOS=y
77# CONFIG_405_DMA is not set
78# CONFIG_PM is not set
79CONFIG_UART0_TTYS0=y
80# CONFIG_UART0_TTYS1 is not set
81# CONFIG_SERIAL_SICC is not set
82CONFIG_NOT_COHERENT_CACHE=y
83
84#
85# Platform options
86#
87# CONFIG_PC_KEYBOARD is not set
88# CONFIG_SMP is not set
89# CONFIG_PREEMPT is not set
90# CONFIG_HIGHMEM is not set
91CONFIG_KERNEL_ELF=y
92CONFIG_BINFMT_ELF=y
93# CONFIG_BINFMT_MISC is not set
94# CONFIG_CMDLINE_BOOL is not set
95
96#
97# Bus options
98#
99# CONFIG_PCI is not set
100# CONFIG_PCI_DOMAINS is not set
101# CONFIG_HOTPLUG is not set
102
103#
104# Parallel port support
105#
106# CONFIG_PARPORT is not set
107
108#
109# Advanced setup
110#
111# CONFIG_ADVANCED_OPTIONS is not set
112
113#
114# Default settings for advanced configuration options are used
115#
116CONFIG_HIGHMEM_START=0xfe000000
117CONFIG_LOWMEM_SIZE=0x30000000
118CONFIG_KERNEL_START=0xc0000000
119CONFIG_TASK_SIZE=0x80000000
120CONFIG_BOOT_LOAD=0x00400000
121
122#
123# Generic Driver Options
124#
125
126#
127# Memory Technology Devices (MTD)
128#
129# CONFIG_MTD is not set
130
131#
132# Plug and Play support
133#
134# CONFIG_PNP is not set
135
136#
137# Block devices
138#
139CONFIG_BLK_DEV_LOOP=y
140# CONFIG_BLK_DEV_CRYPTOLOOP is not set
141# CONFIG_BLK_DEV_NBD is not set
142CONFIG_BLK_DEV_RAM=y
143CONFIG_BLK_DEV_RAM_SIZE=4096
144CONFIG_BLK_DEV_INITRD=y
145# CONFIG_LBD is not set
146
147#
148# Multi-device support (RAID and LVM)
149#
150# CONFIG_MD is not set
151
152#
153# ATA/ATAPI/MFM/RLL support
154#
155# CONFIG_IDE is not set
156
157#
158# SCSI device support
159#
160# CONFIG_SCSI is not set
161
162#
163# Fusion MPT device support
164#
165
166#
167# I2O device support
168#
169
170#
171# Networking support
172#
173CONFIG_NET=y
174
175#
176# Networking options
177#
178# CONFIG_PACKET is not set
179# CONFIG_NETLINK_DEV is not set
180CONFIG_UNIX=y
181# CONFIG_NET_KEY is not set
182CONFIG_INET=y
183CONFIG_IP_MULTICAST=y
184# CONFIG_IP_ADVANCED_ROUTER is not set
185CONFIG_IP_PNP=y
186CONFIG_IP_PNP_DHCP=y
187CONFIG_IP_PNP_BOOTP=y
188CONFIG_IP_PNP_RARP=y
189# CONFIG_NET_IPIP is not set
190# CONFIG_NET_IPGRE is not set
191# CONFIG_IP_MROUTE is not set
192# CONFIG_ARPD is not set
193# CONFIG_INET_ECN is not set
194CONFIG_SYN_COOKIES=y
195# CONFIG_INET_AH is not set
196# CONFIG_INET_ESP is not set
197# CONFIG_INET_IPCOMP is not set
198# CONFIG_IPV6 is not set
199# CONFIG_DECNET is not set
200# CONFIG_BRIDGE is not set
201# CONFIG_NETFILTER is not set
202
203#
204# SCTP Configuration (EXPERIMENTAL)
205#
206CONFIG_IPV6_SCTP__=y
207# CONFIG_IP_SCTP is not set
208# CONFIG_ATM is not set
209# CONFIG_VLAN_8021Q is not set
210# CONFIG_LLC2 is not set
211# CONFIG_IPX is not set
212# CONFIG_ATALK is not set
213# CONFIG_X25 is not set
214# CONFIG_LAPB is not set
215# CONFIG_NET_DIVERT is not set
216# CONFIG_ECONET is not set
217# CONFIG_WAN_ROUTER is not set
218# CONFIG_NET_HW_FLOWCONTROL is not set
219
220#
221# QoS and/or fair queueing
222#
223# CONFIG_NET_SCHED is not set
224
225#
226# Network testing
227#
228# CONFIG_NET_PKTGEN is not set
229CONFIG_NETDEVICES=y
230# CONFIG_DUMMY is not set
231# CONFIG_BONDING is not set
232# CONFIG_EQUALIZER is not set
233# CONFIG_TUN is not set
234
235#
236# Ethernet (10 or 100Mbit)
237#
238CONFIG_NET_ETHERNET=y
239CONFIG_MII=y
240CONFIG_OAKNET=y
241
242#
243# Ethernet (1000 Mbit)
244#
245
246#
247# Ethernet (10000 Mbit)
248#
249# CONFIG_PPP is not set
250# CONFIG_SLIP is not set
251
252#
253# Wireless LAN (non-hamradio)
254#
255# CONFIG_NET_RADIO is not set
256
257#
258# Token Ring devices
259#
260# CONFIG_SHAPER is not set
261
262#
263# Wan interfaces
264#
265# CONFIG_WAN is not set
266
267#
268# Amateur Radio support
269#
270# CONFIG_HAMRADIO is not set
271
272#
273# IrDA (infrared) support
274#
275# CONFIG_IRDA is not set
276
277#
278# Bluetooth support
279#
280# CONFIG_BT is not set
281
282#
283# ISDN subsystem
284#
285# CONFIG_ISDN_BOOL is not set
286
287#
288# Graphics support
289#
290# CONFIG_FB is not set
291
292#
293# Input device support
294#
295CONFIG_INPUT=y
296
297#
298# Userland interfaces
299#
300# CONFIG_INPUT_MOUSEDEV is not set
301# CONFIG_INPUT_JOYDEV is not set
302# CONFIG_INPUT_TSDEV is not set
303# CONFIG_INPUT_EVDEV is not set
304# CONFIG_INPUT_EVBUG is not set
305
306#
307# Input I/O drivers
308#
309# CONFIG_GAMEPORT is not set
310CONFIG_SOUND_GAMEPORT=y
311CONFIG_SERIO=y
312# CONFIG_SERIO_I8042 is not set
313# CONFIG_SERIO_SERPORT is not set
314# CONFIG_SERIO_CT82C710 is not set
315
316#
317# Input Device Drivers
318#
319# CONFIG_INPUT_KEYBOARD is not set
320# CONFIG_INPUT_MOUSE is not set
321# CONFIG_INPUT_JOYSTICK is not set
322# CONFIG_INPUT_TOUCHSCREEN is not set
323# CONFIG_INPUT_MISC is not set
324
325#
326# Macintosh device drivers
327#
328
329#
330# Character devices
331#
332# CONFIG_VT is not set
333# CONFIG_SERIAL_NONSTANDARD is not set
334
335#
336# Serial drivers
337#
338CONFIG_SERIAL_8250=y
339CONFIG_SERIAL_8250_CONSOLE=y
340CONFIG_SERIAL_8250_NR_UARTS=4
341# CONFIG_SERIAL_8250_EXTENDED is not set
342
343#
344# Non-8250 serial port support
345#
346CONFIG_SERIAL_CORE=y
347CONFIG_SERIAL_CORE_CONSOLE=y
348# CONFIG_UNIX98_PTYS is not set
349
350#
351# I2C support
352#
353CONFIG_I2C=y
354# CONFIG_I2C_CHARDEV is not set
355
356#
357# I2C Algorithms
358#
359# CONFIG_I2C_ALGOBIT is not set
360# CONFIG_I2C_ALGOPCF is not set
361
362#
363# I2C Hardware Bus support
364#
365# CONFIG_I2C_AMD756 is not set
366# CONFIG_I2C_AMD8111 is not set
367CONFIG_I2C_IBM_IIC=y
368
369#
370# I2C Hardware Sensors Chip support
371#
372# CONFIG_I2C_SENSOR is not set
373# CONFIG_SENSORS_ADM1021 is not set
374# CONFIG_SENSORS_EEPROM is not set
375# CONFIG_SENSORS_IT87 is not set
376# CONFIG_SENSORS_LM75 is not set
377# CONFIG_SENSORS_LM78 is not set
378# CONFIG_SENSORS_LM85 is not set
379# CONFIG_SENSORS_VIA686A is not set
380# CONFIG_SENSORS_W83781D is not set
381
382#
383# Mice
384#
385# CONFIG_BUSMOUSE is not set
386# CONFIG_QIC02_TAPE is not set
387
388#
389# IPMI
390#
391# CONFIG_IPMI_HANDLER is not set
392
393#
394# Watchdog Cards
395#
396# CONFIG_WATCHDOG is not set
397# CONFIG_NVRAM is not set
398CONFIG_GEN_RTC=y
399# CONFIG_GEN_RTC_X is not set
400# CONFIG_DTLK is not set
401# CONFIG_R3964 is not set
402# CONFIG_APPLICOM is not set
403
404#
405# Ftape, the floppy tape device driver
406#
407# CONFIG_FTAPE is not set
408# CONFIG_AGP is not set
409# CONFIG_DRM is not set
410# CONFIG_RAW_DRIVER is not set
411
412#
413# Multimedia devices
414#
415# CONFIG_VIDEO_DEV is not set
416
417#
418# Digital Video Broadcasting Devices
419#
420# CONFIG_DVB is not set
421
422#
423# File systems
424#
425CONFIG_EXT2_FS=y
426# CONFIG_EXT2_FS_XATTR is not set
427CONFIG_EXT3_FS=y
428CONFIG_EXT3_FS_XATTR=y
429# CONFIG_EXT3_FS_POSIX_ACL is not set
430# CONFIG_EXT3_FS_SECURITY is not set
431CONFIG_JBD=y
432# CONFIG_JBD_DEBUG is not set
433CONFIG_FS_MBCACHE=y
434# CONFIG_REISERFS_FS is not set
435# CONFIG_JFS_FS is not set
436# CONFIG_XFS_FS is not set
437# CONFIG_MINIX_FS is not set
438# CONFIG_ROMFS_FS is not set
439# CONFIG_QUOTA is not set
440# CONFIG_AUTOFS_FS is not set
441# CONFIG_AUTOFS4_FS is not set
442
443#
444# CD-ROM/DVD Filesystems
445#
446# CONFIG_ISO9660_FS is not set
447# CONFIG_UDF_FS is not set
448
449#
450# DOS/FAT/NT Filesystems
451#
452# CONFIG_FAT_FS is not set
453# CONFIG_NTFS_FS is not set
454
455#
456# Pseudo filesystems
457#
458CONFIG_PROC_FS=y
459CONFIG_PROC_KCORE=y
460# CONFIG_DEVFS_FS is not set
461CONFIG_TMPFS=y
462# CONFIG_HUGETLB_PAGE is not set
463CONFIG_RAMFS=y
464
465#
466# Miscellaneous filesystems
467#
468# CONFIG_ADFS_FS is not set
469# CONFIG_AFFS_FS is not set
470# CONFIG_HFS_FS is not set
471# CONFIG_BEFS_FS is not set
472# CONFIG_BFS_FS is not set
473# CONFIG_EFS_FS is not set
474# CONFIG_CRAMFS is not set
475# CONFIG_VXFS_FS is not set
476# CONFIG_HPFS_FS is not set
477# CONFIG_QNX4FS_FS is not set
478# CONFIG_SYSV_FS is not set
479# CONFIG_UFS_FS is not set
480
481#
482# Network File Systems
483#
484CONFIG_NFS_FS=y
485# CONFIG_NFS_V3 is not set
486# CONFIG_NFS_V4 is not set
487# CONFIG_NFSD is not set
488CONFIG_ROOT_NFS=y
489CONFIG_LOCKD=y
490# CONFIG_EXPORTFS is not set
491CONFIG_SUNRPC=y
492# CONFIG_SUNRPC_GSS is not set
493# CONFIG_SMB_FS is not set
494# CONFIG_CIFS is not set
495# CONFIG_NCP_FS is not set
496# CONFIG_CODA_FS is not set
497# CONFIG_INTERMEZZO_FS is not set
498# CONFIG_AFS_FS is not set
499
500#
501# Partition Types
502#
503# CONFIG_PARTITION_ADVANCED is not set
504CONFIG_MSDOS_PARTITION=y
505
506#
507# Sound
508#
509# CONFIG_SOUND is not set
510
511#
512# IBM 40x options
513#
514
515#
516# USB support
517#
518# CONFIG_USB_GADGET is not set
519
520#
521# Library routines
522#
523CONFIG_CRC32=y
524
525#
526# Kernel hacking
527#
528# CONFIG_DEBUG_KERNEL is not set
529CONFIG_SERIAL_TEXT_DEBUG=y
530CONFIG_OCP=y
531
532#
533# Security options
534#
535# CONFIG_SECURITY is not set
536
537#
538# Cryptographic options
539#
540# CONFIG_CRYPTO is not set
diff --git a/arch/ppc/configs/sandpoint_defconfig b/arch/ppc/configs/sandpoint_defconfig
index 0f4393a07f82..fb493a67c60d 100644
--- a/arch/ppc/configs/sandpoint_defconfig
+++ b/arch/ppc/configs/sandpoint_defconfig
@@ -437,7 +437,7 @@ CONFIG_SOUND_GAMEPORT=y
437# 437#
438CONFIG_SERIAL_8250=y 438CONFIG_SERIAL_8250=y
439CONFIG_SERIAL_8250_CONSOLE=y 439CONFIG_SERIAL_8250_CONSOLE=y
440CONFIG_SERIAL_8250_NR_UARTS=2 440CONFIG_SERIAL_8250_NR_UARTS=4
441# CONFIG_SERIAL_8250_EXTENDED is not set 441# CONFIG_SERIAL_8250_EXTENDED is not set
442 442
443# 443#
diff --git a/arch/ppc/kernel/cpu_setup_6xx.S b/arch/ppc/kernel/cpu_setup_6xx.S
index 468721d9ebd2..bd037caa4055 100644
--- a/arch/ppc/kernel/cpu_setup_6xx.S
+++ b/arch/ppc/kernel/cpu_setup_6xx.S
@@ -249,8 +249,11 @@ END_FTR_SECTION_IFSET(CPU_FTR_NO_DPM)
249 sync 249 sync
250 isync 250 isync
251 251
252 /* Enable L2 HW prefetch 252 /* Enable L2 HW prefetch, if L2 is enabled
253 */ 253 */
254 mfspr r3,SPRN_L2CR
255 andis. r3,r3,L2CR_L2E@h
256 beqlr
254 mfspr r3,SPRN_MSSCR0 257 mfspr r3,SPRN_MSSCR0
255 ori r3,r3,3 258 ori r3,r3,3
256 sync 259 sync
@@ -324,6 +327,7 @@ _GLOBAL(__save_cpu_setup)
324 cmplwi cr4,r3,0x8002 /* 7457 */ 327 cmplwi cr4,r3,0x8002 /* 7457 */
325 cmplwi cr5,r3,0x8003 /* 7447A */ 328 cmplwi cr5,r3,0x8003 /* 7447A */
326 cmplwi cr6,r3,0x7000 /* 750FX */ 329 cmplwi cr6,r3,0x7000 /* 750FX */
330 cmplwi cr7,r3,0x8004 /* 7448 */
327 /* cr1 is 7400 || 7410 */ 331 /* cr1 is 7400 || 7410 */
328 cror 4*cr1+eq,4*cr1+eq,4*cr2+eq 332 cror 4*cr1+eq,4*cr1+eq,4*cr2+eq
329 /* cr0 is 74xx */ 333 /* cr0 is 74xx */
@@ -331,6 +335,7 @@ _GLOBAL(__save_cpu_setup)
331 cror 4*cr0+eq,4*cr0+eq,4*cr4+eq 335 cror 4*cr0+eq,4*cr0+eq,4*cr4+eq
332 cror 4*cr0+eq,4*cr0+eq,4*cr1+eq 336 cror 4*cr0+eq,4*cr0+eq,4*cr1+eq
333 cror 4*cr0+eq,4*cr0+eq,4*cr5+eq 337 cror 4*cr0+eq,4*cr0+eq,4*cr5+eq
338 cror 4*cr0+eq,4*cr0+eq,4*cr7+eq
334 bne 1f 339 bne 1f
335 /* Backup 74xx specific regs */ 340 /* Backup 74xx specific regs */
336 mfspr r4,SPRN_MSSCR0 341 mfspr r4,SPRN_MSSCR0
@@ -393,6 +398,7 @@ _GLOBAL(__restore_cpu_setup)
393 cmplwi cr4,r3,0x8002 /* 7457 */ 398 cmplwi cr4,r3,0x8002 /* 7457 */
394 cmplwi cr5,r3,0x8003 /* 7447A */ 399 cmplwi cr5,r3,0x8003 /* 7447A */
395 cmplwi cr6,r3,0x7000 /* 750FX */ 400 cmplwi cr6,r3,0x7000 /* 750FX */
401 cmplwi cr7,r3,0x8004 /* 7448 */
396 /* cr1 is 7400 || 7410 */ 402 /* cr1 is 7400 || 7410 */
397 cror 4*cr1+eq,4*cr1+eq,4*cr2+eq 403 cror 4*cr1+eq,4*cr1+eq,4*cr2+eq
398 /* cr0 is 74xx */ 404 /* cr0 is 74xx */
@@ -400,6 +406,7 @@ _GLOBAL(__restore_cpu_setup)
400 cror 4*cr0+eq,4*cr0+eq,4*cr4+eq 406 cror 4*cr0+eq,4*cr0+eq,4*cr4+eq
401 cror 4*cr0+eq,4*cr0+eq,4*cr1+eq 407 cror 4*cr0+eq,4*cr0+eq,4*cr1+eq
402 cror 4*cr0+eq,4*cr0+eq,4*cr5+eq 408 cror 4*cr0+eq,4*cr0+eq,4*cr5+eq
409 cror 4*cr0+eq,4*cr0+eq,4*cr7+eq
403 bne 2f 410 bne 2f
404 /* Restore 74xx specific regs */ 411 /* Restore 74xx specific regs */
405 lwz r4,CS_MSSCR0(r5) 412 lwz r4,CS_MSSCR0(r5)
diff --git a/arch/ppc/kernel/cputable.c b/arch/ppc/kernel/cputable.c
index 50936cda0af9..546e1ea4cafa 100644
--- a/arch/ppc/kernel/cputable.c
+++ b/arch/ppc/kernel/cputable.c
@@ -198,10 +198,10 @@ struct cpu_spec cpu_specs[] = {
198 .num_pmcs = 4, 198 .num_pmcs = 4,
199 .cpu_setup = __setup_cpu_750 199 .cpu_setup = __setup_cpu_750
200 }, 200 },
201 { /* 745/755 */ 201 { /* 750CX (80100 and 8010x?) */
202 .pvr_mask = 0xfffff000, 202 .pvr_mask = 0xfffffff0,
203 .pvr_value = 0x00083000, 203 .pvr_value = 0x00080100,
204 .cpu_name = "745/755", 204 .cpu_name = "750CX",
205 .cpu_features = CPU_FTR_COMMON | 205 .cpu_features = CPU_FTR_COMMON |
206 CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_MAYBE_CAN_DOZE | 206 CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_MAYBE_CAN_DOZE |
207 CPU_FTR_USE_TB | CPU_FTR_L2CR | CPU_FTR_TAU | 207 CPU_FTR_USE_TB | CPU_FTR_L2CR | CPU_FTR_TAU |
@@ -210,11 +210,11 @@ struct cpu_spec cpu_specs[] = {
210 .icache_bsize = 32, 210 .icache_bsize = 32,
211 .dcache_bsize = 32, 211 .dcache_bsize = 32,
212 .num_pmcs = 4, 212 .num_pmcs = 4,
213 .cpu_setup = __setup_cpu_750 213 .cpu_setup = __setup_cpu_750cx
214 }, 214 },
215 { /* 750CX (80100 and 8010x?) */ 215 { /* 750CX (82201 and 82202) */
216 .pvr_mask = 0xfffffff0, 216 .pvr_mask = 0xfffffff0,
217 .pvr_value = 0x00080100, 217 .pvr_value = 0x00082200,
218 .cpu_name = "750CX", 218 .cpu_name = "750CX",
219 .cpu_features = CPU_FTR_COMMON | 219 .cpu_features = CPU_FTR_COMMON |
220 CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_MAYBE_CAN_DOZE | 220 CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_MAYBE_CAN_DOZE |
@@ -226,10 +226,10 @@ struct cpu_spec cpu_specs[] = {
226 .num_pmcs = 4, 226 .num_pmcs = 4,
227 .cpu_setup = __setup_cpu_750cx 227 .cpu_setup = __setup_cpu_750cx
228 }, 228 },
229 { /* 750CX (82201 and 82202) */ 229 { /* 750CXe (82214) */
230 .pvr_mask = 0xfffffff0, 230 .pvr_mask = 0xfffffff0,
231 .pvr_value = 0x00082200, 231 .pvr_value = 0x00082210,
232 .cpu_name = "750CX", 232 .cpu_name = "750CXe",
233 .cpu_features = CPU_FTR_COMMON | 233 .cpu_features = CPU_FTR_COMMON |
234 CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_MAYBE_CAN_DOZE | 234 CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_MAYBE_CAN_DOZE |
235 CPU_FTR_USE_TB | CPU_FTR_L2CR | CPU_FTR_TAU | 235 CPU_FTR_USE_TB | CPU_FTR_L2CR | CPU_FTR_TAU |
@@ -240,9 +240,9 @@ struct cpu_spec cpu_specs[] = {
240 .num_pmcs = 4, 240 .num_pmcs = 4,
241 .cpu_setup = __setup_cpu_750cx 241 .cpu_setup = __setup_cpu_750cx
242 }, 242 },
243 { /* 750CXe (82214) */ 243 { /* 750CXe "Gekko" (83214) */
244 .pvr_mask = 0xfffffff0, 244 .pvr_mask = 0xffffffff,
245 .pvr_value = 0x00082210, 245 .pvr_value = 0x00083214,
246 .cpu_name = "750CXe", 246 .cpu_name = "750CXe",
247 .cpu_features = CPU_FTR_COMMON | 247 .cpu_features = CPU_FTR_COMMON |
248 CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_MAYBE_CAN_DOZE | 248 CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_MAYBE_CAN_DOZE |
@@ -254,6 +254,20 @@ struct cpu_spec cpu_specs[] = {
254 .num_pmcs = 4, 254 .num_pmcs = 4,
255 .cpu_setup = __setup_cpu_750cx 255 .cpu_setup = __setup_cpu_750cx
256 }, 256 },
257 { /* 745/755 */
258 .pvr_mask = 0xfffff000,
259 .pvr_value = 0x00083000,
260 .cpu_name = "745/755",
261 .cpu_features = CPU_FTR_COMMON |
262 CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_MAYBE_CAN_DOZE |
263 CPU_FTR_USE_TB | CPU_FTR_L2CR | CPU_FTR_TAU |
264 CPU_FTR_HPTE_TABLE | CPU_FTR_MAYBE_CAN_NAP,
265 .cpu_user_features = COMMON_PPC,
266 .icache_bsize = 32,
267 .dcache_bsize = 32,
268 .num_pmcs = 4,
269 .cpu_setup = __setup_cpu_750
270 },
257 { /* 750FX rev 1.x */ 271 { /* 750FX rev 1.x */
258 .pvr_mask = 0xffffff00, 272 .pvr_mask = 0xffffff00,
259 .pvr_value = 0x70000100, 273 .pvr_value = 0x70000100,
@@ -536,6 +550,22 @@ struct cpu_spec cpu_specs[] = {
536 .num_pmcs = 6, 550 .num_pmcs = 6,
537 .cpu_setup = __setup_cpu_745x 551 .cpu_setup = __setup_cpu_745x
538 }, 552 },
553 { /* 7448 */
554 .pvr_mask = 0xffff0000,
555 .pvr_value = 0x80040000,
556 .cpu_name = "7448",
557 .cpu_features = CPU_FTR_COMMON |
558 CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_USE_TB |
559 CPU_FTR_MAYBE_CAN_NAP | CPU_FTR_L2CR |
560 CPU_FTR_ALTIVEC_COMP | CPU_FTR_HPTE_TABLE |
561 CPU_FTR_SPEC7450 | CPU_FTR_NAP_DISABLE_L2_PR |
562 CPU_FTR_HAS_HIGH_BATS | CPU_FTR_NEED_COHERENT,
563 .cpu_user_features = COMMON_PPC | PPC_FEATURE_ALTIVEC_COMP,
564 .icache_bsize = 32,
565 .dcache_bsize = 32,
566 .num_pmcs = 6,
567 .cpu_setup = __setup_cpu_745x
568 },
539 { /* 82xx (8240, 8245, 8260 are all 603e cores) */ 569 { /* 82xx (8240, 8245, 8260 are all 603e cores) */
540 .pvr_mask = 0x7fff0000, 570 .pvr_mask = 0x7fff0000,
541 .pvr_value = 0x00810000, 571 .pvr_value = 0x00810000,
@@ -852,6 +882,26 @@ struct cpu_spec cpu_specs[] = {
852 882
853#endif /* CONFIG_40x */ 883#endif /* CONFIG_40x */
854#ifdef CONFIG_44x 884#ifdef CONFIG_44x
885 {
886 .pvr_mask = 0xf0000fff,
887 .pvr_value = 0x40000850,
888 .cpu_name = "440EP Rev. A",
889 .cpu_features = CPU_FTR_SPLIT_ID_CACHE |
890 CPU_FTR_USE_TB,
891 .cpu_user_features = COMMON_PPC, /* 440EP has an FPU */
892 .icache_bsize = 32,
893 .dcache_bsize = 32,
894 },
895 {
896 .pvr_mask = 0xf0000fff,
897 .pvr_value = 0x400008d3,
898 .cpu_name = "440EP Rev. B",
899 .cpu_features = CPU_FTR_SPLIT_ID_CACHE |
900 CPU_FTR_USE_TB,
901 .cpu_user_features = COMMON_PPC, /* 440EP has an FPU */
902 .icache_bsize = 32,
903 .dcache_bsize = 32,
904 },
855 { /* 440GP Rev. B */ 905 { /* 440GP Rev. B */
856 .pvr_mask = 0xf0000fff, 906 .pvr_mask = 0xf0000fff,
857 .pvr_value = 0x40000440, 907 .pvr_value = 0x40000440,
@@ -902,6 +952,26 @@ struct cpu_spec cpu_specs[] = {
902 .icache_bsize = 32, 952 .icache_bsize = 32,
903 .dcache_bsize = 32, 953 .dcache_bsize = 32,
904 }, 954 },
955 { /* 440GX Rev. F */
956 .pvr_mask = 0xf0000fff,
957 .pvr_value = 0x50000894,
958 .cpu_name = "440GX Rev. F",
959 .cpu_features = CPU_FTR_SPLIT_ID_CACHE |
960 CPU_FTR_USE_TB,
961 .cpu_user_features = PPC_FEATURE_32 | PPC_FEATURE_HAS_MMU,
962 .icache_bsize = 32,
963 .dcache_bsize = 32,
964 },
965 { /* 440SP Rev. A */
966 .pvr_mask = 0xff000fff,
967 .pvr_value = 0x53000891,
968 .cpu_name = "440SP Rev. A",
969 .cpu_features = CPU_FTR_SPLIT_ID_CACHE |
970 CPU_FTR_USE_TB,
971 .cpu_user_features = PPC_FEATURE_32 | PPC_FEATURE_HAS_MMU,
972 .icache_bsize = 32,
973 .dcache_bsize = 32,
974 },
905#endif /* CONFIG_44x */ 975#endif /* CONFIG_44x */
906#ifdef CONFIG_FSL_BOOKE 976#ifdef CONFIG_FSL_BOOKE
907 { /* e200z5 */ 977 { /* e200z5 */
diff --git a/arch/ppc/kernel/entry.S b/arch/ppc/kernel/entry.S
index d4df68629cc6..cb83045e2edf 100644
--- a/arch/ppc/kernel/entry.S
+++ b/arch/ppc/kernel/entry.S
@@ -215,6 +215,7 @@ syscall_dotrace_cont:
215 lwzx r10,r10,r0 /* Fetch system call handler [ptr] */ 215 lwzx r10,r10,r0 /* Fetch system call handler [ptr] */
216 mtlr r10 216 mtlr r10
217 addi r9,r1,STACK_FRAME_OVERHEAD 217 addi r9,r1,STACK_FRAME_OVERHEAD
218 PPC440EP_ERR42
218 blrl /* Call handler */ 219 blrl /* Call handler */
219 .globl ret_from_syscall 220 .globl ret_from_syscall
220ret_from_syscall: 221ret_from_syscall:
diff --git a/arch/ppc/kernel/find_name.c b/arch/ppc/kernel/find_name.c
deleted file mode 100644
index 3c0fa8e0c077..000000000000
--- a/arch/ppc/kernel/find_name.c
+++ /dev/null
@@ -1,48 +0,0 @@
1#include <stdio.h>
2#include <asm/page.h>
3#include <sys/mman.h>
4#include <strings.h>
5/*
6 * Finds a given address in the System.map and prints it out
7 * with its neighbors. -- Cort
8 */
9
10int main(int argc, char **argv)
11{
12 unsigned long addr, cmp, i;
13 FILE *f;
14 char s[256], last[256];
15
16 if ( argc < 2 )
17 {
18 fprintf(stderr, "Usage: %s <address>\n", argv[0]);
19 return -1;
20 }
21
22 for ( i = 1 ; argv[i] ; i++ )
23 {
24 sscanf( argv[i], "%0lx", &addr );
25 /* adjust if addr is relative to kernelbase */
26 if ( addr < PAGE_OFFSET )
27 addr += PAGE_OFFSET;
28
29 if ( (f = fopen( "System.map", "r" )) == NULL )
30 {
31 perror("fopen()\n");
32 exit(-1);
33 }
34
35 while ( !feof(f) )
36 {
37 fgets(s, 255 , f);
38 sscanf( s, "%0lx", &cmp );
39 if ( addr < cmp )
40 break;
41 strcpy( last, s);
42 }
43
44 printf( "%s%s", last, s );
45 }
46 fclose(f);
47 return 0;
48}
diff --git a/arch/ppc/kernel/head_44x.S b/arch/ppc/kernel/head_44x.S
index 6c7ae6052464..9e68e32edb60 100644
--- a/arch/ppc/kernel/head_44x.S
+++ b/arch/ppc/kernel/head_44x.S
@@ -179,24 +179,26 @@ skpinv: addi r4,r4,1 /* Increment */
1794: 1794:
180#ifdef CONFIG_SERIAL_TEXT_DEBUG 180#ifdef CONFIG_SERIAL_TEXT_DEBUG
181 /* 181 /*
182 * Add temporary UART mapping for early debug. This 182 * Add temporary UART mapping for early debug.
183 * mapping must be identical to that used by the early 183 * We can map UART registers wherever we want as long as they don't
184 * bootloader code since the same asm/serial.h parameters 184 * interfere with other system mappings (e.g. with pinned entries).
185 * are used for polled operation. 185 * For an example of how we handle this - see ocotea.h. --ebs
186 */ 186 */
187 /* pageid fields */ 187 /* pageid fields */
188 lis r3,UART0_IO_BASE@h 188 lis r3,UART0_IO_BASE@h
189 ori r3,r3,PPC44x_TLB_VALID | PPC44x_TLB_256M 189 ori r3,r3,PPC44x_TLB_VALID | PPC44x_TLB_4K
190 190
191 /* xlat fields */ 191 /* xlat fields */
192 lis r4,UART0_PHYS_IO_BASE@h /* RPN depends on SoC */ 192 lis r4,UART0_PHYS_IO_BASE@h /* RPN depends on SoC */
193#ifndef CONFIG_440EP
193 ori r4,r4,0x0001 /* ERPN is 1 for second 4GB page */ 194 ori r4,r4,0x0001 /* ERPN is 1 for second 4GB page */
195#endif
194 196
195 /* attrib fields */ 197 /* attrib fields */
196 li r5,0 198 li r5,0
197 ori r5,r5,(PPC44x_TLB_SW | PPC44x_TLB_SR | PPC44x_TLB_I | PPC44x_TLB_G) 199 ori r5,r5,(PPC44x_TLB_SW | PPC44x_TLB_SR | PPC44x_TLB_I | PPC44x_TLB_G)
198 200
199 li r0,1 /* TLB slot 1 */ 201 li r0,0 /* TLB slot 0 */
200 202
201 tlbwe r3,r0,PPC44x_TLB_PAGEID /* Load the pageid fields */ 203 tlbwe r3,r0,PPC44x_TLB_PAGEID /* Load the pageid fields */
202 tlbwe r4,r0,PPC44x_TLB_XLAT /* Load the translation fields */ 204 tlbwe r4,r0,PPC44x_TLB_XLAT /* Load the translation fields */
@@ -228,6 +230,16 @@ skpinv: addi r4,r4,1 /* Increment */
228 lis r4,interrupt_base@h /* IVPR only uses the high 16-bits */ 230 lis r4,interrupt_base@h /* IVPR only uses the high 16-bits */
229 mtspr SPRN_IVPR,r4 231 mtspr SPRN_IVPR,r4
230 232
233#ifdef CONFIG_440EP
234 /* Clear DAPUIB flag in CCR0 (enable APU between CPU and FPU) */
235 mfspr r2,SPRN_CCR0
236 lis r3,0xffef
237 ori r3,r3,0xffff
238 and r2,r2,r3
239 mtspr SPRN_CCR0,r2
240 isync
241#endif
242
231 /* 243 /*
232 * This is where the main kernel code starts. 244 * This is where the main kernel code starts.
233 */ 245 */
@@ -450,7 +462,11 @@ interrupt_base:
450 462
451 /* Watchdog Timer Interrupt */ 463 /* Watchdog Timer Interrupt */
452 /* TODO: Add watchdog support */ 464 /* TODO: Add watchdog support */
465#ifdef CONFIG_BOOKE_WDT
466 CRITICAL_EXCEPTION(0x1020, WatchdogTimer, WatchdogException)
467#else
453 CRITICAL_EXCEPTION(0x1020, WatchdogTimer, UnknownException) 468 CRITICAL_EXCEPTION(0x1020, WatchdogTimer, UnknownException)
469#endif
454 470
455 /* Data TLB Error Interrupt */ 471 /* Data TLB Error Interrupt */
456 START_EXCEPTION(DataTLBError) 472 START_EXCEPTION(DataTLBError)
diff --git a/arch/ppc/kernel/head_4xx.S b/arch/ppc/kernel/head_4xx.S
index 23fb51819ba5..0a5e723d3be6 100644
--- a/arch/ppc/kernel/head_4xx.S
+++ b/arch/ppc/kernel/head_4xx.S
@@ -448,7 +448,9 @@ label:
448 448
449/* 0x1020 - Watchdog Timer (WDT) Exception 449/* 0x1020 - Watchdog Timer (WDT) Exception
450*/ 450*/
451 451#ifdef CONFIG_BOOKE_WDT
452 CRITICAL_EXCEPTION(0x1020, WDTException, WatchdogException)
453#else
452 CRITICAL_EXCEPTION(0x1020, WDTException, UnknownException) 454 CRITICAL_EXCEPTION(0x1020, WDTException, UnknownException)
453#endif 455#endif
454 456
diff --git a/arch/ppc/kernel/head_8xx.S b/arch/ppc/kernel/head_8xx.S
index 5a7a64e91fc5..eb18cadb3755 100644
--- a/arch/ppc/kernel/head_8xx.S
+++ b/arch/ppc/kernel/head_8xx.S
@@ -288,13 +288,11 @@ SystemCall:
288 * For the MPC8xx, this is a software tablewalk to load the instruction 288 * For the MPC8xx, this is a software tablewalk to load the instruction
289 * TLB. It is modelled after the example in the Motorola manual. The task 289 * TLB. It is modelled after the example in the Motorola manual. The task
290 * switch loads the M_TWB register with the pointer to the first level table. 290 * switch loads the M_TWB register with the pointer to the first level table.
291 * If we discover there is no second level table (the value is zero), the 291 * If we discover there is no second level table (value is zero) or if there
292 * plan was to load that into the TLB, which causes another fault into the 292 * is an invalid pte, we load that into the TLB, which causes another fault
293 * TLB Error interrupt where we can handle such problems. However, that did 293 * into the TLB Error interrupt where we can handle such problems.
294 * not work, so if we discover there is no second level table, we restore 294 * We have to use the MD_xxx registers for the tablewalk because the
295 * registers and branch to the error exception. We have to use the MD_xxx 295 * equivalent MI_xxx registers only perform the attribute functions.
296 * registers for the tablewalk because the equivalent MI_xxx registers
297 * only perform the attribute functions.
298 */ 296 */
299InstructionTLBMiss: 297InstructionTLBMiss:
300#ifdef CONFIG_8xx_CPU6 298#ifdef CONFIG_8xx_CPU6
diff --git a/arch/ppc/kernel/head_fsl_booke.S b/arch/ppc/kernel/head_fsl_booke.S
index eb804b7a3cb2..4028f4c7d978 100644
--- a/arch/ppc/kernel/head_fsl_booke.S
+++ b/arch/ppc/kernel/head_fsl_booke.S
@@ -564,8 +564,11 @@ interrupt_base:
564 EXCEPTION(0x3100, FixedIntervalTimer, UnknownException, EXC_XFER_EE) 564 EXCEPTION(0x3100, FixedIntervalTimer, UnknownException, EXC_XFER_EE)
565 565
566 /* Watchdog Timer Interrupt */ 566 /* Watchdog Timer Interrupt */
567 /* TODO: Add watchdog support */ 567#ifdef CONFIG_BOOKE_WDT
568 CRITICAL_EXCEPTION(0x3200, WatchdogTimer, WatchdogException)
569#else
568 CRITICAL_EXCEPTION(0x3200, WatchdogTimer, UnknownException) 570 CRITICAL_EXCEPTION(0x3200, WatchdogTimer, UnknownException)
571#endif
569 572
570 /* Data TLB Error Interrupt */ 573 /* Data TLB Error Interrupt */
571 START_EXCEPTION(DataTLBError) 574 START_EXCEPTION(DataTLBError)
diff --git a/arch/ppc/kernel/l2cr.S b/arch/ppc/kernel/l2cr.S
index c39441048266..861115249b35 100644
--- a/arch/ppc/kernel/l2cr.S
+++ b/arch/ppc/kernel/l2cr.S
@@ -156,6 +156,26 @@ END_FTR_SECTION_IFSET(CPU_FTR_ALTIVEC)
156 The bit moved on the 7450..... 156 The bit moved on the 7450.....
157 ****/ 157 ****/
158 158
159BEGIN_FTR_SECTION
160 /* Disable L2 prefetch on some 745x and try to ensure
161 * L2 prefetch engines are idle. As explained by errata
162 * text, we can't be sure they are, we just hope very hard
163 * that well be enough (sic !). At least I noticed Apple
164 * doesn't even bother doing the dcbf's here...
165 */
166 mfspr r4,SPRN_MSSCR0
167 rlwinm r4,r4,0,0,29
168 sync
169 mtspr SPRN_MSSCR0,r4
170 sync
171 isync
172 lis r4,KERNELBASE@h
173 dcbf 0,r4
174 dcbf 0,r4
175 dcbf 0,r4
176 dcbf 0,r4
177END_FTR_SECTION_IFSET(CPU_FTR_SPEC7450)
178
159 /* TODO: use HW flush assist when available */ 179 /* TODO: use HW flush assist when available */
160 180
161 lis r4,0x0002 181 lis r4,0x0002
@@ -230,7 +250,16 @@ END_FTR_SECTION_IFSET(CPU_FTR_SPEC7450)
230 oris r3,r3,0x8000 250 oris r3,r3,0x8000
231 mtspr SPRN_L2CR,r3 251 mtspr SPRN_L2CR,r3
232 sync 252 sync
233 253
254 /* Enable L2 HW prefetch on 744x/745x */
255BEGIN_FTR_SECTION
256 mfspr r3,SPRN_MSSCR0
257 ori r3,r3,3
258 sync
259 mtspr SPRN_MSSCR0,r3
260 sync
261 isync
262END_FTR_SECTION_IFSET(CPU_FTR_SPEC7450)
2344: 2634:
235 264
236 /* Restore HID0[DPM] to whatever it was before */ 265 /* Restore HID0[DPM] to whatever it was before */
diff --git a/arch/ppc/kernel/machine_kexec.c b/arch/ppc/kernel/machine_kexec.c
index 84d65a87191e..a72787747df7 100644
--- a/arch/ppc/kernel/machine_kexec.c
+++ b/arch/ppc/kernel/machine_kexec.c
@@ -28,6 +28,12 @@ typedef NORET_TYPE void (*relocate_new_kernel_t)(
28const extern unsigned char relocate_new_kernel[]; 28const extern unsigned char relocate_new_kernel[];
29const extern unsigned int relocate_new_kernel_size; 29const extern unsigned int relocate_new_kernel_size;
30 30
31/*
32 * Provide a dummy crash_notes definition while crash dump arrives to ppc.
33 * This prevents breakage of crash_notes attribute in kernel/ksysfs.c.
34 */
35void *crash_notes = NULL;
36
31void machine_shutdown(void) 37void machine_shutdown(void)
32{ 38{
33 if (ppc_md.machine_shutdown) 39 if (ppc_md.machine_shutdown)
diff --git a/arch/ppc/kernel/misc.S b/arch/ppc/kernel/misc.S
index 191a8def3bdb..ce71b4a01585 100644
--- a/arch/ppc/kernel/misc.S
+++ b/arch/ppc/kernel/misc.S
@@ -1145,6 +1145,7 @@ _GLOBAL(kernel_thread)
1145 stwu r0,-16(r1) 1145 stwu r0,-16(r1)
1146 mtlr r30 /* fn addr in lr */ 1146 mtlr r30 /* fn addr in lr */
1147 mr r3,r31 /* load arg and call fn */ 1147 mr r3,r31 /* load arg and call fn */
1148 PPC440EP_ERR42
1148 blrl 1149 blrl
1149 li r0,__NR_exit /* exit if function returns */ 1150 li r0,__NR_exit /* exit if function returns */
1150 li r3,0 1151 li r3,0
@@ -1451,3 +1452,6 @@ _GLOBAL(sys_call_table)
1451 .long sys_waitid 1452 .long sys_waitid
1452 .long sys_ioprio_set 1453 .long sys_ioprio_set
1453 .long sys_ioprio_get 1454 .long sys_ioprio_get
1455 .long sys_inotify_init /* 275 */
1456 .long sys_inotify_add_watch
1457 .long sys_inotify_rm_watch
diff --git a/arch/ppc/kernel/pci.c b/arch/ppc/kernel/pci.c
index 70cfb6ffd877..7b3586a3bf30 100644
--- a/arch/ppc/kernel/pci.c
+++ b/arch/ppc/kernel/pci.c
@@ -160,6 +160,21 @@ void pcibios_resource_to_bus(struct pci_dev *dev, struct pci_bus_region *region,
160} 160}
161EXPORT_SYMBOL(pcibios_resource_to_bus); 161EXPORT_SYMBOL(pcibios_resource_to_bus);
162 162
163void pcibios_bus_to_resource(struct pci_dev *dev, struct resource *res,
164 struct pci_bus_region *region)
165{
166 unsigned long offset = 0;
167 struct pci_controller *hose = dev->sysdata;
168
169 if (hose && res->flags & IORESOURCE_IO)
170 offset = (unsigned long)hose->io_base_virt - isa_io_base;
171 else if (hose && res->flags & IORESOURCE_MEM)
172 offset = hose->pci_mem_offset;
173 res->start = region->start + offset;
174 res->end = region->end + offset;
175}
176EXPORT_SYMBOL(pcibios_bus_to_resource);
177
163/* 178/*
164 * We need to avoid collisions with `mirrored' VGA ports 179 * We need to avoid collisions with `mirrored' VGA ports
165 * and other strange ISA hardware, so we always want the 180 * and other strange ISA hardware, so we always want the
diff --git a/arch/ppc/kernel/ppc_ksyms.c b/arch/ppc/kernel/ppc_ksyms.c
index d59ad07de8e7..88f6bb7b6964 100644
--- a/arch/ppc/kernel/ppc_ksyms.c
+++ b/arch/ppc/kernel/ppc_ksyms.c
@@ -51,9 +51,6 @@
51#include <asm/commproc.h> 51#include <asm/commproc.h>
52#endif 52#endif
53 53
54/* Tell string.h we don't want memcpy etc. as cpp defines */
55#define EXPORT_SYMTAB_STROPS
56
57extern void transfer_to_handler(void); 54extern void transfer_to_handler(void);
58extern void do_IRQ(struct pt_regs *regs); 55extern void do_IRQ(struct pt_regs *regs);
59extern void MachineCheckException(struct pt_regs *regs); 56extern void MachineCheckException(struct pt_regs *regs);
@@ -263,6 +260,7 @@ EXPORT_SYMBOL(__ashrdi3);
263EXPORT_SYMBOL(__ashldi3); 260EXPORT_SYMBOL(__ashldi3);
264EXPORT_SYMBOL(__lshrdi3); 261EXPORT_SYMBOL(__lshrdi3);
265EXPORT_SYMBOL(memcpy); 262EXPORT_SYMBOL(memcpy);
263EXPORT_SYMBOL(cacheable_memcpy);
266EXPORT_SYMBOL(memset); 264EXPORT_SYMBOL(memset);
267EXPORT_SYMBOL(memmove); 265EXPORT_SYMBOL(memmove);
268EXPORT_SYMBOL(memscan); 266EXPORT_SYMBOL(memscan);
@@ -324,7 +322,7 @@ EXPORT_SYMBOL(__res);
324 322
325EXPORT_SYMBOL(next_mmu_context); 323EXPORT_SYMBOL(next_mmu_context);
326EXPORT_SYMBOL(set_context); 324EXPORT_SYMBOL(set_context);
327EXPORT_SYMBOL(handle_mm_fault); /* For MOL */ 325EXPORT_SYMBOL_GPL(__handle_mm_fault); /* For MOL */
328EXPORT_SYMBOL(disarm_decr); 326EXPORT_SYMBOL(disarm_decr);
329#ifdef CONFIG_PPC_STD_MMU 327#ifdef CONFIG_PPC_STD_MMU
330extern long mol_trampoline; 328extern long mol_trampoline;
diff --git a/arch/ppc/kernel/setup.c b/arch/ppc/kernel/setup.c
index c42f75326939..545cfd0fab59 100644
--- a/arch/ppc/kernel/setup.c
+++ b/arch/ppc/kernel/setup.c
@@ -41,7 +41,11 @@
41#include <asm/xmon.h> 41#include <asm/xmon.h>
42#include <asm/ocp.h> 42#include <asm/ocp.h>
43 43
44#if defined(CONFIG_85xx) || defined(CONFIG_83xx) || defined(CONFIG_MPC10X_BRIDGE) 44#define USES_PPC_SYS (defined(CONFIG_85xx) || defined(CONFIG_83xx) || \
45 defined(CONFIG_MPC10X_BRIDGE) || defined(CONFIG_8260) || \
46 defined(CONFIG_PPC_MPC52xx))
47
48#if USES_PPC_SYS
45#include <asm/ppc_sys.h> 49#include <asm/ppc_sys.h>
46#endif 50#endif
47 51
@@ -121,8 +125,6 @@ void machine_restart(char *cmd)
121 ppc_md.restart(cmd); 125 ppc_md.restart(cmd);
122} 126}
123 127
124EXPORT_SYMBOL(machine_restart);
125
126void machine_power_off(void) 128void machine_power_off(void)
127{ 129{
128#ifdef CONFIG_NVRAM 130#ifdef CONFIG_NVRAM
@@ -131,8 +133,6 @@ void machine_power_off(void)
131 ppc_md.power_off(); 133 ppc_md.power_off();
132} 134}
133 135
134EXPORT_SYMBOL(machine_power_off);
135
136void machine_halt(void) 136void machine_halt(void)
137{ 137{
138#ifdef CONFIG_NVRAM 138#ifdef CONFIG_NVRAM
@@ -141,8 +141,6 @@ void machine_halt(void)
141 ppc_md.halt(); 141 ppc_md.halt();
142} 142}
143 143
144EXPORT_SYMBOL(machine_halt);
145
146void (*pm_power_off)(void) = machine_power_off; 144void (*pm_power_off)(void) = machine_power_off;
147 145
148#ifdef CONFIG_TAU 146#ifdef CONFIG_TAU
@@ -247,7 +245,7 @@ int show_cpuinfo(struct seq_file *m, void *v)
247 seq_printf(m, "bogomips\t: %lu.%02lu\n", 245 seq_printf(m, "bogomips\t: %lu.%02lu\n",
248 lpj / (500000/HZ), (lpj / (5000/HZ)) % 100); 246 lpj / (500000/HZ), (lpj / (5000/HZ)) % 100);
249 247
250#if defined(CONFIG_85xx) || defined(CONFIG_83xx) || defined(CONFIG_MPC10X_BRIDGE) 248#if USES_PPC_SYS
251 if (cur_ppc_sys_spec->ppc_sys_name) 249 if (cur_ppc_sys_spec->ppc_sys_name)
252 seq_printf(m, "chipset\t\t: %s\n", 250 seq_printf(m, "chipset\t\t: %s\n",
253 cur_ppc_sys_spec->ppc_sys_name); 251 cur_ppc_sys_spec->ppc_sys_name);
@@ -621,6 +619,26 @@ machine_init(unsigned long r3, unsigned long r4, unsigned long r5,
621 if (ppc_md.progress) 619 if (ppc_md.progress)
622 ppc_md.progress("id mach(): done", 0x200); 620 ppc_md.progress("id mach(): done", 0x200);
623} 621}
622#ifdef CONFIG_BOOKE_WDT
623/* Checks wdt=x and wdt_period=xx command-line option */
624int __init early_parse_wdt(char *p)
625{
626 if (p && strncmp(p, "0", 1) != 0)
627 booke_wdt_enabled = 1;
628
629 return 0;
630}
631early_param("wdt", early_parse_wdt);
632
633int __init early_parse_wdt_period (char *p)
634{
635 if (p)
636 booke_wdt_period = simple_strtoul(p, NULL, 0);
637
638 return 0;
639}
640early_param("wdt_period", early_parse_wdt_period);
641#endif /* CONFIG_BOOKE_WDT */
624 642
625/* Checks "l2cr=xxxx" command-line option */ 643/* Checks "l2cr=xxxx" command-line option */
626int __init ppc_setup_l2cr(char *str) 644int __init ppc_setup_l2cr(char *str)
diff --git a/arch/ppc/kernel/signal.c b/arch/ppc/kernel/signal.c
index 8aaeb6f4e750..2244bf91e593 100644
--- a/arch/ppc/kernel/signal.c
+++ b/arch/ppc/kernel/signal.c
@@ -759,13 +759,12 @@ int do_signal(sigset_t *oldset, struct pt_regs *regs)
759 else 759 else
760 handle_signal(signr, &ka, &info, oldset, regs, newsp); 760 handle_signal(signr, &ka, &info, oldset, regs, newsp);
761 761
762 if (!(ka.sa.sa_flags & SA_NODEFER)) { 762 spin_lock_irq(&current->sighand->siglock);
763 spin_lock_irq(&current->sighand->siglock); 763 sigorsets(&current->blocked,&current->blocked,&ka.sa.sa_mask);
764 sigorsets(&current->blocked,&current->blocked,&ka.sa.sa_mask); 764 if (!(ka.sa.sa_flags & SA_NODEFER))
765 sigaddset(&current->blocked, signr); 765 sigaddset(&current->blocked, signr);
766 recalc_sigpending(); 766 recalc_sigpending();
767 spin_unlock_irq(&current->sighand->siglock); 767 spin_unlock_irq(&current->sighand->siglock);
768 }
769 768
770 return 1; 769 return 1;
771} 770}
diff --git a/arch/ppc/kernel/traps.c b/arch/ppc/kernel/traps.c
index 9e6ae5696650..d87423d1003a 100644
--- a/arch/ppc/kernel/traps.c
+++ b/arch/ppc/kernel/traps.c
@@ -904,6 +904,25 @@ void SPEFloatingPointException(struct pt_regs *regs)
904} 904}
905#endif 905#endif
906 906
907#ifdef CONFIG_BOOKE_WDT
908/*
909 * Default handler for a Watchdog exception,
910 * spins until a reboot occurs
911 */
912void __attribute__ ((weak)) WatchdogHandler(struct pt_regs *regs)
913{
914 /* Generic WatchdogHandler, implement your own */
915 mtspr(SPRN_TCR, mfspr(SPRN_TCR)&(~TCR_WIE));
916 return;
917}
918
919void WatchdogException(struct pt_regs *regs)
920{
921 printk (KERN_EMERG "PowerPC Book-E Watchdog Exception\n");
922 WatchdogHandler(regs);
923}
924#endif
925
907void __init trap_init(void) 926void __init trap_init(void)
908{ 927{
909} 928}
diff --git a/arch/ppc/mm/init.c b/arch/ppc/mm/init.c
index 6164a2b34733..f421a4b337f6 100644
--- a/arch/ppc/mm/init.c
+++ b/arch/ppc/mm/init.c
@@ -560,8 +560,12 @@ void flush_dcache_page(struct page *page)
560void flush_dcache_icache_page(struct page *page) 560void flush_dcache_icache_page(struct page *page)
561{ 561{
562#ifdef CONFIG_BOOKE 562#ifdef CONFIG_BOOKE
563 __flush_dcache_icache(kmap(page)); 563 void *start = kmap_atomic(page, KM_PPC_SYNC_ICACHE);
564 kunmap(page); 564 __flush_dcache_icache(start);
565 kunmap_atomic(start, KM_PPC_SYNC_ICACHE);
566#elif defined(CONFIG_8xx)
567 /* On 8xx there is no need to kmap since highmem is not supported */
568 __flush_dcache_icache(page_address(page));
565#else 569#else
566 __flush_dcache_icache_phys(page_to_pfn(page) << PAGE_SHIFT); 570 __flush_dcache_icache_phys(page_to_pfn(page) << PAGE_SHIFT);
567#endif 571#endif
diff --git a/arch/ppc/platforms/4xx/Kconfig b/arch/ppc/platforms/4xx/Kconfig
index a0612a86455a..76f4476cab44 100644
--- a/arch/ppc/platforms/4xx/Kconfig
+++ b/arch/ppc/platforms/4xx/Kconfig
@@ -3,6 +3,11 @@ config 4xx
3 depends on 40x || 44x 3 depends on 40x || 44x
4 default y 4 default y
5 5
6config WANT_EARLY_SERIAL
7 bool
8 select SERIAL_8250
9 default n
10
6menu "IBM 4xx options" 11menu "IBM 4xx options"
7 depends on 4xx 12 depends on 4xx
8 13
@@ -11,13 +16,9 @@ choice
11 depends on 40x 16 depends on 40x
12 default WALNUT 17 default WALNUT
13 18
14config ASH
15 bool "Ash"
16 help
17 This option enables support for the IBM NP405H evaluation board.
18
19config BUBINGA 19config BUBINGA
20 bool "Bubinga" 20 bool "Bubinga"
21 select WANT_EARLY_SERIAL
21 help 22 help
22 This option enables support for the IBM 405EP evaluation board. 23 This option enables support for the IBM 405EP evaluation board.
23 24
@@ -31,11 +32,6 @@ config EP405
31 help 32 help
32 This option enables support for the EP405/EP405PC boards. 33 This option enables support for the EP405/EP405PC boards.
33 34
34config OAK
35 bool "Oak"
36 help
37 This option enables support for the IBM 403GCX evaluation board.
38
39config REDWOOD_5 35config REDWOOD_5
40 bool "Redwood-5" 36 bool "Redwood-5"
41 help 37 help
@@ -68,18 +64,27 @@ choice
68 depends on 44x 64 depends on 44x
69 default EBONY 65 default EBONY
70 66
67config BAMBOO
68 bool "Bamboo"
69 select WANT_EARLY_SERIAL
70 help
71 This option enables support for the IBM PPC440EP evaluation board.
72
71config EBONY 73config EBONY
72 bool "Ebony" 74 bool "Ebony"
75 select WANT_EARLY_SERIAL
73 help 76 help
74 This option enables support for the IBM PPC440GP evaluation board. 77 This option enables support for the IBM PPC440GP evaluation board.
75 78
76config LUAN 79config LUAN
77 bool "Luan" 80 bool "Luan"
81 select WANT_EARLY_SERIAL
78 help 82 help
79 This option enables support for the IBM PPC440SP evaluation board. 83 This option enables support for the IBM PPC440SP evaluation board.
80 84
81config OCOTEA 85config OCOTEA
82 bool "Ocotea" 86 bool "Ocotea"
87 select WANT_EARLY_SERIAL
83 help 88 help
84 This option enables support for the IBM PPC440GX evaluation board. 89 This option enables support for the IBM PPC440GX evaluation board.
85 90
@@ -98,6 +103,12 @@ config NP405H
98 depends on ASH 103 depends on ASH
99 default y 104 default y
100 105
106config 440EP
107 bool
108 depends on BAMBOO
109 select PPC_FPU
110 default y
111
101config 440GP 112config 440GP
102 bool 113 bool
103 depends on EBONY 114 depends on EBONY
@@ -115,7 +126,7 @@ config 440SP
115 126
116config 440 127config 440
117 bool 128 bool
118 depends on 440GP || 440SP 129 depends on 440GP || 440SP || 440EP
119 default y 130 default y
120 131
121config 440A 132config 440A
@@ -123,16 +134,21 @@ config 440A
123 depends on 440GX 134 depends on 440GX
124 default y 135 default y
125 136
137config IBM440EP_ERR42
138 bool
139 depends on 440EP
140 default y
141
126# All 405-based cores up until the 405GPR and 405EP have this errata. 142# All 405-based cores up until the 405GPR and 405EP have this errata.
127config IBM405_ERR77 143config IBM405_ERR77
128 bool 144 bool
129 depends on 40x && !403GCX && !405GPR 145 depends on 40x && !403GCX && !405GPR && !405EP
130 default y 146 default y
131 147
132# All 40x-based cores, up until the 405GPR and 405EP have this errata. 148# All 40x-based cores, up until the 405GPR and 405EP have this errata.
133config IBM405_ERR51 149config IBM405_ERR51
134 bool 150 bool
135 depends on 40x && !405GPR 151 depends on 40x && !405GPR && !405EP
136 default y 152 default y
137 153
138config BOOKE 154config BOOKE
@@ -142,7 +158,7 @@ config BOOKE
142 158
143config IBM_OCP 159config IBM_OCP
144 bool 160 bool
145 depends on ASH || BUBINGA || CPCI405 || EBONY || EP405 || LUAN || OCOTEA || REDWOOD_5 || REDWOOD_6 || SYCAMORE || WALNUT 161 depends on ASH || BAMBOO || BUBINGA || CPCI405 || EBONY || EP405 || LUAN || OCOTEA || REDWOOD_5 || REDWOOD_6 || SYCAMORE || WALNUT
146 default y 162 default y
147 163
148config XILINX_OCP 164config XILINX_OCP
@@ -160,6 +176,7 @@ config BIOS_FIXUP
160 depends on BUBINGA || EP405 || SYCAMORE || WALNUT 176 depends on BUBINGA || EP405 || SYCAMORE || WALNUT
161 default y 177 default y
162 178
179# OAK doesn't exist but wanted to keep this around for any future 403GCX boards
163config 403GCX 180config 403GCX
164 bool 181 bool
165 depends OAK 182 depends OAK
@@ -214,10 +231,6 @@ config PPC_GEN550
214 depends on 4xx 231 depends on 4xx
215 default y 232 default y
216 233
217config PM
218 bool "Power Management support (EXPERIMENTAL)"
219 depends on 4xx && EXPERIMENTAL
220
221choice 234choice
222 prompt "TTYS0 device and default console" 235 prompt "TTYS0 device and default console"
223 depends on 40x 236 depends on 40x
diff --git a/arch/ppc/platforms/4xx/Makefile b/arch/ppc/platforms/4xx/Makefile
index ea470c6adbb6..1dd6d7fd6a9a 100644
--- a/arch/ppc/platforms/4xx/Makefile
+++ b/arch/ppc/platforms/4xx/Makefile
@@ -1,13 +1,12 @@
1# 1#
2# Makefile for the PowerPC 4xx linux kernel. 2# Makefile for the PowerPC 4xx linux kernel.
3 3
4obj-$(CONFIG_ASH) += ash.o 4obj-$(CONFIG_BAMBOO) += bamboo.o
5obj-$(CONFIG_CPCI405) += cpci405.o 5obj-$(CONFIG_CPCI405) += cpci405.o
6obj-$(CONFIG_EBONY) += ebony.o 6obj-$(CONFIG_EBONY) += ebony.o
7obj-$(CONFIG_EP405) += ep405.o 7obj-$(CONFIG_EP405) += ep405.o
8obj-$(CONFIG_BUBINGA) += bubinga.o 8obj-$(CONFIG_BUBINGA) += bubinga.o
9obj-$(CONFIG_LUAN) += luan.o 9obj-$(CONFIG_LUAN) += luan.o
10obj-$(CONFIG_OAK) += oak.o
11obj-$(CONFIG_OCOTEA) += ocotea.o 10obj-$(CONFIG_OCOTEA) += ocotea.o
12obj-$(CONFIG_REDWOOD_5) += redwood5.o 11obj-$(CONFIG_REDWOOD_5) += redwood5.o
13obj-$(CONFIG_REDWOOD_6) += redwood6.o 12obj-$(CONFIG_REDWOOD_6) += redwood6.o
@@ -19,6 +18,7 @@ obj-$(CONFIG_405GP) += ibm405gp.o
19obj-$(CONFIG_REDWOOD_5) += ibmstb4.o 18obj-$(CONFIG_REDWOOD_5) += ibmstb4.o
20obj-$(CONFIG_NP405H) += ibmnp405h.o 19obj-$(CONFIG_NP405H) += ibmnp405h.o
21obj-$(CONFIG_REDWOOD_6) += ibmstbx25.o 20obj-$(CONFIG_REDWOOD_6) += ibmstbx25.o
21obj-$(CONFIG_440EP) += ibm440ep.o
22obj-$(CONFIG_440GP) += ibm440gp.o 22obj-$(CONFIG_440GP) += ibm440gp.o
23obj-$(CONFIG_440GX) += ibm440gx.o 23obj-$(CONFIG_440GX) += ibm440gx.o
24obj-$(CONFIG_440SP) += ibm440sp.o 24obj-$(CONFIG_440SP) += ibm440sp.o
diff --git a/arch/ppc/platforms/4xx/ash.c b/arch/ppc/platforms/4xx/ash.c
deleted file mode 100644
index ce2911793716..000000000000
--- a/arch/ppc/platforms/4xx/ash.c
+++ /dev/null
@@ -1,250 +0,0 @@
1/*
2 * arch/ppc/platforms/4xx/ash.c
3 *
4 * Support for the IBM NP405H ash eval board
5 *
6 * Author: Armin Kuster <akuster@mvista.com>
7 *
8 * 2001-2002 (c) MontaVista, Software, Inc. This file is licensed under
9 * the terms of the GNU General Public License version 2. This program
10 * is licensed "as is" without any warranty of any kind, whether express
11 * or implied.
12 */
13#include <linux/config.h>
14#include <linux/init.h>
15#include <linux/pagemap.h>
16#include <linux/pci.h>
17
18#include <asm/machdep.h>
19#include <asm/pci-bridge.h>
20#include <asm/io.h>
21#include <asm/ocp.h>
22#include <asm/ibm_ocp_pci.h>
23#include <asm/todc.h>
24
25#ifdef DEBUG
26#define DBG(x...) printk(x)
27#else
28#define DBG(x...)
29#endif
30
31void *ash_rtc_base;
32
33/* Some IRQs unique to Walnut.
34 * Used by the generic 405 PCI setup functions in ppc4xx_pci.c
35 */
36int __init
37ppc405_map_irq(struct pci_dev *dev, unsigned char idsel, unsigned char pin)
38{
39 static char pci_irq_table[][4] =
40 /*
41 * PCI IDSEL/INTPIN->INTLINE
42 * A B C D
43 */
44 {
45 {24, 24, 24, 24}, /* IDSEL 1 - PCI slot 1 */
46 {25, 25, 25, 25}, /* IDSEL 2 - PCI slot 2 */
47 {26, 26, 26, 26}, /* IDSEL 3 - PCI slot 3 */
48 {27, 27, 27, 27}, /* IDSEL 4 - PCI slot 4 */
49 };
50
51 const long min_idsel = 1, max_idsel = 4, irqs_per_slot = 4;
52 return PCI_IRQ_TABLE_LOOKUP;
53}
54
55void __init
56ash_setup_arch(void)
57{
58 ppc4xx_setup_arch();
59
60 ibm_ocp_set_emac(0, 3);
61
62#ifdef CONFIG_DEBUG_BRINGUP
63 int i;
64 printk("\n");
65 printk("machine\t: %s\n", PPC4xx_MACHINE_NAME);
66 printk("\n");
67 printk("bi_s_version\t %s\n", bip->bi_s_version);
68 printk("bi_r_version\t %s\n", bip->bi_r_version);
69 printk("bi_memsize\t 0x%8.8x\t %dMBytes\n", bip->bi_memsize,
70 bip->bi_memsize / (1024 * 1000));
71 for (i = 0; i < EMAC_NUMS; i++) {
72 printk("bi_enetaddr %d\t %2.2x%2.2x%2.2x-%2.2x%2.2x%2.2x\n", i,
73 bip->bi_enetaddr[i][0], bip->bi_enetaddr[i][1],
74 bip->bi_enetaddr[i][2], bip->bi_enetaddr[i][3],
75 bip->bi_enetaddr[i][4], bip->bi_enetaddr[i][5]);
76 }
77 printk("bi_pci_enetaddr %d\t %2.2x%2.2x%2.2x-%2.2x%2.2x%2.2x\n", 0,
78 bip->bi_pci_enetaddr[0], bip->bi_pci_enetaddr[1],
79 bip->bi_pci_enetaddr[2], bip->bi_pci_enetaddr[3],
80 bip->bi_pci_enetaddr[4], bip->bi_pci_enetaddr[5]);
81
82 printk("bi_intfreq\t 0x%8.8x\t clock:\t %dMhz\n",
83 bip->bi_intfreq, bip->bi_intfreq / 1000000);
84
85 printk("bi_busfreq\t 0x%8.8x\t plb bus clock:\t %dMHz\n",
86 bip->bi_busfreq, bip->bi_busfreq / 1000000);
87 printk("bi_pci_busfreq\t 0x%8.8x\t pci bus clock:\t %dMHz\n",
88 bip->bi_pci_busfreq, bip->bi_pci_busfreq / 1000000);
89
90 printk("\n");
91#endif
92 /* RTC step for ash */
93 ash_rtc_base = (void *) ASH_RTC_VADDR;
94 TODC_INIT(TODC_TYPE_DS1743, ash_rtc_base, ash_rtc_base, ash_rtc_base,
95 8);
96}
97
98void __init
99bios_fixup(struct pci_controller *hose, struct pcil0_regs *pcip)
100{
101 /*
102 * Expected PCI mapping:
103 *
104 * PLB addr PCI memory addr
105 * --------------------- ---------------------
106 * 0000'0000 - 7fff'ffff <--- 0000'0000 - 7fff'ffff
107 * 8000'0000 - Bfff'ffff ---> 8000'0000 - Bfff'ffff
108 *
109 * PLB addr PCI io addr
110 * --------------------- ---------------------
111 * e800'0000 - e800'ffff ---> 0000'0000 - 0001'0000
112 *
113 * The following code is simplified by assuming that the bootrom
114 * has been well behaved in following this mapping.
115 */
116
117#ifdef DEBUG
118 int i;
119
120 printk("ioremap PCLIO_BASE = 0x%x\n", pcip);
121 printk("PCI bridge regs before fixup \n");
122 for (i = 0; i <= 2; i++) {
123 printk(" pmm%dma\t0x%x\n", i, in_le32(&(pcip->pmm[i].ma)));
124 printk(" pmm%dla\t0x%x\n", i, in_le32(&(pcip->pmm[i].la)));
125 printk(" pmm%dpcila\t0x%x\n", i,
126 in_le32(&(pcip->pmm[i].pcila)));
127 printk(" pmm%dpciha\t0x%x\n", i,
128 in_le32(&(pcip->pmm[i].pciha)));
129 }
130 printk(" ptm1ms\t0x%x\n", in_le32(&(pcip->ptm1ms)));
131 printk(" ptm1la\t0x%x\n", in_le32(&(pcip->ptm1la)));
132 printk(" ptm2ms\t0x%x\n", in_le32(&(pcip->ptm2ms)));
133 printk(" ptm2la\t0x%x\n", in_le32(&(pcip->ptm2la)));
134 for (bar = PCI_BASE_ADDRESS_1; bar <= PCI_BASE_ADDRESS_2; bar += 4) {
135 early_read_config_dword(hose, hose->first_busno,
136 PCI_FUNC(hose->first_busno), bar,
137 &bar_response);
138 DBG("BUS %d, device %d, Function %d bar 0x%8.8x is 0x%8.8x\n",
139 hose->first_busno, PCI_SLOT(hose->first_busno),
140 PCI_FUNC(hose->first_busno), bar, bar_response);
141 }
142
143#endif
144 if (ppc_md.progress)
145 ppc_md.progress("bios_fixup(): enter", 0x800);
146
147 /* added for IBM boot rom version 1.15 bios bar changes -AK */
148
149 /* Disable region first */
150 out_le32((void *) &(pcip->pmm[0].ma), 0x00000000);
151 /* PLB starting addr, PCI: 0x80000000 */
152 out_le32((void *) &(pcip->pmm[0].la), 0x80000000);
153 /* PCI start addr, 0x80000000 */
154 out_le32((void *) &(pcip->pmm[0].pcila), PPC405_PCI_MEM_BASE);
155 /* 512MB range of PLB to PCI */
156 out_le32((void *) &(pcip->pmm[0].pciha), 0x00000000);
157 /* Enable no pre-fetch, enable region */
158 out_le32((void *) &(pcip->pmm[0].ma), ((0xffffffff -
159 (PPC405_PCI_UPPER_MEM -
160 PPC405_PCI_MEM_BASE)) | 0x01));
161
162 /* Disable region one */
163 out_le32((void *) &(pcip->pmm[1].ma), 0x00000000);
164 out_le32((void *) &(pcip->pmm[1].la), 0x00000000);
165 out_le32((void *) &(pcip->pmm[1].pcila), 0x00000000);
166 out_le32((void *) &(pcip->pmm[1].pciha), 0x00000000);
167 out_le32((void *) &(pcip->pmm[1].ma), 0x00000000);
168
169 /* Disable region two */
170 out_le32((void *) &(pcip->pmm[2].ma), 0x00000000);
171 out_le32((void *) &(pcip->pmm[2].la), 0x00000000);
172 out_le32((void *) &(pcip->pmm[2].pcila), 0x00000000);
173 out_le32((void *) &(pcip->pmm[2].pciha), 0x00000000);
174 out_le32((void *) &(pcip->pmm[2].ma), 0x00000000);
175
176 /* Enable PTM1 and PTM2, mapped to PLB address 0. */
177
178 out_le32((void *) &(pcip->ptm1la), 0x00000000);
179 out_le32((void *) &(pcip->ptm1ms), 0x00000001);
180 out_le32((void *) &(pcip->ptm2la), 0x00000000);
181 out_le32((void *) &(pcip->ptm2ms), 0x00000001);
182
183 /* Write zero to PTM1 BAR. */
184
185 early_write_config_dword(hose, hose->first_busno,
186 PCI_FUNC(hose->first_busno),
187 PCI_BASE_ADDRESS_1,
188 0x00000000);
189
190 /* Disable PTM2 (unused) */
191
192 out_le32((void *) &(pcip->ptm2la), 0x00000000);
193 out_le32((void *) &(pcip->ptm2ms), 0x00000000);
194
195 /* end work arround */
196 if (ppc_md.progress)
197 ppc_md.progress("bios_fixup(): done", 0x800);
198
199#ifdef DEBUG
200 printk("PCI bridge regs after fixup \n");
201 for (i = 0; i <= 2; i++) {
202 printk(" pmm%dma\t0x%x\n", i, in_le32(&(pcip->pmm[i].ma)));
203 printk(" pmm%dla\t0x%x\n", i, in_le32(&(pcip->pmm[i].la)));
204 printk(" pmm%dpcila\t0x%x\n", i,
205 in_le32(&(pcip->pmm[i].pcila)));
206 printk(" pmm%dpciha\t0x%x\n", i,
207 in_le32(&(pcip->pmm[i].pciha)));
208 }
209 printk(" ptm1ms\t0x%x\n", in_le32(&(pcip->ptm1ms)));
210 printk(" ptm1la\t0x%x\n", in_le32(&(pcip->ptm1la)));
211 printk(" ptm2ms\t0x%x\n", in_le32(&(pcip->ptm2ms)));
212 printk(" ptm2la\t0x%x\n", in_le32(&(pcip->ptm2la)));
213
214 for (bar = PCI_BASE_ADDRESS_1; bar <= PCI_BASE_ADDRESS_2; bar += 4) {
215 early_read_config_dword(hose, hose->first_busno,
216 PCI_FUNC(hose->first_busno), bar,
217 &bar_response);
218 DBG("BUS %d, device %d, Function %d bar 0x%8.8x is 0x%8.8x\n",
219 hose->first_busno, PCI_SLOT(hose->first_busno),
220 PCI_FUNC(hose->first_busno), bar, bar_response);
221 }
222
223
224#endif
225}
226
227void __init
228ash_map_io(void)
229{
230 ppc4xx_map_io();
231 io_block_mapping(ASH_RTC_VADDR, ASH_RTC_PADDR, ASH_RTC_SIZE, _PAGE_IO);
232}
233
234void __init
235platform_init(unsigned long r3, unsigned long r4, unsigned long r5,
236 unsigned long r6, unsigned long r7)
237{
238 ppc4xx_init(r3, r4, r5, r6, r7);
239
240 ppc_md.setup_arch = ash_setup_arch;
241 ppc_md.setup_io_mappings = ash_map_io;
242
243#ifdef CONFIG_PPC_RTC
244 ppc_md.time_init = todc_time_init;
245 ppc_md.set_rtc_time = todc_set_rtc_time;
246 ppc_md.get_rtc_time = todc_get_rtc_time;
247 ppc_md.nvram_read_val = todc_direct_read_val;
248 ppc_md.nvram_write_val = todc_direct_write_val;
249#endif
250}
diff --git a/arch/ppc/platforms/4xx/ash.h b/arch/ppc/platforms/4xx/ash.h
deleted file mode 100644
index 5f7448ea418d..000000000000
--- a/arch/ppc/platforms/4xx/ash.h
+++ /dev/null
@@ -1,83 +0,0 @@
1/*
2 * arch/ppc/platforms/4xx/ash.h
3 *
4 * Macros, definitions, and data structures specific to the IBM PowerPC
5 * Ash eval board.
6 *
7 * Author: Armin Kuster <akuster@mvista.com>
8 *
9 * 2000-2002 (c) MontaVista, Software, Inc. This file is licensed under
10 * the terms of the GNU General Public License version 2. This program
11 * is licensed "as is" without any warranty of any kind, whether express
12 * or implied.
13 */
14
15#ifdef __KERNEL__
16#ifndef __ASM_ASH_H__
17#define __ASM_ASH_H__
18#include <platforms/4xx/ibmnp405h.h>
19
20#ifndef __ASSEMBLY__
21/*
22 * Data structure defining board information maintained by the boot
23 * ROM on IBM's "Ash" evaluation board. An effort has been made to
24 * keep the field names consistent with the 8xx 'bd_t' board info
25 * structures.
26 */
27
28typedef struct board_info {
29 unsigned char bi_s_version[4]; /* Version of this structure */
30 unsigned char bi_r_version[30]; /* Version of the IBM ROM */
31 unsigned int bi_memsize; /* DRAM installed, in bytes */
32 unsigned char bi_enetaddr[4][6]; /* Local Ethernet MAC address */
33 unsigned char bi_pci_enetaddr[6];
34 unsigned int bi_intfreq; /* Processor speed, in Hz */
35 unsigned int bi_busfreq; /* PLB Bus speed, in Hz */
36 unsigned int bi_pci_busfreq; /* PCI speed in Hz */
37} bd_t;
38
39/* Some 4xx parts use a different timebase frequency from the internal clock.
40*/
41#define bi_tbfreq bi_intfreq
42
43/* Memory map for the IBM "Ash" NP405H evaluation board.
44 */
45
46extern void *ash_rtc_base;
47#define ASH_RTC_PADDR ((uint)0xf0000000)
48#define ASH_RTC_VADDR ASH_RTC_PADDR
49#define ASH_RTC_SIZE ((uint)8*1024)
50
51
52/* Early initialization address mapping for block_io.
53 * Standard 405GP map.
54 */
55#define PPC4xx_PCI_IO_PADDR ((uint)PPC405_PCI_PHY_IO_BASE)
56#define PPC4xx_PCI_IO_VADDR PPC4xx_PCI_IO_PADDR
57#define PPC4xx_PCI_IO_SIZE ((uint)64*1024)
58#define PPC4xx_PCI_CFG_PADDR ((uint)PPC405_PCI_CONFIG_ADDR)
59#define PPC4xx_PCI_CFG_VADDR PPC4xx_PCI_CFG_PADDR
60#define PPC4xx_PCI_CFG_SIZE ((uint)4*1024)
61#define PPC4xx_PCI_LCFG_PADDR ((uint)0xef400000)
62#define PPC4xx_PCI_LCFG_VADDR PPC4xx_PCI_LCFG_PADDR
63#define PPC4xx_PCI_LCFG_SIZE ((uint)4*1024)
64#define PPC4xx_ONB_IO_PADDR ((uint)0xef600000)
65#define PPC4xx_ONB_IO_VADDR PPC4xx_ONB_IO_PADDR
66#define PPC4xx_ONB_IO_SIZE ((uint)4*1024)
67
68#define NR_BOARD_IRQS 32
69
70#ifdef CONFIG_PPC405GP_INTERNAL_CLOCK
71#define BASE_BAUD 201600
72#else
73#define BASE_BAUD 691200
74#endif
75
76#define PPC4xx_MACHINE_NAME "IBM NP405H Ash"
77
78extern char pci_irq_table[][4];
79
80
81#endif /* !__ASSEMBLY__ */
82#endif /* __ASM_ASH_H__ */
83#endif /* __KERNEL__ */
diff --git a/arch/ppc/platforms/4xx/bamboo.c b/arch/ppc/platforms/4xx/bamboo.c
new file mode 100644
index 000000000000..ac391d463d78
--- /dev/null
+++ b/arch/ppc/platforms/4xx/bamboo.c
@@ -0,0 +1,456 @@
1/*
2 * arch/ppc/platforms/4xx/bamboo.c
3 *
4 * Bamboo board specific routines
5 *
6 * Wade Farnsworth <wfarnsworth@mvista.com>
7 * Copyright 2004 MontaVista Software Inc.
8 *
9 * This program is free software; you can redistribute it and/or modify it
10 * under the terms of the GNU General Public License as published by the
11 * Free Software Foundation; either version 2 of the License, or (at your
12 * option) any later version.
13 */
14
15#include <linux/config.h>
16#include <linux/stddef.h>
17#include <linux/kernel.h>
18#include <linux/init.h>
19#include <linux/errno.h>
20#include <linux/reboot.h>
21#include <linux/pci.h>
22#include <linux/kdev_t.h>
23#include <linux/types.h>
24#include <linux/major.h>
25#include <linux/blkdev.h>
26#include <linux/console.h>
27#include <linux/delay.h>
28#include <linux/ide.h>
29#include <linux/initrd.h>
30#include <linux/irq.h>
31#include <linux/seq_file.h>
32#include <linux/root_dev.h>
33#include <linux/tty.h>
34#include <linux/serial.h>
35#include <linux/serial_core.h>
36#include <linux/ethtool.h>
37
38#include <asm/system.h>
39#include <asm/pgtable.h>
40#include <asm/page.h>
41#include <asm/dma.h>
42#include <asm/io.h>
43#include <asm/machdep.h>
44#include <asm/ocp.h>
45#include <asm/pci-bridge.h>
46#include <asm/time.h>
47#include <asm/todc.h>
48#include <asm/bootinfo.h>
49#include <asm/ppc4xx_pic.h>
50#include <asm/ppcboot.h>
51
52#include <syslib/gen550.h>
53#include <syslib/ibm440gx_common.h>
54
55bd_t __res;
56
57static struct ibm44x_clocks clocks __initdata;
58
59/*
60 * Bamboo external IRQ triggering/polarity settings
61 */
62unsigned char ppc4xx_uic_ext_irq_cfg[] __initdata = {
63 (IRQ_SENSE_LEVEL | IRQ_POLARITY_NEGATIVE), /* IRQ0: Ethernet transceiver */
64 (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* IRQ1: Expansion connector */
65 (IRQ_SENSE_LEVEL | IRQ_POLARITY_NEGATIVE), /* IRQ2: PCI slot 0 */
66 (IRQ_SENSE_LEVEL | IRQ_POLARITY_NEGATIVE), /* IRQ3: PCI slot 1 */
67 (IRQ_SENSE_LEVEL | IRQ_POLARITY_NEGATIVE), /* IRQ4: PCI slot 2 */
68 (IRQ_SENSE_LEVEL | IRQ_POLARITY_NEGATIVE), /* IRQ5: PCI slot 3 */
69 (IRQ_SENSE_EDGE | IRQ_POLARITY_NEGATIVE), /* IRQ6: SMI pushbutton */
70 (IRQ_SENSE_LEVEL | IRQ_POLARITY_NEGATIVE), /* IRQ7: EXT */
71 (IRQ_SENSE_LEVEL | IRQ_POLARITY_NEGATIVE), /* IRQ8: EXT */
72 (IRQ_SENSE_LEVEL | IRQ_POLARITY_NEGATIVE), /* IRQ9: EXT */
73};
74
75static void __init
76bamboo_calibrate_decr(void)
77{
78 unsigned int freq;
79
80 if (mfspr(SPRN_CCR1) & CCR1_TCS)
81 freq = BAMBOO_TMRCLK;
82 else
83 freq = clocks.cpu;
84
85 ibm44x_calibrate_decr(freq);
86
87}
88
89static int
90bamboo_show_cpuinfo(struct seq_file *m)
91{
92 seq_printf(m, "vendor\t\t: IBM\n");
93 seq_printf(m, "machine\t\t: PPC440EP EVB (Bamboo)\n");
94
95 return 0;
96}
97
98static inline int
99bamboo_map_irq(struct pci_dev *dev, unsigned char idsel, unsigned char pin)
100{
101 static char pci_irq_table[][4] =
102 /*
103 * PCI IDSEL/INTPIN->INTLINE
104 * A B C D
105 */
106 {
107 { 28, 28, 28, 28 }, /* IDSEL 1 - PCI Slot 0 */
108 { 27, 27, 27, 27 }, /* IDSEL 2 - PCI Slot 1 */
109 { 26, 26, 26, 26 }, /* IDSEL 3 - PCI Slot 2 */
110 { 25, 25, 25, 25 }, /* IDSEL 4 - PCI Slot 3 */
111 };
112
113 const long min_idsel = 1, max_idsel = 4, irqs_per_slot = 4;
114 return PCI_IRQ_TABLE_LOOKUP;
115}
116
117static void __init bamboo_set_emacdata(void)
118{
119 u8 * base_addr;
120 struct ocp_def *def;
121 struct ocp_func_emac_data *emacdata;
122 u8 val;
123 int mode;
124 u32 excluded = 0;
125
126 base_addr = ioremap64(BAMBOO_FPGA_SELECTION1_REG_ADDR, 16);
127 val = readb(base_addr);
128 iounmap((void *) base_addr);
129 if (BAMBOO_SEL_MII(val))
130 mode = PHY_MODE_MII;
131 else if (BAMBOO_SEL_RMII(val))
132 mode = PHY_MODE_RMII;
133 else
134 mode = PHY_MODE_SMII;
135
136 /*
137 * SW2 on the Bamboo is used for ethernet configuration and is accessed
138 * via the CONFIG2 register in the FPGA. If the ANEG pin is set,
139 * overwrite the supported features with the settings in SW2.
140 *
141 * This is used as a workaround for the improperly biased RJ-45 sockets
142 * on the Rev. 0 Bamboo. By default only 10baseT is functional.
143 * Removing inductors L17 and L18 from the board allows 100baseT, but
144 * disables 10baseT. The Rev. 1 has no such limitations.
145 */
146
147 base_addr = ioremap64(BAMBOO_FPGA_CONFIG2_REG_ADDR, 8);
148 val = readb(base_addr);
149 iounmap((void *) base_addr);
150 if (!BAMBOO_AUTONEGOTIATE(val)) {
151 excluded |= SUPPORTED_Autoneg;
152 if (BAMBOO_FORCE_100Mbps(val)) {
153 excluded |= SUPPORTED_10baseT_Full;
154 excluded |= SUPPORTED_10baseT_Half;
155 if (BAMBOO_FULL_DUPLEX_EN(val))
156 excluded |= SUPPORTED_100baseT_Half;
157 else
158 excluded |= SUPPORTED_100baseT_Full;
159 } else {
160 excluded |= SUPPORTED_100baseT_Full;
161 excluded |= SUPPORTED_100baseT_Half;
162 if (BAMBOO_FULL_DUPLEX_EN(val))
163 excluded |= SUPPORTED_10baseT_Half;
164 else
165 excluded |= SUPPORTED_10baseT_Full;
166 }
167 }
168
169 /* Set mac_addr, phy mode and unsupported phy features for each EMAC */
170
171 def = ocp_get_one_device(OCP_VENDOR_IBM, OCP_FUNC_EMAC, 0);
172 emacdata = def->additions;
173 memcpy(emacdata->mac_addr, __res.bi_enetaddr, 6);
174 emacdata->phy_mode = mode;
175 emacdata->phy_feat_exc = excluded;
176
177 def = ocp_get_one_device(OCP_VENDOR_IBM, OCP_FUNC_EMAC, 1);
178 emacdata = def->additions;
179 memcpy(emacdata->mac_addr, __res.bi_enet1addr, 6);
180 emacdata->phy_mode = mode;
181 emacdata->phy_feat_exc = excluded;
182}
183
184static int
185bamboo_exclude_device(unsigned char bus, unsigned char devfn)
186{
187 return (bus == 0 && devfn == 0);
188}
189
190#define PCI_READW(offset) \
191 (readw((void *)((u32)pci_reg_base+offset)))
192
193#define PCI_WRITEW(value, offset) \
194 (writew(value, (void *)((u32)pci_reg_base+offset)))
195
196#define PCI_WRITEL(value, offset) \
197 (writel(value, (void *)((u32)pci_reg_base+offset)))
198
199static void __init
200bamboo_setup_pci(void)
201{
202 void *pci_reg_base;
203 unsigned long memory_size;
204 memory_size = ppc_md.find_end_of_memory();
205
206 pci_reg_base = ioremap64(BAMBOO_PCIL0_BASE, BAMBOO_PCIL0_SIZE);
207
208 /* Enable PCI I/O, Mem, and Busmaster cycles */
209 PCI_WRITEW(PCI_READW(PCI_COMMAND) |
210 PCI_COMMAND_MEMORY |
211 PCI_COMMAND_MASTER, PCI_COMMAND);
212
213 /* Disable region first */
214 PCI_WRITEL(0, BAMBOO_PCIL0_PMM0MA);
215
216 /* PLB starting addr: 0x00000000A0000000 */
217 PCI_WRITEL(BAMBOO_PCI_PHY_MEM_BASE, BAMBOO_PCIL0_PMM0LA);
218
219 /* PCI start addr, 0xA0000000 (PCI Address) */
220 PCI_WRITEL(BAMBOO_PCI_MEM_BASE, BAMBOO_PCIL0_PMM0PCILA);
221 PCI_WRITEL(0, BAMBOO_PCIL0_PMM0PCIHA);
222
223 /* Enable no pre-fetch, enable region */
224 PCI_WRITEL(((0xffffffff -
225 (BAMBOO_PCI_UPPER_MEM - BAMBOO_PCI_MEM_BASE)) | 0x01),
226 BAMBOO_PCIL0_PMM0MA);
227
228 /* Disable region one */
229 PCI_WRITEL(0, BAMBOO_PCIL0_PMM1MA);
230 PCI_WRITEL(0, BAMBOO_PCIL0_PMM1LA);
231 PCI_WRITEL(0, BAMBOO_PCIL0_PMM1PCILA);
232 PCI_WRITEL(0, BAMBOO_PCIL0_PMM1PCIHA);
233 PCI_WRITEL(0, BAMBOO_PCIL0_PMM1MA);
234
235 /* Disable region two */
236 PCI_WRITEL(0, BAMBOO_PCIL0_PMM2MA);
237 PCI_WRITEL(0, BAMBOO_PCIL0_PMM2LA);
238 PCI_WRITEL(0, BAMBOO_PCIL0_PMM2PCILA);
239 PCI_WRITEL(0, BAMBOO_PCIL0_PMM2PCIHA);
240 PCI_WRITEL(0, BAMBOO_PCIL0_PMM2MA);
241
242 /* Now configure the PCI->PLB windows, we only use PTM1
243 *
244 * For Inbound flow, set the window size to all available memory
245 * This is required because if size is smaller,
246 * then Eth/PCI DD would fail as PCI card not able to access
247 * the memory allocated by DD.
248 */
249
250 PCI_WRITEL(0, BAMBOO_PCIL0_PTM1MS); /* disabled region 1 */
251 PCI_WRITEL(0, BAMBOO_PCIL0_PTM1LA); /* begin of address map */
252
253 memory_size = 1 << fls(memory_size - 1);
254
255 /* Size low + Enabled */
256 PCI_WRITEL((0xffffffff - (memory_size - 1)) | 0x1, BAMBOO_PCIL0_PTM1MS);
257
258 eieio();
259 iounmap(pci_reg_base);
260}
261
262static void __init
263bamboo_setup_hose(void)
264{
265 unsigned int bar_response, bar;
266 struct pci_controller *hose;
267
268 bamboo_setup_pci();
269
270 hose = pcibios_alloc_controller();
271
272 if (!hose)
273 return;
274
275 hose->first_busno = 0;
276 hose->last_busno = 0xff;
277
278 hose->pci_mem_offset = BAMBOO_PCI_MEM_OFFSET;
279
280 pci_init_resource(&hose->io_resource,
281 BAMBOO_PCI_LOWER_IO,
282 BAMBOO_PCI_UPPER_IO,
283 IORESOURCE_IO,
284 "PCI host bridge");
285
286 pci_init_resource(&hose->mem_resources[0],
287 BAMBOO_PCI_LOWER_MEM,
288 BAMBOO_PCI_UPPER_MEM,
289 IORESOURCE_MEM,
290 "PCI host bridge");
291
292 ppc_md.pci_exclude_device = bamboo_exclude_device;
293
294 hose->io_space.start = BAMBOO_PCI_LOWER_IO;
295 hose->io_space.end = BAMBOO_PCI_UPPER_IO;
296 hose->mem_space.start = BAMBOO_PCI_LOWER_MEM;
297 hose->mem_space.end = BAMBOO_PCI_UPPER_MEM;
298 isa_io_base =
299 (unsigned long)ioremap64(BAMBOO_PCI_IO_BASE, BAMBOO_PCI_IO_SIZE);
300 hose->io_base_virt = (void *)isa_io_base;
301
302 setup_indirect_pci(hose,
303 BAMBOO_PCI_CFGA_PLB32,
304 BAMBOO_PCI_CFGD_PLB32);
305 hose->set_cfg_type = 1;
306
307 /* Zero config bars */
308 for (bar = PCI_BASE_ADDRESS_1; bar <= PCI_BASE_ADDRESS_2; bar += 4) {
309 early_write_config_dword(hose, hose->first_busno,
310 PCI_FUNC(hose->first_busno), bar,
311 0x00000000);
312 early_read_config_dword(hose, hose->first_busno,
313 PCI_FUNC(hose->first_busno), bar,
314 &bar_response);
315 }
316
317 hose->last_busno = pciauto_bus_scan(hose, hose->first_busno);
318
319 ppc_md.pci_swizzle = common_swizzle;
320 ppc_md.pci_map_irq = bamboo_map_irq;
321}
322
323TODC_ALLOC();
324
325static void __init
326bamboo_early_serial_map(void)
327{
328 struct uart_port port;
329
330 /* Setup ioremapped serial port access */
331 memset(&port, 0, sizeof(port));
332 port.membase = ioremap64(PPC440EP_UART0_ADDR, 8);
333 port.irq = 0;
334 port.uartclk = clocks.uart0;
335 port.regshift = 0;
336 port.iotype = SERIAL_IO_MEM;
337 port.flags = ASYNC_BOOT_AUTOCONF | ASYNC_SKIP_TEST;
338 port.line = 0;
339
340 if (early_serial_setup(&port) != 0) {
341 printk("Early serial init of port 0 failed\n");
342 }
343
344#if defined(CONFIG_SERIAL_TEXT_DEBUG) || defined(CONFIG_KGDB)
345 /* Configure debug serial access */
346 gen550_init(0, &port);
347#endif
348
349 port.membase = ioremap64(PPC440EP_UART1_ADDR, 8);
350 port.irq = 1;
351 port.uartclk = clocks.uart1;
352 port.line = 1;
353
354 if (early_serial_setup(&port) != 0) {
355 printk("Early serial init of port 1 failed\n");
356 }
357
358#if defined(CONFIG_SERIAL_TEXT_DEBUG) || defined(CONFIG_KGDB)
359 /* Configure debug serial access */
360 gen550_init(1, &port);
361#endif
362
363 port.membase = ioremap64(PPC440EP_UART2_ADDR, 8);
364 port.irq = 3;
365 port.uartclk = clocks.uart2;
366 port.line = 2;
367
368 if (early_serial_setup(&port) != 0) {
369 printk("Early serial init of port 2 failed\n");
370 }
371
372#if defined(CONFIG_SERIAL_TEXT_DEBUG) || defined(CONFIG_KGDB)
373 /* Configure debug serial access */
374 gen550_init(2, &port);
375#endif
376
377 port.membase = ioremap64(PPC440EP_UART3_ADDR, 8);
378 port.irq = 4;
379 port.uartclk = clocks.uart3;
380 port.line = 3;
381
382 if (early_serial_setup(&port) != 0) {
383 printk("Early serial init of port 3 failed\n");
384 }
385}
386
387static void __init
388bamboo_setup_arch(void)
389{
390
391 bamboo_set_emacdata();
392
393 ibm440gx_get_clocks(&clocks, 33333333, 6 * 1843200);
394 ocp_sys_info.opb_bus_freq = clocks.opb;
395
396 /* Setup TODC access */
397 TODC_INIT(TODC_TYPE_DS1743,
398 0,
399 0,
400 ioremap64(BAMBOO_RTC_ADDR, BAMBOO_RTC_SIZE),
401 8);
402
403 /* init to some ~sane value until calibrate_delay() runs */
404 loops_per_jiffy = 50000000/HZ;
405
406 /* Setup PCI host bridge */
407 bamboo_setup_hose();
408
409#ifdef CONFIG_BLK_DEV_INITRD
410 if (initrd_start)
411 ROOT_DEV = Root_RAM0;
412 else
413#endif
414#ifdef CONFIG_ROOT_NFS
415 ROOT_DEV = Root_NFS;
416#else
417 ROOT_DEV = Root_HDA1;
418#endif
419
420 bamboo_early_serial_map();
421
422 /* Identify the system */
423 printk("IBM Bamboo port (MontaVista Software, Inc. (source@mvista.com))\n");
424}
425
426void __init platform_init(unsigned long r3, unsigned long r4,
427 unsigned long r5, unsigned long r6, unsigned long r7)
428{
429 parse_bootinfo(find_bootinfo());
430
431 /*
432 * If we were passed in a board information, copy it into the
433 * residual data area.
434 */
435 if (r3)
436 __res = *(bd_t *)(r3 + KERNELBASE);
437
438
439 ibm44x_platform_init();
440
441 ppc_md.setup_arch = bamboo_setup_arch;
442 ppc_md.show_cpuinfo = bamboo_show_cpuinfo;
443 ppc_md.get_irq = NULL; /* Set in ppc4xx_pic_init() */
444
445 ppc_md.calibrate_decr = bamboo_calibrate_decr;
446 ppc_md.time_init = todc_time_init;
447 ppc_md.set_rtc_time = todc_set_rtc_time;
448 ppc_md.get_rtc_time = todc_get_rtc_time;
449
450 ppc_md.nvram_read_val = todc_direct_read_val;
451 ppc_md.nvram_write_val = todc_direct_write_val;
452#ifdef CONFIG_KGDB
453 ppc_md.early_serial_map = bamboo_early_serial_map;
454#endif
455}
456
diff --git a/arch/ppc/platforms/4xx/bamboo.h b/arch/ppc/platforms/4xx/bamboo.h
new file mode 100644
index 000000000000..5c0192826494
--- /dev/null
+++ b/arch/ppc/platforms/4xx/bamboo.h
@@ -0,0 +1,136 @@
1/*
2 * arch/ppc/platforms/bamboo.h
3 *
4 * Bamboo board definitions
5 *
6 * Wade Farnsworth <wfarnsworth@mvista.com>
7 *
8 * Copyright 2004 MontaVista Software 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#ifdef __KERNEL__
17#ifndef __ASM_BAMBOO_H__
18#define __ASM_BAMBOO_H__
19
20#include <linux/config.h>
21#include <platforms/4xx/ibm440ep.h>
22
23/* F/W TLB mapping used in bootloader glue to reset EMAC */
24#define PPC44x_EMAC0_MR0 0x0EF600E00
25
26/* Location of MAC addresses in PIBS image */
27#define PIBS_FLASH_BASE 0xfff00000
28#define PIBS_MAC_BASE (PIBS_FLASH_BASE+0xc0400)
29#define PIBS_MAC_SIZE 0x200
30#define PIBS_MAC_OFFSET 0x100
31
32/* Default clock rate */
33#define BAMBOO_TMRCLK 25000000
34
35/* RTC/NVRAM location */
36#define BAMBOO_RTC_ADDR 0x080000000ULL
37#define BAMBOO_RTC_SIZE 0x2000
38
39/* FPGA Registers */
40#define BAMBOO_FPGA_ADDR 0x080002000ULL
41
42#define BAMBOO_FPGA_CONFIG2_REG_ADDR (BAMBOO_FPGA_ADDR + 0x1)
43#define BAMBOO_FULL_DUPLEX_EN(x) (x & 0x08)
44#define BAMBOO_FORCE_100Mbps(x) (x & 0x04)
45#define BAMBOO_AUTONEGOTIATE(x) (x & 0x02)
46
47#define BAMBOO_FPGA_SETTING_REG_ADDR (BAMBOO_FPGA_ADDR + 0x3)
48#define BAMBOO_BOOT_SMALL_FLASH(x) (!(x & 0x80))
49#define BAMBOO_LARGE_FLASH_EN(x) (!(x & 0x40))
50#define BAMBOO_BOOT_NAND_FLASH(x) (!(x & 0x20))
51
52#define BAMBOO_FPGA_SELECTION1_REG_ADDR (BAMBOO_FPGA_ADDR + 0x4)
53#define BAMBOO_SEL_MII(x) (x & 0x80)
54#define BAMBOO_SEL_RMII(x) (x & 0x40)
55#define BAMBOO_SEL_SMII(x) (x & 0x20)
56
57/* Flash */
58#define BAMBOO_SMALL_FLASH_LOW 0x087f00000ULL
59#define BAMBOO_SMALL_FLASH_HIGH 0x0fff00000ULL
60#define BAMBOO_SMALL_FLASH_SIZE 0x100000
61#define BAMBOO_LARGE_FLASH_LOW 0x087800000ULL
62#define BAMBOO_LARGE_FLASH_HIGH1 0x0ff800000ULL
63#define BAMBOO_LARGE_FLASH_HIGH2 0x0ffc00000ULL
64#define BAMBOO_LARGE_FLASH_SIZE 0x400000
65#define BAMBOO_SRAM_LOW 0x087f00000ULL
66#define BAMBOO_SRAM_HIGH1 0x0fff00000ULL
67#define BAMBOO_SRAM_HIGH2 0x0ff800000ULL
68#define BAMBOO_SRAM_SIZE 0x100000
69#define BAMBOO_NAND_FLASH_REG_ADDR 0x090000000ULL
70#define BAMBOO_NAND_FLASH_REG_SIZE 0x2000
71
72/*
73 * Serial port defines
74 */
75#define RS_TABLE_SIZE 4
76
77#define UART0_IO_BASE 0xEF600300
78#define UART1_IO_BASE 0xEF600400
79#define UART2_IO_BASE 0xEF600500
80#define UART3_IO_BASE 0xEF600600
81
82#define BASE_BAUD 33177600/3/16
83#define UART0_INT 0
84#define UART1_INT 1
85#define UART2_INT 3
86#define UART3_INT 4
87
88#define STD_UART_OP(num) \
89 { 0, BASE_BAUD, 0, UART##num##_INT, \
90 (ASYNC_BOOT_AUTOCONF | ASYNC_SKIP_TEST), \
91 iomem_base: (void*)UART##num##_IO_BASE, \
92 io_type: SERIAL_IO_MEM},
93
94#define SERIAL_PORT_DFNS \
95 STD_UART_OP(0) \
96 STD_UART_OP(1) \
97 STD_UART_OP(2) \
98 STD_UART_OP(3)
99
100/* PCI support */
101#define BAMBOO_PCI_CFGA_PLB32 0xeec00000
102#define BAMBOO_PCI_CFGD_PLB32 0xeec00004
103
104#define BAMBOO_PCI_IO_BASE 0x00000000e8000000ULL
105#define BAMBOO_PCI_IO_SIZE 0x00010000
106#define BAMBOO_PCI_MEM_OFFSET 0x00000000
107#define BAMBOO_PCI_PHY_MEM_BASE 0x00000000a0000000ULL
108
109#define BAMBOO_PCI_LOWER_IO 0x00000000
110#define BAMBOO_PCI_UPPER_IO 0x0000ffff
111#define BAMBOO_PCI_LOWER_MEM 0xa0000000
112#define BAMBOO_PCI_UPPER_MEM 0xafffffff
113#define BAMBOO_PCI_MEM_BASE 0xa0000000
114
115#define BAMBOO_PCIL0_BASE 0x00000000ef400000ULL
116#define BAMBOO_PCIL0_SIZE 0x40
117
118#define BAMBOO_PCIL0_PMM0LA 0x000
119#define BAMBOO_PCIL0_PMM0MA 0x004
120#define BAMBOO_PCIL0_PMM0PCILA 0x008
121#define BAMBOO_PCIL0_PMM0PCIHA 0x00C
122#define BAMBOO_PCIL0_PMM1LA 0x010
123#define BAMBOO_PCIL0_PMM1MA 0x014
124#define BAMBOO_PCIL0_PMM1PCILA 0x018
125#define BAMBOO_PCIL0_PMM1PCIHA 0x01C
126#define BAMBOO_PCIL0_PMM2LA 0x020
127#define BAMBOO_PCIL0_PMM2MA 0x024
128#define BAMBOO_PCIL0_PMM2PCILA 0x028
129#define BAMBOO_PCIL0_PMM2PCIHA 0x02C
130#define BAMBOO_PCIL0_PTM1MS 0x030
131#define BAMBOO_PCIL0_PTM1LA 0x034
132#define BAMBOO_PCIL0_PTM2MS 0x038
133#define BAMBOO_PCIL0_PTM2LA 0x03C
134
135#endif /* __ASM_BAMBOO_H__ */
136#endif /* __KERNEL__ */
diff --git a/arch/ppc/platforms/4xx/ebony.c b/arch/ppc/platforms/4xx/ebony.c
index cd11734ef7c5..0fd3442f5131 100644
--- a/arch/ppc/platforms/4xx/ebony.c
+++ b/arch/ppc/platforms/4xx/ebony.c
@@ -7,7 +7,7 @@
7 * Copyright 2002-2005 MontaVista Software Inc. 7 * Copyright 2002-2005 MontaVista Software Inc.
8 * 8 *
9 * Eugene Surovegin <eugene.surovegin@zultys.com> or <ebs@ebshome.net> 9 * Eugene Surovegin <eugene.surovegin@zultys.com> or <ebs@ebshome.net>
10 * Copyright (c) 2003, 2004 Zultys Technologies 10 * Copyright (c) 2003-2005 Zultys Technologies
11 * 11 *
12 * This program is free software; you can redistribute it and/or modify it 12 * This program is free software; you can redistribute it and/or modify it
13 * under the terms of the GNU General Public License as published by the 13 * under the terms of the GNU General Public License as published by the
@@ -50,17 +50,11 @@
50#include <asm/bootinfo.h> 50#include <asm/bootinfo.h>
51#include <asm/ppc4xx_pic.h> 51#include <asm/ppc4xx_pic.h>
52#include <asm/ppcboot.h> 52#include <asm/ppcboot.h>
53#include <asm/tlbflush.h>
53 54
54#include <syslib/gen550.h> 55#include <syslib/gen550.h>
55#include <syslib/ibm440gp_common.h> 56#include <syslib/ibm440gp_common.h>
56 57
57/*
58 * This is a horrible kludge, we eventually need to abstract this
59 * generic PHY stuff, so the standard phy mode defines can be
60 * easily used from arch code.
61 */
62#include "../../../../drivers/net/ibm_emac/ibm_emac_phy.h"
63
64bd_t __res; 58bd_t __res;
65 59
66static struct ibm44x_clocks clocks __initdata; 60static struct ibm44x_clocks clocks __initdata;
@@ -248,6 +242,9 @@ ebony_early_serial_map(void)
248#if defined(CONFIG_SERIAL_TEXT_DEBUG) || defined(CONFIG_KGDB) 242#if defined(CONFIG_SERIAL_TEXT_DEBUG) || defined(CONFIG_KGDB)
249 /* Configure debug serial access */ 243 /* Configure debug serial access */
250 gen550_init(0, &port); 244 gen550_init(0, &port);
245
246 /* Purge TLB entry added in head_44x.S for early serial access */
247 _tlbie(UART0_IO_BASE);
251#endif 248#endif
252 249
253 port.membase = ioremap64(PPC440GP_UART1_ADDR, 8); 250 port.membase = ioremap64(PPC440GP_UART1_ADDR, 8);
diff --git a/arch/ppc/platforms/4xx/ebony.h b/arch/ppc/platforms/4xx/ebony.h
index 47c391c9174d..d08faa46a0ae 100644
--- a/arch/ppc/platforms/4xx/ebony.h
+++ b/arch/ppc/platforms/4xx/ebony.h
@@ -56,9 +56,18 @@
56 * Serial port defines 56 * Serial port defines
57 */ 57 */
58 58
59/* OpenBIOS defined UART mappings, used before early_serial_setup */ 59#if defined(__BOOTER__)
60/* OpenBIOS defined UART mappings, used by bootloader shim */
60#define UART0_IO_BASE 0xE0000200 61#define UART0_IO_BASE 0xE0000200
61#define UART1_IO_BASE 0xE0000300 62#define UART1_IO_BASE 0xE0000300
63#else
64/* head_44x.S created UART mapping, used before early_serial_setup.
65 * We cannot use default OpenBIOS UART mappings because they
66 * don't work for configurations with more than 512M RAM. --ebs
67 */
68#define UART0_IO_BASE 0xF0000200
69#define UART1_IO_BASE 0xF0000300
70#endif
62 71
63/* external Epson SG-615P */ 72/* external Epson SG-615P */
64#define BASE_BAUD 691200 73#define BASE_BAUD 691200
@@ -66,7 +75,7 @@
66#define STD_UART_OP(num) \ 75#define STD_UART_OP(num) \
67 { 0, BASE_BAUD, 0, UART##num##_INT, \ 76 { 0, BASE_BAUD, 0, UART##num##_INT, \
68 (ASYNC_BOOT_AUTOCONF | ASYNC_SKIP_TEST), \ 77 (ASYNC_BOOT_AUTOCONF | ASYNC_SKIP_TEST), \
69 iomem_base: UART##num##_IO_BASE, \ 78 iomem_base: (void*)UART##num##_IO_BASE, \
70 io_type: SERIAL_IO_MEM}, 79 io_type: SERIAL_IO_MEM},
71 80
72#define SERIAL_PORT_DFNS \ 81#define SERIAL_PORT_DFNS \
diff --git a/arch/ppc/platforms/4xx/ibm405ep.c b/arch/ppc/platforms/4xx/ibm405ep.c
index 6d44567f4dd2..093b28d27a41 100644
--- a/arch/ppc/platforms/4xx/ibm405ep.c
+++ b/arch/ppc/platforms/4xx/ibm405ep.c
@@ -33,6 +33,7 @@ static struct ocp_func_mal_data ibm405ep_mal0_def = {
33 .txde_irq = 13, /* TX Descriptor Error IRQ */ 33 .txde_irq = 13, /* TX Descriptor Error IRQ */
34 .rxde_irq = 14, /* RX Descriptor Error IRQ */ 34 .rxde_irq = 14, /* RX Descriptor Error IRQ */
35 .serr_irq = 10, /* MAL System Error IRQ */ 35 .serr_irq = 10, /* MAL System Error IRQ */
36 .dcr_base = DCRN_MAL_BASE /* MAL0_CFG DCR number */
36}; 37};
37OCP_SYSFS_MAL_DATA() 38OCP_SYSFS_MAL_DATA()
38 39
diff --git a/arch/ppc/platforms/4xx/ibm405gp.c b/arch/ppc/platforms/4xx/ibm405gp.c
index dfd7ef3ba5f8..e5700469a682 100644
--- a/arch/ppc/platforms/4xx/ibm405gp.c
+++ b/arch/ppc/platforms/4xx/ibm405gp.c
@@ -46,6 +46,7 @@ static struct ocp_func_mal_data ibm405gp_mal0_def = {
46 .txde_irq = 13, /* TX Descriptor Error IRQ */ 46 .txde_irq = 13, /* TX Descriptor Error IRQ */
47 .rxde_irq = 14, /* RX Descriptor Error IRQ */ 47 .rxde_irq = 14, /* RX Descriptor Error IRQ */
48 .serr_irq = 10, /* MAL System Error IRQ */ 48 .serr_irq = 10, /* MAL System Error IRQ */
49 .dcr_base = DCRN_MAL_BASE /* MAL0_CFG DCR number */
49}; 50};
50OCP_SYSFS_MAL_DATA() 51OCP_SYSFS_MAL_DATA()
51 52
diff --git a/arch/ppc/platforms/4xx/ibm405gpr.c b/arch/ppc/platforms/4xx/ibm405gpr.c
index 01c8ccbc7214..cd0d00d8e8ee 100644
--- a/arch/ppc/platforms/4xx/ibm405gpr.c
+++ b/arch/ppc/platforms/4xx/ibm405gpr.c
@@ -42,6 +42,7 @@ static struct ocp_func_mal_data ibm405gpr_mal0_def = {
42 .txde_irq = 13, /* TX Descriptor Error IRQ */ 42 .txde_irq = 13, /* TX Descriptor Error IRQ */
43 .rxde_irq = 14, /* RX Descriptor Error IRQ */ 43 .rxde_irq = 14, /* RX Descriptor Error IRQ */
44 .serr_irq = 10, /* MAL System Error IRQ */ 44 .serr_irq = 10, /* MAL System Error IRQ */
45 .dcr_base = DCRN_MAL_BASE /* MAL0_CFG DCR number */
45}; 46};
46OCP_SYSFS_MAL_DATA() 47OCP_SYSFS_MAL_DATA()
47 48
diff --git a/arch/ppc/platforms/4xx/ibm440ep.c b/arch/ppc/platforms/4xx/ibm440ep.c
new file mode 100644
index 000000000000..4712de8ff80f
--- /dev/null
+++ b/arch/ppc/platforms/4xx/ibm440ep.c
@@ -0,0 +1,221 @@
1/*
2 * arch/ppc/platforms/4xx/ibm440ep.c
3 *
4 * PPC440EP I/O descriptions
5 *
6 * Wade Farnsworth <wfarnsworth@mvista.com>
7 * Copyright 2004 MontaVista Software Inc.
8 *
9 * This program is free software; you can redistribute it and/or modify it
10 * under the terms of the GNU General Public License as published by the
11 * Free Software Foundation; either version 2 of the License, or (at your
12 * option) any later version.
13 *
14 */
15#include <linux/init.h>
16#include <linux/module.h>
17#include <platforms/4xx/ibm440ep.h>
18#include <asm/ocp.h>
19#include <asm/ppc4xx_pic.h>
20
21static struct ocp_func_emac_data ibm440ep_emac0_def = {
22 .rgmii_idx = -1, /* No RGMII */
23 .rgmii_mux = -1, /* No RGMII */
24 .zmii_idx = 0, /* ZMII device index */
25 .zmii_mux = 0, /* ZMII input of this EMAC */
26 .mal_idx = 0, /* MAL device index */
27 .mal_rx_chan = 0, /* MAL rx channel number */
28 .mal_tx_chan = 0, /* MAL tx channel number */
29 .wol_irq = 61, /* WOL interrupt number */
30 .mdio_idx = -1, /* No shared MDIO */
31 .tah_idx = -1, /* No TAH */
32};
33
34static struct ocp_func_emac_data ibm440ep_emac1_def = {
35 .rgmii_idx = -1, /* No RGMII */
36 .rgmii_mux = -1, /* No RGMII */
37 .zmii_idx = 0, /* ZMII device index */
38 .zmii_mux = 1, /* ZMII input of this EMAC */
39 .mal_idx = 0, /* MAL device index */
40 .mal_rx_chan = 1, /* MAL rx channel number */
41 .mal_tx_chan = 2, /* MAL tx channel number */
42 .wol_irq = 63, /* WOL interrupt number */
43 .mdio_idx = -1, /* No shared MDIO */
44 .tah_idx = -1, /* No TAH */
45};
46OCP_SYSFS_EMAC_DATA()
47
48static struct ocp_func_mal_data ibm440ep_mal0_def = {
49 .num_tx_chans = 4, /* Number of TX channels */
50 .num_rx_chans = 2, /* Number of RX channels */
51 .txeob_irq = 10, /* TX End Of Buffer IRQ */
52 .rxeob_irq = 11, /* RX End Of Buffer IRQ */
53 .txde_irq = 33, /* TX Descriptor Error IRQ */
54 .rxde_irq = 34, /* RX Descriptor Error IRQ */
55 .serr_irq = 32, /* MAL System Error IRQ */
56 .dcr_base = DCRN_MAL_BASE /* MAL0_CFG DCR number */
57};
58OCP_SYSFS_MAL_DATA()
59
60static struct ocp_func_iic_data ibm440ep_iic0_def = {
61 .fast_mode = 0, /* Use standad mode (100Khz) */
62};
63
64static struct ocp_func_iic_data ibm440ep_iic1_def = {
65 .fast_mode = 0, /* Use standad mode (100Khz) */
66};
67OCP_SYSFS_IIC_DATA()
68
69struct ocp_def core_ocp[] = {
70 { .vendor = OCP_VENDOR_IBM,
71 .function = OCP_FUNC_OPB,
72 .index = 0,
73 .paddr = 0x0EF600000ULL,
74 .irq = OCP_IRQ_NA,
75 .pm = OCP_CPM_NA,
76 },
77 { .vendor = OCP_VENDOR_IBM,
78 .function = OCP_FUNC_16550,
79 .index = 0,
80 .paddr = PPC440EP_UART0_ADDR,
81 .irq = UART0_INT,
82 .pm = IBM_CPM_UART0,
83 },
84 { .vendor = OCP_VENDOR_IBM,
85 .function = OCP_FUNC_16550,
86 .index = 1,
87 .paddr = PPC440EP_UART1_ADDR,
88 .irq = UART1_INT,
89 .pm = IBM_CPM_UART1,
90 },
91 { .vendor = OCP_VENDOR_IBM,
92 .function = OCP_FUNC_16550,
93 .index = 2,
94 .paddr = PPC440EP_UART2_ADDR,
95 .irq = UART2_INT,
96 .pm = IBM_CPM_UART2,
97 },
98 { .vendor = OCP_VENDOR_IBM,
99 .function = OCP_FUNC_16550,
100 .index = 3,
101 .paddr = PPC440EP_UART3_ADDR,
102 .irq = UART3_INT,
103 .pm = IBM_CPM_UART3,
104 },
105 { .vendor = OCP_VENDOR_IBM,
106 .function = OCP_FUNC_IIC,
107 .index = 0,
108 .paddr = 0x0EF600700ULL,
109 .irq = 2,
110 .pm = IBM_CPM_IIC0,
111 .additions = &ibm440ep_iic0_def,
112 .show = &ocp_show_iic_data
113 },
114 { .vendor = OCP_VENDOR_IBM,
115 .function = OCP_FUNC_IIC,
116 .index = 1,
117 .paddr = 0x0EF600800ULL,
118 .irq = 7,
119 .pm = IBM_CPM_IIC1,
120 .additions = &ibm440ep_iic1_def,
121 .show = &ocp_show_iic_data
122 },
123 { .vendor = OCP_VENDOR_IBM,
124 .function = OCP_FUNC_GPIO,
125 .index = 0,
126 .paddr = 0x0EF600B00ULL,
127 .irq = OCP_IRQ_NA,
128 .pm = IBM_CPM_GPIO0,
129 },
130 { .vendor = OCP_VENDOR_IBM,
131 .function = OCP_FUNC_GPIO,
132 .index = 1,
133 .paddr = 0x0EF600C00ULL,
134 .irq = OCP_IRQ_NA,
135 .pm = OCP_CPM_NA,
136 },
137 { .vendor = OCP_VENDOR_IBM,
138 .function = OCP_FUNC_MAL,
139 .paddr = OCP_PADDR_NA,
140 .irq = OCP_IRQ_NA,
141 .pm = OCP_CPM_NA,
142 .additions = &ibm440ep_mal0_def,
143 .show = &ocp_show_mal_data,
144 },
145 { .vendor = OCP_VENDOR_IBM,
146 .function = OCP_FUNC_EMAC,
147 .index = 0,
148 .paddr = 0x0EF600E00ULL,
149 .irq = 60,
150 .pm = OCP_CPM_NA,
151 .additions = &ibm440ep_emac0_def,
152 .show = &ocp_show_emac_data,
153 },
154 { .vendor = OCP_VENDOR_IBM,
155 .function = OCP_FUNC_EMAC,
156 .index = 1,
157 .paddr = 0x0EF600F00ULL,
158 .irq = 62,
159 .pm = OCP_CPM_NA,
160 .additions = &ibm440ep_emac1_def,
161 .show = &ocp_show_emac_data,
162 },
163 { .vendor = OCP_VENDOR_IBM,
164 .function = OCP_FUNC_ZMII,
165 .paddr = 0x0EF600D00ULL,
166 .irq = OCP_IRQ_NA,
167 .pm = OCP_CPM_NA,
168 },
169 { .vendor = OCP_VENDOR_INVALID
170 }
171};
172
173/* Polarity and triggering settings for internal interrupt sources */
174struct ppc4xx_uic_settings ppc4xx_core_uic_cfg[] __initdata = {
175 { .polarity = 0xffbffe03,
176 .triggering = 0xfffffe00,
177 .ext_irq_mask = 0x000001fc, /* IRQ0 - IRQ6 */
178 },
179 { .polarity = 0xffffc6ef,
180 .triggering = 0xffffc7ff,
181 .ext_irq_mask = 0x00003800, /* IRQ7 - IRQ9 */
182 },
183};
184
185static struct resource usb_gadget_resources[] = {
186 [0] = {
187 .start = 0x050000100ULL,
188 .end = 0x05000017FULL,
189 .flags = IORESOURCE_MEM,
190 },
191 [1] = {
192 .start = 55,
193 .end = 55,
194 .flags = IORESOURCE_IRQ,
195 },
196};
197
198static u64 dma_mask = 0xffffffffULL;
199
200static struct platform_device usb_gadget_device = {
201 .name = "musbhsfc",
202 .id = 0,
203 .num_resources = ARRAY_SIZE(usb_gadget_resources),
204 .resource = usb_gadget_resources,
205 .dev = {
206 .dma_mask = &dma_mask,
207 .coherent_dma_mask = 0xffffffffULL,
208 }
209};
210
211static struct platform_device *ibm440ep_devs[] __initdata = {
212 &usb_gadget_device,
213};
214
215static int __init
216ibm440ep_platform_add_devices(void)
217{
218 return platform_add_devices(ibm440ep_devs, ARRAY_SIZE(ibm440ep_devs));
219}
220arch_initcall(ibm440ep_platform_add_devices);
221
diff --git a/arch/ppc/platforms/4xx/ibm440ep.h b/arch/ppc/platforms/4xx/ibm440ep.h
new file mode 100644
index 000000000000..97c80b8e3e10
--- /dev/null
+++ b/arch/ppc/platforms/4xx/ibm440ep.h
@@ -0,0 +1,76 @@
1/*
2 * arch/ppc/platforms/4xx/ibm440ep.h
3 *
4 * PPC440EP definitions
5 *
6 * Wade Farnsworth <wfarnsworth@mvista.com>
7 *
8 * Copyright 2002 Roland Dreier
9 * Copyright 2004 MontaVista Software, Inc.
10 *
11 * This program is free software; you can redistribute it and/or modify it
12 * under the terms of the GNU General Public License as published by the
13 * Free Software Foundation; either version 2 of the License, or (at your
14 * option) any later version.
15 *
16 */
17
18#ifdef __KERNEL__
19#ifndef __PPC_PLATFORMS_IBM440EP_H
20#define __PPC_PLATFORMS_IBM440EP_H
21
22#include <linux/config.h>
23#include <asm/ibm44x.h>
24
25/* UART */
26#define PPC440EP_UART0_ADDR 0x0EF600300
27#define PPC440EP_UART1_ADDR 0x0EF600400
28#define PPC440EP_UART2_ADDR 0x0EF600500
29#define PPC440EP_UART3_ADDR 0x0EF600600
30#define UART0_INT 0
31#define UART1_INT 1
32#define UART2_INT 3
33#define UART3_INT 4
34
35/* Clock and Power Management */
36#define IBM_CPM_IIC0 0x80000000 /* IIC interface */
37#define IBM_CPM_IIC1 0x40000000 /* IIC interface */
38#define IBM_CPM_PCI 0x20000000 /* PCI bridge */
39#define IBM_CPM_USB1H 0x08000000 /* USB 1.1 Host */
40#define IBM_CPM_FPU 0x04000000 /* floating point unit */
41#define IBM_CPM_CPU 0x02000000 /* processor core */
42#define IBM_CPM_DMA 0x01000000 /* DMA controller */
43#define IBM_CPM_BGO 0x00800000 /* PLB to OPB bus arbiter */
44#define IBM_CPM_BGI 0x00400000 /* OPB to PLB bridge */
45#define IBM_CPM_EBC 0x00200000 /* External Bus Controller */
46#define IBM_CPM_EBM 0x00100000 /* Ext Bus Master Interface */
47#define IBM_CPM_DMC 0x00080000 /* SDRAM peripheral controller */
48#define IBM_CPM_PLB4 0x00040000 /* PLB4 bus arbiter */
49#define IBM_CPM_PLB4x3 0x00020000 /* PLB4 to PLB3 bridge controller */
50#define IBM_CPM_PLB3x4 0x00010000 /* PLB3 to PLB4 bridge controller */
51#define IBM_CPM_PLB3 0x00008000 /* PLB3 bus arbiter */
52#define IBM_CPM_PPM 0x00002000 /* PLB Performance Monitor */
53#define IBM_CPM_UIC1 0x00001000 /* Universal Interrupt Controller */
54#define IBM_CPM_GPIO0 0x00000800 /* General Purpose IO (??) */
55#define IBM_CPM_GPT 0x00000400 /* General Purpose Timers */
56#define IBM_CPM_UART0 0x00000200 /* serial port 0 */
57#define IBM_CPM_UART1 0x00000100 /* serial port 1 */
58#define IBM_CPM_UIC0 0x00000080 /* Universal Interrupt Controller */
59#define IBM_CPM_TMRCLK 0x00000040 /* CPU timers */
60#define IBM_CPM_EMAC0 0x00000020 /* ethernet port 0 */
61#define IBM_CPM_EMAC1 0x00000010 /* ethernet port 1 */
62#define IBM_CPM_UART2 0x00000008 /* serial port 2 */
63#define IBM_CPM_UART3 0x00000004 /* serial port 3 */
64#define IBM_CPM_USB2D 0x00000002 /* USB 2.0 Device */
65#define IBM_CPM_USB2H 0x00000001 /* USB 2.0 Host */
66
67#define DFLT_IBM4xx_PM ~(IBM_CPM_UIC0 | IBM_CPM_UIC1 | IBM_CPM_CPU \
68 | IBM_CPM_EBC | IBM_CPM_BGO | IBM_CPM_FPU \
69 | IBM_CPM_EBM | IBM_CPM_PLB4 | IBM_CPM_3x4 \
70 | IBM_CPM_PLB3 | IBM_CPM_PLB4x3 \
71 | IBM_CPM_EMAC0 | IBM_CPM_TMRCLK \
72 | IBM_CPM_DMA | IBM_CPM_PCI | IBM_CPM_EMAC1)
73
74
75#endif /* __PPC_PLATFORMS_IBM440EP_H */
76#endif /* __KERNEL__ */
diff --git a/arch/ppc/platforms/4xx/ibm440gp.c b/arch/ppc/platforms/4xx/ibm440gp.c
index 27615ef8309c..d926245e8b3e 100644
--- a/arch/ppc/platforms/4xx/ibm440gp.c
+++ b/arch/ppc/platforms/4xx/ibm440gp.c
@@ -56,6 +56,7 @@ static struct ocp_func_mal_data ibm440gp_mal0_def = {
56 .txde_irq = 33, /* TX Descriptor Error IRQ */ 56 .txde_irq = 33, /* TX Descriptor Error IRQ */
57 .rxde_irq = 34, /* RX Descriptor Error IRQ */ 57 .rxde_irq = 34, /* RX Descriptor Error IRQ */
58 .serr_irq = 32, /* MAL System Error IRQ */ 58 .serr_irq = 32, /* MAL System Error IRQ */
59 .dcr_base = DCRN_MAL_BASE /* MAL0_CFG DCR number */
59}; 60};
60OCP_SYSFS_MAL_DATA() 61OCP_SYSFS_MAL_DATA()
61 62
diff --git a/arch/ppc/platforms/4xx/ibm440gx.c b/arch/ppc/platforms/4xx/ibm440gx.c
index 1f38f42835b4..956f45e4ef97 100644
--- a/arch/ppc/platforms/4xx/ibm440gx.c
+++ b/arch/ppc/platforms/4xx/ibm440gx.c
@@ -84,6 +84,7 @@ static struct ocp_func_mal_data ibm440gx_mal0_def = {
84 .txde_irq = 33, /* TX Descriptor Error IRQ */ 84 .txde_irq = 33, /* TX Descriptor Error IRQ */
85 .rxde_irq = 34, /* RX Descriptor Error IRQ */ 85 .rxde_irq = 34, /* RX Descriptor Error IRQ */
86 .serr_irq = 32, /* MAL System Error IRQ */ 86 .serr_irq = 32, /* MAL System Error IRQ */
87 .dcr_base = DCRN_MAL_BASE /* MAL0_CFG DCR number */
87}; 88};
88OCP_SYSFS_MAL_DATA() 89OCP_SYSFS_MAL_DATA()
89 90
diff --git a/arch/ppc/platforms/4xx/ibm440sp.c b/arch/ppc/platforms/4xx/ibm440sp.c
index a203efb47aba..feb17e41ef69 100644
--- a/arch/ppc/platforms/4xx/ibm440sp.c
+++ b/arch/ppc/platforms/4xx/ibm440sp.c
@@ -36,13 +36,14 @@ static struct ocp_func_emac_data ibm440sp_emac0_def = {
36OCP_SYSFS_EMAC_DATA() 36OCP_SYSFS_EMAC_DATA()
37 37
38static struct ocp_func_mal_data ibm440sp_mal0_def = { 38static struct ocp_func_mal_data ibm440sp_mal0_def = {
39 .num_tx_chans = 4, /* Number of TX channels */ 39 .num_tx_chans = 1, /* Number of TX channels */
40 .num_rx_chans = 4, /* Number of RX channels */ 40 .num_rx_chans = 1, /* Number of RX channels */
41 .txeob_irq = 38, /* TX End Of Buffer IRQ */ 41 .txeob_irq = 38, /* TX End Of Buffer IRQ */
42 .rxeob_irq = 39, /* RX End Of Buffer IRQ */ 42 .rxeob_irq = 39, /* RX End Of Buffer IRQ */
43 .txde_irq = 34, /* TX Descriptor Error IRQ */ 43 .txde_irq = 34, /* TX Descriptor Error IRQ */
44 .rxde_irq = 35, /* RX Descriptor Error IRQ */ 44 .rxde_irq = 35, /* RX Descriptor Error IRQ */
45 .serr_irq = 33, /* MAL System Error IRQ */ 45 .serr_irq = 33, /* MAL System Error IRQ */
46 .dcr_base = DCRN_MAL_BASE /* MAL0_CFG DCR number */
46}; 47};
47OCP_SYSFS_MAL_DATA() 48OCP_SYSFS_MAL_DATA()
48 49
diff --git a/arch/ppc/platforms/4xx/ibmnp405h.c b/arch/ppc/platforms/4xx/ibmnp405h.c
index ecdc5be6ae28..a477a78f4902 100644
--- a/arch/ppc/platforms/4xx/ibmnp405h.c
+++ b/arch/ppc/platforms/4xx/ibmnp405h.c
@@ -34,7 +34,7 @@ static struct ocp_func_emac_data ibmnp405h_emac1_def = {
34 .zmii_mux = 1, /* ZMII input of this EMAC */ 34 .zmii_mux = 1, /* ZMII input of this EMAC */
35 .mal_idx = 0, /* MAL device index */ 35 .mal_idx = 0, /* MAL device index */
36 .mal_rx_chan = 1, /* MAL rx channel number */ 36 .mal_rx_chan = 1, /* MAL rx channel number */
37 .mal_tx_chan = 1, /* MAL tx channel number */ 37 .mal_tx_chan = 2, /* MAL tx channel number */
38 .wol_irq = 41, /* WOL interrupt number */ 38 .wol_irq = 41, /* WOL interrupt number */
39 .mdio_idx = -1, /* No shared MDIO */ 39 .mdio_idx = -1, /* No shared MDIO */
40 .tah_idx = -1, /* No TAH */ 40 .tah_idx = -1, /* No TAH */
@@ -46,7 +46,7 @@ static struct ocp_func_emac_data ibmnp405h_emac2_def = {
46 .zmii_mux = 2, /* ZMII input of this EMAC */ 46 .zmii_mux = 2, /* ZMII input of this EMAC */
47 .mal_idx = 0, /* MAL device index */ 47 .mal_idx = 0, /* MAL device index */
48 .mal_rx_chan = 2, /* MAL rx channel number */ 48 .mal_rx_chan = 2, /* MAL rx channel number */
49 .mal_tx_chan = 2, /* MAL tx channel number */ 49 .mal_tx_chan = 4, /* MAL tx channel number */
50 .wol_irq = 41, /* WOL interrupt number */ 50 .wol_irq = 41, /* WOL interrupt number */
51 .mdio_idx = -1, /* No shared MDIO */ 51 .mdio_idx = -1, /* No shared MDIO */
52 .tah_idx = -1, /* No TAH */ 52 .tah_idx = -1, /* No TAH */
@@ -58,7 +58,7 @@ static struct ocp_func_emac_data ibmnp405h_emac3_def = {
58 .zmii_mux = 3, /* ZMII input of this EMAC */ 58 .zmii_mux = 3, /* ZMII input of this EMAC */
59 .mal_idx = 0, /* MAL device index */ 59 .mal_idx = 0, /* MAL device index */
60 .mal_rx_chan = 3, /* MAL rx channel number */ 60 .mal_rx_chan = 3, /* MAL rx channel number */
61 .mal_tx_chan = 3, /* MAL tx channel number */ 61 .mal_tx_chan = 6, /* MAL tx channel number */
62 .wol_irq = 41, /* WOL interrupt number */ 62 .wol_irq = 41, /* WOL interrupt number */
63 .mdio_idx = -1, /* No shared MDIO */ 63 .mdio_idx = -1, /* No shared MDIO */
64 .tah_idx = -1, /* No TAH */ 64 .tah_idx = -1, /* No TAH */
@@ -73,6 +73,7 @@ static struct ocp_func_mal_data ibmnp405h_mal0_def = {
73 .txde_irq = 46, /* TX Descriptor Error IRQ */ 73 .txde_irq = 46, /* TX Descriptor Error IRQ */
74 .rxde_irq = 47, /* RX Descriptor Error IRQ */ 74 .rxde_irq = 47, /* RX Descriptor Error IRQ */
75 .serr_irq = 45, /* MAL System Error IRQ */ 75 .serr_irq = 45, /* MAL System Error IRQ */
76 .dcr_base = DCRN_MAL_BASE /* MAL0_CFG DCR number */
76}; 77};
77OCP_SYSFS_MAL_DATA() 78OCP_SYSFS_MAL_DATA()
78 79
diff --git a/arch/ppc/platforms/4xx/ibmstb4.c b/arch/ppc/platforms/4xx/ibmstb4.c
index 874d16bab73c..d90627b68faa 100644
--- a/arch/ppc/platforms/4xx/ibmstb4.c
+++ b/arch/ppc/platforms/4xx/ibmstb4.c
@@ -11,6 +11,7 @@
11 11
12#include <linux/init.h> 12#include <linux/init.h>
13#include <asm/ocp.h> 13#include <asm/ocp.h>
14#include <asm/ppc4xx_pic.h>
14#include <platforms/4xx/ibmstb4.h> 15#include <platforms/4xx/ibmstb4.h>
15 16
16static struct ocp_func_iic_data ibmstb4_iic0_def = { 17static struct ocp_func_iic_data ibmstb4_iic0_def = {
@@ -72,12 +73,51 @@ struct ocp_def core_ocp[] __initdata = {
72 .irq = IDE0_IRQ, 73 .irq = IDE0_IRQ,
73 .pm = OCP_CPM_NA, 74 .pm = OCP_CPM_NA,
74 }, 75 },
75 { .vendor = OCP_VENDOR_IBM,
76 .function = OCP_FUNC_USB,
77 .paddr = USB0_BASE,
78 .irq = USB0_IRQ,
79 .pm = OCP_CPM_NA,
80 },
81 { .vendor = OCP_VENDOR_INVALID, 76 { .vendor = OCP_VENDOR_INVALID,
82 } 77 }
83}; 78};
79
80/* Polarity and triggering settings for internal interrupt sources */
81struct ppc4xx_uic_settings ppc4xx_core_uic_cfg[] __initdata = {
82 { .polarity = 0x7fffff01,
83 .triggering = 0x00000000,
84 .ext_irq_mask = 0x0000007e, /* IRQ0 - IRQ5 */
85 }
86};
87
88static struct resource ohci_usb_resources[] = {
89 [0] = {
90 .start = USB0_BASE,
91 .end = USB0_BASE + USB0_SIZE - 1,
92 .flags = IORESOURCE_MEM,
93 },
94 [1] = {
95 .start = USB0_IRQ,
96 .end = USB0_IRQ,
97 .flags = IORESOURCE_IRQ,
98 },
99};
100
101static u64 dma_mask = 0xffffffffULL;
102
103static struct platform_device ohci_usb_device = {
104 .name = "ppc-soc-ohci",
105 .id = 0,
106 .num_resources = ARRAY_SIZE(ohci_usb_resources),
107 .resource = ohci_usb_resources,
108 .dev = {
109 .dma_mask = &dma_mask,
110 .coherent_dma_mask = 0xffffffffULL,
111 }
112};
113
114static struct platform_device *ibmstb4_devs[] __initdata = {
115 &ohci_usb_device,
116};
117
118static int __init
119ibmstb4_platform_add_devices(void)
120{
121 return platform_add_devices(ibmstb4_devs, ARRAY_SIZE(ibmstb4_devs));
122}
123arch_initcall(ibmstb4_platform_add_devices);
diff --git a/arch/ppc/platforms/4xx/ibmstb4.h b/arch/ppc/platforms/4xx/ibmstb4.h
index bcb4b1ee71f2..9f21d4c88a3d 100644
--- a/arch/ppc/platforms/4xx/ibmstb4.h
+++ b/arch/ppc/platforms/4xx/ibmstb4.h
@@ -73,9 +73,9 @@
73#define OPB0_BASE 0x40000000 73#define OPB0_BASE 0x40000000
74#define GPIO0_BASE 0x40060000 74#define GPIO0_BASE 0x40060000
75 75
76#define USB0_BASE 0x40010000
77#define USB0_SIZE 0xA0
76#define USB0_IRQ 18 78#define USB0_IRQ 18
77#define USB0_BASE STB04xxx_MAP_IO_ADDR(0x40010000)
78#define USB0_EXTENT 4096
79 79
80#define IIC_NUMS 2 80#define IIC_NUMS 2
81#define UART_NUMS 3 81#define UART_NUMS 3
diff --git a/arch/ppc/platforms/4xx/luan.c b/arch/ppc/platforms/4xx/luan.c
index 95359f748e7b..a38e6f9ef858 100644
--- a/arch/ppc/platforms/4xx/luan.c
+++ b/arch/ppc/platforms/4xx/luan.c
@@ -53,13 +53,6 @@
53#include <syslib/ibm440gx_common.h> 53#include <syslib/ibm440gx_common.h>
54#include <syslib/ibm440sp_common.h> 54#include <syslib/ibm440sp_common.h>
55 55
56/*
57 * This is a horrible kludge, we eventually need to abstract this
58 * generic PHY stuff, so the standard phy mode defines can be
59 * easily used from arch code.
60 */
61#include "../../../../drivers/net/ibm_emac/ibm_emac_phy.h"
62
63bd_t __res; 56bd_t __res;
64 57
65static struct ibm44x_clocks clocks __initdata; 58static struct ibm44x_clocks clocks __initdata;
diff --git a/arch/ppc/platforms/4xx/luan.h b/arch/ppc/platforms/4xx/luan.h
index 09b444c87816..bbe7d0766db8 100644
--- a/arch/ppc/platforms/4xx/luan.h
+++ b/arch/ppc/platforms/4xx/luan.h
@@ -55,7 +55,7 @@
55#define STD_UART_OP(num) \ 55#define STD_UART_OP(num) \
56 { 0, BASE_BAUD, 0, UART##num##_INT, \ 56 { 0, BASE_BAUD, 0, UART##num##_INT, \
57 (ASYNC_BOOT_AUTOCONF | ASYNC_SKIP_TEST), \ 57 (ASYNC_BOOT_AUTOCONF | ASYNC_SKIP_TEST), \
58 iomem_base: UART##num##_IO_BASE, \ 58 iomem_base: (void*)UART##num##_IO_BASE, \
59 io_type: SERIAL_IO_MEM}, 59 io_type: SERIAL_IO_MEM},
60 60
61#define SERIAL_PORT_DFNS \ 61#define SERIAL_PORT_DFNS \
diff --git a/arch/ppc/platforms/4xx/oak.c b/arch/ppc/platforms/4xx/oak.c
deleted file mode 100644
index fa25ee1fa733..000000000000
--- a/arch/ppc/platforms/4xx/oak.c
+++ /dev/null
@@ -1,255 +0,0 @@
1/*
2 *
3 * Copyright (c) 1999-2000 Grant Erickson <grant@lcse.umn.edu>
4 *
5 * Module name: oak.c
6 *
7 * Description:
8 * Architecture- / platform-specific boot-time initialization code for
9 * the IBM PowerPC 403GCX "Oak" evaluation board. Adapted from original
10 * code by Gary Thomas, Cort Dougan <cort@fsmlabs.com>, and Dan Malek
11 * <dan@net4x.com>.
12 *
13 */
14
15#include <linux/config.h>
16#include <linux/init.h>
17#include <linux/smp.h>
18#include <linux/threads.h>
19#include <linux/param.h>
20#include <linux/string.h>
21#include <linux/initrd.h>
22#include <linux/irq.h>
23#include <linux/seq_file.h>
24
25#include <asm/board.h>
26#include <asm/machdep.h>
27#include <asm/page.h>
28#include <asm/bootinfo.h>
29#include <asm/ppc4xx_pic.h>
30#include <asm/time.h>
31
32#include "oak.h"
33
34/* Function Prototypes */
35
36extern void abort(void);
37
38/* Global Variables */
39
40unsigned char __res[sizeof(bd_t)];
41
42
43/*
44 * void __init oak_init()
45 *
46 * Description:
47 * This routine...
48 *
49 * Input(s):
50 * r3 - Optional pointer to a board information structure.
51 * r4 - Optional pointer to the physical starting address of the init RAM
52 * disk.
53 * r5 - Optional pointer to the physical ending address of the init RAM
54 * disk.
55 * r6 - Optional pointer to the physical starting address of any kernel
56 * command-line parameters.
57 * r7 - Optional pointer to the physical ending address of any kernel
58 * command-line parameters.
59 *
60 * Output(s):
61 * N/A
62 *
63 * Returns:
64 * N/A
65 *
66 */
67void __init
68platform_init(unsigned long r3, unsigned long r4, unsigned long r5,
69 unsigned long r6, unsigned long r7)
70{
71 parse_bootinfo(find_bootinfo());
72
73 /*
74 * If we were passed in a board information, copy it into the
75 * residual data area.
76 */
77 if (r3) {
78 memcpy((void *)__res, (void *)(r3 + KERNELBASE), sizeof(bd_t));
79 }
80
81#if defined(CONFIG_BLK_DEV_INITRD)
82 /*
83 * If the init RAM disk has been configured in, and there's a valid
84 * starting address for it, set it up.
85 */
86 if (r4) {
87 initrd_start = r4 + KERNELBASE;
88 initrd_end = r5 + KERNELBASE;
89 }
90#endif /* CONFIG_BLK_DEV_INITRD */
91
92 /* Copy the kernel command line arguments to a safe place. */
93
94 if (r6) {
95 *(char *)(r7 + KERNELBASE) = 0;
96 strcpy(cmd_line, (char *)(r6 + KERNELBASE));
97 }
98
99 /* Initialize machine-dependency vectors */
100
101 ppc_md.setup_arch = oak_setup_arch;
102 ppc_md.show_percpuinfo = oak_show_percpuinfo;
103 ppc_md.irq_canonicalize = NULL;
104 ppc_md.init_IRQ = ppc4xx_pic_init;
105 ppc_md.get_irq = NULL; /* Set in ppc4xx_pic_init() */
106 ppc_md.init = NULL;
107
108 ppc_md.restart = oak_restart;
109 ppc_md.power_off = oak_power_off;
110 ppc_md.halt = oak_halt;
111
112 ppc_md.time_init = oak_time_init;
113 ppc_md.set_rtc_time = oak_set_rtc_time;
114 ppc_md.get_rtc_time = oak_get_rtc_time;
115 ppc_md.calibrate_decr = oak_calibrate_decr;
116}
117
118/*
119 * Document me.
120 */
121void __init
122oak_setup_arch(void)
123{
124 /* XXX - Implement me */
125}
126
127/*
128 * int oak_show_percpuinfo()
129 *
130 * Description:
131 * This routine pretty-prints the platform's internal CPU and bus clock
132 * frequencies into the buffer for usage in /proc/cpuinfo.
133 *
134 * Input(s):
135 * *buffer - Buffer into which CPU and bus clock frequencies are to be
136 * printed.
137 *
138 * Output(s):
139 * *buffer - Buffer with the CPU and bus clock frequencies.
140 *
141 * Returns:
142 * The number of bytes copied into 'buffer' if OK, otherwise zero or less
143 * on error.
144 */
145int
146oak_show_percpuinfo(struct seq_file *m, int i)
147{
148 bd_t *bp = (bd_t *)__res;
149
150 seq_printf(m, "clock\t\t: %dMHz\n"
151 "bus clock\t\t: %dMHz\n",
152 bp->bi_intfreq / 1000000,
153 bp->bi_busfreq / 1000000);
154
155 return 0;
156}
157
158/*
159 * Document me.
160 */
161void
162oak_restart(char *cmd)
163{
164 abort();
165}
166
167/*
168 * Document me.
169 */
170void
171oak_power_off(void)
172{
173 oak_restart(NULL);
174}
175
176/*
177 * Document me.
178 */
179void
180oak_halt(void)
181{
182 oak_restart(NULL);
183}
184
185/*
186 * Document me.
187 */
188long __init
189oak_time_init(void)
190{
191 /* XXX - Implement me */
192 return 0;
193}
194
195/*
196 * Document me.
197 */
198int __init
199oak_set_rtc_time(unsigned long time)
200{
201 /* XXX - Implement me */
202
203 return (0);
204}
205
206/*
207 * Document me.
208 */
209unsigned long __init
210oak_get_rtc_time(void)
211{
212 /* XXX - Implement me */
213
214 return (0);
215}
216
217/*
218 * void __init oak_calibrate_decr()
219 *
220 * Description:
221 * This routine retrieves the internal processor frequency from the board
222 * information structure, sets up the kernel timer decrementer based on
223 * that value, enables the 403 programmable interval timer (PIT) and sets
224 * it up for auto-reload.
225 *
226 * Input(s):
227 * N/A
228 *
229 * Output(s):
230 * N/A
231 *
232 * Returns:
233 * N/A
234 *
235 */
236void __init
237oak_calibrate_decr(void)
238{
239 unsigned int freq;
240 bd_t *bip = (bd_t *)__res;
241
242 freq = bip->bi_intfreq;
243
244 decrementer_count = freq / HZ;
245 count_period_num = 1;
246 count_period_den = freq;
247
248 /* Enable the PIT and set auto-reload of its value */
249
250 mtspr(SPRN_TCR, TCR_PIE | TCR_ARE);
251
252 /* Clear any pending timer interrupts */
253
254 mtspr(SPRN_TSR, TSR_ENW | TSR_WIS | TSR_PIS | TSR_FIS);
255}
diff --git a/arch/ppc/platforms/4xx/oak.h b/arch/ppc/platforms/4xx/oak.h
deleted file mode 100644
index 1b86a4c66b04..000000000000
--- a/arch/ppc/platforms/4xx/oak.h
+++ /dev/null
@@ -1,96 +0,0 @@
1/*
2 *
3 * Copyright (c) 1999 Grant Erickson <grant@lcse.umn.edu>
4 *
5 * Module name: oak.h
6 *
7 * Description:
8 * Macros, definitions, and data structures specific to the IBM PowerPC
9 * 403G{A,B,C,CX} "Oak" evaluation board. Anything specific to the pro-
10 * cessor itself is defined elsewhere.
11 *
12 */
13
14#ifdef __KERNEL__
15#ifndef __ASM_OAK_H__
16#define __ASM_OAK_H__
17
18/* We have an IBM 403G{A,B,C,CX} core */
19#include <asm/ibm403.h>
20
21#define _IO_BASE 0
22#define _ISA_MEM_BASE 0
23#define PCI_DRAM_OFFSET 0
24
25/* Memory map for the "Oak" evaluation board */
26
27#define PPC403SPU_IO_BASE 0x40000000 /* 403 On-chip serial port */
28#define PPC403SPU_IO_SIZE 0x00000008
29#define OAKSERIAL_IO_BASE 0x7E000000 /* NS16550DV serial port */
30#define OAKSERIAL_IO_SIZE 0x00000008
31#define OAKNET_IO_BASE 0xF4000000 /* NS83902AV Ethernet */
32#define OAKNET_IO_SIZE 0x00000040
33#define OAKPROM_IO_BASE 0xFFFE0000 /* AMD 29F010 Flash ROM */
34#define OAKPROM_IO_SIZE 0x00020000
35
36
37/* Interrupt assignments fixed by the hardware implementation */
38
39/* This is annoying kbuild-2.4 problem. -- Tom */
40
41#define PPC403SPU_RX_INT 4 /* AIC_INT4 */
42#define PPC403SPU_TX_INT 5 /* AIC_INT5 */
43#define OAKNET_INT 27 /* AIC_INT27 */
44#define OAKSERIAL_INT 28 /* AIC_INT28 */
45
46#ifndef __ASSEMBLY__
47/*
48 * Data structure defining board information maintained by the boot
49 * ROM on IBM's "Oak" evaluation board. An effort has been made to
50 * keep the field names consistent with the 8xx 'bd_t' board info
51 * structures.
52 */
53
54typedef struct board_info {
55 unsigned char bi_s_version[4]; /* Version of this structure */
56 unsigned char bi_r_version[30]; /* Version of the IBM ROM */
57 unsigned int bi_memsize; /* DRAM installed, in bytes */
58 unsigned char bi_enetaddr[6]; /* Ethernet MAC address */
59 unsigned int bi_intfreq; /* Processor speed, in Hz */
60 unsigned int bi_busfreq; /* Bus speed, in Hz */
61} bd_t;
62
63#ifdef __cplusplus
64extern "C" {
65#endif
66
67extern void oak_init(unsigned long r3,
68 unsigned long ird_start,
69 unsigned long ird_end,
70 unsigned long cline_start,
71 unsigned long cline_end);
72extern void oak_setup_arch(void);
73extern int oak_setup_residual(char *buffer);
74extern void oak_init_IRQ(void);
75extern int oak_get_irq(struct pt_regs *regs);
76extern void oak_restart(char *cmd);
77extern void oak_power_off(void);
78extern void oak_halt(void);
79extern void oak_time_init(void);
80extern int oak_set_rtc_time(unsigned long now);
81extern unsigned long oak_get_rtc_time(void);
82extern void oak_calibrate_decr(void);
83
84#ifdef __cplusplus
85}
86#endif
87
88/* Some 4xx parts use a different timebase frequency from the internal clock.
89*/
90#define bi_tbfreq bi_intfreq
91
92#define PPC4xx_MACHINE_NAME "IBM Oak"
93
94#endif /* !__ASSEMBLY__ */
95#endif /* __ASM_OAK_H__ */
96#endif /* __KERNEL__ */
diff --git a/arch/ppc/platforms/4xx/oak_setup.h b/arch/ppc/platforms/4xx/oak_setup.h
deleted file mode 100644
index 8648bd084df8..000000000000
--- a/arch/ppc/platforms/4xx/oak_setup.h
+++ /dev/null
@@ -1,50 +0,0 @@
1/*
2 *
3 * Copyright (c) 1999-2000 Grant Erickson <grant@lcse.umn.edu>
4 *
5 * Module name: oak_setup.h
6 *
7 * Description:
8 * Architecture- / platform-specific boot-time initialization code for
9 * the IBM PowerPC 403GCX "Oak" evaluation board. Adapted from original
10 * code by Gary Thomas, Cort Dougan <cort@cs.nmt.edu>, and Dan Malek
11 * <dan@netx4.com>.
12 *
13 */
14
15#ifndef __OAK_SETUP_H__
16#define __OAK_SETUP_H__
17
18#include <asm/ptrace.h>
19#include <asm/board.h>
20
21
22#ifdef __cplusplus
23extern "C" {
24#endif
25
26extern unsigned char __res[sizeof(bd_t)];
27
28extern void oak_init(unsigned long r3,
29 unsigned long ird_start,
30 unsigned long ird_end,
31 unsigned long cline_start,
32 unsigned long cline_end);
33extern void oak_setup_arch(void);
34extern int oak_setup_residual(char *buffer);
35extern void oak_init_IRQ(void);
36extern int oak_get_irq(struct pt_regs *regs);
37extern void oak_restart(char *cmd);
38extern void oak_power_off(void);
39extern void oak_halt(void);
40extern void oak_time_init(void);
41extern int oak_set_rtc_time(unsigned long now);
42extern unsigned long oak_get_rtc_time(void);
43extern void oak_calibrate_decr(void);
44
45
46#ifdef __cplusplus
47}
48#endif
49
50#endif /* __OAK_SETUP_H__ */
diff --git a/arch/ppc/platforms/4xx/ocotea.c b/arch/ppc/platforms/4xx/ocotea.c
index 5f82a6bc7046..80028df1b445 100644
--- a/arch/ppc/platforms/4xx/ocotea.c
+++ b/arch/ppc/platforms/4xx/ocotea.c
@@ -48,17 +48,11 @@
48#include <asm/bootinfo.h> 48#include <asm/bootinfo.h>
49#include <asm/ppc4xx_pic.h> 49#include <asm/ppc4xx_pic.h>
50#include <asm/ppcboot.h> 50#include <asm/ppcboot.h>
51#include <asm/tlbflush.h>
51 52
52#include <syslib/gen550.h> 53#include <syslib/gen550.h>
53#include <syslib/ibm440gx_common.h> 54#include <syslib/ibm440gx_common.h>
54 55
55/*
56 * This is a horrible kludge, we eventually need to abstract this
57 * generic PHY stuff, so the standard phy mode defines can be
58 * easily used from arch code.
59 */
60#include "../../../../drivers/net/ibm_emac/ibm_emac_phy.h"
61
62bd_t __res; 56bd_t __res;
63 57
64static struct ibm44x_clocks clocks __initdata; 58static struct ibm44x_clocks clocks __initdata;
@@ -266,6 +260,9 @@ ocotea_early_serial_map(void)
266#if defined(CONFIG_SERIAL_TEXT_DEBUG) || defined(CONFIG_KGDB) 260#if defined(CONFIG_SERIAL_TEXT_DEBUG) || defined(CONFIG_KGDB)
267 /* Configure debug serial access */ 261 /* Configure debug serial access */
268 gen550_init(0, &port); 262 gen550_init(0, &port);
263
264 /* Purge TLB entry added in head_44x.S for early serial access */
265 _tlbie(UART0_IO_BASE);
269#endif 266#endif
270 267
271 port.membase = ioremap64(PPC440GX_UART1_ADDR, 8); 268 port.membase = ioremap64(PPC440GX_UART1_ADDR, 8);
diff --git a/arch/ppc/platforms/4xx/ocotea.h b/arch/ppc/platforms/4xx/ocotea.h
index 202dc8251190..33251153ac5f 100644
--- a/arch/ppc/platforms/4xx/ocotea.h
+++ b/arch/ppc/platforms/4xx/ocotea.h
@@ -55,15 +55,24 @@
55 */ 55 */
56#define RS_TABLE_SIZE 2 56#define RS_TABLE_SIZE 2
57 57
58/* OpenBIOS defined UART mappings, used before early_serial_setup */ 58#if defined(__BOOTER__)
59/* OpenBIOS defined UART mappings, used by bootloader shim */
59#define UART0_IO_BASE 0xE0000200 60#define UART0_IO_BASE 0xE0000200
60#define UART1_IO_BASE 0xE0000300 61#define UART1_IO_BASE 0xE0000300
62#else
63/* head_44x.S created UART mapping, used before early_serial_setup.
64 * We cannot use default OpenBIOS UART mappings because they
65 * don't work for configurations with more than 512M RAM. --ebs
66 */
67#define UART0_IO_BASE 0xF0000200
68#define UART1_IO_BASE 0xF0000300
69#endif
61 70
62#define BASE_BAUD 11059200/16 71#define BASE_BAUD 11059200/16
63#define STD_UART_OP(num) \ 72#define STD_UART_OP(num) \
64 { 0, BASE_BAUD, 0, UART##num##_INT, \ 73 { 0, BASE_BAUD, 0, UART##num##_INT, \
65 (ASYNC_BOOT_AUTOCONF | ASYNC_SKIP_TEST), \ 74 (ASYNC_BOOT_AUTOCONF | ASYNC_SKIP_TEST), \
66 iomem_base: UART##num##_IO_BASE, \ 75 iomem_base: (void*)UART##num##_IO_BASE, \
67 io_type: SERIAL_IO_MEM}, 76 io_type: SERIAL_IO_MEM},
68 77
69#define SERIAL_PORT_DFNS \ 78#define SERIAL_PORT_DFNS \
diff --git a/arch/ppc/platforms/4xx/redwood5.c b/arch/ppc/platforms/4xx/redwood5.c
index 2f5e410afbc5..bee8b4ac8afd 100644
--- a/arch/ppc/platforms/4xx/redwood5.c
+++ b/arch/ppc/platforms/4xx/redwood5.c
@@ -18,6 +18,19 @@
18#include <linux/ioport.h> 18#include <linux/ioport.h>
19#include <asm/io.h> 19#include <asm/io.h>
20#include <asm/machdep.h> 20#include <asm/machdep.h>
21#include <asm/ppc4xx_pic.h>
22
23/*
24 * Define external IRQ senses and polarities.
25 */
26unsigned char ppc4xx_uic_ext_irq_cfg[] __initdata = {
27 (IRQ_SENSE_LEVEL | IRQ_POLARITY_NEGATIVE), /* Ext Int 0 */
28 (IRQ_SENSE_LEVEL | IRQ_POLARITY_NEGATIVE), /* Ext Int 1 */
29 (IRQ_SENSE_LEVEL | IRQ_POLARITY_NEGATIVE), /* Ext Int 2 */
30 (IRQ_SENSE_LEVEL | IRQ_POLARITY_NEGATIVE), /* Ext Int 3 */
31 (IRQ_SENSE_LEVEL | IRQ_POLARITY_NEGATIVE), /* Ext Int 4 */
32 (IRQ_SENSE_LEVEL | IRQ_POLARITY_NEGATIVE), /* Ext Int 5 */
33};
21 34
22static struct resource smc91x_resources[] = { 35static struct resource smc91x_resources[] = {
23 [0] = { 36 [0] = {
diff --git a/arch/ppc/platforms/83xx/mpc834x_sys.c b/arch/ppc/platforms/83xx/mpc834x_sys.c
index ddd04d4c1ea9..b38a851a64ec 100644
--- a/arch/ppc/platforms/83xx/mpc834x_sys.c
+++ b/arch/ppc/platforms/83xx/mpc834x_sys.c
@@ -62,9 +62,29 @@ extern unsigned long total_memory; /* in mm/init */
62unsigned char __res[sizeof (bd_t)]; 62unsigned char __res[sizeof (bd_t)];
63 63
64#ifdef CONFIG_PCI 64#ifdef CONFIG_PCI
65#error "PCI is not supported" 65int
66/* NEED mpc83xx_map_irq & mpc83xx_exclude_device 66mpc83xx_map_irq(struct pci_dev *dev, unsigned char idsel, unsigned char pin)
67 see platforms/85xx/mpc85xx_ads_common.c */ 67{
68 static char pci_irq_table[][4] =
69 /*
70 * PCI IDSEL/INTPIN->INTLINE
71 * A B C D
72 */
73 {
74 {PIRQA, PIRQB, PIRQC, PIRQD}, /* idsel 0x11 */
75 {PIRQC, PIRQD, PIRQA, PIRQB}, /* idsel 0x12 */
76 {PIRQD, PIRQA, PIRQB, PIRQC} /* idsel 0x13 */
77 };
78
79 const long min_idsel = 0x11, max_idsel = 0x13, irqs_per_slot = 4;
80 return PCI_IRQ_TABLE_LOOKUP;
81}
82
83int
84mpc83xx_exclude_device(u_char bus, u_char devfn)
85{
86 return PCIBIOS_SUCCESSFUL;
87}
68#endif /* CONFIG_PCI */ 88#endif /* CONFIG_PCI */
69 89
70/* ************************************************************************ 90/* ************************************************************************
@@ -88,7 +108,7 @@ mpc834x_sys_setup_arch(void)
88 108
89#ifdef CONFIG_PCI 109#ifdef CONFIG_PCI
90 /* setup PCI host bridges */ 110 /* setup PCI host bridges */
91 mpc83xx_sys_setup_hose(); 111 mpc83xx_setup_hose();
92#endif 112#endif
93 mpc83xx_early_serial_map(); 113 mpc83xx_early_serial_map();
94 114
@@ -175,10 +195,17 @@ mpc834x_sys_init_IRQ(void)
175 IRQ_SENSE_LEVEL, /* EXT 1 */ 195 IRQ_SENSE_LEVEL, /* EXT 1 */
176 IRQ_SENSE_LEVEL, /* EXT 2 */ 196 IRQ_SENSE_LEVEL, /* EXT 2 */
177 0, /* EXT 3 */ 197 0, /* EXT 3 */
198#ifdef CONFIG_PCI
199 IRQ_SENSE_LEVEL, /* EXT 4 */
200 IRQ_SENSE_LEVEL, /* EXT 5 */
201 IRQ_SENSE_LEVEL, /* EXT 6 */
202 IRQ_SENSE_LEVEL, /* EXT 7 */
203#else
178 0, /* EXT 4 */ 204 0, /* EXT 4 */
179 0, /* EXT 5 */ 205 0, /* EXT 5 */
180 0, /* EXT 6 */ 206 0, /* EXT 6 */
181 0, /* EXT 7 */ 207 0, /* EXT 7 */
208#endif
182 }; 209 };
183 210
184 ipic_init(binfo->bi_immr_base + 0x00700, 0, MPC83xx_IPIC_IRQ_OFFSET, senses, 8); 211 ipic_init(binfo->bi_immr_base + 0x00700, 0, MPC83xx_IPIC_IRQ_OFFSET, senses, 8);
diff --git a/arch/ppc/platforms/83xx/mpc834x_sys.h b/arch/ppc/platforms/83xx/mpc834x_sys.h
index a2f6e49d7151..1584cd77a9ef 100644
--- a/arch/ppc/platforms/83xx/mpc834x_sys.h
+++ b/arch/ppc/platforms/83xx/mpc834x_sys.h
@@ -26,7 +26,7 @@
26#define VIRT_IMMRBAR ((uint)0xfe000000) 26#define VIRT_IMMRBAR ((uint)0xfe000000)
27 27
28#define BCSR_PHYS_ADDR ((uint)0xf8000000) 28#define BCSR_PHYS_ADDR ((uint)0xf8000000)
29#define BCSR_SIZE ((uint)(32 * 1024)) 29#define BCSR_SIZE ((uint)(128 * 1024))
30 30
31#define BCSR_MISC_REG2_OFF 0x07 31#define BCSR_MISC_REG2_OFF 0x07
32#define BCSR_MISC_REG2_PORESET 0x01 32#define BCSR_MISC_REG2_PORESET 0x01
@@ -34,23 +34,25 @@
34#define BCSR_MISC_REG3_OFF 0x08 34#define BCSR_MISC_REG3_OFF 0x08
35#define BCSR_MISC_REG3_CNFLOCK 0x80 35#define BCSR_MISC_REG3_CNFLOCK 0x80
36 36
37#ifdef CONFIG_PCI 37#define PIRQA MPC83xx_IRQ_EXT4
38/* PCI interrupt controller */ 38#define PIRQB MPC83xx_IRQ_EXT5
39#define PIRQA MPC83xx_IRQ_IRQ4 39#define PIRQC MPC83xx_IRQ_EXT6
40#define PIRQB MPC83xx_IRQ_IRQ5 40#define PIRQD MPC83xx_IRQ_EXT7
41#define PIRQC MPC83xx_IRQ_IRQ6 41
42#define PIRQD MPC83xx_IRQ_IRQ7 42#define MPC83xx_PCI1_LOWER_IO 0x00000000
43 43#define MPC83xx_PCI1_UPPER_IO 0x00ffffff
44#define MPC834x_SYS_PCI1_LOWER_IO 0x00000000 44#define MPC83xx_PCI1_LOWER_MEM 0x80000000
45#define MPC834x_SYS_PCI1_UPPER_IO 0x00ffffff 45#define MPC83xx_PCI1_UPPER_MEM 0x9fffffff
46 46#define MPC83xx_PCI1_IO_BASE 0xe2000000
47#define MPC834x_SYS_PCI1_LOWER_MEM 0x80000000 47#define MPC83xx_PCI1_MEM_OFFSET 0x00000000
48#define MPC834x_SYS_PCI1_UPPER_MEM 0x9fffffff 48#define MPC83xx_PCI1_IO_SIZE 0x01000000
49 49
50#define MPC834x_SYS_PCI1_IO_BASE 0xe2000000 50#define MPC83xx_PCI2_LOWER_IO 0x00000000
51#define MPC834x_SYS_PCI1_MEM_OFFSET 0x00000000 51#define MPC83xx_PCI2_UPPER_IO 0x00ffffff
52 52#define MPC83xx_PCI2_LOWER_MEM 0xa0000000
53#define MPC834x_SYS_PCI1_IO_SIZE 0x01000000 53#define MPC83xx_PCI2_UPPER_MEM 0xbfffffff
54#endif /* CONFIG_PCI */ 54#define MPC83xx_PCI2_IO_BASE 0xe3000000
55#define MPC83xx_PCI2_MEM_OFFSET 0x00000000
56#define MPC83xx_PCI2_IO_SIZE 0x01000000
55 57
56#endif /* __MACH_MPC83XX_SYS_H__ */ 58#endif /* __MACH_MPC83XX_SYS_H__ */
diff --git a/arch/ppc/platforms/85xx/mpc8560_ads.c b/arch/ppc/platforms/85xx/mpc8560_ads.c
index e18380258b68..f2748c88665a 100644
--- a/arch/ppc/platforms/85xx/mpc8560_ads.c
+++ b/arch/ppc/platforms/85xx/mpc8560_ads.c
@@ -56,7 +56,6 @@
56#include <syslib/ppc85xx_common.h> 56#include <syslib/ppc85xx_common.h>
57#include <syslib/ppc85xx_setup.h> 57#include <syslib/ppc85xx_setup.h>
58 58
59extern void cpm2_reset(void);
60 59
61/* ************************************************************************ 60/* ************************************************************************
62 * 61 *
diff --git a/arch/ppc/platforms/85xx/mpc85xx_cds_common.c b/arch/ppc/platforms/85xx/mpc85xx_cds_common.c
index b52c4317fefd..6267b294f704 100644
--- a/arch/ppc/platforms/85xx/mpc85xx_cds_common.c
+++ b/arch/ppc/platforms/85xx/mpc85xx_cds_common.c
@@ -49,7 +49,7 @@
49#include <asm/mpc85xx.h> 49#include <asm/mpc85xx.h>
50#include <asm/irq.h> 50#include <asm/irq.h>
51#include <asm/immap_85xx.h> 51#include <asm/immap_85xx.h>
52#include <asm/immap_cpm2.h> 52#include <asm/cpm2.h>
53#include <asm/ppc_sys.h> 53#include <asm/ppc_sys.h>
54#include <asm/kgdb.h> 54#include <asm/kgdb.h>
55 55
diff --git a/arch/ppc/platforms/85xx/stx_gp3.c b/arch/ppc/platforms/85xx/stx_gp3.c
index bb41265cfc85..c99b365d6110 100644
--- a/arch/ppc/platforms/85xx/stx_gp3.c
+++ b/arch/ppc/platforms/85xx/stx_gp3.c
@@ -52,14 +52,13 @@
52#include <asm/mpc85xx.h> 52#include <asm/mpc85xx.h>
53#include <asm/irq.h> 53#include <asm/irq.h>
54#include <asm/immap_85xx.h> 54#include <asm/immap_85xx.h>
55#include <asm/immap_cpm2.h> 55#include <asm/cpm2.h>
56#include <asm/mpc85xx.h> 56#include <asm/mpc85xx.h>
57#include <asm/ppc_sys.h> 57#include <asm/ppc_sys.h>
58 58
59#include <syslib/cpm2_pic.h> 59#include <syslib/cpm2_pic.h>
60#include <syslib/ppc85xx_common.h> 60#include <syslib/ppc85xx_common.h>
61 61
62extern void cpm2_reset(void);
63 62
64unsigned char __res[sizeof(bd_t)]; 63unsigned char __res[sizeof(bd_t)];
65 64
diff --git a/arch/ppc/platforms/Makefile b/arch/ppc/platforms/Makefile
index 5488a053f415..ff7452e5d8e5 100644
--- a/arch/ppc/platforms/Makefile
+++ b/arch/ppc/platforms/Makefile
@@ -21,22 +21,17 @@ obj-$(CONFIG_CPU_FREQ_PMAC) += pmac_cpufreq.o
21endif 21endif
22obj-$(CONFIG_PMAC_BACKLIGHT) += pmac_backlight.o 22obj-$(CONFIG_PMAC_BACKLIGHT) += pmac_backlight.o
23obj-$(CONFIG_PREP_RESIDUAL) += residual.o 23obj-$(CONFIG_PREP_RESIDUAL) += residual.o
24obj-$(CONFIG_ADIR) += adir_setup.o adir_pic.o adir_pci.o
25obj-$(CONFIG_PQ2ADS) += pq2ads.o 24obj-$(CONFIG_PQ2ADS) += pq2ads.o
26obj-$(CONFIG_TQM8260) += tqm8260_setup.o 25obj-$(CONFIG_TQM8260) += tqm8260_setup.o
27obj-$(CONFIG_CPCI690) += cpci690.o 26obj-$(CONFIG_CPCI690) += cpci690.o
28obj-$(CONFIG_EV64260) += ev64260.o 27obj-$(CONFIG_EV64260) += ev64260.o
29obj-$(CONFIG_CHESTNUT) += chestnut.o 28obj-$(CONFIG_CHESTNUT) += chestnut.o
30obj-$(CONFIG_GEMINI) += gemini_pci.o gemini_setup.o gemini_prom.o 29obj-$(CONFIG_GEMINI) += gemini_pci.o gemini_setup.o gemini_prom.o
31obj-$(CONFIG_K2) += k2.o
32obj-$(CONFIG_LOPEC) += lopec.o 30obj-$(CONFIG_LOPEC) += lopec.o
33obj-$(CONFIG_KATANA) += katana.o 31obj-$(CONFIG_KATANA) += katana.o
34obj-$(CONFIG_HDPU) += hdpu.o 32obj-$(CONFIG_HDPU) += hdpu.o
35obj-$(CONFIG_MCPN765) += mcpn765.o
36obj-$(CONFIG_MENF1) += menf1_setup.o menf1_pci.o
37obj-$(CONFIG_MVME5100) += mvme5100.o 33obj-$(CONFIG_MVME5100) += mvme5100.o
38obj-$(CONFIG_PAL4) += pal4_setup.o pal4_pci.o 34obj-$(CONFIG_PAL4) += pal4_setup.o pal4_pci.o
39obj-$(CONFIG_PCORE) += pcore.o
40obj-$(CONFIG_POWERPMC250) += powerpmc250.o 35obj-$(CONFIG_POWERPMC250) += powerpmc250.o
41obj-$(CONFIG_PPLUS) += pplus.o 36obj-$(CONFIG_PPLUS) += pplus.o
42obj-$(CONFIG_PRPMC750) += prpmc750.o 37obj-$(CONFIG_PRPMC750) += prpmc750.o
@@ -46,6 +41,7 @@ obj-$(CONFIG_SANDPOINT) += sandpoint.o
46obj-$(CONFIG_SBC82xx) += sbc82xx.o 41obj-$(CONFIG_SBC82xx) += sbc82xx.o
47obj-$(CONFIG_SPRUCE) += spruce.o 42obj-$(CONFIG_SPRUCE) += spruce.o
48obj-$(CONFIG_LITE5200) += lite5200.o 43obj-$(CONFIG_LITE5200) += lite5200.o
44obj-$(CONFIG_EV64360) += ev64360.o
49 45
50ifeq ($(CONFIG_SMP),y) 46ifeq ($(CONFIG_SMP),y)
51obj-$(CONFIG_PPC_PMAC) += pmac_smp.o 47obj-$(CONFIG_PPC_PMAC) += pmac_smp.o
diff --git a/arch/ppc/platforms/adir.h b/arch/ppc/platforms/adir.h
deleted file mode 100644
index 13a748b46956..000000000000
--- a/arch/ppc/platforms/adir.h
+++ /dev/null
@@ -1,95 +0,0 @@
1/*
2 * arch/ppc/platforms/adir.h
3 *
4 * Definitions for SBS Adirondack board support
5 *
6 * By Michael Sokolov <msokolov@ivan.Harhan.ORG>
7 */
8
9#ifndef __PPC_PLATFORMS_ADIR_H
10#define __PPC_PLATFORMS_ADIR_H
11
12/*
13 * SBS Adirondack definitions
14 */
15
16/* PPC physical address space layout. We use the one set up by the firmware. */
17#define ADIR_PCI32_MEM_BASE 0x80000000
18#define ADIR_PCI32_MEM_SIZE 0x20000000
19#define ADIR_PCI64_MEM_BASE 0xA0000000
20#define ADIR_PCI64_MEM_SIZE 0x20000000
21#define ADIR_PCI32_IO_BASE 0xC0000000
22#define ADIR_PCI32_IO_SIZE 0x10000000
23#define ADIR_PCI64_IO_BASE 0xD0000000
24#define ADIR_PCI64_IO_SIZE 0x10000000
25#define ADIR_PCI64_PHB 0xFF400000
26#define ADIR_PCI32_PHB 0xFF500000
27
28#define ADIR_PCI64_CONFIG_ADDR (ADIR_PCI64_PHB + 0x000f8000)
29#define ADIR_PCI64_CONFIG_DATA (ADIR_PCI64_PHB + 0x000f8010)
30
31#define ADIR_PCI32_CONFIG_ADDR (ADIR_PCI32_PHB + 0x000f8000)
32#define ADIR_PCI32_CONFIG_DATA (ADIR_PCI32_PHB + 0x000f8010)
33
34/* System memory as seen from PCI */
35#define ADIR_PCI_SYS_MEM_BASE 0x80000000
36
37/* Static virtual mapping of PCI I/O */
38#define ADIR_PCI32_VIRT_IO_BASE 0xFE000000
39#define ADIR_PCI32_VIRT_IO_SIZE 0x01000000
40#define ADIR_PCI64_VIRT_IO_BASE 0xFF000000
41#define ADIR_PCI64_VIRT_IO_SIZE 0x01000000
42
43/* Registers */
44#define ADIR_NVRAM_RTC_ADDR 0x74
45#define ADIR_NVRAM_RTC_DATA 0x75
46
47#define ADIR_BOARD_ID_REG (ADIR_PCI32_VIRT_IO_BASE + 0x08FFF0)
48#define ADIR_CPLD1REV_REG (ADIR_PCI32_VIRT_IO_BASE + 0x08FFF1)
49#define ADIR_CPLD2REV_REG (ADIR_PCI32_VIRT_IO_BASE + 0x08FFF2)
50#define ADIR_FLASHCTL_REG (ADIR_PCI32_VIRT_IO_BASE + 0x08FFF3)
51#define ADIR_CPC710_STAT_REG (ADIR_PCI32_VIRT_IO_BASE + 0x08FFF4)
52#define ADIR_CLOCK_REG (ADIR_PCI32_VIRT_IO_BASE + 0x08FFF5)
53#define ADIR_GPIO_REG (ADIR_PCI32_VIRT_IO_BASE + 0x08FFF8)
54#define ADIR_MISC_REG (ADIR_PCI32_VIRT_IO_BASE + 0x08FFF9)
55#define ADIR_LED_REG (ADIR_PCI32_VIRT_IO_BASE + 0x08FFFA)
56
57#define ADIR_CLOCK_REG_PD 0x10
58#define ADIR_CLOCK_REG_SPREAD 0x08
59#define ADIR_CLOCK_REG_SEL133 0x04
60#define ADIR_CLOCK_REG_SEL1 0x02
61#define ADIR_CLOCK_REG_SEL0 0x01
62
63#define ADIR_PROCA_INT_MASK (ADIR_PCI32_VIRT_IO_BASE + 0x0EFFF0)
64#define ADIR_PROCB_INT_MASK (ADIR_PCI32_VIRT_IO_BASE + 0x0EFFF2)
65#define ADIR_PROCA_INT_STAT (ADIR_PCI32_VIRT_IO_BASE + 0x0EFFF4)
66#define ADIR_PROCB_INT_STAT (ADIR_PCI32_VIRT_IO_BASE + 0x0EFFF6)
67
68/* Linux IRQ numbers */
69#define ADIR_IRQ_NONE -1
70#define ADIR_IRQ_SERIAL2 3
71#define ADIR_IRQ_SERIAL1 4
72#define ADIR_IRQ_FDC 6
73#define ADIR_IRQ_PARALLEL 7
74#define ADIR_IRQ_VIA_AUDIO 10
75#define ADIR_IRQ_VIA_USB 11
76#define ADIR_IRQ_IDE0 14
77#define ADIR_IRQ_IDE1 15
78#define ADIR_IRQ_PCI0_INTA 16
79#define ADIR_IRQ_PCI0_INTB 17
80#define ADIR_IRQ_PCI0_INTC 18
81#define ADIR_IRQ_PCI0_INTD 19
82#define ADIR_IRQ_PCI1_INTA 20
83#define ADIR_IRQ_PCI1_INTB 21
84#define ADIR_IRQ_PCI1_INTC 22
85#define ADIR_IRQ_PCI1_INTD 23
86#define ADIR_IRQ_MBSCSI 24 /* motherboard SCSI */
87#define ADIR_IRQ_MBETH1 25 /* motherboard Ethernet 1 */
88#define ADIR_IRQ_MBETH0 26 /* motherboard Ethernet 0 */
89#define ADIR_IRQ_CPC710_INT1 27
90#define ADIR_IRQ_CPC710_INT2 28
91#define ADIR_IRQ_VT82C686_NMI 29
92#define ADIR_IRQ_VT82C686_INTR 30
93#define ADIR_IRQ_INTERPROC 31
94
95#endif /* __PPC_PLATFORMS_ADIR_H */
diff --git a/arch/ppc/platforms/adir_pci.c b/arch/ppc/platforms/adir_pci.c
deleted file mode 100644
index f94ac53e0711..000000000000
--- a/arch/ppc/platforms/adir_pci.c
+++ /dev/null
@@ -1,247 +0,0 @@
1/*
2 * arch/ppc/platforms/adir_pci.c
3 *
4 * PCI support for SBS Adirondack
5 *
6 * By Michael Sokolov <msokolov@ivan.Harhan.ORG>
7 * based on the K2 version by Matt Porter <mporter@mvista.com>
8 */
9
10#include <linux/kernel.h>
11#include <linux/init.h>
12#include <linux/pci.h>
13#include <linux/slab.h>
14
15#include <asm/byteorder.h>
16#include <asm/io.h>
17#include <asm/uaccess.h>
18#include <asm/machdep.h>
19#include <asm/pci-bridge.h>
20
21#include <syslib/cpc710.h>
22#include "adir.h"
23
24#undef DEBUG
25#ifdef DEBUG
26#define DBG(x...) printk(x)
27#else
28#define DBG(x...)
29#endif /* DEBUG */
30
31static inline int __init
32adir_map_irq(struct pci_dev *dev, unsigned char idsel, unsigned char pin)
33{
34#define PCIIRQ(a,b,c,d) {ADIR_IRQ_##a,ADIR_IRQ_##b,ADIR_IRQ_##c,ADIR_IRQ_##d},
35 struct pci_controller *hose = pci_bus_to_hose(dev->bus->number);
36 /*
37 * The three PCI devices on the motherboard have dedicated lines to the
38 * CPLD interrupt controller, bypassing the standard PCI INTA-D and the
39 * PC interrupt controller. All other PCI devices (slots) have usual
40 * staggered INTA-D lines, resulting in 8 lines total (PCI0 INTA-D and
41 * PCI1 INTA-D). All 8 go to the CPLD interrupt controller. PCI0 INTA-D
42 * also go to the south bridge, so we have the option of taking them
43 * via the CPLD interrupt controller or via the south bridge 8259
44 * 8258 thingy. PCI1 INTA-D can only be taken via the CPLD interrupt
45 * controller. We take all PCI interrupts via the CPLD interrupt
46 * controller as recommended by SBS.
47 *
48 * We also have some monkey business with the PCI devices within the
49 * VT82C686B south bridge itself. This chip actually has 7 functions on
50 * its IDSEL. Function 0 is the actual south bridge, function 1 is IDE,
51 * and function 4 is some special stuff. The other 4 functions are just
52 * regular PCI devices bundled in the chip. 2 and 3 are USB UHCIs and 5
53 * and 6 are audio (not supported on the Adirondack).
54 *
55 * This is where the monkey business begins. PCI devices are supposed
56 * to signal normal PCI interrupts. But the 4 functions in question are
57 * located in the south bridge chip, which is designed with the
58 * assumption that it will be fielding PCI INTA-D interrupts rather
59 * than generating them. Here's what it does. Each of the functions in
60 * question routes its interrupt to one of the IRQs on the 8259 thingy.
61 * Which one? It looks at the Interrupt Line register in the PCI config
62 * space, even though the PCI spec says it's for BIOS/OS interaction
63 * only.
64 *
65 * How do we deal with this? We take these interrupts via 8259 IRQs as
66 * we have to. We return the desired IRQ numbers from this routine when
67 * called for the functions in question. The PCI scan code will then
68 * stick our return value into the Interrupt Line register in the PCI
69 * config space, and the interrupt will actually go there. We identify
70 * these functions within the south bridge IDSEL by their interrupt pin
71 * numbers, as the VT82C686B has 04 in the Interrupt Pin register for
72 * USB and 03 for audio.
73 */
74 if (!hose->index) {
75 static char pci_irq_table[][4] =
76 /*
77 * PCI IDSEL/INTPIN->INTLINE
78 * A B C D
79 */
80 {
81 /* south bridge */ PCIIRQ(IDE0, NONE, VIA_AUDIO, VIA_USB)
82 /* Ethernet 0 */ PCIIRQ(MBETH0, MBETH0, MBETH0, MBETH0)
83 /* PCI0 slot 1 */ PCIIRQ(PCI0_INTB, PCI0_INTC, PCI0_INTD, PCI0_INTA)
84 /* PCI0 slot 2 */ PCIIRQ(PCI0_INTC, PCI0_INTD, PCI0_INTA, PCI0_INTB)
85 /* PCI0 slot 3 */ PCIIRQ(PCI0_INTD, PCI0_INTA, PCI0_INTB, PCI0_INTC)
86 };
87 const long min_idsel = 3, max_idsel = 7, irqs_per_slot = 4;
88 return PCI_IRQ_TABLE_LOOKUP;
89 } else {
90 static char pci_irq_table[][4] =
91 /*
92 * PCI IDSEL/INTPIN->INTLINE
93 * A B C D
94 */
95 {
96 /* Ethernet 1 */ PCIIRQ(MBETH1, MBETH1, MBETH1, MBETH1)
97 /* SCSI */ PCIIRQ(MBSCSI, MBSCSI, MBSCSI, MBSCSI)
98 /* PCI1 slot 1 */ PCIIRQ(PCI1_INTB, PCI1_INTC, PCI1_INTD, PCI1_INTA)
99 /* PCI1 slot 2 */ PCIIRQ(PCI1_INTC, PCI1_INTD, PCI1_INTA, PCI1_INTB)
100 /* PCI1 slot 3 */ PCIIRQ(PCI1_INTD, PCI1_INTA, PCI1_INTB, PCI1_INTC)
101 };
102 const long min_idsel = 3, max_idsel = 7, irqs_per_slot = 4;
103 return PCI_IRQ_TABLE_LOOKUP;
104 }
105#undef PCIIRQ
106}
107
108static void
109adir_pcibios_fixup_resources(struct pci_dev *dev)
110{
111 int i;
112
113 if ((dev->vendor == PCI_VENDOR_ID_IBM) &&
114 (dev->device == PCI_DEVICE_ID_IBM_CPC710_PCI64))
115 {
116 DBG("Fixup CPC710 resources\n");
117 for (i=0; i<DEVICE_COUNT_RESOURCE; i++)
118 {
119 dev->resource[i].start = 0;
120 dev->resource[i].end = 0;
121 }
122 }
123}
124
125/*
126 * CPC710 DD3 has an errata causing it to hang the system if a type 0 config
127 * cycle is attempted on its PCI32 interface with a device number > 21.
128 * CPC710's PCI bridges map device numbers 1 through 21 to AD11 through AD31.
129 * Per the PCI spec it MUST accept all other device numbers and do nothing, and
130 * software MUST scan all device numbers without assuming how IDSELs are
131 * mapped. However, as the CPC710 DD3's errata causes such correct scanning
132 * procedure to hang the system, we have no choice but to introduce this hack
133 * of knowingly avoiding device numbers > 21 on PCI0,
134 */
135static int
136adir_exclude_device(u_char bus, u_char devfn)
137{
138 if ((bus == 0) && (PCI_SLOT(devfn) > 21))
139 return PCIBIOS_DEVICE_NOT_FOUND;
140 else
141 return PCIBIOS_SUCCESSFUL;
142}
143
144void adir_find_bridges(void)
145{
146 struct pci_controller *hose_a, *hose_b;
147
148 /* Setup PCI32 hose */
149 hose_a = pcibios_alloc_controller();
150 if (!hose_a)
151 return;
152
153 hose_a->first_busno = 0;
154 hose_a->last_busno = 0xff;
155 hose_a->pci_mem_offset = ADIR_PCI32_MEM_BASE;
156 hose_a->io_space.start = 0;
157 hose_a->io_space.end = ADIR_PCI32_VIRT_IO_SIZE - 1;
158 hose_a->mem_space.start = 0;
159 hose_a->mem_space.end = ADIR_PCI32_MEM_SIZE - 1;
160 hose_a->io_resource.start = 0;
161 hose_a->io_resource.end = ADIR_PCI32_VIRT_IO_SIZE - 1;
162 hose_a->io_resource.flags = IORESOURCE_IO;
163 hose_a->mem_resources[0].start = ADIR_PCI32_MEM_BASE;
164 hose_a->mem_resources[0].end = ADIR_PCI32_MEM_BASE +
165 ADIR_PCI32_MEM_SIZE - 1;
166 hose_a->mem_resources[0].flags = IORESOURCE_MEM;
167 hose_a->io_base_phys = ADIR_PCI32_IO_BASE;
168 hose_a->io_base_virt = (void *) ADIR_PCI32_VIRT_IO_BASE;
169
170 ppc_md.pci_exclude_device = adir_exclude_device;
171 setup_indirect_pci(hose_a, ADIR_PCI32_CONFIG_ADDR,
172 ADIR_PCI32_CONFIG_DATA);
173
174 /* Initialize PCI32 bus registers */
175 early_write_config_byte(hose_a,
176 hose_a->first_busno,
177 PCI_DEVFN(0, 0),
178 CPC710_BUS_NUMBER,
179 hose_a->first_busno);
180 early_write_config_byte(hose_a,
181 hose_a->first_busno,
182 PCI_DEVFN(0, 0),
183 CPC710_SUB_BUS_NUMBER,
184 hose_a->last_busno);
185
186 hose_a->last_busno = pciauto_bus_scan(hose_a, hose_a->first_busno);
187
188 /* Write out correct max subordinate bus number for hose A */
189 early_write_config_byte(hose_a,
190 hose_a->first_busno,
191 PCI_DEVFN(0, 0),
192 CPC710_SUB_BUS_NUMBER,
193 hose_a->last_busno);
194
195 /* Setup PCI64 hose */
196 hose_b = pcibios_alloc_controller();
197 if (!hose_b)
198 return;
199
200 hose_b->first_busno = hose_a->last_busno + 1;
201 hose_b->last_busno = 0xff;
202 hose_b->pci_mem_offset = ADIR_PCI64_MEM_BASE;
203 hose_b->io_space.start = 0;
204 hose_b->io_space.end = ADIR_PCI64_VIRT_IO_SIZE - 1;
205 hose_b->mem_space.start = 0;
206 hose_b->mem_space.end = ADIR_PCI64_MEM_SIZE - 1;
207 hose_b->io_resource.start = 0;
208 hose_b->io_resource.end = ADIR_PCI64_VIRT_IO_SIZE - 1;
209 hose_b->io_resource.flags = IORESOURCE_IO;
210 hose_b->mem_resources[0].start = ADIR_PCI64_MEM_BASE;
211 hose_b->mem_resources[0].end = ADIR_PCI64_MEM_BASE +
212 ADIR_PCI64_MEM_SIZE - 1;
213 hose_b->mem_resources[0].flags = IORESOURCE_MEM;
214 hose_b->io_base_phys = ADIR_PCI64_IO_BASE;
215 hose_b->io_base_virt = (void *) ADIR_PCI64_VIRT_IO_BASE;
216
217 setup_indirect_pci(hose_b, ADIR_PCI64_CONFIG_ADDR,
218 ADIR_PCI64_CONFIG_DATA);
219
220 /* Initialize PCI64 bus registers */
221 early_write_config_byte(hose_b,
222 0,
223 PCI_DEVFN(0, 0),
224 CPC710_SUB_BUS_NUMBER,
225 0xff);
226
227 early_write_config_byte(hose_b,
228 0,
229 PCI_DEVFN(0, 0),
230 CPC710_BUS_NUMBER,
231 hose_b->first_busno);
232
233 hose_b->last_busno = pciauto_bus_scan(hose_b,
234 hose_b->first_busno);
235
236 /* Write out correct max subordinate bus number for hose B */
237 early_write_config_byte(hose_b,
238 hose_b->first_busno,
239 PCI_DEVFN(0, 0),
240 CPC710_SUB_BUS_NUMBER,
241 hose_b->last_busno);
242
243 ppc_md.pcibios_fixup = NULL;
244 ppc_md.pcibios_fixup_resources = adir_pcibios_fixup_resources;
245 ppc_md.pci_swizzle = common_swizzle;
246 ppc_md.pci_map_irq = adir_map_irq;
247}
diff --git a/arch/ppc/platforms/adir_pic.c b/arch/ppc/platforms/adir_pic.c
deleted file mode 100644
index 9947cba52af5..000000000000
--- a/arch/ppc/platforms/adir_pic.c
+++ /dev/null
@@ -1,130 +0,0 @@
1/*
2 * arch/ppc/platforms/adir_pic.c
3 *
4 * Interrupt controller support for SBS Adirondack
5 *
6 * By Michael Sokolov <msokolov@ivan.Harhan.ORG>
7 * based on the K2 and SCM versions by Matt Porter <mporter@mvista.com>
8 */
9
10#include <linux/stddef.h>
11#include <linux/init.h>
12#include <linux/sched.h>
13#include <linux/pci.h>
14#include <linux/interrupt.h>
15
16#include <asm/io.h>
17#include <asm/i8259.h>
18#include "adir.h"
19
20static void adir_onboard_pic_enable(unsigned int irq);
21static void adir_onboard_pic_disable(unsigned int irq);
22
23__init static void
24adir_onboard_pic_init(void)
25{
26 volatile u_short *maskreg = (volatile u_short *) ADIR_PROCA_INT_MASK;
27
28 /* Disable all Adirondack onboard interrupts */
29 out_be16(maskreg, 0xFFFF);
30}
31
32static int
33adir_onboard_pic_get_irq(void)
34{
35 volatile u_short *statreg = (volatile u_short *) ADIR_PROCA_INT_STAT;
36 int irq;
37 u_short int_status, int_test;
38
39 int_status = in_be16(statreg);
40 for (irq = 0, int_test = 1; irq < 16; irq++, int_test <<= 1) {
41 if (int_status & int_test)
42 break;
43 }
44
45 if (irq == 16)
46 return -1;
47
48 return (irq+16);
49}
50
51static void
52adir_onboard_pic_enable(unsigned int irq)
53{
54 volatile u_short *maskreg = (volatile u_short *) ADIR_PROCA_INT_MASK;
55
56 /* Change irq to Adirondack onboard native value */
57 irq -= 16;
58
59 /* Enable requested irq number */
60 out_be16(maskreg, in_be16(maskreg) & ~(1 << irq));
61}
62
63static void
64adir_onboard_pic_disable(unsigned int irq)
65{
66 volatile u_short *maskreg = (volatile u_short *) ADIR_PROCA_INT_MASK;
67
68 /* Change irq to Adirondack onboard native value */
69 irq -= 16;
70
71 /* Disable requested irq number */
72 out_be16(maskreg, in_be16(maskreg) | (1 << irq));
73}
74
75static struct hw_interrupt_type adir_onboard_pic = {
76 " ADIR PIC ",
77 NULL,
78 NULL,
79 adir_onboard_pic_enable, /* unmask */
80 adir_onboard_pic_disable, /* mask */
81 adir_onboard_pic_disable, /* mask and ack */
82 NULL,
83 NULL
84};
85
86static struct irqaction noop_action = {
87 .handler = no_action,
88 .flags = SA_INTERRUPT,
89 .mask = CPU_MASK_NONE,
90 .name = "82c59 primary cascade",
91};
92
93/*
94 * Linux interrupt values are assigned as follows:
95 *
96 * 0-15 VT82C686 8259 interrupts
97 * 16-31 Adirondack CPLD interrupts
98 */
99__init void
100adir_init_IRQ(void)
101{
102 int i;
103
104 /* Initialize the cascaded 8259's on the VT82C686 */
105 for (i=0; i<16; i++)
106 irq_desc[i].handler = &i8259_pic;
107 i8259_init(NULL);
108
109 /* Initialize Adirondack CPLD PIC and enable 8259 interrupt cascade */
110 for (i=16; i<32; i++)
111 irq_desc[i].handler = &adir_onboard_pic;
112 adir_onboard_pic_init();
113
114 /* Enable 8259 interrupt cascade */
115 setup_irq(ADIR_IRQ_VT82C686_INTR, &noop_action);
116}
117
118int
119adir_get_irq(struct pt_regs *regs)
120{
121 int irq;
122
123 if ((irq = adir_onboard_pic_get_irq()) < 0)
124 return irq;
125
126 if (irq == ADIR_IRQ_VT82C686_INTR)
127 irq = i8259_irq(regs);
128
129 return irq;
130}
diff --git a/arch/ppc/platforms/adir_setup.c b/arch/ppc/platforms/adir_setup.c
deleted file mode 100644
index 6a6754ee0617..000000000000
--- a/arch/ppc/platforms/adir_setup.c
+++ /dev/null
@@ -1,210 +0,0 @@
1/*
2 * arch/ppc/platforms/adir_setup.c
3 *
4 * Board setup routines for SBS Adirondack
5 *
6 * By Michael Sokolov <msokolov@ivan.Harhan.ORG>
7 * based on the K2 version by Matt Porter <mporter@mvista.com>
8 */
9
10#include <linux/config.h>
11#include <linux/stddef.h>
12#include <linux/kernel.h>
13#include <linux/init.h>
14#include <linux/errno.h>
15#include <linux/reboot.h>
16#include <linux/pci.h>
17#include <linux/kdev_t.h>
18#include <linux/types.h>
19#include <linux/major.h>
20#include <linux/initrd.h>
21#include <linux/console.h>
22#include <linux/delay.h>
23#include <linux/ide.h>
24#include <linux/seq_file.h>
25#include <linux/root_dev.h>
26
27#include <asm/system.h>
28#include <asm/pgtable.h>
29#include <asm/page.h>
30#include <asm/dma.h>
31#include <asm/io.h>
32#include <asm/machdep.h>
33#include <asm/time.h>
34#include <asm/todc.h>
35#include <asm/bootinfo.h>
36
37#include "adir.h"
38
39extern void adir_init_IRQ(void);
40extern int adir_get_irq(struct pt_regs *);
41extern void adir_find_bridges(void);
42extern unsigned long loops_per_jiffy;
43
44static unsigned int cpu_750cx[16] = {
45 5, 15, 14, 0, 4, 13, 0, 9, 6, 11, 8, 10, 16, 12, 7, 0
46};
47
48static int
49adir_get_bus_speed(void)
50{
51 if (!(*((u_char *) ADIR_CLOCK_REG) & ADIR_CLOCK_REG_SEL133))
52 return 100000000;
53 else
54 return 133333333;
55}
56
57static int
58adir_get_cpu_speed(void)
59{
60 unsigned long hid1;
61 int cpu_speed;
62
63 hid1 = mfspr(SPRN_HID1) >> 28;
64
65 hid1 = cpu_750cx[hid1];
66
67 cpu_speed = adir_get_bus_speed()*hid1/2;
68 return cpu_speed;
69}
70
71static void __init
72adir_calibrate_decr(void)
73{
74 int freq, divisor = 4;
75
76 /* determine processor bus speed */
77 freq = adir_get_bus_speed();
78 tb_ticks_per_jiffy = freq / HZ / divisor;
79 tb_to_us = mulhwu_scale_factor(freq/divisor, 1000000);
80}
81
82static int
83adir_show_cpuinfo(struct seq_file *m)
84{
85 seq_printf(m, "vendor\t\t: SBS\n");
86 seq_printf(m, "machine\t\t: Adirondack\n");
87 seq_printf(m, "cpu speed\t: %dMhz\n", adir_get_cpu_speed()/1000000);
88 seq_printf(m, "bus speed\t: %dMhz\n", adir_get_bus_speed()/1000000);
89 seq_printf(m, "memory type\t: SDRAM\n");
90
91 return 0;
92}
93
94extern char cmd_line[];
95
96TODC_ALLOC();
97
98static void __init
99adir_setup_arch(void)
100{
101 unsigned int cpu;
102
103 /* Setup TODC access */
104 TODC_INIT(TODC_TYPE_MC146818, ADIR_NVRAM_RTC_ADDR, 0,
105 ADIR_NVRAM_RTC_DATA, 8);
106
107 /* init to some ~sane value until calibrate_delay() runs */
108 loops_per_jiffy = 50000000/HZ;
109
110 /* Setup PCI host bridges */
111 adir_find_bridges();
112
113#ifdef CONFIG_BLK_DEV_INITRD
114 if (initrd_start)
115 ROOT_DEV = Root_RAM0;
116 else
117#endif
118#ifdef CONFIG_ROOT_NFS
119 ROOT_DEV = Root_NFS;
120#else
121 ROOT_DEV = Root_SDA1;
122#endif
123
124 /* Identify the system */
125 printk("System Identification: SBS Adirondack - PowerPC 750CXe @ %d Mhz\n", adir_get_cpu_speed()/1000000);
126 printk("SBS Adirondack port (C) 2001 SBS Technologies, Inc.\n");
127
128 /* Identify the CPU manufacturer */
129 cpu = mfspr(SPRN_PVR);
130 printk("CPU manufacturer: IBM [rev=%04x]\n", (cpu & 0xffff));
131}
132
133static void
134adir_restart(char *cmd)
135{
136 local_irq_disable();
137 /* SRR0 has system reset vector, SRR1 has default MSR value */
138 /* rfi restores MSR from SRR1 and sets the PC to the SRR0 value */
139 __asm__ __volatile__
140 ("lis 3,0xfff0\n\t"
141 "ori 3,3,0x0100\n\t"
142 "mtspr 26,3\n\t"
143 "li 3,0\n\t"
144 "mtspr 27,3\n\t"
145 "rfi\n\t");
146 for(;;);
147}
148
149static void
150adir_power_off(void)
151{
152 for(;;);
153}
154
155static void
156adir_halt(void)
157{
158 adir_restart(NULL);
159}
160
161static unsigned long __init
162adir_find_end_of_memory(void)
163{
164 return boot_mem_size;
165}
166
167static void __init
168adir_map_io(void)
169{
170 io_block_mapping(ADIR_PCI32_VIRT_IO_BASE, ADIR_PCI32_IO_BASE,
171 ADIR_PCI32_VIRT_IO_SIZE, _PAGE_IO);
172 io_block_mapping(ADIR_PCI64_VIRT_IO_BASE, ADIR_PCI64_IO_BASE,
173 ADIR_PCI64_VIRT_IO_SIZE, _PAGE_IO);
174}
175
176void __init
177platform_init(unsigned long r3, unsigned long r4, unsigned long r5,
178 unsigned long r6, unsigned long r7)
179{
180 /*
181 * On the Adirondack we use bi_recs and pass the pointer to them in R3.
182 */
183 parse_bootinfo((struct bi_record *) (r3 + KERNELBASE));
184
185 /* Remember, isa_io_base is virtual but isa_mem_base is physical! */
186 isa_io_base = ADIR_PCI32_VIRT_IO_BASE;
187 isa_mem_base = ADIR_PCI32_MEM_BASE;
188 pci_dram_offset = ADIR_PCI_SYS_MEM_BASE;
189
190 ppc_md.setup_arch = adir_setup_arch;
191 ppc_md.show_cpuinfo = adir_show_cpuinfo;
192 ppc_md.irq_canonicalize = NULL;
193 ppc_md.init_IRQ = adir_init_IRQ;
194 ppc_md.get_irq = adir_get_irq;
195 ppc_md.init = NULL;
196
197 ppc_md.find_end_of_memory = adir_find_end_of_memory;
198 ppc_md.setup_io_mappings = adir_map_io;
199
200 ppc_md.restart = adir_restart;
201 ppc_md.power_off = adir_power_off;
202 ppc_md.halt = adir_halt;
203
204 ppc_md.time_init = todc_time_init;
205 ppc_md.set_rtc_time = todc_set_rtc_time;
206 ppc_md.get_rtc_time = todc_get_rtc_time;
207 ppc_md.nvram_read_val = todc_mc146818_read_val;
208 ppc_md.nvram_write_val = todc_mc146818_write_val;
209 ppc_md.calibrate_decr = adir_calibrate_decr;
210}
diff --git a/arch/ppc/platforms/cpci690.c b/arch/ppc/platforms/cpci690.c
index 507870c9a97a..f64ac2acb603 100644
--- a/arch/ppc/platforms/cpci690.c
+++ b/arch/ppc/platforms/cpci690.c
@@ -35,11 +35,7 @@
35#define SET_PCI_IDE_NATIVE 35#define SET_PCI_IDE_NATIVE
36 36
37static struct mv64x60_handle bh; 37static struct mv64x60_handle bh;
38static u32 cpci690_br_base; 38static void __iomem *cpci690_br_base;
39
40static const unsigned int cpu_7xx[16] = { /* 7xx & 74xx (but not 745x) */
41 18, 15, 14, 2, 4, 13, 5, 9, 6, 11, 8, 10, 16, 12, 7, 0
42};
43 39
44TODC_ALLOC(); 40TODC_ALLOC();
45 41
@@ -55,7 +51,7 @@ cpci690_map_irq(struct pci_dev *dev, unsigned char idsel, unsigned char pin)
55 * A B C D 51 * A B C D
56 */ 52 */
57 { 53 {
58 { 90, 91, 88, 89}, /* IDSEL 30/20 - Sentinel */ 54 { 90, 91, 88, 89 }, /* IDSEL 30/20 - Sentinel */
59 }; 55 };
60 56
61 const long min_idsel = 20, max_idsel = 20, irqs_per_slot = 4; 57 const long min_idsel = 20, max_idsel = 20, irqs_per_slot = 4;
@@ -67,9 +63,9 @@ cpci690_map_irq(struct pci_dev *dev, unsigned char idsel, unsigned char pin)
67 * A B C D 63 * A B C D
68 */ 64 */
69 { 65 {
70 { 93, 94, 95, 92}, /* IDSEL 28/18 - PMC slot 2 */ 66 { 93, 94, 95, 92 }, /* IDSEL 28/18 - PMC slot 2 */
71 { 0, 0, 0, 0}, /* IDSEL 29/19 - Not used */ 67 { 0, 0, 0, 0 }, /* IDSEL 29/19 - Not used */
72 { 94, 95, 92, 93}, /* IDSEL 30/20 - PMC slot 1 */ 68 { 94, 95, 92, 93 }, /* IDSEL 30/20 - PMC slot 1 */
73 }; 69 };
74 70
75 const long min_idsel = 18, max_idsel = 20, irqs_per_slot = 4; 71 const long min_idsel = 18, max_idsel = 20, irqs_per_slot = 4;
@@ -77,68 +73,29 @@ cpci690_map_irq(struct pci_dev *dev, unsigned char idsel, unsigned char pin)
77 } 73 }
78} 74}
79 75
80static int 76#define GB (1024UL * 1024UL * 1024UL)
81cpci690_get_cpu_speed(void)
82{
83 unsigned long hid1;
84 77
85 hid1 = mfspr(SPRN_HID1) >> 28; 78static u32
86 return CPCI690_BUS_FREQ * cpu_7xx[hid1]/2; 79cpci690_get_bus_freq(void)
80{
81 if (boot_mem_size >= (1*GB)) /* bus speed based on mem size */
82 return 100000000;
83 else
84 return 133333333;
87} 85}
88 86
89#define KB (1024UL) 87static const unsigned int cpu_750xx[32] = { /* 750FX & 750GX */
90#define MB (1024UL * KB) 88 0, 0, 2, 2, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,/* 0-15*/
91#define GB (1024UL * MB) 89 16, 17, 18, 19, 20, 22, 24, 26, 28, 30, 32, 34, 36, 38, 40, 0 /*16-31*/
90};
92 91
93unsigned long __init 92static int
94cpci690_find_end_of_memory(void) 93cpci690_get_cpu_freq(void)
95{ 94{
96 u32 mem_ctlr_size; 95 unsigned long pll_cfg;
97 static u32 board_size; 96
98 static u8 first_time = 1; 97 pll_cfg = (mfspr(SPRN_HID1) & 0xf8000000) >> 27;
99 98 return cpci690_get_bus_freq() * cpu_750xx[pll_cfg]/2;
100 if (first_time) {
101 /* Using cpci690_set_bat() mapping ==> virt addr == phys addr */
102 switch (in_8((u8 *) (cpci690_br_base +
103 CPCI690_BR_MEM_CTLR)) & 0x07) {
104 case 0x01:
105 board_size = 256*MB;
106 break;
107 case 0x02:
108 board_size = 512*MB;
109 break;
110 case 0x03:
111 board_size = 768*MB;
112 break;
113 case 0x04:
114 board_size = 1*GB;
115 break;
116 case 0x05:
117 board_size = 1*GB + 512*MB;
118 break;
119 case 0x06:
120 board_size = 2*GB;
121 break;
122 default:
123 board_size = 0xffffffff; /* use mem ctlr size */
124 } /* switch */
125
126 mem_ctlr_size = mv64x60_get_mem_size(CONFIG_MV64X60_NEW_BASE,
127 MV64x60_TYPE_GT64260A);
128
129 /* Check that mem ctlr & board reg agree. If not, pick MIN. */
130 if (board_size != mem_ctlr_size) {
131 printk(KERN_WARNING "Board register & memory controller"
132 "mem size disagree (board reg: 0x%lx, "
133 "mem ctlr: 0x%lx)\n",
134 (ulong)board_size, (ulong)mem_ctlr_size);
135 board_size = min(board_size, mem_ctlr_size);
136 }
137
138 first_time = 0;
139 } /* if */
140
141 return board_size;
142} 99}
143 100
144static void __init 101static void __init
@@ -228,7 +185,7 @@ cpci690_setup_peripherals(void)
228 mv64x60_set_32bit_window(&bh, MV64x60_CPU2DEV_0_WIN, CPCI690_BR_BASE, 185 mv64x60_set_32bit_window(&bh, MV64x60_CPU2DEV_0_WIN, CPCI690_BR_BASE,
229 CPCI690_BR_SIZE, 0); 186 CPCI690_BR_SIZE, 0);
230 bh.ci->enable_window_32bit(&bh, MV64x60_CPU2DEV_0_WIN); 187 bh.ci->enable_window_32bit(&bh, MV64x60_CPU2DEV_0_WIN);
231 cpci690_br_base = (u32)ioremap(CPCI690_BR_BASE, CPCI690_BR_SIZE); 188 cpci690_br_base = ioremap(CPCI690_BR_BASE, CPCI690_BR_SIZE);
232 189
233 mv64x60_set_32bit_window(&bh, MV64x60_CPU2DEV_1_WIN, CPCI690_TODC_BASE, 190 mv64x60_set_32bit_window(&bh, MV64x60_CPU2DEV_1_WIN, CPCI690_TODC_BASE,
234 CPCI690_TODC_SIZE, 0); 191 CPCI690_TODC_SIZE, 0);
@@ -329,7 +286,7 @@ cpci690_fixup_mpsc_pdata(struct platform_device *pdev)
329 pdata->max_idle = 40; 286 pdata->max_idle = 40;
330 pdata->default_baud = CPCI690_MPSC_BAUD; 287 pdata->default_baud = CPCI690_MPSC_BAUD;
331 pdata->brg_clk_src = CPCI690_MPSC_CLK_SRC; 288 pdata->brg_clk_src = CPCI690_MPSC_CLK_SRC;
332 pdata->brg_clk_freq = CPCI690_BUS_FREQ; 289 pdata->brg_clk_freq = cpci690_get_bus_freq();
333} 290}
334 291
335static int __init 292static int __init
@@ -365,7 +322,7 @@ cpci690_reset_board(void)
365 u32 i = 10000; 322 u32 i = 10000;
366 323
367 local_irq_disable(); 324 local_irq_disable();
368 out_8((u8 *)(cpci690_br_base + CPCI690_BR_SW_RESET), 0x11); 325 out_8((cpci690_br_base + CPCI690_BR_SW_RESET), 0x11);
369 326
370 while (i != 0) i++; 327 while (i != 0) i++;
371 panic("restart failed\n"); 328 panic("restart failed\n");
@@ -394,10 +351,40 @@ cpci690_power_off(void)
394static int 351static int
395cpci690_show_cpuinfo(struct seq_file *m) 352cpci690_show_cpuinfo(struct seq_file *m)
396{ 353{
354 char *s;
355
356 seq_printf(m, "cpu MHz\t\t: %d\n",
357 (cpci690_get_cpu_freq() + 500000) / 1000000);
358 seq_printf(m, "bus MHz\t\t: %d\n",
359 (cpci690_get_bus_freq() + 500000) / 1000000);
397 seq_printf(m, "vendor\t\t: " BOARD_VENDOR "\n"); 360 seq_printf(m, "vendor\t\t: " BOARD_VENDOR "\n");
398 seq_printf(m, "machine\t\t: " BOARD_MACHINE "\n"); 361 seq_printf(m, "machine\t\t: " BOARD_MACHINE "\n");
399 seq_printf(m, "cpu MHz\t\t: %d\n", cpci690_get_cpu_speed()/1000/1000); 362 seq_printf(m, "FPGA Revision\t: %d\n",
400 seq_printf(m, "bus MHz\t\t: %d\n", CPCI690_BUS_FREQ/1000/1000); 363 in_8(cpci690_br_base + CPCI690_BR_MEM_CTLR) >> 5);
364
365 switch(bh.type) {
366 case MV64x60_TYPE_GT64260A:
367 s = "gt64260a";
368 break;
369 case MV64x60_TYPE_GT64260B:
370 s = "gt64260b";
371 break;
372 case MV64x60_TYPE_MV64360:
373 s = "mv64360";
374 break;
375 case MV64x60_TYPE_MV64460:
376 s = "mv64460";
377 break;
378 default:
379 s = "Unknown";
380 }
381 seq_printf(m, "bridge type\t: %s\n", s);
382 seq_printf(m, "bridge rev\t: 0x%x\n", bh.rev);
383#if defined(CONFIG_NOT_COHERENT_CACHE)
384 seq_printf(m, "coherency\t: %s\n", "off");
385#else
386 seq_printf(m, "coherency\t: %s\n", "on");
387#endif
401 388
402 return 0; 389 return 0;
403} 390}
@@ -407,7 +394,7 @@ cpci690_calibrate_decr(void)
407{ 394{
408 ulong freq; 395 ulong freq;
409 396
410 freq = CPCI690_BUS_FREQ / 4; 397 freq = cpci690_get_bus_freq() / 4;
411 398
412 printk(KERN_INFO "time_init: decrementer frequency = %lu.%.6lu MHz\n", 399 printk(KERN_INFO "time_init: decrementer frequency = %lu.%.6lu MHz\n",
413 freq/1000000, freq%1000000); 400 freq/1000000, freq%1000000);
@@ -416,25 +403,12 @@ cpci690_calibrate_decr(void)
416 tb_to_us = mulhwu_scale_factor(freq, 1000000); 403 tb_to_us = mulhwu_scale_factor(freq, 1000000);
417} 404}
418 405
419static __inline__ void 406#if defined(CONFIG_SERIAL_TEXT_DEBUG) || defined(CONFIG_KGDB_MPSC)
420cpci690_set_bat(u32 addr, u32 size)
421{
422 addr &= 0xfffe0000;
423 size &= 0x1ffe0000;
424 size = ((size >> 17) - 1) << 2;
425
426 mb();
427 mtspr(SPRN_DBAT1U, addr | size | 0x2); /* Vs == 1; Vp == 0 */
428 mtspr(SPRN_DBAT1L, addr | 0x2a); /* WIMG bits == 0101; PP == r/w access */
429 mb();
430}
431
432#if defined(CONFIG_SERIAL_TEXT_DEBUG) || defined(CONFIG_KGDB)
433static void __init 407static void __init
434cpci690_map_io(void) 408cpci690_map_io(void)
435{ 409{
436 io_block_mapping(CONFIG_MV64X60_NEW_BASE, CONFIG_MV64X60_NEW_BASE, 410 io_block_mapping(CONFIG_MV64X60_NEW_BASE, CONFIG_MV64X60_NEW_BASE,
437 128 * KB, _PAGE_IO); 411 128 * 1024, _PAGE_IO);
438} 412}
439#endif 413#endif
440 414
@@ -442,14 +416,15 @@ void __init
442platform_init(unsigned long r3, unsigned long r4, unsigned long r5, 416platform_init(unsigned long r3, unsigned long r4, unsigned long r5,
443 unsigned long r6, unsigned long r7) 417 unsigned long r6, unsigned long r7)
444{ 418{
445#ifdef CONFIG_BLK_DEV_INITRD
446 initrd_start=initrd_end=0;
447 initrd_below_start_ok=0;
448#endif /* CONFIG_BLK_DEV_INITRD */
449
450 parse_bootinfo(find_bootinfo()); 419 parse_bootinfo(find_bootinfo());
451 420
452 loops_per_jiffy = cpci690_get_cpu_speed() / HZ; 421#ifdef CONFIG_BLK_DEV_INITRD
422 /* take care of initrd if we have one */
423 if (r4) {
424 initrd_start = r4 + KERNELBASE;
425 initrd_end = r5 + KERNELBASE;
426 }
427#endif /* CONFIG_BLK_DEV_INITRD */
453 428
454 isa_mem_base = 0; 429 isa_mem_base = 0;
455 430
@@ -460,7 +435,6 @@ platform_init(unsigned long r3, unsigned long r4, unsigned long r5,
460 ppc_md.restart = cpci690_restart; 435 ppc_md.restart = cpci690_restart;
461 ppc_md.power_off = cpci690_power_off; 436 ppc_md.power_off = cpci690_power_off;
462 ppc_md.halt = cpci690_halt; 437 ppc_md.halt = cpci690_halt;
463 ppc_md.find_end_of_memory = cpci690_find_end_of_memory;
464 ppc_md.time_init = todc_time_init; 438 ppc_md.time_init = todc_time_init;
465 ppc_md.set_rtc_time = todc_set_rtc_time; 439 ppc_md.set_rtc_time = todc_set_rtc_time;
466 ppc_md.get_rtc_time = todc_get_rtc_time; 440 ppc_md.get_rtc_time = todc_get_rtc_time;
@@ -468,22 +442,13 @@ platform_init(unsigned long r3, unsigned long r4, unsigned long r5,
468 ppc_md.nvram_write_val = todc_direct_write_val; 442 ppc_md.nvram_write_val = todc_direct_write_val;
469 ppc_md.calibrate_decr = cpci690_calibrate_decr; 443 ppc_md.calibrate_decr = cpci690_calibrate_decr;
470 444
471 /* 445#if defined(CONFIG_SERIAL_TEXT_DEBUG) || defined(CONFIG_KGDB_MPSC)
472 * Need to map in board regs (used by cpci690_find_end_of_memory())
473 * and the bridge's regs (used by progress);
474 */
475 cpci690_set_bat(CPCI690_BR_BASE, 32 * MB);
476 cpci690_br_base = CPCI690_BR_BASE;
477
478#ifdef CONFIG_SERIAL_TEXT_DEBUG
479 ppc_md.setup_io_mappings = cpci690_map_io; 446 ppc_md.setup_io_mappings = cpci690_map_io;
447#ifdef CONFIG_SERIAL_TEXT_DEBUG
480 ppc_md.progress = mv64x60_mpsc_progress; 448 ppc_md.progress = mv64x60_mpsc_progress;
481 mv64x60_progress_init(CONFIG_MV64X60_NEW_BASE); 449 mv64x60_progress_init(CONFIG_MV64X60_NEW_BASE);
482#endif /* CONFIG_SERIAL_TEXT_DEBUG */ 450#endif /* CONFIG_SERIAL_TEXT_DEBUG */
483#ifdef CONFIG_KGDB 451#endif /* defined(CONFIG_SERIAL_TEXT_DEBUG) || defined(CONFIG_KGDB_MPSC) */
484 ppc_md.setup_io_mappings = cpci690_map_io;
485 ppc_md.early_serial_map = cpci690_early_serial_map;
486#endif /* CONFIG_KGDB */
487 452
488#if defined(CONFIG_SERIAL_MPSC) 453#if defined(CONFIG_SERIAL_MPSC)
489 platform_notify = cpci690_platform_notify; 454 platform_notify = cpci690_platform_notify;
diff --git a/arch/ppc/platforms/cpci690.h b/arch/ppc/platforms/cpci690.h
index 36cd2673c742..49584c9cedf3 100644
--- a/arch/ppc/platforms/cpci690.h
+++ b/arch/ppc/platforms/cpci690.h
@@ -73,6 +73,4 @@ typedef struct board_info {
73#define CPCI690_MPSC_BAUD 9600 73#define CPCI690_MPSC_BAUD 9600
74#define CPCI690_MPSC_CLK_SRC 8 /* TCLK */ 74#define CPCI690_MPSC_CLK_SRC 8 /* TCLK */
75 75
76#define CPCI690_BUS_FREQ 133333333
77
78#endif /* __PPC_PLATFORMS_CPCI690_H */ 76#endif /* __PPC_PLATFORMS_CPCI690_H */
diff --git a/arch/ppc/platforms/ev64360.c b/arch/ppc/platforms/ev64360.c
new file mode 100644
index 000000000000..9811a8a52c25
--- /dev/null
+++ b/arch/ppc/platforms/ev64360.c
@@ -0,0 +1,510 @@
1/*
2 * arch/ppc/platforms/ev64360.c
3 *
4 * Board setup routines for the Marvell EV-64360-BP Evaluation Board.
5 *
6 * Author: Lee Nicks <allinux@gmail.com>
7 *
8 * Based on code done by Rabeeh Khoury - rabeeh@galileo.co.il
9 * Based on code done by - Mark A. Greer <mgreer@mvista.com>
10 *
11 * This program is free software; you can redistribute it and/or modify it
12 * under the terms of the GNU General Public License as published by the
13 * Free Software Foundation; either version 2 of the License, or (at your
14 * option) any later version.
15 */
16#include <linux/config.h>
17#include <linux/kernel.h>
18#include <linux/pci.h>
19#include <linux/kdev_t.h>
20#include <linux/console.h>
21#include <linux/initrd.h>
22#include <linux/root_dev.h>
23#include <linux/delay.h>
24#include <linux/seq_file.h>
25#include <linux/bootmem.h>
26#include <linux/mtd/physmap.h>
27#include <linux/mv643xx.h>
28#ifdef CONFIG_BOOTIMG
29#include <linux/bootimg.h>
30#endif
31#include <asm/page.h>
32#include <asm/time.h>
33#include <asm/smp.h>
34#include <asm/todc.h>
35#include <asm/bootinfo.h>
36#include <asm/ppcboot.h>
37#include <asm/mv64x60.h>
38#include <platforms/ev64360.h>
39
40#define BOARD_VENDOR "Marvell"
41#define BOARD_MACHINE "EV-64360-BP"
42
43static struct mv64x60_handle bh;
44static void __iomem *sram_base;
45
46static u32 ev64360_flash_size_0;
47static u32 ev64360_flash_size_1;
48
49static u32 ev64360_bus_frequency;
50
51unsigned char __res[sizeof(bd_t)];
52
53static int __init
54ev64360_map_irq(struct pci_dev *dev, unsigned char idsel, unsigned char pin)
55{
56 return 0;
57}
58
59static void __init
60ev64360_setup_bridge(void)
61{
62 struct mv64x60_setup_info si;
63 int i;
64
65 memset(&si, 0, sizeof(si));
66
67 si.phys_reg_base = CONFIG_MV64X60_NEW_BASE;
68
69 #ifdef CONFIG_PCI
70 si.pci_1.enable_bus = 1;
71 si.pci_1.pci_io.cpu_base = EV64360_PCI1_IO_START_PROC_ADDR;
72 si.pci_1.pci_io.pci_base_hi = 0;
73 si.pci_1.pci_io.pci_base_lo = EV64360_PCI1_IO_START_PCI_ADDR;
74 si.pci_1.pci_io.size = EV64360_PCI1_IO_SIZE;
75 si.pci_1.pci_io.swap = MV64x60_CPU2PCI_SWAP_NONE;
76 si.pci_1.pci_mem[0].cpu_base = EV64360_PCI1_MEM_START_PROC_ADDR;
77 si.pci_1.pci_mem[0].pci_base_hi = EV64360_PCI1_MEM_START_PCI_HI_ADDR;
78 si.pci_1.pci_mem[0].pci_base_lo = EV64360_PCI1_MEM_START_PCI_LO_ADDR;
79 si.pci_1.pci_mem[0].size = EV64360_PCI1_MEM_SIZE;
80 si.pci_1.pci_mem[0].swap = MV64x60_CPU2PCI_SWAP_NONE;
81 si.pci_1.pci_cmd_bits = 0;
82 si.pci_1.latency_timer = 0x80;
83 #else
84 si.pci_0.enable_bus = 0;
85 si.pci_1.enable_bus = 0;
86 #endif
87
88 for (i = 0; i < MV64x60_CPU2MEM_WINDOWS; i++) {
89#if defined(CONFIG_NOT_COHERENT_CACHE)
90 si.cpu_prot_options[i] = 0;
91 si.enet_options[i] = MV64360_ENET2MEM_SNOOP_NONE;
92 si.mpsc_options[i] = MV64360_MPSC2MEM_SNOOP_NONE;
93 si.idma_options[i] = MV64360_IDMA2MEM_SNOOP_NONE;
94
95 si.pci_1.acc_cntl_options[i] =
96 MV64360_PCI_ACC_CNTL_SNOOP_NONE |
97 MV64360_PCI_ACC_CNTL_SWAP_NONE |
98 MV64360_PCI_ACC_CNTL_MBURST_128_BYTES |
99 MV64360_PCI_ACC_CNTL_RDSIZE_256_BYTES;
100#else
101 si.cpu_prot_options[i] = 0;
102 si.enet_options[i] = MV64360_ENET2MEM_SNOOP_NONE; /* errata */
103 si.mpsc_options[i] = MV64360_MPSC2MEM_SNOOP_NONE; /* errata */
104 si.idma_options[i] = MV64360_IDMA2MEM_SNOOP_NONE; /* errata */
105
106 si.pci_1.acc_cntl_options[i] =
107 MV64360_PCI_ACC_CNTL_SNOOP_WB |
108 MV64360_PCI_ACC_CNTL_SWAP_NONE |
109 MV64360_PCI_ACC_CNTL_MBURST_32_BYTES |
110 MV64360_PCI_ACC_CNTL_RDSIZE_32_BYTES;
111#endif
112 }
113
114 if (mv64x60_init(&bh, &si))
115 printk(KERN_WARNING "Bridge initialization failed.\n");
116
117 #ifdef CONFIG_PCI
118 pci_dram_offset = 0; /* sys mem at same addr on PCI & cpu bus */
119 ppc_md.pci_swizzle = common_swizzle;
120 ppc_md.pci_map_irq = ev64360_map_irq;
121 ppc_md.pci_exclude_device = mv64x60_pci_exclude_device;
122
123 mv64x60_set_bus(&bh, 1, 0);
124 bh.hose_b->first_busno = 0;
125 bh.hose_b->last_busno = 0xff;
126 #endif
127}
128
129/* Bridge & platform setup routines */
130void __init
131ev64360_intr_setup(void)
132{
133 /* MPP 8, 9, and 10 */
134 mv64x60_clr_bits(&bh, MV64x60_MPP_CNTL_1, 0xfff);
135
136 /*
137 * Define GPP 8,9,and 10 interrupt polarity as active low
138 * input signal and level triggered
139 */
140 mv64x60_set_bits(&bh, MV64x60_GPP_LEVEL_CNTL, 0x700);
141 mv64x60_clr_bits(&bh, MV64x60_GPP_IO_CNTL, 0x700);
142
143 /* Config GPP intr ctlr to respond to level trigger */
144 mv64x60_set_bits(&bh, MV64x60_COMM_ARBITER_CNTL, (1<<10));
145
146 /* Erranum FEr PCI-#8 */
147 mv64x60_clr_bits(&bh, MV64x60_PCI0_CMD, (1<<5) | (1<<9));
148 mv64x60_clr_bits(&bh, MV64x60_PCI1_CMD, (1<<5) | (1<<9));
149
150 /*
151 * Dismiss and then enable interrupt on GPP interrupt cause
152 * for CPU #0
153 */
154 mv64x60_write(&bh, MV64x60_GPP_INTR_CAUSE, ~0x700);
155 mv64x60_set_bits(&bh, MV64x60_GPP_INTR_MASK, 0x700);
156
157 /*
158 * Dismiss and then enable interrupt on CPU #0 high cause reg
159 * BIT25 summarizes GPP interrupts 8-15
160 */
161 mv64x60_set_bits(&bh, MV64360_IC_CPU0_INTR_MASK_HI, (1<<25));
162}
163
164void __init
165ev64360_setup_peripherals(void)
166{
167 u32 base;
168
169 /* Set up window for boot CS */
170 mv64x60_set_32bit_window(&bh, MV64x60_CPU2BOOT_WIN,
171 EV64360_BOOT_WINDOW_BASE, EV64360_BOOT_WINDOW_SIZE, 0);
172 bh.ci->enable_window_32bit(&bh, MV64x60_CPU2BOOT_WIN);
173
174 /* We only use the 32-bit flash */
175 mv64x60_get_32bit_window(&bh, MV64x60_CPU2BOOT_WIN, &base,
176 &ev64360_flash_size_0);
177 ev64360_flash_size_1 = 0;
178
179 mv64x60_set_32bit_window(&bh, MV64x60_CPU2DEV_1_WIN,
180 EV64360_RTC_WINDOW_BASE, EV64360_RTC_WINDOW_SIZE, 0);
181 bh.ci->enable_window_32bit(&bh, MV64x60_CPU2DEV_1_WIN);
182
183 mv64x60_set_32bit_window(&bh, MV64x60_CPU2SRAM_WIN,
184 EV64360_INTERNAL_SRAM_BASE, MV64360_SRAM_SIZE, 0);
185 bh.ci->enable_window_32bit(&bh, MV64x60_CPU2SRAM_WIN);
186 sram_base = ioremap(EV64360_INTERNAL_SRAM_BASE, MV64360_SRAM_SIZE);
187
188 /* Set up Enet->SRAM window */
189 mv64x60_set_32bit_window(&bh, MV64x60_ENET2MEM_4_WIN,
190 EV64360_INTERNAL_SRAM_BASE, MV64360_SRAM_SIZE, 0x2);
191 bh.ci->enable_window_32bit(&bh, MV64x60_ENET2MEM_4_WIN);
192
193 /* Give enet r/w access to memory region */
194 mv64x60_set_bits(&bh, MV64360_ENET2MEM_ACC_PROT_0, (0x3 << (4 << 1)));
195 mv64x60_set_bits(&bh, MV64360_ENET2MEM_ACC_PROT_1, (0x3 << (4 << 1)));
196 mv64x60_set_bits(&bh, MV64360_ENET2MEM_ACC_PROT_2, (0x3 << (4 << 1)));
197
198 mv64x60_clr_bits(&bh, MV64x60_PCI1_PCI_DECODE_CNTL, (1 << 3));
199 mv64x60_clr_bits(&bh, MV64x60_TIMR_CNTR_0_3_CNTL,
200 ((1 << 0) | (1 << 8) | (1 << 16) | (1 << 24)));
201
202#if defined(CONFIG_NOT_COHERENT_CACHE)
203 mv64x60_write(&bh, MV64360_SRAM_CONFIG, 0x00160000);
204#else
205 mv64x60_write(&bh, MV64360_SRAM_CONFIG, 0x001600b2);
206#endif
207
208 /*
209 * Setting the SRAM to 0. Note that this generates parity errors on
210 * internal data path in SRAM since it's first time accessing it
211 * while after reset it's not configured.
212 */
213 memset(sram_base, 0, MV64360_SRAM_SIZE);
214
215 /* set up PCI interrupt controller */
216 ev64360_intr_setup();
217}
218
219static void __init
220ev64360_setup_arch(void)
221{
222 if (ppc_md.progress)
223 ppc_md.progress("ev64360_setup_arch: enter", 0);
224
225 set_tb(0, 0);
226
227#ifdef CONFIG_BLK_DEV_INITRD
228 if (initrd_start)
229 ROOT_DEV = Root_RAM0;
230 else
231#endif
232#ifdef CONFIG_ROOT_NFS
233 ROOT_DEV = Root_NFS;
234#else
235 ROOT_DEV = Root_SDA2;
236#endif
237
238 /*
239 * Set up the L2CR register.
240 */
241 _set_L2CR(L2CR_L2E | L2CR_L2PE);
242
243 if (ppc_md.progress)
244 ppc_md.progress("ev64360_setup_arch: calling setup_bridge", 0);
245
246 ev64360_setup_bridge();
247 ev64360_setup_peripherals();
248 ev64360_bus_frequency = ev64360_bus_freq();
249
250 printk(KERN_INFO "%s %s port (C) 2005 Lee Nicks "
251 "(allinux@gmail.com)\n", BOARD_VENDOR, BOARD_MACHINE);
252 if (ppc_md.progress)
253 ppc_md.progress("ev64360_setup_arch: exit", 0);
254}
255
256/* Platform device data fixup routines. */
257#if defined(CONFIG_SERIAL_MPSC)
258static void __init
259ev64360_fixup_mpsc_pdata(struct platform_device *pdev)
260{
261 struct mpsc_pdata *pdata;
262
263 pdata = (struct mpsc_pdata *)pdev->dev.platform_data;
264
265 pdata->max_idle = 40;
266 pdata->default_baud = EV64360_DEFAULT_BAUD;
267 pdata->brg_clk_src = EV64360_MPSC_CLK_SRC;
268 /*
269 * TCLK (not SysCLk) is routed to BRG, then to the MPSC. On most parts,
270 * TCLK == SysCLK but on 64460, they are separate pins.
271 * SysCLK can go up to 200 MHz but TCLK can only go up to 133 MHz.
272 */
273 pdata->brg_clk_freq = min(ev64360_bus_frequency, MV64x60_TCLK_FREQ_MAX);
274}
275#endif
276
277#if defined(CONFIG_MV643XX_ETH)
278static void __init
279ev64360_fixup_eth_pdata(struct platform_device *pdev)
280{
281 struct mv643xx_eth_platform_data *eth_pd;
282 static u16 phy_addr[] = {
283 EV64360_ETH0_PHY_ADDR,
284 EV64360_ETH1_PHY_ADDR,
285 EV64360_ETH2_PHY_ADDR,
286 };
287
288 eth_pd = pdev->dev.platform_data;
289 eth_pd->force_phy_addr = 1;
290 eth_pd->phy_addr = phy_addr[pdev->id];
291 eth_pd->tx_queue_size = EV64360_ETH_TX_QUEUE_SIZE;
292 eth_pd->rx_queue_size = EV64360_ETH_RX_QUEUE_SIZE;
293}
294#endif
295
296static int __init
297ev64360_platform_notify(struct device *dev)
298{
299 static struct {
300 char *bus_id;
301 void ((*rtn)(struct platform_device *pdev));
302 } dev_map[] = {
303#if defined(CONFIG_SERIAL_MPSC)
304 { MPSC_CTLR_NAME ".0", ev64360_fixup_mpsc_pdata },
305 { MPSC_CTLR_NAME ".1", ev64360_fixup_mpsc_pdata },
306#endif
307#if defined(CONFIG_MV643XX_ETH)
308 { MV643XX_ETH_NAME ".0", ev64360_fixup_eth_pdata },
309 { MV643XX_ETH_NAME ".1", ev64360_fixup_eth_pdata },
310 { MV643XX_ETH_NAME ".2", ev64360_fixup_eth_pdata },
311#endif
312 };
313 struct platform_device *pdev;
314 int i;
315
316 if (dev && dev->bus_id)
317 for (i=0; i<ARRAY_SIZE(dev_map); i++)
318 if (!strncmp(dev->bus_id, dev_map[i].bus_id,
319 BUS_ID_SIZE)) {
320
321 pdev = container_of(dev,
322 struct platform_device, dev);
323 dev_map[i].rtn(pdev);
324 }
325
326 return 0;
327}
328
329#ifdef CONFIG_MTD_PHYSMAP
330
331#ifndef MB
332#define MB (1 << 20)
333#endif
334
335/*
336 * MTD Layout.
337 *
338 * FLASH Amount: 0xff000000 - 0xffffffff
339 * ------------- -----------------------
340 * Reserved: 0xff000000 - 0xff03ffff
341 * JFFS2 file system: 0xff040000 - 0xffefffff
342 * U-boot: 0xfff00000 - 0xffffffff
343 */
344static int __init
345ev64360_setup_mtd(void)
346{
347 u32 size;
348 int ptbl_entries;
349 static struct mtd_partition *ptbl;
350
351 size = ev64360_flash_size_0 + ev64360_flash_size_1;
352 if (!size)
353 return -ENOMEM;
354
355 ptbl_entries = 3;
356
357 if ((ptbl = kmalloc(ptbl_entries * sizeof(struct mtd_partition),
358 GFP_KERNEL)) == NULL) {
359
360 printk(KERN_WARNING "Can't alloc MTD partition table\n");
361 return -ENOMEM;
362 }
363 memset(ptbl, 0, ptbl_entries * sizeof(struct mtd_partition));
364
365 ptbl[0].name = "reserved";
366 ptbl[0].offset = 0;
367 ptbl[0].size = EV64360_MTD_RESERVED_SIZE;
368 ptbl[1].name = "jffs2";
369 ptbl[1].offset = EV64360_MTD_RESERVED_SIZE;
370 ptbl[1].size = EV64360_MTD_JFFS2_SIZE;
371 ptbl[2].name = "U-BOOT";
372 ptbl[2].offset = EV64360_MTD_RESERVED_SIZE + EV64360_MTD_JFFS2_SIZE;
373 ptbl[2].size = EV64360_MTD_UBOOT_SIZE;
374
375 physmap_map.size = size;
376 physmap_set_partitions(ptbl, ptbl_entries);
377 return 0;
378}
379
380arch_initcall(ev64360_setup_mtd);
381#endif
382
383static void
384ev64360_restart(char *cmd)
385{
386 ulong i = 0xffffffff;
387 volatile unsigned char * rtc_base = ioremap(EV64360_RTC_WINDOW_BASE,0x4000);
388
389 /* issue hard reset */
390 rtc_base[0xf] = 0x80;
391 rtc_base[0xc] = 0x00;
392 rtc_base[0xd] = 0x01;
393 rtc_base[0xf] = 0x83;
394
395 while (i-- > 0) ;
396 panic("restart failed\n");
397}
398
399static void
400ev64360_halt(void)
401{
402 while (1) ;
403 /* NOTREACHED */
404}
405
406static void
407ev64360_power_off(void)
408{
409 ev64360_halt();
410 /* NOTREACHED */
411}
412
413static int
414ev64360_show_cpuinfo(struct seq_file *m)
415{
416 seq_printf(m, "vendor\t\t: " BOARD_VENDOR "\n");
417 seq_printf(m, "machine\t\t: " BOARD_MACHINE "\n");
418 seq_printf(m, "bus speed\t: %dMHz\n", ev64360_bus_frequency/1000/1000);
419
420 return 0;
421}
422
423static void __init
424ev64360_calibrate_decr(void)
425{
426 u32 freq;
427
428 freq = ev64360_bus_frequency / 4;
429
430 printk(KERN_INFO "time_init: decrementer frequency = %lu.%.6lu MHz\n",
431 (long)freq / 1000000, (long)freq % 1000000);
432
433 tb_ticks_per_jiffy = freq / HZ;
434 tb_to_us = mulhwu_scale_factor(freq, 1000000);
435}
436
437unsigned long __init
438ev64360_find_end_of_memory(void)
439{
440 return mv64x60_get_mem_size(CONFIG_MV64X60_NEW_BASE,
441 MV64x60_TYPE_MV64360);
442}
443
444static inline void
445ev64360_set_bat(void)
446{
447 mb();
448 mtspr(SPRN_DBAT2U, 0xf0001ffe);
449 mtspr(SPRN_DBAT2L, 0xf000002a);
450 mb();
451}
452
453#if defined(CONFIG_SERIAL_TEXT_DEBUG) && defined(CONFIG_SERIAL_MPSC_CONSOLE)
454static void __init
455ev64360_map_io(void)
456{
457 io_block_mapping(CONFIG_MV64X60_NEW_BASE, \
458 CONFIG_MV64X60_NEW_BASE, \
459 0x00020000, _PAGE_IO);
460}
461#endif
462
463void __init
464platform_init(unsigned long r3, unsigned long r4, unsigned long r5,
465 unsigned long r6, unsigned long r7)
466{
467 parse_bootinfo(find_bootinfo());
468
469 /* ASSUMPTION: If both r3 (bd_t pointer) and r6 (cmdline pointer)
470 * are non-zero, then we should use the board info from the bd_t
471 * structure and the cmdline pointed to by r6 instead of the
472 * information from birecs, if any. Otherwise, use the information
473 * from birecs as discovered by the preceeding call to
474 * parse_bootinfo(). This rule should work with both PPCBoot, which
475 * uses a bd_t board info structure, and the kernel boot wrapper,
476 * which uses birecs.
477 */
478 if (r3 && r6) {
479 /* copy board info structure */
480 memcpy( (void *)__res,(void *)(r3+KERNELBASE), sizeof(bd_t) );
481 /* copy command line */
482 *(char *)(r7+KERNELBASE) = 0;
483 strcpy(cmd_line, (char *)(r6+KERNELBASE));
484 }
485 #ifdef CONFIG_ISA
486 isa_mem_base = 0;
487 #endif
488
489 ppc_md.setup_arch = ev64360_setup_arch;
490 ppc_md.show_cpuinfo = ev64360_show_cpuinfo;
491 ppc_md.init_IRQ = mv64360_init_irq;
492 ppc_md.get_irq = mv64360_get_irq;
493 ppc_md.restart = ev64360_restart;
494 ppc_md.power_off = ev64360_power_off;
495 ppc_md.halt = ev64360_halt;
496 ppc_md.find_end_of_memory = ev64360_find_end_of_memory;
497 ppc_md.calibrate_decr = ev64360_calibrate_decr;
498
499#if defined(CONFIG_SERIAL_TEXT_DEBUG) && defined(CONFIG_SERIAL_MPSC_CONSOLE)
500 ppc_md.setup_io_mappings = ev64360_map_io;
501 ppc_md.progress = mv64x60_mpsc_progress;
502 mv64x60_progress_init(CONFIG_MV64X60_NEW_BASE);
503#endif
504
505#if defined(CONFIG_SERIAL_MPSC) || defined(CONFIG_MV643XX_ETH)
506 platform_notify = ev64360_platform_notify;
507#endif
508
509 ev64360_set_bat(); /* Need for ev64360_find_end_of_memory and progress */
510}
diff --git a/arch/ppc/platforms/ev64360.h b/arch/ppc/platforms/ev64360.h
new file mode 100644
index 000000000000..68eabe490397
--- /dev/null
+++ b/arch/ppc/platforms/ev64360.h
@@ -0,0 +1,116 @@
1/*
2 * arch/ppc/platforms/ev64360.h
3 *
4 * Definitions for Marvell EV-64360-BP Evaluation Board.
5 *
6 * Author: Lee Nicks <allinux@gmail.com>
7 *
8 * Based on code done by Rabeeh Khoury - rabeeh@galileo.co.il
9 * Based on code done by Mark A. Greer <mgreer@mvista.com>
10 *
11 * This program is free software; you can redistribute it and/or modify it
12 * under the terms of the GNU General Public License as published by the
13 * Free Software Foundation; either version 2 of the License, or (at your
14 * option) any later version.
15 */
16
17/*
18 * The MV64360 has 2 PCI buses each with 1 window from the CPU bus to
19 * PCI I/O space and 4 windows from the CPU bus to PCI MEM space.
20 * We'll only use one PCI MEM window on each PCI bus.
21 *
22 * This is the CPU physical memory map (windows must be at least 64KB and start
23 * on a boundary that is a multiple of the window size):
24 *
25 * 0x42000000-0x4203ffff - Internal SRAM
26 * 0xf1000000-0xf100ffff - MV64360 Registers (CONFIG_MV64X60_NEW_BASE)
27 * 0xfc800000-0xfcffffff - RTC
28 * 0xff000000-0xffffffff - Boot window, 16 MB flash
29 * 0xc0000000-0xc3ffffff - PCI I/O (second hose)
30 * 0x80000000-0xbfffffff - PCI MEM (second hose)
31 */
32
33#ifndef __PPC_PLATFORMS_EV64360_H
34#define __PPC_PLATFORMS_EV64360_H
35
36/* CPU Physical Memory Map setup. */
37#define EV64360_BOOT_WINDOW_BASE 0xff000000
38#define EV64360_BOOT_WINDOW_SIZE 0x01000000 /* 16 MB */
39#define EV64360_INTERNAL_SRAM_BASE 0x42000000
40#define EV64360_RTC_WINDOW_BASE 0xfc800000
41#define EV64360_RTC_WINDOW_SIZE 0x00800000 /* 8 MB */
42
43#define EV64360_PCI1_MEM_START_PROC_ADDR 0x80000000
44#define EV64360_PCI1_MEM_START_PCI_HI_ADDR 0x00000000
45#define EV64360_PCI1_MEM_START_PCI_LO_ADDR 0x80000000
46#define EV64360_PCI1_MEM_SIZE 0x40000000 /* 1 GB */
47#define EV64360_PCI1_IO_START_PROC_ADDR 0xc0000000
48#define EV64360_PCI1_IO_START_PCI_ADDR 0x00000000
49#define EV64360_PCI1_IO_SIZE 0x04000000 /* 64 MB */
50
51#define EV64360_DEFAULT_BAUD 115200
52#define EV64360_MPSC_CLK_SRC 8 /* TCLK */
53#define EV64360_MPSC_CLK_FREQ 133333333
54
55#define EV64360_MTD_RESERVED_SIZE 0x40000
56#define EV64360_MTD_JFFS2_SIZE 0xec0000
57#define EV64360_MTD_UBOOT_SIZE 0x100000
58
59#define EV64360_ETH0_PHY_ADDR 8
60#define EV64360_ETH1_PHY_ADDR 9
61#define EV64360_ETH2_PHY_ADDR 10
62
63#define EV64360_ETH_TX_QUEUE_SIZE 800
64#define EV64360_ETH_RX_QUEUE_SIZE 400
65
66#define EV64360_ETH_PORT_CONFIG_VALUE \
67 ETH_UNICAST_NORMAL_MODE | \
68 ETH_DEFAULT_RX_QUEUE_0 | \
69 ETH_DEFAULT_RX_ARP_QUEUE_0 | \
70 ETH_RECEIVE_BC_IF_NOT_IP_OR_ARP | \
71 ETH_RECEIVE_BC_IF_IP | \
72 ETH_RECEIVE_BC_IF_ARP | \
73 ETH_CAPTURE_TCP_FRAMES_DIS | \
74 ETH_CAPTURE_UDP_FRAMES_DIS | \
75 ETH_DEFAULT_RX_TCP_QUEUE_0 | \
76 ETH_DEFAULT_RX_UDP_QUEUE_0 | \
77 ETH_DEFAULT_RX_BPDU_QUEUE_0
78
79#define EV64360_ETH_PORT_CONFIG_EXTEND_VALUE \
80 ETH_SPAN_BPDU_PACKETS_AS_NORMAL | \
81 ETH_PARTITION_DISABLE
82
83#define GT_ETH_IPG_INT_RX(value) \
84 ((value & 0x3fff) << 8)
85
86#define EV64360_ETH_PORT_SDMA_CONFIG_VALUE \
87 ETH_RX_BURST_SIZE_4_64BIT | \
88 GT_ETH_IPG_INT_RX(0) | \
89 ETH_TX_BURST_SIZE_4_64BIT
90
91#define EV64360_ETH_PORT_SERIAL_CONTROL_VALUE \
92 ETH_FORCE_LINK_PASS | \
93 ETH_ENABLE_AUTO_NEG_FOR_DUPLX | \
94 ETH_DISABLE_AUTO_NEG_FOR_FLOW_CTRL | \
95 ETH_ADV_SYMMETRIC_FLOW_CTRL | \
96 ETH_FORCE_FC_MODE_NO_PAUSE_DIS_TX | \
97 ETH_FORCE_BP_MODE_NO_JAM | \
98 BIT9 | \
99 ETH_DO_NOT_FORCE_LINK_FAIL | \
100 ETH_RETRANSMIT_16_ATTEMPTS | \
101 ETH_ENABLE_AUTO_NEG_SPEED_GMII | \
102 ETH_DTE_ADV_0 | \
103 ETH_DISABLE_AUTO_NEG_BYPASS | \
104 ETH_AUTO_NEG_NO_CHANGE | \
105 ETH_MAX_RX_PACKET_9700BYTE | \
106 ETH_CLR_EXT_LOOPBACK | \
107 ETH_SET_FULL_DUPLEX_MODE | \
108 ETH_ENABLE_FLOW_CTRL_TX_RX_IN_FULL_DUPLEX
109
110static inline u32
111ev64360_bus_freq(void)
112{
113 return 133333333;
114}
115
116#endif /* __PPC_PLATFORMS_EV64360_H */
diff --git a/arch/ppc/platforms/k2.c b/arch/ppc/platforms/k2.c
deleted file mode 100644
index aacb438708ff..000000000000
--- a/arch/ppc/platforms/k2.c
+++ /dev/null
@@ -1,613 +0,0 @@
1/*
2 * arch/ppc/platforms/k2.c
3 *
4 * Board setup routines for SBS K2
5 *
6 * Author: Matt Porter <mporter@mvista.com>
7 *
8 * Updated by: Randy Vinson <rvinson@mvista.com.
9 *
10 * 2001-2004 (c) MontaVista, Software, Inc. This file is licensed under
11 * the terms of the GNU General Public License version 2. This program
12 * is licensed "as is" without any warranty of any kind, whether express
13 * or implied.
14 */
15
16#include <linux/config.h>
17#include <linux/stddef.h>
18#include <linux/kernel.h>
19#include <linux/init.h>
20#include <linux/errno.h>
21#include <linux/reboot.h>
22#include <linux/pci.h>
23#include <linux/kdev_t.h>
24#include <linux/types.h>
25#include <linux/major.h>
26#include <linux/initrd.h>
27#include <linux/console.h>
28#include <linux/delay.h>
29#include <linux/ide.h>
30#include <linux/irq.h>
31#include <linux/seq_file.h>
32#include <linux/root_dev.h>
33
34#include <asm/system.h>
35#include <asm/pgtable.h>
36#include <asm/page.h>
37#include <asm/dma.h>
38#include <asm/io.h>
39#include <asm/machdep.h>
40#include <asm/time.h>
41#include <asm/i8259.h>
42#include <asm/todc.h>
43#include <asm/bootinfo.h>
44
45#include <syslib/cpc710.h>
46#include "k2.h"
47
48extern unsigned long loops_per_jiffy;
49extern void gen550_progress(char *, unsigned short);
50
51static unsigned int cpu_7xx[16] = {
52 0, 15, 14, 0, 0, 13, 5, 9, 6, 11, 8, 10, 16, 12, 7, 0
53};
54static unsigned int cpu_6xx[16] = {
55 0, 0, 14, 0, 0, 13, 5, 9, 6, 11, 8, 10, 0, 12, 7, 0
56};
57
58static inline int __init
59k2_map_irq(struct pci_dev *dev, unsigned char idsel, unsigned char pin)
60{
61 struct pci_controller *hose = pci_bus_to_hose(dev->bus->number);
62 /*
63 * Check our hose index. If we are zero then we are on the
64 * local PCI hose, otherwise we are on the cPCI hose.
65 */
66 if (!hose->index) {
67 static char pci_irq_table[][4] =
68 /*
69 * PCI IDSEL/INTPIN->INTLINE
70 * A B C D
71 */
72 {
73 {1, 0, 0, 0}, /* Ethernet */
74 {5, 5, 5, 5}, /* PMC Site 1 */
75 {6, 6, 6, 6}, /* PMC Site 2 */
76 {0, 0, 0, 0}, /* unused */
77 {0, 0, 0, 0}, /* unused */
78 {0, 0, 0, 0}, /* PCI-ISA Bridge */
79 {0, 0, 0, 0}, /* unused */
80 {0, 0, 0, 0}, /* unused */
81 {0, 0, 0, 0}, /* unused */
82 {0, 0, 0, 0}, /* unused */
83 {0, 0, 0, 0}, /* unused */
84 {0, 0, 0, 0}, /* unused */
85 {0, 0, 0, 0}, /* unused */
86 {0, 0, 0, 0}, /* unused */
87 {15, 0, 0, 0}, /* M5229 IDE */
88 };
89 const long min_idsel = 3, max_idsel = 17, irqs_per_slot = 4;
90 return PCI_IRQ_TABLE_LOOKUP;
91 } else {
92 static char pci_irq_table[][4] =
93 /*
94 * PCI IDSEL/INTPIN->INTLINE
95 * A B C D
96 */
97 {
98 {10, 11, 12, 9}, /* cPCI slot 8 */
99 {11, 12, 9, 10}, /* cPCI slot 7 */
100 {12, 9, 10, 11}, /* cPCI slot 6 */
101 {9, 10, 11, 12}, /* cPCI slot 5 */
102 {10, 11, 12, 9}, /* cPCI slot 4 */
103 {11, 12, 9, 10}, /* cPCI slot 3 */
104 {12, 9, 10, 11}, /* cPCI slot 2 */
105 };
106 const long min_idsel = 15, max_idsel = 21, irqs_per_slot = 4;
107 return PCI_IRQ_TABLE_LOOKUP;
108 }
109}
110
111void k2_pcibios_fixup(void)
112{
113#if defined(CONFIG_BLK_DEV_IDE) || defined(CONFIG_BLK_DEV_IDE_MODULE)
114 struct pci_dev *ide_dev;
115
116 /*
117 * Enable DMA support on hdc
118 */
119 ide_dev = pci_get_device(PCI_VENDOR_ID_AL,
120 PCI_DEVICE_ID_AL_M5229, NULL);
121
122 if (ide_dev) {
123
124 unsigned long ide_dma_base;
125
126 ide_dma_base = pci_resource_start(ide_dev, 4);
127 outb(0x00, ide_dma_base + 0x2);
128 outb(0x20, ide_dma_base + 0xa);
129 pci_dev_put(ide_dev);
130 }
131#endif
132}
133
134void k2_pcibios_fixup_resources(struct pci_dev *dev)
135{
136 int i;
137
138 if ((dev->vendor == PCI_VENDOR_ID_IBM) &&
139 (dev->device == PCI_DEVICE_ID_IBM_CPC710_PCI64)) {
140 pr_debug("Fixup CPC710 resources\n");
141 for (i = 0; i < DEVICE_COUNT_RESOURCE; i++) {
142 dev->resource[i].start = 0;
143 dev->resource[i].end = 0;
144 }
145 }
146}
147
148void k2_setup_hoses(void)
149{
150 struct pci_controller *hose_a, *hose_b;
151
152 /*
153 * Reconfigure CPC710 memory map so
154 * we have some more PCI memory space.
155 */
156
157 /* Set FPHB mode */
158 __raw_writel(0x808000e0, PGCHP); /* Set FPHB mode */
159
160 /* PCI32 mappings */
161 __raw_writel(0x00000000, K2_PCI32_BAR + PIBAR); /* PCI I/O base */
162 __raw_writel(0x00000000, K2_PCI32_BAR + PMBAR); /* PCI Mem base */
163 __raw_writel(0xf0000000, K2_PCI32_BAR + MSIZE); /* 256MB */
164 __raw_writel(0xfff00000, K2_PCI32_BAR + IOSIZE); /* 1MB */
165 __raw_writel(0xc0000000, K2_PCI32_BAR + SMBAR); /* Base@0xc0000000 */
166 __raw_writel(0x80000000, K2_PCI32_BAR + SIBAR); /* Base@0x80000000 */
167 __raw_writel(0x000000c0, K2_PCI32_BAR + PSSIZE); /* 1GB space */
168 __raw_writel(0x000000c0, K2_PCI32_BAR + PPSIZE); /* 1GB space */
169 __raw_writel(0x00000000, K2_PCI32_BAR + BARPS); /* Base@0x00000000 */
170 __raw_writel(0x00000000, K2_PCI32_BAR + BARPP); /* Base@0x00000000 */
171 __raw_writel(0x00000080, K2_PCI32_BAR + PSBAR); /* Base@0x80 */
172 __raw_writel(0x00000000, K2_PCI32_BAR + PPBAR);
173
174 __raw_writel(0xc0000000, K2_PCI32_BAR + BPMDLK);
175 __raw_writel(0xd0000000, K2_PCI32_BAR + TPMDLK);
176 __raw_writel(0x80000000, K2_PCI32_BAR + BIODLK);
177 __raw_writel(0x80100000, K2_PCI32_BAR + TIODLK);
178 __raw_writel(0xe0008000, K2_PCI32_BAR + DLKCTRL);
179 __raw_writel(0xffffffff, K2_PCI32_BAR + DLKDEV);
180
181 /* PCI64 mappings */
182 __raw_writel(0x00100000, K2_PCI64_BAR + PIBAR); /* PCI I/O base */
183 __raw_writel(0x10000000, K2_PCI64_BAR + PMBAR); /* PCI Mem base */
184 __raw_writel(0xf0000000, K2_PCI64_BAR + MSIZE); /* 256MB */
185 __raw_writel(0xfff00000, K2_PCI64_BAR + IOSIZE); /* 1MB */
186 __raw_writel(0xd0000000, K2_PCI64_BAR + SMBAR); /* Base@0xd0000000 */
187 __raw_writel(0x80100000, K2_PCI64_BAR + SIBAR); /* Base@0x80100000 */
188 __raw_writel(0x000000c0, K2_PCI64_BAR + PSSIZE); /* 1GB space */
189 __raw_writel(0x000000c0, K2_PCI64_BAR + PPSIZE); /* 1GB space */
190 __raw_writel(0x00000000, K2_PCI64_BAR + BARPS); /* Base@0x00000000 */
191 __raw_writel(0x00000000, K2_PCI64_BAR + BARPP); /* Base@0x00000000 */
192
193 /* Setup PCI32 hose */
194 hose_a = pcibios_alloc_controller();
195 if (!hose_a)
196 return;
197
198 hose_a->first_busno = 0;
199 hose_a->last_busno = 0xff;
200 hose_a->pci_mem_offset = K2_PCI32_MEM_BASE;
201
202 pci_init_resource(&hose_a->io_resource,
203 K2_PCI32_LOWER_IO,
204 K2_PCI32_UPPER_IO,
205 IORESOURCE_IO, "PCI32 host bridge");
206
207 pci_init_resource(&hose_a->mem_resources[0],
208 K2_PCI32_LOWER_MEM + K2_PCI32_MEM_BASE,
209 K2_PCI32_UPPER_MEM + K2_PCI32_MEM_BASE,
210 IORESOURCE_MEM, "PCI32 host bridge");
211
212 hose_a->io_space.start = K2_PCI32_LOWER_IO;
213 hose_a->io_space.end = K2_PCI32_UPPER_IO;
214 hose_a->mem_space.start = K2_PCI32_LOWER_MEM;
215 hose_a->mem_space.end = K2_PCI32_UPPER_MEM;
216 hose_a->io_base_virt = (void *)K2_ISA_IO_BASE;
217
218 setup_indirect_pci(hose_a, K2_PCI32_CONFIG_ADDR, K2_PCI32_CONFIG_DATA);
219
220 /* Initialize PCI32 bus registers */
221 early_write_config_byte(hose_a,
222 hose_a->first_busno,
223 PCI_DEVFN(0, 0),
224 CPC710_BUS_NUMBER, hose_a->first_busno);
225
226 early_write_config_byte(hose_a,
227 hose_a->first_busno,
228 PCI_DEVFN(0, 0),
229 CPC710_SUB_BUS_NUMBER, hose_a->last_busno);
230
231 /* Enable PCI interrupt polling */
232 early_write_config_byte(hose_a,
233 hose_a->first_busno,
234 PCI_DEVFN(8, 0), 0x45, 0x80);
235
236 /* Route polled PCI interrupts */
237 early_write_config_byte(hose_a,
238 hose_a->first_busno,
239 PCI_DEVFN(8, 0), 0x48, 0x58);
240
241 early_write_config_byte(hose_a,
242 hose_a->first_busno,
243 PCI_DEVFN(8, 0), 0x49, 0x07);
244
245 early_write_config_byte(hose_a,
246 hose_a->first_busno,
247 PCI_DEVFN(8, 0), 0x4a, 0x31);
248
249 early_write_config_byte(hose_a,
250 hose_a->first_busno,
251 PCI_DEVFN(8, 0), 0x4b, 0xb9);
252
253 /* route secondary IDE channel interrupt to IRQ 15 */
254 early_write_config_byte(hose_a,
255 hose_a->first_busno,
256 PCI_DEVFN(8, 0), 0x75, 0x0f);
257
258 /* enable IDE controller IDSEL */
259 early_write_config_byte(hose_a,
260 hose_a->first_busno,
261 PCI_DEVFN(8, 0), 0x58, 0x48);
262
263 /* Enable IDE function */
264 early_write_config_byte(hose_a,
265 hose_a->first_busno,
266 PCI_DEVFN(17, 0), 0x50, 0x03);
267
268 /* Set M5229 IDE controller to native mode */
269 early_write_config_byte(hose_a,
270 hose_a->first_busno,
271 PCI_DEVFN(17, 0), PCI_CLASS_PROG, 0xdf);
272
273 hose_a->last_busno = pciauto_bus_scan(hose_a, hose_a->first_busno);
274
275 /* Write out correct max subordinate bus number for hose A */
276 early_write_config_byte(hose_a,
277 hose_a->first_busno,
278 PCI_DEVFN(0, 0),
279 CPC710_SUB_BUS_NUMBER, hose_a->last_busno);
280
281 /* Only setup PCI64 hose if we are in the system slot */
282 if (!(readb(K2_MISC_REG) & K2_SYS_SLOT_MASK)) {
283 /* Setup PCI64 hose */
284 hose_b = pcibios_alloc_controller();
285 if (!hose_b)
286 return;
287
288 hose_b->first_busno = hose_a->last_busno + 1;
289 hose_b->last_busno = 0xff;
290
291 /* Reminder: quit changing the following, it is correct. */
292 hose_b->pci_mem_offset = K2_PCI32_MEM_BASE;
293
294 pci_init_resource(&hose_b->io_resource,
295 K2_PCI64_LOWER_IO,
296 K2_PCI64_UPPER_IO,
297 IORESOURCE_IO, "PCI64 host bridge");
298
299 pci_init_resource(&hose_b->mem_resources[0],
300 K2_PCI64_LOWER_MEM + K2_PCI32_MEM_BASE,
301 K2_PCI64_UPPER_MEM + K2_PCI32_MEM_BASE,
302 IORESOURCE_MEM, "PCI64 host bridge");
303
304 hose_b->io_space.start = K2_PCI64_LOWER_IO;
305 hose_b->io_space.end = K2_PCI64_UPPER_IO;
306 hose_b->mem_space.start = K2_PCI64_LOWER_MEM;
307 hose_b->mem_space.end = K2_PCI64_UPPER_MEM;
308 hose_b->io_base_virt = (void *)K2_ISA_IO_BASE;
309
310 setup_indirect_pci(hose_b,
311 K2_PCI64_CONFIG_ADDR, K2_PCI64_CONFIG_DATA);
312
313 /* Initialize PCI64 bus registers */
314 early_write_config_byte(hose_b,
315 0,
316 PCI_DEVFN(0, 0),
317 CPC710_SUB_BUS_NUMBER, 0xff);
318
319 early_write_config_byte(hose_b,
320 0,
321 PCI_DEVFN(0, 0),
322 CPC710_BUS_NUMBER, hose_b->first_busno);
323
324 hose_b->last_busno = pciauto_bus_scan(hose_b,
325 hose_b->first_busno);
326
327 /* Write out correct max subordinate bus number for hose B */
328 early_write_config_byte(hose_b,
329 hose_b->first_busno,
330 PCI_DEVFN(0, 0),
331 CPC710_SUB_BUS_NUMBER,
332 hose_b->last_busno);
333
334 /* Configure PCI64 PSBAR */
335 early_write_config_dword(hose_b,
336 hose_b->first_busno,
337 PCI_DEVFN(0, 0),
338 PCI_BASE_ADDRESS_0,
339 K2_PCI64_SYS_MEM_BASE);
340 }
341
342 /* Configure i8259 level/edge settings */
343 outb(0x62, 0x4d0);
344 outb(0xde, 0x4d1);
345
346#ifdef CONFIG_CPC710_DATA_GATHERING
347 {
348 unsigned int tmp;
349 tmp = __raw_readl(ABCNTL);
350 /* Enable data gathering on both PCI interfaces */
351 __raw_writel(tmp | 0x05000000, ABCNTL);
352 }
353#endif
354
355 ppc_md.pcibios_fixup = k2_pcibios_fixup;
356 ppc_md.pcibios_fixup_resources = k2_pcibios_fixup_resources;
357 ppc_md.pci_swizzle = common_swizzle;
358 ppc_md.pci_map_irq = k2_map_irq;
359}
360
361static int k2_get_bus_speed(void)
362{
363 int bus_speed;
364 unsigned char board_id;
365
366 board_id = *(unsigned char *)K2_BOARD_ID_REG;
367
368 switch (K2_BUS_SPD(board_id)) {
369
370 case 0:
371 default:
372 bus_speed = 100000000;
373 break;
374
375 case 1:
376 bus_speed = 83333333;
377 break;
378
379 case 2:
380 bus_speed = 75000000;
381 break;
382
383 case 3:
384 bus_speed = 66666666;
385 break;
386 }
387 return bus_speed;
388}
389
390static int k2_get_cpu_speed(void)
391{
392 unsigned long hid1;
393 int cpu_speed;
394
395 hid1 = mfspr(SPRN_HID1) >> 28;
396
397 if ((mfspr(SPRN_PVR) >> 16) == 8)
398 hid1 = cpu_7xx[hid1];
399 else
400 hid1 = cpu_6xx[hid1];
401
402 cpu_speed = k2_get_bus_speed() * hid1 / 2;
403 return cpu_speed;
404}
405
406static void __init k2_calibrate_decr(void)
407{
408 int freq, divisor = 4;
409
410 /* determine processor bus speed */
411 freq = k2_get_bus_speed();
412 tb_ticks_per_jiffy = freq / HZ / divisor;
413 tb_to_us = mulhwu_scale_factor(freq / divisor, 1000000);
414}
415
416static int k2_show_cpuinfo(struct seq_file *m)
417{
418 unsigned char k2_geo_bits, k2_system_slot;
419
420 seq_printf(m, "vendor\t\t: SBS\n");
421 seq_printf(m, "machine\t\t: K2\n");
422 seq_printf(m, "cpu speed\t: %dMhz\n", k2_get_cpu_speed() / 1000000);
423 seq_printf(m, "bus speed\t: %dMhz\n", k2_get_bus_speed() / 1000000);
424 seq_printf(m, "memory type\t: SDRAM\n");
425
426 k2_geo_bits = readb(K2_MSIZ_GEO_REG) & K2_GEO_ADR_MASK;
427 k2_system_slot = !(readb(K2_MISC_REG) & K2_SYS_SLOT_MASK);
428 seq_printf(m, "backplane\t: %s slot board",
429 k2_system_slot ? "System" : "Non system");
430 seq_printf(m, "with geographical address %x\n", k2_geo_bits);
431
432 return 0;
433}
434
435TODC_ALLOC();
436
437static void __init k2_setup_arch(void)
438{
439 unsigned int cpu;
440
441 /* Setup TODC access */
442 TODC_INIT(TODC_TYPE_MK48T37, 0, 0,
443 ioremap(K2_RTC_BASE_ADDRESS, K2_RTC_SIZE), 8);
444
445 /* init to some ~sane value until calibrate_delay() runs */
446 loops_per_jiffy = 50000000 / HZ;
447
448 /* make FLASH transactions higher priority than PCI to avoid deadlock */
449 __raw_writel(__raw_readl(SIOC1) | 0x80000000, SIOC1);
450
451 /* Set hardware to access FLASH page 2 */
452 __raw_writel(1 << 29, GPOUT);
453
454 /* Setup PCI host bridges */
455 k2_setup_hoses();
456
457#ifdef CONFIG_BLK_DEV_INITRD
458 if (initrd_start)
459 ROOT_DEV = Root_RAM0;
460 else
461#endif
462#ifdef CONFIG_ROOT_NFS
463 ROOT_DEV = Root_NFS;
464#else
465 ROOT_DEV = Root_HDC1;
466#endif
467
468 /* Identify the system */
469 printk(KERN_INFO "System Identification: SBS K2 - PowerPC 750 @ "
470 "%d Mhz\n", k2_get_cpu_speed() / 1000000);
471 printk(KERN_INFO "Port by MontaVista Software, Inc. "
472 "(source@mvista.com)\n");
473
474 /* Identify the CPU manufacturer */
475 cpu = PVR_REV(mfspr(SPRN_PVR));
476 printk(KERN_INFO "CPU manufacturer: %s [rev=%04x]\n",
477 (cpu & (1 << 15)) ? "IBM" : "Motorola", cpu);
478}
479
480static void k2_restart(char *cmd)
481{
482 local_irq_disable();
483
484 /* Flip FLASH back to page 1 to access firmware image */
485 __raw_writel(0, GPOUT);
486
487 /* SRR0 has system reset vector, SRR1 has default MSR value */
488 /* rfi restores MSR from SRR1 and sets the PC to the SRR0 value */
489 mtspr(SPRN_SRR0, 0xfff00100);
490 mtspr(SPRN_SRR1, 0);
491 __asm__ __volatile__("rfi\n\t");
492
493 /* not reached */
494 for (;;) ;
495}
496
497static void k2_power_off(void)
498{
499 for (;;) ;
500}
501
502static void k2_halt(void)
503{
504 k2_restart(NULL);
505}
506
507/*
508 * Set BAT 3 to map PCI32 I/O space.
509 */
510static __inline__ void k2_set_bat(void)
511{
512 /* wait for all outstanding memory accesses to complete */
513 mb();
514
515 /* setup DBATs */
516 mtspr(SPRN_DBAT2U, 0x80001ffe);
517 mtspr(SPRN_DBAT2L, 0x8000002a);
518 mtspr(SPRN_DBAT3U, 0xf0001ffe);
519 mtspr(SPRN_DBAT3L, 0xf000002a);
520
521 /* wait for updates */
522 mb();
523}
524
525static unsigned long __init k2_find_end_of_memory(void)
526{
527 unsigned long total;
528 unsigned char msize = 7; /* Default to 128MB */
529
530 msize = K2_MEM_SIZE(readb(K2_MSIZ_GEO_REG));
531
532 switch (msize) {
533 case 2:
534 /*
535 * This will break without a lowered
536 * KERNELBASE or CONFIG_HIGHMEM on.
537 * It seems non 1GB builds exist yet,
538 * though.
539 */
540 total = K2_MEM_SIZE_1GB;
541 break;
542 case 3:
543 case 4:
544 total = K2_MEM_SIZE_512MB;
545 break;
546 case 5:
547 case 6:
548 total = K2_MEM_SIZE_256MB;
549 break;
550 case 7:
551 total = K2_MEM_SIZE_128MB;
552 break;
553 default:
554 printk
555 ("K2: Invalid memory size detected, defaulting to 128MB\n");
556 total = K2_MEM_SIZE_128MB;
557 break;
558 }
559 return total;
560}
561
562static void __init k2_map_io(void)
563{
564 io_block_mapping(K2_PCI32_IO_BASE,
565 K2_PCI32_IO_BASE, 0x00200000, _PAGE_IO);
566 io_block_mapping(0xff000000, 0xff000000, 0x01000000, _PAGE_IO);
567}
568
569static void __init k2_init_irq(void)
570{
571 int i;
572
573 for (i = 0; i < 16; i++)
574 irq_desc[i].handler = &i8259_pic;
575
576 i8259_init(0);
577}
578
579void __init platform_init(unsigned long r3, unsigned long r4,
580 unsigned long r5, unsigned long r6, unsigned long r7)
581{
582 parse_bootinfo((struct bi_record *)(r3 + KERNELBASE));
583
584 k2_set_bat();
585
586 isa_io_base = K2_ISA_IO_BASE;
587 isa_mem_base = K2_ISA_MEM_BASE;
588 pci_dram_offset = K2_PCI32_SYS_MEM_BASE;
589
590 ppc_md.setup_arch = k2_setup_arch;
591 ppc_md.show_cpuinfo = k2_show_cpuinfo;
592 ppc_md.init_IRQ = k2_init_irq;
593 ppc_md.get_irq = i8259_irq;
594
595 ppc_md.find_end_of_memory = k2_find_end_of_memory;
596 ppc_md.setup_io_mappings = k2_map_io;
597
598 ppc_md.restart = k2_restart;
599 ppc_md.power_off = k2_power_off;
600 ppc_md.halt = k2_halt;
601
602 ppc_md.time_init = todc_time_init;
603 ppc_md.set_rtc_time = todc_set_rtc_time;
604 ppc_md.get_rtc_time = todc_get_rtc_time;
605 ppc_md.calibrate_decr = k2_calibrate_decr;
606
607 ppc_md.nvram_read_val = todc_direct_read_val;
608 ppc_md.nvram_write_val = todc_direct_write_val;
609
610#ifdef CONFIG_SERIAL_TEXT_DEBUG
611 ppc_md.progress = gen550_progress;
612#endif
613}
diff --git a/arch/ppc/platforms/k2.h b/arch/ppc/platforms/k2.h
deleted file mode 100644
index 78326aba1988..000000000000
--- a/arch/ppc/platforms/k2.h
+++ /dev/null
@@ -1,82 +0,0 @@
1/*
2 * arch/ppc/platforms/k2.h
3 *
4 * Definitions for SBS K2 board support
5 *
6 * Author: Matt Porter <mporter@mvista.com>
7 *
8 * 2001 (c) MontaVista, Software, Inc. This file is licensed under
9 * the terms of the GNU General Public License version 2. This program
10 * is licensed "as is" without any warranty of any kind, whether express
11 * or implied.
12 */
13
14#ifndef __PPC_PLATFORMS_K2_H
15#define __PPC_PLATFORMS_K2_H
16
17/*
18 * SBS K2 definitions
19 */
20
21#define K2_PCI64_BAR 0xff400000
22#define K2_PCI32_BAR 0xff500000
23
24#define K2_PCI64_CONFIG_ADDR (K2_PCI64_BAR + 0x000f8000)
25#define K2_PCI64_CONFIG_DATA (K2_PCI64_BAR + 0x000f8010)
26
27#define K2_PCI32_CONFIG_ADDR (K2_PCI32_BAR + 0x000f8000)
28#define K2_PCI32_CONFIG_DATA (K2_PCI32_BAR + 0x000f8010)
29
30#define K2_PCI64_MEM_BASE 0xd0000000
31#define K2_PCI64_IO_BASE 0x80100000
32
33#define K2_PCI32_MEM_BASE 0xc0000000
34#define K2_PCI32_IO_BASE 0x80000000
35
36#define K2_PCI32_SYS_MEM_BASE 0x80000000
37#define K2_PCI64_SYS_MEM_BASE K2_PCI32_SYS_MEM_BASE
38
39#define K2_PCI32_LOWER_MEM 0x00000000
40#define K2_PCI32_UPPER_MEM 0x0fffffff
41#define K2_PCI32_LOWER_IO 0x00000000
42#define K2_PCI32_UPPER_IO 0x000fffff
43
44#define K2_PCI64_LOWER_MEM 0x10000000
45#define K2_PCI64_UPPER_MEM 0x1fffffff
46#define K2_PCI64_LOWER_IO 0x00100000
47#define K2_PCI64_UPPER_IO 0x001fffff
48
49#define K2_ISA_IO_BASE K2_PCI32_IO_BASE
50#define K2_ISA_MEM_BASE K2_PCI32_MEM_BASE
51
52#define K2_BOARD_ID_REG (K2_ISA_IO_BASE + 0x800)
53#define K2_MISC_REG (K2_ISA_IO_BASE + 0x804)
54#define K2_MSIZ_GEO_REG (K2_ISA_IO_BASE + 0x808)
55#define K2_HOT_SWAP_REG (K2_ISA_IO_BASE + 0x80c)
56#define K2_PLD2_REG (K2_ISA_IO_BASE + 0x80e)
57#define K2_PLD3_REG (K2_ISA_IO_BASE + 0x80f)
58
59#define K2_BUS_SPD(board_id) (board_id >> 2) & 3
60
61#define K2_RTC_BASE_OFFSET 0x90000
62#define K2_RTC_BASE_ADDRESS (K2_PCI32_MEM_BASE + K2_RTC_BASE_OFFSET)
63#define K2_RTC_SIZE 0x8000
64
65#define K2_MEM_SIZE_MASK 0xe0
66#define K2_MEM_SIZE(size_reg) (size_reg & K2_MEM_SIZE_MASK) >> 5
67#define K2_MEM_SIZE_1GB 0x40000000
68#define K2_MEM_SIZE_512MB 0x20000000
69#define K2_MEM_SIZE_256MB 0x10000000
70#define K2_MEM_SIZE_128MB 0x08000000
71
72#define K2_L2CACHE_MASK 0x03 /* Mask for 2 L2 Cache bits */
73#define K2_L2CACHE_512KB 0x00 /* 512KB */
74#define K2_L2CACHE_256KB 0x01 /* 256KB */
75#define K2_L2CACHE_1MB 0x02 /* 1MB */
76#define K2_L2CACHE_NONE 0x03 /* None */
77
78#define K2_GEO_ADR_MASK 0x1f
79
80#define K2_SYS_SLOT_MASK 0x08
81
82#endif /* __PPC_PLATFORMS_K2_H */
diff --git a/arch/ppc/platforms/katana.c b/arch/ppc/platforms/katana.c
index 169dbf6534b9..2b53afae0e9c 100644
--- a/arch/ppc/platforms/katana.c
+++ b/arch/ppc/platforms/katana.c
@@ -33,6 +33,7 @@
33#include <linux/bootimg.h> 33#include <linux/bootimg.h>
34#endif 34#endif
35#include <asm/io.h> 35#include <asm/io.h>
36#include <asm/unistd.h>
36#include <asm/page.h> 37#include <asm/page.h>
37#include <asm/time.h> 38#include <asm/time.h>
38#include <asm/smp.h> 39#include <asm/smp.h>
@@ -42,15 +43,14 @@
42#include <asm/mv64x60.h> 43#include <asm/mv64x60.h>
43#include <platforms/katana.h> 44#include <platforms/katana.h>
44 45
45static struct mv64x60_handle bh; 46static struct mv64x60_handle bh;
46static katana_id_t katana_id; 47static katana_id_t katana_id;
47static void __iomem *cpld_base; 48static void __iomem *cpld_base;
48static void __iomem *sram_base; 49static void __iomem *sram_base;
49 50static u32 katana_flash_size_0;
50static u32 katana_flash_size_0; 51static u32 katana_flash_size_1;
51static u32 katana_flash_size_1; 52static u32 katana_bus_frequency;
52 53static struct pci_controller katana_hose_a;
53static u32 katana_bus_frequency;
54 54
55unsigned char __res[sizeof(bd_t)]; 55unsigned char __res[sizeof(bd_t)];
56 56
@@ -71,8 +71,12 @@ katana_irq_lookup_750i(unsigned char idsel, unsigned char pin)
71 KATANA_PCI_INTA_IRQ_750i, KATANA_PCI_INTB_IRQ_750i }, 71 KATANA_PCI_INTA_IRQ_750i, KATANA_PCI_INTB_IRQ_750i },
72 /* IDSEL 6 (T8110) */ 72 /* IDSEL 6 (T8110) */
73 {KATANA_PCI_INTD_IRQ_750i, 0, 0, 0 }, 73 {KATANA_PCI_INTD_IRQ_750i, 0, 0, 0 },
74 /* IDSEL 7 (unused) */
75 {0, 0, 0, 0 },
76 /* IDSEL 8 (Intel 82544) (752i only but doesn't harm 750i) */
77 {KATANA_PCI_INTD_IRQ_750i, 0, 0, 0 },
74 }; 78 };
75 const long min_idsel = 4, max_idsel = 6, irqs_per_slot = 4; 79 const long min_idsel = 4, max_idsel = 8, irqs_per_slot = 4;
76 80
77 return PCI_IRQ_TABLE_LOOKUP; 81 return PCI_IRQ_TABLE_LOOKUP;
78} 82}
@@ -148,7 +152,7 @@ katana_get_proc_num(void)
148 save_exclude = mv64x60_pci_exclude_bridge; 152 save_exclude = mv64x60_pci_exclude_bridge;
149 mv64x60_pci_exclude_bridge = 0; 153 mv64x60_pci_exclude_bridge = 0;
150 154
151 early_read_config_word(bh.hose_a, 0, 155 early_read_config_word(bh.hose_b, 0,
152 PCI_DEVFN(0,0), PCI_DEVICE_ID, &val); 156 PCI_DEVFN(0,0), PCI_DEVICE_ID, &val);
153 157
154 mv64x60_pci_exclude_bridge = save_exclude; 158 mv64x60_pci_exclude_bridge = save_exclude;
@@ -191,7 +195,8 @@ katana_setup_bridge(void)
191 struct mv64x60_setup_info si; 195 struct mv64x60_setup_info si;
192 void __iomem *vaddr; 196 void __iomem *vaddr;
193 int i; 197 int i;
194 u16 val; 198 u32 v;
199 u16 val, type;
195 u8 save_exclude; 200 u8 save_exclude;
196 201
197 /* 202 /*
@@ -222,6 +227,20 @@ katana_setup_bridge(void)
222 PCI_DEVICE_ID, val); 227 PCI_DEVICE_ID, val);
223 } 228 }
224 229
230 /*
231 * While we're in here, set the hotswap register correctly.
232 * Turn off blue LED; mask ENUM#, clear insertion & extraction bits.
233 */
234 early_read_config_dword(&hose, 0, PCI_DEVFN(0, 0),
235 MV64360_PCICFG_CPCI_HOTSWAP, &v);
236 v &= ~(1<<19);
237 v |= ((1<<17) | (1<<22) | (1<<23));
238 early_write_config_dword(&hose, 0, PCI_DEVFN(0, 0),
239 MV64360_PCICFG_CPCI_HOTSWAP, v);
240
241 /* While we're at it, grab the bridge type for later */
242 early_read_config_word(&hose, 0, PCI_DEVFN(0, 0), PCI_DEVICE_ID, &type);
243
225 mv64x60_pci_exclude_bridge = save_exclude; 244 mv64x60_pci_exclude_bridge = save_exclude;
226 iounmap(vaddr); 245 iounmap(vaddr);
227 246
@@ -251,21 +270,23 @@ katana_setup_bridge(void)
251 si.idma_options[i] = MV64360_IDMA2MEM_SNOOP_NONE; 270 si.idma_options[i] = MV64360_IDMA2MEM_SNOOP_NONE;
252 271
253 si.pci_1.acc_cntl_options[i] = 272 si.pci_1.acc_cntl_options[i] =
254 MV64360_PCI_ACC_CNTL_SNOOP_NONE | 273 MV64360_PCI_ACC_CNTL_SNOOP_NONE |
255 MV64360_PCI_ACC_CNTL_SWAP_NONE | 274 MV64360_PCI_ACC_CNTL_SWAP_NONE |
256 MV64360_PCI_ACC_CNTL_MBURST_128_BYTES | 275 MV64360_PCI_ACC_CNTL_MBURST_128_BYTES |
257 MV64360_PCI_ACC_CNTL_RDSIZE_256_BYTES; 276 MV64360_PCI_ACC_CNTL_RDSIZE_256_BYTES;
258#else 277#else
259 si.cpu_prot_options[i] = 0; 278 si.cpu_prot_options[i] = 0;
260 si.enet_options[i] = MV64360_ENET2MEM_SNOOP_NONE; /* errata */ 279 si.enet_options[i] = MV64360_ENET2MEM_SNOOP_WB;
261 si.mpsc_options[i] = MV64360_MPSC2MEM_SNOOP_NONE; /* errata */ 280 si.mpsc_options[i] = MV64360_MPSC2MEM_SNOOP_WB;
262 si.idma_options[i] = MV64360_IDMA2MEM_SNOOP_NONE; /* errata */ 281 si.idma_options[i] = MV64360_IDMA2MEM_SNOOP_WB;
263 282
264 si.pci_1.acc_cntl_options[i] = 283 si.pci_1.acc_cntl_options[i] =
265 MV64360_PCI_ACC_CNTL_SNOOP_WB | 284 MV64360_PCI_ACC_CNTL_SNOOP_WB |
266 MV64360_PCI_ACC_CNTL_SWAP_NONE | 285 MV64360_PCI_ACC_CNTL_SWAP_NONE |
267 MV64360_PCI_ACC_CNTL_MBURST_32_BYTES | 286 MV64360_PCI_ACC_CNTL_MBURST_32_BYTES |
268 MV64360_PCI_ACC_CNTL_RDSIZE_32_BYTES; 287 ((type == PCI_DEVICE_ID_MARVELL_MV64360) ?
288 MV64360_PCI_ACC_CNTL_RDSIZE_32_BYTES :
289 MV64360_PCI_ACC_CNTL_RDSIZE_256_BYTES);
269#endif 290#endif
270 } 291 }
271 292
@@ -281,12 +302,26 @@ katana_setup_bridge(void)
281 mv64x60_set_bus(&bh, 1, 0); 302 mv64x60_set_bus(&bh, 1, 0);
282 bh.hose_b->first_busno = 0; 303 bh.hose_b->first_busno = 0;
283 bh.hose_b->last_busno = 0xff; 304 bh.hose_b->last_busno = 0xff;
305
306 /*
307 * Need to access hotswap reg which is in the pci config area of the
308 * bridge's hose 0. Note that pcibios_alloc_controller() can't be used
309 * to alloc hose_a b/c that would make hose 0 known to the generic
310 * pci code which we don't want.
311 */
312 bh.hose_a = &katana_hose_a;
313 setup_indirect_pci_nomap(bh.hose_a,
314 bh.v_base + MV64x60_PCI0_CONFIG_ADDR,
315 bh.v_base + MV64x60_PCI0_CONFIG_DATA);
284} 316}
285 317
286/* Bridge & platform setup routines */ 318/* Bridge & platform setup routines */
287void __init 319void __init
288katana_intr_setup(void) 320katana_intr_setup(void)
289{ 321{
322 if (bh.type == MV64x60_TYPE_MV64460) /* As per instns from Marvell */
323 mv64x60_clr_bits(&bh, MV64x60_CPU_MASTER_CNTL, 1 << 15);
324
290 /* MPP 8, 9, and 10 */ 325 /* MPP 8, 9, and 10 */
291 mv64x60_clr_bits(&bh, MV64x60_MPP_CNTL_1, 0xfff); 326 mv64x60_clr_bits(&bh, MV64x60_MPP_CNTL_1, 0xfff);
292 327
@@ -309,9 +344,16 @@ katana_intr_setup(void)
309 /* Config GPP intr ctlr to respond to level trigger */ 344 /* Config GPP intr ctlr to respond to level trigger */
310 mv64x60_set_bits(&bh, MV64x60_COMM_ARBITER_CNTL, (1<<10)); 345 mv64x60_set_bits(&bh, MV64x60_COMM_ARBITER_CNTL, (1<<10));
311 346
312 /* Erranum FEr PCI-#8 */ 347 if (bh.type == MV64x60_TYPE_MV64360) {
313 mv64x60_clr_bits(&bh, MV64x60_PCI0_CMD, (1<<5) | (1<<9)); 348 /* Erratum FEr PCI-#9 */
314 mv64x60_clr_bits(&bh, MV64x60_PCI1_CMD, (1<<5) | (1<<9)); 349 mv64x60_clr_bits(&bh, MV64x60_PCI1_CMD,
350 (1<<4) | (1<<5) | (1<<6) | (1<<7));
351 mv64x60_set_bits(&bh, MV64x60_PCI1_CMD, (1<<8) | (1<<9));
352 } else {
353 mv64x60_clr_bits(&bh, MV64x60_PCI1_CMD, (1<<6) | (1<<7));
354 mv64x60_set_bits(&bh, MV64x60_PCI1_CMD,
355 (1<<4) | (1<<5) | (1<<8) | (1<<9));
356 }
315 357
316 /* 358 /*
317 * Dismiss and then enable interrupt on GPP interrupt cause 359 * Dismiss and then enable interrupt on GPP interrupt cause
@@ -473,17 +515,46 @@ katana_setup_arch(void)
473 ppc_md.progress("katana_setup_arch: exit", 0); 515 ppc_md.progress("katana_setup_arch: exit", 0);
474} 516}
475 517
518void
519katana_fixup_resources(struct pci_dev *dev)
520{
521 u16 v16;
522
523 pci_write_config_byte(dev, PCI_CACHE_LINE_SIZE, L1_CACHE_LINE_SIZE>>2);
524
525 pci_read_config_word(dev, PCI_COMMAND, &v16);
526 v16 |= PCI_COMMAND_INVALIDATE | PCI_COMMAND_FAST_BACK;
527 pci_write_config_word(dev, PCI_COMMAND, v16);
528}
529
530static const unsigned int cpu_750xx[32] = { /* 750FX & 750GX */
531 0, 0, 2, 2, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,/* 0-15*/
532 16, 17, 18, 19, 20, 22, 24, 26, 28, 30, 32, 34, 36, 38, 40, 0 /*16-31*/
533};
534
535static int
536katana_get_cpu_freq(void)
537{
538 unsigned long pll_cfg;
539
540 pll_cfg = (mfspr(SPRN_HID1) & 0xf8000000) >> 27;
541 return katana_bus_frequency * cpu_750xx[pll_cfg]/2;
542}
543
476/* Platform device data fixup routines. */ 544/* Platform device data fixup routines. */
477#if defined(CONFIG_SERIAL_MPSC) 545#if defined(CONFIG_SERIAL_MPSC)
478static void __init 546static void __init
479katana_fixup_mpsc_pdata(struct platform_device *pdev) 547katana_fixup_mpsc_pdata(struct platform_device *pdev)
480{ 548{
481 struct mpsc_pdata *pdata; 549 struct mpsc_pdata *pdata = (struct mpsc_pdata *)pdev->dev.platform_data;
550 bd_t *bdp = (bd_t *)__res;
482 551
483 pdata = (struct mpsc_pdata *)pdev->dev.platform_data; 552 if (bdp->bi_baudrate)
553 pdata->default_baud = bdp->bi_baudrate;
554 else
555 pdata->default_baud = KATANA_DEFAULT_BAUD;
484 556
485 pdata->max_idle = 40; 557 pdata->max_idle = 40;
486 pdata->default_baud = KATANA_DEFAULT_BAUD;
487 pdata->brg_clk_src = KATANA_MPSC_CLK_SRC; 558 pdata->brg_clk_src = KATANA_MPSC_CLK_SRC;
488 /* 559 /*
489 * TCLK (not SysCLk) is routed to BRG, then to the MPSC. On most parts, 560 * TCLK (not SysCLk) is routed to BRG, then to the MPSC. On most parts,
@@ -513,6 +584,18 @@ katana_fixup_eth_pdata(struct platform_device *pdev)
513} 584}
514#endif 585#endif
515 586
587#if defined(CONFIG_SYSFS)
588static void __init
589katana_fixup_mv64xxx_pdata(struct platform_device *pdev)
590{
591 struct mv64xxx_pdata *pdata = (struct mv64xxx_pdata *)
592 pdev->dev.platform_data;
593
594 /* Katana supports the mv64xxx hotswap register */
595 pdata->hs_reg_valid = 1;
596}
597#endif
598
516static int __init 599static int __init
517katana_platform_notify(struct device *dev) 600katana_platform_notify(struct device *dev)
518{ 601{
@@ -529,6 +612,9 @@ katana_platform_notify(struct device *dev)
529 { MV643XX_ETH_NAME ".1", katana_fixup_eth_pdata }, 612 { MV643XX_ETH_NAME ".1", katana_fixup_eth_pdata },
530 { MV643XX_ETH_NAME ".2", katana_fixup_eth_pdata }, 613 { MV643XX_ETH_NAME ".2", katana_fixup_eth_pdata },
531#endif 614#endif
615#if defined(CONFIG_SYSFS)
616 { MV64XXX_DEV_NAME ".0", katana_fixup_mv64xxx_pdata },
617#endif
532 }; 618 };
533 struct platform_device *pdev; 619 struct platform_device *pdev;
534 int i; 620 int i;
@@ -536,8 +622,7 @@ katana_platform_notify(struct device *dev)
536 if (dev && dev->bus_id) 622 if (dev && dev->bus_id)
537 for (i=0; i<ARRAY_SIZE(dev_map); i++) 623 for (i=0; i<ARRAY_SIZE(dev_map); i++)
538 if (!strncmp(dev->bus_id, dev_map[i].bus_id, 624 if (!strncmp(dev->bus_id, dev_map[i].bus_id,
539 BUS_ID_SIZE)) { 625 BUS_ID_SIZE)) {
540
541 pdev = container_of(dev, 626 pdev = container_of(dev,
542 struct platform_device, dev); 627 struct platform_device, dev);
543 dev_map[i].rtn(pdev); 628 dev_map[i].rtn(pdev);
@@ -578,8 +663,7 @@ katana_setup_mtd(void)
578 ptbl_entries = (size >= (64*MB)) ? 6 : 4; 663 ptbl_entries = (size >= (64*MB)) ? 6 : 4;
579 664
580 if ((ptbl = kmalloc(ptbl_entries * sizeof(struct mtd_partition), 665 if ((ptbl = kmalloc(ptbl_entries * sizeof(struct mtd_partition),
581 GFP_KERNEL)) == NULL) { 666 GFP_KERNEL)) == NULL) {
582
583 printk(KERN_WARNING "Can't alloc MTD partition table\n"); 667 printk(KERN_WARNING "Can't alloc MTD partition table\n");
584 return -ENOMEM; 668 return -ENOMEM;
585 } 669 }
@@ -611,7 +695,6 @@ katana_setup_mtd(void)
611 physmap_set_partitions(ptbl, ptbl_entries); 695 physmap_set_partitions(ptbl, ptbl_entries);
612 return 0; 696 return 0;
613} 697}
614
615arch_initcall(katana_setup_mtd); 698arch_initcall(katana_setup_mtd);
616#endif 699#endif
617 700
@@ -632,7 +715,22 @@ katana_halt(void)
632{ 715{
633 u8 v; 716 u8 v;
634 717
635 if (katana_id == KATANA_ID_752I) { 718 /* Turn on blue LED to indicate its okay to remove */
719 if (katana_id == KATANA_ID_750I) {
720 u32 v;
721 u8 save_exclude;
722
723 /* Set LOO bit in cPCI HotSwap reg of hose 0 to turn on LED. */
724 save_exclude = mv64x60_pci_exclude_bridge;
725 mv64x60_pci_exclude_bridge = 0;
726 early_read_config_dword(bh.hose_a, 0, PCI_DEVFN(0, 0),
727 MV64360_PCICFG_CPCI_HOTSWAP, &v);
728 v &= 0xff;
729 v |= (1 << 19);
730 early_write_config_dword(bh.hose_a, 0, PCI_DEVFN(0, 0),
731 MV64360_PCICFG_CPCI_HOTSWAP, v);
732 mv64x60_pci_exclude_bridge = save_exclude;
733 } else if (katana_id == KATANA_ID_752I) {
636 v = in_8(cpld_base + HSL_PLD_BASE + HSL_PLD_HOT_SWAP_OFF); 734 v = in_8(cpld_base + HSL_PLD_BASE + HSL_PLD_HOT_SWAP_OFF);
637 v |= HSL_PLD_HOT_SWAP_LED_BIT; 735 v |= HSL_PLD_HOT_SWAP_LED_BIT;
638 out_8(cpld_base + HSL_PLD_BASE + HSL_PLD_HOT_SWAP_OFF, v); 736 out_8(cpld_base + HSL_PLD_BASE + HSL_PLD_HOT_SWAP_OFF, v);
@@ -652,37 +750,65 @@ katana_power_off(void)
652static int 750static int
653katana_show_cpuinfo(struct seq_file *m) 751katana_show_cpuinfo(struct seq_file *m)
654{ 752{
753 char *s;
754
755 seq_printf(m, "cpu freq\t: %dMHz\n",
756 (katana_get_cpu_freq() + 500000) / 1000000);
757 seq_printf(m, "bus freq\t: %ldMHz\n",
758 ((long)katana_bus_frequency + 500000) / 1000000);
655 seq_printf(m, "vendor\t\t: Artesyn Communication Products, LLC\n"); 759 seq_printf(m, "vendor\t\t: Artesyn Communication Products, LLC\n");
656 760
657 seq_printf(m, "board\t\t: "); 761 seq_printf(m, "board\t\t: ");
658
659 switch (katana_id) { 762 switch (katana_id) {
660 case KATANA_ID_3750: 763 case KATANA_ID_3750:
661 seq_printf(m, "Katana 3750\n"); 764 seq_printf(m, "Katana 3750");
662 break; 765 break;
663 766
664 case KATANA_ID_750I: 767 case KATANA_ID_750I:
665 seq_printf(m, "Katana 750i\n"); 768 seq_printf(m, "Katana 750i");
666 break; 769 break;
667 770
668 case KATANA_ID_752I: 771 case KATANA_ID_752I:
669 seq_printf(m, "Katana 752i\n"); 772 seq_printf(m, "Katana 752i");
670 break; 773 break;
671 774
672 default: 775 default:
673 seq_printf(m, "Unknown\n"); 776 seq_printf(m, "Unknown");
674 break; 777 break;
675 } 778 }
676 779 seq_printf(m, " (product id: 0x%x)\n",
677 seq_printf(m, "product ID\t: 0x%x\n",
678 in_8(cpld_base + KATANA_CPLD_PRODUCT_ID)); 780 in_8(cpld_base + KATANA_CPLD_PRODUCT_ID));
781
782 seq_printf(m, "pci mode\t: %sMonarch\n",
783 katana_is_monarch()? "" : "Non-");
679 seq_printf(m, "hardware rev\t: 0x%x\n", 784 seq_printf(m, "hardware rev\t: 0x%x\n",
680 in_8(cpld_base+KATANA_CPLD_HARDWARE_VER)); 785 in_8(cpld_base+KATANA_CPLD_HARDWARE_VER));
681 seq_printf(m, "PLD rev\t\t: 0x%x\n", 786 seq_printf(m, "pld rev\t\t: 0x%x\n",
682 in_8(cpld_base + KATANA_CPLD_PLD_VER)); 787 in_8(cpld_base + KATANA_CPLD_PLD_VER));
683 seq_printf(m, "PLB freq\t: %ldMhz\n", 788
684 (long)katana_bus_frequency / 1000000); 789 switch(bh.type) {
685 seq_printf(m, "PCI\t\t: %sMonarch\n", katana_is_monarch()? "" : "Non-"); 790 case MV64x60_TYPE_GT64260A:
791 s = "gt64260a";
792 break;
793 case MV64x60_TYPE_GT64260B:
794 s = "gt64260b";
795 break;
796 case MV64x60_TYPE_MV64360:
797 s = "mv64360";
798 break;
799 case MV64x60_TYPE_MV64460:
800 s = "mv64460";
801 break;
802 default:
803 s = "Unknown";
804 }
805 seq_printf(m, "bridge type\t: %s\n", s);
806 seq_printf(m, "bridge rev\t: 0x%x\n", bh.rev);
807#if defined(CONFIG_NOT_COHERENT_CACHE)
808 seq_printf(m, "coherency\t: %s\n", "off");
809#else
810 seq_printf(m, "coherency\t: %s\n", "on");
811#endif
686 812
687 return 0; 813 return 0;
688} 814}
@@ -701,11 +827,20 @@ katana_calibrate_decr(void)
701 tb_to_us = mulhwu_scale_factor(freq, 1000000); 827 tb_to_us = mulhwu_scale_factor(freq, 1000000);
702} 828}
703 829
830/*
831 * The katana supports both uImage and zImage. If uImage, get the mem size
832 * from the bd info. If zImage, the bootwrapper adds a BI_MEMSIZE entry in
833 * the bi_rec data which is sucked out and put into boot_mem_size by
834 * parse_bootinfo(). MMU_init() will then use the boot_mem_size for the mem
835 * size and not call this routine. The only way this will fail is when a uImage
836 * is used but the fw doesn't pass in a valid bi_memsize. This should never
837 * happen, though.
838 */
704unsigned long __init 839unsigned long __init
705katana_find_end_of_memory(void) 840katana_find_end_of_memory(void)
706{ 841{
707 return mv64x60_get_mem_size(CONFIG_MV64X60_NEW_BASE, 842 bd_t *bdp = (bd_t *)__res;
708 MV64x60_TYPE_MV64360); 843 return bdp->bi_memsize;
709} 844}
710 845
711#if defined(CONFIG_I2C_MV64XXX) && defined(CONFIG_SENSORS_M41T00) 846#if defined(CONFIG_I2C_MV64XXX) && defined(CONFIG_SENSORS_M41T00)
@@ -729,15 +864,6 @@ katana_rtc_hookup(void)
729late_initcall(katana_rtc_hookup); 864late_initcall(katana_rtc_hookup);
730#endif 865#endif
731 866
732static inline void
733katana_set_bat(void)
734{
735 mb();
736 mtspr(SPRN_DBAT2U, 0xf0001ffe);
737 mtspr(SPRN_DBAT2L, 0xf000002a);
738 mb();
739}
740
741#if defined(CONFIG_SERIAL_TEXT_DEBUG) && defined(CONFIG_SERIAL_MPSC_CONSOLE) 867#if defined(CONFIG_SERIAL_TEXT_DEBUG) && defined(CONFIG_SERIAL_MPSC_CONSOLE)
742static void __init 868static void __init
743katana_map_io(void) 869katana_map_io(void)
@@ -763,15 +889,24 @@ platform_init(unsigned long r3, unsigned long r4, unsigned long r5,
763 */ 889 */
764 if (r3 && r6) { 890 if (r3 && r6) {
765 /* copy board info structure */ 891 /* copy board info structure */
766 memcpy( (void *)__res,(void *)(r3+KERNELBASE), sizeof(bd_t) ); 892 memcpy((void *)__res, (void *)(r3+KERNELBASE), sizeof(bd_t));
767 /* copy command line */ 893 /* copy command line */
768 *(char *)(r7+KERNELBASE) = 0; 894 *(char *)(r7+KERNELBASE) = 0;
769 strcpy(cmd_line, (char *)(r6+KERNELBASE)); 895 strcpy(cmd_line, (char *)(r6+KERNELBASE));
770 } 896 }
771 897
898#ifdef CONFIG_BLK_DEV_INITRD
899 /* take care of initrd if we have one */
900 if (r4) {
901 initrd_start = r4 + KERNELBASE;
902 initrd_end = r5 + KERNELBASE;
903 }
904#endif /* CONFIG_BLK_DEV_INITRD */
905
772 isa_mem_base = 0; 906 isa_mem_base = 0;
773 907
774 ppc_md.setup_arch = katana_setup_arch; 908 ppc_md.setup_arch = katana_setup_arch;
909 ppc_md.pcibios_fixup_resources = katana_fixup_resources;
775 ppc_md.show_cpuinfo = katana_show_cpuinfo; 910 ppc_md.show_cpuinfo = katana_show_cpuinfo;
776 ppc_md.init_IRQ = mv64360_init_irq; 911 ppc_md.init_IRQ = mv64360_init_irq;
777 ppc_md.get_irq = mv64360_get_irq; 912 ppc_md.get_irq = mv64360_get_irq;
@@ -790,6 +925,4 @@ platform_init(unsigned long r3, unsigned long r4, unsigned long r5,
790#if defined(CONFIG_SERIAL_MPSC) || defined(CONFIG_MV643XX_ETH) 925#if defined(CONFIG_SERIAL_MPSC) || defined(CONFIG_MV643XX_ETH)
791 platform_notify = katana_platform_notify; 926 platform_notify = katana_platform_notify;
792#endif 927#endif
793
794 katana_set_bat(); /* Need for katana_find_end_of_memory and progress */
795} 928}
diff --git a/arch/ppc/platforms/katana.h b/arch/ppc/platforms/katana.h
index b82ed81950f5..597257eff2ec 100644
--- a/arch/ppc/platforms/katana.h
+++ b/arch/ppc/platforms/katana.h
@@ -56,14 +56,14 @@
56#define KATANA_PCI1_IO_SIZE 0x04000000 /* 64 MB */ 56#define KATANA_PCI1_IO_SIZE 0x04000000 /* 64 MB */
57 57
58/* Board-specific IRQ info */ 58/* Board-specific IRQ info */
59#define KATANA_PCI_INTA_IRQ_3750 64+8 59#define KATANA_PCI_INTA_IRQ_3750 (64+8)
60#define KATANA_PCI_INTB_IRQ_3750 64+9 60#define KATANA_PCI_INTB_IRQ_3750 (64+9)
61#define KATANA_PCI_INTC_IRQ_3750 64+10 61#define KATANA_PCI_INTC_IRQ_3750 (64+10)
62 62
63#define KATANA_PCI_INTA_IRQ_750i 64+8 63#define KATANA_PCI_INTA_IRQ_750i (64+8)
64#define KATANA_PCI_INTB_IRQ_750i 64+9 64#define KATANA_PCI_INTB_IRQ_750i (64+9)
65#define KATANA_PCI_INTC_IRQ_750i 64+10 65#define KATANA_PCI_INTC_IRQ_750i (64+10)
66#define KATANA_PCI_INTD_IRQ_750i 64+14 66#define KATANA_PCI_INTD_IRQ_750i (64+14)
67 67
68#define KATANA_CPLD_RST_EVENT 0x00000000 68#define KATANA_CPLD_RST_EVENT 0x00000000
69#define KATANA_CPLD_RST_CMD 0x00001000 69#define KATANA_CPLD_RST_CMD 0x00001000
diff --git a/arch/ppc/platforms/mcpn765.c b/arch/ppc/platforms/mcpn765.c
deleted file mode 100644
index e88d294ea593..000000000000
--- a/arch/ppc/platforms/mcpn765.c
+++ /dev/null
@@ -1,527 +0,0 @@
1/*
2 * arch/ppc/platforms/mcpn765.c
3 *
4 * Board setup routines for the Motorola MCG MCPN765 cPCI Board.
5 *
6 * Author: Mark A. Greer
7 * mgreer@mvista.com
8 *
9 * Modified by Randy Vinson (rvinson@mvista.com)
10 *
11 * 2001-2002 (c) MontaVista, Software, Inc. This file is licensed under
12 * the terms of the GNU General Public License version 2. This program
13 * is licensed "as is" without any warranty of any kind, whether express
14 * or implied.
15 */
16
17/*
18 * This file adds support for the Motorola MCG MCPN765.
19 */
20#include <linux/config.h>
21#include <linux/stddef.h>
22#include <linux/kernel.h>
23#include <linux/init.h>
24#include <linux/errno.h>
25#include <linux/reboot.h>
26#include <linux/pci.h>
27#include <linux/kdev_t.h>
28#include <linux/major.h>
29#include <linux/initrd.h>
30#include <linux/console.h>
31#include <linux/delay.h>
32#include <linux/irq.h>
33#include <linux/seq_file.h>
34#include <linux/root_dev.h>
35#include <linux/serial.h>
36#include <linux/tty.h> /* for linux/serial_core.h */
37#include <linux/serial_core.h>
38#include <linux/slab.h>
39
40#include <asm/system.h>
41#include <asm/pgtable.h>
42#include <asm/page.h>
43#include <asm/time.h>
44#include <asm/dma.h>
45#include <asm/byteorder.h>
46#include <asm/io.h>
47#include <asm/machdep.h>
48#include <asm/prom.h>
49#include <asm/smp.h>
50#include <asm/open_pic.h>
51#include <asm/i8259.h>
52#include <asm/todc.h>
53#include <asm/pci-bridge.h>
54#include <asm/irq.h>
55#include <asm/uaccess.h>
56#include <asm/bootinfo.h>
57#include <asm/hawk.h>
58#include <asm/kgdb.h>
59
60#include "mcpn765.h"
61
62static u_char mcpn765_openpic_initsenses[] __initdata = {
63 (IRQ_SENSE_EDGE | IRQ_POLARITY_POSITIVE),/* 16: i8259 cascade */
64 (IRQ_SENSE_LEVEL | IRQ_POLARITY_NEGATIVE),/* 17: COM1,2,3,4 */
65 (IRQ_SENSE_LEVEL | IRQ_POLARITY_NEGATIVE),/* 18: Enet 1 (front) */
66 (IRQ_SENSE_LEVEL | IRQ_POLARITY_NEGATIVE),/* 19: HAWK WDT XXXX */
67 (IRQ_SENSE_LEVEL | IRQ_POLARITY_NEGATIVE),/* 20: 21554 bridge */
68 (IRQ_SENSE_LEVEL | IRQ_POLARITY_NEGATIVE),/* 21: cPCI INTA# */
69 (IRQ_SENSE_LEVEL | IRQ_POLARITY_NEGATIVE),/* 22: cPCI INTB# */
70 (IRQ_SENSE_LEVEL | IRQ_POLARITY_NEGATIVE),/* 23: cPCI INTC# */
71 (IRQ_SENSE_LEVEL | IRQ_POLARITY_NEGATIVE),/* 24: cPCI INTD# */
72 (IRQ_SENSE_LEVEL | IRQ_POLARITY_NEGATIVE),/* 25: PMC1 INTA#,PMC2 INTB#*/
73 (IRQ_SENSE_LEVEL | IRQ_POLARITY_NEGATIVE),/* 26: PMC1 INTB#,PMC2 INTC#*/
74 (IRQ_SENSE_LEVEL | IRQ_POLARITY_NEGATIVE),/* 27: PMC1 INTC#,PMC2 INTD#*/
75 (IRQ_SENSE_LEVEL | IRQ_POLARITY_NEGATIVE),/* 28: PMC1 INTD#,PMC2 INTA#*/
76 (IRQ_SENSE_LEVEL | IRQ_POLARITY_NEGATIVE),/* 29: Enet 2 (J3) */
77 (IRQ_SENSE_LEVEL | IRQ_POLARITY_NEGATIVE),/* 30: Abort Switch */
78 (IRQ_SENSE_LEVEL | IRQ_POLARITY_NEGATIVE),/* 31: RTC Alarm */
79};
80
81extern void mcpn765_set_VIA_IDE_native(void);
82
83extern u_int openpic_irq(void);
84extern char cmd_line[];
85
86extern void gen550_progress(char *, unsigned short);
87extern void gen550_init(int, struct uart_port *);
88
89int use_of_interrupt_tree = 0;
90
91static void mcpn765_halt(void);
92
93TODC_ALLOC();
94
95/*
96 * Motorola MCG MCPN765 interrupt routing.
97 */
98static inline int
99mcpn765_map_irq(struct pci_dev *dev, unsigned char idsel, unsigned char pin)
100{
101 static char pci_irq_table[][4] =
102 /*
103 * PCI IDSEL/INTPIN->INTLINE
104 * A B C D
105 */
106 {
107 { 14, 0, 0, 0 }, /* IDSEL 11 - have to manually set */
108 { 0, 0, 0, 0 }, /* IDSEL 12 - unused */
109 { 0, 0, 0, 0 }, /* IDSEL 13 - unused */
110 { 18, 0, 0, 0 }, /* IDSEL 14 - Enet 0 */
111 { 0, 0, 0, 0 }, /* IDSEL 15 - unused */
112 { 25, 26, 27, 28 }, /* IDSEL 16 - PMC Slot 1 */
113 { 28, 25, 26, 27 }, /* IDSEL 17 - PMC Slot 2 */
114 { 0, 0, 0, 0 }, /* IDSEL 18 - PMC 2B Connector XXXX */
115 { 29, 0, 0, 0 }, /* IDSEL 19 - Enet 1 */
116 { 20, 0, 0, 0 }, /* IDSEL 20 - 21554 cPCI bridge */
117 };
118
119 const long min_idsel = 11, max_idsel = 20, irqs_per_slot = 4;
120 return PCI_IRQ_TABLE_LOOKUP;
121}
122
123void __init
124mcpn765_set_VIA_IDE_legacy(void)
125{
126 unsigned short vend, dev;
127
128 early_read_config_word(0, 0, PCI_DEVFN(0xb, 1), PCI_VENDOR_ID, &vend);
129 early_read_config_word(0, 0, PCI_DEVFN(0xb, 1), PCI_DEVICE_ID, &dev);
130
131 if ((vend == PCI_VENDOR_ID_VIA) &&
132 (dev == PCI_DEVICE_ID_VIA_82C586_1)) {
133
134 unsigned char temp;
135
136 /* put back original "standard" port base addresses */
137 early_write_config_dword(0, 0, PCI_DEVFN(0xb, 1),
138 PCI_BASE_ADDRESS_0, 0x1f1);
139 early_write_config_dword(0, 0, PCI_DEVFN(0xb, 1),
140 PCI_BASE_ADDRESS_1, 0x3f5);
141 early_write_config_dword(0, 0, PCI_DEVFN(0xb, 1),
142 PCI_BASE_ADDRESS_2, 0x171);
143 early_write_config_dword(0, 0, PCI_DEVFN(0xb, 1),
144 PCI_BASE_ADDRESS_3, 0x375);
145 early_write_config_dword(0, 0, PCI_DEVFN(0xb, 1),
146 PCI_BASE_ADDRESS_4, 0xcc01);
147
148 /* put into legacy mode */
149 early_read_config_byte(0, 0, PCI_DEVFN(0xb, 1), PCI_CLASS_PROG,
150 &temp);
151 temp &= ~0x05;
152 early_write_config_byte(0, 0, PCI_DEVFN(0xb, 1), PCI_CLASS_PROG,
153 temp);
154 }
155}
156
157void
158mcpn765_set_VIA_IDE_native(void)
159{
160 unsigned short vend, dev;
161
162 early_read_config_word(0, 0, PCI_DEVFN(0xb, 1), PCI_VENDOR_ID, &vend);
163 early_read_config_word(0, 0, PCI_DEVFN(0xb, 1), PCI_DEVICE_ID, &dev);
164
165 if ((vend == PCI_VENDOR_ID_VIA) &&
166 (dev == PCI_DEVICE_ID_VIA_82C586_1)) {
167
168 unsigned char temp;
169
170 /* put into native mode */
171 early_read_config_byte(0, 0, PCI_DEVFN(0xb, 1), PCI_CLASS_PROG,
172 &temp);
173 temp |= 0x05;
174 early_write_config_byte(0, 0, PCI_DEVFN(0xb, 1), PCI_CLASS_PROG,
175 temp);
176 }
177}
178
179/*
180 * Initialize the VIA 82c586b.
181 */
182static void __init
183mcpn765_setup_via_82c586b(void)
184{
185 struct pci_dev *dev;
186 u_char c;
187
188 if ((dev = pci_get_device(PCI_VENDOR_ID_VIA,
189 PCI_DEVICE_ID_VIA_82C586_0,
190 NULL)) == NULL) {
191 printk("No VIA ISA bridge found\n");
192 mcpn765_halt();
193 /* NOTREACHED */
194 }
195
196 /*
197 * If the firmware left the EISA 4d0/4d1 ports enabled, make sure
198 * IRQ 14 is set for edge.
199 */
200 pci_read_config_byte(dev, 0x47, &c);
201
202 if (c & (1<<5)) {
203 c = inb(0x4d1);
204 c &= ~(1<<6);
205 outb(c, 0x4d1);
206 }
207
208 /* Disable PNP IRQ routing since we use the Hawk's MPIC */
209 pci_write_config_dword(dev, 0x54, 0);
210 pci_write_config_byte(dev, 0x58, 0);
211
212 pci_dev_put(dev);
213 if ((dev = pci_get_device(PCI_VENDOR_ID_VIA,
214 PCI_DEVICE_ID_VIA_82C586_1,
215 NULL)) == NULL) {
216 printk("No VIA ISA bridge found\n");
217 mcpn765_halt();
218 /* NOTREACHED */
219 }
220
221 /*
222 * PPCBug doesn't set the enable bits for the IDE device.
223 * Turn them on now.
224 */
225 pci_read_config_byte(dev, 0x40, &c);
226 c |= 0x03;
227 pci_write_config_byte(dev, 0x40, c);
228 pci_dev_put(dev);
229
230 return;
231}
232
233void __init
234mcpn765_pcibios_fixup(void)
235{
236 /* Do MCPN765 board specific initialization. */
237 mcpn765_setup_via_82c586b();
238}
239
240void __init
241mcpn765_find_bridges(void)
242{
243 struct pci_controller *hose;
244
245 hose = pcibios_alloc_controller();
246
247 if (!hose)
248 return;
249
250 hose->first_busno = 0;
251 hose->last_busno = 0xff;
252 hose->pci_mem_offset = MCPN765_PCI_PHY_MEM_OFFSET;
253
254 pci_init_resource(&hose->io_resource,
255 MCPN765_PCI_IO_START,
256 MCPN765_PCI_IO_END,
257 IORESOURCE_IO,
258 "PCI host bridge");
259
260 pci_init_resource(&hose->mem_resources[0],
261 MCPN765_PCI_MEM_START,
262 MCPN765_PCI_MEM_END,
263 IORESOURCE_MEM,
264 "PCI host bridge");
265
266 hose->io_space.start = MCPN765_PCI_IO_START;
267 hose->io_space.end = MCPN765_PCI_IO_END;
268 hose->mem_space.start = MCPN765_PCI_MEM_START;
269 hose->mem_space.end = MCPN765_PCI_MEM_END - HAWK_MPIC_SIZE;
270
271 if (hawk_init(hose,
272 MCPN765_HAWK_PPC_REG_BASE,
273 MCPN765_PROC_PCI_MEM_START,
274 MCPN765_PROC_PCI_MEM_END - HAWK_MPIC_SIZE,
275 MCPN765_PROC_PCI_IO_START,
276 MCPN765_PROC_PCI_IO_END,
277 MCPN765_PCI_MEM_END - HAWK_MPIC_SIZE + 1) != 0) {
278 printk("Could not initialize HAWK bridge\n");
279 }
280
281 /* VIA IDE BAR decoders are only 16-bits wide. PCI Auto Config
282 * will reassign the bars outside of 16-bit I/O space, which will
283 * "break" things. To prevent this, we'll set the IDE chip into
284 * legacy mode and seed the bars with their legacy addresses (in 16-bit
285 * I/O space). The Auto Config code will skip the IDE contoller in
286 * legacy mode, so our bar values will stick.
287 */
288 mcpn765_set_VIA_IDE_legacy();
289
290 hose->last_busno = pciauto_bus_scan(hose, hose->first_busno);
291
292 /* Now that we've got 16-bit addresses in the bars, we can switch the
293 * IDE controller back into native mode so we can do "modern" resource
294 * and interrupt management.
295 */
296 mcpn765_set_VIA_IDE_native();
297
298 ppc_md.pcibios_fixup = mcpn765_pcibios_fixup;
299 ppc_md.pcibios_fixup_bus = NULL;
300 ppc_md.pci_swizzle = common_swizzle;
301 ppc_md.pci_map_irq = mcpn765_map_irq;
302
303 return;
304}
305static void __init
306mcpn765_setup_arch(void)
307{
308 struct pci_controller *hose;
309
310 if ( ppc_md.progress )
311 ppc_md.progress("mcpn765_setup_arch: enter", 0);
312
313 loops_per_jiffy = 50000000 / HZ;
314
315#ifdef CONFIG_BLK_DEV_INITRD
316 if (initrd_start)
317 ROOT_DEV = Root_RAM0;
318 else
319#endif
320#ifdef CONFIG_ROOT_NFS
321 ROOT_DEV = Root_NFS;
322#else
323 ROOT_DEV = Root_SDA2;
324#endif
325
326 if ( ppc_md.progress )
327 ppc_md.progress("mcpn765_setup_arch: find_bridges", 0);
328
329 /* Lookup PCI host bridges */
330 mcpn765_find_bridges();
331
332 hose = pci_bus_to_hose(0);
333 isa_io_base = (ulong)hose->io_base_virt;
334
335 TODC_INIT(TODC_TYPE_MK48T37,
336 (MCPN765_PHYS_NVRAM_AS0 - isa_io_base),
337 (MCPN765_PHYS_NVRAM_AS1 - isa_io_base),
338 (MCPN765_PHYS_NVRAM_DATA - isa_io_base),
339 8);
340
341 OpenPIC_InitSenses = mcpn765_openpic_initsenses;
342 OpenPIC_NumInitSenses = sizeof(mcpn765_openpic_initsenses);
343
344 printk("Motorola MCG MCPN765 cPCI Non-System Board\n");
345 printk("MCPN765 port (MontaVista Software, Inc. (source@mvista.com))\n");
346
347 if ( ppc_md.progress )
348 ppc_md.progress("mcpn765_setup_arch: exit", 0);
349
350 return;
351}
352
353static void __init
354mcpn765_init2(void)
355{
356
357 request_region(0x00,0x20,"dma1");
358 request_region(0x20,0x20,"pic1");
359 request_region(0x40,0x20,"timer");
360 request_region(0x80,0x10,"dma page reg");
361 request_region(0xa0,0x20,"pic2");
362 request_region(0xc0,0x20,"dma2");
363
364 return;
365}
366
367/*
368 * Interrupt setup and service.
369 * Have MPIC on HAWK and cascaded 8259s on VIA 82586 cascaded to MPIC.
370 */
371static void __init
372mcpn765_init_IRQ(void)
373{
374 int i;
375
376 if ( ppc_md.progress )
377 ppc_md.progress("init_irq: enter", 0);
378
379 openpic_init(NUM_8259_INTERRUPTS);
380 openpic_hookup_cascade(NUM_8259_INTERRUPTS, "82c59 cascade",
381 i8259_irq);
382
383 for(i=0; i < NUM_8259_INTERRUPTS; i++)
384 irq_desc[i].handler = &i8259_pic;
385
386 i8259_init(0);
387
388 if ( ppc_md.progress )
389 ppc_md.progress("init_irq: exit", 0);
390
391 return;
392}
393
394static u32
395mcpn765_irq_canonicalize(u32 irq)
396{
397 if (irq == 2)
398 return 9;
399 else
400 return irq;
401}
402
403static unsigned long __init
404mcpn765_find_end_of_memory(void)
405{
406 return hawk_get_mem_size(MCPN765_HAWK_SMC_BASE);
407}
408
409static void __init
410mcpn765_map_io(void)
411{
412 io_block_mapping(0xfe800000, 0xfe800000, 0x00800000, _PAGE_IO);
413}
414
415static void
416mcpn765_reset_board(void)
417{
418 local_irq_disable();
419
420 /* set VIA IDE controller into native mode */
421 mcpn765_set_VIA_IDE_native();
422
423 /* Set exception prefix high - to the firmware */
424 _nmask_and_or_msr(0, MSR_IP);
425
426 out_8((u_char *)MCPN765_BOARD_MODRST_REG, 0x01);
427
428 return;
429}
430
431static void
432mcpn765_restart(char *cmd)
433{
434 volatile ulong i = 10000000;
435
436 mcpn765_reset_board();
437
438 while (i-- > 0);
439 panic("restart failed\n");
440}
441
442static void
443mcpn765_power_off(void)
444{
445 mcpn765_halt();
446 /* NOTREACHED */
447}
448
449static void
450mcpn765_halt(void)
451{
452 local_irq_disable();
453 while (1);
454 /* NOTREACHED */
455}
456
457static int
458mcpn765_show_cpuinfo(struct seq_file *m)
459{
460 seq_printf(m, "vendor\t\t: Motorola MCG\n");
461 seq_printf(m, "machine\t\t: MCPN765\n");
462
463 return 0;
464}
465
466/*
467 * Set BAT 3 to map 0xf0000000 to end of physical memory space.
468 */
469static __inline__ void
470mcpn765_set_bat(void)
471{
472 mb();
473 mtspr(SPRN_DBAT1U, 0xfe8000fe);
474 mtspr(SPRN_DBAT1L, 0xfe80002a);
475 mb();
476}
477
478void __init
479platform_init(unsigned long r3, unsigned long r4, unsigned long r5,
480 unsigned long r6, unsigned long r7)
481{
482 parse_bootinfo(find_bootinfo());
483
484 /* Map in board regs, etc. */
485 mcpn765_set_bat();
486
487 isa_mem_base = MCPN765_ISA_MEM_BASE;
488 pci_dram_offset = MCPN765_PCI_DRAM_OFFSET;
489 ISA_DMA_THRESHOLD = 0x00ffffff;
490 DMA_MODE_READ = 0x44;
491 DMA_MODE_WRITE = 0x48;
492
493 ppc_md.setup_arch = mcpn765_setup_arch;
494 ppc_md.show_cpuinfo = mcpn765_show_cpuinfo;
495 ppc_md.irq_canonicalize = mcpn765_irq_canonicalize;
496 ppc_md.init_IRQ = mcpn765_init_IRQ;
497 ppc_md.get_irq = openpic_get_irq;
498 ppc_md.init = mcpn765_init2;
499
500 ppc_md.restart = mcpn765_restart;
501 ppc_md.power_off = mcpn765_power_off;
502 ppc_md.halt = mcpn765_halt;
503
504 ppc_md.find_end_of_memory = mcpn765_find_end_of_memory;
505 ppc_md.setup_io_mappings = mcpn765_map_io;
506
507 ppc_md.time_init = todc_time_init;
508 ppc_md.set_rtc_time = todc_set_rtc_time;
509 ppc_md.get_rtc_time = todc_get_rtc_time;
510 ppc_md.calibrate_decr = todc_calibrate_decr;
511
512 ppc_md.nvram_read_val = todc_m48txx_read_val;
513 ppc_md.nvram_write_val = todc_m48txx_write_val;
514
515 ppc_md.heartbeat = NULL;
516 ppc_md.heartbeat_reset = 0;
517 ppc_md.heartbeat_count = 0;
518
519#ifdef CONFIG_SERIAL_TEXT_DEBUG
520 ppc_md.progress = gen550_progress;
521#endif
522#ifdef CONFIG_KGDB
523 ppc_md.kgdb_map_scc = gen550_kgdb_map_scc;
524#endif
525
526 return;
527}
diff --git a/arch/ppc/platforms/mcpn765.h b/arch/ppc/platforms/mcpn765.h
deleted file mode 100644
index 4d35ecad097b..000000000000
--- a/arch/ppc/platforms/mcpn765.h
+++ /dev/null
@@ -1,122 +0,0 @@
1/*
2 * arch/ppc/platforms/mcpn765.h
3 *
4 * Definitions for Motorola MCG MCPN765 cPCI Board.
5 *
6 * Author: Mark A. Greer
7 * mgreer@mvista.com
8 *
9 * 2001-2004 (c) MontaVista, Software, Inc. This file is licensed under
10 * the terms of the GNU General Public License version 2. This program
11 * is licensed "as is" without any warranty of any kind, whether express
12 * or implied.
13 */
14
15/*
16 * From Processor to PCI:
17 * PCI Mem Space: 0x80000000 - 0xc0000000 -> 0x80000000 - 0xc0000000 (1 GB)
18 * PCI I/O Space: 0xfd800000 - 0xfe000000 -> 0x00000000 - 0x00800000 (8 MB)
19 * Note: Must skip 0xfe000000-0xfe400000 for CONFIG_HIGHMEM/PKMAP area
20 * MPIC in PCI Mem Space: 0xfe800000 - 0xfe830000 (not all used by MPIC)
21 *
22 * From PCI to Processor:
23 * System Memory: 0x00000000 -> 0x00000000
24 */
25
26#ifndef __PPC_PLATFORMS_MCPN765_H
27#define __PPC_PLATFORMS_MCPN765_H
28#include <linux/config.h>
29
30/* PCI Memory space mapping info */
31#define MCPN765_PCI_MEM_SIZE 0x40000000U
32#define MCPN765_PROC_PCI_MEM_START 0x80000000U
33#define MCPN765_PROC_PCI_MEM_END (MCPN765_PROC_PCI_MEM_START + \
34 MCPN765_PCI_MEM_SIZE - 1)
35#define MCPN765_PCI_MEM_START 0x80000000U
36#define MCPN765_PCI_MEM_END (MCPN765_PCI_MEM_START + \
37 MCPN765_PCI_MEM_SIZE - 1)
38
39/* PCI I/O space mapping info */
40#define MCPN765_PCI_IO_SIZE 0x00800000U
41#define MCPN765_PROC_PCI_IO_START 0xfd800000U
42#define MCPN765_PROC_PCI_IO_END (MCPN765_PROC_PCI_IO_START + \
43 MCPN765_PCI_IO_SIZE - 1)
44#define MCPN765_PCI_IO_START 0x00000000U
45#define MCPN765_PCI_IO_END (MCPN765_PCI_IO_START + \
46 MCPN765_PCI_IO_SIZE - 1)
47
48/* System memory mapping info */
49#define MCPN765_PCI_DRAM_OFFSET 0x00000000U
50#define MCPN765_PCI_PHY_MEM_OFFSET 0x00000000U
51
52#define MCPN765_ISA_MEM_BASE 0x00000000U
53#define MCPN765_ISA_IO_BASE MCPN765_PROC_PCI_IO_START
54
55/* Define base addresses for important sets of registers */
56#define MCPN765_HAWK_MPIC_BASE 0xfe800000U
57#define MCPN765_HAWK_SMC_BASE 0xfef80000U
58#define MCPN765_HAWK_PPC_REG_BASE 0xfeff0000U
59
60/* Define MCPN765 board register addresses. */
61#define MCPN765_BOARD_STATUS_REG 0xfef88080U
62#define MCPN765_BOARD_MODFAIL_REG 0xfef88090U
63#define MCPN765_BOARD_MODRST_REG 0xfef880a0U
64#define MCPN765_BOARD_TBEN_REG 0xfef880c0U
65#define MCPN765_BOARD_GEOGRAPHICAL_REG 0xfef880e8U
66#define MCPN765_BOARD_EXT_FEATURE_REG 0xfef880f0U
67#define MCPN765_BOARD_LAST_RESET_REG 0xfef880f8U
68
69/* Defines for UART */
70
71/* Define the UART base addresses */
72#define MCPN765_SERIAL_1 0xfef88000
73#define MCPN765_SERIAL_2 0xfef88200
74#define MCPN765_SERIAL_3 0xfef88400
75#define MCPN765_SERIAL_4 0xfef88600
76
77#ifdef CONFIG_SERIAL_MANY_PORTS
78#define RS_TABLE_SIZE 64
79#else
80#define RS_TABLE_SIZE 4
81#endif
82
83/* Rate for the 1.8432 Mhz clock for the onboard serial chip */
84#define BASE_BAUD ( 1843200 / 16 )
85#define UART_CLK 1843200
86
87#ifdef CONFIG_SERIAL_DETECT_IRQ
88#define STD_COM_FLAGS (ASYNC_BOOT_AUTOCONF|ASYNC_SKIP_TEST|ASYNC_AUTO_IRQ)
89#else
90#define STD_COM_FLAGS (ASYNC_BOOT_AUTOCONF|ASYNC_SKIP_TEST)
91#endif
92
93/* All UART IRQ's are wire-OR'd to IRQ 17 */
94#define STD_SERIAL_PORT_DFNS \
95 { 0, BASE_BAUD, MCPN765_SERIAL_1, 17, STD_COM_FLAGS, /* ttyS0 */\
96 iomem_base: (u8 *)MCPN765_SERIAL_1, \
97 iomem_reg_shift: 4, \
98 io_type: SERIAL_IO_MEM }, \
99 { 0, BASE_BAUD, MCPN765_SERIAL_2, 17, STD_COM_FLAGS, /* ttyS1 */\
100 iomem_base: (u8 *)MCPN765_SERIAL_2, \
101 iomem_reg_shift: 4, \
102 io_type: SERIAL_IO_MEM }, \
103 { 0, BASE_BAUD, MCPN765_SERIAL_3, 17, STD_COM_FLAGS, /* ttyS2 */\
104 iomem_base: (u8 *)MCPN765_SERIAL_3, \
105 iomem_reg_shift: 4, \
106 io_type: SERIAL_IO_MEM }, \
107 { 0, BASE_BAUD, MCPN765_SERIAL_4, 17, STD_COM_FLAGS, /* ttyS3 */\
108 iomem_base: (u8 *)MCPN765_SERIAL_4, \
109 iomem_reg_shift: 4, \
110 io_type: SERIAL_IO_MEM },
111
112#define SERIAL_PORT_DFNS \
113 STD_SERIAL_PORT_DFNS
114
115/* Define the NVRAM/RTC address strobe & data registers */
116#define MCPN765_PHYS_NVRAM_AS0 0xfef880c8U
117#define MCPN765_PHYS_NVRAM_AS1 0xfef880d0U
118#define MCPN765_PHYS_NVRAM_DATA 0xfef880d8U
119
120extern void mcpn765_find_bridges(void);
121
122#endif /* __PPC_PLATFORMS_MCPN765_H */
diff --git a/arch/ppc/platforms/pcore.c b/arch/ppc/platforms/pcore.c
deleted file mode 100644
index d7191630a650..000000000000
--- a/arch/ppc/platforms/pcore.c
+++ /dev/null
@@ -1,352 +0,0 @@
1/*
2 * arch/ppc/platforms/pcore_setup.c
3 *
4 * Setup routines for Force PCORE boards
5 *
6 * Author: Matt Porter <mporter@mvista.com>
7 *
8 * 2001 (c) MontaVista, Software, Inc. This file is licensed under
9 * the terms of the GNU General Public License version 2. This program
10 * is licensed "as is" without any warranty of any kind, whether express
11 * or implied.
12 */
13
14#include <linux/config.h>
15#include <linux/stddef.h>
16#include <linux/kernel.h>
17#include <linux/init.h>
18#include <linux/errno.h>
19#include <linux/reboot.h>
20#include <linux/pci.h>
21#include <linux/kdev_t.h>
22#include <linux/types.h>
23#include <linux/major.h>
24#include <linux/initrd.h>
25#include <linux/console.h>
26#include <linux/irq.h>
27#include <linux/seq_file.h>
28#include <linux/root_dev.h>
29
30#include <asm/io.h>
31#include <asm/machdep.h>
32#include <asm/time.h>
33#include <asm/i8259.h>
34#include <asm/mpc10x.h>
35#include <asm/todc.h>
36#include <asm/bootinfo.h>
37#include <asm/kgdb.h>
38
39#include "pcore.h"
40
41extern unsigned long loops_per_jiffy;
42
43static int board_type;
44
45static inline int __init
46pcore_6750_map_irq(struct pci_dev *dev, unsigned char idsel, unsigned char pin)
47{
48 static char pci_irq_table[][4] =
49 /*
50 * PCI IDSEL/INTPIN->INTLINE
51 * A B C D
52 */
53 {
54 {9, 10, 11, 12}, /* IDSEL 24 - DEC 21554 */
55 {10, 0, 0, 0}, /* IDSEL 25 - DEC 21143 */
56 {11, 12, 9, 10}, /* IDSEL 26 - PMC I */
57 {12, 9, 10, 11}, /* IDSEL 27 - PMC II */
58 {0, 0, 0, 0}, /* IDSEL 28 - unused */
59 {0, 0, 9, 0}, /* IDSEL 29 - unused */
60 {0, 0, 0, 0}, /* IDSEL 30 - Winbond */
61 };
62 const long min_idsel = 24, max_idsel = 30, irqs_per_slot = 4;
63 return PCI_IRQ_TABLE_LOOKUP;
64};
65
66static inline int __init
67pcore_680_map_irq(struct pci_dev *dev, unsigned char idsel, unsigned char pin)
68{
69 static char pci_irq_table[][4] =
70 /*
71 * PCI IDSEL/INTPIN->INTLINE
72 * A B C D
73 */
74 {
75 {9, 10, 11, 12}, /* IDSEL 24 - Sentinel */
76 {10, 0, 0, 0}, /* IDSEL 25 - i82559 #1 */
77 {11, 12, 9, 10}, /* IDSEL 26 - PMC I */
78 {12, 9, 10, 11}, /* IDSEL 27 - PMC II */
79 {9, 0, 0, 0}, /* IDSEL 28 - i82559 #2 */
80 {0, 0, 0, 0}, /* IDSEL 29 - unused */
81 {0, 0, 0, 0}, /* IDSEL 30 - Winbond */
82 };
83 const long min_idsel = 24, max_idsel = 30, irqs_per_slot = 4;
84 return PCI_IRQ_TABLE_LOOKUP;
85};
86
87void __init
88pcore_pcibios_fixup(void)
89{
90 struct pci_dev *dev;
91
92 if ((dev = pci_get_device(PCI_VENDOR_ID_WINBOND,
93 PCI_DEVICE_ID_WINBOND_83C553,
94 0)))
95 {
96 /* Reroute interrupts both IDE channels to 15 */
97 pci_write_config_byte(dev,
98 PCORE_WINBOND_IDE_INT,
99 0xff);
100
101 /* Route INTA-D to IRQ9-12, respectively */
102 pci_write_config_word(dev,
103 PCORE_WINBOND_PCI_INT,
104 0x9abc);
105
106 /*
107 * Set up 8259 edge/level triggering
108 */
109 outb(0x00, PCORE_WINBOND_PRI_EDG_LVL);
110 outb(0x1e, PCORE_WINBOND_SEC_EDG_LVL);
111 pci_dev_put(dev);
112 }
113}
114
115int __init
116pcore_find_bridges(void)
117{
118 struct pci_controller* hose;
119 int host_bridge, board_type;
120
121 hose = pcibios_alloc_controller();
122 if (!hose)
123 return 0;
124
125 mpc10x_bridge_init(hose,
126 MPC10X_MEM_MAP_B,
127 MPC10X_MEM_MAP_B,
128 MPC10X_MAPB_EUMB_BASE);
129
130 /* Determine board type */
131 early_read_config_dword(hose,
132 0,
133 PCI_DEVFN(0,0),
134 PCI_VENDOR_ID,
135 &host_bridge);
136 if (host_bridge == MPC10X_BRIDGE_106)
137 board_type = PCORE_TYPE_6750;
138 else /* MPC10X_BRIDGE_107 */
139 board_type = PCORE_TYPE_680;
140
141 hose->last_busno = pciauto_bus_scan(hose, hose->first_busno);
142
143 ppc_md.pcibios_fixup = pcore_pcibios_fixup;
144 ppc_md.pci_swizzle = common_swizzle;
145
146 if (board_type == PCORE_TYPE_6750)
147 ppc_md.pci_map_irq = pcore_6750_map_irq;
148 else /* PCORE_TYPE_680 */
149 ppc_md.pci_map_irq = pcore_680_map_irq;
150
151 return board_type;
152}
153
154/* Dummy variable to satisfy mpc10x_common.o */
155void *OpenPIC_Addr;
156
157static int
158pcore_show_cpuinfo(struct seq_file *m)
159{
160 seq_printf(m, "vendor\t\t: Force Computers\n");
161
162 if (board_type == PCORE_TYPE_6750)
163 seq_printf(m, "machine\t\t: PowerCore 6750\n");
164 else /* PCORE_TYPE_680 */
165 seq_printf(m, "machine\t\t: PowerCore 680\n");
166
167 seq_printf(m, "L2\t\t: " );
168 if (board_type == PCORE_TYPE_6750)
169 switch (readb(PCORE_DCCR_REG) & PCORE_DCCR_L2_MASK)
170 {
171 case PCORE_DCCR_L2_0KB:
172 seq_printf(m, "nocache");
173 break;
174 case PCORE_DCCR_L2_256KB:
175 seq_printf(m, "256KB");
176 break;
177 case PCORE_DCCR_L2_1MB:
178 seq_printf(m, "1MB");
179 break;
180 case PCORE_DCCR_L2_512KB:
181 seq_printf(m, "512KB");
182 break;
183 default:
184 seq_printf(m, "error");
185 break;
186 }
187 else /* PCORE_TYPE_680 */
188 switch (readb(PCORE_DCCR_REG) & PCORE_DCCR_L2_MASK)
189 {
190 case PCORE_DCCR_L2_2MB:
191 seq_printf(m, "2MB");
192 break;
193 case PCORE_DCCR_L2_256KB:
194 seq_printf(m, "reserved");
195 break;
196 case PCORE_DCCR_L2_1MB:
197 seq_printf(m, "1MB");
198 break;
199 case PCORE_DCCR_L2_512KB:
200 seq_printf(m, "512KB");
201 break;
202 default:
203 seq_printf(m, "error");
204 break;
205 }
206
207 seq_printf(m, "\n");
208
209 return 0;
210}
211
212static void __init
213pcore_setup_arch(void)
214{
215 /* init to some ~sane value until calibrate_delay() runs */
216 loops_per_jiffy = 50000000/HZ;
217
218 /* Lookup PCI host bridges */
219 board_type = pcore_find_bridges();
220
221#ifdef CONFIG_BLK_DEV_INITRD
222 if (initrd_start)
223 ROOT_DEV = Root_RAM0;
224 else
225#endif
226#ifdef CONFIG_ROOT_NFS
227 ROOT_DEV = Root_NFS;
228#else
229 ROOT_DEV = Root_SDA2;
230#endif
231
232 printk(KERN_INFO "Force PowerCore ");
233 if (board_type == PCORE_TYPE_6750)
234 printk("6750\n");
235 else
236 printk("680\n");
237 printk(KERN_INFO "Port by MontaVista Software, Inc. (source@mvista.com)\n");
238 _set_L2CR(L2CR_L2E | _get_L2CR());
239
240}
241
242static void
243pcore_restart(char *cmd)
244{
245 local_irq_disable();
246 /* Hard reset */
247 writeb(0x11, 0xfe000332);
248 while(1);
249}
250
251static void
252pcore_halt(void)
253{
254 local_irq_disable();
255 /* Turn off user LEDs */
256 writeb(0x00, 0xfe000300);
257 while (1);
258}
259
260static void
261pcore_power_off(void)
262{
263 pcore_halt();
264}
265
266
267static void __init
268pcore_init_IRQ(void)
269{
270 int i;
271
272 for ( i = 0 ; i < 16 ; i++ )
273 irq_desc[i].handler = &i8259_pic;
274
275 i8259_init(0);
276}
277
278/*
279 * Set BAT 3 to map 0xf0000000 to end of physical memory space.
280 */
281static __inline__ void
282pcore_set_bat(void)
283{
284 mb();
285 mtspr(SPRN_DBAT3U, 0xf0001ffe);
286 mtspr(SPRN_DBAT3L, 0xfe80002a);
287 mb();
288
289}
290
291static unsigned long __init
292pcore_find_end_of_memory(void)
293{
294
295 return mpc10x_get_mem_size(MPC10X_MEM_MAP_B);
296}
297
298static void __init
299pcore_map_io(void)
300{
301 io_block_mapping(0xfe000000, 0xfe000000, 0x02000000, _PAGE_IO);
302}
303
304TODC_ALLOC();
305
306void __init
307platform_init(unsigned long r3, unsigned long r4, unsigned long r5,
308 unsigned long r6, unsigned long r7)
309{
310 parse_bootinfo(find_bootinfo());
311
312 /* Cover I/O space with a BAT */
313 /* yuck, better hope your ram size is a power of 2 -- paulus */
314 pcore_set_bat();
315
316 isa_io_base = MPC10X_MAPB_ISA_IO_BASE;
317 isa_mem_base = MPC10X_MAPB_ISA_MEM_BASE;
318 pci_dram_offset = MPC10X_MAPB_DRAM_OFFSET;
319
320 ppc_md.setup_arch = pcore_setup_arch;
321 ppc_md.show_cpuinfo = pcore_show_cpuinfo;
322 ppc_md.init_IRQ = pcore_init_IRQ;
323 ppc_md.get_irq = i8259_irq;
324
325 ppc_md.find_end_of_memory = pcore_find_end_of_memory;
326 ppc_md.setup_io_mappings = pcore_map_io;
327
328 ppc_md.restart = pcore_restart;
329 ppc_md.power_off = pcore_power_off;
330 ppc_md.halt = pcore_halt;
331
332 TODC_INIT(TODC_TYPE_MK48T59,
333 PCORE_NVRAM_AS0,
334 PCORE_NVRAM_AS1,
335 PCORE_NVRAM_DATA,
336 8);
337
338 ppc_md.time_init = todc_time_init;
339 ppc_md.get_rtc_time = todc_get_rtc_time;
340 ppc_md.set_rtc_time = todc_set_rtc_time;
341 ppc_md.calibrate_decr = todc_calibrate_decr;
342
343 ppc_md.nvram_read_val = todc_m48txx_read_val;
344 ppc_md.nvram_write_val = todc_m48txx_write_val;
345
346#ifdef CONFIG_SERIAL_TEXT_DEBUG
347 ppc_md.progress = gen550_progress;
348#endif
349#ifdef CONFIG_KGDB
350 ppc_md.kgdb_map_scc = gen550_kgdb_map_scc;
351#endif
352}
diff --git a/arch/ppc/platforms/pcore.h b/arch/ppc/platforms/pcore.h
deleted file mode 100644
index c6a26e764926..000000000000
--- a/arch/ppc/platforms/pcore.h
+++ /dev/null
@@ -1,39 +0,0 @@
1/*
2 * arch/ppc/platforms/pcore.h
3 *
4 * Definitions for Force PowerCore board support
5 *
6 * Author: Matt Porter <mporter@mvista.com>
7 *
8 * 2001 (c) MontaVista, Software, Inc. This file is licensed under
9 * the terms of the GNU General Public License version 2. This program
10 * is licensed "as is" without any warranty of any kind, whether express
11 * or implied.
12 */
13
14#ifndef __PPC_PLATFORMS_PCORE_H
15#define __PPC_PLATFORMS_PCORE_H
16
17#include <asm/mpc10x.h>
18
19#define PCORE_TYPE_6750 1
20#define PCORE_TYPE_680 2
21
22#define PCORE_NVRAM_AS0 0x73
23#define PCORE_NVRAM_AS1 0x75
24#define PCORE_NVRAM_DATA 0x77
25
26#define PCORE_DCCR_REG (MPC10X_MAPB_ISA_IO_BASE + 0x308)
27#define PCORE_DCCR_L2_MASK 0xc0
28#define PCORE_DCCR_L2_0KB 0x00
29#define PCORE_DCCR_L2_256KB 0x40
30#define PCORE_DCCR_L2_512KB 0xc0
31#define PCORE_DCCR_L2_1MB 0x80
32#define PCORE_DCCR_L2_2MB 0x00
33
34#define PCORE_WINBOND_IDE_INT 0x43
35#define PCORE_WINBOND_PCI_INT 0x44
36#define PCORE_WINBOND_PRI_EDG_LVL 0x4d0
37#define PCORE_WINBOND_SEC_EDG_LVL 0x4d1
38
39#endif /* __PPC_PLATFORMS_PCORE_H */
diff --git a/arch/ppc/platforms/pmac_pic.c b/arch/ppc/platforms/pmac_pic.c
index 9f92e1bb7f34..2ce058895e03 100644
--- a/arch/ppc/platforms/pmac_pic.c
+++ b/arch/ppc/platforms/pmac_pic.c
@@ -619,7 +619,7 @@ not_found:
619 return viaint; 619 return viaint;
620} 620}
621 621
622static int pmacpic_suspend(struct sys_device *sysdev, u32 state) 622static int pmacpic_suspend(struct sys_device *sysdev, pm_message_t state)
623{ 623{
624 int viaint = pmacpic_find_viaint(); 624 int viaint = pmacpic_find_viaint();
625 625
diff --git a/arch/ppc/platforms/pmac_setup.c b/arch/ppc/platforms/pmac_setup.c
index 4d324b630f4f..b392b9a15987 100644
--- a/arch/ppc/platforms/pmac_setup.c
+++ b/arch/ppc/platforms/pmac_setup.c
@@ -113,7 +113,7 @@ extern int pmac_newworld;
113extern void zs_kgdb_hook(int tty_num); 113extern void zs_kgdb_hook(int tty_num);
114static void ohare_init(void); 114static void ohare_init(void);
115#ifdef CONFIG_BOOTX_TEXT 115#ifdef CONFIG_BOOTX_TEXT
116void pmac_progress(char *s, unsigned short hex); 116static void pmac_progress(char *s, unsigned short hex);
117#endif 117#endif
118 118
119sys_ctrler_t sys_ctrler = SYS_CTRLER_UNKNOWN; 119sys_ctrler_t sys_ctrler = SYS_CTRLER_UNKNOWN;
@@ -123,7 +123,7 @@ extern struct smp_ops_t psurge_smp_ops;
123extern struct smp_ops_t core99_smp_ops; 123extern struct smp_ops_t core99_smp_ops;
124#endif /* CONFIG_SMP */ 124#endif /* CONFIG_SMP */
125 125
126int __pmac 126static int __pmac
127pmac_show_cpuinfo(struct seq_file *m) 127pmac_show_cpuinfo(struct seq_file *m)
128{ 128{
129 struct device_node *np; 129 struct device_node *np;
@@ -227,7 +227,7 @@ pmac_show_cpuinfo(struct seq_file *m)
227 return 0; 227 return 0;
228} 228}
229 229
230int __openfirmware 230static int __openfirmware
231pmac_show_percpuinfo(struct seq_file *m, int i) 231pmac_show_percpuinfo(struct seq_file *m, int i)
232{ 232{
233#ifdef CONFIG_CPU_FREQ_PMAC 233#ifdef CONFIG_CPU_FREQ_PMAC
@@ -415,7 +415,7 @@ find_ide_boot(void)
415} 415}
416#endif /* CONFIG_BLK_DEV_IDE && CONFIG_BLK_DEV_IDE_PMAC */ 416#endif /* CONFIG_BLK_DEV_IDE && CONFIG_BLK_DEV_IDE_PMAC */
417 417
418void __init 418static void __init
419find_boot_device(void) 419find_boot_device(void)
420{ 420{
421#if defined(CONFIG_BLK_DEV_IDE) && defined(CONFIG_BLK_DEV_IDE_PMAC) 421#if defined(CONFIG_BLK_DEV_IDE) && defined(CONFIG_BLK_DEV_IDE_PMAC)
@@ -512,7 +512,7 @@ note_bootable_part(dev_t dev, int part, int goodness)
512 } 512 }
513} 513}
514 514
515void __pmac 515static void __pmac
516pmac_restart(char *cmd) 516pmac_restart(char *cmd)
517{ 517{
518#ifdef CONFIG_ADB_CUDA 518#ifdef CONFIG_ADB_CUDA
@@ -537,7 +537,7 @@ pmac_restart(char *cmd)
537 } 537 }
538} 538}
539 539
540void __pmac 540static void __pmac
541pmac_power_off(void) 541pmac_power_off(void)
542{ 542{
543#ifdef CONFIG_ADB_CUDA 543#ifdef CONFIG_ADB_CUDA
@@ -562,7 +562,7 @@ pmac_power_off(void)
562 } 562 }
563} 563}
564 564
565void __pmac 565static void __pmac
566pmac_halt(void) 566pmac_halt(void)
567{ 567{
568 pmac_power_off(); 568 pmac_power_off();
@@ -700,7 +700,7 @@ pmac_init(unsigned long r3, unsigned long r4, unsigned long r5,
700} 700}
701 701
702#ifdef CONFIG_BOOTX_TEXT 702#ifdef CONFIG_BOOTX_TEXT
703void __init 703static void __init
704pmac_progress(char *s, unsigned short hex) 704pmac_progress(char *s, unsigned short hex)
705{ 705{
706 if (boot_text_mapped) { 706 if (boot_text_mapped) {
diff --git a/arch/ppc/platforms/prpmc750.c b/arch/ppc/platforms/prpmc750.c
index c894e1ab5934..24ae1caafc61 100644
--- a/arch/ppc/platforms/prpmc750.c
+++ b/arch/ppc/platforms/prpmc750.c
@@ -29,6 +29,7 @@
29#include <linux/ide.h> 29#include <linux/ide.h>
30#include <linux/root_dev.h> 30#include <linux/root_dev.h>
31#include <linux/slab.h> 31#include <linux/slab.h>
32#include <linux/serial_reg.h>
32 33
33#include <asm/byteorder.h> 34#include <asm/byteorder.h>
34#include <asm/system.h> 35#include <asm/system.h>
diff --git a/arch/ppc/platforms/sandpoint.c b/arch/ppc/platforms/sandpoint.c
index 8b149c2fc54f..21e31346b12b 100644
--- a/arch/ppc/platforms/sandpoint.c
+++ b/arch/ppc/platforms/sandpoint.c
@@ -311,19 +311,22 @@ sandpoint_setup_arch(void)
311 { 311 {
312 bd_t *bp = (bd_t *)__res; 312 bd_t *bp = (bd_t *)__res;
313 struct plat_serial8250_port *pdata; 313 struct plat_serial8250_port *pdata;
314 pdata = (struct plat_serial8250_port *) ppc_sys_get_pdata(MPC10X_DUART);
315 314
315 pdata = (struct plat_serial8250_port *) ppc_sys_get_pdata(MPC10X_UART0);
316 if (pdata) 316 if (pdata)
317 { 317 {
318 pdata[0].uartclk = bp->bi_busfreq; 318 pdata[0].uartclk = bp->bi_busfreq;
319 pdata[0].membase = ioremap(pdata[0].mapbase, 0x100); 319 }
320 320
321 /* this disables the 2nd serial port on the DUART 321#ifdef CONFIG_SANDPOINT_ENABLE_UART1
322 * since the sandpoint does not have it connected */ 322 pdata = (struct plat_serial8250_port *) ppc_sys_get_pdata(MPC10X_UART1);
323 pdata[1].uartclk = 0; 323 if (pdata)
324 pdata[1].irq = 0; 324 {
325 pdata[1].mapbase = 0; 325 pdata[0].uartclk = bp->bi_busfreq;
326 } 326 }
327#else
328 ppc_sys_device_remove(MPC10X_UART1);
329#endif
327 } 330 }
328 331
329 printk(KERN_INFO "Motorola SPS Sandpoint Test Platform\n"); 332 printk(KERN_INFO "Motorola SPS Sandpoint Test Platform\n");
diff --git a/arch/ppc/platforms/spd8xx.h b/arch/ppc/platforms/spd8xx.h
deleted file mode 100644
index ed48d144f415..000000000000
--- a/arch/ppc/platforms/spd8xx.h
+++ /dev/null
@@ -1,92 +0,0 @@
1/*
2 * Speech Design SPD8xxTS board specific definitions
3 *
4 * Copyright (c) 2000,2001 Wolfgang Denk (wd@denx.de)
5 */
6
7#ifdef __KERNEL__
8#ifndef __ASM_SPD8XX_H__
9#define __ASM_SPD8XX_H__
10
11#include <linux/config.h>
12
13#include <asm/ppcboot.h>
14
15#ifndef __ASSEMBLY__
16#define SPD_IMMR_BASE 0xFFF00000 /* phys. addr of IMMR */
17#define SPD_IMAP_SIZE (64 * 1024) /* size of mapped area */
18
19#define IMAP_ADDR SPD_IMMR_BASE /* physical base address of IMMR area */
20#define IMAP_SIZE SPD_IMAP_SIZE /* mapped size of IMMR area */
21
22#define PCMCIA_MEM_ADDR ((uint)0xFE100000)
23#define PCMCIA_MEM_SIZE ((uint)(64 * 1024))
24
25#define IDE0_INTERRUPT 10 /* = IRQ5 */
26#define IDE1_INTERRUPT 12 /* = IRQ6 */
27#define CPM_INTERRUPT 13 /* = SIU_LEVEL6 (was: SIU_LEVEL2) */
28
29/* override the default number of IDE hardware interfaces */
30#define MAX_HWIFS 2
31
32/*
33 * Definitions for IDE0 Interface
34 */
35#define IDE0_BASE_OFFSET 0x0000 /* Offset in PCMCIA memory */
36#define IDE0_DATA_REG_OFFSET 0x0000
37#define IDE0_ERROR_REG_OFFSET 0x0081
38#define IDE0_NSECTOR_REG_OFFSET 0x0082
39#define IDE0_SECTOR_REG_OFFSET 0x0083
40#define IDE0_LCYL_REG_OFFSET 0x0084
41#define IDE0_HCYL_REG_OFFSET 0x0085
42#define IDE0_SELECT_REG_OFFSET 0x0086
43#define IDE0_STATUS_REG_OFFSET 0x0087
44#define IDE0_CONTROL_REG_OFFSET 0x0106
45#define IDE0_IRQ_REG_OFFSET 0x000A /* not used */
46
47/*
48 * Definitions for IDE1 Interface
49 */
50#define IDE1_BASE_OFFSET 0x0C00 /* Offset in PCMCIA memory */
51#define IDE1_DATA_REG_OFFSET 0x0000
52#define IDE1_ERROR_REG_OFFSET 0x0081
53#define IDE1_NSECTOR_REG_OFFSET 0x0082
54#define IDE1_SECTOR_REG_OFFSET 0x0083
55#define IDE1_LCYL_REG_OFFSET 0x0084
56#define IDE1_HCYL_REG_OFFSET 0x0085
57#define IDE1_SELECT_REG_OFFSET 0x0086
58#define IDE1_STATUS_REG_OFFSET 0x0087
59#define IDE1_CONTROL_REG_OFFSET 0x0106
60#define IDE1_IRQ_REG_OFFSET 0x000A /* not used */
61
62/* CPM Ethernet through SCCx.
63 *
64 * Bits in parallel I/O port registers that have to be set/cleared
65 * to configure the pins for SCC2 use.
66 */
67#define PA_ENET_MDC ((ushort)0x0001) /* PA 15 !!! */
68#define PA_ENET_MDIO ((ushort)0x0002) /* PA 14 !!! */
69#define PA_ENET_RXD ((ushort)0x0004) /* PA 13 */
70#define PA_ENET_TXD ((ushort)0x0008) /* PA 12 */
71#define PA_ENET_RCLK ((ushort)0x0200) /* PA 6 */
72#define PA_ENET_TCLK ((ushort)0x0400) /* PA 5 */
73
74#define PB_ENET_TENA ((uint)0x00002000) /* PB 18 */
75
76#define PC_ENET_CLSN ((ushort)0x0040) /* PC 9 */
77#define PC_ENET_RENA ((ushort)0x0080) /* PC 8 */
78#define PC_ENET_RESET ((ushort)0x0100) /* PC 7 !!! */
79
80/* Control bits in the SICR to route TCLK (CLK3) and RCLK (CLK2) to
81 * SCC2. Also, make sure GR2 (bit 16) and SC2 (bit 17) are zero.
82 */
83#define SICR_ENET_MASK ((uint)0x0000ff00)
84#define SICR_ENET_CLKRT ((uint)0x00002E00)
85
86/* We don't use the 8259.
87*/
88#define NR_8259_INTS 0
89
90#endif /* !__ASSEMBLY__ */
91#endif /* __ASM_SPD8XX_H__ */
92#endif /* __KERNEL__ */
diff --git a/arch/ppc/platforms/tqm8260_setup.c b/arch/ppc/platforms/tqm8260_setup.c
index a8880bfc034b..3409139330b1 100644
--- a/arch/ppc/platforms/tqm8260_setup.c
+++ b/arch/ppc/platforms/tqm8260_setup.c
@@ -16,8 +16,8 @@
16 16
17#include <linux/init.h> 17#include <linux/init.h>
18 18
19#include <asm/immap_cpm2.h>
20#include <asm/mpc8260.h> 19#include <asm/mpc8260.h>
20#include <asm/cpm2.h>
21#include <asm/machdep.h> 21#include <asm/machdep.h>
22 22
23static int 23static int
diff --git a/arch/ppc/platforms/tqm8xx.h b/arch/ppc/platforms/tqm8xx.h
index 2150dc87b18f..43ac064ebe5a 100644
--- a/arch/ppc/platforms/tqm8xx.h
+++ b/arch/ppc/platforms/tqm8xx.h
@@ -147,29 +147,6 @@ static __inline__ void ide_led(int on)
147#define SICR_ENET_CLKRT ((uint)0x00002600) 147#define SICR_ENET_CLKRT ((uint)0x00002600)
148#endif /* CONFIG_FPS850L */ 148#endif /* CONFIG_FPS850L */
149 149
150/*** SM850 *********************************************************/
151
152/* The SM850 Service Module uses SCC2 for IrDA and SCC3 for Ethernet */
153
154#ifdef CONFIG_SM850
155#define PB_ENET_RXD ((uint)0x00000004) /* PB 29 */
156#define PB_ENET_TXD ((uint)0x00000002) /* PB 30 */
157#define PA_ENET_RCLK ((ushort)0x0100) /* PA 7 */
158#define PA_ENET_TCLK ((ushort)0x0400) /* PA 5 */
159
160#define PC_ENET_LBK ((ushort)0x0008) /* PC 12 */
161#define PC_ENET_TENA ((ushort)0x0004) /* PC 13 */
162
163#define PC_ENET_RENA ((ushort)0x0800) /* PC 4 */
164#define PC_ENET_CLSN ((ushort)0x0400) /* PC 5 */
165
166/* Control bits in the SICR to route TCLK (CLK3) and RCLK (CLK1) to
167 * SCC3. Also, make sure GR3 (bit 8) and SC3 (bit 9) are zero.
168 */
169#define SICR_ENET_MASK ((uint)0x00FF0000)
170#define SICR_ENET_CLKRT ((uint)0x00260000)
171#endif /* CONFIG_SM850 */
172
173/* We don't use the 8259. 150/* We don't use the 8259.
174*/ 151*/
175#define NR_8259_INTS 0 152#define NR_8259_INTS 0
diff --git a/arch/ppc/syslib/Makefile b/arch/ppc/syslib/Makefile
index dec5bf4f6879..8b9b226005d1 100644
--- a/arch/ppc/syslib/Makefile
+++ b/arch/ppc/syslib/Makefile
@@ -11,6 +11,7 @@ obj-$(CONFIG_PPCBUG_NVRAM) += prep_nvram.o
11obj-$(CONFIG_PPC_OCP) += ocp.o 11obj-$(CONFIG_PPC_OCP) += ocp.o
12obj-$(CONFIG_IBM_OCP) += ibm_ocp.o 12obj-$(CONFIG_IBM_OCP) += ibm_ocp.o
13obj-$(CONFIG_44x) += ibm44x_common.o 13obj-$(CONFIG_44x) += ibm44x_common.o
14obj-$(CONFIG_440EP) += ibm440gx_common.o
14obj-$(CONFIG_440GP) += ibm440gp_common.o 15obj-$(CONFIG_440GP) += ibm440gp_common.o
15obj-$(CONFIG_440GX) += ibm440gx_common.o 16obj-$(CONFIG_440GX) += ibm440gx_common.o
16obj-$(CONFIG_440SP) += ibm440gx_common.o ibm440sp_common.o 17obj-$(CONFIG_440SP) += ibm440gx_common.o ibm440sp_common.o
@@ -42,24 +43,17 @@ obj-$(CONFIG_PPC_PMAC) += open_pic.o indirect_pci.o
42obj-$(CONFIG_POWER4) += open_pic2.o 43obj-$(CONFIG_POWER4) += open_pic2.o
43obj-$(CONFIG_PPC_CHRP) += open_pic.o indirect_pci.o i8259.o 44obj-$(CONFIG_PPC_CHRP) += open_pic.o indirect_pci.o i8259.o
44obj-$(CONFIG_PPC_PREP) += open_pic.o indirect_pci.o i8259.o todc_time.o 45obj-$(CONFIG_PPC_PREP) += open_pic.o indirect_pci.o i8259.o todc_time.o
45obj-$(CONFIG_ADIR) += i8259.o indirect_pci.o pci_auto.o \ 46obj-$(CONFIG_BAMBOO) += indirect_pci.o pci_auto.o todc_time.o
46 todc_time.o
47obj-$(CONFIG_CPCI690) += todc_time.o pci_auto.o 47obj-$(CONFIG_CPCI690) += todc_time.o pci_auto.o
48obj-$(CONFIG_EBONY) += indirect_pci.o pci_auto.o todc_time.o 48obj-$(CONFIG_EBONY) += indirect_pci.o pci_auto.o todc_time.o
49obj-$(CONFIG_EV64260) += todc_time.o pci_auto.o 49obj-$(CONFIG_EV64260) += todc_time.o pci_auto.o
50obj-$(CONFIG_CHESTNUT) += mv64360_pic.o pci_auto.o 50obj-$(CONFIG_CHESTNUT) += mv64360_pic.o pci_auto.o
51obj-$(CONFIG_GEMINI) += open_pic.o indirect_pci.o 51obj-$(CONFIG_GEMINI) += open_pic.o indirect_pci.o
52obj-$(CONFIG_GT64260) += gt64260_pic.o 52obj-$(CONFIG_GT64260) += gt64260_pic.o
53obj-$(CONFIG_K2) += i8259.o indirect_pci.o todc_time.o \
54 pci_auto.o
55obj-$(CONFIG_LOPEC) += i8259.o pci_auto.o todc_time.o 53obj-$(CONFIG_LOPEC) += i8259.o pci_auto.o todc_time.o
56obj-$(CONFIG_HDPU) += pci_auto.o 54obj-$(CONFIG_HDPU) += pci_auto.o
57obj-$(CONFIG_LUAN) += indirect_pci.o pci_auto.o todc_time.o 55obj-$(CONFIG_LUAN) += indirect_pci.o pci_auto.o todc_time.o
58obj-$(CONFIG_KATANA) += pci_auto.o 56obj-$(CONFIG_KATANA) += pci_auto.o
59obj-$(CONFIG_MCPN765) += todc_time.o indirect_pci.o pci_auto.o \
60 open_pic.o i8259.o hawk_common.o
61obj-$(CONFIG_MENF1) += todc_time.o i8259.o mpc10x_common.o \
62 pci_auto.o indirect_pci.o
63obj-$(CONFIG_MV64360) += mv64360_pic.o 57obj-$(CONFIG_MV64360) += mv64360_pic.o
64obj-$(CONFIG_MV64X60) += mv64x60.o mv64x60_win.o indirect_pci.o 58obj-$(CONFIG_MV64X60) += mv64x60.o mv64x60_win.o indirect_pci.o
65obj-$(CONFIG_MVME5100) += open_pic.o todc_time.o indirect_pci.o \ 59obj-$(CONFIG_MVME5100) += open_pic.o todc_time.o indirect_pci.o \
@@ -67,7 +61,6 @@ obj-$(CONFIG_MVME5100) += open_pic.o todc_time.o indirect_pci.o \
67obj-$(CONFIG_MVME5100_IPMC761_PRESENT) += i8259.o 61obj-$(CONFIG_MVME5100_IPMC761_PRESENT) += i8259.o
68obj-$(CONFIG_OCOTEA) += indirect_pci.o pci_auto.o todc_time.o 62obj-$(CONFIG_OCOTEA) += indirect_pci.o pci_auto.o todc_time.o
69obj-$(CONFIG_PAL4) += cpc700_pic.o 63obj-$(CONFIG_PAL4) += cpc700_pic.o
70obj-$(CONFIG_PCORE) += todc_time.o i8259.o pci_auto.o
71obj-$(CONFIG_POWERPMC250) += pci_auto.o 64obj-$(CONFIG_POWERPMC250) += pci_auto.o
72obj-$(CONFIG_PPLUS) += hawk_common.o open_pic.o i8259.o \ 65obj-$(CONFIG_PPLUS) += hawk_common.o open_pic.o i8259.o \
73 indirect_pci.o todc_time.o pci_auto.o 66 indirect_pci.o todc_time.o pci_auto.o
@@ -80,7 +73,8 @@ obj-$(CONFIG_SANDPOINT) += i8259.o pci_auto.o todc_time.o
80obj-$(CONFIG_SBC82xx) += todc_time.o 73obj-$(CONFIG_SBC82xx) += todc_time.o
81obj-$(CONFIG_SPRUCE) += cpc700_pic.o indirect_pci.o pci_auto.o \ 74obj-$(CONFIG_SPRUCE) += cpc700_pic.o indirect_pci.o pci_auto.o \
82 todc_time.o 75 todc_time.o
83obj-$(CONFIG_8260) += m8260_setup.o 76obj-$(CONFIG_8260) += m8260_setup.o pq2_devices.o pq2_sys.o \
77 ppc_sys.o
84obj-$(CONFIG_PCI_8260) += m82xx_pci.o indirect_pci.o pci_auto.o 78obj-$(CONFIG_PCI_8260) += m82xx_pci.o indirect_pci.o pci_auto.o
85obj-$(CONFIG_8260_PCI9) += m8260_pci_erratum9.o 79obj-$(CONFIG_8260_PCI9) += m8260_pci_erratum9.o
86obj-$(CONFIG_CPM2) += cpm2_common.o cpm2_pic.o 80obj-$(CONFIG_CPM2) += cpm2_common.o cpm2_pic.o
diff --git a/arch/ppc/syslib/cpm2_common.c b/arch/ppc/syslib/cpm2_common.c
index 4c19a4ac7163..cbac44b1620c 100644
--- a/arch/ppc/syslib/cpm2_common.c
+++ b/arch/ppc/syslib/cpm2_common.c
@@ -27,7 +27,6 @@
27#include <asm/mpc8260.h> 27#include <asm/mpc8260.h>
28#include <asm/page.h> 28#include <asm/page.h>
29#include <asm/pgtable.h> 29#include <asm/pgtable.h>
30#include <asm/immap_cpm2.h>
31#include <asm/cpm2.h> 30#include <asm/cpm2.h>
32#include <asm/rheap.h> 31#include <asm/rheap.h>
33 32
diff --git a/arch/ppc/syslib/ibm440gx_common.c b/arch/ppc/syslib/ibm440gx_common.c
index 4ad85e0e0234..d4776af6a3ca 100644
--- a/arch/ppc/syslib/ibm440gx_common.c
+++ b/arch/ppc/syslib/ibm440gx_common.c
@@ -34,6 +34,10 @@ void __init ibm440gx_get_clocks(struct ibm44x_clocks* p, unsigned int sys_clk,
34 u32 plld = CPR_READ(DCRN_CPR_PLLD); 34 u32 plld = CPR_READ(DCRN_CPR_PLLD);
35 u32 uart0 = SDR_READ(DCRN_SDR_UART0); 35 u32 uart0 = SDR_READ(DCRN_SDR_UART0);
36 u32 uart1 = SDR_READ(DCRN_SDR_UART1); 36 u32 uart1 = SDR_READ(DCRN_SDR_UART1);
37#ifdef CONFIG_440EP
38 u32 uart2 = SDR_READ(DCRN_SDR_UART2);
39 u32 uart3 = SDR_READ(DCRN_SDR_UART3);
40#endif
37 41
38 /* Dividers */ 42 /* Dividers */
39 u32 fbdv = __fix_zero((plld >> 24) & 0x1f, 32); 43 u32 fbdv = __fix_zero((plld >> 24) & 0x1f, 32);
@@ -96,6 +100,17 @@ bypass:
96 p->uart1 = ser_clk; 100 p->uart1 = ser_clk;
97 else 101 else
98 p->uart1 = p->plb / __fix_zero(uart1 & 0xff, 256); 102 p->uart1 = p->plb / __fix_zero(uart1 & 0xff, 256);
103#ifdef CONFIG_440EP
104 if (uart2 & 0x00800000)
105 p->uart2 = ser_clk;
106 else
107 p->uart2 = p->plb / __fix_zero(uart2 & 0xff, 256);
108
109 if (uart3 & 0x00800000)
110 p->uart3 = ser_clk;
111 else
112 p->uart3 = p->plb / __fix_zero(uart3 & 0xff, 256);
113#endif
99} 114}
100 115
101/* Issue L2C diagnostic command */ 116/* Issue L2C diagnostic command */
diff --git a/arch/ppc/syslib/ibm44x_common.h b/arch/ppc/syslib/ibm44x_common.h
index b14eb603ce01..c16b6a5ac6ab 100644
--- a/arch/ppc/syslib/ibm44x_common.h
+++ b/arch/ppc/syslib/ibm44x_common.h
@@ -29,6 +29,10 @@ struct ibm44x_clocks {
29 unsigned int ebc; /* PerClk */ 29 unsigned int ebc; /* PerClk */
30 unsigned int uart0; 30 unsigned int uart0;
31 unsigned int uart1; 31 unsigned int uart1;
32#ifdef CONFIG_440EP
33 unsigned int uart2;
34 unsigned int uart3;
35#endif
32}; 36};
33 37
34/* common 44x platform init */ 38/* common 44x platform init */
diff --git a/arch/ppc/syslib/m8260_setup.c b/arch/ppc/syslib/m8260_setup.c
index fda75d79050c..8f80a42dfdb7 100644
--- a/arch/ppc/syslib/m8260_setup.c
+++ b/arch/ppc/syslib/m8260_setup.c
@@ -24,7 +24,7 @@
24#include <asm/io.h> 24#include <asm/io.h>
25#include <asm/pgtable.h> 25#include <asm/pgtable.h>
26#include <asm/mpc8260.h> 26#include <asm/mpc8260.h>
27#include <asm/immap_cpm2.h> 27#include <asm/cpm2.h>
28#include <asm/machdep.h> 28#include <asm/machdep.h>
29#include <asm/bootinfo.h> 29#include <asm/bootinfo.h>
30#include <asm/time.h> 30#include <asm/time.h>
@@ -33,7 +33,6 @@
33 33
34unsigned char __res[sizeof(bd_t)]; 34unsigned char __res[sizeof(bd_t)];
35 35
36extern void cpm2_reset(void);
37extern void pq2_find_bridges(void); 36extern void pq2_find_bridges(void);
38extern void pq2pci_init_irq(void); 37extern void pq2pci_init_irq(void);
39extern void idma_pci9_init(void); 38extern void idma_pci9_init(void);
diff --git a/arch/ppc/syslib/m82xx_pci.c b/arch/ppc/syslib/m82xx_pci.c
index 5e7a7edcea74..9db58c587b46 100644
--- a/arch/ppc/syslib/m82xx_pci.c
+++ b/arch/ppc/syslib/m82xx_pci.c
@@ -238,9 +238,9 @@ pq2ads_setup_pci(struct pci_controller *hose)
238 * Setting required to enable IRQ1-IRQ7 (SIUMCR [DPPC]), 238 * Setting required to enable IRQ1-IRQ7 (SIUMCR [DPPC]),
239 * and local bus for PCI (SIUMCR [LBPC]). 239 * and local bus for PCI (SIUMCR [LBPC]).
240 */ 240 */
241 immap->im_siu_conf.siu_82xx.sc_siumcr = (immap->im_siu_conf.sc_siumcr & 241 immap->im_siu_conf.siu_82xx.sc_siumcr = (immap->im_siu_conf.siu_82xx.sc_siumcr &
242 ~(SIUMCR_L2PC11 | SIUMCR_LBPC11 | SIUMCR_CS10PC11 | SIUMCR_APPC11) | 242 ~(SIUMCR_L2CPC11 | SIUMCR_LBPC11 | SIUMCR_CS10PC11 | SIUMCR_APPC11) |
243 SIUMCR_BBD | SIUMCR_LBPC01 | SIUMCR_DPPC11 | SIUMCR_APPC10; 243 SIUMCR_BBD | SIUMCR_LBPC01 | SIUMCR_DPPC11 | SIUMCR_APPC10);
244#endif 244#endif
245 /* Enable PCI */ 245 /* Enable PCI */
246 immap->im_pci.pci_gcr = cpu_to_le32(PCIGCR_PCI_BUS_EN); 246 immap->im_pci.pci_gcr = cpu_to_le32(PCIGCR_PCI_BUS_EN);
diff --git a/arch/ppc/syslib/m8xx_setup.c b/arch/ppc/syslib/m8xx_setup.c
index c1db2ab1d154..4c888da89b3c 100644
--- a/arch/ppc/syslib/m8xx_setup.c
+++ b/arch/ppc/syslib/m8xx_setup.c
@@ -57,7 +57,7 @@ unsigned char __res[sizeof(bd_t)];
57extern void m8xx_ide_init(void); 57extern void m8xx_ide_init(void);
58 58
59extern unsigned long find_available_memory(void); 59extern unsigned long find_available_memory(void);
60extern void m8xx_cpm_reset(uint cpm_page); 60extern void m8xx_cpm_reset(void);
61extern void m8xx_wdt_handler_install(bd_t *bp); 61extern void m8xx_wdt_handler_install(bd_t *bp);
62extern void rpxfb_alloc_pages(void); 62extern void rpxfb_alloc_pages(void);
63extern void cpm_interrupt_init(void); 63extern void cpm_interrupt_init(void);
@@ -70,13 +70,9 @@ board_init(void)
70void __init 70void __init
71m8xx_setup_arch(void) 71m8xx_setup_arch(void)
72{ 72{
73 int cpm_page;
74
75 cpm_page = (int) alloc_bootmem_pages(PAGE_SIZE);
76
77 /* Reset the Communication Processor Module. 73 /* Reset the Communication Processor Module.
78 */ 74 */
79 m8xx_cpm_reset(cpm_page); 75 m8xx_cpm_reset();
80 76
81#ifdef CONFIG_FB_RPX 77#ifdef CONFIG_FB_RPX
82 rpxfb_alloc_pages(); 78 rpxfb_alloc_pages();
@@ -270,8 +266,8 @@ m8xx_show_percpuinfo(struct seq_file *m, int i)
270 266
271 bp = (bd_t *)__res; 267 bp = (bd_t *)__res;
272 268
273 seq_printf(m, "clock\t\t: %ldMHz\n" 269 seq_printf(m, "clock\t\t: %uMHz\n"
274 "bus clock\t: %ldMHz\n", 270 "bus clock\t: %uMHz\n",
275 bp->bi_intfreq / 1000000, 271 bp->bi_intfreq / 1000000,
276 bp->bi_busfreq / 1000000); 272 bp->bi_busfreq / 1000000);
277 273
@@ -427,7 +423,7 @@ platform_init(unsigned long r3, unsigned long r4, unsigned long r5,
427 ppc_md.find_end_of_memory = m8xx_find_end_of_memory; 423 ppc_md.find_end_of_memory = m8xx_find_end_of_memory;
428 ppc_md.setup_io_mappings = m8xx_map_io; 424 ppc_md.setup_io_mappings = m8xx_map_io;
429 425
430#if defined(CONFIG_BLK_DEV_IDE) || defined(CONFIG_BLK_DEV_IDE_MODULE) 426#if defined(CONFIG_BLK_DEV_MPC8xx_IDE)
431 m8xx_ide_init(); 427 m8xx_ide_init();
432#endif 428#endif
433} 429}
diff --git a/arch/ppc/syslib/mpc10x_common.c b/arch/ppc/syslib/mpc10x_common.c
index 8fc5f4154521..87065e2e4c5f 100644
--- a/arch/ppc/syslib/mpc10x_common.c
+++ b/arch/ppc/syslib/mpc10x_common.c
@@ -45,24 +45,29 @@
45#define MPC10X_DMA0_IRQ (EPIC_IRQ_BASE + 1 + NUM_8259_INTERRUPTS) 45#define MPC10X_DMA0_IRQ (EPIC_IRQ_BASE + 1 + NUM_8259_INTERRUPTS)
46#define MPC10X_DMA1_IRQ (EPIC_IRQ_BASE + 2 + NUM_8259_INTERRUPTS) 46#define MPC10X_DMA1_IRQ (EPIC_IRQ_BASE + 2 + NUM_8259_INTERRUPTS)
47#define MPC10X_UART0_IRQ (EPIC_IRQ_BASE + 4 + NUM_8259_INTERRUPTS) 47#define MPC10X_UART0_IRQ (EPIC_IRQ_BASE + 4 + NUM_8259_INTERRUPTS)
48#define MPC10X_UART1_IRQ (EPIC_IRQ_BASE + 5 + NUM_8259_INTERRUPTS)
48#else 49#else
49#define MPC10X_I2C_IRQ -1 50#define MPC10X_I2C_IRQ -1
50#define MPC10X_DMA0_IRQ -1 51#define MPC10X_DMA0_IRQ -1
51#define MPC10X_DMA1_IRQ -1 52#define MPC10X_DMA1_IRQ -1
52#define MPC10X_UART0_IRQ -1 53#define MPC10X_UART0_IRQ -1
54#define MPC10X_UART1_IRQ -1
53#endif 55#endif
54 56
55static struct fsl_i2c_platform_data mpc10x_i2c_pdata = { 57static struct fsl_i2c_platform_data mpc10x_i2c_pdata = {
56 .device_flags = 0, 58 .device_flags = 0,
57}; 59};
58 60
59static struct plat_serial8250_port serial_platform_data[] = { 61static struct plat_serial8250_port serial_plat_uart0[] = {
60 [0] = { 62 [0] = {
61 .mapbase = 0x4500, 63 .mapbase = 0x4500,
62 .iotype = UPIO_MEM, 64 .iotype = UPIO_MEM,
63 .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST, 65 .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST,
64 }, 66 },
65 [1] = { 67 { },
68};
69static struct plat_serial8250_port serial_plat_uart1[] = {
70 [0] = {
66 .mapbase = 0x4600, 71 .mapbase = 0x4600,
67 .iotype = UPIO_MEM, 72 .iotype = UPIO_MEM,
68 .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST, 73 .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST,
@@ -133,11 +138,17 @@ struct platform_device ppc_sys_platform_devices[] = {
133 }, 138 },
134 }, 139 },
135 }, 140 },
136 [MPC10X_DUART] = { 141 [MPC10X_UART0] = {
137 .name = "serial8250", 142 .name = "serial8250",
138 .id = 0, 143 .id = 0,
139 .dev.platform_data = serial_platform_data, 144 .dev.platform_data = serial_plat_uart0,
140 }, 145 },
146 [MPC10X_UART1] = {
147 .name = "serial8250",
148 .id = 1,
149 .dev.platform_data = serial_plat_uart1,
150 },
151
141}; 152};
142 153
143/* We use the PCI ID to match on */ 154/* We use the PCI ID to match on */
@@ -147,10 +158,10 @@ struct ppc_sys_spec ppc_sys_specs[] = {
147 .ppc_sys_name = "8245", 158 .ppc_sys_name = "8245",
148 .mask = 0xFFFFFFFF, 159 .mask = 0xFFFFFFFF,
149 .value = MPC10X_BRIDGE_8245, 160 .value = MPC10X_BRIDGE_8245,
150 .num_devices = 4, 161 .num_devices = 5,
151 .device_list = (enum ppc_sys_devices[]) 162 .device_list = (enum ppc_sys_devices[])
152 { 163 {
153 MPC10X_IIC1, MPC10X_DMA0, MPC10X_DMA1, MPC10X_DUART, 164 MPC10X_IIC1, MPC10X_DMA0, MPC10X_DMA1, MPC10X_UART0, MPC10X_UART1,
154 }, 165 },
155 }, 166 },
156 { 167 {
@@ -180,6 +191,25 @@ struct ppc_sys_spec ppc_sys_specs[] = {
180 }, 191 },
181}; 192};
182 193
194/*
195 * mach_mpc10x_fixup: This function enables DUART mode if it detects
196 * if it detects two UARTS in the platform device entries.
197 */
198static int __init mach_mpc10x_fixup(struct platform_device *pdev)
199{
200 if (strncmp (pdev->name, "serial8250", 10) == 0 && pdev->id == 1)
201 writeb(readb(serial_plat_uart1[0].membase + 0x11) | 0x1,
202 serial_plat_uart1[0].membase + 0x11);
203 return 0;
204}
205
206static int __init mach_mpc10x_init(void)
207{
208 ppc_sys_device_fixup = mach_mpc10x_fixup;
209 return 0;
210}
211postcore_initcall(mach_mpc10x_init);
212
183/* Set resources to match bridge memory map */ 213/* Set resources to match bridge memory map */
184void __init 214void __init
185mpc10x_bridge_set_resources(int map, struct pci_controller *hose) 215mpc10x_bridge_set_resources(int map, struct pci_controller *hose)
@@ -219,6 +249,7 @@ mpc10x_bridge_set_resources(int map, struct pci_controller *hose)
219 ppc_md.progress("mpc10x:exit1", 0x100); 249 ppc_md.progress("mpc10x:exit1", 0x100);
220 } 250 }
221} 251}
252
222/* 253/*
223 * Do some initialization and put the EUMB registers at the specified address 254 * Do some initialization and put the EUMB registers at the specified address
224 * (also map the EPIC registers into virtual space--OpenPIC_Addr will be set). 255 * (also map the EPIC registers into virtual space--OpenPIC_Addr will be set).
@@ -411,11 +442,13 @@ mpc10x_bridge_init(struct pci_controller *hose,
411 ppc_sys_platform_devices[MPC10X_DMA1].resource[1].start = MPC10X_DMA1_IRQ; 442 ppc_sys_platform_devices[MPC10X_DMA1].resource[1].start = MPC10X_DMA1_IRQ;
412 ppc_sys_platform_devices[MPC10X_DMA1].resource[1].end = MPC10X_DMA1_IRQ; 443 ppc_sys_platform_devices[MPC10X_DMA1].resource[1].end = MPC10X_DMA1_IRQ;
413 444
414 serial_platform_data[0].mapbase += phys_eumb_base; 445 serial_plat_uart0[0].mapbase += phys_eumb_base;
415 serial_platform_data[0].irq = MPC10X_UART0_IRQ; 446 serial_plat_uart0[0].irq = MPC10X_UART0_IRQ;
447 serial_plat_uart0[0].membase = ioremap(serial_plat_uart0[0].mapbase, 0x100);
416 448
417 serial_platform_data[1].mapbase += phys_eumb_base; 449 serial_plat_uart1[0].mapbase += phys_eumb_base;
418 serial_platform_data[1].irq = MPC10X_UART0_IRQ + 1; 450 serial_plat_uart1[0].irq = MPC10X_UART1_IRQ;
451 serial_plat_uart1[0].membase = ioremap(serial_plat_uart1[0].mapbase, 0x100);
419 452
420 /* 453 /*
421 * 8240 erratum 26, 8241/8245 erratum 29, 107 erratum 23: speculative 454 * 8240 erratum 26, 8241/8245 erratum 29, 107 erratum 23: speculative
diff --git a/arch/ppc/syslib/mpc83xx_devices.c b/arch/ppc/syslib/mpc83xx_devices.c
index 75c8e9834ae7..5aaf0e58e1f9 100644
--- a/arch/ppc/syslib/mpc83xx_devices.c
+++ b/arch/ppc/syslib/mpc83xx_devices.c
@@ -191,8 +191,8 @@ struct platform_device ppc_sys_platform_devices[] = {
191 .num_resources = 2, 191 .num_resources = 2,
192 .resource = (struct resource[]) { 192 .resource = (struct resource[]) {
193 { 193 {
194 .start = 0x22000, 194 .start = 0x23000,
195 .end = 0x22fff, 195 .end = 0x23fff,
196 .flags = IORESOURCE_MEM, 196 .flags = IORESOURCE_MEM,
197 }, 197 },
198 { 198 {
@@ -208,8 +208,8 @@ struct platform_device ppc_sys_platform_devices[] = {
208 .num_resources = 2, 208 .num_resources = 2,
209 .resource = (struct resource[]) { 209 .resource = (struct resource[]) {
210 { 210 {
211 .start = 0x23000, 211 .start = 0x22000,
212 .end = 0x23fff, 212 .end = 0x22fff,
213 .flags = IORESOURCE_MEM, 213 .flags = IORESOURCE_MEM,
214 }, 214 },
215 { 215 {
diff --git a/arch/ppc/syslib/mv64360_pic.c b/arch/ppc/syslib/mv64360_pic.c
index 74d8996418e9..8356da4678a2 100644
--- a/arch/ppc/syslib/mv64360_pic.c
+++ b/arch/ppc/syslib/mv64360_pic.c
@@ -366,10 +366,16 @@ mv64360_pci_error_int_handler(int irq, void *dev_id, struct pt_regs *regs)
366 return IRQ_HANDLED; 366 return IRQ_HANDLED;
367} 367}
368 368
369/*
370 * Bit 0 of MV64x60_PCIx_ERR_MASK does not exist on the 64360 and because of
371 * errata FEr-#11 and FEr-##16 for the 64460, it should be 0 on that chip as
372 * well. IOW, don't set bit 0.
373 */
374#define MV64360_PCI0_ERR_MASK_VAL 0x00a50c24
375
369static int __init 376static int __init
370mv64360_register_hdlrs(void) 377mv64360_register_hdlrs(void)
371{ 378{
372 u32 mask;
373 int rc; 379 int rc;
374 380
375 /* Clear old errors and register CPU interface error intr handler */ 381 /* Clear old errors and register CPU interface error intr handler */
@@ -387,17 +393,6 @@ mv64360_register_hdlrs(void)
387 mv64360_sram_error_int_handler,SA_INTERRUPT,SRAM_INTR_STR, 0))) 393 mv64360_sram_error_int_handler,SA_INTERRUPT,SRAM_INTR_STR, 0)))
388 printk(KERN_WARNING "Can't register SRAM error handler: %d",rc); 394 printk(KERN_WARNING "Can't register SRAM error handler: %d",rc);
389 395
390 /*
391 * Bit 0 reserved on 64360 and erratum FEr PCI-#11 (PCI internal
392 * data parity error set incorrectly) on rev 0 & 1 of 64460 requires
393 * bit 0 to be cleared.
394 */
395 mask = 0x00a50c24;
396
397 if ((mv64x60_get_bridge_type() == MV64x60_TYPE_MV64460) &&
398 (mv64x60_get_bridge_rev() > 1))
399 mask |= 0x1; /* enable DPErr on 64460 */
400
401 /* Clear old errors and register PCI 0 error intr handler */ 396 /* Clear old errors and register PCI 0 error intr handler */
402 mv64x60_write(&bh, MV64x60_PCI0_ERR_CAUSE, 0); 397 mv64x60_write(&bh, MV64x60_PCI0_ERR_CAUSE, 0);
403 if ((rc = request_irq(MV64360_IRQ_PCI0 + mv64360_irq_base, 398 if ((rc = request_irq(MV64360_IRQ_PCI0 + mv64360_irq_base,
@@ -407,7 +402,11 @@ mv64360_register_hdlrs(void)
407 rc); 402 rc);
408 403
409 mv64x60_write(&bh, MV64x60_PCI0_ERR_MASK, 0); 404 mv64x60_write(&bh, MV64x60_PCI0_ERR_MASK, 0);
410 mv64x60_write(&bh, MV64x60_PCI0_ERR_MASK, mask); 405 mv64x60_write(&bh, MV64x60_PCI0_ERR_MASK, MV64360_PCI0_ERR_MASK_VAL);
406
407 /* Erratum FEr PCI-#16 says to clear bit 0 of PCI SERRn Mask reg. */
408 mv64x60_write(&bh, MV64x60_PCI0_ERR_SERR_MASK,
409 mv64x60_read(&bh, MV64x60_PCI0_ERR_SERR_MASK) & ~0x1UL);
411 410
412 /* Clear old errors and register PCI 1 error intr handler */ 411 /* Clear old errors and register PCI 1 error intr handler */
413 mv64x60_write(&bh, MV64x60_PCI1_ERR_CAUSE, 0); 412 mv64x60_write(&bh, MV64x60_PCI1_ERR_CAUSE, 0);
@@ -418,7 +417,11 @@ mv64360_register_hdlrs(void)
418 rc); 417 rc);
419 418
420 mv64x60_write(&bh, MV64x60_PCI1_ERR_MASK, 0); 419 mv64x60_write(&bh, MV64x60_PCI1_ERR_MASK, 0);
421 mv64x60_write(&bh, MV64x60_PCI1_ERR_MASK, mask); 420 mv64x60_write(&bh, MV64x60_PCI1_ERR_MASK, MV64360_PCI0_ERR_MASK_VAL);
421
422 /* Erratum FEr PCI-#16 says to clear bit 0 of PCI Intr Mask reg. */
423 mv64x60_write(&bh, MV64x60_PCI1_ERR_SERR_MASK,
424 mv64x60_read(&bh, MV64x60_PCI1_ERR_SERR_MASK) & ~0x1UL);
422 425
423 return 0; 426 return 0;
424} 427}
diff --git a/arch/ppc/syslib/mv64x60.c b/arch/ppc/syslib/mv64x60.c
index cc77177fa1c6..6262b11f366f 100644
--- a/arch/ppc/syslib/mv64x60.c
+++ b/arch/ppc/syslib/mv64x60.c
@@ -30,13 +30,16 @@
30#include <asm/mv64x60.h> 30#include <asm/mv64x60.h>
31 31
32 32
33u8 mv64x60_pci_exclude_bridge = 1; 33u8 mv64x60_pci_exclude_bridge = 1;
34spinlock_t mv64x60_lock = SPIN_LOCK_UNLOCKED; 34spinlock_t mv64x60_lock = SPIN_LOCK_UNLOCKED;
35 35
36static phys_addr_t mv64x60_bridge_pbase = 0; 36static phys_addr_t mv64x60_bridge_pbase;
37static void *mv64x60_bridge_vbase = 0; 37static void *mv64x60_bridge_vbase;
38static u32 mv64x60_bridge_type = MV64x60_TYPE_INVALID; 38static u32 mv64x60_bridge_type = MV64x60_TYPE_INVALID;
39static u32 mv64x60_bridge_rev = 0; 39static u32 mv64x60_bridge_rev;
40#if defined(CONFIG_SYSFS) && !defined(CONFIG_GT64260)
41static struct pci_controller sysfs_hose_a;
42#endif
40 43
41static u32 gt64260_translate_size(u32 base, u32 size, u32 num_bits); 44static u32 gt64260_translate_size(u32 base, u32 size, u32 num_bits);
42static u32 gt64260_untranslate_size(u32 base, u32 size, u32 num_bits); 45static u32 gt64260_untranslate_size(u32 base, u32 size, u32 num_bits);
@@ -432,6 +435,20 @@ static struct platform_device i2c_device = {
432}; 435};
433#endif 436#endif
434 437
438#if defined(CONFIG_SYSFS) && !defined(CONFIG_GT64260)
439static struct mv64xxx_pdata mv64xxx_pdata = {
440 .hs_reg_valid = 0,
441};
442
443static struct platform_device mv64xxx_device = { /* general mv64x60 stuff */
444 .name = MV64XXX_DEV_NAME,
445 .id = 0,
446 .dev = {
447 .platform_data = &mv64xxx_pdata,
448 },
449};
450#endif
451
435static struct platform_device *mv64x60_pd_devs[] __initdata = { 452static struct platform_device *mv64x60_pd_devs[] __initdata = {
436#ifdef CONFIG_SERIAL_MPSC 453#ifdef CONFIG_SERIAL_MPSC
437 &mpsc_shared_device, 454 &mpsc_shared_device,
@@ -453,6 +470,9 @@ static struct platform_device *mv64x60_pd_devs[] __initdata = {
453#ifdef CONFIG_I2C_MV64XXX 470#ifdef CONFIG_I2C_MV64XXX
454 &i2c_device, 471 &i2c_device,
455#endif 472#endif
473#if defined(CONFIG_SYSFS) && !defined(CONFIG_GT64260)
474 &mv64xxx_device,
475#endif
456}; 476};
457 477
458/* 478/*
@@ -574,6 +594,11 @@ mv64x60_early_init(struct mv64x60_handle *bh, struct mv64x60_setup_info *si)
574 bh->hose_a = &hose_a; 594 bh->hose_a = &hose_a;
575 bh->hose_b = &hose_b; 595 bh->hose_b = &hose_b;
576 596
597#if defined(CONFIG_SYSFS) && !defined(CONFIG_GT64260)
598 /* Save a copy of hose_a for sysfs functions -- hack */
599 memcpy(&sysfs_hose_a, &hose_a, sizeof(hose_a));
600#endif
601
577 mv64x60_set_bus(bh, 0, 0); 602 mv64x60_set_bus(bh, 0, 0);
578 mv64x60_set_bus(bh, 1, 0); 603 mv64x60_set_bus(bh, 1, 0);
579 604
@@ -590,8 +615,6 @@ mv64x60_early_init(struct mv64x60_handle *bh, struct mv64x60_setup_info *si)
590 615
591 mv64x60_set_bits(bh, MV64x60_PCI0_TO_RETRY, 0xffff); 616 mv64x60_set_bits(bh, MV64x60_PCI0_TO_RETRY, 0xffff);
592 mv64x60_set_bits(bh, MV64x60_PCI1_TO_RETRY, 0xffff); 617 mv64x60_set_bits(bh, MV64x60_PCI1_TO_RETRY, 0xffff);
593
594 return;
595} 618}
596 619
597/* 620/*
@@ -628,19 +651,15 @@ mv64x60_get_32bit_window(struct mv64x60_handle *bh, u32 window,
628 val = mv64x60_read(bh, size_reg); 651 val = mv64x60_read(bh, size_reg);
629 val = get_from_field(val, size_bits); 652 val = get_from_field(val, size_bits);
630 *size = bh->ci->untranslate_size(*base, val, size_bits); 653 *size = bh->ci->untranslate_size(*base, val, size_bits);
631 } 654 } else
632 else
633 *size = 0; 655 *size = 0;
634 } 656 } else {
635 else {
636 *base = 0; 657 *base = 0;
637 *size = 0; 658 *size = 0;
638 } 659 }
639 660
640 pr_debug("get 32bit window: %d, base: 0x%x, size: 0x%x\n", 661 pr_debug("get 32bit window: %d, base: 0x%x, size: 0x%x\n",
641 window, *base, *size); 662 window, *base, *size);
642
643 return;
644} 663}
645 664
646/* 665/*
@@ -677,8 +696,6 @@ mv64x60_set_32bit_window(struct mv64x60_handle *bh, u32 window,
677 696
678 (void)mv64x60_read(bh, base_reg); /* Flush FIFO */ 697 (void)mv64x60_read(bh, base_reg); /* Flush FIFO */
679 } 698 }
680
681 return;
682} 699}
683 700
684/* 701/*
@@ -712,11 +729,9 @@ mv64x60_get_64bit_window(struct mv64x60_handle *bh, u32 window,
712 val = get_from_field(val, size_bits); 729 val = get_from_field(val, size_bits);
713 *size = bh->ci->untranslate_size(*base_lo, val, 730 *size = bh->ci->untranslate_size(*base_lo, val,
714 size_bits); 731 size_bits);
715 } 732 } else
716 else
717 *size = 0; 733 *size = 0;
718 } 734 } else {
719 else {
720 *base_hi = 0; 735 *base_hi = 0;
721 *base_lo = 0; 736 *base_lo = 0;
722 *size = 0; 737 *size = 0;
@@ -724,8 +739,6 @@ mv64x60_get_64bit_window(struct mv64x60_handle *bh, u32 window,
724 739
725 pr_debug("get 64bit window: %d, base hi: 0x%x, base lo: 0x%x, " 740 pr_debug("get 64bit window: %d, base hi: 0x%x, base lo: 0x%x, "
726 "size: 0x%x\n", window, *base_hi, *base_lo, *size); 741 "size: 0x%x\n", window, *base_hi, *base_lo, *size);
727
728 return;
729} 742}
730 743
731/* 744/*
@@ -766,8 +779,6 @@ mv64x60_set_64bit_window(struct mv64x60_handle *bh, u32 window,
766 779
767 (void)mv64x60_read(bh, base_lo_reg); /* Flush FIFO */ 780 (void)mv64x60_read(bh, base_lo_reg); /* Flush FIFO */
768 } 781 }
769
770 return;
771} 782}
772 783
773/* 784/*
@@ -1008,8 +1019,6 @@ mv64x60_get_mem_windows(struct mv64x60_handle *bh,
1008 mem_windows[i][0] = 0; 1019 mem_windows[i][0] = 0;
1009 mem_windows[i][1] = 0; 1020 mem_windows[i][1] = 0;
1010 } 1021 }
1011
1012 return;
1013} 1022}
1014 1023
1015/* 1024/*
@@ -1077,8 +1086,6 @@ mv64x60_config_cpu2mem_windows(struct mv64x60_handle *bh,
1077 } 1086 }
1078 1087
1079 } 1088 }
1080
1081 return;
1082} 1089}
1083 1090
1084/* 1091/*
@@ -1112,8 +1119,7 @@ mv64x60_config_cpu2pci_windows(struct mv64x60_handle *bh,
1112 mv64x60_set_32bit_window(bh, remap_tab[bus][0], 1119 mv64x60_set_32bit_window(bh, remap_tab[bus][0],
1113 pi->pci_io.pci_base_lo, 0, 0); 1120 pi->pci_io.pci_base_lo, 0, 0);
1114 bh->ci->enable_window_32bit(bh, win_tab[bus][0]); 1121 bh->ci->enable_window_32bit(bh, win_tab[bus][0]);
1115 } 1122 } else /* Actually, the window should already be disabled */
1116 else /* Actually, the window should already be disabled */
1117 bh->ci->disable_window_32bit(bh, win_tab[bus][0]); 1123 bh->ci->disable_window_32bit(bh, win_tab[bus][0]);
1118 1124
1119 for (i=0; i<3; i++) 1125 for (i=0; i<3; i++)
@@ -1125,11 +1131,8 @@ mv64x60_config_cpu2pci_windows(struct mv64x60_handle *bh,
1125 pi->pci_mem[i].pci_base_hi, 1131 pi->pci_mem[i].pci_base_hi,
1126 pi->pci_mem[i].pci_base_lo, 0, 0); 1132 pi->pci_mem[i].pci_base_lo, 0, 0);
1127 bh->ci->enable_window_32bit(bh, win_tab[bus][i+1]); 1133 bh->ci->enable_window_32bit(bh, win_tab[bus][i+1]);
1128 } 1134 } else /* Actually, the window should already be disabled */
1129 else /* Actually, the window should already be disabled */
1130 bh->ci->disable_window_32bit(bh, win_tab[bus][i+1]); 1135 bh->ci->disable_window_32bit(bh, win_tab[bus][i+1]);
1131
1132 return;
1133} 1136}
1134 1137
1135/* 1138/*
@@ -1206,8 +1209,6 @@ mv64x60_config_pci2mem_windows(struct mv64x60_handle *bh,
1206 MV64x60_PCI0_BAR_ENABLE : 1209 MV64x60_PCI0_BAR_ENABLE :
1207 MV64x60_PCI1_BAR_ENABLE), (1 << i)); 1210 MV64x60_PCI1_BAR_ENABLE), (1 << i));
1208 } 1211 }
1209
1210 return;
1211} 1212}
1212 1213
1213/* 1214/*
@@ -1229,7 +1230,6 @@ mv64x60_alloc_hose(struct mv64x60_handle *bh, u32 cfg_addr, u32 cfg_data,
1229 *hose = pcibios_alloc_controller(); 1230 *hose = pcibios_alloc_controller();
1230 setup_indirect_pci_nomap(*hose, bh->v_base + cfg_addr, 1231 setup_indirect_pci_nomap(*hose, bh->v_base + cfg_addr,
1231 bh->v_base + cfg_data); 1232 bh->v_base + cfg_data);
1232 return;
1233} 1233}
1234 1234
1235/* 1235/*
@@ -1272,7 +1272,6 @@ mv64x60_config_resources(struct pci_controller *hose,
1272 pi->pci_mem[0].size - 1; 1272 pi->pci_mem[0].size - 1;
1273 hose->pci_mem_offset = pi->pci_mem[0].cpu_base - 1273 hose->pci_mem_offset = pi->pci_mem[0].cpu_base -
1274 pi->pci_mem[0].pci_base_lo; 1274 pi->pci_mem[0].pci_base_lo;
1275 return;
1276} 1275}
1277 1276
1278/* 1277/*
@@ -1309,7 +1308,6 @@ mv64x60_config_pci_params(struct pci_controller *hose,
1309 early_write_config_word(hose, 0, devfn, PCI_CACHE_LINE_SIZE, u16_val); 1308 early_write_config_word(hose, 0, devfn, PCI_CACHE_LINE_SIZE, u16_val);
1310 1309
1311 mv64x60_pci_exclude_bridge = save_exclude; 1310 mv64x60_pci_exclude_bridge = save_exclude;
1312 return;
1313} 1311}
1314 1312
1315/* 1313/*
@@ -1336,8 +1334,7 @@ mv64x60_set_bus(struct mv64x60_handle *bh, u32 bus, u32 child_bus)
1336 p2p_cfg = MV64x60_PCI0_P2P_CONFIG; 1334 p2p_cfg = MV64x60_PCI0_P2P_CONFIG;
1337 pci_cfg_offset = 0x64; 1335 pci_cfg_offset = 0x64;
1338 hose = bh->hose_a; 1336 hose = bh->hose_a;
1339 } 1337 } else {
1340 else {
1341 pci_mode = bh->pci_mode_b; 1338 pci_mode = bh->pci_mode_b;
1342 p2p_cfg = MV64x60_PCI1_P2P_CONFIG; 1339 p2p_cfg = MV64x60_PCI1_P2P_CONFIG;
1343 pci_cfg_offset = 0xe4; 1340 pci_cfg_offset = 0xe4;
@@ -1352,8 +1349,7 @@ mv64x60_set_bus(struct mv64x60_handle *bh, u32 bus, u32 child_bus)
1352 val |= (child_bus << 16) | 0xff; 1349 val |= (child_bus << 16) | 0xff;
1353 mv64x60_write(bh, p2p_cfg, val); 1350 mv64x60_write(bh, p2p_cfg, val);
1354 (void)mv64x60_read(bh, p2p_cfg); /* Flush FIFO */ 1351 (void)mv64x60_read(bh, p2p_cfg); /* Flush FIFO */
1355 } 1352 } else { /* PCI-X */
1356 else { /* PCI-X */
1357 /* 1353 /*
1358 * Need to use the current bus/dev number (that's in the 1354 * Need to use the current bus/dev number (that's in the
1359 * P2P CONFIG reg) to access the bridge's pci config space. 1355 * P2P CONFIG reg) to access the bridge's pci config space.
@@ -1365,8 +1361,6 @@ mv64x60_set_bus(struct mv64x60_handle *bh, u32 bus, u32 child_bus)
1365 pci_cfg_offset, child_bus << 8); 1361 pci_cfg_offset, child_bus << 8);
1366 mv64x60_pci_exclude_bridge = save_exclude; 1362 mv64x60_pci_exclude_bridge = save_exclude;
1367 } 1363 }
1368
1369 return;
1370} 1364}
1371 1365
1372/* 1366/*
@@ -1423,8 +1417,6 @@ mv64x60_pd_fixup(struct mv64x60_handle *bh, struct platform_device *pd_devs[],
1423 j++; 1417 j++;
1424 } 1418 }
1425 } 1419 }
1426
1427 return;
1428} 1420}
1429 1421
1430/* 1422/*
@@ -1498,8 +1490,6 @@ gt64260_set_pci2mem_window(struct pci_controller *hose, u32 bus, u32 window,
1498 early_write_config_dword(hose, 0, PCI_DEVFN(0, 0), 1490 early_write_config_dword(hose, 0, PCI_DEVFN(0, 0),
1499 gt64260_reg_addrs[bus][window], mv64x60_mask(base, 20) | 0x8); 1491 gt64260_reg_addrs[bus][window], mv64x60_mask(base, 20) | 0x8);
1500 mv64x60_pci_exclude_bridge = save_exclude; 1492 mv64x60_pci_exclude_bridge = save_exclude;
1501
1502 return;
1503} 1493}
1504 1494
1505/* 1495/*
@@ -1523,8 +1513,6 @@ gt64260_set_pci2regs_window(struct mv64x60_handle *bh,
1523 early_write_config_dword(hose, 0, PCI_DEVFN(0,0), gt64260_offset[bus], 1513 early_write_config_dword(hose, 0, PCI_DEVFN(0,0), gt64260_offset[bus],
1524 (base << 16)); 1514 (base << 16));
1525 mv64x60_pci_exclude_bridge = save_exclude; 1515 mv64x60_pci_exclude_bridge = save_exclude;
1526
1527 return;
1528} 1516}
1529 1517
1530/* 1518/*
@@ -1561,7 +1549,6 @@ static void __init
1561gt64260_enable_window_32bit(struct mv64x60_handle *bh, u32 window) 1549gt64260_enable_window_32bit(struct mv64x60_handle *bh, u32 window)
1562{ 1550{
1563 pr_debug("enable 32bit window: %d\n", window); 1551 pr_debug("enable 32bit window: %d\n", window);
1564 return;
1565} 1552}
1566 1553
1567/* 1554/*
@@ -1584,8 +1571,6 @@ gt64260_disable_window_32bit(struct mv64x60_handle *bh, u32 window)
1584 mv64x60_write(bh, gt64260_32bit_windows[window].base_reg,0xfff); 1571 mv64x60_write(bh, gt64260_32bit_windows[window].base_reg,0xfff);
1585 mv64x60_write(bh, gt64260_32bit_windows[window].size_reg, 0); 1572 mv64x60_write(bh, gt64260_32bit_windows[window].size_reg, 0);
1586 } 1573 }
1587
1588 return;
1589} 1574}
1590 1575
1591/* 1576/*
@@ -1599,7 +1584,6 @@ static void __init
1599gt64260_enable_window_64bit(struct mv64x60_handle *bh, u32 window) 1584gt64260_enable_window_64bit(struct mv64x60_handle *bh, u32 window)
1600{ 1585{
1601 pr_debug("enable 64bit window: %d\n", window); 1586 pr_debug("enable 64bit window: %d\n", window);
1602 return; /* Enabled when window configured (i.e., when top >= base) */
1603} 1587}
1604 1588
1605/* 1589/*
@@ -1624,8 +1608,6 @@ gt64260_disable_window_64bit(struct mv64x60_handle *bh, u32 window)
1624 mv64x60_write(bh, gt64260_64bit_windows[window].base_hi_reg, 0); 1608 mv64x60_write(bh, gt64260_64bit_windows[window].base_hi_reg, 0);
1625 mv64x60_write(bh, gt64260_64bit_windows[window].size_reg, 0); 1609 mv64x60_write(bh, gt64260_64bit_windows[window].size_reg, 0);
1626 } 1610 }
1627
1628 return;
1629} 1611}
1630 1612
1631/* 1613/*
@@ -1712,8 +1694,6 @@ gt64260_disable_all_windows(struct mv64x60_handle *bh,
1712 mv64x60_write(bh, GT64260_IC_CPU_INT_1_MASK, 0); 1694 mv64x60_write(bh, GT64260_IC_CPU_INT_1_MASK, 0);
1713 mv64x60_write(bh, GT64260_IC_CPU_INT_2_MASK, 0); 1695 mv64x60_write(bh, GT64260_IC_CPU_INT_2_MASK, 0);
1714 mv64x60_write(bh, GT64260_IC_CPU_INT_3_MASK, 0); 1696 mv64x60_write(bh, GT64260_IC_CPU_INT_3_MASK, 0);
1715
1716 return;
1717} 1697}
1718 1698
1719/* 1699/*
@@ -1781,14 +1761,11 @@ gt64260a_chip_specific_init(struct mv64x60_handle *bh,
1781 mv64x60_mpsc1_pdata.cache_mgmt = 1; 1761 mv64x60_mpsc1_pdata.cache_mgmt = 1;
1782 1762
1783 if ((r = platform_get_resource(&mpsc1_device, IORESOURCE_IRQ, 0)) 1763 if ((r = platform_get_resource(&mpsc1_device, IORESOURCE_IRQ, 0))
1784 != NULL) { 1764 != NULL) {
1785
1786 r->start = MV64x60_IRQ_SDMA_0; 1765 r->start = MV64x60_IRQ_SDMA_0;
1787 r->end = MV64x60_IRQ_SDMA_0; 1766 r->end = MV64x60_IRQ_SDMA_0;
1788 } 1767 }
1789#endif 1768#endif
1790
1791 return;
1792} 1769}
1793 1770
1794/* 1771/*
@@ -1861,14 +1838,11 @@ gt64260b_chip_specific_init(struct mv64x60_handle *bh,
1861 mv64x60_mpsc1_pdata.cache_mgmt = 1; 1838 mv64x60_mpsc1_pdata.cache_mgmt = 1;
1862 1839
1863 if ((r = platform_get_resource(&mpsc1_device, IORESOURCE_IRQ, 0)) 1840 if ((r = platform_get_resource(&mpsc1_device, IORESOURCE_IRQ, 0))
1864 != NULL) { 1841 != NULL) {
1865
1866 r->start = MV64x60_IRQ_SDMA_0; 1842 r->start = MV64x60_IRQ_SDMA_0;
1867 r->end = MV64x60_IRQ_SDMA_0; 1843 r->end = MV64x60_IRQ_SDMA_0;
1868 } 1844 }
1869#endif 1845#endif
1870
1871 return;
1872} 1846}
1873 1847
1874/* 1848/*
@@ -1945,8 +1919,6 @@ mv64360_set_pci2mem_window(struct pci_controller *hose, u32 bus, u32 window,
1945 mv64360_reg_addrs[bus][window].base_lo_bar, 1919 mv64360_reg_addrs[bus][window].base_lo_bar,
1946 mv64x60_mask(base,20) | 0xc); 1920 mv64x60_mask(base,20) | 0xc);
1947 mv64x60_pci_exclude_bridge = save_exclude; 1921 mv64x60_pci_exclude_bridge = save_exclude;
1948
1949 return;
1950} 1922}
1951 1923
1952/* 1924/*
@@ -1972,8 +1944,6 @@ mv64360_set_pci2regs_window(struct mv64x60_handle *bh,
1972 early_write_config_dword(hose, 0, PCI_DEVFN(0,0), 1944 early_write_config_dword(hose, 0, PCI_DEVFN(0,0),
1973 mv64360_offset[bus][1], 0); 1945 mv64360_offset[bus][1], 0);
1974 mv64x60_pci_exclude_bridge = save_exclude; 1946 mv64x60_pci_exclude_bridge = save_exclude;
1975
1976 return;
1977} 1947}
1978 1948
1979/* 1949/*
@@ -2082,8 +2052,6 @@ mv64360_enable_window_32bit(struct mv64x60_handle *bh, u32 window)
2082 "32bit table corrupted"); 2052 "32bit table corrupted");
2083 } 2053 }
2084 } 2054 }
2085
2086 return;
2087} 2055}
2088 2056
2089/* 2057/*
@@ -2139,8 +2107,6 @@ mv64360_disable_window_32bit(struct mv64x60_handle *bh, u32 window)
2139 "32bit table corrupted"); 2107 "32bit table corrupted");
2140 } 2108 }
2141 } 2109 }
2142
2143 return;
2144} 2110}
2145 2111
2146/* 2112/*
@@ -2158,8 +2124,7 @@ mv64360_enable_window_64bit(struct mv64x60_handle *bh, u32 window)
2158 (mv64360_64bit_windows[window].size_reg != 0)) { 2124 (mv64360_64bit_windows[window].size_reg != 0)) {
2159 2125
2160 if ((mv64360_64bit_windows[window].extra & MV64x60_EXTRA_MASK) 2126 if ((mv64360_64bit_windows[window].extra & MV64x60_EXTRA_MASK)
2161 == MV64x60_EXTRA_PCIACC_ENAB) 2127 == MV64x60_EXTRA_PCIACC_ENAB)
2162
2163 mv64x60_set_bits(bh, 2128 mv64x60_set_bits(bh,
2164 mv64360_64bit_windows[window].base_lo_reg, 2129 mv64360_64bit_windows[window].base_lo_reg,
2165 (1 << (mv64360_64bit_windows[window].extra & 2130 (1 << (mv64360_64bit_windows[window].extra &
@@ -2168,8 +2133,6 @@ mv64360_enable_window_64bit(struct mv64x60_handle *bh, u32 window)
2168 printk(KERN_ERR "mv64360_enable: %s\n", 2133 printk(KERN_ERR "mv64360_enable: %s\n",
2169 "64bit table corrupted"); 2134 "64bit table corrupted");
2170 } 2135 }
2171
2172 return;
2173} 2136}
2174 2137
2175/* 2138/*
@@ -2186,11 +2149,9 @@ mv64360_disable_window_64bit(struct mv64x60_handle *bh, u32 window)
2186 mv64360_64bit_windows[window].size_reg); 2149 mv64360_64bit_windows[window].size_reg);
2187 2150
2188 if ((mv64360_64bit_windows[window].base_lo_reg != 0) && 2151 if ((mv64360_64bit_windows[window].base_lo_reg != 0) &&
2189 (mv64360_64bit_windows[window].size_reg != 0)) { 2152 (mv64360_64bit_windows[window].size_reg != 0)) {
2190
2191 if ((mv64360_64bit_windows[window].extra & MV64x60_EXTRA_MASK) 2153 if ((mv64360_64bit_windows[window].extra & MV64x60_EXTRA_MASK)
2192 == MV64x60_EXTRA_PCIACC_ENAB) 2154 == MV64x60_EXTRA_PCIACC_ENAB)
2193
2194 mv64x60_clr_bits(bh, 2155 mv64x60_clr_bits(bh,
2195 mv64360_64bit_windows[window].base_lo_reg, 2156 mv64360_64bit_windows[window].base_lo_reg,
2196 (1 << (mv64360_64bit_windows[window].extra & 2157 (1 << (mv64360_64bit_windows[window].extra &
@@ -2199,8 +2160,6 @@ mv64360_disable_window_64bit(struct mv64x60_handle *bh, u32 window)
2199 printk(KERN_ERR "mv64360_disable: %s\n", 2160 printk(KERN_ERR "mv64360_disable: %s\n",
2200 "64bit table corrupted"); 2161 "64bit table corrupted");
2201 } 2162 }
2202
2203 return;
2204} 2163}
2205 2164
2206/* 2165/*
@@ -2241,8 +2200,6 @@ mv64360_disable_all_windows(struct mv64x60_handle *bh,
2241 /* Disable all PCI-><whatever> windows */ 2200 /* Disable all PCI-><whatever> windows */
2242 mv64x60_set_bits(bh, MV64x60_PCI0_BAR_ENABLE, 0x0000f9ff); 2201 mv64x60_set_bits(bh, MV64x60_PCI0_BAR_ENABLE, 0x0000f9ff);
2243 mv64x60_set_bits(bh, MV64x60_PCI1_BAR_ENABLE, 0x0000f9ff); 2202 mv64x60_set_bits(bh, MV64x60_PCI1_BAR_ENABLE, 0x0000f9ff);
2244
2245 return;
2246} 2203}
2247 2204
2248/* 2205/*
@@ -2335,8 +2292,6 @@ mv64360_config_io2mem_windows(struct mv64x60_handle *bh,
2335 mv64x60_set_bits(bh, MV64360_IDMA2MEM_ACC_PROT_3, 2292 mv64x60_set_bits(bh, MV64360_IDMA2MEM_ACC_PROT_3,
2336 (0x3 << (i << 1))); 2293 (0x3 << (i << 1)));
2337 } 2294 }
2338
2339 return;
2340} 2295}
2341 2296
2342/* 2297/*
@@ -2350,42 +2305,145 @@ static void __init
2350mv64360_set_mpsc2regs_window(struct mv64x60_handle *bh, u32 base) 2305mv64360_set_mpsc2regs_window(struct mv64x60_handle *bh, u32 base)
2351{ 2306{
2352 pr_debug("set mpsc->internal regs, base: 0x%x\n", base); 2307 pr_debug("set mpsc->internal regs, base: 0x%x\n", base);
2353
2354 mv64x60_write(bh, MV64360_MPSC2REGS_BASE, base & 0xffff0000); 2308 mv64x60_write(bh, MV64360_MPSC2REGS_BASE, base & 0xffff0000);
2355 return;
2356} 2309}
2357 2310
2358/* 2311/*
2359 * mv64360_chip_specific_init() 2312 * mv64360_chip_specific_init()
2360 * 2313 *
2361 * No errata work arounds for the MV64360 implemented at this point. 2314 * Implement errata work arounds for the MV64360.
2362 */ 2315 */
2363static void __init 2316static void __init
2364mv64360_chip_specific_init(struct mv64x60_handle *bh, 2317mv64360_chip_specific_init(struct mv64x60_handle *bh,
2365 struct mv64x60_setup_info *si) 2318 struct mv64x60_setup_info *si)
2366{ 2319{
2320#if !defined(CONFIG_NOT_COHERENT_CACHE)
2321 mv64x60_set_bits(bh, MV64360_D_UNIT_CONTROL_HIGH, (1<<24));
2322#endif
2367#ifdef CONFIG_SERIAL_MPSC 2323#ifdef CONFIG_SERIAL_MPSC
2368 mv64x60_mpsc0_pdata.brg_can_tune = 1; 2324 mv64x60_mpsc0_pdata.brg_can_tune = 1;
2369 mv64x60_mpsc0_pdata.cache_mgmt = 1; 2325 mv64x60_mpsc0_pdata.cache_mgmt = 1;
2370 mv64x60_mpsc1_pdata.brg_can_tune = 1; 2326 mv64x60_mpsc1_pdata.brg_can_tune = 1;
2371 mv64x60_mpsc1_pdata.cache_mgmt = 1; 2327 mv64x60_mpsc1_pdata.cache_mgmt = 1;
2372#endif 2328#endif
2373
2374 return;
2375} 2329}
2376 2330
2377/* 2331/*
2378 * mv64460_chip_specific_init() 2332 * mv64460_chip_specific_init()
2379 * 2333 *
2380 * No errata work arounds for the MV64460 implemented at this point. 2334 * Implement errata work arounds for the MV64460.
2381 */ 2335 */
2382static void __init 2336static void __init
2383mv64460_chip_specific_init(struct mv64x60_handle *bh, 2337mv64460_chip_specific_init(struct mv64x60_handle *bh,
2384 struct mv64x60_setup_info *si) 2338 struct mv64x60_setup_info *si)
2385{ 2339{
2340#if !defined(CONFIG_NOT_COHERENT_CACHE)
2341 mv64x60_set_bits(bh, MV64360_D_UNIT_CONTROL_HIGH, (1<<24) | (1<<25));
2342 mv64x60_set_bits(bh, MV64460_D_UNIT_MMASK, (1<<1) | (1<<4));
2343#endif
2386#ifdef CONFIG_SERIAL_MPSC 2344#ifdef CONFIG_SERIAL_MPSC
2387 mv64x60_mpsc0_pdata.brg_can_tune = 1; 2345 mv64x60_mpsc0_pdata.brg_can_tune = 1;
2346 mv64x60_mpsc0_pdata.cache_mgmt = 1;
2388 mv64x60_mpsc1_pdata.brg_can_tune = 1; 2347 mv64x60_mpsc1_pdata.brg_can_tune = 1;
2348 mv64x60_mpsc1_pdata.cache_mgmt = 1;
2389#endif 2349#endif
2390 return;
2391} 2350}
2351
2352
2353#if defined(CONFIG_SYSFS) && !defined(CONFIG_GT64260)
2354/* Export the hotswap register via sysfs for enum event monitoring */
2355#define VAL_LEN_MAX 11 /* 32-bit hex or dec stringified number + '\n' */
2356
2357DECLARE_MUTEX(mv64xxx_hs_lock);
2358
2359static ssize_t
2360mv64xxx_hs_reg_read(struct kobject *kobj, char *buf, loff_t off, size_t count)
2361{
2362 u32 v;
2363 u8 save_exclude;
2364
2365 if (off > 0)
2366 return 0;
2367 if (count < VAL_LEN_MAX)
2368 return -EINVAL;
2369
2370 if (down_interruptible(&mv64xxx_hs_lock))
2371 return -ERESTARTSYS;
2372 save_exclude = mv64x60_pci_exclude_bridge;
2373 mv64x60_pci_exclude_bridge = 0;
2374 early_read_config_dword(&sysfs_hose_a, 0, PCI_DEVFN(0, 0),
2375 MV64360_PCICFG_CPCI_HOTSWAP, &v);
2376 mv64x60_pci_exclude_bridge = save_exclude;
2377 up(&mv64xxx_hs_lock);
2378
2379 return sprintf(buf, "0x%08x\n", v);
2380}
2381
2382static ssize_t
2383mv64xxx_hs_reg_write(struct kobject *kobj, char *buf, loff_t off, size_t count)
2384{
2385 u32 v;
2386 u8 save_exclude;
2387
2388 if (off > 0)
2389 return 0;
2390 if (count <= 0)
2391 return -EINVAL;
2392
2393 if (sscanf(buf, "%i", &v) == 1) {
2394 if (down_interruptible(&mv64xxx_hs_lock))
2395 return -ERESTARTSYS;
2396 save_exclude = mv64x60_pci_exclude_bridge;
2397 mv64x60_pci_exclude_bridge = 0;
2398 early_write_config_dword(&sysfs_hose_a, 0, PCI_DEVFN(0, 0),
2399 MV64360_PCICFG_CPCI_HOTSWAP, v);
2400 mv64x60_pci_exclude_bridge = save_exclude;
2401 up(&mv64xxx_hs_lock);
2402 }
2403 else
2404 count = -EINVAL;
2405
2406 return count;
2407}
2408
2409static struct bin_attribute mv64xxx_hs_reg_attr = { /* Hotswap register */
2410 .attr = {
2411 .name = "hs_reg",
2412 .mode = S_IRUGO | S_IWUSR,
2413 .owner = THIS_MODULE,
2414 },
2415 .size = VAL_LEN_MAX,
2416 .read = mv64xxx_hs_reg_read,
2417 .write = mv64xxx_hs_reg_write,
2418};
2419
2420/* Provide sysfs file indicating if this platform supports the hs_reg */
2421static ssize_t
2422mv64xxx_hs_reg_valid_show(struct device *dev, struct device_attribute *attr,
2423 char *buf)
2424{
2425 struct platform_device *pdev;
2426 struct mv64xxx_pdata *pdp;
2427 u32 v;
2428
2429 pdev = container_of(dev, struct platform_device, dev);
2430 pdp = (struct mv64xxx_pdata *)pdev->dev.platform_data;
2431
2432 if (down_interruptible(&mv64xxx_hs_lock))
2433 return -ERESTARTSYS;
2434 v = pdp->hs_reg_valid;
2435 up(&mv64xxx_hs_lock);
2436
2437 return sprintf(buf, "%i\n", v);
2438}
2439static DEVICE_ATTR(hs_reg_valid, S_IRUGO, mv64xxx_hs_reg_valid_show, NULL);
2440
2441static int __init
2442mv64xxx_sysfs_init(void)
2443{
2444 sysfs_create_bin_file(&mv64xxx_device.dev.kobj, &mv64xxx_hs_reg_attr);
2445 sysfs_create_file(&mv64xxx_device.dev.kobj,&dev_attr_hs_reg_valid.attr);
2446 return 0;
2447}
2448subsys_initcall(mv64xxx_sysfs_init);
2449#endif
diff --git a/arch/ppc/syslib/of_device.c b/arch/ppc/syslib/of_device.c
index 1eb4f726ca9f..da8a0f2128dc 100644
--- a/arch/ppc/syslib/of_device.c
+++ b/arch/ppc/syslib/of_device.c
@@ -105,7 +105,7 @@ static int of_device_remove(struct device *dev)
105 return 0; 105 return 0;
106} 106}
107 107
108static int of_device_suspend(struct device *dev, u32 state) 108static int of_device_suspend(struct device *dev, pm_message_t state)
109{ 109{
110 struct of_device * of_dev = to_of_device(dev); 110 struct of_device * of_dev = to_of_device(dev);
111 struct of_platform_driver * drv = to_of_platform_driver(dev->driver); 111 struct of_platform_driver * drv = to_of_platform_driver(dev->driver);
diff --git a/arch/ppc/syslib/open_pic.c b/arch/ppc/syslib/open_pic.c
index ad39b86ca92c..53da58523e39 100644
--- a/arch/ppc/syslib/open_pic.c
+++ b/arch/ppc/syslib/open_pic.c
@@ -948,7 +948,7 @@ static void openpic_cached_disable_irq(u_int irq)
948 * we need something better to deal with that... Maybe switch to S1 for 948 * we need something better to deal with that... Maybe switch to S1 for
949 * cpufreq changes 949 * cpufreq changes
950 */ 950 */
951int openpic_suspend(struct sys_device *sysdev, u32 state) 951int openpic_suspend(struct sys_device *sysdev, pm_message_t state)
952{ 952{
953 int i; 953 int i;
954 unsigned long flags; 954 unsigned long flags;
diff --git a/arch/ppc/syslib/ppc4xx_dma.c b/arch/ppc/syslib/ppc4xx_dma.c
index 5015ab99afd2..f15e64285f96 100644
--- a/arch/ppc/syslib/ppc4xx_dma.c
+++ b/arch/ppc/syslib/ppc4xx_dma.c
@@ -620,6 +620,7 @@ ppc4xx_clr_dma_status(unsigned int dmanr)
620 return DMA_STATUS_GOOD; 620 return DMA_STATUS_GOOD;
621} 621}
622 622
623#ifdef CONFIG_PPC4xx_EDMA
623/* 624/*
624 * Enables the burst on the channel (BTEN bit in the control/count register) 625 * Enables the burst on the channel (BTEN bit in the control/count register)
625 * Note: 626 * Note:
@@ -685,6 +686,11 @@ ppc4xx_set_burst_size(unsigned int dmanr, unsigned int bsize)
685 return DMA_STATUS_GOOD; 686 return DMA_STATUS_GOOD;
686} 687}
687 688
689EXPORT_SYMBOL(ppc4xx_enable_burst);
690EXPORT_SYMBOL(ppc4xx_disable_burst);
691EXPORT_SYMBOL(ppc4xx_set_burst_size);
692#endif /* CONFIG_PPC4xx_EDMA */
693
688EXPORT_SYMBOL(ppc4xx_init_dma_channel); 694EXPORT_SYMBOL(ppc4xx_init_dma_channel);
689EXPORT_SYMBOL(ppc4xx_get_channel_config); 695EXPORT_SYMBOL(ppc4xx_get_channel_config);
690EXPORT_SYMBOL(ppc4xx_set_channel_priority); 696EXPORT_SYMBOL(ppc4xx_set_channel_priority);
@@ -703,6 +709,4 @@ EXPORT_SYMBOL(ppc4xx_enable_dma_interrupt);
703EXPORT_SYMBOL(ppc4xx_disable_dma_interrupt); 709EXPORT_SYMBOL(ppc4xx_disable_dma_interrupt);
704EXPORT_SYMBOL(ppc4xx_get_dma_status); 710EXPORT_SYMBOL(ppc4xx_get_dma_status);
705EXPORT_SYMBOL(ppc4xx_clr_dma_status); 711EXPORT_SYMBOL(ppc4xx_clr_dma_status);
706EXPORT_SYMBOL(ppc4xx_enable_burst); 712
707EXPORT_SYMBOL(ppc4xx_disable_burst);
708EXPORT_SYMBOL(ppc4xx_set_burst_size);
diff --git a/arch/ppc/syslib/ppc4xx_setup.c b/arch/ppc/syslib/ppc4xx_setup.c
index e170aebeb69b..b843c4fef25e 100644
--- a/arch/ppc/syslib/ppc4xx_setup.c
+++ b/arch/ppc/syslib/ppc4xx_setup.c
@@ -48,10 +48,6 @@
48extern void abort(void); 48extern void abort(void);
49extern void ppc4xx_find_bridges(void); 49extern void ppc4xx_find_bridges(void);
50 50
51extern void ppc4xx_wdt_heartbeat(void);
52extern int wdt_enable;
53extern unsigned long wdt_period;
54
55/* Global Variables */ 51/* Global Variables */
56bd_t __res; 52bd_t __res;
57 53
@@ -171,7 +167,7 @@ ppc4xx_calibrate_decr(void)
171 unsigned int freq; 167 unsigned int freq;
172 bd_t *bip = &__res; 168 bd_t *bip = &__res;
173 169
174#if defined(CONFIG_WALNUT) || defined(CONFIG_ASH) || defined(CONFIG_SYCAMORE) 170#if defined(CONFIG_WALNUT) || defined(CONFIG_SYCAMORE)
175 /* Walnut boot rom sets DCR CHCR1 (aka CPC0_CR1) bit CETE to 1 */ 171 /* Walnut boot rom sets DCR CHCR1 (aka CPC0_CR1) bit CETE to 1 */
176 mtdcr(DCRN_CHCR1, mfdcr(DCRN_CHCR1) & ~CHR1_CETE); 172 mtdcr(DCRN_CHCR1, mfdcr(DCRN_CHCR1) & ~CHR1_CETE);
177#endif 173#endif
@@ -257,22 +253,6 @@ ppc4xx_init(unsigned long r3, unsigned long r4, unsigned long r5,
257 *(char *) (r7 + KERNELBASE) = 0; 253 *(char *) (r7 + KERNELBASE) = 0;
258 strcpy(cmd_line, (char *) (r6 + KERNELBASE)); 254 strcpy(cmd_line, (char *) (r6 + KERNELBASE));
259 } 255 }
260#if defined(CONFIG_PPC405_WDT)
261/* Look for wdt= option on command line */
262 if (strstr(cmd_line, "wdt=")) {
263 int valid_wdt = 0;
264 char *p, *q;
265 for (q = cmd_line; (p = strstr(q, "wdt=")) != 0;) {
266 q = p + 4;
267 if (p > cmd_line && p[-1] != ' ')
268 continue;
269 wdt_period = simple_strtoul(q, &q, 0);
270 valid_wdt = 1;
271 ++q;
272 }
273 wdt_enable = valid_wdt;
274 }
275#endif
276 256
277 /* Initialize machine-dependent vectors */ 257 /* Initialize machine-dependent vectors */
278 258
@@ -287,11 +267,6 @@ ppc4xx_init(unsigned long r3, unsigned long r4, unsigned long r5,
287 267
288 ppc_md.calibrate_decr = ppc4xx_calibrate_decr; 268 ppc_md.calibrate_decr = ppc4xx_calibrate_decr;
289 269
290#ifdef CONFIG_PPC405_WDT
291 ppc_md.heartbeat = ppc4xx_wdt_heartbeat;
292#endif
293 ppc_md.heartbeat_count = 0;
294
295 ppc_md.find_end_of_memory = ppc4xx_find_end_of_memory; 270 ppc_md.find_end_of_memory = ppc4xx_find_end_of_memory;
296 ppc_md.setup_io_mappings = ppc4xx_map_io; 271 ppc_md.setup_io_mappings = ppc4xx_map_io;
297 272
diff --git a/arch/ppc/syslib/ppc83xx_pci.h b/arch/ppc/syslib/ppc83xx_pci.h
new file mode 100644
index 000000000000..ec691640f6be
--- /dev/null
+++ b/arch/ppc/syslib/ppc83xx_pci.h
@@ -0,0 +1,151 @@
1/* Created by Tony Li <tony.li@freescale.com>
2 * Copyright (c) 2005 freescale semiconductor
3 *
4 * This program is free software; you can redistribute it and/or modify it
5 * under the terms of the GNU General Public License as published by the
6 * Free Software Foundation; either version 2 of the License, or (at your
7 * option) any later version.
8 *
9 * This program is distributed in the hope that it will be useful, but
10 * WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License along
15 * with this program; if not, write to the Free Software Foundation, Inc.,
16 * 675 Mass Ave, Cambridge, MA 02139, USA.
17 */
18
19#ifndef __PPC_SYSLIB_PPC83XX_PCI_H
20#define __PPC_SYSLIB_PPC83XX_PCI_H
21
22typedef struct immr_clk {
23 u32 spmr; /* system PLL mode Register */
24 u32 occr; /* output clock control Register */
25 u32 sccr; /* system clock control Register */
26 u8 res0[0xF4];
27} immr_clk_t;
28
29/*
30 * Sequencer
31 */
32typedef struct immr_ios {
33 u32 potar0;
34 u8 res0[4];
35 u32 pobar0;
36 u8 res1[4];
37 u32 pocmr0;
38 u8 res2[4];
39 u32 potar1;
40 u8 res3[4];
41 u32 pobar1;
42 u8 res4[4];
43 u32 pocmr1;
44 u8 res5[4];
45 u32 potar2;
46 u8 res6[4];
47 u32 pobar2;
48 u8 res7[4];
49 u32 pocmr2;
50 u8 res8[4];
51 u32 potar3;
52 u8 res9[4];
53 u32 pobar3;
54 u8 res10[4];
55 u32 pocmr3;
56 u8 res11[4];
57 u32 potar4;
58 u8 res12[4];
59 u32 pobar4;
60 u8 res13[4];
61 u32 pocmr4;
62 u8 res14[4];
63 u32 potar5;
64 u8 res15[4];
65 u32 pobar5;
66 u8 res16[4];
67 u32 pocmr5;
68 u8 res17[4];
69 u8 res18[0x60];
70 u32 pmcr;
71 u8 res19[4];
72 u32 dtcr;
73 u8 res20[4];
74} immr_ios_t;
75#define POTAR_TA_MASK 0x000fffff
76#define POBAR_BA_MASK 0x000fffff
77#define POCMR_EN 0x80000000
78#define POCMR_IO 0x40000000 /* 0--memory space 1--I/O space */
79#define POCMR_SE 0x20000000 /* streaming enable */
80#define POCMR_DST 0x10000000 /* 0--PCI1 1--PCI2 */
81#define POCMR_CM_MASK 0x000fffff
82
83/*
84 * PCI Controller Control and Status Registers
85 */
86typedef struct immr_pcictrl {
87 u32 esr;
88 u32 ecdr;
89 u32 eer;
90 u32 eatcr;
91 u32 eacr;
92 u32 eeacr;
93 u32 edlcr;
94 u32 edhcr;
95 u32 gcr;
96 u32 ecr;
97 u32 gsr;
98 u8 res0[12];
99 u32 pitar2;
100 u8 res1[4];
101 u32 pibar2;
102 u32 piebar2;
103 u32 piwar2;
104 u8 res2[4];
105 u32 pitar1;
106 u8 res3[4];
107 u32 pibar1;
108 u32 piebar1;
109 u32 piwar1;
110 u8 res4[4];
111 u32 pitar0;
112 u8 res5[4];
113 u32 pibar0;
114 u8 res6[4];
115 u32 piwar0;
116 u8 res7[132];
117} immr_pcictrl_t;
118#define PITAR_TA_MASK 0x000fffff
119#define PIBAR_MASK 0xffffffff
120#define PIEBAR_EBA_MASK 0x000fffff
121#define PIWAR_EN 0x80000000
122#define PIWAR_PF 0x20000000
123#define PIWAR_RTT_MASK 0x000f0000
124#define PIWAR_RTT_NO_SNOOP 0x00040000
125#define PIWAR_RTT_SNOOP 0x00050000
126#define PIWAR_WTT_MASK 0x0000f000
127#define PIWAR_WTT_NO_SNOOP 0x00004000
128#define PIWAR_WTT_SNOOP 0x00005000
129#define PIWAR_IWS_MASK 0x0000003F
130#define PIWAR_IWS_4K 0x0000000B
131#define PIWAR_IWS_8K 0x0000000C
132#define PIWAR_IWS_16K 0x0000000D
133#define PIWAR_IWS_32K 0x0000000E
134#define PIWAR_IWS_64K 0x0000000F
135#define PIWAR_IWS_128K 0x00000010
136#define PIWAR_IWS_256K 0x00000011
137#define PIWAR_IWS_512K 0x00000012
138#define PIWAR_IWS_1M 0x00000013
139#define PIWAR_IWS_2M 0x00000014
140#define PIWAR_IWS_4M 0x00000015
141#define PIWAR_IWS_8M 0x00000016
142#define PIWAR_IWS_16M 0x00000017
143#define PIWAR_IWS_32M 0x00000018
144#define PIWAR_IWS_64M 0x00000019
145#define PIWAR_IWS_128M 0x0000001A
146#define PIWAR_IWS_256M 0x0000001B
147#define PIWAR_IWS_512M 0x0000001C
148#define PIWAR_IWS_1G 0x0000001D
149#define PIWAR_IWS_2G 0x0000001E
150
151#endif /* __PPC_SYSLIB_PPC83XX_PCI_H */
diff --git a/arch/ppc/syslib/ppc83xx_setup.c b/arch/ppc/syslib/ppc83xx_setup.c
index 602a86891f7f..890484e576e7 100644
--- a/arch/ppc/syslib/ppc83xx_setup.c
+++ b/arch/ppc/syslib/ppc83xx_setup.c
@@ -11,6 +11,17 @@
11 * under the terms of the GNU General Public License as published by the 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 12 * Free Software Foundation; either version 2 of the License, or (at your
13 * option) any later version. 13 * option) any later version.
14 *
15 * This program is distributed in the hope that it will be useful, but
16 * WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18 * General Public License for more details.
19 *
20 * You should have received a copy of the GNU General Public License along
21 * with this program; if not, write to the Free Software Foundation, Inc.,
22 * 675 Mass Ave, Cambridge, MA 02139, USA.
23 *
24 * Added PCI support -- Tony Li <tony.li@freescale.com>
14 */ 25 */
15 26
16#include <linux/config.h> 27#include <linux/config.h>
@@ -31,6 +42,10 @@
31#include <asm/delay.h> 42#include <asm/delay.h>
32 43
33#include <syslib/ppc83xx_setup.h> 44#include <syslib/ppc83xx_setup.h>
45#if defined(CONFIG_PCI)
46#include <asm/delay.h>
47#include <syslib/ppc83xx_pci.h>
48#endif
34 49
35phys_addr_t immrbar; 50phys_addr_t immrbar;
36 51
@@ -162,4 +177,237 @@ mpc83xx_halt(void)
162 for(;;); 177 for(;;);
163} 178}
164 179
165/* PCI SUPPORT DOES NOT EXIT, MODEL after ppc85xx_setup.c */ 180#if defined(CONFIG_PCI)
181void __init
182mpc83xx_setup_pci1(struct pci_controller *hose)
183{
184 u16 reg16;
185 volatile immr_pcictrl_t * pci_ctrl;
186 volatile immr_ios_t * ios;
187 bd_t *binfo = (bd_t *) __res;
188
189 pci_ctrl = ioremap(binfo->bi_immr_base + 0x8500, sizeof(immr_pcictrl_t));
190 ios = ioremap(binfo->bi_immr_base + 0x8400, sizeof(immr_ios_t));
191
192 /*
193 * Configure PCI Outbound Translation Windows
194 */
195 ios->potar0 = (MPC83xx_PCI1_LOWER_MEM >> 12) & POTAR_TA_MASK;
196 ios->pobar0 = (MPC83xx_PCI1_LOWER_MEM >> 12) & POBAR_BA_MASK;
197 ios->pocmr0 = POCMR_EN |
198 (((0xffffffff - (MPC83xx_PCI1_UPPER_MEM -
199 MPC83xx_PCI1_LOWER_MEM)) >> 12) & POCMR_CM_MASK);
200
201 /* mapped to PCI1 IO space */
202 ios->potar1 = (MPC83xx_PCI1_LOWER_IO >> 12) & POTAR_TA_MASK;
203 ios->pobar1 = (MPC83xx_PCI1_IO_BASE >> 12) & POBAR_BA_MASK;
204 ios->pocmr1 = POCMR_EN | POCMR_IO |
205 (((0xffffffff - (MPC83xx_PCI1_UPPER_IO -
206 MPC83xx_PCI1_LOWER_IO)) >> 12) & POCMR_CM_MASK);
207
208 /*
209 * Configure PCI Inbound Translation Windows
210 */
211 pci_ctrl->pitar1 = 0x0;
212 pci_ctrl->pibar1 = 0x0;
213 pci_ctrl->piebar1 = 0x0;
214 pci_ctrl->piwar1 = PIWAR_EN | PIWAR_PF | PIWAR_RTT_SNOOP | PIWAR_WTT_SNOOP | PIWAR_IWS_2G;
215
216 /*
217 * Release PCI RST signal
218 */
219 pci_ctrl->gcr = 0;
220 udelay(2000);
221 pci_ctrl->gcr = 1;
222 udelay(2000);
223
224 reg16 = 0xff;
225 early_read_config_word(hose, hose->first_busno, 0, PCI_COMMAND, &reg16);
226 reg16 |= PCI_COMMAND_SERR | PCI_COMMAND_MASTER | PCI_COMMAND_MEMORY;
227 early_write_config_word(hose, hose->first_busno, 0, PCI_COMMAND, reg16);
228
229 /*
230 * Clear non-reserved bits in status register.
231 */
232 early_write_config_word(hose, hose->first_busno, 0, PCI_STATUS, 0xffff);
233 early_write_config_byte(hose, hose->first_busno, 0, PCI_LATENCY_TIMER, 0x80);
234
235 iounmap(pci_ctrl);
236 iounmap(ios);
237}
238
239void __init
240mpc83xx_setup_pci2(struct pci_controller *hose)
241{
242 u16 reg16;
243 volatile immr_pcictrl_t * pci_ctrl;
244 volatile immr_ios_t * ios;
245 bd_t *binfo = (bd_t *) __res;
246
247 pci_ctrl = ioremap(binfo->bi_immr_base + 0x8600, sizeof(immr_pcictrl_t));
248 ios = ioremap(binfo->bi_immr_base + 0x8400, sizeof(immr_ios_t));
249
250 /*
251 * Configure PCI Outbound Translation Windows
252 */
253 ios->potar3 = (MPC83xx_PCI2_LOWER_MEM >> 12) & POTAR_TA_MASK;
254 ios->pobar3 = (MPC83xx_PCI2_LOWER_MEM >> 12) & POBAR_BA_MASK;
255 ios->pocmr3 = POCMR_EN | POCMR_DST |
256 (((0xffffffff - (MPC83xx_PCI2_UPPER_MEM -
257 MPC83xx_PCI2_LOWER_MEM)) >> 12) & POCMR_CM_MASK);
258
259 /* mapped to PCI2 IO space */
260 ios->potar4 = (MPC83xx_PCI2_LOWER_IO >> 12) & POTAR_TA_MASK;
261 ios->pobar4 = (MPC83xx_PCI2_IO_BASE >> 12) & POBAR_BA_MASK;
262 ios->pocmr4 = POCMR_EN | POCMR_DST | POCMR_IO |
263 (((0xffffffff - (MPC83xx_PCI2_UPPER_IO -
264 MPC83xx_PCI2_LOWER_IO)) >> 12) & POCMR_CM_MASK);
265
266 /*
267 * Configure PCI Inbound Translation Windows
268 */
269 pci_ctrl->pitar1 = 0x0;
270 pci_ctrl->pibar1 = 0x0;
271 pci_ctrl->piebar1 = 0x0;
272 pci_ctrl->piwar1 = PIWAR_EN | PIWAR_PF | PIWAR_RTT_SNOOP | PIWAR_WTT_SNOOP | PIWAR_IWS_2G;
273
274 /*
275 * Release PCI RST signal
276 */
277 pci_ctrl->gcr = 0;
278 udelay(2000);
279 pci_ctrl->gcr = 1;
280 udelay(2000);
281
282 reg16 = 0xff;
283 early_read_config_word(hose, hose->first_busno, 0, PCI_COMMAND, &reg16);
284 reg16 |= PCI_COMMAND_SERR | PCI_COMMAND_MASTER | PCI_COMMAND_MEMORY;
285 early_write_config_word(hose, hose->first_busno, 0, PCI_COMMAND, reg16);
286
287 /*
288 * Clear non-reserved bits in status register.
289 */
290 early_write_config_word(hose, hose->first_busno, 0, PCI_STATUS, 0xffff);
291 early_write_config_byte(hose, hose->first_busno, 0, PCI_LATENCY_TIMER, 0x80);
292
293 iounmap(pci_ctrl);
294 iounmap(ios);
295}
296
297/*
298 * PCI buses can be enabled only if SYS board combinates with PIB
299 * (Platform IO Board) board which provide 3 PCI slots. There is 2 PCI buses
300 * and 3 PCI slots, so people must configure the routes between them before
301 * enable PCI bus. This routes are under the control of PCA9555PW device which
302 * can be accessed via I2C bus 2 and are configured by firmware. Refer to
303 * Freescale to get more information about firmware configuration.
304 */
305
306extern int mpc83xx_exclude_device(u_char bus, u_char devfn);
307extern int mpc83xx_map_irq(struct pci_dev *dev, unsigned char idsel,
308 unsigned char pin);
309void __init
310mpc83xx_setup_hose(void)
311{
312 u32 val32;
313 volatile immr_clk_t * clk;
314 struct pci_controller * hose1;
315#ifdef CONFIG_MPC83xx_PCI2
316 struct pci_controller * hose2;
317#endif
318 bd_t * binfo = (bd_t *)__res;
319
320 clk = ioremap(binfo->bi_immr_base + 0xA00,
321 sizeof(immr_clk_t));
322
323 /*
324 * Configure PCI controller and PCI_CLK_OUTPUT both in 66M mode
325 */
326 val32 = clk->occr;
327 udelay(2000);
328 clk->occr = 0xff000000;
329 udelay(2000);
330
331 iounmap(clk);
332
333 hose1 = pcibios_alloc_controller();
334 if(!hose1)
335 return;
336
337 ppc_md.pci_swizzle = common_swizzle;
338 ppc_md.pci_map_irq = mpc83xx_map_irq;
339
340 hose1->bus_offset = 0;
341 hose1->first_busno = 0;
342 hose1->last_busno = 0xff;
343
344 setup_indirect_pci(hose1, binfo->bi_immr_base + PCI1_CFG_ADDR_OFFSET,
345 binfo->bi_immr_base + PCI1_CFG_DATA_OFFSET);
346 hose1->set_cfg_type = 1;
347
348 mpc83xx_setup_pci1(hose1);
349
350 hose1->pci_mem_offset = MPC83xx_PCI1_MEM_OFFSET;
351 hose1->mem_space.start = MPC83xx_PCI1_LOWER_MEM;
352 hose1->mem_space.end = MPC83xx_PCI1_UPPER_MEM;
353
354 hose1->io_base_phys = MPC83xx_PCI1_IO_BASE;
355 hose1->io_space.start = MPC83xx_PCI1_LOWER_IO;
356 hose1->io_space.end = MPC83xx_PCI1_UPPER_IO;
357#ifdef CONFIG_MPC83xx_PCI2
358 isa_io_base = (unsigned long)ioremap(MPC83xx_PCI1_IO_BASE,
359 MPC83xx_PCI1_IO_SIZE + MPC83xx_PCI2_IO_SIZE);
360#else
361 isa_io_base = (unsigned long)ioremap(MPC83xx_PCI1_IO_BASE,
362 MPC83xx_PCI1_IO_SIZE);
363#endif /* CONFIG_MPC83xx_PCI2 */
364 hose1->io_base_virt = (void *)isa_io_base;
365 /* setup resources */
366 pci_init_resource(&hose1->io_resource,
367 MPC83xx_PCI1_LOWER_IO,
368 MPC83xx_PCI1_UPPER_IO,
369 IORESOURCE_IO, "PCI host bridge 1");
370 pci_init_resource(&hose1->mem_resources[0],
371 MPC83xx_PCI1_LOWER_MEM,
372 MPC83xx_PCI1_UPPER_MEM,
373 IORESOURCE_MEM, "PCI host bridge 1");
374
375 ppc_md.pci_exclude_device = mpc83xx_exclude_device;
376 hose1->last_busno = pciauto_bus_scan(hose1, hose1->first_busno);
377
378#ifdef CONFIG_MPC83xx_PCI2
379 hose2 = pcibios_alloc_controller();
380 if(!hose2)
381 return;
382
383 hose2->bus_offset = hose1->last_busno + 1;
384 hose2->first_busno = hose1->last_busno + 1;
385 hose2->last_busno = 0xff;
386 setup_indirect_pci(hose2, binfo->bi_immr_base + PCI2_CFG_ADDR_OFFSET,
387 binfo->bi_immr_base + PCI2_CFG_DATA_OFFSET);
388 hose2->set_cfg_type = 1;
389
390 mpc83xx_setup_pci2(hose2);
391
392 hose2->pci_mem_offset = MPC83xx_PCI2_MEM_OFFSET;
393 hose2->mem_space.start = MPC83xx_PCI2_LOWER_MEM;
394 hose2->mem_space.end = MPC83xx_PCI2_UPPER_MEM;
395
396 hose2->io_base_phys = MPC83xx_PCI2_IO_BASE;
397 hose2->io_space.start = MPC83xx_PCI2_LOWER_IO;
398 hose2->io_space.end = MPC83xx_PCI2_UPPER_IO;
399 hose2->io_base_virt = (void *)(isa_io_base + MPC83xx_PCI1_IO_SIZE);
400 /* setup resources */
401 pci_init_resource(&hose2->io_resource,
402 MPC83xx_PCI2_LOWER_IO,
403 MPC83xx_PCI2_UPPER_IO,
404 IORESOURCE_IO, "PCI host bridge 2");
405 pci_init_resource(&hose2->mem_resources[0],
406 MPC83xx_PCI2_LOWER_MEM,
407 MPC83xx_PCI2_UPPER_MEM,
408 IORESOURCE_MEM, "PCI host bridge 2");
409
410 hose2->last_busno = pciauto_bus_scan(hose2, hose2->first_busno);
411#endif /* CONFIG_MPC83xx_PCI2 */
412}
413#endif /*CONFIG_PCI*/
diff --git a/arch/ppc/syslib/ppc83xx_setup.h b/arch/ppc/syslib/ppc83xx_setup.h
index 683f179b746c..c766c1a5f786 100644
--- a/arch/ppc/syslib/ppc83xx_setup.h
+++ b/arch/ppc/syslib/ppc83xx_setup.h
@@ -12,6 +12,14 @@
12 * Free Software Foundation; either version 2 of the License, or (at your 12 * Free Software Foundation; either version 2 of the License, or (at your
13 * option) any later version. 13 * option) any later version.
14 * 14 *
15 * This program is distributed in the hope that it will be useful, but
16 * WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18 * General Public License for more details.
19 *
20 * You should have received a copy of the GNU General Public License along
21 * with this program; if not, write to the Free Software Foundation, Inc.,
22 * 675 Mass Ave, Cambridge, MA 02139, USA.
15 */ 23 */
16 24
17#ifndef __PPC_SYSLIB_PPC83XX_SETUP_H 25#ifndef __PPC_SYSLIB_PPC83XX_SETUP_H
@@ -19,7 +27,6 @@
19 27
20#include <linux/config.h> 28#include <linux/config.h>
21#include <linux/init.h> 29#include <linux/init.h>
22#include <asm/ppcboot.h>
23 30
24extern unsigned long mpc83xx_find_end_of_memory(void) __init; 31extern unsigned long mpc83xx_find_end_of_memory(void) __init;
25extern long mpc83xx_time_init(void) __init; 32extern long mpc83xx_time_init(void) __init;
@@ -31,13 +38,11 @@ extern void mpc83xx_halt(void);
31extern void mpc83xx_setup_hose(void) __init; 38extern void mpc83xx_setup_hose(void) __init;
32 39
33/* PCI config */ 40/* PCI config */
34#if 0 41#define PCI1_CFG_ADDR_OFFSET (0x8300)
35#define PCI1_CFG_ADDR_OFFSET (FIXME) 42#define PCI1_CFG_DATA_OFFSET (0x8304)
36#define PCI1_CFG_DATA_OFFSET (FIXME)
37 43
38#define PCI2_CFG_ADDR_OFFSET (FIXME) 44#define PCI2_CFG_ADDR_OFFSET (0x8380)
39#define PCI2_CFG_DATA_OFFSET (FIXME) 45#define PCI2_CFG_DATA_OFFSET (0x8384)
40#endif
41 46
42/* Serial Config */ 47/* Serial Config */
43#ifdef CONFIG_SERIAL_MANY_PORTS 48#ifdef CONFIG_SERIAL_MANY_PORTS
diff --git a/arch/ppc/syslib/ppc85xx_setup.c b/arch/ppc/syslib/ppc85xx_setup.c
index ca95d79a704e..b7242f1bd931 100644
--- a/arch/ppc/syslib/ppc85xx_setup.c
+++ b/arch/ppc/syslib/ppc85xx_setup.c
@@ -233,14 +233,14 @@ mpc85xx_setup_pci2(struct pci_controller *hose)
233 pci->powbar1 = (MPC85XX_PCI2_LOWER_MEM >> 12) & 0x000fffff; 233 pci->powbar1 = (MPC85XX_PCI2_LOWER_MEM >> 12) & 0x000fffff;
234 /* Enable, Mem R/W */ 234 /* Enable, Mem R/W */
235 pci->powar1 = 0x80044000 | 235 pci->powar1 = 0x80044000 |
236 (__ilog2(MPC85XX_PCI1_UPPER_MEM - MPC85XX_PCI1_LOWER_MEM + 1) - 1); 236 (__ilog2(MPC85XX_PCI2_UPPER_MEM - MPC85XX_PCI2_LOWER_MEM + 1) - 1);
237 237
238 /* Setup outboud IO windows @ MPC85XX_PCI2_IO_BASE */ 238 /* Setup outboud IO windows @ MPC85XX_PCI2_IO_BASE */
239 pci->potar2 = 0x00000000; 239 pci->potar2 = 0x00000000;
240 pci->potear2 = 0x00000000; 240 pci->potear2 = 0x00000000;
241 pci->powbar2 = (MPC85XX_PCI2_IO_BASE >> 12) & 0x000fffff; 241 pci->powbar2 = (MPC85XX_PCI2_IO_BASE >> 12) & 0x000fffff;
242 /* Enable, IO R/W */ 242 /* Enable, IO R/W */
243 pci->powar2 = 0x80088000 | (__ilog2(MPC85XX_PCI1_IO_SIZE) - 1); 243 pci->powar2 = 0x80088000 | (__ilog2(MPC85XX_PCI2_IO_SIZE) - 1);
244 244
245 /* Setup 2G inbound Memory Window @ 0 */ 245 /* Setup 2G inbound Memory Window @ 0 */
246 pci->pitar1 = 0x00000000; 246 pci->pitar1 = 0x00000000;
diff --git a/arch/ppc/syslib/ppc_sys.c b/arch/ppc/syslib/ppc_sys.c
index 879202352560..52ba0c68078d 100644
--- a/arch/ppc/syslib/ppc_sys.c
+++ b/arch/ppc/syslib/ppc_sys.c
@@ -6,6 +6,7 @@
6 * Maintainer: Kumar Gala <kumar.gala@freescale.com> 6 * Maintainer: Kumar Gala <kumar.gala@freescale.com>
7 * 7 *
8 * Copyright 2005 Freescale Semiconductor Inc. 8 * Copyright 2005 Freescale Semiconductor Inc.
9 * Copyright 2005 MontaVista, Inc. by Vitaly Bordug <vbordug@ru.mvista.com>
9 * 10 *
10 * This program is free software; you can redistribute it and/or modify it 11 * 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 * under the terms of the GNU General Public License as published by the
@@ -35,10 +36,59 @@ void __init identify_ppc_sys_by_id(u32 id)
35 36
36void __init identify_ppc_sys_by_name(char *name) 37void __init identify_ppc_sys_by_name(char *name)
37{ 38{
38 /* TODO */ 39 unsigned int i = 0;
40 while (ppc_sys_specs[i].ppc_sys_name[0])
41 {
42 if (!strcmp(ppc_sys_specs[i].ppc_sys_name, name))
43 break;
44 i++;
45 }
46 cur_ppc_sys_spec = &ppc_sys_specs[i];
39 return; 47 return;
40} 48}
41 49
50static int __init count_sys_specs(void)
51{
52 int i = 0;
53 while (ppc_sys_specs[i].ppc_sys_name[0])
54 i++;
55 return i;
56}
57
58static int __init find_chip_by_name_and_id(char *name, u32 id)
59{
60 int ret = -1;
61 unsigned int i = 0;
62 unsigned int j = 0;
63 unsigned int dups = 0;
64
65 unsigned char matched[count_sys_specs()];
66
67 while (ppc_sys_specs[i].ppc_sys_name[0]) {
68 if (!strcmp(ppc_sys_specs[i].ppc_sys_name, name))
69 matched[j++] = i;
70 i++;
71 }
72 if (j != 0) {
73 for (i = 0; i < j; i++) {
74 if ((ppc_sys_specs[matched[i]].mask & id) ==
75 ppc_sys_specs[matched[i]].value) {
76 ret = matched[i];
77 dups++;
78 }
79 }
80 ret = (dups == 1) ? ret : (-1 * dups);
81 }
82 return ret;
83}
84
85void __init identify_ppc_sys_by_name_and_id(char *name, u32 id)
86{
87 int i = find_chip_by_name_and_id(name, id);
88 BUG_ON(i < 0);
89 cur_ppc_sys_spec = &ppc_sys_specs[i];
90}
91
42/* Update all memory resources by paddr, call before platform_device_register */ 92/* Update all memory resources by paddr, call before platform_device_register */
43void __init 93void __init
44ppc_sys_fixup_mem_resource(struct platform_device *pdev, phys_addr_t paddr) 94ppc_sys_fixup_mem_resource(struct platform_device *pdev, phys_addr_t paddr)
diff --git a/arch/ppc/syslib/pq2_devices.c b/arch/ppc/syslib/pq2_devices.c
new file mode 100644
index 000000000000..1d3869768f96
--- /dev/null
+++ b/arch/ppc/syslib/pq2_devices.c
@@ -0,0 +1,389 @@
1/*
2 * arch/ppc/syslib/pq2_devices.c
3 *
4 * PQ2 Device descriptions
5 *
6 * Maintainer: Kumar Gala <kumar.gala@freescale.com>
7 *
8 * This file is licensed under the terms of the GNU General Public License
9 * version 2. This program is licensed "as is" without any warranty of any
10 * kind, whether express or implied.
11 */
12
13
14#include <linux/init.h>
15#include <linux/module.h>
16#include <linux/device.h>
17#include <linux/ioport.h>
18#include <asm/cpm2.h>
19#include <asm/irq.h>
20#include <asm/ppc_sys.h>
21
22struct platform_device ppc_sys_platform_devices[] = {
23 [MPC82xx_CPM_FCC1] = {
24 .name = "fsl-cpm-fcc",
25 .id = 1,
26 .num_resources = 3,
27 .resource = (struct resource[]) {
28 {
29 .name = "fcc_regs",
30 .start = 0x11300,
31 .end = 0x1131f,
32 .flags = IORESOURCE_MEM,
33 },
34 {
35 .name = "fcc_pram",
36 .start = 0x8400,
37 .end = 0x84ff,
38 .flags = IORESOURCE_MEM,
39 },
40 {
41 .start = SIU_INT_FCC1,
42 .end = SIU_INT_FCC1,
43 .flags = IORESOURCE_IRQ,
44 },
45 },
46 },
47 [MPC82xx_CPM_FCC2] = {
48 .name = "fsl-cpm-fcc",
49 .id = 2,
50 .num_resources = 3,
51 .resource = (struct resource[]) {
52 {
53 .name = "fcc_regs",
54 .start = 0x11320,
55 .end = 0x1133f,
56 .flags = IORESOURCE_MEM,
57 },
58 {
59 .name = "fcc_pram",
60 .start = 0x8500,
61 .end = 0x85ff,
62 .flags = IORESOURCE_MEM,
63 },
64 {
65 .start = SIU_INT_FCC2,
66 .end = SIU_INT_FCC2,
67 .flags = IORESOURCE_IRQ,
68 },
69 },
70 },
71 [MPC82xx_CPM_FCC3] = {
72 .name = "fsl-cpm-fcc",
73 .id = 3,
74 .num_resources = 3,
75 .resource = (struct resource[]) {
76 {
77 .name = "fcc_regs",
78 .start = 0x11340,
79 .end = 0x1135f,
80 .flags = IORESOURCE_MEM,
81 },
82 {
83 .name = "fcc_pram",
84 .start = 0x8600,
85 .end = 0x86ff,
86 .flags = IORESOURCE_MEM,
87 },
88 {
89 .start = SIU_INT_FCC3,
90 .end = SIU_INT_FCC3,
91 .flags = IORESOURCE_IRQ,
92 },
93 },
94 },
95 [MPC82xx_CPM_I2C] = {
96 .name = "fsl-cpm-i2c",
97 .id = 1,
98 .num_resources = 3,
99 .resource = (struct resource[]) {
100 {
101 .name = "i2c_mem",
102 .start = 0x11860,
103 .end = 0x118BF,
104 .flags = IORESOURCE_MEM,
105 },
106 {
107 .name = "i2c_pram",
108 .start = 0x8afc,
109 .end = 0x8afd,
110 .flags = IORESOURCE_MEM,
111 },
112 {
113 .start = SIU_INT_I2C,
114 .end = SIU_INT_I2C,
115 .flags = IORESOURCE_IRQ,
116 },
117 },
118 },
119 [MPC82xx_CPM_SCC1] = {
120 .name = "fsl-cpm-scc",
121 .id = 1,
122 .num_resources = 3,
123 .resource = (struct resource[]) {
124 {
125 .name = "scc_mem",
126 .start = 0x11A00,
127 .end = 0x11A1F,
128 .flags = IORESOURCE_MEM,
129 },
130 {
131 .name = "scc_pram",
132 .start = 0x8000,
133 .end = 0x80ff,
134 .flags = IORESOURCE_MEM,
135 },
136 {
137 .start = SIU_INT_SCC1,
138 .end = SIU_INT_SCC1,
139 .flags = IORESOURCE_IRQ,
140 },
141 },
142 },
143 [MPC82xx_CPM_SCC2] = {
144 .name = "fsl-cpm-scc",
145 .id = 2,
146 .num_resources = 3,
147 .resource = (struct resource[]) {
148 {
149 .name = "scc_mem",
150 .start = 0x11A20,
151 .end = 0x11A3F,
152 .flags = IORESOURCE_MEM,
153 },
154 {
155 .name = "scc_pram",
156 .start = 0x8100,
157 .end = 0x81ff,
158 .flags = IORESOURCE_MEM,
159 },
160 {
161 .start = SIU_INT_SCC2,
162 .end = SIU_INT_SCC2,
163 .flags = IORESOURCE_IRQ,
164 },
165 },
166 },
167 [MPC82xx_CPM_SCC3] = {
168 .name = "fsl-cpm-scc",
169 .id = 3,
170 .num_resources = 3,
171 .resource = (struct resource[]) {
172 {
173 .name = "scc_mem",
174 .start = 0x11A40,
175 .end = 0x11A5F,
176 .flags = IORESOURCE_MEM,
177 },
178 {
179 .name = "scc_pram",
180 .start = 0x8200,
181 .end = 0x82ff,
182 .flags = IORESOURCE_MEM,
183 },
184 {
185 .start = SIU_INT_SCC3,
186 .end = SIU_INT_SCC3,
187 .flags = IORESOURCE_IRQ,
188 },
189 },
190 },
191 [MPC82xx_CPM_SCC4] = {
192 .name = "fsl-cpm-scc",
193 .id = 4,
194 .num_resources = 3,
195 .resource = (struct resource[]) {
196 {
197 .name = "scc_mem",
198 .start = 0x11A60,
199 .end = 0x11A7F,
200 .flags = IORESOURCE_MEM,
201 },
202 {
203 .name = "scc_pram",
204 .start = 0x8300,
205 .end = 0x83ff,
206 .flags = IORESOURCE_MEM,
207 },
208 {
209 .start = SIU_INT_SCC4,
210 .end = SIU_INT_SCC4,
211 .flags = IORESOURCE_IRQ,
212 },
213 },
214 },
215 [MPC82xx_CPM_SPI] = {
216 .name = "fsl-cpm-spi",
217 .id = 1,
218 .num_resources = 3,
219 .resource = (struct resource[]) {
220 {
221 .name = "spi_mem",
222 .start = 0x11AA0,
223 .end = 0x11AFF,
224 .flags = IORESOURCE_MEM,
225 },
226 {
227 .name = "spi_pram",
228 .start = 0x89fc,
229 .end = 0x89fd,
230 .flags = IORESOURCE_MEM,
231 },
232 {
233 .start = SIU_INT_SPI,
234 .end = SIU_INT_SPI,
235 .flags = IORESOURCE_IRQ,
236 },
237 },
238 },
239 [MPC82xx_CPM_MCC1] = {
240 .name = "fsl-cpm-mcc",
241 .id = 1,
242 .num_resources = 3,
243 .resource = (struct resource[]) {
244 {
245 .name = "mcc_mem",
246 .start = 0x11B30,
247 .end = 0x11B3F,
248 .flags = IORESOURCE_MEM,
249 },
250 {
251 .name = "mcc_pram",
252 .start = 0x8700,
253 .end = 0x877f,
254 .flags = IORESOURCE_MEM,
255 },
256 {
257 .start = SIU_INT_MCC1,
258 .end = SIU_INT_MCC1,
259 .flags = IORESOURCE_IRQ,
260 },
261 },
262 },
263 [MPC82xx_CPM_MCC2] = {
264 .name = "fsl-cpm-mcc",
265 .id = 2,
266 .num_resources = 3,
267 .resource = (struct resource[]) {
268 {
269 .name = "mcc_mem",
270 .start = 0x11B50,
271 .end = 0x11B5F,
272 .flags = IORESOURCE_MEM,
273 },
274 {
275 .name = "mcc_pram",
276 .start = 0x8800,
277 .end = 0x887f,
278 .flags = IORESOURCE_MEM,
279 },
280 {
281 .start = SIU_INT_MCC2,
282 .end = SIU_INT_MCC2,
283 .flags = IORESOURCE_IRQ,
284 },
285 },
286 },
287 [MPC82xx_CPM_SMC1] = {
288 .name = "fsl-cpm-smc",
289 .id = 1,
290 .num_resources = 3,
291 .resource = (struct resource[]) {
292 {
293 .name = "smc_mem",
294 .start = 0x11A80,
295 .end = 0x11A8F,
296 .flags = IORESOURCE_MEM,
297 },
298 {
299 .name = "smc_pram",
300 .start = 0x87fc,
301 .end = 0x87fd,
302 .flags = IORESOURCE_MEM,
303 },
304 {
305 .start = SIU_INT_SMC1,
306 .end = SIU_INT_SMC1,
307 .flags = IORESOURCE_IRQ,
308 },
309 },
310 },
311 [MPC82xx_CPM_SMC2] = {
312 .name = "fsl-cpm-smc",
313 .id = 2,
314 .num_resources = 3,
315 .resource = (struct resource[]) {
316 {
317 .name = "smc_mem",
318 .start = 0x11A90,
319 .end = 0x11A9F,
320 .flags = IORESOURCE_MEM,
321 },
322 {
323 .name = "smc_pram",
324 .start = 0x88fc,
325 .end = 0x88fd,
326 .flags = IORESOURCE_MEM,
327 },
328 {
329 .start = SIU_INT_SMC2,
330 .end = SIU_INT_SMC2,
331 .flags = IORESOURCE_IRQ,
332 },
333 },
334 },
335 [MPC82xx_CPM_USB] = {
336 .name = "fsl-cpm-usb",
337 .id = 1,
338 .num_resources = 3,
339 .resource = (struct resource[]) {
340 {
341 .name = "usb_mem",
342 .start = 0x11b60,
343 .end = 0x11b78,
344 .flags = IORESOURCE_MEM,
345 },
346 {
347 .name = "usb_pram",
348 .start = 0x8b00,
349 .end = 0x8bff,
350 .flags = IORESOURCE_MEM,
351 },
352 {
353 .start = SIU_INT_USB,
354 .end = SIU_INT_USB,
355 .flags = IORESOURCE_IRQ,
356 },
357
358 },
359 },
360 [MPC82xx_SEC1] = {
361 .name = "fsl-sec",
362 .id = 1,
363 .num_resources = 1,
364 .resource = (struct resource[]) {
365 {
366 .name = "sec_mem",
367 .start = 0x40000,
368 .end = 0x52fff,
369 .flags = IORESOURCE_MEM,
370 },
371 },
372 },
373};
374
375static int __init mach_mpc82xx_fixup(struct platform_device *pdev)
376{
377 ppc_sys_fixup_mem_resource(pdev, CPM_MAP_ADDR);
378 return 0;
379}
380
381static int __init mach_mpc82xx_init(void)
382{
383 if (ppc_md.progress)
384 ppc_md.progress("mach_mpc82xx_init:enter", 0);
385 ppc_sys_device_fixup = mach_mpc82xx_fixup;
386 return 0;
387}
388
389postcore_initcall(mach_mpc82xx_init);
diff --git a/arch/ppc/syslib/pq2_sys.c b/arch/ppc/syslib/pq2_sys.c
new file mode 100644
index 000000000000..7b6c9ebdb9e3
--- /dev/null
+++ b/arch/ppc/syslib/pq2_sys.c
@@ -0,0 +1,200 @@
1/*
2 * arch/ppc/syslib/pq2_devices.c
3 *
4 * PQ2 System descriptions
5 *
6 * Maintainer: Kumar Gala <kumar.gala@freescale.com>
7 *
8 * This file is licensed under the terms of the GNU General Public License
9 * version 2. This program is licensed "as is" without any warranty of any
10 * kind, whether express or implied.
11 */
12
13#include <linux/init.h>
14#include <linux/module.h>
15#include <linux/device.h>
16
17#include <asm/ppc_sys.h>
18
19struct ppc_sys_spec *cur_ppc_sys_spec;
20struct ppc_sys_spec ppc_sys_specs[] = {
21 /* below is a list of the 8260 family of processors */
22 {
23 .ppc_sys_name = "8250",
24 .mask = 0x0000ff00,
25 .value = 0x00000000,
26 .num_devices = 12,
27 .device_list = (enum ppc_sys_devices[])
28 {
29 MPC82xx_CPM_FCC1, MPC82xx_CPM_FCC2, MPC82xx_CPM_FCC3,
30 MPC82xx_CPM_SCC1, MPC82xx_CPM_SCC2, MPC82xx_CPM_SCC3,
31 MPC82xx_CPM_SCC4, MPC82xx_CPM_MCC1, MPC82xx_CPM_SMC1,
32 MPC82xx_CPM_SMC2, MPC82xx_CPM_SPI, MPC82xx_CPM_I2C,
33 }
34 },
35 {
36 .ppc_sys_name = "8255",
37 .mask = 0x0000ff00,
38 .value = 0x00000000,
39 .num_devices = 11,
40 .device_list = (enum ppc_sys_devices[])
41 {
42 MPC82xx_CPM_FCC1, MPC82xx_CPM_FCC2, MPC82xx_CPM_SCC1,
43 MPC82xx_CPM_SCC2, MPC82xx_CPM_SCC3, MPC82xx_CPM_SCC4,
44 MPC82xx_CPM_MCC1, MPC82xx_CPM_SMC1, MPC82xx_CPM_SMC2,
45 MPC82xx_CPM_SPI, MPC82xx_CPM_I2C,
46 }
47 },
48 {
49 .ppc_sys_name = "8260",
50 .mask = 0x0000ff00,
51 .value = 0x00000000,
52 .num_devices = 12,
53 .device_list = (enum ppc_sys_devices[])
54 {
55 MPC82xx_CPM_FCC1, MPC82xx_CPM_FCC2, MPC82xx_CPM_FCC3,
56 MPC82xx_CPM_SCC1, MPC82xx_CPM_SCC2, MPC82xx_CPM_SCC3,
57 MPC82xx_CPM_SCC4, MPC82xx_CPM_MCC1, MPC82xx_CPM_SMC1,
58 MPC82xx_CPM_SMC2, MPC82xx_CPM_SPI, MPC82xx_CPM_I2C,
59 }
60 },
61 {
62 .ppc_sys_name = "8264",
63 .mask = 0x0000ff00,
64 .value = 0x00000000,
65 .num_devices = 12,
66 .device_list = (enum ppc_sys_devices[])
67 {
68 MPC82xx_CPM_FCC1, MPC82xx_CPM_FCC2, MPC82xx_CPM_FCC3,
69 MPC82xx_CPM_SCC1, MPC82xx_CPM_SCC2, MPC82xx_CPM_SCC3,
70 MPC82xx_CPM_SCC4, MPC82xx_CPM_MCC1, MPC82xx_CPM_SMC1,
71 MPC82xx_CPM_SMC2, MPC82xx_CPM_SPI, MPC82xx_CPM_I2C,
72 }
73 },
74 {
75 .ppc_sys_name = "8265",
76 .mask = 0x0000ff00,
77 .value = 0x00000000,
78 .num_devices = 12,
79 .device_list = (enum ppc_sys_devices[])
80 {
81 MPC82xx_CPM_FCC1, MPC82xx_CPM_FCC2, MPC82xx_CPM_FCC3,
82 MPC82xx_CPM_SCC1, MPC82xx_CPM_SCC2, MPC82xx_CPM_SCC3,
83 MPC82xx_CPM_SCC4, MPC82xx_CPM_MCC1, MPC82xx_CPM_SMC1,
84 MPC82xx_CPM_SMC2, MPC82xx_CPM_SPI, MPC82xx_CPM_I2C,
85 }
86 },
87 {
88 .ppc_sys_name = "8266",
89 .mask = 0x0000ff00,
90 .value = 0x00000000,
91 .num_devices = 12,
92 .device_list = (enum ppc_sys_devices[])
93 {
94 MPC82xx_CPM_FCC1, MPC82xx_CPM_FCC2, MPC82xx_CPM_FCC3,
95 MPC82xx_CPM_SCC1, MPC82xx_CPM_SCC2, MPC82xx_CPM_SCC3,
96 MPC82xx_CPM_SCC4, MPC82xx_CPM_MCC1, MPC82xx_CPM_SMC1,
97 MPC82xx_CPM_SMC2, MPC82xx_CPM_SPI, MPC82xx_CPM_I2C,
98 }
99 },
100 /* below is a list of the 8272 family of processors */
101 {
102 .ppc_sys_name = "8247",
103 .mask = 0x0000ff00,
104 .value = 0x00000d00,
105 .num_devices = 10,
106 .device_list = (enum ppc_sys_devices[])
107 {
108 MPC82xx_CPM_FCC1, MPC82xx_CPM_FCC2, MPC82xx_CPM_SCC1,
109 MPC82xx_CPM_SCC2, MPC82xx_CPM_SCC3, MPC82xx_CPM_SMC1,
110 MPC82xx_CPM_SMC2, MPC82xx_CPM_SPI, MPC82xx_CPM_I2C,
111 MPC82xx_CPM_USB,
112 },
113 },
114 {
115 .ppc_sys_name = "8248",
116 .mask = 0x0000ff00,
117 .value = 0x00000c00,
118 .num_devices = 11,
119 .device_list = (enum ppc_sys_devices[])
120 {
121 MPC82xx_CPM_FCC1, MPC82xx_CPM_FCC2, MPC82xx_CPM_SCC1,
122 MPC82xx_CPM_SCC2, MPC82xx_CPM_SCC3, MPC82xx_CPM_SMC1,
123 MPC82xx_CPM_SMC2, MPC82xx_CPM_SPI, MPC82xx_CPM_I2C,
124 MPC82xx_CPM_USB, MPC82xx_SEC1,
125 },
126 },
127 {
128 .ppc_sys_name = "8271",
129 .mask = 0x0000ff00,
130 .value = 0x00000d00,
131 .num_devices = 10,
132 .device_list = (enum ppc_sys_devices[])
133 {
134 MPC82xx_CPM_FCC1, MPC82xx_CPM_FCC2, MPC82xx_CPM_SCC1,
135 MPC82xx_CPM_SCC2, MPC82xx_CPM_SCC3, MPC82xx_CPM_SMC1,
136 MPC82xx_CPM_SMC2, MPC82xx_CPM_SPI, MPC82xx_CPM_I2C,
137 MPC82xx_CPM_USB,
138 },
139 },
140 {
141 .ppc_sys_name = "8272",
142 .mask = 0x0000ff00,
143 .value = 0x00000c00,
144 .num_devices = 11,
145 .device_list = (enum ppc_sys_devices[])
146 {
147 MPC82xx_CPM_FCC1, MPC82xx_CPM_FCC2, MPC82xx_CPM_SCC1,
148 MPC82xx_CPM_SCC2, MPC82xx_CPM_SCC3, MPC82xx_CPM_SMC1,
149 MPC82xx_CPM_SMC2, MPC82xx_CPM_SPI, MPC82xx_CPM_I2C,
150 MPC82xx_CPM_USB, MPC82xx_SEC1,
151 },
152 },
153 /* below is a list of the 8280 family of processors */
154 {
155 .ppc_sys_name = "8270",
156 .mask = 0x0000ff00,
157 .value = 0x00000a00,
158 .num_devices = 12,
159 .device_list = (enum ppc_sys_devices[])
160 {
161 MPC82xx_CPM_FCC1, MPC82xx_CPM_FCC2, MPC82xx_CPM_FCC3,
162 MPC82xx_CPM_SCC1, MPC82xx_CPM_SCC2, MPC82xx_CPM_SCC3,
163 MPC82xx_CPM_SCC4, MPC82xx_CPM_MCC1, MPC82xx_CPM_SMC1,
164 MPC82xx_CPM_SMC2, MPC82xx_CPM_SPI, MPC82xx_CPM_I2C,
165 },
166 },
167 {
168 .ppc_sys_name = "8275",
169 .mask = 0x0000ff00,
170 .value = 0x00000a00,
171 .num_devices = 12,
172 .device_list = (enum ppc_sys_devices[])
173 {
174 MPC82xx_CPM_FCC1, MPC82xx_CPM_FCC2, MPC82xx_CPM_FCC3,
175 MPC82xx_CPM_SCC1, MPC82xx_CPM_SCC2, MPC82xx_CPM_SCC3,
176 MPC82xx_CPM_SCC4, MPC82xx_CPM_MCC1, MPC82xx_CPM_SMC1,
177 MPC82xx_CPM_SMC2, MPC82xx_CPM_SPI, MPC82xx_CPM_I2C,
178 },
179 },
180 {
181 .ppc_sys_name = "8280",
182 .mask = 0x0000ff00,
183 .value = 0x00000a00,
184 .num_devices = 13,
185 .device_list = (enum ppc_sys_devices[])
186 {
187 MPC82xx_CPM_FCC1, MPC82xx_CPM_FCC2, MPC82xx_CPM_FCC3,
188 MPC82xx_CPM_SCC1, MPC82xx_CPM_SCC2, MPC82xx_CPM_SCC3,
189 MPC82xx_CPM_SCC4, MPC82xx_CPM_MCC1, MPC82xx_CPM_MCC2,
190 MPC82xx_CPM_SMC1, MPC82xx_CPM_SMC2, MPC82xx_CPM_SPI,
191 MPC82xx_CPM_I2C,
192 },
193 },
194 {
195 /* default match */
196 .ppc_sys_name = "",
197 .mask = 0x00000000,
198 .value = 0x00000000,
199 },
200};
diff --git a/arch/ppc64/Kconfig b/arch/ppc64/Kconfig
index f804f25232ac..13b262f10216 100644
--- a/arch/ppc64/Kconfig
+++ b/arch/ppc64/Kconfig
@@ -288,6 +288,7 @@ config SCHED_SMT
288 overhead in some places. If unsure say N here. 288 overhead in some places. If unsure say N here.
289 289
290source "kernel/Kconfig.preempt" 290source "kernel/Kconfig.preempt"
291source kernel/Kconfig.hz
291 292
292config EEH 293config EEH
293 bool "PCI Extended Error Handling (EEH)" if EMBEDDED 294 bool "PCI Extended Error Handling (EEH)" if EMBEDDED
@@ -301,12 +302,6 @@ config GENERIC_HARDIRQS
301 bool 302 bool
302 default y 303 default y
303 304
304config MSCHUNKS
305 bool
306 depends on PPC_ISERIES
307 default y
308
309
310config PPC_RTAS 305config PPC_RTAS
311 bool 306 bool
312 depends on PPC_PSERIES || PPC_BPA 307 depends on PPC_PSERIES || PPC_BPA
@@ -349,13 +344,46 @@ config SECCOMP
349 344
350 If unsure, say Y. Only embedded should say N here. 345 If unsure, say Y. Only embedded should say N here.
351 346
347source "fs/Kconfig.binfmt"
348
349config HOTPLUG_CPU
350 bool "Support for hot-pluggable CPUs"
351 depends on SMP && EXPERIMENTAL && (PPC_PSERIES || PPC_PMAC)
352 select HOTPLUG
353 ---help---
354 Say Y here to be able to turn CPUs off and on.
355
356 Say N if you are unsure.
357
358config PROC_DEVICETREE
359 bool "Support for Open Firmware device tree in /proc"
360 depends on !PPC_ISERIES
361 help
362 This option adds a device-tree directory under /proc which contains
363 an image of the device tree that the kernel copies from Open
364 Firmware. If unsure, say Y here.
365
366config CMDLINE_BOOL
367 bool "Default bootloader kernel arguments"
368 depends on !PPC_ISERIES
369
370config CMDLINE
371 string "Initial kernel command string"
372 depends on CMDLINE_BOOL
373 default "console=ttyS0,9600 console=tty0 root=/dev/sda2"
374 help
375 On some platforms, there is currently no way for the boot loader to
376 pass arguments to the kernel. For these platforms, you can supply
377 some command-line options at build time by entering them here. In
378 most cases you will need to specify the root device here.
379
352endmenu 380endmenu
353 381
354config ISA_DMA_API 382config ISA_DMA_API
355 bool 383 bool
356 default y 384 default y
357 385
358menu "General setup" 386menu "Bus Options"
359 387
360config ISA 388config ISA
361 bool 389 bool
@@ -388,47 +416,16 @@ config PCI_DOMAINS
388 bool 416 bool
389 default PCI 417 default PCI
390 418
391source "fs/Kconfig.binfmt"
392
393source "drivers/pci/Kconfig" 419source "drivers/pci/Kconfig"
394 420
395config HOTPLUG_CPU
396 bool "Support for hot-pluggable CPUs"
397 depends on SMP && EXPERIMENTAL && (PPC_PSERIES || PPC_PMAC)
398 select HOTPLUG
399 ---help---
400 Say Y here to be able to turn CPUs off and on.
401
402 Say N if you are unsure.
403
404source "drivers/pcmcia/Kconfig" 421source "drivers/pcmcia/Kconfig"
405 422
406source "drivers/pci/hotplug/Kconfig" 423source "drivers/pci/hotplug/Kconfig"
407 424
408config PROC_DEVICETREE
409 bool "Support for Open Firmware device tree in /proc"
410 depends on !PPC_ISERIES
411 help
412 This option adds a device-tree directory under /proc which contains
413 an image of the device tree that the kernel copies from Open
414 Firmware. If unsure, say Y here.
415
416config CMDLINE_BOOL
417 bool "Default bootloader kernel arguments"
418 depends on !PPC_ISERIES
419
420config CMDLINE
421 string "Initial kernel command string"
422 depends on CMDLINE_BOOL
423 default "console=ttyS0,9600 console=tty0 root=/dev/sda2"
424 help
425 On some platforms, there is currently no way for the boot loader to
426 pass arguments to the kernel. For these platforms, you can supply
427 some command-line options at build time by entering them here. In
428 most cases you will need to specify the root device here.
429
430endmenu 425endmenu
431 426
427source "net/Kconfig"
428
432source "drivers/Kconfig" 429source "drivers/Kconfig"
433 430
434source "fs/Kconfig" 431source "fs/Kconfig"
diff --git a/arch/ppc64/Kconfig.debug b/arch/ppc64/Kconfig.debug
index 46b1ce58da3b..f16a5030527b 100644
--- a/arch/ppc64/Kconfig.debug
+++ b/arch/ppc64/Kconfig.debug
@@ -41,10 +41,19 @@ config XMON
41 help 41 help
42 Include in-kernel hooks for the xmon kernel monitor/debugger. 42 Include in-kernel hooks for the xmon kernel monitor/debugger.
43 Unless you are intending to debug the kernel, say N here. 43 Unless you are intending to debug the kernel, say N here.
44 Make sure to enable also CONFIG_BOOTX_TEXT on Macs. Otherwise
45 nothing will appear on the screen (xmon writes directly to the
46 framebuffer memory).
47 The cmdline option 'xmon' or 'xmon=early' will drop into xmon very
48 early during boot. 'xmon=on' will just enable the xmon debugger hooks.
49 'xmon=off' will disable the debugger hooks if CONFIG_XMON_DEFAULT is set.
44 50
45config XMON_DEFAULT 51config XMON_DEFAULT
46 bool "Enable xmon by default" 52 bool "Enable xmon by default"
47 depends on XMON 53 depends on XMON
54 help
55 xmon is normally disabled unless booted with 'xmon=on'.
56 Use 'xmon=off' to disable xmon init during runtime.
48 57
49config PPCDBG 58config PPCDBG
50 bool "Include PPCDBG realtime debugging" 59 bool "Include PPCDBG realtime debugging"
diff --git a/arch/ppc64/Makefile b/arch/ppc64/Makefile
index 731b84758331..6350cce82efb 100644
--- a/arch/ppc64/Makefile
+++ b/arch/ppc64/Makefile
@@ -55,6 +55,8 @@ LDFLAGS := -m elf64ppc
55LDFLAGS_vmlinux := -Bstatic -e $(KERNELLOAD) -Ttext $(KERNELLOAD) 55LDFLAGS_vmlinux := -Bstatic -e $(KERNELLOAD) -Ttext $(KERNELLOAD)
56CFLAGS += -msoft-float -pipe -mminimal-toc -mtraceback=none \ 56CFLAGS += -msoft-float -pipe -mminimal-toc -mtraceback=none \
57 -mcall-aixdesc 57 -mcall-aixdesc
58# Temporary hack until we have migrated to asm-powerpc
59CPPFLAGS += -Iinclude3
58 60
59GCC_VERSION := $(call cc-version) 61GCC_VERSION := $(call cc-version)
60GCC_BROKEN_VEC := $(shell if [ $(GCC_VERSION) -lt 0400 ] ; then echo "y"; fi ;) 62GCC_BROKEN_VEC := $(shell if [ $(GCC_VERSION) -lt 0400 ] ; then echo "y"; fi ;)
@@ -112,6 +114,7 @@ all: $(KBUILD_IMAGE)
112 114
113archclean: 115archclean:
114 $(Q)$(MAKE) $(clean)=$(boot) 116 $(Q)$(MAKE) $(clean)=$(boot)
117 $(Q)rm -rf include3
115 118
116prepare: include/asm-ppc64/offsets.h 119prepare: include/asm-ppc64/offsets.h
117 120
@@ -121,6 +124,12 @@ arch/ppc64/kernel/asm-offsets.s: include/asm include/linux/version.h \
121include/asm-ppc64/offsets.h: arch/ppc64/kernel/asm-offsets.s 124include/asm-ppc64/offsets.h: arch/ppc64/kernel/asm-offsets.s
122 $(call filechk,gen-asm-offsets) 125 $(call filechk,gen-asm-offsets)
123 126
127# Temporary hack until we have migrated to asm-powerpc
128include/asm: include3/asm
129include3/asm:
130 $(Q)if [ ! -d include3 ]; then mkdir -p include3; fi;
131 $(Q)ln -fsn $(srctree)/include/asm-powerpc include3/asm
132
124define archhelp 133define archhelp
125 echo '* zImage - Compressed kernel image (arch/$(ARCH)/boot/zImage)' 134 echo '* zImage - Compressed kernel image (arch/$(ARCH)/boot/zImage)'
126 echo ' zImage.initrd- Compressed kernel image with initrd attached,' 135 echo ' zImage.initrd- Compressed kernel image with initrd attached,'
diff --git a/arch/ppc64/boot/Makefile b/arch/ppc64/boot/Makefile
index 683b2d43c15f..2c5f5e73d00c 100644
--- a/arch/ppc64/boot/Makefile
+++ b/arch/ppc64/boot/Makefile
@@ -22,8 +22,8 @@
22 22
23 23
24HOSTCC := gcc 24HOSTCC := gcc
25BOOTCFLAGS := $(HOSTCFLAGS) $(LINUXINCLUDE) -fno-builtin 25BOOTCFLAGS := $(HOSTCFLAGS) -fno-builtin -nostdinc -isystem $(shell $(CROSS32CC) -print-file-name=include)
26BOOTAFLAGS := -D__ASSEMBLY__ $(BOOTCFLAGS) -traditional 26BOOTAFLAGS := -D__ASSEMBLY__ $(BOOTCFLAGS) -traditional -nostdinc
27BOOTLFLAGS := -Ttext 0x00400000 -e _start -T $(srctree)/$(src)/zImage.lds 27BOOTLFLAGS := -Ttext 0x00400000 -e _start -T $(srctree)/$(src)/zImage.lds
28OBJCOPYFLAGS := contents,alloc,load,readonly,data 28OBJCOPYFLAGS := contents,alloc,load,readonly,data
29 29
diff --git a/arch/ppc64/boot/addnote.c b/arch/ppc64/boot/addnote.c
index 719663a694bb..8041a9845ab7 100644
--- a/arch/ppc64/boot/addnote.c
+++ b/arch/ppc64/boot/addnote.c
@@ -157,7 +157,7 @@ main(int ac, char **av)
157 PUT_32BE(ns, strlen(arch) + 1); 157 PUT_32BE(ns, strlen(arch) + 1);
158 PUT_32BE(ns + 4, N_DESCR * 4); 158 PUT_32BE(ns + 4, N_DESCR * 4);
159 PUT_32BE(ns + 8, 0x1275); 159 PUT_32BE(ns + 8, 0x1275);
160 strcpy(&buf[ns + 12], arch); 160 strcpy((char *) &buf[ns + 12], arch);
161 ns += 12 + strlen(arch) + 1; 161 ns += 12 + strlen(arch) + 1;
162 for (i = 0; i < N_DESCR; ++i, ns += 4) 162 for (i = 0; i < N_DESCR; ++i, ns += 4)
163 PUT_32BE(ns, descr[i]); 163 PUT_32BE(ns, descr[i]);
@@ -172,7 +172,7 @@ main(int ac, char **av)
172 PUT_32BE(ns, strlen(rpaname) + 1); 172 PUT_32BE(ns, strlen(rpaname) + 1);
173 PUT_32BE(ns + 4, sizeof(rpanote)); 173 PUT_32BE(ns + 4, sizeof(rpanote));
174 PUT_32BE(ns + 8, 0x12759999); 174 PUT_32BE(ns + 8, 0x12759999);
175 strcpy(&buf[ns + 12], rpaname); 175 strcpy((char *) &buf[ns + 12], rpaname);
176 ns += 12 + ROUNDUP(strlen(rpaname) + 1); 176 ns += 12 + ROUNDUP(strlen(rpaname) + 1);
177 for (i = 0; i < N_RPA_DESCR; ++i, ns += 4) 177 for (i = 0; i < N_RPA_DESCR; ++i, ns += 4)
178 PUT_32BE(ns, rpanote[i]); 178 PUT_32BE(ns, rpanote[i]);
diff --git a/arch/ppc64/boot/crt0.S b/arch/ppc64/boot/crt0.S
index 04d3e74cd72f..3861e7f9cf19 100644
--- a/arch/ppc64/boot/crt0.S
+++ b/arch/ppc64/boot/crt0.S
@@ -9,7 +9,7 @@
9 * NOTE: this code runs in 32 bit mode and is packaged as ELF32. 9 * NOTE: this code runs in 32 bit mode and is packaged as ELF32.
10 */ 10 */
11 11
12#include <asm/ppc_asm.h> 12#include "ppc_asm.h"
13 13
14 .text 14 .text
15 .globl _start 15 .globl _start
diff --git a/arch/ppc64/boot/div64.S b/arch/ppc64/boot/div64.S
index 38f7e466d7d6..722f360a32a9 100644
--- a/arch/ppc64/boot/div64.S
+++ b/arch/ppc64/boot/div64.S
@@ -13,7 +13,7 @@
13 * as published by the Free Software Foundation; either version 13 * as published by the Free Software Foundation; either version
14 * 2 of the License, or (at your option) any later version. 14 * 2 of the License, or (at your option) any later version.
15 */ 15 */
16#include <asm/ppc_asm.h> 16#include "ppc_asm.h"
17 17
18 .globl __div64_32 18 .globl __div64_32
19__div64_32: 19__div64_32:
diff --git a/arch/ppc64/boot/elf.h b/arch/ppc64/boot/elf.h
new file mode 100644
index 000000000000..d4828fcf1cb9
--- /dev/null
+++ b/arch/ppc64/boot/elf.h
@@ -0,0 +1,149 @@
1#ifndef _PPC_BOOT_ELF_H_
2#define _PPC_BOOT_ELF_H_
3
4/* 32-bit ELF base types. */
5typedef unsigned int Elf32_Addr;
6typedef unsigned short Elf32_Half;
7typedef unsigned int Elf32_Off;
8typedef signed int Elf32_Sword;
9typedef unsigned int Elf32_Word;
10
11/* 64-bit ELF base types. */
12typedef unsigned long long Elf64_Addr;
13typedef unsigned short Elf64_Half;
14typedef signed short Elf64_SHalf;
15typedef unsigned long long Elf64_Off;
16typedef signed int Elf64_Sword;
17typedef unsigned int Elf64_Word;
18typedef unsigned long long Elf64_Xword;
19typedef signed long long Elf64_Sxword;
20
21/* These constants are for the segment types stored in the image headers */
22#define PT_NULL 0
23#define PT_LOAD 1
24#define PT_DYNAMIC 2
25#define PT_INTERP 3
26#define PT_NOTE 4
27#define PT_SHLIB 5
28#define PT_PHDR 6
29#define PT_TLS 7 /* Thread local storage segment */
30#define PT_LOOS 0x60000000 /* OS-specific */
31#define PT_HIOS 0x6fffffff /* OS-specific */
32#define PT_LOPROC 0x70000000
33#define PT_HIPROC 0x7fffffff
34#define PT_GNU_EH_FRAME 0x6474e550
35
36#define PT_GNU_STACK (PT_LOOS + 0x474e551)
37
38/* These constants define the different elf file types */
39#define ET_NONE 0
40#define ET_REL 1
41#define ET_EXEC 2
42#define ET_DYN 3
43#define ET_CORE 4
44#define ET_LOPROC 0xff00
45#define ET_HIPROC 0xffff
46
47/* These constants define the various ELF target machines */
48#define EM_NONE 0
49#define EM_PPC 20 /* PowerPC */
50#define EM_PPC64 21 /* PowerPC64 */
51
52#define EI_NIDENT 16
53
54typedef struct elf32_hdr {
55 unsigned char e_ident[EI_NIDENT];
56 Elf32_Half e_type;
57 Elf32_Half e_machine;
58 Elf32_Word e_version;
59 Elf32_Addr e_entry; /* Entry point */
60 Elf32_Off e_phoff;
61 Elf32_Off e_shoff;
62 Elf32_Word e_flags;
63 Elf32_Half e_ehsize;
64 Elf32_Half e_phentsize;
65 Elf32_Half e_phnum;
66 Elf32_Half e_shentsize;
67 Elf32_Half e_shnum;
68 Elf32_Half e_shstrndx;
69} Elf32_Ehdr;
70
71typedef struct elf64_hdr {
72 unsigned char e_ident[16]; /* ELF "magic number" */
73 Elf64_Half e_type;
74 Elf64_Half e_machine;
75 Elf64_Word e_version;
76 Elf64_Addr e_entry; /* Entry point virtual address */
77 Elf64_Off e_phoff; /* Program header table file offset */
78 Elf64_Off e_shoff; /* Section header table file offset */
79 Elf64_Word e_flags;
80 Elf64_Half e_ehsize;
81 Elf64_Half e_phentsize;
82 Elf64_Half e_phnum;
83 Elf64_Half e_shentsize;
84 Elf64_Half e_shnum;
85 Elf64_Half e_shstrndx;
86} Elf64_Ehdr;
87
88/* These constants define the permissions on sections in the program
89 header, p_flags. */
90#define PF_R 0x4
91#define PF_W 0x2
92#define PF_X 0x1
93
94typedef struct elf32_phdr {
95 Elf32_Word p_type;
96 Elf32_Off p_offset;
97 Elf32_Addr p_vaddr;
98 Elf32_Addr p_paddr;
99 Elf32_Word p_filesz;
100 Elf32_Word p_memsz;
101 Elf32_Word p_flags;
102 Elf32_Word p_align;
103} Elf32_Phdr;
104
105typedef struct elf64_phdr {
106 Elf64_Word p_type;
107 Elf64_Word p_flags;
108 Elf64_Off p_offset; /* Segment file offset */
109 Elf64_Addr p_vaddr; /* Segment virtual address */
110 Elf64_Addr p_paddr; /* Segment physical address */
111 Elf64_Xword p_filesz; /* Segment size in file */
112 Elf64_Xword p_memsz; /* Segment size in memory */
113 Elf64_Xword p_align; /* Segment alignment, file & memory */
114} Elf64_Phdr;
115
116#define EI_MAG0 0 /* e_ident[] indexes */
117#define EI_MAG1 1
118#define EI_MAG2 2
119#define EI_MAG3 3
120#define EI_CLASS 4
121#define EI_DATA 5
122#define EI_VERSION 6
123#define EI_OSABI 7
124#define EI_PAD 8
125
126#define ELFMAG0 0x7f /* EI_MAG */
127#define ELFMAG1 'E'
128#define ELFMAG2 'L'
129#define ELFMAG3 'F'
130#define ELFMAG "\177ELF"
131#define SELFMAG 4
132
133#define ELFCLASSNONE 0 /* EI_CLASS */
134#define ELFCLASS32 1
135#define ELFCLASS64 2
136#define ELFCLASSNUM 3
137
138#define ELFDATANONE 0 /* e_ident[EI_DATA] */
139#define ELFDATA2LSB 1
140#define ELFDATA2MSB 2
141
142#define EV_NONE 0 /* e_version, EI_VERSION */
143#define EV_CURRENT 1
144#define EV_NUM 2
145
146#define ELFOSABI_NONE 0
147#define ELFOSABI_LINUX 3
148
149#endif /* _PPC_BOOT_ELF_H_ */
diff --git a/arch/ppc64/boot/main.c b/arch/ppc64/boot/main.c
index 199d9804f61c..99e68cfbe688 100644
--- a/arch/ppc64/boot/main.c
+++ b/arch/ppc64/boot/main.c
@@ -8,36 +8,28 @@
8 * as published by the Free Software Foundation; either version 8 * as published by the Free Software Foundation; either version
9 * 2 of the License, or (at your option) any later version. 9 * 2 of the License, or (at your option) any later version.
10 */ 10 */
11#include "ppc32-types.h" 11#include <stdarg.h>
12#include <stddef.h>
13#include "elf.h"
14#include "page.h"
15#include "string.h"
16#include "stdio.h"
17#include "prom.h"
12#include "zlib.h" 18#include "zlib.h"
13#include <linux/elf.h> 19
14#include <linux/string.h> 20static void gunzip(void *, int, unsigned char *, int *);
15#include <asm/processor.h> 21extern void flush_cache(void *, unsigned long);
16#include <asm/page.h> 22
17
18extern void *finddevice(const char *);
19extern int getprop(void *, const char *, void *, int);
20extern void printf(const char *fmt, ...);
21extern int sprintf(char *buf, const char *fmt, ...);
22void gunzip(void *, int, unsigned char *, int *);
23void *claim(unsigned int, unsigned int, unsigned int);
24void flush_cache(void *, unsigned long);
25void pause(void);
26extern void exit(void);
27
28unsigned long strlen(const char *s);
29void *memmove(void *dest, const void *src, unsigned long n);
30void *memcpy(void *dest, const void *src, unsigned long n);
31 23
32/* Value picked to match that used by yaboot */ 24/* Value picked to match that used by yaboot */
33#define PROG_START 0x01400000 25#define PROG_START 0x01400000
34#define RAM_END (256<<20) // Fixme: use OF */ 26#define RAM_END (256<<20) // Fixme: use OF */
35 27
36char *avail_ram; 28static char *avail_ram;
37char *begin_avail, *end_avail; 29static char *begin_avail, *end_avail;
38char *avail_high; 30static char *avail_high;
39unsigned int heap_use; 31static unsigned int heap_use;
40unsigned int heap_max; 32static unsigned int heap_max;
41 33
42extern char _start[]; 34extern char _start[];
43extern char _vmlinux_start[]; 35extern char _vmlinux_start[];
@@ -52,9 +44,9 @@ struct addr_range {
52 unsigned long size; 44 unsigned long size;
53 unsigned long memsize; 45 unsigned long memsize;
54}; 46};
55struct addr_range vmlinux = {0, 0, 0}; 47static struct addr_range vmlinux = {0, 0, 0};
56struct addr_range vmlinuz = {0, 0, 0}; 48static struct addr_range vmlinuz = {0, 0, 0};
57struct addr_range initrd = {0, 0, 0}; 49static struct addr_range initrd = {0, 0, 0};
58 50
59static char scratch[128<<10]; /* 128kB of scratch space for gunzip */ 51static char scratch[128<<10]; /* 128kB of scratch space for gunzip */
60 52
@@ -64,13 +56,6 @@ typedef void (*kernel_entry_t)( unsigned long,
64 void *); 56 void *);
65 57
66 58
67int (*prom)(void *);
68
69void *chosen_handle;
70void *stdin;
71void *stdout;
72void *stderr;
73
74#undef DEBUG 59#undef DEBUG
75 60
76static unsigned long claim_base = PROG_START; 61static unsigned long claim_base = PROG_START;
@@ -277,7 +262,7 @@ void zfree(void *x, void *addr, unsigned nb)
277 262
278#define DEFLATED 8 263#define DEFLATED 8
279 264
280void gunzip(void *dst, int dstlen, unsigned char *src, int *lenp) 265static void gunzip(void *dst, int dstlen, unsigned char *src, int *lenp)
281{ 266{
282 z_stream s; 267 z_stream s;
283 int r, i, flags; 268 int r, i, flags;
diff --git a/arch/ppc64/boot/page.h b/arch/ppc64/boot/page.h
new file mode 100644
index 000000000000..14eca30fef64
--- /dev/null
+++ b/arch/ppc64/boot/page.h
@@ -0,0 +1,34 @@
1#ifndef _PPC_BOOT_PAGE_H
2#define _PPC_BOOT_PAGE_H
3/*
4 * Copyright (C) 2001 PPC64 Team, IBM Corp
5 *
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License
8 * as published by the Free Software Foundation; either version
9 * 2 of the License, or (at your option) any later version.
10 */
11
12#ifdef __ASSEMBLY__
13#define ASM_CONST(x) x
14#else
15#define __ASM_CONST(x) x##UL
16#define ASM_CONST(x) __ASM_CONST(x)
17#endif
18
19/* PAGE_SHIFT determines the page size */
20#define PAGE_SHIFT 12
21#define PAGE_SIZE (ASM_CONST(1) << PAGE_SHIFT)
22#define PAGE_MASK (~(PAGE_SIZE-1))
23
24/* align addr on a size boundary - adjust address up/down if needed */
25#define _ALIGN_UP(addr,size) (((addr)+((size)-1))&(~((size)-1)))
26#define _ALIGN_DOWN(addr,size) ((addr)&(~((size)-1)))
27
28/* align addr on a size boundary - adjust address up if needed */
29#define _ALIGN(addr,size) _ALIGN_UP(addr,size)
30
31/* to align the pointer to the (next) page boundary */
32#define PAGE_ALIGN(addr) _ALIGN(addr, PAGE_SIZE)
33
34#endif /* _PPC_BOOT_PAGE_H */
diff --git a/arch/ppc64/boot/ppc32-types.h b/arch/ppc64/boot/ppc32-types.h
deleted file mode 100644
index f7b8884f8f70..000000000000
--- a/arch/ppc64/boot/ppc32-types.h
+++ /dev/null
@@ -1,36 +0,0 @@
1#ifndef _PPC64_TYPES_H
2#define _PPC64_TYPES_H
3
4typedef __signed__ char __s8;
5typedef unsigned char __u8;
6
7typedef __signed__ short __s16;
8typedef unsigned short __u16;
9
10typedef __signed__ int __s32;
11typedef unsigned int __u32;
12
13typedef __signed__ long long __s64;
14typedef unsigned long long __u64;
15
16typedef signed char s8;
17typedef unsigned char u8;
18
19typedef signed short s16;
20typedef unsigned short u16;
21
22typedef signed int s32;
23typedef unsigned int u32;
24
25typedef signed long long s64;
26typedef unsigned long long u64;
27
28typedef struct {
29 __u32 u[4];
30} __attribute((aligned(16))) __vector128;
31
32#define BITS_PER_LONG 32
33
34typedef __vector128 vector128;
35
36#endif /* _PPC64_TYPES_H */
diff --git a/arch/ppc64/boot/ppc_asm.h b/arch/ppc64/boot/ppc_asm.h
new file mode 100644
index 000000000000..1c2c2817f9b7
--- /dev/null
+++ b/arch/ppc64/boot/ppc_asm.h
@@ -0,0 +1,62 @@
1#ifndef _PPC64_PPC_ASM_H
2#define _PPC64_PPC_ASM_H
3/*
4 *
5 * Definitions used by various bits of low-level assembly code on PowerPC.
6 *
7 * Copyright (C) 1995-1999 Gary Thomas, Paul Mackerras, Cort Dougan.
8 *
9 * This program is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU General Public License
11 * as published by the Free Software Foundation; either version
12 * 2 of the License, or (at your option) any later version.
13 */
14
15/* Condition Register Bit Fields */
16
17#define cr0 0
18#define cr1 1
19#define cr2 2
20#define cr3 3
21#define cr4 4
22#define cr5 5
23#define cr6 6
24#define cr7 7
25
26
27/* General Purpose Registers (GPRs) */
28
29#define r0 0
30#define r1 1
31#define r2 2
32#define r3 3
33#define r4 4
34#define r5 5
35#define r6 6
36#define r7 7
37#define r8 8
38#define r9 9
39#define r10 10
40#define r11 11
41#define r12 12
42#define r13 13
43#define r14 14
44#define r15 15
45#define r16 16
46#define r17 17
47#define r18 18
48#define r19 19
49#define r20 20
50#define r21 21
51#define r22 22
52#define r23 23
53#define r24 24
54#define r25 25
55#define r26 26
56#define r27 27
57#define r28 28
58#define r29 29
59#define r30 30
60#define r31 31
61
62#endif /* _PPC64_PPC_ASM_H */
diff --git a/arch/ppc64/boot/prom.c b/arch/ppc64/boot/prom.c
index 5e48b80ff5a0..4bea2f4dcb06 100644
--- a/arch/ppc64/boot/prom.c
+++ b/arch/ppc64/boot/prom.c
@@ -7,43 +7,19 @@
7 * 2 of the License, or (at your option) any later version. 7 * 2 of the License, or (at your option) any later version.
8 */ 8 */
9#include <stdarg.h> 9#include <stdarg.h>
10#include <linux/types.h> 10#include <stddef.h>
11#include <linux/string.h> 11#include "string.h"
12#include <linux/ctype.h> 12#include "stdio.h"
13 13#include "prom.h"
14extern __u32 __div64_32(unsigned long long *dividend, __u32 divisor);
15
16/* The unnecessary pointer compare is there
17 * to check for type safety (n must be 64bit)
18 */
19# define do_div(n,base) ({ \
20 __u32 __base = (base); \
21 __u32 __rem; \
22 (void)(((typeof((n)) *)0) == ((unsigned long long *)0)); \
23 if (((n) >> 32) == 0) { \
24 __rem = (__u32)(n) % __base; \
25 (n) = (__u32)(n) / __base; \
26 } else \
27 __rem = __div64_32(&(n), __base); \
28 __rem; \
29 })
30 14
31int (*prom)(void *); 15int (*prom)(void *);
32 16
33void *chosen_handle; 17void *chosen_handle;
18
34void *stdin; 19void *stdin;
35void *stdout; 20void *stdout;
36void *stderr; 21void *stderr;
37 22
38void exit(void);
39void *finddevice(const char *name);
40int getprop(void *phandle, const char *name, void *buf, int buflen);
41void chrpboot(int a1, int a2, void *prom); /* in main.c */
42
43int printf(char *fmt, ...);
44
45/* there is no convenient header to get this from... -- paulus */
46extern unsigned long strlen(const char *);
47 23
48int 24int
49write(void *handle, void *ptr, int nb) 25write(void *handle, void *ptr, int nb)
@@ -210,107 +186,6 @@ fputs(char *str, void *f)
210 return write(f, str, n) == n? 0: -1; 186 return write(f, str, n) == n? 0: -1;
211} 187}
212 188
213int
214readchar(void)
215{
216 char ch;
217
218 for (;;) {
219 switch (read(stdin, &ch, 1)) {
220 case 1:
221 return ch;
222 case -1:
223 printf("read(stdin) returned -1\r\n");
224 return -1;
225 }
226 }
227}
228
229static char line[256];
230static char *lineptr;
231static int lineleft;
232
233int
234getchar(void)
235{
236 int c;
237
238 if (lineleft == 0) {
239 lineptr = line;
240 for (;;) {
241 c = readchar();
242 if (c == -1 || c == 4)
243 break;
244 if (c == '\r' || c == '\n') {
245 *lineptr++ = '\n';
246 putchar('\n');
247 break;
248 }
249 switch (c) {
250 case 0177:
251 case '\b':
252 if (lineptr > line) {
253 putchar('\b');
254 putchar(' ');
255 putchar('\b');
256 --lineptr;
257 }
258 break;
259 case 'U' & 0x1F:
260 while (lineptr > line) {
261 putchar('\b');
262 putchar(' ');
263 putchar('\b');
264 --lineptr;
265 }
266 break;
267 default:
268 if (lineptr >= &line[sizeof(line) - 1])
269 putchar('\a');
270 else {
271 putchar(c);
272 *lineptr++ = c;
273 }
274 }
275 }
276 lineleft = lineptr - line;
277 lineptr = line;
278 }
279 if (lineleft == 0)
280 return -1;
281 --lineleft;
282 return *lineptr++;
283}
284
285
286
287/* String functions lifted from lib/vsprintf.c and lib/ctype.c */
288unsigned char _ctype[] = {
289_C,_C,_C,_C,_C,_C,_C,_C, /* 0-7 */
290_C,_C|_S,_C|_S,_C|_S,_C|_S,_C|_S,_C,_C, /* 8-15 */
291_C,_C,_C,_C,_C,_C,_C,_C, /* 16-23 */
292_C,_C,_C,_C,_C,_C,_C,_C, /* 24-31 */
293_S|_SP,_P,_P,_P,_P,_P,_P,_P, /* 32-39 */
294_P,_P,_P,_P,_P,_P,_P,_P, /* 40-47 */
295_D,_D,_D,_D,_D,_D,_D,_D, /* 48-55 */
296_D,_D,_P,_P,_P,_P,_P,_P, /* 56-63 */
297_P,_U|_X,_U|_X,_U|_X,_U|_X,_U|_X,_U|_X,_U, /* 64-71 */
298_U,_U,_U,_U,_U,_U,_U,_U, /* 72-79 */
299_U,_U,_U,_U,_U,_U,_U,_U, /* 80-87 */
300_U,_U,_U,_P,_P,_P,_P,_P, /* 88-95 */
301_P,_L|_X,_L|_X,_L|_X,_L|_X,_L|_X,_L|_X,_L, /* 96-103 */
302_L,_L,_L,_L,_L,_L,_L,_L, /* 104-111 */
303_L,_L,_L,_L,_L,_L,_L,_L, /* 112-119 */
304_L,_L,_L,_P,_P,_P,_P,_C, /* 120-127 */
3050,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* 128-143 */
3060,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* 144-159 */
307_S|_SP,_P,_P,_P,_P,_P,_P,_P,_P,_P,_P,_P,_P,_P,_P,_P, /* 160-175 */
308_P,_P,_P,_P,_P,_P,_P,_P,_P,_P,_P,_P,_P,_P,_P,_P, /* 176-191 */
309_U,_U,_U,_U,_U,_U,_U,_U,_U,_U,_U,_U,_U,_U,_U,_U, /* 192-207 */
310_U,_U,_U,_U,_U,_U,_U,_P,_U,_U,_U,_U,_U,_U,_U,_L, /* 208-223 */
311_L,_L,_L,_L,_L,_L,_L,_L,_L,_L,_L,_L,_L,_L,_L,_L, /* 224-239 */
312_L,_L,_L,_L,_L,_L,_L,_P,_L,_L,_L,_L,_L,_L,_L,_L}; /* 240-255 */
313
314size_t strnlen(const char * s, size_t count) 189size_t strnlen(const char * s, size_t count)
315{ 190{
316 const char *sc; 191 const char *sc;
@@ -320,44 +195,30 @@ size_t strnlen(const char * s, size_t count)
320 return sc - s; 195 return sc - s;
321} 196}
322 197
323unsigned long simple_strtoul(const char *cp,char **endp,unsigned int base) 198extern unsigned int __div64_32(unsigned long long *dividend,
324{ 199 unsigned int divisor);
325 unsigned long result = 0,value;
326 200
327 if (!base) { 201/* The unnecessary pointer compare is there
328 base = 10; 202 * to check for type safety (n must be 64bit)
329 if (*cp == '0') { 203 */
330 base = 8; 204# define do_div(n,base) ({ \
331 cp++; 205 unsigned int __base = (base); \
332 if ((*cp == 'x') && isxdigit(cp[1])) { 206 unsigned int __rem; \
333 cp++; 207 (void)(((typeof((n)) *)0) == ((unsigned long long *)0)); \
334 base = 16; 208 if (((n) >> 32) == 0) { \
335 } 209 __rem = (unsigned int)(n) % __base; \
336 } 210 (n) = (unsigned int)(n) / __base; \
337 } 211 } else \
338 while (isxdigit(*cp) && 212 __rem = __div64_32(&(n), __base); \
339 (value = isdigit(*cp) ? *cp-'0' : toupper(*cp)-'A'+10) < base) { 213 __rem; \
340 result = result*base + value; 214 })
341 cp++;
342 }
343 if (endp)
344 *endp = (char *)cp;
345 return result;
346}
347
348long simple_strtol(const char *cp,char **endp,unsigned int base)
349{
350 if(*cp=='-')
351 return -simple_strtoul(cp+1,endp,base);
352 return simple_strtoul(cp,endp,base);
353}
354 215
355static int skip_atoi(const char **s) 216static int skip_atoi(const char **s)
356{ 217{
357 int i=0; 218 int i, c;
358 219
359 while (isdigit(**s)) 220 for (i = 0; '0' <= (c = **s) && c <= '9'; ++*s)
360 i = i*10 + *((*s)++) - '0'; 221 i = i*10 + c - '0';
361 return i; 222 return i;
362} 223}
363 224
@@ -436,9 +297,6 @@ static char * number(char * str, unsigned long long num, int base, int size, int
436 return str; 297 return str;
437} 298}
438 299
439/* Forward decl. needed for IP address printing stuff... */
440int sprintf(char * buf, const char *fmt, ...);
441
442int vsprintf(char *buf, const char *fmt, va_list args) 300int vsprintf(char *buf, const char *fmt, va_list args)
443{ 301{
444 int len; 302 int len;
@@ -477,7 +335,7 @@ int vsprintf(char *buf, const char *fmt, va_list args)
477 335
478 /* get field width */ 336 /* get field width */
479 field_width = -1; 337 field_width = -1;
480 if (isdigit(*fmt)) 338 if ('0' <= *fmt && *fmt <= '9')
481 field_width = skip_atoi(&fmt); 339 field_width = skip_atoi(&fmt);
482 else if (*fmt == '*') { 340 else if (*fmt == '*') {
483 ++fmt; 341 ++fmt;
@@ -493,7 +351,7 @@ int vsprintf(char *buf, const char *fmt, va_list args)
493 precision = -1; 351 precision = -1;
494 if (*fmt == '.') { 352 if (*fmt == '.') {
495 ++fmt; 353 ++fmt;
496 if (isdigit(*fmt)) 354 if ('0' <= *fmt && *fmt <= '9')
497 precision = skip_atoi(&fmt); 355 precision = skip_atoi(&fmt);
498 else if (*fmt == '*') { 356 else if (*fmt == '*') {
499 ++fmt; 357 ++fmt;
@@ -628,7 +486,7 @@ int sprintf(char * buf, const char *fmt, ...)
628static char sprint_buf[1024]; 486static char sprint_buf[1024];
629 487
630int 488int
631printf(char *fmt, ...) 489printf(const char *fmt, ...)
632{ 490{
633 va_list args; 491 va_list args;
634 int n; 492 int n;
diff --git a/arch/ppc64/boot/prom.h b/arch/ppc64/boot/prom.h
new file mode 100644
index 000000000000..96ab5aec740c
--- /dev/null
+++ b/arch/ppc64/boot/prom.h
@@ -0,0 +1,18 @@
1#ifndef _PPC_BOOT_PROM_H_
2#define _PPC_BOOT_PROM_H_
3
4extern int (*prom) (void *);
5extern void *chosen_handle;
6
7extern void *stdin;
8extern void *stdout;
9extern void *stderr;
10
11extern int write(void *handle, void *ptr, int nb);
12extern int read(void *handle, void *ptr, int nb);
13extern void exit(void);
14extern void pause(void);
15extern void *finddevice(const char *);
16extern void *claim(unsigned long virt, unsigned long size, unsigned long align);
17extern int getprop(void *phandle, const char *name, void *buf, int buflen);
18#endif /* _PPC_BOOT_PROM_H_ */
diff --git a/arch/ppc64/boot/stdio.h b/arch/ppc64/boot/stdio.h
new file mode 100644
index 000000000000..24bd3a8dee94
--- /dev/null
+++ b/arch/ppc64/boot/stdio.h
@@ -0,0 +1,16 @@
1#ifndef _PPC_BOOT_STDIO_H_
2#define _PPC_BOOT_STDIO_H_
3
4extern int printf(const char *fmt, ...);
5
6extern int sprintf(char *buf, const char *fmt, ...);
7
8extern int vsprintf(char *buf, const char *fmt, va_list args);
9
10extern int putc(int c, void *f);
11extern int putchar(int c);
12extern int getchar(void);
13
14extern int fputs(char *str, void *f);
15
16#endif /* _PPC_BOOT_STDIO_H_ */
diff --git a/arch/ppc64/boot/string.S b/arch/ppc64/boot/string.S
index ba5f2d21c9ea..7ade87ae7718 100644
--- a/arch/ppc64/boot/string.S
+++ b/arch/ppc64/boot/string.S
@@ -9,7 +9,7 @@
9 * NOTE: this code runs in 32 bit mode and is packaged as ELF32. 9 * NOTE: this code runs in 32 bit mode and is packaged as ELF32.
10 */ 10 */
11 11
12#include <asm/ppc_asm.h> 12#include "ppc_asm.h"
13 13
14 .text 14 .text
15 .globl strcpy 15 .globl strcpy
diff --git a/arch/ppc64/boot/string.h b/arch/ppc64/boot/string.h
new file mode 100644
index 000000000000..9289258bcbd6
--- /dev/null
+++ b/arch/ppc64/boot/string.h
@@ -0,0 +1,16 @@
1#ifndef _PPC_BOOT_STRING_H_
2#define _PPC_BOOT_STRING_H_
3
4extern char *strcpy(char *dest, const char *src);
5extern char *strncpy(char *dest, const char *src, size_t n);
6extern char *strcat(char *dest, const char *src);
7extern int strcmp(const char *s1, const char *s2);
8extern size_t strlen(const char *s);
9extern size_t strnlen(const char *s, size_t count);
10
11extern void *memset(void *s, int c, size_t n);
12extern void *memmove(void *dest, const void *src, unsigned long n);
13extern void *memcpy(void *dest, const void *src, unsigned long n);
14extern int memcmp(const void *s1, const void *s2, size_t n);
15
16#endif /* _PPC_BOOT_STRING_H_ */
diff --git a/arch/ppc64/boot/zlib.c b/arch/ppc64/boot/zlib.c
index 9d5e4e9832d2..0d910cd2079d 100644
--- a/arch/ppc64/boot/zlib.c
+++ b/arch/ppc64/boot/zlib.c
@@ -107,7 +107,7 @@ extern void *memcpy(void *, const void *, unsigned long);
107 107
108/* Diagnostic functions */ 108/* Diagnostic functions */
109#ifdef DEBUG_ZLIB 109#ifdef DEBUG_ZLIB
110# include <stdio.h> 110# include "stdio.h"
111# ifndef verbose 111# ifndef verbose
112# define verbose 0 112# define verbose 0
113# endif 113# endif
@@ -1307,7 +1307,7 @@ local int huft_build(
1307 { 1307 {
1308 *t = (inflate_huft *)Z_NULL; 1308 *t = (inflate_huft *)Z_NULL;
1309 *m = 0; 1309 *m = 0;
1310 return Z_OK; 1310 return Z_DATA_ERROR;
1311 } 1311 }
1312 1312
1313 1313
@@ -1351,6 +1351,7 @@ local int huft_build(
1351 if ((j = *p++) != 0) 1351 if ((j = *p++) != 0)
1352 v[x[j]++] = i; 1352 v[x[j]++] = i;
1353 } while (++i < n); 1353 } while (++i < n);
1354 n = x[g]; /* set n to length of v */
1354 1355
1355 1356
1356 /* Generate the Huffman codes and for each, make the table entries */ 1357 /* Generate the Huffman codes and for each, make the table entries */
diff --git a/arch/ppc64/configs/bpa_defconfig b/arch/ppc64/configs/bpa_defconfig
new file mode 100644
index 000000000000..46c5da41c3ae
--- /dev/null
+++ b/arch/ppc64/configs/bpa_defconfig
@@ -0,0 +1,987 @@
1#
2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.13-rc6
4# Mon Aug 8 14:12:19 2005
5#
6CONFIG_64BIT=y
7CONFIG_MMU=y
8CONFIG_RWSEM_XCHGADD_ALGORITHM=y
9CONFIG_GENERIC_CALIBRATE_DELAY=y
10CONFIG_GENERIC_ISA_DMA=y
11CONFIG_HAVE_DEC_LOCK=y
12CONFIG_EARLY_PRINTK=y
13CONFIG_COMPAT=y
14CONFIG_SCHED_NO_NO_OMIT_FRAME_POINTER=y
15CONFIG_FORCE_MAX_ZONEORDER=13
16
17#
18# Code maturity level options
19#
20CONFIG_EXPERIMENTAL=y
21CONFIG_CLEAN_COMPILE=y
22CONFIG_LOCK_KERNEL=y
23CONFIG_INIT_ENV_ARG_LIMIT=32
24
25#
26# General setup
27#
28CONFIG_LOCALVERSION=""
29CONFIG_SWAP=y
30CONFIG_SYSVIPC=y
31# CONFIG_POSIX_MQUEUE is not set
32# CONFIG_BSD_PROCESS_ACCT is not set
33CONFIG_SYSCTL=y
34# CONFIG_AUDIT is not set
35CONFIG_HOTPLUG=y
36CONFIG_KOBJECT_UEVENT=y
37# CONFIG_IKCONFIG is not set
38# CONFIG_CPUSETS is not set
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_PRINTK=y
44CONFIG_BUG=y
45CONFIG_BASE_FULL=y
46CONFIG_FUTEX=y
47CONFIG_EPOLL=y
48CONFIG_SHMEM=y
49CONFIG_CC_ALIGN_FUNCTIONS=0
50CONFIG_CC_ALIGN_LABELS=0
51CONFIG_CC_ALIGN_LOOPS=0
52CONFIG_CC_ALIGN_JUMPS=0
53# CONFIG_TINY_SHMEM is not set
54CONFIG_BASE_SMALL=0
55
56#
57# Loadable module support
58#
59CONFIG_MODULES=y
60CONFIG_MODULE_UNLOAD=y
61# CONFIG_MODULE_FORCE_UNLOAD is not set
62CONFIG_OBSOLETE_MODPARM=y
63# CONFIG_MODVERSIONS is not set
64# CONFIG_MODULE_SRCVERSION_ALL is not set
65# CONFIG_KMOD is not set
66CONFIG_STOP_MACHINE=y
67CONFIG_SYSVIPC_COMPAT=y
68
69#
70# Platform support
71#
72# CONFIG_PPC_ISERIES is not set
73CONFIG_PPC_MULTIPLATFORM=y
74# CONFIG_PPC_PSERIES is not set
75CONFIG_PPC_BPA=y
76# CONFIG_PPC_PMAC is not set
77# CONFIG_PPC_MAPLE is not set
78CONFIG_PPC=y
79CONFIG_PPC64=y
80CONFIG_PPC_OF=y
81CONFIG_BPA_IIC=y
82CONFIG_ALTIVEC=y
83CONFIG_KEXEC=y
84# CONFIG_U3_DART is not set
85# CONFIG_BOOTX_TEXT is not set
86# CONFIG_POWER4_ONLY is not set
87# CONFIG_IOMMU_VMERGE is not set
88CONFIG_SMP=y
89CONFIG_NR_CPUS=4
90CONFIG_ARCH_SELECT_MEMORY_MODEL=y
91CONFIG_ARCH_FLATMEM_ENABLE=y
92CONFIG_SELECT_MEMORY_MODEL=y
93CONFIG_FLATMEM_MANUAL=y
94# CONFIG_DISCONTIGMEM_MANUAL is not set
95# CONFIG_SPARSEMEM_MANUAL is not set
96CONFIG_FLATMEM=y
97CONFIG_FLAT_NODE_MEM_MAP=y
98# CONFIG_NUMA is not set
99CONFIG_SCHED_SMT=y
100CONFIG_PREEMPT_NONE=y
101# CONFIG_PREEMPT_VOLUNTARY is not set
102# CONFIG_PREEMPT is not set
103CONFIG_PREEMPT_BKL=y
104# CONFIG_HZ_100 is not set
105CONFIG_HZ_250=y
106# CONFIG_HZ_1000 is not set
107CONFIG_HZ=250
108CONFIG_GENERIC_HARDIRQS=y
109CONFIG_PPC_RTAS=y
110CONFIG_RTAS_PROC=y
111CONFIG_RTAS_FLASH=y
112CONFIG_SECCOMP=y
113CONFIG_ISA_DMA_API=y
114
115#
116# General setup
117#
118CONFIG_PCI=y
119CONFIG_PCI_DOMAINS=y
120CONFIG_BINFMT_ELF=y
121# CONFIG_BINFMT_MISC is not set
122CONFIG_PCI_LEGACY_PROC=y
123CONFIG_PCI_NAMES=y
124# CONFIG_PCI_DEBUG is not set
125
126#
127# PCCARD (PCMCIA/CardBus) support
128#
129# CONFIG_PCCARD is not set
130
131#
132# PCI Hotplug Support
133#
134# CONFIG_HOTPLUG_PCI is not set
135CONFIG_PROC_DEVICETREE=y
136# CONFIG_CMDLINE_BOOL is not set
137
138#
139# Networking
140#
141CONFIG_NET=y
142
143#
144# Networking options
145#
146CONFIG_PACKET=y
147# CONFIG_PACKET_MMAP is not set
148CONFIG_UNIX=y
149CONFIG_XFRM=y
150# CONFIG_XFRM_USER is not set
151# CONFIG_NET_KEY is not set
152CONFIG_INET=y
153CONFIG_IP_MULTICAST=y
154# CONFIG_IP_ADVANCED_ROUTER is not set
155CONFIG_IP_FIB_HASH=y
156# CONFIG_IP_PNP is not set
157CONFIG_NET_IPIP=y
158# CONFIG_NET_IPGRE is not set
159# CONFIG_IP_MROUTE is not set
160# CONFIG_ARPD is not set
161CONFIG_SYN_COOKIES=y
162# CONFIG_INET_AH is not set
163# CONFIG_INET_ESP is not set
164# CONFIG_INET_IPCOMP is not set
165CONFIG_INET_TUNNEL=y
166CONFIG_IP_TCPDIAG=y
167CONFIG_IP_TCPDIAG_IPV6=y
168# CONFIG_TCP_CONG_ADVANCED is not set
169CONFIG_TCP_CONG_BIC=y
170
171#
172# IP: Virtual Server Configuration
173#
174# CONFIG_IP_VS is not set
175CONFIG_IPV6=y
176# CONFIG_IPV6_PRIVACY is not set
177CONFIG_INET6_AH=m
178CONFIG_INET6_ESP=m
179CONFIG_INET6_IPCOMP=m
180CONFIG_INET6_TUNNEL=m
181CONFIG_IPV6_TUNNEL=m
182CONFIG_NETFILTER=y
183# CONFIG_NETFILTER_DEBUG is not set
184
185#
186# IP: Netfilter Configuration
187#
188CONFIG_IP_NF_CONNTRACK=y
189# CONFIG_IP_NF_CT_ACCT is not set
190# CONFIG_IP_NF_CONNTRACK_MARK is not set
191CONFIG_IP_NF_CT_PROTO_SCTP=y
192CONFIG_IP_NF_FTP=m
193CONFIG_IP_NF_IRC=m
194CONFIG_IP_NF_TFTP=m
195CONFIG_IP_NF_AMANDA=m
196CONFIG_IP_NF_QUEUE=m
197CONFIG_IP_NF_IPTABLES=m
198CONFIG_IP_NF_MATCH_LIMIT=m
199CONFIG_IP_NF_MATCH_IPRANGE=m
200CONFIG_IP_NF_MATCH_MAC=m
201CONFIG_IP_NF_MATCH_PKTTYPE=m
202CONFIG_IP_NF_MATCH_MARK=m
203CONFIG_IP_NF_MATCH_MULTIPORT=m
204CONFIG_IP_NF_MATCH_TOS=m
205CONFIG_IP_NF_MATCH_RECENT=m
206CONFIG_IP_NF_MATCH_ECN=m
207CONFIG_IP_NF_MATCH_DSCP=m
208CONFIG_IP_NF_MATCH_AH_ESP=m
209CONFIG_IP_NF_MATCH_LENGTH=m
210CONFIG_IP_NF_MATCH_TTL=m
211CONFIG_IP_NF_MATCH_TCPMSS=m
212CONFIG_IP_NF_MATCH_HELPER=m
213CONFIG_IP_NF_MATCH_STATE=m
214CONFIG_IP_NF_MATCH_CONNTRACK=m
215CONFIG_IP_NF_MATCH_OWNER=m
216CONFIG_IP_NF_MATCH_ADDRTYPE=m
217CONFIG_IP_NF_MATCH_REALM=m
218CONFIG_IP_NF_MATCH_SCTP=m
219CONFIG_IP_NF_MATCH_COMMENT=m
220CONFIG_IP_NF_MATCH_HASHLIMIT=m
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
226CONFIG_IP_NF_NAT=m
227CONFIG_IP_NF_NAT_NEEDED=y
228CONFIG_IP_NF_TARGET_MASQUERADE=m
229CONFIG_IP_NF_TARGET_REDIRECT=m
230CONFIG_IP_NF_TARGET_NETMAP=m
231CONFIG_IP_NF_TARGET_SAME=m
232CONFIG_IP_NF_NAT_SNMP_BASIC=m
233CONFIG_IP_NF_NAT_IRC=m
234CONFIG_IP_NF_NAT_FTP=m
235CONFIG_IP_NF_NAT_TFTP=m
236CONFIG_IP_NF_NAT_AMANDA=m
237CONFIG_IP_NF_MANGLE=m
238CONFIG_IP_NF_TARGET_TOS=m
239CONFIG_IP_NF_TARGET_ECN=m
240CONFIG_IP_NF_TARGET_DSCP=m
241CONFIG_IP_NF_TARGET_MARK=m
242CONFIG_IP_NF_TARGET_CLASSIFY=m
243CONFIG_IP_NF_RAW=m
244CONFIG_IP_NF_TARGET_NOTRACK=m
245CONFIG_IP_NF_ARPTABLES=m
246CONFIG_IP_NF_ARPFILTER=m
247CONFIG_IP_NF_ARP_MANGLE=m
248
249#
250# IPv6: Netfilter Configuration (EXPERIMENTAL)
251#
252# CONFIG_IP6_NF_QUEUE is not set
253# CONFIG_IP6_NF_IPTABLES is not set
254
255#
256# SCTP Configuration (EXPERIMENTAL)
257#
258# CONFIG_IP_SCTP is not set
259# CONFIG_ATM is not set
260# CONFIG_BRIDGE is not set
261# CONFIG_VLAN_8021Q is not set
262# CONFIG_DECNET is not set
263# CONFIG_LLC2 is not set
264# CONFIG_IPX is not set
265# CONFIG_ATALK is not set
266# CONFIG_X25 is not set
267# CONFIG_LAPB is not set
268# CONFIG_NET_DIVERT is not set
269# CONFIG_ECONET is not set
270# CONFIG_WAN_ROUTER is not set
271# CONFIG_NET_SCHED is not set
272CONFIG_NET_CLS_ROUTE=y
273
274#
275# Network testing
276#
277# CONFIG_NET_PKTGEN is not set
278# CONFIG_HAMRADIO is not set
279# CONFIG_IRDA is not set
280# CONFIG_BT is not set
281
282#
283# Device Drivers
284#
285
286#
287# Generic Driver Options
288#
289CONFIG_STANDALONE=y
290CONFIG_PREVENT_FIRMWARE_BUILD=y
291CONFIG_FW_LOADER=y
292# CONFIG_DEBUG_DRIVER is not set
293
294#
295# Memory Technology Devices (MTD)
296#
297# CONFIG_MTD is not set
298
299#
300# Parallel port support
301#
302# CONFIG_PARPORT is not set
303
304#
305# Plug and Play support
306#
307
308#
309# Block devices
310#
311# CONFIG_BLK_DEV_FD is not set
312# CONFIG_BLK_CPQ_DA is not set
313# CONFIG_BLK_CPQ_CISS_DA is not set
314# CONFIG_BLK_DEV_DAC960 is not set
315# CONFIG_BLK_DEV_UMEM is not set
316# CONFIG_BLK_DEV_COW_COMMON is not set
317CONFIG_BLK_DEV_LOOP=y
318# CONFIG_BLK_DEV_CRYPTOLOOP is not set
319CONFIG_BLK_DEV_NBD=y
320# CONFIG_BLK_DEV_SX8 is not set
321CONFIG_BLK_DEV_RAM=y
322CONFIG_BLK_DEV_RAM_COUNT=16
323CONFIG_BLK_DEV_RAM_SIZE=131072
324CONFIG_BLK_DEV_INITRD=y
325CONFIG_INITRAMFS_SOURCE=""
326# CONFIG_CDROM_PKTCDVD is not set
327
328#
329# IO Schedulers
330#
331CONFIG_IOSCHED_NOOP=y
332CONFIG_IOSCHED_AS=y
333CONFIG_IOSCHED_DEADLINE=y
334CONFIG_IOSCHED_CFQ=y
335# CONFIG_ATA_OVER_ETH is not set
336
337#
338# ATA/ATAPI/MFM/RLL support
339#
340CONFIG_IDE=y
341CONFIG_BLK_DEV_IDE=y
342
343#
344# Please see Documentation/ide.txt for help/info on IDE drives
345#
346# CONFIG_BLK_DEV_IDE_SATA is not set
347CONFIG_BLK_DEV_IDEDISK=y
348CONFIG_IDEDISK_MULTI_MODE=y
349# CONFIG_BLK_DEV_IDECD is not set
350# CONFIG_BLK_DEV_IDETAPE is not set
351# CONFIG_BLK_DEV_IDEFLOPPY is not set
352# CONFIG_IDE_TASK_IOCTL is not set
353
354#
355# IDE chipset support/bugfixes
356#
357CONFIG_IDE_GENERIC=y
358CONFIG_BLK_DEV_IDEPCI=y
359CONFIG_IDEPCI_SHARE_IRQ=y
360# CONFIG_BLK_DEV_OFFBOARD is not set
361CONFIG_BLK_DEV_GENERIC=y
362# CONFIG_BLK_DEV_OPTI621 is not set
363# CONFIG_BLK_DEV_SL82C105 is not set
364CONFIG_BLK_DEV_IDEDMA_PCI=y
365# CONFIG_BLK_DEV_IDEDMA_FORCED is not set
366CONFIG_IDEDMA_PCI_AUTO=y
367# CONFIG_IDEDMA_ONLYDISK is not set
368CONFIG_BLK_DEV_AEC62XX=y
369# CONFIG_BLK_DEV_ALI15X3 is not set
370# CONFIG_BLK_DEV_AMD74XX is not set
371# CONFIG_BLK_DEV_CMD64X is not set
372# CONFIG_BLK_DEV_TRIFLEX is not set
373# CONFIG_BLK_DEV_CY82C693 is not set
374# CONFIG_BLK_DEV_CS5520 is not set
375# CONFIG_BLK_DEV_CS5530 is not set
376# CONFIG_BLK_DEV_HPT34X is not set
377# CONFIG_BLK_DEV_HPT366 is not set
378# CONFIG_BLK_DEV_SC1200 is not set
379# CONFIG_BLK_DEV_PIIX is not set
380# CONFIG_BLK_DEV_IT821X is not set
381# CONFIG_BLK_DEV_NS87415 is not set
382# CONFIG_BLK_DEV_PDC202XX_OLD is not set
383# CONFIG_BLK_DEV_PDC202XX_NEW is not set
384# CONFIG_BLK_DEV_SVWKS is not set
385CONFIG_BLK_DEV_SIIMAGE=y
386# CONFIG_BLK_DEV_SLC90E66 is not set
387# CONFIG_BLK_DEV_TRM290 is not set
388# CONFIG_BLK_DEV_VIA82CXXX is not set
389# CONFIG_IDE_ARM is not set
390CONFIG_BLK_DEV_IDEDMA=y
391# CONFIG_IDEDMA_IVB is not set
392CONFIG_IDEDMA_AUTO=y
393# CONFIG_BLK_DEV_HD is not set
394
395#
396# SCSI device support
397#
398# CONFIG_SCSI is not set
399
400#
401# Multi-device support (RAID and LVM)
402#
403# CONFIG_MD is not set
404
405#
406# Fusion MPT device support
407#
408# CONFIG_FUSION is not set
409
410#
411# IEEE 1394 (FireWire) support
412#
413# CONFIG_IEEE1394 is not set
414
415#
416# I2O device support
417#
418# CONFIG_I2O is not set
419
420#
421# Macintosh device drivers
422#
423
424#
425# Network device support
426#
427CONFIG_NETDEVICES=y
428# CONFIG_DUMMY is not set
429# CONFIG_BONDING is not set
430# CONFIG_EQUALIZER is not set
431# CONFIG_TUN is not set
432
433#
434# ARCnet devices
435#
436# CONFIG_ARCNET is not set
437
438#
439# Ethernet (10 or 100Mbit)
440#
441CONFIG_NET_ETHERNET=y
442CONFIG_MII=y
443# CONFIG_HAPPYMEAL is not set
444# CONFIG_SUNGEM is not set
445# CONFIG_NET_VENDOR_3COM is not set
446
447#
448# Tulip family network device support
449#
450# CONFIG_NET_TULIP is not set
451# CONFIG_HP100 is not set
452# CONFIG_NET_PCI is not set
453
454#
455# Ethernet (1000 Mbit)
456#
457# CONFIG_ACENIC is not set
458# CONFIG_DL2K is not set
459CONFIG_E1000=m
460# CONFIG_E1000_NAPI is not set
461# CONFIG_NS83820 is not set
462# CONFIG_HAMACHI is not set
463# CONFIG_YELLOWFIN is not set
464# CONFIG_R8169 is not set
465CONFIG_SKGE=m
466# CONFIG_SK98LIN is not set
467# CONFIG_TIGON3 is not set
468# CONFIG_BNX2 is not set
469# CONFIG_MV643XX_ETH is not set
470
471#
472# Ethernet (10000 Mbit)
473#
474# CONFIG_IXGB is not set
475# CONFIG_S2IO is not set
476
477#
478# Token Ring devices
479#
480# CONFIG_TR is not set
481
482#
483# Wireless LAN (non-hamradio)
484#
485# CONFIG_NET_RADIO is not set
486
487#
488# Wan interfaces
489#
490# CONFIG_WAN is not set
491# CONFIG_FDDI is not set
492# CONFIG_HIPPI is not set
493# CONFIG_PPP is not set
494# CONFIG_SLIP is not set
495# CONFIG_SHAPER is not set
496# CONFIG_NETCONSOLE is not set
497# CONFIG_NETPOLL is not set
498# CONFIG_NET_POLL_CONTROLLER is not set
499
500#
501# ISDN subsystem
502#
503# CONFIG_ISDN is not set
504
505#
506# Telephony Support
507#
508# CONFIG_PHONE is not set
509
510#
511# Input device support
512#
513CONFIG_INPUT=y
514
515#
516# Userland interfaces
517#
518CONFIG_INPUT_MOUSEDEV=y
519# CONFIG_INPUT_MOUSEDEV_PSAUX is not set
520CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024
521CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768
522# CONFIG_INPUT_JOYDEV is not set
523# CONFIG_INPUT_TSDEV is not set
524# CONFIG_INPUT_EVDEV is not set
525# CONFIG_INPUT_EVBUG is not set
526
527#
528# Input Device Drivers
529#
530# CONFIG_INPUT_KEYBOARD is not set
531# CONFIG_INPUT_MOUSE is not set
532# CONFIG_INPUT_JOYSTICK is not set
533# CONFIG_INPUT_TOUCHSCREEN is not set
534# CONFIG_INPUT_MISC is not set
535
536#
537# Hardware I/O ports
538#
539CONFIG_SERIO=y
540# CONFIG_SERIO_I8042 is not set
541CONFIG_SERIO_SERPORT=y
542# CONFIG_SERIO_PCIPS2 is not set
543# CONFIG_SERIO_RAW is not set
544# CONFIG_GAMEPORT is not set
545
546#
547# Character devices
548#
549CONFIG_VT=y
550CONFIG_VT_CONSOLE=y
551CONFIG_HW_CONSOLE=y
552CONFIG_SERIAL_NONSTANDARD=y
553# CONFIG_ROCKETPORT is not set
554# CONFIG_CYCLADES is not set
555# CONFIG_MOXA_SMARTIO is not set
556# CONFIG_ISI is not set
557# CONFIG_SYNCLINK is not set
558# CONFIG_SYNCLINKMP is not set
559# CONFIG_N_HDLC is not set
560# CONFIG_SPECIALIX is not set
561# CONFIG_SX is not set
562# CONFIG_STALDRV is not set
563
564#
565# Serial drivers
566#
567CONFIG_SERIAL_8250=y
568CONFIG_SERIAL_8250_CONSOLE=y
569CONFIG_SERIAL_8250_NR_UARTS=4
570# CONFIG_SERIAL_8250_EXTENDED is not set
571
572#
573# Non-8250 serial port support
574#
575CONFIG_SERIAL_CORE=y
576CONFIG_SERIAL_CORE_CONSOLE=y
577# CONFIG_SERIAL_JSM is not set
578CONFIG_UNIX98_PTYS=y
579# CONFIG_LEGACY_PTYS is not set
580
581#
582# IPMI
583#
584# CONFIG_IPMI_HANDLER is not set
585
586#
587# Watchdog Cards
588#
589CONFIG_WATCHDOG=y
590# CONFIG_WATCHDOG_NOWAYOUT is not set
591
592#
593# Watchdog Device Drivers
594#
595# CONFIG_SOFT_WATCHDOG is not set
596CONFIG_WATCHDOG_RTAS=y
597
598#
599# PCI-based Watchdog Cards
600#
601# CONFIG_PCIPCWATCHDOG is not set
602# CONFIG_WDTPCI is not set
603# CONFIG_RTC is not set
604# CONFIG_DTLK is not set
605# CONFIG_R3964 is not set
606# CONFIG_APPLICOM is not set
607
608#
609# Ftape, the floppy tape device driver
610#
611# CONFIG_AGP is not set
612# CONFIG_DRM is not set
613# CONFIG_RAW_DRIVER is not set
614# CONFIG_HANGCHECK_TIMER is not set
615
616#
617# TPM devices
618#
619# CONFIG_TCG_TPM is not set
620
621#
622# I2C support
623#
624CONFIG_I2C=y
625# CONFIG_I2C_CHARDEV is not set
626
627#
628# I2C Algorithms
629#
630CONFIG_I2C_ALGOBIT=y
631# CONFIG_I2C_ALGOPCF is not set
632# CONFIG_I2C_ALGOPCA is not set
633
634#
635# I2C Hardware Bus support
636#
637# CONFIG_I2C_ALI1535 is not set
638# CONFIG_I2C_ALI1563 is not set
639# CONFIG_I2C_ALI15X3 is not set
640# CONFIG_I2C_AMD756 is not set
641# CONFIG_I2C_AMD8111 is not set
642# CONFIG_I2C_I801 is not set
643# CONFIG_I2C_I810 is not set
644# CONFIG_I2C_PIIX4 is not set
645# CONFIG_I2C_ISA is not set
646# CONFIG_I2C_NFORCE2 is not set
647# CONFIG_I2C_PARPORT_LIGHT is not set
648# CONFIG_I2C_PROSAVAGE is not set
649# CONFIG_I2C_SAVAGE4 is not set
650# CONFIG_SCx200_ACB is not set
651# CONFIG_I2C_SIS5595 is not set
652# CONFIG_I2C_SIS630 is not set
653# CONFIG_I2C_SIS96X is not set
654# CONFIG_I2C_STUB is not set
655# CONFIG_I2C_VIA is not set
656# CONFIG_I2C_VIAPRO is not set
657# CONFIG_I2C_VOODOO3 is not set
658# CONFIG_I2C_PCA_ISA is not set
659# CONFIG_I2C_SENSOR is not set
660
661#
662# Miscellaneous I2C Chip support
663#
664# CONFIG_SENSORS_DS1337 is not set
665# CONFIG_SENSORS_DS1374 is not set
666# CONFIG_SENSORS_EEPROM is not set
667# CONFIG_SENSORS_PCF8574 is not set
668# CONFIG_SENSORS_PCA9539 is not set
669# CONFIG_SENSORS_PCF8591 is not set
670# CONFIG_SENSORS_RTC8564 is not set
671# CONFIG_SENSORS_MAX6875 is not set
672# CONFIG_I2C_DEBUG_CORE is not set
673# CONFIG_I2C_DEBUG_ALGO is not set
674# CONFIG_I2C_DEBUG_BUS is not set
675# CONFIG_I2C_DEBUG_CHIP is not set
676
677#
678# Dallas's 1-wire bus
679#
680# CONFIG_W1 is not set
681
682#
683# Hardware Monitoring support
684#
685# CONFIG_HWMON is not set
686
687#
688# Misc devices
689#
690
691#
692# Multimedia devices
693#
694# CONFIG_VIDEO_DEV is not set
695
696#
697# Digital Video Broadcasting Devices
698#
699# CONFIG_DVB is not set
700
701#
702# Graphics support
703#
704# CONFIG_FB is not set
705
706#
707# Console display driver support
708#
709# CONFIG_VGA_CONSOLE is not set
710CONFIG_DUMMY_CONSOLE=y
711
712#
713# Sound
714#
715# CONFIG_SOUND is not set
716
717#
718# USB support
719#
720CONFIG_USB_ARCH_HAS_HCD=y
721CONFIG_USB_ARCH_HAS_OHCI=y
722# CONFIG_USB is not set
723
724#
725# USB Gadget Support
726#
727# CONFIG_USB_GADGET is not set
728
729#
730# MMC/SD Card support
731#
732# CONFIG_MMC is not set
733
734#
735# InfiniBand support
736#
737# CONFIG_INFINIBAND is not set
738
739#
740# SN Devices
741#
742
743#
744# File systems
745#
746CONFIG_EXT2_FS=y
747# CONFIG_EXT2_FS_XATTR is not set
748# CONFIG_EXT2_FS_XIP is not set
749CONFIG_EXT3_FS=y
750CONFIG_EXT3_FS_XATTR=y
751# CONFIG_EXT3_FS_POSIX_ACL is not set
752# CONFIG_EXT3_FS_SECURITY is not set
753CONFIG_JBD=y
754# CONFIG_JBD_DEBUG is not set
755CONFIG_FS_MBCACHE=y
756# CONFIG_REISERFS_FS is not set
757# CONFIG_JFS_FS is not set
758CONFIG_FS_POSIX_ACL=y
759
760#
761# XFS support
762#
763# CONFIG_XFS_FS is not set
764# CONFIG_MINIX_FS is not set
765# CONFIG_ROMFS_FS is not set
766CONFIG_INOTIFY=y
767# CONFIG_QUOTA is not set
768CONFIG_DNOTIFY=y
769# CONFIG_AUTOFS_FS is not set
770# CONFIG_AUTOFS4_FS is not set
771
772#
773# CD-ROM/DVD Filesystems
774#
775CONFIG_ISO9660_FS=m
776CONFIG_JOLIET=y
777# CONFIG_ZISOFS is not set
778CONFIG_UDF_FS=m
779CONFIG_UDF_NLS=y
780
781#
782# DOS/FAT/NT Filesystems
783#
784CONFIG_FAT_FS=m
785CONFIG_MSDOS_FS=m
786CONFIG_VFAT_FS=m
787CONFIG_FAT_DEFAULT_CODEPAGE=437
788CONFIG_FAT_DEFAULT_IOCHARSET="iso8859-1"
789# CONFIG_NTFS_FS is not set
790
791#
792# Pseudo filesystems
793#
794CONFIG_PROC_FS=y
795CONFIG_PROC_KCORE=y
796CONFIG_SYSFS=y
797# CONFIG_DEVPTS_FS_XATTR is not set
798CONFIG_TMPFS=y
799CONFIG_TMPFS_XATTR=y
800# CONFIG_TMPFS_SECURITY is not set
801CONFIG_HUGETLBFS=y
802CONFIG_HUGETLB_PAGE=y
803CONFIG_RAMFS=y
804
805#
806# Miscellaneous filesystems
807#
808# CONFIG_ADFS_FS is not set
809# CONFIG_AFFS_FS is not set
810# CONFIG_HFS_FS is not set
811# CONFIG_HFSPLUS_FS is not set
812# CONFIG_BEFS_FS is not set
813# CONFIG_BFS_FS is not set
814# CONFIG_EFS_FS is not set
815# CONFIG_CRAMFS is not set
816# CONFIG_VXFS_FS is not set
817# CONFIG_HPFS_FS is not set
818# CONFIG_QNX4FS_FS is not set
819# CONFIG_SYSV_FS is not set
820# CONFIG_UFS_FS is not set
821
822#
823# Network File Systems
824#
825CONFIG_NFS_FS=m
826CONFIG_NFS_V3=y
827CONFIG_NFS_V3_ACL=y
828# CONFIG_NFS_V4 is not set
829# CONFIG_NFS_DIRECTIO is not set
830CONFIG_NFSD=m
831CONFIG_NFSD_V2_ACL=y
832CONFIG_NFSD_V3=y
833CONFIG_NFSD_V3_ACL=y
834# CONFIG_NFSD_V4 is not set
835CONFIG_NFSD_TCP=y
836CONFIG_LOCKD=m
837CONFIG_LOCKD_V4=y
838CONFIG_EXPORTFS=m
839CONFIG_NFS_ACL_SUPPORT=m
840CONFIG_NFS_COMMON=y
841CONFIG_SUNRPC=m
842# CONFIG_RPCSEC_GSS_KRB5 is not set
843# CONFIG_RPCSEC_GSS_SPKM3 is not set
844# CONFIG_SMB_FS is not set
845# CONFIG_CIFS is not set
846# CONFIG_NCP_FS is not set
847# CONFIG_CODA_FS is not set
848# CONFIG_AFS_FS is not set
849
850#
851# Partition Types
852#
853CONFIG_PARTITION_ADVANCED=y
854# CONFIG_ACORN_PARTITION is not set
855# CONFIG_OSF_PARTITION is not set
856# CONFIG_AMIGA_PARTITION is not set
857# CONFIG_ATARI_PARTITION is not set
858# CONFIG_MAC_PARTITION is not set
859CONFIG_MSDOS_PARTITION=y
860# CONFIG_BSD_DISKLABEL is not set
861# CONFIG_MINIX_SUBPARTITION is not set
862# CONFIG_SOLARIS_X86_PARTITION is not set
863# CONFIG_UNIXWARE_DISKLABEL is not set
864# CONFIG_LDM_PARTITION is not set
865# CONFIG_SGI_PARTITION is not set
866# CONFIG_ULTRIX_PARTITION is not set
867# CONFIG_SUN_PARTITION is not set
868CONFIG_EFI_PARTITION=y
869
870#
871# Native Language Support
872#
873CONFIG_NLS=m
874CONFIG_NLS_DEFAULT="iso8859-1"
875# CONFIG_NLS_CODEPAGE_437 is not set
876# CONFIG_NLS_CODEPAGE_737 is not set
877# CONFIG_NLS_CODEPAGE_775 is not set
878# CONFIG_NLS_CODEPAGE_850 is not set
879# CONFIG_NLS_CODEPAGE_852 is not set
880# CONFIG_NLS_CODEPAGE_855 is not set
881# CONFIG_NLS_CODEPAGE_857 is not set
882# CONFIG_NLS_CODEPAGE_860 is not set
883# CONFIG_NLS_CODEPAGE_861 is not set
884# CONFIG_NLS_CODEPAGE_862 is not set
885# CONFIG_NLS_CODEPAGE_863 is not set
886# CONFIG_NLS_CODEPAGE_864 is not set
887# CONFIG_NLS_CODEPAGE_865 is not set
888# CONFIG_NLS_CODEPAGE_866 is not set
889# CONFIG_NLS_CODEPAGE_869 is not set
890# CONFIG_NLS_CODEPAGE_936 is not set
891# CONFIG_NLS_CODEPAGE_950 is not set
892# CONFIG_NLS_CODEPAGE_932 is not set
893# CONFIG_NLS_CODEPAGE_949 is not set
894# CONFIG_NLS_CODEPAGE_874 is not set
895# CONFIG_NLS_ISO8859_8 is not set
896# CONFIG_NLS_CODEPAGE_1250 is not set
897# CONFIG_NLS_CODEPAGE_1251 is not set
898# CONFIG_NLS_ASCII is not set
899CONFIG_NLS_ISO8859_1=m
900CONFIG_NLS_ISO8859_2=m
901CONFIG_NLS_ISO8859_3=m
902CONFIG_NLS_ISO8859_4=m
903CONFIG_NLS_ISO8859_5=m
904CONFIG_NLS_ISO8859_6=m
905CONFIG_NLS_ISO8859_7=m
906CONFIG_NLS_ISO8859_9=m
907CONFIG_NLS_ISO8859_13=m
908CONFIG_NLS_ISO8859_14=m
909CONFIG_NLS_ISO8859_15=m
910# CONFIG_NLS_KOI8_R is not set
911# CONFIG_NLS_KOI8_U is not set
912# CONFIG_NLS_UTF8 is not set
913
914#
915# Profiling support
916#
917# CONFIG_PROFILING is not set
918
919#
920# Kernel hacking
921#
922# CONFIG_PRINTK_TIME is not set
923CONFIG_DEBUG_KERNEL=y
924CONFIG_MAGIC_SYSRQ=y
925CONFIG_LOG_BUF_SHIFT=15
926# CONFIG_SCHEDSTATS is not set
927# CONFIG_DEBUG_SLAB is not set
928# CONFIG_DEBUG_SPINLOCK is not set
929CONFIG_DEBUG_SPINLOCK_SLEEP=y
930# CONFIG_DEBUG_KOBJECT is not set
931# CONFIG_DEBUG_INFO is not set
932CONFIG_DEBUG_FS=y
933# CONFIG_DEBUG_STACKOVERFLOW is not set
934# CONFIG_KPROBES is not set
935# CONFIG_DEBUG_STACK_USAGE is not set
936CONFIG_DEBUGGER=y
937# CONFIG_XMON is not set
938# CONFIG_PPCDBG is not set
939CONFIG_IRQSTACKS=y
940
941#
942# Security options
943#
944# CONFIG_KEYS is not set
945# CONFIG_SECURITY is not set
946
947#
948# Cryptographic options
949#
950CONFIG_CRYPTO=y
951CONFIG_CRYPTO_HMAC=y
952# CONFIG_CRYPTO_NULL is not set
953# CONFIG_CRYPTO_MD4 is not set
954CONFIG_CRYPTO_MD5=m
955CONFIG_CRYPTO_SHA1=m
956# CONFIG_CRYPTO_SHA256 is not set
957# CONFIG_CRYPTO_SHA512 is not set
958# CONFIG_CRYPTO_WP512 is not set
959# CONFIG_CRYPTO_TGR192 is not set
960CONFIG_CRYPTO_DES=m
961# CONFIG_CRYPTO_BLOWFISH is not set
962# CONFIG_CRYPTO_TWOFISH is not set
963# CONFIG_CRYPTO_SERPENT is not set
964# CONFIG_CRYPTO_AES is not set
965# CONFIG_CRYPTO_CAST5 is not set
966# CONFIG_CRYPTO_CAST6 is not set
967# CONFIG_CRYPTO_TEA is not set
968# CONFIG_CRYPTO_ARC4 is not set
969# CONFIG_CRYPTO_KHAZAD is not set
970# CONFIG_CRYPTO_ANUBIS is not set
971CONFIG_CRYPTO_DEFLATE=m
972# CONFIG_CRYPTO_MICHAEL_MIC is not set
973# CONFIG_CRYPTO_CRC32C is not set
974# CONFIG_CRYPTO_TEST is not set
975
976#
977# Hardware crypto devices
978#
979
980#
981# Library routines
982#
983# CONFIG_CRC_CCITT is not set
984CONFIG_CRC32=y
985# CONFIG_LIBCRC32C is not set
986CONFIG_ZLIB_INFLATE=m
987CONFIG_ZLIB_DEFLATE=m
diff --git a/arch/ppc64/configs/g5_defconfig b/arch/ppc64/configs/g5_defconfig
index 1eb33398648e..fc83d9330282 100644
--- a/arch/ppc64/configs/g5_defconfig
+++ b/arch/ppc64/configs/g5_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.12-rc6 3# Linux kernel version: 2.6.13-rc6
4# Tue Jun 14 16:59:20 2005 4# Mon Aug 8 14:16:59 2005
5# 5#
6CONFIG_64BIT=y 6CONFIG_64BIT=y
7CONFIG_MMU=y 7CONFIG_MMU=y
@@ -73,12 +73,15 @@ CONFIG_SYSVIPC_COMPAT=y
73# CONFIG_PPC_ISERIES is not set 73# CONFIG_PPC_ISERIES is not set
74CONFIG_PPC_MULTIPLATFORM=y 74CONFIG_PPC_MULTIPLATFORM=y
75# CONFIG_PPC_PSERIES is not set 75# CONFIG_PPC_PSERIES is not set
76# CONFIG_PPC_BPA is not set
76CONFIG_PPC_PMAC=y 77CONFIG_PPC_PMAC=y
77# CONFIG_PPC_MAPLE is not set 78# CONFIG_PPC_MAPLE is not set
78CONFIG_PPC=y 79CONFIG_PPC=y
79CONFIG_PPC64=y 80CONFIG_PPC64=y
80CONFIG_PPC_OF=y 81CONFIG_PPC_OF=y
82CONFIG_MPIC=y
81CONFIG_ALTIVEC=y 83CONFIG_ALTIVEC=y
84CONFIG_KEXEC=y
82CONFIG_U3_DART=y 85CONFIG_U3_DART=y
83CONFIG_PPC_PMAC64=y 86CONFIG_PPC_PMAC64=y
84CONFIG_BOOTX_TEXT=y 87CONFIG_BOOTX_TEXT=y
@@ -86,8 +89,24 @@ CONFIG_POWER4_ONLY=y
86CONFIG_IOMMU_VMERGE=y 89CONFIG_IOMMU_VMERGE=y
87CONFIG_SMP=y 90CONFIG_SMP=y
88CONFIG_NR_CPUS=2 91CONFIG_NR_CPUS=2
92CONFIG_ARCH_SELECT_MEMORY_MODEL=y
93CONFIG_ARCH_FLATMEM_ENABLE=y
94CONFIG_SELECT_MEMORY_MODEL=y
95CONFIG_FLATMEM_MANUAL=y
96# CONFIG_DISCONTIGMEM_MANUAL is not set
97# CONFIG_SPARSEMEM_MANUAL is not set
98CONFIG_FLATMEM=y
99CONFIG_FLAT_NODE_MEM_MAP=y
100# CONFIG_NUMA is not set
89# CONFIG_SCHED_SMT is not set 101# CONFIG_SCHED_SMT is not set
102CONFIG_PREEMPT_NONE=y
103# CONFIG_PREEMPT_VOLUNTARY is not set
90# CONFIG_PREEMPT is not set 104# CONFIG_PREEMPT is not set
105# CONFIG_PREEMPT_BKL is not set
106# CONFIG_HZ_100 is not set
107CONFIG_HZ_250=y
108# CONFIG_HZ_1000 is not set
109CONFIG_HZ=250
91CONFIG_GENERIC_HARDIRQS=y 110CONFIG_GENERIC_HARDIRQS=y
92CONFIG_SECCOMP=y 111CONFIG_SECCOMP=y
93CONFIG_ISA_DMA_API=y 112CONFIG_ISA_DMA_API=y
@@ -117,6 +136,142 @@ CONFIG_PROC_DEVICETREE=y
117# CONFIG_CMDLINE_BOOL is not set 136# CONFIG_CMDLINE_BOOL is not set
118 137
119# 138#
139# Networking
140#
141CONFIG_NET=y
142
143#
144# Networking options
145#
146CONFIG_PACKET=y
147# CONFIG_PACKET_MMAP is not set
148CONFIG_UNIX=y
149CONFIG_XFRM=y
150CONFIG_XFRM_USER=m
151CONFIG_NET_KEY=m
152CONFIG_INET=y
153CONFIG_IP_MULTICAST=y
154# CONFIG_IP_ADVANCED_ROUTER is not set
155CONFIG_IP_FIB_HASH=y
156# CONFIG_IP_PNP is not set
157CONFIG_NET_IPIP=y
158# CONFIG_NET_IPGRE is not set
159# CONFIG_IP_MROUTE is not set
160# CONFIG_ARPD is not set
161CONFIG_SYN_COOKIES=y
162CONFIG_INET_AH=m
163CONFIG_INET_ESP=m
164CONFIG_INET_IPCOMP=m
165CONFIG_INET_TUNNEL=y
166CONFIG_IP_TCPDIAG=m
167# CONFIG_IP_TCPDIAG_IPV6 is not set
168# CONFIG_TCP_CONG_ADVANCED is not set
169CONFIG_TCP_CONG_BIC=y
170
171#
172# IP: Virtual Server Configuration
173#
174# CONFIG_IP_VS is not set
175# CONFIG_IPV6 is not set
176CONFIG_NETFILTER=y
177# CONFIG_NETFILTER_DEBUG is not set
178
179#
180# IP: Netfilter Configuration
181#
182CONFIG_IP_NF_CONNTRACK=m
183CONFIG_IP_NF_CT_ACCT=y
184CONFIG_IP_NF_CONNTRACK_MARK=y
185CONFIG_IP_NF_CT_PROTO_SCTP=m
186CONFIG_IP_NF_FTP=m
187CONFIG_IP_NF_IRC=m
188CONFIG_IP_NF_TFTP=m
189CONFIG_IP_NF_AMANDA=m
190CONFIG_IP_NF_QUEUE=m
191CONFIG_IP_NF_IPTABLES=m
192CONFIG_IP_NF_MATCH_LIMIT=m
193CONFIG_IP_NF_MATCH_IPRANGE=m
194CONFIG_IP_NF_MATCH_MAC=m
195CONFIG_IP_NF_MATCH_PKTTYPE=m
196CONFIG_IP_NF_MATCH_MARK=m
197CONFIG_IP_NF_MATCH_MULTIPORT=m
198CONFIG_IP_NF_MATCH_TOS=m
199CONFIG_IP_NF_MATCH_RECENT=m
200CONFIG_IP_NF_MATCH_ECN=m
201CONFIG_IP_NF_MATCH_DSCP=m
202CONFIG_IP_NF_MATCH_AH_ESP=m
203CONFIG_IP_NF_MATCH_LENGTH=m
204CONFIG_IP_NF_MATCH_TTL=m
205CONFIG_IP_NF_MATCH_TCPMSS=m
206CONFIG_IP_NF_MATCH_HELPER=m
207CONFIG_IP_NF_MATCH_STATE=m
208CONFIG_IP_NF_MATCH_CONNTRACK=m
209CONFIG_IP_NF_MATCH_OWNER=m
210CONFIG_IP_NF_MATCH_ADDRTYPE=m
211CONFIG_IP_NF_MATCH_REALM=m
212CONFIG_IP_NF_MATCH_SCTP=m
213CONFIG_IP_NF_MATCH_COMMENT=m
214CONFIG_IP_NF_MATCH_CONNMARK=m
215CONFIG_IP_NF_MATCH_HASHLIMIT=m
216CONFIG_IP_NF_FILTER=m
217CONFIG_IP_NF_TARGET_REJECT=m
218CONFIG_IP_NF_TARGET_LOG=m
219CONFIG_IP_NF_TARGET_ULOG=m
220CONFIG_IP_NF_TARGET_TCPMSS=m
221CONFIG_IP_NF_NAT=m
222CONFIG_IP_NF_NAT_NEEDED=y
223CONFIG_IP_NF_TARGET_MASQUERADE=m
224CONFIG_IP_NF_TARGET_REDIRECT=m
225CONFIG_IP_NF_TARGET_NETMAP=m
226CONFIG_IP_NF_TARGET_SAME=m
227CONFIG_IP_NF_NAT_SNMP_BASIC=m
228CONFIG_IP_NF_NAT_IRC=m
229CONFIG_IP_NF_NAT_FTP=m
230CONFIG_IP_NF_NAT_TFTP=m
231CONFIG_IP_NF_NAT_AMANDA=m
232CONFIG_IP_NF_MANGLE=m
233CONFIG_IP_NF_TARGET_TOS=m
234CONFIG_IP_NF_TARGET_ECN=m
235CONFIG_IP_NF_TARGET_DSCP=m
236CONFIG_IP_NF_TARGET_MARK=m
237CONFIG_IP_NF_TARGET_CLASSIFY=m
238CONFIG_IP_NF_TARGET_CONNMARK=m
239CONFIG_IP_NF_TARGET_CLUSTERIP=m
240CONFIG_IP_NF_RAW=m
241CONFIG_IP_NF_TARGET_NOTRACK=m
242CONFIG_IP_NF_ARPTABLES=m
243CONFIG_IP_NF_ARPFILTER=m
244CONFIG_IP_NF_ARP_MANGLE=m
245
246#
247# SCTP Configuration (EXPERIMENTAL)
248#
249# CONFIG_IP_SCTP is not set
250# CONFIG_ATM is not set
251# CONFIG_BRIDGE is not set
252# CONFIG_VLAN_8021Q is not set
253# CONFIG_DECNET is not set
254CONFIG_LLC=y
255# CONFIG_LLC2 is not set
256# CONFIG_IPX is not set
257# CONFIG_ATALK is not set
258# CONFIG_X25 is not set
259# CONFIG_LAPB is not set
260# CONFIG_NET_DIVERT is not set
261# CONFIG_ECONET is not set
262# CONFIG_WAN_ROUTER is not set
263# CONFIG_NET_SCHED is not set
264CONFIG_NET_CLS_ROUTE=y
265
266#
267# Network testing
268#
269# CONFIG_NET_PKTGEN is not set
270# CONFIG_HAMRADIO is not set
271# CONFIG_IRDA is not set
272# CONFIG_BT is not set
273
274#
120# Device Drivers 275# Device Drivers
121# 276#
122 277
@@ -218,6 +373,7 @@ CONFIG_IDEDMA_PCI_AUTO=y
218# CONFIG_BLK_DEV_HPT366 is not set 373# CONFIG_BLK_DEV_HPT366 is not set
219# CONFIG_BLK_DEV_SC1200 is not set 374# CONFIG_BLK_DEV_SC1200 is not set
220# CONFIG_BLK_DEV_PIIX is not set 375# CONFIG_BLK_DEV_PIIX is not set
376# CONFIG_BLK_DEV_IT821X is not set
221# CONFIG_BLK_DEV_NS87415 is not set 377# CONFIG_BLK_DEV_NS87415 is not set
222# CONFIG_BLK_DEV_PDC202XX_OLD is not set 378# CONFIG_BLK_DEV_PDC202XX_OLD is not set
223# CONFIG_BLK_DEV_PDC202XX_NEW is not set 379# CONFIG_BLK_DEV_PDC202XX_NEW is not set
@@ -251,6 +407,7 @@ CONFIG_CHR_DEV_ST=y
251CONFIG_BLK_DEV_SR=y 407CONFIG_BLK_DEV_SR=y
252CONFIG_BLK_DEV_SR_VENDOR=y 408CONFIG_BLK_DEV_SR_VENDOR=y
253CONFIG_CHR_DEV_SG=y 409CONFIG_CHR_DEV_SG=y
410# CONFIG_CHR_DEV_SCH is not set
254 411
255# 412#
256# Some SCSI devices (e.g. CD jukebox) support multiple LUNs 413# Some SCSI devices (e.g. CD jukebox) support multiple LUNs
@@ -309,6 +466,7 @@ CONFIG_SCSI_QLA2XXX=y
309# CONFIG_SCSI_QLA2300 is not set 466# CONFIG_SCSI_QLA2300 is not set
310# CONFIG_SCSI_QLA2322 is not set 467# CONFIG_SCSI_QLA2322 is not set
311# CONFIG_SCSI_QLA6312 is not set 468# CONFIG_SCSI_QLA6312 is not set
469# CONFIG_SCSI_QLA24XX is not set
312# CONFIG_SCSI_LPFC is not set 470# CONFIG_SCSI_LPFC is not set
313# CONFIG_SCSI_DC395x is not set 471# CONFIG_SCSI_DC395x is not set
314# CONFIG_SCSI_DC390T is not set 472# CONFIG_SCSI_DC390T is not set
@@ -338,6 +496,8 @@ CONFIG_DM_ZERO=m
338# Fusion MPT device support 496# Fusion MPT device support
339# 497#
340# CONFIG_FUSION is not set 498# CONFIG_FUSION is not set
499# CONFIG_FUSION_SPI is not set
500# CONFIG_FUSION_FC is not set
341 501
342# 502#
343# IEEE 1394 (FireWire) support 503# IEEE 1394 (FireWire) support
@@ -351,6 +511,7 @@ CONFIG_IEEE1394=y
351CONFIG_IEEE1394_OUI_DB=y 511CONFIG_IEEE1394_OUI_DB=y
352CONFIG_IEEE1394_EXTRA_CONFIG_ROMS=y 512CONFIG_IEEE1394_EXTRA_CONFIG_ROMS=y
353CONFIG_IEEE1394_CONFIG_ROM_IP1394=y 513CONFIG_IEEE1394_CONFIG_ROM_IP1394=y
514# CONFIG_IEEE1394_EXPORT_FULL_API is not set
354 515
355# 516#
356# Device Drivers 517# Device Drivers
@@ -377,152 +538,14 @@ CONFIG_IEEE1394_RAWIO=y
377# 538#
378# Macintosh device drivers 539# Macintosh device drivers
379# 540#
380CONFIG_ADB=y
381CONFIG_ADB_PMU=y 541CONFIG_ADB_PMU=y
382CONFIG_PMAC_SMU=y 542CONFIG_PMAC_SMU=y
383# CONFIG_PMAC_PBOOK is not set
384# CONFIG_PMAC_BACKLIGHT is not set 543# CONFIG_PMAC_BACKLIGHT is not set
385# CONFIG_INPUT_ADBHID is not set
386CONFIG_THERM_PM72=y 544CONFIG_THERM_PM72=y
387 545
388# 546#
389# Networking support 547# Network device support
390#
391CONFIG_NET=y
392
393#
394# Networking options
395# 548#
396CONFIG_PACKET=y
397# CONFIG_PACKET_MMAP is not set
398CONFIG_UNIX=y
399CONFIG_NET_KEY=m
400CONFIG_INET=y
401CONFIG_IP_MULTICAST=y
402# CONFIG_IP_ADVANCED_ROUTER is not set
403# CONFIG_IP_PNP is not set
404CONFIG_NET_IPIP=y
405# CONFIG_NET_IPGRE is not set
406# CONFIG_IP_MROUTE is not set
407# CONFIG_ARPD is not set
408CONFIG_SYN_COOKIES=y
409CONFIG_INET_AH=m
410CONFIG_INET_ESP=m
411CONFIG_INET_IPCOMP=m
412CONFIG_INET_TUNNEL=y
413CONFIG_IP_TCPDIAG=m
414# CONFIG_IP_TCPDIAG_IPV6 is not set
415
416#
417# IP: Virtual Server Configuration
418#
419# CONFIG_IP_VS is not set
420# CONFIG_IPV6 is not set
421CONFIG_NETFILTER=y
422# CONFIG_NETFILTER_DEBUG is not set
423
424#
425# IP: Netfilter Configuration
426#
427CONFIG_IP_NF_CONNTRACK=m
428CONFIG_IP_NF_CT_ACCT=y
429CONFIG_IP_NF_CONNTRACK_MARK=y
430CONFIG_IP_NF_CT_PROTO_SCTP=m
431CONFIG_IP_NF_FTP=m
432CONFIG_IP_NF_IRC=m
433CONFIG_IP_NF_TFTP=m
434CONFIG_IP_NF_AMANDA=m
435CONFIG_IP_NF_QUEUE=m
436CONFIG_IP_NF_IPTABLES=m
437CONFIG_IP_NF_MATCH_LIMIT=m
438CONFIG_IP_NF_MATCH_IPRANGE=m
439CONFIG_IP_NF_MATCH_MAC=m
440CONFIG_IP_NF_MATCH_PKTTYPE=m
441CONFIG_IP_NF_MATCH_MARK=m
442CONFIG_IP_NF_MATCH_MULTIPORT=m
443CONFIG_IP_NF_MATCH_TOS=m
444CONFIG_IP_NF_MATCH_RECENT=m
445CONFIG_IP_NF_MATCH_ECN=m
446CONFIG_IP_NF_MATCH_DSCP=m
447CONFIG_IP_NF_MATCH_AH_ESP=m
448CONFIG_IP_NF_MATCH_LENGTH=m
449CONFIG_IP_NF_MATCH_TTL=m
450CONFIG_IP_NF_MATCH_TCPMSS=m
451CONFIG_IP_NF_MATCH_HELPER=m
452CONFIG_IP_NF_MATCH_STATE=m
453CONFIG_IP_NF_MATCH_CONNTRACK=m
454CONFIG_IP_NF_MATCH_OWNER=m
455CONFIG_IP_NF_MATCH_ADDRTYPE=m
456CONFIG_IP_NF_MATCH_REALM=m
457CONFIG_IP_NF_MATCH_SCTP=m
458CONFIG_IP_NF_MATCH_COMMENT=m
459CONFIG_IP_NF_MATCH_CONNMARK=m
460CONFIG_IP_NF_MATCH_HASHLIMIT=m
461CONFIG_IP_NF_FILTER=m
462CONFIG_IP_NF_TARGET_REJECT=m
463CONFIG_IP_NF_TARGET_LOG=m
464CONFIG_IP_NF_TARGET_ULOG=m
465CONFIG_IP_NF_TARGET_TCPMSS=m
466CONFIG_IP_NF_NAT=m
467CONFIG_IP_NF_NAT_NEEDED=y
468CONFIG_IP_NF_TARGET_MASQUERADE=m
469CONFIG_IP_NF_TARGET_REDIRECT=m
470CONFIG_IP_NF_TARGET_NETMAP=m
471CONFIG_IP_NF_TARGET_SAME=m
472CONFIG_IP_NF_NAT_SNMP_BASIC=m
473CONFIG_IP_NF_NAT_IRC=m
474CONFIG_IP_NF_NAT_FTP=m
475CONFIG_IP_NF_NAT_TFTP=m
476CONFIG_IP_NF_NAT_AMANDA=m
477CONFIG_IP_NF_MANGLE=m
478CONFIG_IP_NF_TARGET_TOS=m
479CONFIG_IP_NF_TARGET_ECN=m
480CONFIG_IP_NF_TARGET_DSCP=m
481CONFIG_IP_NF_TARGET_MARK=m
482CONFIG_IP_NF_TARGET_CLASSIFY=m
483CONFIG_IP_NF_TARGET_CONNMARK=m
484CONFIG_IP_NF_TARGET_CLUSTERIP=m
485CONFIG_IP_NF_RAW=m
486CONFIG_IP_NF_TARGET_NOTRACK=m
487CONFIG_IP_NF_ARPTABLES=m
488CONFIG_IP_NF_ARPFILTER=m
489CONFIG_IP_NF_ARP_MANGLE=m
490CONFIG_XFRM=y
491CONFIG_XFRM_USER=m
492
493#
494# SCTP Configuration (EXPERIMENTAL)
495#
496# CONFIG_IP_SCTP is not set
497# CONFIG_ATM is not set
498# CONFIG_BRIDGE is not set
499# CONFIG_VLAN_8021Q is not set
500# CONFIG_DECNET is not set
501CONFIG_LLC=y
502# CONFIG_LLC2 is not set
503# CONFIG_IPX is not set
504# CONFIG_ATALK is not set
505# CONFIG_X25 is not set
506# CONFIG_LAPB is not set
507# CONFIG_NET_DIVERT is not set
508# CONFIG_ECONET is not set
509# CONFIG_WAN_ROUTER is not set
510
511#
512# QoS and/or fair queueing
513#
514# CONFIG_NET_SCHED is not set
515CONFIG_NET_CLS_ROUTE=y
516
517#
518# Network testing
519#
520# CONFIG_NET_PKTGEN is not set
521# CONFIG_NETPOLL is not set
522# CONFIG_NET_POLL_CONTROLLER is not set
523# CONFIG_HAMRADIO is not set
524# CONFIG_IRDA is not set
525# CONFIG_BT is not set
526CONFIG_NETDEVICES=y 549CONFIG_NETDEVICES=y
527CONFIG_DUMMY=m 550CONFIG_DUMMY=m
528CONFIG_BONDING=m 551CONFIG_BONDING=m
@@ -562,6 +585,7 @@ CONFIG_E1000=y
562# CONFIG_HAMACHI is not set 585# CONFIG_HAMACHI is not set
563# CONFIG_YELLOWFIN is not set 586# CONFIG_YELLOWFIN is not set
564# CONFIG_R8169 is not set 587# CONFIG_R8169 is not set
588# CONFIG_SKGE is not set
565# CONFIG_SK98LIN is not set 589# CONFIG_SK98LIN is not set
566CONFIG_TIGON3=m 590CONFIG_TIGON3=m
567# CONFIG_BNX2 is not set 591# CONFIG_BNX2 is not set
@@ -604,6 +628,8 @@ CONFIG_PPPOE=m
604# CONFIG_NET_FC is not set 628# CONFIG_NET_FC is not set
605# CONFIG_SHAPER is not set 629# CONFIG_SHAPER is not set
606# CONFIG_NETCONSOLE is not set 630# CONFIG_NETCONSOLE is not set
631# CONFIG_NETPOLL is not set
632# CONFIG_NET_POLL_CONTROLLER is not set
607 633
608# 634#
609# ISDN subsystem 635# ISDN subsystem
@@ -691,7 +717,6 @@ CONFIG_LEGACY_PTY_COUNT=256
691# 717#
692# CONFIG_WATCHDOG is not set 718# CONFIG_WATCHDOG is not set
693# CONFIG_RTC is not set 719# CONFIG_RTC is not set
694# CONFIG_GEN_RTC is not set
695# CONFIG_DTLK is not set 720# CONFIG_DTLK is not set
696# CONFIG_R3964 is not set 721# CONFIG_R3964 is not set
697# CONFIG_APPLICOM is not set 722# CONFIG_APPLICOM is not set
@@ -750,50 +775,19 @@ CONFIG_I2C_KEYWEST=y
750# CONFIG_I2C_VIAPRO is not set 775# CONFIG_I2C_VIAPRO is not set
751# CONFIG_I2C_VOODOO3 is not set 776# CONFIG_I2C_VOODOO3 is not set
752# CONFIG_I2C_PCA_ISA is not set 777# CONFIG_I2C_PCA_ISA is not set
778# CONFIG_I2C_SENSOR is not set
753 779
754# 780#
755# Hardware Sensors Chip support 781# Miscellaneous I2C Chip support
756#
757# CONFIG_I2C_SENSOR is not set
758# CONFIG_SENSORS_ADM1021 is not set
759# CONFIG_SENSORS_ADM1025 is not set
760# CONFIG_SENSORS_ADM1026 is not set
761# CONFIG_SENSORS_ADM1031 is not set
762# CONFIG_SENSORS_ASB100 is not set
763# CONFIG_SENSORS_DS1621 is not set
764# CONFIG_SENSORS_FSCHER is not set
765# CONFIG_SENSORS_FSCPOS is not set
766# CONFIG_SENSORS_GL518SM is not set
767# CONFIG_SENSORS_GL520SM is not set
768# CONFIG_SENSORS_IT87 is not set
769# CONFIG_SENSORS_LM63 is not set
770# CONFIG_SENSORS_LM75 is not set
771# CONFIG_SENSORS_LM77 is not set
772# CONFIG_SENSORS_LM78 is not set
773# CONFIG_SENSORS_LM80 is not set
774# CONFIG_SENSORS_LM83 is not set
775# CONFIG_SENSORS_LM85 is not set
776# CONFIG_SENSORS_LM87 is not set
777# CONFIG_SENSORS_LM90 is not set
778# CONFIG_SENSORS_LM92 is not set
779# CONFIG_SENSORS_MAX1619 is not set
780# CONFIG_SENSORS_PC87360 is not set
781# CONFIG_SENSORS_SMSC47B397 is not set
782# CONFIG_SENSORS_SIS5595 is not set
783# CONFIG_SENSORS_SMSC47M1 is not set
784# CONFIG_SENSORS_VIA686A is not set
785# CONFIG_SENSORS_W83781D is not set
786# CONFIG_SENSORS_W83L785TS is not set
787# CONFIG_SENSORS_W83627HF is not set
788
789#
790# Other I2C Chip support
791# 782#
792# CONFIG_SENSORS_DS1337 is not set 783# CONFIG_SENSORS_DS1337 is not set
784# CONFIG_SENSORS_DS1374 is not set
793# CONFIG_SENSORS_EEPROM is not set 785# CONFIG_SENSORS_EEPROM is not set
794# CONFIG_SENSORS_PCF8574 is not set 786# CONFIG_SENSORS_PCF8574 is not set
787# CONFIG_SENSORS_PCA9539 is not set
795# CONFIG_SENSORS_PCF8591 is not set 788# CONFIG_SENSORS_PCF8591 is not set
796# CONFIG_SENSORS_RTC8564 is not set 789# CONFIG_SENSORS_RTC8564 is not set
790# CONFIG_SENSORS_MAX6875 is not set
797# CONFIG_I2C_DEBUG_CORE is not set 791# CONFIG_I2C_DEBUG_CORE is not set
798# CONFIG_I2C_DEBUG_ALGO is not set 792# CONFIG_I2C_DEBUG_ALGO is not set
799# CONFIG_I2C_DEBUG_BUS is not set 793# CONFIG_I2C_DEBUG_BUS is not set
@@ -805,6 +799,11 @@ CONFIG_I2C_KEYWEST=y
805# CONFIG_W1 is not set 799# CONFIG_W1 is not set
806 800
807# 801#
802# Hardware Monitoring support
803#
804# CONFIG_HWMON is not set
805
806#
808# Misc devices 807# Misc devices
809# 808#
810 809
@@ -911,6 +910,7 @@ CONFIG_USB_DEVICEFS=y
911CONFIG_USB_EHCI_HCD=y 910CONFIG_USB_EHCI_HCD=y
912# CONFIG_USB_EHCI_SPLIT_ISO is not set 911# CONFIG_USB_EHCI_SPLIT_ISO is not set
913# CONFIG_USB_EHCI_ROOT_HUB_TT is not set 912# CONFIG_USB_EHCI_ROOT_HUB_TT is not set
913# CONFIG_USB_ISP116X_HCD is not set
914CONFIG_USB_OHCI_HCD=y 914CONFIG_USB_OHCI_HCD=y
915# CONFIG_USB_OHCI_BIG_ENDIAN is not set 915# CONFIG_USB_OHCI_BIG_ENDIAN is not set
916CONFIG_USB_OHCI_LITTLE_ENDIAN=y 916CONFIG_USB_OHCI_LITTLE_ENDIAN=y
@@ -950,12 +950,15 @@ CONFIG_THRUSTMASTER_FF=y
950CONFIG_USB_HIDDEV=y 950CONFIG_USB_HIDDEV=y
951# CONFIG_USB_AIPTEK is not set 951# CONFIG_USB_AIPTEK is not set
952# CONFIG_USB_WACOM is not set 952# CONFIG_USB_WACOM is not set
953# CONFIG_USB_ACECAD is not set
953# CONFIG_USB_KBTAB is not set 954# CONFIG_USB_KBTAB is not set
954# CONFIG_USB_POWERMATE is not set 955# CONFIG_USB_POWERMATE is not set
955# CONFIG_USB_MTOUCH is not set 956# CONFIG_USB_MTOUCH is not set
957# CONFIG_USB_ITMTOUCH is not set
956# CONFIG_USB_EGALAX is not set 958# CONFIG_USB_EGALAX is not set
957# CONFIG_USB_XPAD is not set 959# CONFIG_USB_XPAD is not set
958# CONFIG_USB_ATI_REMOTE is not set 960# CONFIG_USB_ATI_REMOTE is not set
961# CONFIG_USB_KEYSPAN_REMOTE is not set
959 962
960# 963#
961# USB Imaging devices 964# USB Imaging devices
@@ -1071,10 +1074,11 @@ CONFIG_USB_EZUSB=y
1071# CONFIG_USB_PHIDGETSERVO is not set 1074# CONFIG_USB_PHIDGETSERVO is not set
1072# CONFIG_USB_IDMOUSE is not set 1075# CONFIG_USB_IDMOUSE is not set
1073# CONFIG_USB_SISUSBVGA is not set 1076# CONFIG_USB_SISUSBVGA is not set
1077# CONFIG_USB_LD is not set
1074# CONFIG_USB_TEST is not set 1078# CONFIG_USB_TEST is not set
1075 1079
1076# 1080#
1077# USB ATM/DSL drivers 1081# USB DSL modem support
1078# 1082#
1079 1083
1080# 1084#
@@ -1093,12 +1097,18 @@ CONFIG_USB_EZUSB=y
1093# CONFIG_INFINIBAND is not set 1097# CONFIG_INFINIBAND is not set
1094 1098
1095# 1099#
1100# SN Devices
1101#
1102
1103#
1096# File systems 1104# File systems
1097# 1105#
1098CONFIG_EXT2_FS=y 1106CONFIG_EXT2_FS=y
1099CONFIG_EXT2_FS_XATTR=y 1107CONFIG_EXT2_FS_XATTR=y
1100CONFIG_EXT2_FS_POSIX_ACL=y 1108CONFIG_EXT2_FS_POSIX_ACL=y
1101CONFIG_EXT2_FS_SECURITY=y 1109CONFIG_EXT2_FS_SECURITY=y
1110CONFIG_EXT2_FS_XIP=y
1111CONFIG_FS_XIP=y
1102CONFIG_EXT3_FS=y 1112CONFIG_EXT3_FS=y
1103CONFIG_EXT3_FS_XATTR=y 1113CONFIG_EXT3_FS_XATTR=y
1104CONFIG_EXT3_FS_POSIX_ACL=y 1114CONFIG_EXT3_FS_POSIX_ACL=y
@@ -1126,6 +1136,7 @@ CONFIG_XFS_SECURITY=y
1126CONFIG_XFS_POSIX_ACL=y 1136CONFIG_XFS_POSIX_ACL=y
1127# CONFIG_MINIX_FS is not set 1137# CONFIG_MINIX_FS is not set
1128# CONFIG_ROMFS_FS is not set 1138# CONFIG_ROMFS_FS is not set
1139CONFIG_INOTIFY=y
1129# CONFIG_QUOTA is not set 1140# CONFIG_QUOTA is not set
1130CONFIG_DNOTIFY=y 1141CONFIG_DNOTIFY=y
1131CONFIG_AUTOFS_FS=m 1142CONFIG_AUTOFS_FS=m
@@ -1157,7 +1168,6 @@ CONFIG_FAT_DEFAULT_IOCHARSET="iso8859-1"
1157CONFIG_PROC_FS=y 1168CONFIG_PROC_FS=y
1158CONFIG_PROC_KCORE=y 1169CONFIG_PROC_KCORE=y
1159CONFIG_SYSFS=y 1170CONFIG_SYSFS=y
1160# CONFIG_DEVFS_FS is not set
1161CONFIG_DEVPTS_FS_XATTR=y 1171CONFIG_DEVPTS_FS_XATTR=y
1162# CONFIG_DEVPTS_FS_SECURITY is not set 1172# CONFIG_DEVPTS_FS_SECURITY is not set
1163CONFIG_TMPFS=y 1173CONFIG_TMPFS=y
@@ -1189,15 +1199,20 @@ CONFIG_CRAMFS=y
1189# 1199#
1190CONFIG_NFS_FS=y 1200CONFIG_NFS_FS=y
1191CONFIG_NFS_V3=y 1201CONFIG_NFS_V3=y
1202CONFIG_NFS_V3_ACL=y
1192CONFIG_NFS_V4=y 1203CONFIG_NFS_V4=y
1193# CONFIG_NFS_DIRECTIO is not set 1204# CONFIG_NFS_DIRECTIO is not set
1194CONFIG_NFSD=y 1205CONFIG_NFSD=y
1206CONFIG_NFSD_V2_ACL=y
1195CONFIG_NFSD_V3=y 1207CONFIG_NFSD_V3=y
1208CONFIG_NFSD_V3_ACL=y
1196CONFIG_NFSD_V4=y 1209CONFIG_NFSD_V4=y
1197CONFIG_NFSD_TCP=y 1210CONFIG_NFSD_TCP=y
1198CONFIG_LOCKD=y 1211CONFIG_LOCKD=y
1199CONFIG_LOCKD_V4=y 1212CONFIG_LOCKD_V4=y
1200CONFIG_EXPORTFS=y 1213CONFIG_EXPORTFS=y
1214CONFIG_NFS_ACL_SUPPORT=y
1215CONFIG_NFS_COMMON=y
1201CONFIG_SUNRPC=y 1216CONFIG_SUNRPC=y
1202CONFIG_SUNRPC_GSS=y 1217CONFIG_SUNRPC_GSS=y
1203CONFIG_RPCSEC_GSS_KRB5=y 1218CONFIG_RPCSEC_GSS_KRB5=y
diff --git a/arch/ppc64/configs/iSeries_defconfig b/arch/ppc64/configs/iSeries_defconfig
index f6a2b99afd63..013d4e0e4003 100644
--- a/arch/ppc64/configs/iSeries_defconfig
+++ b/arch/ppc64/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.12-rc6 3# Linux kernel version: 2.6.13-rc6
4# Tue Jun 14 17:01:28 2005 4# Mon Aug 8 14:17:02 2005
5# 5#
6CONFIG_64BIT=y 6CONFIG_64BIT=y
7CONFIG_MMU=y 7CONFIG_MMU=y
@@ -80,10 +80,25 @@ CONFIG_IBMVIO=y
80CONFIG_IOMMU_VMERGE=y 80CONFIG_IOMMU_VMERGE=y
81CONFIG_SMP=y 81CONFIG_SMP=y
82CONFIG_NR_CPUS=32 82CONFIG_NR_CPUS=32
83CONFIG_ARCH_SELECT_MEMORY_MODEL=y
84CONFIG_ARCH_FLATMEM_ENABLE=y
85CONFIG_SELECT_MEMORY_MODEL=y
86CONFIG_FLATMEM_MANUAL=y
87# CONFIG_DISCONTIGMEM_MANUAL is not set
88# CONFIG_SPARSEMEM_MANUAL is not set
89CONFIG_FLATMEM=y
90CONFIG_FLAT_NODE_MEM_MAP=y
91# CONFIG_NUMA is not set
83# CONFIG_SCHED_SMT is not set 92# CONFIG_SCHED_SMT is not set
93CONFIG_PREEMPT_NONE=y
94# CONFIG_PREEMPT_VOLUNTARY is not set
84# CONFIG_PREEMPT is not set 95# CONFIG_PREEMPT is not set
96# CONFIG_PREEMPT_BKL is not set
97# CONFIG_HZ_100 is not set
98CONFIG_HZ_250=y
99# CONFIG_HZ_1000 is not set
100CONFIG_HZ=250
85CONFIG_GENERIC_HARDIRQS=y 101CONFIG_GENERIC_HARDIRQS=y
86CONFIG_MSCHUNKS=y
87CONFIG_LPARCFG=y 102CONFIG_LPARCFG=y
88CONFIG_SECCOMP=y 103CONFIG_SECCOMP=y
89CONFIG_ISA_DMA_API=y 104CONFIG_ISA_DMA_API=y
@@ -110,6 +125,142 @@ CONFIG_PCI_NAMES=y
110# CONFIG_HOTPLUG_PCI is not set 125# CONFIG_HOTPLUG_PCI is not set
111 126
112# 127#
128# Networking
129#
130CONFIG_NET=y
131
132#
133# Networking options
134#
135CONFIG_PACKET=y
136# CONFIG_PACKET_MMAP is not set
137CONFIG_UNIX=y
138CONFIG_XFRM=y
139CONFIG_XFRM_USER=m
140CONFIG_NET_KEY=m
141CONFIG_INET=y
142CONFIG_IP_MULTICAST=y
143# CONFIG_IP_ADVANCED_ROUTER is not set
144CONFIG_IP_FIB_HASH=y
145# CONFIG_IP_PNP is not set
146CONFIG_NET_IPIP=y
147# CONFIG_NET_IPGRE is not set
148# CONFIG_IP_MROUTE is not set
149# CONFIG_ARPD is not set
150CONFIG_SYN_COOKIES=y
151CONFIG_INET_AH=m
152CONFIG_INET_ESP=m
153CONFIG_INET_IPCOMP=m
154CONFIG_INET_TUNNEL=y
155CONFIG_IP_TCPDIAG=m
156# CONFIG_IP_TCPDIAG_IPV6 is not set
157# CONFIG_TCP_CONG_ADVANCED is not set
158CONFIG_TCP_CONG_BIC=y
159
160#
161# IP: Virtual Server Configuration
162#
163# CONFIG_IP_VS is not set
164# CONFIG_IPV6 is not set
165CONFIG_NETFILTER=y
166# CONFIG_NETFILTER_DEBUG is not set
167
168#
169# IP: Netfilter Configuration
170#
171CONFIG_IP_NF_CONNTRACK=m
172CONFIG_IP_NF_CT_ACCT=y
173CONFIG_IP_NF_CONNTRACK_MARK=y
174CONFIG_IP_NF_CT_PROTO_SCTP=m
175CONFIG_IP_NF_FTP=m
176CONFIG_IP_NF_IRC=m
177CONFIG_IP_NF_TFTP=m
178CONFIG_IP_NF_AMANDA=m
179CONFIG_IP_NF_QUEUE=m
180CONFIG_IP_NF_IPTABLES=m
181CONFIG_IP_NF_MATCH_LIMIT=m
182CONFIG_IP_NF_MATCH_IPRANGE=m
183CONFIG_IP_NF_MATCH_MAC=m
184CONFIG_IP_NF_MATCH_PKTTYPE=m
185CONFIG_IP_NF_MATCH_MARK=m
186CONFIG_IP_NF_MATCH_MULTIPORT=m
187CONFIG_IP_NF_MATCH_TOS=m
188CONFIG_IP_NF_MATCH_RECENT=m
189CONFIG_IP_NF_MATCH_ECN=m
190CONFIG_IP_NF_MATCH_DSCP=m
191CONFIG_IP_NF_MATCH_AH_ESP=m
192CONFIG_IP_NF_MATCH_LENGTH=m
193CONFIG_IP_NF_MATCH_TTL=m
194CONFIG_IP_NF_MATCH_TCPMSS=m
195CONFIG_IP_NF_MATCH_HELPER=m
196CONFIG_IP_NF_MATCH_STATE=m
197CONFIG_IP_NF_MATCH_CONNTRACK=m
198CONFIG_IP_NF_MATCH_OWNER=m
199CONFIG_IP_NF_MATCH_ADDRTYPE=m
200CONFIG_IP_NF_MATCH_REALM=m
201CONFIG_IP_NF_MATCH_SCTP=m
202CONFIG_IP_NF_MATCH_COMMENT=m
203CONFIG_IP_NF_MATCH_CONNMARK=m
204CONFIG_IP_NF_MATCH_HASHLIMIT=m
205CONFIG_IP_NF_FILTER=m
206CONFIG_IP_NF_TARGET_REJECT=m
207CONFIG_IP_NF_TARGET_LOG=m
208CONFIG_IP_NF_TARGET_ULOG=m
209CONFIG_IP_NF_TARGET_TCPMSS=m
210CONFIG_IP_NF_NAT=m
211CONFIG_IP_NF_NAT_NEEDED=y
212CONFIG_IP_NF_TARGET_MASQUERADE=m
213CONFIG_IP_NF_TARGET_REDIRECT=m
214CONFIG_IP_NF_TARGET_NETMAP=m
215CONFIG_IP_NF_TARGET_SAME=m
216CONFIG_IP_NF_NAT_SNMP_BASIC=m
217CONFIG_IP_NF_NAT_IRC=m
218CONFIG_IP_NF_NAT_FTP=m
219CONFIG_IP_NF_NAT_TFTP=m
220CONFIG_IP_NF_NAT_AMANDA=m
221CONFIG_IP_NF_MANGLE=m
222CONFIG_IP_NF_TARGET_TOS=m
223CONFIG_IP_NF_TARGET_ECN=m
224CONFIG_IP_NF_TARGET_DSCP=m
225CONFIG_IP_NF_TARGET_MARK=m
226CONFIG_IP_NF_TARGET_CLASSIFY=m
227CONFIG_IP_NF_TARGET_CONNMARK=m
228CONFIG_IP_NF_TARGET_CLUSTERIP=m
229CONFIG_IP_NF_RAW=m
230CONFIG_IP_NF_TARGET_NOTRACK=m
231CONFIG_IP_NF_ARPTABLES=m
232CONFIG_IP_NF_ARPFILTER=m
233CONFIG_IP_NF_ARP_MANGLE=m
234
235#
236# SCTP Configuration (EXPERIMENTAL)
237#
238# CONFIG_IP_SCTP is not set
239# CONFIG_ATM is not set
240# CONFIG_BRIDGE is not set
241# CONFIG_VLAN_8021Q is not set
242# CONFIG_DECNET is not set
243CONFIG_LLC=y
244# CONFIG_LLC2 is not set
245# CONFIG_IPX is not set
246# CONFIG_ATALK is not set
247# CONFIG_X25 is not set
248# CONFIG_LAPB is not set
249# CONFIG_NET_DIVERT is not set
250# CONFIG_ECONET is not set
251# CONFIG_WAN_ROUTER is not set
252# CONFIG_NET_SCHED is not set
253CONFIG_NET_CLS_ROUTE=y
254
255#
256# Network testing
257#
258# CONFIG_NET_PKTGEN is not set
259# CONFIG_HAMRADIO is not set
260# CONFIG_IRDA is not set
261# CONFIG_BT is not set
262
263#
113# Device Drivers 264# Device Drivers
114# 265#
115 266
@@ -184,6 +335,7 @@ CONFIG_CHR_DEV_ST=y
184CONFIG_BLK_DEV_SR=y 335CONFIG_BLK_DEV_SR=y
185CONFIG_BLK_DEV_SR_VENDOR=y 336CONFIG_BLK_DEV_SR_VENDOR=y
186CONFIG_CHR_DEV_SG=y 337CONFIG_CHR_DEV_SG=y
338# CONFIG_CHR_DEV_SCH is not set
187 339
188# 340#
189# Some SCSI devices (e.g. CD jukebox) support multiple LUNs 341# Some SCSI devices (e.g. CD jukebox) support multiple LUNs
@@ -231,6 +383,7 @@ CONFIG_SCSI_QLA2XXX=y
231# CONFIG_SCSI_QLA2300 is not set 383# CONFIG_SCSI_QLA2300 is not set
232# CONFIG_SCSI_QLA2322 is not set 384# CONFIG_SCSI_QLA2322 is not set
233# CONFIG_SCSI_QLA6312 is not set 385# CONFIG_SCSI_QLA6312 is not set
386# CONFIG_SCSI_QLA24XX is not set
234# CONFIG_SCSI_LPFC is not set 387# CONFIG_SCSI_LPFC is not set
235# CONFIG_SCSI_DC395x is not set 388# CONFIG_SCSI_DC395x is not set
236# CONFIG_SCSI_DC390T is not set 389# CONFIG_SCSI_DC390T is not set
@@ -260,6 +413,8 @@ CONFIG_DM_ZERO=m
260# Fusion MPT device support 413# Fusion MPT device support
261# 414#
262# CONFIG_FUSION is not set 415# CONFIG_FUSION is not set
416# CONFIG_FUSION_SPI is not set
417# CONFIG_FUSION_FC is not set
263 418
264# 419#
265# IEEE 1394 (FireWire) support 420# IEEE 1394 (FireWire) support
@@ -276,145 +431,8 @@ CONFIG_DM_ZERO=m
276# 431#
277 432
278# 433#
279# Networking support 434# Network device support
280#
281CONFIG_NET=y
282
283#
284# Networking options
285#
286CONFIG_PACKET=y
287# CONFIG_PACKET_MMAP is not set
288CONFIG_UNIX=y
289CONFIG_NET_KEY=m
290CONFIG_INET=y
291CONFIG_IP_MULTICAST=y
292# CONFIG_IP_ADVANCED_ROUTER is not set
293# CONFIG_IP_PNP is not set
294CONFIG_NET_IPIP=y
295# CONFIG_NET_IPGRE is not set
296# CONFIG_IP_MROUTE is not set
297# CONFIG_ARPD is not set
298CONFIG_SYN_COOKIES=y
299CONFIG_INET_AH=m
300CONFIG_INET_ESP=m
301CONFIG_INET_IPCOMP=m
302CONFIG_INET_TUNNEL=y
303CONFIG_IP_TCPDIAG=m
304# CONFIG_IP_TCPDIAG_IPV6 is not set
305
306#
307# IP: Virtual Server Configuration
308#
309# CONFIG_IP_VS is not set
310# CONFIG_IPV6 is not set
311CONFIG_NETFILTER=y
312# CONFIG_NETFILTER_DEBUG is not set
313
314# 435#
315# IP: Netfilter Configuration
316#
317CONFIG_IP_NF_CONNTRACK=m
318CONFIG_IP_NF_CT_ACCT=y
319CONFIG_IP_NF_CONNTRACK_MARK=y
320CONFIG_IP_NF_CT_PROTO_SCTP=m
321CONFIG_IP_NF_FTP=m
322CONFIG_IP_NF_IRC=m
323CONFIG_IP_NF_TFTP=m
324CONFIG_IP_NF_AMANDA=m
325CONFIG_IP_NF_QUEUE=m
326CONFIG_IP_NF_IPTABLES=m
327CONFIG_IP_NF_MATCH_LIMIT=m
328CONFIG_IP_NF_MATCH_IPRANGE=m
329CONFIG_IP_NF_MATCH_MAC=m
330CONFIG_IP_NF_MATCH_PKTTYPE=m
331CONFIG_IP_NF_MATCH_MARK=m
332CONFIG_IP_NF_MATCH_MULTIPORT=m
333CONFIG_IP_NF_MATCH_TOS=m
334CONFIG_IP_NF_MATCH_RECENT=m
335CONFIG_IP_NF_MATCH_ECN=m
336CONFIG_IP_NF_MATCH_DSCP=m
337CONFIG_IP_NF_MATCH_AH_ESP=m
338CONFIG_IP_NF_MATCH_LENGTH=m
339CONFIG_IP_NF_MATCH_TTL=m
340CONFIG_IP_NF_MATCH_TCPMSS=m
341CONFIG_IP_NF_MATCH_HELPER=m
342CONFIG_IP_NF_MATCH_STATE=m
343CONFIG_IP_NF_MATCH_CONNTRACK=m
344CONFIG_IP_NF_MATCH_OWNER=m
345CONFIG_IP_NF_MATCH_ADDRTYPE=m
346CONFIG_IP_NF_MATCH_REALM=m
347CONFIG_IP_NF_MATCH_SCTP=m
348CONFIG_IP_NF_MATCH_COMMENT=m
349CONFIG_IP_NF_MATCH_CONNMARK=m
350CONFIG_IP_NF_MATCH_HASHLIMIT=m
351CONFIG_IP_NF_FILTER=m
352CONFIG_IP_NF_TARGET_REJECT=m
353CONFIG_IP_NF_TARGET_LOG=m
354CONFIG_IP_NF_TARGET_ULOG=m
355CONFIG_IP_NF_TARGET_TCPMSS=m
356CONFIG_IP_NF_NAT=m
357CONFIG_IP_NF_NAT_NEEDED=y
358CONFIG_IP_NF_TARGET_MASQUERADE=m
359CONFIG_IP_NF_TARGET_REDIRECT=m
360CONFIG_IP_NF_TARGET_NETMAP=m
361CONFIG_IP_NF_TARGET_SAME=m
362CONFIG_IP_NF_NAT_SNMP_BASIC=m
363CONFIG_IP_NF_NAT_IRC=m
364CONFIG_IP_NF_NAT_FTP=m
365CONFIG_IP_NF_NAT_TFTP=m
366CONFIG_IP_NF_NAT_AMANDA=m
367CONFIG_IP_NF_MANGLE=m
368CONFIG_IP_NF_TARGET_TOS=m
369CONFIG_IP_NF_TARGET_ECN=m
370CONFIG_IP_NF_TARGET_DSCP=m
371CONFIG_IP_NF_TARGET_MARK=m
372CONFIG_IP_NF_TARGET_CLASSIFY=m
373CONFIG_IP_NF_TARGET_CONNMARK=m
374CONFIG_IP_NF_TARGET_CLUSTERIP=m
375CONFIG_IP_NF_RAW=m
376CONFIG_IP_NF_TARGET_NOTRACK=m
377CONFIG_IP_NF_ARPTABLES=m
378CONFIG_IP_NF_ARPFILTER=m
379CONFIG_IP_NF_ARP_MANGLE=m
380CONFIG_XFRM=y
381CONFIG_XFRM_USER=m
382
383#
384# SCTP Configuration (EXPERIMENTAL)
385#
386# CONFIG_IP_SCTP is not set
387# CONFIG_ATM is not set
388# CONFIG_BRIDGE is not set
389# CONFIG_VLAN_8021Q is not set
390# CONFIG_DECNET is not set
391CONFIG_LLC=y
392# CONFIG_LLC2 is not set
393# CONFIG_IPX is not set
394# CONFIG_ATALK is not set
395# CONFIG_X25 is not set
396# CONFIG_LAPB is not set
397# CONFIG_NET_DIVERT is not set
398# CONFIG_ECONET is not set
399# CONFIG_WAN_ROUTER is not set
400
401#
402# QoS and/or fair queueing
403#
404# CONFIG_NET_SCHED is not set
405CONFIG_NET_CLS_ROUTE=y
406
407#
408# Network testing
409#
410# CONFIG_NET_PKTGEN is not set
411CONFIG_NETPOLL=y
412CONFIG_NETPOLL_RX=y
413CONFIG_NETPOLL_TRAP=y
414CONFIG_NET_POLL_CONTROLLER=y
415# CONFIG_HAMRADIO is not set
416# CONFIG_IRDA is not set
417# CONFIG_BT is not set
418CONFIG_NETDEVICES=y 436CONFIG_NETDEVICES=y
419CONFIG_DUMMY=m 437CONFIG_DUMMY=m
420CONFIG_BONDING=m 438CONFIG_BONDING=m
@@ -471,6 +489,7 @@ CONFIG_E1000=m
471# CONFIG_HAMACHI is not set 489# CONFIG_HAMACHI is not set
472# CONFIG_YELLOWFIN is not set 490# CONFIG_YELLOWFIN is not set
473# CONFIG_R8169 is not set 491# CONFIG_R8169 is not set
492# CONFIG_SKGE is not set
474# CONFIG_SK98LIN is not set 493# CONFIG_SK98LIN is not set
475# CONFIG_VIA_VELOCITY is not set 494# CONFIG_VIA_VELOCITY is not set
476# CONFIG_TIGON3 is not set 495# CONFIG_TIGON3 is not set
@@ -514,6 +533,10 @@ CONFIG_PPPOE=m
514# CONFIG_NET_FC is not set 533# CONFIG_NET_FC is not set
515# CONFIG_SHAPER is not set 534# CONFIG_SHAPER is not set
516CONFIG_NETCONSOLE=y 535CONFIG_NETCONSOLE=y
536CONFIG_NETPOLL=y
537CONFIG_NETPOLL_RX=y
538CONFIG_NETPOLL_TRAP=y
539CONFIG_NET_POLL_CONTROLLER=y
517 540
518# 541#
519# ISDN subsystem 542# ISDN subsystem
@@ -587,7 +610,6 @@ CONFIG_LEGACY_PTY_COUNT=256
587# 610#
588# CONFIG_WATCHDOG is not set 611# CONFIG_WATCHDOG is not set
589# CONFIG_RTC is not set 612# CONFIG_RTC is not set
590# CONFIG_GEN_RTC is not set
591# CONFIG_DTLK is not set 613# CONFIG_DTLK is not set
592# CONFIG_R3964 is not set 614# CONFIG_R3964 is not set
593# CONFIG_APPLICOM is not set 615# CONFIG_APPLICOM is not set
@@ -610,6 +632,7 @@ CONFIG_MAX_RAW_DEVS=256
610# I2C support 632# I2C support
611# 633#
612# CONFIG_I2C is not set 634# CONFIG_I2C is not set
635# CONFIG_I2C_SENSOR is not set
613 636
614# 637#
615# Dallas's 1-wire bus 638# Dallas's 1-wire bus
@@ -617,6 +640,11 @@ CONFIG_MAX_RAW_DEVS=256
617# CONFIG_W1 is not set 640# CONFIG_W1 is not set
618 641
619# 642#
643# Hardware Monitoring support
644#
645# CONFIG_HWMON is not set
646
647#
620# Misc devices 648# Misc devices
621# 649#
622 650
@@ -663,12 +691,18 @@ CONFIG_USB_ARCH_HAS_OHCI=y
663# CONFIG_INFINIBAND is not set 691# CONFIG_INFINIBAND is not set
664 692
665# 693#
694# SN Devices
695#
696
697#
666# File systems 698# File systems
667# 699#
668CONFIG_EXT2_FS=y 700CONFIG_EXT2_FS=y
669CONFIG_EXT2_FS_XATTR=y 701CONFIG_EXT2_FS_XATTR=y
670CONFIG_EXT2_FS_POSIX_ACL=y 702CONFIG_EXT2_FS_POSIX_ACL=y
671CONFIG_EXT2_FS_SECURITY=y 703CONFIG_EXT2_FS_SECURITY=y
704CONFIG_EXT2_FS_XIP=y
705CONFIG_FS_XIP=y
672CONFIG_EXT3_FS=y 706CONFIG_EXT3_FS=y
673CONFIG_EXT3_FS_XATTR=y 707CONFIG_EXT3_FS_XATTR=y
674CONFIG_EXT3_FS_POSIX_ACL=y 708CONFIG_EXT3_FS_POSIX_ACL=y
@@ -700,6 +734,7 @@ CONFIG_XFS_SECURITY=y
700CONFIG_XFS_POSIX_ACL=y 734CONFIG_XFS_POSIX_ACL=y
701# CONFIG_MINIX_FS is not set 735# CONFIG_MINIX_FS is not set
702# CONFIG_ROMFS_FS is not set 736# CONFIG_ROMFS_FS is not set
737CONFIG_INOTIFY=y
703# CONFIG_QUOTA is not set 738# CONFIG_QUOTA is not set
704CONFIG_DNOTIFY=y 739CONFIG_DNOTIFY=y
705CONFIG_AUTOFS_FS=m 740CONFIG_AUTOFS_FS=m
@@ -731,7 +766,6 @@ CONFIG_FAT_DEFAULT_IOCHARSET="iso8859-1"
731CONFIG_PROC_FS=y 766CONFIG_PROC_FS=y
732CONFIG_PROC_KCORE=y 767CONFIG_PROC_KCORE=y
733CONFIG_SYSFS=y 768CONFIG_SYSFS=y
734# CONFIG_DEVFS_FS is not set
735CONFIG_DEVPTS_FS_XATTR=y 769CONFIG_DEVPTS_FS_XATTR=y
736CONFIG_DEVPTS_FS_SECURITY=y 770CONFIG_DEVPTS_FS_SECURITY=y
737CONFIG_TMPFS=y 771CONFIG_TMPFS=y
@@ -763,15 +797,20 @@ CONFIG_CRAMFS=y
763# 797#
764CONFIG_NFS_FS=y 798CONFIG_NFS_FS=y
765CONFIG_NFS_V3=y 799CONFIG_NFS_V3=y
800CONFIG_NFS_V3_ACL=y
766CONFIG_NFS_V4=y 801CONFIG_NFS_V4=y
767# CONFIG_NFS_DIRECTIO is not set 802# CONFIG_NFS_DIRECTIO is not set
768CONFIG_NFSD=m 803CONFIG_NFSD=m
804CONFIG_NFSD_V2_ACL=y
769CONFIG_NFSD_V3=y 805CONFIG_NFSD_V3=y
806CONFIG_NFSD_V3_ACL=y
770CONFIG_NFSD_V4=y 807CONFIG_NFSD_V4=y
771CONFIG_NFSD_TCP=y 808CONFIG_NFSD_TCP=y
772CONFIG_LOCKD=y 809CONFIG_LOCKD=y
773CONFIG_LOCKD_V4=y 810CONFIG_LOCKD_V4=y
774CONFIG_EXPORTFS=m 811CONFIG_EXPORTFS=m
812CONFIG_NFS_ACL_SUPPORT=y
813CONFIG_NFS_COMMON=y
775CONFIG_SUNRPC=y 814CONFIG_SUNRPC=y
776CONFIG_SUNRPC_GSS=y 815CONFIG_SUNRPC_GSS=y
777CONFIG_RPCSEC_GSS_KRB5=y 816CONFIG_RPCSEC_GSS_KRB5=y
diff --git a/arch/ppc64/configs/maple_defconfig b/arch/ppc64/configs/maple_defconfig
index 8051b0f47b6f..dd42892cd873 100644
--- a/arch/ppc64/configs/maple_defconfig
+++ b/arch/ppc64/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.12-rc6 3# Linux kernel version: 2.6.13-rc6
4# Tue Jun 14 17:12:48 2005 4# Mon Aug 8 14:17:04 2005
5# 5#
6CONFIG_64BIT=y 6CONFIG_64BIT=y
7CONFIG_MMU=y 7CONFIG_MMU=y
@@ -73,12 +73,15 @@ CONFIG_SYSVIPC_COMPAT=y
73# CONFIG_PPC_ISERIES is not set 73# CONFIG_PPC_ISERIES is not set
74CONFIG_PPC_MULTIPLATFORM=y 74CONFIG_PPC_MULTIPLATFORM=y
75# CONFIG_PPC_PSERIES is not set 75# CONFIG_PPC_PSERIES is not set
76# CONFIG_PPC_BPA is not set
76# CONFIG_PPC_PMAC is not set 77# CONFIG_PPC_PMAC is not set
77CONFIG_PPC_MAPLE=y 78CONFIG_PPC_MAPLE=y
78CONFIG_PPC=y 79CONFIG_PPC=y
79CONFIG_PPC64=y 80CONFIG_PPC64=y
80CONFIG_PPC_OF=y 81CONFIG_PPC_OF=y
82CONFIG_MPIC=y
81# CONFIG_ALTIVEC is not set 83# CONFIG_ALTIVEC is not set
84CONFIG_KEXEC=y
82CONFIG_U3_DART=y 85CONFIG_U3_DART=y
83CONFIG_MPIC_BROKEN_U3=y 86CONFIG_MPIC_BROKEN_U3=y
84CONFIG_BOOTX_TEXT=y 87CONFIG_BOOTX_TEXT=y
@@ -86,8 +89,24 @@ CONFIG_POWER4_ONLY=y
86CONFIG_IOMMU_VMERGE=y 89CONFIG_IOMMU_VMERGE=y
87CONFIG_SMP=y 90CONFIG_SMP=y
88CONFIG_NR_CPUS=2 91CONFIG_NR_CPUS=2
92CONFIG_ARCH_SELECT_MEMORY_MODEL=y
93CONFIG_ARCH_FLATMEM_ENABLE=y
94CONFIG_SELECT_MEMORY_MODEL=y
95CONFIG_FLATMEM_MANUAL=y
96# CONFIG_DISCONTIGMEM_MANUAL is not set
97# CONFIG_SPARSEMEM_MANUAL is not set
98CONFIG_FLATMEM=y
99CONFIG_FLAT_NODE_MEM_MAP=y
100# CONFIG_NUMA is not set
89# CONFIG_SCHED_SMT is not set 101# CONFIG_SCHED_SMT is not set
102CONFIG_PREEMPT_NONE=y
103# CONFIG_PREEMPT_VOLUNTARY is not set
90# CONFIG_PREEMPT is not set 104# CONFIG_PREEMPT is not set
105# CONFIG_PREEMPT_BKL is not set
106# CONFIG_HZ_100 is not set
107CONFIG_HZ_250=y
108# CONFIG_HZ_1000 is not set
109CONFIG_HZ=250
91CONFIG_GENERIC_HARDIRQS=y 110CONFIG_GENERIC_HARDIRQS=y
92CONFIG_SECCOMP=y 111CONFIG_SECCOMP=y
93CONFIG_ISA_DMA_API=y 112CONFIG_ISA_DMA_API=y
@@ -116,6 +135,69 @@ CONFIG_PROC_DEVICETREE=y
116# CONFIG_CMDLINE_BOOL is not set 135# CONFIG_CMDLINE_BOOL is not set
117 136
118# 137#
138# Networking
139#
140CONFIG_NET=y
141
142#
143# Networking options
144#
145CONFIG_PACKET=y
146CONFIG_PACKET_MMAP=y
147CONFIG_UNIX=y
148# CONFIG_NET_KEY is not set
149CONFIG_INET=y
150CONFIG_IP_MULTICAST=y
151# CONFIG_IP_ADVANCED_ROUTER is not set
152CONFIG_IP_FIB_HASH=y
153CONFIG_IP_PNP=y
154CONFIG_IP_PNP_DHCP=y
155# CONFIG_IP_PNP_BOOTP is not set
156# CONFIG_IP_PNP_RARP is not set
157# CONFIG_NET_IPIP is not set
158# CONFIG_NET_IPGRE is not set
159# CONFIG_IP_MROUTE is not set
160# CONFIG_ARPD is not set
161# CONFIG_SYN_COOKIES is not set
162# CONFIG_INET_AH is not set
163# CONFIG_INET_ESP is not set
164# CONFIG_INET_IPCOMP is not set
165# CONFIG_INET_TUNNEL is not set
166CONFIG_IP_TCPDIAG=y
167# CONFIG_IP_TCPDIAG_IPV6 is not set
168# CONFIG_TCP_CONG_ADVANCED is not set
169CONFIG_TCP_CONG_BIC=y
170# CONFIG_IPV6 is not set
171# CONFIG_NETFILTER is not set
172
173#
174# SCTP Configuration (EXPERIMENTAL)
175#
176# CONFIG_IP_SCTP is not set
177# CONFIG_ATM is not set
178# CONFIG_BRIDGE is not set
179# CONFIG_VLAN_8021Q is not set
180# CONFIG_DECNET is not set
181# CONFIG_LLC2 is not set
182# CONFIG_IPX is not set
183# CONFIG_ATALK is not set
184# CONFIG_X25 is not set
185# CONFIG_LAPB is not set
186# CONFIG_NET_DIVERT is not set
187# CONFIG_ECONET is not set
188# CONFIG_WAN_ROUTER is not set
189# CONFIG_NET_SCHED is not set
190# CONFIG_NET_CLS_ROUTE is not set
191
192#
193# Network testing
194#
195# CONFIG_NET_PKTGEN is not set
196# CONFIG_HAMRADIO is not set
197# CONFIG_IRDA is not set
198# CONFIG_BT is not set
199
200#
119# Device Drivers 201# Device Drivers
120# 202#
121 203
@@ -213,6 +295,7 @@ CONFIG_BLK_DEV_AMD74XX=y
213# CONFIG_BLK_DEV_HPT366 is not set 295# CONFIG_BLK_DEV_HPT366 is not set
214# CONFIG_BLK_DEV_SC1200 is not set 296# CONFIG_BLK_DEV_SC1200 is not set
215# CONFIG_BLK_DEV_PIIX is not set 297# CONFIG_BLK_DEV_PIIX is not set
298# CONFIG_BLK_DEV_IT821X is not set
216# CONFIG_BLK_DEV_NS87415 is not set 299# CONFIG_BLK_DEV_NS87415 is not set
217# CONFIG_BLK_DEV_PDC202XX_OLD is not set 300# CONFIG_BLK_DEV_PDC202XX_OLD is not set
218# CONFIG_BLK_DEV_PDC202XX_NEW is not set 301# CONFIG_BLK_DEV_PDC202XX_NEW is not set
@@ -240,6 +323,7 @@ CONFIG_IDEDMA_AUTO=y
240# 323#
241# Fusion MPT device support 324# Fusion MPT device support
242# 325#
326# CONFIG_FUSION is not set
243 327
244# 328#
245# IEEE 1394 (FireWire) support 329# IEEE 1394 (FireWire) support
@@ -256,70 +340,8 @@ CONFIG_IDEDMA_AUTO=y
256# 340#
257 341
258# 342#
259# Networking support 343# Network device support
260#
261CONFIG_NET=y
262
263#
264# Networking options
265# 344#
266CONFIG_PACKET=y
267CONFIG_PACKET_MMAP=y
268CONFIG_UNIX=y
269# CONFIG_NET_KEY is not set
270CONFIG_INET=y
271CONFIG_IP_MULTICAST=y
272# CONFIG_IP_ADVANCED_ROUTER is not set
273CONFIG_IP_PNP=y
274CONFIG_IP_PNP_DHCP=y
275# CONFIG_IP_PNP_BOOTP is not set
276# CONFIG_IP_PNP_RARP is not set
277# CONFIG_NET_IPIP is not set
278# CONFIG_NET_IPGRE is not set
279# CONFIG_IP_MROUTE is not set
280# CONFIG_ARPD is not set
281# CONFIG_SYN_COOKIES is not set
282# CONFIG_INET_AH is not set
283# CONFIG_INET_ESP is not set
284# CONFIG_INET_IPCOMP is not set
285# CONFIG_INET_TUNNEL is not set
286CONFIG_IP_TCPDIAG=y
287# CONFIG_IP_TCPDIAG_IPV6 is not set
288# CONFIG_IPV6 is not set
289# CONFIG_NETFILTER is not set
290
291#
292# SCTP Configuration (EXPERIMENTAL)
293#
294# CONFIG_IP_SCTP is not set
295# CONFIG_ATM is not set
296# CONFIG_BRIDGE is not set
297# CONFIG_VLAN_8021Q is not set
298# CONFIG_DECNET is not set
299# CONFIG_LLC2 is not set
300# CONFIG_IPX is not set
301# CONFIG_ATALK is not set
302# CONFIG_X25 is not set
303# CONFIG_LAPB is not set
304# CONFIG_NET_DIVERT is not set
305# CONFIG_ECONET is not set
306# CONFIG_WAN_ROUTER is not set
307
308#
309# QoS and/or fair queueing
310#
311# CONFIG_NET_SCHED is not set
312# CONFIG_NET_CLS_ROUTE is not set
313
314#
315# Network testing
316#
317# CONFIG_NET_PKTGEN is not set
318# CONFIG_NETPOLL is not set
319# CONFIG_NET_POLL_CONTROLLER is not set
320# CONFIG_HAMRADIO is not set
321# CONFIG_IRDA is not set
322# CONFIG_BT is not set
323CONFIG_NETDEVICES=y 345CONFIG_NETDEVICES=y
324# CONFIG_DUMMY is not set 346# CONFIG_DUMMY is not set
325# CONFIG_BONDING is not set 347# CONFIG_BONDING is not set
@@ -376,6 +398,7 @@ CONFIG_E1000=y
376# CONFIG_HAMACHI is not set 398# CONFIG_HAMACHI is not set
377# CONFIG_YELLOWFIN is not set 399# CONFIG_YELLOWFIN is not set
378# CONFIG_R8169 is not set 400# CONFIG_R8169 is not set
401# CONFIG_SKGE is not set
379# CONFIG_SK98LIN is not set 402# CONFIG_SK98LIN is not set
380# CONFIG_VIA_VELOCITY is not set 403# CONFIG_VIA_VELOCITY is not set
381# CONFIG_TIGON3 is not set 404# CONFIG_TIGON3 is not set
@@ -408,6 +431,8 @@ CONFIG_E1000=y
408# CONFIG_SLIP is not set 431# CONFIG_SLIP is not set
409# CONFIG_SHAPER is not set 432# CONFIG_SHAPER is not set
410# CONFIG_NETCONSOLE is not set 433# CONFIG_NETCONSOLE is not set
434# CONFIG_NETPOLL is not set
435# CONFIG_NET_POLL_CONTROLLER is not set
411 436
412# 437#
413# ISDN subsystem 438# ISDN subsystem
@@ -487,7 +512,6 @@ CONFIG_LEGACY_PTY_COUNT=256
487# 512#
488# CONFIG_WATCHDOG is not set 513# CONFIG_WATCHDOG is not set
489# CONFIG_RTC is not set 514# CONFIG_RTC is not set
490# CONFIG_GEN_RTC is not set
491# CONFIG_DTLK is not set 515# CONFIG_DTLK is not set
492# CONFIG_R3964 is not set 516# CONFIG_R3964 is not set
493# CONFIG_APPLICOM is not set 517# CONFIG_APPLICOM is not set
@@ -543,50 +567,19 @@ CONFIG_I2C_AMD8111=y
543# CONFIG_I2C_VIAPRO is not set 567# CONFIG_I2C_VIAPRO is not set
544# CONFIG_I2C_VOODOO3 is not set 568# CONFIG_I2C_VOODOO3 is not set
545# CONFIG_I2C_PCA_ISA is not set 569# CONFIG_I2C_PCA_ISA is not set
570# CONFIG_I2C_SENSOR is not set
546 571
547# 572#
548# Hardware Sensors Chip support 573# Miscellaneous I2C Chip support
549#
550# CONFIG_I2C_SENSOR is not set
551# CONFIG_SENSORS_ADM1021 is not set
552# CONFIG_SENSORS_ADM1025 is not set
553# CONFIG_SENSORS_ADM1026 is not set
554# CONFIG_SENSORS_ADM1031 is not set
555# CONFIG_SENSORS_ASB100 is not set
556# CONFIG_SENSORS_DS1621 is not set
557# CONFIG_SENSORS_FSCHER is not set
558# CONFIG_SENSORS_FSCPOS is not set
559# CONFIG_SENSORS_GL518SM is not set
560# CONFIG_SENSORS_GL520SM is not set
561# CONFIG_SENSORS_IT87 is not set
562# CONFIG_SENSORS_LM63 is not set
563# CONFIG_SENSORS_LM75 is not set
564# CONFIG_SENSORS_LM77 is not set
565# CONFIG_SENSORS_LM78 is not set
566# CONFIG_SENSORS_LM80 is not set
567# CONFIG_SENSORS_LM83 is not set
568# CONFIG_SENSORS_LM85 is not set
569# CONFIG_SENSORS_LM87 is not set
570# CONFIG_SENSORS_LM90 is not set
571# CONFIG_SENSORS_LM92 is not set
572# CONFIG_SENSORS_MAX1619 is not set
573# CONFIG_SENSORS_PC87360 is not set
574# CONFIG_SENSORS_SMSC47B397 is not set
575# CONFIG_SENSORS_SIS5595 is not set
576# CONFIG_SENSORS_SMSC47M1 is not set
577# CONFIG_SENSORS_VIA686A is not set
578# CONFIG_SENSORS_W83781D is not set
579# CONFIG_SENSORS_W83L785TS is not set
580# CONFIG_SENSORS_W83627HF is not set
581
582#
583# Other I2C Chip support
584# 574#
585# CONFIG_SENSORS_DS1337 is not set 575# CONFIG_SENSORS_DS1337 is not set
576# CONFIG_SENSORS_DS1374 is not set
586# CONFIG_SENSORS_EEPROM is not set 577# CONFIG_SENSORS_EEPROM is not set
587# CONFIG_SENSORS_PCF8574 is not set 578# CONFIG_SENSORS_PCF8574 is not set
579# CONFIG_SENSORS_PCA9539 is not set
588# CONFIG_SENSORS_PCF8591 is not set 580# CONFIG_SENSORS_PCF8591 is not set
589# CONFIG_SENSORS_RTC8564 is not set 581# CONFIG_SENSORS_RTC8564 is not set
582# CONFIG_SENSORS_MAX6875 is not set
590# CONFIG_I2C_DEBUG_CORE is not set 583# CONFIG_I2C_DEBUG_CORE is not set
591# CONFIG_I2C_DEBUG_ALGO is not set 584# CONFIG_I2C_DEBUG_ALGO is not set
592# CONFIG_I2C_DEBUG_BUS is not set 585# CONFIG_I2C_DEBUG_BUS is not set
@@ -598,6 +591,11 @@ CONFIG_I2C_AMD8111=y
598# CONFIG_W1 is not set 591# CONFIG_W1 is not set
599 592
600# 593#
594# Hardware Monitoring support
595#
596# CONFIG_HWMON is not set
597
598#
601# Misc devices 599# Misc devices
602# 600#
603 601
@@ -649,6 +647,7 @@ CONFIG_USB_DEVICEFS=y
649CONFIG_USB_EHCI_HCD=y 647CONFIG_USB_EHCI_HCD=y
650CONFIG_USB_EHCI_SPLIT_ISO=y 648CONFIG_USB_EHCI_SPLIT_ISO=y
651CONFIG_USB_EHCI_ROOT_HUB_TT=y 649CONFIG_USB_EHCI_ROOT_HUB_TT=y
650# CONFIG_USB_ISP116X_HCD is not set
652CONFIG_USB_OHCI_HCD=y 651CONFIG_USB_OHCI_HCD=y
653# CONFIG_USB_OHCI_BIG_ENDIAN is not set 652# CONFIG_USB_OHCI_BIG_ENDIAN is not set
654CONFIG_USB_OHCI_LITTLE_ENDIAN=y 653CONFIG_USB_OHCI_LITTLE_ENDIAN=y
@@ -676,12 +675,15 @@ CONFIG_USB_HIDINPUT=y
676# CONFIG_USB_HIDDEV is not set 675# CONFIG_USB_HIDDEV is not set
677# CONFIG_USB_AIPTEK is not set 676# CONFIG_USB_AIPTEK is not set
678# CONFIG_USB_WACOM is not set 677# CONFIG_USB_WACOM is not set
678# CONFIG_USB_ACECAD is not set
679# CONFIG_USB_KBTAB is not set 679# CONFIG_USB_KBTAB is not set
680# CONFIG_USB_POWERMATE is not set 680# CONFIG_USB_POWERMATE is not set
681# CONFIG_USB_MTOUCH is not set 681# CONFIG_USB_MTOUCH is not set
682# CONFIG_USB_ITMTOUCH is not set
682# CONFIG_USB_EGALAX is not set 683# CONFIG_USB_EGALAX is not set
683# CONFIG_USB_XPAD is not set 684# CONFIG_USB_XPAD is not set
684# CONFIG_USB_ATI_REMOTE is not set 685# CONFIG_USB_ATI_REMOTE is not set
686# CONFIG_USB_KEYSPAN_REMOTE is not set
685 687
686# 688#
687# USB Imaging devices 689# USB Imaging devices
@@ -772,10 +774,11 @@ CONFIG_USB_EZUSB=y
772# CONFIG_USB_PHIDGETSERVO is not set 774# CONFIG_USB_PHIDGETSERVO is not set
773# CONFIG_USB_IDMOUSE is not set 775# CONFIG_USB_IDMOUSE is not set
774# CONFIG_USB_SISUSBVGA is not set 776# CONFIG_USB_SISUSBVGA is not set
777# CONFIG_USB_LD is not set
775# CONFIG_USB_TEST is not set 778# CONFIG_USB_TEST is not set
776 779
777# 780#
778# USB ATM/DSL drivers 781# USB DSL modem support
779# 782#
780 783
781# 784#
@@ -794,16 +797,23 @@ CONFIG_USB_EZUSB=y
794# CONFIG_INFINIBAND is not set 797# CONFIG_INFINIBAND is not set
795 798
796# 799#
800# SN Devices
801#
802
803#
797# File systems 804# File systems
798# 805#
799CONFIG_EXT2_FS=y 806CONFIG_EXT2_FS=y
800# CONFIG_EXT2_FS_XATTR is not set 807# CONFIG_EXT2_FS_XATTR is not set
808CONFIG_EXT2_FS_XIP=y
809CONFIG_FS_XIP=y
801CONFIG_EXT3_FS=y 810CONFIG_EXT3_FS=y
802# CONFIG_EXT3_FS_XATTR is not set 811# CONFIG_EXT3_FS_XATTR is not set
803CONFIG_JBD=y 812CONFIG_JBD=y
804# CONFIG_JBD_DEBUG is not set 813# CONFIG_JBD_DEBUG is not set
805# CONFIG_REISERFS_FS is not set 814# CONFIG_REISERFS_FS is not set
806# CONFIG_JFS_FS is not set 815# CONFIG_JFS_FS is not set
816CONFIG_FS_POSIX_ACL=y
807 817
808# 818#
809# XFS support 819# XFS support
@@ -811,6 +821,7 @@ CONFIG_JBD=y
811# CONFIG_XFS_FS is not set 821# CONFIG_XFS_FS is not set
812# CONFIG_MINIX_FS is not set 822# CONFIG_MINIX_FS is not set
813# CONFIG_ROMFS_FS is not set 823# CONFIG_ROMFS_FS is not set
824CONFIG_INOTIFY=y
814# CONFIG_QUOTA is not set 825# CONFIG_QUOTA is not set
815CONFIG_DNOTIFY=y 826CONFIG_DNOTIFY=y
816# CONFIG_AUTOFS_FS is not set 827# CONFIG_AUTOFS_FS is not set
@@ -838,7 +849,6 @@ CONFIG_FAT_DEFAULT_IOCHARSET="iso8859-1"
838CONFIG_PROC_FS=y 849CONFIG_PROC_FS=y
839CONFIG_PROC_KCORE=y 850CONFIG_PROC_KCORE=y
840CONFIG_SYSFS=y 851CONFIG_SYSFS=y
841# CONFIG_DEVFS_FS is not set
842CONFIG_DEVPTS_FS_XATTR=y 852CONFIG_DEVPTS_FS_XATTR=y
843# CONFIG_DEVPTS_FS_SECURITY is not set 853# CONFIG_DEVPTS_FS_SECURITY is not set
844CONFIG_TMPFS=y 854CONFIG_TMPFS=y
@@ -870,12 +880,15 @@ CONFIG_CRAMFS=y
870# 880#
871CONFIG_NFS_FS=y 881CONFIG_NFS_FS=y
872CONFIG_NFS_V3=y 882CONFIG_NFS_V3=y
883CONFIG_NFS_V3_ACL=y
873CONFIG_NFS_V4=y 884CONFIG_NFS_V4=y
874# CONFIG_NFS_DIRECTIO is not set 885# CONFIG_NFS_DIRECTIO is not set
875# CONFIG_NFSD is not set 886# CONFIG_NFSD is not set
876CONFIG_ROOT_NFS=y 887CONFIG_ROOT_NFS=y
877CONFIG_LOCKD=y 888CONFIG_LOCKD=y
878CONFIG_LOCKD_V4=y 889CONFIG_LOCKD_V4=y
890CONFIG_NFS_ACL_SUPPORT=y
891CONFIG_NFS_COMMON=y
879CONFIG_SUNRPC=y 892CONFIG_SUNRPC=y
880CONFIG_SUNRPC_GSS=y 893CONFIG_SUNRPC_GSS=y
881CONFIG_RPCSEC_GSS_KRB5=y 894CONFIG_RPCSEC_GSS_KRB5=y
diff --git a/arch/ppc64/configs/pSeries_defconfig b/arch/ppc64/configs/pSeries_defconfig
index d0db8b5966c0..29f7b80b0efc 100644
--- a/arch/ppc64/configs/pSeries_defconfig
+++ b/arch/ppc64/configs/pSeries_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.12-rc6 3# Linux kernel version: 2.6.13-rc6
4# Tue Jun 14 17:13:47 2005 4# Mon Aug 8 14:17:07 2005
5# 5#
6CONFIG_64BIT=y 6CONFIG_64BIT=y
7CONFIG_MMU=y 7CONFIG_MMU=y
@@ -74,13 +74,17 @@ CONFIG_SYSVIPC_COMPAT=y
74# CONFIG_PPC_ISERIES is not set 74# CONFIG_PPC_ISERIES is not set
75CONFIG_PPC_MULTIPLATFORM=y 75CONFIG_PPC_MULTIPLATFORM=y
76CONFIG_PPC_PSERIES=y 76CONFIG_PPC_PSERIES=y
77# CONFIG_PPC_BPA is not set
77# CONFIG_PPC_PMAC is not set 78# CONFIG_PPC_PMAC is not set
78# CONFIG_PPC_MAPLE is not set 79# CONFIG_PPC_MAPLE is not set
79CONFIG_PPC=y 80CONFIG_PPC=y
80CONFIG_PPC64=y 81CONFIG_PPC64=y
81CONFIG_PPC_OF=y 82CONFIG_PPC_OF=y
83CONFIG_XICS=y
84CONFIG_MPIC=y
82CONFIG_ALTIVEC=y 85CONFIG_ALTIVEC=y
83CONFIG_PPC_SPLPAR=y 86CONFIG_PPC_SPLPAR=y
87CONFIG_KEXEC=y
84CONFIG_IBMVIO=y 88CONFIG_IBMVIO=y
85# CONFIG_U3_DART is not set 89# CONFIG_U3_DART is not set
86# CONFIG_BOOTX_TEXT is not set 90# CONFIG_BOOTX_TEXT is not set
@@ -88,10 +92,30 @@ CONFIG_IBMVIO=y
88CONFIG_IOMMU_VMERGE=y 92CONFIG_IOMMU_VMERGE=y
89CONFIG_SMP=y 93CONFIG_SMP=y
90CONFIG_NR_CPUS=128 94CONFIG_NR_CPUS=128
95CONFIG_ARCH_SELECT_MEMORY_MODEL=y
96CONFIG_ARCH_FLATMEM_ENABLE=y
91CONFIG_ARCH_DISCONTIGMEM_ENABLE=y 97CONFIG_ARCH_DISCONTIGMEM_ENABLE=y
98CONFIG_ARCH_DISCONTIGMEM_DEFAULT=y
99CONFIG_ARCH_SPARSEMEM_ENABLE=y
100CONFIG_SELECT_MEMORY_MODEL=y
101# CONFIG_FLATMEM_MANUAL is not set
102CONFIG_DISCONTIGMEM_MANUAL=y
103# CONFIG_SPARSEMEM_MANUAL is not set
104CONFIG_DISCONTIGMEM=y
105CONFIG_FLAT_NODE_MEM_MAP=y
106CONFIG_NEED_MULTIPLE_NODES=y
107CONFIG_HAVE_ARCH_EARLY_PFN_TO_NID=y
108CONFIG_NODES_SPAN_OTHER_NODES=y
92CONFIG_NUMA=y 109CONFIG_NUMA=y
93CONFIG_SCHED_SMT=y 110CONFIG_SCHED_SMT=y
111CONFIG_PREEMPT_NONE=y
112# CONFIG_PREEMPT_VOLUNTARY is not set
94# CONFIG_PREEMPT is not set 113# CONFIG_PREEMPT is not set
114# CONFIG_PREEMPT_BKL is not set
115# CONFIG_HZ_100 is not set
116CONFIG_HZ_250=y
117# CONFIG_HZ_1000 is not set
118CONFIG_HZ=250
95CONFIG_EEH=y 119CONFIG_EEH=y
96CONFIG_GENERIC_HARDIRQS=y 120CONFIG_GENERIC_HARDIRQS=y
97CONFIG_PPC_RTAS=y 121CONFIG_PPC_RTAS=y
@@ -132,6 +156,142 @@ CONFIG_PROC_DEVICETREE=y
132# CONFIG_CMDLINE_BOOL is not set 156# CONFIG_CMDLINE_BOOL is not set
133 157
134# 158#
159# Networking
160#
161CONFIG_NET=y
162
163#
164# Networking options
165#
166CONFIG_PACKET=y
167# CONFIG_PACKET_MMAP is not set
168CONFIG_UNIX=y
169CONFIG_XFRM=y
170CONFIG_XFRM_USER=m
171CONFIG_NET_KEY=m
172CONFIG_INET=y
173CONFIG_IP_MULTICAST=y
174# CONFIG_IP_ADVANCED_ROUTER is not set
175CONFIG_IP_FIB_HASH=y
176# CONFIG_IP_PNP is not set
177CONFIG_NET_IPIP=y
178# CONFIG_NET_IPGRE is not set
179# CONFIG_IP_MROUTE is not set
180# CONFIG_ARPD is not set
181CONFIG_SYN_COOKIES=y
182CONFIG_INET_AH=m
183CONFIG_INET_ESP=m
184CONFIG_INET_IPCOMP=m
185CONFIG_INET_TUNNEL=y
186CONFIG_IP_TCPDIAG=m
187# CONFIG_IP_TCPDIAG_IPV6 is not set
188# CONFIG_TCP_CONG_ADVANCED is not set
189CONFIG_TCP_CONG_BIC=y
190
191#
192# IP: Virtual Server Configuration
193#
194# CONFIG_IP_VS is not set
195# CONFIG_IPV6 is not set
196CONFIG_NETFILTER=y
197# CONFIG_NETFILTER_DEBUG is not set
198
199#
200# IP: Netfilter Configuration
201#
202CONFIG_IP_NF_CONNTRACK=m
203CONFIG_IP_NF_CT_ACCT=y
204CONFIG_IP_NF_CONNTRACK_MARK=y
205CONFIG_IP_NF_CT_PROTO_SCTP=m
206CONFIG_IP_NF_FTP=m
207CONFIG_IP_NF_IRC=m
208CONFIG_IP_NF_TFTP=m
209CONFIG_IP_NF_AMANDA=m
210CONFIG_IP_NF_QUEUE=m
211CONFIG_IP_NF_IPTABLES=m
212CONFIG_IP_NF_MATCH_LIMIT=m
213CONFIG_IP_NF_MATCH_IPRANGE=m
214CONFIG_IP_NF_MATCH_MAC=m
215CONFIG_IP_NF_MATCH_PKTTYPE=m
216CONFIG_IP_NF_MATCH_MARK=m
217CONFIG_IP_NF_MATCH_MULTIPORT=m
218CONFIG_IP_NF_MATCH_TOS=m
219CONFIG_IP_NF_MATCH_RECENT=m
220CONFIG_IP_NF_MATCH_ECN=m
221CONFIG_IP_NF_MATCH_DSCP=m
222CONFIG_IP_NF_MATCH_AH_ESP=m
223CONFIG_IP_NF_MATCH_LENGTH=m
224CONFIG_IP_NF_MATCH_TTL=m
225CONFIG_IP_NF_MATCH_TCPMSS=m
226CONFIG_IP_NF_MATCH_HELPER=m
227CONFIG_IP_NF_MATCH_STATE=m
228CONFIG_IP_NF_MATCH_CONNTRACK=m
229CONFIG_IP_NF_MATCH_OWNER=m
230CONFIG_IP_NF_MATCH_ADDRTYPE=m
231CONFIG_IP_NF_MATCH_REALM=m
232CONFIG_IP_NF_MATCH_SCTP=m
233CONFIG_IP_NF_MATCH_COMMENT=m
234CONFIG_IP_NF_MATCH_CONNMARK=m
235CONFIG_IP_NF_MATCH_HASHLIMIT=m
236CONFIG_IP_NF_FILTER=m
237CONFIG_IP_NF_TARGET_REJECT=m
238CONFIG_IP_NF_TARGET_LOG=m
239CONFIG_IP_NF_TARGET_ULOG=m
240CONFIG_IP_NF_TARGET_TCPMSS=m
241CONFIG_IP_NF_NAT=m
242CONFIG_IP_NF_NAT_NEEDED=y
243CONFIG_IP_NF_TARGET_MASQUERADE=m
244CONFIG_IP_NF_TARGET_REDIRECT=m
245CONFIG_IP_NF_TARGET_NETMAP=m
246CONFIG_IP_NF_TARGET_SAME=m
247CONFIG_IP_NF_NAT_SNMP_BASIC=m
248CONFIG_IP_NF_NAT_IRC=m
249CONFIG_IP_NF_NAT_FTP=m
250CONFIG_IP_NF_NAT_TFTP=m
251CONFIG_IP_NF_NAT_AMANDA=m
252CONFIG_IP_NF_MANGLE=m
253CONFIG_IP_NF_TARGET_TOS=m
254CONFIG_IP_NF_TARGET_ECN=m
255CONFIG_IP_NF_TARGET_DSCP=m
256CONFIG_IP_NF_TARGET_MARK=m
257CONFIG_IP_NF_TARGET_CLASSIFY=m
258CONFIG_IP_NF_TARGET_CONNMARK=m
259CONFIG_IP_NF_TARGET_CLUSTERIP=m
260CONFIG_IP_NF_RAW=m
261CONFIG_IP_NF_TARGET_NOTRACK=m
262CONFIG_IP_NF_ARPTABLES=m
263CONFIG_IP_NF_ARPFILTER=m
264CONFIG_IP_NF_ARP_MANGLE=m
265
266#
267# SCTP Configuration (EXPERIMENTAL)
268#
269# CONFIG_IP_SCTP is not set
270# CONFIG_ATM is not set
271# CONFIG_BRIDGE is not set
272# CONFIG_VLAN_8021Q is not set
273# CONFIG_DECNET is not set
274CONFIG_LLC=y
275# CONFIG_LLC2 is not set
276# CONFIG_IPX is not set
277# CONFIG_ATALK is not set
278# CONFIG_X25 is not set
279# CONFIG_LAPB is not set
280# CONFIG_NET_DIVERT is not set
281# CONFIG_ECONET is not set
282# CONFIG_WAN_ROUTER is not set
283# CONFIG_NET_SCHED is not set
284CONFIG_NET_CLS_ROUTE=y
285
286#
287# Network testing
288#
289# CONFIG_NET_PKTGEN is not set
290# CONFIG_HAMRADIO is not set
291# CONFIG_IRDA is not set
292# CONFIG_BT is not set
293
294#
135# Device Drivers 295# Device Drivers
136# 296#
137 297
@@ -238,6 +398,7 @@ CONFIG_BLK_DEV_AMD74XX=y
238# CONFIG_BLK_DEV_HPT366 is not set 398# CONFIG_BLK_DEV_HPT366 is not set
239# CONFIG_BLK_DEV_SC1200 is not set 399# CONFIG_BLK_DEV_SC1200 is not set
240# CONFIG_BLK_DEV_PIIX is not set 400# CONFIG_BLK_DEV_PIIX is not set
401# CONFIG_BLK_DEV_IT821X is not set
241# CONFIG_BLK_DEV_NS87415 is not set 402# CONFIG_BLK_DEV_NS87415 is not set
242# CONFIG_BLK_DEV_PDC202XX_OLD is not set 403# CONFIG_BLK_DEV_PDC202XX_OLD is not set
243# CONFIG_BLK_DEV_PDC202XX_NEW is not set 404# CONFIG_BLK_DEV_PDC202XX_NEW is not set
@@ -267,6 +428,7 @@ CONFIG_CHR_DEV_ST=y
267CONFIG_BLK_DEV_SR=y 428CONFIG_BLK_DEV_SR=y
268CONFIG_BLK_DEV_SR_VENDOR=y 429CONFIG_BLK_DEV_SR_VENDOR=y
269CONFIG_CHR_DEV_SG=y 430CONFIG_CHR_DEV_SG=y
431# CONFIG_CHR_DEV_SCH is not set
270 432
271# 433#
272# Some SCSI devices (e.g. CD jukebox) support multiple LUNs 434# Some SCSI devices (e.g. CD jukebox) support multiple LUNs
@@ -322,6 +484,7 @@ CONFIG_SCSI_QLA22XX=m
322CONFIG_SCSI_QLA2300=m 484CONFIG_SCSI_QLA2300=m
323CONFIG_SCSI_QLA2322=m 485CONFIG_SCSI_QLA2322=m
324CONFIG_SCSI_QLA6312=m 486CONFIG_SCSI_QLA6312=m
487CONFIG_SCSI_QLA24XX=m
325CONFIG_SCSI_LPFC=m 488CONFIG_SCSI_LPFC=m
326# CONFIG_SCSI_DC395x is not set 489# CONFIG_SCSI_DC395x is not set
327# CONFIG_SCSI_DC390T is not set 490# CONFIG_SCSI_DC390T is not set
@@ -352,6 +515,8 @@ CONFIG_DM_MULTIPATH_EMC=m
352# Fusion MPT device support 515# Fusion MPT device support
353# 516#
354# CONFIG_FUSION is not set 517# CONFIG_FUSION is not set
518# CONFIG_FUSION_SPI is not set
519# CONFIG_FUSION_FC is not set
355 520
356# 521#
357# IEEE 1394 (FireWire) support 522# IEEE 1394 (FireWire) support
@@ -368,145 +533,8 @@ CONFIG_DM_MULTIPATH_EMC=m
368# 533#
369 534
370# 535#
371# Networking support 536# Network device support
372# 537#
373CONFIG_NET=y
374
375#
376# Networking options
377#
378CONFIG_PACKET=y
379# CONFIG_PACKET_MMAP is not set
380CONFIG_UNIX=y
381CONFIG_NET_KEY=m
382CONFIG_INET=y
383CONFIG_IP_MULTICAST=y
384# CONFIG_IP_ADVANCED_ROUTER is not set
385# CONFIG_IP_PNP is not set
386CONFIG_NET_IPIP=y
387# CONFIG_NET_IPGRE is not set
388# CONFIG_IP_MROUTE is not set
389# CONFIG_ARPD is not set
390CONFIG_SYN_COOKIES=y
391CONFIG_INET_AH=m
392CONFIG_INET_ESP=m
393CONFIG_INET_IPCOMP=m
394CONFIG_INET_TUNNEL=y
395CONFIG_IP_TCPDIAG=m
396# CONFIG_IP_TCPDIAG_IPV6 is not set
397
398#
399# IP: Virtual Server Configuration
400#
401# CONFIG_IP_VS is not set
402# CONFIG_IPV6 is not set
403CONFIG_NETFILTER=y
404# CONFIG_NETFILTER_DEBUG is not set
405
406#
407# IP: Netfilter Configuration
408#
409CONFIG_IP_NF_CONNTRACK=m
410CONFIG_IP_NF_CT_ACCT=y
411CONFIG_IP_NF_CONNTRACK_MARK=y
412CONFIG_IP_NF_CT_PROTO_SCTP=m
413CONFIG_IP_NF_FTP=m
414CONFIG_IP_NF_IRC=m
415CONFIG_IP_NF_TFTP=m
416CONFIG_IP_NF_AMANDA=m
417CONFIG_IP_NF_QUEUE=m
418CONFIG_IP_NF_IPTABLES=m
419CONFIG_IP_NF_MATCH_LIMIT=m
420CONFIG_IP_NF_MATCH_IPRANGE=m
421CONFIG_IP_NF_MATCH_MAC=m
422CONFIG_IP_NF_MATCH_PKTTYPE=m
423CONFIG_IP_NF_MATCH_MARK=m
424CONFIG_IP_NF_MATCH_MULTIPORT=m
425CONFIG_IP_NF_MATCH_TOS=m
426CONFIG_IP_NF_MATCH_RECENT=m
427CONFIG_IP_NF_MATCH_ECN=m
428CONFIG_IP_NF_MATCH_DSCP=m
429CONFIG_IP_NF_MATCH_AH_ESP=m
430CONFIG_IP_NF_MATCH_LENGTH=m
431CONFIG_IP_NF_MATCH_TTL=m
432CONFIG_IP_NF_MATCH_TCPMSS=m
433CONFIG_IP_NF_MATCH_HELPER=m
434CONFIG_IP_NF_MATCH_STATE=m
435CONFIG_IP_NF_MATCH_CONNTRACK=m
436CONFIG_IP_NF_MATCH_OWNER=m
437CONFIG_IP_NF_MATCH_ADDRTYPE=m
438CONFIG_IP_NF_MATCH_REALM=m
439CONFIG_IP_NF_MATCH_SCTP=m
440CONFIG_IP_NF_MATCH_COMMENT=m
441CONFIG_IP_NF_MATCH_CONNMARK=m
442CONFIG_IP_NF_MATCH_HASHLIMIT=m
443CONFIG_IP_NF_FILTER=m
444CONFIG_IP_NF_TARGET_REJECT=m
445CONFIG_IP_NF_TARGET_LOG=m
446CONFIG_IP_NF_TARGET_ULOG=m
447CONFIG_IP_NF_TARGET_TCPMSS=m
448CONFIG_IP_NF_NAT=m
449CONFIG_IP_NF_NAT_NEEDED=y
450CONFIG_IP_NF_TARGET_MASQUERADE=m
451CONFIG_IP_NF_TARGET_REDIRECT=m
452CONFIG_IP_NF_TARGET_NETMAP=m
453CONFIG_IP_NF_TARGET_SAME=m
454CONFIG_IP_NF_NAT_SNMP_BASIC=m
455CONFIG_IP_NF_NAT_IRC=m
456CONFIG_IP_NF_NAT_FTP=m
457CONFIG_IP_NF_NAT_TFTP=m
458CONFIG_IP_NF_NAT_AMANDA=m
459CONFIG_IP_NF_MANGLE=m
460CONFIG_IP_NF_TARGET_TOS=m
461CONFIG_IP_NF_TARGET_ECN=m
462CONFIG_IP_NF_TARGET_DSCP=m
463CONFIG_IP_NF_TARGET_MARK=m
464CONFIG_IP_NF_TARGET_CLASSIFY=m
465CONFIG_IP_NF_TARGET_CONNMARK=m
466CONFIG_IP_NF_TARGET_CLUSTERIP=m
467CONFIG_IP_NF_RAW=m
468CONFIG_IP_NF_TARGET_NOTRACK=m
469CONFIG_IP_NF_ARPTABLES=m
470CONFIG_IP_NF_ARPFILTER=m
471CONFIG_IP_NF_ARP_MANGLE=m
472CONFIG_XFRM=y
473CONFIG_XFRM_USER=m
474
475#
476# SCTP Configuration (EXPERIMENTAL)
477#
478# CONFIG_IP_SCTP is not set
479# CONFIG_ATM is not set
480# CONFIG_BRIDGE is not set
481# CONFIG_VLAN_8021Q is not set
482# CONFIG_DECNET is not set
483CONFIG_LLC=y
484# CONFIG_LLC2 is not set
485# CONFIG_IPX is not set
486# CONFIG_ATALK is not set
487# CONFIG_X25 is not set
488# CONFIG_LAPB is not set
489# CONFIG_NET_DIVERT is not set
490# CONFIG_ECONET is not set
491# CONFIG_WAN_ROUTER is not set
492
493#
494# QoS and/or fair queueing
495#
496# CONFIG_NET_SCHED is not set
497CONFIG_NET_CLS_ROUTE=y
498
499#
500# Network testing
501#
502# CONFIG_NET_PKTGEN is not set
503CONFIG_NETPOLL=y
504CONFIG_NETPOLL_RX=y
505CONFIG_NETPOLL_TRAP=y
506CONFIG_NET_POLL_CONTROLLER=y
507# CONFIG_HAMRADIO is not set
508# CONFIG_IRDA is not set
509# CONFIG_BT is not set
510CONFIG_NETDEVICES=y 538CONFIG_NETDEVICES=y
511CONFIG_DUMMY=m 539CONFIG_DUMMY=m
512CONFIG_BONDING=m 540CONFIG_BONDING=m
@@ -566,6 +594,7 @@ CONFIG_E1000=y
566# CONFIG_HAMACHI is not set 594# CONFIG_HAMACHI is not set
567# CONFIG_YELLOWFIN is not set 595# CONFIG_YELLOWFIN is not set
568# CONFIG_R8169 is not set 596# CONFIG_R8169 is not set
597# CONFIG_SKGE is not set
569# CONFIG_SK98LIN is not set 598# CONFIG_SK98LIN is not set
570# CONFIG_VIA_VELOCITY is not set 599# CONFIG_VIA_VELOCITY is not set
571CONFIG_TIGON3=y 600CONFIG_TIGON3=y
@@ -613,6 +642,10 @@ CONFIG_PPPOE=m
613# CONFIG_NET_FC is not set 642# CONFIG_NET_FC is not set
614# CONFIG_SHAPER is not set 643# CONFIG_SHAPER is not set
615CONFIG_NETCONSOLE=y 644CONFIG_NETCONSOLE=y
645CONFIG_NETPOLL=y
646CONFIG_NETPOLL_RX=y
647CONFIG_NETPOLL_TRAP=y
648CONFIG_NET_POLL_CONTROLLER=y
616 649
617# 650#
618# ISDN subsystem 651# ISDN subsystem
@@ -714,7 +747,6 @@ CONFIG_HVCS=m
714# 747#
715# CONFIG_WATCHDOG is not set 748# CONFIG_WATCHDOG is not set
716# CONFIG_RTC is not set 749# CONFIG_RTC is not set
717# CONFIG_GEN_RTC is not set
718# CONFIG_DTLK is not set 750# CONFIG_DTLK is not set
719# CONFIG_R3964 is not set 751# CONFIG_R3964 is not set
720# CONFIG_APPLICOM is not set 752# CONFIG_APPLICOM is not set
@@ -772,50 +804,19 @@ CONFIG_I2C_ALGOBIT=y
772# CONFIG_I2C_VIAPRO is not set 804# CONFIG_I2C_VIAPRO is not set
773# CONFIG_I2C_VOODOO3 is not set 805# CONFIG_I2C_VOODOO3 is not set
774# CONFIG_I2C_PCA_ISA is not set 806# CONFIG_I2C_PCA_ISA is not set
807# CONFIG_I2C_SENSOR is not set
775 808
776# 809#
777# Hardware Sensors Chip support 810# Miscellaneous I2C Chip support
778#
779# CONFIG_I2C_SENSOR is not set
780# CONFIG_SENSORS_ADM1021 is not set
781# CONFIG_SENSORS_ADM1025 is not set
782# CONFIG_SENSORS_ADM1026 is not set
783# CONFIG_SENSORS_ADM1031 is not set
784# CONFIG_SENSORS_ASB100 is not set
785# CONFIG_SENSORS_DS1621 is not set
786# CONFIG_SENSORS_FSCHER is not set
787# CONFIG_SENSORS_FSCPOS is not set
788# CONFIG_SENSORS_GL518SM is not set
789# CONFIG_SENSORS_GL520SM is not set
790# CONFIG_SENSORS_IT87 is not set
791# CONFIG_SENSORS_LM63 is not set
792# CONFIG_SENSORS_LM75 is not set
793# CONFIG_SENSORS_LM77 is not set
794# CONFIG_SENSORS_LM78 is not set
795# CONFIG_SENSORS_LM80 is not set
796# CONFIG_SENSORS_LM83 is not set
797# CONFIG_SENSORS_LM85 is not set
798# CONFIG_SENSORS_LM87 is not set
799# CONFIG_SENSORS_LM90 is not set
800# CONFIG_SENSORS_LM92 is not set
801# CONFIG_SENSORS_MAX1619 is not set
802# CONFIG_SENSORS_PC87360 is not set
803# CONFIG_SENSORS_SMSC47B397 is not set
804# CONFIG_SENSORS_SIS5595 is not set
805# CONFIG_SENSORS_SMSC47M1 is not set
806# CONFIG_SENSORS_VIA686A is not set
807# CONFIG_SENSORS_W83781D is not set
808# CONFIG_SENSORS_W83L785TS is not set
809# CONFIG_SENSORS_W83627HF is not set
810
811#
812# Other I2C Chip support
813# 811#
814# CONFIG_SENSORS_DS1337 is not set 812# CONFIG_SENSORS_DS1337 is not set
813# CONFIG_SENSORS_DS1374 is not set
815# CONFIG_SENSORS_EEPROM is not set 814# CONFIG_SENSORS_EEPROM is not set
816# CONFIG_SENSORS_PCF8574 is not set 815# CONFIG_SENSORS_PCF8574 is not set
816# CONFIG_SENSORS_PCA9539 is not set
817# CONFIG_SENSORS_PCF8591 is not set 817# CONFIG_SENSORS_PCF8591 is not set
818# CONFIG_SENSORS_RTC8564 is not set 818# CONFIG_SENSORS_RTC8564 is not set
819# CONFIG_SENSORS_MAX6875 is not set
819# CONFIG_I2C_DEBUG_CORE is not set 820# CONFIG_I2C_DEBUG_CORE is not set
820# CONFIG_I2C_DEBUG_ALGO is not set 821# CONFIG_I2C_DEBUG_ALGO is not set
821# CONFIG_I2C_DEBUG_BUS is not set 822# CONFIG_I2C_DEBUG_BUS is not set
@@ -827,6 +828,11 @@ CONFIG_I2C_ALGOBIT=y
827# CONFIG_W1 is not set 828# CONFIG_W1 is not set
828 829
829# 830#
831# Hardware Monitoring support
832#
833# CONFIG_HWMON is not set
834
835#
830# Misc devices 836# Misc devices
831# 837#
832 838
@@ -933,6 +939,7 @@ CONFIG_USB_DEVICEFS=y
933CONFIG_USB_EHCI_HCD=y 939CONFIG_USB_EHCI_HCD=y
934# CONFIG_USB_EHCI_SPLIT_ISO is not set 940# CONFIG_USB_EHCI_SPLIT_ISO is not set
935# CONFIG_USB_EHCI_ROOT_HUB_TT is not set 941# CONFIG_USB_EHCI_ROOT_HUB_TT is not set
942# CONFIG_USB_ISP116X_HCD is not set
936CONFIG_USB_OHCI_HCD=y 943CONFIG_USB_OHCI_HCD=y
937# CONFIG_USB_OHCI_BIG_ENDIAN is not set 944# CONFIG_USB_OHCI_BIG_ENDIAN is not set
938CONFIG_USB_OHCI_LITTLE_ENDIAN=y 945CONFIG_USB_OHCI_LITTLE_ENDIAN=y
@@ -969,12 +976,15 @@ CONFIG_USB_HIDINPUT=y
969CONFIG_USB_HIDDEV=y 976CONFIG_USB_HIDDEV=y
970# CONFIG_USB_AIPTEK is not set 977# CONFIG_USB_AIPTEK is not set
971# CONFIG_USB_WACOM is not set 978# CONFIG_USB_WACOM is not set
979# CONFIG_USB_ACECAD is not set
972# CONFIG_USB_KBTAB is not set 980# CONFIG_USB_KBTAB is not set
973# CONFIG_USB_POWERMATE is not set 981# CONFIG_USB_POWERMATE is not set
974# CONFIG_USB_MTOUCH is not set 982# CONFIG_USB_MTOUCH is not set
983# CONFIG_USB_ITMTOUCH is not set
975# CONFIG_USB_EGALAX is not set 984# CONFIG_USB_EGALAX is not set
976# CONFIG_USB_XPAD is not set 985# CONFIG_USB_XPAD is not set
977# CONFIG_USB_ATI_REMOTE is not set 986# CONFIG_USB_ATI_REMOTE is not set
987# CONFIG_USB_KEYSPAN_REMOTE is not set
978 988
979# 989#
980# USB Imaging devices 990# USB Imaging devices
@@ -1026,10 +1036,11 @@ CONFIG_USB_MON=y
1026# CONFIG_USB_PHIDGETSERVO is not set 1036# CONFIG_USB_PHIDGETSERVO is not set
1027# CONFIG_USB_IDMOUSE is not set 1037# CONFIG_USB_IDMOUSE is not set
1028# CONFIG_USB_SISUSBVGA is not set 1038# CONFIG_USB_SISUSBVGA is not set
1039# CONFIG_USB_LD is not set
1029# CONFIG_USB_TEST is not set 1040# CONFIG_USB_TEST is not set
1030 1041
1031# 1042#
1032# USB ATM/DSL drivers 1043# USB DSL modem support
1033# 1044#
1034 1045
1035# 1046#
@@ -1046,18 +1057,25 @@ CONFIG_USB_MON=y
1046# InfiniBand support 1057# InfiniBand support
1047# 1058#
1048CONFIG_INFINIBAND=m 1059CONFIG_INFINIBAND=m
1060CONFIG_INFINIBAND_USER_VERBS=m
1049CONFIG_INFINIBAND_MTHCA=m 1061CONFIG_INFINIBAND_MTHCA=m
1050# CONFIG_INFINIBAND_MTHCA_DEBUG is not set 1062# CONFIG_INFINIBAND_MTHCA_DEBUG is not set
1051CONFIG_INFINIBAND_IPOIB=m 1063CONFIG_INFINIBAND_IPOIB=m
1052# CONFIG_INFINIBAND_IPOIB_DEBUG is not set 1064# CONFIG_INFINIBAND_IPOIB_DEBUG is not set
1053 1065
1054# 1066#
1067# SN Devices
1068#
1069
1070#
1055# File systems 1071# File systems
1056# 1072#
1057CONFIG_EXT2_FS=y 1073CONFIG_EXT2_FS=y
1058CONFIG_EXT2_FS_XATTR=y 1074CONFIG_EXT2_FS_XATTR=y
1059CONFIG_EXT2_FS_POSIX_ACL=y 1075CONFIG_EXT2_FS_POSIX_ACL=y
1060CONFIG_EXT2_FS_SECURITY=y 1076CONFIG_EXT2_FS_SECURITY=y
1077CONFIG_EXT2_FS_XIP=y
1078CONFIG_FS_XIP=y
1061CONFIG_EXT3_FS=y 1079CONFIG_EXT3_FS=y
1062CONFIG_EXT3_FS_XATTR=y 1080CONFIG_EXT3_FS_XATTR=y
1063CONFIG_EXT3_FS_POSIX_ACL=y 1081CONFIG_EXT3_FS_POSIX_ACL=y
@@ -1089,6 +1107,7 @@ CONFIG_XFS_SECURITY=y
1089CONFIG_XFS_POSIX_ACL=y 1107CONFIG_XFS_POSIX_ACL=y
1090# CONFIG_MINIX_FS is not set 1108# CONFIG_MINIX_FS is not set
1091# CONFIG_ROMFS_FS is not set 1109# CONFIG_ROMFS_FS is not set
1110CONFIG_INOTIFY=y
1092# CONFIG_QUOTA is not set 1111# CONFIG_QUOTA is not set
1093CONFIG_DNOTIFY=y 1112CONFIG_DNOTIFY=y
1094CONFIG_AUTOFS_FS=m 1113CONFIG_AUTOFS_FS=m
@@ -1120,7 +1139,6 @@ CONFIG_FAT_DEFAULT_IOCHARSET="iso8859-1"
1120CONFIG_PROC_FS=y 1139CONFIG_PROC_FS=y
1121CONFIG_PROC_KCORE=y 1140CONFIG_PROC_KCORE=y
1122CONFIG_SYSFS=y 1141CONFIG_SYSFS=y
1123# CONFIG_DEVFS_FS is not set
1124CONFIG_DEVPTS_FS_XATTR=y 1142CONFIG_DEVPTS_FS_XATTR=y
1125CONFIG_DEVPTS_FS_SECURITY=y 1143CONFIG_DEVPTS_FS_SECURITY=y
1126CONFIG_TMPFS=y 1144CONFIG_TMPFS=y
@@ -1152,15 +1170,20 @@ CONFIG_CRAMFS=y
1152# 1170#
1153CONFIG_NFS_FS=y 1171CONFIG_NFS_FS=y
1154CONFIG_NFS_V3=y 1172CONFIG_NFS_V3=y
1173CONFIG_NFS_V3_ACL=y
1155CONFIG_NFS_V4=y 1174CONFIG_NFS_V4=y
1156# CONFIG_NFS_DIRECTIO is not set 1175# CONFIG_NFS_DIRECTIO is not set
1157CONFIG_NFSD=y 1176CONFIG_NFSD=y
1177CONFIG_NFSD_V2_ACL=y
1158CONFIG_NFSD_V3=y 1178CONFIG_NFSD_V3=y
1179CONFIG_NFSD_V3_ACL=y
1159CONFIG_NFSD_V4=y 1180CONFIG_NFSD_V4=y
1160CONFIG_NFSD_TCP=y 1181CONFIG_NFSD_TCP=y
1161CONFIG_LOCKD=y 1182CONFIG_LOCKD=y
1162CONFIG_LOCKD_V4=y 1183CONFIG_LOCKD_V4=y
1163CONFIG_EXPORTFS=y 1184CONFIG_EXPORTFS=y
1185CONFIG_NFS_ACL_SUPPORT=y
1186CONFIG_NFS_COMMON=y
1164CONFIG_SUNRPC=y 1187CONFIG_SUNRPC=y
1165CONFIG_SUNRPC_GSS=y 1188CONFIG_SUNRPC_GSS=y
1166CONFIG_RPCSEC_GSS_KRB5=y 1189CONFIG_RPCSEC_GSS_KRB5=y
diff --git a/arch/ppc64/defconfig b/arch/ppc64/defconfig
index b8e2066dde77..7cb4750bb7a9 100644
--- a/arch/ppc64/defconfig
+++ b/arch/ppc64/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.12-rc5-git9 3# Linux kernel version: 2.6.13-rc6
4# Sun Jun 5 09:26:47 2005 4# Mon Aug 8 14:16:54 2005
5# 5#
6CONFIG_64BIT=y 6CONFIG_64BIT=y
7CONFIG_MMU=y 7CONFIG_MMU=y
@@ -73,13 +73,18 @@ CONFIG_SYSVIPC_COMPAT=y
73# CONFIG_PPC_ISERIES is not set 73# CONFIG_PPC_ISERIES is not set
74CONFIG_PPC_MULTIPLATFORM=y 74CONFIG_PPC_MULTIPLATFORM=y
75CONFIG_PPC_PSERIES=y 75CONFIG_PPC_PSERIES=y
76CONFIG_PPC_BPA=y
76CONFIG_PPC_PMAC=y 77CONFIG_PPC_PMAC=y
77CONFIG_PPC_MAPLE=y 78CONFIG_PPC_MAPLE=y
78CONFIG_PPC=y 79CONFIG_PPC=y
79CONFIG_PPC64=y 80CONFIG_PPC64=y
80CONFIG_PPC_OF=y 81CONFIG_PPC_OF=y
82CONFIG_XICS=y
83CONFIG_MPIC=y
84CONFIG_BPA_IIC=y
81CONFIG_ALTIVEC=y 85CONFIG_ALTIVEC=y
82CONFIG_PPC_SPLPAR=y 86CONFIG_PPC_SPLPAR=y
87CONFIG_KEXEC=y
83CONFIG_IBMVIO=y 88CONFIG_IBMVIO=y
84CONFIG_U3_DART=y 89CONFIG_U3_DART=y
85CONFIG_MPIC_BROKEN_U3=y 90CONFIG_MPIC_BROKEN_U3=y
@@ -89,10 +94,30 @@ CONFIG_BOOTX_TEXT=y
89CONFIG_IOMMU_VMERGE=y 94CONFIG_IOMMU_VMERGE=y
90CONFIG_SMP=y 95CONFIG_SMP=y
91CONFIG_NR_CPUS=32 96CONFIG_NR_CPUS=32
97CONFIG_ARCH_SELECT_MEMORY_MODEL=y
98CONFIG_ARCH_FLATMEM_ENABLE=y
92CONFIG_ARCH_DISCONTIGMEM_ENABLE=y 99CONFIG_ARCH_DISCONTIGMEM_ENABLE=y
100CONFIG_ARCH_DISCONTIGMEM_DEFAULT=y
101CONFIG_ARCH_SPARSEMEM_ENABLE=y
102CONFIG_SELECT_MEMORY_MODEL=y
103# CONFIG_FLATMEM_MANUAL is not set
104CONFIG_DISCONTIGMEM_MANUAL=y
105# CONFIG_SPARSEMEM_MANUAL is not set
106CONFIG_DISCONTIGMEM=y
107CONFIG_FLAT_NODE_MEM_MAP=y
108CONFIG_NEED_MULTIPLE_NODES=y
109CONFIG_HAVE_ARCH_EARLY_PFN_TO_NID=y
110CONFIG_NODES_SPAN_OTHER_NODES=y
93# CONFIG_NUMA is not set 111# CONFIG_NUMA is not set
94# CONFIG_SCHED_SMT is not set 112# CONFIG_SCHED_SMT is not set
113CONFIG_PREEMPT_NONE=y
114# CONFIG_PREEMPT_VOLUNTARY is not set
95# CONFIG_PREEMPT is not set 115# CONFIG_PREEMPT is not set
116# CONFIG_PREEMPT_BKL is not set
117# CONFIG_HZ_100 is not set
118CONFIG_HZ_250=y
119# CONFIG_HZ_1000 is not set
120CONFIG_HZ=250
96CONFIG_EEH=y 121CONFIG_EEH=y
97CONFIG_GENERIC_HARDIRQS=y 122CONFIG_GENERIC_HARDIRQS=y
98CONFIG_PPC_RTAS=y 123CONFIG_PPC_RTAS=y
@@ -133,6 +158,142 @@ CONFIG_PROC_DEVICETREE=y
133# CONFIG_CMDLINE_BOOL is not set 158# CONFIG_CMDLINE_BOOL is not set
134 159
135# 160#
161# Networking
162#
163CONFIG_NET=y
164
165#
166# Networking options
167#
168CONFIG_PACKET=y
169# CONFIG_PACKET_MMAP is not set
170CONFIG_UNIX=y
171CONFIG_XFRM=y
172CONFIG_XFRM_USER=m
173CONFIG_NET_KEY=m
174CONFIG_INET=y
175CONFIG_IP_MULTICAST=y
176# CONFIG_IP_ADVANCED_ROUTER is not set
177CONFIG_IP_FIB_HASH=y
178# CONFIG_IP_PNP is not set
179CONFIG_NET_IPIP=y
180# CONFIG_NET_IPGRE is not set
181# CONFIG_IP_MROUTE is not set
182# CONFIG_ARPD is not set
183CONFIG_SYN_COOKIES=y
184CONFIG_INET_AH=m
185CONFIG_INET_ESP=m
186CONFIG_INET_IPCOMP=m
187CONFIG_INET_TUNNEL=y
188# CONFIG_IP_TCPDIAG is not set
189# CONFIG_IP_TCPDIAG_IPV6 is not set
190# CONFIG_TCP_CONG_ADVANCED is not set
191CONFIG_TCP_CONG_BIC=y
192
193#
194# IP: Virtual Server Configuration
195#
196# CONFIG_IP_VS is not set
197# CONFIG_IPV6 is not set
198CONFIG_NETFILTER=y
199# CONFIG_NETFILTER_DEBUG is not set
200
201#
202# IP: Netfilter Configuration
203#
204CONFIG_IP_NF_CONNTRACK=m
205CONFIG_IP_NF_CT_ACCT=y
206CONFIG_IP_NF_CONNTRACK_MARK=y
207CONFIG_IP_NF_CT_PROTO_SCTP=m
208CONFIG_IP_NF_FTP=m
209CONFIG_IP_NF_IRC=m
210CONFIG_IP_NF_TFTP=m
211CONFIG_IP_NF_AMANDA=m
212CONFIG_IP_NF_QUEUE=m
213CONFIG_IP_NF_IPTABLES=m
214CONFIG_IP_NF_MATCH_LIMIT=m
215CONFIG_IP_NF_MATCH_IPRANGE=m
216CONFIG_IP_NF_MATCH_MAC=m
217CONFIG_IP_NF_MATCH_PKTTYPE=m
218CONFIG_IP_NF_MATCH_MARK=m
219CONFIG_IP_NF_MATCH_MULTIPORT=m
220CONFIG_IP_NF_MATCH_TOS=m
221CONFIG_IP_NF_MATCH_RECENT=m
222CONFIG_IP_NF_MATCH_ECN=m
223CONFIG_IP_NF_MATCH_DSCP=m
224CONFIG_IP_NF_MATCH_AH_ESP=m
225CONFIG_IP_NF_MATCH_LENGTH=m
226CONFIG_IP_NF_MATCH_TTL=m
227CONFIG_IP_NF_MATCH_TCPMSS=m
228CONFIG_IP_NF_MATCH_HELPER=m
229CONFIG_IP_NF_MATCH_STATE=m
230CONFIG_IP_NF_MATCH_CONNTRACK=m
231CONFIG_IP_NF_MATCH_OWNER=m
232CONFIG_IP_NF_MATCH_ADDRTYPE=m
233CONFIG_IP_NF_MATCH_REALM=m
234CONFIG_IP_NF_MATCH_SCTP=m
235CONFIG_IP_NF_MATCH_COMMENT=m
236CONFIG_IP_NF_MATCH_CONNMARK=m
237CONFIG_IP_NF_MATCH_HASHLIMIT=m
238CONFIG_IP_NF_FILTER=m
239CONFIG_IP_NF_TARGET_REJECT=m
240CONFIG_IP_NF_TARGET_LOG=m
241CONFIG_IP_NF_TARGET_ULOG=m
242CONFIG_IP_NF_TARGET_TCPMSS=m
243CONFIG_IP_NF_NAT=m
244CONFIG_IP_NF_NAT_NEEDED=y
245CONFIG_IP_NF_TARGET_MASQUERADE=m
246CONFIG_IP_NF_TARGET_REDIRECT=m
247CONFIG_IP_NF_TARGET_NETMAP=m
248CONFIG_IP_NF_TARGET_SAME=m
249CONFIG_IP_NF_NAT_SNMP_BASIC=m
250CONFIG_IP_NF_NAT_IRC=m
251CONFIG_IP_NF_NAT_FTP=m
252CONFIG_IP_NF_NAT_TFTP=m
253CONFIG_IP_NF_NAT_AMANDA=m
254CONFIG_IP_NF_MANGLE=m
255CONFIG_IP_NF_TARGET_TOS=m
256CONFIG_IP_NF_TARGET_ECN=m
257CONFIG_IP_NF_TARGET_DSCP=m
258CONFIG_IP_NF_TARGET_MARK=m
259CONFIG_IP_NF_TARGET_CLASSIFY=m
260CONFIG_IP_NF_TARGET_CONNMARK=m
261CONFIG_IP_NF_TARGET_CLUSTERIP=m
262CONFIG_IP_NF_RAW=m
263CONFIG_IP_NF_TARGET_NOTRACK=m
264CONFIG_IP_NF_ARPTABLES=m
265CONFIG_IP_NF_ARPFILTER=m
266CONFIG_IP_NF_ARP_MANGLE=m
267
268#
269# SCTP Configuration (EXPERIMENTAL)
270#
271# CONFIG_IP_SCTP is not set
272# CONFIG_ATM is not set
273# CONFIG_BRIDGE is not set
274# CONFIG_VLAN_8021Q is not set
275# CONFIG_DECNET is not set
276CONFIG_LLC=y
277# CONFIG_LLC2 is not set
278# CONFIG_IPX is not set
279# CONFIG_ATALK is not set
280# CONFIG_X25 is not set
281# CONFIG_LAPB is not set
282# CONFIG_NET_DIVERT is not set
283# CONFIG_ECONET is not set
284# CONFIG_WAN_ROUTER is not set
285# CONFIG_NET_SCHED is not set
286CONFIG_NET_CLS_ROUTE=y
287
288#
289# Network testing
290#
291# CONFIG_NET_PKTGEN is not set
292# CONFIG_HAMRADIO is not set
293# CONFIG_IRDA is not set
294# CONFIG_BT is not set
295
296#
136# Device Drivers 297# Device Drivers
137# 298#
138 299
@@ -239,6 +400,7 @@ CONFIG_BLK_DEV_AMD74XX=y
239# CONFIG_BLK_DEV_HPT366 is not set 400# CONFIG_BLK_DEV_HPT366 is not set
240# CONFIG_BLK_DEV_SC1200 is not set 401# CONFIG_BLK_DEV_SC1200 is not set
241# CONFIG_BLK_DEV_PIIX is not set 402# CONFIG_BLK_DEV_PIIX is not set
403# CONFIG_BLK_DEV_IT821X is not set
242# CONFIG_BLK_DEV_NS87415 is not set 404# CONFIG_BLK_DEV_NS87415 is not set
243# CONFIG_BLK_DEV_PDC202XX_OLD is not set 405# CONFIG_BLK_DEV_PDC202XX_OLD is not set
244# CONFIG_BLK_DEV_PDC202XX_NEW is not set 406# CONFIG_BLK_DEV_PDC202XX_NEW is not set
@@ -272,6 +434,7 @@ CONFIG_CHR_DEV_ST=y
272CONFIG_BLK_DEV_SR=y 434CONFIG_BLK_DEV_SR=y
273CONFIG_BLK_DEV_SR_VENDOR=y 435CONFIG_BLK_DEV_SR_VENDOR=y
274CONFIG_CHR_DEV_SG=y 436CONFIG_CHR_DEV_SG=y
437# CONFIG_CHR_DEV_SCH is not set
275 438
276# 439#
277# Some SCSI devices (e.g. CD jukebox) support multiple LUNs 440# Some SCSI devices (e.g. CD jukebox) support multiple LUNs
@@ -339,6 +502,7 @@ CONFIG_SCSI_QLA22XX=m
339CONFIG_SCSI_QLA2300=m 502CONFIG_SCSI_QLA2300=m
340CONFIG_SCSI_QLA2322=m 503CONFIG_SCSI_QLA2322=m
341CONFIG_SCSI_QLA6312=m 504CONFIG_SCSI_QLA6312=m
505CONFIG_SCSI_QLA24XX=m
342CONFIG_SCSI_LPFC=m 506CONFIG_SCSI_LPFC=m
343# CONFIG_SCSI_DC395x is not set 507# CONFIG_SCSI_DC395x is not set
344# CONFIG_SCSI_DC390T is not set 508# CONFIG_SCSI_DC390T is not set
@@ -369,6 +533,8 @@ CONFIG_DM_MULTIPATH_EMC=m
369# Fusion MPT device support 533# Fusion MPT device support
370# 534#
371# CONFIG_FUSION is not set 535# CONFIG_FUSION is not set
536# CONFIG_FUSION_SPI is not set
537# CONFIG_FUSION_FC is not set
372 538
373# 539#
374# IEEE 1394 (FireWire) support 540# IEEE 1394 (FireWire) support
@@ -382,6 +548,7 @@ CONFIG_IEEE1394=y
382# CONFIG_IEEE1394_OUI_DB is not set 548# CONFIG_IEEE1394_OUI_DB is not set
383CONFIG_IEEE1394_EXTRA_CONFIG_ROMS=y 549CONFIG_IEEE1394_EXTRA_CONFIG_ROMS=y
384CONFIG_IEEE1394_CONFIG_ROM_IP1394=y 550CONFIG_IEEE1394_CONFIG_ROM_IP1394=y
551# CONFIG_IEEE1394_EXPORT_FULL_API is not set
385 552
386# 553#
387# Device Drivers 554# Device Drivers
@@ -409,154 +576,14 @@ CONFIG_IEEE1394_AMDTP=m
409# 576#
410# Macintosh device drivers 577# Macintosh device drivers
411# 578#
412CONFIG_ADB=y
413CONFIG_ADB_PMU=y 579CONFIG_ADB_PMU=y
414CONFIG_PMAC_SMU=y 580CONFIG_PMAC_SMU=y
415# CONFIG_PMAC_PBOOK is not set
416# CONFIG_PMAC_BACKLIGHT is not set 581# CONFIG_PMAC_BACKLIGHT is not set
417# CONFIG_INPUT_ADBHID is not set
418CONFIG_THERM_PM72=y 582CONFIG_THERM_PM72=y
419 583
420# 584#
421# Networking support 585# Network device support
422# 586#
423CONFIG_NET=y
424
425#
426# Networking options
427#
428CONFIG_PACKET=y
429# CONFIG_PACKET_MMAP is not set
430CONFIG_UNIX=y
431CONFIG_NET_KEY=m
432CONFIG_INET=y
433CONFIG_IP_MULTICAST=y
434# CONFIG_IP_ADVANCED_ROUTER is not set
435# CONFIG_IP_PNP is not set
436CONFIG_NET_IPIP=y
437# CONFIG_NET_IPGRE is not set
438# CONFIG_IP_MROUTE is not set
439# CONFIG_ARPD is not set
440CONFIG_SYN_COOKIES=y
441CONFIG_INET_AH=m
442CONFIG_INET_ESP=m
443CONFIG_INET_IPCOMP=m
444CONFIG_INET_TUNNEL=y
445# CONFIG_IP_TCPDIAG is not set
446# CONFIG_IP_TCPDIAG_IPV6 is not set
447
448#
449# IP: Virtual Server Configuration
450#
451# CONFIG_IP_VS is not set
452# CONFIG_IPV6 is not set
453CONFIG_NETFILTER=y
454# CONFIG_NETFILTER_DEBUG is not set
455
456#
457# IP: Netfilter Configuration
458#
459CONFIG_IP_NF_CONNTRACK=m
460CONFIG_IP_NF_CT_ACCT=y
461CONFIG_IP_NF_CONNTRACK_MARK=y
462CONFIG_IP_NF_CT_PROTO_SCTP=m
463CONFIG_IP_NF_FTP=m
464CONFIG_IP_NF_IRC=m
465CONFIG_IP_NF_TFTP=m
466CONFIG_IP_NF_AMANDA=m
467CONFIG_IP_NF_QUEUE=m
468CONFIG_IP_NF_IPTABLES=m
469CONFIG_IP_NF_MATCH_LIMIT=m
470CONFIG_IP_NF_MATCH_IPRANGE=m
471CONFIG_IP_NF_MATCH_MAC=m
472CONFIG_IP_NF_MATCH_PKTTYPE=m
473CONFIG_IP_NF_MATCH_MARK=m
474CONFIG_IP_NF_MATCH_MULTIPORT=m
475CONFIG_IP_NF_MATCH_TOS=m
476CONFIG_IP_NF_MATCH_RECENT=m
477CONFIG_IP_NF_MATCH_ECN=m
478CONFIG_IP_NF_MATCH_DSCP=m
479CONFIG_IP_NF_MATCH_AH_ESP=m
480CONFIG_IP_NF_MATCH_LENGTH=m
481CONFIG_IP_NF_MATCH_TTL=m
482CONFIG_IP_NF_MATCH_TCPMSS=m
483CONFIG_IP_NF_MATCH_HELPER=m
484CONFIG_IP_NF_MATCH_STATE=m
485CONFIG_IP_NF_MATCH_CONNTRACK=m
486CONFIG_IP_NF_MATCH_OWNER=m
487CONFIG_IP_NF_MATCH_ADDRTYPE=m
488CONFIG_IP_NF_MATCH_REALM=m
489CONFIG_IP_NF_MATCH_SCTP=m
490CONFIG_IP_NF_MATCH_COMMENT=m
491CONFIG_IP_NF_MATCH_CONNMARK=m
492CONFIG_IP_NF_MATCH_HASHLIMIT=m
493CONFIG_IP_NF_FILTER=m
494CONFIG_IP_NF_TARGET_REJECT=m
495CONFIG_IP_NF_TARGET_LOG=m
496CONFIG_IP_NF_TARGET_ULOG=m
497CONFIG_IP_NF_TARGET_TCPMSS=m
498CONFIG_IP_NF_NAT=m
499CONFIG_IP_NF_NAT_NEEDED=y
500CONFIG_IP_NF_TARGET_MASQUERADE=m
501CONFIG_IP_NF_TARGET_REDIRECT=m
502CONFIG_IP_NF_TARGET_NETMAP=m
503CONFIG_IP_NF_TARGET_SAME=m
504CONFIG_IP_NF_NAT_SNMP_BASIC=m
505CONFIG_IP_NF_NAT_IRC=m
506CONFIG_IP_NF_NAT_FTP=m
507CONFIG_IP_NF_NAT_TFTP=m
508CONFIG_IP_NF_NAT_AMANDA=m
509CONFIG_IP_NF_MANGLE=m
510CONFIG_IP_NF_TARGET_TOS=m
511CONFIG_IP_NF_TARGET_ECN=m
512CONFIG_IP_NF_TARGET_DSCP=m
513CONFIG_IP_NF_TARGET_MARK=m
514CONFIG_IP_NF_TARGET_CLASSIFY=m
515CONFIG_IP_NF_TARGET_CONNMARK=m
516CONFIG_IP_NF_TARGET_CLUSTERIP=m
517CONFIG_IP_NF_RAW=m
518CONFIG_IP_NF_TARGET_NOTRACK=m
519CONFIG_IP_NF_ARPTABLES=m
520CONFIG_IP_NF_ARPFILTER=m
521CONFIG_IP_NF_ARP_MANGLE=m
522CONFIG_XFRM=y
523CONFIG_XFRM_USER=m
524
525#
526# SCTP Configuration (EXPERIMENTAL)
527#
528# CONFIG_IP_SCTP is not set
529# CONFIG_ATM is not set
530# CONFIG_BRIDGE is not set
531# CONFIG_VLAN_8021Q is not set
532# CONFIG_DECNET is not set
533CONFIG_LLC=y
534# CONFIG_LLC2 is not set
535# CONFIG_IPX is not set
536# CONFIG_ATALK is not set
537# CONFIG_X25 is not set
538# CONFIG_LAPB is not set
539# CONFIG_NET_DIVERT is not set
540# CONFIG_ECONET is not set
541# CONFIG_WAN_ROUTER is not set
542
543#
544# QoS and/or fair queueing
545#
546# CONFIG_NET_SCHED is not set
547CONFIG_NET_CLS_ROUTE=y
548
549#
550# Network testing
551#
552# CONFIG_NET_PKTGEN is not set
553CONFIG_NETPOLL=y
554CONFIG_NETPOLL_RX=y
555CONFIG_NETPOLL_TRAP=y
556CONFIG_NET_POLL_CONTROLLER=y
557# CONFIG_HAMRADIO is not set
558# CONFIG_IRDA is not set
559# CONFIG_BT is not set
560CONFIG_NETDEVICES=y 587CONFIG_NETDEVICES=y
561CONFIG_DUMMY=m 588CONFIG_DUMMY=m
562CONFIG_BONDING=m 589CONFIG_BONDING=m
@@ -616,6 +643,7 @@ CONFIG_E1000=y
616# CONFIG_HAMACHI is not set 643# CONFIG_HAMACHI is not set
617# CONFIG_YELLOWFIN is not set 644# CONFIG_YELLOWFIN is not set
618# CONFIG_R8169 is not set 645# CONFIG_R8169 is not set
646# CONFIG_SKGE is not set
619# CONFIG_SK98LIN is not set 647# CONFIG_SK98LIN is not set
620# CONFIG_VIA_VELOCITY is not set 648# CONFIG_VIA_VELOCITY is not set
621CONFIG_TIGON3=y 649CONFIG_TIGON3=y
@@ -661,6 +689,10 @@ CONFIG_PPPOE=m
661# CONFIG_NET_FC is not set 689# CONFIG_NET_FC is not set
662# CONFIG_SHAPER is not set 690# CONFIG_SHAPER is not set
663CONFIG_NETCONSOLE=y 691CONFIG_NETCONSOLE=y
692CONFIG_NETPOLL=y
693CONFIG_NETPOLL_RX=y
694CONFIG_NETPOLL_TRAP=y
695CONFIG_NET_POLL_CONTROLLER=y
664 696
665# 697#
666# ISDN subsystem 698# ISDN subsystem
@@ -764,7 +796,6 @@ CONFIG_HVCS=m
764# 796#
765# CONFIG_WATCHDOG is not set 797# CONFIG_WATCHDOG is not set
766# CONFIG_RTC is not set 798# CONFIG_RTC is not set
767# CONFIG_GEN_RTC is not set
768# CONFIG_DTLK is not set 799# CONFIG_DTLK is not set
769# CONFIG_R3964 is not set 800# CONFIG_R3964 is not set
770# CONFIG_APPLICOM is not set 801# CONFIG_APPLICOM is not set
@@ -823,50 +854,19 @@ CONFIG_I2C_KEYWEST=y
823# CONFIG_I2C_VIAPRO is not set 854# CONFIG_I2C_VIAPRO is not set
824# CONFIG_I2C_VOODOO3 is not set 855# CONFIG_I2C_VOODOO3 is not set
825# CONFIG_I2C_PCA_ISA is not set 856# CONFIG_I2C_PCA_ISA is not set
857# CONFIG_I2C_SENSOR is not set
826 858
827# 859#
828# Hardware Sensors Chip support 860# Miscellaneous I2C Chip support
829#
830# CONFIG_I2C_SENSOR is not set
831# CONFIG_SENSORS_ADM1021 is not set
832# CONFIG_SENSORS_ADM1025 is not set
833# CONFIG_SENSORS_ADM1026 is not set
834# CONFIG_SENSORS_ADM1031 is not set
835# CONFIG_SENSORS_ASB100 is not set
836# CONFIG_SENSORS_DS1621 is not set
837# CONFIG_SENSORS_FSCHER is not set
838# CONFIG_SENSORS_FSCPOS is not set
839# CONFIG_SENSORS_GL518SM is not set
840# CONFIG_SENSORS_GL520SM is not set
841# CONFIG_SENSORS_IT87 is not set
842# CONFIG_SENSORS_LM63 is not set
843# CONFIG_SENSORS_LM75 is not set
844# CONFIG_SENSORS_LM77 is not set
845# CONFIG_SENSORS_LM78 is not set
846# CONFIG_SENSORS_LM80 is not set
847# CONFIG_SENSORS_LM83 is not set
848# CONFIG_SENSORS_LM85 is not set
849# CONFIG_SENSORS_LM87 is not set
850# CONFIG_SENSORS_LM90 is not set
851# CONFIG_SENSORS_LM92 is not set
852# CONFIG_SENSORS_MAX1619 is not set
853# CONFIG_SENSORS_PC87360 is not set
854# CONFIG_SENSORS_SMSC47B397 is not set
855# CONFIG_SENSORS_SIS5595 is not set
856# CONFIG_SENSORS_SMSC47M1 is not set
857# CONFIG_SENSORS_VIA686A is not set
858# CONFIG_SENSORS_W83781D is not set
859# CONFIG_SENSORS_W83L785TS is not set
860# CONFIG_SENSORS_W83627HF is not set
861
862#
863# Other I2C Chip support
864# 861#
865# CONFIG_SENSORS_DS1337 is not set 862# CONFIG_SENSORS_DS1337 is not set
863# CONFIG_SENSORS_DS1374 is not set
866# CONFIG_SENSORS_EEPROM is not set 864# CONFIG_SENSORS_EEPROM is not set
867# CONFIG_SENSORS_PCF8574 is not set 865# CONFIG_SENSORS_PCF8574 is not set
866# CONFIG_SENSORS_PCA9539 is not set
868# CONFIG_SENSORS_PCF8591 is not set 867# CONFIG_SENSORS_PCF8591 is not set
869# CONFIG_SENSORS_RTC8564 is not set 868# CONFIG_SENSORS_RTC8564 is not set
869# CONFIG_SENSORS_MAX6875 is not set
870# CONFIG_I2C_DEBUG_CORE is not set 870# CONFIG_I2C_DEBUG_CORE is not set
871# CONFIG_I2C_DEBUG_ALGO is not set 871# CONFIG_I2C_DEBUG_ALGO is not set
872# CONFIG_I2C_DEBUG_BUS is not set 872# CONFIG_I2C_DEBUG_BUS is not set
@@ -878,6 +878,11 @@ CONFIG_I2C_KEYWEST=y
878# CONFIG_W1 is not set 878# CONFIG_W1 is not set
879 879
880# 880#
881# Hardware Monitoring support
882#
883# CONFIG_HWMON is not set
884
885#
881# Misc devices 886# Misc devices
882# 887#
883 888
@@ -988,6 +993,7 @@ CONFIG_USB_DEVICEFS=y
988CONFIG_USB_EHCI_HCD=y 993CONFIG_USB_EHCI_HCD=y
989# CONFIG_USB_EHCI_SPLIT_ISO is not set 994# CONFIG_USB_EHCI_SPLIT_ISO is not set
990# CONFIG_USB_EHCI_ROOT_HUB_TT is not set 995# CONFIG_USB_EHCI_ROOT_HUB_TT is not set
996# CONFIG_USB_ISP116X_HCD is not set
991CONFIG_USB_OHCI_HCD=y 997CONFIG_USB_OHCI_HCD=y
992# CONFIG_USB_OHCI_BIG_ENDIAN is not set 998# CONFIG_USB_OHCI_BIG_ENDIAN is not set
993CONFIG_USB_OHCI_LITTLE_ENDIAN=y 999CONFIG_USB_OHCI_LITTLE_ENDIAN=y
@@ -1024,12 +1030,15 @@ CONFIG_USB_HIDINPUT=y
1024CONFIG_USB_HIDDEV=y 1030CONFIG_USB_HIDDEV=y
1025# CONFIG_USB_AIPTEK is not set 1031# CONFIG_USB_AIPTEK is not set
1026# CONFIG_USB_WACOM is not set 1032# CONFIG_USB_WACOM is not set
1033# CONFIG_USB_ACECAD is not set
1027# CONFIG_USB_KBTAB is not set 1034# CONFIG_USB_KBTAB is not set
1028# CONFIG_USB_POWERMATE is not set 1035# CONFIG_USB_POWERMATE is not set
1029# CONFIG_USB_MTOUCH is not set 1036# CONFIG_USB_MTOUCH is not set
1037# CONFIG_USB_ITMTOUCH is not set
1030# CONFIG_USB_EGALAX is not set 1038# CONFIG_USB_EGALAX is not set
1031# CONFIG_USB_XPAD is not set 1039# CONFIG_USB_XPAD is not set
1032# CONFIG_USB_ATI_REMOTE is not set 1040# CONFIG_USB_ATI_REMOTE is not set
1041# CONFIG_USB_KEYSPAN_REMOTE is not set
1033 1042
1034# 1043#
1035# USB Imaging devices 1044# USB Imaging devices
@@ -1081,10 +1090,11 @@ CONFIG_USB_PEGASUS=y
1081# CONFIG_USB_PHIDGETSERVO is not set 1090# CONFIG_USB_PHIDGETSERVO is not set
1082# CONFIG_USB_IDMOUSE is not set 1091# CONFIG_USB_IDMOUSE is not set
1083# CONFIG_USB_SISUSBVGA is not set 1092# CONFIG_USB_SISUSBVGA is not set
1093# CONFIG_USB_LD is not set
1084# CONFIG_USB_TEST is not set 1094# CONFIG_USB_TEST is not set
1085 1095
1086# 1096#
1087# USB ATM/DSL drivers 1097# USB DSL modem support
1088# 1098#
1089 1099
1090# 1100#
@@ -1101,18 +1111,25 @@ CONFIG_USB_PEGASUS=y
1101# InfiniBand support 1111# InfiniBand support
1102# 1112#
1103CONFIG_INFINIBAND=m 1113CONFIG_INFINIBAND=m
1114CONFIG_INFINIBAND_USER_VERBS=m
1104CONFIG_INFINIBAND_MTHCA=m 1115CONFIG_INFINIBAND_MTHCA=m
1105# CONFIG_INFINIBAND_MTHCA_DEBUG is not set 1116# CONFIG_INFINIBAND_MTHCA_DEBUG is not set
1106CONFIG_INFINIBAND_IPOIB=m 1117CONFIG_INFINIBAND_IPOIB=m
1107# CONFIG_INFINIBAND_IPOIB_DEBUG is not set 1118# CONFIG_INFINIBAND_IPOIB_DEBUG is not set
1108 1119
1109# 1120#
1121# SN Devices
1122#
1123
1124#
1110# File systems 1125# File systems
1111# 1126#
1112CONFIG_EXT2_FS=y 1127CONFIG_EXT2_FS=y
1113CONFIG_EXT2_FS_XATTR=y 1128CONFIG_EXT2_FS_XATTR=y
1114CONFIG_EXT2_FS_POSIX_ACL=y 1129CONFIG_EXT2_FS_POSIX_ACL=y
1115CONFIG_EXT2_FS_SECURITY=y 1130CONFIG_EXT2_FS_SECURITY=y
1131CONFIG_EXT2_FS_XIP=y
1132CONFIG_FS_XIP=y
1116CONFIG_EXT3_FS=y 1133CONFIG_EXT3_FS=y
1117CONFIG_EXT3_FS_XATTR=y 1134CONFIG_EXT3_FS_XATTR=y
1118CONFIG_EXT3_FS_POSIX_ACL=y 1135CONFIG_EXT3_FS_POSIX_ACL=y
@@ -1144,6 +1161,7 @@ CONFIG_XFS_SECURITY=y
1144CONFIG_XFS_POSIX_ACL=y 1161CONFIG_XFS_POSIX_ACL=y
1145# CONFIG_MINIX_FS is not set 1162# CONFIG_MINIX_FS is not set
1146# CONFIG_ROMFS_FS is not set 1163# CONFIG_ROMFS_FS is not set
1164CONFIG_INOTIFY=y
1147# CONFIG_QUOTA is not set 1165# CONFIG_QUOTA is not set
1148CONFIG_DNOTIFY=y 1166CONFIG_DNOTIFY=y
1149CONFIG_AUTOFS_FS=y 1167CONFIG_AUTOFS_FS=y
@@ -1174,7 +1192,6 @@ CONFIG_FAT_DEFAULT_IOCHARSET="iso8859-1"
1174CONFIG_PROC_FS=y 1192CONFIG_PROC_FS=y
1175CONFIG_PROC_KCORE=y 1193CONFIG_PROC_KCORE=y
1176CONFIG_SYSFS=y 1194CONFIG_SYSFS=y
1177# CONFIG_DEVFS_FS is not set
1178CONFIG_DEVPTS_FS_XATTR=y 1195CONFIG_DEVPTS_FS_XATTR=y
1179CONFIG_DEVPTS_FS_SECURITY=y 1196CONFIG_DEVPTS_FS_SECURITY=y
1180CONFIG_TMPFS=y 1197CONFIG_TMPFS=y
@@ -1206,15 +1223,20 @@ CONFIG_CRAMFS=y
1206# 1223#
1207CONFIG_NFS_FS=y 1224CONFIG_NFS_FS=y
1208CONFIG_NFS_V3=y 1225CONFIG_NFS_V3=y
1226CONFIG_NFS_V3_ACL=y
1209CONFIG_NFS_V4=y 1227CONFIG_NFS_V4=y
1210# CONFIG_NFS_DIRECTIO is not set 1228# CONFIG_NFS_DIRECTIO is not set
1211CONFIG_NFSD=m 1229CONFIG_NFSD=m
1230CONFIG_NFSD_V2_ACL=y
1212CONFIG_NFSD_V3=y 1231CONFIG_NFSD_V3=y
1232CONFIG_NFSD_V3_ACL=y
1213CONFIG_NFSD_V4=y 1233CONFIG_NFSD_V4=y
1214CONFIG_NFSD_TCP=y 1234CONFIG_NFSD_TCP=y
1215CONFIG_LOCKD=y 1235CONFIG_LOCKD=y
1216CONFIG_LOCKD_V4=y 1236CONFIG_LOCKD_V4=y
1217CONFIG_EXPORTFS=m 1237CONFIG_EXPORTFS=m
1238CONFIG_NFS_ACL_SUPPORT=y
1239CONFIG_NFS_COMMON=y
1218CONFIG_SUNRPC=y 1240CONFIG_SUNRPC=y
1219CONFIG_SUNRPC_GSS=y 1241CONFIG_SUNRPC_GSS=y
1220CONFIG_RPCSEC_GSS_KRB5=y 1242CONFIG_RPCSEC_GSS_KRB5=y
diff --git a/arch/ppc64/kernel/LparData.c b/arch/ppc64/kernel/LparData.c
index 6ffcf67dd507..0a9c23ca2f0c 100644
--- a/arch/ppc64/kernel/LparData.c
+++ b/arch/ppc64/kernel/LparData.c
@@ -32,18 +32,17 @@
32/* The HvReleaseData is the root of the information shared between 32/* The HvReleaseData is the root of the information shared between
33 * the hypervisor and Linux. 33 * the hypervisor and Linux.
34 */ 34 */
35
36struct HvReleaseData hvReleaseData = { 35struct HvReleaseData hvReleaseData = {
37 .xDesc = 0xc8a5d9c4, /* "HvRD" ebcdic */ 36 .xDesc = 0xc8a5d9c4, /* "HvRD" ebcdic */
38 .xSize = sizeof(struct HvReleaseData), 37 .xSize = sizeof(struct HvReleaseData),
39 .xVpdAreasPtrOffset = offsetof(struct naca_struct, xItVpdAreas), 38 .xVpdAreasPtrOffset = offsetof(struct naca_struct, xItVpdAreas),
40 .xSlicNacaAddr = &naca, /* 64-bit Naca address */ 39 .xSlicNacaAddr = &naca, /* 64-bit Naca address */
41 .xMsNucDataOffset = 0x4800, /* offset of LparMap within loadarea (see head.S) */ 40 .xMsNucDataOffset = LPARMAP_PHYS,
42 .xTagsMode = 1, /* tags inactive */ 41 .xFlags = HVREL_TAGSINACTIVE /* tags inactive */
43 .xAddressSize = 0, /* 64 bit */ 42 /* 64 bit */
44 .xNoSharedProcs = 0, /* shared processors */ 43 /* shared processors */
45 .xNoHMT = 0, /* HMT allowed */ 44 /* HMT allowed */
46 .xRsvd2 = 6, /* TEMP: This allows non-GA driver */ 45 | 6, /* TEMP: This allows non-GA driver */
47 .xVrmIndex = 4, /* We are v5r2m0 */ 46 .xVrmIndex = 4, /* We are v5r2m0 */
48 .xMinSupportedPlicVrmIndex = 3, /* v5r1m0 */ 47 .xMinSupportedPlicVrmIndex = 3, /* v5r1m0 */
49 .xMinCompatablePlicVrmIndex = 3, /* v5r1m0 */ 48 .xMinCompatablePlicVrmIndex = 3, /* v5r1m0 */
@@ -52,6 +51,17 @@ struct HvReleaseData hvReleaseData = {
52 0xf4, 0x4b, 0xf6, 0xf4 }, 51 0xf4, 0x4b, 0xf6, 0xf4 },
53}; 52};
54 53
54/*
55 * The NACA. The first dword of the naca is required by the iSeries
56 * hypervisor to point to itVpdAreas. The hypervisor finds the NACA
57 * through the pointer in hvReleaseData.
58 */
59struct naca_struct naca = {
60 .xItVpdAreas = &itVpdAreas,
61 .xRamDisk = 0,
62 .xRamDiskSize = 0,
63};
64
55extern void system_reset_iSeries(void); 65extern void system_reset_iSeries(void);
56extern void machine_check_iSeries(void); 66extern void machine_check_iSeries(void);
57extern void data_access_iSeries(void); 67extern void data_access_iSeries(void);
@@ -215,29 +225,3 @@ struct ItVpdAreas itVpdAreas = {
215 0,0 225 0,0
216 } 226 }
217}; 227};
218
219struct msChunks msChunks;
220EXPORT_SYMBOL(msChunks);
221
222/* Depending on whether this is called from iSeries or pSeries setup
223 * code, the location of the msChunks struct may or may not have
224 * to be reloc'd, so we force the caller to do that for us by passing
225 * in a pointer to the structure.
226 */
227unsigned long
228msChunks_alloc(unsigned long mem, unsigned long num_chunks, unsigned long chunk_size)
229{
230 unsigned long offset = reloc_offset();
231 struct msChunks *_msChunks = PTRRELOC(&msChunks);
232
233 _msChunks->num_chunks = num_chunks;
234 _msChunks->chunk_size = chunk_size;
235 _msChunks->chunk_shift = __ilog2(chunk_size);
236 _msChunks->chunk_mask = (1UL<<_msChunks->chunk_shift)-1;
237
238 mem = _ALIGN(mem, sizeof(msChunks_entry));
239 _msChunks->abs = (msChunks_entry *)(mem + offset);
240 mem += num_chunks * sizeof(msChunks_entry);
241
242 return mem;
243}
diff --git a/arch/ppc64/kernel/Makefile b/arch/ppc64/kernel/Makefile
index d9b2660ef221..f4b3bfcc109d 100644
--- a/arch/ppc64/kernel/Makefile
+++ b/arch/ppc64/kernel/Makefile
@@ -11,7 +11,7 @@ obj-y := setup.o entry.o traps.o irq.o idle.o dma.o \
11 udbg.o binfmt_elf32.o sys_ppc32.o ioctl32.o \ 11 udbg.o binfmt_elf32.o sys_ppc32.o ioctl32.o \
12 ptrace32.o signal32.o rtc.o init_task.o \ 12 ptrace32.o signal32.o rtc.o init_task.o \
13 lmb.o cputable.o cpu_setup_power4.o idle_power4.o \ 13 lmb.o cputable.o cpu_setup_power4.o idle_power4.o \
14 iommu.o sysfs.o vdso.o pmc.o 14 iommu.o sysfs.o vdso.o pmc.o firmware.o
15obj-y += vdso32/ vdso64/ 15obj-y += vdso32/ vdso64/
16 16
17obj-$(CONFIG_PPC_OF) += of_device.o 17obj-$(CONFIG_PPC_OF) += of_device.o
@@ -50,7 +50,10 @@ obj-$(CONFIG_LPARCFG) += lparcfg.o
50obj-$(CONFIG_HVC_CONSOLE) += hvconsole.o 50obj-$(CONFIG_HVC_CONSOLE) += hvconsole.o
51obj-$(CONFIG_BOOTX_TEXT) += btext.o 51obj-$(CONFIG_BOOTX_TEXT) += btext.o
52obj-$(CONFIG_HVCS) += hvcserver.o 52obj-$(CONFIG_HVCS) += hvcserver.o
53obj-$(CONFIG_IBMVIO) += vio.o 53
54vio-obj-$(CONFIG_PPC_PSERIES) += pSeries_vio.o
55vio-obj-$(CONFIG_PPC_ISERIES) += iSeries_vio.o
56obj-$(CONFIG_IBMVIO) += vio.o $(vio-obj-y)
54obj-$(CONFIG_XICS) += xics.o 57obj-$(CONFIG_XICS) += xics.o
55obj-$(CONFIG_MPIC) += mpic.o 58obj-$(CONFIG_MPIC) += mpic.o
56 59
@@ -73,3 +76,8 @@ obj-$(CONFIG_ALTIVEC) += vecemu.o vector.o
73obj-$(CONFIG_KPROBES) += kprobes.o 76obj-$(CONFIG_KPROBES) += kprobes.o
74 77
75CFLAGS_ioctl32.o += -Ifs/ 78CFLAGS_ioctl32.o += -Ifs/
79
80ifeq ($(CONFIG_PPC_ISERIES),y)
81arch/ppc64/kernel/head.o: arch/ppc64/kernel/lparmap.s
82AFLAGS_head.o += -Iarch/ppc64/kernel
83endif
diff --git a/arch/ppc64/kernel/asm-offsets.c b/arch/ppc64/kernel/asm-offsets.c
index abb9e5b5da03..17e35d0fed09 100644
--- a/arch/ppc64/kernel/asm-offsets.c
+++ b/arch/ppc64/kernel/asm-offsets.c
@@ -94,7 +94,8 @@ int main(void)
94 DEFINE(PACASLBCACHEPTR, offsetof(struct paca_struct, slb_cache_ptr)); 94 DEFINE(PACASLBCACHEPTR, offsetof(struct paca_struct, slb_cache_ptr));
95 DEFINE(PACACONTEXTID, offsetof(struct paca_struct, context.id)); 95 DEFINE(PACACONTEXTID, offsetof(struct paca_struct, context.id));
96#ifdef CONFIG_HUGETLB_PAGE 96#ifdef CONFIG_HUGETLB_PAGE
97 DEFINE(PACAHTLBSEGS, offsetof(struct paca_struct, context.htlb_segs)); 97 DEFINE(PACALOWHTLBAREAS, offsetof(struct paca_struct, context.low_htlb_areas));
98 DEFINE(PACAHIGHHTLBAREAS, offsetof(struct paca_struct, context.high_htlb_areas));
98#endif /* CONFIG_HUGETLB_PAGE */ 99#endif /* CONFIG_HUGETLB_PAGE */
99 DEFINE(PACADEFAULTDECR, offsetof(struct paca_struct, default_decr)); 100 DEFINE(PACADEFAULTDECR, offsetof(struct paca_struct, default_decr));
100 DEFINE(PACA_EXGEN, offsetof(struct paca_struct, exgen)); 101 DEFINE(PACA_EXGEN, offsetof(struct paca_struct, exgen));
diff --git a/arch/ppc64/kernel/cpu_setup_power4.S b/arch/ppc64/kernel/cpu_setup_power4.S
index 42fc08cf87a0..0482c063c26e 100644
--- a/arch/ppc64/kernel/cpu_setup_power4.S
+++ b/arch/ppc64/kernel/cpu_setup_power4.S
@@ -31,10 +31,13 @@ _GLOBAL(__970_cpu_preinit)
31 */ 31 */
32 mfspr r0,SPRN_PVR 32 mfspr r0,SPRN_PVR
33 srwi r0,r0,16 33 srwi r0,r0,16
34 cmpwi cr0,r0,0x39 34 cmpwi r0,0x39
35 cmpwi cr1,r0,0x3c 35 beq 1f
36 cror 4*cr0+eq,4*cr0+eq,4*cr1+eq 36 cmpwi r0,0x3c
37 beq 1f
38 cmpwi r0,0x44
37 bnelr 39 bnelr
401:
38 41
39 /* Make sure HID4:rm_ci is off before MMU is turned off, that large 42 /* Make sure HID4:rm_ci is off before MMU is turned off, that large
40 * pages are enabled with HID4:61 and clear HID5:DCBZ_size and 43 * pages are enabled with HID4:61 and clear HID5:DCBZ_size and
@@ -133,12 +136,14 @@ _GLOBAL(__save_cpu_setup)
133 /* We only deal with 970 for now */ 136 /* We only deal with 970 for now */
134 mfspr r0,SPRN_PVR 137 mfspr r0,SPRN_PVR
135 srwi r0,r0,16 138 srwi r0,r0,16
136 cmpwi cr0,r0,0x39 139 cmpwi r0,0x39
137 cmpwi cr1,r0,0x3c 140 beq 1f
138 cror 4*cr0+eq,4*cr0+eq,4*cr1+eq 141 cmpwi r0,0x3c
139 bne 1f 142 beq 1f
140 143 cmpwi r0,0x44
141 /* Save HID0,1,4 and 5 */ 144 bne 2f
145
1461: /* Save HID0,1,4 and 5 */
142 mfspr r3,SPRN_HID0 147 mfspr r3,SPRN_HID0
143 std r3,CS_HID0(r5) 148 std r3,CS_HID0(r5)
144 mfspr r3,SPRN_HID1 149 mfspr r3,SPRN_HID1
@@ -148,7 +153,7 @@ _GLOBAL(__save_cpu_setup)
148 mfspr r3,SPRN_HID5 153 mfspr r3,SPRN_HID5
149 std r3,CS_HID5(r5) 154 std r3,CS_HID5(r5)
150 155
1511: 1562:
152 mtcr r7 157 mtcr r7
153 blr 158 blr
154 159
@@ -165,12 +170,14 @@ _GLOBAL(__restore_cpu_setup)
165 /* We only deal with 970 for now */ 170 /* We only deal with 970 for now */
166 mfspr r0,SPRN_PVR 171 mfspr r0,SPRN_PVR
167 srwi r0,r0,16 172 srwi r0,r0,16
168 cmpwi cr0,r0,0x39 173 cmpwi r0,0x39
169 cmpwi cr1,r0,0x3c 174 beq 1f
170 cror 4*cr0+eq,4*cr0+eq,4*cr1+eq 175 cmpwi r0,0x3c
171 bne 1f 176 beq 1f
177 cmpwi r0,0x44
178 bnelr
172 179
173 /* Before accessing memory, we make sure rm_ci is clear */ 1801: /* Before accessing memory, we make sure rm_ci is clear */
174 li r0,0 181 li r0,0
175 mfspr r3,SPRN_HID4 182 mfspr r3,SPRN_HID4
176 rldimi r3,r0,40,23 /* clear bit 23 (rm_ci) */ 183 rldimi r3,r0,40,23 /* clear bit 23 (rm_ci) */
@@ -223,6 +230,5 @@ _GLOBAL(__restore_cpu_setup)
223 mtspr SPRN_HID5,r3 230 mtspr SPRN_HID5,r3
224 sync 231 sync
225 isync 232 isync
2261:
227 blr 233 blr
228 234
diff --git a/arch/ppc64/kernel/cputable.c b/arch/ppc64/kernel/cputable.c
index 8d4c46f6f0b6..4847f2ac8c9f 100644
--- a/arch/ppc64/kernel/cputable.c
+++ b/arch/ppc64/kernel/cputable.c
@@ -5,7 +5,7 @@
5 * 5 *
6 * Modifications for ppc64: 6 * Modifications for ppc64:
7 * Copyright (C) 2003 Dave Engebretsen <engebret@us.ibm.com> 7 * Copyright (C) 2003 Dave Engebretsen <engebret@us.ibm.com>
8 * 8 *
9 * This program is free software; you can redistribute it and/or 9 * This program is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU General Public License 10 * modify it under the terms of the GNU General Public License
11 * as published by the Free Software Foundation; either version 11 * as published by the Free Software Foundation; either version
@@ -60,7 +60,6 @@ struct cpu_spec cpu_specs[] = {
60 .icache_bsize = 128, 60 .icache_bsize = 128,
61 .dcache_bsize = 128, 61 .dcache_bsize = 128,
62 .cpu_setup = __setup_cpu_power3, 62 .cpu_setup = __setup_cpu_power3,
63 .firmware_features = COMMON_PPC64_FW,
64 }, 63 },
65 { /* Power3+ */ 64 { /* Power3+ */
66 .pvr_mask = 0xffff0000, 65 .pvr_mask = 0xffff0000,
@@ -73,7 +72,6 @@ struct cpu_spec cpu_specs[] = {
73 .icache_bsize = 128, 72 .icache_bsize = 128,
74 .dcache_bsize = 128, 73 .dcache_bsize = 128,
75 .cpu_setup = __setup_cpu_power3, 74 .cpu_setup = __setup_cpu_power3,
76 .firmware_features = COMMON_PPC64_FW,
77 }, 75 },
78 { /* Northstar */ 76 { /* Northstar */
79 .pvr_mask = 0xffff0000, 77 .pvr_mask = 0xffff0000,
@@ -86,7 +84,6 @@ struct cpu_spec cpu_specs[] = {
86 .icache_bsize = 128, 84 .icache_bsize = 128,
87 .dcache_bsize = 128, 85 .dcache_bsize = 128,
88 .cpu_setup = __setup_cpu_power3, 86 .cpu_setup = __setup_cpu_power3,
89 .firmware_features = COMMON_PPC64_FW,
90 }, 87 },
91 { /* Pulsar */ 88 { /* Pulsar */
92 .pvr_mask = 0xffff0000, 89 .pvr_mask = 0xffff0000,
@@ -99,7 +96,6 @@ struct cpu_spec cpu_specs[] = {
99 .icache_bsize = 128, 96 .icache_bsize = 128,
100 .dcache_bsize = 128, 97 .dcache_bsize = 128,
101 .cpu_setup = __setup_cpu_power3, 98 .cpu_setup = __setup_cpu_power3,
102 .firmware_features = COMMON_PPC64_FW,
103 }, 99 },
104 { /* I-star */ 100 { /* I-star */
105 .pvr_mask = 0xffff0000, 101 .pvr_mask = 0xffff0000,
@@ -112,7 +108,6 @@ struct cpu_spec cpu_specs[] = {
112 .icache_bsize = 128, 108 .icache_bsize = 128,
113 .dcache_bsize = 128, 109 .dcache_bsize = 128,
114 .cpu_setup = __setup_cpu_power3, 110 .cpu_setup = __setup_cpu_power3,
115 .firmware_features = COMMON_PPC64_FW,
116 }, 111 },
117 { /* S-star */ 112 { /* S-star */
118 .pvr_mask = 0xffff0000, 113 .pvr_mask = 0xffff0000,
@@ -125,7 +120,6 @@ struct cpu_spec cpu_specs[] = {
125 .icache_bsize = 128, 120 .icache_bsize = 128,
126 .dcache_bsize = 128, 121 .dcache_bsize = 128,
127 .cpu_setup = __setup_cpu_power3, 122 .cpu_setup = __setup_cpu_power3,
128 .firmware_features = COMMON_PPC64_FW,
129 }, 123 },
130 { /* Power4 */ 124 { /* Power4 */
131 .pvr_mask = 0xffff0000, 125 .pvr_mask = 0xffff0000,
@@ -138,7 +132,6 @@ struct cpu_spec cpu_specs[] = {
138 .icache_bsize = 128, 132 .icache_bsize = 128,
139 .dcache_bsize = 128, 133 .dcache_bsize = 128,
140 .cpu_setup = __setup_cpu_power4, 134 .cpu_setup = __setup_cpu_power4,
141 .firmware_features = COMMON_PPC64_FW,
142 }, 135 },
143 { /* Power4+ */ 136 { /* Power4+ */
144 .pvr_mask = 0xffff0000, 137 .pvr_mask = 0xffff0000,
@@ -151,7 +144,6 @@ struct cpu_spec cpu_specs[] = {
151 .icache_bsize = 128, 144 .icache_bsize = 128,
152 .dcache_bsize = 128, 145 .dcache_bsize = 128,
153 .cpu_setup = __setup_cpu_power4, 146 .cpu_setup = __setup_cpu_power4,
154 .firmware_features = COMMON_PPC64_FW,
155 }, 147 },
156 { /* PPC970 */ 148 { /* PPC970 */
157 .pvr_mask = 0xffff0000, 149 .pvr_mask = 0xffff0000,
@@ -166,7 +158,6 @@ struct cpu_spec cpu_specs[] = {
166 .icache_bsize = 128, 158 .icache_bsize = 128,
167 .dcache_bsize = 128, 159 .dcache_bsize = 128,
168 .cpu_setup = __setup_cpu_ppc970, 160 .cpu_setup = __setup_cpu_ppc970,
169 .firmware_features = COMMON_PPC64_FW,
170 }, 161 },
171 { /* PPC970FX */ 162 { /* PPC970FX */
172 .pvr_mask = 0xffff0000, 163 .pvr_mask = 0xffff0000,
@@ -181,7 +172,20 @@ struct cpu_spec cpu_specs[] = {
181 .icache_bsize = 128, 172 .icache_bsize = 128,
182 .dcache_bsize = 128, 173 .dcache_bsize = 128,
183 .cpu_setup = __setup_cpu_ppc970, 174 .cpu_setup = __setup_cpu_ppc970,
184 .firmware_features = COMMON_PPC64_FW, 175 },
176 { /* PPC970MP */
177 .pvr_mask = 0xffff0000,
178 .pvr_value = 0x00440000,
179 .cpu_name = "PPC970MP",
180 .cpu_features = CPU_FTR_SPLIT_ID_CACHE |
181 CPU_FTR_USE_TB | CPU_FTR_HPTE_TABLE |
182 CPU_FTR_PPCAS_ARCH_V2 | CPU_FTR_ALTIVEC_COMP |
183 CPU_FTR_CAN_NAP | CPU_FTR_PMC8 | CPU_FTR_MMCRA,
184 .cpu_user_features = COMMON_USER_PPC64 |
185 PPC_FEATURE_HAS_ALTIVEC_COMP,
186 .icache_bsize = 128,
187 .dcache_bsize = 128,
188 .cpu_setup = __setup_cpu_ppc970,
185 }, 189 },
186 { /* Power5 */ 190 { /* Power5 */
187 .pvr_mask = 0xffff0000, 191 .pvr_mask = 0xffff0000,
@@ -196,7 +200,6 @@ struct cpu_spec cpu_specs[] = {
196 .icache_bsize = 128, 200 .icache_bsize = 128,
197 .dcache_bsize = 128, 201 .dcache_bsize = 128,
198 .cpu_setup = __setup_cpu_power4, 202 .cpu_setup = __setup_cpu_power4,
199 .firmware_features = COMMON_PPC64_FW,
200 }, 203 },
201 { /* Power5 */ 204 { /* Power5 */
202 .pvr_mask = 0xffff0000, 205 .pvr_mask = 0xffff0000,
@@ -211,7 +214,6 @@ struct cpu_spec cpu_specs[] = {
211 .icache_bsize = 128, 214 .icache_bsize = 128,
212 .dcache_bsize = 128, 215 .dcache_bsize = 128,
213 .cpu_setup = __setup_cpu_power4, 216 .cpu_setup = __setup_cpu_power4,
214 .firmware_features = COMMON_PPC64_FW,
215 }, 217 },
216 { /* BE DD1.x */ 218 { /* BE DD1.x */
217 .pvr_mask = 0xffff0000, 219 .pvr_mask = 0xffff0000,
@@ -226,7 +228,6 @@ struct cpu_spec cpu_specs[] = {
226 .icache_bsize = 128, 228 .icache_bsize = 128,
227 .dcache_bsize = 128, 229 .dcache_bsize = 128,
228 .cpu_setup = __setup_cpu_be, 230 .cpu_setup = __setup_cpu_be,
229 .firmware_features = COMMON_PPC64_FW,
230 }, 231 },
231 { /* default match */ 232 { /* default match */
232 .pvr_mask = 0x00000000, 233 .pvr_mask = 0x00000000,
@@ -239,29 +240,5 @@ struct cpu_spec cpu_specs[] = {
239 .icache_bsize = 128, 240 .icache_bsize = 128,
240 .dcache_bsize = 128, 241 .dcache_bsize = 128,
241 .cpu_setup = __setup_cpu_power4, 242 .cpu_setup = __setup_cpu_power4,
242 .firmware_features = COMMON_PPC64_FW,
243 } 243 }
244}; 244};
245
246firmware_feature_t firmware_features_table[FIRMWARE_MAX_FEATURES] = {
247 {FW_FEATURE_PFT, "hcall-pft"},
248 {FW_FEATURE_TCE, "hcall-tce"},
249 {FW_FEATURE_SPRG0, "hcall-sprg0"},
250 {FW_FEATURE_DABR, "hcall-dabr"},
251 {FW_FEATURE_COPY, "hcall-copy"},
252 {FW_FEATURE_ASR, "hcall-asr"},
253 {FW_FEATURE_DEBUG, "hcall-debug"},
254 {FW_FEATURE_PERF, "hcall-perf"},
255 {FW_FEATURE_DUMP, "hcall-dump"},
256 {FW_FEATURE_INTERRUPT, "hcall-interrupt"},
257 {FW_FEATURE_MIGRATE, "hcall-migrate"},
258 {FW_FEATURE_PERFMON, "hcall-perfmon"},
259 {FW_FEATURE_CRQ, "hcall-crq"},
260 {FW_FEATURE_VIO, "hcall-vio"},
261 {FW_FEATURE_RDMA, "hcall-rdma"},
262 {FW_FEATURE_LLAN, "hcall-lLAN"},
263 {FW_FEATURE_BULK, "hcall-bulk"},
264 {FW_FEATURE_XDABR, "hcall-xdabr"},
265 {FW_FEATURE_MULTITCE, "hcall-multi-tce"},
266 {FW_FEATURE_SPLPAR, "hcall-splpar"},
267};
diff --git a/arch/ppc64/kernel/firmware.c b/arch/ppc64/kernel/firmware.c
new file mode 100644
index 000000000000..d8432c0fb27d
--- /dev/null
+++ b/arch/ppc64/kernel/firmware.c
@@ -0,0 +1,47 @@
1/*
2 * arch/ppc64/kernel/firmware.c
3 *
4 * Extracted from cputable.c
5 *
6 * Copyright (C) 2001 Ben. Herrenschmidt (benh@kernel.crashing.org)
7 *
8 * Modifications for ppc64:
9 * Copyright (C) 2003 Dave Engebretsen <engebret@us.ibm.com>
10 * Copyright (C) 2005 Stephen Rothwell, IBM Corporation
11 *
12 * This program is free software; you can redistribute it and/or
13 * modify it under the terms of the GNU General Public License
14 * as published by the Free Software Foundation; either version
15 * 2 of the License, or (at your option) any later version.
16 */
17
18#include <linux/config.h>
19
20#include <asm/firmware.h>
21
22unsigned long ppc64_firmware_features;
23
24#ifdef CONFIG_PPC_PSERIES
25firmware_feature_t firmware_features_table[FIRMWARE_MAX_FEATURES] = {
26 {FW_FEATURE_PFT, "hcall-pft"},
27 {FW_FEATURE_TCE, "hcall-tce"},
28 {FW_FEATURE_SPRG0, "hcall-sprg0"},
29 {FW_FEATURE_DABR, "hcall-dabr"},
30 {FW_FEATURE_COPY, "hcall-copy"},
31 {FW_FEATURE_ASR, "hcall-asr"},
32 {FW_FEATURE_DEBUG, "hcall-debug"},
33 {FW_FEATURE_PERF, "hcall-perf"},
34 {FW_FEATURE_DUMP, "hcall-dump"},
35 {FW_FEATURE_INTERRUPT, "hcall-interrupt"},
36 {FW_FEATURE_MIGRATE, "hcall-migrate"},
37 {FW_FEATURE_PERFMON, "hcall-perfmon"},
38 {FW_FEATURE_CRQ, "hcall-crq"},
39 {FW_FEATURE_VIO, "hcall-vio"},
40 {FW_FEATURE_RDMA, "hcall-rdma"},
41 {FW_FEATURE_LLAN, "hcall-lLAN"},
42 {FW_FEATURE_BULK, "hcall-bulk"},
43 {FW_FEATURE_XDABR, "hcall-xdabr"},
44 {FW_FEATURE_MULTITCE, "hcall-multi-tce"},
45 {FW_FEATURE_SPLPAR, "hcall-splpar"},
46};
47#endif
diff --git a/arch/ppc64/kernel/head.S b/arch/ppc64/kernel/head.S
index 93ebcac0d5a2..036959775623 100644
--- a/arch/ppc64/kernel/head.S
+++ b/arch/ppc64/kernel/head.S
@@ -23,14 +23,11 @@
23 * 2 of the License, or (at your option) any later version. 23 * 2 of the License, or (at your option) any later version.
24 */ 24 */
25 25
26#define SECONDARY_PROCESSORS
27
28#include <linux/config.h> 26#include <linux/config.h>
29#include <linux/threads.h> 27#include <linux/threads.h>
30#include <asm/processor.h> 28#include <asm/processor.h>
31#include <asm/page.h> 29#include <asm/page.h>
32#include <asm/mmu.h> 30#include <asm/mmu.h>
33#include <asm/naca.h>
34#include <asm/systemcfg.h> 31#include <asm/systemcfg.h>
35#include <asm/ppc_asm.h> 32#include <asm/ppc_asm.h>
36#include <asm/offsets.h> 33#include <asm/offsets.h>
@@ -38,24 +35,20 @@
38#include <asm/cputable.h> 35#include <asm/cputable.h>
39#include <asm/setup.h> 36#include <asm/setup.h>
40#include <asm/hvcall.h> 37#include <asm/hvcall.h>
38#include <asm/iSeries/LparMap.h>
41 39
42#ifdef CONFIG_PPC_ISERIES 40#ifdef CONFIG_PPC_ISERIES
43#define DO_SOFT_DISABLE 41#define DO_SOFT_DISABLE
44#endif 42#endif
45 43
46/* 44/*
47 * hcall interface to pSeries LPAR
48 */
49#define H_SET_ASR 0x30
50
51/*
52 * We layout physical memory as follows: 45 * We layout physical memory as follows:
53 * 0x0000 - 0x00ff : Secondary processor spin code 46 * 0x0000 - 0x00ff : Secondary processor spin code
54 * 0x0100 - 0x2fff : pSeries Interrupt prologs 47 * 0x0100 - 0x2fff : pSeries Interrupt prologs
55 * 0x3000 - 0x3fff : Interrupt support 48 * 0x3000 - 0x5fff : interrupt support, iSeries and common interrupt prologs
56 * 0x4000 - 0x4fff : NACA 49 * 0x6000 - 0x6fff : Initial (CPU0) segment table
57 * 0x6000 : iSeries and common interrupt prologs 50 * 0x7000 - 0x7fff : FWNMI data area
58 * 0x9000 - 0x9fff : Initial segment table 51 * 0x8000 - : Early init and support code
59 */ 52 */
60 53
61/* 54/*
@@ -93,6 +86,7 @@ END_FTR_SECTION(0, 1)
93 86
94 /* Catch branch to 0 in real mode */ 87 /* Catch branch to 0 in real mode */
95 trap 88 trap
89
96#ifdef CONFIG_PPC_ISERIES 90#ifdef CONFIG_PPC_ISERIES
97 /* 91 /*
98 * At offset 0x20, there is a pointer to iSeries LPAR data. 92 * At offset 0x20, there is a pointer to iSeries LPAR data.
@@ -102,12 +96,12 @@ END_FTR_SECTION(0, 1)
102 .llong hvReleaseData-KERNELBASE 96 .llong hvReleaseData-KERNELBASE
103 97
104 /* 98 /*
105 * At offset 0x28 and 0x30 are offsets to the msChunks 99 * At offset 0x28 and 0x30 are offsets to the mschunks_map
106 * array (used by the iSeries LPAR debugger to do translation 100 * array (used by the iSeries LPAR debugger to do translation
107 * between physical addresses and absolute addresses) and 101 * between physical addresses and absolute addresses) and
108 * to the pidhash table (also used by the debugger) 102 * to the pidhash table (also used by the debugger)
109 */ 103 */
110 .llong msChunks-KERNELBASE 104 .llong mschunks_map-KERNELBASE
111 .llong 0 /* pidhash-KERNELBASE SFRXXX */ 105 .llong 0 /* pidhash-KERNELBASE SFRXXX */
112 106
113 /* Offset 0x38 - Pointer to start of embedded System.map */ 107 /* Offset 0x38 - Pointer to start of embedded System.map */
@@ -119,7 +113,7 @@ embedded_sysmap_start:
119embedded_sysmap_end: 113embedded_sysmap_end:
120 .llong 0 114 .llong 0
121 115
122#else /* CONFIG_PPC_ISERIES */ 116#endif /* CONFIG_PPC_ISERIES */
123 117
124 /* Secondary processors spin on this value until it goes to 1. */ 118 /* Secondary processors spin on this value until it goes to 1. */
125 .globl __secondary_hold_spinloop 119 .globl __secondary_hold_spinloop
@@ -154,7 +148,7 @@ _GLOBAL(__secondary_hold)
154 std r24,__secondary_hold_acknowledge@l(0) 148 std r24,__secondary_hold_acknowledge@l(0)
155 sync 149 sync
156 150
157 /* All secondary cpu's wait here until told to start. */ 151 /* All secondary cpus wait here until told to start. */
158100: ld r4,__secondary_hold_spinloop@l(0) 152100: ld r4,__secondary_hold_spinloop@l(0)
159 cmpdi 0,r4,1 153 cmpdi 0,r4,1
160 bne 100b 154 bne 100b
@@ -169,7 +163,6 @@ _GLOBAL(__secondary_hold)
169 BUG_OPCODE 163 BUG_OPCODE
170#endif 164#endif
171#endif 165#endif
172#endif
173 166
174/* This value is used to mark exception frames on the stack. */ 167/* This value is used to mark exception frames on the stack. */
175 .section ".toc","aw" 168 .section ".toc","aw"
@@ -501,60 +494,37 @@ system_call_pSeries:
501 STD_EXCEPTION_PSERIES(0x1300, instruction_breakpoint) 494 STD_EXCEPTION_PSERIES(0x1300, instruction_breakpoint)
502 STD_EXCEPTION_PSERIES(0x1700, altivec_assist) 495 STD_EXCEPTION_PSERIES(0x1700, altivec_assist)
503 496
497 . = 0x3000
498
499/*** pSeries interrupt support ***/
500
504 /* moved from 0xf00 */ 501 /* moved from 0xf00 */
505 STD_EXCEPTION_PSERIES(0x3000, performance_monitor) 502 STD_EXCEPTION_PSERIES(., performance_monitor)
506 503
507 . = 0x3100 504 .align 7
508_GLOBAL(do_stab_bolted_pSeries) 505_GLOBAL(do_stab_bolted_pSeries)
509 mtcrf 0x80,r12 506 mtcrf 0x80,r12
510 mfspr r12,SPRG2 507 mfspr r12,SPRG2
511 EXCEPTION_PROLOG_PSERIES(PACA_EXSLB, .do_stab_bolted) 508 EXCEPTION_PROLOG_PSERIES(PACA_EXSLB, .do_stab_bolted)
512 509
513 510/*
514 /* Space for the naca. Architected to be located at real address 511 * Vectors for the FWNMI option. Share common code.
515 * NACA_PHYS_ADDR. Various tools rely on this location being fixed. 512 */
516 * The first dword of the naca is required by iSeries LPAR to 513 .globl system_reset_fwnmi
517 * point to itVpdAreas. On pSeries native, this value is not used. 514system_reset_fwnmi:
518 */ 515 HMT_MEDIUM
519 . = NACA_PHYS_ADDR 516 mtspr SPRG1,r13 /* save r13 */
520 .globl __end_interrupts 517 RUNLATCH_ON(r13)
521__end_interrupts: 518 EXCEPTION_PROLOG_PSERIES(PACA_EXGEN, system_reset_common)
522#ifdef CONFIG_PPC_ISERIES
523 .globl naca
524naca:
525 .llong itVpdAreas
526
527 /*
528 * The iSeries LPAR map is at this fixed address
529 * so that the HvReleaseData structure can address
530 * it with a 32-bit offset.
531 *
532 * The VSID values below are dependent on the
533 * VSID generation algorithm. See include/asm/mmu_context.h.
534 */
535 519
536 . = 0x4800 520 .globl machine_check_fwnmi
537 521machine_check_fwnmi:
538 .llong 2 /* # ESIDs to be mapped by hypervisor */ 522 HMT_MEDIUM
539 .llong 1 /* # memory ranges to be mapped by hypervisor */ 523 mtspr SPRG1,r13 /* save r13 */
540 .llong STAB0_PAGE /* Page # of segment table within load area */ 524 RUNLATCH_ON(r13)
541 .llong 0 /* Reserved */ 525 EXCEPTION_PROLOG_PSERIES(PACA_EXMC, machine_check_common)
542 .llong 0 /* Reserved */
543 .llong 0 /* Reserved */
544 .llong 0 /* Reserved */
545 .llong 0 /* Reserved */
546 .llong (KERNELBASE>>SID_SHIFT)
547 .llong 0x408f92c94 /* KERNELBASE VSID */
548 /* We have to list the bolted VMALLOC segment here, too, so that it
549 * will be restored on shared processor switch */
550 .llong (VMALLOCBASE>>SID_SHIFT)
551 .llong 0xf09b89af5 /* VMALLOCBASE VSID */
552 .llong 8192 /* # pages to map (32 MB) */
553 .llong 0 /* Offset from start of loadarea to start of map */
554 .llong 0x408f92c940000 /* VPN of first page to map */
555
556 . = 0x6100
557 526
527#ifdef CONFIG_PPC_ISERIES
558/*** ISeries-LPAR interrupt handlers ***/ 528/*** ISeries-LPAR interrupt handlers ***/
559 529
560 STD_EXCEPTION_ISERIES(0x200, machine_check, PACA_EXMC) 530 STD_EXCEPTION_ISERIES(0x200, machine_check, PACA_EXMC)
@@ -652,9 +622,7 @@ system_reset_iSeries:
652 622
653 cmpwi 0,r23,0 623 cmpwi 0,r23,0
654 beq iSeries_secondary_smp_loop /* Loop until told to go */ 624 beq iSeries_secondary_smp_loop /* Loop until told to go */
655#ifdef SECONDARY_PROCESSORS
656 bne .__secondary_start /* Loop until told to go */ 625 bne .__secondary_start /* Loop until told to go */
657#endif
658iSeries_secondary_smp_loop: 626iSeries_secondary_smp_loop:
659 /* Let the Hypervisor know we are alive */ 627 /* Let the Hypervisor know we are alive */
660 /* 8002 is a call to HvCallCfg::getLps, a harmless Hypervisor function */ 628 /* 8002 is a call to HvCallCfg::getLps, a harmless Hypervisor function */
@@ -697,45 +665,7 @@ hardware_interrupt_iSeries_masked:
697 ld r13,PACA_EXGEN+EX_R13(r13) 665 ld r13,PACA_EXGEN+EX_R13(r13)
698 rfid 666 rfid
699 b . /* prevent speculative execution */ 667 b . /* prevent speculative execution */
700#endif 668#endif /* CONFIG_PPC_ISERIES */
701
702/*
703 * Data area reserved for FWNMI option.
704 */
705 .= 0x7000
706 .globl fwnmi_data_area
707fwnmi_data_area:
708
709/*
710 * Vectors for the FWNMI option. Share common code.
711 */
712 . = 0x8000
713 .globl system_reset_fwnmi
714system_reset_fwnmi:
715 HMT_MEDIUM
716 mtspr SPRG1,r13 /* save r13 */
717 RUNLATCH_ON(r13)
718 EXCEPTION_PROLOG_PSERIES(PACA_EXGEN, system_reset_common)
719 .globl machine_check_fwnmi
720machine_check_fwnmi:
721 HMT_MEDIUM
722 mtspr SPRG1,r13 /* save r13 */
723 RUNLATCH_ON(r13)
724 EXCEPTION_PROLOG_PSERIES(PACA_EXMC, machine_check_common)
725
726 /*
727 * Space for the initial segment table
728 * For LPAR, the hypervisor must fill in at least one entry
729 * before we get control (with relocate on)
730 */
731 . = STAB0_PHYS_ADDR
732 .globl __start_stab
733__start_stab:
734
735 . = (STAB0_PHYS_ADDR + PAGE_SIZE)
736 .globl __end_stab
737__end_stab:
738
739 669
740/*** Common interrupt handlers ***/ 670/*** Common interrupt handlers ***/
741 671
@@ -773,8 +703,8 @@ machine_check_common:
773 * R9 contains the saved CR, r13 points to the paca, 703 * R9 contains the saved CR, r13 points to the paca,
774 * r10 contains the (bad) kernel stack pointer, 704 * r10 contains the (bad) kernel stack pointer,
775 * r11 and r12 contain the saved SRR0 and SRR1. 705 * r11 and r12 contain the saved SRR0 and SRR1.
776 * We switch to using the paca guard page as an emergency stack, 706 * We switch to using an emergency stack, save the registers there,
777 * save the registers there, and call kernel_bad_stack(), which panics. 707 * and call kernel_bad_stack(), which panics.
778 */ 708 */
779bad_stack: 709bad_stack:
780 ld r1,PACAEMERGSP(r13) 710 ld r1,PACAEMERGSP(r13)
@@ -927,6 +857,62 @@ fp_unavailable_common:
927 bl .kernel_fp_unavailable_exception 857 bl .kernel_fp_unavailable_exception
928 BUG_OPCODE 858 BUG_OPCODE
929 859
860/*
861 * load_up_fpu(unused, unused, tsk)
862 * Disable FP for the task which had the FPU previously,
863 * and save its floating-point registers in its thread_struct.
864 * Enables the FPU for use in the kernel on return.
865 * On SMP we know the fpu is free, since we give it up every
866 * switch (ie, no lazy save of the FP registers).
867 * On entry: r13 == 'current' && last_task_used_math != 'current'
868 */
869_STATIC(load_up_fpu)
870 mfmsr r5 /* grab the current MSR */
871 ori r5,r5,MSR_FP
872 mtmsrd r5 /* enable use of fpu now */
873 isync
874/*
875 * For SMP, we don't do lazy FPU switching because it just gets too
876 * horrendously complex, especially when a task switches from one CPU
877 * to another. Instead we call giveup_fpu in switch_to.
878 *
879 */
880#ifndef CONFIG_SMP
881 ld r3,last_task_used_math@got(r2)
882 ld r4,0(r3)
883 cmpdi 0,r4,0
884 beq 1f
885 /* Save FP state to last_task_used_math's THREAD struct */
886 addi r4,r4,THREAD
887 SAVE_32FPRS(0, r4)
888 mffs fr0
889 stfd fr0,THREAD_FPSCR(r4)
890 /* Disable FP for last_task_used_math */
891 ld r5,PT_REGS(r4)
892 ld r4,_MSR-STACK_FRAME_OVERHEAD(r5)
893 li r6,MSR_FP|MSR_FE0|MSR_FE1
894 andc r4,r4,r6
895 std r4,_MSR-STACK_FRAME_OVERHEAD(r5)
8961:
897#endif /* CONFIG_SMP */
898 /* enable use of FP after return */
899 ld r4,PACACURRENT(r13)
900 addi r5,r4,THREAD /* Get THREAD */
901 ld r4,THREAD_FPEXC_MODE(r5)
902 ori r12,r12,MSR_FP
903 or r12,r12,r4
904 std r12,_MSR(r1)
905 lfd fr0,THREAD_FPSCR(r5)
906 mtfsf 0xff,fr0
907 REST_32FPRS(0, r5)
908#ifndef CONFIG_SMP
909 /* Update last_task_used_math to 'current' */
910 subi r4,r5,THREAD /* Back to 'current' */
911 std r4,0(r3)
912#endif /* CONFIG_SMP */
913 /* restore registers and return */
914 b fast_exception_return
915
930 .align 7 916 .align 7
931 .globl altivec_unavailable_common 917 .globl altivec_unavailable_common
932altivec_unavailable_common: 918altivec_unavailable_common:
@@ -942,6 +928,80 @@ END_FTR_SECTION_IFSET(CPU_FTR_ALTIVEC)
942 bl .altivec_unavailable_exception 928 bl .altivec_unavailable_exception
943 b .ret_from_except 929 b .ret_from_except
944 930
931#ifdef CONFIG_ALTIVEC
932/*
933 * load_up_altivec(unused, unused, tsk)
934 * Disable VMX for the task which had it previously,
935 * and save its vector registers in its thread_struct.
936 * Enables the VMX for use in the kernel on return.
937 * On SMP we know the VMX is free, since we give it up every
938 * switch (ie, no lazy save of the vector registers).
939 * On entry: r13 == 'current' && last_task_used_altivec != 'current'
940 */
941_STATIC(load_up_altivec)
942 mfmsr r5 /* grab the current MSR */
943 oris r5,r5,MSR_VEC@h
944 mtmsrd r5 /* enable use of VMX now */
945 isync
946
947/*
948 * For SMP, we don't do lazy VMX switching because it just gets too
949 * horrendously complex, especially when a task switches from one CPU
950 * to another. Instead we call giveup_altvec in switch_to.
951 * VRSAVE isn't dealt with here, that is done in the normal context
952 * switch code. Note that we could rely on vrsave value to eventually
953 * avoid saving all of the VREGs here...
954 */
955#ifndef CONFIG_SMP
956 ld r3,last_task_used_altivec@got(r2)
957 ld r4,0(r3)
958 cmpdi 0,r4,0
959 beq 1f
960 /* Save VMX state to last_task_used_altivec's THREAD struct */
961 addi r4,r4,THREAD
962 SAVE_32VRS(0,r5,r4)
963 mfvscr vr0
964 li r10,THREAD_VSCR
965 stvx vr0,r10,r4
966 /* Disable VMX for last_task_used_altivec */
967 ld r5,PT_REGS(r4)
968 ld r4,_MSR-STACK_FRAME_OVERHEAD(r5)
969 lis r6,MSR_VEC@h
970 andc r4,r4,r6
971 std r4,_MSR-STACK_FRAME_OVERHEAD(r5)
9721:
973#endif /* CONFIG_SMP */
974 /* Hack: if we get an altivec unavailable trap with VRSAVE
975 * set to all zeros, we assume this is a broken application
976 * that fails to set it properly, and thus we switch it to
977 * all 1's
978 */
979 mfspr r4,SPRN_VRSAVE
980 cmpdi 0,r4,0
981 bne+ 1f
982 li r4,-1
983 mtspr SPRN_VRSAVE,r4
9841:
985 /* enable use of VMX after return */
986 ld r4,PACACURRENT(r13)
987 addi r5,r4,THREAD /* Get THREAD */
988 oris r12,r12,MSR_VEC@h
989 std r12,_MSR(r1)
990 li r4,1
991 li r10,THREAD_VSCR
992 stw r4,THREAD_USED_VR(r5)
993 lvx vr0,r10,r5
994 mtvscr vr0
995 REST_32VRS(0,r4,r5)
996#ifndef CONFIG_SMP
997 /* Update last_task_used_math to 'current' */
998 subi r4,r5,THREAD /* Back to 'current' */
999 std r4,0(r3)
1000#endif /* CONFIG_SMP */
1001 /* restore registers and return */
1002 b fast_exception_return
1003#endif /* CONFIG_ALTIVEC */
1004
945/* 1005/*
946 * Hash table stuff 1006 * Hash table stuff
947 */ 1007 */
@@ -1188,6 +1248,42 @@ unrecov_slb:
1188 bl .unrecoverable_exception 1248 bl .unrecoverable_exception
1189 b 1b 1249 b 1b
1190 1250
1251/*
1252 * Space for CPU0's segment table.
1253 *
1254 * On iSeries, the hypervisor must fill in at least one entry before
1255 * we get control (with relocate on). The address is give to the hv
1256 * as a page number (see xLparMap in LparData.c), so this must be at a
1257 * fixed address (the linker can't compute (u64)&initial_stab >>
1258 * PAGE_SHIFT).
1259 */
1260 . = STAB0_PHYS_ADDR /* 0x6000 */
1261 .globl initial_stab
1262initial_stab:
1263 .space 4096
1264
1265/*
1266 * Data area reserved for FWNMI option.
1267 * This address (0x7000) is fixed by the RPA.
1268 */
1269 .= 0x7000
1270 .globl fwnmi_data_area
1271fwnmi_data_area:
1272
1273 /* iSeries does not use the FWNMI stuff, so it is safe to put
1274 * this here, even if we later allow kernels that will boot on
1275 * both pSeries and iSeries */
1276#ifdef CONFIG_PPC_ISERIES
1277 . = LPARMAP_PHYS
1278#include "lparmap.s"
1279/*
1280 * This ".text" is here for old compilers that generate a trailing
1281 * .note section when compiling .c files to .s
1282 */
1283 .text
1284#endif /* CONFIG_PPC_ISERIES */
1285
1286 . = 0x8000
1191 1287
1192/* 1288/*
1193 * On pSeries, secondary processors spin in the following code. 1289 * On pSeries, secondary processors spin in the following code.
@@ -1221,7 +1317,7 @@ _GLOBAL(pSeries_secondary_smp_init)
1221 b .kexec_wait /* next kernel might do better */ 1317 b .kexec_wait /* next kernel might do better */
1222 1318
12232: mtspr SPRG3,r13 /* Save vaddr of paca in SPRG3 */ 13192: mtspr SPRG3,r13 /* Save vaddr of paca in SPRG3 */
1224 /* From now on, r24 is expected to be logica cpuid */ 1320 /* From now on, r24 is expected to be logical cpuid */
1225 mr r24,r5 1321 mr r24,r5
12263: HMT_LOW 13223: HMT_LOW
1227 lbz r23,PACAPROCSTART(r13) /* Test if this processor should */ 1323 lbz r23,PACAPROCSTART(r13) /* Test if this processor should */
@@ -1234,10 +1330,8 @@ _GLOBAL(pSeries_secondary_smp_init)
1234 1330
1235 cmpwi 0,r23,0 1331 cmpwi 0,r23,0
1236#ifdef CONFIG_SMP 1332#ifdef CONFIG_SMP
1237#ifdef SECONDARY_PROCESSORS
1238 bne .__secondary_start 1333 bne .__secondary_start
1239#endif 1334#endif
1240#endif
1241 b 3b /* Loop until told to go */ 1335 b 3b /* Loop until told to go */
1242 1336
1243#ifdef CONFIG_PPC_ISERIES 1337#ifdef CONFIG_PPC_ISERIES
@@ -1451,228 +1545,6 @@ _GLOBAL(copy_and_flush)
1451.align 8 1545.align 8
1452copy_to_here: 1546copy_to_here:
1453 1547
1454/*
1455 * load_up_fpu(unused, unused, tsk)
1456 * Disable FP for the task which had the FPU previously,
1457 * and save its floating-point registers in its thread_struct.
1458 * Enables the FPU for use in the kernel on return.
1459 * On SMP we know the fpu is free, since we give it up every
1460 * switch (ie, no lazy save of the FP registers).
1461 * On entry: r13 == 'current' && last_task_used_math != 'current'
1462 */
1463_STATIC(load_up_fpu)
1464 mfmsr r5 /* grab the current MSR */
1465 ori r5,r5,MSR_FP
1466 mtmsrd r5 /* enable use of fpu now */
1467 isync
1468/*
1469 * For SMP, we don't do lazy FPU switching because it just gets too
1470 * horrendously complex, especially when a task switches from one CPU
1471 * to another. Instead we call giveup_fpu in switch_to.
1472 *
1473 */
1474#ifndef CONFIG_SMP
1475 ld r3,last_task_used_math@got(r2)
1476 ld r4,0(r3)
1477 cmpdi 0,r4,0
1478 beq 1f
1479 /* Save FP state to last_task_used_math's THREAD struct */
1480 addi r4,r4,THREAD
1481 SAVE_32FPRS(0, r4)
1482 mffs fr0
1483 stfd fr0,THREAD_FPSCR(r4)
1484 /* Disable FP for last_task_used_math */
1485 ld r5,PT_REGS(r4)
1486 ld r4,_MSR-STACK_FRAME_OVERHEAD(r5)
1487 li r6,MSR_FP|MSR_FE0|MSR_FE1
1488 andc r4,r4,r6
1489 std r4,_MSR-STACK_FRAME_OVERHEAD(r5)
14901:
1491#endif /* CONFIG_SMP */
1492 /* enable use of FP after return */
1493 ld r4,PACACURRENT(r13)
1494 addi r5,r4,THREAD /* Get THREAD */
1495 ld r4,THREAD_FPEXC_MODE(r5)
1496 ori r12,r12,MSR_FP
1497 or r12,r12,r4
1498 std r12,_MSR(r1)
1499 lfd fr0,THREAD_FPSCR(r5)
1500 mtfsf 0xff,fr0
1501 REST_32FPRS(0, r5)
1502#ifndef CONFIG_SMP
1503 /* Update last_task_used_math to 'current' */
1504 subi r4,r5,THREAD /* Back to 'current' */
1505 std r4,0(r3)
1506#endif /* CONFIG_SMP */
1507 /* restore registers and return */
1508 b fast_exception_return
1509
1510/*
1511 * disable_kernel_fp()
1512 * Disable the FPU.
1513 */
1514_GLOBAL(disable_kernel_fp)
1515 mfmsr r3
1516 rldicl r0,r3,(63-MSR_FP_LG),1
1517 rldicl r3,r0,(MSR_FP_LG+1),0
1518 mtmsrd r3 /* disable use of fpu now */
1519 isync
1520 blr
1521
1522/*
1523 * giveup_fpu(tsk)
1524 * Disable FP for the task given as the argument,
1525 * and save the floating-point registers in its thread_struct.
1526 * Enables the FPU for use in the kernel on return.
1527 */
1528_GLOBAL(giveup_fpu)
1529 mfmsr r5
1530 ori r5,r5,MSR_FP
1531 mtmsrd r5 /* enable use of fpu now */
1532 isync
1533 cmpdi 0,r3,0
1534 beqlr- /* if no previous owner, done */
1535 addi r3,r3,THREAD /* want THREAD of task */
1536 ld r5,PT_REGS(r3)
1537 cmpdi 0,r5,0
1538 SAVE_32FPRS(0, r3)
1539 mffs fr0
1540 stfd fr0,THREAD_FPSCR(r3)
1541 beq 1f
1542 ld r4,_MSR-STACK_FRAME_OVERHEAD(r5)
1543 li r3,MSR_FP|MSR_FE0|MSR_FE1
1544 andc r4,r4,r3 /* disable FP for previous task */
1545 std r4,_MSR-STACK_FRAME_OVERHEAD(r5)
15461:
1547#ifndef CONFIG_SMP
1548 li r5,0
1549 ld r4,last_task_used_math@got(r2)
1550 std r5,0(r4)
1551#endif /* CONFIG_SMP */
1552 blr
1553
1554
1555#ifdef CONFIG_ALTIVEC
1556
1557/*
1558 * load_up_altivec(unused, unused, tsk)
1559 * Disable VMX for the task which had it previously,
1560 * and save its vector registers in its thread_struct.
1561 * Enables the VMX for use in the kernel on return.
1562 * On SMP we know the VMX is free, since we give it up every
1563 * switch (ie, no lazy save of the vector registers).
1564 * On entry: r13 == 'current' && last_task_used_altivec != 'current'
1565 */
1566_STATIC(load_up_altivec)
1567 mfmsr r5 /* grab the current MSR */
1568 oris r5,r5,MSR_VEC@h
1569 mtmsrd r5 /* enable use of VMX now */
1570 isync
1571
1572/*
1573 * For SMP, we don't do lazy VMX switching because it just gets too
1574 * horrendously complex, especially when a task switches from one CPU
1575 * to another. Instead we call giveup_altvec in switch_to.
1576 * VRSAVE isn't dealt with here, that is done in the normal context
1577 * switch code. Note that we could rely on vrsave value to eventually
1578 * avoid saving all of the VREGs here...
1579 */
1580#ifndef CONFIG_SMP
1581 ld r3,last_task_used_altivec@got(r2)
1582 ld r4,0(r3)
1583 cmpdi 0,r4,0
1584 beq 1f
1585 /* Save VMX state to last_task_used_altivec's THREAD struct */
1586 addi r4,r4,THREAD
1587 SAVE_32VRS(0,r5,r4)
1588 mfvscr vr0
1589 li r10,THREAD_VSCR
1590 stvx vr0,r10,r4
1591 /* Disable VMX for last_task_used_altivec */
1592 ld r5,PT_REGS(r4)
1593 ld r4,_MSR-STACK_FRAME_OVERHEAD(r5)
1594 lis r6,MSR_VEC@h
1595 andc r4,r4,r6
1596 std r4,_MSR-STACK_FRAME_OVERHEAD(r5)
15971:
1598#endif /* CONFIG_SMP */
1599 /* Hack: if we get an altivec unavailable trap with VRSAVE
1600 * set to all zeros, we assume this is a broken application
1601 * that fails to set it properly, and thus we switch it to
1602 * all 1's
1603 */
1604 mfspr r4,SPRN_VRSAVE
1605 cmpdi 0,r4,0
1606 bne+ 1f
1607 li r4,-1
1608 mtspr SPRN_VRSAVE,r4
16091:
1610 /* enable use of VMX after return */
1611 ld r4,PACACURRENT(r13)
1612 addi r5,r4,THREAD /* Get THREAD */
1613 oris r12,r12,MSR_VEC@h
1614 std r12,_MSR(r1)
1615 li r4,1
1616 li r10,THREAD_VSCR
1617 stw r4,THREAD_USED_VR(r5)
1618 lvx vr0,r10,r5
1619 mtvscr vr0
1620 REST_32VRS(0,r4,r5)
1621#ifndef CONFIG_SMP
1622 /* Update last_task_used_math to 'current' */
1623 subi r4,r5,THREAD /* Back to 'current' */
1624 std r4,0(r3)
1625#endif /* CONFIG_SMP */
1626 /* restore registers and return */
1627 b fast_exception_return
1628
1629/*
1630 * disable_kernel_altivec()
1631 * Disable the VMX.
1632 */
1633_GLOBAL(disable_kernel_altivec)
1634 mfmsr r3
1635 rldicl r0,r3,(63-MSR_VEC_LG),1
1636 rldicl r3,r0,(MSR_VEC_LG+1),0
1637 mtmsrd r3 /* disable use of VMX now */
1638 isync
1639 blr
1640
1641/*
1642 * giveup_altivec(tsk)
1643 * Disable VMX for the task given as the argument,
1644 * and save the vector registers in its thread_struct.
1645 * Enables the VMX for use in the kernel on return.
1646 */
1647_GLOBAL(giveup_altivec)
1648 mfmsr r5
1649 oris r5,r5,MSR_VEC@h
1650 mtmsrd r5 /* enable use of VMX now */
1651 isync
1652 cmpdi 0,r3,0
1653 beqlr- /* if no previous owner, done */
1654 addi r3,r3,THREAD /* want THREAD of task */
1655 ld r5,PT_REGS(r3)
1656 cmpdi 0,r5,0
1657 SAVE_32VRS(0,r4,r3)
1658 mfvscr vr0
1659 li r4,THREAD_VSCR
1660 stvx vr0,r4,r3
1661 beq 1f
1662 ld r4,_MSR-STACK_FRAME_OVERHEAD(r5)
1663 lis r3,MSR_VEC@h
1664 andc r4,r4,r3 /* disable FP for previous task */
1665 std r4,_MSR-STACK_FRAME_OVERHEAD(r5)
16661:
1667#ifndef CONFIG_SMP
1668 li r5,0
1669 ld r4,last_task_used_altivec@got(r2)
1670 std r5,0(r4)
1671#endif /* CONFIG_SMP */
1672 blr
1673
1674#endif /* CONFIG_ALTIVEC */
1675
1676#ifdef CONFIG_SMP 1548#ifdef CONFIG_SMP
1677#ifdef CONFIG_PPC_PMAC 1549#ifdef CONFIG_PPC_PMAC
1678/* 1550/*
@@ -2023,9 +1895,6 @@ _STATIC(start_here_common)
2023 1895
2024 bl .start_kernel 1896 bl .start_kernel
2025 1897
2026_GLOBAL(__setup_cpu_power3)
2027 blr
2028
2029_GLOBAL(hmt_init) 1898_GLOBAL(hmt_init)
2030#ifdef CONFIG_HMT 1899#ifdef CONFIG_HMT
2031 LOADADDR(r5, hmt_thread_data) 1900 LOADADDR(r5, hmt_thread_data)
@@ -2098,7 +1967,7 @@ _GLOBAL(hmt_start_secondary)
2098 blr 1967 blr
2099#endif 1968#endif
2100 1969
2101#if defined(CONFIG_SMP) && !defined(CONFIG_PPC_ISERIES) 1970#if defined(CONFIG_KEXEC) || (defined(CONFIG_SMP) && !defined(CONFIG_PPC_ISERIES))
2102_GLOBAL(smp_release_cpus) 1971_GLOBAL(smp_release_cpus)
2103 /* All secondary cpus are spinning on a common 1972 /* All secondary cpus are spinning on a common
2104 * spinloop, release them all now so they can start 1973 * spinloop, release them all now so they can start
@@ -2116,28 +1985,20 @@ _GLOBAL(smp_release_cpus)
2116 1985
2117/* 1986/*
2118 * We put a few things here that have to be page-aligned. 1987 * We put a few things here that have to be page-aligned.
2119 * This stuff goes at the beginning of the data segment, 1988 * This stuff goes at the beginning of the bss, which is page-aligned.
2120 * which is page-aligned.
2121 */ 1989 */
2122 .data 1990 .section ".bss"
1991
2123 .align 12 1992 .align 12
2124 .globl sdata 1993
2125sdata:
2126 .globl empty_zero_page 1994 .globl empty_zero_page
2127empty_zero_page: 1995empty_zero_page:
2128 .space 4096 1996 .space PAGE_SIZE
2129 1997
2130 .globl swapper_pg_dir 1998 .globl swapper_pg_dir
2131swapper_pg_dir: 1999swapper_pg_dir:
2132 .space 4096 2000 .space PAGE_SIZE
2133 2001
2134#ifdef CONFIG_SMP
2135/* 1 page segment table per cpu (max 48, cpu0 allocated at STAB0_PHYS_ADDR) */
2136 .globl stab_array
2137stab_array:
2138 .space 4096 * 48
2139#endif
2140
2141/* 2002/*
2142 * This space gets a copy of optional info passed to us by the bootstrap 2003 * This space gets a copy of optional info passed to us by the bootstrap
2143 * Used to pass parameters into the kernel like root=/dev/sda1, etc. 2004 * Used to pass parameters into the kernel like root=/dev/sda1, etc.
diff --git a/arch/ppc64/kernel/iSeries_htab.c b/arch/ppc64/kernel/iSeries_htab.c
index aa9e8fdd1a4f..2192055a90a0 100644
--- a/arch/ppc64/kernel/iSeries_htab.c
+++ b/arch/ppc64/kernel/iSeries_htab.c
@@ -38,11 +38,13 @@ static inline void iSeries_hunlock(unsigned long slot)
38} 38}
39 39
40static long iSeries_hpte_insert(unsigned long hpte_group, unsigned long va, 40static long iSeries_hpte_insert(unsigned long hpte_group, unsigned long va,
41 unsigned long prpn, int secondary, 41 unsigned long prpn, unsigned long vflags,
42 unsigned long hpteflags, int bolted, int large) 42 unsigned long rflags)
43{ 43{
44 unsigned long arpn;
44 long slot; 45 long slot;
45 HPTE lhpte; 46 hpte_t lhpte;
47 int secondary = 0;
46 48
47 /* 49 /*
48 * The hypervisor tries both primary and secondary. 50 * The hypervisor tries both primary and secondary.
@@ -50,13 +52,13 @@ static long iSeries_hpte_insert(unsigned long hpte_group, unsigned long va,
50 * it means we have already tried both primary and secondary, 52 * it means we have already tried both primary and secondary,
51 * so we return failure immediately. 53 * so we return failure immediately.
52 */ 54 */
53 if (secondary) 55 if (vflags & HPTE_V_SECONDARY)
54 return -1; 56 return -1;
55 57
56 iSeries_hlock(hpte_group); 58 iSeries_hlock(hpte_group);
57 59
58 slot = HvCallHpt_findValid(&lhpte, va >> PAGE_SHIFT); 60 slot = HvCallHpt_findValid(&lhpte, va >> PAGE_SHIFT);
59 BUG_ON(lhpte.dw0.dw0.v); 61 BUG_ON(lhpte.v & HPTE_V_VALID);
60 62
61 if (slot == -1) { /* No available entry found in either group */ 63 if (slot == -1) { /* No available entry found in either group */
62 iSeries_hunlock(hpte_group); 64 iSeries_hunlock(hpte_group);
@@ -64,19 +66,15 @@ static long iSeries_hpte_insert(unsigned long hpte_group, unsigned long va,
64 } 66 }
65 67
66 if (slot < 0) { /* MSB set means secondary group */ 68 if (slot < 0) { /* MSB set means secondary group */
69 vflags |= HPTE_V_VALID;
67 secondary = 1; 70 secondary = 1;
68 slot &= 0x7fffffffffffffff; 71 slot &= 0x7fffffffffffffff;
69 } 72 }
70 73
71 lhpte.dw1.dword1 = 0; 74 arpn = phys_to_abs(prpn << PAGE_SHIFT) >> PAGE_SHIFT;
72 lhpte.dw1.dw1.rpn = physRpn_to_absRpn(prpn);
73 lhpte.dw1.flags.flags = hpteflags;
74 75
75 lhpte.dw0.dword0 = 0; 76 lhpte.v = (va >> 23) << HPTE_V_AVPN_SHIFT | vflags | HPTE_V_VALID;
76 lhpte.dw0.dw0.avpn = va >> 23; 77 lhpte.r = (arpn << HPTE_R_RPN_SHIFT) | rflags;
77 lhpte.dw0.dw0.h = secondary;
78 lhpte.dw0.dw0.bolted = bolted;
79 lhpte.dw0.dw0.v = 1;
80 78
81 /* Now fill in the actual HPTE */ 79 /* Now fill in the actual HPTE */
82 HvCallHpt_addValidate(slot, secondary, &lhpte); 80 HvCallHpt_addValidate(slot, secondary, &lhpte);
@@ -88,20 +86,17 @@ static long iSeries_hpte_insert(unsigned long hpte_group, unsigned long va,
88 86
89static unsigned long iSeries_hpte_getword0(unsigned long slot) 87static unsigned long iSeries_hpte_getword0(unsigned long slot)
90{ 88{
91 unsigned long dword0; 89 hpte_t hpte;
92 HPTE hpte;
93 90
94 HvCallHpt_get(&hpte, slot); 91 HvCallHpt_get(&hpte, slot);
95 dword0 = hpte.dw0.dword0; 92 return hpte.v;
96
97 return dword0;
98} 93}
99 94
100static long iSeries_hpte_remove(unsigned long hpte_group) 95static long iSeries_hpte_remove(unsigned long hpte_group)
101{ 96{
102 unsigned long slot_offset; 97 unsigned long slot_offset;
103 int i; 98 int i;
104 HPTE lhpte; 99 unsigned long hpte_v;
105 100
106 /* Pick a random slot to start at */ 101 /* Pick a random slot to start at */
107 slot_offset = mftb() & 0x7; 102 slot_offset = mftb() & 0x7;
@@ -109,10 +104,9 @@ static long iSeries_hpte_remove(unsigned long hpte_group)
109 iSeries_hlock(hpte_group); 104 iSeries_hlock(hpte_group);
110 105
111 for (i = 0; i < HPTES_PER_GROUP; i++) { 106 for (i = 0; i < HPTES_PER_GROUP; i++) {
112 lhpte.dw0.dword0 = 107 hpte_v = iSeries_hpte_getword0(hpte_group + slot_offset);
113 iSeries_hpte_getword0(hpte_group + slot_offset);
114 108
115 if (!lhpte.dw0.dw0.bolted) { 109 if (! (hpte_v & HPTE_V_BOLTED)) {
116 HvCallHpt_invalidateSetSwBitsGet(hpte_group + 110 HvCallHpt_invalidateSetSwBitsGet(hpte_group +
117 slot_offset, 0, 0); 111 slot_offset, 0, 0);
118 iSeries_hunlock(hpte_group); 112 iSeries_hunlock(hpte_group);
@@ -137,13 +131,13 @@ static long iSeries_hpte_remove(unsigned long hpte_group)
137static long iSeries_hpte_updatepp(unsigned long slot, unsigned long newpp, 131static long iSeries_hpte_updatepp(unsigned long slot, unsigned long newpp,
138 unsigned long va, int large, int local) 132 unsigned long va, int large, int local)
139{ 133{
140 HPTE hpte; 134 hpte_t hpte;
141 unsigned long avpn = va >> 23; 135 unsigned long avpn = va >> 23;
142 136
143 iSeries_hlock(slot); 137 iSeries_hlock(slot);
144 138
145 HvCallHpt_get(&hpte, slot); 139 HvCallHpt_get(&hpte, slot);
146 if ((hpte.dw0.dw0.avpn == avpn) && (hpte.dw0.dw0.v)) { 140 if ((HPTE_V_AVPN_VAL(hpte.v) == avpn) && (hpte.v & HPTE_V_VALID)) {
147 /* 141 /*
148 * Hypervisor expects bits as NPPP, which is 142 * Hypervisor expects bits as NPPP, which is
149 * different from how they are mapped in our PP. 143 * different from how they are mapped in our PP.
@@ -167,7 +161,7 @@ static long iSeries_hpte_updatepp(unsigned long slot, unsigned long newpp,
167 */ 161 */
168static long iSeries_hpte_find(unsigned long vpn) 162static long iSeries_hpte_find(unsigned long vpn)
169{ 163{
170 HPTE hpte; 164 hpte_t hpte;
171 long slot; 165 long slot;
172 166
173 /* 167 /*
@@ -177,7 +171,7 @@ static long iSeries_hpte_find(unsigned long vpn)
177 * 0x80000000xxxxxxxx : Entry found in secondary group, slot x 171 * 0x80000000xxxxxxxx : Entry found in secondary group, slot x
178 */ 172 */
179 slot = HvCallHpt_findValid(&hpte, vpn); 173 slot = HvCallHpt_findValid(&hpte, vpn);
180 if (hpte.dw0.dw0.v) { 174 if (hpte.v & HPTE_V_VALID) {
181 if (slot < 0) { 175 if (slot < 0) {
182 slot &= 0x7fffffffffffffff; 176 slot &= 0x7fffffffffffffff;
183 slot = -slot; 177 slot = -slot;
@@ -212,7 +206,7 @@ static void iSeries_hpte_updateboltedpp(unsigned long newpp, unsigned long ea)
212static void iSeries_hpte_invalidate(unsigned long slot, unsigned long va, 206static void iSeries_hpte_invalidate(unsigned long slot, unsigned long va,
213 int large, int local) 207 int large, int local)
214{ 208{
215 HPTE lhpte; 209 unsigned long hpte_v;
216 unsigned long avpn = va >> 23; 210 unsigned long avpn = va >> 23;
217 unsigned long flags; 211 unsigned long flags;
218 212
@@ -220,9 +214,9 @@ static void iSeries_hpte_invalidate(unsigned long slot, unsigned long va,
220 214
221 iSeries_hlock(slot); 215 iSeries_hlock(slot);
222 216
223 lhpte.dw0.dword0 = iSeries_hpte_getword0(slot); 217 hpte_v = iSeries_hpte_getword0(slot);
224 218
225 if ((lhpte.dw0.dw0.avpn == avpn) && lhpte.dw0.dw0.v) 219 if ((HPTE_V_AVPN_VAL(hpte_v) == avpn) && (hpte_v & HPTE_V_VALID))
226 HvCallHpt_invalidateSetSwBitsGet(slot, 0, 0); 220 HvCallHpt_invalidateSetSwBitsGet(slot, 0, 0);
227 221
228 iSeries_hunlock(slot); 222 iSeries_hunlock(slot);
diff --git a/arch/ppc64/kernel/iSeries_setup.c b/arch/ppc64/kernel/iSeries_setup.c
index 077c82fc9f3a..3ffefbbc6623 100644
--- a/arch/ppc64/kernel/iSeries_setup.c
+++ b/arch/ppc64/kernel/iSeries_setup.c
@@ -39,6 +39,7 @@
39#include <asm/cputable.h> 39#include <asm/cputable.h>
40#include <asm/sections.h> 40#include <asm/sections.h>
41#include <asm/iommu.h> 41#include <asm/iommu.h>
42#include <asm/firmware.h>
42 43
43#include <asm/time.h> 44#include <asm/time.h>
44#include "iSeries_setup.h" 45#include "iSeries_setup.h"
@@ -314,6 +315,8 @@ static void __init iSeries_init_early(void)
314 315
315 DBG(" -> iSeries_init_early()\n"); 316 DBG(" -> iSeries_init_early()\n");
316 317
318 ppc64_firmware_features = FW_FEATURE_ISERIES;
319
317 ppcdbg_initialize(); 320 ppcdbg_initialize();
318 321
319#if defined(CONFIG_BLK_DEV_INITRD) 322#if defined(CONFIG_BLK_DEV_INITRD)
@@ -412,6 +415,22 @@ static void __init iSeries_init_early(void)
412 DBG(" <- iSeries_init_early()\n"); 415 DBG(" <- iSeries_init_early()\n");
413} 416}
414 417
418struct mschunks_map mschunks_map = {
419 /* XXX We don't use these, but Piranha might need them. */
420 .chunk_size = MSCHUNKS_CHUNK_SIZE,
421 .chunk_shift = MSCHUNKS_CHUNK_SHIFT,
422 .chunk_mask = MSCHUNKS_OFFSET_MASK,
423};
424EXPORT_SYMBOL(mschunks_map);
425
426void mschunks_alloc(unsigned long num_chunks)
427{
428 klimit = _ALIGN(klimit, sizeof(u32));
429 mschunks_map.mapping = (u32 *)klimit;
430 klimit += num_chunks * sizeof(u32);
431 mschunks_map.num_chunks = num_chunks;
432}
433
415/* 434/*
416 * The iSeries may have very large memories ( > 128 GB ) and a partition 435 * The iSeries may have very large memories ( > 128 GB ) and a partition
417 * may get memory in "chunks" that may be anywhere in the 2**52 real 436 * may get memory in "chunks" that may be anywhere in the 2**52 real
@@ -449,7 +468,7 @@ static void __init build_iSeries_Memory_Map(void)
449 468
450 /* Chunk size on iSeries is 256K bytes */ 469 /* Chunk size on iSeries is 256K bytes */
451 totalChunks = (u32)HvLpConfig_getMsChunks(); 470 totalChunks = (u32)HvLpConfig_getMsChunks();
452 klimit = msChunks_alloc(klimit, totalChunks, 1UL << 18); 471 mschunks_alloc(totalChunks);
453 472
454 /* 473 /*
455 * Get absolute address of our load area 474 * Get absolute address of our load area
@@ -486,7 +505,7 @@ static void __init build_iSeries_Memory_Map(void)
486 printk("Load area size %dK\n", loadAreaSize * 256); 505 printk("Load area size %dK\n", loadAreaSize * 256);
487 506
488 for (nextPhysChunk = 0; nextPhysChunk < loadAreaSize; ++nextPhysChunk) 507 for (nextPhysChunk = 0; nextPhysChunk < loadAreaSize; ++nextPhysChunk)
489 msChunks.abs[nextPhysChunk] = 508 mschunks_map.mapping[nextPhysChunk] =
490 loadAreaFirstChunk + nextPhysChunk; 509 loadAreaFirstChunk + nextPhysChunk;
491 510
492 /* 511 /*
@@ -495,7 +514,7 @@ static void __init build_iSeries_Memory_Map(void)
495 */ 514 */
496 hptFirstChunk = (u32)addr_to_chunk(HvCallHpt_getHptAddress()); 515 hptFirstChunk = (u32)addr_to_chunk(HvCallHpt_getHptAddress());
497 hptSizePages = (u32)HvCallHpt_getHptPages(); 516 hptSizePages = (u32)HvCallHpt_getHptPages();
498 hptSizeChunks = hptSizePages >> (msChunks.chunk_shift - PAGE_SHIFT); 517 hptSizeChunks = hptSizePages >> (MSCHUNKS_CHUNK_SHIFT - PAGE_SHIFT);
499 hptLastChunk = hptFirstChunk + hptSizeChunks - 1; 518 hptLastChunk = hptFirstChunk + hptSizeChunks - 1;
500 519
501 printk("HPT absolute addr = %016lx, size = %dK\n", 520 printk("HPT absolute addr = %016lx, size = %dK\n",
@@ -503,7 +522,7 @@ static void __init build_iSeries_Memory_Map(void)
503 522
504 /* Fill in the hashed page table hash mask */ 523 /* Fill in the hashed page table hash mask */
505 num_ptegs = hptSizePages * 524 num_ptegs = hptSizePages *
506 (PAGE_SIZE / (sizeof(HPTE) * HPTES_PER_GROUP)); 525 (PAGE_SIZE / (sizeof(hpte_t) * HPTES_PER_GROUP));
507 htab_hash_mask = num_ptegs - 1; 526 htab_hash_mask = num_ptegs - 1;
508 527
509 /* 528 /*
@@ -552,7 +571,8 @@ static void __init build_iSeries_Memory_Map(void)
552 (absChunk > hptLastChunk)) && 571 (absChunk > hptLastChunk)) &&
553 ((absChunk < loadAreaFirstChunk) || 572 ((absChunk < loadAreaFirstChunk) ||
554 (absChunk > loadAreaLastChunk))) { 573 (absChunk > loadAreaLastChunk))) {
555 msChunks.abs[nextPhysChunk] = absChunk; 574 mschunks_map.mapping[nextPhysChunk] =
575 absChunk;
556 ++nextPhysChunk; 576 ++nextPhysChunk;
557 } 577 }
558 } 578 }
@@ -618,25 +638,23 @@ static void __init setup_iSeries_cache_sizes(void)
618static void iSeries_make_pte(unsigned long va, unsigned long pa, 638static void iSeries_make_pte(unsigned long va, unsigned long pa,
619 int mode) 639 int mode)
620{ 640{
621 HPTE local_hpte, rhpte; 641 hpte_t local_hpte, rhpte;
622 unsigned long hash, vpn; 642 unsigned long hash, vpn;
623 long slot; 643 long slot;
624 644
625 vpn = va >> PAGE_SHIFT; 645 vpn = va >> PAGE_SHIFT;
626 hash = hpt_hash(vpn, 0); 646 hash = hpt_hash(vpn, 0);
627 647
628 local_hpte.dw1.dword1 = pa | mode; 648 local_hpte.r = pa | mode;
629 local_hpte.dw0.dword0 = 0; 649 local_hpte.v = ((va >> 23) << HPTE_V_AVPN_SHIFT)
630 local_hpte.dw0.dw0.avpn = va >> 23; 650 | HPTE_V_BOLTED | HPTE_V_VALID;
631 local_hpte.dw0.dw0.bolted = 1; /* bolted */
632 local_hpte.dw0.dw0.v = 1;
633 651
634 slot = HvCallHpt_findValid(&rhpte, vpn); 652 slot = HvCallHpt_findValid(&rhpte, vpn);
635 if (slot < 0) { 653 if (slot < 0) {
636 /* Must find space in primary group */ 654 /* Must find space in primary group */
637 panic("hash_page: hpte already exists\n"); 655 panic("hash_page: hpte already exists\n");
638 } 656 }
639 HvCallHpt_addValidate(slot, 0, (HPTE *)&local_hpte ); 657 HvCallHpt_addValidate(slot, 0, &local_hpte);
640} 658}
641 659
642/* 660/*
@@ -646,7 +664,7 @@ static void __init iSeries_bolt_kernel(unsigned long saddr, unsigned long eaddr)
646{ 664{
647 unsigned long pa; 665 unsigned long pa;
648 unsigned long mode_rw = _PAGE_ACCESSED | _PAGE_COHERENT | PP_RWXX; 666 unsigned long mode_rw = _PAGE_ACCESSED | _PAGE_COHERENT | PP_RWXX;
649 HPTE hpte; 667 hpte_t hpte;
650 668
651 for (pa = saddr; pa < eaddr ;pa += PAGE_SIZE) { 669 for (pa = saddr; pa < eaddr ;pa += PAGE_SIZE) {
652 unsigned long ea = (unsigned long)__va(pa); 670 unsigned long ea = (unsigned long)__va(pa);
@@ -659,7 +677,7 @@ static void __init iSeries_bolt_kernel(unsigned long saddr, unsigned long eaddr)
659 if (!in_kernel_text(ea)) 677 if (!in_kernel_text(ea))
660 mode_rw |= HW_NO_EXEC; 678 mode_rw |= HW_NO_EXEC;
661 679
662 if (hpte.dw0.dw0.v) { 680 if (hpte.v & HPTE_V_VALID) {
663 /* HPTE exists, so just bolt it */ 681 /* HPTE exists, so just bolt it */
664 HvCallHpt_setSwBits(slot, 0x10, 0); 682 HvCallHpt_setSwBits(slot, 0x10, 0);
665 /* And make sure the pp bits are correct */ 683 /* And make sure the pp bits are correct */
@@ -946,6 +964,8 @@ void __init iSeries_early_setup(void)
946 ppc_md.calibrate_decr = iSeries_calibrate_decr; 964 ppc_md.calibrate_decr = iSeries_calibrate_decr;
947 ppc_md.progress = iSeries_progress; 965 ppc_md.progress = iSeries_progress;
948 966
967 /* XXX Implement enable_pmcs for iSeries */
968
949 if (get_paca()->lppaca.shared_proc) { 969 if (get_paca()->lppaca.shared_proc) {
950 ppc_md.idle_loop = iseries_shared_idle; 970 ppc_md.idle_loop = iseries_shared_idle;
951 printk(KERN_INFO "Using shared processor idle loop\n"); 971 printk(KERN_INFO "Using shared processor idle loop\n");
diff --git a/arch/ppc64/kernel/iSeries_vio.c b/arch/ppc64/kernel/iSeries_vio.c
new file mode 100644
index 000000000000..6b754b0c8344
--- /dev/null
+++ b/arch/ppc64/kernel/iSeries_vio.c
@@ -0,0 +1,155 @@
1/*
2 * IBM PowerPC iSeries Virtual I/O Infrastructure Support.
3 *
4 * Copyright (c) 2005 Stephen Rothwell, IBM Corp.
5 *
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License
8 * as published by the Free Software Foundation; either version
9 * 2 of the License, or (at your option) any later version.
10 */
11#include <linux/types.h>
12#include <linux/device.h>
13#include <linux/init.h>
14
15#include <asm/vio.h>
16#include <asm/iommu.h>
17#include <asm/abs_addr.h>
18#include <asm/page.h>
19#include <asm/iSeries/vio.h>
20#include <asm/iSeries/HvTypes.h>
21#include <asm/iSeries/HvLpConfig.h>
22#include <asm/iSeries/HvCallXm.h>
23
24struct device *iSeries_vio_dev = &vio_bus_device.dev;
25EXPORT_SYMBOL(iSeries_vio_dev);
26
27static struct iommu_table veth_iommu_table;
28static struct iommu_table vio_iommu_table;
29
30static void __init iommu_vio_init(void)
31{
32 struct iommu_table *t;
33 struct iommu_table_cb cb;
34 unsigned long cbp;
35 unsigned long itc_entries;
36
37 cb.itc_busno = 255; /* Bus 255 is the virtual bus */
38 cb.itc_virtbus = 0xff; /* Ask for virtual bus */
39
40 cbp = virt_to_abs(&cb);
41 HvCallXm_getTceTableParms(cbp);
42
43 itc_entries = cb.itc_size * PAGE_SIZE / sizeof(union tce_entry);
44 veth_iommu_table.it_size = itc_entries / 2;
45 veth_iommu_table.it_busno = cb.itc_busno;
46 veth_iommu_table.it_offset = cb.itc_offset;
47 veth_iommu_table.it_index = cb.itc_index;
48 veth_iommu_table.it_type = TCE_VB;
49 veth_iommu_table.it_blocksize = 1;
50
51 t = iommu_init_table(&veth_iommu_table);
52
53 if (!t)
54 printk("Virtual Bus VETH TCE table failed.\n");
55
56 vio_iommu_table.it_size = itc_entries - veth_iommu_table.it_size;
57 vio_iommu_table.it_busno = cb.itc_busno;
58 vio_iommu_table.it_offset = cb.itc_offset +
59 veth_iommu_table.it_size;
60 vio_iommu_table.it_index = cb.itc_index;
61 vio_iommu_table.it_type = TCE_VB;
62 vio_iommu_table.it_blocksize = 1;
63
64 t = iommu_init_table(&vio_iommu_table);
65
66 if (!t)
67 printk("Virtual Bus VIO TCE table failed.\n");
68}
69
70/**
71 * vio_register_device_iseries: - Register a new iSeries vio device.
72 * @voidev: The device to register.
73 */
74static struct vio_dev *__init vio_register_device_iseries(char *type,
75 uint32_t unit_num)
76{
77 struct vio_dev *viodev;
78
79 /* allocate a vio_dev for this device */
80 viodev = kmalloc(sizeof(struct vio_dev), GFP_KERNEL);
81 if (!viodev)
82 return NULL;
83 memset(viodev, 0, sizeof(struct vio_dev));
84
85 snprintf(viodev->dev.bus_id, BUS_ID_SIZE, "%s%d", type, unit_num);
86
87 viodev->name = viodev->dev.bus_id;
88 viodev->type = type;
89 viodev->unit_address = unit_num;
90 viodev->iommu_table = &vio_iommu_table;
91 if (vio_register_device(viodev) == NULL) {
92 kfree(viodev);
93 return NULL;
94 }
95 return viodev;
96}
97
98void __init probe_bus_iseries(void)
99{
100 HvLpIndexMap vlan_map;
101 struct vio_dev *viodev;
102 int i;
103
104 /* there is only one of each of these */
105 vio_register_device_iseries("viocons", 0);
106 vio_register_device_iseries("vscsi", 0);
107
108 vlan_map = HvLpConfig_getVirtualLanIndexMap();
109 for (i = 0; i < HVMAXARCHITECTEDVIRTUALLANS; i++) {
110 if ((vlan_map & (0x8000 >> i)) == 0)
111 continue;
112 viodev = vio_register_device_iseries("vlan", i);
113 /* veth is special and has it own iommu_table */
114 viodev->iommu_table = &veth_iommu_table;
115 }
116 for (i = 0; i < HVMAXARCHITECTEDVIRTUALDISKS; i++)
117 vio_register_device_iseries("viodasd", i);
118 for (i = 0; i < HVMAXARCHITECTEDVIRTUALCDROMS; i++)
119 vio_register_device_iseries("viocd", i);
120 for (i = 0; i < HVMAXARCHITECTEDVIRTUALTAPES; i++)
121 vio_register_device_iseries("viotape", i);
122}
123
124/**
125 * vio_match_device_iseries: - Tell if a iSeries VIO device matches a
126 * vio_device_id
127 */
128static int vio_match_device_iseries(const struct vio_device_id *id,
129 const struct vio_dev *dev)
130{
131 return strncmp(dev->type, id->type, strlen(id->type)) == 0;
132}
133
134static struct vio_bus_ops vio_bus_ops_iseries = {
135 .match = vio_match_device_iseries,
136};
137
138/**
139 * vio_bus_init_iseries: - Initialize the iSeries virtual IO bus
140 */
141static int __init vio_bus_init_iseries(void)
142{
143 int err;
144
145 err = vio_bus_init(&vio_bus_ops_iseries);
146 if (err == 0) {
147 iommu_vio_init();
148 vio_bus_device.iommu_table = &vio_iommu_table;
149 iSeries_vio_dev = &vio_bus_device.dev;
150 probe_bus_iseries();
151 }
152 return err;
153}
154
155__initcall(vio_bus_init_iseries);
diff --git a/arch/ppc64/kernel/iommu.c b/arch/ppc64/kernel/iommu.c
index 8316426ccaf6..845eebd1e28d 100644
--- a/arch/ppc64/kernel/iommu.c
+++ b/arch/ppc64/kernel/iommu.c
@@ -242,7 +242,7 @@ int iommu_map_sg(struct device *dev, struct iommu_table *tbl,
242 dma_addr_t dma_next = 0, dma_addr; 242 dma_addr_t dma_next = 0, dma_addr;
243 unsigned long flags; 243 unsigned long flags;
244 struct scatterlist *s, *outs, *segstart; 244 struct scatterlist *s, *outs, *segstart;
245 int outcount; 245 int outcount, incount;
246 unsigned long handle; 246 unsigned long handle;
247 247
248 BUG_ON(direction == DMA_NONE); 248 BUG_ON(direction == DMA_NONE);
@@ -252,6 +252,7 @@ int iommu_map_sg(struct device *dev, struct iommu_table *tbl,
252 252
253 outs = s = segstart = &sglist[0]; 253 outs = s = segstart = &sglist[0];
254 outcount = 1; 254 outcount = 1;
255 incount = nelems;
255 handle = 0; 256 handle = 0;
256 257
257 /* Init first segment length for backout at failure */ 258 /* Init first segment length for backout at failure */
@@ -338,10 +339,10 @@ int iommu_map_sg(struct device *dev, struct iommu_table *tbl,
338 339
339 DBG("mapped %d elements:\n", outcount); 340 DBG("mapped %d elements:\n", outcount);
340 341
341 /* For the sake of iommu_free_sg, we clear out the length in the 342 /* For the sake of iommu_unmap_sg, we clear out the length in the
342 * next entry of the sglist if we didn't fill the list completely 343 * next entry of the sglist if we didn't fill the list completely
343 */ 344 */
344 if (outcount < nelems) { 345 if (outcount < incount) {
345 outs++; 346 outs++;
346 outs->dma_address = DMA_ERROR_CODE; 347 outs->dma_address = DMA_ERROR_CODE;
347 outs->dma_length = 0; 348 outs->dma_length = 0;
diff --git a/arch/ppc64/kernel/lmb.c b/arch/ppc64/kernel/lmb.c
index d6c6bd03d2a4..5adaca2ddc9d 100644
--- a/arch/ppc64/kernel/lmb.c
+++ b/arch/ppc64/kernel/lmb.c
@@ -28,33 +28,28 @@ void lmb_dump_all(void)
28{ 28{
29#ifdef DEBUG 29#ifdef DEBUG
30 unsigned long i; 30 unsigned long i;
31 struct lmb *_lmb = &lmb;
32 31
33 udbg_printf("lmb_dump_all:\n"); 32 udbg_printf("lmb_dump_all:\n");
34 udbg_printf(" memory.cnt = 0x%lx\n", 33 udbg_printf(" memory.cnt = 0x%lx\n",
35 _lmb->memory.cnt); 34 lmb.memory.cnt);
36 udbg_printf(" memory.size = 0x%lx\n", 35 udbg_printf(" memory.size = 0x%lx\n",
37 _lmb->memory.size); 36 lmb.memory.size);
38 for (i=0; i < _lmb->memory.cnt ;i++) { 37 for (i=0; i < lmb.memory.cnt ;i++) {
39 udbg_printf(" memory.region[0x%x].base = 0x%lx\n", 38 udbg_printf(" memory.region[0x%x].base = 0x%lx\n",
40 i, _lmb->memory.region[i].base); 39 i, lmb.memory.region[i].base);
41 udbg_printf(" .physbase = 0x%lx\n",
42 _lmb->memory.region[i].physbase);
43 udbg_printf(" .size = 0x%lx\n", 40 udbg_printf(" .size = 0x%lx\n",
44 _lmb->memory.region[i].size); 41 lmb.memory.region[i].size);
45 } 42 }
46 43
47 udbg_printf("\n reserved.cnt = 0x%lx\n", 44 udbg_printf("\n reserved.cnt = 0x%lx\n",
48 _lmb->reserved.cnt); 45 lmb.reserved.cnt);
49 udbg_printf(" reserved.size = 0x%lx\n", 46 udbg_printf(" reserved.size = 0x%lx\n",
50 _lmb->reserved.size); 47 lmb.reserved.size);
51 for (i=0; i < _lmb->reserved.cnt ;i++) { 48 for (i=0; i < lmb.reserved.cnt ;i++) {
52 udbg_printf(" reserved.region[0x%x].base = 0x%lx\n", 49 udbg_printf(" reserved.region[0x%x].base = 0x%lx\n",
53 i, _lmb->reserved.region[i].base); 50 i, lmb.reserved.region[i].base);
54 udbg_printf(" .physbase = 0x%lx\n",
55 _lmb->reserved.region[i].physbase);
56 udbg_printf(" .size = 0x%lx\n", 51 udbg_printf(" .size = 0x%lx\n",
57 _lmb->reserved.region[i].size); 52 lmb.reserved.region[i].size);
58 } 53 }
59#endif /* DEBUG */ 54#endif /* DEBUG */
60} 55}
@@ -98,7 +93,6 @@ lmb_coalesce_regions(struct lmb_region *rgn, unsigned long r1, unsigned long r2)
98 rgn->region[r1].size += rgn->region[r2].size; 93 rgn->region[r1].size += rgn->region[r2].size;
99 for (i=r2; i < rgn->cnt-1; i++) { 94 for (i=r2; i < rgn->cnt-1; i++) {
100 rgn->region[i].base = rgn->region[i+1].base; 95 rgn->region[i].base = rgn->region[i+1].base;
101 rgn->region[i].physbase = rgn->region[i+1].physbase;
102 rgn->region[i].size = rgn->region[i+1].size; 96 rgn->region[i].size = rgn->region[i+1].size;
103 } 97 }
104 rgn->cnt--; 98 rgn->cnt--;
@@ -108,49 +102,29 @@ lmb_coalesce_regions(struct lmb_region *rgn, unsigned long r1, unsigned long r2)
108void __init 102void __init
109lmb_init(void) 103lmb_init(void)
110{ 104{
111 struct lmb *_lmb = &lmb;
112
113 /* Create a dummy zero size LMB which will get coalesced away later. 105 /* Create a dummy zero size LMB which will get coalesced away later.
114 * This simplifies the lmb_add() code below... 106 * This simplifies the lmb_add() code below...
115 */ 107 */
116 _lmb->memory.region[0].base = 0; 108 lmb.memory.region[0].base = 0;
117 _lmb->memory.region[0].size = 0; 109 lmb.memory.region[0].size = 0;
118 _lmb->memory.cnt = 1; 110 lmb.memory.cnt = 1;
119 111
120 /* Ditto. */ 112 /* Ditto. */
121 _lmb->reserved.region[0].base = 0; 113 lmb.reserved.region[0].base = 0;
122 _lmb->reserved.region[0].size = 0; 114 lmb.reserved.region[0].size = 0;
123 _lmb->reserved.cnt = 1; 115 lmb.reserved.cnt = 1;
124} 116}
125 117
126/* This routine called with relocation disabled. */ 118/* This routine called with relocation disabled. */
127void __init 119void __init
128lmb_analyze(void) 120lmb_analyze(void)
129{ 121{
130 unsigned long i; 122 int i;
131 unsigned long mem_size = 0; 123
132 unsigned long size_mask = 0; 124 lmb.memory.size = 0;
133 struct lmb *_lmb = &lmb;
134#ifdef CONFIG_MSCHUNKS
135 unsigned long physbase = 0;
136#endif
137
138 for (i=0; i < _lmb->memory.cnt; i++) {
139 unsigned long lmb_size;
140
141 lmb_size = _lmb->memory.region[i].size;
142
143#ifdef CONFIG_MSCHUNKS
144 _lmb->memory.region[i].physbase = physbase;
145 physbase += lmb_size;
146#else
147 _lmb->memory.region[i].physbase = _lmb->memory.region[i].base;
148#endif
149 mem_size += lmb_size;
150 size_mask |= lmb_size;
151 }
152 125
153 _lmb->memory.size = mem_size; 126 for (i = 0; i < lmb.memory.cnt; i++)
127 lmb.memory.size += lmb.memory.region[i].size;
154} 128}
155 129
156/* This routine called with relocation disabled. */ 130/* This routine called with relocation disabled. */
@@ -168,7 +142,6 @@ lmb_add_region(struct lmb_region *rgn, unsigned long base, unsigned long size)
168 adjacent = lmb_addrs_adjacent(base,size,rgnbase,rgnsize); 142 adjacent = lmb_addrs_adjacent(base,size,rgnbase,rgnsize);
169 if ( adjacent > 0 ) { 143 if ( adjacent > 0 ) {
170 rgn->region[i].base -= size; 144 rgn->region[i].base -= size;
171 rgn->region[i].physbase -= size;
172 rgn->region[i].size += size; 145 rgn->region[i].size += size;
173 coalesced++; 146 coalesced++;
174 break; 147 break;
@@ -195,11 +168,9 @@ lmb_add_region(struct lmb_region *rgn, unsigned long base, unsigned long size)
195 for (i=rgn->cnt-1; i >= 0; i--) { 168 for (i=rgn->cnt-1; i >= 0; i--) {
196 if (base < rgn->region[i].base) { 169 if (base < rgn->region[i].base) {
197 rgn->region[i+1].base = rgn->region[i].base; 170 rgn->region[i+1].base = rgn->region[i].base;
198 rgn->region[i+1].physbase = rgn->region[i].physbase;
199 rgn->region[i+1].size = rgn->region[i].size; 171 rgn->region[i+1].size = rgn->region[i].size;
200 } else { 172 } else {
201 rgn->region[i+1].base = base; 173 rgn->region[i+1].base = base;
202 rgn->region[i+1].physbase = lmb_abs_to_phys(base);
203 rgn->region[i+1].size = size; 174 rgn->region[i+1].size = size;
204 break; 175 break;
205 } 176 }
@@ -213,12 +184,11 @@ lmb_add_region(struct lmb_region *rgn, unsigned long base, unsigned long size)
213long __init 184long __init
214lmb_add(unsigned long base, unsigned long size) 185lmb_add(unsigned long base, unsigned long size)
215{ 186{
216 struct lmb *_lmb = &lmb; 187 struct lmb_region *_rgn = &(lmb.memory);
217 struct lmb_region *_rgn = &(_lmb->memory);
218 188
219 /* On pSeries LPAR systems, the first LMB is our RMO region. */ 189 /* On pSeries LPAR systems, the first LMB is our RMO region. */
220 if ( base == 0 ) 190 if ( base == 0 )
221 _lmb->rmo_size = size; 191 lmb.rmo_size = size;
222 192
223 return lmb_add_region(_rgn, base, size); 193 return lmb_add_region(_rgn, base, size);
224 194
@@ -227,8 +197,7 @@ lmb_add(unsigned long base, unsigned long size)
227long __init 197long __init
228lmb_reserve(unsigned long base, unsigned long size) 198lmb_reserve(unsigned long base, unsigned long size)
229{ 199{
230 struct lmb *_lmb = &lmb; 200 struct lmb_region *_rgn = &(lmb.reserved);
231 struct lmb_region *_rgn = &(_lmb->reserved);
232 201
233 return lmb_add_region(_rgn, base, size); 202 return lmb_add_region(_rgn, base, size);
234} 203}
@@ -260,13 +229,10 @@ lmb_alloc_base(unsigned long size, unsigned long align, unsigned long max_addr)
260{ 229{
261 long i, j; 230 long i, j;
262 unsigned long base = 0; 231 unsigned long base = 0;
263 struct lmb *_lmb = &lmb;
264 struct lmb_region *_mem = &(_lmb->memory);
265 struct lmb_region *_rsv = &(_lmb->reserved);
266 232
267 for (i=_mem->cnt-1; i >= 0; i--) { 233 for (i=lmb.memory.cnt-1; i >= 0; i--) {
268 unsigned long lmbbase = _mem->region[i].base; 234 unsigned long lmbbase = lmb.memory.region[i].base;
269 unsigned long lmbsize = _mem->region[i].size; 235 unsigned long lmbsize = lmb.memory.region[i].size;
270 236
271 if ( max_addr == LMB_ALLOC_ANYWHERE ) 237 if ( max_addr == LMB_ALLOC_ANYWHERE )
272 base = _ALIGN_DOWN(lmbbase+lmbsize-size, align); 238 base = _ALIGN_DOWN(lmbbase+lmbsize-size, align);
@@ -276,8 +242,8 @@ lmb_alloc_base(unsigned long size, unsigned long align, unsigned long max_addr)
276 continue; 242 continue;
277 243
278 while ( (lmbbase <= base) && 244 while ( (lmbbase <= base) &&
279 ((j = lmb_overlaps_region(_rsv,base,size)) >= 0) ) { 245 ((j = lmb_overlaps_region(&lmb.reserved,base,size)) >= 0) ) {
280 base = _ALIGN_DOWN(_rsv->region[j].base-size, align); 246 base = _ALIGN_DOWN(lmb.reserved.region[j].base-size, align);
281 } 247 }
282 248
283 if ( (base != 0) && (lmbbase <= base) ) 249 if ( (base != 0) && (lmbbase <= base) )
@@ -287,62 +253,24 @@ lmb_alloc_base(unsigned long size, unsigned long align, unsigned long max_addr)
287 if ( i < 0 ) 253 if ( i < 0 )
288 return 0; 254 return 0;
289 255
290 lmb_add_region(_rsv, base, size); 256 lmb_add_region(&lmb.reserved, base, size);
291 257
292 return base; 258 return base;
293} 259}
294 260
261/* You must call lmb_analyze() before this. */
295unsigned long __init 262unsigned long __init
296lmb_phys_mem_size(void) 263lmb_phys_mem_size(void)
297{ 264{
298 struct lmb *_lmb = &lmb; 265 return lmb.memory.size;
299#ifdef CONFIG_MSCHUNKS
300 return _lmb->memory.size;
301#else
302 struct lmb_region *_mem = &(_lmb->memory);
303 unsigned long total = 0;
304 int i;
305
306 /* add all physical memory to the bootmem map */
307 for (i=0; i < _mem->cnt; i++)
308 total += _mem->region[i].size;
309 return total;
310#endif /* CONFIG_MSCHUNKS */
311} 266}
312 267
313unsigned long __init 268unsigned long __init
314lmb_end_of_DRAM(void) 269lmb_end_of_DRAM(void)
315{ 270{
316 struct lmb *_lmb = &lmb; 271 int idx = lmb.memory.cnt - 1;
317 struct lmb_region *_mem = &(_lmb->memory);
318 int idx = _mem->cnt - 1;
319
320#ifdef CONFIG_MSCHUNKS
321 return (_mem->region[idx].physbase + _mem->region[idx].size);
322#else
323 return (_mem->region[idx].base + _mem->region[idx].size);
324#endif /* CONFIG_MSCHUNKS */
325
326 return 0;
327}
328
329unsigned long __init
330lmb_abs_to_phys(unsigned long aa)
331{
332 unsigned long i, pa = aa;
333 struct lmb *_lmb = &lmb;
334 struct lmb_region *_mem = &(_lmb->memory);
335
336 for (i=0; i < _mem->cnt; i++) {
337 unsigned long lmbbase = _mem->region[i].base;
338 unsigned long lmbsize = _mem->region[i].size;
339 if ( lmb_addrs_overlap(aa,1,lmbbase,lmbsize) ) {
340 pa = _mem->region[i].physbase + (aa - lmbbase);
341 break;
342 }
343 }
344 272
345 return pa; 273 return (lmb.memory.region[idx].base + lmb.memory.region[idx].size);
346} 274}
347 275
348/* 276/*
@@ -353,20 +281,19 @@ void __init lmb_enforce_memory_limit(void)
353{ 281{
354 extern unsigned long memory_limit; 282 extern unsigned long memory_limit;
355 unsigned long i, limit; 283 unsigned long i, limit;
356 struct lmb_region *mem = &(lmb.memory);
357 284
358 if (! memory_limit) 285 if (! memory_limit)
359 return; 286 return;
360 287
361 limit = memory_limit; 288 limit = memory_limit;
362 for (i = 0; i < mem->cnt; i++) { 289 for (i = 0; i < lmb.memory.cnt; i++) {
363 if (limit > mem->region[i].size) { 290 if (limit > lmb.memory.region[i].size) {
364 limit -= mem->region[i].size; 291 limit -= lmb.memory.region[i].size;
365 continue; 292 continue;
366 } 293 }
367 294
368 mem->region[i].size = limit; 295 lmb.memory.region[i].size = limit;
369 mem->cnt = i + 1; 296 lmb.memory.cnt = i + 1;
370 break; 297 break;
371 } 298 }
372} 299}
diff --git a/arch/ppc64/kernel/lparcfg.c b/arch/ppc64/kernel/lparcfg.c
index 02e96627fa66..edad361a8db0 100644
--- a/arch/ppc64/kernel/lparcfg.c
+++ b/arch/ppc64/kernel/lparcfg.c
@@ -29,7 +29,7 @@
29#include <asm/iSeries/HvLpConfig.h> 29#include <asm/iSeries/HvLpConfig.h>
30#include <asm/lppaca.h> 30#include <asm/lppaca.h>
31#include <asm/hvcall.h> 31#include <asm/hvcall.h>
32#include <asm/cputable.h> 32#include <asm/firmware.h>
33#include <asm/rtas.h> 33#include <asm/rtas.h>
34#include <asm/system.h> 34#include <asm/system.h>
35#include <asm/time.h> 35#include <asm/time.h>
@@ -273,6 +273,7 @@ static void parse_system_parameter_string(struct seq_file *m)
273 if (!workbuffer) { 273 if (!workbuffer) {
274 printk(KERN_ERR "%s %s kmalloc failure at line %d \n", 274 printk(KERN_ERR "%s %s kmalloc failure at line %d \n",
275 __FILE__, __FUNCTION__, __LINE__); 275 __FILE__, __FUNCTION__, __LINE__);
276 kfree(local_buffer);
276 return; 277 return;
277 } 278 }
278#ifdef LPARCFG_DEBUG 279#ifdef LPARCFG_DEBUG
@@ -377,7 +378,7 @@ static int lparcfg_data(struct seq_file *m, void *v)
377 378
378 partition_active_processors = lparcfg_count_active_processors(); 379 partition_active_processors = lparcfg_count_active_processors();
379 380
380 if (cur_cpu_spec->firmware_features & FW_FEATURE_SPLPAR) { 381 if (firmware_has_feature(FW_FEATURE_SPLPAR)) {
381 unsigned long h_entitled, h_unallocated; 382 unsigned long h_entitled, h_unallocated;
382 unsigned long h_aggregation, h_resource; 383 unsigned long h_aggregation, h_resource;
383 unsigned long pool_idle_time, pool_procs; 384 unsigned long pool_idle_time, pool_procs;
@@ -571,7 +572,7 @@ int __init lparcfg_init(void)
571 mode_t mode = S_IRUSR; 572 mode_t mode = S_IRUSR;
572 573
573 /* Allow writing if we have FW_FEATURE_SPLPAR */ 574 /* Allow writing if we have FW_FEATURE_SPLPAR */
574 if (cur_cpu_spec->firmware_features & FW_FEATURE_SPLPAR) { 575 if (firmware_has_feature(FW_FEATURE_SPLPAR)) {
575 lparcfg_fops.write = lparcfg_write; 576 lparcfg_fops.write = lparcfg_write;
576 mode |= S_IWUSR; 577 mode |= S_IWUSR;
577 } 578 }
diff --git a/arch/ppc64/kernel/lparmap.c b/arch/ppc64/kernel/lparmap.c
new file mode 100644
index 000000000000..b81de286df5e
--- /dev/null
+++ b/arch/ppc64/kernel/lparmap.c
@@ -0,0 +1,31 @@
1/*
2 * Copyright (C) 2005 Stephen Rothwell 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#include <asm/mmu.h>
10#include <asm/page.h>
11#include <asm/iSeries/LparMap.h>
12
13const struct LparMap __attribute__((__section__(".text"))) xLparMap = {
14 .xNumberEsids = HvEsidsToMap,
15 .xNumberRanges = HvRangesToMap,
16 .xSegmentTableOffs = STAB0_PAGE,
17
18 .xEsids = {
19 { .xKernelEsid = GET_ESID(KERNELBASE),
20 .xKernelVsid = KERNEL_VSID(KERNELBASE), },
21 { .xKernelEsid = GET_ESID(VMALLOCBASE),
22 .xKernelVsid = KERNEL_VSID(VMALLOCBASE), },
23 },
24
25 .xRanges = {
26 { .xPages = HvPagesToMap,
27 .xOffset = 0,
28 .xVPN = KERNEL_VSID(KERNELBASE) << (SID_SHIFT - PAGE_SHIFT),
29 },
30 },
31};
diff --git a/arch/ppc64/kernel/machine_kexec.c b/arch/ppc64/kernel/machine_kexec.c
index fdb2fc649d72..4775f12a013c 100644
--- a/arch/ppc64/kernel/machine_kexec.c
+++ b/arch/ppc64/kernel/machine_kexec.c
@@ -185,7 +185,7 @@ void kexec_copy_flush(struct kimage *image)
185void kexec_smp_down(void *arg) 185void kexec_smp_down(void *arg)
186{ 186{
187 if (ppc_md.cpu_irq_down) 187 if (ppc_md.cpu_irq_down)
188 ppc_md.cpu_irq_down(); 188 ppc_md.cpu_irq_down(1);
189 189
190 local_irq_disable(); 190 local_irq_disable();
191 kexec_smp_wait(); 191 kexec_smp_wait();
@@ -232,7 +232,7 @@ static void kexec_prepare_cpus(void)
232 232
233 /* after we tell the others to go down */ 233 /* after we tell the others to go down */
234 if (ppc_md.cpu_irq_down) 234 if (ppc_md.cpu_irq_down)
235 ppc_md.cpu_irq_down(); 235 ppc_md.cpu_irq_down(0);
236 236
237 put_cpu(); 237 put_cpu();
238 238
@@ -243,15 +243,19 @@ static void kexec_prepare_cpus(void)
243 243
244static void kexec_prepare_cpus(void) 244static void kexec_prepare_cpus(void)
245{ 245{
246 extern void smp_release_cpus(void);
246 /* 247 /*
247 * move the secondarys to us so that we can copy 248 * move the secondarys to us so that we can copy
248 * the new kernel 0-0x100 safely 249 * the new kernel 0-0x100 safely
249 * 250 *
250 * do this if kexec in setup.c ? 251 * do this if kexec in setup.c ?
252 *
253 * We need to release the cpus if we are ever going from an
254 * UP to an SMP kernel.
251 */ 255 */
252 smp_relase_cpus(); 256 smp_release_cpus();
253 if (ppc_md.cpu_irq_down) 257 if (ppc_md.cpu_irq_down)
254 ppc_md.cpu_irq_down(); 258 ppc_md.cpu_irq_down(0);
255 local_irq_disable(); 259 local_irq_disable();
256} 260}
257 261
diff --git a/arch/ppc64/kernel/misc.S b/arch/ppc64/kernel/misc.S
index 59f4f9973818..474df0a862bf 100644
--- a/arch/ppc64/kernel/misc.S
+++ b/arch/ppc64/kernel/misc.S
@@ -680,6 +680,104 @@ _GLOBAL(kernel_thread)
680 ld r30,-16(r1) 680 ld r30,-16(r1)
681 blr 681 blr
682 682
683/*
684 * disable_kernel_fp()
685 * Disable the FPU.
686 */
687_GLOBAL(disable_kernel_fp)
688 mfmsr r3
689 rldicl r0,r3,(63-MSR_FP_LG),1
690 rldicl r3,r0,(MSR_FP_LG+1),0
691 mtmsrd r3 /* disable use of fpu now */
692 isync
693 blr
694
695/*
696 * giveup_fpu(tsk)
697 * Disable FP for the task given as the argument,
698 * and save the floating-point registers in its thread_struct.
699 * Enables the FPU for use in the kernel on return.
700 */
701_GLOBAL(giveup_fpu)
702 mfmsr r5
703 ori r5,r5,MSR_FP
704 mtmsrd r5 /* enable use of fpu now */
705 isync
706 cmpdi 0,r3,0
707 beqlr- /* if no previous owner, done */
708 addi r3,r3,THREAD /* want THREAD of task */
709 ld r5,PT_REGS(r3)
710 cmpdi 0,r5,0
711 SAVE_32FPRS(0, r3)
712 mffs fr0
713 stfd fr0,THREAD_FPSCR(r3)
714 beq 1f
715 ld r4,_MSR-STACK_FRAME_OVERHEAD(r5)
716 li r3,MSR_FP|MSR_FE0|MSR_FE1
717 andc r4,r4,r3 /* disable FP for previous task */
718 std r4,_MSR-STACK_FRAME_OVERHEAD(r5)
7191:
720#ifndef CONFIG_SMP
721 li r5,0
722 ld r4,last_task_used_math@got(r2)
723 std r5,0(r4)
724#endif /* CONFIG_SMP */
725 blr
726
727#ifdef CONFIG_ALTIVEC
728
729#if 0 /* this has no callers for now */
730/*
731 * disable_kernel_altivec()
732 * Disable the VMX.
733 */
734_GLOBAL(disable_kernel_altivec)
735 mfmsr r3
736 rldicl r0,r3,(63-MSR_VEC_LG),1
737 rldicl r3,r0,(MSR_VEC_LG+1),0
738 mtmsrd r3 /* disable use of VMX now */
739 isync
740 blr
741#endif /* 0 */
742
743/*
744 * giveup_altivec(tsk)
745 * Disable VMX for the task given as the argument,
746 * and save the vector registers in its thread_struct.
747 * Enables the VMX for use in the kernel on return.
748 */
749_GLOBAL(giveup_altivec)
750 mfmsr r5
751 oris r5,r5,MSR_VEC@h
752 mtmsrd r5 /* enable use of VMX now */
753 isync
754 cmpdi 0,r3,0
755 beqlr- /* if no previous owner, done */
756 addi r3,r3,THREAD /* want THREAD of task */
757 ld r5,PT_REGS(r3)
758 cmpdi 0,r5,0
759 SAVE_32VRS(0,r4,r3)
760 mfvscr vr0
761 li r4,THREAD_VSCR
762 stvx vr0,r4,r3
763 beq 1f
764 ld r4,_MSR-STACK_FRAME_OVERHEAD(r5)
765 lis r3,MSR_VEC@h
766 andc r4,r4,r3 /* disable FP for previous task */
767 std r4,_MSR-STACK_FRAME_OVERHEAD(r5)
7681:
769#ifndef CONFIG_SMP
770 li r5,0
771 ld r4,last_task_used_altivec@got(r2)
772 std r5,0(r4)
773#endif /* CONFIG_SMP */
774 blr
775
776#endif /* CONFIG_ALTIVEC */
777
778_GLOBAL(__setup_cpu_power3)
779 blr
780
683/* kexec_wait(phys_cpu) 781/* kexec_wait(phys_cpu)
684 * 782 *
685 * wait for the flag to change, indicating this kernel is going away but 783 * wait for the flag to change, indicating this kernel is going away but
@@ -1129,6 +1227,9 @@ _GLOBAL(sys_call_table32)
1129 .llong .compat_sys_waitid 1227 .llong .compat_sys_waitid
1130 .llong .sys32_ioprio_set 1228 .llong .sys32_ioprio_set
1131 .llong .sys32_ioprio_get 1229 .llong .sys32_ioprio_get
1230 .llong .sys_inotify_init /* 275 */
1231 .llong .sys_inotify_add_watch
1232 .llong .sys_inotify_rm_watch
1132 1233
1133 .balign 8 1234 .balign 8
1134_GLOBAL(sys_call_table) 1235_GLOBAL(sys_call_table)
@@ -1407,3 +1508,6 @@ _GLOBAL(sys_call_table)
1407 .llong .sys_waitid 1508 .llong .sys_waitid
1408 .llong .sys_ioprio_set 1509 .llong .sys_ioprio_set
1409 .llong .sys_ioprio_get 1510 .llong .sys_ioprio_get
1511 .llong .sys_inotify_init /* 275 */
1512 .llong .sys_inotify_add_watch
1513 .llong .sys_inotify_rm_watch
diff --git a/arch/ppc64/kernel/mpic.c b/arch/ppc64/kernel/mpic.c
index e8fbab1df37f..cc262a05ddb4 100644
--- a/arch/ppc64/kernel/mpic.c
+++ b/arch/ppc64/kernel/mpic.c
@@ -794,10 +794,10 @@ void mpic_setup_this_cpu(void)
794 794
795/* 795/*
796 * XXX: someone who knows mpic should check this. 796 * XXX: someone who knows mpic should check this.
797 * do we need to eoi the ipi here (see xics comments)? 797 * do we need to eoi the ipi including for kexec cpu here (see xics comments)?
798 * or can we reset the mpic in the new kernel? 798 * or can we reset the mpic in the new kernel?
799 */ 799 */
800void mpic_teardown_this_cpu(void) 800void mpic_teardown_this_cpu(int secondary)
801{ 801{
802 struct mpic *mpic = mpic_primary; 802 struct mpic *mpic = mpic_primary;
803 unsigned long flags; 803 unsigned long flags;
diff --git a/arch/ppc64/kernel/mpic.h b/arch/ppc64/kernel/mpic.h
index 99fbbc9a084c..ca78a7f10528 100644
--- a/arch/ppc64/kernel/mpic.h
+++ b/arch/ppc64/kernel/mpic.h
@@ -256,7 +256,7 @@ extern unsigned int mpic_irq_get_priority(unsigned int irq);
256extern void mpic_setup_this_cpu(void); 256extern void mpic_setup_this_cpu(void);
257 257
258/* Clean up for kexec (or cpu offline or ...) */ 258/* Clean up for kexec (or cpu offline or ...) */
259extern void mpic_teardown_this_cpu(void); 259extern void mpic_teardown_this_cpu(int secondary);
260 260
261/* Request IPIs on primary mpic */ 261/* Request IPIs on primary mpic */
262extern void mpic_request_ipis(void); 262extern void mpic_request_ipis(void);
diff --git a/arch/ppc64/kernel/of_device.c b/arch/ppc64/kernel/of_device.c
index b80e81984ba8..da580812ddfe 100644
--- a/arch/ppc64/kernel/of_device.c
+++ b/arch/ppc64/kernel/of_device.c
@@ -236,7 +236,6 @@ void of_device_unregister(struct of_device *ofdev)
236struct of_device* of_platform_device_create(struct device_node *np, const char *bus_id) 236struct of_device* of_platform_device_create(struct device_node *np, const char *bus_id)
237{ 237{
238 struct of_device *dev; 238 struct of_device *dev;
239 u32 *reg;
240 239
241 dev = kmalloc(sizeof(*dev), GFP_KERNEL); 240 dev = kmalloc(sizeof(*dev), GFP_KERNEL);
242 if (!dev) 241 if (!dev)
@@ -250,7 +249,6 @@ struct of_device* of_platform_device_create(struct device_node *np, const char *
250 dev->dev.bus = &of_platform_bus_type; 249 dev->dev.bus = &of_platform_bus_type;
251 dev->dev.release = of_release_dev; 250 dev->dev.release = of_release_dev;
252 251
253 reg = (u32 *)get_property(np, "reg", NULL);
254 strlcpy(dev->dev.bus_id, bus_id, BUS_ID_SIZE); 252 strlcpy(dev->dev.bus_id, bus_id, BUS_ID_SIZE);
255 253
256 if (of_device_register(dev) != 0) { 254 if (of_device_register(dev) != 0) {
diff --git a/arch/ppc64/kernel/pSeries_iommu.c b/arch/ppc64/kernel/pSeries_iommu.c
index 69130522a87e..9d5e1e7fc389 100644
--- a/arch/ppc64/kernel/pSeries_iommu.c
+++ b/arch/ppc64/kernel/pSeries_iommu.c
@@ -45,6 +45,7 @@
45#include <asm/plpar_wrappers.h> 45#include <asm/plpar_wrappers.h>
46#include <asm/pSeries_reconfig.h> 46#include <asm/pSeries_reconfig.h>
47#include <asm/systemcfg.h> 47#include <asm/systemcfg.h>
48#include <asm/firmware.h>
48#include "pci.h" 49#include "pci.h"
49 50
50#define DBG(fmt...) 51#define DBG(fmt...)
@@ -546,7 +547,7 @@ void iommu_init_early_pSeries(void)
546 } 547 }
547 548
548 if (systemcfg->platform & PLATFORM_LPAR) { 549 if (systemcfg->platform & PLATFORM_LPAR) {
549 if (cur_cpu_spec->firmware_features & FW_FEATURE_MULTITCE) { 550 if (firmware_has_feature(FW_FEATURE_MULTITCE)) {
550 ppc_md.tce_build = tce_buildmulti_pSeriesLP; 551 ppc_md.tce_build = tce_buildmulti_pSeriesLP;
551 ppc_md.tce_free = tce_freemulti_pSeriesLP; 552 ppc_md.tce_free = tce_freemulti_pSeriesLP;
552 } else { 553 } else {
diff --git a/arch/ppc64/kernel/pSeries_lpar.c b/arch/ppc64/kernel/pSeries_lpar.c
index 6534812db437..a1d5fdfea4a8 100644
--- a/arch/ppc64/kernel/pSeries_lpar.c
+++ b/arch/ppc64/kernel/pSeries_lpar.c
@@ -52,7 +52,6 @@ EXPORT_SYMBOL(plpar_hcall_4out);
52EXPORT_SYMBOL(plpar_hcall_norets); 52EXPORT_SYMBOL(plpar_hcall_norets);
53EXPORT_SYMBOL(plpar_hcall_8arg_2ret); 53EXPORT_SYMBOL(plpar_hcall_8arg_2ret);
54 54
55extern void fw_feature_init(void);
56extern void pSeries_find_serial_port(void); 55extern void pSeries_find_serial_port(void);
57 56
58 57
@@ -267,6 +266,10 @@ void vpa_init(int cpu)
267 266
268 /* Register the Virtual Processor Area (VPA) */ 267 /* Register the Virtual Processor Area (VPA) */
269 flags = 1UL << (63 - 18); 268 flags = 1UL << (63 - 18);
269
270 if (cpu_has_feature(CPU_FTR_ALTIVEC))
271 paca[cpu].lppaca.vmxregs_in_use = 1;
272
270 ret = register_vpa(flags, hwcpu, __pa(vpa)); 273 ret = register_vpa(flags, hwcpu, __pa(vpa));
271 274
272 if (ret) 275 if (ret)
@@ -277,31 +280,19 @@ void vpa_init(int cpu)
277 280
278long pSeries_lpar_hpte_insert(unsigned long hpte_group, 281long pSeries_lpar_hpte_insert(unsigned long hpte_group,
279 unsigned long va, unsigned long prpn, 282 unsigned long va, unsigned long prpn,
280 int secondary, unsigned long hpteflags, 283 unsigned long vflags, unsigned long rflags)
281 int bolted, int large)
282{ 284{
283 unsigned long arpn = physRpn_to_absRpn(prpn);
284 unsigned long lpar_rc; 285 unsigned long lpar_rc;
285 unsigned long flags; 286 unsigned long flags;
286 unsigned long slot; 287 unsigned long slot;
287 HPTE lhpte; 288 unsigned long hpte_v, hpte_r;
288 unsigned long dummy0, dummy1; 289 unsigned long dummy0, dummy1;
289 290
290 /* Fill in the local HPTE with absolute rpn, avpn and flags */ 291 hpte_v = ((va >> 23) << HPTE_V_AVPN_SHIFT) | vflags | HPTE_V_VALID;
291 lhpte.dw1.dword1 = 0; 292 if (vflags & HPTE_V_LARGE)
292 lhpte.dw1.dw1.rpn = arpn; 293 hpte_v &= ~(1UL << HPTE_V_AVPN_SHIFT);
293 lhpte.dw1.flags.flags = hpteflags;
294 294
295 lhpte.dw0.dword0 = 0; 295 hpte_r = (prpn << HPTE_R_RPN_SHIFT) | rflags;
296 lhpte.dw0.dw0.avpn = va >> 23;
297 lhpte.dw0.dw0.h = secondary;
298 lhpte.dw0.dw0.bolted = bolted;
299 lhpte.dw0.dw0.v = 1;
300
301 if (large) {
302 lhpte.dw0.dw0.l = 1;
303 lhpte.dw0.dw0.avpn &= ~0x1UL;
304 }
305 296
306 /* Now fill in the actual HPTE */ 297 /* Now fill in the actual HPTE */
307 /* Set CEC cookie to 0 */ 298 /* Set CEC cookie to 0 */
@@ -312,11 +303,11 @@ long pSeries_lpar_hpte_insert(unsigned long hpte_group,
312 flags = 0; 303 flags = 0;
313 304
314 /* XXX why is this here? - Anton */ 305 /* XXX why is this here? - Anton */
315 if (hpteflags & (_PAGE_GUARDED|_PAGE_NO_CACHE)) 306 if (rflags & (_PAGE_GUARDED|_PAGE_NO_CACHE))
316 lhpte.dw1.flags.flags &= ~_PAGE_COHERENT; 307 hpte_r &= ~_PAGE_COHERENT;
317 308
318 lpar_rc = plpar_hcall(H_ENTER, flags, hpte_group, lhpte.dw0.dword0, 309 lpar_rc = plpar_hcall(H_ENTER, flags, hpte_group, hpte_v,
319 lhpte.dw1.dword1, &slot, &dummy0, &dummy1); 310 hpte_r, &slot, &dummy0, &dummy1);
320 311
321 if (unlikely(lpar_rc == H_PTEG_Full)) 312 if (unlikely(lpar_rc == H_PTEG_Full))
322 return -1; 313 return -1;
@@ -332,7 +323,7 @@ long pSeries_lpar_hpte_insert(unsigned long hpte_group,
332 /* Because of iSeries, we have to pass down the secondary 323 /* Because of iSeries, we have to pass down the secondary
333 * bucket bit here as well 324 * bucket bit here as well
334 */ 325 */
335 return (slot & 7) | (secondary << 3); 326 return (slot & 7) | (!!(vflags & HPTE_V_SECONDARY) << 3);
336} 327}
337 328
338static DEFINE_SPINLOCK(pSeries_lpar_tlbie_lock); 329static DEFINE_SPINLOCK(pSeries_lpar_tlbie_lock);
@@ -427,22 +418,18 @@ static long pSeries_lpar_hpte_find(unsigned long vpn)
427 unsigned long hash; 418 unsigned long hash;
428 unsigned long i, j; 419 unsigned long i, j;
429 long slot; 420 long slot;
430 union { 421 unsigned long hpte_v;
431 unsigned long dword0;
432 Hpte_dword0 dw0;
433 } hpte_dw0;
434 Hpte_dword0 dw0;
435 422
436 hash = hpt_hash(vpn, 0); 423 hash = hpt_hash(vpn, 0);
437 424
438 for (j = 0; j < 2; j++) { 425 for (j = 0; j < 2; j++) {
439 slot = (hash & htab_hash_mask) * HPTES_PER_GROUP; 426 slot = (hash & htab_hash_mask) * HPTES_PER_GROUP;
440 for (i = 0; i < HPTES_PER_GROUP; i++) { 427 for (i = 0; i < HPTES_PER_GROUP; i++) {
441 hpte_dw0.dword0 = pSeries_lpar_hpte_getword0(slot); 428 hpte_v = pSeries_lpar_hpte_getword0(slot);
442 dw0 = hpte_dw0.dw0;
443 429
444 if ((dw0.avpn == (vpn >> 11)) && dw0.v && 430 if ((HPTE_V_AVPN_VAL(hpte_v) == (vpn >> 11))
445 (dw0.h == j)) { 431 && (hpte_v & HPTE_V_VALID)
432 && (!!(hpte_v & HPTE_V_SECONDARY) == j)) {
446 /* HPTE matches */ 433 /* HPTE matches */
447 if (j) 434 if (j)
448 slot = -slot; 435 slot = -slot;
diff --git a/arch/ppc64/kernel/pSeries_setup.c b/arch/ppc64/kernel/pSeries_setup.c
index 5bec956e44a0..f0f0630cf07c 100644
--- a/arch/ppc64/kernel/pSeries_setup.c
+++ b/arch/ppc64/kernel/pSeries_setup.c
@@ -60,7 +60,8 @@
60#include <asm/nvram.h> 60#include <asm/nvram.h>
61#include <asm/plpar_wrappers.h> 61#include <asm/plpar_wrappers.h>
62#include <asm/xics.h> 62#include <asm/xics.h>
63#include <asm/cputable.h> 63#include <asm/firmware.h>
64#include <asm/pmc.h>
64 65
65#include "i8259.h" 66#include "i8259.h"
66#include "mpic.h" 67#include "mpic.h"
@@ -187,6 +188,21 @@ static void __init pSeries_setup_mpic(void)
187 " MPIC "); 188 " MPIC ");
188} 189}
189 190
191static void pseries_lpar_enable_pmcs(void)
192{
193 unsigned long set, reset;
194
195 power4_enable_pmcs();
196
197 set = 1UL << 63;
198 reset = 0;
199 plpar_hcall_norets(H_PERFMON, set, reset);
200
201 /* instruct hypervisor to maintain PMCs */
202 if (firmware_has_feature(FW_FEATURE_SPLPAR))
203 get_paca()->lppaca.pmcregs_in_use = 1;
204}
205
190static void __init pSeries_setup_arch(void) 206static void __init pSeries_setup_arch(void)
191{ 207{
192 /* Fixup ppc_md depending on the type of interrupt controller */ 208 /* Fixup ppc_md depending on the type of interrupt controller */
@@ -231,11 +247,9 @@ static void __init pSeries_setup_arch(void)
231 247
232 pSeries_nvram_init(); 248 pSeries_nvram_init();
233 249
234 if (cur_cpu_spec->firmware_features & FW_FEATURE_SPLPAR)
235 vpa_init(boot_cpuid);
236
237 /* Choose an idle loop */ 250 /* Choose an idle loop */
238 if (cur_cpu_spec->firmware_features & FW_FEATURE_SPLPAR) { 251 if (firmware_has_feature(FW_FEATURE_SPLPAR)) {
252 vpa_init(boot_cpuid);
239 if (get_paca()->lppaca.shared_proc) { 253 if (get_paca()->lppaca.shared_proc) {
240 printk(KERN_INFO "Using shared processor idle loop\n"); 254 printk(KERN_INFO "Using shared processor idle loop\n");
241 ppc_md.idle_loop = pseries_shared_idle; 255 ppc_md.idle_loop = pseries_shared_idle;
@@ -247,6 +261,11 @@ static void __init pSeries_setup_arch(void)
247 printk(KERN_INFO "Using default idle loop\n"); 261 printk(KERN_INFO "Using default idle loop\n");
248 ppc_md.idle_loop = default_idle; 262 ppc_md.idle_loop = default_idle;
249 } 263 }
264
265 if (systemcfg->platform & PLATFORM_LPAR)
266 ppc_md.enable_pmcs = pseries_lpar_enable_pmcs;
267 else
268 ppc_md.enable_pmcs = power4_enable_pmcs;
250} 269}
251 270
252static int __init pSeries_init_panel(void) 271static int __init pSeries_init_panel(void)
@@ -260,11 +279,11 @@ static int __init pSeries_init_panel(void)
260arch_initcall(pSeries_init_panel); 279arch_initcall(pSeries_init_panel);
261 280
262 281
263/* Build up the firmware_features bitmask field 282/* Build up the ppc64_firmware_features bitmask field
264 * using contents of device-tree/ibm,hypertas-functions. 283 * using contents of device-tree/ibm,hypertas-functions.
265 * Ultimately this functionality may be moved into prom.c prom_init(). 284 * Ultimately this functionality may be moved into prom.c prom_init().
266 */ 285 */
267void __init fw_feature_init(void) 286static void __init fw_feature_init(void)
268{ 287{
269 struct device_node * dn; 288 struct device_node * dn;
270 char * hypertas; 289 char * hypertas;
@@ -272,7 +291,7 @@ void __init fw_feature_init(void)
272 291
273 DBG(" -> fw_feature_init()\n"); 292 DBG(" -> fw_feature_init()\n");
274 293
275 cur_cpu_spec->firmware_features = 0; 294 ppc64_firmware_features = 0;
276 dn = of_find_node_by_path("/rtas"); 295 dn = of_find_node_by_path("/rtas");
277 if (dn == NULL) { 296 if (dn == NULL) {
278 printk(KERN_ERR "WARNING ! Cannot find RTAS in device-tree !\n"); 297 printk(KERN_ERR "WARNING ! Cannot find RTAS in device-tree !\n");
@@ -288,7 +307,7 @@ void __init fw_feature_init(void)
288 if ((firmware_features_table[i].name) && 307 if ((firmware_features_table[i].name) &&
289 (strcmp(firmware_features_table[i].name,hypertas))==0) { 308 (strcmp(firmware_features_table[i].name,hypertas))==0) {
290 /* we have a match */ 309 /* we have a match */
291 cur_cpu_spec->firmware_features |= 310 ppc64_firmware_features |=
292 (firmware_features_table[i].val); 311 (firmware_features_table[i].val);
293 break; 312 break;
294 } 313 }
@@ -302,7 +321,7 @@ void __init fw_feature_init(void)
302 of_node_put(dn); 321 of_node_put(dn);
303 no_rtas: 322 no_rtas:
304 printk(KERN_INFO "firmware_features = 0x%lx\n", 323 printk(KERN_INFO "firmware_features = 0x%lx\n",
305 cur_cpu_spec->firmware_features); 324 ppc64_firmware_features);
306 325
307 DBG(" <- fw_feature_init()\n"); 326 DBG(" <- fw_feature_init()\n");
308} 327}
diff --git a/arch/ppc64/kernel/pSeries_smp.c b/arch/ppc64/kernel/pSeries_smp.c
index 62c55a123560..79c7f3223665 100644
--- a/arch/ppc64/kernel/pSeries_smp.c
+++ b/arch/ppc64/kernel/pSeries_smp.c
@@ -41,6 +41,7 @@
41#include <asm/machdep.h> 41#include <asm/machdep.h>
42#include <asm/xics.h> 42#include <asm/xics.h>
43#include <asm/cputable.h> 43#include <asm/cputable.h>
44#include <asm/firmware.h>
44#include <asm/system.h> 45#include <asm/system.h>
45#include <asm/rtas.h> 46#include <asm/rtas.h>
46#include <asm/plpar_wrappers.h> 47#include <asm/plpar_wrappers.h>
@@ -326,7 +327,7 @@ static void __devinit smp_xics_setup_cpu(int cpu)
326 if (cpu != boot_cpuid) 327 if (cpu != boot_cpuid)
327 xics_setup_cpu(); 328 xics_setup_cpu();
328 329
329 if (cur_cpu_spec->firmware_features & FW_FEATURE_SPLPAR) 330 if (firmware_has_feature(FW_FEATURE_SPLPAR))
330 vpa_init(cpu); 331 vpa_init(cpu);
331 332
332 cpu_clear(cpu, of_spin_map); 333 cpu_clear(cpu, of_spin_map);
diff --git a/arch/ppc64/kernel/pSeries_vio.c b/arch/ppc64/kernel/pSeries_vio.c
new file mode 100644
index 000000000000..e0ae06f58f86
--- /dev/null
+++ b/arch/ppc64/kernel/pSeries_vio.c
@@ -0,0 +1,273 @@
1/*
2 * IBM PowerPC pSeries Virtual I/O Infrastructure Support.
3 *
4 * Copyright (c) 2003-2005 IBM Corp.
5 * Dave Engebretsen engebret@us.ibm.com
6 * Santiago Leon santil@us.ibm.com
7 * Hollis Blanchard <hollisb@us.ibm.com>
8 * Stephen Rothwell
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/init.h>
17#include <linux/module.h>
18#include <linux/mm.h>
19#include <linux/kobject.h>
20#include <asm/iommu.h>
21#include <asm/dma.h>
22#include <asm/prom.h>
23#include <asm/vio.h>
24#include <asm/hvcall.h>
25
26extern struct subsystem devices_subsys; /* needed for vio_find_name() */
27
28static void probe_bus_pseries(void)
29{
30 struct device_node *node_vroot, *of_node;
31
32 node_vroot = find_devices("vdevice");
33 if ((node_vroot == NULL) || (node_vroot->child == NULL))
34 /* this machine doesn't do virtual IO, and that's ok */
35 return;
36
37 /*
38 * Create struct vio_devices for each virtual device in the device tree.
39 * Drivers will associate with them later.
40 */
41 for (of_node = node_vroot->child; of_node != NULL;
42 of_node = of_node->sibling) {
43 printk(KERN_DEBUG "%s: processing %p\n", __FUNCTION__, of_node);
44 vio_register_device_node(of_node);
45 }
46}
47
48/**
49 * vio_match_device_pseries: - Tell if a pSeries VIO device matches a
50 * vio_device_id
51 */
52static int vio_match_device_pseries(const struct vio_device_id *id,
53 const struct vio_dev *dev)
54{
55 return (strncmp(dev->type, id->type, strlen(id->type)) == 0) &&
56 device_is_compatible(dev->dev.platform_data, id->compat);
57}
58
59static void vio_release_device_pseries(struct device *dev)
60{
61 /* XXX free TCE table */
62 of_node_put(dev->platform_data);
63}
64
65static ssize_t viodev_show_devspec(struct device *dev,
66 struct device_attribute *attr, char *buf)
67{
68 struct device_node *of_node = dev->platform_data;
69
70 return sprintf(buf, "%s\n", of_node->full_name);
71}
72DEVICE_ATTR(devspec, S_IRUSR | S_IRGRP | S_IROTH, viodev_show_devspec, NULL);
73
74static void vio_unregister_device_pseries(struct vio_dev *viodev)
75{
76 device_remove_file(&viodev->dev, &dev_attr_devspec);
77}
78
79static struct vio_bus_ops vio_bus_ops_pseries = {
80 .match = vio_match_device_pseries,
81 .unregister_device = vio_unregister_device_pseries,
82 .release_device = vio_release_device_pseries,
83};
84
85/**
86 * vio_bus_init_pseries: - Initialize the pSeries virtual IO bus
87 */
88static int __init vio_bus_init_pseries(void)
89{
90 int err;
91
92 err = vio_bus_init(&vio_bus_ops_pseries);
93 if (err == 0)
94 probe_bus_pseries();
95 return err;
96}
97
98__initcall(vio_bus_init_pseries);
99
100/**
101 * vio_build_iommu_table: - gets the dma information from OF and
102 * builds the TCE tree.
103 * @dev: the virtual device.
104 *
105 * Returns a pointer to the built tce tree, or NULL if it can't
106 * find property.
107*/
108static struct iommu_table *vio_build_iommu_table(struct vio_dev *dev)
109{
110 unsigned int *dma_window;
111 struct iommu_table *newTceTable;
112 unsigned long offset;
113 int dma_window_property_size;
114
115 dma_window = (unsigned int *) get_property(dev->dev.platform_data, "ibm,my-dma-window", &dma_window_property_size);
116 if(!dma_window) {
117 return NULL;
118 }
119
120 newTceTable = (struct iommu_table *) kmalloc(sizeof(struct iommu_table), GFP_KERNEL);
121
122 /* There should be some code to extract the phys-encoded offset
123 using prom_n_addr_cells(). However, according to a comment
124 on earlier versions, it's always zero, so we don't bother */
125 offset = dma_window[1] >> PAGE_SHIFT;
126
127 /* TCE table size - measured in tce entries */
128 newTceTable->it_size = dma_window[4] >> PAGE_SHIFT;
129 /* offset for VIO should always be 0 */
130 newTceTable->it_offset = offset;
131 newTceTable->it_busno = 0;
132 newTceTable->it_index = (unsigned long)dma_window[0];
133 newTceTable->it_type = TCE_VB;
134
135 return iommu_init_table(newTceTable);
136}
137
138/**
139 * vio_register_device_node: - Register a new vio device.
140 * @of_node: The OF node for this device.
141 *
142 * Creates and initializes a vio_dev structure from the data in
143 * of_node (dev.platform_data) and adds it to the list of virtual devices.
144 * Returns a pointer to the created vio_dev or NULL if node has
145 * NULL device_type or compatible fields.
146 */
147struct vio_dev * __devinit vio_register_device_node(struct device_node *of_node)
148{
149 struct vio_dev *viodev;
150 unsigned int *unit_address;
151 unsigned int *irq_p;
152
153 /* we need the 'device_type' property, in order to match with drivers */
154 if ((NULL == of_node->type)) {
155 printk(KERN_WARNING
156 "%s: node %s missing 'device_type'\n", __FUNCTION__,
157 of_node->name ? of_node->name : "<unknown>");
158 return NULL;
159 }
160
161 unit_address = (unsigned int *)get_property(of_node, "reg", NULL);
162 if (!unit_address) {
163 printk(KERN_WARNING "%s: node %s missing 'reg'\n", __FUNCTION__,
164 of_node->name ? of_node->name : "<unknown>");
165 return NULL;
166 }
167
168 /* allocate a vio_dev for this node */
169 viodev = kmalloc(sizeof(struct vio_dev), GFP_KERNEL);
170 if (!viodev) {
171 return NULL;
172 }
173 memset(viodev, 0, sizeof(struct vio_dev));
174
175 viodev->dev.platform_data = of_node_get(of_node);
176
177 viodev->irq = NO_IRQ;
178 irq_p = (unsigned int *)get_property(of_node, "interrupts", NULL);
179 if (irq_p) {
180 int virq = virt_irq_create_mapping(*irq_p);
181 if (virq == NO_IRQ) {
182 printk(KERN_ERR "Unable to allocate interrupt "
183 "number for %s\n", of_node->full_name);
184 } else
185 viodev->irq = irq_offset_up(virq);
186 }
187
188 snprintf(viodev->dev.bus_id, BUS_ID_SIZE, "%x", *unit_address);
189 viodev->name = of_node->name;
190 viodev->type = of_node->type;
191 viodev->unit_address = *unit_address;
192 viodev->iommu_table = vio_build_iommu_table(viodev);
193
194 /* register with generic device framework */
195 if (vio_register_device(viodev) == NULL) {
196 /* XXX free TCE table */
197 kfree(viodev);
198 return NULL;
199 }
200 device_create_file(&viodev->dev, &dev_attr_devspec);
201
202 return viodev;
203}
204EXPORT_SYMBOL(vio_register_device_node);
205
206/**
207 * vio_get_attribute: - get attribute for virtual device
208 * @vdev: The vio device to get property.
209 * @which: The property/attribute to be extracted.
210 * @length: Pointer to length of returned data size (unused if NULL).
211 *
212 * Calls prom.c's get_property() to return the value of the
213 * attribute specified by the preprocessor constant @which
214*/
215const void * vio_get_attribute(struct vio_dev *vdev, void* which, int* length)
216{
217 return get_property(vdev->dev.platform_data, (char*)which, length);
218}
219EXPORT_SYMBOL(vio_get_attribute);
220
221/* vio_find_name() - internal because only vio.c knows how we formatted the
222 * kobject name
223 * XXX once vio_bus_type.devices is actually used as a kset in
224 * drivers/base/bus.c, this function should be removed in favor of
225 * "device_find(kobj_name, &vio_bus_type)"
226 */
227static struct vio_dev *vio_find_name(const char *kobj_name)
228{
229 struct kobject *found;
230
231 found = kset_find_obj(&devices_subsys.kset, kobj_name);
232 if (!found)
233 return NULL;
234
235 return to_vio_dev(container_of(found, struct device, kobj));
236}
237
238/**
239 * vio_find_node - find an already-registered vio_dev
240 * @vnode: device_node of the virtual device we're looking for
241 */
242struct vio_dev *vio_find_node(struct device_node *vnode)
243{
244 uint32_t *unit_address;
245 char kobj_name[BUS_ID_SIZE];
246
247 /* construct the kobject name from the device node */
248 unit_address = (uint32_t *)get_property(vnode, "reg", NULL);
249 if (!unit_address)
250 return NULL;
251 snprintf(kobj_name, BUS_ID_SIZE, "%x", *unit_address);
252
253 return vio_find_name(kobj_name);
254}
255EXPORT_SYMBOL(vio_find_node);
256
257int vio_enable_interrupts(struct vio_dev *dev)
258{
259 int rc = h_vio_signal(dev->unit_address, VIO_IRQ_ENABLE);
260 if (rc != H_Success)
261 printk(KERN_ERR "vio: Error 0x%x enabling interrupts\n", rc);
262 return rc;
263}
264EXPORT_SYMBOL(vio_enable_interrupts);
265
266int vio_disable_interrupts(struct vio_dev *dev)
267{
268 int rc = h_vio_signal(dev->unit_address, VIO_IRQ_DISABLE);
269 if (rc != H_Success)
270 printk(KERN_ERR "vio: Error 0x%x disabling interrupts\n", rc);
271 return rc;
272}
273EXPORT_SYMBOL(vio_disable_interrupts);
diff --git a/arch/ppc64/kernel/pacaData.c b/arch/ppc64/kernel/pacaData.c
index 6316188737b6..33a2d8db3f21 100644
--- a/arch/ppc64/kernel/pacaData.c
+++ b/arch/ppc64/kernel/pacaData.c
@@ -59,6 +59,7 @@ extern unsigned long __toc_start;
59 .fpregs_in_use = 1, \ 59 .fpregs_in_use = 1, \
60 .end_of_quantum = 0xfffffffffffffffful, \ 60 .end_of_quantum = 0xfffffffffffffffful, \
61 .slb_count = 64, \ 61 .slb_count = 64, \
62 .vmxregs_in_use = 0, \
62 }, \ 63 }, \
63 64
64#ifdef CONFIG_PPC_ISERIES 65#ifdef CONFIG_PPC_ISERIES
@@ -78,7 +79,7 @@ extern unsigned long __toc_start;
78 79
79#define BOOTCPU_PACA_INIT(number) \ 80#define BOOTCPU_PACA_INIT(number) \
80{ \ 81{ \
81 PACA_INIT_COMMON(number, 1, 0, STAB0_VIRT_ADDR) \ 82 PACA_INIT_COMMON(number, 1, 0, (u64)&initial_stab) \
82 PACA_INIT_ISERIES(number) \ 83 PACA_INIT_ISERIES(number) \
83} 84}
84 85
@@ -90,7 +91,7 @@ extern unsigned long __toc_start;
90 91
91#define BOOTCPU_PACA_INIT(number) \ 92#define BOOTCPU_PACA_INIT(number) \
92{ \ 93{ \
93 PACA_INIT_COMMON(number, 1, STAB0_PHYS_ADDR, STAB0_VIRT_ADDR) \ 94 PACA_INIT_COMMON(number, 1, STAB0_PHYS_ADDR, (u64)&initial_stab) \
94} 95}
95#endif 96#endif
96 97
diff --git a/arch/ppc64/kernel/pci.c b/arch/ppc64/kernel/pci.c
index ae6f579d3fa0..d0d55c7908ef 100644
--- a/arch/ppc64/kernel/pci.c
+++ b/arch/ppc64/kernel/pci.c
@@ -108,8 +108,28 @@ void pcibios_resource_to_bus(struct pci_dev *dev, struct pci_bus_region *region
108 region->end = res->end - offset; 108 region->end = res->end - offset;
109} 109}
110 110
111void pcibios_bus_to_resource(struct pci_dev *dev, struct resource *res,
112 struct pci_bus_region *region)
113{
114 unsigned long offset = 0;
115 struct pci_controller *hose = pci_bus_to_host(dev->bus);
116
117 if (!hose)
118 return;
119
120 if (res->flags & IORESOURCE_IO)
121 offset = (unsigned long)hose->io_base_virt - pci_io_base;
122
123 if (res->flags & IORESOURCE_MEM)
124 offset = hose->pci_mem_offset;
125
126 res->start = region->start + offset;
127 res->end = region->end + offset;
128}
129
111#ifdef CONFIG_HOTPLUG 130#ifdef CONFIG_HOTPLUG
112EXPORT_SYMBOL(pcibios_resource_to_bus); 131EXPORT_SYMBOL(pcibios_resource_to_bus);
132EXPORT_SYMBOL(pcibios_bus_to_resource);
113#endif 133#endif
114 134
115/* 135/*
diff --git a/arch/ppc64/kernel/pmac_setup.c b/arch/ppc64/kernel/pmac_setup.c
index 3013cdb5f933..8ff86a766cdf 100644
--- a/arch/ppc64/kernel/pmac_setup.c
+++ b/arch/ppc64/kernel/pmac_setup.c
@@ -71,6 +71,7 @@
71#include <asm/of_device.h> 71#include <asm/of_device.h>
72#include <asm/lmb.h> 72#include <asm/lmb.h>
73#include <asm/smu.h> 73#include <asm/smu.h>
74#include <asm/pmc.h>
74 75
75#include "pmac.h" 76#include "pmac.h"
76#include "mpic.h" 77#include "mpic.h"
@@ -97,7 +98,7 @@ EXPORT_SYMBOL(smu_cmdbuf_abs);
97 98
98extern void udbg_init_scc(struct device_node *np); 99extern void udbg_init_scc(struct device_node *np);
99 100
100void __pmac pmac_show_cpuinfo(struct seq_file *m) 101static void __pmac pmac_show_cpuinfo(struct seq_file *m)
101{ 102{
102 struct device_node *np; 103 struct device_node *np;
103 char *pp; 104 char *pp;
@@ -144,7 +145,7 @@ void __pmac pmac_show_cpuinfo(struct seq_file *m)
144} 145}
145 146
146 147
147void __init pmac_setup_arch(void) 148static void __init pmac_setup_arch(void)
148{ 149{
149 /* init to some ~sane value until calibrate_delay() runs */ 150 /* init to some ~sane value until calibrate_delay() runs */
150 loops_per_jiffy = 50000000; 151 loops_per_jiffy = 50000000;
@@ -230,7 +231,7 @@ void __pmac note_bootable_part(dev_t dev, int part, int goodness)
230 } 231 }
231} 232}
232 233
233void __pmac pmac_restart(char *cmd) 234static void __pmac pmac_restart(char *cmd)
234{ 235{
235 switch(sys_ctrler) { 236 switch(sys_ctrler) {
236#ifdef CONFIG_ADB_PMU 237#ifdef CONFIG_ADB_PMU
@@ -249,7 +250,7 @@ void __pmac pmac_restart(char *cmd)
249 } 250 }
250} 251}
251 252
252void __pmac pmac_power_off(void) 253static void __pmac pmac_power_off(void)
253{ 254{
254 switch(sys_ctrler) { 255 switch(sys_ctrler) {
255#ifdef CONFIG_ADB_PMU 256#ifdef CONFIG_ADB_PMU
@@ -267,7 +268,7 @@ void __pmac pmac_power_off(void)
267 } 268 }
268} 269}
269 270
270void __pmac pmac_halt(void) 271static void __pmac pmac_halt(void)
271{ 272{
272 pmac_power_off(); 273 pmac_power_off();
273} 274}
@@ -327,7 +328,7 @@ static void __init init_boot_display(void)
327/* 328/*
328 * Early initialization. 329 * Early initialization.
329 */ 330 */
330void __init pmac_init_early(void) 331static void __init pmac_init_early(void)
331{ 332{
332 DBG(" -> pmac_init_early\n"); 333 DBG(" -> pmac_init_early\n");
333 334
@@ -511,4 +512,5 @@ struct machdep_calls __initdata pmac_md = {
511 .progress = pmac_progress, 512 .progress = pmac_progress,
512 .check_legacy_ioport = pmac_check_legacy_ioport, 513 .check_legacy_ioport = pmac_check_legacy_ioport,
513 .idle_loop = native_idle, 514 .idle_loop = native_idle,
515 .enable_pmcs = power4_enable_pmcs,
514}; 516};
diff --git a/arch/ppc64/kernel/pmc.c b/arch/ppc64/kernel/pmc.c
index 67be773f9c00..cdfec7438d01 100644
--- a/arch/ppc64/kernel/pmc.c
+++ b/arch/ppc64/kernel/pmc.c
@@ -65,3 +65,24 @@ void release_pmc_hardware(void)
65 spin_unlock(&pmc_owner_lock); 65 spin_unlock(&pmc_owner_lock);
66} 66}
67EXPORT_SYMBOL_GPL(release_pmc_hardware); 67EXPORT_SYMBOL_GPL(release_pmc_hardware);
68
69void power4_enable_pmcs(void)
70{
71 unsigned long hid0;
72
73 hid0 = mfspr(HID0);
74 hid0 |= 1UL << (63 - 20);
75
76 /* POWER4 requires the following sequence */
77 asm volatile(
78 "sync\n"
79 "mtspr %1, %0\n"
80 "mfspr %0, %1\n"
81 "mfspr %0, %1\n"
82 "mfspr %0, %1\n"
83 "mfspr %0, %1\n"
84 "mfspr %0, %1\n"
85 "mfspr %0, %1\n"
86 "isync" : "=&r" (hid0) : "i" (HID0), "0" (hid0):
87 "memory");
88}
diff --git a/arch/ppc64/kernel/process.c b/arch/ppc64/kernel/process.c
index f7cae05e40fb..7a7e027653ad 100644
--- a/arch/ppc64/kernel/process.c
+++ b/arch/ppc64/kernel/process.c
@@ -50,6 +50,7 @@
50#include <asm/machdep.h> 50#include <asm/machdep.h>
51#include <asm/iSeries/HvCallHpt.h> 51#include <asm/iSeries/HvCallHpt.h>
52#include <asm/cputable.h> 52#include <asm/cputable.h>
53#include <asm/firmware.h>
53#include <asm/sections.h> 54#include <asm/sections.h>
54#include <asm/tlbflush.h> 55#include <asm/tlbflush.h>
55#include <asm/time.h> 56#include <asm/time.h>
@@ -202,11 +203,10 @@ struct task_struct *__switch_to(struct task_struct *prev,
202 new_thread = &new->thread; 203 new_thread = &new->thread;
203 old_thread = &current->thread; 204 old_thread = &current->thread;
204 205
205/* Collect purr utilization data per process and per processor wise */ 206 /* Collect purr utilization data per process and per processor
206/* purr is nothing but processor time base */ 207 * wise purr is nothing but processor time base
207 208 */
208#if defined(CONFIG_PPC_PSERIES) 209 if (firmware_has_feature(FW_FEATURE_SPLPAR)) {
209 if (cur_cpu_spec->firmware_features & FW_FEATURE_SPLPAR) {
210 struct cpu_usage *cu = &__get_cpu_var(cpu_usage_array); 210 struct cpu_usage *cu = &__get_cpu_var(cpu_usage_array);
211 long unsigned start_tb, current_tb; 211 long unsigned start_tb, current_tb;
212 start_tb = old_thread->start_tb; 212 start_tb = old_thread->start_tb;
@@ -214,8 +214,6 @@ struct task_struct *__switch_to(struct task_struct *prev,
214 old_thread->accum_tb += (current_tb - start_tb); 214 old_thread->accum_tb += (current_tb - start_tb);
215 new_thread->start_tb = current_tb; 215 new_thread->start_tb = current_tb;
216 } 216 }
217#endif
218
219 217
220 local_irq_save(flags); 218 local_irq_save(flags);
221 last = _switch(old_thread, new_thread); 219 last = _switch(old_thread, new_thread);
diff --git a/arch/ppc64/kernel/prom.c b/arch/ppc64/kernel/prom.c
index 47727a6f7346..b21848826791 100644
--- a/arch/ppc64/kernel/prom.c
+++ b/arch/ppc64/kernel/prom.c
@@ -625,8 +625,8 @@ void __init finish_device_tree(void)
625 625
626static inline char *find_flat_dt_string(u32 offset) 626static inline char *find_flat_dt_string(u32 offset)
627{ 627{
628 return ((char *)initial_boot_params) + initial_boot_params->off_dt_strings 628 return ((char *)initial_boot_params) +
629 + offset; 629 initial_boot_params->off_dt_strings + offset;
630} 630}
631 631
632/** 632/**
@@ -635,26 +635,33 @@ static inline char *find_flat_dt_string(u32 offset)
635 * unflatten the tree 635 * unflatten the tree
636 */ 636 */
637static int __init scan_flat_dt(int (*it)(unsigned long node, 637static int __init scan_flat_dt(int (*it)(unsigned long node,
638 const char *full_path, void *data), 638 const char *uname, int depth,
639 void *data),
639 void *data) 640 void *data)
640{ 641{
641 unsigned long p = ((unsigned long)initial_boot_params) + 642 unsigned long p = ((unsigned long)initial_boot_params) +
642 initial_boot_params->off_dt_struct; 643 initial_boot_params->off_dt_struct;
643 int rc = 0; 644 int rc = 0;
645 int depth = -1;
644 646
645 do { 647 do {
646 u32 tag = *((u32 *)p); 648 u32 tag = *((u32 *)p);
647 char *pathp; 649 char *pathp;
648 650
649 p += 4; 651 p += 4;
650 if (tag == OF_DT_END_NODE) 652 if (tag == OF_DT_END_NODE) {
653 depth --;
654 continue;
655 }
656 if (tag == OF_DT_NOP)
651 continue; 657 continue;
652 if (tag == OF_DT_END) 658 if (tag == OF_DT_END)
653 break; 659 break;
654 if (tag == OF_DT_PROP) { 660 if (tag == OF_DT_PROP) {
655 u32 sz = *((u32 *)p); 661 u32 sz = *((u32 *)p);
656 p += 8; 662 p += 8;
657 p = _ALIGN(p, sz >= 8 ? 8 : 4); 663 if (initial_boot_params->version < 0x10)
664 p = _ALIGN(p, sz >= 8 ? 8 : 4);
658 p += sz; 665 p += sz;
659 p = _ALIGN(p, 4); 666 p = _ALIGN(p, 4);
660 continue; 667 continue;
@@ -664,9 +671,18 @@ static int __init scan_flat_dt(int (*it)(unsigned long node,
664 " device tree !\n", tag); 671 " device tree !\n", tag);
665 return -EINVAL; 672 return -EINVAL;
666 } 673 }
674 depth++;
667 pathp = (char *)p; 675 pathp = (char *)p;
668 p = _ALIGN(p + strlen(pathp) + 1, 4); 676 p = _ALIGN(p + strlen(pathp) + 1, 4);
669 rc = it(p, pathp, data); 677 if ((*pathp) == '/') {
678 char *lp, *np;
679 for (lp = NULL, np = pathp; *np; np++)
680 if ((*np) == '/')
681 lp = np+1;
682 if (lp != NULL)
683 pathp = lp;
684 }
685 rc = it(p, pathp, depth, data);
670 if (rc != 0) 686 if (rc != 0)
671 break; 687 break;
672 } while(1); 688 } while(1);
@@ -689,17 +705,21 @@ static void* __init get_flat_dt_prop(unsigned long node, const char *name,
689 const char *nstr; 705 const char *nstr;
690 706
691 p += 4; 707 p += 4;
708 if (tag == OF_DT_NOP)
709 continue;
692 if (tag != OF_DT_PROP) 710 if (tag != OF_DT_PROP)
693 return NULL; 711 return NULL;
694 712
695 sz = *((u32 *)p); 713 sz = *((u32 *)p);
696 noff = *((u32 *)(p + 4)); 714 noff = *((u32 *)(p + 4));
697 p += 8; 715 p += 8;
698 p = _ALIGN(p, sz >= 8 ? 8 : 4); 716 if (initial_boot_params->version < 0x10)
717 p = _ALIGN(p, sz >= 8 ? 8 : 4);
699 718
700 nstr = find_flat_dt_string(noff); 719 nstr = find_flat_dt_string(noff);
701 if (nstr == NULL) { 720 if (nstr == NULL) {
702 printk(KERN_WARNING "Can't find property index name !\n"); 721 printk(KERN_WARNING "Can't find property index"
722 " name !\n");
703 return NULL; 723 return NULL;
704 } 724 }
705 if (strcmp(name, nstr) == 0) { 725 if (strcmp(name, nstr) == 0) {
@@ -713,7 +733,7 @@ static void* __init get_flat_dt_prop(unsigned long node, const char *name,
713} 733}
714 734
715static void *__init unflatten_dt_alloc(unsigned long *mem, unsigned long size, 735static void *__init unflatten_dt_alloc(unsigned long *mem, unsigned long size,
716 unsigned long align) 736 unsigned long align)
717{ 737{
718 void *res; 738 void *res;
719 739
@@ -727,13 +747,16 @@ static void *__init unflatten_dt_alloc(unsigned long *mem, unsigned long size,
727static unsigned long __init unflatten_dt_node(unsigned long mem, 747static unsigned long __init unflatten_dt_node(unsigned long mem,
728 unsigned long *p, 748 unsigned long *p,
729 struct device_node *dad, 749 struct device_node *dad,
730 struct device_node ***allnextpp) 750 struct device_node ***allnextpp,
751 unsigned long fpsize)
731{ 752{
732 struct device_node *np; 753 struct device_node *np;
733 struct property *pp, **prev_pp = NULL; 754 struct property *pp, **prev_pp = NULL;
734 char *pathp; 755 char *pathp;
735 u32 tag; 756 u32 tag;
736 unsigned int l; 757 unsigned int l, allocl;
758 int has_name = 0;
759 int new_format = 0;
737 760
738 tag = *((u32 *)(*p)); 761 tag = *((u32 *)(*p));
739 if (tag != OF_DT_BEGIN_NODE) { 762 if (tag != OF_DT_BEGIN_NODE) {
@@ -742,21 +765,62 @@ static unsigned long __init unflatten_dt_node(unsigned long mem,
742 } 765 }
743 *p += 4; 766 *p += 4;
744 pathp = (char *)*p; 767 pathp = (char *)*p;
745 l = strlen(pathp) + 1; 768 l = allocl = strlen(pathp) + 1;
746 *p = _ALIGN(*p + l, 4); 769 *p = _ALIGN(*p + l, 4);
747 770
748 np = unflatten_dt_alloc(&mem, sizeof(struct device_node) + l, 771 /* version 0x10 has a more compact unit name here instead of the full
772 * path. we accumulate the full path size using "fpsize", we'll rebuild
773 * it later. We detect this because the first character of the name is
774 * not '/'.
775 */
776 if ((*pathp) != '/') {
777 new_format = 1;
778 if (fpsize == 0) {
779 /* root node: special case. fpsize accounts for path
780 * plus terminating zero. root node only has '/', so
781 * fpsize should be 2, but we want to avoid the first
782 * level nodes to have two '/' so we use fpsize 1 here
783 */
784 fpsize = 1;
785 allocl = 2;
786 } else {
787 /* account for '/' and path size minus terminal 0
788 * already in 'l'
789 */
790 fpsize += l;
791 allocl = fpsize;
792 }
793 }
794
795
796 np = unflatten_dt_alloc(&mem, sizeof(struct device_node) + allocl,
749 __alignof__(struct device_node)); 797 __alignof__(struct device_node));
750 if (allnextpp) { 798 if (allnextpp) {
751 memset(np, 0, sizeof(*np)); 799 memset(np, 0, sizeof(*np));
752 np->full_name = ((char*)np) + sizeof(struct device_node); 800 np->full_name = ((char*)np) + sizeof(struct device_node);
753 memcpy(np->full_name, pathp, l); 801 if (new_format) {
802 char *p = np->full_name;
803 /* rebuild full path for new format */
804 if (dad && dad->parent) {
805 strcpy(p, dad->full_name);
806#ifdef DEBUG
807 if ((strlen(p) + l + 1) != allocl) {
808 DBG("%s: p: %d, l: %d, a: %d\n",
809 pathp, strlen(p), l, allocl);
810 }
811#endif
812 p += strlen(p);
813 }
814 *(p++) = '/';
815 memcpy(p, pathp, l);
816 } else
817 memcpy(np->full_name, pathp, l);
754 prev_pp = &np->properties; 818 prev_pp = &np->properties;
755 **allnextpp = np; 819 **allnextpp = np;
756 *allnextpp = &np->allnext; 820 *allnextpp = &np->allnext;
757 if (dad != NULL) { 821 if (dad != NULL) {
758 np->parent = dad; 822 np->parent = dad;
759 /* we temporarily use the `next' field as `last_child'. */ 823 /* we temporarily use the next field as `last_child'*/
760 if (dad->next == 0) 824 if (dad->next == 0)
761 dad->child = np; 825 dad->child = np;
762 else 826 else
@@ -770,18 +834,26 @@ static unsigned long __init unflatten_dt_node(unsigned long mem,
770 char *pname; 834 char *pname;
771 835
772 tag = *((u32 *)(*p)); 836 tag = *((u32 *)(*p));
837 if (tag == OF_DT_NOP) {
838 *p += 4;
839 continue;
840 }
773 if (tag != OF_DT_PROP) 841 if (tag != OF_DT_PROP)
774 break; 842 break;
775 *p += 4; 843 *p += 4;
776 sz = *((u32 *)(*p)); 844 sz = *((u32 *)(*p));
777 noff = *((u32 *)((*p) + 4)); 845 noff = *((u32 *)((*p) + 4));
778 *p = _ALIGN((*p) + 8, sz >= 8 ? 8 : 4); 846 *p += 8;
847 if (initial_boot_params->version < 0x10)
848 *p = _ALIGN(*p, sz >= 8 ? 8 : 4);
779 849
780 pname = find_flat_dt_string(noff); 850 pname = find_flat_dt_string(noff);
781 if (pname == NULL) { 851 if (pname == NULL) {
782 printk("Can't find property name in list !\n"); 852 printk("Can't find property name in list !\n");
783 break; 853 break;
784 } 854 }
855 if (strcmp(pname, "name") == 0)
856 has_name = 1;
785 l = strlen(pname) + 1; 857 l = strlen(pname) + 1;
786 pp = unflatten_dt_alloc(&mem, sizeof(struct property), 858 pp = unflatten_dt_alloc(&mem, sizeof(struct property),
787 __alignof__(struct property)); 859 __alignof__(struct property));
@@ -801,6 +873,36 @@ static unsigned long __init unflatten_dt_node(unsigned long mem,
801 } 873 }
802 *p = _ALIGN((*p) + sz, 4); 874 *p = _ALIGN((*p) + sz, 4);
803 } 875 }
876 /* with version 0x10 we may not have the name property, recreate
877 * it here from the unit name if absent
878 */
879 if (!has_name) {
880 char *p = pathp, *ps = pathp, *pa = NULL;
881 int sz;
882
883 while (*p) {
884 if ((*p) == '@')
885 pa = p;
886 if ((*p) == '/')
887 ps = p + 1;
888 p++;
889 }
890 if (pa < ps)
891 pa = p;
892 sz = (pa - ps) + 1;
893 pp = unflatten_dt_alloc(&mem, sizeof(struct property) + sz,
894 __alignof__(struct property));
895 if (allnextpp) {
896 pp->name = "name";
897 pp->length = sz;
898 pp->value = (unsigned char *)(pp + 1);
899 *prev_pp = pp;
900 prev_pp = &pp->next;
901 memcpy(pp->value, ps, sz - 1);
902 ((char *)pp->value)[sz - 1] = 0;
903 DBG("fixed up name for %s -> %s\n", pathp, pp->value);
904 }
905 }
804 if (allnextpp) { 906 if (allnextpp) {
805 *prev_pp = NULL; 907 *prev_pp = NULL;
806 np->name = get_property(np, "name", NULL); 908 np->name = get_property(np, "name", NULL);
@@ -812,11 +914,11 @@ static unsigned long __init unflatten_dt_node(unsigned long mem,
812 np->type = "<NULL>"; 914 np->type = "<NULL>";
813 } 915 }
814 while (tag == OF_DT_BEGIN_NODE) { 916 while (tag == OF_DT_BEGIN_NODE) {
815 mem = unflatten_dt_node(mem, p, np, allnextpp); 917 mem = unflatten_dt_node(mem, p, np, allnextpp, fpsize);
816 tag = *((u32 *)(*p)); 918 tag = *((u32 *)(*p));
817 } 919 }
818 if (tag != OF_DT_END_NODE) { 920 if (tag != OF_DT_END_NODE) {
819 printk("Weird tag at start of node: %x\n", tag); 921 printk("Weird tag at end of node: %x\n", tag);
820 return mem; 922 return mem;
821 } 923 }
822 *p += 4; 924 *p += 4;
@@ -842,21 +944,32 @@ void __init unflatten_device_tree(void)
842 /* First pass, scan for size */ 944 /* First pass, scan for size */
843 start = ((unsigned long)initial_boot_params) + 945 start = ((unsigned long)initial_boot_params) +
844 initial_boot_params->off_dt_struct; 946 initial_boot_params->off_dt_struct;
845 size = unflatten_dt_node(0, &start, NULL, NULL); 947 size = unflatten_dt_node(0, &start, NULL, NULL, 0);
948 size = (size | 3) + 1;
846 949
847 DBG(" size is %lx, allocating...\n", size); 950 DBG(" size is %lx, allocating...\n", size);
848 951
849 /* Allocate memory for the expanded device tree */ 952 /* Allocate memory for the expanded device tree */
850 mem = (unsigned long)abs_to_virt(lmb_alloc(size, 953 mem = lmb_alloc(size + 4, __alignof__(struct device_node));
851 __alignof__(struct device_node))); 954 if (!mem) {
955 DBG("Couldn't allocate memory with lmb_alloc()!\n");
956 panic("Couldn't allocate memory with lmb_alloc()!\n");
957 }
958 mem = (unsigned long)abs_to_virt(mem);
959
960 ((u32 *)mem)[size / 4] = 0xdeadbeef;
961
852 DBG(" unflattening...\n", mem); 962 DBG(" unflattening...\n", mem);
853 963
854 /* Second pass, do actual unflattening */ 964 /* Second pass, do actual unflattening */
855 start = ((unsigned long)initial_boot_params) + 965 start = ((unsigned long)initial_boot_params) +
856 initial_boot_params->off_dt_struct; 966 initial_boot_params->off_dt_struct;
857 unflatten_dt_node(mem, &start, NULL, &allnextp); 967 unflatten_dt_node(mem, &start, NULL, &allnextp, 0);
858 if (*((u32 *)start) != OF_DT_END) 968 if (*((u32 *)start) != OF_DT_END)
859 printk(KERN_WARNING "Weird tag at end of tree: %x\n", *((u32 *)start)); 969 printk(KERN_WARNING "Weird tag at end of tree: %08x\n", *((u32 *)start));
970 if (((u32 *)mem)[size / 4] != 0xdeadbeef)
971 printk(KERN_WARNING "End of tree marker overwritten: %08x\n",
972 ((u32 *)mem)[size / 4] );
860 *allnextp = NULL; 973 *allnextp = NULL;
861 974
862 /* Get pointer to OF "/chosen" node for use everywhere */ 975 /* Get pointer to OF "/chosen" node for use everywhere */
@@ -880,7 +993,7 @@ void __init unflatten_device_tree(void)
880 993
881 994
882static int __init early_init_dt_scan_cpus(unsigned long node, 995static int __init early_init_dt_scan_cpus(unsigned long node,
883 const char *full_path, void *data) 996 const char *uname, int depth, void *data)
884{ 997{
885 char *type = get_flat_dt_prop(node, "device_type", NULL); 998 char *type = get_flat_dt_prop(node, "device_type", NULL);
886 u32 *prop; 999 u32 *prop;
@@ -916,6 +1029,7 @@ static int __init early_init_dt_scan_cpus(unsigned long node,
916 } 1029 }
917 } 1030 }
918 1031
1032#ifdef CONFIG_ALTIVEC
919 /* Check if we have a VMX and eventually update CPU features */ 1033 /* Check if we have a VMX and eventually update CPU features */
920 prop = (u32 *)get_flat_dt_prop(node, "ibm,vmx", NULL); 1034 prop = (u32 *)get_flat_dt_prop(node, "ibm,vmx", NULL);
921 if (prop && (*prop) > 0) { 1035 if (prop && (*prop) > 0) {
@@ -929,6 +1043,7 @@ static int __init early_init_dt_scan_cpus(unsigned long node,
929 cur_cpu_spec->cpu_features |= CPU_FTR_ALTIVEC; 1043 cur_cpu_spec->cpu_features |= CPU_FTR_ALTIVEC;
930 cur_cpu_spec->cpu_user_features |= PPC_FEATURE_HAS_ALTIVEC; 1044 cur_cpu_spec->cpu_user_features |= PPC_FEATURE_HAS_ALTIVEC;
931 } 1045 }
1046#endif /* CONFIG_ALTIVEC */
932 1047
933 /* 1048 /*
934 * Check for an SMT capable CPU and set the CPU feature. We do 1049 * Check for an SMT capable CPU and set the CPU feature. We do
@@ -945,13 +1060,15 @@ static int __init early_init_dt_scan_cpus(unsigned long node,
945} 1060}
946 1061
947static int __init early_init_dt_scan_chosen(unsigned long node, 1062static int __init early_init_dt_scan_chosen(unsigned long node,
948 const char *full_path, void *data) 1063 const char *uname, int depth, void *data)
949{ 1064{
950 u32 *prop; 1065 u32 *prop;
951 u64 *prop64; 1066 u64 *prop64;
952 extern unsigned long memory_limit, tce_alloc_start, tce_alloc_end; 1067 extern unsigned long memory_limit, tce_alloc_start, tce_alloc_end;
953 1068
954 if (strcmp(full_path, "/chosen") != 0) 1069 DBG("search \"chosen\", depth: %d, uname: %s\n", depth, uname);
1070
1071 if (depth != 1 || strcmp(uname, "chosen") != 0)
955 return 0; 1072 return 0;
956 1073
957 /* get platform type */ 1074 /* get platform type */
@@ -1001,18 +1118,20 @@ static int __init early_init_dt_scan_chosen(unsigned long node,
1001} 1118}
1002 1119
1003static int __init early_init_dt_scan_root(unsigned long node, 1120static int __init early_init_dt_scan_root(unsigned long node,
1004 const char *full_path, void *data) 1121 const char *uname, int depth, void *data)
1005{ 1122{
1006 u32 *prop; 1123 u32 *prop;
1007 1124
1008 if (strcmp(full_path, "/") != 0) 1125 if (depth != 0)
1009 return 0; 1126 return 0;
1010 1127
1011 prop = (u32 *)get_flat_dt_prop(node, "#size-cells", NULL); 1128 prop = (u32 *)get_flat_dt_prop(node, "#size-cells", NULL);
1012 dt_root_size_cells = (prop == NULL) ? 1 : *prop; 1129 dt_root_size_cells = (prop == NULL) ? 1 : *prop;
1013 1130 DBG("dt_root_size_cells = %x\n", dt_root_size_cells);
1131
1014 prop = (u32 *)get_flat_dt_prop(node, "#address-cells", NULL); 1132 prop = (u32 *)get_flat_dt_prop(node, "#address-cells", NULL);
1015 dt_root_addr_cells = (prop == NULL) ? 2 : *prop; 1133 dt_root_addr_cells = (prop == NULL) ? 2 : *prop;
1134 DBG("dt_root_addr_cells = %x\n", dt_root_addr_cells);
1016 1135
1017 /* break now */ 1136 /* break now */
1018 return 1; 1137 return 1;
@@ -1040,7 +1159,7 @@ static unsigned long __init dt_mem_next_cell(int s, cell_t **cellp)
1040 1159
1041 1160
1042static int __init early_init_dt_scan_memory(unsigned long node, 1161static int __init early_init_dt_scan_memory(unsigned long node,
1043 const char *full_path, void *data) 1162 const char *uname, int depth, void *data)
1044{ 1163{
1045 char *type = get_flat_dt_prop(node, "device_type", NULL); 1164 char *type = get_flat_dt_prop(node, "device_type", NULL);
1046 cell_t *reg, *endp; 1165 cell_t *reg, *endp;
@@ -1056,7 +1175,9 @@ static int __init early_init_dt_scan_memory(unsigned long node,
1056 1175
1057 endp = reg + (l / sizeof(cell_t)); 1176 endp = reg + (l / sizeof(cell_t));
1058 1177
1059 DBG("memory scan node %s ...\n", full_path); 1178 DBG("memory scan node %s ..., reg size %ld, data: %x %x %x %x, ...\n",
1179 uname, l, reg[0], reg[1], reg[2], reg[3]);
1180
1060 while ((endp - reg) >= (dt_root_addr_cells + dt_root_size_cells)) { 1181 while ((endp - reg) >= (dt_root_addr_cells + dt_root_size_cells)) {
1061 unsigned long base, size; 1182 unsigned long base, size;
1062 1183
@@ -1467,10 +1588,11 @@ struct device_node *of_find_node_by_path(const char *path)
1467 struct device_node *np = allnodes; 1588 struct device_node *np = allnodes;
1468 1589
1469 read_lock(&devtree_lock); 1590 read_lock(&devtree_lock);
1470 for (; np != 0; np = np->allnext) 1591 for (; np != 0; np = np->allnext) {
1471 if (np->full_name != 0 && strcasecmp(np->full_name, path) == 0 1592 if (np->full_name != 0 && strcasecmp(np->full_name, path) == 0
1472 && of_node_get(np)) 1593 && of_node_get(np))
1473 break; 1594 break;
1595 }
1474 read_unlock(&devtree_lock); 1596 read_unlock(&devtree_lock);
1475 return np; 1597 return np;
1476} 1598}
diff --git a/arch/ppc64/kernel/prom_init.c b/arch/ppc64/kernel/prom_init.c
index e248a7950aeb..122283a1d39a 100644
--- a/arch/ppc64/kernel/prom_init.c
+++ b/arch/ppc64/kernel/prom_init.c
@@ -892,7 +892,10 @@ static void __init prom_init_mem(void)
892 if ( RELOC(of_platform) == PLATFORM_PSERIES_LPAR ) 892 if ( RELOC(of_platform) == PLATFORM_PSERIES_LPAR )
893 RELOC(alloc_top) = RELOC(rmo_top); 893 RELOC(alloc_top) = RELOC(rmo_top);
894 else 894 else
895 RELOC(alloc_top) = RELOC(rmo_top) = min(0x40000000ul, RELOC(ram_top)); 895 /* Some RS64 machines have buggy firmware where claims up at 1GB
896 * fails. Cap at 768MB as a workaround. Still plenty of room.
897 */
898 RELOC(alloc_top) = RELOC(rmo_top) = min(0x30000000ul, RELOC(ram_top));
896 899
897 prom_printf("memory layout at init:\n"); 900 prom_printf("memory layout at init:\n");
898 prom_printf(" memory_limit : %x (16 MB aligned)\n", RELOC(prom_memory_limit)); 901 prom_printf(" memory_limit : %x (16 MB aligned)\n", RELOC(prom_memory_limit));
@@ -1534,7 +1537,8 @@ static unsigned long __init dt_find_string(char *str)
1534 */ 1537 */
1535#define MAX_PROPERTY_NAME 64 1538#define MAX_PROPERTY_NAME 64
1536 1539
1537static void __init scan_dt_build_strings(phandle node, unsigned long *mem_start, 1540static void __init scan_dt_build_strings(phandle node,
1541 unsigned long *mem_start,
1538 unsigned long *mem_end) 1542 unsigned long *mem_end)
1539{ 1543{
1540 unsigned long offset = reloc_offset(); 1544 unsigned long offset = reloc_offset();
@@ -1547,16 +1551,21 @@ static void __init scan_dt_build_strings(phandle node, unsigned long *mem_start,
1547 /* get and store all property names */ 1551 /* get and store all property names */
1548 prev_name = RELOC(""); 1552 prev_name = RELOC("");
1549 for (;;) { 1553 for (;;) {
1550 int rc;
1551
1552 /* 64 is max len of name including nul. */ 1554 /* 64 is max len of name including nul. */
1553 namep = make_room(mem_start, mem_end, MAX_PROPERTY_NAME, 1); 1555 namep = make_room(mem_start, mem_end, MAX_PROPERTY_NAME, 1);
1554 rc = call_prom("nextprop", 3, 1, node, prev_name, namep); 1556 if (call_prom("nextprop", 3, 1, node, prev_name, namep) != 1) {
1555 if (rc != 1) {
1556 /* No more nodes: unwind alloc */ 1557 /* No more nodes: unwind alloc */
1557 *mem_start = (unsigned long)namep; 1558 *mem_start = (unsigned long)namep;
1558 break; 1559 break;
1559 } 1560 }
1561
1562 /* skip "name" */
1563 if (strcmp(namep, RELOC("name")) == 0) {
1564 *mem_start = (unsigned long)namep;
1565 prev_name = RELOC("name");
1566 continue;
1567 }
1568 /* get/create string entry */
1560 soff = dt_find_string(namep); 1569 soff = dt_find_string(namep);
1561 if (soff != 0) { 1570 if (soff != 0) {
1562 *mem_start = (unsigned long)namep; 1571 *mem_start = (unsigned long)namep;
@@ -1571,7 +1580,7 @@ static void __init scan_dt_build_strings(phandle node, unsigned long *mem_start,
1571 1580
1572 /* do all our children */ 1581 /* do all our children */
1573 child = call_prom("child", 1, 1, node); 1582 child = call_prom("child", 1, 1, node);
1574 while (child != (phandle)0) { 1583 while (child != 0) {
1575 scan_dt_build_strings(child, mem_start, mem_end); 1584 scan_dt_build_strings(child, mem_start, mem_end);
1576 child = call_prom("peer", 1, 1, child); 1585 child = call_prom("peer", 1, 1, child);
1577 } 1586 }
@@ -1580,16 +1589,13 @@ static void __init scan_dt_build_strings(phandle node, unsigned long *mem_start,
1580static void __init scan_dt_build_struct(phandle node, unsigned long *mem_start, 1589static void __init scan_dt_build_struct(phandle node, unsigned long *mem_start,
1581 unsigned long *mem_end) 1590 unsigned long *mem_end)
1582{ 1591{
1583 int l, align;
1584 phandle child; 1592 phandle child;
1585 char *namep, *prev_name, *sstart, *p, *ep; 1593 char *namep, *prev_name, *sstart, *p, *ep, *lp, *path;
1586 unsigned long soff; 1594 unsigned long soff;
1587 unsigned char *valp; 1595 unsigned char *valp;
1588 unsigned long offset = reloc_offset(); 1596 unsigned long offset = reloc_offset();
1589 char pname[MAX_PROPERTY_NAME]; 1597 static char pname[MAX_PROPERTY_NAME];
1590 char *path; 1598 int l;
1591
1592 path = RELOC(prom_scratch);
1593 1599
1594 dt_push_token(OF_DT_BEGIN_NODE, mem_start, mem_end); 1600 dt_push_token(OF_DT_BEGIN_NODE, mem_start, mem_end);
1595 1601
@@ -1599,23 +1605,33 @@ static void __init scan_dt_build_struct(phandle node, unsigned long *mem_start,
1599 namep, *mem_end - *mem_start); 1605 namep, *mem_end - *mem_start);
1600 if (l >= 0) { 1606 if (l >= 0) {
1601 /* Didn't fit? Get more room. */ 1607 /* Didn't fit? Get more room. */
1602 if (l+1 > *mem_end - *mem_start) { 1608 if ((l+1) > (*mem_end - *mem_start)) {
1603 namep = make_room(mem_start, mem_end, l+1, 1); 1609 namep = make_room(mem_start, mem_end, l+1, 1);
1604 call_prom("package-to-path", 3, 1, node, namep, l); 1610 call_prom("package-to-path", 3, 1, node, namep, l);
1605 } 1611 }
1606 namep[l] = '\0'; 1612 namep[l] = '\0';
1613
1607 /* Fixup an Apple bug where they have bogus \0 chars in the 1614 /* Fixup an Apple bug where they have bogus \0 chars in the
1608 * middle of the path in some properties 1615 * middle of the path in some properties
1609 */ 1616 */
1610 for (p = namep, ep = namep + l; p < ep; p++) 1617 for (p = namep, ep = namep + l; p < ep; p++)
1611 if (*p == '\0') { 1618 if (*p == '\0') {
1612 memmove(p, p+1, ep - p); 1619 memmove(p, p+1, ep - p);
1613 ep--; l--; 1620 ep--; l--; p--;
1614 } 1621 }
1615 *mem_start = _ALIGN(((unsigned long) namep) + strlen(namep) + 1, 4); 1622
1623 /* now try to extract the unit name in that mess */
1624 for (p = namep, lp = NULL; *p; p++)
1625 if (*p == '/')
1626 lp = p + 1;
1627 if (lp != NULL)
1628 memmove(namep, lp, strlen(lp) + 1);
1629 *mem_start = _ALIGN(((unsigned long) namep) +
1630 strlen(namep) + 1, 4);
1616 } 1631 }
1617 1632
1618 /* get it again for debugging */ 1633 /* get it again for debugging */
1634 path = RELOC(prom_scratch);
1619 memset(path, 0, PROM_SCRATCH_SIZE); 1635 memset(path, 0, PROM_SCRATCH_SIZE);
1620 call_prom("package-to-path", 3, 1, node, path, PROM_SCRATCH_SIZE-1); 1636 call_prom("package-to-path", 3, 1, node, path, PROM_SCRATCH_SIZE-1);
1621 1637
@@ -1623,23 +1639,27 @@ static void __init scan_dt_build_struct(phandle node, unsigned long *mem_start,
1623 prev_name = RELOC(""); 1639 prev_name = RELOC("");
1624 sstart = (char *)RELOC(dt_string_start); 1640 sstart = (char *)RELOC(dt_string_start);
1625 for (;;) { 1641 for (;;) {
1626 int rc; 1642 if (call_prom("nextprop", 3, 1, node, prev_name,
1627 1643 RELOC(pname)) != 1)
1628 rc = call_prom("nextprop", 3, 1, node, prev_name, pname);
1629 if (rc != 1)
1630 break; 1644 break;
1631 1645
1646 /* skip "name" */
1647 if (strcmp(RELOC(pname), RELOC("name")) == 0) {
1648 prev_name = RELOC("name");
1649 continue;
1650 }
1651
1632 /* find string offset */ 1652 /* find string offset */
1633 soff = dt_find_string(pname); 1653 soff = dt_find_string(RELOC(pname));
1634 if (soff == 0) { 1654 if (soff == 0) {
1635 prom_printf("WARNING: Can't find string index for <%s>, node %s\n", 1655 prom_printf("WARNING: Can't find string index for"
1636 pname, path); 1656 " <%s>, node %s\n", RELOC(pname), path);
1637 break; 1657 break;
1638 } 1658 }
1639 prev_name = sstart + soff; 1659 prev_name = sstart + soff;
1640 1660
1641 /* get length */ 1661 /* get length */
1642 l = call_prom("getproplen", 2, 1, node, pname); 1662 l = call_prom("getproplen", 2, 1, node, RELOC(pname));
1643 1663
1644 /* sanity checks */ 1664 /* sanity checks */
1645 if (l == PROM_ERROR) 1665 if (l == PROM_ERROR)
@@ -1648,7 +1668,7 @@ static void __init scan_dt_build_struct(phandle node, unsigned long *mem_start,
1648 prom_printf("WARNING: ignoring large property "); 1668 prom_printf("WARNING: ignoring large property ");
1649 /* It seems OF doesn't null-terminate the path :-( */ 1669 /* It seems OF doesn't null-terminate the path :-( */
1650 prom_printf("[%s] ", path); 1670 prom_printf("[%s] ", path);
1651 prom_printf("%s length 0x%x\n", pname, l); 1671 prom_printf("%s length 0x%x\n", RELOC(pname), l);
1652 continue; 1672 continue;
1653 } 1673 }
1654 1674
@@ -1658,17 +1678,16 @@ static void __init scan_dt_build_struct(phandle node, unsigned long *mem_start,
1658 dt_push_token(soff, mem_start, mem_end); 1678 dt_push_token(soff, mem_start, mem_end);
1659 1679
1660 /* push property content */ 1680 /* push property content */
1661 align = (l >= 8) ? 8 : 4; 1681 valp = make_room(mem_start, mem_end, l, 4);
1662 valp = make_room(mem_start, mem_end, l, align); 1682 call_prom("getprop", 4, 1, node, RELOC(pname), valp, l);
1663 call_prom("getprop", 4, 1, node, pname, valp, l);
1664 *mem_start = _ALIGN(*mem_start, 4); 1683 *mem_start = _ALIGN(*mem_start, 4);
1665 } 1684 }
1666 1685
1667 /* Add a "linux,phandle" property. */ 1686 /* Add a "linux,phandle" property. */
1668 soff = dt_find_string(RELOC("linux,phandle")); 1687 soff = dt_find_string(RELOC("linux,phandle"));
1669 if (soff == 0) 1688 if (soff == 0)
1670 prom_printf("WARNING: Can't find string index for <linux-phandle>" 1689 prom_printf("WARNING: Can't find string index for"
1671 " node %s\n", path); 1690 " <linux-phandle> node %s\n", path);
1672 else { 1691 else {
1673 dt_push_token(OF_DT_PROP, mem_start, mem_end); 1692 dt_push_token(OF_DT_PROP, mem_start, mem_end);
1674 dt_push_token(4, mem_start, mem_end); 1693 dt_push_token(4, mem_start, mem_end);
@@ -1679,7 +1698,7 @@ static void __init scan_dt_build_struct(phandle node, unsigned long *mem_start,
1679 1698
1680 /* do all our children */ 1699 /* do all our children */
1681 child = call_prom("child", 1, 1, node); 1700 child = call_prom("child", 1, 1, node);
1682 while (child != (phandle)0) { 1701 while (child != 0) {
1683 scan_dt_build_struct(child, mem_start, mem_end); 1702 scan_dt_build_struct(child, mem_start, mem_end);
1684 child = call_prom("peer", 1, 1, child); 1703 child = call_prom("peer", 1, 1, child);
1685 } 1704 }
@@ -1718,7 +1737,8 @@ static void __init flatten_device_tree(void)
1718 1737
1719 /* Build header and make room for mem rsv map */ 1738 /* Build header and make room for mem rsv map */
1720 mem_start = _ALIGN(mem_start, 4); 1739 mem_start = _ALIGN(mem_start, 4);
1721 hdr = make_room(&mem_start, &mem_end, sizeof(struct boot_param_header), 4); 1740 hdr = make_room(&mem_start, &mem_end,
1741 sizeof(struct boot_param_header), 4);
1722 RELOC(dt_header_start) = (unsigned long)hdr; 1742 RELOC(dt_header_start) = (unsigned long)hdr;
1723 rsvmap = make_room(&mem_start, &mem_end, sizeof(mem_reserve_map), 8); 1743 rsvmap = make_room(&mem_start, &mem_end, sizeof(mem_reserve_map), 8);
1724 1744
@@ -1731,11 +1751,11 @@ static void __init flatten_device_tree(void)
1731 namep = make_room(&mem_start, &mem_end, 16, 1); 1751 namep = make_room(&mem_start, &mem_end, 16, 1);
1732 strcpy(namep, RELOC("linux,phandle")); 1752 strcpy(namep, RELOC("linux,phandle"));
1733 mem_start = (unsigned long)namep + strlen(namep) + 1; 1753 mem_start = (unsigned long)namep + strlen(namep) + 1;
1734 RELOC(dt_string_end) = mem_start;
1735 1754
1736 /* Build string array */ 1755 /* Build string array */
1737 prom_printf("Building dt strings...\n"); 1756 prom_printf("Building dt strings...\n");
1738 scan_dt_build_strings(root, &mem_start, &mem_end); 1757 scan_dt_build_strings(root, &mem_start, &mem_end);
1758 RELOC(dt_string_end) = mem_start;
1739 1759
1740 /* Build structure */ 1760 /* Build structure */
1741 mem_start = PAGE_ALIGN(mem_start); 1761 mem_start = PAGE_ALIGN(mem_start);
@@ -1750,9 +1770,11 @@ static void __init flatten_device_tree(void)
1750 hdr->totalsize = RELOC(dt_struct_end) - RELOC(dt_header_start); 1770 hdr->totalsize = RELOC(dt_struct_end) - RELOC(dt_header_start);
1751 hdr->off_dt_struct = RELOC(dt_struct_start) - RELOC(dt_header_start); 1771 hdr->off_dt_struct = RELOC(dt_struct_start) - RELOC(dt_header_start);
1752 hdr->off_dt_strings = RELOC(dt_string_start) - RELOC(dt_header_start); 1772 hdr->off_dt_strings = RELOC(dt_string_start) - RELOC(dt_header_start);
1773 hdr->dt_strings_size = RELOC(dt_string_end) - RELOC(dt_string_start);
1753 hdr->off_mem_rsvmap = ((unsigned long)rsvmap) - RELOC(dt_header_start); 1774 hdr->off_mem_rsvmap = ((unsigned long)rsvmap) - RELOC(dt_header_start);
1754 hdr->version = OF_DT_VERSION; 1775 hdr->version = OF_DT_VERSION;
1755 hdr->last_comp_version = 1; 1776 /* Version 16 is not backward compatible */
1777 hdr->last_comp_version = 0x10;
1756 1778
1757 /* Reserve the whole thing and copy the reserve map in, we 1779 /* Reserve the whole thing and copy the reserve map in, we
1758 * also bump mem_reserve_cnt to cause further reservations to 1780 * also bump mem_reserve_cnt to cause further reservations to
@@ -1803,11 +1825,14 @@ static void __init fixup_device_tree(void)
1803 if (prom_getprop(u3, "device-rev", &u3_rev, sizeof(u3_rev)) 1825 if (prom_getprop(u3, "device-rev", &u3_rev, sizeof(u3_rev))
1804 == PROM_ERROR) 1826 == PROM_ERROR)
1805 return; 1827 return;
1806 if (u3_rev != 0x35) 1828 if (u3_rev != 0x35 && u3_rev != 0x37)
1807 return; 1829 return;
1808 /* does it need fixup ? */ 1830 /* does it need fixup ? */
1809 if (prom_getproplen(i2c, "interrupts") > 0) 1831 if (prom_getproplen(i2c, "interrupts") > 0)
1810 return; 1832 return;
1833
1834 prom_printf("fixing up bogus interrupts for u3 i2c...\n");
1835
1811 /* interrupt on this revision of u3 is number 0 and level */ 1836 /* interrupt on this revision of u3 is number 0 and level */
1812 interrupts[0] = 0; 1837 interrupts[0] = 0;
1813 interrupts[1] = 1; 1838 interrupts[1] = 1;
diff --git a/arch/ppc64/kernel/rtas_pci.c b/arch/ppc64/kernel/rtas_pci.c
index 1048817befb8..1dccadaddd1d 100644
--- a/arch/ppc64/kernel/rtas_pci.c
+++ b/arch/ppc64/kernel/rtas_pci.c
@@ -58,6 +58,21 @@ static int config_access_valid(struct device_node *dn, int where)
58 return 0; 58 return 0;
59} 59}
60 60
61static int of_device_available(struct device_node * dn)
62{
63 char * status;
64
65 status = get_property(dn, "status", NULL);
66
67 if (!status)
68 return 1;
69
70 if (!strcmp(status, "okay"))
71 return 1;
72
73 return 0;
74}
75
61static int rtas_read_config(struct device_node *dn, int where, int size, u32 *val) 76static int rtas_read_config(struct device_node *dn, int where, int size, u32 *val)
62{ 77{
63 int returnval = -1; 78 int returnval = -1;
@@ -103,7 +118,7 @@ static int rtas_pci_read_config(struct pci_bus *bus,
103 118
104 /* Search only direct children of the bus */ 119 /* Search only direct children of the bus */
105 for (dn = busdn->child; dn; dn = dn->sibling) 120 for (dn = busdn->child; dn; dn = dn->sibling)
106 if (dn->devfn == devfn) 121 if (dn->devfn == devfn && of_device_available(dn))
107 return rtas_read_config(dn, where, size, val); 122 return rtas_read_config(dn, where, size, val);
108 return PCIBIOS_DEVICE_NOT_FOUND; 123 return PCIBIOS_DEVICE_NOT_FOUND;
109} 124}
@@ -146,7 +161,7 @@ static int rtas_pci_write_config(struct pci_bus *bus,
146 161
147 /* Search only direct children of the bus */ 162 /* Search only direct children of the bus */
148 for (dn = busdn->child; dn; dn = dn->sibling) 163 for (dn = busdn->child; dn; dn = dn->sibling)
149 if (dn->devfn == devfn) 164 if (dn->devfn == devfn && of_device_available(dn))
150 return rtas_write_config(dn, where, size, val); 165 return rtas_write_config(dn, where, size, val);
151 return PCIBIOS_DEVICE_NOT_FOUND; 166 return PCIBIOS_DEVICE_NOT_FOUND;
152} 167}
diff --git a/arch/ppc64/kernel/rtasd.c b/arch/ppc64/kernel/rtasd.c
index b0c3b829fe47..e26b0420b6dd 100644
--- a/arch/ppc64/kernel/rtasd.c
+++ b/arch/ppc64/kernel/rtasd.c
@@ -19,6 +19,7 @@
19#include <linux/vmalloc.h> 19#include <linux/vmalloc.h>
20#include <linux/spinlock.h> 20#include <linux/spinlock.h>
21#include <linux/cpu.h> 21#include <linux/cpu.h>
22#include <linux/delay.h>
22 23
23#include <asm/uaccess.h> 24#include <asm/uaccess.h>
24#include <asm/io.h> 25#include <asm/io.h>
@@ -412,8 +413,7 @@ static void do_event_scan_all_cpus(long delay)
412 413
413 /* Drop hotplug lock, and sleep for the specified delay */ 414 /* Drop hotplug lock, and sleep for the specified delay */
414 unlock_cpu_hotplug(); 415 unlock_cpu_hotplug();
415 set_current_state(TASK_INTERRUPTIBLE); 416 msleep_interruptible(delay);
416 schedule_timeout(delay);
417 lock_cpu_hotplug(); 417 lock_cpu_hotplug();
418 418
419 cpu = next_cpu(cpu, cpu_online_map); 419 cpu = next_cpu(cpu, cpu_online_map);
@@ -442,7 +442,7 @@ static int rtasd(void *unused)
442 442
443 printk(KERN_INFO "RTAS daemon started\n"); 443 printk(KERN_INFO "RTAS daemon started\n");
444 444
445 DEBUG("will sleep for %d jiffies\n", (HZ*60/rtas_event_scan_rate) / 2); 445 DEBUG("will sleep for %d milliseconds\n", (30000/rtas_event_scan_rate));
446 446
447 /* See if we have any error stored in NVRAM */ 447 /* See if we have any error stored in NVRAM */
448 memset(logdata, 0, rtas_error_log_max); 448 memset(logdata, 0, rtas_error_log_max);
@@ -459,7 +459,7 @@ static int rtasd(void *unused)
459 } 459 }
460 460
461 /* First pass. */ 461 /* First pass. */
462 do_event_scan_all_cpus(HZ); 462 do_event_scan_all_cpus(1000);
463 463
464 if (surveillance_timeout != -1) { 464 if (surveillance_timeout != -1) {
465 DEBUG("enabling surveillance\n"); 465 DEBUG("enabling surveillance\n");
@@ -471,7 +471,7 @@ static int rtasd(void *unused)
471 * machines have problems if we call event-scan too 471 * machines have problems if we call event-scan too
472 * quickly. */ 472 * quickly. */
473 for (;;) 473 for (;;)
474 do_event_scan_all_cpus((HZ*60/rtas_event_scan_rate) / 2); 474 do_event_scan_all_cpus(30000/rtas_event_scan_rate);
475 475
476error: 476error:
477 /* Should delete proc entries */ 477 /* Should delete proc entries */
diff --git a/arch/ppc64/kernel/rtc.c b/arch/ppc64/kernel/rtc.c
index d729fefa0df5..6ff52bc61325 100644
--- a/arch/ppc64/kernel/rtc.c
+++ b/arch/ppc64/kernel/rtc.c
@@ -35,6 +35,7 @@
35#include <linux/spinlock.h> 35#include <linux/spinlock.h>
36#include <linux/bcd.h> 36#include <linux/bcd.h>
37#include <linux/interrupt.h> 37#include <linux/interrupt.h>
38#include <linux/delay.h>
38 39
39#include <asm/io.h> 40#include <asm/io.h>
40#include <asm/uaccess.h> 41#include <asm/uaccess.h>
@@ -351,8 +352,7 @@ void rtas_get_rtc_time(struct rtc_time *rtc_tm)
351 return; /* delay not allowed */ 352 return; /* delay not allowed */
352 } 353 }
353 wait_time = rtas_extended_busy_delay_time(error); 354 wait_time = rtas_extended_busy_delay_time(error);
354 set_current_state(TASK_INTERRUPTIBLE); 355 msleep_interruptible(wait_time);
355 schedule_timeout(wait_time);
356 error = RTAS_CLOCK_BUSY; 356 error = RTAS_CLOCK_BUSY;
357 } 357 }
358 } while (error == RTAS_CLOCK_BUSY && (__get_tb() < max_wait_tb)); 358 } while (error == RTAS_CLOCK_BUSY && (__get_tb() < max_wait_tb));
@@ -386,8 +386,7 @@ int rtas_set_rtc_time(struct rtc_time *tm)
386 if (in_interrupt()) 386 if (in_interrupt())
387 return 1; /* probably decrementer */ 387 return 1; /* probably decrementer */
388 wait_time = rtas_extended_busy_delay_time(error); 388 wait_time = rtas_extended_busy_delay_time(error);
389 set_current_state(TASK_INTERRUPTIBLE); 389 msleep_interruptible(wait_time);
390 schedule_timeout(wait_time);
391 error = RTAS_CLOCK_BUSY; 390 error = RTAS_CLOCK_BUSY;
392 } 391 }
393 } while (error == RTAS_CLOCK_BUSY && (__get_tb() < max_wait_tb)); 392 } while (error == RTAS_CLOCK_BUSY && (__get_tb() < max_wait_tb));
diff --git a/arch/ppc64/kernel/scanlog.c b/arch/ppc64/kernel/scanlog.c
index 4d70736619c7..215bf8900304 100644
--- a/arch/ppc64/kernel/scanlog.c
+++ b/arch/ppc64/kernel/scanlog.c
@@ -25,6 +25,7 @@
25#include <linux/errno.h> 25#include <linux/errno.h>
26#include <linux/proc_fs.h> 26#include <linux/proc_fs.h>
27#include <linux/init.h> 27#include <linux/init.h>
28#include <linux/delay.h>
28#include <asm/uaccess.h> 29#include <asm/uaccess.h>
29#include <asm/rtas.h> 30#include <asm/rtas.h>
30#include <asm/prom.h> 31#include <asm/prom.h>
@@ -77,7 +78,7 @@ static ssize_t scanlog_read(struct file *file, char __user *buf,
77 return -EFAULT; 78 return -EFAULT;
78 79
79 for (;;) { 80 for (;;) {
80 wait_time = HZ/2; /* default wait if no data */ 81 wait_time = 500; /* default wait if no data */
81 spin_lock(&rtas_data_buf_lock); 82 spin_lock(&rtas_data_buf_lock);
82 memcpy(rtas_data_buf, data, RTAS_DATA_BUF_SIZE); 83 memcpy(rtas_data_buf, data, RTAS_DATA_BUF_SIZE);
83 status = rtas_call(ibm_scan_log_dump, 2, 1, NULL, 84 status = rtas_call(ibm_scan_log_dump, 2, 1, NULL,
@@ -107,24 +108,14 @@ static ssize_t scanlog_read(struct file *file, char __user *buf,
107 break; 108 break;
108 default: 109 default:
109 if (status > 9900 && status <= 9905) { 110 if (status > 9900 && status <= 9905) {
110 /* No data. RTAS is hinting at a delay required 111 wait_time = rtas_extended_busy_delay_time(status);
111 * between 1-100000 milliseconds
112 */
113 int ms = 1;
114 for (; status > 9900; status--)
115 ms = ms * 10;
116 /* Use microseconds for reasonable accuracy */
117 ms *= 1000;
118 wait_time = ms / (1000000/HZ); /* round down is fine */
119 /* Fall through to sleep */
120 } else { 112 } else {
121 printk(KERN_ERR "scanlog: unknown error from rtas: %d\n", status); 113 printk(KERN_ERR "scanlog: unknown error from rtas: %d\n", status);
122 return -EIO; 114 return -EIO;
123 } 115 }
124 } 116 }
125 /* Apparently no data yet. Wait and try again. */ 117 /* Apparently no data yet. Wait and try again. */
126 set_current_state(TASK_INTERRUPTIBLE); 118 msleep_interruptible(wait_time);
127 schedule_timeout(wait_time);
128 } 119 }
129 /*NOTREACHED*/ 120 /*NOTREACHED*/
130} 121}
diff --git a/arch/ppc64/kernel/setup.c b/arch/ppc64/kernel/setup.c
index d1b33f0b26cb..ee3b20de2e7a 100644
--- a/arch/ppc64/kernel/setup.c
+++ b/arch/ppc64/kernel/setup.c
@@ -536,15 +536,19 @@ static void __init check_for_initrd(void)
536 536
537 DBG(" -> check_for_initrd()\n"); 537 DBG(" -> check_for_initrd()\n");
538 538
539 prop = (u64 *)get_property(of_chosen, "linux,initrd-start", NULL); 539 if (of_chosen) {
540 if (prop != NULL) { 540 prop = (u64 *)get_property(of_chosen,
541 initrd_start = (unsigned long)__va(*prop); 541 "linux,initrd-start", NULL);
542 prop = (u64 *)get_property(of_chosen, "linux,initrd-end", NULL);
543 if (prop != NULL) { 542 if (prop != NULL) {
544 initrd_end = (unsigned long)__va(*prop); 543 initrd_start = (unsigned long)__va(*prop);
545 initrd_below_start_ok = 1; 544 prop = (u64 *)get_property(of_chosen,
546 } else 545 "linux,initrd-end", NULL);
547 initrd_start = 0; 546 if (prop != NULL) {
547 initrd_end = (unsigned long)__va(*prop);
548 initrd_below_start_ok = 1;
549 } else
550 initrd_start = 0;
551 }
548 } 552 }
549 553
550 /* If we were passed an initrd, set the ROOT_DEV properly if the values 554 /* If we were passed an initrd, set the ROOT_DEV properly if the values
@@ -627,7 +631,7 @@ void __init setup_system(void)
627 * Initialize xmon 631 * Initialize xmon
628 */ 632 */
629#ifdef CONFIG_XMON_DEFAULT 633#ifdef CONFIG_XMON_DEFAULT
630 xmon_init(); 634 xmon_init(1);
631#endif 635#endif
632 /* 636 /*
633 * Register early console 637 * Register early console
@@ -694,7 +698,6 @@ void machine_restart(char *cmd)
694 local_irq_disable(); 698 local_irq_disable();
695 while (1) ; 699 while (1) ;
696} 700}
697EXPORT_SYMBOL(machine_restart);
698 701
699void machine_power_off(void) 702void machine_power_off(void)
700{ 703{
@@ -707,7 +710,8 @@ void machine_power_off(void)
707 local_irq_disable(); 710 local_irq_disable();
708 while (1) ; 711 while (1) ;
709} 712}
710EXPORT_SYMBOL(machine_power_off); 713/* Used by the G5 thermal driver */
714EXPORT_SYMBOL_GPL(machine_power_off);
711 715
712void machine_halt(void) 716void machine_halt(void)
713{ 717{
@@ -720,7 +724,6 @@ void machine_halt(void)
720 local_irq_disable(); 724 local_irq_disable();
721 while (1) ; 725 while (1) ;
722} 726}
723EXPORT_SYMBOL(machine_halt);
724 727
725static int ppc64_panic_event(struct notifier_block *this, 728static int ppc64_panic_event(struct notifier_block *this,
726 unsigned long event, void *ptr) 729 unsigned long event, void *ptr)
@@ -1071,6 +1074,8 @@ void __init setup_arch(char **cmdline_p)
1071 irqstack_early_init(); 1074 irqstack_early_init();
1072 emergency_stack_init(); 1075 emergency_stack_init();
1073 1076
1077 stabs_alloc();
1078
1074 /* set up the bootmem stuff with available memory */ 1079 /* set up the bootmem stuff with available memory */
1075 do_init_bootmem(); 1080 do_init_bootmem();
1076 sparse_init(); 1081 sparse_init();
@@ -1342,11 +1347,13 @@ static int __init early_xmon(char *p)
1342 /* ensure xmon is enabled */ 1347 /* ensure xmon is enabled */
1343 if (p) { 1348 if (p) {
1344 if (strncmp(p, "on", 2) == 0) 1349 if (strncmp(p, "on", 2) == 0)
1345 xmon_init(); 1350 xmon_init(1);
1351 if (strncmp(p, "off", 3) == 0)
1352 xmon_init(0);
1346 if (strncmp(p, "early", 5) != 0) 1353 if (strncmp(p, "early", 5) != 0)
1347 return 0; 1354 return 0;
1348 } 1355 }
1349 xmon_init(); 1356 xmon_init(1);
1350 debugger(NULL); 1357 debugger(NULL);
1351 1358
1352 return 0; 1359 return 0;
diff --git a/arch/ppc64/kernel/signal.c b/arch/ppc64/kernel/signal.c
index bf782276984c..49a79a55c32d 100644
--- a/arch/ppc64/kernel/signal.c
+++ b/arch/ppc64/kernel/signal.c
@@ -481,10 +481,11 @@ static int handle_signal(unsigned long sig, struct k_sigaction *ka,
481 /* Set up Signal Frame */ 481 /* Set up Signal Frame */
482 ret = setup_rt_frame(sig, ka, info, oldset, regs); 482 ret = setup_rt_frame(sig, ka, info, oldset, regs);
483 483
484 if (ret && !(ka->sa.sa_flags & SA_NODEFER)) { 484 if (ret) {
485 spin_lock_irq(&current->sighand->siglock); 485 spin_lock_irq(&current->sighand->siglock);
486 sigorsets(&current->blocked, &current->blocked, &ka->sa.sa_mask); 486 sigorsets(&current->blocked, &current->blocked, &ka->sa.sa_mask);
487 sigaddset(&current->blocked,sig); 487 if (!(ka->sa.sa_flags & SA_NODEFER))
488 sigaddset(&current->blocked,sig);
488 recalc_sigpending(); 489 recalc_sigpending();
489 spin_unlock_irq(&current->sighand->siglock); 490 spin_unlock_irq(&current->sighand->siglock);
490 } 491 }
diff --git a/arch/ppc64/kernel/signal32.c b/arch/ppc64/kernel/signal32.c
index 3c2fa5c284c0..46f4d6cc7fc9 100644
--- a/arch/ppc64/kernel/signal32.c
+++ b/arch/ppc64/kernel/signal32.c
@@ -976,11 +976,12 @@ int do_signal32(sigset_t *oldset, struct pt_regs *regs)
976 else 976 else
977 ret = handle_signal32(signr, &ka, &info, oldset, regs, newsp); 977 ret = handle_signal32(signr, &ka, &info, oldset, regs, newsp);
978 978
979 if (ret && !(ka.sa.sa_flags & SA_NODEFER)) { 979 if (ret) {
980 spin_lock_irq(&current->sighand->siglock); 980 spin_lock_irq(&current->sighand->siglock);
981 sigorsets(&current->blocked, &current->blocked, 981 sigorsets(&current->blocked, &current->blocked,
982 &ka.sa.sa_mask); 982 &ka.sa.sa_mask);
983 sigaddset(&current->blocked, signr); 983 if (!(ka.sa.sa_flags & SA_NODEFER))
984 sigaddset(&current->blocked, signr);
984 recalc_sigpending(); 985 recalc_sigpending();
985 spin_unlock_irq(&current->sighand->siglock); 986 spin_unlock_irq(&current->sighand->siglock);
986 } 987 }
diff --git a/arch/ppc64/kernel/smp.c b/arch/ppc64/kernel/smp.c
index 2fcddfcb594d..793b562da653 100644
--- a/arch/ppc64/kernel/smp.c
+++ b/arch/ppc64/kernel/smp.c
@@ -65,8 +65,6 @@ struct smp_ops_t *smp_ops;
65 65
66static volatile unsigned int cpu_callin_map[NR_CPUS]; 66static volatile unsigned int cpu_callin_map[NR_CPUS];
67 67
68extern unsigned char stab_array[];
69
70void smp_call_function_interrupt(void); 68void smp_call_function_interrupt(void);
71 69
72int smt_enabled_at_boot = 1; 70int smt_enabled_at_boot = 1;
@@ -492,19 +490,6 @@ int __devinit __cpu_up(unsigned int cpu)
492 490
493 paca[cpu].default_decr = tb_ticks_per_jiffy; 491 paca[cpu].default_decr = tb_ticks_per_jiffy;
494 492
495 if (!cpu_has_feature(CPU_FTR_SLB)) {
496 void *tmp;
497
498 /* maximum of 48 CPUs on machines with a segment table */
499 if (cpu >= 48)
500 BUG();
501
502 tmp = &stab_array[PAGE_SIZE * cpu];
503 memset(tmp, 0, PAGE_SIZE);
504 paca[cpu].stab_addr = (unsigned long)tmp;
505 paca[cpu].stab_real = virt_to_abs(tmp);
506 }
507
508 /* Make sure callin-map entry is 0 (can be leftover a CPU 493 /* Make sure callin-map entry is 0 (can be leftover a CPU
509 * hotplug 494 * hotplug
510 */ 495 */
diff --git a/arch/ppc64/kernel/sysfs.c b/arch/ppc64/kernel/sysfs.c
index 02b8ac4e0168..f311ee7c0070 100644
--- a/arch/ppc64/kernel/sysfs.c
+++ b/arch/ppc64/kernel/sysfs.c
@@ -13,6 +13,7 @@
13#include <asm/current.h> 13#include <asm/current.h>
14#include <asm/processor.h> 14#include <asm/processor.h>
15#include <asm/cputable.h> 15#include <asm/cputable.h>
16#include <asm/firmware.h>
16#include <asm/hvcall.h> 17#include <asm/hvcall.h>
17#include <asm/prom.h> 18#include <asm/prom.h>
18#include <asm/systemcfg.h> 19#include <asm/systemcfg.h>
@@ -100,6 +101,8 @@ static int __init setup_smt_snooze_delay(char *str)
100} 101}
101__setup("smt-snooze-delay=", setup_smt_snooze_delay); 102__setup("smt-snooze-delay=", setup_smt_snooze_delay);
102 103
104#endif /* CONFIG_PPC_MULTIPLATFORM */
105
103/* 106/*
104 * Enabling PMCs will slow partition context switch times so we only do 107 * Enabling PMCs will slow partition context switch times so we only do
105 * it the first time we write to the PMCs. 108 * it the first time we write to the PMCs.
@@ -109,65 +112,15 @@ static DEFINE_PER_CPU(char, pmcs_enabled);
109 112
110void ppc64_enable_pmcs(void) 113void ppc64_enable_pmcs(void)
111{ 114{
112 unsigned long hid0;
113#ifdef CONFIG_PPC_PSERIES
114 unsigned long set, reset;
115#endif /* CONFIG_PPC_PSERIES */
116
117 /* Only need to enable them once */ 115 /* Only need to enable them once */
118 if (__get_cpu_var(pmcs_enabled)) 116 if (__get_cpu_var(pmcs_enabled))
119 return; 117 return;
120 118
121 __get_cpu_var(pmcs_enabled) = 1; 119 __get_cpu_var(pmcs_enabled) = 1;
122 120
123 switch (systemcfg->platform) { 121 if (ppc_md.enable_pmcs)
124 case PLATFORM_PSERIES: 122 ppc_md.enable_pmcs();
125 case PLATFORM_POWERMAC:
126 hid0 = mfspr(HID0);
127 hid0 |= 1UL << (63 - 20);
128
129 /* POWER4 requires the following sequence */
130 asm volatile(
131 "sync\n"
132 "mtspr %1, %0\n"
133 "mfspr %0, %1\n"
134 "mfspr %0, %1\n"
135 "mfspr %0, %1\n"
136 "mfspr %0, %1\n"
137 "mfspr %0, %1\n"
138 "mfspr %0, %1\n"
139 "isync" : "=&r" (hid0) : "i" (HID0), "0" (hid0):
140 "memory");
141 break;
142
143#ifdef CONFIG_PPC_PSERIES
144 case PLATFORM_PSERIES_LPAR:
145 set = 1UL << 63;
146 reset = 0;
147 plpar_hcall_norets(H_PERFMON, set, reset);
148 break;
149#endif /* CONFIG_PPC_PSERIES */
150
151 default:
152 break;
153 }
154
155#ifdef CONFIG_PPC_PSERIES
156 /* instruct hypervisor to maintain PMCs */
157 if (cur_cpu_spec->firmware_features & FW_FEATURE_SPLPAR)
158 get_paca()->lppaca.pmcregs_in_use = 1;
159#endif /* CONFIG_PPC_PSERIES */
160} 123}
161
162#else
163
164/* PMC stuff */
165void ppc64_enable_pmcs(void)
166{
167 /* XXX Implement for iseries */
168}
169#endif /* CONFIG_PPC_MULTIPLATFORM */
170
171EXPORT_SYMBOL(ppc64_enable_pmcs); 124EXPORT_SYMBOL(ppc64_enable_pmcs);
172 125
173/* XXX convert to rusty's on_one_cpu */ 126/* XXX convert to rusty's on_one_cpu */
diff --git a/arch/ppc64/kernel/time.c b/arch/ppc64/kernel/time.c
index 909462e1adea..1696e1b05bb9 100644
--- a/arch/ppc64/kernel/time.c
+++ b/arch/ppc64/kernel/time.c
@@ -67,6 +67,7 @@
67#include <asm/prom.h> 67#include <asm/prom.h>
68#include <asm/sections.h> 68#include <asm/sections.h>
69#include <asm/systemcfg.h> 69#include <asm/systemcfg.h>
70#include <asm/firmware.h>
70 71
71u64 jiffies_64 __cacheline_aligned_in_smp = INITIAL_JIFFIES; 72u64 jiffies_64 __cacheline_aligned_in_smp = INITIAL_JIFFIES;
72 73
@@ -370,13 +371,11 @@ int timer_interrupt(struct pt_regs * regs)
370 process_hvlpevents(regs); 371 process_hvlpevents(regs);
371#endif 372#endif
372 373
373/* collect purr register values often, for accurate calculations */ 374 /* collect purr register values often, for accurate calculations */
374#if defined(CONFIG_PPC_PSERIES) 375 if (firmware_has_feature(FW_FEATURE_SPLPAR)) {
375 if (cur_cpu_spec->firmware_features & FW_FEATURE_SPLPAR) {
376 struct cpu_usage *cu = &__get_cpu_var(cpu_usage_array); 376 struct cpu_usage *cu = &__get_cpu_var(cpu_usage_array);
377 cu->current_tb = mfspr(SPRN_PURR); 377 cu->current_tb = mfspr(SPRN_PURR);
378 } 378 }
379#endif
380 379
381 irq_exit(); 380 irq_exit();
382 381
diff --git a/arch/ppc64/kernel/udbg.c b/arch/ppc64/kernel/udbg.c
index d4ccd6f1ef47..c0da45540f0f 100644
--- a/arch/ppc64/kernel/udbg.c
+++ b/arch/ppc64/kernel/udbg.c
@@ -141,7 +141,7 @@ void udbg_init_scc(struct device_node *np)
141 141
142#endif /* CONFIG_PPC_PMAC */ 142#endif /* CONFIG_PPC_PMAC */
143 143
144#if CONFIG_PPC_PMAC 144#ifdef CONFIG_PPC_PMAC
145static void udbg_real_putc(unsigned char c) 145static void udbg_real_putc(unsigned char c)
146{ 146{
147 while ((real_readb(sccc) & SCC_TXRDY) == 0) 147 while ((real_readb(sccc) & SCC_TXRDY) == 0)
diff --git a/arch/ppc64/kernel/vio.c b/arch/ppc64/kernel/vio.c
index 0c0ba71ac0e8..c90e1dd875ce 100644
--- a/arch/ppc64/kernel/vio.c
+++ b/arch/ppc64/kernel/vio.c
@@ -1,10 +1,11 @@
1/* 1/*
2 * IBM PowerPC Virtual I/O Infrastructure Support. 2 * IBM PowerPC Virtual I/O Infrastructure Support.
3 * 3 *
4 * Copyright (c) 2003 IBM Corp. 4 * Copyright (c) 2003-2005 IBM Corp.
5 * Dave Engebretsen engebret@us.ibm.com 5 * Dave Engebretsen engebret@us.ibm.com
6 * Santiago Leon santil@us.ibm.com 6 * Santiago Leon santil@us.ibm.com
7 * Hollis Blanchard <hollisb@us.ibm.com> 7 * Hollis Blanchard <hollisb@us.ibm.com>
8 * Stephen Rothwell
8 * 9 *
9 * This program is free software; you can redistribute it and/or 10 * This program is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU General Public License 11 * modify it under the terms of the GNU General Public License
@@ -14,61 +15,30 @@
14 15
15#include <linux/init.h> 16#include <linux/init.h>
16#include <linux/console.h> 17#include <linux/console.h>
17#include <linux/version.h>
18#include <linux/module.h> 18#include <linux/module.h>
19#include <linux/kobject.h>
20#include <linux/mm.h> 19#include <linux/mm.h>
21#include <linux/dma-mapping.h> 20#include <linux/dma-mapping.h>
22#include <asm/rtas.h>
23#include <asm/iommu.h> 21#include <asm/iommu.h>
24#include <asm/dma.h> 22#include <asm/dma.h>
25#include <asm/ppcdebug.h>
26#include <asm/vio.h> 23#include <asm/vio.h>
27#include <asm/hvcall.h>
28#include <asm/iSeries/vio.h>
29#include <asm/iSeries/HvTypes.h>
30#include <asm/iSeries/HvCallXm.h>
31#include <asm/iSeries/HvLpConfig.h>
32
33#define DBGENTER() pr_debug("%s entered\n", __FUNCTION__)
34
35extern struct subsystem devices_subsys; /* needed for vio_find_name() */
36 24
37static const struct vio_device_id *vio_match_device( 25static const struct vio_device_id *vio_match_device(
38 const struct vio_device_id *, const struct vio_dev *); 26 const struct vio_device_id *, const struct vio_dev *);
39 27
40#ifdef CONFIG_PPC_PSERIES 28struct vio_dev vio_bus_device = { /* fake "parent" device */
41static struct iommu_table *vio_build_iommu_table(struct vio_dev *);
42static int vio_num_address_cells;
43#endif
44#ifdef CONFIG_PPC_ISERIES
45static struct iommu_table veth_iommu_table;
46static struct iommu_table vio_iommu_table;
47#endif
48static struct vio_dev vio_bus_device = { /* fake "parent" device */
49 .name = vio_bus_device.dev.bus_id, 29 .name = vio_bus_device.dev.bus_id,
50 .type = "", 30 .type = "",
51#ifdef CONFIG_PPC_ISERIES
52 .iommu_table = &vio_iommu_table,
53#endif
54 .dev.bus_id = "vio", 31 .dev.bus_id = "vio",
55 .dev.bus = &vio_bus_type, 32 .dev.bus = &vio_bus_type,
56}; 33};
57 34
58#ifdef CONFIG_PPC_ISERIES 35static struct vio_bus_ops vio_bus_ops;
59static struct vio_dev *__init vio_register_device_iseries(char *type,
60 uint32_t unit_num);
61
62struct device *iSeries_vio_dev = &vio_bus_device.dev;
63EXPORT_SYMBOL(iSeries_vio_dev);
64
65#define device_is_compatible(a, b) 1
66 36
67#endif 37/*
68 38 * Convert from struct device to struct vio_dev and pass to driver.
69/* convert from struct device to struct vio_dev and pass to driver.
70 * dev->driver has already been set by generic code because vio_bus_match 39 * dev->driver has already been set by generic code because vio_bus_match
71 * succeeded. */ 40 * succeeded.
41 */
72static int vio_bus_probe(struct device *dev) 42static int vio_bus_probe(struct device *dev)
73{ 43{
74 struct vio_dev *viodev = to_vio_dev(dev); 44 struct vio_dev *viodev = to_vio_dev(dev);
@@ -76,15 +46,12 @@ static int vio_bus_probe(struct device *dev)
76 const struct vio_device_id *id; 46 const struct vio_device_id *id;
77 int error = -ENODEV; 47 int error = -ENODEV;
78 48
79 DBGENTER();
80
81 if (!viodrv->probe) 49 if (!viodrv->probe)
82 return error; 50 return error;
83 51
84 id = vio_match_device(viodrv->id_table, viodev); 52 id = vio_match_device(viodrv->id_table, viodev);
85 if (id) { 53 if (id)
86 error = viodrv->probe(viodev, id); 54 error = viodrv->probe(viodev, id);
87 }
88 55
89 return error; 56 return error;
90} 57}
@@ -95,11 +62,8 @@ static int vio_bus_remove(struct device *dev)
95 struct vio_dev *viodev = to_vio_dev(dev); 62 struct vio_dev *viodev = to_vio_dev(dev);
96 struct vio_driver *viodrv = to_vio_driver(dev->driver); 63 struct vio_driver *viodrv = to_vio_driver(dev->driver);
97 64
98 DBGENTER(); 65 if (viodrv->remove)
99
100 if (viodrv->remove) {
101 return viodrv->remove(viodev); 66 return viodrv->remove(viodev);
102 }
103 67
104 /* driver can't remove */ 68 /* driver can't remove */
105 return 1; 69 return 1;
@@ -135,193 +99,72 @@ void vio_unregister_driver(struct vio_driver *viodrv)
135EXPORT_SYMBOL(vio_unregister_driver); 99EXPORT_SYMBOL(vio_unregister_driver);
136 100
137/** 101/**
138 * vio_match_device: - Tell if a VIO device has a matching VIO device id structure. 102 * vio_match_device: - Tell if a VIO device has a matching
139 * @ids: array of VIO device id structures to search in 103 * VIO device id structure.
140 * @dev: the VIO device structure to match against 104 * @ids: array of VIO device id structures to search in
105 * @dev: the VIO device structure to match against
141 * 106 *
142 * Used by a driver to check whether a VIO device present in the 107 * Used by a driver to check whether a VIO device present in the
143 * system is in its list of supported devices. Returns the matching 108 * system is in its list of supported devices. Returns the matching
144 * vio_device_id structure or NULL if there is no match. 109 * vio_device_id structure or NULL if there is no match.
145 */ 110 */
146static const struct vio_device_id * vio_match_device(const struct vio_device_id *ids, 111static const struct vio_device_id *vio_match_device(
147 const struct vio_dev *dev) 112 const struct vio_device_id *ids, const struct vio_dev *dev)
148{ 113{
149 DBGENTER(); 114 while (ids->type[0] != '\0') {
150 115 if (vio_bus_ops.match(ids, dev))
151 while (ids->type) {
152 if ((strncmp(dev->type, ids->type, strlen(ids->type)) == 0) &&
153 device_is_compatible(dev->dev.platform_data, ids->compat))
154 return ids; 116 return ids;
155 ids++; 117 ids++;
156 } 118 }
157 return NULL; 119 return NULL;
158} 120}
159 121
160#ifdef CONFIG_PPC_ISERIES
161void __init iommu_vio_init(void)
162{
163 struct iommu_table *t;
164 struct iommu_table_cb cb;
165 unsigned long cbp;
166 unsigned long itc_entries;
167
168 cb.itc_busno = 255; /* Bus 255 is the virtual bus */
169 cb.itc_virtbus = 0xff; /* Ask for virtual bus */
170
171 cbp = virt_to_abs(&cb);
172 HvCallXm_getTceTableParms(cbp);
173
174 itc_entries = cb.itc_size * PAGE_SIZE / sizeof(union tce_entry);
175 veth_iommu_table.it_size = itc_entries / 2;
176 veth_iommu_table.it_busno = cb.itc_busno;
177 veth_iommu_table.it_offset = cb.itc_offset;
178 veth_iommu_table.it_index = cb.itc_index;
179 veth_iommu_table.it_type = TCE_VB;
180 veth_iommu_table.it_blocksize = 1;
181
182 t = iommu_init_table(&veth_iommu_table);
183
184 if (!t)
185 printk("Virtual Bus VETH TCE table failed.\n");
186
187 vio_iommu_table.it_size = itc_entries - veth_iommu_table.it_size;
188 vio_iommu_table.it_busno = cb.itc_busno;
189 vio_iommu_table.it_offset = cb.itc_offset +
190 veth_iommu_table.it_size;
191 vio_iommu_table.it_index = cb.itc_index;
192 vio_iommu_table.it_type = TCE_VB;
193 vio_iommu_table.it_blocksize = 1;
194
195 t = iommu_init_table(&vio_iommu_table);
196
197 if (!t)
198 printk("Virtual Bus VIO TCE table failed.\n");
199}
200#endif
201
202#ifdef CONFIG_PPC_PSERIES
203static void probe_bus_pseries(void)
204{
205 struct device_node *node_vroot, *of_node;
206
207 node_vroot = find_devices("vdevice");
208 if ((node_vroot == NULL) || (node_vroot->child == NULL))
209 /* this machine doesn't do virtual IO, and that's ok */
210 return;
211
212 vio_num_address_cells = prom_n_addr_cells(node_vroot->child);
213
214 /*
215 * Create struct vio_devices for each virtual device in the device tree.
216 * Drivers will associate with them later.
217 */
218 for (of_node = node_vroot->child; of_node != NULL;
219 of_node = of_node->sibling) {
220 printk(KERN_DEBUG "%s: processing %p\n", __FUNCTION__, of_node);
221 vio_register_device_node(of_node);
222 }
223}
224#endif
225
226#ifdef CONFIG_PPC_ISERIES
227static void probe_bus_iseries(void)
228{
229 HvLpIndexMap vlan_map = HvLpConfig_getVirtualLanIndexMap();
230 struct vio_dev *viodev;
231 int i;
232
233 /* there is only one of each of these */
234 vio_register_device_iseries("viocons", 0);
235 vio_register_device_iseries("vscsi", 0);
236
237 vlan_map = HvLpConfig_getVirtualLanIndexMap();
238 for (i = 0; i < HVMAXARCHITECTEDVIRTUALLANS; i++) {
239 if ((vlan_map & (0x8000 >> i)) == 0)
240 continue;
241 viodev = vio_register_device_iseries("vlan", i);
242 /* veth is special and has it own iommu_table */
243 viodev->iommu_table = &veth_iommu_table;
244 }
245 for (i = 0; i < HVMAXARCHITECTEDVIRTUALDISKS; i++)
246 vio_register_device_iseries("viodasd", i);
247 for (i = 0; i < HVMAXARCHITECTEDVIRTUALCDROMS; i++)
248 vio_register_device_iseries("viocd", i);
249 for (i = 0; i < HVMAXARCHITECTEDVIRTUALTAPES; i++)
250 vio_register_device_iseries("viotape", i);
251}
252#endif
253
254/** 122/**
255 * vio_bus_init: - Initialize the virtual IO bus 123 * vio_bus_init: - Initialize the virtual IO bus
256 */ 124 */
257static int __init vio_bus_init(void) 125int __init vio_bus_init(struct vio_bus_ops *ops)
258{ 126{
259 int err; 127 int err;
260 128
129 vio_bus_ops = *ops;
130
261 err = bus_register(&vio_bus_type); 131 err = bus_register(&vio_bus_type);
262 if (err) { 132 if (err) {
263 printk(KERN_ERR "failed to register VIO bus\n"); 133 printk(KERN_ERR "failed to register VIO bus\n");
264 return err; 134 return err;
265 } 135 }
266 136
267 /* the fake parent of all vio devices, just to give us a nice directory */ 137 /*
138 * The fake parent of all vio devices, just to give us
139 * a nice directory
140 */
268 err = device_register(&vio_bus_device.dev); 141 err = device_register(&vio_bus_device.dev);
269 if (err) { 142 if (err) {
270 printk(KERN_WARNING "%s: device_register returned %i\n", __FUNCTION__, 143 printk(KERN_WARNING "%s: device_register returned %i\n",
271 err); 144 __FUNCTION__, err);
272 return err; 145 return err;
273 } 146 }
274 147
275#ifdef CONFIG_PPC_PSERIES
276 probe_bus_pseries();
277#endif
278#ifdef CONFIG_PPC_ISERIES
279 probe_bus_iseries();
280#endif
281
282 return 0; 148 return 0;
283} 149}
284 150
285__initcall(vio_bus_init);
286
287/* vio_dev refcount hit 0 */ 151/* vio_dev refcount hit 0 */
288static void __devinit vio_dev_release(struct device *dev) 152static void __devinit vio_dev_release(struct device *dev)
289{ 153{
290 DBGENTER(); 154 if (vio_bus_ops.release_device)
291 155 vio_bus_ops.release_device(dev);
292#ifdef CONFIG_PPC_PSERIES
293 /* XXX free TCE table */
294 of_node_put(dev->platform_data);
295#endif
296 kfree(to_vio_dev(dev)); 156 kfree(to_vio_dev(dev));
297} 157}
298 158
299#ifdef CONFIG_PPC_PSERIES 159static ssize_t viodev_show_name(struct device *dev,
300static ssize_t viodev_show_devspec(struct device *dev, struct device_attribute *attr, char *buf) 160 struct device_attribute *attr, char *buf)
301{
302 struct device_node *of_node = dev->platform_data;
303
304 return sprintf(buf, "%s\n", of_node->full_name);
305}
306DEVICE_ATTR(devspec, S_IRUSR | S_IRGRP | S_IROTH, viodev_show_devspec, NULL);
307#endif
308
309static ssize_t viodev_show_name(struct device *dev, struct device_attribute *attr, char *buf)
310{ 161{
311 return sprintf(buf, "%s\n", to_vio_dev(dev)->name); 162 return sprintf(buf, "%s\n", to_vio_dev(dev)->name);
312} 163}
313DEVICE_ATTR(name, S_IRUSR | S_IRGRP | S_IROTH, viodev_show_name, NULL); 164DEVICE_ATTR(name, S_IRUSR | S_IRGRP | S_IROTH, viodev_show_name, NULL);
314 165
315static struct vio_dev * __devinit vio_register_device_common( 166struct vio_dev * __devinit vio_register_device(struct vio_dev *viodev)
316 struct vio_dev *viodev, char *name, char *type,
317 uint32_t unit_address, struct iommu_table *iommu_table)
318{ 167{
319 DBGENTER();
320
321 viodev->name = name;
322 viodev->type = type;
323 viodev->unit_address = unit_address;
324 viodev->iommu_table = iommu_table;
325 /* init generic 'struct device' fields: */ 168 /* init generic 'struct device' fields: */
326 viodev->dev.parent = &vio_bus_device.dev; 169 viodev->dev.parent = &vio_bus_device.dev;
327 viodev->dev.bus = &vio_bus_type; 170 viodev->dev.bus = &vio_bus_type;
@@ -338,222 +181,15 @@ static struct vio_dev * __devinit vio_register_device_common(
338 return viodev; 181 return viodev;
339} 182}
340 183
341#ifdef CONFIG_PPC_PSERIES
342/**
343 * vio_register_device_node: - Register a new vio device.
344 * @of_node: The OF node for this device.
345 *
346 * Creates and initializes a vio_dev structure from the data in
347 * of_node (dev.platform_data) and adds it to the list of virtual devices.
348 * Returns a pointer to the created vio_dev or NULL if node has
349 * NULL device_type or compatible fields.
350 */
351struct vio_dev * __devinit vio_register_device_node(struct device_node *of_node)
352{
353 struct vio_dev *viodev;
354 unsigned int *unit_address;
355 unsigned int *irq_p;
356
357 DBGENTER();
358
359 /* we need the 'device_type' property, in order to match with drivers */
360 if ((NULL == of_node->type)) {
361 printk(KERN_WARNING
362 "%s: node %s missing 'device_type'\n", __FUNCTION__,
363 of_node->name ? of_node->name : "<unknown>");
364 return NULL;
365 }
366
367 unit_address = (unsigned int *)get_property(of_node, "reg", NULL);
368 if (!unit_address) {
369 printk(KERN_WARNING "%s: node %s missing 'reg'\n", __FUNCTION__,
370 of_node->name ? of_node->name : "<unknown>");
371 return NULL;
372 }
373
374 /* allocate a vio_dev for this node */
375 viodev = kmalloc(sizeof(struct vio_dev), GFP_KERNEL);
376 if (!viodev) {
377 return NULL;
378 }
379 memset(viodev, 0, sizeof(struct vio_dev));
380
381 viodev->dev.platform_data = of_node_get(of_node);
382
383 viodev->irq = NO_IRQ;
384 irq_p = (unsigned int *)get_property(of_node, "interrupts", NULL);
385 if (irq_p) {
386 int virq = virt_irq_create_mapping(*irq_p);
387 if (virq == NO_IRQ) {
388 printk(KERN_ERR "Unable to allocate interrupt "
389 "number for %s\n", of_node->full_name);
390 } else
391 viodev->irq = irq_offset_up(virq);
392 }
393
394 snprintf(viodev->dev.bus_id, BUS_ID_SIZE, "%x", *unit_address);
395
396 /* register with generic device framework */
397 if (vio_register_device_common(viodev, of_node->name, of_node->type,
398 *unit_address, vio_build_iommu_table(viodev))
399 == NULL) {
400 /* XXX free TCE table */
401 kfree(viodev);
402 return NULL;
403 }
404 device_create_file(&viodev->dev, &dev_attr_devspec);
405
406 return viodev;
407}
408EXPORT_SYMBOL(vio_register_device_node);
409#endif
410
411#ifdef CONFIG_PPC_ISERIES
412/**
413 * vio_register_device: - Register a new vio device.
414 * @voidev: The device to register.
415 */
416static struct vio_dev *__init vio_register_device_iseries(char *type,
417 uint32_t unit_num)
418{
419 struct vio_dev *viodev;
420
421 DBGENTER();
422
423 /* allocate a vio_dev for this node */
424 viodev = kmalloc(sizeof(struct vio_dev), GFP_KERNEL);
425 if (!viodev)
426 return NULL;
427 memset(viodev, 0, sizeof(struct vio_dev));
428
429 snprintf(viodev->dev.bus_id, BUS_ID_SIZE, "%s%d", type, unit_num);
430
431 return vio_register_device_common(viodev, viodev->dev.bus_id, type,
432 unit_num, &vio_iommu_table);
433}
434#endif
435
436void __devinit vio_unregister_device(struct vio_dev *viodev) 184void __devinit vio_unregister_device(struct vio_dev *viodev)
437{ 185{
438 DBGENTER(); 186 if (vio_bus_ops.unregister_device)
439#ifdef CONFIG_PPC_PSERIES 187 vio_bus_ops.unregister_device(viodev);
440 device_remove_file(&viodev->dev, &dev_attr_devspec);
441#endif
442 device_remove_file(&viodev->dev, &dev_attr_name); 188 device_remove_file(&viodev->dev, &dev_attr_name);
443 device_unregister(&viodev->dev); 189 device_unregister(&viodev->dev);
444} 190}
445EXPORT_SYMBOL(vio_unregister_device); 191EXPORT_SYMBOL(vio_unregister_device);
446 192
447#ifdef CONFIG_PPC_PSERIES
448/**
449 * vio_get_attribute: - get attribute for virtual device
450 * @vdev: The vio device to get property.
451 * @which: The property/attribute to be extracted.
452 * @length: Pointer to length of returned data size (unused if NULL).
453 *
454 * Calls prom.c's get_property() to return the value of the
455 * attribute specified by the preprocessor constant @which
456*/
457const void * vio_get_attribute(struct vio_dev *vdev, void* which, int* length)
458{
459 return get_property(vdev->dev.platform_data, (char*)which, length);
460}
461EXPORT_SYMBOL(vio_get_attribute);
462
463/* vio_find_name() - internal because only vio.c knows how we formatted the
464 * kobject name
465 * XXX once vio_bus_type.devices is actually used as a kset in
466 * drivers/base/bus.c, this function should be removed in favor of
467 * "device_find(kobj_name, &vio_bus_type)"
468 */
469static struct vio_dev *vio_find_name(const char *kobj_name)
470{
471 struct kobject *found;
472
473 found = kset_find_obj(&devices_subsys.kset, kobj_name);
474 if (!found)
475 return NULL;
476
477 return to_vio_dev(container_of(found, struct device, kobj));
478}
479
480/**
481 * vio_find_node - find an already-registered vio_dev
482 * @vnode: device_node of the virtual device we're looking for
483 */
484struct vio_dev *vio_find_node(struct device_node *vnode)
485{
486 uint32_t *unit_address;
487 char kobj_name[BUS_ID_SIZE];
488
489 /* construct the kobject name from the device node */
490 unit_address = (uint32_t *)get_property(vnode, "reg", NULL);
491 if (!unit_address)
492 return NULL;
493 snprintf(kobj_name, BUS_ID_SIZE, "%x", *unit_address);
494
495 return vio_find_name(kobj_name);
496}
497EXPORT_SYMBOL(vio_find_node);
498
499/**
500 * vio_build_iommu_table: - gets the dma information from OF and builds the TCE tree.
501 * @dev: the virtual device.
502 *
503 * Returns a pointer to the built tce tree, or NULL if it can't
504 * find property.
505*/
506static struct iommu_table * vio_build_iommu_table(struct vio_dev *dev)
507{
508 unsigned int *dma_window;
509 struct iommu_table *newTceTable;
510 unsigned long offset;
511 int dma_window_property_size;
512
513 dma_window = (unsigned int *) get_property(dev->dev.platform_data, "ibm,my-dma-window", &dma_window_property_size);
514 if(!dma_window) {
515 return NULL;
516 }
517
518 newTceTable = (struct iommu_table *) kmalloc(sizeof(struct iommu_table), GFP_KERNEL);
519
520 /* There should be some code to extract the phys-encoded offset
521 using prom_n_addr_cells(). However, according to a comment
522 on earlier versions, it's always zero, so we don't bother */
523 offset = dma_window[1] >> PAGE_SHIFT;
524
525 /* TCE table size - measured in tce entries */
526 newTceTable->it_size = dma_window[4] >> PAGE_SHIFT;
527 /* offset for VIO should always be 0 */
528 newTceTable->it_offset = offset;
529 newTceTable->it_busno = 0;
530 newTceTable->it_index = (unsigned long)dma_window[0];
531 newTceTable->it_type = TCE_VB;
532
533 return iommu_init_table(newTceTable);
534}
535
536int vio_enable_interrupts(struct vio_dev *dev)
537{
538 int rc = h_vio_signal(dev->unit_address, VIO_IRQ_ENABLE);
539 if (rc != H_Success) {
540 printk(KERN_ERR "vio: Error 0x%x enabling interrupts\n", rc);
541 }
542 return rc;
543}
544EXPORT_SYMBOL(vio_enable_interrupts);
545
546int vio_disable_interrupts(struct vio_dev *dev)
547{
548 int rc = h_vio_signal(dev->unit_address, VIO_IRQ_DISABLE);
549 if (rc != H_Success) {
550 printk(KERN_ERR "vio: Error 0x%x disabling interrupts\n", rc);
551 }
552 return rc;
553}
554EXPORT_SYMBOL(vio_disable_interrupts);
555#endif
556
557static dma_addr_t vio_map_single(struct device *dev, void *vaddr, 193static dma_addr_t vio_map_single(struct device *dev, void *vaddr,
558 size_t size, enum dma_data_direction direction) 194 size_t size, enum dma_data_direction direction)
559{ 195{
@@ -615,18 +251,8 @@ static int vio_bus_match(struct device *dev, struct device_driver *drv)
615 const struct vio_dev *vio_dev = to_vio_dev(dev); 251 const struct vio_dev *vio_dev = to_vio_dev(dev);
616 struct vio_driver *vio_drv = to_vio_driver(drv); 252 struct vio_driver *vio_drv = to_vio_driver(drv);
617 const struct vio_device_id *ids = vio_drv->id_table; 253 const struct vio_device_id *ids = vio_drv->id_table;
618 const struct vio_device_id *found_id;
619
620 DBGENTER();
621 254
622 if (!ids) 255 return (ids != NULL) && (vio_match_device(ids, vio_dev) != NULL);
623 return 0;
624
625 found_id = vio_match_device(ids, vio_dev);
626 if (found_id)
627 return 1;
628
629 return 0;
630} 256}
631 257
632struct bus_type vio_bus_type = { 258struct bus_type vio_bus_type = {
diff --git a/arch/ppc64/kernel/xics.c b/arch/ppc64/kernel/xics.c
index 677c4450984a..d9dc6f28d050 100644
--- a/arch/ppc64/kernel/xics.c
+++ b/arch/ppc64/kernel/xics.c
@@ -647,29 +647,30 @@ static void xics_set_affinity(unsigned int virq, cpumask_t cpumask)
647 } 647 }
648} 648}
649 649
650void xics_teardown_cpu(void) 650void xics_teardown_cpu(int secondary)
651{ 651{
652 int cpu = smp_processor_id(); 652 int cpu = smp_processor_id();
653 int status;
654 653
655 ops->cppr_info(cpu, 0x00); 654 ops->cppr_info(cpu, 0x00);
656 iosync(); 655 iosync();
657 656
658 /* 657 /*
659 * we need to EOI the IPI if we got here from kexec down IPI 658 * Some machines need to have at least one cpu in the GIQ,
660 * 659 * so leave the master cpu in the group.
661 * xics doesn't care if we duplicate an EOI as long as we
662 * don't EOI and raise priority.
663 *
664 * probably need to check all the other interrupts too
665 * should we be flagging idle loop instead?
666 * or creating some task to be scheduled?
667 */ 660 */
668 ops->xirr_info_set(cpu, XICS_IPI); 661 if (secondary) {
669 662 /*
670 status = rtas_set_indicator(GLOBAL_INTERRUPT_QUEUE, 663 * we need to EOI the IPI if we got here from kexec down IPI
671 (1UL << interrupt_server_size) - 1 - default_distrib_server, 0); 664 *
672 WARN_ON(status != 0); 665 * probably need to check all the other interrupts too
666 * should we be flagging idle loop instead?
667 * or creating some task to be scheduled?
668 */
669 ops->xirr_info_set(cpu, XICS_IPI);
670 rtas_set_indicator(GLOBAL_INTERRUPT_QUEUE,
671 (1UL << interrupt_server_size) - 1 -
672 default_distrib_server, 0);
673 }
673} 674}
674 675
675#ifdef CONFIG_HOTPLUG_CPU 676#ifdef CONFIG_HOTPLUG_CPU
diff --git a/arch/ppc64/mm/hash_low.S b/arch/ppc64/mm/hash_low.S
index c23d46956dd9..35eb49e1b890 100644
--- a/arch/ppc64/mm/hash_low.S
+++ b/arch/ppc64/mm/hash_low.S
@@ -129,12 +129,10 @@ _GLOBAL(__hash_page)
129 * code rather than call a C function...) 129 * code rather than call a C function...)
130 */ 130 */
131BEGIN_FTR_SECTION 131BEGIN_FTR_SECTION
132BEGIN_FTR_SECTION
133 mr r4,r30 132 mr r4,r30
134 mr r5,r7 133 mr r5,r7
135 bl .hash_page_do_lazy_icache 134 bl .hash_page_do_lazy_icache
136END_FTR_SECTION_IFSET(CPU_FTR_NOEXECUTE) 135END_FTR_SECTION(CPU_FTR_NOEXECUTE|CPU_FTR_COHERENT_ICACHE, CPU_FTR_NOEXECUTE)
137END_FTR_SECTION_IFCLR(CPU_FTR_COHERENT_ICACHE)
138 136
139 /* At this point, r3 contains new PP bits, save them in 137 /* At this point, r3 contains new PP bits, save them in
140 * place of "access" in the param area (sic) 138 * place of "access" in the param area (sic)
@@ -170,9 +168,7 @@ htab_insert_pte:
170 /* Call ppc_md.hpte_insert */ 168 /* Call ppc_md.hpte_insert */
171 ld r7,STK_PARM(r4)(r1) /* Retreive new pp bits */ 169 ld r7,STK_PARM(r4)(r1) /* Retreive new pp bits */
172 mr r4,r29 /* Retreive va */ 170 mr r4,r29 /* Retreive va */
173 li r6,0 /* primary slot */ 171 li r6,0 /* no vflags */
174 li r8,0 /* not bolted and not large */
175 li r9,0
176_GLOBAL(htab_call_hpte_insert1) 172_GLOBAL(htab_call_hpte_insert1)
177 bl . /* Will be patched by htab_finish_init() */ 173 bl . /* Will be patched by htab_finish_init() */
178 cmpdi 0,r3,0 174 cmpdi 0,r3,0
@@ -192,9 +188,7 @@ _GLOBAL(htab_call_hpte_insert1)
192 /* Call ppc_md.hpte_insert */ 188 /* Call ppc_md.hpte_insert */
193 ld r7,STK_PARM(r4)(r1) /* Retreive new pp bits */ 189 ld r7,STK_PARM(r4)(r1) /* Retreive new pp bits */
194 mr r4,r29 /* Retreive va */ 190 mr r4,r29 /* Retreive va */
195 li r6,1 /* secondary slot */ 191 li r6,HPTE_V_SECONDARY@l /* secondary slot */
196 li r8,0 /* not bolted and not large */
197 li r9,0
198_GLOBAL(htab_call_hpte_insert2) 192_GLOBAL(htab_call_hpte_insert2)
199 bl . /* Will be patched by htab_finish_init() */ 193 bl . /* Will be patched by htab_finish_init() */
200 cmpdi 0,r3,0 194 cmpdi 0,r3,0
diff --git a/arch/ppc64/mm/hash_native.c b/arch/ppc64/mm/hash_native.c
index 4fec05817d66..7626bb59954d 100644
--- a/arch/ppc64/mm/hash_native.c
+++ b/arch/ppc64/mm/hash_native.c
@@ -27,9 +27,9 @@
27 27
28static DEFINE_SPINLOCK(native_tlbie_lock); 28static DEFINE_SPINLOCK(native_tlbie_lock);
29 29
30static inline void native_lock_hpte(HPTE *hptep) 30static inline void native_lock_hpte(hpte_t *hptep)
31{ 31{
32 unsigned long *word = &hptep->dw0.dword0; 32 unsigned long *word = &hptep->v;
33 33
34 while (1) { 34 while (1) {
35 if (!test_and_set_bit(HPTE_LOCK_BIT, word)) 35 if (!test_and_set_bit(HPTE_LOCK_BIT, word))
@@ -39,32 +39,27 @@ static inline void native_lock_hpte(HPTE *hptep)
39 } 39 }
40} 40}
41 41
42static inline void native_unlock_hpte(HPTE *hptep) 42static inline void native_unlock_hpte(hpte_t *hptep)
43{ 43{
44 unsigned long *word = &hptep->dw0.dword0; 44 unsigned long *word = &hptep->v;
45 45
46 asm volatile("lwsync":::"memory"); 46 asm volatile("lwsync":::"memory");
47 clear_bit(HPTE_LOCK_BIT, word); 47 clear_bit(HPTE_LOCK_BIT, word);
48} 48}
49 49
50long native_hpte_insert(unsigned long hpte_group, unsigned long va, 50long native_hpte_insert(unsigned long hpte_group, unsigned long va,
51 unsigned long prpn, int secondary, 51 unsigned long prpn, unsigned long vflags,
52 unsigned long hpteflags, int bolted, int large) 52 unsigned long rflags)
53{ 53{
54 unsigned long arpn = physRpn_to_absRpn(prpn); 54 hpte_t *hptep = htab_address + hpte_group;
55 HPTE *hptep = htab_address + hpte_group; 55 unsigned long hpte_v, hpte_r;
56 Hpte_dword0 dw0;
57 HPTE lhpte;
58 int i; 56 int i;
59 57
60 for (i = 0; i < HPTES_PER_GROUP; i++) { 58 for (i = 0; i < HPTES_PER_GROUP; i++) {
61 dw0 = hptep->dw0.dw0; 59 if (! (hptep->v & HPTE_V_VALID)) {
62
63 if (!dw0.v) {
64 /* retry with lock held */ 60 /* retry with lock held */
65 native_lock_hpte(hptep); 61 native_lock_hpte(hptep);
66 dw0 = hptep->dw0.dw0; 62 if (! (hptep->v & HPTE_V_VALID))
67 if (!dw0.v)
68 break; 63 break;
69 native_unlock_hpte(hptep); 64 native_unlock_hpte(hptep);
70 } 65 }
@@ -75,56 +70,45 @@ long native_hpte_insert(unsigned long hpte_group, unsigned long va,
75 if (i == HPTES_PER_GROUP) 70 if (i == HPTES_PER_GROUP)
76 return -1; 71 return -1;
77 72
78 lhpte.dw1.dword1 = 0; 73 hpte_v = (va >> 23) << HPTE_V_AVPN_SHIFT | vflags | HPTE_V_VALID;
79 lhpte.dw1.dw1.rpn = arpn; 74 if (vflags & HPTE_V_LARGE)
80 lhpte.dw1.flags.flags = hpteflags; 75 va &= ~(1UL << HPTE_V_AVPN_SHIFT);
81 76 hpte_r = (prpn << HPTE_R_RPN_SHIFT) | rflags;
82 lhpte.dw0.dword0 = 0;
83 lhpte.dw0.dw0.avpn = va >> 23;
84 lhpte.dw0.dw0.h = secondary;
85 lhpte.dw0.dw0.bolted = bolted;
86 lhpte.dw0.dw0.v = 1;
87
88 if (large) {
89 lhpte.dw0.dw0.l = 1;
90 lhpte.dw0.dw0.avpn &= ~0x1UL;
91 }
92
93 hptep->dw1.dword1 = lhpte.dw1.dword1;
94 77
78 hptep->r = hpte_r;
95 /* Guarantee the second dword is visible before the valid bit */ 79 /* Guarantee the second dword is visible before the valid bit */
96 __asm__ __volatile__ ("eieio" : : : "memory"); 80 __asm__ __volatile__ ("eieio" : : : "memory");
97
98 /* 81 /*
99 * Now set the first dword including the valid bit 82 * Now set the first dword including the valid bit
100 * NOTE: this also unlocks the hpte 83 * NOTE: this also unlocks the hpte
101 */ 84 */
102 hptep->dw0.dword0 = lhpte.dw0.dword0; 85 hptep->v = hpte_v;
103 86
104 __asm__ __volatile__ ("ptesync" : : : "memory"); 87 __asm__ __volatile__ ("ptesync" : : : "memory");
105 88
106 return i | (secondary << 3); 89 return i | (!!(vflags & HPTE_V_SECONDARY) << 3);
107} 90}
108 91
109static long native_hpte_remove(unsigned long hpte_group) 92static long native_hpte_remove(unsigned long hpte_group)
110{ 93{
111 HPTE *hptep; 94 hpte_t *hptep;
112 Hpte_dword0 dw0;
113 int i; 95 int i;
114 int slot_offset; 96 int slot_offset;
97 unsigned long hpte_v;
115 98
116 /* pick a random entry to start at */ 99 /* pick a random entry to start at */
117 slot_offset = mftb() & 0x7; 100 slot_offset = mftb() & 0x7;
118 101
119 for (i = 0; i < HPTES_PER_GROUP; i++) { 102 for (i = 0; i < HPTES_PER_GROUP; i++) {
120 hptep = htab_address + hpte_group + slot_offset; 103 hptep = htab_address + hpte_group + slot_offset;
121 dw0 = hptep->dw0.dw0; 104 hpte_v = hptep->v;
122 105
123 if (dw0.v && !dw0.bolted) { 106 if ((hpte_v & HPTE_V_VALID) && !(hpte_v & HPTE_V_BOLTED)) {
124 /* retry with lock held */ 107 /* retry with lock held */
125 native_lock_hpte(hptep); 108 native_lock_hpte(hptep);
126 dw0 = hptep->dw0.dw0; 109 hpte_v = hptep->v;
127 if (dw0.v && !dw0.bolted) 110 if ((hpte_v & HPTE_V_VALID)
111 && !(hpte_v & HPTE_V_BOLTED))
128 break; 112 break;
129 native_unlock_hpte(hptep); 113 native_unlock_hpte(hptep);
130 } 114 }
@@ -137,15 +121,15 @@ static long native_hpte_remove(unsigned long hpte_group)
137 return -1; 121 return -1;
138 122
139 /* Invalidate the hpte. NOTE: this also unlocks it */ 123 /* Invalidate the hpte. NOTE: this also unlocks it */
140 hptep->dw0.dword0 = 0; 124 hptep->v = 0;
141 125
142 return i; 126 return i;
143} 127}
144 128
145static inline void set_pp_bit(unsigned long pp, HPTE *addr) 129static inline void set_pp_bit(unsigned long pp, hpte_t *addr)
146{ 130{
147 unsigned long old; 131 unsigned long old;
148 unsigned long *p = &addr->dw1.dword1; 132 unsigned long *p = &addr->r;
149 133
150 __asm__ __volatile__( 134 __asm__ __volatile__(
151 "1: ldarx %0,0,%3\n\ 135 "1: ldarx %0,0,%3\n\
@@ -163,11 +147,11 @@ static inline void set_pp_bit(unsigned long pp, HPTE *addr)
163 */ 147 */
164static long native_hpte_find(unsigned long vpn) 148static long native_hpte_find(unsigned long vpn)
165{ 149{
166 HPTE *hptep; 150 hpte_t *hptep;
167 unsigned long hash; 151 unsigned long hash;
168 unsigned long i, j; 152 unsigned long i, j;
169 long slot; 153 long slot;
170 Hpte_dword0 dw0; 154 unsigned long hpte_v;
171 155
172 hash = hpt_hash(vpn, 0); 156 hash = hpt_hash(vpn, 0);
173 157
@@ -175,10 +159,11 @@ static long native_hpte_find(unsigned long vpn)
175 slot = (hash & htab_hash_mask) * HPTES_PER_GROUP; 159 slot = (hash & htab_hash_mask) * HPTES_PER_GROUP;
176 for (i = 0; i < HPTES_PER_GROUP; i++) { 160 for (i = 0; i < HPTES_PER_GROUP; i++) {
177 hptep = htab_address + slot; 161 hptep = htab_address + slot;
178 dw0 = hptep->dw0.dw0; 162 hpte_v = hptep->v;
179 163
180 if ((dw0.avpn == (vpn >> 11)) && dw0.v && 164 if ((HPTE_V_AVPN_VAL(hpte_v) == (vpn >> 11))
181 (dw0.h == j)) { 165 && (hpte_v & HPTE_V_VALID)
166 && ( !!(hpte_v & HPTE_V_SECONDARY) == j)) {
182 /* HPTE matches */ 167 /* HPTE matches */
183 if (j) 168 if (j)
184 slot = -slot; 169 slot = -slot;
@@ -195,20 +180,21 @@ static long native_hpte_find(unsigned long vpn)
195static long native_hpte_updatepp(unsigned long slot, unsigned long newpp, 180static long native_hpte_updatepp(unsigned long slot, unsigned long newpp,
196 unsigned long va, int large, int local) 181 unsigned long va, int large, int local)
197{ 182{
198 HPTE *hptep = htab_address + slot; 183 hpte_t *hptep = htab_address + slot;
199 Hpte_dword0 dw0; 184 unsigned long hpte_v;
200 unsigned long avpn = va >> 23; 185 unsigned long avpn = va >> 23;
201 int ret = 0; 186 int ret = 0;
202 187
203 if (large) 188 if (large)
204 avpn &= ~0x1UL; 189 avpn &= ~1;
205 190
206 native_lock_hpte(hptep); 191 native_lock_hpte(hptep);
207 192
208 dw0 = hptep->dw0.dw0; 193 hpte_v = hptep->v;
209 194
210 /* Even if we miss, we need to invalidate the TLB */ 195 /* Even if we miss, we need to invalidate the TLB */
211 if ((dw0.avpn != avpn) || !dw0.v) { 196 if ((HPTE_V_AVPN_VAL(hpte_v) != avpn)
197 || !(hpte_v & HPTE_V_VALID)) {
212 native_unlock_hpte(hptep); 198 native_unlock_hpte(hptep);
213 ret = -1; 199 ret = -1;
214 } else { 200 } else {
@@ -244,7 +230,7 @@ static void native_hpte_updateboltedpp(unsigned long newpp, unsigned long ea)
244{ 230{
245 unsigned long vsid, va, vpn, flags = 0; 231 unsigned long vsid, va, vpn, flags = 0;
246 long slot; 232 long slot;
247 HPTE *hptep; 233 hpte_t *hptep;
248 int lock_tlbie = !cpu_has_feature(CPU_FTR_LOCKLESS_TLBIE); 234 int lock_tlbie = !cpu_has_feature(CPU_FTR_LOCKLESS_TLBIE);
249 235
250 vsid = get_kernel_vsid(ea); 236 vsid = get_kernel_vsid(ea);
@@ -269,26 +255,27 @@ static void native_hpte_updateboltedpp(unsigned long newpp, unsigned long ea)
269static void native_hpte_invalidate(unsigned long slot, unsigned long va, 255static void native_hpte_invalidate(unsigned long slot, unsigned long va,
270 int large, int local) 256 int large, int local)
271{ 257{
272 HPTE *hptep = htab_address + slot; 258 hpte_t *hptep = htab_address + slot;
273 Hpte_dword0 dw0; 259 unsigned long hpte_v;
274 unsigned long avpn = va >> 23; 260 unsigned long avpn = va >> 23;
275 unsigned long flags; 261 unsigned long flags;
276 int lock_tlbie = !cpu_has_feature(CPU_FTR_LOCKLESS_TLBIE); 262 int lock_tlbie = !cpu_has_feature(CPU_FTR_LOCKLESS_TLBIE);
277 263
278 if (large) 264 if (large)
279 avpn &= ~0x1UL; 265 avpn &= ~1;
280 266
281 local_irq_save(flags); 267 local_irq_save(flags);
282 native_lock_hpte(hptep); 268 native_lock_hpte(hptep);
283 269
284 dw0 = hptep->dw0.dw0; 270 hpte_v = hptep->v;
285 271
286 /* Even if we miss, we need to invalidate the TLB */ 272 /* Even if we miss, we need to invalidate the TLB */
287 if ((dw0.avpn != avpn) || !dw0.v) { 273 if ((HPTE_V_AVPN_VAL(hpte_v) != avpn)
274 || !(hpte_v & HPTE_V_VALID)) {
288 native_unlock_hpte(hptep); 275 native_unlock_hpte(hptep);
289 } else { 276 } else {
290 /* Invalidate the hpte. NOTE: this also unlocks it */ 277 /* Invalidate the hpte. NOTE: this also unlocks it */
291 hptep->dw0.dword0 = 0; 278 hptep->v = 0;
292 } 279 }
293 280
294 /* Invalidate the tlb */ 281 /* Invalidate the tlb */
@@ -315,8 +302,8 @@ static void native_hpte_invalidate(unsigned long slot, unsigned long va,
315static void native_hpte_clear(void) 302static void native_hpte_clear(void)
316{ 303{
317 unsigned long slot, slots, flags; 304 unsigned long slot, slots, flags;
318 HPTE *hptep = htab_address; 305 hpte_t *hptep = htab_address;
319 Hpte_dword0 dw0; 306 unsigned long hpte_v;
320 unsigned long pteg_count; 307 unsigned long pteg_count;
321 308
322 pteg_count = htab_hash_mask + 1; 309 pteg_count = htab_hash_mask + 1;
@@ -336,11 +323,11 @@ static void native_hpte_clear(void)
336 * running, right? and for crash dump, we probably 323 * running, right? and for crash dump, we probably
337 * don't want to wait for a maybe bad cpu. 324 * don't want to wait for a maybe bad cpu.
338 */ 325 */
339 dw0 = hptep->dw0.dw0; 326 hpte_v = hptep->v;
340 327
341 if (dw0.v) { 328 if (hpte_v & HPTE_V_VALID) {
342 hptep->dw0.dword0 = 0; 329 hptep->v = 0;
343 tlbie(slot2va(dw0.avpn, dw0.l, dw0.h, slot), dw0.l); 330 tlbie(slot2va(hpte_v, slot), hpte_v & HPTE_V_LARGE);
344 } 331 }
345 } 332 }
346 333
@@ -353,8 +340,8 @@ static void native_flush_hash_range(unsigned long context,
353{ 340{
354 unsigned long vsid, vpn, va, hash, secondary, slot, flags, avpn; 341 unsigned long vsid, vpn, va, hash, secondary, slot, flags, avpn;
355 int i, j; 342 int i, j;
356 HPTE *hptep; 343 hpte_t *hptep;
357 Hpte_dword0 dw0; 344 unsigned long hpte_v;
358 struct ppc64_tlb_batch *batch = &__get_cpu_var(ppc64_tlb_batch); 345 struct ppc64_tlb_batch *batch = &__get_cpu_var(ppc64_tlb_batch);
359 346
360 /* XXX fix for large ptes */ 347 /* XXX fix for large ptes */
@@ -390,14 +377,15 @@ static void native_flush_hash_range(unsigned long context,
390 377
391 native_lock_hpte(hptep); 378 native_lock_hpte(hptep);
392 379
393 dw0 = hptep->dw0.dw0; 380 hpte_v = hptep->v;
394 381
395 /* Even if we miss, we need to invalidate the TLB */ 382 /* Even if we miss, we need to invalidate the TLB */
396 if ((dw0.avpn != avpn) || !dw0.v) { 383 if ((HPTE_V_AVPN_VAL(hpte_v) != avpn)
384 || !(hpte_v & HPTE_V_VALID)) {
397 native_unlock_hpte(hptep); 385 native_unlock_hpte(hptep);
398 } else { 386 } else {
399 /* Invalidate the hpte. NOTE: this also unlocks it */ 387 /* Invalidate the hpte. NOTE: this also unlocks it */
400 hptep->dw0.dword0 = 0; 388 hptep->v = 0;
401 } 389 }
402 390
403 j++; 391 j++;
diff --git a/arch/ppc64/mm/hash_utils.c b/arch/ppc64/mm/hash_utils.c
index 1647b1c6f28e..09475c8edf7c 100644
--- a/arch/ppc64/mm/hash_utils.c
+++ b/arch/ppc64/mm/hash_utils.c
@@ -75,8 +75,8 @@
75extern unsigned long dart_tablebase; 75extern unsigned long dart_tablebase;
76#endif /* CONFIG_U3_DART */ 76#endif /* CONFIG_U3_DART */
77 77
78HPTE *htab_address; 78hpte_t *htab_address;
79unsigned long htab_hash_mask; 79unsigned long htab_hash_mask;
80 80
81extern unsigned long _SDR1; 81extern unsigned long _SDR1;
82 82
@@ -97,11 +97,15 @@ static inline void create_pte_mapping(unsigned long start, unsigned long end,
97 unsigned long addr; 97 unsigned long addr;
98 unsigned int step; 98 unsigned int step;
99 unsigned long tmp_mode; 99 unsigned long tmp_mode;
100 unsigned long vflags;
100 101
101 if (large) 102 if (large) {
102 step = 16*MB; 103 step = 16*MB;
103 else 104 vflags = HPTE_V_BOLTED | HPTE_V_LARGE;
105 } else {
104 step = 4*KB; 106 step = 4*KB;
107 vflags = HPTE_V_BOLTED;
108 }
105 109
106 for (addr = start; addr < end; addr += step) { 110 for (addr = start; addr < end; addr += step) {
107 unsigned long vpn, hash, hpteg; 111 unsigned long vpn, hash, hpteg;
@@ -129,12 +133,12 @@ static inline void create_pte_mapping(unsigned long start, unsigned long end,
129 if (systemcfg->platform & PLATFORM_LPAR) 133 if (systemcfg->platform & PLATFORM_LPAR)
130 ret = pSeries_lpar_hpte_insert(hpteg, va, 134 ret = pSeries_lpar_hpte_insert(hpteg, va,
131 virt_to_abs(addr) >> PAGE_SHIFT, 135 virt_to_abs(addr) >> PAGE_SHIFT,
132 0, tmp_mode, 1, large); 136 vflags, tmp_mode);
133 else 137 else
134#endif /* CONFIG_PPC_PSERIES */ 138#endif /* CONFIG_PPC_PSERIES */
135 ret = native_hpte_insert(hpteg, va, 139 ret = native_hpte_insert(hpteg, va,
136 virt_to_abs(addr) >> PAGE_SHIFT, 140 virt_to_abs(addr) >> PAGE_SHIFT,
137 0, tmp_mode, 1, large); 141 vflags, tmp_mode);
138 142
139 if (ret == -1) { 143 if (ret == -1) {
140 ppc64_terminate_msg(0x20, "create_pte_mapping"); 144 ppc64_terminate_msg(0x20, "create_pte_mapping");
@@ -206,7 +210,7 @@ void __init htab_initialize(void)
206 210
207 /* create bolted the linear mapping in the hash table */ 211 /* create bolted the linear mapping in the hash table */
208 for (i=0; i < lmb.memory.cnt; i++) { 212 for (i=0; i < lmb.memory.cnt; i++) {
209 base = lmb.memory.region[i].physbase + KERNELBASE; 213 base = lmb.memory.region[i].base + KERNELBASE;
210 size = lmb.memory.region[i].size; 214 size = lmb.memory.region[i].size;
211 215
212 DBG("creating mapping for region: %lx : %lx\n", base, size); 216 DBG("creating mapping for region: %lx : %lx\n", base, size);
@@ -298,7 +302,7 @@ int hash_page(unsigned long ea, unsigned long access, unsigned long trap)
298 int local = 0; 302 int local = 0;
299 cpumask_t tmp; 303 cpumask_t tmp;
300 304
301 if ((ea & ~REGION_MASK) > EADDR_MASK) 305 if ((ea & ~REGION_MASK) >= PGTABLE_RANGE)
302 return 1; 306 return 1;
303 307
304 switch (REGION_ID(ea)) { 308 switch (REGION_ID(ea)) {
diff --git a/arch/ppc64/mm/hugetlbpage.c b/arch/ppc64/mm/hugetlbpage.c
index fdcfe97c75c1..e7833c80eb68 100644
--- a/arch/ppc64/mm/hugetlbpage.c
+++ b/arch/ppc64/mm/hugetlbpage.c
@@ -27,124 +27,94 @@
27 27
28#include <linux/sysctl.h> 28#include <linux/sysctl.h>
29 29
30#define HUGEPGDIR_SHIFT (HPAGE_SHIFT + PAGE_SHIFT - 3) 30#define NUM_LOW_AREAS (0x100000000UL >> SID_SHIFT)
31#define HUGEPGDIR_SIZE (1UL << HUGEPGDIR_SHIFT) 31#define NUM_HIGH_AREAS (PGTABLE_RANGE >> HTLB_AREA_SHIFT)
32#define HUGEPGDIR_MASK (~(HUGEPGDIR_SIZE-1))
33 32
34#define HUGEPTE_INDEX_SIZE 9 33/* Modelled after find_linux_pte() */
35#define HUGEPGD_INDEX_SIZE 10 34pte_t *huge_pte_offset(struct mm_struct *mm, unsigned long addr)
36
37#define PTRS_PER_HUGEPTE (1 << HUGEPTE_INDEX_SIZE)
38#define PTRS_PER_HUGEPGD (1 << HUGEPGD_INDEX_SIZE)
39
40static inline int hugepgd_index(unsigned long addr)
41{
42 return (addr & ~REGION_MASK) >> HUGEPGDIR_SHIFT;
43}
44
45static pud_t *hugepgd_offset(struct mm_struct *mm, unsigned long addr)
46{ 35{
47 int index; 36 pgd_t *pg;
37 pud_t *pu;
38 pmd_t *pm;
39 pte_t *pt;
48 40
49 if (! mm->context.huge_pgdir) 41 BUG_ON(! in_hugepage_area(mm->context, addr));
50 return NULL;
51 42
43 addr &= HPAGE_MASK;
44
45 pg = pgd_offset(mm, addr);
46 if (!pgd_none(*pg)) {
47 pu = pud_offset(pg, addr);
48 if (!pud_none(*pu)) {
49 pm = pmd_offset(pu, addr);
50 pt = (pte_t *)pm;
51 BUG_ON(!pmd_none(*pm)
52 && !(pte_present(*pt) && pte_huge(*pt)));
53 return pt;
54 }
55 }
52 56
53 index = hugepgd_index(addr); 57 return NULL;
54 BUG_ON(index >= PTRS_PER_HUGEPGD);
55 return (pud_t *)(mm->context.huge_pgdir + index);
56} 58}
57 59
58static inline pte_t *hugepte_offset(pud_t *dir, unsigned long addr) 60pte_t *huge_pte_alloc(struct mm_struct *mm, unsigned long addr)
59{ 61{
60 int index; 62 pgd_t *pg;
61 63 pud_t *pu;
62 if (pud_none(*dir)) 64 pmd_t *pm;
63 return NULL; 65 pte_t *pt;
64 66
65 index = (addr >> HPAGE_SHIFT) % PTRS_PER_HUGEPTE;
66 return (pte_t *)pud_page(*dir) + index;
67}
68
69static pud_t *hugepgd_alloc(struct mm_struct *mm, unsigned long addr)
70{
71 BUG_ON(! in_hugepage_area(mm->context, addr)); 67 BUG_ON(! in_hugepage_area(mm->context, addr));
72 68
73 if (! mm->context.huge_pgdir) { 69 addr &= HPAGE_MASK;
74 pgd_t *new;
75 spin_unlock(&mm->page_table_lock);
76 /* Don't use pgd_alloc(), because we want __GFP_REPEAT */
77 new = kmem_cache_alloc(zero_cache, GFP_KERNEL | __GFP_REPEAT);
78 BUG_ON(memcmp(new, empty_zero_page, PAGE_SIZE));
79 spin_lock(&mm->page_table_lock);
80 70
81 /* 71 pg = pgd_offset(mm, addr);
82 * Because we dropped the lock, we should re-check the 72 pu = pud_alloc(mm, pg, addr);
83 * entry, as somebody else could have populated it..
84 */
85 if (mm->context.huge_pgdir)
86 pgd_free(new);
87 else
88 mm->context.huge_pgdir = new;
89 }
90 return hugepgd_offset(mm, addr);
91}
92 73
93static pte_t *hugepte_alloc(struct mm_struct *mm, pud_t *dir, unsigned long addr) 74 if (pu) {
94{ 75 pm = pmd_alloc(mm, pu, addr);
95 if (! pud_present(*dir)) { 76 if (pm) {
96 pte_t *new; 77 pt = (pte_t *)pm;
97 78 BUG_ON(!pmd_none(*pm)
98 spin_unlock(&mm->page_table_lock); 79 && !(pte_present(*pt) && pte_huge(*pt)));
99 new = kmem_cache_alloc(zero_cache, GFP_KERNEL | __GFP_REPEAT); 80 return pt;
100 BUG_ON(memcmp(new, empty_zero_page, PAGE_SIZE));
101 spin_lock(&mm->page_table_lock);
102 /*
103 * Because we dropped the lock, we should re-check the
104 * entry, as somebody else could have populated it..
105 */
106 if (pud_present(*dir)) {
107 if (new)
108 kmem_cache_free(zero_cache, new);
109 } else {
110 struct page *ptepage;
111
112 if (! new)
113 return NULL;
114 ptepage = virt_to_page(new);
115 ptepage->mapping = (void *) mm;
116 ptepage->index = addr & HUGEPGDIR_MASK;
117 pud_populate(mm, dir, new);
118 } 81 }
119 } 82 }
120 83
121 return hugepte_offset(dir, addr); 84 return NULL;
122} 85}
123 86
124pte_t *huge_pte_offset(struct mm_struct *mm, unsigned long addr) 87#define HUGEPTE_BATCH_SIZE (HPAGE_SIZE / PMD_SIZE)
125{
126 pud_t *pud;
127 88
128 BUG_ON(! in_hugepage_area(mm->context, addr)); 89void set_huge_pte_at(struct mm_struct *mm, unsigned long addr,
90 pte_t *ptep, pte_t pte)
91{
92 int i;
129 93
130 pud = hugepgd_offset(mm, addr); 94 if (pte_present(*ptep)) {
131 if (! pud) 95 pte_clear(mm, addr, ptep);
132 return NULL; 96 flush_tlb_pending();
97 }
133 98
134 return hugepte_offset(pud, addr); 99 for (i = 0; i < HUGEPTE_BATCH_SIZE; i++) {
100 *ptep = __pte(pte_val(pte) & ~_PAGE_HPTEFLAGS);
101 ptep++;
102 }
135} 103}
136 104
137pte_t *huge_pte_alloc(struct mm_struct *mm, unsigned long addr) 105pte_t huge_ptep_get_and_clear(struct mm_struct *mm, unsigned long addr,
106 pte_t *ptep)
138{ 107{
139 pud_t *pud; 108 unsigned long old = pte_update(ptep, ~0UL);
109 int i;
140 110
141 BUG_ON(! in_hugepage_area(mm->context, addr)); 111 if (old & _PAGE_HASHPTE)
112 hpte_update(mm, addr, old, 0);
142 113
143 pud = hugepgd_alloc(mm, addr); 114 for (i = 1; i < HUGEPTE_BATCH_SIZE; i++)
144 if (! pud) 115 ptep[i] = __pte(0);
145 return NULL;
146 116
147 return hugepte_alloc(mm, pud, addr); 117 return __pte(old);
148} 118}
149 119
150/* 120/*
@@ -162,15 +132,17 @@ int is_aligned_hugepage_range(unsigned long addr, unsigned long len)
162 return 0; 132 return 0;
163} 133}
164 134
165static void flush_segments(void *parm) 135static void flush_low_segments(void *parm)
166{ 136{
167 u16 segs = (unsigned long) parm; 137 u16 areas = (unsigned long) parm;
168 unsigned long i; 138 unsigned long i;
169 139
170 asm volatile("isync" : : : "memory"); 140 asm volatile("isync" : : : "memory");
171 141
172 for (i = 0; i < 16; i++) { 142 BUILD_BUG_ON((sizeof(areas)*8) != NUM_LOW_AREAS);
173 if (! (segs & (1U << i))) 143
144 for (i = 0; i < NUM_LOW_AREAS; i++) {
145 if (! (areas & (1U << i)))
174 continue; 146 continue;
175 asm volatile("slbie %0" : : "r" (i << SID_SHIFT)); 147 asm volatile("slbie %0" : : "r" (i << SID_SHIFT));
176 } 148 }
@@ -178,13 +150,33 @@ static void flush_segments(void *parm)
178 asm volatile("isync" : : : "memory"); 150 asm volatile("isync" : : : "memory");
179} 151}
180 152
181static int prepare_low_seg_for_htlb(struct mm_struct *mm, unsigned long seg) 153static void flush_high_segments(void *parm)
182{ 154{
183 unsigned long start = seg << SID_SHIFT; 155 u16 areas = (unsigned long) parm;
184 unsigned long end = (seg+1) << SID_SHIFT; 156 unsigned long i, j;
157
158 asm volatile("isync" : : : "memory");
159
160 BUILD_BUG_ON((sizeof(areas)*8) != NUM_HIGH_AREAS);
161
162 for (i = 0; i < NUM_HIGH_AREAS; i++) {
163 if (! (areas & (1U << i)))
164 continue;
165 for (j = 0; j < (1UL << (HTLB_AREA_SHIFT-SID_SHIFT)); j++)
166 asm volatile("slbie %0"
167 :: "r" ((i << HTLB_AREA_SHIFT) + (j << SID_SHIFT)));
168 }
169
170 asm volatile("isync" : : : "memory");
171}
172
173static int prepare_low_area_for_htlb(struct mm_struct *mm, unsigned long area)
174{
175 unsigned long start = area << SID_SHIFT;
176 unsigned long end = (area+1) << SID_SHIFT;
185 struct vm_area_struct *vma; 177 struct vm_area_struct *vma;
186 178
187 BUG_ON(seg >= 16); 179 BUG_ON(area >= NUM_LOW_AREAS);
188 180
189 /* Check no VMAs are in the region */ 181 /* Check no VMAs are in the region */
190 vma = find_vma(mm, start); 182 vma = find_vma(mm, start);
@@ -194,20 +186,39 @@ static int prepare_low_seg_for_htlb(struct mm_struct *mm, unsigned long seg)
194 return 0; 186 return 0;
195} 187}
196 188
197static int open_low_hpage_segs(struct mm_struct *mm, u16 newsegs) 189static int prepare_high_area_for_htlb(struct mm_struct *mm, unsigned long area)
190{
191 unsigned long start = area << HTLB_AREA_SHIFT;
192 unsigned long end = (area+1) << HTLB_AREA_SHIFT;
193 struct vm_area_struct *vma;
194
195 BUG_ON(area >= NUM_HIGH_AREAS);
196
197 /* Check no VMAs are in the region */
198 vma = find_vma(mm, start);
199 if (vma && (vma->vm_start < end))
200 return -EBUSY;
201
202 return 0;
203}
204
205static int open_low_hpage_areas(struct mm_struct *mm, u16 newareas)
198{ 206{
199 unsigned long i; 207 unsigned long i;
200 208
201 newsegs &= ~(mm->context.htlb_segs); 209 BUILD_BUG_ON((sizeof(newareas)*8) != NUM_LOW_AREAS);
202 if (! newsegs) 210 BUILD_BUG_ON((sizeof(mm->context.low_htlb_areas)*8) != NUM_LOW_AREAS);
211
212 newareas &= ~(mm->context.low_htlb_areas);
213 if (! newareas)
203 return 0; /* The segments we want are already open */ 214 return 0; /* The segments we want are already open */
204 215
205 for (i = 0; i < 16; i++) 216 for (i = 0; i < NUM_LOW_AREAS; i++)
206 if ((1 << i) & newsegs) 217 if ((1 << i) & newareas)
207 if (prepare_low_seg_for_htlb(mm, i) != 0) 218 if (prepare_low_area_for_htlb(mm, i) != 0)
208 return -EBUSY; 219 return -EBUSY;
209 220
210 mm->context.htlb_segs |= newsegs; 221 mm->context.low_htlb_areas |= newareas;
211 222
212 /* update the paca copy of the context struct */ 223 /* update the paca copy of the context struct */
213 get_paca()->context = mm->context; 224 get_paca()->context = mm->context;
@@ -215,29 +226,63 @@ static int open_low_hpage_segs(struct mm_struct *mm, u16 newsegs)
215 /* the context change must make it to memory before the flush, 226 /* the context change must make it to memory before the flush,
216 * so that further SLB misses do the right thing. */ 227 * so that further SLB misses do the right thing. */
217 mb(); 228 mb();
218 on_each_cpu(flush_segments, (void *)(unsigned long)newsegs, 0, 1); 229 on_each_cpu(flush_low_segments, (void *)(unsigned long)newareas, 0, 1);
230
231 return 0;
232}
233
234static int open_high_hpage_areas(struct mm_struct *mm, u16 newareas)
235{
236 unsigned long i;
237
238 BUILD_BUG_ON((sizeof(newareas)*8) != NUM_HIGH_AREAS);
239 BUILD_BUG_ON((sizeof(mm->context.high_htlb_areas)*8)
240 != NUM_HIGH_AREAS);
241
242 newareas &= ~(mm->context.high_htlb_areas);
243 if (! newareas)
244 return 0; /* The areas we want are already open */
245
246 for (i = 0; i < NUM_HIGH_AREAS; i++)
247 if ((1 << i) & newareas)
248 if (prepare_high_area_for_htlb(mm, i) != 0)
249 return -EBUSY;
250
251 mm->context.high_htlb_areas |= newareas;
252
253 /* update the paca copy of the context struct */
254 get_paca()->context = mm->context;
255
256 /* the context change must make it to memory before the flush,
257 * so that further SLB misses do the right thing. */
258 mb();
259 on_each_cpu(flush_high_segments, (void *)(unsigned long)newareas, 0, 1);
219 260
220 return 0; 261 return 0;
221} 262}
222 263
223int prepare_hugepage_range(unsigned long addr, unsigned long len) 264int prepare_hugepage_range(unsigned long addr, unsigned long len)
224{ 265{
225 if (within_hugepage_high_range(addr, len)) 266 int err;
226 return 0; 267
227 else if ((addr < 0x100000000UL) && ((addr+len) < 0x100000000UL)) { 268 if ( (addr+len) < addr )
228 int err; 269 return -EINVAL;
229 /* Yes, we need both tests, in case addr+len overflows 270
230 * 64-bit arithmetic */ 271 if ((addr + len) < 0x100000000UL)
231 err = open_low_hpage_segs(current->mm, 272 err = open_low_hpage_areas(current->mm,
232 LOW_ESID_MASK(addr, len)); 273 LOW_ESID_MASK(addr, len));
233 if (err) 274 else
234 printk(KERN_DEBUG "prepare_hugepage_range(%lx, %lx)" 275 err = open_high_hpage_areas(current->mm,
235 " failed (segs: 0x%04hx)\n", addr, len, 276 HTLB_AREA_MASK(addr, len));
236 LOW_ESID_MASK(addr, len)); 277 if (err) {
278 printk(KERN_DEBUG "prepare_hugepage_range(%lx, %lx)"
279 " failed (lowmask: 0x%04hx, highmask: 0x%04hx)\n",
280 addr, len,
281 LOW_ESID_MASK(addr, len), HTLB_AREA_MASK(addr, len));
237 return err; 282 return err;
238 } 283 }
239 284
240 return -EINVAL; 285 return 0;
241} 286}
242 287
243struct page * 288struct page *
@@ -309,8 +354,8 @@ full_search:
309 vma = find_vma(mm, addr); 354 vma = find_vma(mm, addr);
310 continue; 355 continue;
311 } 356 }
312 if (touches_hugepage_high_range(addr, len)) { 357 if (touches_hugepage_high_range(mm, addr, len)) {
313 addr = TASK_HPAGE_END; 358 addr = ALIGN(addr+1, 1UL<<HTLB_AREA_SHIFT);
314 vma = find_vma(mm, addr); 359 vma = find_vma(mm, addr);
315 continue; 360 continue;
316 } 361 }
@@ -389,8 +434,9 @@ hugepage_recheck:
389 if (touches_hugepage_low_range(mm, addr, len)) { 434 if (touches_hugepage_low_range(mm, addr, len)) {
390 addr = (addr & ((~0) << SID_SHIFT)) - len; 435 addr = (addr & ((~0) << SID_SHIFT)) - len;
391 goto hugepage_recheck; 436 goto hugepage_recheck;
392 } else if (touches_hugepage_high_range(addr, len)) { 437 } else if (touches_hugepage_high_range(mm, addr, len)) {
393 addr = TASK_HPAGE_BASE - len; 438 addr = (addr & ((~0UL) << HTLB_AREA_SHIFT)) - len;
439 goto hugepage_recheck;
394 } 440 }
395 441
396 /* 442 /*
@@ -481,23 +527,28 @@ static unsigned long htlb_get_low_area(unsigned long len, u16 segmask)
481 return -ENOMEM; 527 return -ENOMEM;
482} 528}
483 529
484static unsigned long htlb_get_high_area(unsigned long len) 530static unsigned long htlb_get_high_area(unsigned long len, u16 areamask)
485{ 531{
486 unsigned long addr = TASK_HPAGE_BASE; 532 unsigned long addr = 0x100000000UL;
487 struct vm_area_struct *vma; 533 struct vm_area_struct *vma;
488 534
489 vma = find_vma(current->mm, addr); 535 vma = find_vma(current->mm, addr);
490 for (vma = find_vma(current->mm, addr); 536 while (addr + len <= TASK_SIZE_USER64) {
491 addr + len <= TASK_HPAGE_END;
492 vma = vma->vm_next) {
493 BUG_ON(vma && (addr >= vma->vm_end)); /* invariant */ 537 BUG_ON(vma && (addr >= vma->vm_end)); /* invariant */
494 BUG_ON(! within_hugepage_high_range(addr, len)); 538
539 if (! __within_hugepage_high_range(addr, len, areamask)) {
540 addr = ALIGN(addr+1, 1UL<<HTLB_AREA_SHIFT);
541 vma = find_vma(current->mm, addr);
542 continue;
543 }
495 544
496 if (!vma || (addr + len) <= vma->vm_start) 545 if (!vma || (addr + len) <= vma->vm_start)
497 return addr; 546 return addr;
498 addr = ALIGN(vma->vm_end, HPAGE_SIZE); 547 addr = ALIGN(vma->vm_end, HPAGE_SIZE);
499 /* Because we're in a hugepage region, this alignment 548 /* Depending on segmask this might not be a confirmed
500 * should not skip us over any VMAs */ 549 * hugepage region, so the ALIGN could have skipped
550 * some VMAs */
551 vma = find_vma(current->mm, addr);
501 } 552 }
502 553
503 return -ENOMEM; 554 return -ENOMEM;
@@ -507,6 +558,9 @@ unsigned long hugetlb_get_unmapped_area(struct file *file, unsigned long addr,
507 unsigned long len, unsigned long pgoff, 558 unsigned long len, unsigned long pgoff,
508 unsigned long flags) 559 unsigned long flags)
509{ 560{
561 int lastshift;
562 u16 areamask, curareas;
563
510 if (len & ~HPAGE_MASK) 564 if (len & ~HPAGE_MASK)
511 return -EINVAL; 565 return -EINVAL;
512 566
@@ -514,67 +568,49 @@ unsigned long hugetlb_get_unmapped_area(struct file *file, unsigned long addr,
514 return -EINVAL; 568 return -EINVAL;
515 569
516 if (test_thread_flag(TIF_32BIT)) { 570 if (test_thread_flag(TIF_32BIT)) {
517 int lastshift = 0; 571 curareas = current->mm->context.low_htlb_areas;
518 u16 segmask, cursegs = current->mm->context.htlb_segs;
519 572
520 /* First see if we can do the mapping in the existing 573 /* First see if we can do the mapping in the existing
521 * low hpage segments */ 574 * low areas */
522 addr = htlb_get_low_area(len, cursegs); 575 addr = htlb_get_low_area(len, curareas);
523 if (addr != -ENOMEM) 576 if (addr != -ENOMEM)
524 return addr; 577 return addr;
525 578
526 for (segmask = LOW_ESID_MASK(0x100000000UL-len, len); 579 lastshift = 0;
527 ! lastshift; segmask >>=1) { 580 for (areamask = LOW_ESID_MASK(0x100000000UL-len, len);
528 if (segmask & 1) 581 ! lastshift; areamask >>=1) {
582 if (areamask & 1)
529 lastshift = 1; 583 lastshift = 1;
530 584
531 addr = htlb_get_low_area(len, cursegs | segmask); 585 addr = htlb_get_low_area(len, curareas | areamask);
532 if ((addr != -ENOMEM) 586 if ((addr != -ENOMEM)
533 && open_low_hpage_segs(current->mm, segmask) == 0) 587 && open_low_hpage_areas(current->mm, areamask) == 0)
534 return addr; 588 return addr;
535 } 589 }
536 printk(KERN_DEBUG "hugetlb_get_unmapped_area() unable to open"
537 " enough segments\n");
538 return -ENOMEM;
539 } else { 590 } else {
540 return htlb_get_high_area(len); 591 curareas = current->mm->context.high_htlb_areas;
541 }
542}
543
544void hugetlb_mm_free_pgd(struct mm_struct *mm)
545{
546 int i;
547 pgd_t *pgdir;
548
549 spin_lock(&mm->page_table_lock);
550
551 pgdir = mm->context.huge_pgdir;
552 if (! pgdir)
553 goto out;
554
555 mm->context.huge_pgdir = NULL;
556 592
557 /* cleanup any hugepte pages leftover */ 593 /* First see if we can do the mapping in the existing
558 for (i = 0; i < PTRS_PER_HUGEPGD; i++) { 594 * high areas */
559 pud_t *pud = (pud_t *)(pgdir + i); 595 addr = htlb_get_high_area(len, curareas);
560 596 if (addr != -ENOMEM)
561 if (! pud_none(*pud)) { 597 return addr;
562 pte_t *pte = (pte_t *)pud_page(*pud);
563 struct page *ptepage = virt_to_page(pte);
564 598
565 ptepage->mapping = NULL; 599 lastshift = 0;
600 for (areamask = HTLB_AREA_MASK(TASK_SIZE_USER64-len, len);
601 ! lastshift; areamask >>=1) {
602 if (areamask & 1)
603 lastshift = 1;
566 604
567 BUG_ON(memcmp(pte, empty_zero_page, PAGE_SIZE)); 605 addr = htlb_get_high_area(len, curareas | areamask);
568 kmem_cache_free(zero_cache, pte); 606 if ((addr != -ENOMEM)
607 && open_high_hpage_areas(current->mm, areamask) == 0)
608 return addr;
569 } 609 }
570 pud_clear(pud);
571 } 610 }
572 611 printk(KERN_DEBUG "hugetlb_get_unmapped_area() unable to open"
573 BUG_ON(memcmp(pgdir, empty_zero_page, PAGE_SIZE)); 612 " enough areas\n");
574 kmem_cache_free(zero_cache, pgdir); 613 return -ENOMEM;
575
576 out:
577 spin_unlock(&mm->page_table_lock);
578} 614}
579 615
580int hash_huge_page(struct mm_struct *mm, unsigned long access, 616int hash_huge_page(struct mm_struct *mm, unsigned long access,
@@ -583,7 +619,7 @@ int hash_huge_page(struct mm_struct *mm, unsigned long access,
583 pte_t *ptep; 619 pte_t *ptep;
584 unsigned long va, vpn; 620 unsigned long va, vpn;
585 pte_t old_pte, new_pte; 621 pte_t old_pte, new_pte;
586 unsigned long hpteflags, prpn; 622 unsigned long rflags, prpn;
587 long slot; 623 long slot;
588 int err = 1; 624 int err = 1;
589 625
@@ -626,9 +662,9 @@ int hash_huge_page(struct mm_struct *mm, unsigned long access,
626 old_pte = *ptep; 662 old_pte = *ptep;
627 new_pte = old_pte; 663 new_pte = old_pte;
628 664
629 hpteflags = 0x2 | (! (pte_val(new_pte) & _PAGE_RW)); 665 rflags = 0x2 | (! (pte_val(new_pte) & _PAGE_RW));
630 /* _PAGE_EXEC -> HW_NO_EXEC since it's inverted */ 666 /* _PAGE_EXEC -> HW_NO_EXEC since it's inverted */
631 hpteflags |= ((pte_val(new_pte) & _PAGE_EXEC) ? 0 : HW_NO_EXEC); 667 rflags |= ((pte_val(new_pte) & _PAGE_EXEC) ? 0 : HW_NO_EXEC);
632 668
633 /* Check if pte already has an hpte (case 2) */ 669 /* Check if pte already has an hpte (case 2) */
634 if (unlikely(pte_val(old_pte) & _PAGE_HASHPTE)) { 670 if (unlikely(pte_val(old_pte) & _PAGE_HASHPTE)) {
@@ -641,7 +677,7 @@ int hash_huge_page(struct mm_struct *mm, unsigned long access,
641 slot = (hash & htab_hash_mask) * HPTES_PER_GROUP; 677 slot = (hash & htab_hash_mask) * HPTES_PER_GROUP;
642 slot += (pte_val(old_pte) & _PAGE_GROUP_IX) >> 12; 678 slot += (pte_val(old_pte) & _PAGE_GROUP_IX) >> 12;
643 679
644 if (ppc_md.hpte_updatepp(slot, hpteflags, va, 1, local) == -1) 680 if (ppc_md.hpte_updatepp(slot, rflags, va, 1, local) == -1)
645 pte_val(old_pte) &= ~_PAGE_HPTEFLAGS; 681 pte_val(old_pte) &= ~_PAGE_HPTEFLAGS;
646 } 682 }
647 683
@@ -661,10 +697,10 @@ repeat:
661 697
662 /* Add in WIMG bits */ 698 /* Add in WIMG bits */
663 /* XXX We should store these in the pte */ 699 /* XXX We should store these in the pte */
664 hpteflags |= _PAGE_COHERENT; 700 rflags |= _PAGE_COHERENT;
665 701
666 slot = ppc_md.hpte_insert(hpte_group, va, prpn, 0, 702 slot = ppc_md.hpte_insert(hpte_group, va, prpn,
667 hpteflags, 0, 1); 703 HPTE_V_LARGE, rflags);
668 704
669 /* Primary is full, try the secondary */ 705 /* Primary is full, try the secondary */
670 if (unlikely(slot == -1)) { 706 if (unlikely(slot == -1)) {
@@ -672,7 +708,7 @@ repeat:
672 hpte_group = ((~hash & htab_hash_mask) * 708 hpte_group = ((~hash & htab_hash_mask) *
673 HPTES_PER_GROUP) & ~0x7UL; 709 HPTES_PER_GROUP) & ~0x7UL;
674 slot = ppc_md.hpte_insert(hpte_group, va, prpn, 710 slot = ppc_md.hpte_insert(hpte_group, va, prpn,
675 1, hpteflags, 0, 1); 711 HPTE_V_LARGE, rflags);
676 if (slot == -1) { 712 if (slot == -1) {
677 if (mftb() & 0x1) 713 if (mftb() & 0x1)
678 hpte_group = ((hash & htab_hash_mask) * HPTES_PER_GROUP) & ~0x7UL; 714 hpte_group = ((hash & htab_hash_mask) * HPTES_PER_GROUP) & ~0x7UL;
diff --git a/arch/ppc64/mm/imalloc.c b/arch/ppc64/mm/imalloc.c
index b6e75b891ac0..c65b87b92756 100644
--- a/arch/ppc64/mm/imalloc.c
+++ b/arch/ppc64/mm/imalloc.c
@@ -31,7 +31,7 @@ static int get_free_im_addr(unsigned long size, unsigned long *im_addr)
31 break; 31 break;
32 if ((unsigned long)tmp->addr >= ioremap_bot) 32 if ((unsigned long)tmp->addr >= ioremap_bot)
33 addr = tmp->size + (unsigned long) tmp->addr; 33 addr = tmp->size + (unsigned long) tmp->addr;
34 if (addr > IMALLOC_END-size) 34 if (addr >= IMALLOC_END-size)
35 return 1; 35 return 1;
36 } 36 }
37 *im_addr = addr; 37 *im_addr = addr;
diff --git a/arch/ppc64/mm/init.c b/arch/ppc64/mm/init.c
index b50b3a446dbe..b3b1e9c1770a 100644
--- a/arch/ppc64/mm/init.c
+++ b/arch/ppc64/mm/init.c
@@ -42,7 +42,6 @@
42 42
43#include <asm/pgalloc.h> 43#include <asm/pgalloc.h>
44#include <asm/page.h> 44#include <asm/page.h>
45#include <asm/abs_addr.h>
46#include <asm/prom.h> 45#include <asm/prom.h>
47#include <asm/lmb.h> 46#include <asm/lmb.h>
48#include <asm/rtas.h> 47#include <asm/rtas.h>
@@ -66,6 +65,14 @@
66#include <asm/vdso.h> 65#include <asm/vdso.h>
67#include <asm/imalloc.h> 66#include <asm/imalloc.h>
68 67
68#if PGTABLE_RANGE > USER_VSID_RANGE
69#warning Limited user VSID range means pagetable space is wasted
70#endif
71
72#if (TASK_SIZE_USER64 < PGTABLE_RANGE) && (TASK_SIZE_USER64 < USER_VSID_RANGE)
73#warning TASK_SIZE is smaller than it needs to be.
74#endif
75
69int mem_init_done; 76int mem_init_done;
70unsigned long ioremap_bot = IMALLOC_BASE; 77unsigned long ioremap_bot = IMALLOC_BASE;
71static unsigned long phbs_io_bot = PHBS_IO_BASE; 78static unsigned long phbs_io_bot = PHBS_IO_BASE;
@@ -159,7 +166,6 @@ static int map_io_page(unsigned long ea, unsigned long pa, int flags)
159 ptep = pte_alloc_kernel(&init_mm, pmdp, ea); 166 ptep = pte_alloc_kernel(&init_mm, pmdp, ea);
160 if (!ptep) 167 if (!ptep)
161 return -ENOMEM; 168 return -ENOMEM;
162 pa = abs_to_phys(pa);
163 set_pte_at(&init_mm, ea, ptep, pfn_pte(pa >> PAGE_SHIFT, 169 set_pte_at(&init_mm, ea, ptep, pfn_pte(pa >> PAGE_SHIFT,
164 __pgprot(flags))); 170 __pgprot(flags)));
165 spin_unlock(&init_mm.page_table_lock); 171 spin_unlock(&init_mm.page_table_lock);
@@ -180,9 +186,10 @@ static int map_io_page(unsigned long ea, unsigned long pa, int flags)
180 hpteg = ((hash & htab_hash_mask) * HPTES_PER_GROUP); 186 hpteg = ((hash & htab_hash_mask) * HPTES_PER_GROUP);
181 187
182 /* Panic if a pte grpup is full */ 188 /* Panic if a pte grpup is full */
183 if (ppc_md.hpte_insert(hpteg, va, pa >> PAGE_SHIFT, 0, 189 if (ppc_md.hpte_insert(hpteg, va, pa >> PAGE_SHIFT,
184 _PAGE_NO_CACHE|_PAGE_GUARDED|PP_RWXX, 190 HPTE_V_BOLTED,
185 1, 0) == -1) { 191 _PAGE_NO_CACHE|_PAGE_GUARDED|PP_RWXX)
192 == -1) {
186 panic("map_io_page: could not insert mapping"); 193 panic("map_io_page: could not insert mapping");
187 } 194 }
188 } 195 }
@@ -225,7 +232,7 @@ void __iomem * __ioremap(unsigned long addr, unsigned long size,
225 * Before that, we map using addresses going 232 * Before that, we map using addresses going
226 * up from ioremap_bot. imalloc will use 233 * up from ioremap_bot. imalloc will use
227 * the addresses from ioremap_bot through 234 * the addresses from ioremap_bot through
228 * IMALLOC_END (0xE000001fffffffff) 235 * IMALLOC_END
229 * 236 *
230 */ 237 */
231 pa = addr & PAGE_MASK; 238 pa = addr & PAGE_MASK;
@@ -416,12 +423,6 @@ int init_new_context(struct task_struct *tsk, struct mm_struct *mm)
416 int index; 423 int index;
417 int err; 424 int err;
418 425
419#ifdef CONFIG_HUGETLB_PAGE
420 /* We leave htlb_segs as it was, but for a fork, we need to
421 * clear the huge_pgdir. */
422 mm->context.huge_pgdir = NULL;
423#endif
424
425again: 426again:
426 if (!idr_pre_get(&mmu_context_idr, GFP_KERNEL)) 427 if (!idr_pre_get(&mmu_context_idr, GFP_KERNEL))
427 return -ENOMEM; 428 return -ENOMEM;
@@ -452,8 +453,6 @@ void destroy_context(struct mm_struct *mm)
452 spin_unlock(&mmu_context_lock); 453 spin_unlock(&mmu_context_lock);
453 454
454 mm->context.id = NO_CONTEXT; 455 mm->context.id = NO_CONTEXT;
455
456 hugetlb_mm_free_pgd(mm);
457} 456}
458 457
459/* 458/*
@@ -483,9 +482,9 @@ void __init mm_init_ppc64(void)
483 for (i = 1; i < lmb.memory.cnt; i++) { 482 for (i = 1; i < lmb.memory.cnt; i++) {
484 unsigned long base, prevbase, prevsize; 483 unsigned long base, prevbase, prevsize;
485 484
486 prevbase = lmb.memory.region[i-1].physbase; 485 prevbase = lmb.memory.region[i-1].base;
487 prevsize = lmb.memory.region[i-1].size; 486 prevsize = lmb.memory.region[i-1].size;
488 base = lmb.memory.region[i].physbase; 487 base = lmb.memory.region[i].base;
489 if (base > (prevbase + prevsize)) { 488 if (base > (prevbase + prevsize)) {
490 io_hole_start = prevbase + prevsize; 489 io_hole_start = prevbase + prevsize;
491 io_hole_size = base - (prevbase + prevsize); 490 io_hole_size = base - (prevbase + prevsize);
@@ -512,11 +511,8 @@ int page_is_ram(unsigned long pfn)
512 for (i=0; i < lmb.memory.cnt; i++) { 511 for (i=0; i < lmb.memory.cnt; i++) {
513 unsigned long base; 512 unsigned long base;
514 513
515#ifdef CONFIG_MSCHUNKS
516 base = lmb.memory.region[i].physbase;
517#else
518 base = lmb.memory.region[i].base; 514 base = lmb.memory.region[i].base;
519#endif 515
520 if ((paddr >= base) && 516 if ((paddr >= base) &&
521 (paddr < (base + lmb.memory.region[i].size))) { 517 (paddr < (base + lmb.memory.region[i].size))) {
522 return 1; 518 return 1;
@@ -546,7 +542,7 @@ void __init do_init_bootmem(void)
546 */ 542 */
547 bootmap_pages = bootmem_bootmap_pages(total_pages); 543 bootmap_pages = bootmem_bootmap_pages(total_pages);
548 544
549 start = abs_to_phys(lmb_alloc(bootmap_pages<<PAGE_SHIFT, PAGE_SIZE)); 545 start = lmb_alloc(bootmap_pages<<PAGE_SHIFT, PAGE_SIZE);
550 BUG_ON(!start); 546 BUG_ON(!start);
551 547
552 boot_mapsize = init_bootmem(start >> PAGE_SHIFT, total_pages); 548 boot_mapsize = init_bootmem(start >> PAGE_SHIFT, total_pages);
@@ -556,27 +552,18 @@ void __init do_init_bootmem(void)
556 /* Add all physical memory to the bootmem map, mark each area 552 /* Add all physical memory to the bootmem map, mark each area
557 * present. 553 * present.
558 */ 554 */
559 for (i=0; i < lmb.memory.cnt; i++) { 555 for (i=0; i < lmb.memory.cnt; i++)
560 unsigned long physbase, size; 556 free_bootmem(lmb_start_pfn(&lmb.memory, i),
561 unsigned long start_pfn, end_pfn; 557 lmb_size_bytes(&lmb.memory, i));
562
563 physbase = lmb.memory.region[i].physbase;
564 size = lmb.memory.region[i].size;
565
566 start_pfn = physbase >> PAGE_SHIFT;
567 end_pfn = start_pfn + (size >> PAGE_SHIFT);
568 memory_present(0, start_pfn, end_pfn);
569
570 free_bootmem(physbase, size);
571 }
572 558
573 /* reserve the sections we're already using */ 559 /* reserve the sections we're already using */
574 for (i=0; i < lmb.reserved.cnt; i++) { 560 for (i=0; i < lmb.reserved.cnt; i++)
575 unsigned long physbase = lmb.reserved.region[i].physbase; 561 reserve_bootmem(lmb_start_pfn(&lmb.reserved, i),
576 unsigned long size = lmb.reserved.region[i].size; 562 lmb_size_bytes(&lmb.reserved, i));
577 563
578 reserve_bootmem(physbase, size); 564 for (i=0; i < lmb.memory.cnt; i++)
579 } 565 memory_present(0, lmb_start_pfn(&lmb.memory, i),
566 lmb_end_pfn(&lmb.memory, i));
580} 567}
581 568
582/* 569/*
@@ -614,10 +601,10 @@ static int __init setup_kcore(void)
614 int i; 601 int i;
615 602
616 for (i=0; i < lmb.memory.cnt; i++) { 603 for (i=0; i < lmb.memory.cnt; i++) {
617 unsigned long physbase, size; 604 unsigned long base, size;
618 struct kcore_list *kcore_mem; 605 struct kcore_list *kcore_mem;
619 606
620 physbase = lmb.memory.region[i].physbase; 607 base = lmb.memory.region[i].base;
621 size = lmb.memory.region[i].size; 608 size = lmb.memory.region[i].size;
622 609
623 /* GFP_ATOMIC to avoid might_sleep warnings during boot */ 610 /* GFP_ATOMIC to avoid might_sleep warnings during boot */
@@ -625,7 +612,7 @@ static int __init setup_kcore(void)
625 if (!kcore_mem) 612 if (!kcore_mem)
626 panic("mem_init: kmalloc failed\n"); 613 panic("mem_init: kmalloc failed\n");
627 614
628 kclist_add(kcore_mem, __va(physbase), size); 615 kclist_add(kcore_mem, __va(base), size);
629 } 616 }
630 617
631 kclist_add(&kcore_vmem, (void *)VMALLOC_START, VMALLOC_END-VMALLOC_START); 618 kclist_add(&kcore_vmem, (void *)VMALLOC_START, VMALLOC_END-VMALLOC_START);
@@ -685,9 +672,6 @@ void __init mem_init(void)
685 672
686 mem_init_done = 1; 673 mem_init_done = 1;
687 674
688#ifdef CONFIG_PPC_ISERIES
689 iommu_vio_init();
690#endif
691 /* Initialize the vDSO */ 675 /* Initialize the vDSO */
692 vdso_init(); 676 vdso_init();
693} 677}
@@ -832,23 +816,43 @@ void __iomem * reserve_phb_iospace(unsigned long size)
832 return virt_addr; 816 return virt_addr;
833} 817}
834 818
835kmem_cache_t *zero_cache; 819static void zero_ctor(void *addr, kmem_cache_t *cache, unsigned long flags)
836
837static void zero_ctor(void *pte, kmem_cache_t *cache, unsigned long flags)
838{ 820{
839 memset(pte, 0, PAGE_SIZE); 821 memset(addr, 0, kmem_cache_size(cache));
840} 822}
841 823
824static const int pgtable_cache_size[2] = {
825 PTE_TABLE_SIZE, PMD_TABLE_SIZE
826};
827static const char *pgtable_cache_name[ARRAY_SIZE(pgtable_cache_size)] = {
828 "pgd_pte_cache", "pud_pmd_cache",
829};
830
831kmem_cache_t *pgtable_cache[ARRAY_SIZE(pgtable_cache_size)];
832
842void pgtable_cache_init(void) 833void pgtable_cache_init(void)
843{ 834{
844 zero_cache = kmem_cache_create("zero", 835 int i;
845 PAGE_SIZE, 836
846 0, 837 BUILD_BUG_ON(PTE_TABLE_SIZE != pgtable_cache_size[PTE_CACHE_NUM]);
847 SLAB_HWCACHE_ALIGN | SLAB_MUST_HWCACHE_ALIGN, 838 BUILD_BUG_ON(PMD_TABLE_SIZE != pgtable_cache_size[PMD_CACHE_NUM]);
848 zero_ctor, 839 BUILD_BUG_ON(PUD_TABLE_SIZE != pgtable_cache_size[PUD_CACHE_NUM]);
849 NULL); 840 BUILD_BUG_ON(PGD_TABLE_SIZE != pgtable_cache_size[PGD_CACHE_NUM]);
850 if (!zero_cache) 841
851 panic("pgtable_cache_init(): could not create zero_cache!\n"); 842 for (i = 0; i < ARRAY_SIZE(pgtable_cache_size); i++) {
843 int size = pgtable_cache_size[i];
844 const char *name = pgtable_cache_name[i];
845
846 pgtable_cache[i] = kmem_cache_create(name,
847 size, size,
848 SLAB_HWCACHE_ALIGN
849 | SLAB_MUST_HWCACHE_ALIGN,
850 zero_ctor,
851 NULL);
852 if (! pgtable_cache[i])
853 panic("pgtable_cache_init(): could not create %s!\n",
854 name);
855 }
852} 856}
853 857
854pgprot_t phys_mem_access_prot(struct file *file, unsigned long addr, 858pgprot_t phys_mem_access_prot(struct file *file, unsigned long addr,
diff --git a/arch/ppc64/mm/numa.c b/arch/ppc64/mm/numa.c
index cafd91aef289..cb864b8f2750 100644
--- a/arch/ppc64/mm/numa.c
+++ b/arch/ppc64/mm/numa.c
@@ -440,8 +440,6 @@ new_range:
440 for (i = start ; i < (start+size); i += MEMORY_INCREMENT) 440 for (i = start ; i < (start+size); i += MEMORY_INCREMENT)
441 numa_memory_lookup_table[i >> MEMORY_INCREMENT_SHIFT] = 441 numa_memory_lookup_table[i >> MEMORY_INCREMENT_SHIFT] =
442 numa_domain; 442 numa_domain;
443 memory_present(numa_domain, start >> PAGE_SHIFT,
444 (start + size) >> PAGE_SHIFT);
445 443
446 if (--ranges) 444 if (--ranges)
447 goto new_range; 445 goto new_range;
@@ -483,7 +481,6 @@ static void __init setup_nonnuma(void)
483 481
484 for (i = 0 ; i < top_of_ram; i += MEMORY_INCREMENT) 482 for (i = 0 ; i < top_of_ram; i += MEMORY_INCREMENT)
485 numa_memory_lookup_table[i >> MEMORY_INCREMENT_SHIFT] = 0; 483 numa_memory_lookup_table[i >> MEMORY_INCREMENT_SHIFT] = 0;
486 memory_present(0, 0, init_node_data[0].node_end_pfn);
487} 484}
488 485
489static void __init dump_numa_topology(void) 486static void __init dump_numa_topology(void)
@@ -647,7 +644,12 @@ void __init do_init_bootmem(void)
647new_range: 644new_range:
648 mem_start = read_n_cells(addr_cells, &memcell_buf); 645 mem_start = read_n_cells(addr_cells, &memcell_buf);
649 mem_size = read_n_cells(size_cells, &memcell_buf); 646 mem_size = read_n_cells(size_cells, &memcell_buf);
650 numa_domain = numa_enabled ? of_node_numa_domain(memory) : 0; 647 if (numa_enabled) {
648 numa_domain = of_node_numa_domain(memory);
649 if (numa_domain >= MAX_NUMNODES)
650 numa_domain = 0;
651 } else
652 numa_domain = 0;
651 653
652 if (numa_domain != nid) 654 if (numa_domain != nid)
653 continue; 655 continue;
@@ -666,7 +668,7 @@ new_range:
666 * Mark reserved regions on this node 668 * Mark reserved regions on this node
667 */ 669 */
668 for (i = 0; i < lmb.reserved.cnt; i++) { 670 for (i = 0; i < lmb.reserved.cnt; i++) {
669 unsigned long physbase = lmb.reserved.region[i].physbase; 671 unsigned long physbase = lmb.reserved.region[i].base;
670 unsigned long size = lmb.reserved.region[i].size; 672 unsigned long size = lmb.reserved.region[i].size;
671 673
672 if (pa_to_nid(physbase) != nid && 674 if (pa_to_nid(physbase) != nid &&
@@ -690,6 +692,46 @@ new_range:
690 size); 692 size);
691 } 693 }
692 } 694 }
695 /*
696 * This loop may look famaliar, but we have to do it again
697 * after marking our reserved memory to mark memory present
698 * for sparsemem.
699 */
700 addr_cells = get_mem_addr_cells();
701 size_cells = get_mem_size_cells();
702 memory = NULL;
703 while ((memory = of_find_node_by_type(memory, "memory")) != NULL) {
704 unsigned long mem_start, mem_size;
705 int numa_domain, ranges;
706 unsigned int *memcell_buf;
707 unsigned int len;
708
709 memcell_buf = (unsigned int *)get_property(memory, "reg", &len);
710 if (!memcell_buf || len <= 0)
711 continue;
712
713 ranges = memory->n_addrs; /* ranges in cell */
714new_range2:
715 mem_start = read_n_cells(addr_cells, &memcell_buf);
716 mem_size = read_n_cells(size_cells, &memcell_buf);
717 if (numa_enabled) {
718 numa_domain = of_node_numa_domain(memory);
719 if (numa_domain >= MAX_NUMNODES)
720 numa_domain = 0;
721 } else
722 numa_domain = 0;
723
724 if (numa_domain != nid)
725 continue;
726
727 mem_size = numa_enforce_memory_limit(mem_start, mem_size);
728 memory_present(numa_domain, mem_start >> PAGE_SHIFT,
729 (mem_start + mem_size) >> PAGE_SHIFT);
730
731 if (--ranges) /* process all ranges in cell */
732 goto new_range2;
733 }
734
693 } 735 }
694} 736}
695 737
diff --git a/arch/ppc64/mm/slb_low.S b/arch/ppc64/mm/slb_low.S
index 8379d678f70f..698d6b9ed6d1 100644
--- a/arch/ppc64/mm/slb_low.S
+++ b/arch/ppc64/mm/slb_low.S
@@ -89,32 +89,29 @@ END_FTR_SECTION_IFSET(CPU_FTR_16M_PAGE)
89 b 9f 89 b 9f
90 90
910: /* user address: proto-VSID = context<<15 | ESID */ 910: /* user address: proto-VSID = context<<15 | ESID */
92 li r11,SLB_VSID_USER 92 srdi. r9,r3,USER_ESID_BITS
93
94 srdi. r9,r3,13
95 bne- 8f /* invalid ea bits set */ 93 bne- 8f /* invalid ea bits set */
96 94
97#ifdef CONFIG_HUGETLB_PAGE 95#ifdef CONFIG_HUGETLB_PAGE
98BEGIN_FTR_SECTION 96BEGIN_FTR_SECTION
99 /* check against the hugepage ranges */ 97 lhz r9,PACAHIGHHTLBAREAS(r13)
100 cmpldi r3,(TASK_HPAGE_END>>SID_SHIFT) 98 srdi r11,r3,(HTLB_AREA_SHIFT-SID_SHIFT)
101 bge 6f /* >= TASK_HPAGE_END */ 99 srd r9,r9,r11
102 cmpldi r3,(TASK_HPAGE_BASE>>SID_SHIFT) 100 lhz r11,PACALOWHTLBAREAS(r13)
103 bge 5f /* TASK_HPAGE_BASE..TASK_HPAGE_END */ 101 srd r11,r11,r3
104 cmpldi r3,16 102 or r9,r9,r11
105 bge 6f /* 4GB..TASK_HPAGE_BASE */ 103END_FTR_SECTION_IFSET(CPU_FTR_16M_PAGE)
106 104#endif /* CONFIG_HUGETLB_PAGE */
107 lhz r9,PACAHTLBSEGS(r13) 105
108 srd r9,r9,r3 106 li r11,SLB_VSID_USER
109 andi. r9,r9,1 107
110 beq 6f 108#ifdef CONFIG_HUGETLB_PAGE
111 109BEGIN_FTR_SECTION
1125: /* this is a hugepage user address */ 110 rldimi r11,r9,8,55 /* shift masked bit into SLB_VSID_L */
113 li r11,(SLB_VSID_USER|SLB_VSID_L)
114END_FTR_SECTION_IFSET(CPU_FTR_16M_PAGE) 111END_FTR_SECTION_IFSET(CPU_FTR_16M_PAGE)
115#endif /* CONFIG_HUGETLB_PAGE */ 112#endif /* CONFIG_HUGETLB_PAGE */
116 113
1176: ld r9,PACACONTEXTID(r13) 114 ld r9,PACACONTEXTID(r13)
118 rldimi r3,r9,USER_ESID_BITS,0 115 rldimi r3,r9,USER_ESID_BITS,0
119 116
1209: /* r3 = protovsid, r11 = flags, r10 = esid_data, cr7 = <>KERNELBASE */ 1179: /* r3 = protovsid, r11 = flags, r10 = esid_data, cr7 = <>KERNELBASE */
diff --git a/arch/ppc64/mm/stab.c b/arch/ppc64/mm/stab.c
index df4bbe14153c..1b83f002bf27 100644
--- a/arch/ppc64/mm/stab.c
+++ b/arch/ppc64/mm/stab.c
@@ -18,6 +18,8 @@
18#include <asm/mmu_context.h> 18#include <asm/mmu_context.h>
19#include <asm/paca.h> 19#include <asm/paca.h>
20#include <asm/cputable.h> 20#include <asm/cputable.h>
21#include <asm/lmb.h>
22#include <asm/abs_addr.h>
21 23
22struct stab_entry { 24struct stab_entry {
23 unsigned long esid_data; 25 unsigned long esid_data;
@@ -224,6 +226,39 @@ void switch_stab(struct task_struct *tsk, struct mm_struct *mm)
224extern void slb_initialize(void); 226extern void slb_initialize(void);
225 227
226/* 228/*
229 * Allocate segment tables for secondary CPUs. These must all go in
230 * the first (bolted) segment, so that do_stab_bolted won't get a
231 * recursive segment miss on the segment table itself.
232 */
233void stabs_alloc(void)
234{
235 int cpu;
236
237 if (cpu_has_feature(CPU_FTR_SLB))
238 return;
239
240 for_each_cpu(cpu) {
241 unsigned long newstab;
242
243 if (cpu == 0)
244 continue; /* stab for CPU 0 is statically allocated */
245
246 newstab = lmb_alloc_base(PAGE_SIZE, PAGE_SIZE, 1<<SID_SHIFT);
247 if (! newstab)
248 panic("Unable to allocate segment table for CPU %d.\n",
249 cpu);
250
251 newstab += KERNELBASE;
252
253 memset((void *)newstab, 0, PAGE_SIZE);
254
255 paca[cpu].stab_addr = newstab;
256 paca[cpu].stab_real = virt_to_abs(newstab);
257 printk(KERN_DEBUG "Segment table for CPU %d at 0x%lx virtual, 0x%lx absolute\n", cpu, paca[cpu].stab_addr, paca[cpu].stab_real);
258 }
259}
260
261/*
227 * Build an entry for the base kernel segment and put it into 262 * Build an entry for the base kernel segment and put it into
228 * the segment table or SLB. All other segment table or SLB 263 * the segment table or SLB. All other segment table or SLB
229 * entries are faulted in. 264 * entries are faulted in.
diff --git a/arch/ppc64/mm/tlb.c b/arch/ppc64/mm/tlb.c
index 26f0172c4527..d8a6593a13f0 100644
--- a/arch/ppc64/mm/tlb.c
+++ b/arch/ppc64/mm/tlb.c
@@ -41,7 +41,58 @@ DEFINE_PER_CPU(struct mmu_gather, mmu_gathers);
41DEFINE_PER_CPU(struct pte_freelist_batch *, pte_freelist_cur); 41DEFINE_PER_CPU(struct pte_freelist_batch *, pte_freelist_cur);
42unsigned long pte_freelist_forced_free; 42unsigned long pte_freelist_forced_free;
43 43
44void __pte_free_tlb(struct mmu_gather *tlb, struct page *ptepage) 44struct pte_freelist_batch
45{
46 struct rcu_head rcu;
47 unsigned int index;
48 pgtable_free_t tables[0];
49};
50
51DEFINE_PER_CPU(struct pte_freelist_batch *, pte_freelist_cur);
52unsigned long pte_freelist_forced_free;
53
54#define PTE_FREELIST_SIZE \
55 ((PAGE_SIZE - sizeof(struct pte_freelist_batch)) \
56 / sizeof(pgtable_free_t))
57
58#ifdef CONFIG_SMP
59static void pte_free_smp_sync(void *arg)
60{
61 /* Do nothing, just ensure we sync with all CPUs */
62}
63#endif
64
65/* This is only called when we are critically out of memory
66 * (and fail to get a page in pte_free_tlb).
67 */
68static void pgtable_free_now(pgtable_free_t pgf)
69{
70 pte_freelist_forced_free++;
71
72 smp_call_function(pte_free_smp_sync, NULL, 0, 1);
73
74 pgtable_free(pgf);
75}
76
77static void pte_free_rcu_callback(struct rcu_head *head)
78{
79 struct pte_freelist_batch *batch =
80 container_of(head, struct pte_freelist_batch, rcu);
81 unsigned int i;
82
83 for (i = 0; i < batch->index; i++)
84 pgtable_free(batch->tables[i]);
85
86 free_page((unsigned long)batch);
87}
88
89static void pte_free_submit(struct pte_freelist_batch *batch)
90{
91 INIT_RCU_HEAD(&batch->rcu);
92 call_rcu(&batch->rcu, pte_free_rcu_callback);
93}
94
95void pgtable_free_tlb(struct mmu_gather *tlb, pgtable_free_t pgf)
45{ 96{
46 /* This is safe as we are holding page_table_lock */ 97 /* This is safe as we are holding page_table_lock */
47 cpumask_t local_cpumask = cpumask_of_cpu(smp_processor_id()); 98 cpumask_t local_cpumask = cpumask_of_cpu(smp_processor_id());
@@ -49,19 +100,19 @@ void __pte_free_tlb(struct mmu_gather *tlb, struct page *ptepage)
49 100
50 if (atomic_read(&tlb->mm->mm_users) < 2 || 101 if (atomic_read(&tlb->mm->mm_users) < 2 ||
51 cpus_equal(tlb->mm->cpu_vm_mask, local_cpumask)) { 102 cpus_equal(tlb->mm->cpu_vm_mask, local_cpumask)) {
52 pte_free(ptepage); 103 pgtable_free(pgf);
53 return; 104 return;
54 } 105 }
55 106
56 if (*batchp == NULL) { 107 if (*batchp == NULL) {
57 *batchp = (struct pte_freelist_batch *)__get_free_page(GFP_ATOMIC); 108 *batchp = (struct pte_freelist_batch *)__get_free_page(GFP_ATOMIC);
58 if (*batchp == NULL) { 109 if (*batchp == NULL) {
59 pte_free_now(ptepage); 110 pgtable_free_now(pgf);
60 return; 111 return;
61 } 112 }
62 (*batchp)->index = 0; 113 (*batchp)->index = 0;
63 } 114 }
64 (*batchp)->pages[(*batchp)->index++] = ptepage; 115 (*batchp)->tables[(*batchp)->index++] = pgf;
65 if ((*batchp)->index == PTE_FREELIST_SIZE) { 116 if ((*batchp)->index == PTE_FREELIST_SIZE) {
66 pte_free_submit(*batchp); 117 pte_free_submit(*batchp);
67 *batchp = NULL; 118 *batchp = NULL;
@@ -132,42 +183,6 @@ void __flush_tlb_pending(struct ppc64_tlb_batch *batch)
132 put_cpu(); 183 put_cpu();
133} 184}
134 185
135#ifdef CONFIG_SMP
136static void pte_free_smp_sync(void *arg)
137{
138 /* Do nothing, just ensure we sync with all CPUs */
139}
140#endif
141
142/* This is only called when we are critically out of memory
143 * (and fail to get a page in pte_free_tlb).
144 */
145void pte_free_now(struct page *ptepage)
146{
147 pte_freelist_forced_free++;
148
149 smp_call_function(pte_free_smp_sync, NULL, 0, 1);
150
151 pte_free(ptepage);
152}
153
154static void pte_free_rcu_callback(struct rcu_head *head)
155{
156 struct pte_freelist_batch *batch =
157 container_of(head, struct pte_freelist_batch, rcu);
158 unsigned int i;
159
160 for (i = 0; i < batch->index; i++)
161 pte_free(batch->pages[i]);
162 free_page((unsigned long)batch);
163}
164
165void pte_free_submit(struct pte_freelist_batch *batch)
166{
167 INIT_RCU_HEAD(&batch->rcu);
168 call_rcu(&batch->rcu, pte_free_rcu_callback);
169}
170
171void pte_free_finish(void) 186void pte_free_finish(void)
172{ 187{
173 /* This is safe as we are holding page_table_lock */ 188 /* This is safe as we are holding page_table_lock */
diff --git a/arch/ppc64/oprofile/common.c b/arch/ppc64/oprofile/common.c
index b28bfda23d94..4acd1a424933 100644
--- a/arch/ppc64/oprofile/common.c
+++ b/arch/ppc64/oprofile/common.c
@@ -153,6 +153,7 @@ int __init oprofile_arch_init(struct oprofile_operations *ops)
153 153
154 case PV_970: 154 case PV_970:
155 case PV_970FX: 155 case PV_970FX:
156 case PV_970MP:
156 model = &op_model_power4; 157 model = &op_model_power4;
157 model->num_counters = 8; 158 model->num_counters = 8;
158 ops->cpu_type = "ppc64/970"; 159 ops->cpu_type = "ppc64/970";
diff --git a/arch/ppc64/xmon/start.c b/arch/ppc64/xmon/start.c
index a9265bcc79b2..f86b584acd76 100644
--- a/arch/ppc64/xmon/start.c
+++ b/arch/ppc64/xmon/start.c
@@ -27,7 +27,7 @@ static void sysrq_handle_xmon(int key, struct pt_regs *pt_regs,
27 struct tty_struct *tty) 27 struct tty_struct *tty)
28{ 28{
29 /* ensure xmon is enabled */ 29 /* ensure xmon is enabled */
30 xmon_init(); 30 xmon_init(1);
31 debugger(pt_regs); 31 debugger(pt_regs);
32} 32}
33 33
diff --git a/arch/ppc64/xmon/xmon.c b/arch/ppc64/xmon/xmon.c
index 7f6e13a4b71e..45908b10acd3 100644
--- a/arch/ppc64/xmon/xmon.c
+++ b/arch/ppc64/xmon/xmon.c
@@ -329,13 +329,16 @@ int xmon_core(struct pt_regs *regs, int fromipi)
329 printf("cpu 0x%x: Exception %lx %s in xmon, " 329 printf("cpu 0x%x: Exception %lx %s in xmon, "
330 "returning to main loop\n", 330 "returning to main loop\n",
331 cpu, regs->trap, getvecname(TRAP(regs))); 331 cpu, regs->trap, getvecname(TRAP(regs)));
332 release_output_lock();
332 longjmp(xmon_fault_jmp[cpu], 1); 333 longjmp(xmon_fault_jmp[cpu], 1);
333 } 334 }
334 335
335 if (setjmp(recurse_jmp) != 0) { 336 if (setjmp(recurse_jmp) != 0) {
336 if (!in_xmon || !xmon_gate) { 337 if (!in_xmon || !xmon_gate) {
338 get_output_lock();
337 printf("xmon: WARNING: bad recursive fault " 339 printf("xmon: WARNING: bad recursive fault "
338 "on cpu 0x%x\n", cpu); 340 "on cpu 0x%x\n", cpu);
341 release_output_lock();
339 goto waiting; 342 goto waiting;
340 } 343 }
341 secondary = !(xmon_taken && cpu == xmon_owner); 344 secondary = !(xmon_taken && cpu == xmon_owner);
@@ -2493,15 +2496,25 @@ static void dump_stab(void)
2493 } 2496 }
2494} 2497}
2495 2498
2496void xmon_init(void) 2499void xmon_init(int enable)
2497{ 2500{
2498 __debugger = xmon; 2501 if (enable) {
2499 __debugger_ipi = xmon_ipi; 2502 __debugger = xmon;
2500 __debugger_bpt = xmon_bpt; 2503 __debugger_ipi = xmon_ipi;
2501 __debugger_sstep = xmon_sstep; 2504 __debugger_bpt = xmon_bpt;
2502 __debugger_iabr_match = xmon_iabr_match; 2505 __debugger_sstep = xmon_sstep;
2503 __debugger_dabr_match = xmon_dabr_match; 2506 __debugger_iabr_match = xmon_iabr_match;
2504 __debugger_fault_handler = xmon_fault_handler; 2507 __debugger_dabr_match = xmon_dabr_match;
2508 __debugger_fault_handler = xmon_fault_handler;
2509 } else {
2510 __debugger = NULL;
2511 __debugger_ipi = NULL;
2512 __debugger_bpt = NULL;
2513 __debugger_sstep = NULL;
2514 __debugger_iabr_match = NULL;
2515 __debugger_dabr_match = NULL;
2516 __debugger_fault_handler = NULL;
2517 }
2505} 2518}
2506 2519
2507void dump_segments(void) 2520void dump_segments(void)
diff --git a/arch/s390/Kconfig b/arch/s390/Kconfig
index 6600ee87f896..477ac2758bd5 100644
--- a/arch/s390/Kconfig
+++ b/arch/s390/Kconfig
@@ -465,6 +465,8 @@ config KEXEC
465 465
466endmenu 466endmenu
467 467
468source "net/Kconfig"
469
468config PCMCIA 470config PCMCIA
469 bool 471 bool
470 default n 472 default n
@@ -475,7 +477,7 @@ source "drivers/scsi/Kconfig"
475 477
476source "drivers/s390/Kconfig" 478source "drivers/s390/Kconfig"
477 479
478source "net/Kconfig" 480source "drivers/net/Kconfig"
479 481
480source "fs/Kconfig" 482source "fs/Kconfig"
481 483
diff --git a/arch/s390/appldata/appldata_base.c b/arch/s390/appldata/appldata_base.c
index c067435bae45..c9f2f60cfa58 100644
--- a/arch/s390/appldata/appldata_base.c
+++ b/arch/s390/appldata/appldata_base.c
@@ -232,7 +232,11 @@ static int appldata_diag(char record_nr, u16 function, unsigned long buffer,
232 ry = -1; 232 ry = -1;
233 asm volatile( 233 asm volatile(
234 "diag %1,%0,0xDC\n\t" 234 "diag %1,%0,0xDC\n\t"
235 : "=d" (ry) : "d" (&(appldata_parameter_list)) : "cc"); 235 : "=d" (ry)
236 : "d" (&appldata_parameter_list),
237 "m" (appldata_parameter_list),
238 "m" (appldata_product_id)
239 : "cc");
236 return (int) ry; 240 return (int) ry;
237} 241}
238/************************ timer, work, DIAG <END> ****************************/ 242/************************ timer, work, DIAG <END> ****************************/
diff --git a/arch/s390/defconfig b/arch/s390/defconfig
index 89850b2c27ea..0865251a3f44 100644
--- a/arch/s390/defconfig
+++ b/arch/s390/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.12-rc3 3# Linux kernel version: 2.6.13-rc4
4# Fri Apr 22 15:30:58 2005 4# Fri Jul 29 14:49:30 2005
5# 5#
6CONFIG_MMU=y 6CONFIG_MMU=y
7CONFIG_RWSEM_XCHGADD_ALGORITHM=y 7CONFIG_RWSEM_XCHGADD_ALGORITHM=y
@@ -23,10 +23,11 @@ CONFIG_INIT_ENV_ARG_LIMIT=32
23CONFIG_LOCALVERSION="" 23CONFIG_LOCALVERSION=""
24CONFIG_SWAP=y 24CONFIG_SWAP=y
25CONFIG_SYSVIPC=y 25CONFIG_SYSVIPC=y
26# CONFIG_POSIX_MQUEUE is not set 26CONFIG_POSIX_MQUEUE=y
27# CONFIG_BSD_PROCESS_ACCT is not set 27# CONFIG_BSD_PROCESS_ACCT is not set
28CONFIG_SYSCTL=y 28CONFIG_SYSCTL=y
29# CONFIG_AUDIT is not set 29CONFIG_AUDIT=y
30# CONFIG_AUDITSYSCALL is not set
30CONFIG_HOTPLUG=y 31CONFIG_HOTPLUG=y
31CONFIG_KOBJECT_UEVENT=y 32CONFIG_KOBJECT_UEVENT=y
32CONFIG_IKCONFIG=y 33CONFIG_IKCONFIG=y
@@ -36,6 +37,8 @@ CONFIG_IKCONFIG_PROC=y
36CONFIG_KALLSYMS=y 37CONFIG_KALLSYMS=y
37# CONFIG_KALLSYMS_ALL is not set 38# CONFIG_KALLSYMS_ALL is not set
38# CONFIG_KALLSYMS_EXTRA_PASS is not set 39# CONFIG_KALLSYMS_EXTRA_PASS is not set
40CONFIG_PRINTK=y
41CONFIG_BUG=y
39CONFIG_BASE_FULL=y 42CONFIG_BASE_FULL=y
40CONFIG_FUTEX=y 43CONFIG_FUTEX=y
41CONFIG_EPOLL=y 44CONFIG_EPOLL=y
@@ -51,9 +54,10 @@ CONFIG_BASE_SMALL=0
51# Loadable module support 54# Loadable module support
52# 55#
53CONFIG_MODULES=y 56CONFIG_MODULES=y
54# CONFIG_MODULE_UNLOAD is not set 57CONFIG_MODULE_UNLOAD=y
58# CONFIG_MODULE_FORCE_UNLOAD is not set
55CONFIG_OBSOLETE_MODPARM=y 59CONFIG_OBSOLETE_MODPARM=y
56# CONFIG_MODVERSIONS is not set 60CONFIG_MODVERSIONS=y
57# CONFIG_MODULE_SRCVERSION_ALL is not set 61# CONFIG_MODULE_SRCVERSION_ALL is not set
58CONFIG_KMOD=y 62CONFIG_KMOD=y
59CONFIG_STOP_MACHINE=y 63CONFIG_STOP_MACHINE=y
@@ -81,8 +85,15 @@ CONFIG_MARCH_G5=y
81# CONFIG_MARCH_Z990 is not set 85# CONFIG_MARCH_Z990 is not set
82CONFIG_PACK_STACK=y 86CONFIG_PACK_STACK=y
83# CONFIG_SMALL_STACK is not set 87# CONFIG_SMALL_STACK is not set
84# CONFIG_CHECK_STACK is not set 88CONFIG_CHECK_STACK=y
89CONFIG_STACK_GUARD=256
85# CONFIG_WARN_STACK is not set 90# CONFIG_WARN_STACK is not set
91CONFIG_SELECT_MEMORY_MODEL=y
92CONFIG_FLATMEM_MANUAL=y
93# CONFIG_DISCONTIGMEM_MANUAL is not set
94# CONFIG_SPARSEMEM_MANUAL is not set
95CONFIG_FLATMEM=y
96CONFIG_FLAT_NODE_MEM_MAP=y
86 97
87# 98#
88# I/O subsystem configuration 99# I/O subsystem configuration
@@ -95,7 +106,7 @@ CONFIG_QDIO=y
95# 106#
96# Misc 107# Misc
97# 108#
98# CONFIG_PREEMPT is not set 109CONFIG_PREEMPT=y
99CONFIG_IPL=y 110CONFIG_IPL=y
100# CONFIG_IPL_TAPE is not set 111# CONFIG_IPL_TAPE is not set
101CONFIG_IPL_VM=y 112CONFIG_IPL_VM=y
@@ -105,9 +116,110 @@ CONFIG_BINFMT_MISC=m
105CONFIG_PFAULT=y 116CONFIG_PFAULT=y
106# CONFIG_SHARED_KERNEL is not set 117# CONFIG_SHARED_KERNEL is not set
107# CONFIG_CMM is not set 118# CONFIG_CMM is not set
108# CONFIG_VIRT_TIMER is not set 119CONFIG_VIRT_TIMER=y
120CONFIG_VIRT_CPU_ACCOUNTING=y
121# CONFIG_APPLDATA_BASE is not set
109CONFIG_NO_IDLE_HZ=y 122CONFIG_NO_IDLE_HZ=y
110CONFIG_NO_IDLE_HZ_INIT=y 123CONFIG_NO_IDLE_HZ_INIT=y
124# CONFIG_KEXEC is not set
125
126#
127# Networking
128#
129CONFIG_NET=y
130
131#
132# Networking options
133#
134CONFIG_PACKET=y
135# CONFIG_PACKET_MMAP is not set
136CONFIG_UNIX=y
137CONFIG_XFRM=y
138# CONFIG_XFRM_USER is not set
139CONFIG_NET_KEY=y
140CONFIG_INET=y
141CONFIG_IP_MULTICAST=y
142# CONFIG_IP_ADVANCED_ROUTER is not set
143CONFIG_IP_FIB_HASH=y
144# CONFIG_IP_PNP is not set
145# CONFIG_NET_IPIP is not set
146# CONFIG_NET_IPGRE is not set
147# CONFIG_IP_MROUTE is not set
148# CONFIG_ARPD is not set
149# CONFIG_SYN_COOKIES is not set
150# CONFIG_INET_AH is not set
151# CONFIG_INET_ESP is not set
152# CONFIG_INET_IPCOMP is not set
153# CONFIG_INET_TUNNEL is not set
154CONFIG_IP_TCPDIAG=y
155CONFIG_IP_TCPDIAG_IPV6=y
156# CONFIG_TCP_CONG_ADVANCED is not set
157CONFIG_TCP_CONG_BIC=y
158CONFIG_IPV6=y
159# CONFIG_IPV6_PRIVACY is not set
160# CONFIG_INET6_AH is not set
161# CONFIG_INET6_ESP is not set
162# CONFIG_INET6_IPCOMP is not set
163# CONFIG_INET6_TUNNEL is not set
164# CONFIG_IPV6_TUNNEL is not set
165# CONFIG_NETFILTER is not set
166
167#
168# SCTP Configuration (EXPERIMENTAL)
169#
170# CONFIG_IP_SCTP is not set
171# CONFIG_ATM is not set
172# CONFIG_BRIDGE is not set
173# CONFIG_VLAN_8021Q is not set
174# CONFIG_DECNET is not set
175# CONFIG_LLC2 is not set
176# CONFIG_IPX is not set
177# CONFIG_ATALK is not set
178# CONFIG_X25 is not set
179# CONFIG_LAPB is not set
180# CONFIG_NET_DIVERT is not set
181# CONFIG_ECONET is not set
182# CONFIG_WAN_ROUTER is not set
183CONFIG_NET_SCHED=y
184CONFIG_NET_SCH_CLK_JIFFIES=y
185# CONFIG_NET_SCH_CLK_GETTIMEOFDAY is not set
186# CONFIG_NET_SCH_CLK_CPU is not set
187CONFIG_NET_SCH_CBQ=m
188# CONFIG_NET_SCH_HTB is not set
189# CONFIG_NET_SCH_HFSC is not set
190CONFIG_NET_SCH_PRIO=m
191CONFIG_NET_SCH_RED=m
192CONFIG_NET_SCH_SFQ=m
193CONFIG_NET_SCH_TEQL=m
194CONFIG_NET_SCH_TBF=m
195CONFIG_NET_SCH_GRED=m
196CONFIG_NET_SCH_DSMARK=m
197# CONFIG_NET_SCH_NETEM is not set
198# CONFIG_NET_SCH_INGRESS is not set
199CONFIG_NET_QOS=y
200CONFIG_NET_ESTIMATOR=y
201CONFIG_NET_CLS=y
202# CONFIG_NET_CLS_BASIC is not set
203CONFIG_NET_CLS_TCINDEX=m
204CONFIG_NET_CLS_ROUTE4=m
205CONFIG_NET_CLS_ROUTE=y
206CONFIG_NET_CLS_FW=m
207CONFIG_NET_CLS_U32=m
208# CONFIG_CLS_U32_PERF is not set
209# CONFIG_NET_CLS_IND is not set
210CONFIG_NET_CLS_RSVP=m
211CONFIG_NET_CLS_RSVP6=m
212# CONFIG_NET_EMATCH is not set
213# CONFIG_NET_CLS_ACT is not set
214CONFIG_NET_CLS_POLICE=y
215
216#
217# Network testing
218#
219# CONFIG_NET_PKTGEN is not set
220# CONFIG_HAMRADIO is not set
221# CONFIG_IRDA is not set
222# CONFIG_BT is not set
111# CONFIG_PCMCIA is not set 223# CONFIG_PCMCIA is not set
112 224
113# 225#
@@ -133,6 +245,7 @@ CONFIG_CHR_DEV_ST=y
133CONFIG_BLK_DEV_SR=y 245CONFIG_BLK_DEV_SR=y
134CONFIG_BLK_DEV_SR_VENDOR=y 246CONFIG_BLK_DEV_SR_VENDOR=y
135CONFIG_CHR_DEV_SG=y 247CONFIG_CHR_DEV_SG=y
248# CONFIG_CHR_DEV_SCH is not set
136 249
137# 250#
138# Some SCSI devices (e.g. CD jukebox) support multiple LUNs 251# Some SCSI devices (e.g. CD jukebox) support multiple LUNs
@@ -205,7 +318,13 @@ CONFIG_MD_RAID5=m
205# CONFIG_MD_RAID6 is not set 318# CONFIG_MD_RAID6 is not set
206CONFIG_MD_MULTIPATH=m 319CONFIG_MD_MULTIPATH=m
207# CONFIG_MD_FAULTY is not set 320# CONFIG_MD_FAULTY is not set
208# CONFIG_BLK_DEV_DM is not set 321CONFIG_BLK_DEV_DM=y
322CONFIG_DM_CRYPT=y
323CONFIG_DM_SNAPSHOT=y
324CONFIG_DM_MIRROR=y
325CONFIG_DM_ZERO=y
326CONFIG_DM_MULTIPATH=y
327# CONFIG_DM_MULTIPATH_EMC is not set
209 328
210# 329#
211# Character device drivers 330# Character device drivers
@@ -231,7 +350,8 @@ CONFIG_CCW_CONSOLE=y
231CONFIG_SCLP=y 350CONFIG_SCLP=y
232CONFIG_SCLP_TTY=y 351CONFIG_SCLP_TTY=y
233CONFIG_SCLP_CONSOLE=y 352CONFIG_SCLP_CONSOLE=y
234# CONFIG_SCLP_VT220_TTY is not set 353CONFIG_SCLP_VT220_TTY=y
354CONFIG_SCLP_VT220_CONSOLE=y
235CONFIG_SCLP_CPI=m 355CONFIG_SCLP_CPI=m
236CONFIG_S390_TAPE=m 356CONFIG_S390_TAPE=m
237 357
@@ -255,105 +375,8 @@ CONFIG_S390_TAPE_34XX=m
255CONFIG_Z90CRYPT=m 375CONFIG_Z90CRYPT=m
256 376
257# 377#
258# Networking support 378# Network device support
259#
260CONFIG_NET=y
261
262#
263# Networking options
264#
265CONFIG_PACKET=y
266# CONFIG_PACKET_MMAP is not set
267CONFIG_UNIX=y
268CONFIG_NET_KEY=y
269CONFIG_INET=y
270CONFIG_IP_MULTICAST=y
271# CONFIG_IP_ADVANCED_ROUTER is not set
272# CONFIG_IP_PNP is not set
273# CONFIG_NET_IPIP is not set
274# CONFIG_NET_IPGRE is not set
275# CONFIG_IP_MROUTE is not set
276# CONFIG_ARPD is not set
277# CONFIG_SYN_COOKIES is not set
278# CONFIG_INET_AH is not set
279# CONFIG_INET_ESP is not set
280# CONFIG_INET_IPCOMP is not set
281# CONFIG_INET_TUNNEL is not set
282CONFIG_IP_TCPDIAG=y
283CONFIG_IP_TCPDIAG_IPV6=y
284CONFIG_IPV6=y
285# CONFIG_IPV6_PRIVACY is not set
286# CONFIG_INET6_AH is not set
287# CONFIG_INET6_ESP is not set
288# CONFIG_INET6_IPCOMP is not set
289# CONFIG_INET6_TUNNEL is not set
290# CONFIG_IPV6_TUNNEL is not set
291# CONFIG_NETFILTER is not set
292CONFIG_XFRM=y
293# CONFIG_XFRM_USER is not set
294
295#
296# SCTP Configuration (EXPERIMENTAL)
297#
298# CONFIG_IP_SCTP is not set
299# CONFIG_ATM is not set
300# CONFIG_BRIDGE is not set
301# CONFIG_VLAN_8021Q is not set
302# CONFIG_DECNET is not set
303# CONFIG_LLC2 is not set
304# CONFIG_IPX is not set
305# CONFIG_ATALK is not set
306# CONFIG_X25 is not set
307# CONFIG_LAPB is not set
308# CONFIG_NET_DIVERT is not set
309# CONFIG_ECONET is not set
310# CONFIG_WAN_ROUTER is not set
311
312#
313# QoS and/or fair queueing
314#
315CONFIG_NET_SCHED=y
316CONFIG_NET_SCH_CLK_JIFFIES=y
317# CONFIG_NET_SCH_CLK_GETTIMEOFDAY is not set
318# CONFIG_NET_SCH_CLK_CPU is not set
319CONFIG_NET_SCH_CBQ=m
320# CONFIG_NET_SCH_HTB is not set
321# CONFIG_NET_SCH_HFSC is not set
322CONFIG_NET_SCH_PRIO=m
323CONFIG_NET_SCH_RED=m
324CONFIG_NET_SCH_SFQ=m
325CONFIG_NET_SCH_TEQL=m
326CONFIG_NET_SCH_TBF=m
327CONFIG_NET_SCH_GRED=m
328CONFIG_NET_SCH_DSMARK=m
329# CONFIG_NET_SCH_NETEM is not set
330# CONFIG_NET_SCH_INGRESS is not set
331CONFIG_NET_QOS=y
332CONFIG_NET_ESTIMATOR=y
333CONFIG_NET_CLS=y
334# CONFIG_NET_CLS_BASIC is not set
335CONFIG_NET_CLS_TCINDEX=m
336CONFIG_NET_CLS_ROUTE4=m
337CONFIG_NET_CLS_ROUTE=y
338CONFIG_NET_CLS_FW=m
339CONFIG_NET_CLS_U32=m
340# CONFIG_CLS_U32_PERF is not set
341# CONFIG_NET_CLS_IND is not set
342CONFIG_NET_CLS_RSVP=m
343CONFIG_NET_CLS_RSVP6=m
344# CONFIG_NET_EMATCH is not set
345# CONFIG_NET_CLS_ACT is not set
346CONFIG_NET_CLS_POLICE=y
347
348#
349# Network testing
350# 379#
351# CONFIG_NET_PKTGEN is not set
352# CONFIG_NETPOLL is not set
353# CONFIG_NET_POLL_CONTROLLER is not set
354# CONFIG_HAMRADIO is not set
355# CONFIG_IRDA is not set
356# CONFIG_BT is not set
357CONFIG_NETDEVICES=y 380CONFIG_NETDEVICES=y
358CONFIG_DUMMY=m 381CONFIG_DUMMY=m
359CONFIG_BONDING=m 382CONFIG_BONDING=m
@@ -411,12 +434,15 @@ CONFIG_CCWGROUP=y
411# CONFIG_SLIP is not set 434# CONFIG_SLIP is not set
412# CONFIG_SHAPER is not set 435# CONFIG_SHAPER is not set
413# CONFIG_NETCONSOLE is not set 436# CONFIG_NETCONSOLE is not set
437# CONFIG_NETPOLL is not set
438# CONFIG_NET_POLL_CONTROLLER is not set
414 439
415# 440#
416# File systems 441# File systems
417# 442#
418CONFIG_EXT2_FS=y 443CONFIG_EXT2_FS=y
419# CONFIG_EXT2_FS_XATTR is not set 444# CONFIG_EXT2_FS_XATTR is not set
445# CONFIG_EXT2_FS_XIP is not set
420CONFIG_EXT3_FS=y 446CONFIG_EXT3_FS=y
421CONFIG_EXT3_FS_XATTR=y 447CONFIG_EXT3_FS_XATTR=y
422# CONFIG_EXT3_FS_POSIX_ACL is not set 448# CONFIG_EXT3_FS_POSIX_ACL is not set
@@ -426,6 +452,7 @@ CONFIG_JBD=y
426CONFIG_FS_MBCACHE=y 452CONFIG_FS_MBCACHE=y
427# CONFIG_REISERFS_FS is not set 453# CONFIG_REISERFS_FS is not set
428# CONFIG_JFS_FS is not set 454# CONFIG_JFS_FS is not set
455# CONFIG_FS_POSIX_ACL is not set
429 456
430# 457#
431# XFS support 458# XFS support
@@ -433,6 +460,7 @@ CONFIG_FS_MBCACHE=y
433# CONFIG_XFS_FS is not set 460# CONFIG_XFS_FS is not set
434# CONFIG_MINIX_FS is not set 461# CONFIG_MINIX_FS is not set
435# CONFIG_ROMFS_FS is not set 462# CONFIG_ROMFS_FS is not set
463CONFIG_INOTIFY=y
436# CONFIG_QUOTA is not set 464# CONFIG_QUOTA is not set
437CONFIG_DNOTIFY=y 465CONFIG_DNOTIFY=y
438# CONFIG_AUTOFS_FS is not set 466# CONFIG_AUTOFS_FS is not set
@@ -457,7 +485,6 @@ CONFIG_DNOTIFY=y
457CONFIG_PROC_FS=y 485CONFIG_PROC_FS=y
458CONFIG_PROC_KCORE=y 486CONFIG_PROC_KCORE=y
459CONFIG_SYSFS=y 487CONFIG_SYSFS=y
460# CONFIG_DEVFS_FS is not set
461# CONFIG_DEVPTS_FS_XATTR is not set 488# CONFIG_DEVPTS_FS_XATTR is not set
462CONFIG_TMPFS=y 489CONFIG_TMPFS=y
463# CONFIG_TMPFS_XATTR is not set 490# CONFIG_TMPFS_XATTR is not set
@@ -486,15 +513,18 @@ CONFIG_RAMFS=y
486# 513#
487CONFIG_NFS_FS=y 514CONFIG_NFS_FS=y
488CONFIG_NFS_V3=y 515CONFIG_NFS_V3=y
516# CONFIG_NFS_V3_ACL is not set
489# CONFIG_NFS_V4 is not set 517# CONFIG_NFS_V4 is not set
490# CONFIG_NFS_DIRECTIO is not set 518# CONFIG_NFS_DIRECTIO is not set
491CONFIG_NFSD=y 519CONFIG_NFSD=y
492CONFIG_NFSD_V3=y 520CONFIG_NFSD_V3=y
521# CONFIG_NFSD_V3_ACL is not set
493# CONFIG_NFSD_V4 is not set 522# CONFIG_NFSD_V4 is not set
494CONFIG_NFSD_TCP=y 523CONFIG_NFSD_TCP=y
495CONFIG_LOCKD=y 524CONFIG_LOCKD=y
496CONFIG_LOCKD_V4=y 525CONFIG_LOCKD_V4=y
497CONFIG_EXPORTFS=y 526CONFIG_EXPORTFS=y
527CONFIG_NFS_COMMON=y
498CONFIG_SUNRPC=y 528CONFIG_SUNRPC=y
499# CONFIG_RPCSEC_GSS_KRB5 is not set 529# CONFIG_RPCSEC_GSS_KRB5 is not set
500# CONFIG_RPCSEC_GSS_SPKM3 is not set 530# CONFIG_RPCSEC_GSS_SPKM3 is not set
@@ -544,11 +574,12 @@ CONFIG_MAGIC_SYSRQ=y
544CONFIG_LOG_BUF_SHIFT=17 574CONFIG_LOG_BUF_SHIFT=17
545# CONFIG_SCHEDSTATS is not set 575# CONFIG_SCHEDSTATS is not set
546# CONFIG_DEBUG_SLAB is not set 576# CONFIG_DEBUG_SLAB is not set
577CONFIG_DEBUG_PREEMPT=y
547# CONFIG_DEBUG_SPINLOCK is not set 578# CONFIG_DEBUG_SPINLOCK is not set
548# CONFIG_DEBUG_SPINLOCK_SLEEP is not set 579# CONFIG_DEBUG_SPINLOCK_SLEEP is not set
549# CONFIG_DEBUG_KOBJECT is not set 580# CONFIG_DEBUG_KOBJECT is not set
550# CONFIG_DEBUG_INFO is not set 581# CONFIG_DEBUG_INFO is not set
551# CONFIG_DEBUG_FS is not set 582CONFIG_DEBUG_FS=y
552 583
553# 584#
554# Security options 585# Security options
diff --git a/arch/s390/kernel/compat_linux.c b/arch/s390/kernel/compat_linux.c
index 614056222875..18610cea03a2 100644
--- a/arch/s390/kernel/compat_linux.c
+++ b/arch/s390/kernel/compat_linux.c
@@ -58,6 +58,7 @@
58#include <linux/compat.h> 58#include <linux/compat.h>
59#include <linux/vfs.h> 59#include <linux/vfs.h>
60#include <linux/ptrace.h> 60#include <linux/ptrace.h>
61#include <linux/fadvise.h>
61 62
62#include <asm/types.h> 63#include <asm/types.h>
63#include <asm/ipc.h> 64#include <asm/ipc.h>
@@ -1043,3 +1044,40 @@ sys32_timer_create(clockid_t which_clock, struct compat_sigevent *se32,
1043 1044
1044 return ret; 1045 return ret;
1045} 1046}
1047
1048/*
1049 * 31 bit emulation wrapper functions for sys_fadvise64/fadvise64_64.
1050 * These need to rewrite the advise values for POSIX_FADV_{DONTNEED,NOREUSE}
1051 * because the 31 bit values differ from the 64 bit values.
1052 */
1053
1054asmlinkage long
1055sys32_fadvise64(int fd, loff_t offset, size_t len, int advise)
1056{
1057 if (advise == 4)
1058 advise = POSIX_FADV_DONTNEED;
1059 else if (advise == 5)
1060 advise = POSIX_FADV_NOREUSE;
1061 return sys_fadvise64(fd, offset, len, advise);
1062}
1063
1064struct fadvise64_64_args {
1065 int fd;
1066 long long offset;
1067 long long len;
1068 int advice;
1069};
1070
1071asmlinkage long
1072sys32_fadvise64_64(struct fadvise64_64_args __user *args)
1073{
1074 struct fadvise64_64_args a;
1075
1076 if ( copy_from_user(&a, args, sizeof(a)) )
1077 return -EFAULT;
1078 if (a.advice == 4)
1079 a.advice = POSIX_FADV_DONTNEED;
1080 else if (a.advice == 5)
1081 a.advice = POSIX_FADV_NOREUSE;
1082 return sys_fadvise64_64(a.fd, a.offset, a.len, a.advice);
1083}
diff --git a/arch/s390/kernel/compat_signal.c b/arch/s390/kernel/compat_signal.c
index d05d65ac9694..7358cdb8441f 100644
--- a/arch/s390/kernel/compat_signal.c
+++ b/arch/s390/kernel/compat_signal.c
@@ -637,12 +637,11 @@ handle_signal32(unsigned long sig, struct k_sigaction *ka,
637 else 637 else
638 setup_frame32(sig, ka, oldset, regs); 638 setup_frame32(sig, ka, oldset, regs);
639 639
640 if (!(ka->sa.sa_flags & SA_NODEFER)) { 640 spin_lock_irq(&current->sighand->siglock);
641 spin_lock_irq(&current->sighand->siglock); 641 sigorsets(&current->blocked,&current->blocked,&ka->sa.sa_mask);
642 sigorsets(&current->blocked,&current->blocked,&ka->sa.sa_mask); 642 if (!(ka->sa.sa_flags & SA_NODEFER))
643 sigaddset(&current->blocked,sig); 643 sigaddset(&current->blocked,sig);
644 recalc_sigpending(); 644 recalc_sigpending();
645 spin_unlock_irq(&current->sighand->siglock); 645 spin_unlock_irq(&current->sighand->siglock);
646 }
647} 646}
648 647
diff --git a/arch/s390/kernel/compat_wrapper.S b/arch/s390/kernel/compat_wrapper.S
index bf529739c8ab..23fe94e58688 100644
--- a/arch/s390/kernel/compat_wrapper.S
+++ b/arch/s390/kernel/compat_wrapper.S
@@ -1251,12 +1251,12 @@ sys32_fadvise64_wrapper:
1251 or %r3,%r4 # get low word of 64bit loff_t 1251 or %r3,%r4 # get low word of 64bit loff_t
1252 llgfr %r4,%r5 # size_t (unsigned long) 1252 llgfr %r4,%r5 # size_t (unsigned long)
1253 lgfr %r5,%r6 # int 1253 lgfr %r5,%r6 # int
1254 jg sys_fadvise64 1254 jg sys32_fadvise64
1255 1255
1256 .globl sys32_fadvise64_64_wrapper 1256 .globl sys32_fadvise64_64_wrapper
1257sys32_fadvise64_64_wrapper: 1257sys32_fadvise64_64_wrapper:
1258 llgtr %r2,%r2 # struct fadvise64_64_args * 1258 llgtr %r2,%r2 # struct fadvise64_64_args *
1259 jg s390_fadvise64_64 1259 jg sys32_fadvise64_64
1260 1260
1261 .globl sys32_clock_settime_wrapper 1261 .globl sys32_clock_settime_wrapper
1262sys32_clock_settime_wrapper: 1262sys32_clock_settime_wrapper:
@@ -1449,3 +1449,29 @@ compat_sys_kexec_load_wrapper:
1449 llgtr %r4,%r4 # struct kexec_segment * 1449 llgtr %r4,%r4 # struct kexec_segment *
1450 llgfr %r5,%r5 # unsigned long 1450 llgfr %r5,%r5 # unsigned long
1451 jg compat_sys_kexec_load 1451 jg compat_sys_kexec_load
1452
1453 .globl sys_ioprio_set_wrapper
1454sys_ioprio_set_wrapper:
1455 lgfr %r2,%r2 # int
1456 lgfr %r3,%r3 # int
1457 lgfr %r4,%r4 # int
1458 jg sys_ioprio_set
1459
1460 .globl sys_ioprio_get_wrapper
1461sys_ioprio_get_wrapper:
1462 lgfr %r2,%r2 # int
1463 lgfr %r3,%r3 # int
1464 jg sys_ioprio_get
1465
1466 .globl sys_inotify_add_watch_wrapper
1467sys_inotify_add_watch_wrapper:
1468 lgfr %r2,%r2 # int
1469 llgtr %r3,%r3 # const char *
1470 llgfr %r4,%r4 # u32
1471 jg sys_inotify_add_watch
1472
1473 .globl sys_inotify_rm_watch_wrapper
1474sys_inotify_rm_watch_wrapper:
1475 lgfr %r2,%r2 # int
1476 llgfr %r3,%r3 # u32
1477 jg sys_inotify_rm_watch
diff --git a/arch/s390/kernel/cpcmd.c b/arch/s390/kernel/cpcmd.c
index 20062145e84e..d47fecb42cc5 100644
--- a/arch/s390/kernel/cpcmd.c
+++ b/arch/s390/kernel/cpcmd.c
@@ -46,9 +46,9 @@ int __cpcmd(const char *cmd, char *response, int rlen, int *response_code)
46 "lra 3,0(%4)\n" 46 "lra 3,0(%4)\n"
47 "lr 5,%5\n" 47 "lr 5,%5\n"
48 "diag 2,4,0x8\n" 48 "diag 2,4,0x8\n"
49 "brc 8, .Litfits\n" 49 "brc 8, 1f\n"
50 "ar 5, %5\n" 50 "ar 5, %5\n"
51 ".Litfits: \n" 51 "1: \n"
52 "lr %0,4\n" 52 "lr %0,4\n"
53 "lr %1,5\n" 53 "lr %1,5\n"
54 : "=d" (return_code), "=d" (return_len) 54 : "=d" (return_code), "=d" (return_len)
@@ -64,9 +64,9 @@ int __cpcmd(const char *cmd, char *response, int rlen, int *response_code)
64 "sam31\n" 64 "sam31\n"
65 "diag 2,4,0x8\n" 65 "diag 2,4,0x8\n"
66 "sam64\n" 66 "sam64\n"
67 "brc 8, .Litfits\n" 67 "brc 8, 1f\n"
68 "agr 5, %5\n" 68 "agr 5, %5\n"
69 ".Litfits: \n" 69 "1: \n"
70 "lgr %0,4\n" 70 "lgr %0,4\n"
71 "lgr %1,5\n" 71 "lgr %1,5\n"
72 : "=d" (return_code), "=d" (return_len) 72 : "=d" (return_code), "=d" (return_len)
diff --git a/arch/s390/kernel/debug.c b/arch/s390/kernel/debug.c
index 960ba6029c3a..bc59282da762 100644
--- a/arch/s390/kernel/debug.c
+++ b/arch/s390/kernel/debug.c
@@ -62,7 +62,7 @@ typedef struct
62} debug_sprintf_entry_t; 62} debug_sprintf_entry_t;
63 63
64 64
65extern void tod_to_timeval(uint64_t todval, struct timeval *xtime); 65extern void tod_to_timeval(uint64_t todval, struct timespec *xtime);
66 66
67/* internal function prototyes */ 67/* internal function prototyes */
68 68
@@ -374,9 +374,24 @@ debug_info_copy(debug_info_t* in, int mode)
374{ 374{
375 int i,j; 375 int i,j;
376 debug_info_t* rc; 376 debug_info_t* rc;
377 unsigned long flags;
378
379 /* get a consistent copy of the debug areas */
380 do {
381 rc = debug_info_alloc(in->name, in->pages_per_area,
382 in->nr_areas, in->buf_size, in->level, mode);
383 spin_lock_irqsave(&in->lock, flags);
384 if(!rc)
385 goto out;
386 /* has something changed in the meantime ? */
387 if((rc->pages_per_area == in->pages_per_area) &&
388 (rc->nr_areas == in->nr_areas)) {
389 break;
390 }
391 spin_unlock_irqrestore(&in->lock, flags);
392 debug_info_free(rc);
393 } while (1);
377 394
378 rc = debug_info_alloc(in->name, in->pages_per_area, in->nr_areas,
379 in->buf_size, in->level, mode);
380 if(!rc || (mode == NO_AREAS)) 395 if(!rc || (mode == NO_AREAS))
381 goto out; 396 goto out;
382 397
@@ -386,6 +401,7 @@ debug_info_copy(debug_info_t* in, int mode)
386 } 401 }
387 } 402 }
388out: 403out:
404 spin_unlock_irqrestore(&in->lock, flags);
389 return rc; 405 return rc;
390} 406}
391 407
@@ -593,19 +609,15 @@ debug_open(struct inode *inode, struct file *file)
593 debug_info_t *debug_info, *debug_info_snapshot; 609 debug_info_t *debug_info, *debug_info_snapshot;
594 610
595 down(&debug_lock); 611 down(&debug_lock);
596 612 debug_info = (struct debug_info*)file->f_dentry->d_inode->u.generic_ip;
597 /* find debug log and view */ 613 /* find debug view */
598 debug_info = debug_area_first; 614 for (i = 0; i < DEBUG_MAX_VIEWS; i++) {
599 while(debug_info != NULL){ 615 if (!debug_info->views[i])
600 for (i = 0; i < DEBUG_MAX_VIEWS; i++) { 616 continue;
601 if (!debug_info->views[i]) 617 else if (debug_info->debugfs_entries[i] ==
602 continue; 618 file->f_dentry) {
603 else if (debug_info->debugfs_entries[i] == 619 goto found; /* found view ! */
604 file->f_dentry) {
605 goto found; /* found view ! */
606 }
607 } 620 }
608 debug_info = debug_info->next;
609 } 621 }
610 /* no entry found */ 622 /* no entry found */
611 rc = -EINVAL; 623 rc = -EINVAL;
@@ -833,7 +845,7 @@ extern inline void
833debug_finish_entry(debug_info_t * id, debug_entry_t* active, int level, 845debug_finish_entry(debug_info_t * id, debug_entry_t* active, int level,
834 int exception) 846 int exception)
835{ 847{
836 STCK(active->id.stck); 848 active->id.stck = get_clock();
837 active->id.fields.cpuid = smp_processor_id(); 849 active->id.fields.cpuid = smp_processor_id();
838 active->caller = __builtin_return_address(0); 850 active->caller = __builtin_return_address(0);
839 active->id.fields.exception = exception; 851 active->id.fields.exception = exception;
@@ -1078,7 +1090,7 @@ debug_register_view(debug_info_t * id, struct debug_view *view)
1078 if (view->input_proc) 1090 if (view->input_proc)
1079 mode |= S_IWUSR; 1091 mode |= S_IWUSR;
1080 pde = debugfs_create_file(view->name, mode, id->debugfs_root_entry, 1092 pde = debugfs_create_file(view->name, mode, id->debugfs_root_entry,
1081 NULL, &debug_file_ops); 1093 id , &debug_file_ops);
1082 if (!pde){ 1094 if (!pde){
1083 printk(KERN_WARNING "debug: debugfs_create_file() failed!"\ 1095 printk(KERN_WARNING "debug: debugfs_create_file() failed!"\
1084 " Cannot register view %s/%s\n", id->name,view->name); 1096 " Cannot register view %s/%s\n", id->name,view->name);
@@ -1432,7 +1444,7 @@ int
1432debug_dflt_header_fn(debug_info_t * id, struct debug_view *view, 1444debug_dflt_header_fn(debug_info_t * id, struct debug_view *view,
1433 int area, debug_entry_t * entry, char *out_buf) 1445 int area, debug_entry_t * entry, char *out_buf)
1434{ 1446{
1435 struct timeval time_val; 1447 struct timespec time_spec;
1436 unsigned long long time; 1448 unsigned long long time;
1437 char *except_str; 1449 char *except_str;
1438 unsigned long caller; 1450 unsigned long caller;
@@ -1443,7 +1455,7 @@ debug_dflt_header_fn(debug_info_t * id, struct debug_view *view,
1443 time = entry->id.stck; 1455 time = entry->id.stck;
1444 /* adjust todclock to 1970 */ 1456 /* adjust todclock to 1970 */
1445 time -= 0x8126d60e46000000LL - (0x3c26700LL * 1000000 * 4096); 1457 time -= 0x8126d60e46000000LL - (0x3c26700LL * 1000000 * 4096);
1446 tod_to_timeval(time, &time_val); 1458 tod_to_timeval(time, &time_spec);
1447 1459
1448 if (entry->id.fields.exception) 1460 if (entry->id.fields.exception)
1449 except_str = "*"; 1461 except_str = "*";
@@ -1451,7 +1463,7 @@ debug_dflt_header_fn(debug_info_t * id, struct debug_view *view,
1451 except_str = "-"; 1463 except_str = "-";
1452 caller = ((unsigned long) entry->caller) & PSW_ADDR_INSN; 1464 caller = ((unsigned long) entry->caller) & PSW_ADDR_INSN;
1453 rc += sprintf(out_buf, "%02i %011lu:%06lu %1u %1s %02i %p ", 1465 rc += sprintf(out_buf, "%02i %011lu:%06lu %1u %1s %02i %p ",
1454 area, time_val.tv_sec, time_val.tv_usec, level, 1466 area, time_spec.tv_sec, time_spec.tv_nsec / 1000, level,
1455 except_str, entry->id.fields.cpuid, (void *) caller); 1467 except_str, entry->id.fields.cpuid, (void *) caller);
1456 return rc; 1468 return rc;
1457} 1469}
diff --git a/arch/s390/kernel/entry.S b/arch/s390/kernel/entry.S
index 5b262b5d869f..cbe7d6a2d02c 100644
--- a/arch/s390/kernel/entry.S
+++ b/arch/s390/kernel/entry.S
@@ -138,14 +138,14 @@ STACK_SIZE = 1 << STACK_SHIFT
138 st %r12,__SF_BACKCHAIN(%r15) # clear back chain 138 st %r12,__SF_BACKCHAIN(%r15) # clear back chain
139 .endm 139 .endm
140 140
141 .macro RESTORE_ALL sync 141 .macro RESTORE_ALL psworg,sync
142 mvc __LC_RETURN_PSW(8),SP_PSW(%r15) # move user PSW to lowcore 142 mvc \psworg(8),SP_PSW(%r15) # move user PSW to lowcore
143 .if !\sync 143 .if !\sync
144 ni __LC_RETURN_PSW+1,0xfd # clear wait state bit 144 ni \psworg+1,0xfd # clear wait state bit
145 .endif 145 .endif
146 lm %r0,%r15,SP_R0(%r15) # load gprs 0-15 of user 146 lm %r0,%r15,SP_R0(%r15) # load gprs 0-15 of user
147 STORE_TIMER __LC_EXIT_TIMER 147 STORE_TIMER __LC_EXIT_TIMER
148 lpsw __LC_RETURN_PSW # back to caller 148 lpsw \psworg # back to caller
149 .endm 149 .endm
150 150
151/* 151/*
@@ -235,7 +235,7 @@ sysc_return:
235 tm __TI_flags+3(%r9),_TIF_WORK_SVC 235 tm __TI_flags+3(%r9),_TIF_WORK_SVC
236 bnz BASED(sysc_work) # there is work to do (signals etc.) 236 bnz BASED(sysc_work) # there is work to do (signals etc.)
237sysc_leave: 237sysc_leave:
238 RESTORE_ALL 1 238 RESTORE_ALL __LC_RETURN_PSW,1
239 239
240# 240#
241# recheck if there is more work to do 241# recheck if there is more work to do
@@ -312,8 +312,6 @@ sysc_singlestep:
312 la %r14,BASED(sysc_return) # load adr. of system return 312 la %r14,BASED(sysc_return) # load adr. of system return
313 br %r1 # branch to do_single_step 313 br %r1 # branch to do_single_step
314 314
315__critical_end:
316
317# 315#
318# call trace before and after sys_call 316# call trace before and after sys_call
319# 317#
@@ -571,7 +569,8 @@ io_return:
571 tm __TI_flags+3(%r9),_TIF_WORK_INT 569 tm __TI_flags+3(%r9),_TIF_WORK_INT
572 bnz BASED(io_work) # there is work to do (signals etc.) 570 bnz BASED(io_work) # there is work to do (signals etc.)
573io_leave: 571io_leave:
574 RESTORE_ALL 0 572 RESTORE_ALL __LC_RETURN_PSW,0
573io_done:
575 574
576#ifdef CONFIG_PREEMPT 575#ifdef CONFIG_PREEMPT
577io_preempt: 576io_preempt:
@@ -621,7 +620,7 @@ io_work_loop:
621# 620#
622io_mcck_pending: 621io_mcck_pending:
623 l %r1,BASED(.Ls390_handle_mcck) 622 l %r1,BASED(.Ls390_handle_mcck)
624 l %r14,BASED(io_work_loop) 623 la %r14,BASED(io_work_loop)
625 br %r1 # TIF bit will be cleared by handler 624 br %r1 # TIF bit will be cleared by handler
626 625
627# 626#
@@ -674,6 +673,8 @@ ext_no_vtime:
674 basr %r14,%r1 673 basr %r14,%r1
675 b BASED(io_return) 674 b BASED(io_return)
676 675
676__critical_end:
677
677/* 678/*
678 * Machine check handler routines 679 * Machine check handler routines
679 */ 680 */
@@ -681,6 +682,7 @@ ext_no_vtime:
681 .globl mcck_int_handler 682 .globl mcck_int_handler
682mcck_int_handler: 683mcck_int_handler:
683 spt __LC_CPU_TIMER_SAVE_AREA # revalidate cpu timer 684 spt __LC_CPU_TIMER_SAVE_AREA # revalidate cpu timer
685 mvc __LC_ASYNC_ENTER_TIMER(8),__LC_CPU_TIMER_SAVE_AREA
684 lm %r0,%r15,__LC_GPREGS_SAVE_AREA # revalidate gprs 686 lm %r0,%r15,__LC_GPREGS_SAVE_AREA # revalidate gprs
685 SAVE_ALL_BASE __LC_SAVE_AREA+32 687 SAVE_ALL_BASE __LC_SAVE_AREA+32
686 la %r12,__LC_MCK_OLD_PSW 688 la %r12,__LC_MCK_OLD_PSW
@@ -690,20 +692,11 @@ mcck_int_handler:
690 bo BASED(0f) 692 bo BASED(0f)
691 spt __LC_LAST_UPDATE_TIMER # revalidate cpu timer 693 spt __LC_LAST_UPDATE_TIMER # revalidate cpu timer
692#ifdef CONFIG_VIRT_CPU_ACCOUNTING 694#ifdef CONFIG_VIRT_CPU_ACCOUNTING
693 mvc __LC_LAST_UPDATE_TIMER(8),__LC_ASYNC_ENTER_TIMER 695 mvc __LC_ASYNC_ENTER_TIMER(8),__LC_LAST_UPDATE_TIMER
694 mvc __LC_LAST_UPDATE_TIMER(8),__LC_SYNC_ENTER_TIMER 696 mvc __LC_SYNC_ENTER_TIMER(8),__LC_LAST_UPDATE_TIMER
695 mvc __LC_LAST_UPDATE_TIMER(8),__LC_EXIT_TIMER 697 mvc __LC_EXIT_TIMER(8),__LC_LAST_UPDATE_TIMER
6960: tm __LC_MCCK_CODE+2,0x08 # mwp of old psw valid?
697 bno BASED(mcck_no_vtime) # no -> skip cleanup critical
698 tm __LC_MCK_OLD_PSW+1,0x01 # interrupting from user ?
699 bz BASED(mcck_no_vtime)
700 UPDATE_VTIME __LC_EXIT_TIMER,__LC_ASYNC_ENTER_TIMER,__LC_USER_TIMER
701 UPDATE_VTIME __LC_LAST_UPDATE_TIMER,__LC_EXIT_TIMER,__LC_SYSTEM_TIMER
702 mvc __LC_LAST_UPDATE_TIMER(8),__LC_ASYNC_ENTER_TIMER
703mcck_no_vtime:
704#endif 698#endif
7050: 6990: tm __LC_MCCK_CODE+2,0x09 # mwp + ia of old psw valid?
706 tm __LC_MCCK_CODE+2,0x09 # mwp + ia of old psw valid?
707 bno BASED(mcck_int_main) # no -> skip cleanup critical 700 bno BASED(mcck_int_main) # no -> skip cleanup critical
708 tm __LC_MCK_OLD_PSW+1,0x01 # test problem state bit 701 tm __LC_MCK_OLD_PSW+1,0x01 # test problem state bit
709 bnz BASED(mcck_int_main) # from user -> load async stack 702 bnz BASED(mcck_int_main) # from user -> load async stack
@@ -720,6 +713,16 @@ mcck_int_main:
720 be BASED(0f) 713 be BASED(0f)
721 l %r15,__LC_PANIC_STACK # load panic stack 714 l %r15,__LC_PANIC_STACK # load panic stack
7220: CREATE_STACK_FRAME __LC_MCK_OLD_PSW,__LC_SAVE_AREA+32 7150: CREATE_STACK_FRAME __LC_MCK_OLD_PSW,__LC_SAVE_AREA+32
716#ifdef CONFIG_VIRT_CPU_ACCOUNTING
717 tm __LC_MCCK_CODE+2,0x08 # mwp of old psw valid?
718 bno BASED(mcck_no_vtime) # no -> skip cleanup critical
719 tm __LC_MCK_OLD_PSW+1,0x01 # interrupting from user ?
720 bz BASED(mcck_no_vtime)
721 UPDATE_VTIME __LC_EXIT_TIMER,__LC_ASYNC_ENTER_TIMER,__LC_USER_TIMER
722 UPDATE_VTIME __LC_LAST_UPDATE_TIMER,__LC_EXIT_TIMER,__LC_SYSTEM_TIMER
723 mvc __LC_LAST_UPDATE_TIMER(8),__LC_ASYNC_ENTER_TIMER
724mcck_no_vtime:
725#endif
723 l %r9,__LC_THREAD_INFO # load pointer to thread_info struct 726 l %r9,__LC_THREAD_INFO # load pointer to thread_info struct
724 la %r2,SP_PTREGS(%r15) # load pt_regs 727 la %r2,SP_PTREGS(%r15) # load pt_regs
725 l %r1,BASED(.Ls390_mcck) 728 l %r1,BASED(.Ls390_mcck)
@@ -737,7 +740,7 @@ mcck_int_main:
737 l %r1,BASED(.Ls390_handle_mcck) 740 l %r1,BASED(.Ls390_handle_mcck)
738 basr %r14,%r1 # call machine check handler 741 basr %r14,%r1 # call machine check handler
739mcck_return: 742mcck_return:
740 RESTORE_ALL 0 743 RESTORE_ALL __LC_RETURN_MCCK_PSW,0
741 744
742#ifdef CONFIG_SMP 745#ifdef CONFIG_SMP
743/* 746/*
@@ -803,6 +806,10 @@ cleanup_table_sysc_leave:
803 .long sysc_leave + 0x80000000, sysc_work_loop + 0x80000000 806 .long sysc_leave + 0x80000000, sysc_work_loop + 0x80000000
804cleanup_table_sysc_work_loop: 807cleanup_table_sysc_work_loop:
805 .long sysc_work_loop + 0x80000000, sysc_reschedule + 0x80000000 808 .long sysc_work_loop + 0x80000000, sysc_reschedule + 0x80000000
809cleanup_table_io_leave:
810 .long io_leave + 0x80000000, io_done + 0x80000000
811cleanup_table_io_work_loop:
812 .long io_work_loop + 0x80000000, io_mcck_pending + 0x80000000
806 813
807cleanup_critical: 814cleanup_critical:
808 clc 4(4,%r12),BASED(cleanup_table_system_call) 815 clc 4(4,%r12),BASED(cleanup_table_system_call)
@@ -825,10 +832,26 @@ cleanup_critical:
825 clc 4(4,%r12),BASED(cleanup_table_sysc_work_loop+4) 832 clc 4(4,%r12),BASED(cleanup_table_sysc_work_loop+4)
826 bl BASED(cleanup_sysc_return) 833 bl BASED(cleanup_sysc_return)
8270: 8340:
835 clc 4(4,%r12),BASED(cleanup_table_io_leave)
836 bl BASED(0f)
837 clc 4(4,%r12),BASED(cleanup_table_io_leave+4)
838 bl BASED(cleanup_io_leave)
8390:
840 clc 4(4,%r12),BASED(cleanup_table_io_work_loop)
841 bl BASED(0f)
842 clc 4(4,%r12),BASED(cleanup_table_io_work_loop+4)
843 bl BASED(cleanup_io_return)
8440:
828 br %r14 845 br %r14
829 846
830cleanup_system_call: 847cleanup_system_call:
831 mvc __LC_RETURN_PSW(8),0(%r12) 848 mvc __LC_RETURN_PSW(8),0(%r12)
849 c %r12,BASED(.Lmck_old_psw)
850 be BASED(0f)
851 la %r12,__LC_SAVE_AREA+16
852 b BASED(1f)
8530: la %r12,__LC_SAVE_AREA+32
8541:
832#ifdef CONFIG_VIRT_CPU_ACCOUNTING 855#ifdef CONFIG_VIRT_CPU_ACCOUNTING
833 clc __LC_RETURN_PSW+4(4),BASED(cleanup_system_call_insn+4) 856 clc __LC_RETURN_PSW+4(4),BASED(cleanup_system_call_insn+4)
834 bh BASED(0f) 857 bh BASED(0f)
@@ -838,11 +861,13 @@ cleanup_system_call:
838#endif 861#endif
839 clc __LC_RETURN_PSW+4(4),BASED(cleanup_system_call_insn) 862 clc __LC_RETURN_PSW+4(4),BASED(cleanup_system_call_insn)
840 bh BASED(0f) 863 bh BASED(0f)
841 mvc __LC_SAVE_AREA(16),__LC_SAVE_AREA+16 864 mvc __LC_SAVE_AREA(16),0(%r12)
8420: st %r13,__LC_SAVE_AREA+20 8650: st %r13,4(%r12)
866 st %r12,__LC_SAVE_AREA+48 # argh
843 SAVE_ALL __LC_SVC_OLD_PSW,__LC_SAVE_AREA,1 867 SAVE_ALL __LC_SVC_OLD_PSW,__LC_SAVE_AREA,1
844 CREATE_STACK_FRAME __LC_SVC_OLD_PSW,__LC_SAVE_AREA 868 CREATE_STACK_FRAME __LC_SVC_OLD_PSW,__LC_SAVE_AREA
845 st %r15,__LC_SAVE_AREA+28 869 l %r12,__LC_SAVE_AREA+48 # argh
870 st %r15,12(%r12)
846 lh %r7,0x8a 871 lh %r7,0x8a
847#ifdef CONFIG_VIRT_CPU_ACCOUNTING 872#ifdef CONFIG_VIRT_CPU_ACCOUNTING
848cleanup_vtime: 873cleanup_vtime:
@@ -879,17 +904,21 @@ cleanup_sysc_return:
879 904
880cleanup_sysc_leave: 905cleanup_sysc_leave:
881 clc 4(4,%r12),BASED(cleanup_sysc_leave_insn) 906 clc 4(4,%r12),BASED(cleanup_sysc_leave_insn)
882 be BASED(0f) 907 be BASED(2f)
883#ifdef CONFIG_VIRT_CPU_ACCOUNTING 908#ifdef CONFIG_VIRT_CPU_ACCOUNTING
884 mvc __LC_EXIT_TIMER(8),__LC_ASYNC_ENTER_TIMER 909 mvc __LC_EXIT_TIMER(8),__LC_ASYNC_ENTER_TIMER
885 clc 4(4,%r12),BASED(cleanup_sysc_leave_insn+4) 910 clc 4(4,%r12),BASED(cleanup_sysc_leave_insn+4)
886 be BASED(0f) 911 be BASED(2f)
887#endif 912#endif
888 mvc __LC_RETURN_PSW(8),SP_PSW(%r15) 913 mvc __LC_RETURN_PSW(8),SP_PSW(%r15)
889 mvc __LC_SAVE_AREA+16(16),SP_R12(%r15) 914 c %r12,BASED(.Lmck_old_psw)
890 lm %r0,%r11,SP_R0(%r15) 915 bne BASED(0f)
916 mvc __LC_SAVE_AREA+32(16),SP_R12(%r15)
917 b BASED(1f)
9180: mvc __LC_SAVE_AREA+16(16),SP_R12(%r15)
9191: lm %r0,%r11,SP_R0(%r15)
891 l %r15,SP_R15(%r15) 920 l %r15,SP_R15(%r15)
8920: la %r12,__LC_RETURN_PSW 9212: la %r12,__LC_RETURN_PSW
893 br %r14 922 br %r14
894cleanup_sysc_leave_insn: 923cleanup_sysc_leave_insn:
895#ifdef CONFIG_VIRT_CPU_ACCOUNTING 924#ifdef CONFIG_VIRT_CPU_ACCOUNTING
@@ -897,6 +926,36 @@ cleanup_sysc_leave_insn:
897#endif 926#endif
898 .long sysc_leave + 10 + 0x80000000 927 .long sysc_leave + 10 + 0x80000000
899 928
929cleanup_io_return:
930 mvc __LC_RETURN_PSW(4),0(%r12)
931 mvc __LC_RETURN_PSW+4(4),BASED(cleanup_table_io_work_loop)
932 la %r12,__LC_RETURN_PSW
933 br %r14
934
935cleanup_io_leave:
936 clc 4(4,%r12),BASED(cleanup_io_leave_insn)
937 be BASED(2f)
938#ifdef CONFIG_VIRT_CPU_ACCOUNTING
939 mvc __LC_EXIT_TIMER(8),__LC_ASYNC_ENTER_TIMER
940 clc 4(4,%r12),BASED(cleanup_io_leave_insn+4)
941 be BASED(2f)
942#endif
943 mvc __LC_RETURN_PSW(8),SP_PSW(%r15)
944 c %r12,BASED(.Lmck_old_psw)
945 bne BASED(0f)
946 mvc __LC_SAVE_AREA+32(16),SP_R12(%r15)
947 b BASED(1f)
9480: mvc __LC_SAVE_AREA+16(16),SP_R12(%r15)
9491: lm %r0,%r11,SP_R0(%r15)
950 l %r15,SP_R15(%r15)
9512: la %r12,__LC_RETURN_PSW
952 br %r14
953cleanup_io_leave_insn:
954#ifdef CONFIG_VIRT_CPU_ACCOUNTING
955 .long io_leave + 18 + 0x80000000
956#endif
957 .long io_leave + 14 + 0x80000000
958
900/* 959/*
901 * Integer constants 960 * Integer constants
902 */ 961 */
@@ -918,6 +977,7 @@ cleanup_sysc_leave_insn:
918.Ls390_mcck: .long s390_do_machine_check 977.Ls390_mcck: .long s390_do_machine_check
919.Ls390_handle_mcck: 978.Ls390_handle_mcck:
920 .long s390_handle_mcck 979 .long s390_handle_mcck
980.Lmck_old_psw: .long __LC_MCK_OLD_PSW
921.Ldo_IRQ: .long do_IRQ 981.Ldo_IRQ: .long do_IRQ
922.Ldo_extint: .long do_extint 982.Ldo_extint: .long do_extint
923.Ldo_signal: .long do_signal 983.Ldo_signal: .long do_signal
diff --git a/arch/s390/kernel/entry64.S b/arch/s390/kernel/entry64.S
index 57ca75d0ad7f..fb77b72ab262 100644
--- a/arch/s390/kernel/entry64.S
+++ b/arch/s390/kernel/entry64.S
@@ -131,14 +131,14 @@ _TIF_WORK_INT = (_TIF_SIGPENDING | _TIF_NEED_RESCHED | _TIF_MCCK_PENDING)
131 stg %r12,__SF_BACKCHAIN(%r15) 131 stg %r12,__SF_BACKCHAIN(%r15)
132 .endm 132 .endm
133 133
134 .macro RESTORE_ALL sync 134 .macro RESTORE_ALL psworg,sync
135 mvc __LC_RETURN_PSW(16),SP_PSW(%r15) # move user PSW to lowcore 135 mvc \psworg(16),SP_PSW(%r15) # move user PSW to lowcore
136 .if !\sync 136 .if !\sync
137 ni __LC_RETURN_PSW+1,0xfd # clear wait state bit 137 ni \psworg+1,0xfd # clear wait state bit
138 .endif 138 .endif
139 lmg %r0,%r15,SP_R0(%r15) # load gprs 0-15 of user 139 lmg %r0,%r15,SP_R0(%r15) # load gprs 0-15 of user
140 STORE_TIMER __LC_EXIT_TIMER 140 STORE_TIMER __LC_EXIT_TIMER
141 lpswe __LC_RETURN_PSW # back to caller 141 lpswe \psworg # back to caller
142 .endm 142 .endm
143 143
144/* 144/*
@@ -214,8 +214,8 @@ sysc_nr_ok:
214sysc_do_restart: 214sysc_do_restart:
215 larl %r10,sys_call_table 215 larl %r10,sys_call_table
216#ifdef CONFIG_S390_SUPPORT 216#ifdef CONFIG_S390_SUPPORT
217 tm SP_PSW+3(%r15),0x01 # are we running in 31 bit mode ? 217 tm __TI_flags+5(%r9),(_TIF_31BIT>>16) # running in 31 bit mode ?
218 jo sysc_noemu 218 jno sysc_noemu
219 larl %r10,sys_call_table_emu # use 31 bit emulation system calls 219 larl %r10,sys_call_table_emu # use 31 bit emulation system calls
220sysc_noemu: 220sysc_noemu:
221#endif 221#endif
@@ -233,7 +233,7 @@ sysc_return:
233 tm __TI_flags+7(%r9),_TIF_WORK_SVC 233 tm __TI_flags+7(%r9),_TIF_WORK_SVC
234 jnz sysc_work # there is work to do (signals etc.) 234 jnz sysc_work # there is work to do (signals etc.)
235sysc_leave: 235sysc_leave:
236 RESTORE_ALL 1 236 RESTORE_ALL __LC_RETURN_PSW,1
237 237
238# 238#
239# recheck if there is more work to do 239# recheck if there is more work to do
@@ -308,8 +308,6 @@ sysc_singlestep:
308 jg do_single_step # branch to do_sigtrap 308 jg do_single_step # branch to do_sigtrap
309 309
310 310
311__critical_end:
312
313# 311#
314# call syscall_trace before and after system call 312# call syscall_trace before and after system call
315# special linkage: %r12 contains the return address for trace_svc 313# special linkage: %r12 contains the return address for trace_svc
@@ -612,7 +610,8 @@ io_return:
612 tm __TI_flags+7(%r9),_TIF_WORK_INT 610 tm __TI_flags+7(%r9),_TIF_WORK_INT
613 jnz io_work # there is work to do (signals etc.) 611 jnz io_work # there is work to do (signals etc.)
614io_leave: 612io_leave:
615 RESTORE_ALL 0 613 RESTORE_ALL __LC_RETURN_PSW,0
614io_done:
616 615
617#ifdef CONFIG_PREEMPT 616#ifdef CONFIG_PREEMPT
618io_preempt: 617io_preempt:
@@ -711,6 +710,8 @@ ext_no_vtime:
711 brasl %r14,do_extint 710 brasl %r14,do_extint
712 j io_return 711 j io_return
713 712
713__critical_end:
714
714/* 715/*
715 * Machine check handler routines 716 * Machine check handler routines
716 */ 717 */
@@ -718,6 +719,7 @@ ext_no_vtime:
718mcck_int_handler: 719mcck_int_handler:
719 la %r1,4095 # revalidate r1 720 la %r1,4095 # revalidate r1
720 spt __LC_CPU_TIMER_SAVE_AREA-4095(%r1) # revalidate cpu timer 721 spt __LC_CPU_TIMER_SAVE_AREA-4095(%r1) # revalidate cpu timer
722 mvc __LC_ASYNC_ENTER_TIMER(8),__LC_CPU_TIMER_SAVE_AREA-4095(%r1)
721 lmg %r0,%r15,__LC_GPREGS_SAVE_AREA-4095(%r1)# revalidate gprs 723 lmg %r0,%r15,__LC_GPREGS_SAVE_AREA-4095(%r1)# revalidate gprs
722 SAVE_ALL_BASE __LC_SAVE_AREA+64 724 SAVE_ALL_BASE __LC_SAVE_AREA+64
723 la %r12,__LC_MCK_OLD_PSW 725 la %r12,__LC_MCK_OLD_PSW
@@ -727,20 +729,11 @@ mcck_int_handler:
727 jo 0f 729 jo 0f
728 spt __LC_LAST_UPDATE_TIMER 730 spt __LC_LAST_UPDATE_TIMER
729#ifdef CONFIG_VIRT_CPU_ACCOUNTING 731#ifdef CONFIG_VIRT_CPU_ACCOUNTING
730 mvc __LC_LAST_UPDATE_TIMER(8),__LC_ASYNC_ENTER_TIMER 732 mvc __LC_ASYNC_ENTER_TIMER(8),__LC_LAST_UPDATE_TIMER
731 mvc __LC_LAST_UPDATE_TIMER(8),__LC_SYNC_ENTER_TIMER 733 mvc __LC_SYNC_ENTER_TIMER(8),__LC_LAST_UPDATE_TIMER
732 mvc __LC_LAST_UPDATE_TIMER(8),__LC_EXIT_TIMER 734 mvc __LC_EXIT_TIMER(8),__LC_LAST_UPDATE_TIMER
7330: tm __LC_MCCK_CODE+2,0x08 # mwp of old psw valid?
734 jno mcck_no_vtime # no -> no timer update
735 tm __LC_MCK_OLD_PSW+1,0x01 # interrupting from user ?
736 jz mcck_no_vtime
737 UPDATE_VTIME __LC_EXIT_TIMER,__LC_ASYNC_ENTER_TIMER,__LC_USER_TIMER
738 UPDATE_VTIME __LC_LAST_UPDATE_TIMER,__LC_EXIT_TIMER,__LC_SYSTEM_TIMER
739 mvc __LC_LAST_UPDATE_TIMER(8),__LC_ASYNC_ENTER_TIMER
740mcck_no_vtime:
741#endif 735#endif
7420: 7360: tm __LC_MCCK_CODE+2,0x09 # mwp + ia of old psw valid?
743 tm __LC_MCCK_CODE+2,0x09 # mwp + ia of old psw valid?
744 jno mcck_int_main # no -> skip cleanup critical 737 jno mcck_int_main # no -> skip cleanup critical
745 tm __LC_MCK_OLD_PSW+1,0x01 # test problem state bit 738 tm __LC_MCK_OLD_PSW+1,0x01 # test problem state bit
746 jnz mcck_int_main # from user -> load kernel stack 739 jnz mcck_int_main # from user -> load kernel stack
@@ -756,6 +749,16 @@ mcck_int_main:
756 jz 0f 749 jz 0f
757 lg %r15,__LC_PANIC_STACK # load panic stack 750 lg %r15,__LC_PANIC_STACK # load panic stack
7580: CREATE_STACK_FRAME __LC_MCK_OLD_PSW,__LC_SAVE_AREA+64 7510: CREATE_STACK_FRAME __LC_MCK_OLD_PSW,__LC_SAVE_AREA+64
752#ifdef CONFIG_VIRT_CPU_ACCOUNTING
753 tm __LC_MCCK_CODE+2,0x08 # mwp of old psw valid?
754 jno mcck_no_vtime # no -> no timer update
755 tm __LC_MCK_OLD_PSW+1,0x01 # interrupting from user ?
756 jz mcck_no_vtime
757 UPDATE_VTIME __LC_EXIT_TIMER,__LC_ASYNC_ENTER_TIMER,__LC_USER_TIMER
758 UPDATE_VTIME __LC_LAST_UPDATE_TIMER,__LC_EXIT_TIMER,__LC_SYSTEM_TIMER
759 mvc __LC_LAST_UPDATE_TIMER(8),__LC_ASYNC_ENTER_TIMER
760mcck_no_vtime:
761#endif
759 lg %r9,__LC_THREAD_INFO # load pointer to thread_info struct 762 lg %r9,__LC_THREAD_INFO # load pointer to thread_info struct
760 la %r2,SP_PTREGS(%r15) # load pt_regs 763 la %r2,SP_PTREGS(%r15) # load pt_regs
761 brasl %r14,s390_do_machine_check 764 brasl %r14,s390_do_machine_check
@@ -771,7 +774,7 @@ mcck_int_main:
771 jno mcck_return 774 jno mcck_return
772 brasl %r14,s390_handle_mcck 775 brasl %r14,s390_handle_mcck
773mcck_return: 776mcck_return:
774 RESTORE_ALL 0 777 RESTORE_ALL __LC_RETURN_MCCK_PSW,0
775 778
776#ifdef CONFIG_SMP 779#ifdef CONFIG_SMP
777/* 780/*
@@ -833,6 +836,10 @@ cleanup_table_sysc_leave:
833 .quad sysc_leave, sysc_work_loop 836 .quad sysc_leave, sysc_work_loop
834cleanup_table_sysc_work_loop: 837cleanup_table_sysc_work_loop:
835 .quad sysc_work_loop, sysc_reschedule 838 .quad sysc_work_loop, sysc_reschedule
839cleanup_table_io_leave:
840 .quad io_leave, io_done
841cleanup_table_io_work_loop:
842 .quad io_work_loop, io_mcck_pending
836 843
837cleanup_critical: 844cleanup_critical:
838 clc 8(8,%r12),BASED(cleanup_table_system_call) 845 clc 8(8,%r12),BASED(cleanup_table_system_call)
@@ -855,10 +862,26 @@ cleanup_critical:
855 clc 8(8,%r12),BASED(cleanup_table_sysc_work_loop+8) 862 clc 8(8,%r12),BASED(cleanup_table_sysc_work_loop+8)
856 jl cleanup_sysc_return 863 jl cleanup_sysc_return
8570: 8640:
865 clc 8(8,%r12),BASED(cleanup_table_io_leave)
866 jl 0f
867 clc 8(8,%r12),BASED(cleanup_table_io_leave+8)
868 jl cleanup_io_leave
8690:
870 clc 8(8,%r12),BASED(cleanup_table_io_work_loop)
871 jl 0f
872 clc 8(8,%r12),BASED(cleanup_table_io_work_loop+8)
873 jl cleanup_io_return
8740:
858 br %r14 875 br %r14
859 876
860cleanup_system_call: 877cleanup_system_call:
861 mvc __LC_RETURN_PSW(16),0(%r12) 878 mvc __LC_RETURN_PSW(16),0(%r12)
879 cghi %r12,__LC_MCK_OLD_PSW
880 je 0f
881 la %r12,__LC_SAVE_AREA+32
882 j 1f
8830: la %r12,__LC_SAVE_AREA+64
8841:
862#ifdef CONFIG_VIRT_CPU_ACCOUNTING 885#ifdef CONFIG_VIRT_CPU_ACCOUNTING
863 clc __LC_RETURN_PSW+8(8),BASED(cleanup_system_call_insn+8) 886 clc __LC_RETURN_PSW+8(8),BASED(cleanup_system_call_insn+8)
864 jh 0f 887 jh 0f
@@ -868,11 +891,13 @@ cleanup_system_call:
868#endif 891#endif
869 clc __LC_RETURN_PSW+8(8),BASED(cleanup_system_call_insn) 892 clc __LC_RETURN_PSW+8(8),BASED(cleanup_system_call_insn)
870 jh 0f 893 jh 0f
871 mvc __LC_SAVE_AREA(32),__LC_SAVE_AREA+32 894 mvc __LC_SAVE_AREA(32),0(%r12)
8720: stg %r13,__LC_SAVE_AREA+40 8950: stg %r13,8(%r12)
896 stg %r12,__LC_SAVE_AREA+96 # argh
873 SAVE_ALL __LC_SVC_OLD_PSW,__LC_SAVE_AREA,1 897 SAVE_ALL __LC_SVC_OLD_PSW,__LC_SAVE_AREA,1
874 CREATE_STACK_FRAME __LC_SVC_OLD_PSW,__LC_SAVE_AREA 898 CREATE_STACK_FRAME __LC_SVC_OLD_PSW,__LC_SAVE_AREA
875 stg %r15,__LC_SAVE_AREA+56 899 lg %r12,__LC_SAVE_AREA+96 # argh
900 stg %r15,24(%r12)
876 llgh %r7,__LC_SVC_INT_CODE 901 llgh %r7,__LC_SVC_INT_CODE
877#ifdef CONFIG_VIRT_CPU_ACCOUNTING 902#ifdef CONFIG_VIRT_CPU_ACCOUNTING
878cleanup_vtime: 903cleanup_vtime:
@@ -909,17 +934,21 @@ cleanup_sysc_return:
909 934
910cleanup_sysc_leave: 935cleanup_sysc_leave:
911 clc 8(8,%r12),BASED(cleanup_sysc_leave_insn) 936 clc 8(8,%r12),BASED(cleanup_sysc_leave_insn)
912 je 0f 937 je 2f
913#ifdef CONFIG_VIRT_CPU_ACCOUNTING 938#ifdef CONFIG_VIRT_CPU_ACCOUNTING
914 mvc __LC_EXIT_TIMER(8),__LC_ASYNC_ENTER_TIMER 939 mvc __LC_EXIT_TIMER(8),__LC_ASYNC_ENTER_TIMER
915 clc 8(8,%r12),BASED(cleanup_sysc_leave_insn+8) 940 clc 8(8,%r12),BASED(cleanup_sysc_leave_insn+8)
916 je 0f 941 je 2f
917#endif 942#endif
918 mvc __LC_RETURN_PSW(16),SP_PSW(%r15) 943 mvc __LC_RETURN_PSW(16),SP_PSW(%r15)
919 mvc __LC_SAVE_AREA+32(32),SP_R12(%r15) 944 cghi %r12,__LC_MCK_OLD_PSW
920 lmg %r0,%r11,SP_R0(%r15) 945 jne 0f
946 mvc __LC_SAVE_AREA+64(32),SP_R12(%r15)
947 j 1f
9480: mvc __LC_SAVE_AREA+32(32),SP_R12(%r15)
9491: lmg %r0,%r11,SP_R0(%r15)
921 lg %r15,SP_R15(%r15) 950 lg %r15,SP_R15(%r15)
9220: la %r12,__LC_RETURN_PSW 9512: la %r12,__LC_RETURN_PSW
923 br %r14 952 br %r14
924cleanup_sysc_leave_insn: 953cleanup_sysc_leave_insn:
925#ifdef CONFIG_VIRT_CPU_ACCOUNTING 954#ifdef CONFIG_VIRT_CPU_ACCOUNTING
@@ -927,6 +956,36 @@ cleanup_sysc_leave_insn:
927#endif 956#endif
928 .quad sysc_leave + 12 957 .quad sysc_leave + 12
929 958
959cleanup_io_return:
960 mvc __LC_RETURN_PSW(8),0(%r12)
961 mvc __LC_RETURN_PSW+8(8),BASED(cleanup_table_io_work_loop)
962 la %r12,__LC_RETURN_PSW
963 br %r14
964
965cleanup_io_leave:
966 clc 8(8,%r12),BASED(cleanup_io_leave_insn)
967 je 2f
968#ifdef CONFIG_VIRT_CPU_ACCOUNTING
969 mvc __LC_EXIT_TIMER(8),__LC_ASYNC_ENTER_TIMER
970 clc 8(8,%r12),BASED(cleanup_io_leave_insn+8)
971 je 2f
972#endif
973 mvc __LC_RETURN_PSW(16),SP_PSW(%r15)
974 cghi %r12,__LC_MCK_OLD_PSW
975 jne 0f
976 mvc __LC_SAVE_AREA+64(32),SP_R12(%r15)
977 j 1f
9780: mvc __LC_SAVE_AREA+32(32),SP_R12(%r15)
9791: lmg %r0,%r11,SP_R0(%r15)
980 lg %r15,SP_R15(%r15)
9812: la %r12,__LC_RETURN_PSW
982 br %r14
983cleanup_io_leave_insn:
984#ifdef CONFIG_VIRT_CPU_ACCOUNTING
985 .quad io_leave + 20
986#endif
987 .quad io_leave + 16
988
930/* 989/*
931 * Integer constants 990 * Integer constants
932 */ 991 */
diff --git a/arch/s390/kernel/head.S b/arch/s390/kernel/head.S
index fc8bf5e285f6..2710e66fefba 100644
--- a/arch/s390/kernel/head.S
+++ b/arch/s390/kernel/head.S
@@ -346,6 +346,13 @@ iplstart:
346 la %r2,.Lreset 346 la %r2,.Lreset
347 lhi %r3,26 347 lhi %r3,26
348 diag %r2,%r3,8 348 diag %r2,%r3,8
349 la %r5,.Lirb
350 stsch 0(%r5) # check if irq is pending
351 tm 30(%r5),0x0f # by verifying if any of the
352 bnz .Lwaitforirq # activity or status control
353 tm 31(%r5),0xff # bits is set in the schib
354 bz .Lnoreset
355.Lwaitforirq:
349 mvc 0x78(8),.Lrdrnewpsw # set up IO interrupt psw 356 mvc 0x78(8),.Lrdrnewpsw # set up IO interrupt psw
350.Lwaitrdrirq: 357.Lwaitrdrirq:
351 lpsw .Lrdrwaitpsw 358 lpsw .Lrdrwaitpsw
@@ -535,8 +542,13 @@ startup:basr %r13,0 # get base
535 lhi %r1,0 542 lhi %r1,0
536 icm %r1,3,.Lscpincr1-PARMAREA(%r4) # use this one if != 0 543 icm %r1,3,.Lscpincr1-PARMAREA(%r4) # use this one if != 0
537 jnz .Lscnd 544 jnz .Lscnd
538 l %r1,.Lscpincr2-PARMAREA+4(%r4) # otherwise use this one 545 lhi %r1,0x800 # otherwise report 2GB
539.Lscnd: 546.Lscnd:
547 lhi %r3,0x800 # limit reported memory size to 2GB
548 cr %r1,%r3
549 jl .Lno2gb
550 lr %r1,%r3
551.Lno2gb:
540 xr %r3,%r3 # same logic 552 xr %r3,%r3 # same logic
541 ic %r3,.Lscpa1-PARMAREA(%r4) 553 ic %r3,.Lscpa1-PARMAREA(%r4)
542 chi %r3,0x00 554 chi %r3,0x00
@@ -765,7 +777,7 @@ _stext: basr %r13,0 # get base
765 777
766# check control registers 778# check control registers
767 stctl %c0,%c15,0(%r15) 779 stctl %c0,%c15,0(%r15)
768 oi 2(%r15),0x20 # enable sigp external interrupts 780 oi 2(%r15),0x40 # enable sigp emergency signal
769 oi 0(%r15),0x10 # switch on low address protection 781 oi 0(%r15),0x10 # switch on low address protection
770 lctl %c0,%c15,0(%r15) 782 lctl %c0,%c15,0(%r15)
771 783
diff --git a/arch/s390/kernel/head64.S b/arch/s390/kernel/head64.S
index f525c0c21250..9a8263a153cb 100644
--- a/arch/s390/kernel/head64.S
+++ b/arch/s390/kernel/head64.S
@@ -345,6 +345,13 @@ iplstart:
345 la %r2,.Lreset 345 la %r2,.Lreset
346 lhi %r3,26 346 lhi %r3,26
347 diag %r2,%r3,8 347 diag %r2,%r3,8
348 la %r5,.Lirb
349 stsch 0(%r5) # check if irq is pending
350 tm 30(%r5),0x0f # by verifying if any of the
351 bnz .Lwaitforirq # activity or status control
352 tm 31(%r5),0xff # bits is set in the schib
353 bz .Lnoreset
354.Lwaitforirq:
348 mvc 0x78(8),.Lrdrnewpsw # set up IO interrupt psw 355 mvc 0x78(8),.Lrdrnewpsw # set up IO interrupt psw
349.Lwaitrdrirq: 356.Lwaitrdrirq:
350 lpsw .Lrdrwaitpsw 357 lpsw .Lrdrwaitpsw
@@ -658,10 +665,8 @@ startup:basr %r13,0 # get base
658# 665#
659 la %r1,0f-.LPG1(%r13) # set program check address 666 la %r1,0f-.LPG1(%r13) # set program check address
660 stg %r1,__LC_PGM_NEW_PSW+8 667 stg %r1,__LC_PGM_NEW_PSW+8
661 mvc __LC_DIAG44_OPCODE(8),.Lnop-.LPG1(%r13)
662 diag 0,0,0x44 # test diag 0x44 668 diag 0,0,0x44 # test diag 0x44
663 oi 7(%r12),32 # set diag44 flag 669 oi 7(%r12),32 # set diag44 flag
664 mvc __LC_DIAG44_OPCODE(8),.Ldiag44-.LPG1(%r13)
6650: 6700:
666 671
667# 672#
@@ -702,7 +707,6 @@ startup:basr %r13,0 # get base
702.L4malign:.quad 0xffffffffffc00000 707.L4malign:.quad 0xffffffffffc00000
703.Lscan2g:.quad 0x80000000 + 0x20000 - 8 # 2GB + 128K - 8 708.Lscan2g:.quad 0x80000000 + 0x20000 - 8 # 2GB + 128K - 8
704.Lnop: .long 0x07000700 709.Lnop: .long 0x07000700
705.Ldiag44:.long 0x83000044
706 710
707 .org PARMAREA-64 711 .org PARMAREA-64
708.Lduct: .long 0,0,0,0,0,0,0,0 712.Lduct: .long 0,0,0,0,0,0,0,0
@@ -765,7 +769,7 @@ _stext: basr %r13,0 # get base
765 769
766# check control registers 770# check control registers
767 stctg %c0,%c15,0(%r15) 771 stctg %c0,%c15,0(%r15)
768 oi 6(%r15),0x20 # enable sigp external interrupts 772 oi 6(%r15),0x40 # enable sigp emergency signal
769 oi 4(%r15),0x10 # switch on low address proctection 773 oi 4(%r15),0x10 # switch on low address proctection
770 lctlg %c0,%c15,0(%r15) 774 lctlg %c0,%c15,0(%r15)
771 775
diff --git a/arch/s390/kernel/machine_kexec.c b/arch/s390/kernel/machine_kexec.c
index 2721c3a32b84..5aa71b05b8ae 100644
--- a/arch/s390/kernel/machine_kexec.c
+++ b/arch/s390/kernel/machine_kexec.c
@@ -70,6 +70,8 @@ machine_kexec(struct kimage *image)
70 for (;;); 70 for (;;);
71} 71}
72 72
73extern void pfault_fini(void);
74
73static void 75static void
74kexec_halt_all_cpus(void *kernel_image) 76kexec_halt_all_cpus(void *kernel_image)
75{ 77{
@@ -78,6 +80,11 @@ kexec_halt_all_cpus(void *kernel_image)
78 struct kimage *image; 80 struct kimage *image;
79 relocate_kernel_t data_mover; 81 relocate_kernel_t data_mover;
80 82
83#ifdef CONFIG_PFAULT
84 if (MACHINE_IS_VM)
85 pfault_fini();
86#endif
87
81 if (atomic_compare_and_swap(-1, smp_processor_id(), &cpuid)) 88 if (atomic_compare_and_swap(-1, smp_processor_id(), &cpuid))
82 signal_processor(smp_processor_id(), sigp_stop); 89 signal_processor(smp_processor_id(), sigp_stop);
83 90
diff --git a/arch/s390/kernel/relocate_kernel.S b/arch/s390/kernel/relocate_kernel.S
index d5e4a62fbb79..2a25ec7147ff 100644
--- a/arch/s390/kernel/relocate_kernel.S
+++ b/arch/s390/kernel/relocate_kernel.S
@@ -4,6 +4,7 @@
4 * (C) Copyright IBM Corp. 2005 4 * (C) Copyright IBM Corp. 2005
5 * 5 *
6 * Author(s): Rolf Adelsberger <adelsberger@de.ibm.com> 6 * Author(s): Rolf Adelsberger <adelsberger@de.ibm.com>
7 * Heiko Carstens <heiko.carstens@de.ibm.com>
7 * 8 *
8 */ 9 */
9 10
@@ -25,8 +26,31 @@
25 relocate_kernel: 26 relocate_kernel:
26 basr %r13,0 #base address 27 basr %r13,0 #base address
27 .base: 28 .base:
28 spx zero64-.base(%r13) #absolute addressing mode
29 stnsm sys_msk-.base(%r13),0xf8 #disable DAT and IRQ (external) 29 stnsm sys_msk-.base(%r13),0xf8 #disable DAT and IRQ (external)
30 spx zero64-.base(%r13) #absolute addressing mode
31 stctl %c0,%c15,ctlregs-.base(%r13)
32 stm %r0,%r15,gprregs-.base(%r13)
33 la %r1,load_psw-.base(%r13)
34 mvc 0(8,%r0),0(%r1)
35 la %r0,.back-.base(%r13)
36 st %r0,4(%r0)
37 oi 4(%r0),0x80
38 mvc 0x68(8,%r0),0(%r1)
39 la %r0,.back_pgm-.base(%r13)
40 st %r0,0x6c(%r0)
41 oi 0x6c(%r0),0x80
42 lhi %r0,0
43 diag %r0,%r0,0x308
44 .back:
45 basr %r13,0
46 .back_base:
47 oi have_diag308-.back_base(%r13),0x01
48 lctl %c0,%c15,ctlregs-.back_base(%r13)
49 lm %r0,%r15,gprregs-.back_base(%r13)
50 j .start_reloc
51 .back_pgm:
52 lm %r0,%r15,gprregs-.base(%r13)
53 .start_reloc:
30 lhi %r10,-1 #preparing the mask 54 lhi %r10,-1 #preparing the mask
31 sll %r10,12 #shift it such that it becomes 0xf000 55 sll %r10,12 #shift it such that it becomes 0xf000
32 .top: 56 .top:
@@ -63,6 +87,10 @@
63 o %r3,4(%r4) #or load address into psw 87 o %r3,4(%r4) #or load address into psw
64 st %r3,4(%r4) 88 st %r3,4(%r4)
65 mvc 0(8,%r0),0(%r4) #copy psw to absolute address 0 89 mvc 0(8,%r0),0(%r4) #copy psw to absolute address 0
90 tm have_diag308-.base(%r13),0x01
91 jno .no_diag308
92 diag %r0,%r0,0x308
93 .no_diag308:
66 sr %r1,%r1 #clear %r1 94 sr %r1,%r1 #clear %r1
67 sr %r2,%r2 #clear %r2 95 sr %r2,%r2 #clear %r2
68 sigp %r1,%r2,0x12 #set cpuid to zero 96 sigp %r1,%r2,0x12 #set cpuid to zero
@@ -75,6 +103,17 @@
75 .long 0x00080000,0x80000000 103 .long 0x00080000,0x80000000
76 sys_msk: 104 sys_msk:
77 .quad 0 105 .quad 0
106 ctlregs:
107 .rept 16
108 .long 0
109 .endr
110 gprregs:
111 .rept 16
112 .long 0
113 .endr
114 have_diag308:
115 .byte 0
116 .align 8
78 relocate_kernel_end: 117 relocate_kernel_end:
79 .globl relocate_kernel_len 118 .globl relocate_kernel_len
80 relocate_kernel_len: 119 relocate_kernel_len:
diff --git a/arch/s390/kernel/relocate_kernel64.S b/arch/s390/kernel/relocate_kernel64.S
index 96290cc4eb3c..8cdb86e8911f 100644
--- a/arch/s390/kernel/relocate_kernel64.S
+++ b/arch/s390/kernel/relocate_kernel64.S
@@ -4,6 +4,7 @@
4 * (C) Copyright IBM Corp. 2005 4 * (C) Copyright IBM Corp. 2005
5 * 5 *
6 * Author(s): Rolf Adelsberger <adelsberger@de.ibm.com> 6 * Author(s): Rolf Adelsberger <adelsberger@de.ibm.com>
7 * Heiko Carstens <heiko.carstens@de.ibm.com>
7 * 8 *
8 */ 9 */
9 10
@@ -26,8 +27,34 @@
26 relocate_kernel: 27 relocate_kernel:
27 basr %r13,0 #base address 28 basr %r13,0 #base address
28 .base: 29 .base:
30 stnsm sys_msk-.base(%r13),0xf8 #disable DAT and IRQs
29 spx zero64-.base(%r13) #absolute addressing mode 31 spx zero64-.base(%r13) #absolute addressing mode
30 stnsm sys_msk-.base(%r13),0xf8 #disable DAT and IRQ (external) 32 stctg %c0,%c15,ctlregs-.base(%r13)
33 stmg %r0,%r15,gprregs-.base(%r13)
34 lghi %r0,3
35 sllg %r0,%r0,31
36 stg %r0,0x1d0(%r0)
37 la %r0,.back_pgm-.base(%r13)
38 stg %r0,0x1d8(%r0)
39 la %r1,load_psw-.base(%r13)
40 mvc 0(8,%r0),0(%r1)
41 la %r0,.back-.base(%r13)
42 st %r0,4(%r0)
43 oi 4(%r0),0x80
44 lghi %r0,0
45 diag %r0,%r0,0x308
46 .back:
47 lhi %r1,1 #mode 1 = esame
48 sigp %r1,%r0,0x12 #switch to esame mode
49 sam64 #switch to 64 bit addressing mode
50 basr %r13,0
51 .back_base:
52 oi have_diag308-.back_base(%r13),0x01
53 lctlg %c0,%c15,ctlregs-.back_base(%r13)
54 lmg %r0,%r15,gprregs-.back_base(%r13)
55 j .top
56 .back_pgm:
57 lmg %r0,%r15,gprregs-.base(%r13)
31 .top: 58 .top:
32 lghi %r7,4096 #load PAGE_SIZE in r7 59 lghi %r7,4096 #load PAGE_SIZE in r7
33 lghi %r9,4096 #load PAGE_SIZE in r9 60 lghi %r9,4096 #load PAGE_SIZE in r9
@@ -62,6 +89,10 @@
62 o %r3,4(%r4) #or load address into psw 89 o %r3,4(%r4) #or load address into psw
63 st %r3,4(%r4) 90 st %r3,4(%r4)
64 mvc 0(8,%r0),0(%r4) #copy psw to absolute address 0 91 mvc 0(8,%r0),0(%r4) #copy psw to absolute address 0
92 tm have_diag308-.base(%r13),0x01
93 jno .no_diag308
94 diag %r0,%r0,0x308
95 .no_diag308:
65 sam31 #31 bit mode 96 sam31 #31 bit mode
66 sr %r1,%r1 #erase register r1 97 sr %r1,%r1 #erase register r1
67 sr %r2,%r2 #erase register r2 98 sr %r2,%r2 #erase register r2
@@ -75,8 +106,18 @@
75 .long 0x00080000,0x80000000 106 .long 0x00080000,0x80000000
76 sys_msk: 107 sys_msk:
77 .quad 0 108 .quad 0
109 ctlregs:
110 .rept 16
111 .quad 0
112 .endr
113 gprregs:
114 .rept 16
115 .quad 0
116 .endr
117 have_diag308:
118 .byte 0
119 .align 8
78 relocate_kernel_end: 120 relocate_kernel_end:
79 .globl relocate_kernel_len 121 .globl relocate_kernel_len
80 relocate_kernel_len: 122 relocate_kernel_len:
81 .quad relocate_kernel_end - relocate_kernel 123 .quad relocate_kernel_end - relocate_kernel
82
diff --git a/arch/s390/kernel/s390_ext.c b/arch/s390/kernel/s390_ext.c
index 3bdd38ec71da..207bc511a6e3 100644
--- a/arch/s390/kernel/s390_ext.c
+++ b/arch/s390/kernel/s390_ext.c
@@ -19,7 +19,6 @@
19#include <asm/irq.h> 19#include <asm/irq.h>
20 20
21/* 21/*
22 * Simple hash strategy: index = code & 0xff;
23 * ext_int_hash[index] is the start of the list for all external interrupts 22 * ext_int_hash[index] is the start of the list for all external interrupts
24 * that hash to this index. With the current set of external interrupts 23 * that hash to this index. With the current set of external interrupts
25 * (0x1202 external call, 0x1004 cpu timer, 0x2401 hwc console, 0x4000 24 * (0x1202 external call, 0x1004 cpu timer, 0x2401 hwc console, 0x4000
@@ -27,6 +26,11 @@
27 */ 26 */
28ext_int_info_t *ext_int_hash[256] = { 0, }; 27ext_int_info_t *ext_int_hash[256] = { 0, };
29 28
29static inline int ext_hash(__u16 code)
30{
31 return (code + (code >> 9)) & 0xff;
32}
33
30int register_external_interrupt(__u16 code, ext_int_handler_t handler) 34int register_external_interrupt(__u16 code, ext_int_handler_t handler)
31{ 35{
32 ext_int_info_t *p; 36 ext_int_info_t *p;
@@ -37,7 +41,7 @@ int register_external_interrupt(__u16 code, ext_int_handler_t handler)
37 return -ENOMEM; 41 return -ENOMEM;
38 p->code = code; 42 p->code = code;
39 p->handler = handler; 43 p->handler = handler;
40 index = code & 0xff; 44 index = ext_hash(code);
41 p->next = ext_int_hash[index]; 45 p->next = ext_int_hash[index];
42 ext_int_hash[index] = p; 46 ext_int_hash[index] = p;
43 return 0; 47 return 0;
@@ -52,7 +56,7 @@ int register_early_external_interrupt(__u16 code, ext_int_handler_t handler,
52 return -EINVAL; 56 return -EINVAL;
53 p->code = code; 57 p->code = code;
54 p->handler = handler; 58 p->handler = handler;
55 index = code & 0xff; 59 index = ext_hash(code);
56 p->next = ext_int_hash[index]; 60 p->next = ext_int_hash[index];
57 ext_int_hash[index] = p; 61 ext_int_hash[index] = p;
58 return 0; 62 return 0;
@@ -63,7 +67,7 @@ int unregister_external_interrupt(__u16 code, ext_int_handler_t handler)
63 ext_int_info_t *p, *q; 67 ext_int_info_t *p, *q;
64 int index; 68 int index;
65 69
66 index = code & 0xff; 70 index = ext_hash(code);
67 q = NULL; 71 q = NULL;
68 p = ext_int_hash[index]; 72 p = ext_int_hash[index];
69 while (p != NULL) { 73 while (p != NULL) {
@@ -90,7 +94,7 @@ int unregister_early_external_interrupt(__u16 code, ext_int_handler_t handler,
90 94
91 if (p == NULL || p->code != code || p->handler != handler) 95 if (p == NULL || p->code != code || p->handler != handler)
92 return -EINVAL; 96 return -EINVAL;
93 index = code & 0xff; 97 index = ext_hash(code);
94 q = ext_int_hash[index]; 98 q = ext_int_hash[index];
95 if (p != q) { 99 if (p != q) {
96 while (q != NULL) { 100 while (q != NULL) {
@@ -120,7 +124,7 @@ void do_extint(struct pt_regs *regs, unsigned short code)
120 */ 124 */
121 account_ticks(regs); 125 account_ticks(regs);
122 kstat_cpu(smp_processor_id()).irqs[EXTERNAL_INTERRUPT]++; 126 kstat_cpu(smp_processor_id()).irqs[EXTERNAL_INTERRUPT]++;
123 index = code & 0xff; 127 index = ext_hash(code);
124 for (p = ext_int_hash[index]; p; p = p->next) { 128 for (p = ext_int_hash[index]; p; p = p->next) {
125 if (likely(p->code == code)) { 129 if (likely(p->code == code)) {
126 if (likely(p->handler)) 130 if (likely(p->handler))
diff --git a/arch/s390/kernel/setup.c b/arch/s390/kernel/setup.c
index b6d740ac0e6e..5ba5a5485da9 100644
--- a/arch/s390/kernel/setup.c
+++ b/arch/s390/kernel/setup.c
@@ -299,24 +299,18 @@ void machine_restart(char *command)
299 _machine_restart(command); 299 _machine_restart(command);
300} 300}
301 301
302EXPORT_SYMBOL(machine_restart);
303
304void machine_halt(void) 302void machine_halt(void)
305{ 303{
306 console_unblank(); 304 console_unblank();
307 _machine_halt(); 305 _machine_halt();
308} 306}
309 307
310EXPORT_SYMBOL(machine_halt);
311
312void machine_power_off(void) 308void machine_power_off(void)
313{ 309{
314 console_unblank(); 310 console_unblank();
315 _machine_power_off(); 311 _machine_power_off();
316} 312}
317 313
318EXPORT_SYMBOL(machine_power_off);
319
320static void __init 314static void __init
321add_memory_hole(unsigned long start, unsigned long end) 315add_memory_hole(unsigned long start, unsigned long end)
322{ 316{
@@ -437,12 +431,6 @@ setup_lowcore(void)
437 ctl_set_bit(14, 29); 431 ctl_set_bit(14, 29);
438 } 432 }
439#endif 433#endif
440#ifdef CONFIG_ARCH_S390X
441 if (MACHINE_HAS_DIAG44)
442 lc->diag44_opcode = 0x83000044;
443 else
444 lc->diag44_opcode = 0x07000700;
445#endif /* CONFIG_ARCH_S390X */
446 set_prefix((u32)(unsigned long) lc); 434 set_prefix((u32)(unsigned long) lc);
447} 435}
448 436
diff --git a/arch/s390/kernel/signal.c b/arch/s390/kernel/signal.c
index 610c1d03e975..6a3f5b7473a9 100644
--- a/arch/s390/kernel/signal.c
+++ b/arch/s390/kernel/signal.c
@@ -429,13 +429,12 @@ handle_signal(unsigned long sig, struct k_sigaction *ka,
429 else 429 else
430 setup_frame(sig, ka, oldset, regs); 430 setup_frame(sig, ka, oldset, regs);
431 431
432 if (!(ka->sa.sa_flags & SA_NODEFER)) { 432 spin_lock_irq(&current->sighand->siglock);
433 spin_lock_irq(&current->sighand->siglock); 433 sigorsets(&current->blocked,&current->blocked,&ka->sa.sa_mask);
434 sigorsets(&current->blocked,&current->blocked,&ka->sa.sa_mask); 434 if (!(ka->sa.sa_flags & SA_NODEFER))
435 sigaddset(&current->blocked,sig); 435 sigaddset(&current->blocked,sig);
436 recalc_sigpending(); 436 recalc_sigpending();
437 spin_unlock_irq(&current->sighand->siglock); 437 spin_unlock_irq(&current->sighand->siglock);
438 }
439} 438}
440 439
441/* 440/*
diff --git a/arch/s390/kernel/smp.c b/arch/s390/kernel/smp.c
index 642572a8e334..85222fee4361 100644
--- a/arch/s390/kernel/smp.c
+++ b/arch/s390/kernel/smp.c
@@ -375,7 +375,7 @@ static void smp_ext_bitcall(int cpu, ec_bit_sig sig)
375 * Set signaling bit in lowcore of target cpu and kick it 375 * Set signaling bit in lowcore of target cpu and kick it
376 */ 376 */
377 set_bit(sig, (unsigned long *) &lowcore_ptr[cpu]->ext_call_fast); 377 set_bit(sig, (unsigned long *) &lowcore_ptr[cpu]->ext_call_fast);
378 while(signal_processor(cpu, sigp_external_call) == sigp_busy) 378 while(signal_processor(cpu, sigp_emergency_signal) == sigp_busy)
379 udelay(10); 379 udelay(10);
380} 380}
381 381
@@ -394,7 +394,7 @@ static void smp_ext_bitcall_others(ec_bit_sig sig)
394 * Set signaling bit in lowcore of target cpu and kick it 394 * Set signaling bit in lowcore of target cpu and kick it
395 */ 395 */
396 set_bit(sig, (unsigned long *) &lowcore_ptr[cpu]->ext_call_fast); 396 set_bit(sig, (unsigned long *) &lowcore_ptr[cpu]->ext_call_fast);
397 while (signal_processor(cpu, sigp_external_call) == sigp_busy) 397 while (signal_processor(cpu, sigp_emergency_signal) == sigp_busy)
398 udelay(10); 398 udelay(10);
399 } 399 }
400} 400}
@@ -537,7 +537,8 @@ int __devinit start_secondary(void *cpuvoid)
537#endif 537#endif
538#ifdef CONFIG_PFAULT 538#ifdef CONFIG_PFAULT
539 /* Enable pfault pseudo page faults on this cpu. */ 539 /* Enable pfault pseudo page faults on this cpu. */
540 pfault_init(); 540 if (MACHINE_IS_VM)
541 pfault_init();
541#endif 542#endif
542 /* Mark this cpu as online */ 543 /* Mark this cpu as online */
543 cpu_set(smp_processor_id(), cpu_online_map); 544 cpu_set(smp_processor_id(), cpu_online_map);
@@ -690,7 +691,8 @@ __cpu_disable(void)
690 691
691#ifdef CONFIG_PFAULT 692#ifdef CONFIG_PFAULT
692 /* Disable pfault pseudo page faults on this cpu. */ 693 /* Disable pfault pseudo page faults on this cpu. */
693 pfault_fini(); 694 if (MACHINE_IS_VM)
695 pfault_fini();
694#endif 696#endif
695 697
696 /* disable all external interrupts */ 698 /* disable all external interrupts */
@@ -751,9 +753,9 @@ void __init smp_prepare_cpus(unsigned int max_cpus)
751 unsigned int cpu; 753 unsigned int cpu;
752 int i; 754 int i;
753 755
754 /* request the 0x1202 external interrupt */ 756 /* request the 0x1201 emergency signal external interrupt */
755 if (register_external_interrupt(0x1202, do_ext_call_interrupt) != 0) 757 if (register_external_interrupt(0x1201, do_ext_call_interrupt) != 0)
756 panic("Couldn't request external interrupt 0x1202"); 758 panic("Couldn't request external interrupt 0x1201");
757 smp_check_cpus(max_cpus); 759 smp_check_cpus(max_cpus);
758 memset(lowcore_ptr,0,sizeof(lowcore_ptr)); 760 memset(lowcore_ptr,0,sizeof(lowcore_ptr));
759 /* 761 /*
diff --git a/arch/s390/kernel/syscalls.S b/arch/s390/kernel/syscalls.S
index a8668afb5f87..426d7cafdab3 100644
--- a/arch/s390/kernel/syscalls.S
+++ b/arch/s390/kernel/syscalls.S
@@ -290,3 +290,8 @@ SYSCALL(sys_add_key,sys_add_key,compat_sys_add_key_wrapper)
290SYSCALL(sys_request_key,sys_request_key,compat_sys_request_key_wrapper) 290SYSCALL(sys_request_key,sys_request_key,compat_sys_request_key_wrapper)
291SYSCALL(sys_keyctl,sys_keyctl,compat_sys_keyctl) /* 280 */ 291SYSCALL(sys_keyctl,sys_keyctl,compat_sys_keyctl) /* 280 */
292SYSCALL(sys_waitid,sys_waitid,compat_sys_waitid_wrapper) 292SYSCALL(sys_waitid,sys_waitid,compat_sys_waitid_wrapper)
293SYSCALL(sys_ioprio_set,sys_ioprio_set,sys_ioprio_set_wrapper)
294SYSCALL(sys_ioprio_get,sys_ioprio_get,sys_ioprio_get_wrapper)
295SYSCALL(sys_inotify_init,sys_inotify_init,sys_inotify_init)
296SYSCALL(sys_inotify_add_watch,sys_inotify_add_watch,sys_inotify_add_watch_wrapper)
297SYSCALL(sys_inotify_rm_watch,sys_inotify_rm_watch,sys_inotify_rm_watch_wrapper)
diff --git a/arch/s390/kernel/traps.c b/arch/s390/kernel/traps.c
index bc7b7be7acbe..6b8703ec2ae6 100644
--- a/arch/s390/kernel/traps.c
+++ b/arch/s390/kernel/traps.c
@@ -29,6 +29,7 @@
29#include <linux/delay.h> 29#include <linux/delay.h>
30#include <linux/module.h> 30#include <linux/module.h>
31#include <linux/kallsyms.h> 31#include <linux/kallsyms.h>
32#include <linux/reboot.h>
32 33
33#include <asm/system.h> 34#include <asm/system.h>
34#include <asm/uaccess.h> 35#include <asm/uaccess.h>
@@ -675,6 +676,19 @@ asmlinkage void kernel_stack_overflow(struct pt_regs * regs)
675 panic("Corrupt kernel stack, can't continue."); 676 panic("Corrupt kernel stack, can't continue.");
676} 677}
677 678
679#ifndef CONFIG_ARCH_S390X
680static int
681pagex_reboot_event(struct notifier_block *this, unsigned long event, void *ptr)
682{
683 if (MACHINE_IS_VM)
684 cpcmd("SET PAGEX OFF", NULL, 0, NULL);
685 return NOTIFY_DONE;
686}
687
688static struct notifier_block pagex_reboot_notifier = {
689 .notifier_call = &pagex_reboot_event,
690};
691#endif
678 692
679/* init is done in lowcore.S and head.S */ 693/* init is done in lowcore.S and head.S */
680 694
@@ -735,6 +749,7 @@ void __init trap_init(void)
735 &ext_int_pfault); 749 &ext_int_pfault);
736#endif 750#endif
737#ifndef CONFIG_ARCH_S390X 751#ifndef CONFIG_ARCH_S390X
752 register_reboot_notifier(&pagex_reboot_notifier);
738 cpcmd("SET PAGEX ON", NULL, 0, NULL); 753 cpcmd("SET PAGEX ON", NULL, 0, NULL);
739#endif 754#endif
740 } 755 }
diff --git a/arch/s390/lib/Makefile b/arch/s390/lib/Makefile
index a8758b1d20a9..b701efa1f00e 100644
--- a/arch/s390/lib/Makefile
+++ b/arch/s390/lib/Makefile
@@ -5,5 +5,5 @@
5EXTRA_AFLAGS := -traditional 5EXTRA_AFLAGS := -traditional
6 6
7lib-y += delay.o string.o 7lib-y += delay.o string.o
8lib-$(CONFIG_ARCH_S390_31) += uaccess.o 8lib-$(CONFIG_ARCH_S390_31) += uaccess.o spinlock.o
9lib-$(CONFIG_ARCH_S390X) += uaccess64.o 9lib-$(CONFIG_ARCH_S390X) += uaccess64.o spinlock.o
diff --git a/arch/s390/lib/spinlock.c b/arch/s390/lib/spinlock.c
new file mode 100644
index 000000000000..888b5596c195
--- /dev/null
+++ b/arch/s390/lib/spinlock.c
@@ -0,0 +1,133 @@
1/*
2 * arch/s390/lib/spinlock.c
3 * Out of line spinlock code.
4 *
5 * S390 version
6 * Copyright (C) 2004 IBM Deutschland Entwicklung GmbH, IBM Corporation
7 * Author(s): Martin Schwidefsky (schwidefsky@de.ibm.com)
8 */
9
10#include <linux/types.h>
11#include <linux/module.h>
12#include <linux/spinlock.h>
13#include <linux/init.h>
14#include <asm/io.h>
15
16atomic_t spin_retry_counter;
17int spin_retry = 1000;
18
19/**
20 * spin_retry= parameter
21 */
22static int __init spin_retry_setup(char *str)
23{
24 spin_retry = simple_strtoul(str, &str, 0);
25 return 1;
26}
27__setup("spin_retry=", spin_retry_setup);
28
29static inline void
30_diag44(void)
31{
32#ifdef __s390x__
33 if (MACHINE_HAS_DIAG44)
34#endif
35 asm volatile("diag 0,0,0x44");
36}
37
38void
39_raw_spin_lock_wait(spinlock_t *lp, unsigned int pc)
40{
41 int count = spin_retry;
42
43 while (1) {
44 if (count-- <= 0) {
45 _diag44();
46 count = spin_retry;
47 }
48 atomic_inc(&spin_retry_counter);
49 if (_raw_compare_and_swap(&lp->lock, 0, pc) == 0)
50 return;
51 }
52}
53EXPORT_SYMBOL(_raw_spin_lock_wait);
54
55int
56_raw_spin_trylock_retry(spinlock_t *lp, unsigned int pc)
57{
58 int count = spin_retry;
59
60 while (count-- > 0) {
61 atomic_inc(&spin_retry_counter);
62 if (_raw_compare_and_swap(&lp->lock, 0, pc) == 0)
63 return 1;
64 }
65 return 0;
66}
67EXPORT_SYMBOL(_raw_spin_trylock_retry);
68
69void
70_raw_read_lock_wait(rwlock_t *rw)
71{
72 unsigned int old;
73 int count = spin_retry;
74
75 while (1) {
76 if (count-- <= 0) {
77 _diag44();
78 count = spin_retry;
79 }
80 atomic_inc(&spin_retry_counter);
81 old = rw->lock & 0x7fffffffU;
82 if (_raw_compare_and_swap(&rw->lock, old, old + 1) == old)
83 return;
84 }
85}
86EXPORT_SYMBOL(_raw_read_lock_wait);
87
88int
89_raw_read_trylock_retry(rwlock_t *rw)
90{
91 unsigned int old;
92 int count = spin_retry;
93
94 while (count-- > 0) {
95 atomic_inc(&spin_retry_counter);
96 old = rw->lock & 0x7fffffffU;
97 if (_raw_compare_and_swap(&rw->lock, old, old + 1) == old)
98 return 1;
99 }
100 return 0;
101}
102EXPORT_SYMBOL(_raw_read_trylock_retry);
103
104void
105_raw_write_lock_wait(rwlock_t *rw)
106{
107 int count = spin_retry;
108
109 while (1) {
110 if (count-- <= 0) {
111 _diag44();
112 count = spin_retry;
113 }
114 atomic_inc(&spin_retry_counter);
115 if (_raw_compare_and_swap(&rw->lock, 0, 0x80000000) == 0)
116 return;
117 }
118}
119EXPORT_SYMBOL(_raw_write_lock_wait);
120
121int
122_raw_write_trylock_retry(rwlock_t *rw)
123{
124 int count = spin_retry;
125
126 while (count-- > 0) {
127 atomic_inc(&spin_retry_counter);
128 if (_raw_compare_and_swap(&rw->lock, 0, 0x80000000) == 0)
129 return 1;
130 }
131 return 0;
132}
133EXPORT_SYMBOL(_raw_write_trylock_retry);
diff --git a/arch/s390/mm/fault.c b/arch/s390/mm/fault.c
index 75fde949d125..856a971759b1 100644
--- a/arch/s390/mm/fault.c
+++ b/arch/s390/mm/fault.c
@@ -563,12 +563,14 @@ pfault_interrupt(struct pt_regs *regs, __u16 error_code)
563 * interrupt. pfault_wait is valid. Set pfault_wait 563 * interrupt. pfault_wait is valid. Set pfault_wait
564 * back to zero and wake up the process. This can 564 * back to zero and wake up the process. This can
565 * safely be done because the task is still sleeping 565 * safely be done because the task is still sleeping
566 * and can't procude new pfaults. */ 566 * and can't produce new pfaults. */
567 tsk->thread.pfault_wait = 0; 567 tsk->thread.pfault_wait = 0;
568 wake_up_process(tsk); 568 wake_up_process(tsk);
569 put_task_struct(tsk);
569 } 570 }
570 } else { 571 } else {
571 /* signal bit not set -> a real page is missing. */ 572 /* signal bit not set -> a real page is missing. */
573 get_task_struct(tsk);
572 set_task_state(tsk, TASK_UNINTERRUPTIBLE); 574 set_task_state(tsk, TASK_UNINTERRUPTIBLE);
573 if (xchg(&tsk->thread.pfault_wait, 1) != 0) { 575 if (xchg(&tsk->thread.pfault_wait, 1) != 0) {
574 /* Completion interrupt was faster than the initial 576 /* Completion interrupt was faster than the initial
@@ -578,6 +580,7 @@ pfault_interrupt(struct pt_regs *regs, __u16 error_code)
578 * mode and can't produce new pfaults. */ 580 * mode and can't produce new pfaults. */
579 tsk->thread.pfault_wait = 0; 581 tsk->thread.pfault_wait = 0;
580 set_task_state(tsk, TASK_RUNNING); 582 set_task_state(tsk, TASK_RUNNING);
583 put_task_struct(tsk);
581 } else 584 } else
582 set_tsk_need_resched(tsk); 585 set_tsk_need_resched(tsk);
583 } 586 }
diff --git a/arch/sh/Kconfig b/arch/sh/Kconfig
index a7c8bfc11604..adc8109f8b77 100644
--- a/arch/sh/Kconfig
+++ b/arch/sh/Kconfig
@@ -784,6 +784,8 @@ config EMBEDDED_RAMDISK_IMAGE
784 784
785endmenu 785endmenu
786 786
787source "net/Kconfig"
788
787source "drivers/Kconfig" 789source "drivers/Kconfig"
788 790
789source "fs/Kconfig" 791source "fs/Kconfig"
diff --git a/arch/sh/kernel/entry.S b/arch/sh/kernel/entry.S
index 6615e4838ee4..fb6368159dd0 100644
--- a/arch/sh/kernel/entry.S
+++ b/arch/sh/kernel/entry.S
@@ -1145,5 +1145,10 @@ ENTRY(sys_call_table)
1145 .long sys_add_key /* 285 */ 1145 .long sys_add_key /* 285 */
1146 .long sys_request_key 1146 .long sys_request_key
1147 .long sys_keyctl 1147 .long sys_keyctl
1148 .long sys_ioprio_set
1149 .long sys_ioprio_get
1150 .long sys_inotify_init /* 290 */
1151 .long sys_inotify_add_watch
1152 .long sys_inotify_rm_watch
1148 1153
1149/* End of entry.S */ 1154/* End of entry.S */
diff --git a/arch/sh/kernel/process.c b/arch/sh/kernel/process.c
index 3d024590c24e..6dce9d0b81f8 100644
--- a/arch/sh/kernel/process.c
+++ b/arch/sh/kernel/process.c
@@ -80,8 +80,6 @@ void machine_restart(char * __unused)
80 "mov.l @%1, %0" : : "r" (0x10000000), "r" (0x80000001)); 80 "mov.l @%1, %0" : : "r" (0x10000000), "r" (0x80000001));
81} 81}
82 82
83EXPORT_SYMBOL(machine_restart);
84
85void machine_halt(void) 83void machine_halt(void)
86{ 84{
87#if defined(CONFIG_SH_HS7751RVOIP) 85#if defined(CONFIG_SH_HS7751RVOIP)
@@ -96,8 +94,6 @@ void machine_halt(void)
96 cpu_sleep(); 94 cpu_sleep();
97} 95}
98 96
99EXPORT_SYMBOL(machine_halt);
100
101void machine_power_off(void) 97void machine_power_off(void)
102{ 98{
103#if defined(CONFIG_SH_HS7751RVOIP) 99#if defined(CONFIG_SH_HS7751RVOIP)
@@ -110,8 +106,6 @@ void machine_power_off(void)
110#endif 106#endif
111} 107}
112 108
113EXPORT_SYMBOL(machine_power_off);
114
115void show_regs(struct pt_regs * regs) 109void show_regs(struct pt_regs * regs)
116{ 110{
117 printk("\n"); 111 printk("\n");
diff --git a/arch/sh/kernel/signal.c b/arch/sh/kernel/signal.c
index 06f1b47eded9..b475c4d2405f 100644
--- a/arch/sh/kernel/signal.c
+++ b/arch/sh/kernel/signal.c
@@ -546,13 +546,12 @@ handle_signal(unsigned long sig, struct k_sigaction *ka, siginfo_t *info,
546 if (ka->sa.sa_flags & SA_ONESHOT) 546 if (ka->sa.sa_flags & SA_ONESHOT)
547 ka->sa.sa_handler = SIG_DFL; 547 ka->sa.sa_handler = SIG_DFL;
548 548
549 if (!(ka->sa.sa_flags & SA_NODEFER)) { 549 spin_lock_irq(&current->sighand->siglock);
550 spin_lock_irq(&current->sighand->siglock); 550 sigorsets(&current->blocked,&current->blocked,&ka->sa.sa_mask);
551 sigorsets(&current->blocked,&current->blocked,&ka->sa.sa_mask); 551 if (!(ka->sa.sa_flags & SA_NODEFER))
552 sigaddset(&current->blocked,sig); 552 sigaddset(&current->blocked,sig);
553 recalc_sigpending(); 553 recalc_sigpending();
554 spin_unlock_irq(&current->sighand->siglock); 554 spin_unlock_irq(&current->sighand->siglock);
555 }
556} 555}
557 556
558/* 557/*
@@ -579,7 +578,7 @@ int do_signal(struct pt_regs *regs, sigset_t *oldset)
579 if (!user_mode(regs)) 578 if (!user_mode(regs))
580 return 1; 579 return 1;
581 580
582 if (try_to_freeze(0)) 581 if (try_to_freeze())
583 goto no_signal; 582 goto no_signal;
584 583
585 if (!oldset) 584 if (!oldset)
diff --git a/arch/sh64/Kconfig b/arch/sh64/Kconfig
index 708e59736a4d..fb35b45dc130 100644
--- a/arch/sh64/Kconfig
+++ b/arch/sh64/Kconfig
@@ -29,10 +29,6 @@ config GENERIC_CALIBRATE_DELAY
29 bool 29 bool
30 default y 30 default y
31 31
32config LOG_BUF_SHIFT
33 int
34 default 14
35
36config RWSEM_XCHGADD_ALGORITHM 32config RWSEM_XCHGADD_ALGORITHM
37 bool 33 bool
38 34
@@ -268,6 +264,8 @@ source "fs/Kconfig.binfmt"
268 264
269endmenu 265endmenu
270 266
267source "net/Kconfig"
268
271source "drivers/Kconfig" 269source "drivers/Kconfig"
272 270
273source "fs/Kconfig" 271source "fs/Kconfig"
diff --git a/arch/sh64/kernel/signal.c b/arch/sh64/kernel/signal.c
index 45ad1026dde7..3ea8929e483b 100644
--- a/arch/sh64/kernel/signal.c
+++ b/arch/sh64/kernel/signal.c
@@ -664,13 +664,12 @@ handle_signal(unsigned long sig, siginfo_t *info, struct k_sigaction *ka,
664 else 664 else
665 setup_frame(sig, ka, oldset, regs); 665 setup_frame(sig, ka, oldset, regs);
666 666
667 if (!(ka->sa.sa_flags & SA_NODEFER)) { 667 spin_lock_irq(&current->sighand->siglock);
668 spin_lock_irq(&current->sighand->siglock); 668 sigorsets(&current->blocked,&current->blocked,&ka->sa.sa_mask);
669 sigorsets(&current->blocked,&current->blocked,&ka->sa.sa_mask); 669 if (!(ka->sa.sa_flags & SA_NODEFER))
670 sigaddset(&current->blocked,sig); 670 sigaddset(&current->blocked,sig);
671 recalc_sigpending(); 671 recalc_sigpending();
672 spin_unlock_irq(&current->sighand->siglock); 672 spin_unlock_irq(&current->sighand->siglock);
673 }
674} 673}
675 674
676/* 675/*
@@ -697,7 +696,7 @@ int do_signal(struct pt_regs *regs, sigset_t *oldset)
697 if (!user_mode(regs)) 696 if (!user_mode(regs))
698 return 1; 697 return 1;
699 698
700 if (try_to_freeze(0)) 699 if (try_to_freeze())
701 goto no_signal; 700 goto no_signal;
702 701
703 if (!oldset) 702 if (!oldset)
diff --git a/arch/sh64/kernel/syscalls.S b/arch/sh64/kernel/syscalls.S
index 6aabc63e4518..a3d037805f1c 100644
--- a/arch/sh64/kernel/syscalls.S
+++ b/arch/sh64/kernel/syscalls.S
@@ -342,4 +342,9 @@ sys_call_table:
342 .long sys_add_key 342 .long sys_add_key
343 .long sys_request_key 343 .long sys_request_key
344 .long sys_keyctl /* 315 */ 344 .long sys_keyctl /* 315 */
345 .long sys_ioprio_set
346 .long sys_ioprio_get
347 .long sys_inotify_init
348 .long sys_inotify_add_watch
349 .long sys_inotify_rm_watch /* 320 */
345 350
diff --git a/arch/sh64/mm/fault.c b/arch/sh64/mm/fault.c
index a24932881dbb..f08d0eaf6497 100644
--- a/arch/sh64/mm/fault.c
+++ b/arch/sh64/mm/fault.c
@@ -223,13 +223,13 @@ good_area:
223 */ 223 */
224survive: 224survive:
225 switch (handle_mm_fault(mm, vma, address, writeaccess)) { 225 switch (handle_mm_fault(mm, vma, address, writeaccess)) {
226 case 1: 226 case VM_FAULT_MINOR:
227 tsk->min_flt++; 227 tsk->min_flt++;
228 break; 228 break;
229 case 2: 229 case VM_FAULT_MAJOR:
230 tsk->maj_flt++; 230 tsk->maj_flt++;
231 break; 231 break;
232 case 0: 232 case VM_FAULT_SIGBUS:
233 goto do_sigbus; 233 goto do_sigbus;
234 default: 234 default:
235 goto out_of_memory; 235 goto out_of_memory;
diff --git a/arch/sparc/Kconfig b/arch/sparc/Kconfig
index 7a117ef473c5..aca028aa29bf 100644
--- a/arch/sparc/Kconfig
+++ b/arch/sparc/Kconfig
@@ -268,6 +268,8 @@ source "mm/Kconfig"
268 268
269endmenu 269endmenu
270 270
271source "net/Kconfig"
272
271source "drivers/Kconfig" 273source "drivers/Kconfig"
272 274
273if !SUN4 275if !SUN4
diff --git a/arch/sparc/kernel/process.c b/arch/sparc/kernel/process.c
index 2c216ffeea90..29e72b57d4fd 100644
--- a/arch/sparc/kernel/process.c
+++ b/arch/sparc/kernel/process.c
@@ -158,8 +158,6 @@ void machine_halt(void)
158 panic("Halt failed!"); 158 panic("Halt failed!");
159} 159}
160 160
161EXPORT_SYMBOL(machine_halt);
162
163void machine_restart(char * cmd) 161void machine_restart(char * cmd)
164{ 162{
165 char *p; 163 char *p;
@@ -180,8 +178,6 @@ void machine_restart(char * cmd)
180 panic("Reboot failed!"); 178 panic("Reboot failed!");
181} 179}
182 180
183EXPORT_SYMBOL(machine_restart);
184
185void machine_power_off(void) 181void machine_power_off(void)
186{ 182{
187#ifdef CONFIG_SUN_AUXIO 183#ifdef CONFIG_SUN_AUXIO
@@ -191,8 +187,6 @@ void machine_power_off(void)
191 machine_halt(); 187 machine_halt();
192} 188}
193 189
194EXPORT_SYMBOL(machine_power_off);
195
196static DEFINE_SPINLOCK(sparc_backtrace_lock); 190static DEFINE_SPINLOCK(sparc_backtrace_lock);
197 191
198void __show_backtrace(unsigned long fp) 192void __show_backtrace(unsigned long fp)
diff --git a/arch/sparc/kernel/setup.c b/arch/sparc/kernel/setup.c
index 55352ed85e8a..53c192a4982f 100644
--- a/arch/sparc/kernel/setup.c
+++ b/arch/sparc/kernel/setup.c
@@ -32,7 +32,6 @@
32#include <linux/spinlock.h> 32#include <linux/spinlock.h>
33#include <linux/root_dev.h> 33#include <linux/root_dev.h>
34 34
35#include <asm/segment.h>
36#include <asm/system.h> 35#include <asm/system.h>
37#include <asm/io.h> 36#include <asm/io.h>
38#include <asm/processor.h> 37#include <asm/processor.h>
diff --git a/arch/sparc/kernel/signal.c b/arch/sparc/kernel/signal.c
index 011ff35057a5..5f34d7dc2b89 100644
--- a/arch/sparc/kernel/signal.c
+++ b/arch/sparc/kernel/signal.c
@@ -1034,13 +1034,12 @@ handle_signal(unsigned long signr, struct k_sigaction *ka,
1034 else 1034 else
1035 setup_frame(&ka->sa, regs, signr, oldset, info); 1035 setup_frame(&ka->sa, regs, signr, oldset, info);
1036 } 1036 }
1037 if (!(ka->sa.sa_flags & SA_NOMASK)) { 1037 spin_lock_irq(&current->sighand->siglock);
1038 spin_lock_irq(&current->sighand->siglock); 1038 sigorsets(&current->blocked,&current->blocked,&ka->sa.sa_mask);
1039 sigorsets(&current->blocked,&current->blocked,&ka->sa.sa_mask); 1039 if (!(ka->sa.sa_flags & SA_NOMASK))
1040 sigaddset(&current->blocked, signr); 1040 sigaddset(&current->blocked, signr);
1041 recalc_sigpending(); 1041 recalc_sigpending();
1042 spin_unlock_irq(&current->sighand->siglock); 1042 spin_unlock_irq(&current->sighand->siglock);
1043 }
1044} 1043}
1045 1044
1046static inline void syscall_restart(unsigned long orig_i0, struct pt_regs *regs, 1045static inline void syscall_restart(unsigned long orig_i0, struct pt_regs *regs,
diff --git a/arch/sparc/kernel/sparc_ksyms.c b/arch/sparc/kernel/sparc_ksyms.c
index 1bd430d0ca06..5d974a2b735a 100644
--- a/arch/sparc/kernel/sparc_ksyms.c
+++ b/arch/sparc/kernel/sparc_ksyms.c
@@ -98,8 +98,9 @@ extern void ___rw_write_enter(void);
98 * The module references will be fixed up by module_frob_arch_sections. 98 * The module references will be fixed up by module_frob_arch_sections.
99 */ 99 */
100#define DOT_ALIAS2(__ret, __x, __arg1, __arg2) \ 100#define DOT_ALIAS2(__ret, __x, __arg1, __arg2) \
101 extern __ret __x(__arg1, __arg2) \ 101 extern __ret __x(__arg1, __arg2); \
102 __attribute__((weak, alias("." # __x))); 102 asm(".weak " #__x);\
103 asm(#__x "=." #__x);
103 104
104DOT_ALIAS2(int, div, int, int) 105DOT_ALIAS2(int, div, int, int)
105DOT_ALIAS2(int, mul, int, int) 106DOT_ALIAS2(int, mul, int, int)
@@ -174,7 +175,6 @@ EXPORT_SYMBOL(set_auxio);
174EXPORT_SYMBOL(get_auxio); 175EXPORT_SYMBOL(get_auxio);
175#endif 176#endif
176EXPORT_SYMBOL(request_fast_irq); 177EXPORT_SYMBOL(request_fast_irq);
177EXPORT_SYMBOL(io_remap_page_range);
178EXPORT_SYMBOL(io_remap_pfn_range); 178EXPORT_SYMBOL(io_remap_pfn_range);
179 /* P3: iounit_xxx may be needed, sun4d users */ 179 /* P3: iounit_xxx may be needed, sun4d users */
180/* EXPORT_SYMBOL(iounit_map_dma_init); */ 180/* EXPORT_SYMBOL(iounit_map_dma_init); */
diff --git a/arch/sparc/kernel/systbls.S b/arch/sparc/kernel/systbls.S
index 025f4516e651..e457a40838fc 100644
--- a/arch/sparc/kernel/systbls.S
+++ b/arch/sparc/kernel/systbls.S
@@ -48,8 +48,8 @@ sys_call_table:
48/*135*/ .long sys_nis_syscall, sys_mkdir, sys_rmdir, sys_utimes, sys_stat64 48/*135*/ .long sys_nis_syscall, sys_mkdir, sys_rmdir, sys_utimes, sys_stat64
49/*140*/ .long sys_sendfile64, sys_nis_syscall, sys_futex, sys_gettid, sys_getrlimit 49/*140*/ .long sys_sendfile64, sys_nis_syscall, sys_futex, sys_gettid, sys_getrlimit
50/*145*/ .long sys_setrlimit, sys_pivot_root, sys_prctl, sys_pciconfig_read, sys_pciconfig_write 50/*145*/ .long sys_setrlimit, sys_pivot_root, sys_prctl, sys_pciconfig_read, sys_pciconfig_write
51/*150*/ .long sys_nis_syscall, sys_nis_syscall, sys_nis_syscall, sys_poll, sys_getdents64 51/*150*/ .long sys_nis_syscall, sys_inotify_init, sys_inotify_add_watch, sys_poll, sys_getdents64
52/*155*/ .long sys_fcntl64, sys_ni_syscall, sys_statfs, sys_fstatfs, sys_oldumount 52/*155*/ .long sys_fcntl64, sys_inotify_rm_watch, sys_statfs, sys_fstatfs, sys_oldumount
53/*160*/ .long sys_sched_setaffinity, sys_sched_getaffinity, sys_getdomainname, sys_setdomainname, sys_nis_syscall 53/*160*/ .long sys_sched_setaffinity, sys_sched_getaffinity, sys_getdomainname, sys_setdomainname, sys_nis_syscall
54/*165*/ .long sys_quotactl, sys_set_tid_address, sys_mount, sys_ustat, sys_setxattr 54/*165*/ .long sys_quotactl, sys_set_tid_address, sys_mount, sys_ustat, sys_setxattr
55/*170*/ .long sys_lsetxattr, sys_fsetxattr, sys_getxattr, sys_lgetxattr, sys_getdents 55/*170*/ .long sys_lsetxattr, sys_fsetxattr, sys_getxattr, sys_lgetxattr, sys_getdents
diff --git a/arch/sparc/kernel/tick14.c b/arch/sparc/kernel/tick14.c
index fd8005a3e6bd..591547af4c65 100644
--- a/arch/sparc/kernel/tick14.c
+++ b/arch/sparc/kernel/tick14.c
@@ -19,7 +19,6 @@
19#include <linux/interrupt.h> 19#include <linux/interrupt.h>
20 20
21#include <asm/oplib.h> 21#include <asm/oplib.h>
22#include <asm/segment.h>
23#include <asm/timer.h> 22#include <asm/timer.h>
24#include <asm/mostek.h> 23#include <asm/mostek.h>
25#include <asm/system.h> 24#include <asm/system.h>
diff --git a/arch/sparc/kernel/time.c b/arch/sparc/kernel/time.c
index 6486cbf2efe9..3b759aefc170 100644
--- a/arch/sparc/kernel/time.c
+++ b/arch/sparc/kernel/time.c
@@ -32,7 +32,6 @@
32#include <linux/profile.h> 32#include <linux/profile.h>
33 33
34#include <asm/oplib.h> 34#include <asm/oplib.h>
35#include <asm/segment.h>
36#include <asm/timer.h> 35#include <asm/timer.h>
37#include <asm/mostek.h> 36#include <asm/mostek.h>
38#include <asm/system.h> 37#include <asm/system.h>
diff --git a/arch/sparc/mm/fault.c b/arch/sparc/mm/fault.c
index 37f4107bae66..2bbd53f3cafb 100644
--- a/arch/sparc/mm/fault.c
+++ b/arch/sparc/mm/fault.c
@@ -23,7 +23,6 @@
23#include <linux/module.h> 23#include <linux/module.h>
24 24
25#include <asm/system.h> 25#include <asm/system.h>
26#include <asm/segment.h>
27#include <asm/page.h> 26#include <asm/page.h>
28#include <asm/pgtable.h> 27#include <asm/pgtable.h>
29#include <asm/memreg.h> 28#include <asm/memreg.h>
diff --git a/arch/sparc/mm/generic.c b/arch/sparc/mm/generic.c
index db27eee3bda1..20ccb957fb77 100644
--- a/arch/sparc/mm/generic.c
+++ b/arch/sparc/mm/generic.c
@@ -16,31 +16,6 @@
16#include <asm/cacheflush.h> 16#include <asm/cacheflush.h>
17#include <asm/tlbflush.h> 17#include <asm/tlbflush.h>
18 18
19static inline void forget_pte(pte_t page)
20{
21#if 0 /* old 2.4 code */
22 if (pte_none(page))
23 return;
24 if (pte_present(page)) {
25 unsigned long pfn = pte_pfn(page);
26 struct page *ptpage;
27 if (!pfn_valid(pfn))
28 return;
29 ptpage = pfn_to_page(pfn);
30 if (PageReserved(ptpage))
31 return;
32 page_cache_release(ptpage);
33 return;
34 }
35 swap_free(pte_to_swp_entry(page));
36#else
37 if (!pte_none(page)) {
38 printk("forget_pte: old mapping existed!\n");
39 BUG();
40 }
41#endif
42}
43
44/* Remap IO memory, the same way as remap_pfn_range(), but use 19/* Remap IO memory, the same way as remap_pfn_range(), but use
45 * the obio memory space. 20 * the obio memory space.
46 * 21 *
@@ -60,7 +35,6 @@ static inline void io_remap_pte_range(struct mm_struct *mm, pte_t * pte, unsigne
60 pte_t oldpage = *pte; 35 pte_t oldpage = *pte;
61 pte_clear(mm, address, pte); 36 pte_clear(mm, address, pte);
62 set_pte(pte, mk_pte_io(offset, prot, space)); 37 set_pte(pte, mk_pte_io(offset, prot, space));
63 forget_pte(oldpage);
64 address += PAGE_SIZE; 38 address += PAGE_SIZE;
65 offset += PAGE_SIZE; 39 offset += PAGE_SIZE;
66 pte++; 40 pte++;
@@ -88,37 +62,6 @@ static inline int io_remap_pmd_range(struct mm_struct *mm, pmd_t * pmd, unsigned
88 return 0; 62 return 0;
89} 63}
90 64
91int io_remap_page_range(struct vm_area_struct *vma, unsigned long from, unsigned long offset, unsigned long size, pgprot_t prot, int space)
92{
93 int error = 0;
94 pgd_t * dir;
95 unsigned long beg = from;
96 unsigned long end = from + size;
97 struct mm_struct *mm = vma->vm_mm;
98
99 prot = __pgprot(pg_iobits);
100 offset -= from;
101 dir = pgd_offset(mm, from);
102 flush_cache_range(vma, beg, end);
103
104 spin_lock(&mm->page_table_lock);
105 while (from < end) {
106 pmd_t *pmd = pmd_alloc(current->mm, dir, from);
107 error = -ENOMEM;
108 if (!pmd)
109 break;
110 error = io_remap_pmd_range(mm, pmd, from, end - from, offset + from, prot, space);
111 if (error)
112 break;
113 from = (from + PGDIR_SIZE) & PGDIR_MASK;
114 dir++;
115 }
116 spin_unlock(&mm->page_table_lock);
117
118 flush_tlb_range(vma, beg, end);
119 return error;
120}
121
122int io_remap_pfn_range(struct vm_area_struct *vma, unsigned long from, 65int io_remap_pfn_range(struct vm_area_struct *vma, unsigned long from,
123 unsigned long pfn, unsigned long size, pgprot_t prot) 66 unsigned long pfn, unsigned long size, pgprot_t prot)
124{ 67{
diff --git a/arch/sparc/mm/init.c b/arch/sparc/mm/init.c
index ec2e05028a10..c03babaa0498 100644
--- a/arch/sparc/mm/init.c
+++ b/arch/sparc/mm/init.c
@@ -25,7 +25,6 @@
25#include <linux/bootmem.h> 25#include <linux/bootmem.h>
26 26
27#include <asm/system.h> 27#include <asm/system.h>
28#include <asm/segment.h>
29#include <asm/vac-ops.h> 28#include <asm/vac-ops.h>
30#include <asm/page.h> 29#include <asm/page.h>
31#include <asm/pgtable.h> 30#include <asm/pgtable.h>
diff --git a/arch/sparc64/Kconfig b/arch/sparc64/Kconfig
index 6a4733683f0f..73ec6aec5ed5 100644
--- a/arch/sparc64/Kconfig
+++ b/arch/sparc64/Kconfig
@@ -5,6 +5,16 @@
5 5
6mainmenu "Linux/UltraSPARC Kernel Configuration" 6mainmenu "Linux/UltraSPARC Kernel Configuration"
7 7
8config SPARC64
9 bool
10 default y
11 help
12 SPARC is a family of RISC microprocessors designed and marketed by
13 Sun Microsystems, incorporated. This port covers the newer 64-bit
14 UltraSPARC. The UltraLinux project maintains both the SPARC32 and
15 SPARC64 ports; its web page is available at
16 <http://www.ultralinux.org/>.
17
8config 64BIT 18config 64BIT
9 def_bool y 19 def_bool y
10 20
@@ -71,75 +81,6 @@ config SYSVIPC_COMPAT
71 81
72menu "General machine setup" 82menu "General machine setup"
73 83
74config BBC_I2C
75 tristate "UltraSPARC-III bootbus i2c controller driver"
76 depends on PCI
77 help
78 The BBC devices on the UltraSPARC III have two I2C controllers. The
79 first I2C controller connects mainly to configuration PROMs (NVRAM,
80 CPU configuration, DIMM types, etc.). The second I2C controller
81 connects to environmental control devices such as fans and
82 temperature sensors. The second controller also connects to the
83 smartcard reader, if present. Say Y to enable support for these.
84
85config VT
86 bool "Virtual terminal" if EMBEDDED
87 select INPUT
88 default y
89 ---help---
90 If you say Y here, you will get support for terminal devices with
91 display and keyboard devices. These are called "virtual" because you
92 can run several virtual terminals (also called virtual consoles) on
93 one physical terminal. This is rather useful, for example one
94 virtual terminal can collect system messages and warnings, another
95 one can be used for a text-mode user session, and a third could run
96 an X session, all in parallel. Switching between virtual terminals
97 is done with certain key combinations, usually Alt-<function key>.
98
99 The setterm command ("man setterm") can be used to change the
100 properties (such as colors or beeping) of a virtual terminal. The
101 man page console_codes(4) ("man console_codes") contains the special
102 character sequences that can be used to change those properties
103 directly. The fonts used on virtual terminals can be changed with
104 the setfont ("man setfont") command and the key bindings are defined
105 with the loadkeys ("man loadkeys") command.
106
107 You need at least one virtual terminal device in order to make use
108 of your keyboard and monitor. Therefore, only people configuring an
109 embedded system would want to say N here in order to save some
110 memory; the only way to log into such a system is then via a serial
111 or network connection.
112
113 If unsure, say Y, or else you won't be able to do much with your new
114 shiny Linux system :-)
115
116config VT_CONSOLE
117 bool "Support for console on virtual terminal" if EMBEDDED
118 depends on VT
119 default y
120 ---help---
121 The system console is the device which receives all kernel messages
122 and warnings and which allows logins in single user mode. If you
123 answer Y here, a virtual terminal (the device used to interact with
124 a physical terminal) can be used as system console. This is the most
125 common mode of operations, so you should say Y here unless you want
126 the kernel messages be output only to a serial port (in which case
127 you should say Y to "Console on serial port", below).
128
129 If you do say Y here, by default the currently visible virtual
130 terminal (/dev/tty0) will be used as system console. You can change
131 that with a kernel command line option such as "console=tty3" which
132 would use the third virtual terminal as system console. (Try "man
133 bootparam" or see the documentation of your boot loader (lilo or
134 loadlin) about how to pass options to the kernel at boot time.)
135
136 If unsure, say Y.
137
138config HW_CONSOLE
139 bool
140 depends on VT
141 default y
142
143config SMP 84config SMP
144 bool "Symmetric multi-processing support" 85 bool "Symmetric multi-processing support"
145 ---help--- 86 ---help---
@@ -205,17 +146,6 @@ config US2E_FREQ
205 146
206 If in doubt, say N. 147 If in doubt, say N.
207 148
208# Identify this as a Sparc64 build
209config SPARC64
210 bool
211 default y
212 help
213 SPARC is a family of RISC microprocessors designed and marketed by
214 Sun Microsystems, incorporated. This port covers the newer 64-bit
215 UltraSPARC. The UltraLinux project maintains both the SPARC32 and
216 SPARC64 ports; its web page is available at
217 <http://www.ultralinux.org/>.
218
219# Global things across all Sun machines. 149# Global things across all Sun machines.
220config RWSEM_GENERIC_SPINLOCK 150config RWSEM_GENERIC_SPINLOCK
221 bool 151 bool
@@ -246,6 +176,10 @@ config HUGETLB_PAGE_SIZE_64K
246 176
247endchoice 177endchoice
248 178
179endmenu
180
181source "mm/Kconfig"
182
249config GENERIC_ISA_DMA 183config GENERIC_ISA_DMA
250 bool 184 bool
251 default y 185 default y
@@ -344,33 +278,6 @@ config PCI_DOMAINS
344 bool 278 bool
345 default PCI 279 default PCI
346 280
347config RTC
348 tristate
349 depends on PCI
350 default y
351 ---help---
352 If you say Y here and create a character special file /dev/rtc with
353 major number 10 and minor number 135 using mknod ("man mknod"), you
354 will get access to the real time clock (or hardware clock) built
355 into your computer.
356
357 Every PC has such a clock built in. It can be used to generate
358 signals from as low as 1Hz up to 8192Hz, and can also be used
359 as a 24 hour alarm. It reports status information via the file
360 /proc/driver/rtc and its behaviour is set by various ioctls on
361 /dev/rtc.
362
363 If you run Linux on a multiprocessor machine and said Y to
364 "Symmetric Multi Processing" above, you should say Y here to read
365 and set the RTC in an SMP compatible fashion.
366
367 If you think you have a use for such a device (such as periodic data
368 sampling), then say Y here, and read <file:Documentation/rtc.txt>
369 for details.
370
371 To compile this driver as a module, choose M here: the
372 module will be called rtc.
373
374source "drivers/pci/Kconfig" 281source "drivers/pci/Kconfig"
375 282
376config SUN_OPENPROMFS 283config SUN_OPENPROMFS
@@ -414,6 +321,8 @@ config BINFMT_AOUT32
414 If you want to run SunOS binaries (see SunOS binary emulation below) 321 If you want to run SunOS binaries (see SunOS binary emulation below)
415 or other a.out binaries, say Y. If unsure, say N. 322 or other a.out binaries, say Y. If unsure, say N.
416 323
324menu "Executable file formats"
325
417source "fs/Kconfig.binfmt" 326source "fs/Kconfig.binfmt"
418 327
419config SUNOS_EMUL 328config SUNOS_EMUL
@@ -436,74 +345,7 @@ config SOLARIS_EMUL
436 To compile this code as a module, choose M here: the 345 To compile this code as a module, choose M here: the
437 module will be called solaris. 346 module will be called solaris.
438 347
439source "drivers/parport/Kconfig" 348endmenu
440
441config PRINTER
442 tristate "Parallel printer support"
443 depends on PARPORT
444 ---help---
445 If you intend to attach a printer to the parallel port of your Linux
446 box (as opposed to using a serial printer; if the connector at the
447 printer has 9 or 25 holes ["female"], then it's serial), say Y.
448 Also read the Printing-HOWTO, available from
449 <http://www.tldp.org/docs.html#howto>.
450
451 It is possible to share one parallel port among several devices
452 (e.g. printer and ZIP drive) and it is safe to compile the
453 corresponding drivers into the kernel.
454 To compile this driver as a module, choose M here and read
455 <file:Documentation/parport.txt>. The module will be called lp.
456
457 If you have several parallel ports, you can specify which ports to
458 use with the "lp" kernel command line option. (Try "man bootparam"
459 or see the documentation of your boot loader (lilo or loadlin) about
460 how to pass options to the kernel at boot time.) The syntax of the
461 "lp" command line option can be found in <file:drivers/char/lp.c>.
462
463 If you have more than 8 printers, you need to increase the LP_NO
464 macro in lp.c and the PARPORT_MAX macro in parport.h.
465
466config PPDEV
467 tristate "Support for user-space parallel port device drivers"
468 depends on PARPORT
469 ---help---
470 Saying Y to this adds support for /dev/parport device nodes. This
471 is needed for programs that want portable access to the parallel
472 port, for instance deviceid (which displays Plug-and-Play device
473 IDs).
474
475 This is the parallel port equivalent of SCSI generic support (sg).
476 It is safe to say N to this -- it is not needed for normal printing
477 or parallel port CD-ROM/disk support.
478
479 To compile this driver as a module, choose M here: the
480 module will be called ppdev.
481
482 If unsure, say N.
483
484config ENVCTRL
485 tristate "SUNW, envctrl support"
486 depends on PCI
487 help
488 Kernel support for temperature and fan monitoring on Sun SME
489 machines.
490
491 To compile this driver as a module, choose M here: the
492 module will be called envctrl.
493
494config DISPLAY7SEG
495 tristate "7-Segment Display support"
496 depends on PCI
497 ---help---
498 This is the driver for the 7-segment display and LED present on
499 Sun Microsystems CompactPCI models CP1400 and CP1500.
500
501 To compile this driver as a module, choose M here: the
502 module will be called display7seg.
503
504 If you do not have a CompactPCI model CP1400 or CP1500, or
505 another UltraSPARC-IIi-cEngine boardset with a 7-segment display,
506 you should say N to this option.
507 349
508config CMDLINE_BOOL 350config CMDLINE_BOOL
509 bool "Default bootloader kernel arguments" 351 bool "Default bootloader kernel arguments"
@@ -521,144 +363,16 @@ config CMDLINE
521 363
522 NOTE: This option WILL override the PROM bootargs setting! 364 NOTE: This option WILL override the PROM bootargs setting!
523 365
524source "mm/Kconfig" 366source "net/Kconfig"
525
526endmenu
527
528source "drivers/base/Kconfig"
529
530source "drivers/video/Kconfig"
531 367
532source "drivers/serial/Kconfig" 368source "drivers/Kconfig"
533 369
534source "drivers/sbus/char/Kconfig" 370source "drivers/sbus/char/Kconfig"
535 371
536source "drivers/mtd/Kconfig"
537
538source "drivers/block/Kconfig"
539
540source "drivers/ide/Kconfig"
541
542source "drivers/scsi/Kconfig"
543
544source "drivers/fc4/Kconfig" 372source "drivers/fc4/Kconfig"
545 373
546source "drivers/md/Kconfig"
547
548if PCI
549source "drivers/message/fusion/Kconfig"
550endif
551
552source "drivers/ieee1394/Kconfig"
553
554source "net/Kconfig"
555
556source "drivers/isdn/Kconfig"
557
558source "drivers/telephony/Kconfig"
559
560# This one must be before the filesystem configs. -DaveM
561
562menu "Unix98 PTY support"
563
564config UNIX98_PTYS
565 bool "Unix98 PTY support"
566 ---help---
567 A pseudo terminal (PTY) is a software device consisting of two
568 halves: a master and a slave. The slave device behaves identical to
569 a physical terminal; the master device is used by a process to
570 read data from and write data to the slave, thereby emulating a
571 terminal. Typical programs for the master side are telnet servers
572 and xterms.
573
574 Linux has traditionally used the BSD-like names /dev/ptyxx for
575 masters and /dev/ttyxx for slaves of pseudo terminals. This scheme
576 has a number of problems. The GNU C library glibc 2.1 and later,
577 however, supports the Unix98 naming standard: in order to acquire a
578 pseudo terminal, a process opens /dev/ptmx; the number of the pseudo
579 terminal is then made available to the process and the pseudo
580 terminal slave can be accessed as /dev/pts/<number>. What was
581 traditionally /dev/ttyp2 will then be /dev/pts/2, for example.
582
583 The entries in /dev/pts/ are created on the fly by a virtual
584 file system; therefore, if you say Y here you should say Y to
585 "/dev/pts file system for Unix98 PTYs" as well.
586
587 If you want to say Y here, you need to have the C library glibc 2.1
588 or later (equal to libc-6.1, check with "ls -l /lib/libc.so.*").
589 Read the instructions in <file:Documentation/Changes> pertaining to
590 pseudo terminals. It's safe to say N.
591
592config UNIX98_PTY_COUNT
593 int "Maximum number of Unix98 PTYs in use (0-2048)"
594 depends on UNIX98_PTYS
595 default "256"
596 help
597 The maximum number of Unix98 PTYs that can be used at any one time.
598 The default is 256, and should be enough for desktop systems. Server
599 machines which support incoming telnet/rlogin/ssh connections and/or
600 serve several X terminals may want to increase this: every incoming
601 connection and every xterm uses up one PTY.
602
603 When not in use, each additional set of 256 PTYs occupy
604 approximately 8 KB of kernel memory on 32-bit architectures.
605
606endmenu
607
608menu "XFree86 DRI support"
609
610config DRM
611 bool "Direct Rendering Manager (XFree86 DRI support)"
612 help
613 Kernel-level support for the Direct Rendering Infrastructure (DRI)
614 introduced in XFree86 4.0. If you say Y here, you need to select
615 the module that's right for your graphics card from the list below.
616 These modules provide support for synchronization, security, and
617 DMA transfers. Please see <http://dri.sourceforge.net/> for more
618 details. You should also select and configure AGP
619 (/dev/agpgart) support.
620
621config DRM_FFB
622 tristate "Creator/Creator3D"
623 depends on DRM && BROKEN
624 help
625 Choose this option if you have one of Sun's Creator3D-based graphics
626 and frame buffer cards. Product page at
627 <http://www.sun.com/desktop/products/Graphics/creator3d.html>.
628
629config DRM_TDFX
630 tristate "3dfx Banshee/Voodoo3+"
631 depends on DRM
632 help
633 Choose this option if you have a 3dfx Banshee or Voodoo3 (or later),
634 graphics card. If M is selected, the module will be called tdfx.
635
636config DRM_R128
637 tristate "ATI Rage 128"
638 depends on DRM
639 help
640 Choose this option if you have an ATI Rage 128 graphics card. If M
641 is selected, the module will be called r128. AGP support for
642 this card is strongly suggested (unless you have a PCI version).
643
644endmenu
645
646source "drivers/input/Kconfig"
647
648source "drivers/i2c/Kconfig"
649
650source "fs/Kconfig" 374source "fs/Kconfig"
651 375
652source "drivers/media/Kconfig"
653
654source "sound/Kconfig"
655
656source "drivers/usb/Kconfig"
657
658source "drivers/infiniband/Kconfig"
659
660source "drivers/char/watchdog/Kconfig"
661
662source "arch/sparc64/oprofile/Kconfig" 376source "arch/sparc64/oprofile/Kconfig"
663 377
664source "arch/sparc64/Kconfig.debug" 378source "arch/sparc64/Kconfig.debug"
diff --git a/arch/sparc64/kernel/Makefile b/arch/sparc64/kernel/Makefile
index 093281bdf85f..6f00ab8b9d23 100644
--- a/arch/sparc64/kernel/Makefile
+++ b/arch/sparc64/kernel/Makefile
@@ -8,7 +8,7 @@ EXTRA_CFLAGS := -Werror
8extra-y := head.o init_task.o vmlinux.lds 8extra-y := head.o init_task.o vmlinux.lds
9 9
10obj-y := process.o setup.o cpu.o idprom.o \ 10obj-y := process.o setup.o cpu.o idprom.o \
11 traps.o devices.o auxio.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
diff --git a/arch/sparc64/kernel/entry.S b/arch/sparc64/kernel/entry.S
index d781f10adc52..3e0badb820c5 100644
--- a/arch/sparc64/kernel/entry.S
+++ b/arch/sparc64/kernel/entry.S
@@ -21,6 +21,7 @@
21#include <asm/visasm.h> 21#include <asm/visasm.h>
22#include <asm/estate.h> 22#include <asm/estate.h>
23#include <asm/auxio.h> 23#include <asm/auxio.h>
24#include <asm/sfafsr.h>
24 25
25#define curptr g6 26#define curptr g6
26 27
@@ -690,14 +691,159 @@ netbsd_syscall:
690 retl 691 retl
691 nop 692 nop
692 693
693 /* These next few routines must be sure to clear the 694 /* We need to carefully read the error status, ACK
694 * SFSR FaultValid bit so that the fast tlb data protection 695 * the errors, prevent recursive traps, and pass the
695 * handler does not flush the wrong context and lock up the 696 * information on to C code for logging.
696 * box. 697 *
698 * We pass the AFAR in as-is, and we encode the status
699 * information as described in asm-sparc64/sfafsr.h
700 */
701 .globl __spitfire_access_error
702__spitfire_access_error:
703 /* Disable ESTATE error reporting so that we do not
704 * take recursive traps and RED state the processor.
705 */
706 stxa %g0, [%g0] ASI_ESTATE_ERROR_EN
707 membar #Sync
708
709 mov UDBE_UE, %g1
710 ldxa [%g0] ASI_AFSR, %g4 ! Get AFSR
711
712 /* __spitfire_cee_trap branches here with AFSR in %g4 and
713 * UDBE_CE in %g1. It only clears ESTATE_ERR_CE in the
714 * ESTATE Error Enable register.
715 */
716__spitfire_cee_trap_continue:
717 ldxa [%g0] ASI_AFAR, %g5 ! Get AFAR
718
719 rdpr %tt, %g3
720 and %g3, 0x1ff, %g3 ! Paranoia
721 sllx %g3, SFSTAT_TRAP_TYPE_SHIFT, %g3
722 or %g4, %g3, %g4
723 rdpr %tl, %g3
724 cmp %g3, 1
725 mov 1, %g3
726 bleu %xcc, 1f
727 sllx %g3, SFSTAT_TL_GT_ONE_SHIFT, %g3
728
729 or %g4, %g3, %g4
730
731 /* Read in the UDB error register state, clearing the
732 * sticky error bits as-needed. We only clear them if
733 * the UE bit is set. Likewise, __spitfire_cee_trap
734 * below will only do so if the CE bit is set.
735 *
736 * NOTE: UltraSparc-I/II have high and low UDB error
737 * registers, corresponding to the two UDB units
738 * present on those chips. UltraSparc-IIi only
739 * has a single UDB, called "SDB" in the manual.
740 * For IIi the upper UDB register always reads
741 * as zero so for our purposes things will just
742 * work with the checks below.
743 */
7441: ldxa [%g0] ASI_UDBH_ERROR_R, %g3
745 and %g3, 0x3ff, %g7 ! Paranoia
746 sllx %g7, SFSTAT_UDBH_SHIFT, %g7
747 or %g4, %g7, %g4
748 andcc %g3, %g1, %g3 ! UDBE_UE or UDBE_CE
749 be,pn %xcc, 1f
750 nop
751 stxa %g3, [%g0] ASI_UDB_ERROR_W
752 membar #Sync
753
7541: mov 0x18, %g3
755 ldxa [%g3] ASI_UDBL_ERROR_R, %g3
756 and %g3, 0x3ff, %g7 ! Paranoia
757 sllx %g7, SFSTAT_UDBL_SHIFT, %g7
758 or %g4, %g7, %g4
759 andcc %g3, %g1, %g3 ! UDBE_UE or UDBE_CE
760 be,pn %xcc, 1f
761 nop
762 mov 0x18, %g7
763 stxa %g3, [%g7] ASI_UDB_ERROR_W
764 membar #Sync
765
7661: /* Ok, now that we've latched the error state,
767 * clear the sticky bits in the AFSR.
768 */
769 stxa %g4, [%g0] ASI_AFSR
770 membar #Sync
771
772 rdpr %tl, %g2
773 cmp %g2, 1
774 rdpr %pil, %g2
775 bleu,pt %xcc, 1f
776 wrpr %g0, 15, %pil
777
778 ba,pt %xcc, etraptl1
779 rd %pc, %g7
780
781 ba,pt %xcc, 2f
782 nop
783
7841: ba,pt %xcc, etrap_irq
785 rd %pc, %g7
786
7872: mov %l4, %o1
788 mov %l5, %o2
789 call spitfire_access_error
790 add %sp, PTREGS_OFF, %o0
791 ba,pt %xcc, rtrap
792 clr %l6
793
794 /* This is the trap handler entry point for ECC correctable
795 * errors. They are corrected, but we listen for the trap
796 * so that the event can be logged.
797 *
798 * Disrupting errors are either:
799 * 1) single-bit ECC errors during UDB reads to system
800 * memory
801 * 2) data parity errors during write-back events
802 *
803 * As far as I can make out from the manual, the CEE trap
804 * is only for correctable errors during memory read
805 * accesses by the front-end of the processor.
806 *
807 * The code below is only for trap level 1 CEE events,
808 * as it is the only situation where we can safely record
809 * and log. For trap level >1 we just clear the CE bit
810 * in the AFSR and return.
811 *
812 * This is just like __spiftire_access_error above, but it
813 * specifically handles correctable errors. If an
814 * uncorrectable error is indicated in the AFSR we
815 * will branch directly above to __spitfire_access_error
816 * to handle it instead. Uncorrectable therefore takes
817 * priority over correctable, and the error logging
818 * C code will notice this case by inspecting the
819 * trap type.
820 */
821 .globl __spitfire_cee_trap
822__spitfire_cee_trap:
823 ldxa [%g0] ASI_AFSR, %g4 ! Get AFSR
824 mov 1, %g3
825 sllx %g3, SFAFSR_UE_SHIFT, %g3
826 andcc %g4, %g3, %g0 ! Check for UE
827 bne,pn %xcc, __spitfire_access_error
828 nop
829
830 /* Ok, in this case we only have a correctable error.
831 * Indicate we only wish to capture that state in register
832 * %g1, and we only disable CE error reporting unlike UE
833 * handling which disables all errors.
697 */ 834 */
698 .globl __do_data_access_exception 835 ldxa [%g0] ASI_ESTATE_ERROR_EN, %g3
699 .globl __do_data_access_exception_tl1 836 andn %g3, ESTATE_ERR_CE, %g3
700__do_data_access_exception_tl1: 837 stxa %g3, [%g0] ASI_ESTATE_ERROR_EN
838 membar #Sync
839
840 /* Preserve AFSR in %g4, indicate UDB state to capture in %g1 */
841 ba,pt %xcc, __spitfire_cee_trap_continue
842 mov UDBE_CE, %g1
843
844 .globl __spitfire_data_access_exception
845 .globl __spitfire_data_access_exception_tl1
846__spitfire_data_access_exception_tl1:
701 rdpr %pstate, %g4 847 rdpr %pstate, %g4
702 wrpr %g4, PSTATE_MG|PSTATE_AG, %pstate 848 wrpr %g4, PSTATE_MG|PSTATE_AG, %pstate
703 mov TLB_SFSR, %g3 849 mov TLB_SFSR, %g3
@@ -706,9 +852,25 @@ __do_data_access_exception_tl1:
706 ldxa [%g5] ASI_DMMU, %g5 ! Get SFAR 852 ldxa [%g5] ASI_DMMU, %g5 ! Get SFAR
707 stxa %g0, [%g3] ASI_DMMU ! Clear SFSR.FaultValid bit 853 stxa %g0, [%g3] ASI_DMMU ! Clear SFSR.FaultValid bit
708 membar #Sync 854 membar #Sync
855 rdpr %tt, %g3
856 cmp %g3, 0x80 ! first win spill/fill trap
857 blu,pn %xcc, 1f
858 cmp %g3, 0xff ! last win spill/fill trap
859 bgu,pn %xcc, 1f
860 nop
709 ba,pt %xcc, winfix_dax 861 ba,pt %xcc, winfix_dax
710 rdpr %tpc, %g3 862 rdpr %tpc, %g3
711__do_data_access_exception: 8631: sethi %hi(109f), %g7
864 ba,pt %xcc, etraptl1
865109: or %g7, %lo(109b), %g7
866 mov %l4, %o1
867 mov %l5, %o2
868 call spitfire_data_access_exception_tl1
869 add %sp, PTREGS_OFF, %o0
870 ba,pt %xcc, rtrap
871 clr %l6
872
873__spitfire_data_access_exception:
712 rdpr %pstate, %g4 874 rdpr %pstate, %g4
713 wrpr %g4, PSTATE_MG|PSTATE_AG, %pstate 875 wrpr %g4, PSTATE_MG|PSTATE_AG, %pstate
714 mov TLB_SFSR, %g3 876 mov TLB_SFSR, %g3
@@ -722,20 +884,19 @@ __do_data_access_exception:
722109: or %g7, %lo(109b), %g7 884109: or %g7, %lo(109b), %g7
723 mov %l4, %o1 885 mov %l4, %o1
724 mov %l5, %o2 886 mov %l5, %o2
725 call data_access_exception 887 call spitfire_data_access_exception
726 add %sp, PTREGS_OFF, %o0 888 add %sp, PTREGS_OFF, %o0
727 ba,pt %xcc, rtrap 889 ba,pt %xcc, rtrap
728 clr %l6 890 clr %l6
729 891
730 .globl __do_instruction_access_exception 892 .globl __spitfire_insn_access_exception
731 .globl __do_instruction_access_exception_tl1 893 .globl __spitfire_insn_access_exception_tl1
732__do_instruction_access_exception_tl1: 894__spitfire_insn_access_exception_tl1:
733 rdpr %pstate, %g4 895 rdpr %pstate, %g4
734 wrpr %g4, PSTATE_MG|PSTATE_AG, %pstate 896 wrpr %g4, PSTATE_MG|PSTATE_AG, %pstate
735 mov TLB_SFSR, %g3 897 mov TLB_SFSR, %g3
736 mov DMMU_SFAR, %g5 898 ldxa [%g3] ASI_IMMU, %g4 ! Get SFSR
737 ldxa [%g3] ASI_DMMU, %g4 ! Get SFSR 899 rdpr %tpc, %g5 ! IMMU has no SFAR, use TPC
738 ldxa [%g5] ASI_DMMU, %g5 ! Get SFAR
739 stxa %g0, [%g3] ASI_IMMU ! Clear FaultValid bit 900 stxa %g0, [%g3] ASI_IMMU ! Clear FaultValid bit
740 membar #Sync 901 membar #Sync
741 sethi %hi(109f), %g7 902 sethi %hi(109f), %g7
@@ -743,18 +904,17 @@ __do_instruction_access_exception_tl1:
743109: or %g7, %lo(109b), %g7 904109: or %g7, %lo(109b), %g7
744 mov %l4, %o1 905 mov %l4, %o1
745 mov %l5, %o2 906 mov %l5, %o2
746 call instruction_access_exception_tl1 907 call spitfire_insn_access_exception_tl1
747 add %sp, PTREGS_OFF, %o0 908 add %sp, PTREGS_OFF, %o0
748 ba,pt %xcc, rtrap 909 ba,pt %xcc, rtrap
749 clr %l6 910 clr %l6
750 911
751__do_instruction_access_exception: 912__spitfire_insn_access_exception:
752 rdpr %pstate, %g4 913 rdpr %pstate, %g4
753 wrpr %g4, PSTATE_MG|PSTATE_AG, %pstate 914 wrpr %g4, PSTATE_MG|PSTATE_AG, %pstate
754 mov TLB_SFSR, %g3 915 mov TLB_SFSR, %g3
755 mov DMMU_SFAR, %g5 916 ldxa [%g3] ASI_IMMU, %g4 ! Get SFSR
756 ldxa [%g3] ASI_DMMU, %g4 ! Get SFSR 917 rdpr %tpc, %g5 ! IMMU has no SFAR, use TPC
757 ldxa [%g5] ASI_DMMU, %g5 ! Get SFAR
758 stxa %g0, [%g3] ASI_IMMU ! Clear FaultValid bit 918 stxa %g0, [%g3] ASI_IMMU ! Clear FaultValid bit
759 membar #Sync 919 membar #Sync
760 sethi %hi(109f), %g7 920 sethi %hi(109f), %g7
@@ -762,235 +922,11 @@ __do_instruction_access_exception:
762109: or %g7, %lo(109b), %g7 922109: or %g7, %lo(109b), %g7
763 mov %l4, %o1 923 mov %l4, %o1
764 mov %l5, %o2 924 mov %l5, %o2
765 call instruction_access_exception 925 call spitfire_insn_access_exception
766 add %sp, PTREGS_OFF, %o0 926 add %sp, PTREGS_OFF, %o0
767 ba,pt %xcc, rtrap 927 ba,pt %xcc, rtrap
768 clr %l6 928 clr %l6
769 929
770 /* This is the trap handler entry point for ECC correctable
771 * errors. They are corrected, but we listen for the trap
772 * so that the event can be logged.
773 *
774 * Disrupting errors are either:
775 * 1) single-bit ECC errors during UDB reads to system
776 * memory
777 * 2) data parity errors during write-back events
778 *
779 * As far as I can make out from the manual, the CEE trap
780 * is only for correctable errors during memory read
781 * accesses by the front-end of the processor.
782 *
783 * The code below is only for trap level 1 CEE events,
784 * as it is the only situation where we can safely record
785 * and log. For trap level >1 we just clear the CE bit
786 * in the AFSR and return.
787 */
788
789 /* Our trap handling infrastructure allows us to preserve
790 * two 64-bit values during etrap for arguments to
791 * subsequent C code. Therefore we encode the information
792 * as follows:
793 *
794 * value 1) Full 64-bits of AFAR
795 * value 2) Low 33-bits of AFSR, then bits 33-->42
796 * are UDBL error status and bits 43-->52
797 * are UDBH error status
798 */
799 .align 64
800 .globl cee_trap
801cee_trap:
802 ldxa [%g0] ASI_AFSR, %g1 ! Read AFSR
803 ldxa [%g0] ASI_AFAR, %g2 ! Read AFAR
804 sllx %g1, 31, %g1 ! Clear reserved bits
805 srlx %g1, 31, %g1 ! in AFSR
806
807 /* NOTE: UltraSparc-I/II have high and low UDB error
808 * registers, corresponding to the two UDB units
809 * present on those chips. UltraSparc-IIi only
810 * has a single UDB, called "SDB" in the manual.
811 * For IIi the upper UDB register always reads
812 * as zero so for our purposes things will just
813 * work with the checks below.
814 */
815 ldxa [%g0] ASI_UDBL_ERROR_R, %g3 ! Read UDB-Low error status
816 andcc %g3, (1 << 8), %g4 ! Check CE bit
817 sllx %g3, (64 - 10), %g3 ! Clear reserved bits
818 srlx %g3, (64 - 10), %g3 ! in UDB-Low error status
819
820 sllx %g3, (33 + 0), %g3 ! Shift up to encoding area
821 or %g1, %g3, %g1 ! Or it in
822 be,pn %xcc, 1f ! Branch if CE bit was clear
823 nop
824 stxa %g4, [%g0] ASI_UDB_ERROR_W ! Clear CE sticky bit in UDBL
825 membar #Sync ! Synchronize ASI stores
8261: mov 0x18, %g5 ! Addr of UDB-High error status
827 ldxa [%g5] ASI_UDBH_ERROR_R, %g3 ! Read it
828
829 andcc %g3, (1 << 8), %g4 ! Check CE bit
830 sllx %g3, (64 - 10), %g3 ! Clear reserved bits
831 srlx %g3, (64 - 10), %g3 ! in UDB-High error status
832 sllx %g3, (33 + 10), %g3 ! Shift up to encoding area
833 or %g1, %g3, %g1 ! Or it in
834 be,pn %xcc, 1f ! Branch if CE bit was clear
835 nop
836 nop
837
838 stxa %g4, [%g5] ASI_UDB_ERROR_W ! Clear CE sticky bit in UDBH
839 membar #Sync ! Synchronize ASI stores
8401: mov 1, %g5 ! AFSR CE bit is
841 sllx %g5, 20, %g5 ! bit 20
842 stxa %g5, [%g0] ASI_AFSR ! Clear CE sticky bit in AFSR
843 membar #Sync ! Synchronize ASI stores
844 sllx %g2, (64 - 41), %g2 ! Clear reserved bits
845 srlx %g2, (64 - 41), %g2 ! in latched AFAR
846
847 andn %g2, 0x0f, %g2 ! Finish resv bit clearing
848 mov %g1, %g4 ! Move AFSR+UDB* into save reg
849 mov %g2, %g5 ! Move AFAR into save reg
850 rdpr %pil, %g2
851 wrpr %g0, 15, %pil
852 ba,pt %xcc, etrap_irq
853 rd %pc, %g7
854 mov %l4, %o0
855
856 mov %l5, %o1
857 call cee_log
858 add %sp, PTREGS_OFF, %o2
859 ba,a,pt %xcc, rtrap_irq
860
861 /* Capture I/D/E-cache state into per-cpu error scoreboard.
862 *
863 * %g1: (TL>=0) ? 1 : 0
864 * %g2: scratch
865 * %g3: scratch
866 * %g4: AFSR
867 * %g5: AFAR
868 * %g6: current thread ptr
869 * %g7: scratch
870 */
871#define CHEETAH_LOG_ERROR \
872 /* Put "TL1" software bit into AFSR. */ \
873 and %g1, 0x1, %g1; \
874 sllx %g1, 63, %g2; \
875 or %g4, %g2, %g4; \
876 /* Get log entry pointer for this cpu at this trap level. */ \
877 BRANCH_IF_JALAPENO(g2,g3,50f) \
878 ldxa [%g0] ASI_SAFARI_CONFIG, %g2; \
879 srlx %g2, 17, %g2; \
880 ba,pt %xcc, 60f; \
881 and %g2, 0x3ff, %g2; \
88250: ldxa [%g0] ASI_JBUS_CONFIG, %g2; \
883 srlx %g2, 17, %g2; \
884 and %g2, 0x1f, %g2; \
88560: sllx %g2, 9, %g2; \
886 sethi %hi(cheetah_error_log), %g3; \
887 ldx [%g3 + %lo(cheetah_error_log)], %g3; \
888 brz,pn %g3, 80f; \
889 nop; \
890 add %g3, %g2, %g3; \
891 sllx %g1, 8, %g1; \
892 add %g3, %g1, %g1; \
893 /* %g1 holds pointer to the top of the logging scoreboard */ \
894 ldx [%g1 + 0x0], %g7; \
895 cmp %g7, -1; \
896 bne,pn %xcc, 80f; \
897 nop; \
898 stx %g4, [%g1 + 0x0]; \
899 stx %g5, [%g1 + 0x8]; \
900 add %g1, 0x10, %g1; \
901 /* %g1 now points to D-cache logging area */ \
902 set 0x3ff8, %g2; /* DC_addr mask */ \
903 and %g5, %g2, %g2; /* DC_addr bits of AFAR */ \
904 srlx %g5, 12, %g3; \
905 or %g3, 1, %g3; /* PHYS tag + valid */ \
90610: ldxa [%g2] ASI_DCACHE_TAG, %g7; \
907 cmp %g3, %g7; /* TAG match? */ \
908 bne,pt %xcc, 13f; \
909 nop; \
910 /* Yep, what we want, capture state. */ \
911 stx %g2, [%g1 + 0x20]; \
912 stx %g7, [%g1 + 0x28]; \
913 /* A membar Sync is required before and after utag access. */ \
914 membar #Sync; \
915 ldxa [%g2] ASI_DCACHE_UTAG, %g7; \
916 membar #Sync; \
917 stx %g7, [%g1 + 0x30]; \
918 ldxa [%g2] ASI_DCACHE_SNOOP_TAG, %g7; \
919 stx %g7, [%g1 + 0x38]; \
920 clr %g3; \
92112: ldxa [%g2 + %g3] ASI_DCACHE_DATA, %g7; \
922 stx %g7, [%g1]; \
923 add %g3, (1 << 5), %g3; \
924 cmp %g3, (4 << 5); \
925 bl,pt %xcc, 12b; \
926 add %g1, 0x8, %g1; \
927 ba,pt %xcc, 20f; \
928 add %g1, 0x20, %g1; \
92913: sethi %hi(1 << 14), %g7; \
930 add %g2, %g7, %g2; \
931 srlx %g2, 14, %g7; \
932 cmp %g7, 4; \
933 bl,pt %xcc, 10b; \
934 nop; \
935 add %g1, 0x40, %g1; \
93620: /* %g1 now points to I-cache logging area */ \
937 set 0x1fe0, %g2; /* IC_addr mask */ \
938 and %g5, %g2, %g2; /* IC_addr bits of AFAR */ \
939 sllx %g2, 1, %g2; /* IC_addr[13:6]==VA[12:5] */ \
940 srlx %g5, (13 - 8), %g3; /* Make PTAG */ \
941 andn %g3, 0xff, %g3; /* Mask off undefined bits */ \
94221: ldxa [%g2] ASI_IC_TAG, %g7; \
943 andn %g7, 0xff, %g7; \
944 cmp %g3, %g7; \
945 bne,pt %xcc, 23f; \
946 nop; \
947 /* Yep, what we want, capture state. */ \
948 stx %g2, [%g1 + 0x40]; \
949 stx %g7, [%g1 + 0x48]; \
950 add %g2, (1 << 3), %g2; \
951 ldxa [%g2] ASI_IC_TAG, %g7; \
952 add %g2, (1 << 3), %g2; \
953 stx %g7, [%g1 + 0x50]; \
954 ldxa [%g2] ASI_IC_TAG, %g7; \
955 add %g2, (1 << 3), %g2; \
956 stx %g7, [%g1 + 0x60]; \
957 ldxa [%g2] ASI_IC_TAG, %g7; \
958 stx %g7, [%g1 + 0x68]; \
959 sub %g2, (3 << 3), %g2; \
960 ldxa [%g2] ASI_IC_STAG, %g7; \
961 stx %g7, [%g1 + 0x58]; \
962 clr %g3; \
963 srlx %g2, 2, %g2; \
96422: ldxa [%g2 + %g3] ASI_IC_INSTR, %g7; \
965 stx %g7, [%g1]; \
966 add %g3, (1 << 3), %g3; \
967 cmp %g3, (8 << 3); \
968 bl,pt %xcc, 22b; \
969 add %g1, 0x8, %g1; \
970 ba,pt %xcc, 30f; \
971 add %g1, 0x30, %g1; \
97223: sethi %hi(1 << 14), %g7; \
973 add %g2, %g7, %g2; \
974 srlx %g2, 14, %g7; \
975 cmp %g7, 4; \
976 bl,pt %xcc, 21b; \
977 nop; \
978 add %g1, 0x70, %g1; \
97930: /* %g1 now points to E-cache logging area */ \
980 andn %g5, (32 - 1), %g2; /* E-cache subblock */ \
981 stx %g2, [%g1 + 0x20]; \
982 ldxa [%g2] ASI_EC_TAG_DATA, %g7; \
983 stx %g7, [%g1 + 0x28]; \
984 ldxa [%g2] ASI_EC_R, %g0; \
985 clr %g3; \
98631: ldxa [%g3] ASI_EC_DATA, %g7; \
987 stx %g7, [%g1 + %g3]; \
988 add %g3, 0x8, %g3; \
989 cmp %g3, 0x20; \
990 bl,pt %xcc, 31b; \
991 nop; \
99280: /* DONE */
993
994 /* These get patched into the trap table at boot time 930 /* These get patched into the trap table at boot time
995 * once we know we have a cheetah processor. 931 * once we know we have a cheetah processor.
996 */ 932 */
@@ -1227,6 +1163,170 @@ dcpe_icpe_tl1_common:
1227 membar #Sync 1163 membar #Sync
1228 retry 1164 retry
1229 1165
1166 /* Capture I/D/E-cache state into per-cpu error scoreboard.
1167 *
1168 * %g1: (TL>=0) ? 1 : 0
1169 * %g2: scratch
1170 * %g3: scratch
1171 * %g4: AFSR
1172 * %g5: AFAR
1173 * %g6: current thread ptr
1174 * %g7: scratch
1175 */
1176__cheetah_log_error:
1177 /* Put "TL1" software bit into AFSR. */
1178 and %g1, 0x1, %g1
1179 sllx %g1, 63, %g2
1180 or %g4, %g2, %g4
1181
1182 /* Get log entry pointer for this cpu at this trap level. */
1183 BRANCH_IF_JALAPENO(g2,g3,50f)
1184 ldxa [%g0] ASI_SAFARI_CONFIG, %g2
1185 srlx %g2, 17, %g2
1186 ba,pt %xcc, 60f
1187 and %g2, 0x3ff, %g2
1188
118950: ldxa [%g0] ASI_JBUS_CONFIG, %g2
1190 srlx %g2, 17, %g2
1191 and %g2, 0x1f, %g2
1192
119360: sllx %g2, 9, %g2
1194 sethi %hi(cheetah_error_log), %g3
1195 ldx [%g3 + %lo(cheetah_error_log)], %g3
1196 brz,pn %g3, 80f
1197 nop
1198
1199 add %g3, %g2, %g3
1200 sllx %g1, 8, %g1
1201 add %g3, %g1, %g1
1202
1203 /* %g1 holds pointer to the top of the logging scoreboard */
1204 ldx [%g1 + 0x0], %g7
1205 cmp %g7, -1
1206 bne,pn %xcc, 80f
1207 nop
1208
1209 stx %g4, [%g1 + 0x0]
1210 stx %g5, [%g1 + 0x8]
1211 add %g1, 0x10, %g1
1212
1213 /* %g1 now points to D-cache logging area */
1214 set 0x3ff8, %g2 /* DC_addr mask */
1215 and %g5, %g2, %g2 /* DC_addr bits of AFAR */
1216 srlx %g5, 12, %g3
1217 or %g3, 1, %g3 /* PHYS tag + valid */
1218
121910: ldxa [%g2] ASI_DCACHE_TAG, %g7
1220 cmp %g3, %g7 /* TAG match? */
1221 bne,pt %xcc, 13f
1222 nop
1223
1224 /* Yep, what we want, capture state. */
1225 stx %g2, [%g1 + 0x20]
1226 stx %g7, [%g1 + 0x28]
1227
1228 /* A membar Sync is required before and after utag access. */
1229 membar #Sync
1230 ldxa [%g2] ASI_DCACHE_UTAG, %g7
1231 membar #Sync
1232 stx %g7, [%g1 + 0x30]
1233 ldxa [%g2] ASI_DCACHE_SNOOP_TAG, %g7
1234 stx %g7, [%g1 + 0x38]
1235 clr %g3
1236
123712: ldxa [%g2 + %g3] ASI_DCACHE_DATA, %g7
1238 stx %g7, [%g1]
1239 add %g3, (1 << 5), %g3
1240 cmp %g3, (4 << 5)
1241 bl,pt %xcc, 12b
1242 add %g1, 0x8, %g1
1243
1244 ba,pt %xcc, 20f
1245 add %g1, 0x20, %g1
1246
124713: sethi %hi(1 << 14), %g7
1248 add %g2, %g7, %g2
1249 srlx %g2, 14, %g7
1250 cmp %g7, 4
1251 bl,pt %xcc, 10b
1252 nop
1253
1254 add %g1, 0x40, %g1
1255
1256 /* %g1 now points to I-cache logging area */
125720: set 0x1fe0, %g2 /* IC_addr mask */
1258 and %g5, %g2, %g2 /* IC_addr bits of AFAR */
1259 sllx %g2, 1, %g2 /* IC_addr[13:6]==VA[12:5] */
1260 srlx %g5, (13 - 8), %g3 /* Make PTAG */
1261 andn %g3, 0xff, %g3 /* Mask off undefined bits */
1262
126321: ldxa [%g2] ASI_IC_TAG, %g7
1264 andn %g7, 0xff, %g7
1265 cmp %g3, %g7
1266 bne,pt %xcc, 23f
1267 nop
1268
1269 /* Yep, what we want, capture state. */
1270 stx %g2, [%g1 + 0x40]
1271 stx %g7, [%g1 + 0x48]
1272 add %g2, (1 << 3), %g2
1273 ldxa [%g2] ASI_IC_TAG, %g7
1274 add %g2, (1 << 3), %g2
1275 stx %g7, [%g1 + 0x50]
1276 ldxa [%g2] ASI_IC_TAG, %g7
1277 add %g2, (1 << 3), %g2
1278 stx %g7, [%g1 + 0x60]
1279 ldxa [%g2] ASI_IC_TAG, %g7
1280 stx %g7, [%g1 + 0x68]
1281 sub %g2, (3 << 3), %g2
1282 ldxa [%g2] ASI_IC_STAG, %g7
1283 stx %g7, [%g1 + 0x58]
1284 clr %g3
1285 srlx %g2, 2, %g2
1286
128722: ldxa [%g2 + %g3] ASI_IC_INSTR, %g7
1288 stx %g7, [%g1]
1289 add %g3, (1 << 3), %g3
1290 cmp %g3, (8 << 3)
1291 bl,pt %xcc, 22b
1292 add %g1, 0x8, %g1
1293
1294 ba,pt %xcc, 30f
1295 add %g1, 0x30, %g1
1296
129723: sethi %hi(1 << 14), %g7
1298 add %g2, %g7, %g2
1299 srlx %g2, 14, %g7
1300 cmp %g7, 4
1301 bl,pt %xcc, 21b
1302 nop
1303
1304 add %g1, 0x70, %g1
1305
1306 /* %g1 now points to E-cache logging area */
130730: andn %g5, (32 - 1), %g2
1308 stx %g2, [%g1 + 0x20]
1309 ldxa [%g2] ASI_EC_TAG_DATA, %g7
1310 stx %g7, [%g1 + 0x28]
1311 ldxa [%g2] ASI_EC_R, %g0
1312 clr %g3
1313
131431: ldxa [%g3] ASI_EC_DATA, %g7
1315 stx %g7, [%g1 + %g3]
1316 add %g3, 0x8, %g3
1317 cmp %g3, 0x20
1318
1319 bl,pt %xcc, 31b
1320 nop
132180:
1322 rdpr %tt, %g2
1323 cmp %g2, 0x70
1324 be c_fast_ecc
1325 cmp %g2, 0x63
1326 be c_cee
1327 nop
1328 ba,pt %xcc, c_deferred
1329
1230 /* Cheetah FECC trap handling, we get here from tl{0,1}_fecc 1330 /* Cheetah FECC trap handling, we get here from tl{0,1}_fecc
1231 * in the trap table. That code has done a memory barrier 1331 * in the trap table. That code has done a memory barrier
1232 * and has disabled both the I-cache and D-cache in the DCU 1332 * and has disabled both the I-cache and D-cache in the DCU
@@ -1252,8 +1352,10 @@ cheetah_fast_ecc:
1252 stxa %g4, [%g0] ASI_AFSR 1352 stxa %g4, [%g0] ASI_AFSR
1253 membar #Sync 1353 membar #Sync
1254 1354
1255 CHEETAH_LOG_ERROR 1355 ba,pt %xcc, __cheetah_log_error
1356 nop
1256 1357
1358c_fast_ecc:
1257 rdpr %pil, %g2 1359 rdpr %pil, %g2
1258 wrpr %g0, 15, %pil 1360 wrpr %g0, 15, %pil
1259 ba,pt %xcc, etrap_irq 1361 ba,pt %xcc, etrap_irq
@@ -1278,8 +1380,10 @@ cheetah_cee:
1278 stxa %g4, [%g0] ASI_AFSR 1380 stxa %g4, [%g0] ASI_AFSR
1279 membar #Sync 1381 membar #Sync
1280 1382
1281 CHEETAH_LOG_ERROR 1383 ba,pt %xcc, __cheetah_log_error
1384 nop
1282 1385
1386c_cee:
1283 rdpr %pil, %g2 1387 rdpr %pil, %g2
1284 wrpr %g0, 15, %pil 1388 wrpr %g0, 15, %pil
1285 ba,pt %xcc, etrap_irq 1389 ba,pt %xcc, etrap_irq
@@ -1304,8 +1408,10 @@ cheetah_deferred_trap:
1304 stxa %g4, [%g0] ASI_AFSR 1408 stxa %g4, [%g0] ASI_AFSR
1305 membar #Sync 1409 membar #Sync
1306 1410
1307 CHEETAH_LOG_ERROR 1411 ba,pt %xcc, __cheetah_log_error
1412 nop
1308 1413
1414c_deferred:
1309 rdpr %pil, %g2 1415 rdpr %pil, %g2
1310 wrpr %g0, 15, %pil 1416 wrpr %g0, 15, %pil
1311 ba,pt %xcc, etrap_irq 1417 ba,pt %xcc, etrap_irq
@@ -1600,11 +1706,11 @@ sys_clone: flushw
1600 ba,pt %xcc, sparc_do_fork 1706 ba,pt %xcc, sparc_do_fork
1601 add %sp, PTREGS_OFF, %o2 1707 add %sp, PTREGS_OFF, %o2
1602ret_from_syscall: 1708ret_from_syscall:
1603 /* Clear SPARC_FLAG_NEWCHILD, switch_to leaves thread.flags in 1709 /* Clear current_thread_info()->new_child, and
1604 * %o7 for us. Check performance counter stuff too. 1710 * check performance counter stuff too.
1605 */ 1711 */
1606 andn %o7, _TIF_NEWCHILD, %l0 1712 stb %g0, [%g6 + TI_NEW_CHILD]
1607 stx %l0, [%g6 + TI_FLAGS] 1713 ldx [%g6 + TI_FLAGS], %l0
1608 call schedule_tail 1714 call schedule_tail
1609 mov %g7, %o0 1715 mov %g7, %o0
1610 andcc %l0, _TIF_PERFCTR, %g0 1716 andcc %l0, _TIF_PERFCTR, %g0
@@ -1720,12 +1826,11 @@ ret_sys_call:
1720 /* Check if force_successful_syscall_return() 1826 /* Check if force_successful_syscall_return()
1721 * was invoked. 1827 * was invoked.
1722 */ 1828 */
1723 ldx [%curptr + TI_FLAGS], %l0 1829 ldub [%curptr + TI_SYS_NOERROR], %l0
1724 andcc %l0, _TIF_SYSCALL_SUCCESS, %g0 1830 brz,pt %l0, 1f
1725 be,pt %icc, 1f 1831 nop
1726 andn %l0, _TIF_SYSCALL_SUCCESS, %l0
1727 ba,pt %xcc, 80f 1832 ba,pt %xcc, 80f
1728 stx %l0, [%curptr + TI_FLAGS] 1833 stb %g0, [%curptr + TI_SYS_NOERROR]
1729 1834
17301: 18351:
1731 cmp %o0, -ERESTART_RESTARTBLOCK 1836 cmp %o0, -ERESTART_RESTARTBLOCK
diff --git a/arch/sparc64/kernel/head.S b/arch/sparc64/kernel/head.S
index 8104a56ca2d8..1fa06c4e3bdb 100644
--- a/arch/sparc64/kernel/head.S
+++ b/arch/sparc64/kernel/head.S
@@ -538,11 +538,12 @@ cheetah_tlb_fixup:
538 nop 538 nop
539 call cheetah_plus_patch_winfixup 539 call cheetah_plus_patch_winfixup
540 nop 540 nop
541
542 541
5432: /* Patch copy/page operations to cheetah optimized versions. */ 5422: /* Patch copy/page operations to cheetah optimized versions. */
544 call cheetah_patch_copyops 543 call cheetah_patch_copyops
545 nop 544 nop
545 call cheetah_patch_copy_page
546 nop
546 call cheetah_patch_cachetlbops 547 call cheetah_patch_cachetlbops
547 nop 548 nop
548 549
diff --git a/arch/sparc64/kernel/irq.c b/arch/sparc64/kernel/irq.c
index daa2fb93052c..c9b69167632a 100644
--- a/arch/sparc64/kernel/irq.c
+++ b/arch/sparc64/kernel/irq.c
@@ -782,8 +782,14 @@ static void distribute_irqs(void)
782} 782}
783#endif 783#endif
784 784
785struct sun5_timer {
786 u64 count0;
787 u64 limit0;
788 u64 count1;
789 u64 limit1;
790};
785 791
786struct sun5_timer *prom_timers; 792static struct sun5_timer *prom_timers;
787static u64 prom_limit0, prom_limit1; 793static u64 prom_limit0, prom_limit1;
788 794
789static void map_prom_timers(void) 795static void map_prom_timers(void)
@@ -839,18 +845,6 @@ static void kill_prom_timer(void)
839 : "g1", "g2"); 845 : "g1", "g2");
840} 846}
841 847
842void enable_prom_timer(void)
843{
844 if (!prom_timers)
845 return;
846
847 /* Set it to whatever was there before. */
848 prom_timers->limit1 = prom_limit1;
849 prom_timers->count1 = 0;
850 prom_timers->limit0 = prom_limit0;
851 prom_timers->count0 = 0;
852}
853
854void init_irqwork_curcpu(void) 848void init_irqwork_curcpu(void)
855{ 849{
856 register struct irq_work_struct *workp asm("o2"); 850 register struct irq_work_struct *workp asm("o2");
diff --git a/arch/sparc64/kernel/pci.c b/arch/sparc64/kernel/pci.c
index bba140d98b1b..ec8bf4012c0c 100644
--- a/arch/sparc64/kernel/pci.c
+++ b/arch/sparc64/kernel/pci.c
@@ -540,6 +540,7 @@ void pcibios_bus_to_resource(struct pci_dev *pdev, struct resource *res,
540 540
541 pbm->parent->resource_adjust(pdev, res, root); 541 pbm->parent->resource_adjust(pdev, res, root);
542} 542}
543EXPORT_SYMBOL(pcibios_bus_to_resource);
543 544
544char * __init pcibios_setup(char *str) 545char * __init pcibios_setup(char *str)
545{ 546{
@@ -735,8 +736,7 @@ static void __pci_mmap_set_flags(struct pci_dev *dev, struct vm_area_struct *vma
735static void __pci_mmap_set_pgprot(struct pci_dev *dev, struct vm_area_struct *vma, 736static void __pci_mmap_set_pgprot(struct pci_dev *dev, struct vm_area_struct *vma,
736 enum pci_mmap_state mmap_state) 737 enum pci_mmap_state mmap_state)
737{ 738{
738 /* Our io_remap_page_range/io_remap_pfn_range takes care of this, 739 /* Our io_remap_pfn_range takes care of this, do nothing. */
739 do nothing. */
740} 740}
741 741
742/* Perform the actual remap of the pages for a PCI device mapping, as appropriate 742/* Perform the actual remap of the pages for a PCI device mapping, as appropriate
diff --git a/arch/sparc64/kernel/pci_iommu.c b/arch/sparc64/kernel/pci_iommu.c
index 2803bc7c2c79..425c60cfea19 100644
--- a/arch/sparc64/kernel/pci_iommu.c
+++ b/arch/sparc64/kernel/pci_iommu.c
@@ -466,7 +466,7 @@ do_flush_sync:
466 if (!limit) 466 if (!limit)
467 break; 467 break;
468 udelay(1); 468 udelay(1);
469 membar("#LoadLoad"); 469 rmb();
470 } 470 }
471 if (!limit) 471 if (!limit)
472 printk(KERN_WARNING "pci_strbuf_flush: flushflag timeout " 472 printk(KERN_WARNING "pci_strbuf_flush: flushflag timeout "
diff --git a/arch/sparc64/kernel/power.c b/arch/sparc64/kernel/power.c
index 533104c7907d..946cee0257ea 100644
--- a/arch/sparc64/kernel/power.c
+++ b/arch/sparc64/kernel/power.c
@@ -69,8 +69,6 @@ void machine_power_off(void)
69 machine_halt(); 69 machine_halt();
70} 70}
71 71
72EXPORT_SYMBOL(machine_power_off);
73
74#ifdef CONFIG_PCI 72#ifdef CONFIG_PCI
75static int powerd(void *__unused) 73static int powerd(void *__unused)
76{ 74{
diff --git a/arch/sparc64/kernel/process.c b/arch/sparc64/kernel/process.c
index a0cd2b2494d6..66255434128a 100644
--- a/arch/sparc64/kernel/process.c
+++ b/arch/sparc64/kernel/process.c
@@ -103,7 +103,7 @@ void cpu_idle(void)
103 * other cpus see our increasing idleness for the buddy 103 * other cpus see our increasing idleness for the buddy
104 * redistribution algorithm. -DaveM 104 * redistribution algorithm. -DaveM
105 */ 105 */
106 membar("#StoreStore | #StoreLoad"); 106 membar_storeload_storestore();
107 } 107 }
108} 108}
109 109
@@ -124,8 +124,6 @@ void machine_halt(void)
124 panic("Halt failed!"); 124 panic("Halt failed!");
125} 125}
126 126
127EXPORT_SYMBOL(machine_halt);
128
129void machine_alt_power_off(void) 127void machine_alt_power_off(void)
130{ 128{
131 if (!serial_console && prom_palette) 129 if (!serial_console && prom_palette)
@@ -154,8 +152,6 @@ void machine_restart(char * cmd)
154 panic("Reboot failed!"); 152 panic("Reboot failed!");
155} 153}
156 154
157EXPORT_SYMBOL(machine_restart);
158
159static void show_regwindow32(struct pt_regs *regs) 155static void show_regwindow32(struct pt_regs *regs)
160{ 156{
161 struct reg_window32 __user *rw; 157 struct reg_window32 __user *rw;
@@ -621,8 +617,8 @@ int copy_thread(int nr, unsigned long clone_flags, unsigned long sp,
621 memcpy(child_trap_frame, (((struct sparc_stackf *)regs)-1), (TRACEREG_SZ+STACKFRAME_SZ)); 617 memcpy(child_trap_frame, (((struct sparc_stackf *)regs)-1), (TRACEREG_SZ+STACKFRAME_SZ));
622 618
623 t->flags = (t->flags & ~((0xffUL << TI_FLAG_CWP_SHIFT) | (0xffUL << TI_FLAG_CURRENT_DS_SHIFT))) | 619 t->flags = (t->flags & ~((0xffUL << TI_FLAG_CWP_SHIFT) | (0xffUL << TI_FLAG_CURRENT_DS_SHIFT))) |
624 _TIF_NEWCHILD |
625 (((regs->tstate + 1) & TSTATE_CWP) << TI_FLAG_CWP_SHIFT); 620 (((regs->tstate + 1) & TSTATE_CWP) << TI_FLAG_CWP_SHIFT);
621 t->new_child = 1;
626 t->ksp = ((unsigned long) child_trap_frame) - STACK_BIAS; 622 t->ksp = ((unsigned long) child_trap_frame) - STACK_BIAS;
627 t->kregs = (struct pt_regs *)(child_trap_frame+sizeof(struct sparc_stackf)); 623 t->kregs = (struct pt_regs *)(child_trap_frame+sizeof(struct sparc_stackf));
628 t->fpsaved[0] = 0; 624 t->fpsaved[0] = 0;
diff --git a/arch/sparc64/kernel/rtrap.S b/arch/sparc64/kernel/rtrap.S
index 0696ed4b9d64..fafd227735fa 100644
--- a/arch/sparc64/kernel/rtrap.S
+++ b/arch/sparc64/kernel/rtrap.S
@@ -153,11 +153,14 @@ __handle_signal:
153rtrap_irq: 153rtrap_irq:
154rtrap_clr_l6: clr %l6 154rtrap_clr_l6: clr %l6
155rtrap: 155rtrap:
156 ldub [%g6 + TI_CPU], %l0 156#ifndef CONFIG_SMP
157 sethi %hi(irq_stat), %l2 ! &softirq_active 157 sethi %hi(per_cpu____cpu_data), %l0
158 or %l2, %lo(irq_stat), %l2 ! &softirq_active 158 lduw [%l0 + %lo(per_cpu____cpu_data)], %l1
159irqsz_patchme: sllx %l0, 0, %l0 159#else
160 lduw [%l2 + %l0], %l1 ! softirq_pending 160 sethi %hi(per_cpu____cpu_data), %l0
161 or %l0, %lo(per_cpu____cpu_data), %l0
162 lduw [%l0 + %g5], %l1
163#endif
161 cmp %l1, 0 164 cmp %l1, 0
162 165
163 /* mm/ultra.S:xcall_report_regs KNOWS about this load. */ 166 /* mm/ultra.S:xcall_report_regs KNOWS about this load. */
diff --git a/arch/sparc64/kernel/sbus.c b/arch/sparc64/kernel/sbus.c
index 89f5e019f24c..e09ddf927655 100644
--- a/arch/sparc64/kernel/sbus.c
+++ b/arch/sparc64/kernel/sbus.c
@@ -147,7 +147,7 @@ static void sbus_strbuf_flush(struct sbus_iommu *iommu, u32 base, unsigned long
147 if (!limit) 147 if (!limit)
148 break; 148 break;
149 udelay(1); 149 udelay(1);
150 membar("#LoadLoad"); 150 rmb();
151 } 151 }
152 if (!limit) 152 if (!limit)
153 printk(KERN_WARNING "sbus_strbuf_flush: flushflag timeout " 153 printk(KERN_WARNING "sbus_strbuf_flush: flushflag timeout "
diff --git a/arch/sparc64/kernel/setup.c b/arch/sparc64/kernel/setup.c
index b7e6a91952b2..ddbed3341a23 100644
--- a/arch/sparc64/kernel/setup.c
+++ b/arch/sparc64/kernel/setup.c
@@ -33,7 +33,6 @@
33#include <linux/cpu.h> 33#include <linux/cpu.h>
34#include <linux/initrd.h> 34#include <linux/initrd.h>
35 35
36#include <asm/segment.h>
37#include <asm/system.h> 36#include <asm/system.h>
38#include <asm/io.h> 37#include <asm/io.h>
39#include <asm/processor.h> 38#include <asm/processor.h>
@@ -512,18 +511,6 @@ void __init setup_arch(char **cmdline_p)
512 conswitchp = &prom_con; 511 conswitchp = &prom_con;
513#endif 512#endif
514 513
515#ifdef CONFIG_SMP
516 i = (unsigned long)&irq_stat[1] - (unsigned long)&irq_stat[0];
517 if ((i == SMP_CACHE_BYTES) || (i == (2 * SMP_CACHE_BYTES))) {
518 extern unsigned int irqsz_patchme[1];
519 irqsz_patchme[0] |= ((i == SMP_CACHE_BYTES) ? SMP_CACHE_BYTES_SHIFT : \
520 SMP_CACHE_BYTES_SHIFT + 1);
521 flushi((long)&irqsz_patchme[0]);
522 } else {
523 prom_printf("Unexpected size of irq_stat[] elements\n");
524 prom_halt();
525 }
526#endif
527 /* Work out if we are starfire early on */ 514 /* Work out if we are starfire early on */
528 check_if_starfire(); 515 check_if_starfire();
529 516
diff --git a/arch/sparc64/kernel/signal.c b/arch/sparc64/kernel/signal.c
index b27934671c35..60f5dfabb1e1 100644
--- a/arch/sparc64/kernel/signal.c
+++ b/arch/sparc64/kernel/signal.c
@@ -574,13 +574,12 @@ static inline void handle_signal(unsigned long signr, struct k_sigaction *ka,
574{ 574{
575 setup_rt_frame(ka, regs, signr, oldset, 575 setup_rt_frame(ka, regs, signr, oldset,
576 (ka->sa.sa_flags & SA_SIGINFO) ? info : NULL); 576 (ka->sa.sa_flags & SA_SIGINFO) ? info : NULL);
577 if (!(ka->sa.sa_flags & SA_NOMASK)) { 577 spin_lock_irq(&current->sighand->siglock);
578 spin_lock_irq(&current->sighand->siglock); 578 sigorsets(&current->blocked,&current->blocked,&ka->sa.sa_mask);
579 sigorsets(&current->blocked,&current->blocked,&ka->sa.sa_mask); 579 if (!(ka->sa.sa_flags & SA_NOMASK))
580 sigaddset(&current->blocked,signr); 580 sigaddset(&current->blocked,signr);
581 recalc_sigpending(); 581 recalc_sigpending();
582 spin_unlock_irq(&current->sighand->siglock); 582 spin_unlock_irq(&current->sighand->siglock);
583 }
584} 583}
585 584
586static inline void syscall_restart(unsigned long orig_i0, struct pt_regs *regs, 585static inline void syscall_restart(unsigned long orig_i0, struct pt_regs *regs,
diff --git a/arch/sparc64/kernel/signal32.c b/arch/sparc64/kernel/signal32.c
index f28428f4170e..aecccd0df1d1 100644
--- a/arch/sparc64/kernel/signal32.c
+++ b/arch/sparc64/kernel/signal32.c
@@ -877,11 +877,12 @@ static void new_setup_frame32(struct k_sigaction *ka, struct pt_regs *regs,
877 unsigned long page = (unsigned long) 877 unsigned long page = (unsigned long)
878 page_address(pte_page(*ptep)); 878 page_address(pte_page(*ptep));
879 879
880 __asm__ __volatile__( 880 wmb();
881 " membar #StoreStore\n" 881 __asm__ __volatile__("flush %0 + %1"
882 " flush %0 + %1" 882 : /* no outputs */
883 : : "r" (page), "r" (address & (PAGE_SIZE - 1)) 883 : "r" (page),
884 : "memory"); 884 "r" (address & (PAGE_SIZE - 1))
885 : "memory");
885 } 886 }
886 pte_unmap(ptep); 887 pte_unmap(ptep);
887 preempt_enable(); 888 preempt_enable();
@@ -1292,11 +1293,12 @@ static void setup_rt_frame32(struct k_sigaction *ka, struct pt_regs *regs,
1292 unsigned long page = (unsigned long) 1293 unsigned long page = (unsigned long)
1293 page_address(pte_page(*ptep)); 1294 page_address(pte_page(*ptep));
1294 1295
1295 __asm__ __volatile__( 1296 wmb();
1296 " membar #StoreStore\n" 1297 __asm__ __volatile__("flush %0 + %1"
1297 " flush %0 + %1" 1298 : /* no outputs */
1298 : : "r" (page), "r" (address & (PAGE_SIZE - 1)) 1299 : "r" (page),
1299 : "memory"); 1300 "r" (address & (PAGE_SIZE - 1))
1301 : "memory");
1300 } 1302 }
1301 pte_unmap(ptep); 1303 pte_unmap(ptep);
1302 preempt_enable(); 1304 preempt_enable();
@@ -1325,13 +1327,12 @@ static inline void handle_signal32(unsigned long signr, struct k_sigaction *ka,
1325 else 1327 else
1326 setup_frame32(&ka->sa, regs, signr, oldset, info); 1328 setup_frame32(&ka->sa, regs, signr, oldset, info);
1327 } 1329 }
1328 if (!(ka->sa.sa_flags & SA_NOMASK)) { 1330 spin_lock_irq(&current->sighand->siglock);
1329 spin_lock_irq(&current->sighand->siglock); 1331 sigorsets(&current->blocked,&current->blocked,&ka->sa.sa_mask);
1330 sigorsets(&current->blocked,&current->blocked,&ka->sa.sa_mask); 1332 if (!(ka->sa.sa_flags & SA_NOMASK))
1331 sigaddset(&current->blocked,signr); 1333 sigaddset(&current->blocked,signr);
1332 recalc_sigpending(); 1334 recalc_sigpending();
1333 spin_unlock_irq(&current->sighand->siglock); 1335 spin_unlock_irq(&current->sighand->siglock);
1334 }
1335} 1336}
1336 1337
1337static inline void syscall_restart32(unsigned long orig_i0, struct pt_regs *regs, 1338static inline void syscall_restart32(unsigned long orig_i0, struct pt_regs *regs,
diff --git a/arch/sparc64/kernel/smp.c b/arch/sparc64/kernel/smp.c
index 441fc2e52ce6..b4fc6a5462b2 100644
--- a/arch/sparc64/kernel/smp.c
+++ b/arch/sparc64/kernel/smp.c
@@ -45,8 +45,8 @@ extern void calibrate_delay(void);
45/* Please don't make this stuff initdata!!! --DaveM */ 45/* Please don't make this stuff initdata!!! --DaveM */
46static unsigned char boot_cpu_id; 46static unsigned char boot_cpu_id;
47 47
48cpumask_t cpu_online_map = CPU_MASK_NONE __read_mostly; 48cpumask_t cpu_online_map __read_mostly = CPU_MASK_NONE;
49cpumask_t phys_cpu_present_map = CPU_MASK_NONE __read_mostly; 49cpumask_t phys_cpu_present_map __read_mostly = CPU_MASK_NONE;
50static cpumask_t smp_commenced_mask; 50static cpumask_t smp_commenced_mask;
51static cpumask_t cpu_callout_map; 51static cpumask_t cpu_callout_map;
52 52
@@ -137,14 +137,14 @@ void __init smp_callin(void)
137 /* Clear this or we will die instantly when we 137 /* Clear this or we will die instantly when we
138 * schedule back to this idler... 138 * schedule back to this idler...
139 */ 139 */
140 clear_thread_flag(TIF_NEWCHILD); 140 current_thread_info()->new_child = 0;
141 141
142 /* Attach to the address space of init_task. */ 142 /* Attach to the address space of init_task. */
143 atomic_inc(&init_mm.mm_count); 143 atomic_inc(&init_mm.mm_count);
144 current->active_mm = &init_mm; 144 current->active_mm = &init_mm;
145 145
146 while (!cpu_isset(cpuid, smp_commenced_mask)) 146 while (!cpu_isset(cpuid, smp_commenced_mask))
147 membar("#LoadLoad"); 147 rmb();
148 148
149 cpu_set(cpuid, cpu_online_map); 149 cpu_set(cpuid, cpu_online_map);
150} 150}
@@ -184,11 +184,11 @@ static inline long get_delta (long *rt, long *master)
184 for (i = 0; i < NUM_ITERS; i++) { 184 for (i = 0; i < NUM_ITERS; i++) {
185 t0 = tick_ops->get_tick(); 185 t0 = tick_ops->get_tick();
186 go[MASTER] = 1; 186 go[MASTER] = 1;
187 membar("#StoreLoad"); 187 membar_storeload();
188 while (!(tm = go[SLAVE])) 188 while (!(tm = go[SLAVE]))
189 membar("#LoadLoad"); 189 rmb();
190 go[SLAVE] = 0; 190 go[SLAVE] = 0;
191 membar("#StoreStore"); 191 wmb();
192 t1 = tick_ops->get_tick(); 192 t1 = tick_ops->get_tick();
193 193
194 if (t1 - t0 < best_t1 - best_t0) 194 if (t1 - t0 < best_t1 - best_t0)
@@ -221,7 +221,7 @@ void smp_synchronize_tick_client(void)
221 go[MASTER] = 1; 221 go[MASTER] = 1;
222 222
223 while (go[MASTER]) 223 while (go[MASTER])
224 membar("#LoadLoad"); 224 rmb();
225 225
226 local_irq_save(flags); 226 local_irq_save(flags);
227 { 227 {
@@ -273,21 +273,21 @@ static void smp_synchronize_one_tick(int cpu)
273 273
274 /* wait for client to be ready */ 274 /* wait for client to be ready */
275 while (!go[MASTER]) 275 while (!go[MASTER])
276 membar("#LoadLoad"); 276 rmb();
277 277
278 /* now let the client proceed into his loop */ 278 /* now let the client proceed into his loop */
279 go[MASTER] = 0; 279 go[MASTER] = 0;
280 membar("#StoreLoad"); 280 membar_storeload();
281 281
282 spin_lock_irqsave(&itc_sync_lock, flags); 282 spin_lock_irqsave(&itc_sync_lock, flags);
283 { 283 {
284 for (i = 0; i < NUM_ROUNDS*NUM_ITERS; i++) { 284 for (i = 0; i < NUM_ROUNDS*NUM_ITERS; i++) {
285 while (!go[MASTER]) 285 while (!go[MASTER])
286 membar("#LoadLoad"); 286 rmb();
287 go[MASTER] = 0; 287 go[MASTER] = 0;
288 membar("#StoreStore"); 288 wmb();
289 go[SLAVE] = tick_ops->get_tick(); 289 go[SLAVE] = tick_ops->get_tick();
290 membar("#StoreLoad"); 290 membar_storeload();
291 } 291 }
292 } 292 }
293 spin_unlock_irqrestore(&itc_sync_lock, flags); 293 spin_unlock_irqrestore(&itc_sync_lock, flags);
@@ -927,11 +927,11 @@ void smp_capture(void)
927 smp_processor_id()); 927 smp_processor_id());
928#endif 928#endif
929 penguins_are_doing_time = 1; 929 penguins_are_doing_time = 1;
930 membar("#StoreStore | #LoadStore"); 930 membar_storestore_loadstore();
931 atomic_inc(&smp_capture_registry); 931 atomic_inc(&smp_capture_registry);
932 smp_cross_call(&xcall_capture, 0, 0, 0); 932 smp_cross_call(&xcall_capture, 0, 0, 0);
933 while (atomic_read(&smp_capture_registry) != ncpus) 933 while (atomic_read(&smp_capture_registry) != ncpus)
934 membar("#LoadLoad"); 934 rmb();
935#ifdef CAPTURE_DEBUG 935#ifdef CAPTURE_DEBUG
936 printk("done\n"); 936 printk("done\n");
937#endif 937#endif
@@ -947,7 +947,7 @@ void smp_release(void)
947 smp_processor_id()); 947 smp_processor_id());
948#endif 948#endif
949 penguins_are_doing_time = 0; 949 penguins_are_doing_time = 0;
950 membar("#StoreStore | #StoreLoad"); 950 membar_storeload_storestore();
951 atomic_dec(&smp_capture_registry); 951 atomic_dec(&smp_capture_registry);
952 } 952 }
953} 953}
@@ -970,9 +970,9 @@ void smp_penguin_jailcell(int irq, struct pt_regs *regs)
970 save_alternate_globals(global_save); 970 save_alternate_globals(global_save);
971 prom_world(1); 971 prom_world(1);
972 atomic_inc(&smp_capture_registry); 972 atomic_inc(&smp_capture_registry);
973 membar("#StoreLoad | #StoreStore"); 973 membar_storeload_storestore();
974 while (penguins_are_doing_time) 974 while (penguins_are_doing_time)
975 membar("#LoadLoad"); 975 rmb();
976 restore_alternate_globals(global_save); 976 restore_alternate_globals(global_save);
977 atomic_dec(&smp_capture_registry); 977 atomic_dec(&smp_capture_registry);
978 prom_world(0); 978 prom_world(0);
diff --git a/arch/sparc64/kernel/sparc64_ksyms.c b/arch/sparc64/kernel/sparc64_ksyms.c
index 9202d925a9ce..d89fc24808d3 100644
--- a/arch/sparc64/kernel/sparc64_ksyms.c
+++ b/arch/sparc64/kernel/sparc64_ksyms.c
@@ -88,8 +88,6 @@ extern int svr4_setcontext(svr4_ucontext_t *uc, struct pt_regs *regs);
88extern int compat_sys_ioctl(unsigned int fd, unsigned int cmd, u32 arg); 88extern int compat_sys_ioctl(unsigned int fd, unsigned int cmd, u32 arg);
89extern int (*handle_mathemu)(struct pt_regs *, struct fpustate *); 89extern int (*handle_mathemu)(struct pt_regs *, struct fpustate *);
90extern long sparc32_open(const char __user * filename, int flags, int mode); 90extern long sparc32_open(const char __user * filename, int flags, int mode);
91extern int io_remap_page_range(struct vm_area_struct *vma, unsigned long from,
92 unsigned long offset, unsigned long size, pgprot_t prot, int space);
93extern int io_remap_pfn_range(struct vm_area_struct *vma, unsigned long from, 91extern int io_remap_pfn_range(struct vm_area_struct *vma, unsigned long from,
94 unsigned long pfn, unsigned long size, pgprot_t prot); 92 unsigned long pfn, unsigned long size, pgprot_t prot);
95extern void (*prom_palette)(int); 93extern void (*prom_palette)(int);
@@ -99,17 +97,6 @@ extern int __ashrdi3(int, int);
99extern void dump_thread(struct pt_regs *, struct user *); 97extern void dump_thread(struct pt_regs *, struct user *);
100extern int dump_fpu (struct pt_regs * regs, elf_fpregset_t * fpregs); 98extern int dump_fpu (struct pt_regs * regs, elf_fpregset_t * fpregs);
101 99
102#if defined(CONFIG_SMP) && defined(CONFIG_DEBUG_SPINLOCK)
103extern void _do_spin_lock (spinlock_t *lock, char *str);
104extern void _do_spin_unlock (spinlock_t *lock);
105extern int _spin_trylock (spinlock_t *lock);
106extern void _do_read_lock(rwlock_t *rw, char *str);
107extern void _do_read_unlock(rwlock_t *rw, char *str);
108extern void _do_write_lock(rwlock_t *rw, char *str);
109extern void _do_write_unlock(rwlock_t *rw);
110extern int _do_write_trylock(rwlock_t *rw, char *str);
111#endif
112
113extern unsigned long phys_base; 100extern unsigned long phys_base;
114extern unsigned long pfn_base; 101extern unsigned long pfn_base;
115 102
@@ -152,18 +139,6 @@ EXPORT_SYMBOL(_mcount);
152EXPORT_SYMBOL(cpu_online_map); 139EXPORT_SYMBOL(cpu_online_map);
153EXPORT_SYMBOL(phys_cpu_present_map); 140EXPORT_SYMBOL(phys_cpu_present_map);
154 141
155/* Spinlock debugging library, optional. */
156#ifdef CONFIG_DEBUG_SPINLOCK
157EXPORT_SYMBOL(_do_spin_lock);
158EXPORT_SYMBOL(_do_spin_unlock);
159EXPORT_SYMBOL(_spin_trylock);
160EXPORT_SYMBOL(_do_read_lock);
161EXPORT_SYMBOL(_do_read_unlock);
162EXPORT_SYMBOL(_do_write_lock);
163EXPORT_SYMBOL(_do_write_unlock);
164EXPORT_SYMBOL(_do_write_trylock);
165#endif
166
167EXPORT_SYMBOL(smp_call_function); 142EXPORT_SYMBOL(smp_call_function);
168#endif /* CONFIG_SMP */ 143#endif /* CONFIG_SMP */
169 144
@@ -268,7 +243,6 @@ EXPORT_SYMBOL(pci_dma_supported);
268#endif 243#endif
269 244
270/* I/O device mmaping on Sparc64. */ 245/* I/O device mmaping on Sparc64. */
271EXPORT_SYMBOL(io_remap_page_range);
272EXPORT_SYMBOL(io_remap_pfn_range); 246EXPORT_SYMBOL(io_remap_pfn_range);
273 247
274/* Solaris/SunOS binary compatibility */ 248/* Solaris/SunOS binary compatibility */
@@ -429,3 +403,12 @@ EXPORT_SYMBOL(xor_vis_4);
429EXPORT_SYMBOL(xor_vis_5); 403EXPORT_SYMBOL(xor_vis_5);
430 404
431EXPORT_SYMBOL(prom_palette); 405EXPORT_SYMBOL(prom_palette);
406
407/* memory barriers */
408EXPORT_SYMBOL(mb);
409EXPORT_SYMBOL(rmb);
410EXPORT_SYMBOL(wmb);
411EXPORT_SYMBOL(membar_storeload);
412EXPORT_SYMBOL(membar_storeload_storestore);
413EXPORT_SYMBOL(membar_storeload_loadload);
414EXPORT_SYMBOL(membar_storestore_loadstore);
diff --git a/arch/sparc64/kernel/systbls.S b/arch/sparc64/kernel/systbls.S
index bceb91a8a2bd..53eaf2345fe9 100644
--- a/arch/sparc64/kernel/systbls.S
+++ b/arch/sparc64/kernel/systbls.S
@@ -50,8 +50,8 @@ sys_call_table32:
50 .word sys_nis_syscall, sys32_mkdir, sys_rmdir, sys32_utimes, compat_sys_stat64 50 .word sys_nis_syscall, sys32_mkdir, sys_rmdir, sys32_utimes, compat_sys_stat64
51/*140*/ .word sys32_sendfile64, sys_nis_syscall, sys32_futex, sys_gettid, compat_sys_getrlimit 51/*140*/ .word sys32_sendfile64, sys_nis_syscall, sys32_futex, sys_gettid, compat_sys_getrlimit
52 .word compat_sys_setrlimit, sys_pivot_root, sys32_prctl, sys_pciconfig_read, sys_pciconfig_write 52 .word compat_sys_setrlimit, sys_pivot_root, sys32_prctl, sys_pciconfig_read, sys_pciconfig_write
53/*150*/ .word sys_nis_syscall, sys_nis_syscall, sys_nis_syscall, sys_poll, sys_getdents64 53/*150*/ .word sys_nis_syscall, sys_inotify_init, sys_inotify_add_watch, sys_poll, sys_getdents64
54 .word compat_sys_fcntl64, sys_ni_syscall, compat_sys_statfs, compat_sys_fstatfs, sys_oldumount 54 .word compat_sys_fcntl64, sys_inotify_rm_watch, compat_sys_statfs, compat_sys_fstatfs, sys_oldumount
55/*160*/ .word compat_sys_sched_setaffinity, compat_sys_sched_getaffinity, sys32_getdomainname, sys32_setdomainname, sys_nis_syscall 55/*160*/ .word compat_sys_sched_setaffinity, compat_sys_sched_getaffinity, sys32_getdomainname, sys32_setdomainname, sys_nis_syscall
56 .word sys_quotactl, sys_set_tid_address, compat_sys_mount, sys_ustat, sys32_setxattr 56 .word sys_quotactl, sys_set_tid_address, compat_sys_mount, sys_ustat, sys32_setxattr
57/*170*/ .word sys32_lsetxattr, sys32_fsetxattr, sys_getxattr, sys_lgetxattr, compat_sys_getdents 57/*170*/ .word sys32_lsetxattr, sys32_fsetxattr, sys_getxattr, sys_lgetxattr, compat_sys_getdents
@@ -116,8 +116,8 @@ sys_call_table:
116 .word sys_socketpair, sys_mkdir, sys_rmdir, sys_utimes, sys_stat64 116 .word sys_socketpair, sys_mkdir, sys_rmdir, sys_utimes, sys_stat64
117/*140*/ .word sys_sendfile64, sys_getpeername, sys_futex, sys_gettid, sys_getrlimit 117/*140*/ .word sys_sendfile64, sys_getpeername, sys_futex, sys_gettid, sys_getrlimit
118 .word sys_setrlimit, sys_pivot_root, sys_prctl, sys_pciconfig_read, sys_pciconfig_write 118 .word sys_setrlimit, sys_pivot_root, sys_prctl, sys_pciconfig_read, sys_pciconfig_write
119/*150*/ .word sys_getsockname, sys_nis_syscall, sys_nis_syscall, sys_poll, sys_getdents64 119/*150*/ .word sys_getsockname, sys_inotify_init, sys_inotify_add_watch, sys_poll, sys_getdents64
120 .word sys_nis_syscall, sys_ni_syscall, sys_statfs, sys_fstatfs, sys_oldumount 120 .word sys_nis_syscall, sys_inotify_rm_watch, sys_statfs, sys_fstatfs, sys_oldumount
121/*160*/ .word sys_sched_setaffinity, sys_sched_getaffinity, sys_getdomainname, sys_setdomainname, sys_utrap_install 121/*160*/ .word sys_sched_setaffinity, sys_sched_getaffinity, sys_getdomainname, sys_setdomainname, sys_utrap_install
122 .word sys_quotactl, sys_set_tid_address, sys_mount, sys_ustat, sys_setxattr 122 .word sys_quotactl, sys_set_tid_address, sys_mount, sys_ustat, sys_setxattr
123/*170*/ .word sys_lsetxattr, sys_fsetxattr, sys_getxattr, sys_lgetxattr, sys_getdents 123/*170*/ .word sys_lsetxattr, sys_fsetxattr, sys_getxattr, sys_lgetxattr, sys_getdents
diff --git a/arch/sparc64/kernel/traps.c b/arch/sparc64/kernel/traps.c
index a9f4596d7c2b..b280b2ef674f 100644
--- a/arch/sparc64/kernel/traps.c
+++ b/arch/sparc64/kernel/traps.c
@@ -33,6 +33,7 @@
33#include <asm/dcu.h> 33#include <asm/dcu.h>
34#include <asm/estate.h> 34#include <asm/estate.h>
35#include <asm/chafsr.h> 35#include <asm/chafsr.h>
36#include <asm/sfafsr.h>
36#include <asm/psrcompat.h> 37#include <asm/psrcompat.h>
37#include <asm/processor.h> 38#include <asm/processor.h>
38#include <asm/timer.h> 39#include <asm/timer.h>
@@ -143,8 +144,7 @@ void do_BUG(const char *file, int line)
143} 144}
144#endif 145#endif
145 146
146void instruction_access_exception(struct pt_regs *regs, 147void spitfire_insn_access_exception(struct pt_regs *regs, unsigned long sfsr, unsigned long sfar)
147 unsigned long sfsr, unsigned long sfar)
148{ 148{
149 siginfo_t info; 149 siginfo_t info;
150 150
@@ -153,8 +153,8 @@ void instruction_access_exception(struct pt_regs *regs,
153 return; 153 return;
154 154
155 if (regs->tstate & TSTATE_PRIV) { 155 if (regs->tstate & TSTATE_PRIV) {
156 printk("instruction_access_exception: SFSR[%016lx] SFAR[%016lx], going.\n", 156 printk("spitfire_insn_access_exception: SFSR[%016lx] "
157 sfsr, sfar); 157 "SFAR[%016lx], going.\n", sfsr, sfar);
158 die_if_kernel("Iax", regs); 158 die_if_kernel("Iax", regs);
159 } 159 }
160 if (test_thread_flag(TIF_32BIT)) { 160 if (test_thread_flag(TIF_32BIT)) {
@@ -169,19 +169,17 @@ void instruction_access_exception(struct pt_regs *regs,
169 force_sig_info(SIGSEGV, &info, current); 169 force_sig_info(SIGSEGV, &info, current);
170} 170}
171 171
172void instruction_access_exception_tl1(struct pt_regs *regs, 172void spitfire_insn_access_exception_tl1(struct pt_regs *regs, unsigned long sfsr, unsigned long sfar)
173 unsigned long sfsr, unsigned long sfar)
174{ 173{
175 if (notify_die(DIE_TRAP_TL1, "instruction access exception tl1", regs, 174 if (notify_die(DIE_TRAP_TL1, "instruction access exception tl1", regs,
176 0, 0x8, SIGTRAP) == NOTIFY_STOP) 175 0, 0x8, SIGTRAP) == NOTIFY_STOP)
177 return; 176 return;
178 177
179 dump_tl1_traplog((struct tl1_traplog *)(regs + 1)); 178 dump_tl1_traplog((struct tl1_traplog *)(regs + 1));
180 instruction_access_exception(regs, sfsr, sfar); 179 spitfire_insn_access_exception(regs, sfsr, sfar);
181} 180}
182 181
183void data_access_exception(struct pt_regs *regs, 182void spitfire_data_access_exception(struct pt_regs *regs, unsigned long sfsr, unsigned long sfar)
184 unsigned long sfsr, unsigned long sfar)
185{ 183{
186 siginfo_t info; 184 siginfo_t info;
187 185
@@ -207,8 +205,8 @@ void data_access_exception(struct pt_regs *regs,
207 return; 205 return;
208 } 206 }
209 /* Shit... */ 207 /* Shit... */
210 printk("data_access_exception: SFSR[%016lx] SFAR[%016lx], going.\n", 208 printk("spitfire_data_access_exception: SFSR[%016lx] "
211 sfsr, sfar); 209 "SFAR[%016lx], going.\n", sfsr, sfar);
212 die_if_kernel("Dax", regs); 210 die_if_kernel("Dax", regs);
213 } 211 }
214 212
@@ -220,6 +218,16 @@ void data_access_exception(struct pt_regs *regs,
220 force_sig_info(SIGSEGV, &info, current); 218 force_sig_info(SIGSEGV, &info, current);
221} 219}
222 220
221void spitfire_data_access_exception_tl1(struct pt_regs *regs, unsigned long sfsr, unsigned long sfar)
222{
223 if (notify_die(DIE_TRAP_TL1, "data access exception tl1", regs,
224 0, 0x30, SIGTRAP) == NOTIFY_STOP)
225 return;
226
227 dump_tl1_traplog((struct tl1_traplog *)(regs + 1));
228 spitfire_data_access_exception(regs, sfsr, sfar);
229}
230
223#ifdef CONFIG_PCI 231#ifdef CONFIG_PCI
224/* This is really pathetic... */ 232/* This is really pathetic... */
225extern volatile int pci_poke_in_progress; 233extern volatile int pci_poke_in_progress;
@@ -253,54 +261,13 @@ static void spitfire_clean_and_reenable_l1_caches(void)
253 : "memory"); 261 : "memory");
254} 262}
255 263
256void do_iae(struct pt_regs *regs) 264static void spitfire_enable_estate_errors(void)
257{ 265{
258 siginfo_t info; 266 __asm__ __volatile__("stxa %0, [%%g0] %1\n\t"
259 267 "membar #Sync"
260 spitfire_clean_and_reenable_l1_caches(); 268 : /* no outputs */
261 269 : "r" (ESTATE_ERR_ALL),
262 if (notify_die(DIE_TRAP, "instruction access exception", regs, 270 "i" (ASI_ESTATE_ERROR_EN));
263 0, 0x8, SIGTRAP) == NOTIFY_STOP)
264 return;
265
266 info.si_signo = SIGBUS;
267 info.si_errno = 0;
268 info.si_code = BUS_OBJERR;
269 info.si_addr = (void *)0;
270 info.si_trapno = 0;
271 force_sig_info(SIGBUS, &info, current);
272}
273
274void do_dae(struct pt_regs *regs)
275{
276 siginfo_t info;
277
278#ifdef CONFIG_PCI
279 if (pci_poke_in_progress && pci_poke_cpu == smp_processor_id()) {
280 spitfire_clean_and_reenable_l1_caches();
281
282 pci_poke_faulted = 1;
283
284 /* Why the fuck did they have to change this? */
285 if (tlb_type == cheetah || tlb_type == cheetah_plus)
286 regs->tpc += 4;
287
288 regs->tnpc = regs->tpc + 4;
289 return;
290 }
291#endif
292 spitfire_clean_and_reenable_l1_caches();
293
294 if (notify_die(DIE_TRAP, "data access exception", regs,
295 0, 0x30, SIGTRAP) == NOTIFY_STOP)
296 return;
297
298 info.si_signo = SIGBUS;
299 info.si_errno = 0;
300 info.si_code = BUS_OBJERR;
301 info.si_addr = (void *)0;
302 info.si_trapno = 0;
303 force_sig_info(SIGBUS, &info, current);
304} 271}
305 272
306static char ecc_syndrome_table[] = { 273static char ecc_syndrome_table[] = {
@@ -338,65 +305,15 @@ static char ecc_syndrome_table[] = {
338 0x0b, 0x48, 0x48, 0x4b, 0x48, 0x4b, 0x4b, 0x4a 305 0x0b, 0x48, 0x48, 0x4b, 0x48, 0x4b, 0x4b, 0x4a
339}; 306};
340 307
341/* cee_trap in entry.S encodes AFSR/UDBH/UDBL error status
342 * in the following format. The AFAR is left as is, with
343 * reserved bits cleared, and is a raw 40-bit physical
344 * address.
345 */
346#define CE_STATUS_UDBH_UE (1UL << (43 + 9))
347#define CE_STATUS_UDBH_CE (1UL << (43 + 8))
348#define CE_STATUS_UDBH_ESYNDR (0xffUL << 43)
349#define CE_STATUS_UDBH_SHIFT 43
350#define CE_STATUS_UDBL_UE (1UL << (33 + 9))
351#define CE_STATUS_UDBL_CE (1UL << (33 + 8))
352#define CE_STATUS_UDBL_ESYNDR (0xffUL << 33)
353#define CE_STATUS_UDBL_SHIFT 33
354#define CE_STATUS_AFSR_MASK (0x1ffffffffUL)
355#define CE_STATUS_AFSR_ME (1UL << 32)
356#define CE_STATUS_AFSR_PRIV (1UL << 31)
357#define CE_STATUS_AFSR_ISAP (1UL << 30)
358#define CE_STATUS_AFSR_ETP (1UL << 29)
359#define CE_STATUS_AFSR_IVUE (1UL << 28)
360#define CE_STATUS_AFSR_TO (1UL << 27)
361#define CE_STATUS_AFSR_BERR (1UL << 26)
362#define CE_STATUS_AFSR_LDP (1UL << 25)
363#define CE_STATUS_AFSR_CP (1UL << 24)
364#define CE_STATUS_AFSR_WP (1UL << 23)
365#define CE_STATUS_AFSR_EDP (1UL << 22)
366#define CE_STATUS_AFSR_UE (1UL << 21)
367#define CE_STATUS_AFSR_CE (1UL << 20)
368#define CE_STATUS_AFSR_ETS (0xfUL << 16)
369#define CE_STATUS_AFSR_ETS_SHIFT 16
370#define CE_STATUS_AFSR_PSYND (0xffffUL << 0)
371#define CE_STATUS_AFSR_PSYND_SHIFT 0
372
373/* Layout of Ecache TAG Parity Syndrome of AFSR */
374#define AFSR_ETSYNDROME_7_0 0x1UL /* E$-tag bus bits <7:0> */
375#define AFSR_ETSYNDROME_15_8 0x2UL /* E$-tag bus bits <15:8> */
376#define AFSR_ETSYNDROME_21_16 0x4UL /* E$-tag bus bits <21:16> */
377#define AFSR_ETSYNDROME_24_22 0x8UL /* E$-tag bus bits <24:22> */
378
379static char *syndrome_unknown = "<Unknown>"; 308static char *syndrome_unknown = "<Unknown>";
380 309
381asmlinkage void cee_log(unsigned long ce_status, 310static void spitfire_log_udb_syndrome(unsigned long afar, unsigned long udbh, unsigned long udbl, unsigned long bit)
382 unsigned long afar,
383 struct pt_regs *regs)
384{ 311{
385 char memmod_str[64]; 312 unsigned short scode;
386 char *p; 313 char memmod_str[64], *p;
387 unsigned short scode, udb_reg;
388 314
389 printk(KERN_WARNING "CPU[%d]: Correctable ECC Error " 315 if (udbl & bit) {
390 "AFSR[%lx] AFAR[%016lx] UDBL[%lx] UDBH[%lx]\n", 316 scode = ecc_syndrome_table[udbl & 0xff];
391 smp_processor_id(),
392 (ce_status & CE_STATUS_AFSR_MASK),
393 afar,
394 ((ce_status >> CE_STATUS_UDBL_SHIFT) & 0x3ffUL),
395 ((ce_status >> CE_STATUS_UDBH_SHIFT) & 0x3ffUL));
396
397 udb_reg = ((ce_status >> CE_STATUS_UDBL_SHIFT) & 0x3ffUL);
398 if (udb_reg & (1 << 8)) {
399 scode = ecc_syndrome_table[udb_reg & 0xff];
400 if (prom_getunumber(scode, afar, 317 if (prom_getunumber(scode, afar,
401 memmod_str, sizeof(memmod_str)) == -1) 318 memmod_str, sizeof(memmod_str)) == -1)
402 p = syndrome_unknown; 319 p = syndrome_unknown;
@@ -407,9 +324,8 @@ asmlinkage void cee_log(unsigned long ce_status,
407 smp_processor_id(), scode, p); 324 smp_processor_id(), scode, p);
408 } 325 }
409 326
410 udb_reg = ((ce_status >> CE_STATUS_UDBH_SHIFT) & 0x3ffUL); 327 if (udbh & bit) {
411 if (udb_reg & (1 << 8)) { 328 scode = ecc_syndrome_table[udbh & 0xff];
412 scode = ecc_syndrome_table[udb_reg & 0xff];
413 if (prom_getunumber(scode, afar, 329 if (prom_getunumber(scode, afar,
414 memmod_str, sizeof(memmod_str)) == -1) 330 memmod_str, sizeof(memmod_str)) == -1)
415 p = syndrome_unknown; 331 p = syndrome_unknown;
@@ -419,6 +335,127 @@ asmlinkage void cee_log(unsigned long ce_status,
419 "Memory Module \"%s\"\n", 335 "Memory Module \"%s\"\n",
420 smp_processor_id(), scode, p); 336 smp_processor_id(), scode, p);
421 } 337 }
338
339}
340
341static void spitfire_cee_log(unsigned long afsr, unsigned long afar, unsigned long udbh, unsigned long udbl, int tl1, struct pt_regs *regs)
342{
343
344 printk(KERN_WARNING "CPU[%d]: Correctable ECC Error "
345 "AFSR[%lx] AFAR[%016lx] UDBL[%lx] UDBH[%lx] TL>1[%d]\n",
346 smp_processor_id(), afsr, afar, udbl, udbh, tl1);
347
348 spitfire_log_udb_syndrome(afar, udbh, udbl, UDBE_CE);
349
350 /* We always log it, even if someone is listening for this
351 * trap.
352 */
353 notify_die(DIE_TRAP, "Correctable ECC Error", regs,
354 0, TRAP_TYPE_CEE, SIGTRAP);
355
356 /* The Correctable ECC Error trap does not disable I/D caches. So
357 * we only have to restore the ESTATE Error Enable register.
358 */
359 spitfire_enable_estate_errors();
360}
361
362static void spitfire_ue_log(unsigned long afsr, unsigned long afar, unsigned long udbh, unsigned long udbl, unsigned long tt, int tl1, struct pt_regs *regs)
363{
364 siginfo_t info;
365
366 printk(KERN_WARNING "CPU[%d]: Uncorrectable Error AFSR[%lx] "
367 "AFAR[%lx] UDBL[%lx] UDBH[%ld] TT[%lx] TL>1[%d]\n",
368 smp_processor_id(), afsr, afar, udbl, udbh, tt, tl1);
369
370 /* XXX add more human friendly logging of the error status
371 * XXX as is implemented for cheetah
372 */
373
374 spitfire_log_udb_syndrome(afar, udbh, udbl, UDBE_UE);
375
376 /* We always log it, even if someone is listening for this
377 * trap.
378 */
379 notify_die(DIE_TRAP, "Uncorrectable Error", regs,
380 0, tt, SIGTRAP);
381
382 if (regs->tstate & TSTATE_PRIV) {
383 if (tl1)
384 dump_tl1_traplog((struct tl1_traplog *)(regs + 1));
385 die_if_kernel("UE", regs);
386 }
387
388 /* XXX need more intelligent processing here, such as is implemented
389 * XXX for cheetah errors, in fact if the E-cache still holds the
390 * XXX line with bad parity this will loop
391 */
392
393 spitfire_clean_and_reenable_l1_caches();
394 spitfire_enable_estate_errors();
395
396 if (test_thread_flag(TIF_32BIT)) {
397 regs->tpc &= 0xffffffff;
398 regs->tnpc &= 0xffffffff;
399 }
400 info.si_signo = SIGBUS;
401 info.si_errno = 0;
402 info.si_code = BUS_OBJERR;
403 info.si_addr = (void *)0;
404 info.si_trapno = 0;
405 force_sig_info(SIGBUS, &info, current);
406}
407
408void spitfire_access_error(struct pt_regs *regs, unsigned long status_encoded, unsigned long afar)
409{
410 unsigned long afsr, tt, udbh, udbl;
411 int tl1;
412
413 afsr = (status_encoded & SFSTAT_AFSR_MASK) >> SFSTAT_AFSR_SHIFT;
414 tt = (status_encoded & SFSTAT_TRAP_TYPE) >> SFSTAT_TRAP_TYPE_SHIFT;
415 tl1 = (status_encoded & SFSTAT_TL_GT_ONE) ? 1 : 0;
416 udbl = (status_encoded & SFSTAT_UDBL_MASK) >> SFSTAT_UDBL_SHIFT;
417 udbh = (status_encoded & SFSTAT_UDBH_MASK) >> SFSTAT_UDBH_SHIFT;
418
419#ifdef CONFIG_PCI
420 if (tt == TRAP_TYPE_DAE &&
421 pci_poke_in_progress && pci_poke_cpu == smp_processor_id()) {
422 spitfire_clean_and_reenable_l1_caches();
423 spitfire_enable_estate_errors();
424
425 pci_poke_faulted = 1;
426 regs->tnpc = regs->tpc + 4;
427 return;
428 }
429#endif
430
431 if (afsr & SFAFSR_UE)
432 spitfire_ue_log(afsr, afar, udbh, udbl, tt, tl1, regs);
433
434 if (tt == TRAP_TYPE_CEE) {
435 /* Handle the case where we took a CEE trap, but ACK'd
436 * only the UE state in the UDB error registers.
437 */
438 if (afsr & SFAFSR_UE) {
439 if (udbh & UDBE_CE) {
440 __asm__ __volatile__(
441 "stxa %0, [%1] %2\n\t"
442 "membar #Sync"
443 : /* no outputs */
444 : "r" (udbh & UDBE_CE),
445 "r" (0x0), "i" (ASI_UDB_ERROR_W));
446 }
447 if (udbl & UDBE_CE) {
448 __asm__ __volatile__(
449 "stxa %0, [%1] %2\n\t"
450 "membar #Sync"
451 : /* no outputs */
452 : "r" (udbl & UDBE_CE),
453 "r" (0x18), "i" (ASI_UDB_ERROR_W));
454 }
455 }
456
457 spitfire_cee_log(afsr, afar, udbh, udbl, tl1, regs);
458 }
422} 459}
423 460
424int cheetah_pcache_forced_on; 461int cheetah_pcache_forced_on;
@@ -2125,6 +2162,11 @@ void __init trap_init(void)
2125 TI_PCR != offsetof(struct thread_info, pcr_reg) || 2162 TI_PCR != offsetof(struct thread_info, pcr_reg) ||
2126 TI_CEE_STUFF != offsetof(struct thread_info, cee_stuff) || 2163 TI_CEE_STUFF != offsetof(struct thread_info, cee_stuff) ||
2127 TI_PRE_COUNT != offsetof(struct thread_info, preempt_count) || 2164 TI_PRE_COUNT != offsetof(struct thread_info, preempt_count) ||
2165 TI_NEW_CHILD != offsetof(struct thread_info, new_child) ||
2166 TI_SYS_NOERROR != offsetof(struct thread_info, syscall_noerror) ||
2167 TI_RESTART_BLOCK != offsetof(struct thread_info, restart_block) ||
2168 TI_KUNA_REGS != offsetof(struct thread_info, kern_una_regs) ||
2169 TI_KUNA_INSN != offsetof(struct thread_info, kern_una_insn) ||
2128 TI_FPREGS != offsetof(struct thread_info, fpregs) || 2170 TI_FPREGS != offsetof(struct thread_info, fpregs) ||
2129 (TI_FPREGS & (64 - 1))) 2171 (TI_FPREGS & (64 - 1)))
2130 thread_info_offsets_are_bolixed_dave(); 2172 thread_info_offsets_are_bolixed_dave();
diff --git a/arch/sparc64/kernel/ttable.S b/arch/sparc64/kernel/ttable.S
index 491bb3681f9d..8365bc1f81f3 100644
--- a/arch/sparc64/kernel/ttable.S
+++ b/arch/sparc64/kernel/ttable.S
@@ -18,9 +18,10 @@ sparc64_ttable_tl0:
18tl0_resv000: BOOT_KERNEL BTRAP(0x1) BTRAP(0x2) BTRAP(0x3) 18tl0_resv000: BOOT_KERNEL BTRAP(0x1) BTRAP(0x2) BTRAP(0x3)
19tl0_resv004: BTRAP(0x4) BTRAP(0x5) BTRAP(0x6) BTRAP(0x7) 19tl0_resv004: BTRAP(0x4) BTRAP(0x5) BTRAP(0x6) BTRAP(0x7)
20tl0_iax: membar #Sync 20tl0_iax: membar #Sync
21 TRAP_NOSAVE_7INSNS(__do_instruction_access_exception) 21 TRAP_NOSAVE_7INSNS(__spitfire_insn_access_exception)
22tl0_resv009: BTRAP(0x9) 22tl0_resv009: BTRAP(0x9)
23tl0_iae: TRAP(do_iae) 23tl0_iae: membar #Sync
24 TRAP_NOSAVE_7INSNS(__spitfire_access_error)
24tl0_resv00b: BTRAP(0xb) BTRAP(0xc) BTRAP(0xd) BTRAP(0xe) BTRAP(0xf) 25tl0_resv00b: BTRAP(0xb) BTRAP(0xc) BTRAP(0xd) BTRAP(0xe) BTRAP(0xf)
25tl0_ill: membar #Sync 26tl0_ill: membar #Sync
26 TRAP_7INSNS(do_illegal_instruction) 27 TRAP_7INSNS(do_illegal_instruction)
@@ -36,9 +37,10 @@ tl0_cwin: CLEAN_WINDOW
36tl0_div0: TRAP(do_div0) 37tl0_div0: TRAP(do_div0)
37tl0_resv029: BTRAP(0x29) BTRAP(0x2a) BTRAP(0x2b) BTRAP(0x2c) BTRAP(0x2d) BTRAP(0x2e) 38tl0_resv029: BTRAP(0x29) BTRAP(0x2a) BTRAP(0x2b) BTRAP(0x2c) BTRAP(0x2d) BTRAP(0x2e)
38tl0_resv02f: BTRAP(0x2f) 39tl0_resv02f: BTRAP(0x2f)
39tl0_dax: TRAP_NOSAVE(__do_data_access_exception) 40tl0_dax: TRAP_NOSAVE(__spitfire_data_access_exception)
40tl0_resv031: BTRAP(0x31) 41tl0_resv031: BTRAP(0x31)
41tl0_dae: TRAP(do_dae) 42tl0_dae: membar #Sync
43 TRAP_NOSAVE_7INSNS(__spitfire_access_error)
42tl0_resv033: BTRAP(0x33) 44tl0_resv033: BTRAP(0x33)
43tl0_mna: TRAP_NOSAVE(do_mna) 45tl0_mna: TRAP_NOSAVE(do_mna)
44tl0_lddfmna: TRAP_NOSAVE(do_lddfmna) 46tl0_lddfmna: TRAP_NOSAVE(do_lddfmna)
@@ -73,7 +75,8 @@ tl0_resv05c: BTRAP(0x5c) BTRAP(0x5d) BTRAP(0x5e) BTRAP(0x5f)
73tl0_ivec: TRAP_IVEC 75tl0_ivec: TRAP_IVEC
74tl0_paw: TRAP(do_paw) 76tl0_paw: TRAP(do_paw)
75tl0_vaw: TRAP(do_vaw) 77tl0_vaw: TRAP(do_vaw)
76tl0_cee: TRAP_NOSAVE(cee_trap) 78tl0_cee: membar #Sync
79 TRAP_NOSAVE_7INSNS(__spitfire_cee_trap)
77tl0_iamiss: 80tl0_iamiss:
78#include "itlb_base.S" 81#include "itlb_base.S"
79tl0_damiss: 82tl0_damiss:
@@ -175,9 +178,10 @@ tl0_resv1f0: BTRAPS(0x1f0) BTRAPS(0x1f8)
175sparc64_ttable_tl1: 178sparc64_ttable_tl1:
176tl1_resv000: BOOT_KERNEL BTRAPTL1(0x1) BTRAPTL1(0x2) BTRAPTL1(0x3) 179tl1_resv000: BOOT_KERNEL BTRAPTL1(0x1) BTRAPTL1(0x2) BTRAPTL1(0x3)
177tl1_resv004: BTRAPTL1(0x4) BTRAPTL1(0x5) BTRAPTL1(0x6) BTRAPTL1(0x7) 180tl1_resv004: BTRAPTL1(0x4) BTRAPTL1(0x5) BTRAPTL1(0x6) BTRAPTL1(0x7)
178tl1_iax: TRAP_NOSAVE(__do_instruction_access_exception_tl1) 181tl1_iax: TRAP_NOSAVE(__spitfire_insn_access_exception_tl1)
179tl1_resv009: BTRAPTL1(0x9) 182tl1_resv009: BTRAPTL1(0x9)
180tl1_iae: TRAPTL1(do_iae_tl1) 183tl1_iae: membar #Sync
184 TRAP_NOSAVE_7INSNS(__spitfire_access_error)
181tl1_resv00b: BTRAPTL1(0xb) BTRAPTL1(0xc) BTRAPTL1(0xd) BTRAPTL1(0xe) BTRAPTL1(0xf) 185tl1_resv00b: BTRAPTL1(0xb) BTRAPTL1(0xc) BTRAPTL1(0xd) BTRAPTL1(0xe) BTRAPTL1(0xf)
182tl1_ill: TRAPTL1(do_ill_tl1) 186tl1_ill: TRAPTL1(do_ill_tl1)
183tl1_privop: BTRAPTL1(0x11) 187tl1_privop: BTRAPTL1(0x11)
@@ -193,9 +197,10 @@ tl1_cwin: CLEAN_WINDOW
193tl1_div0: TRAPTL1(do_div0_tl1) 197tl1_div0: TRAPTL1(do_div0_tl1)
194tl1_resv029: BTRAPTL1(0x29) BTRAPTL1(0x2a) BTRAPTL1(0x2b) BTRAPTL1(0x2c) 198tl1_resv029: BTRAPTL1(0x29) BTRAPTL1(0x2a) BTRAPTL1(0x2b) BTRAPTL1(0x2c)
195tl1_resv02d: BTRAPTL1(0x2d) BTRAPTL1(0x2e) BTRAPTL1(0x2f) 199tl1_resv02d: BTRAPTL1(0x2d) BTRAPTL1(0x2e) BTRAPTL1(0x2f)
196tl1_dax: TRAP_NOSAVE(__do_data_access_exception_tl1) 200tl1_dax: TRAP_NOSAVE(__spitfire_data_access_exception_tl1)
197tl1_resv031: BTRAPTL1(0x31) 201tl1_resv031: BTRAPTL1(0x31)
198tl1_dae: TRAPTL1(do_dae_tl1) 202tl1_dae: membar #Sync
203 TRAP_NOSAVE_7INSNS(__spitfire_access_error)
199tl1_resv033: BTRAPTL1(0x33) 204tl1_resv033: BTRAPTL1(0x33)
200tl1_mna: TRAP_NOSAVE(do_mna) 205tl1_mna: TRAP_NOSAVE(do_mna)
201tl1_lddfmna: TRAPTL1(do_lddfmna_tl1) 206tl1_lddfmna: TRAPTL1(do_lddfmna_tl1)
@@ -219,8 +224,8 @@ tl1_paw: TRAPTL1(do_paw_tl1)
219tl1_vaw: TRAPTL1(do_vaw_tl1) 224tl1_vaw: TRAPTL1(do_vaw_tl1)
220 225
221 /* The grotty trick to save %g1 into current->thread.cee_stuff 226 /* The grotty trick to save %g1 into current->thread.cee_stuff
222 * is because when we take this trap we could be interrupting trap 227 * is because when we take this trap we could be interrupting
223 * code already using the trap alternate global registers. 228 * trap code already using the trap alternate global registers.
224 * 229 *
225 * We cross our fingers and pray that this store/load does 230 * We cross our fingers and pray that this store/load does
226 * not cause yet another CEE trap. 231 * not cause yet another CEE trap.
diff --git a/arch/sparc64/kernel/una_asm.S b/arch/sparc64/kernel/una_asm.S
new file mode 100644
index 000000000000..cbb40585253c
--- /dev/null
+++ b/arch/sparc64/kernel/una_asm.S
@@ -0,0 +1,153 @@
1/* una_asm.S: Kernel unaligned trap assembler helpers.
2 *
3 * Copyright (C) 1996,2005 David S. Miller (davem@davemloft.net)
4 * Copyright (C) 1996,1997 Jakub Jelinek (jj@sunsite.mff.cuni.cz)
5 */
6
7 .text
8
9kernel_unaligned_trap_fault:
10 call kernel_mna_trap_fault
11 nop
12 retl
13 nop
14 .size kern_unaligned_trap_fault, .-kern_unaligned_trap_fault
15
16 .globl __do_int_store
17__do_int_store:
18 rd %asi, %o4
19 wr %o3, 0, %asi
20 ldx [%o2], %g3
21 cmp %o1, 2
22 be,pn %icc, 2f
23 cmp %o1, 4
24 be,pt %icc, 1f
25 srlx %g3, 24, %g2
26 srlx %g3, 56, %g1
27 srlx %g3, 48, %g7
284: stba %g1, [%o0] %asi
29 srlx %g3, 40, %g1
305: stba %g7, [%o0 + 1] %asi
31 srlx %g3, 32, %g7
326: stba %g1, [%o0 + 2] %asi
337: stba %g7, [%o0 + 3] %asi
34 srlx %g3, 16, %g1
358: stba %g2, [%o0 + 4] %asi
36 srlx %g3, 8, %g7
379: stba %g1, [%o0 + 5] %asi
3810: stba %g7, [%o0 + 6] %asi
39 ba,pt %xcc, 0f
4011: stba %g3, [%o0 + 7] %asi
411: srl %g3, 16, %g7
4212: stba %g2, [%o0] %asi
43 srl %g3, 8, %g2
4413: stba %g7, [%o0 + 1] %asi
4514: stba %g2, [%o0 + 2] %asi
46 ba,pt %xcc, 0f
4715: stba %g3, [%o0 + 3] %asi
482: srl %g3, 8, %g2
4916: stba %g2, [%o0] %asi
5017: stba %g3, [%o0 + 1] %asi
510:
52 wr %o4, 0x0, %asi
53 retl
54 nop
55 .size __do_int_store, .-__do_int_store
56
57 .section __ex_table
58 .word 4b, kernel_unaligned_trap_fault
59 .word 5b, kernel_unaligned_trap_fault
60 .word 6b, kernel_unaligned_trap_fault
61 .word 7b, kernel_unaligned_trap_fault
62 .word 8b, kernel_unaligned_trap_fault
63 .word 9b, kernel_unaligned_trap_fault
64 .word 10b, kernel_unaligned_trap_fault
65 .word 11b, kernel_unaligned_trap_fault
66 .word 12b, kernel_unaligned_trap_fault
67 .word 13b, kernel_unaligned_trap_fault
68 .word 14b, kernel_unaligned_trap_fault
69 .word 15b, kernel_unaligned_trap_fault
70 .word 16b, kernel_unaligned_trap_fault
71 .word 17b, kernel_unaligned_trap_fault
72 .previous
73
74 .globl do_int_load
75do_int_load:
76 rd %asi, %o5
77 wr %o4, 0, %asi
78 cmp %o1, 8
79 bge,pn %icc, 9f
80 cmp %o1, 4
81 be,pt %icc, 6f
824: lduba [%o2] %asi, %g2
835: lduba [%o2 + 1] %asi, %g3
84 sll %g2, 8, %g2
85 brz,pt %o3, 3f
86 add %g2, %g3, %g2
87 sllx %g2, 48, %g2
88 srax %g2, 48, %g2
893: ba,pt %xcc, 0f
90 stx %g2, [%o0]
916: lduba [%o2 + 1] %asi, %g3
92 sll %g2, 24, %g2
937: lduba [%o2 + 2] %asi, %g7
94 sll %g3, 16, %g3
958: lduba [%o2 + 3] %asi, %g1
96 sll %g7, 8, %g7
97 or %g2, %g3, %g2
98 or %g7, %g1, %g7
99 or %g2, %g7, %g2
100 brnz,a,pt %o3, 3f
101 sra %g2, 0, %g2
1023: ba,pt %xcc, 0f
103 stx %g2, [%o0]
1049: lduba [%o2] %asi, %g2
10510: lduba [%o2 + 1] %asi, %g3
106 sllx %g2, 56, %g2
10711: lduba [%o2 + 2] %asi, %g7
108 sllx %g3, 48, %g3
10912: lduba [%o2 + 3] %asi, %g1
110 sllx %g7, 40, %g7
111 sllx %g1, 32, %g1
112 or %g2, %g3, %g2
113 or %g7, %g1, %g7
11413: lduba [%o2 + 4] %asi, %g3
115 or %g2, %g7, %g7
11614: lduba [%o2 + 5] %asi, %g1
117 sllx %g3, 24, %g3
11815: lduba [%o2 + 6] %asi, %g2
119 sllx %g1, 16, %g1
120 or %g7, %g3, %g7
12116: lduba [%o2 + 7] %asi, %g3
122 sllx %g2, 8, %g2
123 or %g7, %g1, %g7
124 or %g2, %g3, %g2
125 or %g7, %g2, %g7
126 cmp %o1, 8
127 be,a,pt %icc, 0f
128 stx %g7, [%o0]
129 srlx %g7, 32, %g2
130 sra %g7, 0, %g7
131 stx %g2, [%o0]
132 stx %g7, [%o0 + 8]
1330:
134 wr %o5, 0x0, %asi
135 retl
136 nop
137 .size __do_int_load, .-__do_int_load
138
139 .section __ex_table
140 .word 4b, kernel_unaligned_trap_fault
141 .word 5b, kernel_unaligned_trap_fault
142 .word 6b, kernel_unaligned_trap_fault
143 .word 7b, kernel_unaligned_trap_fault
144 .word 8b, kernel_unaligned_trap_fault
145 .word 9b, kernel_unaligned_trap_fault
146 .word 10b, kernel_unaligned_trap_fault
147 .word 11b, kernel_unaligned_trap_fault
148 .word 12b, kernel_unaligned_trap_fault
149 .word 13b, kernel_unaligned_trap_fault
150 .word 14b, kernel_unaligned_trap_fault
151 .word 15b, kernel_unaligned_trap_fault
152 .word 16b, kernel_unaligned_trap_fault
153 .previous
diff --git a/arch/sparc64/kernel/unaligned.c b/arch/sparc64/kernel/unaligned.c
index 4372bf32ecf6..da9739f0d437 100644
--- a/arch/sparc64/kernel/unaligned.c
+++ b/arch/sparc64/kernel/unaligned.c
@@ -180,169 +180,28 @@ static void __attribute_used__ unaligned_panic(char *str, struct pt_regs *regs)
180 die_if_kernel(str, regs); 180 die_if_kernel(str, regs);
181} 181}
182 182
183#define do_integer_load(dest_reg, size, saddr, is_signed, asi, errh) ({ \ 183extern void do_int_load(unsigned long *dest_reg, int size,
184__asm__ __volatile__ ( \ 184 unsigned long *saddr, int is_signed, int asi);
185 "wr %4, 0, %%asi\n\t" \
186 "cmp %1, 8\n\t" \
187 "bge,pn %%icc, 9f\n\t" \
188 " cmp %1, 4\n\t" \
189 "be,pt %%icc, 6f\n" \
190"4:\t" " lduba [%2] %%asi, %%l1\n" \
191"5:\t" "lduba [%2 + 1] %%asi, %%l2\n\t" \
192 "sll %%l1, 8, %%l1\n\t" \
193 "brz,pt %3, 3f\n\t" \
194 " add %%l1, %%l2, %%l1\n\t" \
195 "sllx %%l1, 48, %%l1\n\t" \
196 "srax %%l1, 48, %%l1\n" \
197"3:\t" "ba,pt %%xcc, 0f\n\t" \
198 " stx %%l1, [%0]\n" \
199"6:\t" "lduba [%2 + 1] %%asi, %%l2\n\t" \
200 "sll %%l1, 24, %%l1\n" \
201"7:\t" "lduba [%2 + 2] %%asi, %%g7\n\t" \
202 "sll %%l2, 16, %%l2\n" \
203"8:\t" "lduba [%2 + 3] %%asi, %%g1\n\t" \
204 "sll %%g7, 8, %%g7\n\t" \
205 "or %%l1, %%l2, %%l1\n\t" \
206 "or %%g7, %%g1, %%g7\n\t" \
207 "or %%l1, %%g7, %%l1\n\t" \
208 "brnz,a,pt %3, 3f\n\t" \
209 " sra %%l1, 0, %%l1\n" \
210"3:\t" "ba,pt %%xcc, 0f\n\t" \
211 " stx %%l1, [%0]\n" \
212"9:\t" "lduba [%2] %%asi, %%l1\n" \
213"10:\t" "lduba [%2 + 1] %%asi, %%l2\n\t" \
214 "sllx %%l1, 56, %%l1\n" \
215"11:\t" "lduba [%2 + 2] %%asi, %%g7\n\t" \
216 "sllx %%l2, 48, %%l2\n" \
217"12:\t" "lduba [%2 + 3] %%asi, %%g1\n\t" \
218 "sllx %%g7, 40, %%g7\n\t" \
219 "sllx %%g1, 32, %%g1\n\t" \
220 "or %%l1, %%l2, %%l1\n\t" \
221 "or %%g7, %%g1, %%g7\n" \
222"13:\t" "lduba [%2 + 4] %%asi, %%l2\n\t" \
223 "or %%l1, %%g7, %%g7\n" \
224"14:\t" "lduba [%2 + 5] %%asi, %%g1\n\t" \
225 "sllx %%l2, 24, %%l2\n" \
226"15:\t" "lduba [%2 + 6] %%asi, %%l1\n\t" \
227 "sllx %%g1, 16, %%g1\n\t" \
228 "or %%g7, %%l2, %%g7\n" \
229"16:\t" "lduba [%2 + 7] %%asi, %%l2\n\t" \
230 "sllx %%l1, 8, %%l1\n\t" \
231 "or %%g7, %%g1, %%g7\n\t" \
232 "or %%l1, %%l2, %%l1\n\t" \
233 "or %%g7, %%l1, %%g7\n\t" \
234 "cmp %1, 8\n\t" \
235 "be,a,pt %%icc, 0f\n\t" \
236 " stx %%g7, [%0]\n\t" \
237 "srlx %%g7, 32, %%l1\n\t" \
238 "sra %%g7, 0, %%g7\n\t" \
239 "stx %%l1, [%0]\n\t" \
240 "stx %%g7, [%0 + 8]\n" \
241"0:\n\t" \
242 "wr %%g0, %5, %%asi\n\n\t" \
243 ".section __ex_table\n\t" \
244 ".word 4b, " #errh "\n\t" \
245 ".word 5b, " #errh "\n\t" \
246 ".word 6b, " #errh "\n\t" \
247 ".word 7b, " #errh "\n\t" \
248 ".word 8b, " #errh "\n\t" \
249 ".word 9b, " #errh "\n\t" \
250 ".word 10b, " #errh "\n\t" \
251 ".word 11b, " #errh "\n\t" \
252 ".word 12b, " #errh "\n\t" \
253 ".word 13b, " #errh "\n\t" \
254 ".word 14b, " #errh "\n\t" \
255 ".word 15b, " #errh "\n\t" \
256 ".word 16b, " #errh "\n\n\t" \
257 ".previous\n\t" \
258 : : "r" (dest_reg), "r" (size), "r" (saddr), "r" (is_signed), \
259 "r" (asi), "i" (ASI_AIUS) \
260 : "l1", "l2", "g7", "g1", "cc"); \
261})
262 185
263#define store_common(dst_addr, size, src_val, asi, errh) ({ \ 186extern void __do_int_store(unsigned long *dst_addr, int size,
264__asm__ __volatile__ ( \ 187 unsigned long *src_val, int asi);
265 "wr %3, 0, %%asi\n\t" \ 188
266 "ldx [%2], %%l1\n" \ 189static inline void do_int_store(int reg_num, int size, unsigned long *dst_addr,
267 "cmp %1, 2\n\t" \ 190 struct pt_regs *regs, int asi)
268 "be,pn %%icc, 2f\n\t" \ 191{
269 " cmp %1, 4\n\t" \ 192 unsigned long zero = 0;
270 "be,pt %%icc, 1f\n\t" \ 193 unsigned long *src_val = &zero;
271 " srlx %%l1, 24, %%l2\n\t" \ 194
272 "srlx %%l1, 56, %%g1\n\t" \ 195 if (size == 16) {
273 "srlx %%l1, 48, %%g7\n" \ 196 size = 8;
274"4:\t" "stba %%g1, [%0] %%asi\n\t" \ 197 zero = (((long)(reg_num ?
275 "srlx %%l1, 40, %%g1\n" \ 198 (unsigned)fetch_reg(reg_num, regs) : 0)) << 32) |
276"5:\t" "stba %%g7, [%0 + 1] %%asi\n\t" \ 199 (unsigned)fetch_reg(reg_num + 1, regs);
277 "srlx %%l1, 32, %%g7\n" \ 200 } else if (reg_num) {
278"6:\t" "stba %%g1, [%0 + 2] %%asi\n" \ 201 src_val = fetch_reg_addr(reg_num, regs);
279"7:\t" "stba %%g7, [%0 + 3] %%asi\n\t" \ 202 }
280 "srlx %%l1, 16, %%g1\n" \ 203 __do_int_store(dst_addr, size, src_val, asi);
281"8:\t" "stba %%l2, [%0 + 4] %%asi\n\t" \ 204}
282 "srlx %%l1, 8, %%g7\n" \
283"9:\t" "stba %%g1, [%0 + 5] %%asi\n" \
284"10:\t" "stba %%g7, [%0 + 6] %%asi\n\t" \
285 "ba,pt %%xcc, 0f\n" \
286"11:\t" " stba %%l1, [%0 + 7] %%asi\n" \
287"1:\t" "srl %%l1, 16, %%g7\n" \
288"12:\t" "stba %%l2, [%0] %%asi\n\t" \
289 "srl %%l1, 8, %%l2\n" \
290"13:\t" "stba %%g7, [%0 + 1] %%asi\n" \
291"14:\t" "stba %%l2, [%0 + 2] %%asi\n\t" \
292 "ba,pt %%xcc, 0f\n" \
293"15:\t" " stba %%l1, [%0 + 3] %%asi\n" \
294"2:\t" "srl %%l1, 8, %%l2\n" \
295"16:\t" "stba %%l2, [%0] %%asi\n" \
296"17:\t" "stba %%l1, [%0 + 1] %%asi\n" \
297"0:\n\t" \
298 "wr %%g0, %4, %%asi\n\n\t" \
299 ".section __ex_table\n\t" \
300 ".word 4b, " #errh "\n\t" \
301 ".word 5b, " #errh "\n\t" \
302 ".word 6b, " #errh "\n\t" \
303 ".word 7b, " #errh "\n\t" \
304 ".word 8b, " #errh "\n\t" \
305 ".word 9b, " #errh "\n\t" \
306 ".word 10b, " #errh "\n\t" \
307 ".word 11b, " #errh "\n\t" \
308 ".word 12b, " #errh "\n\t" \
309 ".word 13b, " #errh "\n\t" \
310 ".word 14b, " #errh "\n\t" \
311 ".word 15b, " #errh "\n\t" \
312 ".word 16b, " #errh "\n\t" \
313 ".word 17b, " #errh "\n\n\t" \
314 ".previous\n\t" \
315 : : "r" (dst_addr), "r" (size), "r" (src_val), "r" (asi), "i" (ASI_AIUS)\
316 : "l1", "l2", "g7", "g1", "cc"); \
317})
318
319#define do_integer_store(reg_num, size, dst_addr, regs, asi, errh) ({ \
320 unsigned long zero = 0; \
321 unsigned long *src_val = &zero; \
322 \
323 if (size == 16) { \
324 size = 8; \
325 zero = (((long)(reg_num ? \
326 (unsigned)fetch_reg(reg_num, regs) : 0)) << 32) | \
327 (unsigned)fetch_reg(reg_num + 1, regs); \
328 } else if (reg_num) src_val = fetch_reg_addr(reg_num, regs); \
329 store_common(dst_addr, size, src_val, asi, errh); \
330})
331
332extern void smp_capture(void);
333extern void smp_release(void);
334
335#define do_atomic(srcdest_reg, mem, errh) ({ \
336 unsigned long flags, tmp; \
337 \
338 smp_capture(); \
339 local_irq_save(flags); \
340 tmp = *srcdest_reg; \
341 do_integer_load(srcdest_reg, 4, mem, 0, errh); \
342 store_common(mem, 4, &tmp, errh); \
343 local_irq_restore(flags); \
344 smp_release(); \
345})
346 205
347static inline void advance(struct pt_regs *regs) 206static inline void advance(struct pt_regs *regs)
348{ 207{
@@ -364,24 +223,29 @@ static inline int ok_for_kernel(unsigned int insn)
364 return !floating_point_load_or_store_p(insn); 223 return !floating_point_load_or_store_p(insn);
365} 224}
366 225
367void kernel_mna_trap_fault(struct pt_regs *regs, unsigned int insn) __asm__ ("kernel_mna_trap_fault"); 226void kernel_mna_trap_fault(void)
368
369void kernel_mna_trap_fault(struct pt_regs *regs, unsigned int insn)
370{ 227{
371 unsigned long g2 = regs->u_regs [UREG_G2]; 228 struct pt_regs *regs = current_thread_info()->kern_una_regs;
229 unsigned int insn = current_thread_info()->kern_una_insn;
230 unsigned long g2 = regs->u_regs[UREG_G2];
372 unsigned long fixup = search_extables_range(regs->tpc, &g2); 231 unsigned long fixup = search_extables_range(regs->tpc, &g2);
373 232
374 if (!fixup) { 233 if (!fixup) {
375 unsigned long address = compute_effective_address(regs, insn, ((insn >> 25) & 0x1f)); 234 unsigned long address;
235
236 address = compute_effective_address(regs, insn,
237 ((insn >> 25) & 0x1f));
376 if (address < PAGE_SIZE) { 238 if (address < PAGE_SIZE) {
377 printk(KERN_ALERT "Unable to handle kernel NULL pointer dereference in mna handler"); 239 printk(KERN_ALERT "Unable to handle kernel NULL "
240 "pointer dereference in mna handler");
378 } else 241 } else
379 printk(KERN_ALERT "Unable to handle kernel paging request in mna handler"); 242 printk(KERN_ALERT "Unable to handle kernel paging "
243 "request in mna handler");
380 printk(KERN_ALERT " at virtual address %016lx\n",address); 244 printk(KERN_ALERT " at virtual address %016lx\n",address);
381 printk(KERN_ALERT "current->{mm,active_mm}->context = %016lx\n", 245 printk(KERN_ALERT "current->{active_,}mm->context = %016lx\n",
382 (current->mm ? CTX_HWBITS(current->mm->context) : 246 (current->mm ? CTX_HWBITS(current->mm->context) :
383 CTX_HWBITS(current->active_mm->context))); 247 CTX_HWBITS(current->active_mm->context)));
384 printk(KERN_ALERT "current->{mm,active_mm}->pgd = %016lx\n", 248 printk(KERN_ALERT "current->{active_,}mm->pgd = %016lx\n",
385 (current->mm ? (unsigned long) current->mm->pgd : 249 (current->mm ? (unsigned long) current->mm->pgd :
386 (unsigned long) current->active_mm->pgd)); 250 (unsigned long) current->active_mm->pgd));
387 die_if_kernel("Oops", regs); 251 die_if_kernel("Oops", regs);
@@ -400,48 +264,41 @@ asmlinkage void kernel_unaligned_trap(struct pt_regs *regs, unsigned int insn, u
400 enum direction dir = decode_direction(insn); 264 enum direction dir = decode_direction(insn);
401 int size = decode_access_size(insn); 265 int size = decode_access_size(insn);
402 266
267 current_thread_info()->kern_una_regs = regs;
268 current_thread_info()->kern_una_insn = insn;
269
403 if (!ok_for_kernel(insn) || dir == both) { 270 if (!ok_for_kernel(insn) || dir == both) {
404 printk("Unsupported unaligned load/store trap for kernel at <%016lx>.\n", 271 printk("Unsupported unaligned load/store trap for kernel "
405 regs->tpc); 272 "at <%016lx>.\n", regs->tpc);
406 unaligned_panic("Kernel does fpu/atomic unaligned load/store.", regs); 273 unaligned_panic("Kernel does fpu/atomic "
407 274 "unaligned load/store.", regs);
408 __asm__ __volatile__ ("\n" 275
409"kernel_unaligned_trap_fault:\n\t" 276 kernel_mna_trap_fault();
410 "mov %0, %%o0\n\t"
411 "call kernel_mna_trap_fault\n\t"
412 " mov %1, %%o1\n\t"
413 :
414 : "r" (regs), "r" (insn)
415 : "o0", "o1", "o2", "o3", "o4", "o5", "o7",
416 "g1", "g2", "g3", "g4", "g7", "cc");
417 } else { 277 } else {
418 unsigned long addr = compute_effective_address(regs, insn, ((insn >> 25) & 0x1f)); 278 unsigned long addr;
419 279
280 addr = compute_effective_address(regs, insn,
281 ((insn >> 25) & 0x1f));
420#ifdef DEBUG_MNA 282#ifdef DEBUG_MNA
421 printk("KMNA: pc=%016lx [dir=%s addr=%016lx size=%d] retpc[%016lx]\n", 283 printk("KMNA: pc=%016lx [dir=%s addr=%016lx size=%d] "
422 regs->tpc, dirstrings[dir], addr, size, regs->u_regs[UREG_RETPC]); 284 "retpc[%016lx]\n",
285 regs->tpc, dirstrings[dir], addr, size,
286 regs->u_regs[UREG_RETPC]);
423#endif 287#endif
424 switch (dir) { 288 switch (dir) {
425 case load: 289 case load:
426 do_integer_load(fetch_reg_addr(((insn>>25)&0x1f), regs), 290 do_int_load(fetch_reg_addr(((insn>>25)&0x1f), regs),
427 size, (unsigned long *) addr, 291 size, (unsigned long *) addr,
428 decode_signedness(insn), decode_asi(insn, regs), 292 decode_signedness(insn),
429 kernel_unaligned_trap_fault); 293 decode_asi(insn, regs));
430 break; 294 break;
431 295
432 case store: 296 case store:
433 do_integer_store(((insn>>25)&0x1f), size, 297 do_int_store(((insn>>25)&0x1f), size,
434 (unsigned long *) addr, regs, 298 (unsigned long *) addr, regs,
435 decode_asi(insn, regs), 299 decode_asi(insn, regs));
436 kernel_unaligned_trap_fault);
437 break;
438#if 0 /* unsupported */
439 case both:
440 do_atomic(fetch_reg_addr(((insn>>25)&0x1f), regs),
441 (unsigned long *) addr,
442 kernel_unaligned_trap_fault);
443 break; 300 break;
444#endif 301
445 default: 302 default:
446 panic("Impossible kernel unaligned trap."); 303 panic("Impossible kernel unaligned trap.");
447 /* Not reached... */ 304 /* Not reached... */
@@ -492,9 +349,9 @@ int handle_popc(u32 insn, struct pt_regs *regs)
492 349
493extern void do_fpother(struct pt_regs *regs); 350extern void do_fpother(struct pt_regs *regs);
494extern void do_privact(struct pt_regs *regs); 351extern void do_privact(struct pt_regs *regs);
495extern void data_access_exception(struct pt_regs *regs, 352extern void spitfire_data_access_exception(struct pt_regs *regs,
496 unsigned long sfsr, 353 unsigned long sfsr,
497 unsigned long sfar); 354 unsigned long sfar);
498 355
499int handle_ldf_stq(u32 insn, struct pt_regs *regs) 356int handle_ldf_stq(u32 insn, struct pt_regs *regs)
500{ 357{
@@ -537,14 +394,14 @@ int handle_ldf_stq(u32 insn, struct pt_regs *regs)
537 break; 394 break;
538 } 395 }
539 default: 396 default:
540 data_access_exception(regs, 0, addr); 397 spitfire_data_access_exception(regs, 0, addr);
541 return 1; 398 return 1;
542 } 399 }
543 if (put_user (first >> 32, (u32 __user *)addr) || 400 if (put_user (first >> 32, (u32 __user *)addr) ||
544 __put_user ((u32)first, (u32 __user *)(addr + 4)) || 401 __put_user ((u32)first, (u32 __user *)(addr + 4)) ||
545 __put_user (second >> 32, (u32 __user *)(addr + 8)) || 402 __put_user (second >> 32, (u32 __user *)(addr + 8)) ||
546 __put_user ((u32)second, (u32 __user *)(addr + 12))) { 403 __put_user ((u32)second, (u32 __user *)(addr + 12))) {
547 data_access_exception(regs, 0, addr); 404 spitfire_data_access_exception(regs, 0, addr);
548 return 1; 405 return 1;
549 } 406 }
550 } else { 407 } else {
@@ -557,7 +414,7 @@ int handle_ldf_stq(u32 insn, struct pt_regs *regs)
557 do_privact(regs); 414 do_privact(regs);
558 return 1; 415 return 1;
559 } else if (asi > ASI_SNFL) { 416 } else if (asi > ASI_SNFL) {
560 data_access_exception(regs, 0, addr); 417 spitfire_data_access_exception(regs, 0, addr);
561 return 1; 418 return 1;
562 } 419 }
563 switch (insn & 0x180000) { 420 switch (insn & 0x180000) {
@@ -574,7 +431,7 @@ int handle_ldf_stq(u32 insn, struct pt_regs *regs)
574 err |= __get_user (data[i], (u32 __user *)(addr + 4*i)); 431 err |= __get_user (data[i], (u32 __user *)(addr + 4*i));
575 } 432 }
576 if (err && !(asi & 0x2 /* NF */)) { 433 if (err && !(asi & 0x2 /* NF */)) {
577 data_access_exception(regs, 0, addr); 434 spitfire_data_access_exception(regs, 0, addr);
578 return 1; 435 return 1;
579 } 436 }
580 if (asi & 0x8) /* Little */ { 437 if (asi & 0x8) /* Little */ {
@@ -677,7 +534,7 @@ void handle_lddfmna(struct pt_regs *regs, unsigned long sfar, unsigned long sfsr
677 *(u64 *)(f->regs + freg) = value; 534 *(u64 *)(f->regs + freg) = value;
678 current_thread_info()->fpsaved[0] |= flag; 535 current_thread_info()->fpsaved[0] |= flag;
679 } else { 536 } else {
680daex: data_access_exception(regs, sfsr, sfar); 537daex: spitfire_data_access_exception(regs, sfsr, sfar);
681 return; 538 return;
682 } 539 }
683 advance(regs); 540 advance(regs);
@@ -721,7 +578,7 @@ void handle_stdfmna(struct pt_regs *regs, unsigned long sfar, unsigned long sfsr
721 __put_user ((u32)value, (u32 __user *)(sfar + 4))) 578 __put_user ((u32)value, (u32 __user *)(sfar + 4)))
722 goto daex; 579 goto daex;
723 } else { 580 } else {
724daex: data_access_exception(regs, sfsr, sfar); 581daex: spitfire_data_access_exception(regs, sfsr, sfar);
725 return; 582 return;
726 } 583 }
727 advance(regs); 584 advance(regs);
diff --git a/arch/sparc64/kernel/us2e_cpufreq.c b/arch/sparc64/kernel/us2e_cpufreq.c
index 7aae0a18aabe..686e526bec04 100644
--- a/arch/sparc64/kernel/us2e_cpufreq.c
+++ b/arch/sparc64/kernel/us2e_cpufreq.c
@@ -88,7 +88,6 @@ static void frob_mem_refresh(int cpu_slowing_down,
88{ 88{
89 unsigned long old_refr_count, refr_count, mctrl; 89 unsigned long old_refr_count, refr_count, mctrl;
90 90
91
92 refr_count = (clock_tick * MCTRL0_REFR_INTERVAL); 91 refr_count = (clock_tick * MCTRL0_REFR_INTERVAL);
93 refr_count /= (MCTRL0_REFR_CLKS_P_CNT * divisor * 1000000000UL); 92 refr_count /= (MCTRL0_REFR_CLKS_P_CNT * divisor * 1000000000UL);
94 93
@@ -230,6 +229,25 @@ static unsigned long estar_to_divisor(unsigned long estar)
230 return ret; 229 return ret;
231} 230}
232 231
232static unsigned int us2e_freq_get(unsigned int cpu)
233{
234 cpumask_t cpus_allowed;
235 unsigned long clock_tick, estar;
236
237 if (!cpu_online(cpu))
238 return 0;
239
240 cpus_allowed = current->cpus_allowed;
241 set_cpus_allowed(current, cpumask_of_cpu(cpu));
242
243 clock_tick = sparc64_get_clock_tick(cpu) / 1000;
244 estar = read_hbreg(HBIRD_ESTAR_MODE_ADDR);
245
246 set_cpus_allowed(current, cpus_allowed);
247
248 return clock_tick / estar_to_divisor(estar);
249}
250
233static void us2e_set_cpu_divider_index(unsigned int cpu, unsigned int index) 251static void us2e_set_cpu_divider_index(unsigned int cpu, unsigned int index)
234{ 252{
235 unsigned long new_bits, new_freq; 253 unsigned long new_bits, new_freq;
@@ -243,7 +261,7 @@ static void us2e_set_cpu_divider_index(unsigned int cpu, unsigned int index)
243 cpus_allowed = current->cpus_allowed; 261 cpus_allowed = current->cpus_allowed;
244 set_cpus_allowed(current, cpumask_of_cpu(cpu)); 262 set_cpus_allowed(current, cpumask_of_cpu(cpu));
245 263
246 new_freq = clock_tick = sparc64_get_clock_tick(cpu); 264 new_freq = clock_tick = sparc64_get_clock_tick(cpu) / 1000;
247 new_bits = index_to_estar_mode(index); 265 new_bits = index_to_estar_mode(index);
248 divisor = index_to_divisor(index); 266 divisor = index_to_divisor(index);
249 new_freq /= divisor; 267 new_freq /= divisor;
@@ -258,7 +276,8 @@ static void us2e_set_cpu_divider_index(unsigned int cpu, unsigned int index)
258 cpufreq_notify_transition(&freqs, CPUFREQ_PRECHANGE); 276 cpufreq_notify_transition(&freqs, CPUFREQ_PRECHANGE);
259 277
260 if (old_divisor != divisor) 278 if (old_divisor != divisor)
261 us2e_transition(estar, new_bits, clock_tick, old_divisor, divisor); 279 us2e_transition(estar, new_bits, clock_tick * 1000,
280 old_divisor, divisor);
262 281
263 cpufreq_notify_transition(&freqs, CPUFREQ_POSTCHANGE); 282 cpufreq_notify_transition(&freqs, CPUFREQ_POSTCHANGE);
264 283
@@ -272,10 +291,8 @@ static int us2e_freq_target(struct cpufreq_policy *policy,
272 unsigned int new_index = 0; 291 unsigned int new_index = 0;
273 292
274 if (cpufreq_frequency_table_target(policy, 293 if (cpufreq_frequency_table_target(policy,
275 &us2e_freq_table[policy->cpu].table[0], 294 &us2e_freq_table[policy->cpu].table[0],
276 target_freq, 295 target_freq, relation, &new_index))
277 relation,
278 &new_index))
279 return -EINVAL; 296 return -EINVAL;
280 297
281 us2e_set_cpu_divider_index(policy->cpu, new_index); 298 us2e_set_cpu_divider_index(policy->cpu, new_index);
@@ -292,7 +309,7 @@ static int us2e_freq_verify(struct cpufreq_policy *policy)
292static int __init us2e_freq_cpu_init(struct cpufreq_policy *policy) 309static int __init us2e_freq_cpu_init(struct cpufreq_policy *policy)
293{ 310{
294 unsigned int cpu = policy->cpu; 311 unsigned int cpu = policy->cpu;
295 unsigned long clock_tick = sparc64_get_clock_tick(cpu); 312 unsigned long clock_tick = sparc64_get_clock_tick(cpu) / 1000;
296 struct cpufreq_frequency_table *table = 313 struct cpufreq_frequency_table *table =
297 &us2e_freq_table[cpu].table[0]; 314 &us2e_freq_table[cpu].table[0];
298 315
@@ -351,9 +368,10 @@ static int __init us2e_freq_init(void)
351 memset(us2e_freq_table, 0, 368 memset(us2e_freq_table, 0,
352 (NR_CPUS * sizeof(struct us2e_freq_percpu_info))); 369 (NR_CPUS * sizeof(struct us2e_freq_percpu_info)));
353 370
371 driver->init = us2e_freq_cpu_init;
354 driver->verify = us2e_freq_verify; 372 driver->verify = us2e_freq_verify;
355 driver->target = us2e_freq_target; 373 driver->target = us2e_freq_target;
356 driver->init = us2e_freq_cpu_init; 374 driver->get = us2e_freq_get;
357 driver->exit = us2e_freq_cpu_exit; 375 driver->exit = us2e_freq_cpu_exit;
358 driver->owner = THIS_MODULE, 376 driver->owner = THIS_MODULE,
359 strcpy(driver->name, "UltraSPARC-IIe"); 377 strcpy(driver->name, "UltraSPARC-IIe");
diff --git a/arch/sparc64/kernel/us3_cpufreq.c b/arch/sparc64/kernel/us3_cpufreq.c
index 18fe54b8aa55..9080e7cd4bb0 100644
--- a/arch/sparc64/kernel/us3_cpufreq.c
+++ b/arch/sparc64/kernel/us3_cpufreq.c
@@ -56,7 +56,7 @@ static void write_safari_cfg(unsigned long val)
56 56
57static unsigned long get_current_freq(unsigned int cpu, unsigned long safari_cfg) 57static unsigned long get_current_freq(unsigned int cpu, unsigned long safari_cfg)
58{ 58{
59 unsigned long clock_tick = sparc64_get_clock_tick(cpu); 59 unsigned long clock_tick = sparc64_get_clock_tick(cpu) / 1000;
60 unsigned long ret; 60 unsigned long ret;
61 61
62 switch (safari_cfg & SAFARI_CFG_DIV_MASK) { 62 switch (safari_cfg & SAFARI_CFG_DIV_MASK) {
@@ -76,6 +76,26 @@ static unsigned long get_current_freq(unsigned int cpu, unsigned long safari_cfg
76 return ret; 76 return ret;
77} 77}
78 78
79static unsigned int us3_freq_get(unsigned int cpu)
80{
81 cpumask_t cpus_allowed;
82 unsigned long reg;
83 unsigned int ret;
84
85 if (!cpu_online(cpu))
86 return 0;
87
88 cpus_allowed = current->cpus_allowed;
89 set_cpus_allowed(current, cpumask_of_cpu(cpu));
90
91 reg = read_safari_cfg();
92 ret = get_current_freq(cpu, reg);
93
94 set_cpus_allowed(current, cpus_allowed);
95
96 return ret;
97}
98
79static void us3_set_cpu_divider_index(unsigned int cpu, unsigned int index) 99static void us3_set_cpu_divider_index(unsigned int cpu, unsigned int index)
80{ 100{
81 unsigned long new_bits, new_freq, reg; 101 unsigned long new_bits, new_freq, reg;
@@ -88,7 +108,7 @@ static void us3_set_cpu_divider_index(unsigned int cpu, unsigned int index)
88 cpus_allowed = current->cpus_allowed; 108 cpus_allowed = current->cpus_allowed;
89 set_cpus_allowed(current, cpumask_of_cpu(cpu)); 109 set_cpus_allowed(current, cpumask_of_cpu(cpu));
90 110
91 new_freq = sparc64_get_clock_tick(cpu); 111 new_freq = sparc64_get_clock_tick(cpu) / 1000;
92 switch (index) { 112 switch (index) {
93 case 0: 113 case 0:
94 new_bits = SAFARI_CFG_DIV_1; 114 new_bits = SAFARI_CFG_DIV_1;
@@ -150,7 +170,7 @@ static int us3_freq_verify(struct cpufreq_policy *policy)
150static int __init us3_freq_cpu_init(struct cpufreq_policy *policy) 170static int __init us3_freq_cpu_init(struct cpufreq_policy *policy)
151{ 171{
152 unsigned int cpu = policy->cpu; 172 unsigned int cpu = policy->cpu;
153 unsigned long clock_tick = sparc64_get_clock_tick(cpu); 173 unsigned long clock_tick = sparc64_get_clock_tick(cpu) / 1000;
154 struct cpufreq_frequency_table *table = 174 struct cpufreq_frequency_table *table =
155 &us3_freq_table[cpu].table[0]; 175 &us3_freq_table[cpu].table[0];
156 176
@@ -206,9 +226,10 @@ static int __init us3_freq_init(void)
206 memset(us3_freq_table, 0, 226 memset(us3_freq_table, 0,
207 (NR_CPUS * sizeof(struct us3_freq_percpu_info))); 227 (NR_CPUS * sizeof(struct us3_freq_percpu_info)));
208 228
229 driver->init = us3_freq_cpu_init;
209 driver->verify = us3_freq_verify; 230 driver->verify = us3_freq_verify;
210 driver->target = us3_freq_target; 231 driver->target = us3_freq_target;
211 driver->init = us3_freq_cpu_init; 232 driver->get = us3_freq_get;
212 driver->exit = us3_freq_cpu_exit; 233 driver->exit = us3_freq_cpu_exit;
213 driver->owner = THIS_MODULE, 234 driver->owner = THIS_MODULE,
214 strcpy(driver->name, "UltraSPARC-III"); 235 strcpy(driver->name, "UltraSPARC-III");
diff --git a/arch/sparc64/kernel/winfixup.S b/arch/sparc64/kernel/winfixup.S
index dfbc7e0dcf70..99c809a1e5ac 100644
--- a/arch/sparc64/kernel/winfixup.S
+++ b/arch/sparc64/kernel/winfixup.S
@@ -318,7 +318,7 @@ fill_fixup_dax:
318 nop 318 nop
319 rdpr %pstate, %l1 ! Prepare to change globals. 319 rdpr %pstate, %l1 ! Prepare to change globals.
320 mov %g4, %o1 ! Setup args for 320 mov %g4, %o1 ! Setup args for
321 mov %g5, %o2 ! final call to data_access_exception. 321 mov %g5, %o2 ! final call to spitfire_data_access_exception.
322 andn %l1, PSTATE_MM, %l1 ! We want to be in RMO 322 andn %l1, PSTATE_MM, %l1 ! We want to be in RMO
323 323
324 mov %g6, %o7 ! Stash away current. 324 mov %g6, %o7 ! Stash away current.
@@ -330,7 +330,7 @@ fill_fixup_dax:
330 mov TSB_REG, %g1 330 mov TSB_REG, %g1
331 ldxa [%g1] ASI_IMMU, %g5 331 ldxa [%g1] ASI_IMMU, %g5
332#endif 332#endif
333 call data_access_exception 333 call spitfire_data_access_exception
334 add %sp, PTREGS_OFF, %o0 334 add %sp, PTREGS_OFF, %o0
335 335
336 b,pt %xcc, rtrap 336 b,pt %xcc, rtrap
@@ -391,7 +391,7 @@ window_dax_from_user_common:
391109: or %g7, %lo(109b), %g7 391109: or %g7, %lo(109b), %g7
392 mov %l4, %o1 392 mov %l4, %o1
393 mov %l5, %o2 393 mov %l5, %o2
394 call data_access_exception 394 call spitfire_data_access_exception
395 add %sp, PTREGS_OFF, %o0 395 add %sp, PTREGS_OFF, %o0
396 ba,pt %xcc, rtrap 396 ba,pt %xcc, rtrap
397 clr %l6 397 clr %l6
diff --git a/arch/sparc64/lib/Makefile b/arch/sparc64/lib/Makefile
index 40dbeec7e5d6..6201f1040982 100644
--- a/arch/sparc64/lib/Makefile
+++ b/arch/sparc64/lib/Makefile
@@ -12,7 +12,7 @@ lib-y := PeeCeeI.o copy_page.o clear_page.o strlen.o strncmp.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 copy_in_user.o user_fixup.o memmove.o \ 14 copy_in_user.o user_fixup.o memmove.o \
15 mcount.o ipcsum.o rwsem.o xor.o find_bit.o delay.o 15 mcount.o ipcsum.o rwsem.o xor.o find_bit.o delay.o mb.o
16 16
17lib-$(CONFIG_DEBUG_SPINLOCK) += debuglocks.o 17lib-$(CONFIG_DEBUG_SPINLOCK) += debuglocks.o
18lib-$(CONFIG_HAVE_DEC_LOCK) += dec_and_lock.o 18lib-$(CONFIG_HAVE_DEC_LOCK) += dec_and_lock.o
diff --git a/arch/sparc64/lib/PeeCeeI.c b/arch/sparc64/lib/PeeCeeI.c
index 3008d536e8c2..3c6cfbb20360 100644
--- a/arch/sparc64/lib/PeeCeeI.c
+++ b/arch/sparc64/lib/PeeCeeI.c
@@ -7,28 +7,31 @@
7#include <asm/io.h> 7#include <asm/io.h>
8#include <asm/byteorder.h> 8#include <asm/byteorder.h>
9 9
10void outsb(void __iomem *addr, const void *src, unsigned long count) 10void outsb(unsigned long __addr, const void *src, unsigned long count)
11{ 11{
12 void __iomem *addr = (void __iomem *) __addr;
12 const u8 *p = src; 13 const u8 *p = src;
13 14
14 while(count--) 15 while (count--)
15 outb(*p++, addr); 16 outb(*p++, addr);
16} 17}
17 18
18void outsw(void __iomem *addr, const void *src, unsigned long count) 19void outsw(unsigned long __addr, const void *src, unsigned long count)
19{ 20{
20 if(count) { 21 void __iomem *addr = (void __iomem *) __addr;
22
23 if (count) {
21 u16 *ps = (u16 *)src; 24 u16 *ps = (u16 *)src;
22 u32 *pi; 25 u32 *pi;
23 26
24 if(((u64)src) & 0x2) { 27 if (((u64)src) & 0x2) {
25 u16 val = le16_to_cpup(ps); 28 u16 val = le16_to_cpup(ps);
26 outw(val, addr); 29 outw(val, addr);
27 ps++; 30 ps++;
28 count--; 31 count--;
29 } 32 }
30 pi = (u32 *)ps; 33 pi = (u32 *)ps;
31 while(count >= 2) { 34 while (count >= 2) {
32 u32 w = le32_to_cpup(pi); 35 u32 w = le32_to_cpup(pi);
33 36
34 pi++; 37 pi++;
@@ -37,19 +40,21 @@ void outsw(void __iomem *addr, const void *src, unsigned long count)
37 count -= 2; 40 count -= 2;
38 } 41 }
39 ps = (u16 *)pi; 42 ps = (u16 *)pi;
40 if(count) { 43 if (count) {
41 u16 val = le16_to_cpup(ps); 44 u16 val = le16_to_cpup(ps);
42 outw(val, addr); 45 outw(val, addr);
43 } 46 }
44 } 47 }
45} 48}
46 49
47void outsl(void __iomem *addr, const void *src, unsigned long count) 50void outsl(unsigned long __addr, const void *src, unsigned long count)
48{ 51{
49 if(count) { 52 void __iomem *addr = (void __iomem *) __addr;
50 if((((u64)src) & 0x3) == 0) { 53
54 if (count) {
55 if ((((u64)src) & 0x3) == 0) {
51 u32 *p = (u32 *)src; 56 u32 *p = (u32 *)src;
52 while(count--) { 57 while (count--) {
53 u32 val = cpu_to_le32p(p); 58 u32 val = cpu_to_le32p(p);
54 outl(val, addr); 59 outl(val, addr);
55 p++; 60 p++;
@@ -60,13 +65,13 @@ void outsl(void __iomem *addr, const void *src, unsigned long count)
60 u32 l = 0, l2; 65 u32 l = 0, l2;
61 u32 *pi; 66 u32 *pi;
62 67
63 switch(((u64)src) & 0x3) { 68 switch (((u64)src) & 0x3) {
64 case 0x2: 69 case 0x2:
65 count -= 1; 70 count -= 1;
66 l = cpu_to_le16p(ps) << 16; 71 l = cpu_to_le16p(ps) << 16;
67 ps++; 72 ps++;
68 pi = (u32 *)ps; 73 pi = (u32 *)ps;
69 while(count--) { 74 while (count--) {
70 l2 = cpu_to_le32p(pi); 75 l2 = cpu_to_le32p(pi);
71 pi++; 76 pi++;
72 outl(((l >> 16) | (l2 << 16)), addr); 77 outl(((l >> 16) | (l2 << 16)), addr);
@@ -86,7 +91,7 @@ void outsl(void __iomem *addr, const void *src, unsigned long count)
86 ps++; 91 ps++;
87 l |= (l2 << 16); 92 l |= (l2 << 16);
88 pi = (u32 *)ps; 93 pi = (u32 *)ps;
89 while(count--) { 94 while (count--) {
90 l2 = cpu_to_le32p(pi); 95 l2 = cpu_to_le32p(pi);
91 pi++; 96 pi++;
92 outl(((l >> 8) | (l2 << 24)), addr); 97 outl(((l >> 8) | (l2 << 24)), addr);
@@ -101,7 +106,7 @@ void outsl(void __iomem *addr, const void *src, unsigned long count)
101 pb = (u8 *)src; 106 pb = (u8 *)src;
102 l = (*pb++ << 24); 107 l = (*pb++ << 24);
103 pi = (u32 *)pb; 108 pi = (u32 *)pb;
104 while(count--) { 109 while (count--) {
105 l2 = cpu_to_le32p(pi); 110 l2 = cpu_to_le32p(pi);
106 pi++; 111 pi++;
107 outl(((l >> 24) | (l2 << 8)), addr); 112 outl(((l >> 24) | (l2 << 8)), addr);
@@ -119,16 +124,18 @@ void outsl(void __iomem *addr, const void *src, unsigned long count)
119 } 124 }
120} 125}
121 126
122void insb(void __iomem *addr, void *dst, unsigned long count) 127void insb(unsigned long __addr, void *dst, unsigned long count)
123{ 128{
124 if(count) { 129 void __iomem *addr = (void __iomem *) __addr;
130
131 if (count) {
125 u32 *pi; 132 u32 *pi;
126 u8 *pb = dst; 133 u8 *pb = dst;
127 134
128 while((((unsigned long)pb) & 0x3) && count--) 135 while ((((unsigned long)pb) & 0x3) && count--)
129 *pb++ = inb(addr); 136 *pb++ = inb(addr);
130 pi = (u32 *)pb; 137 pi = (u32 *)pb;
131 while(count >= 4) { 138 while (count >= 4) {
132 u32 w; 139 u32 w;
133 140
134 w = (inb(addr) << 24); 141 w = (inb(addr) << 24);
@@ -139,23 +146,25 @@ void insb(void __iomem *addr, void *dst, unsigned long count)
139 count -= 4; 146 count -= 4;
140 } 147 }
141 pb = (u8 *)pi; 148 pb = (u8 *)pi;
142 while(count--) 149 while (count--)
143 *pb++ = inb(addr); 150 *pb++ = inb(addr);
144 } 151 }
145} 152}
146 153
147void insw(void __iomem *addr, void *dst, unsigned long count) 154void insw(unsigned long __addr, void *dst, unsigned long count)
148{ 155{
149 if(count) { 156 void __iomem *addr = (void __iomem *) __addr;
157
158 if (count) {
150 u16 *ps = dst; 159 u16 *ps = dst;
151 u32 *pi; 160 u32 *pi;
152 161
153 if(((unsigned long)ps) & 0x2) { 162 if (((unsigned long)ps) & 0x2) {
154 *ps++ = le16_to_cpu(inw(addr)); 163 *ps++ = le16_to_cpu(inw(addr));
155 count--; 164 count--;
156 } 165 }
157 pi = (u32 *)ps; 166 pi = (u32 *)ps;
158 while(count >= 2) { 167 while (count >= 2) {
159 u32 w; 168 u32 w;
160 169
161 w = (le16_to_cpu(inw(addr)) << 16); 170 w = (le16_to_cpu(inw(addr)) << 16);
@@ -164,31 +173,33 @@ void insw(void __iomem *addr, void *dst, unsigned long count)
164 count -= 2; 173 count -= 2;
165 } 174 }
166 ps = (u16 *)pi; 175 ps = (u16 *)pi;
167 if(count) 176 if (count)
168 *ps = le16_to_cpu(inw(addr)); 177 *ps = le16_to_cpu(inw(addr));
169 } 178 }
170} 179}
171 180
172void insl(void __iomem *addr, void *dst, unsigned long count) 181void insl(unsigned long __addr, void *dst, unsigned long count)
173{ 182{
174 if(count) { 183 void __iomem *addr = (void __iomem *) __addr;
175 if((((unsigned long)dst) & 0x3) == 0) { 184
185 if (count) {
186 if ((((unsigned long)dst) & 0x3) == 0) {
176 u32 *pi = dst; 187 u32 *pi = dst;
177 while(count--) 188 while (count--)
178 *pi++ = le32_to_cpu(inl(addr)); 189 *pi++ = le32_to_cpu(inl(addr));
179 } else { 190 } else {
180 u32 l = 0, l2, *pi; 191 u32 l = 0, l2, *pi;
181 u16 *ps; 192 u16 *ps;
182 u8 *pb; 193 u8 *pb;
183 194
184 switch(((unsigned long)dst) & 3) { 195 switch (((unsigned long)dst) & 3) {
185 case 0x2: 196 case 0x2:
186 ps = dst; 197 ps = dst;
187 count -= 1; 198 count -= 1;
188 l = le32_to_cpu(inl(addr)); 199 l = le32_to_cpu(inl(addr));
189 *ps++ = l; 200 *ps++ = l;
190 pi = (u32 *)ps; 201 pi = (u32 *)ps;
191 while(count--) { 202 while (count--) {
192 l2 = le32_to_cpu(inl(addr)); 203 l2 = le32_to_cpu(inl(addr));
193 *pi++ = (l << 16) | (l2 >> 16); 204 *pi++ = (l << 16) | (l2 >> 16);
194 l = l2; 205 l = l2;
@@ -205,7 +216,7 @@ void insl(void __iomem *addr, void *dst, unsigned long count)
205 ps = (u16 *)pb; 216 ps = (u16 *)pb;
206 *ps++ = ((l >> 8) & 0xffff); 217 *ps++ = ((l >> 8) & 0xffff);
207 pi = (u32 *)ps; 218 pi = (u32 *)ps;
208 while(count--) { 219 while (count--) {
209 l2 = le32_to_cpu(inl(addr)); 220 l2 = le32_to_cpu(inl(addr));
210 *pi++ = (l << 24) | (l2 >> 8); 221 *pi++ = (l << 24) | (l2 >> 8);
211 l = l2; 222 l = l2;
@@ -220,7 +231,7 @@ void insl(void __iomem *addr, void *dst, unsigned long count)
220 l = le32_to_cpu(inl(addr)); 231 l = le32_to_cpu(inl(addr));
221 *pb++ = l >> 24; 232 *pb++ = l >> 24;
222 pi = (u32 *)pb; 233 pi = (u32 *)pb;
223 while(count--) { 234 while (count--) {
224 l2 = le32_to_cpu(inl(addr)); 235 l2 = le32_to_cpu(inl(addr));
225 *pi++ = (l << 8) | (l2 >> 24); 236 *pi++ = (l << 8) | (l2 >> 24);
226 l = l2; 237 l = l2;
diff --git a/arch/sparc64/lib/copy_page.S b/arch/sparc64/lib/copy_page.S
index 23ebf2c970b7..feebb14fd27a 100644
--- a/arch/sparc64/lib/copy_page.S
+++ b/arch/sparc64/lib/copy_page.S
@@ -87,7 +87,7 @@ copy_user_page: /* %o0=dest, %o1=src, %o2=vaddr */
87 membar #Sync 87 membar #Sync
88 wrpr %o2, 0x0, %pstate 88 wrpr %o2, 0x0, %pstate
89 89
90 BRANCH_IF_ANY_CHEETAH(g3,o2,1f) 90cheetah_copy_page_insn:
91 ba,pt %xcc, 9f 91 ba,pt %xcc, 9f
92 nop 92 nop
93 93
@@ -240,3 +240,14 @@ copy_user_page: /* %o0=dest, %o1=src, %o2=vaddr */
240 stw %o4, [%g6 + TI_PRE_COUNT] 240 stw %o4, [%g6 + TI_PRE_COUNT]
241 241
242 .size copy_user_page, .-copy_user_page 242 .size copy_user_page, .-copy_user_page
243
244 .globl cheetah_patch_copy_page
245cheetah_patch_copy_page:
246 sethi %hi(0x01000000), %o1 ! NOP
247 sethi %hi(cheetah_copy_page_insn), %o0
248 or %o0, %lo(cheetah_copy_page_insn), %o0
249 stw %o1, [%o0]
250 membar #StoreStore
251 flush %o0
252 retl
253 nop
diff --git a/arch/sparc64/lib/debuglocks.c b/arch/sparc64/lib/debuglocks.c
index f03344cf784e..f5f0b5586f01 100644
--- a/arch/sparc64/lib/debuglocks.c
+++ b/arch/sparc64/lib/debuglocks.c
@@ -12,8 +12,6 @@
12 12
13#ifdef CONFIG_SMP 13#ifdef CONFIG_SMP
14 14
15#define GET_CALLER(PC) __asm__ __volatile__("mov %%i7, %0" : "=r" (PC))
16
17static inline void show (char *str, spinlock_t *lock, unsigned long caller) 15static inline void show (char *str, spinlock_t *lock, unsigned long caller)
18{ 16{
19 int cpu = smp_processor_id(); 17 int cpu = smp_processor_id();
@@ -51,20 +49,19 @@ static inline void show_write (char *str, rwlock_t *lock, unsigned long caller)
51#undef INIT_STUCK 49#undef INIT_STUCK
52#define INIT_STUCK 100000000 50#define INIT_STUCK 100000000
53 51
54void _do_spin_lock(spinlock_t *lock, char *str) 52void _do_spin_lock(spinlock_t *lock, char *str, unsigned long caller)
55{ 53{
56 unsigned long caller, val; 54 unsigned long val;
57 int stuck = INIT_STUCK; 55 int stuck = INIT_STUCK;
58 int cpu = get_cpu(); 56 int cpu = get_cpu();
59 int shown = 0; 57 int shown = 0;
60 58
61 GET_CALLER(caller);
62again: 59again:
63 __asm__ __volatile__("ldstub [%1], %0" 60 __asm__ __volatile__("ldstub [%1], %0"
64 : "=r" (val) 61 : "=r" (val)
65 : "r" (&(lock->lock)) 62 : "r" (&(lock->lock))
66 : "memory"); 63 : "memory");
67 membar("#StoreLoad | #StoreStore"); 64 membar_storeload_storestore();
68 if (val) { 65 if (val) {
69 while (lock->lock) { 66 while (lock->lock) {
70 if (!--stuck) { 67 if (!--stuck) {
@@ -72,7 +69,7 @@ again:
72 show(str, lock, caller); 69 show(str, lock, caller);
73 stuck = INIT_STUCK; 70 stuck = INIT_STUCK;
74 } 71 }
75 membar("#LoadLoad"); 72 rmb();
76 } 73 }
77 goto again; 74 goto again;
78 } 75 }
@@ -84,17 +81,16 @@ again:
84 put_cpu(); 81 put_cpu();
85} 82}
86 83
87int _do_spin_trylock(spinlock_t *lock) 84int _do_spin_trylock(spinlock_t *lock, unsigned long caller)
88{ 85{
89 unsigned long val, caller; 86 unsigned long val;
90 int cpu = get_cpu(); 87 int cpu = get_cpu();
91 88
92 GET_CALLER(caller);
93 __asm__ __volatile__("ldstub [%1], %0" 89 __asm__ __volatile__("ldstub [%1], %0"
94 : "=r" (val) 90 : "=r" (val)
95 : "r" (&(lock->lock)) 91 : "r" (&(lock->lock))
96 : "memory"); 92 : "memory");
97 membar("#StoreLoad | #StoreStore"); 93 membar_storeload_storestore();
98 if (!val) { 94 if (!val) {
99 lock->owner_pc = ((unsigned int)caller); 95 lock->owner_pc = ((unsigned int)caller);
100 lock->owner_cpu = cpu; 96 lock->owner_cpu = cpu;
@@ -111,21 +107,20 @@ void _do_spin_unlock(spinlock_t *lock)
111{ 107{
112 lock->owner_pc = 0; 108 lock->owner_pc = 0;
113 lock->owner_cpu = NO_PROC_ID; 109 lock->owner_cpu = NO_PROC_ID;
114 membar("#StoreStore | #LoadStore"); 110 membar_storestore_loadstore();
115 lock->lock = 0; 111 lock->lock = 0;
116 current->thread.smp_lock_count--; 112 current->thread.smp_lock_count--;
117} 113}
118 114
119/* Keep INIT_STUCK the same... */ 115/* Keep INIT_STUCK the same... */
120 116
121void _do_read_lock (rwlock_t *rw, char *str) 117void _do_read_lock(rwlock_t *rw, char *str, unsigned long caller)
122{ 118{
123 unsigned long caller, val; 119 unsigned long val;
124 int stuck = INIT_STUCK; 120 int stuck = INIT_STUCK;
125 int cpu = get_cpu(); 121 int cpu = get_cpu();
126 int shown = 0; 122 int shown = 0;
127 123
128 GET_CALLER(caller);
129wlock_again: 124wlock_again:
130 /* Wait for any writer to go away. */ 125 /* Wait for any writer to go away. */
131 while (((long)(rw->lock)) < 0) { 126 while (((long)(rw->lock)) < 0) {
@@ -134,7 +129,7 @@ wlock_again:
134 show_read(str, rw, caller); 129 show_read(str, rw, caller);
135 stuck = INIT_STUCK; 130 stuck = INIT_STUCK;
136 } 131 }
137 membar("#LoadLoad"); 132 rmb();
138 } 133 }
139 /* Try once to increment the counter. */ 134 /* Try once to increment the counter. */
140 __asm__ __volatile__( 135 __asm__ __volatile__(
@@ -147,7 +142,7 @@ wlock_again:
147"2:" : "=r" (val) 142"2:" : "=r" (val)
148 : "0" (&(rw->lock)) 143 : "0" (&(rw->lock))
149 : "g1", "g7", "memory"); 144 : "g1", "g7", "memory");
150 membar("#StoreLoad | #StoreStore"); 145 membar_storeload_storestore();
151 if (val) 146 if (val)
152 goto wlock_again; 147 goto wlock_again;
153 rw->reader_pc[cpu] = ((unsigned int)caller); 148 rw->reader_pc[cpu] = ((unsigned int)caller);
@@ -157,15 +152,13 @@ wlock_again:
157 put_cpu(); 152 put_cpu();
158} 153}
159 154
160void _do_read_unlock (rwlock_t *rw, char *str) 155void _do_read_unlock(rwlock_t *rw, char *str, unsigned long caller)
161{ 156{
162 unsigned long caller, val; 157 unsigned long val;
163 int stuck = INIT_STUCK; 158 int stuck = INIT_STUCK;
164 int cpu = get_cpu(); 159 int cpu = get_cpu();
165 int shown = 0; 160 int shown = 0;
166 161
167 GET_CALLER(caller);
168
169 /* Drop our identity _first_. */ 162 /* Drop our identity _first_. */
170 rw->reader_pc[cpu] = 0; 163 rw->reader_pc[cpu] = 0;
171 current->thread.smp_lock_count--; 164 current->thread.smp_lock_count--;
@@ -193,14 +186,13 @@ runlock_again:
193 put_cpu(); 186 put_cpu();
194} 187}
195 188
196void _do_write_lock (rwlock_t *rw, char *str) 189void _do_write_lock(rwlock_t *rw, char *str, unsigned long caller)
197{ 190{
198 unsigned long caller, val; 191 unsigned long val;
199 int stuck = INIT_STUCK; 192 int stuck = INIT_STUCK;
200 int cpu = get_cpu(); 193 int cpu = get_cpu();
201 int shown = 0; 194 int shown = 0;
202 195
203 GET_CALLER(caller);
204wlock_again: 196wlock_again:
205 /* Spin while there is another writer. */ 197 /* Spin while there is another writer. */
206 while (((long)rw->lock) < 0) { 198 while (((long)rw->lock) < 0) {
@@ -209,7 +201,7 @@ wlock_again:
209 show_write(str, rw, caller); 201 show_write(str, rw, caller);
210 stuck = INIT_STUCK; 202 stuck = INIT_STUCK;
211 } 203 }
212 membar("#LoadLoad"); 204 rmb();
213 } 205 }
214 206
215 /* Try to acuire the write bit. */ 207 /* Try to acuire the write bit. */
@@ -264,7 +256,7 @@ wlock_again:
264 show_write(str, rw, caller); 256 show_write(str, rw, caller);
265 stuck = INIT_STUCK; 257 stuck = INIT_STUCK;
266 } 258 }
267 membar("#LoadLoad"); 259 rmb();
268 } 260 }
269 goto wlock_again; 261 goto wlock_again;
270 } 262 }
@@ -278,14 +270,12 @@ wlock_again:
278 put_cpu(); 270 put_cpu();
279} 271}
280 272
281void _do_write_unlock(rwlock_t *rw) 273void _do_write_unlock(rwlock_t *rw, unsigned long caller)
282{ 274{
283 unsigned long caller, val; 275 unsigned long val;
284 int stuck = INIT_STUCK; 276 int stuck = INIT_STUCK;
285 int shown = 0; 277 int shown = 0;
286 278
287 GET_CALLER(caller);
288
289 /* Drop our identity _first_ */ 279 /* Drop our identity _first_ */
290 rw->writer_pc = 0; 280 rw->writer_pc = 0;
291 rw->writer_cpu = NO_PROC_ID; 281 rw->writer_cpu = NO_PROC_ID;
@@ -313,13 +303,11 @@ wlock_again:
313 } 303 }
314} 304}
315 305
316int _do_write_trylock (rwlock_t *rw, char *str) 306int _do_write_trylock(rwlock_t *rw, char *str, unsigned long caller)
317{ 307{
318 unsigned long caller, val; 308 unsigned long val;
319 int cpu = get_cpu(); 309 int cpu = get_cpu();
320 310
321 GET_CALLER(caller);
322
323 /* Try to acuire the write bit. */ 311 /* Try to acuire the write bit. */
324 __asm__ __volatile__( 312 __asm__ __volatile__(
325" mov 1, %%g3\n" 313" mov 1, %%g3\n"
diff --git a/arch/sparc64/lib/mb.S b/arch/sparc64/lib/mb.S
new file mode 100644
index 000000000000..4004f748619f
--- /dev/null
+++ b/arch/sparc64/lib/mb.S
@@ -0,0 +1,73 @@
1/* mb.S: Out of line memory barriers.
2 *
3 * Copyright (C) 2005 David S. Miller (davem@davemloft.net)
4 */
5
6 /* These are here in an effort to more fully work around
7 * Spitfire Errata #51. Essentially, if a memory barrier
8 * occurs soon after a mispredicted branch, the chip can stop
9 * executing instructions until a trap occurs. Therefore, if
10 * interrupts are disabled, the chip can hang forever.
11 *
12 * It used to be believed that the memory barrier had to be
13 * right in the delay slot, but a case has been traced
14 * recently wherein the memory barrier was one instruction
15 * after the branch delay slot and the chip still hung. The
16 * offending sequence was the following in sym_wakeup_done()
17 * of the sym53c8xx_2 driver:
18 *
19 * call sym_ccb_from_dsa, 0
20 * movge %icc, 0, %l0
21 * brz,pn %o0, .LL1303
22 * mov %o0, %l2
23 * membar #LoadLoad
24 *
25 * The branch has to be mispredicted for the bug to occur.
26 * Therefore, we put the memory barrier explicitly into a
27 * "branch always, predicted taken" delay slot to avoid the
28 * problem case.
29 */
30
31 .text
32
3399: retl
34 nop
35
36 .globl mb
37mb: ba,pt %xcc, 99b
38 membar #LoadLoad | #LoadStore | #StoreStore | #StoreLoad
39 .size mb, .-mb
40
41 .globl rmb
42rmb: ba,pt %xcc, 99b
43 membar #LoadLoad
44 .size rmb, .-rmb
45
46 .globl wmb
47wmb: ba,pt %xcc, 99b
48 membar #StoreStore
49 .size wmb, .-wmb
50
51 .globl membar_storeload
52membar_storeload:
53 ba,pt %xcc, 99b
54 membar #StoreLoad
55 .size membar_storeload, .-membar_storeload
56
57 .globl membar_storeload_storestore
58membar_storeload_storestore:
59 ba,pt %xcc, 99b
60 membar #StoreLoad | #StoreStore
61 .size membar_storeload_storestore, .-membar_storeload_storestore
62
63 .globl membar_storeload_loadload
64membar_storeload_loadload:
65 ba,pt %xcc, 99b
66 membar #StoreLoad | #LoadLoad
67 .size membar_storeload_loadload, .-membar_storeload_loadload
68
69 .globl membar_storestore_loadstore
70membar_storestore_loadstore:
71 ba,pt %xcc, 99b
72 membar #StoreStore | #LoadStore
73 .size membar_storestore_loadstore, .-membar_storestore_loadstore
diff --git a/arch/sparc64/mm/generic.c b/arch/sparc64/mm/generic.c
index 6b31f6117a95..c954d91f01d0 100644
--- a/arch/sparc64/mm/generic.c
+++ b/arch/sparc64/mm/generic.c
@@ -116,37 +116,6 @@ static inline int io_remap_pud_range(struct mm_struct *mm, pud_t * pud, unsigned
116 return 0; 116 return 0;
117} 117}
118 118
119int io_remap_page_range(struct vm_area_struct *vma, unsigned long from, unsigned long offset, unsigned long size, pgprot_t prot, int space)
120{
121 int error = 0;
122 pgd_t * dir;
123 unsigned long beg = from;
124 unsigned long end = from + size;
125 struct mm_struct *mm = vma->vm_mm;
126
127 prot = __pgprot(pg_iobits);
128 offset -= from;
129 dir = pgd_offset(mm, from);
130 flush_cache_range(vma, beg, end);
131
132 spin_lock(&mm->page_table_lock);
133 while (from < end) {
134 pud_t *pud = pud_alloc(mm, dir, from);
135 error = -ENOMEM;
136 if (!pud)
137 break;
138 error = io_remap_pud_range(mm, pud, from, end - from, offset + from, prot, space);
139 if (error)
140 break;
141 from = (from + PGDIR_SIZE) & PGDIR_MASK;
142 dir++;
143 }
144 flush_tlb_range(vma, beg, end);
145 spin_unlock(&mm->page_table_lock);
146
147 return error;
148}
149
150int io_remap_pfn_range(struct vm_area_struct *vma, unsigned long from, 119int io_remap_pfn_range(struct vm_area_struct *vma, unsigned long from,
151 unsigned long pfn, unsigned long size, pgprot_t prot) 120 unsigned long pfn, unsigned long size, pgprot_t prot)
152{ 121{
diff --git a/arch/sparc64/mm/init.c b/arch/sparc64/mm/init.c
index 8fc413cb6acd..3fbaf342a452 100644
--- a/arch/sparc64/mm/init.c
+++ b/arch/sparc64/mm/init.c
@@ -121,15 +121,24 @@ __inline__ void flush_dcache_page_impl(struct page *page)
121} 121}
122 122
123#define PG_dcache_dirty PG_arch_1 123#define PG_dcache_dirty PG_arch_1
124#define PG_dcache_cpu_shift 24
125#define PG_dcache_cpu_mask (256 - 1)
126
127#if NR_CPUS > 256
128#error D-cache dirty tracking and thread_info->cpu need fixing for > 256 cpus
129#endif
124 130
125#define dcache_dirty_cpu(page) \ 131#define dcache_dirty_cpu(page) \
126 (((page)->flags >> 24) & (NR_CPUS - 1UL)) 132 (((page)->flags >> PG_dcache_cpu_shift) & PG_dcache_cpu_mask)
127 133
128static __inline__ void set_dcache_dirty(struct page *page, int this_cpu) 134static __inline__ void set_dcache_dirty(struct page *page, int this_cpu)
129{ 135{
130 unsigned long mask = this_cpu; 136 unsigned long mask = this_cpu;
131 unsigned long non_cpu_bits = ~((NR_CPUS - 1UL) << 24UL); 137 unsigned long non_cpu_bits;
132 mask = (mask << 24) | (1UL << PG_dcache_dirty); 138
139 non_cpu_bits = ~(PG_dcache_cpu_mask << PG_dcache_cpu_shift);
140 mask = (mask << PG_dcache_cpu_shift) | (1UL << PG_dcache_dirty);
141
133 __asm__ __volatile__("1:\n\t" 142 __asm__ __volatile__("1:\n\t"
134 "ldx [%2], %%g7\n\t" 143 "ldx [%2], %%g7\n\t"
135 "and %%g7, %1, %%g1\n\t" 144 "and %%g7, %1, %%g1\n\t"
@@ -151,7 +160,7 @@ static __inline__ void clear_dcache_dirty_cpu(struct page *page, unsigned long c
151 __asm__ __volatile__("! test_and_clear_dcache_dirty\n" 160 __asm__ __volatile__("! test_and_clear_dcache_dirty\n"
152 "1:\n\t" 161 "1:\n\t"
153 "ldx [%2], %%g7\n\t" 162 "ldx [%2], %%g7\n\t"
154 "srlx %%g7, 24, %%g1\n\t" 163 "srlx %%g7, %4, %%g1\n\t"
155 "and %%g1, %3, %%g1\n\t" 164 "and %%g1, %3, %%g1\n\t"
156 "cmp %%g1, %0\n\t" 165 "cmp %%g1, %0\n\t"
157 "bne,pn %%icc, 2f\n\t" 166 "bne,pn %%icc, 2f\n\t"
@@ -164,7 +173,8 @@ static __inline__ void clear_dcache_dirty_cpu(struct page *page, unsigned long c
164 "2:" 173 "2:"
165 : /* no outputs */ 174 : /* no outputs */
166 : "r" (cpu), "r" (mask), "r" (&page->flags), 175 : "r" (cpu), "r" (mask), "r" (&page->flags),
167 "i" (NR_CPUS - 1UL) 176 "i" (PG_dcache_cpu_mask),
177 "i" (PG_dcache_cpu_shift)
168 : "g1", "g7"); 178 : "g1", "g7");
169} 179}
170 180
@@ -180,7 +190,8 @@ void update_mmu_cache(struct vm_area_struct *vma, unsigned long address, pte_t p
180 if (pfn_valid(pfn) && 190 if (pfn_valid(pfn) &&
181 (page = pfn_to_page(pfn), page_mapping(page)) && 191 (page = pfn_to_page(pfn), page_mapping(page)) &&
182 ((pg_flags = page->flags) & (1UL << PG_dcache_dirty))) { 192 ((pg_flags = page->flags) & (1UL << PG_dcache_dirty))) {
183 int cpu = ((pg_flags >> 24) & (NR_CPUS - 1UL)); 193 int cpu = ((pg_flags >> PG_dcache_cpu_shift) &
194 PG_dcache_cpu_mask);
184 int this_cpu = get_cpu(); 195 int this_cpu = get_cpu();
185 196
186 /* This is just to optimize away some function calls 197 /* This is just to optimize away some function calls
diff --git a/arch/sparc64/mm/ultra.S b/arch/sparc64/mm/ultra.S
index 363770893797..8dfa825eca51 100644
--- a/arch/sparc64/mm/ultra.S
+++ b/arch/sparc64/mm/ultra.S
@@ -10,6 +10,7 @@
10#include <asm/page.h> 10#include <asm/page.h>
11#include <asm/spitfire.h> 11#include <asm/spitfire.h>
12#include <asm/mmu_context.h> 12#include <asm/mmu_context.h>
13#include <asm/mmu.h>
13#include <asm/pil.h> 14#include <asm/pil.h>
14#include <asm/head.h> 15#include <asm/head.h>
15#include <asm/thread_info.h> 16#include <asm/thread_info.h>
@@ -45,6 +46,8 @@ __flush_tlb_mm: /* %o0=(ctx & TAG_CONTEXT_BITS), %o1=SECONDARY_CONTEXT */
45 nop 46 nop
46 nop 47 nop
47 nop 48 nop
49 nop
50 nop
48 51
49 .align 32 52 .align 32
50 .globl __flush_tlb_pending 53 .globl __flush_tlb_pending
@@ -73,6 +76,9 @@ __flush_tlb_pending:
73 retl 76 retl
74 wrpr %g7, 0x0, %pstate 77 wrpr %g7, 0x0, %pstate
75 nop 78 nop
79 nop
80 nop
81 nop
76 82
77 .align 32 83 .align 32
78 .globl __flush_tlb_kernel_range 84 .globl __flush_tlb_kernel_range
@@ -224,16 +230,8 @@ __update_mmu_cache: /* %o0=hw_context, %o1=address, %o2=pte, %o3=fault_code */
224 or %o5, %o0, %o5 230 or %o5, %o0, %o5
225 ba,a,pt %xcc, __prefill_itlb 231 ba,a,pt %xcc, __prefill_itlb
226 232
227 /* Cheetah specific versions, patched at boot time. 233 /* Cheetah specific versions, patched at boot time. */
228 * 234__cheetah_flush_tlb_mm: /* 18 insns */
229 * This writes of the PRIMARY_CONTEXT register in this file are
230 * safe even on Cheetah+ and later wrt. the page size fields.
231 * The nucleus page size fields do not matter because we make
232 * no data references, and these instructions execute out of a
233 * locked I-TLB entry sitting in the fully assosciative I-TLB.
234 * This sequence should also never trap.
235 */
236__cheetah_flush_tlb_mm: /* 15 insns */
237 rdpr %pstate, %g7 235 rdpr %pstate, %g7
238 andn %g7, PSTATE_IE, %g2 236 andn %g7, PSTATE_IE, %g2
239 wrpr %g2, 0x0, %pstate 237 wrpr %g2, 0x0, %pstate
@@ -241,6 +239,9 @@ __cheetah_flush_tlb_mm: /* 15 insns */
241 mov PRIMARY_CONTEXT, %o2 239 mov PRIMARY_CONTEXT, %o2
242 mov 0x40, %g3 240 mov 0x40, %g3
243 ldxa [%o2] ASI_DMMU, %g2 241 ldxa [%o2] ASI_DMMU, %g2
242 srlx %g2, CTX_PGSZ1_NUC_SHIFT, %o1
243 sllx %o1, CTX_PGSZ1_NUC_SHIFT, %o1
244 or %o0, %o1, %o0 /* Preserve nucleus page size fields */
244 stxa %o0, [%o2] ASI_DMMU 245 stxa %o0, [%o2] ASI_DMMU
245 stxa %g0, [%g3] ASI_DMMU_DEMAP 246 stxa %g0, [%g3] ASI_DMMU_DEMAP
246 stxa %g0, [%g3] ASI_IMMU_DEMAP 247 stxa %g0, [%g3] ASI_IMMU_DEMAP
@@ -250,7 +251,7 @@ __cheetah_flush_tlb_mm: /* 15 insns */
250 retl 251 retl
251 wrpr %g7, 0x0, %pstate 252 wrpr %g7, 0x0, %pstate
252 253
253__cheetah_flush_tlb_pending: /* 23 insns */ 254__cheetah_flush_tlb_pending: /* 26 insns */
254 /* %o0 = context, %o1 = nr, %o2 = vaddrs[] */ 255 /* %o0 = context, %o1 = nr, %o2 = vaddrs[] */
255 rdpr %pstate, %g7 256 rdpr %pstate, %g7
256 sllx %o1, 3, %o1 257 sllx %o1, 3, %o1
@@ -259,6 +260,9 @@ __cheetah_flush_tlb_pending: /* 23 insns */
259 wrpr %g0, 1, %tl 260 wrpr %g0, 1, %tl
260 mov PRIMARY_CONTEXT, %o4 261 mov PRIMARY_CONTEXT, %o4
261 ldxa [%o4] ASI_DMMU, %g2 262 ldxa [%o4] ASI_DMMU, %g2
263 srlx %g2, CTX_PGSZ1_NUC_SHIFT, %o3
264 sllx %o3, CTX_PGSZ1_NUC_SHIFT, %o3
265 or %o0, %o3, %o0 /* Preserve nucleus page size fields */
262 stxa %o0, [%o4] ASI_DMMU 266 stxa %o0, [%o4] ASI_DMMU
2631: sub %o1, (1 << 3), %o1 2671: sub %o1, (1 << 3), %o1
264 ldx [%o2 + %o1], %o3 268 ldx [%o2 + %o1], %o3
@@ -311,14 +315,14 @@ cheetah_patch_cachetlbops:
311 sethi %hi(__cheetah_flush_tlb_mm), %o1 315 sethi %hi(__cheetah_flush_tlb_mm), %o1
312 or %o1, %lo(__cheetah_flush_tlb_mm), %o1 316 or %o1, %lo(__cheetah_flush_tlb_mm), %o1
313 call cheetah_patch_one 317 call cheetah_patch_one
314 mov 15, %o2 318 mov 18, %o2
315 319
316 sethi %hi(__flush_tlb_pending), %o0 320 sethi %hi(__flush_tlb_pending), %o0
317 or %o0, %lo(__flush_tlb_pending), %o0 321 or %o0, %lo(__flush_tlb_pending), %o0
318 sethi %hi(__cheetah_flush_tlb_pending), %o1 322 sethi %hi(__cheetah_flush_tlb_pending), %o1
319 or %o1, %lo(__cheetah_flush_tlb_pending), %o1 323 or %o1, %lo(__cheetah_flush_tlb_pending), %o1
320 call cheetah_patch_one 324 call cheetah_patch_one
321 mov 23, %o2 325 mov 26, %o2
322 326
323#ifdef DCACHE_ALIASING_POSSIBLE 327#ifdef DCACHE_ALIASING_POSSIBLE
324 sethi %hi(__flush_dcache_page), %o0 328 sethi %hi(__flush_dcache_page), %o0
@@ -352,9 +356,12 @@ cheetah_patch_cachetlbops:
352 .globl xcall_flush_tlb_mm 356 .globl xcall_flush_tlb_mm
353xcall_flush_tlb_mm: 357xcall_flush_tlb_mm:
354 mov PRIMARY_CONTEXT, %g2 358 mov PRIMARY_CONTEXT, %g2
355 mov 0x40, %g4
356 ldxa [%g2] ASI_DMMU, %g3 359 ldxa [%g2] ASI_DMMU, %g3
360 srlx %g3, CTX_PGSZ1_NUC_SHIFT, %g4
361 sllx %g4, CTX_PGSZ1_NUC_SHIFT, %g4
362 or %g5, %g4, %g5 /* Preserve nucleus page size fields */
357 stxa %g5, [%g2] ASI_DMMU 363 stxa %g5, [%g2] ASI_DMMU
364 mov 0x40, %g4
358 stxa %g0, [%g4] ASI_DMMU_DEMAP 365 stxa %g0, [%g4] ASI_DMMU_DEMAP
359 stxa %g0, [%g4] ASI_IMMU_DEMAP 366 stxa %g0, [%g4] ASI_IMMU_DEMAP
360 stxa %g3, [%g2] ASI_DMMU 367 stxa %g3, [%g2] ASI_DMMU
@@ -366,6 +373,10 @@ xcall_flush_tlb_pending:
366 sllx %g1, 3, %g1 373 sllx %g1, 3, %g1
367 mov PRIMARY_CONTEXT, %g4 374 mov PRIMARY_CONTEXT, %g4
368 ldxa [%g4] ASI_DMMU, %g2 375 ldxa [%g4] ASI_DMMU, %g2
376 srlx %g2, CTX_PGSZ1_NUC_SHIFT, %g4
377 sllx %g4, CTX_PGSZ1_NUC_SHIFT, %g4
378 or %g5, %g4, %g5
379 mov PRIMARY_CONTEXT, %g4
369 stxa %g5, [%g4] ASI_DMMU 380 stxa %g5, [%g4] ASI_DMMU
3701: sub %g1, (1 << 3), %g1 3811: sub %g1, (1 << 3), %g1
371 ldx [%g7 + %g1], %g5 382 ldx [%g7 + %g1], %g5
diff --git a/arch/sparc64/solaris/misc.c b/arch/sparc64/solaris/misc.c
index 15b4cfe07557..302efbcba70e 100644
--- a/arch/sparc64/solaris/misc.c
+++ b/arch/sparc64/solaris/misc.c
@@ -737,7 +737,8 @@ MODULE_LICENSE("GPL");
737extern u32 tl0_solaris[8]; 737extern u32 tl0_solaris[8];
738#define update_ttable(x) \ 738#define update_ttable(x) \
739 tl0_solaris[3] = (((long)(x) - (long)tl0_solaris - 3) >> 2) | 0x40000000; \ 739 tl0_solaris[3] = (((long)(x) - (long)tl0_solaris - 3) >> 2) | 0x40000000; \
740 __asm__ __volatile__ ("membar #StoreStore; flush %0" : : "r" (&tl0_solaris[3])) 740 wmb(); \
741 __asm__ __volatile__ ("flush %0" : : "r" (&tl0_solaris[3]))
741#else 742#else
742#endif 743#endif
743 744
@@ -761,7 +762,8 @@ int init_module(void)
761 entry64_personality_patch |= 762 entry64_personality_patch |=
762 (offsetof(struct task_struct, personality) + 763 (offsetof(struct task_struct, personality) +
763 (sizeof(unsigned long) - 1)); 764 (sizeof(unsigned long) - 1));
764 __asm__ __volatile__("membar #StoreStore; flush %0" 765 wmb();
766 __asm__ __volatile__("flush %0"
765 : : "r" (&entry64_personality_patch)); 767 : : "r" (&entry64_personality_patch));
766 return 0; 768 return 0;
767} 769}
diff --git a/arch/sparc64/solaris/socket.c b/arch/sparc64/solaris/socket.c
index 06740582717e..d3a66ea74a7f 100644
--- a/arch/sparc64/solaris/socket.c
+++ b/arch/sparc64/solaris/socket.c
@@ -16,6 +16,7 @@
16#include <linux/net.h> 16#include <linux/net.h>
17#include <linux/compat.h> 17#include <linux/compat.h>
18#include <net/compat.h> 18#include <net/compat.h>
19#include <net/sock.h>
19 20
20#include <asm/uaccess.h> 21#include <asm/uaccess.h>
21#include <asm/string.h> 22#include <asm/string.h>
@@ -297,121 +298,165 @@ asmlinkage int solaris_sendmsg(int fd, struct sol_nmsghdr __user *user_msg, unsi
297{ 298{
298 struct socket *sock; 299 struct socket *sock;
299 char address[MAX_SOCK_ADDR]; 300 char address[MAX_SOCK_ADDR];
300 struct iovec iov[UIO_FASTIOV]; 301 struct iovec iovstack[UIO_FASTIOV], *iov = iovstack;
301 unsigned char ctl[sizeof(struct cmsghdr) + 20]; 302 unsigned char ctl[sizeof(struct cmsghdr) + 20];
302 unsigned char *ctl_buf = ctl; 303 unsigned char *ctl_buf = ctl;
303 struct msghdr kern_msg; 304 struct msghdr msg_sys;
304 int err, total_len; 305 int err, ctl_len, iov_size, total_len;
305 306
306 if(msghdr_from_user32_to_kern(&kern_msg, user_msg)) 307 err = -EFAULT;
307 return -EFAULT; 308 if (msghdr_from_user32_to_kern(&msg_sys, user_msg))
308 if(kern_msg.msg_iovlen > UIO_MAXIOV) 309 goto out;
309 return -EINVAL; 310
310 err = verify_compat_iovec(&kern_msg, iov, address, VERIFY_READ); 311 sock = sockfd_lookup(fd, &err);
311 if (err < 0) 312 if (!sock)
312 goto out; 313 goto out;
314
315 /* do not move before msg_sys is valid */
316 err = -EMSGSIZE;
317 if (msg_sys.msg_iovlen > UIO_MAXIOV)
318 goto out_put;
319
320 /* Check whether to allocate the iovec area*/
321 err = -ENOMEM;
322 iov_size = msg_sys.msg_iovlen * sizeof(struct iovec);
323 if (msg_sys.msg_iovlen > UIO_FASTIOV) {
324 iov = sock_kmalloc(sock->sk, iov_size, GFP_KERNEL);
325 if (!iov)
326 goto out_put;
327 }
328
329 err = verify_compat_iovec(&msg_sys, iov, address, VERIFY_READ);
330 if (err < 0)
331 goto out_freeiov;
313 total_len = err; 332 total_len = err;
314 333
315 if(kern_msg.msg_controllen) { 334 err = -ENOBUFS;
316 struct sol_cmsghdr __user *ucmsg = kern_msg.msg_control; 335 if (msg_sys.msg_controllen > INT_MAX)
336 goto out_freeiov;
337
338 ctl_len = msg_sys.msg_controllen;
339 if (ctl_len) {
340 struct sol_cmsghdr __user *ucmsg = msg_sys.msg_control;
317 unsigned long *kcmsg; 341 unsigned long *kcmsg;
318 compat_size_t cmlen; 342 compat_size_t cmlen;
319 343
320 if (kern_msg.msg_controllen <= sizeof(compat_size_t)) 344 err = -EINVAL;
321 return -EINVAL; 345 if (ctl_len <= sizeof(compat_size_t))
346 goto out_freeiov;
322 347
323 if(kern_msg.msg_controllen > sizeof(ctl)) { 348 if (ctl_len > sizeof(ctl)) {
324 err = -ENOBUFS; 349 err = -ENOBUFS;
325 ctl_buf = kmalloc(kern_msg.msg_controllen, GFP_KERNEL); 350 ctl_buf = kmalloc(ctl_len, GFP_KERNEL);
326 if(!ctl_buf) 351 if (!ctl_buf)
327 goto out_freeiov; 352 goto out_freeiov;
328 } 353 }
329 __get_user(cmlen, &ucmsg->cmsg_len); 354 __get_user(cmlen, &ucmsg->cmsg_len);
330 kcmsg = (unsigned long *) ctl_buf; 355 kcmsg = (unsigned long *) ctl_buf;
331 *kcmsg++ = (unsigned long)cmlen; 356 *kcmsg++ = (unsigned long)cmlen;
332 err = -EFAULT; 357 err = -EFAULT;
333 if(copy_from_user(kcmsg, &ucmsg->cmsg_level, 358 if (copy_from_user(kcmsg, &ucmsg->cmsg_level,
334 kern_msg.msg_controllen - sizeof(compat_size_t))) 359 ctl_len - sizeof(compat_size_t)))
335 goto out_freectl; 360 goto out_freectl;
336 kern_msg.msg_control = ctl_buf; 361 msg_sys.msg_control = ctl_buf;
337 } 362 }
338 kern_msg.msg_flags = solaris_to_linux_msgflags(user_flags); 363 msg_sys.msg_flags = solaris_to_linux_msgflags(user_flags);
339 364
340 lock_kernel(); 365 if (sock->file->f_flags & O_NONBLOCK)
341 sock = sockfd_lookup(fd, &err); 366 msg_sys.msg_flags |= MSG_DONTWAIT;
342 if (sock != NULL) { 367 err = sock_sendmsg(sock, &msg_sys, total_len);
343 if (sock->file->f_flags & O_NONBLOCK)
344 kern_msg.msg_flags |= MSG_DONTWAIT;
345 err = sock_sendmsg(sock, &kern_msg, total_len);
346 sockfd_put(sock);
347 }
348 unlock_kernel();
349 368
350out_freectl: 369out_freectl:
351 /* N.B. Use kfree here, as kern_msg.msg_controllen might change? */ 370 if (ctl_buf != ctl)
352 if(ctl_buf != ctl) 371 sock_kfree_s(sock->sk, ctl_buf, ctl_len);
353 kfree(ctl_buf);
354out_freeiov: 372out_freeiov:
355 if(kern_msg.msg_iov != iov) 373 if (iov != iovstack)
356 kfree(kern_msg.msg_iov); 374 sock_kfree_s(sock->sk, iov, iov_size);
357out: 375out_put:
376 sockfd_put(sock);
377out:
358 return err; 378 return err;
359} 379}
360 380
361asmlinkage int solaris_recvmsg(int fd, struct sol_nmsghdr __user *user_msg, unsigned int user_flags) 381asmlinkage int solaris_recvmsg(int fd, struct sol_nmsghdr __user *user_msg, unsigned int user_flags)
362{ 382{
363 struct iovec iovstack[UIO_FASTIOV];
364 struct msghdr kern_msg;
365 char addr[MAX_SOCK_ADDR];
366 struct socket *sock; 383 struct socket *sock;
384 struct iovec iovstack[UIO_FASTIOV];
367 struct iovec *iov = iovstack; 385 struct iovec *iov = iovstack;
386 struct msghdr msg_sys;
387 unsigned long cmsg_ptr;
388 int err, iov_size, total_len, len;
389
390 /* kernel mode address */
391 char addr[MAX_SOCK_ADDR];
392
393 /* user mode address pointers */
368 struct sockaddr __user *uaddr; 394 struct sockaddr __user *uaddr;
369 int __user *uaddr_len; 395 int __user *uaddr_len;
370 unsigned long cmsg_ptr;
371 int err, total_len, len = 0;
372 396
373 if(msghdr_from_user32_to_kern(&kern_msg, user_msg)) 397 if (msghdr_from_user32_to_kern(&msg_sys, user_msg))
374 return -EFAULT; 398 return -EFAULT;
375 if(kern_msg.msg_iovlen > UIO_MAXIOV)
376 return -EINVAL;
377 399
378 uaddr = kern_msg.msg_name; 400 sock = sockfd_lookup(fd, &err);
401 if (!sock)
402 goto out;
403
404 err = -EMSGSIZE;
405 if (msg_sys.msg_iovlen > UIO_MAXIOV)
406 goto out_put;
407
408 /* Check whether to allocate the iovec area*/
409 err = -ENOMEM;
410 iov_size = msg_sys.msg_iovlen * sizeof(struct iovec);
411 if (msg_sys.msg_iovlen > UIO_FASTIOV) {
412 iov = sock_kmalloc(sock->sk, iov_size, GFP_KERNEL);
413 if (!iov)
414 goto out_put;
415 }
416
417 /*
418 * Save the user-mode address (verify_iovec will change the
419 * kernel msghdr to use the kernel address space)
420 */
421
422 uaddr = (void __user *) msg_sys.msg_name;
379 uaddr_len = &user_msg->msg_namelen; 423 uaddr_len = &user_msg->msg_namelen;
380 err = verify_compat_iovec(&kern_msg, iov, addr, VERIFY_WRITE); 424 err = verify_compat_iovec(&msg_sys, iov, addr, VERIFY_WRITE);
381 if (err < 0) 425 if (err < 0)
382 goto out; 426 goto out_freeiov;
383 total_len = err; 427 total_len = err;
384 428
385 cmsg_ptr = (unsigned long) kern_msg.msg_control; 429 cmsg_ptr = (unsigned long) msg_sys.msg_control;
386 kern_msg.msg_flags = 0; 430 msg_sys.msg_flags = MSG_CMSG_COMPAT;
387 431
388 lock_kernel(); 432 if (sock->file->f_flags & O_NONBLOCK)
389 sock = sockfd_lookup(fd, &err); 433 user_flags |= MSG_DONTWAIT;
390 if (sock != NULL) { 434
391 if (sock->file->f_flags & O_NONBLOCK) 435 err = sock_recvmsg(sock, &msg_sys, total_len, user_flags);
392 user_flags |= MSG_DONTWAIT; 436 if(err < 0)
393 err = sock_recvmsg(sock, &kern_msg, total_len, user_flags); 437 goto out_freeiov;
394 if(err >= 0) 438
395 len = err; 439 len = err;
396 sockfd_put(sock); 440
397 } 441 if (uaddr != NULL) {
398 unlock_kernel(); 442 err = move_addr_to_user(addr, msg_sys.msg_namelen, uaddr, uaddr_len);
399 443 if (err < 0)
400 if(uaddr != NULL && err >= 0) 444 goto out_freeiov;
401 err = move_addr_to_user(addr, kern_msg.msg_namelen, uaddr, uaddr_len);
402 if(err >= 0) {
403 err = __put_user(linux_to_solaris_msgflags(kern_msg.msg_flags), &user_msg->msg_flags);
404 if(!err) {
405 /* XXX Convert cmsg back into userspace 32-bit format... */
406 err = __put_user((unsigned long)kern_msg.msg_control - cmsg_ptr,
407 &user_msg->msg_controllen);
408 }
409 } 445 }
446 err = __put_user(linux_to_solaris_msgflags(msg_sys.msg_flags), &user_msg->msg_flags);
447 if (err)
448 goto out_freeiov;
449 err = __put_user((unsigned long)msg_sys.msg_control - cmsg_ptr,
450 &user_msg->msg_controllen);
451 if (err)
452 goto out_freeiov;
453 err = len;
410 454
411 if(kern_msg.msg_iov != iov) 455out_freeiov:
412 kfree(kern_msg.msg_iov); 456 if (iov != iovstack)
457 sock_kfree_s(sock->sk, iov, iov_size);
458out_put:
459 sockfd_put(sock);
413out: 460out:
414 if(err < 0) 461 return err;
415 return err;
416 return len;
417} 462}
diff --git a/arch/um/Kconfig b/arch/um/Kconfig
index 6682c7883647..684e1f8b2755 100644
--- a/arch/um/Kconfig
+++ b/arch/um/Kconfig
@@ -73,7 +73,7 @@ config MODE_SKAS
73 to CONFIG_MODE_TT). Otherwise, it is safe to say Y. Disabling this 73 to CONFIG_MODE_TT). Otherwise, it is safe to say Y. Disabling this
74 option will shrink the UML binary slightly. 74 option will shrink the UML binary slightly.
75 75
76source "arch/um/Kconfig_arch" 76source "arch/um/Kconfig.arch"
77source "mm/Kconfig" 77source "mm/Kconfig"
78 78
79config LD_SCRIPT_STATIC 79config LD_SCRIPT_STATIC
@@ -196,7 +196,7 @@ config HOST_2G_2G
196config SMP 196config SMP
197 bool "Symmetric multi-processing support (EXPERIMENTAL)" 197 bool "Symmetric multi-processing support (EXPERIMENTAL)"
198 default n 198 default n
199 depends on MODE_TT && EXPERIMENTAL 199 depends on (MODE_TT && EXPERIMENTAL && !SMP_BROKEN) || (BROKEN && SMP_BROKEN)
200 help 200 help
201 This option enables UML SMP support. 201 This option enables UML SMP support.
202 It is NOT related to having a real SMP box. Not directly, at least. 202 It is NOT related to having a real SMP box. Not directly, at least.
@@ -275,9 +275,11 @@ endmenu
275 275
276source "init/Kconfig" 276source "init/Kconfig"
277 277
278source "net/Kconfig"
279
278source "drivers/base/Kconfig" 280source "drivers/base/Kconfig"
279 281
280source "arch/um/Kconfig_char" 282source "arch/um/Kconfig.char"
281 283
282source "drivers/block/Kconfig" 284source "drivers/block/Kconfig"
283 285
@@ -285,9 +287,9 @@ config NETDEVICES
285 bool 287 bool
286 default NET 288 default NET
287 289
288source "arch/um/Kconfig_net" 290source "arch/um/Kconfig.net"
289 291
290source "net/Kconfig" 292source "drivers/net/Kconfig"
291 293
292source "fs/Kconfig" 294source "fs/Kconfig"
293 295
@@ -309,7 +311,7 @@ config GENERIC_ISA_DMA
309 depends on SCSI 311 depends on SCSI
310 default y 312 default y
311 313
312source "arch/um/Kconfig_scsi" 314source "arch/um/Kconfig.scsi"
313 315
314endmenu 316endmenu
315 317
diff --git a/arch/um/Kconfig_char b/arch/um/Kconfig.char
index 62d87b71179b..62d87b71179b 100644
--- a/arch/um/Kconfig_char
+++ b/arch/um/Kconfig.char
diff --git a/arch/um/Kconfig.debug b/arch/um/Kconfig.debug
index bd41e4286d0d..5681a8bd370b 100644
--- a/arch/um/Kconfig.debug
+++ b/arch/um/Kconfig.debug
@@ -2,6 +2,17 @@ menu "Kernel hacking"
2 2
3source "lib/Kconfig.debug" 3source "lib/Kconfig.debug"
4 4
5config CMDLINE_ON_HOST
6 bool "Show command line arguments on the host in TT mode"
7 depends on MODE_TT
8 default !DEBUG_INFO
9 help
10 This controls whether arguments in guest processes should be shown on
11 the host's ps output.
12 Enabling this option hinders debugging on some recent GDB versions
13 (because GDB gets "confused" when we do an execvp()). So probably you
14 should disable it.
15
5config PT_PROXY 16config PT_PROXY
6 bool "Enable ptrace proxy" 17 bool "Enable ptrace proxy"
7 depends on XTERM_CHAN && DEBUG_INFO && MODE_TT 18 depends on XTERM_CHAN && DEBUG_INFO && MODE_TT
diff --git a/arch/um/Kconfig_i386 b/arch/um/Kconfig.i386
index 27c18a8d9d17..8ad156a00499 100644
--- a/arch/um/Kconfig_i386
+++ b/arch/um/Kconfig.i386
@@ -6,6 +6,10 @@ config 64BIT
6 bool 6 bool
7 default n 7 default n
8 8
9config SEMAPHORE_SLEEPERS
10 bool
11 default y
12
9config TOP_ADDR 13config TOP_ADDR
10 hex 14 hex
11 default 0xc0000000 if !HOST_2G_2G 15 default 0xc0000000 if !HOST_2G_2G
diff --git a/arch/um/Kconfig_net b/arch/um/Kconfig.net
index 1c2f9a70d91d..14a04ebdeae9 100644
--- a/arch/um/Kconfig_net
+++ b/arch/um/Kconfig.net
@@ -34,7 +34,7 @@ config UML_NET_ETHERTAP
34 link with the host. 34 link with the host.
35 35
36 To use this, your host kernel must have support for Ethertap 36 To use this, your host kernel must have support for Ethertap
37 devices. Also, if your host kernel is 2.4.x, it must have 37 devices. Also, if your host kernel is 2.4.x, it must have
38 CONFIG_NETLINK_DEV configured as Y or M. 38 CONFIG_NETLINK_DEV configured as Y or M.
39 39
40 For more information, see 40 For more information, see
@@ -43,7 +43,7 @@ config UML_NET_ETHERTAP
43 networking. 43 networking.
44 44
45 If you'd like to set up an IP network with the host and/or the 45 If you'd like to set up an IP network with the host and/or the
46 outside world, say Y to this, the Daemon Transport and/or the 46 outside world, say Y to this, the Daemon Transport and/or the
47 Slip Transport. You'll need at least one of them, but may choose 47 Slip Transport. You'll need at least one of them, but may choose
48 more than one without conflict. If you don't need UML networking, 48 more than one without conflict. If you don't need UML networking,
49 say N. 49 say N.
@@ -78,7 +78,7 @@ config UML_NET_SLIP
78 78
79 The Ethertap Transport is preferred over slip because of its 79 The Ethertap Transport is preferred over slip because of its
80 limitations. If you prefer slip, however, say Y here. Otherwise 80 limitations. If you prefer slip, however, say Y here. Otherwise
81 choose the Multicast transport (to network multiple UMLs on 81 choose the Multicast transport (to network multiple UMLs on
82 multiple hosts), Ethertap (to network with the host and the 82 multiple hosts), Ethertap (to network with the host and the
83 outside world), and/or the Daemon transport (to network multiple 83 outside world), and/or the Daemon transport (to network multiple
84 UMLs on a single host). You may choose more than one without 84 UMLs on a single host). You may choose more than one without
@@ -135,10 +135,10 @@ config UML_NET_MCAST
135 135
136config UML_NET_PCAP 136config UML_NET_PCAP
137 bool "pcap transport" 137 bool "pcap transport"
138 depends on UML_NET && BROKEN 138 depends on UML_NET && EXPERIMENTAL
139 help 139 help
140 The pcap transport makes a pcap packet stream on the host look 140 The pcap transport makes a pcap packet stream on the host look
141 like an ethernet device inside UML. This is useful for making 141 like an ethernet device inside UML. This is useful for making
142 UML act as a network monitor for the host. You must have libcap 142 UML act as a network monitor for the host. You must have libcap
143 installed in order to build the pcap transport into UML. 143 installed in order to build the pcap transport into UML.
144 144
@@ -169,11 +169,11 @@ config UML_NET_SLIRP
169 setup string. The effect of this transport on the UML is similar 169 setup string. The effect of this transport on the UML is similar
170 that of a host behind a firewall that masquerades all network 170 that of a host behind a firewall that masquerades all network
171 connections passing through it (but is less secure). 171 connections passing through it (but is less secure).
172 172
173 To use this you should first have slirp compiled somewhere 173 To use this you should first have slirp compiled somewhere
174 accessible on the host, and have read its documentation. If you 174 accessible on the host, and have read its documentation. If you
175 don't need UML networking, say N. 175 don't need UML networking, say N.
176 176
177 Startup example: "eth0=slirp,FE:FD:01:02:03:04,/usr/local/bin/slirp" 177 Startup example: "eth0=slirp,FE:FD:01:02:03:04,/usr/local/bin/slirp"
178 178
179endmenu 179endmenu
diff --git a/arch/um/Kconfig_scsi b/arch/um/Kconfig.scsi
index c291c942b1a8..c291c942b1a8 100644
--- a/arch/um/Kconfig_scsi
+++ b/arch/um/Kconfig.scsi
diff --git a/arch/um/Kconfig_x86_64 b/arch/um/Kconfig.x86_64
index 735a047c890c..bd35e59419c8 100644
--- a/arch/um/Kconfig_x86_64
+++ b/arch/um/Kconfig.x86_64
@@ -6,6 +6,10 @@ config 64BIT
6 bool 6 bool
7 default y 7 default y
8 8
9config SEMAPHORE_SLEEPERS
10 bool
11 default y
12
9config TOP_ADDR 13config TOP_ADDR
10 hex 14 hex
11 default 0x80000000 15 default 0x80000000
@@ -33,3 +37,7 @@ config ARCH_HAS_SC_SIGNALS
33config ARCH_REUSE_HOST_VSYSCALL_AREA 37config ARCH_REUSE_HOST_VSYSCALL_AREA
34 bool 38 bool
35 default n 39 default n
40
41config SMP_BROKEN
42 bool
43 default y
diff --git a/arch/um/Makefile b/arch/um/Makefile
index 3f073902351f..b15f6048caae 100644
--- a/arch/um/Makefile
+++ b/arch/um/Makefile
@@ -51,25 +51,27 @@ MRPROPER_DIRS += $(ARCH_DIR)/include2
51endif 51endif
52SYS_DIR := $(ARCH_DIR)/include/sysdep-$(SUBARCH) 52SYS_DIR := $(ARCH_DIR)/include/sysdep-$(SUBARCH)
53 53
54include $(srctree)/$(ARCH_DIR)/Makefile-$(SUBARCH) 54# -Dvmap=kernel_vmap affects everything, and prevents anything from
55# referencing the libpcap.o symbol so named.
56
57CFLAGS += $(CFLAGS-y) -D__arch_um__ -DSUBARCH=\"$(SUBARCH)\" \
58 $(ARCH_INCLUDE) $(MODE_INCLUDE) -Dvmap=kernel_vmap
59AFLAGS += $(ARCH_INCLUDE)
55 60
56core-y += $(SUBARCH_CORE) 61USER_CFLAGS := $(patsubst -I%,,$(CFLAGS))
57libs-y += $(SUBARCH_LIBS) 62USER_CFLAGS := $(patsubst -D__KERNEL__,,$(USER_CFLAGS)) $(ARCH_INCLUDE) \
63 $(MODE_INCLUDE)
58 64
59# -Derrno=kernel_errno - This turns all kernel references to errno into 65# -Derrno=kernel_errno - This turns all kernel references to errno into
60# kernel_errno to separate them from the libc errno. This allows -fno-common 66# kernel_errno to separate them from the libc errno. This allows -fno-common
61# in CFLAGS. Otherwise, it would cause ld to complain about the two different 67# in CFLAGS. Otherwise, it would cause ld to complain about the two different
62# errnos. 68# errnos.
63 69
64CFLAGS += $(CFLAGS-y) -D__arch_um__ -DSUBARCH=\"$(SUBARCH)\" \
65 $(ARCH_INCLUDE) $(MODE_INCLUDE)
66
67USER_CFLAGS := $(patsubst -I%,,$(CFLAGS))
68USER_CFLAGS := $(patsubst -D__KERNEL__,,$(USER_CFLAGS)) $(ARCH_INCLUDE) \
69 $(MODE_INCLUDE) $(ARCH_USER_CFLAGS)
70CFLAGS += -Derrno=kernel_errno -Dsigprocmask=kernel_sigprocmask 70CFLAGS += -Derrno=kernel_errno -Dsigprocmask=kernel_sigprocmask
71CFLAGS += $(call cc-option,-fno-unit-at-a-time,) 71CFLAGS += $(call cc-option,-fno-unit-at-a-time,)
72 72
73include $(srctree)/$(ARCH_DIR)/Makefile-$(SUBARCH)
74
73#This will adjust *FLAGS accordingly to the platform. 75#This will adjust *FLAGS accordingly to the platform.
74include $(srctree)/$(ARCH_DIR)/Makefile-os-$(OS) 76include $(srctree)/$(ARCH_DIR)/Makefile-os-$(OS)
75 77
@@ -100,10 +102,10 @@ define archhelp
100endef 102endef
101 103
102ifneq ($(KBUILD_SRC),) 104ifneq ($(KBUILD_SRC),)
103$(shell mkdir -p $(ARCH_DIR) && ln -fsn $(srctree)/$(ARCH_DIR)/Kconfig_$(SUBARCH) $(ARCH_DIR)/Kconfig_arch) 105$(shell mkdir -p $(ARCH_DIR) && ln -fsn $(srctree)/$(ARCH_DIR)/Kconfig.$(SUBARCH) $(ARCH_DIR)/Kconfig.arch)
104CLEAN_FILES += $(ARCH_DIR)/Kconfig_arch 106CLEAN_FILES += $(ARCH_DIR)/Kconfig.arch
105else 107else
106$(shell cd $(ARCH_DIR) && ln -sf Kconfig_$(SUBARCH) Kconfig_arch) 108$(shell cd $(ARCH_DIR) && ln -sf Kconfig.$(SUBARCH) Kconfig.arch)
107endif 109endif
108 110
109prepare: $(ARCH_SYMLINKS) $(SYS_HEADERS) $(GEN_HEADERS) 111prepare: $(ARCH_SYMLINKS) $(SYS_HEADERS) $(GEN_HEADERS)
@@ -116,18 +118,19 @@ CONFIG_KERNEL_STACK_ORDER ?= 2
116STACK_SIZE := $(shell echo $$[ 4096 * (1 << $(CONFIG_KERNEL_STACK_ORDER)) ] ) 118STACK_SIZE := $(shell echo $$[ 4096 * (1 << $(CONFIG_KERNEL_STACK_ORDER)) ] )
117 119
118ifndef START 120ifndef START
119 START = $$(($(TOP_ADDR) - $(SIZE))) 121 START = $(shell echo $$[ $(TOP_ADDR) - $(SIZE) ] )
120endif 122endif
121 123
122CPPFLAGS_vmlinux.lds = $(shell echo -U$(SUBARCH) \ 124CPPFLAGS_vmlinux.lds = -U$(SUBARCH) \
123 -DSTART=$(START) -DELF_ARCH=$(ELF_ARCH) \ 125 -DSTART=$(START) -DELF_ARCH=$(ELF_ARCH) \
124 -DELF_FORMAT=\"$(ELF_FORMAT)\" $(CPP_MODE-y) \ 126 -DELF_FORMAT="$(ELF_FORMAT)" $(CPP_MODE-y) \
125 -DKERNEL_STACK_SIZE=$(STACK_SIZE) -DSUBARCH=$(SUBARCH)) 127 -DKERNEL_STACK_SIZE=$(STACK_SIZE) \
128 -DUNMAP_PATH=arch/um/sys-$(SUBARCH)/unmap_fin.o
126 129
127#The wrappers will select whether using "malloc" or the kernel allocator. 130#The wrappers will select whether using "malloc" or the kernel allocator.
128LINK_WRAPS = -Wl,--wrap,malloc -Wl,--wrap,free -Wl,--wrap,calloc 131LINK_WRAPS = -Wl,--wrap,malloc -Wl,--wrap,free -Wl,--wrap,calloc
129 132
130CFLAGS_vmlinux = $(LINK-y) $(LINK_WRAPS) 133CFLAGS_vmlinux := $(LINK-y) $(LINK_WRAPS)
131define cmd_vmlinux__ 134define cmd_vmlinux__
132 $(CC) $(CFLAGS_vmlinux) -o $@ \ 135 $(CC) $(CFLAGS_vmlinux) -o $@ \
133 -Wl,-T,$(vmlinux-lds) $(vmlinux-init) \ 136 -Wl,-T,$(vmlinux-lds) $(vmlinux-init) \
@@ -140,11 +143,12 @@ endef
140#When cleaning we don't include .config, so we don't include 143#When cleaning we don't include .config, so we don't include
141#TT or skas makefiles and don't clean skas_ptregs.h. 144#TT or skas makefiles and don't clean skas_ptregs.h.
142CLEAN_FILES += linux x.i gmon.out $(ARCH_DIR)/include/uml-config.h \ 145CLEAN_FILES += linux x.i gmon.out $(ARCH_DIR)/include/uml-config.h \
143 $(GEN_HEADERS) $(ARCH_DIR)/include/skas_ptregs.h 146 $(GEN_HEADERS) $(ARCH_DIR)/include/skas_ptregs.h \
147 $(ARCH_DIR)/include/user_constants.h
144 148
145MRPROPER_FILES += $(SYMLINK_HEADERS) $(ARCH_SYMLINKS) \ 149MRPROPER_FILES += $(SYMLINK_HEADERS) $(ARCH_SYMLINKS) \
146 $(addprefix $(ARCH_DIR)/kernel/,$(KERN_SYMLINKS)) $(ARCH_DIR)/os \ 150 $(addprefix $(ARCH_DIR)/kernel/,$(KERN_SYMLINKS)) $(ARCH_DIR)/os \
147 $(ARCH_DIR)/Kconfig_arch 151 $(ARCH_DIR)/Kconfig.arch
148 152
149archclean: 153archclean:
150 $(Q)$(MAKE) $(clean)=$(ARCH_DIR)/util 154 $(Q)$(MAKE) $(clean)=$(ARCH_DIR)/util
@@ -242,7 +246,7 @@ $(ARCH_DIR)/util: scripts_basic $(SYS_DIR)/sc.h $(ARCH_DIR)/kernel-offsets.h FOR
242$(ARCH_DIR)/kernel/skas/util: scripts_basic $(ARCH_DIR)/user-offsets.h FORCE 246$(ARCH_DIR)/kernel/skas/util: scripts_basic $(ARCH_DIR)/user-offsets.h FORCE
243 $(Q)$(MAKE) $(build)=$@ 247 $(Q)$(MAKE) $(build)=$@
244 248
245$(ARCH_DIR)/os-$(OS)/util: scripts_basic FORCE 249$(ARCH_DIR)/os-$(OS)/util: scripts_basic $(ARCH_DIR)/user-offsets.h FORCE
246 $(Q)$(MAKE) $(build)=$@ 250 $(Q)$(MAKE) $(build)=$@
247 251
248export SUBARCH USER_CFLAGS OS 252export SUBARCH USER_CFLAGS OS
diff --git a/arch/um/Makefile-i386 b/arch/um/Makefile-i386
index 301059062a3e..a777e57dbf89 100644
--- a/arch/um/Makefile-i386
+++ b/arch/um/Makefile-i386
@@ -1,4 +1,4 @@
1SUBARCH_CORE := arch/um/sys-i386/ arch/i386/crypto/ 1core-y += arch/um/sys-i386/ arch/i386/crypto/
2 2
3TOP_ADDR := $(CONFIG_TOP_ADDR) 3TOP_ADDR := $(CONFIG_TOP_ADDR)
4 4
@@ -8,21 +8,33 @@ ifeq ($(CONFIG_MODE_SKAS),y)
8 endif 8 endif
9endif 9endif
10 10
11LDFLAGS += -m elf_i386
12ELF_ARCH := $(SUBARCH)
13ELF_FORMAT := elf32-$(SUBARCH)
14OBJCOPYFLAGS := -O binary -R .note -R .comment -S
15
16ifeq ("$(origin SUBARCH)", "command line")
17ifneq ("$(shell uname -m | sed -e s/i.86/i386/)", "$(SUBARCH)")
18CFLAGS += $(call cc-option,-m32)
19USER_CFLAGS += $(call cc-option,-m32)
20HOSTCFLAGS += $(call cc-option,-m32)
21HOSTLDFLAGS += $(call cc-option,-m32)
22AFLAGS += $(call cc-option,-m32)
23LINK-y += $(call cc-option,-m32)
24UML_OBJCOPYFLAGS += -F $(ELF_FORMAT)
25
26export LDFLAGS HOSTCFLAGS HOSTLDFLAGS UML_OBJCOPYFLAGS
27endif
28endif
29
11CFLAGS += -U__$(SUBARCH)__ -U$(SUBARCH) $(STUB_CFLAGS) 30CFLAGS += -U__$(SUBARCH)__ -U$(SUBARCH) $(STUB_CFLAGS)
12ARCH_USER_CFLAGS :=
13 31
14ifneq ($(CONFIG_GPROF),y) 32ifneq ($(CONFIG_GPROF),y)
15ARCH_CFLAGS += -DUM_FASTCALL 33ARCH_CFLAGS += -DUM_FASTCALL
16endif 34endif
17 35
18ELF_ARCH := $(SUBARCH)
19ELF_FORMAT := elf32-$(SUBARCH)
20
21OBJCOPYFLAGS := -O binary -R .note -R .comment -S
22
23SYS_UTIL_DIR := $(ARCH_DIR)/sys-i386/util 36SYS_UTIL_DIR := $(ARCH_DIR)/sys-i386/util
24 37SYS_HEADERS := $(SYS_DIR)/sc.h $(SYS_DIR)/thread.h
25SYS_HEADERS := $(SYS_DIR)/sc.h $(SYS_DIR)/thread.h
26 38
27prepare: $(SYS_HEADERS) 39prepare: $(SYS_HEADERS)
28 40
diff --git a/arch/um/Makefile-x86_64 b/arch/um/Makefile-x86_64
index d80bd0052e6b..baddb5d64ca5 100644
--- a/arch/um/Makefile-x86_64
+++ b/arch/um/Makefile-x86_64
@@ -1,11 +1,13 @@
1# Copyright 2003 - 2004 Pathscale, Inc 1# Copyright 2003 - 2004 Pathscale, Inc
2# Released under the GPL 2# Released under the GPL
3 3
4SUBARCH_LIBS := arch/um/sys-x86_64/ 4libs-y += arch/um/sys-x86_64/
5START := 0x60000000 5START := 0x60000000
6 6
7CFLAGS += -U__$(SUBARCH)__ -fno-builtin $(STUB_CFLAGS) 7#We #undef __x86_64__ for kernelspace, not for userspace where
8ARCH_USER_CFLAGS := -D__x86_64__ 8#it's needed for headers to work!
9CFLAGS += -U__$(SUBARCH)__ -fno-builtin
10USER_CFLAGS += -fno-builtin
9 11
10ELF_ARCH := i386:x86-64 12ELF_ARCH := i386:x86-64
11ELF_FORMAT := elf64-x86-64 13ELF_FORMAT := elf64-x86-64
diff --git a/arch/um/drivers/Makefile b/arch/um/drivers/Makefile
index b2de9916c32c..783e18cae090 100644
--- a/arch/um/drivers/Makefile
+++ b/arch/um/drivers/Makefile
@@ -10,14 +10,26 @@ slip-objs := slip_kern.o slip_user.o
10slirp-objs := slirp_kern.o slirp_user.o 10slirp-objs := slirp_kern.o slirp_user.o
11daemon-objs := daemon_kern.o daemon_user.o 11daemon-objs := daemon_kern.o daemon_user.o
12mcast-objs := mcast_kern.o mcast_user.o 12mcast-objs := mcast_kern.o mcast_user.o
13#pcap-objs := pcap_kern.o pcap_user.o $(PCAP)
14net-objs := net_kern.o net_user.o 13net-objs := net_kern.o net_user.o
15mconsole-objs := mconsole_kern.o mconsole_user.o 14mconsole-objs := mconsole_kern.o mconsole_user.o
16hostaudio-objs := hostaudio_kern.o 15hostaudio-objs := hostaudio_kern.o
17ubd-objs := ubd_kern.o ubd_user.o 16ubd-objs := ubd_kern.o
18port-objs := port_kern.o port_user.o 17port-objs := port_kern.o port_user.o
19harddog-objs := harddog_kern.o harddog_user.o 18harddog-objs := harddog_kern.o harddog_user.o
20 19
20LDFLAGS_pcap.o := -r $(shell $(CC) $(CFLAGS) -print-file-name=libpcap.a)
21
22targets := pcap_kern.o pcap_user.o
23
24$(obj)/pcap.o: $(obj)/pcap_kern.o $(obj)/pcap_user.o
25 $(LD) -r -dp -o $@ $^ $(LDFLAGS) $(LDFLAGS_pcap.o)
26#XXX: The call below does not work because the flags are added before the
27# object name, so nothing from the library gets linked.
28#$(call if_changed,ld)
29
30# When the above is fixed, don't forget to add this too!
31#targets += $(obj)/pcap.o
32
21obj-y := stdio_console.o fd.o chan_kern.o chan_user.o line.o 33obj-y := stdio_console.o fd.o chan_kern.o chan_user.o line.o
22obj-$(CONFIG_SSL) += ssl.o 34obj-$(CONFIG_SSL) += ssl.o
23obj-$(CONFIG_STDERR_CONSOLE) += stderr_console.o 35obj-$(CONFIG_STDERR_CONSOLE) += stderr_console.o
@@ -26,7 +38,7 @@ obj-$(CONFIG_UML_NET_SLIP) += slip.o slip_common.o
26obj-$(CONFIG_UML_NET_SLIRP) += slirp.o slip_common.o 38obj-$(CONFIG_UML_NET_SLIRP) += slirp.o slip_common.o
27obj-$(CONFIG_UML_NET_DAEMON) += daemon.o 39obj-$(CONFIG_UML_NET_DAEMON) += daemon.o
28obj-$(CONFIG_UML_NET_MCAST) += mcast.o 40obj-$(CONFIG_UML_NET_MCAST) += mcast.o
29#obj-$(CONFIG_UML_NET_PCAP) += pcap.o $(PCAP) 41obj-$(CONFIG_UML_NET_PCAP) += pcap.o
30obj-$(CONFIG_UML_NET) += net.o 42obj-$(CONFIG_UML_NET) += net.o
31obj-$(CONFIG_MCONSOLE) += mconsole.o 43obj-$(CONFIG_MCONSOLE) += mconsole.o
32obj-$(CONFIG_MMAPPER) += mmapper_kern.o 44obj-$(CONFIG_MMAPPER) += mmapper_kern.o
@@ -41,6 +53,7 @@ obj-$(CONFIG_UML_WATCHDOG) += harddog.o
41obj-$(CONFIG_BLK_DEV_COW_COMMON) += cow_user.o 53obj-$(CONFIG_BLK_DEV_COW_COMMON) += cow_user.o
42obj-$(CONFIG_UML_RANDOM) += random.o 54obj-$(CONFIG_UML_RANDOM) += random.o
43 55
44USER_OBJS := fd.o null.o pty.o tty.o xterm.o slip_common.o 56# pcap_user.o must be added explicitly.
57USER_OBJS := fd.o null.o pty.o tty.o xterm.o slip_common.o pcap_user.o
45 58
46include arch/um/scripts/Makefile.rules 59include arch/um/scripts/Makefile.rules
diff --git a/arch/um/drivers/chan_user.c b/arch/um/drivers/chan_user.c
index 5d3768156c92..de3bce71aeb3 100644
--- a/arch/um/drivers/chan_user.c
+++ b/arch/um/drivers/chan_user.c
@@ -63,7 +63,7 @@ error:
63 * 63 *
64 * SIGWINCH can't be received synchronously, so you have to set up to receive it 64 * SIGWINCH can't be received synchronously, so you have to set up to receive it
65 * as a signal. That being the case, if you are going to wait for it, it is 65 * as a signal. That being the case, if you are going to wait for it, it is
66 * convenient to sit in a pause() and wait for the signal to bounce you out of 66 * convenient to sit in sigsuspend() and wait for the signal to bounce you out of
67 * it (see below for how we make sure to exit only on SIGWINCH). 67 * it (see below for how we make sure to exit only on SIGWINCH).
68 */ 68 */
69 69
@@ -94,18 +94,19 @@ static int winch_thread(void *arg)
94 "byte, err = %d\n", -count); 94 "byte, err = %d\n", -count);
95 95
96 /* We are not using SIG_IGN on purpose, so don't fix it as I thought to 96 /* We are not using SIG_IGN on purpose, so don't fix it as I thought to
97 * do! If using SIG_IGN, the pause() call below would not stop on 97 * do! If using SIG_IGN, the sigsuspend() call below would not stop on
98 * SIGWINCH. */ 98 * SIGWINCH. */
99 99
100 signal(SIGWINCH, winch_handler); 100 signal(SIGWINCH, winch_handler);
101 sigfillset(&sigs); 101 sigfillset(&sigs);
102 sigdelset(&sigs, SIGWINCH); 102 /* Block all signals possible. */
103 /* Block anything else than SIGWINCH. */
104 if(sigprocmask(SIG_SETMASK, &sigs, NULL) < 0){ 103 if(sigprocmask(SIG_SETMASK, &sigs, NULL) < 0){
105 printk("winch_thread : sigprocmask failed, errno = %d\n", 104 printk("winch_thread : sigprocmask failed, errno = %d\n",
106 errno); 105 errno);
107 exit(1); 106 exit(1);
108 } 107 }
108 /* In sigsuspend(), block anything else than SIGWINCH. */
109 sigdelset(&sigs, SIGWINCH);
109 110
110 if(setsid() < 0){ 111 if(setsid() < 0){
111 printk("winch_thread : setsid failed, errno = %d\n", errno); 112 printk("winch_thread : setsid failed, errno = %d\n", errno);
@@ -130,7 +131,7 @@ static int winch_thread(void *arg)
130 while(1){ 131 while(1){
131 /* This will be interrupted by SIGWINCH only, since other signals 132 /* This will be interrupted by SIGWINCH only, since other signals
132 * are blocked.*/ 133 * are blocked.*/
133 pause(); 134 sigsuspend(&sigs);
134 135
135 count = os_write_file(pipe_fd, &c, sizeof(c)); 136 count = os_write_file(pipe_fd, &c, sizeof(c));
136 if(count != sizeof(c)) 137 if(count != sizeof(c))
diff --git a/arch/um/drivers/cow.h b/arch/um/drivers/cow.h
index 4fcbe8b1b77e..4fcf3a8d13f4 100644
--- a/arch/um/drivers/cow.h
+++ b/arch/um/drivers/cow.h
@@ -3,10 +3,10 @@
3 3
4#include <asm/types.h> 4#include <asm/types.h>
5 5
6#if __BYTE_ORDER == __BIG_ENDIAN 6#if defined(__BIG_ENDIAN)
7# define ntohll(x) (x) 7# define ntohll(x) (x)
8# define htonll(x) (x) 8# define htonll(x) (x)
9#elif __BYTE_ORDER == __LITTLE_ENDIAN 9#elif defined(__LITTLE_ENDIAN)
10# define ntohll(x) bswap_64(x) 10# define ntohll(x) bswap_64(x)
11# define htonll(x) bswap_64(x) 11# define htonll(x) bswap_64(x)
12#else 12#else
diff --git a/arch/um/drivers/hostaudio_kern.c b/arch/um/drivers/hostaudio_kern.c
index d5742783e19d..59602b81b240 100644
--- a/arch/um/drivers/hostaudio_kern.c
+++ b/arch/um/drivers/hostaudio_kern.c
@@ -57,10 +57,10 @@ __uml_setup("mixer=", set_mixer, "mixer=<mixer device>\n" MIXER_HELP);
57 57
58#else /*MODULE*/ 58#else /*MODULE*/
59 59
60MODULE_PARM(dsp, "s"); 60module_param(dsp, charp, 0644);
61MODULE_PARM_DESC(dsp, DSP_HELP); 61MODULE_PARM_DESC(dsp, DSP_HELP);
62 62
63MODULE_PARM(mixer, "s"); 63module_param(mixer, charp, 0644);
64MODULE_PARM_DESC(mixer, MIXER_HELP); 64MODULE_PARM_DESC(mixer, MIXER_HELP);
65 65
66#endif 66#endif
diff --git a/arch/um/drivers/mconsole_kern.c b/arch/um/drivers/mconsole_kern.c
index 404de41a4f67..c190c2414197 100644
--- a/arch/um/drivers/mconsole_kern.c
+++ b/arch/um/drivers/mconsole_kern.c
@@ -557,7 +557,7 @@ static int create_proc_mconsole(void)
557 557
558 ent = create_proc_entry("mconsole", S_IFREG | 0200, NULL); 558 ent = create_proc_entry("mconsole", S_IFREG | 0200, NULL);
559 if(ent == NULL){ 559 if(ent == NULL){
560 printk("create_proc_mconsole : create_proc_entry failed\n"); 560 printk(KERN_INFO "create_proc_mconsole : create_proc_entry failed\n");
561 return(0); 561 return(0);
562 } 562 }
563 563
diff --git a/arch/um/drivers/mmapper_kern.c b/arch/um/drivers/mmapper_kern.c
index a37a5ac13c22..022f67bb6873 100644
--- a/arch/um/drivers/mmapper_kern.c
+++ b/arch/um/drivers/mmapper_kern.c
@@ -9,19 +9,11 @@
9 * 9 *
10 */ 10 */
11 11
12#include <linux/types.h> 12#include <linux/init.h>
13#include <linux/kdev_t.h>
14#include <linux/time.h>
15#include <linux/devfs_fs_kernel.h>
16#include <linux/module.h> 13#include <linux/module.h>
17#include <linux/mm.h> 14#include <linux/mm.h>
18#include <linux/slab.h>
19#include <linux/init.h>
20#include <linux/smp_lock.h>
21#include <linux/miscdevice.h> 15#include <linux/miscdevice.h>
22#include <asm/uaccess.h> 16#include <asm/uaccess.h>
23#include <asm/irq.h>
24#include <asm/pgtable.h>
25#include "mem_user.h" 17#include "mem_user.h"
26#include "user_util.h" 18#include "user_util.h"
27 19
@@ -31,35 +23,22 @@ static unsigned long p_buf = 0;
31static char *v_buf = NULL; 23static char *v_buf = NULL;
32 24
33static ssize_t 25static ssize_t
34mmapper_read(struct file *file, char *buf, size_t count, loff_t *ppos) 26mmapper_read(struct file *file, char __user *buf, size_t count, loff_t *ppos)
35{ 27{
36 if(*ppos > mmapper_size) 28 return simple_read_from_buffer(buf, count, ppos, v_buf, mmapper_size);
37 return -EINVAL;
38
39 if(count + *ppos > mmapper_size)
40 count = count + *ppos - mmapper_size;
41
42 if(count < 0)
43 return -EINVAL;
44
45 copy_to_user(buf,&v_buf[*ppos],count);
46
47 return count;
48} 29}
49 30
50static ssize_t 31static ssize_t
51mmapper_write(struct file *file, const char *buf, size_t count, loff_t *ppos) 32mmapper_write(struct file *file, const char __user *buf, size_t count, loff_t *ppos)
52{ 33{
53 if(*ppos > mmapper_size) 34 if (*ppos > mmapper_size)
54 return -EINVAL; 35 return -EINVAL;
55 36
56 if(count + *ppos > mmapper_size) 37 if (count > mmapper_size - *ppos)
57 count = count + *ppos - mmapper_size; 38 count = mmapper_size - *ppos;
58
59 if(count < 0)
60 return -EINVAL;
61 39
62 copy_from_user(&v_buf[*ppos],buf,count); 40 if (copy_from_user(&v_buf[*ppos], buf, count))
41 return -EFAULT;
63 42
64 return count; 43 return count;
65} 44}
@@ -77,7 +56,6 @@ mmapper_mmap(struct file *file, struct vm_area_struct * vma)
77 int ret = -EINVAL; 56 int ret = -EINVAL;
78 int size; 57 int size;
79 58
80 lock_kernel();
81 if (vma->vm_pgoff != 0) 59 if (vma->vm_pgoff != 0)
82 goto out; 60 goto out;
83 61
@@ -92,7 +70,6 @@ mmapper_mmap(struct file *file, struct vm_area_struct * vma)
92 goto out; 70 goto out;
93 ret = 0; 71 ret = 0;
94out: 72out:
95 unlock_kernel();
96 return ret; 73 return ret;
97} 74}
98 75
diff --git a/arch/um/drivers/ubd_kern.c b/arch/um/drivers/ubd_kern.c
index 344b24d09a7c..e77a38da4350 100644
--- a/arch/um/drivers/ubd_kern.c
+++ b/arch/um/drivers/ubd_kern.c
@@ -35,6 +35,7 @@
35#include "linux/blkpg.h" 35#include "linux/blkpg.h"
36#include "linux/genhd.h" 36#include "linux/genhd.h"
37#include "linux/spinlock.h" 37#include "linux/spinlock.h"
38#include "asm/atomic.h"
38#include "asm/segment.h" 39#include "asm/segment.h"
39#include "asm/uaccess.h" 40#include "asm/uaccess.h"
40#include "asm/irq.h" 41#include "asm/irq.h"
@@ -53,20 +54,21 @@
53#include "mem.h" 54#include "mem.h"
54#include "mem_kern.h" 55#include "mem_kern.h"
55#include "cow.h" 56#include "cow.h"
57#include "aio.h"
56 58
57enum ubd_req { UBD_READ, UBD_WRITE }; 59enum ubd_req { UBD_READ, UBD_WRITE };
58 60
59struct io_thread_req { 61struct io_thread_req {
60 enum ubd_req op; 62 enum aio_type op;
61 int fds[2]; 63 int fds[2];
62 unsigned long offsets[2]; 64 unsigned long offsets[2];
63 unsigned long long offset; 65 unsigned long long offset;
64 unsigned long length; 66 unsigned long length;
65 char *buffer; 67 char *buffer;
66 int sectorsize; 68 int sectorsize;
67 unsigned long sector_mask; 69 int bitmap_offset;
68 unsigned long long cow_offset; 70 long bitmap_start;
69 unsigned long bitmap_words[2]; 71 long bitmap_end;
70 int error; 72 int error;
71}; 73};
72 74
@@ -80,28 +82,31 @@ extern int create_cow_file(char *cow_file, char *backing_file,
80 unsigned long *bitmap_len_out, 82 unsigned long *bitmap_len_out,
81 int *data_offset_out); 83 int *data_offset_out);
82extern int read_cow_bitmap(int fd, void *buf, int offset, int len); 84extern int read_cow_bitmap(int fd, void *buf, int offset, int len);
83extern void do_io(struct io_thread_req *req); 85extern void do_io(struct io_thread_req *req, struct request *r,
86 unsigned long *bitmap);
84 87
85static inline int ubd_test_bit(__u64 bit, unsigned char *data) 88static inline int ubd_test_bit(__u64 bit, void *data)
86{ 89{
90 unsigned char *buffer = data;
87 __u64 n; 91 __u64 n;
88 int bits, off; 92 int bits, off;
89 93
90 bits = sizeof(data[0]) * 8; 94 bits = sizeof(buffer[0]) * 8;
91 n = bit / bits; 95 n = bit / bits;
92 off = bit % bits; 96 off = bit % bits;
93 return((data[n] & (1 << off)) != 0); 97 return((buffer[n] & (1 << off)) != 0);
94} 98}
95 99
96static inline void ubd_set_bit(__u64 bit, unsigned char *data) 100static inline void ubd_set_bit(__u64 bit, void *data)
97{ 101{
102 unsigned char *buffer = data;
98 __u64 n; 103 __u64 n;
99 int bits, off; 104 int bits, off;
100 105
101 bits = sizeof(data[0]) * 8; 106 bits = sizeof(buffer[0]) * 8;
102 n = bit / bits; 107 n = bit / bits;
103 off = bit % bits; 108 off = bit % bits;
104 data[n] |= (1 << off); 109 buffer[n] |= (1 << off);
105} 110}
106/*End stuff from ubd_user.h*/ 111/*End stuff from ubd_user.h*/
107 112
@@ -110,8 +115,6 @@ static inline void ubd_set_bit(__u64 bit, unsigned char *data)
110static DEFINE_SPINLOCK(ubd_io_lock); 115static DEFINE_SPINLOCK(ubd_io_lock);
111static DEFINE_SPINLOCK(ubd_lock); 116static DEFINE_SPINLOCK(ubd_lock);
112 117
113static void (*do_ubd)(void);
114
115static int ubd_open(struct inode * inode, struct file * filp); 118static int ubd_open(struct inode * inode, struct file * filp);
116static int ubd_release(struct inode * inode, struct file * file); 119static int ubd_release(struct inode * inode, struct file * file);
117static int ubd_ioctl(struct inode * inode, struct file * file, 120static int ubd_ioctl(struct inode * inode, struct file * file,
@@ -158,6 +161,8 @@ struct cow {
158 int data_offset; 161 int data_offset;
159}; 162};
160 163
164#define MAX_SG 64
165
161struct ubd { 166struct ubd {
162 char *file; 167 char *file;
163 int count; 168 int count;
@@ -168,6 +173,7 @@ struct ubd {
168 int no_cow; 173 int no_cow;
169 struct cow cow; 174 struct cow cow;
170 struct platform_device pdev; 175 struct platform_device pdev;
176 struct scatterlist sg[MAX_SG];
171}; 177};
172 178
173#define DEFAULT_COW { \ 179#define DEFAULT_COW { \
@@ -460,80 +466,113 @@ __uml_help(fakehd,
460); 466);
461 467
462static void do_ubd_request(request_queue_t * q); 468static void do_ubd_request(request_queue_t * q);
463 469static int in_ubd;
464/* Only changed by ubd_init, which is an initcall. */
465int thread_fd = -1;
466 470
467/* Changed by ubd_handler, which is serialized because interrupts only 471/* Changed by ubd_handler, which is serialized because interrupts only
468 * happen on CPU 0. 472 * happen on CPU 0.
469 */ 473 */
470int intr_count = 0; 474int intr_count = 0;
471 475
472/* call ubd_finish if you need to serialize */ 476static void ubd_end_request(struct request *req, int bytes, int uptodate)
473static void __ubd_finish(struct request *req, int error)
474{ 477{
475 int nsect; 478 if (!end_that_request_first(req, uptodate, bytes >> 9)) {
476 479 add_disk_randomness(req->rq_disk);
477 if(error){ 480 end_that_request_last(req);
478 end_request(req, 0);
479 return;
480 } 481 }
481 nsect = req->current_nr_sectors;
482 req->sector += nsect;
483 req->buffer += nsect << 9;
484 req->errors = 0;
485 req->nr_sectors -= nsect;
486 req->current_nr_sectors = 0;
487 end_request(req, 1);
488} 482}
489 483
490static inline void ubd_finish(struct request *req, int error) 484/* call ubd_finish if you need to serialize */
485static void __ubd_finish(struct request *req, int bytes)
491{ 486{
492 spin_lock(&ubd_io_lock); 487 if(bytes < 0){
493 __ubd_finish(req, error); 488 ubd_end_request(req, 0, 0);
494 spin_unlock(&ubd_io_lock); 489 return;
490 }
491
492 ubd_end_request(req, bytes, 1);
495} 493}
496 494
497/* Called without ubd_io_lock held */ 495static inline void ubd_finish(struct request *req, int bytes)
498static void ubd_handler(void)
499{ 496{
500 struct io_thread_req req; 497 spin_lock(&ubd_io_lock);
501 struct request *rq = elv_next_request(ubd_queue); 498 __ubd_finish(req, bytes);
502 int n; 499 spin_unlock(&ubd_io_lock);
503
504 do_ubd = NULL;
505 intr_count++;
506 n = os_read_file(thread_fd, &req, sizeof(req));
507 if(n != sizeof(req)){
508 printk(KERN_ERR "Pid %d - spurious interrupt in ubd_handler, "
509 "err = %d\n", os_getpid(), -n);
510 spin_lock(&ubd_io_lock);
511 end_request(rq, 0);
512 spin_unlock(&ubd_io_lock);
513 return;
514 }
515
516 ubd_finish(rq, req.error);
517 reactivate_fd(thread_fd, UBD_IRQ);
518 do_ubd_request(ubd_queue);
519} 500}
520 501
502struct bitmap_io {
503 atomic_t count;
504 struct aio_context aio;
505};
506
507struct ubd_aio {
508 struct aio_context aio;
509 struct request *req;
510 int len;
511 struct bitmap_io *bitmap;
512 void *bitmap_buf;
513};
514
515static int ubd_reply_fd = -1;
516
521static irqreturn_t ubd_intr(int irq, void *dev, struct pt_regs *unused) 517static irqreturn_t ubd_intr(int irq, void *dev, struct pt_regs *unused)
522{ 518{
523 ubd_handler(); 519 struct aio_thread_reply reply;
524 return(IRQ_HANDLED); 520 struct ubd_aio *aio;
525} 521 struct request *req;
522 int err, n, fd = (int) (long) dev;
523
524 while(1){
525 err = os_read_file(fd, &reply, sizeof(reply));
526 if(err == -EAGAIN)
527 break;
528 if(err < 0){
529 printk("ubd_aio_handler - read returned err %d\n",
530 -err);
531 break;
532 }
526 533
527/* Only changed by ubd_init, which is an initcall. */ 534 aio = container_of(reply.data, struct ubd_aio, aio);
528static int io_pid = -1; 535 n = reply.err;
529 536
530void kill_io_thread(void) 537 if(n == 0){
531{ 538 req = aio->req;
532 if(io_pid != -1) 539 req->nr_sectors -= aio->len >> 9;
533 os_kill_process(io_pid, 1); 540
534} 541 if((aio->bitmap != NULL) &&
542 (atomic_dec_and_test(&aio->bitmap->count))){
543 aio->aio = aio->bitmap->aio;
544 aio->len = 0;
545 kfree(aio->bitmap);
546 aio->bitmap = NULL;
547 submit_aio(&aio->aio);
548 }
549 else {
550 if((req->nr_sectors == 0) &&
551 (aio->bitmap == NULL)){
552 int len = req->hard_nr_sectors << 9;
553 ubd_finish(req, len);
554 }
555
556 if(aio->bitmap_buf != NULL)
557 kfree(aio->bitmap_buf);
558 kfree(aio);
559 }
560 }
561 else if(n < 0){
562 ubd_finish(aio->req, n);
563 if(aio->bitmap != NULL)
564 kfree(aio->bitmap);
565 if(aio->bitmap_buf != NULL)
566 kfree(aio->bitmap_buf);
567 kfree(aio);
568 }
569 }
570 reactivate_fd(fd, UBD_IRQ);
535 571
536__uml_exitcall(kill_io_thread); 572 do_ubd_request(ubd_queue);
573
574 return(IRQ_HANDLED);
575}
537 576
538static int ubd_file_size(struct ubd *dev, __u64 *size_out) 577static int ubd_file_size(struct ubd *dev, __u64 *size_out)
539{ 578{
@@ -569,7 +608,7 @@ static int ubd_open_dev(struct ubd *dev)
569 &dev->cow.data_offset, create_ptr); 608 &dev->cow.data_offset, create_ptr);
570 609
571 if((dev->fd == -ENOENT) && create_cow){ 610 if((dev->fd == -ENOENT) && create_cow){
572 dev->fd = create_cow_file(dev->file, dev->cow.file, 611 dev->fd = create_cow_file(dev->file, dev->cow.file,
573 dev->openflags, 1 << 9, PAGE_SIZE, 612 dev->openflags, 1 << 9, PAGE_SIZE,
574 &dev->cow.bitmap_offset, 613 &dev->cow.bitmap_offset,
575 &dev->cow.bitmap_len, 614 &dev->cow.bitmap_len,
@@ -668,21 +707,22 @@ static int ubd_add(int n)
668 struct ubd *dev = &ubd_dev[n]; 707 struct ubd *dev = &ubd_dev[n];
669 int err; 708 int err;
670 709
710 err = -ENODEV;
671 if(dev->file == NULL) 711 if(dev->file == NULL)
672 return(-ENODEV); 712 goto out;
673 713
674 if (ubd_open_dev(dev)) 714 if (ubd_open_dev(dev))
675 return(-ENODEV); 715 goto out;
676 716
677 err = ubd_file_size(dev, &dev->size); 717 err = ubd_file_size(dev, &dev->size);
678 if(err < 0) 718 if(err < 0)
679 return(err); 719 goto out_close;
680 720
681 dev->size = ROUND_BLOCK(dev->size); 721 dev->size = ROUND_BLOCK(dev->size);
682 722
683 err = ubd_new_disk(MAJOR_NR, dev->size, n, &ubd_gendisk[n]); 723 err = ubd_new_disk(MAJOR_NR, dev->size, n, &ubd_gendisk[n]);
684 if(err) 724 if(err)
685 return(err); 725 goto out_close;
686 726
687 if(fake_major != MAJOR_NR) 727 if(fake_major != MAJOR_NR)
688 ubd_new_disk(fake_major, dev->size, n, 728 ubd_new_disk(fake_major, dev->size, n,
@@ -693,8 +733,11 @@ static int ubd_add(int n)
693 if (fake_ide) 733 if (fake_ide)
694 make_ide_entries(ubd_gendisk[n]->disk_name); 734 make_ide_entries(ubd_gendisk[n]->disk_name);
695 735
736 err = 0;
737out_close:
696 ubd_close(dev); 738 ubd_close(dev);
697 return 0; 739out:
740 return err;
698} 741}
699 742
700static int ubd_config(char *str) 743static int ubd_config(char *str)
@@ -827,6 +870,10 @@ int ubd_init(void)
827{ 870{
828 int i; 871 int i;
829 872
873 ubd_reply_fd = init_aio_irq(UBD_IRQ, "ubd", ubd_intr);
874 if(ubd_reply_fd < 0)
875 printk("Setting up ubd AIO failed, err = %d\n", ubd_reply_fd);
876
830 devfs_mk_dir("ubd"); 877 devfs_mk_dir("ubd");
831 if (register_blkdev(MAJOR_NR, "ubd")) 878 if (register_blkdev(MAJOR_NR, "ubd"))
832 return -1; 879 return -1;
@@ -837,6 +884,7 @@ int ubd_init(void)
837 return -1; 884 return -1;
838 } 885 }
839 886
887 blk_queue_max_hw_segments(ubd_queue, MAX_SG);
840 if (fake_major != MAJOR_NR) { 888 if (fake_major != MAJOR_NR) {
841 char name[sizeof("ubd_nnn\0")]; 889 char name[sizeof("ubd_nnn\0")];
842 890
@@ -848,40 +896,12 @@ int ubd_init(void)
848 driver_register(&ubd_driver); 896 driver_register(&ubd_driver);
849 for (i = 0; i < MAX_DEV; i++) 897 for (i = 0; i < MAX_DEV; i++)
850 ubd_add(i); 898 ubd_add(i);
899
851 return 0; 900 return 0;
852} 901}
853 902
854late_initcall(ubd_init); 903late_initcall(ubd_init);
855 904
856int ubd_driver_init(void){
857 unsigned long stack;
858 int err;
859
860 /* Set by CONFIG_BLK_DEV_UBD_SYNC or ubd=sync.*/
861 if(global_openflags.s){
862 printk(KERN_INFO "ubd: Synchronous mode\n");
863 /* Letting ubd=sync be like using ubd#s= instead of ubd#= is
864 * enough. So use anyway the io thread. */
865 }
866 stack = alloc_stack(0, 0);
867 io_pid = start_io_thread(stack + PAGE_SIZE - sizeof(void *),
868 &thread_fd);
869 if(io_pid < 0){
870 printk(KERN_ERR
871 "ubd : Failed to start I/O thread (errno = %d) - "
872 "falling back to synchronous I/O\n", -io_pid);
873 io_pid = -1;
874 return(0);
875 }
876 err = um_request_irq(UBD_IRQ, thread_fd, IRQ_READ, ubd_intr,
877 SA_INTERRUPT, "ubd", ubd_dev);
878 if(err != 0)
879 printk(KERN_ERR "um_request_irq failed - errno = %d\n", -err);
880 return(err);
881}
882
883device_initcall(ubd_driver_init);
884
885static int ubd_open(struct inode *inode, struct file *filp) 905static int ubd_open(struct inode *inode, struct file *filp)
886{ 906{
887 struct gendisk *disk = inode->i_bdev->bd_disk; 907 struct gendisk *disk = inode->i_bdev->bd_disk;
@@ -919,105 +939,55 @@ static int ubd_release(struct inode * inode, struct file * file)
919 return(0); 939 return(0);
920} 940}
921 941
922static void cowify_bitmap(__u64 io_offset, int length, unsigned long *cow_mask, 942static void cowify_bitmap(struct io_thread_req *req, unsigned long *bitmap)
923 __u64 *cow_offset, unsigned long *bitmap,
924 __u64 bitmap_offset, unsigned long *bitmap_words,
925 __u64 bitmap_len)
926{ 943{
927 __u64 sector = io_offset >> 9; 944 __u64 sector = req->offset / req->sectorsize;
928 int i, update_bitmap = 0; 945 int i;
929
930 for(i = 0; i < length >> 9; i++){
931 if(cow_mask != NULL)
932 ubd_set_bit(i, (unsigned char *) cow_mask);
933 if(ubd_test_bit(sector + i, (unsigned char *) bitmap))
934 continue;
935
936 update_bitmap = 1;
937 ubd_set_bit(sector + i, (unsigned char *) bitmap);
938 }
939
940 if(!update_bitmap)
941 return;
942
943 *cow_offset = sector / (sizeof(unsigned long) * 8);
944
945 /* This takes care of the case where we're exactly at the end of the
946 * device, and *cow_offset + 1 is off the end. So, just back it up
947 * by one word. Thanks to Lynn Kerby for the fix and James McMechan
948 * for the original diagnosis.
949 */
950 if(*cow_offset == ((bitmap_len + sizeof(unsigned long) - 1) /
951 sizeof(unsigned long) - 1))
952 (*cow_offset)--;
953
954 bitmap_words[0] = bitmap[*cow_offset];
955 bitmap_words[1] = bitmap[*cow_offset + 1];
956
957 *cow_offset *= sizeof(unsigned long);
958 *cow_offset += bitmap_offset;
959}
960 946
961static void cowify_req(struct io_thread_req *req, unsigned long *bitmap, 947 for(i = 0; i < req->length / req->sectorsize; i++){
962 __u64 bitmap_offset, __u64 bitmap_len) 948 if(ubd_test_bit(sector + i, bitmap))
963{ 949 continue;
964 __u64 sector = req->offset >> 9;
965 int i;
966 950
967 if(req->length > (sizeof(req->sector_mask) * 8) << 9) 951 if(req->bitmap_start == -1)
968 panic("Operation too long"); 952 req->bitmap_start = sector + i;
953 req->bitmap_end = sector + i + 1;
969 954
970 if(req->op == UBD_READ) { 955 ubd_set_bit(sector + i, bitmap);
971 for(i = 0; i < req->length >> 9; i++){ 956 }
972 if(ubd_test_bit(sector + i, (unsigned char *) bitmap))
973 ubd_set_bit(i, (unsigned char *)
974 &req->sector_mask);
975 }
976 }
977 else cowify_bitmap(req->offset, req->length, &req->sector_mask,
978 &req->cow_offset, bitmap, bitmap_offset,
979 req->bitmap_words, bitmap_len);
980} 957}
981 958
982/* Called with ubd_io_lock held */ 959/* Called with ubd_io_lock held */
983static int prepare_request(struct request *req, struct io_thread_req *io_req) 960static int prepare_request(struct request *req, struct io_thread_req *io_req,
961 unsigned long long offset, int page_offset,
962 int len, struct page *page)
984{ 963{
985 struct gendisk *disk = req->rq_disk; 964 struct gendisk *disk = req->rq_disk;
986 struct ubd *dev = disk->private_data; 965 struct ubd *dev = disk->private_data;
987 __u64 offset;
988 int len;
989
990 if(req->rq_status == RQ_INACTIVE) return(1);
991 966
992 /* This should be impossible now */ 967 /* This should be impossible now */
993 if((rq_data_dir(req) == WRITE) && !dev->openflags.w){ 968 if((rq_data_dir(req) == WRITE) && !dev->openflags.w){
994 printk("Write attempted on readonly ubd device %s\n", 969 printk("Write attempted on readonly ubd device %s\n",
995 disk->disk_name); 970 disk->disk_name);
996 end_request(req, 0); 971 ubd_end_request(req, 0, 0);
997 return(1); 972 return(1);
998 } 973 }
999 974
1000 offset = ((__u64) req->sector) << 9;
1001 len = req->current_nr_sectors << 9;
1002
1003 io_req->fds[0] = (dev->cow.file != NULL) ? dev->cow.fd : dev->fd; 975 io_req->fds[0] = (dev->cow.file != NULL) ? dev->cow.fd : dev->fd;
1004 io_req->fds[1] = dev->fd; 976 io_req->fds[1] = dev->fd;
1005 io_req->cow_offset = -1;
1006 io_req->offset = offset; 977 io_req->offset = offset;
1007 io_req->length = len; 978 io_req->length = len;
1008 io_req->error = 0; 979 io_req->error = 0;
1009 io_req->sector_mask = 0; 980 io_req->op = (rq_data_dir(req) == READ) ? AIO_READ : AIO_WRITE;
1010
1011 io_req->op = (rq_data_dir(req) == READ) ? UBD_READ : UBD_WRITE;
1012 io_req->offsets[0] = 0; 981 io_req->offsets[0] = 0;
1013 io_req->offsets[1] = dev->cow.data_offset; 982 io_req->offsets[1] = dev->cow.data_offset;
1014 io_req->buffer = req->buffer; 983 io_req->buffer = page_address(page) + page_offset;
1015 io_req->sectorsize = 1 << 9; 984 io_req->sectorsize = 1 << 9;
985 io_req->bitmap_offset = dev->cow.bitmap_offset;
986 io_req->bitmap_start = -1;
987 io_req->bitmap_end = -1;
1016 988
1017 if(dev->cow.file != NULL) 989 if((dev->cow.file != NULL) && (io_req->op == UBD_WRITE))
1018 cowify_req(io_req, dev->cow.bitmap, dev->cow.bitmap_offset, 990 cowify_bitmap(io_req, dev->cow.bitmap);
1019 dev->cow.bitmap_len);
1020
1021 return(0); 991 return(0);
1022} 992}
1023 993
@@ -1026,30 +996,36 @@ static void do_ubd_request(request_queue_t *q)
1026{ 996{
1027 struct io_thread_req io_req; 997 struct io_thread_req io_req;
1028 struct request *req; 998 struct request *req;
1029 int err, n; 999 __u64 sector;
1030 1000 int err;
1031 if(thread_fd == -1){ 1001
1032 while((req = elv_next_request(q)) != NULL){ 1002 if(in_ubd)
1033 err = prepare_request(req, &io_req); 1003 return;
1034 if(!err){ 1004 in_ubd = 1;
1035 do_io(&io_req); 1005 while((req = elv_next_request(q)) != NULL){
1036 __ubd_finish(req, io_req.error); 1006 struct gendisk *disk = req->rq_disk;
1037 } 1007 struct ubd *dev = disk->private_data;
1038 } 1008 int n, i;
1039 } 1009
1040 else { 1010 blkdev_dequeue_request(req);
1041 if(do_ubd || (req = elv_next_request(q)) == NULL) 1011
1042 return; 1012 sector = req->sector;
1043 err = prepare_request(req, &io_req); 1013 n = blk_rq_map_sg(q, req, dev->sg);
1044 if(!err){ 1014
1045 do_ubd = ubd_handler; 1015 for(i = 0; i < n; i++){
1046 n = os_write_file(thread_fd, (char *) &io_req, 1016 struct scatterlist *sg = &dev->sg[i];
1047 sizeof(io_req)); 1017
1048 if(n != sizeof(io_req)) 1018 err = prepare_request(req, &io_req, sector << 9,
1049 printk("write to io thread failed, " 1019 sg->offset, sg->length,
1050 "errno = %d\n", -n); 1020 sg->page);
1021 if(err)
1022 continue;
1023
1024 sector += sg->length >> 9;
1025 do_io(&io_req, req, dev->cow.bitmap);
1051 } 1026 }
1052 } 1027 }
1028 in_ubd = 0;
1053} 1029}
1054 1030
1055static int ubd_ioctl(struct inode * inode, struct file * file, 1031static int ubd_ioctl(struct inode * inode, struct file * file,
@@ -1265,131 +1241,95 @@ int create_cow_file(char *cow_file, char *backing_file, struct openflags flags,
1265 return(err); 1241 return(err);
1266} 1242}
1267 1243
1268static int update_bitmap(struct io_thread_req *req) 1244void do_io(struct io_thread_req *req, struct request *r, unsigned long *bitmap)
1269{
1270 int n;
1271
1272 if(req->cow_offset == -1)
1273 return(0);
1274
1275 n = os_seek_file(req->fds[1], req->cow_offset);
1276 if(n < 0){
1277 printk("do_io - bitmap lseek failed : err = %d\n", -n);
1278 return(1);
1279 }
1280
1281 n = os_write_file(req->fds[1], &req->bitmap_words,
1282 sizeof(req->bitmap_words));
1283 if(n != sizeof(req->bitmap_words)){
1284 printk("do_io - bitmap update failed, err = %d fd = %d\n", -n,
1285 req->fds[1]);
1286 return(1);
1287 }
1288
1289 return(0);
1290}
1291
1292void do_io(struct io_thread_req *req)
1293{ 1245{
1294 char *buf; 1246 struct ubd_aio *aio;
1295 unsigned long len; 1247 struct bitmap_io *bitmap_io = NULL;
1296 int n, nsectors, start, end, bit; 1248 char *buf;
1297 int err; 1249 void *bitmap_buf = NULL;
1298 __u64 off; 1250 unsigned long len, sector;
1299 1251 int nsectors, start, end, bit, err;
1300 nsectors = req->length / req->sectorsize; 1252 __u64 off;
1301 start = 0; 1253
1302 do { 1254 if(req->bitmap_start != -1){
1303 bit = ubd_test_bit(start, (unsigned char *) &req->sector_mask); 1255 /* Round up to the nearest word */
1304 end = start; 1256 int round = sizeof(unsigned long);
1305 while((end < nsectors) && 1257 len = (req->bitmap_end - req->bitmap_start +
1306 (ubd_test_bit(end, (unsigned char *) 1258 round * 8 - 1) / (round * 8);
1307 &req->sector_mask) == bit)) 1259 len *= round;
1308 end++; 1260
1309 1261 off = req->bitmap_start / (8 * round);
1310 off = req->offset + req->offsets[bit] + 1262 off *= round;
1311 start * req->sectorsize; 1263
1312 len = (end - start) * req->sectorsize; 1264 bitmap_io = kmalloc(sizeof(*bitmap_io), GFP_KERNEL);
1313 buf = &req->buffer[start * req->sectorsize]; 1265 if(bitmap_io == NULL){
1314 1266 printk("Failed to kmalloc bitmap IO\n");
1315 err = os_seek_file(req->fds[bit], off); 1267 req->error = 1;
1316 if(err < 0){ 1268 return;
1317 printk("do_io - lseek failed : err = %d\n", -err); 1269 }
1318 req->error = 1;
1319 return;
1320 }
1321 if(req->op == UBD_READ){
1322 n = 0;
1323 do {
1324 buf = &buf[n];
1325 len -= n;
1326 n = os_read_file(req->fds[bit], buf, len);
1327 if (n < 0) {
1328 printk("do_io - read failed, err = %d "
1329 "fd = %d\n", -n, req->fds[bit]);
1330 req->error = 1;
1331 return;
1332 }
1333 } while((n < len) && (n != 0));
1334 if (n < len) memset(&buf[n], 0, len - n);
1335 } else {
1336 n = os_write_file(req->fds[bit], buf, len);
1337 if(n != len){
1338 printk("do_io - write failed err = %d "
1339 "fd = %d\n", -n, req->fds[bit]);
1340 req->error = 1;
1341 return;
1342 }
1343 }
1344 1270
1345 start = end; 1271 bitmap_buf = kmalloc(len, GFP_KERNEL);
1346 } while(start < nsectors); 1272 if(bitmap_buf == NULL){
1273 printk("do_io : kmalloc of bitmap chunk "
1274 "failed\n");
1275 kfree(bitmap_io);
1276 req->error = 1;
1277 return;
1278 }
1279 memcpy(bitmap_buf, &bitmap[off / sizeof(bitmap[0])], len);
1280
1281 *bitmap_io = ((struct bitmap_io)
1282 { .count = ATOMIC_INIT(0),
1283 .aio = INIT_AIO(AIO_WRITE, req->fds[1],
1284 bitmap_buf, len,
1285 req->bitmap_offset + off,
1286 ubd_reply_fd) } );
1287 }
1347 1288
1348 req->error = update_bitmap(req); 1289 nsectors = req->length / req->sectorsize;
1349} 1290 start = 0;
1291 end = nsectors;
1292 bit = 0;
1293 do {
1294 if(bitmap != NULL){
1295 sector = req->offset / req->sectorsize;
1296 bit = ubd_test_bit(sector + start, bitmap);
1297 end = start;
1298 while((end < nsectors) &&
1299 (ubd_test_bit(sector + end, bitmap) == bit))
1300 end++;
1301 }
1350 1302
1351/* Changed in start_io_thread, which is serialized by being called only 1303 off = req->offsets[bit] + req->offset +
1352 * from ubd_init, which is an initcall. 1304 start * req->sectorsize;
1353 */ 1305 len = (end - start) * req->sectorsize;
1354int kernel_fd = -1; 1306 buf = &req->buffer[start * req->sectorsize];
1355 1307
1356/* Only changed by the io thread */ 1308 aio = kmalloc(sizeof(*aio), GFP_KERNEL);
1357int io_count = 0; 1309 if(aio == NULL){
1310 req->error = 1;
1311 return;
1312 }
1358 1313
1359int io_thread(void *arg) 1314 *aio = ((struct ubd_aio)
1360{ 1315 { .aio = INIT_AIO(req->op, req->fds[bit], buf,
1361 struct io_thread_req req; 1316 len, off, ubd_reply_fd),
1362 int n; 1317 .len = len,
1318 .req = r,
1319 .bitmap = bitmap_io,
1320 .bitmap_buf = bitmap_buf });
1321
1322 if(aio->bitmap != NULL)
1323 atomic_inc(&aio->bitmap->count);
1324
1325 err = submit_aio(&aio->aio);
1326 if(err){
1327 printk("do_io - submit_aio failed, "
1328 "err = %d\n", err);
1329 req->error = 1;
1330 return;
1331 }
1363 1332
1364 ignore_sigwinch_sig(); 1333 start = end;
1365 while(1){ 1334 } while(start < nsectors);
1366 n = os_read_file(kernel_fd, &req, sizeof(req));
1367 if(n != sizeof(req)){
1368 if(n < 0)
1369 printk("io_thread - read failed, fd = %d, "
1370 "err = %d\n", kernel_fd, -n);
1371 else {
1372 printk("io_thread - short read, fd = %d, "
1373 "length = %d\n", kernel_fd, n);
1374 }
1375 continue;
1376 }
1377 io_count++;
1378 do_io(&req);
1379 n = os_write_file(kernel_fd, &req, sizeof(req));
1380 if(n != sizeof(req))
1381 printk("io_thread - write failed, fd = %d, err = %d\n",
1382 kernel_fd, -n);
1383 }
1384} 1335}
1385
1386/*
1387 * Overrides for Emacs so that we follow Linus's tabbing style.
1388 * Emacs will notice this stuff at the end of the file and automatically
1389 * adjust the settings for this buffer only. This must remain at the end
1390 * of the file.
1391 * ---------------------------------------------------------------------------
1392 * Local variables:
1393 * c-file-style: "linux"
1394 * End:
1395 */
diff --git a/arch/um/include/aio.h b/arch/um/include/aio.h
new file mode 100644
index 000000000000..83f16877ab08
--- /dev/null
+++ b/arch/um/include/aio.h
@@ -0,0 +1,40 @@
1/*
2 * Copyright (C) 2004 Jeff Dike (jdike@karaya.com)
3 * Licensed under the GPL
4 */
5
6#ifndef AIO_H__
7#define AIO_H__
8
9enum aio_type { AIO_READ, AIO_WRITE, AIO_MMAP };
10
11struct aio_thread_reply {
12 void *data;
13 int err;
14};
15
16struct aio_context {
17 enum aio_type type;
18 int fd;
19 void *data;
20 int len;
21 unsigned long long offset;
22 int reply_fd;
23 struct aio_context *next;
24};
25
26#define INIT_AIO(aio_type, aio_fd, aio_data, aio_len, aio_offset, \
27 aio_reply_fd) \
28 { .type = aio_type, \
29 .fd = aio_fd, \
30 .data = aio_data, \
31 .len = aio_len, \
32 .offset = aio_offset, \
33 .reply_fd = aio_reply_fd }
34
35#define INIT_AIO_CONTEXT { .reply_fd = -1, \
36 .next = NULL }
37
38extern int submit_aio(struct aio_context *aio);
39
40#endif
diff --git a/arch/um/include/init.h b/arch/um/include/init.h
index 55c2693f8778..cbd79a8d213d 100644
--- a/arch/um/include/init.h
+++ b/arch/um/include/init.h
@@ -111,7 +111,15 @@ extern struct uml_param __uml_setup_start, __uml_setup_end;
111 111
112#ifndef __KERNEL__ 112#ifndef __KERNEL__
113 113
114#define __initcall(fn) static initcall_t __initcall_##fn __init_call = fn 114#define __define_initcall(level,fn) \
115 static initcall_t __initcall_##fn __attribute_used__ \
116 __attribute__((__section__(".initcall" level ".init"))) = fn
117
118/* Userspace initcalls shouldn't depend on anything in the kernel, so we'll
119 * make them run first.
120 */
121#define __initcall(fn) __define_initcall("1", fn)
122
115#define __exitcall(fn) static exitcall_t __exitcall_##fn __exit_call = fn 123#define __exitcall(fn) static exitcall_t __exitcall_##fn __exit_call = fn
116 124
117#define __init_call __attribute__ ((unused,__section__ (".initcall.init"))) 125#define __init_call __attribute__ ((unused,__section__ (".initcall.init")))
diff --git a/arch/um/include/irq_kern.h b/arch/um/include/irq_kern.h
index 3af52a634c4c..c222d56b1494 100644
--- a/arch/um/include/irq_kern.h
+++ b/arch/um/include/irq_kern.h
@@ -7,12 +7,15 @@
7#define __IRQ_KERN_H__ 7#define __IRQ_KERN_H__
8 8
9#include "linux/interrupt.h" 9#include "linux/interrupt.h"
10#include "asm/ptrace.h"
10 11
11extern int um_request_irq(unsigned int irq, int fd, int type, 12extern int um_request_irq(unsigned int irq, int fd, int type,
12 irqreturn_t (*handler)(int, void *, 13 irqreturn_t (*handler)(int, void *,
13 struct pt_regs *), 14 struct pt_regs *),
14 unsigned long irqflags, const char * devname, 15 unsigned long irqflags, const char * devname,
15 void *dev_id); 16 void *dev_id);
17extern int init_aio_irq(int irq, char *name,
18 irqreturn_t (*handler)(int, void *, struct pt_regs *));
16 19
17#endif 20#endif
18 21
diff --git a/arch/um/include/os.h b/arch/um/include/os.h
index 881d2988d2d8..4c362458052c 100644
--- a/arch/um/include/os.h
+++ b/arch/um/include/os.h
@@ -153,6 +153,11 @@ extern int os_file_type(char *file);
153extern int os_file_mode(char *file, struct openflags *mode_out); 153extern int os_file_mode(char *file, struct openflags *mode_out);
154extern int os_lock_file(int fd, int excl); 154extern int os_lock_file(int fd, int excl);
155 155
156/* start_up.c */
157extern void os_early_checks(void);
158extern int can_do_skas(void);
159
160/* process.c */
156extern unsigned long os_process_pc(int pid); 161extern unsigned long os_process_pc(int pid);
157extern int os_process_parent(int pid); 162extern int os_process_parent(int pid);
158extern void os_stop_process(int pid); 163extern void os_stop_process(int pid);
@@ -161,6 +166,9 @@ extern void os_kill_ptraced_process(int pid, int reap_child);
161extern void os_usr1_process(int pid); 166extern void os_usr1_process(int pid);
162extern int os_getpid(void); 167extern int os_getpid(void);
163extern int os_getpgrp(void); 168extern int os_getpgrp(void);
169extern void init_new_thread_stack(void *sig_stack, void (*usr1_handler)(int));
170extern void init_new_thread_signals(int altstack);
171extern int run_kernel_thread(int (*fn)(void *), void *arg, void **jmp_ptr);
164 172
165extern int os_map_memory(void *virt, int fd, unsigned long long off, 173extern int os_map_memory(void *virt, int fd, unsigned long long off,
166 unsigned long len, int r, int w, int x); 174 unsigned long len, int r, int w, int x);
@@ -170,6 +178,13 @@ extern int os_unmap_memory(void *addr, int len);
170extern void os_flush_stdout(void); 178extern void os_flush_stdout(void);
171extern unsigned long long os_usecs(void); 179extern unsigned long long os_usecs(void);
172 180
181/* tt.c
182 * for tt mode only (will be deleted in future...)
183 */
184extern void forward_pending_sigio(int target);
185extern int start_fork_tramp(void *arg, unsigned long temp_stack,
186 int clone_flags, int (*tramp)(void *));
187
173#endif 188#endif
174 189
175/* 190/*
diff --git a/arch/um/include/syscall.h b/arch/um/include/syscall.h
new file mode 100644
index 000000000000..dda1df901a08
--- /dev/null
+++ b/arch/um/include/syscall.h
@@ -0,0 +1,12 @@
1/*
2 * Copyright (C) 2002 Jeff Dike (jdike@karaya.com)
3 * Licensed under the GPL
4 */
5
6#ifndef __SYSCALL_USER_H
7#define __SYSCALL_USER_H
8
9extern int record_syscall_start(int syscall);
10extern void record_syscall_end(int index, long result);
11
12#endif
diff --git a/arch/um/include/syscall_user.h b/arch/um/include/syscall_user.h
deleted file mode 100644
index 811d0ec2445e..000000000000
--- a/arch/um/include/syscall_user.h
+++ /dev/null
@@ -1,23 +0,0 @@
1/*
2 * Copyright (C) 2002 Jeff Dike (jdike@karaya.com)
3 * Licensed under the GPL
4 */
5
6#ifndef __SYSCALL_USER_H
7#define __SYSCALL_USER_H
8
9extern int record_syscall_start(int syscall);
10extern void record_syscall_end(int index, long result);
11
12#endif
13
14/*
15 * Overrides for Emacs so that we follow Linus's tabbing style.
16 * Emacs will notice this stuff at the end of the file and automatically
17 * adjust the settings for this buffer only. This must remain at the end
18 * of the file.
19 * ---------------------------------------------------------------------------
20 * Local variables:
21 * c-file-style: "linux"
22 * End:
23 */
diff --git a/arch/um/include/sysdep-i386/syscalls.h b/arch/um/include/sysdep-i386/syscalls.h
index be0a3e3469eb..a0d5b74d3731 100644
--- a/arch/um/include/sysdep-i386/syscalls.h
+++ b/arch/um/include/sysdep-i386/syscalls.h
@@ -16,6 +16,8 @@ extern syscall_handler_t sys_rt_sigaction;
16 16
17extern syscall_handler_t old_mmap_i386; 17extern syscall_handler_t old_mmap_i386;
18 18
19extern syscall_handler_t *sys_call_table[];
20
19#define EXECUTE_SYSCALL(syscall, regs) \ 21#define EXECUTE_SYSCALL(syscall, regs) \
20 ((long (*)(struct syscall_args)) (*sys_call_table[syscall]))(SYSCALL_ARGS(&regs->regs)) 22 ((long (*)(struct syscall_args)) (*sys_call_table[syscall]))(SYSCALL_ARGS(&regs->regs))
21 23
diff --git a/arch/um/include/sysdep-x86_64/ptrace.h b/arch/um/include/sysdep-x86_64/ptrace.h
index be8acd5efd97..331aa2d1f3f5 100644
--- a/arch/um/include/sysdep-x86_64/ptrace.h
+++ b/arch/um/include/sysdep-x86_64/ptrace.h
@@ -227,7 +227,7 @@ struct syscall_args {
227 panic("Bad register in UPT_SET : %d\n", reg); \ 227 panic("Bad register in UPT_SET : %d\n", reg); \
228 break; \ 228 break; \
229 } \ 229 } \
230 val; \ 230 __upt_val; \
231 }) 231 })
232 232
233#define UPT_SET_SYSCALL_RETURN(r, res) \ 233#define UPT_SET_SYSCALL_RETURN(r, res) \
diff --git a/arch/um/include/sysdep-x86_64/syscalls.h b/arch/um/include/sysdep-x86_64/syscalls.h
index 67923cca5691..e06f83e80f4a 100644
--- a/arch/um/include/sysdep-x86_64/syscalls.h
+++ b/arch/um/include/sysdep-x86_64/syscalls.h
@@ -14,6 +14,8 @@ typedef long syscall_handler_t(void);
14 14
15extern syscall_handler_t *ia32_sys_call_table[]; 15extern syscall_handler_t *ia32_sys_call_table[];
16 16
17extern syscall_handler_t *sys_call_table[];
18
17#define EXECUTE_SYSCALL(syscall, regs) \ 19#define EXECUTE_SYSCALL(syscall, regs) \
18 (((long (*)(long, long, long, long, long, long)) \ 20 (((long (*)(long, long, long, long, long, long)) \
19 (*sys_call_table[syscall]))(UPT_SYSCALL_ARG1(&regs->regs), \ 21 (*sys_call_table[syscall]))(UPT_SYSCALL_ARG1(&regs->regs), \
diff --git a/arch/um/include/tlb.h b/arch/um/include/tlb.h
index c6f9628f39bf..45d7da6c3b2c 100644
--- a/arch/um/include/tlb.h
+++ b/arch/um/include/tlb.h
@@ -9,7 +9,7 @@
9#include "um_mmu.h" 9#include "um_mmu.h"
10 10
11struct host_vm_op { 11struct host_vm_op {
12 enum { MMAP, MUNMAP, MPROTECT } type; 12 enum { NONE, MMAP, MUNMAP, MPROTECT } type;
13 union { 13 union {
14 struct { 14 struct {
15 unsigned long addr; 15 unsigned long addr;
@@ -38,24 +38,10 @@ extern void mprotect_kernel_vm(int w);
38extern void force_flush_all(void); 38extern void force_flush_all(void);
39extern void fix_range_common(struct mm_struct *mm, unsigned long start_addr, 39extern void fix_range_common(struct mm_struct *mm, unsigned long start_addr,
40 unsigned long end_addr, int force, 40 unsigned long end_addr, int force,
41 void (*do_ops)(union mm_context *, 41 int (*do_ops)(union mm_context *,
42 struct host_vm_op *, int)); 42 struct host_vm_op *, int, int,
43 void **));
43extern int flush_tlb_kernel_range_common(unsigned long start, 44extern int flush_tlb_kernel_range_common(unsigned long start,
44 unsigned long end); 45 unsigned long end);
45 46
46extern int add_mmap(unsigned long virt, unsigned long phys, unsigned long len,
47 int r, int w, int x, struct host_vm_op *ops, int index,
48 int last_filled, union mm_context *mmu,
49 void (*do_ops)(union mm_context *, struct host_vm_op *,
50 int));
51extern int add_munmap(unsigned long addr, unsigned long len,
52 struct host_vm_op *ops, int index, int last_filled,
53 union mm_context *mmu,
54 void (*do_ops)(union mm_context *, struct host_vm_op *,
55 int));
56extern int add_mprotect(unsigned long addr, unsigned long len, int r, int w,
57 int x, struct host_vm_op *ops, int index,
58 int last_filled, union mm_context *mmu,
59 void (*do_ops)(union mm_context *, struct host_vm_op *,
60 int));
61#endif 47#endif
diff --git a/arch/um/include/user_util.h b/arch/um/include/user_util.h
index 7b6a24dfd302..bb505e01d994 100644
--- a/arch/um/include/user_util.h
+++ b/arch/um/include/user_util.h
@@ -54,8 +54,6 @@ extern void stack_protections(unsigned long address);
54extern void task_protections(unsigned long address); 54extern void task_protections(unsigned long address);
55extern int wait_for_stop(int pid, int sig, int cont_type, void *relay); 55extern int wait_for_stop(int pid, int sig, int cont_type, void *relay);
56extern void *add_signal_handler(int sig, void (*handler)(int)); 56extern void *add_signal_handler(int sig, void (*handler)(int));
57extern int start_fork_tramp(void *arg, unsigned long temp_stack,
58 int clone_flags, int (*tramp)(void *));
59extern int linux_main(int argc, char **argv); 57extern int linux_main(int argc, char **argv);
60extern void set_cmdline(char *cmd); 58extern void set_cmdline(char *cmd);
61extern void input_cb(void (*proc)(void *), void *arg, int arg_len); 59extern void input_cb(void (*proc)(void *), void *arg, int arg_len);
@@ -64,8 +62,6 @@ extern void *um_kmalloc(int size);
64extern int switcheroo(int fd, int prot, void *from, void *to, int size); 62extern int switcheroo(int fd, int prot, void *from, void *to, int size);
65extern void setup_machinename(char *machine_out); 63extern void setup_machinename(char *machine_out);
66extern void setup_hostinfo(void); 64extern void setup_hostinfo(void);
67extern void init_new_thread_stack(void *sig_stack, void (*usr1_handler)(int));
68extern void init_new_thread_signals(int altstack);
69extern void do_exec(int old_pid, int new_pid); 65extern void do_exec(int old_pid, int new_pid);
70extern void tracer_panic(char *msg, ...); 66extern void tracer_panic(char *msg, ...);
71extern char *get_umid(int only_if_set); 67extern char *get_umid(int only_if_set);
@@ -74,16 +70,12 @@ extern int detach(int pid, int sig);
74extern int attach(int pid); 70extern int attach(int pid);
75extern void kill_child_dead(int pid); 71extern void kill_child_dead(int pid);
76extern int cont(int pid); 72extern int cont(int pid);
77extern void check_ptrace(void);
78extern void check_sigio(void); 73extern void check_sigio(void);
79extern int run_kernel_thread(int (*fn)(void *), void *arg, void **jmp_ptr);
80extern void write_sigio_workaround(void); 74extern void write_sigio_workaround(void);
81extern void arch_check_bugs(void); 75extern void arch_check_bugs(void);
82extern int cpu_feature(char *what, char *buf, int len); 76extern int cpu_feature(char *what, char *buf, int len);
83extern int arch_handle_signal(int sig, union uml_pt_regs *regs); 77extern int arch_handle_signal(int sig, union uml_pt_regs *regs);
84extern int arch_fixup(unsigned long address, void *sc_ptr); 78extern int arch_fixup(unsigned long address, void *sc_ptr);
85extern void forward_pending_sigio(int target);
86extern int can_do_skas(void);
87extern void arch_init_thread(void); 79extern void arch_init_thread(void);
88extern int setjmp_wrapper(void (*proc)(void *, void *), ...); 80extern int setjmp_wrapper(void (*proc)(void *, void *), ...);
89extern int raw(int fd); 81extern int raw(int fd);
diff --git a/arch/um/kernel/Makefile b/arch/um/kernel/Makefile
index a8918e80df96..614b8ebeb0ed 100644
--- a/arch/um/kernel/Makefile
+++ b/arch/um/kernel/Makefile
@@ -8,25 +8,24 @@ clean-files :=
8 8
9obj-y = config.o exec_kern.o exitcode.o \ 9obj-y = config.o exec_kern.o exitcode.o \
10 helper.o init_task.o irq.o irq_user.o ksyms.o main.o mem.o mem_user.o \ 10 helper.o init_task.o irq.o irq_user.o ksyms.o main.o mem.o mem_user.o \
11 physmem.o process.o process_kern.o ptrace.o reboot.o resource.o \ 11 physmem.o process_kern.o ptrace.o reboot.o resource.o sigio_user.o \
12 sigio_user.o sigio_kern.o signal_kern.o signal_user.o smp.o \ 12 sigio_kern.o signal_kern.o signal_user.o smp.o syscall_kern.o sysrq.o \
13 syscall_kern.o sysrq.o tempfile.o time.o time_kern.o \ 13 tempfile.o time.o time_kern.o tlb.o trap_kern.o trap_user.o \
14 tlb.o trap_kern.o trap_user.o uaccess_user.o um_arch.o umid.o \ 14 uaccess_user.o um_arch.o umid.o user_util.o
15 user_util.o
16 15
17obj-$(CONFIG_BLK_DEV_INITRD) += initrd.o 16obj-$(CONFIG_BLK_DEV_INITRD) += initrd.o
18obj-$(CONFIG_GPROF) += gprof_syms.o 17obj-$(CONFIG_GPROF) += gprof_syms.o
19obj-$(CONFIG_GCOV) += gmon_syms.o 18obj-$(CONFIG_GCOV) += gmon_syms.o
20obj-$(CONFIG_TTY_LOG) += tty_log.o 19obj-$(CONFIG_TTY_LOG) += tty_log.o
21obj-$(CONFIG_SYSCALL_DEBUG) += syscall_user.o 20obj-$(CONFIG_SYSCALL_DEBUG) += syscall.o
22 21
23obj-$(CONFIG_MODE_TT) += tt/ 22obj-$(CONFIG_MODE_TT) += tt/
24obj-$(CONFIG_MODE_SKAS) += skas/ 23obj-$(CONFIG_MODE_SKAS) += skas/
25 24
26user-objs-$(CONFIG_TTY_LOG) += tty_log.o 25user-objs-$(CONFIG_TTY_LOG) += tty_log.o
27 26
28USER_OBJS := $(user-objs-y) config.o helper.o main.o process.o tempfile.o \ 27USER_OBJS := $(user-objs-y) config.o helper.o main.o tempfile.o time.o \
29 time.o tty_log.o umid.o user_util.o 28 tty_log.o umid.o user_util.o
30 29
31include arch/um/scripts/Makefile.rules 30include arch/um/scripts/Makefile.rules
32 31
diff --git a/arch/um/kernel/exitcode.c b/arch/um/kernel/exitcode.c
index 0ea87f24b36f..d21ebad666b4 100644
--- a/arch/um/kernel/exitcode.c
+++ b/arch/um/kernel/exitcode.c
@@ -48,7 +48,7 @@ static int make_proc_exitcode(void)
48 48
49 ent = create_proc_entry("exitcode", 0600, &proc_root); 49 ent = create_proc_entry("exitcode", 0600, &proc_root);
50 if(ent == NULL){ 50 if(ent == NULL){
51 printk("make_proc_exitcode : Failed to register " 51 printk(KERN_WARNING "make_proc_exitcode : Failed to register "
52 "/proc/exitcode\n"); 52 "/proc/exitcode\n");
53 return(0); 53 return(0);
54 } 54 }
diff --git a/arch/um/kernel/helper.c b/arch/um/kernel/helper.c
index 13b1f5c2f7ee..f83e1e8e2392 100644
--- a/arch/um/kernel/helper.c
+++ b/arch/um/kernel/helper.c
@@ -13,6 +13,7 @@
13#include "user.h" 13#include "user.h"
14#include "kern_util.h" 14#include "kern_util.h"
15#include "user_util.h" 15#include "user_util.h"
16#include "helper.h"
16#include "os.h" 17#include "os.h"
17 18
18struct helper_data { 19struct helper_data {
@@ -149,7 +150,7 @@ int run_helper_thread(int (*proc)(void *), void *arg, unsigned int flags,
149 return(pid); 150 return(pid);
150} 151}
151 152
152int helper_wait(int pid, int block) 153int helper_wait(int pid)
153{ 154{
154 int ret; 155 int ret;
155 156
@@ -160,14 +161,3 @@ int helper_wait(int pid, int block)
160 } 161 }
161 return(ret); 162 return(ret);
162} 163}
163
164/*
165 * Overrides for Emacs so that we follow Linus's tabbing style.
166 * Emacs will notice this stuff at the end of the file and automatically
167 * adjust the settings for this buffer only. This must remain at the end
168 * of the file.
169 * ---------------------------------------------------------------------------
170 * Local variables:
171 * c-file-style: "linux"
172 * End:
173 */
diff --git a/arch/um/kernel/irq.c b/arch/um/kernel/irq.c
index 9f18061ef4c9..dcd814971995 100644
--- a/arch/um/kernel/irq.c
+++ b/arch/um/kernel/irq.c
@@ -31,7 +31,7 @@
31#include "kern_util.h" 31#include "kern_util.h"
32#include "irq_user.h" 32#include "irq_user.h"
33#include "irq_kern.h" 33#include "irq_kern.h"
34 34#include "os.h"
35 35
36/* 36/*
37 * Generic, controller-independent functions: 37 * Generic, controller-independent functions:
@@ -168,13 +168,32 @@ void __init init_IRQ(void)
168 } 168 }
169} 169}
170 170
171/* 171int init_aio_irq(int irq, char *name, irqreturn_t (*handler)(int, void *,
172 * Overrides for Emacs so that we follow Linus's tabbing style. 172 struct pt_regs *))
173 * Emacs will notice this stuff at the end of the file and automatically 173{
174 * adjust the settings for this buffer only. This must remain at the end 174 int fds[2], err;
175 * of the file. 175
176 * --------------------------------------------------------------------------- 176 err = os_pipe(fds, 1, 1);
177 * Local variables: 177 if(err){
178 * c-file-style: "linux" 178 printk("init_aio_irq - os_pipe failed, err = %d\n", -err);
179 * End: 179 goto out;
180 */ 180 }
181
182 err = um_request_irq(irq, fds[0], IRQ_READ, handler,
183 SA_INTERRUPT | SA_SAMPLE_RANDOM, name,
184 (void *) (long) fds[0]);
185 if(err){
186 printk("init_aio_irq - : um_request_irq failed, err = %d\n",
187 err);
188 goto out_close;
189 }
190
191 err = fds[1];
192 goto out;
193
194 out_close:
195 os_close_file(fds[0]);
196 os_close_file(fds[1]);
197 out:
198 return(err);
199}
diff --git a/arch/um/kernel/ksyms.c b/arch/um/kernel/ksyms.c
index 99439fa15ef4..32d3076dd220 100644
--- a/arch/um/kernel/ksyms.c
+++ b/arch/um/kernel/ksyms.c
@@ -114,22 +114,3 @@ extern void FASTCALL( __read_lock_failed(rwlock_t *rw));
114EXPORT_SYMBOL(__read_lock_failed); 114EXPORT_SYMBOL(__read_lock_failed);
115 115
116#endif 116#endif
117
118#ifdef CONFIG_HIGHMEM
119EXPORT_SYMBOL(kmap);
120EXPORT_SYMBOL(kunmap);
121EXPORT_SYMBOL(kmap_atomic);
122EXPORT_SYMBOL(kunmap_atomic);
123EXPORT_SYMBOL(kmap_atomic_to_page);
124#endif
125
126/*
127 * Overrides for Emacs so that we follow Linus's tabbing style.
128 * Emacs will notice this stuff at the end of the file and automatically
129 * adjust the settings for this buffer only. This must remain at the end
130 * of the file.
131 * ---------------------------------------------------------------------------
132 * Local variables:
133 * c-file-style: "linux"
134 * End:
135 */
diff --git a/arch/um/kernel/main.c b/arch/um/kernel/main.c
index 1e1a87f1c510..d31027f0fe39 100644
--- a/arch/um/kernel/main.c
+++ b/arch/um/kernel/main.c
@@ -97,7 +97,7 @@ int main(int argc, char **argv, char **envp)
97 exit(1); 97 exit(1);
98 } 98 }
99 99
100#ifdef UML_CONFIG_MODE_TT 100#ifdef UML_CONFIG_CMDLINE_ON_HOST
101 /* Allocate memory for thread command lines */ 101 /* Allocate memory for thread command lines */
102 if(argc < 2 || strlen(argv[1]) < THREAD_NAME_LEN - 1){ 102 if(argc < 2 || strlen(argv[1]) < THREAD_NAME_LEN - 1){
103 103
diff --git a/arch/um/kernel/process_kern.c b/arch/um/kernel/process_kern.c
index d4036ed680bc..c23d8a08d0ff 100644
--- a/arch/um/kernel/process_kern.c
+++ b/arch/um/kernel/process_kern.c
@@ -412,7 +412,7 @@ int __init make_proc_sysemu(void)
412 412
413 if (ent == NULL) 413 if (ent == NULL)
414 { 414 {
415 printk("Failed to register /proc/sysemu\n"); 415 printk(KERN_WARNING "Failed to register /proc/sysemu\n");
416 return(0); 416 return(0);
417 } 417 }
418 418
diff --git a/arch/um/kernel/reboot.c b/arch/um/kernel/reboot.c
index fcec51da1d37..a637e885c583 100644
--- a/arch/um/kernel/reboot.c
+++ b/arch/um/kernel/reboot.c
@@ -49,23 +49,17 @@ void machine_restart(char * __unused)
49 CHOOSE_MODE(reboot_tt(), reboot_skas()); 49 CHOOSE_MODE(reboot_tt(), reboot_skas());
50} 50}
51 51
52EXPORT_SYMBOL(machine_restart);
53
54void machine_power_off(void) 52void machine_power_off(void)
55{ 53{
56 uml_cleanup(); 54 uml_cleanup();
57 CHOOSE_MODE(halt_tt(), halt_skas()); 55 CHOOSE_MODE(halt_tt(), halt_skas());
58} 56}
59 57
60EXPORT_SYMBOL(machine_power_off);
61
62void machine_halt(void) 58void machine_halt(void)
63{ 59{
64 machine_power_off(); 60 machine_power_off();
65} 61}
66 62
67EXPORT_SYMBOL(machine_halt);
68
69/* 63/*
70 * Overrides for Emacs so that we follow Linus's tabbing style. 64 * Overrides for Emacs so that we follow Linus's tabbing style.
71 * Emacs will notice this stuff at the end of the file and automatically 65 * Emacs will notice this stuff at the end of the file and automatically
diff --git a/arch/um/kernel/signal_kern.c b/arch/um/kernel/signal_kern.c
index 7807a3e8c426..03618bd13d55 100644
--- a/arch/um/kernel/signal_kern.c
+++ b/arch/um/kernel/signal_kern.c
@@ -87,12 +87,12 @@ static int handle_signal(struct pt_regs *regs, unsigned long signr,
87 recalc_sigpending(); 87 recalc_sigpending();
88 spin_unlock_irq(&current->sighand->siglock); 88 spin_unlock_irq(&current->sighand->siglock);
89 force_sigsegv(signr, current); 89 force_sigsegv(signr, current);
90 } 90 } else {
91 else if(!(ka->sa.sa_flags & SA_NODEFER)){
92 spin_lock_irq(&current->sighand->siglock); 91 spin_lock_irq(&current->sighand->siglock);
93 sigorsets(&current->blocked, &current->blocked, 92 sigorsets(&current->blocked, &current->blocked,
94 &ka->sa.sa_mask); 93 &ka->sa.sa_mask);
95 sigaddset(&current->blocked, signr); 94 if(!(ka->sa.sa_flags & SA_NODEFER))
95 sigaddset(&current->blocked, signr);
96 recalc_sigpending(); 96 recalc_sigpending();
97 spin_unlock_irq(&current->sighand->siglock); 97 spin_unlock_irq(&current->sighand->siglock);
98 } 98 }
diff --git a/arch/um/kernel/skas/Makefile b/arch/um/kernel/skas/Makefile
index d296d55ade4b..db36c7c95940 100644
--- a/arch/um/kernel/skas/Makefile
+++ b/arch/um/kernel/skas/Makefile
@@ -4,7 +4,7 @@
4# 4#
5 5
6obj-y := clone.o exec_kern.o mem.o mem_user.o mmu.o process.o process_kern.o \ 6obj-y := clone.o exec_kern.o mem.o mem_user.o mmu.o process.o process_kern.o \
7 syscall_kern.o syscall_user.o tlb.o trap_user.o uaccess.o \ 7 syscall.o tlb.o trap_user.o uaccess.o
8 8
9subdir- := util 9subdir- := util
10 10
diff --git a/arch/um/kernel/skas/include/mmu-skas.h b/arch/um/kernel/skas/include/mmu-skas.h
index 278b72f1d9ad..09536f81ee42 100644
--- a/arch/um/kernel/skas/include/mmu-skas.h
+++ b/arch/um/kernel/skas/include/mmu-skas.h
@@ -6,11 +6,15 @@
6#ifndef __SKAS_MMU_H 6#ifndef __SKAS_MMU_H
7#define __SKAS_MMU_H 7#define __SKAS_MMU_H
8 8
9#include "linux/config.h"
9#include "mm_id.h" 10#include "mm_id.h"
10 11
11struct mmu_context_skas { 12struct mmu_context_skas {
12 struct mm_id id; 13 struct mm_id id;
13 unsigned long last_page_table; 14 unsigned long last_page_table;
15#ifdef CONFIG_3_LEVEL_PGTABLES
16 unsigned long last_pmd;
17#endif
14}; 18};
15 19
16extern void switch_mm_skas(struct mm_id * mm_idp); 20extern void switch_mm_skas(struct mm_id * mm_idp);
diff --git a/arch/um/kernel/skas/include/skas.h b/arch/um/kernel/skas/include/skas.h
index d983ea842547..060934740f9f 100644
--- a/arch/um/kernel/skas/include/skas.h
+++ b/arch/um/kernel/skas/include/skas.h
@@ -24,28 +24,26 @@ extern void new_thread_proc(void *stack, void (*handler)(int sig));
24extern void remove_sigstack(void); 24extern void remove_sigstack(void);
25extern void new_thread_handler(int sig); 25extern void new_thread_handler(int sig);
26extern void handle_syscall(union uml_pt_regs *regs); 26extern void handle_syscall(union uml_pt_regs *regs);
27extern int map(struct mm_id * mm_idp, unsigned long virt, unsigned long len, 27extern int map(struct mm_id * mm_idp, unsigned long virt,
28 int r, int w, int x, int phys_fd, unsigned long long offset); 28 unsigned long len, int r, int w, int x, int phys_fd,
29extern int unmap(struct mm_id * mm_idp, void *addr, unsigned long len); 29 unsigned long long offset, int done, void **data);
30extern int unmap(struct mm_id * mm_idp, void *addr, unsigned long len,
31 int done, void **data);
30extern int protect(struct mm_id * mm_idp, unsigned long addr, 32extern int protect(struct mm_id * mm_idp, unsigned long addr,
31 unsigned long len, int r, int w, int x); 33 unsigned long len, int r, int w, int x, int done,
34 void **data);
32extern void user_signal(int sig, union uml_pt_regs *regs, int pid); 35extern void user_signal(int sig, union uml_pt_regs *regs, int pid);
33extern int new_mm(int from); 36extern int new_mm(int from, unsigned long stack);
34extern int start_userspace(unsigned long stub_stack); 37extern int start_userspace(unsigned long stub_stack);
35extern int copy_context_skas0(unsigned long stack, int pid); 38extern int copy_context_skas0(unsigned long stack, int pid);
36extern void get_skas_faultinfo(int pid, struct faultinfo * fi); 39extern void get_skas_faultinfo(int pid, struct faultinfo * fi);
37extern long execute_syscall_skas(void *r); 40extern long execute_syscall_skas(void *r);
38extern unsigned long current_stub_stack(void); 41extern unsigned long current_stub_stack(void);
42extern long run_syscall_stub(struct mm_id * mm_idp,
43 int syscall, unsigned long *args, long expected,
44 void **addr, int done);
45extern long syscall_stub_data(struct mm_id * mm_idp,
46 unsigned long *data, int data_count,
47 void **addr, void **stub_addr);
39 48
40#endif 49#endif
41
42/*
43 * Overrides for Emacs so that we follow Linus's tabbing style.
44 * Emacs will notice this stuff at the end of the file and automatically
45 * adjust the settings for this buffer only. This must remain at the end
46 * of the file.
47 * ---------------------------------------------------------------------------
48 * Local variables:
49 * c-file-style: "linux"
50 * End:
51 */
diff --git a/arch/um/kernel/skas/mem_user.c b/arch/um/kernel/skas/mem_user.c
index b0980ff3bd95..1d89640bd502 100644
--- a/arch/um/kernel/skas/mem_user.c
+++ b/arch/um/kernel/skas/mem_user.c
@@ -5,13 +5,14 @@
5 5
6#include <signal.h> 6#include <signal.h>
7#include <errno.h> 7#include <errno.h>
8#include <string.h>
8#include <sys/mman.h> 9#include <sys/mman.h>
9#include <sys/wait.h> 10#include <sys/wait.h>
10#include <asm/page.h> 11#include <asm/page.h>
11#include <asm/unistd.h> 12#include <asm/unistd.h>
12#include "mem_user.h" 13#include "mem_user.h"
13#include "mem.h" 14#include "mem.h"
14#include "mm_id.h" 15#include "skas.h"
15#include "user.h" 16#include "user.h"
16#include "os.h" 17#include "os.h"
17#include "proc_mm.h" 18#include "proc_mm.h"
@@ -23,46 +24,155 @@
23#include "uml-config.h" 24#include "uml-config.h"
24#include "sysdep/ptrace.h" 25#include "sysdep/ptrace.h"
25#include "sysdep/stub.h" 26#include "sysdep/stub.h"
26#include "skas.h"
27 27
28extern unsigned long syscall_stub, __syscall_stub_start; 28extern unsigned long batch_syscall_stub, __syscall_stub_start;
29 29
30extern void wait_stub_done(int pid, int sig, char * fname); 30extern void wait_stub_done(int pid, int sig, char * fname);
31 31
32static long run_syscall_stub(struct mm_id * mm_idp, int syscall, 32static inline unsigned long *check_init_stack(struct mm_id * mm_idp,
33 unsigned long *args) 33 unsigned long *stack)
34{
35 if(stack == NULL){
36 stack = (unsigned long *) mm_idp->stack + 2;
37 *stack = 0;
38 }
39 return stack;
40}
41
42extern int proc_mm;
43
44int single_count = 0;
45int multi_count = 0;
46int multi_op_count = 0;
47
48static long do_syscall_stub(struct mm_id *mm_idp, void **addr)
34{ 49{
50 unsigned long regs[MAX_REG_NR];
51 unsigned long *data;
52 unsigned long *syscall;
53 long ret, offset;
35 int n, pid = mm_idp->u.pid; 54 int n, pid = mm_idp->u.pid;
36 unsigned long regs[MAX_REG_NR]; 55
56 if(proc_mm)
57#warning Need to look up userspace_pid by cpu
58 pid = userspace_pid[0];
59
60 multi_count++;
37 61
38 get_safe_registers(regs); 62 get_safe_registers(regs);
39 regs[REGS_IP_INDEX] = UML_CONFIG_STUB_CODE + 63 regs[REGS_IP_INDEX] = UML_CONFIG_STUB_CODE +
40 ((unsigned long) &syscall_stub - 64 ((unsigned long) &batch_syscall_stub -
41 (unsigned long) &__syscall_stub_start); 65 (unsigned long) &__syscall_stub_start);
42 /* XXX Don't have a define for starting a syscall */ 66 n = ptrace_setregs(pid, regs);
43 regs[REGS_SYSCALL_NR] = syscall; 67 if(n < 0)
44 regs[REGS_SYSCALL_ARG1] = args[0]; 68 panic("do_syscall_stub : PTRACE_SETREGS failed, errno = %d\n",
45 regs[REGS_SYSCALL_ARG2] = args[1]; 69 n);
46 regs[REGS_SYSCALL_ARG3] = args[2]; 70
47 regs[REGS_SYSCALL_ARG4] = args[3]; 71 wait_stub_done(pid, 0, "do_syscall_stub");
48 regs[REGS_SYSCALL_ARG5] = args[4]; 72
49 regs[REGS_SYSCALL_ARG6] = args[5]; 73 /* When the stub stops, we find the following values on the
50 n = ptrace_setregs(pid, regs); 74 * beginning of the stack:
51 if(n < 0){ 75 * (long )return_value
52 printk("run_syscall_stub : PTRACE_SETREGS failed, " 76 * (long )offset to failed sycall-data (0, if no error)
53 "errno = %d\n", n); 77 */
54 return(n); 78 ret = *((unsigned long *) mm_idp->stack);
79 offset = *((unsigned long *) mm_idp->stack + 1);
80 if (offset) {
81 data = (unsigned long *)(mm_idp->stack +
82 offset - UML_CONFIG_STUB_DATA);
83 syscall = (unsigned long *)((unsigned long)data + data[0]);
84 printk("do_syscall_stub: syscall %ld failed, return value = "
85 "0x%lx, expected return value = 0x%lx\n",
86 syscall[0], ret, syscall[7]);
87 printk(" syscall parameters: "
88 "0x%lx 0x%lx 0x%lx 0x%lx 0x%lx 0x%lx\n",
89 syscall[1], syscall[2], syscall[3],
90 syscall[4], syscall[5], syscall[6]);
91 for(n = 1; n < data[0]/sizeof(long); n++) {
92 if(n == 1)
93 printk(" additional syscall data:");
94 if(n % 4 == 1)
95 printk("\n ");
96 printk(" 0x%lx", data[n]);
97 }
98 if(n > 1)
99 printk("\n");
100 }
101 else ret = 0;
102
103 *addr = check_init_stack(mm_idp, NULL);
104
105 return ret;
106}
107
108long run_syscall_stub(struct mm_id * mm_idp, int syscall,
109 unsigned long *args, long expected, void **addr,
110 int done)
111{
112 unsigned long *stack = check_init_stack(mm_idp, *addr);
113
114 if(done && *addr == NULL)
115 single_count++;
116
117 *stack += sizeof(long);
118 stack += *stack / sizeof(long);
119
120 *stack++ = syscall;
121 *stack++ = args[0];
122 *stack++ = args[1];
123 *stack++ = args[2];
124 *stack++ = args[3];
125 *stack++ = args[4];
126 *stack++ = args[5];
127 *stack++ = expected;
128 *stack = 0;
129 multi_op_count++;
130
131 if(!done && ((((unsigned long) stack) & ~PAGE_MASK) <
132 PAGE_SIZE - 10 * sizeof(long))){
133 *addr = stack;
134 return 0;
55 } 135 }
56 136
57 wait_stub_done(pid, 0, "run_syscall_stub"); 137 return do_syscall_stub(mm_idp, addr);
138}
139
140long syscall_stub_data(struct mm_id * mm_idp,
141 unsigned long *data, int data_count,
142 void **addr, void **stub_addr)
143{
144 unsigned long *stack;
145 int ret = 0;
58 146
59 return(*((unsigned long *) mm_idp->stack)); 147 /* If *addr still is uninitialized, it *must* contain NULL.
148 * Thus in this case do_syscall_stub correctly won't be called.
149 */
150 if((((unsigned long) *addr) & ~PAGE_MASK) >=
151 PAGE_SIZE - (10 + data_count) * sizeof(long)) {
152 ret = do_syscall_stub(mm_idp, addr);
153 /* in case of error, don't overwrite data on stack */
154 if(ret)
155 return ret;
156 }
157
158 stack = check_init_stack(mm_idp, *addr);
159 *addr = stack;
160
161 *stack = data_count * sizeof(long);
162
163 memcpy(stack + 1, data, data_count * sizeof(long));
164
165 *stub_addr = (void *)(((unsigned long)(stack + 1) & ~PAGE_MASK) +
166 UML_CONFIG_STUB_DATA);
167
168 return 0;
60} 169}
61 170
62int map(struct mm_id *mm_idp, unsigned long virt, unsigned long len, 171int map(struct mm_id * mm_idp, unsigned long virt, unsigned long len,
63 int r, int w, int x, int phys_fd, unsigned long long offset) 172 int r, int w, int x, int phys_fd, unsigned long long offset,
173 int done, void **data)
64{ 174{
65 int prot, n; 175 int prot, ret;
66 176
67 prot = (r ? PROT_READ : 0) | (w ? PROT_WRITE : 0) | 177 prot = (r ? PROT_READ : 0) | (w ? PROT_WRITE : 0) |
68 (x ? PROT_EXEC : 0); 178 (x ? PROT_EXEC : 0);
@@ -70,6 +180,7 @@ int map(struct mm_id *mm_idp, unsigned long virt, unsigned long len,
70 if(proc_mm){ 180 if(proc_mm){
71 struct proc_mm_op map; 181 struct proc_mm_op map;
72 int fd = mm_idp->u.mm_fd; 182 int fd = mm_idp->u.mm_fd;
183
73 map = ((struct proc_mm_op) { .op = MM_MMAP, 184 map = ((struct proc_mm_op) { .op = MM_MMAP,
74 .u = 185 .u =
75 { .mmap = 186 { .mmap =
@@ -81,63 +192,61 @@ int map(struct mm_id *mm_idp, unsigned long virt, unsigned long len,
81 .fd = phys_fd, 192 .fd = phys_fd,
82 .offset= offset 193 .offset= offset
83 } } } ); 194 } } } );
84 n = os_write_file(fd, &map, sizeof(map)); 195 ret = os_write_file(fd, &map, sizeof(map));
85 if(n != sizeof(map)) 196 if(ret != sizeof(map))
86 printk("map : /proc/mm map failed, err = %d\n", -n); 197 printk("map : /proc/mm map failed, err = %d\n", -ret);
198 else ret = 0;
87 } 199 }
88 else { 200 else {
89 long res;
90 unsigned long args[] = { virt, len, prot, 201 unsigned long args[] = { virt, len, prot,
91 MAP_SHARED | MAP_FIXED, phys_fd, 202 MAP_SHARED | MAP_FIXED, phys_fd,
92 MMAP_OFFSET(offset) }; 203 MMAP_OFFSET(offset) };
93 204
94 res = run_syscall_stub(mm_idp, STUB_MMAP_NR, args); 205 ret = run_syscall_stub(mm_idp, STUB_MMAP_NR, args, virt,
95 if((void *) res == MAP_FAILED) 206 data, done);
96 printk("mmap stub failed, errno = %d\n", res);
97 } 207 }
98 208
99 return 0; 209 return ret;
100} 210}
101 211
102int unmap(struct mm_id *mm_idp, void *addr, unsigned long len) 212int unmap(struct mm_id * mm_idp, void *addr, unsigned long len, int done,
213 void **data)
103{ 214{
104 int n; 215 int ret;
105 216
106 if(proc_mm){ 217 if(proc_mm){
107 struct proc_mm_op unmap; 218 struct proc_mm_op unmap;
108 int fd = mm_idp->u.mm_fd; 219 int fd = mm_idp->u.mm_fd;
220
109 unmap = ((struct proc_mm_op) { .op = MM_MUNMAP, 221 unmap = ((struct proc_mm_op) { .op = MM_MUNMAP,
110 .u = 222 .u =
111 { .munmap = 223 { .munmap =
112 { .addr = 224 { .addr =
113 (unsigned long) addr, 225 (unsigned long) addr,
114 .len = len } } } ); 226 .len = len } } } );
115 n = os_write_file(fd, &unmap, sizeof(unmap)); 227 ret = os_write_file(fd, &unmap, sizeof(unmap));
116 if(n != sizeof(unmap)) { 228 if(ret != sizeof(unmap))
117 if(n < 0) 229 printk("unmap - proc_mm write returned %d\n", ret);
118 return(n); 230 else ret = 0;
119 else if(n > 0)
120 return(-EIO);
121 }
122 } 231 }
123 else { 232 else {
124 int res;
125 unsigned long args[] = { (unsigned long) addr, len, 0, 0, 0, 233 unsigned long args[] = { (unsigned long) addr, len, 0, 0, 0,
126 0 }; 234 0 };
127 235
128 res = run_syscall_stub(mm_idp, __NR_munmap, args); 236 ret = run_syscall_stub(mm_idp, __NR_munmap, args, 0,
129 if(res < 0) 237 data, done);
130 printk("munmap stub failed, errno = %d\n", res); 238 if(ret < 0)
239 printk("munmap stub failed, errno = %d\n", ret);
131 } 240 }
132 241
133 return(0); 242 return ret;
134} 243}
135 244
136int protect(struct mm_id *mm_idp, unsigned long addr, unsigned long len, 245int protect(struct mm_id * mm_idp, unsigned long addr, unsigned long len,
137 int r, int w, int x) 246 int r, int w, int x, int done, void **data)
138{ 247{
139 struct proc_mm_op protect; 248 struct proc_mm_op protect;
140 int prot, n; 249 int prot, ret;
141 250
142 prot = (r ? PROT_READ : 0) | (w ? PROT_WRITE : 0) | 251 prot = (r ? PROT_READ : 0) | (w ? PROT_WRITE : 0) |
143 (x ? PROT_EXEC : 0); 252 (x ? PROT_EXEC : 0);
@@ -152,20 +261,19 @@ int protect(struct mm_id *mm_idp, unsigned long addr, unsigned long len,
152 .len = len, 261 .len = len,
153 .prot = prot } } } ); 262 .prot = prot } } } );
154 263
155 n = os_write_file(fd, &protect, sizeof(protect)); 264 ret = os_write_file(fd, &protect, sizeof(protect));
156 if(n != sizeof(protect)) 265 if(ret != sizeof(protect))
157 panic("protect failed, err = %d", -n); 266 printk("protect failed, err = %d", -ret);
267 else ret = 0;
158 } 268 }
159 else { 269 else {
160 int res;
161 unsigned long args[] = { addr, len, prot, 0, 0, 0 }; 270 unsigned long args[] = { addr, len, prot, 0, 0, 0 };
162 271
163 res = run_syscall_stub(mm_idp, __NR_mprotect, args); 272 ret = run_syscall_stub(mm_idp, __NR_mprotect, args, 0,
164 if(res < 0) 273 data, done);
165 panic("mprotect stub failed, errno = %d\n", res);
166 } 274 }
167 275
168 return(0); 276 return ret;
169} 277}
170 278
171void before_mem_skas(unsigned long unused) 279void before_mem_skas(unsigned long unused)
diff --git a/arch/um/kernel/skas/mmu.c b/arch/um/kernel/skas/mmu.c
index d232daa42c31..240143b616a2 100644
--- a/arch/um/kernel/skas/mmu.c
+++ b/arch/um/kernel/skas/mmu.c
@@ -56,6 +56,9 @@ static int init_stub_pte(struct mm_struct *mm, unsigned long proc,
56 */ 56 */
57 57
58 mm->context.skas.last_page_table = pmd_page_kernel(*pmd); 58 mm->context.skas.last_page_table = pmd_page_kernel(*pmd);
59#ifdef CONFIG_3_LEVEL_PGTABLES
60 mm->context.skas.last_pmd = (unsigned long) __va(pud_val(*pud));
61#endif
59 62
60 *pte = mk_pte(virt_to_page(kernel), __pgprot(_PAGE_PRESENT)); 63 *pte = mk_pte(virt_to_page(kernel), __pgprot(_PAGE_PRESENT));
61 *pte = pte_mkexec(*pte); 64 *pte = pte_mkexec(*pte);
@@ -77,23 +80,14 @@ int init_new_context_skas(struct task_struct *task, struct mm_struct *mm)
77 struct mm_struct *cur_mm = current->mm; 80 struct mm_struct *cur_mm = current->mm;
78 struct mm_id *cur_mm_id = &cur_mm->context.skas.id; 81 struct mm_id *cur_mm_id = &cur_mm->context.skas.id;
79 struct mm_id *mm_id = &mm->context.skas.id; 82 struct mm_id *mm_id = &mm->context.skas.id;
80 unsigned long stack; 83 unsigned long stack = 0;
81 int from, ret; 84 int from, ret = -ENOMEM;
82 85
83 if(proc_mm){ 86 if(!proc_mm || !ptrace_faultinfo){
84 if((cur_mm != NULL) && (cur_mm != &init_mm)) 87 stack = get_zeroed_page(GFP_KERNEL);
85 from = cur_mm->context.skas.id.u.mm_fd; 88 if(stack == 0)
86 else from = -1; 89 goto out;
87 90
88 ret = new_mm(from);
89 if(ret < 0){
90 printk("init_new_context_skas - new_mm failed, "
91 "errno = %d\n", ret);
92 return ret;
93 }
94 mm_id->u.mm_fd = ret;
95 }
96 else {
97 /* This zeros the entry that pgd_alloc didn't, needed since 91 /* This zeros the entry that pgd_alloc didn't, needed since
98 * we are about to reinitialize it, and want mm.nr_ptes to 92 * we are about to reinitialize it, and want mm.nr_ptes to
99 * be accurate. 93 * be accurate.
@@ -103,20 +97,30 @@ int init_new_context_skas(struct task_struct *task, struct mm_struct *mm)
103 ret = init_stub_pte(mm, CONFIG_STUB_CODE, 97 ret = init_stub_pte(mm, CONFIG_STUB_CODE,
104 (unsigned long) &__syscall_stub_start); 98 (unsigned long) &__syscall_stub_start);
105 if(ret) 99 if(ret)
106 goto out; 100 goto out_free;
107
108 ret = -ENOMEM;
109 stack = get_zeroed_page(GFP_KERNEL);
110 if(stack == 0)
111 goto out;
112 mm_id->stack = stack;
113 101
114 ret = init_stub_pte(mm, CONFIG_STUB_DATA, stack); 102 ret = init_stub_pte(mm, CONFIG_STUB_DATA, stack);
115 if(ret) 103 if(ret)
116 goto out_free; 104 goto out_free;
117 105
118 mm->nr_ptes--; 106 mm->nr_ptes--;
107 }
108 mm_id->stack = stack;
119 109
110 if(proc_mm){
111 if((cur_mm != NULL) && (cur_mm != &init_mm))
112 from = cur_mm_id->u.mm_fd;
113 else from = -1;
114
115 ret = new_mm(from, stack);
116 if(ret < 0){
117 printk("init_new_context_skas - new_mm failed, "
118 "errno = %d\n", ret);
119 goto out_free;
120 }
121 mm_id->u.mm_fd = ret;
122 }
123 else {
120 if((cur_mm != NULL) && (cur_mm != &init_mm)) 124 if((cur_mm != NULL) && (cur_mm != &init_mm))
121 mm_id->u.pid = copy_context_skas0(stack, 125 mm_id->u.pid = copy_context_skas0(stack,
122 cur_mm_id->u.pid); 126 cur_mm_id->u.pid);
@@ -126,7 +130,8 @@ int init_new_context_skas(struct task_struct *task, struct mm_struct *mm)
126 return 0; 130 return 0;
127 131
128 out_free: 132 out_free:
129 free_page(mm_id->stack); 133 if(mm_id->stack != 0)
134 free_page(mm_id->stack);
130 out: 135 out:
131 return ret; 136 return ret;
132} 137}
@@ -137,9 +142,15 @@ void destroy_context_skas(struct mm_struct *mm)
137 142
138 if(proc_mm) 143 if(proc_mm)
139 os_close_file(mmu->id.u.mm_fd); 144 os_close_file(mmu->id.u.mm_fd);
140 else { 145 else
141 os_kill_ptraced_process(mmu->id.u.pid, 1); 146 os_kill_ptraced_process(mmu->id.u.pid, 1);
147
148 if(!proc_mm || !ptrace_faultinfo){
142 free_page(mmu->id.stack); 149 free_page(mmu->id.stack);
143 free_page(mmu->last_page_table); 150 pte_free_kernel((pte_t *) mmu->last_page_table);
151 dec_page_state(nr_page_table_pages);
152#ifdef CONFIG_3_LEVEL_PGTABLES
153 pmd_free((pmd_t *) mmu->last_pmd);
154#endif
144 } 155 }
145} 156}
diff --git a/arch/um/kernel/skas/process.c b/arch/um/kernel/skas/process.c
index ba671dab8878..5cd0e9929789 100644
--- a/arch/um/kernel/skas/process.c
+++ b/arch/um/kernel/skas/process.c
@@ -61,10 +61,14 @@ void wait_stub_done(int pid, int sig, char * fname)
61 61
62 CATCH_EINTR(n = waitpid(pid, &status, WUNTRACED)); 62 CATCH_EINTR(n = waitpid(pid, &status, WUNTRACED));
63 } while((n >= 0) && WIFSTOPPED(status) && 63 } while((n >= 0) && WIFSTOPPED(status) &&
64 (WSTOPSIG(status) == SIGVTALRM)); 64 ((WSTOPSIG(status) == SIGVTALRM) ||
65 /* running UML inside a detached screen can cause
66 * SIGWINCHes
67 */
68 (WSTOPSIG(status) == SIGWINCH)));
65 69
66 if((n < 0) || !WIFSTOPPED(status) || 70 if((n < 0) || !WIFSTOPPED(status) ||
67 (WSTOPSIG(status) != SIGUSR1 && WSTOPSIG(status != SIGTRAP))){ 71 (WSTOPSIG(status) != SIGUSR1 && WSTOPSIG(status) != SIGTRAP)){
68 panic("%s : failed to wait for SIGUSR1/SIGTRAP, " 72 panic("%s : failed to wait for SIGUSR1/SIGTRAP, "
69 "pid = %d, n = %d, errno = %d, status = 0x%x\n", 73 "pid = %d, n = %d, errno = %d, status = 0x%x\n",
70 fname, pid, n, errno, status); 74 fname, pid, n, errno, status);
@@ -134,6 +138,8 @@ static void handle_trap(int pid, union uml_pt_regs *regs, int local_using_sysemu
134} 138}
135 139
136extern int __syscall_stub_start; 140extern int __syscall_stub_start;
141int stub_code_fd = -1;
142__u64 stub_code_offset;
137 143
138static int userspace_tramp(void *stack) 144static int userspace_tramp(void *stack)
139{ 145{
@@ -148,31 +154,31 @@ static int userspace_tramp(void *stack)
148 /* This has a pte, but it can't be mapped in with the usual 154 /* This has a pte, but it can't be mapped in with the usual
149 * tlb_flush mechanism because this is part of that mechanism 155 * tlb_flush mechanism because this is part of that mechanism
150 */ 156 */
151 int fd;
152 __u64 offset;
153
154 fd = phys_mapping(to_phys(&__syscall_stub_start), &offset);
155 addr = mmap64((void *) UML_CONFIG_STUB_CODE, page_size(), 157 addr = mmap64((void *) UML_CONFIG_STUB_CODE, page_size(),
156 PROT_EXEC, MAP_FIXED | MAP_PRIVATE, fd, offset); 158 PROT_EXEC, MAP_FIXED | MAP_PRIVATE,
159 stub_code_fd, stub_code_offset);
157 if(addr == MAP_FAILED){ 160 if(addr == MAP_FAILED){
158 printk("mapping mmap stub failed, errno = %d\n", 161 printk("mapping stub code failed, errno = %d\n",
159 errno); 162 errno);
160 exit(1); 163 exit(1);
161 } 164 }
162 165
163 if(stack != NULL){ 166 if(stack != NULL){
167 int fd;
168 __u64 offset;
169
164 fd = phys_mapping(to_phys(stack), &offset); 170 fd = phys_mapping(to_phys(stack), &offset);
165 addr = mmap((void *) UML_CONFIG_STUB_DATA, page_size(), 171 addr = mmap((void *) UML_CONFIG_STUB_DATA, page_size(),
166 PROT_READ | PROT_WRITE, 172 PROT_READ | PROT_WRITE,
167 MAP_FIXED | MAP_SHARED, fd, offset); 173 MAP_FIXED | MAP_SHARED, fd, offset);
168 if(addr == MAP_FAILED){ 174 if(addr == MAP_FAILED){
169 printk("mapping segfault stack failed, " 175 printk("mapping stub stack failed, "
170 "errno = %d\n", errno); 176 "errno = %d\n", errno);
171 exit(1); 177 exit(1);
172 } 178 }
173 } 179 }
174 } 180 }
175 if(!ptrace_faultinfo && (stack != NULL)){ 181 if(!ptrace_faultinfo){
176 unsigned long v = UML_CONFIG_STUB_CODE + 182 unsigned long v = UML_CONFIG_STUB_CODE +
177 (unsigned long) stub_segv_handler - 183 (unsigned long) stub_segv_handler -
178 (unsigned long) &__syscall_stub_start; 184 (unsigned long) &__syscall_stub_start;
@@ -198,6 +204,10 @@ int start_userspace(unsigned long stub_stack)
198 unsigned long sp; 204 unsigned long sp;
199 int pid, status, n, flags; 205 int pid, status, n, flags;
200 206
207 if ( stub_code_fd == -1 )
208 stub_code_fd = phys_mapping(to_phys(&__syscall_stub_start),
209 &stub_code_offset);
210
201 stack = mmap(NULL, PAGE_SIZE, PROT_READ | PROT_WRITE | PROT_EXEC, 211 stack = mmap(NULL, PAGE_SIZE, PROT_READ | PROT_WRITE | PROT_EXEC,
202 MAP_PRIVATE | MAP_ANONYMOUS, -1, 0); 212 MAP_PRIVATE | MAP_ANONYMOUS, -1, 0);
203 if(stack == MAP_FAILED) 213 if(stack == MAP_FAILED)
@@ -359,6 +369,53 @@ int copy_context_skas0(unsigned long new_stack, int pid)
359 return pid; 369 return pid;
360} 370}
361 371
372/*
373 * This is used only, if proc_mm is available, while PTRACE_FAULTINFO
374 * isn't. Opening /proc/mm creates a new mm_context, which lacks the stub-pages
375 * Thus, we map them using /proc/mm-fd
376 */
377void map_stub_pages(int fd, unsigned long code,
378 unsigned long data, unsigned long stack)
379{
380 struct proc_mm_op mmop;
381 int n;
382
383 mmop = ((struct proc_mm_op) { .op = MM_MMAP,
384 .u =
385 { .mmap =
386 { .addr = code,
387 .len = PAGE_SIZE,
388 .prot = PROT_EXEC,
389 .flags = MAP_FIXED | MAP_PRIVATE,
390 .fd = stub_code_fd,
391 .offset = stub_code_offset
392 } } });
393 n = os_write_file(fd, &mmop, sizeof(mmop));
394 if(n != sizeof(mmop))
395 panic("map_stub_pages : /proc/mm map for code failed, "
396 "err = %d\n", -n);
397
398 if ( stack ) {
399 __u64 map_offset;
400 int map_fd = phys_mapping(to_phys((void *)stack), &map_offset);
401 mmop = ((struct proc_mm_op)
402 { .op = MM_MMAP,
403 .u =
404 { .mmap =
405 { .addr = data,
406 .len = PAGE_SIZE,
407 .prot = PROT_READ | PROT_WRITE,
408 .flags = MAP_FIXED | MAP_SHARED,
409 .fd = map_fd,
410 .offset = map_offset
411 } } });
412 n = os_write_file(fd, &mmop, sizeof(mmop));
413 if(n != sizeof(mmop))
414 panic("map_stub_pages : /proc/mm map for data failed, "
415 "err = %d\n", -n);
416 }
417}
418
362void new_thread(void *stack, void **switch_buf_ptr, void **fork_buf_ptr, 419void new_thread(void *stack, void **switch_buf_ptr, void **fork_buf_ptr,
363 void (*handler)(int)) 420 void (*handler)(int))
364{ 421{
diff --git a/arch/um/kernel/skas/process_kern.c b/arch/um/kernel/skas/process_kern.c
index cbabab104ac3..3d1b227226e6 100644
--- a/arch/um/kernel/skas/process_kern.c
+++ b/arch/um/kernel/skas/process_kern.c
@@ -129,7 +129,9 @@ int copy_thread_skas(int nr, unsigned long clone_flags, unsigned long sp,
129 return(0); 129 return(0);
130} 130}
131 131
132int new_mm(int from) 132extern void map_stub_pages(int fd, unsigned long code,
133 unsigned long data, unsigned long stack);
134int new_mm(int from, unsigned long stack)
133{ 135{
134 struct proc_mm_op copy; 136 struct proc_mm_op copy;
135 int n, fd; 137 int n, fd;
@@ -148,6 +150,9 @@ int new_mm(int from)
148 "err = %d\n", -n); 150 "err = %d\n", -n);
149 } 151 }
150 152
153 if(!ptrace_faultinfo)
154 map_stub_pages(fd, CONFIG_STUB_CODE, CONFIG_STUB_DATA, stack);
155
151 return(fd); 156 return(fd);
152} 157}
153 158
diff --git a/arch/um/kernel/skas/syscall.c b/arch/um/kernel/skas/syscall.c
new file mode 100644
index 000000000000..51fb94076fcf
--- /dev/null
+++ b/arch/um/kernel/skas/syscall.c
@@ -0,0 +1,50 @@
1/*
2 * Copyright (C) 2002 Jeff Dike (jdike@karaya.com)
3 * Licensed under the GPL
4 */
5
6#include "linux/sys.h"
7#include "linux/ptrace.h"
8#include "asm/errno.h"
9#include "asm/unistd.h"
10#include "asm/ptrace.h"
11#include "asm/current.h"
12#include "sysdep/syscalls.h"
13#include "kern_util.h"
14#include "syscall.h"
15
16void handle_syscall(union uml_pt_regs *r)
17{
18 struct pt_regs *regs = container_of(r, struct pt_regs, regs);
19 long result;
20 int syscall;
21#ifdef UML_CONFIG_SYSCALL_DEBUG
22 int index;
23
24 index = record_syscall_start(UPT_SYSCALL_NR(r));
25#endif
26 syscall_trace(r, 0);
27
28 current->thread.nsyscalls++;
29 nsyscalls++;
30
31 /* This should go in the declaration of syscall, but when I do that,
32 * strace -f -c bash -c 'ls ; ls' breaks, sometimes not tracing
33 * children at all, sometimes hanging when bash doesn't see the first
34 * ls exit.
35 * The assembly looks functionally the same to me. This is
36 * gcc version 4.0.1 20050727 (Red Hat 4.0.1-5)
37 * in case it's a compiler bug.
38 */
39 syscall = UPT_SYSCALL_NR(r);
40 if((syscall >= NR_syscalls) || (syscall < 0))
41 result = -ENOSYS;
42 else result = EXECUTE_SYSCALL(syscall, regs);
43
44 REGS_SET_SYSCALL_RETURN(r->skas.regs, result);
45
46 syscall_trace(r, 1);
47#ifdef UML_CONFIG_SYSCALL_DEBUG
48 record_syscall_end(index, result);
49#endif
50}
diff --git a/arch/um/kernel/skas/syscall_kern.c b/arch/um/kernel/skas/syscall_kern.c
deleted file mode 100644
index bdf040ce5b8e..000000000000
--- a/arch/um/kernel/skas/syscall_kern.c
+++ /dev/null
@@ -1,43 +0,0 @@
1/*
2 * Copyright (C) 2002 - 2003 Jeff Dike (jdike@addtoit.com)
3 * Licensed under the GPL
4 */
5
6#include "linux/sys.h"
7#include "linux/ptrace.h"
8#include "asm/errno.h"
9#include "asm/unistd.h"
10#include "asm/ptrace.h"
11#include "asm/current.h"
12#include "sysdep/syscalls.h"
13#include "kern_util.h"
14
15extern syscall_handler_t *sys_call_table[];
16
17long execute_syscall_skas(void *r)
18{
19 struct pt_regs *regs = r;
20 long res;
21 int syscall;
22
23 current->thread.nsyscalls++;
24 nsyscalls++;
25 syscall = UPT_SYSCALL_NR(&regs->regs);
26
27 if((syscall >= NR_syscalls) || (syscall < 0))
28 res = -ENOSYS;
29 else res = EXECUTE_SYSCALL(syscall, regs);
30
31 return(res);
32}
33
34/*
35 * Overrides for Emacs so that we follow Linus's tabbing style.
36 * Emacs will notice this stuff at the end of the file and automatically
37 * adjust the settings for this buffer only. This must remain at the end
38 * of the file.
39 * ---------------------------------------------------------------------------
40 * Local variables:
41 * c-file-style: "linux"
42 * End:
43 */
diff --git a/arch/um/kernel/skas/syscall_user.c b/arch/um/kernel/skas/syscall_user.c
deleted file mode 100644
index 2828e6e37721..000000000000
--- a/arch/um/kernel/skas/syscall_user.c
+++ /dev/null
@@ -1,44 +0,0 @@
1/*
2 * Copyright (C) 2002 Jeff Dike (jdike@karaya.com)
3 * Licensed under the GPL
4 */
5
6#include <stdlib.h>
7#include <signal.h>
8#include "kern_util.h"
9#include "uml-config.h"
10#include "syscall_user.h"
11#include "sysdep/ptrace.h"
12#include "sysdep/sigcontext.h"
13#include "skas.h"
14
15void handle_syscall(union uml_pt_regs *regs)
16{
17 long result;
18#if UML_CONFIG_SYSCALL_DEBUG
19 int index;
20
21 index = record_syscall_start(UPT_SYSCALL_NR(regs));
22#endif
23
24 syscall_trace(regs, 0);
25 result = execute_syscall_skas(regs);
26
27 REGS_SET_SYSCALL_RETURN(regs->skas.regs, result);
28
29 syscall_trace(regs, 1);
30#if UML_CONFIG_SYSCALL_DEBUG
31 record_syscall_end(index, result);
32#endif
33}
34
35/*
36 * Overrides for Emacs so that we follow Linus's tabbing style.
37 * Emacs will notice this stuff at the end of the file and automatically
38 * adjust the settings for this buffer only. This must remain at the end
39 * of the file.
40 * ---------------------------------------------------------------------------
41 * Local variables:
42 * c-file-style: "linux"
43 * End:
44 */
diff --git a/arch/um/kernel/skas/tlb.c b/arch/um/kernel/skas/tlb.c
index 6230999c672c..6e84963dfc29 100644
--- a/arch/um/kernel/skas/tlb.c
+++ b/arch/um/kernel/skas/tlb.c
@@ -18,33 +18,39 @@
18#include "os.h" 18#include "os.h"
19#include "tlb.h" 19#include "tlb.h"
20 20
21static void do_ops(union mm_context *mmu, struct host_vm_op *ops, int last) 21static int do_ops(union mm_context *mmu, struct host_vm_op *ops, int last,
22 int finished, void **flush)
22{ 23{
23 struct host_vm_op *op; 24 struct host_vm_op *op;
24 int i; 25 int i, ret = 0;
25 26
26 for(i = 0; i <= last; i++){ 27 for(i = 0; i <= last && !ret; i++){
27 op = &ops[i]; 28 op = &ops[i];
28 switch(op->type){ 29 switch(op->type){
29 case MMAP: 30 case MMAP:
30 map(&mmu->skas.id, op->u.mmap.addr, op->u.mmap.len, 31 ret = map(&mmu->skas.id, op->u.mmap.addr,
31 op->u.mmap.r, op->u.mmap.w, op->u.mmap.x, 32 op->u.mmap.len, op->u.mmap.r, op->u.mmap.w,
32 op->u.mmap.fd, op->u.mmap.offset); 33 op->u.mmap.x, op->u.mmap.fd,
34 op->u.mmap.offset, finished, flush);
33 break; 35 break;
34 case MUNMAP: 36 case MUNMAP:
35 unmap(&mmu->skas.id, (void *) op->u.munmap.addr, 37 ret = unmap(&mmu->skas.id,
36 op->u.munmap.len); 38 (void *) op->u.munmap.addr,
39 op->u.munmap.len, finished, flush);
37 break; 40 break;
38 case MPROTECT: 41 case MPROTECT:
39 protect(&mmu->skas.id, op->u.mprotect.addr, 42 ret = protect(&mmu->skas.id, op->u.mprotect.addr,
40 op->u.mprotect.len, op->u.mprotect.r, 43 op->u.mprotect.len, op->u.mprotect.r,
41 op->u.mprotect.w, op->u.mprotect.x); 44 op->u.mprotect.w, op->u.mprotect.x,
45 finished, flush);
42 break; 46 break;
43 default: 47 default:
44 printk("Unknown op type %d in do_ops\n", op->type); 48 printk("Unknown op type %d in do_ops\n", op->type);
45 break; 49 break;
46 } 50 }
47 } 51 }
52
53 return ret;
48} 54}
49 55
50extern int proc_mm; 56extern int proc_mm;
diff --git a/arch/um/kernel/skas/trap_user.c b/arch/um/kernel/skas/trap_user.c
index 0dee1d95c806..9950a6716fe5 100644
--- a/arch/um/kernel/skas/trap_user.c
+++ b/arch/um/kernel/skas/trap_user.c
@@ -58,7 +58,6 @@ void user_signal(int sig, union uml_pt_regs *regs, int pid)
58 int segv = ((sig == SIGFPE) || (sig == SIGSEGV) || (sig == SIGBUS) || 58 int segv = ((sig == SIGFPE) || (sig == SIGSEGV) || (sig == SIGBUS) ||
59 (sig == SIGILL) || (sig == SIGTRAP)); 59 (sig == SIGILL) || (sig == SIGTRAP));
60 60
61 regs->skas.is_user = 1;
62 if (segv) 61 if (segv)
63 get_skas_faultinfo(pid, &regs->skas.faultinfo); 62 get_skas_faultinfo(pid, &regs->skas.faultinfo);
64 info = &sig_info[sig]; 63 info = &sig_info[sig];
diff --git a/arch/um/kernel/syscall.c b/arch/um/kernel/syscall.c
new file mode 100644
index 000000000000..1429c131879d
--- /dev/null
+++ b/arch/um/kernel/syscall.c
@@ -0,0 +1,36 @@
1/*
2 * Copyright (C) 2002 Jeff Dike (jdike@karaya.com)
3 * Licensed under the GPL
4 */
5
6#include "kern_util.h"
7#include "syscall.h"
8#include "os.h"
9
10struct {
11 int syscall;
12 int pid;
13 long result;
14 unsigned long long start;
15 unsigned long long end;
16} syscall_record[1024];
17
18int record_syscall_start(int syscall)
19{
20 int max, index;
21
22 max = sizeof(syscall_record)/sizeof(syscall_record[0]);
23 index = next_syscall_index(max);
24
25 syscall_record[index].syscall = syscall;
26 syscall_record[index].pid = current_pid();
27 syscall_record[index].result = 0xdeadbeef;
28 syscall_record[index].start = os_usecs();
29 return(index);
30}
31
32void record_syscall_end(int index, long result)
33{
34 syscall_record[index].result = result;
35 syscall_record[index].end = os_usecs();
36}
diff --git a/arch/um/kernel/syscall_user.c b/arch/um/kernel/syscall_user.c
deleted file mode 100644
index 01b711e00a85..000000000000
--- a/arch/um/kernel/syscall_user.c
+++ /dev/null
@@ -1,48 +0,0 @@
1/*
2 * Copyright (C) 2002 Jeff Dike (jdike@karaya.com)
3 * Licensed under the GPL
4 */
5
6#include <stdlib.h>
7#include <sys/time.h>
8#include "kern_util.h"
9#include "syscall_user.h"
10
11struct {
12 int syscall;
13 int pid;
14 long result;
15 struct timeval start;
16 struct timeval end;
17} syscall_record[1024];
18
19int record_syscall_start(int syscall)
20{
21 int max, index;
22
23 max = sizeof(syscall_record)/sizeof(syscall_record[0]);
24 index = next_syscall_index(max);
25
26 syscall_record[index].syscall = syscall;
27 syscall_record[index].pid = current_pid();
28 syscall_record[index].result = 0xdeadbeef;
29 gettimeofday(&syscall_record[index].start, NULL);
30 return(index);
31}
32
33void record_syscall_end(int index, long result)
34{
35 syscall_record[index].result = result;
36 gettimeofday(&syscall_record[index].end, NULL);
37}
38
39/*
40 * Overrides for Emacs so that we follow Linus's tabbing style.
41 * Emacs will notice this stuff at the end of the file and automatically
42 * adjust the settings for this buffer only. This must remain at the end
43 * of the file.
44 * ---------------------------------------------------------------------------
45 * Local variables:
46 * c-file-style: "linux"
47 * End:
48 */
diff --git a/arch/um/kernel/time_kern.c b/arch/um/kernel/time_kern.c
index a8b4ef601f59..4e08f7545d63 100644
--- a/arch/um/kernel/time_kern.c
+++ b/arch/um/kernel/time_kern.c
@@ -137,7 +137,10 @@ long um_stime(int __user *tptr)
137void timer_handler(int sig, union uml_pt_regs *regs) 137void timer_handler(int sig, union uml_pt_regs *regs)
138{ 138{
139 local_irq_disable(); 139 local_irq_disable();
140 update_process_times(CHOOSE_MODE(user_context(UPT_SP(regs)), (regs)->skas.is_user)); 140 irq_enter();
141 update_process_times(CHOOSE_MODE(user_context(UPT_SP(regs)),
142 (regs)->skas.is_user));
143 irq_exit();
141 local_irq_enable(); 144 local_irq_enable();
142 if(current_thread->cpu == 0) 145 if(current_thread->cpu == 0)
143 timer_irq(regs); 146 timer_irq(regs);
diff --git a/arch/um/kernel/tlb.c b/arch/um/kernel/tlb.c
index 83ec8d4747fd..80ed6188e8a2 100644
--- a/arch/um/kernel/tlb.c
+++ b/arch/um/kernel/tlb.c
@@ -15,12 +15,118 @@
15#include "mem_user.h" 15#include "mem_user.h"
16#include "os.h" 16#include "os.h"
17 17
18static int add_mmap(unsigned long virt, unsigned long phys, unsigned long len,
19 int r, int w, int x, struct host_vm_op *ops, int *index,
20 int last_filled, union mm_context *mmu, void **flush,
21 int (*do_ops)(union mm_context *, struct host_vm_op *,
22 int, int, void **))
23{
24 __u64 offset;
25 struct host_vm_op *last;
26 int fd, ret = 0;
27
28 fd = phys_mapping(phys, &offset);
29 if(*index != -1){
30 last = &ops[*index];
31 if((last->type == MMAP) &&
32 (last->u.mmap.addr + last->u.mmap.len == virt) &&
33 (last->u.mmap.r == r) && (last->u.mmap.w == w) &&
34 (last->u.mmap.x == x) && (last->u.mmap.fd == fd) &&
35 (last->u.mmap.offset + last->u.mmap.len == offset)){
36 last->u.mmap.len += len;
37 return 0;
38 }
39 }
40
41 if(*index == last_filled){
42 ret = (*do_ops)(mmu, ops, last_filled, 0, flush);
43 *index = -1;
44 }
45
46 ops[++*index] = ((struct host_vm_op) { .type = MMAP,
47 .u = { .mmap = {
48 .addr = virt,
49 .len = len,
50 .r = r,
51 .w = w,
52 .x = x,
53 .fd = fd,
54 .offset = offset }
55 } });
56 return ret;
57}
58
59static int add_munmap(unsigned long addr, unsigned long len,
60 struct host_vm_op *ops, int *index, int last_filled,
61 union mm_context *mmu, void **flush,
62 int (*do_ops)(union mm_context *, struct host_vm_op *,
63 int, int, void **))
64{
65 struct host_vm_op *last;
66 int ret = 0;
67
68 if(*index != -1){
69 last = &ops[*index];
70 if((last->type == MUNMAP) &&
71 (last->u.munmap.addr + last->u.mmap.len == addr)){
72 last->u.munmap.len += len;
73 return 0;
74 }
75 }
76
77 if(*index == last_filled){
78 ret = (*do_ops)(mmu, ops, last_filled, 0, flush);
79 *index = -1;
80 }
81
82 ops[++*index] = ((struct host_vm_op) { .type = MUNMAP,
83 .u = { .munmap = {
84 .addr = addr,
85 .len = len } } });
86 return ret;
87}
88
89static int add_mprotect(unsigned long addr, unsigned long len, int r, int w,
90 int x, struct host_vm_op *ops, int *index,
91 int last_filled, union mm_context *mmu, void **flush,
92 int (*do_ops)(union mm_context *, struct host_vm_op *,
93 int, int, void **))
94{
95 struct host_vm_op *last;
96 int ret = 0;
97
98 if(*index != -1){
99 last = &ops[*index];
100 if((last->type == MPROTECT) &&
101 (last->u.mprotect.addr + last->u.mprotect.len == addr) &&
102 (last->u.mprotect.r == r) && (last->u.mprotect.w == w) &&
103 (last->u.mprotect.x == x)){
104 last->u.mprotect.len += len;
105 return 0;
106 }
107 }
108
109 if(*index == last_filled){
110 ret = (*do_ops)(mmu, ops, last_filled, 0, flush);
111 *index = -1;
112 }
113
114 ops[++*index] = ((struct host_vm_op) { .type = MPROTECT,
115 .u = { .mprotect = {
116 .addr = addr,
117 .len = len,
118 .r = r,
119 .w = w,
120 .x = x } } });
121 return ret;
122}
123
18#define ADD_ROUND(n, inc) (((n) + (inc)) & ~((inc) - 1)) 124#define ADD_ROUND(n, inc) (((n) + (inc)) & ~((inc) - 1))
19 125
20void fix_range_common(struct mm_struct *mm, unsigned long start_addr, 126void fix_range_common(struct mm_struct *mm, unsigned long start_addr,
21 unsigned long end_addr, int force, 127 unsigned long end_addr, int force,
22 void (*do_ops)(union mm_context *, struct host_vm_op *, 128 int (*do_ops)(union mm_context *, struct host_vm_op *,
23 int)) 129 int, int, void **))
24{ 130{
25 pgd_t *npgd; 131 pgd_t *npgd;
26 pud_t *npud; 132 pud_t *npud;
@@ -29,21 +135,24 @@ void fix_range_common(struct mm_struct *mm, unsigned long start_addr,
29 union mm_context *mmu = &mm->context; 135 union mm_context *mmu = &mm->context;
30 unsigned long addr, end; 136 unsigned long addr, end;
31 int r, w, x; 137 int r, w, x;
32 struct host_vm_op ops[16]; 138 struct host_vm_op ops[1];
139 void *flush = NULL;
33 int op_index = -1, last_op = sizeof(ops) / sizeof(ops[0]) - 1; 140 int op_index = -1, last_op = sizeof(ops) / sizeof(ops[0]) - 1;
141 int ret = 0;
34 142
35 if(mm == NULL) return; 143 if(mm == NULL) return;
36 144
37 for(addr = start_addr; addr < end_addr;){ 145 ops[0].type = NONE;
146 for(addr = start_addr; addr < end_addr && !ret;){
38 npgd = pgd_offset(mm, addr); 147 npgd = pgd_offset(mm, addr);
39 if(!pgd_present(*npgd)){ 148 if(!pgd_present(*npgd)){
40 end = ADD_ROUND(addr, PGDIR_SIZE); 149 end = ADD_ROUND(addr, PGDIR_SIZE);
41 if(end > end_addr) 150 if(end > end_addr)
42 end = end_addr; 151 end = end_addr;
43 if(force || pgd_newpage(*npgd)){ 152 if(force || pgd_newpage(*npgd)){
44 op_index = add_munmap(addr, end - addr, ops, 153 ret = add_munmap(addr, end - addr, ops,
45 op_index, last_op, mmu, 154 &op_index, last_op, mmu,
46 do_ops); 155 &flush, do_ops);
47 pgd_mkuptodate(*npgd); 156 pgd_mkuptodate(*npgd);
48 } 157 }
49 addr = end; 158 addr = end;
@@ -56,9 +165,9 @@ void fix_range_common(struct mm_struct *mm, unsigned long start_addr,
56 if(end > end_addr) 165 if(end > end_addr)
57 end = end_addr; 166 end = end_addr;
58 if(force || pud_newpage(*npud)){ 167 if(force || pud_newpage(*npud)){
59 op_index = add_munmap(addr, end - addr, ops, 168 ret = add_munmap(addr, end - addr, ops,
60 op_index, last_op, mmu, 169 &op_index, last_op, mmu,
61 do_ops); 170 &flush, do_ops);
62 pud_mkuptodate(*npud); 171 pud_mkuptodate(*npud);
63 } 172 }
64 addr = end; 173 addr = end;
@@ -71,9 +180,9 @@ void fix_range_common(struct mm_struct *mm, unsigned long start_addr,
71 if(end > end_addr) 180 if(end > end_addr)
72 end = end_addr; 181 end = end_addr;
73 if(force || pmd_newpage(*npmd)){ 182 if(force || pmd_newpage(*npmd)){
74 op_index = add_munmap(addr, end - addr, ops, 183 ret = add_munmap(addr, end - addr, ops,
75 op_index, last_op, mmu, 184 &op_index, last_op, mmu,
76 do_ops); 185 &flush, do_ops);
77 pmd_mkuptodate(*npmd); 186 pmd_mkuptodate(*npmd);
78 } 187 }
79 addr = end; 188 addr = end;
@@ -92,24 +201,32 @@ void fix_range_common(struct mm_struct *mm, unsigned long start_addr,
92 } 201 }
93 if(force || pte_newpage(*npte)){ 202 if(force || pte_newpage(*npte)){
94 if(pte_present(*npte)) 203 if(pte_present(*npte))
95 op_index = add_mmap(addr, 204 ret = add_mmap(addr,
96 pte_val(*npte) & PAGE_MASK, 205 pte_val(*npte) & PAGE_MASK,
97 PAGE_SIZE, r, w, x, ops, 206 PAGE_SIZE, r, w, x, ops,
98 op_index, last_op, mmu, 207 &op_index, last_op, mmu,
99 do_ops); 208 &flush, do_ops);
100 else op_index = add_munmap(addr, PAGE_SIZE, ops, 209 else ret = add_munmap(addr, PAGE_SIZE, ops,
101 op_index, last_op, mmu, 210 &op_index, last_op, mmu,
102 do_ops); 211 &flush, do_ops);
103 } 212 }
104 else if(pte_newprot(*npte)) 213 else if(pte_newprot(*npte))
105 op_index = add_mprotect(addr, PAGE_SIZE, r, w, x, ops, 214 ret = add_mprotect(addr, PAGE_SIZE, r, w, x, ops,
106 op_index, last_op, mmu, 215 &op_index, last_op, mmu,
107 do_ops); 216 &flush, do_ops);
108 217
109 *npte = pte_mkuptodate(*npte); 218 *npte = pte_mkuptodate(*npte);
110 addr += PAGE_SIZE; 219 addr += PAGE_SIZE;
111 } 220 }
112 (*do_ops)(mmu, ops, op_index); 221
222 if(!ret)
223 ret = (*do_ops)(mmu, ops, op_index, 1, &flush);
224
225 /* This is not an else because ret is modified above */
226 if(ret) {
227 printk("fix_range_common: failed, killing current process\n");
228 force_sig(SIGKILL, current);
229 }
113} 230}
114 231
115int flush_tlb_kernel_range_common(unsigned long start, unsigned long end) 232int flush_tlb_kernel_range_common(unsigned long start, unsigned long end)
@@ -226,106 +343,6 @@ pte_t *addr_pte(struct task_struct *task, unsigned long addr)
226 return(pte_offset_map(pmd, addr)); 343 return(pte_offset_map(pmd, addr));
227} 344}
228 345
229int add_mmap(unsigned long virt, unsigned long phys, unsigned long len,
230 int r, int w, int x, struct host_vm_op *ops, int index,
231 int last_filled, union mm_context *mmu,
232 void (*do_ops)(union mm_context *, struct host_vm_op *, int))
233{
234 __u64 offset;
235 struct host_vm_op *last;
236 int fd;
237
238 fd = phys_mapping(phys, &offset);
239 if(index != -1){
240 last = &ops[index];
241 if((last->type == MMAP) &&
242 (last->u.mmap.addr + last->u.mmap.len == virt) &&
243 (last->u.mmap.r == r) && (last->u.mmap.w == w) &&
244 (last->u.mmap.x == x) && (last->u.mmap.fd == fd) &&
245 (last->u.mmap.offset + last->u.mmap.len == offset)){
246 last->u.mmap.len += len;
247 return(index);
248 }
249 }
250
251 if(index == last_filled){
252 (*do_ops)(mmu, ops, last_filled);
253 index = -1;
254 }
255
256 ops[++index] = ((struct host_vm_op) { .type = MMAP,
257 .u = { .mmap = {
258 .addr = virt,
259 .len = len,
260 .r = r,
261 .w = w,
262 .x = x,
263 .fd = fd,
264 .offset = offset }
265 } });
266 return(index);
267}
268
269int add_munmap(unsigned long addr, unsigned long len, struct host_vm_op *ops,
270 int index, int last_filled, union mm_context *mmu,
271 void (*do_ops)(union mm_context *, struct host_vm_op *, int))
272{
273 struct host_vm_op *last;
274
275 if(index != -1){
276 last = &ops[index];
277 if((last->type == MUNMAP) &&
278 (last->u.munmap.addr + last->u.mmap.len == addr)){
279 last->u.munmap.len += len;
280 return(index);
281 }
282 }
283
284 if(index == last_filled){
285 (*do_ops)(mmu, ops, last_filled);
286 index = -1;
287 }
288
289 ops[++index] = ((struct host_vm_op) { .type = MUNMAP,
290 .u = { .munmap = {
291 .addr = addr,
292 .len = len } } });
293 return(index);
294}
295
296int add_mprotect(unsigned long addr, unsigned long len, int r, int w, int x,
297 struct host_vm_op *ops, int index, int last_filled,
298 union mm_context *mmu,
299 void (*do_ops)(union mm_context *, struct host_vm_op *, int))
300{
301 struct host_vm_op *last;
302
303 if(index != -1){
304 last = &ops[index];
305 if((last->type == MPROTECT) &&
306 (last->u.mprotect.addr + last->u.mprotect.len == addr) &&
307 (last->u.mprotect.r == r) && (last->u.mprotect.w == w) &&
308 (last->u.mprotect.x == x)){
309 last->u.mprotect.len += len;
310 return(index);
311 }
312 }
313
314 if(index == last_filled){
315 (*do_ops)(mmu, ops, last_filled);
316 index = -1;
317 }
318
319 ops[++index] = ((struct host_vm_op) { .type = MPROTECT,
320 .u = { .mprotect = {
321 .addr = addr,
322 .len = len,
323 .r = r,
324 .w = w,
325 .x = x } } });
326 return(index);
327}
328
329void flush_tlb_page(struct vm_area_struct *vma, unsigned long address) 346void flush_tlb_page(struct vm_area_struct *vma, unsigned long address)
330{ 347{
331 address &= PAGE_MASK; 348 address &= PAGE_MASK;
diff --git a/arch/um/kernel/trap_kern.c b/arch/um/kernel/trap_kern.c
index c20aef120598..b5fc89fe9eab 100644
--- a/arch/um/kernel/trap_kern.c
+++ b/arch/um/kernel/trap_kern.c
@@ -26,6 +26,7 @@
26#include "mem.h" 26#include "mem.h"
27#include "mem_kern.h" 27#include "mem_kern.h"
28 28
29/* Note this is constrained to return 0, -EFAULT, -EACCESS, -ENOMEM by segv(). */
29int handle_page_fault(unsigned long address, unsigned long ip, 30int handle_page_fault(unsigned long address, unsigned long ip,
30 int is_write, int is_user, int *code_out) 31 int is_write, int is_user, int *code_out)
31{ 32{
@@ -35,7 +36,6 @@ int handle_page_fault(unsigned long address, unsigned long ip,
35 pud_t *pud; 36 pud_t *pud;
36 pmd_t *pmd; 37 pmd_t *pmd;
37 pte_t *pte; 38 pte_t *pte;
38 unsigned long page;
39 int err = -EFAULT; 39 int err = -EFAULT;
40 40
41 *code_out = SEGV_MAPERR; 41 *code_out = SEGV_MAPERR;
@@ -52,7 +52,7 @@ int handle_page_fault(unsigned long address, unsigned long ip,
52 else if(expand_stack(vma, address)) 52 else if(expand_stack(vma, address))
53 goto out; 53 goto out;
54 54
55 good_area: 55good_area:
56 *code_out = SEGV_ACCERR; 56 *code_out = SEGV_ACCERR;
57 if(is_write && !(vma->vm_flags & VM_WRITE)) 57 if(is_write && !(vma->vm_flags & VM_WRITE))
58 goto out; 58 goto out;
@@ -60,9 +60,8 @@ int handle_page_fault(unsigned long address, unsigned long ip,
60 if(!(vma->vm_flags & (VM_READ | VM_EXEC))) 60 if(!(vma->vm_flags & (VM_READ | VM_EXEC)))
61 goto out; 61 goto out;
62 62
63 page = address & PAGE_MASK;
64 do { 63 do {
65 survive: 64survive:
66 switch (handle_mm_fault(mm, vma, address, is_write)){ 65 switch (handle_mm_fault(mm, vma, address, is_write)){
67 case VM_FAULT_MINOR: 66 case VM_FAULT_MINOR:
68 current->min_flt++; 67 current->min_flt++;
@@ -79,16 +78,16 @@ int handle_page_fault(unsigned long address, unsigned long ip,
79 default: 78 default:
80 BUG(); 79 BUG();
81 } 80 }
82 pgd = pgd_offset(mm, page); 81 pgd = pgd_offset(mm, address);
83 pud = pud_offset(pgd, page); 82 pud = pud_offset(pgd, address);
84 pmd = pmd_offset(pud, page); 83 pmd = pmd_offset(pud, address);
85 pte = pte_offset_kernel(pmd, page); 84 pte = pte_offset_kernel(pmd, address);
86 } while(!pte_present(*pte)); 85 } while(!pte_present(*pte));
87 err = 0; 86 err = 0;
88 *pte = pte_mkyoung(*pte); 87 *pte = pte_mkyoung(*pte);
89 if(pte_write(*pte)) *pte = pte_mkdirty(*pte); 88 if(pte_write(*pte)) *pte = pte_mkdirty(*pte);
90 flush_tlb_page(vma, page); 89 flush_tlb_page(vma, address);
91 out: 90out:
92 up_read(&mm->mmap_sem); 91 up_read(&mm->mmap_sem);
93 return(err); 92 return(err);
94 93
@@ -144,19 +143,18 @@ unsigned long segv(struct faultinfo fi, unsigned long ip, int is_user, void *sc)
144 panic("Kernel mode fault at addr 0x%lx, ip 0x%lx", 143 panic("Kernel mode fault at addr 0x%lx, ip 0x%lx",
145 address, ip); 144 address, ip);
146 145
147 if(err == -EACCES){ 146 if (err == -EACCES) {
148 si.si_signo = SIGBUS; 147 si.si_signo = SIGBUS;
149 si.si_errno = 0; 148 si.si_errno = 0;
150 si.si_code = BUS_ADRERR; 149 si.si_code = BUS_ADRERR;
151 si.si_addr = (void *)address; 150 si.si_addr = (void *)address;
152 current->thread.arch.faultinfo = fi; 151 current->thread.arch.faultinfo = fi;
153 force_sig_info(SIGBUS, &si, current); 152 force_sig_info(SIGBUS, &si, current);
154 } 153 } else if (err == -ENOMEM) {
155 else if(err == -ENOMEM){
156 printk("VM: killing process %s\n", current->comm); 154 printk("VM: killing process %s\n", current->comm);
157 do_exit(SIGKILL); 155 do_exit(SIGKILL);
158 } 156 } else {
159 else { 157 BUG_ON(err != -EFAULT);
160 si.si_signo = SIGSEGV; 158 si.si_signo = SIGSEGV;
161 si.si_addr = (void *) address; 159 si.si_addr = (void *) address;
162 current->thread.arch.faultinfo = fi; 160 current->thread.arch.faultinfo = fi;
@@ -200,30 +198,3 @@ void winch(int sig, union uml_pt_regs *regs)
200void trap_init(void) 198void trap_init(void)
201{ 199{
202} 200}
203
204DEFINE_SPINLOCK(trap_lock);
205
206static int trap_index = 0;
207
208int next_trap_index(int limit)
209{
210 int ret;
211
212 spin_lock(&trap_lock);
213 ret = trap_index;
214 if(++trap_index == limit)
215 trap_index = 0;
216 spin_unlock(&trap_lock);
217 return(ret);
218}
219
220/*
221 * Overrides for Emacs so that we follow Linus's tabbing style.
222 * Emacs will notice this stuff at the end of the file and automatically
223 * adjust the settings for this buffer only. This must remain at the end
224 * of the file.
225 * ---------------------------------------------------------------------------
226 * Local variables:
227 * c-file-style: "linux"
228 * End:
229 */
diff --git a/arch/um/kernel/trap_user.c b/arch/um/kernel/trap_user.c
index f825a6eda3f5..e9ccd6b8d3c7 100644
--- a/arch/um/kernel/trap_user.c
+++ b/arch/um/kernel/trap_user.c
@@ -40,35 +40,14 @@ void kill_child_dead(int pid)
40 } while(1); 40 } while(1);
41} 41}
42 42
43/* Unlocked - don't care if this is a bit off */
44int nsegfaults = 0;
45
46struct {
47 unsigned long address;
48 int is_write;
49 int pid;
50 unsigned long sp;
51 int is_user;
52} segfault_record[1024];
53
54void segv_handler(int sig, union uml_pt_regs *regs) 43void segv_handler(int sig, union uml_pt_regs *regs)
55{ 44{
56 int index, max;
57 struct faultinfo * fi = UPT_FAULTINFO(regs); 45 struct faultinfo * fi = UPT_FAULTINFO(regs);
58 46
59 if(UPT_IS_USER(regs) && !SEGV_IS_FIXABLE(fi)){ 47 if(UPT_IS_USER(regs) && !SEGV_IS_FIXABLE(fi)){
60 bad_segv(*fi, UPT_IP(regs)); 48 bad_segv(*fi, UPT_IP(regs));
61 return; 49 return;
62 } 50 }
63 max = sizeof(segfault_record)/sizeof(segfault_record[0]);
64 index = next_trap_index(max);
65
66 nsegfaults++;
67 segfault_record[index].address = FAULT_ADDRESS(*fi);
68 segfault_record[index].pid = os_getpid();
69 segfault_record[index].is_write = FAULT_WRITE(*fi);
70 segfault_record[index].sp = UPT_SP(regs);
71 segfault_record[index].is_user = UPT_IS_USER(regs);
72 segv(*fi, UPT_IP(regs), UPT_IS_USER(regs), regs); 51 segv(*fi, UPT_IP(regs), UPT_IS_USER(regs), regs);
73} 52}
74 53
diff --git a/arch/um/kernel/tt/syscall_kern.c b/arch/um/kernel/tt/syscall_kern.c
index 2650a628719e..3d29c90514cc 100644
--- a/arch/um/kernel/tt/syscall_kern.c
+++ b/arch/um/kernel/tt/syscall_kern.c
@@ -12,36 +12,41 @@
12#include "asm/uaccess.h" 12#include "asm/uaccess.h"
13#include "asm/stat.h" 13#include "asm/stat.h"
14#include "sysdep/syscalls.h" 14#include "sysdep/syscalls.h"
15#include "sysdep/sigcontext.h"
15#include "kern_util.h" 16#include "kern_util.h"
17#include "syscall.h"
16 18
17extern syscall_handler_t *sys_call_table[]; 19void syscall_handler_tt(int sig, struct pt_regs *regs)
18
19long execute_syscall_tt(void *r)
20{ 20{
21 struct pt_regs *regs = r; 21 void *sc;
22 long res; 22 long result;
23 int syscall; 23 int syscall;
24
25#ifdef CONFIG_SYSCALL_DEBUG 24#ifdef CONFIG_SYSCALL_DEBUG
25 int index;
26 index = record_syscall_start(syscall);
27#endif
28 sc = UPT_SC(&regs->regs);
29 SC_START_SYSCALL(sc);
30
31 syscall_trace(&regs->regs, 0);
32
26 current->thread.nsyscalls++; 33 current->thread.nsyscalls++;
27 nsyscalls++; 34 nsyscalls++;
28#endif
29 syscall = UPT_SYSCALL_NR(&regs->regs); 35 syscall = UPT_SYSCALL_NR(&regs->regs);
30 36
31 if((syscall >= NR_syscalls) || (syscall < 0)) 37 if((syscall >= NR_syscalls) || (syscall < 0))
32 res = -ENOSYS; 38 result = -ENOSYS;
33 else res = EXECUTE_SYSCALL(syscall, regs); 39 else result = EXECUTE_SYSCALL(syscall, regs);
34 40
35 return(res); 41 /* regs->sc may have changed while the system call ran (there may
36} 42 * have been an interrupt or segfault), so it needs to be refreshed.
43 */
44 UPT_SC(&regs->regs) = sc;
37 45
38/* 46 SC_SET_SYSCALL_RETURN(sc, result);
39 * Overrides for Emacs so that we follow Linus's tabbing style. 47
40 * Emacs will notice this stuff at the end of the file and automatically 48 syscall_trace(&regs->regs, 1);
41 * adjust the settings for this buffer only. This must remain at the end 49#ifdef CONFIG_SYSCALL_DEBUG
42 * of the file. 50 record_syscall_end(index, result);
43 * --------------------------------------------------------------------------- 51#endif
44 * Local variables: 52}
45 * c-file-style: "linux"
46 * End:
47 */
diff --git a/arch/um/kernel/tt/syscall_user.c b/arch/um/kernel/tt/syscall_user.c
index b218316cfdb2..902987bf379b 100644
--- a/arch/um/kernel/tt/syscall_user.c
+++ b/arch/um/kernel/tt/syscall_user.c
@@ -13,42 +13,9 @@
13#include "task.h" 13#include "task.h"
14#include "user_util.h" 14#include "user_util.h"
15#include "kern_util.h" 15#include "kern_util.h"
16#include "syscall_user.h" 16#include "syscall.h"
17#include "tt.h" 17#include "tt.h"
18 18
19
20void syscall_handler_tt(int sig, union uml_pt_regs *regs)
21{
22 void *sc;
23 long result;
24 int syscall;
25#ifdef UML_CONFIG_DEBUG_SYSCALL
26 int index;
27#endif
28
29 syscall = UPT_SYSCALL_NR(regs);
30 sc = UPT_SC(regs);
31 SC_START_SYSCALL(sc);
32
33#ifdef UML_CONFIG_DEBUG_SYSCALL
34 index = record_syscall_start(syscall);
35#endif
36 syscall_trace(regs, 0);
37 result = execute_syscall_tt(regs);
38
39 /* regs->sc may have changed while the system call ran (there may
40 * have been an interrupt or segfault), so it needs to be refreshed.
41 */
42 UPT_SC(regs) = sc;
43
44 SC_SET_SYSCALL_RETURN(sc, result);
45
46 syscall_trace(regs, 1);
47#ifdef UML_CONFIG_DEBUG_SYSCALL
48 record_syscall_end(index, result);
49#endif
50}
51
52void do_sigtrap(void *task) 19void do_sigtrap(void *task)
53{ 20{
54 UPT_SYSCALL_NR(TASK_REGS(task)) = -1; 21 UPT_SYSCALL_NR(TASK_REGS(task)) = -1;
diff --git a/arch/um/kernel/tt/tlb.c b/arch/um/kernel/tt/tlb.c
index 2eefb43bc9c2..f1d85dbb45b9 100644
--- a/arch/um/kernel/tt/tlb.c
+++ b/arch/um/kernel/tt/tlb.c
@@ -17,25 +17,31 @@
17#include "os.h" 17#include "os.h"
18#include "tlb.h" 18#include "tlb.h"
19 19
20static void do_ops(union mm_context *mmu, struct host_vm_op *ops, int last) 20static int do_ops(union mm_context *mmu, struct host_vm_op *ops, int last,
21 int finished, void **flush)
21{ 22{
22 struct host_vm_op *op; 23 struct host_vm_op *op;
23 int i; 24 int i, ret=0;
24 25
25 for(i = 0; i <= last; i++){ 26 for(i = 0; i <= last && !ret; i++){
26 op = &ops[i]; 27 op = &ops[i];
27 switch(op->type){ 28 switch(op->type){
28 case MMAP: 29 case MMAP:
29 os_map_memory((void *) op->u.mmap.addr, op->u.mmap.fd, 30 ret = os_map_memory((void *) op->u.mmap.addr,
30 op->u.mmap.offset, op->u.mmap.len, 31 op->u.mmap.fd, op->u.mmap.offset,
31 op->u.mmap.r, op->u.mmap.w, 32 op->u.mmap.len, op->u.mmap.r,
32 op->u.mmap.x); 33 op->u.mmap.w, op->u.mmap.x);
33 break; 34 break;
34 case MUNMAP: 35 case MUNMAP:
35 os_unmap_memory((void *) op->u.munmap.addr, 36 ret = os_unmap_memory((void *) op->u.munmap.addr,
36 op->u.munmap.len); 37 op->u.munmap.len);
37 break; 38 break;
38 case MPROTECT: 39 case MPROTECT:
40 ret = protect_memory(op->u.mprotect.addr,
41 op->u.munmap.len,
42 op->u.mprotect.r,
43 op->u.mprotect.w,
44 op->u.mprotect.x, 1);
39 protect_memory(op->u.mprotect.addr, op->u.munmap.len, 45 protect_memory(op->u.mprotect.addr, op->u.munmap.len,
40 op->u.mprotect.r, op->u.mprotect.w, 46 op->u.mprotect.r, op->u.mprotect.w,
41 op->u.mprotect.x, 1); 47 op->u.mprotect.x, 1);
@@ -45,6 +51,8 @@ static void do_ops(union mm_context *mmu, struct host_vm_op *ops, int last)
45 break; 51 break;
46 } 52 }
47 } 53 }
54
55 return ret;
48} 56}
49 57
50static void fix_range(struct mm_struct *mm, unsigned long start_addr, 58static void fix_range(struct mm_struct *mm, unsigned long start_addr,
diff --git a/arch/um/kernel/um_arch.c b/arch/um/kernel/um_arch.c
index 8736d098f0ee..09f6f7ce4695 100644
--- a/arch/um/kernel/um_arch.c
+++ b/arch/um/kernel/um_arch.c
@@ -38,6 +38,9 @@
38#include "choose-mode.h" 38#include "choose-mode.h"
39#include "mode_kern.h" 39#include "mode_kern.h"
40#include "mode.h" 40#include "mode.h"
41#ifdef UML_CONFIG_MODE_SKAS
42#include "skas.h"
43#endif
41 44
42#define DEFAULT_COMMAND_LINE "root=98:0" 45#define DEFAULT_COMMAND_LINE "root=98:0"
43 46
@@ -123,7 +126,7 @@ unsigned long start_vm;
123unsigned long end_vm; 126unsigned long end_vm;
124int ncpus = 1; 127int ncpus = 1;
125 128
126#ifdef CONFIG_MODE_TT 129#ifdef CONFIG_CMDLINE_ON_HOST
127/* Pointer set in linux_main, the array itself is private to each thread, 130/* Pointer set in linux_main, the array itself is private to each thread,
128 * and changed at address space creation time so this poses no concurrency 131 * and changed at address space creation time so this poses no concurrency
129 * problems. 132 * problems.
@@ -138,7 +141,7 @@ long physmem_size = 32 * 1024 * 1024;
138 141
139void set_cmdline(char *cmd) 142void set_cmdline(char *cmd)
140{ 143{
141#ifdef CONFIG_MODE_TT 144#ifdef CONFIG_CMDLINE_ON_HOST
142 char *umid, *ptr; 145 char *umid, *ptr;
143 146
144 if(CHOOSE_MODE(honeypot, 0)) return; 147 if(CHOOSE_MODE(honeypot, 0)) return;
@@ -318,6 +321,7 @@ int linux_main(int argc, char **argv)
318 unsigned long avail, diff; 321 unsigned long avail, diff;
319 unsigned long virtmem_size, max_physmem; 322 unsigned long virtmem_size, max_physmem;
320 unsigned int i, add; 323 unsigned int i, add;
324 char * mode;
321 325
322 for (i = 1; i < argc; i++){ 326 for (i = 1; i < argc; i++){
323 if((i == 1) && (argv[i][0] == ' ')) continue; 327 if((i == 1) && (argv[i][0] == ' ')) continue;
@@ -329,6 +333,7 @@ int linux_main(int argc, char **argv)
329 if(have_root == 0) 333 if(have_root == 0)
330 add_arg(DEFAULT_COMMAND_LINE); 334 add_arg(DEFAULT_COMMAND_LINE);
331 335
336 os_early_checks();
332 mode_tt = force_tt ? 1 : !can_do_skas(); 337 mode_tt = force_tt ? 1 : !can_do_skas();
333#ifndef CONFIG_MODE_TT 338#ifndef CONFIG_MODE_TT
334 if (mode_tt) { 339 if (mode_tt) {
@@ -338,6 +343,21 @@ int linux_main(int argc, char **argv)
338 exit(1); 343 exit(1);
339 } 344 }
340#endif 345#endif
346
347#ifndef CONFIG_MODE_SKAS
348 mode = "TT";
349#else
350 /* Show to the user the result of selection */
351 if (mode_tt)
352 mode = "TT";
353 else if (proc_mm && ptrace_faultinfo)
354 mode = "SKAS3";
355 else
356 mode = "SKAS0";
357#endif
358
359 printf("UML running in %s mode\n", mode);
360
341 uml_start = CHOOSE_MODE_PROC(set_task_sizes_tt, set_task_sizes_skas, 0, 361 uml_start = CHOOSE_MODE_PROC(set_task_sizes_tt, set_task_sizes_skas, 0,
342 &host_task_size, &task_size); 362 &host_task_size, &task_size);
343 363
@@ -366,7 +386,7 @@ int linux_main(int argc, char **argv)
366 386
367 setup_machinename(system_utsname.machine); 387 setup_machinename(system_utsname.machine);
368 388
369#ifdef CONFIG_MODE_TT 389#ifdef CONFIG_CMDLINE_ON_HOST
370 argv1_begin = argv[1]; 390 argv1_begin = argv[1];
371 argv1_end = &argv[1][strlen(argv[1])]; 391 argv1_end = &argv[1][strlen(argv[1])];
372#endif 392#endif
@@ -451,7 +471,6 @@ void __init setup_arch(char **cmdline_p)
451void __init check_bugs(void) 471void __init check_bugs(void)
452{ 472{
453 arch_check_bugs(); 473 arch_check_bugs();
454 check_ptrace();
455 check_sigio(); 474 check_sigio();
456 check_devanon(); 475 check_devanon();
457} 476}
diff --git a/arch/um/kernel/uml.lds.S b/arch/um/kernel/uml.lds.S
index 163476a8cb1b..b03326d391c9 100644
--- a/arch/um/kernel/uml.lds.S
+++ b/arch/um/kernel/uml.lds.S
@@ -16,8 +16,8 @@ SECTIONS
16 __binary_start = .; 16 __binary_start = .;
17 17
18#ifdef MODE_TT 18#ifdef MODE_TT
19 .remap_data : { arch/um/sys-SUBARCH/unmap_fin.o (.data .bss) } 19 .remap_data : { UNMAP_PATH (.data .bss) }
20 .remap : { arch/um/sys-SUBARCH/unmap_fin.o (.text) } 20 .remap : { UNMAP_PATH (.text) }
21 21
22 . = ALIGN(4096); /* Init code and data */ 22 . = ALIGN(4096); /* Init code and data */
23#endif 23#endif
diff --git a/arch/um/os-Linux/Makefile b/arch/um/os-Linux/Makefile
index 4ddf540284ce..d3c1560e3ed8 100644
--- a/arch/um/os-Linux/Makefile
+++ b/arch/um/os-Linux/Makefile
@@ -3,11 +3,16 @@
3# Licensed under the GPL 3# Licensed under the GPL
4# 4#
5 5
6obj-y = elf_aux.o file.o process.o signal.o time.o tty.o user_syms.o drivers/ \ 6obj-y = aio.o elf_aux.o file.o process.o signal.o start_up.o time.o tt.o \
7 sys-$(SUBARCH)/ 7 tty.o user_syms.o drivers/ sys-$(SUBARCH)/
8 8
9USER_OBJS := elf_aux.o file.o process.o signal.o time.o tty.o 9USER_OBJS := aio.o elf_aux.o file.o process.o signal.o start_up.o time.o tt.o \
10 tty.o
10 11
11CFLAGS_user_syms.o += -DSUBARCH_$(SUBARCH) 12CFLAGS_user_syms.o += -DSUBARCH_$(SUBARCH)
12 13
14HAVE_AIO_ABI := $(shell [ -r /usr/include/linux/aio_abi.h ] && \
15 echo -DHAVE_AIO_ABI )
16CFLAGS_aio.o += $(HAVE_AIO_ABI)
17
13include arch/um/scripts/Makefile.rules 18include arch/um/scripts/Makefile.rules
diff --git a/arch/um/os-Linux/aio.c b/arch/um/os-Linux/aio.c
new file mode 100644
index 000000000000..b04897cd995d
--- /dev/null
+++ b/arch/um/os-Linux/aio.c
@@ -0,0 +1,414 @@
1/*
2 * Copyright (C) 2004 Jeff Dike (jdike@addtoit.com)
3 * Licensed under the GPL
4 */
5
6#include <stdlib.h>
7#include <unistd.h>
8#include <signal.h>
9#include <string.h>
10#include <errno.h>
11#include <sched.h>
12#include <sys/syscall.h>
13#include "os.h"
14#include "helper.h"
15#include "aio.h"
16#include "init.h"
17#include "user.h"
18#include "mode.h"
19
20static int aio_req_fd_r = -1;
21static int aio_req_fd_w = -1;
22
23static int update_aio(struct aio_context *aio, int res)
24{
25 if(res < 0)
26 aio->len = res;
27 else if((res == 0) && (aio->type == AIO_READ)){
28 /* This is the EOF case - we have hit the end of the file
29 * and it ends in a partial block, so we fill the end of
30 * the block with zeros and claim success.
31 */
32 memset(aio->data, 0, aio->len);
33 aio->len = 0;
34 }
35 else if(res > 0){
36 aio->len -= res;
37 aio->data += res;
38 aio->offset += res;
39 return aio->len;
40 }
41
42 return 0;
43}
44
45#if defined(HAVE_AIO_ABI)
46#include <linux/aio_abi.h>
47
48/* If we have the headers, we are going to build with AIO enabled.
49 * If we don't have aio in libc, we define the necessary stubs here.
50 */
51
52#if !defined(HAVE_AIO_LIBC)
53
54static long io_setup(int n, aio_context_t *ctxp)
55{
56 return syscall(__NR_io_setup, n, ctxp);
57}
58
59static long io_submit(aio_context_t ctx, long nr, struct iocb **iocbpp)
60{
61 return syscall(__NR_io_submit, ctx, nr, iocbpp);
62}
63
64static long io_getevents(aio_context_t ctx_id, long min_nr, long nr,
65 struct io_event *events, struct timespec *timeout)
66{
67 return syscall(__NR_io_getevents, ctx_id, min_nr, nr, events, timeout);
68}
69
70#endif
71
72/* The AIO_MMAP cases force the mmapped page into memory here
73 * rather than in whatever place first touches the data. I used
74 * to do this by touching the page, but that's delicate because
75 * gcc is prone to optimizing that away. So, what's done here
76 * is we read from the descriptor from which the page was
77 * mapped. The caller is required to pass an offset which is
78 * inside the page that was mapped. Thus, when the read
79 * returns, we know that the page is in the page cache, and
80 * that it now backs the mmapped area.
81 */
82
83static int do_aio(aio_context_t ctx, struct aio_context *aio)
84{
85 struct iocb iocb, *iocbp = &iocb;
86 char c;
87 int err;
88
89 iocb = ((struct iocb) { .aio_data = (unsigned long) aio,
90 .aio_reqprio = 0,
91 .aio_fildes = aio->fd,
92 .aio_buf = (unsigned long) aio->data,
93 .aio_nbytes = aio->len,
94 .aio_offset = aio->offset,
95 .aio_reserved1 = 0,
96 .aio_reserved2 = 0,
97 .aio_reserved3 = 0 });
98
99 switch(aio->type){
100 case AIO_READ:
101 iocb.aio_lio_opcode = IOCB_CMD_PREAD;
102 break;
103 case AIO_WRITE:
104 iocb.aio_lio_opcode = IOCB_CMD_PWRITE;
105 break;
106 case AIO_MMAP:
107 iocb.aio_lio_opcode = IOCB_CMD_PREAD;
108 iocb.aio_buf = (unsigned long) &c;
109 iocb.aio_nbytes = sizeof(c);
110 break;
111 default:
112 printk("Bogus op in do_aio - %d\n", aio->type);
113 err = -EINVAL;
114 goto out;
115 }
116
117 err = io_submit(ctx, 1, &iocbp);
118 if(err > 0)
119 err = 0;
120
121 out:
122 return err;
123}
124
125static aio_context_t ctx = 0;
126
127static int aio_thread(void *arg)
128{
129 struct aio_thread_reply reply;
130 struct aio_context *aio;
131 struct io_event event;
132 int err, n;
133
134 signal(SIGWINCH, SIG_IGN);
135
136 while(1){
137 n = io_getevents(ctx, 1, 1, &event, NULL);
138 if(n < 0){
139 if(errno == EINTR)
140 continue;
141 printk("aio_thread - io_getevents failed, "
142 "errno = %d\n", errno);
143 }
144 else {
145 aio = (struct aio_context *) event.data;
146 if(update_aio(aio, event.res)){
147 do_aio(ctx, aio);
148 continue;
149 }
150
151 reply = ((struct aio_thread_reply)
152 { .data = aio,
153 .err = aio->len });
154 err = os_write_file(aio->reply_fd, &reply,
155 sizeof(reply));
156 if(err != sizeof(reply))
157 printk("aio_thread - write failed, "
158 "fd = %d, err = %d\n", aio->reply_fd,
159 -err);
160 }
161 }
162 return 0;
163}
164
165#endif
166
167static int do_not_aio(struct aio_context *aio)
168{
169 char c;
170 int err;
171
172 switch(aio->type){
173 case AIO_READ:
174 err = os_seek_file(aio->fd, aio->offset);
175 if(err)
176 goto out;
177
178 err = os_read_file(aio->fd, aio->data, aio->len);
179 break;
180 case AIO_WRITE:
181 err = os_seek_file(aio->fd, aio->offset);
182 if(err)
183 goto out;
184
185 err = os_write_file(aio->fd, aio->data, aio->len);
186 break;
187 case AIO_MMAP:
188 err = os_seek_file(aio->fd, aio->offset);
189 if(err)
190 goto out;
191
192 err = os_read_file(aio->fd, &c, sizeof(c));
193 break;
194 default:
195 printk("do_not_aio - bad request type : %d\n", aio->type);
196 err = -EINVAL;
197 break;
198 }
199
200 out:
201 return err;
202}
203
204static int not_aio_thread(void *arg)
205{
206 struct aio_context *aio;
207 struct aio_thread_reply reply;
208 int err;
209
210 signal(SIGWINCH, SIG_IGN);
211 while(1){
212 err = os_read_file(aio_req_fd_r, &aio, sizeof(aio));
213 if(err != sizeof(aio)){
214 if(err < 0)
215 printk("not_aio_thread - read failed, "
216 "fd = %d, err = %d\n", aio_req_fd_r,
217 -err);
218 else {
219 printk("not_aio_thread - short read, fd = %d, "
220 "length = %d\n", aio_req_fd_r, err);
221 }
222 continue;
223 }
224 again:
225 err = do_not_aio(aio);
226
227 if(update_aio(aio, err))
228 goto again;
229
230 reply = ((struct aio_thread_reply) { .data = aio,
231 .err = aio->len });
232 err = os_write_file(aio->reply_fd, &reply, sizeof(reply));
233 if(err != sizeof(reply))
234 printk("not_aio_thread - write failed, fd = %d, "
235 "err = %d\n", aio_req_fd_r, -err);
236 }
237}
238
239static int submit_aio_24(struct aio_context *aio)
240{
241 int err;
242
243 err = os_write_file(aio_req_fd_w, &aio, sizeof(aio));
244 if(err == sizeof(aio))
245 err = 0;
246
247 return err;
248}
249
250static int aio_pid = -1;
251static int (*submit_proc)(struct aio_context *aio);
252
253static int init_aio_24(void)
254{
255 unsigned long stack;
256 int fds[2], err;
257
258 err = os_pipe(fds, 1, 1);
259 if(err)
260 goto out;
261
262 aio_req_fd_w = fds[0];
263 aio_req_fd_r = fds[1];
264 err = run_helper_thread(not_aio_thread, NULL,
265 CLONE_FILES | CLONE_VM | SIGCHLD, &stack, 0);
266 if(err < 0)
267 goto out_close_pipe;
268
269 aio_pid = err;
270 goto out;
271
272 out_close_pipe:
273 os_close_file(fds[0]);
274 os_close_file(fds[1]);
275 aio_req_fd_w = -1;
276 aio_req_fd_r = -1;
277 out:
278#ifndef HAVE_AIO_ABI
279 printk("/usr/include/linux/aio_abi.h not present during build\n");
280#endif
281 printk("2.6 host AIO support not used - falling back to I/O "
282 "thread\n");
283
284 submit_proc = submit_aio_24;
285
286 return 0;
287}
288
289#ifdef HAVE_AIO_ABI
290#define DEFAULT_24_AIO 0
291static int submit_aio_26(struct aio_context *aio)
292{
293 struct aio_thread_reply reply;
294 int err;
295
296 err = do_aio(ctx, aio);
297 if(err){
298 reply = ((struct aio_thread_reply) { .data = aio,
299 .err = err });
300 err = os_write_file(aio->reply_fd, &reply, sizeof(reply));
301 if(err != sizeof(reply))
302 printk("submit_aio_26 - write failed, "
303 "fd = %d, err = %d\n", aio->reply_fd, -err);
304 else err = 0;
305 }
306
307 return err;
308}
309
310static int init_aio_26(void)
311{
312 unsigned long stack;
313 int err;
314
315 if(io_setup(256, &ctx)){
316 printk("aio_thread failed to initialize context, err = %d\n",
317 errno);
318 return -errno;
319 }
320
321 err = run_helper_thread(aio_thread, NULL,
322 CLONE_FILES | CLONE_VM | SIGCHLD, &stack, 0);
323 if(err < 0)
324 return -errno;
325
326 aio_pid = err;
327
328 printk("Using 2.6 host AIO\n");
329
330 submit_proc = submit_aio_26;
331
332 return 0;
333}
334
335#else
336#define DEFAULT_24_AIO 1
337static int submit_aio_26(struct aio_context *aio)
338{
339 return -ENOSYS;
340}
341
342static int init_aio_26(void)
343{
344 submit_proc = submit_aio_26;
345 return -ENOSYS;
346}
347#endif
348
349static int aio_24 = DEFAULT_24_AIO;
350
351static int __init set_aio_24(char *name, int *add)
352{
353 aio_24 = 1;
354 return 0;
355}
356
357__uml_setup("aio=2.4", set_aio_24,
358"aio=2.4\n"
359" This is used to force UML to use 2.4-style AIO even when 2.6 AIO is\n"
360" available. 2.4 AIO is a single thread that handles one request at a\n"
361" time, synchronously. 2.6 AIO is a thread which uses the 2.6 AIO \n"
362" interface to handle an arbitrary number of pending requests. 2.6 AIO \n"
363" is not available in tt mode, on 2.4 hosts, or when UML is built with\n"
364" /usr/include/linux/aio_abi.h not available. Many distributions don't\n"
365" include aio_abi.h, so you will need to copy it from a kernel tree to\n"
366" your /usr/include/linux in order to build an AIO-capable UML\n\n"
367);
368
369static int init_aio(void)
370{
371 int err;
372
373 CHOOSE_MODE(({
374 if(!aio_24){
375 printk("Disabling 2.6 AIO in tt mode\n");
376 aio_24 = 1;
377 } }), (void) 0);
378
379 if(!aio_24){
380 err = init_aio_26();
381 if(err && (errno == ENOSYS)){
382 printk("2.6 AIO not supported on the host - "
383 "reverting to 2.4 AIO\n");
384 aio_24 = 1;
385 }
386 else return err;
387 }
388
389 if(aio_24)
390 return init_aio_24();
391
392 return 0;
393}
394
395/* The reason for the __initcall/__uml_exitcall asymmetry is that init_aio
396 * needs to be called when the kernel is running because it calls run_helper,
397 * which needs get_free_page. exit_aio is a __uml_exitcall because the generic
398 * kernel does not run __exitcalls on shutdown, and can't because many of them
399 * break when called outside of module unloading.
400 */
401__initcall(init_aio);
402
403static void exit_aio(void)
404{
405 if(aio_pid != -1)
406 os_kill_process(aio_pid, 1);
407}
408
409__uml_exitcall(exit_aio);
410
411int submit_aio(struct aio_context *aio)
412{
413 return (*submit_proc)(aio);
414}
diff --git a/arch/um/os-Linux/elf_aux.c b/arch/um/os-Linux/elf_aux.c
index f0d6060e3e57..4cca3e9c23fe 100644
--- a/arch/um/os-Linux/elf_aux.c
+++ b/arch/um/os-Linux/elf_aux.c
@@ -11,6 +11,7 @@
11#include <stddef.h> 11#include <stddef.h>
12#include "init.h" 12#include "init.h"
13#include "elf_user.h" 13#include "elf_user.h"
14#include "mem_user.h"
14 15
15#if ELF_CLASS == ELFCLASS32 16#if ELF_CLASS == ELFCLASS32
16typedef Elf32_auxv_t elf_auxv_t; 17typedef Elf32_auxv_t elf_auxv_t;
@@ -40,6 +41,9 @@ __init void scan_elf_aux( char **envp)
40 break; 41 break;
41 case AT_SYSINFO_EHDR: 42 case AT_SYSINFO_EHDR:
42 vsyscall_ehdr = auxv->a_un.a_val; 43 vsyscall_ehdr = auxv->a_un.a_val;
44 /* See if the page is under TASK_SIZE */
45 if (vsyscall_ehdr < (unsigned long) envp)
46 vsyscall_ehdr = 0;
43 break; 47 break;
44 case AT_HWCAP: 48 case AT_HWCAP:
45 elf_aux_hwcap = auxv->a_un.a_val; 49 elf_aux_hwcap = auxv->a_un.a_val;
diff --git a/arch/um/os-Linux/process.c b/arch/um/os-Linux/process.c
index 1e126bfd31a7..d32413e4b4ce 100644
--- a/arch/um/os-Linux/process.c
+++ b/arch/um/os-Linux/process.c
@@ -3,10 +3,10 @@
3 * Licensed under the GPL 3 * Licensed under the GPL
4 */ 4 */
5 5
6#include <unistd.h>
7#include <stdio.h> 6#include <stdio.h>
8#include <errno.h> 7#include <errno.h>
9#include <signal.h> 8#include <signal.h>
9#include <setjmp.h>
10#include <linux/unistd.h> 10#include <linux/unistd.h>
11#include <sys/mman.h> 11#include <sys/mman.h>
12#include <sys/wait.h> 12#include <sys/wait.h>
@@ -14,6 +14,10 @@
14#include "os.h" 14#include "os.h"
15#include "user.h" 15#include "user.h"
16#include "user_util.h" 16#include "user_util.h"
17#include "signal_user.h"
18#include "process.h"
19#include "irq_user.h"
20#include "kern_util.h"
17 21
18#define ARBITRARY_ADDR -1 22#define ARBITRARY_ADDR -1
19#define FAILURE_PID -1 23#define FAILURE_PID -1
@@ -114,8 +118,10 @@ void os_usr1_process(int pid)
114 kill(pid, SIGUSR1); 118 kill(pid, SIGUSR1);
115} 119}
116 120
117/*Don't use the glibc version, which caches the result in TLS. It misses some 121/* Don't use the glibc version, which caches the result in TLS. It misses some
118 * syscalls, and also breaks with clone(), which does not unshare the TLS.*/ 122 * syscalls, and also breaks with clone(), which does not unshare the TLS.
123 */
124
119inline _syscall0(pid_t, getpid) 125inline _syscall0(pid_t, getpid)
120 126
121int os_getpid(void) 127int os_getpid(void)
@@ -164,6 +170,52 @@ int os_unmap_memory(void *addr, int len)
164 return(0); 170 return(0);
165} 171}
166 172
173void init_new_thread_stack(void *sig_stack, void (*usr1_handler)(int))
174{
175 int flags = 0, pages;
176
177 if(sig_stack != NULL){
178 pages = (1 << UML_CONFIG_KERNEL_STACK_ORDER);
179 set_sigstack(sig_stack, pages * page_size());
180 flags = SA_ONSTACK;
181 }
182 if(usr1_handler) set_handler(SIGUSR1, usr1_handler, flags, -1);
183}
184
185void init_new_thread_signals(int altstack)
186{
187 int flags = altstack ? SA_ONSTACK : 0;
188
189 set_handler(SIGSEGV, (__sighandler_t) sig_handler, flags,
190 SIGUSR1, SIGIO, SIGWINCH, SIGALRM, SIGVTALRM, -1);
191 set_handler(SIGTRAP, (__sighandler_t) sig_handler, flags,
192 SIGUSR1, SIGIO, SIGWINCH, SIGALRM, SIGVTALRM, -1);
193 set_handler(SIGFPE, (__sighandler_t) sig_handler, flags,
194 SIGUSR1, SIGIO, SIGWINCH, SIGALRM, SIGVTALRM, -1);
195 set_handler(SIGILL, (__sighandler_t) sig_handler, flags,
196 SIGUSR1, SIGIO, SIGWINCH, SIGALRM, SIGVTALRM, -1);
197 set_handler(SIGBUS, (__sighandler_t) sig_handler, flags,
198 SIGUSR1, SIGIO, SIGWINCH, SIGALRM, SIGVTALRM, -1);
199 set_handler(SIGUSR2, (__sighandler_t) sig_handler,
200 flags, SIGUSR1, SIGIO, SIGWINCH, SIGALRM, SIGVTALRM, -1);
201 signal(SIGHUP, SIG_IGN);
202
203 init_irq_signals(altstack);
204}
205
206int run_kernel_thread(int (*fn)(void *), void *arg, void **jmp_ptr)
207{
208 sigjmp_buf buf;
209 int n;
210
211 *jmp_ptr = &buf;
212 n = sigsetjmp(buf, 1);
213 if(n != 0)
214 return(n);
215 (*fn)(arg);
216 return(0);
217}
218
167/* 219/*
168 * Overrides for Emacs so that we follow Linus's tabbing style. 220 * Overrides for Emacs so that we follow Linus's tabbing style.
169 * Emacs will notice this stuff at the end of the file and automatically 221 * Emacs will notice this stuff at the end of the file and automatically
diff --git a/arch/um/kernel/process.c b/arch/um/os-Linux/start_up.c
index c45a60e9c92d..040cc1472bc7 100644
--- a/arch/um/kernel/process.c
+++ b/arch/um/os-Linux/start_up.c
@@ -1,4 +1,4 @@
1/* 1/*
2 * Copyright (C) 2000, 2001, 2002 Jeff Dike (jdike@karaya.com) 2 * Copyright (C) 2000, 2001, 2002 Jeff Dike (jdike@karaya.com)
3 * Licensed under the GPL 3 * Licensed under the GPL
4 */ 4 */
@@ -19,7 +19,6 @@
19#include "user_util.h" 19#include "user_util.h"
20#include "kern_util.h" 20#include "kern_util.h"
21#include "user.h" 21#include "user.h"
22#include "process.h"
23#include "signal_kern.h" 22#include "signal_kern.h"
24#include "signal_user.h" 23#include "signal_user.h"
25#include "sysdep/ptrace.h" 24#include "sysdep/ptrace.h"
@@ -39,99 +38,7 @@
39#include "registers.h" 38#include "registers.h"
40#endif 39#endif
41 40
42void init_new_thread_stack(void *sig_stack, void (*usr1_handler)(int)) 41static int ptrace_child(void *arg)
43{
44 int flags = 0, pages;
45
46 if(sig_stack != NULL){
47 pages = (1 << UML_CONFIG_KERNEL_STACK_ORDER);
48 set_sigstack(sig_stack, pages * page_size());
49 flags = SA_ONSTACK;
50 }
51 if(usr1_handler) set_handler(SIGUSR1, usr1_handler, flags, -1);
52}
53
54void init_new_thread_signals(int altstack)
55{
56 int flags = altstack ? SA_ONSTACK : 0;
57
58 set_handler(SIGSEGV, (__sighandler_t) sig_handler, flags,
59 SIGUSR1, SIGIO, SIGWINCH, SIGALRM, SIGVTALRM, -1);
60 set_handler(SIGTRAP, (__sighandler_t) sig_handler, flags,
61 SIGUSR1, SIGIO, SIGWINCH, SIGALRM, SIGVTALRM, -1);
62 set_handler(SIGFPE, (__sighandler_t) sig_handler, flags,
63 SIGUSR1, SIGIO, SIGWINCH, SIGALRM, SIGVTALRM, -1);
64 set_handler(SIGILL, (__sighandler_t) sig_handler, flags,
65 SIGUSR1, SIGIO, SIGWINCH, SIGALRM, SIGVTALRM, -1);
66 set_handler(SIGBUS, (__sighandler_t) sig_handler, flags,
67 SIGUSR1, SIGIO, SIGWINCH, SIGALRM, SIGVTALRM, -1);
68 set_handler(SIGUSR2, (__sighandler_t) sig_handler,
69 flags, SIGUSR1, SIGIO, SIGWINCH, SIGALRM, SIGVTALRM, -1);
70 signal(SIGHUP, SIG_IGN);
71
72 init_irq_signals(altstack);
73}
74
75struct tramp {
76 int (*tramp)(void *);
77 void *tramp_data;
78 unsigned long temp_stack;
79 int flags;
80 int pid;
81};
82
83/* See above for why sigkill is here */
84
85int sigkill = SIGKILL;
86
87int outer_tramp(void *arg)
88{
89 struct tramp *t;
90 int sig = sigkill;
91
92 t = arg;
93 t->pid = clone(t->tramp, (void *) t->temp_stack + page_size()/2,
94 t->flags, t->tramp_data);
95 if(t->pid > 0) wait_for_stop(t->pid, SIGSTOP, PTRACE_CONT, NULL);
96 kill(os_getpid(), sig);
97 _exit(0);
98}
99
100int start_fork_tramp(void *thread_arg, unsigned long temp_stack,
101 int clone_flags, int (*tramp)(void *))
102{
103 struct tramp arg;
104 unsigned long sp;
105 int new_pid, status, err;
106
107 /* The trampoline will run on the temporary stack */
108 sp = stack_sp(temp_stack);
109
110 clone_flags |= CLONE_FILES | SIGCHLD;
111
112 arg.tramp = tramp;
113 arg.tramp_data = thread_arg;
114 arg.temp_stack = temp_stack;
115 arg.flags = clone_flags;
116
117 /* Start the process and wait for it to kill itself */
118 new_pid = clone(outer_tramp, (void *) sp, clone_flags, &arg);
119 if(new_pid < 0)
120 return(new_pid);
121
122 CATCH_EINTR(err = waitpid(new_pid, &status, 0));
123 if(err < 0)
124 panic("Waiting for outer trampoline failed - errno = %d",
125 errno);
126
127 if(!WIFSIGNALED(status) || (WTERMSIG(status) != SIGKILL))
128 panic("outer trampoline didn't exit with SIGKILL, "
129 "status = %d", status);
130
131 return(arg.pid);
132}
133
134static int ptrace_child(void)
135{ 42{
136 int ret; 43 int ret;
137 int pid = os_getpid(), ppid = getppid(); 44 int pid = os_getpid(), ppid = getppid();
@@ -160,36 +67,44 @@ static int ptrace_child(void)
160 _exit(ret); 67 _exit(ret);
161} 68}
162 69
163static int start_ptraced_child(void) 70static int start_ptraced_child(void **stack_out)
164{ 71{
72 void *stack;
73 unsigned long sp;
165 int pid, n, status; 74 int pid, n, status;
166
167 pid = fork();
168 if(pid == 0)
169 ptrace_child();
170 75
76 stack = mmap(NULL, PAGE_SIZE, PROT_READ | PROT_WRITE | PROT_EXEC,
77 MAP_PRIVATE | MAP_ANONYMOUS, -1, 0);
78 if(stack == MAP_FAILED)
79 panic("check_ptrace : mmap failed, errno = %d", errno);
80 sp = (unsigned long) stack + PAGE_SIZE - sizeof(void *);
81 pid = clone(ptrace_child, (void *) sp, SIGCHLD, NULL);
171 if(pid < 0) 82 if(pid < 0)
172 panic("check_ptrace : fork failed, errno = %d", errno); 83 panic("start_ptraced_child : clone failed, errno = %d", errno);
173 CATCH_EINTR(n = waitpid(pid, &status, WUNTRACED)); 84 CATCH_EINTR(n = waitpid(pid, &status, WUNTRACED));
174 if(n < 0) 85 if(n < 0)
175 panic("check_ptrace : wait failed, errno = %d", errno); 86 panic("check_ptrace : clone failed, errno = %d", errno);
176 if(!WIFSTOPPED(status) || (WSTOPSIG(status) != SIGSTOP)) 87 if(!WIFSTOPPED(status) || (WSTOPSIG(status) != SIGSTOP))
177 panic("check_ptrace : expected SIGSTOP, got status = %d", 88 panic("check_ptrace : expected SIGSTOP, got status = %d",
178 status); 89 status);
179 90
91 *stack_out = stack;
180 return(pid); 92 return(pid);
181} 93}
182 94
183/* When testing for SYSEMU support, if it is one of the broken versions, we must 95/* When testing for SYSEMU support, if it is one of the broken versions, we
184 * just avoid using sysemu, not panic, but only if SYSEMU features are broken. 96 * must just avoid using sysemu, not panic, but only if SYSEMU features are
97 * broken.
185 * So only for SYSEMU features we test mustpanic, while normal host features 98 * So only for SYSEMU features we test mustpanic, while normal host features
186 * must work anyway!*/ 99 * must work anyway!
187static int stop_ptraced_child(int pid, int exitcode, int mustexit) 100 */
101static int stop_ptraced_child(int pid, void *stack, int exitcode,
102 int mustpanic)
188{ 103{
189 int status, n, ret = 0; 104 int status, n, ret = 0;
190 105
191 if(ptrace(PTRACE_CONT, pid, 0, 0) < 0) 106 if(ptrace(PTRACE_CONT, pid, 0, 0) < 0)
192 panic("stop_ptraced_child : ptrace failed, errno = %d", errno); 107 panic("check_ptrace : ptrace failed, errno = %d", errno);
193 CATCH_EINTR(n = waitpid(pid, &status, 0)); 108 CATCH_EINTR(n = waitpid(pid, &status, 0));
194 if(!WIFEXITED(status) || (WEXITSTATUS(status) != exitcode)) { 109 if(!WIFEXITED(status) || (WEXITSTATUS(status) != exitcode)) {
195 int exit_with = WEXITSTATUS(status); 110 int exit_with = WEXITSTATUS(status);
@@ -200,16 +115,32 @@ static int stop_ptraced_child(int pid, int exitcode, int mustexit)
200 printk("check_ptrace : child exited with exitcode %d, while " 115 printk("check_ptrace : child exited with exitcode %d, while "
201 "expecting %d; status 0x%x", exit_with, 116 "expecting %d; status 0x%x", exit_with,
202 exitcode, status); 117 exitcode, status);
203 if (mustexit) 118 if (mustpanic)
204 panic("\n"); 119 panic("\n");
205 else 120 else
206 printk("\n"); 121 printk("\n");
207 ret = -1; 122 ret = -1;
208 } 123 }
209 124
125 if(munmap(stack, PAGE_SIZE) < 0)
126 panic("check_ptrace : munmap failed, errno = %d", errno);
210 return ret; 127 return ret;
211} 128}
212 129
130int ptrace_faultinfo = 1;
131int proc_mm = 1;
132
133static int __init skas0_cmd_param(char *str, int* add)
134{
135 ptrace_faultinfo = proc_mm = 0;
136 return 0;
137}
138
139__uml_setup("skas0", skas0_cmd_param,
140 "skas0\n"
141 " Disables SKAS3 usage, so that SKAS0 is used, unless \n"
142 " you specify mode=tt.\n\n");
143
213static int force_sysemu_disabled = 0; 144static int force_sysemu_disabled = 0;
214 145
215static int __init nosysemu_cmd_param(char *str, int* add) 146static int __init nosysemu_cmd_param(char *str, int* add)
@@ -219,20 +150,22 @@ static int __init nosysemu_cmd_param(char *str, int* add)
219} 150}
220 151
221__uml_setup("nosysemu", nosysemu_cmd_param, 152__uml_setup("nosysemu", nosysemu_cmd_param,
222 "nosysemu\n" 153"nosysemu\n"
223 " Turns off syscall emulation patch for ptrace (SYSEMU) on.\n" 154" Turns off syscall emulation patch for ptrace (SYSEMU) on.\n"
224 " SYSEMU is a performance-patch introduced by Laurent Vivier. It changes\n" 155" SYSEMU is a performance-patch introduced by Laurent Vivier. It changes\n"
225 " behaviour of ptrace() and helps reducing host context switch rate.\n" 156" behaviour of ptrace() and helps reducing host context switch rate.\n"
226 " To make it working, you need a kernel patch for your host, too.\n" 157" To make it working, you need a kernel patch for your host, too.\n"
227 " See http://perso.wanadoo.fr/laurent.vivier/UML/ for further information.\n\n"); 158" See http://perso.wanadoo.fr/laurent.vivier/UML/ for further \n"
159" information.\n\n");
228 160
229static void __init check_sysemu(void) 161static void __init check_sysemu(void)
230{ 162{
231 int pid, syscall, n, status, count=0; 163 void *stack;
164 int pid, n, status, count=0;
232 165
233 printk("Checking syscall emulation patch for ptrace..."); 166 printk("Checking syscall emulation patch for ptrace...");
234 sysemu_supported = 0; 167 sysemu_supported = 0;
235 pid = start_ptraced_child(); 168 pid = start_ptraced_child(&stack);
236 169
237 if(ptrace(PTRACE_SYSEMU, pid, 0, 0) < 0) 170 if(ptrace(PTRACE_SYSEMU, pid, 0, 0) < 0)
238 goto fail; 171 goto fail;
@@ -250,7 +183,7 @@ static void __init check_sysemu(void)
250 panic("check_sysemu : failed to modify system " 183 panic("check_sysemu : failed to modify system "
251 "call return, errno = %d", errno); 184 "call return, errno = %d", errno);
252 185
253 if (stop_ptraced_child(pid, 0, 0) < 0) 186 if (stop_ptraced_child(pid, stack, 0, 0) < 0)
254 goto fail_stopped; 187 goto fail_stopped;
255 188
256 sysemu_supported = 1; 189 sysemu_supported = 1;
@@ -258,7 +191,13 @@ static void __init check_sysemu(void)
258 set_using_sysemu(!force_sysemu_disabled); 191 set_using_sysemu(!force_sysemu_disabled);
259 192
260 printk("Checking advanced syscall emulation patch for ptrace..."); 193 printk("Checking advanced syscall emulation patch for ptrace...");
261 pid = start_ptraced_child(); 194 pid = start_ptraced_child(&stack);
195
196 if(ptrace(PTRACE_OLDSETOPTIONS, pid, 0,
197 (void *) PTRACE_O_TRACESYSGOOD) < 0)
198 panic("check_ptrace: PTRACE_OLDSETOPTIONS failed, errno = %d",
199 errno);
200
262 while(1){ 201 while(1){
263 count++; 202 count++;
264 if(ptrace(PTRACE_SYSEMU_SINGLESTEP, pid, 0, 0) < 0) 203 if(ptrace(PTRACE_SYSEMU_SINGLESTEP, pid, 0, 0) < 0)
@@ -266,15 +205,10 @@ static void __init check_sysemu(void)
266 CATCH_EINTR(n = waitpid(pid, &status, WUNTRACED)); 205 CATCH_EINTR(n = waitpid(pid, &status, WUNTRACED));
267 if(n < 0) 206 if(n < 0)
268 panic("check_ptrace : wait failed, errno = %d", errno); 207 panic("check_ptrace : wait failed, errno = %d", errno);
269 if(!WIFSTOPPED(status) || (WSTOPSIG(status) != SIGTRAP)) 208 if(WIFSTOPPED(status) && (WSTOPSIG(status) == (SIGTRAP|0x80))){
270 panic("check_ptrace : expected (SIGTRAP|SYSCALL_TRAP), "
271 "got status = %d", status);
272
273 syscall = ptrace(PTRACE_PEEKUSR, pid, PT_SYSCALL_NR_OFFSET,
274 0);
275 if(syscall == __NR_getpid){
276 if (!count) 209 if (!count)
277 panic("check_ptrace : SYSEMU_SINGLESTEP doesn't singlestep"); 210 panic("check_ptrace : SYSEMU_SINGLESTEP "
211 "doesn't singlestep");
278 n = ptrace(PTRACE_POKEUSR, pid, PT_SYSCALL_RET_OFFSET, 212 n = ptrace(PTRACE_POKEUSR, pid, PT_SYSCALL_RET_OFFSET,
279 os_getpid()); 213 os_getpid());
280 if(n < 0) 214 if(n < 0)
@@ -282,8 +216,13 @@ static void __init check_sysemu(void)
282 "call return, errno = %d", errno); 216 "call return, errno = %d", errno);
283 break; 217 break;
284 } 218 }
219 else if(WIFSTOPPED(status) && (WSTOPSIG(status) == SIGTRAP))
220 count++;
221 else
222 panic("check_ptrace : expected SIGTRAP or "
223 "(SIGTRAP|0x80), got status = %d", status);
285 } 224 }
286 if (stop_ptraced_child(pid, 0, 0) < 0) 225 if (stop_ptraced_child(pid, stack, 0, 0) < 0)
287 goto fail_stopped; 226 goto fail_stopped;
288 227
289 sysemu_supported = 2; 228 sysemu_supported = 2;
@@ -294,32 +233,33 @@ static void __init check_sysemu(void)
294 return; 233 return;
295 234
296fail: 235fail:
297 stop_ptraced_child(pid, 1, 0); 236 stop_ptraced_child(pid, stack, 1, 0);
298fail_stopped: 237fail_stopped:
299 printk("missing\n"); 238 printk("missing\n");
300} 239}
301 240
302void __init check_ptrace(void) 241static void __init check_ptrace(void)
303{ 242{
243 void *stack;
304 int pid, syscall, n, status; 244 int pid, syscall, n, status;
305 245
306 printk("Checking that ptrace can change system call numbers..."); 246 printk("Checking that ptrace can change system call numbers...");
307 pid = start_ptraced_child(); 247 pid = start_ptraced_child(&stack);
308 248
309 if (ptrace(PTRACE_OLDSETOPTIONS, pid, 0, (void *)PTRACE_O_TRACESYSGOOD) < 0) 249 if(ptrace(PTRACE_OLDSETOPTIONS, pid, 0, (void *)PTRACE_O_TRACESYSGOOD) < 0)
310 panic("check_ptrace: PTRACE_SETOPTIONS failed, errno = %d", errno); 250 panic("check_ptrace: PTRACE_OLDSETOPTIONS failed, errno = %d", errno);
311 251
312 while(1){ 252 while(1){
313 if(ptrace(PTRACE_SYSCALL, pid, 0, 0) < 0) 253 if(ptrace(PTRACE_SYSCALL, pid, 0, 0) < 0)
314 panic("check_ptrace : ptrace failed, errno = %d", 254 panic("check_ptrace : ptrace failed, errno = %d",
315 errno); 255 errno);
316 CATCH_EINTR(n = waitpid(pid, &status, WUNTRACED)); 256 CATCH_EINTR(n = waitpid(pid, &status, WUNTRACED));
317 if(n < 0) 257 if(n < 0)
318 panic("check_ptrace : wait failed, errno = %d", errno); 258 panic("check_ptrace : wait failed, errno = %d", errno);
319 if(!WIFSTOPPED(status) || (WSTOPSIG(status) != SIGTRAP + 0x80)) 259 if(!WIFSTOPPED(status) || (WSTOPSIG(status) != (SIGTRAP|0x80)))
320 panic("check_ptrace : expected SIGTRAP + 0x80, " 260 panic("check_ptrace : expected (SIGTRAP|0x80), "
321 "got status = %d", status); 261 "got status = %d", status);
322 262
323 syscall = ptrace(PTRACE_PEEKUSR, pid, PT_SYSCALL_NR_OFFSET, 263 syscall = ptrace(PTRACE_PEEKUSR, pid, PT_SYSCALL_NR_OFFSET,
324 0); 264 0);
325 if(syscall == __NR_getpid){ 265 if(syscall == __NR_getpid){
@@ -331,78 +271,83 @@ void __init check_ptrace(void)
331 break; 271 break;
332 } 272 }
333 } 273 }
334 stop_ptraced_child(pid, 0, 1); 274 stop_ptraced_child(pid, stack, 0, 1);
335 printk("OK\n"); 275 printk("OK\n");
336 check_sysemu(); 276 check_sysemu();
337} 277}
338 278
339int run_kernel_thread(int (*fn)(void *), void *arg, void **jmp_ptr) 279void os_early_checks(void)
340{ 280{
341 sigjmp_buf buf; 281 check_ptrace();
342 int n;
343
344 *jmp_ptr = &buf;
345 n = sigsetjmp(buf, 1);
346 if(n != 0)
347 return(n);
348 (*fn)(arg);
349 return(0);
350} 282}
351 283
352void forward_pending_sigio(int target) 284static int __init noprocmm_cmd_param(char *str, int* add)
353{ 285{
354 sigset_t sigs; 286 proc_mm = 0;
355 287 return 0;
356 if(sigpending(&sigs))
357 panic("forward_pending_sigio : sigpending failed");
358 if(sigismember(&sigs, SIGIO))
359 kill(target, SIGIO);
360} 288}
361 289
362int ptrace_faultinfo = 0; 290__uml_setup("noprocmm", noprocmm_cmd_param,
363int proc_mm = 1; 291"noprocmm\n"
292" Turns off usage of /proc/mm, even if host supports it.\n"
293" To support /proc/mm, the host needs to be patched using\n"
294" the current skas3 patch.\n\n");
295
296static int __init noptracefaultinfo_cmd_param(char *str, int* add)
297{
298 ptrace_faultinfo = 0;
299 return 0;
300}
364 301
365extern void *__syscall_stub_start, __syscall_stub_end; 302__uml_setup("noptracefaultinfo", noptracefaultinfo_cmd_param,
303"noptracefaultinfo\n"
304" Turns off usage of PTRACE_FAULTINFO, even if host supports\n"
305" it. To support PTRACE_FAULTINFO, the host needs to be patched\n"
306" using the current skas3 patch.\n\n");
366 307
367#ifdef UML_CONFIG_MODE_SKAS 308#ifdef UML_CONFIG_MODE_SKAS
368static inline void check_skas3_ptrace_support(void) 309static inline void check_skas3_ptrace_support(void)
369{ 310{
370 struct ptrace_faultinfo fi; 311 struct ptrace_faultinfo fi;
312 void *stack;
371 int pid, n; 313 int pid, n;
372 314
373 printf("Checking for the skas3 patch in the host..."); 315 printf("Checking for the skas3 patch in the host...");
374 pid = start_ptraced_child(); 316 pid = start_ptraced_child(&stack);
375 317
376 n = ptrace(PTRACE_FAULTINFO, pid, 0, &fi); 318 n = ptrace(PTRACE_FAULTINFO, pid, 0, &fi);
377 if (n < 0) { 319 if (n < 0) {
320 ptrace_faultinfo = 0;
378 if(errno == EIO) 321 if(errno == EIO)
379 printf("not found\n"); 322 printf("not found\n");
380 else { 323 else
381 perror("not found"); 324 perror("not found");
382 }
383 } 325 }
384 else { 326 else {
385 ptrace_faultinfo = 1; 327 if (!ptrace_faultinfo)
386 printf("found\n"); 328 printf("found but disabled on command line\n");
329 else
330 printf("found\n");
387 } 331 }
388 332
389 init_registers(pid); 333 init_registers(pid);
390 stop_ptraced_child(pid, 1, 1); 334 stop_ptraced_child(pid, stack, 1, 1);
391} 335}
392 336
393int can_do_skas(void) 337int can_do_skas(void)
394{ 338{
395 printf("Checking for /proc/mm..."); 339 printf("Checking for /proc/mm...");
396 if (os_access("/proc/mm", OS_ACC_W_OK) < 0) { 340 if (os_access("/proc/mm", OS_ACC_W_OK) < 0) {
397 proc_mm = 0; 341 proc_mm = 0;
398 printf("not found\n"); 342 printf("not found\n");
399 goto out;
400 } 343 }
401 else { 344 else {
402 printf("found\n"); 345 if (!proc_mm)
346 printf("found but disabled on command line\n");
347 else
348 printf("found\n");
403 } 349 }
404 350
405out:
406 check_skas3_ptrace_support(); 351 check_skas3_ptrace_support();
407 return 1; 352 return 1;
408} 353}
diff --git a/arch/um/os-Linux/tt.c b/arch/um/os-Linux/tt.c
new file mode 100644
index 000000000000..5b047ab8416a
--- /dev/null
+++ b/arch/um/os-Linux/tt.c
@@ -0,0 +1,113 @@
1/*
2 * Copyright (C) 2000, 2001, 2002 Jeff Dike (jdike@karaya.com)
3 * Licensed under the GPL
4 */
5
6#include <stdio.h>
7#include <unistd.h>
8#include <signal.h>
9#include <sched.h>
10#include <errno.h>
11#include <stdarg.h>
12#include <stdlib.h>
13#include <setjmp.h>
14#include <sys/time.h>
15#include <sys/ptrace.h>
16#include <linux/ptrace.h>
17#include <sys/wait.h>
18#include <sys/mman.h>
19#include <asm/ptrace.h>
20#include <asm/unistd.h>
21#include <asm/page.h>
22#include "user_util.h"
23#include "kern_util.h"
24#include "user.h"
25#include "signal_kern.h"
26#include "signal_user.h"
27#include "sysdep/ptrace.h"
28#include "sysdep/sigcontext.h"
29#include "irq_user.h"
30#include "ptrace_user.h"
31#include "time_user.h"
32#include "init.h"
33#include "os.h"
34#include "uml-config.h"
35#include "choose-mode.h"
36#include "mode.h"
37#include "tempfile.h"
38
39/*
40 *-------------------------
41 * only for tt mode (will be deleted in future...)
42 *-------------------------
43 */
44
45struct tramp {
46 int (*tramp)(void *);
47 void *tramp_data;
48 unsigned long temp_stack;
49 int flags;
50 int pid;
51};
52
53/* See above for why sigkill is here */
54
55int sigkill = SIGKILL;
56
57int outer_tramp(void *arg)
58{
59 struct tramp *t;
60 int sig = sigkill;
61
62 t = arg;
63 t->pid = clone(t->tramp, (void *) t->temp_stack + page_size()/2,
64 t->flags, t->tramp_data);
65 if(t->pid > 0) wait_for_stop(t->pid, SIGSTOP, PTRACE_CONT, NULL);
66 kill(os_getpid(), sig);
67 _exit(0);
68}
69
70int start_fork_tramp(void *thread_arg, unsigned long temp_stack,
71 int clone_flags, int (*tramp)(void *))
72{
73 struct tramp arg;
74 unsigned long sp;
75 int new_pid, status, err;
76
77 /* The trampoline will run on the temporary stack */
78 sp = stack_sp(temp_stack);
79
80 clone_flags |= CLONE_FILES | SIGCHLD;
81
82 arg.tramp = tramp;
83 arg.tramp_data = thread_arg;
84 arg.temp_stack = temp_stack;
85 arg.flags = clone_flags;
86
87 /* Start the process and wait for it to kill itself */
88 new_pid = clone(outer_tramp, (void *) sp, clone_flags, &arg);
89 if(new_pid < 0)
90 return(new_pid);
91
92 CATCH_EINTR(err = waitpid(new_pid, &status, 0));
93 if(err < 0)
94 panic("Waiting for outer trampoline failed - errno = %d",
95 errno);
96
97 if(!WIFSIGNALED(status) || (WTERMSIG(status) != SIGKILL))
98 panic("outer trampoline didn't exit with SIGKILL, "
99 "status = %d", status);
100
101 return(arg.pid);
102}
103
104void forward_pending_sigio(int target)
105{
106 sigset_t sigs;
107
108 if(sigpending(&sigs))
109 panic("forward_pending_sigio : sigpending failed");
110 if(sigismember(&sigs, SIGIO))
111 kill(target, SIGIO);
112}
113
diff --git a/arch/um/os-Linux/user_syms.c b/arch/um/os-Linux/user_syms.c
index 75d7af9ae1d2..56d3f870926b 100644
--- a/arch/um/os-Linux/user_syms.c
+++ b/arch/um/os-Linux/user_syms.c
@@ -83,6 +83,9 @@ EXPORT_SYMBOL_PROTO(statfs64);
83 83
84EXPORT_SYMBOL_PROTO(getuid); 84EXPORT_SYMBOL_PROTO(getuid);
85 85
86EXPORT_SYMBOL_PROTO(fsync);
87EXPORT_SYMBOL_PROTO(fdatasync);
88
86/* 89/*
87 * Overrides for Emacs so that we follow Linus's tabbing style. 90 * Overrides for Emacs so that we follow Linus's tabbing style.
88 * Emacs will notice this stuff at the end of the file and automatically 91 * Emacs will notice this stuff at the end of the file and automatically
diff --git a/arch/um/scripts/Makefile.unmap b/arch/um/scripts/Makefile.unmap
index 37a8f9765295..b2165188d942 100644
--- a/arch/um/scripts/Makefile.unmap
+++ b/arch/um/scripts/Makefile.unmap
@@ -12,8 +12,8 @@ $(obj)/unmap.o: _c_flags = $(call unprofile,$(CFLAGS))
12 12
13quiet_cmd_wrapld = LD $@ 13quiet_cmd_wrapld = LD $@
14define cmd_wrapld 14define cmd_wrapld
15 $(LD) -r -o $(obj)/unmap_tmp.o $< $(shell $(CC) -print-file-name=libc.a); \ 15 $(LD) $(LDFLAGS) -r -o $(obj)/unmap_tmp.o $< ; \
16 $(OBJCOPY) $(obj)/unmap_tmp.o $@ -G switcheroo 16 $(OBJCOPY) $(UML_OBJCOPYFLAGS) $(obj)/unmap_tmp.o $@ -G switcheroo
17endef 17endef
18 18
19$(obj)/unmap_fin.o : $(obj)/unmap.o FORCE 19$(obj)/unmap_fin.o : $(obj)/unmap.o FORCE
diff --git a/arch/um/sys-i386/Makefile b/arch/um/sys-i386/Makefile
index 77c3c4d29f55..4ca2a229da49 100644
--- a/arch/um/sys-i386/Makefile
+++ b/arch/um/sys-i386/Makefile
@@ -16,13 +16,7 @@ semaphore.c-dir = kernel
16highmem.c-dir = mm 16highmem.c-dir = mm
17module.c-dir = kernel 17module.c-dir = kernel
18 18
19STUB_CFLAGS = -Wp,-MD,$(depfile) $(call unprofile,$(USER_CFLAGS)) 19$(obj)/stub_segv.o : _c_flags = $(call unprofile,$(CFLAGS))
20
21# _cflags works with kernel files, not with userspace ones, but c_flags does,
22# why ask why?
23$(obj)/stub_segv.o : c_flags = $(STUB_CFLAGS)
24
25$(obj)/stub.o : a_flags = $(STUB_CFLAGS)
26 20
27subdir- := util 21subdir- := util
28 22
diff --git a/arch/um/sys-i386/ldt.c b/arch/um/sys-i386/ldt.c
index dc755b0b9db8..bd3c34aa52e5 100644
--- a/arch/um/sys-i386/ldt.c
+++ b/arch/um/sys-i386/ldt.c
@@ -4,96 +4,106 @@
4 */ 4 */
5 5
6#include "linux/config.h" 6#include "linux/config.h"
7#include "linux/sched.h"
7#include "linux/slab.h" 8#include "linux/slab.h"
9#include "linux/types.h"
8#include "asm/uaccess.h" 10#include "asm/uaccess.h"
9#include "asm/ptrace.h" 11#include "asm/ptrace.h"
12#include "asm/smp.h"
13#include "asm/ldt.h"
10#include "choose-mode.h" 14#include "choose-mode.h"
11#include "kern.h" 15#include "kern.h"
16#include "mode_kern.h"
12 17
13#ifdef CONFIG_MODE_TT 18#ifdef CONFIG_MODE_TT
14extern int modify_ldt(int func, void *ptr, unsigned long bytecount);
15 19
16/* XXX this needs copy_to_user and copy_from_user */ 20extern int modify_ldt(int func, void *ptr, unsigned long bytecount);
17 21
18int sys_modify_ldt_tt(int func, void __user *ptr, unsigned long bytecount) 22static int do_modify_ldt_tt(int func, void *ptr, unsigned long bytecount)
19{ 23{
20 if (!access_ok(VERIFY_READ, ptr, bytecount))
21 return -EFAULT;
22
23 return modify_ldt(func, ptr, bytecount); 24 return modify_ldt(func, ptr, bytecount);
24} 25}
26
25#endif 27#endif
26 28
27#ifdef CONFIG_MODE_SKAS 29#ifdef CONFIG_MODE_SKAS
28extern int userspace_pid[];
29 30
31#include "skas.h"
30#include "skas_ptrace.h" 32#include "skas_ptrace.h"
31 33
32int sys_modify_ldt_skas(int func, void __user *ptr, unsigned long bytecount) 34static int do_modify_ldt_skas(int func, void *ptr, unsigned long bytecount)
33{ 35{
34 struct ptrace_ldt ldt; 36 struct ptrace_ldt ldt;
35 void *buf; 37 u32 cpu;
36 int res, n; 38 int res;
37 39
38 buf = kmalloc(bytecount, GFP_KERNEL); 40 ldt = ((struct ptrace_ldt) { .func = func,
39 if(buf == NULL) 41 .ptr = ptr,
40 return(-ENOMEM); 42 .bytecount = bytecount });
41 43
42 res = 0; 44 cpu = get_cpu();
45 res = ptrace(PTRACE_LDT, userspace_pid[cpu], 0, (unsigned long) &ldt);
46 put_cpu();
47
48 return res;
49}
50#endif
51
52int sys_modify_ldt(int func, void __user *ptr, unsigned long bytecount)
53{
54 struct user_desc info;
55 int res = 0;
56 void *buf = NULL;
57 void *p = NULL; /* What we pass to host. */
43 58
44 switch(func){ 59 switch(func){
45 case 1: 60 case 1:
46 case 0x11: 61 case 0x11: /* write_ldt */
47 res = copy_from_user(buf, ptr, bytecount); 62 /* Do this check now to avoid overflows. */
48 break; 63 if (bytecount != sizeof(struct user_desc)) {
49 } 64 res = -EINVAL;
65 goto out;
66 }
67
68 if(copy_from_user(&info, ptr, sizeof(info))) {
69 res = -EFAULT;
70 goto out;
71 }
50 72
51 if(res != 0){ 73 p = &info;
52 res = -EFAULT; 74 break;
75 case 0:
76 case 2: /* read_ldt */
77
78 /* The use of info avoids kmalloc on the write case, not on the
79 * read one. */
80 buf = kmalloc(bytecount, GFP_KERNEL);
81 if (!buf) {
82 res = -ENOMEM;
83 goto out;
84 }
85 p = buf;
86 default:
87 res = -ENOSYS;
53 goto out; 88 goto out;
54 } 89 }
55 90
56 ldt = ((struct ptrace_ldt) { .func = func, 91 res = CHOOSE_MODE_PROC(do_modify_ldt_tt, do_modify_ldt_skas, func,
57 .ptr = buf, 92 p, bytecount);
58 .bytecount = bytecount });
59#warning Need to look up userspace_pid by cpu
60 res = ptrace(PTRACE_LDT, userspace_pid[0], 0, (unsigned long) &ldt);
61 if(res < 0) 93 if(res < 0)
62 goto out; 94 goto out;
63 95
64 switch(func){ 96 switch(func){
65 case 0: 97 case 0:
66 case 2: 98 case 2:
67 n = res; 99 /* Modify_ldt was for reading and returned the number of read
68 res = copy_to_user(ptr, buf, n); 100 * bytes.*/
69 if(res != 0) 101 if(copy_to_user(ptr, p, res))
70 res = -EFAULT; 102 res = -EFAULT;
71 else
72 res = n;
73 break; 103 break;
74 } 104 }
75 105
76 out: 106out:
77 kfree(buf); 107 kfree(buf);
78 return(res); 108 return res;
79}
80#endif
81
82int sys_modify_ldt(int func, void __user *ptr, unsigned long bytecount)
83{
84 return(CHOOSE_MODE_PROC(sys_modify_ldt_tt, sys_modify_ldt_skas, func,
85 ptr, bytecount));
86} 109}
87
88
89
90/*
91 * Overrides for Emacs so that we follow Linus's tabbing style.
92 * Emacs will notice this stuff at the end of the file and automatically
93 * adjust the settings for this buffer only. This must remain at the end
94 * of the file.
95 * ---------------------------------------------------------------------------
96 * Local variables:
97 * c-file-style: "linux"
98 * End:
99 */
diff --git a/arch/um/sys-i386/signal.c b/arch/um/sys-i386/signal.c
index 4efc69a039d7..16bc19928b3c 100644
--- a/arch/um/sys-i386/signal.c
+++ b/arch/um/sys-i386/signal.c
@@ -122,9 +122,9 @@ int copy_sc_from_user_tt(struct sigcontext *to, struct sigcontext *from,
122 int err; 122 int err;
123 123
124 to_fp = to->fpstate; 124 to_fp = to->fpstate;
125 from_fp = from->fpstate;
126 sigs = to->oldmask; 125 sigs = to->oldmask;
127 err = copy_from_user(to, from, sizeof(*to)); 126 err = copy_from_user(to, from, sizeof(*to));
127 from_fp = to->fpstate;
128 to->oldmask = sigs; 128 to->oldmask = sigs;
129 to->fpstate = to_fp; 129 to->fpstate = to_fp;
130 if(to_fp != NULL) 130 if(to_fp != NULL)
diff --git a/arch/um/sys-i386/stub.S b/arch/um/sys-i386/stub.S
index 2f2c70a8f043..6a70d9ab5c29 100644
--- a/arch/um/sys-i386/stub.S
+++ b/arch/um/sys-i386/stub.S
@@ -2,7 +2,50 @@
2 2
3 .globl syscall_stub 3 .globl syscall_stub
4.section .__syscall_stub, "x" 4.section .__syscall_stub, "x"
5syscall_stub: 5
6 int $0x80 6 .globl batch_syscall_stub
7batch_syscall_stub:
8 /* load pointer to first operation */
9 mov $(UML_CONFIG_STUB_DATA+8), %esp
10
11again:
12 /* load length of additional data */
13 mov 0x0(%esp), %eax
14
15 /* if(length == 0) : end of list */
16 /* write possible 0 to header */
17 mov %eax, UML_CONFIG_STUB_DATA+4
18 cmpl $0, %eax
19 jz done
20
21 /* save current pointer */
22 mov %esp, UML_CONFIG_STUB_DATA+4
23
24 /* skip additional data */
25 add %eax, %esp
26
27 /* load syscall-# */
28 pop %eax
29
30 /* load syscall params */
31 pop %ebx
32 pop %ecx
33 pop %edx
34 pop %esi
35 pop %edi
36 pop %ebp
37
38 /* execute syscall */
39 int $0x80
40
41 /* check return value */
42 pop %ebx
43 cmp %ebx, %eax
44 je again
45
46done:
47 /* save return value */
7 mov %eax, UML_CONFIG_STUB_DATA 48 mov %eax, UML_CONFIG_STUB_DATA
49
50 /* stop */
8 int3 51 int3
diff --git a/arch/um/sys-i386/stub_segv.c b/arch/um/sys-i386/stub_segv.c
index b251442ad0b1..1e88b275edac 100644
--- a/arch/um/sys-i386/stub_segv.c
+++ b/arch/um/sys-i386/stub_segv.c
@@ -3,8 +3,7 @@
3 * Licensed under the GPL 3 * Licensed under the GPL
4 */ 4 */
5 5
6#include <signal.h> 6#include <asm/signal.h>
7#include <asm/sigcontext.h>
8#include <asm/unistd.h> 7#include <asm/unistd.h>
9#include "uml-config.h" 8#include "uml-config.h"
10#include "sysdep/sigcontext.h" 9#include "sysdep/sigcontext.h"
@@ -21,10 +20,10 @@ stub_segv_handler(int sig)
21 __asm__("movl %0, %%eax ; int $0x80": : "g" (__NR_getpid)); 20 __asm__("movl %0, %%eax ; int $0x80": : "g" (__NR_getpid));
22 __asm__("movl %%eax, %%ebx ; movl %0, %%eax ; movl %1, %%ecx ;" 21 __asm__("movl %%eax, %%ebx ; movl %0, %%eax ; movl %1, %%ecx ;"
23 "int $0x80": : "g" (__NR_kill), "g" (SIGUSR1)); 22 "int $0x80": : "g" (__NR_kill), "g" (SIGUSR1));
24 /* Pop the frame pointer and return address since we need to leave 23 /* Load pointer to sigcontext into esp, since we need to leave
25 * the stack in its original form when we do the sigreturn here, by 24 * the stack in its original form when we do the sigreturn here, by
26 * hand. 25 * hand.
27 */ 26 */
28 __asm__("popl %%eax ; popl %%eax ; popl %%eax ; movl %0, %%eax ; " 27 __asm__("mov %0,%%esp ; movl %1, %%eax ; "
29 "int $0x80" : : "g" (__NR_sigreturn)); 28 "int $0x80" : : "a" (sc), "g" (__NR_sigreturn));
30} 29}
diff --git a/arch/um/sys-i386/unmap.c b/arch/um/sys-i386/unmap.c
index 136875263d27..1b0ad0e4adcd 100644
--- a/arch/um/sys-i386/unmap.c
+++ b/arch/um/sys-i386/unmap.c
@@ -15,7 +15,7 @@ int switcheroo(int fd, int prot, void *from, void *to, int size)
15 if(munmap(to, size) < 0){ 15 if(munmap(to, size) < 0){
16 return(-1); 16 return(-1);
17 } 17 }
18 if(mmap2(to, size, prot, MAP_SHARED | MAP_FIXED, fd, 0) != to){ 18 if(mmap2(to, size, prot, MAP_SHARED | MAP_FIXED, fd, 0) == (void*) -1 ){
19 return(-1); 19 return(-1);
20 } 20 }
21 if(munmap(from, size) < 0){ 21 if(munmap(from, size) < 0){
diff --git a/arch/um/sys-x86_64/Makefile b/arch/um/sys-x86_64/Makefile
index 7488206ce6f4..f0ab574d1e95 100644
--- a/arch/um/sys-x86_64/Makefile
+++ b/arch/um/sys-x86_64/Makefile
@@ -6,7 +6,7 @@
6 6
7#XXX: why into lib-y? 7#XXX: why into lib-y?
8lib-y = bitops.o bugs.o csum-partial.o delay.o fault.o mem.o memcpy.o \ 8lib-y = bitops.o bugs.o csum-partial.o delay.o fault.o mem.o memcpy.o \
9 ptrace.o ptrace_user.o semaphore.o sigcontext.o signal.o stub.o \ 9 ptrace.o ptrace_user.o sigcontext.o signal.o stub.o \
10 stub_segv.o syscalls.o syscall_table.o sysrq.o thunk.o 10 stub_segv.o syscalls.o syscall_table.o sysrq.o thunk.o
11 11
12obj-y := ksyms.o 12obj-y := ksyms.o
@@ -15,7 +15,7 @@ obj-$(CONFIG_MODULES) += module.o um_module.o
15USER_OBJS := ptrace_user.o sigcontext.o 15USER_OBJS := ptrace_user.o sigcontext.o
16 16
17SYMLINKS = bitops.c csum-copy.S csum-partial.c csum-wrappers.c memcpy.S \ 17SYMLINKS = bitops.c csum-copy.S csum-partial.c csum-wrappers.c memcpy.S \
18 semaphore.c thunk.S module.c 18 thunk.S module.c
19 19
20include arch/um/scripts/Makefile.rules 20include arch/um/scripts/Makefile.rules
21 21
@@ -24,17 +24,10 @@ csum-copy.S-dir = lib
24csum-partial.c-dir = lib 24csum-partial.c-dir = lib
25csum-wrappers.c-dir = lib 25csum-wrappers.c-dir = lib
26memcpy.S-dir = lib 26memcpy.S-dir = lib
27semaphore.c-dir = kernel
28thunk.S-dir = lib 27thunk.S-dir = lib
29module.c-dir = kernel 28module.c-dir = kernel
30 29
31STUB_CFLAGS = -Wp,-MD,$(depfile) $(call unprofile,$(USER_CFLAGS)) 30$(obj)/stub_segv.o: _c_flags = $(call unprofile,$(CFLAGS))
32
33# _cflags works with kernel files, not with userspace ones, but c_flags does,
34# why ask why?
35$(obj)/stub_segv.o : c_flags = $(STUB_CFLAGS)
36
37$(obj)/stub.o : a_flags = $(STUB_CFLAGS)
38 31
39subdir- := util 32subdir- := util
40 33
diff --git a/arch/um/sys-x86_64/signal.c b/arch/um/sys-x86_64/signal.c
index 73a7926f7370..fe1d065332b1 100644
--- a/arch/um/sys-x86_64/signal.c
+++ b/arch/um/sys-x86_64/signal.c
@@ -104,28 +104,35 @@ int copy_sc_to_user_skas(struct sigcontext *to, struct _fpstate *to_fp,
104int copy_sc_from_user_tt(struct sigcontext *to, struct sigcontext *from, 104int copy_sc_from_user_tt(struct sigcontext *to, struct sigcontext *from,
105 int fpsize) 105 int fpsize)
106{ 106{
107 struct _fpstate *to_fp, *from_fp; 107 struct _fpstate *to_fp, *from_fp;
108 unsigned long sigs; 108 unsigned long sigs;
109 int err; 109 int err;
110 110
111 to_fp = to->fpstate; 111 to_fp = to->fpstate;
112 from_fp = from->fpstate; 112 sigs = to->oldmask;
113 sigs = to->oldmask; 113 err = copy_from_user(to, from, sizeof(*to));
114 err = copy_from_user(to, from, sizeof(*to)); 114 from_fp = to->fpstate;
115 to->oldmask = sigs; 115 to->fpstate = to_fp;
116 return(err); 116 to->oldmask = sigs;
117 if(to_fp != NULL)
118 err |= copy_from_user(to_fp, from_fp, fpsize);
119 return(err);
117} 120}
118 121
119int copy_sc_to_user_tt(struct sigcontext *to, struct _fpstate *fp, 122int copy_sc_to_user_tt(struct sigcontext *to, struct _fpstate *fp,
120 struct sigcontext *from, int fpsize) 123 struct sigcontext *from, int fpsize)
121{ 124{
122 struct _fpstate *to_fp, *from_fp; 125 struct _fpstate *to_fp, *from_fp;
123 int err; 126 int err;
124 127
125 to_fp = (fp ? fp : (struct _fpstate *) (to + 1)); 128 to_fp = (fp ? fp : (struct _fpstate *) (to + 1));
126 from_fp = from->fpstate; 129 from_fp = from->fpstate;
127 err = copy_to_user(to, from, sizeof(*to)); 130 err = copy_to_user(to, from, sizeof(*to));
128 return(err); 131 if(from_fp != NULL){
132 err |= copy_to_user(&to->fpstate, &to_fp, sizeof(to->fpstate));
133 err |= copy_to_user(to_fp, from_fp, fpsize);
134 }
135 return(err);
129} 136}
130 137
131#endif 138#endif
@@ -168,7 +175,7 @@ int setup_signal_stack_si(unsigned long stack_top, int sig,
168 175
169 frame = (struct rt_sigframe __user *) 176 frame = (struct rt_sigframe __user *)
170 round_down(stack_top - sizeof(struct rt_sigframe), 16) - 8; 177 round_down(stack_top - sizeof(struct rt_sigframe), 16) - 8;
171 ((unsigned char *) frame) -= 128; 178 frame = (struct rt_sigframe *) ((unsigned long) frame - 128);
172 179
173 if (!access_ok(VERIFY_WRITE, fp, sizeof(struct _fpstate))) 180 if (!access_ok(VERIFY_WRITE, fp, sizeof(struct _fpstate)))
174 goto out; 181 goto out;
diff --git a/arch/um/sys-x86_64/stub.S b/arch/um/sys-x86_64/stub.S
index 31c14925716b..03c279735784 100644
--- a/arch/um/sys-x86_64/stub.S
+++ b/arch/um/sys-x86_64/stub.S
@@ -13,3 +13,54 @@ syscall_stub:
13 or %rcx, %rbx 13 or %rcx, %rbx
14 movq %rax, (%rbx) 14 movq %rax, (%rbx)
15 int3 15 int3
16
17 .globl batch_syscall_stub
18batch_syscall_stub:
19 mov $(UML_CONFIG_STUB_DATA >> 32), %rbx
20 sal $32, %rbx
21 mov $(UML_CONFIG_STUB_DATA & 0xffffffff), %rax
22 or %rax, %rbx
23 /* load pointer to first operation */
24 mov %rbx, %rsp
25 add $0x10, %rsp
26again:
27 /* load length of additional data */
28 mov 0x0(%rsp), %rax
29
30 /* if(length == 0) : end of list */
31 /* write possible 0 to header */
32 mov %rax, 8(%rbx)
33 cmp $0, %rax
34 jz done
35
36 /* save current pointer */
37 mov %rsp, 8(%rbx)
38
39 /* skip additional data */
40 add %rax, %rsp
41
42 /* load syscall-# */
43 pop %rax
44
45 /* load syscall params */
46 pop %rdi
47 pop %rsi
48 pop %rdx
49 pop %r10
50 pop %r8
51 pop %r9
52
53 /* execute syscall */
54 syscall
55
56 /* check return value */
57 pop %rcx
58 cmp %rcx, %rax
59 je again
60
61done:
62 /* save return value */
63 mov %rax, (%rbx)
64
65 /* stop */
66 int3
diff --git a/arch/um/sys-x86_64/stub_segv.c b/arch/um/sys-x86_64/stub_segv.c
index 161d1fe9c034..65a131b362b6 100644
--- a/arch/um/sys-x86_64/stub_segv.c
+++ b/arch/um/sys-x86_64/stub_segv.c
@@ -3,9 +3,10 @@
3 * Licensed under the GPL 3 * Licensed under the GPL
4 */ 4 */
5 5
6#include <signal.h> 6#include <asm/signal.h>
7#include <linux/compiler.h> 7#include <linux/compiler.h>
8#include <asm/unistd.h> 8#include <asm/unistd.h>
9#include <asm/ucontext.h>
9#include "uml-config.h" 10#include "uml-config.h"
10#include "sysdep/sigcontext.h" 11#include "sysdep/sigcontext.h"
11#include "sysdep/faultinfo.h" 12#include "sysdep/faultinfo.h"
diff --git a/arch/um/sys-x86_64/unmap.c b/arch/um/sys-x86_64/unmap.c
index bc7094cce47e..f4a4bffd8a18 100644
--- a/arch/um/sys-x86_64/unmap.c
+++ b/arch/um/sys-x86_64/unmap.c
@@ -15,7 +15,7 @@ int switcheroo(int fd, int prot, void *from, void *to, int size)
15 if(munmap(to, size) < 0){ 15 if(munmap(to, size) < 0){
16 return(-1); 16 return(-1);
17 } 17 }
18 if(mmap(to, size, prot, MAP_SHARED | MAP_FIXED, fd, 0) != to){ 18 if(mmap(to, size, prot, MAP_SHARED | MAP_FIXED, fd, 0) == (void*) -1){
19 return(-1); 19 return(-1);
20 } 20 }
21 if(munmap(from, size) < 0){ 21 if(munmap(from, size) < 0){
diff --git a/arch/v850/Kconfig b/arch/v850/Kconfig
index 27febd6ffa80..89c053b6c2c4 100644
--- a/arch/v850/Kconfig
+++ b/arch/v850/Kconfig
@@ -250,6 +250,8 @@ source "fs/Kconfig.binfmt"
250 250
251endmenu 251endmenu
252 252
253source "net/Kconfig"
254
253############################################################################# 255#############################################################################
254 256
255source "drivers/base/Kconfig" 257source "drivers/base/Kconfig"
@@ -283,7 +285,7 @@ source "drivers/ieee1394/Kconfig"
283 285
284source "drivers/message/i2o/Kconfig" 286source "drivers/message/i2o/Kconfig"
285 287
286source "net/Kconfig" 288source "drivers/net/Kconfig"
287 289
288source "drivers/isdn/Kconfig" 290source "drivers/isdn/Kconfig"
289 291
diff --git a/arch/v850/Makefile b/arch/v850/Makefile
index 6edaed4a310e..bf38ca0ad781 100644
--- a/arch/v850/Makefile
+++ b/arch/v850/Makefile
@@ -1,8 +1,8 @@
1# 1#
2# arch/v850/Makefile 2# arch/v850/Makefile
3# 3#
4# Copyright (C) 2001,02,03 NEC Corporation 4# Copyright (C) 2001,02,03,05 NEC Corporation
5# Copyright (C) 2001,02,03 Miles Bader <miles@gnu.org> 5# Copyright (C) 2001,02,03,05 Miles Bader <miles@gnu.org>
6# 6#
7# This file is included by the global makefile so that you can add your own 7# This file is included by the global makefile so that you can add your own
8# architecture-specific flags and dependencies. Remember to do have actions 8# architecture-specific flags and dependencies. Remember to do have actions
@@ -22,6 +22,9 @@ CFLAGS += -ffixed-r16 -mno-prolog-function
22CFLAGS += -fno-builtin 22CFLAGS += -fno-builtin
23CFLAGS += -D__linux__ -DUTS_SYSNAME=\"uClinux\" 23CFLAGS += -D__linux__ -DUTS_SYSNAME=\"uClinux\"
24 24
25# By default, build a kernel that runs on the gdb v850 simulator.
26KBUILD_DEFCONFIG := sim_defconfig
27
25# This prevents the linker from consolidating the .gnu.linkonce.this_module 28# This prevents the linker from consolidating the .gnu.linkonce.this_module
26# section into .text (which the v850 default linker script for -r does for 29# section into .text (which the v850 default linker script for -r does for
27# some reason) 30# some reason)
diff --git a/arch/v850/README b/arch/v850/README
index 01b98e290d4a..12f7f7a665e0 100644
--- a/arch/v850/README
+++ b/arch/v850/README
@@ -1,31 +1,43 @@
1This port to the NEC V850E processor supports the following platforms: 1This port to the NEC V850E processor supports the following platforms:
2 2
3 + The gdb v850e simulator (CONFIG_V850E_SIM). 3 "sim"
4 4 The gdb v850e simulator (CONFIG_V850E_SIM).
5 + The Midas labs RTE-V850E/MA1-CB and RTE-V850E/NB85E-CB evaluation boards 5
6 (CONFIG_RTE_CB_MA1 and CONFIG_RTE_CB_NB85E). This support has only been 6 "rte-ma1-cb"
7 tested when running with the Multi-debugger monitor ROM (for the Green 7 The Midas labs RTE-V850E/MA1-CB and RTE-V850E/NB85E-CB evaluation
8 Hills Multi debugger). The optional NEC Solution Gear RTE-MOTHER-A 8 boards (CONFIG_RTE_CB_MA1 and CONFIG_RTE_CB_NB85E). This support
9 motherboard is also supported, which allows PCI boards to be used 9 has only been tested when running with the Multi-debugger monitor
10 (CONFIG_RTE_MB_A_PCI). 10 ROM (for the Green Hills Multi debugger). The optional NEC
11 11 Solution Gear RTE-MOTHER-A motherboard is also supported, which
12 + The Midas labs RTE-V850E/ME2-CB evaluation board (CONFIG_RTE_CB_ME2). 12 allows PCI boards to be used (CONFIG_RTE_MB_A_PCI).
13 This has only been tested using a kernel downloaded via an ICE connection 13
14 using the Multi debugger. Support for the RTE-MOTHER-A is present, but 14 "rte-me2-cb"
15 hasn't been tested (unlike the other Midas labs cpu boards, the 15 The Midas labs RTE-V850E/ME2-CB evaluation board (CONFIG_RTE_CB_ME2).
16 RTE-V850E/ME2-CB includes an ethernet adaptor). 16 This has only been tested using a kernel downloaded via an ICE
17 17 connection using the Multi debugger. Support for the RTE-MOTHER-A is
18 + The NEC AS85EP1 V850E evaluation chip/board (CONFIG_V850E_AS85EP1). 18 present, but hasn't been tested (unlike the other Midas labs cpu
19 19 boards, the RTE-V850E/ME2-CB includes an ethernet adaptor).
20 + The NEC `Anna' (board/chip) implementation of the V850E2 processor 20
21 (CONFIG_V850E2_ANNA). 21 "as85ep1"
22 22 The NEC AS85EP1 V850E evaluation chip/board (CONFIG_V850E_AS85EP1).
23 + The sim85e2c and sim85e2s simulators, which are verilog simulations of 23
24 the V850E2 NA85E2C/NA85E2S cpu cores (CONFIG_V850E2_SIM85E2C and 24 "anna"
25 CONFIG_V850E2_SIM85E2S). 25 The NEC `Anna' (board/chip) implementation of the V850E2 processor
26 26 (CONFIG_V850E2_ANNA).
27 + A FPGA implementation of the V850E2 NA85E2C cpu core 27
28 (CONFIG_V850E2_FPGA85E2C). 28 "sim85e2c", "sim85e2s"
29 The sim85e2c and sim85e2s simulators, which are verilog simulations
30 of the V850E2 NA85E2C/NA85E2S cpu cores (CONFIG_V850E2_SIM85E2C and
31 CONFIG_V850E2_SIM85E2S).
32
33 "fpga85e2c"
34 A FPGA implementation of the V850E2 NA85E2C cpu core
35 (CONFIG_V850E2_FPGA85E2C).
36
37To get a default kernel configuration for a particular platform, you can
38use a <platform>_defconfig make target (e.g., "make rte-me2-cb_defconfig");
39to see which default configurations are possible, look in the directory
40"arch/v850/configs".
29 41
30Porting to anything with a V850E/MA1 or MA2 processor should be simple. 42Porting to anything with a V850E/MA1 or MA2 processor should be simple.
31See the file <asm-v850/machdep.h> and the files it includes for an example of 43See the file <asm-v850/machdep.h> and the files it includes for an example of
diff --git a/arch/v850/configs/rte-ma1-cb_defconfig b/arch/v850/configs/rte-ma1-cb_defconfig
new file mode 100644
index 000000000000..1a5beda36e29
--- /dev/null
+++ b/arch/v850/configs/rte-ma1-cb_defconfig
@@ -0,0 +1,617 @@
1#
2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.13-uc0
4# Fri Sep 2 13:54:27 2005
5#
6# CONFIG_MMU is not set
7# CONFIG_UID16 is not set
8CONFIG_RWSEM_GENERIC_SPINLOCK=y
9# CONFIG_RWSEM_XCHGADD_ALGORITHM is not set
10CONFIG_GENERIC_CALIBRATE_DELAY=y
11# CONFIG_ISA is not set
12# CONFIG_ISAPNP is not set
13# CONFIG_EISA is not set
14# CONFIG_MCA is not set
15CONFIG_V850=y
16
17#
18# Processor type and features
19#
20# CONFIG_V850E_SIM is not set
21CONFIG_RTE_CB_MA1=y
22# CONFIG_RTE_CB_NB85E is not set
23# CONFIG_RTE_CB_ME2 is not set
24# CONFIG_V850E_AS85EP1 is not set
25# CONFIG_V850E2_SIM85E2C is not set
26# CONFIG_V850E2_SIM85E2S is not set
27# CONFIG_V850E2_FPGA85E2C is not set
28# CONFIG_V850E2_ANNA is not set
29CONFIG_V850E=y
30CONFIG_V850E_MA1=y
31CONFIG_RTE_CB=y
32CONFIG_RTE_CB_MULTI=y
33CONFIG_RTE_CB_MULTI_DBTRAP=y
34# CONFIG_RTE_CB_MA1_KSRAM is not set
35CONFIG_RTE_MB_A_PCI=y
36CONFIG_RTE_GBUS_INT=y
37CONFIG_PCI=y
38CONFIG_V850E_INTC=y
39CONFIG_V850E_TIMER_D=y
40# CONFIG_V850E_CACHE is not set
41# CONFIG_V850E2_CACHE is not set
42CONFIG_NO_CACHE=y
43CONFIG_ZERO_BSS=y
44# CONFIG_V850E_HIGHRES_TIMER is not set
45# CONFIG_RESET_GUARD is not set
46CONFIG_LARGE_ALLOCS=y
47CONFIG_FLATMEM=y
48CONFIG_FLAT_NODE_MEM_MAP=y
49
50#
51# Code maturity level options
52#
53# CONFIG_EXPERIMENTAL is not set
54CONFIG_CLEAN_COMPILE=y
55CONFIG_BROKEN_ON_SMP=y
56CONFIG_INIT_ENV_ARG_LIMIT=32
57
58#
59# General setup
60#
61CONFIG_LOCALVERSION=""
62# CONFIG_BSD_PROCESS_ACCT is not set
63# CONFIG_SYSCTL is not set
64# CONFIG_AUDIT is not set
65# CONFIG_HOTPLUG is not set
66CONFIG_KOBJECT_UEVENT=y
67# CONFIG_IKCONFIG is not set
68CONFIG_EMBEDDED=y
69# CONFIG_KALLSYMS is not set
70CONFIG_PRINTK=y
71CONFIG_BUG=y
72# CONFIG_BASE_FULL is not set
73# CONFIG_FUTEX is not set
74# CONFIG_EPOLL is not set
75CONFIG_CC_OPTIMIZE_FOR_SIZE=y
76CONFIG_CC_ALIGN_FUNCTIONS=0
77CONFIG_CC_ALIGN_LABELS=0
78CONFIG_CC_ALIGN_LOOPS=0
79CONFIG_CC_ALIGN_JUMPS=0
80CONFIG_BASE_SMALL=1
81
82#
83# Loadable module support
84#
85CONFIG_MODULES=y
86CONFIG_MODULE_UNLOAD=y
87CONFIG_OBSOLETE_MODPARM=y
88# CONFIG_MODULE_SRCVERSION_ALL is not set
89CONFIG_KMOD=y
90
91#
92# Bus options (PCI, PCMCIA, EISA, MCA, ISA)
93#
94# CONFIG_PCI_LEGACY_PROC is not set
95# CONFIG_PCI_NAMES is not set
96# CONFIG_PCI_DEBUG is not set
97
98#
99# PCCARD (PCMCIA/CardBus) support
100#
101# CONFIG_PCCARD is not set
102
103#
104# PCI Hotplug Support
105#
106
107#
108# Executable file formats
109#
110CONFIG_BINFMT_FLAT=y
111# CONFIG_BINFMT_ZFLAT is not set
112# CONFIG_BINFMT_SHARED_FLAT is not set
113# CONFIG_BINFMT_MISC is not set
114
115#
116# Networking
117#
118CONFIG_NET=y
119
120#
121# Networking options
122#
123# CONFIG_PACKET is not set
124# CONFIG_UNIX is not set
125# CONFIG_NET_KEY is not set
126CONFIG_INET=y
127# CONFIG_IP_MULTICAST is not set
128# CONFIG_IP_ADVANCED_ROUTER is not set
129CONFIG_IP_FIB_HASH=y
130# CONFIG_IP_PNP is not set
131# CONFIG_NET_IPIP is not set
132# CONFIG_NET_IPGRE is not set
133# CONFIG_SYN_COOKIES is not set
134# CONFIG_INET_AH is not set
135# CONFIG_INET_ESP is not set
136# CONFIG_INET_IPCOMP is not set
137# CONFIG_INET_TUNNEL is not set
138# CONFIG_IP_TCPDIAG is not set
139# CONFIG_IP_TCPDIAG_IPV6 is not set
140# CONFIG_TCP_CONG_ADVANCED is not set
141CONFIG_TCP_CONG_BIC=y
142# CONFIG_IPV6 is not set
143# CONFIG_NETFILTER is not set
144# CONFIG_BRIDGE is not set
145# CONFIG_VLAN_8021Q is not set
146# CONFIG_DECNET is not set
147# CONFIG_LLC2 is not set
148# CONFIG_IPX is not set
149# CONFIG_ATALK is not set
150# CONFIG_NET_SCHED is not set
151# CONFIG_NET_CLS_ROUTE is not set
152
153#
154# Network testing
155#
156# CONFIG_NET_PKTGEN is not set
157# CONFIG_HAMRADIO is not set
158# CONFIG_IRDA is not set
159# CONFIG_BT is not set
160
161#
162# Generic Driver Options
163#
164CONFIG_STANDALONE=y
165CONFIG_PREVENT_FIRMWARE_BUILD=y
166# CONFIG_FW_LOADER is not set
167# CONFIG_DEBUG_DRIVER is not set
168
169#
170# Memory Technology Devices (MTD)
171#
172CONFIG_MTD=y
173# CONFIG_MTD_DEBUG is not set
174# CONFIG_MTD_CONCAT is not set
175# CONFIG_MTD_PARTITIONS is not set
176
177#
178# User Modules And Translation Layers
179#
180# CONFIG_MTD_CHAR is not set
181CONFIG_MTD_BLOCK=y
182# CONFIG_FTL is not set
183# CONFIG_NFTL is not set
184# CONFIG_INFTL is not set
185
186#
187# RAM/ROM/Flash chip drivers
188#
189# CONFIG_MTD_CFI is not set
190# CONFIG_MTD_JEDECPROBE is not set
191CONFIG_MTD_MAP_BANK_WIDTH_1=y
192CONFIG_MTD_MAP_BANK_WIDTH_2=y
193CONFIG_MTD_MAP_BANK_WIDTH_4=y
194# CONFIG_MTD_MAP_BANK_WIDTH_8 is not set
195# CONFIG_MTD_MAP_BANK_WIDTH_16 is not set
196# CONFIG_MTD_MAP_BANK_WIDTH_32 is not set
197CONFIG_MTD_CFI_I1=y
198CONFIG_MTD_CFI_I2=y
199# CONFIG_MTD_CFI_I4 is not set
200# CONFIG_MTD_CFI_I8 is not set
201# CONFIG_MTD_RAM is not set
202# CONFIG_MTD_ROM is not set
203# CONFIG_MTD_ABSENT is not set
204
205#
206# Mapping drivers for chip access
207#
208# CONFIG_MTD_COMPLEX_MAPPINGS is not set
209# CONFIG_MTD_PLATRAM is not set
210
211#
212# Self-contained MTD device drivers
213#
214# CONFIG_MTD_PMC551 is not set
215CONFIG_MTD_SLRAM=y
216# CONFIG_MTD_PHRAM is not set
217# CONFIG_MTD_MTDRAM is not set
218# CONFIG_MTD_BLKMTD is not set
219
220#
221# Disk-On-Chip Device Drivers
222#
223# CONFIG_MTD_DOC2000 is not set
224# CONFIG_MTD_DOC2001 is not set
225# CONFIG_MTD_DOC2001PLUS is not set
226
227#
228# NAND Flash Device Drivers
229#
230# CONFIG_MTD_NAND is not set
231
232#
233# Parallel port support
234#
235# CONFIG_PARPORT is not set
236
237#
238# Block devices
239#
240# CONFIG_BLK_DEV_FD is not set
241# CONFIG_BLK_CPQ_DA is not set
242# CONFIG_BLK_CPQ_CISS_DA is not set
243# CONFIG_BLK_DEV_DAC960 is not set
244# CONFIG_BLK_DEV_COW_COMMON is not set
245# CONFIG_BLK_DEV_LOOP is not set
246# CONFIG_BLK_DEV_NBD is not set
247# CONFIG_BLK_DEV_SX8 is not set
248# CONFIG_BLK_DEV_RAM is not set
249CONFIG_BLK_DEV_RAM_COUNT=16
250CONFIG_INITRAMFS_SOURCE=""
251# CONFIG_CDROM_PKTCDVD is not set
252
253#
254# IO Schedulers
255#
256CONFIG_IOSCHED_NOOP=y
257# CONFIG_IOSCHED_AS is not set
258# CONFIG_IOSCHED_DEADLINE is not set
259# CONFIG_IOSCHED_CFQ is not set
260# CONFIG_ATA_OVER_ETH is not set
261
262#
263# Disk device support
264#
265
266#
267# ATA/ATAPI/MFM/RLL support
268#
269# CONFIG_IDE is not set
270
271#
272# SCSI device support
273#
274# CONFIG_SCSI is not set
275
276#
277# Multi-device support (RAID and LVM)
278#
279# CONFIG_MD is not set
280
281#
282# Fusion MPT device support
283#
284# CONFIG_FUSION is not set
285
286#
287# IEEE 1394 (FireWire) support
288#
289# CONFIG_IEEE1394 is not set
290
291#
292# I2O device support
293#
294# CONFIG_I2O is not set
295
296#
297# Network device support
298#
299CONFIG_NETDEVICES=y
300# CONFIG_DUMMY is not set
301# CONFIG_BONDING is not set
302# CONFIG_EQUALIZER is not set
303# CONFIG_TUN is not set
304
305#
306# ARCnet devices
307#
308# CONFIG_ARCNET is not set
309
310#
311# Ethernet (10 or 100Mbit)
312#
313CONFIG_NET_ETHERNET=y
314CONFIG_MII=y
315# CONFIG_HAPPYMEAL is not set
316# CONFIG_SUNGEM is not set
317# CONFIG_NET_VENDOR_3COM is not set
318# CONFIG_NET_VENDOR_SMC is not set
319
320#
321# Tulip family network device support
322#
323# CONFIG_NET_TULIP is not set
324# CONFIG_HP100 is not set
325# CONFIG_NE2000 is not set
326CONFIG_NET_PCI=y
327# CONFIG_PCNET32 is not set
328# CONFIG_AMD8111_ETH is not set
329# CONFIG_ADAPTEC_STARFIRE is not set
330# CONFIG_DGRS is not set
331CONFIG_EEPRO100=y
332# CONFIG_E100 is not set
333# CONFIG_FEALNX is not set
334# CONFIG_NATSEMI is not set
335# CONFIG_NE2K_PCI is not set
336# CONFIG_8139TOO is not set
337# CONFIG_SIS900 is not set
338# CONFIG_EPIC100 is not set
339# CONFIG_SUNDANCE is not set
340# CONFIG_TLAN is not set
341# CONFIG_VIA_RHINE is not set
342
343#
344# Ethernet (1000 Mbit)
345#
346# CONFIG_ACENIC is not set
347# CONFIG_DL2K is not set
348# CONFIG_E1000 is not set
349# CONFIG_NS83820 is not set
350# CONFIG_HAMACHI is not set
351# CONFIG_R8169 is not set
352# CONFIG_SK98LIN is not set
353# CONFIG_VIA_VELOCITY is not set
354# CONFIG_TIGON3 is not set
355# CONFIG_BNX2 is not set
356
357#
358# Ethernet (10000 Mbit)
359#
360# CONFIG_IXGB is not set
361# CONFIG_S2IO is not set
362
363#
364# Token Ring devices
365#
366# CONFIG_TR is not set
367
368#
369# Wireless LAN (non-hamradio)
370#
371# CONFIG_NET_RADIO is not set
372
373#
374# Wan interfaces
375#
376# CONFIG_WAN is not set
377# CONFIG_FDDI is not set
378# CONFIG_PPP is not set
379# CONFIG_SLIP is not set
380# CONFIG_NETPOLL is not set
381# CONFIG_NET_POLL_CONTROLLER is not set
382
383#
384# ISDN subsystem
385#
386# CONFIG_ISDN is not set
387
388#
389# Input device support
390#
391CONFIG_INPUT=y
392
393#
394# Userland interfaces
395#
396# CONFIG_INPUT_MOUSEDEV is not set
397# CONFIG_INPUT_JOYDEV is not set
398# CONFIG_INPUT_TSDEV is not set
399# CONFIG_INPUT_EVDEV is not set
400# CONFIG_INPUT_EVBUG is not set
401
402#
403# Input Device Drivers
404#
405# CONFIG_INPUT_KEYBOARD is not set
406# CONFIG_INPUT_MOUSE is not set
407# CONFIG_INPUT_JOYSTICK is not set
408# CONFIG_INPUT_TOUCHSCREEN is not set
409# CONFIG_INPUT_MISC is not set
410
411#
412# Hardware I/O ports
413#
414# CONFIG_SERIO is not set
415# CONFIG_GAMEPORT is not set
416
417#
418# Character devices
419#
420# CONFIG_VT is not set
421# CONFIG_SERIAL_NONSTANDARD is not set
422
423#
424# Serial drivers
425#
426# CONFIG_SERIAL_8250 is not set
427
428#
429# Non-8250 serial port support
430#
431CONFIG_V850E_UART=y
432CONFIG_V850E_UART_CONSOLE=y
433CONFIG_SERIAL_CORE=y
434CONFIG_SERIAL_CORE_CONSOLE=y
435# CONFIG_SERIAL_JSM is not set
436# CONFIG_UNIX98_PTYS is not set
437# CONFIG_LEGACY_PTYS is not set
438
439#
440# IPMI
441#
442# CONFIG_IPMI_HANDLER is not set
443
444#
445# Watchdog Cards
446#
447# CONFIG_WATCHDOG is not set
448# CONFIG_RTC is not set
449# CONFIG_GEN_RTC is not set
450# CONFIG_DTLK is not set
451# CONFIG_R3964 is not set
452# CONFIG_APPLICOM is not set
453
454#
455# Ftape, the floppy tape device driver
456#
457# CONFIG_DRM is not set
458# CONFIG_RAW_DRIVER is not set
459
460#
461# TPM devices
462#
463
464#
465# Multimedia devices
466#
467# CONFIG_VIDEO_DEV is not set
468
469#
470# Digital Video Broadcasting Devices
471#
472# CONFIG_DVB is not set
473
474#
475# File systems
476#
477# CONFIG_EXT2_FS is not set
478# CONFIG_EXT3_FS is not set
479# CONFIG_JBD is not set
480# CONFIG_REISERFS_FS is not set
481# CONFIG_JFS_FS is not set
482# CONFIG_FS_POSIX_ACL is not set
483
484#
485# XFS support
486#
487# CONFIG_XFS_FS is not set
488# CONFIG_MINIX_FS is not set
489CONFIG_ROMFS_FS=y
490# CONFIG_MAGIC_ROM_PTR is not set
491CONFIG_INOTIFY=y
492# CONFIG_QUOTA is not set
493CONFIG_DNOTIFY=y
494# CONFIG_AUTOFS_FS is not set
495# CONFIG_AUTOFS4_FS is not set
496
497#
498# CD-ROM/DVD Filesystems
499#
500# CONFIG_ISO9660_FS is not set
501# CONFIG_UDF_FS is not set
502
503#
504# DOS/FAT/NT Filesystems
505#
506# CONFIG_MSDOS_FS is not set
507# CONFIG_VFAT_FS is not set
508# CONFIG_NTFS_FS is not set
509
510#
511# Pseudo filesystems
512#
513CONFIG_PROC_FS=y
514CONFIG_SYSFS=y
515# CONFIG_TMPFS is not set
516# CONFIG_HUGETLB_PAGE is not set
517CONFIG_RAMFS=y
518
519#
520# Miscellaneous filesystems
521#
522# CONFIG_HFSPLUS_FS is not set
523# CONFIG_JFFS_FS is not set
524# CONFIG_JFFS2_FS is not set
525# CONFIG_CRAMFS is not set
526# CONFIG_VXFS_FS is not set
527# CONFIG_HPFS_FS is not set
528# CONFIG_QNX4FS_FS is not set
529# CONFIG_SYSV_FS is not set
530# CONFIG_UFS_FS is not set
531
532#
533# Network File Systems
534#
535CONFIG_NFS_FS=y
536CONFIG_NFS_V3=y
537# CONFIG_NFS_V3_ACL is not set
538# CONFIG_NFSD is not set
539CONFIG_LOCKD=y
540CONFIG_LOCKD_V4=y
541CONFIG_NFS_COMMON=y
542CONFIG_SUNRPC=y
543# CONFIG_SMB_FS is not set
544# CONFIG_CIFS is not set
545# CONFIG_NCP_FS is not set
546# CONFIG_CODA_FS is not set
547
548#
549# Partition Types
550#
551# CONFIG_PARTITION_ADVANCED is not set
552CONFIG_MSDOS_PARTITION=y
553
554#
555# Native Language Support
556#
557# CONFIG_NLS is not set
558
559#
560# Graphics support
561#
562# CONFIG_FB is not set
563
564#
565# Sound
566#
567# CONFIG_SOUND is not set
568
569#
570# USB support
571#
572CONFIG_USB_ARCH_HAS_HCD=y
573CONFIG_USB_ARCH_HAS_OHCI=y
574# CONFIG_USB is not set
575
576#
577# USB Gadget Support
578#
579# CONFIG_USB_GADGET is not set
580
581#
582# Kernel hacking
583#
584# CONFIG_PRINTK_TIME is not set
585CONFIG_DEBUG_KERNEL=y
586# CONFIG_MAGIC_SYSRQ is not set
587CONFIG_LOG_BUF_SHIFT=14
588# CONFIG_SCHEDSTATS is not set
589# CONFIG_DEBUG_SLAB is not set
590# CONFIG_DEBUG_SPINLOCK is not set
591# CONFIG_DEBUG_SPINLOCK_SLEEP is not set
592# CONFIG_DEBUG_KOBJECT is not set
593CONFIG_DEBUG_INFO=y
594# CONFIG_DEBUG_FS is not set
595# CONFIG_NO_KERNEL_MSG is not set
596
597#
598# Security options
599#
600# CONFIG_KEYS is not set
601# CONFIG_SECURITY is not set
602
603#
604# Cryptographic options
605#
606# CONFIG_CRYPTO is not set
607
608#
609# Hardware crypto devices
610#
611
612#
613# Library routines
614#
615# CONFIG_CRC_CCITT is not set
616# CONFIG_CRC32 is not set
617# CONFIG_LIBCRC32C is not set
diff --git a/arch/v850/configs/rte-me2-cb_defconfig b/arch/v850/configs/rte-me2-cb_defconfig
new file mode 100644
index 000000000000..15e666478061
--- /dev/null
+++ b/arch/v850/configs/rte-me2-cb_defconfig
@@ -0,0 +1,462 @@
1#
2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.13-uc0
4# Fri Sep 2 13:47:50 2005
5#
6# CONFIG_MMU is not set
7# CONFIG_UID16 is not set
8CONFIG_RWSEM_GENERIC_SPINLOCK=y
9# CONFIG_RWSEM_XCHGADD_ALGORITHM is not set
10CONFIG_GENERIC_CALIBRATE_DELAY=y
11# CONFIG_ISA is not set
12# CONFIG_ISAPNP is not set
13# CONFIG_EISA is not set
14# CONFIG_MCA is not set
15CONFIG_V850=y
16
17#
18# Processor type and features
19#
20# CONFIG_V850E_SIM is not set
21# CONFIG_RTE_CB_MA1 is not set
22# CONFIG_RTE_CB_NB85E is not set
23CONFIG_RTE_CB_ME2=y
24# CONFIG_V850E_AS85EP1 is not set
25# CONFIG_V850E2_SIM85E2C is not set
26# CONFIG_V850E2_SIM85E2S is not set
27# CONFIG_V850E2_FPGA85E2C is not set
28# CONFIG_V850E2_ANNA is not set
29CONFIG_V850E=y
30CONFIG_V850E_ME2=y
31CONFIG_RTE_CB=y
32# CONFIG_RTE_MB_A_PCI is not set
33# CONFIG_PCI is not set
34CONFIG_V850E_INTC=y
35CONFIG_V850E_TIMER_D=y
36CONFIG_V850E_CACHE=y
37# CONFIG_V850E2_CACHE is not set
38# CONFIG_NO_CACHE is not set
39# CONFIG_ROM_KERNEL is not set
40CONFIG_ZERO_BSS=y
41# CONFIG_V850E_HIGHRES_TIMER is not set
42# CONFIG_RESET_GUARD is not set
43CONFIG_LARGE_ALLOCS=y
44CONFIG_FLATMEM=y
45CONFIG_FLAT_NODE_MEM_MAP=y
46
47#
48# Code maturity level options
49#
50# CONFIG_EXPERIMENTAL is not set
51CONFIG_CLEAN_COMPILE=y
52CONFIG_BROKEN_ON_SMP=y
53CONFIG_INIT_ENV_ARG_LIMIT=32
54
55#
56# General setup
57#
58CONFIG_LOCALVERSION=""
59# CONFIG_BSD_PROCESS_ACCT is not set
60# CONFIG_SYSCTL is not set
61# CONFIG_HOTPLUG is not set
62# CONFIG_IKCONFIG is not set
63CONFIG_EMBEDDED=y
64# CONFIG_KALLSYMS is not set
65CONFIG_PRINTK=y
66CONFIG_BUG=y
67# CONFIG_BASE_FULL is not set
68# CONFIG_FUTEX is not set
69# CONFIG_EPOLL is not set
70CONFIG_CC_OPTIMIZE_FOR_SIZE=y
71CONFIG_CC_ALIGN_FUNCTIONS=0
72CONFIG_CC_ALIGN_LABELS=0
73CONFIG_CC_ALIGN_LOOPS=0
74CONFIG_CC_ALIGN_JUMPS=0
75CONFIG_BASE_SMALL=1
76
77#
78# Loadable module support
79#
80CONFIG_MODULES=y
81CONFIG_MODULE_UNLOAD=y
82CONFIG_OBSOLETE_MODPARM=y
83# CONFIG_MODULE_SRCVERSION_ALL is not set
84CONFIG_KMOD=y
85
86#
87# Bus options (PCI, PCMCIA, EISA, MCA, ISA)
88#
89
90#
91# PCCARD (PCMCIA/CardBus) support
92#
93# CONFIG_PCCARD is not set
94
95#
96# PCI Hotplug Support
97#
98
99#
100# Executable file formats
101#
102CONFIG_BINFMT_FLAT=y
103# CONFIG_BINFMT_ZFLAT is not set
104# CONFIG_BINFMT_SHARED_FLAT is not set
105# CONFIG_BINFMT_MISC is not set
106
107#
108# Networking
109#
110# CONFIG_NET is not set
111
112#
113# Generic Driver Options
114#
115CONFIG_STANDALONE=y
116CONFIG_PREVENT_FIRMWARE_BUILD=y
117# CONFIG_FW_LOADER is not set
118# CONFIG_DEBUG_DRIVER is not set
119
120#
121# Memory Technology Devices (MTD)
122#
123CONFIG_MTD=y
124# CONFIG_MTD_DEBUG is not set
125# CONFIG_MTD_CONCAT is not set
126# CONFIG_MTD_PARTITIONS is not set
127
128#
129# User Modules And Translation Layers
130#
131# CONFIG_MTD_CHAR is not set
132CONFIG_MTD_BLOCK=y
133# CONFIG_FTL is not set
134# CONFIG_NFTL is not set
135# CONFIG_INFTL is not set
136
137#
138# RAM/ROM/Flash chip drivers
139#
140# CONFIG_MTD_CFI is not set
141# CONFIG_MTD_JEDECPROBE is not set
142CONFIG_MTD_MAP_BANK_WIDTH_1=y
143CONFIG_MTD_MAP_BANK_WIDTH_2=y
144CONFIG_MTD_MAP_BANK_WIDTH_4=y
145# CONFIG_MTD_MAP_BANK_WIDTH_8 is not set
146# CONFIG_MTD_MAP_BANK_WIDTH_16 is not set
147# CONFIG_MTD_MAP_BANK_WIDTH_32 is not set
148CONFIG_MTD_CFI_I1=y
149CONFIG_MTD_CFI_I2=y
150# CONFIG_MTD_CFI_I4 is not set
151# CONFIG_MTD_CFI_I8 is not set
152# CONFIG_MTD_RAM is not set
153# CONFIG_MTD_ROM is not set
154# CONFIG_MTD_ABSENT is not set
155
156#
157# Mapping drivers for chip access
158#
159# CONFIG_MTD_COMPLEX_MAPPINGS is not set
160# CONFIG_MTD_PLATRAM is not set
161
162#
163# Self-contained MTD device drivers
164#
165CONFIG_MTD_SLRAM=y
166# CONFIG_MTD_PHRAM is not set
167# CONFIG_MTD_MTDRAM is not set
168# CONFIG_MTD_BLKMTD is not set
169
170#
171# Disk-On-Chip Device Drivers
172#
173# CONFIG_MTD_DOC2000 is not set
174# CONFIG_MTD_DOC2001 is not set
175# CONFIG_MTD_DOC2001PLUS is not set
176
177#
178# NAND Flash Device Drivers
179#
180# CONFIG_MTD_NAND is not set
181
182#
183# Parallel port support
184#
185# CONFIG_PARPORT is not set
186
187#
188# Block devices
189#
190# CONFIG_BLK_DEV_FD is not set
191# CONFIG_BLK_DEV_COW_COMMON is not set
192# CONFIG_BLK_DEV_LOOP is not set
193# CONFIG_BLK_DEV_RAM is not set
194CONFIG_BLK_DEV_RAM_COUNT=16
195CONFIG_INITRAMFS_SOURCE=""
196# CONFIG_CDROM_PKTCDVD is not set
197
198#
199# IO Schedulers
200#
201CONFIG_IOSCHED_NOOP=y
202# CONFIG_IOSCHED_AS is not set
203# CONFIG_IOSCHED_DEADLINE is not set
204# CONFIG_IOSCHED_CFQ is not set
205
206#
207# Disk device support
208#
209
210#
211# ATA/ATAPI/MFM/RLL support
212#
213# CONFIG_IDE is not set
214
215#
216# SCSI device support
217#
218# CONFIG_SCSI is not set
219
220#
221# Multi-device support (RAID and LVM)
222#
223# CONFIG_MD is not set
224
225#
226# Fusion MPT device support
227#
228# CONFIG_FUSION is not set
229
230#
231# IEEE 1394 (FireWire) support
232#
233
234#
235# I2O device support
236#
237
238#
239# Network device support
240#
241# CONFIG_NETPOLL is not set
242# CONFIG_NET_POLL_CONTROLLER is not set
243
244#
245# ISDN subsystem
246#
247
248#
249# Input device support
250#
251CONFIG_INPUT=y
252
253#
254# Userland interfaces
255#
256# CONFIG_INPUT_MOUSEDEV is not set
257# CONFIG_INPUT_JOYDEV is not set
258# CONFIG_INPUT_TSDEV is not set
259# CONFIG_INPUT_EVDEV is not set
260# CONFIG_INPUT_EVBUG is not set
261
262#
263# Input Device Drivers
264#
265# CONFIG_INPUT_KEYBOARD is not set
266# CONFIG_INPUT_MOUSE is not set
267# CONFIG_INPUT_JOYSTICK is not set
268# CONFIG_INPUT_TOUCHSCREEN is not set
269# CONFIG_INPUT_MISC is not set
270
271#
272# Hardware I/O ports
273#
274CONFIG_SERIO=y
275# CONFIG_SERIO_I8042 is not set
276# CONFIG_SERIO_SERPORT is not set
277# CONFIG_SERIO_LIBPS2 is not set
278# CONFIG_SERIO_RAW is not set
279# CONFIG_GAMEPORT is not set
280
281#
282# Character devices
283#
284# CONFIG_VT is not set
285# CONFIG_SERIAL_NONSTANDARD is not set
286
287#
288# Serial drivers
289#
290CONFIG_SERIAL_8250=y
291CONFIG_SERIAL_8250_CONSOLE=y
292CONFIG_SERIAL_8250_NR_UARTS=1
293# CONFIG_SERIAL_8250_EXTENDED is not set
294
295#
296# Non-8250 serial port support
297#
298# CONFIG_V850E_UART is not set
299CONFIG_SERIAL_CORE=y
300CONFIG_SERIAL_CORE_CONSOLE=y
301# CONFIG_UNIX98_PTYS is not set
302# CONFIG_LEGACY_PTYS is not set
303
304#
305# IPMI
306#
307# CONFIG_IPMI_HANDLER is not set
308
309#
310# Watchdog Cards
311#
312# CONFIG_WATCHDOG is not set
313# CONFIG_RTC is not set
314# CONFIG_GEN_RTC is not set
315# CONFIG_DTLK is not set
316# CONFIG_R3964 is not set
317
318#
319# Ftape, the floppy tape device driver
320#
321# CONFIG_RAW_DRIVER is not set
322
323#
324# TPM devices
325#
326
327#
328# Multimedia devices
329#
330# CONFIG_VIDEO_DEV is not set
331
332#
333# Digital Video Broadcasting Devices
334#
335
336#
337# File systems
338#
339# CONFIG_EXT2_FS is not set
340# CONFIG_EXT3_FS is not set
341# CONFIG_JBD is not set
342# CONFIG_REISERFS_FS is not set
343# CONFIG_JFS_FS is not set
344# CONFIG_FS_POSIX_ACL is not set
345
346#
347# XFS support
348#
349# CONFIG_XFS_FS is not set
350# CONFIG_MINIX_FS is not set
351CONFIG_ROMFS_FS=y
352# CONFIG_MAGIC_ROM_PTR is not set
353CONFIG_INOTIFY=y
354# CONFIG_QUOTA is not set
355CONFIG_DNOTIFY=y
356# CONFIG_AUTOFS_FS is not set
357# CONFIG_AUTOFS4_FS is not set
358
359#
360# CD-ROM/DVD Filesystems
361#
362# CONFIG_ISO9660_FS is not set
363# CONFIG_UDF_FS is not set
364
365#
366# DOS/FAT/NT Filesystems
367#
368# CONFIG_MSDOS_FS is not set
369# CONFIG_VFAT_FS is not set
370# CONFIG_NTFS_FS is not set
371
372#
373# Pseudo filesystems
374#
375CONFIG_PROC_FS=y
376CONFIG_SYSFS=y
377# CONFIG_TMPFS is not set
378# CONFIG_HUGETLB_PAGE is not set
379CONFIG_RAMFS=y
380
381#
382# Miscellaneous filesystems
383#
384# CONFIG_HFSPLUS_FS is not set
385# CONFIG_JFFS_FS is not set
386# CONFIG_JFFS2_FS is not set
387# CONFIG_CRAMFS is not set
388# CONFIG_VXFS_FS is not set
389# CONFIG_HPFS_FS is not set
390# CONFIG_QNX4FS_FS is not set
391# CONFIG_SYSV_FS is not set
392# CONFIG_UFS_FS is not set
393
394#
395# Partition Types
396#
397# CONFIG_PARTITION_ADVANCED is not set
398CONFIG_MSDOS_PARTITION=y
399
400#
401# Native Language Support
402#
403# CONFIG_NLS is not set
404
405#
406# Graphics support
407#
408# CONFIG_FB is not set
409
410#
411# Sound
412#
413# CONFIG_SOUND is not set
414
415#
416# USB support
417#
418# CONFIG_USB_ARCH_HAS_HCD is not set
419# CONFIG_USB_ARCH_HAS_OHCI is not set
420
421#
422# USB Gadget Support
423#
424# CONFIG_USB_GADGET is not set
425
426#
427# Kernel hacking
428#
429# CONFIG_PRINTK_TIME is not set
430CONFIG_DEBUG_KERNEL=y
431# CONFIG_MAGIC_SYSRQ is not set
432CONFIG_LOG_BUF_SHIFT=14
433# CONFIG_SCHEDSTATS is not set
434# CONFIG_DEBUG_SLAB is not set
435# CONFIG_DEBUG_SPINLOCK is not set
436# CONFIG_DEBUG_SPINLOCK_SLEEP is not set
437# CONFIG_DEBUG_KOBJECT is not set
438CONFIG_DEBUG_INFO=y
439# CONFIG_DEBUG_FS is not set
440# CONFIG_NO_KERNEL_MSG is not set
441
442#
443# Security options
444#
445# CONFIG_KEYS is not set
446# CONFIG_SECURITY is not set
447
448#
449# Cryptographic options
450#
451# CONFIG_CRYPTO is not set
452
453#
454# Hardware crypto devices
455#
456
457#
458# Library routines
459#
460# CONFIG_CRC_CCITT is not set
461# CONFIG_CRC32 is not set
462# CONFIG_LIBCRC32C is not set
diff --git a/arch/v850/configs/sim_defconfig b/arch/v850/configs/sim_defconfig
new file mode 100644
index 000000000000..f31ba7398ad0
--- /dev/null
+++ b/arch/v850/configs/sim_defconfig
@@ -0,0 +1,451 @@
1#
2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.13-uc0
4# Fri Sep 2 13:36:43 2005
5#
6# CONFIG_MMU is not set
7# CONFIG_UID16 is not set
8CONFIG_RWSEM_GENERIC_SPINLOCK=y
9# CONFIG_RWSEM_XCHGADD_ALGORITHM is not set
10CONFIG_GENERIC_CALIBRATE_DELAY=y
11# CONFIG_ISA is not set
12# CONFIG_ISAPNP is not set
13# CONFIG_EISA is not set
14# CONFIG_MCA is not set
15CONFIG_V850=y
16
17#
18# Processor type and features
19#
20CONFIG_V850E_SIM=y
21# CONFIG_RTE_CB_MA1 is not set
22# CONFIG_RTE_CB_NB85E is not set
23# CONFIG_RTE_CB_ME2 is not set
24# CONFIG_V850E_AS85EP1 is not set
25# CONFIG_V850E2_SIM85E2C is not set
26# CONFIG_V850E2_SIM85E2S is not set
27# CONFIG_V850E2_FPGA85E2C is not set
28# CONFIG_V850E2_ANNA is not set
29CONFIG_V850E=y
30# CONFIG_PCI is not set
31# CONFIG_V850E_INTC is not set
32# CONFIG_V850E_TIMER_D is not set
33# CONFIG_V850E_CACHE is not set
34# CONFIG_V850E2_CACHE is not set
35CONFIG_NO_CACHE=y
36CONFIG_ZERO_BSS=y
37# CONFIG_RESET_GUARD is not set
38CONFIG_LARGE_ALLOCS=y
39CONFIG_FLATMEM=y
40CONFIG_FLAT_NODE_MEM_MAP=y
41
42#
43# Code maturity level options
44#
45# CONFIG_EXPERIMENTAL is not set
46CONFIG_CLEAN_COMPILE=y
47CONFIG_BROKEN_ON_SMP=y
48CONFIG_INIT_ENV_ARG_LIMIT=32
49
50#
51# General setup
52#
53CONFIG_LOCALVERSION=""
54# CONFIG_BSD_PROCESS_ACCT is not set
55# CONFIG_SYSCTL is not set
56# CONFIG_HOTPLUG is not set
57# CONFIG_IKCONFIG is not set
58CONFIG_EMBEDDED=y
59# CONFIG_KALLSYMS is not set
60CONFIG_PRINTK=y
61CONFIG_BUG=y
62# CONFIG_BASE_FULL is not set
63# CONFIG_FUTEX is not set
64# CONFIG_EPOLL is not set
65CONFIG_CC_OPTIMIZE_FOR_SIZE=y
66CONFIG_CC_ALIGN_FUNCTIONS=0
67CONFIG_CC_ALIGN_LABELS=0
68CONFIG_CC_ALIGN_LOOPS=0
69CONFIG_CC_ALIGN_JUMPS=0
70CONFIG_BASE_SMALL=1
71
72#
73# Loadable module support
74#
75CONFIG_MODULES=y
76CONFIG_MODULE_UNLOAD=y
77CONFIG_OBSOLETE_MODPARM=y
78# CONFIG_MODULE_SRCVERSION_ALL is not set
79CONFIG_KMOD=y
80
81#
82# Bus options (PCI, PCMCIA, EISA, MCA, ISA)
83#
84
85#
86# PCCARD (PCMCIA/CardBus) support
87#
88# CONFIG_PCCARD is not set
89
90#
91# PCI Hotplug Support
92#
93
94#
95# Executable file formats
96#
97CONFIG_BINFMT_FLAT=y
98# CONFIG_BINFMT_ZFLAT is not set
99# CONFIG_BINFMT_SHARED_FLAT is not set
100# CONFIG_BINFMT_MISC is not set
101
102#
103# Networking
104#
105# CONFIG_NET is not set
106
107#
108# Generic Driver Options
109#
110CONFIG_STANDALONE=y
111CONFIG_PREVENT_FIRMWARE_BUILD=y
112# CONFIG_FW_LOADER is not set
113# CONFIG_DEBUG_DRIVER is not set
114
115#
116# Memory Technology Devices (MTD)
117#
118CONFIG_MTD=y
119# CONFIG_MTD_DEBUG is not set
120# CONFIG_MTD_CONCAT is not set
121# CONFIG_MTD_PARTITIONS is not set
122
123#
124# User Modules And Translation Layers
125#
126# CONFIG_MTD_CHAR is not set
127CONFIG_MTD_BLOCK=y
128# CONFIG_FTL is not set
129# CONFIG_NFTL is not set
130# CONFIG_INFTL is not set
131
132#
133# RAM/ROM/Flash chip drivers
134#
135# CONFIG_MTD_CFI is not set
136# CONFIG_MTD_JEDECPROBE is not set
137CONFIG_MTD_MAP_BANK_WIDTH_1=y
138CONFIG_MTD_MAP_BANK_WIDTH_2=y
139CONFIG_MTD_MAP_BANK_WIDTH_4=y
140# CONFIG_MTD_MAP_BANK_WIDTH_8 is not set
141# CONFIG_MTD_MAP_BANK_WIDTH_16 is not set
142# CONFIG_MTD_MAP_BANK_WIDTH_32 is not set
143CONFIG_MTD_CFI_I1=y
144CONFIG_MTD_CFI_I2=y
145# CONFIG_MTD_CFI_I4 is not set
146# CONFIG_MTD_CFI_I8 is not set
147# CONFIG_MTD_RAM is not set
148# CONFIG_MTD_ROM is not set
149# CONFIG_MTD_ABSENT is not set
150
151#
152# Mapping drivers for chip access
153#
154# CONFIG_MTD_COMPLEX_MAPPINGS is not set
155# CONFIG_MTD_PLATRAM is not set
156
157#
158# Self-contained MTD device drivers
159#
160CONFIG_MTD_SLRAM=y
161# CONFIG_MTD_PHRAM is not set
162# CONFIG_MTD_MTDRAM is not set
163# CONFIG_MTD_BLKMTD is not set
164
165#
166# Disk-On-Chip Device Drivers
167#
168# CONFIG_MTD_DOC2000 is not set
169# CONFIG_MTD_DOC2001 is not set
170# CONFIG_MTD_DOC2001PLUS is not set
171
172#
173# NAND Flash Device Drivers
174#
175# CONFIG_MTD_NAND is not set
176
177#
178# Parallel port support
179#
180# CONFIG_PARPORT is not set
181
182#
183# Block devices
184#
185# CONFIG_BLK_DEV_FD is not set
186# CONFIG_BLK_DEV_COW_COMMON is not set
187# CONFIG_BLK_DEV_LOOP is not set
188# CONFIG_BLK_DEV_RAM is not set
189CONFIG_BLK_DEV_RAM_COUNT=16
190CONFIG_INITRAMFS_SOURCE=""
191# CONFIG_CDROM_PKTCDVD is not set
192
193#
194# IO Schedulers
195#
196CONFIG_IOSCHED_NOOP=y
197# CONFIG_IOSCHED_AS is not set
198# CONFIG_IOSCHED_DEADLINE is not set
199# CONFIG_IOSCHED_CFQ is not set
200
201#
202# Disk device support
203#
204
205#
206# ATA/ATAPI/MFM/RLL support
207#
208# CONFIG_IDE is not set
209
210#
211# SCSI device support
212#
213# CONFIG_SCSI is not set
214
215#
216# Multi-device support (RAID and LVM)
217#
218# CONFIG_MD is not set
219
220#
221# Fusion MPT device support
222#
223# CONFIG_FUSION is not set
224
225#
226# IEEE 1394 (FireWire) support
227#
228
229#
230# I2O device support
231#
232
233#
234# Network device support
235#
236# CONFIG_NETPOLL is not set
237# CONFIG_NET_POLL_CONTROLLER is not set
238
239#
240# ISDN subsystem
241#
242
243#
244# Input device support
245#
246CONFIG_INPUT=y
247
248#
249# Userland interfaces
250#
251# CONFIG_INPUT_MOUSEDEV is not set
252# CONFIG_INPUT_JOYDEV is not set
253# CONFIG_INPUT_TSDEV is not set
254# CONFIG_INPUT_EVDEV is not set
255# CONFIG_INPUT_EVBUG is not set
256
257#
258# Input Device Drivers
259#
260# CONFIG_INPUT_KEYBOARD is not set
261# CONFIG_INPUT_MOUSE is not set
262# CONFIG_INPUT_JOYSTICK is not set
263# CONFIG_INPUT_TOUCHSCREEN is not set
264# CONFIG_INPUT_MISC is not set
265
266#
267# Hardware I/O ports
268#
269CONFIG_SERIO=y
270# CONFIG_SERIO_I8042 is not set
271# CONFIG_SERIO_SERPORT is not set
272# CONFIG_SERIO_LIBPS2 is not set
273# CONFIG_SERIO_RAW is not set
274# CONFIG_GAMEPORT is not set
275
276#
277# Character devices
278#
279# CONFIG_VT is not set
280# CONFIG_SERIAL_NONSTANDARD is not set
281
282#
283# Serial drivers
284#
285# CONFIG_SERIAL_8250 is not set
286
287#
288# Non-8250 serial port support
289#
290# CONFIG_UNIX98_PTYS is not set
291# CONFIG_LEGACY_PTYS is not set
292
293#
294# IPMI
295#
296# CONFIG_IPMI_HANDLER is not set
297
298#
299# Watchdog Cards
300#
301# CONFIG_WATCHDOG is not set
302# CONFIG_RTC is not set
303# CONFIG_GEN_RTC is not set
304# CONFIG_DTLK is not set
305# CONFIG_R3964 is not set
306
307#
308# Ftape, the floppy tape device driver
309#
310# CONFIG_RAW_DRIVER is not set
311
312#
313# TPM devices
314#
315
316#
317# Multimedia devices
318#
319# CONFIG_VIDEO_DEV is not set
320
321#
322# Digital Video Broadcasting Devices
323#
324
325#
326# File systems
327#
328# CONFIG_EXT2_FS is not set
329# CONFIG_EXT3_FS is not set
330# CONFIG_JBD is not set
331# CONFIG_REISERFS_FS is not set
332# CONFIG_JFS_FS is not set
333# CONFIG_FS_POSIX_ACL is not set
334
335#
336# XFS support
337#
338# CONFIG_XFS_FS is not set
339# CONFIG_MINIX_FS is not set
340CONFIG_ROMFS_FS=y
341# CONFIG_MAGIC_ROM_PTR is not set
342CONFIG_INOTIFY=y
343# CONFIG_QUOTA is not set
344CONFIG_DNOTIFY=y
345# CONFIG_AUTOFS_FS is not set
346# CONFIG_AUTOFS4_FS is not set
347
348#
349# CD-ROM/DVD Filesystems
350#
351# CONFIG_ISO9660_FS is not set
352# CONFIG_UDF_FS is not set
353
354#
355# DOS/FAT/NT Filesystems
356#
357# CONFIG_MSDOS_FS is not set
358# CONFIG_VFAT_FS is not set
359# CONFIG_NTFS_FS is not set
360
361#
362# Pseudo filesystems
363#
364CONFIG_PROC_FS=y
365CONFIG_SYSFS=y
366# CONFIG_TMPFS is not set
367# CONFIG_HUGETLB_PAGE is not set
368CONFIG_RAMFS=y
369
370#
371# Miscellaneous filesystems
372#
373# CONFIG_HFSPLUS_FS is not set
374# CONFIG_JFFS_FS is not set
375# CONFIG_JFFS2_FS is not set
376# CONFIG_CRAMFS is not set
377# CONFIG_VXFS_FS is not set
378# CONFIG_HPFS_FS is not set
379# CONFIG_QNX4FS_FS is not set
380# CONFIG_SYSV_FS is not set
381# CONFIG_UFS_FS is not set
382
383#
384# Partition Types
385#
386# CONFIG_PARTITION_ADVANCED is not set
387CONFIG_MSDOS_PARTITION=y
388
389#
390# Native Language Support
391#
392# CONFIG_NLS is not set
393
394#
395# Graphics support
396#
397# CONFIG_FB is not set
398
399#
400# Sound
401#
402# CONFIG_SOUND is not set
403
404#
405# USB support
406#
407# CONFIG_USB_ARCH_HAS_HCD is not set
408# CONFIG_USB_ARCH_HAS_OHCI is not set
409
410#
411# USB Gadget Support
412#
413# CONFIG_USB_GADGET is not set
414
415#
416# Kernel hacking
417#
418# CONFIG_PRINTK_TIME is not set
419CONFIG_DEBUG_KERNEL=y
420# CONFIG_MAGIC_SYSRQ is not set
421CONFIG_LOG_BUF_SHIFT=14
422# CONFIG_SCHEDSTATS is not set
423# CONFIG_DEBUG_SLAB is not set
424# CONFIG_DEBUG_SPINLOCK is not set
425# CONFIG_DEBUG_SPINLOCK_SLEEP is not set
426# CONFIG_DEBUG_KOBJECT is not set
427CONFIG_DEBUG_INFO=y
428# CONFIG_DEBUG_FS is not set
429# CONFIG_NO_KERNEL_MSG is not set
430
431#
432# Security options
433#
434# CONFIG_KEYS is not set
435# CONFIG_SECURITY is not set
436
437#
438# Cryptographic options
439#
440# CONFIG_CRYPTO is not set
441
442#
443# Hardware crypto devices
444#
445
446#
447# Library routines
448#
449# CONFIG_CRC_CCITT is not set
450# CONFIG_CRC32 is not set
451# CONFIG_LIBCRC32C is not set
diff --git a/arch/v850/kernel/anna.c b/arch/v850/kernel/anna.c
index 6aaeab5e8a40..d0502e142437 100644
--- a/arch/v850/kernel/anna.c
+++ b/arch/v850/kernel/anna.c
@@ -132,8 +132,6 @@ void machine_restart (char *__unused)
132 asm ("jmp r0"); /* Jump to the reset vector. */ 132 asm ("jmp r0"); /* Jump to the reset vector. */
133} 133}
134 134
135EXPORT_SYMBOL(machine_restart);
136
137void machine_halt (void) 135void machine_halt (void)
138{ 136{
139#ifdef CONFIG_RESET_GUARD 137#ifdef CONFIG_RESET_GUARD
@@ -145,15 +143,11 @@ void machine_halt (void)
145 asm ("halt; nop; nop; nop; nop; nop"); 143 asm ("halt; nop; nop; nop; nop; nop");
146} 144}
147 145
148EXPORT_SYMBOL(machine_halt);
149
150void machine_power_off (void) 146void machine_power_off (void)
151{ 147{
152 machine_halt (); 148 machine_halt ();
153} 149}
154 150
155EXPORT_SYMBOL(machine_power_off);
156
157/* Called before configuring an on-chip UART. */ 151/* Called before configuring an on-chip UART. */
158void anna_uart_pre_configure (unsigned chan, unsigned cflags, unsigned baud) 152void anna_uart_pre_configure (unsigned chan, unsigned cflags, unsigned baud)
159{ 153{
diff --git a/arch/v850/kernel/as85ep1.c b/arch/v850/kernel/as85ep1.c
index 4059b1df11b5..d78c5e4ea9bc 100644
--- a/arch/v850/kernel/as85ep1.c
+++ b/arch/v850/kernel/as85ep1.c
@@ -160,8 +160,6 @@ void machine_restart (char *__unused)
160 asm ("jmp r0"); /* Jump to the reset vector. */ 160 asm ("jmp r0"); /* Jump to the reset vector. */
161} 161}
162 162
163EXPORT_SYMBOL(machine_restart);
164
165void machine_halt (void) 163void machine_halt (void)
166{ 164{
167#ifdef CONFIG_RESET_GUARD 165#ifdef CONFIG_RESET_GUARD
@@ -173,15 +171,11 @@ void machine_halt (void)
173 asm ("halt; nop; nop; nop; nop; nop"); 171 asm ("halt; nop; nop; nop; nop; nop");
174} 172}
175 173
176EXPORT_SYMBOL(machine_halt);
177
178void machine_power_off (void) 174void machine_power_off (void)
179{ 175{
180 machine_halt (); 176 machine_halt ();
181} 177}
182 178
183EXPORT_SYMBOL(machine_power_off);
184
185/* Called before configuring an on-chip UART. */ 179/* Called before configuring an on-chip UART. */
186void as85ep1_uart_pre_configure (unsigned chan, unsigned cflags, unsigned baud) 180void as85ep1_uart_pre_configure (unsigned chan, unsigned cflags, unsigned baud)
187{ 181{
diff --git a/arch/v850/kernel/fpga85e2c.c b/arch/v850/kernel/fpga85e2c.c
index 4bac5149b3c2..d8094519ad85 100644
--- a/arch/v850/kernel/fpga85e2c.c
+++ b/arch/v850/kernel/fpga85e2c.c
@@ -121,22 +121,16 @@ void machine_halt (void)
121 } 121 }
122} 122}
123 123
124EXPORT_SYMBOL(machine_halt);
125
126void machine_restart (char *__unused) 124void machine_restart (char *__unused)
127{ 125{
128 machine_halt (); 126 machine_halt ();
129} 127}
130 128
131EXPORT_SYMBOL(machine_restart);
132
133void machine_power_off (void) 129void machine_power_off (void)
134{ 130{
135 machine_halt (); 131 machine_halt ();
136} 132}
137 133
138EXPORT_SYMBOL(machine_power_off);
139
140 134
141/* Interrupts */ 135/* Interrupts */
142 136
diff --git a/arch/v850/kernel/rte_cb.c b/arch/v850/kernel/rte_cb.c
index 7ba397f77aca..0c794b9e0f9b 100644
--- a/arch/v850/kernel/rte_cb.c
+++ b/arch/v850/kernel/rte_cb.c
@@ -67,8 +67,6 @@ void machine_restart (char *__unused)
67 asm ("jmp r0"); /* Jump to the reset vector. */ 67 asm ("jmp r0"); /* Jump to the reset vector. */
68} 68}
69 69
70EXPORT_SYMBOL(machine_restart);
71
72/* This says `HALt.' in LEDese. */ 70/* This says `HALt.' in LEDese. */
73static unsigned char halt_leds_msg[] = { 0x76, 0x77, 0x38, 0xF8 }; 71static unsigned char halt_leds_msg[] = { 0x76, 0x77, 0x38, 0xF8 };
74 72
@@ -89,15 +87,11 @@ void machine_halt (void)
89 asm ("halt; nop; nop; nop; nop; nop"); 87 asm ("halt; nop; nop; nop; nop; nop");
90} 88}
91 89
92EXPORT_SYMBOL(machine_halt);
93
94void machine_power_off (void) 90void machine_power_off (void)
95{ 91{
96 machine_halt (); 92 machine_halt ();
97} 93}
98 94
99EXPORT_SYMBOL(machine_power_off);
100
101 95
102/* Animated LED display for timer tick. */ 96/* Animated LED display for timer tick. */
103 97
diff --git a/arch/v850/kernel/rte_mb_a_pci.c b/arch/v850/kernel/rte_mb_a_pci.c
index 074b50abc89d..ffbb6d073bf2 100644
--- a/arch/v850/kernel/rte_mb_a_pci.c
+++ b/arch/v850/kernel/rte_mb_a_pci.c
@@ -1,8 +1,8 @@
1/* 1/*
2 * arch/v850/kernel/mb_a_pci.c -- PCI support for Midas lab RTE-MOTHER-A board 2 * arch/v850/kernel/mb_a_pci.c -- PCI support for Midas lab RTE-MOTHER-A board
3 * 3 *
4 * Copyright (C) 2001,02,03 NEC Electronics Corporation 4 * Copyright (C) 2001,02,03,05 NEC Electronics Corporation
5 * Copyright (C) 2001,02,03 Miles Bader <miles@gnu.org> 5 * Copyright (C) 2001,02,03,05 Miles Bader <miles@gnu.org>
6 * 6 *
7 * This file is subject to the terms and conditions of the GNU General 7 * This file is subject to the terms and conditions of the GNU General
8 * Public License. See the file COPYING in the main directory of this 8 * Public License. See the file COPYING in the main directory of this
@@ -743,15 +743,17 @@ pci_unmap_sg (struct pci_dev *pdev, struct scatterlist *sg, int sg_len,int dir)
743 for a scatter-gather list, same rules and usage. */ 743 for a scatter-gather list, same rules and usage. */
744 744
745void 745void
746pci_dma_sync_sg_for_cpu (struct pci_dev *dev, struct scatterlist *sg, int sg_len, 746pci_dma_sync_sg_for_cpu (struct pci_dev *dev,
747 int dir) 747 struct scatterlist *sg, int sg_len,
748 int dir)
748{ 749{
749 BUG (); 750 BUG ();
750} 751}
751 752
752void 753void
753pci_dma_sync_sg_for_device (struct pci_dev *dev, struct scatterlist *sg, int sg_len, 754pci_dma_sync_sg_for_device (struct pci_dev *dev,
754 int dir) 755 struct scatterlist *sg, int sg_len,
756 int dir)
755{ 757{
756 BUG (); 758 BUG ();
757} 759}
@@ -786,6 +788,27 @@ pci_free_consistent (struct pci_dev *pdev, size_t size, void *cpu_addr,
786} 788}
787 789
788 790
791/* iomap/iomap */
792
793void __iomem *pci_iomap (struct pci_dev *dev, int bar, unsigned long max)
794{
795 unsigned long start = pci_resource_start (dev, bar);
796 unsigned long len = pci_resource_len (dev, bar);
797
798 if (!start || len == 0)
799 return 0;
800
801 /* None of the ioremap functions actually do anything, other than
802 re-casting their argument, so don't bother differentiating them. */
803 return ioremap (start, len);
804}
805
806void pci_iounmap (struct pci_dev *dev, void __iomem *addr)
807{
808 /* nothing */
809}
810
811
789/* symbol exports (for modules) */ 812/* symbol exports (for modules) */
790 813
791EXPORT_SYMBOL (pci_map_single); 814EXPORT_SYMBOL (pci_map_single);
@@ -794,3 +817,5 @@ EXPORT_SYMBOL (pci_alloc_consistent);
794EXPORT_SYMBOL (pci_free_consistent); 817EXPORT_SYMBOL (pci_free_consistent);
795EXPORT_SYMBOL (pci_dma_sync_single_for_cpu); 818EXPORT_SYMBOL (pci_dma_sync_single_for_cpu);
796EXPORT_SYMBOL (pci_dma_sync_single_for_device); 819EXPORT_SYMBOL (pci_dma_sync_single_for_device);
820EXPORT_SYMBOL (pci_iomap);
821EXPORT_SYMBOL (pci_iounmap);
diff --git a/arch/v850/kernel/setup.c b/arch/v850/kernel/setup.c
index c41d72b01b88..abd48409dcca 100644
--- a/arch/v850/kernel/setup.c
+++ b/arch/v850/kernel/setup.c
@@ -1,8 +1,8 @@
1/* 1/*
2 * arch/v850/kernel/setup.c -- Arch-dependent initialization functions 2 * arch/v850/kernel/setup.c -- Arch-dependent initialization functions
3 * 3 *
4 * Copyright (C) 2001,02,03 NEC Electronics Corporation 4 * Copyright (C) 2001,02,03,05 NEC Electronics Corporation
5 * Copyright (C) 2001,02,03 Miles Bader <miles@gnu.org> 5 * Copyright (C) 2001,02,03,05 Miles Bader <miles@gnu.org>
6 * 6 *
7 * This file is subject to the terms and conditions of the GNU General 7 * This file is subject to the terms and conditions of the GNU General
8 * Public License. See the file COPYING in the main directory of this 8 * Public License. See the file COPYING in the main directory of this
@@ -98,10 +98,20 @@ void __init trap_init (void)
98} 98}
99 99
100#ifdef CONFIG_MTD 100#ifdef CONFIG_MTD
101
102/* From drivers/mtd/devices/slram.c */
103#define SLRAM_BLK_SZ 0x4000
104
101/* Set the root filesystem to be the given memory region. 105/* Set the root filesystem to be the given memory region.
102 Some parameter may be appended to CMD_LINE. */ 106 Some parameter may be appended to CMD_LINE. */
103void set_mem_root (void *addr, size_t len, char *cmd_line) 107void set_mem_root (void *addr, size_t len, char *cmd_line)
104{ 108{
109 /* Some sort of idiocy in MTD means we must supply a length that's
110 a multiple of SLRAM_BLK_SZ. We just round up the real length,
111 as the file system shouldn't attempt to access anything beyond
112 the end of the image anyway. */
113 len = (((len - 1) + SLRAM_BLK_SZ) / SLRAM_BLK_SZ) * SLRAM_BLK_SZ;
114
105 /* The only way to pass info to the MTD slram driver is via 115 /* The only way to pass info to the MTD slram driver is via
106 the command line. */ 116 the command line. */
107 if (*cmd_line) { 117 if (*cmd_line) {
@@ -284,3 +294,33 @@ init_mem_alloc (unsigned long ram_start, unsigned long ram_len)
284 free_area_init_node (0, NODE_DATA(0), zones_size, 294 free_area_init_node (0, NODE_DATA(0), zones_size,
285 ADDR_TO_PAGE (PAGE_OFFSET), 0); 295 ADDR_TO_PAGE (PAGE_OFFSET), 0);
286} 296}
297
298
299
300/* Taken from m68knommu */
301void show_mem(void)
302{
303 unsigned long i;
304 int free = 0, total = 0, reserved = 0, shared = 0;
305 int cached = 0;
306
307 printk(KERN_INFO "\nMem-info:\n");
308 show_free_areas();
309 i = max_mapnr;
310 while (i-- > 0) {
311 total++;
312 if (PageReserved(mem_map+i))
313 reserved++;
314 else if (PageSwapCache(mem_map+i))
315 cached++;
316 else if (!page_count(mem_map+i))
317 free++;
318 else
319 shared += page_count(mem_map+i) - 1;
320 }
321 printk(KERN_INFO "%d pages of RAM\n",total);
322 printk(KERN_INFO "%d free pages\n",free);
323 printk(KERN_INFO "%d reserved pages\n",reserved);
324 printk(KERN_INFO "%d pages shared\n",shared);
325 printk(KERN_INFO "%d pages swap cached\n",cached);
326}
diff --git a/arch/v850/kernel/signal.c b/arch/v850/kernel/signal.c
index 37061e32e1a4..633e4e1b825f 100644
--- a/arch/v850/kernel/signal.c
+++ b/arch/v850/kernel/signal.c
@@ -462,13 +462,12 @@ handle_signal(unsigned long sig, siginfo_t *info, struct k_sigaction *ka,
462 else 462 else
463 setup_frame(sig, ka, oldset, regs); 463 setup_frame(sig, ka, oldset, regs);
464 464
465 if (!(ka->sa.sa_flags & SA_NODEFER)) { 465 spin_lock_irq(&current->sighand->siglock);
466 spin_lock_irq(&current->sighand->siglock); 466 sigorsets(&current->blocked,&current->blocked,&ka->sa.sa_mask);
467 sigorsets(&current->blocked,&current->blocked,&ka->sa.sa_mask); 467 if (!(ka->sa.sa_flags & SA_NODEFER))
468 sigaddset(&current->blocked,sig); 468 sigaddset(&current->blocked,sig);
469 recalc_sigpending(); 469 recalc_sigpending();
470 spin_unlock_irq(&current->sighand->siglock); 470 spin_unlock_irq(&current->sighand->siglock);
471 }
472} 471}
473 472
474/* 473/*
diff --git a/arch/v850/kernel/sim.c b/arch/v850/kernel/sim.c
index 4f31da962632..e2cc5580fa2a 100644
--- a/arch/v850/kernel/sim.c
+++ b/arch/v850/kernel/sim.c
@@ -104,24 +104,18 @@ void machine_restart (char *__unused)
104 V850_SIM_SYSCALL (exit, 0); 104 V850_SIM_SYSCALL (exit, 0);
105} 105}
106 106
107EXPORT_SYMBOL(machine_restart);
108
109void machine_halt (void) 107void machine_halt (void)
110{ 108{
111 V850_SIM_SYSCALL (write, 1, "HALT\n", 5); 109 V850_SIM_SYSCALL (write, 1, "HALT\n", 5);
112 V850_SIM_SYSCALL (exit, 0); 110 V850_SIM_SYSCALL (exit, 0);
113} 111}
114 112
115EXPORT_SYMBOL(machine_halt);
116
117void machine_power_off (void) 113void machine_power_off (void)
118{ 114{
119 V850_SIM_SYSCALL (write, 1, "POWER OFF\n", 10); 115 V850_SIM_SYSCALL (write, 1, "POWER OFF\n", 10);
120 V850_SIM_SYSCALL (exit, 0); 116 V850_SIM_SYSCALL (exit, 0);
121} 117}
122 118
123EXPORT_SYMBOL(machine_power_off);
124
125 119
126/* Load data from a file called NAME into ram. The address and length 120/* Load data from a file called NAME into ram. The address and length
127 of the data image are returned in ADDR and LEN. */ 121 of the data image are returned in ADDR and LEN. */
diff --git a/arch/v850/kernel/sim85e2.c b/arch/v850/kernel/sim85e2.c
index 93a722b516bb..9111613fb53a 100644
--- a/arch/v850/kernel/sim85e2.c
+++ b/arch/v850/kernel/sim85e2.c
@@ -184,18 +184,13 @@ void machine_halt (void)
184 for (;;) {} 184 for (;;) {}
185} 185}
186 186
187EXPORT_SYMBOL(machine_halt);
188
189void machine_restart (char *__unused) 187void machine_restart (char *__unused)
190{ 188{
191 machine_halt (); 189 machine_halt ();
192} 190}
193 191
194EXPORT_SYMBOL(machine_restart);
195
196void machine_power_off (void) 192void machine_power_off (void)
197{ 193{
198 machine_halt (); 194 machine_halt ();
199} 195}
200 196
201EXPORT_SYMBOL(machine_power_off);
diff --git a/arch/v850/kernel/vmlinux.lds.S b/arch/v850/kernel/vmlinux.lds.S
index bbd3429bcffc..5be05f47109e 100644
--- a/arch/v850/kernel/vmlinux.lds.S
+++ b/arch/v850/kernel/vmlinux.lds.S
@@ -1,8 +1,8 @@
1/* 1/*
2 * arch/v850/vmlinux.lds.S -- kernel linker script for v850 platforms 2 * arch/v850/vmlinux.lds.S -- kernel linker script for v850 platforms
3 * 3 *
4 * Copyright (C) 2002,03,04 NEC Electronics Corporation 4 * Copyright (C) 2002,03,04,05 NEC Electronics Corporation
5 * Copyright (C) 2002,03,04 Miles Bader <miles@gnu.org> 5 * Copyright (C) 2002,03,04,05 Miles Bader <miles@gnu.org>
6 * 6 *
7 * This file is subject to the terms and conditions of the GNU General 7 * This file is subject to the terms and conditions of the GNU General
8 * Public License. See the file COPYING in the main directory of this 8 * Public License. See the file COPYING in the main directory of this
@@ -12,6 +12,7 @@
12 */ 12 */
13 13
14#include <linux/config.h> 14#include <linux/config.h>
15
15#define VMLINUX_SYMBOL(_sym_) _##_sym_ 16#define VMLINUX_SYMBOL(_sym_) _##_sym_
16#include <asm-generic/vmlinux.lds.h> 17#include <asm-generic/vmlinux.lds.h>
17 18
@@ -42,6 +43,19 @@
42 *(.rodata) *(.rodata.*) \ 43 *(.rodata) *(.rodata.*) \
43 *(__vermagic) /* Kernel version magic */ \ 44 *(__vermagic) /* Kernel version magic */ \
44 *(.rodata1) \ 45 *(.rodata1) \
46 /* PCI quirks */ \
47 ___start_pci_fixups_early = . ; \
48 *(.pci_fixup_early) \
49 ___end_pci_fixups_early = . ; \
50 ___start_pci_fixups_header = . ; \
51 *(.pci_fixup_header) \
52 ___end_pci_fixups_header = . ; \
53 ___start_pci_fixups_final = . ; \
54 *(.pci_fixup_final) \
55 ___end_pci_fixups_final = . ; \
56 ___start_pci_fixups_enable = . ; \
57 *(.pci_fixup_enable) \
58 ___end_pci_fixups_enable = . ; \
45 /* Kernel symbol table: Normal symbols */ \ 59 /* Kernel symbol table: Normal symbols */ \
46 ___start___ksymtab = .; \ 60 ___start___ksymtab = .; \
47 *(__ksymtab) \ 61 *(__ksymtab) \
@@ -61,6 +75,7 @@
61 *(__kcrctab_gpl) \ 75 *(__kcrctab_gpl) \
62 ___stop___kcrctab_gpl = .; \ 76 ___stop___kcrctab_gpl = .; \
63 /* Built-in module parameters */ \ 77 /* Built-in module parameters */ \
78 . = ALIGN (4) ; \
64 ___start___param = .; \ 79 ___start___param = .; \
65 *(__param) \ 80 *(__param) \
66 ___stop___param = .; 81 ___stop___param = .;
diff --git a/arch/x86_64/Kconfig b/arch/x86_64/Kconfig
index d09437b5c48f..75e52c57f19c 100644
--- a/arch/x86_64/Kconfig
+++ b/arch/x86_64/Kconfig
@@ -24,6 +24,10 @@ config X86
24 bool 24 bool
25 default y 25 default y
26 26
27config SEMAPHORE_SLEEPERS
28 bool
29 default y
30
27config MMU 31config MMU
28 bool 32 bool
29 default y 33 default y
@@ -329,12 +333,15 @@ config HPET_EMULATE_RTC
329 333
330config GART_IOMMU 334config GART_IOMMU
331 bool "IOMMU support" 335 bool "IOMMU support"
336 default y
332 depends on PCI 337 depends on PCI
333 help 338 help
334 Support the K8 IOMMU. Needed to run systems with more than 4GB of memory 339 Support the IOMMU. Needed to run systems with more than 3GB of memory
335 properly with 32-bit PCI devices that do not support DAC (Double Address 340 properly with 32-bit PCI devices that do not support DAC (Double Address
336 Cycle). The IOMMU can be turned off at runtime with the iommu=off parameter. 341 Cycle). The IOMMU can be turned off at runtime with the iommu=off parameter.
337 Normally the kernel will take the right choice by itself. 342 Normally the kernel will take the right choice by itself.
343 This option includes a driver for the AMD Opteron/Athlon64 IOMMU
344 and a software emulation used on some other systems.
338 If unsure, say Y. 345 If unsure, say Y.
339 346
340# need this always enabled with GART_IOMMU for the VIA workaround 347# need this always enabled with GART_IOMMU for the VIA workaround
@@ -515,6 +522,8 @@ config UID16
515 522
516endmenu 523endmenu
517 524
525source "net/Kconfig"
526
518source drivers/Kconfig 527source drivers/Kconfig
519 528
520source "drivers/firmware/Kconfig" 529source "drivers/firmware/Kconfig"
diff --git a/arch/x86_64/Makefile b/arch/x86_64/Makefile
index 428915697675..4c6ed96d5f7c 100644
--- a/arch/x86_64/Makefile
+++ b/arch/x86_64/Makefile
@@ -21,18 +21,6 @@
21# 21#
22# $Id: Makefile,v 1.31 2002/03/22 15:56:07 ak Exp $ 22# $Id: Makefile,v 1.31 2002/03/22 15:56:07 ak Exp $
23 23
24#
25# early bootup linking needs 32bit. You can either use real 32bit tools
26# here or 64bit tools in 32bit mode.
27#
28IA32_CC := $(CC) $(CPPFLAGS) -m32 -O2 -fomit-frame-pointer
29IA32_LD := $(LD) -m elf_i386
30IA32_AS := $(CC) $(AFLAGS) -m32 -Wa,--32 -traditional -c
31IA32_OBJCOPY := $(CROSS_COMPILE)objcopy
32IA32_CPP := $(CROSS_COMPILE)gcc -m32 -E
33export IA32_CC IA32_LD IA32_AS IA32_OBJCOPY IA32_CPP
34
35
36LDFLAGS := -m elf_x86_64 24LDFLAGS := -m elf_x86_64
37OBJCOPYFLAGS := -O binary -R .note -R .comment -S 25OBJCOPYFLAGS := -O binary -R .note -R .comment -S
38LDFLAGS_vmlinux := 26LDFLAGS_vmlinux :=
diff --git a/arch/x86_64/crypto/aes.c b/arch/x86_64/crypto/aes.c
index 2b5c4010ce38..acfdaa28791e 100644
--- a/arch/x86_64/crypto/aes.c
+++ b/arch/x86_64/crypto/aes.c
@@ -322,3 +322,4 @@ module_exit(aes_fini);
322 322
323MODULE_DESCRIPTION("Rijndael (AES) Cipher Algorithm"); 323MODULE_DESCRIPTION("Rijndael (AES) Cipher Algorithm");
324MODULE_LICENSE("GPL"); 324MODULE_LICENSE("GPL");
325MODULE_ALIAS("aes");
diff --git a/arch/x86_64/defconfig b/arch/x86_64/defconfig
index 569595b74c7c..b97a61e1c71c 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.12-rc4 3# Linux kernel version: 2.6.13-rc6-git3
4# Fri May 13 06:39:11 2005 4# Fri Aug 12 16:40:34 2005
5# 5#
6CONFIG_X86_64=y 6CONFIG_X86_64=y
7CONFIG_64BIT=y 7CONFIG_64BIT=y
@@ -84,14 +84,27 @@ CONFIG_X86_IO_APIC=y
84CONFIG_X86_LOCAL_APIC=y 84CONFIG_X86_LOCAL_APIC=y
85CONFIG_MTRR=y 85CONFIG_MTRR=y
86CONFIG_SMP=y 86CONFIG_SMP=y
87# CONFIG_PREEMPT is not set
88CONFIG_SCHED_SMT=y 87CONFIG_SCHED_SMT=y
88CONFIG_PREEMPT_NONE=y
89# CONFIG_PREEMPT_VOLUNTARY is not set
90# CONFIG_PREEMPT is not set
91CONFIG_PREEMPT_BKL=y
89CONFIG_K8_NUMA=y 92CONFIG_K8_NUMA=y
90# CONFIG_NUMA_EMU is not set 93# CONFIG_NUMA_EMU is not set
91CONFIG_DISCONTIGMEM=y 94CONFIG_ARCH_DISCONTIGMEM_ENABLE=y
92CONFIG_NUMA=y 95CONFIG_NUMA=y
96CONFIG_ARCH_DISCONTIGMEM_DEFAULT=y
97CONFIG_ARCH_SPARSEMEM_ENABLE=y
98CONFIG_SELECT_MEMORY_MODEL=y
99# CONFIG_FLATMEM_MANUAL is not set
100CONFIG_DISCONTIGMEM_MANUAL=y
101# CONFIG_SPARSEMEM_MANUAL is not set
102CONFIG_DISCONTIGMEM=y
103CONFIG_FLAT_NODE_MEM_MAP=y
104CONFIG_NEED_MULTIPLE_NODES=y
105CONFIG_HAVE_ARCH_EARLY_PFN_TO_NID=y
93CONFIG_HAVE_DEC_LOCK=y 106CONFIG_HAVE_DEC_LOCK=y
94CONFIG_NR_CPUS=8 107CONFIG_NR_CPUS=32
95CONFIG_HPET_TIMER=y 108CONFIG_HPET_TIMER=y
96CONFIG_X86_PM_TIMER=y 109CONFIG_X86_PM_TIMER=y
97CONFIG_HPET_EMULATE_RTC=y 110CONFIG_HPET_EMULATE_RTC=y
@@ -99,7 +112,13 @@ CONFIG_GART_IOMMU=y
99CONFIG_SWIOTLB=y 112CONFIG_SWIOTLB=y
100CONFIG_X86_MCE=y 113CONFIG_X86_MCE=y
101CONFIG_X86_MCE_INTEL=y 114CONFIG_X86_MCE_INTEL=y
115CONFIG_PHYSICAL_START=0x100000
116# CONFIG_KEXEC is not set
102CONFIG_SECCOMP=y 117CONFIG_SECCOMP=y
118# CONFIG_HZ_100 is not set
119CONFIG_HZ_250=y
120# CONFIG_HZ_1000 is not set
121CONFIG_HZ=250
103CONFIG_GENERIC_HARDIRQS=y 122CONFIG_GENERIC_HARDIRQS=y
104CONFIG_GENERIC_IRQ_PROBE=y 123CONFIG_GENERIC_IRQ_PROBE=y
105CONFIG_ISA_DMA_API=y 124CONFIG_ISA_DMA_API=y
@@ -118,12 +137,11 @@ CONFIG_PM_STD_PARTITION=""
118CONFIG_ACPI=y 137CONFIG_ACPI=y
119CONFIG_ACPI_BOOT=y 138CONFIG_ACPI_BOOT=y
120CONFIG_ACPI_INTERPRETER=y 139CONFIG_ACPI_INTERPRETER=y
121CONFIG_ACPI_SLEEP=y
122CONFIG_ACPI_SLEEP_PROC_FS=y
123CONFIG_ACPI_AC=y 140CONFIG_ACPI_AC=y
124CONFIG_ACPI_BATTERY=y 141CONFIG_ACPI_BATTERY=y
125CONFIG_ACPI_BUTTON=y 142CONFIG_ACPI_BUTTON=y
126# CONFIG_ACPI_VIDEO is not set 143# CONFIG_ACPI_VIDEO is not set
144CONFIG_ACPI_HOTKEY=m
127CONFIG_ACPI_FAN=y 145CONFIG_ACPI_FAN=y
128CONFIG_ACPI_PROCESSOR=y 146CONFIG_ACPI_PROCESSOR=y
129CONFIG_ACPI_THERMAL=y 147CONFIG_ACPI_THERMAL=y
@@ -154,6 +172,7 @@ CONFIG_CPU_FREQ_GOV_PERFORMANCE=y
154# CONFIG_CPU_FREQ_GOV_POWERSAVE is not set 172# CONFIG_CPU_FREQ_GOV_POWERSAVE is not set
155CONFIG_CPU_FREQ_GOV_USERSPACE=y 173CONFIG_CPU_FREQ_GOV_USERSPACE=y
156CONFIG_CPU_FREQ_GOV_ONDEMAND=y 174CONFIG_CPU_FREQ_GOV_ONDEMAND=y
175# CONFIG_CPU_FREQ_GOV_CONSERVATIVE is not set
157 176
158# 177#
159# CPUFreq processor drivers 178# CPUFreq processor drivers
@@ -204,6 +223,72 @@ CONFIG_SYSVIPC_COMPAT=y
204CONFIG_UID16=y 223CONFIG_UID16=y
205 224
206# 225#
226# Networking
227#
228CONFIG_NET=y
229
230#
231# Networking options
232#
233CONFIG_PACKET=y
234# CONFIG_PACKET_MMAP is not set
235CONFIG_UNIX=y
236# CONFIG_NET_KEY is not set
237CONFIG_INET=y
238CONFIG_IP_MULTICAST=y
239# CONFIG_IP_ADVANCED_ROUTER is not set
240CONFIG_IP_FIB_HASH=y
241# CONFIG_IP_PNP is not set
242# CONFIG_NET_IPIP is not set
243# CONFIG_NET_IPGRE is not set
244# CONFIG_IP_MROUTE is not set
245# CONFIG_ARPD is not set
246# CONFIG_SYN_COOKIES is not set
247# CONFIG_INET_AH is not set
248# CONFIG_INET_ESP is not set
249# CONFIG_INET_IPCOMP is not set
250# CONFIG_INET_TUNNEL is not set
251CONFIG_IP_TCPDIAG=y
252CONFIG_IP_TCPDIAG_IPV6=y
253# CONFIG_TCP_CONG_ADVANCED is not set
254CONFIG_TCP_CONG_BIC=y
255CONFIG_IPV6=y
256# CONFIG_IPV6_PRIVACY is not set
257# CONFIG_INET6_AH is not set
258# CONFIG_INET6_ESP is not set
259# CONFIG_INET6_IPCOMP is not set
260# CONFIG_INET6_TUNNEL is not set
261# CONFIG_IPV6_TUNNEL is not set
262# CONFIG_NETFILTER is not set
263
264#
265# SCTP Configuration (EXPERIMENTAL)
266#
267# CONFIG_IP_SCTP is not set
268# CONFIG_ATM is not set
269# CONFIG_BRIDGE is not set
270# CONFIG_VLAN_8021Q is not set
271# CONFIG_DECNET is not set
272# CONFIG_LLC2 is not set
273# CONFIG_IPX is not set
274# CONFIG_ATALK is not set
275# CONFIG_X25 is not set
276# CONFIG_LAPB is not set
277# CONFIG_NET_DIVERT is not set
278# CONFIG_ECONET is not set
279# CONFIG_WAN_ROUTER is not set
280# CONFIG_NET_SCHED is not set
281# CONFIG_NET_CLS_ROUTE is not set
282
283#
284# Network testing
285#
286# CONFIG_NET_PKTGEN is not set
287# CONFIG_HAMRADIO is not set
288# CONFIG_IRDA is not set
289# CONFIG_BT is not set
290
291#
207# Device Drivers 292# Device Drivers
208# 293#
209 294
@@ -308,6 +393,7 @@ CONFIG_BLK_DEV_AMD74XX=y
308# CONFIG_BLK_DEV_HPT366 is not set 393# CONFIG_BLK_DEV_HPT366 is not set
309# CONFIG_BLK_DEV_SC1200 is not set 394# CONFIG_BLK_DEV_SC1200 is not set
310CONFIG_BLK_DEV_PIIX=y 395CONFIG_BLK_DEV_PIIX=y
396# CONFIG_BLK_DEV_IT821X is not set
311# CONFIG_BLK_DEV_NS87415 is not set 397# CONFIG_BLK_DEV_NS87415 is not set
312# CONFIG_BLK_DEV_PDC202XX_OLD is not set 398# CONFIG_BLK_DEV_PDC202XX_OLD is not set
313CONFIG_BLK_DEV_PDC202XX_NEW=y 399CONFIG_BLK_DEV_PDC202XX_NEW=y
@@ -338,6 +424,7 @@ CONFIG_BLK_DEV_SD=y
338# CONFIG_CHR_DEV_OSST is not set 424# CONFIG_CHR_DEV_OSST is not set
339# CONFIG_BLK_DEV_SR is not set 425# CONFIG_BLK_DEV_SR is not set
340# CONFIG_CHR_DEV_SG is not set 426# CONFIG_CHR_DEV_SG is not set
427# CONFIG_CHR_DEV_SCH is not set
341 428
342# 429#
343# Some SCSI devices (e.g. CD jukebox) support multiple LUNs 430# Some SCSI devices (e.g. CD jukebox) support multiple LUNs
@@ -402,6 +489,7 @@ CONFIG_SCSI_QLA2XXX=y
402# CONFIG_SCSI_QLA2300 is not set 489# CONFIG_SCSI_QLA2300 is not set
403# CONFIG_SCSI_QLA2322 is not set 490# CONFIG_SCSI_QLA2322 is not set
404# CONFIG_SCSI_QLA6312 is not set 491# CONFIG_SCSI_QLA6312 is not set
492# CONFIG_SCSI_QLA24XX is not set
405# CONFIG_SCSI_LPFC is not set 493# CONFIG_SCSI_LPFC is not set
406# CONFIG_SCSI_DC395x is not set 494# CONFIG_SCSI_DC395x is not set
407# CONFIG_SCSI_DC390T is not set 495# CONFIG_SCSI_DC390T is not set
@@ -410,13 +498,22 @@ CONFIG_SCSI_QLA2XXX=y
410# 498#
411# Multi-device support (RAID and LVM) 499# Multi-device support (RAID and LVM)
412# 500#
413# CONFIG_MD is not set 501CONFIG_MD=y
502# CONFIG_BLK_DEV_MD is not set
503CONFIG_BLK_DEV_DM=y
504# CONFIG_DM_CRYPT is not set
505# CONFIG_DM_SNAPSHOT is not set
506# CONFIG_DM_MIRROR is not set
507# CONFIG_DM_ZERO is not set
508# CONFIG_DM_MULTIPATH is not set
414 509
415# 510#
416# Fusion MPT device support 511# Fusion MPT device support
417# 512#
418CONFIG_FUSION=y 513CONFIG_FUSION=y
419CONFIG_FUSION_MAX_SGE=40 514CONFIG_FUSION_SPI=y
515# CONFIG_FUSION_FC is not set
516CONFIG_FUSION_MAX_SGE=128
420# CONFIG_FUSION_CTL is not set 517# CONFIG_FUSION_CTL is not set
421 518
422# 519#
@@ -430,75 +527,8 @@ CONFIG_FUSION_MAX_SGE=40
430# CONFIG_I2O is not set 527# CONFIG_I2O is not set
431 528
432# 529#
433# Networking support 530# Network device support
434#
435CONFIG_NET=y
436
437#
438# Networking options
439#
440CONFIG_PACKET=y
441# CONFIG_PACKET_MMAP is not set
442CONFIG_UNIX=y
443# CONFIG_NET_KEY is not set
444CONFIG_INET=y
445CONFIG_IP_MULTICAST=y
446# CONFIG_IP_ADVANCED_ROUTER is not set
447# CONFIG_IP_PNP is not set
448# CONFIG_NET_IPIP is not set
449# CONFIG_NET_IPGRE is not set
450# CONFIG_IP_MROUTE is not set
451# CONFIG_ARPD is not set
452# CONFIG_SYN_COOKIES is not set
453# CONFIG_INET_AH is not set
454# CONFIG_INET_ESP is not set
455# CONFIG_INET_IPCOMP is not set
456# CONFIG_INET_TUNNEL is not set
457CONFIG_IP_TCPDIAG=y
458CONFIG_IP_TCPDIAG_IPV6=y
459CONFIG_IPV6=y
460# CONFIG_IPV6_PRIVACY is not set
461# CONFIG_INET6_AH is not set
462# CONFIG_INET6_ESP is not set
463# CONFIG_INET6_IPCOMP is not set
464# CONFIG_INET6_TUNNEL is not set
465# CONFIG_IPV6_TUNNEL is not set
466# CONFIG_NETFILTER is not set
467
468#
469# SCTP Configuration (EXPERIMENTAL)
470# 531#
471# CONFIG_IP_SCTP is not set
472# CONFIG_ATM is not set
473# CONFIG_BRIDGE is not set
474# CONFIG_VLAN_8021Q is not set
475# CONFIG_DECNET is not set
476# CONFIG_LLC2 is not set
477# CONFIG_IPX is not set
478# CONFIG_ATALK is not set
479# CONFIG_X25 is not set
480# CONFIG_LAPB is not set
481# CONFIG_NET_DIVERT is not set
482# CONFIG_ECONET is not set
483# CONFIG_WAN_ROUTER is not set
484
485#
486# QoS and/or fair queueing
487#
488# CONFIG_NET_SCHED is not set
489# CONFIG_NET_CLS_ROUTE is not set
490
491#
492# Network testing
493#
494# CONFIG_NET_PKTGEN is not set
495CONFIG_NETPOLL=y
496# CONFIG_NETPOLL_RX is not set
497# CONFIG_NETPOLL_TRAP is not set
498CONFIG_NET_POLL_CONTROLLER=y
499# CONFIG_HAMRADIO is not set
500# CONFIG_IRDA is not set
501# CONFIG_BT is not set
502CONFIG_NETDEVICES=y 532CONFIG_NETDEVICES=y
503# CONFIG_DUMMY is not set 533# CONFIG_DUMMY is not set
504# CONFIG_BONDING is not set 534# CONFIG_BONDING is not set
@@ -517,7 +547,9 @@ CONFIG_NET_ETHERNET=y
517CONFIG_MII=y 547CONFIG_MII=y
518# CONFIG_HAPPYMEAL is not set 548# CONFIG_HAPPYMEAL is not set
519# CONFIG_SUNGEM is not set 549# CONFIG_SUNGEM is not set
520# CONFIG_NET_VENDOR_3COM is not set 550CONFIG_NET_VENDOR_3COM=y
551CONFIG_VORTEX=y
552# CONFIG_TYPHOON is not set
521 553
522# 554#
523# Tulip family network device support 555# Tulip family network device support
@@ -532,7 +564,7 @@ CONFIG_NET_PCI=y
532CONFIG_FORCEDETH=y 564CONFIG_FORCEDETH=y
533# CONFIG_DGRS is not set 565# CONFIG_DGRS is not set
534# CONFIG_EEPRO100 is not set 566# CONFIG_EEPRO100 is not set
535# CONFIG_E100 is not set 567CONFIG_E100=y
536# CONFIG_FEALNX is not set 568# CONFIG_FEALNX is not set
537# CONFIG_NATSEMI is not set 569# CONFIG_NATSEMI is not set
538# CONFIG_NE2K_PCI is not set 570# CONFIG_NE2K_PCI is not set
@@ -558,9 +590,11 @@ CONFIG_E1000=y
558# CONFIG_HAMACHI is not set 590# CONFIG_HAMACHI is not set
559# CONFIG_YELLOWFIN is not set 591# CONFIG_YELLOWFIN is not set
560# CONFIG_R8169 is not set 592# CONFIG_R8169 is not set
593# CONFIG_SKGE is not set
561# CONFIG_SK98LIN is not set 594# CONFIG_SK98LIN is not set
562# CONFIG_VIA_VELOCITY is not set 595# CONFIG_VIA_VELOCITY is not set
563CONFIG_TIGON3=y 596CONFIG_TIGON3=y
597# CONFIG_BNX2 is not set
564 598
565# 599#
566# Ethernet (10000 Mbit) 600# Ethernet (10000 Mbit)
@@ -591,6 +625,10 @@ CONFIG_S2IO=m
591# CONFIG_NET_FC is not set 625# CONFIG_NET_FC is not set
592# CONFIG_SHAPER is not set 626# CONFIG_SHAPER is not set
593CONFIG_NETCONSOLE=y 627CONFIG_NETCONSOLE=y
628CONFIG_NETPOLL=y
629# CONFIG_NETPOLL_RX is not set
630# CONFIG_NETPOLL_TRAP is not set
631CONFIG_NET_POLL_CONTROLLER=y
594 632
595# 633#
596# ISDN subsystem 634# ISDN subsystem
@@ -647,7 +685,6 @@ CONFIG_SERIO_I8042=y
647CONFIG_SERIO_LIBPS2=y 685CONFIG_SERIO_LIBPS2=y
648# CONFIG_SERIO_RAW is not set 686# CONFIG_SERIO_RAW is not set
649# CONFIG_GAMEPORT is not set 687# CONFIG_GAMEPORT is not set
650CONFIG_SOUND_GAMEPORT=y
651 688
652# 689#
653# Character devices 690# Character devices
@@ -716,6 +753,7 @@ CONFIG_MAX_RAW_DEVS=256
716# I2C support 753# I2C support
717# 754#
718# CONFIG_I2C is not set 755# CONFIG_I2C is not set
756# CONFIG_I2C_SENSOR is not set
719 757
720# 758#
721# Dallas's 1-wire bus 759# Dallas's 1-wire bus
@@ -723,6 +761,12 @@ CONFIG_MAX_RAW_DEVS=256
723# CONFIG_W1 is not set 761# CONFIG_W1 is not set
724 762
725# 763#
764# Hardware Monitoring support
765#
766CONFIG_HWMON=y
767# CONFIG_HWMON_DEBUG_CHIP is not set
768
769#
726# Misc devices 770# Misc devices
727# 771#
728# CONFIG_IBM_ASM is not set 772# CONFIG_IBM_ASM is not set
@@ -808,6 +852,7 @@ CONFIG_USB_DEVICEFS=y
808CONFIG_USB_EHCI_HCD=y 852CONFIG_USB_EHCI_HCD=y
809# CONFIG_USB_EHCI_SPLIT_ISO is not set 853# CONFIG_USB_EHCI_SPLIT_ISO is not set
810# CONFIG_USB_EHCI_ROOT_HUB_TT is not set 854# CONFIG_USB_EHCI_ROOT_HUB_TT is not set
855# CONFIG_USB_ISP116X_HCD is not set
811CONFIG_USB_OHCI_HCD=y 856CONFIG_USB_OHCI_HCD=y
812# CONFIG_USB_OHCI_BIG_ENDIAN is not set 857# CONFIG_USB_OHCI_BIG_ENDIAN is not set
813CONFIG_USB_OHCI_LITTLE_ENDIAN=y 858CONFIG_USB_OHCI_LITTLE_ENDIAN=y
@@ -846,12 +891,15 @@ CONFIG_USB_HIDINPUT=y
846# CONFIG_USB_HIDDEV is not set 891# CONFIG_USB_HIDDEV is not set
847# CONFIG_USB_AIPTEK is not set 892# CONFIG_USB_AIPTEK is not set
848# CONFIG_USB_WACOM is not set 893# CONFIG_USB_WACOM is not set
894# CONFIG_USB_ACECAD is not set
849# CONFIG_USB_KBTAB is not set 895# CONFIG_USB_KBTAB is not set
850# CONFIG_USB_POWERMATE is not set 896# CONFIG_USB_POWERMATE is not set
851# CONFIG_USB_MTOUCH is not set 897# CONFIG_USB_MTOUCH is not set
898# CONFIG_USB_ITMTOUCH is not set
852# CONFIG_USB_EGALAX is not set 899# CONFIG_USB_EGALAX is not set
853# CONFIG_USB_XPAD is not set 900# CONFIG_USB_XPAD is not set
854# CONFIG_USB_ATI_REMOTE is not set 901# CONFIG_USB_ATI_REMOTE is not set
902# CONFIG_USB_KEYSPAN_REMOTE is not set
855 903
856# 904#
857# USB Imaging devices 905# USB Imaging devices
@@ -902,10 +950,11 @@ CONFIG_USB_MON=y
902# CONFIG_USB_PHIDGETSERVO is not set 950# CONFIG_USB_PHIDGETSERVO is not set
903# CONFIG_USB_IDMOUSE is not set 951# CONFIG_USB_IDMOUSE is not set
904# CONFIG_USB_SISUSBVGA is not set 952# CONFIG_USB_SISUSBVGA is not set
953# CONFIG_USB_LD is not set
905# CONFIG_USB_TEST is not set 954# CONFIG_USB_TEST is not set
906 955
907# 956#
908# USB ATM/DSL drivers 957# USB DSL modem support
909# 958#
910 959
911# 960#
@@ -924,6 +973,10 @@ CONFIG_USB_MON=y
924# CONFIG_INFINIBAND is not set 973# CONFIG_INFINIBAND is not set
925 974
926# 975#
976# SN Devices
977#
978
979#
927# Firmware Drivers 980# Firmware Drivers
928# 981#
929# CONFIG_EDD is not set 982# CONFIG_EDD is not set
@@ -935,6 +988,7 @@ CONFIG_EXT2_FS=y
935CONFIG_EXT2_FS_XATTR=y 988CONFIG_EXT2_FS_XATTR=y
936CONFIG_EXT2_FS_POSIX_ACL=y 989CONFIG_EXT2_FS_POSIX_ACL=y
937# CONFIG_EXT2_FS_SECURITY is not set 990# CONFIG_EXT2_FS_SECURITY is not set
991# CONFIG_EXT2_FS_XIP is not set
938CONFIG_EXT3_FS=y 992CONFIG_EXT3_FS=y
939CONFIG_EXT3_FS_XATTR=y 993CONFIG_EXT3_FS_XATTR=y
940CONFIG_EXT3_FS_POSIX_ACL=y 994CONFIG_EXT3_FS_POSIX_ACL=y
@@ -957,6 +1011,7 @@ CONFIG_FS_POSIX_ACL=y
957# CONFIG_XFS_FS is not set 1011# CONFIG_XFS_FS is not set
958# CONFIG_MINIX_FS is not set 1012# CONFIG_MINIX_FS is not set
959# CONFIG_ROMFS_FS is not set 1013# CONFIG_ROMFS_FS is not set
1014CONFIG_INOTIFY=y
960# CONFIG_QUOTA is not set 1015# CONFIG_QUOTA is not set
961CONFIG_DNOTIFY=y 1016CONFIG_DNOTIFY=y
962CONFIG_AUTOFS_FS=y 1017CONFIG_AUTOFS_FS=y
@@ -986,7 +1041,6 @@ CONFIG_FAT_DEFAULT_IOCHARSET="iso8859-1"
986CONFIG_PROC_FS=y 1041CONFIG_PROC_FS=y
987CONFIG_PROC_KCORE=y 1042CONFIG_PROC_KCORE=y
988CONFIG_SYSFS=y 1043CONFIG_SYSFS=y
989# CONFIG_DEVFS_FS is not set
990# CONFIG_DEVPTS_FS_XATTR is not set 1044# CONFIG_DEVPTS_FS_XATTR is not set
991CONFIG_TMPFS=y 1045CONFIG_TMPFS=y
992# CONFIG_TMPFS_XATTR is not set 1046# CONFIG_TMPFS_XATTR is not set
@@ -1016,15 +1070,18 @@ CONFIG_RAMFS=y
1016# 1070#
1017CONFIG_NFS_FS=y 1071CONFIG_NFS_FS=y
1018CONFIG_NFS_V3=y 1072CONFIG_NFS_V3=y
1073# CONFIG_NFS_V3_ACL is not set
1019# CONFIG_NFS_V4 is not set 1074# CONFIG_NFS_V4 is not set
1020# CONFIG_NFS_DIRECTIO is not set 1075# CONFIG_NFS_DIRECTIO is not set
1021CONFIG_NFSD=y 1076CONFIG_NFSD=y
1022CONFIG_NFSD_V3=y 1077CONFIG_NFSD_V3=y
1078# CONFIG_NFSD_V3_ACL is not set
1023# CONFIG_NFSD_V4 is not set 1079# CONFIG_NFSD_V4 is not set
1024CONFIG_NFSD_TCP=y 1080CONFIG_NFSD_TCP=y
1025CONFIG_LOCKD=y 1081CONFIG_LOCKD=y
1026CONFIG_LOCKD_V4=y 1082CONFIG_LOCKD_V4=y
1027CONFIG_EXPORTFS=y 1083CONFIG_EXPORTFS=y
1084CONFIG_NFS_COMMON=y
1028CONFIG_SUNRPC=y 1085CONFIG_SUNRPC=y
1029# CONFIG_RPCSEC_GSS_KRB5 is not set 1086# CONFIG_RPCSEC_GSS_KRB5 is not set
1030# CONFIG_RPCSEC_GSS_SPKM3 is not set 1087# CONFIG_RPCSEC_GSS_SPKM3 is not set
diff --git a/arch/x86_64/ia32/Makefile b/arch/x86_64/ia32/Makefile
index a12b19da4b59..f76217d8f579 100644
--- a/arch/x86_64/ia32/Makefile
+++ b/arch/x86_64/ia32/Makefile
@@ -4,14 +4,14 @@
4 4
5obj-$(CONFIG_IA32_EMULATION) := ia32entry.o sys_ia32.o ia32_ioctl.o \ 5obj-$(CONFIG_IA32_EMULATION) := ia32entry.o sys_ia32.o ia32_ioctl.o \
6 ia32_signal.o tls32.o \ 6 ia32_signal.o tls32.o \
7 ia32_binfmt.o fpu32.o ptrace32.o syscall32.o 7 ia32_binfmt.o fpu32.o ptrace32.o syscall32.o syscall32_syscall.o
8 8
9sysv-$(CONFIG_SYSVIPC) := ipc32.o 9sysv-$(CONFIG_SYSVIPC) := ipc32.o
10obj-$(CONFIG_IA32_EMULATION) += $(sysv-y) 10obj-$(CONFIG_IA32_EMULATION) += $(sysv-y)
11 11
12obj-$(CONFIG_IA32_AOUT) += ia32_aout.o 12obj-$(CONFIG_IA32_AOUT) += ia32_aout.o
13 13
14$(obj)/syscall32.o: $(src)/syscall32.c \ 14$(obj)/syscall32_syscall.o: \
15 $(foreach F,sysenter syscall,$(obj)/vsyscall-$F.so) 15 $(foreach F,sysenter syscall,$(obj)/vsyscall-$F.so)
16 16
17# Teach kbuild about targets 17# Teach kbuild about targets
diff --git a/arch/x86_64/ia32/ia32_aout.c b/arch/x86_64/ia32/ia32_aout.c
index c12edf5d97f0..3e6780fa0186 100644
--- a/arch/x86_64/ia32/ia32_aout.c
+++ b/arch/x86_64/ia32/ia32_aout.c
@@ -42,7 +42,7 @@ extern int ia32_setup_arg_pages(struct linux_binprm *bprm,
42static int load_aout_binary(struct linux_binprm *, struct pt_regs * regs); 42static int load_aout_binary(struct linux_binprm *, struct pt_regs * regs);
43static int load_aout_library(struct file*); 43static int load_aout_library(struct file*);
44 44
45#if CORE_DUMP 45#ifdef CORE_DUMP
46static int aout_core_dump(long signr, struct pt_regs * regs, struct file *file); 46static int aout_core_dump(long signr, struct pt_regs * regs, struct file *file);
47 47
48/* 48/*
@@ -103,7 +103,7 @@ static struct linux_binfmt aout_format = {
103 .module = THIS_MODULE, 103 .module = THIS_MODULE,
104 .load_binary = load_aout_binary, 104 .load_binary = load_aout_binary,
105 .load_shlib = load_aout_library, 105 .load_shlib = load_aout_library,
106#if CORE_DUMP 106#ifdef CORE_DUMP
107 .core_dump = aout_core_dump, 107 .core_dump = aout_core_dump,
108#endif 108#endif
109 .min_coredump = PAGE_SIZE 109 .min_coredump = PAGE_SIZE
@@ -120,7 +120,7 @@ static void set_brk(unsigned long start, unsigned long end)
120 up_write(&current->mm->mmap_sem); 120 up_write(&current->mm->mmap_sem);
121} 121}
122 122
123#if CORE_DUMP 123#ifdef CORE_DUMP
124/* 124/*
125 * These are the only things you should do on a core-file: use only these 125 * These are the only things you should do on a core-file: use only these
126 * macros to write out all the necessary info. 126 * macros to write out all the necessary info.
diff --git a/arch/x86_64/ia32/ia32entry.S b/arch/x86_64/ia32/ia32entry.S
index cc935427d532..c45d6a05b984 100644
--- a/arch/x86_64/ia32/ia32entry.S
+++ b/arch/x86_64/ia32/ia32entry.S
@@ -591,11 +591,15 @@ ia32_sys_call_table:
591 .quad compat_sys_mq_getsetattr 591 .quad compat_sys_mq_getsetattr
592 .quad compat_sys_kexec_load /* reserved for kexec */ 592 .quad compat_sys_kexec_load /* reserved for kexec */
593 .quad compat_sys_waitid 593 .quad compat_sys_waitid
594 .quad quiet_ni_syscall /* sys_altroot */ 594 .quad quiet_ni_syscall /* 285: sys_altroot */
595 .quad sys_add_key 595 .quad sys_add_key
596 .quad sys_request_key 596 .quad sys_request_key
597 .quad sys_keyctl 597 .quad sys_keyctl
598 /* don't forget to change IA32_NR_syscalls */ 598 .quad sys_ioprio_set
599 .quad sys_ioprio_get /* 290 */
600 .quad sys_inotify_init
601 .quad sys_inotify_add_watch
602 .quad sys_inotify_rm_watch
599ia32_syscall_end: 603ia32_syscall_end:
600 .rept IA32_NR_syscalls-(ia32_syscall_end-ia32_sys_call_table)/8 604 .rept IA32_NR_syscalls-(ia32_syscall_end-ia32_sys_call_table)/8
601 .quad ni_syscall 605 .quad ni_syscall
diff --git a/arch/x86_64/ia32/ptrace32.c b/arch/x86_64/ia32/ptrace32.c
index b98b6d2462f6..2a925e2af390 100644
--- a/arch/x86_64/ia32/ptrace32.c
+++ b/arch/x86_64/ia32/ptrace32.c
@@ -43,11 +43,11 @@ static int putreg32(struct task_struct *child, unsigned regno, u32 val)
43 switch (regno) { 43 switch (regno) {
44 case offsetof(struct user32, regs.fs): 44 case offsetof(struct user32, regs.fs):
45 if (val && (val & 3) != 3) return -EIO; 45 if (val && (val & 3) != 3) return -EIO;
46 child->thread.fs = val & 0xffff; 46 child->thread.fsindex = val & 0xffff;
47 break; 47 break;
48 case offsetof(struct user32, regs.gs): 48 case offsetof(struct user32, regs.gs):
49 if (val && (val & 3) != 3) return -EIO; 49 if (val && (val & 3) != 3) return -EIO;
50 child->thread.gs = val & 0xffff; 50 child->thread.gsindex = val & 0xffff;
51 break; 51 break;
52 case offsetof(struct user32, regs.ds): 52 case offsetof(struct user32, regs.ds):
53 if (val && (val & 3) != 3) return -EIO; 53 if (val && (val & 3) != 3) return -EIO;
@@ -138,10 +138,10 @@ static int getreg32(struct task_struct *child, unsigned regno, u32 *val)
138 138
139 switch (regno) { 139 switch (regno) {
140 case offsetof(struct user32, regs.fs): 140 case offsetof(struct user32, regs.fs):
141 *val = child->thread.fs; 141 *val = child->thread.fsindex;
142 break; 142 break;
143 case offsetof(struct user32, regs.gs): 143 case offsetof(struct user32, regs.gs):
144 *val = child->thread.gs; 144 *val = child->thread.gsindex;
145 break; 145 break;
146 case offsetof(struct user32, regs.ds): 146 case offsetof(struct user32, regs.ds):
147 *val = child->thread.ds; 147 *val = child->thread.ds;
diff --git a/arch/x86_64/ia32/sys_ia32.c b/arch/x86_64/ia32/sys_ia32.c
index 68a9ab06ee7c..be996d1b691e 100644
--- a/arch/x86_64/ia32/sys_ia32.c
+++ b/arch/x86_64/ia32/sys_ia32.c
@@ -61,6 +61,7 @@
61#include <linux/ptrace.h> 61#include <linux/ptrace.h>
62#include <linux/highuid.h> 62#include <linux/highuid.h>
63#include <linux/vmalloc.h> 63#include <linux/vmalloc.h>
64#include <linux/fsnotify.h>
64#include <asm/mman.h> 65#include <asm/mman.h>
65#include <asm/types.h> 66#include <asm/types.h>
66#include <asm/uaccess.h> 67#include <asm/uaccess.h>
@@ -984,8 +985,10 @@ asmlinkage long sys32_open(const char __user * filename, int flags, int mode)
984 if (IS_ERR(f)) { 985 if (IS_ERR(f)) {
985 put_unused_fd(fd); 986 put_unused_fd(fd);
986 fd = error; 987 fd = error;
987 } else 988 } else {
989 fsnotify_open(f->f_dentry);
988 fd_install(fd, f); 990 fd_install(fd, f);
991 }
989 } 992 }
990 putname(tmp); 993 putname(tmp);
991 } 994 }
diff --git a/arch/x86_64/ia32/syscall32.c b/arch/x86_64/ia32/syscall32.c
index 01d8db1a1c09..adbc5f8089e9 100644
--- a/arch/x86_64/ia32/syscall32.c
+++ b/arch/x86_64/ia32/syscall32.c
@@ -14,16 +14,6 @@
14#include <asm/tlbflush.h> 14#include <asm/tlbflush.h>
15#include <asm/ia32_unistd.h> 15#include <asm/ia32_unistd.h>
16 16
17/* 32bit VDSOs mapped into user space. */
18asm(".section \".init.data\",\"aw\"\n"
19 "syscall32_syscall:\n"
20 ".incbin \"arch/x86_64/ia32/vsyscall-syscall.so\"\n"
21 "syscall32_syscall_end:\n"
22 "syscall32_sysenter:\n"
23 ".incbin \"arch/x86_64/ia32/vsyscall-sysenter.so\"\n"
24 "syscall32_sysenter_end:\n"
25 ".previous");
26
27extern unsigned char syscall32_syscall[], syscall32_syscall_end[]; 17extern unsigned char syscall32_syscall[], syscall32_syscall_end[];
28extern unsigned char syscall32_sysenter[], syscall32_sysenter_end[]; 18extern unsigned char syscall32_sysenter[], syscall32_sysenter_end[];
29extern int sysctl_vsyscall32; 19extern int sysctl_vsyscall32;
@@ -57,6 +47,7 @@ int syscall32_setup_pages(struct linux_binprm *bprm, int exstack)
57 int npages = (VSYSCALL32_END - VSYSCALL32_BASE) >> PAGE_SHIFT; 47 int npages = (VSYSCALL32_END - VSYSCALL32_BASE) >> PAGE_SHIFT;
58 struct vm_area_struct *vma; 48 struct vm_area_struct *vma;
59 struct mm_struct *mm = current->mm; 49 struct mm_struct *mm = current->mm;
50 int ret;
60 51
61 vma = kmem_cache_alloc(vm_area_cachep, SLAB_KERNEL); 52 vma = kmem_cache_alloc(vm_area_cachep, SLAB_KERNEL);
62 if (!vma) 53 if (!vma)
@@ -78,7 +69,11 @@ int syscall32_setup_pages(struct linux_binprm *bprm, int exstack)
78 vma->vm_mm = mm; 69 vma->vm_mm = mm;
79 70
80 down_write(&mm->mmap_sem); 71 down_write(&mm->mmap_sem);
81 insert_vm_struct(mm, vma); 72 if ((ret = insert_vm_struct(mm, vma))) {
73 up_write(&mm->mmap_sem);
74 kmem_cache_free(vm_area_cachep, vma);
75 return ret;
76 }
82 mm->total_vm += npages; 77 mm->total_vm += npages;
83 up_write(&mm->mmap_sem); 78 up_write(&mm->mmap_sem);
84 return 0; 79 return 0;
diff --git a/arch/x86_64/ia32/syscall32_syscall.S b/arch/x86_64/ia32/syscall32_syscall.S
new file mode 100644
index 000000000000..8f8271bdf135
--- /dev/null
+++ b/arch/x86_64/ia32/syscall32_syscall.S
@@ -0,0 +1,17 @@
1/* 32bit VDSOs mapped into user space. */
2
3 .section ".init.data","aw"
4
5 .globl syscall32_syscall
6 .globl syscall32_syscall_end
7
8syscall32_syscall:
9 .incbin "arch/x86_64/ia32/vsyscall-syscall.so"
10syscall32_syscall_end:
11
12 .globl syscall32_sysenter
13 .globl syscall32_sysenter_end
14
15syscall32_sysenter:
16 .incbin "arch/x86_64/ia32/vsyscall-sysenter.so"
17syscall32_sysenter_end:
diff --git a/arch/x86_64/kernel/Makefile b/arch/x86_64/kernel/Makefile
index 48f9e2c19cd6..c32e198d7b2b 100644
--- a/arch/x86_64/kernel/Makefile
+++ b/arch/x86_64/kernel/Makefile
@@ -4,10 +4,10 @@
4 4
5extra-y := head.o head64.o init_task.o vmlinux.lds 5extra-y := head.o head64.o init_task.o vmlinux.lds
6EXTRA_AFLAGS := -traditional 6EXTRA_AFLAGS := -traditional
7obj-y := process.o semaphore.o signal.o entry.o traps.o irq.o \ 7obj-y := process.o signal.o entry.o traps.o irq.o \
8 ptrace.o time.o ioport.o ldt.o setup.o i8259.o sys_x86_64.o \ 8 ptrace.o time.o ioport.o ldt.o setup.o i8259.o sys_x86_64.o \
9 x8664_ksyms.o i387.o syscall.o vsyscall.o \ 9 x8664_ksyms.o i387.o syscall.o vsyscall.o \
10 setup64.o bootflag.o e820.o reboot.o quirks.o 10 setup64.o bootflag.o e820.o reboot.o quirks.o i8237.o
11 11
12obj-$(CONFIG_X86_MCE) += mce.o 12obj-$(CONFIG_X86_MCE) += mce.o
13obj-$(CONFIG_X86_MCE_INTEL) += mce_intel.o 13obj-$(CONFIG_X86_MCE_INTEL) += mce_intel.o
@@ -45,3 +45,4 @@ swiotlb-$(CONFIG_SWIOTLB) += ../../ia64/lib/swiotlb.o
45microcode-$(subst m,y,$(CONFIG_MICROCODE)) += ../../i386/kernel/microcode.o 45microcode-$(subst m,y,$(CONFIG_MICROCODE)) += ../../i386/kernel/microcode.o
46intel_cacheinfo-y += ../../i386/kernel/cpu/intel_cacheinfo.o 46intel_cacheinfo-y += ../../i386/kernel/cpu/intel_cacheinfo.o
47quirks-y += ../../i386/kernel/quirks.o 47quirks-y += ../../i386/kernel/quirks.o
48i8237-y += ../../i386/kernel/i8237.o
diff --git a/arch/x86_64/kernel/e820.c b/arch/x86_64/kernel/e820.c
index 6ded3a50dfe6..b548dea4e5b9 100644
--- a/arch/x86_64/kernel/e820.c
+++ b/arch/x86_64/kernel/e820.c
@@ -185,6 +185,40 @@ unsigned long __init e820_end_of_ram(void)
185} 185}
186 186
187/* 187/*
188 * Compute how much memory is missing in a range.
189 * Unlike the other functions in this file the arguments are in page numbers.
190 */
191unsigned long __init
192e820_hole_size(unsigned long start_pfn, unsigned long end_pfn)
193{
194 unsigned long ram = 0;
195 unsigned long start = start_pfn << PAGE_SHIFT;
196 unsigned long end = end_pfn << PAGE_SHIFT;
197 int i;
198 for (i = 0; i < e820.nr_map; i++) {
199 struct e820entry *ei = &e820.map[i];
200 unsigned long last, addr;
201
202 if (ei->type != E820_RAM ||
203 ei->addr+ei->size <= start ||
204 ei->addr >= end)
205 continue;
206
207 addr = round_up(ei->addr, PAGE_SIZE);
208 if (addr < start)
209 addr = start;
210
211 last = round_down(ei->addr + ei->size, PAGE_SIZE);
212 if (last >= end)
213 last = end;
214
215 if (last > addr)
216 ram += last - addr;
217 }
218 return ((end - start) - ram) >> PAGE_SHIFT;
219}
220
221/*
188 * Mark e820 reserved areas as busy for the resource manager. 222 * Mark e820 reserved areas as busy for the resource manager.
189 */ 223 */
190void __init e820_reserve_resources(void) 224void __init e820_reserve_resources(void)
diff --git a/arch/x86_64/kernel/entry.S b/arch/x86_64/kernel/entry.S
index 28817490fdc6..096d470e280f 100644
--- a/arch/x86_64/kernel/entry.S
+++ b/arch/x86_64/kernel/entry.S
@@ -76,7 +76,7 @@
76 76
77 .macro FAKE_STACK_FRAME child_rip 77 .macro FAKE_STACK_FRAME child_rip
78 /* push in order ss, rsp, eflags, cs, rip */ 78 /* push in order ss, rsp, eflags, cs, rip */
79 xorq %rax, %rax 79 xorl %eax, %eax
80 pushq %rax /* ss */ 80 pushq %rax /* ss */
81 CFI_ADJUST_CFA_OFFSET 8 81 CFI_ADJUST_CFA_OFFSET 8
82 pushq %rax /* rsp */ 82 pushq %rax /* rsp */
@@ -423,7 +423,7 @@ ENTRY(stub_rt_sigreturn)
423 testl $3,CS(%rdi) 423 testl $3,CS(%rdi)
424 je 1f 424 je 1f
425 swapgs 425 swapgs
4261: addl $1,%gs:pda_irqcount # RED-PEN should check preempt count 4261: incl %gs:pda_irqcount # RED-PEN should check preempt count
427 movq %gs:pda_irqstackptr,%rax 427 movq %gs:pda_irqstackptr,%rax
428 cmoveq %rax,%rsp 428 cmoveq %rax,%rsp
429 pushq %rdi # save old stack 429 pushq %rdi # save old stack
@@ -436,7 +436,7 @@ ENTRY(common_interrupt)
436ret_from_intr: 436ret_from_intr:
437 popq %rdi 437 popq %rdi
438 cli 438 cli
439 subl $1,%gs:pda_irqcount 439 decl %gs:pda_irqcount
440#ifdef CONFIG_DEBUG_INFO 440#ifdef CONFIG_DEBUG_INFO
441 movq RBP(%rdi),%rbp 441 movq RBP(%rdi),%rbp
442#endif 442#endif
@@ -494,7 +494,7 @@ retint_signal:
494 sti 494 sti
495 SAVE_REST 495 SAVE_REST
496 movq $-1,ORIG_RAX(%rsp) 496 movq $-1,ORIG_RAX(%rsp)
497 xorq %rsi,%rsi # oldset 497 xorl %esi,%esi # oldset
498 movq %rsp,%rdi # &pt_regs 498 movq %rsp,%rdi # &pt_regs
499 call do_notify_resume 499 call do_notify_resume
500 RESTORE_REST 500 RESTORE_REST
@@ -752,7 +752,7 @@ child_rip:
752 movq %rsi, %rdi 752 movq %rsi, %rdi
753 call *%rax 753 call *%rax
754 # exit 754 # exit
755 xorq %rdi, %rdi 755 xorl %edi, %edi
756 call do_exit 756 call do_exit
757 757
758/* 758/*
@@ -918,3 +918,15 @@ ENTRY(machine_check)
918ENTRY(call_debug) 918ENTRY(call_debug)
919 zeroentry do_call_debug 919 zeroentry do_call_debug
920 920
921ENTRY(call_softirq)
922 movq %gs:pda_irqstackptr,%rax
923 pushq %r15
924 movq %rsp,%r15
925 incl %gs:pda_irqcount
926 cmove %rax,%rsp
927 call __do_softirq
928 movq %r15,%rsp
929 decl %gs:pda_irqcount
930 popq %r15
931 ret
932
diff --git a/arch/x86_64/kernel/genapic.c b/arch/x86_64/kernel/genapic.c
index 69b9c25a8fc4..30c843a5efdd 100644
--- a/arch/x86_64/kernel/genapic.c
+++ b/arch/x86_64/kernel/genapic.c
@@ -31,6 +31,7 @@ u8 x86_cpu_to_log_apicid[NR_CPUS] = { [0 ... NR_CPUS-1] = BAD_APICID };
31 31
32extern struct genapic apic_cluster; 32extern struct genapic apic_cluster;
33extern struct genapic apic_flat; 33extern struct genapic apic_flat;
34extern struct genapic apic_physflat;
34 35
35struct genapic *genapic = &apic_flat; 36struct genapic *genapic = &apic_flat;
36 37
@@ -44,12 +45,7 @@ void __init clustered_apic_check(void)
44 u8 clusters, max_cluster; 45 u8 clusters, max_cluster;
45 u8 id; 46 u8 id;
46 u8 cluster_cnt[NUM_APIC_CLUSTERS]; 47 u8 cluster_cnt[NUM_APIC_CLUSTERS];
47 48 int num_cpus = 0;
48 if (boot_cpu_data.x86_vendor == X86_VENDOR_AMD) {
49 /* AMD always uses flat mode right now */
50 genapic = &apic_flat;
51 goto print;
52 }
53 49
54#if defined(CONFIG_ACPI_BUS) 50#if defined(CONFIG_ACPI_BUS)
55 /* 51 /*
@@ -64,15 +60,34 @@ void __init clustered_apic_check(void)
64#endif 60#endif
65 61
66 memset(cluster_cnt, 0, sizeof(cluster_cnt)); 62 memset(cluster_cnt, 0, sizeof(cluster_cnt));
67
68 for (i = 0; i < NR_CPUS; i++) { 63 for (i = 0; i < NR_CPUS; i++) {
69 id = bios_cpu_apicid[i]; 64 id = bios_cpu_apicid[i];
70 if (id != BAD_APICID) 65 if (id == BAD_APICID)
71 cluster_cnt[APIC_CLUSTERID(id)]++; 66 continue;
67 num_cpus++;
68 cluster_cnt[APIC_CLUSTERID(id)]++;
72 } 69 }
73 70
71 /* Don't use clustered mode on AMD platforms. */
72 if (boot_cpu_data.x86_vendor == X86_VENDOR_AMD) {
73 genapic = &apic_physflat;
74#ifndef CONFIG_CPU_HOTPLUG
75 /* In the CPU hotplug case we cannot use broadcast mode
76 because that opens a race when a CPU is removed.
77 Stay at physflat mode in this case.
78 It is bad to do this unconditionally though. Once
79 we have ACPI platform support for CPU hotplug
80 we should detect hotplug capablity from ACPI tables and
81 only do this when really needed. -AK */
82 if (num_cpus <= 8)
83 genapic = &apic_flat;
84#endif
85 goto print;
86 }
87
74 clusters = 0; 88 clusters = 0;
75 max_cluster = 0; 89 max_cluster = 0;
90
76 for (i = 0; i < NUM_APIC_CLUSTERS; i++) { 91 for (i = 0; i < NUM_APIC_CLUSTERS; i++) {
77 if (cluster_cnt[i] > 0) { 92 if (cluster_cnt[i] > 0) {
78 ++clusters; 93 ++clusters;
diff --git a/arch/x86_64/kernel/genapic_flat.c b/arch/x86_64/kernel/genapic_flat.c
index 282846965080..adc96282a9e2 100644
--- a/arch/x86_64/kernel/genapic_flat.c
+++ b/arch/x86_64/kernel/genapic_flat.c
@@ -2,13 +2,11 @@
2 * Copyright 2004 James Cleverdon, IBM. 2 * Copyright 2004 James Cleverdon, IBM.
3 * Subject to the GNU Public License, v.2 3 * Subject to the GNU Public License, v.2
4 * 4 *
5 * Flat APIC subarch code. Maximum 8 CPUs, logical delivery. 5 * Flat APIC subarch code.
6 * 6 *
7 * Hacked for x86-64 by James Cleverdon from i386 architecture code by 7 * Hacked for x86-64 by James Cleverdon from i386 architecture code by
8 * Martin Bligh, Andi Kleen, James Bottomley, John Stultz, and 8 * Martin Bligh, Andi Kleen, James Bottomley, John Stultz, and
9 * James Cleverdon. 9 * James Cleverdon.
10 * Ashok Raj <ashok.raj@intel.com>
11 * Removed IPI broadcast shortcut to support CPU hotplug
12 */ 10 */
13#include <linux/config.h> 11#include <linux/config.h>
14#include <linux/threads.h> 12#include <linux/threads.h>
@@ -20,47 +18,6 @@
20#include <asm/smp.h> 18#include <asm/smp.h>
21#include <asm/ipi.h> 19#include <asm/ipi.h>
22 20
23/*
24 * The following permit choosing broadcast IPI shortcut v.s sending IPI only
25 * to online cpus via the send_IPI_mask varient.
26 * The mask version is my preferred option, since it eliminates a lot of
27 * other extra code that would need to be written to cleanup intrs sent
28 * to a CPU while offline.
29 *
30 * Sending broadcast introduces lots of trouble in CPU hotplug situations.
31 * These IPI's are delivered to cpu's irrespective of their offline status
32 * and could pickup stale intr data when these CPUS are turned online.
33 *
34 * Not using broadcast is a cleaner approach IMO, but Andi Kleen disagrees with
35 * the idea of not using broadcast IPI's anymore. Hence the run time check
36 * is introduced, on his request so we can choose an alternate mechanism.
37 *
38 * Initial wacky performance tests that collect cycle counts show
39 * no increase in using mask v.s broadcast version. In fact they seem
40 * identical in terms of cycle counts.
41 *
42 * if we need to use broadcast, we need to do the following.
43 *
44 * cli;
45 * hold call_lock;
46 * clear any pending IPI, just ack and clear all pending intr
47 * set cpu_online_map;
48 * release call_lock;
49 * sti;
50 *
51 * The complicated dummy irq processing shown above is not required if
52 * we didnt sent IPI's to wrong CPU's in the first place.
53 *
54 * - Ashok Raj <ashok.raj@intel.com>
55 */
56#ifdef CONFIG_HOTPLUG_CPU
57#define DEFAULT_SEND_IPI (1)
58#else
59#define DEFAULT_SEND_IPI (0)
60#endif
61
62static int no_broadcast=DEFAULT_SEND_IPI;
63
64static cpumask_t flat_target_cpus(void) 21static cpumask_t flat_target_cpus(void)
65{ 22{
66 return cpu_online_map; 23 return cpu_online_map;
@@ -119,37 +76,15 @@ static void flat_send_IPI_mask(cpumask_t cpumask, int vector)
119 local_irq_restore(flags); 76 local_irq_restore(flags);
120} 77}
121 78
122static inline void __local_flat_send_IPI_allbutself(int vector)
123{
124 if (no_broadcast) {
125 cpumask_t mask = cpu_online_map;
126 int this_cpu = get_cpu();
127
128 cpu_clear(this_cpu, mask);
129 flat_send_IPI_mask(mask, vector);
130 put_cpu();
131 }
132 else
133 __send_IPI_shortcut(APIC_DEST_ALLBUT, vector, APIC_DEST_LOGICAL);
134}
135
136static inline void __local_flat_send_IPI_all(int vector)
137{
138 if (no_broadcast)
139 flat_send_IPI_mask(cpu_online_map, vector);
140 else
141 __send_IPI_shortcut(APIC_DEST_ALLINC, vector, APIC_DEST_LOGICAL);
142}
143
144static void flat_send_IPI_allbutself(int vector) 79static void flat_send_IPI_allbutself(int vector)
145{ 80{
146 if (((num_online_cpus()) - 1) >= 1) 81 if (((num_online_cpus()) - 1) >= 1)
147 __local_flat_send_IPI_allbutself(vector); 82 __send_IPI_shortcut(APIC_DEST_ALLBUT, vector,APIC_DEST_LOGICAL);
148} 83}
149 84
150static void flat_send_IPI_all(int vector) 85static void flat_send_IPI_all(int vector)
151{ 86{
152 __local_flat_send_IPI_all(vector); 87 __send_IPI_shortcut(APIC_DEST_ALLINC, vector, APIC_DEST_LOGICAL);
153} 88}
154 89
155static int flat_apic_id_registered(void) 90static int flat_apic_id_registered(void)
@@ -170,16 +105,6 @@ static unsigned int phys_pkg_id(int index_msb)
170 return ((ebx >> 24) & 0xFF) >> index_msb; 105 return ((ebx >> 24) & 0xFF) >> index_msb;
171} 106}
172 107
173static __init int no_ipi_broadcast(char *str)
174{
175 get_option(&str, &no_broadcast);
176 printk ("Using %s mode\n", no_broadcast ? "No IPI Broadcast" :
177 "IPI Broadcast");
178 return 1;
179}
180
181__setup("no_ipi_broadcast", no_ipi_broadcast);
182
183struct genapic apic_flat = { 108struct genapic apic_flat = {
184 .name = "flat", 109 .name = "flat",
185 .int_delivery_mode = dest_LowestPrio, 110 .int_delivery_mode = dest_LowestPrio,
@@ -195,11 +120,62 @@ struct genapic apic_flat = {
195 .phys_pkg_id = phys_pkg_id, 120 .phys_pkg_id = phys_pkg_id,
196}; 121};
197 122
198static int __init print_ipi_mode(void) 123/*
124 * Physflat mode is used when there are more than 8 CPUs on a AMD system.
125 * We cannot use logical delivery in this case because the mask
126 * overflows, so use physical mode.
127 */
128
129static cpumask_t physflat_target_cpus(void)
130{
131 return cpumask_of_cpu(0);
132}
133
134static void physflat_send_IPI_mask(cpumask_t cpumask, int vector)
135{
136 send_IPI_mask_sequence(cpumask, vector);
137}
138
139static void physflat_send_IPI_allbutself(int vector)
140{
141 cpumask_t allbutme = cpu_online_map;
142 int me = get_cpu();
143 cpu_clear(me, allbutme);
144 physflat_send_IPI_mask(allbutme, vector);
145 put_cpu();
146}
147
148static void physflat_send_IPI_all(int vector)
199{ 149{
200 printk ("Using IPI %s mode\n", no_broadcast ? "No-Shortcut" : 150 physflat_send_IPI_mask(cpu_online_map, vector);
201 "Shortcut");
202 return 0;
203} 151}
204 152
205late_initcall(print_ipi_mode); 153static unsigned int physflat_cpu_mask_to_apicid(cpumask_t cpumask)
154{
155 int cpu;
156
157 /*
158 * We're using fixed IRQ delivery, can only return one phys APIC ID.
159 * May as well be the first.
160 */
161 cpu = first_cpu(cpumask);
162 if ((unsigned)cpu < NR_CPUS)
163 return x86_cpu_to_apicid[cpu];
164 else
165 return BAD_APICID;
166}
167
168struct genapic apic_physflat = {
169 .name = "physical flat",
170 .int_delivery_mode = dest_LowestPrio,
171 .int_dest_mode = (APIC_DEST_PHYSICAL != 0),
172 .int_delivery_dest = APIC_DEST_PHYSICAL | APIC_DM_LOWEST,
173 .target_cpus = physflat_target_cpus,
174 .apic_id_registered = flat_apic_id_registered,
175 .init_apic_ldr = flat_init_apic_ldr,/*not needed, but shouldn't hurt*/
176 .send_IPI_all = physflat_send_IPI_all,
177 .send_IPI_allbutself = physflat_send_IPI_allbutself,
178 .send_IPI_mask = physflat_send_IPI_mask,
179 .cpu_mask_to_apicid = physflat_cpu_mask_to_apicid,
180 .phys_pkg_id = phys_pkg_id,
181};
diff --git a/arch/x86_64/kernel/head.S b/arch/x86_64/kernel/head.S
index 8d765aa77a26..98ff5eb32b9a 100644
--- a/arch/x86_64/kernel/head.S
+++ b/arch/x86_64/kernel/head.S
@@ -137,14 +137,14 @@ startup_64:
137 wrmsr 137 wrmsr
138 138
139 /* Setup cr0 */ 139 /* Setup cr0 */
140 xorq %rax, %rax 140#define CR0_PM 1 /* protected mode */
141 btsq $31, %rax /* Enable paging */ 141#define CR0_MP (1<<1)
142 btsq $0, %rax /* Enable protected mode */ 142#define CR0_ET (1<<4)
143 btsq $1, %rax /* Enable MP */ 143#define CR0_NE (1<<5)
144 btsq $4, %rax /* Enable ET */ 144#define CR0_WP (1<<16)
145 btsq $5, %rax /* Enable NE */ 145#define CR0_AM (1<<18)
146 btsq $16, %rax /* Enable WP */ 146#define CR0_PAGING (1<<31)
147 btsq $18, %rax /* Enable AM */ 147 movl $CR0_PM|CR0_MP|CR0_ET|CR0_NE|CR0_WP|CR0_AM|CR0_PAGING,%eax
148 /* Make changes effective */ 148 /* Make changes effective */
149 movq %rax, %cr0 149 movq %rax, %cr0
150 150
diff --git a/arch/x86_64/kernel/irq.c b/arch/x86_64/kernel/irq.c
index cc3fb85f5145..849a20aec7ca 100644
--- a/arch/x86_64/kernel/irq.c
+++ b/arch/x86_64/kernel/irq.c
@@ -135,3 +135,22 @@ void fixup_irqs(cpumask_t map)
135 local_irq_disable(); 135 local_irq_disable();
136} 136}
137#endif 137#endif
138
139extern void call_softirq(void);
140
141asmlinkage void do_softirq(void)
142{
143 __u32 pending;
144 unsigned long flags;
145
146 if (in_interrupt())
147 return;
148
149 local_irq_save(flags);
150 pending = local_softirq_pending();
151 /* Switch to interrupt stack */
152 if (pending)
153 call_softirq();
154 local_irq_restore(flags);
155}
156EXPORT_SYMBOL(do_softirq);
diff --git a/arch/x86_64/kernel/machine_kexec.c b/arch/x86_64/kernel/machine_kexec.c
index 60d1eff41567..89fab51e20f4 100644
--- a/arch/x86_64/kernel/machine_kexec.c
+++ b/arch/x86_64/kernel/machine_kexec.c
@@ -8,43 +8,26 @@
8 8
9#include <linux/mm.h> 9#include <linux/mm.h>
10#include <linux/kexec.h> 10#include <linux/kexec.h>
11#include <linux/delay.h>
12#include <linux/string.h> 11#include <linux/string.h>
13#include <linux/reboot.h> 12#include <linux/reboot.h>
14#include <asm/pda.h>
15#include <asm/pgtable.h> 13#include <asm/pgtable.h>
16#include <asm/pgalloc.h>
17#include <asm/tlbflush.h> 14#include <asm/tlbflush.h>
18#include <asm/mmu_context.h> 15#include <asm/mmu_context.h>
19#include <asm/io.h> 16#include <asm/io.h>
20#include <asm/apic.h> 17
21#include <asm/cpufeature.h> 18static void init_level2_page(pmd_t *level2p, unsigned long addr)
22#include <asm/hw_irq.h>
23
24#define LEVEL0_SIZE (1UL << 12UL)
25#define LEVEL1_SIZE (1UL << 21UL)
26#define LEVEL2_SIZE (1UL << 30UL)
27#define LEVEL3_SIZE (1UL << 39UL)
28#define LEVEL4_SIZE (1UL << 48UL)
29
30#define L0_ATTR (_PAGE_PRESENT | _PAGE_RW | _PAGE_ACCESSED | _PAGE_DIRTY)
31#define L1_ATTR (_PAGE_PRESENT | _PAGE_RW | _PAGE_ACCESSED | _PAGE_DIRTY | _PAGE_PSE)
32#define L2_ATTR (_PAGE_PRESENT | _PAGE_RW | _PAGE_ACCESSED | _PAGE_DIRTY)
33#define L3_ATTR (_PAGE_PRESENT | _PAGE_RW | _PAGE_ACCESSED | _PAGE_DIRTY)
34
35static void init_level2_page(u64 *level2p, unsigned long addr)
36{ 19{
37 unsigned long end_addr; 20 unsigned long end_addr;
38 21
39 addr &= PAGE_MASK; 22 addr &= PAGE_MASK;
40 end_addr = addr + LEVEL2_SIZE; 23 end_addr = addr + PUD_SIZE;
41 while (addr < end_addr) { 24 while (addr < end_addr) {
42 *(level2p++) = addr | L1_ATTR; 25 set_pmd(level2p++, __pmd(addr | __PAGE_KERNEL_LARGE_EXEC));
43 addr += LEVEL1_SIZE; 26 addr += PMD_SIZE;
44 } 27 }
45} 28}
46 29
47static int init_level3_page(struct kimage *image, u64 *level3p, 30static int init_level3_page(struct kimage *image, pud_t *level3p,
48 unsigned long addr, unsigned long last_addr) 31 unsigned long addr, unsigned long last_addr)
49{ 32{
50 unsigned long end_addr; 33 unsigned long end_addr;
@@ -52,32 +35,32 @@ static int init_level3_page(struct kimage *image, u64 *level3p,
52 35
53 result = 0; 36 result = 0;
54 addr &= PAGE_MASK; 37 addr &= PAGE_MASK;
55 end_addr = addr + LEVEL3_SIZE; 38 end_addr = addr + PGDIR_SIZE;
56 while ((addr < last_addr) && (addr < end_addr)) { 39 while ((addr < last_addr) && (addr < end_addr)) {
57 struct page *page; 40 struct page *page;
58 u64 *level2p; 41 pmd_t *level2p;
59 42
60 page = kimage_alloc_control_pages(image, 0); 43 page = kimage_alloc_control_pages(image, 0);
61 if (!page) { 44 if (!page) {
62 result = -ENOMEM; 45 result = -ENOMEM;
63 goto out; 46 goto out;
64 } 47 }
65 level2p = (u64 *)page_address(page); 48 level2p = (pmd_t *)page_address(page);
66 init_level2_page(level2p, addr); 49 init_level2_page(level2p, addr);
67 *(level3p++) = __pa(level2p) | L2_ATTR; 50 set_pud(level3p++, __pud(__pa(level2p) | _KERNPG_TABLE));
68 addr += LEVEL2_SIZE; 51 addr += PUD_SIZE;
69 } 52 }
70 /* clear the unused entries */ 53 /* clear the unused entries */
71 while (addr < end_addr) { 54 while (addr < end_addr) {
72 *(level3p++) = 0; 55 pud_clear(level3p++);
73 addr += LEVEL2_SIZE; 56 addr += PUD_SIZE;
74 } 57 }
75out: 58out:
76 return result; 59 return result;
77} 60}
78 61
79 62
80static int init_level4_page(struct kimage *image, u64 *level4p, 63static int init_level4_page(struct kimage *image, pgd_t *level4p,
81 unsigned long addr, unsigned long last_addr) 64 unsigned long addr, unsigned long last_addr)
82{ 65{
83 unsigned long end_addr; 66 unsigned long end_addr;
@@ -85,28 +68,28 @@ static int init_level4_page(struct kimage *image, u64 *level4p,
85 68
86 result = 0; 69 result = 0;
87 addr &= PAGE_MASK; 70 addr &= PAGE_MASK;
88 end_addr = addr + LEVEL4_SIZE; 71 end_addr = addr + (PTRS_PER_PGD * PGDIR_SIZE);
89 while ((addr < last_addr) && (addr < end_addr)) { 72 while ((addr < last_addr) && (addr < end_addr)) {
90 struct page *page; 73 struct page *page;
91 u64 *level3p; 74 pud_t *level3p;
92 75
93 page = kimage_alloc_control_pages(image, 0); 76 page = kimage_alloc_control_pages(image, 0);
94 if (!page) { 77 if (!page) {
95 result = -ENOMEM; 78 result = -ENOMEM;
96 goto out; 79 goto out;
97 } 80 }
98 level3p = (u64 *)page_address(page); 81 level3p = (pud_t *)page_address(page);
99 result = init_level3_page(image, level3p, addr, last_addr); 82 result = init_level3_page(image, level3p, addr, last_addr);
100 if (result) { 83 if (result) {
101 goto out; 84 goto out;
102 } 85 }
103 *(level4p++) = __pa(level3p) | L3_ATTR; 86 set_pgd(level4p++, __pgd(__pa(level3p) | _KERNPG_TABLE));
104 addr += LEVEL3_SIZE; 87 addr += PGDIR_SIZE;
105 } 88 }
106 /* clear the unused entries */ 89 /* clear the unused entries */
107 while (addr < end_addr) { 90 while (addr < end_addr) {
108 *(level4p++) = 0; 91 pgd_clear(level4p++);
109 addr += LEVEL3_SIZE; 92 addr += PGDIR_SIZE;
110 } 93 }
111out: 94out:
112 return result; 95 return result;
@@ -115,52 +98,50 @@ out:
115 98
116static int init_pgtable(struct kimage *image, unsigned long start_pgtable) 99static int init_pgtable(struct kimage *image, unsigned long start_pgtable)
117{ 100{
118 u64 *level4p; 101 pgd_t *level4p;
119 level4p = (u64 *)__va(start_pgtable); 102 level4p = (pgd_t *)__va(start_pgtable);
120 return init_level4_page(image, level4p, 0, end_pfn << PAGE_SHIFT); 103 return init_level4_page(image, level4p, 0, end_pfn << PAGE_SHIFT);
121} 104}
122 105
123static void set_idt(void *newidt, u16 limit) 106static void set_idt(void *newidt, u16 limit)
124{ 107{
125 unsigned char curidt[10]; 108 struct desc_ptr curidt;
126 109
127 /* x86-64 supports unaliged loads & stores */ 110 /* x86-64 supports unaliged loads & stores */
128 (*(u16 *)(curidt)) = limit; 111 curidt.size = limit;
129 (*(u64 *)(curidt +2)) = (unsigned long)(newidt); 112 curidt.address = (unsigned long)newidt;
130 113
131 __asm__ __volatile__ ( 114 __asm__ __volatile__ (
132 "lidt %0\n" 115 "lidtq %0\n"
133 : "=m" (curidt) 116 : : "m" (curidt)
134 ); 117 );
135}; 118};
136 119
137 120
138static void set_gdt(void *newgdt, u16 limit) 121static void set_gdt(void *newgdt, u16 limit)
139{ 122{
140 unsigned char curgdt[10]; 123 struct desc_ptr curgdt;
141 124
142 /* x86-64 supports unaligned loads & stores */ 125 /* x86-64 supports unaligned loads & stores */
143 (*(u16 *)(curgdt)) = limit; 126 curgdt.size = limit;
144 (*(u64 *)(curgdt +2)) = (unsigned long)(newgdt); 127 curgdt.address = (unsigned long)newgdt;
145 128
146 __asm__ __volatile__ ( 129 __asm__ __volatile__ (
147 "lgdt %0\n" 130 "lgdtq %0\n"
148 : "=m" (curgdt) 131 : : "m" (curgdt)
149 ); 132 );
150}; 133};
151 134
152static void load_segments(void) 135static void load_segments(void)
153{ 136{
154 __asm__ __volatile__ ( 137 __asm__ __volatile__ (
155 "\tmovl $"STR(__KERNEL_DS)",%eax\n" 138 "\tmovl %0,%%ds\n"
156 "\tmovl %eax,%ds\n" 139 "\tmovl %0,%%es\n"
157 "\tmovl %eax,%es\n" 140 "\tmovl %0,%%ss\n"
158 "\tmovl %eax,%ss\n" 141 "\tmovl %0,%%fs\n"
159 "\tmovl %eax,%fs\n" 142 "\tmovl %0,%%gs\n"
160 "\tmovl %eax,%gs\n" 143 : : "a" (__KERNEL_DS)
161 ); 144 );
162#undef STR
163#undef __STR
164} 145}
165 146
166typedef NORET_TYPE void (*relocate_new_kernel_t)(unsigned long indirection_page, 147typedef NORET_TYPE void (*relocate_new_kernel_t)(unsigned long indirection_page,
@@ -178,7 +159,7 @@ int machine_kexec_prepare(struct kimage *image)
178 159
179 /* Calculate the offsets */ 160 /* Calculate the offsets */
180 start_pgtable = page_to_pfn(image->control_code_page) << PAGE_SHIFT; 161 start_pgtable = page_to_pfn(image->control_code_page) << PAGE_SHIFT;
181 control_code_buffer = start_pgtable + 4096UL; 162 control_code_buffer = start_pgtable + PAGE_SIZE;
182 163
183 /* Setup the identity mapped 64bit page table */ 164 /* Setup the identity mapped 64bit page table */
184 result = init_pgtable(image, start_pgtable); 165 result = init_pgtable(image, start_pgtable);
@@ -214,7 +195,7 @@ NORET_TYPE void machine_kexec(struct kimage *image)
214 /* Calculate the offsets */ 195 /* Calculate the offsets */
215 page_list = image->head; 196 page_list = image->head;
216 start_pgtable = page_to_pfn(image->control_code_page) << PAGE_SHIFT; 197 start_pgtable = page_to_pfn(image->control_code_page) << PAGE_SHIFT;
217 control_code_buffer = start_pgtable + 4096UL; 198 control_code_buffer = start_pgtable + PAGE_SIZE;
218 199
219 /* Set the low half of the page table to my identity mapped 200 /* Set the low half of the page table to my identity mapped
220 * page table for kexec. Leave the high half pointing at the 201 * page table for kexec. Leave the high half pointing at the
diff --git a/arch/x86_64/kernel/mce.c b/arch/x86_64/kernel/mce.c
index 21e70625a495..8aa56736cde3 100644
--- a/arch/x86_64/kernel/mce.c
+++ b/arch/x86_64/kernel/mce.c
@@ -15,6 +15,8 @@
15#include <linux/sysdev.h> 15#include <linux/sysdev.h>
16#include <linux/miscdevice.h> 16#include <linux/miscdevice.h>
17#include <linux/fs.h> 17#include <linux/fs.h>
18#include <linux/cpu.h>
19#include <linux/percpu.h>
18#include <asm/processor.h> 20#include <asm/processor.h>
19#include <asm/msr.h> 21#include <asm/msr.h>
20#include <asm/mce.h> 22#include <asm/mce.h>
@@ -34,6 +36,7 @@ static unsigned long bank[NR_BANKS] = { [0 ... NR_BANKS-1] = ~0UL };
34static unsigned long console_logged; 36static unsigned long console_logged;
35static int notify_user; 37static int notify_user;
36static int rip_msr; 38static int rip_msr;
39static int mce_bootlog;
37 40
38/* 41/*
39 * Lockless MCE logging infrastructure. 42 * Lockless MCE logging infrastructure.
@@ -195,10 +198,11 @@ void do_machine_check(struct pt_regs * regs, long error_code)
195 rdmsrl(MSR_IA32_MC0_ADDR + i*4, m.addr); 198 rdmsrl(MSR_IA32_MC0_ADDR + i*4, m.addr);
196 199
197 mce_get_rip(&m, regs); 200 mce_get_rip(&m, regs);
198 if (error_code != -1) 201 if (error_code >= 0)
199 rdtscll(m.tsc); 202 rdtscll(m.tsc);
200 wrmsrl(MSR_IA32_MC0_STATUS + i*4, 0); 203 wrmsrl(MSR_IA32_MC0_STATUS + i*4, 0);
201 mce_log(&m); 204 if (error_code != -2)
205 mce_log(&m);
202 206
203 /* Did this bank cause the exception? */ 207 /* Did this bank cause the exception? */
204 /* Assume that the bank with uncorrectable errors did it, 208 /* Assume that the bank with uncorrectable errors did it,
@@ -313,7 +317,7 @@ static void mce_init(void *dummy)
313 317
314 /* Log the machine checks left over from the previous reset. 318 /* Log the machine checks left over from the previous reset.
315 This also clears all registers */ 319 This also clears all registers */
316 do_machine_check(NULL, -1); 320 do_machine_check(NULL, mce_bootlog ? -1 : -2);
317 321
318 set_in_cr4(X86_CR4_MCE); 322 set_in_cr4(X86_CR4_MCE);
319 323
@@ -474,11 +478,17 @@ static int __init mcheck_disable(char *str)
474} 478}
475 479
476/* mce=off disables machine check. Note you can reenable it later 480/* mce=off disables machine check. Note you can reenable it later
477 using sysfs */ 481 using sysfs.
482 mce=bootlog Log MCEs from before booting. Disabled by default to work
483 around buggy BIOS that leave bogus MCEs. */
478static int __init mcheck_enable(char *str) 484static int __init mcheck_enable(char *str)
479{ 485{
486 if (*str == '=')
487 str++;
480 if (!strcmp(str, "off")) 488 if (!strcmp(str, "off"))
481 mce_dont_init = 1; 489 mce_dont_init = 1;
490 else if (!strcmp(str, "bootlog"))
491 mce_bootlog = 1;
482 else 492 else
483 printk("mce= argument %s ignored. Please use /sys", str); 493 printk("mce= argument %s ignored. Please use /sys", str);
484 return 0; 494 return 0;
@@ -514,10 +524,7 @@ static struct sysdev_class mce_sysclass = {
514 set_kset_name("machinecheck"), 524 set_kset_name("machinecheck"),
515}; 525};
516 526
517static struct sys_device device_mce = { 527static DEFINE_PER_CPU(struct sys_device, device_mce);
518 .id = 0,
519 .cls = &mce_sysclass,
520};
521 528
522/* Why are there no generic functions for this? */ 529/* Why are there no generic functions for this? */
523#define ACCESSOR(name, var, start) \ 530#define ACCESSOR(name, var, start) \
@@ -542,27 +549,83 @@ ACCESSOR(bank4ctl,bank[4],mce_restart())
542ACCESSOR(tolerant,tolerant,) 549ACCESSOR(tolerant,tolerant,)
543ACCESSOR(check_interval,check_interval,mce_restart()) 550ACCESSOR(check_interval,check_interval,mce_restart())
544 551
545static __cpuinit int mce_init_device(void) 552/* Per cpu sysdev init. All of the cpus still share the same ctl bank */
553static __cpuinit int mce_create_device(unsigned int cpu)
546{ 554{
547 int err; 555 int err;
556 if (!mce_available(&cpu_data[cpu]))
557 return -EIO;
558
559 per_cpu(device_mce,cpu).id = cpu;
560 per_cpu(device_mce,cpu).cls = &mce_sysclass;
561
562 err = sysdev_register(&per_cpu(device_mce,cpu));
563
564 if (!err) {
565 sysdev_create_file(&per_cpu(device_mce,cpu), &attr_bank0ctl);
566 sysdev_create_file(&per_cpu(device_mce,cpu), &attr_bank1ctl);
567 sysdev_create_file(&per_cpu(device_mce,cpu), &attr_bank2ctl);
568 sysdev_create_file(&per_cpu(device_mce,cpu), &attr_bank3ctl);
569 sysdev_create_file(&per_cpu(device_mce,cpu), &attr_bank4ctl);
570 sysdev_create_file(&per_cpu(device_mce,cpu), &attr_tolerant);
571 sysdev_create_file(&per_cpu(device_mce,cpu), &attr_check_interval);
572 }
573 return err;
574}
575
576#ifdef CONFIG_HOTPLUG_CPU
577static __cpuinit void mce_remove_device(unsigned int cpu)
578{
579 sysdev_remove_file(&per_cpu(device_mce,cpu), &attr_bank0ctl);
580 sysdev_remove_file(&per_cpu(device_mce,cpu), &attr_bank1ctl);
581 sysdev_remove_file(&per_cpu(device_mce,cpu), &attr_bank2ctl);
582 sysdev_remove_file(&per_cpu(device_mce,cpu), &attr_bank3ctl);
583 sysdev_remove_file(&per_cpu(device_mce,cpu), &attr_bank4ctl);
584 sysdev_remove_file(&per_cpu(device_mce,cpu), &attr_tolerant);
585 sysdev_remove_file(&per_cpu(device_mce,cpu), &attr_check_interval);
586 sysdev_unregister(&per_cpu(device_mce,cpu));
587}
588#endif
589
590/* Get notified when a cpu comes on/off. Be hotplug friendly. */
591static __cpuinit int
592mce_cpu_callback(struct notifier_block *nfb, unsigned long action, void *hcpu)
593{
594 unsigned int cpu = (unsigned long)hcpu;
595
596 switch (action) {
597 case CPU_ONLINE:
598 mce_create_device(cpu);
599 break;
600#ifdef CONFIG_HOTPLUG_CPU
601 case CPU_DEAD:
602 mce_remove_device(cpu);
603 break;
604#endif
605 }
606 return NOTIFY_OK;
607}
608
609static struct notifier_block mce_cpu_notifier = {
610 .notifier_call = mce_cpu_callback,
611};
612
613static __init int mce_init_device(void)
614{
615 int err;
616 int i = 0;
617
548 if (!mce_available(&boot_cpu_data)) 618 if (!mce_available(&boot_cpu_data))
549 return -EIO; 619 return -EIO;
550 err = sysdev_class_register(&mce_sysclass); 620 err = sysdev_class_register(&mce_sysclass);
551 if (!err) 621
552 err = sysdev_register(&device_mce); 622 for_each_online_cpu(i) {
553 if (!err) { 623 mce_create_device(i);
554 /* could create per CPU objects, but it is not worth it. */ 624 }
555 sysdev_create_file(&device_mce, &attr_bank0ctl); 625
556 sysdev_create_file(&device_mce, &attr_bank1ctl); 626 register_cpu_notifier(&mce_cpu_notifier);
557 sysdev_create_file(&device_mce, &attr_bank2ctl);
558 sysdev_create_file(&device_mce, &attr_bank3ctl);
559 sysdev_create_file(&device_mce, &attr_bank4ctl);
560 sysdev_create_file(&device_mce, &attr_tolerant);
561 sysdev_create_file(&device_mce, &attr_check_interval);
562 }
563
564 misc_register(&mce_log_device); 627 misc_register(&mce_log_device);
565 return err; 628 return err;
566
567} 629}
630
568device_initcall(mce_init_device); 631device_initcall(mce_init_device);
diff --git a/arch/x86_64/kernel/mpparse.c b/arch/x86_64/kernel/mpparse.c
index 9c5aa2a790c7..79c362d03e2e 100644
--- a/arch/x86_64/kernel/mpparse.c
+++ b/arch/x86_64/kernel/mpparse.c
@@ -109,7 +109,7 @@ static int __init mpf_checksum(unsigned char *mp, int len)
109 109
110static void __init MP_processor_info (struct mpc_config_processor *m) 110static void __init MP_processor_info (struct mpc_config_processor *m)
111{ 111{
112 int ver; 112 int ver, cpu;
113 static int found_bsp=0; 113 static int found_bsp=0;
114 114
115 if (!(m->mpc_cpuflag & CPU_ENABLED)) 115 if (!(m->mpc_cpuflag & CPU_ENABLED))
@@ -131,7 +131,7 @@ static void __init MP_processor_info (struct mpc_config_processor *m)
131 return; 131 return;
132 } 132 }
133 133
134 num_processors++; 134 cpu = num_processors++;
135 135
136 if (m->mpc_apicid > MAX_APICS) { 136 if (m->mpc_apicid > MAX_APICS) {
137 printk(KERN_ERR "Processor #%d INVALID. (Max ID: %d).\n", 137 printk(KERN_ERR "Processor #%d INVALID. (Max ID: %d).\n",
@@ -155,13 +155,18 @@ static void __init MP_processor_info (struct mpc_config_processor *m)
155 * in same order as logical cpu numbers. Hence the first 155 * in same order as logical cpu numbers. Hence the first
156 * entry is BSP, and so on. 156 * entry is BSP, and so on.
157 */ 157 */
158 cpu = 0;
159
158 bios_cpu_apicid[0] = m->mpc_apicid; 160 bios_cpu_apicid[0] = m->mpc_apicid;
159 x86_cpu_to_apicid[0] = m->mpc_apicid; 161 x86_cpu_to_apicid[0] = m->mpc_apicid;
160 found_bsp = 1; 162 found_bsp = 1;
161 } else { 163 } else
162 bios_cpu_apicid[num_processors - found_bsp] = m->mpc_apicid; 164 cpu = num_processors - found_bsp;
163 x86_cpu_to_apicid[num_processors - found_bsp] = m->mpc_apicid; 165 bios_cpu_apicid[cpu] = m->mpc_apicid;
164 } 166 x86_cpu_to_apicid[cpu] = m->mpc_apicid;
167
168 cpu_set(cpu, cpu_possible_map);
169 cpu_set(cpu, cpu_present_map);
165} 170}
166 171
167static void __init MP_bus_info (struct mpc_config_bus *m) 172static void __init MP_bus_info (struct mpc_config_bus *m)
@@ -965,8 +970,21 @@ int mp_register_gsi(u32 gsi, int edge_level, int active_high_low)
965 * due to unused I/O APIC pins. 970 * due to unused I/O APIC pins.
966 */ 971 */
967 int irq = gsi; 972 int irq = gsi;
968 gsi = pci_irq++; 973 if (gsi < MAX_GSI_NUM) {
969 gsi_to_irq[irq] = gsi; 974 if (gsi > 15)
975 gsi = pci_irq++;
976#ifdef CONFIG_ACPI_BUS
977 /*
978 * Don't assign IRQ used by ACPI SCI
979 */
980 if (gsi == acpi_fadt.sci_int)
981 gsi = pci_irq++;
982#endif
983 gsi_to_irq[irq] = gsi;
984 } else {
985 printk(KERN_ERR "GSI %u is too high\n", gsi);
986 return gsi;
987 }
970 } 988 }
971 989
972 io_apic_set_pci_routing(ioapic, ioapic_pin, gsi, 990 io_apic_set_pci_routing(ioapic, ioapic_pin, gsi,
diff --git a/arch/x86_64/kernel/nmi.c b/arch/x86_64/kernel/nmi.c
index 4e44d6e6b7e5..64a8e05d5811 100644
--- a/arch/x86_64/kernel/nmi.c
+++ b/arch/x86_64/kernel/nmi.c
@@ -290,7 +290,7 @@ void enable_timer_nmi_watchdog(void)
290 290
291static int nmi_pm_active; /* nmi_active before suspend */ 291static int nmi_pm_active; /* nmi_active before suspend */
292 292
293static int lapic_nmi_suspend(struct sys_device *dev, u32 state) 293static int lapic_nmi_suspend(struct sys_device *dev, pm_message_t state)
294{ 294{
295 nmi_pm_active = nmi_active; 295 nmi_pm_active = nmi_active;
296 disable_lapic_nmi_watchdog(); 296 disable_lapic_nmi_watchdog();
diff --git a/arch/x86_64/kernel/reboot.c b/arch/x86_64/kernel/reboot.c
index 57e71dbdfd69..47f95687905f 100644
--- a/arch/x86_64/kernel/reboot.c
+++ b/arch/x86_64/kernel/reboot.c
@@ -109,23 +109,10 @@ void machine_shutdown(void)
109 local_irq_enable(); 109 local_irq_enable();
110} 110}
111 111
112void machine_restart(char * __unused) 112void machine_emergency_restart(void)
113{ 113{
114 int i; 114 int i;
115 115
116 printk("machine restart\n");
117
118 machine_shutdown();
119
120 if (!reboot_force) {
121 local_irq_disable();
122#ifndef CONFIG_SMP
123 disable_local_APIC();
124#endif
125 disable_IO_APIC();
126 local_irq_enable();
127 }
128
129 /* Tell the BIOS if we want cold or warm reboot */ 116 /* Tell the BIOS if we want cold or warm reboot */
130 *((unsigned short *)__va(0x472)) = reboot_mode; 117 *((unsigned short *)__va(0x472)) = reboot_mode;
131 118
@@ -150,18 +137,26 @@ void machine_restart(char * __unused)
150 } 137 }
151} 138}
152 139
153EXPORT_SYMBOL(machine_restart); 140void machine_restart(char * __unused)
141{
142 printk("machine restart\n");
143
144 if (!reboot_force) {
145 machine_shutdown();
146 }
147 machine_emergency_restart();
148}
154 149
155void machine_halt(void) 150void machine_halt(void)
156{ 151{
157} 152}
158 153
159EXPORT_SYMBOL(machine_halt);
160
161void machine_power_off(void) 154void machine_power_off(void)
162{ 155{
156 if (!reboot_force) {
157 machine_shutdown();
158 }
163 if (pm_power_off) 159 if (pm_power_off)
164 pm_power_off(); 160 pm_power_off();
165} 161}
166 162
167EXPORT_SYMBOL(machine_power_off);
diff --git a/arch/x86_64/kernel/semaphore.c b/arch/x86_64/kernel/semaphore.c
deleted file mode 100644
index 48f7c18172b9..000000000000
--- a/arch/x86_64/kernel/semaphore.c
+++ /dev/null
@@ -1,180 +0,0 @@
1/*
2 * x86_64 semaphore implementation.
3 *
4 * (C) Copyright 1999 Linus Torvalds
5 *
6 * Portions Copyright 1999 Red Hat, Inc.
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 * rw semaphores implemented November 1999 by Benjamin LaHaise <bcrl@kvack.org>
14 */
15#include <linux/config.h>
16#include <linux/sched.h>
17#include <linux/init.h>
18#include <asm/errno.h>
19
20#include <asm/semaphore.h>
21
22/*
23 * Semaphores are implemented using a two-way counter:
24 * The "count" variable is decremented for each process
25 * that tries to acquire the semaphore, while the "sleeping"
26 * variable is a count of such acquires.
27 *
28 * Notably, the inline "up()" and "down()" functions can
29 * efficiently test if they need to do any extra work (up
30 * needs to do something only if count was negative before
31 * the increment operation.
32 *
33 * "sleeping" and the contention routine ordering is protected
34 * by the spinlock in the semaphore's waitqueue head.
35 *
36 * Note that these functions are only called when there is
37 * contention on the lock, and as such all this is the
38 * "non-critical" part of the whole semaphore business. The
39 * critical part is the inline stuff in <asm/semaphore.h>
40 * where we want to avoid any extra jumps and calls.
41 */
42
43/*
44 * Logic:
45 * - only on a boundary condition do we need to care. When we go
46 * from a negative count to a non-negative, we wake people up.
47 * - when we go from a non-negative count to a negative do we
48 * (a) synchronize with the "sleeper" count and (b) make sure
49 * that we're on the wakeup list before we synchronize so that
50 * we cannot lose wakeup events.
51 */
52
53void __up(struct semaphore *sem)
54{
55 wake_up(&sem->wait);
56}
57
58void __sched __down(struct semaphore * sem)
59{
60 struct task_struct *tsk = current;
61 DECLARE_WAITQUEUE(wait, tsk);
62 unsigned long flags;
63
64 tsk->state = TASK_UNINTERRUPTIBLE;
65 spin_lock_irqsave(&sem->wait.lock, flags);
66 add_wait_queue_exclusive_locked(&sem->wait, &wait);
67
68 sem->sleepers++;
69 for (;;) {
70 int sleepers = sem->sleepers;
71
72 /*
73 * Add "everybody else" into it. They aren't
74 * playing, because we own the spinlock in
75 * the wait_queue_head.
76 */
77 if (!atomic_add_negative(sleepers - 1, &sem->count)) {
78 sem->sleepers = 0;
79 break;
80 }
81 sem->sleepers = 1; /* us - see -1 above */
82 spin_unlock_irqrestore(&sem->wait.lock, flags);
83
84 schedule();
85
86 spin_lock_irqsave(&sem->wait.lock, flags);
87 tsk->state = TASK_UNINTERRUPTIBLE;
88 }
89 remove_wait_queue_locked(&sem->wait, &wait);
90 wake_up_locked(&sem->wait);
91 spin_unlock_irqrestore(&sem->wait.lock, flags);
92 tsk->state = TASK_RUNNING;
93}
94
95int __sched __down_interruptible(struct semaphore * sem)
96{
97 int retval = 0;
98 struct task_struct *tsk = current;
99 DECLARE_WAITQUEUE(wait, tsk);
100 unsigned long flags;
101
102 tsk->state = TASK_INTERRUPTIBLE;
103 spin_lock_irqsave(&sem->wait.lock, flags);
104 add_wait_queue_exclusive_locked(&sem->wait, &wait);
105
106 sem->sleepers++;
107 for (;;) {
108 int sleepers = sem->sleepers;
109
110 /*
111 * With signals pending, this turns into
112 * the trylock failure case - we won't be
113 * sleeping, and we* can't get the lock as
114 * it has contention. Just correct the count
115 * and exit.
116 */
117 if (signal_pending(current)) {
118 retval = -EINTR;
119 sem->sleepers = 0;
120 atomic_add(sleepers, &sem->count);
121 break;
122 }
123
124 /*
125 * Add "everybody else" into it. They aren't
126 * playing, because we own the spinlock in
127 * wait_queue_head. The "-1" is because we're
128 * still hoping to get the semaphore.
129 */
130 if (!atomic_add_negative(sleepers - 1, &sem->count)) {
131 sem->sleepers = 0;
132 break;
133 }
134 sem->sleepers = 1; /* us - see -1 above */
135 spin_unlock_irqrestore(&sem->wait.lock, flags);
136
137 schedule();
138
139 spin_lock_irqsave(&sem->wait.lock, flags);
140 tsk->state = TASK_INTERRUPTIBLE;
141 }
142 remove_wait_queue_locked(&sem->wait, &wait);
143 wake_up_locked(&sem->wait);
144 spin_unlock_irqrestore(&sem->wait.lock, flags);
145
146 tsk->state = TASK_RUNNING;
147 return retval;
148}
149
150/*
151 * Trylock failed - make sure we correct for
152 * having decremented the count.
153 *
154 * We could have done the trylock with a
155 * single "cmpxchg" without failure cases,
156 * but then it wouldn't work on a 386.
157 */
158int __down_trylock(struct semaphore * sem)
159{
160 int sleepers;
161 unsigned long flags;
162
163 spin_lock_irqsave(&sem->wait.lock, flags);
164 sleepers = sem->sleepers + 1;
165 sem->sleepers = 0;
166
167 /*
168 * Add "everybody else" and us into it. They aren't
169 * playing, because we own the spinlock in the
170 * wait_queue_head.
171 */
172 if (!atomic_add_negative(sleepers, &sem->count)) {
173 wake_up_locked(&sem->wait);
174 }
175
176 spin_unlock_irqrestore(&sem->wait.lock, flags);
177 return 1;
178}
179
180
diff --git a/arch/x86_64/kernel/setup.c b/arch/x86_64/kernel/setup.c
index 5fd03225058a..116a491e2961 100644
--- a/arch/x86_64/kernel/setup.c
+++ b/arch/x86_64/kernel/setup.c
@@ -645,15 +645,15 @@ void __init setup_arch(char **cmdline_p)
645 } 645 }
646 } 646 }
647#endif 647#endif
648
649 sparse_init();
650
651#ifdef CONFIG_KEXEC 648#ifdef CONFIG_KEXEC
652 if (crashk_res.start != crashk_res.end) { 649 if (crashk_res.start != crashk_res.end) {
653 reserve_bootmem(crashk_res.start, 650 reserve_bootmem(crashk_res.start,
654 crashk_res.end - crashk_res.start + 1); 651 crashk_res.end - crashk_res.start + 1);
655 } 652 }
656#endif 653#endif
654
655 sparse_init();
656
657 paging_init(); 657 paging_init();
658 658
659 check_ioapic(); 659 check_ioapic();
@@ -765,8 +765,6 @@ static void __init amd_detect_cmp(struct cpuinfo_x86 *c)
765 int cpu = smp_processor_id(); 765 int cpu = smp_processor_id();
766 int node = 0; 766 int node = 0;
767 unsigned bits; 767 unsigned bits;
768 if (c->x86_num_cores == 1)
769 return;
770 768
771 bits = 0; 769 bits = 0;
772 while ((1 << bits) < c->x86_num_cores) 770 while ((1 << bits) < c->x86_num_cores)
@@ -1081,8 +1079,7 @@ void __cpuinit identify_cpu(struct cpuinfo_x86 *c)
1081 else 1079 else
1082 mtrr_ap_init(); 1080 mtrr_ap_init();
1083#ifdef CONFIG_NUMA 1081#ifdef CONFIG_NUMA
1084 if (c != &boot_cpu_data) 1082 numa_add_cpu(smp_processor_id());
1085 numa_add_cpu(c - cpu_data);
1086#endif 1083#endif
1087} 1084}
1088 1085
diff --git a/arch/x86_64/kernel/setup64.c b/arch/x86_64/kernel/setup64.c
index f2b9c6bc999a..34082c1cc41e 100644
--- a/arch/x86_64/kernel/setup64.c
+++ b/arch/x86_64/kernel/setup64.c
@@ -12,6 +12,7 @@
12#include <linux/string.h> 12#include <linux/string.h>
13#include <linux/bootmem.h> 13#include <linux/bootmem.h>
14#include <linux/bitops.h> 14#include <linux/bitops.h>
15#include <linux/module.h>
15#include <asm/bootsetup.h> 16#include <asm/bootsetup.h>
16#include <asm/pda.h> 17#include <asm/pda.h>
17#include <asm/pgtable.h> 18#include <asm/pgtable.h>
@@ -22,10 +23,8 @@
22#include <asm/smp.h> 23#include <asm/smp.h>
23#include <asm/i387.h> 24#include <asm/i387.h>
24#include <asm/percpu.h> 25#include <asm/percpu.h>
25#include <asm/mtrr.h>
26#include <asm/proto.h> 26#include <asm/proto.h>
27#include <asm/mman.h> 27#include <asm/sections.h>
28#include <asm/numa.h>
29 28
30char x86_boot_params[BOOT_PARAM_SIZE] __initdata = {0,}; 29char x86_boot_params[BOOT_PARAM_SIZE] __initdata = {0,};
31 30
@@ -33,11 +32,6 @@ cpumask_t cpu_initialized __cpuinitdata = CPU_MASK_NONE;
33 32
34struct x8664_pda cpu_pda[NR_CPUS] __cacheline_aligned; 33struct x8664_pda cpu_pda[NR_CPUS] __cacheline_aligned;
35 34
36extern struct task_struct init_task;
37
38extern unsigned char __per_cpu_start[], __per_cpu_end[];
39
40extern struct desc_ptr cpu_gdt_descr[];
41struct desc_ptr idt_descr = { 256 * 16, (unsigned long) idt_table }; 35struct desc_ptr idt_descr = { 256 * 16, (unsigned long) idt_table };
42 36
43char boot_cpu_stack[IRQSTACKSIZE] __attribute__((section(".bss.page_aligned"))); 37char boot_cpu_stack[IRQSTACKSIZE] __attribute__((section(".bss.page_aligned")));
@@ -101,7 +95,7 @@ void __init setup_per_cpu_areas(void)
101#endif 95#endif
102 96
103 for (i = 0; i < NR_CPUS; i++) { 97 for (i = 0; i < NR_CPUS; i++) {
104 unsigned char *ptr; 98 char *ptr;
105 99
106 if (!NODE_DATA(cpu_to_node(i))) { 100 if (!NODE_DATA(cpu_to_node(i))) {
107 printk("cpu with no node %d, num_online_nodes %d\n", 101 printk("cpu with no node %d, num_online_nodes %d\n",
@@ -190,11 +184,7 @@ void __cpuinit check_efer(void)
190 */ 184 */
191void __cpuinit cpu_init (void) 185void __cpuinit cpu_init (void)
192{ 186{
193#ifdef CONFIG_SMP
194 int cpu = stack_smp_processor_id(); 187 int cpu = stack_smp_processor_id();
195#else
196 int cpu = smp_processor_id();
197#endif
198 struct tss_struct *t = &per_cpu(init_tss, cpu); 188 struct tss_struct *t = &per_cpu(init_tss, cpu);
199 unsigned long v; 189 unsigned long v;
200 char *estacks = NULL; 190 char *estacks = NULL;
@@ -214,7 +204,7 @@ void __cpuinit cpu_init (void)
214 204
215 printk("Initializing CPU#%d\n", cpu); 205 printk("Initializing CPU#%d\n", cpu);
216 206
217 clear_in_cr4(X86_CR4_VME|X86_CR4_PVI|X86_CR4_TSD|X86_CR4_DE); 207 clear_in_cr4(X86_CR4_VME|X86_CR4_PVI|X86_CR4_TSD|X86_CR4_DE);
218 208
219 /* 209 /*
220 * Initialize the per-CPU GDT with the boot GDT, 210 * Initialize the per-CPU GDT with the boot GDT,
diff --git a/arch/x86_64/kernel/signal.c b/arch/x86_64/kernel/signal.c
index 98590a989f3d..d642fbf3da29 100644
--- a/arch/x86_64/kernel/signal.c
+++ b/arch/x86_64/kernel/signal.c
@@ -394,10 +394,11 @@ handle_signal(unsigned long sig, siginfo_t *info, struct k_sigaction *ka,
394#endif 394#endif
395 ret = setup_rt_frame(sig, ka, info, oldset, regs); 395 ret = setup_rt_frame(sig, ka, info, oldset, regs);
396 396
397 if (ret && !(ka->sa.sa_flags & SA_NODEFER)) { 397 if (ret) {
398 spin_lock_irq(&current->sighand->siglock); 398 spin_lock_irq(&current->sighand->siglock);
399 sigorsets(&current->blocked,&current->blocked,&ka->sa.sa_mask); 399 sigorsets(&current->blocked,&current->blocked,&ka->sa.sa_mask);
400 sigaddset(&current->blocked,sig); 400 if (!(ka->sa.sa_flags & SA_NODEFER))
401 sigaddset(&current->blocked,sig);
401 recalc_sigpending(); 402 recalc_sigpending();
402 spin_unlock_irq(&current->sighand->siglock); 403 spin_unlock_irq(&current->sighand->siglock);
403 } 404 }
diff --git a/arch/x86_64/kernel/smp.c b/arch/x86_64/kernel/smp.c
index ccae392886af..e5958220d6b8 100644
--- a/arch/x86_64/kernel/smp.c
+++ b/arch/x86_64/kernel/smp.c
@@ -129,10 +129,9 @@ asmlinkage void smp_invalidate_interrupt (void)
129 } else 129 } else
130 leave_mm(cpu); 130 leave_mm(cpu);
131 } 131 }
132out:
132 ack_APIC_irq(); 133 ack_APIC_irq();
133 cpu_clear(cpu, flush_cpumask); 134 cpu_clear(cpu, flush_cpumask);
134
135out:
136 put_cpu_no_resched(); 135 put_cpu_no_resched();
137} 136}
138 137
@@ -294,6 +293,69 @@ void unlock_ipi_call_lock(void)
294} 293}
295 294
296/* 295/*
296 * this function sends a 'generic call function' IPI to one other CPU
297 * in the system.
298 */
299static void __smp_call_function_single (int cpu, void (*func) (void *info), void *info,
300 int nonatomic, int wait)
301{
302 struct call_data_struct data;
303 int cpus = 1;
304
305 data.func = func;
306 data.info = info;
307 atomic_set(&data.started, 0);
308 data.wait = wait;
309 if (wait)
310 atomic_set(&data.finished, 0);
311
312 call_data = &data;
313 wmb();
314 /* Send a message to all other CPUs and wait for them to respond */
315 send_IPI_mask(cpumask_of_cpu(cpu), CALL_FUNCTION_VECTOR);
316
317 /* Wait for response */
318 while (atomic_read(&data.started) != cpus)
319 cpu_relax();
320
321 if (!wait)
322 return;
323
324 while (atomic_read(&data.finished) != cpus)
325 cpu_relax();
326}
327
328/*
329 * smp_call_function_single - Run a function on another CPU
330 * @func: The function to run. This must be fast and non-blocking.
331 * @info: An arbitrary pointer to pass to the function.
332 * @nonatomic: Currently unused.
333 * @wait: If true, wait until function has completed on other CPUs.
334 *
335 * Retrurns 0 on success, else a negative status code.
336 *
337 * Does not return until the remote CPU is nearly ready to execute <func>
338 * or is or has executed.
339 */
340
341int smp_call_function_single (int cpu, void (*func) (void *info), void *info,
342 int nonatomic, int wait)
343{
344 /* prevent preemption and reschedule on another processor */
345 int me = get_cpu();
346 if (cpu == me) {
347 WARN_ON(1);
348 put_cpu();
349 return -EBUSY;
350 }
351 spin_lock_bh(&call_lock);
352 __smp_call_function_single(cpu, func, info, nonatomic, wait);
353 spin_unlock_bh(&call_lock);
354 put_cpu();
355 return 0;
356}
357
358/*
297 * this function sends a 'generic call function' IPI to all other CPUs 359 * this function sends a 'generic call function' IPI to all other CPUs
298 * in the system. 360 * in the system.
299 */ 361 */
diff --git a/arch/x86_64/kernel/smpboot.c b/arch/x86_64/kernel/smpboot.c
index b969ee128728..fa25e39fe54d 100644
--- a/arch/x86_64/kernel/smpboot.c
+++ b/arch/x86_64/kernel/smpboot.c
@@ -113,24 +113,6 @@ struct task_struct *idle_thread_array[NR_CPUS] __cpuinitdata ;
113#define set_idle_for_cpu(x,p) (idle_thread_array[(x)] = (p)) 113#define set_idle_for_cpu(x,p) (idle_thread_array[(x)] = (p))
114 114
115/* 115/*
116 * cpu_possible_map should be static, it cannot change as cpu's
117 * are onlined, or offlined. The reason is per-cpu data-structures
118 * are allocated by some modules at init time, and dont expect to
119 * do this dynamically on cpu arrival/departure.
120 * cpu_present_map on the other hand can change dynamically.
121 * In case when cpu_hotplug is not compiled, then we resort to current
122 * behaviour, which is cpu_possible == cpu_present.
123 * If cpu-hotplug is supported, then we need to preallocate for all
124 * those NR_CPUS, hence cpu_possible_map represents entire NR_CPUS range.
125 * - Ashok Raj
126 */
127#ifdef CONFIG_HOTPLUG_CPU
128#define fixup_cpu_possible_map(x) cpu_set((x), cpu_possible_map)
129#else
130#define fixup_cpu_possible_map(x)
131#endif
132
133/*
134 * Currently trivial. Write the real->protected mode 116 * Currently trivial. Write the real->protected mode
135 * bootstrap into the page concerned. The caller 117 * bootstrap into the page concerned. The caller
136 * has made sure it's suitably aligned. 118 * has made sure it's suitably aligned.
@@ -229,9 +211,6 @@ static __cpuinit void sync_master(void *arg)
229{ 211{
230 unsigned long flags, i; 212 unsigned long flags, i;
231 213
232 if (smp_processor_id() != boot_cpu_id)
233 return;
234
235 go[MASTER] = 0; 214 go[MASTER] = 0;
236 215
237 local_irq_save(flags); 216 local_irq_save(flags);
@@ -280,12 +259,12 @@ get_delta(long *rt, long *master)
280 return tcenter - best_tm; 259 return tcenter - best_tm;
281} 260}
282 261
283static __cpuinit void sync_tsc(void) 262static __cpuinit void sync_tsc(unsigned int master)
284{ 263{
285 int i, done = 0; 264 int i, done = 0;
286 long delta, adj, adjust_latency = 0; 265 long delta, adj, adjust_latency = 0;
287 unsigned long flags, rt, master_time_stamp, bound; 266 unsigned long flags, rt, master_time_stamp, bound;
288#if DEBUG_TSC_SYNC 267#ifdef DEBUG_TSC_SYNC
289 static struct syncdebug { 268 static struct syncdebug {
290 long rt; /* roundtrip time */ 269 long rt; /* roundtrip time */
291 long master; /* master's timestamp */ 270 long master; /* master's timestamp */
@@ -294,9 +273,17 @@ static __cpuinit void sync_tsc(void)
294 } t[NUM_ROUNDS] __cpuinitdata; 273 } t[NUM_ROUNDS] __cpuinitdata;
295#endif 274#endif
296 275
276 printk(KERN_INFO "CPU %d: Syncing TSC to CPU %u.\n",
277 smp_processor_id(), master);
278
297 go[MASTER] = 1; 279 go[MASTER] = 1;
298 280
299 smp_call_function(sync_master, NULL, 1, 0); 281 /* It is dangerous to broadcast IPI as cpus are coming up,
282 * as they may not be ready to accept them. So since
283 * we only need to send the ipi to the boot cpu direct
284 * the message, and avoid the race.
285 */
286 smp_call_function_single(master, sync_master, NULL, 1, 0);
300 287
301 while (go[MASTER]) /* wait for master to be ready */ 288 while (go[MASTER]) /* wait for master to be ready */
302 no_cpu_relax(); 289 no_cpu_relax();
@@ -321,7 +308,7 @@ static __cpuinit void sync_tsc(void)
321 rdtscll(t); 308 rdtscll(t);
322 wrmsrl(MSR_IA32_TSC, t + adj); 309 wrmsrl(MSR_IA32_TSC, t + adj);
323 } 310 }
324#if DEBUG_TSC_SYNC 311#ifdef DEBUG_TSC_SYNC
325 t[i].rt = rt; 312 t[i].rt = rt;
326 t[i].master = master_time_stamp; 313 t[i].master = master_time_stamp;
327 t[i].diff = delta; 314 t[i].diff = delta;
@@ -331,7 +318,7 @@ static __cpuinit void sync_tsc(void)
331 } 318 }
332 spin_unlock_irqrestore(&tsc_sync_lock, flags); 319 spin_unlock_irqrestore(&tsc_sync_lock, flags);
333 320
334#if DEBUG_TSC_SYNC 321#ifdef DEBUG_TSC_SYNC
335 for (i = 0; i < NUM_ROUNDS; ++i) 322 for (i = 0; i < NUM_ROUNDS; ++i)
336 printk("rt=%5ld master=%5ld diff=%5ld adjlat=%5ld\n", 323 printk("rt=%5ld master=%5ld diff=%5ld adjlat=%5ld\n",
337 t[i].rt, t[i].master, t[i].diff, t[i].lat); 324 t[i].rt, t[i].master, t[i].diff, t[i].lat);
@@ -340,16 +327,14 @@ static __cpuinit void sync_tsc(void)
340 printk(KERN_INFO 327 printk(KERN_INFO
341 "CPU %d: synchronized TSC with CPU %u (last diff %ld cycles, " 328 "CPU %d: synchronized TSC with CPU %u (last diff %ld cycles, "
342 "maxerr %lu cycles)\n", 329 "maxerr %lu cycles)\n",
343 smp_processor_id(), boot_cpu_id, delta, rt); 330 smp_processor_id(), master, delta, rt);
344} 331}
345 332
346static void __cpuinit tsc_sync_wait(void) 333static void __cpuinit tsc_sync_wait(void)
347{ 334{
348 if (notscsync || !cpu_has_tsc) 335 if (notscsync || !cpu_has_tsc)
349 return; 336 return;
350 printk(KERN_INFO "CPU %d: Syncing TSC to CPU %u.\n", smp_processor_id(), 337 sync_tsc(0);
351 boot_cpu_id);
352 sync_tsc();
353} 338}
354 339
355static __init int notscsync_setup(char *s) 340static __init int notscsync_setup(char *s)
@@ -507,6 +492,14 @@ void __cpuinit start_secondary(void)
507 */ 492 */
508 set_cpu_sibling_map(smp_processor_id()); 493 set_cpu_sibling_map(smp_processor_id());
509 494
495 /*
496 * Wait for TSC sync to not schedule things before.
497 * We still process interrupts, which could see an inconsistent
498 * time in that window unfortunately.
499 * Do this here because TSC sync has global unprotected state.
500 */
501 tsc_sync_wait();
502
510 /* 503 /*
511 * We need to hold call_lock, so there is no inconsistency 504 * We need to hold call_lock, so there is no inconsistency
512 * between the time smp_call_function() determines number of 505 * between the time smp_call_function() determines number of
@@ -524,20 +517,13 @@ void __cpuinit start_secondary(void)
524 per_cpu(cpu_state, smp_processor_id()) = CPU_ONLINE; 517 per_cpu(cpu_state, smp_processor_id()) = CPU_ONLINE;
525 unlock_ipi_call_lock(); 518 unlock_ipi_call_lock();
526 519
527 mb();
528
529 /* Wait for TSC sync to not schedule things before.
530 We still process interrupts, which could see an inconsistent
531 time in that window unfortunately. */
532 tsc_sync_wait();
533
534 cpu_idle(); 520 cpu_idle();
535} 521}
536 522
537extern volatile unsigned long init_rsp; 523extern volatile unsigned long init_rsp;
538extern void (*initial_code)(void); 524extern void (*initial_code)(void);
539 525
540#if APIC_DEBUG 526#ifdef APIC_DEBUG
541static void inquire_remote_apic(int apicid) 527static void inquire_remote_apic(int apicid)
542{ 528{
543 unsigned i, regs[] = { APIC_ID >> 4, APIC_LVR >> 4, APIC_SPIV >> 4 }; 529 unsigned i, regs[] = { APIC_ID >> 4, APIC_LVR >> 4, APIC_SPIV >> 4 };
@@ -773,8 +759,9 @@ do_rest:
773 initial_code = start_secondary; 759 initial_code = start_secondary;
774 clear_ti_thread_flag(c_idle.idle->thread_info, TIF_FORK); 760 clear_ti_thread_flag(c_idle.idle->thread_info, TIF_FORK);
775 761
776 printk(KERN_INFO "Booting processor %d/%d rip %lx rsp %lx\n", cpu, apicid, 762 printk(KERN_INFO "Booting processor %d/%d APIC 0x%x\n", cpu,
777 start_rip, init_rsp); 763 cpus_weight(cpu_present_map),
764 apicid);
778 765
779 /* 766 /*
780 * This grunge runs the startup process for 767 * This grunge runs the startup process for
@@ -841,7 +828,7 @@ do_rest:
841 else 828 else
842 /* trampoline code not run */ 829 /* trampoline code not run */
843 printk("Not responding.\n"); 830 printk("Not responding.\n");
844#if APIC_DEBUG 831#ifdef APIC_DEBUG
845 inquire_remote_apic(apicid); 832 inquire_remote_apic(apicid);
846#endif 833#endif
847 } 834 }
@@ -924,6 +911,27 @@ static __init void enforce_max_cpus(unsigned max_cpus)
924 } 911 }
925} 912}
926 913
914#ifdef CONFIG_HOTPLUG_CPU
915/*
916 * cpu_possible_map should be static, it cannot change as cpu's
917 * are onlined, or offlined. The reason is per-cpu data-structures
918 * are allocated by some modules at init time, and dont expect to
919 * do this dynamically on cpu arrival/departure.
920 * cpu_present_map on the other hand can change dynamically.
921 * In case when cpu_hotplug is not compiled, then we resort to current
922 * behaviour, which is cpu_possible == cpu_present.
923 * If cpu-hotplug is supported, then we need to preallocate for all
924 * those NR_CPUS, hence cpu_possible_map represents entire NR_CPUS range.
925 * - Ashok Raj
926 */
927static void prefill_possible_map(void)
928{
929 int i;
930 for (i = 0; i < NR_CPUS; i++)
931 cpu_set(i, cpu_possible_map);
932}
933#endif
934
927/* 935/*
928 * Various sanity checks. 936 * Various sanity checks.
929 */ 937 */
@@ -987,25 +995,15 @@ static int __init smp_sanity_check(unsigned max_cpus)
987 */ 995 */
988void __init smp_prepare_cpus(unsigned int max_cpus) 996void __init smp_prepare_cpus(unsigned int max_cpus)
989{ 997{
990 int i;
991
992 nmi_watchdog_default(); 998 nmi_watchdog_default();
993 current_cpu_data = boot_cpu_data; 999 current_cpu_data = boot_cpu_data;
994 current_thread_info()->cpu = 0; /* needed? */ 1000 current_thread_info()->cpu = 0; /* needed? */
995 1001
996 enforce_max_cpus(max_cpus); 1002 enforce_max_cpus(max_cpus);
997 1003
998 /* 1004#ifdef CONFIG_HOTPLUG_CPU
999 * Fill in cpu_present_mask 1005 prefill_possible_map();
1000 */ 1006#endif
1001 for (i = 0; i < NR_CPUS; i++) {
1002 int apicid = cpu_present_to_apicid(i);
1003 if (physid_isset(apicid, phys_cpu_present_map)) {
1004 cpu_set(i, cpu_present_map);
1005 cpu_set(i, cpu_possible_map);
1006 }
1007 fixup_cpu_possible_map(i);
1008 }
1009 1007
1010 if (smp_sanity_check(max_cpus) < 0) { 1008 if (smp_sanity_check(max_cpus) < 0) {
1011 printk(KERN_INFO "SMP disabled\n"); 1009 printk(KERN_INFO "SMP disabled\n");
@@ -1189,8 +1187,7 @@ void __cpu_die(unsigned int cpu)
1189 printk ("CPU %d is now offline\n", cpu); 1187 printk ("CPU %d is now offline\n", cpu);
1190 return; 1188 return;
1191 } 1189 }
1192 current->state = TASK_UNINTERRUPTIBLE; 1190 msleep(100);
1193 schedule_timeout(HZ/10);
1194 } 1191 }
1195 printk(KERN_ERR "CPU %u didn't die...\n", cpu); 1192 printk(KERN_ERR "CPU %u didn't die...\n", cpu);
1196} 1193}
diff --git a/arch/x86_64/kernel/traps.c b/arch/x86_64/kernel/traps.c
index 102736630002..6ead433a3885 100644
--- a/arch/x86_64/kernel/traps.c
+++ b/arch/x86_64/kernel/traps.c
@@ -594,9 +594,6 @@ asmlinkage void default_do_nmi(struct pt_regs *regs)
594 if (!cpu) 594 if (!cpu)
595 reason = get_nmi_reason(); 595 reason = get_nmi_reason();
596 596
597 if (!cpu_online(cpu))
598 return;
599
600 if (!(reason & 0xc0)) { 597 if (!(reason & 0xc0)) {
601 if (notify_die(DIE_NMI_IPI, "nmi_ipi", regs, reason, 0, SIGINT) 598 if (notify_die(DIE_NMI_IPI, "nmi_ipi", regs, reason, 0, SIGINT)
602 == NOTIFY_STOP) 599 == NOTIFY_STOP)
diff --git a/arch/x86_64/kernel/vmlinux.lds.S b/arch/x86_64/kernel/vmlinux.lds.S
index 61c12758ca70..2a94f9b60b2d 100644
--- a/arch/x86_64/kernel/vmlinux.lds.S
+++ b/arch/x86_64/kernel/vmlinux.lds.S
@@ -62,8 +62,8 @@ SECTIONS
62 } 62 }
63 63
64#define VSYSCALL_ADDR (-10*1024*1024) 64#define VSYSCALL_ADDR (-10*1024*1024)
65#define VSYSCALL_PHYS_ADDR ((LOADADDR(.data.cacheline_aligned) + SIZEOF(.data.cacheline_aligned) + 4095) & ~(4095)) 65#define VSYSCALL_PHYS_ADDR ((LOADADDR(.data.read_mostly) + SIZEOF(.data.read_mostly) + 4095) & ~(4095))
66#define VSYSCALL_VIRT_ADDR ((ADDR(.data.cacheline_aligned) + SIZEOF(.data.cacheline_aligned) + 4095) & ~(4095)) 66#define VSYSCALL_VIRT_ADDR ((ADDR(.data.read_mostly) + SIZEOF(.data.read_mostly) + 4095) & ~(4095))
67 67
68#define VLOAD_OFFSET (VSYSCALL_ADDR - VSYSCALL_PHYS_ADDR) 68#define VLOAD_OFFSET (VSYSCALL_ADDR - VSYSCALL_PHYS_ADDR)
69#define VLOAD(x) (ADDR(x) - VLOAD_OFFSET) 69#define VLOAD(x) (ADDR(x) - VLOAD_OFFSET)
diff --git a/arch/x86_64/lib/csum-copy.S b/arch/x86_64/lib/csum-copy.S
index 01808ec37836..72fd55ee896e 100644
--- a/arch/x86_64/lib/csum-copy.S
+++ b/arch/x86_64/lib/csum-copy.S
@@ -188,8 +188,8 @@ csum_partial_copy_generic:
188 source 188 source
189 movw (%rdi),%bx 189 movw (%rdi),%bx
190 adcl %ebx,%eax 190 adcl %ebx,%eax
191 dest
192 decl %ecx 191 decl %ecx
192 dest
193 movw %bx,(%rsi) 193 movw %bx,(%rsi)
194 leaq 2(%rdi),%rdi 194 leaq 2(%rdi),%rdi
195 leaq 2(%rsi),%rsi 195 leaq 2(%rsi),%rsi
diff --git a/arch/x86_64/lib/delay.c b/arch/x86_64/lib/delay.c
index 33a873a3c223..841bd738a189 100644
--- a/arch/x86_64/lib/delay.c
+++ b/arch/x86_64/lib/delay.c
@@ -18,8 +18,6 @@
18#include <asm/smp.h> 18#include <asm/smp.h>
19#endif 19#endif
20 20
21int x86_udelay_tsc = 0; /* Delay via TSC */
22
23int read_current_timer(unsigned long *timer_value) 21int read_current_timer(unsigned long *timer_value)
24{ 22{
25 rdtscll(*timer_value); 23 rdtscll(*timer_value);
diff --git a/arch/x86_64/mm/fault.c b/arch/x86_64/mm/fault.c
index 2f187986f940..ca914c3bd49c 100644
--- a/arch/x86_64/mm/fault.c
+++ b/arch/x86_64/mm/fault.c
@@ -23,7 +23,6 @@
23#include <linux/vt_kern.h> /* For unblank_screen() */ 23#include <linux/vt_kern.h> /* For unblank_screen() */
24#include <linux/compiler.h> 24#include <linux/compiler.h>
25#include <linux/module.h> 25#include <linux/module.h>
26#include <linux/kprobes.h>
27 26
28#include <asm/system.h> 27#include <asm/system.h>
29#include <asm/uaccess.h> 28#include <asm/uaccess.h>
@@ -212,9 +211,7 @@ int unhandled_signal(struct task_struct *tsk, int sig)
212{ 211{
213 if (tsk->pid == 1) 212 if (tsk->pid == 1)
214 return 1; 213 return 1;
215 /* Warn for strace, but not for gdb */ 214 if (tsk->ptrace & PT_PTRACED)
216 if (!test_ti_thread_flag(tsk->thread_info, TIF_SYSCALL_TRACE) &&
217 (tsk->ptrace & PT_PTRACED))
218 return 0; 215 return 0;
219 return (tsk->sighand->action[sig-1].sa.sa_handler == SIG_IGN) || 216 return (tsk->sighand->action[sig-1].sa.sa_handler == SIG_IGN) ||
220 (tsk->sighand->action[sig-1].sa.sa_handler == SIG_DFL); 217 (tsk->sighand->action[sig-1].sa.sa_handler == SIG_DFL);
@@ -440,13 +437,13 @@ good_area:
440 * the fault. 437 * the fault.
441 */ 438 */
442 switch (handle_mm_fault(mm, vma, address, write)) { 439 switch (handle_mm_fault(mm, vma, address, write)) {
443 case 1: 440 case VM_FAULT_MINOR:
444 tsk->min_flt++; 441 tsk->min_flt++;
445 break; 442 break;
446 case 2: 443 case VM_FAULT_MAJOR:
447 tsk->maj_flt++; 444 tsk->maj_flt++;
448 break; 445 break;
449 case 0: 446 case VM_FAULT_SIGBUS:
450 goto do_sigbus; 447 goto do_sigbus;
451 default: 448 default:
452 goto out_of_memory; 449 goto out_of_memory;
diff --git a/arch/x86_64/mm/init.c b/arch/x86_64/mm/init.c
index 72e4b364ed73..aa4a5189ecee 100644
--- a/arch/x86_64/mm/init.c
+++ b/arch/x86_64/mm/init.c
@@ -322,18 +322,26 @@ void zap_low_mappings(void)
322void __init paging_init(void) 322void __init paging_init(void)
323{ 323{
324 { 324 {
325 unsigned long zones_size[MAX_NR_ZONES] = {0, 0, 0}; 325 unsigned long zones_size[MAX_NR_ZONES];
326 unsigned long holes[MAX_NR_ZONES];
326 unsigned int max_dma; 327 unsigned int max_dma;
327 328
329 memset(zones_size, 0, sizeof(zones_size));
330 memset(holes, 0, sizeof(holes));
331
328 max_dma = virt_to_phys((char *)MAX_DMA_ADDRESS) >> PAGE_SHIFT; 332 max_dma = virt_to_phys((char *)MAX_DMA_ADDRESS) >> PAGE_SHIFT;
329 333
330 if (end_pfn < max_dma) 334 if (end_pfn < max_dma) {
331 zones_size[ZONE_DMA] = end_pfn; 335 zones_size[ZONE_DMA] = end_pfn;
332 else { 336 holes[ZONE_DMA] = e820_hole_size(0, end_pfn);
337 } else {
333 zones_size[ZONE_DMA] = max_dma; 338 zones_size[ZONE_DMA] = max_dma;
339 holes[ZONE_DMA] = e820_hole_size(0, max_dma);
334 zones_size[ZONE_NORMAL] = end_pfn - max_dma; 340 zones_size[ZONE_NORMAL] = end_pfn - max_dma;
341 holes[ZONE_NORMAL] = e820_hole_size(max_dma, end_pfn);
335 } 342 }
336 free_area_init(zones_size); 343 free_area_init_node(0, NODE_DATA(0), zones_size,
344 __pa(PAGE_OFFSET) >> PAGE_SHIFT, holes);
337 } 345 }
338 return; 346 return;
339} 347}
diff --git a/arch/x86_64/mm/numa.c b/arch/x86_64/mm/numa.c
index ac61c186eb02..6a156f5692ae 100644
--- a/arch/x86_64/mm/numa.c
+++ b/arch/x86_64/mm/numa.c
@@ -36,34 +36,36 @@ int numa_off __initdata;
36int __init compute_hash_shift(struct node *nodes, int numnodes) 36int __init compute_hash_shift(struct node *nodes, int numnodes)
37{ 37{
38 int i; 38 int i;
39 int shift = 24; 39 int shift = 20;
40 u64 addr; 40 unsigned long addr,maxend=0;
41 41
42 /* When in doubt use brute force. */ 42 for (i = 0; i < numnodes; i++)
43 while (shift < 48) { 43 if ((nodes[i].start != nodes[i].end) && (nodes[i].end > maxend))
44 memset(memnodemap,0xff,sizeof(*memnodemap) * NODEMAPSIZE); 44 maxend = nodes[i].end;
45 for (i = 0; i < numnodes; i++) { 45
46 if (nodes[i].start == nodes[i].end) 46 while ((1UL << shift) < (maxend / NODEMAPSIZE))
47 continue; 47 shift++;
48 for (addr = nodes[i].start; 48
49 addr < nodes[i].end; 49 printk (KERN_DEBUG"Using %d for the hash shift. Max adder is %lx \n",
50 addr += (1UL << shift)) { 50 shift,maxend);
51 if (memnodemap[addr >> shift] != 0xff && 51 memset(memnodemap,0xff,sizeof(*memnodemap) * NODEMAPSIZE);
52 memnodemap[addr >> shift] != i) { 52 for (i = 0; i < numnodes; i++) {
53 printk(KERN_INFO 53 if (nodes[i].start == nodes[i].end)
54 "node %d shift %d addr %Lx conflict %d\n", 54 continue;
55 i, shift, addr, memnodemap[addr>>shift]); 55 for (addr = nodes[i].start;
56 goto next; 56 addr < nodes[i].end;
57 } 57 addr += (1UL << shift)) {
58 memnodemap[addr >> shift] = i; 58 if (memnodemap[addr >> shift] != 0xff) {
59 printk(KERN_INFO
60 "Your memory is not aligned you need to rebuild your kernel "
61 "with a bigger NODEMAPSIZE shift=%d adder=%lu\n",
62 shift,addr);
63 return -1;
59 } 64 }
65 memnodemap[addr >> shift] = i;
60 } 66 }
61 return shift;
62 next:
63 shift++;
64 } 67 }
65 memset(memnodemap,0,sizeof(*memnodemap) * NODEMAPSIZE); 68 return shift;
66 return -1;
67} 69}
68 70
69#ifdef CONFIG_SPARSEMEM 71#ifdef CONFIG_SPARSEMEM
@@ -124,9 +126,11 @@ void __init setup_node_zones(int nodeid)
124{ 126{
125 unsigned long start_pfn, end_pfn; 127 unsigned long start_pfn, end_pfn;
126 unsigned long zones[MAX_NR_ZONES]; 128 unsigned long zones[MAX_NR_ZONES];
129 unsigned long holes[MAX_NR_ZONES];
127 unsigned long dma_end_pfn; 130 unsigned long dma_end_pfn;
128 131
129 memset(zones, 0, sizeof(unsigned long) * MAX_NR_ZONES); 132 memset(zones, 0, sizeof(unsigned long) * MAX_NR_ZONES);
133 memset(holes, 0, sizeof(unsigned long) * MAX_NR_ZONES);
130 134
131 start_pfn = node_start_pfn(nodeid); 135 start_pfn = node_start_pfn(nodeid);
132 end_pfn = node_end_pfn(nodeid); 136 end_pfn = node_end_pfn(nodeid);
@@ -137,13 +141,17 @@ void __init setup_node_zones(int nodeid)
137 dma_end_pfn = __pa(MAX_DMA_ADDRESS) >> PAGE_SHIFT; 141 dma_end_pfn = __pa(MAX_DMA_ADDRESS) >> PAGE_SHIFT;
138 if (start_pfn < dma_end_pfn) { 142 if (start_pfn < dma_end_pfn) {
139 zones[ZONE_DMA] = dma_end_pfn - start_pfn; 143 zones[ZONE_DMA] = dma_end_pfn - start_pfn;
144 holes[ZONE_DMA] = e820_hole_size(start_pfn, dma_end_pfn);
140 zones[ZONE_NORMAL] = end_pfn - dma_end_pfn; 145 zones[ZONE_NORMAL] = end_pfn - dma_end_pfn;
146 holes[ZONE_NORMAL] = e820_hole_size(dma_end_pfn, end_pfn);
147
141 } else { 148 } else {
142 zones[ZONE_NORMAL] = end_pfn - start_pfn; 149 zones[ZONE_NORMAL] = end_pfn - start_pfn;
150 holes[ZONE_NORMAL] = e820_hole_size(start_pfn, end_pfn);
143 } 151 }
144 152
145 free_area_init_node(nodeid, NODE_DATA(nodeid), zones, 153 free_area_init_node(nodeid, NODE_DATA(nodeid), zones,
146 start_pfn, NULL); 154 start_pfn, holes);
147} 155}
148 156
149void __init numa_init_array(void) 157void __init numa_init_array(void)
diff --git a/arch/x86_64/mm/srat.c b/arch/x86_64/mm/srat.c
index 5d01b31472e1..8e3d097a9ddd 100644
--- a/arch/x86_64/mm/srat.c
+++ b/arch/x86_64/mm/srat.c
@@ -20,6 +20,9 @@
20 20
21static struct acpi_table_slit *acpi_slit; 21static struct acpi_table_slit *acpi_slit;
22 22
23/* Internal processor count */
24static unsigned int __initdata num_processors = 0;
25
23static nodemask_t nodes_parsed __initdata; 26static nodemask_t nodes_parsed __initdata;
24static nodemask_t nodes_found __initdata; 27static nodemask_t nodes_found __initdata;
25static struct node nodes[MAX_NUMNODES] __initdata; 28static struct node nodes[MAX_NUMNODES] __initdata;
@@ -101,16 +104,18 @@ acpi_numa_processor_affinity_init(struct acpi_table_processor_affinity *pa)
101 bad_srat(); 104 bad_srat();
102 return; 105 return;
103 } 106 }
104 if (pa->apic_id >= NR_CPUS) { 107 if (num_processors >= NR_CPUS) {
105 printk(KERN_ERR "SRAT: lapic %u too large.\n", 108 printk(KERN_ERR "SRAT: Processor #%d (lapic %u) INVALID. (Max ID: %d).\n",
106 pa->apic_id); 109 num_processors, pa->apic_id, NR_CPUS);
107 bad_srat(); 110 bad_srat();
108 return; 111 return;
109 } 112 }
110 cpu_to_node[pa->apic_id] = node; 113 cpu_to_node[num_processors] = node;
111 acpi_numa = 1; 114 acpi_numa = 1;
112 printk(KERN_INFO "SRAT: PXM %u -> APIC %u -> Node %u\n", 115 printk(KERN_INFO "SRAT: PXM %u -> APIC %u -> CPU %u -> Node %u\n",
113 pxm, pa->apic_id, node); 116 pxm, pa->apic_id, num_processors, node);
117
118 num_processors++;
114} 119}
115 120
116/* Callback for parsing of the Proximity Domain <-> Memory Area mappings */ 121/* Callback for parsing of the Proximity Domain <-> Memory Area mappings */
@@ -124,7 +129,6 @@ acpi_numa_memory_affinity_init(struct acpi_table_memory_affinity *ma)
124 129
125 if (srat_disabled() || ma->flags.enabled == 0) 130 if (srat_disabled() || ma->flags.enabled == 0)
126 return; 131 return;
127 /* hotplug bit is ignored for now */
128 pxm = ma->proximity_domain; 132 pxm = ma->proximity_domain;
129 node = setup_node(pxm); 133 node = setup_node(pxm);
130 if (node < 0) { 134 if (node < 0) {
@@ -134,6 +138,10 @@ acpi_numa_memory_affinity_init(struct acpi_table_memory_affinity *ma)
134 } 138 }
135 start = ma->base_addr_lo | ((u64)ma->base_addr_hi << 32); 139 start = ma->base_addr_lo | ((u64)ma->base_addr_hi << 32);
136 end = start + (ma->length_lo | ((u64)ma->length_hi << 32)); 140 end = start + (ma->length_lo | ((u64)ma->length_hi << 32));
141 /* It is fine to add this area to the nodes data it will be used later*/
142 if (ma->flags.hot_pluggable == 1)
143 printk(KERN_INFO "SRAT: hot plug zone found %lx - %lx \n",
144 start, end);
137 i = conflicting_nodes(start, end); 145 i = conflicting_nodes(start, end);
138 if (i >= 0) { 146 if (i >= 0) {
139 printk(KERN_ERR 147 printk(KERN_ERR
diff --git a/arch/x86_64/pci/k8-bus.c b/arch/x86_64/pci/k8-bus.c
index 7e7d0c2a0025..d80c323669e0 100644
--- a/arch/x86_64/pci/k8-bus.c
+++ b/arch/x86_64/pci/k8-bus.c
@@ -29,7 +29,7 @@ __init static int
29fill_mp_bus_to_cpumask(void) 29fill_mp_bus_to_cpumask(void)
30{ 30{
31 struct pci_dev *nb_dev = NULL; 31 struct pci_dev *nb_dev = NULL;
32 int i, j, printed; 32 int i, j;
33 u32 ldtbus, nid; 33 u32 ldtbus, nid;
34 static int lbnr[3] = { 34 static int lbnr[3] = {
35 LDT_BUS_NUMBER_REGISTER_0, 35 LDT_BUS_NUMBER_REGISTER_0,
@@ -47,13 +47,22 @@ fill_mp_bus_to_cpumask(void)
47 * if there are no busses hanging off of the current 47 * if there are no busses hanging off of the current
48 * ldt link then both the secondary and subordinate 48 * ldt link then both the secondary and subordinate
49 * bus number fields are set to 0. 49 * bus number fields are set to 0.
50 *
51 * RED-PEN
52 * This is slightly broken because it assumes
53 * HT node IDs == Linux node ids, which is not always
54 * true. However it is probably mostly true.
50 */ 55 */
51 if (!(SECONDARY_LDT_BUS_NUMBER(ldtbus) == 0 56 if (!(SECONDARY_LDT_BUS_NUMBER(ldtbus) == 0
52 && SUBORDINATE_LDT_BUS_NUMBER(ldtbus) == 0)) { 57 && SUBORDINATE_LDT_BUS_NUMBER(ldtbus) == 0)) {
53 for (j = SECONDARY_LDT_BUS_NUMBER(ldtbus); 58 for (j = SECONDARY_LDT_BUS_NUMBER(ldtbus);
54 j <= SUBORDINATE_LDT_BUS_NUMBER(ldtbus); 59 j <= SUBORDINATE_LDT_BUS_NUMBER(ldtbus);
55 j++) 60 j++) {
56 pci_bus_to_node[j] = NODE_ID(nid); 61 int node = NODE_ID(nid);
62 if (!node_online(node))
63 node = 0;
64 pci_bus_to_node[j] = node;
65 }
57 } 66 }
58 } 67 }
59 } 68 }
diff --git a/arch/xtensa/Kconfig b/arch/xtensa/Kconfig
index c9b5d298e3c4..2b6257bec4c3 100644
--- a/arch/xtensa/Kconfig
+++ b/arch/xtensa/Kconfig
@@ -228,6 +228,8 @@ source "fs/Kconfig.binfmt"
228 228
229endmenu 229endmenu
230 230
231source "net/Kconfig"
232
231source "drivers/Kconfig" 233source "drivers/Kconfig"
232 234
233source "fs/Kconfig" 235source "fs/Kconfig"
diff --git a/arch/xtensa/kernel/asm-offsets.c b/arch/xtensa/kernel/asm-offsets.c
index 840cd9a1d3d2..7cd1d7f8f608 100644
--- a/arch/xtensa/kernel/asm-offsets.c
+++ b/arch/xtensa/kernel/asm-offsets.c
@@ -15,7 +15,6 @@
15#include <asm/processor.h> 15#include <asm/processor.h>
16 16
17#include <linux/types.h> 17#include <linux/types.h>
18#include <linux/sched.h>
19#include <linux/stddef.h> 18#include <linux/stddef.h>
20#include <linux/thread_info.h> 19#include <linux/thread_info.h>
21#include <linux/ptrace.h> 20#include <linux/ptrace.h>
diff --git a/arch/xtensa/kernel/signal.c b/arch/xtensa/kernel/signal.c
index df6e1e17b096..dc42cede9394 100644
--- a/arch/xtensa/kernel/signal.c
+++ b/arch/xtensa/kernel/signal.c
@@ -702,12 +702,11 @@ int do_signal(struct pt_regs *regs, sigset_t *oldset)
702 if (ka.sa.sa_flags & SA_ONESHOT) 702 if (ka.sa.sa_flags & SA_ONESHOT)
703 ka.sa.sa_handler = SIG_DFL; 703 ka.sa.sa_handler = SIG_DFL;
704 704
705 if (!(ka.sa.sa_flags & SA_NODEFER)) { 705 spin_lock_irq(&current->sighand->siglock);
706 spin_lock_irq(&current->sighand->siglock); 706 sigorsets(&current->blocked, &current->blocked, &ka.sa.sa_mask);
707 sigorsets(&current->blocked, &current->blocked, &ka.sa.sa_mask); 707 if (!(ka.sa.sa_flags & SA_NODEFER))
708 sigaddset(&current->blocked, signr); 708 sigaddset(&current->blocked, signr);
709 recalc_sigpending(); 709 recalc_sigpending();
710 spin_unlock_irq(&current->sighand->siglock); 710 spin_unlock_irq(&current->sighand->siglock);
711 }
712 return 1; 711 return 1;
713} 712}
diff --git a/arch/xtensa/kernel/syscalls.c b/arch/xtensa/kernel/syscalls.c
index 7270509c44de..f20c6494c518 100644
--- a/arch/xtensa/kernel/syscalls.c
+++ b/arch/xtensa/kernel/syscalls.c
@@ -69,8 +69,8 @@ int sys_pipe(int __user *userfds)
69/* 69/*
70 * Common code for old and new mmaps. 70 * Common code for old and new mmaps.
71 */ 71 */
72long sys_mmap2(unsigned long addr, unsigned long len, unsigned long prot, 72long sys_mmap(unsigned long addr, unsigned long len, unsigned long prot,
73 unsigned long flags, unsigned long fd, unsigned long pgoff) 73 unsigned long flags, unsigned long fd, unsigned long pgoff)
74{ 74{
75 int error = -EBADF; 75 int error = -EBADF;
76 struct file * file = NULL; 76 struct file * file = NULL;
diff --git a/arch/xtensa/kernel/syscalls.h b/arch/xtensa/kernel/syscalls.h
index 07580696b602..216c10a31501 100644
--- a/arch/xtensa/kernel/syscalls.h
+++ b/arch/xtensa/kernel/syscalls.h
@@ -42,7 +42,7 @@ SYSCALL(sys_mknod, 3)
42SYSCALL(sys_chmod, 2) /* 15 */ 42SYSCALL(sys_chmod, 2) /* 15 */
43SYSCALL(sys_lchown, 3) 43SYSCALL(sys_lchown, 3)
44SYSCALL(sys_ni_syscall, 0) 44SYSCALL(sys_ni_syscall, 0)
45SYSCALL(sys_stat, 2) 45SYSCALL(sys_newstat, 2)
46SYSCALL(sys_lseek, 3) 46SYSCALL(sys_lseek, 3)
47SYSCALL(sys_getpid, 0) /* 20 */ 47SYSCALL(sys_getpid, 0) /* 20 */
48SYSCALL(sys_mount, 5) 48SYSCALL(sys_mount, 5)
@@ -52,7 +52,7 @@ SYSCALL(sys_getuid, 0)
52SYSCALL(sys_ni_syscall, 1) /* 25 */ 52SYSCALL(sys_ni_syscall, 1) /* 25 */
53SYSCALL(sys_ptrace, 4) 53SYSCALL(sys_ptrace, 4)
54SYSCALL(sys_ni_syscall, 1) 54SYSCALL(sys_ni_syscall, 1)
55SYSCALL(sys_fstat, 2) 55SYSCALL(sys_newfstat, 2)
56SYSCALL(sys_ni_syscall, 0) 56SYSCALL(sys_ni_syscall, 0)
57SYSCALL(sys_utime, 2) /* 30 */ 57SYSCALL(sys_utime, 2) /* 30 */
58SYSCALL(sys_ni_syscall, 0) 58SYSCALL(sys_ni_syscall, 0)
@@ -108,7 +108,7 @@ SYSCALL(sys_getgroups, 2) /* 80 */
108SYSCALL(sys_setgroups, 2) 108SYSCALL(sys_setgroups, 2)
109SYSCALL(sys_ni_syscall, 0) 109SYSCALL(sys_ni_syscall, 0)
110SYSCALL(sys_symlink, 2) 110SYSCALL(sys_symlink, 2)
111SYSCALL(sys_lstat, 2) 111SYSCALL(sys_newlstat, 2)
112SYSCALL(sys_readlink, 3) /* 85 */ 112SYSCALL(sys_readlink, 3) /* 85 */
113SYSCALL(sys_uselib, 1) 113SYSCALL(sys_uselib, 1)
114SYSCALL(sys_swapon, 2) 114SYSCALL(sys_swapon, 2)
diff --git a/arch/xtensa/kernel/traps.c b/arch/xtensa/kernel/traps.c
index 804246e743b1..225d64d73f04 100644
--- a/arch/xtensa/kernel/traps.c
+++ b/arch/xtensa/kernel/traps.c
@@ -29,6 +29,7 @@
29#include <linux/module.h> 29#include <linux/module.h>
30#include <linux/stringify.h> 30#include <linux/stringify.h>
31#include <linux/kallsyms.h> 31#include <linux/kallsyms.h>
32#include <linux/delay.h>
32 33
33#include <asm/ptrace.h> 34#include <asm/ptrace.h>
34#include <asm/timex.h> 35#include <asm/timex.h>
@@ -488,8 +489,7 @@ void die(const char * str, struct pt_regs * regs, long err)
488 489
489 if (panic_on_oops) { 490 if (panic_on_oops) {
490 printk(KERN_EMERG "Fatal exception: panic in 5 seconds\n"); 491 printk(KERN_EMERG "Fatal exception: panic in 5 seconds\n");
491 set_current_state(TASK_UNINTERRUPTIBLE); 492 ssleep(5);
492 schedule_timeout(5 * HZ);
493 panic("Fatal exception"); 493 panic("Fatal exception");
494 } 494 }
495 do_exit(err); 495 do_exit(err);
diff --git a/arch/xtensa/kernel/vmlinux.lds.S b/arch/xtensa/kernel/vmlinux.lds.S
index 476b2b53cd01..5ed71dfc8110 100644
--- a/arch/xtensa/kernel/vmlinux.lds.S
+++ b/arch/xtensa/kernel/vmlinux.lds.S
@@ -90,10 +90,10 @@ SECTIONS
90 *(.literal .text) 90 *(.literal .text)
91 *(.srom.text) 91 *(.srom.text)
92 VMLINUX_SYMBOL(__sched_text_start) = .; 92 VMLINUX_SYMBOL(__sched_text_start) = .;
93 *(.sched.text.literal .sched.text) 93 *(.sched.literal .sched.text)
94 VMLINUX_SYMBOL(__sched_text_end) = .; 94 VMLINUX_SYMBOL(__sched_text_end) = .;
95 VMLINUX_SYMBOL(__lock_text_start) = .; 95 VMLINUX_SYMBOL(__lock_text_start) = .;
96 *(.spinlock.text.literal .spinlock.text) 96 *(.spinlock.literal .spinlock.text)
97 VMLINUX_SYMBOL(__lock_text_end) = .; 97 VMLINUX_SYMBOL(__lock_text_end) = .;
98 98
99 } 99 }
@@ -164,7 +164,7 @@ SECTIONS
164 __init_begin = .; 164 __init_begin = .;
165 .init.text : { 165 .init.text : {
166 _sinittext = .; 166 _sinittext = .;
167 *(.init.text.literal) *(.init.text) 167 *(.init.literal) *(.init.text)
168 _einittext = .; 168 _einittext = .;
169 } 169 }
170 170