aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
Diffstat (limited to 'arch')
-rw-r--r--arch/alpha/kernel/process.c10
-rw-r--r--arch/arm/Kconfig24
-rw-r--r--arch/arm/Makefile3
-rw-r--r--arch/arm/boot/compressed/head.S3
-rw-r--r--arch/arm/boot/compressed/misc.c6
-rw-r--r--arch/arm/common/scoop.c6
-rw-r--r--arch/arm/configs/ixdp2401_defconfig4
-rw-r--r--arch/arm/configs/ixdp2801_defconfig2
-rw-r--r--arch/arm/configs/realview_defconfig (renamed from arch/arm/configs/mp1000_defconfig)430
-rw-r--r--arch/arm/kernel/armksyms.c4
-rw-r--r--arch/arm/kernel/entry-armv.S22
-rw-r--r--arch/arm/kernel/irq.c34
-rw-r--r--arch/arm/kernel/process.c29
-rw-r--r--arch/arm/kernel/ptrace.c49
-rw-r--r--arch/arm/kernel/setup.c10
-rw-r--r--arch/arm/kernel/smp.c156
-rw-r--r--arch/arm/lib/bitops.h6
-rw-r--r--arch/arm/lib/uaccess.S132
-rw-r--r--arch/arm/mach-aaec2000/clock.c1
-rw-r--r--arch/arm/mach-clps711x/Kconfig11
-rw-r--r--arch/arm/mach-clps711x/Makefile1
-rw-r--r--arch/arm/mach-clps711x/edb7211-mm.c8
-rw-r--r--arch/arm/mach-clps711x/mp1000-mach.c49
-rw-r--r--arch/arm/mach-clps711x/mp1000-mm.c47
-rw-r--r--arch/arm/mach-clps711x/mp1000-seprom.c195
-rw-r--r--arch/arm/mach-epxa10db/mm.c1
-rw-r--r--arch/arm/mach-integrator/impd1.c3
-rw-r--r--arch/arm/mach-ixp2000/core.c81
-rw-r--r--arch/arm/mach-ixp2000/enp2611.c12
-rw-r--r--arch/arm/mach-ixp2000/uengine.c11
-rw-r--r--arch/arm/mach-ixp4xx/common-pci.c2
-rw-r--r--arch/arm/mach-omap1/leds-h2p2-debug.c1
-rw-r--r--arch/arm/mach-pxa/Kconfig9
-rw-r--r--arch/arm/mach-pxa/Makefile1
-rw-r--r--arch/arm/mach-pxa/corgi.c48
-rw-r--r--arch/arm/mach-pxa/corgi_lcd.c1
-rw-r--r--arch/arm/mach-pxa/lubbock.c80
-rw-r--r--arch/arm/mach-pxa/mainstone.c90
-rw-r--r--arch/arm/mach-pxa/pm.c16
-rw-r--r--arch/arm/mach-pxa/poodle.c32
-rw-r--r--arch/arm/mach-pxa/spitz.c95
-rw-r--r--arch/arm/mach-pxa/time.c8
-rw-r--r--arch/arm/mach-pxa/tosa.c306
-rw-r--r--arch/arm/mach-realview/Kconfig9
-rw-r--r--arch/arm/mach-realview/Makefile3
-rw-r--r--arch/arm/mach-realview/core.c5
-rw-r--r--arch/arm/mach-realview/core.h1
-rw-r--r--arch/arm/mach-realview/headsmp.S39
-rw-r--r--arch/arm/mach-realview/hotplug.c138
-rw-r--r--arch/arm/mach-realview/localtimer.c130
-rw-r--r--arch/arm/mach-realview/platsmp.c200
-rw-r--r--arch/arm/mach-realview/realview_eb.c49
-rw-r--r--arch/arm/mach-s3c2410/Kconfig8
-rw-r--r--arch/arm/mach-s3c2410/mach-anubis.c51
-rw-r--r--arch/arm/mach-s3c2410/mach-bast.c73
-rw-r--r--arch/arm/mach-s3c2410/mach-rx3715.c13
-rw-r--r--arch/arm/mach-s3c2410/mach-smdk2440.c23
-rw-r--r--arch/arm/mach-s3c2410/mach-vr1000.c56
-rw-r--r--arch/arm/mach-sa1100/time.c8
-rw-r--r--arch/arm/mm/Kconfig12
-rw-r--r--arch/arm/mm/init.c9
-rw-r--r--arch/arm/mm/mm-armv.c56
-rw-r--r--arch/arm/mm/proc-v6.S26
-rw-r--r--arch/arm/nwfpe/fpa11.h2
-rw-r--r--arch/arm/nwfpe/fpa11_cpdt.c10
-rw-r--r--arch/arm/nwfpe/fpopcode.c16
-rw-r--r--arch/arm/nwfpe/softfloat-specialize1
-rw-r--r--arch/arm/nwfpe/softfloat.c6
-rw-r--r--arch/arm/nwfpe/softfloat.h14
-rw-r--r--arch/arm/plat-omap/ocpi.c1
-rw-r--r--arch/arm26/kernel/process.c12
-rw-r--r--arch/arm26/kernel/ptrace.c49
-rw-r--r--arch/cris/arch-v10/README.mm6
-rw-r--r--arch/cris/arch-v10/drivers/pcf8563.c1
-rw-r--r--arch/cris/arch-v10/kernel/fasttimer.c1
-rw-r--r--arch/cris/arch-v10/kernel/ptrace.c51
-rw-r--r--arch/cris/arch-v10/kernel/signal.c2
-rw-r--r--arch/cris/arch-v32/drivers/cryptocop.c14
-rw-r--r--arch/cris/arch-v32/drivers/nandflash.c1
-rw-r--r--arch/cris/arch-v32/drivers/pcf8563.c1
-rw-r--r--arch/cris/arch-v32/kernel/ptrace.c51
-rw-r--r--arch/cris/arch-v32/kernel/signal.c2
-rw-r--r--arch/cris/arch-v32/kernel/smp.c1
-rw-r--r--arch/cris/kernel/process.c2
-rw-r--r--arch/cris/mm/ioremap.c2
-rw-r--r--arch/frv/kernel/process.c6
-rw-r--r--arch/frv/kernel/ptrace.c43
-rw-r--r--arch/h8300/kernel/process.c28
-rw-r--r--arch/h8300/kernel/ptrace.c39
-rw-r--r--arch/i386/Kconfig13
-rw-r--r--arch/i386/Kconfig.debug10
-rw-r--r--arch/i386/kernel/apic.c10
-rw-r--r--arch/i386/kernel/apm.c25
-rw-r--r--arch/i386/kernel/cpu/common.c5
-rw-r--r--arch/i386/kernel/cpu/cpufreq/acpi-cpufreq.c3
-rw-r--r--arch/i386/kernel/cpu/cpufreq/powernow-k7.c12
-rw-r--r--arch/i386/kernel/cpu/cpufreq/powernow-k8.c19
-rw-r--r--arch/i386/kernel/cpu/cpufreq/speedstep-centrino.c5
-rw-r--r--arch/i386/kernel/cpu/mcheck/k7.c2
-rw-r--r--arch/i386/kernel/cpu/mcheck/mce.c4
-rw-r--r--arch/i386/kernel/cpu/mcheck/p4.c4
-rw-r--r--arch/i386/kernel/cpu/mcheck/p5.c2
-rw-r--r--arch/i386/kernel/cpu/mcheck/p6.c2
-rw-r--r--arch/i386/kernel/cpu/mcheck/winchip.c2
-rw-r--r--arch/i386/kernel/ioport.c3
-rw-r--r--arch/i386/kernel/kprobes.c180
-rw-r--r--arch/i386/kernel/ldt.c1
-rw-r--r--arch/i386/kernel/mca.c2
-rw-r--r--arch/i386/kernel/process.c68
-rw-r--r--arch/i386/kernel/ptrace.c44
-rw-r--r--arch/i386/kernel/reboot_fixups.c3
-rw-r--r--arch/i386/kernel/scx200.c1
-rw-r--r--arch/i386/kernel/setup.c2
-rw-r--r--arch/i386/kernel/smpboot.c5
-rw-r--r--arch/i386/oprofile/Kconfig6
-rw-r--r--arch/i386/power/cpu.c1
-rw-r--r--arch/ia64/Kconfig18
-rw-r--r--arch/ia64/Kconfig.debug11
-rw-r--r--arch/ia64/hp/sim/simserial.c6
-rw-r--r--arch/ia64/ia32/ia32_ioctl.c4
-rw-r--r--arch/ia64/kernel/kprobes.c126
-rw-r--r--arch/ia64/kernel/mca_drv.c3
-rw-r--r--arch/ia64/kernel/perfmon.c2
-rw-r--r--arch/ia64/kernel/process.c34
-rw-r--r--arch/ia64/kernel/setup.c7
-rw-r--r--arch/ia64/kernel/smpboot.c1
-rw-r--r--arch/ia64/lib/Makefile2
-rw-r--r--arch/ia64/lib/swiotlb.c759
-rw-r--r--arch/ia64/oprofile/Kconfig6
-rw-r--r--arch/ia64/sn/pci/pcibr/pcibr_provider.c4
-rw-r--r--arch/ia64/sn/pci/pcibr/pcibr_reg.c2
-rw-r--r--arch/m32r/kernel/process.c2
-rw-r--r--arch/m32r/kernel/smpboot.c1
-rw-r--r--arch/m68k/atari/time.c6
-rw-r--r--arch/m68k/kernel/process.c2
-rw-r--r--arch/m68k/kernel/ptrace.c47
-rw-r--r--arch/m68knommu/Kconfig17
-rw-r--r--arch/m68knommu/Makefile7
-rw-r--r--arch/m68knommu/kernel/asm-offsets.c1
-rw-r--r--arch/m68knommu/kernel/ptrace.c39
-rw-r--r--arch/m68knommu/kernel/setup.c5
-rw-r--r--arch/m68knommu/kernel/vmlinux.lds.S9
-rw-r--r--arch/m68knommu/platform/520x/Makefile19
-rw-r--r--arch/m68knommu/platform/520x/config.c65
-rw-r--r--arch/m68knommu/platform/5307/Makefile1
-rw-r--r--arch/m68knommu/platform/5307/head.S3
-rw-r--r--arch/m68knommu/platform/5307/ints.c1
-rw-r--r--arch/m68knommu/platform/5307/pit.c12
-rw-r--r--arch/mips/Kconfig2
-rw-r--r--arch/mips/au1000/common/setup.c11
-rw-r--r--arch/mips/boot/.gitignore4
-rw-r--r--arch/mips/configs/ddb5476_defconfig1
-rw-r--r--arch/mips/configs/jmr3927_defconfig1
-rw-r--r--arch/mips/configs/ocelot_3_defconfig1
-rw-r--r--arch/mips/configs/pnx8550-jbs_defconfig11
-rw-r--r--arch/mips/configs/pnx8550-v2pci_defconfig11
-rw-r--r--arch/mips/configs/rbhma4500_defconfig1
-rw-r--r--arch/mips/ddb5xxx/common/rtc_ds1386.c6
-rw-r--r--arch/mips/dec/time.c24
-rw-r--r--arch/mips/jmr3927/common/rtc_ds1742.c6
-rw-r--r--arch/mips/kernel/ioctl32.c4
-rw-r--r--arch/mips/kernel/irixsig.c3
-rw-r--r--arch/mips/kernel/process.c2
-rw-r--r--arch/mips/kernel/ptrace.c55
-rw-r--r--arch/mips/kernel/rtlx.c197
-rw-r--r--arch/mips/kernel/signal.c3
-rw-r--r--arch/mips/kernel/signal32.c13
-rw-r--r--arch/mips/kernel/smp.c4
-rw-r--r--arch/mips/kernel/vpe.c100
-rw-r--r--arch/mips/lasat/ds1603.c9
-rw-r--r--arch/mips/momentum/jaguar_atx/setup.c6
-rw-r--r--arch/mips/momentum/ocelot_3/setup.c6
-rw-r--r--arch/mips/momentum/ocelot_c/setup.c6
-rw-r--r--arch/mips/pmc-sierra/yosemite/setup.c6
-rw-r--r--arch/mips/sgi-ip22/ip22-time.c6
-rw-r--r--arch/mips/sibyte/swarm/rtc_m41t81.c7
-rw-r--r--arch/mips/sibyte/swarm/rtc_xicor1241.c6
-rw-r--r--arch/mips/tx4938/toshiba_rbtx4938/irq.c1
-rw-r--r--arch/parisc/kernel/asm-offsets.c1
-rw-r--r--arch/parisc/kernel/process.c4
-rw-r--r--arch/parisc/kernel/ptrace.c50
-rw-r--r--arch/parisc/kernel/smp.c1
-rw-r--r--arch/powerpc/Kconfig61
-rw-r--r--arch/powerpc/Kconfig.debug10
-rw-r--r--arch/powerpc/Makefile5
-rw-r--r--arch/powerpc/configs/cell_defconfig1024
-rw-r--r--arch/powerpc/configs/g5_defconfig1543
-rw-r--r--arch/powerpc/configs/iseries_defconfig998
-rw-r--r--arch/powerpc/configs/maple_defconfig1062
-rw-r--r--arch/powerpc/configs/pseries_defconfig1371
-rw-r--r--arch/powerpc/kernel/Makefile9
-rw-r--r--arch/powerpc/kernel/asm-offsets.c5
-rw-r--r--arch/powerpc/kernel/cputable.c14
-rw-r--r--arch/powerpc/kernel/head_64.S320
-rw-r--r--arch/powerpc/kernel/lparmap.c4
-rw-r--r--arch/powerpc/kernel/misc_64.S70
-rw-r--r--arch/powerpc/kernel/ppc32.h138
-rw-r--r--arch/powerpc/kernel/ppc_ksyms.c9
-rw-r--r--arch/powerpc/kernel/process.c30
-rw-r--r--arch/powerpc/kernel/prom.c99
-rw-r--r--arch/powerpc/kernel/prom_init.c13
-rw-r--r--arch/powerpc/kernel/ptrace.c43
-rw-r--r--arch/powerpc/kernel/rtas-proc.c (renamed from arch/ppc64/kernel/rtas-proc.c)0
-rw-r--r--arch/powerpc/kernel/rtas.c24
-rw-r--r--arch/powerpc/kernel/rtas_flash.c (renamed from arch/ppc64/kernel/rtas_flash.c)113
-rw-r--r--arch/powerpc/kernel/setup-common.c163
-rw-r--r--arch/powerpc/kernel/setup_32.c3
-rw-r--r--arch/powerpc/kernel/setup_64.c245
-rw-r--r--arch/powerpc/kernel/signal_32.c3
-rw-r--r--arch/powerpc/kernel/signal_64.c (renamed from arch/ppc64/kernel/signal.c)1
-rw-r--r--arch/powerpc/kernel/smp-tbsync.c (renamed from arch/ppc64/kernel/smp-tbsync.c)112
-rw-r--r--arch/powerpc/kernel/smp.c (renamed from arch/ppc64/kernel/smp.c)60
-rw-r--r--arch/powerpc/kernel/time.c10
-rw-r--r--arch/powerpc/kernel/traps.c23
-rw-r--r--arch/powerpc/kernel/vio.c27
-rw-r--r--arch/powerpc/kernel/vmlinux.lds.S29
-rw-r--r--arch/powerpc/lib/Makefile9
-rw-r--r--arch/powerpc/lib/bitops.c (renamed from arch/ppc64/kernel/bitops.c)97
-rw-r--r--arch/powerpc/lib/copypage_64.S2
-rw-r--r--arch/powerpc/lib/copyuser_64.S4
-rw-r--r--arch/powerpc/lib/locks.c3
-rw-r--r--arch/powerpc/mm/fault.c17
-rw-r--r--arch/powerpc/mm/hash_low_64.S613
-rw-r--r--arch/powerpc/mm/hash_native_64.c377
-rw-r--r--arch/powerpc/mm/hash_utils_64.c538
-rw-r--r--arch/powerpc/mm/hugetlbpage.c140
-rw-r--r--arch/powerpc/mm/init_64.c19
-rw-r--r--arch/powerpc/mm/mem.c58
-rw-r--r--arch/powerpc/mm/numa.c1
-rw-r--r--arch/powerpc/mm/pgtable_64.c23
-rw-r--r--arch/powerpc/mm/ppc_mmu_32.c15
-rw-r--r--arch/powerpc/mm/slb.c102
-rw-r--r--arch/powerpc/mm/slb_low.S229
-rw-r--r--arch/powerpc/mm/stab.c30
-rw-r--r--arch/powerpc/mm/tlb_64.c32
-rw-r--r--arch/powerpc/oprofile/Kconfig6
-rw-r--r--arch/powerpc/oprofile/op_model_power4.c24
-rw-r--r--arch/powerpc/platforms/Makefile1
-rw-r--r--arch/powerpc/platforms/cell/Makefile2
-rw-r--r--arch/powerpc/platforms/cell/interrupt.c (renamed from arch/ppc64/kernel/bpa_iic.c)8
-rw-r--r--arch/powerpc/platforms/cell/interrupt.h (renamed from arch/ppc64/kernel/bpa_iic.h)8
-rw-r--r--arch/powerpc/platforms/cell/iommu.c (renamed from arch/ppc64/kernel/bpa_iommu.c)44
-rw-r--r--arch/powerpc/platforms/cell/iommu.h (renamed from arch/ppc64/kernel/bpa_iommu.h)10
-rw-r--r--arch/powerpc/platforms/cell/setup.c (renamed from arch/ppc64/kernel/bpa_setup.c)46
-rw-r--r--arch/powerpc/platforms/cell/smp.c230
-rw-r--r--arch/powerpc/platforms/cell/spider-pic.c (renamed from arch/ppc64/kernel/spider-pic.c)2
-rw-r--r--arch/powerpc/platforms/chrp/nvram.c13
-rw-r--r--arch/powerpc/platforms/chrp/pegasos_eth.c1
-rw-r--r--arch/powerpc/platforms/chrp/smp.c39
-rw-r--r--arch/powerpc/platforms/iseries/call_hpt.h4
-rw-r--r--arch/powerpc/platforms/iseries/call_pci.h4
-rw-r--r--arch/powerpc/platforms/iseries/call_sm.h4
-rw-r--r--arch/powerpc/platforms/iseries/htab.c65
-rw-r--r--arch/powerpc/platforms/iseries/hvlog.c10
-rw-r--r--arch/powerpc/platforms/iseries/hvlpconfig.c2
-rw-r--r--arch/powerpc/platforms/iseries/iommu.c76
-rw-r--r--arch/powerpc/platforms/iseries/irq.c11
-rw-r--r--arch/powerpc/platforms/iseries/ksyms.c2
-rw-r--r--arch/powerpc/platforms/iseries/lpardata.c12
-rw-r--r--arch/powerpc/platforms/iseries/lpevents.c8
-rw-r--r--arch/powerpc/platforms/iseries/mf.c8
-rw-r--r--arch/powerpc/platforms/iseries/naca.h24
-rw-r--r--arch/powerpc/platforms/iseries/pci.c41
-rw-r--r--arch/powerpc/platforms/iseries/proc.c4
-rw-r--r--arch/powerpc/platforms/iseries/release_data.h2
-rw-r--r--arch/powerpc/platforms/iseries/setup.c91
-rw-r--r--arch/powerpc/platforms/iseries/smp.c3
-rw-r--r--arch/powerpc/platforms/iseries/vio.c47
-rw-r--r--arch/powerpc/platforms/iseries/viopath.c28
-rw-r--r--arch/powerpc/platforms/iseries/vpdinfo.c2
-rw-r--r--arch/powerpc/platforms/powermac/Makefile3
-rw-r--r--arch/powerpc/platforms/powermac/cpufreq_32.c (renamed from arch/powerpc/platforms/powermac/cpufreq.c)15
-rw-r--r--arch/powerpc/platforms/powermac/cpufreq_64.c323
-rw-r--r--arch/powerpc/platforms/powermac/pic.c8
-rw-r--r--arch/powerpc/platforms/powermac/setup.c16
-rw-r--r--arch/powerpc/platforms/pseries/Kconfig9
-rw-r--r--arch/powerpc/platforms/pseries/Makefile2
-rw-r--r--arch/powerpc/platforms/pseries/iommu.c7
-rw-r--r--arch/powerpc/platforms/pseries/lpar.c131
-rw-r--r--arch/powerpc/platforms/pseries/plpar_wrappers.h110
-rw-r--r--arch/powerpc/platforms/pseries/ras.c2
-rw-r--r--arch/powerpc/platforms/pseries/reconfig.c6
-rw-r--r--arch/powerpc/platforms/pseries/rtas-fw.c138
-rw-r--r--arch/powerpc/platforms/pseries/rtas-fw.h3
-rw-r--r--arch/powerpc/platforms/pseries/rtasd.c (renamed from arch/ppc64/kernel/rtasd.c)0
-rw-r--r--arch/powerpc/platforms/pseries/setup.c41
-rw-r--r--arch/powerpc/platforms/pseries/smp.c3
-rw-r--r--arch/powerpc/sysdev/Makefile1
-rw-r--r--arch/powerpc/sysdev/dart.h59
-rw-r--r--arch/powerpc/sysdev/i8259.c5
-rw-r--r--arch/powerpc/sysdev/mmio_nvram.c (renamed from arch/ppc64/kernel/bpa_nvram.c)60
-rw-r--r--arch/powerpc/sysdev/u3_iommu.c6
-rw-r--r--arch/ppc/4xx_io/serial_sicc.c17
-rw-r--r--arch/ppc/8260_io/fcc_enet.c3
-rw-r--r--arch/ppc/8xx_io/commproc.c5
-rw-r--r--arch/ppc/8xx_io/cs4218_tdm.c3
-rw-r--r--arch/ppc/Kconfig18
-rw-r--r--arch/ppc/Makefile3
-rw-r--r--arch/ppc/boot/simple/Makefile27
-rw-r--r--arch/ppc/boot/simple/misc.c16
-rw-r--r--arch/ppc/boot/simple/openbios.c106
-rw-r--r--arch/ppc/configs/ev64360_defconfig73
-rw-r--r--arch/ppc/configs/mpc834x_sys_defconfig431
-rw-r--r--arch/ppc/configs/stx_gp3_defconfig86
-rw-r--r--arch/ppc/kernel/Makefile2
-rw-r--r--arch/ppc/kernel/bitops.c126
-rw-r--r--arch/ppc/kernel/head_44x.S4
-rw-r--r--arch/ppc/kernel/idle.c25
-rw-r--r--arch/ppc/kernel/irq.c2
-rw-r--r--arch/ppc/kernel/machine_kexec.c2
-rw-r--r--arch/ppc/kernel/misc.S145
-rw-r--r--arch/ppc/kernel/ppc_ksyms.c5
-rw-r--r--arch/ppc/kernel/rio.c52
-rw-r--r--arch/ppc/kernel/smp.c1
-rw-r--r--arch/ppc/kernel/traps.c20
-rw-r--r--arch/ppc/platforms/4xx/Kconfig19
-rw-r--r--arch/ppc/platforms/4xx/Makefile2
-rw-r--r--arch/ppc/platforms/4xx/bubinga.c2
-rw-r--r--arch/ppc/platforms/4xx/bubinga.h64
-rw-r--r--arch/ppc/platforms/4xx/ebony.h4
-rw-r--r--arch/ppc/platforms/4xx/ppc440spe.c148
-rw-r--r--arch/ppc/platforms/4xx/ppc440spe.h66
-rw-r--r--arch/ppc/platforms/4xx/sycamore.c7
-rw-r--r--arch/ppc/platforms/4xx/sycamore.h67
-rw-r--r--arch/ppc/platforms/4xx/walnut.c2
-rw-r--r--arch/ppc/platforms/4xx/walnut.h67
-rw-r--r--arch/ppc/platforms/4xx/yucca.c395
-rw-r--r--arch/ppc/platforms/4xx/yucca.h111
-rw-r--r--arch/ppc/platforms/83xx/mpc834x_sys.c23
-rw-r--r--arch/ppc/platforms/85xx/mpc85xx_ads_common.c10
-rw-r--r--arch/ppc/platforms/85xx/stx_gp3.c14
-rw-r--r--arch/ppc/platforms/85xx/stx_gp3.h1
-rw-r--r--arch/ppc/platforms/ev64360.c12
-rw-r--r--arch/ppc/syslib/Makefile4
-rw-r--r--arch/ppc/syslib/ibm440sp_common.c4
-rw-r--r--arch/ppc/syslib/ibm44x_common.c12
-rw-r--r--arch/ppc/syslib/m8xx_setup.c1
-rw-r--r--arch/ppc/syslib/m8xx_wdt.c13
-rw-r--r--arch/ppc/syslib/mpc83xx_devices.c12
-rw-r--r--arch/ppc/syslib/mpc83xx_sys.c24
-rw-r--r--arch/ppc/syslib/ppc405_pci.c7
-rw-r--r--arch/ppc/syslib/ppc440spe_pcie.c442
-rw-r--r--arch/ppc/syslib/ppc440spe_pcie.h149
-rw-r--r--arch/ppc/syslib/ppc4xx_pic.c37
-rw-r--r--arch/ppc/syslib/ppc85xx_rio.c938
-rw-r--r--arch/ppc/syslib/ppc85xx_rio.h21
-rw-r--r--arch/ppc/syslib/ppc_sys.c1
-rw-r--r--arch/ppc/syslib/prom.c11
-rw-r--r--arch/ppc/syslib/prom_init.c1
-rw-r--r--arch/ppc/xmon/xmon.c5
-rw-r--r--arch/ppc64/Kconfig29
-rw-r--r--arch/ppc64/Kconfig.debug4
-rw-r--r--arch/ppc64/Makefile1
-rw-r--r--arch/ppc64/boot/main.c11
-rw-r--r--arch/ppc64/kernel/Makefile16
-rw-r--r--arch/ppc64/kernel/asm-offsets.c5
-rw-r--r--arch/ppc64/kernel/head.S320
-rw-r--r--arch/ppc64/kernel/idle.c16
-rw-r--r--arch/ppc64/kernel/irq.c4
-rw-r--r--arch/ppc64/kernel/kprobes.c138
-rw-r--r--arch/ppc64/kernel/lparcfg.c8
-rw-r--r--arch/ppc64/kernel/machine_kexec.c2
-rw-r--r--arch/ppc64/kernel/misc.S72
-rw-r--r--arch/ppc64/kernel/pacaData.c4
-rw-r--r--arch/ppc64/kernel/pci.c17
-rw-r--r--arch/ppc64/kernel/pci_dn.c5
-rw-r--r--arch/ppc64/kernel/proc_ppc64.c2
-rw-r--r--arch/ppc64/kernel/prom.c119
-rw-r--r--arch/ppc64/kernel/prom_init.c7
-rw-r--r--arch/ppc64/kernel/rtas_pci.c6
-rw-r--r--arch/ppc64/kernel/scanlog.c3
-rw-r--r--arch/ppc64/kernel/sysfs.c1
-rw-r--r--arch/ppc64/kernel/udbg.c55
-rw-r--r--arch/ppc64/kernel/udbg_scc.c1
-rw-r--r--arch/ppc64/lib/Makefile5
-rw-r--r--arch/ppc64/lib/string.S179
-rw-r--r--arch/s390/Makefile4
-rw-r--r--arch/s390/appldata/appldata_base.c7
-rw-r--r--arch/s390/kernel/Makefile4
-rw-r--r--arch/s390/kernel/debug.c12
-rw-r--r--arch/s390/kernel/entry.S4
-rw-r--r--arch/s390/kernel/entry64.S4
-rw-r--r--arch/s390/kernel/head.S383
-rw-r--r--arch/s390/kernel/head31.S336
-rw-r--r--arch/s390/kernel/head64.S543
-rw-r--r--arch/s390/kernel/process.c24
-rw-r--r--arch/s390/kernel/smp.c1
-rw-r--r--arch/s390/kernel/time.c8
-rw-r--r--arch/s390/kernel/traps.c29
-rw-r--r--arch/s390/mm/extmem.c8
-rw-r--r--arch/s390/mm/fault.c115
-rw-r--r--arch/sh/Kconfig28
-rw-r--r--arch/sh/Makefile8
-rw-r--r--arch/sh/drivers/Makefile5
-rw-r--r--arch/sh/drivers/superhyway/Makefile6
-rw-r--r--arch/sh/drivers/superhyway/ops-sh4-202.c171
-rw-r--r--arch/sh/kernel/process.c14
-rw-r--r--arch/sh/kernel/ptrace.c44
-rw-r--r--arch/sh/kernel/setup.c26
-rw-r--r--arch/sh/kernel/smp.c5
-rw-r--r--arch/sh/mm/init.c21
-rw-r--r--arch/sh/mm/tlb-sh3.c19
-rw-r--r--arch/sh/ramdisk/Makefile20
-rw-r--r--arch/sh/ramdisk/ld.script9
-rw-r--r--arch/sh64/kernel/process.c16
-rw-r--r--arch/sh64/kernel/ptrace.c83
-rw-r--r--arch/sh64/kernel/syscalls.S2
-rw-r--r--arch/sparc/Kconfig8
-rw-r--r--arch/sparc/kernel/Makefile1
-rw-r--r--arch/sparc/kernel/cpu.c4
-rw-r--r--arch/sparc/kernel/led.c139
-rw-r--r--arch/sparc/kernel/pcic.c2
-rw-r--r--arch/sparc/kernel/process.c35
-rw-r--r--arch/sparc/kernel/sunos_ioctl.c1
-rw-r--r--arch/sparc/mm/fault.c2
-rw-r--r--arch/sparc64/Kconfig13
-rw-r--r--arch/sparc64/Kconfig.debug10
-rw-r--r--arch/sparc64/kernel/cpu.c4
-rw-r--r--arch/sparc64/kernel/ioctl32.c465
-rw-r--r--arch/sparc64/kernel/kprobes.c165
-rw-r--r--arch/sparc64/kernel/process.c24
-rw-r--r--arch/sparc64/kernel/sbus.c2
-rw-r--r--arch/sparc64/kernel/setup.c12
-rw-r--r--arch/sparc64/kernel/signal32.c6
-rw-r--r--arch/sparc64/kernel/smp.c95
-rw-r--r--arch/sparc64/kernel/sunos_ioctl32.c1
-rw-r--r--arch/sparc64/kernel/time.c13
-rw-r--r--arch/sparc64/kernel/us2e_cpufreq.c7
-rw-r--r--arch/sparc64/kernel/us3_cpufreq.c7
-rw-r--r--arch/sparc64/mm/fault.c4
-rw-r--r--arch/sparc64/oprofile/Kconfig6
-rw-r--r--arch/um/Kconfig46
-rw-r--r--arch/um/Makefile2
-rw-r--r--arch/um/Makefile-i3862
-rw-r--r--arch/um/drivers/chan_user.c1
-rw-r--r--arch/um/drivers/harddog_kern.c1
-rw-r--r--arch/um/drivers/harddog_user.c1
-rw-r--r--arch/um/drivers/net_kern.c76
-rw-r--r--arch/um/drivers/net_user.c1
-rw-r--r--arch/um/drivers/port_user.c1
-rw-r--r--arch/um/drivers/random.c6
-rw-r--r--arch/um/drivers/slip_user.c1
-rw-r--r--arch/um/drivers/slirp_user.c1
-rw-r--r--arch/um/drivers/xterm.c1
-rw-r--r--arch/um/include/helper.h27
-rw-r--r--arch/um/include/mem_user.h2
-rw-r--r--arch/um/include/net_user.h2
-rw-r--r--arch/um/include/os.h16
-rw-r--r--arch/um/include/sysdep-i386/stub.h64
-rw-r--r--arch/um/include/sysdep-x86_64/stub.h61
-rw-r--r--arch/um/include/uml_uaccess.h4
-rw-r--r--arch/um/kernel/Makefile7
-rw-r--r--arch/um/kernel/ksyms.c1
-rw-r--r--arch/um/kernel/mem.c4
-rw-r--r--arch/um/kernel/physmem.c4
-rw-r--r--arch/um/kernel/ptrace.c50
-rw-r--r--arch/um/kernel/sigio_user.c3
-rw-r--r--arch/um/kernel/skas/include/mmu-skas.h2
-rw-r--r--arch/um/kernel/skas/include/skas.h3
-rw-r--r--arch/um/kernel/skas/mem.c2
-rw-r--r--arch/um/kernel/skas/mmu.c44
-rw-r--r--arch/um/kernel/skas/process.c17
-rw-r--r--arch/um/kernel/skas/process_kern.c2
-rw-r--r--arch/um/kernel/tt/uaccess_user.c1
-rw-r--r--arch/um/kernel/uaccess.c30
-rw-r--r--arch/um/kernel/uaccess_user.c64
-rw-r--r--arch/um/kernel/um_arch.c10
-rw-r--r--arch/um/kernel/user_util.c1
-rw-r--r--arch/um/os-Linux/Makefile9
-rw-r--r--arch/um/os-Linux/aio.c1
-rw-r--r--arch/um/os-Linux/drivers/ethertap_user.c1
-rw-r--r--arch/um/os-Linux/drivers/tuntap_user.c1
-rw-r--r--arch/um/os-Linux/helper.c (renamed from arch/um/kernel/helper.c)18
-rw-r--r--arch/um/os-Linux/main.c (renamed from arch/um/kernel/main.c)49
-rw-r--r--arch/um/os-Linux/mem.c6
-rw-r--r--arch/um/os-Linux/start_up.c77
-rw-r--r--arch/um/os-Linux/uaccess.c32
-rw-r--r--arch/um/scripts/Makefile.rules7
-rw-r--r--arch/um/sys-i386/ldt.c506
-rw-r--r--arch/um/sys-x86_64/Makefile5
-rw-r--r--arch/um/sys-x86_64/syscalls.c75
-rw-r--r--arch/v850/kernel/process.c16
-rw-r--r--arch/v850/kernel/ptrace.c43
-rw-r--r--arch/x86_64/Kconfig13
-rw-r--r--arch/x86_64/Kconfig.debug10
-rw-r--r--arch/x86_64/ia32/ia32_ioctl.c6
-rw-r--r--arch/x86_64/kernel/Makefile2
-rw-r--r--arch/x86_64/kernel/kprobes.c183
-rw-r--r--arch/x86_64/kernel/process.c69
-rw-r--r--arch/x86_64/kernel/ptrace.c43
-rw-r--r--arch/x86_64/kernel/smpboot.c3
-rw-r--r--arch/x86_64/lib/bitops.c66
-rw-r--r--arch/x86_64/oprofile/Kconfig6
-rw-r--r--arch/xtensa/kernel/process.c3
-rw-r--r--arch/xtensa/kernel/ptrace.c55
-rw-r--r--arch/xtensa/platform-iss/network.c33
496 files changed, 18666 insertions, 8431 deletions
diff --git a/arch/alpha/kernel/process.c b/arch/alpha/kernel/process.c
index eb20c3afff58..a8682612abc0 100644
--- a/arch/alpha/kernel/process.c
+++ b/arch/alpha/kernel/process.c
@@ -43,21 +43,17 @@
43#include "proto.h" 43#include "proto.h"
44#include "pci_impl.h" 44#include "pci_impl.h"
45 45
46void default_idle(void)
47{
48 barrier();
49}
50
51void 46void
52cpu_idle(void) 47cpu_idle(void)
53{ 48{
49 set_thread_flag(TIF_POLLING_NRFLAG);
50
54 while (1) { 51 while (1) {
55 void (*idle)(void) = default_idle;
56 /* FIXME -- EV6 and LCA45 know how to power down 52 /* FIXME -- EV6 and LCA45 know how to power down
57 the CPU. */ 53 the CPU. */
58 54
59 while (!need_resched()) 55 while (!need_resched())
60 idle(); 56 cpu_relax();
61 schedule(); 57 schedule();
62 } 58 }
63} 59}
diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index dc6d8342e5e6..ec77721507cb 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -324,7 +324,7 @@ menu "Kernel Features"
324 324
325config SMP 325config SMP
326 bool "Symmetric Multi-Processing (EXPERIMENTAL)" 326 bool "Symmetric Multi-Processing (EXPERIMENTAL)"
327 depends on EXPERIMENTAL && BROKEN #&& n 327 depends on EXPERIMENTAL && REALVIEW_MPCORE
328 help 328 help
329 This enables support for systems with more than one CPU. If you have 329 This enables support for systems with more than one CPU. If you have
330 a system with only one CPU, like most personal computers, say N. If 330 a system with only one CPU, like most personal computers, say N. If
@@ -349,6 +349,23 @@ config NR_CPUS
349 depends on SMP 349 depends on SMP
350 default "4" 350 default "4"
351 351
352config HOTPLUG_CPU
353 bool "Support for hot-pluggable CPUs (EXPERIMENTAL)"
354 depends on SMP && HOTPLUG && EXPERIMENTAL
355 help
356 Say Y here to experiment with turning CPUs off and on. CPUs
357 can be controlled through /sys/devices/system/cpu.
358
359config LOCAL_TIMERS
360 bool "Use local timer interrupts"
361 depends on SMP && REALVIEW_MPCORE
362 default y
363 help
364 Enable support for local timers on SMP platforms, rather then the
365 legacy IPI broadcast method. Local timers allows the system
366 accounting to be spread across the timer interval, preventing a
367 "thundering herd" at every timer tick.
368
352config PREEMPT 369config PREEMPT
353 bool "Preemptible Kernel (EXPERIMENTAL)" 370 bool "Preemptible Kernel (EXPERIMENTAL)"
354 depends on EXPERIMENTAL 371 depends on EXPERIMENTAL
@@ -578,7 +595,7 @@ config FPE_NWFPE
578 595
579config FPE_NWFPE_XP 596config FPE_NWFPE_XP
580 bool "Support extended precision" 597 bool "Support extended precision"
581 depends on FPE_NWFPE && !CPU_BIG_ENDIAN 598 depends on FPE_NWFPE
582 help 599 help
583 Say Y to include 80-bit support in the kernel floating-point 600 Say Y to include 80-bit support in the kernel floating-point
584 emulator. Otherwise, only 32 and 64-bit support is compiled in. 601 emulator. Otherwise, only 32 and 64-bit support is compiled in.
@@ -697,8 +714,7 @@ source "drivers/acorn/block/Kconfig"
697 714
698if PCMCIA || ARCH_CLPS7500 || ARCH_IOP3XX || ARCH_IXP4XX \ 715if PCMCIA || ARCH_CLPS7500 || ARCH_IOP3XX || ARCH_IXP4XX \
699 || ARCH_L7200 || ARCH_LH7A40X || ARCH_PXA || ARCH_RPC \ 716 || ARCH_L7200 || ARCH_LH7A40X || ARCH_PXA || ARCH_RPC \
700 || ARCH_S3C2410 || ARCH_SA1100 || ARCH_SHARK || FOOTBRIDGE \ 717 || ARCH_S3C2410 || ARCH_SA1100 || ARCH_SHARK || FOOTBRIDGE
701 || MACH_MP1000
702source "drivers/ide/Kconfig" 718source "drivers/ide/Kconfig"
703endif 719endif
704 720
diff --git a/arch/arm/Makefile b/arch/arm/Makefile
index d80749ae2a7e..114cda7f1b73 100644
--- a/arch/arm/Makefile
+++ b/arch/arm/Makefile
@@ -38,6 +38,7 @@ comma = ,
38# macro, but instead defines a whole series of macros which makes 38# macro, but instead defines a whole series of macros which makes
39# testing for a specific architecture or later rather impossible. 39# testing for a specific architecture or later rather impossible.
40arch-$(CONFIG_CPU_32v6) :=-D__LINUX_ARM_ARCH__=6 $(call cc-option,-march=armv6,-march=armv5t -Wa$(comma)-march=armv6) 40arch-$(CONFIG_CPU_32v6) :=-D__LINUX_ARM_ARCH__=6 $(call cc-option,-march=armv6,-march=armv5t -Wa$(comma)-march=armv6)
41arch-$(CONFIG_CPU_32v6K) :=-D__LINUX_ARM_ARCH__=6 $(call cc-option,-march=armv6k,-march=armv5t -Wa$(comma)-march=armv6k)
41arch-$(CONFIG_CPU_32v5) :=-D__LINUX_ARM_ARCH__=5 $(call cc-option,-march=armv5te,-march=armv4) 42arch-$(CONFIG_CPU_32v5) :=-D__LINUX_ARM_ARCH__=5 $(call cc-option,-march=armv5te,-march=armv4)
42arch-$(CONFIG_CPU_32v4) :=-D__LINUX_ARM_ARCH__=4 -march=armv4 43arch-$(CONFIG_CPU_32v4) :=-D__LINUX_ARM_ARCH__=4 -march=armv4
43arch-$(CONFIG_CPU_32v3) :=-D__LINUX_ARM_ARCH__=3 -march=armv3 44arch-$(CONFIG_CPU_32v3) :=-D__LINUX_ARM_ARCH__=3 -march=armv3
@@ -143,7 +144,7 @@ drivers-$(CONFIG_OPROFILE) += arch/arm/oprofile/
143drivers-$(CONFIG_ARCH_CLPS7500) += drivers/acorn/char/ 144drivers-$(CONFIG_ARCH_CLPS7500) += drivers/acorn/char/
144drivers-$(CONFIG_ARCH_L7200) += drivers/acorn/char/ 145drivers-$(CONFIG_ARCH_L7200) += drivers/acorn/char/
145 146
146libs-y += arch/arm/lib/ 147libs-y := arch/arm/lib/ $(libs-y)
147 148
148# Default target when executing plain make 149# Default target when executing plain make
149ifeq ($(CONFIG_XIP_KERNEL),y) 150ifeq ($(CONFIG_XIP_KERNEL),y)
diff --git a/arch/arm/boot/compressed/head.S b/arch/arm/boot/compressed/head.S
index a54d2eb64892..7c7f475e213e 100644
--- a/arch/arm/boot/compressed/head.S
+++ b/arch/arm/boot/compressed/head.S
@@ -39,8 +39,7 @@
39 defined(CONFIG_ARCH_IXP4XX) || \ 39 defined(CONFIG_ARCH_IXP4XX) || \
40 defined(CONFIG_ARCH_IXP2000) || \ 40 defined(CONFIG_ARCH_IXP2000) || \
41 defined(CONFIG_ARCH_LH7A40X) || \ 41 defined(CONFIG_ARCH_LH7A40X) || \
42 defined(CONFIG_ARCH_OMAP) || \ 42 defined(CONFIG_ARCH_OMAP)
43 defined(CONFIG_MACH_MP1000)
44 .macro loadsp, rb 43 .macro loadsp, rb
45 addruart \rb 44 addruart \rb
46 .endm 45 .endm
diff --git a/arch/arm/boot/compressed/misc.c b/arch/arm/boot/compressed/misc.c
index 50f13eec6cd7..5ab94584baee 100644
--- a/arch/arm/boot/compressed/misc.c
+++ b/arch/arm/boot/compressed/misc.c
@@ -283,8 +283,14 @@ void flush_window(void)
283 putstr("."); 283 putstr(".");
284} 284}
285 285
286#ifndef arch_error
287#define arch_error(x)
288#endif
289
286static void error(char *x) 290static void error(char *x)
287{ 291{
292 arch_error(x);
293
288 putstr("\n\n"); 294 putstr("\n\n");
289 putstr(x); 295 putstr(x);
290 putstr("\n\n -- System halted"); 296 putstr("\n\n -- System halted");
diff --git a/arch/arm/common/scoop.c b/arch/arm/common/scoop.c
index bb4eff614413..c7fdf390cef9 100644
--- a/arch/arm/common/scoop.c
+++ b/arch/arm/common/scoop.c
@@ -19,12 +19,6 @@
19 19
20#define SCOOP_REG(d,adr) (*(volatile unsigned short*)(d +(adr))) 20#define SCOOP_REG(d,adr) (*(volatile unsigned short*)(d +(adr)))
21 21
22/* PCMCIA to Scoop linkage structures for pxa2xx_sharpsl.c
23 There is no easy way to link multiple scoop devices into one
24 single entity for the pxa2xx_pcmcia device */
25int scoop_num;
26struct scoop_pcmcia_dev *scoop_devs;
27
28struct scoop_dev { 22struct scoop_dev {
29 void *base; 23 void *base;
30 spinlock_t scoop_lock; 24 spinlock_t scoop_lock;
diff --git a/arch/arm/configs/ixdp2401_defconfig b/arch/arm/configs/ixdp2401_defconfig
index 38c9a721d5c9..32bd552e0986 100644
--- a/arch/arm/configs/ixdp2401_defconfig
+++ b/arch/arm/configs/ixdp2401_defconfig
@@ -152,7 +152,7 @@ CONFIG_ALIGNMENT_TRAP=y
152# 152#
153CONFIG_ZBOOT_ROM_TEXT=0x0 153CONFIG_ZBOOT_ROM_TEXT=0x0
154CONFIG_ZBOOT_ROM_BSS=0x0 154CONFIG_ZBOOT_ROM_BSS=0x0
155CONFIG_CMDLINE="console=ttyS0,57600 root=/dev/nfs ip=bootp mem=64M@0x0 pci=firmware" 155CONFIG_CMDLINE="console=ttyS0,115200 root=/dev/nfs ip=bootp mem=64M@0x0 pci=firmware"
156# CONFIG_XIP_KERNEL is not set 156# CONFIG_XIP_KERNEL is not set
157 157
158# 158#
@@ -560,7 +560,7 @@ CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768
560# 560#
561CONFIG_SERIAL_8250=y 561CONFIG_SERIAL_8250=y
562CONFIG_SERIAL_8250_CONSOLE=y 562CONFIG_SERIAL_8250_CONSOLE=y
563CONFIG_SERIAL_8250_NR_UARTS=2 563CONFIG_SERIAL_8250_NR_UARTS=3
564# CONFIG_SERIAL_8250_EXTENDED is not set 564# CONFIG_SERIAL_8250_EXTENDED is not set
565 565
566# 566#
diff --git a/arch/arm/configs/ixdp2801_defconfig b/arch/arm/configs/ixdp2801_defconfig
index 12ef23d1c016..66ac0885df3e 100644
--- a/arch/arm/configs/ixdp2801_defconfig
+++ b/arch/arm/configs/ixdp2801_defconfig
@@ -560,7 +560,7 @@ CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768
560# 560#
561CONFIG_SERIAL_8250=y 561CONFIG_SERIAL_8250=y
562CONFIG_SERIAL_8250_CONSOLE=y 562CONFIG_SERIAL_8250_CONSOLE=y
563CONFIG_SERIAL_8250_NR_UARTS=2 563CONFIG_SERIAL_8250_NR_UARTS=3
564# CONFIG_SERIAL_8250_EXTENDED is not set 564# CONFIG_SERIAL_8250_EXTENDED is not set
565 565
566# 566#
diff --git a/arch/arm/configs/mp1000_defconfig b/arch/arm/configs/realview_defconfig
index d2cbc6fada1d..0485b2f1cc20 100644
--- a/arch/arm/configs/mp1000_defconfig
+++ b/arch/arm/configs/realview_defconfig
@@ -1,7 +1,7 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.14-rc1 3# Linux kernel version: 2.6.14-rc2
4# Fri Sep 16 15:48:13 2005 4# Thu Sep 29 14:50:10 2005
5# 5#
6CONFIG_ARM=y 6CONFIG_ARM=y
7CONFIG_MMU=y 7CONFIG_MMU=y
@@ -12,11 +12,9 @@ CONFIG_GENERIC_CALIBRATE_DELAY=y
12# 12#
13# Code maturity level options 13# Code maturity level options
14# 14#
15CONFIG_EXPERIMENTAL=y 15# CONFIG_EXPERIMENTAL is not set
16# CONFIG_CLEAN_COMPILE is not set 16CONFIG_CLEAN_COMPILE=y
17CONFIG_BROKEN=y
18CONFIG_BROKEN_ON_SMP=y 17CONFIG_BROKEN_ON_SMP=y
19CONFIG_LOCK_KERNEL=y
20CONFIG_INIT_ENV_ARG_LIMIT=32 18CONFIG_INIT_ENV_ARG_LIMIT=32
21 19
22# 20#
@@ -24,18 +22,16 @@ CONFIG_INIT_ENV_ARG_LIMIT=32
24# 22#
25CONFIG_LOCALVERSION="" 23CONFIG_LOCALVERSION=""
26CONFIG_LOCALVERSION_AUTO=y 24CONFIG_LOCALVERSION_AUTO=y
27CONFIG_SWAP=y 25# CONFIG_SWAP is not set
28CONFIG_SYSVIPC=y 26CONFIG_SYSVIPC=y
29# CONFIG_POSIX_MQUEUE is not set
30# CONFIG_BSD_PROCESS_ACCT is not set 27# CONFIG_BSD_PROCESS_ACCT is not set
31CONFIG_SYSCTL=y 28CONFIG_SYSCTL=y
32# CONFIG_AUDIT is not set 29# CONFIG_AUDIT is not set
33# CONFIG_HOTPLUG is not set 30CONFIG_HOTPLUG=y
34CONFIG_KOBJECT_UEVENT=y 31CONFIG_KOBJECT_UEVENT=y
35CONFIG_IKCONFIG=y 32# CONFIG_IKCONFIG is not set
36CONFIG_IKCONFIG_PROC=y
37CONFIG_INITRAMFS_SOURCE="" 33CONFIG_INITRAMFS_SOURCE=""
38CONFIG_EMBEDDED=y 34# CONFIG_EMBEDDED is not set
39CONFIG_KALLSYMS=y 35CONFIG_KALLSYMS=y
40# CONFIG_KALLSYMS_ALL is not set 36# CONFIG_KALLSYMS_ALL is not set
41# CONFIG_KALLSYMS_EXTRA_PASS is not set 37# CONFIG_KALLSYMS_EXTRA_PASS is not set
@@ -58,17 +54,15 @@ CONFIG_BASE_SMALL=0
58# 54#
59CONFIG_MODULES=y 55CONFIG_MODULES=y
60CONFIG_MODULE_UNLOAD=y 56CONFIG_MODULE_UNLOAD=y
61# CONFIG_MODULE_FORCE_UNLOAD is not set
62CONFIG_OBSOLETE_MODPARM=y 57CONFIG_OBSOLETE_MODPARM=y
63# CONFIG_MODVERSIONS is not set
64# CONFIG_MODULE_SRCVERSION_ALL is not set 58# CONFIG_MODULE_SRCVERSION_ALL is not set
65CONFIG_KMOD=y 59# CONFIG_KMOD is not set
66 60
67# 61#
68# System Type 62# System Type
69# 63#
70# CONFIG_ARCH_CLPS7500 is not set 64# CONFIG_ARCH_CLPS7500 is not set
71CONFIG_ARCH_CLPS711X=y 65# CONFIG_ARCH_CLPS711X is not set
72# CONFIG_ARCH_CO285 is not set 66# CONFIG_ARCH_CO285 is not set
73# CONFIG_ARCH_EBSA110 is not set 67# CONFIG_ARCH_EBSA110 is not set
74# CONFIG_ARCH_CAMELOT is not set 68# CONFIG_ARCH_CAMELOT is not set
@@ -86,43 +80,43 @@ CONFIG_ARCH_CLPS711X=y
86# CONFIG_ARCH_LH7A40X is not set 80# CONFIG_ARCH_LH7A40X is not set
87# CONFIG_ARCH_OMAP is not set 81# CONFIG_ARCH_OMAP is not set
88# CONFIG_ARCH_VERSATILE is not set 82# CONFIG_ARCH_VERSATILE is not set
83CONFIG_ARCH_REALVIEW=y
89# CONFIG_ARCH_IMX is not set 84# CONFIG_ARCH_IMX is not set
90# CONFIG_ARCH_H720X is not set 85# CONFIG_ARCH_H720X is not set
91# CONFIG_ARCH_AAEC2000 is not set 86# CONFIG_ARCH_AAEC2000 is not set
92 87
93# 88#
94# CLPS711X/EP721X Implementations 89# RealView platform type
95# 90#
96# CONFIG_ARCH_AUTCPU12 is not set 91CONFIG_MACH_REALVIEW_EB=y
97# CONFIG_ARCH_CDB89712 is not set
98# CONFIG_ARCH_CEIVA is not set
99# CONFIG_ARCH_CLEP7312 is not set
100# CONFIG_ARCH_EDB7211 is not set
101# CONFIG_ARCH_P720T is not set
102# CONFIG_ARCH_FORTUNET is not set
103CONFIG_MACH_MP1000=y
104CONFIG_MP1000_90MHZ=y
105 92
106# 93#
107# Processor Type 94# Processor Type
108# 95#
109CONFIG_CPU_32=y 96CONFIG_CPU_32=y
110CONFIG_CPU_ARM720T=y 97CONFIG_CPU_ARM926T=y
111CONFIG_CPU_32v4=y 98# CONFIG_CPU_V6 is not set
112CONFIG_CPU_ABRT_LV4T=y 99CONFIG_CPU_32v5=y
113CONFIG_CPU_CACHE_V4=y 100CONFIG_CPU_ABRT_EV5TJ=y
114CONFIG_CPU_CACHE_VIVT=y 101CONFIG_CPU_CACHE_VIVT=y
115CONFIG_CPU_COPY_V4WT=y 102CONFIG_CPU_COPY_V4WB=y
116CONFIG_CPU_TLB_V4WT=y 103CONFIG_CPU_TLB_V4WBI=y
117 104
118# 105#
119# Processor Features 106# Processor Features
120# 107#
121CONFIG_ARM_THUMB=y 108CONFIG_ARM_THUMB=y
109# CONFIG_CPU_ICACHE_DISABLE is not set
110# CONFIG_CPU_DCACHE_DISABLE is not set
111# CONFIG_CPU_DCACHE_WRITETHROUGH is not set
112# CONFIG_CPU_CACHE_ROUND_ROBIN is not set
113CONFIG_ARM_GIC=y
114CONFIG_ICST307=y
122 115
123# 116#
124# Bus support 117# Bus support
125# 118#
119CONFIG_ARM_AMBA=y
126CONFIG_ISA_DMA_API=y 120CONFIG_ISA_DMA_API=y
127 121
128# 122#
@@ -133,14 +127,8 @@ CONFIG_ISA_DMA_API=y
133# 127#
134# Kernel Features 128# Kernel Features
135# 129#
136# CONFIG_SMP is not set
137CONFIG_PREEMPT=y
138# CONFIG_NO_IDLE_HZ is not set 130# CONFIG_NO_IDLE_HZ is not set
139# CONFIG_ARCH_DISCONTIGMEM_ENABLE is not set 131# CONFIG_ARCH_DISCONTIGMEM_ENABLE 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 132CONFIG_FLATMEM=y
145CONFIG_FLAT_NODE_MEM_MAP=y 133CONFIG_FLAT_NODE_MEM_MAP=y
146# CONFIG_SPARSEMEM_STATIC is not set 134# CONFIG_SPARSEMEM_STATIC is not set
@@ -151,7 +139,7 @@ CONFIG_ALIGNMENT_TRAP=y
151# 139#
152CONFIG_ZBOOT_ROM_TEXT=0x0 140CONFIG_ZBOOT_ROM_TEXT=0x0
153CONFIG_ZBOOT_ROM_BSS=0x0 141CONFIG_ZBOOT_ROM_BSS=0x0
154CONFIG_CMDLINE="console=ttyCL,38400 root=/dev/discs/disc0/part1 ip=any cs89x0_media=rj45" 142CONFIG_CMDLINE="root=/dev/nfs nfsroot=10.1.69.3:/work/nfsroot ip=dhcp console=ttyAMA0 mem=128M"
155# CONFIG_XIP_KERNEL is not set 143# CONFIG_XIP_KERNEL is not set
156 144
157# 145#
@@ -163,14 +151,14 @@ CONFIG_CMDLINE="console=ttyCL,38400 root=/dev/discs/disc0/part1 ip=any cs89x0_me
163# 151#
164CONFIG_FPE_NWFPE=y 152CONFIG_FPE_NWFPE=y
165# CONFIG_FPE_NWFPE_XP is not set 153# CONFIG_FPE_NWFPE_XP is not set
166# CONFIG_FPE_FASTFPE is not set 154# CONFIG_VFP is not set
167 155
168# 156#
169# Userspace binary formats 157# Userspace binary formats
170# 158#
171CONFIG_BINFMT_ELF=y 159CONFIG_BINFMT_ELF=y
172# CONFIG_BINFMT_AOUT is not set 160# CONFIG_BINFMT_AOUT is not set
173CONFIG_BINFMT_MISC=y 161# CONFIG_BINFMT_MISC is not set
174# CONFIG_ARTHUR is not set 162# CONFIG_ARTHUR is not set
175 163
176# 164#
@@ -197,10 +185,9 @@ CONFIG_IP_FIB_HASH=y
197CONFIG_IP_PNP=y 185CONFIG_IP_PNP=y
198CONFIG_IP_PNP_DHCP=y 186CONFIG_IP_PNP_DHCP=y
199CONFIG_IP_PNP_BOOTP=y 187CONFIG_IP_PNP_BOOTP=y
200CONFIG_IP_PNP_RARP=y 188# CONFIG_IP_PNP_RARP is not set
201# CONFIG_NET_IPIP is not set 189# CONFIG_NET_IPIP is not set
202# CONFIG_NET_IPGRE is not set 190# CONFIG_NET_IPGRE is not set
203# CONFIG_ARPD is not set
204# CONFIG_SYN_COOKIES is not set 191# CONFIG_SYN_COOKIES is not set
205# CONFIG_INET_AH is not set 192# CONFIG_INET_AH is not set
206# CONFIG_INET_ESP is not set 193# CONFIG_INET_ESP is not set
@@ -210,36 +197,14 @@ CONFIG_INET_DIAG=y
210CONFIG_INET_TCP_DIAG=y 197CONFIG_INET_TCP_DIAG=y
211# CONFIG_TCP_CONG_ADVANCED is not set 198# CONFIG_TCP_CONG_ADVANCED is not set
212CONFIG_TCP_CONG_BIC=y 199CONFIG_TCP_CONG_BIC=y
213CONFIG_IPV6=y 200# CONFIG_IPV6 is not set
214# CONFIG_IPV6_PRIVACY is not set
215# CONFIG_INET6_AH is not set
216# CONFIG_INET6_ESP is not set
217# CONFIG_INET6_IPCOMP is not set
218# CONFIG_INET6_TUNNEL is not set
219# CONFIG_IPV6_TUNNEL is not set
220# CONFIG_NETFILTER is not set 201# CONFIG_NETFILTER is not set
221
222#
223# DCCP Configuration (EXPERIMENTAL)
224#
225# CONFIG_IP_DCCP is not set
226
227#
228# SCTP Configuration (EXPERIMENTAL)
229#
230# CONFIG_IP_SCTP is not set
231# CONFIG_ATM is not set
232# CONFIG_BRIDGE is not set 202# CONFIG_BRIDGE is not set
233# CONFIG_VLAN_8021Q is not set 203# CONFIG_VLAN_8021Q is not set
234# CONFIG_DECNET is not set 204# CONFIG_DECNET is not set
235# CONFIG_LLC2 is not set 205# CONFIG_LLC2 is not set
236# CONFIG_IPX is not set 206# CONFIG_IPX is not set
237# CONFIG_ATALK is not set 207# CONFIG_ATALK is not set
238# CONFIG_X25 is not set
239# CONFIG_LAPB is not set
240# CONFIG_NET_DIVERT is not set
241# CONFIG_ECONET is not set
242# CONFIG_WAN_ROUTER is not set
243# CONFIG_NET_SCHED is not set 208# CONFIG_NET_SCHED is not set
244# CONFIG_NET_CLS_ROUTE is not set 209# CONFIG_NET_CLS_ROUTE is not set
245 210
@@ -247,7 +212,6 @@ CONFIG_IPV6=y
247# Network testing 212# Network testing
248# 213#
249# CONFIG_NET_PKTGEN is not set 214# CONFIG_NET_PKTGEN is not set
250# CONFIG_NETFILTER_NETLINK is not set
251# CONFIG_HAMRADIO is not set 215# CONFIG_HAMRADIO is not set
252# CONFIG_IRDA is not set 216# CONFIG_IRDA is not set
253# CONFIG_BT is not set 217# CONFIG_BT is not set
@@ -269,14 +233,10 @@ CONFIG_PREVENT_FIRMWARE_BUILD=y
269# Memory Technology Devices (MTD) 233# Memory Technology Devices (MTD)
270# 234#
271CONFIG_MTD=y 235CONFIG_MTD=y
272CONFIG_MTD_DEBUG=y 236# CONFIG_MTD_DEBUG is not set
273CONFIG_MTD_DEBUG_VERBOSE=3
274# CONFIG_MTD_CONCAT is not set 237# CONFIG_MTD_CONCAT is not set
275CONFIG_MTD_PARTITIONS=y 238CONFIG_MTD_PARTITIONS=y
276CONFIG_MTD_REDBOOT_PARTS=m 239# CONFIG_MTD_REDBOOT_PARTS is not set
277CONFIG_MTD_REDBOOT_DIRECTORY_BLOCK=-2
278CONFIG_MTD_REDBOOT_PARTS_UNALLOCATED=y
279# CONFIG_MTD_REDBOOT_PARTS_READONLY is not set
280CONFIG_MTD_CMDLINE_PARTS=y 240CONFIG_MTD_CMDLINE_PARTS=y
281# CONFIG_MTD_AFS_PARTS is not set 241# CONFIG_MTD_AFS_PARTS is not set
282 242
@@ -292,45 +252,36 @@ CONFIG_MTD_BLOCK=y
292# 252#
293# RAM/ROM/Flash chip drivers 253# RAM/ROM/Flash chip drivers
294# 254#
295CONFIG_MTD_CFI=m 255CONFIG_MTD_CFI=y
296# CONFIG_MTD_JEDECPROBE is not set 256# CONFIG_MTD_JEDECPROBE is not set
297CONFIG_MTD_GEN_PROBE=m 257CONFIG_MTD_GEN_PROBE=y
298CONFIG_MTD_CFI_ADV_OPTIONS=y 258# CONFIG_MTD_CFI_ADV_OPTIONS is not set
299CONFIG_MTD_CFI_NOSWAP=y 259CONFIG_MTD_MAP_BANK_WIDTH_1=y
300# CONFIG_MTD_CFI_BE_BYTE_SWAP is not set 260CONFIG_MTD_MAP_BANK_WIDTH_2=y
301# CONFIG_MTD_CFI_LE_BYTE_SWAP is not set
302CONFIG_MTD_CFI_GEOMETRY=y
303# CONFIG_MTD_MAP_BANK_WIDTH_1 is not set
304# CONFIG_MTD_MAP_BANK_WIDTH_2 is not set
305CONFIG_MTD_MAP_BANK_WIDTH_4=y 261CONFIG_MTD_MAP_BANK_WIDTH_4=y
306# CONFIG_MTD_MAP_BANK_WIDTH_8 is not set 262# CONFIG_MTD_MAP_BANK_WIDTH_8 is not set
307# CONFIG_MTD_MAP_BANK_WIDTH_16 is not set 263# CONFIG_MTD_MAP_BANK_WIDTH_16 is not set
308# CONFIG_MTD_MAP_BANK_WIDTH_32 is not set 264# CONFIG_MTD_MAP_BANK_WIDTH_32 is not set
309# CONFIG_MTD_CFI_I1 is not set 265CONFIG_MTD_CFI_I1=y
310CONFIG_MTD_CFI_I2=y 266CONFIG_MTD_CFI_I2=y
311# CONFIG_MTD_CFI_I4 is not set 267# CONFIG_MTD_CFI_I4 is not set
312# CONFIG_MTD_CFI_I8 is not set 268# CONFIG_MTD_CFI_I8 is not set
313# CONFIG_MTD_OTP is not set 269CONFIG_MTD_CFI_INTELEXT=y
314CONFIG_MTD_CFI_INTELEXT=m 270CONFIG_MTD_CFI_AMDSTD=y
315# CONFIG_MTD_CFI_AMDSTD is not set 271CONFIG_MTD_CFI_AMDSTD_RETRY=0
316# CONFIG_MTD_CFI_STAA is not set 272# CONFIG_MTD_CFI_STAA is not set
317CONFIG_MTD_CFI_UTIL=m 273CONFIG_MTD_CFI_UTIL=y
318# CONFIG_MTD_RAM is not set 274# CONFIG_MTD_RAM is not set
319# CONFIG_MTD_ROM is not set 275# CONFIG_MTD_ROM is not set
320# CONFIG_MTD_ABSENT is not set 276# CONFIG_MTD_ABSENT is not set
321# CONFIG_MTD_OBSOLETE_CHIPS is not set
322# CONFIG_MTD_XIP is not set
323 277
324# 278#
325# Mapping drivers for chip access 279# Mapping drivers for chip access
326# 280#
327# CONFIG_MTD_COMPLEX_MAPPINGS is not set 281# CONFIG_MTD_COMPLEX_MAPPINGS is not set
328CONFIG_MTD_PHYSMAP=m 282# CONFIG_MTD_PHYSMAP is not set
329CONFIG_MTD_PHYSMAP_START=0x0000000 283CONFIG_MTD_ARM_INTEGRATOR=y
330CONFIG_MTD_PHYSMAP_LEN=0x4000000 284# CONFIG_MTD_EDB7312 is not set
331CONFIG_MTD_PHYSMAP_BANKWIDTH=2
332# CONFIG_MTD_ARM_INTEGRATOR is not set
333CONFIG_MTD_EDB7312=m
334# CONFIG_MTD_PLATRAM is not set 285# CONFIG_MTD_PLATRAM is not set
335 286
336# 287#
@@ -340,7 +291,6 @@ CONFIG_MTD_EDB7312=m
340# CONFIG_MTD_PHRAM is not set 291# CONFIG_MTD_PHRAM is not set
341# CONFIG_MTD_MTDRAM is not set 292# CONFIG_MTD_MTDRAM is not set
342# CONFIG_MTD_BLKMTD is not set 293# CONFIG_MTD_BLKMTD is not set
343# CONFIG_MTD_BLOCK2MTD is not set
344 294
345# 295#
346# Disk-On-Chip Device Drivers 296# Disk-On-Chip Device Drivers
@@ -352,12 +302,7 @@ CONFIG_MTD_EDB7312=m
352# 302#
353# NAND Flash Device Drivers 303# NAND Flash Device Drivers
354# 304#
355CONFIG_MTD_NAND=y 305# CONFIG_MTD_NAND is not set
356# CONFIG_MTD_NAND_VERIFY_WRITE is not set
357CONFIG_MTD_NAND_MP1000=y
358CONFIG_MTD_NAND_IDS=y
359# CONFIG_MTD_NAND_DISKONCHIP is not set
360# CONFIG_MTD_NAND_NANDSIM is not set
361 306
362# 307#
363# Parallel port support 308# Parallel port support
@@ -372,53 +317,22 @@ CONFIG_MTD_NAND_IDS=y
372# Block devices 317# Block devices
373# 318#
374# CONFIG_BLK_DEV_COW_COMMON is not set 319# CONFIG_BLK_DEV_COW_COMMON is not set
375CONFIG_BLK_DEV_LOOP=m 320# CONFIG_BLK_DEV_LOOP is not set
376# CONFIG_BLK_DEV_CRYPTOLOOP is not set
377# CONFIG_BLK_DEV_NBD is not set 321# CONFIG_BLK_DEV_NBD is not set
378CONFIG_BLK_DEV_RAM=y 322# CONFIG_BLK_DEV_RAM is not set
379CONFIG_BLK_DEV_RAM_COUNT=2 323CONFIG_BLK_DEV_RAM_COUNT=16
380CONFIG_BLK_DEV_RAM_SIZE=16384
381CONFIG_BLK_DEV_INITRD=y
382# CONFIG_CDROM_PKTCDVD is not set 324# CONFIG_CDROM_PKTCDVD is not set
383 325
384# 326#
385# IO Schedulers 327# IO Schedulers
386# 328#
387CONFIG_IOSCHED_NOOP=y 329CONFIG_IOSCHED_NOOP=y
388CONFIG_IOSCHED_AS=y 330# CONFIG_IOSCHED_AS is not set
389CONFIG_IOSCHED_DEADLINE=y 331CONFIG_IOSCHED_DEADLINE=y
390CONFIG_IOSCHED_CFQ=y 332# CONFIG_IOSCHED_CFQ is not set
391# CONFIG_ATA_OVER_ETH is not set 333# CONFIG_ATA_OVER_ETH is not set
392 334
393# 335#
394# ATA/ATAPI/MFM/RLL support
395#
396CONFIG_IDE=y
397CONFIG_BLK_DEV_IDE=y
398
399#
400# Please see Documentation/ide.txt for help/info on IDE drives
401#
402# CONFIG_BLK_DEV_IDE_SATA is not set
403# CONFIG_BLK_DEV_HD_IDE is not set
404CONFIG_BLK_DEV_IDEDISK=y
405# CONFIG_IDEDISK_MULTI_MODE is not set
406# CONFIG_BLK_DEV_IDECD is not set
407# CONFIG_BLK_DEV_IDETAPE is not set
408# CONFIG_BLK_DEV_IDEFLOPPY is not set
409# CONFIG_IDE_TASK_IOCTL is not set
410
411#
412# IDE chipset support/bugfixes
413#
414# CONFIG_IDE_GENERIC is not set
415CONFIG_IDE_ARM=y
416CONFIG_BLK_DEV_IDE_MP1000=y
417# CONFIG_BLK_DEV_IDEDMA is not set
418# CONFIG_IDEDMA_AUTO is not set
419# CONFIG_BLK_DEV_HD is not set
420
421#
422# SCSI device support 336# SCSI device support
423# 337#
424# CONFIG_RAID_ATTRS is not set 338# CONFIG_RAID_ATTRS is not set
@@ -427,14 +341,7 @@ CONFIG_BLK_DEV_IDE_MP1000=y
427# 341#
428# Multi-device support (RAID and LVM) 342# Multi-device support (RAID and LVM)
429# 343#
430CONFIG_MD=y 344# CONFIG_MD is not set
431# CONFIG_BLK_DEV_MD is not set
432CONFIG_BLK_DEV_DM=y
433# CONFIG_DM_CRYPT is not set
434# CONFIG_DM_SNAPSHOT is not set
435# CONFIG_DM_MIRROR is not set
436# CONFIG_DM_ZERO is not set
437# CONFIG_DM_MULTIPATH is not set
438 345
439# 346#
440# Fusion MPT device support 347# Fusion MPT device support
@@ -444,7 +351,6 @@ CONFIG_BLK_DEV_DM=y
444# 351#
445# IEEE 1394 (FireWire) support 352# IEEE 1394 (FireWire) support
446# 353#
447# CONFIG_IEEE1394 is not set
448 354
449# 355#
450# I2O device support 356# I2O device support
@@ -468,10 +374,9 @@ CONFIG_NETDEVICES=y
468# Ethernet (10 or 100Mbit) 374# Ethernet (10 or 100Mbit)
469# 375#
470CONFIG_NET_ETHERNET=y 376CONFIG_NET_ETHERNET=y
471# CONFIG_MII is not set 377CONFIG_MII=y
472# CONFIG_SMC91X is not set 378CONFIG_SMC91X=y
473# CONFIG_DM9000 is not set 379# CONFIG_DM9000 is not set
474CONFIG_CS89x0=y
475 380
476# 381#
477# Ethernet (1000 Mbit) 382# Ethernet (1000 Mbit)
@@ -496,8 +401,6 @@ CONFIG_CS89x0=y
496# CONFIG_WAN is not set 401# CONFIG_WAN is not set
497# CONFIG_PPP is not set 402# CONFIG_PPP is not set
498# CONFIG_SLIP is not set 403# CONFIG_SLIP is not set
499# CONFIG_SHAPER is not set
500# CONFIG_NETCONSOLE is not set
501# CONFIG_NETPOLL is not set 404# CONFIG_NETPOLL is not set
502# CONFIG_NET_POLL_CONTROLLER is not set 405# CONFIG_NET_POLL_CONTROLLER is not set
503 406
@@ -514,17 +417,28 @@ CONFIG_INPUT=y
514# 417#
515# Userland interfaces 418# Userland interfaces
516# 419#
517# CONFIG_INPUT_MOUSEDEV is not set 420CONFIG_INPUT_MOUSEDEV=y
421CONFIG_INPUT_MOUSEDEV_PSAUX=y
422CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024
423CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768
518# CONFIG_INPUT_JOYDEV is not set 424# CONFIG_INPUT_JOYDEV is not set
519# CONFIG_INPUT_TSDEV is not set 425# CONFIG_INPUT_TSDEV is not set
520# CONFIG_INPUT_EVDEV is not set 426# CONFIG_INPUT_EVDEV is not set
521CONFIG_INPUT_EVBUG=y 427# CONFIG_INPUT_EVBUG is not set
522 428
523# 429#
524# Input Device Drivers 430# Input Device Drivers
525# 431#
526# CONFIG_INPUT_KEYBOARD is not set 432CONFIG_INPUT_KEYBOARD=y
527# CONFIG_INPUT_MOUSE is not set 433CONFIG_KEYBOARD_ATKBD=y
434# CONFIG_KEYBOARD_SUNKBD is not set
435# CONFIG_KEYBOARD_LKKBD is not set
436# CONFIG_KEYBOARD_XTKBD is not set
437# CONFIG_KEYBOARD_NEWTON is not set
438CONFIG_INPUT_MOUSE=y
439CONFIG_MOUSE_PS2=y
440# CONFIG_MOUSE_SERIAL is not set
441# CONFIG_MOUSE_VSXXXAA is not set
528# CONFIG_INPUT_JOYSTICK is not set 442# CONFIG_INPUT_JOYSTICK is not set
529# CONFIG_INPUT_TOUCHSCREEN is not set 443# CONFIG_INPUT_TOUCHSCREEN is not set
530# CONFIG_INPUT_MISC is not set 444# CONFIG_INPUT_MISC is not set
@@ -533,8 +447,9 @@ CONFIG_INPUT_EVBUG=y
533# Hardware I/O ports 447# Hardware I/O ports
534# 448#
535CONFIG_SERIO=y 449CONFIG_SERIO=y
536CONFIG_SERIO_SERPORT=y 450# CONFIG_SERIO_SERPORT is not set
537# CONFIG_SERIO_LIBPS2 is not set 451CONFIG_SERIO_AMBAKMI=y
452CONFIG_SERIO_LIBPS2=y
538# CONFIG_SERIO_RAW is not set 453# CONFIG_SERIO_RAW is not set
539# CONFIG_GAMEPORT is not set 454# CONFIG_GAMEPORT is not set
540 455
@@ -549,21 +464,19 @@ CONFIG_HW_CONSOLE=y
549# 464#
550# Serial drivers 465# Serial drivers
551# 466#
552CONFIG_SERIAL_8250=y 467# CONFIG_SERIAL_8250 is not set
553CONFIG_SERIAL_8250_CONSOLE=y
554CONFIG_SERIAL_8250_NR_UARTS=2
555# CONFIG_SERIAL_8250_EXTENDED is not set
556 468
557# 469#
558# Non-8250 serial port support 470# Non-8250 serial port support
559# 471#
560CONFIG_SERIAL_CLPS711X=y 472# CONFIG_SERIAL_AMBA_PL010 is not set
561CONFIG_SERIAL_CLPS711X_CONSOLE=y 473CONFIG_SERIAL_AMBA_PL011=y
474CONFIG_SERIAL_AMBA_PL011_CONSOLE=y
562CONFIG_SERIAL_CORE=y 475CONFIG_SERIAL_CORE=y
563CONFIG_SERIAL_CORE_CONSOLE=y 476CONFIG_SERIAL_CORE_CONSOLE=y
564CONFIG_UNIX98_PTYS=y 477CONFIG_UNIX98_PTYS=y
565CONFIG_LEGACY_PTYS=y 478CONFIG_LEGACY_PTYS=y
566CONFIG_LEGACY_PTY_COUNT=256 479CONFIG_LEGACY_PTY_COUNT=16
567 480
568# 481#
569# IPMI 482# IPMI
@@ -574,8 +487,8 @@ CONFIG_LEGACY_PTY_COUNT=256
574# Watchdog Cards 487# Watchdog Cards
575# 488#
576# CONFIG_WATCHDOG is not set 489# CONFIG_WATCHDOG is not set
577CONFIG_NVRAM=y 490# CONFIG_NVRAM is not set
578CONFIG_RTC=y 491# CONFIG_RTC is not set
579# CONFIG_DTLK is not set 492# CONFIG_DTLK is not set
580# CONFIG_R3964 is not set 493# CONFIG_R3964 is not set
581 494
@@ -596,9 +509,8 @@ CONFIG_RTC=y
596# 509#
597# Hardware Monitoring support 510# Hardware Monitoring support
598# 511#
599CONFIG_HWMON=y 512# CONFIG_HWMON is not set
600# CONFIG_HWMON_VID is not set 513# CONFIG_HWMON_VID is not set
601# CONFIG_HWMON_DEBUG_CHIP is not set
602 514
603# 515#
604# Misc devices 516# Misc devices
@@ -621,18 +533,72 @@ CONFIG_HWMON=y
621# 533#
622# Graphics support 534# Graphics support
623# 535#
624# CONFIG_FB is not set 536CONFIG_FB=y
537CONFIG_FB_CFB_FILLRECT=y
538CONFIG_FB_CFB_COPYAREA=y
539CONFIG_FB_CFB_IMAGEBLIT=y
540CONFIG_FB_SOFT_CURSOR=y
541# CONFIG_FB_MACMODES is not set
542# CONFIG_FB_MODE_HELPERS is not set
543# CONFIG_FB_TILEBLITTING is not set
544CONFIG_FB_ARMCLCD=y
545# CONFIG_FB_S1D13XXX is not set
546# CONFIG_FB_VIRTUAL is not set
625 547
626# 548#
627# Console display driver support 549# Console display driver support
628# 550#
629# CONFIG_VGA_CONSOLE is not set 551# CONFIG_VGA_CONSOLE is not set
630CONFIG_DUMMY_CONSOLE=y 552CONFIG_DUMMY_CONSOLE=y
553CONFIG_FRAMEBUFFER_CONSOLE=y
554# CONFIG_FONTS is not set
555CONFIG_FONT_8x8=y
556CONFIG_FONT_8x16=y
557
558#
559# Logo configuration
560#
561CONFIG_LOGO=y
562# CONFIG_LOGO_LINUX_MONO is not set
563# CONFIG_LOGO_LINUX_VGA16 is not set
564CONFIG_LOGO_LINUX_CLUT224=y
565# CONFIG_BACKLIGHT_LCD_SUPPORT is not set
631 566
632# 567#
633# Sound 568# Sound
634# 569#
635# CONFIG_SOUND is not set 570CONFIG_SOUND=y
571
572#
573# Advanced Linux Sound Architecture
574#
575CONFIG_SND=y
576CONFIG_SND_TIMER=y
577CONFIG_SND_PCM=y
578# CONFIG_SND_SEQUENCER is not set
579CONFIG_SND_OSSEMUL=y
580CONFIG_SND_MIXER_OSS=y
581CONFIG_SND_PCM_OSS=y
582# CONFIG_SND_VERBOSE_PRINTK is not set
583# CONFIG_SND_DEBUG is not set
584
585#
586# Generic devices
587#
588# CONFIG_SND_DUMMY is not set
589# CONFIG_SND_MTPAV is not set
590# CONFIG_SND_SERIAL_U16550 is not set
591# CONFIG_SND_MPU401 is not set
592
593#
594# ALSA ARM devices
595#
596# CONFIG_SND_ARMAACI is not set
597
598#
599# Open Sound System
600#
601# CONFIG_SOUND_PRIME is not set
636 602
637# 603#
638# USB support 604# USB support
@@ -654,32 +620,17 @@ CONFIG_USB_ARCH_HAS_HCD=y
654# 620#
655# File systems 621# File systems
656# 622#
657CONFIG_EXT2_FS=y 623# CONFIG_EXT2_FS is not set
658CONFIG_EXT2_FS_XATTR=y 624# CONFIG_EXT3_FS is not set
659# CONFIG_EXT2_FS_POSIX_ACL is not set 625# CONFIG_JBD is not set
660# CONFIG_EXT2_FS_SECURITY is not set 626# CONFIG_REISERFS_FS is not set
661# CONFIG_EXT2_FS_XIP is not set
662CONFIG_EXT3_FS=y
663CONFIG_EXT3_FS_XATTR=y
664# CONFIG_EXT3_FS_POSIX_ACL is not set
665# CONFIG_EXT3_FS_SECURITY is not set
666CONFIG_JBD=y
667# CONFIG_JBD_DEBUG is not set
668CONFIG_FS_MBCACHE=y
669CONFIG_REISERFS_FS=m
670# CONFIG_REISERFS_CHECK is not set
671# CONFIG_REISERFS_PROC_INFO is not set
672# CONFIG_REISERFS_FS_XATTR is not set
673# CONFIG_JFS_FS is not set 627# CONFIG_JFS_FS is not set
674CONFIG_FS_POSIX_ACL=y 628# CONFIG_FS_POSIX_ACL is not set
675# CONFIG_XFS_FS is not set 629# CONFIG_XFS_FS is not set
676# CONFIG_MINIX_FS is not set 630# CONFIG_MINIX_FS is not set
677# CONFIG_ROMFS_FS is not set 631# CONFIG_ROMFS_FS is not set
678CONFIG_INOTIFY=y 632CONFIG_INOTIFY=y
679CONFIG_QUOTA=y 633# CONFIG_QUOTA is not set
680# CONFIG_QFMT_V1 is not set
681# CONFIG_QFMT_V2 is not set
682CONFIG_QUOTACTL=y
683CONFIG_DNOTIFY=y 634CONFIG_DNOTIFY=y
684# CONFIG_AUTOFS_FS is not set 635# CONFIG_AUTOFS_FS is not set
685# CONFIG_AUTOFS4_FS is not set 636# CONFIG_AUTOFS4_FS is not set
@@ -694,8 +645,11 @@ CONFIG_DNOTIFY=y
694# 645#
695# DOS/FAT/NT Filesystems 646# DOS/FAT/NT Filesystems
696# 647#
648CONFIG_FAT_FS=y
697# CONFIG_MSDOS_FS is not set 649# CONFIG_MSDOS_FS is not set
698# CONFIG_VFAT_FS is not set 650CONFIG_VFAT_FS=y
651CONFIG_FAT_DEFAULT_CODEPAGE=437
652CONFIG_FAT_DEFAULT_IOCHARSET="iso8859-1"
699# CONFIG_NTFS_FS is not set 653# CONFIG_NTFS_FS is not set
700 654
701# 655#
@@ -704,7 +658,6 @@ CONFIG_DNOTIFY=y
704CONFIG_PROC_FS=y 658CONFIG_PROC_FS=y
705CONFIG_SYSFS=y 659CONFIG_SYSFS=y
706CONFIG_TMPFS=y 660CONFIG_TMPFS=y
707# CONFIG_HUGETLBFS is not set
708# CONFIG_HUGETLB_PAGE is not set 661# CONFIG_HUGETLB_PAGE is not set
709CONFIG_RAMFS=y 662CONFIG_RAMFS=y
710# CONFIG_RELAYFS_FS is not set 663# CONFIG_RELAYFS_FS is not set
@@ -712,22 +665,10 @@ CONFIG_RAMFS=y
712# 665#
713# Miscellaneous filesystems 666# Miscellaneous filesystems
714# 667#
715# CONFIG_ADFS_FS is not set
716# CONFIG_AFFS_FS is not set
717# CONFIG_HFS_FS is not set
718# CONFIG_HFSPLUS_FS is not set 668# CONFIG_HFSPLUS_FS is not set
719# CONFIG_BEFS_FS is not set
720# CONFIG_BFS_FS is not set
721# CONFIG_EFS_FS is not set
722# CONFIG_JFFS_FS is not set 669# CONFIG_JFFS_FS is not set
723CONFIG_JFFS2_FS=m 670# CONFIG_JFFS2_FS is not set
724CONFIG_JFFS2_FS_DEBUG=0 671CONFIG_CRAMFS=y
725CONFIG_JFFS2_FS_WRITEBUFFER=y
726# CONFIG_JFFS2_COMPRESSION_OPTIONS is not set
727CONFIG_JFFS2_ZLIB=y
728CONFIG_JFFS2_RTIME=y
729# CONFIG_JFFS2_RUBIN is not set
730CONFIG_CRAMFS=m
731# CONFIG_VXFS_FS is not set 672# CONFIG_VXFS_FS is not set
732# CONFIG_HPFS_FS is not set 673# CONFIG_HPFS_FS is not set
733# CONFIG_QNX4FS_FS is not set 674# CONFIG_QNX4FS_FS is not set
@@ -740,32 +681,16 @@ CONFIG_CRAMFS=m
740CONFIG_NFS_FS=y 681CONFIG_NFS_FS=y
741CONFIG_NFS_V3=y 682CONFIG_NFS_V3=y
742# CONFIG_NFS_V3_ACL is not set 683# CONFIG_NFS_V3_ACL is not set
743CONFIG_NFS_V4=y 684# CONFIG_NFSD is not set
744# CONFIG_NFS_DIRECTIO is not set
745CONFIG_NFSD=y
746CONFIG_NFSD_V3=y
747# CONFIG_NFSD_V3_ACL is not set
748CONFIG_NFSD_V4=y
749CONFIG_NFSD_TCP=y
750CONFIG_ROOT_NFS=y 685CONFIG_ROOT_NFS=y
751CONFIG_LOCKD=y 686CONFIG_LOCKD=y
752CONFIG_LOCKD_V4=y 687CONFIG_LOCKD_V4=y
753CONFIG_EXPORTFS=y
754CONFIG_NFS_COMMON=y 688CONFIG_NFS_COMMON=y
755CONFIG_SUNRPC=y 689CONFIG_SUNRPC=y
756CONFIG_SUNRPC_GSS=y 690# CONFIG_SMB_FS is not set
757CONFIG_RPCSEC_GSS_KRB5=y 691# CONFIG_CIFS is not set
758# CONFIG_RPCSEC_GSS_SPKM3 is not set
759CONFIG_SMB_FS=m
760# CONFIG_SMB_NLS_DEFAULT is not set
761CONFIG_CIFS=m
762# CONFIG_CIFS_STATS is not set
763# CONFIG_CIFS_XATTR is not set
764# CONFIG_CIFS_EXPERIMENTAL is not set
765# CONFIG_NCP_FS is not set 692# CONFIG_NCP_FS is not set
766# CONFIG_CODA_FS is not set 693# CONFIG_CODA_FS is not set
767# CONFIG_AFS_FS is not set
768# CONFIG_9P_FS is not set
769 694
770# 695#
771# Partition Types 696# Partition Types
@@ -802,7 +727,7 @@ CONFIG_NLS_CODEPAGE_437=y
802# CONFIG_NLS_CODEPAGE_1250 is not set 727# CONFIG_NLS_CODEPAGE_1250 is not set
803# CONFIG_NLS_CODEPAGE_1251 is not set 728# CONFIG_NLS_CODEPAGE_1251 is not set
804# CONFIG_NLS_ASCII is not set 729# CONFIG_NLS_ASCII is not set
805# CONFIG_NLS_ISO8859_1 is not set 730CONFIG_NLS_ISO8859_1=y
806# CONFIG_NLS_ISO8859_2 is not set 731# CONFIG_NLS_ISO8859_2 is not set
807# CONFIG_NLS_ISO8859_3 is not set 732# CONFIG_NLS_ISO8859_3 is not set
808# CONFIG_NLS_ISO8859_4 is not set 733# CONFIG_NLS_ISO8859_4 is not set
@@ -818,34 +743,26 @@ CONFIG_NLS_CODEPAGE_437=y
818# CONFIG_NLS_UTF8 is not set 743# CONFIG_NLS_UTF8 is not set
819 744
820# 745#
821# Profiling support
822#
823# CONFIG_PROFILING is not set
824
825#
826# Kernel hacking 746# Kernel hacking
827# 747#
828CONFIG_PRINTK_TIME=y 748# CONFIG_PRINTK_TIME is not set
829CONFIG_DEBUG_KERNEL=y 749CONFIG_DEBUG_KERNEL=y
830# CONFIG_MAGIC_SYSRQ is not set 750CONFIG_MAGIC_SYSRQ=y
831CONFIG_LOG_BUF_SHIFT=14 751CONFIG_LOG_BUF_SHIFT=14
832CONFIG_DETECT_SOFTLOCKUP=y 752CONFIG_DETECT_SOFTLOCKUP=y
833# CONFIG_SCHEDSTATS is not set 753# CONFIG_SCHEDSTATS is not set
834# CONFIG_DEBUG_SLAB is not set 754# CONFIG_DEBUG_SLAB is not set
835CONFIG_DEBUG_PREEMPT=y
836# CONFIG_DEBUG_SPINLOCK is not set 755# CONFIG_DEBUG_SPINLOCK is not set
837# CONFIG_DEBUG_SPINLOCK_SLEEP is not set 756# CONFIG_DEBUG_SPINLOCK_SLEEP is not set
838# CONFIG_DEBUG_KOBJECT is not set 757# CONFIG_DEBUG_KOBJECT is not set
839# CONFIG_DEBUG_BUGVERBOSE is not set 758CONFIG_DEBUG_BUGVERBOSE=y
840CONFIG_DEBUG_INFO=y 759# CONFIG_DEBUG_INFO is not set
841# CONFIG_DEBUG_FS is not set 760# CONFIG_DEBUG_FS is not set
842CONFIG_FRAME_POINTER=y 761CONFIG_FRAME_POINTER=y
843CONFIG_DEBUG_USER=y 762CONFIG_DEBUG_USER=y
844CONFIG_DEBUG_WAITQ=y 763# CONFIG_DEBUG_WAITQ is not set
845CONFIG_DEBUG_ERRORS=y 764CONFIG_DEBUG_ERRORS=y
846CONFIG_DEBUG_LL=y 765# CONFIG_DEBUG_LL is not set
847# CONFIG_DEBUG_ICEDCC is not set
848# CONFIG_DEBUG_CLPS711X_UART2 is not set
849 766
850# 767#
851# Security options 768# Security options
@@ -856,31 +773,7 @@ CONFIG_DEBUG_LL=y
856# 773#
857# Cryptographic options 774# Cryptographic options
858# 775#
859CONFIG_CRYPTO=y 776# CONFIG_CRYPTO is not set
860# CONFIG_CRYPTO_HMAC is not set
861# CONFIG_CRYPTO_NULL is not set
862# CONFIG_CRYPTO_MD4 is not set
863CONFIG_CRYPTO_MD5=y
864# CONFIG_CRYPTO_SHA1 is not set
865# CONFIG_CRYPTO_SHA256 is not set
866# CONFIG_CRYPTO_SHA512 is not set
867# CONFIG_CRYPTO_WP512 is not set
868# CONFIG_CRYPTO_TGR192 is not set
869CONFIG_CRYPTO_DES=y
870# CONFIG_CRYPTO_BLOWFISH is not set
871# CONFIG_CRYPTO_TWOFISH is not set
872# CONFIG_CRYPTO_SERPENT is not set
873# CONFIG_CRYPTO_AES is not set
874# CONFIG_CRYPTO_CAST5 is not set
875# CONFIG_CRYPTO_CAST6 is not set
876# CONFIG_CRYPTO_TEA is not set
877# CONFIG_CRYPTO_ARC4 is not set
878# CONFIG_CRYPTO_KHAZAD is not set
879# CONFIG_CRYPTO_ANUBIS is not set
880# CONFIG_CRYPTO_DEFLATE is not set
881# CONFIG_CRYPTO_MICHAEL_MIC is not set
882# CONFIG_CRYPTO_CRC32C is not set
883# CONFIG_CRYPTO_TEST is not set
884 777
885# 778#
886# Hardware crypto devices 779# Hardware crypto devices
@@ -893,5 +786,4 @@ CONFIG_CRYPTO_DES=y
893# CONFIG_CRC16 is not set 786# CONFIG_CRC16 is not set
894CONFIG_CRC32=y 787CONFIG_CRC32=y
895# CONFIG_LIBCRC32C is not set 788# CONFIG_LIBCRC32C is not set
896CONFIG_ZLIB_INFLATE=m 789CONFIG_ZLIB_INFLATE=y
897CONFIG_ZLIB_DEFLATE=m
diff --git a/arch/arm/kernel/armksyms.c b/arch/arm/kernel/armksyms.c
index 7b17a87a3311..7a3261f0bf79 100644
--- a/arch/arm/kernel/armksyms.c
+++ b/arch/arm/kernel/armksyms.c
@@ -9,6 +9,7 @@
9 */ 9 */
10#include <linux/module.h> 10#include <linux/module.h>
11#include <linux/string.h> 11#include <linux/string.h>
12#include <linux/cryptohash.h>
12#include <linux/delay.h> 13#include <linux/delay.h>
13#include <linux/in6.h> 14#include <linux/in6.h>
14#include <linux/syscalls.h> 15#include <linux/syscalls.h>
@@ -126,6 +127,9 @@ EXPORT_SYMBOL(__put_user_2);
126EXPORT_SYMBOL(__put_user_4); 127EXPORT_SYMBOL(__put_user_4);
127EXPORT_SYMBOL(__put_user_8); 128EXPORT_SYMBOL(__put_user_8);
128 129
130 /* crypto hash */
131EXPORT_SYMBOL(sha_transform);
132
129 /* gcc lib functions */ 133 /* gcc lib functions */
130EXPORT_SYMBOL(__ashldi3); 134EXPORT_SYMBOL(__ashldi3);
131EXPORT_SYMBOL(__ashrdi3); 135EXPORT_SYMBOL(__ashrdi3);
diff --git a/arch/arm/kernel/entry-armv.S b/arch/arm/kernel/entry-armv.S
index be439cab92c6..d9fb819bf7cc 100644
--- a/arch/arm/kernel/entry-armv.S
+++ b/arch/arm/kernel/entry-armv.S
@@ -47,6 +47,13 @@
47 movne r0, sp 47 movne r0, sp
48 adrne lr, 1b 48 adrne lr, 1b
49 bne do_IPI 49 bne do_IPI
50
51#ifdef CONFIG_LOCAL_TIMERS
52 test_for_ltirq r0, r6, r5, lr
53 movne r0, sp
54 adrne lr, 1b
55 bne do_local_timer
56#endif
50#endif 57#endif
51 58
52 .endm 59 .endm
@@ -785,7 +792,7 @@ __kuser_helper_end:
785 * SP points to a minimal amount of processor-private memory, the address 792 * SP points to a minimal amount of processor-private memory, the address
786 * of which is copied into r0 for the mode specific abort handler. 793 * of which is copied into r0 for the mode specific abort handler.
787 */ 794 */
788 .macro vector_stub, name, correction=0 795 .macro vector_stub, name, mode, correction=0
789 .align 5 796 .align 5
790 797
791vector_\name: 798vector_\name:
@@ -805,15 +812,14 @@ vector_\name:
805 @ Prepare for SVC32 mode. IRQs remain disabled. 812 @ Prepare for SVC32 mode. IRQs remain disabled.
806 @ 813 @
807 mrs r0, cpsr 814 mrs r0, cpsr
808 bic r0, r0, #MODE_MASK 815 eor r0, r0, #(\mode ^ SVC_MODE)
809 orr r0, r0, #SVC_MODE
810 msr spsr_cxsf, r0 816 msr spsr_cxsf, r0
811 817
812 @ 818 @
813 @ the branch table must immediately follow this code 819 @ the branch table must immediately follow this code
814 @ 820 @
815 mov r0, sp
816 and lr, lr, #0x0f 821 and lr, lr, #0x0f
822 mov r0, sp
817 ldr lr, [pc, lr, lsl #2] 823 ldr lr, [pc, lr, lsl #2]
818 movs pc, lr @ branch to handler in SVC mode 824 movs pc, lr @ branch to handler in SVC mode
819 .endm 825 .endm
@@ -823,7 +829,7 @@ __stubs_start:
823/* 829/*
824 * Interrupt dispatcher 830 * Interrupt dispatcher
825 */ 831 */
826 vector_stub irq, 4 832 vector_stub irq, IRQ_MODE, 4
827 833
828 .long __irq_usr @ 0 (USR_26 / USR_32) 834 .long __irq_usr @ 0 (USR_26 / USR_32)
829 .long __irq_invalid @ 1 (FIQ_26 / FIQ_32) 835 .long __irq_invalid @ 1 (FIQ_26 / FIQ_32)
@@ -846,7 +852,7 @@ __stubs_start:
846 * Data abort dispatcher 852 * Data abort dispatcher
847 * Enter in ABT mode, spsr = USR CPSR, lr = USR PC 853 * Enter in ABT mode, spsr = USR CPSR, lr = USR PC
848 */ 854 */
849 vector_stub dabt, 8 855 vector_stub dabt, ABT_MODE, 8
850 856
851 .long __dabt_usr @ 0 (USR_26 / USR_32) 857 .long __dabt_usr @ 0 (USR_26 / USR_32)
852 .long __dabt_invalid @ 1 (FIQ_26 / FIQ_32) 858 .long __dabt_invalid @ 1 (FIQ_26 / FIQ_32)
@@ -869,7 +875,7 @@ __stubs_start:
869 * Prefetch abort dispatcher 875 * Prefetch abort dispatcher
870 * Enter in ABT mode, spsr = USR CPSR, lr = USR PC 876 * Enter in ABT mode, spsr = USR CPSR, lr = USR PC
871 */ 877 */
872 vector_stub pabt, 4 878 vector_stub pabt, ABT_MODE, 4
873 879
874 .long __pabt_usr @ 0 (USR_26 / USR_32) 880 .long __pabt_usr @ 0 (USR_26 / USR_32)
875 .long __pabt_invalid @ 1 (FIQ_26 / FIQ_32) 881 .long __pabt_invalid @ 1 (FIQ_26 / FIQ_32)
@@ -892,7 +898,7 @@ __stubs_start:
892 * Undef instr entry dispatcher 898 * Undef instr entry dispatcher
893 * Enter in UND mode, spsr = SVC/USR CPSR, lr = SVC/USR PC 899 * Enter in UND mode, spsr = SVC/USR CPSR, lr = SVC/USR PC
894 */ 900 */
895 vector_stub und 901 vector_stub und, UND_MODE
896 902
897 .long __und_usr @ 0 (USR_26 / USR_32) 903 .long __und_usr @ 0 (USR_26 / USR_32)
898 .long __und_invalid @ 1 (FIQ_26 / FIQ_32) 904 .long __und_invalid @ 1 (FIQ_26 / FIQ_32)
diff --git a/arch/arm/kernel/irq.c b/arch/arm/kernel/irq.c
index 3284118f356b..d7099dbbb879 100644
--- a/arch/arm/kernel/irq.c
+++ b/arch/arm/kernel/irq.c
@@ -264,6 +264,7 @@ unlock:
264#endif 264#endif
265#ifdef CONFIG_SMP 265#ifdef CONFIG_SMP
266 show_ipi_list(p); 266 show_ipi_list(p);
267 show_local_irqs(p);
267#endif 268#endif
268 seq_printf(p, "Err: %10lu\n", irq_err_count); 269 seq_printf(p, "Err: %10lu\n", irq_err_count);
269 } 270 }
@@ -995,7 +996,7 @@ void __init init_irq_proc(void)
995 struct proc_dir_entry *dir; 996 struct proc_dir_entry *dir;
996 int irq; 997 int irq;
997 998
998 dir = proc_mkdir("irq", 0); 999 dir = proc_mkdir("irq", NULL);
999 if (!dir) 1000 if (!dir)
1000 return; 1001 return;
1001 1002
@@ -1050,3 +1051,34 @@ static int __init noirqdebug_setup(char *str)
1050} 1051}
1051 1052
1052__setup("noirqdebug", noirqdebug_setup); 1053__setup("noirqdebug", noirqdebug_setup);
1054
1055#ifdef CONFIG_HOTPLUG_CPU
1056/*
1057 * The CPU has been marked offline. Migrate IRQs off this CPU. If
1058 * the affinity settings do not allow other CPUs, force them onto any
1059 * available CPU.
1060 */
1061void migrate_irqs(void)
1062{
1063 unsigned int i, cpu = smp_processor_id();
1064
1065 for (i = 0; i < NR_IRQS; i++) {
1066 struct irqdesc *desc = irq_desc + i;
1067
1068 if (desc->cpu == cpu) {
1069 unsigned int newcpu = any_online_cpu(desc->affinity);
1070
1071 if (newcpu == NR_CPUS) {
1072 if (printk_ratelimit())
1073 printk(KERN_INFO "IRQ%u no longer affine to CPU%u\n",
1074 i, cpu);
1075
1076 cpus_setall(desc->affinity);
1077 newcpu = any_online_cpu(desc->affinity);
1078 }
1079
1080 route_irq(desc, i, newcpu);
1081 }
1082 }
1083}
1084#endif /* CONFIG_HOTPLUG_CPU */
diff --git a/arch/arm/kernel/process.c b/arch/arm/kernel/process.c
index 409db6d5ec99..30494aab829a 100644
--- a/arch/arm/kernel/process.c
+++ b/arch/arm/kernel/process.c
@@ -26,6 +26,7 @@
26#include <linux/interrupt.h> 26#include <linux/interrupt.h>
27#include <linux/kallsyms.h> 27#include <linux/kallsyms.h>
28#include <linux/init.h> 28#include <linux/init.h>
29#include <linux/cpu.h>
29 30
30#include <asm/system.h> 31#include <asm/system.h>
31#include <asm/io.h> 32#include <asm/io.h>
@@ -85,12 +86,16 @@ EXPORT_SYMBOL(pm_power_off);
85 */ 86 */
86void default_idle(void) 87void default_idle(void)
87{ 88{
88 local_irq_disable(); 89 if (hlt_counter)
89 if (!need_resched() && !hlt_counter) { 90 cpu_relax();
90 timer_dyn_reprogram(); 91 else {
91 arch_idle(); 92 local_irq_disable();
93 if (!need_resched()) {
94 timer_dyn_reprogram();
95 arch_idle();
96 }
97 local_irq_enable();
92 } 98 }
93 local_irq_enable();
94} 99}
95 100
96/* 101/*
@@ -105,15 +110,23 @@ void cpu_idle(void)
105 /* endless idle loop with no priority at all */ 110 /* endless idle loop with no priority at all */
106 while (1) { 111 while (1) {
107 void (*idle)(void) = pm_idle; 112 void (*idle)(void) = pm_idle;
113
114#ifdef CONFIG_HOTPLUG_CPU
115 if (cpu_is_offline(smp_processor_id())) {
116 leds_event(led_idle_start);
117 cpu_die();
118 }
119#endif
120
108 if (!idle) 121 if (!idle)
109 idle = default_idle; 122 idle = default_idle;
110 preempt_disable();
111 leds_event(led_idle_start); 123 leds_event(led_idle_start);
112 while (!need_resched()) 124 while (!need_resched())
113 idle(); 125 idle();
114 leds_event(led_idle_end); 126 leds_event(led_idle_end);
115 preempt_enable(); 127 preempt_enable_no_resched();
116 schedule(); 128 schedule();
129 preempt_disable();
117 } 130 }
118} 131}
119 132
@@ -346,7 +359,7 @@ copy_thread(int nr, unsigned long clone_flags, unsigned long stack_start,
346 struct thread_info *thread = p->thread_info; 359 struct thread_info *thread = p->thread_info;
347 struct pt_regs *childregs; 360 struct pt_regs *childregs;
348 361
349 childregs = ((struct pt_regs *)((unsigned long)thread + THREAD_START_SP)) - 1; 362 childregs = (void *)thread + THREAD_START_SP - sizeof(*regs);
350 *childregs = *regs; 363 *childregs = *regs;
351 childregs->ARM_r0 = 0; 364 childregs->ARM_r0 = 0;
352 childregs->ARM_sp = stack_start; 365 childregs->ARM_sp = stack_start;
diff --git a/arch/arm/kernel/ptrace.c b/arch/arm/kernel/ptrace.c
index 9bd8609a2926..9a340e790da5 100644
--- a/arch/arm/kernel/ptrace.c
+++ b/arch/arm/kernel/ptrace.c
@@ -648,7 +648,7 @@ static int ptrace_setwmmxregs(struct task_struct *tsk, void __user *ufp)
648 648
649#endif 649#endif
650 650
651static int do_ptrace(int request, struct task_struct *child, long addr, long data) 651long arch_ptrace(struct task_struct *child, long request, long addr, long data)
652{ 652{
653 unsigned long tmp; 653 unsigned long tmp;
654 int ret; 654 int ret;
@@ -782,53 +782,6 @@ static int do_ptrace(int request, struct task_struct *child, long addr, long dat
782 return ret; 782 return ret;
783} 783}
784 784
785asmlinkage long sys_ptrace(long request, long pid, long addr, long data)
786{
787 struct task_struct *child;
788 int ret;
789
790 lock_kernel();
791 ret = -EPERM;
792 if (request == PTRACE_TRACEME) {
793 /* are we already being traced? */
794 if (current->ptrace & PT_PTRACED)
795 goto out;
796 ret = security_ptrace(current->parent, current);
797 if (ret)
798 goto out;
799 /* set the ptrace bit in the process flags. */
800 current->ptrace |= PT_PTRACED;
801 ret = 0;
802 goto out;
803 }
804 ret = -ESRCH;
805 read_lock(&tasklist_lock);
806 child = find_task_by_pid(pid);
807 if (child)
808 get_task_struct(child);
809 read_unlock(&tasklist_lock);
810 if (!child)
811 goto out;
812
813 ret = -EPERM;
814 if (pid == 1) /* you may not mess with init */
815 goto out_tsk;
816
817 if (request == PTRACE_ATTACH) {
818 ret = ptrace_attach(child);
819 goto out_tsk;
820 }
821 ret = ptrace_check_attach(child, request == PTRACE_KILL);
822 if (ret == 0)
823 ret = do_ptrace(request, child, addr, data);
824
825out_tsk:
826 put_task_struct(child);
827out:
828 unlock_kernel();
829 return ret;
830}
831
832asmlinkage void syscall_trace(int why, struct pt_regs *regs) 785asmlinkage void syscall_trace(int why, struct pt_regs *regs)
833{ 786{
834 unsigned long ip; 787 unsigned long ip;
diff --git a/arch/arm/kernel/setup.c b/arch/arm/kernel/setup.c
index c9b69771f92e..85774165e9fd 100644
--- a/arch/arm/kernel/setup.c
+++ b/arch/arm/kernel/setup.c
@@ -338,7 +338,8 @@ void cpu_init(void)
338 BUG(); 338 BUG();
339 } 339 }
340 340
341 dump_cpu_info(cpu); 341 if (system_state == SYSTEM_BOOTING)
342 dump_cpu_info(cpu);
342 343
343 /* 344 /*
344 * setup stacks for re-entrant exception handlers 345 * setup stacks for re-entrant exception handlers
@@ -838,7 +839,12 @@ static int c_show(struct seq_file *m, void *v)
838 839
839#if defined(CONFIG_SMP) 840#if defined(CONFIG_SMP)
840 for_each_online_cpu(i) { 841 for_each_online_cpu(i) {
841 seq_printf(m, "Processor\t: %d\n", i); 842 /*
843 * glibc reads /proc/cpuinfo to determine the number of
844 * online processors, looking for lines beginning with
845 * "processor". Give glibc what it expects.
846 */
847 seq_printf(m, "processor\t: %d\n", i);
842 seq_printf(m, "BogoMIPS\t: %lu.%02lu\n\n", 848 seq_printf(m, "BogoMIPS\t: %lu.%02lu\n\n",
843 per_cpu(cpu_data, i).loops_per_jiffy / (500000UL/HZ), 849 per_cpu(cpu_data, i).loops_per_jiffy / (500000UL/HZ),
844 (per_cpu(cpu_data, i).loops_per_jiffy / (5000UL/HZ)) % 100); 850 (per_cpu(cpu_data, i).loops_per_jiffy / (5000UL/HZ)) % 100);
diff --git a/arch/arm/kernel/smp.c b/arch/arm/kernel/smp.c
index 826164945747..e55ea952f7aa 100644
--- a/arch/arm/kernel/smp.c
+++ b/arch/arm/kernel/smp.c
@@ -80,19 +80,23 @@ static DEFINE_SPINLOCK(smp_call_function_lock);
80 80
81int __cpuinit __cpu_up(unsigned int cpu) 81int __cpuinit __cpu_up(unsigned int cpu)
82{ 82{
83 struct task_struct *idle; 83 struct cpuinfo_arm *ci = &per_cpu(cpu_data, cpu);
84 struct task_struct *idle = ci->idle;
84 pgd_t *pgd; 85 pgd_t *pgd;
85 pmd_t *pmd; 86 pmd_t *pmd;
86 int ret; 87 int ret;
87 88
88 /* 89 /*
89 * Spawn a new process manually. Grab a pointer to 90 * Spawn a new process manually, if not already done.
90 * its task struct so we can mess with it 91 * Grab a pointer to its task struct so we can mess with it
91 */ 92 */
92 idle = fork_idle(cpu); 93 if (!idle) {
93 if (IS_ERR(idle)) { 94 idle = fork_idle(cpu);
94 printk(KERN_ERR "CPU%u: fork() failed\n", cpu); 95 if (IS_ERR(idle)) {
95 return PTR_ERR(idle); 96 printk(KERN_ERR "CPU%u: fork() failed\n", cpu);
97 return PTR_ERR(idle);
98 }
99 ci->idle = idle;
96 } 100 }
97 101
98 /* 102 /*
@@ -138,7 +142,7 @@ int __cpuinit __cpu_up(unsigned int cpu)
138 ret = -EIO; 142 ret = -EIO;
139 } 143 }
140 144
141 secondary_data.stack = 0; 145 secondary_data.stack = NULL;
142 secondary_data.pgdir = 0; 146 secondary_data.pgdir = 0;
143 147
144 *pmd_offset(pgd, PHYS_OFFSET) = __pmd(0); 148 *pmd_offset(pgd, PHYS_OFFSET) = __pmd(0);
@@ -155,6 +159,96 @@ int __cpuinit __cpu_up(unsigned int cpu)
155 return ret; 159 return ret;
156} 160}
157 161
162#ifdef CONFIG_HOTPLUG_CPU
163/*
164 * __cpu_disable runs on the processor to be shutdown.
165 */
166int __cpuexit __cpu_disable(void)
167{
168 unsigned int cpu = smp_processor_id();
169 struct task_struct *p;
170 int ret;
171
172 ret = mach_cpu_disable(cpu);
173 if (ret)
174 return ret;
175
176 /*
177 * Take this CPU offline. Once we clear this, we can't return,
178 * and we must not schedule until we're ready to give up the cpu.
179 */
180 cpu_clear(cpu, cpu_online_map);
181
182 /*
183 * OK - migrate IRQs away from this CPU
184 */
185 migrate_irqs();
186
187 /*
188 * Stop the local timer for this CPU.
189 */
190 local_timer_stop(cpu);
191
192 /*
193 * Flush user cache and TLB mappings, and then remove this CPU
194 * from the vm mask set of all processes.
195 */
196 flush_cache_all();
197 local_flush_tlb_all();
198
199 read_lock(&tasklist_lock);
200 for_each_process(p) {
201 if (p->mm)
202 cpu_clear(cpu, p->mm->cpu_vm_mask);
203 }
204 read_unlock(&tasklist_lock);
205
206 return 0;
207}
208
209/*
210 * called on the thread which is asking for a CPU to be shutdown -
211 * waits until shutdown has completed, or it is timed out.
212 */
213void __cpuexit __cpu_die(unsigned int cpu)
214{
215 if (!platform_cpu_kill(cpu))
216 printk("CPU%u: unable to kill\n", cpu);
217}
218
219/*
220 * Called from the idle thread for the CPU which has been shutdown.
221 *
222 * Note that we disable IRQs here, but do not re-enable them
223 * before returning to the caller. This is also the behaviour
224 * of the other hotplug-cpu capable cores, so presumably coming
225 * out of idle fixes this.
226 */
227void __cpuexit cpu_die(void)
228{
229 unsigned int cpu = smp_processor_id();
230
231 local_irq_disable();
232 idle_task_exit();
233
234 /*
235 * actual CPU shutdown procedure is at least platform (if not
236 * CPU) specific
237 */
238 platform_cpu_die(cpu);
239
240 /*
241 * Do not return to the idle loop - jump back to the secondary
242 * cpu initialisation. There's some initialisation which needs
243 * to be repeated to undo the effects of taking the CPU offline.
244 */
245 __asm__("mov sp, %0\n"
246 " b secondary_start_kernel"
247 :
248 : "r" ((void *)current->thread_info + THREAD_SIZE - 8));
249}
250#endif /* CONFIG_HOTPLUG_CPU */
251
158/* 252/*
159 * This is the secondary CPU boot entry. We're using this CPUs 253 * This is the secondary CPU boot entry. We're using this CPUs
160 * idle thread stack, but a set of temporary page tables. 254 * idle thread stack, but a set of temporary page tables.
@@ -162,7 +256,9 @@ int __cpuinit __cpu_up(unsigned int cpu)
162asmlinkage void __cpuinit secondary_start_kernel(void) 256asmlinkage void __cpuinit secondary_start_kernel(void)
163{ 257{
164 struct mm_struct *mm = &init_mm; 258 struct mm_struct *mm = &init_mm;
165 unsigned int cpu = smp_processor_id(); 259 unsigned int cpu;
260
261 cpu = smp_processor_id();
166 262
167 printk("CPU%u: Booted secondary processor\n", cpu); 263 printk("CPU%u: Booted secondary processor\n", cpu);
168 264
@@ -179,6 +275,7 @@ asmlinkage void __cpuinit secondary_start_kernel(void)
179 local_flush_tlb_all(); 275 local_flush_tlb_all();
180 276
181 cpu_init(); 277 cpu_init();
278 preempt_disable();
182 279
183 /* 280 /*
184 * Give the platform a chance to do its own initialisation. 281 * Give the platform a chance to do its own initialisation.
@@ -201,6 +298,11 @@ asmlinkage void __cpuinit secondary_start_kernel(void)
201 cpu_set(cpu, cpu_online_map); 298 cpu_set(cpu, cpu_online_map);
202 299
203 /* 300 /*
301 * Setup local timer for this CPU.
302 */
303 local_timer_setup(cpu);
304
305 /*
204 * OK, it's off to the idle thread for us 306 * OK, it's off to the idle thread for us
205 */ 307 */
206 cpu_idle(); 308 cpu_idle();
@@ -236,6 +338,8 @@ void __init smp_prepare_boot_cpu(void)
236{ 338{
237 unsigned int cpu = smp_processor_id(); 339 unsigned int cpu = smp_processor_id();
238 340
341 per_cpu(cpu_data, cpu).idle = current;
342
239 cpu_set(cpu, cpu_possible_map); 343 cpu_set(cpu, cpu_possible_map);
240 cpu_set(cpu, cpu_present_map); 344 cpu_set(cpu, cpu_present_map);
241 cpu_set(cpu, cpu_online_map); 345 cpu_set(cpu, cpu_online_map);
@@ -268,8 +372,8 @@ static void send_ipi_message(cpumask_t callmap, enum ipi_msg_type msg)
268 * You must not call this function with disabled interrupts, from a 372 * You must not call this function with disabled interrupts, from a
269 * hardware interrupt handler, nor from a bottom half handler. 373 * hardware interrupt handler, nor from a bottom half handler.
270 */ 374 */
271int smp_call_function_on_cpu(void (*func)(void *info), void *info, int retry, 375static int smp_call_function_on_cpu(void (*func)(void *info), void *info,
272 int wait, cpumask_t callmap) 376 int retry, int wait, cpumask_t callmap)
273{ 377{
274 struct smp_call_struct data; 378 struct smp_call_struct data;
275 unsigned long timeout; 379 unsigned long timeout;
@@ -309,8 +413,8 @@ int smp_call_function_on_cpu(void (*func)(void *info), void *info, int retry,
309 printk(KERN_CRIT 413 printk(KERN_CRIT
310 "CPU%u: smp_call_function timeout for %p(%p)\n" 414 "CPU%u: smp_call_function timeout for %p(%p)\n"
311 " callmap %lx pending %lx, %swait\n", 415 " callmap %lx pending %lx, %swait\n",
312 smp_processor_id(), func, info, callmap, data.pending, 416 smp_processor_id(), func, info, *cpus_addr(callmap),
313 wait ? "" : "no "); 417 *cpus_addr(data.pending), wait ? "" : "no ");
314 418
315 /* 419 /*
316 * TRACE 420 * TRACE
@@ -363,6 +467,18 @@ void show_ipi_list(struct seq_file *p)
363 seq_putc(p, '\n'); 467 seq_putc(p, '\n');
364} 468}
365 469
470void show_local_irqs(struct seq_file *p)
471{
472 unsigned int cpu;
473
474 seq_printf(p, "LOC: ");
475
476 for_each_present_cpu(cpu)
477 seq_printf(p, "%10u ", irq_stat[cpu].local_timer_irqs);
478
479 seq_putc(p, '\n');
480}
481
366static void ipi_timer(struct pt_regs *regs) 482static void ipi_timer(struct pt_regs *regs)
367{ 483{
368 int user = user_mode(regs); 484 int user = user_mode(regs);
@@ -373,6 +489,18 @@ static void ipi_timer(struct pt_regs *regs)
373 irq_exit(); 489 irq_exit();
374} 490}
375 491
492#ifdef CONFIG_LOCAL_TIMERS
493asmlinkage void do_local_timer(struct pt_regs *regs)
494{
495 int cpu = smp_processor_id();
496
497 if (local_timer_ack()) {
498 irq_stat[cpu].local_timer_irqs++;
499 ipi_timer(regs);
500 }
501}
502#endif
503
376/* 504/*
377 * ipi_call_function - handle IPI from smp_call_function() 505 * ipi_call_function - handle IPI from smp_call_function()
378 * 506 *
@@ -424,7 +552,7 @@ static void ipi_cpu_stop(unsigned int cpu)
424 * 552 *
425 * Bit 0 - Inter-processor function call 553 * Bit 0 - Inter-processor function call
426 */ 554 */
427void do_IPI(struct pt_regs *regs) 555asmlinkage void do_IPI(struct pt_regs *regs)
428{ 556{
429 unsigned int cpu = smp_processor_id(); 557 unsigned int cpu = smp_processor_id();
430 struct ipi_data *ipi = &per_cpu(ipi_data, cpu); 558 struct ipi_data *ipi = &per_cpu(ipi_data, cpu);
diff --git a/arch/arm/lib/bitops.h b/arch/arm/lib/bitops.h
index 64a988c1ad44..b8c14e936697 100644
--- a/arch/arm/lib/bitops.h
+++ b/arch/arm/lib/bitops.h
@@ -1,6 +1,6 @@
1#include <linux/config.h> 1#include <linux/config.h>
2 2
3#if __LINUX_ARM_ARCH__ >= 6 && defined(CONFIG_CPU_MPCORE) 3#if __LINUX_ARM_ARCH__ >= 6 && defined(CONFIG_CPU_32v6K)
4 .macro bitop, instr 4 .macro bitop, instr
5 mov r2, #1 5 mov r2, #1
6 and r3, r0, #7 @ Get bit offset 6 and r3, r0, #7 @ Get bit offset
@@ -34,7 +34,7 @@
34 and r2, r0, #7 34 and r2, r0, #7
35 mov r3, #1 35 mov r3, #1
36 mov r3, r3, lsl r2 36 mov r3, r3, lsl r2
37 save_and_disable_irqs ip, r2 37 save_and_disable_irqs ip
38 ldrb r2, [r1, r0, lsr #3] 38 ldrb r2, [r1, r0, lsr #3]
39 \instr r2, r2, r3 39 \instr r2, r2, r3
40 strb r2, [r1, r0, lsr #3] 40 strb r2, [r1, r0, lsr #3]
@@ -54,7 +54,7 @@
54 add r1, r1, r0, lsr #3 54 add r1, r1, r0, lsr #3
55 and r3, r0, #7 55 and r3, r0, #7
56 mov r0, #1 56 mov r0, #1
57 save_and_disable_irqs ip, r2 57 save_and_disable_irqs ip
58 ldrb r2, [r1] 58 ldrb r2, [r1]
59 tst r2, r0, lsl r3 59 tst r2, r0, lsl r3
60 \instr r2, r2, r0, lsl r3 60 \instr r2, r2, r0, lsl r3
diff --git a/arch/arm/lib/uaccess.S b/arch/arm/lib/uaccess.S
index c28449157bea..6f1b5b49fe4c 100644
--- a/arch/arm/lib/uaccess.S
+++ b/arch/arm/lib/uaccess.S
@@ -43,8 +43,6 @@ ENTRY(__arch_copy_to_user)
43 stmfd sp!, {r2, r4 - r7, lr} 43 stmfd sp!, {r2, r4 - r7, lr}
44 cmp r2, #4 44 cmp r2, #4
45 blt .c2u_not_enough 45 blt .c2u_not_enough
46 PLD( pld [r1, #0] )
47 PLD( pld [r0, #0] )
48 ands ip, r0, #3 46 ands ip, r0, #3
49 bne .c2u_dest_not_aligned 47 bne .c2u_dest_not_aligned
50.c2u_dest_aligned: 48.c2u_dest_aligned:
@@ -73,25 +71,13 @@ USER( strt r3, [r0], #4) @ May fault
73 sub r2, r2, ip 71 sub r2, r2, ip
74 subs ip, ip, #32 72 subs ip, ip, #32
75 blt .c2u_0rem8lp 73 blt .c2u_0rem8lp
76 PLD( pld [r1, #28] ) 74
77 PLD( pld [r0, #28] ) 75.c2u_0cpy8lp: ldmia r1!, {r3 - r6}
78 PLD( subs ip, ip, #64 )
79 PLD( blt .c2u_0cpynopld )
80 PLD( pld [r1, #60] )
81 PLD( pld [r0, #60] )
82
83.c2u_0cpy8lp:
84 PLD( pld [r1, #92] )
85 PLD( pld [r0, #92] )
86.c2u_0cpynopld: ldmia r1!, {r3 - r6}
87 stmia r0!, {r3 - r6} @ Shouldnt fault 76 stmia r0!, {r3 - r6} @ Shouldnt fault
88 ldmia r1!, {r3 - r6} 77 ldmia r1!, {r3 - r6}
89 subs ip, ip, #32 78 subs ip, ip, #32
90 stmia r0!, {r3 - r6} @ Shouldnt fault 79 stmia r0!, {r3 - r6} @ Shouldnt fault
91 bpl .c2u_0cpy8lp 80 bpl .c2u_0cpy8lp
92 PLD( cmn ip, #64 )
93 PLD( bge .c2u_0cpynopld )
94 PLD( add ip, ip, #64 )
95 81
96.c2u_0rem8lp: cmn ip, #16 82.c2u_0rem8lp: cmn ip, #16
97 ldmgeia r1!, {r3 - r6} 83 ldmgeia r1!, {r3 - r6}
@@ -143,17 +129,8 @@ USER( strt r3, [r0], #4) @ May fault
143 sub r2, r2, ip 129 sub r2, r2, ip
144 subs ip, ip, #16 130 subs ip, ip, #16
145 blt .c2u_1rem8lp 131 blt .c2u_1rem8lp
146 PLD( pld [r1, #12] ) 132
147 PLD( pld [r0, #12] ) 133.c2u_1cpy8lp: mov r3, r7, pull #8
148 PLD( subs ip, ip, #32 )
149 PLD( blt .c2u_1cpynopld )
150 PLD( pld [r1, #28] )
151 PLD( pld [r0, #28] )
152
153.c2u_1cpy8lp:
154 PLD( pld [r1, #44] )
155 PLD( pld [r0, #44] )
156.c2u_1cpynopld: mov r3, r7, pull #8
157 ldmia r1!, {r4 - r7} 134 ldmia r1!, {r4 - r7}
158 subs ip, ip, #16 135 subs ip, ip, #16
159 orr r3, r3, r4, push #24 136 orr r3, r3, r4, push #24
@@ -165,9 +142,6 @@ USER( strt r3, [r0], #4) @ May fault
165 orr r6, r6, r7, push #24 142 orr r6, r6, r7, push #24
166 stmia r0!, {r3 - r6} @ Shouldnt fault 143 stmia r0!, {r3 - r6} @ Shouldnt fault
167 bpl .c2u_1cpy8lp 144 bpl .c2u_1cpy8lp
168 PLD( cmn ip, #32 )
169 PLD( bge .c2u_1cpynopld )
170 PLD( add ip, ip, #32 )
171 145
172.c2u_1rem8lp: tst ip, #8 146.c2u_1rem8lp: tst ip, #8
173 movne r3, r7, pull #8 147 movne r3, r7, pull #8
@@ -210,17 +184,8 @@ USER( strt r3, [r0], #4) @ May fault
210 sub r2, r2, ip 184 sub r2, r2, ip
211 subs ip, ip, #16 185 subs ip, ip, #16
212 blt .c2u_2rem8lp 186 blt .c2u_2rem8lp
213 PLD( pld [r1, #12] ) 187
214 PLD( pld [r0, #12] ) 188.c2u_2cpy8lp: mov r3, r7, pull #16
215 PLD( subs ip, ip, #32 )
216 PLD( blt .c2u_2cpynopld )
217 PLD( pld [r1, #28] )
218 PLD( pld [r0, #28] )
219
220.c2u_2cpy8lp:
221 PLD( pld [r1, #44] )
222 PLD( pld [r0, #44] )
223.c2u_2cpynopld: mov r3, r7, pull #16
224 ldmia r1!, {r4 - r7} 189 ldmia r1!, {r4 - r7}
225 subs ip, ip, #16 190 subs ip, ip, #16
226 orr r3, r3, r4, push #16 191 orr r3, r3, r4, push #16
@@ -232,9 +197,6 @@ USER( strt r3, [r0], #4) @ May fault
232 orr r6, r6, r7, push #16 197 orr r6, r6, r7, push #16
233 stmia r0!, {r3 - r6} @ Shouldnt fault 198 stmia r0!, {r3 - r6} @ Shouldnt fault
234 bpl .c2u_2cpy8lp 199 bpl .c2u_2cpy8lp
235 PLD( cmn ip, #32 )
236 PLD( bge .c2u_2cpynopld )
237 PLD( add ip, ip, #32 )
238 200
239.c2u_2rem8lp: tst ip, #8 201.c2u_2rem8lp: tst ip, #8
240 movne r3, r7, pull #16 202 movne r3, r7, pull #16
@@ -277,17 +239,8 @@ USER( strt r3, [r0], #4) @ May fault
277 sub r2, r2, ip 239 sub r2, r2, ip
278 subs ip, ip, #16 240 subs ip, ip, #16
279 blt .c2u_3rem8lp 241 blt .c2u_3rem8lp
280 PLD( pld [r1, #12] ) 242
281 PLD( pld [r0, #12] ) 243.c2u_3cpy8lp: mov r3, r7, pull #24
282 PLD( subs ip, ip, #32 )
283 PLD( blt .c2u_3cpynopld )
284 PLD( pld [r1, #28] )
285 PLD( pld [r0, #28] )
286
287.c2u_3cpy8lp:
288 PLD( pld [r1, #44] )
289 PLD( pld [r0, #44] )
290.c2u_3cpynopld: mov r3, r7, pull #24
291 ldmia r1!, {r4 - r7} 244 ldmia r1!, {r4 - r7}
292 subs ip, ip, #16 245 subs ip, ip, #16
293 orr r3, r3, r4, push #8 246 orr r3, r3, r4, push #8
@@ -299,9 +252,6 @@ USER( strt r3, [r0], #4) @ May fault
299 orr r6, r6, r7, push #8 252 orr r6, r6, r7, push #8
300 stmia r0!, {r3 - r6} @ Shouldnt fault 253 stmia r0!, {r3 - r6} @ Shouldnt fault
301 bpl .c2u_3cpy8lp 254 bpl .c2u_3cpy8lp
302 PLD( cmn ip, #32 )
303 PLD( bge .c2u_3cpynopld )
304 PLD( add ip, ip, #32 )
305 255
306.c2u_3rem8lp: tst ip, #8 256.c2u_3rem8lp: tst ip, #8
307 movne r3, r7, pull #24 257 movne r3, r7, pull #24
@@ -356,8 +306,6 @@ ENTRY(__arch_copy_from_user)
356 stmfd sp!, {r0, r2, r4 - r7, lr} 306 stmfd sp!, {r0, r2, r4 - r7, lr}
357 cmp r2, #4 307 cmp r2, #4
358 blt .cfu_not_enough 308 blt .cfu_not_enough
359 PLD( pld [r1, #0] )
360 PLD( pld [r0, #0] )
361 ands ip, r0, #3 309 ands ip, r0, #3
362 bne .cfu_dest_not_aligned 310 bne .cfu_dest_not_aligned
363.cfu_dest_aligned: 311.cfu_dest_aligned:
@@ -385,25 +333,13 @@ USER( ldrt r3, [r1], #4)
385 sub r2, r2, ip 333 sub r2, r2, ip
386 subs ip, ip, #32 334 subs ip, ip, #32
387 blt .cfu_0rem8lp 335 blt .cfu_0rem8lp
388 PLD( pld [r1, #28] ) 336
389 PLD( pld [r0, #28] ) 337.cfu_0cpy8lp: ldmia r1!, {r3 - r6} @ Shouldnt fault
390 PLD( subs ip, ip, #64 )
391 PLD( blt .cfu_0cpynopld )
392 PLD( pld [r1, #60] )
393 PLD( pld [r0, #60] )
394
395.cfu_0cpy8lp:
396 PLD( pld [r1, #92] )
397 PLD( pld [r0, #92] )
398.cfu_0cpynopld: ldmia r1!, {r3 - r6} @ Shouldnt fault
399 stmia r0!, {r3 - r6} 338 stmia r0!, {r3 - r6}
400 ldmia r1!, {r3 - r6} @ Shouldnt fault 339 ldmia r1!, {r3 - r6} @ Shouldnt fault
401 subs ip, ip, #32 340 subs ip, ip, #32
402 stmia r0!, {r3 - r6} 341 stmia r0!, {r3 - r6}
403 bpl .cfu_0cpy8lp 342 bpl .cfu_0cpy8lp
404 PLD( cmn ip, #64 )
405 PLD( bge .cfu_0cpynopld )
406 PLD( add ip, ip, #64 )
407 343
408.cfu_0rem8lp: cmn ip, #16 344.cfu_0rem8lp: cmn ip, #16
409 ldmgeia r1!, {r3 - r6} @ Shouldnt fault 345 ldmgeia r1!, {r3 - r6} @ Shouldnt fault
@@ -456,17 +392,8 @@ USER( ldrt r7, [r1], #4) @ May fault
456 sub r2, r2, ip 392 sub r2, r2, ip
457 subs ip, ip, #16 393 subs ip, ip, #16
458 blt .cfu_1rem8lp 394 blt .cfu_1rem8lp
459 PLD( pld [r1, #12] ) 395
460 PLD( pld [r0, #12] ) 396.cfu_1cpy8lp: mov r3, r7, pull #8
461 PLD( subs ip, ip, #32 )
462 PLD( blt .cfu_1cpynopld )
463 PLD( pld [r1, #28] )
464 PLD( pld [r0, #28] )
465
466.cfu_1cpy8lp:
467 PLD( pld [r1, #44] )
468 PLD( pld [r0, #44] )
469.cfu_1cpynopld: mov r3, r7, pull #8
470 ldmia r1!, {r4 - r7} @ Shouldnt fault 397 ldmia r1!, {r4 - r7} @ Shouldnt fault
471 subs ip, ip, #16 398 subs ip, ip, #16
472 orr r3, r3, r4, push #24 399 orr r3, r3, r4, push #24
@@ -478,9 +405,6 @@ USER( ldrt r7, [r1], #4) @ May fault
478 orr r6, r6, r7, push #24 405 orr r6, r6, r7, push #24
479 stmia r0!, {r3 - r6} 406 stmia r0!, {r3 - r6}
480 bpl .cfu_1cpy8lp 407 bpl .cfu_1cpy8lp
481 PLD( cmn ip, #32 )
482 PLD( bge .cfu_1cpynopld )
483 PLD( add ip, ip, #32 )
484 408
485.cfu_1rem8lp: tst ip, #8 409.cfu_1rem8lp: tst ip, #8
486 movne r3, r7, pull #8 410 movne r3, r7, pull #8
@@ -523,17 +447,8 @@ USER( ldrt r7, [r1], #4) @ May fault
523 sub r2, r2, ip 447 sub r2, r2, ip
524 subs ip, ip, #16 448 subs ip, ip, #16
525 blt .cfu_2rem8lp 449 blt .cfu_2rem8lp
526 PLD( pld [r1, #12] ) 450
527 PLD( pld [r0, #12] ) 451.cfu_2cpy8lp: mov r3, r7, pull #16
528 PLD( subs ip, ip, #32 )
529 PLD( blt .cfu_2cpynopld )
530 PLD( pld [r1, #28] )
531 PLD( pld [r0, #28] )
532
533.cfu_2cpy8lp:
534 PLD( pld [r1, #44] )
535 PLD( pld [r0, #44] )
536.cfu_2cpynopld: mov r3, r7, pull #16
537 ldmia r1!, {r4 - r7} @ Shouldnt fault 452 ldmia r1!, {r4 - r7} @ Shouldnt fault
538 subs ip, ip, #16 453 subs ip, ip, #16
539 orr r3, r3, r4, push #16 454 orr r3, r3, r4, push #16
@@ -545,9 +460,6 @@ USER( ldrt r7, [r1], #4) @ May fault
545 orr r6, r6, r7, push #16 460 orr r6, r6, r7, push #16
546 stmia r0!, {r3 - r6} 461 stmia r0!, {r3 - r6}
547 bpl .cfu_2cpy8lp 462 bpl .cfu_2cpy8lp
548 PLD( cmn ip, #32 )
549 PLD( bge .cfu_2cpynopld )
550 PLD( add ip, ip, #32 )
551 463
552.cfu_2rem8lp: tst ip, #8 464.cfu_2rem8lp: tst ip, #8
553 movne r3, r7, pull #16 465 movne r3, r7, pull #16
@@ -590,17 +502,8 @@ USER( ldrt r7, [r1], #4) @ May fault
590 sub r2, r2, ip 502 sub r2, r2, ip
591 subs ip, ip, #16 503 subs ip, ip, #16
592 blt .cfu_3rem8lp 504 blt .cfu_3rem8lp
593 PLD( pld [r1, #12] ) 505
594 PLD( pld [r0, #12] ) 506.cfu_3cpy8lp: mov r3, r7, pull #24
595 PLD( subs ip, ip, #32 )
596 PLD( blt .cfu_3cpynopld )
597 PLD( pld [r1, #28] )
598 PLD( pld [r0, #28] )
599
600.cfu_3cpy8lp:
601 PLD( pld [r1, #44] )
602 PLD( pld [r0, #44] )
603.cfu_3cpynopld: mov r3, r7, pull #24
604 ldmia r1!, {r4 - r7} @ Shouldnt fault 507 ldmia r1!, {r4 - r7} @ Shouldnt fault
605 orr r3, r3, r4, push #8 508 orr r3, r3, r4, push #8
606 mov r4, r4, pull #24 509 mov r4, r4, pull #24
@@ -612,9 +515,6 @@ USER( ldrt r7, [r1], #4) @ May fault
612 stmia r0!, {r3 - r6} 515 stmia r0!, {r3 - r6}
613 subs ip, ip, #16 516 subs ip, ip, #16
614 bpl .cfu_3cpy8lp 517 bpl .cfu_3cpy8lp
615 PLD( cmn ip, #32 )
616 PLD( bge .cfu_3cpynopld )
617 PLD( add ip, ip, #32 )
618 518
619.cfu_3rem8lp: tst ip, #8 519.cfu_3rem8lp: tst ip, #8
620 movne r3, r7, pull #24 520 movne r3, r7, pull #24
diff --git a/arch/arm/mach-aaec2000/clock.c b/arch/arm/mach-aaec2000/clock.c
index 99e019169dda..0340ddc4824e 100644
--- a/arch/arm/mach-aaec2000/clock.c
+++ b/arch/arm/mach-aaec2000/clock.c
@@ -14,6 +14,7 @@
14#include <linux/list.h> 14#include <linux/list.h>
15#include <linux/errno.h> 15#include <linux/errno.h>
16#include <linux/err.h> 16#include <linux/err.h>
17#include <linux/string.h>
17 18
18#include <asm/semaphore.h> 19#include <asm/semaphore.h>
19#include <asm/hardware/clock.h> 20#include <asm/hardware/clock.h>
diff --git a/arch/arm/mach-clps711x/Kconfig b/arch/arm/mach-clps711x/Kconfig
index d5c155045762..0793dcf54f2e 100644
--- a/arch/arm/mach-clps711x/Kconfig
+++ b/arch/arm/mach-clps711x/Kconfig
@@ -69,17 +69,6 @@ config EP72XX_ROM_BOOT
69 69
70 You almost surely want to say N here. 70 You almost surely want to say N here.
71 71
72config MACH_MP1000
73 bool "MACH_MP1000"
74 help
75 Say Y if you intend to run the kernel on the Comdial MP1000 platform.
76
77config MP1000_90MHZ
78 bool "MP1000_90MHZ"
79 depends on MACH_MP1000
80 help
81 Say Y if you have the MP1000 configured to be set at 90MHZ rather than 74MHZ
82
83endmenu 72endmenu
84 73
85endif 74endif
diff --git a/arch/arm/mach-clps711x/Makefile b/arch/arm/mach-clps711x/Makefile
index 8a6dc1ccf8fe..4a197315f0cf 100644
--- a/arch/arm/mach-clps711x/Makefile
+++ b/arch/arm/mach-clps711x/Makefile
@@ -15,7 +15,6 @@ obj-$(CONFIG_ARCH_CDB89712) += cdb89712.o
15obj-$(CONFIG_ARCH_CLEP7312) += clep7312.o 15obj-$(CONFIG_ARCH_CLEP7312) += clep7312.o
16obj-$(CONFIG_ARCH_EDB7211) += edb7211-arch.o edb7211-mm.o 16obj-$(CONFIG_ARCH_EDB7211) += edb7211-arch.o edb7211-mm.o
17obj-$(CONFIG_ARCH_FORTUNET) += fortunet.o 17obj-$(CONFIG_ARCH_FORTUNET) += fortunet.o
18obj-$(CONFIG_MACH_MP1000) += mp1000-mach.o mp1000-mm.o mp1000-seprom.o
19obj-$(CONFIG_ARCH_P720T) += p720t.o 18obj-$(CONFIG_ARCH_P720T) += p720t.o
20leds-$(CONFIG_ARCH_P720T) += p720t-leds.o 19leds-$(CONFIG_ARCH_P720T) += p720t-leds.o
21obj-$(CONFIG_LEDS) += $(leds-y) 20obj-$(CONFIG_LEDS) += $(leds-y)
diff --git a/arch/arm/mach-clps711x/edb7211-mm.c b/arch/arm/mach-clps711x/edb7211-mm.c
index 72f8bb05d55e..0d52e0851251 100644
--- a/arch/arm/mach-clps711x/edb7211-mm.c
+++ b/arch/arm/mach-clps711x/edb7211-mm.c
@@ -55,22 +55,22 @@ static struct map_desc edb7211_io_desc[] __initdata = {
55 .virtual = EP7211_VIRT_EXTKBD, 55 .virtual = EP7211_VIRT_EXTKBD,
56 .pfn = __phys_to_pfn(EP7211_PHYS_EXTKBD), 56 .pfn = __phys_to_pfn(EP7211_PHYS_EXTKBD),
57 .length = SZ_1M, 57 .length = SZ_1M,
58 .type - MT_DEVICE 58 .type = MT_DEVICE,
59 }, { /* and CS8900A Ethernet chip */ 59 }, { /* and CS8900A Ethernet chip */
60 .virtual = EP7211_VIRT_CS8900A, 60 .virtual = EP7211_VIRT_CS8900A,
61 .pfn = __phys_to_pfn(EP7211_PHYS_CS8900A), 61 .pfn = __phys_to_pfn(EP7211_PHYS_CS8900A),
62 .length = SZ_1M, 62 .length = SZ_1M,
63 .type = MT_DEVICE 63 .type = MT_DEVICE,
64 }, { /* flash banks */ 64 }, { /* flash banks */
65 .virtual = EP7211_VIRT_FLASH1, 65 .virtual = EP7211_VIRT_FLASH1,
66 .pfn = __phys_to_pfn(EP7211_PHYS_FLASH1), 66 .pfn = __phys_to_pfn(EP7211_PHYS_FLASH1),
67 .length = SZ_8M, 67 .length = SZ_8M,
68 .type = MT_DEVICE 68 .type = MT_DEVICE,
69 }, { 69 }, {
70 .virtual = EP7211_VIRT_FLASH2, 70 .virtual = EP7211_VIRT_FLASH2,
71 .pfn = __phys_to_pfn(EP7211_PHYS_FLASH2), 71 .pfn = __phys_to_pfn(EP7211_PHYS_FLASH2),
72 .length = SZ_8M, 72 .length = SZ_8M,
73 .type = MT_DEVICE 73 .type = MT_DEVICE,
74 } 74 }
75}; 75};
76 76
diff --git a/arch/arm/mach-clps711x/mp1000-mach.c b/arch/arm/mach-clps711x/mp1000-mach.c
deleted file mode 100644
index c2816bcde5e7..000000000000
--- a/arch/arm/mach-clps711x/mp1000-mach.c
+++ /dev/null
@@ -1,49 +0,0 @@
1/*
2 * linux/arch/arm/mach-mp1000/mp1000.c
3 *
4 * Copyright (C) 2005 Comdial Corporation
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/init.h>
21#include <linux/types.h>
22#include <linux/string.h>
23
24#include <asm/setup.h>
25#include <asm/mach-types.h>
26#include <asm/mach/arch.h>
27#include <asm/arch/mp1000-seprom.h>
28
29#include "common.h"
30
31extern void mp1000_map_io(void);
32
33static void __init mp1000_init(void)
34{
35 seprom_init();
36}
37
38MACHINE_START(MP1000, "Comdial MP1000")
39 /* Maintainer: Jon Ringle */
40 .phys_ram = 0xc0000000,
41 .phys_io = 0x80000000,
42 .io_pg_offst = ((0xff000000) >> 18) & 0xfffc,
43 .boot_params = 0xc0015100,
44 .map_io = mp1000_map_io,
45 .init_irq = clps711x_init_irq,
46 .init_machine = mp1000_init,
47 .timer = &clps711x_timer,
48MACHINE_END
49
diff --git a/arch/arm/mach-clps711x/mp1000-mm.c b/arch/arm/mach-clps711x/mp1000-mm.c
deleted file mode 100644
index 20e810b0ec0c..000000000000
--- a/arch/arm/mach-clps711x/mp1000-mm.c
+++ /dev/null
@@ -1,47 +0,0 @@
1/*
2 * linux/arch/arm/mach-mp1000/mm.c
3 *
4 * Extra MM routines for the MP1000
5 *
6 * Copyright (C) 2005 Comdial Corporation
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 as published by
10 * the Free Software Foundation; either version 2 of the License, or
11 * (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#include <linux/kernel.h>
23#include <linux/init.h>
24
25#include <asm/hardware.h>
26#include <asm/page.h>
27#include <asm/pgtable.h>
28#include <asm/sizes.h>
29
30#include <asm/mach/map.h>
31
32extern void clps711x_map_io(void);
33
34static struct map_desc mp1000_io_desc[] __initdata = {
35 { MP1000_EIO_BASE, MP1000_EIO_START, MP1000_EIO_SIZE, MT_DEVICE },
36 { MP1000_FIO_BASE, MP1000_FIO_START, MP1000_FIO_SIZE, MT_DEVICE },
37 { MP1000_LIO_BASE, MP1000_LIO_START, MP1000_LIO_SIZE, MT_DEVICE },
38 { MP1000_NIO_BASE, MP1000_NIO_START, MP1000_NIO_SIZE, MT_DEVICE },
39 { MP1000_IDE_BASE, MP1000_IDE_START, MP1000_IDE_SIZE, MT_DEVICE },
40 { MP1000_DSP_BASE, MP1000_DSP_START, MP1000_DSP_SIZE, MT_DEVICE }
41};
42
43void __init mp1000_map_io(void)
44{
45 clps711x_map_io();
46 iotable_init(mp1000_io_desc, ARRAY_SIZE(mp1000_io_desc));
47}
diff --git a/arch/arm/mach-clps711x/mp1000-seprom.c b/arch/arm/mach-clps711x/mp1000-seprom.c
deleted file mode 100644
index b22d0bebb851..000000000000
--- a/arch/arm/mach-clps711x/mp1000-seprom.c
+++ /dev/null
@@ -1,195 +0,0 @@
1/*`
2 * mp1000-seprom.c
3 *
4 * This file contains the Serial EEPROM code for the MP1000 board
5 *
6 * Copyright (C) 2005 Comdial Corporation
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 as published by
10 * the Free Software Foundation; either version 2 of the License, or
11 * (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
24#include <linux/kernel.h>
25#include <linux/init.h>
26#include <asm/hardware.h>
27#include <asm/hardware/clps7111.h>
28#include <asm/arch/mp1000-seprom.h>
29
30/* If SepromInit() can initialize and checksum the seprom successfully, */
31/* then it will point seprom_data_ptr at the shadow copy. */
32
33static eeprom_struct seprom_data; /* shadow copy of seprom content */
34
35eeprom_struct *seprom_data_ptr = 0; /* 0 => not initialized */
36
37/*
38 * Port D Bit 5 is Chip Select for EEPROM
39 * Port E Bit 0 is Input, Data out from EEPROM
40 * Port E Bit 1 is Output, Data in to EEPROM
41 * Port E Bit 2 is Output, CLK to EEPROM
42 */
43
44static char *port_d_ptr = (char *)(CLPS7111_VIRT_BASE + PDDR);
45static char *port_e_ptr = (char *)(CLPS7111_VIRT_BASE + PEDR);
46
47#define NO_OF_SHORTS 64 // Device is 64 x 16 bits
48#define ENABLE_RW 0
49#define DISABLE_RW 1
50
51static inline void toggle_seprom_clock(void)
52{
53 *port_e_ptr |= HwPortESepromCLK;
54 *port_e_ptr &= ~(HwPortESepromCLK);
55}
56
57static inline void select_eeprom(void)
58{
59 *port_d_ptr |= HwPortDEECS;
60 *port_e_ptr &= ~(HwPortESepromCLK);
61}
62
63static inline void deselect_eeprom(void)
64{
65 *port_d_ptr &= ~(HwPortDEECS);
66 *port_e_ptr &= ~(HwPortESepromDIn);
67}
68
69/*
70 * GetSepromDataPtr - returns pointer to shadow (RAM) copy of seprom
71 * and returns 0 if seprom is not initialized or
72 * has a checksum error.
73 */
74
75eeprom_struct* get_seprom_ptr(void)
76{
77 return seprom_data_ptr;
78}
79
80unsigned char* get_eeprom_mac_address(void)
81{
82 return seprom_data_ptr->variant.eprom_struct.mac_Address;
83}
84
85/*
86 * ReadSProm, Physically reads data from the Serial PROM
87 */
88static void read_sprom(short address, int length, eeprom_struct *buffer)
89{
90 short data = COMMAND_READ | (address & 0x3F);
91 short bit;
92 int i;
93
94 select_eeprom();
95
96 // Clock in 9 bits of the command
97 for (i = 0, bit = 0x100; i < 9; i++, bit >>= 1) {
98 if (data & bit)
99 *port_e_ptr |= HwPortESepromDIn;
100 else
101 *port_e_ptr &= ~(HwPortESepromDIn);
102
103 toggle_seprom_clock();
104 }
105
106 //
107 // Now read one or more shorts of data from the Seprom
108 //
109 while (length-- > 0) {
110 data = 0;
111
112 // Read 16 bits at a time
113 for (i = 0; i < 16; i++) {
114 data <<= 1;
115 toggle_seprom_clock();
116 data |= *port_e_ptr & HwPortESepromDOut;
117
118 }
119
120 buffer->variant.eprom_short_data[address++] = data;
121 }
122
123 deselect_eeprom();
124
125 return;
126}
127
128
129
130/*
131 * ReadSerialPROM
132 *
133 * Input: Pointer to array of 64 x 16 Bits
134 *
135 * Output: if no problem reading data is filled in
136 */
137static void read_serial_prom(eeprom_struct *data)
138{
139 read_sprom(0, 64, data);
140}
141
142
143//
144// Compute Serial EEPROM checksum
145//
146// Input: Pointer to struct with Eprom data
147//
148// Output: The computed Eprom checksum
149//
150static short compute_seprom_checksum(eeprom_struct *data)
151{
152 short checksum = 0;
153 int i;
154
155 for (i = 0; i < 126; i++) {
156 checksum += (short)data->variant.eprom_byte_data[i];
157 }
158
159 return((short)(0x5555 - (checksum & 0xFFFF)));
160}
161
162//
163// Make sure the data port bits for the SEPROM are correctly initialised
164//
165
166void __init seprom_init(void)
167{
168 short checksum;
169
170 // Init Port D
171 *(char *)(CLPS7111_VIRT_BASE + PDDDR) = 0x0;
172 *(char *)(CLPS7111_VIRT_BASE + PDDR) = 0x15;
173
174 // Init Port E
175 *(int *)(CLPS7111_VIRT_BASE + PEDDR) = 0x06;
176 *(int *)(CLPS7111_VIRT_BASE + PEDR) = 0x04;
177
178 //
179 // Make sure that EEPROM struct size never exceeds 128 bytes
180 //
181 if (sizeof(eeprom_struct) > 128) {
182 panic("Serial PROM struct size > 128, aborting read\n");
183 }
184
185 read_serial_prom(&seprom_data);
186
187 checksum = compute_seprom_checksum(&seprom_data);
188
189 if (checksum != seprom_data.variant.eprom_short_data[63]) {
190 panic("Serial EEPROM checksum failed\n");
191 }
192
193 seprom_data_ptr = &seprom_data;
194}
195
diff --git a/arch/arm/mach-epxa10db/mm.c b/arch/arm/mach-epxa10db/mm.c
index e8832d0910ee..cfd0d2182d44 100644
--- a/arch/arm/mach-epxa10db/mm.c
+++ b/arch/arm/mach-epxa10db/mm.c
@@ -25,6 +25,7 @@
25#include <asm/hardware.h> 25#include <asm/hardware.h>
26#include <asm/io.h> 26#include <asm/io.h>
27#include <asm/sizes.h> 27#include <asm/sizes.h>
28#include <asm/page.h>
28 29
29#include <asm/mach/map.h> 30#include <asm/mach/map.h>
30 31
diff --git a/arch/arm/mach-integrator/impd1.c b/arch/arm/mach-integrator/impd1.c
index a1b153d1626c..a4bafee77a06 100644
--- a/arch/arm/mach-integrator/impd1.c
+++ b/arch/arm/mach-integrator/impd1.c
@@ -420,8 +420,7 @@ static int impd1_probe(struct lm_device *dev)
420 free_impd1: 420 free_impd1:
421 if (impd1 && impd1->base) 421 if (impd1 && impd1->base)
422 iounmap(impd1->base); 422 iounmap(impd1->base);
423 if (impd1) 423 kfree(impd1);
424 kfree(impd1);
425 release_lm: 424 release_lm:
426 release_mem_region(dev->resource.start, SZ_4K); 425 release_mem_region(dev->resource.start, SZ_4K);
427 return ret; 426 return ret;
diff --git a/arch/arm/mach-ixp2000/core.c b/arch/arm/mach-ixp2000/core.c
index c93a98b2a32c..6851abaf5524 100644
--- a/arch/arm/mach-ixp2000/core.c
+++ b/arch/arm/mach-ixp2000/core.c
@@ -84,63 +84,54 @@ static struct map_desc ixp2000_io_desc[] __initdata = {
84 .virtual = IXP2000_CAP_VIRT_BASE, 84 .virtual = IXP2000_CAP_VIRT_BASE,
85 .pfn = __phys_to_pfn(IXP2000_CAP_PHYS_BASE), 85 .pfn = __phys_to_pfn(IXP2000_CAP_PHYS_BASE),
86 .length = IXP2000_CAP_SIZE, 86 .length = IXP2000_CAP_SIZE,
87 .type = MT_DEVICE 87 .type = MT_IXP2000_DEVICE,
88 }, { 88 }, {
89 .virtual = IXP2000_INTCTL_VIRT_BASE, 89 .virtual = IXP2000_INTCTL_VIRT_BASE,
90 .pfn = __phys_to_pfn(IXP2000_INTCTL_PHYS_BASE), 90 .pfn = __phys_to_pfn(IXP2000_INTCTL_PHYS_BASE),
91 .length = IXP2000_INTCTL_SIZE, 91 .length = IXP2000_INTCTL_SIZE,
92 .type = MT_DEVICE 92 .type = MT_IXP2000_DEVICE,
93 }, { 93 }, {
94 .virtual = IXP2000_PCI_CREG_VIRT_BASE, 94 .virtual = IXP2000_PCI_CREG_VIRT_BASE,
95 .pfn = __phys_to_pfn(IXP2000_PCI_CREG_PHYS_BASE), 95 .pfn = __phys_to_pfn(IXP2000_PCI_CREG_PHYS_BASE),
96 .length = IXP2000_PCI_CREG_SIZE, 96 .length = IXP2000_PCI_CREG_SIZE,
97 .type = MT_DEVICE 97 .type = MT_IXP2000_DEVICE,
98 }, { 98 }, {
99 .virtual = IXP2000_PCI_CSR_VIRT_BASE, 99 .virtual = IXP2000_PCI_CSR_VIRT_BASE,
100 .pfn = __phys_to_pfn(IXP2000_PCI_CSR_PHYS_BASE), 100 .pfn = __phys_to_pfn(IXP2000_PCI_CSR_PHYS_BASE),
101 .length = IXP2000_PCI_CSR_SIZE, 101 .length = IXP2000_PCI_CSR_SIZE,
102 .type = MT_DEVICE 102 .type = MT_IXP2000_DEVICE,
103 }, { 103 }, {
104 .virtual = IXP2000_MSF_VIRT_BASE, 104 .virtual = IXP2000_MSF_VIRT_BASE,
105 .pfn = __phys_to_pfn(IXP2000_MSF_PHYS_BASE), 105 .pfn = __phys_to_pfn(IXP2000_MSF_PHYS_BASE),
106 .length = IXP2000_MSF_SIZE, 106 .length = IXP2000_MSF_SIZE,
107 .type = MT_DEVICE 107 .type = MT_IXP2000_DEVICE,
108 }, { 108 }, {
109 .virtual = IXP2000_PCI_IO_VIRT_BASE, 109 .virtual = IXP2000_PCI_IO_VIRT_BASE,
110 .pfn = __phys_to_pfn(IXP2000_PCI_IO_PHYS_BASE), 110 .pfn = __phys_to_pfn(IXP2000_PCI_IO_PHYS_BASE),
111 .length = IXP2000_PCI_IO_SIZE, 111 .length = IXP2000_PCI_IO_SIZE,
112 .type = MT_DEVICE 112 .type = MT_IXP2000_DEVICE,
113 }, { 113 }, {
114 .virtual = IXP2000_PCI_CFG0_VIRT_BASE, 114 .virtual = IXP2000_PCI_CFG0_VIRT_BASE,
115 .pfn = __phys_to_pfn(IXP2000_PCI_CFG0_PHYS_BASE), 115 .pfn = __phys_to_pfn(IXP2000_PCI_CFG0_PHYS_BASE),
116 .length = IXP2000_PCI_CFG0_SIZE, 116 .length = IXP2000_PCI_CFG0_SIZE,
117 .type = MT_DEVICE 117 .type = MT_IXP2000_DEVICE,
118 }, { 118 }, {
119 .virtual = IXP2000_PCI_CFG1_VIRT_BASE, 119 .virtual = IXP2000_PCI_CFG1_VIRT_BASE,
120 .pfn = __phys_to_pfn(IXP2000_PCI_CFG1_PHYS_BASE), 120 .pfn = __phys_to_pfn(IXP2000_PCI_CFG1_PHYS_BASE),
121 .length = IXP2000_PCI_CFG1_SIZE, 121 .length = IXP2000_PCI_CFG1_SIZE,
122 .type = MT_DEVICE 122 .type = MT_IXP2000_DEVICE,
123 } 123 }
124}; 124};
125 125
126void __init ixp2000_map_io(void) 126void __init ixp2000_map_io(void)
127{ 127{
128 extern unsigned int processor_id;
129
130 /* 128 /*
131 * On IXP2400 CPUs we need to use MT_IXP2000_DEVICE for 129 * On IXP2400 CPUs we need to use MT_IXP2000_DEVICE so that
132 * tweaking the PMDs so XCB=101. On IXP2800s we use the normal 130 * XCB=101 (to avoid triggering erratum #66), and given that
133 * PMD flags. 131 * this mode speeds up I/O accesses and we have write buffer
132 * flushes in the right places anyway, it doesn't hurt to use
133 * XCB=101 for all IXP2000s.
134 */ 134 */
135 if ((processor_id & 0xfffffff0) == 0x69054190) {
136 int i;
137
138 printk(KERN_INFO "Enabling IXP2400 erratum #66 workaround\n");
139
140 for(i=0;i<ARRAY_SIZE(ixp2000_io_desc);i++)
141 ixp2000_io_desc[i].type = MT_IXP2000_DEVICE;
142 }
143
144 iotable_init(ixp2000_io_desc, ARRAY_SIZE(ixp2000_io_desc)); 135 iotable_init(ixp2000_io_desc, ARRAY_SIZE(ixp2000_io_desc));
145 136
146 /* Set slowport to 8-bit mode. */ 137 /* Set slowport to 8-bit mode. */
@@ -402,6 +393,40 @@ static void ixp2000_pci_irq_unmask(unsigned int irq)
402 ixp2000_reg_write(IXP2000_PCI_XSCALE_INT_ENABLE, (temp | (1 << 27))); 393 ixp2000_reg_write(IXP2000_PCI_XSCALE_INT_ENABLE, (temp | (1 << 27)));
403} 394}
404 395
396/*
397 * Error interrupts. These are used extensively by the microengine drivers
398 */
399static void ixp2000_err_irq_handler(unsigned int irq, struct irqdesc *desc, struct pt_regs *regs)
400{
401 int i;
402 unsigned long status = *IXP2000_IRQ_ERR_STATUS;
403
404 for(i = 31; i >= 0; i--) {
405 if(status & (1 << i)) {
406 desc = irq_desc + IRQ_IXP2000_DRAM0_MIN_ERR + i;
407 desc->handle(IRQ_IXP2000_DRAM0_MIN_ERR + i, desc, regs);
408 }
409 }
410}
411
412static void ixp2000_err_irq_mask(unsigned int irq)
413{
414 ixp2000_reg_write(IXP2000_IRQ_ERR_ENABLE_CLR,
415 (1 << (irq - IRQ_IXP2000_DRAM0_MIN_ERR)));
416}
417
418static void ixp2000_err_irq_unmask(unsigned int irq)
419{
420 ixp2000_reg_write(IXP2000_IRQ_ERR_ENABLE_SET,
421 (1 << (irq - IRQ_IXP2000_DRAM0_MIN_ERR)));
422}
423
424static struct irqchip ixp2000_err_irq_chip = {
425 .ack = ixp2000_err_irq_mask,
426 .mask = ixp2000_err_irq_mask,
427 .unmask = ixp2000_err_irq_unmask
428};
429
405static struct irqchip ixp2000_pci_irq_chip = { 430static struct irqchip ixp2000_pci_irq_chip = {
406 .ack = ixp2000_pci_irq_mask, 431 .ack = ixp2000_pci_irq_mask,
407 .mask = ixp2000_pci_irq_mask, 432 .mask = ixp2000_pci_irq_mask,
@@ -459,6 +484,18 @@ void __init ixp2000_init_irq(void)
459 } else set_irq_flags(irq, 0); 484 } else set_irq_flags(irq, 0);
460 } 485 }
461 486
487 for (irq = IRQ_IXP2000_DRAM0_MIN_ERR; irq <= IRQ_IXP2000_SP_INT; irq++) {
488 if((1 << (irq - IRQ_IXP2000_DRAM0_MIN_ERR)) &
489 IXP2000_VALID_ERR_IRQ_MASK) {
490 set_irq_chip(irq, &ixp2000_err_irq_chip);
491 set_irq_handler(irq, do_level_IRQ);
492 set_irq_flags(irq, IRQF_VALID);
493 }
494 else
495 set_irq_flags(irq, 0);
496 }
497 set_irq_chained_handler(IRQ_IXP2000_ERRSUM, ixp2000_err_irq_handler);
498
462 /* 499 /*
463 * GPIO IRQs are invalid until someone sets the interrupt mode 500 * GPIO IRQs are invalid until someone sets the interrupt mode
464 * by calling set_irq_type(). 501 * by calling set_irq_type().
diff --git a/arch/arm/mach-ixp2000/enp2611.c b/arch/arm/mach-ixp2000/enp2611.c
index 7719c478aa84..61f6006241bd 100644
--- a/arch/arm/mach-ixp2000/enp2611.c
+++ b/arch/arm/mach-ixp2000/enp2611.c
@@ -69,19 +69,19 @@ static struct sys_timer enp2611_timer = {
69static struct map_desc enp2611_io_desc[] __initdata = { 69static struct map_desc enp2611_io_desc[] __initdata = {
70 { 70 {
71 .virtual = ENP2611_CALEB_VIRT_BASE, 71 .virtual = ENP2611_CALEB_VIRT_BASE,
72 .physical = ENP2611_CALEB_PHYS_BASE, 72 .pfn = __phys_to_pfn(ENP2611_CALEB_PHYS_BASE),
73 .length = ENP2611_CALEB_SIZE, 73 .length = ENP2611_CALEB_SIZE,
74 .type = MT_IXP2000_DEVICE 74 .type = MT_IXP2000_DEVICE,
75 }, { 75 }, {
76 .virtual = ENP2611_PM3386_0_VIRT_BASE, 76 .virtual = ENP2611_PM3386_0_VIRT_BASE,
77 .physical = ENP2611_PM3386_0_PHYS_BASE, 77 .pfn = __phys_to_pfn(ENP2611_PM3386_0_PHYS_BASE),
78 .length = ENP2611_PM3386_0_SIZE, 78 .length = ENP2611_PM3386_0_SIZE,
79 .type = MT_IXP2000_DEVICE 79 .type = MT_IXP2000_DEVICE,
80 }, { 80 }, {
81 .virtual = ENP2611_PM3386_1_VIRT_BASE, 81 .virtual = ENP2611_PM3386_1_VIRT_BASE,
82 .physical = ENP2611_PM3386_1_PHYS_BASE, 82 .pfn = __phys_to_pfn(ENP2611_PM3386_1_PHYS_BASE),
83 .length = ENP2611_PM3386_1_SIZE, 83 .length = ENP2611_PM3386_1_SIZE,
84 .type = MT_IXP2000_DEVICE 84 .type = MT_IXP2000_DEVICE,
85 } 85 }
86}; 86};
87 87
diff --git a/arch/arm/mach-ixp2000/uengine.c b/arch/arm/mach-ixp2000/uengine.c
index 43e234349d4a..ec4e007a22ef 100644
--- a/arch/arm/mach-ixp2000/uengine.c
+++ b/arch/arm/mach-ixp2000/uengine.c
@@ -91,8 +91,8 @@ EXPORT_SYMBOL(ixp2000_uengine_csr_write);
91 91
92void ixp2000_uengine_reset(u32 uengine_mask) 92void ixp2000_uengine_reset(u32 uengine_mask)
93{ 93{
94 ixp2000_reg_write(IXP2000_RESET1, uengine_mask & ixp2000_uengine_mask); 94 ixp2000_reg_wrb(IXP2000_RESET1, uengine_mask & ixp2000_uengine_mask);
95 ixp2000_reg_write(IXP2000_RESET1, 0); 95 ixp2000_reg_wrb(IXP2000_RESET1, 0);
96} 96}
97EXPORT_SYMBOL(ixp2000_uengine_reset); 97EXPORT_SYMBOL(ixp2000_uengine_reset);
98 98
@@ -452,21 +452,20 @@ static int __init ixp2000_uengine_init(void)
452 /* 452 /*
453 * Reset microengines. 453 * Reset microengines.
454 */ 454 */
455 ixp2000_reg_write(IXP2000_RESET1, ixp2000_uengine_mask); 455 ixp2000_uengine_reset(ixp2000_uengine_mask);
456 ixp2000_reg_write(IXP2000_RESET1, 0);
457 456
458 /* 457 /*
459 * Synchronise timestamp counters across all microengines. 458 * Synchronise timestamp counters across all microengines.
460 */ 459 */
461 value = ixp2000_reg_read(IXP2000_MISC_CONTROL); 460 value = ixp2000_reg_read(IXP2000_MISC_CONTROL);
462 ixp2000_reg_write(IXP2000_MISC_CONTROL, value & ~0x80); 461 ixp2000_reg_wrb(IXP2000_MISC_CONTROL, value & ~0x80);
463 for (uengine = 0; uengine < 32; uengine++) { 462 for (uengine = 0; uengine < 32; uengine++) {
464 if (ixp2000_uengine_mask & (1 << uengine)) { 463 if (ixp2000_uengine_mask & (1 << uengine)) {
465 ixp2000_uengine_csr_write(uengine, TIMESTAMP_LOW, 0); 464 ixp2000_uengine_csr_write(uengine, TIMESTAMP_LOW, 0);
466 ixp2000_uengine_csr_write(uengine, TIMESTAMP_HIGH, 0); 465 ixp2000_uengine_csr_write(uengine, TIMESTAMP_HIGH, 0);
467 } 466 }
468 } 467 }
469 ixp2000_reg_write(IXP2000_MISC_CONTROL, value | 0x80); 468 ixp2000_reg_wrb(IXP2000_MISC_CONTROL, value | 0x80);
470 469
471 return 0; 470 return 0;
472} 471}
diff --git a/arch/arm/mach-ixp4xx/common-pci.c b/arch/arm/mach-ixp4xx/common-pci.c
index 2b544363c078..9795da270e3a 100644
--- a/arch/arm/mach-ixp4xx/common-pci.c
+++ b/arch/arm/mach-ixp4xx/common-pci.c
@@ -427,7 +427,7 @@ void __init ixp4xx_pci_preinit(void)
427#ifdef __ARMEB__ 427#ifdef __ARMEB__
428 *PCI_CSR = PCI_CSR_IC | PCI_CSR_ABE | PCI_CSR_PDS | PCI_CSR_ADS; 428 *PCI_CSR = PCI_CSR_IC | PCI_CSR_ABE | PCI_CSR_PDS | PCI_CSR_ADS;
429#else 429#else
430 *PCI_CSR = PCI_CSR_IC; 430 *PCI_CSR = PCI_CSR_IC | PCI_CSR_ABE;
431#endif 431#endif
432 432
433 pr_debug("DONE\n"); 433 pr_debug("DONE\n");
diff --git a/arch/arm/mach-omap1/leds-h2p2-debug.c b/arch/arm/mach-omap1/leds-h2p2-debug.c
index be283cda63dd..399010c14036 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/Kconfig b/arch/arm/mach-pxa/Kconfig
index 3e5f69bb5ac4..b380a438e68f 100644
--- a/arch/arm/mach-pxa/Kconfig
+++ b/arch/arm/mach-pxa/Kconfig
@@ -27,7 +27,8 @@ config PXA_SHARPSL
27 Say Y here if you intend to run this kernel on a 27 Say Y here if you intend to run this kernel on a
28 Sharp Zaurus SL-5600 (Poodle), SL-C700 (Corgi), 28 Sharp Zaurus SL-5600 (Poodle), SL-C700 (Corgi),
29 SL-C750 (Shepherd), SL-C760 (Husky), SL-C1000 (Akita), 29 SL-C750 (Shepherd), SL-C760 (Husky), SL-C1000 (Akita),
30 SL-C3000 (Spitz) or SL-C3100 (Borzoi) handheld computer. 30 SL-C3000 (Spitz), SL-C3100 (Borzoi) or SL-C6000x (Tosa)
31 handheld computer.
31 32
32endchoice 33endchoice
33 34
@@ -37,7 +38,7 @@ choice
37 prompt "Select target Sharp Zaurus device range" 38 prompt "Select target Sharp Zaurus device range"
38 39
39config PXA_SHARPSL_25x 40config PXA_SHARPSL_25x
40 bool "Sharp PXA25x models (SL-5600 and SL-C7xx)" 41 bool "Sharp PXA25x models (SL-5600, SL-C7xx and SL-C6000x)"
41 select PXA25x 42 select PXA25x
42 43
43config PXA_SHARPSL_27x 44config PXA_SHARPSL_27x
@@ -80,6 +81,10 @@ config MACH_BORZOI
80 depends PXA_SHARPSL_27x 81 depends PXA_SHARPSL_27x
81 select PXA_SHARP_Cxx00 82 select PXA_SHARP_Cxx00
82 83
84config MACH_TOSA
85 bool "Enable Sharp SL-6000x (Tosa) Support"
86 depends PXA_SHARPSL
87
83config PXA25x 88config PXA25x
84 bool 89 bool
85 help 90 help
diff --git a/arch/arm/mach-pxa/Makefile b/arch/arm/mach-pxa/Makefile
index f609a0f232cb..8bc72d07cea8 100644
--- a/arch/arm/mach-pxa/Makefile
+++ b/arch/arm/mach-pxa/Makefile
@@ -14,6 +14,7 @@ obj-$(CONFIG_ARCH_PXA_IDP) += idp.o
14obj-$(CONFIG_PXA_SHARP_C7xx) += corgi.o corgi_ssp.o corgi_lcd.o ssp.o 14obj-$(CONFIG_PXA_SHARP_C7xx) += corgi.o corgi_ssp.o corgi_lcd.o ssp.o
15obj-$(CONFIG_PXA_SHARP_Cxx00) += spitz.o corgi_ssp.o corgi_lcd.o ssp.o 15obj-$(CONFIG_PXA_SHARP_Cxx00) += spitz.o corgi_ssp.o corgi_lcd.o ssp.o
16obj-$(CONFIG_MACH_POODLE) += poodle.o 16obj-$(CONFIG_MACH_POODLE) += poodle.o
17obj-$(CONFIG_MACH_TOSA) += tosa.o
17 18
18# Support for blinky lights 19# Support for blinky lights
19led-y := leds.o 20led-y := leds.o
diff --git a/arch/arm/mach-pxa/corgi.c b/arch/arm/mach-pxa/corgi.c
index eb5f6d744a4a..100fb31b5156 100644
--- a/arch/arm/mach-pxa/corgi.c
+++ b/arch/arm/mach-pxa/corgi.c
@@ -62,6 +62,37 @@ static struct scoop_config corgi_scoop_setup = {
62 .io_out = CORGI_SCOOP_IO_OUT, 62 .io_out = CORGI_SCOOP_IO_OUT,
63}; 63};
64 64
65struct platform_device corgiscoop_device = {
66 .name = "sharp-scoop",
67 .id = -1,
68 .dev = {
69 .platform_data = &corgi_scoop_setup,
70 },
71 .num_resources = ARRAY_SIZE(corgi_scoop_resources),
72 .resource = corgi_scoop_resources,
73};
74
75static void corgi_pcmcia_init(void)
76{
77 /* Setup default state of GPIO outputs
78 before we enable them as outputs. */
79 GPSR(GPIO48_nPOE) = GPIO_bit(GPIO48_nPOE) |
80 GPIO_bit(GPIO49_nPWE) | GPIO_bit(GPIO50_nPIOR) |
81 GPIO_bit(GPIO51_nPIOW) | GPIO_bit(GPIO52_nPCE_1) |
82 GPIO_bit(GPIO53_nPCE_2);
83
84 pxa_gpio_mode(GPIO48_nPOE_MD);
85 pxa_gpio_mode(GPIO49_nPWE_MD);
86 pxa_gpio_mode(GPIO50_nPIOR_MD);
87 pxa_gpio_mode(GPIO51_nPIOW_MD);
88 pxa_gpio_mode(GPIO55_nPREG_MD);
89 pxa_gpio_mode(GPIO56_nPWAIT_MD);
90 pxa_gpio_mode(GPIO57_nIOIS16_MD);
91 pxa_gpio_mode(GPIO52_nPCE_1_MD);
92 pxa_gpio_mode(GPIO53_nPCE_2_MD);
93 pxa_gpio_mode(GPIO54_pSKTSEL_MD);
94}
95
65static struct scoop_pcmcia_dev corgi_pcmcia_scoop[] = { 96static struct scoop_pcmcia_dev corgi_pcmcia_scoop[] = {
66{ 97{
67 .dev = &corgiscoop_device.dev, 98 .dev = &corgiscoop_device.dev,
@@ -71,16 +102,14 @@ static struct scoop_pcmcia_dev corgi_pcmcia_scoop[] = {
71}, 102},
72}; 103};
73 104
74struct platform_device corgiscoop_device = { 105static struct scoop_pcmcia_config corgi_pcmcia_config = {
75 .name = "sharp-scoop", 106 .devs = &corgi_pcmcia_scoop[0],
76 .id = -1, 107 .num_devs = 1,
77 .dev = { 108 .pcmcia_init = corgi_pcmcia_init,
78 .platform_data = &corgi_scoop_setup,
79 },
80 .num_resources = ARRAY_SIZE(corgi_scoop_resources),
81 .resource = corgi_scoop_resources,
82}; 109};
83 110
111EXPORT_SYMBOL(corgiscoop_device);
112
84 113
85/* 114/*
86 * Corgi SSP Device 115 * Corgi SSP Device
@@ -294,8 +323,7 @@ static void __init corgi_init(void)
294 pxa_set_mci_info(&corgi_mci_platform_data); 323 pxa_set_mci_info(&corgi_mci_platform_data);
295 pxa_set_ficp_info(&corgi_ficp_platform_data); 324 pxa_set_ficp_info(&corgi_ficp_platform_data);
296 325
297 scoop_num = 1; 326 platform_scoop_config = &corgi_pcmcia_config;
298 scoop_devs = &corgi_pcmcia_scoop[0];
299 327
300 platform_add_devices(devices, ARRAY_SIZE(devices)); 328 platform_add_devices(devices, ARRAY_SIZE(devices));
301} 329}
diff --git a/arch/arm/mach-pxa/corgi_lcd.c b/arch/arm/mach-pxa/corgi_lcd.c
index 54162ba95414..698eb06545c4 100644
--- a/arch/arm/mach-pxa/corgi_lcd.c
+++ b/arch/arm/mach-pxa/corgi_lcd.c
@@ -19,6 +19,7 @@
19#include <linux/kernel.h> 19#include <linux/kernel.h>
20#include <linux/platform_device.h> 20#include <linux/platform_device.h>
21#include <linux/module.h> 21#include <linux/module.h>
22#include <linux/string.h>
22#include <asm/arch/akita.h> 23#include <asm/arch/akita.h>
23#include <asm/arch/corgi.h> 24#include <asm/arch/corgi.h>
24#include <asm/arch/hardware.h> 25#include <asm/arch/hardware.h>
diff --git a/arch/arm/mach-pxa/lubbock.c b/arch/arm/mach-pxa/lubbock.c
index 9c6e77faec5b..b464bc88ff93 100644
--- a/arch/arm/mach-pxa/lubbock.c
+++ b/arch/arm/mach-pxa/lubbock.c
@@ -19,16 +19,20 @@
19#include <linux/major.h> 19#include <linux/major.h>
20#include <linux/fb.h> 20#include <linux/fb.h>
21#include <linux/interrupt.h> 21#include <linux/interrupt.h>
22#include <linux/mtd/mtd.h>
23#include <linux/mtd/partitions.h>
22 24
23#include <asm/setup.h> 25#include <asm/setup.h>
24#include <asm/memory.h> 26#include <asm/memory.h>
25#include <asm/mach-types.h> 27#include <asm/mach-types.h>
26#include <asm/hardware.h> 28#include <asm/hardware.h>
27#include <asm/irq.h> 29#include <asm/irq.h>
30#include <asm/sizes.h>
28 31
29#include <asm/mach/arch.h> 32#include <asm/mach/arch.h>
30#include <asm/mach/map.h> 33#include <asm/mach/map.h>
31#include <asm/mach/irq.h> 34#include <asm/mach/irq.h>
35#include <asm/mach/flash.h>
32 36
33#include <asm/hardware/sa1111.h> 37#include <asm/hardware/sa1111.h>
34 38
@@ -199,10 +203,75 @@ static struct platform_device smc91x_device = {
199 .resource = smc91x_resources, 203 .resource = smc91x_resources,
200}; 204};
201 205
206static struct resource flash_resources[] = {
207 [0] = {
208 .start = 0x00000000,
209 .end = SZ_64M - 1,
210 .flags = IORESOURCE_MEM,
211 },
212 [1] = {
213 .start = 0x04000000,
214 .end = 0x04000000 + SZ_64M - 1,
215 .flags = IORESOURCE_MEM,
216 },
217};
218
219static struct mtd_partition lubbock_partitions[] = {
220 {
221 .name = "Bootloader",
222 .size = 0x00040000,
223 .offset = 0,
224 .mask_flags = MTD_WRITEABLE /* force read-only */
225 },{
226 .name = "Kernel",
227 .size = 0x00100000,
228 .offset = 0x00040000,
229 },{
230 .name = "Filesystem",
231 .size = MTDPART_SIZ_FULL,
232 .offset = 0x00140000
233 }
234};
235
236static struct flash_platform_data lubbock_flash_data[2] = {
237 {
238 .map_name = "cfi_probe",
239 .parts = lubbock_partitions,
240 .nr_parts = ARRAY_SIZE(lubbock_partitions),
241 }, {
242 .map_name = "cfi_probe",
243 .parts = NULL,
244 .nr_parts = 0,
245 }
246};
247
248static struct platform_device lubbock_flash_device[2] = {
249 {
250 .name = "pxa2xx-flash",
251 .id = 0,
252 .dev = {
253 .platform_data = &lubbock_flash_data[0],
254 },
255 .resource = &flash_resources[0],
256 .num_resources = 1,
257 },
258 {
259 .name = "pxa2xx-flash",
260 .id = 1,
261 .dev = {
262 .platform_data = &lubbock_flash_data[1],
263 },
264 .resource = &flash_resources[1],
265 .num_resources = 1,
266 },
267};
268
202static struct platform_device *devices[] __initdata = { 269static struct platform_device *devices[] __initdata = {
203 &sa1111_device, 270 &sa1111_device,
204 &lub_audio_device, 271 &lub_audio_device,
205 &smc91x_device, 272 &smc91x_device,
273 &lubbock_flash_device[0],
274 &lubbock_flash_device[1],
206}; 275};
207 276
208static struct pxafb_mach_info sharp_lm8v31 __initdata = { 277static struct pxafb_mach_info sharp_lm8v31 __initdata = {
@@ -315,10 +384,21 @@ static struct pxaficp_platform_data lubbock_ficp_platform_data = {
315 384
316static void __init lubbock_init(void) 385static void __init lubbock_init(void)
317{ 386{
387 int flashboot = (LUB_CONF_SWITCHES & 1);
388
318 pxa_set_udc_info(&udc_info); 389 pxa_set_udc_info(&udc_info);
319 set_pxa_fb_info(&sharp_lm8v31); 390 set_pxa_fb_info(&sharp_lm8v31);
320 pxa_set_mci_info(&lubbock_mci_platform_data); 391 pxa_set_mci_info(&lubbock_mci_platform_data);
321 pxa_set_ficp_info(&lubbock_ficp_platform_data); 392 pxa_set_ficp_info(&lubbock_ficp_platform_data);
393
394 lubbock_flash_data[0].width = lubbock_flash_data[1].width =
395 (BOOT_DEF & 1) ? 2 : 4;
396 /* Compensate for the nROMBT switch which swaps the flash banks */
397 printk(KERN_NOTICE "Lubbock configured to boot from %s (bank %d)\n",
398 flashboot?"Flash":"ROM", flashboot);
399
400 lubbock_flash_data[flashboot^1].name = "application-flash";
401 lubbock_flash_data[flashboot].name = "boot-rom";
322 (void) platform_add_devices(devices, ARRAY_SIZE(devices)); 402 (void) platform_add_devices(devices, ARRAY_SIZE(devices));
323} 403}
324 404
diff --git a/arch/arm/mach-pxa/mainstone.c b/arch/arm/mach-pxa/mainstone.c
index 887a8cb7b721..07892f4012d8 100644
--- a/arch/arm/mach-pxa/mainstone.c
+++ b/arch/arm/mach-pxa/mainstone.c
@@ -20,6 +20,9 @@
20#include <linux/sched.h> 20#include <linux/sched.h>
21#include <linux/bitops.h> 21#include <linux/bitops.h>
22#include <linux/fb.h> 22#include <linux/fb.h>
23#include <linux/ioport.h>
24#include <linux/mtd/mtd.h>
25#include <linux/mtd/partitions.h>
23 26
24#include <asm/types.h> 27#include <asm/types.h>
25#include <asm/setup.h> 28#include <asm/setup.h>
@@ -27,10 +30,12 @@
27#include <asm/mach-types.h> 30#include <asm/mach-types.h>
28#include <asm/hardware.h> 31#include <asm/hardware.h>
29#include <asm/irq.h> 32#include <asm/irq.h>
33#include <asm/sizes.h>
30 34
31#include <asm/mach/arch.h> 35#include <asm/mach/arch.h>
32#include <asm/mach/map.h> 36#include <asm/mach/map.h>
33#include <asm/mach/irq.h> 37#include <asm/mach/irq.h>
38#include <asm/mach/flash.h>
34 39
35#include <asm/arch/pxa-regs.h> 40#include <asm/arch/pxa-regs.h>
36#include <asm/arch/mainstone.h> 41#include <asm/arch/mainstone.h>
@@ -190,6 +195,69 @@ static struct platform_device mst_audio_device = {
190 .dev = { .platform_data = &mst_audio_ops }, 195 .dev = { .platform_data = &mst_audio_ops },
191}; 196};
192 197
198static struct resource flash_resources[] = {
199 [0] = {
200 .start = PXA_CS0_PHYS,
201 .end = PXA_CS0_PHYS + SZ_64M - 1,
202 .flags = IORESOURCE_MEM,
203 },
204 [1] = {
205 .start = PXA_CS1_PHYS,
206 .end = PXA_CS1_PHYS + SZ_64M - 1,
207 .flags = IORESOURCE_MEM,
208 },
209};
210
211static struct mtd_partition mainstoneflash0_partitions[] = {
212 {
213 .name = "Bootloader",
214 .size = 0x00040000,
215 .offset = 0,
216 .mask_flags = MTD_WRITEABLE /* force read-only */
217 },{
218 .name = "Kernel",
219 .size = 0x00400000,
220 .offset = 0x00040000,
221 },{
222 .name = "Filesystem",
223 .size = MTDPART_SIZ_FULL,
224 .offset = 0x00440000
225 }
226};
227
228static struct flash_platform_data mst_flash_data[2] = {
229 {
230 .map_name = "cfi_probe",
231 .parts = mainstoneflash0_partitions,
232 .nr_parts = ARRAY_SIZE(mainstoneflash0_partitions),
233 }, {
234 .map_name = "cfi_probe",
235 .parts = NULL,
236 .nr_parts = 0,
237 }
238};
239
240static struct platform_device mst_flash_device[2] = {
241 {
242 .name = "pxa2xx-flash",
243 .id = 0,
244 .dev = {
245 .platform_data = &mst_flash_data[0],
246 },
247 .resource = &flash_resources[0],
248 .num_resources = 1,
249 },
250 {
251 .name = "pxa2xx-flash",
252 .id = 1,
253 .dev = {
254 .platform_data = &mst_flash_data[1],
255 },
256 .resource = &flash_resources[1],
257 .num_resources = 1,
258 },
259};
260
193static void mainstone_backlight_power(int on) 261static void mainstone_backlight_power(int on)
194{ 262{
195 if (on) { 263 if (on) {
@@ -318,16 +386,34 @@ static struct pxaficp_platform_data mainstone_ficp_platform_data = {
318 .transceiver_mode = mainstone_irda_transceiver_mode, 386 .transceiver_mode = mainstone_irda_transceiver_mode,
319}; 387};
320 388
389static struct platform_device *platform_devices[] __initdata = {
390 &smc91x_device,
391 &mst_audio_device,
392 &mst_flash_device[0],
393 &mst_flash_device[1],
394};
395
321static void __init mainstone_init(void) 396static void __init mainstone_init(void)
322{ 397{
398 int SW7 = 0; /* FIXME: get from SCR (Mst doc section 3.2.1.1) */
399
400 mst_flash_data[0].width = (BOOT_DEF & 1) ? 2 : 4;
401 mst_flash_data[1].width = 4;
402
403 /* Compensate for SW7 which swaps the flash banks */
404 mst_flash_data[SW7].name = "processor-flash";
405 mst_flash_data[SW7 ^ 1].name = "mainboard-flash";
406
407 printk(KERN_NOTICE "Mainstone configured to boot from %s\n",
408 mst_flash_data[0].name);
409
323 /* 410 /*
324 * On Mainstone, we route AC97_SYSCLK via GPIO45 to 411 * On Mainstone, we route AC97_SYSCLK via GPIO45 to
325 * the audio daughter card 412 * the audio daughter card
326 */ 413 */
327 pxa_gpio_mode(GPIO45_SYSCLK_AC97_MD); 414 pxa_gpio_mode(GPIO45_SYSCLK_AC97_MD);
328 415
329 platform_device_register(&smc91x_device); 416 platform_add_devices(platform_devices, ARRAY_SIZE(platform_devices));
330 platform_device_register(&mst_audio_device);
331 417
332 /* reading Mainstone's "Virtual Configuration Register" 418 /* reading Mainstone's "Virtual Configuration Register"
333 might be handy to select LCD type here */ 419 might be handy to select LCD type here */
diff --git a/arch/arm/mach-pxa/pm.c b/arch/arm/mach-pxa/pm.c
index ac4dd4336160..f74b9af112dc 100644
--- a/arch/arm/mach-pxa/pm.c
+++ b/arch/arm/mach-pxa/pm.c
@@ -12,6 +12,7 @@
12 */ 12 */
13#include <linux/config.h> 13#include <linux/config.h>
14#include <linux/init.h> 14#include <linux/init.h>
15#include <linux/module.h>
15#include <linux/suspend.h> 16#include <linux/suspend.h>
16#include <linux/errno.h> 17#include <linux/errno.h>
17#include <linux/time.h> 18#include <linux/time.h>
@@ -19,6 +20,7 @@
19#include <asm/hardware.h> 20#include <asm/hardware.h>
20#include <asm/memory.h> 21#include <asm/memory.h>
21#include <asm/system.h> 22#include <asm/system.h>
23#include <asm/arch/pm.h>
22#include <asm/arch/pxa-regs.h> 24#include <asm/arch/pxa-regs.h>
23#include <asm/arch/lubbock.h> 25#include <asm/arch/lubbock.h>
24#include <asm/mach/time.h> 26#include <asm/mach/time.h>
@@ -72,7 +74,7 @@ enum { SLEEP_SAVE_START = 0,
72}; 74};
73 75
74 76
75static int pxa_pm_enter(suspend_state_t state) 77int pxa_pm_enter(suspend_state_t state)
76{ 78{
77 unsigned long sleep_save[SLEEP_SAVE_SIZE]; 79 unsigned long sleep_save[SLEEP_SAVE_SIZE];
78 unsigned long checksum = 0; 80 unsigned long checksum = 0;
@@ -191,6 +193,8 @@ static int pxa_pm_enter(suspend_state_t state)
191 return 0; 193 return 0;
192} 194}
193 195
196EXPORT_SYMBOL_GPL(pxa_pm_enter);
197
194unsigned long sleep_phys_sp(void *sp) 198unsigned long sleep_phys_sp(void *sp)
195{ 199{
196 return virt_to_phys(sp); 200 return virt_to_phys(sp);
@@ -199,21 +203,25 @@ unsigned long sleep_phys_sp(void *sp)
199/* 203/*
200 * Called after processes are frozen, but before we shut down devices. 204 * Called after processes are frozen, but before we shut down devices.
201 */ 205 */
202static int pxa_pm_prepare(suspend_state_t state) 206int pxa_pm_prepare(suspend_state_t state)
203{ 207{
204 extern int pxa_cpu_pm_prepare(suspend_state_t state); 208 extern int pxa_cpu_pm_prepare(suspend_state_t state);
205 209
206 return pxa_cpu_pm_prepare(state); 210 return pxa_cpu_pm_prepare(state);
207} 211}
208 212
213EXPORT_SYMBOL_GPL(pxa_pm_prepare);
214
209/* 215/*
210 * Called after devices are re-setup, but before processes are thawed. 216 * Called after devices are re-setup, but before processes are thawed.
211 */ 217 */
212static int pxa_pm_finish(suspend_state_t state) 218int pxa_pm_finish(suspend_state_t state)
213{ 219{
214 return 0; 220 return 0;
215} 221}
216 222
223EXPORT_SYMBOL_GPL(pxa_pm_finish);
224
217/* 225/*
218 * Set to PM_DISK_FIRMWARE so we can quickly veto suspend-to-disk. 226 * Set to PM_DISK_FIRMWARE so we can quickly veto suspend-to-disk.
219 */ 227 */
@@ -230,4 +238,4 @@ static int __init pxa_pm_init(void)
230 return 0; 238 return 0;
231} 239}
232 240
233late_initcall(pxa_pm_init); 241device_initcall(pxa_pm_init);
diff --git a/arch/arm/mach-pxa/poodle.c b/arch/arm/mach-pxa/poodle.c
index ad6a13f95a62..eef3de26ad37 100644
--- a/arch/arm/mach-pxa/poodle.c
+++ b/arch/arm/mach-pxa/poodle.c
@@ -65,6 +65,27 @@ struct platform_device poodle_scoop_device = {
65 .resource = poodle_scoop_resources, 65 .resource = poodle_scoop_resources,
66}; 66};
67 67
68static void poodle_pcmcia_init(void)
69{
70 /* Setup default state of GPIO outputs
71 before we enable them as outputs. */
72 GPSR(GPIO48_nPOE) = GPIO_bit(GPIO48_nPOE) |
73 GPIO_bit(GPIO49_nPWE) | GPIO_bit(GPIO50_nPIOR) |
74 GPIO_bit(GPIO51_nPIOW) | GPIO_bit(GPIO52_nPCE_1) |
75 GPIO_bit(GPIO53_nPCE_2);
76
77 pxa_gpio_mode(GPIO48_nPOE_MD);
78 pxa_gpio_mode(GPIO49_nPWE_MD);
79 pxa_gpio_mode(GPIO50_nPIOR_MD);
80 pxa_gpio_mode(GPIO51_nPIOW_MD);
81 pxa_gpio_mode(GPIO55_nPREG_MD);
82 pxa_gpio_mode(GPIO56_nPWAIT_MD);
83 pxa_gpio_mode(GPIO57_nIOIS16_MD);
84 pxa_gpio_mode(GPIO52_nPCE_1_MD);
85 pxa_gpio_mode(GPIO53_nPCE_2_MD);
86 pxa_gpio_mode(GPIO54_pSKTSEL_MD);
87}
88
68static struct scoop_pcmcia_dev poodle_pcmcia_scoop[] = { 89static struct scoop_pcmcia_dev poodle_pcmcia_scoop[] = {
69{ 90{
70 .dev = &poodle_scoop_device.dev, 91 .dev = &poodle_scoop_device.dev,
@@ -74,6 +95,14 @@ static struct scoop_pcmcia_dev poodle_pcmcia_scoop[] = {
74}, 95},
75}; 96};
76 97
98static struct scoop_pcmcia_config poodle_pcmcia_config = {
99 .devs = &poodle_pcmcia_scoop[0],
100 .num_devs = 1,
101 .pcmcia_init = poodle_pcmcia_init,
102};
103
104EXPORT_SYMBOL(poodle_scoop_device);
105
77 106
78/* LoCoMo device */ 107/* LoCoMo device */
79static struct resource locomo_resources[] = { 108static struct resource locomo_resources[] = {
@@ -268,8 +297,7 @@ static void __init poodle_init(void)
268 pxa_set_mci_info(&poodle_mci_platform_data); 297 pxa_set_mci_info(&poodle_mci_platform_data);
269 pxa_set_ficp_info(&poodle_ficp_platform_data); 298 pxa_set_ficp_info(&poodle_ficp_platform_data);
270 299
271 scoop_num = 1; 300 platform_scoop_config = &poodle_pcmcia_config;
272 scoop_devs = &poodle_pcmcia_scoop[0];
273 301
274 ret = platform_add_devices(devices, ARRAY_SIZE(devices)); 302 ret = platform_add_devices(devices, ARRAY_SIZE(devices));
275 if (ret) { 303 if (ret) {
diff --git a/arch/arm/mach-pxa/spitz.c b/arch/arm/mach-pxa/spitz.c
index 6c6878cd2207..4e9a699ee428 100644
--- a/arch/arm/mach-pxa/spitz.c
+++ b/arch/arm/mach-pxa/spitz.c
@@ -104,6 +104,66 @@ struct platform_device spitzscoop2_device = {
104 .resource = spitz_scoop2_resources, 104 .resource = spitz_scoop2_resources,
105}; 105};
106 106
107#define SPITZ_PWR_SD 0x01
108#define SPITZ_PWR_CF 0x02
109
110/* Power control is shared with between one of the CF slots and SD */
111static void spitz_card_pwr_ctrl(int device, unsigned short new_cpr)
112{
113 unsigned short cpr = read_scoop_reg(&spitzscoop_device.dev, SCOOP_CPR);
114
115 if (new_cpr & 0x0007) {
116 set_scoop_gpio(&spitzscoop_device.dev, SPITZ_SCP_CF_POWER);
117 if (!(cpr & 0x0002) && !(cpr & 0x0004))
118 mdelay(5);
119 if (device == SPITZ_PWR_CF)
120 cpr |= 0x0002;
121 if (device == SPITZ_PWR_SD)
122 cpr |= 0x0004;
123 write_scoop_reg(&spitzscoop_device.dev, SCOOP_CPR, cpr | new_cpr);
124 } else {
125 if (device == SPITZ_PWR_CF)
126 cpr &= ~0x0002;
127 if (device == SPITZ_PWR_SD)
128 cpr &= ~0x0004;
129 write_scoop_reg(&spitzscoop_device.dev, SCOOP_CPR, cpr | new_cpr);
130 if (!(cpr & 0x0002) && !(cpr & 0x0004)) {
131 mdelay(1);
132 reset_scoop_gpio(&spitzscoop_device.dev, SPITZ_SCP_CF_POWER);
133 }
134 }
135}
136
137static void spitz_pcmcia_init(void)
138{
139 /* Setup default state of GPIO outputs
140 before we enable them as outputs. */
141 GPSR(GPIO48_nPOE) = GPIO_bit(GPIO48_nPOE) |
142 GPIO_bit(GPIO49_nPWE) | GPIO_bit(GPIO50_nPIOR) |
143 GPIO_bit(GPIO51_nPIOW) | GPIO_bit(GPIO54_nPCE_2);
144 GPSR(GPIO85_nPCE_1) = GPIO_bit(GPIO85_nPCE_1);
145
146 pxa_gpio_mode(GPIO48_nPOE_MD);
147 pxa_gpio_mode(GPIO49_nPWE_MD);
148 pxa_gpio_mode(GPIO50_nPIOR_MD);
149 pxa_gpio_mode(GPIO51_nPIOW_MD);
150 pxa_gpio_mode(GPIO55_nPREG_MD);
151 pxa_gpio_mode(GPIO56_nPWAIT_MD);
152 pxa_gpio_mode(GPIO57_nIOIS16_MD);
153 pxa_gpio_mode(GPIO85_nPCE_1_MD);
154 pxa_gpio_mode(GPIO54_nPCE_2_MD);
155 pxa_gpio_mode(GPIO104_pSKTSEL_MD);
156}
157
158static void spitz_pcmcia_pwr(struct device *scoop, unsigned short cpr, int nr)
159{
160 /* Only need to override behaviour for slot 0 */
161 if (nr == 0)
162 spitz_card_pwr_ctrl(SPITZ_PWR_CF, cpr);
163 else
164 write_scoop_reg(scoop, SCOOP_CPR, cpr);
165}
166
107static struct scoop_pcmcia_dev spitz_pcmcia_scoop[] = { 167static struct scoop_pcmcia_dev spitz_pcmcia_scoop[] = {
108{ 168{
109 .dev = &spitzscoop_device.dev, 169 .dev = &spitzscoop_device.dev,
@@ -117,6 +177,16 @@ static struct scoop_pcmcia_dev spitz_pcmcia_scoop[] = {
117}, 177},
118}; 178};
119 179
180static struct scoop_pcmcia_config spitz_pcmcia_config = {
181 .devs = &spitz_pcmcia_scoop[0],
182 .num_devs = 2,
183 .pcmcia_init = spitz_pcmcia_init,
184 .power_ctrl = spitz_pcmcia_pwr,
185};
186
187EXPORT_SYMBOL(spitzscoop_device);
188EXPORT_SYMBOL(spitzscoop2_device);
189
120 190
121/* 191/*
122 * Spitz SSP Device 192 * Spitz SSP Device
@@ -235,27 +305,14 @@ static int spitz_mci_init(struct device *dev, irqreturn_t (*spitz_detect_int)(in
235 return 0; 305 return 0;
236} 306}
237 307
238/* Power control is shared with one of the CF slots so we have a mess */
239static void spitz_mci_setpower(struct device *dev, unsigned int vdd) 308static void spitz_mci_setpower(struct device *dev, unsigned int vdd)
240{ 309{
241 struct pxamci_platform_data* p_d = dev->platform_data; 310 struct pxamci_platform_data* p_d = dev->platform_data;
242 311
243 unsigned short cpr = read_scoop_reg(&spitzscoop_device.dev, SCOOP_CPR); 312 if (( 1 << vdd) & p_d->ocr_mask)
244 313 spitz_card_pwr_ctrl(SPITZ_PWR_SD, 0x0004);
245 if (( 1 << vdd) & p_d->ocr_mask) { 314 else
246 /* printk(KERN_DEBUG "%s: on\n", __FUNCTION__); */ 315 spitz_card_pwr_ctrl(SPITZ_PWR_SD, 0x0000);
247 set_scoop_gpio(&spitzscoop_device.dev, SPITZ_SCP_CF_POWER);
248 mdelay(2);
249 write_scoop_reg(&spitzscoop_device.dev, SCOOP_CPR, cpr | 0x04);
250 } else {
251 /* printk(KERN_DEBUG "%s: off\n", __FUNCTION__); */
252 write_scoop_reg(&spitzscoop_device.dev, SCOOP_CPR, cpr & ~0x04);
253
254 if (!(cpr | 0x02)) {
255 mdelay(1);
256 reset_scoop_gpio(&spitzscoop_device.dev, SPITZ_SCP_CF_POWER);
257 }
258 }
259} 316}
260 317
261static int spitz_mci_get_ro(struct device *dev) 318static int spitz_mci_get_ro(struct device *dev)
@@ -351,8 +408,8 @@ static void __init common_init(void)
351 408
352static void __init spitz_init(void) 409static void __init spitz_init(void)
353{ 410{
354 scoop_num = 2; 411 platform_scoop_config = &spitz_pcmcia_config;
355 scoop_devs = &spitz_pcmcia_scoop[0]; 412
356 spitz_bl_machinfo.set_bl_intensity = spitz_bl_set_intensity; 413 spitz_bl_machinfo.set_bl_intensity = spitz_bl_set_intensity;
357 414
358 common_init(); 415 common_init();
diff --git a/arch/arm/mach-pxa/time.c b/arch/arm/mach-pxa/time.c
index 7dad3f1465e0..b9b2057349eb 100644
--- a/arch/arm/mach-pxa/time.c
+++ b/arch/arm/mach-pxa/time.c
@@ -132,11 +132,13 @@ static void __init pxa_timer_init(void)
132 tv.tv_sec = pxa_get_rtc_time(); 132 tv.tv_sec = pxa_get_rtc_time();
133 do_settimeofday(&tv); 133 do_settimeofday(&tv);
134 134
135 OSMR0 = 0; /* set initial match at 0 */ 135 OIER = 0; /* disable any timer interrupts */
136 OSCR = LATCH*2; /* push OSCR out of the way */
137 OSMR0 = LATCH; /* set initial match */
136 OSSR = 0xf; /* clear status on all timers */ 138 OSSR = 0xf; /* clear status on all timers */
137 setup_irq(IRQ_OST0, &pxa_timer_irq); 139 setup_irq(IRQ_OST0, &pxa_timer_irq);
138 OIER |= OIER_E0; /* enable match on timer 0 to cause interrupts */ 140 OIER = OIER_E0; /* enable match on timer 0 to cause interrupts */
139 OSCR = 0; /* initialize free-running timer, force first match */ 141 OSCR = 0; /* initialize free-running timer */
140} 142}
141 143
142#ifdef CONFIG_NO_IDLE_HZ 144#ifdef CONFIG_NO_IDLE_HZ
diff --git a/arch/arm/mach-pxa/tosa.c b/arch/arm/mach-pxa/tosa.c
new file mode 100644
index 000000000000..c312054dfb88
--- /dev/null
+++ b/arch/arm/mach-pxa/tosa.c
@@ -0,0 +1,306 @@
1/*
2 * Support for Sharp SL-C6000x PDAs
3 * Model: (Tosa)
4 *
5 * Copyright (c) 2005 Dirk Opfer
6 *
7 * Based on code written by Sharp/Lineo for 2.4 kernels
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 version 2 as
11 * published by the Free Software Foundation.
12 *
13 */
14
15#include <linux/kernel.h>
16#include <linux/init.h>
17#include <linux/device.h>
18#include <linux/major.h>
19#include <linux/fs.h>
20#include <linux/interrupt.h>
21#include <linux/mmc/host.h>
22
23#include <asm/setup.h>
24#include <asm/memory.h>
25#include <asm/mach-types.h>
26#include <asm/hardware.h>
27#include <asm/irq.h>
28#include <asm/arch/irda.h>
29#include <asm/arch/mmc.h>
30#include <asm/arch/udc.h>
31
32#include <asm/mach/arch.h>
33#include <asm/mach/map.h>
34#include <asm/mach/irq.h>
35
36#include <asm/arch/pxa-regs.h>
37#include <asm/arch/irq.h>
38#include <asm/arch/tosa.h>
39
40#include <asm/hardware/scoop.h>
41#include <asm/mach/sharpsl_param.h>
42
43#include "generic.h"
44
45
46/*
47 * SCOOP Device
48 */
49static struct resource tosa_scoop_resources[] = {
50 [0] = {
51 .start = TOSA_CF_PHYS,
52 .end = TOSA_CF_PHYS + 0xfff,
53 .flags = IORESOURCE_MEM,
54 },
55};
56
57static struct scoop_config tosa_scoop_setup = {
58 .io_dir = TOSA_SCOOP_IO_DIR,
59 .io_out = TOSA_SCOOP_IO_OUT,
60
61};
62
63struct platform_device tosascoop_device = {
64 .name = "sharp-scoop",
65 .id = 0,
66 .dev = {
67 .platform_data = &tosa_scoop_setup,
68 },
69 .num_resources = ARRAY_SIZE(tosa_scoop_resources),
70 .resource = tosa_scoop_resources,
71};
72
73
74/*
75 * SCOOP Device Jacket
76 */
77static struct resource tosa_scoop_jc_resources[] = {
78 [0] = {
79 .start = TOSA_SCOOP_PHYS + 0x40,
80 .end = TOSA_SCOOP_PHYS + 0xfff,
81 .flags = IORESOURCE_MEM,
82 },
83};
84
85static struct scoop_config tosa_scoop_jc_setup = {
86 .io_dir = TOSA_SCOOP_JC_IO_DIR,
87 .io_out = TOSA_SCOOP_JC_IO_OUT,
88};
89
90struct platform_device tosascoop_jc_device = {
91 .name = "sharp-scoop",
92 .id = 1,
93 .dev = {
94 .platform_data = &tosa_scoop_jc_setup,
95 .parent = &tosascoop_device.dev,
96 },
97 .num_resources = ARRAY_SIZE(tosa_scoop_jc_resources),
98 .resource = tosa_scoop_jc_resources,
99};
100
101/*
102 * PCMCIA
103 */
104static struct scoop_pcmcia_dev tosa_pcmcia_scoop[] = {
105{
106 .dev = &tosascoop_device.dev,
107 .irq = TOSA_IRQ_GPIO_CF_IRQ,
108 .cd_irq = TOSA_IRQ_GPIO_CF_CD,
109 .cd_irq_str = "PCMCIA0 CD",
110},{
111 .dev = &tosascoop_jc_device.dev,
112 .irq = TOSA_IRQ_GPIO_JC_CF_IRQ,
113 .cd_irq = -1,
114},
115};
116
117static void tosa_pcmcia_init(void)
118{
119 /* Setup default state of GPIO outputs
120 before we enable them as outputs. */
121 GPSR(GPIO48_nPOE) = GPIO_bit(GPIO48_nPOE) |
122 GPIO_bit(GPIO49_nPWE) | GPIO_bit(GPIO50_nPIOR) |
123 GPIO_bit(GPIO51_nPIOW) | GPIO_bit(GPIO52_nPCE_1) |
124 GPIO_bit(GPIO53_nPCE_2);
125
126 pxa_gpio_mode(GPIO48_nPOE_MD);
127 pxa_gpio_mode(GPIO49_nPWE_MD);
128 pxa_gpio_mode(GPIO50_nPIOR_MD);
129 pxa_gpio_mode(GPIO51_nPIOW_MD);
130 pxa_gpio_mode(GPIO55_nPREG_MD);
131 pxa_gpio_mode(GPIO56_nPWAIT_MD);
132 pxa_gpio_mode(GPIO57_nIOIS16_MD);
133 pxa_gpio_mode(GPIO52_nPCE_1_MD);
134 pxa_gpio_mode(GPIO53_nPCE_2_MD);
135 pxa_gpio_mode(GPIO54_pSKTSEL_MD);
136}
137
138static struct scoop_pcmcia_config tosa_pcmcia_config = {
139 .devs = &tosa_pcmcia_scoop[0],
140 .num_devs = 2,
141 .pcmcia_init = tosa_pcmcia_init,
142};
143
144/*
145 * USB Device Controller
146 */
147static void tosa_udc_command(int cmd)
148{
149 switch(cmd) {
150 case PXA2XX_UDC_CMD_CONNECT:
151 set_scoop_gpio(&tosascoop_jc_device.dev,TOSA_SCOOP_JC_USB_PULLUP);
152 break;
153 case PXA2XX_UDC_CMD_DISCONNECT:
154 reset_scoop_gpio(&tosascoop_jc_device.dev,TOSA_SCOOP_JC_USB_PULLUP);
155 break;
156 }
157}
158
159static int tosa_udc_is_connected(void)
160{
161 return ((GPLR(TOSA_GPIO_USB_IN) & GPIO_bit(TOSA_GPIO_USB_IN)) == 0);
162}
163
164
165static struct pxa2xx_udc_mach_info udc_info __initdata = {
166 .udc_command = tosa_udc_command,
167 .udc_is_connected = tosa_udc_is_connected,
168};
169
170/*
171 * MMC/SD Device
172 */
173static struct pxamci_platform_data tosa_mci_platform_data;
174
175static int tosa_mci_init(struct device *dev, irqreturn_t (*tosa_detect_int)(int, void *, struct pt_regs *), void *data)
176{
177 int err;
178
179 /* setup GPIO for PXA25x MMC controller */
180 pxa_gpio_mode(GPIO6_MMCCLK_MD);
181 pxa_gpio_mode(GPIO8_MMCCS0_MD);
182 pxa_gpio_mode(TOSA_GPIO_nSD_DETECT | GPIO_IN);
183
184 tosa_mci_platform_data.detect_delay = msecs_to_jiffies(250);
185
186 err = request_irq(TOSA_IRQ_GPIO_nSD_DETECT, tosa_detect_int, SA_INTERRUPT,
187 "MMC/SD card detect", data);
188 if (err) {
189 printk(KERN_ERR "tosa_mci_init: MMC/SD: can't request MMC card detect IRQ\n");
190 return -1;
191 }
192
193 set_irq_type(TOSA_IRQ_GPIO_nSD_DETECT, IRQT_BOTHEDGE);
194
195 return 0;
196}
197
198static void tosa_mci_setpower(struct device *dev, unsigned int vdd)
199{
200 struct pxamci_platform_data* p_d = dev->platform_data;
201
202 if (( 1 << vdd) & p_d->ocr_mask) {
203 set_scoop_gpio(&tosascoop_device.dev,TOSA_SCOOP_PWR_ON);
204 } else {
205 reset_scoop_gpio(&tosascoop_device.dev,TOSA_SCOOP_PWR_ON);
206 }
207}
208
209static int tosa_mci_get_ro(struct device *dev)
210{
211 return (read_scoop_reg(&tosascoop_device.dev, SCOOP_GPWR)&TOSA_SCOOP_SD_WP);
212}
213
214static void tosa_mci_exit(struct device *dev, void *data)
215{
216 free_irq(TOSA_IRQ_GPIO_nSD_DETECT, data);
217}
218
219static struct pxamci_platform_data tosa_mci_platform_data = {
220 .ocr_mask = MMC_VDD_32_33|MMC_VDD_33_34,
221 .init = tosa_mci_init,
222 .get_ro = tosa_mci_get_ro,
223 .setpower = tosa_mci_setpower,
224 .exit = tosa_mci_exit,
225};
226
227/*
228 * Irda
229 */
230static void tosa_irda_transceiver_mode(struct device *dev, int mode)
231{
232 if (mode & IR_OFF) {
233 reset_scoop_gpio(&tosascoop_device.dev,TOSA_SCOOP_IR_POWERDWN);
234 pxa_gpio_mode(GPIO47_STTXD|GPIO_DFLT_LOW);
235 pxa_gpio_mode(GPIO47_STTXD|GPIO_OUT);
236 } else {
237 pxa_gpio_mode(GPIO47_STTXD_MD);
238 set_scoop_gpio(&tosascoop_device.dev,TOSA_SCOOP_IR_POWERDWN);
239 }
240}
241
242static struct pxaficp_platform_data tosa_ficp_platform_data = {
243 .transceiver_cap = IR_SIRMODE | IR_OFF,
244 .transceiver_mode = tosa_irda_transceiver_mode,
245};
246
247/*
248 * Tosa Keyboard
249 */
250static struct platform_device tosakbd_device = {
251 .name = "tosa-keyboard",
252 .id = -1,
253};
254
255static struct platform_device *devices[] __initdata = {
256 &tosascoop_device,
257 &tosascoop_jc_device,
258 &tosakbd_device,
259};
260
261static void __init tosa_init(void)
262{
263 pxa_gpio_mode(TOSA_GPIO_ON_RESET | GPIO_IN);
264 pxa_gpio_mode(TOSA_GPIO_TC6393_INT | GPIO_IN);
265 pxa_gpio_mode(TOSA_GPIO_USB_IN | GPIO_IN);
266
267 /* setup sleep mode values */
268 PWER = 0x00000002;
269 PFER = 0x00000000;
270 PRER = 0x00000002;
271 PGSR0 = 0x00000000;
272 PGSR1 = 0x00FF0002;
273 PGSR2 = 0x00014000;
274 PCFR |= PCFR_OPDE;
275
276 /* enable batt_fault */
277 PMCR = 0x01;
278
279 pxa_set_mci_info(&tosa_mci_platform_data);
280 pxa_set_udc_info(&udc_info);
281 pxa_set_ficp_info(&tosa_ficp_platform_data);
282 platform_scoop_config = &tosa_pcmcia_config;
283
284 platform_add_devices(devices, ARRAY_SIZE(devices));
285}
286
287static void __init fixup_tosa(struct machine_desc *desc,
288 struct tag *tags, char **cmdline, struct meminfo *mi)
289{
290 sharpsl_save_param();
291 mi->nr_banks=1;
292 mi->bank[0].start = 0xa0000000;
293 mi->bank[0].node = 0;
294 mi->bank[0].size = (64*1024*1024);
295}
296
297MACHINE_START(TOSA, "SHARP Tosa")
298 .phys_ram = 0xa0000000,
299 .phys_io = 0x40000000,
300 .io_pg_offst = (io_p2v(0x40000000) >> 18) & 0xfffc,
301 .fixup = fixup_tosa,
302 .map_io = pxa_map_io,
303 .init_irq = pxa_init_irq,
304 .init_machine = tosa_init,
305 .timer = &pxa_timer,
306MACHINE_END
diff --git a/arch/arm/mach-realview/Kconfig b/arch/arm/mach-realview/Kconfig
index 4b63dc9eabfe..129976866d47 100644
--- a/arch/arm/mach-realview/Kconfig
+++ b/arch/arm/mach-realview/Kconfig
@@ -8,4 +8,13 @@ config MACH_REALVIEW_EB
8 help 8 help
9 Include support for the ARM(R) RealView Emulation Baseboard platform. 9 Include support for the ARM(R) RealView Emulation Baseboard platform.
10 10
11config REALVIEW_MPCORE
12 bool "Support MPcore tile"
13 depends on MACH_REALVIEW_EB
14 help
15 Enable support for the MPCore tile on the Realview platform.
16 Since there are device address and interrupt differences, a
17 kernel built with this option enabled is not compatible with
18 other tiles.
19
11endmenu 20endmenu
diff --git a/arch/arm/mach-realview/Makefile b/arch/arm/mach-realview/Makefile
index 8d37ea1605fd..36e76ba937fc 100644
--- a/arch/arm/mach-realview/Makefile
+++ b/arch/arm/mach-realview/Makefile
@@ -4,3 +4,6 @@
4 4
5obj-y := core.o clock.o 5obj-y := core.o clock.o
6obj-$(CONFIG_MACH_REALVIEW_EB) += realview_eb.o 6obj-$(CONFIG_MACH_REALVIEW_EB) += realview_eb.o
7obj-$(CONFIG_SMP) += platsmp.o headsmp.o
8obj-$(CONFIG_HOTPLUG_CPU) += hotplug.o
9obj-$(CONFIG_LOCAL_TIMERS) += localtimer.o
diff --git a/arch/arm/mach-realview/core.c b/arch/arm/mach-realview/core.c
index 482eb512ebe8..e2c6fa23d3cd 100644
--- a/arch/arm/mach-realview/core.c
+++ b/arch/arm/mach-realview/core.c
@@ -550,6 +550,11 @@ static irqreturn_t realview_timer_interrupt(int irq, void *dev_id, struct pt_reg
550 550
551 timer_tick(regs); 551 timer_tick(regs);
552 552
553#if defined(CONFIG_SMP) && !defined(CONFIG_LOCAL_TIMERS)
554 smp_send_timer();
555 update_process_times(user_mode(regs));
556#endif
557
553 write_sequnlock(&xtime_lock); 558 write_sequnlock(&xtime_lock);
554 559
555 return IRQ_HANDLED; 560 return IRQ_HANDLED;
diff --git a/arch/arm/mach-realview/core.h b/arch/arm/mach-realview/core.h
index 575599db74db..d83e8bad2038 100644
--- a/arch/arm/mach-realview/core.h
+++ b/arch/arm/mach-realview/core.h
@@ -23,6 +23,7 @@
23#define __ASM_ARCH_REALVIEW_H 23#define __ASM_ARCH_REALVIEW_H
24 24
25#include <asm/hardware/amba.h> 25#include <asm/hardware/amba.h>
26#include <asm/leds.h>
26#include <asm/io.h> 27#include <asm/io.h>
27 28
28#define __io_address(n) __io(IO_ADDRESS(n)) 29#define __io_address(n) __io(IO_ADDRESS(n))
diff --git a/arch/arm/mach-realview/headsmp.S b/arch/arm/mach-realview/headsmp.S
new file mode 100644
index 000000000000..4075473cf68a
--- /dev/null
+++ b/arch/arm/mach-realview/headsmp.S
@@ -0,0 +1,39 @@
1/*
2 * linux/arch/arm/mach-realview/headsmp.S
3 *
4 * Copyright (c) 2003 ARM Limited
5 * All Rights Reserved
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License version 2 as
9 * published by the Free Software Foundation.
10 */
11#include <linux/linkage.h>
12#include <linux/init.h>
13
14 __INIT
15
16/*
17 * Realview specific entry point for secondary CPUs. This provides
18 * a "holding pen" into which all secondary cores are held until we're
19 * ready for them to initialise.
20 */
21ENTRY(realview_secondary_startup)
22 mrc p15, 0, r0, c0, c0, 5
23 and r0, r0, #15
24 adr r4, 1f
25 ldmia r4, {r5, r6}
26 sub r4, r4, r5
27 add r6, r6, r4
28pen: ldr r7, [r6]
29 cmp r7, r0
30 bne pen
31
32 /*
33 * we've been released from the holding pen: secondary_stack
34 * should now contain the SVC stack for this core
35 */
36 b secondary_startup
37
381: .long .
39 .long pen_release
diff --git a/arch/arm/mach-realview/hotplug.c b/arch/arm/mach-realview/hotplug.c
new file mode 100644
index 000000000000..09748cbcd10e
--- /dev/null
+++ b/arch/arm/mach-realview/hotplug.c
@@ -0,0 +1,138 @@
1/*
2 * linux/arch/arm/mach-realview/hotplug.c
3 *
4 * Copyright (C) 2002 ARM Ltd.
5 * All Rights Reserved
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License version 2 as
9 * published by the Free Software Foundation.
10 */
11#include <linux/kernel.h>
12#include <linux/errno.h>
13#include <linux/smp.h>
14#include <linux/completion.h>
15
16extern volatile int pen_release;
17
18static DECLARE_COMPLETION(cpu_killed);
19
20static inline void cpu_enter_lowpower(void)
21{
22 unsigned int v;
23
24 asm volatile( "mcr p15, 0, %1, c7, c14, 0\n"
25 " mcr p15, 0, %1, c7, c5, 0\n"
26 " mcr p15, 0, %1, c7, c10, 4\n"
27 /*
28 * Turn off coherency
29 */
30 " mrc p15, 0, %0, c1, c0, 1\n"
31 " bic %0, %0, #0x20\n"
32 " mcr p15, 0, %0, c1, c0, 1\n"
33 " mrc p15, 0, %0, c1, c0, 0\n"
34 " bic %0, %0, #0x04\n"
35 " mcr p15, 0, %0, c1, c0, 0\n"
36 : "=&r" (v)
37 : "r" (0)
38 : "cc");
39}
40
41static inline void cpu_leave_lowpower(void)
42{
43 unsigned int v;
44
45 asm volatile( "mrc p15, 0, %0, c1, c0, 0\n"
46 " orr %0, %0, #0x04\n"
47 " mcr p15, 0, %0, c1, c0, 0\n"
48 " mrc p15, 0, %0, c1, c0, 1\n"
49 " orr %0, %0, #0x20\n"
50 " mcr p15, 0, %0, c1, c0, 1\n"
51 : "=&r" (v)
52 :
53 : "cc");
54}
55
56static inline void platform_do_lowpower(unsigned int cpu)
57{
58 /*
59 * there is no power-control hardware on this platform, so all
60 * we can do is put the core into WFI; this is safe as the calling
61 * code will have already disabled interrupts
62 */
63 for (;;) {
64 /*
65 * here's the WFI
66 */
67 asm(".word 0xe320f003\n"
68 :
69 :
70 : "memory", "cc");
71
72 if (pen_release == cpu) {
73 /*
74 * OK, proper wakeup, we're done
75 */
76 break;
77 }
78
79 /*
80 * getting here, means that we have come out of WFI without
81 * having been woken up - this shouldn't happen
82 *
83 * The trouble is, letting people know about this is not really
84 * possible, since we are currently running incoherently, and
85 * therefore cannot safely call printk() or anything else
86 */
87#ifdef DEBUG
88 printk("CPU%u: spurious wakeup call\n", cpu);
89#endif
90 }
91}
92
93int platform_cpu_kill(unsigned int cpu)
94{
95 return wait_for_completion_timeout(&cpu_killed, 5000);
96}
97
98/*
99 * platform-specific code to shutdown a CPU
100 *
101 * Called with IRQs disabled
102 */
103void platform_cpu_die(unsigned int cpu)
104{
105#ifdef DEBUG
106 unsigned int this_cpu = hard_smp_processor_id();
107
108 if (cpu != this_cpu) {
109 printk(KERN_CRIT "Eek! platform_cpu_die running on %u, should be %u\n",
110 this_cpu, cpu);
111 BUG();
112 }
113#endif
114
115 printk(KERN_NOTICE "CPU%u: shutdown\n", cpu);
116 complete(&cpu_killed);
117
118 /*
119 * we're ready for shutdown now, so do it
120 */
121 cpu_enter_lowpower();
122 platform_do_lowpower(cpu);
123
124 /*
125 * bring this CPU back into the world of cache
126 * coherency, and then restore interrupts
127 */
128 cpu_leave_lowpower();
129}
130
131int mach_cpu_disable(unsigned int cpu)
132{
133 /*
134 * we don't allow CPU 0 to be shutdown (it is still too special
135 * e.g. clock tick interrupts)
136 */
137 return cpu == 0 ? -EPERM : 0;
138}
diff --git a/arch/arm/mach-realview/localtimer.c b/arch/arm/mach-realview/localtimer.c
new file mode 100644
index 000000000000..5e917e37d095
--- /dev/null
+++ b/arch/arm/mach-realview/localtimer.c
@@ -0,0 +1,130 @@
1/*
2 * linux/arch/arm/mach-realview/localtimer.c
3 *
4 * Copyright (C) 2002 ARM Ltd.
5 * All Rights Reserved
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License version 2 as
9 * published by the Free Software Foundation.
10 */
11#include <linux/init.h>
12#include <linux/kernel.h>
13#include <linux/delay.h>
14#include <linux/device.h>
15#include <linux/smp.h>
16
17#include <asm/mach/time.h>
18#include <asm/hardware/arm_twd.h>
19#include <asm/hardware/gic.h>
20#include <asm/hardware.h>
21#include <asm/io.h>
22#include <asm/irq.h>
23
24#include "core.h"
25
26#define TWD_BASE(cpu) (__io_address(REALVIEW_TWD_BASE) + \
27 ((cpu) * REALVIEW_TWD_SIZE))
28
29static unsigned long mpcore_timer_rate;
30
31/*
32 * local_timer_ack: checks for a local timer interrupt.
33 *
34 * If a local timer interrupt has occured, acknowledge and return 1.
35 * Otherwise, return 0.
36 */
37int local_timer_ack(void)
38{
39 void __iomem *base = TWD_BASE(smp_processor_id());
40
41 if (__raw_readl(base + TWD_TIMER_INTSTAT)) {
42 __raw_writel(1, base + TWD_TIMER_INTSTAT);
43 return 1;
44 }
45
46 return 0;
47}
48
49void __cpuinit local_timer_setup(unsigned int cpu)
50{
51 void __iomem *base = TWD_BASE(cpu);
52 unsigned int load, offset;
53 u64 waitjiffies;
54 unsigned int count;
55
56 /*
57 * If this is the first time round, we need to work out how fast
58 * the timer ticks
59 */
60 if (mpcore_timer_rate == 0) {
61 printk("Calibrating local timer... ");
62
63 /* Wait for a tick to start */
64 waitjiffies = get_jiffies_64() + 1;
65
66 while (get_jiffies_64() < waitjiffies)
67 udelay(10);
68
69 /* OK, now the tick has started, let's get the timer going */
70 waitjiffies += 5;
71
72 /* enable, no interrupt or reload */
73 __raw_writel(0x1, base + TWD_TIMER_CONTROL);
74
75 /* maximum value */
76 __raw_writel(0xFFFFFFFFU, base + TWD_TIMER_COUNTER);
77
78 while (get_jiffies_64() < waitjiffies)
79 udelay(10);
80
81 count = __raw_readl(base + TWD_TIMER_COUNTER);
82
83 mpcore_timer_rate = (0xFFFFFFFFU - count) * (HZ / 5);
84
85 printk("%lu.%02luMHz.\n", mpcore_timer_rate / 1000000,
86 (mpcore_timer_rate / 100000) % 100);
87 }
88
89 load = mpcore_timer_rate / HZ;
90
91 __raw_writel(load, base + TWD_TIMER_LOAD);
92 __raw_writel(0x7, base + TWD_TIMER_CONTROL);
93
94 /*
95 * Now maneuver our local tick into the right part of the jiffy.
96 * Start by working out where within the tick our local timer
97 * interrupt should go.
98 */
99 offset = ((mpcore_timer_rate / HZ) / (NR_CPUS + 1)) * (cpu + 1);
100
101 /*
102 * gettimeoffset() will return a number of us since the last tick.
103 * Convert this number of us to a local timer tick count.
104 * Be careful of integer overflow whilst keeping maximum precision.
105 *
106 * with HZ=100 and 1MHz (fpga) ~ 1GHz processor:
107 * load = 1 ~ 10,000
108 * mpcore_timer_rate/10000 = 100 ~ 100,000
109 *
110 * so the multiply value will be less than 10^9 always.
111 */
112 load = (system_timer->offset() * (mpcore_timer_rate / 10000)) / 100;
113
114 /* Add on our offset to get the load value */
115 load = (load + offset) % (mpcore_timer_rate / HZ);
116
117 __raw_writel(load, base + TWD_TIMER_COUNTER);
118
119 /* Make sure our local interrupt controller has this enabled */
120 __raw_writel(1 << IRQ_LOCALTIMER,
121 __io_address(REALVIEW_GIC_DIST_BASE) + GIC_DIST_ENABLE_SET);
122}
123
124/*
125 * take a local timer down
126 */
127void __cpuexit local_timer_stop(unsigned int cpu)
128{
129 __raw_writel(0, TWD_BASE(cpu) + TWD_TIMER_CONTROL);
130}
diff --git a/arch/arm/mach-realview/platsmp.c b/arch/arm/mach-realview/platsmp.c
new file mode 100644
index 000000000000..0c7d4ac9a7b3
--- /dev/null
+++ b/arch/arm/mach-realview/platsmp.c
@@ -0,0 +1,200 @@
1/*
2 * linux/arch/arm/mach-realview/platsmp.c
3 *
4 * Copyright (C) 2002 ARM Ltd.
5 * All Rights Reserved
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License version 2 as
9 * published by the Free Software Foundation.
10 */
11#include <linux/init.h>
12#include <linux/errno.h>
13#include <linux/delay.h>
14#include <linux/device.h>
15#include <linux/smp.h>
16
17#include <asm/cacheflush.h>
18#include <asm/hardware/arm_scu.h>
19#include <asm/hardware.h>
20
21#include "core.h"
22
23extern void realview_secondary_startup(void);
24
25/*
26 * control for which core is the next to come out of the secondary
27 * boot "holding pen"
28 */
29volatile int __cpuinitdata pen_release = -1;
30
31static unsigned int __init get_core_count(void)
32{
33 unsigned int ncores;
34
35 ncores = __raw_readl(__io_address(REALVIEW_MPCORE_SCU_BASE) + SCU_CONFIG);
36
37 return (ncores & 0x03) + 1;
38}
39
40static DEFINE_SPINLOCK(boot_lock);
41
42void __cpuinit platform_secondary_init(unsigned int cpu)
43{
44 /*
45 * the primary core may have used a "cross call" soft interrupt
46 * to get this processor out of WFI in the BootMonitor - make
47 * sure that we are no longer being sent this soft interrupt
48 */
49 smp_cross_call_done(cpumask_of_cpu(cpu));
50
51 /*
52 * if any interrupts are already enabled for the primary
53 * core (e.g. timer irq), then they will not have been enabled
54 * for us: do so
55 */
56 gic_cpu_init(__io_address(REALVIEW_GIC_CPU_BASE));
57
58 /*
59 * let the primary processor know we're out of the
60 * pen, then head off into the C entry point
61 */
62 pen_release = -1;
63
64 /*
65 * Synchronise with the boot thread.
66 */
67 spin_lock(&boot_lock);
68 spin_unlock(&boot_lock);
69}
70
71int __cpuinit boot_secondary(unsigned int cpu, struct task_struct *idle)
72{
73 unsigned long timeout;
74
75 /*
76 * set synchronisation state between this boot processor
77 * and the secondary one
78 */
79 spin_lock(&boot_lock);
80
81 /*
82 * The secondary processor is waiting to be released from
83 * the holding pen - release it, then wait for it to flag
84 * that it has been released by resetting pen_release.
85 *
86 * Note that "pen_release" is the hardware CPU ID, whereas
87 * "cpu" is Linux's internal ID.
88 */
89 pen_release = cpu;
90 flush_cache_all();
91
92 /*
93 * XXX
94 *
95 * This is a later addition to the booting protocol: the
96 * bootMonitor now puts secondary cores into WFI, so
97 * poke_milo() no longer gets the cores moving; we need
98 * to send a soft interrupt to wake the secondary core.
99 * Use smp_cross_call() for this, since there's little
100 * point duplicating the code here
101 */
102 smp_cross_call(cpumask_of_cpu(cpu));
103
104 timeout = jiffies + (1 * HZ);
105 while (time_before(jiffies, timeout)) {
106 if (pen_release == -1)
107 break;
108
109 udelay(10);
110 }
111
112 /*
113 * now the secondary core is starting up let it run its
114 * calibrations, then wait for it to finish
115 */
116 spin_unlock(&boot_lock);
117
118 return pen_release != -1 ? -ENOSYS : 0;
119}
120
121static void __init poke_milo(void)
122{
123 extern void secondary_startup(void);
124
125 /* nobody is to be released from the pen yet */
126 pen_release = -1;
127
128 /*
129 * write the address of secondary startup into the system-wide
130 * flags register, then clear the bottom two bits, which is what
131 * BootMonitor is waiting for
132 */
133#if 1
134#define REALVIEW_SYS_FLAGSS_OFFSET 0x30
135 __raw_writel(virt_to_phys(realview_secondary_startup),
136 __io_address(REALVIEW_SYS_BASE) +
137 REALVIEW_SYS_FLAGSS_OFFSET);
138#define REALVIEW_SYS_FLAGSC_OFFSET 0x34
139 __raw_writel(3,
140 __io_address(REALVIEW_SYS_BASE) +
141 REALVIEW_SYS_FLAGSC_OFFSET);
142#endif
143
144 mb();
145}
146
147void __init smp_prepare_cpus(unsigned int max_cpus)
148{
149 unsigned int ncores = get_core_count();
150 unsigned int cpu = smp_processor_id();
151 int i;
152
153 /* sanity check */
154 if (ncores == 0) {
155 printk(KERN_ERR
156 "Realview: strange CM count of 0? Default to 1\n");
157
158 ncores = 1;
159 }
160
161 if (ncores > NR_CPUS) {
162 printk(KERN_WARNING
163 "Realview: no. of cores (%d) greater than configured "
164 "maximum of %d - clipping\n",
165 ncores, NR_CPUS);
166 ncores = NR_CPUS;
167 }
168
169 smp_store_cpu_info(cpu);
170
171 /*
172 * are we trying to boot more cores than exist?
173 */
174 if (max_cpus > ncores)
175 max_cpus = ncores;
176
177 /*
178 * Enable the local timer for primary CPU
179 */
180 local_timer_setup(cpu);
181
182 /*
183 * Initialise the possible/present maps.
184 * cpu_possible_map describes the set of CPUs which may be present
185 * cpu_present_map describes the set of CPUs populated
186 */
187 for (i = 0; i < max_cpus; i++) {
188 cpu_set(i, cpu_possible_map);
189 cpu_set(i, cpu_present_map);
190 }
191
192 /*
193 * Do we need any more CPUs? If so, then let them know where
194 * to start. Note that, on modern versions of MILO, the "poke"
195 * doesn't actually do anything until each individual core is
196 * sent a soft interrupt to get it out of WFI
197 */
198 if (max_cpus > 1)
199 poke_milo();
200}
diff --git a/arch/arm/mach-realview/realview_eb.c b/arch/arm/mach-realview/realview_eb.c
index 01b264be5029..7dc32503fdf2 100644
--- a/arch/arm/mach-realview/realview_eb.c
+++ b/arch/arm/mach-realview/realview_eb.c
@@ -43,14 +43,44 @@
43#include "clock.h" 43#include "clock.h"
44 44
45static struct map_desc realview_eb_io_desc[] __initdata = { 45static struct map_desc realview_eb_io_desc[] __initdata = {
46 { IO_ADDRESS(REALVIEW_SYS_BASE), REALVIEW_SYS_BASE, SZ_4K, MT_DEVICE }, 46 {
47 { IO_ADDRESS(REALVIEW_GIC_CPU_BASE), REALVIEW_GIC_CPU_BASE, SZ_4K, MT_DEVICE }, 47 .virtual = IO_ADDRESS(REALVIEW_SYS_BASE),
48 { IO_ADDRESS(REALVIEW_GIC_DIST_BASE), REALVIEW_GIC_DIST_BASE, SZ_4K, MT_DEVICE }, 48 .pfn = __phys_to_pfn(REALVIEW_SYS_BASE),
49 { IO_ADDRESS(REALVIEW_SCTL_BASE), REALVIEW_SCTL_BASE, SZ_4K, MT_DEVICE }, 49 .length = SZ_4K,
50 { IO_ADDRESS(REALVIEW_TIMER0_1_BASE), REALVIEW_TIMER0_1_BASE, SZ_4K, MT_DEVICE }, 50 .type = MT_DEVICE,
51 { IO_ADDRESS(REALVIEW_TIMER2_3_BASE), REALVIEW_TIMER2_3_BASE, SZ_4K, MT_DEVICE }, 51 }, {
52 .virtual = IO_ADDRESS(REALVIEW_GIC_CPU_BASE),
53 .pfn = __phys_to_pfn(REALVIEW_GIC_CPU_BASE),
54 .length = SZ_4K,
55 .type = MT_DEVICE,
56 }, {
57 .virtual = IO_ADDRESS(REALVIEW_GIC_DIST_BASE),
58 .pfn = __phys_to_pfn(REALVIEW_GIC_DIST_BASE),
59 .length = SZ_4K,
60 .type = MT_DEVICE,
61 }, {
62 .virtual = IO_ADDRESS(REALVIEW_SCTL_BASE),
63 .pfn = __phys_to_pfn(REALVIEW_SCTL_BASE),
64 .length = SZ_4K,
65 .type = MT_DEVICE,
66 }, {
67 .virtual = IO_ADDRESS(REALVIEW_TIMER0_1_BASE),
68 .pfn = __phys_to_pfn(REALVIEW_TIMER0_1_BASE),
69 .length = SZ_4K,
70 .type = MT_DEVICE,
71 }, {
72 .virtual = IO_ADDRESS(REALVIEW_TIMER2_3_BASE),
73 .pfn = __phys_to_pfn(REALVIEW_TIMER2_3_BASE),
74 .length = SZ_4K,
75 .type = MT_DEVICE,
76 },
52#ifdef CONFIG_DEBUG_LL 77#ifdef CONFIG_DEBUG_LL
53 { IO_ADDRESS(REALVIEW_UART0_BASE), REALVIEW_UART0_BASE, SZ_4K, MT_DEVICE }, 78 {
79 .virtual = IO_ADDRESS(REALVIEW_UART0_BASE),
80 .pfn = __phys_to_pfn(REALVIEW_UART0_BASE),
81 .length = SZ_4K,
82 .type = MT_DEVICE,
83 }
54#endif 84#endif
55}; 85};
56 86
@@ -106,6 +136,11 @@ static struct amba_device *amba_devs[] __initdata = {
106 136
107static void __init gic_init_irq(void) 137static void __init gic_init_irq(void)
108{ 138{
139#ifdef CONFIG_REALVIEW_MPCORE
140 writel(0x0000a05f, __io_address(REALVIEW_SYS_LOCK));
141 writel(0x008003c0, __io_address(REALVIEW_SYS_BASE) + 0xd8);
142 writel(0x00000000, __io_address(REALVIEW_SYS_LOCK));
143#endif
109 gic_dist_init(__io_address(REALVIEW_GIC_DIST_BASE)); 144 gic_dist_init(__io_address(REALVIEW_GIC_DIST_BASE));
110 gic_cpu_init(__io_address(REALVIEW_GIC_CPU_BASE)); 145 gic_cpu_init(__io_address(REALVIEW_GIC_CPU_BASE));
111} 146}
diff --git a/arch/arm/mach-s3c2410/Kconfig b/arch/arm/mach-s3c2410/Kconfig
index c796bcdd6158..0b9d7ca49ec1 100644
--- a/arch/arm/mach-s3c2410/Kconfig
+++ b/arch/arm/mach-s3c2410/Kconfig
@@ -121,6 +121,14 @@ config S3C2410_BOOT_WATCHDOG
121 system resets depends on the value of PCLK. The timeout on an 121 system resets depends on the value of PCLK. The timeout on an
122 200MHz s3c2410 should be about 30 seconds. 122 200MHz s3c2410 should be about 30 seconds.
123 123
124config S3C2410_BOOT_ERROR_RESET
125 bool "S3C2410 Reboot on decompression error"
126 depends on ARCH_S3C2410
127 help
128 Say y here to use the watchdog to reset the system if the
129 kernel decompressor detects an error during decompression.
130
131
124comment "S3C2410 Setup" 132comment "S3C2410 Setup"
125 133
126config S3C2410_DMA 134config S3C2410_DMA
diff --git a/arch/arm/mach-s3c2410/mach-anubis.c b/arch/arm/mach-s3c2410/mach-anubis.c
index 8390b685c2b6..0f81fc0c2f7f 100644
--- a/arch/arm/mach-s3c2410/mach-anubis.c
+++ b/arch/arm/mach-s3c2410/mach-anubis.c
@@ -56,8 +56,16 @@
56static struct map_desc anubis_iodesc[] __initdata = { 56static struct map_desc anubis_iodesc[] __initdata = {
57 /* ISA IO areas */ 57 /* ISA IO areas */
58 58
59 { (u32)S3C24XX_VA_ISA_BYTE, 0x0, SZ_16M, MT_DEVICE }, 59 {
60 { (u32)S3C24XX_VA_ISA_WORD, 0x0, SZ_16M, MT_DEVICE }, 60 .virtual = (u32)S3C24XX_VA_ISA_BYTE,
61 .pfn = __phys_to_pfn(0x0),
62 .length = SZ_4M,
63 .type = MT_DEVICE
64 }, {
65 .virtual = (u32)S3C24XX_VA_ISA_WORD,
66 .pfn = __phys_to_pfn(0x0),
67 .length = SZ_4M, MT_DEVICE
68 },
61 69
62 /* we could possibly compress the next set down into a set of smaller tables 70 /* we could possibly compress the next set down into a set of smaller tables
63 * pagetables, but that would mean using an L2 section, and it still means 71 * pagetables, but that would mean using an L2 section, and it still means
@@ -66,16 +74,41 @@ static struct map_desc anubis_iodesc[] __initdata = {
66 74
67 /* CPLD control registers */ 75 /* CPLD control registers */
68 76
69 { (u32)ANUBIS_VA_CTRL1, ANUBIS_PA_CTRL1, SZ_4K, MT_DEVICE }, 77 {
70 { (u32)ANUBIS_VA_CTRL2, ANUBIS_PA_CTRL2, SZ_4K, MT_DEVICE }, 78 .virtual = (u32)ANUBIS_VA_CTRL1,
79 .pfn = __phys_to_pfn(ANUBIS_PA_CTRL1),
80 .length = SZ_4K,
81 .type = MT_DEVICE
82 }, {
83 .virtual = (u32)ANUBIS_VA_CTRL2,
84 .pfn = __phys_to_pfn(ANUBIS_PA_CTRL2),
85 .length = SZ_4K,
86 .type =MT_DEVICE
87 },
71 88
72 /* IDE drives */ 89 /* IDE drives */
73 90
74 { (u32)ANUBIS_IDEPRI, S3C2410_CS3, SZ_1M, MT_DEVICE }, 91 {
75 { (u32)ANUBIS_IDEPRIAUX, S3C2410_CS3+(1<<26), SZ_1M, MT_DEVICE }, 92 .virtual = (u32)ANUBIS_IDEPRI,
76 93 .pfn = __phys_to_pfn(S3C2410_CS3),
77 { (u32)ANUBIS_IDESEC, S3C2410_CS4, SZ_1M, MT_DEVICE }, 94 .length = SZ_1M,
78 { (u32)ANUBIS_IDESECAUX, S3C2410_CS4+(1<<26), SZ_1M, MT_DEVICE }, 95 .type = MT_DEVICE
96 }, {
97 .virtual = (u32)ANUBIS_IDEPRIAUX,
98 .pfn = __phys_to_pfn(S3C2410_CS3+(1<<26)),
99 .length = SZ_1M,
100 .type = MT_DEVICE
101 }, {
102 .virtual = (u32)ANUBIS_IDESEC,
103 .pfn = __phys_to_pfn(S3C2410_CS4),
104 .length = SZ_1M,
105 .type = MT_DEVICE
106 }, {
107 .virtual = (u32)ANUBIS_IDESECAUX,
108 .pfn = __phys_to_pfn(S3C2410_CS4+(1<<26)),
109 .length = SZ_1M,
110 .type = MT_DEVICE
111 },
79}; 112};
80 113
81#define UCON S3C2410_UCON_DEFAULT | S3C2410_UCON_UCLK 114#define UCON S3C2410_UCON_DEFAULT | S3C2410_UCON_UCLK
diff --git a/arch/arm/mach-s3c2410/mach-bast.c b/arch/arm/mach-s3c2410/mach-bast.c
index 0b71c896bbd1..1be2567a7486 100644
--- a/arch/arm/mach-s3c2410/mach-bast.c
+++ b/arch/arm/mach-s3c2410/mach-bast.c
@@ -89,32 +89,63 @@
89 89
90/* macros to modify the physical addresses for io space */ 90/* macros to modify the physical addresses for io space */
91 91
92#define PA_CS2(item) ((item) + S3C2410_CS2) 92#define PA_CS2(item) (__phys_to_pfn((item) + S3C2410_CS2))
93#define PA_CS3(item) ((item) + S3C2410_CS3) 93#define PA_CS3(item) (__phys_to_pfn((item) + S3C2410_CS3))
94#define PA_CS4(item) ((item) + S3C2410_CS4) 94#define PA_CS4(item) (__phys_to_pfn((item) + S3C2410_CS4))
95#define PA_CS5(item) ((item) + S3C2410_CS5) 95#define PA_CS5(item) (__phys_to_pfn((item) + S3C2410_CS5))
96 96
97static struct map_desc bast_iodesc[] __initdata = { 97static struct map_desc bast_iodesc[] __initdata = {
98 /* ISA IO areas */ 98 /* ISA IO areas */
99 99 {
100 { (u32)S3C24XX_VA_ISA_BYTE, PA_CS2(BAST_PA_ISAIO), SZ_16M, MT_DEVICE }, 100 .virtual = (u32)S3C24XX_VA_ISA_BYTE,
101 { (u32)S3C24XX_VA_ISA_WORD, PA_CS3(BAST_PA_ISAIO), SZ_16M, MT_DEVICE }, 101 .pfn = PA_CS2(BAST_PA_ISAIO),
102 102 .length = SZ_16M,
103 /* we could possibly compress the next set down into a set of smaller tables 103 .type = MT_DEVICE,
104 * pagetables, but that would mean using an L2 section, and it still means 104 }, {
105 * we cannot actually feed the same register to an LDR due to 16K spacing 105 .virtual = (u32)S3C24XX_VA_ISA_WORD,
106 */ 106 .pfn = PA_CS3(BAST_PA_ISAIO),
107 107 .length = SZ_16M,
108 .type = MT_DEVICE,
109 },
108 /* bast CPLD control registers, and external interrupt controls */ 110 /* bast CPLD control registers, and external interrupt controls */
109 { (u32)BAST_VA_CTRL1, BAST_PA_CTRL1, SZ_1M, MT_DEVICE }, 111 {
110 { (u32)BAST_VA_CTRL2, BAST_PA_CTRL2, SZ_1M, MT_DEVICE }, 112 .virtual = (u32)BAST_VA_CTRL1,
111 { (u32)BAST_VA_CTRL3, BAST_PA_CTRL3, SZ_1M, MT_DEVICE }, 113 .pfn = __phys_to_pfn(BAST_PA_CTRL1),
112 { (u32)BAST_VA_CTRL4, BAST_PA_CTRL4, SZ_1M, MT_DEVICE }, 114 .length = SZ_1M,
113 115 .type = MT_DEVICE,
116 }, {
117 .virtual = (u32)BAST_VA_CTRL2,
118 .pfn = __phys_to_pfn(BAST_PA_CTRL2),
119 .length = SZ_1M,
120 .type = MT_DEVICE,
121 }, {
122 .virtual = (u32)BAST_VA_CTRL3,
123 .pfn = __phys_to_pfn(BAST_PA_CTRL3),
124 .length = SZ_1M,
125 .type = MT_DEVICE,
126 }, {
127 .virtual = (u32)BAST_VA_CTRL4,
128 .pfn = __phys_to_pfn(BAST_PA_CTRL4),
129 .length = SZ_1M,
130 .type = MT_DEVICE,
131 },
114 /* PC104 IRQ mux */ 132 /* PC104 IRQ mux */
115 { (u32)BAST_VA_PC104_IRQREQ, BAST_PA_PC104_IRQREQ, SZ_1M, MT_DEVICE }, 133 {
116 { (u32)BAST_VA_PC104_IRQRAW, BAST_PA_PC104_IRQRAW, SZ_1M, MT_DEVICE }, 134 .virtual = (u32)BAST_VA_PC104_IRQREQ,
117 { (u32)BAST_VA_PC104_IRQMASK, BAST_PA_PC104_IRQMASK, SZ_1M, MT_DEVICE }, 135 .pfn = __phys_to_pfn(BAST_PA_PC104_IRQREQ),
136 .length = SZ_1M,
137 .type = MT_DEVICE,
138 }, {
139 .virtual = (u32)BAST_VA_PC104_IRQRAW,
140 .pfn = __phys_to_pfn(BAST_PA_PC104_IRQRAW),
141 .length = SZ_1M,
142 .type = MT_DEVICE,
143 }, {
144 .virtual = (u32)BAST_VA_PC104_IRQMASK,
145 .pfn = __phys_to_pfn(BAST_PA_PC104_IRQMASK),
146 .length = SZ_1M,
147 .type = MT_DEVICE,
148 },
118 149
119 /* peripheral space... one for each of fast/slow/byte/16bit */ 150 /* peripheral space... one for each of fast/slow/byte/16bit */
120 /* note, ide is only decoded in word space, even though some registers 151 /* note, ide is only decoded in word space, even though some registers
diff --git a/arch/arm/mach-s3c2410/mach-rx3715.c b/arch/arm/mach-s3c2410/mach-rx3715.c
index 24d69019a843..f8d86d1e16b6 100644
--- a/arch/arm/mach-s3c2410/mach-rx3715.c
+++ b/arch/arm/mach-s3c2410/mach-rx3715.c
@@ -56,8 +56,17 @@
56static struct map_desc rx3715_iodesc[] __initdata = { 56static struct map_desc rx3715_iodesc[] __initdata = {
57 /* dump ISA space somewhere unused */ 57 /* dump ISA space somewhere unused */
58 58
59 { (u32)S3C24XX_VA_ISA_WORD, S3C2410_CS3, SZ_16M, MT_DEVICE }, 59 {
60 { (u32)S3C24XX_VA_ISA_BYTE, S3C2410_CS3, SZ_16M, MT_DEVICE }, 60 .virtual = (u32)S3C24XX_VA_ISA_WORD,
61 .pfn = __phys_to_pfn(S3C2410_CS3),
62 .length = SZ_1M,
63 .type = MT_DEVICE,
64 }, {
65 .virtual = (u32)S3C24XX_VA_ISA_BYTE,
66 .pfn = __phys_to_pfn(S3C2410_CS3),
67 .length = SZ_1M,
68 .type = MT_DEVICE,
69 },
61}; 70};
62 71
63 72
diff --git a/arch/arm/mach-s3c2410/mach-smdk2440.c b/arch/arm/mach-s3c2410/mach-smdk2440.c
index d666c621ad06..4e31118533e6 100644
--- a/arch/arm/mach-s3c2410/mach-smdk2440.c
+++ b/arch/arm/mach-s3c2410/mach-smdk2440.c
@@ -58,8 +58,27 @@
58static struct map_desc smdk2440_iodesc[] __initdata = { 58static struct map_desc smdk2440_iodesc[] __initdata = {
59 /* ISA IO Space map (memory space selected by A24) */ 59 /* ISA IO Space map (memory space selected by A24) */
60 60
61 { (u32)S3C24XX_VA_ISA_WORD, S3C2410_CS2, SZ_16M, MT_DEVICE }, 61 {
62 { (u32)S3C24XX_VA_ISA_BYTE, S3C2410_CS2, SZ_16M, MT_DEVICE }, 62 .virtual = (u32)S3C24XX_VA_ISA_WORD,
63 .pfn = __phys_to_pfn(S3C2410_CS2),
64 .length = 0x10000,
65 .type = MT_DEVICE,
66 }, {
67 .virtual = (u32)S3C24XX_VA_ISA_WORD + 0x10000,
68 .pfn = __phys_to_pfn(S3C2410_CS2 + (1<<24)),
69 .length = SZ_4M,
70 .type = MT_DEVICE,
71 }, {
72 .virtual = (u32)S3C24XX_VA_ISA_BYTE,
73 .pfn = __phys_to_pfn(S3C2410_CS2),
74 .length = 0x10000,
75 .type = MT_DEVICE,
76 }, {
77 .virtual = (u32)S3C24XX_VA_ISA_BYTE + 0x10000,
78 .pfn = __phys_to_pfn(S3C2410_CS2 + (1<<24)),
79 .length = SZ_4M,
80 .type = MT_DEVICE,
81 }
63}; 82};
64 83
65#define UCON S3C2410_UCON_DEFAULT | S3C2410_UCON_UCLK 84#define UCON S3C2410_UCON_DEFAULT | S3C2410_UCON_UCLK
diff --git a/arch/arm/mach-s3c2410/mach-vr1000.c b/arch/arm/mach-s3c2410/mach-vr1000.c
index 46b259673c18..ae7e099bf6c8 100644
--- a/arch/arm/mach-s3c2410/mach-vr1000.c
+++ b/arch/arm/mach-s3c2410/mach-vr1000.c
@@ -74,27 +74,47 @@
74 74
75/* macros to modify the physical addresses for io space */ 75/* macros to modify the physical addresses for io space */
76 76
77#define PA_CS2(item) ((item) + S3C2410_CS2) 77#define PA_CS2(item) (__phys_to_pfn((item) + S3C2410_CS2))
78#define PA_CS3(item) ((item) + S3C2410_CS3) 78#define PA_CS3(item) (__phys_to_pfn((item) + S3C2410_CS3))
79#define PA_CS4(item) ((item) + S3C2410_CS4) 79#define PA_CS4(item) (__phys_to_pfn((item) + S3C2410_CS4))
80#define PA_CS5(item) ((item) + S3C2410_CS5) 80#define PA_CS5(item) (__phys_to_pfn((item) + S3C2410_CS5))
81 81
82static struct map_desc vr1000_iodesc[] __initdata = { 82static struct map_desc vr1000_iodesc[] __initdata = {
83 /* ISA IO areas */ 83 /* ISA IO areas */
84 84 {
85 { (u32)S3C24XX_VA_ISA_BYTE, PA_CS2(BAST_PA_ISAIO), SZ_16M, MT_DEVICE }, 85 .virtual = (u32)S3C24XX_VA_ISA_BYTE,
86 { (u32)S3C24XX_VA_ISA_WORD, PA_CS3(BAST_PA_ISAIO), SZ_16M, MT_DEVICE }, 86 .pfn = PA_CS2(BAST_PA_ISAIO),
87 87 .length = SZ_16M,
88 /* we could possibly compress the next set down into a set of smaller tables 88 .type = MT_DEVICE,
89 * pagetables, but that would mean using an L2 section, and it still means 89 }, {
90 * we cannot actually feed the same register to an LDR due to 16K spacing 90 .virtual = (u32)S3C24XX_VA_ISA_WORD,
91 */ 91 .pfn = PA_CS3(BAST_PA_ISAIO),
92 92 .length = SZ_16M,
93 /* bast CPLD control registers, and external interrupt controls */ 93 .type = MT_DEVICE,
94 { (u32)VR1000_VA_CTRL1, VR1000_PA_CTRL1, SZ_1M, MT_DEVICE }, 94 },
95 { (u32)VR1000_VA_CTRL2, VR1000_PA_CTRL2, SZ_1M, MT_DEVICE }, 95
96 { (u32)VR1000_VA_CTRL3, VR1000_PA_CTRL3, SZ_1M, MT_DEVICE }, 96 /* CPLD control registers, and external interrupt controls */
97 { (u32)VR1000_VA_CTRL4, VR1000_PA_CTRL4, SZ_1M, MT_DEVICE }, 97 {
98 .virtual = (u32)VR1000_VA_CTRL1,
99 .pfn = __phys_to_pfn(VR1000_PA_CTRL1),
100 .length = SZ_1M,
101 .type = MT_DEVICE,
102 }, {
103 .virtual = (u32)VR1000_VA_CTRL2,
104 .pfn = __phys_to_pfn(VR1000_PA_CTRL2),
105 .length = SZ_1M,
106 .type = MT_DEVICE,
107 }, {
108 .virtual = (u32)VR1000_VA_CTRL3,
109 .pfn = __phys_to_pfn(VR1000_PA_CTRL3),
110 .length = SZ_1M,
111 .type = MT_DEVICE,
112 }, {
113 .virtual = (u32)VR1000_VA_CTRL4,
114 .pfn = __phys_to_pfn(VR1000_PA_CTRL4),
115 .length = SZ_1M,
116 .type = MT_DEVICE,
117 },
98 118
99 /* peripheral space... one for each of fast/slow/byte/16bit */ 119 /* peripheral space... one for each of fast/slow/byte/16bit */
100 /* note, ide is only decoded in word space, even though some registers 120 /* note, ide is only decoded in word space, even though some registers
diff --git a/arch/arm/mach-sa1100/time.c b/arch/arm/mach-sa1100/time.c
index 47e0420623fc..e4b435e634e4 100644
--- a/arch/arm/mach-sa1100/time.c
+++ b/arch/arm/mach-sa1100/time.c
@@ -124,11 +124,13 @@ static void __init sa1100_timer_init(void)
124 tv.tv_sec = sa1100_get_rtc_time(); 124 tv.tv_sec = sa1100_get_rtc_time();
125 do_settimeofday(&tv); 125 do_settimeofday(&tv);
126 126
127 OSMR0 = 0; /* set initial match at 0 */ 127 OIER = 0; /* disable any timer interrupts */
128 OSCR = LATCH*2; /* push OSCR out of the way */
129 OSMR0 = LATCH; /* set initial match */
128 OSSR = 0xf; /* clear status on all timers */ 130 OSSR = 0xf; /* clear status on all timers */
129 setup_irq(IRQ_OST0, &sa1100_timer_irq); 131 setup_irq(IRQ_OST0, &sa1100_timer_irq);
130 OIER |= OIER_E0; /* enable match on timer 0 to cause interrupts */ 132 OIER = OIER_E0; /* enable match on timer 0 to cause interrupts */
131 OSCR = 0; /* initialize free-running timer, force first match */ 133 OSCR = 0; /* initialize free-running timer */
132} 134}
133 135
134#ifdef CONFIG_NO_IDLE_HZ 136#ifdef CONFIG_NO_IDLE_HZ
diff --git a/arch/arm/mm/Kconfig b/arch/arm/mm/Kconfig
index 5568403e984d..e3c14d6b4328 100644
--- a/arch/arm/mm/Kconfig
+++ b/arch/arm/mm/Kconfig
@@ -250,6 +250,18 @@ config CPU_V6
250 select CPU_COPY_V6 250 select CPU_COPY_V6
251 select CPU_TLB_V6 251 select CPU_TLB_V6
252 252
253# ARMv6k
254config CPU_32v6K
255 bool "Support ARM V6K processor extensions" if !SMP
256 depends on CPU_V6
257 default y if SMP
258 help
259 Say Y here if your ARMv6 processor supports the 'K' extension.
260 This enables the kernel to use some instructions not present
261 on previous processors, and as such a kernel build with this
262 enabled will not boot on processors with do not support these
263 instructions.
264
253# Figure out what processor architecture version we should be using. 265# Figure out what processor architecture version we should be using.
254# This defines the compiler instruction set which depends on the machine type. 266# This defines the compiler instruction set which depends on the machine type.
255config CPU_32v3 267config CPU_32v3
diff --git a/arch/arm/mm/init.c b/arch/arm/mm/init.c
index fd079ff1fc53..c168f322ef8c 100644
--- a/arch/arm/mm/init.c
+++ b/arch/arm/mm/init.c
@@ -486,10 +486,17 @@ static void __init devicemaps_init(struct machine_desc *mdesc)
486 486
487 /* 487 /*
488 * Ask the machine support to map in the statically mapped devices. 488 * Ask the machine support to map in the statically mapped devices.
489 * After this point, we can start to touch devices again.
490 */ 489 */
491 if (mdesc->map_io) 490 if (mdesc->map_io)
492 mdesc->map_io(); 491 mdesc->map_io();
492
493 /*
494 * Finally flush the tlb again - this ensures that we're in a
495 * consistent state wrt the writebuffer if the writebuffer needs
496 * draining. After this point, we can start to touch devices
497 * again.
498 */
499 local_flush_tlb_all();
493} 500}
494 501
495/* 502/*
diff --git a/arch/arm/mm/mm-armv.c b/arch/arm/mm/mm-armv.c
index 1221fdde1769..9e50127be635 100644
--- a/arch/arm/mm/mm-armv.c
+++ b/arch/arm/mm/mm-armv.c
@@ -354,7 +354,7 @@ void __init build_mem_type_table(void)
354{ 354{
355 struct cachepolicy *cp; 355 struct cachepolicy *cp;
356 unsigned int cr = get_cr(); 356 unsigned int cr = get_cr();
357 unsigned int user_pgprot; 357 unsigned int user_pgprot, kern_pgprot;
358 int cpu_arch = cpu_architecture(); 358 int cpu_arch = cpu_architecture();
359 int i; 359 int i;
360 360
@@ -381,7 +381,7 @@ void __init build_mem_type_table(void)
381 } 381 }
382 382
383 cp = &cache_policies[cachepolicy]; 383 cp = &cache_policies[cachepolicy];
384 user_pgprot = cp->pte; 384 kern_pgprot = user_pgprot = cp->pte;
385 385
386 /* 386 /*
387 * ARMv6 and above have extended page tables. 387 * ARMv6 and above have extended page tables.
@@ -393,6 +393,7 @@ void __init build_mem_type_table(void)
393 */ 393 */
394 mem_types[MT_MEMORY].prot_sect &= ~PMD_BIT4; 394 mem_types[MT_MEMORY].prot_sect &= ~PMD_BIT4;
395 mem_types[MT_ROM].prot_sect &= ~PMD_BIT4; 395 mem_types[MT_ROM].prot_sect &= ~PMD_BIT4;
396
396 /* 397 /*
397 * Mark cache clean areas and XIP ROM read only 398 * Mark cache clean areas and XIP ROM read only
398 * from SVC mode and no access from userspace. 399 * from SVC mode and no access from userspace.
@@ -412,32 +413,47 @@ void __init build_mem_type_table(void)
412 * (iow, non-global) 413 * (iow, non-global)
413 */ 414 */
414 user_pgprot |= L_PTE_ASID; 415 user_pgprot |= L_PTE_ASID;
416
417#ifdef CONFIG_SMP
418 /*
419 * Mark memory with the "shared" attribute for SMP systems
420 */
421 user_pgprot |= L_PTE_SHARED;
422 kern_pgprot |= L_PTE_SHARED;
423 mem_types[MT_MEMORY].prot_sect |= PMD_SECT_S;
424#endif
415 } 425 }
416 426
427 for (i = 0; i < 16; i++) {
428 unsigned long v = pgprot_val(protection_map[i]);
429 v = (v & ~(L_PTE_BUFFERABLE|L_PTE_CACHEABLE)) | user_pgprot;
430 protection_map[i] = __pgprot(v);
431 }
432
433 mem_types[MT_LOW_VECTORS].prot_pte |= kern_pgprot;
434 mem_types[MT_HIGH_VECTORS].prot_pte |= kern_pgprot;
435
417 if (cpu_arch >= CPU_ARCH_ARMv5) { 436 if (cpu_arch >= CPU_ARCH_ARMv5) {
418 mem_types[MT_LOW_VECTORS].prot_pte |= cp->pte & PTE_CACHEABLE; 437#ifndef CONFIG_SMP
419 mem_types[MT_HIGH_VECTORS].prot_pte |= cp->pte & PTE_CACHEABLE; 438 /*
439 * Only use write-through for non-SMP systems
440 */
441 mem_types[MT_LOW_VECTORS].prot_pte &= ~L_PTE_BUFFERABLE;
442 mem_types[MT_HIGH_VECTORS].prot_pte &= ~L_PTE_BUFFERABLE;
443#endif
420 } else { 444 } else {
421 mem_types[MT_LOW_VECTORS].prot_pte |= cp->pte;
422 mem_types[MT_HIGH_VECTORS].prot_pte |= cp->pte;
423 mem_types[MT_MINICLEAN].prot_sect &= ~PMD_SECT_TEX(1); 445 mem_types[MT_MINICLEAN].prot_sect &= ~PMD_SECT_TEX(1);
424 } 446 }
425 447
448 pgprot_kernel = __pgprot(L_PTE_PRESENT | L_PTE_YOUNG |
449 L_PTE_DIRTY | L_PTE_WRITE |
450 L_PTE_EXEC | kern_pgprot);
451
426 mem_types[MT_LOW_VECTORS].prot_l1 |= ecc_mask; 452 mem_types[MT_LOW_VECTORS].prot_l1 |= ecc_mask;
427 mem_types[MT_HIGH_VECTORS].prot_l1 |= ecc_mask; 453 mem_types[MT_HIGH_VECTORS].prot_l1 |= ecc_mask;
428 mem_types[MT_MEMORY].prot_sect |= ecc_mask | cp->pmd; 454 mem_types[MT_MEMORY].prot_sect |= ecc_mask | cp->pmd;
429 mem_types[MT_ROM].prot_sect |= cp->pmd; 455 mem_types[MT_ROM].prot_sect |= cp->pmd;
430 456
431 for (i = 0; i < 16; i++) {
432 unsigned long v = pgprot_val(protection_map[i]);
433 v = (v & ~(PTE_BUFFERABLE|PTE_CACHEABLE)) | user_pgprot;
434 protection_map[i] = __pgprot(v);
435 }
436
437 pgprot_kernel = __pgprot(L_PTE_PRESENT | L_PTE_YOUNG |
438 L_PTE_DIRTY | L_PTE_WRITE |
439 L_PTE_EXEC | cp->pte);
440
441 switch (cp->pmd) { 457 switch (cp->pmd) {
442 case PMD_SECT_WT: 458 case PMD_SECT_WT:
443 mem_types[MT_CACHECLEAN].prot_sect |= PMD_SECT_WT; 459 mem_types[MT_CACHECLEAN].prot_sect |= PMD_SECT_WT;
@@ -469,14 +485,14 @@ void __init create_mapping(struct map_desc *md)
469 485
470 if (md->virtual != vectors_base() && md->virtual < TASK_SIZE) { 486 if (md->virtual != vectors_base() && md->virtual < TASK_SIZE) {
471 printk(KERN_WARNING "BUG: not creating mapping for " 487 printk(KERN_WARNING "BUG: not creating mapping for "
472 "0x%016llx at 0x%08lx in user region\n", 488 "0x%08llx at 0x%08lx in user region\n",
473 __pfn_to_phys((u64)md->pfn), md->virtual); 489 __pfn_to_phys((u64)md->pfn), md->virtual);
474 return; 490 return;
475 } 491 }
476 492
477 if ((md->type == MT_DEVICE || md->type == MT_ROM) && 493 if ((md->type == MT_DEVICE || md->type == MT_ROM) &&
478 md->virtual >= PAGE_OFFSET && md->virtual < VMALLOC_END) { 494 md->virtual >= PAGE_OFFSET && md->virtual < VMALLOC_END) {
479 printk(KERN_WARNING "BUG: mapping for 0x%016llx at 0x%08lx " 495 printk(KERN_WARNING "BUG: mapping for 0x%08llx at 0x%08lx "
480 "overlaps vmalloc space\n", 496 "overlaps vmalloc space\n",
481 __pfn_to_phys((u64)md->pfn), md->virtual); 497 __pfn_to_phys((u64)md->pfn), md->virtual);
482 } 498 }
@@ -492,14 +508,14 @@ void __init create_mapping(struct map_desc *md)
492 if(md->pfn >= 0x100000) { 508 if(md->pfn >= 0x100000) {
493 if(domain) { 509 if(domain) {
494 printk(KERN_ERR "MM: invalid domain in supersection " 510 printk(KERN_ERR "MM: invalid domain in supersection "
495 "mapping for 0x%016llx at 0x%08lx\n", 511 "mapping for 0x%08llx at 0x%08lx\n",
496 __pfn_to_phys((u64)md->pfn), md->virtual); 512 __pfn_to_phys((u64)md->pfn), md->virtual);
497 return; 513 return;
498 } 514 }
499 if((md->virtual | md->length | __pfn_to_phys(md->pfn)) 515 if((md->virtual | md->length | __pfn_to_phys(md->pfn))
500 & ~SUPERSECTION_MASK) { 516 & ~SUPERSECTION_MASK) {
501 printk(KERN_ERR "MM: cannot create mapping for " 517 printk(KERN_ERR "MM: cannot create mapping for "
502 "0x%016llx at 0x%08lx invalid alignment\n", 518 "0x%08llx at 0x%08lx invalid alignment\n",
503 __pfn_to_phys((u64)md->pfn), md->virtual); 519 __pfn_to_phys((u64)md->pfn), md->virtual);
504 return; 520 return;
505 } 521 }
diff --git a/arch/arm/mm/proc-v6.S b/arch/arm/mm/proc-v6.S
index 9bb5fff406fb..92f3ca31b7b9 100644
--- a/arch/arm/mm/proc-v6.S
+++ b/arch/arm/mm/proc-v6.S
@@ -12,6 +12,7 @@
12#include <linux/linkage.h> 12#include <linux/linkage.h>
13#include <asm/assembler.h> 13#include <asm/assembler.h>
14#include <asm/asm-offsets.h> 14#include <asm/asm-offsets.h>
15#include <asm/hardware/arm_scu.h>
15#include <asm/procinfo.h> 16#include <asm/procinfo.h>
16#include <asm/pgtable.h> 17#include <asm/pgtable.h>
17 18
@@ -112,6 +113,9 @@ ENTRY(cpu_v6_dcache_clean_area)
112ENTRY(cpu_v6_switch_mm) 113ENTRY(cpu_v6_switch_mm)
113 mov r2, #0 114 mov r2, #0
114 ldr r1, [r1, #MM_CONTEXT_ID] @ get mm->context.id 115 ldr r1, [r1, #MM_CONTEXT_ID] @ get mm->context.id
116#ifdef CONFIG_SMP
117 orr r0, r0, #2 @ set shared pgtable
118#endif
115 mcr p15, 0, r2, c7, c5, 6 @ flush BTAC/BTB 119 mcr p15, 0, r2, c7, c5, 6 @ flush BTAC/BTB
116 mcr p15, 0, r2, c7, c10, 4 @ drain write buffer 120 mcr p15, 0, r2, c7, c10, 4 @ drain write buffer
117 mcr p15, 0, r0, c2, c0, 0 @ set TTB 0 121 mcr p15, 0, r0, c2, c0, 0 @ set TTB 0
@@ -140,7 +144,7 @@ ENTRY(cpu_v6_switch_mm)
140ENTRY(cpu_v6_set_pte) 144ENTRY(cpu_v6_set_pte)
141 str r1, [r0], #-2048 @ linux version 145 str r1, [r0], #-2048 @ linux version
142 146
143 bic r2, r1, #0x000007f0 147 bic r2, r1, #0x000003f0
144 bic r2, r2, #0x00000003 148 bic r2, r2, #0x00000003
145 orr r2, r2, #PTE_EXT_AP0 | 2 149 orr r2, r2, #PTE_EXT_AP0 | 2
146 150
@@ -191,6 +195,23 @@ cpu_v6_name:
191 * - cache type register is implemented 195 * - cache type register is implemented
192 */ 196 */
193__v6_setup: 197__v6_setup:
198#ifdef CONFIG_SMP
199 /* Set up the SCU on core 0 only */
200 mrc p15, 0, r0, c0, c0, 5 @ CPU core number
201 ands r0, r0, #15
202 moveq r0, #0x10000000 @ SCU_BASE
203 orreq r0, r0, #0x00100000
204 ldreq r5, [r0, #SCU_CTRL]
205 orreq r5, r5, #1
206 streq r5, [r0, #SCU_CTRL]
207
208#ifndef CONFIG_CPU_DCACHE_DISABLE
209 mrc p15, 0, r0, c1, c0, 1 @ Enable SMP/nAMP mode
210 orr r0, r0, #0x20
211 mcr p15, 0, r0, c1, c0, 1
212#endif
213#endif
214
194 mov r0, #0 215 mov r0, #0
195 mcr p15, 0, r0, c7, c14, 0 @ clean+invalidate D cache 216 mcr p15, 0, r0, c7, c14, 0 @ clean+invalidate D cache
196 mcr p15, 0, r0, c7, c5, 0 @ invalidate I cache 217 mcr p15, 0, r0, c7, c5, 0 @ invalidate I cache
@@ -198,6 +219,9 @@ __v6_setup:
198 mcr p15, 0, r0, c7, c10, 4 @ drain write buffer 219 mcr p15, 0, r0, c7, c10, 4 @ drain write buffer
199 mcr p15, 0, r0, c8, c7, 0 @ invalidate I + D TLBs 220 mcr p15, 0, r0, c8, c7, 0 @ invalidate I + D TLBs
200 mcr p15, 0, r0, c2, c0, 2 @ TTB control register 221 mcr p15, 0, r0, c2, c0, 2 @ TTB control register
222#ifdef CONFIG_SMP
223 orr r4, r4, #2 @ set shared pgtable
224#endif
201 mcr p15, 0, r4, c2, c0, 1 @ load TTB1 225 mcr p15, 0, r4, c2, c0, 1 @ load TTB1
202#ifdef CONFIG_VFP 226#ifdef CONFIG_VFP
203 mrc p15, 0, r0, c1, c0, 2 227 mrc p15, 0, r0, c1, c0, 2
diff --git a/arch/arm/nwfpe/fpa11.h b/arch/arm/nwfpe/fpa11.h
index 9677ae8448e8..da4c616b6c49 100644
--- a/arch/arm/nwfpe/fpa11.h
+++ b/arch/arm/nwfpe/fpa11.h
@@ -60,7 +60,7 @@ typedef union tagFPREG {
60#ifdef CONFIG_FPE_NWFPE_XP 60#ifdef CONFIG_FPE_NWFPE_XP
61 floatx80 fExtended; 61 floatx80 fExtended;
62#else 62#else
63 int padding[3]; 63 u32 padding[3];
64#endif 64#endif
65} FPREG; 65} FPREG;
66 66
diff --git a/arch/arm/nwfpe/fpa11_cpdt.c b/arch/arm/nwfpe/fpa11_cpdt.c
index b0db5cbcc3b1..32859fa8dcfc 100644
--- a/arch/arm/nwfpe/fpa11_cpdt.c
+++ b/arch/arm/nwfpe/fpa11_cpdt.c
@@ -59,8 +59,13 @@ static inline void loadExtended(const unsigned int Fn, const unsigned int __user
59 p = (unsigned int *) &fpa11->fpreg[Fn].fExtended; 59 p = (unsigned int *) &fpa11->fpreg[Fn].fExtended;
60 fpa11->fType[Fn] = typeExtended; 60 fpa11->fType[Fn] = typeExtended;
61 get_user(p[0], &pMem[0]); /* sign & exponent */ 61 get_user(p[0], &pMem[0]); /* sign & exponent */
62#ifdef __ARMEB__
63 get_user(p[1], &pMem[1]); /* ms bits */
64 get_user(p[2], &pMem[2]); /* ls bits */
65#else
62 get_user(p[1], &pMem[2]); /* ls bits */ 66 get_user(p[1], &pMem[2]); /* ls bits */
63 get_user(p[2], &pMem[1]); /* ms bits */ 67 get_user(p[2], &pMem[1]); /* ms bits */
68#endif
64} 69}
65#endif 70#endif
66 71
@@ -177,8 +182,13 @@ static inline void storeExtended(const unsigned int Fn, unsigned int __user *pMe
177 } 182 }
178 183
179 put_user(val.i[0], &pMem[0]); /* sign & exp */ 184 put_user(val.i[0], &pMem[0]); /* sign & exp */
185#ifdef __ARMEB__
186 put_user(val.i[1], &pMem[1]); /* msw */
187 put_user(val.i[2], &pMem[2]);
188#else
180 put_user(val.i[1], &pMem[2]); 189 put_user(val.i[1], &pMem[2]);
181 put_user(val.i[2], &pMem[1]); /* msw */ 190 put_user(val.i[2], &pMem[1]); /* msw */
191#endif
182} 192}
183#endif 193#endif
184 194
diff --git a/arch/arm/nwfpe/fpopcode.c b/arch/arm/nwfpe/fpopcode.c
index 4c9f5703148c..67ff2ab08ea0 100644
--- a/arch/arm/nwfpe/fpopcode.c
+++ b/arch/arm/nwfpe/fpopcode.c
@@ -29,14 +29,14 @@
29 29
30#ifdef CONFIG_FPE_NWFPE_XP 30#ifdef CONFIG_FPE_NWFPE_XP
31const floatx80 floatx80Constant[] = { 31const floatx80 floatx80Constant[] = {
32 {0x0000, 0x0000000000000000ULL}, /* extended 0.0 */ 32 { .high = 0x0000, .low = 0x0000000000000000ULL},/* extended 0.0 */
33 {0x3fff, 0x8000000000000000ULL}, /* extended 1.0 */ 33 { .high = 0x3fff, .low = 0x8000000000000000ULL},/* extended 1.0 */
34 {0x4000, 0x8000000000000000ULL}, /* extended 2.0 */ 34 { .high = 0x4000, .low = 0x8000000000000000ULL},/* extended 2.0 */
35 {0x4000, 0xc000000000000000ULL}, /* extended 3.0 */ 35 { .high = 0x4000, .low = 0xc000000000000000ULL},/* extended 3.0 */
36 {0x4001, 0x8000000000000000ULL}, /* extended 4.0 */ 36 { .high = 0x4001, .low = 0x8000000000000000ULL},/* extended 4.0 */
37 {0x4001, 0xa000000000000000ULL}, /* extended 5.0 */ 37 { .high = 0x4001, .low = 0xa000000000000000ULL},/* extended 5.0 */
38 {0x3ffe, 0x8000000000000000ULL}, /* extended 0.5 */ 38 { .high = 0x3ffe, .low = 0x8000000000000000ULL},/* extended 0.5 */
39 {0x4002, 0xa000000000000000ULL} /* extended 10.0 */ 39 { .high = 0x4002, .low = 0xa000000000000000ULL},/* extended 10.0 */
40}; 40};
41#endif 41#endif
42 42
diff --git a/arch/arm/nwfpe/softfloat-specialize b/arch/arm/nwfpe/softfloat-specialize
index acf409144763..d4a4c8e06635 100644
--- a/arch/arm/nwfpe/softfloat-specialize
+++ b/arch/arm/nwfpe/softfloat-specialize
@@ -332,6 +332,7 @@ static floatx80 commonNaNToFloatx80( commonNaNT a )
332 332
333 z.low = LIT64( 0xC000000000000000 ) | ( a.high>>1 ); 333 z.low = LIT64( 0xC000000000000000 ) | ( a.high>>1 );
334 z.high = ( ( (bits16) a.sign )<<15 ) | 0x7FFF; 334 z.high = ( ( (bits16) a.sign )<<15 ) | 0x7FFF;
335 z.__padding = 0;
335 return z; 336 return z;
336 337
337} 338}
diff --git a/arch/arm/nwfpe/softfloat.c b/arch/arm/nwfpe/softfloat.c
index f9f049132a17..0f9656e482ba 100644
--- a/arch/arm/nwfpe/softfloat.c
+++ b/arch/arm/nwfpe/softfloat.c
@@ -531,6 +531,7 @@ INLINE floatx80 packFloatx80( flag zSign, int32 zExp, bits64 zSig )
531 531
532 z.low = zSig; 532 z.low = zSig;
533 z.high = ( ( (bits16) zSign )<<15 ) + zExp; 533 z.high = ( ( (bits16) zSign )<<15 ) + zExp;
534 z.__padding = 0;
534 return z; 535 return z;
535 536
536} 537}
@@ -2831,6 +2832,7 @@ static floatx80 subFloatx80Sigs( struct roundingData *roundData, floatx80 a, flo
2831 roundData->exception |= float_flag_invalid; 2832 roundData->exception |= float_flag_invalid;
2832 z.low = floatx80_default_nan_low; 2833 z.low = floatx80_default_nan_low;
2833 z.high = floatx80_default_nan_high; 2834 z.high = floatx80_default_nan_high;
2835 z.__padding = 0;
2834 return z; 2836 return z;
2835 } 2837 }
2836 if ( aExp == 0 ) { 2838 if ( aExp == 0 ) {
@@ -2950,6 +2952,7 @@ floatx80 floatx80_mul( struct roundingData *roundData, floatx80 a, floatx80 b )
2950 roundData->exception |= float_flag_invalid; 2952 roundData->exception |= float_flag_invalid;
2951 z.low = floatx80_default_nan_low; 2953 z.low = floatx80_default_nan_low;
2952 z.high = floatx80_default_nan_high; 2954 z.high = floatx80_default_nan_high;
2955 z.__padding = 0;
2953 return z; 2956 return z;
2954 } 2957 }
2955 return packFloatx80( zSign, 0x7FFF, LIT64( 0x8000000000000000 ) ); 2958 return packFloatx80( zSign, 0x7FFF, LIT64( 0x8000000000000000 ) );
@@ -3015,6 +3018,7 @@ floatx80 floatx80_div( struct roundingData *roundData, floatx80 a, floatx80 b )
3015 roundData->exception |= float_flag_invalid; 3018 roundData->exception |= float_flag_invalid;
3016 z.low = floatx80_default_nan_low; 3019 z.low = floatx80_default_nan_low;
3017 z.high = floatx80_default_nan_high; 3020 z.high = floatx80_default_nan_high;
3021 z.__padding = 0;
3018 return z; 3022 return z;
3019 } 3023 }
3020 roundData->exception |= float_flag_divbyzero; 3024 roundData->exception |= float_flag_divbyzero;
@@ -3093,6 +3097,7 @@ floatx80 floatx80_rem( struct roundingData *roundData, floatx80 a, floatx80 b )
3093 roundData->exception |= float_flag_invalid; 3097 roundData->exception |= float_flag_invalid;
3094 z.low = floatx80_default_nan_low; 3098 z.low = floatx80_default_nan_low;
3095 z.high = floatx80_default_nan_high; 3099 z.high = floatx80_default_nan_high;
3100 z.__padding = 0;
3096 return z; 3101 return z;
3097 } 3102 }
3098 normalizeFloatx80Subnormal( bSig, &bExp, &bSig ); 3103 normalizeFloatx80Subnormal( bSig, &bExp, &bSig );
@@ -3184,6 +3189,7 @@ floatx80 floatx80_sqrt( struct roundingData *roundData, floatx80 a )
3184 roundData->exception |= float_flag_invalid; 3189 roundData->exception |= float_flag_invalid;
3185 z.low = floatx80_default_nan_low; 3190 z.low = floatx80_default_nan_low;
3186 z.high = floatx80_default_nan_high; 3191 z.high = floatx80_default_nan_high;
3192 z.__padding = 0;
3187 return z; 3193 return z;
3188 } 3194 }
3189 if ( aExp == 0 ) { 3195 if ( aExp == 0 ) {
diff --git a/arch/arm/nwfpe/softfloat.h b/arch/arm/nwfpe/softfloat.h
index 14151700b6b2..978c699673c6 100644
--- a/arch/arm/nwfpe/softfloat.h
+++ b/arch/arm/nwfpe/softfloat.h
@@ -51,11 +51,17 @@ input or output the `floatx80' type will be defined.
51Software IEC/IEEE floating-point types. 51Software IEC/IEEE floating-point types.
52------------------------------------------------------------------------------- 52-------------------------------------------------------------------------------
53*/ 53*/
54typedef unsigned long int float32; 54typedef u32 float32;
55typedef unsigned long long float64; 55typedef u64 float64;
56typedef struct { 56typedef struct {
57 unsigned short high; 57#ifdef __ARMEB__
58 unsigned long long low; 58 u16 __padding;
59 u16 high;
60#else
61 u16 high;
62 u16 __padding;
63#endif
64 u64 low;
59} floatx80; 65} floatx80;
60 66
61/* 67/*
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/arm26/kernel/process.c b/arch/arm26/kernel/process.c
index 9eb9964d32a7..15833a0057dd 100644
--- a/arch/arm26/kernel/process.c
+++ b/arch/arm26/kernel/process.c
@@ -74,15 +74,13 @@ __setup("hlt", hlt_setup);
74void cpu_idle(void) 74void cpu_idle(void)
75{ 75{
76 /* endless idle loop with no priority at all */ 76 /* endless idle loop with no priority at all */
77 preempt_disable();
78 while (1) { 77 while (1) {
79 while (!need_resched()) { 78 while (!need_resched())
80 local_irq_disable(); 79 cpu_relax();
81 if (!need_resched() && !hlt_counter) 80 preempt_enable_no_resched();
82 local_irq_enable(); 81 schedule();
83 } 82 preempt_disable();
84 } 83 }
85 schedule();
86} 84}
87 85
88static char reboot_mode = 'h'; 86static char reboot_mode = 'h';
diff --git a/arch/arm26/kernel/ptrace.c b/arch/arm26/kernel/ptrace.c
index cf7e977d18c8..4e6b7356a722 100644
--- a/arch/arm26/kernel/ptrace.c
+++ b/arch/arm26/kernel/ptrace.c
@@ -546,7 +546,7 @@ static int ptrace_setfpregs(struct task_struct *tsk, void *ufp)
546 sizeof(struct user_fp)) ? -EFAULT : 0; 546 sizeof(struct user_fp)) ? -EFAULT : 0;
547} 547}
548 548
549static int do_ptrace(int request, struct task_struct *child, long addr, long data) 549long arch_ptrace(struct task_struct *child, long request, long addr, long data)
550{ 550{
551 unsigned long tmp; 551 unsigned long tmp;
552 int ret; 552 int ret;
@@ -665,53 +665,6 @@ static int do_ptrace(int request, struct task_struct *child, long addr, long dat
665 return ret; 665 return ret;
666} 666}
667 667
668asmlinkage long sys_ptrace(long request, long pid, long addr, long data)
669{
670 struct task_struct *child;
671 int ret;
672
673 lock_kernel();
674 ret = -EPERM;
675 if (request == PTRACE_TRACEME) {
676 /* are we already being traced? */
677 if (current->ptrace & PT_PTRACED)
678 goto out;
679 ret = security_ptrace(current->parent, current);
680 if (ret)
681 goto out;
682 /* set the ptrace bit in the process flags. */
683 current->ptrace |= PT_PTRACED;
684 ret = 0;
685 goto out;
686 }
687 ret = -ESRCH;
688 read_lock(&tasklist_lock);
689 child = find_task_by_pid(pid);
690 if (child)
691 get_task_struct(child);
692 read_unlock(&tasklist_lock);
693 if (!child)
694 goto out;
695
696 ret = -EPERM;
697 if (pid == 1) /* you may not mess with init */
698 goto out_tsk;
699
700 if (request == PTRACE_ATTACH) {
701 ret = ptrace_attach(child);
702 goto out_tsk;
703 }
704 ret = ptrace_check_attach(child, request == PTRACE_KILL);
705 if (ret == 0)
706 ret = do_ptrace(request, child, addr, data);
707
708out_tsk:
709 put_task_struct(child);
710out:
711 unlock_kernel();
712 return ret;
713}
714
715asmlinkage void syscall_trace(int why, struct pt_regs *regs) 668asmlinkage void syscall_trace(int why, struct pt_regs *regs)
716{ 669{
717 unsigned long ip; 670 unsigned long ip;
diff --git a/arch/cris/arch-v10/README.mm b/arch/cris/arch-v10/README.mm
index 6f08903f3139..517d1f027fe8 100644
--- a/arch/cris/arch-v10/README.mm
+++ b/arch/cris/arch-v10/README.mm
@@ -177,7 +177,7 @@ The example address is 0xd004000c; in binary this is:
177Given the top-level Page Directory, the offset in that directory is calculated 177Given the top-level Page Directory, the offset in that directory is calculated
178using the upper 8 bits: 178using the upper 8 bits:
179 179
180extern inline pgd_t * pgd_offset(struct mm_struct * mm, unsigned long address) 180static inline pgd_t * pgd_offset(struct mm_struct * mm, unsigned long address)
181{ 181{
182 return mm->pgd + (address >> PGDIR_SHIFT); 182 return mm->pgd + (address >> PGDIR_SHIFT);
183} 183}
@@ -190,14 +190,14 @@ The pgd_t from our example will therefore be the 208'th (0xd0) entry in mm->pgd.
190 190
191Since the Middle Directory does not exist, it is a unity mapping: 191Since the Middle Directory does not exist, it is a unity mapping:
192 192
193extern inline pmd_t * pmd_offset(pgd_t * dir, unsigned long address) 193static inline pmd_t * pmd_offset(pgd_t * dir, unsigned long address)
194{ 194{
195 return (pmd_t *) dir; 195 return (pmd_t *) dir;
196} 196}
197 197
198The Page Table provides the final lookup by using bits 13 to 23 as index: 198The Page Table provides the final lookup by using bits 13 to 23 as index:
199 199
200extern inline pte_t * pte_offset(pmd_t * dir, unsigned long address) 200static inline pte_t * pte_offset(pmd_t * dir, unsigned long address)
201{ 201{
202 return (pte_t *) pmd_page(*dir) + ((address >> PAGE_SHIFT) & 202 return (pte_t *) pmd_page(*dir) + ((address >> PAGE_SHIFT) &
203 (PTRS_PER_PTE - 1)); 203 (PTRS_PER_PTE - 1));
diff --git a/arch/cris/arch-v10/drivers/pcf8563.c b/arch/cris/arch-v10/drivers/pcf8563.c
index 201f4c90d961..f2c55742e90c 100644
--- a/arch/cris/arch-v10/drivers/pcf8563.c
+++ b/arch/cris/arch-v10/drivers/pcf8563.c
@@ -19,7 +19,6 @@
19 */ 19 */
20 20
21#include <linux/config.h> 21#include <linux/config.h>
22#include <linux/version.h>
23#include <linux/module.h> 22#include <linux/module.h>
24#include <linux/kernel.h> 23#include <linux/kernel.h>
25#include <linux/types.h> 24#include <linux/types.h>
diff --git a/arch/cris/arch-v10/kernel/fasttimer.c b/arch/cris/arch-v10/kernel/fasttimer.c
index 094ff45ae85b..cac05a5e514c 100644
--- a/arch/cris/arch-v10/kernel/fasttimer.c
+++ b/arch/cris/arch-v10/kernel/fasttimer.c
@@ -112,7 +112,6 @@
112#include <asm/rtc.h> 112#include <asm/rtc.h>
113 113
114#include <linux/config.h> 114#include <linux/config.h>
115#include <linux/version.h>
116 115
117#include <asm/arch/svinto.h> 116#include <asm/arch/svinto.h>
118#include <asm/fasttimer.h> 117#include <asm/fasttimer.h>
diff --git a/arch/cris/arch-v10/kernel/ptrace.c b/arch/cris/arch-v10/kernel/ptrace.c
index 130dd214e41d..6cbd34a27b90 100644
--- a/arch/cris/arch-v10/kernel/ptrace.c
+++ b/arch/cris/arch-v10/kernel/ptrace.c
@@ -76,55 +76,11 @@ ptrace_disable(struct task_struct *child)
76 * (in user space) where the result of the ptrace call is written (instead of 76 * (in user space) where the result of the ptrace call is written (instead of
77 * being returned). 77 * being returned).
78 */ 78 */
79asmlinkage int 79long arch_ptrace(struct task_struct *child, long request, long addr, long data)
80sys_ptrace(long request, long pid, long addr, long data)
81{ 80{
82 struct task_struct *child;
83 int ret; 81 int ret;
84 unsigned long __user *datap = (unsigned long __user *)data; 82 unsigned long __user *datap = (unsigned long __user *)data;
85 83
86 lock_kernel();
87 ret = -EPERM;
88
89 if (request == PTRACE_TRACEME) {
90 /* are we already being traced? */
91 if (current->ptrace & PT_PTRACED)
92 goto out;
93 ret = security_ptrace(current->parent, current);
94 if (ret)
95 goto out;
96 /* set the ptrace bit in the process flags. */
97 current->ptrace |= PT_PTRACED;
98 ret = 0;
99 goto out;
100 }
101
102 ret = -ESRCH;
103 read_lock(&tasklist_lock);
104 child = find_task_by_pid(pid);
105
106 if (child)
107 get_task_struct(child);
108
109 read_unlock(&tasklist_lock);
110
111 if (!child)
112 goto out;
113
114 ret = -EPERM;
115
116 if (pid == 1) /* Leave the init process alone! */
117 goto out_tsk;
118
119 if (request == PTRACE_ATTACH) {
120 ret = ptrace_attach(child);
121 goto out_tsk;
122 }
123
124 ret = ptrace_check_attach(child, request == PTRACE_KILL);
125 if (ret < 0)
126 goto out_tsk;
127
128 switch (request) { 84 switch (request) {
129 /* Read word at location address. */ 85 /* Read word at location address. */
130 case PTRACE_PEEKTEXT: 86 case PTRACE_PEEKTEXT:
@@ -289,10 +245,7 @@ sys_ptrace(long request, long pid, long addr, long data)
289 ret = ptrace_request(child, request, addr, data); 245 ret = ptrace_request(child, request, addr, data);
290 break; 246 break;
291 } 247 }
292out_tsk: 248
293 put_task_struct(child);
294out:
295 unlock_kernel();
296 return ret; 249 return ret;
297} 250}
298 251
diff --git a/arch/cris/arch-v10/kernel/signal.c b/arch/cris/arch-v10/kernel/signal.c
index 693771961f85..19bcad05716f 100644
--- a/arch/cris/arch-v10/kernel/signal.c
+++ b/arch/cris/arch-v10/kernel/signal.c
@@ -476,7 +476,7 @@ give_sigsegv:
476 * OK, we're invoking a handler 476 * OK, we're invoking a handler
477 */ 477 */
478 478
479extern inline void 479static inline void
480handle_signal(int canrestart, unsigned long sig, 480handle_signal(int canrestart, unsigned long sig,
481 siginfo_t *info, struct k_sigaction *ka, 481 siginfo_t *info, struct k_sigaction *ka,
482 sigset_t *oldset, struct pt_regs * regs) 482 sigset_t *oldset, struct pt_regs * regs)
diff --git a/arch/cris/arch-v32/drivers/cryptocop.c b/arch/cris/arch-v32/drivers/cryptocop.c
index ca72076c630a..501fa52d8d3a 100644
--- a/arch/cris/arch-v32/drivers/cryptocop.c
+++ b/arch/cris/arch-v32/drivers/cryptocop.c
@@ -277,7 +277,7 @@ struct file_operations cryptocop_fops = {
277static void free_cdesc(struct cryptocop_dma_desc *cdesc) 277static void free_cdesc(struct cryptocop_dma_desc *cdesc)
278{ 278{
279 DEBUG(printk("free_cdesc: cdesc 0x%p, from_pool=%d\n", cdesc, cdesc->from_pool)); 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); 280 kfree(cdesc->free_buf);
281 281
282 if (cdesc->from_pool) { 282 if (cdesc->from_pool) {
283 unsigned long int flags; 283 unsigned long int flags;
@@ -2950,15 +2950,15 @@ static int cryptocop_ioctl_process(struct inode *inode, struct file *filp, unsig
2950 put_page(outpages[i]); 2950 put_page(outpages[i]);
2951 } 2951 }
2952 2952
2953 if (digest_result) kfree(digest_result); 2953 kfree(digest_result);
2954 if (inpages) kfree(inpages); 2954 kfree(inpages);
2955 if (outpages) kfree(outpages); 2955 kfree(outpages);
2956 if (cop){ 2956 if (cop){
2957 if (cop->tfrm_op.indata) kfree(cop->tfrm_op.indata); 2957 kfree(cop->tfrm_op.indata);
2958 if (cop->tfrm_op.outdata) kfree(cop->tfrm_op.outdata); 2958 kfree(cop->tfrm_op.outdata);
2959 kfree(cop); 2959 kfree(cop);
2960 } 2960 }
2961 if (jc) kfree(jc); 2961 kfree(jc);
2962 2962
2963 DEBUG(print_lock_status()); 2963 DEBUG(print_lock_status());
2964 2964
diff --git a/arch/cris/arch-v32/drivers/nandflash.c b/arch/cris/arch-v32/drivers/nandflash.c
index fc2a619b035d..93ddea4d9564 100644
--- a/arch/cris/arch-v32/drivers/nandflash.c
+++ b/arch/cris/arch-v32/drivers/nandflash.c
@@ -14,7 +14,6 @@
14 * 14 *
15 */ 15 */
16 16
17#include <linux/version.h>
18#include <linux/slab.h> 17#include <linux/slab.h>
19#include <linux/init.h> 18#include <linux/init.h>
20#include <linux/module.h> 19#include <linux/module.h>
diff --git a/arch/cris/arch-v32/drivers/pcf8563.c b/arch/cris/arch-v32/drivers/pcf8563.c
index f894580b648b..d788bda3578c 100644
--- a/arch/cris/arch-v32/drivers/pcf8563.c
+++ b/arch/cris/arch-v32/drivers/pcf8563.c
@@ -18,7 +18,6 @@
18 */ 18 */
19 19
20#include <linux/config.h> 20#include <linux/config.h>
21#include <linux/version.h>
22#include <linux/module.h> 21#include <linux/module.h>
23#include <linux/kernel.h> 22#include <linux/kernel.h>
24#include <linux/types.h> 23#include <linux/types.h>
diff --git a/arch/cris/arch-v32/kernel/ptrace.c b/arch/cris/arch-v32/kernel/ptrace.c
index 208489da2a87..5528b83a622b 100644
--- a/arch/cris/arch-v32/kernel/ptrace.c
+++ b/arch/cris/arch-v32/kernel/ptrace.c
@@ -99,55 +99,11 @@ ptrace_disable(struct task_struct *child)
99} 99}
100 100
101 101
102asmlinkage int 102long arch_ptrace(struct task_struct *child, long request, long addr, long data)
103sys_ptrace(long request, long pid, long addr, long data)
104{ 103{
105 struct task_struct *child;
106 int ret; 104 int ret;
107 unsigned long __user *datap = (unsigned long __user *)data; 105 unsigned long __user *datap = (unsigned long __user *)data;
108 106
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) { 107 switch (request) {
152 /* Read word at location address. */ 108 /* Read word at location address. */
153 case PTRACE_PEEKTEXT: 109 case PTRACE_PEEKTEXT:
@@ -347,10 +303,7 @@ sys_ptrace(long request, long pid, long addr, long data)
347 ret = ptrace_request(child, request, addr, data); 303 ret = ptrace_request(child, request, addr, data);
348 break; 304 break;
349 } 305 }
350out_tsk: 306
351 put_task_struct(child);
352out:
353 unlock_kernel();
354 return ret; 307 return ret;
355} 308}
356 309
diff --git a/arch/cris/arch-v32/kernel/signal.c b/arch/cris/arch-v32/kernel/signal.c
index 0a3614dab887..99e59b3eacf8 100644
--- a/arch/cris/arch-v32/kernel/signal.c
+++ b/arch/cris/arch-v32/kernel/signal.c
@@ -513,7 +513,7 @@ give_sigsegv:
513} 513}
514 514
515/* Invoke a singal handler to, well, handle the signal. */ 515/* Invoke a singal handler to, well, handle the signal. */
516extern inline void 516static inline void
517handle_signal(int canrestart, unsigned long sig, 517handle_signal(int canrestart, unsigned long sig,
518 siginfo_t *info, struct k_sigaction *ka, 518 siginfo_t *info, struct k_sigaction *ka,
519 sigset_t *oldset, struct pt_regs * regs) 519 sigset_t *oldset, struct pt_regs * regs)
diff --git a/arch/cris/arch-v32/kernel/smp.c b/arch/cris/arch-v32/kernel/smp.c
index 957f551ba5ce..13867f4fad16 100644
--- a/arch/cris/arch-v32/kernel/smp.c
+++ b/arch/cris/arch-v32/kernel/smp.c
@@ -161,6 +161,7 @@ void __init smp_callin(void)
161 REG_WR(intr_vect, irq_regs[cpu], rw_mask, vect_mask); 161 REG_WR(intr_vect, irq_regs[cpu], rw_mask, vect_mask);
162 unmask_irq(IPI_INTR_VECT); 162 unmask_irq(IPI_INTR_VECT);
163 unmask_irq(TIMER_INTR_VECT); 163 unmask_irq(TIMER_INTR_VECT);
164 preempt_disable();
164 local_irq_enable(); 165 local_irq_enable();
165 166
166 cpu_set(cpu, cpu_online_map); 167 cpu_set(cpu, cpu_online_map);
diff --git a/arch/cris/kernel/process.c b/arch/cris/kernel/process.c
index 949a0e40e03c..7c80afb10460 100644
--- a/arch/cris/kernel/process.c
+++ b/arch/cris/kernel/process.c
@@ -218,7 +218,9 @@ void cpu_idle (void)
218 idle = default_idle; 218 idle = default_idle;
219 idle(); 219 idle();
220 } 220 }
221 preempt_enable_no_resched();
221 schedule(); 222 schedule();
223 preempt_disable();
222 } 224 }
223} 225}
224 226
diff --git a/arch/cris/mm/ioremap.c b/arch/cris/mm/ioremap.c
index a92ac9877582..1780df3ed9e5 100644
--- a/arch/cris/mm/ioremap.c
+++ b/arch/cris/mm/ioremap.c
@@ -16,7 +16,7 @@
16#include <asm/tlbflush.h> 16#include <asm/tlbflush.h>
17#include <asm/arch/memmap.h> 17#include <asm/arch/memmap.h>
18 18
19extern inline void remap_area_pte(pte_t * pte, unsigned long address, unsigned long size, 19static inline void remap_area_pte(pte_t * pte, unsigned long address, unsigned long size,
20 unsigned long phys_addr, pgprot_t prot) 20 unsigned long phys_addr, pgprot_t prot)
21{ 21{
22 unsigned long end; 22 unsigned long end;
diff --git a/arch/frv/kernel/process.c b/arch/frv/kernel/process.c
index 3001b82b1514..54a452136f00 100644
--- a/arch/frv/kernel/process.c
+++ b/arch/frv/kernel/process.c
@@ -77,16 +77,20 @@ void (*idle)(void) = core_sleep_idle;
77 */ 77 */
78void cpu_idle(void) 78void cpu_idle(void)
79{ 79{
80 int cpu = smp_processor_id();
81
80 /* endless idle loop with no priority at all */ 82 /* endless idle loop with no priority at all */
81 while (1) { 83 while (1) {
82 while (!need_resched()) { 84 while (!need_resched()) {
83 irq_stat[smp_processor_id()].idle_timestamp = jiffies; 85 irq_stat[cpu].idle_timestamp = jiffies;
84 86
85 if (!frv_dma_inprogress && idle) 87 if (!frv_dma_inprogress && idle)
86 idle(); 88 idle();
87 } 89 }
88 90
91 preempt_enable_no_resched();
89 schedule(); 92 schedule();
93 preempt_disable();
90 } 94 }
91} 95}
92 96
diff --git a/arch/frv/kernel/ptrace.c b/arch/frv/kernel/ptrace.c
index cb335a14a315..f953484e7d59 100644
--- a/arch/frv/kernel/ptrace.c
+++ b/arch/frv/kernel/ptrace.c
@@ -106,48 +106,11 @@ void ptrace_enable(struct task_struct *child)
106 child->thread.frame0->__status |= REG__STATUS_STEP; 106 child->thread.frame0->__status |= REG__STATUS_STEP;
107} 107}
108 108
109asmlinkage long sys_ptrace(long request, long pid, long addr, long data) 109long arch_ptrace(struct task_struct *child, long request, long addr, long data)
110{ 110{
111 struct task_struct *child;
112 unsigned long tmp; 111 unsigned long tmp;
113 int ret; 112 int ret;
114 113
115 lock_kernel();
116 ret = -EPERM;
117 if (request == PTRACE_TRACEME) {
118 /* are we already being traced? */
119 if (current->ptrace & PT_PTRACED)
120 goto out;
121 ret = security_ptrace(current->parent, current);
122 if (ret)
123 goto out;
124 /* set the ptrace bit in the process flags. */
125 current->ptrace |= PT_PTRACED;
126 ret = 0;
127 goto out;
128 }
129 ret = -ESRCH;
130 read_lock(&tasklist_lock);
131 child = find_task_by_pid(pid);
132 if (child)
133 get_task_struct(child);
134 read_unlock(&tasklist_lock);
135 if (!child)
136 goto out;
137
138 ret = -EPERM;
139 if (pid == 1) /* you may not mess with init */
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) { 114 switch (request) {
152 /* when I and D space are separate, these will need to be fixed. */ 115 /* when I and D space are separate, these will need to be fixed. */
153 case PTRACE_PEEKTEXT: /* read word at location addr. */ 116 case PTRACE_PEEKTEXT: /* read word at location addr. */
@@ -351,10 +314,6 @@ asmlinkage long sys_ptrace(long request, long pid, long addr, long data)
351 ret = -EIO; 314 ret = -EIO;
352 break; 315 break;
353 } 316 }
354out_tsk:
355 put_task_struct(child);
356out:
357 unlock_kernel();
358 return ret; 317 return ret;
359} 318}
360 319
diff --git a/arch/h8300/kernel/process.c b/arch/h8300/kernel/process.c
index 27f1fce64ce4..fe21adf3e75e 100644
--- a/arch/h8300/kernel/process.c
+++ b/arch/h8300/kernel/process.c
@@ -53,22 +53,18 @@ asmlinkage void ret_from_fork(void);
53#if !defined(CONFIG_H8300H_SIM) && !defined(CONFIG_H8S_SIM) 53#if !defined(CONFIG_H8300H_SIM) && !defined(CONFIG_H8S_SIM)
54void default_idle(void) 54void default_idle(void)
55{ 55{
56 while(1) { 56 local_irq_disable();
57 if (!need_resched()) { 57 if (!need_resched()) {
58 local_irq_enable(); 58 local_irq_enable();
59 __asm__("sleep"); 59 /* XXX: race here! What if need_resched() gets set now? */
60 local_irq_disable(); 60 __asm__("sleep");
61 } 61 } else
62 schedule(); 62 local_irq_enable();
63 }
64} 63}
65#else 64#else
66void default_idle(void) 65void default_idle(void)
67{ 66{
68 while(1) { 67 cpu_relax();
69 if (need_resched())
70 schedule();
71 }
72} 68}
73#endif 69#endif
74void (*idle)(void) = default_idle; 70void (*idle)(void) = default_idle;
@@ -81,7 +77,13 @@ void (*idle)(void) = default_idle;
81 */ 77 */
82void cpu_idle(void) 78void cpu_idle(void)
83{ 79{
84 idle(); 80 while (1) {
81 while (!need_resched())
82 idle();
83 preempt_enable_no_resched();
84 schedule();
85 preempt_disable();
86 }
85} 87}
86 88
87void machine_restart(char * __unused) 89void machine_restart(char * __unused)
diff --git a/arch/h8300/kernel/ptrace.c b/arch/h8300/kernel/ptrace.c
index a569fe4aa284..0ff6f79b0fed 100644
--- a/arch/h8300/kernel/ptrace.c
+++ b/arch/h8300/kernel/ptrace.c
@@ -57,43 +57,10 @@ void ptrace_disable(struct task_struct *child)
57 h8300_disable_trace(child); 57 h8300_disable_trace(child);
58} 58}
59 59
60asmlinkage long sys_ptrace(long request, long pid, long addr, long data) 60long arch_ptrace(struct task_struct *child, long request, long addr, long data)
61{ 61{
62 struct task_struct *child;
63 int ret; 62 int ret;
64 63
65 lock_kernel();
66 ret = -EPERM;
67 if (request == PTRACE_TRACEME) {
68 /* are we already being traced? */
69 if (current->ptrace & PT_PTRACED)
70 goto out;
71 /* set the ptrace bit in the process flags. */
72 current->ptrace |= PT_PTRACED;
73 ret = 0;
74 goto out;
75 }
76 ret = -ESRCH;
77 read_lock(&tasklist_lock);
78 child = find_task_by_pid(pid);
79 if (child)
80 get_task_struct(child);
81 read_unlock(&tasklist_lock);
82 if (!child)
83 goto out;
84
85 ret = -EPERM;
86 if (pid == 1) /* you may not mess with init */
87 goto out_tsk;
88
89 if (request == PTRACE_ATTACH) {
90 ret = ptrace_attach(child);
91 goto out_tsk;
92 }
93 ret = ptrace_check_attach(child, request == PTRACE_KILL);
94 if (ret < 0)
95 goto out_tsk;
96
97 switch (request) { 64 switch (request) {
98 case PTRACE_PEEKTEXT: /* read word at location addr. */ 65 case PTRACE_PEEKTEXT: /* read word at location addr. */
99 case PTRACE_PEEKDATA: { 66 case PTRACE_PEEKDATA: {
@@ -251,10 +218,6 @@ asmlinkage long sys_ptrace(long request, long pid, long addr, long data)
251 ret = -EIO; 218 ret = -EIO;
252 break; 219 break;
253 } 220 }
254out_tsk:
255 put_task_struct(child);
256out:
257 unlock_kernel();
258 return ret; 221 return ret;
259} 222}
260 223
diff --git a/arch/i386/Kconfig b/arch/i386/Kconfig
index bac0da731ee3..dbf90ad6eac3 100644
--- a/arch/i386/Kconfig
+++ b/arch/i386/Kconfig
@@ -997,8 +997,21 @@ source "drivers/Kconfig"
997 997
998source "fs/Kconfig" 998source "fs/Kconfig"
999 999
1000menu "Instrumentation Support"
1001 depends on EXPERIMENTAL
1002
1000source "arch/i386/oprofile/Kconfig" 1003source "arch/i386/oprofile/Kconfig"
1001 1004
1005config KPROBES
1006 bool "Kprobes (EXPERIMENTAL)"
1007 help
1008 Kprobes allows you to trap at almost any kernel address and
1009 execute a callback function. register_kprobe() establishes
1010 a probepoint and specifies the callback. Kprobes is useful
1011 for kernel debugging, non-intrusive instrumentation and testing.
1012 If in doubt, say "N".
1013endmenu
1014
1002source "arch/i386/Kconfig.debug" 1015source "arch/i386/Kconfig.debug"
1003 1016
1004source "security/Kconfig" 1017source "security/Kconfig"
diff --git a/arch/i386/Kconfig.debug b/arch/i386/Kconfig.debug
index 5228c40a6fb2..c48b424dd640 100644
--- a/arch/i386/Kconfig.debug
+++ b/arch/i386/Kconfig.debug
@@ -22,16 +22,6 @@ config DEBUG_STACKOVERFLOW
22 This option will cause messages to be printed if free stack space 22 This option will cause messages to be printed if free stack space
23 drops below a certain limit. 23 drops below a certain limit.
24 24
25config KPROBES
26 bool "Kprobes"
27 depends on DEBUG_KERNEL
28 help
29 Kprobes allows you to trap at almost any kernel address and
30 execute a callback function. register_kprobe() establishes
31 a probepoint and specifies the callback. Kprobes is useful
32 for kernel debugging, non-intrusive instrumentation and testing.
33 If in doubt, say "N".
34
35config DEBUG_STACK_USAGE 25config DEBUG_STACK_USAGE
36 bool "Stack utilization instrumentation" 26 bool "Stack utilization instrumentation"
37 depends on DEBUG_KERNEL 27 depends on DEBUG_KERNEL
diff --git a/arch/i386/kernel/apic.c b/arch/i386/kernel/apic.c
index 7c724ffa08bb..496a2c9909fe 100644
--- a/arch/i386/kernel/apic.c
+++ b/arch/i386/kernel/apic.c
@@ -559,14 +559,20 @@ void __devinit setup_local_APIC(void)
559 * If Linux enabled the LAPIC against the BIOS default 559 * If Linux enabled the LAPIC against the BIOS default
560 * disable it down before re-entering the BIOS on shutdown. 560 * disable it down before re-entering the BIOS on shutdown.
561 * Otherwise the BIOS may get confused and not power-off. 561 * Otherwise the BIOS may get confused and not power-off.
562 * Additionally clear all LVT entries before disable_local_APIC
563 * for the case where Linux didn't enable the LAPIC.
562 */ 564 */
563void lapic_shutdown(void) 565void lapic_shutdown(void)
564{ 566{
565 if (!cpu_has_apic || !enabled_via_apicbase) 567 if (!cpu_has_apic)
566 return; 568 return;
567 569
568 local_irq_disable(); 570 local_irq_disable();
569 disable_local_APIC(); 571 clear_local_APIC();
572
573 if (enabled_via_apicbase)
574 disable_local_APIC();
575
570 local_irq_enable(); 576 local_irq_enable();
571} 577}
572 578
diff --git a/arch/i386/kernel/apm.c b/arch/i386/kernel/apm.c
index d2ef0c2aa93e..003548b8735f 100644
--- a/arch/i386/kernel/apm.c
+++ b/arch/i386/kernel/apm.c
@@ -447,8 +447,7 @@ static char * apm_event_name[] = {
447 "system standby resume", 447 "system standby resume",
448 "capabilities change" 448 "capabilities change"
449}; 449};
450#define NR_APM_EVENT_NAME \ 450#define NR_APM_EVENT_NAME ARRAY_SIZE(apm_event_name)
451 (sizeof(apm_event_name) / sizeof(apm_event_name[0]))
452 451
453typedef struct lookup_t { 452typedef struct lookup_t {
454 int key; 453 int key;
@@ -479,7 +478,7 @@ static const lookup_t error_table[] = {
479 { APM_NO_ERROR, "BIOS did not set a return code" }, 478 { APM_NO_ERROR, "BIOS did not set a return code" },
480 { APM_NOT_PRESENT, "No APM present" } 479 { APM_NOT_PRESENT, "No APM present" }
481}; 480};
482#define ERROR_COUNT (sizeof(error_table)/sizeof(lookup_t)) 481#define ERROR_COUNT ARRAY_SIZE(error_table)
483 482
484/** 483/**
485 * apm_error - display an APM error 484 * apm_error - display an APM error
@@ -770,8 +769,26 @@ static int set_system_power_state(u_short state)
770static int apm_do_idle(void) 769static int apm_do_idle(void)
771{ 770{
772 u32 eax; 771 u32 eax;
772 u8 ret = 0;
773 int idled = 0;
774 int polling;
775
776 polling = test_thread_flag(TIF_POLLING_NRFLAG);
777 if (polling) {
778 clear_thread_flag(TIF_POLLING_NRFLAG);
779 smp_mb__after_clear_bit();
780 }
781 if (!need_resched()) {
782 idled = 1;
783 ret = apm_bios_call_simple(APM_FUNC_IDLE, 0, 0, &eax);
784 }
785 if (polling)
786 set_thread_flag(TIF_POLLING_NRFLAG);
787
788 if (!idled)
789 return 0;
773 790
774 if (apm_bios_call_simple(APM_FUNC_IDLE, 0, 0, &eax)) { 791 if (ret) {
775 static unsigned long t; 792 static unsigned long t;
776 793
777 /* This always fails on some SMP boards running UP kernels. 794 /* This always fails on some SMP boards running UP kernels.
diff --git a/arch/i386/kernel/cpu/common.c b/arch/i386/kernel/cpu/common.c
index 74145a33cb0f..c145fb30002e 100644
--- a/arch/i386/kernel/cpu/common.c
+++ b/arch/i386/kernel/cpu/common.c
@@ -30,8 +30,6 @@ static int disable_x86_serial_nr __devinitdata = 1;
30 30
31struct cpu_dev * cpu_devs[X86_VENDOR_NUM] = {}; 31struct cpu_dev * cpu_devs[X86_VENDOR_NUM] = {};
32 32
33extern void mcheck_init(struct cpuinfo_x86 *c);
34
35extern int disable_pse; 33extern int disable_pse;
36 34
37static void default_init(struct cpuinfo_x86 * c) 35static void default_init(struct cpuinfo_x86 * c)
@@ -429,9 +427,8 @@ void __devinit identify_cpu(struct cpuinfo_x86 *c)
429 } 427 }
430 428
431 /* Init Machine Check Exception if available. */ 429 /* Init Machine Check Exception if available. */
432#ifdef CONFIG_X86_MCE
433 mcheck_init(c); 430 mcheck_init(c);
434#endif 431
435 if (c == &boot_cpu_data) 432 if (c == &boot_cpu_data)
436 sysenter_setup(); 433 sysenter_setup();
437 enable_sep_cpu(); 434 enable_sep_cpu();
diff --git a/arch/i386/kernel/cpu/cpufreq/acpi-cpufreq.c b/arch/i386/kernel/cpu/cpufreq/acpi-cpufreq.c
index caa9f7711343..871366b83b3f 100644
--- a/arch/i386/kernel/cpu/cpufreq/acpi-cpufreq.c
+++ b/arch/i386/kernel/cpu/cpufreq/acpi-cpufreq.c
@@ -377,10 +377,9 @@ acpi_cpufreq_cpu_init (
377 arg0.buffer.length = 12; 377 arg0.buffer.length = 12;
378 arg0.buffer.pointer = (u8 *) arg0_buf; 378 arg0.buffer.pointer = (u8 *) arg0_buf;
379 379
380 data = kmalloc(sizeof(struct cpufreq_acpi_io), GFP_KERNEL); 380 data = kzalloc(sizeof(struct cpufreq_acpi_io), GFP_KERNEL);
381 if (!data) 381 if (!data)
382 return (-ENOMEM); 382 return (-ENOMEM);
383 memset(data, 0, sizeof(struct cpufreq_acpi_io));
384 383
385 acpi_io_data[cpu] = data; 384 acpi_io_data[cpu] = data;
386 385
diff --git a/arch/i386/kernel/cpu/cpufreq/powernow-k7.c b/arch/i386/kernel/cpu/cpufreq/powernow-k7.c
index 73a5dc5b26b8..edcd626001da 100644
--- a/arch/i386/kernel/cpu/cpufreq/powernow-k7.c
+++ b/arch/i386/kernel/cpu/cpufreq/powernow-k7.c
@@ -171,10 +171,9 @@ static int get_ranges (unsigned char *pst)
171 unsigned int speed; 171 unsigned int speed;
172 u8 fid, vid; 172 u8 fid, vid;
173 173
174 powernow_table = kmalloc((sizeof(struct cpufreq_frequency_table) * (number_scales + 1)), GFP_KERNEL); 174 powernow_table = kzalloc((sizeof(struct cpufreq_frequency_table) * (number_scales + 1)), GFP_KERNEL);
175 if (!powernow_table) 175 if (!powernow_table)
176 return -ENOMEM; 176 return -ENOMEM;
177 memset(powernow_table, 0, (sizeof(struct cpufreq_frequency_table) * (number_scales + 1)));
178 177
179 for (j=0 ; j < number_scales; j++) { 178 for (j=0 ; j < number_scales; j++) {
180 fid = *pst++; 179 fid = *pst++;
@@ -305,16 +304,13 @@ static int powernow_acpi_init(void)
305 goto err0; 304 goto err0;
306 } 305 }
307 306
308 acpi_processor_perf = kmalloc(sizeof(struct acpi_processor_performance), 307 acpi_processor_perf = kzalloc(sizeof(struct acpi_processor_performance),
309 GFP_KERNEL); 308 GFP_KERNEL);
310
311 if (!acpi_processor_perf) { 309 if (!acpi_processor_perf) {
312 retval = -ENOMEM; 310 retval = -ENOMEM;
313 goto err0; 311 goto err0;
314 } 312 }
315 313
316 memset(acpi_processor_perf, 0, sizeof(struct acpi_processor_performance));
317
318 if (acpi_processor_register_performance(acpi_processor_perf, 0)) { 314 if (acpi_processor_register_performance(acpi_processor_perf, 0)) {
319 retval = -EIO; 315 retval = -EIO;
320 goto err1; 316 goto err1;
@@ -337,14 +333,12 @@ static int powernow_acpi_init(void)
337 goto err2; 333 goto err2;
338 } 334 }
339 335
340 powernow_table = kmalloc((number_scales + 1) * (sizeof(struct cpufreq_frequency_table)), GFP_KERNEL); 336 powernow_table = kzalloc((number_scales + 1) * (sizeof(struct cpufreq_frequency_table)), GFP_KERNEL);
341 if (!powernow_table) { 337 if (!powernow_table) {
342 retval = -ENOMEM; 338 retval = -ENOMEM;
343 goto err2; 339 goto err2;
344 } 340 }
345 341
346 memset(powernow_table, 0, ((number_scales + 1) * sizeof(struct cpufreq_frequency_table)));
347
348 pc.val = (unsigned long) acpi_processor_perf->states[0].control; 342 pc.val = (unsigned long) acpi_processor_perf->states[0].control;
349 for (i = 0; i < number_scales; i++) { 343 for (i = 0; i < number_scales; i++) {
350 u8 fid, vid; 344 u8 fid, vid;
diff --git a/arch/i386/kernel/cpu/cpufreq/powernow-k8.c b/arch/i386/kernel/cpu/cpufreq/powernow-k8.c
index 2d5c9adba0cd..68a1fc87f4ca 100644
--- a/arch/i386/kernel/cpu/cpufreq/powernow-k8.c
+++ b/arch/i386/kernel/cpu/cpufreq/powernow-k8.c
@@ -462,7 +462,6 @@ static int check_supported_cpu(unsigned int cpu)
462 462
463 oldmask = current->cpus_allowed; 463 oldmask = current->cpus_allowed;
464 set_cpus_allowed(current, cpumask_of_cpu(cpu)); 464 set_cpus_allowed(current, cpumask_of_cpu(cpu));
465 schedule();
466 465
467 if (smp_processor_id() != cpu) { 466 if (smp_processor_id() != cpu) {
468 printk(KERN_ERR "limiting to cpu %u failed\n", cpu); 467 printk(KERN_ERR "limiting to cpu %u failed\n", cpu);
@@ -497,9 +496,7 @@ static int check_supported_cpu(unsigned int cpu)
497 496
498out: 497out:
499 set_cpus_allowed(current, oldmask); 498 set_cpus_allowed(current, oldmask);
500 schedule();
501 return rc; 499 return rc;
502
503} 500}
504 501
505static int check_pst_table(struct powernow_k8_data *data, struct pst_s *pst, u8 maxvid) 502static int check_pst_table(struct powernow_k8_data *data, struct pst_s *pst, u8 maxvid)
@@ -913,7 +910,6 @@ static int powernowk8_target(struct cpufreq_policy *pol, unsigned targfreq, unsi
913 /* only run on specific CPU from here on */ 910 /* only run on specific CPU from here on */
914 oldmask = current->cpus_allowed; 911 oldmask = current->cpus_allowed;
915 set_cpus_allowed(current, cpumask_of_cpu(pol->cpu)); 912 set_cpus_allowed(current, cpumask_of_cpu(pol->cpu));
916 schedule();
917 913
918 if (smp_processor_id() != pol->cpu) { 914 if (smp_processor_id() != pol->cpu) {
919 printk(KERN_ERR "limiting to cpu %u failed\n", pol->cpu); 915 printk(KERN_ERR "limiting to cpu %u failed\n", pol->cpu);
@@ -968,8 +964,6 @@ static int powernowk8_target(struct cpufreq_policy *pol, unsigned targfreq, unsi
968 964
969err_out: 965err_out:
970 set_cpus_allowed(current, oldmask); 966 set_cpus_allowed(current, oldmask);
971 schedule();
972
973 return ret; 967 return ret;
974} 968}
975 969
@@ -991,12 +985,11 @@ static int __init powernowk8_cpu_init(struct cpufreq_policy *pol)
991 if (!check_supported_cpu(pol->cpu)) 985 if (!check_supported_cpu(pol->cpu))
992 return -ENODEV; 986 return -ENODEV;
993 987
994 data = kmalloc(sizeof(struct powernow_k8_data), GFP_KERNEL); 988 data = kzalloc(sizeof(struct powernow_k8_data), GFP_KERNEL);
995 if (!data) { 989 if (!data) {
996 printk(KERN_ERR PFX "unable to alloc powernow_k8_data"); 990 printk(KERN_ERR PFX "unable to alloc powernow_k8_data");
997 return -ENOMEM; 991 return -ENOMEM;
998 } 992 }
999 memset(data,0,sizeof(struct powernow_k8_data));
1000 993
1001 data->cpu = pol->cpu; 994 data->cpu = pol->cpu;
1002 995
@@ -1026,7 +1019,6 @@ static int __init powernowk8_cpu_init(struct cpufreq_policy *pol)
1026 /* only run on specific CPU from here on */ 1019 /* only run on specific CPU from here on */
1027 oldmask = current->cpus_allowed; 1020 oldmask = current->cpus_allowed;
1028 set_cpus_allowed(current, cpumask_of_cpu(pol->cpu)); 1021 set_cpus_allowed(current, cpumask_of_cpu(pol->cpu));
1029 schedule();
1030 1022
1031 if (smp_processor_id() != pol->cpu) { 1023 if (smp_processor_id() != pol->cpu) {
1032 printk(KERN_ERR "limiting to cpu %u failed\n", pol->cpu); 1024 printk(KERN_ERR "limiting to cpu %u failed\n", pol->cpu);
@@ -1045,7 +1037,6 @@ static int __init powernowk8_cpu_init(struct cpufreq_policy *pol)
1045 1037
1046 /* run on any CPU again */ 1038 /* run on any CPU again */
1047 set_cpus_allowed(current, oldmask); 1039 set_cpus_allowed(current, oldmask);
1048 schedule();
1049 1040
1050 pol->governor = CPUFREQ_DEFAULT_GOVERNOR; 1041 pol->governor = CPUFREQ_DEFAULT_GOVERNOR;
1051 pol->cpus = cpu_core_map[pol->cpu]; 1042 pol->cpus = cpu_core_map[pol->cpu];
@@ -1080,7 +1071,6 @@ static int __init powernowk8_cpu_init(struct cpufreq_policy *pol)
1080 1071
1081err_out: 1072err_out:
1082 set_cpus_allowed(current, oldmask); 1073 set_cpus_allowed(current, oldmask);
1083 schedule();
1084 powernow_k8_cpu_exit_acpi(data); 1074 powernow_k8_cpu_exit_acpi(data);
1085 1075
1086 kfree(data); 1076 kfree(data);
@@ -1116,17 +1106,14 @@ static unsigned int powernowk8_get (unsigned int cpu)
1116 set_cpus_allowed(current, oldmask); 1106 set_cpus_allowed(current, oldmask);
1117 return 0; 1107 return 0;
1118 } 1108 }
1119 preempt_disable(); 1109
1120
1121 if (query_current_values_with_pending_wait(data)) 1110 if (query_current_values_with_pending_wait(data))
1122 goto out; 1111 goto out;
1123 1112
1124 khz = find_khz_freq_from_fid(data->currfid); 1113 khz = find_khz_freq_from_fid(data->currfid);
1125 1114
1126 out: 1115out:
1127 preempt_enable_no_resched();
1128 set_cpus_allowed(current, oldmask); 1116 set_cpus_allowed(current, oldmask);
1129
1130 return khz; 1117 return khz;
1131} 1118}
1132 1119
diff --git a/arch/i386/kernel/cpu/cpufreq/speedstep-centrino.c b/arch/i386/kernel/cpu/cpufreq/speedstep-centrino.c
index 1465974256c9..edb9873e27e3 100644
--- a/arch/i386/kernel/cpu/cpufreq/speedstep-centrino.c
+++ b/arch/i386/kernel/cpu/cpufreq/speedstep-centrino.c
@@ -67,7 +67,7 @@ static const struct cpu_id cpu_ids[] = {
67 [CPU_MP4HT_D0] = {15, 3, 4 }, 67 [CPU_MP4HT_D0] = {15, 3, 4 },
68 [CPU_MP4HT_E0] = {15, 4, 1 }, 68 [CPU_MP4HT_E0] = {15, 4, 1 },
69}; 69};
70#define N_IDS (sizeof(cpu_ids)/sizeof(cpu_ids[0])) 70#define N_IDS ARRAY_SIZE(cpu_ids)
71 71
72struct cpu_model 72struct cpu_model
73{ 73{
@@ -423,12 +423,11 @@ static int centrino_cpu_init_acpi(struct cpufreq_policy *policy)
423 } 423 }
424 } 424 }
425 425
426 centrino_model[cpu] = kmalloc(sizeof(struct cpu_model), GFP_KERNEL); 426 centrino_model[cpu] = kzalloc(sizeof(struct cpu_model), GFP_KERNEL);
427 if (!centrino_model[cpu]) { 427 if (!centrino_model[cpu]) {
428 result = -ENOMEM; 428 result = -ENOMEM;
429 goto err_unreg; 429 goto err_unreg;
430 } 430 }
431 memset(centrino_model[cpu], 0, sizeof(struct cpu_model));
432 431
433 centrino_model[cpu]->model_name=NULL; 432 centrino_model[cpu]->model_name=NULL;
434 centrino_model[cpu]->max_freq = p.states[0].core_frequency * 1000; 433 centrino_model[cpu]->max_freq = p.states[0].core_frequency * 1000;
diff --git a/arch/i386/kernel/cpu/mcheck/k7.c b/arch/i386/kernel/cpu/mcheck/k7.c
index 7c6b9c73522f..fc5d5215e23d 100644
--- a/arch/i386/kernel/cpu/mcheck/k7.c
+++ b/arch/i386/kernel/cpu/mcheck/k7.c
@@ -68,7 +68,7 @@ static fastcall void k7_machine_check(struct pt_regs * regs, long error_code)
68 68
69 69
70/* AMD K7 machine check is Intel like */ 70/* AMD K7 machine check is Intel like */
71void __devinit amd_mcheck_init(struct cpuinfo_x86 *c) 71void amd_mcheck_init(struct cpuinfo_x86 *c)
72{ 72{
73 u32 l, h; 73 u32 l, h;
74 int i; 74 int i;
diff --git a/arch/i386/kernel/cpu/mcheck/mce.c b/arch/i386/kernel/cpu/mcheck/mce.c
index 2cf25d2ba0f1..6170af3c271a 100644
--- a/arch/i386/kernel/cpu/mcheck/mce.c
+++ b/arch/i386/kernel/cpu/mcheck/mce.c
@@ -16,7 +16,7 @@
16 16
17#include "mce.h" 17#include "mce.h"
18 18
19int mce_disabled __devinitdata = 0; 19int mce_disabled = 0;
20int nr_mce_banks; 20int nr_mce_banks;
21 21
22EXPORT_SYMBOL_GPL(nr_mce_banks); /* non-fatal.o */ 22EXPORT_SYMBOL_GPL(nr_mce_banks); /* non-fatal.o */
@@ -31,7 +31,7 @@ static fastcall void unexpected_machine_check(struct pt_regs * regs, long error_
31void fastcall (*machine_check_vector)(struct pt_regs *, long error_code) = unexpected_machine_check; 31void fastcall (*machine_check_vector)(struct pt_regs *, long error_code) = unexpected_machine_check;
32 32
33/* This has to be run for each processor */ 33/* This has to be run for each processor */
34void __devinit mcheck_init(struct cpuinfo_x86 *c) 34void mcheck_init(struct cpuinfo_x86 *c)
35{ 35{
36 if (mce_disabled==1) 36 if (mce_disabled==1)
37 return; 37 return;
diff --git a/arch/i386/kernel/cpu/mcheck/p4.c b/arch/i386/kernel/cpu/mcheck/p4.c
index 1d1e885f500a..fd2c459a31ef 100644
--- a/arch/i386/kernel/cpu/mcheck/p4.c
+++ b/arch/i386/kernel/cpu/mcheck/p4.c
@@ -77,7 +77,7 @@ fastcall void smp_thermal_interrupt(struct pt_regs *regs)
77} 77}
78 78
79/* P4/Xeon Thermal regulation detect and init */ 79/* P4/Xeon Thermal regulation detect and init */
80static void __devinit intel_init_thermal(struct cpuinfo_x86 *c) 80static void intel_init_thermal(struct cpuinfo_x86 *c)
81{ 81{
82 u32 l, h; 82 u32 l, h;
83 unsigned int cpu = smp_processor_id(); 83 unsigned int cpu = smp_processor_id();
@@ -231,7 +231,7 @@ static fastcall void intel_machine_check(struct pt_regs * regs, long error_code)
231} 231}
232 232
233 233
234void __devinit intel_p4_mcheck_init(struct cpuinfo_x86 *c) 234void intel_p4_mcheck_init(struct cpuinfo_x86 *c)
235{ 235{
236 u32 l, h; 236 u32 l, h;
237 int i; 237 int i;
diff --git a/arch/i386/kernel/cpu/mcheck/p5.c b/arch/i386/kernel/cpu/mcheck/p5.c
index 3a2e24baddc7..94bc43d950cf 100644
--- a/arch/i386/kernel/cpu/mcheck/p5.c
+++ b/arch/i386/kernel/cpu/mcheck/p5.c
@@ -28,7 +28,7 @@ static fastcall void pentium_machine_check(struct pt_regs * regs, long error_cod
28} 28}
29 29
30/* Set up machine check reporting for processors with Intel style MCE */ 30/* Set up machine check reporting for processors with Intel style MCE */
31void __devinit intel_p5_mcheck_init(struct cpuinfo_x86 *c) 31void intel_p5_mcheck_init(struct cpuinfo_x86 *c)
32{ 32{
33 u32 l, h; 33 u32 l, h;
34 34
diff --git a/arch/i386/kernel/cpu/mcheck/p6.c b/arch/i386/kernel/cpu/mcheck/p6.c
index 979b18bc95c1..deeae42ce199 100644
--- a/arch/i386/kernel/cpu/mcheck/p6.c
+++ b/arch/i386/kernel/cpu/mcheck/p6.c
@@ -79,7 +79,7 @@ static fastcall void intel_machine_check(struct pt_regs * regs, long error_code)
79} 79}
80 80
81/* Set up machine check reporting for processors with Intel style MCE */ 81/* Set up machine check reporting for processors with Intel style MCE */
82void __devinit intel_p6_mcheck_init(struct cpuinfo_x86 *c) 82void intel_p6_mcheck_init(struct cpuinfo_x86 *c)
83{ 83{
84 u32 l, h; 84 u32 l, h;
85 int i; 85 int i;
diff --git a/arch/i386/kernel/cpu/mcheck/winchip.c b/arch/i386/kernel/cpu/mcheck/winchip.c
index 5b9d2dd411d3..9e424b6c293d 100644
--- a/arch/i386/kernel/cpu/mcheck/winchip.c
+++ b/arch/i386/kernel/cpu/mcheck/winchip.c
@@ -22,7 +22,7 @@ static fastcall void winchip_machine_check(struct pt_regs * regs, long error_cod
22} 22}
23 23
24/* Set up machine check reporting on the Winchip C6 series */ 24/* Set up machine check reporting on the Winchip C6 series */
25void __devinit winchip_mcheck_init(struct cpuinfo_x86 *c) 25void winchip_mcheck_init(struct cpuinfo_x86 *c)
26{ 26{
27 u32 lo, hi; 27 u32 lo, hi;
28 machine_check_vector = winchip_machine_check; 28 machine_check_vector = winchip_machine_check;
diff --git a/arch/i386/kernel/ioport.c b/arch/i386/kernel/ioport.c
index f2b37654777f..b59a34dbe262 100644
--- a/arch/i386/kernel/ioport.c
+++ b/arch/i386/kernel/ioport.c
@@ -108,8 +108,11 @@ asmlinkage long sys_ioperm(unsigned long from, unsigned long num, int turn_on)
108 /* 108 /*
109 * Sets the lazy trigger so that the next I/O operation will 109 * Sets the lazy trigger so that the next I/O operation will
110 * reload the correct bitmap. 110 * reload the correct bitmap.
111 * Reset the owner so that a process switch will not set
112 * tss->io_bitmap_base to IO_BITMAP_OFFSET.
111 */ 113 */
112 tss->io_bitmap_base = INVALID_IO_BITMAP_OFFSET_LAZY; 114 tss->io_bitmap_base = INVALID_IO_BITMAP_OFFSET_LAZY;
115 tss->io_bitmap_owner = NULL;
113 116
114 put_cpu(); 117 put_cpu();
115 118
diff --git a/arch/i386/kernel/kprobes.c b/arch/i386/kernel/kprobes.c
index 6345b430b105..32b0c24ab9a6 100644
--- a/arch/i386/kernel/kprobes.c
+++ b/arch/i386/kernel/kprobes.c
@@ -31,22 +31,16 @@
31#include <linux/config.h> 31#include <linux/config.h>
32#include <linux/kprobes.h> 32#include <linux/kprobes.h>
33#include <linux/ptrace.h> 33#include <linux/ptrace.h>
34#include <linux/spinlock.h>
35#include <linux/preempt.h> 34#include <linux/preempt.h>
36#include <asm/cacheflush.h> 35#include <asm/cacheflush.h>
37#include <asm/kdebug.h> 36#include <asm/kdebug.h>
38#include <asm/desc.h> 37#include <asm/desc.h>
39 38
40static struct kprobe *current_kprobe;
41static unsigned long kprobe_status, kprobe_old_eflags, kprobe_saved_eflags;
42static struct kprobe *kprobe_prev;
43static unsigned long kprobe_status_prev, kprobe_old_eflags_prev, kprobe_saved_eflags_prev;
44static struct pt_regs jprobe_saved_regs;
45static long *jprobe_saved_esp;
46/* copy of the kernel stack at the probe fire time */
47static kprobe_opcode_t jprobes_stack[MAX_STACK_SIZE];
48void jprobe_return_end(void); 39void jprobe_return_end(void);
49 40
41DEFINE_PER_CPU(struct kprobe *, current_kprobe) = NULL;
42DEFINE_PER_CPU(struct kprobe_ctlblk, kprobe_ctlblk);
43
50/* 44/*
51 * returns non-zero if opcode modifies the interrupt flag. 45 * returns non-zero if opcode modifies the interrupt flag.
52 */ 46 */
@@ -91,29 +85,30 @@ void __kprobes arch_remove_kprobe(struct kprobe *p)
91{ 85{
92} 86}
93 87
94static inline void save_previous_kprobe(void) 88static inline void save_previous_kprobe(struct kprobe_ctlblk *kcb)
95{ 89{
96 kprobe_prev = current_kprobe; 90 kcb->prev_kprobe.kp = kprobe_running();
97 kprobe_status_prev = kprobe_status; 91 kcb->prev_kprobe.status = kcb->kprobe_status;
98 kprobe_old_eflags_prev = kprobe_old_eflags; 92 kcb->prev_kprobe.old_eflags = kcb->kprobe_old_eflags;
99 kprobe_saved_eflags_prev = kprobe_saved_eflags; 93 kcb->prev_kprobe.saved_eflags = kcb->kprobe_saved_eflags;
100} 94}
101 95
102static inline void restore_previous_kprobe(void) 96static inline void restore_previous_kprobe(struct kprobe_ctlblk *kcb)
103{ 97{
104 current_kprobe = kprobe_prev; 98 __get_cpu_var(current_kprobe) = kcb->prev_kprobe.kp;
105 kprobe_status = kprobe_status_prev; 99 kcb->kprobe_status = kcb->prev_kprobe.status;
106 kprobe_old_eflags = kprobe_old_eflags_prev; 100 kcb->kprobe_old_eflags = kcb->prev_kprobe.old_eflags;
107 kprobe_saved_eflags = kprobe_saved_eflags_prev; 101 kcb->kprobe_saved_eflags = kcb->prev_kprobe.saved_eflags;
108} 102}
109 103
110static inline void set_current_kprobe(struct kprobe *p, struct pt_regs *regs) 104static inline void set_current_kprobe(struct kprobe *p, struct pt_regs *regs,
105 struct kprobe_ctlblk *kcb)
111{ 106{
112 current_kprobe = p; 107 __get_cpu_var(current_kprobe) = p;
113 kprobe_saved_eflags = kprobe_old_eflags 108 kcb->kprobe_saved_eflags = kcb->kprobe_old_eflags
114 = (regs->eflags & (TF_MASK | IF_MASK)); 109 = (regs->eflags & (TF_MASK | IF_MASK));
115 if (is_IF_modifier(p->opcode)) 110 if (is_IF_modifier(p->opcode))
116 kprobe_saved_eflags &= ~IF_MASK; 111 kcb->kprobe_saved_eflags &= ~IF_MASK;
117} 112}
118 113
119static inline void prepare_singlestep(struct kprobe *p, struct pt_regs *regs) 114static inline void prepare_singlestep(struct kprobe *p, struct pt_regs *regs)
@@ -127,6 +122,7 @@ static inline void prepare_singlestep(struct kprobe *p, struct pt_regs *regs)
127 regs->eip = (unsigned long)&p->ainsn.insn; 122 regs->eip = (unsigned long)&p->ainsn.insn;
128} 123}
129 124
125/* Called with kretprobe_lock held */
130void __kprobes arch_prepare_kretprobe(struct kretprobe *rp, 126void __kprobes arch_prepare_kretprobe(struct kretprobe *rp,
131 struct pt_regs *regs) 127 struct pt_regs *regs)
132{ 128{
@@ -157,9 +153,15 @@ static int __kprobes kprobe_handler(struct pt_regs *regs)
157 int ret = 0; 153 int ret = 0;
158 kprobe_opcode_t *addr = NULL; 154 kprobe_opcode_t *addr = NULL;
159 unsigned long *lp; 155 unsigned long *lp;
156 struct kprobe_ctlblk *kcb;
160 157
161 /* We're in an interrupt, but this is clear and BUG()-safe. */ 158 /*
159 * We don't want to be preempted for the entire
160 * duration of kprobe processing
161 */
162 preempt_disable(); 162 preempt_disable();
163 kcb = get_kprobe_ctlblk();
164
163 /* Check if the application is using LDT entry for its code segment and 165 /* Check if the application is using LDT entry for its code segment and
164 * calculate the address by reading the base address from the LDT entry. 166 * calculate the address by reading the base address from the LDT entry.
165 */ 167 */
@@ -173,15 +175,12 @@ static int __kprobes kprobe_handler(struct pt_regs *regs)
173 } 175 }
174 /* Check we're not actually recursing */ 176 /* Check we're not actually recursing */
175 if (kprobe_running()) { 177 if (kprobe_running()) {
176 /* We *are* holding lock here, so this is safe.
177 Disarm the probe we just hit, and ignore it. */
178 p = get_kprobe(addr); 178 p = get_kprobe(addr);
179 if (p) { 179 if (p) {
180 if (kprobe_status == KPROBE_HIT_SS && 180 if (kcb->kprobe_status == KPROBE_HIT_SS &&
181 *p->ainsn.insn == BREAKPOINT_INSTRUCTION) { 181 *p->ainsn.insn == BREAKPOINT_INSTRUCTION) {
182 regs->eflags &= ~TF_MASK; 182 regs->eflags &= ~TF_MASK;
183 regs->eflags |= kprobe_saved_eflags; 183 regs->eflags |= kcb->kprobe_saved_eflags;
184 unlock_kprobes();
185 goto no_kprobe; 184 goto no_kprobe;
186 } 185 }
187 /* We have reentered the kprobe_handler(), since 186 /* We have reentered the kprobe_handler(), since
@@ -190,26 +189,23 @@ static int __kprobes kprobe_handler(struct pt_regs *regs)
190 * just single step on the instruction of the new probe 189 * just single step on the instruction of the new probe
191 * without calling any user handlers. 190 * without calling any user handlers.
192 */ 191 */
193 save_previous_kprobe(); 192 save_previous_kprobe(kcb);
194 set_current_kprobe(p, regs); 193 set_current_kprobe(p, regs, kcb);
195 p->nmissed++; 194 p->nmissed++;
196 prepare_singlestep(p, regs); 195 prepare_singlestep(p, regs);
197 kprobe_status = KPROBE_REENTER; 196 kcb->kprobe_status = KPROBE_REENTER;
198 return 1; 197 return 1;
199 } else { 198 } else {
200 p = current_kprobe; 199 p = __get_cpu_var(current_kprobe);
201 if (p->break_handler && p->break_handler(p, regs)) { 200 if (p->break_handler && p->break_handler(p, regs)) {
202 goto ss_probe; 201 goto ss_probe;
203 } 202 }
204 } 203 }
205 /* If it's not ours, can't be delete race, (we hold lock). */
206 goto no_kprobe; 204 goto no_kprobe;
207 } 205 }
208 206
209 lock_kprobes();
210 p = get_kprobe(addr); 207 p = get_kprobe(addr);
211 if (!p) { 208 if (!p) {
212 unlock_kprobes();
213 if (regs->eflags & VM_MASK) { 209 if (regs->eflags & VM_MASK) {
214 /* We are in virtual-8086 mode. Return 0 */ 210 /* We are in virtual-8086 mode. Return 0 */
215 goto no_kprobe; 211 goto no_kprobe;
@@ -232,8 +228,8 @@ static int __kprobes kprobe_handler(struct pt_regs *regs)
232 goto no_kprobe; 228 goto no_kprobe;
233 } 229 }
234 230
235 kprobe_status = KPROBE_HIT_ACTIVE; 231 set_current_kprobe(p, regs, kcb);
236 set_current_kprobe(p, regs); 232 kcb->kprobe_status = KPROBE_HIT_ACTIVE;
237 233
238 if (p->pre_handler && p->pre_handler(p, regs)) 234 if (p->pre_handler && p->pre_handler(p, regs))
239 /* handler has already set things up, so skip ss setup */ 235 /* handler has already set things up, so skip ss setup */
@@ -241,7 +237,7 @@ static int __kprobes kprobe_handler(struct pt_regs *regs)
241 237
242ss_probe: 238ss_probe:
243 prepare_singlestep(p, regs); 239 prepare_singlestep(p, regs);
244 kprobe_status = KPROBE_HIT_SS; 240 kcb->kprobe_status = KPROBE_HIT_SS;
245 return 1; 241 return 1;
246 242
247no_kprobe: 243no_kprobe:
@@ -269,9 +265,10 @@ int __kprobes trampoline_probe_handler(struct kprobe *p, struct pt_regs *regs)
269 struct kretprobe_instance *ri = NULL; 265 struct kretprobe_instance *ri = NULL;
270 struct hlist_head *head; 266 struct hlist_head *head;
271 struct hlist_node *node, *tmp; 267 struct hlist_node *node, *tmp;
272 unsigned long orig_ret_address = 0; 268 unsigned long flags, orig_ret_address = 0;
273 unsigned long trampoline_address =(unsigned long)&kretprobe_trampoline; 269 unsigned long trampoline_address =(unsigned long)&kretprobe_trampoline;
274 270
271 spin_lock_irqsave(&kretprobe_lock, flags);
275 head = kretprobe_inst_table_head(current); 272 head = kretprobe_inst_table_head(current);
276 273
277 /* 274 /*
@@ -310,14 +307,15 @@ int __kprobes trampoline_probe_handler(struct kprobe *p, struct pt_regs *regs)
310 BUG_ON(!orig_ret_address || (orig_ret_address == trampoline_address)); 307 BUG_ON(!orig_ret_address || (orig_ret_address == trampoline_address));
311 regs->eip = orig_ret_address; 308 regs->eip = orig_ret_address;
312 309
313 unlock_kprobes(); 310 reset_current_kprobe();
311 spin_unlock_irqrestore(&kretprobe_lock, flags);
314 preempt_enable_no_resched(); 312 preempt_enable_no_resched();
315 313
316 /* 314 /*
317 * By returning a non-zero value, we are telling 315 * By returning a non-zero value, we are telling
318 * kprobe_handler() that we have handled unlocking 316 * kprobe_handler() that we don't want the post_handler
319 * and re-enabling preemption. 317 * to run (and have re-enabled preemption)
320 */ 318 */
321 return 1; 319 return 1;
322} 320}
323 321
@@ -343,7 +341,8 @@ int __kprobes trampoline_probe_handler(struct kprobe *p, struct pt_regs *regs)
343 * that is atop the stack is the address following the copied instruction. 341 * that is atop the stack is the address following the copied instruction.
344 * We need to make it the address following the original instruction. 342 * We need to make it the address following the original instruction.
345 */ 343 */
346static void __kprobes resume_execution(struct kprobe *p, struct pt_regs *regs) 344static void __kprobes resume_execution(struct kprobe *p,
345 struct pt_regs *regs, struct kprobe_ctlblk *kcb)
347{ 346{
348 unsigned long *tos = (unsigned long *)&regs->esp; 347 unsigned long *tos = (unsigned long *)&regs->esp;
349 unsigned long next_eip = 0; 348 unsigned long next_eip = 0;
@@ -353,7 +352,7 @@ static void __kprobes resume_execution(struct kprobe *p, struct pt_regs *regs)
353 switch (p->ainsn.insn[0]) { 352 switch (p->ainsn.insn[0]) {
354 case 0x9c: /* pushfl */ 353 case 0x9c: /* pushfl */
355 *tos &= ~(TF_MASK | IF_MASK); 354 *tos &= ~(TF_MASK | IF_MASK);
356 *tos |= kprobe_old_eflags; 355 *tos |= kcb->kprobe_old_eflags;
357 break; 356 break;
358 case 0xc3: /* ret/lret */ 357 case 0xc3: /* ret/lret */
359 case 0xcb: 358 case 0xcb:
@@ -394,27 +393,30 @@ static void __kprobes resume_execution(struct kprobe *p, struct pt_regs *regs)
394 393
395/* 394/*
396 * Interrupts are disabled on entry as trap1 is an interrupt gate and they 395 * Interrupts are disabled on entry as trap1 is an interrupt gate and they
397 * remain disabled thoroughout this function. And we hold kprobe lock. 396 * remain disabled thoroughout this function.
398 */ 397 */
399static inline int post_kprobe_handler(struct pt_regs *regs) 398static inline int post_kprobe_handler(struct pt_regs *regs)
400{ 399{
401 if (!kprobe_running()) 400 struct kprobe *cur = kprobe_running();
401 struct kprobe_ctlblk *kcb = get_kprobe_ctlblk();
402
403 if (!cur)
402 return 0; 404 return 0;
403 405
404 if ((kprobe_status != KPROBE_REENTER) && current_kprobe->post_handler) { 406 if ((kcb->kprobe_status != KPROBE_REENTER) && cur->post_handler) {
405 kprobe_status = KPROBE_HIT_SSDONE; 407 kcb->kprobe_status = KPROBE_HIT_SSDONE;
406 current_kprobe->post_handler(current_kprobe, regs, 0); 408 cur->post_handler(cur, regs, 0);
407 } 409 }
408 410
409 resume_execution(current_kprobe, regs); 411 resume_execution(cur, regs, kcb);
410 regs->eflags |= kprobe_saved_eflags; 412 regs->eflags |= kcb->kprobe_saved_eflags;
411 413
412 /*Restore back the original saved kprobes variables and continue. */ 414 /*Restore back the original saved kprobes variables and continue. */
413 if (kprobe_status == KPROBE_REENTER) { 415 if (kcb->kprobe_status == KPROBE_REENTER) {
414 restore_previous_kprobe(); 416 restore_previous_kprobe(kcb);
415 goto out; 417 goto out;
416 } 418 }
417 unlock_kprobes(); 419 reset_current_kprobe();
418out: 420out:
419 preempt_enable_no_resched(); 421 preempt_enable_no_resched();
420 422
@@ -429,18 +431,19 @@ out:
429 return 1; 431 return 1;
430} 432}
431 433
432/* Interrupts disabled, kprobe_lock held. */
433static inline int kprobe_fault_handler(struct pt_regs *regs, int trapnr) 434static inline int kprobe_fault_handler(struct pt_regs *regs, int trapnr)
434{ 435{
435 if (current_kprobe->fault_handler 436 struct kprobe *cur = kprobe_running();
436 && current_kprobe->fault_handler(current_kprobe, regs, trapnr)) 437 struct kprobe_ctlblk *kcb = get_kprobe_ctlblk();
438
439 if (cur->fault_handler && cur->fault_handler(cur, regs, trapnr))
437 return 1; 440 return 1;
438 441
439 if (kprobe_status & KPROBE_HIT_SS) { 442 if (kcb->kprobe_status & KPROBE_HIT_SS) {
440 resume_execution(current_kprobe, regs); 443 resume_execution(cur, regs, kcb);
441 regs->eflags |= kprobe_old_eflags; 444 regs->eflags |= kcb->kprobe_old_eflags;
442 445
443 unlock_kprobes(); 446 reset_current_kprobe();
444 preempt_enable_no_resched(); 447 preempt_enable_no_resched();
445 } 448 }
446 return 0; 449 return 0;
@@ -453,39 +456,41 @@ int __kprobes kprobe_exceptions_notify(struct notifier_block *self,
453 unsigned long val, void *data) 456 unsigned long val, void *data)
454{ 457{
455 struct die_args *args = (struct die_args *)data; 458 struct die_args *args = (struct die_args *)data;
459 int ret = NOTIFY_DONE;
460
456 switch (val) { 461 switch (val) {
457 case DIE_INT3: 462 case DIE_INT3:
458 if (kprobe_handler(args->regs)) 463 if (kprobe_handler(args->regs))
459 return NOTIFY_STOP; 464 ret = NOTIFY_STOP;
460 break; 465 break;
461 case DIE_DEBUG: 466 case DIE_DEBUG:
462 if (post_kprobe_handler(args->regs)) 467 if (post_kprobe_handler(args->regs))
463 return NOTIFY_STOP; 468 ret = NOTIFY_STOP;
464 break; 469 break;
465 case DIE_GPF: 470 case DIE_GPF:
466 if (kprobe_running() &&
467 kprobe_fault_handler(args->regs, args->trapnr))
468 return NOTIFY_STOP;
469 break;
470 case DIE_PAGE_FAULT: 471 case DIE_PAGE_FAULT:
472 /* kprobe_running() needs smp_processor_id() */
473 preempt_disable();
471 if (kprobe_running() && 474 if (kprobe_running() &&
472 kprobe_fault_handler(args->regs, args->trapnr)) 475 kprobe_fault_handler(args->regs, args->trapnr))
473 return NOTIFY_STOP; 476 ret = NOTIFY_STOP;
477 preempt_enable();
474 break; 478 break;
475 default: 479 default:
476 break; 480 break;
477 } 481 }
478 return NOTIFY_DONE; 482 return ret;
479} 483}
480 484
481int __kprobes setjmp_pre_handler(struct kprobe *p, struct pt_regs *regs) 485int __kprobes setjmp_pre_handler(struct kprobe *p, struct pt_regs *regs)
482{ 486{
483 struct jprobe *jp = container_of(p, struct jprobe, kp); 487 struct jprobe *jp = container_of(p, struct jprobe, kp);
484 unsigned long addr; 488 unsigned long addr;
489 struct kprobe_ctlblk *kcb = get_kprobe_ctlblk();
485 490
486 jprobe_saved_regs = *regs; 491 kcb->jprobe_saved_regs = *regs;
487 jprobe_saved_esp = &regs->esp; 492 kcb->jprobe_saved_esp = &regs->esp;
488 addr = (unsigned long)jprobe_saved_esp; 493 addr = (unsigned long)(kcb->jprobe_saved_esp);
489 494
490 /* 495 /*
491 * TBD: As Linus pointed out, gcc assumes that the callee 496 * TBD: As Linus pointed out, gcc assumes that the callee
@@ -494,7 +499,8 @@ int __kprobes setjmp_pre_handler(struct kprobe *p, struct pt_regs *regs)
494 * we also save and restore enough stack bytes to cover 499 * we also save and restore enough stack bytes to cover
495 * the argument area. 500 * the argument area.
496 */ 501 */
497 memcpy(jprobes_stack, (kprobe_opcode_t *) addr, MIN_STACK_SIZE(addr)); 502 memcpy(kcb->jprobes_stack, (kprobe_opcode_t *)addr,
503 MIN_STACK_SIZE(addr));
498 regs->eflags &= ~IF_MASK; 504 regs->eflags &= ~IF_MASK;
499 regs->eip = (unsigned long)(jp->entry); 505 regs->eip = (unsigned long)(jp->entry);
500 return 1; 506 return 1;
@@ -502,36 +508,40 @@ int __kprobes setjmp_pre_handler(struct kprobe *p, struct pt_regs *regs)
502 508
503void __kprobes jprobe_return(void) 509void __kprobes jprobe_return(void)
504{ 510{
505 preempt_enable_no_resched(); 511 struct kprobe_ctlblk *kcb = get_kprobe_ctlblk();
512
506 asm volatile (" xchgl %%ebx,%%esp \n" 513 asm volatile (" xchgl %%ebx,%%esp \n"
507 " int3 \n" 514 " int3 \n"
508 " .globl jprobe_return_end \n" 515 " .globl jprobe_return_end \n"
509 " jprobe_return_end: \n" 516 " jprobe_return_end: \n"
510 " nop \n"::"b" 517 " nop \n"::"b"
511 (jprobe_saved_esp):"memory"); 518 (kcb->jprobe_saved_esp):"memory");
512} 519}
513 520
514int __kprobes longjmp_break_handler(struct kprobe *p, struct pt_regs *regs) 521int __kprobes longjmp_break_handler(struct kprobe *p, struct pt_regs *regs)
515{ 522{
523 struct kprobe_ctlblk *kcb = get_kprobe_ctlblk();
516 u8 *addr = (u8 *) (regs->eip - 1); 524 u8 *addr = (u8 *) (regs->eip - 1);
517 unsigned long stack_addr = (unsigned long)jprobe_saved_esp; 525 unsigned long stack_addr = (unsigned long)(kcb->jprobe_saved_esp);
518 struct jprobe *jp = container_of(p, struct jprobe, kp); 526 struct jprobe *jp = container_of(p, struct jprobe, kp);
519 527
520 if ((addr > (u8 *) jprobe_return) && (addr < (u8 *) jprobe_return_end)) { 528 if ((addr > (u8 *) jprobe_return) && (addr < (u8 *) jprobe_return_end)) {
521 if (&regs->esp != jprobe_saved_esp) { 529 if (&regs->esp != kcb->jprobe_saved_esp) {
522 struct pt_regs *saved_regs = 530 struct pt_regs *saved_regs =
523 container_of(jprobe_saved_esp, struct pt_regs, esp); 531 container_of(kcb->jprobe_saved_esp,
532 struct pt_regs, esp);
524 printk("current esp %p does not match saved esp %p\n", 533 printk("current esp %p does not match saved esp %p\n",
525 &regs->esp, jprobe_saved_esp); 534 &regs->esp, kcb->jprobe_saved_esp);
526 printk("Saved registers for jprobe %p\n", jp); 535 printk("Saved registers for jprobe %p\n", jp);
527 show_registers(saved_regs); 536 show_registers(saved_regs);
528 printk("Current registers\n"); 537 printk("Current registers\n");
529 show_registers(regs); 538 show_registers(regs);
530 BUG(); 539 BUG();
531 } 540 }
532 *regs = jprobe_saved_regs; 541 *regs = kcb->jprobe_saved_regs;
533 memcpy((kprobe_opcode_t *) stack_addr, jprobes_stack, 542 memcpy((kprobe_opcode_t *) stack_addr, kcb->jprobes_stack,
534 MIN_STACK_SIZE(stack_addr)); 543 MIN_STACK_SIZE(stack_addr));
544 preempt_enable_no_resched();
535 return 1; 545 return 1;
536 } 546 }
537 return 0; 547 return 0;
diff --git a/arch/i386/kernel/ldt.c b/arch/i386/kernel/ldt.c
index fe1ffa55587d..983f95707e11 100644
--- a/arch/i386/kernel/ldt.c
+++ b/arch/i386/kernel/ldt.c
@@ -18,6 +18,7 @@
18#include <asm/system.h> 18#include <asm/system.h>
19#include <asm/ldt.h> 19#include <asm/ldt.h>
20#include <asm/desc.h> 20#include <asm/desc.h>
21#include <asm/mmu_context.h>
21 22
22#ifdef CONFIG_SMP /* avoids "defined but not used" warnig */ 23#ifdef CONFIG_SMP /* avoids "defined but not used" warnig */
23static void flush_ldt(void *null) 24static void flush_ldt(void *null)
diff --git a/arch/i386/kernel/mca.c b/arch/i386/kernel/mca.c
index 8600faeea29d..558bb207720f 100644
--- a/arch/i386/kernel/mca.c
+++ b/arch/i386/kernel/mca.c
@@ -132,7 +132,7 @@ static struct resource mca_standard_resources[] = {
132 { .start = 0x100, .end = 0x107, .name = "POS (MCA)" } 132 { .start = 0x100, .end = 0x107, .name = "POS (MCA)" }
133}; 133};
134 134
135#define MCA_STANDARD_RESOURCES (sizeof(mca_standard_resources)/sizeof(struct resource)) 135#define MCA_STANDARD_RESOURCES ARRAY_SIZE(mca_standard_resources)
136 136
137/** 137/**
138 * mca_read_and_store_pos - read the POS registers into a memory buffer 138 * mca_read_and_store_pos - read the POS registers into a memory buffer
diff --git a/arch/i386/kernel/process.c b/arch/i386/kernel/process.c
index 7a14fdfd3af9..1cb261f225d5 100644
--- a/arch/i386/kernel/process.c
+++ b/arch/i386/kernel/process.c
@@ -99,14 +99,22 @@ EXPORT_SYMBOL(enable_hlt);
99 */ 99 */
100void default_idle(void) 100void default_idle(void)
101{ 101{
102 local_irq_enable();
103
102 if (!hlt_counter && boot_cpu_data.hlt_works_ok) { 104 if (!hlt_counter && boot_cpu_data.hlt_works_ok) {
103 local_irq_disable(); 105 clear_thread_flag(TIF_POLLING_NRFLAG);
104 if (!need_resched()) 106 smp_mb__after_clear_bit();
105 safe_halt(); 107 while (!need_resched()) {
106 else 108 local_irq_disable();
107 local_irq_enable(); 109 if (!need_resched())
110 safe_halt();
111 else
112 local_irq_enable();
113 }
114 set_thread_flag(TIF_POLLING_NRFLAG);
108 } else { 115 } else {
109 cpu_relax(); 116 while (!need_resched())
117 cpu_relax();
110 } 118 }
111} 119}
112#ifdef CONFIG_APM_MODULE 120#ifdef CONFIG_APM_MODULE
@@ -120,29 +128,14 @@ EXPORT_SYMBOL(default_idle);
120 */ 128 */
121static void poll_idle (void) 129static void poll_idle (void)
122{ 130{
123 int oldval;
124
125 local_irq_enable(); 131 local_irq_enable();
126 132
127 /* 133 asm volatile(
128 * Deal with another CPU just having chosen a thread to 134 "2:"
129 * run here: 135 "testl %0, %1;"
130 */ 136 "rep; nop;"
131 oldval = test_and_clear_thread_flag(TIF_NEED_RESCHED); 137 "je 2b;"
132 138 : : "i"(_TIF_NEED_RESCHED), "m" (current_thread_info()->flags));
133 if (!oldval) {
134 set_thread_flag(TIF_POLLING_NRFLAG);
135 asm volatile(
136 "2:"
137 "testl %0, %1;"
138 "rep; nop;"
139 "je 2b;"
140 : : "i"(_TIF_NEED_RESCHED), "m" (current_thread_info()->flags));
141
142 clear_thread_flag(TIF_POLLING_NRFLAG);
143 } else {
144 set_need_resched();
145 }
146} 139}
147 140
148#ifdef CONFIG_HOTPLUG_CPU 141#ifdef CONFIG_HOTPLUG_CPU
@@ -179,7 +172,9 @@ static inline void play_dead(void)
179 */ 172 */
180void cpu_idle(void) 173void cpu_idle(void)
181{ 174{
182 int cpu = raw_smp_processor_id(); 175 int cpu = smp_processor_id();
176
177 set_thread_flag(TIF_POLLING_NRFLAG);
183 178
184 /* endless idle loop with no priority at all */ 179 /* endless idle loop with no priority at all */
185 while (1) { 180 while (1) {
@@ -201,7 +196,9 @@ void cpu_idle(void)
201 __get_cpu_var(irq_stat).idle_timestamp = jiffies; 196 __get_cpu_var(irq_stat).idle_timestamp = jiffies;
202 idle(); 197 idle();
203 } 198 }
199 preempt_enable_no_resched();
204 schedule(); 200 schedule();
201 preempt_disable();
205 } 202 }
206} 203}
207 204
@@ -244,15 +241,12 @@ static void mwait_idle(void)
244{ 241{
245 local_irq_enable(); 242 local_irq_enable();
246 243
247 if (!need_resched()) { 244 while (!need_resched()) {
248 set_thread_flag(TIF_POLLING_NRFLAG); 245 __monitor((void *)&current_thread_info()->flags, 0, 0);
249 do { 246 smp_mb();
250 __monitor((void *)&current_thread_info()->flags, 0, 0); 247 if (need_resched())
251 if (need_resched()) 248 break;
252 break; 249 __mwait(0, 0);
253 __mwait(0, 0);
254 } while (!need_resched());
255 clear_thread_flag(TIF_POLLING_NRFLAG);
256 } 250 }
257} 251}
258 252
diff --git a/arch/i386/kernel/ptrace.c b/arch/i386/kernel/ptrace.c
index efd11f09c996..5ffbb4b7ad05 100644
--- a/arch/i386/kernel/ptrace.c
+++ b/arch/i386/kernel/ptrace.c
@@ -354,49 +354,12 @@ ptrace_set_thread_area(struct task_struct *child,
354 return 0; 354 return 0;
355} 355}
356 356
357asmlinkage long sys_ptrace(long request, long pid, long addr, long data) 357long arch_ptrace(struct task_struct *child, long request, long addr, long data)
358{ 358{
359 struct task_struct *child;
360 struct user * dummy = NULL; 359 struct user * dummy = NULL;
361 int i, ret; 360 int i, ret;
362 unsigned long __user *datap = (unsigned long __user *)data; 361 unsigned long __user *datap = (unsigned long __user *)data;
363 362
364 lock_kernel();
365 ret = -EPERM;
366 if (request == PTRACE_TRACEME) {
367 /* are we already being traced? */
368 if (current->ptrace & PT_PTRACED)
369 goto out;
370 ret = security_ptrace(current->parent, current);
371 if (ret)
372 goto out;
373 /* set the ptrace bit in the process flags. */
374 current->ptrace |= PT_PTRACED;
375 ret = 0;
376 goto out;
377 }
378 ret = -ESRCH;
379 read_lock(&tasklist_lock);
380 child = find_task_by_pid(pid);
381 if (child)
382 get_task_struct(child);
383 read_unlock(&tasklist_lock);
384 if (!child)
385 goto out;
386
387 ret = -EPERM;
388 if (pid == 1) /* you may not mess with init */
389 goto out_tsk;
390
391 if (request == PTRACE_ATTACH) {
392 ret = ptrace_attach(child);
393 goto out_tsk;
394 }
395
396 ret = ptrace_check_attach(child, request == PTRACE_KILL);
397 if (ret < 0)
398 goto out_tsk;
399
400 switch (request) { 363 switch (request) {
401 /* when I and D space are separate, these will need to be fixed. */ 364 /* when I and D space are separate, these will need to be fixed. */
402 case PTRACE_PEEKTEXT: /* read word at location addr. */ 365 case PTRACE_PEEKTEXT: /* read word at location addr. */
@@ -663,10 +626,7 @@ asmlinkage long sys_ptrace(long request, long pid, long addr, long data)
663 ret = ptrace_request(child, request, addr, data); 626 ret = ptrace_request(child, request, addr, data);
664 break; 627 break;
665 } 628 }
666out_tsk: 629 out_tsk:
667 put_task_struct(child);
668out:
669 unlock_kernel();
670 return ret; 630 return ret;
671} 631}
672 632
diff --git a/arch/i386/kernel/reboot_fixups.c b/arch/i386/kernel/reboot_fixups.c
index c9b87330aeea..10e21a4773dd 100644
--- a/arch/i386/kernel/reboot_fixups.c
+++ b/arch/i386/kernel/reboot_fixups.c
@@ -10,6 +10,7 @@
10 10
11#include <asm/delay.h> 11#include <asm/delay.h>
12#include <linux/pci.h> 12#include <linux/pci.h>
13#include <linux/reboot_fixups.h>
13 14
14static void cs5530a_warm_reset(struct pci_dev *dev) 15static void cs5530a_warm_reset(struct pci_dev *dev)
15{ 16{
@@ -42,7 +43,7 @@ void mach_reboot_fixups(void)
42 struct pci_dev *dev; 43 struct pci_dev *dev;
43 int i; 44 int i;
44 45
45 for (i=0; i < (sizeof(fixups_table)/sizeof(fixups_table[0])); i++) { 46 for (i=0; i < ARRAY_SIZE(fixups_table); i++) {
46 cur = &(fixups_table[i]); 47 cur = &(fixups_table[i]);
47 dev = pci_get_device(cur->vendor, cur->device, NULL); 48 dev = pci_get_device(cur->vendor, cur->device, NULL);
48 if (!dev) 49 if (!dev)
diff --git a/arch/i386/kernel/scx200.c b/arch/i386/kernel/scx200.c
index 69e203a0d330..9c968ae67c43 100644
--- a/arch/i386/kernel/scx200.c
+++ b/arch/i386/kernel/scx200.c
@@ -12,6 +12,7 @@
12#include <linux/pci.h> 12#include <linux/pci.h>
13 13
14#include <linux/scx200.h> 14#include <linux/scx200.h>
15#include <linux/scx200_gpio.h>
15 16
16/* Verify that the configuration block really is there */ 17/* Verify that the configuration block really is there */
17#define scx200_cb_probe(base) (inw((base) + SCx200_CBA) == (base)) 18#define scx200_cb_probe(base) (inw((base) + SCx200_CBA) == (base))
diff --git a/arch/i386/kernel/setup.c b/arch/i386/kernel/setup.c
index b48ac635f3c1..fdfcb0cba9b4 100644
--- a/arch/i386/kernel/setup.c
+++ b/arch/i386/kernel/setup.c
@@ -129,9 +129,7 @@ struct drive_info_struct { char dummy[32]; } drive_info;
129EXPORT_SYMBOL(drive_info); 129EXPORT_SYMBOL(drive_info);
130#endif 130#endif
131struct screen_info screen_info; 131struct screen_info screen_info;
132#ifdef CONFIG_VT
133EXPORT_SYMBOL(screen_info); 132EXPORT_SYMBOL(screen_info);
134#endif
135struct apm_info apm_info; 133struct apm_info apm_info;
136EXPORT_SYMBOL(apm_info); 134EXPORT_SYMBOL(apm_info);
137struct sys_desc_table_struct { 135struct sys_desc_table_struct {
diff --git a/arch/i386/kernel/smpboot.c b/arch/i386/kernel/smpboot.c
index 01b618e73ecd..bc5a9d97466b 100644
--- a/arch/i386/kernel/smpboot.c
+++ b/arch/i386/kernel/smpboot.c
@@ -68,11 +68,9 @@ EXPORT_SYMBOL(smp_num_siblings);
68 68
69/* Package ID of each logical CPU */ 69/* Package ID of each logical CPU */
70int phys_proc_id[NR_CPUS] __read_mostly = {[0 ... NR_CPUS-1] = BAD_APICID}; 70int phys_proc_id[NR_CPUS] __read_mostly = {[0 ... NR_CPUS-1] = BAD_APICID};
71EXPORT_SYMBOL(phys_proc_id);
72 71
73/* Core ID of each logical CPU */ 72/* Core ID of each logical CPU */
74int cpu_core_id[NR_CPUS] __read_mostly = {[0 ... NR_CPUS-1] = BAD_APICID}; 73int cpu_core_id[NR_CPUS] __read_mostly = {[0 ... NR_CPUS-1] = BAD_APICID};
75EXPORT_SYMBOL(cpu_core_id);
76 74
77cpumask_t cpu_sibling_map[NR_CPUS] __read_mostly; 75cpumask_t cpu_sibling_map[NR_CPUS] __read_mostly;
78EXPORT_SYMBOL(cpu_sibling_map); 76EXPORT_SYMBOL(cpu_sibling_map);
@@ -487,6 +485,7 @@ static void __devinit start_secondary(void *unused)
487 * things done here to the most necessary things. 485 * things done here to the most necessary things.
488 */ 486 */
489 cpu_init(); 487 cpu_init();
488 preempt_disable();
490 smp_callin(); 489 smp_callin();
491 while (!cpu_isset(smp_processor_id(), smp_commenced_mask)) 490 while (!cpu_isset(smp_processor_id(), smp_commenced_mask))
492 rep_nop(); 491 rep_nop();
@@ -612,7 +611,7 @@ static inline void __inquire_remote_apic(int apicid)
612 611
613 printk("Inquiring remote APIC #%d...\n", apicid); 612 printk("Inquiring remote APIC #%d...\n", apicid);
614 613
615 for (i = 0; i < sizeof(regs) / sizeof(*regs); i++) { 614 for (i = 0; i < ARRAY_SIZE(regs); i++) {
616 printk("... APIC #%d %s: ", apicid, names[i]); 615 printk("... APIC #%d %s: ", apicid, names[i]);
617 616
618 /* 617 /*
diff --git a/arch/i386/oprofile/Kconfig b/arch/i386/oprofile/Kconfig
index 5ade19801b97..d8a84088471a 100644
--- a/arch/i386/oprofile/Kconfig
+++ b/arch/i386/oprofile/Kconfig
@@ -1,7 +1,3 @@
1
2menu "Profiling support"
3 depends on EXPERIMENTAL
4
5config PROFILING 1config PROFILING
6 bool "Profiling support (EXPERIMENTAL)" 2 bool "Profiling support (EXPERIMENTAL)"
7 help 3 help
@@ -19,5 +15,3 @@ config OPROFILE
19 15
20 If unsure, say N. 16 If unsure, say N.
21 17
22endmenu
23
diff --git a/arch/i386/power/cpu.c b/arch/i386/power/cpu.c
index 1f1572692e0b..50a0bef8c85f 100644
--- a/arch/i386/power/cpu.c
+++ b/arch/i386/power/cpu.c
@@ -118,6 +118,7 @@ void __restore_processor_state(struct saved_context *ctxt)
118 fix_processor_context(); 118 fix_processor_context();
119 do_fpu_end(); 119 do_fpu_end();
120 mtrr_ap_init(); 120 mtrr_ap_init();
121 mcheck_init(&boot_cpu_data);
121} 122}
122 123
123void restore_processor_state(void) 124void restore_processor_state(void)
diff --git a/arch/ia64/Kconfig b/arch/ia64/Kconfig
index 1642375fb14e..d4de8a4814be 100644
--- a/arch/ia64/Kconfig
+++ b/arch/ia64/Kconfig
@@ -26,6 +26,10 @@ config MMU
26 bool 26 bool
27 default y 27 default y
28 28
29config SWIOTLB
30 bool
31 default y
32
29config RWSEM_XCHGADD_ALGORITHM 33config RWSEM_XCHGADD_ALGORITHM
30 bool 34 bool
31 default y 35 default y
@@ -187,6 +191,7 @@ config IOSAPIC
187 191
188config IA64_SGI_SN_XP 192config IA64_SGI_SN_XP
189 tristate "Support communication between SGI SSIs" 193 tristate "Support communication between SGI SSIs"
194 depends on IA64_GENERIC || IA64_SGI_SN2
190 select IA64_UNCACHED_ALLOCATOR 195 select IA64_UNCACHED_ALLOCATOR
191 help 196 help
192 An SGI machine can be divided into multiple Single System 197 An SGI machine can be divided into multiple Single System
@@ -422,8 +427,21 @@ config GENERIC_PENDING_IRQ
422 427
423source "arch/ia64/hp/sim/Kconfig" 428source "arch/ia64/hp/sim/Kconfig"
424 429
430menu "Instrumentation Support"
431 depends on EXPERIMENTAL
432
425source "arch/ia64/oprofile/Kconfig" 433source "arch/ia64/oprofile/Kconfig"
426 434
435config KPROBES
436 bool "Kprobes (EXPERIMENTAL)"
437 help
438 Kprobes allows you to trap at almost any kernel address and
439 execute a callback function. register_kprobe() establishes
440 a probepoint and specifies the callback. Kprobes is useful
441 for kernel debugging, non-intrusive instrumentation and testing.
442 If in doubt, say "N".
443endmenu
444
427source "arch/ia64/Kconfig.debug" 445source "arch/ia64/Kconfig.debug"
428 446
429source "security/Kconfig" 447source "security/Kconfig"
diff --git a/arch/ia64/Kconfig.debug b/arch/ia64/Kconfig.debug
index fda67ac993d7..de9d507ba0fd 100644
--- a/arch/ia64/Kconfig.debug
+++ b/arch/ia64/Kconfig.debug
@@ -2,17 +2,6 @@ menu "Kernel hacking"
2 2
3source "lib/Kconfig.debug" 3source "lib/Kconfig.debug"
4 4
5config KPROBES
6 bool "Kprobes"
7 depends on DEBUG_KERNEL
8 help
9 Kprobes allows you to trap at almost any kernel address and
10 execute a callback function. register_kprobe() establishes
11 a probepoint and specifies the callback. Kprobes is useful
12 for kernel debugging, non-intrusive instrumentation and testing.
13 If in doubt, say "N".
14
15
16choice 5choice
17 prompt "Physical memory granularity" 6 prompt "Physical memory granularity"
18 default IA64_GRANULE_64MB 7 default IA64_GRANULE_64MB
diff --git a/arch/ia64/hp/sim/simserial.c b/arch/ia64/hp/sim/simserial.c
index b42ec37be51c..19ee635eeb70 100644
--- a/arch/ia64/hp/sim/simserial.c
+++ b/arch/ia64/hp/sim/simserial.c
@@ -642,10 +642,8 @@ static void rs_close(struct tty_struct *tty, struct file * filp)
642 info->event = 0; 642 info->event = 0;
643 info->tty = 0; 643 info->tty = 0;
644 if (info->blocked_open) { 644 if (info->blocked_open) {
645 if (info->close_delay) { 645 if (info->close_delay)
646 current->state = TASK_INTERRUPTIBLE; 646 schedule_timeout_interruptible(info->close_delay);
647 schedule_timeout(info->close_delay);
648 }
649 wake_up_interruptible(&info->open_wait); 647 wake_up_interruptible(&info->open_wait);
650 } 648 }
651 info->flags &= ~(ASYNC_NORMAL_ACTIVE|ASYNC_CLOSING); 649 info->flags &= ~(ASYNC_NORMAL_ACTIVE|ASYNC_CLOSING);
diff --git a/arch/ia64/ia32/ia32_ioctl.c b/arch/ia64/ia32/ia32_ioctl.c
index 164b211f4174..88739394f6df 100644
--- a/arch/ia64/ia32/ia32_ioctl.c
+++ b/arch/ia64/ia32/ia32_ioctl.c
@@ -29,10 +29,8 @@
29#define CODE 29#define CODE
30#include "compat_ioctl.c" 30#include "compat_ioctl.c"
31 31
32typedef int (* ioctl32_handler_t)(unsigned int, unsigned int, unsigned long, struct file *);
33
34#define COMPATIBLE_IOCTL(cmd) HANDLE_IOCTL((cmd),sys_ioctl) 32#define COMPATIBLE_IOCTL(cmd) HANDLE_IOCTL((cmd),sys_ioctl)
35#define HANDLE_IOCTL(cmd,handler) { (cmd), (ioctl32_handler_t)(handler), NULL }, 33#define HANDLE_IOCTL(cmd,handler) { (cmd), (ioctl_trans_handler_t)(handler), NULL },
36#define IOCTL_TABLE_START \ 34#define IOCTL_TABLE_START \
37 struct ioctl_trans ioctl_start[] = { 35 struct ioctl_trans ioctl_start[] = {
38#define IOCTL_TABLE_END \ 36#define IOCTL_TABLE_END \
diff --git a/arch/ia64/kernel/kprobes.c b/arch/ia64/kernel/kprobes.c
index 471086b808a4..96736a119c91 100644
--- a/arch/ia64/kernel/kprobes.c
+++ b/arch/ia64/kernel/kprobes.c
@@ -26,7 +26,6 @@
26#include <linux/config.h> 26#include <linux/config.h>
27#include <linux/kprobes.h> 27#include <linux/kprobes.h>
28#include <linux/ptrace.h> 28#include <linux/ptrace.h>
29#include <linux/spinlock.h>
30#include <linux/string.h> 29#include <linux/string.h>
31#include <linux/slab.h> 30#include <linux/slab.h>
32#include <linux/preempt.h> 31#include <linux/preempt.h>
@@ -38,13 +37,8 @@
38 37
39extern void jprobe_inst_return(void); 38extern void jprobe_inst_return(void);
40 39
41/* kprobe_status settings */ 40DEFINE_PER_CPU(struct kprobe *, current_kprobe) = NULL;
42#define KPROBE_HIT_ACTIVE 0x00000001 41DEFINE_PER_CPU(struct kprobe_ctlblk, kprobe_ctlblk);
43#define KPROBE_HIT_SS 0x00000002
44
45static struct kprobe *current_kprobe, *kprobe_prev;
46static unsigned long kprobe_status, kprobe_status_prev;
47static struct pt_regs jprobe_saved_regs;
48 42
49enum instruction_type {A, I, M, F, B, L, X, u}; 43enum instruction_type {A, I, M, F, B, L, X, u};
50static enum instruction_type bundle_encoding[32][3] = { 44static enum instruction_type bundle_encoding[32][3] = {
@@ -313,21 +307,22 @@ static int __kprobes valid_kprobe_addr(int template, int slot,
313 return 0; 307 return 0;
314} 308}
315 309
316static inline void save_previous_kprobe(void) 310static inline void save_previous_kprobe(struct kprobe_ctlblk *kcb)
317{ 311{
318 kprobe_prev = current_kprobe; 312 kcb->prev_kprobe.kp = kprobe_running();
319 kprobe_status_prev = kprobe_status; 313 kcb->prev_kprobe.status = kcb->kprobe_status;
320} 314}
321 315
322static inline void restore_previous_kprobe(void) 316static inline void restore_previous_kprobe(struct kprobe_ctlblk *kcb)
323{ 317{
324 current_kprobe = kprobe_prev; 318 __get_cpu_var(current_kprobe) = kcb->prev_kprobe.kp;
325 kprobe_status = kprobe_status_prev; 319 kcb->kprobe_status = kcb->prev_kprobe.status;
326} 320}
327 321
328static inline void set_current_kprobe(struct kprobe *p) 322static inline void set_current_kprobe(struct kprobe *p,
323 struct kprobe_ctlblk *kcb)
329{ 324{
330 current_kprobe = p; 325 __get_cpu_var(current_kprobe) = p;
331} 326}
332 327
333static void kretprobe_trampoline(void) 328static void kretprobe_trampoline(void)
@@ -347,10 +342,11 @@ int __kprobes trampoline_probe_handler(struct kprobe *p, struct pt_regs *regs)
347 struct kretprobe_instance *ri = NULL; 342 struct kretprobe_instance *ri = NULL;
348 struct hlist_head *head; 343 struct hlist_head *head;
349 struct hlist_node *node, *tmp; 344 struct hlist_node *node, *tmp;
350 unsigned long orig_ret_address = 0; 345 unsigned long flags, orig_ret_address = 0;
351 unsigned long trampoline_address = 346 unsigned long trampoline_address =
352 ((struct fnptr *)kretprobe_trampoline)->ip; 347 ((struct fnptr *)kretprobe_trampoline)->ip;
353 348
349 spin_lock_irqsave(&kretprobe_lock, flags);
354 head = kretprobe_inst_table_head(current); 350 head = kretprobe_inst_table_head(current);
355 351
356 /* 352 /*
@@ -389,17 +385,19 @@ int __kprobes trampoline_probe_handler(struct kprobe *p, struct pt_regs *regs)
389 BUG_ON(!orig_ret_address || (orig_ret_address == trampoline_address)); 385 BUG_ON(!orig_ret_address || (orig_ret_address == trampoline_address));
390 regs->cr_iip = orig_ret_address; 386 regs->cr_iip = orig_ret_address;
391 387
392 unlock_kprobes(); 388 reset_current_kprobe();
389 spin_unlock_irqrestore(&kretprobe_lock, flags);
393 preempt_enable_no_resched(); 390 preempt_enable_no_resched();
394 391
395 /* 392 /*
396 * By returning a non-zero value, we are telling 393 * By returning a non-zero value, we are telling
397 * kprobe_handler() that we have handled unlocking 394 * kprobe_handler() that we don't want the post_handler
398 * and re-enabling preemption. 395 * to run (and have re-enabled preemption)
399 */ 396 */
400 return 1; 397 return 1;
401} 398}
402 399
400/* Called with kretprobe_lock held */
403void __kprobes arch_prepare_kretprobe(struct kretprobe *rp, 401void __kprobes arch_prepare_kretprobe(struct kretprobe *rp,
404 struct pt_regs *regs) 402 struct pt_regs *regs)
405{ 403{
@@ -606,17 +604,22 @@ static int __kprobes pre_kprobes_handler(struct die_args *args)
606 int ret = 0; 604 int ret = 0;
607 struct pt_regs *regs = args->regs; 605 struct pt_regs *regs = args->regs;
608 kprobe_opcode_t *addr = (kprobe_opcode_t *)instruction_pointer(regs); 606 kprobe_opcode_t *addr = (kprobe_opcode_t *)instruction_pointer(regs);
607 struct kprobe_ctlblk *kcb;
609 608
609 /*
610 * We don't want to be preempted for the entire
611 * duration of kprobe processing
612 */
610 preempt_disable(); 613 preempt_disable();
614 kcb = get_kprobe_ctlblk();
611 615
612 /* Handle recursion cases */ 616 /* Handle recursion cases */
613 if (kprobe_running()) { 617 if (kprobe_running()) {
614 p = get_kprobe(addr); 618 p = get_kprobe(addr);
615 if (p) { 619 if (p) {
616 if ( (kprobe_status == KPROBE_HIT_SS) && 620 if ((kcb->kprobe_status == KPROBE_HIT_SS) &&
617 (p->ainsn.inst_flag == INST_FLAG_BREAK_INST)) { 621 (p->ainsn.inst_flag == INST_FLAG_BREAK_INST)) {
618 ia64_psr(regs)->ss = 0; 622 ia64_psr(regs)->ss = 0;
619 unlock_kprobes();
620 goto no_kprobe; 623 goto no_kprobe;
621 } 624 }
622 /* We have reentered the pre_kprobe_handler(), since 625 /* We have reentered the pre_kprobe_handler(), since
@@ -625,17 +628,17 @@ static int __kprobes pre_kprobes_handler(struct die_args *args)
625 * just single step on the instruction of the new probe 628 * just single step on the instruction of the new probe
626 * without calling any user handlers. 629 * without calling any user handlers.
627 */ 630 */
628 save_previous_kprobe(); 631 save_previous_kprobe(kcb);
629 set_current_kprobe(p); 632 set_current_kprobe(p, kcb);
630 p->nmissed++; 633 p->nmissed++;
631 prepare_ss(p, regs); 634 prepare_ss(p, regs);
632 kprobe_status = KPROBE_REENTER; 635 kcb->kprobe_status = KPROBE_REENTER;
633 return 1; 636 return 1;
634 } else if (args->err == __IA64_BREAK_JPROBE) { 637 } else if (args->err == __IA64_BREAK_JPROBE) {
635 /* 638 /*
636 * jprobe instrumented function just completed 639 * jprobe instrumented function just completed
637 */ 640 */
638 p = current_kprobe; 641 p = __get_cpu_var(current_kprobe);
639 if (p->break_handler && p->break_handler(p, regs)) { 642 if (p->break_handler && p->break_handler(p, regs)) {
640 goto ss_probe; 643 goto ss_probe;
641 } 644 }
@@ -645,10 +648,8 @@ static int __kprobes pre_kprobes_handler(struct die_args *args)
645 } 648 }
646 } 649 }
647 650
648 lock_kprobes();
649 p = get_kprobe(addr); 651 p = get_kprobe(addr);
650 if (!p) { 652 if (!p) {
651 unlock_kprobes();
652 if (!is_ia64_break_inst(regs)) { 653 if (!is_ia64_break_inst(regs)) {
653 /* 654 /*
654 * The breakpoint instruction was removed right 655 * The breakpoint instruction was removed right
@@ -665,8 +666,8 @@ static int __kprobes pre_kprobes_handler(struct die_args *args)
665 goto no_kprobe; 666 goto no_kprobe;
666 } 667 }
667 668
668 kprobe_status = KPROBE_HIT_ACTIVE; 669 set_current_kprobe(p, kcb);
669 set_current_kprobe(p); 670 kcb->kprobe_status = KPROBE_HIT_ACTIVE;
670 671
671 if (p->pre_handler && p->pre_handler(p, regs)) 672 if (p->pre_handler && p->pre_handler(p, regs))
672 /* 673 /*
@@ -678,7 +679,7 @@ static int __kprobes pre_kprobes_handler(struct die_args *args)
678 679
679ss_probe: 680ss_probe:
680 prepare_ss(p, regs); 681 prepare_ss(p, regs);
681 kprobe_status = KPROBE_HIT_SS; 682 kcb->kprobe_status = KPROBE_HIT_SS;
682 return 1; 683 return 1;
683 684
684no_kprobe: 685no_kprobe:
@@ -688,23 +689,25 @@ no_kprobe:
688 689
689static int __kprobes post_kprobes_handler(struct pt_regs *regs) 690static int __kprobes post_kprobes_handler(struct pt_regs *regs)
690{ 691{
691 if (!kprobe_running()) 692 struct kprobe *cur = kprobe_running();
693 struct kprobe_ctlblk *kcb = get_kprobe_ctlblk();
694
695 if (!cur)
692 return 0; 696 return 0;
693 697
694 if ((kprobe_status != KPROBE_REENTER) && current_kprobe->post_handler) { 698 if ((kcb->kprobe_status != KPROBE_REENTER) && cur->post_handler) {
695 kprobe_status = KPROBE_HIT_SSDONE; 699 kcb->kprobe_status = KPROBE_HIT_SSDONE;
696 current_kprobe->post_handler(current_kprobe, regs, 0); 700 cur->post_handler(cur, regs, 0);
697 } 701 }
698 702
699 resume_execution(current_kprobe, regs); 703 resume_execution(cur, regs);
700 704
701 /*Restore back the original saved kprobes variables and continue. */ 705 /*Restore back the original saved kprobes variables and continue. */
702 if (kprobe_status == KPROBE_REENTER) { 706 if (kcb->kprobe_status == KPROBE_REENTER) {
703 restore_previous_kprobe(); 707 restore_previous_kprobe(kcb);
704 goto out; 708 goto out;
705 } 709 }
706 710 reset_current_kprobe();
707 unlock_kprobes();
708 711
709out: 712out:
710 preempt_enable_no_resched(); 713 preempt_enable_no_resched();
@@ -713,16 +716,15 @@ out:
713 716
714static int __kprobes kprobes_fault_handler(struct pt_regs *regs, int trapnr) 717static int __kprobes kprobes_fault_handler(struct pt_regs *regs, int trapnr)
715{ 718{
716 if (!kprobe_running()) 719 struct kprobe *cur = kprobe_running();
717 return 0; 720 struct kprobe_ctlblk *kcb = get_kprobe_ctlblk();
718 721
719 if (current_kprobe->fault_handler && 722 if (cur->fault_handler && cur->fault_handler(cur, regs, trapnr))
720 current_kprobe->fault_handler(current_kprobe, regs, trapnr))
721 return 1; 723 return 1;
722 724
723 if (kprobe_status & KPROBE_HIT_SS) { 725 if (kcb->kprobe_status & KPROBE_HIT_SS) {
724 resume_execution(current_kprobe, regs); 726 resume_execution(cur, regs);
725 unlock_kprobes(); 727 reset_current_kprobe();
726 preempt_enable_no_resched(); 728 preempt_enable_no_resched();
727 } 729 }
728 730
@@ -733,31 +735,38 @@ int __kprobes kprobe_exceptions_notify(struct notifier_block *self,
733 unsigned long val, void *data) 735 unsigned long val, void *data)
734{ 736{
735 struct die_args *args = (struct die_args *)data; 737 struct die_args *args = (struct die_args *)data;
738 int ret = NOTIFY_DONE;
739
736 switch(val) { 740 switch(val) {
737 case DIE_BREAK: 741 case DIE_BREAK:
738 if (pre_kprobes_handler(args)) 742 if (pre_kprobes_handler(args))
739 return NOTIFY_STOP; 743 ret = NOTIFY_STOP;
740 break; 744 break;
741 case DIE_SS: 745 case DIE_SS:
742 if (post_kprobes_handler(args->regs)) 746 if (post_kprobes_handler(args->regs))
743 return NOTIFY_STOP; 747 ret = NOTIFY_STOP;
744 break; 748 break;
745 case DIE_PAGE_FAULT: 749 case DIE_PAGE_FAULT:
746 if (kprobes_fault_handler(args->regs, args->trapnr)) 750 /* kprobe_running() needs smp_processor_id() */
747 return NOTIFY_STOP; 751 preempt_disable();
752 if (kprobe_running() &&
753 kprobes_fault_handler(args->regs, args->trapnr))
754 ret = NOTIFY_STOP;
755 preempt_enable();
748 default: 756 default:
749 break; 757 break;
750 } 758 }
751 return NOTIFY_DONE; 759 return ret;
752} 760}
753 761
754int __kprobes setjmp_pre_handler(struct kprobe *p, struct pt_regs *regs) 762int __kprobes setjmp_pre_handler(struct kprobe *p, struct pt_regs *regs)
755{ 763{
756 struct jprobe *jp = container_of(p, struct jprobe, kp); 764 struct jprobe *jp = container_of(p, struct jprobe, kp);
757 unsigned long addr = ((struct fnptr *)(jp->entry))->ip; 765 unsigned long addr = ((struct fnptr *)(jp->entry))->ip;
766 struct kprobe_ctlblk *kcb = get_kprobe_ctlblk();
758 767
759 /* save architectural state */ 768 /* save architectural state */
760 jprobe_saved_regs = *regs; 769 kcb->jprobe_saved_regs = *regs;
761 770
762 /* after rfi, execute the jprobe instrumented function */ 771 /* after rfi, execute the jprobe instrumented function */
763 regs->cr_iip = addr & ~0xFULL; 772 regs->cr_iip = addr & ~0xFULL;
@@ -775,7 +784,10 @@ int __kprobes setjmp_pre_handler(struct kprobe *p, struct pt_regs *regs)
775 784
776int __kprobes longjmp_break_handler(struct kprobe *p, struct pt_regs *regs) 785int __kprobes longjmp_break_handler(struct kprobe *p, struct pt_regs *regs)
777{ 786{
778 *regs = jprobe_saved_regs; 787 struct kprobe_ctlblk *kcb = get_kprobe_ctlblk();
788
789 *regs = kcb->jprobe_saved_regs;
790 preempt_enable_no_resched();
779 return 1; 791 return 1;
780} 792}
781 793
diff --git a/arch/ia64/kernel/mca_drv.c b/arch/ia64/kernel/mca_drv.c
index f081c60ab206..eb39bc9c133b 100644
--- a/arch/ia64/kernel/mca_drv.c
+++ b/arch/ia64/kernel/mca_drv.c
@@ -88,7 +88,7 @@ mca_page_isolate(unsigned long paddr)
88 if (!ia64_phys_addr_valid(paddr)) 88 if (!ia64_phys_addr_valid(paddr))
89 return ISOLATE_NONE; 89 return ISOLATE_NONE;
90 90
91 if (!pfn_valid(paddr)) 91 if (!pfn_valid(paddr >> PAGE_SHIFT))
92 return ISOLATE_NONE; 92 return ISOLATE_NONE;
93 93
94 /* convert physical address to physical page number */ 94 /* convert physical address to physical page number */
@@ -108,6 +108,7 @@ mca_page_isolate(unsigned long paddr)
108 return ISOLATE_NG; 108 return ISOLATE_NG;
109 109
110 /* add attribute 'Reserved' and register the page */ 110 /* add attribute 'Reserved' and register the page */
111 get_page(p);
111 SetPageReserved(p); 112 SetPageReserved(p);
112 page_isolate[num_page_isolate++] = p; 113 page_isolate[num_page_isolate++] = p;
113 114
diff --git a/arch/ia64/kernel/perfmon.c b/arch/ia64/kernel/perfmon.c
index f7dfc107cb7b..410d4804fa6e 100644
--- a/arch/ia64/kernel/perfmon.c
+++ b/arch/ia64/kernel/perfmon.c
@@ -4940,7 +4940,7 @@ abort_locked:
4940 if (call_made && PFM_CMD_RW_ARG(cmd) && copy_to_user(arg, args_k, base_sz*count)) ret = -EFAULT; 4940 if (call_made && PFM_CMD_RW_ARG(cmd) && copy_to_user(arg, args_k, base_sz*count)) ret = -EFAULT;
4941 4941
4942error_args: 4942error_args:
4943 if (args_k) kfree(args_k); 4943 kfree(args_k);
4944 4944
4945 DPRINT(("cmd=%s ret=%ld\n", PFM_CMD_NAME(cmd), ret)); 4945 DPRINT(("cmd=%s ret=%ld\n", PFM_CMD_NAME(cmd), ret));
4946 4946
diff --git a/arch/ia64/kernel/process.c b/arch/ia64/kernel/process.c
index 051e050359e4..640d6908f8ec 100644
--- a/arch/ia64/kernel/process.c
+++ b/arch/ia64/kernel/process.c
@@ -197,11 +197,15 @@ void
197default_idle (void) 197default_idle (void)
198{ 198{
199 local_irq_enable(); 199 local_irq_enable();
200 while (!need_resched()) 200 while (!need_resched()) {
201 if (can_do_pal_halt) 201 if (can_do_pal_halt) {
202 safe_halt(); 202 local_irq_disable();
203 else 203 if (!need_resched())
204 safe_halt();
205 local_irq_enable();
206 } else
204 cpu_relax(); 207 cpu_relax();
208 }
205} 209}
206 210
207#ifdef CONFIG_HOTPLUG_CPU 211#ifdef CONFIG_HOTPLUG_CPU
@@ -263,16 +267,16 @@ void __attribute__((noreturn))
263cpu_idle (void) 267cpu_idle (void)
264{ 268{
265 void (*mark_idle)(int) = ia64_mark_idle; 269 void (*mark_idle)(int) = ia64_mark_idle;
270 int cpu = smp_processor_id();
271 set_thread_flag(TIF_POLLING_NRFLAG);
266 272
267 /* endless idle loop with no priority at all */ 273 /* endless idle loop with no priority at all */
268 while (1) { 274 while (1) {
275 if (!need_resched()) {
276 void (*idle)(void);
269#ifdef CONFIG_SMP 277#ifdef CONFIG_SMP
270 if (!need_resched())
271 min_xtp(); 278 min_xtp();
272#endif 279#endif
273 while (!need_resched()) {
274 void (*idle)(void);
275
276 if (__get_cpu_var(cpu_idle_state)) 280 if (__get_cpu_var(cpu_idle_state))
277 __get_cpu_var(cpu_idle_state) = 0; 281 __get_cpu_var(cpu_idle_state) = 0;
278 282
@@ -284,17 +288,17 @@ cpu_idle (void)
284 if (!idle) 288 if (!idle)
285 idle = default_idle; 289 idle = default_idle;
286 (*idle)(); 290 (*idle)();
287 } 291 if (mark_idle)
288 292 (*mark_idle)(0);
289 if (mark_idle)
290 (*mark_idle)(0);
291
292#ifdef CONFIG_SMP 293#ifdef CONFIG_SMP
293 normal_xtp(); 294 normal_xtp();
294#endif 295#endif
296 }
297 preempt_enable_no_resched();
295 schedule(); 298 schedule();
299 preempt_disable();
296 check_pgt_cache(); 300 check_pgt_cache();
297 if (cpu_is_offline(smp_processor_id())) 301 if (cpu_is_offline(cpu))
298 play_dead(); 302 play_dead();
299 } 303 }
300} 304}
diff --git a/arch/ia64/kernel/setup.c b/arch/ia64/kernel/setup.c
index fc56ca2da358..3af6de36a482 100644
--- a/arch/ia64/kernel/setup.c
+++ b/arch/ia64/kernel/setup.c
@@ -92,6 +92,13 @@ extern void efi_initialize_iomem_resources(struct resource *,
92extern char _text[], _end[], _etext[]; 92extern char _text[], _end[], _etext[];
93 93
94unsigned long ia64_max_cacheline_size; 94unsigned long ia64_max_cacheline_size;
95
96int dma_get_cache_alignment(void)
97{
98 return ia64_max_cacheline_size;
99}
100EXPORT_SYMBOL(dma_get_cache_alignment);
101
95unsigned long ia64_iobase; /* virtual address for I/O accesses */ 102unsigned long ia64_iobase; /* virtual address for I/O accesses */
96EXPORT_SYMBOL(ia64_iobase); 103EXPORT_SYMBOL(ia64_iobase);
97struct io_space io_space[MAX_IO_SPACES]; 104struct io_space io_space[MAX_IO_SPACES];
diff --git a/arch/ia64/kernel/smpboot.c b/arch/ia64/kernel/smpboot.c
index 400a48987124..8f44e7d2df66 100644
--- a/arch/ia64/kernel/smpboot.c
+++ b/arch/ia64/kernel/smpboot.c
@@ -399,6 +399,7 @@ start_secondary (void *unused)
399 Dprintk("start_secondary: starting CPU 0x%x\n", hard_smp_processor_id()); 399 Dprintk("start_secondary: starting CPU 0x%x\n", hard_smp_processor_id());
400 efi_map_pal_code(); 400 efi_map_pal_code();
401 cpu_init(); 401 cpu_init();
402 preempt_disable();
402 smp_callin(); 403 smp_callin();
403 404
404 cpu_idle(); 405 cpu_idle();
diff --git a/arch/ia64/lib/Makefile b/arch/ia64/lib/Makefile
index cb1af597370b..ac64664a1807 100644
--- a/arch/ia64/lib/Makefile
+++ b/arch/ia64/lib/Makefile
@@ -9,7 +9,7 @@ lib-y := __divsi3.o __udivsi3.o __modsi3.o __umodsi3.o \
9 bitop.o checksum.o clear_page.o csum_partial_copy.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
13 13
14lib-$(CONFIG_ITANIUM) += copy_page.o copy_user.o memcpy.o 14lib-$(CONFIG_ITANIUM) += copy_page.o copy_user.o memcpy.o
15lib-$(CONFIG_MCKINLEY) += copy_page_mck.o memcpy_mck.o 15lib-$(CONFIG_MCKINLEY) += copy_page_mck.o memcpy_mck.o
diff --git a/arch/ia64/lib/swiotlb.c b/arch/ia64/lib/swiotlb.c
deleted file mode 100644
index 96edcc0fdcd9..000000000000
--- a/arch/ia64/lib/swiotlb.c
+++ /dev/null
@@ -1,759 +0,0 @@
1/*
2 * Dynamic DMA mapping support.
3 *
4 * This implementation is for IA-64 platforms that do not support
5 * I/O TLBs (aka DMA address translation hardware).
6 * Copyright (C) 2000 Asit Mallick <Asit.K.Mallick@intel.com>
7 * Copyright (C) 2000 Goutham Rao <goutham.rao@intel.com>
8 * Copyright (C) 2000, 2003 Hewlett-Packard Co
9 * David Mosberger-Tang <davidm@hpl.hp.com>
10 *
11 * 03/05/07 davidm Switch from PCI-DMA to generic device DMA API.
12 * 00/12/13 davidm Rename to swiotlb.c and add mark_clean() to avoid
13 * unnecessary i-cache flushing.
14 * 04/07/.. ak Better overflow handling. Assorted fixes.
15 */
16
17#include <linux/cache.h>
18#include <linux/mm.h>
19#include <linux/module.h>
20#include <linux/pci.h>
21#include <linux/spinlock.h>
22#include <linux/string.h>
23#include <linux/types.h>
24#include <linux/ctype.h>
25
26#include <asm/io.h>
27#include <asm/pci.h>
28#include <asm/dma.h>
29
30#include <linux/init.h>
31#include <linux/bootmem.h>
32
33#define OFFSET(val,align) ((unsigned long) \
34 ( (val) & ( (align) - 1)))
35
36#define SG_ENT_VIRT_ADDRESS(sg) (page_address((sg)->page) + (sg)->offset)
37#define SG_ENT_PHYS_ADDRESS(SG) virt_to_phys(SG_ENT_VIRT_ADDRESS(SG))
38
39/*
40 * Maximum allowable number of contiguous slabs to map,
41 * must be a power of 2. What is the appropriate value ?
42 * The complexity of {map,unmap}_single is linearly dependent on this value.
43 */
44#define IO_TLB_SEGSIZE 128
45
46/*
47 * log of the size of each IO TLB slab. The number of slabs is command line
48 * controllable.
49 */
50#define IO_TLB_SHIFT 11
51
52#define SLABS_PER_PAGE (1 << (PAGE_SHIFT - IO_TLB_SHIFT))
53
54/*
55 * Minimum IO TLB size to bother booting with. Systems with mainly
56 * 64bit capable cards will only lightly use the swiotlb. If we can't
57 * allocate a contiguous 1MB, we're probably in trouble anyway.
58 */
59#define IO_TLB_MIN_SLABS ((1<<20) >> IO_TLB_SHIFT)
60
61int swiotlb_force;
62
63/*
64 * Used to do a quick range check in swiotlb_unmap_single and
65 * swiotlb_sync_single_*, to see if the memory was in fact allocated by this
66 * API.
67 */
68static char *io_tlb_start, *io_tlb_end;
69
70/*
71 * The number of IO TLB blocks (in groups of 64) betweeen io_tlb_start and
72 * io_tlb_end. This is command line adjustable via setup_io_tlb_npages.
73 */
74static unsigned long io_tlb_nslabs;
75
76/*
77 * When the IOMMU overflows we return a fallback buffer. This sets the size.
78 */
79static unsigned long io_tlb_overflow = 32*1024;
80
81void *io_tlb_overflow_buffer;
82
83/*
84 * This is a free list describing the number of free entries available from
85 * each index
86 */
87static unsigned int *io_tlb_list;
88static unsigned int io_tlb_index;
89
90/*
91 * We need to save away the original address corresponding to a mapped entry
92 * for the sync operations.
93 */
94static unsigned char **io_tlb_orig_addr;
95
96/*
97 * Protect the above data structures in the map and unmap calls
98 */
99static DEFINE_SPINLOCK(io_tlb_lock);
100
101static int __init
102setup_io_tlb_npages(char *str)
103{
104 if (isdigit(*str)) {
105 io_tlb_nslabs = simple_strtoul(str, &str, 0);
106 /* avoid tail segment of size < IO_TLB_SEGSIZE */
107 io_tlb_nslabs = ALIGN(io_tlb_nslabs, IO_TLB_SEGSIZE);
108 }
109 if (*str == ',')
110 ++str;
111 if (!strcmp(str, "force"))
112 swiotlb_force = 1;
113 return 1;
114}
115__setup("swiotlb=", setup_io_tlb_npages);
116/* make io_tlb_overflow tunable too? */
117
118/*
119 * Statically reserve bounce buffer space and initialize bounce buffer data
120 * structures for the software IO TLB used to implement the PCI DMA API.
121 */
122void
123swiotlb_init_with_default_size (size_t default_size)
124{
125 unsigned long i;
126
127 if (!io_tlb_nslabs) {
128 io_tlb_nslabs = (default_size >> IO_TLB_SHIFT);
129 io_tlb_nslabs = ALIGN(io_tlb_nslabs, IO_TLB_SEGSIZE);
130 }
131
132 /*
133 * Get IO TLB memory from the low pages
134 */
135 io_tlb_start = alloc_bootmem_low_pages_limit(io_tlb_nslabs *
136 (1 << IO_TLB_SHIFT), 0x100000000);
137 if (!io_tlb_start)
138 panic("Cannot allocate SWIOTLB buffer");
139 io_tlb_end = io_tlb_start + io_tlb_nslabs * (1 << IO_TLB_SHIFT);
140
141 /*
142 * Allocate and initialize the free list array. This array is used
143 * to find contiguous free memory regions of size up to IO_TLB_SEGSIZE
144 * between io_tlb_start and io_tlb_end.
145 */
146 io_tlb_list = alloc_bootmem(io_tlb_nslabs * sizeof(int));
147 for (i = 0; i < io_tlb_nslabs; i++)
148 io_tlb_list[i] = IO_TLB_SEGSIZE - OFFSET(i, IO_TLB_SEGSIZE);
149 io_tlb_index = 0;
150 io_tlb_orig_addr = alloc_bootmem(io_tlb_nslabs * sizeof(char *));
151
152 /*
153 * Get the overflow emergency buffer
154 */
155 io_tlb_overflow_buffer = alloc_bootmem_low(io_tlb_overflow);
156 printk(KERN_INFO "Placing software IO TLB between 0x%lx - 0x%lx\n",
157 virt_to_phys(io_tlb_start), virt_to_phys(io_tlb_end));
158}
159
160void
161swiotlb_init (void)
162{
163 swiotlb_init_with_default_size(64 * (1<<20)); /* default to 64MB */
164}
165
166/*
167 * Systems with larger DMA zones (those that don't support ISA) can
168 * initialize the swiotlb later using the slab allocator if needed.
169 * This should be just like above, but with some error catching.
170 */
171int
172swiotlb_late_init_with_default_size (size_t default_size)
173{
174 unsigned long i, req_nslabs = io_tlb_nslabs;
175 unsigned int order;
176
177 if (!io_tlb_nslabs) {
178 io_tlb_nslabs = (default_size >> IO_TLB_SHIFT);
179 io_tlb_nslabs = ALIGN(io_tlb_nslabs, IO_TLB_SEGSIZE);
180 }
181
182 /*
183 * Get IO TLB memory from the low pages
184 */
185 order = get_order(io_tlb_nslabs * (1 << IO_TLB_SHIFT));
186 io_tlb_nslabs = SLABS_PER_PAGE << order;
187
188 while ((SLABS_PER_PAGE << order) > IO_TLB_MIN_SLABS) {
189 io_tlb_start = (char *)__get_free_pages(GFP_DMA | __GFP_NOWARN,
190 order);
191 if (io_tlb_start)
192 break;
193 order--;
194 }
195
196 if (!io_tlb_start)
197 goto cleanup1;
198
199 if (order != get_order(io_tlb_nslabs * (1 << IO_TLB_SHIFT))) {
200 printk(KERN_WARNING "Warning: only able to allocate %ld MB "
201 "for software IO TLB\n", (PAGE_SIZE << order) >> 20);
202 io_tlb_nslabs = SLABS_PER_PAGE << order;
203 }
204 io_tlb_end = io_tlb_start + io_tlb_nslabs * (1 << IO_TLB_SHIFT);
205 memset(io_tlb_start, 0, io_tlb_nslabs * (1 << IO_TLB_SHIFT));
206
207 /*
208 * Allocate and initialize the free list array. This array is used
209 * to find contiguous free memory regions of size up to IO_TLB_SEGSIZE
210 * between io_tlb_start and io_tlb_end.
211 */
212 io_tlb_list = (unsigned int *)__get_free_pages(GFP_KERNEL,
213 get_order(io_tlb_nslabs * sizeof(int)));
214 if (!io_tlb_list)
215 goto cleanup2;
216
217 for (i = 0; i < io_tlb_nslabs; i++)
218 io_tlb_list[i] = IO_TLB_SEGSIZE - OFFSET(i, IO_TLB_SEGSIZE);
219 io_tlb_index = 0;
220
221 io_tlb_orig_addr = (unsigned char **)__get_free_pages(GFP_KERNEL,
222 get_order(io_tlb_nslabs * sizeof(char *)));
223 if (!io_tlb_orig_addr)
224 goto cleanup3;
225
226 memset(io_tlb_orig_addr, 0, io_tlb_nslabs * sizeof(char *));
227
228 /*
229 * Get the overflow emergency buffer
230 */
231 io_tlb_overflow_buffer = (void *)__get_free_pages(GFP_DMA,
232 get_order(io_tlb_overflow));
233 if (!io_tlb_overflow_buffer)
234 goto cleanup4;
235
236 printk(KERN_INFO "Placing %ldMB software IO TLB between 0x%lx - "
237 "0x%lx\n", (io_tlb_nslabs * (1 << IO_TLB_SHIFT)) >> 20,
238 virt_to_phys(io_tlb_start), virt_to_phys(io_tlb_end));
239
240 return 0;
241
242cleanup4:
243 free_pages((unsigned long)io_tlb_orig_addr, get_order(io_tlb_nslabs *
244 sizeof(char *)));
245 io_tlb_orig_addr = NULL;
246cleanup3:
247 free_pages((unsigned long)io_tlb_list, get_order(io_tlb_nslabs *
248 sizeof(int)));
249 io_tlb_list = NULL;
250 io_tlb_end = NULL;
251cleanup2:
252 free_pages((unsigned long)io_tlb_start, order);
253 io_tlb_start = NULL;
254cleanup1:
255 io_tlb_nslabs = req_nslabs;
256 return -ENOMEM;
257}
258
259static inline int
260address_needs_mapping(struct device *hwdev, dma_addr_t addr)
261{
262 dma_addr_t mask = 0xffffffff;
263 /* If the device has a mask, use it, otherwise default to 32 bits */
264 if (hwdev && hwdev->dma_mask)
265 mask = *hwdev->dma_mask;
266 return (addr & ~mask) != 0;
267}
268
269/*
270 * Allocates bounce buffer and returns its kernel virtual address.
271 */
272static void *
273map_single(struct device *hwdev, char *buffer, size_t size, int dir)
274{
275 unsigned long flags;
276 char *dma_addr;
277 unsigned int nslots, stride, index, wrap;
278 int i;
279
280 /*
281 * For mappings greater than a page, we limit the stride (and
282 * hence alignment) to a page size.
283 */
284 nslots = ALIGN(size, 1 << IO_TLB_SHIFT) >> IO_TLB_SHIFT;
285 if (size > PAGE_SIZE)
286 stride = (1 << (PAGE_SHIFT - IO_TLB_SHIFT));
287 else
288 stride = 1;
289
290 if (!nslots)
291 BUG();
292
293 /*
294 * Find suitable number of IO TLB entries size that will fit this
295 * request and allocate a buffer from that IO TLB pool.
296 */
297 spin_lock_irqsave(&io_tlb_lock, flags);
298 {
299 wrap = index = ALIGN(io_tlb_index, stride);
300
301 if (index >= io_tlb_nslabs)
302 wrap = index = 0;
303
304 do {
305 /*
306 * If we find a slot that indicates we have 'nslots'
307 * number of contiguous buffers, we allocate the
308 * buffers from that slot and mark the entries as '0'
309 * indicating unavailable.
310 */
311 if (io_tlb_list[index] >= nslots) {
312 int count = 0;
313
314 for (i = index; i < (int) (index + nslots); i++)
315 io_tlb_list[i] = 0;
316 for (i = index - 1; (OFFSET(i, IO_TLB_SEGSIZE) != IO_TLB_SEGSIZE -1) && io_tlb_list[i]; i--)
317 io_tlb_list[i] = ++count;
318 dma_addr = io_tlb_start + (index << IO_TLB_SHIFT);
319
320 /*
321 * Update the indices to avoid searching in
322 * the next round.
323 */
324 io_tlb_index = ((index + nslots) < io_tlb_nslabs
325 ? (index + nslots) : 0);
326
327 goto found;
328 }
329 index += stride;
330 if (index >= io_tlb_nslabs)
331 index = 0;
332 } while (index != wrap);
333
334 spin_unlock_irqrestore(&io_tlb_lock, flags);
335 return NULL;
336 }
337 found:
338 spin_unlock_irqrestore(&io_tlb_lock, flags);
339
340 /*
341 * Save away the mapping from the original address to the DMA address.
342 * This is needed when we sync the memory. Then we sync the buffer if
343 * needed.
344 */
345 io_tlb_orig_addr[index] = buffer;
346 if (dir == DMA_TO_DEVICE || dir == DMA_BIDIRECTIONAL)
347 memcpy(dma_addr, buffer, size);
348
349 return dma_addr;
350}
351
352/*
353 * dma_addr is the kernel virtual address of the bounce buffer to unmap.
354 */
355static void
356unmap_single(struct device *hwdev, char *dma_addr, size_t size, int dir)
357{
358 unsigned long flags;
359 int i, count, nslots = ALIGN(size, 1 << IO_TLB_SHIFT) >> IO_TLB_SHIFT;
360 int index = (dma_addr - io_tlb_start) >> IO_TLB_SHIFT;
361 char *buffer = io_tlb_orig_addr[index];
362
363 /*
364 * First, sync the memory before unmapping the entry
365 */
366 if (buffer && ((dir == DMA_FROM_DEVICE) || (dir == DMA_BIDIRECTIONAL)))
367 /*
368 * bounce... copy the data back into the original buffer * and
369 * delete the bounce buffer.
370 */
371 memcpy(buffer, dma_addr, size);
372
373 /*
374 * Return the buffer to the free list by setting the corresponding
375 * entries to indicate the number of contigous entries available.
376 * While returning the entries to the free list, we merge the entries
377 * with slots below and above the pool being returned.
378 */
379 spin_lock_irqsave(&io_tlb_lock, flags);
380 {
381 count = ((index + nslots) < ALIGN(index + 1, IO_TLB_SEGSIZE) ?
382 io_tlb_list[index + nslots] : 0);
383 /*
384 * Step 1: return the slots to the free list, merging the
385 * slots with superceeding slots
386 */
387 for (i = index + nslots - 1; i >= index; i--)
388 io_tlb_list[i] = ++count;
389 /*
390 * Step 2: merge the returned slots with the preceding slots,
391 * if available (non zero)
392 */
393 for (i = index - 1; (OFFSET(i, IO_TLB_SEGSIZE) != IO_TLB_SEGSIZE -1) && io_tlb_list[i]; i--)
394 io_tlb_list[i] = ++count;
395 }
396 spin_unlock_irqrestore(&io_tlb_lock, flags);
397}
398
399static void
400sync_single(struct device *hwdev, char *dma_addr, size_t size, int dir)
401{
402 int index = (dma_addr - io_tlb_start) >> IO_TLB_SHIFT;
403 char *buffer = io_tlb_orig_addr[index];
404
405 /*
406 * bounce... copy the data back into/from the original buffer
407 * XXX How do you handle DMA_BIDIRECTIONAL here ?
408 */
409 if (dir == DMA_FROM_DEVICE)
410 memcpy(buffer, dma_addr, size);
411 else if (dir == DMA_TO_DEVICE)
412 memcpy(dma_addr, buffer, size);
413 else
414 BUG();
415}
416
417void *
418swiotlb_alloc_coherent(struct device *hwdev, size_t size,
419 dma_addr_t *dma_handle, gfp_t flags)
420{
421 unsigned long dev_addr;
422 void *ret;
423 int order = get_order(size);
424
425 /*
426 * XXX fix me: the DMA API should pass us an explicit DMA mask
427 * instead, or use ZONE_DMA32 (ia64 overloads ZONE_DMA to be a ~32
428 * bit range instead of a 16MB one).
429 */
430 flags |= GFP_DMA;
431
432 ret = (void *)__get_free_pages(flags, order);
433 if (ret && address_needs_mapping(hwdev, virt_to_phys(ret))) {
434 /*
435 * The allocated memory isn't reachable by the device.
436 * Fall back on swiotlb_map_single().
437 */
438 free_pages((unsigned long) ret, order);
439 ret = NULL;
440 }
441 if (!ret) {
442 /*
443 * We are either out of memory or the device can't DMA
444 * to GFP_DMA memory; fall back on
445 * swiotlb_map_single(), which will grab memory from
446 * the lowest available address range.
447 */
448 dma_addr_t handle;
449 handle = swiotlb_map_single(NULL, NULL, size, DMA_FROM_DEVICE);
450 if (dma_mapping_error(handle))
451 return NULL;
452
453 ret = phys_to_virt(handle);
454 }
455
456 memset(ret, 0, size);
457 dev_addr = virt_to_phys(ret);
458
459 /* Confirm address can be DMA'd by device */
460 if (address_needs_mapping(hwdev, dev_addr)) {
461 printk("hwdev DMA mask = 0x%016Lx, dev_addr = 0x%016lx\n",
462 (unsigned long long)*hwdev->dma_mask, dev_addr);
463 panic("swiotlb_alloc_coherent: allocated memory is out of "
464 "range for device");
465 }
466 *dma_handle = dev_addr;
467 return ret;
468}
469
470void
471swiotlb_free_coherent(struct device *hwdev, size_t size, void *vaddr,
472 dma_addr_t dma_handle)
473{
474 if (!(vaddr >= (void *)io_tlb_start
475 && vaddr < (void *)io_tlb_end))
476 free_pages((unsigned long) vaddr, get_order(size));
477 else
478 /* DMA_TO_DEVICE to avoid memcpy in unmap_single */
479 swiotlb_unmap_single (hwdev, dma_handle, size, DMA_TO_DEVICE);
480}
481
482static void
483swiotlb_full(struct device *dev, size_t size, int dir, int do_panic)
484{
485 /*
486 * Ran out of IOMMU space for this operation. This is very bad.
487 * Unfortunately the drivers cannot handle this operation properly.
488 * unless they check for pci_dma_mapping_error (most don't)
489 * When the mapping is small enough return a static buffer to limit
490 * the damage, or panic when the transfer is too big.
491 */
492 printk(KERN_ERR "PCI-DMA: Out of SW-IOMMU space for %lu bytes at "
493 "device %s\n", size, dev ? dev->bus_id : "?");
494
495 if (size > io_tlb_overflow && do_panic) {
496 if (dir == PCI_DMA_FROMDEVICE || dir == PCI_DMA_BIDIRECTIONAL)
497 panic("PCI-DMA: Memory would be corrupted\n");
498 if (dir == PCI_DMA_TODEVICE || dir == PCI_DMA_BIDIRECTIONAL)
499 panic("PCI-DMA: Random memory would be DMAed\n");
500 }
501}
502
503/*
504 * Map a single buffer of the indicated size for DMA in streaming mode. The
505 * PCI address to use is returned.
506 *
507 * Once the device is given the dma address, the device owns this memory until
508 * either swiotlb_unmap_single or swiotlb_dma_sync_single is performed.
509 */
510dma_addr_t
511swiotlb_map_single(struct device *hwdev, void *ptr, size_t size, int dir)
512{
513 unsigned long dev_addr = virt_to_phys(ptr);
514 void *map;
515
516 if (dir == DMA_NONE)
517 BUG();
518 /*
519 * If the pointer passed in happens to be in the device's DMA window,
520 * we can safely return the device addr and not worry about bounce
521 * buffering it.
522 */
523 if (!address_needs_mapping(hwdev, dev_addr) && !swiotlb_force)
524 return dev_addr;
525
526 /*
527 * Oh well, have to allocate and map a bounce buffer.
528 */
529 map = map_single(hwdev, ptr, size, dir);
530 if (!map) {
531 swiotlb_full(hwdev, size, dir, 1);
532 map = io_tlb_overflow_buffer;
533 }
534
535 dev_addr = virt_to_phys(map);
536
537 /*
538 * Ensure that the address returned is DMA'ble
539 */
540 if (address_needs_mapping(hwdev, dev_addr))
541 panic("map_single: bounce buffer is not DMA'ble");
542
543 return dev_addr;
544}
545
546/*
547 * Since DMA is i-cache coherent, any (complete) pages that were written via
548 * DMA can be marked as "clean" so that lazy_mmu_prot_update() doesn't have to
549 * flush them when they get mapped into an executable vm-area.
550 */
551static void
552mark_clean(void *addr, size_t size)
553{
554 unsigned long pg_addr, end;
555
556 pg_addr = PAGE_ALIGN((unsigned long) addr);
557 end = (unsigned long) addr + size;
558 while (pg_addr + PAGE_SIZE <= end) {
559 struct page *page = virt_to_page(pg_addr);
560 set_bit(PG_arch_1, &page->flags);
561 pg_addr += PAGE_SIZE;
562 }
563}
564
565/*
566 * Unmap a single streaming mode DMA translation. The dma_addr and size must
567 * match what was provided for in a previous swiotlb_map_single call. All
568 * other usages are undefined.
569 *
570 * After this call, reads by the cpu to the buffer are guaranteed to see
571 * whatever the device wrote there.
572 */
573void
574swiotlb_unmap_single(struct device *hwdev, dma_addr_t dev_addr, size_t size,
575 int dir)
576{
577 char *dma_addr = phys_to_virt(dev_addr);
578
579 if (dir == DMA_NONE)
580 BUG();
581 if (dma_addr >= io_tlb_start && dma_addr < io_tlb_end)
582 unmap_single(hwdev, dma_addr, size, dir);
583 else if (dir == DMA_FROM_DEVICE)
584 mark_clean(dma_addr, size);
585}
586
587/*
588 * Make physical memory consistent for a single streaming mode DMA translation
589 * after a transfer.
590 *
591 * If you perform a swiotlb_map_single() but wish to interrogate the buffer
592 * using the cpu, yet do not wish to teardown the PCI dma mapping, you must
593 * call this function before doing so. At the next point you give the PCI dma
594 * address back to the card, you must first perform a
595 * swiotlb_dma_sync_for_device, and then the device again owns the buffer
596 */
597void
598swiotlb_sync_single_for_cpu(struct device *hwdev, dma_addr_t dev_addr,
599 size_t size, int dir)
600{
601 char *dma_addr = phys_to_virt(dev_addr);
602
603 if (dir == DMA_NONE)
604 BUG();
605 if (dma_addr >= io_tlb_start && dma_addr < io_tlb_end)
606 sync_single(hwdev, dma_addr, size, dir);
607 else if (dir == DMA_FROM_DEVICE)
608 mark_clean(dma_addr, size);
609}
610
611void
612swiotlb_sync_single_for_device(struct device *hwdev, dma_addr_t dev_addr,
613 size_t size, int dir)
614{
615 char *dma_addr = phys_to_virt(dev_addr);
616
617 if (dir == DMA_NONE)
618 BUG();
619 if (dma_addr >= io_tlb_start && dma_addr < io_tlb_end)
620 sync_single(hwdev, dma_addr, size, dir);
621 else if (dir == DMA_FROM_DEVICE)
622 mark_clean(dma_addr, size);
623}
624
625/*
626 * Map a set of buffers described by scatterlist in streaming mode for DMA.
627 * This is the scatter-gather version of the above swiotlb_map_single
628 * interface. Here the scatter gather list elements are each tagged with the
629 * appropriate dma address and length. They are obtained via
630 * sg_dma_{address,length}(SG).
631 *
632 * NOTE: An implementation may be able to use a smaller number of
633 * DMA address/length pairs than there are SG table elements.
634 * (for example via virtual mapping capabilities)
635 * The routine returns the number of addr/length pairs actually
636 * used, at most nents.
637 *
638 * Device ownership issues as mentioned above for swiotlb_map_single are the
639 * same here.
640 */
641int
642swiotlb_map_sg(struct device *hwdev, struct scatterlist *sg, int nelems,
643 int dir)
644{
645 void *addr;
646 unsigned long dev_addr;
647 int i;
648
649 if (dir == DMA_NONE)
650 BUG();
651
652 for (i = 0; i < nelems; i++, sg++) {
653 addr = SG_ENT_VIRT_ADDRESS(sg);
654 dev_addr = virt_to_phys(addr);
655 if (swiotlb_force || address_needs_mapping(hwdev, dev_addr)) {
656 sg->dma_address = (dma_addr_t) virt_to_phys(map_single(hwdev, addr, sg->length, dir));
657 if (!sg->dma_address) {
658 /* Don't panic here, we expect map_sg users
659 to do proper error handling. */
660 swiotlb_full(hwdev, sg->length, dir, 0);
661 swiotlb_unmap_sg(hwdev, sg - i, i, dir);
662 sg[0].dma_length = 0;
663 return 0;
664 }
665 } else
666 sg->dma_address = dev_addr;
667 sg->dma_length = sg->length;
668 }
669 return nelems;
670}
671
672/*
673 * Unmap a set of streaming mode DMA translations. Again, cpu read rules
674 * concerning calls here are the same as for swiotlb_unmap_single() above.
675 */
676void
677swiotlb_unmap_sg(struct device *hwdev, struct scatterlist *sg, int nelems,
678 int dir)
679{
680 int i;
681
682 if (dir == DMA_NONE)
683 BUG();
684
685 for (i = 0; i < nelems; i++, sg++)
686 if (sg->dma_address != SG_ENT_PHYS_ADDRESS(sg))
687 unmap_single(hwdev, (void *) phys_to_virt(sg->dma_address), sg->dma_length, dir);
688 else if (dir == DMA_FROM_DEVICE)
689 mark_clean(SG_ENT_VIRT_ADDRESS(sg), sg->dma_length);
690}
691
692/*
693 * Make physical memory consistent for a set of streaming mode DMA translations
694 * after a transfer.
695 *
696 * The same as swiotlb_sync_single_* but for a scatter-gather list, same rules
697 * and usage.
698 */
699void
700swiotlb_sync_sg_for_cpu(struct device *hwdev, struct scatterlist *sg,
701 int nelems, int dir)
702{
703 int i;
704
705 if (dir == DMA_NONE)
706 BUG();
707
708 for (i = 0; i < nelems; i++, sg++)
709 if (sg->dma_address != SG_ENT_PHYS_ADDRESS(sg))
710 sync_single(hwdev, (void *) sg->dma_address,
711 sg->dma_length, dir);
712}
713
714void
715swiotlb_sync_sg_for_device(struct device *hwdev, struct scatterlist *sg,
716 int nelems, int dir)
717{
718 int i;
719
720 if (dir == DMA_NONE)
721 BUG();
722
723 for (i = 0; i < nelems; i++, sg++)
724 if (sg->dma_address != SG_ENT_PHYS_ADDRESS(sg))
725 sync_single(hwdev, (void *) sg->dma_address,
726 sg->dma_length, dir);
727}
728
729int
730swiotlb_dma_mapping_error(dma_addr_t dma_addr)
731{
732 return (dma_addr == virt_to_phys(io_tlb_overflow_buffer));
733}
734
735/*
736 * Return whether the given PCI device DMA address mask can be supported
737 * properly. For example, if your device can only drive the low 24-bits
738 * during PCI bus mastering, then you would pass 0x00ffffff as the mask to
739 * this function.
740 */
741int
742swiotlb_dma_supported (struct device *hwdev, u64 mask)
743{
744 return (virt_to_phys (io_tlb_end) - 1) <= mask;
745}
746
747EXPORT_SYMBOL(swiotlb_init);
748EXPORT_SYMBOL(swiotlb_map_single);
749EXPORT_SYMBOL(swiotlb_unmap_single);
750EXPORT_SYMBOL(swiotlb_map_sg);
751EXPORT_SYMBOL(swiotlb_unmap_sg);
752EXPORT_SYMBOL(swiotlb_sync_single_for_cpu);
753EXPORT_SYMBOL(swiotlb_sync_single_for_device);
754EXPORT_SYMBOL(swiotlb_sync_sg_for_cpu);
755EXPORT_SYMBOL(swiotlb_sync_sg_for_device);
756EXPORT_SYMBOL(swiotlb_dma_mapping_error);
757EXPORT_SYMBOL(swiotlb_alloc_coherent);
758EXPORT_SYMBOL(swiotlb_free_coherent);
759EXPORT_SYMBOL(swiotlb_dma_supported);
diff --git a/arch/ia64/oprofile/Kconfig b/arch/ia64/oprofile/Kconfig
index 56e6f614b04a..97271ab484dc 100644
--- a/arch/ia64/oprofile/Kconfig
+++ b/arch/ia64/oprofile/Kconfig
@@ -1,7 +1,3 @@
1
2menu "Profiling support"
3 depends on EXPERIMENTAL
4
5config PROFILING 1config PROFILING
6 bool "Profiling support (EXPERIMENTAL)" 2 bool "Profiling support (EXPERIMENTAL)"
7 help 3 help
@@ -22,5 +18,3 @@ config OPROFILE
22 18
23 If unsure, say N. 19 If unsure, say N.
24 20
25endmenu
26
diff --git a/arch/ia64/sn/pci/pcibr/pcibr_provider.c b/arch/ia64/sn/pci/pcibr/pcibr_provider.c
index 7b03b8084ffc..1f500c81002c 100644
--- a/arch/ia64/sn/pci/pcibr/pcibr_provider.c
+++ b/arch/ia64/sn/pci/pcibr/pcibr_provider.c
@@ -212,13 +212,13 @@ void pcibr_target_interrupt(struct sn_irq_info *sn_irq_info)
212 pdi_pcibus_info; 212 pdi_pcibus_info;
213 213
214 /* Disable the device's IRQ */ 214 /* Disable the device's IRQ */
215 pcireg_intr_enable_bit_clr(pcibus_info, bit); 215 pcireg_intr_enable_bit_clr(pcibus_info, (1 << bit));
216 216
217 /* Change the device's IRQ */ 217 /* Change the device's IRQ */
218 pcireg_intr_addr_addr_set(pcibus_info, bit, xtalk_addr); 218 pcireg_intr_addr_addr_set(pcibus_info, bit, xtalk_addr);
219 219
220 /* Re-enable the device's IRQ */ 220 /* Re-enable the device's IRQ */
221 pcireg_intr_enable_bit_set(pcibus_info, bit); 221 pcireg_intr_enable_bit_set(pcibus_info, (1 << bit));
222 222
223 pcibr_force_interrupt(sn_irq_info); 223 pcibr_force_interrupt(sn_irq_info);
224 } 224 }
diff --git a/arch/ia64/sn/pci/pcibr/pcibr_reg.c b/arch/ia64/sn/pci/pcibr/pcibr_reg.c
index 4f718c3e93d3..5d534091262c 100644
--- a/arch/ia64/sn/pci/pcibr/pcibr_reg.c
+++ b/arch/ia64/sn/pci/pcibr/pcibr_reg.c
@@ -131,7 +131,7 @@ void pcireg_intr_enable_bit_clr(struct pcibus_info *pcibus_info, uint64_t bits)
131 __sn_clrq_relaxed(&ptr->tio.cp_int_enable, bits); 131 __sn_clrq_relaxed(&ptr->tio.cp_int_enable, bits);
132 break; 132 break;
133 case PCIBR_BRIDGETYPE_PIC: 133 case PCIBR_BRIDGETYPE_PIC:
134 __sn_clrq_relaxed(&ptr->pic.p_int_enable, ~bits); 134 __sn_clrq_relaxed(&ptr->pic.p_int_enable, bits);
135 break; 135 break;
136 default: 136 default:
137 panic 137 panic
diff --git a/arch/m32r/kernel/process.c b/arch/m32r/kernel/process.c
index ea13a8f4d8b0..cc4b571e5db7 100644
--- a/arch/m32r/kernel/process.c
+++ b/arch/m32r/kernel/process.c
@@ -104,7 +104,9 @@ void cpu_idle (void)
104 104
105 idle(); 105 idle();
106 } 106 }
107 preempt_enable_no_resched();
107 schedule(); 108 schedule();
109 preempt_disable();
108 } 110 }
109} 111}
110 112
diff --git a/arch/m32r/kernel/smpboot.c b/arch/m32r/kernel/smpboot.c
index 640d592ea072..b90c54169fa5 100644
--- a/arch/m32r/kernel/smpboot.c
+++ b/arch/m32r/kernel/smpboot.c
@@ -426,6 +426,7 @@ void __init smp_cpus_done(unsigned int max_cpus)
426int __init start_secondary(void *unused) 426int __init start_secondary(void *unused)
427{ 427{
428 cpu_init(); 428 cpu_init();
429 preempt_disable();
429 smp_callin(); 430 smp_callin();
430 while (!cpu_isset(smp_processor_id(), smp_commenced_mask)) 431 while (!cpu_isset(smp_processor_id(), smp_commenced_mask))
431 cpu_relax(); 432 cpu_relax();
diff --git a/arch/m68k/atari/time.c b/arch/m68k/atari/time.c
index 6df7fb60dfea..e79bbc94216d 100644
--- a/arch/m68k/atari/time.c
+++ b/arch/m68k/atari/time.c
@@ -212,10 +212,8 @@ int atari_tt_hwclk( int op, struct rtc_time *t )
212 * additionally the RTC_SET bit is set to prevent an update cycle. 212 * additionally the RTC_SET bit is set to prevent an update cycle.
213 */ 213 */
214 214
215 while( RTC_READ(RTC_FREQ_SELECT) & RTC_UIP ) { 215 while( RTC_READ(RTC_FREQ_SELECT) & RTC_UIP )
216 current->state = TASK_INTERRUPTIBLE; 216 schedule_timeout_interruptible(HWCLK_POLL_INTERVAL);
217 schedule_timeout(HWCLK_POLL_INTERVAL);
218 }
219 217
220 local_irq_save(flags); 218 local_irq_save(flags);
221 RTC_WRITE( RTC_CONTROL, ctrl | RTC_SET ); 219 RTC_WRITE( RTC_CONTROL, ctrl | RTC_SET );
diff --git a/arch/m68k/kernel/process.c b/arch/m68k/kernel/process.c
index 11b1b90ba6ba..13d109328a42 100644
--- a/arch/m68k/kernel/process.c
+++ b/arch/m68k/kernel/process.c
@@ -102,7 +102,9 @@ void cpu_idle(void)
102 while (1) { 102 while (1) {
103 while (!need_resched()) 103 while (!need_resched())
104 idle(); 104 idle();
105 preempt_enable_no_resched();
105 schedule(); 106 schedule();
107 preempt_disable();
106 } 108 }
107} 109}
108 110
diff --git a/arch/m68k/kernel/ptrace.c b/arch/m68k/kernel/ptrace.c
index f7f1d2e5b90b..7e54422685cf 100644
--- a/arch/m68k/kernel/ptrace.c
+++ b/arch/m68k/kernel/ptrace.c
@@ -121,48 +121,11 @@ void ptrace_disable(struct task_struct *child)
121 child->thread.work.syscall_trace = 0; 121 child->thread.work.syscall_trace = 0;
122} 122}
123 123
124asmlinkage long sys_ptrace(long request, long pid, long addr, long data) 124long arch_ptrace(struct task_struct *child, long request, long addr, long data)
125{ 125{
126 struct task_struct *child;
127 unsigned long tmp; 126 unsigned long tmp;
128 int i, ret = 0; 127 int i, ret = 0;
129 128
130 lock_kernel();
131 if (request == PTRACE_TRACEME) {
132 /* are we already being traced? */
133 if (current->ptrace & PT_PTRACED) {
134 ret = -EPERM;
135 goto out;
136 }
137 /* set the ptrace bit in the process flags. */
138 current->ptrace |= PT_PTRACED;
139 goto out;
140 }
141 read_lock(&tasklist_lock);
142 child = find_task_by_pid(pid);
143 if (child)
144 get_task_struct(child);
145 read_unlock(&tasklist_lock);
146 if (unlikely(!child)) {
147 ret = -ESRCH;
148 goto out;
149 }
150
151 /* you may not mess with init */
152 if (unlikely(pid == 1)) {
153 ret = -EPERM;
154 goto out_tsk;
155 }
156
157 if (request == PTRACE_ATTACH) {
158 ret = ptrace_attach(child);
159 goto out_tsk;
160 }
161
162 ret = ptrace_check_attach(child, request == PTRACE_KILL);
163 if (ret)
164 goto out_tsk;
165
166 switch (request) { 129 switch (request) {
167 /* when I and D space are separate, these will need to be fixed. */ 130 /* when I and D space are separate, these will need to be fixed. */
168 case PTRACE_PEEKTEXT: /* read word at location addr. */ 131 case PTRACE_PEEKTEXT: /* read word at location addr. */
@@ -317,14 +280,10 @@ asmlinkage long sys_ptrace(long request, long pid, long addr, long data)
317 ret = ptrace_request(child, request, addr, data); 280 ret = ptrace_request(child, request, addr, data);
318 break; 281 break;
319 } 282 }
320out_tsk: 283
321 put_task_struct(child);
322out:
323 unlock_kernel();
324 return ret; 284 return ret;
325out_eio: 285out_eio:
326 ret = -EIO; 286 return -EIO;
327 goto out_tsk;
328} 287}
329 288
330asmlinkage void syscall_trace(void) 289asmlinkage void syscall_trace(void)
diff --git a/arch/m68knommu/Kconfig b/arch/m68knommu/Kconfig
index 8520df9cee6d..b96498120fe9 100644
--- a/arch/m68knommu/Kconfig
+++ b/arch/m68knommu/Kconfig
@@ -71,6 +71,11 @@ config M5206e
71 help 71 help
72 Motorola ColdFire 5206e processor support. 72 Motorola ColdFire 5206e processor support.
73 73
74config M520x
75 bool "MCF520x"
76 help
77 Freescale Coldfire 5207/5208 processor support.
78
74config M523x 79config M523x
75 bool "MCF523x" 80 bool "MCF523x"
76 help 81 help
@@ -120,7 +125,7 @@ config M527x
120 125
121config COLDFIRE 126config COLDFIRE
122 bool 127 bool
123 depends on (M5206 || M5206e || M523x || M5249 || M527x || M5272 || M528x || M5307 || M5407) 128 depends on (M5206 || M5206e || M520x || M523x || M5249 || M527x || M5272 || M528x || M5307 || M5407)
124 default y 129 default y
125 130
126choice 131choice
@@ -322,6 +327,12 @@ config ELITE
322 help 327 help
323 Support for the Motorola M5206eLITE board. 328 Support for the Motorola M5206eLITE board.
324 329
330config M5208EVB
331 bool "Freescale M5208EVB board support"
332 depends on M520x
333 help
334 Support for the Freescale Coldfire M5208EVB.
335
325config M5235EVB 336config M5235EVB
326 bool "Freescale M5235EVB support" 337 bool "Freescale M5235EVB support"
327 depends on M523x 338 depends on M523x
@@ -465,10 +476,10 @@ config ARNEWSH
465 default y 476 default y
466 depends on (ARN5206 || ARN5307) 477 depends on (ARN5206 || ARN5307)
467 478
468config MOTOROLA 479config FREESCALE
469 bool 480 bool
470 default y 481 default y
471 depends on (M5206eC3 || M5235EVB || M5249C3 || M5271EVB || M5272C3 || M5275EVB || M5282EVB || M5307C3 || M5407C3) 482 depends on (M5206eC3 || M5208EVB || M5235EVB || M5249C3 || M5271EVB || M5272C3 || M5275EVB || M5282EVB || M5307C3 || M5407C3)
472 483
473config HW_FEITH 484config HW_FEITH
474 bool 485 bool
diff --git a/arch/m68knommu/Makefile b/arch/m68knommu/Makefile
index b8fdf191b8f6..b6b5c14e55fd 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_M520x) := 520x
17platform-$(CONFIG_M523x) := 523x 18platform-$(CONFIG_M523x) := 523x
18platform-$(CONFIG_M5249) := 5249 19platform-$(CONFIG_M5249) := 5249
19platform-$(CONFIG_M527x) := 527x 20platform-$(CONFIG_M527x) := 527x
@@ -29,7 +30,7 @@ board-$(CONFIG_UCDIMM) := ucdimm
29board-$(CONFIG_UCQUICC) := uCquicc 30board-$(CONFIG_UCQUICC) := uCquicc
30board-$(CONFIG_DRAGEN2) := de2 31board-$(CONFIG_DRAGEN2) := de2
31board-$(CONFIG_ARNEWSH) := ARNEWSH 32board-$(CONFIG_ARNEWSH) := ARNEWSH
32board-$(CONFIG_MOTOROLA) := MOTOROLA 33board-$(CONFIG_FREESCALE) := FREESCALE
33board-$(CONFIG_M5235EVB) := M5235EVB 34board-$(CONFIG_M5235EVB) := M5235EVB
34board-$(CONFIG_M5271EVB) := M5271EVB 35board-$(CONFIG_M5271EVB) := M5271EVB
35board-$(CONFIG_M5275EVB) := M5275EVB 36board-$(CONFIG_M5275EVB) := M5275EVB
@@ -41,6 +42,7 @@ board-$(CONFIG_SECUREEDGEMP3) := MP3
41board-$(CONFIG_CLEOPATRA) := CLEOPATRA 42board-$(CONFIG_CLEOPATRA) := CLEOPATRA
42board-$(CONFIG_senTec) := senTec 43board-$(CONFIG_senTec) := senTec
43board-$(CONFIG_SNEHA) := SNEHA 44board-$(CONFIG_SNEHA) := SNEHA
45board-$(CONFIG_M5208EVB) := M5208EVB
44board-$(CONFIG_MOD5272) := MOD5272 46board-$(CONFIG_MOD5272) := MOD5272
45BOARD := $(board-y) 47BOARD := $(board-y)
46 48
@@ -56,6 +58,7 @@ MODEL := $(model-y)
56# 58#
57cpuclass-$(CONFIG_M5206) := 5307 59cpuclass-$(CONFIG_M5206) := 5307
58cpuclass-$(CONFIG_M5206e) := 5307 60cpuclass-$(CONFIG_M5206e) := 5307
61cpuclass-$(CONFIG_M520x) := 5307
59cpuclass-$(CONFIG_M523x) := 5307 62cpuclass-$(CONFIG_M523x) := 5307
60cpuclass-$(CONFIG_M5249) := 5307 63cpuclass-$(CONFIG_M5249) := 5307
61cpuclass-$(CONFIG_M527x) := 5307 64cpuclass-$(CONFIG_M527x) := 5307
@@ -80,6 +83,7 @@ export PLATFORM BOARD MODEL CPUCLASS
80# 83#
81cflags-$(CONFIG_M5206) := -m5200 -Wa,-S -Wa,-m5200 84cflags-$(CONFIG_M5206) := -m5200 -Wa,-S -Wa,-m5200
82cflags-$(CONFIG_M5206e) := -m5200 -Wa,-S -Wa,-m5200 85cflags-$(CONFIG_M5206e) := -m5200 -Wa,-S -Wa,-m5200
86cflags-$(CONFIG_M520x) := -m5307 -Wa,-S -Wa,-m5307
83cflags-$(CONFIG_M523x) := -m5307 -Wa,-S -Wa,-m5307 87cflags-$(CONFIG_M523x) := -m5307 -Wa,-S -Wa,-m5307
84cflags-$(CONFIG_M5249) := -m5200 -Wa,-S -Wa,-m5200 88cflags-$(CONFIG_M5249) := -m5200 -Wa,-S -Wa,-m5200
85cflags-$(CONFIG_M527x) := -m5307 -Wa,-S -Wa,-m5307 89cflags-$(CONFIG_M527x) := -m5307 -Wa,-S -Wa,-m5307
@@ -95,7 +99,6 @@ cflags-$(CONFIG_M68360) := -m68332
95AFLAGS += $(cflags-y) 99AFLAGS += $(cflags-y)
96 100
97CFLAGS += $(cflags-y) 101CFLAGS += $(cflags-y)
98CFLAGS += -fno-builtin
99CFLAGS += -O1 -g 102CFLAGS += -O1 -g
100CFLAGS += -D__linux__ 103CFLAGS += -D__linux__
101CFLAGS += -DUTS_SYSNAME=\"uClinux\" 104CFLAGS += -DUTS_SYSNAME=\"uClinux\"
diff --git a/arch/m68knommu/kernel/asm-offsets.c b/arch/m68knommu/kernel/asm-offsets.c
index cd3ffe12653e..b988c7bdc6e4 100644
--- a/arch/m68knommu/kernel/asm-offsets.c
+++ b/arch/m68knommu/kernel/asm-offsets.c
@@ -15,6 +15,7 @@
15#include <linux/hardirq.h> 15#include <linux/hardirq.h>
16#include <asm/bootinfo.h> 16#include <asm/bootinfo.h>
17#include <asm/irq.h> 17#include <asm/irq.h>
18#include <asm/irqnode.h>
18#include <asm/thread_info.h> 19#include <asm/thread_info.h>
19 20
20#define DEFINE(sym, val) \ 21#define DEFINE(sym, val) \
diff --git a/arch/m68knommu/kernel/ptrace.c b/arch/m68knommu/kernel/ptrace.c
index 621d7b91ccfe..262ab8c72e5f 100644
--- a/arch/m68knommu/kernel/ptrace.c
+++ b/arch/m68knommu/kernel/ptrace.c
@@ -101,43 +101,10 @@ void ptrace_disable(struct task_struct *child)
101 put_reg(child, PT_SR, tmp); 101 put_reg(child, PT_SR, tmp);
102} 102}
103 103
104asmlinkage long sys_ptrace(long request, long pid, long addr, long data) 104long arch_ptrace(truct task_struct *child, long request, long addr, long data)
105{ 105{
106 struct task_struct *child;
107 int ret; 106 int ret;
108 107
109 lock_kernel();
110 ret = -EPERM;
111 if (request == PTRACE_TRACEME) {
112 /* are we already being traced? */
113 if (current->ptrace & PT_PTRACED)
114 goto out;
115 /* set the ptrace bit in the process flags. */
116 current->ptrace |= PT_PTRACED;
117 ret = 0;
118 goto out;
119 }
120 ret = -ESRCH;
121 read_lock(&tasklist_lock);
122 child = find_task_by_pid(pid);
123 if (child)
124 get_task_struct(child);
125 read_unlock(&tasklist_lock);
126 if (!child)
127 goto out;
128
129 ret = -EPERM;
130 if (pid == 1) /* you may not mess with init */
131 goto out_tsk;
132
133 if (request == PTRACE_ATTACH) {
134 ret = ptrace_attach(child);
135 goto out_tsk;
136 }
137 ret = ptrace_check_attach(child, request == PTRACE_KILL);
138 if (ret < 0)
139 goto out_tsk;
140
141 switch (request) { 108 switch (request) {
142 /* when I and D space are separate, these will need to be fixed. */ 109 /* when I and D space are separate, these will need to be fixed. */
143 case PTRACE_PEEKTEXT: /* read word at location addr. */ 110 case PTRACE_PEEKTEXT: /* read word at location addr. */
@@ -357,10 +324,6 @@ asmlinkage long sys_ptrace(long request, long pid, long addr, long data)
357 ret = -EIO; 324 ret = -EIO;
358 break; 325 break;
359 } 326 }
360out_tsk:
361 put_task_struct(child);
362out:
363 unlock_kernel();
364 return ret; 327 return ret;
365} 328}
366 329
diff --git a/arch/m68knommu/kernel/setup.c b/arch/m68knommu/kernel/setup.c
index a220345e9746..abb80fa2b940 100644
--- a/arch/m68knommu/kernel/setup.c
+++ b/arch/m68knommu/kernel/setup.c
@@ -107,6 +107,9 @@ void (*mach_power_off)( void ) = NULL;
107#if defined(CONFIG_M5206e) 107#if defined(CONFIG_M5206e)
108 #define CPU "COLDFIRE(m5206e)" 108 #define CPU "COLDFIRE(m5206e)"
109#endif 109#endif
110#if defined(CONFIG_M520x)
111 #define CPU "COLDFIRE(m520x)"
112#endif
110#if defined(CONFIG_M523x) 113#if defined(CONFIG_M523x)
111 #define CPU "COLDFIRE(m523x)" 114 #define CPU "COLDFIRE(m523x)"
112#endif 115#endif
@@ -132,7 +135,7 @@ void (*mach_power_off)( void ) = NULL;
132 #define CPU "COLDFIRE(m5407)" 135 #define CPU "COLDFIRE(m5407)"
133#endif 136#endif
134#ifndef CPU 137#ifndef CPU
135 #define CPU "UNKOWN" 138 #define CPU "UNKNOWN"
136#endif 139#endif
137 140
138/* (es) */ 141/* (es) */
diff --git a/arch/m68knommu/kernel/vmlinux.lds.S b/arch/m68knommu/kernel/vmlinux.lds.S
index 47f06787190d..0eab92ca4b97 100644
--- a/arch/m68knommu/kernel/vmlinux.lds.S
+++ b/arch/m68knommu/kernel/vmlinux.lds.S
@@ -125,6 +125,14 @@
125#endif 125#endif
126 126
127/* 127/*
128 * The Freescale 5208EVB board has 32MB of RAM.
129 */
130#if defined(CONFIG_M5208EVB)
131#define RAM_START 0x40020000
132#define RAM_LENGTH 0x01e00000
133#endif
134
135/*
128 * The senTec COBRA5272 board has nearly the same memory layout as 136 * The senTec COBRA5272 board has nearly the same memory layout as
129 * the M5272C3. We assume 16MiB ram. 137 * the M5272C3. We assume 16MiB ram.
130 */ 138 */
@@ -275,6 +283,7 @@ SECTIONS {
275 *(__ksymtab_strings) 283 *(__ksymtab_strings)
276 284
277 /* Built-in module parameters */ 285 /* Built-in module parameters */
286 . = ALIGN(4) ;
278 __start___param = .; 287 __start___param = .;
279 *(__param) 288 *(__param)
280 __stop___param = .; 289 __stop___param = .;
diff --git a/arch/m68knommu/platform/520x/Makefile b/arch/m68knommu/platform/520x/Makefile
new file mode 100644
index 000000000000..e861b05106bc
--- /dev/null
+++ b/arch/m68knommu/platform/520x/Makefile
@@ -0,0 +1,19 @@
1#
2# Makefile for the M5208 specific file.
3#
4
5#
6# If you want to play with the HW breakpoints then you will
7# need to add define this, which will give you a stack backtrace
8# on the console port whenever a DBG interrupt occurs. You have to
9# set up you HW breakpoints to trigger a DBG interrupt:
10#
11# EXTRA_CFLAGS += -DTRAP_DBG_INTERRUPT
12# EXTRA_AFLAGS += -DTRAP_DBG_INTERRUPT
13#
14
15ifdef CONFIG_FULLDEBUG
16AFLAGS += -DDEBUGGER_COMPATIBLE_CACHE=1
17endif
18
19obj-y := config.o
diff --git a/arch/m68knommu/platform/520x/config.c b/arch/m68knommu/platform/520x/config.c
new file mode 100644
index 000000000000..71dea2e0f452
--- /dev/null
+++ b/arch/m68knommu/platform/520x/config.c
@@ -0,0 +1,65 @@
1/***************************************************************************/
2
3/*
4 * linux/arch/m68knommu/platform/520x/config.c
5 *
6 * Copyright (C) 2005, Freescale (www.freescale.com)
7 * Copyright (C) 2005, Intec Automation (mike@steroidmicros.com)
8 * Copyright (C) 1999-2003, Greg Ungerer (gerg@snapgear.com)
9 * Copyright (C) 2001-2003, SnapGear Inc. (www.snapgear.com)
10 */
11
12/***************************************************************************/
13
14#include <linux/config.h>
15#include <linux/kernel.h>
16#include <linux/param.h>
17#include <asm/machdep.h>
18#include <asm/dma.h>
19
20/***************************************************************************/
21
22/*
23 * DMA channel base address table.
24 */
25unsigned int dma_base_addr[MAX_M68K_DMA_CHANNELS];
26unsigned int dma_device_address[MAX_M68K_DMA_CHANNELS];
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 * Program the vector to be an auto-vectored.
40 */
41
42void mcf_autovector(unsigned int vec)
43{
44 /* Everything is auto-vectored on the 520x devices */
45}
46
47/***************************************************************************/
48
49void config_BSP(char *commandp, int size)
50{
51#ifdef CONFIG_BOOTPARAM
52 strncpy(commandp, CONFIG_BOOTPARAM_STRING, size);
53 commandp[size-1] = 0;
54#else
55 memset(commandp, 0, size);
56#endif
57
58 mach_sched_init = coldfire_pit_init;
59 mach_tick = coldfire_pit_tick;
60 mach_gettimeoffset = coldfire_pit_offset;
61 mach_trap_init = coldfire_trap_init;
62 mach_reset = coldfire_reset;
63}
64
65/***************************************************************************/
diff --git a/arch/m68knommu/platform/5307/Makefile b/arch/m68knommu/platform/5307/Makefile
index 6fe5a2b8fb08..8d1619dc1ea6 100644
--- a/arch/m68knommu/platform/5307/Makefile
+++ b/arch/m68knommu/platform/5307/Makefile
@@ -19,6 +19,7 @@ endif
19obj-$(CONFIG_COLDFIRE) += entry.o vectors.o ints.o 19obj-$(CONFIG_COLDFIRE) += entry.o vectors.o ints.o
20obj-$(CONFIG_M5206) += timers.o 20obj-$(CONFIG_M5206) += timers.o
21obj-$(CONFIG_M5206e) += timers.o 21obj-$(CONFIG_M5206e) += timers.o
22obj-$(CONFIG_M520x) += pit.o
22obj-$(CONFIG_M523x) += pit.o 23obj-$(CONFIG_M523x) += pit.o
23obj-$(CONFIG_M5249) += timers.o 24obj-$(CONFIG_M5249) += timers.o
24obj-$(CONFIG_M527x) += pit.o 25obj-$(CONFIG_M527x) += pit.o
diff --git a/arch/m68knommu/platform/5307/head.S b/arch/m68knommu/platform/5307/head.S
index 7f4ba837901f..c30c462b99b1 100644
--- a/arch/m68knommu/platform/5307/head.S
+++ b/arch/m68knommu/platform/5307/head.S
@@ -113,6 +113,9 @@
113#define MEM_BASE 0x02000000 113#define MEM_BASE 0x02000000
114#define VBR_BASE 0x20000000 /* vectors in SRAM */ 114#define VBR_BASE 0x20000000 /* vectors in SRAM */
115#endif 115#endif
116#if defined(CONFIG_M5208EVB)
117#define MEM_BASE 0x40000000
118#endif
116 119
117#ifndef MEM_BASE 120#ifndef MEM_BASE
118#define MEM_BASE 0x00000000 /* memory base at address 0 */ 121#define MEM_BASE 0x00000000 /* memory base at address 0 */
diff --git a/arch/m68knommu/platform/5307/ints.c b/arch/m68knommu/platform/5307/ints.c
index 0117754d44f3..a134fb2f0566 100644
--- a/arch/m68knommu/platform/5307/ints.c
+++ b/arch/m68knommu/platform/5307/ints.c
@@ -26,6 +26,7 @@
26 26
27#include <asm/system.h> 27#include <asm/system.h>
28#include <asm/irq.h> 28#include <asm/irq.h>
29#include <asm/irqnode.h>
29#include <asm/traps.h> 30#include <asm/traps.h>
30#include <asm/page.h> 31#include <asm/page.h>
31#include <asm/machdep.h> 32#include <asm/machdep.h>
diff --git a/arch/m68knommu/platform/5307/pit.c b/arch/m68knommu/platform/5307/pit.c
index a9b2c2e7e280..323f2677e49d 100644
--- a/arch/m68knommu/platform/5307/pit.c
+++ b/arch/m68knommu/platform/5307/pit.c
@@ -3,7 +3,7 @@
3/* 3/*
4 * pit.c -- Motorola ColdFire PIT timer. Currently this type of 4 * pit.c -- Motorola ColdFire PIT timer. Currently this type of
5 * hardware timer only exists in the Motorola ColdFire 5 * hardware timer only exists in the Motorola ColdFire
6 * 5270/5271 and 5282 CPUs. 6 * 5270/5271, 5282 and other CPUs.
7 * 7 *
8 * Copyright (C) 1999-2004, Greg Ungerer (gerg@snapgear.com) 8 * Copyright (C) 1999-2004, Greg Ungerer (gerg@snapgear.com)
9 * Copyright (C) 2001-2004, SnapGear Inc. (www.snapgear.com) 9 * Copyright (C) 2001-2004, SnapGear Inc. (www.snapgear.com)
@@ -47,10 +47,10 @@ void coldfire_pit_init(irqreturn_t (*handler)(int, void *, struct pt_regs *))
47 47
48 icrp = (volatile unsigned char *) (MCF_IPSBAR + MCFICM_INTC0 + 48 icrp = (volatile unsigned char *) (MCF_IPSBAR + MCFICM_INTC0 +
49 MCFINTC_ICR0 + MCFINT_PIT1); 49 MCFINTC_ICR0 + MCFINT_PIT1);
50 *icrp = 0x2b; /* PIT1 with level 5, priority 3 */ 50 *icrp = ICR_INTRCONF;
51 51
52 imrp = (volatile unsigned long *) (MCF_IPSBAR + MCFICM_INTC0 + MCFINTC_IMRH); 52 imrp = (volatile unsigned long *) (MCF_IPSBAR + MCFICM_INTC0 + MCFPIT_IMR);
53 *imrp &= ~(1 << (MCFINT_PIT1 - 32)); 53 *imrp &= ~MCFPIT_IMR_IBIT;
54 54
55 /* Set up PIT timer 1 as poll clock */ 55 /* Set up PIT timer 1 as poll clock */
56 tp = (volatile struct mcfpit *) (MCF_IPSBAR + MCFPIT_BASE1); 56 tp = (volatile struct mcfpit *) (MCF_IPSBAR + MCFPIT_BASE1);
@@ -70,7 +70,7 @@ unsigned long coldfire_pit_offset(void)
70 unsigned long pmr, pcntr, offset; 70 unsigned long pmr, pcntr, offset;
71 71
72 tp = (volatile struct mcfpit *) (MCF_IPSBAR + MCFPIT_BASE1); 72 tp = (volatile struct mcfpit *) (MCF_IPSBAR + MCFPIT_BASE1);
73 ipr = (volatile unsigned long *) (MCF_IPSBAR + MCFICM_INTC0 + MCFINTC_IPRH); 73 ipr = (volatile unsigned long *) (MCF_IPSBAR + MCFICM_INTC0 + MCFPIT_IMR);
74 74
75 pmr = *(&tp->pmr); 75 pmr = *(&tp->pmr);
76 pcntr = *(&tp->pcntr); 76 pcntr = *(&tp->pcntr);
@@ -80,7 +80,7 @@ unsigned long coldfire_pit_offset(void)
80 * timer interupt is pending, then add on a ticks worth of time. 80 * timer interupt is pending, then add on a ticks worth of time.
81 */ 81 */
82 offset = ((pmr - pcntr) * (1000000 / HZ)) / pmr; 82 offset = ((pmr - pcntr) * (1000000 / HZ)) / pmr;
83 if ((offset < (1000000 / HZ / 2)) && (*ipr & (1 << (MCFINT_PIT1 - 32)))) 83 if ((offset < (1000000 / HZ / 2)) && (*ipr & MCFPIT_IMR_IBIT))
84 offset += 1000000 / HZ; 84 offset += 1000000 / HZ;
85 return offset; 85 return offset;
86} 86}
diff --git a/arch/mips/Kconfig b/arch/mips/Kconfig
index 0097a0d53b3b..e380a8322a94 100644
--- a/arch/mips/Kconfig
+++ b/arch/mips/Kconfig
@@ -958,7 +958,7 @@ config SOC_PNX8550
958 bool 958 bool
959 select DMA_NONCOHERENT 959 select DMA_NONCOHERENT
960 select HW_HAS_PCI 960 select HW_HAS_PCI
961 select SYS_HAS_CPU_R4X00 961 select SYS_HAS_CPU_MIPS32_R1
962 select SYS_SUPPORTS_32BIT_KERNEL 962 select SYS_SUPPORTS_32BIT_KERNEL
963 963
964config SWAP_IO_SPACE 964config SWAP_IO_SPACE
diff --git a/arch/mips/au1000/common/setup.c b/arch/mips/au1000/common/setup.c
index 1ef15d5ef943..4f21f42d096b 100644
--- a/arch/mips/au1000/common/setup.c
+++ b/arch/mips/au1000/common/setup.c
@@ -111,17 +111,6 @@ void __init plat_setup(void)
111 } 111 }
112#endif 112#endif
113 113
114#ifdef CONFIG_FB_E1356
115 if ((argptr = strstr(argptr, "video=")) == NULL) {
116 argptr = prom_getcmdline();
117#ifdef CONFIG_MIPS_PB1000
118 strcat(argptr, " video=e1356fb:system:pb1000,mmunalign:1");
119#else
120 strcat(argptr, " video=e1356fb:system:pb1500");
121#endif
122 }
123#endif
124
125#ifdef CONFIG_FB_XPERT98 114#ifdef CONFIG_FB_XPERT98
126 if ((argptr = strstr(argptr, "video=")) == NULL) { 115 if ((argptr = strstr(argptr, "video=")) == NULL) {
127 argptr = prom_getcmdline(); 116 argptr = prom_getcmdline();
diff --git a/arch/mips/boot/.gitignore b/arch/mips/boot/.gitignore
new file mode 100644
index 000000000000..ba63401c6e10
--- /dev/null
+++ b/arch/mips/boot/.gitignore
@@ -0,0 +1,4 @@
1mkboot
2elf2ecoff
3zImage
4zImage.tmp
diff --git a/arch/mips/configs/ddb5476_defconfig b/arch/mips/configs/ddb5476_defconfig
index b260e51eb517..326f3aa63741 100644
--- a/arch/mips/configs/ddb5476_defconfig
+++ b/arch/mips/configs/ddb5476_defconfig
@@ -658,7 +658,6 @@ CONFIG_FB=y
658# CONFIG_FB_SMIVGX is not set 658# CONFIG_FB_SMIVGX is not set
659# CONFIG_FB_CYBLA is not set 659# CONFIG_FB_CYBLA is not set
660# CONFIG_FB_TRIDENT is not set 660# CONFIG_FB_TRIDENT is not set
661# CONFIG_FB_E1356 is not set
662# CONFIG_FB_S1D13XXX is not set 661# CONFIG_FB_S1D13XXX is not set
663# CONFIG_FB_VIRTUAL is not set 662# CONFIG_FB_VIRTUAL is not set
664 663
diff --git a/arch/mips/configs/jmr3927_defconfig b/arch/mips/configs/jmr3927_defconfig
index 9a728c2d8fd5..6390a753e80b 100644
--- a/arch/mips/configs/jmr3927_defconfig
+++ b/arch/mips/configs/jmr3927_defconfig
@@ -628,7 +628,6 @@ CONFIG_FB=y
628# CONFIG_FB_SMIVGX is not set 628# CONFIG_FB_SMIVGX is not set
629# CONFIG_FB_CYBLA is not set 629# CONFIG_FB_CYBLA is not set
630# CONFIG_FB_TRIDENT is not set 630# CONFIG_FB_TRIDENT is not set
631# CONFIG_FB_E1356 is not set
632# CONFIG_FB_S1D13XXX is not set 631# CONFIG_FB_S1D13XXX is not set
633# CONFIG_FB_VIRTUAL is not set 632# CONFIG_FB_VIRTUAL is not set
634 633
diff --git a/arch/mips/configs/ocelot_3_defconfig b/arch/mips/configs/ocelot_3_defconfig
index ffb23fcab862..f18d05c2ca77 100644
--- a/arch/mips/configs/ocelot_3_defconfig
+++ b/arch/mips/configs/ocelot_3_defconfig
@@ -758,7 +758,6 @@ CONFIG_FB_MODE_HELPERS=y
758# CONFIG_FB_SMIVGX is not set 758# CONFIG_FB_SMIVGX is not set
759# CONFIG_FB_CYBLA is not set 759# CONFIG_FB_CYBLA is not set
760# CONFIG_FB_TRIDENT is not set 760# CONFIG_FB_TRIDENT is not set
761# CONFIG_FB_E1356 is not set
762# CONFIG_FB_S1D13XXX is not set 761# CONFIG_FB_S1D13XXX is not set
763# CONFIG_FB_VIRTUAL is not set 762# CONFIG_FB_VIRTUAL is not set
764 763
diff --git a/arch/mips/configs/pnx8550-jbs_defconfig b/arch/mips/configs/pnx8550-jbs_defconfig
index 95f84d711912..555837e4c06f 100644
--- a/arch/mips/configs/pnx8550-jbs_defconfig
+++ b/arch/mips/configs/pnx8550-jbs_defconfig
@@ -129,7 +129,7 @@ CONFIG_MIPS_L1_CACHE_SHIFT=5
129# 129#
130# CPU selection 130# CPU selection
131# 131#
132# CONFIG_CPU_MIPS32_R1 is not set 132CONFIG_CPU_MIPS32_R1=y
133# CONFIG_CPU_MIPS32_R2 is not set 133# CONFIG_CPU_MIPS32_R2 is not set
134# CONFIG_CPU_MIPS64_R1 is not set 134# CONFIG_CPU_MIPS64_R1 is not set
135# CONFIG_CPU_MIPS64_R2 is not set 135# CONFIG_CPU_MIPS64_R2 is not set
@@ -137,7 +137,7 @@ CONFIG_MIPS_L1_CACHE_SHIFT=5
137# CONFIG_CPU_TX39XX is not set 137# CONFIG_CPU_TX39XX is not set
138# CONFIG_CPU_VR41XX is not set 138# CONFIG_CPU_VR41XX is not set
139# CONFIG_CPU_R4300 is not set 139# CONFIG_CPU_R4300 is not set
140CONFIG_CPU_R4X00=y 140# CONFIG_CPU_R4X00 is not set
141# CONFIG_CPU_TX49XX is not set 141# CONFIG_CPU_TX49XX is not set
142# CONFIG_CPU_R5000 is not set 142# CONFIG_CPU_R5000 is not set
143# CONFIG_CPU_R5432 is not set 143# CONFIG_CPU_R5432 is not set
@@ -148,10 +148,11 @@ CONFIG_CPU_R4X00=y
148# CONFIG_CPU_RM7000 is not set 148# CONFIG_CPU_RM7000 is not set
149# CONFIG_CPU_RM9000 is not set 149# CONFIG_CPU_RM9000 is not set
150# CONFIG_CPU_SB1 is not set 150# CONFIG_CPU_SB1 is not set
151CONFIG_SYS_HAS_CPU_R4X00=y 151CONFIG_SYS_HAS_CPU_MIPS32_R1=y
152CONFIG_CPU_MIPS32=y
153CONFIG_CPU_MIPSR1=y
152CONFIG_SYS_SUPPORTS_32BIT_KERNEL=y 154CONFIG_SYS_SUPPORTS_32BIT_KERNEL=y
153CONFIG_CPU_SUPPORTS_32BIT_KERNEL=y 155CONFIG_CPU_SUPPORTS_32BIT_KERNEL=y
154CONFIG_CPU_SUPPORTS_64BIT_KERNEL=y
155 156
156# 157#
157# Kernel type 158# Kernel type
@@ -162,11 +163,11 @@ CONFIG_PAGE_SIZE_4KB=y
162# CONFIG_PAGE_SIZE_8KB is not set 163# CONFIG_PAGE_SIZE_8KB is not set
163# CONFIG_PAGE_SIZE_16KB is not set 164# CONFIG_PAGE_SIZE_16KB is not set
164# CONFIG_PAGE_SIZE_64KB is not set 165# CONFIG_PAGE_SIZE_64KB is not set
166CONFIG_CPU_HAS_PREFETCH=y
165# CONFIG_MIPS_MT is not set 167# CONFIG_MIPS_MT is not set
166# CONFIG_64BIT_PHYS_ADDR is not set 168# CONFIG_64BIT_PHYS_ADDR is not set
167# CONFIG_CPU_ADVANCED is not set 169# CONFIG_CPU_ADVANCED is not set
168CONFIG_CPU_HAS_LLSC=y 170CONFIG_CPU_HAS_LLSC=y
169CONFIG_CPU_HAS_LLDSCD=y
170CONFIG_CPU_HAS_SYNC=y 171CONFIG_CPU_HAS_SYNC=y
171CONFIG_GENERIC_HARDIRQS=y 172CONFIG_GENERIC_HARDIRQS=y
172CONFIG_GENERIC_IRQ_PROBE=y 173CONFIG_GENERIC_IRQ_PROBE=y
diff --git a/arch/mips/configs/pnx8550-v2pci_defconfig b/arch/mips/configs/pnx8550-v2pci_defconfig
index deb24c29ac0a..37bd8d5c865d 100644
--- a/arch/mips/configs/pnx8550-v2pci_defconfig
+++ b/arch/mips/configs/pnx8550-v2pci_defconfig
@@ -128,7 +128,7 @@ CONFIG_MIPS_L1_CACHE_SHIFT=5
128# 128#
129# CPU selection 129# CPU selection
130# 130#
131# CONFIG_CPU_MIPS32_R1 is not set 131CONFIG_CPU_MIPS32_R1=y
132# CONFIG_CPU_MIPS32_R2 is not set 132# CONFIG_CPU_MIPS32_R2 is not set
133# CONFIG_CPU_MIPS64_R1 is not set 133# CONFIG_CPU_MIPS64_R1 is not set
134# CONFIG_CPU_MIPS64_R2 is not set 134# CONFIG_CPU_MIPS64_R2 is not set
@@ -136,7 +136,7 @@ CONFIG_MIPS_L1_CACHE_SHIFT=5
136# CONFIG_CPU_TX39XX is not set 136# CONFIG_CPU_TX39XX is not set
137# CONFIG_CPU_VR41XX is not set 137# CONFIG_CPU_VR41XX is not set
138# CONFIG_CPU_R4300 is not set 138# CONFIG_CPU_R4300 is not set
139CONFIG_CPU_R4X00=y 139# CONFIG_CPU_R4X00 is not set
140# CONFIG_CPU_TX49XX is not set 140# CONFIG_CPU_TX49XX is not set
141# CONFIG_CPU_R5000 is not set 141# CONFIG_CPU_R5000 is not set
142# CONFIG_CPU_R5432 is not set 142# CONFIG_CPU_R5432 is not set
@@ -147,10 +147,11 @@ CONFIG_CPU_R4X00=y
147# CONFIG_CPU_RM7000 is not set 147# CONFIG_CPU_RM7000 is not set
148# CONFIG_CPU_RM9000 is not set 148# CONFIG_CPU_RM9000 is not set
149# CONFIG_CPU_SB1 is not set 149# CONFIG_CPU_SB1 is not set
150CONFIG_SYS_HAS_CPU_R4X00=y 150CONFIG_SYS_HAS_CPU_MIPS32_R1=y
151CONFIG_CPU_MIPS32=y
152CONFIG_CPU_MIPSR1=y
151CONFIG_SYS_SUPPORTS_32BIT_KERNEL=y 153CONFIG_SYS_SUPPORTS_32BIT_KERNEL=y
152CONFIG_CPU_SUPPORTS_32BIT_KERNEL=y 154CONFIG_CPU_SUPPORTS_32BIT_KERNEL=y
153CONFIG_CPU_SUPPORTS_64BIT_KERNEL=y
154 155
155# 156#
156# Kernel type 157# Kernel type
@@ -161,6 +162,7 @@ CONFIG_PAGE_SIZE_4KB=y
161# CONFIG_PAGE_SIZE_8KB is not set 162# CONFIG_PAGE_SIZE_8KB is not set
162# CONFIG_PAGE_SIZE_16KB is not set 163# CONFIG_PAGE_SIZE_16KB is not set
163# CONFIG_PAGE_SIZE_64KB is not set 164# CONFIG_PAGE_SIZE_64KB is not set
165CONFIG_CPU_HAS_PREFETCH=y
164# CONFIG_MIPS_MT is not set 166# CONFIG_MIPS_MT is not set
165# CONFIG_64BIT_PHYS_ADDR is not set 167# CONFIG_64BIT_PHYS_ADDR is not set
166CONFIG_CPU_ADVANCED=y 168CONFIG_CPU_ADVANCED=y
@@ -895,7 +897,6 @@ CONFIG_FB=y
895# CONFIG_FB_SMIVGX is not set 897# CONFIG_FB_SMIVGX is not set
896# CONFIG_FB_CYBLA is not set 898# CONFIG_FB_CYBLA is not set
897# CONFIG_FB_TRIDENT is not set 899# CONFIG_FB_TRIDENT is not set
898# CONFIG_FB_E1356 is not set
899# CONFIG_FB_S1D13XXX is not set 900# CONFIG_FB_S1D13XXX is not set
900# CONFIG_FB_VIRTUAL is not set 901# CONFIG_FB_VIRTUAL is not set
901 902
diff --git a/arch/mips/configs/rbhma4500_defconfig b/arch/mips/configs/rbhma4500_defconfig
index 2bc61ca4ba08..897420d39053 100644
--- a/arch/mips/configs/rbhma4500_defconfig
+++ b/arch/mips/configs/rbhma4500_defconfig
@@ -876,7 +876,6 @@ CONFIG_FB_ATY_CT=y
876# CONFIG_FB_SMIVGX is not set 876# CONFIG_FB_SMIVGX is not set
877# CONFIG_FB_CYBLA is not set 877# CONFIG_FB_CYBLA is not set
878# CONFIG_FB_TRIDENT is not set 878# CONFIG_FB_TRIDENT is not set
879# CONFIG_FB_E1356 is not set
880# CONFIG_FB_S1D13XXX is not set 879# CONFIG_FB_S1D13XXX is not set
881# CONFIG_FB_VIRTUAL is not set 880# CONFIG_FB_VIRTUAL is not set
882 881
diff --git a/arch/mips/ddb5xxx/common/rtc_ds1386.c b/arch/mips/ddb5xxx/common/rtc_ds1386.c
index f5b11508ff2f..995896ac0e39 100644
--- a/arch/mips/ddb5xxx/common/rtc_ds1386.c
+++ b/arch/mips/ddb5xxx/common/rtc_ds1386.c
@@ -41,7 +41,9 @@ rtc_ds1386_get_time(void)
41 u8 byte; 41 u8 byte;
42 u8 temp; 42 u8 temp;
43 unsigned int year, month, day, hour, minute, second; 43 unsigned int year, month, day, hour, minute, second;
44 unsigned long flags;
44 45
46 spin_lock_irqsave(&rtc_lock, flags);
45 /* let us freeze external registers */ 47 /* let us freeze external registers */
46 byte = READ_RTC(0xB); 48 byte = READ_RTC(0xB);
47 byte &= 0x3f; 49 byte &= 0x3f;
@@ -60,6 +62,7 @@ rtc_ds1386_get_time(void)
60 /* enable time transfer */ 62 /* enable time transfer */
61 byte |= 0x80; 63 byte |= 0x80;
62 WRITE_RTC(0xB, byte); 64 WRITE_RTC(0xB, byte);
65 spin_unlock_irqrestore(&rtc_lock, flags);
63 66
64 /* calc hour */ 67 /* calc hour */
65 if (temp & 0x40) { 68 if (temp & 0x40) {
@@ -81,7 +84,9 @@ rtc_ds1386_set_time(unsigned long t)
81 u8 byte; 84 u8 byte;
82 u8 temp; 85 u8 temp;
83 u8 year, month, day, hour, minute, second; 86 u8 year, month, day, hour, minute, second;
87 unsigned long flags;
84 88
89 spin_lock_irqsave(&rtc_lock, flags);
85 /* let us freeze external registers */ 90 /* let us freeze external registers */
86 byte = READ_RTC(0xB); 91 byte = READ_RTC(0xB);
87 byte &= 0x3f; 92 byte &= 0x3f;
@@ -133,6 +138,7 @@ rtc_ds1386_set_time(unsigned long t)
133 if (second != READ_RTC(0x1)) { 138 if (second != READ_RTC(0x1)) {
134 WRITE_RTC(0x1, second); 139 WRITE_RTC(0x1, second);
135 } 140 }
141 spin_unlock_irqrestore(&rtc_lock, flags);
136 142
137 return 0; 143 return 0;
138} 144}
diff --git a/arch/mips/dec/time.c b/arch/mips/dec/time.c
index dc7091caa7aa..174822344131 100644
--- a/arch/mips/dec/time.c
+++ b/arch/mips/dec/time.c
@@ -37,10 +37,25 @@
37#include <asm/dec/machtype.h> 37#include <asm/dec/machtype.h>
38 38
39 39
40/*
41 * Returns true if a clock update is in progress
42 */
43static inline unsigned char dec_rtc_is_updating(void)
44{
45 unsigned char uip;
46 unsigned long flags;
47
48 spin_lock_irqsave(&rtc_lock, flags);
49 uip = (CMOS_READ(RTC_FREQ_SELECT) & RTC_UIP);
50 spin_unlock_irqrestore(&rtc_lock, flags);
51 return uip;
52}
53
40static unsigned long dec_rtc_get_time(void) 54static unsigned long dec_rtc_get_time(void)
41{ 55{
42 unsigned int year, mon, day, hour, min, sec, real_year; 56 unsigned int year, mon, day, hour, min, sec, real_year;
43 int i; 57 int i;
58 unsigned long flags;
44 59
45 /* The Linux interpretation of the DS1287 clock register contents: 60 /* The Linux interpretation of the DS1287 clock register contents:
46 * When the Update-In-Progress (UIP) flag goes from 1 to 0, the 61 * When the Update-In-Progress (UIP) flag goes from 1 to 0, the
@@ -49,11 +64,12 @@ static unsigned long dec_rtc_get_time(void)
49 */ 64 */
50 /* read RTC exactly on falling edge of update flag */ 65 /* read RTC exactly on falling edge of update flag */
51 for (i = 0; i < 1000000; i++) /* may take up to 1 second... */ 66 for (i = 0; i < 1000000; i++) /* may take up to 1 second... */
52 if (CMOS_READ(RTC_FREQ_SELECT) & RTC_UIP) 67 if (dec_rtc_is_updating())
53 break; 68 break;
54 for (i = 0; i < 1000000; i++) /* must try at least 2.228 ms */ 69 for (i = 0; i < 1000000; i++) /* must try at least 2.228 ms */
55 if (!(CMOS_READ(RTC_FREQ_SELECT) & RTC_UIP)) 70 if (!dec_rtc_is_updating())
56 break; 71 break;
72 spin_lock_irqsave(&rtc_lock, flags);
57 /* Isn't this overkill? UIP above should guarantee consistency */ 73 /* Isn't this overkill? UIP above should guarantee consistency */
58 do { 74 do {
59 sec = CMOS_READ(RTC_SECONDS); 75 sec = CMOS_READ(RTC_SECONDS);
@@ -77,6 +93,7 @@ static unsigned long dec_rtc_get_time(void)
77 * of unused BBU RAM locations. 93 * of unused BBU RAM locations.
78 */ 94 */
79 real_year = CMOS_READ(RTC_DEC_YEAR); 95 real_year = CMOS_READ(RTC_DEC_YEAR);
96 spin_unlock_irqrestore(&rtc_lock, flags);
80 year += real_year - 72 + 2000; 97 year += real_year - 72 + 2000;
81 98
82 return mktime(year, mon, day, hour, min, sec); 99 return mktime(year, mon, day, hour, min, sec);
@@ -95,6 +112,8 @@ static int dec_rtc_set_mmss(unsigned long nowtime)
95 int real_seconds, real_minutes, cmos_minutes; 112 int real_seconds, real_minutes, cmos_minutes;
96 unsigned char save_control, save_freq_select; 113 unsigned char save_control, save_freq_select;
97 114
115 /* irq are locally disabled here */
116 spin_lock(&rtc_lock);
98 /* tell the clock it's being set */ 117 /* tell the clock it's being set */
99 save_control = CMOS_READ(RTC_CONTROL); 118 save_control = CMOS_READ(RTC_CONTROL);
100 CMOS_WRITE((save_control | RTC_SET), RTC_CONTROL); 119 CMOS_WRITE((save_control | RTC_SET), RTC_CONTROL);
@@ -141,6 +160,7 @@ static int dec_rtc_set_mmss(unsigned long nowtime)
141 */ 160 */
142 CMOS_WRITE(save_control, RTC_CONTROL); 161 CMOS_WRITE(save_control, RTC_CONTROL);
143 CMOS_WRITE(save_freq_select, RTC_FREQ_SELECT); 162 CMOS_WRITE(save_freq_select, RTC_FREQ_SELECT);
163 spin_unlock(&rtc_lock);
144 164
145 return retval; 165 return retval;
146} 166}
diff --git a/arch/mips/jmr3927/common/rtc_ds1742.c b/arch/mips/jmr3927/common/rtc_ds1742.c
index 1ae4318e1358..8b407d7dc460 100644
--- a/arch/mips/jmr3927/common/rtc_ds1742.c
+++ b/arch/mips/jmr3927/common/rtc_ds1742.c
@@ -57,7 +57,9 @@ rtc_ds1742_get_time(void)
57{ 57{
58 unsigned int year, month, day, hour, minute, second; 58 unsigned int year, month, day, hour, minute, second;
59 unsigned int century; 59 unsigned int century;
60 unsigned long flags;
60 61
62 spin_lock_irqsave(&rtc_lock, flags);
61 CMOS_WRITE(RTC_READ, RTC_CONTROL); 63 CMOS_WRITE(RTC_READ, RTC_CONTROL);
62 second = BCD2BIN(CMOS_READ(RTC_SECONDS) & RTC_SECONDS_MASK); 64 second = BCD2BIN(CMOS_READ(RTC_SECONDS) & RTC_SECONDS_MASK);
63 minute = BCD2BIN(CMOS_READ(RTC_MINUTES)); 65 minute = BCD2BIN(CMOS_READ(RTC_MINUTES));
@@ -67,6 +69,7 @@ rtc_ds1742_get_time(void)
67 year = BCD2BIN(CMOS_READ(RTC_YEAR)); 69 year = BCD2BIN(CMOS_READ(RTC_YEAR));
68 century = BCD2BIN(CMOS_READ(RTC_CENTURY) & RTC_CENTURY_MASK); 70 century = BCD2BIN(CMOS_READ(RTC_CENTURY) & RTC_CENTURY_MASK);
69 CMOS_WRITE(0, RTC_CONTROL); 71 CMOS_WRITE(0, RTC_CONTROL);
72 spin_unlock_irqrestore(&rtc_lock, flags);
70 73
71 year += century * 100; 74 year += century * 100;
72 75
@@ -81,7 +84,9 @@ rtc_ds1742_set_time(unsigned long t)
81 u8 year, month, day, hour, minute, second; 84 u8 year, month, day, hour, minute, second;
82 u8 cmos_year, cmos_month, cmos_day, cmos_hour, cmos_minute, cmos_second; 85 u8 cmos_year, cmos_month, cmos_day, cmos_hour, cmos_minute, cmos_second;
83 int cmos_century; 86 int cmos_century;
87 unsigned long flags;
84 88
89 spin_lock_irqsave(&rtc_lock, flags);
85 CMOS_WRITE(RTC_READ, RTC_CONTROL); 90 CMOS_WRITE(RTC_READ, RTC_CONTROL);
86 cmos_second = (u8)(CMOS_READ(RTC_SECONDS) & RTC_SECONDS_MASK); 91 cmos_second = (u8)(CMOS_READ(RTC_SECONDS) & RTC_SECONDS_MASK);
87 cmos_minute = (u8)CMOS_READ(RTC_MINUTES); 92 cmos_minute = (u8)CMOS_READ(RTC_MINUTES);
@@ -139,6 +144,7 @@ rtc_ds1742_set_time(unsigned long t)
139 144
140 /* RTC_CENTURY and RTC_CONTROL share same address... */ 145 /* RTC_CENTURY and RTC_CONTROL share same address... */
141 CMOS_WRITE(cmos_century, RTC_CONTROL); 146 CMOS_WRITE(cmos_century, RTC_CONTROL);
147 spin_unlock_irqrestore(&rtc_lock, flags);
142 148
143 return 0; 149 return 0;
144} 150}
diff --git a/arch/mips/kernel/ioctl32.c b/arch/mips/kernel/ioctl32.c
index ed9b2da510be..9ea1fc748864 100644
--- a/arch/mips/kernel/ioctl32.c
+++ b/arch/mips/kernel/ioctl32.c
@@ -26,10 +26,8 @@ long sys_ioctl(unsigned int fd, unsigned int cmd, unsigned long arg);
26#define CODE 26#define CODE
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 *);
30
31#define COMPATIBLE_IOCTL(cmd) HANDLE_IOCTL((cmd),sys_ioctl) 29#define COMPATIBLE_IOCTL(cmd) HANDLE_IOCTL((cmd),sys_ioctl)
32#define HANDLE_IOCTL(cmd,handler) { (cmd), (ioctl32_handler_t)(handler), NULL }, 30#define HANDLE_IOCTL(cmd,handler) { (cmd), (ioctl_trans_handler_t)(handler), NULL },
33#define IOCTL_TABLE_START \ 31#define IOCTL_TABLE_START \
34 struct ioctl_trans ioctl_start[] = { 32 struct ioctl_trans ioctl_start[] = {
35#define IOCTL_TABLE_END \ 33#define IOCTL_TABLE_END \
diff --git a/arch/mips/kernel/irixsig.c b/arch/mips/kernel/irixsig.c
index 908e63684208..dd118c60bcd0 100644
--- a/arch/mips/kernel/irixsig.c
+++ b/arch/mips/kernel/irixsig.c
@@ -502,8 +502,7 @@ asmlinkage int irix_sigpoll_sys(unsigned long __user *set,
502 while(1) { 502 while(1) {
503 long tmp = 0; 503 long tmp = 0;
504 504
505 current->state = TASK_INTERRUPTIBLE; 505 expire = schedule_timeout_interruptible(expire);
506 expire = schedule_timeout(expire);
507 506
508 for (i=0; i<=4; i++) 507 for (i=0; i<=4; i++)
509 tmp |= (current->pending.signal.sig[i] & kset.sig[i]); 508 tmp |= (current->pending.signal.sig[i] & kset.sig[i]);
diff --git a/arch/mips/kernel/process.c b/arch/mips/kernel/process.c
index 4fe3d5715c41..dd725779d91f 100644
--- a/arch/mips/kernel/process.c
+++ b/arch/mips/kernel/process.c
@@ -52,7 +52,9 @@ ATTRIB_NORET void cpu_idle(void)
52 while (!need_resched()) 52 while (!need_resched())
53 if (cpu_wait) 53 if (cpu_wait)
54 (*cpu_wait)(); 54 (*cpu_wait)();
55 preempt_enable_no_resched();
55 schedule(); 56 schedule();
57 preempt_disable();
56 } 58 }
57} 59}
58 60
diff --git a/arch/mips/kernel/ptrace.c b/arch/mips/kernel/ptrace.c
index f1b0f3e1f95b..510da5fda567 100644
--- a/arch/mips/kernel/ptrace.c
+++ b/arch/mips/kernel/ptrace.c
@@ -174,51 +174,10 @@ int ptrace_setfpregs (struct task_struct *child, __u32 __user *data)
174 return 0; 174 return 0;
175} 175}
176 176
177asmlinkage long sys_ptrace(long request, long pid, long addr, long data) 177long arch_ptrace(struct task_struct *child, long request, long addr, long data)
178{ 178{
179 struct task_struct *child;
180 int ret; 179 int ret;
181 180
182#if 0
183 printk("ptrace(r=%d,pid=%d,addr=%08lx,data=%08lx)\n",
184 (int) request, (int) pid, (unsigned long) addr,
185 (unsigned long) data);
186#endif
187 lock_kernel();
188 ret = -EPERM;
189 if (request == PTRACE_TRACEME) {
190 /* are we already being traced? */
191 if (current->ptrace & PT_PTRACED)
192 goto out;
193 if ((ret = security_ptrace(current->parent, current)))
194 goto out;
195 /* set the ptrace bit in the process flags. */
196 current->ptrace |= PT_PTRACED;
197 ret = 0;
198 goto out;
199 }
200 ret = -ESRCH;
201 read_lock(&tasklist_lock);
202 child = find_task_by_pid(pid);
203 if (child)
204 get_task_struct(child);
205 read_unlock(&tasklist_lock);
206 if (!child)
207 goto out;
208
209 ret = -EPERM;
210 if (pid == 1) /* you may not mess with init */
211 goto out_tsk;
212
213 if (request == PTRACE_ATTACH) {
214 ret = ptrace_attach(child);
215 goto out_tsk;
216 }
217
218 ret = ptrace_check_attach(child, request == PTRACE_KILL);
219 if (ret < 0)
220 goto out_tsk;
221
222 switch (request) { 181 switch (request) {
223 /* when I and D space are separate, these will need to be fixed. */ 182 /* when I and D space are separate, these will need to be fixed. */
224 case PTRACE_PEEKTEXT: /* read word at location addr. */ 183 case PTRACE_PEEKTEXT: /* read word at location addr. */
@@ -319,7 +278,7 @@ asmlinkage long sys_ptrace(long request, long pid, long addr, long data)
319 if (!cpu_has_dsp) { 278 if (!cpu_has_dsp) {
320 tmp = 0; 279 tmp = 0;
321 ret = -EIO; 280 ret = -EIO;
322 goto out_tsk; 281 goto out;
323 } 282 }
324 if (child->thread.dsp.used_dsp) { 283 if (child->thread.dsp.used_dsp) {
325 dregs = __get_dsp_regs(child); 284 dregs = __get_dsp_regs(child);
@@ -333,14 +292,14 @@ asmlinkage long sys_ptrace(long request, long pid, long addr, long data)
333 if (!cpu_has_dsp) { 292 if (!cpu_has_dsp) {
334 tmp = 0; 293 tmp = 0;
335 ret = -EIO; 294 ret = -EIO;
336 goto out_tsk; 295 goto out;
337 } 296 }
338 tmp = child->thread.dsp.dspcontrol; 297 tmp = child->thread.dsp.dspcontrol;
339 break; 298 break;
340 default: 299 default:
341 tmp = 0; 300 tmp = 0;
342 ret = -EIO; 301 ret = -EIO;
343 goto out_tsk; 302 goto out;
344 } 303 }
345 ret = put_user(tmp, (unsigned long __user *) data); 304 ret = put_user(tmp, (unsigned long __user *) data);
346 break; 305 break;
@@ -495,11 +454,7 @@ asmlinkage long sys_ptrace(long request, long pid, long addr, long data)
495 ret = ptrace_request(child, request, addr, data); 454 ret = ptrace_request(child, request, addr, data);
496 break; 455 break;
497 } 456 }
498 457 out:
499out_tsk:
500 put_task_struct(child);
501out:
502 unlock_kernel();
503 return ret; 458 return ret;
504} 459}
505 460
diff --git a/arch/mips/kernel/rtlx.c b/arch/mips/kernel/rtlx.c
index 8c81f3cb4e2d..1d855112bac2 100644
--- a/arch/mips/kernel/rtlx.c
+++ b/arch/mips/kernel/rtlx.c
@@ -20,42 +20,42 @@
20#include <linux/module.h> 20#include <linux/module.h>
21#include <linux/fs.h> 21#include <linux/fs.h>
22#include <linux/init.h> 22#include <linux/init.h>
23#include <asm/uaccess.h>
24#include <linux/slab.h>
25#include <linux/list.h>
26#include <linux/vmalloc.h>
27#include <linux/elf.h>
28#include <linux/seq_file.h>
29#include <linux/syscalls.h>
30#include <linux/moduleloader.h>
31#include <linux/interrupt.h>
32#include <linux/poll.h> 23#include <linux/poll.h>
33#include <linux/sched.h> 24#include <linux/sched.h>
34#include <linux/wait.h> 25#include <linux/wait.h>
35#include <asm/mipsmtregs.h> 26#include <asm/mipsmtregs.h>
36#include <asm/cacheflush.h> 27#include <asm/bitops.h>
37#include <asm/atomic.h>
38#include <asm/cpu.h> 28#include <asm/cpu.h>
39#include <asm/processor.h> 29#include <asm/processor.h>
40#include <asm/system.h>
41#include <asm/rtlx.h> 30#include <asm/rtlx.h>
31#include <asm/uaccess.h>
42 32
43#define RTLX_MAJOR 64
44#define RTLX_TARG_VPE 1 33#define RTLX_TARG_VPE 1
45 34
46struct rtlx_info *rtlx; 35static struct rtlx_info *rtlx;
47static int major; 36static int major;
48static char module_name[] = "rtlx"; 37static char module_name[] = "rtlx";
49static inline int spacefree(int read, int write, int size); 38static struct irqaction irq;
39static int irq_num;
40
41static inline int spacefree(int read, int write, int size)
42{
43 if (read == write) {
44 /*
45 * never fill the buffer completely, so indexes are always
46 * equal if empty and only empty, or !equal if data available
47 */
48 return size - 1;
49 }
50
51 return ((read + size - write) % size) - 1;
52}
50 53
51static struct chan_waitqueues { 54static struct chan_waitqueues {
52 wait_queue_head_t rt_queue; 55 wait_queue_head_t rt_queue;
53 wait_queue_head_t lx_queue; 56 wait_queue_head_t lx_queue;
54} channel_wqs[RTLX_CHANNELS]; 57} channel_wqs[RTLX_CHANNELS];
55 58
56static struct irqaction irq;
57static int irq_num;
58
59extern void *vpe_get_shared(int index); 59extern void *vpe_get_shared(int index);
60 60
61static void rtlx_dispatch(struct pt_regs *regs) 61static void rtlx_dispatch(struct pt_regs *regs)
@@ -63,9 +63,8 @@ static void rtlx_dispatch(struct pt_regs *regs)
63 do_IRQ(MIPSCPU_INT_BASE + MIPS_CPU_RTLX_IRQ, regs); 63 do_IRQ(MIPSCPU_INT_BASE + MIPS_CPU_RTLX_IRQ, regs);
64} 64}
65 65
66irqreturn_t rtlx_interrupt(int irq, void *dev_id, struct pt_regs *regs) 66static irqreturn_t rtlx_interrupt(int irq, void *dev_id, struct pt_regs *regs)
67{ 67{
68 irqreturn_t r = IRQ_HANDLED;
69 int i; 68 int i;
70 69
71 for (i = 0; i < RTLX_CHANNELS; i++) { 70 for (i = 0; i < RTLX_CHANNELS; i++) {
@@ -75,30 +74,7 @@ irqreturn_t rtlx_interrupt(int irq, void *dev_id, struct pt_regs *regs)
75 wake_up_interruptible(&channel_wqs[i].lx_queue); 74 wake_up_interruptible(&channel_wqs[i].lx_queue);
76 } 75 }
77 76
78 return r; 77 return IRQ_HANDLED;
79}
80
81void dump_rtlx(void)
82{
83 int i;
84
85 printk("id 0x%lx state %d\n", rtlx->id, rtlx->state);
86
87 for (i = 0; i < RTLX_CHANNELS; i++) {
88 struct rtlx_channel *chan = &rtlx->channel[i];
89
90 printk(" rt_state %d lx_state %d buffer_size %d\n",
91 chan->rt_state, chan->lx_state, chan->buffer_size);
92
93 printk(" rt_read %d rt_write %d\n",
94 chan->rt_read, chan->rt_write);
95
96 printk(" lx_read %d lx_write %d\n",
97 chan->lx_read, chan->lx_write);
98
99 printk(" rt_buffer <%s>\n", chan->rt_buffer);
100 printk(" lx_buffer <%s>\n", chan->lx_buffer);
101 }
102} 78}
103 79
104/* call when we have the address of the shared structure from the SP side. */ 80/* call when we have the address of the shared structure from the SP side. */
@@ -108,7 +84,7 @@ static int rtlx_init(struct rtlx_info *rtlxi)
108 84
109 if (rtlxi->id != RTLX_ID) { 85 if (rtlxi->id != RTLX_ID) {
110 printk(KERN_WARNING "no valid RTLX id at 0x%p\n", rtlxi); 86 printk(KERN_WARNING "no valid RTLX id at 0x%p\n", rtlxi);
111 return (-ENOEXEC); 87 return -ENOEXEC;
112 } 88 }
113 89
114 /* initialise the wait queues */ 90 /* initialise the wait queues */
@@ -120,9 +96,8 @@ static int rtlx_init(struct rtlx_info *rtlxi)
120 /* set up for interrupt handling */ 96 /* set up for interrupt handling */
121 memset(&irq, 0, sizeof(struct irqaction)); 97 memset(&irq, 0, sizeof(struct irqaction));
122 98
123 if (cpu_has_vint) { 99 if (cpu_has_vint)
124 set_vi_handler(MIPS_CPU_RTLX_IRQ, rtlx_dispatch); 100 set_vi_handler(MIPS_CPU_RTLX_IRQ, rtlx_dispatch);
125 }
126 101
127 irq_num = MIPSCPU_INT_BASE + MIPS_CPU_RTLX_IRQ; 102 irq_num = MIPSCPU_INT_BASE + MIPS_CPU_RTLX_IRQ;
128 irq.handler = rtlx_interrupt; 103 irq.handler = rtlx_interrupt;
@@ -132,7 +107,8 @@ static int rtlx_init(struct rtlx_info *rtlxi)
132 setup_irq(irq_num, &irq); 107 setup_irq(irq_num, &irq);
133 108
134 rtlx = rtlxi; 109 rtlx = rtlxi;
135 return (0); 110
111 return 0;
136} 112}
137 113
138/* only allow one open process at a time to open each channel */ 114/* only allow one open process at a time to open each channel */
@@ -147,36 +123,36 @@ static int rtlx_open(struct inode *inode, struct file *filp)
147 if (rtlx == NULL) { 123 if (rtlx == NULL) {
148 struct rtlx_info **p; 124 struct rtlx_info **p;
149 if( (p = vpe_get_shared(RTLX_TARG_VPE)) == NULL) { 125 if( (p = vpe_get_shared(RTLX_TARG_VPE)) == NULL) {
150 printk(" vpe_get_shared is NULL. Has an SP program been loaded?\n"); 126 printk(KERN_ERR "vpe_get_shared is NULL. "
151 return (-EFAULT); 127 "Has an SP program been loaded?\n");
128 return -EFAULT;
152 } 129 }
153 130
154 if (*p == NULL) { 131 if (*p == NULL) {
155 printk(" vpe_shared %p %p\n", p, *p); 132 printk(KERN_ERR "vpe_shared %p %p\n", p, *p);
156 return (-EFAULT); 133 return -EFAULT;
157 } 134 }
158 135
159 if ((ret = rtlx_init(*p)) < 0) 136 if ((ret = rtlx_init(*p)) < 0)
160 return (ret); 137 return ret;
161 } 138 }
162 139
163 chan = &rtlx->channel[minor]; 140 chan = &rtlx->channel[minor];
164 141
165 /* already open? */ 142 if (test_and_set_bit(RTLX_STATE_OPENED, &chan->lx_state))
166 if (chan->lx_state == RTLX_STATE_OPENED) 143 return -EBUSY;
167 return (-EBUSY);
168 144
169 chan->lx_state = RTLX_STATE_OPENED; 145 return 0;
170 return (0);
171} 146}
172 147
173static int rtlx_release(struct inode *inode, struct file *filp) 148static int rtlx_release(struct inode *inode, struct file *filp)
174{ 149{
175 int minor; 150 int minor = MINOR(inode->i_rdev);
176 151
177 minor = MINOR(inode->i_rdev); 152 clear_bit(RTLX_STATE_OPENED, &rtlx->channel[minor].lx_state);
178 rtlx->channel[minor].lx_state = RTLX_STATE_UNUSED; 153 smp_mb__after_clear_bit();
179 return (0); 154
155 return 0;
180} 156}
181 157
182static unsigned int rtlx_poll(struct file *file, poll_table * wait) 158static unsigned int rtlx_poll(struct file *file, poll_table * wait)
@@ -199,12 +175,13 @@ static unsigned int rtlx_poll(struct file *file, poll_table * wait)
199 if (spacefree(chan->rt_read, chan->rt_write, chan->buffer_size)) 175 if (spacefree(chan->rt_read, chan->rt_write, chan->buffer_size))
200 mask |= POLLOUT | POLLWRNORM; 176 mask |= POLLOUT | POLLWRNORM;
201 177
202 return (mask); 178 return mask;
203} 179}
204 180
205static ssize_t rtlx_read(struct file *file, char __user * buffer, size_t count, 181static ssize_t rtlx_read(struct file *file, char __user * buffer, size_t count,
206 loff_t * ppos) 182 loff_t * ppos)
207{ 183{
184 unsigned long failed;
208 size_t fl = 0L; 185 size_t fl = 0L;
209 int minor; 186 int minor;
210 struct rtlx_channel *lx; 187 struct rtlx_channel *lx;
@@ -216,7 +193,7 @@ static ssize_t rtlx_read(struct file *file, char __user * buffer, size_t count,
216 /* data available? */ 193 /* data available? */
217 if (lx->lx_write == lx->lx_read) { 194 if (lx->lx_write == lx->lx_read) {
218 if (file->f_flags & O_NONBLOCK) 195 if (file->f_flags & O_NONBLOCK)
219 return (0); // -EAGAIN makes cat whinge 196 return 0; /* -EAGAIN makes cat whinge */
220 197
221 /* go to sleep */ 198 /* go to sleep */
222 add_wait_queue(&channel_wqs[minor].lx_queue, &wait); 199 add_wait_queue(&channel_wqs[minor].lx_queue, &wait);
@@ -232,39 +209,39 @@ static ssize_t rtlx_read(struct file *file, char __user * buffer, size_t count,
232 } 209 }
233 210
234 /* find out how much in total */ 211 /* find out how much in total */
235 count = min( count, 212 count = min(count,
236 (size_t)(lx->lx_write + lx->buffer_size - lx->lx_read) % lx->buffer_size); 213 (size_t)(lx->lx_write + lx->buffer_size - lx->lx_read) % lx->buffer_size);
237 214
238 /* then how much from the read pointer onwards */ 215 /* then how much from the read pointer onwards */
239 fl = min( count, (size_t)lx->buffer_size - lx->lx_read); 216 fl = min(count, (size_t)lx->buffer_size - lx->lx_read);
240 217
241 copy_to_user (buffer, &lx->lx_buffer[lx->lx_read], fl); 218 failed = copy_to_user (buffer, &lx->lx_buffer[lx->lx_read], fl);
219 if (failed) {
220 count = fl - failed;
221 goto out;
222 }
242 223
243 /* and if there is anything left at the beginning of the buffer */ 224 /* and if there is anything left at the beginning of the buffer */
244 if ( count - fl ) 225 if (count - fl) {
245 copy_to_user (buffer + fl, lx->lx_buffer, count - fl); 226 failed = copy_to_user (buffer + fl, lx->lx_buffer, count - fl);
227 if (failed) {
228 count -= failed;
229 goto out;
230 }
231 }
246 232
233out:
247 /* update the index */ 234 /* update the index */
248 lx->lx_read += count; 235 lx->lx_read += count;
249 lx->lx_read %= lx->buffer_size; 236 lx->lx_read %= lx->buffer_size;
250 237
251 return (count); 238 return count;
252}
253
254static inline int spacefree(int read, int write, int size)
255{
256 if (read == write) {
257 /* never fill the buffer completely, so indexes are always equal if empty
258 and only empty, or !equal if data available */
259 return (size - 1);
260 }
261
262 return ((read + size - write) % size) - 1;
263} 239}
264 240
265static ssize_t rtlx_write(struct file *file, const char __user * buffer, 241static ssize_t rtlx_write(struct file *file, const char __user * buffer,
266 size_t count, loff_t * ppos) 242 size_t count, loff_t * ppos)
267{ 243{
244 unsigned long failed;
268 int minor; 245 int minor;
269 struct rtlx_channel *rt; 246 struct rtlx_channel *rt;
270 size_t fl; 247 size_t fl;
@@ -277,7 +254,7 @@ static ssize_t rtlx_write(struct file *file, const char __user * buffer,
277 if (!spacefree(rt->rt_read, rt->rt_write, rt->buffer_size)) { 254 if (!spacefree(rt->rt_read, rt->rt_write, rt->buffer_size)) {
278 255
279 if (file->f_flags & O_NONBLOCK) 256 if (file->f_flags & O_NONBLOCK)
280 return (-EAGAIN); 257 return -EAGAIN;
281 258
282 add_wait_queue(&channel_wqs[minor].rt_queue, &wait); 259 add_wait_queue(&channel_wqs[minor].rt_queue, &wait);
283 set_current_state(TASK_INTERRUPTIBLE); 260 set_current_state(TASK_INTERRUPTIBLE);
@@ -290,52 +267,64 @@ static ssize_t rtlx_write(struct file *file, const char __user * buffer,
290 } 267 }
291 268
292 /* total number of bytes to copy */ 269 /* total number of bytes to copy */
293 count = min( count, (size_t)spacefree(rt->rt_read, rt->rt_write, rt->buffer_size) ); 270 count = min(count, (size_t)spacefree(rt->rt_read, rt->rt_write, rt->buffer_size) );
294 271
295 /* first bit from write pointer to the end of the buffer, or count */ 272 /* first bit from write pointer to the end of the buffer, or count */
296 fl = min(count, (size_t) rt->buffer_size - rt->rt_write); 273 fl = min(count, (size_t) rt->buffer_size - rt->rt_write);
297 274
298 copy_from_user(&rt->rt_buffer[rt->rt_write], buffer, fl); 275 failed = copy_from_user(&rt->rt_buffer[rt->rt_write], buffer, fl);
276 if (failed) {
277 count = fl - failed;
278 goto out;
279 }
299 280
300 /* if there's any left copy to the beginning of the buffer */ 281 /* if there's any left copy to the beginning of the buffer */
301 if( count - fl ) 282 if (count - fl) {
302 copy_from_user(rt->rt_buffer, buffer + fl, count - fl); 283 failed = copy_from_user(rt->rt_buffer, buffer + fl, count - fl);
284 if (failed) {
285 count -= failed;
286 goto out;
287 }
288 }
303 289
290out:
304 rt->rt_write += count; 291 rt->rt_write += count;
305 rt->rt_write %= rt->buffer_size; 292 rt->rt_write %= rt->buffer_size;
306 293
307 return(count); 294 return count;
308} 295}
309 296
310static struct file_operations rtlx_fops = { 297static struct file_operations rtlx_fops = {
311 .owner = THIS_MODULE, 298 .owner = THIS_MODULE,
312 .open = rtlx_open, 299 .open = rtlx_open,
313 .release = rtlx_release, 300 .release = rtlx_release,
314 .write = rtlx_write, 301 .write = rtlx_write,
315 .read = rtlx_read, 302 .read = rtlx_read,
316 .poll = rtlx_poll 303 .poll = rtlx_poll
317}; 304};
318 305
319static int rtlx_module_init(void) 306static char register_chrdev_failed[] __initdata =
307 KERN_ERR "rtlx_module_init: unable to register device\n";
308
309static int __init rtlx_module_init(void)
320{ 310{
321 if ((major = register_chrdev(RTLX_MAJOR, module_name, &rtlx_fops)) < 0) { 311 major = register_chrdev(0, module_name, &rtlx_fops);
322 printk("rtlx_module_init: unable to register device\n"); 312 if (major < 0) {
323 return (-EBUSY); 313 printk(register_chrdev_failed);
314 return major;
324 } 315 }
325 316
326 if (major == 0) 317 return 0;
327 major = RTLX_MAJOR;
328
329 return (0);
330} 318}
331 319
332static void rtlx_module_exit(void) 320static void __exit rtlx_module_exit(void)
333{ 321{
334 unregister_chrdev(major, module_name); 322 unregister_chrdev(major, module_name);
335} 323}
336 324
337module_init(rtlx_module_init); 325module_init(rtlx_module_init);
338module_exit(rtlx_module_exit); 326module_exit(rtlx_module_exit);
327
339MODULE_DESCRIPTION("MIPS RTLX"); 328MODULE_DESCRIPTION("MIPS RTLX");
340MODULE_AUTHOR("Elizabeth Clarke, MIPS Technologies, Inc"); 329MODULE_AUTHOR("Elizabeth Clarke, MIPS Technologies, Inc.");
341MODULE_LICENSE("GPL"); 330MODULE_LICENSE("GPL");
diff --git a/arch/mips/kernel/signal.c b/arch/mips/kernel/signal.c
index 9202a17db8f7..05e09eedabff 100644
--- a/arch/mips/kernel/signal.c
+++ b/arch/mips/kernel/signal.c
@@ -384,9 +384,6 @@ give_sigsegv:
384 return 0; 384 return 0;
385} 385}
386 386
387extern void setup_rt_frame_n32(struct k_sigaction * ka,
388 struct pt_regs *regs, int signr, sigset_t *set, siginfo_t *info);
389
390static inline int handle_signal(unsigned long sig, siginfo_t *info, 387static inline int handle_signal(unsigned long sig, siginfo_t *info,
391 struct k_sigaction *ka, sigset_t *oldset, struct pt_regs *regs) 388 struct k_sigaction *ka, sigset_t *oldset, struct pt_regs *regs)
392{ 389{
diff --git a/arch/mips/kernel/signal32.c b/arch/mips/kernel/signal32.c
index dbe821303125..e315d3f6aa6e 100644
--- a/arch/mips/kernel/signal32.c
+++ b/arch/mips/kernel/signal32.c
@@ -647,8 +647,8 @@ static inline void *get_sigframe(struct k_sigaction *ka, struct pt_regs *regs,
647 return (void *)((sp - frame_size) & ALMASK); 647 return (void *)((sp - frame_size) & ALMASK);
648} 648}
649 649
650void setup_frame_32(struct k_sigaction * ka, struct pt_regs *regs, 650int setup_frame_32(struct k_sigaction * ka, struct pt_regs *regs,
651 int signr, sigset_t *set) 651 int signr, sigset_t *set)
652{ 652{
653 struct sigframe *frame; 653 struct sigframe *frame;
654 int err = 0; 654 int err = 0;
@@ -694,13 +694,15 @@ void setup_frame_32(struct k_sigaction * ka, struct pt_regs *regs,
694 current->comm, current->pid, 694 current->comm, current->pid,
695 frame, regs->cp0_epc, frame->sf_code); 695 frame, regs->cp0_epc, frame->sf_code);
696#endif 696#endif
697 return; 697 return 1;
698 698
699give_sigsegv: 699give_sigsegv:
700 force_sigsegv(signr, current); 700 force_sigsegv(signr, current);
701 return 0;
701} 702}
702 703
703void setup_rt_frame_32(struct k_sigaction * ka, struct pt_regs *regs, int signr, sigset_t *set, siginfo_t *info) 704int setup_rt_frame_32(struct k_sigaction * ka, struct pt_regs *regs,
705 int signr, sigset_t *set, siginfo_t *info)
704{ 706{
705 struct rt_sigframe32 *frame; 707 struct rt_sigframe32 *frame;
706 int err = 0; 708 int err = 0;
@@ -763,10 +765,11 @@ void setup_rt_frame_32(struct k_sigaction * ka, struct pt_regs *regs, int signr,
763 current->comm, current->pid, 765 current->comm, current->pid,
764 frame, regs->cp0_epc, frame->rs_code); 766 frame, regs->cp0_epc, frame->rs_code);
765#endif 767#endif
766 return; 768 return 1;
767 769
768give_sigsegv: 770give_sigsegv:
769 force_sigsegv(signr, current); 771 force_sigsegv(signr, current);
772 return 0;
770} 773}
771 774
772static inline int handle_signal(unsigned long sig, siginfo_t *info, 775static inline int handle_signal(unsigned long sig, siginfo_t *info,
diff --git a/arch/mips/kernel/smp.c b/arch/mips/kernel/smp.c
index fcacf1aae98a..25472fcaf715 100644
--- a/arch/mips/kernel/smp.c
+++ b/arch/mips/kernel/smp.c
@@ -82,7 +82,7 @@ extern ATTRIB_NORET void cpu_idle(void);
82 */ 82 */
83asmlinkage void start_secondary(void) 83asmlinkage void start_secondary(void)
84{ 84{
85 unsigned int cpu = smp_processor_id(); 85 unsigned int cpu;
86 86
87 cpu_probe(); 87 cpu_probe();
88 cpu_report(); 88 cpu_report();
@@ -95,6 +95,8 @@ asmlinkage void start_secondary(void)
95 */ 95 */
96 96
97 calibrate_delay(); 97 calibrate_delay();
98 preempt_disable();
99 cpu = smp_processor_id();
98 cpu_data[cpu].udelay_val = loops_per_jiffy; 100 cpu_data[cpu].udelay_val = loops_per_jiffy;
99 101
100 prom_smp_finish(); 102 prom_smp_finish();
diff --git a/arch/mips/kernel/vpe.c b/arch/mips/kernel/vpe.c
index 97fefcc9dbe7..06be405be399 100644
--- a/arch/mips/kernel/vpe.c
+++ b/arch/mips/kernel/vpe.c
@@ -58,10 +58,6 @@
58 58
59typedef void *vpe_handle; 59typedef void *vpe_handle;
60 60
61// defined here because the kernel module loader doesn't have
62// anything to do with it.
63#define SHN_MIPS_SCOMMON 0xff03
64
65#ifndef ARCH_SHF_SMALL 61#ifndef ARCH_SHF_SMALL
66#define ARCH_SHF_SMALL 0 62#define ARCH_SHF_SMALL 0
67#endif 63#endif
@@ -69,11 +65,8 @@ typedef void *vpe_handle;
69/* If this is set, the section belongs in the init part of the module */ 65/* If this is set, the section belongs in the init part of the module */
70#define INIT_OFFSET_MASK (1UL << (BITS_PER_LONG-1)) 66#define INIT_OFFSET_MASK (1UL << (BITS_PER_LONG-1))
71 67
72// temp number,
73#define VPE_MAJOR 63
74
75static char module_name[] = "vpe"; 68static char module_name[] = "vpe";
76static int major = 0; 69static int major;
77 70
78/* grab the likely amount of memory we will need. */ 71/* grab the likely amount of memory we will need. */
79#ifdef CONFIG_MIPS_VPE_LOADER_TOM 72#ifdef CONFIG_MIPS_VPE_LOADER_TOM
@@ -98,22 +91,7 @@ enum tc_state {
98 TC_STATE_DYNAMIC 91 TC_STATE_DYNAMIC
99}; 92};
100 93
101struct vpe; 94struct vpe {
102typedef struct tc {
103 enum tc_state state;
104 int index;
105
106 /* parent VPE */
107 struct vpe *pvpe;
108
109 /* The list of TC's with this VPE */
110 struct list_head tc;
111
112 /* The global list of tc's */
113 struct list_head list;
114} tc_t;
115
116typedef struct vpe {
117 enum vpe_state state; 95 enum vpe_state state;
118 96
119 /* (device) minor associated with this vpe */ 97 /* (device) minor associated with this vpe */
@@ -135,7 +113,21 @@ typedef struct vpe {
135 113
136 /* shared symbol address */ 114 /* shared symbol address */
137 void *shared_ptr; 115 void *shared_ptr;
138} vpe_t; 116};
117
118struct tc {
119 enum tc_state state;
120 int index;
121
122 /* parent VPE */
123 struct vpe *pvpe;
124
125 /* The list of TC's with this VPE */
126 struct list_head tc;
127
128 /* The global list of tc's */
129 struct list_head list;
130};
139 131
140struct vpecontrol_ { 132struct vpecontrol_ {
141 /* Virtual processing elements */ 133 /* Virtual processing elements */
@@ -146,7 +138,7 @@ struct vpecontrol_ {
146} vpecontrol; 138} vpecontrol;
147 139
148static void release_progmem(void *ptr); 140static void release_progmem(void *ptr);
149static void dump_vpe(vpe_t * v); 141static void dump_vpe(struct vpe * v);
150extern void save_gp_address(unsigned int secbase, unsigned int rel); 142extern void save_gp_address(unsigned int secbase, unsigned int rel);
151 143
152/* get the vpe associated with this minor */ 144/* get the vpe associated with this minor */
@@ -197,13 +189,11 @@ struct vpe *alloc_vpe(int minor)
197{ 189{
198 struct vpe *v; 190 struct vpe *v;
199 191
200 if ((v = kmalloc(sizeof(struct vpe), GFP_KERNEL)) == NULL) { 192 if ((v = kzalloc(sizeof(struct vpe), GFP_KERNEL)) == NULL) {
201 printk(KERN_WARNING "VPE: alloc_vpe no mem\n"); 193 printk(KERN_WARNING "VPE: alloc_vpe no mem\n");
202 return NULL; 194 return NULL;
203 } 195 }
204 196
205 memset(v, 0, sizeof(struct vpe));
206
207 INIT_LIST_HEAD(&v->tc); 197 INIT_LIST_HEAD(&v->tc);
208 list_add_tail(&v->list, &vpecontrol.vpe_list); 198 list_add_tail(&v->list, &vpecontrol.vpe_list);
209 199
@@ -216,13 +206,11 @@ struct tc *alloc_tc(int index)
216{ 206{
217 struct tc *t; 207 struct tc *t;
218 208
219 if ((t = kmalloc(sizeof(struct tc), GFP_KERNEL)) == NULL) { 209 if ((t = kzalloc(sizeof(struct tc), GFP_KERNEL)) == NULL) {
220 printk(KERN_WARNING "VPE: alloc_tc no mem\n"); 210 printk(KERN_WARNING "VPE: alloc_tc no mem\n");
221 return NULL; 211 return NULL;
222 } 212 }
223 213
224 memset(t, 0, sizeof(struct tc));
225
226 INIT_LIST_HEAD(&t->tc); 214 INIT_LIST_HEAD(&t->tc);
227 list_add_tail(&t->list, &vpecontrol.tc_list); 215 list_add_tail(&t->list, &vpecontrol.tc_list);
228 216
@@ -412,16 +400,17 @@ static int apply_r_mips_26(struct module *me, uint32_t *location,
412 return -ENOEXEC; 400 return -ENOEXEC;
413 } 401 }
414 402
415/* Not desperately convinced this is a good check of an overflow condition 403/*
416 anyway. But it gets in the way of handling undefined weak symbols which 404 * Not desperately convinced this is a good check of an overflow condition
417 we want to set to zero. 405 * anyway. But it gets in the way of handling undefined weak symbols which
418 if ((v & 0xf0000000) != (((unsigned long)location + 4) & 0xf0000000)) { 406 * we want to set to zero.
419 printk(KERN_ERR 407 * if ((v & 0xf0000000) != (((unsigned long)location + 4) & 0xf0000000)) {
420 "module %s: relocation overflow\n", 408 * printk(KERN_ERR
421 me->name); 409 * "module %s: relocation overflow\n",
422 return -ENOEXEC; 410 * me->name);
423 } 411 * return -ENOEXEC;
424*/ 412 * }
413 */
425 414
426 *location = (*location & ~0x03ffffff) | 415 *location = (*location & ~0x03ffffff) |
427 ((*location + (v >> 2)) & 0x03ffffff); 416 ((*location + (v >> 2)) & 0x03ffffff);
@@ -681,7 +670,7 @@ static void dump_tclist(void)
681} 670}
682 671
683/* We are prepared so configure and start the VPE... */ 672/* We are prepared so configure and start the VPE... */
684int vpe_run(vpe_t * v) 673int vpe_run(struct vpe * v)
685{ 674{
686 unsigned long val; 675 unsigned long val;
687 struct tc *t; 676 struct tc *t;
@@ -772,7 +761,7 @@ int vpe_run(vpe_t * v)
772 return 0; 761 return 0;
773} 762}
774 763
775static unsigned long find_vpe_symbols(vpe_t * v, Elf_Shdr * sechdrs, 764static unsigned long find_vpe_symbols(struct vpe * v, Elf_Shdr * sechdrs,
776 unsigned int symindex, const char *strtab, 765 unsigned int symindex, const char *strtab,
777 struct module *mod) 766 struct module *mod)
778{ 767{
@@ -792,10 +781,12 @@ static unsigned long find_vpe_symbols(vpe_t * v, Elf_Shdr * sechdrs,
792 return 0; 781 return 0;
793} 782}
794 783
795/* Allocates a VPE with some program code space(the load address), copies the contents 784/*
796 of the program (p)buffer performing relocatations/etc, free's it when finished. 785 * Allocates a VPE with some program code space(the load address), copies
786 * the contents of the program (p)buffer performing relocatations/etc,
787 * free's it when finished.
797*/ 788*/
798int vpe_elfload(vpe_t * v) 789int vpe_elfload(struct vpe * v)
799{ 790{
800 Elf_Ehdr *hdr; 791 Elf_Ehdr *hdr;
801 Elf_Shdr *sechdrs; 792 Elf_Shdr *sechdrs;
@@ -931,7 +922,7 @@ cleanup:
931 return err; 922 return err;
932} 923}
933 924
934static void dump_vpe(vpe_t * v) 925static void dump_vpe(struct vpe * v)
935{ 926{
936 struct tc *t; 927 struct tc *t;
937 928
@@ -947,7 +938,7 @@ static void dump_vpe(vpe_t * v)
947static int vpe_open(struct inode *inode, struct file *filp) 938static int vpe_open(struct inode *inode, struct file *filp)
948{ 939{
949 int minor; 940 int minor;
950 vpe_t *v; 941 struct vpe *v;
951 942
952 /* assume only 1 device at the mo. */ 943 /* assume only 1 device at the mo. */
953 if ((minor = MINOR(inode->i_rdev)) != 1) { 944 if ((minor = MINOR(inode->i_rdev)) != 1) {
@@ -1001,7 +992,7 @@ static int vpe_open(struct inode *inode, struct file *filp)
1001static int vpe_release(struct inode *inode, struct file *filp) 992static int vpe_release(struct inode *inode, struct file *filp)
1002{ 993{
1003 int minor, ret = 0; 994 int minor, ret = 0;
1004 vpe_t *v; 995 struct vpe *v;
1005 Elf_Ehdr *hdr; 996 Elf_Ehdr *hdr;
1006 997
1007 minor = MINOR(inode->i_rdev); 998 minor = MINOR(inode->i_rdev);
@@ -1035,7 +1026,7 @@ static ssize_t vpe_write(struct file *file, const char __user * buffer,
1035{ 1026{
1036 int minor; 1027 int minor;
1037 size_t ret = count; 1028 size_t ret = count;
1038 vpe_t *v; 1029 struct vpe *v;
1039 1030
1040 minor = MINOR(file->f_dentry->d_inode->i_rdev); 1031 minor = MINOR(file->f_dentry->d_inode->i_rdev);
1041 if ((v = get_vpe(minor)) == NULL) 1032 if ((v = get_vpe(minor)) == NULL)
@@ -1180,14 +1171,11 @@ static int __init vpe_module_init(void)
1180 return -ENODEV; 1171 return -ENODEV;
1181 } 1172 }
1182 1173
1183 if ((major = register_chrdev(VPE_MAJOR, module_name, &vpe_fops) < 0)) { 1174 if ((major = register_chrdev(0, module_name, &vpe_fops) < 0)) {
1184 printk("VPE loader: unable to register character device\n"); 1175 printk("VPE loader: unable to register character device\n");
1185 return -EBUSY; 1176 return major;
1186 } 1177 }
1187 1178
1188 if (major == 0)
1189 major = VPE_MAJOR;
1190
1191 dmt(); 1179 dmt();
1192 dvpe(); 1180 dvpe();
1193 1181
diff --git a/arch/mips/lasat/ds1603.c b/arch/mips/lasat/ds1603.c
index 9d7812e03dcd..7dced67c55eb 100644
--- a/arch/mips/lasat/ds1603.c
+++ b/arch/mips/lasat/ds1603.c
@@ -8,6 +8,7 @@
8#include <asm/lasat/lasat.h> 8#include <asm/lasat/lasat.h>
9#include <linux/delay.h> 9#include <linux/delay.h>
10#include <asm/lasat/ds1603.h> 10#include <asm/lasat/ds1603.h>
11#include <asm/time.h>
11 12
12#include "ds1603.h" 13#include "ds1603.h"
13 14
@@ -138,19 +139,27 @@ static void rtc_end_op(void)
138unsigned long ds1603_read(void) 139unsigned long ds1603_read(void)
139{ 140{
140 unsigned long word; 141 unsigned long word;
142 unsigned long flags;
143
144 spin_lock_irqsave(&rtc_lock, flags);
141 rtc_init_op(); 145 rtc_init_op();
142 rtc_write_byte(READ_TIME_CMD); 146 rtc_write_byte(READ_TIME_CMD);
143 word = rtc_read_word(); 147 word = rtc_read_word();
144 rtc_end_op(); 148 rtc_end_op();
149 spin_unlock_irqrestore(&rtc_lock, flags);
145 return word; 150 return word;
146} 151}
147 152
148int ds1603_set(unsigned long time) 153int ds1603_set(unsigned long time)
149{ 154{
155 unsigned long flags;
156
157 spin_lock_irqsave(&rtc_lock, flags);
150 rtc_init_op(); 158 rtc_init_op();
151 rtc_write_byte(SET_TIME_CMD); 159 rtc_write_byte(SET_TIME_CMD);
152 rtc_write_word(time); 160 rtc_write_word(time);
153 rtc_end_op(); 161 rtc_end_op();
162 spin_unlock_irqrestore(&rtc_lock, flags);
154 163
155 return 0; 164 return 0;
156} 165}
diff --git a/arch/mips/momentum/jaguar_atx/setup.c b/arch/mips/momentum/jaguar_atx/setup.c
index 768bf4406452..bab192ddc185 100644
--- a/arch/mips/momentum/jaguar_atx/setup.c
+++ b/arch/mips/momentum/jaguar_atx/setup.c
@@ -149,7 +149,9 @@ arch_initcall(per_cpu_mappings);
149unsigned long m48t37y_get_time(void) 149unsigned long m48t37y_get_time(void)
150{ 150{
151 unsigned int year, month, day, hour, min, sec; 151 unsigned int year, month, day, hour, min, sec;
152 unsigned long flags;
152 153
154 spin_lock_irqsave(&rtc_lock, flags);
153 /* stop the update */ 155 /* stop the update */
154 rtc_base[0x7ff8] = 0x40; 156 rtc_base[0x7ff8] = 0x40;
155 157
@@ -166,6 +168,7 @@ unsigned long m48t37y_get_time(void)
166 168
167 /* start the update */ 169 /* start the update */
168 rtc_base[0x7ff8] = 0x00; 170 rtc_base[0x7ff8] = 0x00;
171 spin_unlock_irqrestore(&rtc_lock, flags);
169 172
170 return mktime(year, month, day, hour, min, sec); 173 return mktime(year, month, day, hour, min, sec);
171} 174}
@@ -173,11 +176,13 @@ unsigned long m48t37y_get_time(void)
173int m48t37y_set_time(unsigned long sec) 176int m48t37y_set_time(unsigned long sec)
174{ 177{
175 struct rtc_time tm; 178 struct rtc_time tm;
179 unsigned long flags;
176 180
177 /* convert to a more useful format -- note months count from 0 */ 181 /* convert to a more useful format -- note months count from 0 */
178 to_tm(sec, &tm); 182 to_tm(sec, &tm);
179 tm.tm_mon += 1; 183 tm.tm_mon += 1;
180 184
185 spin_lock_irqsave(&rtc_lock, flags);
181 /* enable writing */ 186 /* enable writing */
182 rtc_base[0x7ff8] = 0x80; 187 rtc_base[0x7ff8] = 0x80;
183 188
@@ -201,6 +206,7 @@ int m48t37y_set_time(unsigned long sec)
201 206
202 /* disable writing */ 207 /* disable writing */
203 rtc_base[0x7ff8] = 0x00; 208 rtc_base[0x7ff8] = 0x00;
209 spin_unlock_irqrestore(&rtc_lock, flags);
204 210
205 return 0; 211 return 0;
206} 212}
diff --git a/arch/mips/momentum/ocelot_3/setup.c b/arch/mips/momentum/ocelot_3/setup.c
index a7803e08f9db..c9b7ff8148ec 100644
--- a/arch/mips/momentum/ocelot_3/setup.c
+++ b/arch/mips/momentum/ocelot_3/setup.c
@@ -135,7 +135,9 @@ void setup_wired_tlb_entries(void)
135unsigned long m48t37y_get_time(void) 135unsigned long m48t37y_get_time(void)
136{ 136{
137 unsigned int year, month, day, hour, min, sec; 137 unsigned int year, month, day, hour, min, sec;
138 unsigned long flags;
138 139
140 spin_lock_irqsave(&rtc_lock, flags);
139 /* stop the update */ 141 /* stop the update */
140 rtc_base[0x7ff8] = 0x40; 142 rtc_base[0x7ff8] = 0x40;
141 143
@@ -152,6 +154,7 @@ unsigned long m48t37y_get_time(void)
152 154
153 /* start the update */ 155 /* start the update */
154 rtc_base[0x7ff8] = 0x00; 156 rtc_base[0x7ff8] = 0x00;
157 spin_unlock_irqrestore(&rtc_lock, flags);
155 158
156 return mktime(year, month, day, hour, min, sec); 159 return mktime(year, month, day, hour, min, sec);
157} 160}
@@ -159,11 +162,13 @@ unsigned long m48t37y_get_time(void)
159int m48t37y_set_time(unsigned long sec) 162int m48t37y_set_time(unsigned long sec)
160{ 163{
161 struct rtc_time tm; 164 struct rtc_time tm;
165 unsigned long flags;
162 166
163 /* convert to a more useful format -- note months count from 0 */ 167 /* convert to a more useful format -- note months count from 0 */
164 to_tm(sec, &tm); 168 to_tm(sec, &tm);
165 tm.tm_mon += 1; 169 tm.tm_mon += 1;
166 170
171 spin_lock_irqsave(&rtc_lock, flags);
167 /* enable writing */ 172 /* enable writing */
168 rtc_base[0x7ff8] = 0x80; 173 rtc_base[0x7ff8] = 0x80;
169 174
@@ -187,6 +192,7 @@ int m48t37y_set_time(unsigned long sec)
187 192
188 /* disable writing */ 193 /* disable writing */
189 rtc_base[0x7ff8] = 0x00; 194 rtc_base[0x7ff8] = 0x00;
195 spin_unlock_irqrestore(&rtc_lock, flags);
190 196
191 return 0; 197 return 0;
192} 198}
diff --git a/arch/mips/momentum/ocelot_c/setup.c b/arch/mips/momentum/ocelot_c/setup.c
index ce70fc96f160..2755c1547473 100644
--- a/arch/mips/momentum/ocelot_c/setup.c
+++ b/arch/mips/momentum/ocelot_c/setup.c
@@ -140,7 +140,9 @@ unsigned long m48t37y_get_time(void)
140 unsigned char* rtc_base = (unsigned char*)0xfc800000; 140 unsigned char* rtc_base = (unsigned char*)0xfc800000;
141#endif 141#endif
142 unsigned int year, month, day, hour, min, sec; 142 unsigned int year, month, day, hour, min, sec;
143 unsigned long flags;
143 144
145 spin_lock_irqsave(&rtc_lock, flags);
144 /* stop the update */ 146 /* stop the update */
145 rtc_base[0x7ff8] = 0x40; 147 rtc_base[0x7ff8] = 0x40;
146 148
@@ -157,6 +159,7 @@ unsigned long m48t37y_get_time(void)
157 159
158 /* start the update */ 160 /* start the update */
159 rtc_base[0x7ff8] = 0x00; 161 rtc_base[0x7ff8] = 0x00;
162 spin_unlock_irqrestore(&rtc_lock, flags);
160 163
161 return mktime(year, month, day, hour, min, sec); 164 return mktime(year, month, day, hour, min, sec);
162} 165}
@@ -169,11 +172,13 @@ int m48t37y_set_time(unsigned long sec)
169 unsigned char* rtc_base = (unsigned char*)0xfc800000; 172 unsigned char* rtc_base = (unsigned char*)0xfc800000;
170#endif 173#endif
171 struct rtc_time tm; 174 struct rtc_time tm;
175 unsigned long flags;
172 176
173 /* convert to a more useful format -- note months count from 0 */ 177 /* convert to a more useful format -- note months count from 0 */
174 to_tm(sec, &tm); 178 to_tm(sec, &tm);
175 tm.tm_mon += 1; 179 tm.tm_mon += 1;
176 180
181 spin_lock_irqsave(&rtc_lock, flags);
177 /* enable writing */ 182 /* enable writing */
178 rtc_base[0x7ff8] = 0x80; 183 rtc_base[0x7ff8] = 0x80;
179 184
@@ -197,6 +202,7 @@ int m48t37y_set_time(unsigned long sec)
197 202
198 /* disable writing */ 203 /* disable writing */
199 rtc_base[0x7ff8] = 0x00; 204 rtc_base[0x7ff8] = 0x00;
205 spin_unlock_irqrestore(&rtc_lock, flags);
200 206
201 return 0; 207 return 0;
202} 208}
diff --git a/arch/mips/pmc-sierra/yosemite/setup.c b/arch/mips/pmc-sierra/yosemite/setup.c
index bdc2ab55bed6..059755b5ed57 100644
--- a/arch/mips/pmc-sierra/yosemite/setup.c
+++ b/arch/mips/pmc-sierra/yosemite/setup.c
@@ -73,7 +73,9 @@ void __init bus_error_init(void)
73unsigned long m48t37y_get_time(void) 73unsigned long m48t37y_get_time(void)
74{ 74{
75 unsigned int year, month, day, hour, min, sec; 75 unsigned int year, month, day, hour, min, sec;
76 unsigned long flags;
76 77
78 spin_lock_irqsave(&rtc_lock, flags);
77 /* Stop the update to the time */ 79 /* Stop the update to the time */
78 m48t37_base->control = 0x40; 80 m48t37_base->control = 0x40;
79 81
@@ -88,6 +90,7 @@ unsigned long m48t37y_get_time(void)
88 90
89 /* Start the update to the time again */ 91 /* Start the update to the time again */
90 m48t37_base->control = 0x00; 92 m48t37_base->control = 0x00;
93 spin_unlock_irqrestore(&rtc_lock, flags);
91 94
92 return mktime(year, month, day, hour, min, sec); 95 return mktime(year, month, day, hour, min, sec);
93} 96}
@@ -95,11 +98,13 @@ unsigned long m48t37y_get_time(void)
95int m48t37y_set_time(unsigned long sec) 98int m48t37y_set_time(unsigned long sec)
96{ 99{
97 struct rtc_time tm; 100 struct rtc_time tm;
101 unsigned long flags;
98 102
99 /* convert to a more useful format -- note months count from 0 */ 103 /* convert to a more useful format -- note months count from 0 */
100 to_tm(sec, &tm); 104 to_tm(sec, &tm);
101 tm.tm_mon += 1; 105 tm.tm_mon += 1;
102 106
107 spin_lock_irqsave(&rtc_lock, flags);
103 /* enable writing */ 108 /* enable writing */
104 m48t37_base->control = 0x80; 109 m48t37_base->control = 0x80;
105 110
@@ -123,6 +128,7 @@ int m48t37y_set_time(unsigned long sec)
123 128
124 /* disable writing */ 129 /* disable writing */
125 m48t37_base->control = 0x00; 130 m48t37_base->control = 0x00;
131 spin_unlock_irqrestore(&rtc_lock, flags);
126 132
127 return 0; 133 return 0;
128} 134}
diff --git a/arch/mips/sgi-ip22/ip22-time.c b/arch/mips/sgi-ip22/ip22-time.c
index df9b5694328a..b7300cc5c5ad 100644
--- a/arch/mips/sgi-ip22/ip22-time.c
+++ b/arch/mips/sgi-ip22/ip22-time.c
@@ -35,7 +35,9 @@ static unsigned long indy_rtc_get_time(void)
35{ 35{
36 unsigned int yrs, mon, day, hrs, min, sec; 36 unsigned int yrs, mon, day, hrs, min, sec;
37 unsigned int save_control; 37 unsigned int save_control;
38 unsigned long flags;
38 39
40 spin_lock_irqsave(&rtc_lock, flags);
39 save_control = hpc3c0->rtcregs[RTC_CMD] & 0xff; 41 save_control = hpc3c0->rtcregs[RTC_CMD] & 0xff;
40 hpc3c0->rtcregs[RTC_CMD] = save_control | RTC_TE; 42 hpc3c0->rtcregs[RTC_CMD] = save_control | RTC_TE;
41 43
@@ -47,6 +49,7 @@ static unsigned long indy_rtc_get_time(void)
47 yrs = BCD2BIN(hpc3c0->rtcregs[RTC_YEAR] & 0xff); 49 yrs = BCD2BIN(hpc3c0->rtcregs[RTC_YEAR] & 0xff);
48 50
49 hpc3c0->rtcregs[RTC_CMD] = save_control; 51 hpc3c0->rtcregs[RTC_CMD] = save_control;
52 spin_unlock_irqrestore(&rtc_lock, flags);
50 53
51 if (yrs < 45) 54 if (yrs < 45)
52 yrs += 30; 55 yrs += 30;
@@ -60,6 +63,7 @@ static int indy_rtc_set_time(unsigned long tim)
60{ 63{
61 struct rtc_time tm; 64 struct rtc_time tm;
62 unsigned int save_control; 65 unsigned int save_control;
66 unsigned long flags;
63 67
64 to_tm(tim, &tm); 68 to_tm(tim, &tm);
65 69
@@ -68,6 +72,7 @@ static int indy_rtc_set_time(unsigned long tim)
68 if (tm.tm_year >= 100) 72 if (tm.tm_year >= 100)
69 tm.tm_year -= 100; 73 tm.tm_year -= 100;
70 74
75 spin_lock_irqsave(&rtc_lock, flags);
71 save_control = hpc3c0->rtcregs[RTC_CMD] & 0xff; 76 save_control = hpc3c0->rtcregs[RTC_CMD] & 0xff;
72 hpc3c0->rtcregs[RTC_CMD] = save_control | RTC_TE; 77 hpc3c0->rtcregs[RTC_CMD] = save_control | RTC_TE;
73 78
@@ -80,6 +85,7 @@ static int indy_rtc_set_time(unsigned long tim)
80 hpc3c0->rtcregs[RTC_HUNDREDTH_SECOND] = 0; 85 hpc3c0->rtcregs[RTC_HUNDREDTH_SECOND] = 0;
81 86
82 hpc3c0->rtcregs[RTC_CMD] = save_control; 87 hpc3c0->rtcregs[RTC_CMD] = save_control;
88 spin_unlock_irqrestore(&rtc_lock, flags);
83 89
84 return 0; 90 return 0;
85} 91}
diff --git a/arch/mips/sibyte/swarm/rtc_m41t81.c b/arch/mips/sibyte/swarm/rtc_m41t81.c
index 5b4fc26c1b36..c13914bdda59 100644
--- a/arch/mips/sibyte/swarm/rtc_m41t81.c
+++ b/arch/mips/sibyte/swarm/rtc_m41t81.c
@@ -144,6 +144,7 @@ static int m41t81_write(uint8_t addr, int b)
144int m41t81_set_time(unsigned long t) 144int m41t81_set_time(unsigned long t)
145{ 145{
146 struct rtc_time tm; 146 struct rtc_time tm;
147 unsigned long flags;
147 148
148 to_tm(t, &tm); 149 to_tm(t, &tm);
149 150
@@ -153,6 +154,7 @@ int m41t81_set_time(unsigned long t)
153 * believe we should finish writing min within a second. 154 * believe we should finish writing min within a second.
154 */ 155 */
155 156
157 spin_lock_irqsave(&rtc_lock, flags);
156 tm.tm_sec = BIN2BCD(tm.tm_sec); 158 tm.tm_sec = BIN2BCD(tm.tm_sec);
157 m41t81_write(M41T81REG_SC, tm.tm_sec); 159 m41t81_write(M41T81REG_SC, tm.tm_sec);
158 160
@@ -180,6 +182,7 @@ int m41t81_set_time(unsigned long t)
180 tm.tm_year %= 100; 182 tm.tm_year %= 100;
181 tm.tm_year = BIN2BCD(tm.tm_year); 183 tm.tm_year = BIN2BCD(tm.tm_year);
182 m41t81_write(M41T81REG_YR, tm.tm_year); 184 m41t81_write(M41T81REG_YR, tm.tm_year);
185 spin_unlock_irqrestore(&rtc_lock, flags);
183 186
184 return 0; 187 return 0;
185} 188}
@@ -187,19 +190,23 @@ int m41t81_set_time(unsigned long t)
187unsigned long m41t81_get_time(void) 190unsigned long m41t81_get_time(void)
188{ 191{
189 unsigned int year, mon, day, hour, min, sec; 192 unsigned int year, mon, day, hour, min, sec;
193 unsigned long flags;
190 194
191 /* 195 /*
192 * min is valid if two reads of sec are the same. 196 * min is valid if two reads of sec are the same.
193 */ 197 */
194 for (;;) { 198 for (;;) {
199 spin_lock_irqsave(&rtc_lock, flags);
195 sec = m41t81_read(M41T81REG_SC); 200 sec = m41t81_read(M41T81REG_SC);
196 min = m41t81_read(M41T81REG_MN); 201 min = m41t81_read(M41T81REG_MN);
197 if (sec == m41t81_read(M41T81REG_SC)) break; 202 if (sec == m41t81_read(M41T81REG_SC)) break;
203 spin_unlock_irqrestore(&rtc_lock, flags);
198 } 204 }
199 hour = m41t81_read(M41T81REG_HR) & 0x3f; 205 hour = m41t81_read(M41T81REG_HR) & 0x3f;
200 day = m41t81_read(M41T81REG_DT); 206 day = m41t81_read(M41T81REG_DT);
201 mon = m41t81_read(M41T81REG_MO); 207 mon = m41t81_read(M41T81REG_MO);
202 year = m41t81_read(M41T81REG_YR); 208 year = m41t81_read(M41T81REG_YR);
209 spin_unlock_irqrestore(&rtc_lock, flags);
203 210
204 sec = BCD2BIN(sec); 211 sec = BCD2BIN(sec);
205 min = BCD2BIN(min); 212 min = BCD2BIN(min);
diff --git a/arch/mips/sibyte/swarm/rtc_xicor1241.c b/arch/mips/sibyte/swarm/rtc_xicor1241.c
index d9ff9323f24e..f4a178836415 100644
--- a/arch/mips/sibyte/swarm/rtc_xicor1241.c
+++ b/arch/mips/sibyte/swarm/rtc_xicor1241.c
@@ -113,9 +113,11 @@ int xicor_set_time(unsigned long t)
113{ 113{
114 struct rtc_time tm; 114 struct rtc_time tm;
115 int tmp; 115 int tmp;
116 unsigned long flags;
116 117
117 to_tm(t, &tm); 118 to_tm(t, &tm);
118 119
120 spin_lock_irqsave(&rtc_lock, flags);
119 /* unlock writes to the CCR */ 121 /* unlock writes to the CCR */
120 xicor_write(X1241REG_SR, X1241REG_SR_WEL); 122 xicor_write(X1241REG_SR, X1241REG_SR_WEL);
121 xicor_write(X1241REG_SR, X1241REG_SR_WEL | X1241REG_SR_RWEL); 123 xicor_write(X1241REG_SR, X1241REG_SR_WEL | X1241REG_SR_RWEL);
@@ -160,6 +162,7 @@ int xicor_set_time(unsigned long t)
160 xicor_write(X1241REG_HR, tmp); 162 xicor_write(X1241REG_HR, tmp);
161 163
162 xicor_write(X1241REG_SR, 0); 164 xicor_write(X1241REG_SR, 0);
165 spin_unlock_irqrestore(&rtc_lock, flags);
163 166
164 return 0; 167 return 0;
165} 168}
@@ -167,7 +170,9 @@ int xicor_set_time(unsigned long t)
167unsigned long xicor_get_time(void) 170unsigned long xicor_get_time(void)
168{ 171{
169 unsigned int year, mon, day, hour, min, sec, y2k; 172 unsigned int year, mon, day, hour, min, sec, y2k;
173 unsigned long flags;
170 174
175 spin_lock_irqsave(&rtc_lock, flags);
171 sec = xicor_read(X1241REG_SC); 176 sec = xicor_read(X1241REG_SC);
172 min = xicor_read(X1241REG_MN); 177 min = xicor_read(X1241REG_MN);
173 hour = xicor_read(X1241REG_HR); 178 hour = xicor_read(X1241REG_HR);
@@ -183,6 +188,7 @@ unsigned long xicor_get_time(void)
183 mon = xicor_read(X1241REG_MO); 188 mon = xicor_read(X1241REG_MO);
184 year = xicor_read(X1241REG_YR); 189 year = xicor_read(X1241REG_YR);
185 y2k = xicor_read(X1241REG_Y2K); 190 y2k = xicor_read(X1241REG_Y2K);
191 spin_unlock_irqrestore(&rtc_lock, flags);
186 192
187 sec = BCD2BIN(sec); 193 sec = BCD2BIN(sec);
188 min = BCD2BIN(min); 194 min = BCD2BIN(min);
diff --git a/arch/mips/tx4938/toshiba_rbtx4938/irq.c b/arch/mips/tx4938/toshiba_rbtx4938/irq.c
index 230f5a93c2e6..9cd9c0fe2265 100644
--- a/arch/mips/tx4938/toshiba_rbtx4938/irq.c
+++ b/arch/mips/tx4938/toshiba_rbtx4938/irq.c
@@ -84,7 +84,6 @@ IRQ Device
84#include <asm/ptrace.h> 84#include <asm/ptrace.h>
85#include <asm/reboot.h> 85#include <asm/reboot.h>
86#include <asm/time.h> 86#include <asm/time.h>
87#include <linux/version.h>
88#include <linux/bootmem.h> 87#include <linux/bootmem.h>
89#include <asm/tx4938/rbtx4938.h> 88#include <asm/tx4938/rbtx4938.h>
90 89
diff --git a/arch/parisc/kernel/asm-offsets.c b/arch/parisc/kernel/asm-offsets.c
index 1ad44f92d6e4..e23c4e1e3a25 100644
--- a/arch/parisc/kernel/asm-offsets.c
+++ b/arch/parisc/kernel/asm-offsets.c
@@ -30,7 +30,6 @@
30#include <linux/types.h> 30#include <linux/types.h>
31#include <linux/sched.h> 31#include <linux/sched.h>
32#include <linux/thread_info.h> 32#include <linux/thread_info.h>
33#include <linux/version.h>
34#include <linux/ptrace.h> 33#include <linux/ptrace.h>
35#include <linux/hardirq.h> 34#include <linux/hardirq.h>
36 35
diff --git a/arch/parisc/kernel/process.c b/arch/parisc/kernel/process.c
index 7fdca87ef647..fee4f1f09adc 100644
--- a/arch/parisc/kernel/process.c
+++ b/arch/parisc/kernel/process.c
@@ -88,11 +88,15 @@ void default_idle(void)
88 */ 88 */
89void cpu_idle(void) 89void cpu_idle(void)
90{ 90{
91 set_thread_flag(TIF_POLLING_NRFLAG);
92
91 /* endless idle loop with no priority at all */ 93 /* endless idle loop with no priority at all */
92 while (1) { 94 while (1) {
93 while (!need_resched()) 95 while (!need_resched())
94 barrier(); 96 barrier();
97 preempt_enable_no_resched();
95 schedule(); 98 schedule();
99 preempt_disable();
96 check_pgt_cache(); 100 check_pgt_cache();
97 } 101 }
98} 102}
diff --git a/arch/parisc/kernel/ptrace.c b/arch/parisc/kernel/ptrace.c
index 18130c3748f3..b6fe202a620d 100644
--- a/arch/parisc/kernel/ptrace.c
+++ b/arch/parisc/kernel/ptrace.c
@@ -78,52 +78,13 @@ void ptrace_disable(struct task_struct *child)
78 pa_psw(child)->l = 0; 78 pa_psw(child)->l = 0;
79} 79}
80 80
81long sys_ptrace(long request, long pid, long addr, long data) 81long arch_ptrace(struct task_struct *child, long request, long addr, long data)
82{ 82{
83 struct task_struct *child;
84 long ret; 83 long ret;
85#ifdef DEBUG_PTRACE 84#ifdef DEBUG_PTRACE
86 long oaddr=addr, odata=data; 85 long oaddr=addr, odata=data;
87#endif 86#endif
88 87
89 lock_kernel();
90 ret = -EPERM;
91 if (request == PTRACE_TRACEME) {
92 /* are we already being traced? */
93 if (current->ptrace & PT_PTRACED)
94 goto out;
95
96 ret = security_ptrace(current->parent, current);
97 if (ret)
98 goto out;
99
100 /* set the ptrace bit in the process flags. */
101 current->ptrace |= PT_PTRACED;
102 ret = 0;
103 goto out;
104 }
105
106 ret = -ESRCH;
107 read_lock(&tasklist_lock);
108 child = find_task_by_pid(pid);
109 if (child)
110 get_task_struct(child);
111 read_unlock(&tasklist_lock);
112 if (!child)
113 goto out;
114 ret = -EPERM;
115 if (pid == 1) /* no messing around with init! */
116 goto out_tsk;
117
118 if (request == PTRACE_ATTACH) {
119 ret = ptrace_attach(child);
120 goto out_tsk;
121 }
122
123 ret = ptrace_check_attach(child, request == PTRACE_KILL);
124 if (ret < 0)
125 goto out_tsk;
126
127 switch (request) { 88 switch (request) {
128 case PTRACE_PEEKTEXT: /* read word at location addr. */ 89 case PTRACE_PEEKTEXT: /* read word at location addr. */
129 case PTRACE_PEEKDATA: { 90 case PTRACE_PEEKDATA: {
@@ -383,11 +344,11 @@ long sys_ptrace(long request, long pid, long addr, long data)
383 344
384 case PTRACE_GETEVENTMSG: 345 case PTRACE_GETEVENTMSG:
385 ret = put_user(child->ptrace_message, (unsigned int __user *) data); 346 ret = put_user(child->ptrace_message, (unsigned int __user *) data);
386 goto out_tsk; 347 goto out;
387 348
388 default: 349 default:
389 ret = ptrace_request(child, request, addr, data); 350 ret = ptrace_request(child, request, addr, data);
390 goto out_tsk; 351 goto out;
391 } 352 }
392 353
393out_wake_notrap: 354out_wake_notrap:
@@ -396,10 +357,7 @@ out_wake:
396 wake_up_process(child); 357 wake_up_process(child);
397 ret = 0; 358 ret = 0;
398out_tsk: 359out_tsk:
399 put_task_struct(child); 360 DBG("arch_ptrace(%ld, %d, %lx, %lx) returning %ld\n",
400out:
401 unlock_kernel();
402 DBG("sys_ptrace(%ld, %d, %lx, %lx) returning %ld\n",
403 request, pid, oaddr, odata, ret); 361 request, pid, oaddr, odata, ret);
404 return ret; 362 return ret;
405} 363}
diff --git a/arch/parisc/kernel/smp.c b/arch/parisc/kernel/smp.c
index 5db3be4e2704..a9ecf6465784 100644
--- a/arch/parisc/kernel/smp.c
+++ b/arch/parisc/kernel/smp.c
@@ -463,6 +463,7 @@ void __init smp_callin(void)
463#endif 463#endif
464 464
465 smp_cpu_init(slave_id); 465 smp_cpu_init(slave_id);
466 preempt_disable();
466 467
467#if 0 /* NOT WORKING YET - see entry.S */ 468#if 0 /* NOT WORKING YET - see entry.S */
468 istack = (void *)__get_free_pages(GFP_KERNEL,ISTACK_ORDER); 469 istack = (void *)__get_free_pages(GFP_KERNEL,ISTACK_ORDER);
diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig
index 967ecf92d6a7..1493c7896fe3 100644
--- a/arch/powerpc/Kconfig
+++ b/arch/powerpc/Kconfig
@@ -300,6 +300,7 @@ config PPC_PMAC64
300 bool 300 bool
301 depends on PPC_PMAC && POWER4 301 depends on PPC_PMAC && POWER4
302 select U3_DART 302 select U3_DART
303 select GENERIC_TBSYNC
303 default y 304 default y
304 305
305config PPC_PREP 306config PPC_PREP
@@ -314,15 +315,17 @@ config PPC_MAPLE
314 bool " Maple 970FX Evaluation Board" 315 bool " Maple 970FX Evaluation Board"
315 select U3_DART 316 select U3_DART
316 select MPIC_BROKEN_U3 317 select MPIC_BROKEN_U3
318 select GENERIC_TBSYNC
317 default n 319 default n
318 help 320 help
319 This option enables support for the Maple 970FX Evaluation Board. 321 This option enables support for the Maple 970FX Evaluation Board.
320 For more informations, refer to <http://www.970eval.com> 322 For more informations, refer to <http://www.970eval.com>
321 323
322config PPC_BPA 324config PPC_CELL
323 bool " Broadband Processor Architecture" 325 bool " Cell Broadband Processor Architecture"
324 depends on PPC_MULTIPLATFORM && PPC64 326 depends on PPC_MULTIPLATFORM && PPC64
325 select PPC_RTAS 327 select PPC_RTAS
328 select MMIO_NVRAM
326 329
327config PPC_OF 330config PPC_OF
328 bool 331 bool
@@ -353,13 +356,26 @@ config RTAS_ERROR_LOGGING
353 depends on PPC_RTAS 356 depends on PPC_RTAS
354 default n 357 default n
355 358
359config RTAS_PROC
360 bool "Proc interface to RTAS"
361 depends on PPC_RTAS
362 default y
363
364config RTAS_FLASH
365 tristate "Firmware flash interface"
366 depends on PPC64 && RTAS_PROC
367
368config MMIO_NVRAM
369 bool
370 default n
371
356config MPIC_BROKEN_U3 372config MPIC_BROKEN_U3
357 bool 373 bool
358 depends on PPC_MAPLE 374 depends on PPC_MAPLE
359 default y 375 default y
360 376
361config BPA_IIC 377config CELL_IIC
362 depends on PPC_BPA 378 depends on PPC_CELL
363 bool 379 bool
364 default y 380 default y
365 381
@@ -372,6 +388,11 @@ config PPC_MPC106
372 bool 388 bool
373 default n 389 default n
374 390
391config GENERIC_TBSYNC
392 bool
393 default y if CONFIG_PPC32 && CONFIG_SMP
394 default n
395
375source "drivers/cpufreq/Kconfig" 396source "drivers/cpufreq/Kconfig"
376 397
377config CPU_FREQ_PMAC 398config CPU_FREQ_PMAC
@@ -383,6 +404,14 @@ config CPU_FREQ_PMAC
383 this currently includes some models of iBook & Titanium 404 this currently includes some models of iBook & Titanium
384 PowerBook. 405 PowerBook.
385 406
407config CPU_FREQ_PMAC64
408 bool "Support for some Apple G5s"
409 depends on CPU_FREQ && PMAC_SMU && PPC64
410 select CPU_FREQ_TABLE
411 help
412 This adds support for frequency switching on Apple iMac G5,
413 and some of the more recent desktop G5 machines as well.
414
386config PPC601_SYNC_FIX 415config PPC601_SYNC_FIX
387 bool "Workarounds for PPC601 bugs" 416 bool "Workarounds for PPC601 bugs"
388 depends on 6xx && (PPC_PREP || PPC_PMAC) 417 depends on 6xx && (PPC_PREP || PPC_PMAC)
@@ -463,6 +492,7 @@ source "fs/Kconfig.binfmt"
463config FORCE_MAX_ZONEORDER 492config FORCE_MAX_ZONEORDER
464 int 493 int
465 depends on PPC64 494 depends on PPC64
495 default "9" if PPC_64K_PAGES
466 default "13" 496 default "13"
467 497
468config MATH_EMULATION 498config MATH_EMULATION
@@ -582,6 +612,16 @@ config NODES_SPAN_OTHER_NODES
582 def_bool y 612 def_bool y
583 depends on NEED_MULTIPLE_NODES 613 depends on NEED_MULTIPLE_NODES
584 614
615config PPC_64K_PAGES
616 bool "64k page size"
617 depends on PPC64
618 help
619 This option changes the kernel logical page size to 64k. On machines
620 without processor support for 64k pages, the kernel will simulate
621 them by loading each individual 4k page on demand transparently,
622 while on hardware with such support, it will be used to map
623 normal application pages.
624
585config SCHED_SMT 625config SCHED_SMT
586 bool "SMT (Hyperthreading) scheduler support" 626 bool "SMT (Hyperthreading) scheduler support"
587 depends on PPC64 && SMP 627 depends on PPC64 && SMP
@@ -886,8 +926,21 @@ source "arch/powerpc/platforms/iseries/Kconfig"
886 926
887source "lib/Kconfig" 927source "lib/Kconfig"
888 928
929menu "Instrumentation Support"
930 depends on EXPERIMENTAL
931
889source "arch/powerpc/oprofile/Kconfig" 932source "arch/powerpc/oprofile/Kconfig"
890 933
934config KPROBES
935 bool "Kprobes (EXPERIMENTAL)"
936 help
937 Kprobes allows you to trap at almost any kernel address and
938 execute a callback function. register_kprobe() establishes
939 a probepoint and specifies the callback. Kprobes is useful
940 for kernel debugging, non-intrusive instrumentation and testing.
941 If in doubt, say "N".
942endmenu
943
891source "arch/powerpc/Kconfig.debug" 944source "arch/powerpc/Kconfig.debug"
892 945
893source "security/Kconfig" 946source "security/Kconfig"
diff --git a/arch/powerpc/Kconfig.debug b/arch/powerpc/Kconfig.debug
index 0baf64ec80d0..30a30bf559ea 100644
--- a/arch/powerpc/Kconfig.debug
+++ b/arch/powerpc/Kconfig.debug
@@ -9,16 +9,6 @@ config DEBUG_STACKOVERFLOW
9 This option will cause messages to be printed if free stack space 9 This option will cause messages to be printed if free stack space
10 drops below a certain limit. 10 drops below a certain limit.
11 11
12config KPROBES
13 bool "Kprobes"
14 depends on DEBUG_KERNEL && PPC64
15 help
16 Kprobes allows you to trap at almost any kernel address and
17 execute a callback function. register_kprobe() establishes
18 a probepoint and specifies the callback. Kprobes is useful
19 for kernel debugging, non-intrusive instrumentation and testing.
20 If in doubt, say "N".
21
22config DEBUG_STACK_USAGE 12config DEBUG_STACK_USAGE
23 bool "Stack utilization instrumentation" 13 bool "Stack utilization instrumentation"
24 depends on DEBUG_KERNEL && PPC64 14 depends on DEBUG_KERNEL && PPC64
diff --git a/arch/powerpc/Makefile b/arch/powerpc/Makefile
index 2f4cce06a7e5..5bc11bd36c1f 100644
--- a/arch/powerpc/Makefile
+++ b/arch/powerpc/Makefile
@@ -12,9 +12,6 @@
12# Rewritten by Cort Dougan and Paul Mackerras 12# Rewritten by Cort Dougan and Paul Mackerras
13# 13#
14 14
15# This must match PAGE_OFFSET in include/asm-powerpc/page.h.
16KERNELLOAD := $(CONFIG_KERNEL_START)
17
18HAS_BIARCH := $(call cc-option-yn, -m32) 15HAS_BIARCH := $(call cc-option-yn, -m32)
19 16
20ifeq ($(CONFIG_PPC64),y) 17ifeq ($(CONFIG_PPC64),y)
@@ -59,7 +56,7 @@ override LD += -m elf$(SZ)ppc
59override CC += -m$(SZ) 56override CC += -m$(SZ)
60endif 57endif
61 58
62LDFLAGS_vmlinux := -Ttext $(KERNELLOAD) -Bstatic -e $(KERNELLOAD) 59LDFLAGS_vmlinux := -Bstatic
63 60
64# The -Iarch/$(ARCH)/include is temporary while we are merging 61# The -Iarch/$(ARCH)/include is temporary while we are merging
65CPPFLAGS += -Iarch/$(ARCH) -Iarch/$(ARCH)/include 62CPPFLAGS += -Iarch/$(ARCH) -Iarch/$(ARCH)/include
diff --git a/arch/powerpc/configs/cell_defconfig b/arch/powerpc/configs/cell_defconfig
new file mode 100644
index 000000000000..67ffecbc05cb
--- /dev/null
+++ b/arch/powerpc/configs/cell_defconfig
@@ -0,0 +1,1024 @@
1#
2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.14-rc4
4# Thu Oct 20 08:29:10 2005
5#
6CONFIG_64BIT=y
7CONFIG_MMU=y
8CONFIG_RWSEM_XCHGADD_ALGORITHM=y
9CONFIG_GENERIC_CALIBRATE_DELAY=y
10CONFIG_GENERIC_ISA_DMA=y
11CONFIG_EARLY_PRINTK=y
12CONFIG_COMPAT=y
13CONFIG_SCHED_NO_NO_OMIT_FRAME_POINTER=y
14CONFIG_ARCH_MAY_HAVE_PC_FDC=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_LOCALVERSION_AUTO=y
30CONFIG_SWAP=y
31CONFIG_SYSVIPC=y
32# CONFIG_POSIX_MQUEUE is not set
33# CONFIG_BSD_PROCESS_ACCT is not set
34CONFIG_SYSCTL=y
35# CONFIG_AUDIT is not set
36CONFIG_HOTPLUG=y
37CONFIG_KOBJECT_UEVENT=y
38# CONFIG_IKCONFIG is not set
39# CONFIG_CPUSETS is not set
40CONFIG_INITRAMFS_SOURCE=""
41# CONFIG_EMBEDDED is not set
42CONFIG_KALLSYMS=y
43# CONFIG_KALLSYMS_ALL is not set
44# CONFIG_KALLSYMS_EXTRA_PASS is not set
45CONFIG_PRINTK=y
46CONFIG_BUG=y
47CONFIG_BASE_FULL=y
48CONFIG_FUTEX=y
49CONFIG_EPOLL=y
50CONFIG_SHMEM=y
51CONFIG_CC_ALIGN_FUNCTIONS=0
52CONFIG_CC_ALIGN_LABELS=0
53CONFIG_CC_ALIGN_LOOPS=0
54CONFIG_CC_ALIGN_JUMPS=0
55# CONFIG_TINY_SHMEM is not set
56CONFIG_BASE_SMALL=0
57
58#
59# Loadable module support
60#
61CONFIG_MODULES=y
62CONFIG_MODULE_UNLOAD=y
63# CONFIG_MODULE_FORCE_UNLOAD is not set
64CONFIG_OBSOLETE_MODPARM=y
65# CONFIG_MODVERSIONS is not set
66# CONFIG_MODULE_SRCVERSION_ALL is not set
67# CONFIG_KMOD is not set
68CONFIG_STOP_MACHINE=y
69CONFIG_SYSVIPC_COMPAT=y
70
71#
72# Platform support
73#
74# CONFIG_PPC_ISERIES is not set
75CONFIG_PPC_MULTIPLATFORM=y
76# CONFIG_PPC_PSERIES is not set
77CONFIG_PPC_BPA=y
78# CONFIG_PPC_PMAC is not set
79# CONFIG_PPC_MAPLE is not set
80CONFIG_PPC=y
81CONFIG_PPC64=y
82CONFIG_PPC_OF=y
83CONFIG_BPA_IIC=y
84CONFIG_ALTIVEC=y
85CONFIG_KEXEC=y
86# CONFIG_U3_DART is not set
87# CONFIG_BOOTX_TEXT is not set
88# CONFIG_POWER4_ONLY is not set
89# CONFIG_IOMMU_VMERGE is not set
90CONFIG_SMP=y
91CONFIG_NR_CPUS=4
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_SPARSEMEM_STATIC is not set
101# CONFIG_NUMA is not set
102CONFIG_SCHED_SMT=y
103CONFIG_PREEMPT_NONE=y
104# CONFIG_PREEMPT_VOLUNTARY is not set
105# CONFIG_PREEMPT is not set
106CONFIG_PREEMPT_BKL=y
107# CONFIG_HZ_100 is not set
108CONFIG_HZ_250=y
109# CONFIG_HZ_1000 is not set
110CONFIG_HZ=250
111CONFIG_GENERIC_HARDIRQS=y
112CONFIG_PPC_RTAS=y
113CONFIG_RTAS_PROC=y
114CONFIG_RTAS_FLASH=y
115CONFIG_SECCOMP=y
116CONFIG_BINFMT_ELF=y
117# CONFIG_BINFMT_MISC is not set
118CONFIG_PROC_DEVICETREE=y
119# CONFIG_CMDLINE_BOOL is not set
120CONFIG_ISA_DMA_API=y
121
122#
123# Bus Options
124#
125CONFIG_PCI=y
126CONFIG_PCI_DOMAINS=y
127CONFIG_PCI_LEGACY_PROC=y
128# CONFIG_PCI_DEBUG is not set
129
130#
131# PCCARD (PCMCIA/CardBus) support
132#
133# CONFIG_PCCARD is not set
134
135#
136# PCI Hotplug Support
137#
138# CONFIG_HOTPLUG_PCI is not set
139
140#
141# Networking
142#
143CONFIG_NET=y
144
145#
146# Networking options
147#
148CONFIG_PACKET=y
149# CONFIG_PACKET_MMAP is not set
150CONFIG_UNIX=y
151CONFIG_XFRM=y
152# CONFIG_XFRM_USER is not set
153# CONFIG_NET_KEY is not set
154CONFIG_INET=y
155CONFIG_IP_MULTICAST=y
156# CONFIG_IP_ADVANCED_ROUTER is not set
157CONFIG_IP_FIB_HASH=y
158# CONFIG_IP_PNP is not set
159CONFIG_NET_IPIP=y
160# CONFIG_NET_IPGRE is not set
161# CONFIG_IP_MROUTE is not set
162# CONFIG_ARPD is not set
163CONFIG_SYN_COOKIES=y
164# CONFIG_INET_AH is not set
165# CONFIG_INET_ESP is not set
166# CONFIG_INET_IPCOMP is not set
167CONFIG_INET_TUNNEL=y
168CONFIG_INET_DIAG=y
169CONFIG_INET_TCP_DIAG=y
170# CONFIG_TCP_CONG_ADVANCED is not set
171CONFIG_TCP_CONG_BIC=y
172
173#
174# IP: Virtual Server Configuration
175#
176# CONFIG_IP_VS is not set
177CONFIG_IPV6=y
178# CONFIG_IPV6_PRIVACY is not set
179CONFIG_INET6_AH=m
180CONFIG_INET6_ESP=m
181CONFIG_INET6_IPCOMP=m
182CONFIG_INET6_TUNNEL=m
183CONFIG_IPV6_TUNNEL=m
184CONFIG_NETFILTER=y
185# CONFIG_NETFILTER_DEBUG is not set
186# CONFIG_NETFILTER_NETLINK is not set
187
188#
189# IP: Netfilter Configuration
190#
191CONFIG_IP_NF_CONNTRACK=y
192# CONFIG_IP_NF_CT_ACCT is not set
193# CONFIG_IP_NF_CONNTRACK_MARK is not set
194# CONFIG_IP_NF_CONNTRACK_EVENTS is not set
195CONFIG_IP_NF_CT_PROTO_SCTP=y
196CONFIG_IP_NF_FTP=m
197CONFIG_IP_NF_IRC=m
198# CONFIG_IP_NF_NETBIOS_NS is not set
199CONFIG_IP_NF_TFTP=m
200CONFIG_IP_NF_AMANDA=m
201# CONFIG_IP_NF_PPTP is not set
202CONFIG_IP_NF_QUEUE=m
203CONFIG_IP_NF_IPTABLES=m
204CONFIG_IP_NF_MATCH_LIMIT=m
205CONFIG_IP_NF_MATCH_IPRANGE=m
206CONFIG_IP_NF_MATCH_MAC=m
207CONFIG_IP_NF_MATCH_PKTTYPE=m
208CONFIG_IP_NF_MATCH_MARK=m
209CONFIG_IP_NF_MATCH_MULTIPORT=m
210CONFIG_IP_NF_MATCH_TOS=m
211CONFIG_IP_NF_MATCH_RECENT=m
212CONFIG_IP_NF_MATCH_ECN=m
213CONFIG_IP_NF_MATCH_DSCP=m
214CONFIG_IP_NF_MATCH_AH_ESP=m
215CONFIG_IP_NF_MATCH_LENGTH=m
216CONFIG_IP_NF_MATCH_TTL=m
217CONFIG_IP_NF_MATCH_TCPMSS=m
218CONFIG_IP_NF_MATCH_HELPER=m
219CONFIG_IP_NF_MATCH_STATE=m
220CONFIG_IP_NF_MATCH_CONNTRACK=m
221CONFIG_IP_NF_MATCH_OWNER=m
222CONFIG_IP_NF_MATCH_ADDRTYPE=m
223CONFIG_IP_NF_MATCH_REALM=m
224CONFIG_IP_NF_MATCH_SCTP=m
225# CONFIG_IP_NF_MATCH_DCCP is not set
226CONFIG_IP_NF_MATCH_COMMENT=m
227CONFIG_IP_NF_MATCH_HASHLIMIT=m
228CONFIG_IP_NF_MATCH_STRING=m
229CONFIG_IP_NF_FILTER=m
230CONFIG_IP_NF_TARGET_REJECT=m
231CONFIG_IP_NF_TARGET_LOG=m
232CONFIG_IP_NF_TARGET_ULOG=m
233CONFIG_IP_NF_TARGET_TCPMSS=m
234CONFIG_IP_NF_TARGET_NFQUEUE=m
235CONFIG_IP_NF_NAT=m
236CONFIG_IP_NF_NAT_NEEDED=y
237CONFIG_IP_NF_TARGET_MASQUERADE=m
238CONFIG_IP_NF_TARGET_REDIRECT=m
239CONFIG_IP_NF_TARGET_NETMAP=m
240CONFIG_IP_NF_TARGET_SAME=m
241CONFIG_IP_NF_NAT_SNMP_BASIC=m
242CONFIG_IP_NF_NAT_IRC=m
243CONFIG_IP_NF_NAT_FTP=m
244CONFIG_IP_NF_NAT_TFTP=m
245CONFIG_IP_NF_NAT_AMANDA=m
246CONFIG_IP_NF_MANGLE=m
247CONFIG_IP_NF_TARGET_TOS=m
248CONFIG_IP_NF_TARGET_ECN=m
249CONFIG_IP_NF_TARGET_DSCP=m
250CONFIG_IP_NF_TARGET_MARK=m
251CONFIG_IP_NF_TARGET_CLASSIFY=m
252CONFIG_IP_NF_TARGET_TTL=m
253CONFIG_IP_NF_RAW=m
254CONFIG_IP_NF_TARGET_NOTRACK=m
255CONFIG_IP_NF_ARPTABLES=m
256CONFIG_IP_NF_ARPFILTER=m
257CONFIG_IP_NF_ARP_MANGLE=m
258
259#
260# IPv6: Netfilter Configuration (EXPERIMENTAL)
261#
262# CONFIG_IP6_NF_QUEUE is not set
263# CONFIG_IP6_NF_IPTABLES is not set
264# CONFIG_IP6_NF_TARGET_NFQUEUE is not set
265
266#
267# DCCP Configuration (EXPERIMENTAL)
268#
269# CONFIG_IP_DCCP is not set
270
271#
272# SCTP Configuration (EXPERIMENTAL)
273#
274# CONFIG_IP_SCTP is not set
275# CONFIG_ATM is not set
276# CONFIG_BRIDGE is not set
277# CONFIG_VLAN_8021Q is not set
278# CONFIG_DECNET is not set
279# CONFIG_LLC2 is not set
280# CONFIG_IPX is not set
281# CONFIG_ATALK is not set
282# CONFIG_X25 is not set
283# CONFIG_LAPB is not set
284# CONFIG_NET_DIVERT is not set
285# CONFIG_ECONET is not set
286# CONFIG_WAN_ROUTER is not set
287# CONFIG_NET_SCHED is not set
288CONFIG_NET_CLS_ROUTE=y
289
290#
291# Network testing
292#
293# CONFIG_NET_PKTGEN is not set
294# CONFIG_HAMRADIO is not set
295# CONFIG_IRDA is not set
296# CONFIG_BT is not set
297# CONFIG_IEEE80211 is not set
298
299#
300# Device Drivers
301#
302
303#
304# Generic Driver Options
305#
306CONFIG_STANDALONE=y
307CONFIG_PREVENT_FIRMWARE_BUILD=y
308CONFIG_FW_LOADER=y
309# CONFIG_DEBUG_DRIVER is not set
310
311#
312# Connector - unified userspace <-> kernelspace linker
313#
314# CONFIG_CONNECTOR is not set
315
316#
317# Memory Technology Devices (MTD)
318#
319# CONFIG_MTD is not set
320
321#
322# Parallel port support
323#
324# CONFIG_PARPORT is not set
325
326#
327# Plug and Play support
328#
329
330#
331# Block devices
332#
333# CONFIG_BLK_DEV_FD is not set
334# CONFIG_BLK_CPQ_DA is not set
335# CONFIG_BLK_CPQ_CISS_DA is not set
336# CONFIG_BLK_DEV_DAC960 is not set
337# CONFIG_BLK_DEV_UMEM is not set
338# CONFIG_BLK_DEV_COW_COMMON is not set
339CONFIG_BLK_DEV_LOOP=y
340# CONFIG_BLK_DEV_CRYPTOLOOP is not set
341CONFIG_BLK_DEV_NBD=y
342# CONFIG_BLK_DEV_SX8 is not set
343CONFIG_BLK_DEV_RAM=y
344CONFIG_BLK_DEV_RAM_COUNT=16
345CONFIG_BLK_DEV_RAM_SIZE=131072
346CONFIG_BLK_DEV_INITRD=y
347# CONFIG_CDROM_PKTCDVD is not set
348
349#
350# IO Schedulers
351#
352CONFIG_IOSCHED_NOOP=y
353CONFIG_IOSCHED_AS=y
354CONFIG_IOSCHED_DEADLINE=y
355CONFIG_IOSCHED_CFQ=y
356# CONFIG_ATA_OVER_ETH is not set
357
358#
359# ATA/ATAPI/MFM/RLL support
360#
361CONFIG_IDE=y
362CONFIG_BLK_DEV_IDE=y
363
364#
365# Please see Documentation/ide.txt for help/info on IDE drives
366#
367# CONFIG_BLK_DEV_IDE_SATA is not set
368CONFIG_BLK_DEV_IDEDISK=y
369CONFIG_IDEDISK_MULTI_MODE=y
370# CONFIG_BLK_DEV_IDECD is not set
371# CONFIG_BLK_DEV_IDETAPE is not set
372# CONFIG_BLK_DEV_IDEFLOPPY is not set
373# CONFIG_IDE_TASK_IOCTL is not set
374
375#
376# IDE chipset support/bugfixes
377#
378CONFIG_IDE_GENERIC=y
379CONFIG_BLK_DEV_IDEPCI=y
380CONFIG_IDEPCI_SHARE_IRQ=y
381# CONFIG_BLK_DEV_OFFBOARD is not set
382CONFIG_BLK_DEV_GENERIC=y
383# CONFIG_BLK_DEV_OPTI621 is not set
384# CONFIG_BLK_DEV_SL82C105 is not set
385CONFIG_BLK_DEV_IDEDMA_PCI=y
386# CONFIG_BLK_DEV_IDEDMA_FORCED is not set
387CONFIG_IDEDMA_PCI_AUTO=y
388# CONFIG_IDEDMA_ONLYDISK is not set
389CONFIG_BLK_DEV_AEC62XX=y
390# CONFIG_BLK_DEV_ALI15X3 is not set
391# CONFIG_BLK_DEV_AMD74XX is not set
392# CONFIG_BLK_DEV_CMD64X is not set
393# CONFIG_BLK_DEV_TRIFLEX is not set
394# CONFIG_BLK_DEV_CY82C693 is not set
395# CONFIG_BLK_DEV_CS5520 is not set
396# CONFIG_BLK_DEV_CS5530 is not set
397# CONFIG_BLK_DEV_HPT34X is not set
398# CONFIG_BLK_DEV_HPT366 is not set
399# CONFIG_BLK_DEV_SC1200 is not set
400# CONFIG_BLK_DEV_PIIX is not set
401# CONFIG_BLK_DEV_IT821X is not set
402# CONFIG_BLK_DEV_NS87415 is not set
403# CONFIG_BLK_DEV_PDC202XX_OLD is not set
404# CONFIG_BLK_DEV_PDC202XX_NEW is not set
405# CONFIG_BLK_DEV_SVWKS is not set
406CONFIG_BLK_DEV_SIIMAGE=y
407# CONFIG_BLK_DEV_SLC90E66 is not set
408# CONFIG_BLK_DEV_TRM290 is not set
409# CONFIG_BLK_DEV_VIA82CXXX is not set
410# CONFIG_IDE_ARM is not set
411CONFIG_BLK_DEV_IDEDMA=y
412# CONFIG_IDEDMA_IVB is not set
413CONFIG_IDEDMA_AUTO=y
414# CONFIG_BLK_DEV_HD is not set
415
416#
417# SCSI device support
418#
419# CONFIG_RAID_ATTRS is not set
420# CONFIG_SCSI is not set
421
422#
423# Multi-device support (RAID and LVM)
424#
425# CONFIG_MD is not set
426
427#
428# Fusion MPT device support
429#
430# CONFIG_FUSION is not set
431
432#
433# IEEE 1394 (FireWire) support
434#
435# CONFIG_IEEE1394 is not set
436
437#
438# I2O device support
439#
440# CONFIG_I2O is not set
441
442#
443# Macintosh device drivers
444#
445
446#
447# Network device support
448#
449CONFIG_NETDEVICES=y
450# CONFIG_DUMMY is not set
451# CONFIG_BONDING is not set
452# CONFIG_EQUALIZER is not set
453# CONFIG_TUN is not set
454
455#
456# ARCnet devices
457#
458# CONFIG_ARCNET is not set
459
460#
461# PHY device support
462#
463# CONFIG_PHYLIB is not set
464
465#
466# Ethernet (10 or 100Mbit)
467#
468CONFIG_NET_ETHERNET=y
469CONFIG_MII=y
470# CONFIG_HAPPYMEAL is not set
471# CONFIG_SUNGEM is not set
472# CONFIG_CASSINI is not set
473# CONFIG_NET_VENDOR_3COM is not set
474
475#
476# Tulip family network device support
477#
478# CONFIG_NET_TULIP is not set
479# CONFIG_HP100 is not set
480# CONFIG_NET_PCI is not set
481
482#
483# Ethernet (1000 Mbit)
484#
485# CONFIG_ACENIC is not set
486# CONFIG_DL2K is not set
487CONFIG_E1000=m
488# CONFIG_E1000_NAPI is not set
489# CONFIG_NS83820 is not set
490# CONFIG_HAMACHI is not set
491# CONFIG_YELLOWFIN is not set
492# CONFIG_R8169 is not set
493# CONFIG_SIS190 is not set
494CONFIG_SKGE=m
495# CONFIG_SK98LIN is not set
496# CONFIG_TIGON3 is not set
497# CONFIG_BNX2 is not set
498# CONFIG_SPIDER_NET is not set
499# CONFIG_MV643XX_ETH is not set
500
501#
502# Ethernet (10000 Mbit)
503#
504# CONFIG_CHELSIO_T1 is not set
505# CONFIG_IXGB is not set
506# CONFIG_S2IO is not set
507
508#
509# Token Ring devices
510#
511# CONFIG_TR is not set
512
513#
514# Wireless LAN (non-hamradio)
515#
516# CONFIG_NET_RADIO is not set
517
518#
519# Wan interfaces
520#
521# CONFIG_WAN is not set
522# CONFIG_FDDI is not set
523# CONFIG_HIPPI is not set
524# CONFIG_PPP is not set
525# CONFIG_SLIP is not set
526# CONFIG_SHAPER is not set
527# CONFIG_NETCONSOLE is not set
528# CONFIG_NETPOLL is not set
529# CONFIG_NET_POLL_CONTROLLER is not set
530
531#
532# ISDN subsystem
533#
534# CONFIG_ISDN is not set
535
536#
537# Telephony Support
538#
539# CONFIG_PHONE is not set
540
541#
542# Input device support
543#
544CONFIG_INPUT=y
545
546#
547# Userland interfaces
548#
549CONFIG_INPUT_MOUSEDEV=y
550# CONFIG_INPUT_MOUSEDEV_PSAUX is not set
551CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024
552CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768
553# CONFIG_INPUT_JOYDEV is not set
554# CONFIG_INPUT_TSDEV is not set
555# CONFIG_INPUT_EVDEV is not set
556# CONFIG_INPUT_EVBUG is not set
557
558#
559# Input Device Drivers
560#
561# CONFIG_INPUT_KEYBOARD is not set
562# CONFIG_INPUT_MOUSE is not set
563# CONFIG_INPUT_JOYSTICK is not set
564# CONFIG_INPUT_TOUCHSCREEN is not set
565# CONFIG_INPUT_MISC is not set
566
567#
568# Hardware I/O ports
569#
570CONFIG_SERIO=y
571# CONFIG_SERIO_I8042 is not set
572CONFIG_SERIO_SERPORT=y
573# CONFIG_SERIO_PCIPS2 is not set
574# CONFIG_SERIO_RAW is not set
575# CONFIG_GAMEPORT is not set
576
577#
578# Character devices
579#
580CONFIG_VT=y
581CONFIG_VT_CONSOLE=y
582CONFIG_HW_CONSOLE=y
583CONFIG_SERIAL_NONSTANDARD=y
584# CONFIG_ROCKETPORT is not set
585# CONFIG_CYCLADES is not set
586# CONFIG_DIGIEPCA is not set
587# CONFIG_MOXA_SMARTIO is not set
588# CONFIG_ISI is not set
589# CONFIG_SYNCLINK is not set
590# CONFIG_SYNCLINKMP is not set
591# CONFIG_N_HDLC is not set
592# CONFIG_SPECIALIX is not set
593# CONFIG_SX is not set
594# CONFIG_STALDRV is not set
595
596#
597# Serial drivers
598#
599CONFIG_SERIAL_8250=y
600CONFIG_SERIAL_8250_CONSOLE=y
601CONFIG_SERIAL_8250_NR_UARTS=4
602# CONFIG_SERIAL_8250_EXTENDED is not set
603
604#
605# Non-8250 serial port support
606#
607CONFIG_SERIAL_CORE=y
608CONFIG_SERIAL_CORE_CONSOLE=y
609# CONFIG_SERIAL_JSM is not set
610CONFIG_UNIX98_PTYS=y
611# CONFIG_LEGACY_PTYS is not set
612
613#
614# IPMI
615#
616# CONFIG_IPMI_HANDLER is not set
617
618#
619# Watchdog Cards
620#
621CONFIG_WATCHDOG=y
622# CONFIG_WATCHDOG_NOWAYOUT is not set
623
624#
625# Watchdog Device Drivers
626#
627# CONFIG_SOFT_WATCHDOG is not set
628CONFIG_WATCHDOG_RTAS=y
629
630#
631# PCI-based Watchdog Cards
632#
633# CONFIG_PCIPCWATCHDOG is not set
634# CONFIG_WDTPCI is not set
635# CONFIG_RTC is not set
636# CONFIG_DTLK is not set
637# CONFIG_R3964 is not set
638# CONFIG_APPLICOM is not set
639
640#
641# Ftape, the floppy tape device driver
642#
643# CONFIG_AGP is not set
644# CONFIG_DRM is not set
645# CONFIG_RAW_DRIVER is not set
646# CONFIG_HANGCHECK_TIMER is not set
647
648#
649# TPM devices
650#
651# CONFIG_TCG_TPM is not set
652
653#
654# I2C support
655#
656CONFIG_I2C=y
657# CONFIG_I2C_CHARDEV is not set
658
659#
660# I2C Algorithms
661#
662CONFIG_I2C_ALGOBIT=y
663# CONFIG_I2C_ALGOPCF is not set
664# CONFIG_I2C_ALGOPCA is not set
665
666#
667# I2C Hardware Bus support
668#
669# CONFIG_I2C_ALI1535 is not set
670# CONFIG_I2C_ALI1563 is not set
671# CONFIG_I2C_ALI15X3 is not set
672# CONFIG_I2C_AMD756 is not set
673# CONFIG_I2C_AMD8111 is not set
674# CONFIG_I2C_I801 is not set
675# CONFIG_I2C_I810 is not set
676# CONFIG_I2C_PIIX4 is not set
677# CONFIG_I2C_NFORCE2 is not set
678# CONFIG_I2C_PARPORT_LIGHT is not set
679# CONFIG_I2C_PROSAVAGE is not set
680# CONFIG_I2C_SAVAGE4 is not set
681# CONFIG_SCx200_ACB is not set
682# CONFIG_I2C_SIS5595 is not set
683# CONFIG_I2C_SIS630 is not set
684# CONFIG_I2C_SIS96X is not set
685# CONFIG_I2C_STUB is not set
686# CONFIG_I2C_VIA is not set
687# CONFIG_I2C_VIAPRO is not set
688# CONFIG_I2C_VOODOO3 is not set
689# CONFIG_I2C_PCA_ISA is not set
690
691#
692# Miscellaneous I2C Chip support
693#
694# CONFIG_SENSORS_DS1337 is not set
695# CONFIG_SENSORS_DS1374 is not set
696# CONFIG_SENSORS_EEPROM is not set
697# CONFIG_SENSORS_PCF8574 is not set
698# CONFIG_SENSORS_PCA9539 is not set
699# CONFIG_SENSORS_PCF8591 is not set
700# CONFIG_SENSORS_RTC8564 is not set
701# CONFIG_SENSORS_MAX6875 is not set
702# CONFIG_I2C_DEBUG_CORE is not set
703# CONFIG_I2C_DEBUG_ALGO is not set
704# CONFIG_I2C_DEBUG_BUS is not set
705# CONFIG_I2C_DEBUG_CHIP is not set
706
707#
708# Dallas's 1-wire bus
709#
710# CONFIG_W1 is not set
711
712#
713# Hardware Monitoring support
714#
715# CONFIG_HWMON is not set
716# CONFIG_HWMON_VID is not set
717
718#
719# Misc devices
720#
721
722#
723# Multimedia Capabilities Port drivers
724#
725
726#
727# Multimedia devices
728#
729# CONFIG_VIDEO_DEV is not set
730
731#
732# Digital Video Broadcasting Devices
733#
734# CONFIG_DVB is not set
735
736#
737# Graphics support
738#
739# CONFIG_FB is not set
740
741#
742# Console display driver support
743#
744# CONFIG_VGA_CONSOLE is not set
745CONFIG_DUMMY_CONSOLE=y
746
747#
748# Sound
749#
750# CONFIG_SOUND is not set
751
752#
753# USB support
754#
755CONFIG_USB_ARCH_HAS_HCD=y
756CONFIG_USB_ARCH_HAS_OHCI=y
757# CONFIG_USB is not set
758
759#
760# USB Gadget Support
761#
762# CONFIG_USB_GADGET is not set
763
764#
765# MMC/SD Card support
766#
767# CONFIG_MMC is not set
768
769#
770# InfiniBand support
771#
772# CONFIG_INFINIBAND is not set
773
774#
775# SN Devices
776#
777
778#
779# File systems
780#
781CONFIG_EXT2_FS=y
782# CONFIG_EXT2_FS_XATTR is not set
783# CONFIG_EXT2_FS_XIP is not set
784CONFIG_EXT3_FS=y
785CONFIG_EXT3_FS_XATTR=y
786# CONFIG_EXT3_FS_POSIX_ACL is not set
787# CONFIG_EXT3_FS_SECURITY is not set
788CONFIG_JBD=y
789# CONFIG_JBD_DEBUG is not set
790CONFIG_FS_MBCACHE=y
791# CONFIG_REISERFS_FS is not set
792# CONFIG_JFS_FS is not set
793CONFIG_FS_POSIX_ACL=y
794# CONFIG_XFS_FS is not set
795# CONFIG_MINIX_FS is not set
796# CONFIG_ROMFS_FS is not set
797CONFIG_INOTIFY=y
798# CONFIG_QUOTA is not set
799CONFIG_DNOTIFY=y
800# CONFIG_AUTOFS_FS is not set
801# CONFIG_AUTOFS4_FS is not set
802# CONFIG_FUSE_FS is not set
803
804#
805# CD-ROM/DVD Filesystems
806#
807CONFIG_ISO9660_FS=m
808CONFIG_JOLIET=y
809# CONFIG_ZISOFS is not set
810CONFIG_UDF_FS=m
811CONFIG_UDF_NLS=y
812
813#
814# DOS/FAT/NT Filesystems
815#
816CONFIG_FAT_FS=m
817CONFIG_MSDOS_FS=m
818CONFIG_VFAT_FS=m
819CONFIG_FAT_DEFAULT_CODEPAGE=437
820CONFIG_FAT_DEFAULT_IOCHARSET="iso8859-1"
821# CONFIG_NTFS_FS is not set
822
823#
824# Pseudo filesystems
825#
826CONFIG_PROC_FS=y
827CONFIG_PROC_KCORE=y
828CONFIG_SYSFS=y
829CONFIG_TMPFS=y
830CONFIG_HUGETLBFS=y
831CONFIG_HUGETLB_PAGE=y
832CONFIG_RAMFS=y
833# CONFIG_RELAYFS_FS is not set
834
835#
836# Miscellaneous filesystems
837#
838# CONFIG_ADFS_FS is not set
839# CONFIG_AFFS_FS is not set
840# CONFIG_HFS_FS is not set
841# CONFIG_HFSPLUS_FS is not set
842# CONFIG_BEFS_FS is not set
843# CONFIG_BFS_FS is not set
844# CONFIG_EFS_FS is not set
845# CONFIG_CRAMFS is not set
846# CONFIG_VXFS_FS is not set
847# CONFIG_HPFS_FS is not set
848# CONFIG_QNX4FS_FS is not set
849# CONFIG_SYSV_FS is not set
850# CONFIG_UFS_FS is not set
851
852#
853# Network File Systems
854#
855CONFIG_NFS_FS=m
856CONFIG_NFS_V3=y
857CONFIG_NFS_V3_ACL=y
858# CONFIG_NFS_V4 is not set
859# CONFIG_NFS_DIRECTIO is not set
860CONFIG_NFSD=m
861CONFIG_NFSD_V2_ACL=y
862CONFIG_NFSD_V3=y
863CONFIG_NFSD_V3_ACL=y
864# CONFIG_NFSD_V4 is not set
865CONFIG_NFSD_TCP=y
866CONFIG_LOCKD=m
867CONFIG_LOCKD_V4=y
868CONFIG_EXPORTFS=m
869CONFIG_NFS_ACL_SUPPORT=m
870CONFIG_NFS_COMMON=y
871CONFIG_SUNRPC=m
872# CONFIG_RPCSEC_GSS_KRB5 is not set
873# CONFIG_RPCSEC_GSS_SPKM3 is not set
874# CONFIG_SMB_FS is not set
875# CONFIG_CIFS is not set
876# CONFIG_NCP_FS is not set
877# CONFIG_CODA_FS is not set
878# CONFIG_AFS_FS is not set
879# CONFIG_9P_FS is not set
880
881#
882# Partition Types
883#
884CONFIG_PARTITION_ADVANCED=y
885# CONFIG_ACORN_PARTITION is not set
886# CONFIG_OSF_PARTITION is not set
887# CONFIG_AMIGA_PARTITION is not set
888# CONFIG_ATARI_PARTITION is not set
889# CONFIG_MAC_PARTITION is not set
890CONFIG_MSDOS_PARTITION=y
891# CONFIG_BSD_DISKLABEL is not set
892# CONFIG_MINIX_SUBPARTITION is not set
893# CONFIG_SOLARIS_X86_PARTITION is not set
894# CONFIG_UNIXWARE_DISKLABEL is not set
895# CONFIG_LDM_PARTITION is not set
896# CONFIG_SGI_PARTITION is not set
897# CONFIG_ULTRIX_PARTITION is not set
898# CONFIG_SUN_PARTITION is not set
899CONFIG_EFI_PARTITION=y
900
901#
902# Native Language Support
903#
904CONFIG_NLS=m
905CONFIG_NLS_DEFAULT="iso8859-1"
906# CONFIG_NLS_CODEPAGE_437 is not set
907# CONFIG_NLS_CODEPAGE_737 is not set
908# CONFIG_NLS_CODEPAGE_775 is not set
909# CONFIG_NLS_CODEPAGE_850 is not set
910# CONFIG_NLS_CODEPAGE_852 is not set
911# CONFIG_NLS_CODEPAGE_855 is not set
912# CONFIG_NLS_CODEPAGE_857 is not set
913# CONFIG_NLS_CODEPAGE_860 is not set
914# CONFIG_NLS_CODEPAGE_861 is not set
915# CONFIG_NLS_CODEPAGE_862 is not set
916# CONFIG_NLS_CODEPAGE_863 is not set
917# CONFIG_NLS_CODEPAGE_864 is not set
918# CONFIG_NLS_CODEPAGE_865 is not set
919# CONFIG_NLS_CODEPAGE_866 is not set
920# CONFIG_NLS_CODEPAGE_869 is not set
921# CONFIG_NLS_CODEPAGE_936 is not set
922# CONFIG_NLS_CODEPAGE_950 is not set
923# CONFIG_NLS_CODEPAGE_932 is not set
924# CONFIG_NLS_CODEPAGE_949 is not set
925# CONFIG_NLS_CODEPAGE_874 is not set
926# CONFIG_NLS_ISO8859_8 is not set
927# CONFIG_NLS_CODEPAGE_1250 is not set
928# CONFIG_NLS_CODEPAGE_1251 is not set
929# CONFIG_NLS_ASCII is not set
930CONFIG_NLS_ISO8859_1=m
931CONFIG_NLS_ISO8859_2=m
932CONFIG_NLS_ISO8859_3=m
933CONFIG_NLS_ISO8859_4=m
934CONFIG_NLS_ISO8859_5=m
935CONFIG_NLS_ISO8859_6=m
936CONFIG_NLS_ISO8859_7=m
937CONFIG_NLS_ISO8859_9=m
938CONFIG_NLS_ISO8859_13=m
939CONFIG_NLS_ISO8859_14=m
940CONFIG_NLS_ISO8859_15=m
941# CONFIG_NLS_KOI8_R is not set
942# CONFIG_NLS_KOI8_U is not set
943# CONFIG_NLS_UTF8 is not set
944
945#
946# Profiling support
947#
948# CONFIG_PROFILING is not set
949
950#
951# Kernel hacking
952#
953# CONFIG_PRINTK_TIME is not set
954CONFIG_DEBUG_KERNEL=y
955CONFIG_MAGIC_SYSRQ=y
956CONFIG_LOG_BUF_SHIFT=15
957CONFIG_DETECT_SOFTLOCKUP=y
958# CONFIG_SCHEDSTATS is not set
959# CONFIG_DEBUG_SLAB is not set
960# CONFIG_DEBUG_SPINLOCK is not set
961CONFIG_DEBUG_SPINLOCK_SLEEP=y
962# CONFIG_DEBUG_KOBJECT is not set
963# CONFIG_DEBUG_INFO is not set
964CONFIG_DEBUG_FS=y
965# CONFIG_DEBUG_STACKOVERFLOW is not set
966# CONFIG_KPROBES is not set
967# CONFIG_DEBUG_STACK_USAGE is not set
968CONFIG_DEBUGGER=y
969# CONFIG_XMON is not set
970# CONFIG_PPCDBG is not set
971CONFIG_IRQSTACKS=y
972
973#
974# Security options
975#
976# CONFIG_KEYS is not set
977# CONFIG_SECURITY is not set
978
979#
980# Cryptographic options
981#
982CONFIG_CRYPTO=y
983CONFIG_CRYPTO_HMAC=y
984# CONFIG_CRYPTO_NULL is not set
985# CONFIG_CRYPTO_MD4 is not set
986CONFIG_CRYPTO_MD5=m
987CONFIG_CRYPTO_SHA1=m
988# CONFIG_CRYPTO_SHA256 is not set
989# CONFIG_CRYPTO_SHA512 is not set
990# CONFIG_CRYPTO_WP512 is not set
991# CONFIG_CRYPTO_TGR192 is not set
992CONFIG_CRYPTO_DES=m
993# CONFIG_CRYPTO_BLOWFISH is not set
994# CONFIG_CRYPTO_TWOFISH is not set
995# CONFIG_CRYPTO_SERPENT is not set
996# CONFIG_CRYPTO_AES is not set
997# CONFIG_CRYPTO_CAST5 is not set
998# CONFIG_CRYPTO_CAST6 is not set
999# CONFIG_CRYPTO_TEA is not set
1000# CONFIG_CRYPTO_ARC4 is not set
1001# CONFIG_CRYPTO_KHAZAD is not set
1002# CONFIG_CRYPTO_ANUBIS is not set
1003CONFIG_CRYPTO_DEFLATE=m
1004# CONFIG_CRYPTO_MICHAEL_MIC is not set
1005# CONFIG_CRYPTO_CRC32C is not set
1006# CONFIG_CRYPTO_TEST is not set
1007
1008#
1009# Hardware crypto devices
1010#
1011
1012#
1013# Library routines
1014#
1015# CONFIG_CRC_CCITT is not set
1016# CONFIG_CRC16 is not set
1017CONFIG_CRC32=y
1018# CONFIG_LIBCRC32C is not set
1019CONFIG_ZLIB_INFLATE=m
1020CONFIG_ZLIB_DEFLATE=m
1021CONFIG_TEXTSEARCH=y
1022CONFIG_TEXTSEARCH_KMP=m
1023CONFIG_TEXTSEARCH_BM=m
1024CONFIG_TEXTSEARCH_FSM=m
diff --git a/arch/powerpc/configs/g5_defconfig b/arch/powerpc/configs/g5_defconfig
new file mode 100644
index 000000000000..e76854f8c121
--- /dev/null
+++ b/arch/powerpc/configs/g5_defconfig
@@ -0,0 +1,1543 @@
1#
2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.14
4# Mon Nov 7 13:37:59 2005
5#
6CONFIG_PPC64=y
7CONFIG_64BIT=y
8CONFIG_PPC_MERGE=y
9CONFIG_MMU=y
10CONFIG_GENERIC_HARDIRQS=y
11CONFIG_RWSEM_XCHGADD_ALGORITHM=y
12CONFIG_GENERIC_CALIBRATE_DELAY=y
13CONFIG_PPC=y
14CONFIG_EARLY_PRINTK=y
15CONFIG_COMPAT=y
16CONFIG_SYSVIPC_COMPAT=y
17CONFIG_SCHED_NO_NO_OMIT_FRAME_POINTER=y
18CONFIG_ARCH_MAY_HAVE_PC_FDC=y
19
20#
21# Processor support
22#
23CONFIG_POWER4_ONLY=y
24CONFIG_POWER4=y
25CONFIG_PPC_FPU=y
26CONFIG_ALTIVEC=y
27CONFIG_PPC_STD_MMU=y
28CONFIG_SMP=y
29CONFIG_NR_CPUS=2
30
31#
32# Code maturity level options
33#
34CONFIG_EXPERIMENTAL=y
35CONFIG_CLEAN_COMPILE=y
36CONFIG_LOCK_KERNEL=y
37CONFIG_INIT_ENV_ARG_LIMIT=32
38
39#
40# General setup
41#
42CONFIG_LOCALVERSION=""
43CONFIG_LOCALVERSION_AUTO=y
44CONFIG_SWAP=y
45CONFIG_SYSVIPC=y
46CONFIG_POSIX_MQUEUE=y
47# CONFIG_BSD_PROCESS_ACCT is not set
48CONFIG_SYSCTL=y
49# CONFIG_AUDIT is not set
50CONFIG_HOTPLUG=y
51CONFIG_KOBJECT_UEVENT=y
52CONFIG_IKCONFIG=y
53CONFIG_IKCONFIG_PROC=y
54# CONFIG_CPUSETS is not set
55CONFIG_INITRAMFS_SOURCE=""
56# CONFIG_EMBEDDED is not set
57CONFIG_KALLSYMS=y
58# CONFIG_KALLSYMS_ALL is not set
59# CONFIG_KALLSYMS_EXTRA_PASS is not set
60CONFIG_PRINTK=y
61CONFIG_BUG=y
62CONFIG_BASE_FULL=y
63CONFIG_FUTEX=y
64CONFIG_EPOLL=y
65CONFIG_SHMEM=y
66CONFIG_CC_ALIGN_FUNCTIONS=0
67CONFIG_CC_ALIGN_LABELS=0
68CONFIG_CC_ALIGN_LOOPS=0
69CONFIG_CC_ALIGN_JUMPS=0
70# CONFIG_TINY_SHMEM is not set
71CONFIG_BASE_SMALL=0
72
73#
74# Loadable module support
75#
76CONFIG_MODULES=y
77CONFIG_MODULE_UNLOAD=y
78# CONFIG_MODULE_FORCE_UNLOAD is not set
79CONFIG_OBSOLETE_MODPARM=y
80CONFIG_MODVERSIONS=y
81CONFIG_MODULE_SRCVERSION_ALL=y
82CONFIG_KMOD=y
83CONFIG_STOP_MACHINE=y
84
85#
86# Platform support
87#
88CONFIG_PPC_MULTIPLATFORM=y
89# CONFIG_PPC_ISERIES is not set
90# CONFIG_EMBEDDED6xx is not set
91# CONFIG_APUS is not set
92# CONFIG_PPC_PSERIES is not set
93CONFIG_PPC_PMAC=y
94CONFIG_PPC_PMAC64=y
95# CONFIG_PPC_MAPLE is not set
96# CONFIG_PPC_CELL is not set
97CONFIG_PPC_OF=y
98CONFIG_U3_DART=y
99CONFIG_MPIC=y
100# CONFIG_PPC_RTAS is not set
101# CONFIG_MMIO_NVRAM is not set
102# CONFIG_PPC_MPC106 is not set
103CONFIG_GENERIC_TBSYNC=y
104CONFIG_CPU_FREQ=y
105CONFIG_CPU_FREQ_TABLE=y
106# CONFIG_CPU_FREQ_DEBUG is not set
107CONFIG_CPU_FREQ_STAT=y
108# CONFIG_CPU_FREQ_STAT_DETAILS is not set
109CONFIG_CPU_FREQ_DEFAULT_GOV_PERFORMANCE=y
110# CONFIG_CPU_FREQ_DEFAULT_GOV_USERSPACE is not set
111CONFIG_CPU_FREQ_GOV_PERFORMANCE=y
112CONFIG_CPU_FREQ_GOV_POWERSAVE=y
113CONFIG_CPU_FREQ_GOV_USERSPACE=y
114# CONFIG_CPU_FREQ_GOV_ONDEMAND is not set
115# CONFIG_CPU_FREQ_GOV_CONSERVATIVE is not set
116CONFIG_CPU_FREQ_PMAC64=y
117# CONFIG_WANT_EARLY_SERIAL is not set
118
119#
120# Kernel options
121#
122# CONFIG_HZ_100 is not set
123CONFIG_HZ_250=y
124# CONFIG_HZ_1000 is not set
125CONFIG_HZ=250
126CONFIG_PREEMPT_NONE=y
127# CONFIG_PREEMPT_VOLUNTARY is not set
128# CONFIG_PREEMPT is not set
129# CONFIG_PREEMPT_BKL is not set
130CONFIG_BINFMT_ELF=y
131# CONFIG_BINFMT_MISC is not set
132CONFIG_FORCE_MAX_ZONEORDER=13
133CONFIG_IOMMU_VMERGE=y
134# CONFIG_HOTPLUG_CPU is not set
135CONFIG_KEXEC=y
136CONFIG_IRQ_ALL_CPUS=y
137# CONFIG_NUMA is not set
138CONFIG_ARCH_SELECT_MEMORY_MODEL=y
139CONFIG_ARCH_FLATMEM_ENABLE=y
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
147CONFIG_SPLIT_PTLOCK_CPUS=4
148# CONFIG_PPC_64K_PAGES is not set
149# CONFIG_SCHED_SMT is not set
150CONFIG_PROC_DEVICETREE=y
151# CONFIG_CMDLINE_BOOL is not set
152# CONFIG_PM is not set
153CONFIG_SECCOMP=y
154CONFIG_ISA_DMA_API=y
155
156#
157# Bus options
158#
159CONFIG_GENERIC_ISA_DMA=y
160# CONFIG_PPC_I8259 is not set
161# CONFIG_PPC_INDIRECT_PCI is not set
162CONFIG_PCI=y
163CONFIG_PCI_DOMAINS=y
164CONFIG_PCI_LEGACY_PROC=y
165# CONFIG_PCI_DEBUG is not set
166
167#
168# PCCARD (PCMCIA/CardBus) support
169#
170# CONFIG_PCCARD is not set
171
172#
173# PCI Hotplug Support
174#
175# CONFIG_HOTPLUG_PCI is not set
176CONFIG_KERNEL_START=0xc000000000000000
177
178#
179# Networking
180#
181CONFIG_NET=y
182
183#
184# Networking options
185#
186CONFIG_PACKET=y
187# CONFIG_PACKET_MMAP is not set
188CONFIG_UNIX=y
189CONFIG_XFRM=y
190CONFIG_XFRM_USER=m
191CONFIG_NET_KEY=m
192CONFIG_INET=y
193CONFIG_IP_MULTICAST=y
194# CONFIG_IP_ADVANCED_ROUTER is not set
195CONFIG_IP_FIB_HASH=y
196# CONFIG_IP_PNP is not set
197CONFIG_NET_IPIP=y
198# CONFIG_NET_IPGRE is not set
199# CONFIG_IP_MROUTE is not set
200# CONFIG_ARPD is not set
201CONFIG_SYN_COOKIES=y
202CONFIG_INET_AH=m
203CONFIG_INET_ESP=m
204CONFIG_INET_IPCOMP=m
205CONFIG_INET_TUNNEL=y
206CONFIG_INET_DIAG=y
207CONFIG_INET_TCP_DIAG=y
208# CONFIG_TCP_CONG_ADVANCED is not set
209CONFIG_TCP_CONG_BIC=y
210
211#
212# IP: Virtual Server Configuration
213#
214# CONFIG_IP_VS is not set
215# CONFIG_IPV6 is not set
216CONFIG_NETFILTER=y
217# CONFIG_NETFILTER_DEBUG is not set
218# CONFIG_NETFILTER_NETLINK is not set
219
220#
221# IP: Netfilter Configuration
222#
223CONFIG_IP_NF_CONNTRACK=m
224CONFIG_IP_NF_CT_ACCT=y
225CONFIG_IP_NF_CONNTRACK_MARK=y
226CONFIG_IP_NF_CONNTRACK_EVENTS=y
227CONFIG_IP_NF_CT_PROTO_SCTP=m
228CONFIG_IP_NF_FTP=m
229CONFIG_IP_NF_IRC=m
230# CONFIG_IP_NF_NETBIOS_NS is not set
231CONFIG_IP_NF_TFTP=m
232CONFIG_IP_NF_AMANDA=m
233# CONFIG_IP_NF_PPTP is not set
234CONFIG_IP_NF_QUEUE=m
235CONFIG_IP_NF_IPTABLES=m
236CONFIG_IP_NF_MATCH_LIMIT=m
237CONFIG_IP_NF_MATCH_IPRANGE=m
238CONFIG_IP_NF_MATCH_MAC=m
239CONFIG_IP_NF_MATCH_PKTTYPE=m
240CONFIG_IP_NF_MATCH_MARK=m
241CONFIG_IP_NF_MATCH_MULTIPORT=m
242CONFIG_IP_NF_MATCH_TOS=m
243CONFIG_IP_NF_MATCH_RECENT=m
244CONFIG_IP_NF_MATCH_ECN=m
245CONFIG_IP_NF_MATCH_DSCP=m
246CONFIG_IP_NF_MATCH_AH_ESP=m
247CONFIG_IP_NF_MATCH_LENGTH=m
248CONFIG_IP_NF_MATCH_TTL=m
249CONFIG_IP_NF_MATCH_TCPMSS=m
250CONFIG_IP_NF_MATCH_HELPER=m
251CONFIG_IP_NF_MATCH_STATE=m
252CONFIG_IP_NF_MATCH_CONNTRACK=m
253CONFIG_IP_NF_MATCH_OWNER=m
254CONFIG_IP_NF_MATCH_ADDRTYPE=m
255CONFIG_IP_NF_MATCH_REALM=m
256CONFIG_IP_NF_MATCH_SCTP=m
257# CONFIG_IP_NF_MATCH_DCCP is not set
258CONFIG_IP_NF_MATCH_COMMENT=m
259CONFIG_IP_NF_MATCH_CONNMARK=m
260CONFIG_IP_NF_MATCH_CONNBYTES=m
261CONFIG_IP_NF_MATCH_HASHLIMIT=m
262CONFIG_IP_NF_MATCH_STRING=m
263CONFIG_IP_NF_FILTER=m
264CONFIG_IP_NF_TARGET_REJECT=m
265CONFIG_IP_NF_TARGET_LOG=m
266CONFIG_IP_NF_TARGET_ULOG=m
267CONFIG_IP_NF_TARGET_TCPMSS=m
268CONFIG_IP_NF_TARGET_NFQUEUE=m
269CONFIG_IP_NF_NAT=m
270CONFIG_IP_NF_NAT_NEEDED=y
271CONFIG_IP_NF_TARGET_MASQUERADE=m
272CONFIG_IP_NF_TARGET_REDIRECT=m
273CONFIG_IP_NF_TARGET_NETMAP=m
274CONFIG_IP_NF_TARGET_SAME=m
275CONFIG_IP_NF_NAT_SNMP_BASIC=m
276CONFIG_IP_NF_NAT_IRC=m
277CONFIG_IP_NF_NAT_FTP=m
278CONFIG_IP_NF_NAT_TFTP=m
279CONFIG_IP_NF_NAT_AMANDA=m
280CONFIG_IP_NF_MANGLE=m
281CONFIG_IP_NF_TARGET_TOS=m
282CONFIG_IP_NF_TARGET_ECN=m
283CONFIG_IP_NF_TARGET_DSCP=m
284CONFIG_IP_NF_TARGET_MARK=m
285CONFIG_IP_NF_TARGET_CLASSIFY=m
286CONFIG_IP_NF_TARGET_TTL=m
287CONFIG_IP_NF_TARGET_CONNMARK=m
288CONFIG_IP_NF_TARGET_CLUSTERIP=m
289CONFIG_IP_NF_RAW=m
290CONFIG_IP_NF_TARGET_NOTRACK=m
291CONFIG_IP_NF_ARPTABLES=m
292CONFIG_IP_NF_ARPFILTER=m
293CONFIG_IP_NF_ARP_MANGLE=m
294
295#
296# DCCP Configuration (EXPERIMENTAL)
297#
298# CONFIG_IP_DCCP is not set
299
300#
301# SCTP Configuration (EXPERIMENTAL)
302#
303# CONFIG_IP_SCTP is not set
304# CONFIG_ATM is not set
305# CONFIG_BRIDGE is not set
306# CONFIG_VLAN_8021Q is not set
307# CONFIG_DECNET is not set
308CONFIG_LLC=y
309# CONFIG_LLC2 is not set
310# CONFIG_IPX is not set
311# CONFIG_ATALK is not set
312# CONFIG_X25 is not set
313# CONFIG_LAPB is not set
314# CONFIG_NET_DIVERT is not set
315# CONFIG_ECONET is not set
316# CONFIG_WAN_ROUTER is not set
317
318#
319# QoS and/or fair queueing
320#
321# CONFIG_NET_SCHED is not set
322CONFIG_NET_CLS_ROUTE=y
323
324#
325# Network testing
326#
327# CONFIG_NET_PKTGEN is not set
328# CONFIG_HAMRADIO is not set
329# CONFIG_IRDA is not set
330# CONFIG_BT is not set
331# CONFIG_IEEE80211 is not set
332
333#
334# Device Drivers
335#
336
337#
338# Generic Driver Options
339#
340CONFIG_STANDALONE=y
341CONFIG_PREVENT_FIRMWARE_BUILD=y
342CONFIG_FW_LOADER=y
343# CONFIG_DEBUG_DRIVER is not set
344
345#
346# Connector - unified userspace <-> kernelspace linker
347#
348# CONFIG_CONNECTOR is not set
349
350#
351# Memory Technology Devices (MTD)
352#
353# CONFIG_MTD is not set
354
355#
356# Parallel port support
357#
358# CONFIG_PARPORT is not set
359
360#
361# Plug and Play support
362#
363
364#
365# Block devices
366#
367# CONFIG_BLK_DEV_FD is not set
368# CONFIG_BLK_CPQ_DA is not set
369# CONFIG_BLK_CPQ_CISS_DA is not set
370# CONFIG_BLK_DEV_DAC960 is not set
371# CONFIG_BLK_DEV_UMEM is not set
372# CONFIG_BLK_DEV_COW_COMMON is not set
373CONFIG_BLK_DEV_LOOP=y
374# CONFIG_BLK_DEV_CRYPTOLOOP is not set
375CONFIG_BLK_DEV_NBD=m
376# CONFIG_BLK_DEV_SX8 is not set
377# CONFIG_BLK_DEV_UB is not set
378CONFIG_BLK_DEV_RAM=y
379CONFIG_BLK_DEV_RAM_COUNT=16
380CONFIG_BLK_DEV_RAM_SIZE=65536
381CONFIG_BLK_DEV_INITRD=y
382CONFIG_CDROM_PKTCDVD=m
383CONFIG_CDROM_PKTCDVD_BUFFERS=8
384# CONFIG_CDROM_PKTCDVD_WCACHE is not set
385
386#
387# IO Schedulers
388#
389CONFIG_IOSCHED_NOOP=y
390CONFIG_IOSCHED_AS=y
391CONFIG_IOSCHED_DEADLINE=y
392CONFIG_IOSCHED_CFQ=y
393CONFIG_DEFAULT_AS=y
394# CONFIG_DEFAULT_DEADLINE is not set
395# CONFIG_DEFAULT_CFQ is not set
396# CONFIG_DEFAULT_NOOP is not set
397CONFIG_DEFAULT_IOSCHED="anticipatory"
398# CONFIG_ATA_OVER_ETH is not set
399
400#
401# ATA/ATAPI/MFM/RLL support
402#
403CONFIG_IDE=y
404CONFIG_BLK_DEV_IDE=y
405
406#
407# Please see Documentation/ide.txt for help/info on IDE drives
408#
409# CONFIG_BLK_DEV_IDE_SATA is not set
410CONFIG_BLK_DEV_IDEDISK=y
411# CONFIG_IDEDISK_MULTI_MODE is not set
412CONFIG_BLK_DEV_IDECD=y
413# CONFIG_BLK_DEV_IDETAPE is not set
414# CONFIG_BLK_DEV_IDEFLOPPY is not set
415# CONFIG_BLK_DEV_IDESCSI is not set
416# CONFIG_IDE_TASK_IOCTL is not set
417
418#
419# IDE chipset support/bugfixes
420#
421CONFIG_IDE_GENERIC=y
422CONFIG_BLK_DEV_IDEPCI=y
423# CONFIG_IDEPCI_SHARE_IRQ is not set
424# CONFIG_BLK_DEV_OFFBOARD is not set
425# CONFIG_BLK_DEV_GENERIC is not set
426# CONFIG_BLK_DEV_OPTI621 is not set
427# CONFIG_BLK_DEV_SL82C105 is not set
428CONFIG_BLK_DEV_IDEDMA_PCI=y
429# CONFIG_BLK_DEV_IDEDMA_FORCED is not set
430CONFIG_IDEDMA_PCI_AUTO=y
431# CONFIG_IDEDMA_ONLYDISK is not set
432# CONFIG_BLK_DEV_AEC62XX is not set
433# CONFIG_BLK_DEV_ALI15X3 is not set
434# CONFIG_BLK_DEV_AMD74XX is not set
435# CONFIG_BLK_DEV_CMD64X is not set
436# CONFIG_BLK_DEV_TRIFLEX is not set
437# CONFIG_BLK_DEV_CY82C693 is not set
438# CONFIG_BLK_DEV_CS5520 is not set
439# CONFIG_BLK_DEV_CS5530 is not set
440# CONFIG_BLK_DEV_HPT34X is not set
441# CONFIG_BLK_DEV_HPT366 is not set
442# CONFIG_BLK_DEV_SC1200 is not set
443# CONFIG_BLK_DEV_PIIX is not set
444# CONFIG_BLK_DEV_IT821X is not set
445# CONFIG_BLK_DEV_NS87415 is not set
446# CONFIG_BLK_DEV_PDC202XX_OLD is not set
447# CONFIG_BLK_DEV_PDC202XX_NEW is not set
448# CONFIG_BLK_DEV_SVWKS is not set
449# CONFIG_BLK_DEV_SIIMAGE is not set
450# CONFIG_BLK_DEV_SLC90E66 is not set
451# CONFIG_BLK_DEV_TRM290 is not set
452# CONFIG_BLK_DEV_VIA82CXXX is not set
453CONFIG_BLK_DEV_IDE_PMAC=y
454CONFIG_BLK_DEV_IDE_PMAC_ATA100FIRST=y
455CONFIG_BLK_DEV_IDEDMA_PMAC=y
456# CONFIG_BLK_DEV_IDE_PMAC_BLINK is not set
457# CONFIG_IDE_ARM is not set
458CONFIG_BLK_DEV_IDEDMA=y
459# CONFIG_IDEDMA_IVB is not set
460CONFIG_IDEDMA_AUTO=y
461# CONFIG_BLK_DEV_HD is not set
462
463#
464# SCSI device support
465#
466# CONFIG_RAID_ATTRS is not set
467CONFIG_SCSI=y
468CONFIG_SCSI_PROC_FS=y
469
470#
471# SCSI support type (disk, tape, CD-ROM)
472#
473CONFIG_BLK_DEV_SD=y
474CONFIG_CHR_DEV_ST=y
475# CONFIG_CHR_DEV_OSST is not set
476CONFIG_BLK_DEV_SR=y
477CONFIG_BLK_DEV_SR_VENDOR=y
478CONFIG_CHR_DEV_SG=y
479# CONFIG_CHR_DEV_SCH is not set
480
481#
482# Some SCSI devices (e.g. CD jukebox) support multiple LUNs
483#
484CONFIG_SCSI_MULTI_LUN=y
485CONFIG_SCSI_CONSTANTS=y
486# CONFIG_SCSI_LOGGING is not set
487
488#
489# SCSI Transport Attributes
490#
491CONFIG_SCSI_SPI_ATTRS=y
492# CONFIG_SCSI_FC_ATTRS is not set
493# CONFIG_SCSI_ISCSI_ATTRS is not set
494# CONFIG_SCSI_SAS_ATTRS is not set
495
496#
497# SCSI low-level drivers
498#
499# CONFIG_ISCSI_TCP is not set
500# CONFIG_BLK_DEV_3W_XXXX_RAID is not set
501# CONFIG_SCSI_3W_9XXX is not set
502# CONFIG_SCSI_ACARD is not set
503# CONFIG_SCSI_AACRAID is not set
504# CONFIG_SCSI_AIC7XXX is not set
505# CONFIG_SCSI_AIC7XXX_OLD is not set
506# CONFIG_SCSI_AIC79XX is not set
507# CONFIG_MEGARAID_NEWGEN is not set
508# CONFIG_MEGARAID_LEGACY is not set
509# CONFIG_MEGARAID_SAS is not set
510CONFIG_SCSI_SATA=y
511# CONFIG_SCSI_SATA_AHCI is not set
512CONFIG_SCSI_SATA_SVW=y
513# CONFIG_SCSI_ATA_PIIX is not set
514# CONFIG_SCSI_SATA_MV is not set
515# CONFIG_SCSI_SATA_NV is not set
516# CONFIG_SCSI_PDC_ADMA is not set
517# CONFIG_SCSI_SATA_QSTOR is not set
518# CONFIG_SCSI_SATA_PROMISE is not set
519# CONFIG_SCSI_SATA_SX4 is not set
520# CONFIG_SCSI_SATA_SIL is not set
521# CONFIG_SCSI_SATA_SIL24 is not set
522# CONFIG_SCSI_SATA_SIS is not set
523# CONFIG_SCSI_SATA_ULI is not set
524# CONFIG_SCSI_SATA_VIA is not set
525# CONFIG_SCSI_SATA_VITESSE is not set
526# CONFIG_SCSI_BUSLOGIC is not set
527# CONFIG_SCSI_DMX3191D is not set
528# CONFIG_SCSI_EATA is not set
529# CONFIG_SCSI_FUTURE_DOMAIN is not set
530# CONFIG_SCSI_GDTH is not set
531# CONFIG_SCSI_IPS is not set
532# CONFIG_SCSI_INITIO is not set
533# CONFIG_SCSI_INIA100 is not set
534# CONFIG_SCSI_SYM53C8XX_2 is not set
535# CONFIG_SCSI_IPR is not set
536# CONFIG_SCSI_QLOGIC_FC is not set
537# CONFIG_SCSI_QLOGIC_1280 is not set
538CONFIG_SCSI_QLA2XXX=y
539# CONFIG_SCSI_QLA21XX is not set
540# CONFIG_SCSI_QLA22XX is not set
541# CONFIG_SCSI_QLA2300 is not set
542# CONFIG_SCSI_QLA2322 is not set
543# CONFIG_SCSI_QLA6312 is not set
544# CONFIG_SCSI_QLA24XX is not set
545# CONFIG_SCSI_LPFC is not set
546# CONFIG_SCSI_DC395x is not set
547# CONFIG_SCSI_DC390T is not set
548# CONFIG_SCSI_DEBUG is not set
549
550#
551# Multi-device support (RAID and LVM)
552#
553CONFIG_MD=y
554CONFIG_BLK_DEV_MD=y
555CONFIG_MD_LINEAR=y
556CONFIG_MD_RAID0=y
557CONFIG_MD_RAID1=y
558CONFIG_MD_RAID10=m
559CONFIG_MD_RAID5=y
560CONFIG_MD_RAID6=m
561CONFIG_MD_MULTIPATH=m
562CONFIG_MD_FAULTY=m
563CONFIG_BLK_DEV_DM=y
564CONFIG_DM_CRYPT=m
565CONFIG_DM_SNAPSHOT=m
566CONFIG_DM_MIRROR=m
567CONFIG_DM_ZERO=m
568# CONFIG_DM_MULTIPATH is not set
569
570#
571# Fusion MPT device support
572#
573# CONFIG_FUSION is not set
574# CONFIG_FUSION_SPI is not set
575# CONFIG_FUSION_FC is not set
576# CONFIG_FUSION_SAS is not set
577
578#
579# IEEE 1394 (FireWire) support
580#
581CONFIG_IEEE1394=y
582
583#
584# Subsystem Options
585#
586# CONFIG_IEEE1394_VERBOSEDEBUG is not set
587CONFIG_IEEE1394_OUI_DB=y
588CONFIG_IEEE1394_EXTRA_CONFIG_ROMS=y
589CONFIG_IEEE1394_CONFIG_ROM_IP1394=y
590# CONFIG_IEEE1394_EXPORT_FULL_API is not set
591
592#
593# Device Drivers
594#
595# CONFIG_IEEE1394_PCILYNX is not set
596CONFIG_IEEE1394_OHCI1394=y
597
598#
599# Protocol Drivers
600#
601CONFIG_IEEE1394_VIDEO1394=m
602CONFIG_IEEE1394_SBP2=m
603# CONFIG_IEEE1394_SBP2_PHYS_DMA is not set
604CONFIG_IEEE1394_ETH1394=m
605CONFIG_IEEE1394_DV1394=m
606CONFIG_IEEE1394_RAWIO=y
607# CONFIG_IEEE1394_CMP is not set
608
609#
610# I2O device support
611#
612# CONFIG_I2O is not set
613
614#
615# Macintosh device drivers
616#
617CONFIG_ADB_PMU=y
618CONFIG_PMAC_SMU=y
619CONFIG_THERM_PM72=y
620CONFIG_WINDFARM=y
621CONFIG_WINDFARM_PM81=y
622CONFIG_WINDFARM_PM91=y
623
624#
625# Network device support
626#
627CONFIG_NETDEVICES=y
628CONFIG_DUMMY=m
629CONFIG_BONDING=m
630# CONFIG_EQUALIZER is not set
631CONFIG_TUN=m
632
633#
634# ARCnet devices
635#
636# CONFIG_ARCNET is not set
637
638#
639# PHY device support
640#
641# CONFIG_PHYLIB is not set
642
643#
644# Ethernet (10 or 100Mbit)
645#
646CONFIG_NET_ETHERNET=y
647CONFIG_MII=y
648# CONFIG_HAPPYMEAL is not set
649CONFIG_SUNGEM=y
650# CONFIG_CASSINI is not set
651# CONFIG_NET_VENDOR_3COM is not set
652
653#
654# Tulip family network device support
655#
656# CONFIG_NET_TULIP is not set
657# CONFIG_HP100 is not set
658# CONFIG_NET_PCI is not set
659# CONFIG_FEC_8XX is not set
660
661#
662# Ethernet (1000 Mbit)
663#
664CONFIG_ACENIC=y
665CONFIG_ACENIC_OMIT_TIGON_I=y
666# CONFIG_DL2K is not set
667CONFIG_E1000=y
668# CONFIG_E1000_NAPI is not set
669# CONFIG_NS83820 is not set
670# CONFIG_HAMACHI is not set
671# CONFIG_YELLOWFIN is not set
672# CONFIG_R8169 is not set
673# CONFIG_SIS190 is not set
674# CONFIG_SKGE is not set
675# CONFIG_SK98LIN is not set
676CONFIG_TIGON3=m
677# CONFIG_BNX2 is not set
678# CONFIG_MV643XX_ETH is not set
679
680#
681# Ethernet (10000 Mbit)
682#
683# CONFIG_CHELSIO_T1 is not set
684# CONFIG_IXGB is not set
685# CONFIG_S2IO is not set
686
687#
688# Token Ring devices
689#
690CONFIG_TR=y
691CONFIG_IBMOL=y
692# CONFIG_3C359 is not set
693# CONFIG_TMS380TR is not set
694
695#
696# Wireless LAN (non-hamradio)
697#
698# CONFIG_NET_RADIO is not set
699
700#
701# Wan interfaces
702#
703# CONFIG_WAN is not set
704# CONFIG_FDDI is not set
705# CONFIG_HIPPI is not set
706CONFIG_PPP=m
707# CONFIG_PPP_MULTILINK is not set
708# CONFIG_PPP_FILTER is not set
709CONFIG_PPP_ASYNC=m
710CONFIG_PPP_SYNC_TTY=m
711CONFIG_PPP_DEFLATE=m
712CONFIG_PPP_BSDCOMP=m
713CONFIG_PPPOE=m
714# CONFIG_SLIP is not set
715# CONFIG_NET_FC is not set
716# CONFIG_SHAPER is not set
717# CONFIG_NETCONSOLE is not set
718# CONFIG_NETPOLL is not set
719# CONFIG_NET_POLL_CONTROLLER is not set
720
721#
722# ISDN subsystem
723#
724# CONFIG_ISDN is not set
725
726#
727# Telephony Support
728#
729# CONFIG_PHONE is not set
730
731#
732# Input device support
733#
734CONFIG_INPUT=y
735
736#
737# Userland interfaces
738#
739CONFIG_INPUT_MOUSEDEV=y
740# CONFIG_INPUT_MOUSEDEV_PSAUX is not set
741CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024
742CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768
743CONFIG_INPUT_JOYDEV=m
744# CONFIG_INPUT_TSDEV is not set
745CONFIG_INPUT_EVDEV=y
746# CONFIG_INPUT_EVBUG is not set
747
748#
749# Input Device Drivers
750#
751CONFIG_INPUT_KEYBOARD=y
752# CONFIG_KEYBOARD_ATKBD is not set
753# CONFIG_KEYBOARD_SUNKBD is not set
754# CONFIG_KEYBOARD_LKKBD is not set
755# CONFIG_KEYBOARD_XTKBD is not set
756# CONFIG_KEYBOARD_NEWTON is not set
757CONFIG_INPUT_MOUSE=y
758# CONFIG_MOUSE_PS2 is not set
759# CONFIG_MOUSE_SERIAL is not set
760# CONFIG_MOUSE_VSXXXAA is not set
761# CONFIG_INPUT_JOYSTICK is not set
762# CONFIG_INPUT_TOUCHSCREEN is not set
763# CONFIG_INPUT_MISC is not set
764
765#
766# Hardware I/O ports
767#
768CONFIG_SERIO=y
769# CONFIG_SERIO_I8042 is not set
770# CONFIG_SERIO_SERPORT is not set
771# CONFIG_SERIO_PCIPS2 is not set
772# CONFIG_SERIO_RAW is not set
773# CONFIG_GAMEPORT is not set
774
775#
776# Character devices
777#
778CONFIG_VT=y
779CONFIG_VT_CONSOLE=y
780CONFIG_HW_CONSOLE=y
781# CONFIG_SERIAL_NONSTANDARD is not set
782
783#
784# Serial drivers
785#
786# CONFIG_SERIAL_8250 is not set
787
788#
789# Non-8250 serial port support
790#
791# CONFIG_SERIAL_PMACZILOG is not set
792# CONFIG_SERIAL_JSM is not set
793CONFIG_UNIX98_PTYS=y
794CONFIG_LEGACY_PTYS=y
795CONFIG_LEGACY_PTY_COUNT=256
796
797#
798# IPMI
799#
800# CONFIG_IPMI_HANDLER is not set
801
802#
803# Watchdog Cards
804#
805# CONFIG_WATCHDOG is not set
806# CONFIG_RTC is not set
807# CONFIG_DTLK is not set
808# CONFIG_R3964 is not set
809# CONFIG_APPLICOM is not set
810
811#
812# Ftape, the floppy tape device driver
813#
814CONFIG_AGP=m
815CONFIG_AGP_UNINORTH=m
816# CONFIG_DRM is not set
817CONFIG_RAW_DRIVER=y
818CONFIG_MAX_RAW_DEVS=256
819# CONFIG_HANGCHECK_TIMER is not set
820
821#
822# TPM devices
823#
824# CONFIG_TCG_TPM is not set
825# CONFIG_TELCLOCK is not set
826
827#
828# I2C support
829#
830CONFIG_I2C=y
831CONFIG_I2C_CHARDEV=y
832
833#
834# I2C Algorithms
835#
836CONFIG_I2C_ALGOBIT=y
837# CONFIG_I2C_ALGOPCF is not set
838# CONFIG_I2C_ALGOPCA is not set
839
840#
841# I2C Hardware Bus support
842#
843# CONFIG_I2C_ALI1535 is not set
844# CONFIG_I2C_ALI1563 is not set
845# CONFIG_I2C_ALI15X3 is not set
846# CONFIG_I2C_AMD756 is not set
847# CONFIG_I2C_AMD8111 is not set
848# CONFIG_I2C_I801 is not set
849# CONFIG_I2C_I810 is not set
850# CONFIG_I2C_PIIX4 is not set
851CONFIG_I2C_KEYWEST=y
852CONFIG_I2C_PMAC_SMU=y
853# CONFIG_I2C_NFORCE2 is not set
854# CONFIG_I2C_PARPORT_LIGHT is not set
855# CONFIG_I2C_PROSAVAGE is not set
856# CONFIG_I2C_SAVAGE4 is not set
857# CONFIG_SCx200_ACB is not set
858# CONFIG_I2C_SIS5595 is not set
859# CONFIG_I2C_SIS630 is not set
860# CONFIG_I2C_SIS96X is not set
861# CONFIG_I2C_STUB is not set
862# CONFIG_I2C_VIA is not set
863# CONFIG_I2C_VIAPRO is not set
864# CONFIG_I2C_VOODOO3 is not set
865# CONFIG_I2C_PCA_ISA is not set
866
867#
868# Miscellaneous I2C Chip support
869#
870# CONFIG_SENSORS_DS1337 is not set
871# CONFIG_SENSORS_DS1374 is not set
872# CONFIG_SENSORS_EEPROM is not set
873# CONFIG_SENSORS_PCF8574 is not set
874# CONFIG_SENSORS_PCA9539 is not set
875# CONFIG_SENSORS_PCF8591 is not set
876# CONFIG_SENSORS_RTC8564 is not set
877# CONFIG_SENSORS_MAX6875 is not set
878# CONFIG_RTC_X1205_I2C is not set
879# CONFIG_I2C_DEBUG_CORE is not set
880# CONFIG_I2C_DEBUG_ALGO is not set
881# CONFIG_I2C_DEBUG_BUS is not set
882# CONFIG_I2C_DEBUG_CHIP is not set
883
884#
885# Dallas's 1-wire bus
886#
887# CONFIG_W1 is not set
888
889#
890# Hardware Monitoring support
891#
892# CONFIG_HWMON is not set
893# CONFIG_HWMON_VID is not set
894
895#
896# Misc devices
897#
898
899#
900# Multimedia Capabilities Port drivers
901#
902
903#
904# Multimedia devices
905#
906# CONFIG_VIDEO_DEV is not set
907
908#
909# Digital Video Broadcasting Devices
910#
911# CONFIG_DVB is not set
912
913#
914# Graphics support
915#
916CONFIG_FB=y
917CONFIG_FB_CFB_FILLRECT=y
918CONFIG_FB_CFB_COPYAREA=y
919CONFIG_FB_CFB_IMAGEBLIT=y
920CONFIG_FB_SOFT_CURSOR=y
921CONFIG_FB_MACMODES=y
922CONFIG_FB_MODE_HELPERS=y
923CONFIG_FB_TILEBLITTING=y
924# CONFIG_FB_CIRRUS is not set
925# CONFIG_FB_PM2 is not set
926# CONFIG_FB_CYBER2000 is not set
927CONFIG_FB_OF=y
928# CONFIG_FB_CONTROL is not set
929# CONFIG_FB_PLATINUM is not set
930# CONFIG_FB_VALKYRIE is not set
931# CONFIG_FB_CT65550 is not set
932# CONFIG_FB_ASILIANT is not set
933# CONFIG_FB_IMSTT is not set
934# CONFIG_FB_VGA16 is not set
935CONFIG_FB_NVIDIA=y
936CONFIG_FB_NVIDIA_I2C=y
937# CONFIG_FB_RIVA is not set
938# CONFIG_FB_MATROX is not set
939# CONFIG_FB_RADEON_OLD is not set
940CONFIG_FB_RADEON=y
941CONFIG_FB_RADEON_I2C=y
942# CONFIG_FB_RADEON_DEBUG is not set
943# CONFIG_FB_ATY128 is not set
944# CONFIG_FB_ATY is not set
945# CONFIG_FB_SAVAGE is not set
946# CONFIG_FB_SIS is not set
947# CONFIG_FB_NEOMAGIC is not set
948# CONFIG_FB_KYRO is not set
949# CONFIG_FB_3DFX is not set
950# CONFIG_FB_VOODOO1 is not set
951# CONFIG_FB_CYBLA is not set
952# CONFIG_FB_TRIDENT is not set
953# CONFIG_FB_S1D13XXX is not set
954# CONFIG_FB_VIRTUAL is not set
955
956#
957# Console display driver support
958#
959# CONFIG_VGA_CONSOLE is not set
960CONFIG_DUMMY_CONSOLE=y
961CONFIG_FRAMEBUFFER_CONSOLE=y
962# CONFIG_FONTS is not set
963CONFIG_FONT_8x8=y
964CONFIG_FONT_8x16=y
965
966#
967# Logo configuration
968#
969CONFIG_LOGO=y
970CONFIG_LOGO_LINUX_MONO=y
971CONFIG_LOGO_LINUX_VGA16=y
972CONFIG_LOGO_LINUX_CLUT224=y
973CONFIG_BACKLIGHT_LCD_SUPPORT=y
974CONFIG_BACKLIGHT_CLASS_DEVICE=m
975CONFIG_BACKLIGHT_DEVICE=y
976CONFIG_LCD_CLASS_DEVICE=m
977CONFIG_LCD_DEVICE=y
978
979#
980# Sound
981#
982CONFIG_SOUND=m
983
984#
985# Advanced Linux Sound Architecture
986#
987CONFIG_SND=m
988CONFIG_SND_TIMER=m
989CONFIG_SND_PCM=m
990CONFIG_SND_HWDEP=m
991CONFIG_SND_RAWMIDI=m
992CONFIG_SND_SEQUENCER=m
993# CONFIG_SND_SEQ_DUMMY is not set
994CONFIG_SND_OSSEMUL=y
995CONFIG_SND_MIXER_OSS=m
996CONFIG_SND_PCM_OSS=m
997CONFIG_SND_SEQUENCER_OSS=y
998# CONFIG_SND_VERBOSE_PRINTK is not set
999# CONFIG_SND_DEBUG is not set
1000CONFIG_SND_GENERIC_DRIVER=y
1001
1002#
1003# Generic devices
1004#
1005# CONFIG_SND_DUMMY is not set
1006# CONFIG_SND_VIRMIDI is not set
1007# CONFIG_SND_MTPAV is not set
1008# CONFIG_SND_SERIAL_U16550 is not set
1009# CONFIG_SND_MPU401 is not set
1010
1011#
1012# PCI devices
1013#
1014# CONFIG_SND_ALI5451 is not set
1015# CONFIG_SND_ATIIXP is not set
1016# CONFIG_SND_ATIIXP_MODEM is not set
1017# CONFIG_SND_AU8810 is not set
1018# CONFIG_SND_AU8820 is not set
1019# CONFIG_SND_AU8830 is not set
1020# CONFIG_SND_AZT3328 is not set
1021# CONFIG_SND_BT87X is not set
1022# CONFIG_SND_CS46XX is not set
1023# CONFIG_SND_CS4281 is not set
1024# CONFIG_SND_EMU10K1 is not set
1025# CONFIG_SND_EMU10K1X is not set
1026# CONFIG_SND_CA0106 is not set
1027# CONFIG_SND_KORG1212 is not set
1028# CONFIG_SND_MIXART is not set
1029# CONFIG_SND_NM256 is not set
1030# CONFIG_SND_RME32 is not set
1031# CONFIG_SND_RME96 is not set
1032# CONFIG_SND_RME9652 is not set
1033# CONFIG_SND_HDSP is not set
1034# CONFIG_SND_HDSPM is not set
1035# CONFIG_SND_TRIDENT is not set
1036# CONFIG_SND_YMFPCI is not set
1037# CONFIG_SND_AD1889 is not set
1038# CONFIG_SND_ALS4000 is not set
1039# CONFIG_SND_CMIPCI is not set
1040# CONFIG_SND_ENS1370 is not set
1041# CONFIG_SND_ENS1371 is not set
1042# CONFIG_SND_ES1938 is not set
1043# CONFIG_SND_ES1968 is not set
1044# CONFIG_SND_MAESTRO3 is not set
1045# CONFIG_SND_FM801 is not set
1046# CONFIG_SND_ICE1712 is not set
1047# CONFIG_SND_ICE1724 is not set
1048# CONFIG_SND_INTEL8X0 is not set
1049# CONFIG_SND_INTEL8X0M is not set
1050# CONFIG_SND_SONICVIBES is not set
1051# CONFIG_SND_VIA82XX is not set
1052# CONFIG_SND_VIA82XX_MODEM is not set
1053# CONFIG_SND_VX222 is not set
1054# CONFIG_SND_HDA_INTEL is not set
1055
1056#
1057# ALSA PowerMac devices
1058#
1059CONFIG_SND_POWERMAC=m
1060CONFIG_SND_POWERMAC_AUTO_DRC=y
1061
1062#
1063# USB devices
1064#
1065CONFIG_SND_USB_AUDIO=m
1066# CONFIG_SND_USB_USX2Y is not set
1067
1068#
1069# Open Sound System
1070#
1071# CONFIG_SOUND_PRIME is not set
1072
1073#
1074# USB support
1075#
1076CONFIG_USB_ARCH_HAS_HCD=y
1077CONFIG_USB_ARCH_HAS_OHCI=y
1078CONFIG_USB=y
1079# CONFIG_USB_DEBUG is not set
1080
1081#
1082# Miscellaneous USB options
1083#
1084CONFIG_USB_DEVICEFS=y
1085# CONFIG_USB_BANDWIDTH is not set
1086# CONFIG_USB_DYNAMIC_MINORS is not set
1087# CONFIG_USB_OTG is not set
1088
1089#
1090# USB Host Controller Drivers
1091#
1092CONFIG_USB_EHCI_HCD=y
1093# CONFIG_USB_EHCI_SPLIT_ISO is not set
1094# CONFIG_USB_EHCI_ROOT_HUB_TT is not set
1095# CONFIG_USB_ISP116X_HCD is not set
1096CONFIG_USB_OHCI_HCD=y
1097# CONFIG_USB_OHCI_BIG_ENDIAN is not set
1098CONFIG_USB_OHCI_LITTLE_ENDIAN=y
1099# CONFIG_USB_UHCI_HCD is not set
1100# CONFIG_USB_SL811_HCD is not set
1101
1102#
1103# USB Device Class drivers
1104#
1105# CONFIG_OBSOLETE_OSS_USB_DRIVER is not set
1106CONFIG_USB_ACM=m
1107CONFIG_USB_PRINTER=y
1108
1109#
1110# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support'
1111#
1112
1113#
1114# may also be needed; see USB_STORAGE Help for more information
1115#
1116CONFIG_USB_STORAGE=y
1117# CONFIG_USB_STORAGE_DEBUG is not set
1118CONFIG_USB_STORAGE_DATAFAB=y
1119CONFIG_USB_STORAGE_FREECOM=y
1120CONFIG_USB_STORAGE_ISD200=y
1121CONFIG_USB_STORAGE_DPCM=y
1122# CONFIG_USB_STORAGE_USBAT is not set
1123CONFIG_USB_STORAGE_SDDR09=y
1124CONFIG_USB_STORAGE_SDDR55=y
1125CONFIG_USB_STORAGE_JUMPSHOT=y
1126# CONFIG_USB_STORAGE_ONETOUCH is not set
1127
1128#
1129# USB Input Devices
1130#
1131CONFIG_USB_HID=y
1132CONFIG_USB_HIDINPUT=y
1133CONFIG_HID_FF=y
1134CONFIG_HID_PID=y
1135CONFIG_LOGITECH_FF=y
1136CONFIG_THRUSTMASTER_FF=y
1137CONFIG_USB_HIDDEV=y
1138# CONFIG_USB_AIPTEK is not set
1139# CONFIG_USB_WACOM is not set
1140# CONFIG_USB_ACECAD is not set
1141# CONFIG_USB_KBTAB is not set
1142# CONFIG_USB_POWERMATE is not set
1143# CONFIG_USB_MTOUCH is not set
1144# CONFIG_USB_ITMTOUCH is not set
1145# CONFIG_USB_EGALAX is not set
1146# CONFIG_USB_YEALINK is not set
1147# CONFIG_USB_XPAD is not set
1148# CONFIG_USB_ATI_REMOTE is not set
1149# CONFIG_USB_KEYSPAN_REMOTE is not set
1150# CONFIG_USB_APPLETOUCH is not set
1151
1152#
1153# USB Imaging devices
1154#
1155# CONFIG_USB_MDC800 is not set
1156# CONFIG_USB_MICROTEK is not set
1157
1158#
1159# USB Multimedia devices
1160#
1161# CONFIG_USB_DABUSB is not set
1162
1163#
1164# Video4Linux support is needed for USB Multimedia device support
1165#
1166
1167#
1168# USB Network Adapters
1169#
1170CONFIG_USB_CATC=m
1171CONFIG_USB_KAWETH=m
1172CONFIG_USB_PEGASUS=m
1173CONFIG_USB_RTL8150=m
1174CONFIG_USB_USBNET=m
1175# CONFIG_USB_NET_AX8817X is not set
1176CONFIG_USB_NET_CDCETHER=m
1177# CONFIG_USB_NET_GL620A is not set
1178# CONFIG_USB_NET_NET1080 is not set
1179# CONFIG_USB_NET_PLUSB is not set
1180# CONFIG_USB_NET_RNDIS_HOST is not set
1181# CONFIG_USB_NET_CDC_SUBSET is not set
1182# CONFIG_USB_NET_ZAURUS is not set
1183CONFIG_USB_MON=y
1184
1185#
1186# USB port drivers
1187#
1188
1189#
1190# USB Serial Converter support
1191#
1192CONFIG_USB_SERIAL=m
1193CONFIG_USB_SERIAL_GENERIC=y
1194# CONFIG_USB_SERIAL_AIRPRIME is not set
1195CONFIG_USB_SERIAL_BELKIN=m
1196CONFIG_USB_SERIAL_DIGI_ACCELEPORT=m
1197# CONFIG_USB_SERIAL_CP2101 is not set
1198CONFIG_USB_SERIAL_CYPRESS_M8=m
1199CONFIG_USB_SERIAL_EMPEG=m
1200CONFIG_USB_SERIAL_FTDI_SIO=m
1201CONFIG_USB_SERIAL_VISOR=m
1202CONFIG_USB_SERIAL_IPAQ=m
1203CONFIG_USB_SERIAL_IR=m
1204CONFIG_USB_SERIAL_EDGEPORT=m
1205CONFIG_USB_SERIAL_EDGEPORT_TI=m
1206CONFIG_USB_SERIAL_GARMIN=m
1207CONFIG_USB_SERIAL_IPW=m
1208CONFIG_USB_SERIAL_KEYSPAN_PDA=m
1209CONFIG_USB_SERIAL_KEYSPAN=m
1210CONFIG_USB_SERIAL_KEYSPAN_MPR=y
1211CONFIG_USB_SERIAL_KEYSPAN_USA28=y
1212CONFIG_USB_SERIAL_KEYSPAN_USA28X=y
1213CONFIG_USB_SERIAL_KEYSPAN_USA28XA=y
1214CONFIG_USB_SERIAL_KEYSPAN_USA28XB=y
1215CONFIG_USB_SERIAL_KEYSPAN_USA19=y
1216CONFIG_USB_SERIAL_KEYSPAN_USA18X=y
1217CONFIG_USB_SERIAL_KEYSPAN_USA19W=y
1218CONFIG_USB_SERIAL_KEYSPAN_USA19QW=y
1219CONFIG_USB_SERIAL_KEYSPAN_USA19QI=y
1220CONFIG_USB_SERIAL_KEYSPAN_USA49W=y
1221CONFIG_USB_SERIAL_KEYSPAN_USA49WLC=y
1222CONFIG_USB_SERIAL_KLSI=m
1223CONFIG_USB_SERIAL_KOBIL_SCT=m
1224CONFIG_USB_SERIAL_MCT_U232=m
1225# CONFIG_USB_SERIAL_NOKIA_DKU2 is not set
1226CONFIG_USB_SERIAL_PL2303=m
1227# CONFIG_USB_SERIAL_HP4X is not set
1228CONFIG_USB_SERIAL_SAFE=m
1229CONFIG_USB_SERIAL_SAFE_PADDED=y
1230CONFIG_USB_SERIAL_TI=m
1231CONFIG_USB_SERIAL_CYBERJACK=m
1232CONFIG_USB_SERIAL_XIRCOM=m
1233CONFIG_USB_SERIAL_OMNINET=m
1234CONFIG_USB_EZUSB=y
1235
1236#
1237# USB Miscellaneous drivers
1238#
1239# CONFIG_USB_EMI62 is not set
1240# CONFIG_USB_EMI26 is not set
1241# CONFIG_USB_AUERSWALD is not set
1242# CONFIG_USB_RIO500 is not set
1243# CONFIG_USB_LEGOTOWER is not set
1244# CONFIG_USB_LCD is not set
1245# CONFIG_USB_LED is not set
1246# CONFIG_USB_CYTHERM is not set
1247# CONFIG_USB_PHIDGETKIT is not set
1248# CONFIG_USB_PHIDGETSERVO is not set
1249# CONFIG_USB_IDMOUSE is not set
1250# CONFIG_USB_SISUSBVGA is not set
1251# CONFIG_USB_LD is not set
1252# CONFIG_USB_TEST is not set
1253
1254#
1255# USB DSL modem support
1256#
1257
1258#
1259# USB Gadget Support
1260#
1261# CONFIG_USB_GADGET is not set
1262
1263#
1264# MMC/SD Card support
1265#
1266# CONFIG_MMC is not set
1267
1268#
1269# InfiniBand support
1270#
1271# CONFIG_INFINIBAND is not set
1272
1273#
1274# SN Devices
1275#
1276
1277#
1278# File systems
1279#
1280CONFIG_EXT2_FS=y
1281CONFIG_EXT2_FS_XATTR=y
1282CONFIG_EXT2_FS_POSIX_ACL=y
1283CONFIG_EXT2_FS_SECURITY=y
1284CONFIG_EXT2_FS_XIP=y
1285CONFIG_FS_XIP=y
1286CONFIG_EXT3_FS=y
1287CONFIG_EXT3_FS_XATTR=y
1288CONFIG_EXT3_FS_POSIX_ACL=y
1289CONFIG_EXT3_FS_SECURITY=y
1290CONFIG_JBD=y
1291# CONFIG_JBD_DEBUG is not set
1292CONFIG_FS_MBCACHE=y
1293CONFIG_REISERFS_FS=y
1294# CONFIG_REISERFS_CHECK is not set
1295# CONFIG_REISERFS_PROC_INFO is not set
1296CONFIG_REISERFS_FS_XATTR=y
1297CONFIG_REISERFS_FS_POSIX_ACL=y
1298CONFIG_REISERFS_FS_SECURITY=y
1299# CONFIG_JFS_FS is not set
1300CONFIG_FS_POSIX_ACL=y
1301CONFIG_XFS_FS=m
1302CONFIG_XFS_EXPORT=y
1303# CONFIG_XFS_QUOTA is not set
1304CONFIG_XFS_SECURITY=y
1305CONFIG_XFS_POSIX_ACL=y
1306# CONFIG_XFS_RT is not set
1307# CONFIG_MINIX_FS is not set
1308# CONFIG_ROMFS_FS is not set
1309CONFIG_INOTIFY=y
1310# CONFIG_QUOTA is not set
1311CONFIG_DNOTIFY=y
1312CONFIG_AUTOFS_FS=m
1313# CONFIG_AUTOFS4_FS is not set
1314# CONFIG_FUSE_FS is not set
1315
1316#
1317# CD-ROM/DVD Filesystems
1318#
1319CONFIG_ISO9660_FS=y
1320CONFIG_JOLIET=y
1321CONFIG_ZISOFS=y
1322CONFIG_ZISOFS_FS=y
1323CONFIG_UDF_FS=m
1324CONFIG_UDF_NLS=y
1325
1326#
1327# DOS/FAT/NT Filesystems
1328#
1329CONFIG_FAT_FS=y
1330CONFIG_MSDOS_FS=y
1331CONFIG_VFAT_FS=y
1332CONFIG_FAT_DEFAULT_CODEPAGE=437
1333CONFIG_FAT_DEFAULT_IOCHARSET="iso8859-1"
1334# CONFIG_NTFS_FS is not set
1335
1336#
1337# Pseudo filesystems
1338#
1339CONFIG_PROC_FS=y
1340CONFIG_PROC_KCORE=y
1341CONFIG_SYSFS=y
1342CONFIG_TMPFS=y
1343CONFIG_HUGETLBFS=y
1344CONFIG_HUGETLB_PAGE=y
1345CONFIG_RAMFS=y
1346# CONFIG_RELAYFS_FS is not set
1347
1348#
1349# Miscellaneous filesystems
1350#
1351# CONFIG_ADFS_FS is not set
1352# CONFIG_AFFS_FS is not set
1353CONFIG_HFS_FS=m
1354CONFIG_HFSPLUS_FS=m
1355# CONFIG_BEFS_FS is not set
1356# CONFIG_BFS_FS is not set
1357# CONFIG_EFS_FS is not set
1358CONFIG_CRAMFS=y
1359# CONFIG_VXFS_FS is not set
1360# CONFIG_HPFS_FS is not set
1361# CONFIG_QNX4FS_FS is not set
1362# CONFIG_SYSV_FS is not set
1363# CONFIG_UFS_FS is not set
1364
1365#
1366# Network File Systems
1367#
1368CONFIG_NFS_FS=y
1369CONFIG_NFS_V3=y
1370CONFIG_NFS_V3_ACL=y
1371CONFIG_NFS_V4=y
1372# CONFIG_NFS_DIRECTIO is not set
1373CONFIG_NFSD=y
1374CONFIG_NFSD_V2_ACL=y
1375CONFIG_NFSD_V3=y
1376CONFIG_NFSD_V3_ACL=y
1377CONFIG_NFSD_V4=y
1378CONFIG_NFSD_TCP=y
1379CONFIG_LOCKD=y
1380CONFIG_LOCKD_V4=y
1381CONFIG_EXPORTFS=y
1382CONFIG_NFS_ACL_SUPPORT=y
1383CONFIG_NFS_COMMON=y
1384CONFIG_SUNRPC=y
1385CONFIG_SUNRPC_GSS=y
1386CONFIG_RPCSEC_GSS_KRB5=y
1387# CONFIG_RPCSEC_GSS_SPKM3 is not set
1388# CONFIG_SMB_FS is not set
1389CONFIG_CIFS=m
1390# CONFIG_CIFS_STATS is not set
1391# CONFIG_CIFS_XATTR is not set
1392# CONFIG_CIFS_EXPERIMENTAL is not set
1393# CONFIG_NCP_FS is not set
1394# CONFIG_CODA_FS is not set
1395# CONFIG_AFS_FS is not set
1396# CONFIG_9P_FS is not set
1397
1398#
1399# Partition Types
1400#
1401CONFIG_PARTITION_ADVANCED=y
1402# CONFIG_ACORN_PARTITION is not set
1403# CONFIG_OSF_PARTITION is not set
1404# CONFIG_AMIGA_PARTITION is not set
1405# CONFIG_ATARI_PARTITION is not set
1406CONFIG_MAC_PARTITION=y
1407CONFIG_MSDOS_PARTITION=y
1408# CONFIG_BSD_DISKLABEL is not set
1409# CONFIG_MINIX_SUBPARTITION is not set
1410# CONFIG_SOLARIS_X86_PARTITION is not set
1411# CONFIG_UNIXWARE_DISKLABEL is not set
1412# CONFIG_LDM_PARTITION is not set
1413# CONFIG_SGI_PARTITION is not set
1414# CONFIG_ULTRIX_PARTITION is not set
1415# CONFIG_SUN_PARTITION is not set
1416# CONFIG_EFI_PARTITION is not set
1417
1418#
1419# Native Language Support
1420#
1421CONFIG_NLS=y
1422CONFIG_NLS_DEFAULT="iso8859-1"
1423CONFIG_NLS_CODEPAGE_437=y
1424# CONFIG_NLS_CODEPAGE_737 is not set
1425# CONFIG_NLS_CODEPAGE_775 is not set
1426# CONFIG_NLS_CODEPAGE_850 is not set
1427# CONFIG_NLS_CODEPAGE_852 is not set
1428# CONFIG_NLS_CODEPAGE_855 is not set
1429# CONFIG_NLS_CODEPAGE_857 is not set
1430# CONFIG_NLS_CODEPAGE_860 is not set
1431# CONFIG_NLS_CODEPAGE_861 is not set
1432# CONFIG_NLS_CODEPAGE_862 is not set
1433# CONFIG_NLS_CODEPAGE_863 is not set
1434# CONFIG_NLS_CODEPAGE_864 is not set
1435# CONFIG_NLS_CODEPAGE_865 is not set
1436# CONFIG_NLS_CODEPAGE_866 is not set
1437# CONFIG_NLS_CODEPAGE_869 is not set
1438# CONFIG_NLS_CODEPAGE_936 is not set
1439# CONFIG_NLS_CODEPAGE_950 is not set
1440# CONFIG_NLS_CODEPAGE_932 is not set
1441# CONFIG_NLS_CODEPAGE_949 is not set
1442# CONFIG_NLS_CODEPAGE_874 is not set
1443# CONFIG_NLS_ISO8859_8 is not set
1444CONFIG_NLS_CODEPAGE_1250=y
1445CONFIG_NLS_CODEPAGE_1251=y
1446CONFIG_NLS_ASCII=y
1447CONFIG_NLS_ISO8859_1=y
1448# CONFIG_NLS_ISO8859_2 is not set
1449# CONFIG_NLS_ISO8859_3 is not set
1450# CONFIG_NLS_ISO8859_4 is not set
1451# CONFIG_NLS_ISO8859_5 is not set
1452# CONFIG_NLS_ISO8859_6 is not set
1453# CONFIG_NLS_ISO8859_7 is not set
1454# CONFIG_NLS_ISO8859_9 is not set
1455# CONFIG_NLS_ISO8859_13 is not set
1456# CONFIG_NLS_ISO8859_14 is not set
1457CONFIG_NLS_ISO8859_15=y
1458# CONFIG_NLS_KOI8_R is not set
1459# CONFIG_NLS_KOI8_U is not set
1460CONFIG_NLS_UTF8=y
1461
1462#
1463# Library routines
1464#
1465CONFIG_CRC_CCITT=m
1466# CONFIG_CRC16 is not set
1467CONFIG_CRC32=y
1468CONFIG_LIBCRC32C=m
1469CONFIG_ZLIB_INFLATE=y
1470CONFIG_ZLIB_DEFLATE=m
1471CONFIG_TEXTSEARCH=y
1472CONFIG_TEXTSEARCH_KMP=m
1473CONFIG_TEXTSEARCH_BM=m
1474CONFIG_TEXTSEARCH_FSM=m
1475
1476#
1477# Profiling support
1478#
1479CONFIG_PROFILING=y
1480CONFIG_OPROFILE=y
1481
1482#
1483# Kernel hacking
1484#
1485# CONFIG_PRINTK_TIME is not set
1486CONFIG_DEBUG_KERNEL=y
1487CONFIG_MAGIC_SYSRQ=y
1488CONFIG_LOG_BUF_SHIFT=17
1489CONFIG_DETECT_SOFTLOCKUP=y
1490# CONFIG_SCHEDSTATS is not set
1491# CONFIG_DEBUG_SLAB is not set
1492# CONFIG_DEBUG_SPINLOCK is not set
1493# CONFIG_DEBUG_SPINLOCK_SLEEP is not set
1494# CONFIG_DEBUG_KOBJECT is not set
1495# CONFIG_DEBUG_INFO is not set
1496CONFIG_DEBUG_FS=y
1497# CONFIG_DEBUG_VM is not set
1498# CONFIG_RCU_TORTURE_TEST is not set
1499# CONFIG_DEBUG_STACKOVERFLOW is not set
1500# CONFIG_KPROBES is not set
1501# CONFIG_DEBUG_STACK_USAGE is not set
1502# CONFIG_DEBUGGER is not set
1503CONFIG_IRQSTACKS=y
1504CONFIG_BOOTX_TEXT=y
1505
1506#
1507# Security options
1508#
1509# CONFIG_KEYS is not set
1510# CONFIG_SECURITY is not set
1511
1512#
1513# Cryptographic options
1514#
1515CONFIG_CRYPTO=y
1516CONFIG_CRYPTO_HMAC=y
1517CONFIG_CRYPTO_NULL=m
1518CONFIG_CRYPTO_MD4=m
1519CONFIG_CRYPTO_MD5=y
1520CONFIG_CRYPTO_SHA1=m
1521CONFIG_CRYPTO_SHA256=m
1522CONFIG_CRYPTO_SHA512=m
1523CONFIG_CRYPTO_WP512=m
1524# CONFIG_CRYPTO_TGR192 is not set
1525CONFIG_CRYPTO_DES=y
1526CONFIG_CRYPTO_BLOWFISH=m
1527CONFIG_CRYPTO_TWOFISH=m
1528CONFIG_CRYPTO_SERPENT=m
1529CONFIG_CRYPTO_AES=m
1530CONFIG_CRYPTO_CAST5=m
1531CONFIG_CRYPTO_CAST6=m
1532CONFIG_CRYPTO_TEA=m
1533CONFIG_CRYPTO_ARC4=m
1534CONFIG_CRYPTO_KHAZAD=m
1535CONFIG_CRYPTO_ANUBIS=m
1536CONFIG_CRYPTO_DEFLATE=m
1537CONFIG_CRYPTO_MICHAEL_MIC=m
1538CONFIG_CRYPTO_CRC32C=m
1539CONFIG_CRYPTO_TEST=m
1540
1541#
1542# Hardware crypto devices
1543#
diff --git a/arch/powerpc/configs/iseries_defconfig b/arch/powerpc/configs/iseries_defconfig
new file mode 100644
index 000000000000..62e92c7e9e27
--- /dev/null
+++ b/arch/powerpc/configs/iseries_defconfig
@@ -0,0 +1,998 @@
1#
2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.14-rc4
4# Thu Oct 20 08:30:56 2005
5#
6CONFIG_64BIT=y
7CONFIG_MMU=y
8CONFIG_RWSEM_XCHGADD_ALGORITHM=y
9CONFIG_GENERIC_CALIBRATE_DELAY=y
10CONFIG_GENERIC_ISA_DMA=y
11CONFIG_EARLY_PRINTK=y
12CONFIG_COMPAT=y
13CONFIG_SCHED_NO_NO_OMIT_FRAME_POINTER=y
14CONFIG_ARCH_MAY_HAVE_PC_FDC=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_LOCALVERSION_AUTO=y
30CONFIG_SWAP=y
31CONFIG_SYSVIPC=y
32CONFIG_POSIX_MQUEUE=y
33# CONFIG_BSD_PROCESS_ACCT is not set
34CONFIG_SYSCTL=y
35CONFIG_AUDIT=y
36CONFIG_AUDITSYSCALL=y
37CONFIG_HOTPLUG=y
38CONFIG_KOBJECT_UEVENT=y
39CONFIG_IKCONFIG=y
40CONFIG_IKCONFIG_PROC=y
41# CONFIG_CPUSETS is not set
42CONFIG_INITRAMFS_SOURCE=""
43# CONFIG_EMBEDDED is not set
44CONFIG_KALLSYMS=y
45# CONFIG_KALLSYMS_ALL is not set
46# CONFIG_KALLSYMS_EXTRA_PASS is not set
47CONFIG_PRINTK=y
48CONFIG_BUG=y
49CONFIG_BASE_FULL=y
50CONFIG_FUTEX=y
51CONFIG_EPOLL=y
52CONFIG_SHMEM=y
53CONFIG_CC_ALIGN_FUNCTIONS=0
54CONFIG_CC_ALIGN_LABELS=0
55CONFIG_CC_ALIGN_LOOPS=0
56CONFIG_CC_ALIGN_JUMPS=0
57# CONFIG_TINY_SHMEM is not set
58CONFIG_BASE_SMALL=0
59
60#
61# Loadable module support
62#
63CONFIG_MODULES=y
64CONFIG_MODULE_UNLOAD=y
65# CONFIG_MODULE_FORCE_UNLOAD is not set
66CONFIG_OBSOLETE_MODPARM=y
67CONFIG_MODVERSIONS=y
68CONFIG_MODULE_SRCVERSION_ALL=y
69CONFIG_KMOD=y
70CONFIG_STOP_MACHINE=y
71CONFIG_SYSVIPC_COMPAT=y
72
73#
74# Platform support
75#
76CONFIG_PPC_ISERIES=y
77# CONFIG_PPC_MULTIPLATFORM is not set
78CONFIG_PPC=y
79CONFIG_PPC64=y
80CONFIG_IBMVIO=y
81# CONFIG_POWER4_ONLY is not set
82CONFIG_IOMMU_VMERGE=y
83CONFIG_SMP=y
84CONFIG_NR_CPUS=32
85CONFIG_ARCH_SELECT_MEMORY_MODEL=y
86CONFIG_ARCH_FLATMEM_ENABLE=y
87CONFIG_SELECT_MEMORY_MODEL=y
88CONFIG_FLATMEM_MANUAL=y
89# CONFIG_DISCONTIGMEM_MANUAL is not set
90# CONFIG_SPARSEMEM_MANUAL is not set
91CONFIG_FLATMEM=y
92CONFIG_FLAT_NODE_MEM_MAP=y
93# CONFIG_SPARSEMEM_STATIC is not set
94# CONFIG_NUMA is not set
95# CONFIG_SCHED_SMT is not set
96CONFIG_PREEMPT_NONE=y
97# CONFIG_PREEMPT_VOLUNTARY is not set
98# CONFIG_PREEMPT is not set
99# CONFIG_PREEMPT_BKL is not set
100# CONFIG_HZ_100 is not set
101CONFIG_HZ_250=y
102# CONFIG_HZ_1000 is not set
103CONFIG_HZ=250
104CONFIG_GENERIC_HARDIRQS=y
105CONFIG_LPARCFG=y
106CONFIG_SECCOMP=y
107CONFIG_BINFMT_ELF=y
108# CONFIG_BINFMT_MISC is not set
109CONFIG_ISA_DMA_API=y
110
111#
112# Bus Options
113#
114CONFIG_PCI=y
115CONFIG_PCI_DOMAINS=y
116CONFIG_PCI_LEGACY_PROC=y
117# CONFIG_PCI_DEBUG is not set
118
119#
120# PCCARD (PCMCIA/CardBus) support
121#
122# CONFIG_PCCARD is not set
123
124#
125# PCI Hotplug Support
126#
127# CONFIG_HOTPLUG_PCI is not set
128
129#
130# Networking
131#
132CONFIG_NET=y
133
134#
135# Networking options
136#
137CONFIG_PACKET=y
138# CONFIG_PACKET_MMAP is not set
139CONFIG_UNIX=y
140CONFIG_XFRM=y
141CONFIG_XFRM_USER=m
142CONFIG_NET_KEY=m
143CONFIG_INET=y
144CONFIG_IP_MULTICAST=y
145# CONFIG_IP_ADVANCED_ROUTER is not set
146CONFIG_IP_FIB_HASH=y
147# CONFIG_IP_PNP is not set
148CONFIG_NET_IPIP=y
149# CONFIG_NET_IPGRE is not set
150# CONFIG_IP_MROUTE is not set
151# CONFIG_ARPD is not set
152CONFIG_SYN_COOKIES=y
153CONFIG_INET_AH=m
154CONFIG_INET_ESP=m
155CONFIG_INET_IPCOMP=m
156CONFIG_INET_TUNNEL=y
157CONFIG_INET_DIAG=y
158CONFIG_INET_TCP_DIAG=y
159# CONFIG_TCP_CONG_ADVANCED is not set
160CONFIG_TCP_CONG_BIC=y
161
162#
163# IP: Virtual Server Configuration
164#
165# CONFIG_IP_VS is not set
166# CONFIG_IPV6 is not set
167CONFIG_NETFILTER=y
168# CONFIG_NETFILTER_DEBUG is not set
169# CONFIG_NETFILTER_NETLINK is not set
170
171#
172# IP: Netfilter Configuration
173#
174CONFIG_IP_NF_CONNTRACK=m
175CONFIG_IP_NF_CT_ACCT=y
176CONFIG_IP_NF_CONNTRACK_MARK=y
177CONFIG_IP_NF_CONNTRACK_EVENTS=y
178CONFIG_IP_NF_CT_PROTO_SCTP=m
179CONFIG_IP_NF_FTP=m
180CONFIG_IP_NF_IRC=m
181# CONFIG_IP_NF_NETBIOS_NS is not set
182CONFIG_IP_NF_TFTP=m
183CONFIG_IP_NF_AMANDA=m
184# CONFIG_IP_NF_PPTP is not set
185CONFIG_IP_NF_QUEUE=m
186CONFIG_IP_NF_IPTABLES=m
187CONFIG_IP_NF_MATCH_LIMIT=m
188CONFIG_IP_NF_MATCH_IPRANGE=m
189CONFIG_IP_NF_MATCH_MAC=m
190CONFIG_IP_NF_MATCH_PKTTYPE=m
191CONFIG_IP_NF_MATCH_MARK=m
192CONFIG_IP_NF_MATCH_MULTIPORT=m
193CONFIG_IP_NF_MATCH_TOS=m
194CONFIG_IP_NF_MATCH_RECENT=m
195CONFIG_IP_NF_MATCH_ECN=m
196CONFIG_IP_NF_MATCH_DSCP=m
197CONFIG_IP_NF_MATCH_AH_ESP=m
198CONFIG_IP_NF_MATCH_LENGTH=m
199CONFIG_IP_NF_MATCH_TTL=m
200CONFIG_IP_NF_MATCH_TCPMSS=m
201CONFIG_IP_NF_MATCH_HELPER=m
202CONFIG_IP_NF_MATCH_STATE=m
203CONFIG_IP_NF_MATCH_CONNTRACK=m
204CONFIG_IP_NF_MATCH_OWNER=m
205CONFIG_IP_NF_MATCH_ADDRTYPE=m
206CONFIG_IP_NF_MATCH_REALM=m
207CONFIG_IP_NF_MATCH_SCTP=m
208# CONFIG_IP_NF_MATCH_DCCP is not set
209CONFIG_IP_NF_MATCH_COMMENT=m
210CONFIG_IP_NF_MATCH_CONNMARK=m
211CONFIG_IP_NF_MATCH_CONNBYTES=m
212CONFIG_IP_NF_MATCH_HASHLIMIT=m
213CONFIG_IP_NF_MATCH_STRING=m
214CONFIG_IP_NF_FILTER=m
215CONFIG_IP_NF_TARGET_REJECT=m
216CONFIG_IP_NF_TARGET_LOG=m
217CONFIG_IP_NF_TARGET_ULOG=m
218CONFIG_IP_NF_TARGET_TCPMSS=m
219CONFIG_IP_NF_TARGET_NFQUEUE=m
220CONFIG_IP_NF_NAT=m
221CONFIG_IP_NF_NAT_NEEDED=y
222CONFIG_IP_NF_TARGET_MASQUERADE=m
223CONFIG_IP_NF_TARGET_REDIRECT=m
224CONFIG_IP_NF_TARGET_NETMAP=m
225CONFIG_IP_NF_TARGET_SAME=m
226CONFIG_IP_NF_NAT_SNMP_BASIC=m
227CONFIG_IP_NF_NAT_IRC=m
228CONFIG_IP_NF_NAT_FTP=m
229CONFIG_IP_NF_NAT_TFTP=m
230CONFIG_IP_NF_NAT_AMANDA=m
231CONFIG_IP_NF_MANGLE=m
232CONFIG_IP_NF_TARGET_TOS=m
233CONFIG_IP_NF_TARGET_ECN=m
234CONFIG_IP_NF_TARGET_DSCP=m
235CONFIG_IP_NF_TARGET_MARK=m
236CONFIG_IP_NF_TARGET_CLASSIFY=m
237CONFIG_IP_NF_TARGET_TTL=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# DCCP Configuration (EXPERIMENTAL)
248#
249# CONFIG_IP_DCCP is not set
250
251#
252# SCTP Configuration (EXPERIMENTAL)
253#
254# CONFIG_IP_SCTP is not set
255# CONFIG_ATM is not set
256# CONFIG_BRIDGE is not set
257# CONFIG_VLAN_8021Q is not set
258# CONFIG_DECNET is not set
259CONFIG_LLC=y
260# CONFIG_LLC2 is not set
261# CONFIG_IPX is not set
262# CONFIG_ATALK is not set
263# CONFIG_X25 is not set
264# CONFIG_LAPB is not set
265# CONFIG_NET_DIVERT is not set
266# CONFIG_ECONET is not set
267# CONFIG_WAN_ROUTER is not set
268# CONFIG_NET_SCHED is not set
269CONFIG_NET_CLS_ROUTE=y
270
271#
272# Network testing
273#
274# CONFIG_NET_PKTGEN is not set
275# CONFIG_HAMRADIO is not set
276# CONFIG_IRDA is not set
277# CONFIG_BT is not set
278# CONFIG_IEEE80211 is not set
279
280#
281# Device Drivers
282#
283
284#
285# Generic Driver Options
286#
287CONFIG_STANDALONE=y
288CONFIG_PREVENT_FIRMWARE_BUILD=y
289CONFIG_FW_LOADER=m
290# CONFIG_DEBUG_DRIVER is not set
291
292#
293# Connector - unified userspace <-> kernelspace linker
294#
295# CONFIG_CONNECTOR is not set
296
297#
298# Memory Technology Devices (MTD)
299#
300# CONFIG_MTD is not set
301
302#
303# Parallel port support
304#
305# CONFIG_PARPORT is not set
306
307#
308# Plug and Play support
309#
310
311#
312# Block devices
313#
314# CONFIG_BLK_DEV_FD is not set
315# CONFIG_BLK_CPQ_DA is not set
316# CONFIG_BLK_CPQ_CISS_DA is not set
317# CONFIG_BLK_DEV_DAC960 is not set
318# CONFIG_BLK_DEV_UMEM is not set
319# CONFIG_BLK_DEV_COW_COMMON is not set
320CONFIG_BLK_DEV_LOOP=y
321# CONFIG_BLK_DEV_CRYPTOLOOP is not set
322CONFIG_BLK_DEV_NBD=m
323# CONFIG_BLK_DEV_SX8 is not set
324CONFIG_BLK_DEV_RAM=y
325CONFIG_BLK_DEV_RAM_COUNT=16
326CONFIG_BLK_DEV_RAM_SIZE=65536
327CONFIG_BLK_DEV_INITRD=y
328# CONFIG_CDROM_PKTCDVD is not set
329
330#
331# IO Schedulers
332#
333CONFIG_IOSCHED_NOOP=y
334CONFIG_IOSCHED_AS=y
335CONFIG_IOSCHED_DEADLINE=y
336CONFIG_IOSCHED_CFQ=y
337# CONFIG_ATA_OVER_ETH is not set
338
339#
340# ATA/ATAPI/MFM/RLL support
341#
342# CONFIG_IDE is not set
343
344#
345# SCSI device support
346#
347# CONFIG_RAID_ATTRS is not set
348CONFIG_SCSI=y
349CONFIG_SCSI_PROC_FS=y
350
351#
352# SCSI support type (disk, tape, CD-ROM)
353#
354CONFIG_BLK_DEV_SD=y
355CONFIG_CHR_DEV_ST=y
356# CONFIG_CHR_DEV_OSST is not set
357CONFIG_BLK_DEV_SR=y
358CONFIG_BLK_DEV_SR_VENDOR=y
359CONFIG_CHR_DEV_SG=y
360# CONFIG_CHR_DEV_SCH is not set
361
362#
363# Some SCSI devices (e.g. CD jukebox) support multiple LUNs
364#
365CONFIG_SCSI_MULTI_LUN=y
366CONFIG_SCSI_CONSTANTS=y
367# CONFIG_SCSI_LOGGING is not set
368
369#
370# SCSI Transport Attributes
371#
372CONFIG_SCSI_SPI_ATTRS=y
373CONFIG_SCSI_FC_ATTRS=y
374# CONFIG_SCSI_ISCSI_ATTRS is not set
375# CONFIG_SCSI_SAS_ATTRS is not set
376
377#
378# SCSI low-level drivers
379#
380# CONFIG_BLK_DEV_3W_XXXX_RAID is not set
381# CONFIG_SCSI_3W_9XXX is not set
382# CONFIG_SCSI_ACARD is not set
383# CONFIG_SCSI_AACRAID is not set
384# CONFIG_SCSI_AIC7XXX is not set
385# CONFIG_SCSI_AIC7XXX_OLD is not set
386# CONFIG_SCSI_AIC79XX is not set
387# CONFIG_MEGARAID_NEWGEN is not set
388# CONFIG_MEGARAID_LEGACY is not set
389# CONFIG_MEGARAID_SAS is not set
390# CONFIG_SCSI_SATA is not set
391# CONFIG_SCSI_BUSLOGIC is not set
392# CONFIG_SCSI_DMX3191D is not set
393# CONFIG_SCSI_EATA is not set
394# CONFIG_SCSI_FUTURE_DOMAIN is not set
395# CONFIG_SCSI_GDTH is not set
396# CONFIG_SCSI_IPS is not set
397CONFIG_SCSI_IBMVSCSI=m
398# CONFIG_SCSI_INITIO is not set
399# CONFIG_SCSI_INIA100 is not set
400# CONFIG_SCSI_SYM53C8XX_2 is not set
401# CONFIG_SCSI_IPR is not set
402# CONFIG_SCSI_QLOGIC_FC is not set
403# CONFIG_SCSI_QLOGIC_1280 is not set
404CONFIG_SCSI_QLA2XXX=y
405# CONFIG_SCSI_QLA21XX is not set
406# CONFIG_SCSI_QLA22XX is not set
407# CONFIG_SCSI_QLA2300 is not set
408# CONFIG_SCSI_QLA2322 is not set
409# CONFIG_SCSI_QLA6312 is not set
410# CONFIG_SCSI_QLA24XX is not set
411# CONFIG_SCSI_LPFC is not set
412# CONFIG_SCSI_DC395x is not set
413# CONFIG_SCSI_DC390T is not set
414# CONFIG_SCSI_DEBUG is not set
415
416#
417# Multi-device support (RAID and LVM)
418#
419CONFIG_MD=y
420CONFIG_BLK_DEV_MD=y
421CONFIG_MD_LINEAR=y
422CONFIG_MD_RAID0=y
423CONFIG_MD_RAID1=y
424CONFIG_MD_RAID10=m
425CONFIG_MD_RAID5=y
426CONFIG_MD_RAID6=m
427CONFIG_MD_MULTIPATH=m
428CONFIG_MD_FAULTY=m
429CONFIG_BLK_DEV_DM=y
430CONFIG_DM_CRYPT=m
431CONFIG_DM_SNAPSHOT=m
432CONFIG_DM_MIRROR=m
433CONFIG_DM_ZERO=m
434# CONFIG_DM_MULTIPATH is not set
435
436#
437# Fusion MPT device support
438#
439# CONFIG_FUSION is not set
440# CONFIG_FUSION_SPI is not set
441# CONFIG_FUSION_FC is not set
442# CONFIG_FUSION_SAS is not set
443
444#
445# IEEE 1394 (FireWire) support
446#
447# CONFIG_IEEE1394 is not set
448
449#
450# I2O device support
451#
452# CONFIG_I2O is not set
453
454#
455# Macintosh device drivers
456#
457
458#
459# Network device support
460#
461CONFIG_NETDEVICES=y
462CONFIG_DUMMY=m
463CONFIG_BONDING=m
464# CONFIG_EQUALIZER is not set
465CONFIG_TUN=m
466
467#
468# ARCnet devices
469#
470# CONFIG_ARCNET is not set
471
472#
473# PHY device support
474#
475# CONFIG_PHYLIB is not set
476
477#
478# Ethernet (10 or 100Mbit)
479#
480CONFIG_NET_ETHERNET=y
481CONFIG_MII=y
482# CONFIG_HAPPYMEAL is not set
483# CONFIG_SUNGEM is not set
484# CONFIG_CASSINI is not set
485# CONFIG_NET_VENDOR_3COM is not set
486
487#
488# Tulip family network device support
489#
490# CONFIG_NET_TULIP is not set
491# CONFIG_HP100 is not set
492CONFIG_NET_PCI=y
493CONFIG_PCNET32=y
494# CONFIG_AMD8111_ETH is not set
495# CONFIG_ADAPTEC_STARFIRE is not set
496# CONFIG_B44 is not set
497# CONFIG_FORCEDETH is not set
498# CONFIG_DGRS is not set
499# CONFIG_EEPRO100 is not set
500CONFIG_E100=y
501# CONFIG_FEALNX is not set
502# CONFIG_NATSEMI is not set
503# CONFIG_NE2K_PCI is not set
504# CONFIG_8139CP is not set
505# CONFIG_8139TOO is not set
506# CONFIG_SIS900 is not set
507# CONFIG_EPIC100 is not set
508# CONFIG_SUNDANCE is not set
509# CONFIG_VIA_RHINE is not set
510
511#
512# Ethernet (1000 Mbit)
513#
514CONFIG_ACENIC=m
515# CONFIG_ACENIC_OMIT_TIGON_I is not set
516# CONFIG_DL2K is not set
517CONFIG_E1000=m
518# CONFIG_E1000_NAPI is not set
519# CONFIG_NS83820 is not set
520# CONFIG_HAMACHI is not set
521# CONFIG_YELLOWFIN is not set
522# CONFIG_R8169 is not set
523# CONFIG_SIS190 is not set
524# CONFIG_SKGE is not set
525# CONFIG_SK98LIN is not set
526# CONFIG_VIA_VELOCITY is not set
527# CONFIG_TIGON3 is not set
528# CONFIG_BNX2 is not set
529
530#
531# Ethernet (10000 Mbit)
532#
533# CONFIG_CHELSIO_T1 is not set
534# CONFIG_IXGB is not set
535# CONFIG_S2IO is not set
536
537#
538# Token Ring devices
539#
540CONFIG_TR=y
541CONFIG_IBMOL=y
542# CONFIG_3C359 is not set
543# CONFIG_TMS380TR is not set
544
545#
546# Wireless LAN (non-hamradio)
547#
548# CONFIG_NET_RADIO is not set
549
550#
551# Wan interfaces
552#
553# CONFIG_WAN is not set
554CONFIG_ISERIES_VETH=y
555# CONFIG_FDDI is not set
556# CONFIG_HIPPI is not set
557CONFIG_PPP=m
558# CONFIG_PPP_MULTILINK is not set
559# CONFIG_PPP_FILTER is not set
560CONFIG_PPP_ASYNC=m
561CONFIG_PPP_SYNC_TTY=m
562CONFIG_PPP_DEFLATE=m
563CONFIG_PPP_BSDCOMP=m
564CONFIG_PPPOE=m
565# CONFIG_SLIP is not set
566# CONFIG_NET_FC is not set
567# CONFIG_SHAPER is not set
568CONFIG_NETCONSOLE=y
569CONFIG_NETPOLL=y
570CONFIG_NETPOLL_RX=y
571CONFIG_NETPOLL_TRAP=y
572CONFIG_NET_POLL_CONTROLLER=y
573
574#
575# ISDN subsystem
576#
577# CONFIG_ISDN is not set
578
579#
580# Telephony Support
581#
582# CONFIG_PHONE is not set
583
584#
585# Input device support
586#
587CONFIG_INPUT=y
588
589#
590# Userland interfaces
591#
592CONFIG_INPUT_MOUSEDEV=y
593# CONFIG_INPUT_MOUSEDEV_PSAUX is not set
594CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024
595CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768
596# CONFIG_INPUT_JOYDEV is not set
597# CONFIG_INPUT_TSDEV is not set
598# CONFIG_INPUT_EVDEV is not set
599# CONFIG_INPUT_EVBUG is not set
600
601#
602# Input Device Drivers
603#
604# CONFIG_INPUT_KEYBOARD is not set
605# CONFIG_INPUT_MOUSE is not set
606# CONFIG_INPUT_JOYSTICK is not set
607# CONFIG_INPUT_TOUCHSCREEN is not set
608# CONFIG_INPUT_MISC is not set
609
610#
611# Hardware I/O ports
612#
613# CONFIG_SERIO is not set
614# CONFIG_GAMEPORT is not set
615
616#
617# Character devices
618#
619# CONFIG_SERIAL_NONSTANDARD is not set
620
621#
622# Serial drivers
623#
624# CONFIG_SERIAL_8250 is not set
625
626#
627# Non-8250 serial port support
628#
629CONFIG_SERIAL_CORE=m
630CONFIG_SERIAL_ICOM=m
631# CONFIG_SERIAL_JSM is not set
632CONFIG_UNIX98_PTYS=y
633CONFIG_LEGACY_PTYS=y
634CONFIG_LEGACY_PTY_COUNT=256
635
636#
637# IPMI
638#
639# CONFIG_IPMI_HANDLER is not set
640
641#
642# Watchdog Cards
643#
644# CONFIG_WATCHDOG is not set
645# CONFIG_RTC is not set
646# CONFIG_DTLK is not set
647# CONFIG_R3964 is not set
648# CONFIG_APPLICOM is not set
649
650#
651# Ftape, the floppy tape device driver
652#
653# CONFIG_AGP is not set
654# CONFIG_DRM is not set
655CONFIG_RAW_DRIVER=y
656CONFIG_MAX_RAW_DEVS=256
657# CONFIG_HANGCHECK_TIMER is not set
658
659#
660# TPM devices
661#
662# CONFIG_TCG_TPM is not set
663
664#
665# I2C support
666#
667# CONFIG_I2C is not set
668
669#
670# Dallas's 1-wire bus
671#
672# CONFIG_W1 is not set
673
674#
675# Hardware Monitoring support
676#
677# CONFIG_HWMON is not set
678# CONFIG_HWMON_VID is not set
679
680#
681# Misc devices
682#
683
684#
685# Multimedia Capabilities Port drivers
686#
687
688#
689# Multimedia devices
690#
691# CONFIG_VIDEO_DEV is not set
692
693#
694# Digital Video Broadcasting Devices
695#
696# CONFIG_DVB is not set
697
698#
699# Graphics support
700#
701# CONFIG_FB is not set
702
703#
704# Sound
705#
706# CONFIG_SOUND is not set
707
708#
709# USB support
710#
711CONFIG_USB_ARCH_HAS_HCD=y
712CONFIG_USB_ARCH_HAS_OHCI=y
713# CONFIG_USB is not set
714
715#
716# USB Gadget Support
717#
718# CONFIG_USB_GADGET is not set
719
720#
721# MMC/SD Card support
722#
723# CONFIG_MMC is not set
724
725#
726# InfiniBand support
727#
728# CONFIG_INFINIBAND is not set
729
730#
731# SN Devices
732#
733
734#
735# File systems
736#
737CONFIG_EXT2_FS=y
738CONFIG_EXT2_FS_XATTR=y
739CONFIG_EXT2_FS_POSIX_ACL=y
740CONFIG_EXT2_FS_SECURITY=y
741CONFIG_EXT2_FS_XIP=y
742CONFIG_FS_XIP=y
743CONFIG_EXT3_FS=y
744CONFIG_EXT3_FS_XATTR=y
745CONFIG_EXT3_FS_POSIX_ACL=y
746CONFIG_EXT3_FS_SECURITY=y
747CONFIG_JBD=y
748# CONFIG_JBD_DEBUG is not set
749CONFIG_FS_MBCACHE=y
750CONFIG_REISERFS_FS=y
751# CONFIG_REISERFS_CHECK is not set
752# CONFIG_REISERFS_PROC_INFO is not set
753CONFIG_REISERFS_FS_XATTR=y
754CONFIG_REISERFS_FS_POSIX_ACL=y
755CONFIG_REISERFS_FS_SECURITY=y
756CONFIG_JFS_FS=m
757CONFIG_JFS_POSIX_ACL=y
758CONFIG_JFS_SECURITY=y
759# CONFIG_JFS_DEBUG is not set
760# CONFIG_JFS_STATISTICS is not set
761CONFIG_FS_POSIX_ACL=y
762CONFIG_XFS_FS=m
763CONFIG_XFS_EXPORT=y
764# CONFIG_XFS_QUOTA is not set
765CONFIG_XFS_SECURITY=y
766CONFIG_XFS_POSIX_ACL=y
767# CONFIG_XFS_RT is not set
768# CONFIG_MINIX_FS is not set
769# CONFIG_ROMFS_FS is not set
770CONFIG_INOTIFY=y
771# CONFIG_QUOTA is not set
772CONFIG_DNOTIFY=y
773CONFIG_AUTOFS_FS=m
774# CONFIG_AUTOFS4_FS is not set
775# CONFIG_FUSE_FS is not set
776
777#
778# CD-ROM/DVD Filesystems
779#
780CONFIG_ISO9660_FS=y
781CONFIG_JOLIET=y
782CONFIG_ZISOFS=y
783CONFIG_ZISOFS_FS=y
784CONFIG_UDF_FS=m
785CONFIG_UDF_NLS=y
786
787#
788# DOS/FAT/NT Filesystems
789#
790CONFIG_FAT_FS=y
791CONFIG_MSDOS_FS=y
792CONFIG_VFAT_FS=y
793CONFIG_FAT_DEFAULT_CODEPAGE=437
794CONFIG_FAT_DEFAULT_IOCHARSET="iso8859-1"
795# CONFIG_NTFS_FS is not set
796
797#
798# Pseudo filesystems
799#
800CONFIG_PROC_FS=y
801CONFIG_PROC_KCORE=y
802CONFIG_SYSFS=y
803CONFIG_TMPFS=y
804# CONFIG_HUGETLBFS is not set
805# CONFIG_HUGETLB_PAGE is not set
806CONFIG_RAMFS=y
807# CONFIG_RELAYFS_FS is not set
808
809#
810# Miscellaneous filesystems
811#
812# CONFIG_ADFS_FS is not set
813# CONFIG_AFFS_FS is not set
814# CONFIG_HFS_FS is not set
815# CONFIG_HFSPLUS_FS is not set
816# CONFIG_BEFS_FS is not set
817# CONFIG_BFS_FS is not set
818# CONFIG_EFS_FS is not set
819CONFIG_CRAMFS=y
820# CONFIG_VXFS_FS is not set
821# CONFIG_HPFS_FS is not set
822# CONFIG_QNX4FS_FS is not set
823# CONFIG_SYSV_FS is not set
824# CONFIG_UFS_FS is not set
825
826#
827# Network File Systems
828#
829CONFIG_NFS_FS=y
830CONFIG_NFS_V3=y
831CONFIG_NFS_V3_ACL=y
832CONFIG_NFS_V4=y
833# CONFIG_NFS_DIRECTIO is not set
834CONFIG_NFSD=m
835CONFIG_NFSD_V2_ACL=y
836CONFIG_NFSD_V3=y
837CONFIG_NFSD_V3_ACL=y
838CONFIG_NFSD_V4=y
839CONFIG_NFSD_TCP=y
840CONFIG_LOCKD=y
841CONFIG_LOCKD_V4=y
842CONFIG_EXPORTFS=m
843CONFIG_NFS_ACL_SUPPORT=y
844CONFIG_NFS_COMMON=y
845CONFIG_SUNRPC=y
846CONFIG_SUNRPC_GSS=y
847CONFIG_RPCSEC_GSS_KRB5=y
848CONFIG_RPCSEC_GSS_SPKM3=m
849# CONFIG_SMB_FS is not set
850CONFIG_CIFS=m
851# CONFIG_CIFS_STATS is not set
852CONFIG_CIFS_XATTR=y
853CONFIG_CIFS_POSIX=y
854# CONFIG_CIFS_EXPERIMENTAL is not set
855# CONFIG_NCP_FS is not set
856# CONFIG_CODA_FS is not set
857# CONFIG_AFS_FS is not set
858# CONFIG_9P_FS is not set
859
860#
861# Partition Types
862#
863# CONFIG_PARTITION_ADVANCED is not set
864CONFIG_MSDOS_PARTITION=y
865
866#
867# Native Language Support
868#
869CONFIG_NLS=y
870CONFIG_NLS_DEFAULT="iso8859-1"
871CONFIG_NLS_CODEPAGE_437=y
872# CONFIG_NLS_CODEPAGE_737 is not set
873# CONFIG_NLS_CODEPAGE_775 is not set
874# CONFIG_NLS_CODEPAGE_850 is not set
875# CONFIG_NLS_CODEPAGE_852 is not set
876# CONFIG_NLS_CODEPAGE_855 is not set
877# CONFIG_NLS_CODEPAGE_857 is not set
878# CONFIG_NLS_CODEPAGE_860 is not set
879# CONFIG_NLS_CODEPAGE_861 is not set
880# CONFIG_NLS_CODEPAGE_862 is not set
881# CONFIG_NLS_CODEPAGE_863 is not set
882# CONFIG_NLS_CODEPAGE_864 is not set
883# CONFIG_NLS_CODEPAGE_865 is not set
884# CONFIG_NLS_CODEPAGE_866 is not set
885# CONFIG_NLS_CODEPAGE_869 is not set
886# CONFIG_NLS_CODEPAGE_936 is not set
887# CONFIG_NLS_CODEPAGE_950 is not set
888# CONFIG_NLS_CODEPAGE_932 is not set
889# CONFIG_NLS_CODEPAGE_949 is not set
890# CONFIG_NLS_CODEPAGE_874 is not set
891# CONFIG_NLS_ISO8859_8 is not set
892# CONFIG_NLS_CODEPAGE_1250 is not set
893# CONFIG_NLS_CODEPAGE_1251 is not set
894CONFIG_NLS_ASCII=y
895CONFIG_NLS_ISO8859_1=y
896# CONFIG_NLS_ISO8859_2 is not set
897# CONFIG_NLS_ISO8859_3 is not set
898# CONFIG_NLS_ISO8859_4 is not set
899# CONFIG_NLS_ISO8859_5 is not set
900# CONFIG_NLS_ISO8859_6 is not set
901# CONFIG_NLS_ISO8859_7 is not set
902# CONFIG_NLS_ISO8859_9 is not set
903# CONFIG_NLS_ISO8859_13 is not set
904# CONFIG_NLS_ISO8859_14 is not set
905# CONFIG_NLS_ISO8859_15 is not set
906# CONFIG_NLS_KOI8_R is not set
907# CONFIG_NLS_KOI8_U is not set
908# CONFIG_NLS_UTF8 is not set
909
910#
911# iSeries device drivers
912#
913CONFIG_VIOCONS=y
914CONFIG_VIODASD=y
915CONFIG_VIOCD=m
916CONFIG_VIOTAPE=m
917CONFIG_VIOPATH=y
918
919#
920# Profiling support
921#
922CONFIG_PROFILING=y
923CONFIG_OPROFILE=y
924
925#
926# Kernel hacking
927#
928# CONFIG_PRINTK_TIME is not set
929CONFIG_DEBUG_KERNEL=y
930CONFIG_MAGIC_SYSRQ=y
931CONFIG_LOG_BUF_SHIFT=17
932CONFIG_DETECT_SOFTLOCKUP=y
933# CONFIG_SCHEDSTATS is not set
934# CONFIG_DEBUG_SLAB is not set
935# CONFIG_DEBUG_SPINLOCK is not set
936# CONFIG_DEBUG_SPINLOCK_SLEEP is not set
937# CONFIG_DEBUG_KOBJECT is not set
938# CONFIG_DEBUG_INFO is not set
939CONFIG_DEBUG_FS=y
940CONFIG_DEBUG_STACKOVERFLOW=y
941# CONFIG_KPROBES is not set
942CONFIG_DEBUG_STACK_USAGE=y
943# CONFIG_DEBUGGER is not set
944# CONFIG_PPCDBG is not set
945CONFIG_IRQSTACKS=y
946
947#
948# Security options
949#
950# CONFIG_KEYS is not set
951# CONFIG_SECURITY is not set
952
953#
954# Cryptographic options
955#
956CONFIG_CRYPTO=y
957CONFIG_CRYPTO_HMAC=y
958CONFIG_CRYPTO_NULL=m
959CONFIG_CRYPTO_MD4=m
960CONFIG_CRYPTO_MD5=y
961CONFIG_CRYPTO_SHA1=m
962CONFIG_CRYPTO_SHA256=m
963CONFIG_CRYPTO_SHA512=m
964CONFIG_CRYPTO_WP512=m
965CONFIG_CRYPTO_TGR192=m
966CONFIG_CRYPTO_DES=y
967CONFIG_CRYPTO_BLOWFISH=m
968CONFIG_CRYPTO_TWOFISH=m
969CONFIG_CRYPTO_SERPENT=m
970CONFIG_CRYPTO_AES=m
971CONFIG_CRYPTO_CAST5=m
972CONFIG_CRYPTO_CAST6=m
973CONFIG_CRYPTO_TEA=m
974CONFIG_CRYPTO_ARC4=m
975CONFIG_CRYPTO_KHAZAD=m
976CONFIG_CRYPTO_ANUBIS=m
977CONFIG_CRYPTO_DEFLATE=m
978CONFIG_CRYPTO_MICHAEL_MIC=m
979CONFIG_CRYPTO_CRC32C=m
980CONFIG_CRYPTO_TEST=m
981
982#
983# Hardware crypto devices
984#
985
986#
987# Library routines
988#
989CONFIG_CRC_CCITT=m
990# CONFIG_CRC16 is not set
991CONFIG_CRC32=y
992CONFIG_LIBCRC32C=m
993CONFIG_ZLIB_INFLATE=y
994CONFIG_ZLIB_DEFLATE=m
995CONFIG_TEXTSEARCH=y
996CONFIG_TEXTSEARCH_KMP=m
997CONFIG_TEXTSEARCH_BM=m
998CONFIG_TEXTSEARCH_FSM=m
diff --git a/arch/powerpc/configs/maple_defconfig b/arch/powerpc/configs/maple_defconfig
new file mode 100644
index 000000000000..7b480f3d1406
--- /dev/null
+++ b/arch/powerpc/configs/maple_defconfig
@@ -0,0 +1,1062 @@
1#
2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.14-rc4
4# Thu Oct 20 08:31:24 2005
5#
6CONFIG_64BIT=y
7CONFIG_MMU=y
8CONFIG_RWSEM_XCHGADD_ALGORITHM=y
9CONFIG_GENERIC_CALIBRATE_DELAY=y
10CONFIG_GENERIC_ISA_DMA=y
11CONFIG_EARLY_PRINTK=y
12CONFIG_COMPAT=y
13CONFIG_SCHED_NO_NO_OMIT_FRAME_POINTER=y
14CONFIG_ARCH_MAY_HAVE_PC_FDC=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_LOCALVERSION_AUTO=y
30CONFIG_SWAP=y
31CONFIG_SYSVIPC=y
32CONFIG_POSIX_MQUEUE=y
33# CONFIG_BSD_PROCESS_ACCT is not set
34CONFIG_SYSCTL=y
35# CONFIG_AUDIT is not set
36# CONFIG_HOTPLUG is not set
37CONFIG_KOBJECT_UEVENT=y
38CONFIG_IKCONFIG=y
39CONFIG_IKCONFIG_PROC=y
40# CONFIG_CPUSETS is not set
41CONFIG_INITRAMFS_SOURCE=""
42# CONFIG_EMBEDDED is not set
43CONFIG_KALLSYMS=y
44CONFIG_KALLSYMS_ALL=y
45# CONFIG_KALLSYMS_EXTRA_PASS is not set
46CONFIG_PRINTK=y
47CONFIG_BUG=y
48CONFIG_BASE_FULL=y
49CONFIG_FUTEX=y
50CONFIG_EPOLL=y
51CONFIG_SHMEM=y
52CONFIG_CC_ALIGN_FUNCTIONS=0
53CONFIG_CC_ALIGN_LABELS=0
54CONFIG_CC_ALIGN_LOOPS=0
55CONFIG_CC_ALIGN_JUMPS=0
56# CONFIG_TINY_SHMEM is not set
57CONFIG_BASE_SMALL=0
58
59#
60# Loadable module support
61#
62CONFIG_MODULES=y
63CONFIG_MODULE_UNLOAD=y
64# CONFIG_MODULE_FORCE_UNLOAD is not set
65CONFIG_OBSOLETE_MODPARM=y
66CONFIG_MODVERSIONS=y
67CONFIG_MODULE_SRCVERSION_ALL=y
68CONFIG_KMOD=y
69CONFIG_STOP_MACHINE=y
70CONFIG_SYSVIPC_COMPAT=y
71
72#
73# Platform support
74#
75# CONFIG_PPC_ISERIES is not set
76CONFIG_PPC_MULTIPLATFORM=y
77# CONFIG_PPC_PSERIES is not set
78# CONFIG_PPC_BPA is not set
79# CONFIG_PPC_PMAC is not set
80CONFIG_PPC_MAPLE=y
81CONFIG_PPC=y
82CONFIG_PPC64=y
83CONFIG_PPC_OF=y
84CONFIG_MPIC=y
85# CONFIG_ALTIVEC is not set
86CONFIG_KEXEC=y
87CONFIG_U3_DART=y
88CONFIG_MPIC_BROKEN_U3=y
89CONFIG_BOOTX_TEXT=y
90CONFIG_POWER4_ONLY=y
91CONFIG_IOMMU_VMERGE=y
92CONFIG_SMP=y
93CONFIG_NR_CPUS=2
94CONFIG_ARCH_SELECT_MEMORY_MODEL=y
95CONFIG_ARCH_FLATMEM_ENABLE=y
96CONFIG_SELECT_MEMORY_MODEL=y
97CONFIG_FLATMEM_MANUAL=y
98# CONFIG_DISCONTIGMEM_MANUAL is not set
99# CONFIG_SPARSEMEM_MANUAL is not set
100CONFIG_FLATMEM=y
101CONFIG_FLAT_NODE_MEM_MAP=y
102# CONFIG_SPARSEMEM_STATIC is not set
103# CONFIG_NUMA is not set
104# CONFIG_SCHED_SMT is not set
105CONFIG_PREEMPT_NONE=y
106# CONFIG_PREEMPT_VOLUNTARY is not set
107# CONFIG_PREEMPT is not set
108# CONFIG_PREEMPT_BKL is not set
109# CONFIG_HZ_100 is not set
110CONFIG_HZ_250=y
111# CONFIG_HZ_1000 is not set
112CONFIG_HZ=250
113CONFIG_GENERIC_HARDIRQS=y
114CONFIG_SECCOMP=y
115CONFIG_BINFMT_ELF=y
116# CONFIG_BINFMT_MISC is not set
117CONFIG_PROC_DEVICETREE=y
118# CONFIG_CMDLINE_BOOL is not set
119CONFIG_ISA_DMA_API=y
120
121#
122# Bus Options
123#
124CONFIG_PCI=y
125CONFIG_PCI_DOMAINS=y
126CONFIG_PCI_LEGACY_PROC=y
127# CONFIG_PCI_DEBUG is not set
128
129#
130# PCCARD (PCMCIA/CardBus) support
131#
132# CONFIG_PCCARD is not set
133
134#
135# PCI Hotplug Support
136#
137# CONFIG_HOTPLUG_PCI is not set
138
139#
140# Networking
141#
142CONFIG_NET=y
143
144#
145# Networking options
146#
147CONFIG_PACKET=y
148CONFIG_PACKET_MMAP=y
149CONFIG_UNIX=y
150# CONFIG_NET_KEY is not set
151CONFIG_INET=y
152CONFIG_IP_MULTICAST=y
153# CONFIG_IP_ADVANCED_ROUTER is not set
154CONFIG_IP_FIB_HASH=y
155CONFIG_IP_PNP=y
156CONFIG_IP_PNP_DHCP=y
157# CONFIG_IP_PNP_BOOTP is not set
158# CONFIG_IP_PNP_RARP is not set
159# CONFIG_NET_IPIP is not set
160# CONFIG_NET_IPGRE is not set
161# CONFIG_IP_MROUTE is not set
162# CONFIG_ARPD is not set
163# CONFIG_SYN_COOKIES is not set
164# CONFIG_INET_AH is not set
165# CONFIG_INET_ESP is not set
166# CONFIG_INET_IPCOMP is not set
167# CONFIG_INET_TUNNEL is not set
168CONFIG_INET_DIAG=y
169CONFIG_INET_TCP_DIAG=y
170# CONFIG_TCP_CONG_ADVANCED is not set
171CONFIG_TCP_CONG_BIC=y
172# CONFIG_IPV6 is not set
173# CONFIG_NETFILTER is not set
174
175#
176# DCCP Configuration (EXPERIMENTAL)
177#
178# CONFIG_IP_DCCP 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# CONFIG_IEEE80211 is not set
207
208#
209# Device Drivers
210#
211
212#
213# Generic Driver Options
214#
215CONFIG_STANDALONE=y
216CONFIG_PREVENT_FIRMWARE_BUILD=y
217# CONFIG_FW_LOADER is not set
218# CONFIG_DEBUG_DRIVER is not set
219
220#
221# Connector - unified userspace <-> kernelspace linker
222#
223# CONFIG_CONNECTOR is not set
224
225#
226# Memory Technology Devices (MTD)
227#
228# CONFIG_MTD is not set
229
230#
231# Parallel port support
232#
233# CONFIG_PARPORT is not set
234
235#
236# Plug and Play support
237#
238
239#
240# Block devices
241#
242# CONFIG_BLK_DEV_FD is not set
243# CONFIG_BLK_CPQ_DA is not set
244# CONFIG_BLK_CPQ_CISS_DA is not set
245# CONFIG_BLK_DEV_DAC960 is not set
246# CONFIG_BLK_DEV_UMEM is not set
247# CONFIG_BLK_DEV_COW_COMMON is not set
248# CONFIG_BLK_DEV_LOOP is not set
249# CONFIG_BLK_DEV_NBD is not set
250# CONFIG_BLK_DEV_SX8 is not set
251# CONFIG_BLK_DEV_UB is not set
252CONFIG_BLK_DEV_RAM=y
253CONFIG_BLK_DEV_RAM_COUNT=16
254CONFIG_BLK_DEV_RAM_SIZE=8192
255# CONFIG_BLK_DEV_INITRD is not set
256# CONFIG_CDROM_PKTCDVD is not set
257
258#
259# IO Schedulers
260#
261CONFIG_IOSCHED_NOOP=y
262CONFIG_IOSCHED_AS=y
263CONFIG_IOSCHED_DEADLINE=y
264CONFIG_IOSCHED_CFQ=y
265# CONFIG_ATA_OVER_ETH is not set
266
267#
268# ATA/ATAPI/MFM/RLL support
269#
270CONFIG_IDE=y
271CONFIG_BLK_DEV_IDE=y
272
273#
274# Please see Documentation/ide.txt for help/info on IDE drives
275#
276# CONFIG_BLK_DEV_IDE_SATA is not set
277CONFIG_BLK_DEV_IDEDISK=y
278# CONFIG_IDEDISK_MULTI_MODE is not set
279CONFIG_BLK_DEV_IDECD=y
280# CONFIG_BLK_DEV_IDETAPE is not set
281# CONFIG_BLK_DEV_IDEFLOPPY is not set
282CONFIG_IDE_TASK_IOCTL=y
283
284#
285# IDE chipset support/bugfixes
286#
287CONFIG_IDE_GENERIC=y
288CONFIG_BLK_DEV_IDEPCI=y
289CONFIG_IDEPCI_SHARE_IRQ=y
290# CONFIG_BLK_DEV_OFFBOARD is not set
291CONFIG_BLK_DEV_GENERIC=y
292# CONFIG_BLK_DEV_OPTI621 is not set
293# CONFIG_BLK_DEV_SL82C105 is not set
294CONFIG_BLK_DEV_IDEDMA_PCI=y
295# CONFIG_BLK_DEV_IDEDMA_FORCED is not set
296CONFIG_IDEDMA_PCI_AUTO=y
297# CONFIG_IDEDMA_ONLYDISK is not set
298# CONFIG_BLK_DEV_AEC62XX is not set
299# CONFIG_BLK_DEV_ALI15X3 is not set
300CONFIG_BLK_DEV_AMD74XX=y
301# CONFIG_BLK_DEV_CMD64X is not set
302# CONFIG_BLK_DEV_TRIFLEX is not set
303# CONFIG_BLK_DEV_CY82C693 is not set
304# CONFIG_BLK_DEV_CS5520 is not set
305# CONFIG_BLK_DEV_CS5530 is not set
306# CONFIG_BLK_DEV_HPT34X is not set
307# CONFIG_BLK_DEV_HPT366 is not set
308# CONFIG_BLK_DEV_SC1200 is not set
309# CONFIG_BLK_DEV_PIIX is not set
310# CONFIG_BLK_DEV_IT821X is not set
311# CONFIG_BLK_DEV_NS87415 is not set
312# CONFIG_BLK_DEV_PDC202XX_OLD is not set
313# CONFIG_BLK_DEV_PDC202XX_NEW is not set
314# CONFIG_BLK_DEV_SVWKS is not set
315# CONFIG_BLK_DEV_SIIMAGE is not set
316# CONFIG_BLK_DEV_SLC90E66 is not set
317# CONFIG_BLK_DEV_TRM290 is not set
318# CONFIG_BLK_DEV_VIA82CXXX is not set
319# CONFIG_IDE_ARM is not set
320CONFIG_BLK_DEV_IDEDMA=y
321# CONFIG_IDEDMA_IVB is not set
322CONFIG_IDEDMA_AUTO=y
323# CONFIG_BLK_DEV_HD is not set
324
325#
326# SCSI device support
327#
328# CONFIG_RAID_ATTRS is not set
329# CONFIG_SCSI is not set
330
331#
332# Multi-device support (RAID and LVM)
333#
334# CONFIG_MD is not set
335
336#
337# Fusion MPT device support
338#
339# CONFIG_FUSION is not set
340
341#
342# IEEE 1394 (FireWire) support
343#
344# CONFIG_IEEE1394 is not set
345
346#
347# I2O device support
348#
349# CONFIG_I2O is not set
350
351#
352# Macintosh device drivers
353#
354
355#
356# Network device support
357#
358CONFIG_NETDEVICES=y
359# CONFIG_DUMMY is not set
360# CONFIG_BONDING is not set
361# CONFIG_EQUALIZER is not set
362# CONFIG_TUN is not set
363
364#
365# ARCnet devices
366#
367# CONFIG_ARCNET is not set
368
369#
370# PHY device support
371#
372# CONFIG_PHYLIB is not set
373
374#
375# Ethernet (10 or 100Mbit)
376#
377CONFIG_NET_ETHERNET=y
378CONFIG_MII=y
379# CONFIG_HAPPYMEAL is not set
380# CONFIG_SUNGEM is not set
381# CONFIG_CASSINI is not set
382# CONFIG_NET_VENDOR_3COM is not set
383
384#
385# Tulip family network device support
386#
387# CONFIG_NET_TULIP is not set
388# CONFIG_HP100 is not set
389CONFIG_NET_PCI=y
390# CONFIG_PCNET32 is not set
391CONFIG_AMD8111_ETH=y
392# CONFIG_AMD8111E_NAPI is not set
393# CONFIG_ADAPTEC_STARFIRE is not set
394# CONFIG_B44 is not set
395# CONFIG_FORCEDETH is not set
396# CONFIG_DGRS is not set
397# CONFIG_EEPRO100 is not set
398# CONFIG_E100 is not set
399# CONFIG_FEALNX is not set
400# CONFIG_NATSEMI is not set
401# CONFIG_NE2K_PCI is not set
402# CONFIG_8139CP is not set
403# CONFIG_8139TOO is not set
404# CONFIG_SIS900 is not set
405# CONFIG_EPIC100 is not set
406# CONFIG_SUNDANCE is not set
407# CONFIG_VIA_RHINE is not set
408
409#
410# Ethernet (1000 Mbit)
411#
412# CONFIG_ACENIC is not set
413# CONFIG_DL2K is not set
414CONFIG_E1000=y
415# CONFIG_E1000_NAPI is not set
416# CONFIG_NS83820 is not set
417# CONFIG_HAMACHI is not set
418# CONFIG_YELLOWFIN is not set
419# CONFIG_R8169 is not set
420# CONFIG_SIS190 is not set
421# CONFIG_SKGE is not set
422# CONFIG_SK98LIN is not set
423# CONFIG_VIA_VELOCITY is not set
424# CONFIG_TIGON3 is not set
425# CONFIG_BNX2 is not set
426# CONFIG_MV643XX_ETH is not set
427
428#
429# Ethernet (10000 Mbit)
430#
431# CONFIG_CHELSIO_T1 is not set
432# CONFIG_IXGB is not set
433# CONFIG_S2IO is not set
434
435#
436# Token Ring devices
437#
438# CONFIG_TR is not set
439
440#
441# Wireless LAN (non-hamradio)
442#
443# CONFIG_NET_RADIO is not set
444
445#
446# Wan interfaces
447#
448# CONFIG_WAN is not set
449# CONFIG_FDDI is not set
450# CONFIG_HIPPI is not set
451# CONFIG_PPP is not set
452# CONFIG_SLIP is not set
453# CONFIG_SHAPER is not set
454# CONFIG_NETCONSOLE is not set
455# CONFIG_NETPOLL is not set
456# CONFIG_NET_POLL_CONTROLLER is not set
457
458#
459# ISDN subsystem
460#
461# CONFIG_ISDN is not set
462
463#
464# Telephony Support
465#
466# CONFIG_PHONE is not set
467
468#
469# Input device support
470#
471CONFIG_INPUT=y
472
473#
474# Userland interfaces
475#
476CONFIG_INPUT_MOUSEDEV=y
477# CONFIG_INPUT_MOUSEDEV_PSAUX is not set
478CONFIG_INPUT_MOUSEDEV_SCREEN_X=1600
479CONFIG_INPUT_MOUSEDEV_SCREEN_Y=1200
480# CONFIG_INPUT_JOYDEV is not set
481# CONFIG_INPUT_TSDEV is not set
482# CONFIG_INPUT_EVDEV is not set
483# CONFIG_INPUT_EVBUG is not set
484
485#
486# Input Device Drivers
487#
488# CONFIG_INPUT_KEYBOARD is not set
489# CONFIG_INPUT_MOUSE is not set
490# CONFIG_INPUT_JOYSTICK is not set
491# CONFIG_INPUT_TOUCHSCREEN is not set
492# CONFIG_INPUT_MISC is not set
493
494#
495# Hardware I/O ports
496#
497# CONFIG_SERIO is not set
498# CONFIG_GAMEPORT is not set
499
500#
501# Character devices
502#
503CONFIG_VT=y
504CONFIG_VT_CONSOLE=y
505CONFIG_HW_CONSOLE=y
506# CONFIG_SERIAL_NONSTANDARD is not set
507
508#
509# Serial drivers
510#
511CONFIG_SERIAL_8250=y
512CONFIG_SERIAL_8250_CONSOLE=y
513CONFIG_SERIAL_8250_NR_UARTS=4
514# CONFIG_SERIAL_8250_EXTENDED is not set
515
516#
517# Non-8250 serial port support
518#
519CONFIG_SERIAL_CORE=y
520CONFIG_SERIAL_CORE_CONSOLE=y
521# CONFIG_SERIAL_JSM is not set
522CONFIG_UNIX98_PTYS=y
523CONFIG_LEGACY_PTYS=y
524CONFIG_LEGACY_PTY_COUNT=256
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_RTC is not set
536# CONFIG_DTLK is not set
537# CONFIG_R3964 is not set
538# CONFIG_APPLICOM is not set
539
540#
541# Ftape, the floppy tape device driver
542#
543# CONFIG_AGP is not set
544# CONFIG_DRM is not set
545# CONFIG_RAW_DRIVER is not set
546# CONFIG_HANGCHECK_TIMER is not set
547
548#
549# TPM devices
550#
551# CONFIG_TCG_TPM is not set
552
553#
554# I2C support
555#
556CONFIG_I2C=y
557CONFIG_I2C_CHARDEV=y
558
559#
560# I2C Algorithms
561#
562CONFIG_I2C_ALGOBIT=y
563# CONFIG_I2C_ALGOPCF is not set
564# CONFIG_I2C_ALGOPCA is not set
565
566#
567# I2C Hardware Bus support
568#
569# CONFIG_I2C_ALI1535 is not set
570# CONFIG_I2C_ALI1563 is not set
571# CONFIG_I2C_ALI15X3 is not set
572# CONFIG_I2C_AMD756 is not set
573CONFIG_I2C_AMD8111=y
574# CONFIG_I2C_I801 is not set
575# CONFIG_I2C_I810 is not set
576# CONFIG_I2C_PIIX4 is not set
577# CONFIG_I2C_NFORCE2 is not set
578# CONFIG_I2C_PARPORT_LIGHT is not set
579# CONFIG_I2C_PROSAVAGE is not set
580# CONFIG_I2C_SAVAGE4 is not set
581# CONFIG_SCx200_ACB is not set
582# CONFIG_I2C_SIS5595 is not set
583# CONFIG_I2C_SIS630 is not set
584# CONFIG_I2C_SIS96X is not set
585# CONFIG_I2C_STUB is not set
586# CONFIG_I2C_VIA is not set
587# CONFIG_I2C_VIAPRO is not set
588# CONFIG_I2C_VOODOO3 is not set
589# CONFIG_I2C_PCA_ISA is not set
590
591#
592# Miscellaneous I2C Chip support
593#
594# CONFIG_SENSORS_DS1337 is not set
595# CONFIG_SENSORS_DS1374 is not set
596# CONFIG_SENSORS_EEPROM is not set
597# CONFIG_SENSORS_PCF8574 is not set
598# CONFIG_SENSORS_PCA9539 is not set
599# CONFIG_SENSORS_PCF8591 is not set
600# CONFIG_SENSORS_RTC8564 is not set
601# CONFIG_SENSORS_MAX6875 is not set
602# CONFIG_I2C_DEBUG_CORE is not set
603# CONFIG_I2C_DEBUG_ALGO is not set
604# CONFIG_I2C_DEBUG_BUS is not set
605# CONFIG_I2C_DEBUG_CHIP is not set
606
607#
608# Dallas's 1-wire bus
609#
610# CONFIG_W1 is not set
611
612#
613# Hardware Monitoring support
614#
615# CONFIG_HWMON is not set
616# CONFIG_HWMON_VID is not set
617
618#
619# Misc devices
620#
621
622#
623# Multimedia Capabilities Port drivers
624#
625
626#
627# Multimedia devices
628#
629# CONFIG_VIDEO_DEV is not set
630
631#
632# Digital Video Broadcasting Devices
633#
634# CONFIG_DVB is not set
635
636#
637# Graphics support
638#
639# CONFIG_FB is not set
640
641#
642# Console display driver support
643#
644# CONFIG_VGA_CONSOLE is not set
645CONFIG_DUMMY_CONSOLE=y
646
647#
648# Sound
649#
650# CONFIG_SOUND is not set
651
652#
653# USB support
654#
655CONFIG_USB_ARCH_HAS_HCD=y
656CONFIG_USB_ARCH_HAS_OHCI=y
657CONFIG_USB=y
658# CONFIG_USB_DEBUG is not set
659
660#
661# Miscellaneous USB options
662#
663CONFIG_USB_DEVICEFS=y
664# CONFIG_USB_BANDWIDTH is not set
665# CONFIG_USB_DYNAMIC_MINORS is not set
666# CONFIG_USB_OTG is not set
667
668#
669# USB Host Controller Drivers
670#
671CONFIG_USB_EHCI_HCD=y
672CONFIG_USB_EHCI_SPLIT_ISO=y
673CONFIG_USB_EHCI_ROOT_HUB_TT=y
674# CONFIG_USB_ISP116X_HCD is not set
675CONFIG_USB_OHCI_HCD=y
676# CONFIG_USB_OHCI_BIG_ENDIAN is not set
677CONFIG_USB_OHCI_LITTLE_ENDIAN=y
678CONFIG_USB_UHCI_HCD=y
679# CONFIG_USB_SL811_HCD is not set
680
681#
682# USB Device Class drivers
683#
684# CONFIG_USB_BLUETOOTH_TTY is not set
685# CONFIG_USB_ACM is not set
686# CONFIG_USB_PRINTER is not set
687
688#
689# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support' may also be needed; see USB_STORAGE Help for more information
690#
691# CONFIG_USB_STORAGE is not set
692
693#
694# USB Input Devices
695#
696CONFIG_USB_HID=y
697CONFIG_USB_HIDINPUT=y
698# CONFIG_HID_FF is not set
699# CONFIG_USB_HIDDEV is not set
700# CONFIG_USB_AIPTEK is not set
701# CONFIG_USB_WACOM is not set
702# CONFIG_USB_ACECAD is not set
703# CONFIG_USB_KBTAB is not set
704# CONFIG_USB_POWERMATE is not set
705# CONFIG_USB_MTOUCH is not set
706# CONFIG_USB_ITMTOUCH is not set
707# CONFIG_USB_EGALAX is not set
708# CONFIG_USB_YEALINK is not set
709# CONFIG_USB_XPAD is not set
710# CONFIG_USB_ATI_REMOTE is not set
711# CONFIG_USB_KEYSPAN_REMOTE is not set
712# CONFIG_USB_APPLETOUCH is not set
713
714#
715# USB Imaging devices
716#
717# CONFIG_USB_MDC800 is not set
718
719#
720# USB Multimedia devices
721#
722# CONFIG_USB_DABUSB is not set
723
724#
725# Video4Linux support is needed for USB Multimedia device support
726#
727
728#
729# USB Network Adapters
730#
731# CONFIG_USB_CATC is not set
732# CONFIG_USB_KAWETH is not set
733CONFIG_USB_PEGASUS=y
734# CONFIG_USB_RTL8150 is not set
735# CONFIG_USB_USBNET is not set
736CONFIG_USB_MON=y
737
738#
739# USB port drivers
740#
741
742#
743# USB Serial Converter support
744#
745CONFIG_USB_SERIAL=y
746# CONFIG_USB_SERIAL_CONSOLE is not set
747CONFIG_USB_SERIAL_GENERIC=y
748# CONFIG_USB_SERIAL_AIRPRIME is not set
749# CONFIG_USB_SERIAL_BELKIN is not set
750# CONFIG_USB_SERIAL_DIGI_ACCELEPORT is not set
751# CONFIG_USB_SERIAL_CP2101 is not set
752CONFIG_USB_SERIAL_CYPRESS_M8=m
753# CONFIG_USB_SERIAL_EMPEG is not set
754# CONFIG_USB_SERIAL_FTDI_SIO is not set
755# CONFIG_USB_SERIAL_VISOR is not set
756# CONFIG_USB_SERIAL_IPAQ is not set
757# CONFIG_USB_SERIAL_IR is not set
758# CONFIG_USB_SERIAL_EDGEPORT is not set
759# CONFIG_USB_SERIAL_EDGEPORT_TI is not set
760CONFIG_USB_SERIAL_GARMIN=m
761CONFIG_USB_SERIAL_IPW=m
762# CONFIG_USB_SERIAL_KEYSPAN_PDA is not set
763CONFIG_USB_SERIAL_KEYSPAN=y
764CONFIG_USB_SERIAL_KEYSPAN_MPR=y
765CONFIG_USB_SERIAL_KEYSPAN_USA28=y
766CONFIG_USB_SERIAL_KEYSPAN_USA28X=y
767CONFIG_USB_SERIAL_KEYSPAN_USA28XA=y
768CONFIG_USB_SERIAL_KEYSPAN_USA28XB=y
769CONFIG_USB_SERIAL_KEYSPAN_USA19=y
770CONFIG_USB_SERIAL_KEYSPAN_USA18X=y
771CONFIG_USB_SERIAL_KEYSPAN_USA19W=y
772CONFIG_USB_SERIAL_KEYSPAN_USA19QW=y
773CONFIG_USB_SERIAL_KEYSPAN_USA19QI=y
774CONFIG_USB_SERIAL_KEYSPAN_USA49W=y
775CONFIG_USB_SERIAL_KEYSPAN_USA49WLC=y
776# CONFIG_USB_SERIAL_KLSI is not set
777# CONFIG_USB_SERIAL_KOBIL_SCT is not set
778# CONFIG_USB_SERIAL_MCT_U232 is not set
779# CONFIG_USB_SERIAL_PL2303 is not set
780# CONFIG_USB_SERIAL_HP4X is not set
781# CONFIG_USB_SERIAL_SAFE is not set
782CONFIG_USB_SERIAL_TI=m
783# CONFIG_USB_SERIAL_CYBERJACK is not set
784# CONFIG_USB_SERIAL_XIRCOM is not set
785# CONFIG_USB_SERIAL_OMNINET is not set
786CONFIG_USB_EZUSB=y
787
788#
789# USB Miscellaneous drivers
790#
791# CONFIG_USB_EMI62 is not set
792# CONFIG_USB_EMI26 is not set
793# CONFIG_USB_AUERSWALD is not set
794# CONFIG_USB_RIO500 is not set
795# CONFIG_USB_LEGOTOWER is not set
796# CONFIG_USB_LCD is not set
797# CONFIG_USB_LED is not set
798# CONFIG_USB_CYTHERM is not set
799# CONFIG_USB_PHIDGETKIT is not set
800# CONFIG_USB_PHIDGETSERVO is not set
801# CONFIG_USB_IDMOUSE is not set
802# CONFIG_USB_SISUSBVGA is not set
803# CONFIG_USB_LD is not set
804# CONFIG_USB_TEST is not set
805
806#
807# USB DSL modem support
808#
809
810#
811# USB Gadget Support
812#
813# CONFIG_USB_GADGET is not set
814
815#
816# MMC/SD Card support
817#
818# CONFIG_MMC is not set
819
820#
821# InfiniBand support
822#
823# CONFIG_INFINIBAND is not set
824
825#
826# SN Devices
827#
828
829#
830# File systems
831#
832CONFIG_EXT2_FS=y
833# CONFIG_EXT2_FS_XATTR is not set
834CONFIG_EXT2_FS_XIP=y
835CONFIG_FS_XIP=y
836CONFIG_EXT3_FS=y
837# CONFIG_EXT3_FS_XATTR is not set
838CONFIG_JBD=y
839# CONFIG_JBD_DEBUG is not set
840# CONFIG_REISERFS_FS is not set
841# CONFIG_JFS_FS is not set
842CONFIG_FS_POSIX_ACL=y
843# CONFIG_XFS_FS is not set
844# CONFIG_MINIX_FS is not set
845# CONFIG_ROMFS_FS is not set
846CONFIG_INOTIFY=y
847# CONFIG_QUOTA is not set
848CONFIG_DNOTIFY=y
849# CONFIG_AUTOFS_FS is not set
850# CONFIG_AUTOFS4_FS is not set
851# CONFIG_FUSE_FS is not set
852
853#
854# CD-ROM/DVD Filesystems
855#
856# CONFIG_ISO9660_FS is not set
857# CONFIG_UDF_FS is not set
858
859#
860# DOS/FAT/NT Filesystems
861#
862CONFIG_FAT_FS=y
863CONFIG_MSDOS_FS=y
864CONFIG_VFAT_FS=y
865CONFIG_FAT_DEFAULT_CODEPAGE=437
866CONFIG_FAT_DEFAULT_IOCHARSET="iso8859-1"
867# CONFIG_NTFS_FS is not set
868
869#
870# Pseudo filesystems
871#
872CONFIG_PROC_FS=y
873CONFIG_PROC_KCORE=y
874CONFIG_SYSFS=y
875CONFIG_TMPFS=y
876CONFIG_HUGETLBFS=y
877CONFIG_HUGETLB_PAGE=y
878CONFIG_RAMFS=y
879# CONFIG_RELAYFS_FS is not set
880
881#
882# Miscellaneous filesystems
883#
884# CONFIG_ADFS_FS is not set
885# CONFIG_AFFS_FS is not set
886# CONFIG_HFS_FS is not set
887# CONFIG_HFSPLUS_FS is not set
888# CONFIG_BEFS_FS is not set
889# CONFIG_BFS_FS is not set
890# CONFIG_EFS_FS is not set
891CONFIG_CRAMFS=y
892# CONFIG_VXFS_FS is not set
893# CONFIG_HPFS_FS is not set
894# CONFIG_QNX4FS_FS is not set
895# CONFIG_SYSV_FS is not set
896# CONFIG_UFS_FS is not set
897
898#
899# Network File Systems
900#
901CONFIG_NFS_FS=y
902CONFIG_NFS_V3=y
903CONFIG_NFS_V3_ACL=y
904CONFIG_NFS_V4=y
905# CONFIG_NFS_DIRECTIO is not set
906# CONFIG_NFSD is not set
907CONFIG_ROOT_NFS=y
908CONFIG_LOCKD=y
909CONFIG_LOCKD_V4=y
910CONFIG_NFS_ACL_SUPPORT=y
911CONFIG_NFS_COMMON=y
912CONFIG_SUNRPC=y
913CONFIG_SUNRPC_GSS=y
914CONFIG_RPCSEC_GSS_KRB5=y
915# CONFIG_RPCSEC_GSS_SPKM3 is not set
916# CONFIG_SMB_FS is not set
917# CONFIG_CIFS is not set
918# CONFIG_NCP_FS is not set
919# CONFIG_CODA_FS is not set
920# CONFIG_AFS_FS is not set
921# CONFIG_9P_FS is not set
922
923#
924# Partition Types
925#
926CONFIG_PARTITION_ADVANCED=y
927# CONFIG_ACORN_PARTITION is not set
928# CONFIG_OSF_PARTITION is not set
929# CONFIG_AMIGA_PARTITION is not set
930# CONFIG_ATARI_PARTITION is not set
931CONFIG_MAC_PARTITION=y
932CONFIG_MSDOS_PARTITION=y
933# CONFIG_BSD_DISKLABEL is not set
934# CONFIG_MINIX_SUBPARTITION is not set
935# CONFIG_SOLARIS_X86_PARTITION is not set
936# CONFIG_UNIXWARE_DISKLABEL is not set
937# CONFIG_LDM_PARTITION is not set
938# CONFIG_SGI_PARTITION is not set
939# CONFIG_ULTRIX_PARTITION is not set
940# CONFIG_SUN_PARTITION is not set
941# CONFIG_EFI_PARTITION is not set
942
943#
944# Native Language Support
945#
946CONFIG_NLS=y
947CONFIG_NLS_DEFAULT="utf-8"
948# CONFIG_NLS_CODEPAGE_437 is not set
949# CONFIG_NLS_CODEPAGE_737 is not set
950# CONFIG_NLS_CODEPAGE_775 is not set
951# CONFIG_NLS_CODEPAGE_850 is not set
952# CONFIG_NLS_CODEPAGE_852 is not set
953# CONFIG_NLS_CODEPAGE_855 is not set
954# CONFIG_NLS_CODEPAGE_857 is not set
955# CONFIG_NLS_CODEPAGE_860 is not set
956# CONFIG_NLS_CODEPAGE_861 is not set
957# CONFIG_NLS_CODEPAGE_862 is not set
958# CONFIG_NLS_CODEPAGE_863 is not set
959# CONFIG_NLS_CODEPAGE_864 is not set
960# CONFIG_NLS_CODEPAGE_865 is not set
961# CONFIG_NLS_CODEPAGE_866 is not set
962# CONFIG_NLS_CODEPAGE_869 is not set
963# CONFIG_NLS_CODEPAGE_936 is not set
964# CONFIG_NLS_CODEPAGE_950 is not set
965# CONFIG_NLS_CODEPAGE_932 is not set
966# CONFIG_NLS_CODEPAGE_949 is not set
967# CONFIG_NLS_CODEPAGE_874 is not set
968# CONFIG_NLS_ISO8859_8 is not set
969# CONFIG_NLS_CODEPAGE_1250 is not set
970# CONFIG_NLS_CODEPAGE_1251 is not set
971# CONFIG_NLS_ASCII is not set
972# CONFIG_NLS_ISO8859_1 is not set
973# CONFIG_NLS_ISO8859_2 is not set
974# CONFIG_NLS_ISO8859_3 is not set
975# CONFIG_NLS_ISO8859_4 is not set
976# CONFIG_NLS_ISO8859_5 is not set
977# CONFIG_NLS_ISO8859_6 is not set
978# CONFIG_NLS_ISO8859_7 is not set
979# CONFIG_NLS_ISO8859_9 is not set
980# CONFIG_NLS_ISO8859_13 is not set
981# CONFIG_NLS_ISO8859_14 is not set
982# CONFIG_NLS_ISO8859_15 is not set
983# CONFIG_NLS_KOI8_R is not set
984# CONFIG_NLS_KOI8_U is not set
985CONFIG_NLS_UTF8=y
986
987#
988# Profiling support
989#
990# CONFIG_PROFILING is not set
991
992#
993# Kernel hacking
994#
995# CONFIG_PRINTK_TIME is not set
996CONFIG_DEBUG_KERNEL=y
997CONFIG_MAGIC_SYSRQ=y
998CONFIG_LOG_BUF_SHIFT=17
999CONFIG_DETECT_SOFTLOCKUP=y
1000# CONFIG_SCHEDSTATS is not set
1001CONFIG_DEBUG_SLAB=y
1002# CONFIG_DEBUG_SPINLOCK is not set
1003CONFIG_DEBUG_SPINLOCK_SLEEP=y
1004# CONFIG_DEBUG_KOBJECT is not set
1005# CONFIG_DEBUG_INFO is not set
1006CONFIG_DEBUG_FS=y
1007CONFIG_DEBUG_STACKOVERFLOW=y
1008# CONFIG_KPROBES is not set
1009CONFIG_DEBUG_STACK_USAGE=y
1010CONFIG_DEBUGGER=y
1011CONFIG_XMON=y
1012CONFIG_XMON_DEFAULT=y
1013# CONFIG_PPCDBG is not set
1014# CONFIG_IRQSTACKS is not set
1015
1016#
1017# Security options
1018#
1019# CONFIG_KEYS is not set
1020# CONFIG_SECURITY is not set
1021
1022#
1023# Cryptographic options
1024#
1025CONFIG_CRYPTO=y
1026# CONFIG_CRYPTO_HMAC is not set
1027# CONFIG_CRYPTO_NULL is not set
1028# CONFIG_CRYPTO_MD4 is not set
1029CONFIG_CRYPTO_MD5=y
1030# CONFIG_CRYPTO_SHA1 is not set
1031# CONFIG_CRYPTO_SHA256 is not set
1032# CONFIG_CRYPTO_SHA512 is not set
1033# CONFIG_CRYPTO_WP512 is not set
1034# CONFIG_CRYPTO_TGR192 is not set
1035CONFIG_CRYPTO_DES=y
1036# CONFIG_CRYPTO_BLOWFISH is not set
1037# CONFIG_CRYPTO_TWOFISH is not set
1038# CONFIG_CRYPTO_SERPENT is not set
1039# CONFIG_CRYPTO_AES is not set
1040# CONFIG_CRYPTO_CAST5 is not set
1041# CONFIG_CRYPTO_CAST6 is not set
1042# CONFIG_CRYPTO_TEA is not set
1043# CONFIG_CRYPTO_ARC4 is not set
1044# CONFIG_CRYPTO_KHAZAD is not set
1045# CONFIG_CRYPTO_ANUBIS is not set
1046# CONFIG_CRYPTO_DEFLATE is not set
1047# CONFIG_CRYPTO_MICHAEL_MIC is not set
1048# CONFIG_CRYPTO_CRC32C is not set
1049# CONFIG_CRYPTO_TEST is not set
1050
1051#
1052# Hardware crypto devices
1053#
1054
1055#
1056# Library routines
1057#
1058CONFIG_CRC_CCITT=y
1059# CONFIG_CRC16 is not set
1060CONFIG_CRC32=y
1061# CONFIG_LIBCRC32C is not set
1062CONFIG_ZLIB_INFLATE=y
diff --git a/arch/powerpc/configs/pseries_defconfig b/arch/powerpc/configs/pseries_defconfig
new file mode 100644
index 000000000000..9f09dff9e11a
--- /dev/null
+++ b/arch/powerpc/configs/pseries_defconfig
@@ -0,0 +1,1371 @@
1#
2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.14-rc4
4# Thu Oct 20 08:32:17 2005
5#
6CONFIG_64BIT=y
7CONFIG_MMU=y
8CONFIG_RWSEM_XCHGADD_ALGORITHM=y
9CONFIG_GENERIC_CALIBRATE_DELAY=y
10CONFIG_GENERIC_ISA_DMA=y
11CONFIG_EARLY_PRINTK=y
12CONFIG_COMPAT=y
13CONFIG_SCHED_NO_NO_OMIT_FRAME_POINTER=y
14CONFIG_ARCH_MAY_HAVE_PC_FDC=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_LOCALVERSION_AUTO=y
30CONFIG_SWAP=y
31CONFIG_SYSVIPC=y
32CONFIG_POSIX_MQUEUE=y
33# CONFIG_BSD_PROCESS_ACCT is not set
34CONFIG_SYSCTL=y
35CONFIG_AUDIT=y
36CONFIG_AUDITSYSCALL=y
37CONFIG_HOTPLUG=y
38CONFIG_KOBJECT_UEVENT=y
39CONFIG_IKCONFIG=y
40CONFIG_IKCONFIG_PROC=y
41CONFIG_CPUSETS=y
42CONFIG_INITRAMFS_SOURCE=""
43# CONFIG_EMBEDDED is not set
44CONFIG_KALLSYMS=y
45CONFIG_KALLSYMS_ALL=y
46# CONFIG_KALLSYMS_EXTRA_PASS is not set
47CONFIG_PRINTK=y
48CONFIG_BUG=y
49CONFIG_BASE_FULL=y
50CONFIG_FUTEX=y
51CONFIG_EPOLL=y
52CONFIG_SHMEM=y
53CONFIG_CC_ALIGN_FUNCTIONS=0
54CONFIG_CC_ALIGN_LABELS=0
55CONFIG_CC_ALIGN_LOOPS=0
56CONFIG_CC_ALIGN_JUMPS=0
57# CONFIG_TINY_SHMEM is not set
58CONFIG_BASE_SMALL=0
59
60#
61# Loadable module support
62#
63CONFIG_MODULES=y
64CONFIG_MODULE_UNLOAD=y
65# CONFIG_MODULE_FORCE_UNLOAD is not set
66CONFIG_OBSOLETE_MODPARM=y
67CONFIG_MODVERSIONS=y
68CONFIG_MODULE_SRCVERSION_ALL=y
69CONFIG_KMOD=y
70CONFIG_STOP_MACHINE=y
71CONFIG_SYSVIPC_COMPAT=y
72
73#
74# Platform support
75#
76# CONFIG_PPC_ISERIES is not set
77CONFIG_PPC_MULTIPLATFORM=y
78CONFIG_PPC_PSERIES=y
79# CONFIG_PPC_BPA is not set
80# CONFIG_PPC_PMAC is not set
81# CONFIG_PPC_MAPLE is not set
82CONFIG_PPC=y
83CONFIG_PPC64=y
84CONFIG_PPC_OF=y
85CONFIG_XICS=y
86CONFIG_MPIC=y
87CONFIG_ALTIVEC=y
88CONFIG_PPC_SPLPAR=y
89CONFIG_KEXEC=y
90CONFIG_IBMVIO=y
91# CONFIG_U3_DART is not set
92# CONFIG_BOOTX_TEXT is not set
93# CONFIG_POWER4_ONLY is not set
94CONFIG_IOMMU_VMERGE=y
95CONFIG_SMP=y
96CONFIG_NR_CPUS=128
97CONFIG_ARCH_SELECT_MEMORY_MODEL=y
98CONFIG_ARCH_FLATMEM_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
109# CONFIG_SPARSEMEM_STATIC is not set
110CONFIG_HAVE_ARCH_EARLY_PFN_TO_NID=y
111CONFIG_NODES_SPAN_OTHER_NODES=y
112CONFIG_NUMA=y
113CONFIG_SCHED_SMT=y
114CONFIG_PREEMPT_NONE=y
115# CONFIG_PREEMPT_VOLUNTARY is not set
116# CONFIG_PREEMPT is not set
117# CONFIG_PREEMPT_BKL is not set
118# CONFIG_HZ_100 is not set
119CONFIG_HZ_250=y
120# CONFIG_HZ_1000 is not set
121CONFIG_HZ=250
122CONFIG_EEH=y
123CONFIG_GENERIC_HARDIRQS=y
124CONFIG_PPC_RTAS=y
125CONFIG_RTAS_PROC=y
126CONFIG_RTAS_FLASH=m
127CONFIG_SCANLOG=m
128CONFIG_LPARCFG=y
129CONFIG_SECCOMP=y
130CONFIG_BINFMT_ELF=y
131# CONFIG_BINFMT_MISC is not set
132CONFIG_HOTPLUG_CPU=y
133CONFIG_PROC_DEVICETREE=y
134# CONFIG_CMDLINE_BOOL is not set
135CONFIG_ISA_DMA_API=y
136
137#
138# Bus Options
139#
140CONFIG_PCI=y
141CONFIG_PCI_DOMAINS=y
142CONFIG_PCI_LEGACY_PROC=y
143# CONFIG_PCI_DEBUG is not set
144
145#
146# PCCARD (PCMCIA/CardBus) support
147#
148# CONFIG_PCCARD is not set
149
150#
151# PCI Hotplug Support
152#
153CONFIG_HOTPLUG_PCI=m
154# CONFIG_HOTPLUG_PCI_FAKE is not set
155# CONFIG_HOTPLUG_PCI_CPCI is not set
156# CONFIG_HOTPLUG_PCI_SHPC is not set
157CONFIG_HOTPLUG_PCI_RPA=m
158CONFIG_HOTPLUG_PCI_RPA_DLPAR=m
159
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
188CONFIG_INET_DIAG=y
189CONFIG_INET_TCP_DIAG=y
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
200CONFIG_NETFILTER_NETLINK=y
201CONFIG_NETFILTER_NETLINK_QUEUE=m
202CONFIG_NETFILTER_NETLINK_LOG=m
203
204#
205# IP: Netfilter Configuration
206#
207CONFIG_IP_NF_CONNTRACK=m
208CONFIG_IP_NF_CT_ACCT=y
209CONFIG_IP_NF_CONNTRACK_MARK=y
210CONFIG_IP_NF_CONNTRACK_EVENTS=y
211CONFIG_IP_NF_CONNTRACK_NETLINK=m
212CONFIG_IP_NF_CT_PROTO_SCTP=m
213CONFIG_IP_NF_FTP=m
214CONFIG_IP_NF_IRC=m
215# CONFIG_IP_NF_NETBIOS_NS is not set
216CONFIG_IP_NF_TFTP=m
217CONFIG_IP_NF_AMANDA=m
218# CONFIG_IP_NF_PPTP is not set
219CONFIG_IP_NF_QUEUE=m
220CONFIG_IP_NF_IPTABLES=m
221CONFIG_IP_NF_MATCH_LIMIT=m
222CONFIG_IP_NF_MATCH_IPRANGE=m
223CONFIG_IP_NF_MATCH_MAC=m
224CONFIG_IP_NF_MATCH_PKTTYPE=m
225CONFIG_IP_NF_MATCH_MARK=m
226CONFIG_IP_NF_MATCH_MULTIPORT=m
227CONFIG_IP_NF_MATCH_TOS=m
228CONFIG_IP_NF_MATCH_RECENT=m
229CONFIG_IP_NF_MATCH_ECN=m
230CONFIG_IP_NF_MATCH_DSCP=m
231CONFIG_IP_NF_MATCH_AH_ESP=m
232CONFIG_IP_NF_MATCH_LENGTH=m
233CONFIG_IP_NF_MATCH_TTL=m
234CONFIG_IP_NF_MATCH_TCPMSS=m
235CONFIG_IP_NF_MATCH_HELPER=m
236CONFIG_IP_NF_MATCH_STATE=m
237CONFIG_IP_NF_MATCH_CONNTRACK=m
238CONFIG_IP_NF_MATCH_OWNER=m
239CONFIG_IP_NF_MATCH_ADDRTYPE=m
240CONFIG_IP_NF_MATCH_REALM=m
241CONFIG_IP_NF_MATCH_SCTP=m
242# CONFIG_IP_NF_MATCH_DCCP is not set
243CONFIG_IP_NF_MATCH_COMMENT=m
244CONFIG_IP_NF_MATCH_CONNMARK=m
245CONFIG_IP_NF_MATCH_CONNBYTES=m
246CONFIG_IP_NF_MATCH_HASHLIMIT=m
247CONFIG_IP_NF_MATCH_STRING=m
248CONFIG_IP_NF_FILTER=m
249CONFIG_IP_NF_TARGET_REJECT=m
250CONFIG_IP_NF_TARGET_LOG=m
251CONFIG_IP_NF_TARGET_ULOG=m
252CONFIG_IP_NF_TARGET_TCPMSS=m
253CONFIG_IP_NF_TARGET_NFQUEUE=m
254CONFIG_IP_NF_NAT=m
255CONFIG_IP_NF_NAT_NEEDED=y
256CONFIG_IP_NF_TARGET_MASQUERADE=m
257CONFIG_IP_NF_TARGET_REDIRECT=m
258CONFIG_IP_NF_TARGET_NETMAP=m
259CONFIG_IP_NF_TARGET_SAME=m
260CONFIG_IP_NF_NAT_SNMP_BASIC=m
261CONFIG_IP_NF_NAT_IRC=m
262CONFIG_IP_NF_NAT_FTP=m
263CONFIG_IP_NF_NAT_TFTP=m
264CONFIG_IP_NF_NAT_AMANDA=m
265CONFIG_IP_NF_MANGLE=m
266CONFIG_IP_NF_TARGET_TOS=m
267CONFIG_IP_NF_TARGET_ECN=m
268CONFIG_IP_NF_TARGET_DSCP=m
269CONFIG_IP_NF_TARGET_MARK=m
270CONFIG_IP_NF_TARGET_CLASSIFY=m
271CONFIG_IP_NF_TARGET_TTL=m
272CONFIG_IP_NF_TARGET_CONNMARK=m
273CONFIG_IP_NF_TARGET_CLUSTERIP=m
274CONFIG_IP_NF_RAW=m
275CONFIG_IP_NF_TARGET_NOTRACK=m
276CONFIG_IP_NF_ARPTABLES=m
277CONFIG_IP_NF_ARPFILTER=m
278CONFIG_IP_NF_ARP_MANGLE=m
279
280#
281# DCCP Configuration (EXPERIMENTAL)
282#
283# CONFIG_IP_DCCP is not set
284
285#
286# SCTP Configuration (EXPERIMENTAL)
287#
288# CONFIG_IP_SCTP is not set
289# CONFIG_ATM is not set
290# CONFIG_BRIDGE is not set
291# CONFIG_VLAN_8021Q is not set
292# CONFIG_DECNET is not set
293CONFIG_LLC=y
294# CONFIG_LLC2 is not set
295# CONFIG_IPX is not set
296# CONFIG_ATALK is not set
297# CONFIG_X25 is not set
298# CONFIG_LAPB is not set
299# CONFIG_NET_DIVERT is not set
300# CONFIG_ECONET is not set
301# CONFIG_WAN_ROUTER is not set
302# CONFIG_NET_SCHED is not set
303CONFIG_NET_CLS_ROUTE=y
304
305#
306# Network testing
307#
308# CONFIG_NET_PKTGEN is not set
309# CONFIG_HAMRADIO is not set
310# CONFIG_IRDA is not set
311# CONFIG_BT is not set
312# CONFIG_IEEE80211 is not set
313
314#
315# Device Drivers
316#
317
318#
319# Generic Driver Options
320#
321CONFIG_STANDALONE=y
322CONFIG_PREVENT_FIRMWARE_BUILD=y
323CONFIG_FW_LOADER=y
324# CONFIG_DEBUG_DRIVER is not set
325
326#
327# Connector - unified userspace <-> kernelspace linker
328#
329# CONFIG_CONNECTOR is not set
330
331#
332# Memory Technology Devices (MTD)
333#
334# CONFIG_MTD is not set
335
336#
337# Parallel port support
338#
339CONFIG_PARPORT=m
340CONFIG_PARPORT_PC=m
341# CONFIG_PARPORT_SERIAL is not set
342# CONFIG_PARPORT_PC_FIFO is not set
343# CONFIG_PARPORT_PC_SUPERIO is not set
344# CONFIG_PARPORT_GSC is not set
345# CONFIG_PARPORT_1284 is not set
346
347#
348# Plug and Play support
349#
350
351#
352# Block devices
353#
354CONFIG_BLK_DEV_FD=m
355# CONFIG_PARIDE is not set
356# CONFIG_BLK_CPQ_DA is not set
357# CONFIG_BLK_CPQ_CISS_DA is not set
358# CONFIG_BLK_DEV_DAC960 is not set
359# CONFIG_BLK_DEV_UMEM is not set
360# CONFIG_BLK_DEV_COW_COMMON is not set
361CONFIG_BLK_DEV_LOOP=y
362# CONFIG_BLK_DEV_CRYPTOLOOP is not set
363CONFIG_BLK_DEV_NBD=m
364# CONFIG_BLK_DEV_SX8 is not set
365# CONFIG_BLK_DEV_UB is not set
366CONFIG_BLK_DEV_RAM=y
367CONFIG_BLK_DEV_RAM_COUNT=16
368CONFIG_BLK_DEV_RAM_SIZE=65536
369CONFIG_BLK_DEV_INITRD=y
370# CONFIG_CDROM_PKTCDVD is not set
371
372#
373# IO Schedulers
374#
375CONFIG_IOSCHED_NOOP=y
376CONFIG_IOSCHED_AS=y
377CONFIG_IOSCHED_DEADLINE=y
378CONFIG_IOSCHED_CFQ=y
379# CONFIG_ATA_OVER_ETH is not set
380
381#
382# ATA/ATAPI/MFM/RLL support
383#
384CONFIG_IDE=y
385CONFIG_BLK_DEV_IDE=y
386
387#
388# Please see Documentation/ide.txt for help/info on IDE drives
389#
390# CONFIG_BLK_DEV_IDE_SATA is not set
391CONFIG_BLK_DEV_IDEDISK=y
392# CONFIG_IDEDISK_MULTI_MODE is not set
393CONFIG_BLK_DEV_IDECD=y
394# CONFIG_BLK_DEV_IDETAPE is not set
395# CONFIG_BLK_DEV_IDEFLOPPY is not set
396# CONFIG_BLK_DEV_IDESCSI is not set
397# CONFIG_IDE_TASK_IOCTL is not set
398
399#
400# IDE chipset support/bugfixes
401#
402CONFIG_IDE_GENERIC=y
403CONFIG_BLK_DEV_IDEPCI=y
404CONFIG_IDEPCI_SHARE_IRQ=y
405# CONFIG_BLK_DEV_OFFBOARD is not set
406CONFIG_BLK_DEV_GENERIC=y
407# CONFIG_BLK_DEV_OPTI621 is not set
408CONFIG_BLK_DEV_SL82C105=y
409CONFIG_BLK_DEV_IDEDMA_PCI=y
410# CONFIG_BLK_DEV_IDEDMA_FORCED is not set
411CONFIG_IDEDMA_PCI_AUTO=y
412# CONFIG_IDEDMA_ONLYDISK is not set
413# CONFIG_BLK_DEV_AEC62XX is not set
414# CONFIG_BLK_DEV_ALI15X3 is not set
415CONFIG_BLK_DEV_AMD74XX=y
416# CONFIG_BLK_DEV_CMD64X is not set
417# CONFIG_BLK_DEV_TRIFLEX is not set
418# CONFIG_BLK_DEV_CY82C693 is not set
419# CONFIG_BLK_DEV_CS5520 is not set
420# CONFIG_BLK_DEV_CS5530 is not set
421# CONFIG_BLK_DEV_HPT34X is not set
422# CONFIG_BLK_DEV_HPT366 is not set
423# CONFIG_BLK_DEV_SC1200 is not set
424# CONFIG_BLK_DEV_PIIX is not set
425# CONFIG_BLK_DEV_IT821X is not set
426# CONFIG_BLK_DEV_NS87415 is not set
427# CONFIG_BLK_DEV_PDC202XX_OLD is not set
428# CONFIG_BLK_DEV_PDC202XX_NEW is not set
429# CONFIG_BLK_DEV_SVWKS is not set
430# CONFIG_BLK_DEV_SIIMAGE is not set
431# CONFIG_BLK_DEV_SLC90E66 is not set
432# CONFIG_BLK_DEV_TRM290 is not set
433# CONFIG_BLK_DEV_VIA82CXXX is not set
434# CONFIG_IDE_ARM is not set
435CONFIG_BLK_DEV_IDEDMA=y
436# CONFIG_IDEDMA_IVB is not set
437CONFIG_IDEDMA_AUTO=y
438# CONFIG_BLK_DEV_HD is not set
439
440#
441# SCSI device support
442#
443# CONFIG_RAID_ATTRS is not set
444CONFIG_SCSI=y
445CONFIG_SCSI_PROC_FS=y
446
447#
448# SCSI support type (disk, tape, CD-ROM)
449#
450CONFIG_BLK_DEV_SD=y
451CONFIG_CHR_DEV_ST=y
452# CONFIG_CHR_DEV_OSST is not set
453CONFIG_BLK_DEV_SR=y
454CONFIG_BLK_DEV_SR_VENDOR=y
455CONFIG_CHR_DEV_SG=y
456# CONFIG_CHR_DEV_SCH is not set
457
458#
459# Some SCSI devices (e.g. CD jukebox) support multiple LUNs
460#
461CONFIG_SCSI_MULTI_LUN=y
462CONFIG_SCSI_CONSTANTS=y
463# CONFIG_SCSI_LOGGING is not set
464
465#
466# SCSI Transport Attributes
467#
468CONFIG_SCSI_SPI_ATTRS=y
469CONFIG_SCSI_FC_ATTRS=y
470CONFIG_SCSI_ISCSI_ATTRS=m
471# CONFIG_SCSI_SAS_ATTRS is not set
472
473#
474# SCSI low-level drivers
475#
476# CONFIG_BLK_DEV_3W_XXXX_RAID is not set
477# CONFIG_SCSI_3W_9XXX is not set
478# CONFIG_SCSI_ACARD is not set
479# CONFIG_SCSI_AACRAID is not set
480# CONFIG_SCSI_AIC7XXX is not set
481# CONFIG_SCSI_AIC7XXX_OLD is not set
482# CONFIG_SCSI_AIC79XX is not set
483# CONFIG_MEGARAID_NEWGEN is not set
484# CONFIG_MEGARAID_LEGACY is not set
485# CONFIG_MEGARAID_SAS is not set
486# CONFIG_SCSI_SATA is not set
487# CONFIG_SCSI_BUSLOGIC is not set
488# CONFIG_SCSI_DMX3191D is not set
489# CONFIG_SCSI_EATA is not set
490# CONFIG_SCSI_FUTURE_DOMAIN is not set
491# CONFIG_SCSI_GDTH is not set
492# CONFIG_SCSI_IPS is not set
493CONFIG_SCSI_IBMVSCSI=y
494# CONFIG_SCSI_INITIO is not set
495# CONFIG_SCSI_INIA100 is not set
496# CONFIG_SCSI_PPA is not set
497# CONFIG_SCSI_IMM is not set
498CONFIG_SCSI_SYM53C8XX_2=y
499CONFIG_SCSI_SYM53C8XX_DMA_ADDRESSING_MODE=0
500CONFIG_SCSI_SYM53C8XX_DEFAULT_TAGS=16
501CONFIG_SCSI_SYM53C8XX_MAX_TAGS=64
502# CONFIG_SCSI_SYM53C8XX_IOMAPPED is not set
503CONFIG_SCSI_IPR=y
504CONFIG_SCSI_IPR_TRACE=y
505CONFIG_SCSI_IPR_DUMP=y
506# CONFIG_SCSI_QLOGIC_FC is not set
507# CONFIG_SCSI_QLOGIC_1280 is not set
508CONFIG_SCSI_QLA2XXX=y
509CONFIG_SCSI_QLA21XX=m
510CONFIG_SCSI_QLA22XX=m
511CONFIG_SCSI_QLA2300=m
512CONFIG_SCSI_QLA2322=m
513CONFIG_SCSI_QLA6312=m
514CONFIG_SCSI_QLA24XX=m
515CONFIG_SCSI_LPFC=m
516# CONFIG_SCSI_DC395x is not set
517# CONFIG_SCSI_DC390T is not set
518# CONFIG_SCSI_DEBUG is not set
519
520#
521# Multi-device support (RAID and LVM)
522#
523CONFIG_MD=y
524CONFIG_BLK_DEV_MD=y
525CONFIG_MD_LINEAR=y
526CONFIG_MD_RAID0=y
527CONFIG_MD_RAID1=y
528CONFIG_MD_RAID10=m
529CONFIG_MD_RAID5=y
530CONFIG_MD_RAID6=m
531CONFIG_MD_MULTIPATH=m
532CONFIG_MD_FAULTY=m
533CONFIG_BLK_DEV_DM=y
534CONFIG_DM_CRYPT=m
535CONFIG_DM_SNAPSHOT=m
536CONFIG_DM_MIRROR=m
537CONFIG_DM_ZERO=m
538CONFIG_DM_MULTIPATH=m
539CONFIG_DM_MULTIPATH_EMC=m
540
541#
542# Fusion MPT device support
543#
544# CONFIG_FUSION is not set
545# CONFIG_FUSION_SPI is not set
546# CONFIG_FUSION_FC is not set
547# CONFIG_FUSION_SAS is not set
548
549#
550# IEEE 1394 (FireWire) support
551#
552# CONFIG_IEEE1394 is not set
553
554#
555# I2O device support
556#
557# CONFIG_I2O is not set
558
559#
560# Macintosh device drivers
561#
562
563#
564# Network device support
565#
566CONFIG_NETDEVICES=y
567CONFIG_DUMMY=m
568CONFIG_BONDING=m
569# CONFIG_EQUALIZER is not set
570CONFIG_TUN=m
571
572#
573# ARCnet devices
574#
575# CONFIG_ARCNET is not set
576
577#
578# PHY device support
579#
580# CONFIG_PHYLIB is not set
581
582#
583# Ethernet (10 or 100Mbit)
584#
585CONFIG_NET_ETHERNET=y
586CONFIG_MII=y
587# CONFIG_HAPPYMEAL is not set
588# CONFIG_SUNGEM is not set
589# CONFIG_CASSINI is not set
590CONFIG_NET_VENDOR_3COM=y
591CONFIG_VORTEX=y
592# CONFIG_TYPHOON is not set
593
594#
595# Tulip family network device support
596#
597# CONFIG_NET_TULIP is not set
598# CONFIG_HP100 is not set
599CONFIG_IBMVETH=y
600CONFIG_NET_PCI=y
601CONFIG_PCNET32=y
602# CONFIG_AMD8111_ETH is not set
603# CONFIG_ADAPTEC_STARFIRE is not set
604# CONFIG_B44 is not set
605# CONFIG_FORCEDETH is not set
606# CONFIG_DGRS is not set
607# CONFIG_EEPRO100 is not set
608CONFIG_E100=y
609# CONFIG_FEALNX is not set
610# CONFIG_NATSEMI is not set
611# CONFIG_NE2K_PCI is not set
612# CONFIG_8139CP is not set
613# CONFIG_8139TOO is not set
614# CONFIG_SIS900 is not set
615# CONFIG_EPIC100 is not set
616# CONFIG_SUNDANCE is not set
617# CONFIG_VIA_RHINE is not set
618# CONFIG_NET_POCKET is not set
619
620#
621# Ethernet (1000 Mbit)
622#
623CONFIG_ACENIC=y
624CONFIG_ACENIC_OMIT_TIGON_I=y
625# CONFIG_DL2K is not set
626CONFIG_E1000=y
627# CONFIG_E1000_NAPI is not set
628# CONFIG_NS83820 is not set
629# CONFIG_HAMACHI is not set
630# CONFIG_YELLOWFIN is not set
631# CONFIG_R8169 is not set
632# CONFIG_SIS190 is not set
633# CONFIG_SKGE is not set
634# CONFIG_SK98LIN is not set
635# CONFIG_VIA_VELOCITY is not set
636CONFIG_TIGON3=y
637# CONFIG_BNX2 is not set
638# CONFIG_MV643XX_ETH is not set
639
640#
641# Ethernet (10000 Mbit)
642#
643# CONFIG_CHELSIO_T1 is not set
644CONFIG_IXGB=m
645# CONFIG_IXGB_NAPI is not set
646CONFIG_S2IO=m
647# CONFIG_S2IO_NAPI is not set
648# CONFIG_2BUFF_MODE is not set
649
650#
651# Token Ring devices
652#
653CONFIG_TR=y
654CONFIG_IBMOL=y
655# CONFIG_3C359 is not set
656# CONFIG_TMS380TR is not set
657
658#
659# Wireless LAN (non-hamradio)
660#
661# CONFIG_NET_RADIO is not set
662
663#
664# Wan interfaces
665#
666# CONFIG_WAN is not set
667# CONFIG_FDDI is not set
668# CONFIG_HIPPI is not set
669# CONFIG_PLIP is not set
670CONFIG_PPP=m
671# CONFIG_PPP_MULTILINK is not set
672# CONFIG_PPP_FILTER is not set
673CONFIG_PPP_ASYNC=m
674CONFIG_PPP_SYNC_TTY=m
675CONFIG_PPP_DEFLATE=m
676CONFIG_PPP_BSDCOMP=m
677CONFIG_PPPOE=m
678# CONFIG_SLIP is not set
679# CONFIG_NET_FC is not set
680# CONFIG_SHAPER is not set
681CONFIG_NETCONSOLE=y
682CONFIG_NETPOLL=y
683CONFIG_NETPOLL_RX=y
684CONFIG_NETPOLL_TRAP=y
685CONFIG_NET_POLL_CONTROLLER=y
686
687#
688# ISDN subsystem
689#
690# CONFIG_ISDN is not set
691
692#
693# Telephony Support
694#
695# CONFIG_PHONE is not set
696
697#
698# Input device support
699#
700CONFIG_INPUT=y
701
702#
703# Userland interfaces
704#
705CONFIG_INPUT_MOUSEDEV=y
706# CONFIG_INPUT_MOUSEDEV_PSAUX is not set
707CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024
708CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768
709# CONFIG_INPUT_JOYDEV is not set
710# CONFIG_INPUT_TSDEV is not set
711# CONFIG_INPUT_EVDEV is not set
712# CONFIG_INPUT_EVBUG is not set
713
714#
715# Input Device Drivers
716#
717CONFIG_INPUT_KEYBOARD=y
718CONFIG_KEYBOARD_ATKBD=y
719# CONFIG_KEYBOARD_SUNKBD is not set
720# CONFIG_KEYBOARD_LKKBD is not set
721# CONFIG_KEYBOARD_XTKBD is not set
722# CONFIG_KEYBOARD_NEWTON is not set
723CONFIG_INPUT_MOUSE=y
724CONFIG_MOUSE_PS2=y
725# CONFIG_MOUSE_SERIAL is not set
726# CONFIG_MOUSE_VSXXXAA is not set
727# CONFIG_INPUT_JOYSTICK is not set
728# CONFIG_INPUT_TOUCHSCREEN is not set
729CONFIG_INPUT_MISC=y
730CONFIG_INPUT_PCSPKR=m
731# CONFIG_INPUT_UINPUT is not set
732
733#
734# Hardware I/O ports
735#
736CONFIG_SERIO=y
737CONFIG_SERIO_I8042=y
738# CONFIG_SERIO_SERPORT is not set
739# CONFIG_SERIO_PARKBD is not set
740# CONFIG_SERIO_PCIPS2 is not set
741CONFIG_SERIO_LIBPS2=y
742# CONFIG_SERIO_RAW is not set
743# CONFIG_GAMEPORT is not set
744
745#
746# Character devices
747#
748CONFIG_VT=y
749CONFIG_VT_CONSOLE=y
750CONFIG_HW_CONSOLE=y
751# CONFIG_SERIAL_NONSTANDARD is not set
752
753#
754# Serial drivers
755#
756CONFIG_SERIAL_8250=y
757CONFIG_SERIAL_8250_CONSOLE=y
758CONFIG_SERIAL_8250_NR_UARTS=4
759# CONFIG_SERIAL_8250_EXTENDED is not set
760
761#
762# Non-8250 serial port support
763#
764CONFIG_SERIAL_CORE=y
765CONFIG_SERIAL_CORE_CONSOLE=y
766CONFIG_SERIAL_ICOM=m
767# CONFIG_SERIAL_JSM is not set
768CONFIG_UNIX98_PTYS=y
769CONFIG_LEGACY_PTYS=y
770CONFIG_LEGACY_PTY_COUNT=256
771# CONFIG_PRINTER is not set
772# CONFIG_PPDEV is not set
773# CONFIG_TIPAR is not set
774CONFIG_HVC_CONSOLE=y
775CONFIG_HVCS=m
776
777#
778# IPMI
779#
780# CONFIG_IPMI_HANDLER is not set
781
782#
783# Watchdog Cards
784#
785# CONFIG_WATCHDOG is not set
786# CONFIG_RTC is not set
787# CONFIG_DTLK is not set
788# CONFIG_R3964 is not set
789# CONFIG_APPLICOM is not set
790
791#
792# Ftape, the floppy tape device driver
793#
794# CONFIG_AGP is not set
795# CONFIG_DRM is not set
796CONFIG_RAW_DRIVER=y
797CONFIG_MAX_RAW_DEVS=1024
798# CONFIG_HANGCHECK_TIMER is not set
799
800#
801# TPM devices
802#
803# CONFIG_TCG_TPM is not set
804
805#
806# I2C support
807#
808CONFIG_I2C=y
809# CONFIG_I2C_CHARDEV is not set
810
811#
812# I2C Algorithms
813#
814CONFIG_I2C_ALGOBIT=y
815# CONFIG_I2C_ALGOPCF is not set
816# CONFIG_I2C_ALGOPCA is not set
817
818#
819# I2C Hardware Bus support
820#
821# CONFIG_I2C_ALI1535 is not set
822# CONFIG_I2C_ALI1563 is not set
823# CONFIG_I2C_ALI15X3 is not set
824# CONFIG_I2C_AMD756 is not set
825# CONFIG_I2C_AMD8111 is not set
826# CONFIG_I2C_I801 is not set
827# CONFIG_I2C_I810 is not set
828# CONFIG_I2C_PIIX4 is not set
829# CONFIG_I2C_NFORCE2 is not set
830# CONFIG_I2C_PARPORT is not set
831# CONFIG_I2C_PARPORT_LIGHT is not set
832# CONFIG_I2C_PROSAVAGE is not set
833# CONFIG_I2C_SAVAGE4 is not set
834# CONFIG_SCx200_ACB is not set
835# CONFIG_I2C_SIS5595 is not set
836# CONFIG_I2C_SIS630 is not set
837# CONFIG_I2C_SIS96X is not set
838# CONFIG_I2C_STUB is not set
839# CONFIG_I2C_VIA is not set
840# CONFIG_I2C_VIAPRO is not set
841# CONFIG_I2C_VOODOO3 is not set
842# CONFIG_I2C_PCA_ISA is not set
843
844#
845# Miscellaneous I2C Chip support
846#
847# CONFIG_SENSORS_DS1337 is not set
848# CONFIG_SENSORS_DS1374 is not set
849# CONFIG_SENSORS_EEPROM is not set
850# CONFIG_SENSORS_PCF8574 is not set
851# CONFIG_SENSORS_PCA9539 is not set
852# CONFIG_SENSORS_PCF8591 is not set
853# CONFIG_SENSORS_RTC8564 is not set
854# CONFIG_SENSORS_MAX6875 is not set
855# CONFIG_I2C_DEBUG_CORE is not set
856# CONFIG_I2C_DEBUG_ALGO is not set
857# CONFIG_I2C_DEBUG_BUS is not set
858# CONFIG_I2C_DEBUG_CHIP is not set
859
860#
861# Dallas's 1-wire bus
862#
863# CONFIG_W1 is not set
864
865#
866# Hardware Monitoring support
867#
868# CONFIG_HWMON is not set
869# CONFIG_HWMON_VID is not set
870
871#
872# Misc devices
873#
874
875#
876# Multimedia Capabilities Port drivers
877#
878
879#
880# Multimedia devices
881#
882# CONFIG_VIDEO_DEV is not set
883
884#
885# Digital Video Broadcasting Devices
886#
887# CONFIG_DVB is not set
888
889#
890# Graphics support
891#
892CONFIG_FB=y
893CONFIG_FB_CFB_FILLRECT=y
894CONFIG_FB_CFB_COPYAREA=y
895CONFIG_FB_CFB_IMAGEBLIT=y
896CONFIG_FB_SOFT_CURSOR=y
897CONFIG_FB_MACMODES=y
898CONFIG_FB_MODE_HELPERS=y
899CONFIG_FB_TILEBLITTING=y
900# CONFIG_FB_CIRRUS is not set
901# CONFIG_FB_PM2 is not set
902# CONFIG_FB_CYBER2000 is not set
903CONFIG_FB_OF=y
904# CONFIG_FB_CT65550 is not set
905# CONFIG_FB_ASILIANT is not set
906# CONFIG_FB_IMSTT is not set
907# CONFIG_FB_VGA16 is not set
908# CONFIG_FB_NVIDIA is not set
909# CONFIG_FB_RIVA is not set
910CONFIG_FB_MATROX=y
911CONFIG_FB_MATROX_MILLENIUM=y
912CONFIG_FB_MATROX_MYSTIQUE=y
913CONFIG_FB_MATROX_G=y
914# CONFIG_FB_MATROX_I2C is not set
915CONFIG_FB_MATROX_MULTIHEAD=y
916# CONFIG_FB_RADEON_OLD is not set
917CONFIG_FB_RADEON=y
918CONFIG_FB_RADEON_I2C=y
919# CONFIG_FB_RADEON_DEBUG is not set
920# CONFIG_FB_ATY128 is not set
921# CONFIG_FB_ATY is not set
922# CONFIG_FB_SAVAGE is not set
923# CONFIG_FB_SIS is not set
924# CONFIG_FB_NEOMAGIC is not set
925# CONFIG_FB_KYRO is not set
926# CONFIG_FB_3DFX is not set
927# CONFIG_FB_VOODOO1 is not set
928# CONFIG_FB_CYBLA is not set
929# CONFIG_FB_TRIDENT is not set
930# CONFIG_FB_S1D13XXX is not set
931# CONFIG_FB_VIRTUAL is not set
932
933#
934# Console display driver support
935#
936# CONFIG_VGA_CONSOLE is not set
937CONFIG_DUMMY_CONSOLE=y
938CONFIG_FRAMEBUFFER_CONSOLE=y
939# CONFIG_FONTS is not set
940CONFIG_FONT_8x8=y
941CONFIG_FONT_8x16=y
942
943#
944# Logo configuration
945#
946CONFIG_LOGO=y
947CONFIG_LOGO_LINUX_MONO=y
948CONFIG_LOGO_LINUX_VGA16=y
949CONFIG_LOGO_LINUX_CLUT224=y
950CONFIG_BACKLIGHT_LCD_SUPPORT=y
951CONFIG_BACKLIGHT_CLASS_DEVICE=m
952CONFIG_BACKLIGHT_DEVICE=y
953CONFIG_LCD_CLASS_DEVICE=m
954CONFIG_LCD_DEVICE=y
955
956#
957# Sound
958#
959# CONFIG_SOUND is not set
960
961#
962# USB support
963#
964CONFIG_USB_ARCH_HAS_HCD=y
965CONFIG_USB_ARCH_HAS_OHCI=y
966CONFIG_USB=y
967# CONFIG_USB_DEBUG is not set
968
969#
970# Miscellaneous USB options
971#
972CONFIG_USB_DEVICEFS=y
973# CONFIG_USB_BANDWIDTH is not set
974# CONFIG_USB_DYNAMIC_MINORS is not set
975# CONFIG_USB_OTG is not set
976
977#
978# USB Host Controller Drivers
979#
980CONFIG_USB_EHCI_HCD=y
981# CONFIG_USB_EHCI_SPLIT_ISO is not set
982# CONFIG_USB_EHCI_ROOT_HUB_TT is not set
983# CONFIG_USB_ISP116X_HCD is not set
984CONFIG_USB_OHCI_HCD=y
985# CONFIG_USB_OHCI_BIG_ENDIAN is not set
986CONFIG_USB_OHCI_LITTLE_ENDIAN=y
987# CONFIG_USB_UHCI_HCD is not set
988# CONFIG_USB_SL811_HCD is not set
989
990#
991# USB Device Class drivers
992#
993# CONFIG_USB_BLUETOOTH_TTY is not set
994# CONFIG_USB_ACM is not set
995# CONFIG_USB_PRINTER is not set
996
997#
998# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support' may also be needed; see USB_STORAGE Help for more information
999#
1000CONFIG_USB_STORAGE=y
1001# CONFIG_USB_STORAGE_DEBUG is not set
1002# CONFIG_USB_STORAGE_DATAFAB is not set
1003# CONFIG_USB_STORAGE_FREECOM is not set
1004# CONFIG_USB_STORAGE_ISD200 is not set
1005# CONFIG_USB_STORAGE_DPCM is not set
1006# CONFIG_USB_STORAGE_USBAT is not set
1007# CONFIG_USB_STORAGE_SDDR09 is not set
1008# CONFIG_USB_STORAGE_SDDR55 is not set
1009# CONFIG_USB_STORAGE_JUMPSHOT is not set
1010
1011#
1012# USB Input Devices
1013#
1014CONFIG_USB_HID=y
1015CONFIG_USB_HIDINPUT=y
1016# CONFIG_HID_FF is not set
1017CONFIG_USB_HIDDEV=y
1018# CONFIG_USB_AIPTEK is not set
1019# CONFIG_USB_WACOM is not set
1020# CONFIG_USB_ACECAD is not set
1021# CONFIG_USB_KBTAB is not set
1022# CONFIG_USB_POWERMATE is not set
1023# CONFIG_USB_MTOUCH is not set
1024# CONFIG_USB_ITMTOUCH is not set
1025# CONFIG_USB_EGALAX is not set
1026# CONFIG_USB_YEALINK is not set
1027# CONFIG_USB_XPAD is not set
1028# CONFIG_USB_ATI_REMOTE is not set
1029# CONFIG_USB_KEYSPAN_REMOTE is not set
1030# CONFIG_USB_APPLETOUCH is not set
1031
1032#
1033# USB Imaging devices
1034#
1035# CONFIG_USB_MDC800 is not set
1036# CONFIG_USB_MICROTEK is not set
1037
1038#
1039# USB Multimedia devices
1040#
1041# CONFIG_USB_DABUSB is not set
1042
1043#
1044# Video4Linux support is needed for USB Multimedia device support
1045#
1046
1047#
1048# USB Network Adapters
1049#
1050# CONFIG_USB_CATC is not set
1051# CONFIG_USB_KAWETH is not set
1052# CONFIG_USB_PEGASUS is not set
1053# CONFIG_USB_RTL8150 is not set
1054# CONFIG_USB_USBNET is not set
1055CONFIG_USB_MON=y
1056
1057#
1058# USB port drivers
1059#
1060# CONFIG_USB_USS720 is not set
1061
1062#
1063# USB Serial Converter support
1064#
1065# CONFIG_USB_SERIAL is not set
1066
1067#
1068# USB Miscellaneous drivers
1069#
1070# CONFIG_USB_EMI62 is not set
1071# CONFIG_USB_EMI26 is not set
1072# CONFIG_USB_AUERSWALD is not set
1073# CONFIG_USB_RIO500 is not set
1074# CONFIG_USB_LEGOTOWER is not set
1075# CONFIG_USB_LCD is not set
1076# CONFIG_USB_LED is not set
1077# CONFIG_USB_CYTHERM is not set
1078# CONFIG_USB_PHIDGETKIT is not set
1079# CONFIG_USB_PHIDGETSERVO is not set
1080# CONFIG_USB_IDMOUSE is not set
1081# CONFIG_USB_SISUSBVGA is not set
1082# CONFIG_USB_LD is not set
1083# CONFIG_USB_TEST is not set
1084
1085#
1086# USB DSL modem support
1087#
1088
1089#
1090# USB Gadget Support
1091#
1092# CONFIG_USB_GADGET is not set
1093
1094#
1095# MMC/SD Card support
1096#
1097# CONFIG_MMC is not set
1098
1099#
1100# InfiniBand support
1101#
1102CONFIG_INFINIBAND=m
1103# CONFIG_INFINIBAND_USER_MAD is not set
1104# CONFIG_INFINIBAND_USER_ACCESS is not set
1105CONFIG_INFINIBAND_MTHCA=m
1106# CONFIG_INFINIBAND_MTHCA_DEBUG is not set
1107CONFIG_INFINIBAND_IPOIB=m
1108# CONFIG_INFINIBAND_IPOIB_DEBUG is not set
1109
1110#
1111# SN Devices
1112#
1113
1114#
1115# File systems
1116#
1117CONFIG_EXT2_FS=y
1118CONFIG_EXT2_FS_XATTR=y
1119CONFIG_EXT2_FS_POSIX_ACL=y
1120CONFIG_EXT2_FS_SECURITY=y
1121CONFIG_EXT2_FS_XIP=y
1122CONFIG_FS_XIP=y
1123CONFIG_EXT3_FS=y
1124CONFIG_EXT3_FS_XATTR=y
1125CONFIG_EXT3_FS_POSIX_ACL=y
1126CONFIG_EXT3_FS_SECURITY=y
1127CONFIG_JBD=y
1128# CONFIG_JBD_DEBUG is not set
1129CONFIG_FS_MBCACHE=y
1130CONFIG_REISERFS_FS=y
1131# CONFIG_REISERFS_CHECK is not set
1132# CONFIG_REISERFS_PROC_INFO is not set
1133CONFIG_REISERFS_FS_XATTR=y
1134CONFIG_REISERFS_FS_POSIX_ACL=y
1135CONFIG_REISERFS_FS_SECURITY=y
1136CONFIG_JFS_FS=m
1137CONFIG_JFS_POSIX_ACL=y
1138CONFIG_JFS_SECURITY=y
1139# CONFIG_JFS_DEBUG is not set
1140# CONFIG_JFS_STATISTICS is not set
1141CONFIG_FS_POSIX_ACL=y
1142CONFIG_XFS_FS=m
1143CONFIG_XFS_EXPORT=y
1144# CONFIG_XFS_QUOTA is not set
1145CONFIG_XFS_SECURITY=y
1146CONFIG_XFS_POSIX_ACL=y
1147# CONFIG_XFS_RT is not set
1148# CONFIG_MINIX_FS is not set
1149# CONFIG_ROMFS_FS is not set
1150CONFIG_INOTIFY=y
1151# CONFIG_QUOTA is not set
1152CONFIG_DNOTIFY=y
1153CONFIG_AUTOFS_FS=m
1154# CONFIG_AUTOFS4_FS is not set
1155# CONFIG_FUSE_FS is not set
1156
1157#
1158# CD-ROM/DVD Filesystems
1159#
1160CONFIG_ISO9660_FS=y
1161CONFIG_JOLIET=y
1162CONFIG_ZISOFS=y
1163CONFIG_ZISOFS_FS=y
1164CONFIG_UDF_FS=m
1165CONFIG_UDF_NLS=y
1166
1167#
1168# DOS/FAT/NT Filesystems
1169#
1170CONFIG_FAT_FS=y
1171CONFIG_MSDOS_FS=y
1172CONFIG_VFAT_FS=y
1173CONFIG_FAT_DEFAULT_CODEPAGE=437
1174CONFIG_FAT_DEFAULT_IOCHARSET="iso8859-1"
1175# CONFIG_NTFS_FS is not set
1176
1177#
1178# Pseudo filesystems
1179#
1180CONFIG_PROC_FS=y
1181CONFIG_PROC_KCORE=y
1182CONFIG_SYSFS=y
1183CONFIG_TMPFS=y
1184CONFIG_HUGETLBFS=y
1185CONFIG_HUGETLB_PAGE=y
1186CONFIG_RAMFS=y
1187# CONFIG_RELAYFS_FS is not set
1188
1189#
1190# Miscellaneous filesystems
1191#
1192# CONFIG_ADFS_FS is not set
1193# CONFIG_AFFS_FS is not set
1194# CONFIG_HFS_FS is not set
1195# CONFIG_HFSPLUS_FS is not set
1196# CONFIG_BEFS_FS is not set
1197# CONFIG_BFS_FS is not set
1198# CONFIG_EFS_FS is not set
1199CONFIG_CRAMFS=y
1200# CONFIG_VXFS_FS is not set
1201# CONFIG_HPFS_FS is not set
1202# CONFIG_QNX4FS_FS is not set
1203# CONFIG_SYSV_FS is not set
1204# CONFIG_UFS_FS is not set
1205
1206#
1207# Network File Systems
1208#
1209CONFIG_NFS_FS=y
1210CONFIG_NFS_V3=y
1211CONFIG_NFS_V3_ACL=y
1212CONFIG_NFS_V4=y
1213# CONFIG_NFS_DIRECTIO is not set
1214CONFIG_NFSD=y
1215CONFIG_NFSD_V2_ACL=y
1216CONFIG_NFSD_V3=y
1217CONFIG_NFSD_V3_ACL=y
1218CONFIG_NFSD_V4=y
1219CONFIG_NFSD_TCP=y
1220CONFIG_LOCKD=y
1221CONFIG_LOCKD_V4=y
1222CONFIG_EXPORTFS=y
1223CONFIG_NFS_ACL_SUPPORT=y
1224CONFIG_NFS_COMMON=y
1225CONFIG_SUNRPC=y
1226CONFIG_SUNRPC_GSS=y
1227CONFIG_RPCSEC_GSS_KRB5=y
1228CONFIG_RPCSEC_GSS_SPKM3=m
1229# CONFIG_SMB_FS is not set
1230CONFIG_CIFS=m
1231# CONFIG_CIFS_STATS is not set
1232CONFIG_CIFS_XATTR=y
1233CONFIG_CIFS_POSIX=y
1234# CONFIG_CIFS_EXPERIMENTAL is not set
1235# CONFIG_NCP_FS is not set
1236# CONFIG_CODA_FS is not set
1237# CONFIG_AFS_FS is not set
1238# CONFIG_9P_FS is not set
1239
1240#
1241# Partition Types
1242#
1243# CONFIG_PARTITION_ADVANCED is not set
1244CONFIG_MSDOS_PARTITION=y
1245
1246#
1247# Native Language Support
1248#
1249CONFIG_NLS=y
1250CONFIG_NLS_DEFAULT="iso8859-1"
1251CONFIG_NLS_CODEPAGE_437=y
1252# CONFIG_NLS_CODEPAGE_737 is not set
1253# CONFIG_NLS_CODEPAGE_775 is not set
1254# CONFIG_NLS_CODEPAGE_850 is not set
1255# CONFIG_NLS_CODEPAGE_852 is not set
1256# CONFIG_NLS_CODEPAGE_855 is not set
1257# CONFIG_NLS_CODEPAGE_857 is not set
1258# CONFIG_NLS_CODEPAGE_860 is not set
1259# CONFIG_NLS_CODEPAGE_861 is not set
1260# CONFIG_NLS_CODEPAGE_862 is not set
1261# CONFIG_NLS_CODEPAGE_863 is not set
1262# CONFIG_NLS_CODEPAGE_864 is not set
1263# CONFIG_NLS_CODEPAGE_865 is not set
1264# CONFIG_NLS_CODEPAGE_866 is not set
1265# CONFIG_NLS_CODEPAGE_869 is not set
1266# CONFIG_NLS_CODEPAGE_936 is not set
1267# CONFIG_NLS_CODEPAGE_950 is not set
1268# CONFIG_NLS_CODEPAGE_932 is not set
1269# CONFIG_NLS_CODEPAGE_949 is not set
1270# CONFIG_NLS_CODEPAGE_874 is not set
1271# CONFIG_NLS_ISO8859_8 is not set
1272# CONFIG_NLS_CODEPAGE_1250 is not set
1273# CONFIG_NLS_CODEPAGE_1251 is not set
1274CONFIG_NLS_ASCII=y
1275CONFIG_NLS_ISO8859_1=y
1276# CONFIG_NLS_ISO8859_2 is not set
1277# CONFIG_NLS_ISO8859_3 is not set
1278# CONFIG_NLS_ISO8859_4 is not set
1279# CONFIG_NLS_ISO8859_5 is not set
1280# CONFIG_NLS_ISO8859_6 is not set
1281# CONFIG_NLS_ISO8859_7 is not set
1282# CONFIG_NLS_ISO8859_9 is not set
1283# CONFIG_NLS_ISO8859_13 is not set
1284# CONFIG_NLS_ISO8859_14 is not set
1285# CONFIG_NLS_ISO8859_15 is not set
1286# CONFIG_NLS_KOI8_R is not set
1287# CONFIG_NLS_KOI8_U is not set
1288# CONFIG_NLS_UTF8 is not set
1289
1290#
1291# Profiling support
1292#
1293CONFIG_PROFILING=y
1294CONFIG_OPROFILE=y
1295
1296#
1297# Kernel hacking
1298#
1299# CONFIG_PRINTK_TIME is not set
1300CONFIG_DEBUG_KERNEL=y
1301CONFIG_MAGIC_SYSRQ=y
1302CONFIG_LOG_BUF_SHIFT=17
1303CONFIG_DETECT_SOFTLOCKUP=y
1304# CONFIG_SCHEDSTATS is not set
1305# CONFIG_DEBUG_SLAB is not set
1306# CONFIG_DEBUG_SPINLOCK is not set
1307# CONFIG_DEBUG_SPINLOCK_SLEEP is not set
1308# CONFIG_DEBUG_KOBJECT is not set
1309# CONFIG_DEBUG_INFO is not set
1310CONFIG_DEBUG_FS=y
1311CONFIG_DEBUG_STACKOVERFLOW=y
1312# CONFIG_KPROBES is not set
1313CONFIG_DEBUG_STACK_USAGE=y
1314CONFIG_DEBUGGER=y
1315CONFIG_XMON=y
1316CONFIG_XMON_DEFAULT=y
1317# CONFIG_PPCDBG is not set
1318CONFIG_IRQSTACKS=y
1319
1320#
1321# Security options
1322#
1323# CONFIG_KEYS is not set
1324# CONFIG_SECURITY is not set
1325
1326#
1327# Cryptographic options
1328#
1329CONFIG_CRYPTO=y
1330CONFIG_CRYPTO_HMAC=y
1331CONFIG_CRYPTO_NULL=m
1332CONFIG_CRYPTO_MD4=m
1333CONFIG_CRYPTO_MD5=y
1334CONFIG_CRYPTO_SHA1=m
1335CONFIG_CRYPTO_SHA256=m
1336CONFIG_CRYPTO_SHA512=m
1337CONFIG_CRYPTO_WP512=m
1338CONFIG_CRYPTO_TGR192=m
1339CONFIG_CRYPTO_DES=y
1340CONFIG_CRYPTO_BLOWFISH=m
1341CONFIG_CRYPTO_TWOFISH=m
1342CONFIG_CRYPTO_SERPENT=m
1343CONFIG_CRYPTO_AES=m
1344CONFIG_CRYPTO_CAST5=m
1345CONFIG_CRYPTO_CAST6=m
1346CONFIG_CRYPTO_TEA=m
1347CONFIG_CRYPTO_ARC4=m
1348CONFIG_CRYPTO_KHAZAD=m
1349CONFIG_CRYPTO_ANUBIS=m
1350CONFIG_CRYPTO_DEFLATE=m
1351CONFIG_CRYPTO_MICHAEL_MIC=m
1352CONFIG_CRYPTO_CRC32C=m
1353CONFIG_CRYPTO_TEST=m
1354
1355#
1356# Hardware crypto devices
1357#
1358
1359#
1360# Library routines
1361#
1362CONFIG_CRC_CCITT=m
1363# CONFIG_CRC16 is not set
1364CONFIG_CRC32=y
1365CONFIG_LIBCRC32C=m
1366CONFIG_ZLIB_INFLATE=y
1367CONFIG_ZLIB_DEFLATE=m
1368CONFIG_TEXTSEARCH=y
1369CONFIG_TEXTSEARCH_KMP=m
1370CONFIG_TEXTSEARCH_BM=m
1371CONFIG_TEXTSEARCH_FSM=m
diff --git a/arch/powerpc/kernel/Makefile b/arch/powerpc/kernel/Makefile
index 572d4f5eaacb..b3ae2993efb8 100644
--- a/arch/powerpc/kernel/Makefile
+++ b/arch/powerpc/kernel/Makefile
@@ -13,12 +13,15 @@ endif
13obj-y := semaphore.o cputable.o ptrace.o syscalls.o \ 13obj-y := semaphore.o cputable.o ptrace.o syscalls.o \
14 signal_32.o pmc.o 14 signal_32.o pmc.o
15obj-$(CONFIG_PPC64) += setup_64.o binfmt_elf32.o sys_ppc32.o \ 15obj-$(CONFIG_PPC64) += setup_64.o binfmt_elf32.o sys_ppc32.o \
16 ptrace32.o systbl.o 16 signal_64.o ptrace32.o systbl.o
17obj-$(CONFIG_ALTIVEC) += vecemu.o vector.o 17obj-$(CONFIG_ALTIVEC) += vecemu.o vector.o
18obj-$(CONFIG_POWER4) += idle_power4.o 18obj-$(CONFIG_POWER4) += idle_power4.o
19obj-$(CONFIG_PPC_OF) += of_device.o 19obj-$(CONFIG_PPC_OF) += of_device.o
20obj-$(CONFIG_PPC_RTAS) += rtas.o 20obj-$(CONFIG_PPC_RTAS) += rtas.o
21obj-$(CONFIG_RTAS_FLASH) += rtas_flash.o
22obj-$(CONFIG_RTAS_PROC) += rtas-proc.o
21obj-$(CONFIG_IBMVIO) += vio.o 23obj-$(CONFIG_IBMVIO) += vio.o
24obj-$(CONFIG_GENERIC_TBSYNC) += smp-tbsync.o
22 25
23ifeq ($(CONFIG_PPC_MERGE),y) 26ifeq ($(CONFIG_PPC_MERGE),y)
24 27
@@ -38,6 +41,7 @@ obj-$(CONFIG_PPC_OF) += prom_init.o
38obj-$(CONFIG_MODULES) += ppc_ksyms.o 41obj-$(CONFIG_MODULES) += ppc_ksyms.o
39obj-$(CONFIG_BOOTX_TEXT) += btext.o 42obj-$(CONFIG_BOOTX_TEXT) += btext.o
40obj-$(CONFIG_6xx) += idle_6xx.o 43obj-$(CONFIG_6xx) += idle_6xx.o
44obj-$(CONFIG_SMP) += smp.o
41 45
42ifeq ($(CONFIG_PPC_ISERIES),y) 46ifeq ($(CONFIG_PPC_ISERIES),y)
43$(obj)/head_64.o: $(obj)/lparmap.s 47$(obj)/head_64.o: $(obj)/lparmap.s
@@ -46,8 +50,9 @@ endif
46 50
47else 51else
48# stuff used from here for ARCH=ppc or ARCH=ppc64 52# stuff used from here for ARCH=ppc or ARCH=ppc64
53smpobj-$(CONFIG_SMP) += smp.o
49obj-$(CONFIG_PPC64) += traps.o process.o init_task.o time.o \ 54obj-$(CONFIG_PPC64) += traps.o process.o init_task.o time.o \
50 setup-common.o 55 setup-common.o $(smpobj-y)
51 56
52 57
53endif 58endif
diff --git a/arch/powerpc/kernel/asm-offsets.c b/arch/powerpc/kernel/asm-offsets.c
index 330cd783206f..b75757251994 100644
--- a/arch/powerpc/kernel/asm-offsets.c
+++ b/arch/powerpc/kernel/asm-offsets.c
@@ -40,7 +40,7 @@
40#ifdef CONFIG_PPC64 40#ifdef CONFIG_PPC64
41#include <asm/paca.h> 41#include <asm/paca.h>
42#include <asm/lppaca.h> 42#include <asm/lppaca.h>
43#include <asm/iSeries/HvLpEvent.h> 43#include <asm/iseries/hv_lp_event.h>
44#include <asm/cache.h> 44#include <asm/cache.h>
45#include <asm/systemcfg.h> 45#include <asm/systemcfg.h>
46#include <asm/compat.h> 46#include <asm/compat.h>
@@ -125,6 +125,9 @@ int main(void)
125 DEFINE(PACASLBCACHE, offsetof(struct paca_struct, slb_cache)); 125 DEFINE(PACASLBCACHE, offsetof(struct paca_struct, slb_cache));
126 DEFINE(PACASLBCACHEPTR, offsetof(struct paca_struct, slb_cache_ptr)); 126 DEFINE(PACASLBCACHEPTR, offsetof(struct paca_struct, slb_cache_ptr));
127 DEFINE(PACACONTEXTID, offsetof(struct paca_struct, context.id)); 127 DEFINE(PACACONTEXTID, offsetof(struct paca_struct, context.id));
128#ifdef CONFIG_PPC_64K_PAGES
129 DEFINE(PACAPGDIR, offsetof(struct paca_struct, pgdir));
130#endif
128#ifdef CONFIG_HUGETLB_PAGE 131#ifdef CONFIG_HUGETLB_PAGE
129 DEFINE(PACALOWHTLBAREAS, offsetof(struct paca_struct, context.low_htlb_areas)); 132 DEFINE(PACALOWHTLBAREAS, offsetof(struct paca_struct, context.low_htlb_areas));
130 DEFINE(PACAHIGHHTLBAREAS, offsetof(struct paca_struct, context.high_htlb_areas)); 133 DEFINE(PACAHIGHHTLBAREAS, offsetof(struct paca_struct, context.high_htlb_areas));
diff --git a/arch/powerpc/kernel/cputable.c b/arch/powerpc/kernel/cputable.c
index b91345fa0805..cc4e9eb1c13f 100644
--- a/arch/powerpc/kernel/cputable.c
+++ b/arch/powerpc/kernel/cputable.c
@@ -240,7 +240,7 @@ struct cpu_spec cpu_specs[] = {
240 .oprofile_model = &op_model_power4, 240 .oprofile_model = &op_model_power4,
241#endif 241#endif
242 }, 242 },
243 { /* Power5 */ 243 { /* Power5 GR */
244 .pvr_mask = 0xffff0000, 244 .pvr_mask = 0xffff0000,
245 .pvr_value = 0x003a0000, 245 .pvr_value = 0x003a0000,
246 .cpu_name = "POWER5 (gr)", 246 .cpu_name = "POWER5 (gr)",
@@ -255,7 +255,7 @@ struct cpu_spec cpu_specs[] = {
255 .oprofile_model = &op_model_power4, 255 .oprofile_model = &op_model_power4,
256#endif 256#endif
257 }, 257 },
258 { /* Power5 */ 258 { /* Power5 GS */
259 .pvr_mask = 0xffff0000, 259 .pvr_mask = 0xffff0000,
260 .pvr_value = 0x003b0000, 260 .pvr_value = 0x003b0000,
261 .cpu_name = "POWER5 (gs)", 261 .cpu_name = "POWER5 (gs)",
@@ -929,6 +929,16 @@ struct cpu_spec cpu_specs[] = {
929 .icache_bsize = 32, 929 .icache_bsize = 32,
930 .dcache_bsize = 32, 930 .dcache_bsize = 32,
931 }, 931 },
932 { /* 440SPe Rev. A */
933 .pvr_mask = 0xff000fff,
934 .pvr_value = 0x53000890,
935 .cpu_name = "440SPe Rev. A",
936 .cpu_features = CPU_FTR_SPLIT_ID_CACHE |
937 CPU_FTR_USE_TB,
938 .cpu_user_features = PPC_FEATURE_32 | PPC_FEATURE_HAS_MMU,
939 .icache_bsize = 32,
940 .dcache_bsize = 32,
941 },
932#endif /* CONFIG_44x */ 942#endif /* CONFIG_44x */
933#ifdef CONFIG_FSL_BOOKE 943#ifdef CONFIG_FSL_BOOKE
934 { /* e200z5 */ 944 { /* e200z5 */
diff --git a/arch/powerpc/kernel/head_64.S b/arch/powerpc/kernel/head_64.S
index 147215a0d6c0..16ab40daa738 100644
--- a/arch/powerpc/kernel/head_64.S
+++ b/arch/powerpc/kernel/head_64.S
@@ -35,7 +35,7 @@
35#include <asm/cputable.h> 35#include <asm/cputable.h>
36#include <asm/setup.h> 36#include <asm/setup.h>
37#include <asm/hvcall.h> 37#include <asm/hvcall.h>
38#include <asm/iSeries/LparMap.h> 38#include <asm/iseries/lpar_map.h>
39#include <asm/thread_info.h> 39#include <asm/thread_info.h>
40 40
41#ifdef CONFIG_PPC_ISERIES 41#ifdef CONFIG_PPC_ISERIES
@@ -195,11 +195,11 @@ exception_marker:
195#define EX_R12 24 195#define EX_R12 24
196#define EX_R13 32 196#define EX_R13 32
197#define EX_SRR0 40 197#define EX_SRR0 40
198#define EX_R3 40 /* SLB miss saves R3, but not SRR0 */
199#define EX_DAR 48 198#define EX_DAR 48
200#define EX_LR 48 /* SLB miss saves LR, but not DAR */
201#define EX_DSISR 56 199#define EX_DSISR 56
202#define EX_CCR 60 200#define EX_CCR 60
201#define EX_R3 64
202#define EX_LR 72
203 203
204#define EXCEPTION_PROLOG_PSERIES(area, label) \ 204#define EXCEPTION_PROLOG_PSERIES(area, label) \
205 mfspr r13,SPRN_SPRG3; /* get paca address into r13 */ \ 205 mfspr r13,SPRN_SPRG3; /* get paca address into r13 */ \
@@ -419,17 +419,22 @@ data_access_slb_pSeries:
419 mtspr SPRN_SPRG1,r13 419 mtspr SPRN_SPRG1,r13
420 RUNLATCH_ON(r13) 420 RUNLATCH_ON(r13)
421 mfspr r13,SPRN_SPRG3 /* get paca address into r13 */ 421 mfspr r13,SPRN_SPRG3 /* get paca address into r13 */
422 std r3,PACA_EXSLB+EX_R3(r13)
423 mfspr r3,SPRN_DAR
422 std r9,PACA_EXSLB+EX_R9(r13) /* save r9 - r12 */ 424 std r9,PACA_EXSLB+EX_R9(r13) /* save r9 - r12 */
425 mfcr r9
426#ifdef __DISABLED__
427 /* Keep that around for when we re-implement dynamic VSIDs */
428 cmpdi r3,0
429 bge slb_miss_user_pseries
430#endif /* __DISABLED__ */
423 std r10,PACA_EXSLB+EX_R10(r13) 431 std r10,PACA_EXSLB+EX_R10(r13)
424 std r11,PACA_EXSLB+EX_R11(r13) 432 std r11,PACA_EXSLB+EX_R11(r13)
425 std r12,PACA_EXSLB+EX_R12(r13) 433 std r12,PACA_EXSLB+EX_R12(r13)
426 std r3,PACA_EXSLB+EX_R3(r13) 434 mfspr r10,SPRN_SPRG1
427 mfspr r9,SPRN_SPRG1 435 std r10,PACA_EXSLB+EX_R13(r13)
428 std r9,PACA_EXSLB+EX_R13(r13)
429 mfcr r9
430 mfspr r12,SPRN_SRR1 /* and SRR1 */ 436 mfspr r12,SPRN_SRR1 /* and SRR1 */
431 mfspr r3,SPRN_DAR 437 b .slb_miss_realmode /* Rel. branch works in real mode */
432 b .do_slb_miss /* Rel. branch works in real mode */
433 438
434 STD_EXCEPTION_PSERIES(0x400, instruction_access) 439 STD_EXCEPTION_PSERIES(0x400, instruction_access)
435 440
@@ -440,17 +445,22 @@ instruction_access_slb_pSeries:
440 mtspr SPRN_SPRG1,r13 445 mtspr SPRN_SPRG1,r13
441 RUNLATCH_ON(r13) 446 RUNLATCH_ON(r13)
442 mfspr r13,SPRN_SPRG3 /* get paca address into r13 */ 447 mfspr r13,SPRN_SPRG3 /* get paca address into r13 */
448 std r3,PACA_EXSLB+EX_R3(r13)
449 mfspr r3,SPRN_SRR0 /* SRR0 is faulting address */
443 std r9,PACA_EXSLB+EX_R9(r13) /* save r9 - r12 */ 450 std r9,PACA_EXSLB+EX_R9(r13) /* save r9 - r12 */
451 mfcr r9
452#ifdef __DISABLED__
453 /* Keep that around for when we re-implement dynamic VSIDs */
454 cmpdi r3,0
455 bge slb_miss_user_pseries
456#endif /* __DISABLED__ */
444 std r10,PACA_EXSLB+EX_R10(r13) 457 std r10,PACA_EXSLB+EX_R10(r13)
445 std r11,PACA_EXSLB+EX_R11(r13) 458 std r11,PACA_EXSLB+EX_R11(r13)
446 std r12,PACA_EXSLB+EX_R12(r13) 459 std r12,PACA_EXSLB+EX_R12(r13)
447 std r3,PACA_EXSLB+EX_R3(r13) 460 mfspr r10,SPRN_SPRG1
448 mfspr r9,SPRN_SPRG1 461 std r10,PACA_EXSLB+EX_R13(r13)
449 std r9,PACA_EXSLB+EX_R13(r13)
450 mfcr r9
451 mfspr r12,SPRN_SRR1 /* and SRR1 */ 462 mfspr r12,SPRN_SRR1 /* and SRR1 */
452 mfspr r3,SPRN_SRR0 /* SRR0 is faulting address */ 463 b .slb_miss_realmode /* Rel. branch works in real mode */
453 b .do_slb_miss /* Rel. branch works in real mode */
454 464
455 STD_EXCEPTION_PSERIES(0x500, hardware_interrupt) 465 STD_EXCEPTION_PSERIES(0x500, hardware_interrupt)
456 STD_EXCEPTION_PSERIES(0x600, alignment) 466 STD_EXCEPTION_PSERIES(0x600, alignment)
@@ -509,6 +519,38 @@ _GLOBAL(do_stab_bolted_pSeries)
509 EXCEPTION_PROLOG_PSERIES(PACA_EXSLB, .do_stab_bolted) 519 EXCEPTION_PROLOG_PSERIES(PACA_EXSLB, .do_stab_bolted)
510 520
511/* 521/*
522 * We have some room here we use that to put
523 * the peries slb miss user trampoline code so it's reasonably
524 * away from slb_miss_user_common to avoid problems with rfid
525 *
526 * This is used for when the SLB miss handler has to go virtual,
527 * which doesn't happen for now anymore but will once we re-implement
528 * dynamic VSIDs for shared page tables
529 */
530#ifdef __DISABLED__
531slb_miss_user_pseries:
532 std r10,PACA_EXGEN+EX_R10(r13)
533 std r11,PACA_EXGEN+EX_R11(r13)
534 std r12,PACA_EXGEN+EX_R12(r13)
535 mfspr r10,SPRG1
536 ld r11,PACA_EXSLB+EX_R9(r13)
537 ld r12,PACA_EXSLB+EX_R3(r13)
538 std r10,PACA_EXGEN+EX_R13(r13)
539 std r11,PACA_EXGEN+EX_R9(r13)
540 std r12,PACA_EXGEN+EX_R3(r13)
541 clrrdi r12,r13,32
542 mfmsr r10
543 mfspr r11,SRR0 /* save SRR0 */
544 ori r12,r12,slb_miss_user_common@l /* virt addr of handler */
545 ori r10,r10,MSR_IR|MSR_DR|MSR_RI
546 mtspr SRR0,r12
547 mfspr r12,SRR1 /* and SRR1 */
548 mtspr SRR1,r10
549 rfid
550 b . /* prevent spec. execution */
551#endif /* __DISABLED__ */
552
553/*
512 * Vectors for the FWNMI option. Share common code. 554 * Vectors for the FWNMI option. Share common code.
513 */ 555 */
514 .globl system_reset_fwnmi 556 .globl system_reset_fwnmi
@@ -559,22 +601,59 @@ END_FTR_SECTION_IFCLR(CPU_FTR_SLB)
559 .globl data_access_slb_iSeries 601 .globl data_access_slb_iSeries
560data_access_slb_iSeries: 602data_access_slb_iSeries:
561 mtspr SPRN_SPRG1,r13 /* save r13 */ 603 mtspr SPRN_SPRG1,r13 /* save r13 */
562 EXCEPTION_PROLOG_ISERIES_1(PACA_EXSLB) 604 mfspr r13,SPRN_SPRG3 /* get paca address into r13 */
563 std r3,PACA_EXSLB+EX_R3(r13) 605 std r3,PACA_EXSLB+EX_R3(r13)
564 ld r12,PACALPPACA+LPPACASRR1(r13)
565 mfspr r3,SPRN_DAR 606 mfspr r3,SPRN_DAR
566 b .do_slb_miss 607 std r9,PACA_EXSLB+EX_R9(r13)
608 mfcr r9
609#ifdef __DISABLED__
610 cmpdi r3,0
611 bge slb_miss_user_iseries
612#endif
613 std r10,PACA_EXSLB+EX_R10(r13)
614 std r11,PACA_EXSLB+EX_R11(r13)
615 std r12,PACA_EXSLB+EX_R12(r13)
616 mfspr r10,SPRN_SPRG1
617 std r10,PACA_EXSLB+EX_R13(r13)
618 ld r12,PACALPPACA+LPPACASRR1(r13);
619 b .slb_miss_realmode
567 620
568 STD_EXCEPTION_ISERIES(0x400, instruction_access, PACA_EXGEN) 621 STD_EXCEPTION_ISERIES(0x400, instruction_access, PACA_EXGEN)
569 622
570 .globl instruction_access_slb_iSeries 623 .globl instruction_access_slb_iSeries
571instruction_access_slb_iSeries: 624instruction_access_slb_iSeries:
572 mtspr SPRN_SPRG1,r13 /* save r13 */ 625 mtspr SPRN_SPRG1,r13 /* save r13 */
573 EXCEPTION_PROLOG_ISERIES_1(PACA_EXSLB) 626 mfspr r13,SPRN_SPRG3 /* get paca address into r13 */
574 std r3,PACA_EXSLB+EX_R3(r13) 627 std r3,PACA_EXSLB+EX_R3(r13)
575 ld r12,PACALPPACA+LPPACASRR1(r13) 628 ld r3,PACALPPACA+LPPACASRR0(r13) /* get SRR0 value */
576 ld r3,PACALPPACA+LPPACASRR0(r13) 629 std r9,PACA_EXSLB+EX_R9(r13)
577 b .do_slb_miss 630 mfcr r9
631#ifdef __DISABLED__
632 cmpdi r3,0
633 bge .slb_miss_user_iseries
634#endif
635 std r10,PACA_EXSLB+EX_R10(r13)
636 std r11,PACA_EXSLB+EX_R11(r13)
637 std r12,PACA_EXSLB+EX_R12(r13)
638 mfspr r10,SPRN_SPRG1
639 std r10,PACA_EXSLB+EX_R13(r13)
640 ld r12,PACALPPACA+LPPACASRR1(r13);
641 b .slb_miss_realmode
642
643#ifdef __DISABLED__
644slb_miss_user_iseries:
645 std r10,PACA_EXGEN+EX_R10(r13)
646 std r11,PACA_EXGEN+EX_R11(r13)
647 std r12,PACA_EXGEN+EX_R12(r13)
648 mfspr r10,SPRG1
649 ld r11,PACA_EXSLB+EX_R9(r13)
650 ld r12,PACA_EXSLB+EX_R3(r13)
651 std r10,PACA_EXGEN+EX_R13(r13)
652 std r11,PACA_EXGEN+EX_R9(r13)
653 std r12,PACA_EXGEN+EX_R3(r13)
654 EXCEPTION_PROLOG_ISERIES_2
655 b slb_miss_user_common
656#endif
578 657
579 MASKABLE_EXCEPTION_ISERIES(0x500, hardware_interrupt) 658 MASKABLE_EXCEPTION_ISERIES(0x500, hardware_interrupt)
580 STD_EXCEPTION_ISERIES(0x600, alignment, PACA_EXGEN) 659 STD_EXCEPTION_ISERIES(0x600, alignment, PACA_EXGEN)
@@ -809,6 +888,126 @@ instruction_access_common:
809 li r5,0x400 888 li r5,0x400
810 b .do_hash_page /* Try to handle as hpte fault */ 889 b .do_hash_page /* Try to handle as hpte fault */
811 890
891/*
892 * Here is the common SLB miss user that is used when going to virtual
893 * mode for SLB misses, that is currently not used
894 */
895#ifdef __DISABLED__
896 .align 7
897 .globl slb_miss_user_common
898slb_miss_user_common:
899 mflr r10
900 std r3,PACA_EXGEN+EX_DAR(r13)
901 stw r9,PACA_EXGEN+EX_CCR(r13)
902 std r10,PACA_EXGEN+EX_LR(r13)
903 std r11,PACA_EXGEN+EX_SRR0(r13)
904 bl .slb_allocate_user
905
906 ld r10,PACA_EXGEN+EX_LR(r13)
907 ld r3,PACA_EXGEN+EX_R3(r13)
908 lwz r9,PACA_EXGEN+EX_CCR(r13)
909 ld r11,PACA_EXGEN+EX_SRR0(r13)
910 mtlr r10
911 beq- slb_miss_fault
912
913 andi. r10,r12,MSR_RI /* check for unrecoverable exception */
914 beq- unrecov_user_slb
915 mfmsr r10
916
917.machine push
918.machine "power4"
919 mtcrf 0x80,r9
920.machine pop
921
922 clrrdi r10,r10,2 /* clear RI before setting SRR0/1 */
923 mtmsrd r10,1
924
925 mtspr SRR0,r11
926 mtspr SRR1,r12
927
928 ld r9,PACA_EXGEN+EX_R9(r13)
929 ld r10,PACA_EXGEN+EX_R10(r13)
930 ld r11,PACA_EXGEN+EX_R11(r13)
931 ld r12,PACA_EXGEN+EX_R12(r13)
932 ld r13,PACA_EXGEN+EX_R13(r13)
933 rfid
934 b .
935
936slb_miss_fault:
937 EXCEPTION_PROLOG_COMMON(0x380, PACA_EXGEN)
938 ld r4,PACA_EXGEN+EX_DAR(r13)
939 li r5,0
940 std r4,_DAR(r1)
941 std r5,_DSISR(r1)
942 b .handle_page_fault
943
944unrecov_user_slb:
945 EXCEPTION_PROLOG_COMMON(0x4200, PACA_EXGEN)
946 DISABLE_INTS
947 bl .save_nvgprs
9481: addi r3,r1,STACK_FRAME_OVERHEAD
949 bl .unrecoverable_exception
950 b 1b
951
952#endif /* __DISABLED__ */
953
954
955/*
956 * r13 points to the PACA, r9 contains the saved CR,
957 * r12 contain the saved SRR1, SRR0 is still ready for return
958 * r3 has the faulting address
959 * r9 - r13 are saved in paca->exslb.
960 * r3 is saved in paca->slb_r3
961 * We assume we aren't going to take any exceptions during this procedure.
962 */
963_GLOBAL(slb_miss_realmode)
964 mflr r10
965
966 stw r9,PACA_EXSLB+EX_CCR(r13) /* save CR in exc. frame */
967 std r10,PACA_EXSLB+EX_LR(r13) /* save LR */
968
969 bl .slb_allocate_realmode
970
971 /* All done -- return from exception. */
972
973 ld r10,PACA_EXSLB+EX_LR(r13)
974 ld r3,PACA_EXSLB+EX_R3(r13)
975 lwz r9,PACA_EXSLB+EX_CCR(r13) /* get saved CR */
976#ifdef CONFIG_PPC_ISERIES
977 ld r11,PACALPPACA+LPPACASRR0(r13) /* get SRR0 value */
978#endif /* CONFIG_PPC_ISERIES */
979
980 mtlr r10
981
982 andi. r10,r12,MSR_RI /* check for unrecoverable exception */
983 beq- unrecov_slb
984
985.machine push
986.machine "power4"
987 mtcrf 0x80,r9
988 mtcrf 0x01,r9 /* slb_allocate uses cr0 and cr7 */
989.machine pop
990
991#ifdef CONFIG_PPC_ISERIES
992 mtspr SPRN_SRR0,r11
993 mtspr SPRN_SRR1,r12
994#endif /* CONFIG_PPC_ISERIES */
995 ld r9,PACA_EXSLB+EX_R9(r13)
996 ld r10,PACA_EXSLB+EX_R10(r13)
997 ld r11,PACA_EXSLB+EX_R11(r13)
998 ld r12,PACA_EXSLB+EX_R12(r13)
999 ld r13,PACA_EXSLB+EX_R13(r13)
1000 rfid
1001 b . /* prevent speculative execution */
1002
1003unrecov_slb:
1004 EXCEPTION_PROLOG_COMMON(0x4100, PACA_EXSLB)
1005 DISABLE_INTS
1006 bl .save_nvgprs
10071: addi r3,r1,STACK_FRAME_OVERHEAD
1008 bl .unrecoverable_exception
1009 b 1b
1010
812 .align 7 1011 .align 7
813 .globl hardware_interrupt_common 1012 .globl hardware_interrupt_common
814 .globl hardware_interrupt_entry 1013 .globl hardware_interrupt_entry
@@ -1139,62 +1338,6 @@ _GLOBAL(do_stab_bolted)
1139 b . /* prevent speculative execution */ 1338 b . /* prevent speculative execution */
1140 1339
1141/* 1340/*
1142 * r13 points to the PACA, r9 contains the saved CR,
1143 * r11 and r12 contain the saved SRR0 and SRR1.
1144 * r3 has the faulting address
1145 * r9 - r13 are saved in paca->exslb.
1146 * r3 is saved in paca->slb_r3
1147 * We assume we aren't going to take any exceptions during this procedure.
1148 */
1149_GLOBAL(do_slb_miss)
1150 mflr r10
1151
1152 stw r9,PACA_EXSLB+EX_CCR(r13) /* save CR in exc. frame */
1153 std r10,PACA_EXSLB+EX_LR(r13) /* save LR */
1154
1155 bl .slb_allocate /* handle it */
1156
1157 /* All done -- return from exception. */
1158
1159 ld r10,PACA_EXSLB+EX_LR(r13)
1160 ld r3,PACA_EXSLB+EX_R3(r13)
1161 lwz r9,PACA_EXSLB+EX_CCR(r13) /* get saved CR */
1162#ifdef CONFIG_PPC_ISERIES
1163 ld r11,PACALPPACA+LPPACASRR0(r13) /* get SRR0 value */
1164#endif /* CONFIG_PPC_ISERIES */
1165
1166 mtlr r10
1167
1168 andi. r10,r12,MSR_RI /* check for unrecoverable exception */
1169 beq- unrecov_slb
1170
1171.machine push
1172.machine "power4"
1173 mtcrf 0x80,r9
1174 mtcrf 0x01,r9 /* slb_allocate uses cr0 and cr7 */
1175.machine pop
1176
1177#ifdef CONFIG_PPC_ISERIES
1178 mtspr SPRN_SRR0,r11
1179 mtspr SPRN_SRR1,r12
1180#endif /* CONFIG_PPC_ISERIES */
1181 ld r9,PACA_EXSLB+EX_R9(r13)
1182 ld r10,PACA_EXSLB+EX_R10(r13)
1183 ld r11,PACA_EXSLB+EX_R11(r13)
1184 ld r12,PACA_EXSLB+EX_R12(r13)
1185 ld r13,PACA_EXSLB+EX_R13(r13)
1186 rfid
1187 b . /* prevent speculative execution */
1188
1189unrecov_slb:
1190 EXCEPTION_PROLOG_COMMON(0x4100, PACA_EXSLB)
1191 DISABLE_INTS
1192 bl .save_nvgprs
11931: addi r3,r1,STACK_FRAME_OVERHEAD
1194 bl .unrecoverable_exception
1195 b 1b
1196
1197/*
1198 * Space for CPU0's segment table. 1341 * Space for CPU0's segment table.
1199 * 1342 *
1200 * On iSeries, the hypervisor must fill in at least one entry before 1343 * On iSeries, the hypervisor must fill in at least one entry before
@@ -1569,7 +1712,10 @@ _GLOBAL(__secondary_start)
1569#endif 1712#endif
1570 /* Initialize the first segment table (or SLB) entry */ 1713 /* Initialize the first segment table (or SLB) entry */
1571 ld r3,PACASTABVIRT(r13) /* get addr of segment table */ 1714 ld r3,PACASTABVIRT(r13) /* get addr of segment table */
1715BEGIN_FTR_SECTION
1572 bl .stab_initialize 1716 bl .stab_initialize
1717END_FTR_SECTION_IFCLR(CPU_FTR_SLB)
1718 bl .slb_initialize
1573 1719
1574 /* Initialize the kernel stack. Just a repeat for iSeries. */ 1720 /* Initialize the kernel stack. Just a repeat for iSeries. */
1575 LOADADDR(r3,current_set) 1721 LOADADDR(r3,current_set)
@@ -1914,24 +2060,6 @@ _GLOBAL(hmt_start_secondary)
1914 blr 2060 blr
1915#endif 2061#endif
1916 2062
1917#if defined(CONFIG_KEXEC) || defined(CONFIG_SMP)
1918_GLOBAL(smp_release_cpus)
1919 /* All secondary cpus are spinning on a common
1920 * spinloop, release them all now so they can start
1921 * to spin on their individual paca spinloops.
1922 * For non SMP kernels, the secondary cpus never
1923 * get out of the common spinloop.
1924 * XXX This does nothing useful on iSeries, secondaries are
1925 * already waiting on their paca.
1926 */
1927 li r3,1
1928 LOADADDR(r5,__secondary_hold_spinloop)
1929 std r3,0(r5)
1930 sync
1931 blr
1932#endif /* CONFIG_SMP */
1933
1934
1935/* 2063/*
1936 * We put a few things here that have to be page-aligned. 2064 * We put a few things here that have to be page-aligned.
1937 * This stuff goes at the beginning of the bss, which is page-aligned. 2065 * This stuff goes at the beginning of the bss, which is page-aligned.
diff --git a/arch/powerpc/kernel/lparmap.c b/arch/powerpc/kernel/lparmap.c
index b81de286df5e..5a05a797485f 100644
--- a/arch/powerpc/kernel/lparmap.c
+++ b/arch/powerpc/kernel/lparmap.c
@@ -8,7 +8,7 @@
8 */ 8 */
9#include <asm/mmu.h> 9#include <asm/mmu.h>
10#include <asm/page.h> 10#include <asm/page.h>
11#include <asm/iSeries/LparMap.h> 11#include <asm/iseries/lpar_map.h>
12 12
13const struct LparMap __attribute__((__section__(".text"))) xLparMap = { 13const struct LparMap __attribute__((__section__(".text"))) xLparMap = {
14 .xNumberEsids = HvEsidsToMap, 14 .xNumberEsids = HvEsidsToMap,
@@ -25,7 +25,7 @@ const struct LparMap __attribute__((__section__(".text"))) xLparMap = {
25 .xRanges = { 25 .xRanges = {
26 { .xPages = HvPagesToMap, 26 { .xPages = HvPagesToMap,
27 .xOffset = 0, 27 .xOffset = 0,
28 .xVPN = KERNEL_VSID(KERNELBASE) << (SID_SHIFT - PAGE_SHIFT), 28 .xVPN = KERNEL_VSID(KERNELBASE) << (SID_SHIFT - HW_PAGE_SHIFT),
29 }, 29 },
30 }, 30 },
31}; 31};
diff --git a/arch/powerpc/kernel/misc_64.S b/arch/powerpc/kernel/misc_64.S
index b3e95ff0dba0..ae1433da09b2 100644
--- a/arch/powerpc/kernel/misc_64.S
+++ b/arch/powerpc/kernel/misc_64.S
@@ -604,6 +604,76 @@ _GLOBAL(real_writeb)
604#endif /* defined(CONFIG_PPC_PMAC) || defined(CONFIG_PPC_MAPLE) */ 604#endif /* defined(CONFIG_PPC_PMAC) || defined(CONFIG_PPC_MAPLE) */
605 605
606/* 606/*
607 * SCOM access functions for 970 (FX only for now)
608 *
609 * unsigned long scom970_read(unsigned int address);
610 * void scom970_write(unsigned int address, unsigned long value);
611 *
612 * The address passed in is the 24 bits register address. This code
613 * is 970 specific and will not check the status bits, so you should
614 * know what you are doing.
615 */
616_GLOBAL(scom970_read)
617 /* interrupts off */
618 mfmsr r4
619 ori r0,r4,MSR_EE
620 xori r0,r0,MSR_EE
621 mtmsrd r0,1
622
623 /* rotate 24 bits SCOM address 8 bits left and mask out it's low 8 bits
624 * (including parity). On current CPUs they must be 0'd,
625 * and finally or in RW bit
626 */
627 rlwinm r3,r3,8,0,15
628 ori r3,r3,0x8000
629
630 /* do the actual scom read */
631 sync
632 mtspr SPRN_SCOMC,r3
633 isync
634 mfspr r3,SPRN_SCOMD
635 isync
636 mfspr r0,SPRN_SCOMC
637 isync
638
639 /* XXX: fixup result on some buggy 970's (ouch ! we lost a bit, bah
640 * that's the best we can do). Not implemented yet as we don't use
641 * the scom on any of the bogus CPUs yet, but may have to be done
642 * ultimately
643 */
644
645 /* restore interrupts */
646 mtmsrd r4,1
647 blr
648
649
650_GLOBAL(scom970_write)
651 /* interrupts off */
652 mfmsr r5
653 ori r0,r5,MSR_EE
654 xori r0,r0,MSR_EE
655 mtmsrd r0,1
656
657 /* rotate 24 bits SCOM address 8 bits left and mask out it's low 8 bits
658 * (including parity). On current CPUs they must be 0'd.
659 */
660
661 rlwinm r3,r3,8,0,15
662
663 sync
664 mtspr SPRN_SCOMD,r4 /* write data */
665 isync
666 mtspr SPRN_SCOMC,r3 /* write command */
667 isync
668 mfspr 3,SPRN_SCOMC
669 isync
670
671 /* restore interrupts */
672 mtmsrd r5,1
673 blr
674
675
676/*
607 * Create a kernel thread 677 * Create a kernel thread
608 * kernel_thread(fn, arg, flags) 678 * kernel_thread(fn, arg, flags)
609 */ 679 */
diff --git a/arch/powerpc/kernel/ppc32.h b/arch/powerpc/kernel/ppc32.h
new file mode 100644
index 000000000000..90e562771791
--- /dev/null
+++ b/arch/powerpc/kernel/ppc32.h
@@ -0,0 +1,138 @@
1#ifndef _PPC64_PPC32_H
2#define _PPC64_PPC32_H
3
4#include <linux/compat.h>
5#include <asm/siginfo.h>
6#include <asm/signal.h>
7
8/*
9 * Data types and macros for providing 32b PowerPC support.
10 *
11 * This program is free software; you can redistribute it and/or
12 * modify it under the terms of the GNU General Public License
13 * as published by the Free Software Foundation; either version
14 * 2 of the License, or (at your option) any later version.
15 */
16
17/* These are here to support 32-bit syscalls on a 64-bit kernel. */
18
19typedef struct compat_siginfo {
20 int si_signo;
21 int si_errno;
22 int si_code;
23
24 union {
25 int _pad[SI_PAD_SIZE32];
26
27 /* kill() */
28 struct {
29 compat_pid_t _pid; /* sender's pid */
30 compat_uid_t _uid; /* sender's uid */
31 } _kill;
32
33 /* POSIX.1b timers */
34 struct {
35 compat_timer_t _tid; /* timer id */
36 int _overrun; /* overrun count */
37 compat_sigval_t _sigval; /* same as below */
38 int _sys_private; /* not to be passed to user */
39 } _timer;
40
41 /* POSIX.1b signals */
42 struct {
43 compat_pid_t _pid; /* sender's pid */
44 compat_uid_t _uid; /* sender's uid */
45 compat_sigval_t _sigval;
46 } _rt;
47
48 /* SIGCHLD */
49 struct {
50 compat_pid_t _pid; /* which child */
51 compat_uid_t _uid; /* sender's uid */
52 int _status; /* exit code */
53 compat_clock_t _utime;
54 compat_clock_t _stime;
55 } _sigchld;
56
57 /* SIGILL, SIGFPE, SIGSEGV, SIGBUS, SIGEMT */
58 struct {
59 unsigned int _addr; /* faulting insn/memory ref. */
60 } _sigfault;
61
62 /* SIGPOLL */
63 struct {
64 int _band; /* POLL_IN, POLL_OUT, POLL_MSG */
65 int _fd;
66 } _sigpoll;
67 } _sifields;
68} compat_siginfo_t;
69
70#define __old_sigaction32 old_sigaction32
71
72struct __old_sigaction32 {
73 compat_uptr_t sa_handler;
74 compat_old_sigset_t sa_mask;
75 unsigned int sa_flags;
76 compat_uptr_t sa_restorer; /* not used by Linux/SPARC yet */
77};
78
79
80
81struct sigaction32 {
82 compat_uptr_t sa_handler; /* Really a pointer, but need to deal with 32 bits */
83 unsigned int sa_flags;
84 compat_uptr_t sa_restorer; /* Another 32 bit pointer */
85 compat_sigset_t sa_mask; /* A 32 bit mask */
86};
87
88typedef struct sigaltstack_32 {
89 unsigned int ss_sp;
90 int ss_flags;
91 compat_size_t ss_size;
92} stack_32_t;
93
94struct pt_regs32 {
95 unsigned int gpr[32];
96 unsigned int nip;
97 unsigned int msr;
98 unsigned int orig_gpr3; /* Used for restarting system calls */
99 unsigned int ctr;
100 unsigned int link;
101 unsigned int xer;
102 unsigned int ccr;
103 unsigned int mq; /* 601 only (not used at present) */
104 unsigned int trap; /* Reason for being here */
105 unsigned int dar; /* Fault registers */
106 unsigned int dsisr;
107 unsigned int result; /* Result of a system call */
108};
109
110struct sigcontext32 {
111 unsigned int _unused[4];
112 int signal;
113 compat_uptr_t handler;
114 unsigned int oldmask;
115 compat_uptr_t regs; /* 4 byte pointer to the pt_regs32 structure. */
116};
117
118struct mcontext32 {
119 elf_gregset_t32 mc_gregs;
120 elf_fpregset_t mc_fregs;
121 unsigned int mc_pad[2];
122 elf_vrregset_t32 mc_vregs __attribute__((__aligned__(16)));
123};
124
125struct ucontext32 {
126 unsigned int uc_flags;
127 unsigned int uc_link;
128 stack_32_t uc_stack;
129 int uc_pad[7];
130 compat_uptr_t uc_regs; /* points to uc_mcontext field */
131 compat_sigset_t uc_sigmask; /* mask last for extensibility */
132 /* glibc has 1024-bit signal masks, ours are 64-bit */
133 int uc_maskext[30];
134 int uc_pad2[3];
135 struct mcontext32 uc_mcontext;
136};
137
138#endif /* _PPC64_PPC32_H */
diff --git a/arch/powerpc/kernel/ppc_ksyms.c b/arch/powerpc/kernel/ppc_ksyms.c
index 8bc540337ba0..47d6f7e2ea9f 100644
--- a/arch/powerpc/kernel/ppc_ksyms.c
+++ b/arch/powerpc/kernel/ppc_ksyms.c
@@ -81,15 +81,6 @@ EXPORT_SYMBOL(_prep_type);
81EXPORT_SYMBOL(ucSystemType); 81EXPORT_SYMBOL(ucSystemType);
82#endif 82#endif
83 83
84#if !defined(__INLINE_BITOPS)
85EXPORT_SYMBOL(set_bit);
86EXPORT_SYMBOL(clear_bit);
87EXPORT_SYMBOL(change_bit);
88EXPORT_SYMBOL(test_and_set_bit);
89EXPORT_SYMBOL(test_and_clear_bit);
90EXPORT_SYMBOL(test_and_change_bit);
91#endif /* __INLINE_BITOPS */
92
93EXPORT_SYMBOL(strcpy); 84EXPORT_SYMBOL(strcpy);
94EXPORT_SYMBOL(strncpy); 85EXPORT_SYMBOL(strncpy);
95EXPORT_SYMBOL(strcat); 86EXPORT_SYMBOL(strcat);
diff --git a/arch/powerpc/kernel/process.c b/arch/powerpc/kernel/process.c
index 8f85dabe4df3..de69fb37c731 100644
--- a/arch/powerpc/kernel/process.c
+++ b/arch/powerpc/kernel/process.c
@@ -46,9 +46,9 @@
46#include <asm/processor.h> 46#include <asm/processor.h>
47#include <asm/mmu.h> 47#include <asm/mmu.h>
48#include <asm/prom.h> 48#include <asm/prom.h>
49#include <asm/machdep.h>
49#ifdef CONFIG_PPC64 50#ifdef CONFIG_PPC64
50#include <asm/firmware.h> 51#include <asm/firmware.h>
51#include <asm/plpar_wrappers.h>
52#include <asm/time.h> 52#include <asm/time.h>
53#endif 53#endif
54 54
@@ -201,27 +201,13 @@ int dump_spe(struct pt_regs *regs, elf_vrregset_t *evrregs)
201} 201}
202#endif /* CONFIG_SPE */ 202#endif /* CONFIG_SPE */
203 203
204static void set_dabr_spr(unsigned long val)
205{
206 mtspr(SPRN_DABR, val);
207}
208
209int set_dabr(unsigned long dabr) 204int set_dabr(unsigned long dabr)
210{ 205{
211 int ret = 0; 206 if (ppc_md.set_dabr)
212 207 return ppc_md.set_dabr(dabr);
213#ifdef CONFIG_PPC64
214 if (firmware_has_feature(FW_FEATURE_XDABR)) {
215 /* We want to catch accesses from kernel and userspace */
216 unsigned long flags = H_DABRX_KERNEL|H_DABRX_USER;
217 ret = plpar_set_xdabr(dabr, flags);
218 } else if (firmware_has_feature(FW_FEATURE_DABR)) {
219 ret = plpar_set_dabr(dabr);
220 } else
221#endif
222 set_dabr_spr(dabr);
223 208
224 return ret; 209 mtspr(SPRN_DABR, dabr);
210 return 0;
225} 211}
226 212
227#ifdef CONFIG_PPC64 213#ifdef CONFIG_PPC64
@@ -566,12 +552,10 @@ int copy_thread(int nr, unsigned long clone_flags, unsigned long usp,
566#ifdef CONFIG_PPC64 552#ifdef CONFIG_PPC64
567 if (cpu_has_feature(CPU_FTR_SLB)) { 553 if (cpu_has_feature(CPU_FTR_SLB)) {
568 unsigned long sp_vsid = get_kernel_vsid(sp); 554 unsigned long sp_vsid = get_kernel_vsid(sp);
555 unsigned long llp = mmu_psize_defs[mmu_linear_psize].sllp;
569 556
570 sp_vsid <<= SLB_VSID_SHIFT; 557 sp_vsid <<= SLB_VSID_SHIFT;
571 sp_vsid |= SLB_VSID_KERNEL; 558 sp_vsid |= SLB_VSID_KERNEL | llp;
572 if (cpu_has_feature(CPU_FTR_16M_PAGE))
573 sp_vsid |= SLB_VSID_L;
574
575 p->thread.ksp_vsid = sp_vsid; 559 p->thread.ksp_vsid = sp_vsid;
576 } 560 }
577 561
diff --git a/arch/powerpc/kernel/prom.c b/arch/powerpc/kernel/prom.c
index 2eccd0e159e3..f645adb57534 100644
--- a/arch/powerpc/kernel/prom.c
+++ b/arch/powerpc/kernel/prom.c
@@ -724,10 +724,10 @@ static inline char *find_flat_dt_string(u32 offset)
724 * used to extract the memory informations at boot before we can 724 * used to extract the memory informations at boot before we can
725 * unflatten the tree 725 * unflatten the tree
726 */ 726 */
727static int __init scan_flat_dt(int (*it)(unsigned long node, 727int __init of_scan_flat_dt(int (*it)(unsigned long node,
728 const char *uname, int depth, 728 const char *uname, int depth,
729 void *data), 729 void *data),
730 void *data) 730 void *data)
731{ 731{
732 unsigned long p = ((unsigned long)initial_boot_params) + 732 unsigned long p = ((unsigned long)initial_boot_params) +
733 initial_boot_params->off_dt_struct; 733 initial_boot_params->off_dt_struct;
@@ -784,8 +784,8 @@ static int __init scan_flat_dt(int (*it)(unsigned long node,
784 * This function can be used within scan_flattened_dt callback to get 784 * This function can be used within scan_flattened_dt callback to get
785 * access to properties 785 * access to properties
786 */ 786 */
787static void* __init get_flat_dt_prop(unsigned long node, const char *name, 787void* __init of_get_flat_dt_prop(unsigned long node, const char *name,
788 unsigned long *size) 788 unsigned long *size)
789{ 789{
790 unsigned long p = node; 790 unsigned long p = node;
791 791
@@ -1087,7 +1087,7 @@ void __init unflatten_device_tree(void)
1087static int __init early_init_dt_scan_cpus(unsigned long node, 1087static int __init early_init_dt_scan_cpus(unsigned long node,
1088 const char *uname, int depth, void *data) 1088 const char *uname, int depth, void *data)
1089{ 1089{
1090 char *type = get_flat_dt_prop(node, "device_type", NULL); 1090 char *type = of_get_flat_dt_prop(node, "device_type", NULL);
1091 u32 *prop; 1091 u32 *prop;
1092 unsigned long size = 0; 1092 unsigned long size = 0;
1093 1093
@@ -1095,19 +1095,6 @@ static int __init early_init_dt_scan_cpus(unsigned long node,
1095 if (type == NULL || strcmp(type, "cpu") != 0) 1095 if (type == NULL || strcmp(type, "cpu") != 0)
1096 return 0; 1096 return 0;
1097 1097
1098#ifdef CONFIG_PPC_PSERIES
1099 /* On LPAR, look for the first ibm,pft-size property for the hash table size
1100 */
1101 if (systemcfg->platform == PLATFORM_PSERIES_LPAR && ppc64_pft_size == 0) {
1102 u32 *pft_size;
1103 pft_size = get_flat_dt_prop(node, "ibm,pft-size", NULL);
1104 if (pft_size != NULL) {
1105 /* pft_size[0] is the NUMA CEC cookie */
1106 ppc64_pft_size = pft_size[1];
1107 }
1108 }
1109#endif
1110
1111 boot_cpuid = 0; 1098 boot_cpuid = 0;
1112 boot_cpuid_phys = 0; 1099 boot_cpuid_phys = 0;
1113 if (initial_boot_params && initial_boot_params->version >= 2) { 1100 if (initial_boot_params && initial_boot_params->version >= 2) {
@@ -1117,8 +1104,9 @@ static int __init early_init_dt_scan_cpus(unsigned long node,
1117 boot_cpuid_phys = initial_boot_params->boot_cpuid_phys; 1104 boot_cpuid_phys = initial_boot_params->boot_cpuid_phys;
1118 } else { 1105 } else {
1119 /* Check if it's the boot-cpu, set it's hw index now */ 1106 /* Check if it's the boot-cpu, set it's hw index now */
1120 if (get_flat_dt_prop(node, "linux,boot-cpu", NULL) != NULL) { 1107 if (of_get_flat_dt_prop(node,
1121 prop = get_flat_dt_prop(node, "reg", NULL); 1108 "linux,boot-cpu", NULL) != NULL) {
1109 prop = of_get_flat_dt_prop(node, "reg", NULL);
1122 if (prop != NULL) 1110 if (prop != NULL)
1123 boot_cpuid_phys = *prop; 1111 boot_cpuid_phys = *prop;
1124 } 1112 }
@@ -1127,14 +1115,14 @@ static int __init early_init_dt_scan_cpus(unsigned long node,
1127 1115
1128#ifdef CONFIG_ALTIVEC 1116#ifdef CONFIG_ALTIVEC
1129 /* Check if we have a VMX and eventually update CPU features */ 1117 /* Check if we have a VMX and eventually update CPU features */
1130 prop = (u32 *)get_flat_dt_prop(node, "ibm,vmx", &size); 1118 prop = (u32 *)of_get_flat_dt_prop(node, "ibm,vmx", &size);
1131 if (prop && (*prop) > 0) { 1119 if (prop && (*prop) > 0) {
1132 cur_cpu_spec->cpu_features |= CPU_FTR_ALTIVEC; 1120 cur_cpu_spec->cpu_features |= CPU_FTR_ALTIVEC;
1133 cur_cpu_spec->cpu_user_features |= PPC_FEATURE_HAS_ALTIVEC; 1121 cur_cpu_spec->cpu_user_features |= PPC_FEATURE_HAS_ALTIVEC;
1134 } 1122 }
1135 1123
1136 /* Same goes for Apple's "altivec" property */ 1124 /* Same goes for Apple's "altivec" property */
1137 prop = (u32 *)get_flat_dt_prop(node, "altivec", NULL); 1125 prop = (u32 *)of_get_flat_dt_prop(node, "altivec", NULL);
1138 if (prop) { 1126 if (prop) {
1139 cur_cpu_spec->cpu_features |= CPU_FTR_ALTIVEC; 1127 cur_cpu_spec->cpu_features |= CPU_FTR_ALTIVEC;
1140 cur_cpu_spec->cpu_user_features |= PPC_FEATURE_HAS_ALTIVEC; 1128 cur_cpu_spec->cpu_user_features |= PPC_FEATURE_HAS_ALTIVEC;
@@ -1147,7 +1135,7 @@ static int __init early_init_dt_scan_cpus(unsigned long node,
1147 * this by looking at the size of the ibm,ppc-interrupt-server#s 1135 * this by looking at the size of the ibm,ppc-interrupt-server#s
1148 * property 1136 * property
1149 */ 1137 */
1150 prop = (u32 *)get_flat_dt_prop(node, "ibm,ppc-interrupt-server#s", 1138 prop = (u32 *)of_get_flat_dt_prop(node, "ibm,ppc-interrupt-server#s",
1151 &size); 1139 &size);
1152 cur_cpu_spec->cpu_features &= ~CPU_FTR_SMT; 1140 cur_cpu_spec->cpu_features &= ~CPU_FTR_SMT;
1153 if (prop && ((size / sizeof(u32)) > 1)) 1141 if (prop && ((size / sizeof(u32)) > 1))
@@ -1170,7 +1158,7 @@ static int __init early_init_dt_scan_chosen(unsigned long node,
1170 return 0; 1158 return 0;
1171 1159
1172 /* get platform type */ 1160 /* get platform type */
1173 prop = (u32 *)get_flat_dt_prop(node, "linux,platform", NULL); 1161 prop = (u32 *)of_get_flat_dt_prop(node, "linux,platform", NULL);
1174 if (prop == NULL) 1162 if (prop == NULL)
1175 return 0; 1163 return 0;
1176#ifdef CONFIG_PPC64 1164#ifdef CONFIG_PPC64
@@ -1183,21 +1171,21 @@ static int __init early_init_dt_scan_chosen(unsigned long node,
1183 1171
1184#ifdef CONFIG_PPC64 1172#ifdef CONFIG_PPC64
1185 /* check if iommu is forced on or off */ 1173 /* check if iommu is forced on or off */
1186 if (get_flat_dt_prop(node, "linux,iommu-off", NULL) != NULL) 1174 if (of_get_flat_dt_prop(node, "linux,iommu-off", NULL) != NULL)
1187 iommu_is_off = 1; 1175 iommu_is_off = 1;
1188 if (get_flat_dt_prop(node, "linux,iommu-force-on", NULL) != NULL) 1176 if (of_get_flat_dt_prop(node, "linux,iommu-force-on", NULL) != NULL)
1189 iommu_force_on = 1; 1177 iommu_force_on = 1;
1190#endif 1178#endif
1191 1179
1192 lprop = get_flat_dt_prop(node, "linux,memory-limit", NULL); 1180 lprop = of_get_flat_dt_prop(node, "linux,memory-limit", NULL);
1193 if (lprop) 1181 if (lprop)
1194 memory_limit = *lprop; 1182 memory_limit = *lprop;
1195 1183
1196#ifdef CONFIG_PPC64 1184#ifdef CONFIG_PPC64
1197 lprop = get_flat_dt_prop(node, "linux,tce-alloc-start", NULL); 1185 lprop = of_get_flat_dt_prop(node, "linux,tce-alloc-start", NULL);
1198 if (lprop) 1186 if (lprop)
1199 tce_alloc_start = *lprop; 1187 tce_alloc_start = *lprop;
1200 lprop = get_flat_dt_prop(node, "linux,tce-alloc-end", NULL); 1188 lprop = of_get_flat_dt_prop(node, "linux,tce-alloc-end", NULL);
1201 if (lprop) 1189 if (lprop)
1202 tce_alloc_end = *lprop; 1190 tce_alloc_end = *lprop;
1203#endif 1191#endif
@@ -1209,9 +1197,9 @@ static int __init early_init_dt_scan_chosen(unsigned long node,
1209 { 1197 {
1210 u64 *basep, *entryp; 1198 u64 *basep, *entryp;
1211 1199
1212 basep = get_flat_dt_prop(node, "linux,rtas-base", NULL); 1200 basep = of_get_flat_dt_prop(node, "linux,rtas-base", NULL);
1213 entryp = get_flat_dt_prop(node, "linux,rtas-entry", NULL); 1201 entryp = of_get_flat_dt_prop(node, "linux,rtas-entry", NULL);
1214 prop = get_flat_dt_prop(node, "linux,rtas-size", NULL); 1202 prop = of_get_flat_dt_prop(node, "linux,rtas-size", NULL);
1215 if (basep && entryp && prop) { 1203 if (basep && entryp && prop) {
1216 rtas.base = *basep; 1204 rtas.base = *basep;
1217 rtas.entry = *entryp; 1205 rtas.entry = *entryp;
@@ -1232,11 +1220,11 @@ static int __init early_init_dt_scan_root(unsigned long node,
1232 if (depth != 0) 1220 if (depth != 0)
1233 return 0; 1221 return 0;
1234 1222
1235 prop = get_flat_dt_prop(node, "#size-cells", NULL); 1223 prop = of_get_flat_dt_prop(node, "#size-cells", NULL);
1236 dt_root_size_cells = (prop == NULL) ? 1 : *prop; 1224 dt_root_size_cells = (prop == NULL) ? 1 : *prop;
1237 DBG("dt_root_size_cells = %x\n", dt_root_size_cells); 1225 DBG("dt_root_size_cells = %x\n", dt_root_size_cells);
1238 1226
1239 prop = get_flat_dt_prop(node, "#address-cells", NULL); 1227 prop = of_get_flat_dt_prop(node, "#address-cells", NULL);
1240 dt_root_addr_cells = (prop == NULL) ? 2 : *prop; 1228 dt_root_addr_cells = (prop == NULL) ? 2 : *prop;
1241 DBG("dt_root_addr_cells = %x\n", dt_root_addr_cells); 1229 DBG("dt_root_addr_cells = %x\n", dt_root_addr_cells);
1242 1230
@@ -1271,7 +1259,7 @@ static unsigned long __init dt_mem_next_cell(int s, cell_t **cellp)
1271static int __init early_init_dt_scan_memory(unsigned long node, 1259static int __init early_init_dt_scan_memory(unsigned long node,
1272 const char *uname, int depth, void *data) 1260 const char *uname, int depth, void *data)
1273{ 1261{
1274 char *type = get_flat_dt_prop(node, "device_type", NULL); 1262 char *type = of_get_flat_dt_prop(node, "device_type", NULL);
1275 cell_t *reg, *endp; 1263 cell_t *reg, *endp;
1276 unsigned long l; 1264 unsigned long l;
1277 1265
@@ -1279,13 +1267,13 @@ static int __init early_init_dt_scan_memory(unsigned long node,
1279 if (type == NULL || strcmp(type, "memory") != 0) 1267 if (type == NULL || strcmp(type, "memory") != 0)
1280 return 0; 1268 return 0;
1281 1269
1282 reg = (cell_t *)get_flat_dt_prop(node, "reg", &l); 1270 reg = (cell_t *)of_get_flat_dt_prop(node, "reg", &l);
1283 if (reg == NULL) 1271 if (reg == NULL)
1284 return 0; 1272 return 0;
1285 1273
1286 endp = reg + (l / sizeof(cell_t)); 1274 endp = reg + (l / sizeof(cell_t));
1287 1275
1288 DBG("memory scan node %s ..., reg size %ld, data: %x %x %x %x, ...\n", 1276 DBG("memory scan node %s, reg size %ld, data: %x %x %x %x,\n",
1289 uname, l, reg[0], reg[1], reg[2], reg[3]); 1277 uname, l, reg[0], reg[1], reg[2], reg[3]);
1290 1278
1291 while ((endp - reg) >= (dt_root_addr_cells + dt_root_size_cells)) { 1279 while ((endp - reg) >= (dt_root_addr_cells + dt_root_size_cells)) {
@@ -1343,12 +1331,12 @@ void __init early_init_devtree(void *params)
1343 * device-tree, including the platform type, initrd location and 1331 * device-tree, including the platform type, initrd location and
1344 * size, TCE reserve, and more ... 1332 * size, TCE reserve, and more ...
1345 */ 1333 */
1346 scan_flat_dt(early_init_dt_scan_chosen, NULL); 1334 of_scan_flat_dt(early_init_dt_scan_chosen, NULL);
1347 1335
1348 /* Scan memory nodes and rebuild LMBs */ 1336 /* Scan memory nodes and rebuild LMBs */
1349 lmb_init(); 1337 lmb_init();
1350 scan_flat_dt(early_init_dt_scan_root, NULL); 1338 of_scan_flat_dt(early_init_dt_scan_root, NULL);
1351 scan_flat_dt(early_init_dt_scan_memory, NULL); 1339 of_scan_flat_dt(early_init_dt_scan_memory, NULL);
1352 lmb_enforce_memory_limit(memory_limit); 1340 lmb_enforce_memory_limit(memory_limit);
1353 lmb_analyze(); 1341 lmb_analyze();
1354#ifdef CONFIG_PPC64 1342#ifdef CONFIG_PPC64
@@ -1363,10 +1351,10 @@ void __init early_init_devtree(void *params)
1363 1351
1364 DBG("Scanning CPUs ...\n"); 1352 DBG("Scanning CPUs ...\n");
1365 1353
1366 /* Retreive hash table size from flattened tree plus other 1354 /* Retreive CPU related informations from the flat tree
1367 * CPU related informations (altivec support, boot CPU ID, ...) 1355 * (altivec support, boot CPU ID, ...)
1368 */ 1356 */
1369 scan_flat_dt(early_init_dt_scan_cpus, NULL); 1357 of_scan_flat_dt(early_init_dt_scan_cpus, NULL);
1370 1358
1371 DBG(" <- early_init_devtree()\n"); 1359 DBG(" <- early_init_devtree()\n");
1372} 1360}
@@ -1986,14 +1974,29 @@ EXPORT_SYMBOL(get_property);
1986/* 1974/*
1987 * Add a property to a node 1975 * Add a property to a node
1988 */ 1976 */
1989void prom_add_property(struct device_node* np, struct property* prop) 1977int prom_add_property(struct device_node* np, struct property* prop)
1990{ 1978{
1991 struct property **next = &np->properties; 1979 struct property **next;
1992 1980
1993 prop->next = NULL; 1981 prop->next = NULL;
1994 while (*next) 1982 write_lock(&devtree_lock);
1983 next = &np->properties;
1984 while (*next) {
1985 if (strcmp(prop->name, (*next)->name) == 0) {
1986 /* duplicate ! don't insert it */
1987 write_unlock(&devtree_lock);
1988 return -1;
1989 }
1995 next = &(*next)->next; 1990 next = &(*next)->next;
1991 }
1996 *next = prop; 1992 *next = prop;
1993 write_unlock(&devtree_lock);
1994
1995 /* try to add to proc as well if it was initialized */
1996 if (np->pde)
1997 proc_device_tree_add_prop(np->pde, prop);
1998
1999 return 0;
1997} 2000}
1998 2001
1999/* I quickly hacked that one, check against spec ! */ 2002/* I quickly hacked that one, check against spec ! */
diff --git a/arch/powerpc/kernel/prom_init.c b/arch/powerpc/kernel/prom_init.c
index 9750b3cd8ecd..6dc33d19fc2a 100644
--- a/arch/powerpc/kernel/prom_init.c
+++ b/arch/powerpc/kernel/prom_init.c
@@ -403,19 +403,19 @@ static int __init prom_next_node(phandle *nodep)
403 } 403 }
404} 404}
405 405
406static int __init prom_getprop(phandle node, const char *pname, 406static int inline prom_getprop(phandle node, const char *pname,
407 void *value, size_t valuelen) 407 void *value, size_t valuelen)
408{ 408{
409 return call_prom("getprop", 4, 1, node, ADDR(pname), 409 return call_prom("getprop", 4, 1, node, ADDR(pname),
410 (u32)(unsigned long) value, (u32) valuelen); 410 (u32)(unsigned long) value, (u32) valuelen);
411} 411}
412 412
413static int __init prom_getproplen(phandle node, const char *pname) 413static int inline prom_getproplen(phandle node, const char *pname)
414{ 414{
415 return call_prom("getproplen", 2, 1, node, ADDR(pname)); 415 return call_prom("getproplen", 2, 1, node, ADDR(pname));
416} 416}
417 417
418static int __init prom_setprop(phandle node, const char *pname, 418static int inline prom_setprop(phandle node, const char *pname,
419 void *value, size_t valuelen) 419 void *value, size_t valuelen)
420{ 420{
421 return call_prom("setprop", 4, 1, node, ADDR(pname), 421 return call_prom("setprop", 4, 1, node, ADDR(pname),
@@ -1408,8 +1408,9 @@ static int __init prom_find_machine_type(void)
1408 struct prom_t *_prom = &RELOC(prom); 1408 struct prom_t *_prom = &RELOC(prom);
1409 char compat[256]; 1409 char compat[256];
1410 int len, i = 0; 1410 int len, i = 0;
1411#ifdef CONFIG_PPC64
1411 phandle rtas; 1412 phandle rtas;
1412 1413#endif
1413 len = prom_getprop(_prom->root, "compatible", 1414 len = prom_getprop(_prom->root, "compatible",
1414 compat, sizeof(compat)-1); 1415 compat, sizeof(compat)-1);
1415 if (len > 0) { 1416 if (len > 0) {
@@ -1872,7 +1873,7 @@ static void __init fixup_device_tree(void)
1872 if (prom_getprop(u3, "device-rev", &u3_rev, sizeof(u3_rev)) 1873 if (prom_getprop(u3, "device-rev", &u3_rev, sizeof(u3_rev))
1873 == PROM_ERROR) 1874 == PROM_ERROR)
1874 return; 1875 return;
1875 if (u3_rev != 0x35 && u3_rev != 0x37) 1876 if (u3_rev < 0x35 || u3_rev > 0x39)
1876 return; 1877 return;
1877 /* does it need fixup ? */ 1878 /* does it need fixup ? */
1878 if (prom_getproplen(i2c, "interrupts") > 0) 1879 if (prom_getproplen(i2c, "interrupts") > 0)
@@ -2000,7 +2001,7 @@ unsigned long __init prom_init(unsigned long r3, unsigned long r4,
2000#endif 2001#endif
2001 2002
2002 /* 2003 /*
2003 * On pSeries and BPA, copy the CPU hold code 2004 * Copy the CPU hold code
2004 */ 2005 */
2005 if (RELOC(of_platform) != PLATFORM_POWERMAC) 2006 if (RELOC(of_platform) != PLATFORM_POWERMAC)
2006 copy_and_flush(0, KERNELBASE + offset, 0x100, 0); 2007 copy_and_flush(0, KERNELBASE + offset, 0x100, 0);
diff --git a/arch/powerpc/kernel/ptrace.c b/arch/powerpc/kernel/ptrace.c
index 568ea335d616..3d2abd95c7ae 100644
--- a/arch/powerpc/kernel/ptrace.c
+++ b/arch/powerpc/kernel/ptrace.c
@@ -248,46 +248,10 @@ void ptrace_disable(struct task_struct *child)
248 clear_single_step(child); 248 clear_single_step(child);
249} 249}
250 250
251long sys_ptrace(long request, long pid, long addr, long data) 251long arch_ptrace(struct task_struct *child, long request, long addr, long data)
252{ 252{
253 struct task_struct *child;
254 int ret = -EPERM; 253 int ret = -EPERM;
255 254
256 lock_kernel();
257 if (request == PTRACE_TRACEME) {
258 /* are we already being traced? */
259 if (current->ptrace & PT_PTRACED)
260 goto out;
261 ret = security_ptrace(current->parent, current);
262 if (ret)
263 goto out;
264 /* set the ptrace bit in the process flags. */
265 current->ptrace |= PT_PTRACED;
266 ret = 0;
267 goto out;
268 }
269 ret = -ESRCH;
270 read_lock(&tasklist_lock);
271 child = find_task_by_pid(pid);
272 if (child)
273 get_task_struct(child);
274 read_unlock(&tasklist_lock);
275 if (!child)
276 goto out;
277
278 ret = -EPERM;
279 if (pid == 1) /* you may not mess with init */
280 goto out_tsk;
281
282 if (request == PTRACE_ATTACH) {
283 ret = ptrace_attach(child);
284 goto out_tsk;
285 }
286
287 ret = ptrace_check_attach(child, request == PTRACE_KILL);
288 if (ret < 0)
289 goto out_tsk;
290
291 switch (request) { 255 switch (request) {
292 /* when I and D space are separate, these will need to be fixed. */ 256 /* when I and D space are separate, these will need to be fixed. */
293 case PTRACE_PEEKTEXT: /* read word at location addr. */ 257 case PTRACE_PEEKTEXT: /* read word at location addr. */
@@ -540,10 +504,7 @@ long sys_ptrace(long request, long pid, long addr, long data)
540 ret = ptrace_request(child, request, addr, data); 504 ret = ptrace_request(child, request, addr, data);
541 break; 505 break;
542 } 506 }
543out_tsk: 507
544 put_task_struct(child);
545out:
546 unlock_kernel();
547 return ret; 508 return ret;
548} 509}
549 510
diff --git a/arch/ppc64/kernel/rtas-proc.c b/arch/powerpc/kernel/rtas-proc.c
index 5bdd5b079d96..5bdd5b079d96 100644
--- a/arch/ppc64/kernel/rtas-proc.c
+++ b/arch/powerpc/kernel/rtas-proc.c
diff --git a/arch/powerpc/kernel/rtas.c b/arch/powerpc/kernel/rtas.c
index 4d22eeeeb91d..9d4e07f6f1ec 100644
--- a/arch/powerpc/kernel/rtas.c
+++ b/arch/powerpc/kernel/rtas.c
@@ -17,6 +17,7 @@
17#include <linux/spinlock.h> 17#include <linux/spinlock.h>
18#include <linux/module.h> 18#include <linux/module.h>
19#include <linux/init.h> 19#include <linux/init.h>
20#include <linux/delay.h>
20 21
21#include <asm/prom.h> 22#include <asm/prom.h>
22#include <asm/rtas.h> 23#include <asm/rtas.h>
@@ -43,6 +44,13 @@ char rtas_data_buf[RTAS_DATA_BUF_SIZE] __cacheline_aligned;
43unsigned long rtas_rmo_buf; 44unsigned long rtas_rmo_buf;
44 45
45/* 46/*
47 * If non-NULL, this gets called when the kernel terminates.
48 * This is done like this so rtas_flash can be a module.
49 */
50void (*rtas_flash_term_hook)(int);
51EXPORT_SYMBOL(rtas_flash_term_hook);
52
53/*
46 * call_rtas_display_status and call_rtas_display_status_delay 54 * call_rtas_display_status and call_rtas_display_status_delay
47 * are designed only for very early low-level debugging, which 55 * are designed only for very early low-level debugging, which
48 * is why the token is hard-coded to 10. 56 * is why the token is hard-coded to 10.
@@ -76,7 +84,7 @@ void call_rtas_display_status_delay(unsigned char c)
76 while (width-- > 0) 84 while (width-- > 0)
77 call_rtas_display_status(' '); 85 call_rtas_display_status(' ');
78 width = 16; 86 width = 16;
79 udelay(500000); 87 mdelay(500);
80 pending_newline = 1; 88 pending_newline = 1;
81 } else { 89 } else {
82 if (pending_newline) { 90 if (pending_newline) {
@@ -206,6 +214,7 @@ void rtas_progress(char *s, unsigned short hex)
206 214
207 spin_unlock(&progress_lock); 215 spin_unlock(&progress_lock);
208} 216}
217EXPORT_SYMBOL(rtas_progress); /* needed by rtas_flash module */
209 218
210int rtas_token(const char *service) 219int rtas_token(const char *service)
211{ 220{
@@ -492,6 +501,8 @@ int rtas_set_indicator(int indicator, int index, int new_value)
492 501
493void rtas_restart(char *cmd) 502void rtas_restart(char *cmd)
494{ 503{
504 if (rtas_flash_term_hook)
505 rtas_flash_term_hook(SYS_RESTART);
495 printk("RTAS system-reboot returned %d\n", 506 printk("RTAS system-reboot returned %d\n",
496 rtas_call(rtas_token("system-reboot"), 0, 1, NULL)); 507 rtas_call(rtas_token("system-reboot"), 0, 1, NULL));
497 for (;;); 508 for (;;);
@@ -499,6 +510,8 @@ void rtas_restart(char *cmd)
499 510
500void rtas_power_off(void) 511void rtas_power_off(void)
501{ 512{
513 if (rtas_flash_term_hook)
514 rtas_flash_term_hook(SYS_POWER_OFF);
502 /* allow power on only with power button press */ 515 /* allow power on only with power button press */
503 printk("RTAS power-off returned %d\n", 516 printk("RTAS power-off returned %d\n",
504 rtas_call(rtas_token("power-off"), 2, 1, NULL, -1, -1)); 517 rtas_call(rtas_token("power-off"), 2, 1, NULL, -1, -1));
@@ -507,7 +520,12 @@ void rtas_power_off(void)
507 520
508void rtas_halt(void) 521void rtas_halt(void)
509{ 522{
510 rtas_power_off(); 523 if (rtas_flash_term_hook)
524 rtas_flash_term_hook(SYS_HALT);
525 /* allow power on only with power button press */
526 printk("RTAS power-off returned %d\n",
527 rtas_call(rtas_token("power-off"), 2, 1, NULL, -1, -1));
528 for (;;);
511} 529}
512 530
513/* Must be in the RMO region, so we place it here */ 531/* Must be in the RMO region, so we place it here */
@@ -591,7 +609,6 @@ asmlinkage int ppc_rtas(struct rtas_args __user *uargs)
591 return 0; 609 return 0;
592} 610}
593 611
594#ifdef CONFIG_SMP
595/* This version can't take the spinlock, because it never returns */ 612/* This version can't take the spinlock, because it never returns */
596 613
597struct rtas_args rtas_stop_self_args = { 614struct rtas_args rtas_stop_self_args = {
@@ -616,7 +633,6 @@ void rtas_stop_self(void)
616 633
617 panic("Alas, I survived.\n"); 634 panic("Alas, I survived.\n");
618} 635}
619#endif
620 636
621/* 637/*
622 * Call early during boot, before mem init or bootmem, to retreive the RTAS 638 * Call early during boot, before mem init or bootmem, to retreive the RTAS
diff --git a/arch/ppc64/kernel/rtas_flash.c b/arch/powerpc/kernel/rtas_flash.c
index 923e2e201a70..50500093c97f 100644
--- a/arch/ppc64/kernel/rtas_flash.c
+++ b/arch/powerpc/kernel/rtas_flash.c
@@ -19,6 +19,7 @@
19#include <asm/delay.h> 19#include <asm/delay.h>
20#include <asm/uaccess.h> 20#include <asm/uaccess.h>
21#include <asm/rtas.h> 21#include <asm/rtas.h>
22#include <asm/abs_addr.h>
22 23
23#define MODULE_VERS "1.0" 24#define MODULE_VERS "1.0"
24#define MODULE_NAME "rtas_flash" 25#define MODULE_NAME "rtas_flash"
@@ -71,10 +72,36 @@
71#define VALIDATE_BUF_SIZE 4096 72#define VALIDATE_BUF_SIZE 4096
72#define RTAS_MSG_MAXLEN 64 73#define RTAS_MSG_MAXLEN 64
73 74
75struct flash_block {
76 char *data;
77 unsigned long length;
78};
79
80/* This struct is very similar but not identical to
81 * that needed by the rtas flash update.
82 * All we need to do for rtas is rewrite num_blocks
83 * into a version/length and translate the pointers
84 * to absolute.
85 */
86#define FLASH_BLOCKS_PER_NODE ((PAGE_SIZE - 16) / sizeof(struct flash_block))
87struct flash_block_list {
88 unsigned long num_blocks;
89 struct flash_block_list *next;
90 struct flash_block blocks[FLASH_BLOCKS_PER_NODE];
91};
92struct flash_block_list_header { /* just the header of flash_block_list */
93 unsigned long num_blocks;
94 struct flash_block_list *next;
95};
96
97static struct flash_block_list_header rtas_firmware_flash_list = {0, NULL};
98
99#define FLASH_BLOCK_LIST_VERSION (1UL)
100
74/* Local copy of the flash block list. 101/* Local copy of the flash block list.
75 * We only allow one open of the flash proc file and create this 102 * We only allow one open of the flash proc file and create this
76 * list as we go. This list will be put in the kernel's 103 * list as we go. This list will be put in the
77 * rtas_firmware_flash_list global var once it is fully read. 104 * rtas_firmware_flash_list var once it is fully read.
78 * 105 *
79 * For convenience as we build the list we use virtual addrs, 106 * For convenience as we build the list we use virtual addrs,
80 * we do not fill in the version number, and the length field 107 * we do not fill in the version number, and the length field
@@ -562,6 +589,86 @@ static int validate_flash_release(struct inode *inode, struct file *file)
562 return 0; 589 return 0;
563} 590}
564 591
592static void rtas_flash_firmware(int reboot_type)
593{
594 unsigned long image_size;
595 struct flash_block_list *f, *next, *flist;
596 unsigned long rtas_block_list;
597 int i, status, update_token;
598
599 if (rtas_firmware_flash_list.next == NULL)
600 return; /* nothing to do */
601
602 if (reboot_type != SYS_RESTART) {
603 printk(KERN_ALERT "FLASH: firmware flash requires a reboot\n");
604 printk(KERN_ALERT "FLASH: the firmware image will NOT be flashed\n");
605 return;
606 }
607
608 update_token = rtas_token("ibm,update-flash-64-and-reboot");
609 if (update_token == RTAS_UNKNOWN_SERVICE) {
610 printk(KERN_ALERT "FLASH: ibm,update-flash-64-and-reboot "
611 "is not available -- not a service partition?\n");
612 printk(KERN_ALERT "FLASH: firmware will not be flashed\n");
613 return;
614 }
615
616 /* NOTE: the "first" block list is a global var with no data
617 * blocks in the kernel data segment. We do this because
618 * we want to ensure this block_list addr is under 4GB.
619 */
620 rtas_firmware_flash_list.num_blocks = 0;
621 flist = (struct flash_block_list *)&rtas_firmware_flash_list;
622 rtas_block_list = virt_to_abs(flist);
623 if (rtas_block_list >= 4UL*1024*1024*1024) {
624 printk(KERN_ALERT "FLASH: kernel bug...flash list header addr above 4GB\n");
625 return;
626 }
627
628 printk(KERN_ALERT "FLASH: preparing saved firmware image for flash\n");
629 /* Update the block_list in place. */
630 image_size = 0;
631 for (f = flist; f; f = next) {
632 /* Translate data addrs to absolute */
633 for (i = 0; i < f->num_blocks; i++) {
634 f->blocks[i].data = (char *)virt_to_abs(f->blocks[i].data);
635 image_size += f->blocks[i].length;
636 }
637 next = f->next;
638 /* Don't translate NULL pointer for last entry */
639 if (f->next)
640 f->next = (struct flash_block_list *)virt_to_abs(f->next);
641 else
642 f->next = NULL;
643 /* make num_blocks into the version/length field */
644 f->num_blocks = (FLASH_BLOCK_LIST_VERSION << 56) | ((f->num_blocks+1)*16);
645 }
646
647 printk(KERN_ALERT "FLASH: flash image is %ld bytes\n", image_size);
648 printk(KERN_ALERT "FLASH: performing flash and reboot\n");
649 rtas_progress("Flashing \n", 0x0);
650 rtas_progress("Please Wait... ", 0x0);
651 printk(KERN_ALERT "FLASH: this will take several minutes. Do not power off!\n");
652 status = rtas_call(update_token, 1, 1, NULL, rtas_block_list);
653 switch (status) { /* should only get "bad" status */
654 case 0:
655 printk(KERN_ALERT "FLASH: success\n");
656 break;
657 case -1:
658 printk(KERN_ALERT "FLASH: hardware error. Firmware may not be not flashed\n");
659 break;
660 case -3:
661 printk(KERN_ALERT "FLASH: image is corrupt or not correct for this platform. Firmware not flashed\n");
662 break;
663 case -4:
664 printk(KERN_ALERT "FLASH: flash failed when partially complete. System may not reboot\n");
665 break;
666 default:
667 printk(KERN_ALERT "FLASH: unknown flash return code %d\n", status);
668 break;
669 }
670}
671
565static void remove_flash_pde(struct proc_dir_entry *dp) 672static void remove_flash_pde(struct proc_dir_entry *dp)
566{ 673{
567 if (dp) { 674 if (dp) {
@@ -701,6 +808,7 @@ int __init rtas_flash_init(void)
701 if (rc != 0) 808 if (rc != 0)
702 goto cleanup; 809 goto cleanup;
703 810
811 rtas_flash_term_hook = rtas_flash_firmware;
704 return 0; 812 return 0;
705 813
706cleanup: 814cleanup:
@@ -714,6 +822,7 @@ cleanup:
714 822
715void __exit rtas_flash_cleanup(void) 823void __exit rtas_flash_cleanup(void)
716{ 824{
825 rtas_flash_term_hook = NULL;
717 remove_flash_pde(firmware_flash_pde); 826 remove_flash_pde(firmware_flash_pde);
718 remove_flash_pde(firmware_update_pde); 827 remove_flash_pde(firmware_update_pde);
719 remove_flash_pde(validate_pde); 828 remove_flash_pde(validate_pde);
diff --git a/arch/powerpc/kernel/setup-common.c b/arch/powerpc/kernel/setup-common.c
index 1292460fcde2..e22856ecb5a0 100644
--- a/arch/powerpc/kernel/setup-common.c
+++ b/arch/powerpc/kernel/setup-common.c
@@ -170,12 +170,8 @@ static int show_cpuinfo(struct seq_file *m, void *v)
170 } 170 }
171 171
172#ifdef CONFIG_SMP 172#ifdef CONFIG_SMP
173#ifdef CONFIG_PPC64 /* XXX for now */
174 pvr = per_cpu(pvr, cpu_id); 173 pvr = per_cpu(pvr, cpu_id);
175#else 174#else
176 pvr = cpu_data[cpu_id].pvr;
177#endif
178#else
179 pvr = mfspr(SPRN_PVR); 175 pvr = mfspr(SPRN_PVR);
180#endif 176#endif
181 maj = (pvr >> 8) & 0xFF; 177 maj = (pvr >> 8) & 0xFF;
@@ -201,11 +197,11 @@ static int show_cpuinfo(struct seq_file *m, void *v)
201#ifdef CONFIG_TAU_AVERAGE 197#ifdef CONFIG_TAU_AVERAGE
202 /* more straightforward, but potentially misleading */ 198 /* more straightforward, but potentially misleading */
203 seq_printf(m, "temperature \t: %u C (uncalibrated)\n", 199 seq_printf(m, "temperature \t: %u C (uncalibrated)\n",
204 cpu_temp(i)); 200 cpu_temp(cpu_id));
205#else 201#else
206 /* show the actual temp sensor range */ 202 /* show the actual temp sensor range */
207 u32 temp; 203 u32 temp;
208 temp = cpu_temp_both(i); 204 temp = cpu_temp_both(cpu_id);
209 seq_printf(m, "temperature \t: %u-%u C (uncalibrated)\n", 205 seq_printf(m, "temperature \t: %u-%u C (uncalibrated)\n",
210 temp & 0xff, temp >> 16); 206 temp & 0xff, temp >> 16);
211#endif 207#endif
@@ -408,3 +404,158 @@ static int __init set_preferred_console(void)
408} 404}
409console_initcall(set_preferred_console); 405console_initcall(set_preferred_console);
410#endif /* CONFIG_PPC_MULTIPLATFORM */ 406#endif /* CONFIG_PPC_MULTIPLATFORM */
407
408void __init check_for_initrd(void)
409{
410#ifdef CONFIG_BLK_DEV_INITRD
411 unsigned long *prop;
412
413 DBG(" -> check_for_initrd()\n");
414
415 if (of_chosen) {
416 prop = (unsigned long *)get_property(of_chosen,
417 "linux,initrd-start", NULL);
418 if (prop != NULL) {
419 initrd_start = (unsigned long)__va(*prop);
420 prop = (unsigned long *)get_property(of_chosen,
421 "linux,initrd-end", NULL);
422 if (prop != NULL) {
423 initrd_end = (unsigned long)__va(*prop);
424 initrd_below_start_ok = 1;
425 } else
426 initrd_start = 0;
427 }
428 }
429
430 /* If we were passed an initrd, set the ROOT_DEV properly if the values
431 * look sensible. If not, clear initrd reference.
432 */
433 if (initrd_start >= KERNELBASE && initrd_end >= KERNELBASE &&
434 initrd_end > initrd_start)
435 ROOT_DEV = Root_RAM0;
436 else {
437 printk("Bogus initrd %08lx %08lx\n", initrd_start, initrd_end);
438 initrd_start = initrd_end = 0;
439 }
440
441 if (initrd_start)
442 printk("Found initrd at 0x%lx:0x%lx\n", initrd_start, initrd_end);
443
444 DBG(" <- check_for_initrd()\n");
445#endif /* CONFIG_BLK_DEV_INITRD */
446}
447
448#ifdef CONFIG_SMP
449
450/**
451 * setup_cpu_maps - initialize the following cpu maps:
452 * cpu_possible_map
453 * cpu_present_map
454 * cpu_sibling_map
455 *
456 * Having the possible map set up early allows us to restrict allocations
457 * of things like irqstacks to num_possible_cpus() rather than NR_CPUS.
458 *
459 * We do not initialize the online map here; cpus set their own bits in
460 * cpu_online_map as they come up.
461 *
462 * This function is valid only for Open Firmware systems. finish_device_tree
463 * must be called before using this.
464 *
465 * While we're here, we may as well set the "physical" cpu ids in the paca.
466 */
467void __init smp_setup_cpu_maps(void)
468{
469 struct device_node *dn = NULL;
470 int cpu = 0;
471 int swap_cpuid = 0;
472
473 while ((dn = of_find_node_by_type(dn, "cpu")) && cpu < NR_CPUS) {
474 int *intserv;
475 int j, len = sizeof(u32), nthreads = 1;
476
477 intserv = (int *)get_property(dn, "ibm,ppc-interrupt-server#s",
478 &len);
479 if (intserv)
480 nthreads = len / sizeof(int);
481 else {
482 intserv = (int *) get_property(dn, "reg", NULL);
483 if (!intserv)
484 intserv = &cpu; /* assume logical == phys */
485 }
486
487 for (j = 0; j < nthreads && cpu < NR_CPUS; j++) {
488 cpu_set(cpu, cpu_present_map);
489 set_hard_smp_processor_id(cpu, intserv[j]);
490
491 if (intserv[j] == boot_cpuid_phys)
492 swap_cpuid = cpu;
493 cpu_set(cpu, cpu_possible_map);
494 cpu++;
495 }
496 }
497
498 /* Swap CPU id 0 with boot_cpuid_phys, so we can always assume that
499 * boot cpu is logical 0.
500 */
501 if (boot_cpuid_phys != get_hard_smp_processor_id(0)) {
502 u32 tmp;
503 tmp = get_hard_smp_processor_id(0);
504 set_hard_smp_processor_id(0, boot_cpuid_phys);
505 set_hard_smp_processor_id(swap_cpuid, tmp);
506 }
507
508#ifdef CONFIG_PPC64
509 /*
510 * On pSeries LPAR, we need to know how many cpus
511 * could possibly be added to this partition.
512 */
513 if (systemcfg->platform == PLATFORM_PSERIES_LPAR &&
514 (dn = of_find_node_by_path("/rtas"))) {
515 int num_addr_cell, num_size_cell, maxcpus;
516 unsigned int *ireg;
517
518 num_addr_cell = prom_n_addr_cells(dn);
519 num_size_cell = prom_n_size_cells(dn);
520
521 ireg = (unsigned int *)
522 get_property(dn, "ibm,lrdr-capacity", NULL);
523
524 if (!ireg)
525 goto out;
526
527 maxcpus = ireg[num_addr_cell + num_size_cell];
528
529 /* Double maxcpus for processors which have SMT capability */
530 if (cpu_has_feature(CPU_FTR_SMT))
531 maxcpus *= 2;
532
533 if (maxcpus > NR_CPUS) {
534 printk(KERN_WARNING
535 "Partition configured for %d cpus, "
536 "operating system maximum is %d.\n",
537 maxcpus, NR_CPUS);
538 maxcpus = NR_CPUS;
539 } else
540 printk(KERN_INFO "Partition configured for %d cpus.\n",
541 maxcpus);
542
543 for (cpu = 0; cpu < maxcpus; cpu++)
544 cpu_set(cpu, cpu_possible_map);
545 out:
546 of_node_put(dn);
547 }
548
549 /*
550 * Do the sibling map; assume only two threads per processor.
551 */
552 for_each_cpu(cpu) {
553 cpu_set(cpu, cpu_sibling_map[cpu]);
554 if (cpu_has_feature(CPU_FTR_SMT))
555 cpu_set(cpu ^ 0x1, cpu_sibling_map[cpu]);
556 }
557
558 systemcfg->processorCount = num_present_cpus();
559#endif /* CONFIG_PPC64 */
560}
561#endif /* CONFIG_SMP */
diff --git a/arch/powerpc/kernel/setup_32.c b/arch/powerpc/kernel/setup_32.c
index 9680ae99b084..3af2631e3fab 100644
--- a/arch/powerpc/kernel/setup_32.c
+++ b/arch/powerpc/kernel/setup_32.c
@@ -286,8 +286,11 @@ void __init setup_arch(char **cmdline_p)
286 loops_per_jiffy = 500000000 / HZ; 286 loops_per_jiffy = 500000000 / HZ;
287 287
288 unflatten_device_tree(); 288 unflatten_device_tree();
289 check_for_initrd();
289 finish_device_tree(); 290 finish_device_tree();
290 291
292 smp_setup_cpu_maps();
293
291#ifdef CONFIG_BOOTX_TEXT 294#ifdef CONFIG_BOOTX_TEXT
292 init_boot_display(); 295 init_boot_display();
293#endif 296#endif
diff --git a/arch/powerpc/kernel/setup_64.c b/arch/powerpc/kernel/setup_64.c
index 40c48100bf1b..0471e843b6c5 100644
--- a/arch/powerpc/kernel/setup_64.c
+++ b/arch/powerpc/kernel/setup_64.c
@@ -41,7 +41,6 @@
41#include <asm/elf.h> 41#include <asm/elf.h>
42#include <asm/machdep.h> 42#include <asm/machdep.h>
43#include <asm/paca.h> 43#include <asm/paca.h>
44#include <asm/ppcdebug.h>
45#include <asm/time.h> 44#include <asm/time.h>
46#include <asm/cputable.h> 45#include <asm/cputable.h>
47#include <asm/sections.h> 46#include <asm/sections.h>
@@ -56,10 +55,11 @@
56#include <asm/page.h> 55#include <asm/page.h>
57#include <asm/mmu.h> 56#include <asm/mmu.h>
58#include <asm/lmb.h> 57#include <asm/lmb.h>
59#include <asm/iSeries/ItLpNaca.h> 58#include <asm/iseries/it_lp_naca.h>
60#include <asm/firmware.h> 59#include <asm/firmware.h>
61#include <asm/systemcfg.h> 60#include <asm/systemcfg.h>
62#include <asm/xmon.h> 61#include <asm/xmon.h>
62#include <asm/udbg.h>
63 63
64#ifdef DEBUG 64#ifdef DEBUG
65#define DBG(fmt...) udbg_printf(fmt) 65#define DBG(fmt...) udbg_printf(fmt)
@@ -103,8 +103,6 @@ extern void htab_initialize(void);
103extern void early_init_devtree(void *flat_dt); 103extern void early_init_devtree(void *flat_dt);
104extern void unflatten_device_tree(void); 104extern void unflatten_device_tree(void);
105 105
106extern void smp_release_cpus(void);
107
108int have_of = 1; 106int have_of = 1;
109int boot_cpuid = 0; 107int boot_cpuid = 0;
110int boot_cpuid_phys = 0; 108int boot_cpuid_phys = 0;
@@ -183,120 +181,14 @@ static int __init early_smt_enabled(char *p)
183} 181}
184early_param("smt-enabled", early_smt_enabled); 182early_param("smt-enabled", early_smt_enabled);
185 183
186/** 184#else
187 * setup_cpu_maps - initialize the following cpu maps: 185#define check_smt_enabled()
188 * cpu_possible_map
189 * cpu_present_map
190 * cpu_sibling_map
191 *
192 * Having the possible map set up early allows us to restrict allocations
193 * of things like irqstacks to num_possible_cpus() rather than NR_CPUS.
194 *
195 * We do not initialize the online map here; cpus set their own bits in
196 * cpu_online_map as they come up.
197 *
198 * This function is valid only for Open Firmware systems. finish_device_tree
199 * must be called before using this.
200 *
201 * While we're here, we may as well set the "physical" cpu ids in the paca.
202 */
203static void __init setup_cpu_maps(void)
204{
205 struct device_node *dn = NULL;
206 int cpu = 0;
207 int swap_cpuid = 0;
208
209 check_smt_enabled();
210
211 while ((dn = of_find_node_by_type(dn, "cpu")) && cpu < NR_CPUS) {
212 u32 *intserv;
213 int j, len = sizeof(u32), nthreads;
214
215 intserv = (u32 *)get_property(dn, "ibm,ppc-interrupt-server#s",
216 &len);
217 if (!intserv)
218 intserv = (u32 *)get_property(dn, "reg", NULL);
219
220 nthreads = len / sizeof(u32);
221
222 for (j = 0; j < nthreads && cpu < NR_CPUS; j++) {
223 cpu_set(cpu, cpu_present_map);
224 set_hard_smp_processor_id(cpu, intserv[j]);
225
226 if (intserv[j] == boot_cpuid_phys)
227 swap_cpuid = cpu;
228 cpu_set(cpu, cpu_possible_map);
229 cpu++;
230 }
231 }
232
233 /* Swap CPU id 0 with boot_cpuid_phys, so we can always assume that
234 * boot cpu is logical 0.
235 */
236 if (boot_cpuid_phys != get_hard_smp_processor_id(0)) {
237 u32 tmp;
238 tmp = get_hard_smp_processor_id(0);
239 set_hard_smp_processor_id(0, boot_cpuid_phys);
240 set_hard_smp_processor_id(swap_cpuid, tmp);
241 }
242
243 /*
244 * On pSeries LPAR, we need to know how many cpus
245 * could possibly be added to this partition.
246 */
247 if (systemcfg->platform == PLATFORM_PSERIES_LPAR &&
248 (dn = of_find_node_by_path("/rtas"))) {
249 int num_addr_cell, num_size_cell, maxcpus;
250 unsigned int *ireg;
251
252 num_addr_cell = prom_n_addr_cells(dn);
253 num_size_cell = prom_n_size_cells(dn);
254
255 ireg = (unsigned int *)
256 get_property(dn, "ibm,lrdr-capacity", NULL);
257
258 if (!ireg)
259 goto out;
260
261 maxcpus = ireg[num_addr_cell + num_size_cell];
262
263 /* Double maxcpus for processors which have SMT capability */
264 if (cpu_has_feature(CPU_FTR_SMT))
265 maxcpus *= 2;
266
267 if (maxcpus > NR_CPUS) {
268 printk(KERN_WARNING
269 "Partition configured for %d cpus, "
270 "operating system maximum is %d.\n",
271 maxcpus, NR_CPUS);
272 maxcpus = NR_CPUS;
273 } else
274 printk(KERN_INFO "Partition configured for %d cpus.\n",
275 maxcpus);
276
277 for (cpu = 0; cpu < maxcpus; cpu++)
278 cpu_set(cpu, cpu_possible_map);
279 out:
280 of_node_put(dn);
281 }
282
283 /*
284 * Do the sibling map; assume only two threads per processor.
285 */
286 for_each_cpu(cpu) {
287 cpu_set(cpu, cpu_sibling_map[cpu]);
288 if (cpu_has_feature(CPU_FTR_SMT))
289 cpu_set(cpu ^ 0x1, cpu_sibling_map[cpu]);
290 }
291
292 systemcfg->processorCount = num_present_cpus();
293}
294#endif /* CONFIG_SMP */ 186#endif /* CONFIG_SMP */
295 187
296extern struct machdep_calls pSeries_md; 188extern struct machdep_calls pSeries_md;
297extern struct machdep_calls pmac_md; 189extern struct machdep_calls pmac_md;
298extern struct machdep_calls maple_md; 190extern struct machdep_calls maple_md;
299extern struct machdep_calls bpa_md; 191extern struct machdep_calls cell_md;
300extern struct machdep_calls iseries_md; 192extern struct machdep_calls iseries_md;
301 193
302/* Ultimately, stuff them in an elf section like initcalls... */ 194/* Ultimately, stuff them in an elf section like initcalls... */
@@ -310,8 +202,8 @@ static struct machdep_calls __initdata *machines[] = {
310#ifdef CONFIG_PPC_MAPLE 202#ifdef CONFIG_PPC_MAPLE
311 &maple_md, 203 &maple_md,
312#endif /* CONFIG_PPC_MAPLE */ 204#endif /* CONFIG_PPC_MAPLE */
313#ifdef CONFIG_PPC_BPA 205#ifdef CONFIG_PPC_CELL
314 &bpa_md, 206 &cell_md,
315#endif 207#endif
316#ifdef CONFIG_PPC_ISERIES 208#ifdef CONFIG_PPC_ISERIES
317 &iseries_md, 209 &iseries_md,
@@ -352,12 +244,6 @@ void __init early_setup(unsigned long dt_ptr)
352 DBG(" -> early_setup()\n"); 244 DBG(" -> early_setup()\n");
353 245
354 /* 246 /*
355 * Fill the default DBG level (do we want to keep
356 * that old mecanism around forever ?)
357 */
358 ppcdbg_initialize();
359
360 /*
361 * Do early initializations using the flattened device 247 * Do early initializations using the flattened device
362 * tree, like retreiving the physical memory map or 248 * tree, like retreiving the physical memory map or
363 * calculating/retreiving the hash table size 249 * calculating/retreiving the hash table size
@@ -385,21 +271,49 @@ void __init early_setup(unsigned long dt_ptr)
385 DBG("Found, Initializing memory management...\n"); 271 DBG("Found, Initializing memory management...\n");
386 272
387 /* 273 /*
388 * Initialize stab / SLB management 274 * Initialize the MMU Hash table and create the linear mapping
275 * of memory. Has to be done before stab/slb initialization as
276 * this is currently where the page size encoding is obtained
389 */ 277 */
390 if (!firmware_has_feature(FW_FEATURE_ISERIES)) 278 htab_initialize();
391 stab_initialize(lpaca->stab_real);
392 279
393 /* 280 /*
394 * Initialize the MMU Hash table and create the linear mapping 281 * Initialize stab / SLB management except on iSeries
395 * of memory
396 */ 282 */
397 htab_initialize(); 283 if (!firmware_has_feature(FW_FEATURE_ISERIES)) {
284 if (cpu_has_feature(CPU_FTR_SLB))
285 slb_initialize();
286 else
287 stab_initialize(lpaca->stab_real);
288 }
398 289
399 DBG(" <- early_setup()\n"); 290 DBG(" <- early_setup()\n");
400} 291}
401 292
402 293
294#if defined(CONFIG_SMP) || defined(CONFIG_KEXEC)
295void smp_release_cpus(void)
296{
297 extern unsigned long __secondary_hold_spinloop;
298
299 DBG(" -> smp_release_cpus()\n");
300
301 /* All secondary cpus are spinning on a common spinloop, release them
302 * all now so they can start to spin on their individual paca
303 * spinloops. For non SMP kernels, the secondary cpus never get out
304 * of the common spinloop.
305 * This is useless but harmless on iSeries, secondaries are already
306 * waiting on their paca spinloops. */
307
308 __secondary_hold_spinloop = 1;
309 mb();
310
311 DBG(" <- smp_release_cpus()\n");
312}
313#else
314#define smp_release_cpus()
315#endif /* CONFIG_SMP || CONFIG_KEXEC */
316
403/* 317/*
404 * Initialize some remaining members of the ppc64_caches and systemcfg structures 318 * Initialize some remaining members of the ppc64_caches and systemcfg structures
405 * (at least until we get rid of them completely). This is mostly some 319 * (at least until we get rid of them completely). This is mostly some
@@ -481,43 +395,6 @@ static void __init initialize_cache_info(void)
481 DBG(" <- initialize_cache_info()\n"); 395 DBG(" <- initialize_cache_info()\n");
482} 396}
483 397
484static void __init check_for_initrd(void)
485{
486#ifdef CONFIG_BLK_DEV_INITRD
487 u64 *prop;
488
489 DBG(" -> check_for_initrd()\n");
490
491 if (of_chosen) {
492 prop = (u64 *)get_property(of_chosen,
493 "linux,initrd-start", NULL);
494 if (prop != NULL) {
495 initrd_start = (unsigned long)__va(*prop);
496 prop = (u64 *)get_property(of_chosen,
497 "linux,initrd-end", NULL);
498 if (prop != NULL) {
499 initrd_end = (unsigned long)__va(*prop);
500 initrd_below_start_ok = 1;
501 } else
502 initrd_start = 0;
503 }
504 }
505
506 /* If we were passed an initrd, set the ROOT_DEV properly if the values
507 * look sensible. If not, clear initrd reference.
508 */
509 if (initrd_start >= KERNELBASE && initrd_end >= KERNELBASE &&
510 initrd_end > initrd_start)
511 ROOT_DEV = Root_RAM0;
512 else
513 initrd_start = initrd_end = 0;
514
515 if (initrd_start)
516 printk("Found initrd at 0x%lx:0x%lx\n", initrd_start, initrd_end);
517
518 DBG(" <- check_for_initrd()\n");
519#endif /* CONFIG_BLK_DEV_INITRD */
520}
521 398
522/* 399/*
523 * Do some initial setup of the system. The parameters are those which 400 * Do some initial setup of the system. The parameters are those which
@@ -589,23 +466,18 @@ void __init setup_system(void)
589 466
590 parse_early_param(); 467 parse_early_param();
591 468
592#ifdef CONFIG_SMP 469 check_smt_enabled();
593 /* 470 smp_setup_cpu_maps();
594 * iSeries has already initialized the cpu maps at this point.
595 */
596 setup_cpu_maps();
597 471
598 /* Release secondary cpus out of their spinloops at 0x60 now that 472 /* Release secondary cpus out of their spinloops at 0x60 now that
599 * we can map physical -> logical CPU ids 473 * we can map physical -> logical CPU ids
600 */ 474 */
601 smp_release_cpus(); 475 smp_release_cpus();
602#endif
603 476
604 printk("Starting Linux PPC64 %s\n", system_utsname.version); 477 printk("Starting Linux PPC64 %s\n", system_utsname.version);
605 478
606 printk("-----------------------------------------------------\n"); 479 printk("-----------------------------------------------------\n");
607 printk("ppc64_pft_size = 0x%lx\n", ppc64_pft_size); 480 printk("ppc64_pft_size = 0x%lx\n", ppc64_pft_size);
608 printk("ppc64_debug_switch = 0x%lx\n", ppc64_debug_switch);
609 printk("ppc64_interrupt_controller = 0x%ld\n", ppc64_interrupt_controller); 481 printk("ppc64_interrupt_controller = 0x%ld\n", ppc64_interrupt_controller);
610 printk("systemcfg = 0x%p\n", systemcfg); 482 printk("systemcfg = 0x%p\n", systemcfg);
611 printk("systemcfg->platform = 0x%x\n", systemcfg->platform); 483 printk("systemcfg->platform = 0x%x\n", systemcfg->platform);
@@ -631,23 +503,6 @@ static int ppc64_panic_event(struct notifier_block *this,
631 return NOTIFY_DONE; 503 return NOTIFY_DONE;
632} 504}
633 505
634#ifdef CONFIG_PPC_ISERIES
635/*
636 * On iSeries we just parse the mem=X option from the command line.
637 * On pSeries it's a bit more complicated, see prom_init_mem()
638 */
639static int __init early_parsemem(char *p)
640{
641 if (!p)
642 return 0;
643
644 memory_limit = ALIGN(memparse(p, &p), PAGE_SIZE);
645
646 return 0;
647}
648early_param("mem", early_parsemem);
649#endif /* CONFIG_PPC_ISERIES */
650
651#ifdef CONFIG_IRQSTACKS 506#ifdef CONFIG_IRQSTACKS
652static void __init irqstack_early_init(void) 507static void __init irqstack_early_init(void)
653{ 508{
@@ -658,10 +513,12 @@ static void __init irqstack_early_init(void)
658 * SLB misses on them. 513 * SLB misses on them.
659 */ 514 */
660 for_each_cpu(i) { 515 for_each_cpu(i) {
661 softirq_ctx[i] = (struct thread_info *)__va(lmb_alloc_base(THREAD_SIZE, 516 softirq_ctx[i] = (struct thread_info *)
662 THREAD_SIZE, 0x10000000)); 517 __va(lmb_alloc_base(THREAD_SIZE,
663 hardirq_ctx[i] = (struct thread_info *)__va(lmb_alloc_base(THREAD_SIZE, 518 THREAD_SIZE, 0x10000000));
664 THREAD_SIZE, 0x10000000)); 519 hardirq_ctx[i] = (struct thread_info *)
520 __va(lmb_alloc_base(THREAD_SIZE,
521 THREAD_SIZE, 0x10000000));
665 } 522 }
666} 523}
667#else 524#else
@@ -689,8 +546,8 @@ static void __init emergency_stack_init(void)
689 limit = min(0x10000000UL, lmb.rmo_size); 546 limit = min(0x10000000UL, lmb.rmo_size);
690 547
691 for_each_cpu(i) 548 for_each_cpu(i)
692 paca[i].emergency_sp = __va(lmb_alloc_base(PAGE_SIZE, 128, 549 paca[i].emergency_sp =
693 limit)) + PAGE_SIZE; 550 __va(lmb_alloc_base(HW_PAGE_SIZE, 128, limit)) + HW_PAGE_SIZE;
694} 551}
695 552
696/* 553/*
diff --git a/arch/powerpc/kernel/signal_32.c b/arch/powerpc/kernel/signal_32.c
index 444c3e81884c..081d931eae48 100644
--- a/arch/powerpc/kernel/signal_32.c
+++ b/arch/powerpc/kernel/signal_32.c
@@ -43,8 +43,7 @@
43#include <asm/uaccess.h> 43#include <asm/uaccess.h>
44#include <asm/cacheflush.h> 44#include <asm/cacheflush.h>
45#ifdef CONFIG_PPC64 45#ifdef CONFIG_PPC64
46#include <asm/ppc32.h> 46#include "ppc32.h"
47#include <asm/ppcdebug.h>
48#include <asm/unistd.h> 47#include <asm/unistd.h>
49#include <asm/vdso.h> 48#include <asm/vdso.h>
50#else 49#else
diff --git a/arch/ppc64/kernel/signal.c b/arch/powerpc/kernel/signal_64.c
index ec9d0984b6a0..58194e150711 100644
--- a/arch/ppc64/kernel/signal.c
+++ b/arch/powerpc/kernel/signal_64.c
@@ -33,7 +33,6 @@
33#include <asm/ucontext.h> 33#include <asm/ucontext.h>
34#include <asm/uaccess.h> 34#include <asm/uaccess.h>
35#include <asm/pgtable.h> 35#include <asm/pgtable.h>
36#include <asm/ppcdebug.h>
37#include <asm/unistd.h> 36#include <asm/unistd.h>
38#include <asm/cacheflush.h> 37#include <asm/cacheflush.h>
39#include <asm/vdso.h> 38#include <asm/vdso.h>
diff --git a/arch/ppc64/kernel/smp-tbsync.c b/arch/powerpc/kernel/smp-tbsync.c
index 7d8ec9996b3e..9adef3bddad4 100644
--- a/arch/ppc64/kernel/smp-tbsync.c
+++ b/arch/powerpc/kernel/smp-tbsync.c
@@ -22,11 +22,11 @@ enum {
22}; 22};
23 23
24static struct { 24static struct {
25 volatile long tb; 25 volatile u64 tb;
26 volatile long mark; 26 volatile u64 mark;
27 volatile int cmd; 27 volatile int cmd;
28 volatile int handshake; 28 volatile int handshake;
29 int filler[3]; 29 int filler[2];
30 30
31 volatile int ack; 31 volatile int ack;
32 int filler2[7]; 32 int filler2[7];
@@ -36,89 +36,80 @@ static struct {
36 36
37static volatile int running; 37static volatile int running;
38 38
39static void __devinit 39static void __devinit enter_contest(u64 mark, long add)
40enter_contest( long mark, long add )
41{ 40{
42 while( (long)(mftb() - mark) < 0 ) 41 while (get_tb() < mark)
43 tbsync->race_result = add; 42 tbsync->race_result = add;
44} 43}
45 44
46void __devinit 45void __devinit smp_generic_take_timebase(void)
47smp_generic_take_timebase( void )
48{ 46{
49 int cmd; 47 int cmd;
50 long tb; 48 u64 tb;
51 49
52 local_irq_disable(); 50 local_irq_disable();
53 while( !running ) 51 while (!running)
54 ; 52 barrier();
55 rmb(); 53 rmb();
56 54
57 for( ;; ) { 55 for (;;) {
58 tbsync->ack = 1; 56 tbsync->ack = 1;
59 while( !tbsync->handshake ) 57 while (!tbsync->handshake)
60 ; 58 barrier();
61 rmb(); 59 rmb();
62 60
63 cmd = tbsync->cmd; 61 cmd = tbsync->cmd;
64 tb = tbsync->tb; 62 tb = tbsync->tb;
63 mb();
65 tbsync->ack = 0; 64 tbsync->ack = 0;
66 if( cmd == kExit ) 65 if (cmd == kExit)
67 return; 66 break;
68 67
69 if( cmd == kSetAndTest ) { 68 while (tbsync->handshake)
70 while( tbsync->handshake ) 69 barrier();
71 ; 70 if (cmd == kSetAndTest)
72 asm volatile ("mttbl %0" :: "r" (tb & 0xfffffffful) ); 71 set_tb(tb >> 32, tb & 0xfffffffful);
73 asm volatile ("mttbu %0" :: "r" (tb >> 32) ); 72 enter_contest(tbsync->mark, -1);
74 } else {
75 while( tbsync->handshake )
76 ;
77 }
78 enter_contest( tbsync->mark, -1 );
79 } 73 }
80 local_irq_enable(); 74 local_irq_enable();
81} 75}
82 76
83static int __devinit 77static int __devinit start_contest(int cmd, long offset, int num)
84start_contest( int cmd, long offset, long num )
85{ 78{
86 int i, score=0; 79 int i, score=0;
87 long tb, mark; 80 u64 tb;
81 long mark;
88 82
89 tbsync->cmd = cmd; 83 tbsync->cmd = cmd;
90 84
91 local_irq_disable(); 85 local_irq_disable();
92 for( i=-3; i<num; ) { 86 for (i = -3; i < num; ) {
93 tb = (long)mftb() + 400; 87 tb = get_tb() + 400;
94 tbsync->tb = tb + offset; 88 tbsync->tb = tb + offset;
95 tbsync->mark = mark = tb + 400; 89 tbsync->mark = mark = tb + 400;
96 90
97 wmb(); 91 wmb();
98 92
99 tbsync->handshake = 1; 93 tbsync->handshake = 1;
100 while( tbsync->ack ) 94 while (tbsync->ack)
101 ; 95 barrier();
102 96
103 while( (long)(mftb() - tb) <= 0 ) 97 while (get_tb() <= tb)
104 ; 98 barrier();
105 tbsync->handshake = 0; 99 tbsync->handshake = 0;
106 enter_contest( mark, 1 ); 100 enter_contest(mark, 1);
107 101
108 while( !tbsync->ack ) 102 while (!tbsync->ack)
109 ; 103 barrier();
110 104
111 if ((tbsync->tb ^ (long)mftb()) & 0x8000000000000000ul) 105 if (i++ > 0)
112 continue;
113 if( i++ > 0 )
114 score += tbsync->race_result; 106 score += tbsync->race_result;
115 } 107 }
116 local_irq_enable(); 108 local_irq_enable();
117 return score; 109 return score;
118} 110}
119 111
120void __devinit 112void __devinit smp_generic_give_timebase(void)
121smp_generic_give_timebase( void )
122{ 113{
123 int i, score, score2, old, min=0, max=5000, offset=1000; 114 int i, score, score2, old, min=0, max=5000, offset=1000;
124 115
@@ -130,14 +121,14 @@ smp_generic_give_timebase( void )
130 mb(); 121 mb();
131 running = 1; 122 running = 1;
132 123
133 while( !tbsync->ack ) 124 while (!tbsync->ack)
134 ; 125 barrier();
135 126
136 printk("Got ack\n"); 127 printk("Got ack\n");
137 128
138 /* binary search */ 129 /* binary search */
139 for( old=-1 ; old != offset ; offset=(min+max)/2 ) { 130 for (old = -1; old != offset ; offset = (min+max) / 2) {
140 score = start_contest( kSetAndTest, offset, NUM_ITER ); 131 score = start_contest(kSetAndTest, offset, NUM_ITER);
141 132
142 printk("score %d, offset %d\n", score, offset ); 133 printk("score %d, offset %d\n", score, offset );
143 134
@@ -147,21 +138,22 @@ smp_generic_give_timebase( void )
147 min = offset; 138 min = offset;
148 old = offset; 139 old = offset;
149 } 140 }
150 score = start_contest( kSetAndTest, min, NUM_ITER ); 141 score = start_contest(kSetAndTest, min, NUM_ITER);
151 score2 = start_contest( kSetAndTest, max, NUM_ITER ); 142 score2 = start_contest(kSetAndTest, max, NUM_ITER);
152 143
153 printk( "Min %d (score %d), Max %d (score %d)\n", min, score, max, score2 ); 144 printk("Min %d (score %d), Max %d (score %d)\n",
154 score = abs( score ); 145 min, score, max, score2);
155 score2 = abs( score2 ); 146 score = abs(score);
147 score2 = abs(score2);
156 offset = (score < score2) ? min : max; 148 offset = (score < score2) ? min : max;
157 149
158 /* guard against inaccurate mttb */ 150 /* guard against inaccurate mttb */
159 for( i=0; i<10; i++ ) { 151 for (i = 0; i < 10; i++) {
160 start_contest( kSetAndTest, offset, NUM_ITER/10 ); 152 start_contest(kSetAndTest, offset, NUM_ITER/10);
161 153
162 if( (score2=start_contest(kTest, offset, NUM_ITER)) < 0 ) 154 if ((score2 = start_contest(kTest, offset, NUM_ITER)) < 0)
163 score2 = -score2; 155 score2 = -score2;
164 if( score2 <= score || score2 < 20 ) 156 if (score2 <= score || score2 < 20)
165 break; 157 break;
166 } 158 }
167 printk("Final offset: %d (%d/%d)\n", offset, score2, NUM_ITER ); 159 printk("Final offset: %d (%d/%d)\n", offset, score2, NUM_ITER );
@@ -170,10 +162,10 @@ smp_generic_give_timebase( void )
170 tbsync->cmd = kExit; 162 tbsync->cmd = kExit;
171 wmb(); 163 wmb();
172 tbsync->handshake = 1; 164 tbsync->handshake = 1;
173 while( tbsync->ack ) 165 while (tbsync->ack)
174 ; 166 barrier();
175 tbsync->handshake = 0; 167 tbsync->handshake = 0;
176 kfree( tbsync ); 168 kfree(tbsync);
177 tbsync = NULL; 169 tbsync = NULL;
178 running = 0; 170 running = 0;
179} 171}
diff --git a/arch/ppc64/kernel/smp.c b/arch/powerpc/kernel/smp.c
index 017c12919832..5c330c3366e4 100644
--- a/arch/ppc64/kernel/smp.c
+++ b/arch/powerpc/kernel/smp.c
@@ -39,13 +39,17 @@
39#include <asm/pgtable.h> 39#include <asm/pgtable.h>
40#include <asm/prom.h> 40#include <asm/prom.h>
41#include <asm/smp.h> 41#include <asm/smp.h>
42#include <asm/paca.h>
43#include <asm/time.h> 42#include <asm/time.h>
44#include <asm/machdep.h> 43#include <asm/machdep.h>
45#include <asm/cputable.h> 44#include <asm/cputable.h>
46#include <asm/system.h> 45#include <asm/system.h>
47#include <asm/abs_addr.h>
48#include <asm/mpic.h> 46#include <asm/mpic.h>
47#ifdef CONFIG_PPC64
48#include <asm/paca.h>
49#endif
50
51int smp_hw_index[NR_CPUS];
52struct thread_info *secondary_ti;
49 53
50#ifdef DEBUG 54#ifdef DEBUG
51#define DBG(fmt...) udbg_printf(fmt) 55#define DBG(fmt...) udbg_printf(fmt)
@@ -60,6 +64,7 @@ cpumask_t cpu_sibling_map[NR_CPUS] = { [0 ... NR_CPUS-1] = CPU_MASK_NONE };
60EXPORT_SYMBOL(cpu_online_map); 64EXPORT_SYMBOL(cpu_online_map);
61EXPORT_SYMBOL(cpu_possible_map); 65EXPORT_SYMBOL(cpu_possible_map);
62 66
67/* SMP operations for this machine */
63struct smp_ops_t *smp_ops; 68struct smp_ops_t *smp_ops;
64 69
65static volatile unsigned int cpu_callin_map[NR_CPUS]; 70static volatile unsigned int cpu_callin_map[NR_CPUS];
@@ -89,7 +94,9 @@ void __devinit smp_mpic_setup_cpu(int cpu)
89{ 94{
90 mpic_setup_this_cpu(); 95 mpic_setup_this_cpu();
91} 96}
97#endif /* CONFIG_MPIC */
92 98
99#ifdef CONFIG_PPC64
93void __devinit smp_generic_kick_cpu(int nr) 100void __devinit smp_generic_kick_cpu(int nr)
94{ 101{
95 BUG_ON(nr < 0 || nr >= NR_CPUS); 102 BUG_ON(nr < 0 || nr >= NR_CPUS);
@@ -102,8 +109,7 @@ void __devinit smp_generic_kick_cpu(int nr)
102 paca[nr].cpu_start = 1; 109 paca[nr].cpu_start = 1;
103 smp_mb(); 110 smp_mb();
104} 111}
105 112#endif
106#endif /* CONFIG_MPIC */
107 113
108void smp_message_recv(int msg, struct pt_regs *regs) 114void smp_message_recv(int msg, struct pt_regs *regs)
109{ 115{
@@ -111,15 +117,10 @@ void smp_message_recv(int msg, struct pt_regs *regs)
111 case PPC_MSG_CALL_FUNCTION: 117 case PPC_MSG_CALL_FUNCTION:
112 smp_call_function_interrupt(); 118 smp_call_function_interrupt();
113 break; 119 break;
114 case PPC_MSG_RESCHEDULE: 120 case PPC_MSG_RESCHEDULE:
115 /* XXX Do we have to do this? */ 121 /* XXX Do we have to do this? */
116 set_need_resched(); 122 set_need_resched();
117 break; 123 break;
118#if 0
119 case PPC_MSG_MIGRATE_TASK:
120 /* spare */
121 break;
122#endif
123#ifdef CONFIG_DEBUGGER 124#ifdef CONFIG_DEBUGGER
124 case PPC_MSG_DEBUGGER_BREAK: 125 case PPC_MSG_DEBUGGER_BREAK:
125 debugger_ipi(regs); 126 debugger_ipi(regs);
@@ -171,8 +172,8 @@ static struct call_data_struct {
171 int wait; 172 int wait;
172} *call_data; 173} *call_data;
173 174
174/* delay of at least 8 seconds on 1GHz cpu */ 175/* delay of at least 8 seconds */
175#define SMP_CALL_TIMEOUT (1UL << (30 + 3)) 176#define SMP_CALL_TIMEOUT 8
176 177
177/* 178/*
178 * This function sends a 'generic call function' IPI to all other CPUs 179 * This function sends a 'generic call function' IPI to all other CPUs
@@ -194,7 +195,7 @@ int smp_call_function (void (*func) (void *info), void *info, int nonatomic,
194{ 195{
195 struct call_data_struct data; 196 struct call_data_struct data;
196 int ret = -1, cpus; 197 int ret = -1, cpus;
197 unsigned long timeout; 198 u64 timeout;
198 199
199 /* Can deadlock when called with interrupts disabled */ 200 /* Can deadlock when called with interrupts disabled */
200 WARN_ON(irqs_disabled()); 201 WARN_ON(irqs_disabled());
@@ -220,11 +221,12 @@ int smp_call_function (void (*func) (void *info), void *info, int nonatomic,
220 /* Send a message to all other CPUs and wait for them to respond */ 221 /* Send a message to all other CPUs and wait for them to respond */
221 smp_ops->message_pass(MSG_ALL_BUT_SELF, PPC_MSG_CALL_FUNCTION); 222 smp_ops->message_pass(MSG_ALL_BUT_SELF, PPC_MSG_CALL_FUNCTION);
222 223
224 timeout = get_tb() + (u64) SMP_CALL_TIMEOUT * tb_ticks_per_sec;
225
223 /* Wait for response */ 226 /* Wait for response */
224 timeout = SMP_CALL_TIMEOUT;
225 while (atomic_read(&data.started) != cpus) { 227 while (atomic_read(&data.started) != cpus) {
226 HMT_low(); 228 HMT_low();
227 if (--timeout == 0) { 229 if (get_tb() >= timeout) {
228 printk("smp_call_function on cpu %d: other cpus not " 230 printk("smp_call_function on cpu %d: other cpus not "
229 "responding (%d)\n", smp_processor_id(), 231 "responding (%d)\n", smp_processor_id(),
230 atomic_read(&data.started)); 232 atomic_read(&data.started));
@@ -234,10 +236,9 @@ int smp_call_function (void (*func) (void *info), void *info, int nonatomic,
234 } 236 }
235 237
236 if (wait) { 238 if (wait) {
237 timeout = SMP_CALL_TIMEOUT;
238 while (atomic_read(&data.finished) != cpus) { 239 while (atomic_read(&data.finished) != cpus) {
239 HMT_low(); 240 HMT_low();
240 if (--timeout == 0) { 241 if (get_tb() >= timeout) {
241 printk("smp_call_function on cpu %d: other " 242 printk("smp_call_function on cpu %d: other "
242 "cpus not finishing (%d/%d)\n", 243 "cpus not finishing (%d/%d)\n",
243 smp_processor_id(), 244 smp_processor_id(),
@@ -251,7 +252,7 @@ int smp_call_function (void (*func) (void *info), void *info, int nonatomic,
251 252
252 ret = 0; 253 ret = 0;
253 254
254out: 255 out:
255 call_data = NULL; 256 call_data = NULL;
256 HMT_medium(); 257 HMT_medium();
257 spin_unlock(&call_lock); 258 spin_unlock(&call_lock);
@@ -313,8 +314,11 @@ static void __init smp_create_idle(unsigned int cpu)
313 p = fork_idle(cpu); 314 p = fork_idle(cpu);
314 if (IS_ERR(p)) 315 if (IS_ERR(p))
315 panic("failed fork for CPU %u: %li", cpu, PTR_ERR(p)); 316 panic("failed fork for CPU %u: %li", cpu, PTR_ERR(p));
317#ifdef CONFIG_PPC64
316 paca[cpu].__current = p; 318 paca[cpu].__current = p;
319#endif
317 current_set[cpu] = p->thread_info; 320 current_set[cpu] = p->thread_info;
321 p->thread_info->cpu = cpu;
318} 322}
319 323
320void __init smp_prepare_cpus(unsigned int max_cpus) 324void __init smp_prepare_cpus(unsigned int max_cpus)
@@ -333,18 +337,6 @@ void __init smp_prepare_cpus(unsigned int max_cpus)
333 smp_store_cpu_info(boot_cpuid); 337 smp_store_cpu_info(boot_cpuid);
334 cpu_callin_map[boot_cpuid] = 1; 338 cpu_callin_map[boot_cpuid] = 1;
335 339
336#ifndef CONFIG_PPC_ISERIES
337 paca[boot_cpuid].next_jiffy_update_tb = tb_last_stamp = get_tb();
338
339 /*
340 * Should update do_gtod.stamp_xsec.
341 * For now we leave it which means the time can be some
342 * number of msecs off until someone does a settimeofday()
343 */
344 do_gtod.varp->tb_orig_stamp = tb_last_stamp;
345 systemcfg->tb_orig_stamp = tb_last_stamp;
346#endif
347
348 max_cpus = smp_ops->probe(); 340 max_cpus = smp_ops->probe();
349 341
350 smp_space_timers(max_cpus); 342 smp_space_timers(max_cpus);
@@ -359,8 +351,9 @@ void __devinit smp_prepare_boot_cpu(void)
359 BUG_ON(smp_processor_id() != boot_cpuid); 351 BUG_ON(smp_processor_id() != boot_cpuid);
360 352
361 cpu_set(boot_cpuid, cpu_online_map); 353 cpu_set(boot_cpuid, cpu_online_map);
362 354#ifdef CONFIG_PPC64
363 paca[boot_cpuid].__current = current; 355 paca[boot_cpuid].__current = current;
356#endif
364 current_set[boot_cpuid] = current->thread_info; 357 current_set[boot_cpuid] = current->thread_info;
365} 358}
366 359
@@ -444,13 +437,16 @@ int __devinit __cpu_up(unsigned int cpu)
444{ 437{
445 int c; 438 int c;
446 439
440 secondary_ti = current_set[cpu];
447 if (!cpu_enable(cpu)) 441 if (!cpu_enable(cpu))
448 return 0; 442 return 0;
449 443
450 if (smp_ops->cpu_bootable && !smp_ops->cpu_bootable(cpu)) 444 if (smp_ops->cpu_bootable && !smp_ops->cpu_bootable(cpu))
451 return -EINVAL; 445 return -EINVAL;
452 446
447#ifdef CONFIG_PPC64
453 paca[cpu].default_decr = tb_ticks_per_jiffy; 448 paca[cpu].default_decr = tb_ticks_per_jiffy;
449#endif
454 450
455 /* Make sure callin-map entry is 0 (can be leftover a CPU 451 /* Make sure callin-map entry is 0 (can be leftover a CPU
456 * hotplug 452 * hotplug
@@ -513,7 +509,7 @@ int __devinit start_secondary(void *unused)
513 current->active_mm = &init_mm; 509 current->active_mm = &init_mm;
514 510
515 smp_store_cpu_info(cpu); 511 smp_store_cpu_info(cpu);
516 set_dec(paca[cpu].default_decr); 512 set_dec(tb_ticks_per_jiffy);
517 cpu_callin_map[cpu] = 1; 513 cpu_callin_map[cpu] = 1;
518 514
519 smp_ops->setup_cpu(cpu); 515 smp_ops->setup_cpu(cpu);
diff --git a/arch/powerpc/kernel/time.c b/arch/powerpc/kernel/time.c
index 23436b6c1881..a6282b625b44 100644
--- a/arch/powerpc/kernel/time.c
+++ b/arch/powerpc/kernel/time.c
@@ -61,14 +61,16 @@
61#include <asm/prom.h> 61#include <asm/prom.h>
62#include <asm/irq.h> 62#include <asm/irq.h>
63#include <asm/div64.h> 63#include <asm/div64.h>
64#include <asm/smp.h>
64#ifdef CONFIG_PPC64 65#ifdef CONFIG_PPC64
65#include <asm/systemcfg.h> 66#include <asm/systemcfg.h>
66#include <asm/firmware.h> 67#include <asm/firmware.h>
67#endif 68#endif
68#ifdef CONFIG_PPC_ISERIES 69#ifdef CONFIG_PPC_ISERIES
69#include <asm/iSeries/ItLpQueue.h> 70#include <asm/iseries/it_lp_queue.h>
70#include <asm/iSeries/HvCallXm.h> 71#include <asm/iseries/hv_call_xm.h>
71#endif 72#endif
73#include <asm/smp.h>
72 74
73/* keep track of when we need to update the rtc */ 75/* keep track of when we need to update the rtc */
74time_t last_rtc_update; 76time_t last_rtc_update;
@@ -118,10 +120,6 @@ static unsigned adjusting_time = 0;
118unsigned long ppc_proc_freq; 120unsigned long ppc_proc_freq;
119unsigned long ppc_tb_freq; 121unsigned long ppc_tb_freq;
120 122
121#ifdef CONFIG_PPC32 /* XXX for now */
122#define boot_cpuid 0
123#endif
124
125u64 tb_last_jiffy __cacheline_aligned_in_smp; 123u64 tb_last_jiffy __cacheline_aligned_in_smp;
126unsigned long tb_last_stamp; 124unsigned long tb_last_stamp;
127 125
diff --git a/arch/powerpc/kernel/traps.c b/arch/powerpc/kernel/traps.c
index 5d638ecddbd0..0578f8387603 100644
--- a/arch/powerpc/kernel/traps.c
+++ b/arch/powerpc/kernel/traps.c
@@ -39,7 +39,6 @@
39#include <asm/io.h> 39#include <asm/io.h>
40#include <asm/machdep.h> 40#include <asm/machdep.h>
41#include <asm/rtas.h> 41#include <asm/rtas.h>
42#include <asm/xmon.h>
43#include <asm/pmc.h> 42#include <asm/pmc.h>
44#ifdef CONFIG_PPC32 43#ifdef CONFIG_PPC32
45#include <asm/reg.h> 44#include <asm/reg.h>
@@ -147,8 +146,8 @@ int die(const char *str, struct pt_regs *regs, long err)
147 printk("POWERMAC "); 146 printk("POWERMAC ");
148 nl = 1; 147 nl = 1;
149 break; 148 break;
150 case PLATFORM_BPA: 149 case PLATFORM_CELL:
151 printk("BPA "); 150 printk("CELL ");
152 nl = 1; 151 nl = 1;
153 break; 152 break;
154 } 153 }
@@ -748,23 +747,13 @@ static int check_bug_trap(struct pt_regs *regs)
748 return 0; 747 return 0;
749 if (bug->line & BUG_WARNING_TRAP) { 748 if (bug->line & BUG_WARNING_TRAP) {
750 /* this is a WARN_ON rather than BUG/BUG_ON */ 749 /* this is a WARN_ON rather than BUG/BUG_ON */
751#ifdef CONFIG_XMON 750 printk(KERN_ERR "Badness in %s at %s:%ld\n",
752 xmon_printf(KERN_ERR "Badness in %s at %s:%d\n",
753 bug->function, bug->file,
754 bug->line & ~BUG_WARNING_TRAP);
755#endif /* CONFIG_XMON */
756 printk(KERN_ERR "Badness in %s at %s:%d\n",
757 bug->function, bug->file, 751 bug->function, bug->file,
758 bug->line & ~BUG_WARNING_TRAP); 752 bug->line & ~BUG_WARNING_TRAP);
759 dump_stack(); 753 dump_stack();
760 return 1; 754 return 1;
761 } 755 }
762#ifdef CONFIG_XMON 756 printk(KERN_CRIT "kernel BUG in %s at %s:%ld!\n",
763 xmon_printf(KERN_CRIT "kernel BUG in %s at %s:%d!\n",
764 bug->function, bug->file, bug->line);
765 xmon(regs);
766#endif /* CONFIG_XMON */
767 printk(KERN_CRIT "kernel BUG in %s at %s:%d!\n",
768 bug->function, bug->file, bug->line); 757 bug->function, bug->file, bug->line);
769 758
770 return 0; 759 return 0;
@@ -898,10 +887,6 @@ void altivec_unavailable_exception(struct pt_regs *regs)
898 die("Unrecoverable VMX/Altivec Unavailable Exception", regs, SIGABRT); 887 die("Unrecoverable VMX/Altivec Unavailable Exception", regs, SIGABRT);
899} 888}
900 889
901#ifdef CONFIG_PPC64
902extern perf_irq_t perf_irq;
903#endif
904
905#if defined(CONFIG_PPC64) || defined(CONFIG_E500) 890#if defined(CONFIG_PPC64) || defined(CONFIG_E500)
906void performance_monitor_exception(struct pt_regs *regs) 891void performance_monitor_exception(struct pt_regs *regs)
907{ 892{
diff --git a/arch/powerpc/kernel/vio.c b/arch/powerpc/kernel/vio.c
index 97082a4203ad..71a6addf9f7f 100644
--- a/arch/powerpc/kernel/vio.c
+++ b/arch/powerpc/kernel/vio.c
@@ -21,6 +21,7 @@
21#include <asm/iommu.h> 21#include <asm/iommu.h>
22#include <asm/dma.h> 22#include <asm/dma.h>
23#include <asm/vio.h> 23#include <asm/vio.h>
24#include <asm/prom.h>
24 25
25static const struct vio_device_id *vio_match_device( 26static const struct vio_device_id *vio_match_device(
26 const struct vio_device_id *, const struct vio_dev *); 27 const struct vio_device_id *, const struct vio_dev *);
@@ -265,7 +266,33 @@ static int vio_bus_match(struct device *dev, struct device_driver *drv)
265 return (ids != NULL) && (vio_match_device(ids, vio_dev) != NULL); 266 return (ids != NULL) && (vio_match_device(ids, vio_dev) != NULL);
266} 267}
267 268
269static int vio_hotplug(struct device *dev, char **envp, int num_envp,
270 char *buffer, int buffer_size)
271{
272 const struct vio_dev *vio_dev = to_vio_dev(dev);
273 char *cp;
274 int length;
275
276 if (!num_envp)
277 return -ENOMEM;
278
279 if (!vio_dev->dev.platform_data)
280 return -ENODEV;
281 cp = (char *)get_property(vio_dev->dev.platform_data, "compatible", &length);
282 if (!cp)
283 return -ENODEV;
284
285 envp[0] = buffer;
286 length = scnprintf(buffer, buffer_size, "MODALIAS=vio:T%sS%s",
287 vio_dev->type, cp);
288 if (buffer_size - length <= 0)
289 return -ENOMEM;
290 envp[1] = NULL;
291 return 0;
292}
293
268struct bus_type vio_bus_type = { 294struct bus_type vio_bus_type = {
269 .name = "vio", 295 .name = "vio",
296 .hotplug = vio_hotplug,
270 .match = vio_bus_match, 297 .match = vio_bus_match,
271}; 298};
diff --git a/arch/powerpc/kernel/vmlinux.lds.S b/arch/powerpc/kernel/vmlinux.lds.S
index d4dfcfbce272..7fa7b15fd8e6 100644
--- a/arch/powerpc/kernel/vmlinux.lds.S
+++ b/arch/powerpc/kernel/vmlinux.lds.S
@@ -3,9 +3,12 @@
3#include <asm/page.h> 3#include <asm/page.h>
4#else 4#else
5#define PAGE_SIZE 4096 5#define PAGE_SIZE 4096
6#define KERNELBASE CONFIG_KERNEL_START
6#endif 7#endif
7#include <asm-generic/vmlinux.lds.h> 8#include <asm-generic/vmlinux.lds.h>
8 9
10ENTRY(_stext)
11
9#ifdef CONFIG_PPC64 12#ifdef CONFIG_PPC64
10OUTPUT_ARCH(powerpc:common64) 13OUTPUT_ARCH(powerpc:common64)
11jiffies = jiffies_64; 14jiffies = jiffies_64;
@@ -21,33 +24,9 @@ SECTIONS
21 *(.exit.data) 24 *(.exit.data)
22 } 25 }
23 26
27 . = KERNELBASE;
24 28
25 /* Read-only sections, merged into text segment: */ 29 /* Read-only sections, merged into text segment: */
26#ifdef CONFIG_PPC32
27 . = + SIZEOF_HEADERS;
28 .interp : { *(.interp) }
29 .hash : { *(.hash) }
30 .dynsym : { *(.dynsym) }
31 .dynstr : { *(.dynstr) }
32 .rel.text : { *(.rel.text) }
33 .rela.text : { *(.rela.text) }
34 .rel.data : { *(.rel.data) }
35 .rela.data : { *(.rela.data) }
36 .rel.rodata : { *(.rel.rodata) }
37 .rela.rodata : { *(.rela.rodata) }
38 .rel.got : { *(.rel.got) }
39 .rela.got : { *(.rela.got) }
40 .rel.ctors : { *(.rel.ctors) }
41 .rela.ctors : { *(.rela.ctors) }
42 .rel.dtors : { *(.rel.dtors) }
43 .rela.dtors : { *(.rela.dtors) }
44 .rel.bss : { *(.rel.bss) }
45 .rela.bss : { *(.rela.bss) }
46 .rel.plt : { *(.rel.plt) }
47 .rela.plt : { *(.rela.plt) }
48/* .init : { *(.init) } =0*/
49 .plt : { *(.plt) }
50#endif
51 .text : { 30 .text : {
52 *(.text .text.*) 31 *(.text .text.*)
53 SCHED_TEXT 32 SCHED_TEXT
diff --git a/arch/powerpc/lib/Makefile b/arch/powerpc/lib/Makefile
index e6b2be3bcec1..34f5c2e074c9 100644
--- a/arch/powerpc/lib/Makefile
+++ b/arch/powerpc/lib/Makefile
@@ -3,13 +3,14 @@
3# 3#
4 4
5ifeq ($(CONFIG_PPC_MERGE),y) 5ifeq ($(CONFIG_PPC_MERGE),y)
6obj-y := string.o 6obj-y := string.o strcase.o
7obj-$(CONFIG_PPC32) += div64.o copy_32.o checksum_32.o
7endif 8endif
8 9
9obj-y += strcase.o 10obj-y += bitops.o
10obj-$(CONFIG_PPC32) += div64.o copy_32.o checksum_32.o
11obj-$(CONFIG_PPC64) += checksum_64.o copypage_64.o copyuser_64.o \ 11obj-$(CONFIG_PPC64) += checksum_64.o copypage_64.o copyuser_64.o \
12 memcpy_64.o usercopy_64.o mem_64.o 12 memcpy_64.o usercopy_64.o mem_64.o string.o \
13 strcase.o
13obj-$(CONFIG_PPC_ISERIES) += e2a.o 14obj-$(CONFIG_PPC_ISERIES) += e2a.o
14obj-$(CONFIG_XMON) += sstep.o 15obj-$(CONFIG_XMON) += sstep.o
15 16
diff --git a/arch/ppc64/kernel/bitops.c b/arch/powerpc/lib/bitops.c
index ae329e8b4acb..b67ce3004ebf 100644
--- a/arch/ppc64/kernel/bitops.c
+++ b/arch/powerpc/lib/bitops.c
@@ -1,93 +1,97 @@
1/* 1#include <linux/types.h>
2 * These are too big to be inlined.
3 */
4
5#include <linux/kernel.h>
6#include <linux/module.h> 2#include <linux/module.h>
7#include <linux/bitops.h>
8#include <asm/byteorder.h> 3#include <asm/byteorder.h>
4#include <asm/bitops.h>
9 5
10unsigned long find_next_zero_bit(const unsigned long *addr, unsigned long size, 6/**
11 unsigned long offset) 7 * find_next_bit - find the next set bit in a memory region
8 * @addr: The address to base the search on
9 * @offset: The bitnumber to start searching at
10 * @size: The maximum size to search
11 */
12unsigned long find_next_bit(const unsigned long *addr, unsigned long size,
13 unsigned long offset)
12{ 14{
13 const unsigned long *p = addr + (offset >> 6); 15 const unsigned long *p = addr + BITOP_WORD(offset);
14 unsigned long result = offset & ~63UL; 16 unsigned long result = offset & ~(BITS_PER_LONG-1);
15 unsigned long tmp; 17 unsigned long tmp;
16 18
17 if (offset >= size) 19 if (offset >= size)
18 return size; 20 return size;
19 size -= result; 21 size -= result;
20 offset &= 63UL; 22 offset %= BITS_PER_LONG;
21 if (offset) { 23 if (offset) {
22 tmp = *(p++); 24 tmp = *(p++);
23 tmp |= ~0UL >> (64 - offset); 25 tmp &= (~0UL << offset);
24 if (size < 64) 26 if (size < BITS_PER_LONG)
25 goto found_first; 27 goto found_first;
26 if (~tmp) 28 if (tmp)
27 goto found_middle; 29 goto found_middle;
28 size -= 64; 30 size -= BITS_PER_LONG;
29 result += 64; 31 result += BITS_PER_LONG;
30 } 32 }
31 while (size & ~63UL) { 33 while (size & ~(BITS_PER_LONG-1)) {
32 if (~(tmp = *(p++))) 34 if ((tmp = *(p++)))
33 goto found_middle; 35 goto found_middle;
34 result += 64; 36 result += BITS_PER_LONG;
35 size -= 64; 37 size -= BITS_PER_LONG;
36 } 38 }
37 if (!size) 39 if (!size)
38 return result; 40 return result;
39 tmp = *p; 41 tmp = *p;
40 42
41found_first: 43found_first:
42 tmp |= ~0UL << size; 44 tmp &= (~0UL >> (64 - size));
43 if (tmp == ~0UL) /* Are any bits zero? */ 45 if (tmp == 0UL) /* Are any bits set? */
44 return result + size; /* Nope. */ 46 return result + size; /* Nope. */
45found_middle: 47found_middle:
46 return result + ffz(tmp); 48 return result + __ffs(tmp);
47} 49}
50EXPORT_SYMBOL(find_next_bit);
48 51
49EXPORT_SYMBOL(find_next_zero_bit); 52/*
50 53 * This implementation of find_{first,next}_zero_bit was stolen from
51unsigned long find_next_bit(const unsigned long *addr, unsigned long size, 54 * Linus' asm-alpha/bitops.h.
52 unsigned long offset) 55 */
56unsigned long find_next_zero_bit(const unsigned long *addr, unsigned long size,
57 unsigned long offset)
53{ 58{
54 const unsigned long *p = addr + (offset >> 6); 59 const unsigned long *p = addr + BITOP_WORD(offset);
55 unsigned long result = offset & ~63UL; 60 unsigned long result = offset & ~(BITS_PER_LONG-1);
56 unsigned long tmp; 61 unsigned long tmp;
57 62
58 if (offset >= size) 63 if (offset >= size)
59 return size; 64 return size;
60 size -= result; 65 size -= result;
61 offset &= 63UL; 66 offset %= BITS_PER_LONG;
62 if (offset) { 67 if (offset) {
63 tmp = *(p++); 68 tmp = *(p++);
64 tmp &= (~0UL << offset); 69 tmp |= ~0UL >> (BITS_PER_LONG - offset);
65 if (size < 64) 70 if (size < BITS_PER_LONG)
66 goto found_first; 71 goto found_first;
67 if (tmp) 72 if (~tmp)
68 goto found_middle; 73 goto found_middle;
69 size -= 64; 74 size -= BITS_PER_LONG;
70 result += 64; 75 result += BITS_PER_LONG;
71 } 76 }
72 while (size & ~63UL) { 77 while (size & ~(BITS_PER_LONG-1)) {
73 if ((tmp = *(p++))) 78 if (~(tmp = *(p++)))
74 goto found_middle; 79 goto found_middle;
75 result += 64; 80 result += BITS_PER_LONG;
76 size -= 64; 81 size -= BITS_PER_LONG;
77 } 82 }
78 if (!size) 83 if (!size)
79 return result; 84 return result;
80 tmp = *p; 85 tmp = *p;
81 86
82found_first: 87found_first:
83 tmp &= (~0UL >> (64 - size)); 88 tmp |= ~0UL << size;
84 if (tmp == 0UL) /* Are any bits set? */ 89 if (tmp == ~0UL) /* Are any bits zero? */
85 return result + size; /* Nope. */ 90 return result + size; /* Nope. */
86found_middle: 91found_middle:
87 return result + __ffs(tmp); 92 return result + ffz(tmp);
88} 93}
89 94EXPORT_SYMBOL(find_next_zero_bit);
90EXPORT_SYMBOL(find_next_bit);
91 95
92static inline unsigned int ext2_ilog2(unsigned int x) 96static inline unsigned int ext2_ilog2(unsigned int x)
93{ 97{
@@ -106,8 +110,8 @@ static inline unsigned int ext2_ffz(unsigned int x)
106 return rc; 110 return rc;
107} 111}
108 112
109unsigned long find_next_zero_le_bit(const unsigned long *addr, unsigned long size, 113unsigned long find_next_zero_le_bit(const unsigned long *addr,
110 unsigned long offset) 114 unsigned long size, unsigned long offset)
111{ 115{
112 const unsigned int *p = ((const unsigned int *)addr) + (offset >> 5); 116 const unsigned int *p = ((const unsigned int *)addr) + (offset >> 5);
113 unsigned int result = offset & ~31; 117 unsigned int result = offset & ~31;
@@ -143,5 +147,4 @@ found_first:
143found_middle: 147found_middle:
144 return result + ext2_ffz(tmp); 148 return result + ext2_ffz(tmp);
145} 149}
146
147EXPORT_SYMBOL(find_next_zero_le_bit); 150EXPORT_SYMBOL(find_next_zero_le_bit);
diff --git a/arch/powerpc/lib/copypage_64.S b/arch/powerpc/lib/copypage_64.S
index 733d61618bbf..40523b140109 100644
--- a/arch/powerpc/lib/copypage_64.S
+++ b/arch/powerpc/lib/copypage_64.S
@@ -11,7 +11,7 @@
11#include <asm/processor.h> 11#include <asm/processor.h>
12#include <asm/ppc_asm.h> 12#include <asm/ppc_asm.h>
13 13
14_GLOBAL(copy_page) 14_GLOBAL(copy_4K_page)
15 std r31,-8(1) 15 std r31,-8(1)
16 std r30,-16(1) 16 std r30,-16(1)
17 std r29,-24(1) 17 std r29,-24(1)
diff --git a/arch/powerpc/lib/copyuser_64.S b/arch/powerpc/lib/copyuser_64.S
index a0b3fbbd6fb1..6d69ef39b7df 100644
--- a/arch/powerpc/lib/copyuser_64.S
+++ b/arch/powerpc/lib/copyuser_64.S
@@ -24,7 +24,7 @@ _GLOBAL(__copy_tofrom_user)
24 std r4,-16(r1) 24 std r4,-16(r1)
25 std r5,-8(r1) 25 std r5,-8(r1)
26 dcbt 0,r4 26 dcbt 0,r4
27 beq .Lcopy_page 27 beq .Lcopy_page_4K
28 andi. r6,r6,7 28 andi. r6,r6,7
29 mtcrf 0x01,r5 29 mtcrf 0x01,r5
30 blt cr1,.Lshort_copy 30 blt cr1,.Lshort_copy
@@ -366,7 +366,7 @@ _GLOBAL(__copy_tofrom_user)
366 * above (following the .Ldst_aligned label) but it runs slightly 366 * above (following the .Ldst_aligned label) but it runs slightly
367 * slower on POWER3. 367 * slower on POWER3.
368 */ 368 */
369.Lcopy_page: 369.Lcopy_page_4K:
370 std r31,-32(1) 370 std r31,-32(1)
371 std r30,-40(1) 371 std r30,-40(1)
372 std r29,-48(1) 372 std r29,-48(1)
diff --git a/arch/powerpc/lib/locks.c b/arch/powerpc/lib/locks.c
index 3794715b2972..35bd03c41dd1 100644
--- a/arch/powerpc/lib/locks.c
+++ b/arch/powerpc/lib/locks.c
@@ -22,7 +22,8 @@
22/* waiting for a spinlock... */ 22/* waiting for a spinlock... */
23#if defined(CONFIG_PPC_SPLPAR) || defined(CONFIG_PPC_ISERIES) 23#if defined(CONFIG_PPC_SPLPAR) || defined(CONFIG_PPC_ISERIES)
24#include <asm/hvcall.h> 24#include <asm/hvcall.h>
25#include <asm/iSeries/HvCall.h> 25#include <asm/iseries/hv_call.h>
26#include <asm/smp.h>
26 27
27void __spin_yield(raw_spinlock_t *lock) 28void __spin_yield(raw_spinlock_t *lock)
28{ 29{
diff --git a/arch/powerpc/mm/fault.c b/arch/powerpc/mm/fault.c
index 841d8b6323a8..93d4fbfdb724 100644
--- a/arch/powerpc/mm/fault.c
+++ b/arch/powerpc/mm/fault.c
@@ -389,5 +389,22 @@ void bad_page_fault(struct pt_regs *regs, unsigned long address, int sig)
389 } 389 }
390 390
391 /* kernel has accessed a bad area */ 391 /* kernel has accessed a bad area */
392
393 printk(KERN_ALERT "Unable to handle kernel paging request for ");
394 switch (regs->trap) {
395 case 0x300:
396 case 0x380:
397 printk("data at address 0x%08lx\n", regs->dar);
398 break;
399 case 0x400:
400 case 0x480:
401 printk("instruction fetch\n");
402 break;
403 default:
404 printk("unknown fault\n");
405 }
406 printk(KERN_ALERT "Faulting instruction address: 0x%08lx\n",
407 regs->nip);
408
392 die("Kernel access of bad area", regs, sig); 409 die("Kernel access of bad area", regs, sig);
393} 410}
diff --git a/arch/powerpc/mm/hash_low_64.S b/arch/powerpc/mm/hash_low_64.S
index d6ed9102eeea..e0d02c4a2615 100644
--- a/arch/powerpc/mm/hash_low_64.S
+++ b/arch/powerpc/mm/hash_low_64.S
@@ -1,7 +1,7 @@
1/* 1/*
2 * ppc64 MMU hashtable management routines 2 * ppc64 MMU hashtable management routines
3 * 3 *
4 * (c) Copyright IBM Corp. 2003 4 * (c) Copyright IBM Corp. 2003, 2005
5 * 5 *
6 * Maintained by: Benjamin Herrenschmidt 6 * Maintained by: Benjamin Herrenschmidt
7 * <benh@kernel.crashing.org> 7 * <benh@kernel.crashing.org>
@@ -10,6 +10,7 @@
10 * described in the kernel's COPYING file. 10 * described in the kernel's COPYING file.
11 */ 11 */
12 12
13#include <linux/config.h>
13#include <asm/reg.h> 14#include <asm/reg.h>
14#include <asm/pgtable.h> 15#include <asm/pgtable.h>
15#include <asm/mmu.h> 16#include <asm/mmu.h>
@@ -42,14 +43,24 @@
42/* Save non-volatile offsets */ 43/* Save non-volatile offsets */
43#define STK_REG(i) (112 + ((i)-14)*8) 44#define STK_REG(i) (112 + ((i)-14)*8)
44 45
46
47#ifndef CONFIG_PPC_64K_PAGES
48
49/*****************************************************************************
50 * *
51 * 4K SW & 4K HW pages implementation *
52 * *
53 *****************************************************************************/
54
55
45/* 56/*
46 * _hash_page(unsigned long ea, unsigned long access, unsigned long vsid, 57 * _hash_page_4K(unsigned long ea, unsigned long access, unsigned long vsid,
47 * pte_t *ptep, unsigned long trap, int local) 58 * pte_t *ptep, unsigned long trap, int local)
48 * 59 *
49 * Adds a page to the hash table. This is the non-LPAR version for now 60 * Adds a 4K page to the hash table in a segment of 4K pages only
50 */ 61 */
51 62
52_GLOBAL(__hash_page) 63_GLOBAL(__hash_page_4K)
53 mflr r0 64 mflr r0
54 std r0,16(r1) 65 std r0,16(r1)
55 stdu r1,-STACKFRAMESIZE(r1) 66 stdu r1,-STACKFRAMESIZE(r1)
@@ -88,7 +99,8 @@ _GLOBAL(__hash_page)
88 /* If so, just bail out and refault if needed. Someone else 99 /* If so, just bail out and refault if needed. Someone else
89 * is changing this PTE anyway and might hash it. 100 * is changing this PTE anyway and might hash it.
90 */ 101 */
91 bne- bail_ok 102 bne- htab_bail_ok
103
92 /* Prepare new PTE value (turn access RW into DIRTY, then 104 /* Prepare new PTE value (turn access RW into DIRTY, then
93 * add BUSY,HASHPTE and ACCESSED) 105 * add BUSY,HASHPTE and ACCESSED)
94 */ 106 */
@@ -118,10 +130,10 @@ _GLOBAL(__hash_page)
118 130
119 /* Convert linux PTE bits into HW equivalents */ 131 /* Convert linux PTE bits into HW equivalents */
120 andi. r3,r30,0x1fe /* Get basic set of flags */ 132 andi. r3,r30,0x1fe /* Get basic set of flags */
121 xori r3,r3,HW_NO_EXEC /* _PAGE_EXEC -> NOEXEC */ 133 xori r3,r3,HPTE_R_N /* _PAGE_EXEC -> NOEXEC */
122 rlwinm r0,r30,32-9+1,30,30 /* _PAGE_RW -> _PAGE_USER (r0) */ 134 rlwinm r0,r30,32-9+1,30,30 /* _PAGE_RW -> _PAGE_USER (r0) */
123 rlwinm r4,r30,32-7+1,30,30 /* _PAGE_DIRTY -> _PAGE_USER (r4) */ 135 rlwinm r4,r30,32-7+1,30,30 /* _PAGE_DIRTY -> _PAGE_USER (r4) */
124 and r0,r0,r4 /* _PAGE_RW & _PAGE_DIRTY -> r0 bit 30 */ 136 and r0,r0,r4 /* _PAGE_RW & _PAGE_DIRTY ->r0 bit 30*/
125 andc r0,r30,r0 /* r0 = pte & ~r0 */ 137 andc r0,r30,r0 /* r0 = pte & ~r0 */
126 rlwimi r3,r0,32-1,31,31 /* Insert result into PP lsb */ 138 rlwimi r3,r0,32-1,31,31 /* Insert result into PP lsb */
127 139
@@ -158,19 +170,21 @@ htab_insert_pte:
158 andc r30,r30,r0 170 andc r30,r30,r0
159 ori r30,r30,_PAGE_HASHPTE 171 ori r30,r30,_PAGE_HASHPTE
160 172
161 /* page number in r5 */ 173 /* physical address r5 */
162 rldicl r5,r31,64-PTE_SHIFT,PTE_SHIFT 174 rldicl r5,r31,64-PTE_RPN_SHIFT,PTE_RPN_SHIFT
175 sldi r5,r5,PAGE_SHIFT
163 176
164 /* Calculate primary group hash */ 177 /* Calculate primary group hash */
165 and r0,r28,r27 178 and r0,r28,r27
166 rldicr r3,r0,3,63-3 /* r0 = (hash & mask) << 3 */ 179 rldicr r3,r0,3,63-3 /* r3 = (hash & mask) << 3 */
167 180
168 /* Call ppc_md.hpte_insert */ 181 /* Call ppc_md.hpte_insert */
169 ld r7,STK_PARM(r4)(r1) /* Retreive new pp bits */ 182 ld r6,STK_PARM(r4)(r1) /* Retreive new pp bits */
170 mr r4,r29 /* Retreive va */ 183 mr r4,r29 /* Retreive va */
171 li r6,0 /* no vflags */ 184 li r7,0 /* !bolted, !secondary */
185 li r8,MMU_PAGE_4K /* page size */
172_GLOBAL(htab_call_hpte_insert1) 186_GLOBAL(htab_call_hpte_insert1)
173 bl . /* Will be patched by htab_finish_init() */ 187 bl . /* Patched by htab_finish_init() */
174 cmpdi 0,r3,0 188 cmpdi 0,r3,0
175 bge htab_pte_insert_ok /* Insertion successful */ 189 bge htab_pte_insert_ok /* Insertion successful */
176 cmpdi 0,r3,-2 /* Critical failure */ 190 cmpdi 0,r3,-2 /* Critical failure */
@@ -178,19 +192,21 @@ _GLOBAL(htab_call_hpte_insert1)
178 192
179 /* Now try secondary slot */ 193 /* Now try secondary slot */
180 194
181 /* page number in r5 */ 195 /* physical address r5 */
182 rldicl r5,r31,64-PTE_SHIFT,PTE_SHIFT 196 rldicl r5,r31,64-PTE_RPN_SHIFT,PTE_RPN_SHIFT
197 sldi r5,r5,PAGE_SHIFT
183 198
184 /* Calculate secondary group hash */ 199 /* Calculate secondary group hash */
185 andc r0,r27,r28 200 andc r0,r27,r28
186 rldicr r3,r0,3,63-3 /* r0 = (~hash & mask) << 3 */ 201 rldicr r3,r0,3,63-3 /* r0 = (~hash & mask) << 3 */
187 202
188 /* Call ppc_md.hpte_insert */ 203 /* Call ppc_md.hpte_insert */
189 ld r7,STK_PARM(r4)(r1) /* Retreive new pp bits */ 204 ld r6,STK_PARM(r4)(r1) /* Retreive new pp bits */
190 mr r4,r29 /* Retreive va */ 205 mr r4,r29 /* Retreive va */
191 li r6,HPTE_V_SECONDARY@l /* secondary slot */ 206 li r7,HPTE_V_SECONDARY /* !bolted, secondary */
207 li r8,MMU_PAGE_4K /* page size */
192_GLOBAL(htab_call_hpte_insert2) 208_GLOBAL(htab_call_hpte_insert2)
193 bl . /* Will be patched by htab_finish_init() */ 209 bl . /* Patched by htab_finish_init() */
194 cmpdi 0,r3,0 210 cmpdi 0,r3,0
195 bge+ htab_pte_insert_ok /* Insertion successful */ 211 bge+ htab_pte_insert_ok /* Insertion successful */
196 cmpdi 0,r3,-2 /* Critical failure */ 212 cmpdi 0,r3,-2 /* Critical failure */
@@ -207,14 +223,14 @@ _GLOBAL(htab_call_hpte_insert2)
207 rldicr r3,r0,3,63-3 /* r0 = (hash & mask) << 3 */ 223 rldicr r3,r0,3,63-3 /* r0 = (hash & mask) << 3 */
208 /* Call ppc_md.hpte_remove */ 224 /* Call ppc_md.hpte_remove */
209_GLOBAL(htab_call_hpte_remove) 225_GLOBAL(htab_call_hpte_remove)
210 bl . /* Will be patched by htab_finish_init() */ 226 bl . /* Patched by htab_finish_init() */
211 227
212 /* Try all again */ 228 /* Try all again */
213 b htab_insert_pte 229 b htab_insert_pte
214 230
215bail_ok: 231htab_bail_ok:
216 li r3,0 232 li r3,0
217 b bail 233 b htab_bail
218 234
219htab_pte_insert_ok: 235htab_pte_insert_ok:
220 /* Insert slot number & secondary bit in PTE */ 236 /* Insert slot number & secondary bit in PTE */
@@ -227,7 +243,7 @@ htab_write_out_pte:
227 ld r6,STK_PARM(r6)(r1) 243 ld r6,STK_PARM(r6)(r1)
228 std r30,0(r6) 244 std r30,0(r6)
229 li r3, 0 245 li r3, 0
230bail: 246htab_bail:
231 ld r27,STK_REG(r27)(r1) 247 ld r27,STK_REG(r27)(r1)
232 ld r28,STK_REG(r28)(r1) 248 ld r28,STK_REG(r28)(r1)
233 ld r29,STK_REG(r29)(r1) 249 ld r29,STK_REG(r29)(r1)
@@ -256,10 +272,10 @@ htab_modify_pte:
256 272
257 /* Call ppc_md.hpte_updatepp */ 273 /* Call ppc_md.hpte_updatepp */
258 mr r5,r29 /* va */ 274 mr r5,r29 /* va */
259 li r6,0 /* large is 0 */ 275 li r6,MMU_PAGE_4K /* page size */
260 ld r7,STK_PARM(r8)(r1) /* get "local" param */ 276 ld r7,STK_PARM(r8)(r1) /* get "local" param */
261_GLOBAL(htab_call_hpte_updatepp) 277_GLOBAL(htab_call_hpte_updatepp)
262 bl . /* Will be patched by htab_finish_init() */ 278 bl . /* Patched by htab_finish_init() */
263 279
264 /* if we failed because typically the HPTE wasn't really here 280 /* if we failed because typically the HPTE wasn't really here
265 * we try an insertion. 281 * we try an insertion.
@@ -276,13 +292,556 @@ htab_wrong_access:
276 /* Bail out clearing reservation */ 292 /* Bail out clearing reservation */
277 stdcx. r31,0,r6 293 stdcx. r31,0,r6
278 li r3,1 294 li r3,1
279 b bail 295 b htab_bail
296
297htab_pte_insert_failure:
298 /* Bail out restoring old PTE */
299 ld r6,STK_PARM(r6)(r1)
300 std r31,0(r6)
301 li r3,-1
302 b htab_bail
303
304
305#else /* CONFIG_PPC_64K_PAGES */
306
307
308/*****************************************************************************
309 * *
310 * 64K SW & 4K or 64K HW in a 4K segment pages implementation *
311 * *
312 *****************************************************************************/
313
314/* _hash_page_4K(unsigned long ea, unsigned long access, unsigned long vsid,
315 * pte_t *ptep, unsigned long trap, int local)
316 */
317
318/*
319 * For now, we do NOT implement Admixed pages
320 */
321_GLOBAL(__hash_page_4K)
322 mflr r0
323 std r0,16(r1)
324 stdu r1,-STACKFRAMESIZE(r1)
325 /* Save all params that we need after a function call */
326 std r6,STK_PARM(r6)(r1)
327 std r8,STK_PARM(r8)(r1)
328
329 /* Add _PAGE_PRESENT to access */
330 ori r4,r4,_PAGE_PRESENT
331
332 /* Save non-volatile registers.
333 * r31 will hold "old PTE"
334 * r30 is "new PTE"
335 * r29 is "va"
336 * r28 is a hash value
337 * r27 is hashtab mask (maybe dynamic patched instead ?)
338 * r26 is the hidx mask
339 * r25 is the index in combo page
340 */
341 std r25,STK_REG(r25)(r1)
342 std r26,STK_REG(r26)(r1)
343 std r27,STK_REG(r27)(r1)
344 std r28,STK_REG(r28)(r1)
345 std r29,STK_REG(r29)(r1)
346 std r30,STK_REG(r30)(r1)
347 std r31,STK_REG(r31)(r1)
348
349 /* Step 1:
350 *
351 * Check permissions, atomically mark the linux PTE busy
352 * and hashed.
353 */
3541:
355 ldarx r31,0,r6
356 /* Check access rights (access & ~(pte_val(*ptep))) */
357 andc. r0,r4,r31
358 bne- htab_wrong_access
359 /* Check if PTE is busy */
360 andi. r0,r31,_PAGE_BUSY
361 /* If so, just bail out and refault if needed. Someone else
362 * is changing this PTE anyway and might hash it.
363 */
364 bne- htab_bail_ok
365 /* Prepare new PTE value (turn access RW into DIRTY, then
366 * add BUSY and ACCESSED)
367 */
368 rlwinm r30,r4,32-9+7,31-7,31-7 /* _PAGE_RW -> _PAGE_DIRTY */
369 or r30,r30,r31
370 ori r30,r30,_PAGE_BUSY | _PAGE_ACCESSED | _PAGE_HASHPTE
371 /* Write the linux PTE atomically (setting busy) */
372 stdcx. r30,0,r6
373 bne- 1b
374 isync
375
376 /* Step 2:
377 *
378 * Insert/Update the HPTE in the hash table. At this point,
379 * r4 (access) is re-useable, we use it for the new HPTE flags
380 */
381
382 /* Load the hidx index */
383 rldicl r25,r3,64-12,60
384
385 /* Calc va and put it in r29 */
386 rldicr r29,r5,28,63-28 /* r29 = (vsid << 28) */
387 rldicl r3,r3,0,36 /* r3 = (ea & 0x0fffffff) */
388 or r29,r3,r29 /* r29 = va
389
390 /* Calculate hash value for primary slot and store it in r28 */
391 rldicl r5,r5,0,25 /* vsid & 0x0000007fffffffff */
392 rldicl r0,r3,64-12,48 /* (ea >> 12) & 0xffff */
393 xor r28,r5,r0
394
395 /* Convert linux PTE bits into HW equivalents */
396 andi. r3,r30,0x1fe /* Get basic set of flags */
397 xori r3,r3,HPTE_R_N /* _PAGE_EXEC -> NOEXEC */
398 rlwinm r0,r30,32-9+1,30,30 /* _PAGE_RW -> _PAGE_USER (r0) */
399 rlwinm r4,r30,32-7+1,30,30 /* _PAGE_DIRTY -> _PAGE_USER (r4) */
400 and r0,r0,r4 /* _PAGE_RW & _PAGE_DIRTY ->r0 bit 30*/
401 andc r0,r30,r0 /* r0 = pte & ~r0 */
402 rlwimi r3,r0,32-1,31,31 /* Insert result into PP lsb */
403
404 /* We eventually do the icache sync here (maybe inline that
405 * code rather than call a C function...)
406 */
407BEGIN_FTR_SECTION
408 mr r4,r30
409 mr r5,r7
410 bl .hash_page_do_lazy_icache
411END_FTR_SECTION(CPU_FTR_NOEXECUTE|CPU_FTR_COHERENT_ICACHE, CPU_FTR_NOEXECUTE)
412
413 /* At this point, r3 contains new PP bits, save them in
414 * place of "access" in the param area (sic)
415 */
416 std r3,STK_PARM(r4)(r1)
417
418 /* Get htab_hash_mask */
419 ld r4,htab_hash_mask@got(2)
420 ld r27,0(r4) /* htab_hash_mask -> r27 */
421
422 /* Check if we may already be in the hashtable, in this case, we
423 * go to out-of-line code to try to modify the HPTE. We look for
424 * the bit at (1 >> (index + 32))
425 */
426 andi. r0,r31,_PAGE_HASHPTE
427 li r26,0 /* Default hidx */
428 beq htab_insert_pte
429 ld r6,STK_PARM(r6)(r1)
430 ori r26,r6,0x8000 /* Load the hidx mask */
431 ld r26,0(r26)
432 addi r5,r25,36 /* Check actual HPTE_SUB bit, this */
433 rldcr. r0,r31,r5,0 /* must match pgtable.h definition */
434 bne htab_modify_pte
435
436htab_insert_pte:
437 /* real page number in r5, PTE RPN value + index */
438 rldicl r5,r31,64-PTE_RPN_SHIFT,PTE_RPN_SHIFT
439 sldi r5,r5,PAGE_SHIFT-HW_PAGE_SHIFT
440 add r5,r5,r25
441 sldi r5,r5,HW_PAGE_SHIFT
442
443 /* Calculate primary group hash */
444 and r0,r28,r27
445 rldicr r3,r0,3,63-3 /* r0 = (hash & mask) << 3 */
446
447 /* Call ppc_md.hpte_insert */
448 ld r6,STK_PARM(r4)(r1) /* Retreive new pp bits */
449 mr r4,r29 /* Retreive va */
450 li r7,0 /* !bolted, !secondary */
451 li r8,MMU_PAGE_4K /* page size */
452_GLOBAL(htab_call_hpte_insert1)
453 bl . /* patched by htab_finish_init() */
454 cmpdi 0,r3,0
455 bge htab_pte_insert_ok /* Insertion successful */
456 cmpdi 0,r3,-2 /* Critical failure */
457 beq- htab_pte_insert_failure
458
459 /* Now try secondary slot */
460
461 /* real page number in r5, PTE RPN value + index */
462 rldicl r5,r31,64-PTE_RPN_SHIFT,PTE_RPN_SHIFT
463 sldi r5,r5,PAGE_SHIFT-HW_PAGE_SHIFT
464 add r5,r5,r25
465 sldi r5,r5,HW_PAGE_SHIFT
466
467 /* Calculate secondary group hash */
468 andc r0,r27,r28
469 rldicr r3,r0,3,63-3 /* r0 = (~hash & mask) << 3 */
470
471 /* Call ppc_md.hpte_insert */
472 ld r6,STK_PARM(r4)(r1) /* Retreive new pp bits */
473 mr r4,r29 /* Retreive va */
474 li r7,HPTE_V_SECONDARY /* !bolted, secondary */
475 li r8,MMU_PAGE_4K /* page size */
476_GLOBAL(htab_call_hpte_insert2)
477 bl . /* patched by htab_finish_init() */
478 cmpdi 0,r3,0
479 bge+ htab_pte_insert_ok /* Insertion successful */
480 cmpdi 0,r3,-2 /* Critical failure */
481 beq- htab_pte_insert_failure
482
483 /* Both are full, we need to evict something */
484 mftb r0
485 /* Pick a random group based on TB */
486 andi. r0,r0,1
487 mr r5,r28
488 bne 2f
489 not r5,r5
4902: and r0,r5,r27
491 rldicr r3,r0,3,63-3 /* r0 = (hash & mask) << 3 */
492 /* Call ppc_md.hpte_remove */
493_GLOBAL(htab_call_hpte_remove)
494 bl . /* patched by htab_finish_init() */
495
496 /* Try all again */
497 b htab_insert_pte
498
499htab_bail_ok:
500 li r3,0
501 b htab_bail
502
503htab_pte_insert_ok:
504 /* Insert slot number & secondary bit in PTE second half,
505 * clear _PAGE_BUSY and set approriate HPTE slot bit
506 */
507 ld r6,STK_PARM(r6)(r1)
508 li r0,_PAGE_BUSY
509 andc r30,r30,r0
510 /* HPTE SUB bit */
511 li r0,1
512 subfic r5,r25,27 /* Must match bit position in */
513 sld r0,r0,r5 /* pgtable.h */
514 or r30,r30,r0
515 /* hindx */
516 sldi r5,r25,2
517 sld r3,r3,r5
518 li r4,0xf
519 sld r4,r4,r5
520 andc r26,r26,r4
521 or r26,r26,r3
522 ori r5,r6,0x8000
523 std r26,0(r5)
524 lwsync
525 std r30,0(r6)
526 li r3, 0
527htab_bail:
528 ld r25,STK_REG(r25)(r1)
529 ld r26,STK_REG(r26)(r1)
530 ld r27,STK_REG(r27)(r1)
531 ld r28,STK_REG(r28)(r1)
532 ld r29,STK_REG(r29)(r1)
533 ld r30,STK_REG(r30)(r1)
534 ld r31,STK_REG(r31)(r1)
535 addi r1,r1,STACKFRAMESIZE
536 ld r0,16(r1)
537 mtlr r0
538 blr
539
540htab_modify_pte:
541 /* Keep PP bits in r4 and slot idx from the PTE around in r3 */
542 mr r4,r3
543 sldi r5,r25,2
544 srd r3,r26,r5
545
546 /* Secondary group ? if yes, get a inverted hash value */
547 mr r5,r28
548 andi. r0,r3,0x8 /* page secondary ? */
549 beq 1f
550 not r5,r5
5511: andi. r3,r3,0x7 /* extract idx alone */
552
553 /* Calculate proper slot value for ppc_md.hpte_updatepp */
554 and r0,r5,r27
555 rldicr r0,r0,3,63-3 /* r0 = (hash & mask) << 3 */
556 add r3,r0,r3 /* add slot idx */
557
558 /* Call ppc_md.hpte_updatepp */
559 mr r5,r29 /* va */
560 li r6,MMU_PAGE_4K /* page size */
561 ld r7,STK_PARM(r8)(r1) /* get "local" param */
562_GLOBAL(htab_call_hpte_updatepp)
563 bl . /* patched by htab_finish_init() */
564
565 /* if we failed because typically the HPTE wasn't really here
566 * we try an insertion.
567 */
568 cmpdi 0,r3,-1
569 beq- htab_insert_pte
570
571 /* Clear the BUSY bit and Write out the PTE */
572 li r0,_PAGE_BUSY
573 andc r30,r30,r0
574 ld r6,STK_PARM(r6)(r1)
575 std r30,0(r6)
576 li r3,0
577 b htab_bail
578
579htab_wrong_access:
580 /* Bail out clearing reservation */
581 stdcx. r31,0,r6
582 li r3,1
583 b htab_bail
280 584
281htab_pte_insert_failure: 585htab_pte_insert_failure:
282 /* Bail out restoring old PTE */ 586 /* Bail out restoring old PTE */
283 ld r6,STK_PARM(r6)(r1) 587 ld r6,STK_PARM(r6)(r1)
284 std r31,0(r6) 588 std r31,0(r6)
285 li r3,-1 589 li r3,-1
286 b bail 590 b htab_bail
591
592
593/*****************************************************************************
594 * *
595 * 64K SW & 64K HW in a 64K segment pages implementation *
596 * *
597 *****************************************************************************/
598
599_GLOBAL(__hash_page_64K)
600 mflr r0
601 std r0,16(r1)
602 stdu r1,-STACKFRAMESIZE(r1)
603 /* Save all params that we need after a function call */
604 std r6,STK_PARM(r6)(r1)
605 std r8,STK_PARM(r8)(r1)
606
607 /* Add _PAGE_PRESENT to access */
608 ori r4,r4,_PAGE_PRESENT
609
610 /* Save non-volatile registers.
611 * r31 will hold "old PTE"
612 * r30 is "new PTE"
613 * r29 is "va"
614 * r28 is a hash value
615 * r27 is hashtab mask (maybe dynamic patched instead ?)
616 */
617 std r27,STK_REG(r27)(r1)
618 std r28,STK_REG(r28)(r1)
619 std r29,STK_REG(r29)(r1)
620 std r30,STK_REG(r30)(r1)
621 std r31,STK_REG(r31)(r1)
622
623 /* Step 1:
624 *
625 * Check permissions, atomically mark the linux PTE busy
626 * and hashed.
627 */
6281:
629 ldarx r31,0,r6
630 /* Check access rights (access & ~(pte_val(*ptep))) */
631 andc. r0,r4,r31
632 bne- ht64_wrong_access
633 /* Check if PTE is busy */
634 andi. r0,r31,_PAGE_BUSY
635 /* If so, just bail out and refault if needed. Someone else
636 * is changing this PTE anyway and might hash it.
637 */
638 bne- ht64_bail_ok
639 /* Prepare new PTE value (turn access RW into DIRTY, then
640 * add BUSY,HASHPTE and ACCESSED)
641 */
642 rlwinm r30,r4,32-9+7,31-7,31-7 /* _PAGE_RW -> _PAGE_DIRTY */
643 or r30,r30,r31
644 ori r30,r30,_PAGE_BUSY | _PAGE_ACCESSED | _PAGE_HASHPTE
645 /* Write the linux PTE atomically (setting busy) */
646 stdcx. r30,0,r6
647 bne- 1b
648 isync
649
650 /* Step 2:
651 *
652 * Insert/Update the HPTE in the hash table. At this point,
653 * r4 (access) is re-useable, we use it for the new HPTE flags
654 */
655
656 /* Calc va and put it in r29 */
657 rldicr r29,r5,28,63-28
658 rldicl r3,r3,0,36
659 or r29,r3,r29
660
661 /* Calculate hash value for primary slot and store it in r28 */
662 rldicl r5,r5,0,25 /* vsid & 0x0000007fffffffff */
663 rldicl r0,r3,64-16,52 /* (ea >> 16) & 0xfff */
664 xor r28,r5,r0
665
666 /* Convert linux PTE bits into HW equivalents */
667 andi. r3,r30,0x1fe /* Get basic set of flags */
668 xori r3,r3,HPTE_R_N /* _PAGE_EXEC -> NOEXEC */
669 rlwinm r0,r30,32-9+1,30,30 /* _PAGE_RW -> _PAGE_USER (r0) */
670 rlwinm r4,r30,32-7+1,30,30 /* _PAGE_DIRTY -> _PAGE_USER (r4) */
671 and r0,r0,r4 /* _PAGE_RW & _PAGE_DIRTY ->r0 bit 30*/
672 andc r0,r30,r0 /* r0 = pte & ~r0 */
673 rlwimi r3,r0,32-1,31,31 /* Insert result into PP lsb */
674
675 /* We eventually do the icache sync here (maybe inline that
676 * code rather than call a C function...)
677 */
678BEGIN_FTR_SECTION
679 mr r4,r30
680 mr r5,r7
681 bl .hash_page_do_lazy_icache
682END_FTR_SECTION(CPU_FTR_NOEXECUTE|CPU_FTR_COHERENT_ICACHE, CPU_FTR_NOEXECUTE)
683
684 /* At this point, r3 contains new PP bits, save them in
685 * place of "access" in the param area (sic)
686 */
687 std r3,STK_PARM(r4)(r1)
688
689 /* Get htab_hash_mask */
690 ld r4,htab_hash_mask@got(2)
691 ld r27,0(r4) /* htab_hash_mask -> r27 */
692
693 /* Check if we may already be in the hashtable, in this case, we
694 * go to out-of-line code to try to modify the HPTE
695 */
696 andi. r0,r31,_PAGE_HASHPTE
697 bne ht64_modify_pte
698
699ht64_insert_pte:
700 /* Clear hpte bits in new pte (we also clear BUSY btw) and
701 * add _PAGE_HASHPTE
702 */
703 lis r0,_PAGE_HPTEFLAGS@h
704 ori r0,r0,_PAGE_HPTEFLAGS@l
705 andc r30,r30,r0
706 ori r30,r30,_PAGE_HASHPTE
707
708 /* Phyical address in r5 */
709 rldicl r5,r31,64-PTE_RPN_SHIFT,PTE_RPN_SHIFT
710 sldi r5,r5,PAGE_SHIFT
711
712 /* Calculate primary group hash */
713 and r0,r28,r27
714 rldicr r3,r0,3,63-3 /* r0 = (hash & mask) << 3 */
715
716 /* Call ppc_md.hpte_insert */
717 ld r6,STK_PARM(r4)(r1) /* Retreive new pp bits */
718 mr r4,r29 /* Retreive va */
719 li r7,0 /* !bolted, !secondary */
720 li r8,MMU_PAGE_64K
721_GLOBAL(ht64_call_hpte_insert1)
722 bl . /* patched by htab_finish_init() */
723 cmpdi 0,r3,0
724 bge ht64_pte_insert_ok /* Insertion successful */
725 cmpdi 0,r3,-2 /* Critical failure */
726 beq- ht64_pte_insert_failure
727
728 /* Now try secondary slot */
729
730 /* Phyical address in r5 */
731 rldicl r5,r31,64-PTE_RPN_SHIFT,PTE_RPN_SHIFT
732 sldi r5,r5,PAGE_SHIFT
733
734 /* Calculate secondary group hash */
735 andc r0,r27,r28
736 rldicr r3,r0,3,63-3 /* r0 = (~hash & mask) << 3 */
737
738 /* Call ppc_md.hpte_insert */
739 ld r6,STK_PARM(r4)(r1) /* Retreive new pp bits */
740 mr r4,r29 /* Retreive va */
741 li r7,HPTE_V_SECONDARY /* !bolted, secondary */
742 li r8,MMU_PAGE_64K
743_GLOBAL(ht64_call_hpte_insert2)
744 bl . /* patched by htab_finish_init() */
745 cmpdi 0,r3,0
746 bge+ ht64_pte_insert_ok /* Insertion successful */
747 cmpdi 0,r3,-2 /* Critical failure */
748 beq- ht64_pte_insert_failure
749
750 /* Both are full, we need to evict something */
751 mftb r0
752 /* Pick a random group based on TB */
753 andi. r0,r0,1
754 mr r5,r28
755 bne 2f
756 not r5,r5
7572: and r0,r5,r27
758 rldicr r3,r0,3,63-3 /* r0 = (hash & mask) << 3 */
759 /* Call ppc_md.hpte_remove */
760_GLOBAL(ht64_call_hpte_remove)
761 bl . /* patched by htab_finish_init() */
762
763 /* Try all again */
764 b ht64_insert_pte
765
766ht64_bail_ok:
767 li r3,0
768 b ht64_bail
769
770ht64_pte_insert_ok:
771 /* Insert slot number & secondary bit in PTE */
772 rldimi r30,r3,12,63-15
773
774 /* Write out the PTE with a normal write
775 * (maybe add eieio may be good still ?)
776 */
777ht64_write_out_pte:
778 ld r6,STK_PARM(r6)(r1)
779 std r30,0(r6)
780 li r3, 0
781ht64_bail:
782 ld r27,STK_REG(r27)(r1)
783 ld r28,STK_REG(r28)(r1)
784 ld r29,STK_REG(r29)(r1)
785 ld r30,STK_REG(r30)(r1)
786 ld r31,STK_REG(r31)(r1)
787 addi r1,r1,STACKFRAMESIZE
788 ld r0,16(r1)
789 mtlr r0
790 blr
791
792ht64_modify_pte:
793 /* Keep PP bits in r4 and slot idx from the PTE around in r3 */
794 mr r4,r3
795 rlwinm r3,r31,32-12,29,31
796
797 /* Secondary group ? if yes, get a inverted hash value */
798 mr r5,r28
799 andi. r0,r31,_PAGE_F_SECOND
800 beq 1f
801 not r5,r5
8021:
803 /* Calculate proper slot value for ppc_md.hpte_updatepp */
804 and r0,r5,r27
805 rldicr r0,r0,3,63-3 /* r0 = (hash & mask) << 3 */
806 add r3,r0,r3 /* add slot idx */
807
808 /* Call ppc_md.hpte_updatepp */
809 mr r5,r29 /* va */
810 li r6,MMU_PAGE_64K
811 ld r7,STK_PARM(r8)(r1) /* get "local" param */
812_GLOBAL(ht64_call_hpte_updatepp)
813 bl . /* patched by htab_finish_init() */
814
815 /* if we failed because typically the HPTE wasn't really here
816 * we try an insertion.
817 */
818 cmpdi 0,r3,-1
819 beq- ht64_insert_pte
820
821 /* Clear the BUSY bit and Write out the PTE */
822 li r0,_PAGE_BUSY
823 andc r30,r30,r0
824 b ht64_write_out_pte
825
826ht64_wrong_access:
827 /* Bail out clearing reservation */
828 stdcx. r31,0,r6
829 li r3,1
830 b ht64_bail
831
832ht64_pte_insert_failure:
833 /* Bail out restoring old PTE */
834 ld r6,STK_PARM(r6)(r1)
835 std r31,0(r6)
836 li r3,-1
837 b ht64_bail
838
839
840#endif /* CONFIG_PPC_64K_PAGES */
287 841
288 842
843/*****************************************************************************
844 * *
845 * Huge pages implementation is in hugetlbpage.c *
846 * *
847 *****************************************************************************/
diff --git a/arch/powerpc/mm/hash_native_64.c b/arch/powerpc/mm/hash_native_64.c
index 174d14576c28..d96bcfe4c6f6 100644
--- a/arch/powerpc/mm/hash_native_64.c
+++ b/arch/powerpc/mm/hash_native_64.c
@@ -9,6 +9,9 @@
9 * as published by the Free Software Foundation; either version 9 * as published by the Free Software Foundation; either version
10 * 2 of the License, or (at your option) any later version. 10 * 2 of the License, or (at your option) any later version.
11 */ 11 */
12
13#undef DEBUG_LOW
14
12#include <linux/spinlock.h> 15#include <linux/spinlock.h>
13#include <linux/bitops.h> 16#include <linux/bitops.h>
14#include <linux/threads.h> 17#include <linux/threads.h>
@@ -22,11 +25,84 @@
22#include <asm/tlbflush.h> 25#include <asm/tlbflush.h>
23#include <asm/tlb.h> 26#include <asm/tlb.h>
24#include <asm/cputable.h> 27#include <asm/cputable.h>
28#include <asm/udbg.h>
29
30#ifdef DEBUG_LOW
31#define DBG_LOW(fmt...) udbg_printf(fmt)
32#else
33#define DBG_LOW(fmt...)
34#endif
25 35
26#define HPTE_LOCK_BIT 3 36#define HPTE_LOCK_BIT 3
27 37
28static DEFINE_SPINLOCK(native_tlbie_lock); 38static DEFINE_SPINLOCK(native_tlbie_lock);
29 39
40static inline void __tlbie(unsigned long va, unsigned int psize)
41{
42 unsigned int penc;
43
44 /* clear top 16 bits, non SLS segment */
45 va &= ~(0xffffULL << 48);
46
47 switch (psize) {
48 case MMU_PAGE_4K:
49 va &= ~0xffful;
50 asm volatile("tlbie %0,0" : : "r" (va) : "memory");
51 break;
52 default:
53 penc = mmu_psize_defs[psize].penc;
54 va &= ~((1ul << mmu_psize_defs[psize].shift) - 1);
55 va |= (0x7f >> (8 - penc)) << 12;
56 asm volatile("tlbie %0,1" : : "r" (va) : "memory");
57 break;
58 }
59}
60
61static inline void __tlbiel(unsigned long va, unsigned int psize)
62{
63 unsigned int penc;
64
65 /* clear top 16 bits, non SLS segment */
66 va &= ~(0xffffULL << 48);
67
68 switch (psize) {
69 case MMU_PAGE_4K:
70 va &= ~0xffful;
71 asm volatile(".long 0x7c000224 | (%0 << 11) | (0 << 21)"
72 : : "r"(va) : "memory");
73 break;
74 default:
75 penc = mmu_psize_defs[psize].penc;
76 va &= ~((1ul << mmu_psize_defs[psize].shift) - 1);
77 va |= (0x7f >> (8 - penc)) << 12;
78 asm volatile(".long 0x7c000224 | (%0 << 11) | (1 << 21)"
79 : : "r"(va) : "memory");
80 break;
81 }
82
83}
84
85static inline void tlbie(unsigned long va, int psize, int local)
86{
87 unsigned int use_local = local && cpu_has_feature(CPU_FTR_TLBIEL);
88 int lock_tlbie = !cpu_has_feature(CPU_FTR_LOCKLESS_TLBIE);
89
90 if (use_local)
91 use_local = mmu_psize_defs[psize].tlbiel;
92 if (lock_tlbie && !use_local)
93 spin_lock(&native_tlbie_lock);
94 asm volatile("ptesync": : :"memory");
95 if (use_local) {
96 __tlbiel(va, psize);
97 asm volatile("ptesync": : :"memory");
98 } else {
99 __tlbie(va, psize);
100 asm volatile("eieio; tlbsync; ptesync": : :"memory");
101 }
102 if (lock_tlbie && !use_local)
103 spin_unlock(&native_tlbie_lock);
104}
105
30static inline void native_lock_hpte(hpte_t *hptep) 106static inline void native_lock_hpte(hpte_t *hptep)
31{ 107{
32 unsigned long *word = &hptep->v; 108 unsigned long *word = &hptep->v;
@@ -48,13 +124,19 @@ static inline void native_unlock_hpte(hpte_t *hptep)
48} 124}
49 125
50long native_hpte_insert(unsigned long hpte_group, unsigned long va, 126long native_hpte_insert(unsigned long hpte_group, unsigned long va,
51 unsigned long prpn, unsigned long vflags, 127 unsigned long pa, unsigned long rflags,
52 unsigned long rflags) 128 unsigned long vflags, int psize)
53{ 129{
54 hpte_t *hptep = htab_address + hpte_group; 130 hpte_t *hptep = htab_address + hpte_group;
55 unsigned long hpte_v, hpte_r; 131 unsigned long hpte_v, hpte_r;
56 int i; 132 int i;
57 133
134 if (!(vflags & HPTE_V_BOLTED)) {
135 DBG_LOW(" insert(group=%lx, va=%016lx, pa=%016lx,"
136 " rflags=%lx, vflags=%lx, psize=%d)\n",
137 hpte_group, va, pa, rflags, vflags, psize);
138 }
139
58 for (i = 0; i < HPTES_PER_GROUP; i++) { 140 for (i = 0; i < HPTES_PER_GROUP; i++) {
59 if (! (hptep->v & HPTE_V_VALID)) { 141 if (! (hptep->v & HPTE_V_VALID)) {
60 /* retry with lock held */ 142 /* retry with lock held */
@@ -70,10 +152,13 @@ long native_hpte_insert(unsigned long hpte_group, unsigned long va,
70 if (i == HPTES_PER_GROUP) 152 if (i == HPTES_PER_GROUP)
71 return -1; 153 return -1;
72 154
73 hpte_v = (va >> 23) << HPTE_V_AVPN_SHIFT | vflags | HPTE_V_VALID; 155 hpte_v = hpte_encode_v(va, psize) | vflags | HPTE_V_VALID;
74 if (vflags & HPTE_V_LARGE) 156 hpte_r = hpte_encode_r(pa, psize) | rflags;
75 va &= ~(1UL << HPTE_V_AVPN_SHIFT); 157
76 hpte_r = (prpn << HPTE_R_RPN_SHIFT) | rflags; 158 if (!(vflags & HPTE_V_BOLTED)) {
159 DBG_LOW(" i=%x hpte_v=%016lx, hpte_r=%016lx\n",
160 i, hpte_v, hpte_r);
161 }
77 162
78 hptep->r = hpte_r; 163 hptep->r = hpte_r;
79 /* Guarantee the second dword is visible before the valid bit */ 164 /* Guarantee the second dword is visible before the valid bit */
@@ -96,6 +181,8 @@ static long native_hpte_remove(unsigned long hpte_group)
96 int slot_offset; 181 int slot_offset;
97 unsigned long hpte_v; 182 unsigned long hpte_v;
98 183
184 DBG_LOW(" remove(group=%lx)\n", hpte_group);
185
99 /* pick a random entry to start at */ 186 /* pick a random entry to start at */
100 slot_offset = mftb() & 0x7; 187 slot_offset = mftb() & 0x7;
101 188
@@ -126,34 +213,51 @@ static long native_hpte_remove(unsigned long hpte_group)
126 return i; 213 return i;
127} 214}
128 215
129static inline void set_pp_bit(unsigned long pp, hpte_t *addr) 216static long native_hpte_updatepp(unsigned long slot, unsigned long newpp,
217 unsigned long va, int psize, int local)
130{ 218{
131 unsigned long old; 219 hpte_t *hptep = htab_address + slot;
132 unsigned long *p = &addr->r; 220 unsigned long hpte_v, want_v;
133 221 int ret = 0;
134 __asm__ __volatile__( 222
135 "1: ldarx %0,0,%3\n\ 223 want_v = hpte_encode_v(va, psize);
136 rldimi %0,%2,0,61\n\ 224
137 stdcx. %0,0,%3\n\ 225 DBG_LOW(" update(va=%016lx, avpnv=%016lx, hash=%016lx, newpp=%x)",
138 bne 1b" 226 va, want_v & HPTE_V_AVPN, slot, newpp);
139 : "=&r" (old), "=m" (*p) 227
140 : "r" (pp), "r" (p), "m" (*p) 228 native_lock_hpte(hptep);
141 : "cc"); 229
230 hpte_v = hptep->v;
231
232 /* Even if we miss, we need to invalidate the TLB */
233 if (!HPTE_V_COMPARE(hpte_v, want_v) || !(hpte_v & HPTE_V_VALID)) {
234 DBG_LOW(" -> miss\n");
235 native_unlock_hpte(hptep);
236 ret = -1;
237 } else {
238 DBG_LOW(" -> hit\n");
239 /* Update the HPTE */
240 hptep->r = (hptep->r & ~(HPTE_R_PP | HPTE_R_N)) |
241 (newpp & (HPTE_R_PP | HPTE_R_N));
242 native_unlock_hpte(hptep);
243 }
244
245 /* Ensure it is out of the tlb too. */
246 tlbie(va, psize, local);
247
248 return ret;
142} 249}
143 250
144/* 251static long native_hpte_find(unsigned long va, int psize)
145 * Only works on small pages. Yes its ugly to have to check each slot in
146 * the group but we only use this during bootup.
147 */
148static long native_hpte_find(unsigned long vpn)
149{ 252{
150 hpte_t *hptep; 253 hpte_t *hptep;
151 unsigned long hash; 254 unsigned long hash;
152 unsigned long i, j; 255 unsigned long i, j;
153 long slot; 256 long slot;
154 unsigned long hpte_v; 257 unsigned long want_v, hpte_v;
155 258
156 hash = hpt_hash(vpn, 0); 259 hash = hpt_hash(va, mmu_psize_defs[psize].shift);
260 want_v = hpte_encode_v(va, psize);
157 261
158 for (j = 0; j < 2; j++) { 262 for (j = 0; j < 2; j++) {
159 slot = (hash & htab_hash_mask) * HPTES_PER_GROUP; 263 slot = (hash & htab_hash_mask) * HPTES_PER_GROUP;
@@ -161,7 +265,7 @@ static long native_hpte_find(unsigned long vpn)
161 hptep = htab_address + slot; 265 hptep = htab_address + slot;
162 hpte_v = hptep->v; 266 hpte_v = hptep->v;
163 267
164 if ((HPTE_V_AVPN_VAL(hpte_v) == (vpn >> 11)) 268 if (HPTE_V_COMPARE(hpte_v, want_v)
165 && (hpte_v & HPTE_V_VALID) 269 && (hpte_v & HPTE_V_VALID)
166 && ( !!(hpte_v & HPTE_V_SECONDARY) == j)) { 270 && ( !!(hpte_v & HPTE_V_SECONDARY) == j)) {
167 /* HPTE matches */ 271 /* HPTE matches */
@@ -177,127 +281,101 @@ static long native_hpte_find(unsigned long vpn)
177 return -1; 281 return -1;
178} 282}
179 283
180static long native_hpte_updatepp(unsigned long slot, unsigned long newpp,
181 unsigned long va, int large, int local)
182{
183 hpte_t *hptep = htab_address + slot;
184 unsigned long hpte_v;
185 unsigned long avpn = va >> 23;
186 int ret = 0;
187
188 if (large)
189 avpn &= ~1;
190
191 native_lock_hpte(hptep);
192
193 hpte_v = hptep->v;
194
195 /* Even if we miss, we need to invalidate the TLB */
196 if ((HPTE_V_AVPN_VAL(hpte_v) != avpn)
197 || !(hpte_v & HPTE_V_VALID)) {
198 native_unlock_hpte(hptep);
199 ret = -1;
200 } else {
201 set_pp_bit(newpp, hptep);
202 native_unlock_hpte(hptep);
203 }
204
205 /* Ensure it is out of the tlb too */
206 if (cpu_has_feature(CPU_FTR_TLBIEL) && !large && local) {
207 tlbiel(va);
208 } else {
209 int lock_tlbie = !cpu_has_feature(CPU_FTR_LOCKLESS_TLBIE);
210
211 if (lock_tlbie)
212 spin_lock(&native_tlbie_lock);
213 tlbie(va, large);
214 if (lock_tlbie)
215 spin_unlock(&native_tlbie_lock);
216 }
217
218 return ret;
219}
220
221/* 284/*
222 * Update the page protection bits. Intended to be used to create 285 * Update the page protection bits. Intended to be used to create
223 * guard pages for kernel data structures on pages which are bolted 286 * guard pages for kernel data structures on pages which are bolted
224 * in the HPT. Assumes pages being operated on will not be stolen. 287 * in the HPT. Assumes pages being operated on will not be stolen.
225 * Does not work on large pages.
226 * 288 *
227 * No need to lock here because we should be the only user. 289 * No need to lock here because we should be the only user.
228 */ 290 */
229static void native_hpte_updateboltedpp(unsigned long newpp, unsigned long ea) 291static void native_hpte_updateboltedpp(unsigned long newpp, unsigned long ea,
292 int psize)
230{ 293{
231 unsigned long vsid, va, vpn, flags = 0; 294 unsigned long vsid, va;
232 long slot; 295 long slot;
233 hpte_t *hptep; 296 hpte_t *hptep;
234 int lock_tlbie = !cpu_has_feature(CPU_FTR_LOCKLESS_TLBIE);
235 297
236 vsid = get_kernel_vsid(ea); 298 vsid = get_kernel_vsid(ea);
237 va = (vsid << 28) | (ea & 0x0fffffff); 299 va = (vsid << 28) | (ea & 0x0fffffff);
238 vpn = va >> PAGE_SHIFT;
239 300
240 slot = native_hpte_find(vpn); 301 slot = native_hpte_find(va, psize);
241 if (slot == -1) 302 if (slot == -1)
242 panic("could not find page to bolt\n"); 303 panic("could not find page to bolt\n");
243 hptep = htab_address + slot; 304 hptep = htab_address + slot;
244 305
245 set_pp_bit(newpp, hptep); 306 /* Update the HPTE */
307 hptep->r = (hptep->r & ~(HPTE_R_PP | HPTE_R_N)) |
308 (newpp & (HPTE_R_PP | HPTE_R_N));
246 309
247 /* Ensure it is out of the tlb too */ 310 /* Ensure it is out of the tlb too. */
248 if (lock_tlbie) 311 tlbie(va, psize, 0);
249 spin_lock_irqsave(&native_tlbie_lock, flags);
250 tlbie(va, 0);
251 if (lock_tlbie)
252 spin_unlock_irqrestore(&native_tlbie_lock, flags);
253} 312}
254 313
255static void native_hpte_invalidate(unsigned long slot, unsigned long va, 314static void native_hpte_invalidate(unsigned long slot, unsigned long va,
256 int large, int local) 315 int psize, int local)
257{ 316{
258 hpte_t *hptep = htab_address + slot; 317 hpte_t *hptep = htab_address + slot;
259 unsigned long hpte_v; 318 unsigned long hpte_v;
260 unsigned long avpn = va >> 23; 319 unsigned long want_v;
261 unsigned long flags; 320 unsigned long flags;
262 int lock_tlbie = !cpu_has_feature(CPU_FTR_LOCKLESS_TLBIE);
263
264 if (large)
265 avpn &= ~1;
266 321
267 local_irq_save(flags); 322 local_irq_save(flags);
268 native_lock_hpte(hptep);
269 323
324 DBG_LOW(" invalidate(va=%016lx, hash: %x)\n", va, slot);
325
326 want_v = hpte_encode_v(va, psize);
327 native_lock_hpte(hptep);
270 hpte_v = hptep->v; 328 hpte_v = hptep->v;
271 329
272 /* Even if we miss, we need to invalidate the TLB */ 330 /* Even if we miss, we need to invalidate the TLB */
273 if ((HPTE_V_AVPN_VAL(hpte_v) != avpn) 331 if (!HPTE_V_COMPARE(hpte_v, want_v) || !(hpte_v & HPTE_V_VALID))
274 || !(hpte_v & HPTE_V_VALID)) {
275 native_unlock_hpte(hptep); 332 native_unlock_hpte(hptep);
276 } else { 333 else
277 /* Invalidate the hpte. NOTE: this also unlocks it */ 334 /* Invalidate the hpte. NOTE: this also unlocks it */
278 hptep->v = 0; 335 hptep->v = 0;
279 }
280 336
281 /* Invalidate the tlb */ 337 /* Invalidate the TLB */
282 if (cpu_has_feature(CPU_FTR_TLBIEL) && !large && local) { 338 tlbie(va, psize, local);
283 tlbiel(va); 339
284 } else {
285 if (lock_tlbie)
286 spin_lock(&native_tlbie_lock);
287 tlbie(va, large);
288 if (lock_tlbie)
289 spin_unlock(&native_tlbie_lock);
290 }
291 local_irq_restore(flags); 340 local_irq_restore(flags);
292} 341}
293 342
294/* 343/*
344 * XXX This need fixing based on page size. It's only used by
345 * native_hpte_clear() for now which needs fixing too so they
346 * make a good pair...
347 */
348static unsigned long slot2va(unsigned long hpte_v, unsigned long slot)
349{
350 unsigned long avpn = HPTE_V_AVPN_VAL(hpte_v);
351 unsigned long va;
352
353 va = avpn << 23;
354
355 if (! (hpte_v & HPTE_V_LARGE)) {
356 unsigned long vpi, pteg;
357
358 pteg = slot / HPTES_PER_GROUP;
359 if (hpte_v & HPTE_V_SECONDARY)
360 pteg = ~pteg;
361
362 vpi = ((va >> 28) ^ pteg) & htab_hash_mask;
363
364 va |= vpi << PAGE_SHIFT;
365 }
366
367 return va;
368}
369
370/*
295 * clear all mappings on kexec. All cpus are in real mode (or they will 371 * clear all mappings on kexec. All cpus are in real mode (or they will
296 * be when they isi), and we are the only one left. We rely on our kernel 372 * be when they isi), and we are the only one left. We rely on our kernel
297 * mapping being 0xC0's and the hardware ignoring those two real bits. 373 * mapping being 0xC0's and the hardware ignoring those two real bits.
298 * 374 *
299 * TODO: add batching support when enabled. remember, no dynamic memory here, 375 * TODO: add batching support when enabled. remember, no dynamic memory here,
300 * athough there is the control page available... 376 * athough there is the control page available...
377 *
378 * XXX FIXME: 4k only for now !
301 */ 379 */
302static void native_hpte_clear(void) 380static void native_hpte_clear(void)
303{ 381{
@@ -327,7 +405,7 @@ static void native_hpte_clear(void)
327 405
328 if (hpte_v & HPTE_V_VALID) { 406 if (hpte_v & HPTE_V_VALID) {
329 hptep->v = 0; 407 hptep->v = 0;
330 tlbie(slot2va(hpte_v, slot), hpte_v & HPTE_V_LARGE); 408 tlbie(slot2va(hpte_v, slot), MMU_PAGE_4K, 0);
331 } 409 }
332 } 410 }
333 411
@@ -335,59 +413,59 @@ static void native_hpte_clear(void)
335 local_irq_restore(flags); 413 local_irq_restore(flags);
336} 414}
337 415
416/*
417 * Batched hash table flush, we batch the tlbie's to avoid taking/releasing
418 * the lock all the time
419 */
338static void native_flush_hash_range(unsigned long number, int local) 420static void native_flush_hash_range(unsigned long number, int local)
339{ 421{
340 unsigned long va, vpn, hash, secondary, slot, flags, avpn; 422 unsigned long va, hash, index, hidx, shift, slot;
341 int i, j;
342 hpte_t *hptep; 423 hpte_t *hptep;
343 unsigned long hpte_v; 424 unsigned long hpte_v;
425 unsigned long want_v;
426 unsigned long flags;
427 real_pte_t pte;
344 struct ppc64_tlb_batch *batch = &__get_cpu_var(ppc64_tlb_batch); 428 struct ppc64_tlb_batch *batch = &__get_cpu_var(ppc64_tlb_batch);
345 unsigned long large = batch->large; 429 unsigned long psize = batch->psize;
430 int i;
346 431
347 local_irq_save(flags); 432 local_irq_save(flags);
348 433
349 j = 0;
350 for (i = 0; i < number; i++) { 434 for (i = 0; i < number; i++) {
351 va = batch->vaddr[j]; 435 va = batch->vaddr[i];
352 if (large) 436 pte = batch->pte[i];
353 vpn = va >> HPAGE_SHIFT; 437
354 else 438 pte_iterate_hashed_subpages(pte, psize, va, index, shift) {
355 vpn = va >> PAGE_SHIFT; 439 hash = hpt_hash(va, shift);
356 hash = hpt_hash(vpn, large); 440 hidx = __rpte_to_hidx(pte, index);
357 secondary = (pte_val(batch->pte[i]) & _PAGE_SECONDARY) >> 15; 441 if (hidx & _PTEIDX_SECONDARY)
358 if (secondary) 442 hash = ~hash;
359 hash = ~hash; 443 slot = (hash & htab_hash_mask) * HPTES_PER_GROUP;
360 slot = (hash & htab_hash_mask) * HPTES_PER_GROUP; 444 slot += hidx & _PTEIDX_GROUP_IX;
361 slot += (pte_val(batch->pte[i]) & _PAGE_GROUP_IX) >> 12; 445 hptep = htab_address + slot;
362 446 want_v = hpte_encode_v(va, psize);
363 hptep = htab_address + slot; 447 native_lock_hpte(hptep);
364 448 hpte_v = hptep->v;
365 avpn = va >> 23; 449 if (!HPTE_V_COMPARE(hpte_v, want_v) ||
366 if (large) 450 !(hpte_v & HPTE_V_VALID))
367 avpn &= ~0x1UL; 451 native_unlock_hpte(hptep);
368 452 else
369 native_lock_hpte(hptep); 453 hptep->v = 0;
370 454 } pte_iterate_hashed_end();
371 hpte_v = hptep->v;
372
373 /* Even if we miss, we need to invalidate the TLB */
374 if ((HPTE_V_AVPN_VAL(hpte_v) != avpn)
375 || !(hpte_v & HPTE_V_VALID)) {
376 native_unlock_hpte(hptep);
377 } else {
378 /* Invalidate the hpte. NOTE: this also unlocks it */
379 hptep->v = 0;
380 }
381
382 j++;
383 } 455 }
384 456
385 if (cpu_has_feature(CPU_FTR_TLBIEL) && !large && local) { 457 if (cpu_has_feature(CPU_FTR_TLBIEL) &&
458 mmu_psize_defs[psize].tlbiel && local) {
386 asm volatile("ptesync":::"memory"); 459 asm volatile("ptesync":::"memory");
387 460 for (i = 0; i < number; i++) {
388 for (i = 0; i < j; i++) 461 va = batch->vaddr[i];
389 __tlbiel(batch->vaddr[i]); 462 pte = batch->pte[i];
390 463
464 pte_iterate_hashed_subpages(pte, psize, va, index,
465 shift) {
466 __tlbiel(va, psize);
467 } pte_iterate_hashed_end();
468 }
391 asm volatile("ptesync":::"memory"); 469 asm volatile("ptesync":::"memory");
392 } else { 470 } else {
393 int lock_tlbie = !cpu_has_feature(CPU_FTR_LOCKLESS_TLBIE); 471 int lock_tlbie = !cpu_has_feature(CPU_FTR_LOCKLESS_TLBIE);
@@ -396,10 +474,15 @@ static void native_flush_hash_range(unsigned long number, int local)
396 spin_lock(&native_tlbie_lock); 474 spin_lock(&native_tlbie_lock);
397 475
398 asm volatile("ptesync":::"memory"); 476 asm volatile("ptesync":::"memory");
399 477 for (i = 0; i < number; i++) {
400 for (i = 0; i < j; i++) 478 va = batch->vaddr[i];
401 __tlbie(batch->vaddr[i], large); 479 pte = batch->pte[i];
402 480
481 pte_iterate_hashed_subpages(pte, psize, va, index,
482 shift) {
483 __tlbie(va, psize);
484 } pte_iterate_hashed_end();
485 }
403 asm volatile("eieio; tlbsync; ptesync":::"memory"); 486 asm volatile("eieio; tlbsync; ptesync":::"memory");
404 487
405 if (lock_tlbie) 488 if (lock_tlbie)
diff --git a/arch/powerpc/mm/hash_utils_64.c b/arch/powerpc/mm/hash_utils_64.c
index 6e9e05cce02c..22e474876133 100644
--- a/arch/powerpc/mm/hash_utils_64.c
+++ b/arch/powerpc/mm/hash_utils_64.c
@@ -19,6 +19,7 @@
19 */ 19 */
20 20
21#undef DEBUG 21#undef DEBUG
22#undef DEBUG_LOW
22 23
23#include <linux/config.h> 24#include <linux/config.h>
24#include <linux/spinlock.h> 25#include <linux/spinlock.h>
@@ -32,7 +33,6 @@
32#include <linux/init.h> 33#include <linux/init.h>
33#include <linux/signal.h> 34#include <linux/signal.h>
34 35
35#include <asm/ppcdebug.h>
36#include <asm/processor.h> 36#include <asm/processor.h>
37#include <asm/pgtable.h> 37#include <asm/pgtable.h>
38#include <asm/mmu.h> 38#include <asm/mmu.h>
@@ -59,6 +59,15 @@
59#define DBG(fmt...) 59#define DBG(fmt...)
60#endif 60#endif
61 61
62#ifdef DEBUG_LOW
63#define DBG_LOW(fmt...) udbg_printf(fmt)
64#else
65#define DBG_LOW(fmt...)
66#endif
67
68#define KB (1024)
69#define MB (1024*KB)
70
62/* 71/*
63 * Note: pte --> Linux PTE 72 * Note: pte --> Linux PTE
64 * HPTE --> PowerPC Hashed Page Table Entry 73 * HPTE --> PowerPC Hashed Page Table Entry
@@ -77,91 +86,292 @@ extern unsigned long dart_tablebase;
77 86
78hpte_t *htab_address; 87hpte_t *htab_address;
79unsigned long htab_hash_mask; 88unsigned long htab_hash_mask;
80
81unsigned long _SDR1; 89unsigned long _SDR1;
90struct mmu_psize_def mmu_psize_defs[MMU_PAGE_COUNT];
91int mmu_linear_psize = MMU_PAGE_4K;
92int mmu_virtual_psize = MMU_PAGE_4K;
93#ifdef CONFIG_HUGETLB_PAGE
94int mmu_huge_psize = MMU_PAGE_16M;
95unsigned int HPAGE_SHIFT;
96#endif
82 97
83#define KB (1024) 98/* There are definitions of page sizes arrays to be used when none
84#define MB (1024*KB) 99 * is provided by the firmware.
85 100 */
86static inline void loop_forever(void)
87{
88 volatile unsigned long x = 1;
89 for(;x;x|=1)
90 ;
91}
92 101
93static inline void create_pte_mapping(unsigned long start, unsigned long end, 102/* Pre-POWER4 CPUs (4k pages only)
94 unsigned long mode, int large) 103 */
104struct mmu_psize_def mmu_psize_defaults_old[] = {
105 [MMU_PAGE_4K] = {
106 .shift = 12,
107 .sllp = 0,
108 .penc = 0,
109 .avpnm = 0,
110 .tlbiel = 0,
111 },
112};
113
114/* POWER4, GPUL, POWER5
115 *
116 * Support for 16Mb large pages
117 */
118struct mmu_psize_def mmu_psize_defaults_gp[] = {
119 [MMU_PAGE_4K] = {
120 .shift = 12,
121 .sllp = 0,
122 .penc = 0,
123 .avpnm = 0,
124 .tlbiel = 1,
125 },
126 [MMU_PAGE_16M] = {
127 .shift = 24,
128 .sllp = SLB_VSID_L,
129 .penc = 0,
130 .avpnm = 0x1UL,
131 .tlbiel = 0,
132 },
133};
134
135
136int htab_bolt_mapping(unsigned long vstart, unsigned long vend,
137 unsigned long pstart, unsigned long mode, int psize)
95{ 138{
96 unsigned long addr; 139 unsigned long vaddr, paddr;
97 unsigned int step; 140 unsigned int step, shift;
98 unsigned long tmp_mode; 141 unsigned long tmp_mode;
99 unsigned long vflags; 142 int ret = 0;
100 143
101 if (large) { 144 shift = mmu_psize_defs[psize].shift;
102 step = 16*MB; 145 step = 1 << shift;
103 vflags = HPTE_V_BOLTED | HPTE_V_LARGE;
104 } else {
105 step = 4*KB;
106 vflags = HPTE_V_BOLTED;
107 }
108 146
109 for (addr = start; addr < end; addr += step) { 147 for (vaddr = vstart, paddr = pstart; vaddr < vend;
148 vaddr += step, paddr += step) {
110 unsigned long vpn, hash, hpteg; 149 unsigned long vpn, hash, hpteg;
111 unsigned long vsid = get_kernel_vsid(addr); 150 unsigned long vsid = get_kernel_vsid(vaddr);
112 unsigned long va = (vsid << 28) | (addr & 0xfffffff); 151 unsigned long va = (vsid << 28) | (vaddr & 0x0fffffff);
113 int ret = -1;
114
115 if (large)
116 vpn = va >> HPAGE_SHIFT;
117 else
118 vpn = va >> PAGE_SHIFT;
119
120 152
153 vpn = va >> shift;
121 tmp_mode = mode; 154 tmp_mode = mode;
122 155
123 /* Make non-kernel text non-executable */ 156 /* Make non-kernel text non-executable */
124 if (!in_kernel_text(addr)) 157 if (!in_kernel_text(vaddr))
125 tmp_mode = mode | HW_NO_EXEC; 158 tmp_mode = mode | HPTE_R_N;
126
127 hash = hpt_hash(vpn, large);
128 159
160 hash = hpt_hash(va, shift);
129 hpteg = ((hash & htab_hash_mask) * HPTES_PER_GROUP); 161 hpteg = ((hash & htab_hash_mask) * HPTES_PER_GROUP);
130 162
163 /* The crap below can be cleaned once ppd_md.probe() can
164 * set up the hash callbacks, thus we can just used the
165 * normal insert callback here.
166 */
131#ifdef CONFIG_PPC_ISERIES 167#ifdef CONFIG_PPC_ISERIES
132 if (systemcfg->platform & PLATFORM_ISERIES_LPAR) 168 if (systemcfg->platform == PLATFORM_ISERIES_LPAR)
133 ret = iSeries_hpte_bolt_or_insert(hpteg, va, 169 ret = iSeries_hpte_insert(hpteg, va,
134 virt_to_abs(addr) >> PAGE_SHIFT, 170 virt_to_abs(paddr),
135 vflags, tmp_mode); 171 tmp_mode,
172 HPTE_V_BOLTED,
173 psize);
136 else 174 else
137#endif 175#endif
138#ifdef CONFIG_PPC_PSERIES 176#ifdef CONFIG_PPC_PSERIES
139 if (systemcfg->platform & PLATFORM_LPAR) 177 if (systemcfg->platform & PLATFORM_LPAR)
140 ret = pSeries_lpar_hpte_insert(hpteg, va, 178 ret = pSeries_lpar_hpte_insert(hpteg, va,
141 virt_to_abs(addr) >> PAGE_SHIFT, 179 virt_to_abs(paddr),
142 vflags, tmp_mode); 180 tmp_mode,
181 HPTE_V_BOLTED,
182 psize);
143 else 183 else
144#endif 184#endif
145#ifdef CONFIG_PPC_MULTIPLATFORM 185#ifdef CONFIG_PPC_MULTIPLATFORM
146 ret = native_hpte_insert(hpteg, va, 186 ret = native_hpte_insert(hpteg, va,
147 virt_to_abs(addr) >> PAGE_SHIFT, 187 virt_to_abs(paddr),
148 vflags, tmp_mode); 188 tmp_mode, HPTE_V_BOLTED,
189 psize);
149#endif 190#endif
191 if (ret < 0)
192 break;
193 }
194 return ret < 0 ? ret : 0;
195}
150 196
151 if (ret == -1) { 197static int __init htab_dt_scan_page_sizes(unsigned long node,
152 ppc64_terminate_msg(0x20, "create_pte_mapping"); 198 const char *uname, int depth,
153 loop_forever(); 199 void *data)
200{
201 char *type = of_get_flat_dt_prop(node, "device_type", NULL);
202 u32 *prop;
203 unsigned long size = 0;
204
205 /* We are scanning "cpu" nodes only */
206 if (type == NULL || strcmp(type, "cpu") != 0)
207 return 0;
208
209 prop = (u32 *)of_get_flat_dt_prop(node,
210 "ibm,segment-page-sizes", &size);
211 if (prop != NULL) {
212 DBG("Page sizes from device-tree:\n");
213 size /= 4;
214 cur_cpu_spec->cpu_features &= ~(CPU_FTR_16M_PAGE);
215 while(size > 0) {
216 unsigned int shift = prop[0];
217 unsigned int slbenc = prop[1];
218 unsigned int lpnum = prop[2];
219 unsigned int lpenc = 0;
220 struct mmu_psize_def *def;
221 int idx = -1;
222
223 size -= 3; prop += 3;
224 while(size > 0 && lpnum) {
225 if (prop[0] == shift)
226 lpenc = prop[1];
227 prop += 2; size -= 2;
228 lpnum--;
229 }
230 switch(shift) {
231 case 0xc:
232 idx = MMU_PAGE_4K;
233 break;
234 case 0x10:
235 idx = MMU_PAGE_64K;
236 break;
237 case 0x14:
238 idx = MMU_PAGE_1M;
239 break;
240 case 0x18:
241 idx = MMU_PAGE_16M;
242 cur_cpu_spec->cpu_features |= CPU_FTR_16M_PAGE;
243 break;
244 case 0x22:
245 idx = MMU_PAGE_16G;
246 break;
247 }
248 if (idx < 0)
249 continue;
250 def = &mmu_psize_defs[idx];
251 def->shift = shift;
252 if (shift <= 23)
253 def->avpnm = 0;
254 else
255 def->avpnm = (1 << (shift - 23)) - 1;
256 def->sllp = slbenc;
257 def->penc = lpenc;
258 /* We don't know for sure what's up with tlbiel, so
259 * for now we only set it for 4K and 64K pages
260 */
261 if (idx == MMU_PAGE_4K || idx == MMU_PAGE_64K)
262 def->tlbiel = 1;
263 else
264 def->tlbiel = 0;
265
266 DBG(" %d: shift=%02x, sllp=%04x, avpnm=%08x, "
267 "tlbiel=%d, penc=%d\n",
268 idx, shift, def->sllp, def->avpnm, def->tlbiel,
269 def->penc);
154 } 270 }
271 return 1;
272 }
273 return 0;
274}
275
276
277static void __init htab_init_page_sizes(void)
278{
279 int rc;
280
281 /* Default to 4K pages only */
282 memcpy(mmu_psize_defs, mmu_psize_defaults_old,
283 sizeof(mmu_psize_defaults_old));
284
285 /*
286 * Try to find the available page sizes in the device-tree
287 */
288 rc = of_scan_flat_dt(htab_dt_scan_page_sizes, NULL);
289 if (rc != 0) /* Found */
290 goto found;
291
292 /*
293 * Not in the device-tree, let's fallback on known size
294 * list for 16M capable GP & GR
295 */
296 if ((systemcfg->platform != PLATFORM_ISERIES_LPAR) &&
297 cpu_has_feature(CPU_FTR_16M_PAGE))
298 memcpy(mmu_psize_defs, mmu_psize_defaults_gp,
299 sizeof(mmu_psize_defaults_gp));
300 found:
301 /*
302 * Pick a size for the linear mapping. Currently, we only support
303 * 16M, 1M and 4K which is the default
304 */
305 if (mmu_psize_defs[MMU_PAGE_16M].shift)
306 mmu_linear_psize = MMU_PAGE_16M;
307 else if (mmu_psize_defs[MMU_PAGE_1M].shift)
308 mmu_linear_psize = MMU_PAGE_1M;
309
310 /*
311 * Pick a size for the ordinary pages. Default is 4K, we support
312 * 64K if cache inhibited large pages are supported by the
313 * processor
314 */
315#ifdef CONFIG_PPC_64K_PAGES
316 if (mmu_psize_defs[MMU_PAGE_64K].shift &&
317 cpu_has_feature(CPU_FTR_CI_LARGE_PAGE))
318 mmu_virtual_psize = MMU_PAGE_64K;
319#endif
320
321 printk(KERN_INFO "Page orders: linear mapping = %d, others = %d\n",
322 mmu_psize_defs[mmu_linear_psize].shift,
323 mmu_psize_defs[mmu_virtual_psize].shift);
324
325#ifdef CONFIG_HUGETLB_PAGE
326 /* Init large page size. Currently, we pick 16M or 1M depending
327 * on what is available
328 */
329 if (mmu_psize_defs[MMU_PAGE_16M].shift)
330 mmu_huge_psize = MMU_PAGE_16M;
331 /* With 4k/4level pagetables, we can't (for now) cope with a
332 * huge page size < PMD_SIZE */
333 else if (mmu_psize_defs[MMU_PAGE_1M].shift)
334 mmu_huge_psize = MMU_PAGE_1M;
335
336 /* Calculate HPAGE_SHIFT and sanity check it */
337 if (mmu_psize_defs[mmu_huge_psize].shift > MIN_HUGEPTE_SHIFT &&
338 mmu_psize_defs[mmu_huge_psize].shift < SID_SHIFT)
339 HPAGE_SHIFT = mmu_psize_defs[mmu_huge_psize].shift;
340 else
341 HPAGE_SHIFT = 0; /* No huge pages dude ! */
342#endif /* CONFIG_HUGETLB_PAGE */
343}
344
345static int __init htab_dt_scan_pftsize(unsigned long node,
346 const char *uname, int depth,
347 void *data)
348{
349 char *type = of_get_flat_dt_prop(node, "device_type", NULL);
350 u32 *prop;
351
352 /* We are scanning "cpu" nodes only */
353 if (type == NULL || strcmp(type, "cpu") != 0)
354 return 0;
355
356 prop = (u32 *)of_get_flat_dt_prop(node, "ibm,pft-size", NULL);
357 if (prop != NULL) {
358 /* pft_size[0] is the NUMA CEC cookie */
359 ppc64_pft_size = prop[1];
360 return 1;
155 } 361 }
362 return 0;
156} 363}
157 364
158static unsigned long get_hashtable_size(void) 365static unsigned long __init htab_get_table_size(void)
159{ 366{
160 unsigned long rnd_mem_size, pteg_count; 367 unsigned long rnd_mem_size, pteg_count;
161 368
162 /* If hash size wasn't obtained in prom.c, we calculate it now based on 369 /* If hash size isn't already provided by the platform, we try to
163 * the total RAM size 370 * retreive it from the device-tree. If it's not there neither, we
371 * calculate it now based on the total RAM size
164 */ 372 */
373 if (ppc64_pft_size == 0)
374 of_scan_flat_dt(htab_dt_scan_pftsize, NULL);
165 if (ppc64_pft_size) 375 if (ppc64_pft_size)
166 return 1UL << ppc64_pft_size; 376 return 1UL << ppc64_pft_size;
167 377
@@ -181,25 +391,23 @@ void __init htab_initialize(void)
181 unsigned long table, htab_size_bytes; 391 unsigned long table, htab_size_bytes;
182 unsigned long pteg_count; 392 unsigned long pteg_count;
183 unsigned long mode_rw; 393 unsigned long mode_rw;
184 int i, use_largepages = 0;
185 unsigned long base = 0, size = 0; 394 unsigned long base = 0, size = 0;
395 int i;
396
186 extern unsigned long tce_alloc_start, tce_alloc_end; 397 extern unsigned long tce_alloc_start, tce_alloc_end;
187 398
188 DBG(" -> htab_initialize()\n"); 399 DBG(" -> htab_initialize()\n");
189 400
401 /* Initialize page sizes */
402 htab_init_page_sizes();
403
190 /* 404 /*
191 * Calculate the required size of the htab. We want the number of 405 * Calculate the required size of the htab. We want the number of
192 * PTEGs to equal one half the number of real pages. 406 * PTEGs to equal one half the number of real pages.
193 */ 407 */
194 htab_size_bytes = get_hashtable_size(); 408 htab_size_bytes = htab_get_table_size();
195 pteg_count = htab_size_bytes >> 7; 409 pteg_count = htab_size_bytes >> 7;
196 410
197 /* For debug, make the HTAB 1/8 as big as it normally would be. */
198 ifppcdebug(PPCDBG_HTABSIZE) {
199 pteg_count >>= 3;
200 htab_size_bytes = pteg_count << 7;
201 }
202
203 htab_hash_mask = pteg_count - 1; 411 htab_hash_mask = pteg_count - 1;
204 412
205 if (systemcfg->platform & PLATFORM_LPAR) { 413 if (systemcfg->platform & PLATFORM_LPAR) {
@@ -211,14 +419,11 @@ void __init htab_initialize(void)
211 * the absolute address space. 419 * the absolute address space.
212 */ 420 */
213 table = lmb_alloc(htab_size_bytes, htab_size_bytes); 421 table = lmb_alloc(htab_size_bytes, htab_size_bytes);
422 BUG_ON(table == 0);
214 423
215 DBG("Hash table allocated at %lx, size: %lx\n", table, 424 DBG("Hash table allocated at %lx, size: %lx\n", table,
216 htab_size_bytes); 425 htab_size_bytes);
217 426
218 if ( !table ) {
219 ppc64_terminate_msg(0x20, "hpt space");
220 loop_forever();
221 }
222 htab_address = abs_to_virt(table); 427 htab_address = abs_to_virt(table);
223 428
224 /* htab absolute addr + encoded htabsize */ 429 /* htab absolute addr + encoded htabsize */
@@ -234,8 +439,6 @@ void __init htab_initialize(void)
234 * _NOT_ map it to avoid cache paradoxes as it's remapped non 439 * _NOT_ map it to avoid cache paradoxes as it's remapped non
235 * cacheable later on 440 * cacheable later on
236 */ 441 */
237 if (cpu_has_feature(CPU_FTR_16M_PAGE))
238 use_largepages = 1;
239 442
240 /* create bolted the linear mapping in the hash table */ 443 /* create bolted the linear mapping in the hash table */
241 for (i=0; i < lmb.memory.cnt; i++) { 444 for (i=0; i < lmb.memory.cnt; i++) {
@@ -246,27 +449,32 @@ void __init htab_initialize(void)
246 449
247#ifdef CONFIG_U3_DART 450#ifdef CONFIG_U3_DART
248 /* Do not map the DART space. Fortunately, it will be aligned 451 /* Do not map the DART space. Fortunately, it will be aligned
249 * in such a way that it will not cross two lmb regions and will 452 * in such a way that it will not cross two lmb regions and
250 * fit within a single 16Mb page. 453 * will fit within a single 16Mb page.
251 * The DART space is assumed to be a full 16Mb region even if we 454 * The DART space is assumed to be a full 16Mb region even if
252 * only use 2Mb of that space. We will use more of it later for 455 * we only use 2Mb of that space. We will use more of it later
253 * AGP GART. We have to use a full 16Mb large page. 456 * for AGP GART. We have to use a full 16Mb large page.
254 */ 457 */
255 DBG("DART base: %lx\n", dart_tablebase); 458 DBG("DART base: %lx\n", dart_tablebase);
256 459
257 if (dart_tablebase != 0 && dart_tablebase >= base 460 if (dart_tablebase != 0 && dart_tablebase >= base
258 && dart_tablebase < (base + size)) { 461 && dart_tablebase < (base + size)) {
259 if (base != dart_tablebase) 462 if (base != dart_tablebase)
260 create_pte_mapping(base, dart_tablebase, mode_rw, 463 BUG_ON(htab_bolt_mapping(base, dart_tablebase,
261 use_largepages); 464 base, mode_rw,
465 mmu_linear_psize));
262 if ((base + size) > (dart_tablebase + 16*MB)) 466 if ((base + size) > (dart_tablebase + 16*MB))
263 create_pte_mapping(dart_tablebase + 16*MB, base + size, 467 BUG_ON(htab_bolt_mapping(dart_tablebase+16*MB,
264 mode_rw, use_largepages); 468 base + size,
469 dart_tablebase+16*MB,
470 mode_rw,
471 mmu_linear_psize));
265 continue; 472 continue;
266 } 473 }
267#endif /* CONFIG_U3_DART */ 474#endif /* CONFIG_U3_DART */
268 create_pte_mapping(base, base + size, mode_rw, use_largepages); 475 BUG_ON(htab_bolt_mapping(base, base + size, base,
269 } 476 mode_rw, mmu_linear_psize));
477 }
270 478
271 /* 479 /*
272 * If we have a memory_limit and we've allocated TCEs then we need to 480 * If we have a memory_limit and we've allocated TCEs then we need to
@@ -282,8 +490,9 @@ void __init htab_initialize(void)
282 if (base + size >= tce_alloc_start) 490 if (base + size >= tce_alloc_start)
283 tce_alloc_start = base + size + 1; 491 tce_alloc_start = base + size + 1;
284 492
285 create_pte_mapping(tce_alloc_start, tce_alloc_end, 493 BUG_ON(htab_bolt_mapping(tce_alloc_start, tce_alloc_end,
286 mode_rw, use_largepages); 494 tce_alloc_start, mode_rw,
495 mmu_linear_psize));
287 } 496 }
288 497
289 DBG(" <- htab_initialize()\n"); 498 DBG(" <- htab_initialize()\n");
@@ -309,7 +518,7 @@ unsigned int hash_page_do_lazy_icache(unsigned int pp, pte_t pte, int trap)
309 __flush_dcache_icache(page_address(page)); 518 __flush_dcache_icache(page_address(page));
310 set_bit(PG_arch_1, &page->flags); 519 set_bit(PG_arch_1, &page->flags);
311 } else 520 } else
312 pp |= HW_NO_EXEC; 521 pp |= HPTE_R_N;
313 } 522 }
314 return pp; 523 return pp;
315} 524}
@@ -325,94 +534,169 @@ int hash_page(unsigned long ea, unsigned long access, unsigned long trap)
325 unsigned long vsid; 534 unsigned long vsid;
326 struct mm_struct *mm; 535 struct mm_struct *mm;
327 pte_t *ptep; 536 pte_t *ptep;
328 int ret;
329 int user_region = 0;
330 int local = 0;
331 cpumask_t tmp; 537 cpumask_t tmp;
538 int rc, user_region = 0, local = 0;
332 539
333 if ((ea & ~REGION_MASK) >= PGTABLE_RANGE) 540 DBG_LOW("hash_page(ea=%016lx, access=%lx, trap=%lx\n",
334 return 1; 541 ea, access, trap);
542
543 if ((ea & ~REGION_MASK) >= PGTABLE_RANGE) {
544 DBG_LOW(" out of pgtable range !\n");
545 return 1;
546 }
335 547
548 /* Get region & vsid */
336 switch (REGION_ID(ea)) { 549 switch (REGION_ID(ea)) {
337 case USER_REGION_ID: 550 case USER_REGION_ID:
338 user_region = 1; 551 user_region = 1;
339 mm = current->mm; 552 mm = current->mm;
340 if (! mm) 553 if (! mm) {
554 DBG_LOW(" user region with no mm !\n");
341 return 1; 555 return 1;
342 556 }
343 vsid = get_vsid(mm->context.id, ea); 557 vsid = get_vsid(mm->context.id, ea);
344 break; 558 break;
345 case VMALLOC_REGION_ID: 559 case VMALLOC_REGION_ID:
346 mm = &init_mm; 560 mm = &init_mm;
347 vsid = get_kernel_vsid(ea); 561 vsid = get_kernel_vsid(ea);
348 break; 562 break;
349#if 0
350 case KERNEL_REGION_ID:
351 /*
352 * Should never get here - entire 0xC0... region is bolted.
353 * Send the problem up to do_page_fault
354 */
355#endif
356 default: 563 default:
357 /* Not a valid range 564 /* Not a valid range
358 * Send the problem up to do_page_fault 565 * Send the problem up to do_page_fault
359 */ 566 */
360 return 1; 567 return 1;
361 break;
362 } 568 }
569 DBG_LOW(" mm=%p, mm->pgdir=%p, vsid=%016lx\n", mm, mm->pgd, vsid);
363 570
571 /* Get pgdir */
364 pgdir = mm->pgd; 572 pgdir = mm->pgd;
365
366 if (pgdir == NULL) 573 if (pgdir == NULL)
367 return 1; 574 return 1;
368 575
576 /* Check CPU locality */
369 tmp = cpumask_of_cpu(smp_processor_id()); 577 tmp = cpumask_of_cpu(smp_processor_id());
370 if (user_region && cpus_equal(mm->cpu_vm_mask, tmp)) 578 if (user_region && cpus_equal(mm->cpu_vm_mask, tmp))
371 local = 1; 579 local = 1;
372 580
373 /* Is this a huge page ? */ 581 /* Handle hugepage regions */
374 if (unlikely(in_hugepage_area(mm->context, ea))) 582 if (unlikely(in_hugepage_area(mm->context, ea))) {
375 ret = hash_huge_page(mm, access, ea, vsid, local); 583 DBG_LOW(" -> huge page !\n");
376 else { 584 return hash_huge_page(mm, access, ea, vsid, local);
377 ptep = find_linux_pte(pgdir, ea); 585 }
378 if (ptep == NULL) 586
379 return 1; 587 /* Get PTE and page size from page tables */
380 ret = __hash_page(ea, access, vsid, ptep, trap, local); 588 ptep = find_linux_pte(pgdir, ea);
589 if (ptep == NULL || !pte_present(*ptep)) {
590 DBG_LOW(" no PTE !\n");
591 return 1;
592 }
593
594#ifndef CONFIG_PPC_64K_PAGES
595 DBG_LOW(" i-pte: %016lx\n", pte_val(*ptep));
596#else
597 DBG_LOW(" i-pte: %016lx %016lx\n", pte_val(*ptep),
598 pte_val(*(ptep + PTRS_PER_PTE)));
599#endif
600 /* Pre-check access permissions (will be re-checked atomically
601 * in __hash_page_XX but this pre-check is a fast path
602 */
603 if (access & ~pte_val(*ptep)) {
604 DBG_LOW(" no access !\n");
605 return 1;
381 } 606 }
382 607
383 return ret; 608 /* Do actual hashing */
609#ifndef CONFIG_PPC_64K_PAGES
610 rc = __hash_page_4K(ea, access, vsid, ptep, trap, local);
611#else
612 if (mmu_virtual_psize == MMU_PAGE_64K)
613 rc = __hash_page_64K(ea, access, vsid, ptep, trap, local);
614 else
615 rc = __hash_page_4K(ea, access, vsid, ptep, trap, local);
616#endif /* CONFIG_PPC_64K_PAGES */
617
618#ifndef CONFIG_PPC_64K_PAGES
619 DBG_LOW(" o-pte: %016lx\n", pte_val(*ptep));
620#else
621 DBG_LOW(" o-pte: %016lx %016lx\n", pte_val(*ptep),
622 pte_val(*(ptep + PTRS_PER_PTE)));
623#endif
624 DBG_LOW(" -> rc=%d\n", rc);
625 return rc;
384} 626}
385 627
386void flush_hash_page(unsigned long va, pte_t pte, int local) 628void hash_preload(struct mm_struct *mm, unsigned long ea,
629 unsigned long access, unsigned long trap)
387{ 630{
388 unsigned long vpn, hash, secondary, slot; 631 unsigned long vsid;
389 unsigned long huge = pte_huge(pte); 632 void *pgdir;
633 pte_t *ptep;
634 cpumask_t mask;
635 unsigned long flags;
636 int local = 0;
637
638 /* We don't want huge pages prefaulted for now
639 */
640 if (unlikely(in_hugepage_area(mm->context, ea)))
641 return;
390 642
391 if (huge) 643 DBG_LOW("hash_preload(mm=%p, mm->pgdir=%p, ea=%016lx, access=%lx,"
392 vpn = va >> HPAGE_SHIFT; 644 " trap=%lx\n", mm, mm->pgd, ea, access, trap);
645
646 /* Get PTE, VSID, access mask */
647 pgdir = mm->pgd;
648 if (pgdir == NULL)
649 return;
650 ptep = find_linux_pte(pgdir, ea);
651 if (!ptep)
652 return;
653 vsid = get_vsid(mm->context.id, ea);
654
655 /* Hash it in */
656 local_irq_save(flags);
657 mask = cpumask_of_cpu(smp_processor_id());
658 if (cpus_equal(mm->cpu_vm_mask, mask))
659 local = 1;
660#ifndef CONFIG_PPC_64K_PAGES
661 __hash_page_4K(ea, access, vsid, ptep, trap, local);
662#else
663 if (mmu_virtual_psize == MMU_PAGE_64K)
664 __hash_page_64K(ea, access, vsid, ptep, trap, local);
393 else 665 else
394 vpn = va >> PAGE_SHIFT; 666 __hash_page_4K(ea, access, vsid, ptep, trap, local);
395 hash = hpt_hash(vpn, huge); 667#endif /* CONFIG_PPC_64K_PAGES */
396 secondary = (pte_val(pte) & _PAGE_SECONDARY) >> 15; 668 local_irq_restore(flags);
397 if (secondary) 669}
398 hash = ~hash; 670
399 slot = (hash & htab_hash_mask) * HPTES_PER_GROUP; 671void flush_hash_page(unsigned long va, real_pte_t pte, int psize, int local)
400 slot += (pte_val(pte) & _PAGE_GROUP_IX) >> 12; 672{
401 673 unsigned long hash, index, shift, hidx, slot;
402 ppc_md.hpte_invalidate(slot, va, huge, local); 674
675 DBG_LOW("flush_hash_page(va=%016x)\n", va);
676 pte_iterate_hashed_subpages(pte, psize, va, index, shift) {
677 hash = hpt_hash(va, shift);
678 hidx = __rpte_to_hidx(pte, index);
679 if (hidx & _PTEIDX_SECONDARY)
680 hash = ~hash;
681 slot = (hash & htab_hash_mask) * HPTES_PER_GROUP;
682 slot += hidx & _PTEIDX_GROUP_IX;
683 DBG_LOW(" sub %d: hash=%x, hidx=%x\n", index, slot, hidx);
684 ppc_md.hpte_invalidate(slot, va, psize, local);
685 } pte_iterate_hashed_end();
403} 686}
404 687
405void flush_hash_range(unsigned long number, int local) 688void flush_hash_range(unsigned long number, int local)
406{ 689{
407 if (ppc_md.flush_hash_range) { 690 if (ppc_md.flush_hash_range)
408 ppc_md.flush_hash_range(number, local); 691 ppc_md.flush_hash_range(number, local);
409 } else { 692 else {
410 int i; 693 int i;
411 struct ppc64_tlb_batch *batch = 694 struct ppc64_tlb_batch *batch =
412 &__get_cpu_var(ppc64_tlb_batch); 695 &__get_cpu_var(ppc64_tlb_batch);
413 696
414 for (i = 0; i < number; i++) 697 for (i = 0; i < number; i++)
415 flush_hash_page(batch->vaddr[i], batch->pte[i], local); 698 flush_hash_page(batch->vaddr[i], batch->pte[i],
699 batch->psize, local);
416 } 700 }
417} 701}
418 702
@@ -452,6 +736,18 @@ void __init htab_finish_init(void)
452 extern unsigned int *htab_call_hpte_remove; 736 extern unsigned int *htab_call_hpte_remove;
453 extern unsigned int *htab_call_hpte_updatepp; 737 extern unsigned int *htab_call_hpte_updatepp;
454 738
739#ifdef CONFIG_PPC_64K_PAGES
740 extern unsigned int *ht64_call_hpte_insert1;
741 extern unsigned int *ht64_call_hpte_insert2;
742 extern unsigned int *ht64_call_hpte_remove;
743 extern unsigned int *ht64_call_hpte_updatepp;
744
745 make_bl(ht64_call_hpte_insert1, ppc_md.hpte_insert);
746 make_bl(ht64_call_hpte_insert2, ppc_md.hpte_insert);
747 make_bl(ht64_call_hpte_remove, ppc_md.hpte_remove);
748 make_bl(ht64_call_hpte_updatepp, ppc_md.hpte_updatepp);
749#endif /* CONFIG_PPC_64K_PAGES */
750
455 make_bl(htab_call_hpte_insert1, ppc_md.hpte_insert); 751 make_bl(htab_call_hpte_insert1, ppc_md.hpte_insert);
456 make_bl(htab_call_hpte_insert2, ppc_md.hpte_insert); 752 make_bl(htab_call_hpte_insert2, ppc_md.hpte_insert);
457 make_bl(htab_call_hpte_remove, ppc_md.hpte_remove); 753 make_bl(htab_call_hpte_remove, ppc_md.hpte_remove);
diff --git a/arch/powerpc/mm/hugetlbpage.c b/arch/powerpc/mm/hugetlbpage.c
index 0ea0994ed974..426c269e552e 100644
--- a/arch/powerpc/mm/hugetlbpage.c
+++ b/arch/powerpc/mm/hugetlbpage.c
@@ -47,10 +47,25 @@ pte_t *huge_pte_offset(struct mm_struct *mm, unsigned long addr)
47 pu = pud_offset(pg, addr); 47 pu = pud_offset(pg, addr);
48 if (!pud_none(*pu)) { 48 if (!pud_none(*pu)) {
49 pm = pmd_offset(pu, addr); 49 pm = pmd_offset(pu, addr);
50#ifdef CONFIG_PPC_64K_PAGES
51 /* Currently, we use the normal PTE offset within full
52 * size PTE pages, thus our huge PTEs are scattered in
53 * the PTE page and we do waste some. We may change
54 * that in the future, but the current mecanism keeps
55 * things much simpler
56 */
57 if (!pmd_none(*pm)) {
58 /* Note: pte_offset_* are all equivalent on
59 * ppc64 as we don't have HIGHMEM
60 */
61 pt = pte_offset_kernel(pm, addr);
62 return pt;
63 }
64#else /* CONFIG_PPC_64K_PAGES */
65 /* On 4k pages, we put huge PTEs in the PMD page */
50 pt = (pte_t *)pm; 66 pt = (pte_t *)pm;
51 BUG_ON(!pmd_none(*pm)
52 && !(pte_present(*pt) && pte_huge(*pt)));
53 return pt; 67 return pt;
68#endif /* CONFIG_PPC_64K_PAGES */
54 } 69 }
55 } 70 }
56 71
@@ -74,9 +89,16 @@ pte_t *huge_pte_alloc(struct mm_struct *mm, unsigned long addr)
74 if (pu) { 89 if (pu) {
75 pm = pmd_alloc(mm, pu, addr); 90 pm = pmd_alloc(mm, pu, addr);
76 if (pm) { 91 if (pm) {
92#ifdef CONFIG_PPC_64K_PAGES
93 /* See comment in huge_pte_offset. Note that if we ever
94 * want to put the page size in the PMD, we would have
95 * to open code our own pte_alloc* function in order
96 * to populate and set the size atomically
97 */
98 pt = pte_alloc_map(mm, pm, addr);
99#else /* CONFIG_PPC_64K_PAGES */
77 pt = (pte_t *)pm; 100 pt = (pte_t *)pm;
78 BUG_ON(!pmd_none(*pm) 101#endif /* CONFIG_PPC_64K_PAGES */
79 && !(pte_present(*pt) && pte_huge(*pt)));
80 return pt; 102 return pt;
81 } 103 }
82 } 104 }
@@ -84,35 +106,29 @@ pte_t *huge_pte_alloc(struct mm_struct *mm, unsigned long addr)
84 return NULL; 106 return NULL;
85} 107}
86 108
87#define HUGEPTE_BATCH_SIZE (HPAGE_SIZE / PMD_SIZE)
88
89void set_huge_pte_at(struct mm_struct *mm, unsigned long addr, 109void set_huge_pte_at(struct mm_struct *mm, unsigned long addr,
90 pte_t *ptep, pte_t pte) 110 pte_t *ptep, pte_t pte)
91{ 111{
92 int i;
93
94 if (pte_present(*ptep)) { 112 if (pte_present(*ptep)) {
95 pte_clear(mm, addr, ptep); 113 /* We open-code pte_clear because we need to pass the right
114 * argument to hpte_update (huge / !huge)
115 */
116 unsigned long old = pte_update(ptep, ~0UL);
117 if (old & _PAGE_HASHPTE)
118 hpte_update(mm, addr & HPAGE_MASK, ptep, old, 1);
96 flush_tlb_pending(); 119 flush_tlb_pending();
97 } 120 }
98 121 *ptep = __pte(pte_val(pte) & ~_PAGE_HPTEFLAGS);
99 for (i = 0; i < HUGEPTE_BATCH_SIZE; i++) {
100 *ptep = __pte(pte_val(pte) & ~_PAGE_HPTEFLAGS);
101 ptep++;
102 }
103} 122}
104 123
105pte_t huge_ptep_get_and_clear(struct mm_struct *mm, unsigned long addr, 124pte_t huge_ptep_get_and_clear(struct mm_struct *mm, unsigned long addr,
106 pte_t *ptep) 125 pte_t *ptep)
107{ 126{
108 unsigned long old = pte_update(ptep, ~0UL); 127 unsigned long old = pte_update(ptep, ~0UL);
109 int i;
110 128
111 if (old & _PAGE_HASHPTE) 129 if (old & _PAGE_HASHPTE)
112 hpte_update(mm, addr, old, 0); 130 hpte_update(mm, addr & HPAGE_MASK, ptep, old, 1);
113 131 *ptep = __pte(0);
114 for (i = 1; i < HUGEPTE_BATCH_SIZE; i++)
115 ptep[i] = __pte(0);
116 132
117 return __pte(old); 133 return __pte(old);
118} 134}
@@ -196,6 +212,12 @@ static int prepare_high_area_for_htlb(struct mm_struct *mm, unsigned long area)
196 212
197 BUG_ON(area >= NUM_HIGH_AREAS); 213 BUG_ON(area >= NUM_HIGH_AREAS);
198 214
215 /* Hack, so that each addresses is controlled by exactly one
216 * of the high or low area bitmaps, the first high area starts
217 * at 4GB, not 0 */
218 if (start == 0)
219 start = 0x100000000UL;
220
199 /* Check no VMAs are in the region */ 221 /* Check no VMAs are in the region */
200 vma = find_vma(mm, start); 222 vma = find_vma(mm, start);
201 if (vma && (vma->vm_start < end)) 223 if (vma && (vma->vm_start < end))
@@ -563,6 +585,8 @@ unsigned long hugetlb_get_unmapped_area(struct file *file, unsigned long addr,
563 int lastshift; 585 int lastshift;
564 u16 areamask, curareas; 586 u16 areamask, curareas;
565 587
588 if (HPAGE_SHIFT == 0)
589 return -EINVAL;
566 if (len & ~HPAGE_MASK) 590 if (len & ~HPAGE_MASK)
567 return -EINVAL; 591 return -EINVAL;
568 592
@@ -619,19 +643,15 @@ int hash_huge_page(struct mm_struct *mm, unsigned long access,
619 unsigned long ea, unsigned long vsid, int local) 643 unsigned long ea, unsigned long vsid, int local)
620{ 644{
621 pte_t *ptep; 645 pte_t *ptep;
622 unsigned long va, vpn; 646 unsigned long old_pte, new_pte;
623 pte_t old_pte, new_pte; 647 unsigned long va, rflags, pa;
624 unsigned long rflags, prpn;
625 long slot; 648 long slot;
626 int err = 1; 649 int err = 1;
627 650
628 spin_lock(&mm->page_table_lock);
629
630 ptep = huge_pte_offset(mm, ea); 651 ptep = huge_pte_offset(mm, ea);
631 652
632 /* Search the Linux page table for a match with va */ 653 /* Search the Linux page table for a match with va */
633 va = (vsid << 28) | (ea & 0x0fffffff); 654 va = (vsid << 28) | (ea & 0x0fffffff);
634 vpn = va >> HPAGE_SHIFT;
635 655
636 /* 656 /*
637 * If no pte found or not present, send the problem up to 657 * If no pte found or not present, send the problem up to
@@ -640,8 +660,6 @@ int hash_huge_page(struct mm_struct *mm, unsigned long access,
640 if (unlikely(!ptep || pte_none(*ptep))) 660 if (unlikely(!ptep || pte_none(*ptep)))
641 goto out; 661 goto out;
642 662
643/* BUG_ON(pte_bad(*ptep)); */
644
645 /* 663 /*
646 * Check the user's access rights to the page. If access should be 664 * Check the user's access rights to the page. If access should be
647 * prevented then send the problem up to do_page_fault. 665 * prevented then send the problem up to do_page_fault.
@@ -661,58 +679,64 @@ int hash_huge_page(struct mm_struct *mm, unsigned long access,
661 */ 679 */
662 680
663 681
664 old_pte = *ptep; 682 do {
665 new_pte = old_pte; 683 old_pte = pte_val(*ptep);
666 684 if (old_pte & _PAGE_BUSY)
667 rflags = 0x2 | (! (pte_val(new_pte) & _PAGE_RW)); 685 goto out;
686 new_pte = old_pte | _PAGE_BUSY |
687 _PAGE_ACCESSED | _PAGE_HASHPTE;
688 } while(old_pte != __cmpxchg_u64((unsigned long *)ptep,
689 old_pte, new_pte));
690
691 rflags = 0x2 | (!(new_pte & _PAGE_RW));
668 /* _PAGE_EXEC -> HW_NO_EXEC since it's inverted */ 692 /* _PAGE_EXEC -> HW_NO_EXEC since it's inverted */
669 rflags |= ((pte_val(new_pte) & _PAGE_EXEC) ? 0 : HW_NO_EXEC); 693 rflags |= ((new_pte & _PAGE_EXEC) ? 0 : HPTE_R_N);
670 694
671 /* Check if pte already has an hpte (case 2) */ 695 /* Check if pte already has an hpte (case 2) */
672 if (unlikely(pte_val(old_pte) & _PAGE_HASHPTE)) { 696 if (unlikely(old_pte & _PAGE_HASHPTE)) {
673 /* There MIGHT be an HPTE for this pte */ 697 /* There MIGHT be an HPTE for this pte */
674 unsigned long hash, slot; 698 unsigned long hash, slot;
675 699
676 hash = hpt_hash(vpn, 1); 700 hash = hpt_hash(va, HPAGE_SHIFT);
677 if (pte_val(old_pte) & _PAGE_SECONDARY) 701 if (old_pte & _PAGE_F_SECOND)
678 hash = ~hash; 702 hash = ~hash;
679 slot = (hash & htab_hash_mask) * HPTES_PER_GROUP; 703 slot = (hash & htab_hash_mask) * HPTES_PER_GROUP;
680 slot += (pte_val(old_pte) & _PAGE_GROUP_IX) >> 12; 704 slot += (old_pte & _PAGE_F_GIX) >> 12;
681 705
682 if (ppc_md.hpte_updatepp(slot, rflags, va, 1, local) == -1) 706 if (ppc_md.hpte_updatepp(slot, rflags, va, 1, local) == -1)
683 pte_val(old_pte) &= ~_PAGE_HPTEFLAGS; 707 old_pte &= ~_PAGE_HPTEFLAGS;
684 } 708 }
685 709
686 if (likely(!(pte_val(old_pte) & _PAGE_HASHPTE))) { 710 if (likely(!(old_pte & _PAGE_HASHPTE))) {
687 unsigned long hash = hpt_hash(vpn, 1); 711 unsigned long hash = hpt_hash(va, HPAGE_SHIFT);
688 unsigned long hpte_group; 712 unsigned long hpte_group;
689 713
690 prpn = pte_pfn(old_pte); 714 pa = pte_pfn(__pte(old_pte)) << PAGE_SHIFT;
691 715
692repeat: 716repeat:
693 hpte_group = ((hash & htab_hash_mask) * 717 hpte_group = ((hash & htab_hash_mask) *
694 HPTES_PER_GROUP) & ~0x7UL; 718 HPTES_PER_GROUP) & ~0x7UL;
695 719
696 /* Update the linux pte with the HPTE slot */ 720 /* clear HPTE slot informations in new PTE */
697 pte_val(new_pte) &= ~_PAGE_HPTEFLAGS; 721 new_pte = (new_pte & ~_PAGE_HPTEFLAGS) | _PAGE_HASHPTE;
698 pte_val(new_pte) |= _PAGE_HASHPTE;
699 722
700 /* Add in WIMG bits */ 723 /* Add in WIMG bits */
701 /* XXX We should store these in the pte */ 724 /* XXX We should store these in the pte */
725 /* --BenH: I think they are ... */
702 rflags |= _PAGE_COHERENT; 726 rflags |= _PAGE_COHERENT;
703 727
704 slot = ppc_md.hpte_insert(hpte_group, va, prpn, 728 /* Insert into the hash table, primary slot */
705 HPTE_V_LARGE, rflags); 729 slot = ppc_md.hpte_insert(hpte_group, va, pa, rflags, 0,
730 mmu_huge_psize);
706 731
707 /* Primary is full, try the secondary */ 732 /* Primary is full, try the secondary */
708 if (unlikely(slot == -1)) { 733 if (unlikely(slot == -1)) {
709 pte_val(new_pte) |= _PAGE_SECONDARY; 734 new_pte |= _PAGE_F_SECOND;
710 hpte_group = ((~hash & htab_hash_mask) * 735 hpte_group = ((~hash & htab_hash_mask) *
711 HPTES_PER_GROUP) & ~0x7UL; 736 HPTES_PER_GROUP) & ~0x7UL;
712 slot = ppc_md.hpte_insert(hpte_group, va, prpn, 737 slot = ppc_md.hpte_insert(hpte_group, va, pa, rflags,
713 HPTE_V_LARGE |
714 HPTE_V_SECONDARY, 738 HPTE_V_SECONDARY,
715 rflags); 739 mmu_huge_psize);
716 if (slot == -1) { 740 if (slot == -1) {
717 if (mftb() & 0x1) 741 if (mftb() & 0x1)
718 hpte_group = ((hash & htab_hash_mask) * 742 hpte_group = ((hash & htab_hash_mask) *
@@ -726,20 +750,18 @@ repeat:
726 if (unlikely(slot == -2)) 750 if (unlikely(slot == -2))
727 panic("hash_huge_page: pte_insert failed\n"); 751 panic("hash_huge_page: pte_insert failed\n");
728 752
729 pte_val(new_pte) |= (slot<<12) & _PAGE_GROUP_IX; 753 new_pte |= (slot << 12) & _PAGE_F_GIX;
730
731 /*
732 * No need to use ldarx/stdcx here because all who
733 * might be updating the pte will hold the
734 * page_table_lock
735 */
736 *ptep = new_pte;
737 } 754 }
738 755
756 /*
757 * No need to use ldarx/stdcx here because all who
758 * might be updating the pte will hold the
759 * page_table_lock
760 */
761 *ptep = __pte(new_pte & ~_PAGE_BUSY);
762
739 err = 0; 763 err = 0;
740 764
741 out: 765 out:
742 spin_unlock(&mm->page_table_lock);
743
744 return err; 766 return err;
745} 767}
diff --git a/arch/powerpc/mm/init_64.c b/arch/powerpc/mm/init_64.c
index b0fc822ec29f..ce974c83d88a 100644
--- a/arch/powerpc/mm/init_64.c
+++ b/arch/powerpc/mm/init_64.c
@@ -57,7 +57,6 @@
57#include <asm/processor.h> 57#include <asm/processor.h>
58#include <asm/mmzone.h> 58#include <asm/mmzone.h>
59#include <asm/cputable.h> 59#include <asm/cputable.h>
60#include <asm/ppcdebug.h>
61#include <asm/sections.h> 60#include <asm/sections.h>
62#include <asm/system.h> 61#include <asm/system.h>
63#include <asm/iommu.h> 62#include <asm/iommu.h>
@@ -188,12 +187,21 @@ static void zero_ctor(void *addr, kmem_cache_t *cache, unsigned long flags)
188 memset(addr, 0, kmem_cache_size(cache)); 187 memset(addr, 0, kmem_cache_size(cache));
189} 188}
190 189
190#ifdef CONFIG_PPC_64K_PAGES
191static const int pgtable_cache_size[2] = {
192 PTE_TABLE_SIZE, PGD_TABLE_SIZE
193};
194static const char *pgtable_cache_name[ARRAY_SIZE(pgtable_cache_size)] = {
195 "pte_pmd_cache", "pgd_cache",
196};
197#else
191static const int pgtable_cache_size[2] = { 198static const int pgtable_cache_size[2] = {
192 PTE_TABLE_SIZE, PMD_TABLE_SIZE 199 PTE_TABLE_SIZE, PMD_TABLE_SIZE
193}; 200};
194static const char *pgtable_cache_name[ARRAY_SIZE(pgtable_cache_size)] = { 201static const char *pgtable_cache_name[ARRAY_SIZE(pgtable_cache_size)] = {
195 "pgd_pte_cache", "pud_pmd_cache", 202 "pgd_pte_cache", "pud_pmd_cache",
196}; 203};
204#endif /* CONFIG_PPC_64K_PAGES */
197 205
198kmem_cache_t *pgtable_cache[ARRAY_SIZE(pgtable_cache_size)]; 206kmem_cache_t *pgtable_cache[ARRAY_SIZE(pgtable_cache_size)];
199 207
@@ -201,19 +209,14 @@ void pgtable_cache_init(void)
201{ 209{
202 int i; 210 int i;
203 211
204 BUILD_BUG_ON(PTE_TABLE_SIZE != pgtable_cache_size[PTE_CACHE_NUM]);
205 BUILD_BUG_ON(PMD_TABLE_SIZE != pgtable_cache_size[PMD_CACHE_NUM]);
206 BUILD_BUG_ON(PUD_TABLE_SIZE != pgtable_cache_size[PUD_CACHE_NUM]);
207 BUILD_BUG_ON(PGD_TABLE_SIZE != pgtable_cache_size[PGD_CACHE_NUM]);
208
209 for (i = 0; i < ARRAY_SIZE(pgtable_cache_size); i++) { 212 for (i = 0; i < ARRAY_SIZE(pgtable_cache_size); i++) {
210 int size = pgtable_cache_size[i]; 213 int size = pgtable_cache_size[i];
211 const char *name = pgtable_cache_name[i]; 214 const char *name = pgtable_cache_name[i];
212 215
213 pgtable_cache[i] = kmem_cache_create(name, 216 pgtable_cache[i] = kmem_cache_create(name,
214 size, size, 217 size, size,
215 SLAB_HWCACHE_ALIGN 218 SLAB_HWCACHE_ALIGN |
216 | SLAB_MUST_HWCACHE_ALIGN, 219 SLAB_MUST_HWCACHE_ALIGN,
217 zero_ctor, 220 zero_ctor,
218 NULL); 221 NULL);
219 if (! pgtable_cache[i]) 222 if (! pgtable_cache[i])
diff --git a/arch/powerpc/mm/mem.c b/arch/powerpc/mm/mem.c
index 117b00012e14..6f55efd9be95 100644
--- a/arch/powerpc/mm/mem.c
+++ b/arch/powerpc/mm/mem.c
@@ -61,6 +61,9 @@ int init_bootmem_done;
61int mem_init_done; 61int mem_init_done;
62unsigned long memory_limit; 62unsigned long memory_limit;
63 63
64extern void hash_preload(struct mm_struct *mm, unsigned long ea,
65 unsigned long access, unsigned long trap);
66
64/* 67/*
65 * This is called by /dev/mem to know if a given address has to 68 * This is called by /dev/mem to know if a given address has to
66 * be mapped non-cacheable or not 69 * be mapped non-cacheable or not
@@ -355,7 +358,7 @@ void __init mem_init(void)
355 } 358 }
356 359
357 codesize = (unsigned long)&_sdata - (unsigned long)&_stext; 360 codesize = (unsigned long)&_sdata - (unsigned long)&_stext;
358 datasize = (unsigned long)&__init_begin - (unsigned long)&_sdata; 361 datasize = (unsigned long)&_edata - (unsigned long)&_sdata;
359 initsize = (unsigned long)&__init_end - (unsigned long)&__init_begin; 362 initsize = (unsigned long)&__init_end - (unsigned long)&__init_begin;
360 bsssize = (unsigned long)&__bss_stop - (unsigned long)&__bss_start; 363 bsssize = (unsigned long)&__bss_stop - (unsigned long)&__bss_start;
361 364
@@ -493,18 +496,10 @@ EXPORT_SYMBOL(flush_icache_user_range);
493void update_mmu_cache(struct vm_area_struct *vma, unsigned long address, 496void update_mmu_cache(struct vm_area_struct *vma, unsigned long address,
494 pte_t pte) 497 pte_t pte)
495{ 498{
496 /* handle i-cache coherency */ 499#ifdef CONFIG_PPC_STD_MMU
497 unsigned long pfn = pte_pfn(pte); 500 unsigned long access = 0, trap;
498#ifdef CONFIG_PPC32
499 pmd_t *pmd;
500#else
501 unsigned long vsid;
502 void *pgdir;
503 pte_t *ptep;
504 int local = 0;
505 cpumask_t tmp;
506 unsigned long flags;
507#endif 501#endif
502 unsigned long pfn = pte_pfn(pte);
508 503
509 /* handle i-cache coherency */ 504 /* handle i-cache coherency */
510 if (!cpu_has_feature(CPU_FTR_COHERENT_ICACHE) && 505 if (!cpu_has_feature(CPU_FTR_COHERENT_ICACHE) &&
@@ -535,30 +530,21 @@ void update_mmu_cache(struct vm_area_struct *vma, unsigned long address,
535 /* We only want HPTEs for linux PTEs that have _PAGE_ACCESSED set */ 530 /* We only want HPTEs for linux PTEs that have _PAGE_ACCESSED set */
536 if (!pte_young(pte) || address >= TASK_SIZE) 531 if (!pte_young(pte) || address >= TASK_SIZE)
537 return; 532 return;
538#ifdef CONFIG_PPC32
539 if (Hash == 0)
540 return;
541 pmd = pmd_offset(pgd_offset(vma->vm_mm, address), address);
542 if (!pmd_none(*pmd))
543 add_hash_page(vma->vm_mm->context, address, pmd_val(*pmd));
544#else
545 pgdir = vma->vm_mm->pgd;
546 if (pgdir == NULL)
547 return;
548 533
549 ptep = find_linux_pte(pgdir, address); 534 /* We try to figure out if we are coming from an instruction
550 if (!ptep) 535 * access fault and pass that down to __hash_page so we avoid
536 * double-faulting on execution of fresh text. We have to test
537 * for regs NULL since init will get here first thing at boot
538 *
539 * We also avoid filling the hash if not coming from a fault
540 */
541 if (current->thread.regs == NULL)
551 return; 542 return;
552 543 trap = TRAP(current->thread.regs);
553 vsid = get_vsid(vma->vm_mm->context.id, address); 544 if (trap == 0x400)
554 545 access |= _PAGE_EXEC;
555 local_irq_save(flags); 546 else if (trap != 0x300)
556 tmp = cpumask_of_cpu(smp_processor_id()); 547 return;
557 if (cpus_equal(vma->vm_mm->cpu_vm_mask, tmp)) 548 hash_preload(vma->vm_mm, address, access, trap);
558 local = 1; 549#endif /* CONFIG_PPC_STD_MMU */
559
560 __hash_page(address, 0, vsid, ptep, 0x300, local);
561 local_irq_restore(flags);
562#endif
563#endif
564} 550}
diff --git a/arch/powerpc/mm/numa.c b/arch/powerpc/mm/numa.c
index 4035cad8d7f1..da09ba03c424 100644
--- a/arch/powerpc/mm/numa.c
+++ b/arch/powerpc/mm/numa.c
@@ -21,6 +21,7 @@
21#include <asm/machdep.h> 21#include <asm/machdep.h>
22#include <asm/abs_addr.h> 22#include <asm/abs_addr.h>
23#include <asm/system.h> 23#include <asm/system.h>
24#include <asm/smp.h>
24 25
25static int numa_enabled = 1; 26static int numa_enabled = 1;
26 27
diff --git a/arch/powerpc/mm/pgtable_64.c b/arch/powerpc/mm/pgtable_64.c
index b79a78206135..900842451bd3 100644
--- a/arch/powerpc/mm/pgtable_64.c
+++ b/arch/powerpc/mm/pgtable_64.c
@@ -59,7 +59,6 @@
59#include <asm/processor.h> 59#include <asm/processor.h>
60#include <asm/mmzone.h> 60#include <asm/mmzone.h>
61#include <asm/cputable.h> 61#include <asm/cputable.h>
62#include <asm/ppcdebug.h>
63#include <asm/sections.h> 62#include <asm/sections.h>
64#include <asm/system.h> 63#include <asm/system.h>
65#include <asm/iommu.h> 64#include <asm/iommu.h>
@@ -101,7 +100,6 @@ static int map_io_page(unsigned long ea, unsigned long pa, int flags)
101 pud_t *pudp; 100 pud_t *pudp;
102 pmd_t *pmdp; 101 pmd_t *pmdp;
103 pte_t *ptep; 102 pte_t *ptep;
104 unsigned long vsid;
105 103
106 if (mem_init_done) { 104 if (mem_init_done) {
107 pgdp = pgd_offset_k(ea); 105 pgdp = pgd_offset_k(ea);
@@ -117,28 +115,15 @@ static int map_io_page(unsigned long ea, unsigned long pa, int flags)
117 set_pte_at(&init_mm, ea, ptep, pfn_pte(pa >> PAGE_SHIFT, 115 set_pte_at(&init_mm, ea, ptep, pfn_pte(pa >> PAGE_SHIFT,
118 __pgprot(flags))); 116 __pgprot(flags)));
119 } else { 117 } else {
120 unsigned long va, vpn, hash, hpteg;
121
122 /* 118 /*
123 * If the mm subsystem is not fully up, we cannot create a 119 * If the mm subsystem is not fully up, we cannot create a
124 * linux page table entry for this mapping. Simply bolt an 120 * linux page table entry for this mapping. Simply bolt an
125 * entry in the hardware page table. 121 * entry in the hardware page table.
122 *
126 */ 123 */
127 vsid = get_kernel_vsid(ea); 124 if (htab_bolt_mapping(ea, ea + PAGE_SIZE, pa, flags,
128 va = (vsid << 28) | (ea & 0xFFFFFFF); 125 mmu_virtual_psize))
129 vpn = va >> PAGE_SHIFT; 126 panic("Can't map bolted IO mapping");
130
131 hash = hpt_hash(vpn, 0);
132
133 hpteg = ((hash & htab_hash_mask) * HPTES_PER_GROUP);
134
135 /* Panic if a pte grpup is full */
136 if (ppc_md.hpte_insert(hpteg, va, pa >> PAGE_SHIFT,
137 HPTE_V_BOLTED,
138 _PAGE_NO_CACHE|_PAGE_GUARDED|PP_RWXX)
139 == -1) {
140 panic("map_io_page: could not insert mapping");
141 }
142 } 127 }
143 return 0; 128 return 0;
144} 129}
diff --git a/arch/powerpc/mm/ppc_mmu_32.c b/arch/powerpc/mm/ppc_mmu_32.c
index cef9e83cc7e9..ed7fcfe5fd37 100644
--- a/arch/powerpc/mm/ppc_mmu_32.c
+++ b/arch/powerpc/mm/ppc_mmu_32.c
@@ -179,6 +179,21 @@ void __init setbat(int index, unsigned long virt, unsigned long phys,
179} 179}
180 180
181/* 181/*
182 * Preload a translation in the hash table
183 */
184void hash_preload(struct mm_struct *mm, unsigned long ea,
185 unsigned long access, unsigned long trap)
186{
187 pmd_t *pmd;
188
189 if (Hash == 0)
190 return;
191 pmd = pmd_offset(pgd_offset(mm, ea), ea);
192 if (!pmd_none(*pmd))
193 add_hash_page(mm->context, ea, pmd_val(*pmd));
194}
195
196/*
182 * Initialize the hash table and patch the instructions in hashtable.S. 197 * Initialize the hash table and patch the instructions in hashtable.S.
183 */ 198 */
184void __init MMU_init_hw(void) 199void __init MMU_init_hw(void)
diff --git a/arch/powerpc/mm/slb.c b/arch/powerpc/mm/slb.c
index 0473953f6a37..60e852f2f8e5 100644
--- a/arch/powerpc/mm/slb.c
+++ b/arch/powerpc/mm/slb.c
@@ -14,14 +14,32 @@
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 16
17#undef DEBUG
18
17#include <linux/config.h> 19#include <linux/config.h>
18#include <asm/pgtable.h> 20#include <asm/pgtable.h>
19#include <asm/mmu.h> 21#include <asm/mmu.h>
20#include <asm/mmu_context.h> 22#include <asm/mmu_context.h>
21#include <asm/paca.h> 23#include <asm/paca.h>
22#include <asm/cputable.h> 24#include <asm/cputable.h>
25#include <asm/cacheflush.h>
26
27#ifdef DEBUG
28#define DBG(fmt...) udbg_printf(fmt)
29#else
30#define DBG(fmt...)
31#endif
23 32
24extern void slb_allocate(unsigned long ea); 33extern void slb_allocate_realmode(unsigned long ea);
34extern void slb_allocate_user(unsigned long ea);
35
36static void slb_allocate(unsigned long ea)
37{
38 /* Currently, we do real mode for all SLBs including user, but
39 * that will change if we bring back dynamic VSIDs
40 */
41 slb_allocate_realmode(ea);
42}
25 43
26static inline unsigned long mk_esid_data(unsigned long ea, unsigned long slot) 44static inline unsigned long mk_esid_data(unsigned long ea, unsigned long slot)
27{ 45{
@@ -46,13 +64,15 @@ static void slb_flush_and_rebolt(void)
46{ 64{
47 /* If you change this make sure you change SLB_NUM_BOLTED 65 /* If you change this make sure you change SLB_NUM_BOLTED
48 * appropriately too. */ 66 * appropriately too. */
49 unsigned long ksp_flags = SLB_VSID_KERNEL; 67 unsigned long linear_llp, virtual_llp, lflags, vflags;
50 unsigned long ksp_esid_data; 68 unsigned long ksp_esid_data;
51 69
52 WARN_ON(!irqs_disabled()); 70 WARN_ON(!irqs_disabled());
53 71
54 if (cpu_has_feature(CPU_FTR_16M_PAGE)) 72 linear_llp = mmu_psize_defs[mmu_linear_psize].sllp;
55 ksp_flags |= SLB_VSID_L; 73 virtual_llp = mmu_psize_defs[mmu_virtual_psize].sllp;
74 lflags = SLB_VSID_KERNEL | linear_llp;
75 vflags = SLB_VSID_KERNEL | virtual_llp;
56 76
57 ksp_esid_data = mk_esid_data(get_paca()->kstack, 2); 77 ksp_esid_data = mk_esid_data(get_paca()->kstack, 2);
58 if ((ksp_esid_data & ESID_MASK) == KERNELBASE) 78 if ((ksp_esid_data & ESID_MASK) == KERNELBASE)
@@ -67,9 +87,9 @@ static void slb_flush_and_rebolt(void)
67 /* Slot 2 - kernel stack */ 87 /* Slot 2 - kernel stack */
68 "slbmte %2,%3\n" 88 "slbmte %2,%3\n"
69 "isync" 89 "isync"
70 :: "r"(mk_vsid_data(VMALLOCBASE, SLB_VSID_KERNEL)), 90 :: "r"(mk_vsid_data(VMALLOCBASE, vflags)),
71 "r"(mk_esid_data(VMALLOCBASE, 1)), 91 "r"(mk_esid_data(VMALLOCBASE, 1)),
72 "r"(mk_vsid_data(ksp_esid_data, ksp_flags)), 92 "r"(mk_vsid_data(ksp_esid_data, lflags)),
73 "r"(ksp_esid_data) 93 "r"(ksp_esid_data)
74 : "memory"); 94 : "memory");
75} 95}
@@ -102,6 +122,9 @@ void switch_slb(struct task_struct *tsk, struct mm_struct *mm)
102 122
103 get_paca()->slb_cache_ptr = 0; 123 get_paca()->slb_cache_ptr = 0;
104 get_paca()->context = mm->context; 124 get_paca()->context = mm->context;
125#ifdef CONFIG_PPC_64K_PAGES
126 get_paca()->pgdir = mm->pgd;
127#endif /* CONFIG_PPC_64K_PAGES */
105 128
106 /* 129 /*
107 * preload some userspace segments into the SLB. 130 * preload some userspace segments into the SLB.
@@ -131,28 +154,77 @@ void switch_slb(struct task_struct *tsk, struct mm_struct *mm)
131 slb_allocate(unmapped_base); 154 slb_allocate(unmapped_base);
132} 155}
133 156
157static inline void patch_slb_encoding(unsigned int *insn_addr,
158 unsigned int immed)
159{
160 /* Assume the instruction had a "0" immediate value, just
161 * "or" in the new value
162 */
163 *insn_addr |= immed;
164 flush_icache_range((unsigned long)insn_addr, 4+
165 (unsigned long)insn_addr);
166}
167
134void slb_initialize(void) 168void slb_initialize(void)
135{ 169{
170 unsigned long linear_llp, virtual_llp;
171 static int slb_encoding_inited;
172 extern unsigned int *slb_miss_kernel_load_linear;
173 extern unsigned int *slb_miss_kernel_load_virtual;
174 extern unsigned int *slb_miss_user_load_normal;
175#ifdef CONFIG_HUGETLB_PAGE
176 extern unsigned int *slb_miss_user_load_huge;
177 unsigned long huge_llp;
178
179 huge_llp = mmu_psize_defs[mmu_huge_psize].sllp;
180#endif
181
182 /* Prepare our SLB miss handler based on our page size */
183 linear_llp = mmu_psize_defs[mmu_linear_psize].sllp;
184 virtual_llp = mmu_psize_defs[mmu_virtual_psize].sllp;
185 if (!slb_encoding_inited) {
186 slb_encoding_inited = 1;
187 patch_slb_encoding(slb_miss_kernel_load_linear,
188 SLB_VSID_KERNEL | linear_llp);
189 patch_slb_encoding(slb_miss_kernel_load_virtual,
190 SLB_VSID_KERNEL | virtual_llp);
191 patch_slb_encoding(slb_miss_user_load_normal,
192 SLB_VSID_USER | virtual_llp);
193
194 DBG("SLB: linear LLP = %04x\n", linear_llp);
195 DBG("SLB: virtual LLP = %04x\n", virtual_llp);
196#ifdef CONFIG_HUGETLB_PAGE
197 patch_slb_encoding(slb_miss_user_load_huge,
198 SLB_VSID_USER | huge_llp);
199 DBG("SLB: huge LLP = %04x\n", huge_llp);
200#endif
201 }
202
136 /* On iSeries the bolted entries have already been set up by 203 /* On iSeries the bolted entries have already been set up by
137 * the hypervisor from the lparMap data in head.S */ 204 * the hypervisor from the lparMap data in head.S */
138#ifndef CONFIG_PPC_ISERIES 205#ifndef CONFIG_PPC_ISERIES
139 unsigned long flags = SLB_VSID_KERNEL; 206 {
207 unsigned long lflags, vflags;
140 208
141 /* Invalidate the entire SLB (even slot 0) & all the ERATS */ 209 lflags = SLB_VSID_KERNEL | linear_llp;
142 if (cpu_has_feature(CPU_FTR_16M_PAGE)) 210 vflags = SLB_VSID_KERNEL | virtual_llp;
143 flags |= SLB_VSID_L;
144 211
145 asm volatile("isync":::"memory"); 212 /* Invalidate the entire SLB (even slot 0) & all the ERATS */
146 asm volatile("slbmte %0,%0"::"r" (0) : "memory"); 213 asm volatile("isync":::"memory");
214 asm volatile("slbmte %0,%0"::"r" (0) : "memory");
147 asm volatile("isync; slbia; isync":::"memory"); 215 asm volatile("isync; slbia; isync":::"memory");
148 create_slbe(KERNELBASE, flags, 0); 216 create_slbe(KERNELBASE, lflags, 0);
149 create_slbe(VMALLOCBASE, SLB_VSID_KERNEL, 1); 217
218 /* VMALLOC space has 4K pages always for now */
219 create_slbe(VMALLOCBASE, vflags, 1);
220
150 /* We don't bolt the stack for the time being - we're in boot, 221 /* We don't bolt the stack for the time being - we're in boot,
151 * so the stack is in the bolted segment. By the time it goes 222 * so the stack is in the bolted segment. By the time it goes
152 * elsewhere, we'll call _switch() which will bolt in the new 223 * elsewhere, we'll call _switch() which will bolt in the new
153 * one. */ 224 * one. */
154 asm volatile("isync":::"memory"); 225 asm volatile("isync":::"memory");
155#endif 226 }
227#endif /* CONFIG_PPC_ISERIES */
156 228
157 get_paca()->stab_rr = SLB_NUM_BOLTED; 229 get_paca()->stab_rr = SLB_NUM_BOLTED;
158} 230}
diff --git a/arch/powerpc/mm/slb_low.S b/arch/powerpc/mm/slb_low.S
index a3a03da503bc..950ffc5848c7 100644
--- a/arch/powerpc/mm/slb_low.S
+++ b/arch/powerpc/mm/slb_low.S
@@ -18,61 +18,28 @@
18 18
19#include <linux/config.h> 19#include <linux/config.h>
20#include <asm/processor.h> 20#include <asm/processor.h>
21#include <asm/page.h>
22#include <asm/mmu.h>
23#include <asm/ppc_asm.h> 21#include <asm/ppc_asm.h>
24#include <asm/asm-offsets.h> 22#include <asm/asm-offsets.h>
25#include <asm/cputable.h> 23#include <asm/cputable.h>
24#include <asm/page.h>
25#include <asm/mmu.h>
26#include <asm/pgtable.h>
26 27
27/* void slb_allocate(unsigned long ea); 28/* void slb_allocate_realmode(unsigned long ea);
28 * 29 *
29 * Create an SLB entry for the given EA (user or kernel). 30 * Create an SLB entry for the given EA (user or kernel).
30 * r3 = faulting address, r13 = PACA 31 * r3 = faulting address, r13 = PACA
31 * r9, r10, r11 are clobbered by this function 32 * r9, r10, r11 are clobbered by this function
32 * No other registers are examined or changed. 33 * No other registers are examined or changed.
33 */ 34 */
34_GLOBAL(slb_allocate) 35_GLOBAL(slb_allocate_realmode)
35 /* 36 /* r3 = faulting address */
36 * First find a slot, round robin. Previously we tried to find
37 * a free slot first but that took too long. Unfortunately we
38 * dont have any LRU information to help us choose a slot.
39 */
40#ifdef CONFIG_PPC_ISERIES
41 /*
42 * On iSeries, the "bolted" stack segment can be cast out on
43 * shared processor switch so we need to check for a miss on
44 * it and restore it to the right slot.
45 */
46 ld r9,PACAKSAVE(r13)
47 clrrdi r9,r9,28
48 clrrdi r11,r3,28
49 li r10,SLB_NUM_BOLTED-1 /* Stack goes in last bolted slot */
50 cmpld r9,r11
51 beq 3f
52#endif /* CONFIG_PPC_ISERIES */
53
54 ld r10,PACASTABRR(r13)
55 addi r10,r10,1
56 /* use a cpu feature mask if we ever change our slb size */
57 cmpldi r10,SLB_NUM_ENTRIES
58
59 blt+ 4f
60 li r10,SLB_NUM_BOLTED
61
624:
63 std r10,PACASTABRR(r13)
643:
65 /* r3 = faulting address, r10 = entry */
66 37
67 srdi r9,r3,60 /* get region */ 38 srdi r9,r3,60 /* get region */
68 srdi r3,r3,28 /* get esid */ 39 srdi r10,r3,28 /* get esid */
69 cmpldi cr7,r9,0xc /* cmp KERNELBASE for later use */ 40 cmpldi cr7,r9,0xc /* cmp KERNELBASE for later use */
70 41
71 rldimi r10,r3,28,0 /* r10= ESID<<28 | entry */ 42 /* r3 = address, r10 = esid, cr7 = <>KERNELBASE */
72 oris r10,r10,SLB_ESID_V@h /* r10 |= SLB_ESID_V */
73
74 /* r3 = esid, r10 = esid_data, cr7 = <>KERNELBASE */
75
76 blt cr7,0f /* user or kernel? */ 43 blt cr7,0f /* user or kernel? */
77 44
78 /* kernel address: proto-VSID = ESID */ 45 /* kernel address: proto-VSID = ESID */
@@ -81,43 +48,166 @@ _GLOBAL(slb_allocate)
81 * top segment. That's ok, the scramble below will translate 48 * top segment. That's ok, the scramble below will translate
82 * it to VSID 0, which is reserved as a bad VSID - one which 49 * it to VSID 0, which is reserved as a bad VSID - one which
83 * will never have any pages in it. */ 50 * will never have any pages in it. */
84 li r11,SLB_VSID_KERNEL
85BEGIN_FTR_SECTION
86 bne cr7,9f
87 li r11,(SLB_VSID_KERNEL|SLB_VSID_L)
88END_FTR_SECTION_IFSET(CPU_FTR_16M_PAGE)
89 b 9f
90 51
910: /* user address: proto-VSID = context<<15 | ESID */ 52 /* Check if hitting the linear mapping of the vmalloc/ioremap
92 srdi. r9,r3,USER_ESID_BITS 53 * kernel space
54 */
55 bne cr7,1f
56
57 /* Linear mapping encoding bits, the "li" instruction below will
58 * be patched by the kernel at boot
59 */
60_GLOBAL(slb_miss_kernel_load_linear)
61 li r11,0
62 b slb_finish_load
63
641: /* vmalloc/ioremap mapping encoding bits, the "li" instruction below
65 * will be patched by the kernel at boot
66 */
67_GLOBAL(slb_miss_kernel_load_virtual)
68 li r11,0
69 b slb_finish_load
70
71
720: /* user address: proto-VSID = context << 15 | ESID. First check
73 * if the address is within the boundaries of the user region
74 */
75 srdi. r9,r10,USER_ESID_BITS
93 bne- 8f /* invalid ea bits set */ 76 bne- 8f /* invalid ea bits set */
94 77
78 /* Figure out if the segment contains huge pages */
95#ifdef CONFIG_HUGETLB_PAGE 79#ifdef CONFIG_HUGETLB_PAGE
96BEGIN_FTR_SECTION 80BEGIN_FTR_SECTION
81 b 1f
82END_FTR_SECTION_IFCLR(CPU_FTR_16M_PAGE)
83 cmpldi r10,16
84
85 lhz r9,PACALOWHTLBAREAS(r13)
86 mr r11,r10
87 blt 5f
88
97 lhz r9,PACAHIGHHTLBAREAS(r13) 89 lhz r9,PACAHIGHHTLBAREAS(r13)
98 srdi r11,r3,(HTLB_AREA_SHIFT-SID_SHIFT) 90 srdi r11,r10,(HTLB_AREA_SHIFT-SID_SHIFT)
99 srd r9,r9,r11 91
100 lhz r11,PACALOWHTLBAREAS(r13) 925: srd r9,r9,r11
101 srd r11,r11,r3 93 andi. r9,r9,1
102 or r9,r9,r11 94 beq 1f
103END_FTR_SECTION_IFSET(CPU_FTR_16M_PAGE) 95_GLOBAL(slb_miss_user_load_huge)
96 li r11,0
97 b 2f
981:
104#endif /* CONFIG_HUGETLB_PAGE */ 99#endif /* CONFIG_HUGETLB_PAGE */
105 100
106 li r11,SLB_VSID_USER 101_GLOBAL(slb_miss_user_load_normal)
102 li r11,0
107 103
108#ifdef CONFIG_HUGETLB_PAGE 1042:
109BEGIN_FTR_SECTION 105 ld r9,PACACONTEXTID(r13)
110 rldimi r11,r9,8,55 /* shift masked bit into SLB_VSID_L */ 106 rldimi r10,r9,USER_ESID_BITS,0
111END_FTR_SECTION_IFSET(CPU_FTR_16M_PAGE) 107 b slb_finish_load
112#endif /* CONFIG_HUGETLB_PAGE */
113 108
1098: /* invalid EA */
110 li r10,0 /* BAD_VSID */
111 li r11,SLB_VSID_USER /* flags don't much matter */
112 b slb_finish_load
113
114#ifdef __DISABLED__
115
116/* void slb_allocate_user(unsigned long ea);
117 *
118 * Create an SLB entry for the given EA (user or kernel).
119 * r3 = faulting address, r13 = PACA
120 * r9, r10, r11 are clobbered by this function
121 * No other registers are examined or changed.
122 *
123 * It is called with translation enabled in order to be able to walk the
124 * page tables. This is not currently used.
125 */
126_GLOBAL(slb_allocate_user)
127 /* r3 = faulting address */
128 srdi r10,r3,28 /* get esid */
129
130 crset 4*cr7+lt /* set "user" flag for later */
131
132 /* check if we fit in the range covered by the pagetables*/
133 srdi. r9,r3,PGTABLE_EADDR_SIZE
134 crnot 4*cr0+eq,4*cr0+eq
135 beqlr
136
137 /* now we need to get to the page tables in order to get the page
138 * size encoding from the PMD. In the future, we'll be able to deal
139 * with 1T segments too by getting the encoding from the PGD instead
140 */
141 ld r9,PACAPGDIR(r13)
142 cmpldi cr0,r9,0
143 beqlr
144 rlwinm r11,r10,8,25,28
145 ldx r9,r9,r11 /* get pgd_t */
146 cmpldi cr0,r9,0
147 beqlr
148 rlwinm r11,r10,3,17,28
149 ldx r9,r9,r11 /* get pmd_t */
150 cmpldi cr0,r9,0
151 beqlr
152
153 /* build vsid flags */
154 andi. r11,r9,SLB_VSID_LLP
155 ori r11,r11,SLB_VSID_USER
156
157 /* get context to calculate proto-VSID */
114 ld r9,PACACONTEXTID(r13) 158 ld r9,PACACONTEXTID(r13)
115 rldimi r3,r9,USER_ESID_BITS,0 159 rldimi r10,r9,USER_ESID_BITS,0
160
161 /* fall through slb_finish_load */
162
163#endif /* __DISABLED__ */
164
165
166/*
167 * Finish loading of an SLB entry and return
168 *
169 * r3 = EA, r10 = proto-VSID, r11 = flags, clobbers r9, cr7 = <>KERNELBASE
170 */
171slb_finish_load:
172 ASM_VSID_SCRAMBLE(r10,r9)
173 rldimi r11,r10,SLB_VSID_SHIFT,16 /* combine VSID and flags */
174
175 /* r3 = EA, r11 = VSID data */
176 /*
177 * Find a slot, round robin. Previously we tried to find a
178 * free slot first but that took too long. Unfortunately we
179 * dont have any LRU information to help us choose a slot.
180 */
181#ifdef CONFIG_PPC_ISERIES
182 /*
183 * On iSeries, the "bolted" stack segment can be cast out on
184 * shared processor switch so we need to check for a miss on
185 * it and restore it to the right slot.
186 */
187 ld r9,PACAKSAVE(r13)
188 clrrdi r9,r9,28
189 clrrdi r3,r3,28
190 li r10,SLB_NUM_BOLTED-1 /* Stack goes in last bolted slot */
191 cmpld r9,r3
192 beq 3f
193#endif /* CONFIG_PPC_ISERIES */
194
195 ld r10,PACASTABRR(r13)
196 addi r10,r10,1
197 /* use a cpu feature mask if we ever change our slb size */
198 cmpldi r10,SLB_NUM_ENTRIES
199
200 blt+ 4f
201 li r10,SLB_NUM_BOLTED
116 202
1179: /* r3 = protovsid, r11 = flags, r10 = esid_data, cr7 = <>KERNELBASE */ 2034:
118 ASM_VSID_SCRAMBLE(r3,r9) 204 std r10,PACASTABRR(r13)
205
2063:
207 rldimi r3,r10,0,36 /* r3= EA[0:35] | entry */
208 oris r10,r3,SLB_ESID_V@h /* r3 |= SLB_ESID_V */
119 209
120 rldimi r11,r3,SLB_VSID_SHIFT,16 /* combine VSID and flags */ 210 /* r3 = ESID data, r11 = VSID data */
121 211
122 /* 212 /*
123 * No need for an isync before or after this slbmte. The exception 213 * No need for an isync before or after this slbmte. The exception
@@ -125,7 +215,9 @@ END_FTR_SECTION_IFSET(CPU_FTR_16M_PAGE)
125 */ 215 */
126 slbmte r11,r10 216 slbmte r11,r10
127 217
128 bgelr cr7 /* we're done for kernel addresses */ 218 /* we're done for kernel addresses */
219 crclr 4*cr0+eq /* set result to "success" */
220 bgelr cr7
129 221
130 /* Update the slb cache */ 222 /* Update the slb cache */
131 lhz r3,PACASLBCACHEPTR(r13) /* offset = paca->slb_cache_ptr */ 223 lhz r3,PACASLBCACHEPTR(r13) /* offset = paca->slb_cache_ptr */
@@ -143,9 +235,6 @@ END_FTR_SECTION_IFSET(CPU_FTR_16M_PAGE)
143 li r3,SLB_CACHE_ENTRIES+1 235 li r3,SLB_CACHE_ENTRIES+1
1442: 2362:
145 sth r3,PACASLBCACHEPTR(r13) /* paca->slb_cache_ptr = offset */ 237 sth r3,PACASLBCACHEPTR(r13) /* paca->slb_cache_ptr = offset */
238 crclr 4*cr0+eq /* set result to "success" */
146 blr 239 blr
147 240
1488: /* invalid EA */
149 li r3,0 /* BAD_VSID */
150 li r11,SLB_VSID_USER /* flags don't much matter */
151 b 9b
diff --git a/arch/powerpc/mm/stab.c b/arch/powerpc/mm/stab.c
index 1b83f002bf27..fa325dbf98fc 100644
--- a/arch/powerpc/mm/stab.c
+++ b/arch/powerpc/mm/stab.c
@@ -26,7 +26,6 @@ struct stab_entry {
26 unsigned long vsid_data; 26 unsigned long vsid_data;
27}; 27};
28 28
29/* Both the segment table and SLB code uses the following cache */
30#define NR_STAB_CACHE_ENTRIES 8 29#define NR_STAB_CACHE_ENTRIES 8
31DEFINE_PER_CPU(long, stab_cache_ptr); 30DEFINE_PER_CPU(long, stab_cache_ptr);
32DEFINE_PER_CPU(long, stab_cache[NR_STAB_CACHE_ENTRIES]); 31DEFINE_PER_CPU(long, stab_cache[NR_STAB_CACHE_ENTRIES]);
@@ -186,7 +185,7 @@ void switch_stab(struct task_struct *tsk, struct mm_struct *mm)
186 /* Never flush the first entry. */ 185 /* Never flush the first entry. */
187 ste += 1; 186 ste += 1;
188 for (entry = 1; 187 for (entry = 1;
189 entry < (PAGE_SIZE / sizeof(struct stab_entry)); 188 entry < (HW_PAGE_SIZE / sizeof(struct stab_entry));
190 entry++, ste++) { 189 entry++, ste++) {
191 unsigned long ea; 190 unsigned long ea;
192 ea = ste->esid_data & ESID_MASK; 191 ea = ste->esid_data & ESID_MASK;
@@ -200,6 +199,10 @@ void switch_stab(struct task_struct *tsk, struct mm_struct *mm)
200 199
201 __get_cpu_var(stab_cache_ptr) = 0; 200 __get_cpu_var(stab_cache_ptr) = 0;
202 201
202#ifdef CONFIG_PPC_64K_PAGES
203 get_paca()->pgdir = mm->pgd;
204#endif /* CONFIG_PPC_64K_PAGES */
205
203 /* Now preload some entries for the new task */ 206 /* Now preload some entries for the new task */
204 if (test_tsk_thread_flag(tsk, TIF_32BIT)) 207 if (test_tsk_thread_flag(tsk, TIF_32BIT))
205 unmapped_base = TASK_UNMAPPED_BASE_USER32; 208 unmapped_base = TASK_UNMAPPED_BASE_USER32;
@@ -223,8 +226,6 @@ void switch_stab(struct task_struct *tsk, struct mm_struct *mm)
223 asm volatile("sync" : : : "memory"); 226 asm volatile("sync" : : : "memory");
224} 227}
225 228
226extern void slb_initialize(void);
227
228/* 229/*
229 * Allocate segment tables for secondary CPUs. These must all go in 230 * 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 * the first (bolted) segment, so that do_stab_bolted won't get a
@@ -243,18 +244,21 @@ void stabs_alloc(void)
243 if (cpu == 0) 244 if (cpu == 0)
244 continue; /* stab for CPU 0 is statically allocated */ 245 continue; /* stab for CPU 0 is statically allocated */
245 246
246 newstab = lmb_alloc_base(PAGE_SIZE, PAGE_SIZE, 1<<SID_SHIFT); 247 newstab = lmb_alloc_base(HW_PAGE_SIZE, HW_PAGE_SIZE,
248 1<<SID_SHIFT);
247 if (! newstab) 249 if (! newstab)
248 panic("Unable to allocate segment table for CPU %d.\n", 250 panic("Unable to allocate segment table for CPU %d.\n",
249 cpu); 251 cpu);
250 252
251 newstab += KERNELBASE; 253 newstab += KERNELBASE;
252 254
253 memset((void *)newstab, 0, PAGE_SIZE); 255 memset((void *)newstab, 0, HW_PAGE_SIZE);
254 256
255 paca[cpu].stab_addr = newstab; 257 paca[cpu].stab_addr = newstab;
256 paca[cpu].stab_real = virt_to_abs(newstab); 258 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); 259 printk(KERN_DEBUG "Segment table for CPU %d at 0x%lx "
260 "virtual, 0x%lx absolute\n",
261 cpu, paca[cpu].stab_addr, paca[cpu].stab_real);
258 } 262 }
259} 263}
260 264
@@ -267,13 +271,9 @@ void stab_initialize(unsigned long stab)
267{ 271{
268 unsigned long vsid = get_kernel_vsid(KERNELBASE); 272 unsigned long vsid = get_kernel_vsid(KERNELBASE);
269 273
270 if (cpu_has_feature(CPU_FTR_SLB)) { 274 asm volatile("isync; slbia; isync":::"memory");
271 slb_initialize(); 275 make_ste(stab, GET_ESID(KERNELBASE), vsid);
272 } else {
273 asm volatile("isync; slbia; isync":::"memory");
274 make_ste(stab, GET_ESID(KERNELBASE), vsid);
275 276
276 /* Order update */ 277 /* Order update */
277 asm volatile("sync":::"memory"); 278 asm volatile("sync":::"memory");
278 }
279} 279}
diff --git a/arch/powerpc/mm/tlb_64.c b/arch/powerpc/mm/tlb_64.c
index 09ab81a10f4f..53e31b834ace 100644
--- a/arch/powerpc/mm/tlb_64.c
+++ b/arch/powerpc/mm/tlb_64.c
@@ -21,6 +21,7 @@
21 * as published by the Free Software Foundation; either version 21 * as published by the Free Software Foundation; either version
22 * 2 of the License, or (at your option) any later version. 22 * 2 of the License, or (at your option) any later version.
23 */ 23 */
24
24#include <linux/config.h> 25#include <linux/config.h>
25#include <linux/kernel.h> 26#include <linux/kernel.h>
26#include <linux/mm.h> 27#include <linux/mm.h>
@@ -30,7 +31,7 @@
30#include <asm/pgalloc.h> 31#include <asm/pgalloc.h>
31#include <asm/tlbflush.h> 32#include <asm/tlbflush.h>
32#include <asm/tlb.h> 33#include <asm/tlb.h>
33#include <linux/highmem.h> 34#include <asm/bug.h>
34 35
35DEFINE_PER_CPU(struct ppc64_tlb_batch, ppc64_tlb_batch); 36DEFINE_PER_CPU(struct ppc64_tlb_batch, ppc64_tlb_batch);
36 37
@@ -126,28 +127,46 @@ void pgtable_free_tlb(struct mmu_gather *tlb, pgtable_free_t pgf)
126 * (if we remove it we should clear the _PTE_HPTEFLAGS bits). 127 * (if we remove it we should clear the _PTE_HPTEFLAGS bits).
127 */ 128 */
128void hpte_update(struct mm_struct *mm, unsigned long addr, 129void hpte_update(struct mm_struct *mm, unsigned long addr,
129 unsigned long pte, int wrprot) 130 pte_t *ptep, unsigned long pte, int huge)
130{ 131{
131 struct ppc64_tlb_batch *batch = &__get_cpu_var(ppc64_tlb_batch); 132 struct ppc64_tlb_batch *batch = &__get_cpu_var(ppc64_tlb_batch);
132 unsigned long vsid; 133 unsigned long vsid;
134 unsigned int psize = mmu_virtual_psize;
133 int i; 135 int i;
134 136
135 i = batch->index; 137 i = batch->index;
136 138
139 /* We mask the address for the base page size. Huge pages will
140 * have applied their own masking already
141 */
142 addr &= PAGE_MASK;
143
144 /* Get page size (maybe move back to caller) */
145 if (huge) {
146#ifdef CONFIG_HUGETLB_PAGE
147 psize = mmu_huge_psize;
148#else
149 BUG();
150#endif
151 }
152
137 /* 153 /*
138 * This can happen when we are in the middle of a TLB batch and 154 * This can happen when we are in the middle of a TLB batch and
139 * we encounter memory pressure (eg copy_page_range when it tries 155 * we encounter memory pressure (eg copy_page_range when it tries
140 * to allocate a new pte). If we have to reclaim memory and end 156 * to allocate a new pte). If we have to reclaim memory and end
141 * up scanning and resetting referenced bits then our batch context 157 * up scanning and resetting referenced bits then our batch context
142 * will change mid stream. 158 * will change mid stream.
159 *
160 * We also need to ensure only one page size is present in a given
161 * batch
143 */ 162 */
144 if (i != 0 && (mm != batch->mm || batch->large != pte_huge(pte))) { 163 if (i != 0 && (mm != batch->mm || batch->psize != psize)) {
145 flush_tlb_pending(); 164 flush_tlb_pending();
146 i = 0; 165 i = 0;
147 } 166 }
148 if (i == 0) { 167 if (i == 0) {
149 batch->mm = mm; 168 batch->mm = mm;
150 batch->large = pte_huge(pte); 169 batch->psize = psize;
151 } 170 }
152 if (addr < KERNELBASE) { 171 if (addr < KERNELBASE) {
153 vsid = get_vsid(mm->context.id, addr); 172 vsid = get_vsid(mm->context.id, addr);
@@ -155,7 +174,7 @@ void hpte_update(struct mm_struct *mm, unsigned long addr,
155 } else 174 } else
156 vsid = get_kernel_vsid(addr); 175 vsid = get_kernel_vsid(addr);
157 batch->vaddr[i] = (vsid << 28 ) | (addr & 0x0fffffff); 176 batch->vaddr[i] = (vsid << 28 ) | (addr & 0x0fffffff);
158 batch->pte[i] = __pte(pte); 177 batch->pte[i] = __real_pte(__pte(pte), ptep);
159 batch->index = ++i; 178 batch->index = ++i;
160 if (i >= PPC64_TLB_BATCH_NR) 179 if (i >= PPC64_TLB_BATCH_NR)
161 flush_tlb_pending(); 180 flush_tlb_pending();
@@ -177,7 +196,8 @@ void __flush_tlb_pending(struct ppc64_tlb_batch *batch)
177 local = 1; 196 local = 1;
178 197
179 if (i == 1) 198 if (i == 1)
180 flush_hash_page(batch->vaddr[0], batch->pte[0], local); 199 flush_hash_page(batch->vaddr[0], batch->pte[0],
200 batch->psize, local);
181 else 201 else
182 flush_hash_range(i, local); 202 flush_hash_range(i, local);
183 batch->index = 0; 203 batch->index = 0;
diff --git a/arch/powerpc/oprofile/Kconfig b/arch/powerpc/oprofile/Kconfig
index 19d37730b664..eb2dece76a54 100644
--- a/arch/powerpc/oprofile/Kconfig
+++ b/arch/powerpc/oprofile/Kconfig
@@ -1,7 +1,3 @@
1
2menu "Profiling support"
3 depends on EXPERIMENTAL
4
5config PROFILING 1config PROFILING
6 bool "Profiling support (EXPERIMENTAL)" 2 bool "Profiling support (EXPERIMENTAL)"
7 help 3 help
@@ -19,5 +15,3 @@ config OPROFILE
19 15
20 If unsure, say N. 16 If unsure, say N.
21 17
22endmenu
23
diff --git a/arch/powerpc/oprofile/op_model_power4.c b/arch/powerpc/oprofile/op_model_power4.c
index 886449315847..c4ee5478427b 100644
--- a/arch/powerpc/oprofile/op_model_power4.c
+++ b/arch/powerpc/oprofile/op_model_power4.c
@@ -17,6 +17,7 @@
17#include <asm/systemcfg.h> 17#include <asm/systemcfg.h>
18#include <asm/rtas.h> 18#include <asm/rtas.h>
19#include <asm/oprofile_impl.h> 19#include <asm/oprofile_impl.h>
20#include <asm/reg.h>
20 21
21#define dbg(args...) 22#define dbg(args...)
22 23
@@ -81,6 +82,26 @@ static void power4_reg_setup(struct op_counter_config *ctr,
81 82
82extern void ppc64_enable_pmcs(void); 83extern void ppc64_enable_pmcs(void);
83 84
85/*
86 * Older CPUs require the MMCRA sample bit to be always set, but newer
87 * CPUs only want it set for some groups. Eventually we will remove all
88 * knowledge of this bit in the kernel, oprofile userspace should be
89 * setting it when required.
90 *
91 * In order to keep current installations working we force the bit for
92 * those older CPUs. Once everyone has updated their oprofile userspace we
93 * can remove this hack.
94 */
95static inline int mmcra_must_set_sample(void)
96{
97 if (__is_processor(PV_POWER4) || __is_processor(PV_POWER4p) ||
98 __is_processor(PV_970) || __is_processor(PV_970FX) ||
99 __is_processor(PV_970MP))
100 return 1;
101
102 return 0;
103}
104
84static void power4_cpu_setup(void *unused) 105static void power4_cpu_setup(void *unused)
85{ 106{
86 unsigned int mmcr0 = mmcr0_val; 107 unsigned int mmcr0 = mmcr0_val;
@@ -98,7 +119,8 @@ static void power4_cpu_setup(void *unused)
98 119
99 mtspr(SPRN_MMCR1, mmcr1_val); 120 mtspr(SPRN_MMCR1, mmcr1_val);
100 121
101 mmcra |= MMCRA_SAMPLE_ENABLE; 122 if (mmcra_must_set_sample())
123 mmcra |= MMCRA_SAMPLE_ENABLE;
102 mtspr(SPRN_MMCRA, mmcra); 124 mtspr(SPRN_MMCRA, mmcra);
103 125
104 dbg("setup on cpu %d, mmcr0 %lx\n", smp_processor_id(), 126 dbg("setup on cpu %d, mmcr0 %lx\n", smp_processor_id(),
diff --git a/arch/powerpc/platforms/Makefile b/arch/powerpc/platforms/Makefile
index 172c0db63504..8836b3a00668 100644
--- a/arch/powerpc/platforms/Makefile
+++ b/arch/powerpc/platforms/Makefile
@@ -11,3 +11,4 @@ obj-$(CONFIG_85xx) += 85xx/
11obj-$(CONFIG_PPC_PSERIES) += pseries/ 11obj-$(CONFIG_PPC_PSERIES) += pseries/
12obj-$(CONFIG_PPC_ISERIES) += iseries/ 12obj-$(CONFIG_PPC_ISERIES) += iseries/
13obj-$(CONFIG_PPC_MAPLE) += maple/ 13obj-$(CONFIG_PPC_MAPLE) += maple/
14obj-$(CONFIG_PPC_CELL) += cell/
diff --git a/arch/powerpc/platforms/cell/Makefile b/arch/powerpc/platforms/cell/Makefile
new file mode 100644
index 000000000000..55e094b96bc0
--- /dev/null
+++ b/arch/powerpc/platforms/cell/Makefile
@@ -0,0 +1,2 @@
1obj-y += interrupt.o iommu.o setup.o spider-pic.o
2obj-$(CONFIG_SMP) += smp.o
diff --git a/arch/ppc64/kernel/bpa_iic.c b/arch/powerpc/platforms/cell/interrupt.c
index 0aaa878e19d3..7fbe78a9327d 100644
--- a/arch/ppc64/kernel/bpa_iic.c
+++ b/arch/powerpc/platforms/cell/interrupt.c
@@ -1,5 +1,5 @@
1/* 1/*
2 * BPA Internal Interrupt Controller 2 * Cell Internal Interrupt Controller
3 * 3 *
4 * (C) Copyright IBM Deutschland Entwicklung GmbH 2005 4 * (C) Copyright IBM Deutschland Entwicklung GmbH 2005
5 * 5 *
@@ -31,7 +31,7 @@
31#include <asm/prom.h> 31#include <asm/prom.h>
32#include <asm/ptrace.h> 32#include <asm/ptrace.h>
33 33
34#include "bpa_iic.h" 34#include "interrupt.h"
35 35
36struct iic_pending_bits { 36struct iic_pending_bits {
37 u32 data; 37 u32 data;
@@ -89,7 +89,7 @@ static void iic_end(unsigned int irq)
89} 89}
90 90
91static struct hw_interrupt_type iic_pic = { 91static struct hw_interrupt_type iic_pic = {
92 .typename = " BPA-IIC ", 92 .typename = " CELL-IIC ",
93 .startup = iic_startup, 93 .startup = iic_startup,
94 .enable = iic_enable, 94 .enable = iic_enable,
95 .disable = iic_disable, 95 .disable = iic_disable,
@@ -106,7 +106,7 @@ static int iic_external_get_irq(struct iic_pending_bits pending)
106 irq = -1; 106 irq = -1;
107 107
108 /* 108 /*
109 * This mapping is specific to the Broadband 109 * This mapping is specific to the Cell Broadband
110 * Engine. We might need to get the numbers 110 * Engine. We might need to get the numbers
111 * from the device tree to support future CPUs. 111 * from the device tree to support future CPUs.
112 */ 112 */
diff --git a/arch/ppc64/kernel/bpa_iic.h b/arch/powerpc/platforms/cell/interrupt.h
index 6833c3022166..37d58e6fd0c6 100644
--- a/arch/ppc64/kernel/bpa_iic.h
+++ b/arch/powerpc/platforms/cell/interrupt.h
@@ -1,5 +1,5 @@
1#ifndef ASM_BPA_IIC_H 1#ifndef ASM_CELL_PIC_H
2#define ASM_BPA_IIC_H 2#define ASM_CELL_PIC_H
3#ifdef __KERNEL__ 3#ifdef __KERNEL__
4/* 4/*
5 * Mapping of IIC pending bits into per-node 5 * Mapping of IIC pending bits into per-node
@@ -21,7 +21,7 @@
21 * + node number 21 * + node number
22 * * don't care 22 * * don't care
23 * 23 *
24 * A node consists of a Broadband Engine and an optional 24 * A node consists of a Cell Broadband Engine and an optional
25 * south bridge device providing a maximum of 64 IRQs. 25 * south bridge device providing a maximum of 64 IRQs.
26 * The south bridge may be connected to either IOIF0 26 * The south bridge may be connected to either IOIF0
27 * or IOIF1. 27 * or IOIF1.
@@ -59,4 +59,4 @@ extern void spider_init_IRQ(void);
59extern int spider_get_irq(unsigned long int_pending); 59extern int spider_get_irq(unsigned long int_pending);
60 60
61#endif 61#endif
62#endif /* ASM_BPA_IIC_H */ 62#endif /* ASM_CELL_PIC_H */
diff --git a/arch/ppc64/kernel/bpa_iommu.c b/arch/powerpc/platforms/cell/iommu.c
index da1b4b7a3269..74f999b4ac9e 100644
--- a/arch/ppc64/kernel/bpa_iommu.c
+++ b/arch/powerpc/platforms/cell/iommu.c
@@ -1,5 +1,5 @@
1/* 1/*
2 * IOMMU implementation for Broadband Processor Architecture 2 * IOMMU implementation for Cell Broadband Processor Architecture
3 * We just establish a linear mapping at boot by setting all the 3 * We just establish a linear mapping at boot by setting all the
4 * IOPT cache entries in the CPU. 4 * IOPT cache entries in the CPU.
5 * The mapping functions should be identical to pci_direct_iommu, 5 * The mapping functions should be identical to pci_direct_iommu,
@@ -41,7 +41,7 @@
41#include <asm/system.h> 41#include <asm/system.h>
42#include <asm/ppc-pci.h> 42#include <asm/ppc-pci.h>
43 43
44#include "bpa_iommu.h" 44#include "iommu.h"
45 45
46static inline unsigned long 46static inline unsigned long
47get_iopt_entry(unsigned long real_address, unsigned long ioid, 47get_iopt_entry(unsigned long real_address, unsigned long ioid,
@@ -276,7 +276,7 @@ static void iommu_dev_setup_null(struct pci_dev *d) { }
276 * for each DMA window used by any device. For now, we 276 * for each DMA window used by any device. For now, we
277 * happen to know that there is only one DMA window in use, 277 * happen to know that there is only one DMA window in use,
278 * starting at iopt_phys_offset. */ 278 * starting at iopt_phys_offset. */
279static void bpa_map_iommu(void) 279static void cell_map_iommu(void)
280{ 280{
281 unsigned long address; 281 unsigned long address;
282 void __iomem *base; 282 void __iomem *base;
@@ -309,7 +309,7 @@ static void bpa_map_iommu(void)
309} 309}
310 310
311 311
312static void *bpa_alloc_coherent(struct device *hwdev, size_t size, 312static void *cell_alloc_coherent(struct device *hwdev, size_t size,
313 dma_addr_t *dma_handle, gfp_t flag) 313 dma_addr_t *dma_handle, gfp_t flag)
314{ 314{
315 void *ret; 315 void *ret;
@@ -317,65 +317,65 @@ static void *bpa_alloc_coherent(struct device *hwdev, size_t size,
317 ret = (void *)__get_free_pages(flag, get_order(size)); 317 ret = (void *)__get_free_pages(flag, get_order(size));
318 if (ret != NULL) { 318 if (ret != NULL) {
319 memset(ret, 0, size); 319 memset(ret, 0, size);
320 *dma_handle = virt_to_abs(ret) | BPA_DMA_VALID; 320 *dma_handle = virt_to_abs(ret) | CELL_DMA_VALID;
321 } 321 }
322 return ret; 322 return ret;
323} 323}
324 324
325static void bpa_free_coherent(struct device *hwdev, size_t size, 325static void cell_free_coherent(struct device *hwdev, size_t size,
326 void *vaddr, dma_addr_t dma_handle) 326 void *vaddr, dma_addr_t dma_handle)
327{ 327{
328 free_pages((unsigned long)vaddr, get_order(size)); 328 free_pages((unsigned long)vaddr, get_order(size));
329} 329}
330 330
331static dma_addr_t bpa_map_single(struct device *hwdev, void *ptr, 331static dma_addr_t cell_map_single(struct device *hwdev, void *ptr,
332 size_t size, enum dma_data_direction direction) 332 size_t size, enum dma_data_direction direction)
333{ 333{
334 return virt_to_abs(ptr) | BPA_DMA_VALID; 334 return virt_to_abs(ptr) | CELL_DMA_VALID;
335} 335}
336 336
337static void bpa_unmap_single(struct device *hwdev, dma_addr_t dma_addr, 337static void cell_unmap_single(struct device *hwdev, dma_addr_t dma_addr,
338 size_t size, enum dma_data_direction direction) 338 size_t size, enum dma_data_direction direction)
339{ 339{
340} 340}
341 341
342static int bpa_map_sg(struct device *hwdev, struct scatterlist *sg, 342static int cell_map_sg(struct device *hwdev, struct scatterlist *sg,
343 int nents, enum dma_data_direction direction) 343 int nents, enum dma_data_direction direction)
344{ 344{
345 int i; 345 int i;
346 346
347 for (i = 0; i < nents; i++, sg++) { 347 for (i = 0; i < nents; i++, sg++) {
348 sg->dma_address = (page_to_phys(sg->page) + sg->offset) 348 sg->dma_address = (page_to_phys(sg->page) + sg->offset)
349 | BPA_DMA_VALID; 349 | CELL_DMA_VALID;
350 sg->dma_length = sg->length; 350 sg->dma_length = sg->length;
351 } 351 }
352 352
353 return nents; 353 return nents;
354} 354}
355 355
356static void bpa_unmap_sg(struct device *hwdev, struct scatterlist *sg, 356static void cell_unmap_sg(struct device *hwdev, struct scatterlist *sg,
357 int nents, enum dma_data_direction direction) 357 int nents, enum dma_data_direction direction)
358{ 358{
359} 359}
360 360
361static int bpa_dma_supported(struct device *dev, u64 mask) 361static int cell_dma_supported(struct device *dev, u64 mask)
362{ 362{
363 return mask < 0x100000000ull; 363 return mask < 0x100000000ull;
364} 364}
365 365
366void bpa_init_iommu(void) 366void cell_init_iommu(void)
367{ 367{
368 bpa_map_iommu(); 368 cell_map_iommu();
369 369
370 /* Direct I/O, IOMMU off */ 370 /* Direct I/O, IOMMU off */
371 ppc_md.iommu_dev_setup = iommu_dev_setup_null; 371 ppc_md.iommu_dev_setup = iommu_dev_setup_null;
372 ppc_md.iommu_bus_setup = iommu_bus_setup_null; 372 ppc_md.iommu_bus_setup = iommu_bus_setup_null;
373 373
374 pci_dma_ops.alloc_coherent = bpa_alloc_coherent; 374 pci_dma_ops.alloc_coherent = cell_alloc_coherent;
375 pci_dma_ops.free_coherent = bpa_free_coherent; 375 pci_dma_ops.free_coherent = cell_free_coherent;
376 pci_dma_ops.map_single = bpa_map_single; 376 pci_dma_ops.map_single = cell_map_single;
377 pci_dma_ops.unmap_single = bpa_unmap_single; 377 pci_dma_ops.unmap_single = cell_unmap_single;
378 pci_dma_ops.map_sg = bpa_map_sg; 378 pci_dma_ops.map_sg = cell_map_sg;
379 pci_dma_ops.unmap_sg = bpa_unmap_sg; 379 pci_dma_ops.unmap_sg = cell_unmap_sg;
380 pci_dma_ops.dma_supported = bpa_dma_supported; 380 pci_dma_ops.dma_supported = cell_dma_supported;
381} 381}
diff --git a/arch/ppc64/kernel/bpa_iommu.h b/arch/powerpc/platforms/cell/iommu.h
index e547d77dfa04..490d77abfe85 100644
--- a/arch/ppc64/kernel/bpa_iommu.h
+++ b/arch/powerpc/platforms/cell/iommu.h
@@ -1,5 +1,5 @@
1#ifndef BPA_IOMMU_H 1#ifndef CELL_IOMMU_H
2#define BPA_IOMMU_H 2#define CELL_IOMMU_H
3 3
4/* some constants */ 4/* some constants */
5enum { 5enum {
@@ -55,11 +55,11 @@ enum {
55 55
56 /* The high bit needs to be set on every DMA address, 56 /* The high bit needs to be set on every DMA address,
57 only 2GB are addressable */ 57 only 2GB are addressable */
58 BPA_DMA_VALID = 0x80000000, 58 CELL_DMA_VALID = 0x80000000,
59 BPA_DMA_MASK = 0x7fffffff, 59 CELL_DMA_MASK = 0x7fffffff,
60}; 60};
61 61
62 62
63void bpa_init_iommu(void); 63void cell_init_iommu(void);
64 64
65#endif 65#endif
diff --git a/arch/ppc64/kernel/bpa_setup.c b/arch/powerpc/platforms/cell/setup.c
index c2dc8f282eb8..9a495634d0c2 100644
--- a/arch/ppc64/kernel/bpa_setup.c
+++ b/arch/powerpc/platforms/cell/setup.c
@@ -1,11 +1,11 @@
1/* 1/*
2 * linux/arch/ppc/kernel/bpa_setup.c 2 * linux/arch/powerpc/platforms/cell/cell_setup.c
3 * 3 *
4 * Copyright (C) 1995 Linus Torvalds 4 * Copyright (C) 1995 Linus Torvalds
5 * Adapted from 'alpha' version by Gary Thomas 5 * Adapted from 'alpha' version by Gary Thomas
6 * Modified by Cort Dougan (cort@cs.nmt.edu) 6 * Modified by Cort Dougan (cort@cs.nmt.edu)
7 * Modified by PPC64 Team, IBM Corp 7 * Modified by PPC64 Team, IBM Corp
8 * Modified by BPA Team, IBM Deutschland Entwicklung GmbH 8 * Modified by Cell Team, IBM Deutschland Entwicklung GmbH
9 * 9 *
10 * This program is free software; you can redistribute it and/or 10 * This program is free software; you can redistribute it and/or
11 * modify it under the terms of the GNU General Public License 11 * modify it under the terms of the GNU General Public License
@@ -46,8 +46,8 @@
46#include <asm/ppc-pci.h> 46#include <asm/ppc-pci.h>
47#include <asm/irq.h> 47#include <asm/irq.h>
48 48
49#include "bpa_iic.h" 49#include "interrupt.h"
50#include "bpa_iommu.h" 50#include "iommu.h"
51 51
52#ifdef DEBUG 52#ifdef DEBUG
53#define DBG(fmt...) udbg_printf(fmt) 53#define DBG(fmt...) udbg_printf(fmt)
@@ -55,7 +55,7 @@
55#define DBG(fmt...) 55#define DBG(fmt...)
56#endif 56#endif
57 57
58void bpa_show_cpuinfo(struct seq_file *m) 58void cell_show_cpuinfo(struct seq_file *m)
59{ 59{
60 struct device_node *root; 60 struct device_node *root;
61 const char *model = ""; 61 const char *model = "";
@@ -63,22 +63,22 @@ void bpa_show_cpuinfo(struct seq_file *m)
63 root = of_find_node_by_path("/"); 63 root = of_find_node_by_path("/");
64 if (root) 64 if (root)
65 model = get_property(root, "model", NULL); 65 model = get_property(root, "model", NULL);
66 seq_printf(m, "machine\t\t: BPA %s\n", model); 66 seq_printf(m, "machine\t\t: CHRP %s\n", model);
67 of_node_put(root); 67 of_node_put(root);
68} 68}
69 69
70static void bpa_progress(char *s, unsigned short hex) 70static void cell_progress(char *s, unsigned short hex)
71{ 71{
72 printk("*** %04x : %s\n", hex, s ? s : ""); 72 printk("*** %04x : %s\n", hex, s ? s : "");
73} 73}
74 74
75static void __init bpa_setup_arch(void) 75static void __init cell_setup_arch(void)
76{ 76{
77 ppc_md.init_IRQ = iic_init_IRQ; 77 ppc_md.init_IRQ = iic_init_IRQ;
78 ppc_md.get_irq = iic_get_irq; 78 ppc_md.get_irq = iic_get_irq;
79 79
80#ifdef CONFIG_SMP 80#ifdef CONFIG_SMP
81 smp_init_pSeries(); 81 smp_init_cell();
82#endif 82#endif
83 83
84 /* init to some ~sane value until calibrate_delay() runs */ 84 /* init to some ~sane value until calibrate_delay() runs */
@@ -97,39 +97,39 @@ static void __init bpa_setup_arch(void)
97 conswitchp = &dummy_con; 97 conswitchp = &dummy_con;
98#endif 98#endif
99 99
100 bpa_nvram_init(); 100 mmio_nvram_init();
101} 101}
102 102
103/* 103/*
104 * Early initialization. Relocation is on but do not reference unbolted pages 104 * Early initialization. Relocation is on but do not reference unbolted pages
105 */ 105 */
106static void __init bpa_init_early(void) 106static void __init cell_init_early(void)
107{ 107{
108 DBG(" -> bpa_init_early()\n"); 108 DBG(" -> cell_init_early()\n");
109 109
110 hpte_init_native(); 110 hpte_init_native();
111 111
112 bpa_init_iommu(); 112 cell_init_iommu();
113 113
114 ppc64_interrupt_controller = IC_BPA_IIC; 114 ppc64_interrupt_controller = IC_CELL_PIC;
115 115
116 DBG(" <- bpa_init_early()\n"); 116 DBG(" <- cell_init_early()\n");
117} 117}
118 118
119 119
120static int __init bpa_probe(int platform) 120static int __init cell_probe(int platform)
121{ 121{
122 if (platform != PLATFORM_BPA) 122 if (platform != PLATFORM_CELL)
123 return 0; 123 return 0;
124 124
125 return 1; 125 return 1;
126} 126}
127 127
128struct machdep_calls __initdata bpa_md = { 128struct machdep_calls __initdata cell_md = {
129 .probe = bpa_probe, 129 .probe = cell_probe,
130 .setup_arch = bpa_setup_arch, 130 .setup_arch = cell_setup_arch,
131 .init_early = bpa_init_early, 131 .init_early = cell_init_early,
132 .show_cpuinfo = bpa_show_cpuinfo, 132 .show_cpuinfo = cell_show_cpuinfo,
133 .restart = rtas_restart, 133 .restart = rtas_restart,
134 .power_off = rtas_power_off, 134 .power_off = rtas_power_off,
135 .halt = rtas_halt, 135 .halt = rtas_halt,
@@ -137,5 +137,5 @@ struct machdep_calls __initdata bpa_md = {
137 .get_rtc_time = rtas_get_rtc_time, 137 .get_rtc_time = rtas_get_rtc_time,
138 .set_rtc_time = rtas_set_rtc_time, 138 .set_rtc_time = rtas_set_rtc_time,
139 .calibrate_decr = generic_calibrate_decr, 139 .calibrate_decr = generic_calibrate_decr,
140 .progress = bpa_progress, 140 .progress = cell_progress,
141}; 141};
diff --git a/arch/powerpc/platforms/cell/smp.c b/arch/powerpc/platforms/cell/smp.c
new file mode 100644
index 000000000000..de96eadf419d
--- /dev/null
+++ b/arch/powerpc/platforms/cell/smp.c
@@ -0,0 +1,230 @@
1/*
2 * SMP support for BPA machines.
3 *
4 * Dave Engebretsen, Peter Bergner, and
5 * Mike Corrigan {engebret|bergner|mikec}@us.ibm.com
6 *
7 * Plus various changes from other IBM teams...
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#undef DEBUG
16
17#include <linux/config.h>
18#include <linux/kernel.h>
19#include <linux/module.h>
20#include <linux/sched.h>
21#include <linux/smp.h>
22#include <linux/interrupt.h>
23#include <linux/delay.h>
24#include <linux/init.h>
25#include <linux/spinlock.h>
26#include <linux/cache.h>
27#include <linux/err.h>
28#include <linux/sysdev.h>
29#include <linux/cpu.h>
30
31#include <asm/ptrace.h>
32#include <asm/atomic.h>
33#include <asm/irq.h>
34#include <asm/page.h>
35#include <asm/pgtable.h>
36#include <asm/io.h>
37#include <asm/prom.h>
38#include <asm/smp.h>
39#include <asm/paca.h>
40#include <asm/time.h>
41#include <asm/machdep.h>
42#include <asm/cputable.h>
43#include <asm/firmware.h>
44#include <asm/system.h>
45#include <asm/rtas.h>
46
47#include "interrupt.h"
48
49#ifdef DEBUG
50#define DBG(fmt...) udbg_printf(fmt)
51#else
52#define DBG(fmt...)
53#endif
54
55/*
56 * The primary thread of each non-boot processor is recorded here before
57 * smp init.
58 */
59static cpumask_t of_spin_map;
60
61extern void pSeries_secondary_smp_init(unsigned long);
62
63/**
64 * smp_startup_cpu() - start the given cpu
65 *
66 * At boot time, there is nothing to do for primary threads which were
67 * started from Open Firmware. For anything else, call RTAS with the
68 * appropriate start location.
69 *
70 * Returns:
71 * 0 - failure
72 * 1 - success
73 */
74static inline int __devinit smp_startup_cpu(unsigned int lcpu)
75{
76 int status;
77 unsigned long start_here = __pa((u32)*((unsigned long *)
78 pSeries_secondary_smp_init));
79 unsigned int pcpu;
80 int start_cpu;
81
82 if (cpu_isset(lcpu, of_spin_map))
83 /* Already started by OF and sitting in spin loop */
84 return 1;
85
86 pcpu = get_hard_smp_processor_id(lcpu);
87
88 /* Fixup atomic count: it exited inside IRQ handler. */
89 paca[lcpu].__current->thread_info->preempt_count = 0;
90
91 /*
92 * If the RTAS start-cpu token does not exist then presume the
93 * cpu is already spinning.
94 */
95 start_cpu = rtas_token("start-cpu");
96 if (start_cpu == RTAS_UNKNOWN_SERVICE)
97 return 1;
98
99 status = rtas_call(start_cpu, 3, 1, NULL, pcpu, start_here, lcpu);
100 if (status != 0) {
101 printk(KERN_ERR "start-cpu failed: %i\n", status);
102 return 0;
103 }
104
105 return 1;
106}
107
108static void smp_iic_message_pass(int target, int msg)
109{
110 unsigned int i;
111
112 if (target < NR_CPUS) {
113 iic_cause_IPI(target, msg);
114 } else {
115 for_each_online_cpu(i) {
116 if (target == MSG_ALL_BUT_SELF
117 && i == smp_processor_id())
118 continue;
119 iic_cause_IPI(i, msg);
120 }
121 }
122}
123
124static int __init smp_iic_probe(void)
125{
126 iic_request_IPIs();
127
128 return cpus_weight(cpu_possible_map);
129}
130
131static void __devinit smp_iic_setup_cpu(int cpu)
132{
133 if (cpu != boot_cpuid)
134 iic_setup_cpu();
135}
136
137static DEFINE_SPINLOCK(timebase_lock);
138static unsigned long timebase = 0;
139
140static void __devinit cell_give_timebase(void)
141{
142 spin_lock(&timebase_lock);
143 rtas_call(rtas_token("freeze-time-base"), 0, 1, NULL);
144 timebase = get_tb();
145 spin_unlock(&timebase_lock);
146
147 while (timebase)
148 barrier();
149 rtas_call(rtas_token("thaw-time-base"), 0, 1, NULL);
150}
151
152static void __devinit cell_take_timebase(void)
153{
154 while (!timebase)
155 barrier();
156 spin_lock(&timebase_lock);
157 set_tb(timebase >> 32, timebase & 0xffffffff);
158 timebase = 0;
159 spin_unlock(&timebase_lock);
160}
161
162static void __devinit smp_cell_kick_cpu(int nr)
163{
164 BUG_ON(nr < 0 || nr >= NR_CPUS);
165
166 if (!smp_startup_cpu(nr))
167 return;
168
169 /*
170 * The processor is currently spinning, waiting for the
171 * cpu_start field to become non-zero After we set cpu_start,
172 * the processor will continue on to secondary_start
173 */
174 paca[nr].cpu_start = 1;
175}
176
177static int smp_cell_cpu_bootable(unsigned int nr)
178{
179 /* Special case - we inhibit secondary thread startup
180 * during boot if the user requests it. Odd-numbered
181 * cpus are assumed to be secondary threads.
182 */
183 if (system_state < SYSTEM_RUNNING &&
184 cpu_has_feature(CPU_FTR_SMT) &&
185 !smt_enabled_at_boot && nr % 2 != 0)
186 return 0;
187
188 return 1;
189}
190static struct smp_ops_t bpa_iic_smp_ops = {
191 .message_pass = smp_iic_message_pass,
192 .probe = smp_iic_probe,
193 .kick_cpu = smp_cell_kick_cpu,
194 .setup_cpu = smp_iic_setup_cpu,
195 .cpu_bootable = smp_cell_cpu_bootable,
196};
197
198/* This is called very early */
199void __init smp_init_cell(void)
200{
201 int i;
202
203 DBG(" -> smp_init_cell()\n");
204
205 smp_ops = &bpa_iic_smp_ops;
206
207 /* Mark threads which are still spinning in hold loops. */
208 if (cpu_has_feature(CPU_FTR_SMT)) {
209 for_each_present_cpu(i) {
210 if (i % 2 == 0)
211 /*
212 * Even-numbered logical cpus correspond to
213 * primary threads.
214 */
215 cpu_set(i, of_spin_map);
216 }
217 } else {
218 of_spin_map = cpu_present_map;
219 }
220
221 cpu_clear(boot_cpuid, of_spin_map);
222
223 /* Non-lpar has additional take/give timebase */
224 if (rtas_token("freeze-time-base") != RTAS_UNKNOWN_SERVICE) {
225 smp_ops->give_timebase = cell_give_timebase;
226 smp_ops->take_timebase = cell_take_timebase;
227 }
228
229 DBG(" <- smp_init_cell()\n");
230}
diff --git a/arch/ppc64/kernel/spider-pic.c b/arch/powerpc/platforms/cell/spider-pic.c
index d5c9a02fb119..e74132188bdf 100644
--- a/arch/ppc64/kernel/spider-pic.c
+++ b/arch/powerpc/platforms/cell/spider-pic.c
@@ -27,7 +27,7 @@
27#include <asm/prom.h> 27#include <asm/prom.h>
28#include <asm/io.h> 28#include <asm/io.h>
29 29
30#include "bpa_iic.h" 30#include "interrupt.h"
31 31
32/* register layout taken from Spider spec, table 7.4-4 */ 32/* register layout taken from Spider spec, table 7.4-4 */
33enum { 33enum {
diff --git a/arch/powerpc/platforms/chrp/nvram.c b/arch/powerpc/platforms/chrp/nvram.c
index 4ac7125aa09c..150f67d6f90c 100644
--- a/arch/powerpc/platforms/chrp/nvram.c
+++ b/arch/powerpc/platforms/chrp/nvram.c
@@ -17,6 +17,7 @@
17#include <asm/uaccess.h> 17#include <asm/uaccess.h>
18#include <asm/prom.h> 18#include <asm/prom.h>
19#include <asm/machdep.h> 19#include <asm/machdep.h>
20#include <asm/rtas.h>
20#include "chrp.h" 21#include "chrp.h"
21 22
22static unsigned int nvram_size; 23static unsigned int nvram_size;
@@ -25,7 +26,8 @@ static DEFINE_SPINLOCK(nvram_lock);
25 26
26static unsigned char chrp_nvram_read(int addr) 27static unsigned char chrp_nvram_read(int addr)
27{ 28{
28 unsigned long done, flags; 29 unsigned int done;
30 unsigned long flags;
29 unsigned char ret; 31 unsigned char ret;
30 32
31 if (addr >= nvram_size) { 33 if (addr >= nvram_size) {
@@ -34,7 +36,8 @@ static unsigned char chrp_nvram_read(int addr)
34 return 0xff; 36 return 0xff;
35 } 37 }
36 spin_lock_irqsave(&nvram_lock, flags); 38 spin_lock_irqsave(&nvram_lock, flags);
37 if ((call_rtas("nvram-fetch", 3, 2, &done, addr, __pa(nvram_buf), 1) != 0) || 1 != done) 39 if ((rtas_call(rtas_token("nvram-fetch"), 3, 2, &done, addr,
40 __pa(nvram_buf), 1) != 0) || 1 != done)
38 ret = 0xff; 41 ret = 0xff;
39 else 42 else
40 ret = nvram_buf[0]; 43 ret = nvram_buf[0];
@@ -45,7 +48,8 @@ static unsigned char chrp_nvram_read(int addr)
45 48
46static void chrp_nvram_write(int addr, unsigned char val) 49static void chrp_nvram_write(int addr, unsigned char val)
47{ 50{
48 unsigned long done, flags; 51 unsigned int done;
52 unsigned long flags;
49 53
50 if (addr >= nvram_size) { 54 if (addr >= nvram_size) {
51 printk(KERN_DEBUG "%s: write addr %d > nvram_size %u\n", 55 printk(KERN_DEBUG "%s: write addr %d > nvram_size %u\n",
@@ -54,7 +58,8 @@ static void chrp_nvram_write(int addr, unsigned char val)
54 } 58 }
55 spin_lock_irqsave(&nvram_lock, flags); 59 spin_lock_irqsave(&nvram_lock, flags);
56 nvram_buf[0] = val; 60 nvram_buf[0] = val;
57 if ((call_rtas("nvram-store", 3, 2, &done, addr, __pa(nvram_buf), 1) != 0) || 1 != done) 61 if ((rtas_call(rtas_token("nvram-store"), 3, 2, &done, addr,
62 __pa(nvram_buf), 1) != 0) || 1 != done)
58 printk(KERN_DEBUG "rtas IO error storing 0x%02x at %d", val, addr); 63 printk(KERN_DEBUG "rtas IO error storing 0x%02x at %d", val, addr);
59 spin_unlock_irqrestore(&nvram_lock, flags); 64 spin_unlock_irqrestore(&nvram_lock, flags);
60} 65}
diff --git a/arch/powerpc/platforms/chrp/pegasos_eth.c b/arch/powerpc/platforms/chrp/pegasos_eth.c
index a9052305c35d..29c86781c493 100644
--- a/arch/powerpc/platforms/chrp/pegasos_eth.c
+++ b/arch/powerpc/platforms/chrp/pegasos_eth.c
@@ -14,6 +14,7 @@
14#include <linux/init.h> 14#include <linux/init.h>
15#include <linux/ioport.h> 15#include <linux/ioport.h>
16#include <linux/device.h> 16#include <linux/device.h>
17#include <linux/platform_device.h>
17#include <linux/mv643xx.h> 18#include <linux/mv643xx.h>
18#include <linux/pci.h> 19#include <linux/pci.h>
19 20
diff --git a/arch/powerpc/platforms/chrp/smp.c b/arch/powerpc/platforms/chrp/smp.c
index 31ee49c25014..bb2315997d45 100644
--- a/arch/powerpc/platforms/chrp/smp.c
+++ b/arch/powerpc/platforms/chrp/smp.c
@@ -35,43 +35,6 @@
35#include <asm/smp.h> 35#include <asm/smp.h>
36#include <asm/mpic.h> 36#include <asm/mpic.h>
37 37
38extern unsigned long smp_chrp_cpu_nr;
39
40static int __init smp_chrp_probe(void)
41{
42 struct device_node *cpus = NULL;
43 unsigned int *reg;
44 int reglen;
45 int ncpus = 0;
46 int cpuid;
47 unsigned int phys;
48
49 /* Count CPUs in the device-tree */
50 cpuid = 1; /* the boot cpu is logical cpu 0 */
51 while ((cpus = of_find_node_by_type(cpus, "cpu")) != NULL) {
52 phys = ncpus;
53 reg = (unsigned int *) get_property(cpus, "reg", &reglen);
54 if (reg && reglen >= sizeof(unsigned int))
55 /* hmmm, not having a reg property would be bad */
56 phys = *reg;
57 if (phys != boot_cpuid_phys) {
58 set_hard_smp_processor_id(cpuid, phys);
59 ++cpuid;
60 }
61 ++ncpus;
62 }
63
64 printk(KERN_INFO "CHRP SMP probe found %d cpus\n", ncpus);
65
66 /* Nothing more to do if less than 2 of them */
67 if (ncpus <= 1)
68 return 1;
69
70 mpic_request_ipis();
71
72 return ncpus;
73}
74
75static void __devinit smp_chrp_kick_cpu(int nr) 38static void __devinit smp_chrp_kick_cpu(int nr)
76{ 39{
77 *(unsigned long *)KERNELBASE = nr; 40 *(unsigned long *)KERNELBASE = nr;
@@ -114,7 +77,7 @@ void __devinit smp_chrp_take_timebase(void)
114/* CHRP with openpic */ 77/* CHRP with openpic */
115struct smp_ops_t chrp_smp_ops = { 78struct smp_ops_t chrp_smp_ops = {
116 .message_pass = smp_mpic_message_pass, 79 .message_pass = smp_mpic_message_pass,
117 .probe = smp_chrp_probe, 80 .probe = smp_mpic_probe,
118 .kick_cpu = smp_chrp_kick_cpu, 81 .kick_cpu = smp_chrp_kick_cpu,
119 .setup_cpu = smp_chrp_setup_cpu, 82 .setup_cpu = smp_chrp_setup_cpu,
120 .give_timebase = smp_chrp_give_timebase, 83 .give_timebase = smp_chrp_give_timebase,
diff --git a/arch/powerpc/platforms/iseries/call_hpt.h b/arch/powerpc/platforms/iseries/call_hpt.h
index 321f3bb7a8f5..a843b0f87b72 100644
--- a/arch/powerpc/platforms/iseries/call_hpt.h
+++ b/arch/powerpc/platforms/iseries/call_hpt.h
@@ -23,8 +23,8 @@
23 * drive the hypervisor from the OS. 23 * drive the hypervisor from the OS.
24 */ 24 */
25 25
26#include <asm/iSeries/HvCallSc.h> 26#include <asm/iseries/hv_call_sc.h>
27#include <asm/iSeries/HvTypes.h> 27#include <asm/iseries/hv_types.h>
28#include <asm/mmu.h> 28#include <asm/mmu.h>
29 29
30#define HvCallHptGetHptAddress HvCallHpt + 0 30#define HvCallHptGetHptAddress HvCallHpt + 0
diff --git a/arch/powerpc/platforms/iseries/call_pci.h b/arch/powerpc/platforms/iseries/call_pci.h
index a86e065b9577..59d4e0ad5cf3 100644
--- a/arch/powerpc/platforms/iseries/call_pci.h
+++ b/arch/powerpc/platforms/iseries/call_pci.h
@@ -25,8 +25,8 @@
25#ifndef _PLATFORMS_ISERIES_CALL_PCI_H 25#ifndef _PLATFORMS_ISERIES_CALL_PCI_H
26#define _PLATFORMS_ISERIES_CALL_PCI_H 26#define _PLATFORMS_ISERIES_CALL_PCI_H
27 27
28#include <asm/iSeries/HvCallSc.h> 28#include <asm/iseries/hv_call_sc.h>
29#include <asm/iSeries/HvTypes.h> 29#include <asm/iseries/hv_types.h>
30 30
31/* 31/*
32 * DSA == Direct Select Address 32 * DSA == Direct Select Address
diff --git a/arch/powerpc/platforms/iseries/call_sm.h b/arch/powerpc/platforms/iseries/call_sm.h
index ef223166cf22..c7e251619f48 100644
--- a/arch/powerpc/platforms/iseries/call_sm.h
+++ b/arch/powerpc/platforms/iseries/call_sm.h
@@ -23,8 +23,8 @@
23 * drive the hypervisor from the OS. 23 * drive the hypervisor from the OS.
24 */ 24 */
25 25
26#include <asm/iSeries/HvCallSc.h> 26#include <asm/iseries/hv_call_sc.h>
27#include <asm/iSeries/HvTypes.h> 27#include <asm/iseries/hv_types.h>
28 28
29#define HvCallSmGet64BitsOfAccessMap HvCallSm + 11 29#define HvCallSmGet64BitsOfAccessMap HvCallSm + 11
30 30
diff --git a/arch/powerpc/platforms/iseries/htab.c b/arch/powerpc/platforms/iseries/htab.c
index b3c6c3374ca6..30bdcf3925d9 100644
--- a/arch/powerpc/platforms/iseries/htab.c
+++ b/arch/powerpc/platforms/iseries/htab.c
@@ -39,15 +39,16 @@ static inline void iSeries_hunlock(unsigned long slot)
39 spin_unlock(&iSeries_hlocks[(slot >> 4) & 0x3f]); 39 spin_unlock(&iSeries_hlocks[(slot >> 4) & 0x3f]);
40} 40}
41 41
42static long iSeries_hpte_insert(unsigned long hpte_group, unsigned long va, 42long iSeries_hpte_insert(unsigned long hpte_group, unsigned long va,
43 unsigned long prpn, unsigned long vflags, 43 unsigned long pa, unsigned long rflags,
44 unsigned long rflags) 44 unsigned long vflags, int psize)
45{ 45{
46 unsigned long arpn;
47 long slot; 46 long slot;
48 hpte_t lhpte; 47 hpte_t lhpte;
49 int secondary = 0; 48 int secondary = 0;
50 49
50 BUG_ON(psize != MMU_PAGE_4K);
51
51 /* 52 /*
52 * The hypervisor tries both primary and secondary. 53 * The hypervisor tries both primary and secondary.
53 * If we are being called to insert in the secondary, 54 * If we are being called to insert in the secondary,
@@ -59,8 +60,19 @@ static long iSeries_hpte_insert(unsigned long hpte_group, unsigned long va,
59 60
60 iSeries_hlock(hpte_group); 61 iSeries_hlock(hpte_group);
61 62
62 slot = HvCallHpt_findValid(&lhpte, va >> PAGE_SHIFT); 63 slot = HvCallHpt_findValid(&lhpte, va >> HW_PAGE_SHIFT);
63 BUG_ON(lhpte.v & HPTE_V_VALID); 64 if (unlikely(lhpte.v & HPTE_V_VALID)) {
65 if (vflags & HPTE_V_BOLTED) {
66 HvCallHpt_setSwBits(slot, 0x10, 0);
67 HvCallHpt_setPp(slot, PP_RWXX);
68 iSeries_hunlock(hpte_group);
69 if (slot < 0)
70 return 0x8 | (slot & 7);
71 else
72 return slot & 7;
73 }
74 BUG();
75 }
64 76
65 if (slot == -1) { /* No available entry found in either group */ 77 if (slot == -1) { /* No available entry found in either group */
66 iSeries_hunlock(hpte_group); 78 iSeries_hunlock(hpte_group);
@@ -73,10 +85,9 @@ static long iSeries_hpte_insert(unsigned long hpte_group, unsigned long va,
73 slot &= 0x7fffffffffffffff; 85 slot &= 0x7fffffffffffffff;
74 } 86 }
75 87
76 arpn = phys_to_abs(prpn << PAGE_SHIFT) >> PAGE_SHIFT;
77 88
78 lhpte.v = (va >> 23) << HPTE_V_AVPN_SHIFT | vflags | HPTE_V_VALID; 89 lhpte.v = hpte_encode_v(va, MMU_PAGE_4K) | vflags | HPTE_V_VALID;
79 lhpte.r = (arpn << HPTE_R_RPN_SHIFT) | rflags; 90 lhpte.r = hpte_encode_r(phys_to_abs(pa), MMU_PAGE_4K) | rflags;
80 91
81 /* Now fill in the actual HPTE */ 92 /* Now fill in the actual HPTE */
82 HvCallHpt_addValidate(slot, secondary, &lhpte); 93 HvCallHpt_addValidate(slot, secondary, &lhpte);
@@ -86,25 +97,6 @@ static long iSeries_hpte_insert(unsigned long hpte_group, unsigned long va,
86 return (secondary << 3) | (slot & 7); 97 return (secondary << 3) | (slot & 7);
87} 98}
88 99
89long iSeries_hpte_bolt_or_insert(unsigned long hpte_group,
90 unsigned long va, unsigned long prpn, unsigned long vflags,
91 unsigned long rflags)
92{
93 long slot;
94 hpte_t lhpte;
95
96 slot = HvCallHpt_findValid(&lhpte, va >> PAGE_SHIFT);
97
98 if (lhpte.v & HPTE_V_VALID) {
99 /* Bolt the existing HPTE */
100 HvCallHpt_setSwBits(slot, 0x10, 0);
101 HvCallHpt_setPp(slot, PP_RWXX);
102 return 0;
103 }
104
105 return iSeries_hpte_insert(hpte_group, va, prpn, vflags, rflags);
106}
107
108static unsigned long iSeries_hpte_getword0(unsigned long slot) 100static unsigned long iSeries_hpte_getword0(unsigned long slot)
109{ 101{
110 hpte_t hpte; 102 hpte_t hpte;
@@ -150,15 +142,17 @@ static long iSeries_hpte_remove(unsigned long hpte_group)
150 * bits 61..63 : PP2,PP1,PP0 142 * bits 61..63 : PP2,PP1,PP0
151 */ 143 */
152static long iSeries_hpte_updatepp(unsigned long slot, unsigned long newpp, 144static long iSeries_hpte_updatepp(unsigned long slot, unsigned long newpp,
153 unsigned long va, int large, int local) 145 unsigned long va, int psize, int local)
154{ 146{
155 hpte_t hpte; 147 hpte_t hpte;
156 unsigned long avpn = va >> 23; 148 unsigned long want_v;
157 149
158 iSeries_hlock(slot); 150 iSeries_hlock(slot);
159 151
160 HvCallHpt_get(&hpte, slot); 152 HvCallHpt_get(&hpte, slot);
161 if ((HPTE_V_AVPN_VAL(hpte.v) == avpn) && (hpte.v & HPTE_V_VALID)) { 153 want_v = hpte_encode_v(va, MMU_PAGE_4K);
154
155 if (HPTE_V_COMPARE(hpte.v, want_v) && (hpte.v & HPTE_V_VALID)) {
162 /* 156 /*
163 * Hypervisor expects bits as NPPP, which is 157 * Hypervisor expects bits as NPPP, which is
164 * different from how they are mapped in our PP. 158 * different from how they are mapped in our PP.
@@ -210,14 +204,17 @@ static long iSeries_hpte_find(unsigned long vpn)
210 * 204 *
211 * No need to lock here because we should be the only user. 205 * No need to lock here because we should be the only user.
212 */ 206 */
213static void iSeries_hpte_updateboltedpp(unsigned long newpp, unsigned long ea) 207static void iSeries_hpte_updateboltedpp(unsigned long newpp, unsigned long ea,
208 int psize)
214{ 209{
215 unsigned long vsid,va,vpn; 210 unsigned long vsid,va,vpn;
216 long slot; 211 long slot;
217 212
213 BUG_ON(psize != MMU_PAGE_4K);
214
218 vsid = get_kernel_vsid(ea); 215 vsid = get_kernel_vsid(ea);
219 va = (vsid << 28) | (ea & 0x0fffffff); 216 va = (vsid << 28) | (ea & 0x0fffffff);
220 vpn = va >> PAGE_SHIFT; 217 vpn = va >> HW_PAGE_SHIFT;
221 slot = iSeries_hpte_find(vpn); 218 slot = iSeries_hpte_find(vpn);
222 if (slot == -1) 219 if (slot == -1)
223 panic("updateboltedpp: Could not find page to bolt\n"); 220 panic("updateboltedpp: Could not find page to bolt\n");
@@ -225,7 +222,7 @@ static void iSeries_hpte_updateboltedpp(unsigned long newpp, unsigned long ea)
225} 222}
226 223
227static void iSeries_hpte_invalidate(unsigned long slot, unsigned long va, 224static void iSeries_hpte_invalidate(unsigned long slot, unsigned long va,
228 int large, int local) 225 int psize, int local)
229{ 226{
230 unsigned long hpte_v; 227 unsigned long hpte_v;
231 unsigned long avpn = va >> 23; 228 unsigned long avpn = va >> 23;
diff --git a/arch/powerpc/platforms/iseries/hvlog.c b/arch/powerpc/platforms/iseries/hvlog.c
index f61e2e9ac9ec..f476d71194fa 100644
--- a/arch/powerpc/platforms/iseries/hvlog.c
+++ b/arch/powerpc/platforms/iseries/hvlog.c
@@ -9,9 +9,9 @@
9 9
10#include <asm/page.h> 10#include <asm/page.h>
11#include <asm/abs_addr.h> 11#include <asm/abs_addr.h>
12#include <asm/iSeries/HvCall.h> 12#include <asm/iseries/hv_call.h>
13#include <asm/iSeries/HvCallSc.h> 13#include <asm/iseries/hv_call_sc.h>
14#include <asm/iSeries/HvTypes.h> 14#include <asm/iseries/hv_types.h>
15 15
16 16
17void HvCall_writeLogBuffer(const void *buffer, u64 len) 17void HvCall_writeLogBuffer(const void *buffer, u64 len)
@@ -22,7 +22,7 @@ void HvCall_writeLogBuffer(const void *buffer, u64 len)
22 22
23 while (len) { 23 while (len) {
24 hv_buf.addr = cur; 24 hv_buf.addr = cur;
25 left_this_page = ((cur & PAGE_MASK) + PAGE_SIZE) - cur; 25 left_this_page = ((cur & HW_PAGE_MASK) + HW_PAGE_SIZE) - cur;
26 if (left_this_page > len) 26 if (left_this_page > len)
27 left_this_page = len; 27 left_this_page = len;
28 hv_buf.len = left_this_page; 28 hv_buf.len = left_this_page;
@@ -30,6 +30,6 @@ void HvCall_writeLogBuffer(const void *buffer, u64 len)
30 HvCall2(HvCallBaseWriteLogBuffer, 30 HvCall2(HvCallBaseWriteLogBuffer,
31 virt_to_abs(&hv_buf), 31 virt_to_abs(&hv_buf),
32 left_this_page); 32 left_this_page);
33 cur = (cur & PAGE_MASK) + PAGE_SIZE; 33 cur = (cur & HW_PAGE_MASK) + HW_PAGE_SIZE;
34 } 34 }
35} 35}
diff --git a/arch/powerpc/platforms/iseries/hvlpconfig.c b/arch/powerpc/platforms/iseries/hvlpconfig.c
index dc28621aea0d..663a1affb4bb 100644
--- a/arch/powerpc/platforms/iseries/hvlpconfig.c
+++ b/arch/powerpc/platforms/iseries/hvlpconfig.c
@@ -17,7 +17,7 @@
17 */ 17 */
18 18
19#include <linux/module.h> 19#include <linux/module.h>
20#include <asm/iSeries/HvLpConfig.h> 20#include <asm/iseries/hv_lp_config.h>
21 21
22HvLpIndex HvLpConfig_getLpIndex_outline(void) 22HvLpIndex HvLpConfig_getLpIndex_outline(void)
23{ 23{
diff --git a/arch/powerpc/platforms/iseries/iommu.c b/arch/powerpc/platforms/iseries/iommu.c
index 1db26d8be640..bf081b345820 100644
--- a/arch/powerpc/platforms/iseries/iommu.c
+++ b/arch/powerpc/platforms/iseries/iommu.c
@@ -32,7 +32,7 @@
32#include <asm/machdep.h> 32#include <asm/machdep.h>
33#include <asm/abs_addr.h> 33#include <asm/abs_addr.h>
34#include <asm/pci-bridge.h> 34#include <asm/pci-bridge.h>
35#include <asm/iSeries/HvCallXm.h> 35#include <asm/iseries/hv_call_xm.h>
36 36
37extern struct list_head iSeries_Global_Device_List; 37extern struct list_head iSeries_Global_Device_List;
38 38
@@ -43,9 +43,12 @@ static void tce_build_iSeries(struct iommu_table *tbl, long index, long npages,
43 u64 rc; 43 u64 rc;
44 union tce_entry tce; 44 union tce_entry tce;
45 45
46 index <<= TCE_PAGE_FACTOR;
47 npages <<= TCE_PAGE_FACTOR;
48
46 while (npages--) { 49 while (npages--) {
47 tce.te_word = 0; 50 tce.te_word = 0;
48 tce.te_bits.tb_rpn = virt_to_abs(uaddr) >> PAGE_SHIFT; 51 tce.te_bits.tb_rpn = virt_to_abs(uaddr) >> TCE_SHIFT;
49 52
50 if (tbl->it_type == TCE_VB) { 53 if (tbl->it_type == TCE_VB) {
51 /* Virtual Bus */ 54 /* Virtual Bus */
@@ -66,7 +69,7 @@ static void tce_build_iSeries(struct iommu_table *tbl, long index, long npages,
66 panic("PCI_DMA: HvCallXm_setTce failed, Rc: 0x%lx\n", 69 panic("PCI_DMA: HvCallXm_setTce failed, Rc: 0x%lx\n",
67 rc); 70 rc);
68 index++; 71 index++;
69 uaddr += PAGE_SIZE; 72 uaddr += TCE_PAGE_SIZE;
70 } 73 }
71} 74}
72 75
@@ -74,6 +77,9 @@ static void tce_free_iSeries(struct iommu_table *tbl, long index, long npages)
74{ 77{
75 u64 rc; 78 u64 rc;
76 79
80 npages <<= TCE_PAGE_FACTOR;
81 index <<= TCE_PAGE_FACTOR;
82
77 while (npages--) { 83 while (npages--) {
78 rc = HvCallXm_setTce((u64)tbl->it_index, (u64)index, 0); 84 rc = HvCallXm_setTce((u64)tbl->it_index, (u64)index, 0);
79 if (rc) 85 if (rc)
@@ -83,27 +89,6 @@ static void tce_free_iSeries(struct iommu_table *tbl, long index, long npages)
83 } 89 }
84} 90}
85 91
86#ifdef CONFIG_PCI
87/*
88 * This function compares the known tables to find an iommu_table
89 * that has already been built for hardware TCEs.
90 */
91static struct iommu_table *iommu_table_find(struct iommu_table * tbl)
92{
93 struct pci_dn *pdn;
94
95 list_for_each_entry(pdn, &iSeries_Global_Device_List, Device_List) {
96 struct iommu_table *it = pdn->iommu_table;
97 if ((it != NULL) &&
98 (it->it_type == TCE_PCI) &&
99 (it->it_offset == tbl->it_offset) &&
100 (it->it_index == tbl->it_index) &&
101 (it->it_size == tbl->it_size))
102 return it;
103 }
104 return NULL;
105}
106
107/* 92/*
108 * Call Hv with the architected data structure to get TCE table info. 93 * Call Hv with the architected data structure to get TCE table info.
109 * info. Put the returned data into the Linux representation of the 94 * info. Put the returned data into the Linux representation of the
@@ -113,8 +98,10 @@ static struct iommu_table *iommu_table_find(struct iommu_table * tbl)
113 * 2. TCE table per Bus. 98 * 2. TCE table per Bus.
114 * 3. TCE Table per IOA. 99 * 3. TCE Table per IOA.
115 */ 100 */
116static void iommu_table_getparms(struct pci_dn *pdn, 101void iommu_table_getparms_iSeries(unsigned long busno,
117 struct iommu_table* tbl) 102 unsigned char slotno,
103 unsigned char virtbus,
104 struct iommu_table* tbl)
118{ 105{
119 struct iommu_table_cb *parms; 106 struct iommu_table_cb *parms;
120 107
@@ -124,9 +111,9 @@ static void iommu_table_getparms(struct pci_dn *pdn,
124 111
125 memset(parms, 0, sizeof(*parms)); 112 memset(parms, 0, sizeof(*parms));
126 113
127 parms->itc_busno = pdn->busno; 114 parms->itc_busno = busno;
128 parms->itc_slotno = pdn->LogicalSlot; 115 parms->itc_slotno = slotno;
129 parms->itc_virtbus = 0; 116 parms->itc_virtbus = virtbus;
130 117
131 HvCallXm_getTceTableParms(iseries_hv_addr(parms)); 118 HvCallXm_getTceTableParms(iseries_hv_addr(parms));
132 119
@@ -134,17 +121,40 @@ static void iommu_table_getparms(struct pci_dn *pdn,
134 panic("PCI_DMA: parms->size is zero, parms is 0x%p", parms); 121 panic("PCI_DMA: parms->size is zero, parms is 0x%p", parms);
135 122
136 /* itc_size is in pages worth of table, it_size is in # of entries */ 123 /* itc_size is in pages worth of table, it_size is in # of entries */
137 tbl->it_size = (parms->itc_size * PAGE_SIZE) / sizeof(union tce_entry); 124 tbl->it_size = ((parms->itc_size * TCE_PAGE_SIZE) /
125 sizeof(union tce_entry)) >> TCE_PAGE_FACTOR;
138 tbl->it_busno = parms->itc_busno; 126 tbl->it_busno = parms->itc_busno;
139 tbl->it_offset = parms->itc_offset; 127 tbl->it_offset = parms->itc_offset >> TCE_PAGE_FACTOR;
140 tbl->it_index = parms->itc_index; 128 tbl->it_index = parms->itc_index;
141 tbl->it_blocksize = 1; 129 tbl->it_blocksize = 1;
142 tbl->it_type = TCE_PCI; 130 tbl->it_type = virtbus ? TCE_VB : TCE_PCI;
143 131
144 kfree(parms); 132 kfree(parms);
145} 133}
146 134
147 135
136#ifdef CONFIG_PCI
137/*
138 * This function compares the known tables to find an iommu_table
139 * that has already been built for hardware TCEs.
140 */
141static struct iommu_table *iommu_table_find(struct iommu_table * tbl)
142{
143 struct pci_dn *pdn;
144
145 list_for_each_entry(pdn, &iSeries_Global_Device_List, Device_List) {
146 struct iommu_table *it = pdn->iommu_table;
147 if ((it != NULL) &&
148 (it->it_type == TCE_PCI) &&
149 (it->it_offset == tbl->it_offset) &&
150 (it->it_index == tbl->it_index) &&
151 (it->it_size == tbl->it_size))
152 return it;
153 }
154 return NULL;
155}
156
157
148void iommu_devnode_init_iSeries(struct device_node *dn) 158void iommu_devnode_init_iSeries(struct device_node *dn)
149{ 159{
150 struct iommu_table *tbl; 160 struct iommu_table *tbl;
@@ -152,7 +162,7 @@ void iommu_devnode_init_iSeries(struct device_node *dn)
152 162
153 tbl = kmalloc(sizeof(struct iommu_table), GFP_KERNEL); 163 tbl = kmalloc(sizeof(struct iommu_table), GFP_KERNEL);
154 164
155 iommu_table_getparms(pdn, tbl); 165 iommu_table_getparms_iSeries(pdn->busno, pdn->LogicalSlot, 0, tbl);
156 166
157 /* Look for existing tce table */ 167 /* Look for existing tce table */
158 pdn->iommu_table = iommu_table_find(tbl); 168 pdn->iommu_table = iommu_table_find(tbl);
diff --git a/arch/powerpc/platforms/iseries/irq.c b/arch/powerpc/platforms/iseries/irq.c
index 937ac99b9d33..a06603d84a45 100644
--- a/arch/powerpc/platforms/iseries/irq.c
+++ b/arch/powerpc/platforms/iseries/irq.c
@@ -35,10 +35,9 @@
35#include <linux/irq.h> 35#include <linux/irq.h>
36#include <linux/spinlock.h> 36#include <linux/spinlock.h>
37 37
38#include <asm/ppcdebug.h> 38#include <asm/iseries/hv_types.h>
39#include <asm/iSeries/HvTypes.h> 39#include <asm/iseries/hv_lp_event.h>
40#include <asm/iSeries/HvLpEvent.h> 40#include <asm/iseries/hv_call_xm.h>
41#include <asm/iSeries/HvCallXm.h>
42 41
43#include "irq.h" 42#include "irq.h"
44#include "call_pci.h" 43#include "call_pci.h"
@@ -227,8 +226,6 @@ static void iSeries_enable_IRQ(unsigned int irq)
227 /* Unmask secondary INTA */ 226 /* Unmask secondary INTA */
228 mask = 0x80000000; 227 mask = 0x80000000;
229 HvCallPci_unmaskInterrupts(bus, subBus, deviceId, mask); 228 HvCallPci_unmaskInterrupts(bus, subBus, deviceId, mask);
230 PPCDBG(PPCDBG_BUSWALK, "iSeries_enable_IRQ 0x%02X.%02X.%02X 0x%04X\n",
231 bus, subBus, deviceId, irq);
232} 229}
233 230
234/* This is called by iSeries_activate_IRQs */ 231/* This is called by iSeries_activate_IRQs */
@@ -310,8 +307,6 @@ static void iSeries_disable_IRQ(unsigned int irq)
310 /* Mask secondary INTA */ 307 /* Mask secondary INTA */
311 mask = 0x80000000; 308 mask = 0x80000000;
312 HvCallPci_maskInterrupts(bus, subBus, deviceId, mask); 309 HvCallPci_maskInterrupts(bus, subBus, deviceId, mask);
313 PPCDBG(PPCDBG_BUSWALK, "iSeries_disable_IRQ 0x%02X.%02X.%02X 0x%04X\n",
314 bus, subBus, deviceId, irq);
315} 310}
316 311
317/* 312/*
diff --git a/arch/powerpc/platforms/iseries/ksyms.c b/arch/powerpc/platforms/iseries/ksyms.c
index f271b3539721..a2200842f4e5 100644
--- a/arch/powerpc/platforms/iseries/ksyms.c
+++ b/arch/powerpc/platforms/iseries/ksyms.c
@@ -9,7 +9,7 @@
9#include <linux/module.h> 9#include <linux/module.h>
10 10
11#include <asm/hw_irq.h> 11#include <asm/hw_irq.h>
12#include <asm/iSeries/HvCallSc.h> 12#include <asm/iseries/hv_call_sc.h>
13 13
14EXPORT_SYMBOL(HvCall0); 14EXPORT_SYMBOL(HvCall0);
15EXPORT_SYMBOL(HvCall1); 15EXPORT_SYMBOL(HvCall1);
diff --git a/arch/powerpc/platforms/iseries/lpardata.c b/arch/powerpc/platforms/iseries/lpardata.c
index ed2ffee6f731..bb8c91537f35 100644
--- a/arch/powerpc/platforms/iseries/lpardata.c
+++ b/arch/powerpc/platforms/iseries/lpardata.c
@@ -13,16 +13,16 @@
13#include <linux/bitops.h> 13#include <linux/bitops.h>
14#include <asm/processor.h> 14#include <asm/processor.h>
15#include <asm/ptrace.h> 15#include <asm/ptrace.h>
16#include <asm/naca.h>
17#include <asm/abs_addr.h> 16#include <asm/abs_addr.h>
18#include <asm/iSeries/ItLpNaca.h> 17#include <asm/iseries/it_lp_naca.h>
19#include <asm/lppaca.h> 18#include <asm/lppaca.h>
20#include <asm/iSeries/ItLpRegSave.h> 19#include <asm/iseries/it_lp_reg_save.h>
21#include <asm/paca.h> 20#include <asm/paca.h>
22#include <asm/iSeries/LparMap.h> 21#include <asm/iseries/lpar_map.h>
23#include <asm/iSeries/ItExtVpdPanel.h> 22#include <asm/iseries/it_exp_vpd_panel.h>
24#include <asm/iSeries/ItLpQueue.h> 23#include <asm/iseries/it_lp_queue.h>
25 24
25#include "naca.h"
26#include "vpd_areas.h" 26#include "vpd_areas.h"
27#include "spcomm_area.h" 27#include "spcomm_area.h"
28#include "ipl_parms.h" 28#include "ipl_parms.h"
diff --git a/arch/powerpc/platforms/iseries/lpevents.c b/arch/powerpc/platforms/iseries/lpevents.c
index 54c7753dbe05..e9fb98bf895f 100644
--- a/arch/powerpc/platforms/iseries/lpevents.c
+++ b/arch/powerpc/platforms/iseries/lpevents.c
@@ -17,10 +17,10 @@
17 17
18#include <asm/system.h> 18#include <asm/system.h>
19#include <asm/paca.h> 19#include <asm/paca.h>
20#include <asm/iSeries/ItLpQueue.h> 20#include <asm/iseries/it_lp_queue.h>
21#include <asm/iSeries/HvLpEvent.h> 21#include <asm/iseries/hv_lp_event.h>
22#include <asm/iSeries/HvCallEvent.h> 22#include <asm/iseries/hv_call_event.h>
23#include <asm/iSeries/ItLpNaca.h> 23#include <asm/iseries/it_lp_naca.h>
24 24
25/* 25/*
26 * The LpQueue is used to pass event data from the hypervisor to 26 * The LpQueue is used to pass event data from the hypervisor to
diff --git a/arch/powerpc/platforms/iseries/mf.c b/arch/powerpc/platforms/iseries/mf.c
index e5de31aa0015..49e7e4b85847 100644
--- a/arch/powerpc/platforms/iseries/mf.c
+++ b/arch/powerpc/platforms/iseries/mf.c
@@ -38,10 +38,10 @@
38#include <asm/uaccess.h> 38#include <asm/uaccess.h>
39#include <asm/paca.h> 39#include <asm/paca.h>
40#include <asm/abs_addr.h> 40#include <asm/abs_addr.h>
41#include <asm/iSeries/vio.h> 41#include <asm/iseries/vio.h>
42#include <asm/iSeries/mf.h> 42#include <asm/iseries/mf.h>
43#include <asm/iSeries/HvLpConfig.h> 43#include <asm/iseries/hv_lp_config.h>
44#include <asm/iSeries/ItLpQueue.h> 44#include <asm/iseries/it_lp_queue.h>
45 45
46#include "setup.h" 46#include "setup.h"
47 47
diff --git a/arch/powerpc/platforms/iseries/naca.h b/arch/powerpc/platforms/iseries/naca.h
new file mode 100644
index 000000000000..ab2372eb8d2e
--- /dev/null
+++ b/arch/powerpc/platforms/iseries/naca.h
@@ -0,0 +1,24 @@
1#ifndef _PLATFORMS_ISERIES_NACA_H
2#define _PLATFORMS_ISERIES_NACA_H
3
4/*
5 * c 2001 PPC 64 Team, IBM Corp
6 *
7 * This program is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU General Public License
9 * as published by the Free Software Foundation; either version
10 * 2 of the License, or (at your option) any later version.
11 */
12
13#include <asm/types.h>
14
15struct naca_struct {
16 /* Kernel only data - undefined for user space */
17 void *xItVpdAreas; /* VPD Data 0x00 */
18 void *xRamDisk; /* iSeries ramdisk 0x08 */
19 u64 xRamDiskSize; /* In pages 0x10 */
20};
21
22extern struct naca_struct naca;
23
24#endif /* _PLATFORMS_ISERIES_NACA_H */
diff --git a/arch/powerpc/platforms/iseries/pci.c b/arch/powerpc/platforms/iseries/pci.c
index 959e59fd9c11..4b75131773a6 100644
--- a/arch/powerpc/platforms/iseries/pci.c
+++ b/arch/powerpc/platforms/iseries/pci.c
@@ -32,12 +32,11 @@
32#include <asm/prom.h> 32#include <asm/prom.h>
33#include <asm/machdep.h> 33#include <asm/machdep.h>
34#include <asm/pci-bridge.h> 34#include <asm/pci-bridge.h>
35#include <asm/ppcdebug.h>
36#include <asm/iommu.h> 35#include <asm/iommu.h>
37#include <asm/abs_addr.h> 36#include <asm/abs_addr.h>
38 37
39#include <asm/iSeries/HvCallXm.h> 38#include <asm/iseries/hv_call_xm.h>
40#include <asm/iSeries/mf.h> 39#include <asm/iseries/mf.h>
41 40
42#include <asm/ppc-pci.h> 41#include <asm/ppc-pci.h>
43 42
@@ -207,10 +206,6 @@ static struct device_node *build_device_node(HvBusNumber Bus,
207 struct device_node *node; 206 struct device_node *node;
208 struct pci_dn *pdn; 207 struct pci_dn *pdn;
209 208
210 PPCDBG(PPCDBG_BUSWALK,
211 "-build_device_node 0x%02X.%02X.%02X Function: %02X\n",
212 Bus, SubBus, AgentId, Function);
213
214 node = kmalloc(sizeof(struct device_node), GFP_KERNEL); 209 node = kmalloc(sizeof(struct device_node), GFP_KERNEL);
215 if (node == NULL) 210 if (node == NULL)
216 return NULL; 211 return NULL;
@@ -243,8 +238,6 @@ unsigned long __init find_and_init_phbs(void)
243 struct pci_controller *phb; 238 struct pci_controller *phb;
244 HvBusNumber bus; 239 HvBusNumber bus;
245 240
246 PPCDBG(PPCDBG_BUSWALK, "find_and_init_phbs Entry\n");
247
248 /* Check all possible buses. */ 241 /* Check all possible buses. */
249 for (bus = 0; bus < 256; bus++) { 242 for (bus = 0; bus < 256; bus++) {
250 int ret = HvCallXm_testBus(bus); 243 int ret = HvCallXm_testBus(bus);
@@ -261,9 +254,6 @@ unsigned long __init find_and_init_phbs(void)
261 phb->last_busno = bus; 254 phb->last_busno = bus;
262 phb->ops = &iSeries_pci_ops; 255 phb->ops = &iSeries_pci_ops;
263 256
264 PPCDBG(PPCDBG_BUSWALK, "PCI:Create iSeries pci_controller(%p), Bus: %04X\n",
265 phb, bus);
266
267 /* Find and connect the devices. */ 257 /* Find and connect the devices. */
268 scan_PHB_slots(phb); 258 scan_PHB_slots(phb);
269 } 259 }
@@ -285,11 +275,9 @@ unsigned long __init find_and_init_phbs(void)
285 */ 275 */
286void iSeries_pcibios_init(void) 276void iSeries_pcibios_init(void)
287{ 277{
288 PPCDBG(PPCDBG_BUSWALK, "iSeries_pcibios_init Entry.\n");
289 iomm_table_initialize(); 278 iomm_table_initialize();
290 find_and_init_phbs(); 279 find_and_init_phbs();
291 io_page_mask = -1; 280 io_page_mask = -1;
292 PPCDBG(PPCDBG_BUSWALK, "iSeries_pcibios_init Exit.\n");
293} 281}
294 282
295/* 283/*
@@ -301,8 +289,6 @@ void __init iSeries_pci_final_fixup(void)
301 struct device_node *node; 289 struct device_node *node;
302 int DeviceCount = 0; 290 int DeviceCount = 0;
303 291
304 PPCDBG(PPCDBG_BUSWALK, "iSeries_pcibios_fixup Entry.\n");
305
306 /* Fix up at the device node and pci_dev relationship */ 292 /* Fix up at the device node and pci_dev relationship */
307 mf_display_src(0xC9000100); 293 mf_display_src(0xC9000100);
308 294
@@ -316,9 +302,6 @@ void __init iSeries_pci_final_fixup(void)
316 ++DeviceCount; 302 ++DeviceCount;
317 pdev->sysdata = (void *)node; 303 pdev->sysdata = (void *)node;
318 PCI_DN(node)->pcidev = pdev; 304 PCI_DN(node)->pcidev = pdev;
319 PPCDBG(PPCDBG_BUSWALK,
320 "pdev 0x%p <==> DevNode 0x%p\n",
321 pdev, node);
322 allocate_device_bars(pdev); 305 allocate_device_bars(pdev);
323 iSeries_Device_Information(pdev, DeviceCount); 306 iSeries_Device_Information(pdev, DeviceCount);
324 iommu_devnode_init_iSeries(node); 307 iommu_devnode_init_iSeries(node);
@@ -333,13 +316,10 @@ void __init iSeries_pci_final_fixup(void)
333 316
334void pcibios_fixup_bus(struct pci_bus *PciBus) 317void pcibios_fixup_bus(struct pci_bus *PciBus)
335{ 318{
336 PPCDBG(PPCDBG_BUSWALK, "iSeries_pcibios_fixup_bus(0x%04X) Entry.\n",
337 PciBus->number);
338} 319}
339 320
340void pcibios_fixup_resources(struct pci_dev *pdev) 321void pcibios_fixup_resources(struct pci_dev *pdev)
341{ 322{
342 PPCDBG(PPCDBG_BUSWALK, "fixup_resources pdev %p\n", pdev);
343} 323}
344 324
345/* 325/*
@@ -401,9 +381,6 @@ static void scan_EADS_bridge(HvBusNumber bus, HvSubBusNumber SubBus,
401 printk("found device at bus %d idsel %d func %d (AgentId %x)\n", 381 printk("found device at bus %d idsel %d func %d (AgentId %x)\n",
402 bus, IdSel, Function, AgentId); 382 bus, IdSel, Function, AgentId);
403 /* Connect EADs: 0x18.00.12 = 0x00 */ 383 /* Connect EADs: 0x18.00.12 = 0x00 */
404 PPCDBG(PPCDBG_BUSWALK,
405 "PCI:Connect EADs: 0x%02X.%02X.%02X\n",
406 bus, SubBus, AgentId);
407 HvRc = HvCallPci_getBusUnitInfo(bus, SubBus, AgentId, 384 HvRc = HvCallPci_getBusUnitInfo(bus, SubBus, AgentId,
408 iseries_hv_addr(BridgeInfo), 385 iseries_hv_addr(BridgeInfo),
409 sizeof(struct HvCallPci_BridgeInfo)); 386 sizeof(struct HvCallPci_BridgeInfo));
@@ -414,14 +391,6 @@ static void scan_EADS_bridge(HvBusNumber bus, HvSubBusNumber SubBus,
414 BridgeInfo->maxAgents, 391 BridgeInfo->maxAgents,
415 BridgeInfo->maxSubBusNumber, 392 BridgeInfo->maxSubBusNumber,
416 BridgeInfo->logicalSlotNumber); 393 BridgeInfo->logicalSlotNumber);
417 PPCDBG(PPCDBG_BUSWALK,
418 "PCI: BridgeInfo, Type:0x%02X, SubBus:0x%02X, MaxAgents:0x%02X, MaxSubBus: 0x%02X, LSlot: 0x%02X\n",
419 BridgeInfo->busUnitInfo.deviceType,
420 BridgeInfo->subBusNumber,
421 BridgeInfo->maxAgents,
422 BridgeInfo->maxSubBusNumber,
423 BridgeInfo->logicalSlotNumber);
424
425 if (BridgeInfo->busUnitInfo.deviceType == 394 if (BridgeInfo->busUnitInfo.deviceType ==
426 HvCallPci_BridgeDevice) { 395 HvCallPci_BridgeDevice) {
427 /* Scan_Bridge_Slot...: 0x18.00.12 */ 396 /* Scan_Bridge_Slot...: 0x18.00.12 */
@@ -454,9 +423,6 @@ static int scan_bridge_slot(HvBusNumber Bus,
454 423
455 /* iSeries_allocate_IRQ.: 0x18.00.12(0xA3) */ 424 /* iSeries_allocate_IRQ.: 0x18.00.12(0xA3) */
456 Irq = iSeries_allocate_IRQ(Bus, 0, EADsIdSel); 425 Irq = iSeries_allocate_IRQ(Bus, 0, EADsIdSel);
457 PPCDBG(PPCDBG_BUSWALK,
458 "PCI:- allocate and assign IRQ 0x%02X.%02X.%02X = 0x%02X\n",
459 Bus, 0, EADsIdSel, Irq);
460 426
461 /* 427 /*
462 * Connect all functions of any device found. 428 * Connect all functions of any device found.
@@ -482,9 +448,6 @@ static int scan_bridge_slot(HvBusNumber Bus,
482 printk("read vendor ID: %x\n", VendorId); 448 printk("read vendor ID: %x\n", VendorId);
483 449
484 /* FoundDevice: 0x18.28.10 = 0x12AE */ 450 /* FoundDevice: 0x18.28.10 = 0x12AE */
485 PPCDBG(PPCDBG_BUSWALK,
486 "PCI:- FoundDevice: 0x%02X.%02X.%02X = 0x%04X, irq %d\n",
487 Bus, SubBus, AgentId, VendorId, Irq);
488 HvRc = HvCallPci_configStore8(Bus, SubBus, AgentId, 451 HvRc = HvCallPci_configStore8(Bus, SubBus, AgentId,
489 PCI_INTERRUPT_LINE, Irq); 452 PCI_INTERRUPT_LINE, Irq);
490 if (HvRc != 0) 453 if (HvRc != 0)
diff --git a/arch/powerpc/platforms/iseries/proc.c b/arch/powerpc/platforms/iseries/proc.c
index 6f1929cac66b..e68b6b5fa89f 100644
--- a/arch/powerpc/platforms/iseries/proc.c
+++ b/arch/powerpc/platforms/iseries/proc.c
@@ -24,8 +24,8 @@
24#include <asm/processor.h> 24#include <asm/processor.h>
25#include <asm/time.h> 25#include <asm/time.h>
26#include <asm/lppaca.h> 26#include <asm/lppaca.h>
27#include <asm/iSeries/ItLpQueue.h> 27#include <asm/iseries/it_lp_queue.h>
28#include <asm/iSeries/HvCallXm.h> 28#include <asm/iseries/hv_call_xm.h>
29 29
30#include "processor_vpd.h" 30#include "processor_vpd.h"
31#include "main_store.h" 31#include "main_store.h"
diff --git a/arch/powerpc/platforms/iseries/release_data.h b/arch/powerpc/platforms/iseries/release_data.h
index c68b9c3e5caf..66189fd2e32d 100644
--- a/arch/powerpc/platforms/iseries/release_data.h
+++ b/arch/powerpc/platforms/iseries/release_data.h
@@ -24,7 +24,7 @@
24 * address of the OS's NACA). 24 * address of the OS's NACA).
25 */ 25 */
26#include <asm/types.h> 26#include <asm/types.h>
27#include <asm/naca.h> 27#include "naca.h"
28 28
29/* 29/*
30 * When we IPL a secondary partition, we will check if if the 30 * When we IPL a secondary partition, we will check if if the
diff --git a/arch/powerpc/platforms/iseries/setup.c b/arch/powerpc/platforms/iseries/setup.c
index 1544c6f10a38..7f8f0cda6a74 100644
--- a/arch/powerpc/platforms/iseries/setup.c
+++ b/arch/powerpc/platforms/iseries/setup.c
@@ -27,6 +27,7 @@
27#include <linux/kdev_t.h> 27#include <linux/kdev_t.h>
28#include <linux/major.h> 28#include <linux/major.h>
29#include <linux/root_dev.h> 29#include <linux/root_dev.h>
30#include <linux/kernel.h>
30 31
31#include <asm/processor.h> 32#include <asm/processor.h>
32#include <asm/machdep.h> 33#include <asm/machdep.h>
@@ -40,19 +41,19 @@
40#include <asm/firmware.h> 41#include <asm/firmware.h>
41 42
42#include <asm/time.h> 43#include <asm/time.h>
43#include <asm/naca.h>
44#include <asm/paca.h> 44#include <asm/paca.h>
45#include <asm/cache.h> 45#include <asm/cache.h>
46#include <asm/sections.h> 46#include <asm/sections.h>
47#include <asm/abs_addr.h> 47#include <asm/abs_addr.h>
48#include <asm/iSeries/HvLpConfig.h> 48#include <asm/iseries/hv_lp_config.h>
49#include <asm/iSeries/HvCallEvent.h> 49#include <asm/iseries/hv_call_event.h>
50#include <asm/iSeries/HvCallXm.h> 50#include <asm/iseries/hv_call_xm.h>
51#include <asm/iSeries/ItLpQueue.h> 51#include <asm/iseries/it_lp_queue.h>
52#include <asm/iSeries/mf.h> 52#include <asm/iseries/mf.h>
53#include <asm/iSeries/HvLpEvent.h> 53#include <asm/iseries/hv_lp_event.h>
54#include <asm/iSeries/LparMap.h> 54#include <asm/iseries/lpar_map.h>
55 55
56#include "naca.h"
56#include "setup.h" 57#include "setup.h"
57#include "irq.h" 58#include "irq.h"
58#include "vpd_areas.h" 59#include "vpd_areas.h"
@@ -70,8 +71,6 @@ extern void hvlog(char *fmt, ...);
70#endif 71#endif
71 72
72/* Function Prototypes */ 73/* Function Prototypes */
73extern void ppcdbg_initialize(void);
74
75static void build_iSeries_Memory_Map(void); 74static void build_iSeries_Memory_Map(void);
76static void iseries_shared_idle(void); 75static void iseries_shared_idle(void);
77static void iseries_dedicated_idle(void); 76static void iseries_dedicated_idle(void);
@@ -94,6 +93,8 @@ extern unsigned long iSeries_recal_titan;
94 93
95static int mf_initialized; 94static int mf_initialized;
96 95
96static unsigned long cmd_mem_limit;
97
97struct MemoryBlock { 98struct MemoryBlock {
98 unsigned long absStart; 99 unsigned long absStart;
99 unsigned long absEnd; 100 unsigned long absEnd;
@@ -306,8 +307,6 @@ static void __init iSeries_init_early(void)
306 307
307 ppc64_firmware_features = FW_FEATURE_ISERIES; 308 ppc64_firmware_features = FW_FEATURE_ISERIES;
308 309
309 ppcdbg_initialize();
310
311 ppc64_interrupt_controller = IC_ISERIES; 310 ppc64_interrupt_controller = IC_ISERIES;
312 311
313#if defined(CONFIG_BLK_DEV_INITRD) 312#if defined(CONFIG_BLK_DEV_INITRD)
@@ -317,11 +316,11 @@ static void __init iSeries_init_early(void)
317 */ 316 */
318 if (naca.xRamDisk) { 317 if (naca.xRamDisk) {
319 initrd_start = (unsigned long)__va(naca.xRamDisk); 318 initrd_start = (unsigned long)__va(naca.xRamDisk);
320 initrd_end = initrd_start + naca.xRamDiskSize * PAGE_SIZE; 319 initrd_end = initrd_start + naca.xRamDiskSize * HW_PAGE_SIZE;
321 initrd_below_start_ok = 1; // ramdisk in kernel space 320 initrd_below_start_ok = 1; // ramdisk in kernel space
322 ROOT_DEV = Root_RAM0; 321 ROOT_DEV = Root_RAM0;
323 if (((rd_size * 1024) / PAGE_SIZE) < naca.xRamDiskSize) 322 if (((rd_size * 1024) / HW_PAGE_SIZE) < naca.xRamDiskSize)
324 rd_size = (naca.xRamDiskSize * PAGE_SIZE) / 1024; 323 rd_size = (naca.xRamDiskSize * HW_PAGE_SIZE) / 1024;
325 } else 324 } else
326#endif /* CONFIG_BLK_DEV_INITRD */ 325#endif /* CONFIG_BLK_DEV_INITRD */
327 { 326 {
@@ -341,23 +340,6 @@ static void __init iSeries_init_early(void)
341 */ 340 */
342 iommu_init_early_iSeries(); 341 iommu_init_early_iSeries();
343 342
344 iSeries_get_cmdline();
345
346 /* Save unparsed command line copy for /proc/cmdline */
347 strlcpy(saved_command_line, cmd_line, COMMAND_LINE_SIZE);
348
349 /* Parse early parameters, in particular mem=x */
350 parse_early_param();
351
352 if (memory_limit) {
353 if (memory_limit < systemcfg->physicalMemorySize)
354 systemcfg->physicalMemorySize = memory_limit;
355 else {
356 printk("Ignoring mem=%lu >= ram_top.\n", memory_limit);
357 memory_limit = 0;
358 }
359 }
360
361 /* Initialize machine-dependency vectors */ 343 /* Initialize machine-dependency vectors */
362#ifdef CONFIG_SMP 344#ifdef CONFIG_SMP
363 smp_init_iSeries(); 345 smp_init_iSeries();
@@ -484,13 +466,14 @@ static void __init build_iSeries_Memory_Map(void)
484 */ 466 */
485 hptFirstChunk = (u32)addr_to_chunk(HvCallHpt_getHptAddress()); 467 hptFirstChunk = (u32)addr_to_chunk(HvCallHpt_getHptAddress());
486 hptSizePages = (u32)HvCallHpt_getHptPages(); 468 hptSizePages = (u32)HvCallHpt_getHptPages();
487 hptSizeChunks = hptSizePages >> (MSCHUNKS_CHUNK_SHIFT - PAGE_SHIFT); 469 hptSizeChunks = hptSizePages >>
470 (MSCHUNKS_CHUNK_SHIFT - HW_PAGE_SHIFT);
488 hptLastChunk = hptFirstChunk + hptSizeChunks - 1; 471 hptLastChunk = hptFirstChunk + hptSizeChunks - 1;
489 472
490 printk("HPT absolute addr = %016lx, size = %dK\n", 473 printk("HPT absolute addr = %016lx, size = %dK\n",
491 chunk_to_addr(hptFirstChunk), hptSizeChunks * 256); 474 chunk_to_addr(hptFirstChunk), hptSizeChunks * 256);
492 475
493 ppc64_pft_size = __ilog2(hptSizePages * PAGE_SIZE); 476 ppc64_pft_size = __ilog2(hptSizePages * HW_PAGE_SIZE);
494 477
495 /* 478 /*
496 * The actual hashed page table is in the hypervisor, 479 * The actual hashed page table is in the hypervisor,
@@ -643,7 +626,7 @@ static void __init iSeries_fixup_klimit(void)
643 */ 626 */
644 if (naca.xRamDisk) 627 if (naca.xRamDisk)
645 klimit = KERNELBASE + (u64)naca.xRamDisk + 628 klimit = KERNELBASE + (u64)naca.xRamDisk +
646 (naca.xRamDiskSize * PAGE_SIZE); 629 (naca.xRamDiskSize * HW_PAGE_SIZE);
647 else { 630 else {
648 /* 631 /*
649 * No ram disk was included - check and see if there 632 * No ram disk was included - check and see if there
@@ -711,20 +694,19 @@ static void iseries_shared_idle(void)
711 if (hvlpevent_is_pending()) 694 if (hvlpevent_is_pending())
712 process_iSeries_events(); 695 process_iSeries_events();
713 696
697 preempt_enable_no_resched();
714 schedule(); 698 schedule();
699 preempt_disable();
715 } 700 }
716} 701}
717 702
718static void iseries_dedicated_idle(void) 703static void iseries_dedicated_idle(void)
719{ 704{
720 long oldval; 705 long oldval;
706 set_thread_flag(TIF_POLLING_NRFLAG);
721 707
722 while (1) { 708 while (1) {
723 oldval = test_and_clear_thread_flag(TIF_NEED_RESCHED); 709 if (!need_resched()) {
724
725 if (!oldval) {
726 set_thread_flag(TIF_POLLING_NRFLAG);
727
728 while (!need_resched()) { 710 while (!need_resched()) {
729 ppc64_runlatch_off(); 711 ppc64_runlatch_off();
730 HMT_low(); 712 HMT_low();
@@ -737,13 +719,12 @@ static void iseries_dedicated_idle(void)
737 } 719 }
738 720
739 HMT_medium(); 721 HMT_medium();
740 clear_thread_flag(TIF_POLLING_NRFLAG);
741 } else {
742 set_need_resched();
743 } 722 }
744 723
745 ppc64_runlatch_on(); 724 ppc64_runlatch_on();
725 preempt_enable_no_resched();
746 schedule(); 726 schedule();
727 preempt_disable();
747 } 728 }
748} 729}
749 730
@@ -971,6 +952,8 @@ void build_flat_dt(struct iseries_flat_dt *dt)
971 /* /chosen */ 952 /* /chosen */
972 dt_start_node(dt, "chosen"); 953 dt_start_node(dt, "chosen");
973 dt_prop_u32(dt, "linux,platform", PLATFORM_ISERIES_LPAR); 954 dt_prop_u32(dt, "linux,platform", PLATFORM_ISERIES_LPAR);
955 if (cmd_mem_limit)
956 dt_prop_u64(dt, "linux,memory-limit", cmd_mem_limit);
974 dt_end_node(dt); 957 dt_end_node(dt);
975 958
976 dt_cpus(dt); 959 dt_cpus(dt);
@@ -990,7 +973,27 @@ void * __init iSeries_early_setup(void)
990 */ 973 */
991 build_iSeries_Memory_Map(); 974 build_iSeries_Memory_Map();
992 975
976 iSeries_get_cmdline();
977
978 /* Save unparsed command line copy for /proc/cmdline */
979 strlcpy(saved_command_line, cmd_line, COMMAND_LINE_SIZE);
980
981 /* Parse early parameters, in particular mem=x */
982 parse_early_param();
983
993 build_flat_dt(&iseries_dt); 984 build_flat_dt(&iseries_dt);
994 985
995 return (void *) __pa(&iseries_dt); 986 return (void *) __pa(&iseries_dt);
996} 987}
988
989/*
990 * On iSeries we just parse the mem=X option from the command line.
991 * On pSeries it's a bit more complicated, see prom_init_mem()
992 */
993static int __init early_parsemem(char *p)
994{
995 if (p)
996 cmd_mem_limit = ALIGN(memparse(p, &p), PAGE_SIZE);
997 return 0;
998}
999early_param("mem", early_parsemem);
diff --git a/arch/powerpc/platforms/iseries/smp.c b/arch/powerpc/platforms/iseries/smp.c
index f720916682f6..fcb094ec6aec 100644
--- a/arch/powerpc/platforms/iseries/smp.c
+++ b/arch/powerpc/platforms/iseries/smp.c
@@ -38,9 +38,8 @@
38#include <asm/io.h> 38#include <asm/io.h>
39#include <asm/smp.h> 39#include <asm/smp.h>
40#include <asm/paca.h> 40#include <asm/paca.h>
41#include <asm/iSeries/HvCall.h> 41#include <asm/iseries/hv_call.h>
42#include <asm/time.h> 42#include <asm/time.h>
43#include <asm/ppcdebug.h>
44#include <asm/machdep.h> 43#include <asm/machdep.h>
45#include <asm/cputable.h> 44#include <asm/cputable.h>
46#include <asm/system.h> 45#include <asm/system.h>
diff --git a/arch/powerpc/platforms/iseries/vio.c b/arch/powerpc/platforms/iseries/vio.c
index c0f7d2e9153f..384360ee06ec 100644
--- a/arch/powerpc/platforms/iseries/vio.c
+++ b/arch/powerpc/platforms/iseries/vio.c
@@ -17,10 +17,10 @@
17#include <asm/tce.h> 17#include <asm/tce.h>
18#include <asm/abs_addr.h> 18#include <asm/abs_addr.h>
19#include <asm/page.h> 19#include <asm/page.h>
20#include <asm/iSeries/vio.h> 20#include <asm/iseries/vio.h>
21#include <asm/iSeries/HvTypes.h> 21#include <asm/iseries/hv_types.h>
22#include <asm/iSeries/HvLpConfig.h> 22#include <asm/iseries/hv_lp_config.h>
23#include <asm/iSeries/HvCallXm.h> 23#include <asm/iseries/hv_call_xm.h>
24 24
25struct device *iSeries_vio_dev = &vio_bus_device.dev; 25struct device *iSeries_vio_dev = &vio_bus_device.dev;
26EXPORT_SYMBOL(iSeries_vio_dev); 26EXPORT_SYMBOL(iSeries_vio_dev);
@@ -30,41 +30,14 @@ static struct iommu_table vio_iommu_table;
30 30
31static void __init iommu_vio_init(void) 31static void __init iommu_vio_init(void)
32{ 32{
33 struct iommu_table *t; 33 iommu_table_getparms_iSeries(255, 0, 0xff, &veth_iommu_table);
34 struct iommu_table_cb cb; 34 veth_iommu_table.it_size /= 2;
35 unsigned long cbp; 35 vio_iommu_table = veth_iommu_table;
36 unsigned long itc_entries; 36 vio_iommu_table.it_offset += veth_iommu_table.it_size;
37 37
38 cb.itc_busno = 255; /* Bus 255 is the virtual bus */ 38 if (!iommu_init_table(&veth_iommu_table))
39 cb.itc_virtbus = 0xff; /* Ask for virtual bus */
40
41 cbp = virt_to_abs(&cb);
42 HvCallXm_getTceTableParms(cbp);
43
44 itc_entries = cb.itc_size * PAGE_SIZE / sizeof(union tce_entry);
45 veth_iommu_table.it_size = itc_entries / 2;
46 veth_iommu_table.it_busno = cb.itc_busno;
47 veth_iommu_table.it_offset = cb.itc_offset;
48 veth_iommu_table.it_index = cb.itc_index;
49 veth_iommu_table.it_type = TCE_VB;
50 veth_iommu_table.it_blocksize = 1;
51
52 t = iommu_init_table(&veth_iommu_table);
53
54 if (!t)
55 printk("Virtual Bus VETH TCE table failed.\n"); 39 printk("Virtual Bus VETH TCE table failed.\n");
56 40 if (!iommu_init_table(&vio_iommu_table))
57 vio_iommu_table.it_size = itc_entries - veth_iommu_table.it_size;
58 vio_iommu_table.it_busno = cb.itc_busno;
59 vio_iommu_table.it_offset = cb.itc_offset +
60 veth_iommu_table.it_size;
61 vio_iommu_table.it_index = cb.itc_index;
62 vio_iommu_table.it_type = TCE_VB;
63 vio_iommu_table.it_blocksize = 1;
64
65 t = iommu_init_table(&vio_iommu_table);
66
67 if (!t)
68 printk("Virtual Bus VIO TCE table failed.\n"); 41 printk("Virtual Bus VIO TCE table failed.\n");
69} 42}
70 43
diff --git a/arch/powerpc/platforms/iseries/viopath.c b/arch/powerpc/platforms/iseries/viopath.c
index c0c767bd37f1..842672695598 100644
--- a/arch/powerpc/platforms/iseries/viopath.c
+++ b/arch/powerpc/platforms/iseries/viopath.c
@@ -41,12 +41,12 @@
41 41
42#include <asm/system.h> 42#include <asm/system.h>
43#include <asm/uaccess.h> 43#include <asm/uaccess.h>
44#include <asm/iSeries/HvTypes.h> 44#include <asm/iseries/hv_types.h>
45#include <asm/iSeries/ItExtVpdPanel.h> 45#include <asm/iseries/it_exp_vpd_panel.h>
46#include <asm/iSeries/HvLpEvent.h> 46#include <asm/iseries/hv_lp_event.h>
47#include <asm/iSeries/HvLpConfig.h> 47#include <asm/iseries/hv_lp_config.h>
48#include <asm/iSeries/mf.h> 48#include <asm/iseries/mf.h>
49#include <asm/iSeries/vio.h> 49#include <asm/iseries/vio.h>
50 50
51/* Status of the path to each other partition in the system. 51/* Status of the path to each other partition in the system.
52 * This is overkill, since we will only ever establish connections 52 * This is overkill, since we will only ever establish connections
@@ -68,7 +68,8 @@ static DEFINE_SPINLOCK(statuslock);
68 * For each kind of event we allocate a buffer that is 68 * For each kind of event we allocate a buffer that is
69 * guaranteed not to cross a page boundary 69 * guaranteed not to cross a page boundary
70 */ 70 */
71static unsigned char event_buffer[VIO_MAX_SUBTYPES * 256] __page_aligned; 71static unsigned char event_buffer[VIO_MAX_SUBTYPES * 256]
72 __attribute__((__aligned__(4096)));
72static atomic_t event_buffer_available[VIO_MAX_SUBTYPES]; 73static atomic_t event_buffer_available[VIO_MAX_SUBTYPES];
73static int event_buffer_initialised; 74static int event_buffer_initialised;
74 75
@@ -116,12 +117,12 @@ static int proc_viopath_show(struct seq_file *m, void *v)
116 HvLpEvent_Rc hvrc; 117 HvLpEvent_Rc hvrc;
117 DECLARE_MUTEX_LOCKED(Semaphore); 118 DECLARE_MUTEX_LOCKED(Semaphore);
118 119
119 buf = kmalloc(PAGE_SIZE, GFP_KERNEL); 120 buf = kmalloc(HW_PAGE_SIZE, GFP_KERNEL);
120 if (!buf) 121 if (!buf)
121 return 0; 122 return 0;
122 memset(buf, 0, PAGE_SIZE); 123 memset(buf, 0, HW_PAGE_SIZE);
123 124
124 handle = dma_map_single(iSeries_vio_dev, buf, PAGE_SIZE, 125 handle = dma_map_single(iSeries_vio_dev, buf, HW_PAGE_SIZE,
125 DMA_FROM_DEVICE); 126 DMA_FROM_DEVICE);
126 127
127 hvrc = HvCallEvent_signalLpEventFast(viopath_hostLp, 128 hvrc = HvCallEvent_signalLpEventFast(viopath_hostLp,
@@ -131,7 +132,7 @@ static int proc_viopath_show(struct seq_file *m, void *v)
131 viopath_sourceinst(viopath_hostLp), 132 viopath_sourceinst(viopath_hostLp),
132 viopath_targetinst(viopath_hostLp), 133 viopath_targetinst(viopath_hostLp),
133 (u64)(unsigned long)&Semaphore, VIOVERSION << 16, 134 (u64)(unsigned long)&Semaphore, VIOVERSION << 16,
134 ((u64)handle) << 32, PAGE_SIZE, 0, 0); 135 ((u64)handle) << 32, HW_PAGE_SIZE, 0, 0);
135 136
136 if (hvrc != HvLpEvent_Rc_Good) 137 if (hvrc != HvLpEvent_Rc_Good)
137 printk(VIOPATH_KERN_WARN "hv error on op %d\n", (int)hvrc); 138 printk(VIOPATH_KERN_WARN "hv error on op %d\n", (int)hvrc);
@@ -140,7 +141,7 @@ static int proc_viopath_show(struct seq_file *m, void *v)
140 141
141 vlanMap = HvLpConfig_getVirtualLanIndexMap(); 142 vlanMap = HvLpConfig_getVirtualLanIndexMap();
142 143
143 buf[PAGE_SIZE-1] = '\0'; 144 buf[HW_PAGE_SIZE-1] = '\0';
144 seq_printf(m, "%s", buf); 145 seq_printf(m, "%s", buf);
145 seq_printf(m, "AVAILABLE_VETH=%x\n", vlanMap); 146 seq_printf(m, "AVAILABLE_VETH=%x\n", vlanMap);
146 seq_printf(m, "SRLNBR=%c%c%c%c%c%c%c\n", 147 seq_printf(m, "SRLNBR=%c%c%c%c%c%c%c\n",
@@ -152,7 +153,8 @@ static int proc_viopath_show(struct seq_file *m, void *v)
152 e2a(xItExtVpdPanel.systemSerial[4]), 153 e2a(xItExtVpdPanel.systemSerial[4]),
153 e2a(xItExtVpdPanel.systemSerial[5])); 154 e2a(xItExtVpdPanel.systemSerial[5]));
154 155
155 dma_unmap_single(iSeries_vio_dev, handle, PAGE_SIZE, DMA_FROM_DEVICE); 156 dma_unmap_single(iSeries_vio_dev, handle, HW_PAGE_SIZE,
157 DMA_FROM_DEVICE);
156 kfree(buf); 158 kfree(buf);
157 159
158 return 0; 160 return 0;
diff --git a/arch/powerpc/platforms/iseries/vpdinfo.c b/arch/powerpc/platforms/iseries/vpdinfo.c
index 9c318849dee7..23a6d1e5b429 100644
--- a/arch/powerpc/platforms/iseries/vpdinfo.c
+++ b/arch/powerpc/platforms/iseries/vpdinfo.c
@@ -32,7 +32,7 @@
32#include <asm/resource.h> 32#include <asm/resource.h>
33#include <asm/abs_addr.h> 33#include <asm/abs_addr.h>
34#include <asm/pci-bridge.h> 34#include <asm/pci-bridge.h>
35#include <asm/iSeries/HvTypes.h> 35#include <asm/iseries/hv_types.h>
36 36
37#include "pci.h" 37#include "pci.h"
38#include "call_pci.h" 38#include "call_pci.h"
diff --git a/arch/powerpc/platforms/powermac/Makefile b/arch/powerpc/platforms/powermac/Makefile
index 4369676f1d54..c9df44fcf571 100644
--- a/arch/powerpc/platforms/powermac/Makefile
+++ b/arch/powerpc/platforms/powermac/Makefile
@@ -1,7 +1,8 @@
1obj-y += pic.o setup.o time.o feature.o pci.o \ 1obj-y += pic.o setup.o time.o feature.o pci.o \
2 sleep.o low_i2c.o cache.o 2 sleep.o low_i2c.o cache.o
3obj-$(CONFIG_PMAC_BACKLIGHT) += backlight.o 3obj-$(CONFIG_PMAC_BACKLIGHT) += backlight.o
4obj-$(CONFIG_CPU_FREQ_PMAC) += cpufreq.o 4obj-$(CONFIG_CPU_FREQ_PMAC) += cpufreq_32.o
5obj-$(CONFIG_CPU_FREQ_PMAC64) += cpufreq_64.o
5obj-$(CONFIG_NVRAM) += nvram.o 6obj-$(CONFIG_NVRAM) += nvram.o
6# ppc64 pmac doesn't define CONFIG_NVRAM but needs nvram stuff 7# ppc64 pmac doesn't define CONFIG_NVRAM but needs nvram stuff
7obj-$(CONFIG_PPC64) += nvram.o 8obj-$(CONFIG_PPC64) += nvram.o
diff --git a/arch/powerpc/platforms/powermac/cpufreq.c b/arch/powerpc/platforms/powermac/cpufreq_32.c
index c47f8b69725c..56fd4e05fede 100644
--- a/arch/powerpc/platforms/powermac/cpufreq.c
+++ b/arch/powerpc/platforms/powermac/cpufreq_32.c
@@ -397,18 +397,16 @@ static int pmac_cpufreq_target( struct cpufreq_policy *policy,
397 unsigned int relation) 397 unsigned int relation)
398{ 398{
399 unsigned int newstate = 0; 399 unsigned int newstate = 0;
400 int rc;
400 401
401 if (cpufreq_frequency_table_target(policy, pmac_cpu_freqs, 402 if (cpufreq_frequency_table_target(policy, pmac_cpu_freqs,
402 target_freq, relation, &newstate)) 403 target_freq, relation, &newstate))
403 return -EINVAL; 404 return -EINVAL;
404 405
405 return do_set_cpu_speed(newstate, 1); 406 rc = do_set_cpu_speed(newstate, 1);
406}
407 407
408unsigned int pmac_get_one_cpufreq(int i) 408 ppc_proc_freq = cur_freq * 1000ul;
409{ 409 return rc;
410 /* Supports only one CPU for now */
411 return (i == 0) ? cur_freq : 0;
412} 410}
413 411
414static int pmac_cpufreq_cpu_init(struct cpufreq_policy *policy) 412static int pmac_cpufreq_cpu_init(struct cpufreq_policy *policy)
@@ -474,6 +472,8 @@ static int pmac_cpufreq_resume(struct cpufreq_policy *policy)
474 do_set_cpu_speed(sleep_freq == low_freq ? 472 do_set_cpu_speed(sleep_freq == low_freq ?
475 CPUFREQ_LOW : CPUFREQ_HIGH, 0); 473 CPUFREQ_LOW : CPUFREQ_HIGH, 0);
476 474
475 ppc_proc_freq = cur_freq * 1000ul;
476
477 no_schedule = 0; 477 no_schedule = 0;
478 return 0; 478 return 0;
479} 479}
@@ -547,7 +547,7 @@ static int pmac_cpufreq_init_MacRISC3(struct device_node *cpunode)
547 */ 547 */
548 if (low_freq < 98000000) 548 if (low_freq < 98000000)
549 low_freq = 101000000; 549 low_freq = 101000000;
550 550
551 /* Convert those to CPU core clocks */ 551 /* Convert those to CPU core clocks */
552 low_freq = (low_freq * (*ratio)) / 2000; 552 low_freq = (low_freq * (*ratio)) / 2000;
553 hi_freq = (hi_freq * (*ratio)) / 2000; 553 hi_freq = (hi_freq * (*ratio)) / 2000;
@@ -714,6 +714,7 @@ out:
714 714
715 pmac_cpu_freqs[CPUFREQ_LOW].frequency = low_freq; 715 pmac_cpu_freqs[CPUFREQ_LOW].frequency = low_freq;
716 pmac_cpu_freqs[CPUFREQ_HIGH].frequency = hi_freq; 716 pmac_cpu_freqs[CPUFREQ_HIGH].frequency = hi_freq;
717 ppc_proc_freq = cur_freq * 1000ul;
717 718
718 printk(KERN_INFO "Registering PowerMac CPU frequency driver\n"); 719 printk(KERN_INFO "Registering PowerMac CPU frequency driver\n");
719 printk(KERN_INFO "Low: %d Mhz, High: %d Mhz, Boot: %d Mhz\n", 720 printk(KERN_INFO "Low: %d Mhz, High: %d Mhz, Boot: %d Mhz\n",
diff --git a/arch/powerpc/platforms/powermac/cpufreq_64.c b/arch/powerpc/platforms/powermac/cpufreq_64.c
new file mode 100644
index 000000000000..39150342c6f1
--- /dev/null
+++ b/arch/powerpc/platforms/powermac/cpufreq_64.c
@@ -0,0 +1,323 @@
1/*
2 * Copyright (C) 2002 - 2005 Benjamin Herrenschmidt <benh@kernel.crashing.org>
3 * and Markus Demleitner <msdemlei@cl.uni-heidelberg.de>
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License version 2 as
7 * published by the Free Software Foundation.
8 *
9 * This driver adds basic cpufreq support for SMU & 970FX based G5 Macs,
10 * that is iMac G5 and latest single CPU desktop.
11 */
12
13#include <linux/config.h>
14#include <linux/module.h>
15#include <linux/types.h>
16#include <linux/errno.h>
17#include <linux/kernel.h>
18#include <linux/delay.h>
19#include <linux/sched.h>
20#include <linux/slab.h>
21#include <linux/cpufreq.h>
22#include <linux/init.h>
23#include <linux/completion.h>
24#include <asm/prom.h>
25#include <asm/machdep.h>
26#include <asm/irq.h>
27#include <asm/sections.h>
28#include <asm/cputable.h>
29#include <asm/time.h>
30#include <asm/smu.h>
31
32#undef DEBUG
33
34#ifdef DEBUG
35#define DBG(fmt...) printk(fmt)
36#else
37#define DBG(fmt...)
38#endif
39
40/* see 970FX user manual */
41
42#define SCOM_PCR 0x0aa001 /* PCR scom addr */
43
44#define PCR_HILO_SELECT 0x80000000U /* 1 = PCR, 0 = PCRH */
45#define PCR_SPEED_FULL 0x00000000U /* 1:1 speed value */
46#define PCR_SPEED_HALF 0x00020000U /* 1:2 speed value */
47#define PCR_SPEED_QUARTER 0x00040000U /* 1:4 speed value */
48#define PCR_SPEED_MASK 0x000e0000U /* speed mask */
49#define PCR_SPEED_SHIFT 17
50#define PCR_FREQ_REQ_VALID 0x00010000U /* freq request valid */
51#define PCR_VOLT_REQ_VALID 0x00008000U /* volt request valid */
52#define PCR_TARGET_TIME_MASK 0x00006000U /* target time */
53#define PCR_STATLAT_MASK 0x00001f00U /* STATLAT value */
54#define PCR_SNOOPLAT_MASK 0x000000f0U /* SNOOPLAT value */
55#define PCR_SNOOPACC_MASK 0x0000000fU /* SNOOPACC value */
56
57#define SCOM_PSR 0x408001 /* PSR scom addr */
58/* warning: PSR is a 64 bits register */
59#define PSR_CMD_RECEIVED 0x2000000000000000U /* command received */
60#define PSR_CMD_COMPLETED 0x1000000000000000U /* command completed */
61#define PSR_CUR_SPEED_MASK 0x0300000000000000U /* current speed */
62#define PSR_CUR_SPEED_SHIFT (56)
63
64/*
65 * The G5 only supports two frequencies (Quarter speed is not supported)
66 */
67#define CPUFREQ_HIGH 0
68#define CPUFREQ_LOW 1
69
70static struct cpufreq_frequency_table g5_cpu_freqs[] = {
71 {CPUFREQ_HIGH, 0},
72 {CPUFREQ_LOW, 0},
73 {0, CPUFREQ_TABLE_END},
74};
75
76static struct freq_attr* g5_cpu_freqs_attr[] = {
77 &cpufreq_freq_attr_scaling_available_freqs,
78 NULL,
79};
80
81/* Power mode data is an array of the 32 bits PCR values to use for
82 * the various frequencies, retreived from the device-tree
83 */
84static u32 *g5_pmode_data;
85static int g5_pmode_max;
86static int g5_pmode_cur;
87
88static DECLARE_MUTEX(g5_switch_mutex);
89
90
91static struct smu_sdbp_fvt *g5_fvt_table; /* table of op. points */
92static int g5_fvt_count; /* number of op. points */
93static int g5_fvt_cur; /* current op. point */
94
95/* ----------------- real hardware interface */
96
97static void g5_switch_volt(int speed_mode)
98{
99 struct smu_simple_cmd cmd;
100
101 DECLARE_COMPLETION(comp);
102 smu_queue_simple(&cmd, SMU_CMD_POWER_COMMAND, 8, smu_done_complete,
103 &comp, 'V', 'S', 'L', 'E', 'W',
104 0xff, g5_fvt_cur+1, speed_mode);
105 wait_for_completion(&comp);
106}
107
108static int g5_switch_freq(int speed_mode)
109{
110 struct cpufreq_freqs freqs;
111 int to;
112
113 if (g5_pmode_cur == speed_mode)
114 return 0;
115
116 down(&g5_switch_mutex);
117
118 freqs.old = g5_cpu_freqs[g5_pmode_cur].frequency;
119 freqs.new = g5_cpu_freqs[speed_mode].frequency;
120 freqs.cpu = 0;
121
122 cpufreq_notify_transition(&freqs, CPUFREQ_PRECHANGE);
123
124 /* If frequency is going up, first ramp up the voltage */
125 if (speed_mode < g5_pmode_cur)
126 g5_switch_volt(speed_mode);
127
128 /* Clear PCR high */
129 scom970_write(SCOM_PCR, 0);
130 /* Clear PCR low */
131 scom970_write(SCOM_PCR, PCR_HILO_SELECT | 0);
132 /* Set PCR low */
133 scom970_write(SCOM_PCR, PCR_HILO_SELECT |
134 g5_pmode_data[speed_mode]);
135
136 /* Wait for completion */
137 for (to = 0; to < 10; to++) {
138 unsigned long psr = scom970_read(SCOM_PSR);
139
140 if ((psr & PSR_CMD_RECEIVED) == 0 &&
141 (((psr >> PSR_CUR_SPEED_SHIFT) ^
142 (g5_pmode_data[speed_mode] >> PCR_SPEED_SHIFT)) & 0x3)
143 == 0)
144 break;
145 if (psr & PSR_CMD_COMPLETED)
146 break;
147 udelay(100);
148 }
149
150 /* If frequency is going down, last ramp the voltage */
151 if (speed_mode > g5_pmode_cur)
152 g5_switch_volt(speed_mode);
153
154 g5_pmode_cur = speed_mode;
155 ppc_proc_freq = g5_cpu_freqs[speed_mode].frequency * 1000ul;
156
157 cpufreq_notify_transition(&freqs, CPUFREQ_POSTCHANGE);
158
159 up(&g5_switch_mutex);
160
161 return 0;
162}
163
164static int g5_query_freq(void)
165{
166 unsigned long psr = scom970_read(SCOM_PSR);
167 int i;
168
169 for (i = 0; i <= g5_pmode_max; i++)
170 if ((((psr >> PSR_CUR_SPEED_SHIFT) ^
171 (g5_pmode_data[i] >> PCR_SPEED_SHIFT)) & 0x3) == 0)
172 break;
173 return i;
174}
175
176/* ----------------- cpufreq bookkeeping */
177
178static int g5_cpufreq_verify(struct cpufreq_policy *policy)
179{
180 return cpufreq_frequency_table_verify(policy, g5_cpu_freqs);
181}
182
183static int g5_cpufreq_target(struct cpufreq_policy *policy,
184 unsigned int target_freq, unsigned int relation)
185{
186 unsigned int newstate = 0;
187
188 if (cpufreq_frequency_table_target(policy, g5_cpu_freqs,
189 target_freq, relation, &newstate))
190 return -EINVAL;
191
192 return g5_switch_freq(newstate);
193}
194
195static unsigned int g5_cpufreq_get_speed(unsigned int cpu)
196{
197 return g5_cpu_freqs[g5_pmode_cur].frequency;
198}
199
200static int g5_cpufreq_cpu_init(struct cpufreq_policy *policy)
201{
202 if (policy->cpu != 0)
203 return -ENODEV;
204
205 policy->governor = CPUFREQ_DEFAULT_GOVERNOR;
206 policy->cpuinfo.transition_latency = CPUFREQ_ETERNAL;
207 policy->cur = g5_cpu_freqs[g5_query_freq()].frequency;
208 cpufreq_frequency_table_get_attr(g5_cpu_freqs, policy->cpu);
209
210 return cpufreq_frequency_table_cpuinfo(policy,
211 g5_cpu_freqs);
212}
213
214
215static struct cpufreq_driver g5_cpufreq_driver = {
216 .name = "powermac",
217 .owner = THIS_MODULE,
218 .flags = CPUFREQ_CONST_LOOPS,
219 .init = g5_cpufreq_cpu_init,
220 .verify = g5_cpufreq_verify,
221 .target = g5_cpufreq_target,
222 .get = g5_cpufreq_get_speed,
223 .attr = g5_cpu_freqs_attr,
224};
225
226
227static int __init g5_cpufreq_init(void)
228{
229 struct device_node *cpunode;
230 unsigned int psize, ssize;
231 struct smu_sdbp_header *shdr;
232 unsigned long max_freq;
233 u32 *valp;
234 int rc = -ENODEV;
235
236 /* Look for CPU and SMU nodes */
237 cpunode = of_find_node_by_type(NULL, "cpu");
238 if (!cpunode) {
239 DBG("No CPU node !\n");
240 return -ENODEV;
241 }
242
243 /* Check 970FX for now */
244 valp = (u32 *)get_property(cpunode, "cpu-version", NULL);
245 if (!valp) {
246 DBG("No cpu-version property !\n");
247 goto bail_noprops;
248 }
249 if (((*valp) >> 16) != 0x3c) {
250 DBG("Wrong CPU version: %08x\n", *valp);
251 goto bail_noprops;
252 }
253
254 /* Look for the powertune data in the device-tree */
255 g5_pmode_data = (u32 *)get_property(cpunode, "power-mode-data",&psize);
256 if (!g5_pmode_data) {
257 DBG("No power-mode-data !\n");
258 goto bail_noprops;
259 }
260 g5_pmode_max = psize / sizeof(u32) - 1;
261
262 /* Look for the FVT table */
263 shdr = smu_get_sdb_partition(SMU_SDB_FVT_ID, NULL);
264 if (!shdr)
265 goto bail_noprops;
266 g5_fvt_table = (struct smu_sdbp_fvt *)&shdr[1];
267 ssize = (shdr->len * sizeof(u32)) - sizeof(struct smu_sdbp_header);
268 g5_fvt_count = ssize / sizeof(struct smu_sdbp_fvt);
269 g5_fvt_cur = 0;
270
271 /* Sanity checking */
272 if (g5_fvt_count < 1 || g5_pmode_max < 1)
273 goto bail_noprops;
274
275 /*
276 * From what I see, clock-frequency is always the maximal frequency.
277 * The current driver can not slew sysclk yet, so we really only deal
278 * with powertune steps for now. We also only implement full freq and
279 * half freq in this version. So far, I haven't yet seen a machine
280 * supporting anything else.
281 */
282 valp = (u32 *)get_property(cpunode, "clock-frequency", NULL);
283 if (!valp)
284 return -ENODEV;
285 max_freq = (*valp)/1000;
286 g5_cpu_freqs[0].frequency = max_freq;
287 g5_cpu_freqs[1].frequency = max_freq/2;
288
289 /* Check current frequency */
290 g5_pmode_cur = g5_query_freq();
291 if (g5_pmode_cur > 1)
292 /* We don't support anything but 1:1 and 1:2, fixup ... */
293 g5_pmode_cur = 1;
294
295 /* Force apply current frequency to make sure everything is in
296 * sync (voltage is right for example). Firmware may leave us with
297 * a strange setting ...
298 */
299 g5_switch_freq(g5_pmode_cur);
300
301 printk(KERN_INFO "Registering G5 CPU frequency driver\n");
302 printk(KERN_INFO "Low: %d Mhz, High: %d Mhz, Cur: %d MHz\n",
303 g5_cpu_freqs[1].frequency/1000,
304 g5_cpu_freqs[0].frequency/1000,
305 g5_cpu_freqs[g5_pmode_cur].frequency/1000);
306
307 rc = cpufreq_register_driver(&g5_cpufreq_driver);
308
309 /* We keep the CPU node on hold... hopefully, Apple G5 don't have
310 * hotplug CPU with a dynamic device-tree ...
311 */
312 return rc;
313
314 bail_noprops:
315 of_node_put(cpunode);
316
317 return rc;
318}
319
320module_init(g5_cpufreq_init);
321
322
323MODULE_LICENSE("GPL");
diff --git a/arch/powerpc/platforms/powermac/pic.c b/arch/powerpc/platforms/powermac/pic.c
index 0037a8c8c81f..83a49e80ac29 100644
--- a/arch/powerpc/platforms/powermac/pic.c
+++ b/arch/powerpc/platforms/powermac/pic.c
@@ -576,7 +576,7 @@ void __init pmac_pic_init(void)
576#endif /* CONFIG_PPC32 */ 576#endif /* CONFIG_PPC32 */
577} 577}
578 578
579#ifdef CONFIG_PM 579#if defined(CONFIG_PM) && defined(CONFIG_PPC32)
580/* 580/*
581 * These procedures are used in implementing sleep on the powerbooks. 581 * These procedures are used in implementing sleep on the powerbooks.
582 * sleep_save_intrs() saves the states of all interrupt enables 582 * sleep_save_intrs() saves the states of all interrupt enables
@@ -643,7 +643,7 @@ static int pmacpic_resume(struct sys_device *sysdev)
643 return 0; 643 return 0;
644} 644}
645 645
646#endif /* CONFIG_PM */ 646#endif /* CONFIG_PM && CONFIG_PPC32 */
647 647
648static struct sysdev_class pmacpic_sysclass = { 648static struct sysdev_class pmacpic_sysclass = {
649 set_kset_name("pmac_pic"), 649 set_kset_name("pmac_pic"),
@@ -655,10 +655,10 @@ static struct sys_device device_pmacpic = {
655}; 655};
656 656
657static struct sysdev_driver driver_pmacpic = { 657static struct sysdev_driver driver_pmacpic = {
658#ifdef CONFIG_PM 658#if defined(CONFIG_PM) && defined(CONFIG_PPC32)
659 .suspend = &pmacpic_suspend, 659 .suspend = &pmacpic_suspend,
660 .resume = &pmacpic_resume, 660 .resume = &pmacpic_resume,
661#endif /* CONFIG_PM */ 661#endif /* CONFIG_PM && CONFIG_PPC32 */
662}; 662};
663 663
664static int __init init_pmacpic_sysfs(void) 664static int __init init_pmacpic_sysfs(void)
diff --git a/arch/powerpc/platforms/powermac/setup.c b/arch/powerpc/platforms/powermac/setup.c
index 6f62af597291..7acb0546671f 100644
--- a/arch/powerpc/platforms/powermac/setup.c
+++ b/arch/powerpc/platforms/powermac/setup.c
@@ -75,6 +75,7 @@
75#include <asm/smu.h> 75#include <asm/smu.h>
76#include <asm/pmc.h> 76#include <asm/pmc.h>
77#include <asm/mpic.h> 77#include <asm/mpic.h>
78#include <asm/lmb.h>
78 79
79#include "pmac.h" 80#include "pmac.h"
80 81
@@ -192,18 +193,6 @@ static void pmac_show_cpuinfo(struct seq_file *m)
192 pmac_newworld ? "NewWorld" : "OldWorld"); 193 pmac_newworld ? "NewWorld" : "OldWorld");
193} 194}
194 195
195static void pmac_show_percpuinfo(struct seq_file *m, int i)
196{
197#ifdef CONFIG_CPU_FREQ_PMAC
198 extern unsigned int pmac_get_one_cpufreq(int i);
199 unsigned int freq = pmac_get_one_cpufreq(i);
200 if (freq != 0) {
201 seq_printf(m, "clock\t\t: %dMHz\n", freq/1000);
202 return;
203 }
204#endif /* CONFIG_CPU_FREQ_PMAC */
205}
206
207#ifndef CONFIG_ADB_CUDA 196#ifndef CONFIG_ADB_CUDA
208int find_via_cuda(void) 197int find_via_cuda(void)
209{ 198{
@@ -350,7 +339,7 @@ void __init pmac_setup_arch(void)
350 find_via_pmu(); 339 find_via_pmu();
351 smu_init(); 340 smu_init();
352 341
353#ifdef CONFIG_NVRAM 342#if defined(CONFIG_NVRAM) || defined(CONFIG_PPC64)
354 pmac_nvram_init(); 343 pmac_nvram_init();
355#endif 344#endif
356 345
@@ -766,7 +755,6 @@ struct machdep_calls __initdata pmac_md = {
766 .setup_arch = pmac_setup_arch, 755 .setup_arch = pmac_setup_arch,
767 .init_early = pmac_init_early, 756 .init_early = pmac_init_early,
768 .show_cpuinfo = pmac_show_cpuinfo, 757 .show_cpuinfo = pmac_show_cpuinfo,
769 .show_percpuinfo = pmac_show_percpuinfo,
770 .init_IRQ = pmac_pic_init, 758 .init_IRQ = pmac_pic_init,
771 .get_irq = mpic_get_irq, /* changed later */ 759 .get_irq = mpic_get_irq, /* changed later */
772 .pcibios_fixup = pmac_pcibios_fixup, 760 .pcibios_fixup = pmac_pcibios_fixup,
diff --git a/arch/powerpc/platforms/pseries/Kconfig b/arch/powerpc/platforms/pseries/Kconfig
index 2d57f588151d..e3fc3407bb1f 100644
--- a/arch/powerpc/platforms/pseries/Kconfig
+++ b/arch/powerpc/platforms/pseries/Kconfig
@@ -21,15 +21,6 @@ config EEH
21 depends on PPC_PSERIES 21 depends on PPC_PSERIES
22 default y if !EMBEDDED 22 default y if !EMBEDDED
23 23
24config RTAS_PROC
25 bool "Proc interface to RTAS"
26 depends on PPC_RTAS
27 default y
28
29config RTAS_FLASH
30 tristate "Firmware flash interface"
31 depends on PPC64 && RTAS_PROC
32
33config SCANLOG 24config SCANLOG
34 tristate "Scanlog dump interface" 25 tristate "Scanlog dump interface"
35 depends on RTAS_PROC && PPC_PSERIES 26 depends on RTAS_PROC && PPC_PSERIES
diff --git a/arch/powerpc/platforms/pseries/Makefile b/arch/powerpc/platforms/pseries/Makefile
index 5ef494e3a70f..b9938fece781 100644
--- a/arch/powerpc/platforms/pseries/Makefile
+++ b/arch/powerpc/platforms/pseries/Makefile
@@ -1,5 +1,5 @@
1obj-y := pci.o lpar.o hvCall.o nvram.o reconfig.o \ 1obj-y := pci.o lpar.o hvCall.o nvram.o reconfig.o \
2 setup.o iommu.o rtas-fw.o ras.o 2 setup.o iommu.o ras.o rtasd.o
3obj-$(CONFIG_SMP) += smp.o 3obj-$(CONFIG_SMP) += smp.o
4obj-$(CONFIG_IBMVIO) += vio.o 4obj-$(CONFIG_IBMVIO) += vio.o
5obj-$(CONFIG_XICS) += xics.o 5obj-$(CONFIG_XICS) += xics.o
diff --git a/arch/powerpc/platforms/pseries/iommu.c b/arch/powerpc/platforms/pseries/iommu.c
index 9e90d41131d8..fcc50bfd43fd 100644
--- a/arch/powerpc/platforms/pseries/iommu.c
+++ b/arch/powerpc/platforms/pseries/iommu.c
@@ -37,17 +37,18 @@
37#include <asm/io.h> 37#include <asm/io.h>
38#include <asm/prom.h> 38#include <asm/prom.h>
39#include <asm/rtas.h> 39#include <asm/rtas.h>
40#include <asm/ppcdebug.h>
41#include <asm/iommu.h> 40#include <asm/iommu.h>
42#include <asm/pci-bridge.h> 41#include <asm/pci-bridge.h>
43#include <asm/machdep.h> 42#include <asm/machdep.h>
44#include <asm/abs_addr.h> 43#include <asm/abs_addr.h>
45#include <asm/plpar_wrappers.h>
46#include <asm/pSeries_reconfig.h> 44#include <asm/pSeries_reconfig.h>
47#include <asm/systemcfg.h> 45#include <asm/systemcfg.h>
48#include <asm/firmware.h> 46#include <asm/firmware.h>
49#include <asm/tce.h> 47#include <asm/tce.h>
50#include <asm/ppc-pci.h> 48#include <asm/ppc-pci.h>
49#include <asm/udbg.h>
50
51#include "plpar_wrappers.h"
51 52
52#define DBG(fmt...) 53#define DBG(fmt...)
53 54
@@ -498,7 +499,7 @@ static int iommu_reconfig_notifier(struct notifier_block *nb, unsigned long acti
498 499
499 switch (action) { 500 switch (action) {
500 case PSERIES_RECONFIG_REMOVE: 501 case PSERIES_RECONFIG_REMOVE:
501 if (pci->iommu_table && 502 if (pci && pci->iommu_table &&
502 get_property(np, "ibm,dma-window", NULL)) 503 get_property(np, "ibm,dma-window", NULL))
503 iommu_free_table(np); 504 iommu_free_table(np);
504 break; 505 break;
diff --git a/arch/powerpc/platforms/pseries/lpar.c b/arch/powerpc/platforms/pseries/lpar.c
index 268d8362dde7..a50e5f3f396d 100644
--- a/arch/powerpc/platforms/pseries/lpar.c
+++ b/arch/powerpc/platforms/pseries/lpar.c
@@ -19,7 +19,7 @@
19 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 19 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 */ 20 */
21 21
22#define DEBUG 22#undef DEBUG_LOW
23 23
24#include <linux/config.h> 24#include <linux/config.h>
25#include <linux/kernel.h> 25#include <linux/kernel.h>
@@ -31,19 +31,21 @@
31#include <asm/machdep.h> 31#include <asm/machdep.h>
32#include <asm/abs_addr.h> 32#include <asm/abs_addr.h>
33#include <asm/mmu_context.h> 33#include <asm/mmu_context.h>
34#include <asm/ppcdebug.h>
35#include <asm/iommu.h> 34#include <asm/iommu.h>
36#include <asm/tlbflush.h> 35#include <asm/tlbflush.h>
37#include <asm/tlb.h> 36#include <asm/tlb.h>
38#include <asm/prom.h> 37#include <asm/prom.h>
39#include <asm/abs_addr.h> 38#include <asm/abs_addr.h>
40#include <asm/cputable.h> 39#include <asm/cputable.h>
41#include <asm/plpar_wrappers.h> 40#include <asm/udbg.h>
41#include <asm/smp.h>
42 42
43#ifdef DEBUG 43#include "plpar_wrappers.h"
44#define DBG(fmt...) udbg_printf(fmt) 44
45#ifdef DEBUG_LOW
46#define DBG_LOW(fmt...) do { udbg_printf(fmt); } while(0)
45#else 47#else
46#define DBG(fmt...) 48#define DBG_LOW(fmt...) do { } while(0)
47#endif 49#endif
48 50
49/* in pSeries_hvCall.S */ 51/* in pSeries_hvCall.S */
@@ -260,27 +262,24 @@ out:
260void vpa_init(int cpu) 262void vpa_init(int cpu)
261{ 263{
262 int hwcpu = get_hard_smp_processor_id(cpu); 264 int hwcpu = get_hard_smp_processor_id(cpu);
263 unsigned long vpa = (unsigned long)&(paca[cpu].lppaca); 265 unsigned long vpa = __pa(&paca[cpu].lppaca);
264 long ret; 266 long ret;
265 unsigned long flags;
266
267 /* Register the Virtual Processor Area (VPA) */
268 flags = 1UL << (63 - 18);
269 267
270 if (cpu_has_feature(CPU_FTR_ALTIVEC)) 268 if (cpu_has_feature(CPU_FTR_ALTIVEC))
271 paca[cpu].lppaca.vmxregs_in_use = 1; 269 paca[cpu].lppaca.vmxregs_in_use = 1;
272 270
273 ret = register_vpa(flags, hwcpu, __pa(vpa)); 271 ret = register_vpa(hwcpu, vpa);
274 272
275 if (ret) 273 if (ret)
276 printk(KERN_ERR "WARNING: vpa_init: VPA registration for " 274 printk(KERN_ERR "WARNING: vpa_init: VPA registration for "
277 "cpu %d (hw %d) of area %lx returns %ld\n", 275 "cpu %d (hw %d) of area %lx returns %ld\n",
278 cpu, hwcpu, __pa(vpa), ret); 276 cpu, hwcpu, vpa, ret);
279} 277}
280 278
281long pSeries_lpar_hpte_insert(unsigned long hpte_group, 279long pSeries_lpar_hpte_insert(unsigned long hpte_group,
282 unsigned long va, unsigned long prpn, 280 unsigned long va, unsigned long pa,
283 unsigned long vflags, unsigned long rflags) 281 unsigned long rflags, unsigned long vflags,
282 int psize)
284{ 283{
285 unsigned long lpar_rc; 284 unsigned long lpar_rc;
286 unsigned long flags; 285 unsigned long flags;
@@ -288,11 +287,28 @@ long pSeries_lpar_hpte_insert(unsigned long hpte_group,
288 unsigned long hpte_v, hpte_r; 287 unsigned long hpte_v, hpte_r;
289 unsigned long dummy0, dummy1; 288 unsigned long dummy0, dummy1;
290 289
291 hpte_v = ((va >> 23) << HPTE_V_AVPN_SHIFT) | vflags | HPTE_V_VALID; 290 if (!(vflags & HPTE_V_BOLTED))
292 if (vflags & HPTE_V_LARGE) 291 DBG_LOW("hpte_insert(group=%lx, va=%016lx, pa=%016lx, "
293 hpte_v &= ~(1UL << HPTE_V_AVPN_SHIFT); 292 "rflags=%lx, vflags=%lx, psize=%d)\n",
294 293 hpte_group, va, pa, rflags, vflags, psize);
295 hpte_r = (prpn << HPTE_R_RPN_SHIFT) | rflags; 294
295 hpte_v = hpte_encode_v(va, psize) | vflags | HPTE_V_VALID;
296 hpte_r = hpte_encode_r(pa, psize) | rflags;
297
298 if (!(vflags & HPTE_V_BOLTED))
299 DBG_LOW(" hpte_v=%016lx, hpte_r=%016lx\n", hpte_v, hpte_r);
300
301#if 1
302 {
303 int i;
304 for (i=0;i<8;i++) {
305 unsigned long w0, w1;
306 plpar_pte_read(0, hpte_group, &w0, &w1);
307 BUG_ON (HPTE_V_COMPARE(hpte_v, w0)
308 && (w0 & HPTE_V_VALID));
309 }
310 }
311#endif
296 312
297 /* Now fill in the actual HPTE */ 313 /* Now fill in the actual HPTE */
298 /* Set CEC cookie to 0 */ 314 /* Set CEC cookie to 0 */
@@ -302,23 +318,30 @@ long pSeries_lpar_hpte_insert(unsigned long hpte_group,
302 /* Exact = 0 */ 318 /* Exact = 0 */
303 flags = 0; 319 flags = 0;
304 320
305 /* XXX why is this here? - Anton */ 321 /* Make pHyp happy */
306 if (rflags & (_PAGE_GUARDED|_PAGE_NO_CACHE)) 322 if (rflags & (_PAGE_GUARDED|_PAGE_NO_CACHE))
307 hpte_r &= ~_PAGE_COHERENT; 323 hpte_r &= ~_PAGE_COHERENT;
308 324
309 lpar_rc = plpar_hcall(H_ENTER, flags, hpte_group, hpte_v, 325 lpar_rc = plpar_hcall(H_ENTER, flags, hpte_group, hpte_v,
310 hpte_r, &slot, &dummy0, &dummy1); 326 hpte_r, &slot, &dummy0, &dummy1);
311 327 if (unlikely(lpar_rc == H_PTEG_Full)) {
312 if (unlikely(lpar_rc == H_PTEG_Full)) 328 if (!(vflags & HPTE_V_BOLTED))
329 DBG_LOW(" full\n");
313 return -1; 330 return -1;
331 }
314 332
315 /* 333 /*
316 * Since we try and ioremap PHBs we don't own, the pte insert 334 * Since we try and ioremap PHBs we don't own, the pte insert
317 * will fail. However we must catch the failure in hash_page 335 * will fail. However we must catch the failure in hash_page
318 * or we will loop forever, so return -2 in this case. 336 * or we will loop forever, so return -2 in this case.
319 */ 337 */
320 if (unlikely(lpar_rc != H_Success)) 338 if (unlikely(lpar_rc != H_Success)) {
339 if (!(vflags & HPTE_V_BOLTED))
340 DBG_LOW(" lpar err %d\n", lpar_rc);
321 return -2; 341 return -2;
342 }
343 if (!(vflags & HPTE_V_BOLTED))
344 DBG_LOW(" -> slot: %d\n", slot & 7);
322 345
323 /* Because of iSeries, we have to pass down the secondary 346 /* Because of iSeries, we have to pass down the secondary
324 * bucket bit here as well 347 * bucket bit here as well
@@ -343,10 +366,8 @@ static long pSeries_lpar_hpte_remove(unsigned long hpte_group)
343 /* don't remove a bolted entry */ 366 /* don't remove a bolted entry */
344 lpar_rc = plpar_pte_remove(H_ANDCOND, hpte_group + slot_offset, 367 lpar_rc = plpar_pte_remove(H_ANDCOND, hpte_group + slot_offset,
345 (0x1UL << 4), &dummy1, &dummy2); 368 (0x1UL << 4), &dummy1, &dummy2);
346
347 if (lpar_rc == H_Success) 369 if (lpar_rc == H_Success)
348 return i; 370 return i;
349
350 BUG_ON(lpar_rc != H_Not_Found); 371 BUG_ON(lpar_rc != H_Not_Found);
351 372
352 slot_offset++; 373 slot_offset++;
@@ -374,20 +395,28 @@ static void pSeries_lpar_hptab_clear(void)
374 * We can probably optimize here and assume the high bits of newpp are 395 * We can probably optimize here and assume the high bits of newpp are
375 * already zero. For now I am paranoid. 396 * already zero. For now I am paranoid.
376 */ 397 */
377static long pSeries_lpar_hpte_updatepp(unsigned long slot, unsigned long newpp, 398static long pSeries_lpar_hpte_updatepp(unsigned long slot,
378 unsigned long va, int large, int local) 399 unsigned long newpp,
400 unsigned long va,
401 int psize, int local)
379{ 402{
380 unsigned long lpar_rc; 403 unsigned long lpar_rc;
381 unsigned long flags = (newpp & 7) | H_AVPN; 404 unsigned long flags = (newpp & 7) | H_AVPN;
382 unsigned long avpn = va >> 23; 405 unsigned long want_v;
383 406
384 if (large) 407 want_v = hpte_encode_v(va, psize);
385 avpn &= ~0x1UL;
386 408
387 lpar_rc = plpar_pte_protect(flags, slot, (avpn << 7)); 409 DBG_LOW(" update: avpnv=%016lx, hash=%016lx, f=%x, psize: %d ... ",
410 want_v & HPTE_V_AVPN, slot, flags, psize);
388 411
389 if (lpar_rc == H_Not_Found) 412 lpar_rc = plpar_pte_protect(flags, slot, want_v & HPTE_V_AVPN);
413
414 if (lpar_rc == H_Not_Found) {
415 DBG_LOW("not found !\n");
390 return -1; 416 return -1;
417 }
418
419 DBG_LOW("ok\n");
391 420
392 BUG_ON(lpar_rc != H_Success); 421 BUG_ON(lpar_rc != H_Success);
393 422
@@ -413,21 +442,22 @@ static unsigned long pSeries_lpar_hpte_getword0(unsigned long slot)
413 return dword0; 442 return dword0;
414} 443}
415 444
416static long pSeries_lpar_hpte_find(unsigned long vpn) 445static long pSeries_lpar_hpte_find(unsigned long va, int psize)
417{ 446{
418 unsigned long hash; 447 unsigned long hash;
419 unsigned long i, j; 448 unsigned long i, j;
420 long slot; 449 long slot;
421 unsigned long hpte_v; 450 unsigned long want_v, hpte_v;
422 451
423 hash = hpt_hash(vpn, 0); 452 hash = hpt_hash(va, mmu_psize_defs[psize].shift);
453 want_v = hpte_encode_v(va, psize);
424 454
425 for (j = 0; j < 2; j++) { 455 for (j = 0; j < 2; j++) {
426 slot = (hash & htab_hash_mask) * HPTES_PER_GROUP; 456 slot = (hash & htab_hash_mask) * HPTES_PER_GROUP;
427 for (i = 0; i < HPTES_PER_GROUP; i++) { 457 for (i = 0; i < HPTES_PER_GROUP; i++) {
428 hpte_v = pSeries_lpar_hpte_getword0(slot); 458 hpte_v = pSeries_lpar_hpte_getword0(slot);
429 459
430 if ((HPTE_V_AVPN_VAL(hpte_v) == (vpn >> 11)) 460 if (HPTE_V_COMPARE(hpte_v, want_v)
431 && (hpte_v & HPTE_V_VALID) 461 && (hpte_v & HPTE_V_VALID)
432 && (!!(hpte_v & HPTE_V_SECONDARY) == j)) { 462 && (!!(hpte_v & HPTE_V_SECONDARY) == j)) {
433 /* HPTE matches */ 463 /* HPTE matches */
@@ -444,17 +474,15 @@ static long pSeries_lpar_hpte_find(unsigned long vpn)
444} 474}
445 475
446static void pSeries_lpar_hpte_updateboltedpp(unsigned long newpp, 476static void pSeries_lpar_hpte_updateboltedpp(unsigned long newpp,
447 unsigned long ea) 477 unsigned long ea,
478 int psize)
448{ 479{
449 unsigned long lpar_rc; 480 unsigned long lpar_rc, slot, vsid, va, flags;
450 unsigned long vsid, va, vpn, flags;
451 long slot;
452 481
453 vsid = get_kernel_vsid(ea); 482 vsid = get_kernel_vsid(ea);
454 va = (vsid << 28) | (ea & 0x0fffffff); 483 va = (vsid << 28) | (ea & 0x0fffffff);
455 vpn = va >> PAGE_SHIFT;
456 484
457 slot = pSeries_lpar_hpte_find(vpn); 485 slot = pSeries_lpar_hpte_find(va, psize);
458 BUG_ON(slot == -1); 486 BUG_ON(slot == -1);
459 487
460 flags = newpp & 7; 488 flags = newpp & 7;
@@ -464,18 +492,18 @@ static void pSeries_lpar_hpte_updateboltedpp(unsigned long newpp,
464} 492}
465 493
466static void pSeries_lpar_hpte_invalidate(unsigned long slot, unsigned long va, 494static void pSeries_lpar_hpte_invalidate(unsigned long slot, unsigned long va,
467 int large, int local) 495 int psize, int local)
468{ 496{
469 unsigned long avpn = va >> 23; 497 unsigned long want_v;
470 unsigned long lpar_rc; 498 unsigned long lpar_rc;
471 unsigned long dummy1, dummy2; 499 unsigned long dummy1, dummy2;
472 500
473 if (large) 501 DBG_LOW(" inval : slot=%lx, va=%016lx, psize: %d, local: %d",
474 avpn &= ~0x1UL; 502 slot, va, psize, local);
475
476 lpar_rc = plpar_pte_remove(H_AVPN, slot, (avpn << 7), &dummy1,
477 &dummy2);
478 503
504 want_v = hpte_encode_v(va, psize);
505 lpar_rc = plpar_pte_remove(H_AVPN, slot, want_v & HPTE_V_AVPN,
506 &dummy1, &dummy2);
479 if (lpar_rc == H_Not_Found) 507 if (lpar_rc == H_Not_Found)
480 return; 508 return;
481 509
@@ -497,7 +525,8 @@ void pSeries_lpar_flush_hash_range(unsigned long number, int local)
497 spin_lock_irqsave(&pSeries_lpar_tlbie_lock, flags); 525 spin_lock_irqsave(&pSeries_lpar_tlbie_lock, flags);
498 526
499 for (i = 0; i < number; i++) 527 for (i = 0; i < number; i++)
500 flush_hash_page(batch->vaddr[i], batch->pte[i], local); 528 flush_hash_page(batch->vaddr[i], batch->pte[i],
529 batch->psize, local);
501 530
502 if (lock_tlbie) 531 if (lock_tlbie)
503 spin_unlock_irqrestore(&pSeries_lpar_tlbie_lock, flags); 532 spin_unlock_irqrestore(&pSeries_lpar_tlbie_lock, flags);
diff --git a/arch/powerpc/platforms/pseries/plpar_wrappers.h b/arch/powerpc/platforms/pseries/plpar_wrappers.h
new file mode 100644
index 000000000000..3bd1b3e06003
--- /dev/null
+++ b/arch/powerpc/platforms/pseries/plpar_wrappers.h
@@ -0,0 +1,110 @@
1#ifndef _PSERIES_PLPAR_WRAPPERS_H
2#define _PSERIES_PLPAR_WRAPPERS_H
3
4#include <asm/hvcall.h>
5
6static inline long poll_pending(void)
7{
8 unsigned long dummy;
9 return plpar_hcall(H_POLL_PENDING, 0, 0, 0, 0, &dummy, &dummy, &dummy);
10}
11
12static inline long prod_processor(void)
13{
14 plpar_hcall_norets(H_PROD);
15 return 0;
16}
17
18static inline long cede_processor(void)
19{
20 plpar_hcall_norets(H_CEDE);
21 return 0;
22}
23
24static inline long vpa_call(unsigned long flags, unsigned long cpu,
25 unsigned long vpa)
26{
27 /* flags are in bits 16-18 (counting from most significant bit) */
28 flags = flags << (63 - 18);
29
30 return plpar_hcall_norets(H_REGISTER_VPA, flags, cpu, vpa);
31}
32
33static inline long unregister_vpa(unsigned long cpu, unsigned long vpa)
34{
35 return vpa_call(0x5, cpu, vpa);
36}
37
38static inline long register_vpa(unsigned long cpu, unsigned long vpa)
39{
40 return vpa_call(0x1, cpu, vpa);
41}
42
43extern void vpa_init(int cpu);
44
45static inline long plpar_pte_remove(unsigned long flags, unsigned long ptex,
46 unsigned long avpn, unsigned long *old_pteh_ret,
47 unsigned long *old_ptel_ret)
48{
49 unsigned long dummy;
50 return plpar_hcall(H_REMOVE, flags, ptex, avpn, 0, old_pteh_ret,
51 old_ptel_ret, &dummy);
52}
53
54static inline long plpar_pte_read(unsigned long flags, unsigned long ptex,
55 unsigned long *old_pteh_ret, unsigned long *old_ptel_ret)
56{
57 unsigned long dummy;
58 return plpar_hcall(H_READ, flags, ptex, 0, 0, old_pteh_ret,
59 old_ptel_ret, &dummy);
60}
61
62static inline long plpar_pte_protect(unsigned long flags, unsigned long ptex,
63 unsigned long avpn)
64{
65 return plpar_hcall_norets(H_PROTECT, flags, ptex, avpn);
66}
67
68static inline long plpar_tce_get(unsigned long liobn, unsigned long ioba,
69 unsigned long *tce_ret)
70{
71 unsigned long dummy;
72 return plpar_hcall(H_GET_TCE, liobn, ioba, 0, 0, tce_ret, &dummy,
73 &dummy);
74}
75
76static inline long plpar_tce_put(unsigned long liobn, unsigned long ioba,
77 unsigned long tceval)
78{
79 return plpar_hcall_norets(H_PUT_TCE, liobn, ioba, tceval);
80}
81
82static inline long plpar_tce_put_indirect(unsigned long liobn,
83 unsigned long ioba, unsigned long page, unsigned long count)
84{
85 return plpar_hcall_norets(H_PUT_TCE_INDIRECT, liobn, ioba, page, count);
86}
87
88static inline long plpar_tce_stuff(unsigned long liobn, unsigned long ioba,
89 unsigned long tceval, unsigned long count)
90{
91 return plpar_hcall_norets(H_STUFF_TCE, liobn, ioba, tceval, count);
92}
93
94static inline long plpar_get_term_char(unsigned long termno,
95 unsigned long *len_ret, char *buf_ret)
96{
97 unsigned long *lbuf = (unsigned long *)buf_ret; /* TODO: alignment? */
98 return plpar_hcall(H_GET_TERM_CHAR, termno, 0, 0, 0, len_ret,
99 lbuf + 0, lbuf + 1);
100}
101
102static inline long plpar_put_term_char(unsigned long termno, unsigned long len,
103 const char *buffer)
104{
105 unsigned long *lbuf = (unsigned long *)buffer; /* TODO: alignment? */
106 return plpar_hcall_norets(H_PUT_TERM_CHAR, termno, len, lbuf[0],
107 lbuf[1]);
108}
109
110#endif /* _PSERIES_PLPAR_WRAPPERS_H */
diff --git a/arch/powerpc/platforms/pseries/ras.c b/arch/powerpc/platforms/pseries/ras.c
index 6562ff4b0a82..fbd214d68b07 100644
--- a/arch/powerpc/platforms/pseries/ras.c
+++ b/arch/powerpc/platforms/pseries/ras.c
@@ -48,7 +48,7 @@
48#include <asm/ptrace.h> 48#include <asm/ptrace.h>
49#include <asm/machdep.h> 49#include <asm/machdep.h>
50#include <asm/rtas.h> 50#include <asm/rtas.h>
51#include <asm/ppcdebug.h> 51#include <asm/udbg.h>
52 52
53static unsigned char ras_log_buf[RTAS_ERROR_LOG_MAX]; 53static unsigned char ras_log_buf[RTAS_ERROR_LOG_MAX];
54static DEFINE_SPINLOCK(ras_log_buf_lock); 54static DEFINE_SPINLOCK(ras_log_buf_lock);
diff --git a/arch/powerpc/platforms/pseries/reconfig.c b/arch/powerpc/platforms/pseries/reconfig.c
index 58c61219d08e..d7d400339458 100644
--- a/arch/powerpc/platforms/pseries/reconfig.c
+++ b/arch/powerpc/platforms/pseries/reconfig.c
@@ -286,10 +286,8 @@ static struct property *new_property(const char *name, const int length,
286 return new; 286 return new;
287 287
288cleanup: 288cleanup:
289 if (new->name) 289 kfree(new->name);
290 kfree(new->name); 290 kfree(new->value);
291 if (new->value)
292 kfree(new->value);
293 kfree(new); 291 kfree(new);
294 return NULL; 292 return NULL;
295} 293}
diff --git a/arch/powerpc/platforms/pseries/rtas-fw.c b/arch/powerpc/platforms/pseries/rtas-fw.c
deleted file mode 100644
index 15d81d758ca0..000000000000
--- a/arch/powerpc/platforms/pseries/rtas-fw.c
+++ /dev/null
@@ -1,138 +0,0 @@
1/*
2 *
3 * Procedures for firmware flash updates on pSeries systems.
4 *
5 * Peter Bergner, IBM March 2001.
6 * Copyright (C) 2001 IBM.
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
14#include <stdarg.h>
15#include <linux/kernel.h>
16#include <linux/types.h>
17#include <linux/spinlock.h>
18#include <linux/module.h>
19#include <linux/init.h>
20
21#include <asm/prom.h>
22#include <asm/rtas.h>
23#include <asm/semaphore.h>
24#include <asm/machdep.h>
25#include <asm/page.h>
26#include <asm/param.h>
27#include <asm/system.h>
28#include <asm/abs_addr.h>
29#include <asm/udbg.h>
30#include <asm/delay.h>
31#include <asm/uaccess.h>
32#include <asm/systemcfg.h>
33
34#include "rtas-fw.h"
35
36struct flash_block_list_header rtas_firmware_flash_list = {0, NULL};
37
38#define FLASH_BLOCK_LIST_VERSION (1UL)
39
40static void rtas_flash_firmware(void)
41{
42 unsigned long image_size;
43 struct flash_block_list *f, *next, *flist;
44 unsigned long rtas_block_list;
45 int i, status, update_token;
46
47 update_token = rtas_token("ibm,update-flash-64-and-reboot");
48 if (update_token == RTAS_UNKNOWN_SERVICE) {
49 printk(KERN_ALERT "FLASH: ibm,update-flash-64-and-reboot is not available -- not a service partition?\n");
50 printk(KERN_ALERT "FLASH: firmware will not be flashed\n");
51 return;
52 }
53
54 /* NOTE: the "first" block list is a global var with no data
55 * blocks in the kernel data segment. We do this because
56 * we want to ensure this block_list addr is under 4GB.
57 */
58 rtas_firmware_flash_list.num_blocks = 0;
59 flist = (struct flash_block_list *)&rtas_firmware_flash_list;
60 rtas_block_list = virt_to_abs(flist);
61 if (rtas_block_list >= 4UL*1024*1024*1024) {
62 printk(KERN_ALERT "FLASH: kernel bug...flash list header addr above 4GB\n");
63 return;
64 }
65
66 printk(KERN_ALERT "FLASH: preparing saved firmware image for flash\n");
67 /* Update the block_list in place. */
68 image_size = 0;
69 for (f = flist; f; f = next) {
70 /* Translate data addrs to absolute */
71 for (i = 0; i < f->num_blocks; i++) {
72 f->blocks[i].data = (char *)virt_to_abs(f->blocks[i].data);
73 image_size += f->blocks[i].length;
74 }
75 next = f->next;
76 /* Don't translate NULL pointer for last entry */
77 if (f->next)
78 f->next = (struct flash_block_list *)virt_to_abs(f->next);
79 else
80 f->next = NULL;
81 /* make num_blocks into the version/length field */
82 f->num_blocks = (FLASH_BLOCK_LIST_VERSION << 56) | ((f->num_blocks+1)*16);
83 }
84
85 printk(KERN_ALERT "FLASH: flash image is %ld bytes\n", image_size);
86 printk(KERN_ALERT "FLASH: performing flash and reboot\n");
87 rtas_progress("Flashing \n", 0x0);
88 rtas_progress("Please Wait... ", 0x0);
89 printk(KERN_ALERT "FLASH: this will take several minutes. Do not power off!\n");
90 status = rtas_call(update_token, 1, 1, NULL, rtas_block_list);
91 switch (status) { /* should only get "bad" status */
92 case 0:
93 printk(KERN_ALERT "FLASH: success\n");
94 break;
95 case -1:
96 printk(KERN_ALERT "FLASH: hardware error. Firmware may not be not flashed\n");
97 break;
98 case -3:
99 printk(KERN_ALERT "FLASH: image is corrupt or not correct for this platform. Firmware not flashed\n");
100 break;
101 case -4:
102 printk(KERN_ALERT "FLASH: flash failed when partially complete. System may not reboot\n");
103 break;
104 default:
105 printk(KERN_ALERT "FLASH: unknown flash return code %d\n", status);
106 break;
107 }
108}
109
110void rtas_flash_bypass_warning(void)
111{
112 printk(KERN_ALERT "FLASH: firmware flash requires a reboot\n");
113 printk(KERN_ALERT "FLASH: the firmware image will NOT be flashed\n");
114}
115
116
117void rtas_fw_restart(char *cmd)
118{
119 if (rtas_firmware_flash_list.next)
120 rtas_flash_firmware();
121 rtas_restart(cmd);
122}
123
124void rtas_fw_power_off(void)
125{
126 if (rtas_firmware_flash_list.next)
127 rtas_flash_bypass_warning();
128 rtas_power_off();
129}
130
131void rtas_fw_halt(void)
132{
133 if (rtas_firmware_flash_list.next)
134 rtas_flash_bypass_warning();
135 rtas_halt();
136}
137
138EXPORT_SYMBOL(rtas_firmware_flash_list);
diff --git a/arch/powerpc/platforms/pseries/rtas-fw.h b/arch/powerpc/platforms/pseries/rtas-fw.h
deleted file mode 100644
index e70fa69974a3..000000000000
--- a/arch/powerpc/platforms/pseries/rtas-fw.h
+++ /dev/null
@@ -1,3 +0,0 @@
1void rtas_fw_restart(char *cmd);
2void rtas_fw_power_off(void);
3void rtas_fw_halt(void);
diff --git a/arch/ppc64/kernel/rtasd.c b/arch/powerpc/platforms/pseries/rtasd.c
index e26b0420b6dd..e26b0420b6dd 100644
--- a/arch/ppc64/kernel/rtasd.c
+++ b/arch/powerpc/platforms/pseries/rtasd.c
diff --git a/arch/powerpc/platforms/pseries/setup.c b/arch/powerpc/platforms/pseries/setup.c
index 10cb0f2d9b5b..a093a0d4dd69 100644
--- a/arch/powerpc/platforms/pseries/setup.c
+++ b/arch/powerpc/platforms/pseries/setup.c
@@ -58,7 +58,6 @@
58#include <asm/irq.h> 58#include <asm/irq.h>
59#include <asm/time.h> 59#include <asm/time.h>
60#include <asm/nvram.h> 60#include <asm/nvram.h>
61#include <asm/plpar_wrappers.h>
62#include "xics.h" 61#include "xics.h"
63#include <asm/firmware.h> 62#include <asm/firmware.h>
64#include <asm/pmc.h> 63#include <asm/pmc.h>
@@ -66,8 +65,9 @@
66#include <asm/ppc-pci.h> 65#include <asm/ppc-pci.h>
67#include <asm/i8259.h> 66#include <asm/i8259.h>
68#include <asm/udbg.h> 67#include <asm/udbg.h>
68#include <asm/smp.h>
69 69
70#include "rtas-fw.h" 70#include "plpar_wrappers.h"
71 71
72#ifdef DEBUG 72#ifdef DEBUG
73#define DBG(fmt...) udbg_printf(fmt) 73#define DBG(fmt...) udbg_printf(fmt)
@@ -352,6 +352,17 @@ static void pSeries_mach_cpu_die(void)
352 for(;;); 352 for(;;);
353} 353}
354 354
355static int pseries_set_dabr(unsigned long dabr)
356{
357 return plpar_hcall_norets(H_SET_DABR, dabr);
358}
359
360static int pseries_set_xdabr(unsigned long dabr)
361{
362 /* We want to catch accesses from kernel and userspace */
363 return plpar_hcall_norets(H_SET_XDABR, dabr,
364 H_DABRX_KERNEL | H_DABRX_USER);
365}
355 366
356/* 367/*
357 * Early initialization. Relocation is on but do not reference unbolted pages 368 * Early initialization. Relocation is on but do not reference unbolted pages
@@ -387,6 +398,10 @@ static void __init pSeries_init_early(void)
387 DBG("Hello World !\n"); 398 DBG("Hello World !\n");
388 } 399 }
389 400
401 if (firmware_has_feature(FW_FEATURE_DABR))
402 ppc_md.set_dabr = pseries_set_dabr;
403 else if (firmware_has_feature(FW_FEATURE_XDABR))
404 ppc_md.set_dabr = pseries_set_xdabr;
390 405
391 iommu_init_early_pSeries(); 406 iommu_init_early_pSeries();
392 407
@@ -454,6 +469,7 @@ static inline void dedicated_idle_sleep(unsigned int cpu)
454 * more. 469 * more.
455 */ 470 */
456 clear_thread_flag(TIF_POLLING_NRFLAG); 471 clear_thread_flag(TIF_POLLING_NRFLAG);
472 smp_mb__after_clear_bit();
457 473
458 /* 474 /*
459 * SMT dynamic mode. Cede will result in this thread going 475 * SMT dynamic mode. Cede will result in this thread going
@@ -466,6 +482,7 @@ static inline void dedicated_idle_sleep(unsigned int cpu)
466 cede_processor(); 482 cede_processor();
467 else 483 else
468 local_irq_enable(); 484 local_irq_enable();
485 set_thread_flag(TIF_POLLING_NRFLAG);
469 } else { 486 } else {
470 /* 487 /*
471 * Give the HV an opportunity at the processor, since we are 488 * Give the HV an opportunity at the processor, since we are
@@ -477,11 +494,11 @@ static inline void dedicated_idle_sleep(unsigned int cpu)
477 494
478static void pseries_dedicated_idle(void) 495static void pseries_dedicated_idle(void)
479{ 496{
480 long oldval;
481 struct paca_struct *lpaca = get_paca(); 497 struct paca_struct *lpaca = get_paca();
482 unsigned int cpu = smp_processor_id(); 498 unsigned int cpu = smp_processor_id();
483 unsigned long start_snooze; 499 unsigned long start_snooze;
484 unsigned long *smt_snooze_delay = &__get_cpu_var(smt_snooze_delay); 500 unsigned long *smt_snooze_delay = &__get_cpu_var(smt_snooze_delay);
501 set_thread_flag(TIF_POLLING_NRFLAG);
485 502
486 while (1) { 503 while (1) {
487 /* 504 /*
@@ -490,10 +507,7 @@ static void pseries_dedicated_idle(void)
490 */ 507 */
491 lpaca->lppaca.idle = 1; 508 lpaca->lppaca.idle = 1;
492 509
493 oldval = test_and_clear_thread_flag(TIF_NEED_RESCHED); 510 if (!need_resched()) {
494 if (!oldval) {
495 set_thread_flag(TIF_POLLING_NRFLAG);
496
497 start_snooze = __get_tb() + 511 start_snooze = __get_tb() +
498 *smt_snooze_delay * tb_ticks_per_usec; 512 *smt_snooze_delay * tb_ticks_per_usec;
499 513
@@ -516,15 +530,14 @@ static void pseries_dedicated_idle(void)
516 } 530 }
517 531
518 HMT_medium(); 532 HMT_medium();
519 clear_thread_flag(TIF_POLLING_NRFLAG);
520 } else {
521 set_need_resched();
522 } 533 }
523 534
524 lpaca->lppaca.idle = 0; 535 lpaca->lppaca.idle = 0;
525 ppc64_runlatch_on(); 536 ppc64_runlatch_on();
526 537
538 preempt_enable_no_resched();
527 schedule(); 539 schedule();
540 preempt_disable();
528 541
529 if (cpu_is_offline(cpu) && system_state == SYSTEM_RUNNING) 542 if (cpu_is_offline(cpu) && system_state == SYSTEM_RUNNING)
530 cpu_die(); 543 cpu_die();
@@ -568,7 +581,9 @@ static void pseries_shared_idle(void)
568 lpaca->lppaca.idle = 0; 581 lpaca->lppaca.idle = 0;
569 ppc64_runlatch_on(); 582 ppc64_runlatch_on();
570 583
584 preempt_enable_no_resched();
571 schedule(); 585 schedule();
586 preempt_disable();
572 587
573 if (cpu_is_offline(cpu) && system_state == SYSTEM_RUNNING) 588 if (cpu_is_offline(cpu) && system_state == SYSTEM_RUNNING)
574 cpu_die(); 589 cpu_die();
@@ -591,9 +606,9 @@ struct machdep_calls __initdata pSeries_md = {
591 .pcibios_fixup = pSeries_final_fixup, 606 .pcibios_fixup = pSeries_final_fixup,
592 .pci_probe_mode = pSeries_pci_probe_mode, 607 .pci_probe_mode = pSeries_pci_probe_mode,
593 .irq_bus_setup = pSeries_irq_bus_setup, 608 .irq_bus_setup = pSeries_irq_bus_setup,
594 .restart = rtas_fw_restart, 609 .restart = rtas_restart,
595 .power_off = rtas_fw_power_off, 610 .power_off = rtas_power_off,
596 .halt = rtas_fw_halt, 611 .halt = rtas_halt,
597 .panic = rtas_os_term, 612 .panic = rtas_os_term,
598 .cpu_die = pSeries_mach_cpu_die, 613 .cpu_die = pSeries_mach_cpu_die,
599 .get_boot_time = rtas_get_boot_time, 614 .get_boot_time = rtas_get_boot_time,
diff --git a/arch/powerpc/platforms/pseries/smp.c b/arch/powerpc/platforms/pseries/smp.c
index 9c9458ddfc25..7a243e8ccd7e 100644
--- a/arch/powerpc/platforms/pseries/smp.c
+++ b/arch/powerpc/platforms/pseries/smp.c
@@ -44,10 +44,11 @@
44#include <asm/firmware.h> 44#include <asm/firmware.h>
45#include <asm/system.h> 45#include <asm/system.h>
46#include <asm/rtas.h> 46#include <asm/rtas.h>
47#include <asm/plpar_wrappers.h>
48#include <asm/pSeries_reconfig.h> 47#include <asm/pSeries_reconfig.h>
49#include <asm/mpic.h> 48#include <asm/mpic.h>
50 49
50#include "plpar_wrappers.h"
51
51#ifdef DEBUG 52#ifdef DEBUG
52#define DBG(fmt...) udbg_printf(fmt) 53#define DBG(fmt...) udbg_printf(fmt)
53#else 54#else
diff --git a/arch/powerpc/sysdev/Makefile b/arch/powerpc/sysdev/Makefile
index 8acd21dee05d..6b7efcfc352a 100644
--- a/arch/powerpc/sysdev/Makefile
+++ b/arch/powerpc/sysdev/Makefile
@@ -5,3 +5,4 @@ obj-$(CONFIG_PPC_MPC106) += grackle.o
5obj-$(CONFIG_BOOKE) += dcr.o 5obj-$(CONFIG_BOOKE) += dcr.o
6obj-$(CONFIG_40x) += dcr.o 6obj-$(CONFIG_40x) += dcr.o
7obj-$(CONFIG_U3_DART) += u3_iommu.o 7obj-$(CONFIG_U3_DART) += u3_iommu.o
8obj-$(CONFIG_MMIO_NVRAM) += mmio_nvram.o
diff --git a/arch/powerpc/sysdev/dart.h b/arch/powerpc/sysdev/dart.h
new file mode 100644
index 000000000000..ea8f0d9eed8a
--- /dev/null
+++ b/arch/powerpc/sysdev/dart.h
@@ -0,0 +1,59 @@
1/*
2 * Copyright (C) 2004 Olof Johansson <olof@austin.ibm.com>, IBM Corporation
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 2 of the License, or
7 * (at your option) any later version.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
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
16 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 */
18
19#ifndef _POWERPC_SYSDEV_DART_H
20#define _POWERPC_SYSDEV_DART_H
21
22
23/* physical base of DART registers */
24#define DART_BASE 0xf8033000UL
25
26/* Offset from base to control register */
27#define DARTCNTL 0
28/* Offset from base to exception register */
29#define DARTEXCP 0x10
30/* Offset from base to TLB tag registers */
31#define DARTTAG 0x1000
32
33
34/* Control Register fields */
35
36/* base address of table (pfn) */
37#define DARTCNTL_BASE_MASK 0xfffff
38#define DARTCNTL_BASE_SHIFT 12
39
40#define DARTCNTL_FLUSHTLB 0x400
41#define DARTCNTL_ENABLE 0x200
42
43/* size of table in pages */
44#define DARTCNTL_SIZE_MASK 0x1ff
45#define DARTCNTL_SIZE_SHIFT 0
46
47
48/* DART table fields */
49
50#define DARTMAP_VALID 0x80000000
51#define DARTMAP_RPNMASK 0x00ffffff
52
53
54#define DART_PAGE_SHIFT 12
55#define DART_PAGE_SIZE (1 << DART_PAGE_SHIFT)
56#define DART_PAGE_FACTOR (PAGE_SHIFT - DART_PAGE_SHIFT)
57
58
59#endif /* _POWERPC_SYSDEV_DART_H */
diff --git a/arch/powerpc/sysdev/i8259.c b/arch/powerpc/sysdev/i8259.c
index 90bce6e0c191..b7ac32fdd776 100644
--- a/arch/powerpc/sysdev/i8259.c
+++ b/arch/powerpc/sysdev/i8259.c
@@ -207,6 +207,9 @@ void __init i8259_init(unsigned long intack_addr, int offset)
207 207
208 spin_unlock_irqrestore(&i8259_lock, flags); 208 spin_unlock_irqrestore(&i8259_lock, flags);
209 209
210 for (i = 0; i < NUM_ISA_INTERRUPTS; ++i)
211 irq_desc[offset + i].handler = &i8259_pic;
212
210 /* reserve our resources */ 213 /* reserve our resources */
211 setup_irq(offset + 2, &i8259_irqaction); 214 setup_irq(offset + 2, &i8259_irqaction);
212 request_resource(&ioport_resource, &pic1_iores); 215 request_resource(&ioport_resource, &pic1_iores);
@@ -216,6 +219,4 @@ void __init i8259_init(unsigned long intack_addr, int offset)
216 if (intack_addr != 0) 219 if (intack_addr != 0)
217 pci_intack = ioremap(intack_addr, 1); 220 pci_intack = ioremap(intack_addr, 1);
218 221
219 for (i = 0; i < NUM_ISA_INTERRUPTS; ++i)
220 irq_desc[offset + i].handler = &i8259_pic;
221} 222}
diff --git a/arch/ppc64/kernel/bpa_nvram.c b/arch/powerpc/sysdev/mmio_nvram.c
index 06a119cfceb5..74e0d31a3559 100644
--- a/arch/ppc64/kernel/bpa_nvram.c
+++ b/arch/powerpc/sysdev/mmio_nvram.c
@@ -1,5 +1,5 @@
1/* 1/*
2 * NVRAM for CPBW 2 * memory mapped NVRAM
3 * 3 *
4 * (C) Copyright IBM Corp. 2005 4 * (C) Copyright IBM Corp. 2005
5 * 5 *
@@ -30,54 +30,54 @@
30#include <asm/nvram.h> 30#include <asm/nvram.h>
31#include <asm/prom.h> 31#include <asm/prom.h>
32 32
33static void __iomem *bpa_nvram_start; 33static void __iomem *mmio_nvram_start;
34static long bpa_nvram_len; 34static long mmio_nvram_len;
35static spinlock_t bpa_nvram_lock = SPIN_LOCK_UNLOCKED; 35static spinlock_t mmio_nvram_lock = SPIN_LOCK_UNLOCKED;
36 36
37static ssize_t bpa_nvram_read(char *buf, size_t count, loff_t *index) 37static ssize_t mmio_nvram_read(char *buf, size_t count, loff_t *index)
38{ 38{
39 unsigned long flags; 39 unsigned long flags;
40 40
41 if (*index >= bpa_nvram_len) 41 if (*index >= mmio_nvram_len)
42 return 0; 42 return 0;
43 if (*index + count > bpa_nvram_len) 43 if (*index + count > mmio_nvram_len)
44 count = bpa_nvram_len - *index; 44 count = mmio_nvram_len - *index;
45 45
46 spin_lock_irqsave(&bpa_nvram_lock, flags); 46 spin_lock_irqsave(&mmio_nvram_lock, flags);
47 47
48 memcpy_fromio(buf, bpa_nvram_start + *index, count); 48 memcpy_fromio(buf, mmio_nvram_start + *index, count);
49 49
50 spin_unlock_irqrestore(&bpa_nvram_lock, flags); 50 spin_unlock_irqrestore(&mmio_nvram_lock, flags);
51 51
52 *index += count; 52 *index += count;
53 return count; 53 return count;
54} 54}
55 55
56static ssize_t bpa_nvram_write(char *buf, size_t count, loff_t *index) 56static ssize_t mmio_nvram_write(char *buf, size_t count, loff_t *index)
57{ 57{
58 unsigned long flags; 58 unsigned long flags;
59 59
60 if (*index >= bpa_nvram_len) 60 if (*index >= mmio_nvram_len)
61 return 0; 61 return 0;
62 if (*index + count > bpa_nvram_len) 62 if (*index + count > mmio_nvram_len)
63 count = bpa_nvram_len - *index; 63 count = mmio_nvram_len - *index;
64 64
65 spin_lock_irqsave(&bpa_nvram_lock, flags); 65 spin_lock_irqsave(&mmio_nvram_lock, flags);
66 66
67 memcpy_toio(bpa_nvram_start + *index, buf, count); 67 memcpy_toio(mmio_nvram_start + *index, buf, count);
68 68
69 spin_unlock_irqrestore(&bpa_nvram_lock, flags); 69 spin_unlock_irqrestore(&mmio_nvram_lock, flags);
70 70
71 *index += count; 71 *index += count;
72 return count; 72 return count;
73} 73}
74 74
75static ssize_t bpa_nvram_get_size(void) 75static ssize_t mmio_nvram_get_size(void)
76{ 76{
77 return bpa_nvram_len; 77 return mmio_nvram_len;
78} 78}
79 79
80int __init bpa_nvram_init(void) 80int __init mmio_nvram_init(void)
81{ 81{
82 struct device_node *nvram_node; 82 struct device_node *nvram_node;
83 unsigned long *buffer; 83 unsigned long *buffer;
@@ -97,20 +97,20 @@ int __init bpa_nvram_init(void)
97 97
98 ret = -ENODEV; 98 ret = -ENODEV;
99 nvram_addr = buffer[0]; 99 nvram_addr = buffer[0];
100 bpa_nvram_len = buffer[1]; 100 mmio_nvram_len = buffer[1];
101 if ( (!bpa_nvram_len) || (!nvram_addr) ) 101 if ( (!mmio_nvram_len) || (!nvram_addr) )
102 goto out; 102 goto out;
103 103
104 bpa_nvram_start = ioremap(nvram_addr, bpa_nvram_len); 104 mmio_nvram_start = ioremap(nvram_addr, mmio_nvram_len);
105 if (!bpa_nvram_start) 105 if (!mmio_nvram_start)
106 goto out; 106 goto out;
107 107
108 printk(KERN_INFO "BPA NVRAM, %luk mapped to %p\n", 108 printk(KERN_INFO "mmio NVRAM, %luk mapped to %p\n",
109 bpa_nvram_len >> 10, bpa_nvram_start); 109 mmio_nvram_len >> 10, mmio_nvram_start);
110 110
111 ppc_md.nvram_read = bpa_nvram_read; 111 ppc_md.nvram_read = mmio_nvram_read;
112 ppc_md.nvram_write = bpa_nvram_write; 112 ppc_md.nvram_write = mmio_nvram_write;
113 ppc_md.nvram_size = bpa_nvram_get_size; 113 ppc_md.nvram_size = mmio_nvram_get_size;
114 114
115out: 115out:
116 of_node_put(nvram_node); 116 of_node_put(nvram_node);
diff --git a/arch/powerpc/sysdev/u3_iommu.c b/arch/powerpc/sysdev/u3_iommu.c
index fba871a1bda5..543d65909812 100644
--- a/arch/powerpc/sysdev/u3_iommu.c
+++ b/arch/powerpc/sysdev/u3_iommu.c
@@ -1,5 +1,5 @@
1/* 1/*
2 * arch/ppc64/kernel/u3_iommu.c 2 * arch/powerpc/sysdev/u3_iommu.c
3 * 3 *
4 * Copyright (C) 2004 Olof Johansson <olof@austin.ibm.com>, IBM Corporation 4 * Copyright (C) 2004 Olof Johansson <olof@austin.ibm.com>, IBM Corporation
5 * 5 *
@@ -37,16 +37,16 @@
37#include <linux/vmalloc.h> 37#include <linux/vmalloc.h>
38#include <asm/io.h> 38#include <asm/io.h>
39#include <asm/prom.h> 39#include <asm/prom.h>
40#include <asm/ppcdebug.h>
41#include <asm/iommu.h> 40#include <asm/iommu.h>
42#include <asm/pci-bridge.h> 41#include <asm/pci-bridge.h>
43#include <asm/machdep.h> 42#include <asm/machdep.h>
44#include <asm/abs_addr.h> 43#include <asm/abs_addr.h>
45#include <asm/cacheflush.h> 44#include <asm/cacheflush.h>
46#include <asm/lmb.h> 45#include <asm/lmb.h>
47#include <asm/dart.h>
48#include <asm/ppc-pci.h> 46#include <asm/ppc-pci.h>
49 47
48#include "dart.h"
49
50extern int iommu_force_on; 50extern int iommu_force_on;
51 51
52/* Physical base address and size of the DART table */ 52/* Physical base address and size of the DART table */
diff --git a/arch/ppc/4xx_io/serial_sicc.c b/arch/ppc/4xx_io/serial_sicc.c
index e95c48d57571..84d96b857e4a 100644
--- a/arch/ppc/4xx_io/serial_sicc.c
+++ b/arch/ppc/4xx_io/serial_sicc.c
@@ -1145,8 +1145,8 @@ static int set_serial_info(struct SICC_info *info,
1145 info->flags = ((state->flags & ~ASYNC_INTERNAL_FLAGS) | 1145 info->flags = ((state->flags & ~ASYNC_INTERNAL_FLAGS) |
1146 (info->flags & ASYNC_INTERNAL_FLAGS)); 1146 (info->flags & ASYNC_INTERNAL_FLAGS));
1147 state->custom_divisor = new_serial.custom_divisor; 1147 state->custom_divisor = new_serial.custom_divisor;
1148 state->close_delay = new_serial.close_delay * HZ / 100; 1148 state->close_delay = msecs_to_jiffies(10 * new_serial.close_delay);
1149 state->closing_wait = new_serial.closing_wait * HZ / 100; 1149 state->closing_wait = msecs_to_jiffies(10 * new_serial.closing_wait);
1150 info->tty->low_latency = (info->flags & ASYNC_LOW_LATENCY) ? 1 : 0; 1150 info->tty->low_latency = (info->flags & ASYNC_LOW_LATENCY) ? 1 : 0;
1151 port->fifosize = new_serial.xmit_fifo_size; 1151 port->fifosize = new_serial.xmit_fifo_size;
1152 1152
@@ -1465,10 +1465,8 @@ static void siccuart_close(struct tty_struct *tty, struct file *filp)
1465 info->event = 0; 1465 info->event = 0;
1466 info->tty = NULL; 1466 info->tty = NULL;
1467 if (info->blocked_open) { 1467 if (info->blocked_open) {
1468 if (info->state->close_delay) { 1468 if (info->state->close_delay)
1469 set_current_state(TASK_INTERRUPTIBLE); 1469 schedule_timeout_interruptible(info->state->close_delay);
1470 schedule_timeout(info->state->close_delay);
1471 }
1472 wake_up_interruptible(&info->open_wait); 1470 wake_up_interruptible(&info->open_wait);
1473 } 1471 }
1474 info->flags &= ~(ASYNC_NORMAL_ACTIVE|ASYNC_CLOSING); 1472 info->flags &= ~(ASYNC_NORMAL_ACTIVE|ASYNC_CLOSING);
@@ -1496,7 +1494,7 @@ static void siccuart_wait_until_sent(struct tty_struct *tty, int timeout)
1496 * Note: we have to use pretty tight timings here to satisfy 1494 * Note: we have to use pretty tight timings here to satisfy
1497 * the NIST-PCTS. 1495 * the NIST-PCTS.
1498 */ 1496 */
1499 char_time = (info->timeout - HZ/50) / info->port->fifosize; 1497 char_time = (info->timeout - msecs_to_jiffies(20)) / info->port->fifosize;
1500 char_time = char_time / 5; 1498 char_time = char_time / 5;
1501 if (char_time == 0) 1499 if (char_time == 0)
1502 char_time = 1; 1500 char_time = 1;
@@ -1521,8 +1519,7 @@ static void siccuart_wait_until_sent(struct tty_struct *tty, int timeout)
1521 tty->index, jiffies, 1519 tty->index, jiffies,
1522 expire, char_time); 1520 expire, char_time);
1523 while ((readb(info->port->uart_base + BL_SICC_LSR) & _LSR_TX_ALL) != _LSR_TX_ALL) { 1521 while ((readb(info->port->uart_base + BL_SICC_LSR) & _LSR_TX_ALL) != _LSR_TX_ALL) {
1524 set_current_state(TASK_INTERRUPTIBLE); 1522 schedule_timeout_interruptible(char_time);
1525 schedule_timeout(char_time);
1526 if (signal_pending(current)) 1523 if (signal_pending(current))
1527 break; 1524 break;
1528 if (timeout && time_after(jiffies, expire)) 1525 if (timeout && time_after(jiffies, expire))
@@ -1773,7 +1770,7 @@ int __init siccuart_init(void)
1773 for (i = 0; i < SERIAL_SICC_NR; i++) { 1770 for (i = 0; i < SERIAL_SICC_NR; i++) {
1774 struct SICC_state *state = sicc_state + i; 1771 struct SICC_state *state = sicc_state + i;
1775 state->line = i; 1772 state->line = i;
1776 state->close_delay = 5 * HZ / 10; 1773 state->close_delay = msecs_to_jiffies(500);
1777 state->closing_wait = 30 * HZ; 1774 state->closing_wait = 30 * HZ;
1778 spin_lock_init(&state->sicc_lock); 1775 spin_lock_init(&state->sicc_lock);
1779 } 1776 }
diff --git a/arch/ppc/8260_io/fcc_enet.c b/arch/ppc/8260_io/fcc_enet.c
index 2086c6ad1147..4edeede9ccfd 100644
--- a/arch/ppc/8260_io/fcc_enet.c
+++ b/arch/ppc/8260_io/fcc_enet.c
@@ -1309,8 +1309,7 @@ static void mii_dm9161_wait(uint mii_reg, struct net_device *dev)
1309 1309
1310 /* Davicom takes a bit to come up after a reset, 1310 /* Davicom takes a bit to come up after a reset,
1311 * so wait here for a bit */ 1311 * so wait here for a bit */
1312 set_current_state(TASK_UNINTERRUPTIBLE); 1312 schedule_timeout_uninterruptible(timeout);
1313 schedule_timeout(timeout);
1314} 1313}
1315 1314
1316static phy_info_t phy_info_dm9161 = { 1315static phy_info_t phy_info_dm9161 = {
diff --git a/arch/ppc/8xx_io/commproc.c b/arch/ppc/8xx_io/commproc.c
index b42789f8eb76..579cd40258b9 100644
--- a/arch/ppc/8xx_io/commproc.c
+++ b/arch/ppc/8xx_io/commproc.c
@@ -388,9 +388,8 @@ void m8xx_cpm_dpinit(void)
388 388
389/* 389/*
390 * Allocate the requested size worth of DP memory. 390 * Allocate the requested size worth of DP memory.
391 * This function used to return an index into the DPRAM area. 391 * This function returns an offset into the DPRAM area.
392 * Now it returns the actuall physical address of that area. 392 * Use cpm_dpram_addr() to get the virtual address of the area.
393 * use m8xx_cpm_dpram_offset() to get the index
394 */ 393 */
395uint cpm_dpalloc(uint size, uint align) 394uint cpm_dpalloc(uint size, uint align)
396{ 395{
diff --git a/arch/ppc/8xx_io/cs4218_tdm.c b/arch/ppc/8xx_io/cs4218_tdm.c
index 532caa388dc2..49eb2a7e65c0 100644
--- a/arch/ppc/8xx_io/cs4218_tdm.c
+++ b/arch/ppc/8xx_io/cs4218_tdm.c
@@ -1013,8 +1013,7 @@ static void CS_IrqCleanup(void)
1013 */ 1013 */
1014 cpm_free_handler(CPMVEC_SMC2); 1014 cpm_free_handler(CPMVEC_SMC2);
1015 1015
1016 if (beep_buf) 1016 kfree(beep_buf);
1017 kfree(beep_buf);
1018 kd_mksound = orig_mksound; 1017 kd_mksound = orig_mksound;
1019} 1018}
1020#endif /* MODULE */ 1019#endif /* MODULE */
diff --git a/arch/ppc/Kconfig b/arch/ppc/Kconfig
index 114b90fdea24..8fa51b0a32d2 100644
--- a/arch/ppc/Kconfig
+++ b/arch/ppc/Kconfig
@@ -746,6 +746,16 @@ config MPC834x
746 bool 746 bool
747 default y if MPC834x_SYS 747 default y if MPC834x_SYS
748 748
749config CPM1
750 bool
751 depends on 8xx
752 default y
753 help
754 The CPM1 (Communications Processor Module) is a coprocessor on
755 embedded CPUs made by Motorola. Selecting this option means that
756 you wish to build a kernel for a machine with a CPM1 coprocessor
757 on it (8xx, 827x, 8560).
758
749config CPM2 759config CPM2
750 bool 760 bool
751 depends on 8260 || MPC8560 || MPC8555 761 depends on 8260 || MPC8560 || MPC8555
@@ -1247,6 +1257,14 @@ source "drivers/pci/Kconfig"
1247 1257
1248source "drivers/pcmcia/Kconfig" 1258source "drivers/pcmcia/Kconfig"
1249 1259
1260config RAPIDIO
1261 bool "RapidIO support" if MPC8540 || MPC8560
1262 help
1263 If you say Y here, the kernel will include drivers and
1264 infrastructure code to support RapidIO interconnect devices.
1265
1266source "drivers/rapidio/Kconfig"
1267
1250endmenu 1268endmenu
1251 1269
1252menu "Advanced setup" 1270menu "Advanced setup"
diff --git a/arch/ppc/Makefile b/arch/ppc/Makefile
index 94d5716fa7c3..e719a4933af1 100644
--- a/arch/ppc/Makefile
+++ b/arch/ppc/Makefile
@@ -66,7 +66,8 @@ head-$(CONFIG_PPC_FPU) += arch/powerpc/kernel/fpu.o
66core-y += arch/ppc/kernel/ arch/powerpc/kernel/ \ 66core-y += arch/ppc/kernel/ arch/powerpc/kernel/ \
67 arch/ppc/platforms/ \ 67 arch/ppc/platforms/ \
68 arch/ppc/mm/ arch/ppc/lib/ \ 68 arch/ppc/mm/ arch/ppc/lib/ \
69 arch/ppc/syslib/ arch/powerpc/sysdev/ 69 arch/ppc/syslib/ arch/powerpc/sysdev/ \
70 arch/powerpc/lib/
70core-$(CONFIG_4xx) += arch/ppc/platforms/4xx/ 71core-$(CONFIG_4xx) += arch/ppc/platforms/4xx/
71core-$(CONFIG_83xx) += arch/ppc/platforms/83xx/ 72core-$(CONFIG_83xx) += arch/ppc/platforms/83xx/
72core-$(CONFIG_85xx) += arch/ppc/platforms/85xx/ 73core-$(CONFIG_85xx) += arch/ppc/platforms/85xx/
diff --git a/arch/ppc/boot/simple/Makefile b/arch/ppc/boot/simple/Makefile
index b7bd8f61a4ad..82df88b01bbe 100644
--- a/arch/ppc/boot/simple/Makefile
+++ b/arch/ppc/boot/simple/Makefile
@@ -67,6 +67,12 @@ zimageinitrd-$(CONFIG_BAMBOO) := zImage.initrd-TREE
67 entrypoint-$(CONFIG_BAMBOO) := 0x01000000 67 entrypoint-$(CONFIG_BAMBOO) := 0x01000000
68 extra.o-$(CONFIG_BAMBOO) := pibs.o 68 extra.o-$(CONFIG_BAMBOO) := pibs.o
69 69
70 zimage-$(CONFIG_BUBINGA) := zImage-TREE
71zimageinitrd-$(CONFIG_BUBINGA) := zImage.initrd-TREE
72 end-$(CONFIG_BUBINGA) := bubinga
73 entrypoint-$(CONFIG_BUBINGA) := 0x01000000
74 extra.o-$(CONFIG_BUBINGA) := openbios.o
75
70 zimage-$(CONFIG_EBONY) := zImage-TREE 76 zimage-$(CONFIG_EBONY) := zImage-TREE
71zimageinitrd-$(CONFIG_EBONY) := zImage.initrd-TREE 77zimageinitrd-$(CONFIG_EBONY) := zImage.initrd-TREE
72 end-$(CONFIG_EBONY) := ebony 78 end-$(CONFIG_EBONY) := ebony
@@ -79,12 +85,30 @@ zimageinitrd-$(CONFIG_LUAN) := zImage.initrd-TREE
79 entrypoint-$(CONFIG_LUAN) := 0x01000000 85 entrypoint-$(CONFIG_LUAN) := 0x01000000
80 extra.o-$(CONFIG_LUAN) := pibs.o 86 extra.o-$(CONFIG_LUAN) := pibs.o
81 87
88 zimage-$(CONFIG_YUCCA) := zImage-TREE
89zimageinitrd-$(CONFIG_YUCCA) := zImage.initrd-TREE
90 end-$(CONFIG_YUCCA) := yucca
91 entrypoint-$(CONFIG_YUCCA) := 0x01000000
92 extra.o-$(CONFIG_YUCCA) := pibs.o
93
82 zimage-$(CONFIG_OCOTEA) := zImage-TREE 94 zimage-$(CONFIG_OCOTEA) := zImage-TREE
83zimageinitrd-$(CONFIG_OCOTEA) := zImage.initrd-TREE 95zimageinitrd-$(CONFIG_OCOTEA) := zImage.initrd-TREE
84 end-$(CONFIG_OCOTEA) := ocotea 96 end-$(CONFIG_OCOTEA) := ocotea
85 entrypoint-$(CONFIG_OCOTEA) := 0x01000000 97 entrypoint-$(CONFIG_OCOTEA) := 0x01000000
86 extra.o-$(CONFIG_OCOTEA) := pibs.o 98 extra.o-$(CONFIG_OCOTEA) := pibs.o
87 99
100 zimage-$(CONFIG_SYCAMORE) := zImage-TREE
101zimageinitrd-$(CONFIG_SYCAMORE) := zImage.initrd-TREE
102 end-$(CONFIG_SYCAMORE) := sycamore
103 entrypoint-$(CONFIG_SYCAMORE) := 0x01000000
104 extra.o-$(CONFIG_SYCAMORE) := openbios.o
105
106 zimage-$(CONFIG_WALNUT) := zImage-TREE
107zimageinitrd-$(CONFIG_WALNUT) := zImage.initrd-TREE
108 end-$(CONFIG_WALNUT) := walnut
109 entrypoint-$(CONFIG_WALNUT) := 0x01000000
110 extra.o-$(CONFIG_WALNUT) := openbios.o
111
88 extra.o-$(CONFIG_EV64260) := misc-ev64260.o 112 extra.o-$(CONFIG_EV64260) := misc-ev64260.o
89 end-$(CONFIG_EV64260) := ev64260 113 end-$(CONFIG_EV64260) := ev64260
90 cacheflag-$(CONFIG_EV64260) := -include $(clear_L2_L3) 114 cacheflag-$(CONFIG_EV64260) := -include $(clear_L2_L3)
@@ -162,7 +186,8 @@ OBJCOPY_ARGS := -O elf32-powerpc
162 186
163# head.o and relocate.o must be at the start. 187# head.o and relocate.o must be at the start.
164boot-y := head.o relocate.o $(extra.o-y) $(misc-y) 188boot-y := head.o relocate.o $(extra.o-y) $(misc-y)
165boot-$(CONFIG_40x) += embed_config.o 189boot-$(CONFIG_REDWOOD_5) += embed_config.o
190boot-$(CONFIG_REDWOOD_6) += embed_config.o
166boot-$(CONFIG_8xx) += embed_config.o 191boot-$(CONFIG_8xx) += embed_config.o
167boot-$(CONFIG_8260) += embed_config.o 192boot-$(CONFIG_8260) += embed_config.o
168boot-$(CONFIG_BSEIP) += iic.o 193boot-$(CONFIG_BSEIP) += iic.o
diff --git a/arch/ppc/boot/simple/misc.c b/arch/ppc/boot/simple/misc.c
index e02de5b467a4..f415d6c62362 100644
--- a/arch/ppc/boot/simple/misc.c
+++ b/arch/ppc/boot/simple/misc.c
@@ -23,7 +23,7 @@
23#include <asm/page.h> 23#include <asm/page.h>
24#include <asm/mmu.h> 24#include <asm/mmu.h>
25#include <asm/bootinfo.h> 25#include <asm/bootinfo.h>
26#ifdef CONFIG_44x 26#ifdef CONFIG_4xx
27#include <asm/ibm4xx.h> 27#include <asm/ibm4xx.h>
28#endif 28#endif
29#include <asm/reg.h> 29#include <asm/reg.h>
@@ -88,6 +88,14 @@ get_mem_size(void)
88 return 0; 88 return 0;
89} 89}
90 90
91#if defined(CONFIG_40x)
92#define PPC4xx_EMAC0_MR0 EMAC0_BASE
93#endif
94
95#if defined(CONFIG_44x) && defined(PPC44x_EMAC0_MR0)
96#define PPC4xx_EMAC0_MR0 PPC44x_EMAC0_MR0
97#endif
98
91struct bi_record * 99struct bi_record *
92decompress_kernel(unsigned long load_addr, int num_words, unsigned long cksum) 100decompress_kernel(unsigned long load_addr, int num_words, unsigned long cksum)
93{ 101{
@@ -103,13 +111,13 @@ decompress_kernel(unsigned long load_addr, int num_words, unsigned long cksum)
103 com_port = serial_init(0, NULL); 111 com_port = serial_init(0, NULL);
104#endif 112#endif
105 113
106#if defined(CONFIG_44x) && defined(PPC44x_EMAC0_MR0) 114#if defined(PPC4xx_EMAC0_MR0)
107 /* Reset MAL */ 115 /* Reset MAL */
108 mtdcr(DCRN_MALCR(DCRN_MAL_BASE), MALCR_MMSR); 116 mtdcr(DCRN_MALCR(DCRN_MAL_BASE), MALCR_MMSR);
109 /* Wait for reset */ 117 /* Wait for reset */
110 while (mfdcr(DCRN_MALCR(DCRN_MAL_BASE)) & MALCR_MMSR) {}; 118 while (mfdcr(DCRN_MALCR(DCRN_MAL_BASE)) & MALCR_MMSR) {};
111 /* Reset EMAC */ 119 /* Reset EMAC */
112 *(volatile unsigned long *)PPC44x_EMAC0_MR0 = 0x20000000; 120 *(volatile unsigned long *)PPC4xx_EMAC0_MR0 = 0x20000000;
113 __asm__ __volatile__("eieio"); 121 __asm__ __volatile__("eieio");
114#endif 122#endif
115 123
@@ -164,7 +172,9 @@ decompress_kernel(unsigned long load_addr, int num_words, unsigned long cksum)
164 puts(" "); puthex((unsigned long)(&__ramdisk_end));puts("\n"); 172 puts(" "); puthex((unsigned long)(&__ramdisk_end));puts("\n");
165 } 173 }
166 174
175#ifndef CONFIG_40x /* don't overwrite the 40x image located at 0x00400000! */
167 avail_ram = (char *)0x00400000; 176 avail_ram = (char *)0x00400000;
177#endif
168 end_avail = (char *)0x00800000; 178 end_avail = (char *)0x00800000;
169 puts("avail ram: "); puthex((unsigned long)avail_ram); puts(" "); 179 puts("avail ram: "); puthex((unsigned long)avail_ram); puts(" ");
170 puthex((unsigned long)end_avail); puts("\n"); 180 puthex((unsigned long)end_avail); puts("\n");
diff --git a/arch/ppc/boot/simple/openbios.c b/arch/ppc/boot/simple/openbios.c
index c732b6d70cfb..81f11d8b30a7 100644
--- a/arch/ppc/boot/simple/openbios.c
+++ b/arch/ppc/boot/simple/openbios.c
@@ -1,19 +1,43 @@
1/* 1/*
2 * arch/ppc/boot/simple/openbios.c 2 * arch/ppc/boot/simple/openbios.c
3 * 3 *
4 * 2005 (c) SYSGO AG - g.jaeger@sysgo.com 4 * Copyright (c) 2005 DENX Software Engineering
5 * Stefan Roese <sr@denx.de>
6 *
7 * Based on original work by
8 * 2005 (c) SYSGO AG - g.jaeger@sysgo.com
9 *
5 * This file is licensed under the terms of the GNU General Public 10 * This file is licensed under the terms of the GNU General Public
6 * License version 2. This program is licensed "as is" without 11 * License version 2. This program is licensed "as is" without
7 * any warranty of any kind, whether express or implied. 12 * any warranty of any kind, whether express or implied.
8 * 13 *
9 * Derived from arch/ppc/boot/simple/pibs.c (from MontaVista)
10 */ 14 */
11 15
12#include <linux/types.h> 16#include <linux/types.h>
13#include <linux/config.h> 17#include <linux/config.h>
14#include <linux/string.h> 18#include <linux/string.h>
15#include <asm/ppcboot.h> 19#include <asm/ppcboot.h>
16#include <platforms/4xx/ebony.h> 20#include <asm/ibm4xx.h>
21#include <asm/reg.h>
22#ifdef CONFIG_40x
23#include <asm/io.h>
24#endif
25
26#if defined(CONFIG_BUBINGA)
27#define BOARD_INFO_VECTOR 0xFFF80B50 /* openbios 1.19 moved this vector down - armin */
28#else
29#define BOARD_INFO_VECTOR 0xFFFE0B50
30#endif
31
32#ifdef CONFIG_40x
33/* Supply a default Ethernet address for those eval boards that don't
34 * ship with one. This is an address from the MBX board I have, so
35 * it is unlikely you will find it on your network.
36 */
37static ushort def_enet_addr[] = { 0x0800, 0x3e26, 0x1559 };
38
39extern unsigned long timebase_period_ns;
40#endif /* CONFIG_40x */
17 41
18extern unsigned long decompress_kernel(unsigned long load_addr, int num_words, 42extern unsigned long decompress_kernel(unsigned long load_addr, int num_words,
19 unsigned long cksum); 43 unsigned long cksum);
@@ -23,15 +47,85 @@ extern unsigned long decompress_kernel(unsigned long load_addr, int num_words,
23bd_t hold_resid_buf __attribute__ ((__section__ (".data.boot"))); 47bd_t hold_resid_buf __attribute__ ((__section__ (".data.boot")));
24bd_t *hold_residual = &hold_resid_buf; 48bd_t *hold_residual = &hold_resid_buf;
25 49
50typedef struct openbios_board_info {
51 unsigned char bi_s_version[4]; /* Version of this structure */
52 unsigned char bi_r_version[30]; /* Version of the IBM ROM */
53 unsigned int bi_memsize; /* DRAM installed, in bytes */
54#ifdef CONFIG_405EP
55 unsigned char bi_enetaddr[2][6]; /* Local Ethernet MAC address */
56#else /* CONFIG_405EP */
57 unsigned char bi_enetaddr[6]; /* Local Ethernet MAC address */
58#endif /* CONFIG_405EP */
59 unsigned char bi_pci_enetaddr[6]; /* PCI Ethernet MAC address */
60 unsigned int bi_intfreq; /* Processor speed, in Hz */
61 unsigned int bi_busfreq; /* PLB Bus speed, in Hz */
62 unsigned int bi_pci_busfreq; /* PCI Bus speed, in Hz */
63#ifdef CONFIG_405EP
64 unsigned int bi_opb_busfreq; /* OPB Bus speed, in Hz */
65 unsigned int bi_pllouta_freq; /* PLL OUTA speed, in Hz */
66#endif /* CONFIG_405EP */
67} openbios_bd_t;
68
26void * 69void *
27load_kernel(unsigned long load_addr, int num_words, unsigned long cksum, 70load_kernel(unsigned long load_addr, int num_words, unsigned long cksum,
28 void *ign1, void *ign2) 71 void *ign1, void *ign2)
29{ 72{
30 decompress_kernel(load_addr, num_words, cksum); 73#ifdef CONFIG_40x
74 openbios_bd_t *openbios_bd = NULL;
75 openbios_bd_t *(*get_board_info)(void) =
76 (openbios_bd_t *(*)(void))(*(unsigned long *)BOARD_INFO_VECTOR);
77
78 /*
79 * On 40x platforms we not only need the MAC-addresses, but also the
80 * clocks and memsize. Now try to get all values using the OpenBIOS
81 * "get_board_info()" callback.
82 */
83 if ((openbios_bd = get_board_info()) != NULL) {
84 /*
85 * Copy bd_info from OpenBIOS struct into U-Boot struct
86 * used by kernel
87 */
88 hold_residual->bi_memsize = openbios_bd->bi_memsize;
89 hold_residual->bi_intfreq = openbios_bd->bi_intfreq;
90 hold_residual->bi_busfreq = openbios_bd->bi_busfreq;
91 hold_residual->bi_pci_busfreq = openbios_bd->bi_pci_busfreq;
92 memcpy(hold_residual->bi_pci_enetaddr, openbios_bd->bi_pci_enetaddr, 6);
93#ifdef CONFIG_405EP
94 memcpy(hold_residual->bi_enetaddr, openbios_bd->bi_enetaddr[0], 6);
95 memcpy(hold_residual->bi_enet1addr, openbios_bd->bi_enetaddr[1], 6);
96 hold_residual->bi_opbfreq = openbios_bd->bi_opb_busfreq;
97 hold_residual->bi_procfreq = openbios_bd->bi_pllouta_freq;
98#else /* CONFIG_405EP */
99 memcpy(hold_residual->bi_enetaddr, openbios_bd->bi_enetaddr, 6);
100#endif /* CONFIG_405EP */
101 } else {
102 /* Hmmm...better try to stuff some defaults.
103 */
104 hold_residual->bi_memsize = 16 * 1024 * 1024;
105 hold_residual->bi_intfreq = 200000000;
106 hold_residual->bi_busfreq = 100000000;
107 hold_residual->bi_pci_busfreq = 66666666;
108
109 /*
110 * Only supply one mac-address in this fallback
111 */
112 memcpy(hold_residual->bi_enetaddr, (void *)def_enet_addr, 6);
113#ifdef CONFIG_405EP
114 hold_residual->bi_opbfreq = 50000000;
115 hold_residual->bi_procfreq = 200000000;
116#endif /* CONFIG_405EP */
117 }
31 118
119 timebase_period_ns = 1000000000 / hold_residual->bi_intfreq;
120#endif /* CONFIG_40x */
121
122#ifdef CONFIG_440GP
32 /* simply copy the MAC addresses */ 123 /* simply copy the MAC addresses */
33 memcpy(hold_residual->bi_enetaddr, (char *)EBONY_OPENBIOS_MAC_BASE, 6); 124 memcpy(hold_residual->bi_enetaddr, (char *)OPENBIOS_MAC_BASE, 6);
34 memcpy(hold_residual->bi_enet1addr, (char *)(EBONY_OPENBIOS_MAC_BASE+EBONY_OPENBIOS_MAC_OFFSET), 6); 125 memcpy(hold_residual->bi_enet1addr, (char *)(OPENBIOS_MAC_BASE+OPENBIOS_MAC_OFFSET), 6);
126#endif /* CONFIG_440GP */
127
128 decompress_kernel(load_addr, num_words, cksum);
35 129
36 return (void *)hold_residual; 130 return (void *)hold_residual;
37} 131}
diff --git a/arch/ppc/configs/ev64360_defconfig b/arch/ppc/configs/ev64360_defconfig
index de9bbb791db9..d471e578dcb5 100644
--- a/arch/ppc/configs/ev64360_defconfig
+++ b/arch/ppc/configs/ev64360_defconfig
@@ -1,17 +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.13-rc5 3# Linux kernel version: 2.6.14
4# Fri Aug 5 15:18:23 2005 4# Fri Oct 28 19:15:34 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_GENERIC_CALIBRATE_DELAY=y
10CONFIG_HAVE_DEC_LOCK=y
11CONFIG_PPC=y 10CONFIG_PPC=y
12CONFIG_PPC32=y 11CONFIG_PPC32=y
13CONFIG_GENERIC_NVRAM=y 12CONFIG_GENERIC_NVRAM=y
14CONFIG_SCHED_NO_NO_OMIT_FRAME_POINTER=y 13CONFIG_SCHED_NO_NO_OMIT_FRAME_POINTER=y
14CONFIG_ARCH_MAY_HAVE_PC_FDC=y
15 15
16# 16#
17# Code maturity level options 17# Code maturity level options
@@ -26,6 +26,7 @@ CONFIG_INIT_ENV_ARG_LIMIT=32
26# General setup 26# General setup
27# 27#
28CONFIG_LOCALVERSION="" 28CONFIG_LOCALVERSION=""
29CONFIG_LOCALVERSION_AUTO=y
29CONFIG_SWAP=y 30CONFIG_SWAP=y
30CONFIG_SYSVIPC=y 31CONFIG_SYSVIPC=y
31CONFIG_POSIX_MQUEUE=y 32CONFIG_POSIX_MQUEUE=y
@@ -35,6 +36,7 @@ CONFIG_SYSCTL=y
35CONFIG_HOTPLUG=y 36CONFIG_HOTPLUG=y
36CONFIG_KOBJECT_UEVENT=y 37CONFIG_KOBJECT_UEVENT=y
37# CONFIG_IKCONFIG is not set 38# CONFIG_IKCONFIG is not set
39CONFIG_INITRAMFS_SOURCE=""
38# CONFIG_EMBEDDED is not set 40# CONFIG_EMBEDDED is not set
39CONFIG_KALLSYMS=y 41CONFIG_KALLSYMS=y
40# CONFIG_KALLSYMS_EXTRA_PASS is not set 42# CONFIG_KALLSYMS_EXTRA_PASS is not set
@@ -74,7 +76,7 @@ CONFIG_TAU=y
74# CONFIG_TAU_AVERAGE is not set 76# CONFIG_TAU_AVERAGE is not set
75# CONFIG_KEXEC is not set 77# CONFIG_KEXEC is not set
76# CONFIG_CPU_FREQ is not set 78# CONFIG_CPU_FREQ is not set
77# CONFIG_PM is not set 79# CONFIG_WANT_EARLY_SERIAL is not set
78CONFIG_PPC_STD_MMU=y 80CONFIG_PPC_STD_MMU=y
79CONFIG_NOT_COHERENT_CACHE=y 81CONFIG_NOT_COHERENT_CACHE=y
80 82
@@ -86,22 +88,18 @@ CONFIG_NOT_COHERENT_CACHE=y
86# CONFIG_KATANA is not set 88# CONFIG_KATANA is not set
87# CONFIG_WILLOW is not set 89# CONFIG_WILLOW is not set
88# CONFIG_CPCI690 is not set 90# CONFIG_CPCI690 is not set
89# CONFIG_PCORE is not set
90# CONFIG_POWERPMC250 is not set 91# CONFIG_POWERPMC250 is not set
91# CONFIG_CHESTNUT is not set 92# CONFIG_CHESTNUT is not set
92# CONFIG_SPRUCE is not set 93# CONFIG_SPRUCE is not set
93# CONFIG_HDPU is not set 94# CONFIG_HDPU is not set
94# CONFIG_EV64260 is not set 95# CONFIG_EV64260 is not set
95# CONFIG_LOPEC is not set 96# CONFIG_LOPEC is not set
96# CONFIG_MCPN765 is not set
97# CONFIG_MVME5100 is not set 97# CONFIG_MVME5100 is not set
98# CONFIG_PPLUS is not set 98# CONFIG_PPLUS is not set
99# CONFIG_PRPMC750 is not set 99# CONFIG_PRPMC750 is not set
100# CONFIG_PRPMC800 is not set 100# CONFIG_PRPMC800 is not set
101# CONFIG_SANDPOINT is not set 101# CONFIG_SANDPOINT is not set
102# CONFIG_RADSTONE_PPC7D is not set 102# CONFIG_RADSTONE_PPC7D is not set
103# CONFIG_ADIR is not set
104# CONFIG_K2 is not set
105# CONFIG_PAL4 is not set 103# CONFIG_PAL4 is not set
106# CONFIG_GEMINI is not set 104# CONFIG_GEMINI is not set
107# CONFIG_EST8260 is not set 105# CONFIG_EST8260 is not set
@@ -138,10 +136,13 @@ CONFIG_FLATMEM_MANUAL=y
138# CONFIG_SPARSEMEM_MANUAL is not set 136# CONFIG_SPARSEMEM_MANUAL is not set
139CONFIG_FLATMEM=y 137CONFIG_FLATMEM=y
140CONFIG_FLAT_NODE_MEM_MAP=y 138CONFIG_FLAT_NODE_MEM_MAP=y
139# CONFIG_SPARSEMEM_STATIC is not set
141CONFIG_BINFMT_ELF=y 140CONFIG_BINFMT_ELF=y
142CONFIG_BINFMT_MISC=y 141CONFIG_BINFMT_MISC=y
143CONFIG_CMDLINE_BOOL=y 142CONFIG_CMDLINE_BOOL=y
144CONFIG_CMDLINE="console=ttyMM0,115200 root=/dev/mtdblock1 rw rootfstype=jffs2" 143CONFIG_CMDLINE="console=ttyMM0,115200 root=/dev/mtdblock1 rw rootfstype=jffs2"
144# CONFIG_PM is not set
145# CONFIG_SOFTWARE_SUSPEND is not set
145CONFIG_SECCOMP=y 146CONFIG_SECCOMP=y
146CONFIG_ISA_DMA_API=y 147CONFIG_ISA_DMA_API=y
147 148
@@ -152,7 +153,6 @@ CONFIG_GENERIC_ISA_DMA=y
152CONFIG_PCI=y 153CONFIG_PCI=y
153CONFIG_PCI_DOMAINS=y 154CONFIG_PCI_DOMAINS=y
154# CONFIG_PCI_LEGACY_PROC is not set 155# CONFIG_PCI_LEGACY_PROC is not set
155# CONFIG_PCI_NAMES is not set
156 156
157# 157#
158# PCCARD (PCMCIA/CardBus) support 158# PCCARD (PCMCIA/CardBus) support
@@ -206,14 +206,19 @@ CONFIG_SYN_COOKIES=y
206# CONFIG_INET_ESP is not set 206# CONFIG_INET_ESP is not set
207# CONFIG_INET_IPCOMP is not set 207# CONFIG_INET_IPCOMP is not set
208# CONFIG_INET_TUNNEL is not set 208# CONFIG_INET_TUNNEL is not set
209CONFIG_IP_TCPDIAG=y 209CONFIG_INET_DIAG=y
210# CONFIG_IP_TCPDIAG_IPV6 is not set 210CONFIG_INET_TCP_DIAG=y
211# CONFIG_TCP_CONG_ADVANCED is not set 211# CONFIG_TCP_CONG_ADVANCED is not set
212CONFIG_TCP_CONG_BIC=y 212CONFIG_TCP_CONG_BIC=y
213# CONFIG_IPV6 is not set 213# CONFIG_IPV6 is not set
214# CONFIG_NETFILTER is not set 214# CONFIG_NETFILTER is not set
215 215
216# 216#
217# DCCP Configuration (EXPERIMENTAL)
218#
219# CONFIG_IP_DCCP is not set
220
221#
217# SCTP Configuration (EXPERIMENTAL) 222# SCTP Configuration (EXPERIMENTAL)
218# 223#
219# CONFIG_IP_SCTP is not set 224# CONFIG_IP_SCTP is not set
@@ -239,6 +244,7 @@ CONFIG_TCP_CONG_BIC=y
239# CONFIG_HAMRADIO is not set 244# CONFIG_HAMRADIO is not set
240# CONFIG_IRDA is not set 245# CONFIG_IRDA is not set
241# CONFIG_BT is not set 246# CONFIG_BT is not set
247# CONFIG_IEEE80211 is not set
242 248
243# 249#
244# Device Drivers 250# Device Drivers
@@ -252,6 +258,11 @@ CONFIG_PREVENT_FIRMWARE_BUILD=y
252# CONFIG_FW_LOADER is not set 258# CONFIG_FW_LOADER is not set
253 259
254# 260#
261# Connector - unified userspace <-> kernelspace linker
262#
263# CONFIG_CONNECTOR is not set
264
265#
255# Memory Technology Devices (MTD) 266# Memory Technology Devices (MTD)
256# 267#
257CONFIG_MTD=y 268CONFIG_MTD=y
@@ -358,7 +369,6 @@ CONFIG_BLK_DEV_RAM=y
358CONFIG_BLK_DEV_RAM_COUNT=16 369CONFIG_BLK_DEV_RAM_COUNT=16
359CONFIG_BLK_DEV_RAM_SIZE=32768 370CONFIG_BLK_DEV_RAM_SIZE=32768
360CONFIG_BLK_DEV_INITRD=y 371CONFIG_BLK_DEV_INITRD=y
361CONFIG_INITRAMFS_SOURCE=""
362# CONFIG_LBD is not set 372# CONFIG_LBD is not set
363# CONFIG_CDROM_PKTCDVD is not set 373# CONFIG_CDROM_PKTCDVD is not set
364 374
@@ -379,6 +389,7 @@ CONFIG_IOSCHED_CFQ=y
379# 389#
380# SCSI device support 390# SCSI device support
381# 391#
392# CONFIG_RAID_ATTRS is not set
382# CONFIG_SCSI is not set 393# CONFIG_SCSI is not set
383 394
384# 395#
@@ -420,6 +431,10 @@ CONFIG_NETDEVICES=y
420# CONFIG_ARCNET is not set 431# CONFIG_ARCNET is not set
421 432
422# 433#
434# PHY device support
435#
436
437#
423# Ethernet (10 or 100Mbit) 438# Ethernet (10 or 100Mbit)
424# 439#
425# CONFIG_NET_ETHERNET is not set 440# CONFIG_NET_ETHERNET is not set
@@ -434,6 +449,7 @@ CONFIG_NETDEVICES=y
434# CONFIG_HAMACHI is not set 449# CONFIG_HAMACHI is not set
435# CONFIG_YELLOWFIN is not set 450# CONFIG_YELLOWFIN is not set
436# CONFIG_R8169 is not set 451# CONFIG_R8169 is not set
452# CONFIG_SIS190 is not set
437# CONFIG_SKGE is not set 453# CONFIG_SKGE is not set
438# CONFIG_SK98LIN is not set 454# CONFIG_SK98LIN is not set
439# CONFIG_TIGON3 is not set 455# CONFIG_TIGON3 is not set
@@ -446,6 +462,7 @@ CONFIG_MV643XX_ETH_0=y
446# 462#
447# Ethernet (10000 Mbit) 463# Ethernet (10000 Mbit)
448# 464#
465# CONFIG_CHELSIO_T1 is not set
449# CONFIG_IXGB is not set 466# CONFIG_IXGB is not set
450# CONFIG_S2IO is not set 467# CONFIG_S2IO is not set
451 468
@@ -547,7 +564,20 @@ CONFIG_LEGACY_PTY_COUNT=256
547# 564#
548# Watchdog Cards 565# Watchdog Cards
549# 566#
550# CONFIG_WATCHDOG is not set 567CONFIG_WATCHDOG=y
568# CONFIG_WATCHDOG_NOWAYOUT is not set
569
570#
571# Watchdog Device Drivers
572#
573# CONFIG_SOFT_WATCHDOG is not set
574CONFIG_MV64X60_WDT=y
575
576#
577# PCI-based Watchdog Cards
578#
579# CONFIG_PCIPCWATCHDOG is not set
580# CONFIG_WDTPCI is not set
551# CONFIG_NVRAM is not set 581# CONFIG_NVRAM is not set
552CONFIG_GEN_RTC=y 582CONFIG_GEN_RTC=y
553# CONFIG_GEN_RTC_X is not set 583# CONFIG_GEN_RTC_X is not set
@@ -571,7 +601,6 @@ CONFIG_GEN_RTC=y
571# I2C support 601# I2C support
572# 602#
573# CONFIG_I2C is not set 603# CONFIG_I2C is not set
574# CONFIG_I2C_SENSOR is not set
575 604
576# 605#
577# Dallas's 1-wire bus 606# Dallas's 1-wire bus
@@ -582,6 +611,7 @@ CONFIG_GEN_RTC=y
582# Hardware Monitoring support 611# Hardware Monitoring support
583# 612#
584CONFIG_HWMON=y 613CONFIG_HWMON=y
614# CONFIG_HWMON_VID is not set
585# CONFIG_HWMON_DEBUG_CHIP is not set 615# CONFIG_HWMON_DEBUG_CHIP is not set
586 616
587# 617#
@@ -589,6 +619,10 @@ CONFIG_HWMON=y
589# 619#
590 620
591# 621#
622# Multimedia Capabilities Port drivers
623#
624
625#
592# Multimedia devices 626# Multimedia devices
593# 627#
594# CONFIG_VIDEO_DEV is not set 628# CONFIG_VIDEO_DEV is not set
@@ -651,10 +685,6 @@ CONFIG_EXT2_FS=y
651# CONFIG_REISERFS_FS is not set 685# CONFIG_REISERFS_FS is not set
652# CONFIG_JFS_FS is not set 686# CONFIG_JFS_FS is not set
653# CONFIG_FS_POSIX_ACL is not set 687# CONFIG_FS_POSIX_ACL is not set
654
655#
656# XFS support
657#
658# CONFIG_XFS_FS is not set 688# CONFIG_XFS_FS is not set
659# CONFIG_MINIX_FS is not set 689# CONFIG_MINIX_FS is not set
660# CONFIG_ROMFS_FS is not set 690# CONFIG_ROMFS_FS is not set
@@ -663,6 +693,7 @@ CONFIG_INOTIFY=y
663CONFIG_DNOTIFY=y 693CONFIG_DNOTIFY=y
664# CONFIG_AUTOFS_FS is not set 694# CONFIG_AUTOFS_FS is not set
665# CONFIG_AUTOFS4_FS is not set 695# CONFIG_AUTOFS4_FS is not set
696# CONFIG_FUSE_FS is not set
666 697
667# 698#
668# CD-ROM/DVD Filesystems 699# CD-ROM/DVD Filesystems
@@ -683,11 +714,10 @@ CONFIG_DNOTIFY=y
683CONFIG_PROC_FS=y 714CONFIG_PROC_FS=y
684CONFIG_PROC_KCORE=y 715CONFIG_PROC_KCORE=y
685CONFIG_SYSFS=y 716CONFIG_SYSFS=y
686# CONFIG_DEVPTS_FS_XATTR is not set
687CONFIG_TMPFS=y 717CONFIG_TMPFS=y
688# CONFIG_TMPFS_XATTR is not set
689# CONFIG_HUGETLB_PAGE is not set 718# CONFIG_HUGETLB_PAGE is not set
690CONFIG_RAMFS=y 719CONFIG_RAMFS=y
720# CONFIG_RELAYFS_FS is not set
691 721
692# 722#
693# Miscellaneous filesystems 723# Miscellaneous filesystems
@@ -735,6 +765,7 @@ CONFIG_SUNRPC=y
735# CONFIG_NCP_FS is not set 765# CONFIG_NCP_FS is not set
736# CONFIG_CODA_FS is not set 766# CONFIG_CODA_FS is not set
737# CONFIG_AFS_FS is not set 767# CONFIG_AFS_FS is not set
768# CONFIG_9P_FS is not set
738 769
739# 770#
740# Partition Types 771# Partition Types
@@ -751,6 +782,7 @@ CONFIG_MSDOS_PARTITION=y
751# Library routines 782# Library routines
752# 783#
753# CONFIG_CRC_CCITT is not set 784# CONFIG_CRC_CCITT is not set
785# CONFIG_CRC16 is not set
754CONFIG_CRC32=y 786CONFIG_CRC32=y
755# CONFIG_LIBCRC32C is not set 787# CONFIG_LIBCRC32C is not set
756CONFIG_ZLIB_INFLATE=y 788CONFIG_ZLIB_INFLATE=y
@@ -767,6 +799,7 @@ CONFIG_ZLIB_DEFLATE=y
767# CONFIG_PRINTK_TIME is not set 799# CONFIG_PRINTK_TIME is not set
768# CONFIG_DEBUG_KERNEL is not set 800# CONFIG_DEBUG_KERNEL is not set
769CONFIG_LOG_BUF_SHIFT=14 801CONFIG_LOG_BUF_SHIFT=14
802# CONFIG_SERIAL_TEXT_DEBUG is not set
770 803
771# 804#
772# Security options 805# Security options
diff --git a/arch/ppc/configs/mpc834x_sys_defconfig b/arch/ppc/configs/mpc834x_sys_defconfig
index 4a5522ca8207..673dc64ebcb1 100644
--- a/arch/ppc/configs/mpc834x_sys_defconfig
+++ b/arch/ppc/configs/mpc834x_sys_defconfig
@@ -1,16 +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.11-rc4 3# Linux kernel version: 2.6.14
4# Thu Feb 17 16:12:23 2005 4# Mon Nov 7 15:38:29 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_GENERIC_CALIBRATE_DELAY=y
10CONFIG_HAVE_DEC_LOCK=y
11CONFIG_PPC=y 10CONFIG_PPC=y
12CONFIG_PPC32=y 11CONFIG_PPC32=y
13CONFIG_GENERIC_NVRAM=y 12CONFIG_GENERIC_NVRAM=y
13CONFIG_SCHED_NO_NO_OMIT_FRAME_POINTER=y
14CONFIG_ARCH_MAY_HAVE_PC_FDC=y
14 15
15# 16#
16# Code maturity level options 17# Code maturity level options
@@ -18,23 +19,28 @@ 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=""
36CONFIG_EMBEDDED=y 39CONFIG_EMBEDDED=y
37# CONFIG_KALLSYMS is not set 40# CONFIG_KALLSYMS is not set
41CONFIG_PRINTK=y
42CONFIG_BUG=y
43CONFIG_BASE_FULL=y
38CONFIG_FUTEX=y 44CONFIG_FUTEX=y
39# CONFIG_EPOLL is not set 45# CONFIG_EPOLL is not set
40# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set 46# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
@@ -44,6 +50,7 @@ CONFIG_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
@@ -59,34 +66,84 @@ CONFIG_6xx=y
59# CONFIG_POWER3 is not set 66# CONFIG_POWER3 is not set
60# CONFIG_POWER4 is not set 67# CONFIG_POWER4 is not set
61# CONFIG_8xx is not set 68# CONFIG_8xx is not set
69# CONFIG_E200 is not set
62# CONFIG_E500 is not set 70# CONFIG_E500 is not set
71CONFIG_PPC_FPU=y
72# CONFIG_KEXEC is not set
63# CONFIG_CPU_FREQ is not set 73# CONFIG_CPU_FREQ is not set
74# CONFIG_WANT_EARLY_SERIAL is not set
64CONFIG_PPC_GEN550=y 75CONFIG_PPC_GEN550=y
65CONFIG_83xx=y
66
67#
68# Freescale 83xx options
69#
70CONFIG_MPC834x_SYS=y
71CONFIG_MPC834x=y
72CONFIG_PPC_STD_MMU=y 76CONFIG_PPC_STD_MMU=y
73 77
74# 78#
75# Platform options 79# Platform options
76# 80#
81# CONFIG_PPC_MULTIPLATFORM is not set
82# CONFIG_APUS is not set
83# CONFIG_KATANA is not set
84# CONFIG_WILLOW is not set
85# CONFIG_CPCI690 is not set
86# CONFIG_POWERPMC250 is not set
87# CONFIG_CHESTNUT is not set
88# CONFIG_SPRUCE is not set
89# CONFIG_HDPU is not set
90# CONFIG_EV64260 is not set
91# CONFIG_LOPEC is not set
92# CONFIG_MVME5100 is not set
93# CONFIG_PPLUS is not set
94# CONFIG_PRPMC750 is not set
95# CONFIG_PRPMC800 is not set
96# CONFIG_SANDPOINT is not set
97# CONFIG_RADSTONE_PPC7D is not set
98# CONFIG_PAL4 is not set
99# CONFIG_GEMINI is not set
100# CONFIG_EST8260 is not set
101# CONFIG_SBC82xx is not set
102# CONFIG_SBS8260 is not set
103# CONFIG_RPX8260 is not set
104# CONFIG_TQM8260 is not set
105# CONFIG_ADS8272 is not set
106# CONFIG_PQ2FADS is not set
107# CONFIG_LITE5200 is not set
108CONFIG_MPC834x_SYS=y
109# CONFIG_EV64360 is not set
110CONFIG_83xx=y
111CONFIG_MPC834x=y
77# CONFIG_SMP is not set 112# CONFIG_SMP is not set
78# CONFIG_PREEMPT is not set
79# CONFIG_HIGHMEM is not set 113# CONFIG_HIGHMEM is not set
114# CONFIG_HZ_100 is not set
115CONFIG_HZ_250=y
116# CONFIG_HZ_1000 is not set
117CONFIG_HZ=250
118CONFIG_PREEMPT_NONE=y
119# CONFIG_PREEMPT_VOLUNTARY is not set
120# CONFIG_PREEMPT is not set
121CONFIG_SELECT_MEMORY_MODEL=y
122CONFIG_FLATMEM_MANUAL=y
123# CONFIG_DISCONTIGMEM_MANUAL is not set
124# CONFIG_SPARSEMEM_MANUAL is not set
125CONFIG_FLATMEM=y
126CONFIG_FLAT_NODE_MEM_MAP=y
127# CONFIG_SPARSEMEM_STATIC is not set
128CONFIG_SPLIT_PTLOCK_CPUS=4
80CONFIG_BINFMT_ELF=y 129CONFIG_BINFMT_ELF=y
81# CONFIG_BINFMT_MISC is not set 130# CONFIG_BINFMT_MISC is not set
82# CONFIG_CMDLINE_BOOL is not set 131# CONFIG_CMDLINE_BOOL is not set
132# CONFIG_PM is not set
133# CONFIG_SOFTWARE_SUSPEND is not set
134CONFIG_SECCOMP=y
135CONFIG_ISA_DMA_API=y
83 136
84# 137#
85# Bus options 138# Bus options
86# 139#
87CONFIG_GENERIC_ISA_DMA=y 140CONFIG_GENERIC_ISA_DMA=y
88# CONFIG_PCI is not set 141# CONFIG_PPC_I8259 is not set
89# CONFIG_PCI_DOMAINS is not set 142CONFIG_PPC_INDIRECT_PCI=y
143CONFIG_PCI=y
144CONFIG_PCI_DOMAINS=y
145# CONFIG_MPC83xx_PCI2 is not set
146CONFIG_PCI_LEGACY_PROC=y
90 147
91# 148#
92# PCCARD (PCMCIA/CardBus) support 149# PCCARD (PCMCIA/CardBus) support
@@ -94,10 +151,6 @@ CONFIG_GENERIC_ISA_DMA=y
94# CONFIG_PCCARD is not set 151# CONFIG_PCCARD is not set
95 152
96# 153#
97# PC-card bridges
98#
99
100#
101# Advanced setup 154# Advanced setup
102# 155#
103# CONFIG_ADVANCED_OPTIONS is not set 156# CONFIG_ADVANCED_OPTIONS is not set
@@ -112,6 +165,75 @@ CONFIG_TASK_SIZE=0x80000000
112CONFIG_BOOT_LOAD=0x00800000 165CONFIG_BOOT_LOAD=0x00800000
113 166
114# 167#
168# Networking
169#
170CONFIG_NET=y
171
172#
173# Networking options
174#
175CONFIG_PACKET=y
176# CONFIG_PACKET_MMAP is not set
177CONFIG_UNIX=y
178# CONFIG_NET_KEY is not set
179CONFIG_INET=y
180CONFIG_IP_MULTICAST=y
181# CONFIG_IP_ADVANCED_ROUTER is not set
182CONFIG_IP_FIB_HASH=y
183CONFIG_IP_PNP=y
184CONFIG_IP_PNP_DHCP=y
185CONFIG_IP_PNP_BOOTP=y
186# CONFIG_IP_PNP_RARP is not set
187# CONFIG_NET_IPIP is not set
188# CONFIG_NET_IPGRE is not set
189# CONFIG_IP_MROUTE is not set
190# CONFIG_ARPD is not set
191CONFIG_SYN_COOKIES=y
192# CONFIG_INET_AH is not set
193# CONFIG_INET_ESP is not set
194# CONFIG_INET_IPCOMP is not set
195# CONFIG_INET_TUNNEL is not set
196CONFIG_INET_DIAG=y
197CONFIG_INET_TCP_DIAG=y
198# CONFIG_TCP_CONG_ADVANCED is not set
199CONFIG_TCP_CONG_BIC=y
200# CONFIG_IPV6 is not set
201# CONFIG_NETFILTER is not set
202
203#
204# DCCP Configuration (EXPERIMENTAL)
205#
206# CONFIG_IP_DCCP is not set
207
208#
209# SCTP Configuration (EXPERIMENTAL)
210#
211# CONFIG_IP_SCTP is not set
212# CONFIG_ATM is not set
213# CONFIG_BRIDGE is not set
214# CONFIG_VLAN_8021Q is not set
215# CONFIG_DECNET is not set
216# CONFIG_LLC2 is not set
217# CONFIG_IPX is not set
218# CONFIG_ATALK is not set
219# CONFIG_X25 is not set
220# CONFIG_LAPB is not set
221# CONFIG_NET_DIVERT is not set
222# CONFIG_ECONET is not set
223# CONFIG_WAN_ROUTER is not set
224# CONFIG_NET_SCHED is not set
225# CONFIG_NET_CLS_ROUTE is not set
226
227#
228# Network testing
229#
230# CONFIG_NET_PKTGEN is not set
231# CONFIG_HAMRADIO is not set
232# CONFIG_IRDA is not set
233# CONFIG_BT is not set
234# CONFIG_IEEE80211 is not set
235
236#
115# Device Drivers 237# Device Drivers
116# 238#
117 239
@@ -123,6 +245,11 @@ CONFIG_PREVENT_FIRMWARE_BUILD=y
123# CONFIG_FW_LOADER is not set 245# CONFIG_FW_LOADER is not set
124 246
125# 247#
248# Connector - unified userspace <-> kernelspace linker
249#
250# CONFIG_CONNECTOR is not set
251
252#
126# Memory Technology Devices (MTD) 253# Memory Technology Devices (MTD)
127# 254#
128# CONFIG_MTD is not set 255# CONFIG_MTD is not set
@@ -140,15 +267,19 @@ CONFIG_PREVENT_FIRMWARE_BUILD=y
140# Block devices 267# Block devices
141# 268#
142# CONFIG_BLK_DEV_FD is not set 269# CONFIG_BLK_DEV_FD is not set
270# CONFIG_BLK_CPQ_DA is not set
271# CONFIG_BLK_CPQ_CISS_DA is not set
272# CONFIG_BLK_DEV_DAC960 is not set
273# CONFIG_BLK_DEV_UMEM is not set
143# CONFIG_BLK_DEV_COW_COMMON is not set 274# CONFIG_BLK_DEV_COW_COMMON is not set
144CONFIG_BLK_DEV_LOOP=y 275CONFIG_BLK_DEV_LOOP=y
145# CONFIG_BLK_DEV_CRYPTOLOOP is not set 276# CONFIG_BLK_DEV_CRYPTOLOOP is not set
146# CONFIG_BLK_DEV_NBD is not set 277# CONFIG_BLK_DEV_NBD is not set
278# CONFIG_BLK_DEV_SX8 is not set
147CONFIG_BLK_DEV_RAM=y 279CONFIG_BLK_DEV_RAM=y
148CONFIG_BLK_DEV_RAM_COUNT=16 280CONFIG_BLK_DEV_RAM_COUNT=16
149CONFIG_BLK_DEV_RAM_SIZE=32768 281CONFIG_BLK_DEV_RAM_SIZE=32768
150CONFIG_BLK_DEV_INITRD=y 282CONFIG_BLK_DEV_INITRD=y
151CONFIG_INITRAMFS_SOURCE=""
152# CONFIG_LBD is not set 283# CONFIG_LBD is not set
153# CONFIG_CDROM_PKTCDVD is not set 284# CONFIG_CDROM_PKTCDVD is not set
154 285
@@ -159,6 +290,11 @@ CONFIG_IOSCHED_NOOP=y
159CONFIG_IOSCHED_AS=y 290CONFIG_IOSCHED_AS=y
160CONFIG_IOSCHED_DEADLINE=y 291CONFIG_IOSCHED_DEADLINE=y
161CONFIG_IOSCHED_CFQ=y 292CONFIG_IOSCHED_CFQ=y
293CONFIG_DEFAULT_AS=y
294# CONFIG_DEFAULT_DEADLINE is not set
295# CONFIG_DEFAULT_CFQ is not set
296# CONFIG_DEFAULT_NOOP is not set
297CONFIG_DEFAULT_IOSCHED="anticipatory"
162# CONFIG_ATA_OVER_ETH is not set 298# CONFIG_ATA_OVER_ETH is not set
163 299
164# 300#
@@ -169,6 +305,7 @@ CONFIG_IOSCHED_CFQ=y
169# 305#
170# SCSI device support 306# SCSI device support
171# 307#
308# CONFIG_RAID_ATTRS is not set
172# CONFIG_SCSI is not set 309# CONFIG_SCSI is not set
173 310
174# 311#
@@ -179,110 +316,116 @@ CONFIG_IOSCHED_CFQ=y
179# 316#
180# Fusion MPT device support 317# Fusion MPT device support
181# 318#
319# CONFIG_FUSION is not set
182 320
183# 321#
184# IEEE 1394 (FireWire) support 322# IEEE 1394 (FireWire) support
185# 323#
324# CONFIG_IEEE1394 is not set
186 325
187# 326#
188# I2O device support 327# I2O device support
189# 328#
329# CONFIG_I2O is not set
190 330
191# 331#
192# Macintosh device drivers 332# Macintosh device drivers
193# 333#
194 334
195# 335#
196# Networking support 336# Network device support
197# 337#
198CONFIG_NET=y 338CONFIG_NETDEVICES=y
199 339# CONFIG_DUMMY is not set
200# 340# CONFIG_BONDING is not set
201# Networking options 341# CONFIG_EQUALIZER is not set
202# 342# CONFIG_TUN is not set
203CONFIG_PACKET=y
204# CONFIG_PACKET_MMAP is not set
205# CONFIG_NETLINK_DEV is not set
206CONFIG_UNIX=y
207# CONFIG_NET_KEY is not set
208CONFIG_INET=y
209CONFIG_IP_MULTICAST=y
210# CONFIG_IP_ADVANCED_ROUTER is not set
211CONFIG_IP_PNP=y
212CONFIG_IP_PNP_DHCP=y
213CONFIG_IP_PNP_BOOTP=y
214# CONFIG_IP_PNP_RARP is not set
215# CONFIG_NET_IPIP is not set
216# CONFIG_NET_IPGRE is not set
217# CONFIG_IP_MROUTE is not set
218# CONFIG_ARPD is not set
219CONFIG_SYN_COOKIES=y
220# CONFIG_INET_AH is not set
221# CONFIG_INET_ESP is not set
222# CONFIG_INET_IPCOMP is not set
223# CONFIG_INET_TUNNEL is not set
224CONFIG_IP_TCPDIAG=y
225# CONFIG_IP_TCPDIAG_IPV6 is not set
226# CONFIG_IPV6 is not set
227# CONFIG_NETFILTER is not set
228 343
229# 344#
230# SCTP Configuration (EXPERIMENTAL) 345# ARCnet devices
231# 346#
232# CONFIG_IP_SCTP is not set 347# CONFIG_ARCNET is not set
233# CONFIG_ATM is not set
234# CONFIG_BRIDGE is not set
235# CONFIG_VLAN_8021Q is not set
236# CONFIG_DECNET is not set
237# CONFIG_LLC2 is not set
238# CONFIG_IPX is not set
239# CONFIG_ATALK is not set
240# CONFIG_X25 is not set
241# CONFIG_LAPB is not set
242# CONFIG_NET_DIVERT is not set
243# CONFIG_ECONET is not set
244# CONFIG_WAN_ROUTER is not set
245 348
246# 349#
247# QoS and/or fair queueing 350# PHY device support
248# 351#
249# CONFIG_NET_SCHED is not set 352CONFIG_PHYLIB=y
250# CONFIG_NET_CLS_ROUTE is not set
251 353
252# 354#
253# Network testing 355# MII PHY device drivers
254# 356#
255# CONFIG_NET_PKTGEN is not set 357CONFIG_MARVELL_PHY=y
256# CONFIG_NETPOLL is not set 358# CONFIG_DAVICOM_PHY is not set
257# CONFIG_NET_POLL_CONTROLLER is not set 359# CONFIG_QSEMI_PHY is not set
258# CONFIG_HAMRADIO is not set 360# CONFIG_LXT_PHY is not set
259# CONFIG_IRDA is not set 361# CONFIG_CICADA_PHY is not set
260# CONFIG_BT is not set
261CONFIG_NETDEVICES=y
262# CONFIG_DUMMY is not set
263# CONFIG_BONDING is not set
264# CONFIG_EQUALIZER is not set
265# CONFIG_TUN is not set
266 362
267# 363#
268# Ethernet (10 or 100Mbit) 364# Ethernet (10 or 100Mbit)
269# 365#
270CONFIG_NET_ETHERNET=y 366CONFIG_NET_ETHERNET=y
271CONFIG_MII=y 367CONFIG_MII=y
368# CONFIG_HAPPYMEAL is not set
369# CONFIG_SUNGEM is not set
370# CONFIG_CASSINI is not set
371# CONFIG_NET_VENDOR_3COM is not set
372
373#
374# Tulip family network device support
375#
376# CONFIG_NET_TULIP is not set
377# CONFIG_HP100 is not set
378CONFIG_NET_PCI=y
379# CONFIG_PCNET32 is not set
380# CONFIG_AMD8111_ETH is not set
381# CONFIG_ADAPTEC_STARFIRE is not set
382# CONFIG_B44 is not set
383# CONFIG_FORCEDETH is not set
384# CONFIG_DGRS is not set
385# CONFIG_EEPRO100 is not set
386CONFIG_E100=y
387# CONFIG_FEALNX is not set
388# CONFIG_NATSEMI is not set
389# CONFIG_NE2K_PCI is not set
390# CONFIG_8139CP is not set
391# CONFIG_8139TOO is not set
392# CONFIG_SIS900 is not set
393# CONFIG_EPIC100 is not set
394# CONFIG_SUNDANCE is not set
395# CONFIG_TLAN is not set
396# CONFIG_VIA_RHINE is not set
272 397
273# 398#
274# Ethernet (1000 Mbit) 399# Ethernet (1000 Mbit)
275# 400#
401# CONFIG_ACENIC is not set
402# CONFIG_DL2K is not set
403CONFIG_E1000=y
404# CONFIG_E1000_NAPI is not set
405# CONFIG_NS83820 is not set
406# CONFIG_HAMACHI is not set
407# CONFIG_YELLOWFIN is not set
408# CONFIG_R8169 is not set
409# CONFIG_SIS190 is not set
410# CONFIG_SKGE is not set
411# CONFIG_SK98LIN is not set
412# CONFIG_VIA_VELOCITY is not set
413# CONFIG_TIGON3 is not set
414# CONFIG_BNX2 is not set
276CONFIG_GIANFAR=y 415CONFIG_GIANFAR=y
277# CONFIG_GFAR_NAPI is not set 416# CONFIG_GFAR_NAPI is not set
278 417
279# 418#
280# Ethernet (10000 Mbit) 419# Ethernet (10000 Mbit)
281# 420#
421# CONFIG_CHELSIO_T1 is not set
422# CONFIG_IXGB is not set
423# CONFIG_S2IO is not set
282 424
283# 425#
284# Token Ring devices 426# Token Ring devices
285# 427#
428# CONFIG_TR is not set
286 429
287# 430#
288# Wireless LAN (non-hamradio) 431# Wireless LAN (non-hamradio)
@@ -293,10 +436,14 @@ CONFIG_GIANFAR=y
293# Wan interfaces 436# Wan interfaces
294# 437#
295# CONFIG_WAN is not set 438# CONFIG_WAN is not set
439# CONFIG_FDDI is not set
440# CONFIG_HIPPI is not set
296# CONFIG_PPP is not set 441# CONFIG_PPP is not set
297# CONFIG_SLIP is not set 442# CONFIG_SLIP is not set
298# CONFIG_SHAPER is not set 443# CONFIG_SHAPER is not set
299# CONFIG_NETCONSOLE is not set 444# CONFIG_NETCONSOLE is not set
445# CONFIG_NETPOLL is not set
446# CONFIG_NET_POLL_CONTROLLER is not set
300 447
301# 448#
302# ISDN subsystem 449# ISDN subsystem
@@ -323,14 +470,6 @@ CONFIG_INPUT=y
323# CONFIG_INPUT_EVBUG is not set 470# CONFIG_INPUT_EVBUG is not set
324 471
325# 472#
326# Input I/O drivers
327#
328# CONFIG_GAMEPORT is not set
329CONFIG_SOUND_GAMEPORT=y
330# CONFIG_SERIO is not set
331# CONFIG_SERIO_I8042 is not set
332
333#
334# Input Device Drivers 473# Input Device Drivers
335# 474#
336# CONFIG_INPUT_KEYBOARD is not set 475# CONFIG_INPUT_KEYBOARD is not set
@@ -340,6 +479,12 @@ CONFIG_SOUND_GAMEPORT=y
340# CONFIG_INPUT_MISC is not set 479# CONFIG_INPUT_MISC is not set
341 480
342# 481#
482# Hardware I/O ports
483#
484# CONFIG_SERIO is not set
485# CONFIG_GAMEPORT is not set
486
487#
343# Character devices 488# Character devices
344# 489#
345# CONFIG_VT is not set 490# CONFIG_VT is not set
@@ -358,6 +503,7 @@ CONFIG_SERIAL_8250_NR_UARTS=4
358# 503#
359CONFIG_SERIAL_CORE=y 504CONFIG_SERIAL_CORE=y
360CONFIG_SERIAL_CORE_CONSOLE=y 505CONFIG_SERIAL_CORE_CONSOLE=y
506# CONFIG_SERIAL_JSM is not set
361CONFIG_UNIX98_PTYS=y 507CONFIG_UNIX98_PTYS=y
362CONFIG_LEGACY_PTYS=y 508CONFIG_LEGACY_PTYS=y
363CONFIG_LEGACY_PTY_COUNT=256 509CONFIG_LEGACY_PTY_COUNT=256
@@ -376,6 +522,7 @@ CONFIG_GEN_RTC=y
376# CONFIG_GEN_RTC_X is not set 522# CONFIG_GEN_RTC_X is not set
377# CONFIG_DTLK is not set 523# CONFIG_DTLK is not set
378# CONFIG_R3964 is not set 524# CONFIG_R3964 is not set
525# CONFIG_APPLICOM is not set
379 526
380# 527#
381# Ftape, the floppy tape device driver 528# Ftape, the floppy tape device driver
@@ -385,6 +532,12 @@ CONFIG_GEN_RTC=y
385# CONFIG_RAW_DRIVER is not set 532# CONFIG_RAW_DRIVER is not set
386 533
387# 534#
535# TPM devices
536#
537# CONFIG_TCG_TPM is not set
538# CONFIG_TELCLOCK is not set
539
540#
388# I2C support 541# I2C support
389# 542#
390CONFIG_I2C=y 543CONFIG_I2C=y
@@ -400,23 +553,68 @@ CONFIG_I2C_CHARDEV=y
400# 553#
401# I2C Hardware Bus support 554# I2C Hardware Bus support
402# 555#
403# CONFIG_I2C_ISA is not set 556# CONFIG_I2C_ALI1535 is not set
557# CONFIG_I2C_ALI1563 is not set
558# CONFIG_I2C_ALI15X3 is not set
559# CONFIG_I2C_AMD756 is not set
560# CONFIG_I2C_AMD8111 is not set
561# CONFIG_I2C_I801 is not set
562# CONFIG_I2C_I810 is not set
563# CONFIG_I2C_PIIX4 is not set
404CONFIG_I2C_MPC=y 564CONFIG_I2C_MPC=y
565# CONFIG_I2C_NFORCE2 is not set
405# CONFIG_I2C_PARPORT_LIGHT is not set 566# CONFIG_I2C_PARPORT_LIGHT is not set
567# CONFIG_I2C_PROSAVAGE is not set
568# CONFIG_I2C_SAVAGE4 is not set
569# CONFIG_SCx200_ACB is not set
570# CONFIG_I2C_SIS5595 is not set
571# CONFIG_I2C_SIS630 is not set
572# CONFIG_I2C_SIS96X is not set
573# CONFIG_I2C_VIA is not set
574# CONFIG_I2C_VIAPRO is not set
575# CONFIG_I2C_VOODOO3 is not set
406# CONFIG_I2C_PCA_ISA is not set 576# CONFIG_I2C_PCA_ISA is not set
407 577
408# 578#
409# Hardware Sensors Chip support 579# Miscellaneous I2C Chip support
580#
581# CONFIG_SENSORS_DS1337 is not set
582# CONFIG_SENSORS_DS1374 is not set
583# CONFIG_SENSORS_EEPROM is not set
584# CONFIG_SENSORS_PCF8574 is not set
585# CONFIG_SENSORS_PCA9539 is not set
586# CONFIG_SENSORS_PCF8591 is not set
587# CONFIG_SENSORS_RTC8564 is not set
588# CONFIG_SENSORS_M41T00 is not set
589# CONFIG_SENSORS_MAX6875 is not set
590# CONFIG_RTC_X1205_I2C is not set
591# CONFIG_I2C_DEBUG_CORE is not set
592# CONFIG_I2C_DEBUG_ALGO is not set
593# CONFIG_I2C_DEBUG_BUS is not set
594# CONFIG_I2C_DEBUG_CHIP is not set
595
596#
597# Dallas's 1-wire bus
598#
599# CONFIG_W1 is not set
600
601#
602# Hardware Monitoring support
410# 603#
411# CONFIG_I2C_SENSOR is not set 604CONFIG_HWMON=y
605# CONFIG_HWMON_VID is not set
412# CONFIG_SENSORS_ADM1021 is not set 606# CONFIG_SENSORS_ADM1021 is not set
413# CONFIG_SENSORS_ADM1025 is not set 607# CONFIG_SENSORS_ADM1025 is not set
414# CONFIG_SENSORS_ADM1026 is not set 608# CONFIG_SENSORS_ADM1026 is not set
415# CONFIG_SENSORS_ADM1031 is not set 609# CONFIG_SENSORS_ADM1031 is not set
610# CONFIG_SENSORS_ADM9240 is not set
416# CONFIG_SENSORS_ASB100 is not set 611# CONFIG_SENSORS_ASB100 is not set
612# CONFIG_SENSORS_ATXP1 is not set
417# CONFIG_SENSORS_DS1621 is not set 613# CONFIG_SENSORS_DS1621 is not set
418# CONFIG_SENSORS_FSCHER is not set 614# CONFIG_SENSORS_FSCHER is not set
615# CONFIG_SENSORS_FSCPOS is not set
419# CONFIG_SENSORS_GL518SM is not set 616# CONFIG_SENSORS_GL518SM is not set
617# CONFIG_SENSORS_GL520SM is not set
420# CONFIG_SENSORS_IT87 is not set 618# CONFIG_SENSORS_IT87 is not set
421# CONFIG_SENSORS_LM63 is not set 619# CONFIG_SENSORS_LM63 is not set
422# CONFIG_SENSORS_LM75 is not set 620# CONFIG_SENSORS_LM75 is not set
@@ -427,33 +625,26 @@ CONFIG_I2C_MPC=y
427# CONFIG_SENSORS_LM85 is not set 625# CONFIG_SENSORS_LM85 is not set
428# CONFIG_SENSORS_LM87 is not set 626# CONFIG_SENSORS_LM87 is not set
429# CONFIG_SENSORS_LM90 is not set 627# CONFIG_SENSORS_LM90 is not set
628# CONFIG_SENSORS_LM92 is not set
430# CONFIG_SENSORS_MAX1619 is not set 629# CONFIG_SENSORS_MAX1619 is not set
431# CONFIG_SENSORS_PC87360 is not set 630# CONFIG_SENSORS_PC87360 is not set
432# CONFIG_SENSORS_SMSC47B397 is not set 631# CONFIG_SENSORS_SIS5595 is not set
433# CONFIG_SENSORS_SMSC47M1 is not set 632# CONFIG_SENSORS_SMSC47M1 is not set
633# CONFIG_SENSORS_SMSC47B397 is not set
634# CONFIG_SENSORS_VIA686A is not set
434# CONFIG_SENSORS_W83781D is not set 635# CONFIG_SENSORS_W83781D is not set
636# CONFIG_SENSORS_W83792D is not set
435# CONFIG_SENSORS_W83L785TS is not set 637# CONFIG_SENSORS_W83L785TS is not set
436# CONFIG_SENSORS_W83627HF is not set 638# CONFIG_SENSORS_W83627HF is not set
639# CONFIG_SENSORS_W83627EHF is not set
640# CONFIG_HWMON_DEBUG_CHIP is not set
437 641
438# 642#
439# Other I2C Chip support 643# Misc devices
440#
441# CONFIG_SENSORS_EEPROM is not set
442# CONFIG_SENSORS_PCF8574 is not set
443# CONFIG_SENSORS_PCF8591 is not set
444# CONFIG_SENSORS_RTC8564 is not set
445# CONFIG_I2C_DEBUG_CORE is not set
446# CONFIG_I2C_DEBUG_ALGO is not set
447# CONFIG_I2C_DEBUG_BUS is not set
448# CONFIG_I2C_DEBUG_CHIP is not set
449
450#
451# Dallas's 1-wire bus
452# 644#
453# CONFIG_W1 is not set
454 645
455# 646#
456# Misc devices 647# Multimedia Capabilities Port drivers
457# 648#
458 649
459# 650#
@@ -479,11 +670,12 @@ CONFIG_I2C_MPC=y
479# 670#
480# USB support 671# USB support
481# 672#
482# CONFIG_USB_ARCH_HAS_HCD is not set 673CONFIG_USB_ARCH_HAS_HCD=y
483# CONFIG_USB_ARCH_HAS_OHCI is not set 674CONFIG_USB_ARCH_HAS_OHCI=y
675# CONFIG_USB is not set
484 676
485# 677#
486# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support' may also be needed; see USB_STORAGE Help for more information 678# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support'
487# 679#
488 680
489# 681#
@@ -502,10 +694,15 @@ CONFIG_I2C_MPC=y
502# CONFIG_INFINIBAND is not set 694# CONFIG_INFINIBAND is not set
503 695
504# 696#
697# SN Devices
698#
699
700#
505# File systems 701# File systems
506# 702#
507CONFIG_EXT2_FS=y 703CONFIG_EXT2_FS=y
508# CONFIG_EXT2_FS_XATTR is not set 704# CONFIG_EXT2_FS_XATTR is not set
705# CONFIG_EXT2_FS_XIP is not set
509CONFIG_EXT3_FS=y 706CONFIG_EXT3_FS=y
510CONFIG_EXT3_FS_XATTR=y 707CONFIG_EXT3_FS_XATTR=y
511# CONFIG_EXT3_FS_POSIX_ACL is not set 708# CONFIG_EXT3_FS_POSIX_ACL is not set
@@ -515,17 +712,16 @@ CONFIG_JBD=y
515CONFIG_FS_MBCACHE=y 712CONFIG_FS_MBCACHE=y
516# CONFIG_REISERFS_FS is not set 713# CONFIG_REISERFS_FS is not set
517# CONFIG_JFS_FS is not set 714# CONFIG_JFS_FS is not set
518 715# CONFIG_FS_POSIX_ACL is not set
519#
520# XFS support
521#
522# CONFIG_XFS_FS is not set 716# CONFIG_XFS_FS is not set
523# CONFIG_MINIX_FS is not set 717# CONFIG_MINIX_FS is not set
524# CONFIG_ROMFS_FS is not set 718# CONFIG_ROMFS_FS is not set
719CONFIG_INOTIFY=y
525# CONFIG_QUOTA is not set 720# CONFIG_QUOTA is not set
526CONFIG_DNOTIFY=y 721CONFIG_DNOTIFY=y
527# CONFIG_AUTOFS_FS is not set 722# CONFIG_AUTOFS_FS is not set
528# CONFIG_AUTOFS4_FS is not set 723# CONFIG_AUTOFS4_FS is not set
724# CONFIG_FUSE_FS is not set
529 725
530# 726#
531# CD-ROM/DVD Filesystems 727# CD-ROM/DVD Filesystems
@@ -546,12 +742,10 @@ CONFIG_DNOTIFY=y
546CONFIG_PROC_FS=y 742CONFIG_PROC_FS=y
547CONFIG_PROC_KCORE=y 743CONFIG_PROC_KCORE=y
548CONFIG_SYSFS=y 744CONFIG_SYSFS=y
549# CONFIG_DEVFS_FS is not set
550# CONFIG_DEVPTS_FS_XATTR is not set
551CONFIG_TMPFS=y 745CONFIG_TMPFS=y
552# CONFIG_TMPFS_XATTR is not set
553# CONFIG_HUGETLB_PAGE is not set 746# CONFIG_HUGETLB_PAGE is not set
554CONFIG_RAMFS=y 747CONFIG_RAMFS=y
748# CONFIG_RELAYFS_FS is not set
555 749
556# 750#
557# Miscellaneous filesystems 751# Miscellaneous filesystems
@@ -580,6 +774,7 @@ CONFIG_NFS_FS=y
580# CONFIG_NFSD is not set 774# CONFIG_NFSD is not set
581CONFIG_ROOT_NFS=y 775CONFIG_ROOT_NFS=y
582CONFIG_LOCKD=y 776CONFIG_LOCKD=y
777CONFIG_NFS_COMMON=y
583CONFIG_SUNRPC=y 778CONFIG_SUNRPC=y
584# CONFIG_RPCSEC_GSS_KRB5 is not set 779# CONFIG_RPCSEC_GSS_KRB5 is not set
585# CONFIG_RPCSEC_GSS_SPKM3 is not set 780# CONFIG_RPCSEC_GSS_SPKM3 is not set
@@ -588,6 +783,7 @@ CONFIG_SUNRPC=y
588# CONFIG_NCP_FS is not set 783# CONFIG_NCP_FS is not set
589# CONFIG_CODA_FS is not set 784# CONFIG_CODA_FS is not set
590# CONFIG_AFS_FS is not set 785# CONFIG_AFS_FS is not set
786# CONFIG_9P_FS is not set
591 787
592# 788#
593# Partition Types 789# Partition Types
@@ -614,6 +810,7 @@ CONFIG_PARTITION_ADVANCED=y
614# Library routines 810# Library routines
615# 811#
616# CONFIG_CRC_CCITT is not set 812# CONFIG_CRC_CCITT is not set
813# CONFIG_CRC16 is not set
617CONFIG_CRC32=y 814CONFIG_CRC32=y
618# CONFIG_LIBCRC32C is not set 815# CONFIG_LIBCRC32C is not set
619 816
@@ -625,7 +822,9 @@ CONFIG_CRC32=y
625# 822#
626# Kernel hacking 823# Kernel hacking
627# 824#
825# CONFIG_PRINTK_TIME is not set
628# CONFIG_DEBUG_KERNEL is not set 826# CONFIG_DEBUG_KERNEL is not set
827CONFIG_LOG_BUF_SHIFT=14
629# CONFIG_SERIAL_TEXT_DEBUG is not set 828# CONFIG_SERIAL_TEXT_DEBUG is not set
630 829
631# 830#
diff --git a/arch/ppc/configs/stx_gp3_defconfig b/arch/ppc/configs/stx_gp3_defconfig
index 66dae8367659..3fedc43e44ad 100644
--- a/arch/ppc/configs/stx_gp3_defconfig
+++ b/arch/ppc/configs/stx_gp3_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-rc2 3# Linux kernel version: 2.6.12-rc4
4# Wed Jan 26 14:32:58 2005 4# Tue May 24 18:11:04 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,7 +31,6 @@ 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
33CONFIG_HOTPLUG=y 34CONFIG_HOTPLUG=y
34CONFIG_KOBJECT_UEVENT=y 35CONFIG_KOBJECT_UEVENT=y
35# CONFIG_IKCONFIG is not set 36# CONFIG_IKCONFIG is not set
@@ -37,6 +38,9 @@ CONFIG_EMBEDDED=y
37CONFIG_KALLSYMS=y 38CONFIG_KALLSYMS=y
38# CONFIG_KALLSYMS_ALL is not set 39# CONFIG_KALLSYMS_ALL is not set
39# CONFIG_KALLSYMS_EXTRA_PASS is not set 40# CONFIG_KALLSYMS_EXTRA_PASS is not set
41CONFIG_PRINTK=y
42CONFIG_BUG=y
43CONFIG_BASE_FULL=y
40CONFIG_FUTEX=y 44CONFIG_FUTEX=y
41CONFIG_EPOLL=y 45CONFIG_EPOLL=y
42# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set 46# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
@@ -46,6 +50,7 @@ CONFIG_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
@@ -69,9 +74,11 @@ CONFIG_KMOD=y
69CONFIG_E500=y 74CONFIG_E500=y
70CONFIG_BOOKE=y 75CONFIG_BOOKE=y
71CONFIG_FSL_BOOKE=y 76CONFIG_FSL_BOOKE=y
77# CONFIG_PHYS_64BIT is not set
72# CONFIG_SPE is not set 78# CONFIG_SPE is not set
73CONFIG_MATH_EMULATION=y 79CONFIG_MATH_EMULATION=y
74# CONFIG_CPU_FREQ is not set 80# CONFIG_CPU_FREQ is not set
81# CONFIG_PM is not set
75CONFIG_85xx=y 82CONFIG_85xx=y
76CONFIG_PPC_INDIRECT_PCI_BE=y 83CONFIG_PPC_INDIRECT_PCI_BE=y
77 84
@@ -96,6 +103,7 @@ CONFIG_HIGHMEM=y
96CONFIG_BINFMT_ELF=y 103CONFIG_BINFMT_ELF=y
97CONFIG_BINFMT_MISC=m 104CONFIG_BINFMT_MISC=m
98# CONFIG_CMDLINE_BOOL is not set 105# CONFIG_CMDLINE_BOOL is not set
106CONFIG_ISA_DMA_API=y
99 107
100# 108#
101# Bus options 109# Bus options
@@ -104,15 +112,15 @@ CONFIG_PCI=y
104CONFIG_PCI_DOMAINS=y 112CONFIG_PCI_DOMAINS=y
105# CONFIG_PCI_LEGACY_PROC is not set 113# CONFIG_PCI_LEGACY_PROC is not set
106# CONFIG_PCI_NAMES is not set 114# CONFIG_PCI_NAMES is not set
115# CONFIG_PCI_DEBUG is not set
107 116
108# 117#
109# PCCARD (PCMCIA/CardBus) support 118# PCCARD (PCMCIA/CardBus) support
110# 119#
111# CONFIG_PCCARD is not set 120# CONFIG_PCCARD is not set
112 121CONFIG_RAPIDIO=y
113# 122CONFIG_RAPIDIO_8_BIT_TRANSPORT=y
114# PC-card bridges 123CONFIG_RAPIDIO_DISC_TIMEOUT=30
115#
116 124
117# 125#
118# Advanced setup 126# Advanced setup
@@ -152,7 +160,7 @@ CONFIG_PARPORT=m
152CONFIG_PARPORT_PC=m 160CONFIG_PARPORT_PC=m
153# CONFIG_PARPORT_PC_FIFO is not set 161# CONFIG_PARPORT_PC_FIFO is not set
154# CONFIG_PARPORT_PC_SUPERIO is not set 162# CONFIG_PARPORT_PC_SUPERIO is not set
155# CONFIG_PARPORT_OTHER is not set 163# CONFIG_PARPORT_GSC is not set
156# CONFIG_PARPORT_1284 is not set 164# CONFIG_PARPORT_1284 is not set
157 165
158# 166#
@@ -264,7 +272,6 @@ CONFIG_SCSI_CONSTANTS=y
264# CONFIG_SCSI_BUSLOGIC is not set 272# CONFIG_SCSI_BUSLOGIC is not set
265# CONFIG_SCSI_DMX3191D is not set 273# CONFIG_SCSI_DMX3191D is not set
266# CONFIG_SCSI_EATA is not set 274# CONFIG_SCSI_EATA is not set
267# CONFIG_SCSI_EATA_PIO is not set
268# CONFIG_SCSI_FUTURE_DOMAIN is not set 275# CONFIG_SCSI_FUTURE_DOMAIN is not set
269# CONFIG_SCSI_GDTH is not set 276# CONFIG_SCSI_GDTH is not set
270# CONFIG_SCSI_IPS is not set 277# CONFIG_SCSI_IPS is not set
@@ -274,7 +281,6 @@ CONFIG_SCSI_CONSTANTS=y
274# CONFIG_SCSI_IMM is not set 281# CONFIG_SCSI_IMM is not set
275# CONFIG_SCSI_SYM53C8XX_2 is not set 282# CONFIG_SCSI_SYM53C8XX_2 is not set
276# CONFIG_SCSI_IPR is not set 283# CONFIG_SCSI_IPR is not set
277# CONFIG_SCSI_QLOGIC_ISP is not set
278# CONFIG_SCSI_QLOGIC_FC is not set 284# CONFIG_SCSI_QLOGIC_FC is not set
279# CONFIG_SCSI_QLOGIC_1280 is not set 285# CONFIG_SCSI_QLOGIC_1280 is not set
280CONFIG_SCSI_QLA2XXX=m 286CONFIG_SCSI_QLA2XXX=m
@@ -283,6 +289,7 @@ CONFIG_SCSI_QLA2XXX=m
283# CONFIG_SCSI_QLA2300 is not set 289# CONFIG_SCSI_QLA2300 is not set
284# CONFIG_SCSI_QLA2322 is not set 290# CONFIG_SCSI_QLA2322 is not set
285# CONFIG_SCSI_QLA6312 is not set 291# CONFIG_SCSI_QLA6312 is not set
292# CONFIG_SCSI_LPFC is not set
286# CONFIG_SCSI_DC395x is not set 293# CONFIG_SCSI_DC395x is not set
287# CONFIG_SCSI_DC390T is not set 294# CONFIG_SCSI_DC390T is not set
288# CONFIG_SCSI_NSP32 is not set 295# CONFIG_SCSI_NSP32 is not set
@@ -322,7 +329,6 @@ CONFIG_NET=y
322# 329#
323CONFIG_PACKET=y 330CONFIG_PACKET=y
324# CONFIG_PACKET_MMAP is not set 331# CONFIG_PACKET_MMAP is not set
325# CONFIG_NETLINK_DEV is not set
326CONFIG_UNIX=y 332CONFIG_UNIX=y
327# CONFIG_NET_KEY is not set 333# CONFIG_NET_KEY is not set
328CONFIG_INET=y 334CONFIG_INET=y
@@ -431,7 +437,7 @@ CONFIG_IP_NF_NAT_FTP=m
431# 437#
432# Network testing 438# Network testing
433# 439#
434# CONFIG_NET_PKTGEN is not set 440CONFIG_NET_PKTGEN=y
435# CONFIG_NETPOLL is not set 441# CONFIG_NETPOLL is not set
436# CONFIG_NET_POLL_CONTROLLER is not set 442# CONFIG_NET_POLL_CONTROLLER is not set
437# CONFIG_HAMRADIO is not set 443# CONFIG_HAMRADIO is not set
@@ -499,6 +505,7 @@ CONFIG_GFAR_NAPI=y
499# Wan interfaces 505# Wan interfaces
500# 506#
501# CONFIG_WAN is not set 507# CONFIG_WAN is not set
508CONFIG_RIONET=y
502# CONFIG_FDDI is not set 509# CONFIG_FDDI is not set
503# CONFIG_HIPPI is not set 510# CONFIG_HIPPI is not set
504# CONFIG_PLIP is not set 511# CONFIG_PLIP is not set
@@ -536,20 +543,6 @@ CONFIG_INPUT_EVDEV=m
536# CONFIG_INPUT_EVBUG is not set 543# CONFIG_INPUT_EVBUG is not set
537 544
538# 545#
539# Input I/O drivers
540#
541# CONFIG_GAMEPORT is not set
542CONFIG_SOUND_GAMEPORT=y
543CONFIG_SERIO=y
544CONFIG_SERIO_I8042=y
545CONFIG_SERIO_SERPORT=y
546# CONFIG_SERIO_CT82C710 is not set
547# CONFIG_SERIO_PARKBD is not set
548# CONFIG_SERIO_PCIPS2 is not set
549CONFIG_SERIO_LIBPS2=y
550# CONFIG_SERIO_RAW is not set
551
552#
553# Input Device Drivers 546# Input Device Drivers
554# 547#
555CONFIG_INPUT_KEYBOARD=y 548CONFIG_INPUT_KEYBOARD=y
@@ -567,6 +560,19 @@ CONFIG_MOUSE_PS2=y
567# CONFIG_INPUT_MISC is not set 560# CONFIG_INPUT_MISC is not set
568 561
569# 562#
563# Hardware I/O ports
564#
565CONFIG_SERIO=y
566CONFIG_SERIO_I8042=y
567CONFIG_SERIO_SERPORT=y
568# CONFIG_SERIO_PARKBD is not set
569# CONFIG_SERIO_PCIPS2 is not set
570CONFIG_SERIO_LIBPS2=y
571# CONFIG_SERIO_RAW is not set
572# CONFIG_GAMEPORT is not set
573CONFIG_SOUND_GAMEPORT=y
574
575#
570# Character devices 576# Character devices
571# 577#
572# CONFIG_VT is not set 578# CONFIG_VT is not set
@@ -590,6 +596,7 @@ CONFIG_SERIAL_CPM_SCC2=y
590# CONFIG_SERIAL_CPM_SCC4 is not set 596# CONFIG_SERIAL_CPM_SCC4 is not set
591# CONFIG_SERIAL_CPM_SMC1 is not set 597# CONFIG_SERIAL_CPM_SMC1 is not set
592# CONFIG_SERIAL_CPM_SMC2 is not set 598# CONFIG_SERIAL_CPM_SMC2 is not set
599# CONFIG_SERIAL_JSM is not set
593CONFIG_UNIX98_PTYS=y 600CONFIG_UNIX98_PTYS=y
594CONFIG_LEGACY_PTYS=y 601CONFIG_LEGACY_PTYS=y
595CONFIG_LEGACY_PTY_COUNT=256 602CONFIG_LEGACY_PTY_COUNT=256
@@ -626,6 +633,11 @@ CONFIG_DRM=m
626# CONFIG_RAW_DRIVER is not set 633# CONFIG_RAW_DRIVER is not set
627 634
628# 635#
636# TPM devices
637#
638# CONFIG_TCG_TPM is not set
639
640#
629# I2C support 641# I2C support
630# 642#
631CONFIG_I2C=m 643CONFIG_I2C=m
@@ -648,12 +660,12 @@ CONFIG_I2C_ALGOBIT=m
648# CONFIG_I2C_AMD8111 is not set 660# CONFIG_I2C_AMD8111 is not set
649# CONFIG_I2C_I801 is not set 661# CONFIG_I2C_I801 is not set
650# CONFIG_I2C_I810 is not set 662# CONFIG_I2C_I810 is not set
663# CONFIG_I2C_PIIX4 is not set
651# CONFIG_I2C_ISA is not set 664# CONFIG_I2C_ISA is not set
652# CONFIG_I2C_MPC is not set 665# CONFIG_I2C_MPC is not set
653# CONFIG_I2C_NFORCE2 is not set 666# CONFIG_I2C_NFORCE2 is not set
654# CONFIG_I2C_PARPORT is not set 667# CONFIG_I2C_PARPORT is not set
655# CONFIG_I2C_PARPORT_LIGHT is not set 668# CONFIG_I2C_PARPORT_LIGHT is not set
656# CONFIG_I2C_PIIX4 is not set
657# CONFIG_I2C_PROSAVAGE is not set 669# CONFIG_I2C_PROSAVAGE is not set
658# CONFIG_I2C_SAVAGE4 is not set 670# CONFIG_I2C_SAVAGE4 is not set
659# CONFIG_SCx200_ACB is not set 671# CONFIG_SCx200_ACB is not set
@@ -677,7 +689,9 @@ CONFIG_I2C_ALGOBIT=m
677# CONFIG_SENSORS_ASB100 is not set 689# CONFIG_SENSORS_ASB100 is not set
678# CONFIG_SENSORS_DS1621 is not set 690# CONFIG_SENSORS_DS1621 is not set
679# CONFIG_SENSORS_FSCHER is not set 691# CONFIG_SENSORS_FSCHER is not set
692# CONFIG_SENSORS_FSCPOS is not set
680# CONFIG_SENSORS_GL518SM is not set 693# CONFIG_SENSORS_GL518SM is not set
694# CONFIG_SENSORS_GL520SM is not set
681# CONFIG_SENSORS_IT87 is not set 695# CONFIG_SENSORS_IT87 is not set
682# CONFIG_SENSORS_LM63 is not set 696# CONFIG_SENSORS_LM63 is not set
683# CONFIG_SENSORS_LM75 is not set 697# CONFIG_SENSORS_LM75 is not set
@@ -688,9 +702,11 @@ CONFIG_I2C_ALGOBIT=m
688# CONFIG_SENSORS_LM85 is not set 702# CONFIG_SENSORS_LM85 is not set
689# CONFIG_SENSORS_LM87 is not set 703# CONFIG_SENSORS_LM87 is not set
690# CONFIG_SENSORS_LM90 is not set 704# CONFIG_SENSORS_LM90 is not set
705# CONFIG_SENSORS_LM92 is not set
691# CONFIG_SENSORS_MAX1619 is not set 706# CONFIG_SENSORS_MAX1619 is not set
692# CONFIG_SENSORS_PC87360 is not set 707# CONFIG_SENSORS_PC87360 is not set
693# CONFIG_SENSORS_SMSC47B397 is not set 708# CONFIG_SENSORS_SMSC47B397 is not set
709# CONFIG_SENSORS_SIS5595 is not set
694# CONFIG_SENSORS_SMSC47M1 is not set 710# CONFIG_SENSORS_SMSC47M1 is not set
695# CONFIG_SENSORS_VIA686A is not set 711# CONFIG_SENSORS_VIA686A is not set
696# CONFIG_SENSORS_W83781D is not set 712# CONFIG_SENSORS_W83781D is not set
@@ -700,10 +716,12 @@ CONFIG_I2C_ALGOBIT=m
700# 716#
701# Other I2C Chip support 717# Other I2C Chip support
702# 718#
719# CONFIG_SENSORS_DS1337 is not set
703# CONFIG_SENSORS_EEPROM is not set 720# CONFIG_SENSORS_EEPROM is not set
704# CONFIG_SENSORS_PCF8574 is not set 721# CONFIG_SENSORS_PCF8574 is not set
705# CONFIG_SENSORS_PCF8591 is not set 722# CONFIG_SENSORS_PCF8591 is not set
706# CONFIG_SENSORS_RTC8564 is not set 723# CONFIG_SENSORS_RTC8564 is not set
724# CONFIG_SENSORS_M41T00 is not set
707# CONFIG_I2C_DEBUG_CORE is not set 725# CONFIG_I2C_DEBUG_CORE is not set
708# CONFIG_I2C_DEBUG_ALGO is not set 726# CONFIG_I2C_DEBUG_ALGO is not set
709# CONFIG_I2C_DEBUG_BUS is not set 727# CONFIG_I2C_DEBUG_BUS is not set
@@ -732,7 +750,6 @@ CONFIG_I2C_ALGOBIT=m
732# Graphics support 750# Graphics support
733# 751#
734# CONFIG_FB is not set 752# CONFIG_FB is not set
735# CONFIG_BACKLIGHT_LCD_SUPPORT is not set
736 753
737# 754#
738# Sound 755# Sound
@@ -752,13 +769,9 @@ CONFIG_SOUND=m
752# 769#
753# USB support 770# USB support
754# 771#
755# CONFIG_USB is not set
756CONFIG_USB_ARCH_HAS_HCD=y 772CONFIG_USB_ARCH_HAS_HCD=y
757CONFIG_USB_ARCH_HAS_OHCI=y 773CONFIG_USB_ARCH_HAS_OHCI=y
758 774# CONFIG_USB is not set
759#
760# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support' may also be needed; see USB_STORAGE Help for more information
761#
762 775
763# 776#
764# USB Gadget Support 777# USB Gadget Support
@@ -789,6 +802,10 @@ CONFIG_JBD_DEBUG=y
789CONFIG_FS_MBCACHE=y 802CONFIG_FS_MBCACHE=y
790# CONFIG_REISERFS_FS is not set 803# CONFIG_REISERFS_FS is not set
791# CONFIG_JFS_FS is not set 804# CONFIG_JFS_FS is not set
805
806#
807# XFS support
808#
792# CONFIG_XFS_FS is not set 809# CONFIG_XFS_FS is not set
793# CONFIG_MINIX_FS is not set 810# CONFIG_MINIX_FS is not set
794# CONFIG_ROMFS_FS is not set 811# CONFIG_ROMFS_FS is not set
@@ -859,7 +876,6 @@ CONFIG_NFS_V3=y
859CONFIG_ROOT_NFS=y 876CONFIG_ROOT_NFS=y
860CONFIG_LOCKD=y 877CONFIG_LOCKD=y
861CONFIG_LOCKD_V4=y 878CONFIG_LOCKD_V4=y
862# CONFIG_EXPORTFS is not set
863CONFIG_SUNRPC=y 879CONFIG_SUNRPC=y
864# CONFIG_RPCSEC_GSS_KRB5 is not set 880# CONFIG_RPCSEC_GSS_KRB5 is not set
865# CONFIG_RPCSEC_GSS_SPKM3 is not set 881# CONFIG_RPCSEC_GSS_SPKM3 is not set
@@ -942,8 +958,10 @@ CONFIG_ZLIB_INFLATE=m
942# 958#
943# Kernel hacking 959# Kernel hacking
944# 960#
961# CONFIG_PRINTK_TIME is not set
945CONFIG_DEBUG_KERNEL=y 962CONFIG_DEBUG_KERNEL=y
946# CONFIG_MAGIC_SYSRQ is not set 963# CONFIG_MAGIC_SYSRQ is not set
964CONFIG_LOG_BUF_SHIFT=14
947# CONFIG_SCHEDSTATS is not set 965# CONFIG_SCHEDSTATS is not set
948# CONFIG_DEBUG_SLAB is not set 966# CONFIG_DEBUG_SLAB is not set
949# CONFIG_DEBUG_SPINLOCK is not set 967# CONFIG_DEBUG_SPINLOCK is not set
diff --git a/arch/ppc/kernel/Makefile b/arch/ppc/kernel/Makefile
index b35346df1e37..76a55a438f23 100644
--- a/arch/ppc/kernel/Makefile
+++ b/arch/ppc/kernel/Makefile
@@ -22,6 +22,7 @@ obj-$(CONFIG_POWER4) += cpu_setup_power4.o
22obj-$(CONFIG_MODULES) += module.o ppc_ksyms.o 22obj-$(CONFIG_MODULES) += module.o ppc_ksyms.o
23obj-$(CONFIG_NOT_COHERENT_CACHE) += dma-mapping.o 23obj-$(CONFIG_NOT_COHERENT_CACHE) += dma-mapping.o
24obj-$(CONFIG_PCI) += pci.o 24obj-$(CONFIG_PCI) += pci.o
25obj-$(CONFIG_RAPIDIO) += rio.o
25obj-$(CONFIG_KGDB) += ppc-stub.o 26obj-$(CONFIG_KGDB) += ppc-stub.o
26obj-$(CONFIG_SMP) += smp.o smp-tbsync.o 27obj-$(CONFIG_SMP) += smp.o smp-tbsync.o
27obj-$(CONFIG_TAU) += temp.o 28obj-$(CONFIG_TAU) += temp.o
@@ -45,7 +46,6 @@ obj-$(CONFIG_MODULES) += module.o
45obj-$(CONFIG_NOT_COHERENT_CACHE) += dma-mapping.o 46obj-$(CONFIG_NOT_COHERENT_CACHE) += dma-mapping.o
46obj-$(CONFIG_PCI) += pci.o 47obj-$(CONFIG_PCI) += pci.o
47obj-$(CONFIG_KGDB) += ppc-stub.o 48obj-$(CONFIG_KGDB) += ppc-stub.o
48obj-$(CONFIG_SMP) += smp.o smp-tbsync.o
49obj-$(CONFIG_TAU) += temp.o 49obj-$(CONFIG_TAU) += temp.o
50ifndef CONFIG_E200 50ifndef CONFIG_E200
51obj-$(CONFIG_FSL_BOOKE) += perfmon_fsl_booke.o 51obj-$(CONFIG_FSL_BOOKE) += perfmon_fsl_booke.o
diff --git a/arch/ppc/kernel/bitops.c b/arch/ppc/kernel/bitops.c
deleted file mode 100644
index 7f53d193968b..000000000000
--- a/arch/ppc/kernel/bitops.c
+++ /dev/null
@@ -1,126 +0,0 @@
1/*
2 * Copyright (C) 1996 Paul Mackerras.
3 */
4
5#include <linux/kernel.h>
6#include <linux/bitops.h>
7
8/*
9 * If the bitops are not inlined in bitops.h, they are defined here.
10 * -- paulus
11 */
12#if !__INLINE_BITOPS
13void set_bit(int nr, volatile void * addr)
14{
15 unsigned long old;
16 unsigned long mask = 1 << (nr & 0x1f);
17 unsigned long *p = ((unsigned long *)addr) + (nr >> 5);
18
19 __asm__ __volatile__(SMP_WMB "\n\
201: lwarx %0,0,%3 \n\
21 or %0,%0,%2 \n"
22 PPC405_ERR77(0,%3)
23" stwcx. %0,0,%3 \n\
24 bne 1b"
25 SMP_MB
26 : "=&r" (old), "=m" (*p)
27 : "r" (mask), "r" (p), "m" (*p)
28 : "cc" );
29}
30
31void clear_bit(int nr, volatile void *addr)
32{
33 unsigned long old;
34 unsigned long mask = 1 << (nr & 0x1f);
35 unsigned long *p = ((unsigned long *)addr) + (nr >> 5);
36
37 __asm__ __volatile__(SMP_WMB "\n\
381: lwarx %0,0,%3 \n\
39 andc %0,%0,%2 \n"
40 PPC405_ERR77(0,%3)
41" stwcx. %0,0,%3 \n\
42 bne 1b"
43 SMP_MB
44 : "=&r" (old), "=m" (*p)
45 : "r" (mask), "r" (p), "m" (*p)
46 : "cc");
47}
48
49void change_bit(int nr, volatile void *addr)
50{
51 unsigned long old;
52 unsigned long mask = 1 << (nr & 0x1f);
53 unsigned long *p = ((unsigned long *)addr) + (nr >> 5);
54
55 __asm__ __volatile__(SMP_WMB "\n\
561: lwarx %0,0,%3 \n\
57 xor %0,%0,%2 \n"
58 PPC405_ERR77(0,%3)
59" stwcx. %0,0,%3 \n\
60 bne 1b"
61 SMP_MB
62 : "=&r" (old), "=m" (*p)
63 : "r" (mask), "r" (p), "m" (*p)
64 : "cc");
65}
66
67int test_and_set_bit(int nr, volatile void *addr)
68{
69 unsigned int old, t;
70 unsigned int mask = 1 << (nr & 0x1f);
71 volatile unsigned int *p = ((volatile unsigned int *)addr) + (nr >> 5);
72
73 __asm__ __volatile__(SMP_WMB "\n\
741: lwarx %0,0,%4 \n\
75 or %1,%0,%3 \n"
76 PPC405_ERR77(0,%4)
77" stwcx. %1,0,%4 \n\
78 bne 1b"
79 SMP_MB
80 : "=&r" (old), "=&r" (t), "=m" (*p)
81 : "r" (mask), "r" (p), "m" (*p)
82 : "cc");
83
84 return (old & mask) != 0;
85}
86
87int test_and_clear_bit(int nr, volatile void *addr)
88{
89 unsigned int old, t;
90 unsigned int mask = 1 << (nr & 0x1f);
91 volatile unsigned int *p = ((volatile unsigned int *)addr) + (nr >> 5);
92
93 __asm__ __volatile__(SMP_WMB "\n\
941: lwarx %0,0,%4 \n\
95 andc %1,%0,%3 \n"
96 PPC405_ERR77(0,%4)
97" stwcx. %1,0,%4 \n\
98 bne 1b"
99 SMP_MB
100 : "=&r" (old), "=&r" (t), "=m" (*p)
101 : "r" (mask), "r" (p), "m" (*p)
102 : "cc");
103
104 return (old & mask) != 0;
105}
106
107int test_and_change_bit(int nr, volatile void *addr)
108{
109 unsigned int old, t;
110 unsigned int mask = 1 << (nr & 0x1f);
111 volatile unsigned int *p = ((volatile unsigned int *)addr) + (nr >> 5);
112
113 __asm__ __volatile__(SMP_WMB "\n\
1141: lwarx %0,0,%4 \n\
115 xor %1,%0,%3 \n"
116 PPC405_ERR77(0,%4)
117" stwcx. %1,0,%4 \n\
118 bne 1b"
119 SMP_MB
120 : "=&r" (old), "=&r" (t), "=m" (*p)
121 : "r" (mask), "r" (p), "m" (*p)
122 : "cc");
123
124 return (old & mask) != 0;
125}
126#endif /* !__INLINE_BITOPS */
diff --git a/arch/ppc/kernel/head_44x.S b/arch/ppc/kernel/head_44x.S
index 8b49679fad54..677c571aa276 100644
--- a/arch/ppc/kernel/head_44x.S
+++ b/arch/ppc/kernel/head_44x.S
@@ -190,8 +190,8 @@ skpinv: addi r4,r4,1 /* Increment */
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#ifdef UART0_PHYS_ERPN
194 ori r4,r4,0x0001 /* ERPN is 1 for second 4GB page */ 194 ori r4,r4,UART0_PHYS_ERPN /* Add ERPN if above 4GB */
195#endif 195#endif
196 196
197 /* attrib fields */ 197 /* attrib fields */
diff --git a/arch/ppc/kernel/idle.c b/arch/ppc/kernel/idle.c
index 11e5b44713f7..3c4e4cb61074 100644
--- a/arch/ppc/kernel/idle.c
+++ b/arch/ppc/kernel/idle.c
@@ -53,10 +53,6 @@ void default_idle(void)
53 } 53 }
54#endif 54#endif
55 } 55 }
56 if (need_resched())
57 schedule();
58 if (cpu_is_offline(cpu) && system_state == SYSTEM_RUNNING)
59 cpu_die();
60} 56}
61 57
62/* 58/*
@@ -64,11 +60,22 @@ void default_idle(void)
64 */ 60 */
65void cpu_idle(void) 61void cpu_idle(void)
66{ 62{
67 for (;;) 63 int cpu = smp_processor_id();
68 if (ppc_md.idle != NULL) 64
69 ppc_md.idle(); 65 for (;;) {
70 else 66 while (need_resched()) {
71 default_idle(); 67 if (ppc_md.idle != NULL)
68 ppc_md.idle();
69 else
70 default_idle();
71 }
72
73 if (cpu_is_offline(cpu) && system_state == SYSTEM_RUNNING)
74 cpu_die();
75 preempt_enable_no_resched();
76 schedule();
77 preempt_disable();
78 }
72} 79}
73 80
74#if defined(CONFIG_SYSCTL) && defined(CONFIG_6xx) 81#if defined(CONFIG_SYSCTL) && defined(CONFIG_6xx)
diff --git a/arch/ppc/kernel/irq.c b/arch/ppc/kernel/irq.c
index 772e428aaa59..fbb2b9f8922c 100644
--- a/arch/ppc/kernel/irq.c
+++ b/arch/ppc/kernel/irq.c
@@ -126,7 +126,7 @@ skip:
126 seq_puts(p, " PowerPC Thermal Assist (cpu temp)\n"); 126 seq_puts(p, " PowerPC Thermal Assist (cpu temp)\n");
127 } 127 }
128#endif 128#endif
129#ifdef CONFIG_SMP 129#if defined(CONFIG_SMP) && !defined(CONFIG_PPC_MERGE)
130 /* should this be per processor send/receive? */ 130 /* should this be per processor send/receive? */
131 seq_printf(p, "IPI (recv/sent): %10u/%u\n", 131 seq_printf(p, "IPI (recv/sent): %10u/%u\n",
132 atomic_read(&ipi_recv), atomic_read(&ipi_sent)); 132 atomic_read(&ipi_recv), atomic_read(&ipi_sent));
diff --git a/arch/ppc/kernel/machine_kexec.c b/arch/ppc/kernel/machine_kexec.c
index a72787747df7..a882b0dbe8de 100644
--- a/arch/ppc/kernel/machine_kexec.c
+++ b/arch/ppc/kernel/machine_kexec.c
@@ -32,7 +32,7 @@ const extern unsigned int relocate_new_kernel_size;
32 * Provide a dummy crash_notes definition while crash dump arrives to ppc. 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. 33 * This prevents breakage of crash_notes attribute in kernel/ksysfs.c.
34 */ 34 */
35void *crash_notes = NULL; 35note_buf_t crash_notes[NR_CPUS];
36 36
37void machine_shutdown(void) 37void machine_shutdown(void)
38{ 38{
diff --git a/arch/ppc/kernel/misc.S b/arch/ppc/kernel/misc.S
index 3056ede2424d..ae6af29938a1 100644
--- a/arch/ppc/kernel/misc.S
+++ b/arch/ppc/kernel/misc.S
@@ -25,6 +25,11 @@
25#include <asm/thread_info.h> 25#include <asm/thread_info.h>
26#include <asm/asm-offsets.h> 26#include <asm/asm-offsets.h>
27 27
28#ifdef CONFIG_8xx
29#define ISYNC_8xx isync
30#else
31#define ISYNC_8xx
32#endif
28 .text 33 .text
29 34
30 .align 5 35 .align 5
@@ -800,8 +805,18 @@ _GLOBAL(_insb)
800 subi r4,r4,1 805 subi r4,r4,1
801 blelr- 806 blelr-
80200: lbz r5,0(r3) 80700: lbz r5,0(r3)
803 eieio 80801: eieio
804 stbu r5,1(r4) 80902: stbu r5,1(r4)
810 ISYNC_8xx
811 .section .fixup,"ax"
81203: blr
813 .text
814 .section __ex_table, "a"
815 .align 2
816 .long 00b, 03b
817 .long 01b, 03b
818 .long 02b, 03b
819 .text
805 bdnz 00b 820 bdnz 00b
806 blr 821 blr
807 822
@@ -811,8 +826,18 @@ _GLOBAL(_outsb)
811 subi r4,r4,1 826 subi r4,r4,1
812 blelr- 827 blelr-
81300: lbzu r5,1(r4) 82800: lbzu r5,1(r4)
814 stb r5,0(r3) 82901: stb r5,0(r3)
815 eieio 83002: eieio
831 ISYNC_8xx
832 .section .fixup,"ax"
83303: blr
834 .text
835 .section __ex_table, "a"
836 .align 2
837 .long 00b, 03b
838 .long 01b, 03b
839 .long 02b, 03b
840 .text
816 bdnz 00b 841 bdnz 00b
817 blr 842 blr
818 843
@@ -822,8 +847,18 @@ _GLOBAL(_insw)
822 subi r4,r4,2 847 subi r4,r4,2
823 blelr- 848 blelr-
82400: lhbrx r5,0,r3 84900: lhbrx r5,0,r3
825 eieio 85001: eieio
826 sthu r5,2(r4) 85102: sthu r5,2(r4)
852 ISYNC_8xx
853 .section .fixup,"ax"
85403: blr
855 .text
856 .section __ex_table, "a"
857 .align 2
858 .long 00b, 03b
859 .long 01b, 03b
860 .long 02b, 03b
861 .text
827 bdnz 00b 862 bdnz 00b
828 blr 863 blr
829 864
@@ -833,8 +868,18 @@ _GLOBAL(_outsw)
833 subi r4,r4,2 868 subi r4,r4,2
834 blelr- 869 blelr-
83500: lhzu r5,2(r4) 87000: lhzu r5,2(r4)
836 eieio 87101: eieio
837 sthbrx r5,0,r3 87202: sthbrx r5,0,r3
873 ISYNC_8xx
874 .section .fixup,"ax"
87503: blr
876 .text
877 .section __ex_table, "a"
878 .align 2
879 .long 00b, 03b
880 .long 01b, 03b
881 .long 02b, 03b
882 .text
838 bdnz 00b 883 bdnz 00b
839 blr 884 blr
840 885
@@ -844,8 +889,18 @@ _GLOBAL(_insl)
844 subi r4,r4,4 889 subi r4,r4,4
845 blelr- 890 blelr-
84600: lwbrx r5,0,r3 89100: lwbrx r5,0,r3
847 eieio 89201: eieio
848 stwu r5,4(r4) 89302: stwu r5,4(r4)
894 ISYNC_8xx
895 .section .fixup,"ax"
89603: blr
897 .text
898 .section __ex_table, "a"
899 .align 2
900 .long 00b, 03b
901 .long 01b, 03b
902 .long 02b, 03b
903 .text
849 bdnz 00b 904 bdnz 00b
850 blr 905 blr
851 906
@@ -855,8 +910,18 @@ _GLOBAL(_outsl)
855 subi r4,r4,4 910 subi r4,r4,4
856 blelr- 911 blelr-
85700: lwzu r5,4(r4) 91200: lwzu r5,4(r4)
858 stwbrx r5,0,r3 91301: stwbrx r5,0,r3
859 eieio 91402: eieio
915 ISYNC_8xx
916 .section .fixup,"ax"
91703: blr
918 .text
919 .section __ex_table, "a"
920 .align 2
921 .long 00b, 03b
922 .long 01b, 03b
923 .long 02b, 03b
924 .text
860 bdnz 00b 925 bdnz 00b
861 blr 926 blr
862 927
@@ -867,8 +932,18 @@ _GLOBAL(_insw_ns)
867 subi r4,r4,2 932 subi r4,r4,2
868 blelr- 933 blelr-
86900: lhz r5,0(r3) 93400: lhz r5,0(r3)
870 eieio 93501: eieio
871 sthu r5,2(r4) 93602: sthu r5,2(r4)
937 ISYNC_8xx
938 .section .fixup,"ax"
93903: blr
940 .text
941 .section __ex_table, "a"
942 .align 2
943 .long 00b, 03b
944 .long 01b, 03b
945 .long 02b, 03b
946 .text
872 bdnz 00b 947 bdnz 00b
873 blr 948 blr
874 949
@@ -879,8 +954,18 @@ _GLOBAL(_outsw_ns)
879 subi r4,r4,2 954 subi r4,r4,2
880 blelr- 955 blelr-
88100: lhzu r5,2(r4) 95600: lhzu r5,2(r4)
882 sth r5,0(r3) 95701: sth r5,0(r3)
883 eieio 95802: eieio
959 ISYNC_8xx
960 .section .fixup,"ax"
96103: blr
962 .text
963 .section __ex_table, "a"
964 .align 2
965 .long 00b, 03b
966 .long 01b, 03b
967 .long 02b, 03b
968 .text
884 bdnz 00b 969 bdnz 00b
885 blr 970 blr
886 971
@@ -891,8 +976,18 @@ _GLOBAL(_insl_ns)
891 subi r4,r4,4 976 subi r4,r4,4
892 blelr- 977 blelr-
89300: lwz r5,0(r3) 97800: lwz r5,0(r3)
894 eieio 97901: eieio
895 stwu r5,4(r4) 98002: stwu r5,4(r4)
981 ISYNC_8xx
982 .section .fixup,"ax"
98303: blr
984 .text
985 .section __ex_table, "a"
986 .align 2
987 .long 00b, 03b
988 .long 01b, 03b
989 .long 02b, 03b
990 .text
896 bdnz 00b 991 bdnz 00b
897 blr 992 blr
898 993
@@ -903,8 +998,18 @@ _GLOBAL(_outsl_ns)
903 subi r4,r4,4 998 subi r4,r4,4
904 blelr- 999 blelr-
90500: lwzu r5,4(r4) 100000: lwzu r5,4(r4)
906 stw r5,0(r3) 100101: stw r5,0(r3)
907 eieio 100202: eieio
1003 ISYNC_8xx
1004 .section .fixup,"ax"
100503: blr
1006 .text
1007 .section __ex_table, "a"
1008 .align 2
1009 .long 00b, 03b
1010 .long 01b, 03b
1011 .long 02b, 03b
1012 .text
908 bdnz 00b 1013 bdnz 00b
909 blr 1014 blr
910 1015
diff --git a/arch/ppc/kernel/ppc_ksyms.c b/arch/ppc/kernel/ppc_ksyms.c
index ae24196d78f6..e0ca61b37f4f 100644
--- a/arch/ppc/kernel/ppc_ksyms.c
+++ b/arch/ppc/kernel/ppc_ksyms.c
@@ -131,6 +131,11 @@ EXPORT_SYMBOL(outw);
131EXPORT_SYMBOL(outl); 131EXPORT_SYMBOL(outl);
132EXPORT_SYMBOL(outsl);*/ 132EXPORT_SYMBOL(outsl);*/
133 133
134EXPORT_SYMBOL(__ide_mm_insl);
135EXPORT_SYMBOL(__ide_mm_outsw);
136EXPORT_SYMBOL(__ide_mm_insw);
137EXPORT_SYMBOL(__ide_mm_outsl);
138
134EXPORT_SYMBOL(_insb); 139EXPORT_SYMBOL(_insb);
135EXPORT_SYMBOL(_outsb); 140EXPORT_SYMBOL(_outsb);
136EXPORT_SYMBOL(_insw); 141EXPORT_SYMBOL(_insw);
diff --git a/arch/ppc/kernel/rio.c b/arch/ppc/kernel/rio.c
new file mode 100644
index 000000000000..29487fedfc76
--- /dev/null
+++ b/arch/ppc/kernel/rio.c
@@ -0,0 +1,52 @@
1/*
2 * RapidIO PPC32 support
3 *
4 * Copyright 2005 MontaVista Software, Inc.
5 * Matt Porter <mporter@kernel.crashing.org>
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#include <linux/init.h>
14#include <linux/kernel.h>
15#include <linux/rio.h>
16
17#include <asm/rio.h>
18
19/**
20 * platform_rio_init - Do platform specific RIO init
21 *
22 * Any platform specific initialization of RapdIO
23 * hardware is done here as well as registration
24 * of any active master ports in the system.
25 */
26void __attribute__ ((weak))
27 platform_rio_init(void)
28{
29 printk(KERN_WARNING "RIO: No platform_rio_init() present\n");
30}
31
32/**
33 * ppc_rio_init - Do PPC32 RIO init
34 *
35 * Calls platform-specific RIO init code and then calls
36 * rio_init_mports() to initialize any master ports that
37 * have been registered with the RIO subsystem.
38 */
39static int __init ppc_rio_init(void)
40{
41 printk(KERN_INFO "RIO: RapidIO init\n");
42
43 /* Platform specific initialization */
44 platform_rio_init();
45
46 /* Enumerate all registered ports */
47 rio_init_mports();
48
49 return 0;
50}
51
52subsys_initcall(ppc_rio_init);
diff --git a/arch/ppc/kernel/smp.c b/arch/ppc/kernel/smp.c
index bc5bf1124836..43b8fc2ca591 100644
--- a/arch/ppc/kernel/smp.c
+++ b/arch/ppc/kernel/smp.c
@@ -341,6 +341,7 @@ int __devinit start_secondary(void *unused)
341 cpu = smp_processor_id(); 341 cpu = smp_processor_id();
342 smp_store_cpu_info(cpu); 342 smp_store_cpu_info(cpu);
343 set_dec(tb_ticks_per_jiffy); 343 set_dec(tb_ticks_per_jiffy);
344 preempt_disable();
344 cpu_callin_map[cpu] = 1; 345 cpu_callin_map[cpu] = 1;
345 346
346 printk("CPU %d done callin...\n", cpu); 347 printk("CPU %d done callin...\n", cpu);
diff --git a/arch/ppc/kernel/traps.c b/arch/ppc/kernel/traps.c
index f265b81e7008..9dbc4d28fa28 100644
--- a/arch/ppc/kernel/traps.c
+++ b/arch/ppc/kernel/traps.c
@@ -49,7 +49,7 @@ extern int xmon_sstep(struct pt_regs *regs);
49extern int xmon_iabr_match(struct pt_regs *regs); 49extern int xmon_iabr_match(struct pt_regs *regs);
50extern int xmon_dabr_match(struct pt_regs *regs); 50extern int xmon_dabr_match(struct pt_regs *regs);
51 51
52void (*debugger)(struct pt_regs *regs) = xmon; 52int (*debugger)(struct pt_regs *regs) = xmon;
53int (*debugger_bpt)(struct pt_regs *regs) = xmon_bpt; 53int (*debugger_bpt)(struct pt_regs *regs) = xmon_bpt;
54int (*debugger_sstep)(struct pt_regs *regs) = xmon_sstep; 54int (*debugger_sstep)(struct pt_regs *regs) = xmon_sstep;
55int (*debugger_iabr_match)(struct pt_regs *regs) = xmon_iabr_match; 55int (*debugger_iabr_match)(struct pt_regs *regs) = xmon_iabr_match;
@@ -57,7 +57,7 @@ int (*debugger_dabr_match)(struct pt_regs *regs) = xmon_dabr_match;
57void (*debugger_fault_handler)(struct pt_regs *regs); 57void (*debugger_fault_handler)(struct pt_regs *regs);
58#else 58#else
59#ifdef CONFIG_KGDB 59#ifdef CONFIG_KGDB
60void (*debugger)(struct pt_regs *regs); 60int (*debugger)(struct pt_regs *regs);
61int (*debugger_bpt)(struct pt_regs *regs); 61int (*debugger_bpt)(struct pt_regs *regs);
62int (*debugger_sstep)(struct pt_regs *regs); 62int (*debugger_sstep)(struct pt_regs *regs);
63int (*debugger_iabr_match)(struct pt_regs *regs); 63int (*debugger_iabr_match)(struct pt_regs *regs);
@@ -159,7 +159,7 @@ void _exception(int signr, struct pt_regs *regs, int code, unsigned long addr)
159 */ 159 */
160static inline int check_io_access(struct pt_regs *regs) 160static inline int check_io_access(struct pt_regs *regs)
161{ 161{
162#ifdef CONFIG_PPC_PMAC 162#if defined CONFIG_PPC_PMAC || defined CONFIG_8xx
163 unsigned long msr = regs->msr; 163 unsigned long msr = regs->msr;
164 const struct exception_table_entry *entry; 164 const struct exception_table_entry *entry;
165 unsigned int *nip = (unsigned int *)regs->nip; 165 unsigned int *nip = (unsigned int *)regs->nip;
@@ -178,7 +178,11 @@ static inline int check_io_access(struct pt_regs *regs)
178 nip -= 2; 178 nip -= 2;
179 else if (*nip == 0x4c00012c) /* isync */ 179 else if (*nip == 0x4c00012c) /* isync */
180 --nip; 180 --nip;
181 if (*nip == 0x7c0004ac || (*nip >> 26) == 3) { 181 /* eieio from I/O string functions */
182 else if ((*nip) == 0x7c0006ac || *(nip+1) == 0x7c0006ac)
183 nip += 2;
184 if (*nip == 0x7c0004ac || (*nip >> 26) == 3 ||
185 (*(nip+1) >> 26) == 3) {
182 /* sync or twi */ 186 /* sync or twi */
183 unsigned int rb; 187 unsigned int rb;
184 188
@@ -606,22 +610,22 @@ int check_bug_trap(struct pt_regs *regs)
606 if (bug->line & BUG_WARNING_TRAP) { 610 if (bug->line & BUG_WARNING_TRAP) {
607 /* this is a WARN_ON rather than BUG/BUG_ON */ 611 /* this is a WARN_ON rather than BUG/BUG_ON */
608#ifdef CONFIG_XMON 612#ifdef CONFIG_XMON
609 xmon_printf(KERN_ERR "Badness in %s at %s:%d\n", 613 xmon_printf(KERN_ERR "Badness in %s at %s:%ld\n",
610 bug->function, bug->file, 614 bug->function, bug->file,
611 bug->line & ~BUG_WARNING_TRAP); 615 bug->line & ~BUG_WARNING_TRAP);
612#endif /* CONFIG_XMON */ 616#endif /* CONFIG_XMON */
613 printk(KERN_ERR "Badness in %s at %s:%d\n", 617 printk(KERN_ERR "Badness in %s at %s:%ld\n",
614 bug->function, bug->file, 618 bug->function, bug->file,
615 bug->line & ~BUG_WARNING_TRAP); 619 bug->line & ~BUG_WARNING_TRAP);
616 dump_stack(); 620 dump_stack();
617 return 1; 621 return 1;
618 } 622 }
619#ifdef CONFIG_XMON 623#ifdef CONFIG_XMON
620 xmon_printf(KERN_CRIT "kernel BUG in %s at %s:%d!\n", 624 xmon_printf(KERN_CRIT "kernel BUG in %s at %s:%ld!\n",
621 bug->function, bug->file, bug->line); 625 bug->function, bug->file, bug->line);
622 xmon(regs); 626 xmon(regs);
623#endif /* CONFIG_XMON */ 627#endif /* CONFIG_XMON */
624 printk(KERN_CRIT "kernel BUG in %s at %s:%d!\n", 628 printk(KERN_CRIT "kernel BUG in %s at %s:%ld!\n",
625 bug->function, bug->file, bug->line); 629 bug->function, bug->file, bug->line);
626 630
627 return 0; 631 return 0;
diff --git a/arch/ppc/platforms/4xx/Kconfig b/arch/ppc/platforms/4xx/Kconfig
index 76f4476cab44..d8837911bbc6 100644
--- a/arch/ppc/platforms/4xx/Kconfig
+++ b/arch/ppc/platforms/4xx/Kconfig
@@ -82,6 +82,12 @@ config LUAN
82 help 82 help
83 This option enables support for the IBM PPC440SP evaluation board. 83 This option enables support for the IBM PPC440SP evaluation board.
84 84
85config YUCCA
86 bool "Yucca"
87 select WANT_EARLY_SERIAL
88 help
89 This option enables support for the AMCC PPC440SPe evaluation board.
90
85config OCOTEA 91config OCOTEA
86 bool "Ocotea" 92 bool "Ocotea"
87 select WANT_EARLY_SERIAL 93 select WANT_EARLY_SERIAL
@@ -124,9 +130,14 @@ config 440SP
124 depends on LUAN 130 depends on LUAN
125 default y 131 default y
126 132
133config 440SPE
134 bool
135 depends on YUCCA
136 default y
137
127config 440 138config 440
128 bool 139 bool
129 depends on 440GP || 440SP || 440EP 140 depends on 440GP || 440SP || 440SPE || 440EP
130 default y 141 default y
131 142
132config 440A 143config 440A
@@ -158,7 +169,7 @@ config BOOKE
158 169
159config IBM_OCP 170config IBM_OCP
160 bool 171 bool
161 depends on ASH || BAMBOO || BUBINGA || CPCI405 || EBONY || EP405 || LUAN || OCOTEA || REDWOOD_5 || REDWOOD_6 || SYCAMORE || WALNUT 172 depends on ASH || BAMBOO || BUBINGA || CPCI405 || EBONY || EP405 || LUAN || YUCCA || OCOTEA || REDWOOD_5 || REDWOOD_6 || SYCAMORE || WALNUT
162 default y 173 default y
163 174
164config XILINX_OCP 175config XILINX_OCP
@@ -168,7 +179,7 @@ config XILINX_OCP
168 179
169config IBM_EMAC4 180config IBM_EMAC4
170 bool 181 bool
171 depends on 440GX || 440SP 182 depends on 440GX || 440SP || 440SPE
172 default y 183 default y
173 184
174config BIOS_FIXUP 185config BIOS_FIXUP
@@ -214,7 +225,7 @@ config EMBEDDEDBOOT
214 225
215config IBM_OPENBIOS 226config IBM_OPENBIOS
216 bool 227 bool
217 depends on ASH || BUBINGA || REDWOOD_5 || REDWOOD_6 || SYCAMORE || WALNUT 228 depends on ASH || REDWOOD_5 || REDWOOD_6
218 default y 229 default y
219 230
220config PPC4xx_DMA 231config PPC4xx_DMA
diff --git a/arch/ppc/platforms/4xx/Makefile b/arch/ppc/platforms/4xx/Makefile
index 1dd6d7fd6a9a..c9bb61170954 100644
--- a/arch/ppc/platforms/4xx/Makefile
+++ b/arch/ppc/platforms/4xx/Makefile
@@ -7,6 +7,7 @@ obj-$(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_YUCCA) += yucca.o
10obj-$(CONFIG_OCOTEA) += ocotea.o 11obj-$(CONFIG_OCOTEA) += ocotea.o
11obj-$(CONFIG_REDWOOD_5) += redwood5.o 12obj-$(CONFIG_REDWOOD_5) += redwood5.o
12obj-$(CONFIG_REDWOOD_6) += redwood6.o 13obj-$(CONFIG_REDWOOD_6) += redwood6.o
@@ -22,6 +23,7 @@ obj-$(CONFIG_440EP) += ibm440ep.o
22obj-$(CONFIG_440GP) += ibm440gp.o 23obj-$(CONFIG_440GP) += ibm440gp.o
23obj-$(CONFIG_440GX) += ibm440gx.o 24obj-$(CONFIG_440GX) += ibm440gx.o
24obj-$(CONFIG_440SP) += ibm440sp.o 25obj-$(CONFIG_440SP) += ibm440sp.o
26obj-$(CONFIG_440SPE) += ppc440spe.o
25obj-$(CONFIG_405EP) += ibm405ep.o 27obj-$(CONFIG_405EP) += ibm405ep.o
26obj-$(CONFIG_405GPR) += ibm405gpr.o 28obj-$(CONFIG_405GPR) += ibm405gpr.o
27obj-$(CONFIG_VIRTEX_II_PRO) += virtex-ii_pro.o 29obj-$(CONFIG_VIRTEX_II_PRO) += virtex-ii_pro.o
diff --git a/arch/ppc/platforms/4xx/bubinga.c b/arch/ppc/platforms/4xx/bubinga.c
index 3678abf86313..8110f55668c5 100644
--- a/arch/ppc/platforms/4xx/bubinga.c
+++ b/arch/ppc/platforms/4xx/bubinga.c
@@ -89,7 +89,7 @@ bubinga_early_serial_map(void)
89 * by 16. 89 * by 16.
90 */ 90 */
91 uart_div = (mfdcr(DCRN_CPC0_UCR_BASE) & DCRN_CPC0_UCR_U0DIV); 91 uart_div = (mfdcr(DCRN_CPC0_UCR_BASE) & DCRN_CPC0_UCR_U0DIV);
92 uart_clock = __res.bi_pllouta_freq / uart_div; 92 uart_clock = __res.bi_procfreq / uart_div;
93 93
94 /* Setup serial port access */ 94 /* Setup serial port access */
95 memset(&port, 0, sizeof(port)); 95 memset(&port, 0, sizeof(port));
diff --git a/arch/ppc/platforms/4xx/bubinga.h b/arch/ppc/platforms/4xx/bubinga.h
index b1df856f8e22..b5380cfaf5c0 100644
--- a/arch/ppc/platforms/4xx/bubinga.h
+++ b/arch/ppc/platforms/4xx/bubinga.h
@@ -1,52 +1,34 @@
1/* 1/*
2 * Support for IBM PPC 405EP evaluation board (Bubinga). 2 * arch/ppc/platforms/4xx/bubinga.h
3 * 3 *
4 * Author: SAW (IBM), derived from walnut.h. 4 * Bubinga board definitions
5 * Maintained by MontaVista Software <source@mvista.com> 5 *
6 * Copyright (c) 2005 DENX Software Engineering
7 * Stefan Roese <sr@denx.de>
8 *
9 * Based on original work by
10 * SAW (IBM)
11 * 2003 (c) MontaVista Softare Inc.
12 *
13 * This program is free software; you can redistribute it and/or modify it
14 * under the terms of the GNU General Public License as published by the
15 * Free Software Foundation; either version 2 of the License, or (at your
16 * option) any later version.
6 * 17 *
7 * 2003 (c) MontaVista Softare Inc. This file is licensed under the
8 * terms of the GNU General Public License version 2. This program is
9 * licensed "as is" without any warranty of any kind, whether express
10 * or implied.
11 */ 18 */
12 19
13#ifdef __KERNEL__ 20#ifdef __KERNEL__
14#ifndef __BUBINGA_H__ 21#ifndef __BUBINGA_H__
15#define __BUBINGA_H__ 22#define __BUBINGA_H__
16 23
17/* 405EP */ 24#include <linux/config.h>
18#include <platforms/4xx/ibm405ep.h> 25#include <platforms/4xx/ibm405ep.h>
19 26#include <asm/ppcboot.h>
20#ifndef __ASSEMBLY__
21/*
22 * Data structure defining board information maintained by the boot
23 * ROM on IBM's 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[2][6]; /* Local Ethernet MAC address */ unsigned char bi_pci_enetaddr[6]; /* PCI Ethernet MAC address */
33 unsigned int bi_intfreq; /* Processor speed, in Hz */
34 unsigned int bi_busfreq; /* PLB Bus speed, in Hz */
35 unsigned int bi_pci_busfreq; /* PCI Bus speed, in Hz */
36 unsigned int bi_opb_busfreq; /* OPB Bus speed, in Hz */
37 unsigned int bi_pllouta_freq; /* PLL OUTA speed, in Hz */
38} bd_t;
39
40/* Some 4xx parts use a different timebase frequency from the internal clock.
41*/
42#define bi_tbfreq bi_intfreq
43
44 27
45/* Memory map for the Bubinga board. 28/* Memory map for the Bubinga board.
46 * Generic 4xx plus RTC. 29 * Generic 4xx plus RTC.
47 */ 30 */
48 31
49extern void *bubinga_rtc_base;
50#define BUBINGA_RTC_PADDR ((uint)0xf0000000) 32#define BUBINGA_RTC_PADDR ((uint)0xf0000000)
51#define BUBINGA_RTC_VADDR BUBINGA_RTC_PADDR 33#define BUBINGA_RTC_VADDR BUBINGA_RTC_PADDR
52#define BUBINGA_RTC_SIZE ((uint)8*1024) 34#define BUBINGA_RTC_SIZE ((uint)8*1024)
@@ -58,12 +40,18 @@ extern void *bubinga_rtc_base;
58 * for typical configurations at various CPU speeds. 40 * for typical configurations at various CPU speeds.
59 * The base baud is calculated as (FWDA / EXT UART DIV / 16) 41 * The base baud is calculated as (FWDA / EXT UART DIV / 16)
60 */ 42 */
61#define BASE_BAUD 0 43#define BASE_BAUD 0
62 44
63#define BUBINGA_FPGA_BASE 0xF0300000 45/* Flash */
46#define PPC40x_FPGA_BASE 0xF0300000
47#define PPC40x_FPGA_REG_OFFS 1 /* offset to flash map reg */
48#define PPC40x_FLASH_ONBD_N(x) (x & 0x02)
49#define PPC40x_FLASH_SRAM_SEL(x) (x & 0x01)
50#define PPC40x_FLASH_LOW 0xFFF00000
51#define PPC40x_FLASH_HIGH 0xFFF80000
52#define PPC40x_FLASH_SIZE 0x80000
64 53
65#define PPC4xx_MACHINE_NAME "IBM Bubinga" 54#define PPC4xx_MACHINE_NAME "IBM Bubinga"
66 55
67#endif /* !__ASSEMBLY__ */
68#endif /* __BUBINGA_H__ */ 56#endif /* __BUBINGA_H__ */
69#endif /* __KERNEL__ */ 57#endif /* __KERNEL__ */
diff --git a/arch/ppc/platforms/4xx/ebony.h b/arch/ppc/platforms/4xx/ebony.h
index d08faa46a0ae..b91ad4272dfe 100644
--- a/arch/ppc/platforms/4xx/ebony.h
+++ b/arch/ppc/platforms/4xx/ebony.h
@@ -24,8 +24,8 @@
24#define PPC44x_EMAC0_MR0 0xE0000800 24#define PPC44x_EMAC0_MR0 0xE0000800
25 25
26/* Where to find the MAC info */ 26/* Where to find the MAC info */
27#define EBONY_OPENBIOS_MAC_BASE 0xfffffe0c 27#define OPENBIOS_MAC_BASE 0xfffffe0c
28#define EBONY_OPENBIOS_MAC_OFFSET 0x0c 28#define OPENBIOS_MAC_OFFSET 0x0c
29 29
30/* Default clock rates for Rev. B and Rev. C silicon */ 30/* Default clock rates for Rev. B and Rev. C silicon */
31#define EBONY_440GP_RB_SYSCLK 33000000 31#define EBONY_440GP_RB_SYSCLK 33000000
diff --git a/arch/ppc/platforms/4xx/ppc440spe.c b/arch/ppc/platforms/4xx/ppc440spe.c
new file mode 100644
index 000000000000..6139a0b3393e
--- /dev/null
+++ b/arch/ppc/platforms/4xx/ppc440spe.c
@@ -0,0 +1,148 @@
1/*
2 * arch/ppc/platforms/4xx/ppc440spe.c
3 *
4 * PPC440SPe I/O descriptions
5 *
6 * Roland Dreier <rolandd@cisco.com>
7 * Copyright (c) 2005 Cisco Systems. All rights reserved.
8 *
9 * Matt Porter <mporter@kernel.crashing.org>
10 * Copyright 2002-2005 MontaVista Software Inc.
11 *
12 * Eugene Surovegin <eugene.surovegin@zultys.com> or <ebs@ebshome.net>
13 * Copyright (c) 2003, 2004 Zultys Technologies
14 *
15 * This program is free software; you can redistribute it and/or modify it
16 * under the terms of the GNU General Public License as published by the
17 * Free Software Foundation; either version 2 of the License, or (at your
18 * option) any later version.
19 *
20 */
21#include <linux/init.h>
22#include <linux/module.h>
23#include <platforms/4xx/ppc440spe.h>
24#include <asm/ocp.h>
25#include <asm/ppc4xx_pic.h>
26
27static struct ocp_func_emac_data ppc440spe_emac0_def = {
28 .rgmii_idx = -1, /* No RGMII */
29 .rgmii_mux = -1, /* No RGMII */
30 .zmii_idx = -1, /* No ZMII */
31 .zmii_mux = -1, /* No ZMII */
32 .mal_idx = 0, /* MAL device index */
33 .mal_rx_chan = 0, /* MAL rx channel number */
34 .mal_tx_chan = 0, /* MAL tx channel number */
35 .wol_irq = 61, /* WOL interrupt number */
36 .mdio_idx = -1, /* No shared MDIO */
37 .tah_idx = -1, /* No TAH */
38};
39OCP_SYSFS_EMAC_DATA()
40
41static struct ocp_func_mal_data ppc440spe_mal0_def = {
42 .num_tx_chans = 1, /* Number of TX channels */
43 .num_rx_chans = 1, /* Number of RX channels */
44 .txeob_irq = 38, /* TX End Of Buffer IRQ */
45 .rxeob_irq = 39, /* RX End Of Buffer IRQ */
46 .txde_irq = 34, /* TX Descriptor Error IRQ */
47 .rxde_irq = 35, /* RX Descriptor Error IRQ */
48 .serr_irq = 33, /* MAL System Error IRQ */
49 .dcr_base = DCRN_MAL_BASE /* MAL0_CFG DCR number */
50};
51OCP_SYSFS_MAL_DATA()
52
53static struct ocp_func_iic_data ppc440spe_iic0_def = {
54 .fast_mode = 0, /* Use standad mode (100Khz) */
55};
56
57static struct ocp_func_iic_data ppc440spe_iic1_def = {
58 .fast_mode = 0, /* Use standad mode (100Khz) */
59};
60OCP_SYSFS_IIC_DATA()
61
62struct ocp_def core_ocp[] = {
63 { .vendor = OCP_VENDOR_IBM,
64 .function = OCP_FUNC_16550,
65 .index = 0,
66 .paddr = PPC440SPE_UART0_ADDR,
67 .irq = UART0_INT,
68 .pm = IBM_CPM_UART0,
69 },
70 { .vendor = OCP_VENDOR_IBM,
71 .function = OCP_FUNC_16550,
72 .index = 1,
73 .paddr = PPC440SPE_UART1_ADDR,
74 .irq = UART1_INT,
75 .pm = IBM_CPM_UART1,
76 },
77 { .vendor = OCP_VENDOR_IBM,
78 .function = OCP_FUNC_16550,
79 .index = 2,
80 .paddr = PPC440SPE_UART2_ADDR,
81 .irq = UART2_INT,
82 .pm = IBM_CPM_UART2,
83 },
84 { .vendor = OCP_VENDOR_IBM,
85 .function = OCP_FUNC_IIC,
86 .index = 0,
87 .paddr = 0x00000004f0000400ULL,
88 .irq = 2,
89 .pm = IBM_CPM_IIC0,
90 .additions = &ppc440spe_iic0_def,
91 .show = &ocp_show_iic_data
92 },
93 { .vendor = OCP_VENDOR_IBM,
94 .function = OCP_FUNC_IIC,
95 .index = 1,
96 .paddr = 0x00000004f0000500ULL,
97 .irq = 3,
98 .pm = IBM_CPM_IIC1,
99 .additions = &ppc440spe_iic1_def,
100 .show = &ocp_show_iic_data
101 },
102 { .vendor = OCP_VENDOR_IBM,
103 .function = OCP_FUNC_GPIO,
104 .index = 0,
105 .paddr = 0x00000004f0000700ULL,
106 .irq = OCP_IRQ_NA,
107 .pm = IBM_CPM_GPIO0,
108 },
109 { .vendor = OCP_VENDOR_IBM,
110 .function = OCP_FUNC_MAL,
111 .paddr = OCP_PADDR_NA,
112 .irq = OCP_IRQ_NA,
113 .pm = OCP_CPM_NA,
114 .additions = &ppc440spe_mal0_def,
115 .show = &ocp_show_mal_data,
116 },
117 { .vendor = OCP_VENDOR_IBM,
118 .function = OCP_FUNC_EMAC,
119 .index = 0,
120 .paddr = 0x00000004f0000800ULL,
121 .irq = 60,
122 .pm = OCP_CPM_NA,
123 .additions = &ppc440spe_emac0_def,
124 .show = &ocp_show_emac_data,
125 },
126 { .vendor = OCP_VENDOR_INVALID
127 }
128};
129
130/* Polarity and triggering settings for internal interrupt sources */
131struct ppc4xx_uic_settings ppc4xx_core_uic_cfg[] __initdata = {
132 { .polarity = 0xffffffff,
133 .triggering = 0x010f0004,
134 .ext_irq_mask = 0x00000000,
135 },
136 { .polarity = 0xffffffff,
137 .triggering = 0x001f8040,
138 .ext_irq_mask = 0x00007c30, /* IRQ6 - IRQ7, IRQ8 - IRQ12 */
139 },
140 { .polarity = 0xffffffff,
141 .triggering = 0x00000000,
142 .ext_irq_mask = 0x000000fc, /* IRQ0 - IRQ5 */
143 },
144 { .polarity = 0xffffffff,
145 .triggering = 0x00000000,
146 .ext_irq_mask = 0x00000000,
147 },
148};
diff --git a/arch/ppc/platforms/4xx/ppc440spe.h b/arch/ppc/platforms/4xx/ppc440spe.h
new file mode 100644
index 000000000000..2216846973b8
--- /dev/null
+++ b/arch/ppc/platforms/4xx/ppc440spe.h
@@ -0,0 +1,66 @@
1/*
2 * arch/ppc/platforms/4xx/ibm440spe.h
3 *
4 * PPC440SPe definitions
5 *
6 * Roland Dreier <rolandd@cisco.com>
7 * Copyright (c) 2005 Cisco Systems. All rights reserved.
8 *
9 * Matt Porter <mporter@kernel.crashing.org>
10 * Copyright 2004-2005 MontaVista Software, Inc.
11 *
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
14 * Free Software Foundation; either version 2 of the License, or (at your
15 * option) any later version.
16 */
17
18#ifdef __KERNEL__
19#ifndef __PPC_PLATFORMS_PPC440SPE_H
20#define __PPC_PLATFORMS_PPC440SPE_H
21
22#include <linux/config.h>
23
24#include <asm/ibm44x.h>
25
26/* UART */
27#define PPC440SPE_UART0_ADDR 0x00000004f0000200ULL
28#define PPC440SPE_UART1_ADDR 0x00000004f0000300ULL
29#define PPC440SPE_UART2_ADDR 0x00000004f0000600ULL
30#define UART0_INT 0
31#define UART1_INT 1
32#define UART2_INT 37
33
34/* Clock and Power Management */
35#define IBM_CPM_IIC0 0x80000000 /* IIC interface */
36#define IBM_CPM_IIC1 0x40000000 /* IIC interface */
37#define IBM_CPM_PCI 0x20000000 /* PCI bridge */
38#define IBM_CPM_CPU 0x02000000 /* processor core */
39#define IBM_CPM_DMA 0x01000000 /* DMA controller */
40#define IBM_CPM_BGO 0x00800000 /* PLB to OPB bus arbiter */
41#define IBM_CPM_BGI 0x00400000 /* OPB to PLB bridge */
42#define IBM_CPM_EBC 0x00200000 /* External Bux Controller */
43#define IBM_CPM_EBM 0x00100000 /* Ext Bus Master Interface */
44#define IBM_CPM_DMC 0x00080000 /* SDRAM peripheral controller */
45#define IBM_CPM_PLB 0x00040000 /* PLB bus arbiter */
46#define IBM_CPM_SRAM 0x00020000 /* SRAM memory controller */
47#define IBM_CPM_PPM 0x00002000 /* PLB Performance Monitor */
48#define IBM_CPM_UIC1 0x00001000 /* Universal Interrupt Controller */
49#define IBM_CPM_GPIO0 0x00000800 /* General Purpose IO (??) */
50#define IBM_CPM_GPT 0x00000400 /* General Purpose Timers */
51#define IBM_CPM_UART0 0x00000200 /* serial port 0 */
52#define IBM_CPM_UART1 0x00000100 /* serial port 1 */
53#define IBM_CPM_UART2 0x00000100 /* serial port 1 */
54#define IBM_CPM_UIC0 0x00000080 /* Universal Interrupt Controller */
55#define IBM_CPM_TMRCLK 0x00000040 /* CPU timers */
56#define IBM_CPM_EMAC0 0x00000020 /* EMAC 0 */
57
58#define DFLT_IBM4xx_PM ~(IBM_CPM_UIC | IBM_CPM_UIC1 | IBM_CPM_CPU \
59 | IBM_CPM_EBC | IBM_CPM_SRAM | IBM_CPM_BGO \
60 | IBM_CPM_EBM | IBM_CPM_PLB | IBM_CPM_OPB \
61 | IBM_CPM_TMRCLK | IBM_CPM_DMA | IBM_CPM_PCI \
62 | IBM_CPM_TAHOE0 | IBM_CPM_TAHOE1 \
63 | IBM_CPM_EMAC0 | IBM_CPM_EMAC1 \
64 | IBM_CPM_EMAC2 | IBM_CPM_EMAC3 )
65#endif /* __PPC_PLATFORMS_PPC440SP_H */
66#endif /* __KERNEL__ */
diff --git a/arch/ppc/platforms/4xx/sycamore.c b/arch/ppc/platforms/4xx/sycamore.c
index d8019eec4704..281b4a2ffb96 100644
--- a/arch/ppc/platforms/4xx/sycamore.c
+++ b/arch/ppc/platforms/4xx/sycamore.c
@@ -88,9 +88,6 @@ ppc405_map_irq(struct pci_dev *dev, unsigned char idsel, unsigned char pin)
88void __init 88void __init
89sycamore_setup_arch(void) 89sycamore_setup_arch(void)
90{ 90{
91#define SYCAMORE_PS2_BASE 0xF0100000
92#define SYCAMORE_FPGA_BASE 0xF0300000
93
94 void *fpga_brdc; 91 void *fpga_brdc;
95 unsigned char fpga_brdc_data; 92 unsigned char fpga_brdc_data;
96 void *fpga_enable; 93 void *fpga_enable;
@@ -100,7 +97,7 @@ sycamore_setup_arch(void)
100 97
101 ppc4xx_setup_arch(); 98 ppc4xx_setup_arch();
102 99
103 ibm_ocp_set_emac(0, 1); 100 ibm_ocp_set_emac(0, 0);
104 101
105 kb_data = ioremap(SYCAMORE_PS2_BASE, 8); 102 kb_data = ioremap(SYCAMORE_PS2_BASE, 8);
106 if (!kb_data) { 103 if (!kb_data) {
@@ -111,7 +108,7 @@ sycamore_setup_arch(void)
111 108
112 kb_cs = kb_data + 1; 109 kb_cs = kb_data + 1;
113 110
114 fpga_status = ioremap(SYCAMORE_FPGA_BASE, 8); 111 fpga_status = ioremap(PPC40x_FPGA_BASE, 8);
115 if (!fpga_status) { 112 if (!fpga_status) {
116 printk(KERN_CRIT 113 printk(KERN_CRIT
117 "sycamore_setup_arch() fpga_status ioremap failed\n"); 114 "sycamore_setup_arch() fpga_status ioremap failed\n");
diff --git a/arch/ppc/platforms/4xx/sycamore.h b/arch/ppc/platforms/4xx/sycamore.h
index 3e7b4e2c8c57..1cd6c824fd62 100644
--- a/arch/ppc/platforms/4xx/sycamore.h
+++ b/arch/ppc/platforms/4xx/sycamore.h
@@ -1,67 +1,52 @@
1/* 1/*
2 * arch/ppc/platforms/4xx/sycamore.h 2 * arch/ppc/platforms/4xx/sycamore.h
3 * 3 *
4 * Macros, definitions, and data structures specific to the IBM PowerPC 4 * Sycamore board definitions
5 * 405GPr "Sycamore" evaluation board.
6 * 5 *
7 * Author: Armin Kuster <akuster@mvista.com> 6 * Copyright (c) 2005 DENX Software Engineering
7 * Stefan Roese <sr@denx.de>
8 *
9 * Based on original work by
10 * Armin Kuster <akuster@mvista.com>
11 * 2000 (c) MontaVista, Software, Inc.
12 *
13 * This program is free software; you can redistribute it and/or modify it
14 * under the terms of the GNU General Public License as published by the
15 * Free Software Foundation; either version 2 of the License, or (at your
16 * option) any later version.
8 * 17 *
9 * 2000 (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 */ 18 */
14 19
15#ifdef __KERNEL__ 20#ifdef __KERNEL__
16#ifndef __ASM_SYCAMORE_H__ 21#ifndef __ASM_SYCAMORE_H__
17#define __ASM_SYCAMORE_H__ 22#define __ASM_SYCAMORE_H__
18 23
24#include <linux/config.h>
19#include <platforms/4xx/ibm405gpr.h> 25#include <platforms/4xx/ibm405gpr.h>
26#include <asm/ppcboot.h>
20 27
21#ifndef __ASSEMBLY__ 28/* Memory map for the IBM "Sycamore" 405GPr evaluation board.
22/*
23 * Data structure defining board information maintained by the boot
24 * ROM on IBM's "Sycamore" evaluation board. An effort has been made to
25 * keep the field names consistent with the 8xx 'bd_t' board info
26 * structures.
27 */
28
29typedef struct board_info {
30 unsigned char bi_s_version[4]; /* Version of this structure */
31 unsigned char bi_r_version[30]; /* Version of the IBM ROM */
32 unsigned int bi_memsize; /* DRAM installed, in bytes */
33 unsigned char bi_enetaddr[6]; /* Local Ethernet MAC address */
34 unsigned char bi_pci_enetaddr[6]; /* PCI Ethernet MAC address */
35 unsigned int bi_intfreq; /* Processor speed, in Hz */
36 unsigned int bi_busfreq; /* PLB Bus speed, in Hz */
37 unsigned int bi_pci_busfreq; /* PCI Bus speed, in Hz */
38} bd_t;
39
40/* Some 4xx parts use a different timebase frequency from the internal clock.
41*/
42#define bi_tbfreq bi_intfreq
43
44
45/* Memory map for the IBM "Sycamore" 405GP evaluation board.
46 * Generic 4xx plus RTC. 29 * Generic 4xx plus RTC.
47 */ 30 */
48 31
49extern void *sycamore_rtc_base;
50#define SYCAMORE_RTC_PADDR ((uint)0xf0000000) 32#define SYCAMORE_RTC_PADDR ((uint)0xf0000000)
51#define SYCAMORE_RTC_VADDR SYCAMORE_RTC_PADDR 33#define SYCAMORE_RTC_VADDR SYCAMORE_RTC_PADDR
52#define SYCAMORE_RTC_SIZE ((uint)8*1024) 34#define SYCAMORE_RTC_SIZE ((uint)8*1024)
53 35
54#ifdef CONFIG_PPC405GP_INTERNAL_CLOCK
55#define BASE_BAUD 201600
56#else
57#define BASE_BAUD 691200 36#define BASE_BAUD 691200
58#endif
59 37
60#define SYCAMORE_PS2_BASE 0xF0100000 38#define SYCAMORE_PS2_BASE 0xF0100000
61#define SYCAMORE_FPGA_BASE 0xF0300000 39
40/* Flash */
41#define PPC40x_FPGA_BASE 0xF0300000
42#define PPC40x_FPGA_REG_OFFS 5 /* offset to flash map reg */
43#define PPC40x_FLASH_ONBD_N(x) (x & 0x02)
44#define PPC40x_FLASH_SRAM_SEL(x) (x & 0x01)
45#define PPC40x_FLASH_LOW 0xFFF00000
46#define PPC40x_FLASH_HIGH 0xFFF80000
47#define PPC40x_FLASH_SIZE 0x80000
62 48
63#define PPC4xx_MACHINE_NAME "IBM Sycamore" 49#define PPC4xx_MACHINE_NAME "IBM Sycamore"
64 50
65#endif /* !__ASSEMBLY__ */
66#endif /* __ASM_SYCAMORE_H__ */ 51#endif /* __ASM_SYCAMORE_H__ */
67#endif /* __KERNEL__ */ 52#endif /* __KERNEL__ */
diff --git a/arch/ppc/platforms/4xx/walnut.c b/arch/ppc/platforms/4xx/walnut.c
index a33eda4b7489..74cb33182d9f 100644
--- a/arch/ppc/platforms/4xx/walnut.c
+++ b/arch/ppc/platforms/4xx/walnut.c
@@ -90,7 +90,7 @@ walnut_setup_arch(void)
90 90
91 kb_cs = kb_data + 1; 91 kb_cs = kb_data + 1;
92 92
93 fpga_status = ioremap(WALNUT_FPGA_BASE, 8); 93 fpga_status = ioremap(PPC40x_FPGA_BASE, 8);
94 if (!fpga_status) { 94 if (!fpga_status) {
95 printk(KERN_CRIT 95 printk(KERN_CRIT
96 "walnut_setup_arch() fpga_status ioremap failed\n"); 96 "walnut_setup_arch() fpga_status ioremap failed\n");
diff --git a/arch/ppc/platforms/4xx/walnut.h b/arch/ppc/platforms/4xx/walnut.h
index 04cfbf3696b9..dcf2691698c0 100644
--- a/arch/ppc/platforms/4xx/walnut.h
+++ b/arch/ppc/platforms/4xx/walnut.h
@@ -1,72 +1,55 @@
1/* 1/*
2 * arch/ppc/platforms/4xx/walnut.h 2 * arch/ppc/platforms/4xx/walnut.h
3 * 3 *
4 * Macros, definitions, and data structures specific to the IBM PowerPC 4 * Walnut board definitions
5 * 405GP "Walnut" evaluation board.
6 * 5 *
7 * Authors: Grant Erickson <grant@lcse.umn.edu>, Frank Rowand 6 * Copyright (c) 2005 DENX Software Engineering
8 * <frank_rowand@mvista.com>, Debbie Chu <debbie_chu@mvista.com> or 7 * Stefan Roese <sr@denx.de>
9 * source@mvista.com
10 * 8 *
11 * Copyright (c) 1999 Grant Erickson <grant@lcse.umn.edu> 9 * Based on original work by
10 * Copyright (c) 1999 Grant Erickson <grant@lcse.umn.edu>
11 * Frank Rowand <frank_rowand@mvista.com>
12 * Debbie Chu <debbie_chu@mvista.com>
13 * 2000 (c) MontaVista, Software, Inc.
14 *
15 * This program is free software; you can redistribute it and/or modify it
16 * under the terms of the GNU General Public License as published by the
17 * Free Software Foundation; either version 2 of the License, or (at your
18 * option) any later version.
12 * 19 *
13 * 2000 (c) MontaVista, Software, Inc. This file is licensed under
14 * the terms of the GNU General Public License version 2. This program
15 * is licensed "as is" without any warranty of any kind, whether express
16 * or implied.
17 */ 20 */
18 21
19#ifdef __KERNEL__ 22#ifdef __KERNEL__
20#ifndef __ASM_WALNUT_H__ 23#ifndef __ASM_WALNUT_H__
21#define __ASM_WALNUT_H__ 24#define __ASM_WALNUT_H__
22 25
23/* We have a 405GP core */ 26#include <linux/config.h>
24#include <platforms/4xx/ibm405gp.h> 27#include <platforms/4xx/ibm405gp.h>
25 28#include <asm/ppcboot.h>
26#ifndef __ASSEMBLY__
27/*
28 * Data structure defining board information maintained by the boot
29 * ROM on IBM's "Walnut" evaluation board. An effort has been made to
30 * keep the field names consistent with the 8xx 'bd_t' board info
31 * structures.
32 */
33
34typedef struct board_info {
35 unsigned char bi_s_version[4]; /* Version of this structure */
36 unsigned char bi_r_version[30]; /* Version of the IBM ROM */
37 unsigned int bi_memsize; /* DRAM installed, in bytes */
38 unsigned char bi_enetaddr[6]; /* Local Ethernet MAC address */
39 unsigned char bi_pci_enetaddr[6]; /* PCI Ethernet MAC address */
40 unsigned int bi_intfreq; /* Processor speed, in Hz */
41 unsigned int bi_busfreq; /* PLB Bus speed, in Hz */
42 unsigned int bi_pci_busfreq; /* PCI Bus speed, in Hz */
43} bd_t;
44
45/* Some 4xx parts use a different timebase frequency from the internal clock.
46*/
47#define bi_tbfreq bi_intfreq
48
49 29
50/* Memory map for the IBM "Walnut" 405GP evaluation board. 30/* Memory map for the IBM "Walnut" 405GP evaluation board.
51 * Generic 4xx plus RTC. 31 * Generic 4xx plus RTC.
52 */ 32 */
53 33
54extern void *walnut_rtc_base;
55#define WALNUT_RTC_PADDR ((uint)0xf0000000) 34#define WALNUT_RTC_PADDR ((uint)0xf0000000)
56#define WALNUT_RTC_VADDR WALNUT_RTC_PADDR 35#define WALNUT_RTC_VADDR WALNUT_RTC_PADDR
57#define WALNUT_RTC_SIZE ((uint)8*1024) 36#define WALNUT_RTC_SIZE ((uint)8*1024)
58 37
59#ifdef CONFIG_PPC405GP_INTERNAL_CLOCK
60#define BASE_BAUD 201600
61#else
62#define BASE_BAUD 691200 38#define BASE_BAUD 691200
63#endif
64 39
65#define WALNUT_PS2_BASE 0xF0100000 40#define WALNUT_PS2_BASE 0xF0100000
66#define WALNUT_FPGA_BASE 0xF0300000 41
42/* Flash */
43#define PPC40x_FPGA_BASE 0xF0300000
44#define PPC40x_FPGA_REG_OFFS 5 /* offset to flash map reg */
45#define PPC40x_FLASH_ONBD_N(x) (x & 0x02)
46#define PPC40x_FLASH_SRAM_SEL(x) (x & 0x01)
47#define PPC40x_FLASH_LOW 0xFFF00000
48#define PPC40x_FLASH_HIGH 0xFFF80000
49#define PPC40x_FLASH_SIZE 0x80000
50#define WALNUT_FPGA_BASE PPC40x_FPGA_BASE
67 51
68#define PPC4xx_MACHINE_NAME "IBM Walnut" 52#define PPC4xx_MACHINE_NAME "IBM Walnut"
69 53
70#endif /* !__ASSEMBLY__ */
71#endif /* __ASM_WALNUT_H__ */ 54#endif /* __ASM_WALNUT_H__ */
72#endif /* __KERNEL__ */ 55#endif /* __KERNEL__ */
diff --git a/arch/ppc/platforms/4xx/yucca.c b/arch/ppc/platforms/4xx/yucca.c
new file mode 100644
index 000000000000..e60f4bd437ec
--- /dev/null
+++ b/arch/ppc/platforms/4xx/yucca.c
@@ -0,0 +1,395 @@
1/*
2 * arch/ppc/platforms/4xx/yucca.c
3 *
4 * Yucca board specific routines
5 *
6 * Roland Dreier <rolandd@cisco.com> (based on luan.c by Matt Porter)
7 *
8 * Copyright 2004-2005 MontaVista Software Inc.
9 * Copyright (c) 2005 Cisco Systems. All rights reserved.
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#include <linux/config.h>
18#include <linux/stddef.h>
19#include <linux/kernel.h>
20#include <linux/init.h>
21#include <linux/errno.h>
22#include <linux/reboot.h>
23#include <linux/pci.h>
24#include <linux/kdev_t.h>
25#include <linux/types.h>
26#include <linux/major.h>
27#include <linux/blkdev.h>
28#include <linux/console.h>
29#include <linux/delay.h>
30#include <linux/ide.h>
31#include <linux/initrd.h>
32#include <linux/seq_file.h>
33#include <linux/root_dev.h>
34#include <linux/tty.h>
35#include <linux/serial.h>
36#include <linux/serial_core.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/ibm44x_common.h>
53#include <syslib/ibm440gx_common.h>
54#include <syslib/ibm440sp_common.h>
55#include <syslib/ppc440spe_pcie.h>
56
57extern bd_t __res;
58
59static struct ibm44x_clocks clocks __initdata;
60
61static void __init
62yucca_calibrate_decr(void)
63{
64 unsigned int freq;
65
66 if (mfspr(SPRN_CCR1) & CCR1_TCS)
67 freq = YUCCA_TMR_CLK;
68 else
69 freq = clocks.cpu;
70
71 ibm44x_calibrate_decr(freq);
72}
73
74static int
75yucca_show_cpuinfo(struct seq_file *m)
76{
77 seq_printf(m, "vendor\t\t: AMCC\n");
78 seq_printf(m, "machine\t\t: PPC440SPe EVB (Yucca)\n");
79
80 return 0;
81}
82
83static enum {
84 HOSE_UNKNOWN,
85 HOSE_PCIX,
86 HOSE_PCIE0,
87 HOSE_PCIE1,
88 HOSE_PCIE2
89} hose_type[4];
90
91static inline int
92yucca_map_irq(struct pci_dev *dev, unsigned char idsel, unsigned char pin)
93{
94 struct pci_controller *hose = pci_bus_to_hose(dev->bus->number);
95
96 if (hose_type[hose->index] == HOSE_PCIX) {
97 static char pci_irq_table[][4] =
98 /*
99 * PCI IDSEL/INTPIN->INTLINE
100 * A B C D
101 */
102 {
103 { 81, -1, -1, -1 }, /* IDSEL 1 - PCIX0 Slot 0 */
104 };
105 const long min_idsel = 1, max_idsel = 1, irqs_per_slot = 4;
106 return PCI_IRQ_TABLE_LOOKUP;
107 } else if (hose_type[hose->index] == HOSE_PCIE0) {
108 static char pci_irq_table[][4] =
109 /*
110 * PCI IDSEL/INTPIN->INTLINE
111 * A B C D
112 */
113 {
114 { 96, 97, 98, 99 },
115 };
116 const long min_idsel = 1, max_idsel = 1, irqs_per_slot = 4;
117 return PCI_IRQ_TABLE_LOOKUP;
118 } else if (hose_type[hose->index] == HOSE_PCIE1) {
119 static char pci_irq_table[][4] =
120 /*
121 * PCI IDSEL/INTPIN->INTLINE
122 * A B C D
123 */
124 {
125 { 100, 101, 102, 103 },
126 };
127 const long min_idsel = 1, max_idsel = 1, irqs_per_slot = 4;
128 return PCI_IRQ_TABLE_LOOKUP;
129 } else if (hose_type[hose->index] == HOSE_PCIE2) {
130 static char pci_irq_table[][4] =
131 /*
132 * PCI IDSEL/INTPIN->INTLINE
133 * A B C D
134 */
135 {
136 { 104, 105, 106, 107 },
137 };
138 const long min_idsel = 1, max_idsel = 1, irqs_per_slot = 4;
139 return PCI_IRQ_TABLE_LOOKUP;
140 }
141 return -1;
142}
143
144static void __init yucca_set_emacdata(void)
145{
146 struct ocp_def *def;
147 struct ocp_func_emac_data *emacdata;
148
149 /* Set phy_map, phy_mode, and mac_addr for the EMAC */
150 def = ocp_get_one_device(OCP_VENDOR_IBM, OCP_FUNC_EMAC, 0);
151 emacdata = def->additions;
152 emacdata->phy_map = 0x00000001; /* Skip 0x00 */
153 emacdata->phy_mode = PHY_MODE_GMII;
154 memcpy(emacdata->mac_addr, __res.bi_enetaddr, 6);
155}
156
157static int __init yucca_pcie_card_present(int port)
158{
159 void __iomem *pcie_fpga_base;
160 u16 reg;
161
162 pcie_fpga_base = ioremap64(YUCCA_FPGA_REG_BASE, YUCCA_FPGA_REG_SIZE);
163 reg = in_be16(pcie_fpga_base + FPGA_REG1C);
164 iounmap(pcie_fpga_base);
165
166 switch(port) {
167 case 0: return !(reg & FPGA_REG1C_PE0_PRSNT);
168 case 1: return !(reg & FPGA_REG1C_PE1_PRSNT);
169 case 2: return !(reg & FPGA_REG1C_PE2_PRSNT);
170 default: return 0;
171 }
172}
173
174/*
175 * For the given slot, set rootpoint mode, send power to the slot,
176 * turn on the green LED and turn off the yellow LED, enable the clock
177 * and turn off reset.
178 */
179static void __init yucca_setup_pcie_fpga_rootpoint(int port)
180{
181 void __iomem *pcie_reg_fpga_base;
182 u16 power, clock, green_led, yellow_led, reset_off, rootpoint, endpoint;
183
184 pcie_reg_fpga_base = ioremap64(YUCCA_FPGA_REG_BASE, YUCCA_FPGA_REG_SIZE);
185
186 switch(port) {
187 case 0:
188 rootpoint = FPGA_REG1C_PE0_ROOTPOINT;
189 endpoint = 0;
190 power = FPGA_REG1A_PE0_PWRON;
191 green_led = FPGA_REG1A_PE0_GLED;
192 clock = FPGA_REG1A_PE0_REFCLK_ENABLE;
193 yellow_led = FPGA_REG1A_PE0_YLED;
194 reset_off = FPGA_REG1C_PE0_PERST;
195 break;
196 case 1:
197 rootpoint = 0;
198 endpoint = FPGA_REG1C_PE1_ENDPOINT;
199 power = FPGA_REG1A_PE1_PWRON;
200 green_led = FPGA_REG1A_PE1_GLED;
201 clock = FPGA_REG1A_PE1_REFCLK_ENABLE;
202 yellow_led = FPGA_REG1A_PE1_YLED;
203 reset_off = FPGA_REG1C_PE1_PERST;
204 break;
205 case 2:
206 rootpoint = 0;
207 endpoint = FPGA_REG1C_PE2_ENDPOINT;
208 power = FPGA_REG1A_PE2_PWRON;
209 green_led = FPGA_REG1A_PE2_GLED;
210 clock = FPGA_REG1A_PE2_REFCLK_ENABLE;
211 yellow_led = FPGA_REG1A_PE2_YLED;
212 reset_off = FPGA_REG1C_PE2_PERST;
213 break;
214
215 default:
216 return;
217 }
218
219 out_be16(pcie_reg_fpga_base + FPGA_REG1A,
220 ~(power | clock | green_led) &
221 (yellow_led | in_be16(pcie_reg_fpga_base + FPGA_REG1A)));
222 out_be16(pcie_reg_fpga_base + FPGA_REG1C,
223 ~(endpoint | reset_off) &
224 (rootpoint | in_be16(pcie_reg_fpga_base + FPGA_REG1C)));
225
226 /*
227 * Leave device in reset for a while after powering on the
228 * slot to give it a chance to initialize.
229 */
230 mdelay(250);
231
232 out_be16(pcie_reg_fpga_base + FPGA_REG1C,
233 reset_off | in_be16(pcie_reg_fpga_base + FPGA_REG1C));
234
235 iounmap(pcie_reg_fpga_base);
236}
237
238static void __init
239yucca_setup_hoses(void)
240{
241 struct pci_controller *hose;
242 char name[20];
243 int i;
244
245 if (0 && ppc440spe_init_pcie()) {
246 printk(KERN_WARNING "PPC440SPe PCI Express initialization failed\n");
247 return;
248 }
249
250 for (i = 0; i <= 2; ++i) {
251 if (!yucca_pcie_card_present(i))
252 continue;
253
254 printk(KERN_INFO "PCIE%d: card present\n", i);
255 yucca_setup_pcie_fpga_rootpoint(i);
256 if (ppc440spe_init_pcie_rootport(i)) {
257 printk(KERN_WARNING "PCIE%d: initialization failed\n", i);
258 continue;
259 }
260
261 hose = pcibios_alloc_controller();
262 if (!hose)
263 return;
264
265 sprintf(name, "PCIE%d host bridge", i);
266 pci_init_resource(&hose->io_resource,
267 YUCCA_PCIX_LOWER_IO,
268 YUCCA_PCIX_UPPER_IO,
269 IORESOURCE_IO,
270 name);
271
272 hose->mem_space.start = YUCCA_PCIE_LOWER_MEM +
273 i * YUCCA_PCIE_MEM_SIZE;
274 hose->mem_space.end = hose->mem_space.start +
275 YUCCA_PCIE_MEM_SIZE - 1;
276
277 pci_init_resource(&hose->mem_resources[0],
278 hose->mem_space.start,
279 hose->mem_space.end,
280 IORESOURCE_MEM,
281 name);
282
283 hose->first_busno = 0;
284 hose->last_busno = 15;
285 hose_type[hose->index] = HOSE_PCIE0 + i;
286
287 ppc440spe_setup_pcie(hose, i);
288 hose->last_busno = pciauto_bus_scan(hose, hose->first_busno);
289 }
290
291 ppc_md.pci_swizzle = common_swizzle;
292 ppc_md.pci_map_irq = yucca_map_irq;
293}
294
295TODC_ALLOC();
296
297static void __init
298yucca_early_serial_map(void)
299{
300 struct uart_port port;
301
302 /* Setup ioremapped serial port access */
303 memset(&port, 0, sizeof(port));
304 port.membase = ioremap64(PPC440SPE_UART0_ADDR, 8);
305 port.irq = UART0_INT;
306 port.uartclk = clocks.uart0;
307 port.regshift = 0;
308 port.iotype = SERIAL_IO_MEM;
309 port.flags = ASYNC_BOOT_AUTOCONF | ASYNC_SKIP_TEST;
310 port.line = 0;
311
312 if (early_serial_setup(&port) != 0) {
313 printk("Early serial init of port 0 failed\n");
314 }
315
316 port.membase = ioremap64(PPC440SPE_UART1_ADDR, 8);
317 port.irq = UART1_INT;
318 port.uartclk = clocks.uart1;
319 port.line = 1;
320
321 if (early_serial_setup(&port) != 0) {
322 printk("Early serial init of port 1 failed\n");
323 }
324
325 port.membase = ioremap64(PPC440SPE_UART2_ADDR, 8);
326 port.irq = UART2_INT;
327 port.uartclk = BASE_BAUD;
328 port.line = 2;
329
330 if (early_serial_setup(&port) != 0) {
331 printk("Early serial init of port 2 failed\n");
332 }
333}
334
335static void __init
336yucca_setup_arch(void)
337{
338 yucca_set_emacdata();
339
340#if !defined(CONFIG_BDI_SWITCH)
341 /*
342 * The Abatron BDI JTAG debugger does not tolerate others
343 * mucking with the debug registers.
344 */
345 mtspr(SPRN_DBCR0, (DBCR0_TDE | DBCR0_IDM));
346#endif
347
348 /*
349 * Determine various clocks.
350 * To be completely correct we should get SysClk
351 * from FPGA, because it can be changed by on-board switches
352 * --ebs
353 */
354 /* 440GX and 440SPe clocking is the same - rd */
355 ibm440gx_get_clocks(&clocks, 33333333, 6 * 1843200);
356 ocp_sys_info.opb_bus_freq = clocks.opb;
357
358 /* init to some ~sane value until calibrate_delay() runs */
359 loops_per_jiffy = 50000000/HZ;
360
361 /* Setup PCIXn host bridges */
362 yucca_setup_hoses();
363
364#ifdef CONFIG_BLK_DEV_INITRD
365 if (initrd_start)
366 ROOT_DEV = Root_RAM0;
367 else
368#endif
369#ifdef CONFIG_ROOT_NFS
370 ROOT_DEV = Root_NFS;
371#else
372 ROOT_DEV = Root_HDA1;
373#endif
374
375 yucca_early_serial_map();
376
377 /* Identify the system */
378 printk("Yucca port (Roland Dreier <rolandd@cisco.com>)\n");
379}
380
381void __init platform_init(unsigned long r3, unsigned long r4,
382 unsigned long r5, unsigned long r6, unsigned long r7)
383{
384 ibm44x_platform_init(r3, r4, r5, r6, r7);
385
386 ppc_md.setup_arch = yucca_setup_arch;
387 ppc_md.show_cpuinfo = yucca_show_cpuinfo;
388 ppc_md.find_end_of_memory = ibm440sp_find_end_of_memory;
389 ppc_md.get_irq = NULL; /* Set in ppc4xx_pic_init() */
390
391 ppc_md.calibrate_decr = yucca_calibrate_decr;
392#ifdef CONFIG_KGDB
393 ppc_md.early_serial_map = yucca_early_serial_map;
394#endif
395}
diff --git a/arch/ppc/platforms/4xx/yucca.h b/arch/ppc/platforms/4xx/yucca.h
new file mode 100644
index 000000000000..01a4afea1514
--- /dev/null
+++ b/arch/ppc/platforms/4xx/yucca.h
@@ -0,0 +1,111 @@
1/*
2 * arch/ppc/platforms/4xx/yucca.h
3 *
4 * Yucca board definitions
5 *
6 * Roland Dreier <rolandd@cisco.com> (based on luan.h by Matt Porter)
7 *
8 * Copyright 2004-2005 MontaVista Software Inc.
9 * Copyright (c) 2005 Cisco Systems. All rights reserved.
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 __ASM_YUCCA_H__
20#define __ASM_YUCCA_H__
21
22#include <linux/config.h>
23#include <platforms/4xx/ppc440spe.h>
24
25/* F/W TLB mapping used in bootloader glue to reset EMAC */
26#define PPC44x_EMAC0_MR0 0xa0000800
27
28/* Location of MAC addresses in PIBS image */
29#define PIBS_FLASH_BASE 0xffe00000
30#define PIBS_MAC_BASE (PIBS_FLASH_BASE+0x1b0400)
31
32/* External timer clock frequency */
33#define YUCCA_TMR_CLK 25000000
34
35/*
36 * FPGA registers
37 */
38#define YUCCA_FPGA_REG_BASE 0x00000004e2000000ULL
39#define YUCCA_FPGA_REG_SIZE 0x24
40
41#define FPGA_REG1A 0x1a
42
43#define FPGA_REG1A_PE0_GLED 0x8000
44#define FPGA_REG1A_PE1_GLED 0x4000
45#define FPGA_REG1A_PE2_GLED 0x2000
46#define FPGA_REG1A_PE0_YLED 0x1000
47#define FPGA_REG1A_PE1_YLED 0x0800
48#define FPGA_REG1A_PE2_YLED 0x0400
49#define FPGA_REG1A_PE0_PWRON 0x0200
50#define FPGA_REG1A_PE1_PWRON 0x0100
51#define FPGA_REG1A_PE2_PWRON 0x0080
52#define FPGA_REG1A_PE0_REFCLK_ENABLE 0x0040
53#define FPGA_REG1A_PE1_REFCLK_ENABLE 0x0020
54#define FPGA_REG1A_PE2_REFCLK_ENABLE 0x0010
55#define FPGA_REG1A_PE_SPREAD0 0x0008
56#define FPGA_REG1A_PE_SPREAD1 0x0004
57#define FPGA_REG1A_PE_SELSOURCE_0 0x0002
58#define FPGA_REG1A_PE_SELSOURCE_1 0x0001
59
60#define FPGA_REG1C 0x1c
61
62#define FPGA_REG1C_PE0_ROOTPOINT 0x8000
63#define FPGA_REG1C_PE1_ENDPOINT 0x4000
64#define FPGA_REG1C_PE2_ENDPOINT 0x2000
65#define FPGA_REG1C_PE0_PRSNT 0x1000
66#define FPGA_REG1C_PE1_PRSNT 0x0800
67#define FPGA_REG1C_PE2_PRSNT 0x0400
68#define FPGA_REG1C_PE0_WAKE 0x0080
69#define FPGA_REG1C_PE1_WAKE 0x0040
70#define FPGA_REG1C_PE2_WAKE 0x0020
71#define FPGA_REG1C_PE0_PERST 0x0010
72#define FPGA_REG1C_PE1_PERST 0x0008
73#define FPGA_REG1C_PE2_PERST 0x0004
74
75/*
76 * Serial port defines
77 */
78#define RS_TABLE_SIZE 3
79
80/* PIBS defined UART mappings, used before early_serial_setup */
81#define UART0_IO_BASE 0xa0000200
82#define UART1_IO_BASE 0xa0000300
83#define UART2_IO_BASE 0xa0000600
84
85#define BASE_BAUD 11059200
86#define STD_UART_OP(num) \
87 { 0, BASE_BAUD, 0, UART##num##_INT, \
88 (ASYNC_BOOT_AUTOCONF | ASYNC_SKIP_TEST), \
89 iomem_base: (void*)UART##num##_IO_BASE, \
90 io_type: SERIAL_IO_MEM},
91
92#define SERIAL_PORT_DFNS \
93 STD_UART_OP(0) \
94 STD_UART_OP(1) \
95 STD_UART_OP(2)
96
97/* PCI support */
98#define YUCCA_PCIX_LOWER_IO 0x00000000
99#define YUCCA_PCIX_UPPER_IO 0x0000ffff
100#define YUCCA_PCIX_LOWER_MEM 0x80000000
101#define YUCCA_PCIX_UPPER_MEM 0x8fffffff
102#define YUCCA_PCIE_LOWER_MEM 0x90000000
103#define YUCCA_PCIE_MEM_SIZE 0x10000000
104
105#define YUCCA_PCIX_MEM_SIZE 0x10000000
106#define YUCCA_PCIX_MEM_OFFSET 0x00000000
107#define YUCCA_PCIE_MEM_SIZE 0x10000000
108#define YUCCA_PCIE_MEM_OFFSET 0x00000000
109
110#endif /* __ASM_YUCCA_H__ */
111#endif /* __KERNEL__ */
diff --git a/arch/ppc/platforms/83xx/mpc834x_sys.c b/arch/ppc/platforms/83xx/mpc834x_sys.c
index 79b3f533d0a3..98edc75f4105 100644
--- a/arch/ppc/platforms/83xx/mpc834x_sys.c
+++ b/arch/ppc/platforms/83xx/mpc834x_sys.c
@@ -51,6 +51,9 @@
51 51
52#include <syslib/ppc83xx_setup.h> 52#include <syslib/ppc83xx_setup.h>
53 53
54static const char *GFAR_PHY_0 = "phy0:0";
55static const char *GFAR_PHY_1 = "phy0:1";
56
54#ifndef CONFIG_PCI 57#ifndef CONFIG_PCI
55unsigned long isa_io_base = 0; 58unsigned long isa_io_base = 0;
56unsigned long isa_mem_base = 0; 59unsigned long isa_mem_base = 0;
@@ -97,6 +100,7 @@ mpc834x_sys_setup_arch(void)
97 bd_t *binfo = (bd_t *) __res; 100 bd_t *binfo = (bd_t *) __res;
98 unsigned int freq; 101 unsigned int freq;
99 struct gianfar_platform_data *pdata; 102 struct gianfar_platform_data *pdata;
103 struct gianfar_mdio_data *mdata;
100 104
101 /* get the core frequency */ 105 /* get the core frequency */
102 freq = binfo->bi_intfreq; 106 freq = binfo->bi_intfreq;
@@ -111,24 +115,27 @@ mpc834x_sys_setup_arch(void)
111#endif 115#endif
112 mpc83xx_early_serial_map(); 116 mpc83xx_early_serial_map();
113 117
118 /* setup the board related info for the MDIO bus */
119 mdata = (struct gianfar_mdio_data *) ppc_sys_get_pdata(MPC83xx_MDIO);
120
121 mdata->irq[0] = MPC83xx_IRQ_EXT1;
122 mdata->irq[1] = MPC83xx_IRQ_EXT2;
123 mdata->irq[2] = -1;
124 mdata->irq[31] = -1;
125 mdata->paddr += binfo->bi_immr_base;
126
114 /* setup the board related information for the enet controllers */ 127 /* setup the board related information for the enet controllers */
115 pdata = (struct gianfar_platform_data *) ppc_sys_get_pdata(MPC83xx_TSEC1); 128 pdata = (struct gianfar_platform_data *) ppc_sys_get_pdata(MPC83xx_TSEC1);
116 if (pdata) { 129 if (pdata) {
117 pdata->board_flags = FSL_GIANFAR_BRD_HAS_PHY_INTR; 130 pdata->board_flags = FSL_GIANFAR_BRD_HAS_PHY_INTR;
118 pdata->interruptPHY = MPC83xx_IRQ_EXT1; 131 pdata->bus_id = GFAR_PHY_0;
119 pdata->phyid = 0;
120 /* fixup phy address */
121 pdata->phy_reg_addr += binfo->bi_immr_base;
122 memcpy(pdata->mac_addr, binfo->bi_enetaddr, 6); 132 memcpy(pdata->mac_addr, binfo->bi_enetaddr, 6);
123 } 133 }
124 134
125 pdata = (struct gianfar_platform_data *) ppc_sys_get_pdata(MPC83xx_TSEC2); 135 pdata = (struct gianfar_platform_data *) ppc_sys_get_pdata(MPC83xx_TSEC2);
126 if (pdata) { 136 if (pdata) {
127 pdata->board_flags = FSL_GIANFAR_BRD_HAS_PHY_INTR; 137 pdata->board_flags = FSL_GIANFAR_BRD_HAS_PHY_INTR;
128 pdata->interruptPHY = MPC83xx_IRQ_EXT2; 138 pdata->bus_id = GFAR_PHY_1;
129 pdata->phyid = 1;
130 /* fixup phy address */
131 pdata->phy_reg_addr += binfo->bi_immr_base;
132 memcpy(pdata->mac_addr, binfo->bi_enet1addr, 6); 139 memcpy(pdata->mac_addr, binfo->bi_enet1addr, 6);
133 } 140 }
134 141
diff --git a/arch/ppc/platforms/85xx/mpc85xx_ads_common.c b/arch/ppc/platforms/85xx/mpc85xx_ads_common.c
index bd3ac0136756..16ad092d8a06 100644
--- a/arch/ppc/platforms/85xx/mpc85xx_ads_common.c
+++ b/arch/ppc/platforms/85xx/mpc85xx_ads_common.c
@@ -45,6 +45,8 @@
45 45
46#include <mm/mmu_decl.h> 46#include <mm/mmu_decl.h>
47 47
48#include <syslib/ppc85xx_rio.h>
49
48#include <platforms/85xx/mpc85xx_ads_common.h> 50#include <platforms/85xx/mpc85xx_ads_common.h>
49 51
50#ifndef CONFIG_PCI 52#ifndef CONFIG_PCI
@@ -189,3 +191,11 @@ mpc85xx_exclude_device(u_char bus, u_char devfn)
189} 191}
190 192
191#endif /* CONFIG_PCI */ 193#endif /* CONFIG_PCI */
194
195#ifdef CONFIG_RAPIDIO
196void platform_rio_init(void)
197{
198 /* 512MB RIO LAW at 0xc0000000 */
199 mpc85xx_rio_setup(0xc0000000, 0x20000000);
200}
201#endif /* CONFIG_RAPIDIO */
diff --git a/arch/ppc/platforms/85xx/stx_gp3.c b/arch/ppc/platforms/85xx/stx_gp3.c
index 1e1b85f8193a..15ce9d070634 100644
--- a/arch/ppc/platforms/85xx/stx_gp3.c
+++ b/arch/ppc/platforms/85xx/stx_gp3.c
@@ -37,6 +37,7 @@
37#include <linux/module.h> 37#include <linux/module.h>
38#include <linux/fsl_devices.h> 38#include <linux/fsl_devices.h>
39#include <linux/interrupt.h> 39#include <linux/interrupt.h>
40#include <linux/rio.h>
40 41
41#include <asm/system.h> 42#include <asm/system.h>
42#include <asm/pgtable.h> 43#include <asm/pgtable.h>
@@ -57,6 +58,7 @@
57 58
58#include <syslib/cpm2_pic.h> 59#include <syslib/cpm2_pic.h>
59#include <syslib/ppc85xx_common.h> 60#include <syslib/ppc85xx_common.h>
61#include <syslib/ppc85xx_rio.h>
60 62
61 63
62unsigned char __res[sizeof(bd_t)]; 64unsigned char __res[sizeof(bd_t)];
@@ -273,6 +275,18 @@ int mpc85xx_exclude_device(u_char bus, u_char devfn)
273} 275}
274#endif /* CONFIG_PCI */ 276#endif /* CONFIG_PCI */
275 277
278#ifdef CONFIG_RAPIDIO
279void
280platform_rio_init(void)
281{
282 /*
283 * The STx firmware configures the RapidIO Local Access Window
284 * at 0xc0000000 with a size of 512MB.
285 */
286 mpc85xx_rio_setup(0xc0000000, 0x20000000);
287}
288#endif /* CONFIG_RAPIDIO */
289
276void __init 290void __init
277platform_init(unsigned long r3, unsigned long r4, unsigned long r5, 291platform_init(unsigned long r3, unsigned long r4, unsigned long r5,
278 unsigned long r6, unsigned long r7) 292 unsigned long r6, unsigned long r7)
diff --git a/arch/ppc/platforms/85xx/stx_gp3.h b/arch/ppc/platforms/85xx/stx_gp3.h
index 95fdf4b0680b..7bcc6c35a417 100644
--- a/arch/ppc/platforms/85xx/stx_gp3.h
+++ b/arch/ppc/platforms/85xx/stx_gp3.h
@@ -21,6 +21,7 @@
21 21
22#include <linux/config.h> 22#include <linux/config.h>
23#include <linux/init.h> 23#include <linux/init.h>
24#include <linux/seq_file.h>
24#include <asm/ppcboot.h> 25#include <asm/ppcboot.h>
25 26
26#define BOARD_CCSRBAR ((uint)0xe0000000) 27#define BOARD_CCSRBAR ((uint)0xe0000000)
diff --git a/arch/ppc/platforms/ev64360.c b/arch/ppc/platforms/ev64360.c
index b1324564456e..b9d844f88c2b 100644
--- a/arch/ppc/platforms/ev64360.c
+++ b/arch/ppc/platforms/ev64360.c
@@ -52,6 +52,8 @@ static u32 ev64360_bus_frequency;
52 52
53unsigned char __res[sizeof(bd_t)]; 53unsigned char __res[sizeof(bd_t)];
54 54
55TODC_ALLOC();
56
55static int __init 57static int __init
56ev64360_map_irq(struct pci_dev *dev, unsigned char idsel, unsigned char pin) 58ev64360_map_irq(struct pci_dev *dev, unsigned char idsel, unsigned char pin)
57{ 59{
@@ -182,6 +184,9 @@ ev64360_setup_peripherals(void)
182 EV64360_RTC_WINDOW_BASE, EV64360_RTC_WINDOW_SIZE, 0); 184 EV64360_RTC_WINDOW_BASE, EV64360_RTC_WINDOW_SIZE, 0);
183 bh.ci->enable_window_32bit(&bh, MV64x60_CPU2DEV_1_WIN); 185 bh.ci->enable_window_32bit(&bh, MV64x60_CPU2DEV_1_WIN);
184 186
187 TODC_INIT(TODC_TYPE_DS1501, 0, 0,
188 ioremap(EV64360_RTC_WINDOW_BASE, EV64360_RTC_WINDOW_SIZE), 8);
189
185 mv64x60_set_32bit_window(&bh, MV64x60_CPU2SRAM_WIN, 190 mv64x60_set_32bit_window(&bh, MV64x60_CPU2SRAM_WIN,
186 EV64360_INTERNAL_SRAM_BASE, MV64360_SRAM_SIZE, 0); 191 EV64360_INTERNAL_SRAM_BASE, MV64360_SRAM_SIZE, 0);
187 bh.ci->enable_window_32bit(&bh, MV64x60_CPU2SRAM_WIN); 192 bh.ci->enable_window_32bit(&bh, MV64x60_CPU2SRAM_WIN);
@@ -496,6 +501,13 @@ platform_init(unsigned long r3, unsigned long r4, unsigned long r5,
496 ppc_md.power_off = ev64360_power_off; 501 ppc_md.power_off = ev64360_power_off;
497 ppc_md.halt = ev64360_halt; 502 ppc_md.halt = ev64360_halt;
498 ppc_md.find_end_of_memory = ev64360_find_end_of_memory; 503 ppc_md.find_end_of_memory = ev64360_find_end_of_memory;
504 ppc_md.init = NULL;
505
506 ppc_md.time_init = todc_time_init;
507 ppc_md.set_rtc_time = todc_set_rtc_time;
508 ppc_md.get_rtc_time = todc_get_rtc_time;
509 ppc_md.nvram_read_val = todc_direct_read_val;
510 ppc_md.nvram_write_val = todc_direct_write_val;
499 ppc_md.calibrate_decr = ev64360_calibrate_decr; 511 ppc_md.calibrate_decr = ev64360_calibrate_decr;
500 512
501#if defined(CONFIG_SERIAL_TEXT_DEBUG) && defined(CONFIG_SERIAL_MPSC_CONSOLE) 513#if defined(CONFIG_SERIAL_TEXT_DEBUG) && defined(CONFIG_SERIAL_MPSC_CONSOLE)
diff --git a/arch/ppc/syslib/Makefile b/arch/ppc/syslib/Makefile
index b4ef15b45c4a..5b7f2b80e56e 100644
--- a/arch/ppc/syslib/Makefile
+++ b/arch/ppc/syslib/Makefile
@@ -15,6 +15,7 @@ obj-$(CONFIG_440EP) += ibm440gx_common.o
15obj-$(CONFIG_440GP) += ibm440gp_common.o 15obj-$(CONFIG_440GP) += ibm440gp_common.o
16obj-$(CONFIG_440GX) += ibm440gx_common.o 16obj-$(CONFIG_440GX) += ibm440gx_common.o
17obj-$(CONFIG_440SP) += ibm440gx_common.o ibm440sp_common.o 17obj-$(CONFIG_440SP) += ibm440gx_common.o ibm440sp_common.o
18obj-$(CONFIG_440SPE) += ibm440gx_common.o ibm440sp_common.o ppc440spe_pcie.o
18ifeq ($(CONFIG_4xx),y) 19ifeq ($(CONFIG_4xx),y)
19ifeq ($(CONFIG_VIRTEX_II_PRO),y) 20ifeq ($(CONFIG_VIRTEX_II_PRO),y)
20obj-$(CONFIG_40x) += xilinx_pic.o 21obj-$(CONFIG_40x) += xilinx_pic.o
@@ -46,12 +47,14 @@ obj-$(CONFIG_BAMBOO) += pci_auto.o todc_time.o
46obj-$(CONFIG_CPCI690) += todc_time.o pci_auto.o 47obj-$(CONFIG_CPCI690) += todc_time.o pci_auto.o
47obj-$(CONFIG_EBONY) += pci_auto.o todc_time.o 48obj-$(CONFIG_EBONY) += pci_auto.o todc_time.o
48obj-$(CONFIG_EV64260) += todc_time.o pci_auto.o 49obj-$(CONFIG_EV64260) += todc_time.o pci_auto.o
50obj-$(CONFIG_EV64360) += todc_time.o
49obj-$(CONFIG_CHESTNUT) += mv64360_pic.o pci_auto.o 51obj-$(CONFIG_CHESTNUT) += mv64360_pic.o pci_auto.o
50obj-$(CONFIG_GEMINI) += open_pic.o 52obj-$(CONFIG_GEMINI) += open_pic.o
51obj-$(CONFIG_GT64260) += gt64260_pic.o 53obj-$(CONFIG_GT64260) += gt64260_pic.o
52obj-$(CONFIG_LOPEC) += pci_auto.o todc_time.o 54obj-$(CONFIG_LOPEC) += pci_auto.o todc_time.o
53obj-$(CONFIG_HDPU) += pci_auto.o 55obj-$(CONFIG_HDPU) += pci_auto.o
54obj-$(CONFIG_LUAN) += pci_auto.o todc_time.o 56obj-$(CONFIG_LUAN) += pci_auto.o todc_time.o
57obj-$(CONFIG_YUCCA) += pci_auto.o todc_time.o
55obj-$(CONFIG_KATANA) += pci_auto.o 58obj-$(CONFIG_KATANA) += pci_auto.o
56obj-$(CONFIG_MV64360) += mv64360_pic.o 59obj-$(CONFIG_MV64360) += mv64360_pic.o
57obj-$(CONFIG_MV64X60) += mv64x60.o mv64x60_win.o 60obj-$(CONFIG_MV64X60) += mv64x60.o mv64x60_win.o
@@ -92,6 +95,7 @@ obj-$(CONFIG_85xx) += open_pic.o ppc85xx_common.o ppc85xx_setup.o \
92ifeq ($(CONFIG_85xx),y) 95ifeq ($(CONFIG_85xx),y)
93obj-$(CONFIG_PCI) += pci_auto.o 96obj-$(CONFIG_PCI) += pci_auto.o
94endif 97endif
98obj-$(CONFIG_RAPIDIO) += ppc85xx_rio.o
95obj-$(CONFIG_83xx) += ipic.o ppc83xx_setup.o ppc_sys.o \ 99obj-$(CONFIG_83xx) += ipic.o ppc83xx_setup.o ppc_sys.o \
96 mpc83xx_sys.o mpc83xx_devices.o 100 mpc83xx_sys.o mpc83xx_devices.o
97ifeq ($(CONFIG_83xx),y) 101ifeq ($(CONFIG_83xx),y)
diff --git a/arch/ppc/syslib/ibm440sp_common.c b/arch/ppc/syslib/ibm440sp_common.c
index 417d4cff77a0..cdafda127d81 100644
--- a/arch/ppc/syslib/ibm440sp_common.c
+++ b/arch/ppc/syslib/ibm440sp_common.c
@@ -1,7 +1,7 @@
1/* 1/*
2 * arch/ppc/syslib/ibm440sp_common.c 2 * arch/ppc/syslib/ibm440sp_common.c
3 * 3 *
4 * PPC440SP system library 4 * PPC440SP/PPC440SPe system library
5 * 5 *
6 * Matt Porter <mporter@kernel.crashing.org> 6 * Matt Porter <mporter@kernel.crashing.org>
7 * Copyright 2002-2005 MontaVista Software Inc. 7 * Copyright 2002-2005 MontaVista Software Inc.
@@ -35,7 +35,7 @@ unsigned long __init ibm440sp_find_end_of_memory(void)
35 u32 mem_size = 0; 35 u32 mem_size = 0;
36 36
37 /* Read two bank sizes and sum */ 37 /* Read two bank sizes and sum */
38 for (i=0; i<2; i++) 38 for (i=0; i< MQ0_NUM_BANKS; i++)
39 switch (mfdcr(DCRN_MQ0_BS0BAS + i) & MQ0_CONFIG_SIZE_MASK) { 39 switch (mfdcr(DCRN_MQ0_BS0BAS + i) & MQ0_CONFIG_SIZE_MASK) {
40 case MQ0_CONFIG_SIZE_8M: 40 case MQ0_CONFIG_SIZE_8M:
41 mem_size += PPC44x_MEM_SIZE_8M; 41 mem_size += PPC44x_MEM_SIZE_8M;
diff --git a/arch/ppc/syslib/ibm44x_common.c b/arch/ppc/syslib/ibm44x_common.c
index 5152c8e41340..71db11d22158 100644
--- a/arch/ppc/syslib/ibm44x_common.c
+++ b/arch/ppc/syslib/ibm44x_common.c
@@ -20,6 +20,7 @@
20#include <linux/types.h> 20#include <linux/types.h>
21#include <linux/serial.h> 21#include <linux/serial.h>
22#include <linux/module.h> 22#include <linux/module.h>
23#include <linux/initrd.h>
23 24
24#include <asm/ibm44x.h> 25#include <asm/ibm44x.h>
25#include <asm/mmu.h> 26#include <asm/mmu.h>
@@ -214,9 +215,20 @@ void __init ibm44x_platform_init(unsigned long r3, unsigned long r4, unsigned lo
214/* Called from machine_check_exception */ 215/* Called from machine_check_exception */
215void platform_machine_check(struct pt_regs *regs) 216void platform_machine_check(struct pt_regs *regs)
216{ 217{
218#if defined(CONFIG_440SP) || defined(CONFIG_440SPE)
219 printk("PLB0: BEAR=0x%08x%08x ACR= 0x%08x BESR= 0x%08x%08x\n",
220 mfdcr(DCRN_PLB0_BEARH), mfdcr(DCRN_PLB0_BEARL),
221 mfdcr(DCRN_PLB0_ACR), mfdcr(DCRN_PLB0_BESRH),
222 mfdcr(DCRN_PLB0_BESRL));
223 printk("PLB1: BEAR=0x%08x%08x ACR= 0x%08x BESR= 0x%08x%08x\n",
224 mfdcr(DCRN_PLB1_BEARH), mfdcr(DCRN_PLB1_BEARL),
225 mfdcr(DCRN_PLB1_ACR), mfdcr(DCRN_PLB1_BESRH),
226 mfdcr(DCRN_PLB1_BESRL));
227#else
217 printk("PLB0: BEAR=0x%08x%08x ACR= 0x%08x BESR= 0x%08x\n", 228 printk("PLB0: BEAR=0x%08x%08x ACR= 0x%08x BESR= 0x%08x\n",
218 mfdcr(DCRN_PLB0_BEARH), mfdcr(DCRN_PLB0_BEARL), 229 mfdcr(DCRN_PLB0_BEARH), mfdcr(DCRN_PLB0_BEARL),
219 mfdcr(DCRN_PLB0_ACR), mfdcr(DCRN_PLB0_BESR)); 230 mfdcr(DCRN_PLB0_ACR), mfdcr(DCRN_PLB0_BESR));
231#endif
220 printk("POB0: BEAR=0x%08x%08x BESR0=0x%08x BESR1=0x%08x\n", 232 printk("POB0: BEAR=0x%08x%08x BESR0=0x%08x BESR1=0x%08x\n",
221 mfdcr(DCRN_POB0_BEARH), mfdcr(DCRN_POB0_BEARL), 233 mfdcr(DCRN_POB0_BEARH), mfdcr(DCRN_POB0_BEARL),
222 mfdcr(DCRN_POB0_BESR0), mfdcr(DCRN_POB0_BESR1)); 234 mfdcr(DCRN_POB0_BESR0), mfdcr(DCRN_POB0_BESR1));
diff --git a/arch/ppc/syslib/m8xx_setup.c b/arch/ppc/syslib/m8xx_setup.c
index 97ffbc70574f..1cc3abe6fa43 100644
--- a/arch/ppc/syslib/m8xx_setup.c
+++ b/arch/ppc/syslib/m8xx_setup.c
@@ -45,6 +45,7 @@
45#include <asm/bootinfo.h> 45#include <asm/bootinfo.h>
46#include <asm/time.h> 46#include <asm/time.h>
47#include <asm/xmon.h> 47#include <asm/xmon.h>
48#include <asm/ppc_sys.h>
48 49
49#include "ppc8xx_pic.h" 50#include "ppc8xx_pic.h"
50 51
diff --git a/arch/ppc/syslib/m8xx_wdt.c b/arch/ppc/syslib/m8xx_wdt.c
index c5ac5ce5d7d2..a21632d37e5a 100644
--- a/arch/ppc/syslib/m8xx_wdt.c
+++ b/arch/ppc/syslib/m8xx_wdt.c
@@ -14,6 +14,7 @@
14#include <linux/irq.h> 14#include <linux/irq.h>
15#include <linux/kernel.h> 15#include <linux/kernel.h>
16#include <linux/sched.h> 16#include <linux/sched.h>
17#include <asm/io.h>
17#include <asm/8xx_immap.h> 18#include <asm/8xx_immap.h>
18#include <syslib/m8xx_wdt.h> 19#include <syslib/m8xx_wdt.h>
19 20
@@ -29,8 +30,8 @@ void m8xx_wdt_reset(void)
29{ 30{
30 volatile immap_t *imap = (volatile immap_t *)IMAP_ADDR; 31 volatile immap_t *imap = (volatile immap_t *)IMAP_ADDR;
31 32
32 out_be16(imap->im_siu_conf.sc_swsr, 0x556c); /* write magic1 */ 33 out_be16(&imap->im_siu_conf.sc_swsr, 0x556c); /* write magic1 */
33 out_be16(imap->im_siu_conf.sc_swsr, 0xaa39); /* write magic2 */ 34 out_be16(&imap->im_siu_conf.sc_swsr, 0xaa39); /* write magic2 */
34} 35}
35 36
36static irqreturn_t m8xx_wdt_interrupt(int irq, void *dev, struct pt_regs *regs) 37static irqreturn_t m8xx_wdt_interrupt(int irq, void *dev, struct pt_regs *regs)
@@ -39,7 +40,7 @@ static irqreturn_t m8xx_wdt_interrupt(int irq, void *dev, struct pt_regs *regs)
39 40
40 m8xx_wdt_reset(); 41 m8xx_wdt_reset();
41 42
42 out_be16(imap->im_sit.sit_piscr, in_be16(imap->im_sit.sit_piscr | PISCR_PS)); /* clear irq */ 43 out_be16(&imap->im_sit.sit_piscr, in_be16(&imap->im_sit.sit_piscr) | PISCR_PS); /* clear irq */
43 44
44 return IRQ_HANDLED; 45 return IRQ_HANDLED;
45} 46}
@@ -51,7 +52,7 @@ void __init m8xx_wdt_handler_install(bd_t * binfo)
51 u32 sypcr; 52 u32 sypcr;
52 u32 pitrtclk; 53 u32 pitrtclk;
53 54
54 sypcr = in_be32(imap->im_siu_conf.sc_sypcr); 55 sypcr = in_be32(&imap->im_siu_conf.sc_sypcr);
55 56
56 if (!(sypcr & 0x04)) { 57 if (!(sypcr & 0x04)) {
57 printk(KERN_NOTICE "m8xx_wdt: wdt disabled (SYPCR: 0x%08X)\n", 58 printk(KERN_NOTICE "m8xx_wdt: wdt disabled (SYPCR: 0x%08X)\n",
@@ -87,9 +88,9 @@ void __init m8xx_wdt_handler_install(bd_t * binfo)
87 else 88 else
88 pitc = pitrtclk * wdt_timeout / binfo->bi_intfreq / 2; 89 pitc = pitrtclk * wdt_timeout / binfo->bi_intfreq / 2;
89 90
90 out_be32(imap->im_sit.sit_pitc, pitc << 16); 91 out_be32(&imap->im_sit.sit_pitc, pitc << 16);
91 92
92 out_be16(imap->im_sit.sit_piscr, (mk_int_int_mask(PIT_INTERRUPT) << 8) | PISCR_PIE | PISCR_PTE); 93 out_be16(&imap->im_sit.sit_piscr, (mk_int_int_mask(PIT_INTERRUPT) << 8) | PISCR_PIE | PISCR_PTE);
93 94
94 if (setup_irq(PIT_INTERRUPT, &m8xx_wdt_irqaction)) 95 if (setup_irq(PIT_INTERRUPT, &m8xx_wdt_irqaction))
95 panic("m8xx_wdt: error setting up the watchdog irq!"); 96 panic("m8xx_wdt: error setting up the watchdog irq!");
diff --git a/arch/ppc/syslib/mpc83xx_devices.c b/arch/ppc/syslib/mpc83xx_devices.c
index dbf8acac507f..f43fbf9a9389 100644
--- a/arch/ppc/syslib/mpc83xx_devices.c
+++ b/arch/ppc/syslib/mpc83xx_devices.c
@@ -27,18 +27,20 @@
27 * what IMMRBAR is, will get fixed up by mach_mpc83xx_fixup 27 * what IMMRBAR is, will get fixed up by mach_mpc83xx_fixup
28 */ 28 */
29 29
30struct gianfar_mdio_data mpc83xx_mdio_pdata = {
31 .paddr = 0x24520,
32};
33
30static struct gianfar_platform_data mpc83xx_tsec1_pdata = { 34static struct gianfar_platform_data mpc83xx_tsec1_pdata = {
31 .device_flags = FSL_GIANFAR_DEV_HAS_GIGABIT | 35 .device_flags = FSL_GIANFAR_DEV_HAS_GIGABIT |
32 FSL_GIANFAR_DEV_HAS_COALESCE | FSL_GIANFAR_DEV_HAS_RMON | 36 FSL_GIANFAR_DEV_HAS_COALESCE | FSL_GIANFAR_DEV_HAS_RMON |
33 FSL_GIANFAR_DEV_HAS_MULTI_INTR, 37 FSL_GIANFAR_DEV_HAS_MULTI_INTR,
34 .phy_reg_addr = 0x24000,
35}; 38};
36 39
37static struct gianfar_platform_data mpc83xx_tsec2_pdata = { 40static struct gianfar_platform_data mpc83xx_tsec2_pdata = {
38 .device_flags = FSL_GIANFAR_DEV_HAS_GIGABIT | 41 .device_flags = FSL_GIANFAR_DEV_HAS_GIGABIT |
39 FSL_GIANFAR_DEV_HAS_COALESCE | FSL_GIANFAR_DEV_HAS_RMON | 42 FSL_GIANFAR_DEV_HAS_COALESCE | FSL_GIANFAR_DEV_HAS_RMON |
40 FSL_GIANFAR_DEV_HAS_MULTI_INTR, 43 FSL_GIANFAR_DEV_HAS_MULTI_INTR,
41 .phy_reg_addr = 0x24000,
42}; 44};
43 45
44static struct fsl_i2c_platform_data mpc83xx_fsl_i2c1_pdata = { 46static struct fsl_i2c_platform_data mpc83xx_fsl_i2c1_pdata = {
@@ -220,6 +222,12 @@ struct platform_device ppc_sys_platform_devices[] = {
220 }, 222 },
221 }, 223 },
222 }, 224 },
225 [MPC83xx_MDIO] = {
226 .name = "fsl-gianfar_mdio",
227 .id = 0,
228 .dev.platform_data = &mpc83xx_mdio_pdata,
229 .num_resources = 0,
230 },
223}; 231};
224 232
225static int __init mach_mpc83xx_fixup(struct platform_device *pdev) 233static int __init mach_mpc83xx_fixup(struct platform_device *pdev)
diff --git a/arch/ppc/syslib/mpc83xx_sys.c b/arch/ppc/syslib/mpc83xx_sys.c
index 29aa63350025..da743446789b 100644
--- a/arch/ppc/syslib/mpc83xx_sys.c
+++ b/arch/ppc/syslib/mpc83xx_sys.c
@@ -24,72 +24,72 @@ struct ppc_sys_spec ppc_sys_specs[] = {
24 .ppc_sys_name = "8349E", 24 .ppc_sys_name = "8349E",
25 .mask = 0xFFFF0000, 25 .mask = 0xFFFF0000,
26 .value = 0x80500000, 26 .value = 0x80500000,
27 .num_devices = 8, 27 .num_devices = 9,
28 .device_list = (enum ppc_sys_devices[]) 28 .device_list = (enum ppc_sys_devices[])
29 { 29 {
30 MPC83xx_TSEC1, MPC83xx_TSEC2, MPC83xx_IIC1, 30 MPC83xx_TSEC1, MPC83xx_TSEC2, MPC83xx_IIC1,
31 MPC83xx_IIC2, MPC83xx_DUART, MPC83xx_SEC2, 31 MPC83xx_IIC2, MPC83xx_DUART, MPC83xx_SEC2,
32 MPC83xx_USB2_DR, MPC83xx_USB2_MPH 32 MPC83xx_USB2_DR, MPC83xx_USB2_MPH, MPC83xx_MDIO
33 }, 33 },
34 }, 34 },
35 { 35 {
36 .ppc_sys_name = "8349", 36 .ppc_sys_name = "8349",
37 .mask = 0xFFFF0000, 37 .mask = 0xFFFF0000,
38 .value = 0x80510000, 38 .value = 0x80510000,
39 .num_devices = 7, 39 .num_devices = 8,
40 .device_list = (enum ppc_sys_devices[]) 40 .device_list = (enum ppc_sys_devices[])
41 { 41 {
42 MPC83xx_TSEC1, MPC83xx_TSEC2, MPC83xx_IIC1, 42 MPC83xx_TSEC1, MPC83xx_TSEC2, MPC83xx_IIC1,
43 MPC83xx_IIC2, MPC83xx_DUART, 43 MPC83xx_IIC2, MPC83xx_DUART,
44 MPC83xx_USB2_DR, MPC83xx_USB2_MPH 44 MPC83xx_USB2_DR, MPC83xx_USB2_MPH, MPC83xx_MDIO
45 }, 45 },
46 }, 46 },
47 { 47 {
48 .ppc_sys_name = "8347E", 48 .ppc_sys_name = "8347E",
49 .mask = 0xFFFF0000, 49 .mask = 0xFFFF0000,
50 .value = 0x80520000, 50 .value = 0x80520000,
51 .num_devices = 8, 51 .num_devices = 9,
52 .device_list = (enum ppc_sys_devices[]) 52 .device_list = (enum ppc_sys_devices[])
53 { 53 {
54 MPC83xx_TSEC1, MPC83xx_TSEC2, MPC83xx_IIC1, 54 MPC83xx_TSEC1, MPC83xx_TSEC2, MPC83xx_IIC1,
55 MPC83xx_IIC2, MPC83xx_DUART, MPC83xx_SEC2, 55 MPC83xx_IIC2, MPC83xx_DUART, MPC83xx_SEC2,
56 MPC83xx_USB2_DR, MPC83xx_USB2_MPH 56 MPC83xx_USB2_DR, MPC83xx_USB2_MPH, MPC83xx_MDIO
57 }, 57 },
58 }, 58 },
59 { 59 {
60 .ppc_sys_name = "8347", 60 .ppc_sys_name = "8347",
61 .mask = 0xFFFF0000, 61 .mask = 0xFFFF0000,
62 .value = 0x80530000, 62 .value = 0x80530000,
63 .num_devices = 7, 63 .num_devices = 8,
64 .device_list = (enum ppc_sys_devices[]) 64 .device_list = (enum ppc_sys_devices[])
65 { 65 {
66 MPC83xx_TSEC1, MPC83xx_TSEC2, MPC83xx_IIC1, 66 MPC83xx_TSEC1, MPC83xx_TSEC2, MPC83xx_IIC1,
67 MPC83xx_IIC2, MPC83xx_DUART, 67 MPC83xx_IIC2, MPC83xx_DUART,
68 MPC83xx_USB2_DR, MPC83xx_USB2_MPH 68 MPC83xx_USB2_DR, MPC83xx_USB2_MPH, MPC83xx_MDIO
69 }, 69 },
70 }, 70 },
71 { 71 {
72 .ppc_sys_name = "8343E", 72 .ppc_sys_name = "8343E",
73 .mask = 0xFFFF0000, 73 .mask = 0xFFFF0000,
74 .value = 0x80540000, 74 .value = 0x80540000,
75 .num_devices = 7, 75 .num_devices = 8,
76 .device_list = (enum ppc_sys_devices[]) 76 .device_list = (enum ppc_sys_devices[])
77 { 77 {
78 MPC83xx_TSEC1, MPC83xx_TSEC2, MPC83xx_IIC1, 78 MPC83xx_TSEC1, MPC83xx_TSEC2, MPC83xx_IIC1,
79 MPC83xx_IIC2, MPC83xx_DUART, MPC83xx_SEC2, 79 MPC83xx_IIC2, MPC83xx_DUART, MPC83xx_SEC2,
80 MPC83xx_USB2_DR, 80 MPC83xx_USB2_DR, MPC83xx_MDIO
81 }, 81 },
82 }, 82 },
83 { 83 {
84 .ppc_sys_name = "8343", 84 .ppc_sys_name = "8343",
85 .mask = 0xFFFF0000, 85 .mask = 0xFFFF0000,
86 .value = 0x80550000, 86 .value = 0x80550000,
87 .num_devices = 6, 87 .num_devices = 7,
88 .device_list = (enum ppc_sys_devices[]) 88 .device_list = (enum ppc_sys_devices[])
89 { 89 {
90 MPC83xx_TSEC1, MPC83xx_TSEC2, MPC83xx_IIC1, 90 MPC83xx_TSEC1, MPC83xx_TSEC2, MPC83xx_IIC1,
91 MPC83xx_IIC2, MPC83xx_DUART, 91 MPC83xx_IIC2, MPC83xx_DUART,
92 MPC83xx_USB2_DR, 92 MPC83xx_USB2_DR, MPC83xx_MDIO
93 }, 93 },
94 }, 94 },
95 { /* default match */ 95 { /* default match */
diff --git a/arch/ppc/syslib/ppc405_pci.c b/arch/ppc/syslib/ppc405_pci.c
index 81c83bf98df4..d6d838b16dac 100644
--- a/arch/ppc/syslib/ppc405_pci.c
+++ b/arch/ppc/syslib/ppc405_pci.c
@@ -89,13 +89,6 @@ ppc4xx_find_bridges(void)
89 isa_mem_base = 0; 89 isa_mem_base = 0;
90 pci_dram_offset = 0; 90 pci_dram_offset = 0;
91 91
92#if (PSR_PCI_ARBIT_EN > 1)
93 /* Check if running in slave mode */
94 if ((mfdcr(DCRN_CHPSR) & PSR_PCI_ARBIT_EN) == 0) {
95 printk("Running as PCI slave, kernel PCI disabled !\n");
96 return;
97 }
98#endif
99 /* Setup PCI32 hose */ 92 /* Setup PCI32 hose */
100 hose_a = pcibios_alloc_controller(); 93 hose_a = pcibios_alloc_controller();
101 if (!hose_a) 94 if (!hose_a)
diff --git a/arch/ppc/syslib/ppc440spe_pcie.c b/arch/ppc/syslib/ppc440spe_pcie.c
new file mode 100644
index 000000000000..1509fc1ddfb6
--- /dev/null
+++ b/arch/ppc/syslib/ppc440spe_pcie.c
@@ -0,0 +1,442 @@
1/*
2 * Copyright (c) 2005 Cisco Systems. All rights reserved.
3 * Roland Dreier <rolandd@cisco.com>
4 *
5 * This program is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License as published by the
7 * Free Software Foundation; either version 2 of the License, or (at your
8 * option) any later version.
9 */
10
11#include <linux/config.h>
12#include <linux/kernel.h>
13#include <linux/delay.h>
14#include <linux/pci.h>
15#include <linux/init.h>
16
17#include <asm/reg.h>
18#include <asm/io.h>
19#include <asm/ibm44x.h>
20
21#include "ppc440spe_pcie.h"
22
23static int
24pcie_read_config(struct pci_bus *bus, unsigned int devfn, int offset,
25 int len, u32 *val)
26{
27 struct pci_controller *hose = bus->sysdata;
28
29 if (PCI_SLOT(devfn) != 1)
30 return PCIBIOS_DEVICE_NOT_FOUND;
31
32 offset += devfn << 12;
33
34 /*
35 * Note: the caller has already checked that offset is
36 * suitably aligned and that len is 1, 2 or 4.
37 */
38 switch (len) {
39 case 1:
40 *val = in_8(hose->cfg_data + offset);
41 break;
42 case 2:
43 *val = in_le16(hose->cfg_data + offset);
44 break;
45 default:
46 *val = in_le32(hose->cfg_data + offset);
47 break;
48 }
49
50 if (0) printk("%s: read %x(%d) @ %x\n", __func__, *val, len, offset);
51
52 return PCIBIOS_SUCCESSFUL;
53}
54
55static int
56pcie_write_config(struct pci_bus *bus, unsigned int devfn, int offset,
57 int len, u32 val)
58{
59 struct pci_controller *hose = bus->sysdata;
60
61 if (PCI_SLOT(devfn) != 1)
62 return PCIBIOS_DEVICE_NOT_FOUND;
63
64 offset += devfn << 12;
65
66 switch (len) {
67 case 1:
68 out_8(hose->cfg_data + offset, val);
69 break;
70 case 2:
71 out_le16(hose->cfg_data + offset, val);
72 break;
73 default:
74 out_le32(hose->cfg_data + offset, val);
75 break;
76 }
77 return PCIBIOS_SUCCESSFUL;
78}
79
80static struct pci_ops pcie_pci_ops =
81{
82 .read = pcie_read_config,
83 .write = pcie_write_config
84};
85
86enum {
87 PTYPE_ENDPOINT = 0x0,
88 PTYPE_LEGACY_ENDPOINT = 0x1,
89 PTYPE_ROOT_PORT = 0x4,
90
91 LNKW_X1 = 0x1,
92 LNKW_X4 = 0x4,
93 LNKW_X8 = 0x8
94};
95
96static void check_error(void)
97{
98 u32 valPE0, valPE1, valPE2;
99
100 /* SDR0_PEGPLLLCT1 reset */
101 if (!(valPE0 = SDR_READ(PESDR0_PLLLCT1) & 0x01000000)) {
102 printk(KERN_INFO "PCIE: SDR0_PEGPLLLCT1 reset error 0x%8x\n", valPE0);
103 }
104
105 valPE0 = SDR_READ(PESDR0_RCSSET);
106 valPE1 = SDR_READ(PESDR1_RCSSET);
107 valPE2 = SDR_READ(PESDR2_RCSSET);
108
109 /* SDR0_PExRCSSET rstgu */
110 if ( !(valPE0 & 0x01000000) ||
111 !(valPE1 & 0x01000000) ||
112 !(valPE2 & 0x01000000)) {
113 printk(KERN_INFO "PCIE: SDR0_PExRCSSET rstgu error\n");
114 }
115
116 /* SDR0_PExRCSSET rstdl */
117 if ( !(valPE0 & 0x00010000) ||
118 !(valPE1 & 0x00010000) ||
119 !(valPE2 & 0x00010000)) {
120 printk(KERN_INFO "PCIE: SDR0_PExRCSSET rstdl error\n");
121 }
122
123 /* SDR0_PExRCSSET rstpyn */
124 if ( (valPE0 & 0x00001000) ||
125 (valPE1 & 0x00001000) ||
126 (valPE2 & 0x00001000)) {
127 printk(KERN_INFO "PCIE: SDR0_PExRCSSET rstpyn error\n");
128 }
129
130 /* SDR0_PExRCSSET hldplb */
131 if ( (valPE0 & 0x10000000) ||
132 (valPE1 & 0x10000000) ||
133 (valPE2 & 0x10000000)) {
134 printk(KERN_INFO "PCIE: SDR0_PExRCSSET hldplb error\n");
135 }
136
137 /* SDR0_PExRCSSET rdy */
138 if ( (valPE0 & 0x00100000) ||
139 (valPE1 & 0x00100000) ||
140 (valPE2 & 0x00100000)) {
141 printk(KERN_INFO "PCIE: SDR0_PExRCSSET rdy error\n");
142 }
143
144 /* SDR0_PExRCSSET shutdown */
145 if ( (valPE0 & 0x00000100) ||
146 (valPE1 & 0x00000100) ||
147 (valPE2 & 0x00000100)) {
148 printk(KERN_INFO "PCIE: SDR0_PExRCSSET shutdown error\n");
149 }
150}
151
152/*
153 * Initialize PCI Express core as described in User Manual section 27.12.1
154 */
155int ppc440spe_init_pcie(void)
156{
157 /* Set PLL clock receiver to LVPECL */
158 SDR_WRITE(PESDR0_PLLLCT1, SDR_READ(PESDR0_PLLLCT1) | 1 << 28);
159
160 check_error();
161
162 printk(KERN_INFO "PCIE initialization OK\n");
163
164 if (!(SDR_READ(PESDR0_PLLLCT2) & 0x10000))
165 printk(KERN_INFO "PESDR_PLLCT2 resistance calibration failed (0x%08x)\n",
166 SDR_READ(PESDR0_PLLLCT2));
167
168 /* De-assert reset of PCIe PLL, wait for lock */
169 SDR_WRITE(PESDR0_PLLLCT1, SDR_READ(PESDR0_PLLLCT1) & ~(1 << 24));
170 udelay(3);
171
172 return 0;
173}
174
175int ppc440spe_init_pcie_rootport(int port)
176{
177 static int core_init;
178 void __iomem *utl_base;
179 u32 val = 0;
180 int i;
181
182 if (!core_init) {
183 ++core_init;
184 i = ppc440spe_init_pcie();
185 if (i)
186 return i;
187 }
188
189 /*
190 * Initialize various parts of the PCI Express core for our port:
191 *
192 * - Set as a root port and enable max width
193 * (PXIE0 -> X8, PCIE1 and PCIE2 -> X4).
194 * - Set up UTL configuration.
195 * - Increase SERDES drive strength to levels suggested by AMCC.
196 * - De-assert RSTPYN, RSTDL and RSTGU.
197 */
198 switch (port) {
199 case 0:
200 SDR_WRITE(PESDR0_DLPSET, PTYPE_ROOT_PORT << 20 | LNKW_X8 << 12);
201
202 SDR_WRITE(PESDR0_UTLSET1, 0x21222222);
203 SDR_WRITE(PESDR0_UTLSET2, 0x11000000);
204
205 SDR_WRITE(PESDR0_HSSL0SET1, 0x35000000);
206 SDR_WRITE(PESDR0_HSSL1SET1, 0x35000000);
207 SDR_WRITE(PESDR0_HSSL2SET1, 0x35000000);
208 SDR_WRITE(PESDR0_HSSL3SET1, 0x35000000);
209 SDR_WRITE(PESDR0_HSSL4SET1, 0x35000000);
210 SDR_WRITE(PESDR0_HSSL5SET1, 0x35000000);
211 SDR_WRITE(PESDR0_HSSL6SET1, 0x35000000);
212 SDR_WRITE(PESDR0_HSSL7SET1, 0x35000000);
213
214 SDR_WRITE(PESDR0_RCSSET,
215 (SDR_READ(PESDR0_RCSSET) & ~(1 << 24 | 1 << 16)) | 1 << 12);
216 break;
217
218 case 1:
219 SDR_WRITE(PESDR1_DLPSET, PTYPE_ROOT_PORT << 20 | LNKW_X4 << 12);
220
221 SDR_WRITE(PESDR1_UTLSET1, 0x21222222);
222 SDR_WRITE(PESDR1_UTLSET2, 0x11000000);
223
224 SDR_WRITE(PESDR1_HSSL0SET1, 0x35000000);
225 SDR_WRITE(PESDR1_HSSL1SET1, 0x35000000);
226 SDR_WRITE(PESDR1_HSSL2SET1, 0x35000000);
227 SDR_WRITE(PESDR1_HSSL3SET1, 0x35000000);
228
229 SDR_WRITE(PESDR1_RCSSET,
230 (SDR_READ(PESDR1_RCSSET) & ~(1 << 24 | 1 << 16)) | 1 << 12);
231 break;
232
233 case 2:
234 SDR_WRITE(PESDR2_DLPSET, PTYPE_ROOT_PORT << 20 | LNKW_X4 << 12);
235
236 SDR_WRITE(PESDR2_UTLSET1, 0x21222222);
237 SDR_WRITE(PESDR2_UTLSET2, 0x11000000);
238
239 SDR_WRITE(PESDR2_HSSL0SET1, 0x35000000);
240 SDR_WRITE(PESDR2_HSSL1SET1, 0x35000000);
241 SDR_WRITE(PESDR2_HSSL2SET1, 0x35000000);
242 SDR_WRITE(PESDR2_HSSL3SET1, 0x35000000);
243
244 SDR_WRITE(PESDR2_RCSSET,
245 (SDR_READ(PESDR2_RCSSET) & ~(1 << 24 | 1 << 16)) | 1 << 12);
246 break;
247 }
248
249 mdelay(1000);
250
251 switch (port) {
252 case 0: val = SDR_READ(PESDR0_RCSSTS); break;
253 case 1: val = SDR_READ(PESDR1_RCSSTS); break;
254 case 2: val = SDR_READ(PESDR2_RCSSTS); break;
255 }
256
257 if (!(val & (1 << 20)))
258 printk(KERN_INFO "PCIE%d: PGRST inactive\n", port);
259 else
260 printk(KERN_WARNING "PGRST for PCIE%d failed %08x\n", port, val);
261
262 switch (port) {
263 case 0: printk(KERN_INFO "PCIE0: LOOP %08x\n", SDR_READ(PESDR0_LOOP)); break;
264 case 1: printk(KERN_INFO "PCIE1: LOOP %08x\n", SDR_READ(PESDR1_LOOP)); break;
265 case 2: printk(KERN_INFO "PCIE2: LOOP %08x\n", SDR_READ(PESDR2_LOOP)); break;
266 }
267
268 /*
269 * Map UTL registers at 0xc_1000_0n00
270 */
271 switch (port) {
272 case 0:
273 mtdcr(DCRN_PEGPL_REGBAH(PCIE0), 0x0000000c);
274 mtdcr(DCRN_PEGPL_REGBAL(PCIE0), 0x10000000);
275 mtdcr(DCRN_PEGPL_REGMSK(PCIE0), 0x00007001);
276 mtdcr(DCRN_PEGPL_SPECIAL(PCIE0), 0x68782800);
277 break;
278
279 case 1:
280 mtdcr(DCRN_PEGPL_REGBAH(PCIE1), 0x0000000c);
281 mtdcr(DCRN_PEGPL_REGBAL(PCIE1), 0x10001000);
282 mtdcr(DCRN_PEGPL_REGMSK(PCIE1), 0x00007001);
283 mtdcr(DCRN_PEGPL_SPECIAL(PCIE1), 0x68782800);
284 break;
285
286 case 2:
287 mtdcr(DCRN_PEGPL_REGBAH(PCIE2), 0x0000000c);
288 mtdcr(DCRN_PEGPL_REGBAL(PCIE2), 0x10002000);
289 mtdcr(DCRN_PEGPL_REGMSK(PCIE2), 0x00007001);
290 mtdcr(DCRN_PEGPL_SPECIAL(PCIE2), 0x68782800);
291 }
292
293 utl_base = ioremap64(0xc10000000ull + 0x1000 * port, 0x100);
294
295 /*
296 * Set buffer allocations and then assert VRB and TXE.
297 */
298 out_be32(utl_base + PEUTL_OUTTR, 0x08000000);
299 out_be32(utl_base + PEUTL_INTR, 0x02000000);
300 out_be32(utl_base + PEUTL_OPDBSZ, 0x10000000);
301 out_be32(utl_base + PEUTL_PBBSZ, 0x53000000);
302 out_be32(utl_base + PEUTL_IPHBSZ, 0x08000000);
303 out_be32(utl_base + PEUTL_IPDBSZ, 0x10000000);
304 out_be32(utl_base + PEUTL_RCIRQEN, 0x00f00000);
305 out_be32(utl_base + PEUTL_PCTL, 0x80800066);
306
307 iounmap(utl_base);
308
309 /*
310 * We map PCI Express configuration access into the 512MB regions
311 * PCIE0: 0xc_4000_0000
312 * PCIE1: 0xc_8000_0000
313 * PCIE2: 0xc_c000_0000
314 */
315 switch (port) {
316 case 0:
317 mtdcr(DCRN_PEGPL_CFGBAH(PCIE0), 0x0000000c);
318 mtdcr(DCRN_PEGPL_CFGBAL(PCIE0), 0x40000000);
319 mtdcr(DCRN_PEGPL_CFGMSK(PCIE0), 0xe0000001); /* 512MB region, valid */
320 break;
321
322 case 1:
323 mtdcr(DCRN_PEGPL_CFGBAH(PCIE1), 0x0000000c);
324 mtdcr(DCRN_PEGPL_CFGBAL(PCIE1), 0x80000000);
325 mtdcr(DCRN_PEGPL_CFGMSK(PCIE1), 0xe0000001); /* 512MB region, valid */
326 break;
327
328 case 2:
329 mtdcr(DCRN_PEGPL_CFGBAH(PCIE2), 0x0000000c);
330 mtdcr(DCRN_PEGPL_CFGBAL(PCIE2), 0xc0000000);
331 mtdcr(DCRN_PEGPL_CFGMSK(PCIE2), 0xe0000001); /* 512MB region, valid */
332 break;
333 }
334
335 /*
336 * Check for VC0 active and assert RDY.
337 */
338 switch (port) {
339 case 0:
340 if (!(SDR_READ(PESDR0_RCSSTS) & (1 << 16)))
341 printk(KERN_WARNING "PCIE0: VC0 not active\n");
342 SDR_WRITE(PESDR0_RCSSET, SDR_READ(PESDR0_RCSSET) | 1 << 20);
343 break;
344 case 1:
345 if (!(SDR_READ(PESDR1_RCSSTS) & (1 << 16)))
346 printk(KERN_WARNING "PCIE0: VC0 not active\n");
347 SDR_WRITE(PESDR1_RCSSET, SDR_READ(PESDR1_RCSSET) | 1 << 20);
348 break;
349 case 2:
350 if (!(SDR_READ(PESDR2_RCSSTS) & (1 << 16)))
351 printk(KERN_WARNING "PCIE0: VC0 not active\n");
352 SDR_WRITE(PESDR2_RCSSET, SDR_READ(PESDR2_RCSSET) | 1 << 20);
353 break;
354 }
355
356#if 0
357 /* Dump all config regs */
358 for (i = 0x300; i <= 0x320; ++i)
359 printk("[%04x] 0x%08x\n", i, SDR_READ(i));
360 for (i = 0x340; i <= 0x353; ++i)
361 printk("[%04x] 0x%08x\n", i, SDR_READ(i));
362 for (i = 0x370; i <= 0x383; ++i)
363 printk("[%04x] 0x%08x\n", i, SDR_READ(i));
364 for (i = 0x3a0; i <= 0x3a2; ++i)
365 printk("[%04x] 0x%08x\n", i, SDR_READ(i));
366 for (i = 0x3c0; i <= 0x3c3; ++i)
367 printk("[%04x] 0x%08x\n", i, SDR_READ(i));
368#endif
369
370 mdelay(100);
371
372 return 0;
373}
374
375void ppc440spe_setup_pcie(struct pci_controller *hose, int port)
376{
377 void __iomem *mbase;
378
379 /*
380 * Map 16MB, which is enough for 4 bits of bus #
381 */
382 hose->cfg_data = ioremap64(0xc40000000ull + port * 0x40000000,
383 1 << 24);
384 hose->ops = &pcie_pci_ops;
385
386 /*
387 * Set bus numbers on our root port
388 */
389 mbase = ioremap64(0xc50000000ull + port * 0x40000000, 4096);
390 out_8(mbase + PCI_PRIMARY_BUS, 0);
391 out_8(mbase + PCI_SECONDARY_BUS, 0);
392
393 /*
394 * Set up outbound translation to hose->mem_space from PLB
395 * addresses at an offset of 0xd_0000_0000. We set the low
396 * bits of the mask to 11 to turn off splitting into 8
397 * subregions and to enable the outbound translation.
398 */
399 out_le32(mbase + PECFG_POM0LAH, 0);
400 out_le32(mbase + PECFG_POM0LAL, hose->mem_space.start);
401
402 switch (port) {
403 case 0:
404 mtdcr(DCRN_PEGPL_OMR1BAH(PCIE0), 0x0000000d);
405 mtdcr(DCRN_PEGPL_OMR1BAL(PCIE0), hose->mem_space.start);
406 mtdcr(DCRN_PEGPL_OMR1MSKH(PCIE0), 0x7fffffff);
407 mtdcr(DCRN_PEGPL_OMR1MSKL(PCIE0),
408 ~(hose->mem_space.end - hose->mem_space.start) | 3);
409 break;
410 case 1:
411 mtdcr(DCRN_PEGPL_OMR1BAH(PCIE1), 0x0000000d);
412 mtdcr(DCRN_PEGPL_OMR1BAL(PCIE1), hose->mem_space.start);
413 mtdcr(DCRN_PEGPL_OMR1MSKH(PCIE1), 0x7fffffff);
414 mtdcr(DCRN_PEGPL_OMR1MSKL(PCIE1),
415 ~(hose->mem_space.end - hose->mem_space.start) | 3);
416
417 break;
418 case 2:
419 mtdcr(DCRN_PEGPL_OMR1BAH(PCIE2), 0x0000000d);
420 mtdcr(DCRN_PEGPL_OMR1BAL(PCIE2), hose->mem_space.start);
421 mtdcr(DCRN_PEGPL_OMR1MSKH(PCIE2), 0x7fffffff);
422 mtdcr(DCRN_PEGPL_OMR1MSKL(PCIE2),
423 ~(hose->mem_space.end - hose->mem_space.start) | 3);
424 break;
425 }
426
427 /* Set up 16GB inbound memory window at 0 */
428 out_le32(mbase + PCI_BASE_ADDRESS_0, 0);
429 out_le32(mbase + PCI_BASE_ADDRESS_1, 0);
430 out_le32(mbase + PECFG_BAR0HMPA, 0x7fffffc);
431 out_le32(mbase + PECFG_BAR0LMPA, 0);
432 out_le32(mbase + PECFG_PIM0LAL, 0);
433 out_le32(mbase + PECFG_PIM0LAH, 0);
434 out_le32(mbase + PECFG_PIMEN, 0x1);
435
436 /* Enable I/O, Mem, and Busmaster cycles */
437 out_le16(mbase + PCI_COMMAND,
438 in_le16(mbase + PCI_COMMAND) |
439 PCI_COMMAND_IO | PCI_COMMAND_MEMORY | PCI_COMMAND_MASTER);
440
441 iounmap(mbase);
442}
diff --git a/arch/ppc/syslib/ppc440spe_pcie.h b/arch/ppc/syslib/ppc440spe_pcie.h
new file mode 100644
index 000000000000..55b765ad3272
--- /dev/null
+++ b/arch/ppc/syslib/ppc440spe_pcie.h
@@ -0,0 +1,149 @@
1/*
2 * Copyright (c) 2005 Cisco Systems. All rights reserved.
3 * Roland Dreier <rolandd@cisco.com>
4 *
5 * This program is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License as published by the
7 * Free Software Foundation; either version 2 of the License, or (at your
8 * option) any later version.
9 */
10
11#ifndef __PPC_SYSLIB_PPC440SPE_PCIE_H
12#define __PPC_SYSLIB_PPC440SPE_PCIE_H
13
14#define DCRN_SDR0_CFGADDR 0x00e
15#define DCRN_SDR0_CFGDATA 0x00f
16
17#define DCRN_PCIE0_BASE 0x100
18#define DCRN_PCIE1_BASE 0x120
19#define DCRN_PCIE2_BASE 0x140
20#define PCIE0 DCRN_PCIE0_BASE
21#define PCIE1 DCRN_PCIE1_BASE
22#define PCIE2 DCRN_PCIE2_BASE
23
24#define DCRN_PEGPL_CFGBAH(base) (base + 0x00)
25#define DCRN_PEGPL_CFGBAL(base) (base + 0x01)
26#define DCRN_PEGPL_CFGMSK(base) (base + 0x02)
27#define DCRN_PEGPL_MSGBAH(base) (base + 0x03)
28#define DCRN_PEGPL_MSGBAL(base) (base + 0x04)
29#define DCRN_PEGPL_MSGMSK(base) (base + 0x05)
30#define DCRN_PEGPL_OMR1BAH(base) (base + 0x06)
31#define DCRN_PEGPL_OMR1BAL(base) (base + 0x07)
32#define DCRN_PEGPL_OMR1MSKH(base) (base + 0x08)
33#define DCRN_PEGPL_OMR1MSKL(base) (base + 0x09)
34#define DCRN_PEGPL_REGBAH(base) (base + 0x12)
35#define DCRN_PEGPL_REGBAL(base) (base + 0x13)
36#define DCRN_PEGPL_REGMSK(base) (base + 0x14)
37#define DCRN_PEGPL_SPECIAL(base) (base + 0x15)
38
39/*
40 * System DCRs (SDRs)
41 */
42#define PESDR0_PLLLCT1 0x03a0
43#define PESDR0_PLLLCT2 0x03a1
44#define PESDR0_PLLLCT3 0x03a2
45
46#define PESDR0_UTLSET1 0x0300
47#define PESDR0_UTLSET2 0x0301
48#define PESDR0_DLPSET 0x0302
49#define PESDR0_LOOP 0x0303
50#define PESDR0_RCSSET 0x0304
51#define PESDR0_RCSSTS 0x0305
52#define PESDR0_HSSL0SET1 0x0306
53#define PESDR0_HSSL0SET2 0x0307
54#define PESDR0_HSSL0STS 0x0308
55#define PESDR0_HSSL1SET1 0x0309
56#define PESDR0_HSSL1SET2 0x030a
57#define PESDR0_HSSL1STS 0x030b
58#define PESDR0_HSSL2SET1 0x030c
59#define PESDR0_HSSL2SET2 0x030d
60#define PESDR0_HSSL2STS 0x030e
61#define PESDR0_HSSL3SET1 0x030f
62#define PESDR0_HSSL3SET2 0x0310
63#define PESDR0_HSSL3STS 0x0311
64#define PESDR0_HSSL4SET1 0x0312
65#define PESDR0_HSSL4SET2 0x0313
66#define PESDR0_HSSL4STS 0x0314
67#define PESDR0_HSSL5SET1 0x0315
68#define PESDR0_HSSL5SET2 0x0316
69#define PESDR0_HSSL5STS 0x0317
70#define PESDR0_HSSL6SET1 0x0318
71#define PESDR0_HSSL6SET2 0x0319
72#define PESDR0_HSSL6STS 0x031a
73#define PESDR0_HSSL7SET1 0x031b
74#define PESDR0_HSSL7SET2 0x031c
75#define PESDR0_HSSL7STS 0x031d
76#define PESDR0_HSSCTLSET 0x031e
77#define PESDR0_LANE_ABCD 0x031f
78#define PESDR0_LANE_EFGH 0x0320
79
80#define PESDR1_UTLSET1 0x0340
81#define PESDR1_UTLSET2 0x0341
82#define PESDR1_DLPSET 0x0342
83#define PESDR1_LOOP 0x0343
84#define PESDR1_RCSSET 0x0344
85#define PESDR1_RCSSTS 0x0345
86#define PESDR1_HSSL0SET1 0x0346
87#define PESDR1_HSSL0SET2 0x0347
88#define PESDR1_HSSL0STS 0x0348
89#define PESDR1_HSSL1SET1 0x0349
90#define PESDR1_HSSL1SET2 0x034a
91#define PESDR1_HSSL1STS 0x034b
92#define PESDR1_HSSL2SET1 0x034c
93#define PESDR1_HSSL2SET2 0x034d
94#define PESDR1_HSSL2STS 0x034e
95#define PESDR1_HSSL3SET1 0x034f
96#define PESDR1_HSSL3SET2 0x0350
97#define PESDR1_HSSL3STS 0x0351
98#define PESDR1_HSSCTLSET 0x0352
99#define PESDR1_LANE_ABCD 0x0353
100
101#define PESDR2_UTLSET1 0x0370
102#define PESDR2_UTLSET2 0x0371
103#define PESDR2_DLPSET 0x0372
104#define PESDR2_LOOP 0x0373
105#define PESDR2_RCSSET 0x0374
106#define PESDR2_RCSSTS 0x0375
107#define PESDR2_HSSL0SET1 0x0376
108#define PESDR2_HSSL0SET2 0x0377
109#define PESDR2_HSSL0STS 0x0378
110#define PESDR2_HSSL1SET1 0x0379
111#define PESDR2_HSSL1SET2 0x037a
112#define PESDR2_HSSL1STS 0x037b
113#define PESDR2_HSSL2SET1 0x037c
114#define PESDR2_HSSL2SET2 0x037d
115#define PESDR2_HSSL2STS 0x037e
116#define PESDR2_HSSL3SET1 0x037f
117#define PESDR2_HSSL3SET2 0x0380
118#define PESDR2_HSSL3STS 0x0381
119#define PESDR2_HSSCTLSET 0x0382
120#define PESDR2_LANE_ABCD 0x0383
121
122/*
123 * UTL register offsets
124 */
125#define PEUTL_PBBSZ 0x20
126#define PEUTL_OPDBSZ 0x68
127#define PEUTL_IPHBSZ 0x70
128#define PEUTL_IPDBSZ 0x78
129#define PEUTL_OUTTR 0x90
130#define PEUTL_INTR 0x98
131#define PEUTL_PCTL 0xa0
132#define PEUTL_RCIRQEN 0xb8
133
134/*
135 * Config space register offsets
136 */
137#define PECFG_BAR0LMPA 0x210
138#define PECFG_BAR0HMPA 0x214
139#define PECFG_PIMEN 0x33c
140#define PECFG_PIM0LAL 0x340
141#define PECFG_PIM0LAH 0x344
142#define PECFG_POM0LAL 0x380
143#define PECFG_POM0LAH 0x384
144
145int ppc440spe_init_pcie(void);
146int ppc440spe_init_pcie_rootport(int port);
147void ppc440spe_setup_pcie(struct pci_controller *hose, int port);
148
149#endif /* __PPC_SYSLIB_PPC440SPE_PCIE_H */
diff --git a/arch/ppc/syslib/ppc4xx_pic.c b/arch/ppc/syslib/ppc4xx_pic.c
index 0b435633a0d1..aa4165144ec2 100644
--- a/arch/ppc/syslib/ppc4xx_pic.c
+++ b/arch/ppc/syslib/ppc4xx_pic.c
@@ -38,6 +38,7 @@ extern unsigned char ppc4xx_uic_ext_irq_cfg[] __attribute__ ((weak));
38#define IRQ_MASK_UICx(irq) (1 << (31 - ((irq) & 0x1f))) 38#define IRQ_MASK_UICx(irq) (1 << (31 - ((irq) & 0x1f)))
39#define IRQ_MASK_UIC1(irq) IRQ_MASK_UICx(irq) 39#define IRQ_MASK_UIC1(irq) IRQ_MASK_UICx(irq)
40#define IRQ_MASK_UIC2(irq) IRQ_MASK_UICx(irq) 40#define IRQ_MASK_UIC2(irq) IRQ_MASK_UICx(irq)
41#define IRQ_MASK_UIC3(irq) IRQ_MASK_UICx(irq)
41 42
42#define UIC_HANDLERS(n) \ 43#define UIC_HANDLERS(n) \
43static void ppc4xx_uic##n##_enable(unsigned int irq) \ 44static void ppc4xx_uic##n##_enable(unsigned int irq) \
@@ -88,7 +89,38 @@ static void ppc4xx_uic##n##_end(unsigned int irq) \
88 .end = ppc4xx_uic##n##_end, \ 89 .end = ppc4xx_uic##n##_end, \
89} \ 90} \
90 91
91#if NR_UICS == 3 92#if NR_UICS == 4
93#define ACK_UIC0_PARENT
94#define ACK_UIC1_PARENT mtdcr(DCRN_UIC_SR(UIC0), UIC0_UIC1NC);
95#define ACK_UIC2_PARENT mtdcr(DCRN_UIC_SR(UIC0), UIC0_UIC2NC);
96#define ACK_UIC3_PARENT mtdcr(DCRN_UIC_SR(UIC0), UIC0_UIC3NC);
97UIC_HANDLERS(0);
98UIC_HANDLERS(1);
99UIC_HANDLERS(2);
100UIC_HANDLERS(3);
101
102static int ppc4xx_pic_get_irq(struct pt_regs *regs)
103{
104 u32 uic0 = mfdcr(DCRN_UIC_MSR(UIC0));
105 if (uic0 & UIC0_UIC1NC)
106 return 64 - ffs(mfdcr(DCRN_UIC_MSR(UIC1)));
107 else if (uic0 & UIC0_UIC2NC)
108 return 96 - ffs(mfdcr(DCRN_UIC_MSR(UIC2)));
109 else if (uic0 & UIC0_UIC3NC)
110 return 128 - ffs(mfdcr(DCRN_UIC_MSR(UIC3)));
111 else
112 return uic0 ? 32 - ffs(uic0) : -1;
113}
114
115static void __init ppc4xx_pic_impl_init(void)
116{
117 /* Enable cascade interrupts in UIC0 */
118 ppc_cached_irq_mask[0] |= UIC0_UIC1NC | UIC0_UIC2NC | UIC0_UIC3NC;
119 mtdcr(DCRN_UIC_SR(UIC0), UIC0_UIC1NC | UIC0_UIC2NC | UIC0_UIC3NC);
120 mtdcr(DCRN_UIC_ER(UIC0), ppc_cached_irq_mask[0]);
121}
122
123#elif NR_UICS == 3
92#define ACK_UIC0_PARENT mtdcr(DCRN_UIC_SR(UICB), UICB_UIC0NC); 124#define ACK_UIC0_PARENT mtdcr(DCRN_UIC_SR(UICB), UICB_UIC0NC);
93#define ACK_UIC1_PARENT mtdcr(DCRN_UIC_SR(UICB), UICB_UIC1NC); 125#define ACK_UIC1_PARENT mtdcr(DCRN_UIC_SR(UICB), UICB_UIC1NC);
94#define ACK_UIC2_PARENT mtdcr(DCRN_UIC_SR(UICB), UICB_UIC2NC); 126#define ACK_UIC2_PARENT mtdcr(DCRN_UIC_SR(UICB), UICB_UIC2NC);
@@ -170,6 +202,9 @@ static struct ppc4xx_uic_impl {
170 { .decl = DECLARE_UIC(1), .base = UIC1 }, 202 { .decl = DECLARE_UIC(1), .base = UIC1 },
171#if NR_UICS > 2 203#if NR_UICS > 2
172 { .decl = DECLARE_UIC(2), .base = UIC2 }, 204 { .decl = DECLARE_UIC(2), .base = UIC2 },
205#if NR_UICS > 3
206 { .decl = DECLARE_UIC(3), .base = UIC3 },
207#endif
173#endif 208#endif
174#endif 209#endif
175}; 210};
diff --git a/arch/ppc/syslib/ppc85xx_rio.c b/arch/ppc/syslib/ppc85xx_rio.c
new file mode 100644
index 000000000000..297f3b549177
--- /dev/null
+++ b/arch/ppc/syslib/ppc85xx_rio.c
@@ -0,0 +1,938 @@
1/*
2 * MPC85xx RapidIO support
3 *
4 * Copyright 2005 MontaVista Software, Inc.
5 * Matt Porter <mporter@kernel.crashing.org>
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#include <linux/config.h>
14#include <linux/init.h>
15#include <linux/module.h>
16#include <linux/types.h>
17#include <linux/dma-mapping.h>
18#include <linux/interrupt.h>
19#include <linux/rio.h>
20#include <linux/rio_drv.h>
21
22#include <asm/io.h>
23
24#define RIO_REGS_BASE (CCSRBAR + 0xc0000)
25#define RIO_ATMU_REGS_OFFSET 0x10c00
26#define RIO_MSG_REGS_OFFSET 0x11000
27#define RIO_MAINT_WIN_SIZE 0x400000
28#define RIO_DBELL_WIN_SIZE 0x1000
29
30#define RIO_MSG_OMR_MUI 0x00000002
31#define RIO_MSG_OSR_TE 0x00000080
32#define RIO_MSG_OSR_QOI 0x00000020
33#define RIO_MSG_OSR_QFI 0x00000010
34#define RIO_MSG_OSR_MUB 0x00000004
35#define RIO_MSG_OSR_EOMI 0x00000002
36#define RIO_MSG_OSR_QEI 0x00000001
37
38#define RIO_MSG_IMR_MI 0x00000002
39#define RIO_MSG_ISR_TE 0x00000080
40#define RIO_MSG_ISR_QFI 0x00000010
41#define RIO_MSG_ISR_DIQI 0x00000001
42
43#define RIO_MSG_DESC_SIZE 32
44#define RIO_MSG_BUFFER_SIZE 4096
45#define RIO_MIN_TX_RING_SIZE 2
46#define RIO_MAX_TX_RING_SIZE 2048
47#define RIO_MIN_RX_RING_SIZE 2
48#define RIO_MAX_RX_RING_SIZE 2048
49
50#define DOORBELL_DMR_DI 0x00000002
51#define DOORBELL_DSR_TE 0x00000080
52#define DOORBELL_DSR_QFI 0x00000010
53#define DOORBELL_DSR_DIQI 0x00000001
54#define DOORBELL_TID_OFFSET 0x03
55#define DOORBELL_SID_OFFSET 0x05
56#define DOORBELL_INFO_OFFSET 0x06
57
58#define DOORBELL_MESSAGE_SIZE 0x08
59#define DBELL_SID(x) (*(u8 *)(x + DOORBELL_SID_OFFSET))
60#define DBELL_TID(x) (*(u8 *)(x + DOORBELL_TID_OFFSET))
61#define DBELL_INF(x) (*(u16 *)(x + DOORBELL_INFO_OFFSET))
62
63#define is_power_of_2(x) (((x) & ((x) - 1)) == 0)
64
65struct rio_atmu_regs {
66 u32 rowtar;
67 u32 pad1;
68 u32 rowbar;
69 u32 pad2;
70 u32 rowar;
71 u32 pad3[3];
72};
73
74struct rio_msg_regs {
75 u32 omr;
76 u32 osr;
77 u32 pad1;
78 u32 odqdpar;
79 u32 pad2;
80 u32 osar;
81 u32 odpr;
82 u32 odatr;
83 u32 odcr;
84 u32 pad3;
85 u32 odqepar;
86 u32 pad4[13];
87 u32 imr;
88 u32 isr;
89 u32 pad5;
90 u32 ifqdpar;
91 u32 pad6;
92 u32 ifqepar;
93 u32 pad7[250];
94 u32 dmr;
95 u32 dsr;
96 u32 pad8;
97 u32 dqdpar;
98 u32 pad9;
99 u32 dqepar;
100 u32 pad10[26];
101 u32 pwmr;
102 u32 pwsr;
103 u32 pad11;
104 u32 pwqbar;
105};
106
107struct rio_tx_desc {
108 u32 res1;
109 u32 saddr;
110 u32 dport;
111 u32 dattr;
112 u32 res2;
113 u32 res3;
114 u32 dwcnt;
115 u32 res4;
116};
117
118static u32 regs_win;
119static struct rio_atmu_regs *atmu_regs;
120static struct rio_atmu_regs *maint_atmu_regs;
121static struct rio_atmu_regs *dbell_atmu_regs;
122static u32 dbell_win;
123static u32 maint_win;
124static struct rio_msg_regs *msg_regs;
125
126static struct rio_dbell_ring {
127 void *virt;
128 dma_addr_t phys;
129} dbell_ring;
130
131static struct rio_msg_tx_ring {
132 void *virt;
133 dma_addr_t phys;
134 void *virt_buffer[RIO_MAX_TX_RING_SIZE];
135 dma_addr_t phys_buffer[RIO_MAX_TX_RING_SIZE];
136 int tx_slot;
137 int size;
138 void *dev_id;
139} msg_tx_ring;
140
141static struct rio_msg_rx_ring {
142 void *virt;
143 dma_addr_t phys;
144 void *virt_buffer[RIO_MAX_RX_RING_SIZE];
145 int rx_slot;
146 int size;
147 void *dev_id;
148} msg_rx_ring;
149
150/**
151 * mpc85xx_rio_doorbell_send - Send a MPC85xx doorbell message
152 * @index: ID of RapidIO interface
153 * @destid: Destination ID of target device
154 * @data: 16-bit info field of RapidIO doorbell message
155 *
156 * Sends a MPC85xx doorbell message. Returns %0 on success or
157 * %-EINVAL on failure.
158 */
159static int mpc85xx_rio_doorbell_send(int index, u16 destid, u16 data)
160{
161 pr_debug("mpc85xx_doorbell_send: index %d destid %4.4x data %4.4x\n",
162 index, destid, data);
163 out_be32((void *)&dbell_atmu_regs->rowtar, destid << 22);
164 out_be16((void *)(dbell_win), data);
165
166 return 0;
167}
168
169/**
170 * mpc85xx_local_config_read - Generate a MPC85xx local config space read
171 * @index: ID of RapdiIO interface
172 * @offset: Offset into configuration space
173 * @len: Length (in bytes) of the maintenance transaction
174 * @data: Value to be read into
175 *
176 * Generates a MPC85xx local configuration space read. Returns %0 on
177 * success or %-EINVAL on failure.
178 */
179static int mpc85xx_local_config_read(int index, u32 offset, int len, u32 * data)
180{
181 pr_debug("mpc85xx_local_config_read: index %d offset %8.8x\n", index,
182 offset);
183 *data = in_be32((void *)(regs_win + offset));
184
185 return 0;
186}
187
188/**
189 * mpc85xx_local_config_write - Generate a MPC85xx local config space write
190 * @index: ID of RapdiIO interface
191 * @offset: Offset into configuration space
192 * @len: Length (in bytes) of the maintenance transaction
193 * @data: Value to be written
194 *
195 * Generates a MPC85xx local configuration space write. Returns %0 on
196 * success or %-EINVAL on failure.
197 */
198static int mpc85xx_local_config_write(int index, u32 offset, int len, u32 data)
199{
200 pr_debug
201 ("mpc85xx_local_config_write: index %d offset %8.8x data %8.8x\n",
202 index, offset, data);
203 out_be32((void *)(regs_win + offset), data);
204
205 return 0;
206}
207
208/**
209 * mpc85xx_rio_config_read - Generate a MPC85xx read maintenance transaction
210 * @index: ID of RapdiIO interface
211 * @destid: Destination ID of transaction
212 * @hopcount: Number of hops to target device
213 * @offset: Offset into configuration space
214 * @len: Length (in bytes) of the maintenance transaction
215 * @val: Location to be read into
216 *
217 * Generates a MPC85xx read maintenance transaction. Returns %0 on
218 * success or %-EINVAL on failure.
219 */
220static int
221mpc85xx_rio_config_read(int index, u16 destid, u8 hopcount, u32 offset, int len,
222 u32 * val)
223{
224 u8 *data;
225
226 pr_debug
227 ("mpc85xx_rio_config_read: index %d destid %d hopcount %d offset %8.8x len %d\n",
228 index, destid, hopcount, offset, len);
229 out_be32((void *)&maint_atmu_regs->rowtar,
230 (destid << 22) | (hopcount << 12) | ((offset & ~0x3) >> 9));
231
232 data = (u8 *) maint_win + offset;
233 switch (len) {
234 case 1:
235 *val = in_8((u8 *) data);
236 break;
237 case 2:
238 *val = in_be16((u16 *) data);
239 break;
240 default:
241 *val = in_be32((u32 *) data);
242 break;
243 }
244
245 return 0;
246}
247
248/**
249 * mpc85xx_rio_config_write - Generate a MPC85xx write maintenance transaction
250 * @index: ID of RapdiIO interface
251 * @destid: Destination ID of transaction
252 * @hopcount: Number of hops to target device
253 * @offset: Offset into configuration space
254 * @len: Length (in bytes) of the maintenance transaction
255 * @val: Value to be written
256 *
257 * Generates an MPC85xx write maintenance transaction. Returns %0 on
258 * success or %-EINVAL on failure.
259 */
260static int
261mpc85xx_rio_config_write(int index, u16 destid, u8 hopcount, u32 offset,
262 int len, u32 val)
263{
264 u8 *data;
265 pr_debug
266 ("mpc85xx_rio_config_write: index %d destid %d hopcount %d offset %8.8x len %d val %8.8x\n",
267 index, destid, hopcount, offset, len, val);
268 out_be32((void *)&maint_atmu_regs->rowtar,
269 (destid << 22) | (hopcount << 12) | ((offset & ~0x3) >> 9));
270
271 data = (u8 *) maint_win + offset;
272 switch (len) {
273 case 1:
274 out_8((u8 *) data, val);
275 break;
276 case 2:
277 out_be16((u16 *) data, val);
278 break;
279 default:
280 out_be32((u32 *) data, val);
281 break;
282 }
283
284 return 0;
285}
286
287/**
288 * rio_hw_add_outb_message - Add message to the MPC85xx outbound message queue
289 * @mport: Master port with outbound message queue
290 * @rdev: Target of outbound message
291 * @mbox: Outbound mailbox
292 * @buffer: Message to add to outbound queue
293 * @len: Length of message
294 *
295 * Adds the @buffer message to the MPC85xx outbound message queue. Returns
296 * %0 on success or %-EINVAL on failure.
297 */
298int
299rio_hw_add_outb_message(struct rio_mport *mport, struct rio_dev *rdev, int mbox,
300 void *buffer, size_t len)
301{
302 u32 omr;
303 struct rio_tx_desc *desc =
304 (struct rio_tx_desc *)msg_tx_ring.virt + msg_tx_ring.tx_slot;
305 int ret = 0;
306
307 pr_debug
308 ("RIO: rio_hw_add_outb_message(): destid %4.4x mbox %d buffer %8.8x len %8.8x\n",
309 rdev->destid, mbox, (int)buffer, len);
310
311 if ((len < 8) || (len > RIO_MAX_MSG_SIZE)) {
312 ret = -EINVAL;
313 goto out;
314 }
315
316 /* Copy and clear rest of buffer */
317 memcpy(msg_tx_ring.virt_buffer[msg_tx_ring.tx_slot], buffer, len);
318 if (len < (RIO_MAX_MSG_SIZE - 4))
319 memset((void *)((u32) msg_tx_ring.
320 virt_buffer[msg_tx_ring.tx_slot] + len), 0,
321 RIO_MAX_MSG_SIZE - len);
322
323 /* Set mbox field for message */
324 desc->dport = mbox & 0x3;
325
326 /* Enable EOMI interrupt, set priority, and set destid */
327 desc->dattr = 0x28000000 | (rdev->destid << 2);
328
329 /* Set transfer size aligned to next power of 2 (in double words) */
330 desc->dwcnt = is_power_of_2(len) ? len : 1 << get_bitmask_order(len);
331
332 /* Set snooping and source buffer address */
333 desc->saddr = 0x00000004 | msg_tx_ring.phys_buffer[msg_tx_ring.tx_slot];
334
335 /* Increment enqueue pointer */
336 omr = in_be32((void *)&msg_regs->omr);
337 out_be32((void *)&msg_regs->omr, omr | RIO_MSG_OMR_MUI);
338
339 /* Go to next descriptor */
340 if (++msg_tx_ring.tx_slot == msg_tx_ring.size)
341 msg_tx_ring.tx_slot = 0;
342
343 out:
344 return ret;
345}
346
347EXPORT_SYMBOL_GPL(rio_hw_add_outb_message);
348
349/**
350 * mpc85xx_rio_tx_handler - MPC85xx outbound message interrupt handler
351 * @irq: Linux interrupt number
352 * @dev_instance: Pointer to interrupt-specific data
353 * @regs: Register context
354 *
355 * Handles outbound message interrupts. Executes a register outbound
356 * mailbox event handler and acks the interrupt occurence.
357 */
358static irqreturn_t
359mpc85xx_rio_tx_handler(int irq, void *dev_instance, struct pt_regs *regs)
360{
361 int osr;
362 struct rio_mport *port = (struct rio_mport *)dev_instance;
363
364 osr = in_be32((void *)&msg_regs->osr);
365
366 if (osr & RIO_MSG_OSR_TE) {
367 pr_info("RIO: outbound message transmission error\n");
368 out_be32((void *)&msg_regs->osr, RIO_MSG_OSR_TE);
369 goto out;
370 }
371
372 if (osr & RIO_MSG_OSR_QOI) {
373 pr_info("RIO: outbound message queue overflow\n");
374 out_be32((void *)&msg_regs->osr, RIO_MSG_OSR_QOI);
375 goto out;
376 }
377
378 if (osr & RIO_MSG_OSR_EOMI) {
379 u32 dqp = in_be32((void *)&msg_regs->odqdpar);
380 int slot = (dqp - msg_tx_ring.phys) >> 5;
381 port->outb_msg[0].mcback(port, msg_tx_ring.dev_id, -1, slot);
382
383 /* Ack the end-of-message interrupt */
384 out_be32((void *)&msg_regs->osr, RIO_MSG_OSR_EOMI);
385 }
386
387 out:
388 return IRQ_HANDLED;
389}
390
391/**
392 * rio_open_outb_mbox - Initialize MPC85xx outbound mailbox
393 * @mport: Master port implementing the outbound message unit
394 * @dev_id: Device specific pointer to pass on event
395 * @mbox: Mailbox to open
396 * @entries: Number of entries in the outbound mailbox ring
397 *
398 * Initializes buffer ring, request the outbound message interrupt,
399 * and enables the outbound message unit. Returns %0 on success and
400 * %-EINVAL or %-ENOMEM on failure.
401 */
402int rio_open_outb_mbox(struct rio_mport *mport, void *dev_id, int mbox, int entries)
403{
404 int i, j, rc = 0;
405
406 if ((entries < RIO_MIN_TX_RING_SIZE) ||
407 (entries > RIO_MAX_TX_RING_SIZE) || (!is_power_of_2(entries))) {
408 rc = -EINVAL;
409 goto out;
410 }
411
412 /* Initialize shadow copy ring */
413 msg_tx_ring.dev_id = dev_id;
414 msg_tx_ring.size = entries;
415
416 for (i = 0; i < msg_tx_ring.size; i++) {
417 if (!
418 (msg_tx_ring.virt_buffer[i] =
419 dma_alloc_coherent(NULL, RIO_MSG_BUFFER_SIZE,
420 &msg_tx_ring.phys_buffer[i],
421 GFP_KERNEL))) {
422 rc = -ENOMEM;
423 for (j = 0; j < msg_tx_ring.size; j++)
424 if (msg_tx_ring.virt_buffer[j])
425 dma_free_coherent(NULL,
426 RIO_MSG_BUFFER_SIZE,
427 msg_tx_ring.
428 virt_buffer[j],
429 msg_tx_ring.
430 phys_buffer[j]);
431 goto out;
432 }
433 }
434
435 /* Initialize outbound message descriptor ring */
436 if (!(msg_tx_ring.virt = dma_alloc_coherent(NULL,
437 msg_tx_ring.size *
438 RIO_MSG_DESC_SIZE,
439 &msg_tx_ring.phys,
440 GFP_KERNEL))) {
441 rc = -ENOMEM;
442 goto out_dma;
443 }
444 memset(msg_tx_ring.virt, 0, msg_tx_ring.size * RIO_MSG_DESC_SIZE);
445 msg_tx_ring.tx_slot = 0;
446
447 /* Point dequeue/enqueue pointers at first entry in ring */
448 out_be32((void *)&msg_regs->odqdpar, msg_tx_ring.phys);
449 out_be32((void *)&msg_regs->odqepar, msg_tx_ring.phys);
450
451 /* Configure for snooping */
452 out_be32((void *)&msg_regs->osar, 0x00000004);
453
454 /* Clear interrupt status */
455 out_be32((void *)&msg_regs->osr, 0x000000b3);
456
457 /* Hook up outbound message handler */
458 if ((rc =
459 request_irq(MPC85xx_IRQ_RIO_TX, mpc85xx_rio_tx_handler, 0,
460 "msg_tx", (void *)mport)) < 0)
461 goto out_irq;
462
463 /*
464 * Configure outbound message unit
465 * Snooping
466 * Interrupts (all enabled, except QEIE)
467 * Chaining mode
468 * Disable
469 */
470 out_be32((void *)&msg_regs->omr, 0x00100220);
471
472 /* Set number of entries */
473 out_be32((void *)&msg_regs->omr,
474 in_be32((void *)&msg_regs->omr) |
475 ((get_bitmask_order(entries) - 2) << 12));
476
477 /* Now enable the unit */
478 out_be32((void *)&msg_regs->omr, in_be32((void *)&msg_regs->omr) | 0x1);
479
480 out:
481 return rc;
482
483 out_irq:
484 dma_free_coherent(NULL, msg_tx_ring.size * RIO_MSG_DESC_SIZE,
485 msg_tx_ring.virt, msg_tx_ring.phys);
486
487 out_dma:
488 for (i = 0; i < msg_tx_ring.size; i++)
489 dma_free_coherent(NULL, RIO_MSG_BUFFER_SIZE,
490 msg_tx_ring.virt_buffer[i],
491 msg_tx_ring.phys_buffer[i]);
492
493 return rc;
494}
495
496/**
497 * rio_close_outb_mbox - Shut down MPC85xx outbound mailbox
498 * @mport: Master port implementing the outbound message unit
499 * @mbox: Mailbox to close
500 *
501 * Disables the outbound message unit, free all buffers, and
502 * frees the outbound message interrupt.
503 */
504void rio_close_outb_mbox(struct rio_mport *mport, int mbox)
505{
506 /* Disable inbound message unit */
507 out_be32((void *)&msg_regs->omr, 0);
508
509 /* Free ring */
510 dma_free_coherent(NULL, msg_tx_ring.size * RIO_MSG_DESC_SIZE,
511 msg_tx_ring.virt, msg_tx_ring.phys);
512
513 /* Free interrupt */
514 free_irq(MPC85xx_IRQ_RIO_TX, (void *)mport);
515}
516
517/**
518 * mpc85xx_rio_rx_handler - MPC85xx inbound message interrupt handler
519 * @irq: Linux interrupt number
520 * @dev_instance: Pointer to interrupt-specific data
521 * @regs: Register context
522 *
523 * Handles inbound message interrupts. Executes a registered inbound
524 * mailbox event handler and acks the interrupt occurence.
525 */
526static irqreturn_t
527mpc85xx_rio_rx_handler(int irq, void *dev_instance, struct pt_regs *regs)
528{
529 int isr;
530 struct rio_mport *port = (struct rio_mport *)dev_instance;
531
532 isr = in_be32((void *)&msg_regs->isr);
533
534 if (isr & RIO_MSG_ISR_TE) {
535 pr_info("RIO: inbound message reception error\n");
536 out_be32((void *)&msg_regs->isr, RIO_MSG_ISR_TE);
537 goto out;
538 }
539
540 /* XXX Need to check/dispatch until queue empty */
541 if (isr & RIO_MSG_ISR_DIQI) {
542 /*
543 * We implement *only* mailbox 0, but can receive messages
544 * for any mailbox/letter to that mailbox destination. So,
545 * make the callback with an unknown/invalid mailbox number
546 * argument.
547 */
548 port->inb_msg[0].mcback(port, msg_rx_ring.dev_id, -1, -1);
549
550 /* Ack the queueing interrupt */
551 out_be32((void *)&msg_regs->isr, RIO_MSG_ISR_DIQI);
552 }
553
554 out:
555 return IRQ_HANDLED;
556}
557
558/**
559 * rio_open_inb_mbox - Initialize MPC85xx inbound mailbox
560 * @mport: Master port implementing the inbound message unit
561 * @dev_id: Device specific pointer to pass on event
562 * @mbox: Mailbox to open
563 * @entries: Number of entries in the inbound mailbox ring
564 *
565 * Initializes buffer ring, request the inbound message interrupt,
566 * and enables the inbound message unit. Returns %0 on success
567 * and %-EINVAL or %-ENOMEM on failure.
568 */
569int rio_open_inb_mbox(struct rio_mport *mport, void *dev_id, int mbox, int entries)
570{
571 int i, rc = 0;
572
573 if ((entries < RIO_MIN_RX_RING_SIZE) ||
574 (entries > RIO_MAX_RX_RING_SIZE) || (!is_power_of_2(entries))) {
575 rc = -EINVAL;
576 goto out;
577 }
578
579 /* Initialize client buffer ring */
580 msg_rx_ring.dev_id = dev_id;
581 msg_rx_ring.size = entries;
582 msg_rx_ring.rx_slot = 0;
583 for (i = 0; i < msg_rx_ring.size; i++)
584 msg_rx_ring.virt_buffer[i] = NULL;
585
586 /* Initialize inbound message ring */
587 if (!(msg_rx_ring.virt = dma_alloc_coherent(NULL,
588 msg_rx_ring.size *
589 RIO_MAX_MSG_SIZE,
590 &msg_rx_ring.phys,
591 GFP_KERNEL))) {
592 rc = -ENOMEM;
593 goto out;
594 }
595
596 /* Point dequeue/enqueue pointers at first entry in ring */
597 out_be32((void *)&msg_regs->ifqdpar, (u32) msg_rx_ring.phys);
598 out_be32((void *)&msg_regs->ifqepar, (u32) msg_rx_ring.phys);
599
600 /* Clear interrupt status */
601 out_be32((void *)&msg_regs->isr, 0x00000091);
602
603 /* Hook up inbound message handler */
604 if ((rc =
605 request_irq(MPC85xx_IRQ_RIO_RX, mpc85xx_rio_rx_handler, 0,
606 "msg_rx", (void *)mport)) < 0) {
607 dma_free_coherent(NULL, RIO_MSG_BUFFER_SIZE,
608 msg_tx_ring.virt_buffer[i],
609 msg_tx_ring.phys_buffer[i]);
610 goto out;
611 }
612
613 /*
614 * Configure inbound message unit:
615 * Snooping
616 * 4KB max message size
617 * Unmask all interrupt sources
618 * Disable
619 */
620 out_be32((void *)&msg_regs->imr, 0x001b0060);
621
622 /* Set number of queue entries */
623 out_be32((void *)&msg_regs->imr,
624 in_be32((void *)&msg_regs->imr) |
625 ((get_bitmask_order(entries) - 2) << 12));
626
627 /* Now enable the unit */
628 out_be32((void *)&msg_regs->imr, in_be32((void *)&msg_regs->imr) | 0x1);
629
630 out:
631 return rc;
632}
633
634/**
635 * rio_close_inb_mbox - Shut down MPC85xx inbound mailbox
636 * @mport: Master port implementing the inbound message unit
637 * @mbox: Mailbox to close
638 *
639 * Disables the inbound message unit, free all buffers, and
640 * frees the inbound message interrupt.
641 */
642void rio_close_inb_mbox(struct rio_mport *mport, int mbox)
643{
644 /* Disable inbound message unit */
645 out_be32((void *)&msg_regs->imr, 0);
646
647 /* Free ring */
648 dma_free_coherent(NULL, msg_rx_ring.size * RIO_MAX_MSG_SIZE,
649 msg_rx_ring.virt, msg_rx_ring.phys);
650
651 /* Free interrupt */
652 free_irq(MPC85xx_IRQ_RIO_RX, (void *)mport);
653}
654
655/**
656 * rio_hw_add_inb_buffer - Add buffer to the MPC85xx inbound message queue
657 * @mport: Master port implementing the inbound message unit
658 * @mbox: Inbound mailbox number
659 * @buf: Buffer to add to inbound queue
660 *
661 * Adds the @buf buffer to the MPC85xx inbound message queue. Returns
662 * %0 on success or %-EINVAL on failure.
663 */
664int rio_hw_add_inb_buffer(struct rio_mport *mport, int mbox, void *buf)
665{
666 int rc = 0;
667
668 pr_debug("RIO: rio_hw_add_inb_buffer(), msg_rx_ring.rx_slot %d\n",
669 msg_rx_ring.rx_slot);
670
671 if (msg_rx_ring.virt_buffer[msg_rx_ring.rx_slot]) {
672 printk(KERN_ERR
673 "RIO: error adding inbound buffer %d, buffer exists\n",
674 msg_rx_ring.rx_slot);
675 rc = -EINVAL;
676 goto out;
677 }
678
679 msg_rx_ring.virt_buffer[msg_rx_ring.rx_slot] = buf;
680 if (++msg_rx_ring.rx_slot == msg_rx_ring.size)
681 msg_rx_ring.rx_slot = 0;
682
683 out:
684 return rc;
685}
686
687EXPORT_SYMBOL_GPL(rio_hw_add_inb_buffer);
688
689/**
690 * rio_hw_get_inb_message - Fetch inbound message from the MPC85xx message unit
691 * @mport: Master port implementing the inbound message unit
692 * @mbox: Inbound mailbox number
693 *
694 * Gets the next available inbound message from the inbound message queue.
695 * A pointer to the message is returned on success or NULL on failure.
696 */
697void *rio_hw_get_inb_message(struct rio_mport *mport, int mbox)
698{
699 u32 imr;
700 u32 phys_buf, virt_buf;
701 void *buf = NULL;
702 int buf_idx;
703
704 phys_buf = in_be32((void *)&msg_regs->ifqdpar);
705
706 /* If no more messages, then bail out */
707 if (phys_buf == in_be32((void *)&msg_regs->ifqepar))
708 goto out2;
709
710 virt_buf = (u32) msg_rx_ring.virt + (phys_buf - msg_rx_ring.phys);
711 buf_idx = (phys_buf - msg_rx_ring.phys) / RIO_MAX_MSG_SIZE;
712 buf = msg_rx_ring.virt_buffer[buf_idx];
713
714 if (!buf) {
715 printk(KERN_ERR
716 "RIO: inbound message copy failed, no buffers\n");
717 goto out1;
718 }
719
720 /* Copy max message size, caller is expected to allocate that big */
721 memcpy(buf, (void *)virt_buf, RIO_MAX_MSG_SIZE);
722
723 /* Clear the available buffer */
724 msg_rx_ring.virt_buffer[buf_idx] = NULL;
725
726 out1:
727 imr = in_be32((void *)&msg_regs->imr);
728 out_be32((void *)&msg_regs->imr, imr | RIO_MSG_IMR_MI);
729
730 out2:
731 return buf;
732}
733
734EXPORT_SYMBOL_GPL(rio_hw_get_inb_message);
735
736/**
737 * mpc85xx_rio_dbell_handler - MPC85xx doorbell interrupt handler
738 * @irq: Linux interrupt number
739 * @dev_instance: Pointer to interrupt-specific data
740 * @regs: Register context
741 *
742 * Handles doorbell interrupts. Parses a list of registered
743 * doorbell event handlers and executes a matching event handler.
744 */
745static irqreturn_t
746mpc85xx_rio_dbell_handler(int irq, void *dev_instance, struct pt_regs *regs)
747{
748 int dsr;
749 struct rio_mport *port = (struct rio_mport *)dev_instance;
750
751 dsr = in_be32((void *)&msg_regs->dsr);
752
753 if (dsr & DOORBELL_DSR_TE) {
754 pr_info("RIO: doorbell reception error\n");
755 out_be32((void *)&msg_regs->dsr, DOORBELL_DSR_TE);
756 goto out;
757 }
758
759 if (dsr & DOORBELL_DSR_QFI) {
760 pr_info("RIO: doorbell queue full\n");
761 out_be32((void *)&msg_regs->dsr, DOORBELL_DSR_QFI);
762 goto out;
763 }
764
765 /* XXX Need to check/dispatch until queue empty */
766 if (dsr & DOORBELL_DSR_DIQI) {
767 u32 dmsg =
768 (u32) dbell_ring.virt +
769 (in_be32((void *)&msg_regs->dqdpar) & 0xfff);
770 u32 dmr;
771 struct rio_dbell *dbell;
772 int found = 0;
773
774 pr_debug
775 ("RIO: processing doorbell, sid %2.2x tid %2.2x info %4.4x\n",
776 DBELL_SID(dmsg), DBELL_TID(dmsg), DBELL_INF(dmsg));
777
778 list_for_each_entry(dbell, &port->dbells, node) {
779 if ((dbell->res->start <= DBELL_INF(dmsg)) &&
780 (dbell->res->end >= DBELL_INF(dmsg))) {
781 found = 1;
782 break;
783 }
784 }
785 if (found) {
786 dbell->dinb(port, dbell->dev_id, DBELL_SID(dmsg), DBELL_TID(dmsg),
787 DBELL_INF(dmsg));
788 } else {
789 pr_debug
790 ("RIO: spurious doorbell, sid %2.2x tid %2.2x info %4.4x\n",
791 DBELL_SID(dmsg), DBELL_TID(dmsg), DBELL_INF(dmsg));
792 }
793 dmr = in_be32((void *)&msg_regs->dmr);
794 out_be32((void *)&msg_regs->dmr, dmr | DOORBELL_DMR_DI);
795 out_be32((void *)&msg_regs->dsr, DOORBELL_DSR_DIQI);
796 }
797
798 out:
799 return IRQ_HANDLED;
800}
801
802/**
803 * mpc85xx_rio_doorbell_init - MPC85xx doorbell interface init
804 * @mport: Master port implementing the inbound doorbell unit
805 *
806 * Initializes doorbell unit hardware and inbound DMA buffer
807 * ring. Called from mpc85xx_rio_setup(). Returns %0 on success
808 * or %-ENOMEM on failure.
809 */
810static int mpc85xx_rio_doorbell_init(struct rio_mport *mport)
811{
812 int rc = 0;
813
814 /* Map outbound doorbell window immediately after maintenance window */
815 if (!(dbell_win =
816 (u32) ioremap(mport->iores.start + RIO_MAINT_WIN_SIZE,
817 RIO_DBELL_WIN_SIZE))) {
818 printk(KERN_ERR
819 "RIO: unable to map outbound doorbell window\n");
820 rc = -ENOMEM;
821 goto out;
822 }
823
824 /* Initialize inbound doorbells */
825 if (!(dbell_ring.virt = dma_alloc_coherent(NULL,
826 512 * DOORBELL_MESSAGE_SIZE,
827 &dbell_ring.phys,
828 GFP_KERNEL))) {
829 printk(KERN_ERR "RIO: unable allocate inbound doorbell ring\n");
830 rc = -ENOMEM;
831 iounmap((void *)dbell_win);
832 goto out;
833 }
834
835 /* Point dequeue/enqueue pointers at first entry in ring */
836 out_be32((void *)&msg_regs->dqdpar, (u32) dbell_ring.phys);
837 out_be32((void *)&msg_regs->dqepar, (u32) dbell_ring.phys);
838
839 /* Clear interrupt status */
840 out_be32((void *)&msg_regs->dsr, 0x00000091);
841
842 /* Hook up doorbell handler */
843 if ((rc =
844 request_irq(MPC85xx_IRQ_RIO_BELL, mpc85xx_rio_dbell_handler, 0,
845 "dbell_rx", (void *)mport) < 0)) {
846 iounmap((void *)dbell_win);
847 dma_free_coherent(NULL, 512 * DOORBELL_MESSAGE_SIZE,
848 dbell_ring.virt, dbell_ring.phys);
849 printk(KERN_ERR
850 "MPC85xx RIO: unable to request inbound doorbell irq");
851 goto out;
852 }
853
854 /* Configure doorbells for snooping, 512 entries, and enable */
855 out_be32((void *)&msg_regs->dmr, 0x00108161);
856
857 out:
858 return rc;
859}
860
861static char *cmdline = NULL;
862
863static int mpc85xx_rio_get_hdid(int index)
864{
865 /* XXX Need to parse multiple entries in some format */
866 if (!cmdline)
867 return -1;
868
869 return simple_strtol(cmdline, NULL, 0);
870}
871
872static int mpc85xx_rio_get_cmdline(char *s)
873{
874 if (!s)
875 return 0;
876
877 cmdline = s;
878 return 1;
879}
880
881__setup("riohdid=", mpc85xx_rio_get_cmdline);
882
883/**
884 * mpc85xx_rio_setup - Setup MPC85xx RapidIO interface
885 * @law_start: Starting physical address of RapidIO LAW
886 * @law_size: Size of RapidIO LAW
887 *
888 * Initializes MPC85xx RapidIO hardware interface, configures
889 * master port with system-specific info, and registers the
890 * master port with the RapidIO subsystem.
891 */
892void mpc85xx_rio_setup(int law_start, int law_size)
893{
894 struct rio_ops *ops;
895 struct rio_mport *port;
896
897 ops = kmalloc(sizeof(struct rio_ops), GFP_KERNEL);
898 ops->lcread = mpc85xx_local_config_read;
899 ops->lcwrite = mpc85xx_local_config_write;
900 ops->cread = mpc85xx_rio_config_read;
901 ops->cwrite = mpc85xx_rio_config_write;
902 ops->dsend = mpc85xx_rio_doorbell_send;
903
904 port = kmalloc(sizeof(struct rio_mport), GFP_KERNEL);
905 port->id = 0;
906 port->index = 0;
907 INIT_LIST_HEAD(&port->dbells);
908 port->iores.start = law_start;
909 port->iores.end = law_start + law_size;
910 port->iores.flags = IORESOURCE_MEM;
911
912 rio_init_dbell_res(&port->riores[RIO_DOORBELL_RESOURCE], 0, 0xffff);
913 rio_init_mbox_res(&port->riores[RIO_INB_MBOX_RESOURCE], 0, 0);
914 rio_init_mbox_res(&port->riores[RIO_OUTB_MBOX_RESOURCE], 0, 0);
915 strcpy(port->name, "RIO0 mport");
916
917 port->ops = ops;
918 port->host_deviceid = mpc85xx_rio_get_hdid(port->id);
919
920 rio_register_mport(port);
921
922 regs_win = (u32) ioremap(RIO_REGS_BASE, 0x20000);
923 atmu_regs = (struct rio_atmu_regs *)(regs_win + RIO_ATMU_REGS_OFFSET);
924 maint_atmu_regs = atmu_regs + 1;
925 dbell_atmu_regs = atmu_regs + 2;
926 msg_regs = (struct rio_msg_regs *)(regs_win + RIO_MSG_REGS_OFFSET);
927
928 /* Configure maintenance transaction window */
929 out_be32((void *)&maint_atmu_regs->rowbar, 0x000c0000);
930 out_be32((void *)&maint_atmu_regs->rowar, 0x80077015);
931
932 maint_win = (u32) ioremap(law_start, RIO_MAINT_WIN_SIZE);
933
934 /* Configure outbound doorbell window */
935 out_be32((void *)&dbell_atmu_regs->rowbar, 0x000c0400);
936 out_be32((void *)&dbell_atmu_regs->rowar, 0x8004200b);
937 mpc85xx_rio_doorbell_init(port);
938}
diff --git a/arch/ppc/syslib/ppc85xx_rio.h b/arch/ppc/syslib/ppc85xx_rio.h
new file mode 100644
index 000000000000..c0827a2c3eec
--- /dev/null
+++ b/arch/ppc/syslib/ppc85xx_rio.h
@@ -0,0 +1,21 @@
1/*
2 * MPC85xx RapidIO definitions
3 *
4 * Copyright 2005 MontaVista Software, Inc.
5 * Matt Porter <mporter@kernel.crashing.org>
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#ifndef __PPC_SYSLIB_PPC85XX_RIO_H
14#define __PPC_SYSLIB_PPC85XX_RIO_H
15
16#include <linux/config.h>
17#include <linux/init.h>
18
19extern void mpc85xx_rio_setup(int law_start, int law_size);
20
21#endif /* __PPC_SYSLIB_PPC85XX_RIO_H */
diff --git a/arch/ppc/syslib/ppc_sys.c b/arch/ppc/syslib/ppc_sys.c
index 62ee86e80711..603f01190816 100644
--- a/arch/ppc/syslib/ppc_sys.c
+++ b/arch/ppc/syslib/ppc_sys.c
@@ -14,6 +14,7 @@
14 * option) any later version. 14 * option) any later version.
15 */ 15 */
16 16
17#include <linux/string.h>
17#include <asm/ppc_sys.h> 18#include <asm/ppc_sys.h>
18 19
19int (*ppc_sys_device_fixup) (struct platform_device * pdev); 20int (*ppc_sys_device_fixup) (struct platform_device * pdev);
diff --git a/arch/ppc/syslib/prom.c b/arch/ppc/syslib/prom.c
index 278da6ee62ea..af4deace49e0 100644
--- a/arch/ppc/syslib/prom.c
+++ b/arch/ppc/syslib/prom.c
@@ -13,7 +13,6 @@
13#include <linux/kernel.h> 13#include <linux/kernel.h>
14#include <linux/string.h> 14#include <linux/string.h>
15#include <linux/init.h> 15#include <linux/init.h>
16#include <linux/version.h>
17#include <linux/threads.h> 16#include <linux/threads.h>
18#include <linux/spinlock.h> 17#include <linux/spinlock.h>
19#include <linux/ioport.h> 18#include <linux/ioport.h>
@@ -1165,7 +1164,7 @@ get_property(struct device_node *np, const char *name, int *lenp)
1165/* 1164/*
1166 * Add a property to a node 1165 * Add a property to a node
1167 */ 1166 */
1168void 1167int
1169prom_add_property(struct device_node* np, struct property* prop) 1168prom_add_property(struct device_node* np, struct property* prop)
1170{ 1169{
1171 struct property **next = &np->properties; 1170 struct property **next = &np->properties;
@@ -1174,6 +1173,8 @@ prom_add_property(struct device_node* np, struct property* prop)
1174 while (*next) 1173 while (*next)
1175 next = &(*next)->next; 1174 next = &(*next)->next;
1176 *next = prop; 1175 *next = prop;
1176
1177 return 0;
1177} 1178}
1178 1179
1179/* I quickly hacked that one, check against spec ! */ 1180/* I quickly hacked that one, check against spec ! */
@@ -1335,10 +1336,8 @@ release_OF_resource(struct device_node* node, int index)
1335 if (!res) 1336 if (!res)
1336 return -ENODEV; 1337 return -ENODEV;
1337 1338
1338 if (res->name) { 1339 kfree(res->name);
1339 kfree(res->name); 1340 res->name = NULL;
1340 res->name = NULL;
1341 }
1342 release_resource(res); 1341 release_resource(res);
1343 kfree(res); 1342 kfree(res);
1344 1343
diff --git a/arch/ppc/syslib/prom_init.c b/arch/ppc/syslib/prom_init.c
index 7f15136830f4..df14422ae1c6 100644
--- a/arch/ppc/syslib/prom_init.c
+++ b/arch/ppc/syslib/prom_init.c
@@ -9,7 +9,6 @@
9#include <linux/kernel.h> 9#include <linux/kernel.h>
10#include <linux/string.h> 10#include <linux/string.h>
11#include <linux/init.h> 11#include <linux/init.h>
12#include <linux/version.h>
13#include <linux/threads.h> 12#include <linux/threads.h>
14#include <linux/spinlock.h> 13#include <linux/spinlock.h>
15#include <linux/ioport.h> 14#include <linux/ioport.h>
diff --git a/arch/ppc/xmon/xmon.c b/arch/ppc/xmon/xmon.c
index 66bfaa3211a2..2b483b4f1602 100644
--- a/arch/ppc/xmon/xmon.c
+++ b/arch/ppc/xmon/xmon.c
@@ -220,8 +220,7 @@ static void get_tb(unsigned *p)
220 p[1] = lo; 220 p[1] = lo;
221} 221}
222 222
223void 223int xmon(struct pt_regs *excp)
224xmon(struct pt_regs *excp)
225{ 224{
226 struct pt_regs regs; 225 struct pt_regs regs;
227 int msr, cmd; 226 int msr, cmd;
@@ -290,6 +289,8 @@ xmon(struct pt_regs *excp)
290#endif /* CONFIG_SMP */ 289#endif /* CONFIG_SMP */
291 set_msr(msr); /* restore interrupt enable */ 290 set_msr(msr); /* restore interrupt enable */
292 get_tb(start_tb[smp_processor_id()]); 291 get_tb(start_tb[smp_processor_id()]);
292
293 return cmd != 'X';
293} 294}
294 295
295irqreturn_t 296irqreturn_t
diff --git a/arch/ppc64/Kconfig b/arch/ppc64/Kconfig
index 42677cc96508..29552348e581 100644
--- a/arch/ppc64/Kconfig
+++ b/arch/ppc64/Kconfig
@@ -47,11 +47,16 @@ config ARCH_MAY_HAVE_PC_FDC
47 bool 47 bool
48 default y 48 default y
49 49
50config PPC_STD_MMU
51 bool
52 default y
53
50# We optimistically allocate largepages from the VM, so make the limit 54# We optimistically allocate largepages from the VM, so make the limit
51# large enough (16MB). This badly named config option is actually 55# large enough (16MB). This badly named config option is actually
52# max order + 1 56# max order + 1
53config FORCE_MAX_ZONEORDER 57config FORCE_MAX_ZONEORDER
54 int 58 int
59 default "9" if PPC_64K_PAGES
55 default "13" 60 default "13"
56 61
57source "init/Kconfig" 62source "init/Kconfig"
@@ -89,12 +94,14 @@ config PPC_PMAC
89 bool " Apple G5 based machines" 94 bool " Apple G5 based machines"
90 default y 95 default y
91 select U3_DART 96 select U3_DART
97 select GENERIC_TBSYNC
92 98
93config PPC_MAPLE 99config PPC_MAPLE
94 depends on PPC_MULTIPLATFORM 100 depends on PPC_MULTIPLATFORM
95 bool " Maple 970FX Evaluation Board" 101 bool " Maple 970FX Evaluation Board"
96 select U3_DART 102 select U3_DART
97 select MPIC_BROKEN_U3 103 select MPIC_BROKEN_U3
104 select GENERIC_TBSYNC
98 default n 105 default n
99 help 106 help
100 This option enables support for the Maple 970FX Evaluation Board. 107 This option enables support for the Maple 970FX Evaluation Board.
@@ -167,6 +174,16 @@ config KEXEC
167 support. As of this writing the exact hardware interface is 174 support. As of this writing the exact hardware interface is
168 strongly in flux, so no good recommendation can be made. 175 strongly in flux, so no good recommendation can be made.
169 176
177source "drivers/cpufreq/Kconfig"
178
179config CPU_FREQ_PMAC64
180 bool "Support for some Apple G5s"
181 depends on CPU_FREQ && PMAC_SMU && PPC64
182 select CPU_FREQ_TABLE
183 help
184 This adds support for frequency switching on Apple iMac G5,
185 and some of the more recent desktop G5 machines as well.
186
170config IBMVIO 187config IBMVIO
171 depends on PPC_PSERIES || PPC_ISERIES 188 depends on PPC_PSERIES || PPC_ISERIES
172 bool 189 bool
@@ -182,6 +199,9 @@ config MPIC_BROKEN_U3
182 depends on PPC_MAPLE 199 depends on PPC_MAPLE
183 default y 200 default y
184 201
202config GENERIC_TBSYNC
203 def_bool n
204
185config PPC_PMAC64 205config PPC_PMAC64
186 bool 206 bool
187 depends on PPC_PMAC 207 depends on PPC_PMAC
@@ -289,6 +309,15 @@ config NODES_SPAN_OTHER_NODES
289 def_bool y 309 def_bool y
290 depends on NEED_MULTIPLE_NODES 310 depends on NEED_MULTIPLE_NODES
291 311
312config PPC_64K_PAGES
313 bool "64k page size"
314 help
315 This option changes the kernel logical page size to 64k. On machines
316 without processor support for 64k pages, the kernel will simulate
317 them by loading each individual 4k page on demand transparently,
318 while on hardware with such support, it will be used to map
319 normal application pages.
320
292config SCHED_SMT 321config SCHED_SMT
293 bool "SMT (Hyperthreading) scheduler support" 322 bool "SMT (Hyperthreading) scheduler support"
294 depends on SMP 323 depends on SMP
diff --git a/arch/ppc64/Kconfig.debug b/arch/ppc64/Kconfig.debug
index f16a5030527b..b258c9314a1b 100644
--- a/arch/ppc64/Kconfig.debug
+++ b/arch/ppc64/Kconfig.debug
@@ -55,10 +55,6 @@ config XMON_DEFAULT
55 xmon is normally disabled unless booted with 'xmon=on'. 55 xmon is normally disabled unless booted with 'xmon=on'.
56 Use 'xmon=off' to disable xmon init during runtime. 56 Use 'xmon=off' to disable xmon init during runtime.
57 57
58config PPCDBG
59 bool "Include PPCDBG realtime debugging"
60 depends on DEBUG_KERNEL
61
62config IRQSTACKS 58config IRQSTACKS
63 bool "Use separate kernel stacks when processing interrupts" 59 bool "Use separate kernel stacks when processing interrupts"
64 help 60 help
diff --git a/arch/ppc64/Makefile b/arch/ppc64/Makefile
index fdbd6f44adc0..a55a82d145d4 100644
--- a/arch/ppc64/Makefile
+++ b/arch/ppc64/Makefile
@@ -86,7 +86,6 @@ head-y := arch/ppc64/kernel/head.o
86head-y += arch/powerpc/kernel/fpu.o 86head-y += arch/powerpc/kernel/fpu.o
87head-y += arch/powerpc/kernel/entry_64.o 87head-y += arch/powerpc/kernel/entry_64.o
88 88
89libs-y += arch/ppc64/lib/
90core-y += arch/ppc64/kernel/ arch/powerpc/kernel/ 89core-y += arch/ppc64/kernel/ arch/powerpc/kernel/
91core-y += arch/powerpc/mm/ 90core-y += arch/powerpc/mm/
92core-y += arch/powerpc/sysdev/ 91core-y += arch/powerpc/sysdev/
diff --git a/arch/ppc64/boot/main.c b/arch/ppc64/boot/main.c
index c1dc876bccab..e0dde24a72ce 100644
--- a/arch/ppc64/boot/main.c
+++ b/arch/ppc64/boot/main.c
@@ -203,8 +203,15 @@ void start(unsigned long a1, unsigned long a2, void *promptr, void *sp)
203 if (elf64ph->p_type == PT_LOAD && elf64ph->p_offset != 0) 203 if (elf64ph->p_type == PT_LOAD && elf64ph->p_offset != 0)
204 break; 204 break;
205 } 205 }
206 vmlinux.size = (unsigned long)elf64ph->p_filesz; 206 vmlinux.size = (unsigned long)elf64ph->p_filesz +
207 vmlinux.memsize = (unsigned long)elf64ph->p_memsz; 207 (unsigned long)elf64ph->p_offset;
208 /* We need to claim the memsize plus the file offset since gzip
209 * will expand the header (file offset), then the kernel, then
210 * possible rubbish we don't care about. But the kernel bss must
211 * be claimed (it will be zero'd by the kernel itself)
212 */
213 vmlinux.memsize = (unsigned long)elf64ph->p_memsz +
214 (unsigned long)elf64ph->p_offset;
208 printf("Allocating 0x%lx bytes for kernel ...\n\r", vmlinux.memsize); 215 printf("Allocating 0x%lx bytes for kernel ...\n\r", vmlinux.memsize);
209 vmlinux.addr = try_claim(vmlinux.memsize); 216 vmlinux.addr = try_claim(vmlinux.memsize);
210 if (vmlinux.addr == 0) { 217 if (vmlinux.addr == 0) {
diff --git a/arch/ppc64/kernel/Makefile b/arch/ppc64/kernel/Makefile
index 327c08ce4291..c441aebe7648 100644
--- a/arch/ppc64/kernel/Makefile
+++ b/arch/ppc64/kernel/Makefile
@@ -12,8 +12,7 @@ obj-y := misc.o prom.o
12endif 12endif
13 13
14obj-y += irq.o idle.o dma.o \ 14obj-y += irq.o idle.o dma.o \
15 signal.o \ 15 align.o pacaData.o \
16 align.o bitops.o pacaData.o \
17 udbg.o ioctl32.o \ 16 udbg.o ioctl32.o \
18 rtc.o \ 17 rtc.o \
19 cpu_setup_power4.o \ 18 cpu_setup_power4.o \
@@ -29,22 +28,16 @@ ifneq ($(CONFIG_PPC_MERGE),y)
29obj-$(CONFIG_PPC_MULTIPLATFORM) += prom_init.o 28obj-$(CONFIG_PPC_MULTIPLATFORM) += prom_init.o
30endif 29endif
31 30
32obj-$(CONFIG_PPC_PSERIES) += rtasd.o udbg_16550.o 31obj-$(CONFIG_PPC_PSERIES) += udbg_16550.o
33
34obj-$(CONFIG_PPC_BPA) += bpa_setup.o bpa_iommu.o bpa_nvram.o \
35 bpa_iic.o spider-pic.o
36 32
37obj-$(CONFIG_KEXEC) += machine_kexec.o 33obj-$(CONFIG_KEXEC) += machine_kexec.o
38obj-$(CONFIG_EEH) += eeh.o 34obj-$(CONFIG_EEH) += eeh.o
39obj-$(CONFIG_PROC_FS) += proc_ppc64.o 35obj-$(CONFIG_PROC_FS) += proc_ppc64.o
40obj-$(CONFIG_RTAS_FLASH) += rtas_flash.o
41obj-$(CONFIG_SMP) += smp.o
42obj-$(CONFIG_MODULES) += module.o 36obj-$(CONFIG_MODULES) += module.o
43ifneq ($(CONFIG_PPC_MERGE),y) 37ifneq ($(CONFIG_PPC_MERGE),y)
44obj-$(CONFIG_MODULES) += ppc_ksyms.o 38obj-$(CONFIG_MODULES) += ppc_ksyms.o
45endif 39endif
46obj-$(CONFIG_PPC_RTAS) += rtas_pci.o 40obj-$(CONFIG_PPC_RTAS) += rtas_pci.o
47obj-$(CONFIG_RTAS_PROC) += rtas-proc.o
48obj-$(CONFIG_SCANLOG) += scanlog.o 41obj-$(CONFIG_SCANLOG) += scanlog.o
49obj-$(CONFIG_LPARCFG) += lparcfg.o 42obj-$(CONFIG_LPARCFG) += lparcfg.o
50obj-$(CONFIG_HVC_CONSOLE) += hvconsole.o 43obj-$(CONFIG_HVC_CONSOLE) += hvconsole.o
@@ -57,11 +50,6 @@ obj-$(CONFIG_PPC_PMAC) += udbg_scc.o
57 50
58obj-$(CONFIG_PPC_MAPLE) += udbg_16550.o 51obj-$(CONFIG_PPC_MAPLE) += udbg_16550.o
59 52
60ifdef CONFIG_SMP
61obj-$(CONFIG_PPC_PMAC) += smp-tbsync.o
62obj-$(CONFIG_PPC_MAPLE) += smp-tbsync.o
63endif
64
65obj-$(CONFIG_KPROBES) += kprobes.o 53obj-$(CONFIG_KPROBES) += kprobes.o
66 54
67CFLAGS_ioctl32.o += -Ifs/ 55CFLAGS_ioctl32.o += -Ifs/
diff --git a/arch/ppc64/kernel/asm-offsets.c b/arch/ppc64/kernel/asm-offsets.c
index 5e6046cb414e..bce9065da6cb 100644
--- a/arch/ppc64/kernel/asm-offsets.c
+++ b/arch/ppc64/kernel/asm-offsets.c
@@ -31,7 +31,7 @@
31 31
32#include <asm/paca.h> 32#include <asm/paca.h>
33#include <asm/lppaca.h> 33#include <asm/lppaca.h>
34#include <asm/iSeries/HvLpEvent.h> 34#include <asm/iseries/hv_lp_event.h>
35#include <asm/rtas.h> 35#include <asm/rtas.h>
36#include <asm/cputable.h> 36#include <asm/cputable.h>
37#include <asm/cache.h> 37#include <asm/cache.h>
@@ -93,6 +93,9 @@ int main(void)
93 DEFINE(PACASLBCACHE, offsetof(struct paca_struct, slb_cache)); 93 DEFINE(PACASLBCACHE, offsetof(struct paca_struct, slb_cache));
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_PPC_64K_PAGES
97 DEFINE(PACAPGDIR, offsetof(struct paca_struct, pgdir));
98#endif
96#ifdef CONFIG_HUGETLB_PAGE 99#ifdef CONFIG_HUGETLB_PAGE
97 DEFINE(PACALOWHTLBAREAS, offsetof(struct paca_struct, context.low_htlb_areas)); 100 DEFINE(PACALOWHTLBAREAS, offsetof(struct paca_struct, context.low_htlb_areas));
98 DEFINE(PACAHIGHHTLBAREAS, offsetof(struct paca_struct, context.high_htlb_areas)); 101 DEFINE(PACAHIGHHTLBAREAS, offsetof(struct paca_struct, context.high_htlb_areas));
diff --git a/arch/ppc64/kernel/head.S b/arch/ppc64/kernel/head.S
index 929f9f42cf7a..9e8050ea1225 100644
--- a/arch/ppc64/kernel/head.S
+++ b/arch/ppc64/kernel/head.S
@@ -35,7 +35,7 @@
35#include <asm/cputable.h> 35#include <asm/cputable.h>
36#include <asm/setup.h> 36#include <asm/setup.h>
37#include <asm/hvcall.h> 37#include <asm/hvcall.h>
38#include <asm/iSeries/LparMap.h> 38#include <asm/iseries/lpar_map.h>
39#include <asm/thread_info.h> 39#include <asm/thread_info.h>
40 40
41#ifdef CONFIG_PPC_ISERIES 41#ifdef CONFIG_PPC_ISERIES
@@ -195,11 +195,11 @@ exception_marker:
195#define EX_R12 24 195#define EX_R12 24
196#define EX_R13 32 196#define EX_R13 32
197#define EX_SRR0 40 197#define EX_SRR0 40
198#define EX_R3 40 /* SLB miss saves R3, but not SRR0 */
199#define EX_DAR 48 198#define EX_DAR 48
200#define EX_LR 48 /* SLB miss saves LR, but not DAR */
201#define EX_DSISR 56 199#define EX_DSISR 56
202#define EX_CCR 60 200#define EX_CCR 60
201#define EX_R3 64
202#define EX_LR 72
203 203
204#define EXCEPTION_PROLOG_PSERIES(area, label) \ 204#define EXCEPTION_PROLOG_PSERIES(area, label) \
205 mfspr r13,SPRN_SPRG3; /* get paca address into r13 */ \ 205 mfspr r13,SPRN_SPRG3; /* get paca address into r13 */ \
@@ -419,17 +419,22 @@ data_access_slb_pSeries:
419 mtspr SPRN_SPRG1,r13 419 mtspr SPRN_SPRG1,r13
420 RUNLATCH_ON(r13) 420 RUNLATCH_ON(r13)
421 mfspr r13,SPRN_SPRG3 /* get paca address into r13 */ 421 mfspr r13,SPRN_SPRG3 /* get paca address into r13 */
422 std r3,PACA_EXSLB+EX_R3(r13)
423 mfspr r3,SPRN_DAR
422 std r9,PACA_EXSLB+EX_R9(r13) /* save r9 - r12 */ 424 std r9,PACA_EXSLB+EX_R9(r13) /* save r9 - r12 */
425 mfcr r9
426#ifdef __DISABLED__
427 /* Keep that around for when we re-implement dynamic VSIDs */
428 cmpdi r3,0
429 bge slb_miss_user_pseries
430#endif /* __DISABLED__ */
423 std r10,PACA_EXSLB+EX_R10(r13) 431 std r10,PACA_EXSLB+EX_R10(r13)
424 std r11,PACA_EXSLB+EX_R11(r13) 432 std r11,PACA_EXSLB+EX_R11(r13)
425 std r12,PACA_EXSLB+EX_R12(r13) 433 std r12,PACA_EXSLB+EX_R12(r13)
426 std r3,PACA_EXSLB+EX_R3(r13) 434 mfspr r10,SPRN_SPRG1
427 mfspr r9,SPRN_SPRG1 435 std r10,PACA_EXSLB+EX_R13(r13)
428 std r9,PACA_EXSLB+EX_R13(r13)
429 mfcr r9
430 mfspr r12,SPRN_SRR1 /* and SRR1 */ 436 mfspr r12,SPRN_SRR1 /* and SRR1 */
431 mfspr r3,SPRN_DAR 437 b .slb_miss_realmode /* Rel. branch works in real mode */
432 b .do_slb_miss /* Rel. branch works in real mode */
433 438
434 STD_EXCEPTION_PSERIES(0x400, instruction_access) 439 STD_EXCEPTION_PSERIES(0x400, instruction_access)
435 440
@@ -440,17 +445,22 @@ instruction_access_slb_pSeries:
440 mtspr SPRN_SPRG1,r13 445 mtspr SPRN_SPRG1,r13
441 RUNLATCH_ON(r13) 446 RUNLATCH_ON(r13)
442 mfspr r13,SPRN_SPRG3 /* get paca address into r13 */ 447 mfspr r13,SPRN_SPRG3 /* get paca address into r13 */
448 std r3,PACA_EXSLB+EX_R3(r13)
449 mfspr r3,SPRN_SRR0 /* SRR0 is faulting address */
443 std r9,PACA_EXSLB+EX_R9(r13) /* save r9 - r12 */ 450 std r9,PACA_EXSLB+EX_R9(r13) /* save r9 - r12 */
451 mfcr r9
452#ifdef __DISABLED__
453 /* Keep that around for when we re-implement dynamic VSIDs */
454 cmpdi r3,0
455 bge slb_miss_user_pseries
456#endif /* __DISABLED__ */
444 std r10,PACA_EXSLB+EX_R10(r13) 457 std r10,PACA_EXSLB+EX_R10(r13)
445 std r11,PACA_EXSLB+EX_R11(r13) 458 std r11,PACA_EXSLB+EX_R11(r13)
446 std r12,PACA_EXSLB+EX_R12(r13) 459 std r12,PACA_EXSLB+EX_R12(r13)
447 std r3,PACA_EXSLB+EX_R3(r13) 460 mfspr r10,SPRN_SPRG1
448 mfspr r9,SPRN_SPRG1 461 std r10,PACA_EXSLB+EX_R13(r13)
449 std r9,PACA_EXSLB+EX_R13(r13)
450 mfcr r9
451 mfspr r12,SPRN_SRR1 /* and SRR1 */ 462 mfspr r12,SPRN_SRR1 /* and SRR1 */
452 mfspr r3,SPRN_SRR0 /* SRR0 is faulting address */ 463 b .slb_miss_realmode /* Rel. branch works in real mode */
453 b .do_slb_miss /* Rel. branch works in real mode */
454 464
455 STD_EXCEPTION_PSERIES(0x500, hardware_interrupt) 465 STD_EXCEPTION_PSERIES(0x500, hardware_interrupt)
456 STD_EXCEPTION_PSERIES(0x600, alignment) 466 STD_EXCEPTION_PSERIES(0x600, alignment)
@@ -509,6 +519,38 @@ _GLOBAL(do_stab_bolted_pSeries)
509 EXCEPTION_PROLOG_PSERIES(PACA_EXSLB, .do_stab_bolted) 519 EXCEPTION_PROLOG_PSERIES(PACA_EXSLB, .do_stab_bolted)
510 520
511/* 521/*
522 * We have some room here we use that to put
523 * the peries slb miss user trampoline code so it's reasonably
524 * away from slb_miss_user_common to avoid problems with rfid
525 *
526 * This is used for when the SLB miss handler has to go virtual,
527 * which doesn't happen for now anymore but will once we re-implement
528 * dynamic VSIDs for shared page tables
529 */
530#ifdef __DISABLED__
531slb_miss_user_pseries:
532 std r10,PACA_EXGEN+EX_R10(r13)
533 std r11,PACA_EXGEN+EX_R11(r13)
534 std r12,PACA_EXGEN+EX_R12(r13)
535 mfspr r10,SPRG1
536 ld r11,PACA_EXSLB+EX_R9(r13)
537 ld r12,PACA_EXSLB+EX_R3(r13)
538 std r10,PACA_EXGEN+EX_R13(r13)
539 std r11,PACA_EXGEN+EX_R9(r13)
540 std r12,PACA_EXGEN+EX_R3(r13)
541 clrrdi r12,r13,32
542 mfmsr r10
543 mfspr r11,SRR0 /* save SRR0 */
544 ori r12,r12,slb_miss_user_common@l /* virt addr of handler */
545 ori r10,r10,MSR_IR|MSR_DR|MSR_RI
546 mtspr SRR0,r12
547 mfspr r12,SRR1 /* and SRR1 */
548 mtspr SRR1,r10
549 rfid
550 b . /* prevent spec. execution */
551#endif /* __DISABLED__ */
552
553/*
512 * Vectors for the FWNMI option. Share common code. 554 * Vectors for the FWNMI option. Share common code.
513 */ 555 */
514 .globl system_reset_fwnmi 556 .globl system_reset_fwnmi
@@ -559,22 +601,59 @@ END_FTR_SECTION_IFCLR(CPU_FTR_SLB)
559 .globl data_access_slb_iSeries 601 .globl data_access_slb_iSeries
560data_access_slb_iSeries: 602data_access_slb_iSeries:
561 mtspr SPRN_SPRG1,r13 /* save r13 */ 603 mtspr SPRN_SPRG1,r13 /* save r13 */
562 EXCEPTION_PROLOG_ISERIES_1(PACA_EXSLB) 604 mfspr r13,SPRN_SPRG3 /* get paca address into r13 */
563 std r3,PACA_EXSLB+EX_R3(r13) 605 std r3,PACA_EXSLB+EX_R3(r13)
564 ld r12,PACALPPACA+LPPACASRR1(r13)
565 mfspr r3,SPRN_DAR 606 mfspr r3,SPRN_DAR
566 b .do_slb_miss 607 std r9,PACA_EXSLB+EX_R9(r13)
608 mfcr r9
609#ifdef __DISABLED__
610 cmpdi r3,0
611 bge slb_miss_user_iseries
612#endif
613 std r10,PACA_EXSLB+EX_R10(r13)
614 std r11,PACA_EXSLB+EX_R11(r13)
615 std r12,PACA_EXSLB+EX_R12(r13)
616 mfspr r10,SPRN_SPRG1
617 std r10,PACA_EXSLB+EX_R13(r13)
618 ld r12,PACALPPACA+LPPACASRR1(r13);
619 b .slb_miss_realmode
567 620
568 STD_EXCEPTION_ISERIES(0x400, instruction_access, PACA_EXGEN) 621 STD_EXCEPTION_ISERIES(0x400, instruction_access, PACA_EXGEN)
569 622
570 .globl instruction_access_slb_iSeries 623 .globl instruction_access_slb_iSeries
571instruction_access_slb_iSeries: 624instruction_access_slb_iSeries:
572 mtspr SPRN_SPRG1,r13 /* save r13 */ 625 mtspr SPRN_SPRG1,r13 /* save r13 */
573 EXCEPTION_PROLOG_ISERIES_1(PACA_EXSLB) 626 mfspr r13,SPRN_SPRG3 /* get paca address into r13 */
574 std r3,PACA_EXSLB+EX_R3(r13) 627 std r3,PACA_EXSLB+EX_R3(r13)
575 ld r12,PACALPPACA+LPPACASRR1(r13) 628 ld r3,PACALPPACA+LPPACASRR0(r13) /* get SRR0 value */
576 ld r3,PACALPPACA+LPPACASRR0(r13) 629 std r9,PACA_EXSLB+EX_R9(r13)
577 b .do_slb_miss 630 mfcr r9
631#ifdef __DISABLED__
632 cmpdi r3,0
633 bge .slb_miss_user_iseries
634#endif
635 std r10,PACA_EXSLB+EX_R10(r13)
636 std r11,PACA_EXSLB+EX_R11(r13)
637 std r12,PACA_EXSLB+EX_R12(r13)
638 mfspr r10,SPRN_SPRG1
639 std r10,PACA_EXSLB+EX_R13(r13)
640 ld r12,PACALPPACA+LPPACASRR1(r13);
641 b .slb_miss_realmode
642
643#ifdef __DISABLED__
644slb_miss_user_iseries:
645 std r10,PACA_EXGEN+EX_R10(r13)
646 std r11,PACA_EXGEN+EX_R11(r13)
647 std r12,PACA_EXGEN+EX_R12(r13)
648 mfspr r10,SPRG1
649 ld r11,PACA_EXSLB+EX_R9(r13)
650 ld r12,PACA_EXSLB+EX_R3(r13)
651 std r10,PACA_EXGEN+EX_R13(r13)
652 std r11,PACA_EXGEN+EX_R9(r13)
653 std r12,PACA_EXGEN+EX_R3(r13)
654 EXCEPTION_PROLOG_ISERIES_2
655 b slb_miss_user_common
656#endif
578 657
579 MASKABLE_EXCEPTION_ISERIES(0x500, hardware_interrupt) 658 MASKABLE_EXCEPTION_ISERIES(0x500, hardware_interrupt)
580 STD_EXCEPTION_ISERIES(0x600, alignment, PACA_EXGEN) 659 STD_EXCEPTION_ISERIES(0x600, alignment, PACA_EXGEN)
@@ -809,6 +888,126 @@ instruction_access_common:
809 li r5,0x400 888 li r5,0x400
810 b .do_hash_page /* Try to handle as hpte fault */ 889 b .do_hash_page /* Try to handle as hpte fault */
811 890
891/*
892 * Here is the common SLB miss user that is used when going to virtual
893 * mode for SLB misses, that is currently not used
894 */
895#ifdef __DISABLED__
896 .align 7
897 .globl slb_miss_user_common
898slb_miss_user_common:
899 mflr r10
900 std r3,PACA_EXGEN+EX_DAR(r13)
901 stw r9,PACA_EXGEN+EX_CCR(r13)
902 std r10,PACA_EXGEN+EX_LR(r13)
903 std r11,PACA_EXGEN+EX_SRR0(r13)
904 bl .slb_allocate_user
905
906 ld r10,PACA_EXGEN+EX_LR(r13)
907 ld r3,PACA_EXGEN+EX_R3(r13)
908 lwz r9,PACA_EXGEN+EX_CCR(r13)
909 ld r11,PACA_EXGEN+EX_SRR0(r13)
910 mtlr r10
911 beq- slb_miss_fault
912
913 andi. r10,r12,MSR_RI /* check for unrecoverable exception */
914 beq- unrecov_user_slb
915 mfmsr r10
916
917.machine push
918.machine "power4"
919 mtcrf 0x80,r9
920.machine pop
921
922 clrrdi r10,r10,2 /* clear RI before setting SRR0/1 */
923 mtmsrd r10,1
924
925 mtspr SRR0,r11
926 mtspr SRR1,r12
927
928 ld r9,PACA_EXGEN+EX_R9(r13)
929 ld r10,PACA_EXGEN+EX_R10(r13)
930 ld r11,PACA_EXGEN+EX_R11(r13)
931 ld r12,PACA_EXGEN+EX_R12(r13)
932 ld r13,PACA_EXGEN+EX_R13(r13)
933 rfid
934 b .
935
936slb_miss_fault:
937 EXCEPTION_PROLOG_COMMON(0x380, PACA_EXGEN)
938 ld r4,PACA_EXGEN+EX_DAR(r13)
939 li r5,0
940 std r4,_DAR(r1)
941 std r5,_DSISR(r1)
942 b .handle_page_fault
943
944unrecov_user_slb:
945 EXCEPTION_PROLOG_COMMON(0x4200, PACA_EXGEN)
946 DISABLE_INTS
947 bl .save_nvgprs
9481: addi r3,r1,STACK_FRAME_OVERHEAD
949 bl .unrecoverable_exception
950 b 1b
951
952#endif /* __DISABLED__ */
953
954
955/*
956 * r13 points to the PACA, r9 contains the saved CR,
957 * r12 contain the saved SRR1, SRR0 is still ready for return
958 * r3 has the faulting address
959 * r9 - r13 are saved in paca->exslb.
960 * r3 is saved in paca->slb_r3
961 * We assume we aren't going to take any exceptions during this procedure.
962 */
963_GLOBAL(slb_miss_realmode)
964 mflr r10
965
966 stw r9,PACA_EXSLB+EX_CCR(r13) /* save CR in exc. frame */
967 std r10,PACA_EXSLB+EX_LR(r13) /* save LR */
968
969 bl .slb_allocate_realmode
970
971 /* All done -- return from exception. */
972
973 ld r10,PACA_EXSLB+EX_LR(r13)
974 ld r3,PACA_EXSLB+EX_R3(r13)
975 lwz r9,PACA_EXSLB+EX_CCR(r13) /* get saved CR */
976#ifdef CONFIG_PPC_ISERIES
977 ld r11,PACALPPACA+LPPACASRR0(r13) /* get SRR0 value */
978#endif /* CONFIG_PPC_ISERIES */
979
980 mtlr r10
981
982 andi. r10,r12,MSR_RI /* check for unrecoverable exception */
983 beq- unrecov_slb
984
985.machine push
986.machine "power4"
987 mtcrf 0x80,r9
988 mtcrf 0x01,r9 /* slb_allocate uses cr0 and cr7 */
989.machine pop
990
991#ifdef CONFIG_PPC_ISERIES
992 mtspr SPRN_SRR0,r11
993 mtspr SPRN_SRR1,r12
994#endif /* CONFIG_PPC_ISERIES */
995 ld r9,PACA_EXSLB+EX_R9(r13)
996 ld r10,PACA_EXSLB+EX_R10(r13)
997 ld r11,PACA_EXSLB+EX_R11(r13)
998 ld r12,PACA_EXSLB+EX_R12(r13)
999 ld r13,PACA_EXSLB+EX_R13(r13)
1000 rfid
1001 b . /* prevent speculative execution */
1002
1003unrecov_slb:
1004 EXCEPTION_PROLOG_COMMON(0x4100, PACA_EXSLB)
1005 DISABLE_INTS
1006 bl .save_nvgprs
10071: addi r3,r1,STACK_FRAME_OVERHEAD
1008 bl .unrecoverable_exception
1009 b 1b
1010
812 .align 7 1011 .align 7
813 .globl hardware_interrupt_common 1012 .globl hardware_interrupt_common
814 .globl hardware_interrupt_entry 1013 .globl hardware_interrupt_entry
@@ -1139,62 +1338,6 @@ _GLOBAL(do_stab_bolted)
1139 b . /* prevent speculative execution */ 1338 b . /* prevent speculative execution */
1140 1339
1141/* 1340/*
1142 * r13 points to the PACA, r9 contains the saved CR,
1143 * r11 and r12 contain the saved SRR0 and SRR1.
1144 * r3 has the faulting address
1145 * r9 - r13 are saved in paca->exslb.
1146 * r3 is saved in paca->slb_r3
1147 * We assume we aren't going to take any exceptions during this procedure.
1148 */
1149_GLOBAL(do_slb_miss)
1150 mflr r10
1151
1152 stw r9,PACA_EXSLB+EX_CCR(r13) /* save CR in exc. frame */
1153 std r10,PACA_EXSLB+EX_LR(r13) /* save LR */
1154
1155 bl .slb_allocate /* handle it */
1156
1157 /* All done -- return from exception. */
1158
1159 ld r10,PACA_EXSLB+EX_LR(r13)
1160 ld r3,PACA_EXSLB+EX_R3(r13)
1161 lwz r9,PACA_EXSLB+EX_CCR(r13) /* get saved CR */
1162#ifdef CONFIG_PPC_ISERIES
1163 ld r11,PACALPPACA+LPPACASRR0(r13) /* get SRR0 value */
1164#endif /* CONFIG_PPC_ISERIES */
1165
1166 mtlr r10
1167
1168 andi. r10,r12,MSR_RI /* check for unrecoverable exception */
1169 beq- unrecov_slb
1170
1171.machine push
1172.machine "power4"
1173 mtcrf 0x80,r9
1174 mtcrf 0x01,r9 /* slb_allocate uses cr0 and cr7 */
1175.machine pop
1176
1177#ifdef CONFIG_PPC_ISERIES
1178 mtspr SPRN_SRR0,r11
1179 mtspr SPRN_SRR1,r12
1180#endif /* CONFIG_PPC_ISERIES */
1181 ld r9,PACA_EXSLB+EX_R9(r13)
1182 ld r10,PACA_EXSLB+EX_R10(r13)
1183 ld r11,PACA_EXSLB+EX_R11(r13)
1184 ld r12,PACA_EXSLB+EX_R12(r13)
1185 ld r13,PACA_EXSLB+EX_R13(r13)
1186 rfid
1187 b . /* prevent speculative execution */
1188
1189unrecov_slb:
1190 EXCEPTION_PROLOG_COMMON(0x4100, PACA_EXSLB)
1191 DISABLE_INTS
1192 bl .save_nvgprs
11931: addi r3,r1,STACK_FRAME_OVERHEAD
1194 bl .unrecoverable_exception
1195 b 1b
1196
1197/*
1198 * Space for CPU0's segment table. 1341 * Space for CPU0's segment table.
1199 * 1342 *
1200 * On iSeries, the hypervisor must fill in at least one entry before 1343 * On iSeries, the hypervisor must fill in at least one entry before
@@ -1569,7 +1712,10 @@ _GLOBAL(__secondary_start)
1569#endif 1712#endif
1570 /* Initialize the first segment table (or SLB) entry */ 1713 /* Initialize the first segment table (or SLB) entry */
1571 ld r3,PACASTABVIRT(r13) /* get addr of segment table */ 1714 ld r3,PACASTABVIRT(r13) /* get addr of segment table */
1715BEGIN_FTR_SECTION
1572 bl .stab_initialize 1716 bl .stab_initialize
1717END_FTR_SECTION_IFCLR(CPU_FTR_SLB)
1718 bl .slb_initialize
1573 1719
1574 /* Initialize the kernel stack. Just a repeat for iSeries. */ 1720 /* Initialize the kernel stack. Just a repeat for iSeries. */
1575 LOADADDR(r3,current_set) 1721 LOADADDR(r3,current_set)
@@ -1914,24 +2060,6 @@ _GLOBAL(hmt_start_secondary)
1914 blr 2060 blr
1915#endif 2061#endif
1916 2062
1917#if defined(CONFIG_KEXEC) || defined(CONFIG_SMP)
1918_GLOBAL(smp_release_cpus)
1919 /* All secondary cpus are spinning on a common
1920 * spinloop, release them all now so they can start
1921 * to spin on their individual paca spinloops.
1922 * For non SMP kernels, the secondary cpus never
1923 * get out of the common spinloop.
1924 * XXX This does nothing useful on iSeries, secondaries are
1925 * already waiting on their paca.
1926 */
1927 li r3,1
1928 LOADADDR(r5,__secondary_hold_spinloop)
1929 std r3,0(r5)
1930 sync
1931 blr
1932#endif /* CONFIG_SMP */
1933
1934
1935/* 2063/*
1936 * We put a few things here that have to be page-aligned. 2064 * We put a few things here that have to be page-aligned.
1937 * This stuff goes at the beginning of the bss, which is page-aligned. 2065 * This stuff goes at the beginning of the bss, which is page-aligned.
diff --git a/arch/ppc64/kernel/idle.c b/arch/ppc64/kernel/idle.c
index 8abd2ad92832..715bc0e71e0f 100644
--- a/arch/ppc64/kernel/idle.c
+++ b/arch/ppc64/kernel/idle.c
@@ -28,20 +28,17 @@
28#include <asm/time.h> 28#include <asm/time.h>
29#include <asm/systemcfg.h> 29#include <asm/systemcfg.h>
30#include <asm/machdep.h> 30#include <asm/machdep.h>
31#include <asm/smp.h>
31 32
32extern void power4_idle(void); 33extern void power4_idle(void);
33 34
34void default_idle(void) 35void default_idle(void)
35{ 36{
36 long oldval;
37 unsigned int cpu = smp_processor_id(); 37 unsigned int cpu = smp_processor_id();
38 set_thread_flag(TIF_POLLING_NRFLAG);
38 39
39 while (1) { 40 while (1) {
40 oldval = test_and_clear_thread_flag(TIF_NEED_RESCHED); 41 if (!need_resched()) {
41
42 if (!oldval) {
43 set_thread_flag(TIF_POLLING_NRFLAG);
44
45 while (!need_resched() && !cpu_is_offline(cpu)) { 42 while (!need_resched() && !cpu_is_offline(cpu)) {
46 ppc64_runlatch_off(); 43 ppc64_runlatch_off();
47 44
@@ -54,13 +51,12 @@ void default_idle(void)
54 } 51 }
55 52
56 HMT_medium(); 53 HMT_medium();
57 clear_thread_flag(TIF_POLLING_NRFLAG);
58 } else {
59 set_need_resched();
60 } 54 }
61 55
62 ppc64_runlatch_on(); 56 ppc64_runlatch_on();
57 preempt_enable_no_resched();
63 schedule(); 58 schedule();
59 preempt_disable();
64 if (cpu_is_offline(cpu) && system_state == SYSTEM_RUNNING) 60 if (cpu_is_offline(cpu) && system_state == SYSTEM_RUNNING)
65 cpu_die(); 61 cpu_die();
66 } 62 }
@@ -76,7 +72,9 @@ void native_idle(void)
76 72
77 if (need_resched()) { 73 if (need_resched()) {
78 ppc64_runlatch_on(); 74 ppc64_runlatch_on();
75 preempt_enable_no_resched();
79 schedule(); 76 schedule();
77 preempt_disable();
80 } 78 }
81 79
82 if (cpu_is_offline(smp_processor_id()) && 80 if (cpu_is_offline(smp_processor_id()) &&
diff --git a/arch/ppc64/kernel/irq.c b/arch/ppc64/kernel/irq.c
index f41afe545045..87474584033f 100644
--- a/arch/ppc64/kernel/irq.c
+++ b/arch/ppc64/kernel/irq.c
@@ -52,7 +52,7 @@
52#include <asm/cache.h> 52#include <asm/cache.h>
53#include <asm/prom.h> 53#include <asm/prom.h>
54#include <asm/ptrace.h> 54#include <asm/ptrace.h>
55#include <asm/iSeries/ItLpQueue.h> 55#include <asm/iseries/it_lp_queue.h>
56#include <asm/machdep.h> 56#include <asm/machdep.h>
57#include <asm/paca.h> 57#include <asm/paca.h>
58 58
@@ -392,7 +392,7 @@ int virt_irq_create_mapping(unsigned int real_irq)
392 if (ppc64_interrupt_controller == IC_OPEN_PIC) 392 if (ppc64_interrupt_controller == IC_OPEN_PIC)
393 return real_irq; /* no mapping for openpic (for now) */ 393 return real_irq; /* no mapping for openpic (for now) */
394 394
395 if (ppc64_interrupt_controller == IC_BPA_IIC) 395 if (ppc64_interrupt_controller == IC_CELL_PIC)
396 return real_irq; /* no mapping for iic either */ 396 return real_irq; /* no mapping for iic either */
397 397
398 /* don't map interrupts < MIN_VIRT_IRQ */ 398 /* don't map interrupts < MIN_VIRT_IRQ */
diff --git a/arch/ppc64/kernel/kprobes.c b/arch/ppc64/kernel/kprobes.c
index ed876a5178ae..511af54e6230 100644
--- a/arch/ppc64/kernel/kprobes.c
+++ b/arch/ppc64/kernel/kprobes.c
@@ -30,19 +30,14 @@
30#include <linux/config.h> 30#include <linux/config.h>
31#include <linux/kprobes.h> 31#include <linux/kprobes.h>
32#include <linux/ptrace.h> 32#include <linux/ptrace.h>
33#include <linux/spinlock.h>
34#include <linux/preempt.h> 33#include <linux/preempt.h>
35#include <asm/cacheflush.h> 34#include <asm/cacheflush.h>
36#include <asm/kdebug.h> 35#include <asm/kdebug.h>
37#include <asm/sstep.h> 36#include <asm/sstep.h>
38 37
39static DECLARE_MUTEX(kprobe_mutex); 38static DECLARE_MUTEX(kprobe_mutex);
40 39DEFINE_PER_CPU(struct kprobe *, current_kprobe) = NULL;
41static struct kprobe *current_kprobe; 40DEFINE_PER_CPU(struct kprobe_ctlblk, kprobe_ctlblk);
42static unsigned long kprobe_status, kprobe_saved_msr;
43static struct kprobe *kprobe_prev;
44static unsigned long kprobe_status_prev, kprobe_saved_msr_prev;
45static struct pt_regs jprobe_saved_regs;
46 41
47int __kprobes arch_prepare_kprobe(struct kprobe *p) 42int __kprobes arch_prepare_kprobe(struct kprobe *p)
48{ 43{
@@ -108,20 +103,28 @@ static inline void prepare_singlestep(struct kprobe *p, struct pt_regs *regs)
108 regs->nip = (unsigned long)p->ainsn.insn; 103 regs->nip = (unsigned long)p->ainsn.insn;
109} 104}
110 105
111static inline void save_previous_kprobe(void) 106static inline void save_previous_kprobe(struct kprobe_ctlblk *kcb)
107{
108 kcb->prev_kprobe.kp = kprobe_running();
109 kcb->prev_kprobe.status = kcb->kprobe_status;
110 kcb->prev_kprobe.saved_msr = kcb->kprobe_saved_msr;
111}
112
113static inline void restore_previous_kprobe(struct kprobe_ctlblk *kcb)
112{ 114{
113 kprobe_prev = current_kprobe; 115 __get_cpu_var(current_kprobe) = kcb->prev_kprobe.kp;
114 kprobe_status_prev = kprobe_status; 116 kcb->kprobe_status = kcb->prev_kprobe.status;
115 kprobe_saved_msr_prev = kprobe_saved_msr; 117 kcb->kprobe_saved_msr = kcb->prev_kprobe.saved_msr;
116} 118}
117 119
118static inline void restore_previous_kprobe(void) 120static inline void set_current_kprobe(struct kprobe *p, struct pt_regs *regs,
121 struct kprobe_ctlblk *kcb)
119{ 122{
120 current_kprobe = kprobe_prev; 123 __get_cpu_var(current_kprobe) = p;
121 kprobe_status = kprobe_status_prev; 124 kcb->kprobe_saved_msr = regs->msr;
122 kprobe_saved_msr = kprobe_saved_msr_prev;
123} 125}
124 126
127/* Called with kretprobe_lock held */
125void __kprobes arch_prepare_kretprobe(struct kretprobe *rp, 128void __kprobes arch_prepare_kretprobe(struct kretprobe *rp,
126 struct pt_regs *regs) 129 struct pt_regs *regs)
127{ 130{
@@ -145,19 +148,24 @@ static inline int kprobe_handler(struct pt_regs *regs)
145 struct kprobe *p; 148 struct kprobe *p;
146 int ret = 0; 149 int ret = 0;
147 unsigned int *addr = (unsigned int *)regs->nip; 150 unsigned int *addr = (unsigned int *)regs->nip;
151 struct kprobe_ctlblk *kcb;
152
153 /*
154 * We don't want to be preempted for the entire
155 * duration of kprobe processing
156 */
157 preempt_disable();
158 kcb = get_kprobe_ctlblk();
148 159
149 /* Check we're not actually recursing */ 160 /* Check we're not actually recursing */
150 if (kprobe_running()) { 161 if (kprobe_running()) {
151 /* We *are* holding lock here, so this is safe.
152 Disarm the probe we just hit, and ignore it. */
153 p = get_kprobe(addr); 162 p = get_kprobe(addr);
154 if (p) { 163 if (p) {
155 kprobe_opcode_t insn = *p->ainsn.insn; 164 kprobe_opcode_t insn = *p->ainsn.insn;
156 if (kprobe_status == KPROBE_HIT_SS && 165 if (kcb->kprobe_status == KPROBE_HIT_SS &&
157 is_trap(insn)) { 166 is_trap(insn)) {
158 regs->msr &= ~MSR_SE; 167 regs->msr &= ~MSR_SE;
159 regs->msr |= kprobe_saved_msr; 168 regs->msr |= kcb->kprobe_saved_msr;
160 unlock_kprobes();
161 goto no_kprobe; 169 goto no_kprobe;
162 } 170 }
163 /* We have reentered the kprobe_handler(), since 171 /* We have reentered the kprobe_handler(), since
@@ -166,27 +174,24 @@ static inline int kprobe_handler(struct pt_regs *regs)
166 * just single step on the instruction of the new probe 174 * just single step on the instruction of the new probe
167 * without calling any user handlers. 175 * without calling any user handlers.
168 */ 176 */
169 save_previous_kprobe(); 177 save_previous_kprobe(kcb);
170 current_kprobe = p; 178 set_current_kprobe(p, regs, kcb);
171 kprobe_saved_msr = regs->msr; 179 kcb->kprobe_saved_msr = regs->msr;
172 p->nmissed++; 180 p->nmissed++;
173 prepare_singlestep(p, regs); 181 prepare_singlestep(p, regs);
174 kprobe_status = KPROBE_REENTER; 182 kcb->kprobe_status = KPROBE_REENTER;
175 return 1; 183 return 1;
176 } else { 184 } else {
177 p = current_kprobe; 185 p = __get_cpu_var(current_kprobe);
178 if (p->break_handler && p->break_handler(p, regs)) { 186 if (p->break_handler && p->break_handler(p, regs)) {
179 goto ss_probe; 187 goto ss_probe;
180 } 188 }
181 } 189 }
182 /* If it's not ours, can't be delete race, (we hold lock). */
183 goto no_kprobe; 190 goto no_kprobe;
184 } 191 }
185 192
186 lock_kprobes();
187 p = get_kprobe(addr); 193 p = get_kprobe(addr);
188 if (!p) { 194 if (!p) {
189 unlock_kprobes();
190 if (*addr != BREAKPOINT_INSTRUCTION) { 195 if (*addr != BREAKPOINT_INSTRUCTION) {
191 /* 196 /*
192 * PowerPC has multiple variants of the "trap" 197 * PowerPC has multiple variants of the "trap"
@@ -209,24 +214,19 @@ static inline int kprobe_handler(struct pt_regs *regs)
209 goto no_kprobe; 214 goto no_kprobe;
210 } 215 }
211 216
212 kprobe_status = KPROBE_HIT_ACTIVE; 217 kcb->kprobe_status = KPROBE_HIT_ACTIVE;
213 current_kprobe = p; 218 set_current_kprobe(p, regs, kcb);
214 kprobe_saved_msr = regs->msr;
215 if (p->pre_handler && p->pre_handler(p, regs)) 219 if (p->pre_handler && p->pre_handler(p, regs))
216 /* handler has already set things up, so skip ss setup */ 220 /* handler has already set things up, so skip ss setup */
217 return 1; 221 return 1;
218 222
219ss_probe: 223ss_probe:
220 prepare_singlestep(p, regs); 224 prepare_singlestep(p, regs);
221 kprobe_status = KPROBE_HIT_SS; 225 kcb->kprobe_status = KPROBE_HIT_SS;
222 /*
223 * This preempt_disable() matches the preempt_enable_no_resched()
224 * in post_kprobe_handler().
225 */
226 preempt_disable();
227 return 1; 226 return 1;
228 227
229no_kprobe: 228no_kprobe:
229 preempt_enable_no_resched();
230 return ret; 230 return ret;
231} 231}
232 232
@@ -251,9 +251,10 @@ int __kprobes trampoline_probe_handler(struct kprobe *p, struct pt_regs *regs)
251 struct kretprobe_instance *ri = NULL; 251 struct kretprobe_instance *ri = NULL;
252 struct hlist_head *head; 252 struct hlist_head *head;
253 struct hlist_node *node, *tmp; 253 struct hlist_node *node, *tmp;
254 unsigned long orig_ret_address = 0; 254 unsigned long flags, orig_ret_address = 0;
255 unsigned long trampoline_address =(unsigned long)&kretprobe_trampoline; 255 unsigned long trampoline_address =(unsigned long)&kretprobe_trampoline;
256 256
257 spin_lock_irqsave(&kretprobe_lock, flags);
257 head = kretprobe_inst_table_head(current); 258 head = kretprobe_inst_table_head(current);
258 259
259 /* 260 /*
@@ -292,12 +293,14 @@ int __kprobes trampoline_probe_handler(struct kprobe *p, struct pt_regs *regs)
292 BUG_ON(!orig_ret_address || (orig_ret_address == trampoline_address)); 293 BUG_ON(!orig_ret_address || (orig_ret_address == trampoline_address));
293 regs->nip = orig_ret_address; 294 regs->nip = orig_ret_address;
294 295
295 unlock_kprobes(); 296 reset_current_kprobe();
297 spin_unlock_irqrestore(&kretprobe_lock, flags);
298 preempt_enable_no_resched();
296 299
297 /* 300 /*
298 * By returning a non-zero value, we are telling 301 * By returning a non-zero value, we are telling
299 * kprobe_handler() that we have handled unlocking 302 * kprobe_handler() that we don't want the post_handler
300 * and re-enabling preemption. 303 * to run (and have re-enabled preemption)
301 */ 304 */
302 return 1; 305 return 1;
303} 306}
@@ -323,23 +326,26 @@ static void __kprobes resume_execution(struct kprobe *p, struct pt_regs *regs)
323 326
324static inline int post_kprobe_handler(struct pt_regs *regs) 327static inline int post_kprobe_handler(struct pt_regs *regs)
325{ 328{
326 if (!kprobe_running()) 329 struct kprobe *cur = kprobe_running();
330 struct kprobe_ctlblk *kcb = get_kprobe_ctlblk();
331
332 if (!cur)
327 return 0; 333 return 0;
328 334
329 if ((kprobe_status != KPROBE_REENTER) && current_kprobe->post_handler) { 335 if ((kcb->kprobe_status != KPROBE_REENTER) && cur->post_handler) {
330 kprobe_status = KPROBE_HIT_SSDONE; 336 kcb->kprobe_status = KPROBE_HIT_SSDONE;
331 current_kprobe->post_handler(current_kprobe, regs, 0); 337 cur->post_handler(cur, regs, 0);
332 } 338 }
333 339
334 resume_execution(current_kprobe, regs); 340 resume_execution(cur, regs);
335 regs->msr |= kprobe_saved_msr; 341 regs->msr |= kcb->kprobe_saved_msr;
336 342
337 /*Restore back the original saved kprobes variables and continue. */ 343 /*Restore back the original saved kprobes variables and continue. */
338 if (kprobe_status == KPROBE_REENTER) { 344 if (kcb->kprobe_status == KPROBE_REENTER) {
339 restore_previous_kprobe(); 345 restore_previous_kprobe(kcb);
340 goto out; 346 goto out;
341 } 347 }
342 unlock_kprobes(); 348 reset_current_kprobe();
343out: 349out:
344 preempt_enable_no_resched(); 350 preempt_enable_no_resched();
345 351
@@ -354,19 +360,20 @@ out:
354 return 1; 360 return 1;
355} 361}
356 362
357/* Interrupts disabled, kprobe_lock held. */
358static inline int kprobe_fault_handler(struct pt_regs *regs, int trapnr) 363static inline int kprobe_fault_handler(struct pt_regs *regs, int trapnr)
359{ 364{
360 if (current_kprobe->fault_handler 365 struct kprobe *cur = kprobe_running();
361 && current_kprobe->fault_handler(current_kprobe, regs, trapnr)) 366 struct kprobe_ctlblk *kcb = get_kprobe_ctlblk();
367
368 if (cur->fault_handler && cur->fault_handler(cur, regs, trapnr))
362 return 1; 369 return 1;
363 370
364 if (kprobe_status & KPROBE_HIT_SS) { 371 if (kcb->kprobe_status & KPROBE_HIT_SS) {
365 resume_execution(current_kprobe, regs); 372 resume_execution(cur, regs);
366 regs->msr &= ~MSR_SE; 373 regs->msr &= ~MSR_SE;
367 regs->msr |= kprobe_saved_msr; 374 regs->msr |= kcb->kprobe_saved_msr;
368 375
369 unlock_kprobes(); 376 reset_current_kprobe();
370 preempt_enable_no_resched(); 377 preempt_enable_no_resched();
371 } 378 }
372 return 0; 379 return 0;
@@ -381,11 +388,6 @@ int __kprobes kprobe_exceptions_notify(struct notifier_block *self,
381 struct die_args *args = (struct die_args *)data; 388 struct die_args *args = (struct die_args *)data;
382 int ret = NOTIFY_DONE; 389 int ret = NOTIFY_DONE;
383 390
384 /*
385 * Interrupts are not disabled here. We need to disable
386 * preemption, because kprobe_running() uses smp_processor_id().
387 */
388 preempt_disable();
389 switch (val) { 391 switch (val) {
390 case DIE_BPT: 392 case DIE_BPT:
391 if (kprobe_handler(args->regs)) 393 if (kprobe_handler(args->regs))
@@ -396,22 +398,25 @@ int __kprobes kprobe_exceptions_notify(struct notifier_block *self,
396 ret = NOTIFY_STOP; 398 ret = NOTIFY_STOP;
397 break; 399 break;
398 case DIE_PAGE_FAULT: 400 case DIE_PAGE_FAULT:
401 /* kprobe_running() needs smp_processor_id() */
402 preempt_disable();
399 if (kprobe_running() && 403 if (kprobe_running() &&
400 kprobe_fault_handler(args->regs, args->trapnr)) 404 kprobe_fault_handler(args->regs, args->trapnr))
401 ret = NOTIFY_STOP; 405 ret = NOTIFY_STOP;
406 preempt_enable();
402 break; 407 break;
403 default: 408 default:
404 break; 409 break;
405 } 410 }
406 preempt_enable_no_resched();
407 return ret; 411 return ret;
408} 412}
409 413
410int __kprobes setjmp_pre_handler(struct kprobe *p, struct pt_regs *regs) 414int __kprobes setjmp_pre_handler(struct kprobe *p, struct pt_regs *regs)
411{ 415{
412 struct jprobe *jp = container_of(p, struct jprobe, kp); 416 struct jprobe *jp = container_of(p, struct jprobe, kp);
417 struct kprobe_ctlblk *kcb = get_kprobe_ctlblk();
413 418
414 memcpy(&jprobe_saved_regs, regs, sizeof(struct pt_regs)); 419 memcpy(&kcb->jprobe_saved_regs, regs, sizeof(struct pt_regs));
415 420
416 /* setup return addr to the jprobe handler routine */ 421 /* setup return addr to the jprobe handler routine */
417 regs->nip = (unsigned long)(((func_descr_t *)jp->entry)->entry); 422 regs->nip = (unsigned long)(((func_descr_t *)jp->entry)->entry);
@@ -431,12 +436,15 @@ void __kprobes jprobe_return_end(void)
431 436
432int __kprobes longjmp_break_handler(struct kprobe *p, struct pt_regs *regs) 437int __kprobes longjmp_break_handler(struct kprobe *p, struct pt_regs *regs)
433{ 438{
439 struct kprobe_ctlblk *kcb = get_kprobe_ctlblk();
440
434 /* 441 /*
435 * FIXME - we should ideally be validating that we got here 'cos 442 * FIXME - we should ideally be validating that we got here 'cos
436 * of the "trap" in jprobe_return() above, before restoring the 443 * of the "trap" in jprobe_return() above, before restoring the
437 * saved regs... 444 * saved regs...
438 */ 445 */
439 memcpy(regs, &jprobe_saved_regs, sizeof(struct pt_regs)); 446 memcpy(regs, &kcb->jprobe_saved_regs, sizeof(struct pt_regs));
447 preempt_enable_no_resched();
440 return 1; 448 return 1;
441} 449}
442 450
diff --git a/arch/ppc64/kernel/lparcfg.c b/arch/ppc64/kernel/lparcfg.c
index cae19bbd5acd..3e7b2f28ec83 100644
--- a/arch/ppc64/kernel/lparcfg.c
+++ b/arch/ppc64/kernel/lparcfg.c
@@ -26,14 +26,14 @@
26#include <linux/init.h> 26#include <linux/init.h>
27#include <linux/seq_file.h> 27#include <linux/seq_file.h>
28#include <asm/uaccess.h> 28#include <asm/uaccess.h>
29#include <asm/iSeries/HvLpConfig.h> 29#include <asm/iseries/hv_lp_config.h>
30#include <asm/lppaca.h> 30#include <asm/lppaca.h>
31#include <asm/hvcall.h> 31#include <asm/hvcall.h>
32#include <asm/firmware.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>
36#include <asm/iSeries/ItExtVpdPanel.h> 36#include <asm/iseries/it_exp_vpd_panel.h>
37#include <asm/prom.h> 37#include <asm/prom.h>
38 38
39#define MODULE_VERS "1.6" 39#define MODULE_VERS "1.6"
@@ -599,9 +599,7 @@ int __init lparcfg_init(void)
599void __exit lparcfg_cleanup(void) 599void __exit lparcfg_cleanup(void)
600{ 600{
601 if (proc_ppc64_lparcfg) { 601 if (proc_ppc64_lparcfg) {
602 if (proc_ppc64_lparcfg->data) { 602 kfree(proc_ppc64_lparcfg->data);
603 kfree(proc_ppc64_lparcfg->data);
604 }
605 remove_proc_entry("lparcfg", proc_ppc64_lparcfg->parent); 603 remove_proc_entry("lparcfg", proc_ppc64_lparcfg->parent);
606 } 604 }
607} 605}
diff --git a/arch/ppc64/kernel/machine_kexec.c b/arch/ppc64/kernel/machine_kexec.c
index bf7cc4f8210f..07ea03598c00 100644
--- a/arch/ppc64/kernel/machine_kexec.c
+++ b/arch/ppc64/kernel/machine_kexec.c
@@ -24,6 +24,7 @@
24#include <asm/mmu.h> 24#include <asm/mmu.h>
25#include <asm/sections.h> /* _end */ 25#include <asm/sections.h> /* _end */
26#include <asm/prom.h> 26#include <asm/prom.h>
27#include <asm/smp.h>
27 28
28#define HASH_GROUP_SIZE 0x80 /* size of each hash group, asm/mmu.h */ 29#define HASH_GROUP_SIZE 0x80 /* size of each hash group, asm/mmu.h */
29 30
@@ -244,7 +245,6 @@ static void kexec_prepare_cpus(void)
244 245
245static void kexec_prepare_cpus(void) 246static void kexec_prepare_cpus(void)
246{ 247{
247 extern void smp_release_cpus(void);
248 /* 248 /*
249 * move the secondarys to us so that we can copy 249 * move the secondarys to us so that we can copy
250 * the new kernel 0-0x100 safely 250 * the new kernel 0-0x100 safely
diff --git a/arch/ppc64/kernel/misc.S b/arch/ppc64/kernel/misc.S
index 077507ffbab8..914632ec587d 100644
--- a/arch/ppc64/kernel/misc.S
+++ b/arch/ppc64/kernel/misc.S
@@ -560,7 +560,7 @@ _GLOBAL(real_readb)
560 isync 560 isync
561 blr 561 blr
562 562
563 /* 563/*
564 * Do an IO access in real mode 564 * Do an IO access in real mode
565 */ 565 */
566_GLOBAL(real_writeb) 566_GLOBAL(real_writeb)
@@ -593,6 +593,76 @@ _GLOBAL(real_writeb)
593#endif /* defined(CONFIG_PPC_PMAC) || defined(CONFIG_PPC_MAPLE) */ 593#endif /* defined(CONFIG_PPC_PMAC) || defined(CONFIG_PPC_MAPLE) */
594 594
595/* 595/*
596 * SCOM access functions for 970 (FX only for now)
597 *
598 * unsigned long scom970_read(unsigned int address);
599 * void scom970_write(unsigned int address, unsigned long value);
600 *
601 * The address passed in is the 24 bits register address. This code
602 * is 970 specific and will not check the status bits, so you should
603 * know what you are doing.
604 */
605_GLOBAL(scom970_read)
606 /* interrupts off */
607 mfmsr r4
608 ori r0,r4,MSR_EE
609 xori r0,r0,MSR_EE
610 mtmsrd r0,1
611
612 /* rotate 24 bits SCOM address 8 bits left and mask out it's low 8 bits
613 * (including parity). On current CPUs they must be 0'd,
614 * and finally or in RW bit
615 */
616 rlwinm r3,r3,8,0,15
617 ori r3,r3,0x8000
618
619 /* do the actual scom read */
620 sync
621 mtspr SPRN_SCOMC,r3
622 isync
623 mfspr r3,SPRN_SCOMD
624 isync
625 mfspr r0,SPRN_SCOMC
626 isync
627
628 /* XXX: fixup result on some buggy 970's (ouch ! we lost a bit, bah
629 * that's the best we can do). Not implemented yet as we don't use
630 * the scom on any of the bogus CPUs yet, but may have to be done
631 * ultimately
632 */
633
634 /* restore interrupts */
635 mtmsrd r4,1
636 blr
637
638
639_GLOBAL(scom970_write)
640 /* interrupts off */
641 mfmsr r5
642 ori r0,r5,MSR_EE
643 xori r0,r0,MSR_EE
644 mtmsrd r0,1
645
646 /* rotate 24 bits SCOM address 8 bits left and mask out it's low 8 bits
647 * (including parity). On current CPUs they must be 0'd.
648 */
649
650 rlwinm r3,r3,8,0,15
651
652 sync
653 mtspr SPRN_SCOMD,r4 /* write data */
654 isync
655 mtspr SPRN_SCOMC,r3 /* write command */
656 isync
657 mfspr 3,SPRN_SCOMC
658 isync
659
660 /* restore interrupts */
661 mtmsrd r5,1
662 blr
663
664
665/*
596 * Create a kernel thread 666 * Create a kernel thread
597 * kernel_thread(fn, arg, flags) 667 * kernel_thread(fn, arg, flags)
598 */ 668 */
diff --git a/arch/ppc64/kernel/pacaData.c b/arch/ppc64/kernel/pacaData.c
index 33a2d8db3f21..3133c72b28ec 100644
--- a/arch/ppc64/kernel/pacaData.c
+++ b/arch/ppc64/kernel/pacaData.c
@@ -17,13 +17,13 @@
17#include <asm/page.h> 17#include <asm/page.h>
18 18
19#include <asm/lppaca.h> 19#include <asm/lppaca.h>
20#include <asm/iSeries/ItLpQueue.h> 20#include <asm/iseries/it_lp_queue.h>
21#include <asm/paca.h> 21#include <asm/paca.h>
22 22
23static union { 23static union {
24 struct systemcfg data; 24 struct systemcfg data;
25 u8 page[PAGE_SIZE]; 25 u8 page[PAGE_SIZE];
26} systemcfg_store __page_aligned; 26} systemcfg_store __attribute__((__section__(".data.page.aligned")));
27struct systemcfg *systemcfg = &systemcfg_store.data; 27struct systemcfg *systemcfg = &systemcfg_store.data;
28EXPORT_SYMBOL(systemcfg); 28EXPORT_SYMBOL(systemcfg);
29 29
diff --git a/arch/ppc64/kernel/pci.c b/arch/ppc64/kernel/pci.c
index 3d2106b022a1..30247ff74972 100644
--- a/arch/ppc64/kernel/pci.c
+++ b/arch/ppc64/kernel/pci.c
@@ -295,8 +295,8 @@ static void pci_parse_of_addrs(struct device_node *node, struct pci_dev *dev)
295 } 295 }
296} 296}
297 297
298static struct pci_dev *of_create_pci_dev(struct device_node *node, 298struct pci_dev *of_create_pci_dev(struct device_node *node,
299 struct pci_bus *bus, int devfn) 299 struct pci_bus *bus, int devfn)
300{ 300{
301 struct pci_dev *dev; 301 struct pci_dev *dev;
302 const char *type; 302 const char *type;
@@ -354,10 +354,9 @@ static struct pci_dev *of_create_pci_dev(struct device_node *node,
354 354
355 return dev; 355 return dev;
356} 356}
357EXPORT_SYMBOL(of_create_pci_dev);
357 358
358static void of_scan_pci_bridge(struct device_node *node, struct pci_dev *dev); 359void __devinit of_scan_bus(struct device_node *node,
359
360static void __devinit of_scan_bus(struct device_node *node,
361 struct pci_bus *bus) 360 struct pci_bus *bus)
362{ 361{
363 struct device_node *child = NULL; 362 struct device_node *child = NULL;
@@ -381,9 +380,10 @@ static void __devinit of_scan_bus(struct device_node *node,
381 380
382 do_bus_setup(bus); 381 do_bus_setup(bus);
383} 382}
383EXPORT_SYMBOL(of_scan_bus);
384 384
385static void __devinit of_scan_pci_bridge(struct device_node *node, 385void __devinit of_scan_pci_bridge(struct device_node *node,
386 struct pci_dev *dev) 386 struct pci_dev *dev)
387{ 387{
388 struct pci_bus *bus; 388 struct pci_bus *bus;
389 u32 *busrange, *ranges; 389 u32 *busrange, *ranges;
@@ -464,9 +464,10 @@ static void __devinit of_scan_pci_bridge(struct device_node *node,
464 else if (mode == PCI_PROBE_NORMAL) 464 else if (mode == PCI_PROBE_NORMAL)
465 pci_scan_child_bus(bus); 465 pci_scan_child_bus(bus);
466} 466}
467EXPORT_SYMBOL(of_scan_pci_bridge);
467#endif /* CONFIG_PPC_MULTIPLATFORM */ 468#endif /* CONFIG_PPC_MULTIPLATFORM */
468 469
469static void __devinit scan_phb(struct pci_controller *hose) 470void __devinit scan_phb(struct pci_controller *hose)
470{ 471{
471 struct pci_bus *bus; 472 struct pci_bus *bus;
472 struct device_node *node = hose->arch_data; 473 struct device_node *node = hose->arch_data;
diff --git a/arch/ppc64/kernel/pci_dn.c b/arch/ppc64/kernel/pci_dn.c
index 493bbe43f5b4..1a443a7ada4c 100644
--- a/arch/ppc64/kernel/pci_dn.c
+++ b/arch/ppc64/kernel/pci_dn.c
@@ -181,13 +181,14 @@ EXPORT_SYMBOL(fetch_dev_dn);
181static int pci_dn_reconfig_notifier(struct notifier_block *nb, unsigned long action, void *node) 181static int pci_dn_reconfig_notifier(struct notifier_block *nb, unsigned long action, void *node)
182{ 182{
183 struct device_node *np = node; 183 struct device_node *np = node;
184 struct pci_dn *pci; 184 struct pci_dn *pci = NULL;
185 int err = NOTIFY_OK; 185 int err = NOTIFY_OK;
186 186
187 switch (action) { 187 switch (action) {
188 case PSERIES_RECONFIG_ADD: 188 case PSERIES_RECONFIG_ADD:
189 pci = np->parent->data; 189 pci = np->parent->data;
190 update_dn_pci_info(np, pci->phb); 190 if (pci)
191 update_dn_pci_info(np, pci->phb);
191 break; 192 break;
192 default: 193 default:
193 err = NOTIFY_DONE; 194 err = NOTIFY_DONE;
diff --git a/arch/ppc64/kernel/proc_ppc64.c b/arch/ppc64/kernel/proc_ppc64.c
index a87c66a9652a..24e955ee9487 100644
--- a/arch/ppc64/kernel/proc_ppc64.c
+++ b/arch/ppc64/kernel/proc_ppc64.c
@@ -53,7 +53,7 @@ static int __init proc_ppc64_create(void)
53 if (!root) 53 if (!root)
54 return 1; 54 return 1;
55 55
56 if (!(systemcfg->platform & (PLATFORM_PSERIES | PLATFORM_BPA))) 56 if (!(systemcfg->platform & (PLATFORM_PSERIES | PLATFORM_CELL)))
57 return 0; 57 return 0;
58 58
59 if (!proc_mkdir("rtas", root)) 59 if (!proc_mkdir("rtas", root))
diff --git a/arch/ppc64/kernel/prom.c b/arch/ppc64/kernel/prom.c
index 97bfceb5353b..3402fbee62c7 100644
--- a/arch/ppc64/kernel/prom.c
+++ b/arch/ppc64/kernel/prom.c
@@ -31,6 +31,7 @@
31#include <linux/initrd.h> 31#include <linux/initrd.h>
32#include <linux/bitops.h> 32#include <linux/bitops.h>
33#include <linux/module.h> 33#include <linux/module.h>
34#include <linux/module.h>
34 35
35#include <asm/prom.h> 36#include <asm/prom.h>
36#include <asm/rtas.h> 37#include <asm/rtas.h>
@@ -46,7 +47,6 @@
46#include <asm/pgtable.h> 47#include <asm/pgtable.h>
47#include <asm/pci.h> 48#include <asm/pci.h>
48#include <asm/iommu.h> 49#include <asm/iommu.h>
49#include <asm/ppcdebug.h>
50#include <asm/btext.h> 50#include <asm/btext.h>
51#include <asm/sections.h> 51#include <asm/sections.h>
52#include <asm/machdep.h> 52#include <asm/machdep.h>
@@ -635,10 +635,10 @@ static inline char *find_flat_dt_string(u32 offset)
635 * used to extract the memory informations at boot before we can 635 * used to extract the memory informations at boot before we can
636 * unflatten the tree 636 * unflatten the tree
637 */ 637 */
638static int __init scan_flat_dt(int (*it)(unsigned long node, 638int __init of_scan_flat_dt(int (*it)(unsigned long node,
639 const char *uname, int depth, 639 const char *uname, int depth,
640 void *data), 640 void *data),
641 void *data) 641 void *data)
642{ 642{
643 unsigned long p = ((unsigned long)initial_boot_params) + 643 unsigned long p = ((unsigned long)initial_boot_params) +
644 initial_boot_params->off_dt_struct; 644 initial_boot_params->off_dt_struct;
@@ -695,8 +695,8 @@ static int __init scan_flat_dt(int (*it)(unsigned long node,
695 * This function can be used within scan_flattened_dt callback to get 695 * This function can be used within scan_flattened_dt callback to get
696 * access to properties 696 * access to properties
697 */ 697 */
698static void* __init get_flat_dt_prop(unsigned long node, const char *name, 698void* __init of_get_flat_dt_prop(unsigned long node, const char *name,
699 unsigned long *size) 699 unsigned long *size)
700{ 700{
701 unsigned long p = node; 701 unsigned long p = node;
702 702
@@ -996,7 +996,7 @@ void __init unflatten_device_tree(void)
996static int __init early_init_dt_scan_cpus(unsigned long node, 996static int __init early_init_dt_scan_cpus(unsigned long node,
997 const char *uname, int depth, void *data) 997 const char *uname, int depth, void *data)
998{ 998{
999 char *type = get_flat_dt_prop(node, "device_type", NULL); 999 char *type = of_get_flat_dt_prop(node, "device_type", NULL);
1000 u32 *prop; 1000 u32 *prop;
1001 unsigned long size; 1001 unsigned long size;
1002 1002
@@ -1004,17 +1004,6 @@ static int __init early_init_dt_scan_cpus(unsigned long node,
1004 if (type == NULL || strcmp(type, "cpu") != 0) 1004 if (type == NULL || strcmp(type, "cpu") != 0)
1005 return 0; 1005 return 0;
1006 1006
1007 /* On LPAR, look for the first ibm,pft-size property for the hash table size
1008 */
1009 if (systemcfg->platform == PLATFORM_PSERIES_LPAR && ppc64_pft_size == 0) {
1010 u32 *pft_size;
1011 pft_size = (u32 *)get_flat_dt_prop(node, "ibm,pft-size", NULL);
1012 if (pft_size != NULL) {
1013 /* pft_size[0] is the NUMA CEC cookie */
1014 ppc64_pft_size = pft_size[1];
1015 }
1016 }
1017
1018 if (initial_boot_params && initial_boot_params->version >= 2) { 1007 if (initial_boot_params && initial_boot_params->version >= 2) {
1019 /* version 2 of the kexec param format adds the phys cpuid 1008 /* version 2 of the kexec param format adds the phys cpuid
1020 * of booted proc. 1009 * of booted proc.
@@ -1023,8 +1012,9 @@ static int __init early_init_dt_scan_cpus(unsigned long node,
1023 boot_cpuid = 0; 1012 boot_cpuid = 0;
1024 } else { 1013 } else {
1025 /* Check if it's the boot-cpu, set it's hw index in paca now */ 1014 /* Check if it's the boot-cpu, set it's hw index in paca now */
1026 if (get_flat_dt_prop(node, "linux,boot-cpu", NULL) != NULL) { 1015 if (of_get_flat_dt_prop(node, "linux,boot-cpu", NULL)
1027 u32 *prop = get_flat_dt_prop(node, "reg", NULL); 1016 != NULL) {
1017 u32 *prop = of_get_flat_dt_prop(node, "reg", NULL);
1028 set_hard_smp_processor_id(0, prop == NULL ? 0 : *prop); 1018 set_hard_smp_processor_id(0, prop == NULL ? 0 : *prop);
1029 boot_cpuid_phys = get_hard_smp_processor_id(0); 1019 boot_cpuid_phys = get_hard_smp_processor_id(0);
1030 } 1020 }
@@ -1032,14 +1022,14 @@ static int __init early_init_dt_scan_cpus(unsigned long node,
1032 1022
1033#ifdef CONFIG_ALTIVEC 1023#ifdef CONFIG_ALTIVEC
1034 /* Check if we have a VMX and eventually update CPU features */ 1024 /* Check if we have a VMX and eventually update CPU features */
1035 prop = (u32 *)get_flat_dt_prop(node, "ibm,vmx", NULL); 1025 prop = (u32 *)of_get_flat_dt_prop(node, "ibm,vmx", NULL);
1036 if (prop && (*prop) > 0) { 1026 if (prop && (*prop) > 0) {
1037 cur_cpu_spec->cpu_features |= CPU_FTR_ALTIVEC; 1027 cur_cpu_spec->cpu_features |= CPU_FTR_ALTIVEC;
1038 cur_cpu_spec->cpu_user_features |= PPC_FEATURE_HAS_ALTIVEC; 1028 cur_cpu_spec->cpu_user_features |= PPC_FEATURE_HAS_ALTIVEC;
1039 } 1029 }
1040 1030
1041 /* Same goes for Apple's "altivec" property */ 1031 /* Same goes for Apple's "altivec" property */
1042 prop = (u32 *)get_flat_dt_prop(node, "altivec", NULL); 1032 prop = (u32 *)of_get_flat_dt_prop(node, "altivec", NULL);
1043 if (prop) { 1033 if (prop) {
1044 cur_cpu_spec->cpu_features |= CPU_FTR_ALTIVEC; 1034 cur_cpu_spec->cpu_features |= CPU_FTR_ALTIVEC;
1045 cur_cpu_spec->cpu_user_features |= PPC_FEATURE_HAS_ALTIVEC; 1035 cur_cpu_spec->cpu_user_features |= PPC_FEATURE_HAS_ALTIVEC;
@@ -1051,7 +1041,7 @@ static int __init early_init_dt_scan_cpus(unsigned long node,
1051 * this by looking at the size of the ibm,ppc-interrupt-server#s 1041 * this by looking at the size of the ibm,ppc-interrupt-server#s
1052 * property 1042 * property
1053 */ 1043 */
1054 prop = (u32 *)get_flat_dt_prop(node, "ibm,ppc-interrupt-server#s", 1044 prop = (u32 *)of_get_flat_dt_prop(node, "ibm,ppc-interrupt-server#s",
1055 &size); 1045 &size);
1056 cur_cpu_spec->cpu_features &= ~CPU_FTR_SMT; 1046 cur_cpu_spec->cpu_features &= ~CPU_FTR_SMT;
1057 if (prop && ((size / sizeof(u32)) > 1)) 1047 if (prop && ((size / sizeof(u32)) > 1))
@@ -1072,26 +1062,26 @@ static int __init early_init_dt_scan_chosen(unsigned long node,
1072 return 0; 1062 return 0;
1073 1063
1074 /* get platform type */ 1064 /* get platform type */
1075 prop = (u32 *)get_flat_dt_prop(node, "linux,platform", NULL); 1065 prop = (u32 *)of_get_flat_dt_prop(node, "linux,platform", NULL);
1076 if (prop == NULL) 1066 if (prop == NULL)
1077 return 0; 1067 return 0;
1078 systemcfg->platform = *prop; 1068 systemcfg->platform = *prop;
1079 1069
1080 /* check if iommu is forced on or off */ 1070 /* check if iommu is forced on or off */
1081 if (get_flat_dt_prop(node, "linux,iommu-off", NULL) != NULL) 1071 if (of_get_flat_dt_prop(node, "linux,iommu-off", NULL) != NULL)
1082 iommu_is_off = 1; 1072 iommu_is_off = 1;
1083 if (get_flat_dt_prop(node, "linux,iommu-force-on", NULL) != NULL) 1073 if (of_get_flat_dt_prop(node, "linux,iommu-force-on", NULL) != NULL)
1084 iommu_force_on = 1; 1074 iommu_force_on = 1;
1085 1075
1086 prop64 = (u64*)get_flat_dt_prop(node, "linux,memory-limit", NULL); 1076 prop64 = (u64*)of_get_flat_dt_prop(node, "linux,memory-limit", NULL);
1087 if (prop64) 1077 if (prop64)
1088 memory_limit = *prop64; 1078 memory_limit = *prop64;
1089 1079
1090 prop64 = (u64*)get_flat_dt_prop(node, "linux,tce-alloc-start", NULL); 1080 prop64 = (u64*)of_get_flat_dt_prop(node, "linux,tce-alloc-start",NULL);
1091 if (prop64) 1081 if (prop64)
1092 tce_alloc_start = *prop64; 1082 tce_alloc_start = *prop64;
1093 1083
1094 prop64 = (u64*)get_flat_dt_prop(node, "linux,tce-alloc-end", NULL); 1084 prop64 = (u64*)of_get_flat_dt_prop(node, "linux,tce-alloc-end", NULL);
1095 if (prop64) 1085 if (prop64)
1096 tce_alloc_end = *prop64; 1086 tce_alloc_end = *prop64;
1097 1087
@@ -1102,9 +1092,12 @@ static int __init early_init_dt_scan_chosen(unsigned long node,
1102 { 1092 {
1103 u64 *basep, *entryp; 1093 u64 *basep, *entryp;
1104 1094
1105 basep = (u64*)get_flat_dt_prop(node, "linux,rtas-base", NULL); 1095 basep = (u64*)of_get_flat_dt_prop(node,
1106 entryp = (u64*)get_flat_dt_prop(node, "linux,rtas-entry", NULL); 1096 "linux,rtas-base", NULL);
1107 prop = (u32*)get_flat_dt_prop(node, "linux,rtas-size", NULL); 1097 entryp = (u64*)of_get_flat_dt_prop(node,
1098 "linux,rtas-entry", NULL);
1099 prop = (u32*)of_get_flat_dt_prop(node,
1100 "linux,rtas-size", NULL);
1108 if (basep && entryp && prop) { 1101 if (basep && entryp && prop) {
1109 rtas.base = *basep; 1102 rtas.base = *basep;
1110 rtas.entry = *entryp; 1103 rtas.entry = *entryp;
@@ -1125,11 +1118,11 @@ static int __init early_init_dt_scan_root(unsigned long node,
1125 if (depth != 0) 1118 if (depth != 0)
1126 return 0; 1119 return 0;
1127 1120
1128 prop = (u32 *)get_flat_dt_prop(node, "#size-cells", NULL); 1121 prop = (u32 *)of_get_flat_dt_prop(node, "#size-cells", NULL);
1129 dt_root_size_cells = (prop == NULL) ? 1 : *prop; 1122 dt_root_size_cells = (prop == NULL) ? 1 : *prop;
1130 DBG("dt_root_size_cells = %x\n", dt_root_size_cells); 1123 DBG("dt_root_size_cells = %x\n", dt_root_size_cells);
1131 1124
1132 prop = (u32 *)get_flat_dt_prop(node, "#address-cells", NULL); 1125 prop = (u32 *)of_get_flat_dt_prop(node, "#address-cells", NULL);
1133 dt_root_addr_cells = (prop == NULL) ? 2 : *prop; 1126 dt_root_addr_cells = (prop == NULL) ? 2 : *prop;
1134 DBG("dt_root_addr_cells = %x\n", dt_root_addr_cells); 1127 DBG("dt_root_addr_cells = %x\n", dt_root_addr_cells);
1135 1128
@@ -1161,7 +1154,7 @@ static unsigned long __init dt_mem_next_cell(int s, cell_t **cellp)
1161static int __init early_init_dt_scan_memory(unsigned long node, 1154static int __init early_init_dt_scan_memory(unsigned long node,
1162 const char *uname, int depth, void *data) 1155 const char *uname, int depth, void *data)
1163{ 1156{
1164 char *type = get_flat_dt_prop(node, "device_type", NULL); 1157 char *type = of_get_flat_dt_prop(node, "device_type", NULL);
1165 cell_t *reg, *endp; 1158 cell_t *reg, *endp;
1166 unsigned long l; 1159 unsigned long l;
1167 1160
@@ -1169,7 +1162,7 @@ static int __init early_init_dt_scan_memory(unsigned long node,
1169 if (type == NULL || strcmp(type, "memory") != 0) 1162 if (type == NULL || strcmp(type, "memory") != 0)
1170 return 0; 1163 return 0;
1171 1164
1172 reg = (cell_t *)get_flat_dt_prop(node, "reg", &l); 1165 reg = (cell_t *)of_get_flat_dt_prop(node, "reg", &l);
1173 if (reg == NULL) 1166 if (reg == NULL)
1174 return 0; 1167 return 0;
1175 1168
@@ -1225,19 +1218,16 @@ void __init early_init_devtree(void *params)
1225 /* Setup flat device-tree pointer */ 1218 /* Setup flat device-tree pointer */
1226 initial_boot_params = params; 1219 initial_boot_params = params;
1227 1220
1228 /* By default, hash size is not set */
1229 ppc64_pft_size = 0;
1230
1231 /* Retreive various informations from the /chosen node of the 1221 /* Retreive various informations from the /chosen node of the
1232 * device-tree, including the platform type, initrd location and 1222 * device-tree, including the platform type, initrd location and
1233 * size, TCE reserve, and more ... 1223 * size, TCE reserve, and more ...
1234 */ 1224 */
1235 scan_flat_dt(early_init_dt_scan_chosen, NULL); 1225 of_scan_flat_dt(early_init_dt_scan_chosen, NULL);
1236 1226
1237 /* Scan memory nodes and rebuild LMBs */ 1227 /* Scan memory nodes and rebuild LMBs */
1238 lmb_init(); 1228 lmb_init();
1239 scan_flat_dt(early_init_dt_scan_root, NULL); 1229 of_scan_flat_dt(early_init_dt_scan_root, NULL);
1240 scan_flat_dt(early_init_dt_scan_memory, NULL); 1230 of_scan_flat_dt(early_init_dt_scan_memory, NULL);
1241 lmb_enforce_memory_limit(memory_limit); 1231 lmb_enforce_memory_limit(memory_limit);
1242 lmb_analyze(); 1232 lmb_analyze();
1243 systemcfg->physicalMemorySize = lmb_phys_mem_size(); 1233 systemcfg->physicalMemorySize = lmb_phys_mem_size();
@@ -1253,26 +1243,8 @@ void __init early_init_devtree(void *params)
1253 /* Retreive hash table size from flattened tree plus other 1243 /* Retreive hash table size from flattened tree plus other
1254 * CPU related informations (altivec support, boot CPU ID, ...) 1244 * CPU related informations (altivec support, boot CPU ID, ...)
1255 */ 1245 */
1256 scan_flat_dt(early_init_dt_scan_cpus, NULL); 1246 of_scan_flat_dt(early_init_dt_scan_cpus, NULL);
1257 1247
1258 /* If hash size wasn't obtained above, we calculate it now based on
1259 * the total RAM size
1260 */
1261 if (ppc64_pft_size == 0) {
1262 unsigned long rnd_mem_size, pteg_count;
1263
1264 /* round mem_size up to next power of 2 */
1265 rnd_mem_size = 1UL << __ilog2(systemcfg->physicalMemorySize);
1266 if (rnd_mem_size < systemcfg->physicalMemorySize)
1267 rnd_mem_size <<= 1;
1268
1269 /* # pages / 2 */
1270 pteg_count = max(rnd_mem_size >> (12 + 1), 1UL << 11);
1271
1272 ppc64_pft_size = __ilog2(pteg_count << 7);
1273 }
1274
1275 DBG("Hash pftSize: %x\n", (int)ppc64_pft_size);
1276 DBG(" <- early_init_devtree()\n"); 1248 DBG(" <- early_init_devtree()\n");
1277} 1249}
1278 1250
@@ -1894,17 +1866,32 @@ get_property(struct device_node *np, const char *name, int *lenp)
1894EXPORT_SYMBOL(get_property); 1866EXPORT_SYMBOL(get_property);
1895 1867
1896/* 1868/*
1897 * Add a property to a node 1869 * Add a property to a node.
1898 */ 1870 */
1899void 1871int
1900prom_add_property(struct device_node* np, struct property* prop) 1872prom_add_property(struct device_node* np, struct property* prop)
1901{ 1873{
1902 struct property **next = &np->properties; 1874 struct property **next;
1903 1875
1904 prop->next = NULL; 1876 prop->next = NULL;
1905 while (*next) 1877 write_lock(&devtree_lock);
1878 next = &np->properties;
1879 while (*next) {
1880 if (strcmp(prop->name, (*next)->name) == 0) {
1881 /* duplicate ! don't insert it */
1882 write_unlock(&devtree_lock);
1883 return -1;
1884 }
1906 next = &(*next)->next; 1885 next = &(*next)->next;
1886 }
1907 *next = prop; 1887 *next = prop;
1888 write_unlock(&devtree_lock);
1889
1890 /* try to add to proc as well if it was initialized */
1891 if (np->pde)
1892 proc_device_tree_add_prop(np->pde, prop);
1893
1894 return 0;
1908} 1895}
1909 1896
1910#if 0 1897#if 0
diff --git a/arch/ppc64/kernel/prom_init.c b/arch/ppc64/kernel/prom_init.c
index 69924ba4d7d9..e4c880dab997 100644
--- a/arch/ppc64/kernel/prom_init.c
+++ b/arch/ppc64/kernel/prom_init.c
@@ -44,7 +44,6 @@
44#include <asm/pgtable.h> 44#include <asm/pgtable.h>
45#include <asm/pci.h> 45#include <asm/pci.h>
46#include <asm/iommu.h> 46#include <asm/iommu.h>
47#include <asm/ppcdebug.h>
48#include <asm/btext.h> 47#include <asm/btext.h>
49#include <asm/sections.h> 48#include <asm/sections.h>
50#include <asm/machdep.h> 49#include <asm/machdep.h>
@@ -1825,7 +1824,7 @@ static void __init fixup_device_tree(void)
1825 if (prom_getprop(u3, "device-rev", &u3_rev, sizeof(u3_rev)) 1824 if (prom_getprop(u3, "device-rev", &u3_rev, sizeof(u3_rev))
1826 == PROM_ERROR) 1825 == PROM_ERROR)
1827 return; 1826 return;
1828 if (u3_rev != 0x35 && u3_rev != 0x37) 1827 if (u3_rev < 0x35 || u3_rev > 0x39)
1829 return; 1828 return;
1830 /* does it need fixup ? */ 1829 /* does it need fixup ? */
1831 if (prom_getproplen(i2c, "interrupts") > 0) 1830 if (prom_getproplen(i2c, "interrupts") > 0)
@@ -1939,9 +1938,9 @@ unsigned long __init prom_init(unsigned long r3, unsigned long r4, unsigned long
1939 prom_send_capabilities(); 1938 prom_send_capabilities();
1940 1939
1941 /* 1940 /*
1942 * On pSeries and BPA, copy the CPU hold code 1941 * On pSeries and Cell, copy the CPU hold code
1943 */ 1942 */
1944 if (RELOC(of_platform) & (PLATFORM_PSERIES | PLATFORM_BPA)) 1943 if (RELOC(of_platform) & (PLATFORM_PSERIES | PLATFORM_CELL))
1945 copy_and_flush(0, KERNELBASE - offset, 0x100, 0); 1944 copy_and_flush(0, KERNELBASE - offset, 0x100, 0);
1946 1945
1947 /* 1946 /*
diff --git a/arch/ppc64/kernel/rtas_pci.c b/arch/ppc64/kernel/rtas_pci.c
index 3ad15c90fbbd..3c3f19192fcc 100644
--- a/arch/ppc64/kernel/rtas_pci.c
+++ b/arch/ppc64/kernel/rtas_pci.c
@@ -440,7 +440,6 @@ struct pci_controller * __devinit init_phb_dynamic(struct device_node *dn)
440 struct device_node *root = of_find_node_by_path("/"); 440 struct device_node *root = of_find_node_by_path("/");
441 unsigned int root_size_cells = 0; 441 unsigned int root_size_cells = 0;
442 struct pci_controller *phb; 442 struct pci_controller *phb;
443 struct pci_bus *bus;
444 int primary; 443 int primary;
445 444
446 root_size_cells = prom_n_size_cells(root); 445 root_size_cells = prom_n_size_cells(root);
@@ -456,10 +455,7 @@ struct pci_controller * __devinit init_phb_dynamic(struct device_node *dn)
456 of_node_put(root); 455 of_node_put(root);
457 456
458 pci_devs_phb_init_dynamic(phb); 457 pci_devs_phb_init_dynamic(phb);
459 phb->last_busno = 0xff; 458 scan_phb(phb);
460 bus = pci_scan_bus(phb->first_busno, phb->ops, phb->arch_data);
461 phb->bus = bus;
462 phb->last_busno = bus->subordinate;
463 459
464 return phb; 460 return phb;
465} 461}
diff --git a/arch/ppc64/kernel/scanlog.c b/arch/ppc64/kernel/scanlog.c
index 215bf8900304..2edc947f7c44 100644
--- a/arch/ppc64/kernel/scanlog.c
+++ b/arch/ppc64/kernel/scanlog.c
@@ -225,8 +225,7 @@ int __init scanlog_init(void)
225void __exit scanlog_cleanup(void) 225void __exit scanlog_cleanup(void)
226{ 226{
227 if (proc_ppc64_scan_log_dump) { 227 if (proc_ppc64_scan_log_dump) {
228 if (proc_ppc64_scan_log_dump->data) 228 kfree(proc_ppc64_scan_log_dump->data);
229 kfree(proc_ppc64_scan_log_dump->data);
230 remove_proc_entry("scan-log-dump", proc_ppc64_scan_log_dump->parent); 229 remove_proc_entry("scan-log-dump", proc_ppc64_scan_log_dump->parent);
231 } 230 }
232} 231}
diff --git a/arch/ppc64/kernel/sysfs.c b/arch/ppc64/kernel/sysfs.c
index 6654b350979c..e99ec62c2c52 100644
--- a/arch/ppc64/kernel/sysfs.c
+++ b/arch/ppc64/kernel/sysfs.c
@@ -20,6 +20,7 @@
20#include <asm/paca.h> 20#include <asm/paca.h>
21#include <asm/lppaca.h> 21#include <asm/lppaca.h>
22#include <asm/machdep.h> 22#include <asm/machdep.h>
23#include <asm/smp.h>
23 24
24static DEFINE_PER_CPU(struct cpu, cpu_devices); 25static DEFINE_PER_CPU(struct cpu, cpu_devices);
25 26
diff --git a/arch/ppc64/kernel/udbg.c b/arch/ppc64/kernel/udbg.c
index d49c3613c8ec..0d878e72fc44 100644
--- a/arch/ppc64/kernel/udbg.c
+++ b/arch/ppc64/kernel/udbg.c
@@ -10,12 +10,10 @@
10 */ 10 */
11 11
12#include <stdarg.h> 12#include <stdarg.h>
13#define WANT_PPCDBG_TAB /* Only defined here */
14#include <linux/config.h> 13#include <linux/config.h>
15#include <linux/types.h> 14#include <linux/types.h>
16#include <linux/sched.h> 15#include <linux/sched.h>
17#include <linux/console.h> 16#include <linux/console.h>
18#include <asm/ppcdebug.h>
19#include <asm/processor.h> 17#include <asm/processor.h>
20 18
21void (*udbg_putc)(unsigned char c); 19void (*udbg_putc)(unsigned char c);
@@ -89,59 +87,6 @@ void udbg_printf(const char *fmt, ...)
89 va_end(args); 87 va_end(args);
90} 88}
91 89
92/* PPCDBG stuff */
93
94u64 ppc64_debug_switch;
95
96/* Special print used by PPCDBG() macro */
97void udbg_ppcdbg(unsigned long debug_flags, const char *fmt, ...)
98{
99 unsigned long active_debugs = debug_flags & ppc64_debug_switch;
100
101 if (active_debugs) {
102 va_list ap;
103 unsigned char buf[UDBG_BUFSIZE];
104 unsigned long i, len = 0;
105
106 for (i=0; i < PPCDBG_NUM_FLAGS; i++) {
107 if (((1U << i) & active_debugs) &&
108 trace_names[i]) {
109 len += strlen(trace_names[i]);
110 udbg_puts(trace_names[i]);
111 break;
112 }
113 }
114
115 snprintf(buf, UDBG_BUFSIZE, " [%s]: ", current->comm);
116 len += strlen(buf);
117 udbg_puts(buf);
118
119 while (len < 18) {
120 udbg_puts(" ");
121 len++;
122 }
123
124 va_start(ap, fmt);
125 vsnprintf(buf, UDBG_BUFSIZE, fmt, ap);
126 udbg_puts(buf);
127 va_end(ap);
128 }
129}
130
131unsigned long udbg_ifdebug(unsigned long flags)
132{
133 return (flags & ppc64_debug_switch);
134}
135
136/*
137 * Initialize the PPCDBG state. Called before relocation has been enabled.
138 */
139void __init ppcdbg_initialize(void)
140{
141 ppc64_debug_switch = PPC_DEBUG_DEFAULT; /* | PPCDBG_BUSWALK | */
142 /* PPCDBG_PHBINIT | PPCDBG_MM | PPCDBG_MMINIT | PPCDBG_TCEINIT | PPCDBG_TCE */;
143}
144
145/* 90/*
146 * Early boot console based on udbg 91 * Early boot console based on udbg
147 */ 92 */
diff --git a/arch/ppc64/kernel/udbg_scc.c b/arch/ppc64/kernel/udbg_scc.c
index c47fd6c63531..820c53551507 100644
--- a/arch/ppc64/kernel/udbg_scc.c
+++ b/arch/ppc64/kernel/udbg_scc.c
@@ -12,7 +12,6 @@
12#include <linux/types.h> 12#include <linux/types.h>
13#include <asm/udbg.h> 13#include <asm/udbg.h>
14#include <asm/processor.h> 14#include <asm/processor.h>
15#include <asm/naca.h>
16#include <asm/io.h> 15#include <asm/io.h>
17#include <asm/prom.h> 16#include <asm/prom.h>
18#include <asm/pmac_feature.h> 17#include <asm/pmac_feature.h>
diff --git a/arch/ppc64/lib/Makefile b/arch/ppc64/lib/Makefile
deleted file mode 100644
index 42d5295bf345..000000000000
--- a/arch/ppc64/lib/Makefile
+++ /dev/null
@@ -1,5 +0,0 @@
1#
2# Makefile for ppc64-specific library files..
3#
4
5lib-y := string.o
diff --git a/arch/ppc64/lib/string.S b/arch/ppc64/lib/string.S
deleted file mode 100644
index e21a0038a4d6..000000000000
--- a/arch/ppc64/lib/string.S
+++ /dev/null
@@ -1,179 +0,0 @@
1/*
2 * String handling functions for PowerPC.
3 *
4 * Copyright (C) 1996 Paul Mackerras.
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 <asm/processor.h>
12#include <asm/errno.h>
13#include <asm/ppc_asm.h>
14
15_GLOBAL(strcpy)
16 addi r5,r3,-1
17 addi r4,r4,-1
181: lbzu r0,1(r4)
19 cmpwi 0,r0,0
20 stbu r0,1(r5)
21 bne 1b
22 blr
23
24_GLOBAL(strncpy)
25 cmpwi 0,r5,0
26 beqlr
27 mtctr r5
28 addi r6,r3,-1
29 addi r4,r4,-1
301: lbzu r0,1(r4)
31 cmpwi 0,r0,0
32 stbu r0,1(r6)
33 bdnzf 2,1b /* dec ctr, branch if ctr != 0 && !cr0.eq */
34 blr
35
36_GLOBAL(strcat)
37 addi r5,r3,-1
38 addi r4,r4,-1
391: lbzu r0,1(r5)
40 cmpwi 0,r0,0
41 bne 1b
42 addi r5,r5,-1
431: lbzu r0,1(r4)
44 cmpwi 0,r0,0
45 stbu r0,1(r5)
46 bne 1b
47 blr
48
49_GLOBAL(strcmp)
50 addi r5,r3,-1
51 addi r4,r4,-1
521: lbzu r3,1(r5)
53 cmpwi 1,r3,0
54 lbzu r0,1(r4)
55 subf. r3,r0,r3
56 beqlr 1
57 beq 1b
58 blr
59
60_GLOBAL(strlen)
61 addi r4,r3,-1
621: lbzu r0,1(r4)
63 cmpwi 0,r0,0
64 bne 1b
65 subf r3,r3,r4
66 blr
67
68_GLOBAL(memcmp)
69 cmpwi 0,r5,0
70 ble- 2f
71 mtctr r5
72 addi r6,r3,-1
73 addi r4,r4,-1
741: lbzu r3,1(r6)
75 lbzu r0,1(r4)
76 subf. r3,r0,r3
77 bdnzt 2,1b
78 blr
792: li r3,0
80 blr
81
82_GLOBAL(memchr)
83 cmpwi 0,r5,0
84 ble- 2f
85 mtctr r5
86 addi r3,r3,-1
871: lbzu r0,1(r3)
88 cmpw 0,r0,r4
89 bdnzf 2,1b
90 beqlr
912: li r3,0
92 blr
93
94_GLOBAL(__clear_user)
95 addi r6,r3,-4
96 li r3,0
97 li r5,0
98 cmplwi 0,r4,4
99 blt 7f
100 /* clear a single word */
10111: stwu r5,4(r6)
102 beqlr
103 /* clear word sized chunks */
104 andi. r0,r6,3
105 add r4,r0,r4
106 subf r6,r0,r6
107 srwi r0,r4,2
108 andi. r4,r4,3
109 mtctr r0
110 bdz 7f
1111: stwu r5,4(r6)
112 bdnz 1b
113 /* clear byte sized chunks */
1147: cmpwi 0,r4,0
115 beqlr
116 mtctr r4
117 addi r6,r6,3
1188: stbu r5,1(r6)
119 bdnz 8b
120 blr
12190: mr r3,r4
122 blr
12391: mfctr r3
124 slwi r3,r3,2
125 add r3,r3,r4
126 blr
12792: mfctr r3
128 blr
129
130 .section __ex_table,"a"
131 .align 3
132 .llong 11b,90b
133 .llong 1b,91b
134 .llong 8b,92b
135 .text
136
137/* r3 = dst, r4 = src, r5 = count */
138_GLOBAL(__strncpy_from_user)
139 addi r6,r3,-1
140 addi r4,r4,-1
141 cmpwi 0,r5,0
142 beq 2f
143 mtctr r5
1441: lbzu r0,1(r4)
145 cmpwi 0,r0,0
146 stbu r0,1(r6)
147 bdnzf 2,1b /* dec ctr, branch if ctr != 0 && !cr0.eq */
148 beq 3f
1492: addi r6,r6,1
1503: subf r3,r3,r6
151 blr
15299: li r3,-EFAULT
153 blr
154
155 .section __ex_table,"a"
156 .align 3
157 .llong 1b,99b
158 .text
159
160/* r3 = str, r4 = len (> 0) */
161_GLOBAL(__strnlen_user)
162 addi r7,r3,-1
163 mtctr r4 /* ctr = len */
1641: lbzu r0,1(r7) /* get next byte */
165 cmpwi 0,r0,0
166 bdnzf 2,1b /* loop if --ctr != 0 && byte != 0 */
167 addi r7,r7,1
168 subf r3,r3,r7 /* number of bytes we have looked at */
169 beqlr /* return if we found a 0 byte */
170 cmpw 0,r3,r4 /* did we look at all len bytes? */
171 blt 99f /* if not, must have hit top */
172 addi r3,r4,1 /* return len + 1 to indicate no null found */
173 blr
17499: li r3,0 /* bad address, return 0 */
175 blr
176
177 .section __ex_table,"a"
178 .align 3
179 .llong 1b,99b
diff --git a/arch/s390/Makefile b/arch/s390/Makefile
index 98db30481d97..73a09a6ee6c8 100644
--- a/arch/s390/Makefile
+++ b/arch/s390/Makefile
@@ -76,9 +76,7 @@ AFLAGS += $(aflags-y)
76OBJCOPYFLAGS := -O binary 76OBJCOPYFLAGS := -O binary
77LDFLAGS_vmlinux := -e start 77LDFLAGS_vmlinux := -e start
78 78
79head-$(CONFIG_ARCH_S390_31) += arch/$(ARCH)/kernel/head.o 79head-y := arch/$(ARCH)/kernel/head.o arch/$(ARCH)/kernel/init_task.o
80head-$(CONFIG_ARCH_S390X) += arch/$(ARCH)/kernel/head64.o
81head-y += arch/$(ARCH)/kernel/init_task.o
82 80
83core-y += arch/$(ARCH)/mm/ arch/$(ARCH)/kernel/ arch/$(ARCH)/crypto/ \ 81core-y += arch/$(ARCH)/mm/ arch/$(ARCH)/kernel/ arch/$(ARCH)/crypto/ \
84 arch/$(ARCH)/appldata/ 82 arch/$(ARCH)/appldata/
diff --git a/arch/s390/appldata/appldata_base.c b/arch/s390/appldata/appldata_base.c
index c9f2f60cfa58..dee6ab54984d 100644
--- a/arch/s390/appldata/appldata_base.c
+++ b/arch/s390/appldata/appldata_base.c
@@ -592,12 +592,15 @@ int appldata_register_ops(struct appldata_ops *ops)
592 */ 592 */
593void appldata_unregister_ops(struct appldata_ops *ops) 593void appldata_unregister_ops(struct appldata_ops *ops)
594{ 594{
595 void *table;
595 spin_lock(&appldata_ops_lock); 596 spin_lock(&appldata_ops_lock);
596 unregister_sysctl_table(ops->sysctl_header);
597 list_del(&ops->list); 597 list_del(&ops->list);
598 kfree(ops->ctl_table); 598 /* at that point any incoming access will fail */
599 table = ops->ctl_table;
599 ops->ctl_table = NULL; 600 ops->ctl_table = NULL;
600 spin_unlock(&appldata_ops_lock); 601 spin_unlock(&appldata_ops_lock);
602 unregister_sysctl_table(ops->sysctl_header);
603 kfree(table);
601 P_INFO("%s-ops unregistered!\n", ops->name); 604 P_INFO("%s-ops unregistered!\n", ops->name);
602} 605}
603/********************** module-ops management <END> **************************/ 606/********************** module-ops management <END> **************************/
diff --git a/arch/s390/kernel/Makefile b/arch/s390/kernel/Makefile
index 8584dd823218..7434c32bc631 100644
--- a/arch/s390/kernel/Makefile
+++ b/arch/s390/kernel/Makefile
@@ -8,9 +8,7 @@ obj-y := bitmap.o traps.o time.o process.o \
8 setup.o sys_s390.o ptrace.o signal.o cpcmd.o ebcdic.o \ 8 setup.o sys_s390.o ptrace.o signal.o cpcmd.o ebcdic.o \
9 semaphore.o s390_ext.o debug.o profile.o irq.o reipl_diag.o 9 semaphore.o s390_ext.o debug.o profile.o irq.o reipl_diag.o
10 10
11extra-$(CONFIG_ARCH_S390_31) += head.o 11extra-y += head.o init_task.o vmlinux.lds
12extra-$(CONFIG_ARCH_S390X) += head64.o
13extra-y += init_task.o vmlinux.lds
14 12
15obj-$(CONFIG_MODULES) += s390_ksyms.o module.o 13obj-$(CONFIG_MODULES) += s390_ksyms.o module.o
16obj-$(CONFIG_SMP) += smp.o 14obj-$(CONFIG_SMP) += smp.o
diff --git a/arch/s390/kernel/debug.c b/arch/s390/kernel/debug.c
index bc59282da762..896d39d0e4ce 100644
--- a/arch/s390/kernel/debug.c
+++ b/arch/s390/kernel/debug.c
@@ -486,7 +486,7 @@ out:
486 * - goto next entry in p_info 486 * - goto next entry in p_info
487 */ 487 */
488 488
489extern inline int 489static inline int
490debug_next_entry(file_private_info_t *p_info) 490debug_next_entry(file_private_info_t *p_info)
491{ 491{
492 debug_info_t *id; 492 debug_info_t *id;
@@ -800,7 +800,7 @@ debug_set_level(debug_info_t* id, int new_level)
800 * - set active entry to next in the ring buffer 800 * - set active entry to next in the ring buffer
801 */ 801 */
802 802
803extern inline void 803static inline void
804proceed_active_entry(debug_info_t * id) 804proceed_active_entry(debug_info_t * id)
805{ 805{
806 if ((id->active_entries[id->active_area] += id->entry_size) 806 if ((id->active_entries[id->active_area] += id->entry_size)
@@ -817,7 +817,7 @@ proceed_active_entry(debug_info_t * id)
817 * - set active area to next in the ring buffer 817 * - set active area to next in the ring buffer
818 */ 818 */
819 819
820extern inline void 820static inline void
821proceed_active_area(debug_info_t * id) 821proceed_active_area(debug_info_t * id)
822{ 822{
823 id->active_area++; 823 id->active_area++;
@@ -828,7 +828,7 @@ proceed_active_area(debug_info_t * id)
828 * get_active_entry: 828 * get_active_entry:
829 */ 829 */
830 830
831extern inline debug_entry_t* 831static inline debug_entry_t*
832get_active_entry(debug_info_t * id) 832get_active_entry(debug_info_t * id)
833{ 833{
834 return (debug_entry_t *) (((char *) id->areas[id->active_area] 834 return (debug_entry_t *) (((char *) id->areas[id->active_area]
@@ -841,7 +841,7 @@ get_active_entry(debug_info_t * id)
841 * - set timestamp, caller address, cpu number etc. 841 * - set timestamp, caller address, cpu number etc.
842 */ 842 */
843 843
844extern inline void 844static inline void
845debug_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,
846 int exception) 846 int exception)
847{ 847{
@@ -971,7 +971,7 @@ debug_entry_t
971 * counts arguments in format string for sprintf view 971 * counts arguments in format string for sprintf view
972 */ 972 */
973 973
974extern inline int 974static inline int
975debug_count_numargs(char *string) 975debug_count_numargs(char *string)
976{ 976{
977 int numargs=0; 977 int numargs=0;
diff --git a/arch/s390/kernel/entry.S b/arch/s390/kernel/entry.S
index 9b30f4cf32c4..27b07730b7b8 100644
--- a/arch/s390/kernel/entry.S
+++ b/arch/s390/kernel/entry.S
@@ -288,7 +288,7 @@ sysc_sigpending:
288 bo BASED(sysc_restart) 288 bo BASED(sysc_restart)
289 tm __TI_flags+3(%r9),_TIF_SINGLE_STEP 289 tm __TI_flags+3(%r9),_TIF_SINGLE_STEP
290 bo BASED(sysc_singlestep) 290 bo BASED(sysc_singlestep)
291 b BASED(sysc_leave) # out of here, do NOT recheck 291 b BASED(sysc_work_loop)
292 292
293# 293#
294# _TIF_RESTART_SVC is set, set up registers and restart svc 294# _TIF_RESTART_SVC is set, set up registers and restart svc
@@ -645,7 +645,7 @@ io_sigpending:
645 l %r1,BASED(.Ldo_signal) 645 l %r1,BASED(.Ldo_signal)
646 basr %r14,%r1 # call do_signal 646 basr %r14,%r1 # call do_signal
647 stnsm __SF_EMPTY(%r15),0xfc # disable I/O and ext. interrupts 647 stnsm __SF_EMPTY(%r15),0xfc # disable I/O and ext. interrupts
648 b BASED(io_leave) # out of here, do NOT recheck 648 b BASED(io_work_loop)
649 649
650/* 650/*
651 * External interrupt handler routine 651 * External interrupt handler routine
diff --git a/arch/s390/kernel/entry64.S b/arch/s390/kernel/entry64.S
index 7b9b4a2ba1d7..4eb71ffcf484 100644
--- a/arch/s390/kernel/entry64.S
+++ b/arch/s390/kernel/entry64.S
@@ -283,7 +283,7 @@ sysc_sigpending:
283 jo sysc_restart 283 jo sysc_restart
284 tm __TI_flags+7(%r9),_TIF_SINGLE_STEP 284 tm __TI_flags+7(%r9),_TIF_SINGLE_STEP
285 jo sysc_singlestep 285 jo sysc_singlestep
286 j sysc_leave # out of here, do NOT recheck 286 j sysc_work_loop
287 287
288# 288#
289# _TIF_RESTART_SVC is set, set up registers and restart svc 289# _TIF_RESTART_SVC is set, set up registers and restart svc
@@ -684,7 +684,7 @@ io_sigpending:
684 slgr %r3,%r3 # clear *oldset 684 slgr %r3,%r3 # clear *oldset
685 brasl %r14,do_signal # call do_signal 685 brasl %r14,do_signal # call do_signal
686 stnsm __SF_EMPTY(%r15),0xfc # disable I/O and ext. interrupts 686 stnsm __SF_EMPTY(%r15),0xfc # disable I/O and ext. interrupts
687 j sysc_leave # out of here, do NOT recheck 687 j io_work_loop
688 688
689/* 689/*
690 * External interrupt handler routine 690 * External interrupt handler routine
diff --git a/arch/s390/kernel/head.S b/arch/s390/kernel/head.S
index 039354d72348..d31a97c89f68 100644
--- a/arch/s390/kernel/head.S
+++ b/arch/s390/kernel/head.S
@@ -1,11 +1,12 @@
1/* 1/*
2 * arch/s390/kernel/head.S 2 * arch/s390/kernel/head.S
3 * 3 *
4 * S390 version 4 * (C) Copyright IBM Corp. 1999, 2005
5 * Copyright (C) 1999,2000 IBM Deutschland Entwicklung GmbH, IBM Corporation 5 *
6 * Author(s): Hartmut Penner (hp@de.ibm.com), 6 * Author(s): Hartmut Penner <hp@de.ibm.com>
7 * Martin Schwidefsky (schwidefsky@de.ibm.com), 7 * Martin Schwidefsky <schwidefsky@de.ibm.com>
8 * Rob van der Heij (rvdhei@iae.nl) 8 * Rob van der Heij <rvdhei@iae.nl>
9 * Heiko Carstens <heiko.carstens@de.ibm.com>
9 * 10 *
10 * There are 5 different IPL methods 11 * There are 5 different IPL methods
11 * 1) load the image directly into ram at address 0 and do an PSW restart 12 * 1) load the image directly into ram at address 0 and do an PSW restart
@@ -19,12 +20,7 @@
19 * 5) direct call of start by the SALIPL loader 20 * 5) direct call of start by the SALIPL loader
20 * We use the cpuid to distinguish between VM and native ipl 21 * We use the cpuid to distinguish between VM and native ipl
21 * params for kernel are pushed to 0x10400 (see setup.h) 22 * params for kernel are pushed to 0x10400 (see setup.h)
22 23 *
23 Changes:
24 Okt 25 2000 <rvdheij@iae.nl>
25 added code to skip HDR and EOF to allow SL tape IPL (5 retries)
26 changed first CCW from rewind to backspace block
27
28 */ 24 */
29 25
30#include <linux/config.h> 26#include <linux/config.h>
@@ -34,6 +30,12 @@
34#include <asm/thread_info.h> 30#include <asm/thread_info.h>
35#include <asm/page.h> 31#include <asm/page.h>
36 32
33#ifdef CONFIG_ARCH_S390X
34#define ARCH_OFFSET 4
35#else
36#define ARCH_OFFSET 0
37#endif
38
37#ifndef CONFIG_IPL 39#ifndef CONFIG_IPL
38 .org 0 40 .org 0
39 .long 0x00080000,0x80000000+startup # Just a restart PSW 41 .long 0x00080000,0x80000000+startup # Just a restart PSW
@@ -201,7 +203,7 @@
201 ssch 0(%r3) # load chunk of 1600 bytes 203 ssch 0(%r3) # load chunk of 1600 bytes
202 bnz .Llderr 204 bnz .Llderr
203.Lwait4irq: 205.Lwait4irq:
204 mvc __LC_IO_NEW_PSW(8),.Lnewpsw # set up IO interrupt psw 206 mvc 0x78(8),.Lnewpsw # set up IO interrupt psw
205 lpsw .Lwaitpsw 207 lpsw .Lwaitpsw
206.Lioint: 208.Lioint:
207 c %r1,0xb8 # compare subchannel number 209 c %r1,0xb8 # compare subchannel number
@@ -265,13 +267,13 @@ iplstart:
265 la %r2,IPL_BS # load start address 267 la %r2,IPL_BS # load start address
266 bas %r14,.Lloader # load rest of ipl image 268 bas %r14,.Lloader # load rest of ipl image
267 l %r12,.Lparm # pointer to parameter area 269 l %r12,.Lparm # pointer to parameter area
268 st %r1,IPL_DEVICE-PARMAREA(%r12) # store ipl device number 270 st %r1,IPL_DEVICE+ARCH_OFFSET-PARMAREA(%r12) # save ipl device number
269 271
270# 272#
271# load parameter file from ipl device 273# load parameter file from ipl device
272# 274#
273.Lagain1: 275.Lagain1:
274 l %r2,INITRD_START-PARMAREA(%r12) # use ramdisk location as temp 276 l %r2,INITRD_START+ARCH_OFFSET-PARMAREA(%r12) # ramdisk loc. is temp
275 bas %r14,.Lloader # load parameter file 277 bas %r14,.Lloader # load parameter file
276 ltr %r2,%r2 # got anything ? 278 ltr %r2,%r2 # got anything ?
277 bz .Lnopf 279 bz .Lnopf
@@ -279,7 +281,7 @@ iplstart:
279 bnh .Lnotrunc 281 bnh .Lnotrunc
280 la %r2,895 282 la %r2,895
281.Lnotrunc: 283.Lnotrunc:
282 l %r4,INITRD_START-PARMAREA(%r12) 284 l %r4,INITRD_START+ARCH_OFFSET-PARMAREA(%r12)
283 clc 0(3,%r4),.L_hdr # if it is HDRx 285 clc 0(3,%r4),.L_hdr # if it is HDRx
284 bz .Lagain1 # skip dataset header 286 bz .Lagain1 # skip dataset header
285 clc 0(3,%r4),.L_eof # if it is EOFx 287 clc 0(3,%r4),.L_eof # if it is EOFx
@@ -322,14 +324,14 @@ iplstart:
322# load ramdisk from ipl device 324# load ramdisk from ipl device
323# 325#
324.Lagain2: 326.Lagain2:
325 l %r2,INITRD_START-PARMAREA(%r12) # load adr. of ramdisk 327 l %r2,INITRD_START+ARCH_OFFSET-PARMAREA(%r12) # addr of ramdisk
326 bas %r14,.Lloader # load ramdisk 328 bas %r14,.Lloader # load ramdisk
327 st %r2,INITRD_SIZE-PARMAREA(%r12) # store size of ramdisk 329 st %r2,INITRD_SIZE+ARCH_OFFSET-PARMAREA(%r12) # store size of ramdisk
328 ltr %r2,%r2 330 ltr %r2,%r2
329 bnz .Lrdcont 331 bnz .Lrdcont
330 st %r2,INITRD_START-PARMAREA(%r12) # no ramdisk found, null it 332 st %r2,INITRD_START+ARCH_OFFSET-PARMAREA(%r12) # no ramdisk found
331.Lrdcont: 333.Lrdcont:
332 l %r2,INITRD_START-PARMAREA(%r12) 334 l %r2,INITRD_START+ARCH_OFFSET-PARMAREA(%r12)
333 335
334 clc 0(3,%r2),.L_hdr # skip HDRx and EOFx 336 clc 0(3,%r2),.L_hdr # skip HDRx and EOFx
335 bz .Lagain2 337 bz .Lagain2
@@ -432,10 +434,10 @@ start:
432 la %r3,1(%r3) 434 la %r3,1(%r3)
433.done: 435.done:
434 l %r1,.memsize 436 l %r1,.memsize
435 st %r3,0(%r1) 437 st %r3,ARCH_OFFSET(%r1)
436 slr %r0,%r0 438 slr %r0,%r0
437 st %r0,INITRD_SIZE-PARMAREA(%r11) 439 st %r0,INITRD_SIZE+ARCH_OFFSET-PARMAREA(%r11)
438 st %r0,INITRD_START-PARMAREA(%r11) 440 st %r0,INITRD_START+ARCH_OFFSET-PARMAREA(%r11)
439 j startup # continue with startup 441 j startup # continue with startup
440.tbl: .long _ebcasc # translate table 442.tbl: .long _ebcasc # translate table
441.cmd: .long COMMAND_LINE # address of command line buffer 443.cmd: .long COMMAND_LINE # address of command line buffer
@@ -478,304 +480,23 @@ start:
478 .byte 0xf0,0xf1,0xf2,0xf3,0xf4,0xf5,0xf6,0xf7 480 .byte 0xf0,0xf1,0xf2,0xf3,0xf4,0xf5,0xf6,0xf7
479 .byte 0xf8,0xf9,0xfa,0xfb,0xfc,0xfd,0xfe,0xff 481 .byte 0xf8,0xf9,0xfa,0xfb,0xfc,0xfd,0xfe,0xff
480 482
481# 483.macro GET_IPL_DEVICE
482# startup-code at 0x10000, running in real mode
483# this is called either by the ipl loader or directly by PSW restart
484# or linload or SALIPL
485#
486 .org 0x10000
487startup:basr %r13,0 # get base
488.LPG1: l %r1, .Lget_ipl_device_addr-.LPG1(%r13)
489 basr %r14, %r1
490 lctl %c0,%c15,.Lctl-.LPG1(%r13) # load control registers
491 la %r12,_pstart-.LPG1(%r13) # pointer to parameter area
492 # move IPL device to lowcore
493 mvc __LC_IPLDEV(4),IPL_DEVICE-PARMAREA(%r12)
494
495#
496# clear bss memory
497#
498 l %r2,.Lbss_bgn-.LPG1(%r13) # start of bss
499 l %r3,.Lbss_end-.LPG1(%r13) # end of bss
500 sr %r3,%r2 # length of bss
501 sr %r4,%r4 #
502 sr %r5,%r5 # set src,length and pad to zero
503 sr %r0,%r0 #
504 mvcle %r2,%r4,0 # clear mem
505 jo .-4 # branch back, if not finish
506
507 l %r2,.Lrcp-.LPG1(%r13) # Read SCP forced command word
508.Lservicecall:
509 stosm .Lpmask-.LPG1(%r13),0x01 # authorize ext interrupts
510
511 stctl %r0, %r0,.Lcr-.LPG1(%r13) # get cr0
512 la %r1,0x200 # set bit 22
513 o %r1,.Lcr-.LPG1(%r13) # or old cr0 with r1
514 st %r1,.Lcr-.LPG1(%r13)
515 lctl %r0, %r0,.Lcr-.LPG1(%r13) # load modified cr0
516
517 mvc __LC_EXT_NEW_PSW(8),.Lpcext-.LPG1(%r13) # set postcall psw
518 la %r1, .Lsclph-.LPG1(%r13)
519 a %r1,__LC_EXT_NEW_PSW+4 # set handler
520 st %r1,__LC_EXT_NEW_PSW+4
521
522 la %r4,_pstart-.LPG1(%r13) # %r4 is our index for sccb stuff
523 la %r1, .Lsccb-PARMAREA(%r4) # our sccb
524 .insn rre,0xb2200000,%r2,%r1 # service call
525 ipm %r1
526 srl %r1,28 # get cc code
527 xr %r3, %r3
528 chi %r1,3
529 be .Lfchunk-.LPG1(%r13) # leave
530 chi %r1,2
531 be .Lservicecall-.LPG1(%r13)
532 lpsw .Lwaitsclp-.LPG1(%r13)
533.Lsclph:
534 lh %r1,.Lsccbr-PARMAREA(%r4)
535 chi %r1,0x10 # 0x0010 is the sucess code
536 je .Lprocsccb # let's process the sccb
537 chi %r1,0x1f0
538 bne .Lfchunk-.LPG1(%r13) # unhandled error code
539 c %r2, .Lrcp-.LPG1(%r13) # Did we try Read SCP forced
540 bne .Lfchunk-.LPG1(%r13) # if no, give up
541 l %r2, .Lrcp2-.LPG1(%r13) # try with Read SCP
542 b .Lservicecall-.LPG1(%r13)
543.Lprocsccb:
544 lhi %r1,0
545 icm %r1,3,.Lscpincr1-PARMAREA(%r4) # use this one if != 0
546 jnz .Lscnd
547 lhi %r1,0x800 # otherwise report 2GB
548.Lscnd:
549 lhi %r3,0x800 # limit reported memory size to 2GB
550 cr %r1,%r3
551 jl .Lno2gb
552 lr %r1,%r3
553.Lno2gb:
554 xr %r3,%r3 # same logic
555 ic %r3,.Lscpa1-PARMAREA(%r4)
556 chi %r3,0x00
557 jne .Lcompmem
558 l %r3,.Lscpa2-PARMAREA(%r13)
559.Lcompmem:
560 mr %r2,%r1 # mem in MB on 128-bit
561 l %r1,.Lonemb-.LPG1(%r13)
562 mr %r2,%r1 # mem size in bytes in %r3
563 b .Lfchunk-.LPG1(%r13)
564
565 .align 4
566.Lget_ipl_device_addr:
567 .long .Lget_ipl_device
568.Lpmask:
569 .byte 0
570.align 8
571.Lpcext:.long 0x00080000,0x80000000
572.Lcr:
573 .long 0x00 # place holder for cr0
574.Lwaitsclp:
575 .long 0x020A0000
576 .long .Lsclph
577.Lrcp:
578 .int 0x00120001 # Read SCP forced code
579.Lrcp2:
580 .int 0x00020001 # Read SCP code
581.Lonemb:
582 .int 0x100000
583.Lfchunk:
584
585#
586# find memory chunks.
587#
588 lr %r9,%r3 # end of mem
589 mvc __LC_PGM_NEW_PSW(8),.Lpcmem-.LPG1(%r13)
590 la %r1,1 # test in increments of 128KB
591 sll %r1,17
592 l %r3,.Lmchunk-.LPG1(%r13) # get pointer to memory_chunk array
593 slr %r4,%r4 # set start of chunk to zero
594 slr %r5,%r5 # set end of chunk to zero
595 slr %r6,%r6 # set access code to zero
596 la %r10, MEMORY_CHUNKS # number of chunks
597.Lloop:
598 tprot 0(%r5),0 # test protection of first byte
599 ipm %r7
600 srl %r7,28
601 clr %r6,%r7 # compare cc with last access code
602 be .Lsame-.LPG1(%r13)
603 b .Lchkmem-.LPG1(%r13)
604.Lsame:
605 ar %r5,%r1 # add 128KB to end of chunk
606 bno .Lloop-.LPG1(%r13) # r1 < 0x80000000 -> loop
607.Lchkmem: # > 2GB or tprot got a program check
608 clr %r4,%r5 # chunk size > 0?
609 be .Lchkloop-.LPG1(%r13)
610 st %r4,0(%r3) # store start address of chunk
611 lr %r0,%r5
612 slr %r0,%r4
613 st %r0,4(%r3) # store size of chunk
614 st %r6,8(%r3) # store type of chunk
615 la %r3,12(%r3)
616 l %r4,.Lmemsize-.LPG1(%r13) # address of variable memory_size
617 st %r5,0(%r4) # store last end to memory size
618 ahi %r10,-1 # update chunk number
619.Lchkloop:
620 lr %r6,%r7 # set access code to last cc
621 # we got an exception or we're starting a new
622 # chunk , we must check if we should
623 # still try to find valid memory (if we detected
624 # the amount of available storage), and if we
625 # have chunks left
626 xr %r0,%r0
627 clr %r0,%r9 # did we detect memory?
628 je .Ldonemem # if not, leave
629 chi %r10,0 # do we have chunks left?
630 je .Ldonemem
631 alr %r5,%r1 # add 128KB to end of chunk
632 lr %r4,%r5 # potential new chunk
633 clr %r5,%r9 # should we go on?
634 jl .Lloop
635.Ldonemem:
636 l %r12,.Lmflags-.LPG1(%r13) # get address of machine_flags
637#
638# find out if we are running under VM
639#
640 stidp __LC_CPUID # store cpuid
641 tm __LC_CPUID,0xff # running under VM ?
642 bno .Lnovm-.LPG1(%r13)
643 oi 3(%r12),1 # set VM flag
644.Lnovm:
645 lh %r0,__LC_CPUID+4 # get cpu version
646 chi %r0,0x7490 # running on a P/390 ?
647 bne .Lnop390-.LPG1(%r13)
648 oi 3(%r12),4 # set P/390 flag
649.Lnop390:
650
651#
652# find out if we have an IEEE fpu
653#
654 mvc __LC_PGM_NEW_PSW(8),.Lpcfpu-.LPG1(%r13)
655 efpc %r0,0 # test IEEE extract fpc instruction
656 oi 3(%r12),2 # set IEEE fpu flag
657.Lchkfpu:
658
659#
660# find out if we have the CSP instruction
661#
662 mvc __LC_PGM_NEW_PSW(8),.Lpccsp-.LPG1(%r13)
663 la %r0,0
664 lr %r1,%r0
665 la %r2,4
666 csp %r0,%r2 # Test CSP instruction
667 oi 3(%r12),8 # set CSP flag
668.Lchkcsp:
669
670#
671# find out if we have the MVPG instruction
672#
673 mvc __LC_PGM_NEW_PSW(8),.Lpcmvpg-.LPG1(%r13)
674 sr %r0,%r0
675 la %r1,0
676 la %r2,0
677 mvpg %r1,%r2 # Test CSP instruction
678 oi 3(%r12),16 # set MVPG flag
679.Lchkmvpg:
680
681#
682# find out if we have the IDTE instruction
683#
684 mvc __LC_PGM_NEW_PSW(8),.Lpcidte-.LPG1(%r13)
685 .long 0xb2b10000 # store facility list
686 tm 0xc8,0x08 # check bit for clearing-by-ASCE
687 bno .Lchkidte-.LPG1(%r13)
688 lhi %r1,2094
689 lhi %r2,0
690 .long 0xb98e2001
691 oi 3(%r12),0x80 # set IDTE flag
692.Lchkidte:
693
694 lpsw .Lentry-.LPG1(13) # jump to _stext in primary-space,
695 # virtual and never return ...
696 .align 8
697.Lentry:.long 0x00080000,0x80000000 + _stext
698.Lctl: .long 0x04b50002 # cr0: various things
699 .long 0 # cr1: primary space segment table
700 .long .Lduct # cr2: dispatchable unit control table
701 .long 0 # cr3: instruction authorization
702 .long 0 # cr4: instruction authorization
703 .long 0xffffffff # cr5: primary-aste origin
704 .long 0 # cr6: I/O interrupts
705 .long 0 # cr7: secondary space segment table
706 .long 0 # cr8: access registers translation
707 .long 0 # cr9: tracing off
708 .long 0 # cr10: tracing off
709 .long 0 # cr11: tracing off
710 .long 0 # cr12: tracing off
711 .long 0 # cr13: home space segment table
712 .long 0xc0000000 # cr14: machine check handling off
713 .long 0 # cr15: linkage stack operations
714.Lpcmem:.long 0x00080000,0x80000000 + .Lchkmem
715.Lpcfpu:.long 0x00080000,0x80000000 + .Lchkfpu
716.Lpccsp:.long 0x00080000,0x80000000 + .Lchkcsp
717.Lpcmvpg:.long 0x00080000,0x80000000 + .Lchkmvpg
718.Lpcidte:.long 0x00080000,0x80000000 + .Lchkidte
719.Lmemsize:.long memory_size
720.Lmchunk:.long memory_chunk
721.Lmflags:.long machine_flags
722.Lbss_bgn: .long __bss_start
723.Lbss_end: .long _end
724
725 .org PARMAREA-64
726.Lduct: .long 0,0,0,0,0,0,0,0
727 .long 0,0,0,0,0,0,0,0
728
729#
730# params at 10400 (setup.h)
731#
732 .org PARMAREA
733 .global _pstart
734_pstart:
735 .long 0,0 # IPL_DEVICE
736 .long 0,RAMDISK_ORIGIN # INITRD_START
737 .long 0,RAMDISK_SIZE # INITRD_SIZE
738
739 .org COMMAND_LINE
740 .byte "root=/dev/ram0 ro"
741 .byte 0
742 .org 0x11000
743.Lsccb:
744 .hword 0x1000 # length, one page
745 .byte 0x00,0x00,0x00
746 .byte 0x80 # variable response bit set
747.Lsccbr:
748 .hword 0x00 # response code
749.Lscpincr1:
750 .hword 0x00
751.Lscpa1:
752 .byte 0x00
753 .fill 89,1,0
754.Lscpa2:
755 .int 0x00
756.Lscpincr2:
757 .quad 0x00
758 .fill 3984,1,0
759 .org 0x12000
760 .global _pend
761_pend:
762
763.Lget_ipl_device: 484.Lget_ipl_device:
764 basr %r12,0 485 basr %r12,0
765.LPG2: l %r1,0xb8 # get sid 486.LGID: l %r1,0xb8 # get sid
766 sll %r1,15 # test if subchannel is enabled 487 sll %r1,15 # test if subchannel is enabled
767 srl %r1,31 488 srl %r1,31
768 ltr %r1,%r1 489 ltr %r1,%r1
769 bz 0(%r14) # subchannel disabled 490 bz 0(%r14) # subchannel disabled
770 l %r1,0xb8 491 l %r1,0xb8
771 la %r5,.Lipl_schib-.LPG2(%r12) 492 la %r5,.Lipl_schib-.LGID(%r12)
772 stsch 0(%r5) # get schib of subchannel 493 stsch 0(%r5) # get schib of subchannel
773 bnz 0(%r14) # schib not available 494 bnz 0(%r14) # schib not available
774 tm 5(%r5),0x01 # devno valid? 495 tm 5(%r5),0x01 # devno valid?
775 bno 0(%r14) 496 bno 0(%r14)
776 la %r6,ipl_parameter_flags-.LPG2(%r12) 497 la %r6,ipl_parameter_flags-.LGID(%r12)
777 oi 3(%r6),0x01 # set flag 498 oi 3(%r6),0x01 # set flag
778 la %r2,ipl_devno-.LPG2(%r12) 499 la %r2,ipl_devno-.LGID(%r12)
779 mvc 0(2,%r2),6(%r5) # store devno 500 mvc 0(2,%r2),6(%r5) # store devno
780 tm 4(%r5),0x80 # qdio capable device? 501 tm 4(%r5),0x80 # qdio capable device?
781 bno 0(%r14) 502 bno 0(%r14)
@@ -816,46 +537,10 @@ ipl_parameter_flags:
816 .globl ipl_devno 537 .globl ipl_devno
817ipl_devno: 538ipl_devno:
818 .word 0 539 .word 0
540.endm
819 541
820#ifdef CONFIG_SHARED_KERNEL 542#ifdef CONFIG_ARCH_S390X
821 .org 0x100000 543#include "head64.S"
544#else
545#include "head31.S"
822#endif 546#endif
823
824#
825# startup-code, running in virtual mode
826#
827 .globl _stext
828_stext: basr %r13,0 # get base
829.LPG3:
830#
831# Setup stack
832#
833 l %r15,.Linittu-.LPG3(%r13)
834 mvc __LC_CURRENT(4),__TI_task(%r15)
835 ahi %r15,1<<(PAGE_SHIFT+THREAD_ORDER) # init_task_union + THREAD_SIZE
836 st %r15,__LC_KERNEL_STACK # set end of kernel stack
837 ahi %r15,-96
838 xc __SF_BACKCHAIN(4,%r15),__SF_BACKCHAIN(%r15) # clear backchain
839
840# check control registers
841 stctl %c0,%c15,0(%r15)
842 oi 2(%r15),0x40 # enable sigp emergency signal
843 oi 0(%r15),0x10 # switch on low address protection
844 lctl %c0,%c15,0(%r15)
845
846#
847 lam 0,15,.Laregs-.LPG3(%r13) # load access regs needed by uaccess
848 l %r14,.Lstart-.LPG3(%r13)
849 basr %r14,%r14 # call start_kernel
850#
851# We returned from start_kernel ?!? PANIK
852#
853 basr %r13,0
854 lpsw .Ldw-.(%r13) # load disabled wait psw
855#
856 .align 8
857.Ldw: .long 0x000a0000,0x00000000
858.Linittu: .long init_thread_union
859.Lstart: .long start_kernel
860.Laregs: .long 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
861
diff --git a/arch/s390/kernel/head31.S b/arch/s390/kernel/head31.S
new file mode 100644
index 000000000000..2d3b089bfb83
--- /dev/null
+++ b/arch/s390/kernel/head31.S
@@ -0,0 +1,336 @@
1/*
2 * arch/s390/kernel/head31.S
3 *
4 * (C) Copyright IBM Corp. 2005
5 *
6 * Author(s): Hartmut Penner <hp@de.ibm.com>
7 * Martin Schwidefsky <schwidefsky@de.ibm.com>
8 * Rob van der Heij <rvdhei@iae.nl>
9 * Heiko Carstens <heiko.carstens@de.ibm.com>
10 *
11 */
12
13#
14# startup-code at 0x10000, running in absolute addressing mode
15# this is called either by the ipl loader or directly by PSW restart
16# or linload or SALIPL
17#
18 .org 0x10000
19startup:basr %r13,0 # get base
20.LPG1: l %r1, .Lget_ipl_device_addr-.LPG1(%r13)
21 basr %r14, %r1
22 lctl %c0,%c15,.Lctl-.LPG1(%r13) # load control registers
23 la %r12,_pstart-.LPG1(%r13) # pointer to parameter area
24 # move IPL device to lowcore
25 mvc __LC_IPLDEV(4),IPL_DEVICE-PARMAREA(%r12)
26
27#
28# clear bss memory
29#
30 l %r2,.Lbss_bgn-.LPG1(%r13) # start of bss
31 l %r3,.Lbss_end-.LPG1(%r13) # end of bss
32 sr %r3,%r2 # length of bss
33 sr %r4,%r4
34 sr %r5,%r5 # set src,length and pad to zero
35 sr %r0,%r0
36 mvcle %r2,%r4,0 # clear mem
37 jo .-4 # branch back, if not finish
38
39 l %r2,.Lrcp-.LPG1(%r13) # Read SCP forced command word
40.Lservicecall:
41 stosm .Lpmask-.LPG1(%r13),0x01 # authorize ext interrupts
42
43 stctl %r0, %r0,.Lcr-.LPG1(%r13) # get cr0
44 la %r1,0x200 # set bit 22
45 o %r1,.Lcr-.LPG1(%r13) # or old cr0 with r1
46 st %r1,.Lcr-.LPG1(%r13)
47 lctl %r0, %r0,.Lcr-.LPG1(%r13) # load modified cr0
48
49 mvc __LC_EXT_NEW_PSW(8),.Lpcext-.LPG1(%r13) # set postcall psw
50 la %r1, .Lsclph-.LPG1(%r13)
51 a %r1,__LC_EXT_NEW_PSW+4 # set handler
52 st %r1,__LC_EXT_NEW_PSW+4
53
54 la %r4,_pstart-.LPG1(%r13) # %r4 is our index for sccb stuff
55 la %r1, .Lsccb-PARMAREA(%r4) # our sccb
56 .insn rre,0xb2200000,%r2,%r1 # service call
57 ipm %r1
58 srl %r1,28 # get cc code
59 xr %r3, %r3
60 chi %r1,3
61 be .Lfchunk-.LPG1(%r13) # leave
62 chi %r1,2
63 be .Lservicecall-.LPG1(%r13)
64 lpsw .Lwaitsclp-.LPG1(%r13)
65.Lsclph:
66 lh %r1,.Lsccbr-PARMAREA(%r4)
67 chi %r1,0x10 # 0x0010 is the sucess code
68 je .Lprocsccb # let's process the sccb
69 chi %r1,0x1f0
70 bne .Lfchunk-.LPG1(%r13) # unhandled error code
71 c %r2, .Lrcp-.LPG1(%r13) # Did we try Read SCP forced
72 bne .Lfchunk-.LPG1(%r13) # if no, give up
73 l %r2, .Lrcp2-.LPG1(%r13) # try with Read SCP
74 b .Lservicecall-.LPG1(%r13)
75.Lprocsccb:
76 lhi %r1,0
77 icm %r1,3,.Lscpincr1-PARMAREA(%r4) # use this one if != 0
78 jnz .Lscnd
79 lhi %r1,0x800 # otherwise report 2GB
80.Lscnd:
81 lhi %r3,0x800 # limit reported memory size to 2GB
82 cr %r1,%r3
83 jl .Lno2gb
84 lr %r1,%r3
85.Lno2gb:
86 xr %r3,%r3 # same logic
87 ic %r3,.Lscpa1-PARMAREA(%r4)
88 chi %r3,0x00
89 jne .Lcompmem
90 l %r3,.Lscpa2-PARMAREA(%r13)
91.Lcompmem:
92 mr %r2,%r1 # mem in MB on 128-bit
93 l %r1,.Lonemb-.LPG1(%r13)
94 mr %r2,%r1 # mem size in bytes in %r3
95 b .Lfchunk-.LPG1(%r13)
96
97 .align 4
98.Lget_ipl_device_addr:
99 .long .Lget_ipl_device
100.Lpmask:
101 .byte 0
102.align 8
103.Lpcext:.long 0x00080000,0x80000000
104.Lcr:
105 .long 0x00 # place holder for cr0
106.Lwaitsclp:
107 .long 0x010a0000,0x80000000 + .Lsclph
108.Lrcp:
109 .int 0x00120001 # Read SCP forced code
110.Lrcp2:
111 .int 0x00020001 # Read SCP code
112.Lonemb:
113 .int 0x100000
114.Lfchunk:
115
116#
117# find memory chunks.
118#
119 lr %r9,%r3 # end of mem
120 mvc __LC_PGM_NEW_PSW(8),.Lpcmem-.LPG1(%r13)
121 la %r1,1 # test in increments of 128KB
122 sll %r1,17
123 l %r3,.Lmchunk-.LPG1(%r13) # get pointer to memory_chunk array
124 slr %r4,%r4 # set start of chunk to zero
125 slr %r5,%r5 # set end of chunk to zero
126 slr %r6,%r6 # set access code to zero
127 la %r10, MEMORY_CHUNKS # number of chunks
128.Lloop:
129 tprot 0(%r5),0 # test protection of first byte
130 ipm %r7
131 srl %r7,28
132 clr %r6,%r7 # compare cc with last access code
133 be .Lsame-.LPG1(%r13)
134 b .Lchkmem-.LPG1(%r13)
135.Lsame:
136 ar %r5,%r1 # add 128KB to end of chunk
137 bno .Lloop-.LPG1(%r13) # r1 < 0x80000000 -> loop
138.Lchkmem: # > 2GB or tprot got a program check
139 clr %r4,%r5 # chunk size > 0?
140 be .Lchkloop-.LPG1(%r13)
141 st %r4,0(%r3) # store start address of chunk
142 lr %r0,%r5
143 slr %r0,%r4
144 st %r0,4(%r3) # store size of chunk
145 st %r6,8(%r3) # store type of chunk
146 la %r3,12(%r3)
147 l %r4,.Lmemsize-.LPG1(%r13) # address of variable memory_size
148 st %r5,0(%r4) # store last end to memory size
149 ahi %r10,-1 # update chunk number
150.Lchkloop:
151 lr %r6,%r7 # set access code to last cc
152 # we got an exception or we're starting a new
153 # chunk , we must check if we should
154 # still try to find valid memory (if we detected
155 # the amount of available storage), and if we
156 # have chunks left
157 xr %r0,%r0
158 clr %r0,%r9 # did we detect memory?
159 je .Ldonemem # if not, leave
160 chi %r10,0 # do we have chunks left?
161 je .Ldonemem
162 alr %r5,%r1 # add 128KB to end of chunk
163 lr %r4,%r5 # potential new chunk
164 clr %r5,%r9 # should we go on?
165 jl .Lloop
166.Ldonemem:
167 l %r12,.Lmflags-.LPG1(%r13) # get address of machine_flags
168#
169# find out if we are running under VM
170#
171 stidp __LC_CPUID # store cpuid
172 tm __LC_CPUID,0xff # running under VM ?
173 bno .Lnovm-.LPG1(%r13)
174 oi 3(%r12),1 # set VM flag
175.Lnovm:
176 lh %r0,__LC_CPUID+4 # get cpu version
177 chi %r0,0x7490 # running on a P/390 ?
178 bne .Lnop390-.LPG1(%r13)
179 oi 3(%r12),4 # set P/390 flag
180.Lnop390:
181
182#
183# find out if we have an IEEE fpu
184#
185 mvc __LC_PGM_NEW_PSW(8),.Lpcfpu-.LPG1(%r13)
186 efpc %r0,0 # test IEEE extract fpc instruction
187 oi 3(%r12),2 # set IEEE fpu flag
188.Lchkfpu:
189
190#
191# find out if we have the CSP instruction
192#
193 mvc __LC_PGM_NEW_PSW(8),.Lpccsp-.LPG1(%r13)
194 la %r0,0
195 lr %r1,%r0
196 la %r2,4
197 csp %r0,%r2 # Test CSP instruction
198 oi 3(%r12),8 # set CSP flag
199.Lchkcsp:
200
201#
202# find out if we have the MVPG instruction
203#
204 mvc __LC_PGM_NEW_PSW(8),.Lpcmvpg-.LPG1(%r13)
205 sr %r0,%r0
206 la %r1,0
207 la %r2,0
208 mvpg %r1,%r2 # Test CSP instruction
209 oi 3(%r12),16 # set MVPG flag
210.Lchkmvpg:
211
212#
213# find out if we have the IDTE instruction
214#
215 mvc __LC_PGM_NEW_PSW(8),.Lpcidte-.LPG1(%r13)
216 .long 0xb2b10000 # store facility list
217 tm 0xc8,0x08 # check bit for clearing-by-ASCE
218 bno .Lchkidte-.LPG1(%r13)
219 lhi %r1,2094
220 lhi %r2,0
221 .long 0xb98e2001
222 oi 3(%r12),0x80 # set IDTE flag
223.Lchkidte:
224
225 lpsw .Lentry-.LPG1(13) # jump to _stext in primary-space,
226 # virtual and never return ...
227 .align 8
228.Lentry:.long 0x00080000,0x80000000 + _stext
229.Lctl: .long 0x04b50002 # cr0: various things
230 .long 0 # cr1: primary space segment table
231 .long .Lduct # cr2: dispatchable unit control table
232 .long 0 # cr3: instruction authorization
233 .long 0 # cr4: instruction authorization
234 .long 0xffffffff # cr5: primary-aste origin
235 .long 0 # cr6: I/O interrupts
236 .long 0 # cr7: secondary space segment table
237 .long 0 # cr8: access registers translation
238 .long 0 # cr9: tracing off
239 .long 0 # cr10: tracing off
240 .long 0 # cr11: tracing off
241 .long 0 # cr12: tracing off
242 .long 0 # cr13: home space segment table
243 .long 0xc0000000 # cr14: machine check handling off
244 .long 0 # cr15: linkage stack operations
245.Lpcmem:.long 0x00080000,0x80000000 + .Lchkmem
246.Lpcfpu:.long 0x00080000,0x80000000 + .Lchkfpu
247.Lpccsp:.long 0x00080000,0x80000000 + .Lchkcsp
248.Lpcmvpg:.long 0x00080000,0x80000000 + .Lchkmvpg
249.Lpcidte:.long 0x00080000,0x80000000 + .Lchkidte
250.Lmemsize:.long memory_size
251.Lmchunk:.long memory_chunk
252.Lmflags:.long machine_flags
253.Lbss_bgn: .long __bss_start
254.Lbss_end: .long _end
255
256 .org PARMAREA-64
257.Lduct: .long 0,0,0,0,0,0,0,0
258 .long 0,0,0,0,0,0,0,0
259
260#
261# params at 10400 (setup.h)
262#
263 .org PARMAREA
264 .global _pstart
265_pstart:
266 .long 0,0 # IPL_DEVICE
267 .long 0,RAMDISK_ORIGIN # INITRD_START
268 .long 0,RAMDISK_SIZE # INITRD_SIZE
269
270 .org COMMAND_LINE
271 .byte "root=/dev/ram0 ro"
272 .byte 0
273 .org 0x11000
274.Lsccb:
275 .hword 0x1000 # length, one page
276 .byte 0x00,0x00,0x00
277 .byte 0x80 # variable response bit set
278.Lsccbr:
279 .hword 0x00 # response code
280.Lscpincr1:
281 .hword 0x00
282.Lscpa1:
283 .byte 0x00
284 .fill 89,1,0
285.Lscpa2:
286 .int 0x00
287.Lscpincr2:
288 .quad 0x00
289 .fill 3984,1,0
290 .org 0x12000
291 .global _pend
292_pend:
293
294 GET_IPL_DEVICE
295
296#ifdef CONFIG_SHARED_KERNEL
297 .org 0x100000
298#endif
299
300#
301# startup-code, running in virtual mode
302#
303 .globl _stext
304_stext: basr %r13,0 # get base
305.LPG3:
306#
307# Setup stack
308#
309 l %r15,.Linittu-.LPG3(%r13)
310 mvc __LC_CURRENT(4),__TI_task(%r15)
311 ahi %r15,1<<(PAGE_SHIFT+THREAD_ORDER) # init_task_union+THREAD_SIZE
312 st %r15,__LC_KERNEL_STACK # set end of kernel stack
313 ahi %r15,-96
314 xc __SF_BACKCHAIN(4,%r15),__SF_BACKCHAIN(%r15) # clear backchain
315
316# check control registers
317 stctl %c0,%c15,0(%r15)
318 oi 2(%r15),0x40 # enable sigp emergency signal
319 oi 0(%r15),0x10 # switch on low address protection
320 lctl %c0,%c15,0(%r15)
321
322#
323 lam 0,15,.Laregs-.LPG3(%r13) # load access regs needed by uaccess
324 l %r14,.Lstart-.LPG3(%r13)
325 basr %r14,%r14 # call start_kernel
326#
327# We returned from start_kernel ?!? PANIK
328#
329 basr %r13,0
330 lpsw .Ldw-.(%r13) # load disabled wait psw
331#
332 .align 8
333.Ldw: .long 0x000a0000,0x00000000
334.Linittu:.long init_thread_union
335.Lstart:.long start_kernel
336.Laregs:.long 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
diff --git a/arch/s390/kernel/head64.S b/arch/s390/kernel/head64.S
index 193aafa72f54..f08c06f45d5c 100644
--- a/arch/s390/kernel/head64.S
+++ b/arch/s390/kernel/head64.S
@@ -1,482 +1,17 @@
1/* 1/*
2 * arch/s390/kernel/head.S 2 * arch/s390/kernel/head64.S
3 * 3 *
4 * S390 version 4 * (C) Copyright IBM Corp. 1999,2005
5 * Copyright (C) 1999,2000 IBM Deutschland Entwicklung GmbH, IBM Corporation 5 *
6 * Author(s): Hartmut Penner (hp@de.ibm.com), 6 * Author(s): Hartmut Penner <hp@de.ibm.com>
7 * Martin Schwidefsky (schwidefsky@de.ibm.com), 7 * Martin Schwidefsky <schwidefsky@de.ibm.com>
8 * Rob van der Heij (rvdhei@iae.nl) 8 * Rob van der Heij <rvdhei@iae.nl>
9 * Heiko Carstens <heiko.carstens@de.ibm.com>
9 * 10 *
10 * There are 5 different IPL methods
11 * 1) load the image directly into ram at address 0 and do an PSW restart
12 * 2) linload will load the image from address 0x10000 to memory 0x10000
13 * and start the code thru LPSW 0x0008000080010000 (VM only, deprecated)
14 * 3) generate the tape ipl header, store the generated image on a tape
15 * and ipl from it
16 * In case of SL tape you need to IPL 5 times to get past VOL1 etc
17 * 4) generate the vm reader ipl header, move the generated image to the
18 * VM reader (use option NOH!) and do a ipl from reader (VM only)
19 * 5) direct call of start by the SALIPL loader
20 * We use the cpuid to distinguish between VM and native ipl
21 * params for kernel are pushed to 0x10400 (see setup.h)
22
23 Changes:
24 Okt 25 2000 <rvdheij@iae.nl>
25 added code to skip HDR and EOF to allow SL tape IPL (5 retries)
26 changed first CCW from rewind to backspace block
27
28 */ 11 */
29 12
30#include <linux/config.h>
31#include <asm/setup.h>
32#include <asm/lowcore.h>
33#include <asm/asm-offsets.h>
34#include <asm/thread_info.h>
35#include <asm/page.h>
36
37#ifndef CONFIG_IPL
38 .org 0
39 .long 0x00080000,0x80000000+startup # Just a restart PSW
40#else
41#ifdef CONFIG_IPL_TAPE
42#define IPL_BS 1024
43 .org 0
44 .long 0x00080000,0x80000000+iplstart # The first 24 bytes are loaded
45 .long 0x27000000,0x60000001 # by ipl to addresses 0-23.
46 .long 0x02000000,0x20000000+IPL_BS # (a PSW and two CCWs).
47 .long 0x00000000,0x00000000 # external old psw
48 .long 0x00000000,0x00000000 # svc old psw
49 .long 0x00000000,0x00000000 # program check old psw
50 .long 0x00000000,0x00000000 # machine check old psw
51 .long 0x00000000,0x00000000 # io old psw
52 .long 0x00000000,0x00000000
53 .long 0x00000000,0x00000000
54 .long 0x00000000,0x00000000
55 .long 0x000a0000,0x00000058 # external new psw
56 .long 0x000a0000,0x00000060 # svc new psw
57 .long 0x000a0000,0x00000068 # program check new psw
58 .long 0x000a0000,0x00000070 # machine check new psw
59 .long 0x00080000,0x80000000+.Lioint # io new psw
60
61 .org 0x100
62#
63# subroutine for loading from tape
64# Paramters:
65# R1 = device number
66# R2 = load address
67.Lloader:
68 st %r14,.Lldret
69 la %r3,.Lorbread # r3 = address of orb
70 la %r5,.Lirb # r5 = address of irb
71 st %r2,.Lccwread+4 # initialize CCW data addresses
72 lctl %c6,%c6,.Lcr6
73 slr %r2,%r2
74.Lldlp:
75 la %r6,3 # 3 retries
76.Lssch:
77 ssch 0(%r3) # load chunk of IPL_BS bytes
78 bnz .Llderr
79.Lw4end:
80 bas %r14,.Lwait4io
81 tm 8(%r5),0x82 # do we have a problem ?
82 bnz .Lrecov
83 slr %r7,%r7
84 icm %r7,3,10(%r5) # get residual count
85 lcr %r7,%r7
86 la %r7,IPL_BS(%r7) # IPL_BS-residual=#bytes read
87 ar %r2,%r7 # add to total size
88 tm 8(%r5),0x01 # found a tape mark ?
89 bnz .Ldone
90 l %r0,.Lccwread+4 # update CCW data addresses
91 ar %r0,%r7
92 st %r0,.Lccwread+4
93 b .Lldlp
94.Ldone:
95 l %r14,.Lldret
96 br %r14 # r2 contains the total size
97.Lrecov:
98 bas %r14,.Lsense # do the sensing
99 bct %r6,.Lssch # dec. retry count & branch
100 b .Llderr
101#
102# Sense subroutine
103#
104.Lsense:
105 st %r14,.Lsnsret
106 la %r7,.Lorbsense
107 ssch 0(%r7) # start sense command
108 bnz .Llderr
109 bas %r14,.Lwait4io
110 l %r14,.Lsnsret
111 tm 8(%r5),0x82 # do we have a problem ?
112 bnz .Llderr
113 br %r14
114#
115# Wait for interrupt subroutine
116#
117.Lwait4io:
118 lpsw .Lwaitpsw
119.Lioint:
120 c %r1,0xb8 # compare subchannel number
121 bne .Lwait4io
122 tsch 0(%r5)
123 slr %r0,%r0
124 tm 8(%r5),0x82 # do we have a problem ?
125 bnz .Lwtexit
126 tm 8(%r5),0x04 # got device end ?
127 bz .Lwait4io
128.Lwtexit:
129 br %r14
130.Llderr:
131 lpsw .Lcrash
132
133 .align 8
134.Lorbread:
135 .long 0x00000000,0x0080ff00,.Lccwread
136 .align 8
137.Lorbsense:
138 .long 0x00000000,0x0080ff00,.Lccwsense
139 .align 8
140.Lccwread:
141 .long 0x02200000+IPL_BS,0x00000000
142.Lccwsense:
143 .long 0x04200001,0x00000000
144.Lwaitpsw:
145 .long 0x020a0000,0x80000000+.Lioint
146
147.Lirb: .long 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
148.Lcr6: .long 0xff000000
149 .align 8
150.Lcrash:.long 0x000a0000,0x00000000
151.Lldret:.long 0
152.Lsnsret: .long 0
153#endif /* CONFIG_IPL_TAPE */
154
155#ifdef CONFIG_IPL_VM
156#define IPL_BS 0x730
157 .org 0
158 .long 0x00080000,0x80000000+iplstart # The first 24 bytes are loaded
159 .long 0x02000018,0x60000050 # by ipl to addresses 0-23.
160 .long 0x02000068,0x60000050 # (a PSW and two CCWs).
161 .fill 80-24,1,0x40 # bytes 24-79 are discarded !!
162 .long 0x020000f0,0x60000050 # The next 160 byte are loaded
163 .long 0x02000140,0x60000050 # to addresses 0x18-0xb7
164 .long 0x02000190,0x60000050 # They form the continuation
165 .long 0x020001e0,0x60000050 # of the CCW program started
166 .long 0x02000230,0x60000050 # by ipl and load the range
167 .long 0x02000280,0x60000050 # 0x0f0-0x730 from the image
168 .long 0x020002d0,0x60000050 # to the range 0x0f0-0x730
169 .long 0x02000320,0x60000050 # in memory. At the end of
170 .long 0x02000370,0x60000050 # the channel program the PSW
171 .long 0x020003c0,0x60000050 # at location 0 is loaded.
172 .long 0x02000410,0x60000050 # Initial processing starts
173 .long 0x02000460,0x60000050 # at 0xf0 = iplstart.
174 .long 0x020004b0,0x60000050
175 .long 0x02000500,0x60000050
176 .long 0x02000550,0x60000050
177 .long 0x020005a0,0x60000050
178 .long 0x020005f0,0x60000050
179 .long 0x02000640,0x60000050
180 .long 0x02000690,0x60000050
181 .long 0x020006e0,0x20000050
182
183 .org 0xf0
184#
185# subroutine for loading cards from the reader
186#
187.Lloader:
188 la %r3,.Lorb # r2 = address of orb into r2
189 la %r5,.Lirb # r4 = address of irb
190 la %r6,.Lccws
191 la %r7,20
192.Linit:
193 st %r2,4(%r6) # initialize CCW data addresses
194 la %r2,0x50(%r2)
195 la %r6,8(%r6)
196 bct 7,.Linit
197
198 lctl %c6,%c6,.Lcr6 # set IO subclass mask
199 slr %r2,%r2
200.Lldlp:
201 ssch 0(%r3) # load chunk of 1600 bytes
202 bnz .Llderr
203.Lwait4irq:
204 mvc 0x78(8),.Lnewpsw # set up IO interrupt psw
205 lpsw .Lwaitpsw
206.Lioint:
207 c %r1,0xb8 # compare subchannel number
208 bne .Lwait4irq
209 tsch 0(%r5)
210
211 slr %r0,%r0
212 ic %r0,8(%r5) # get device status
213 chi %r0,8 # channel end ?
214 be .Lcont
215 chi %r0,12 # channel end + device end ?
216 be .Lcont
217
218 l %r0,4(%r5)
219 s %r0,8(%r3) # r0/8 = number of ccws executed
220 mhi %r0,10 # *10 = number of bytes in ccws
221 lh %r3,10(%r5) # get residual count
222 sr %r0,%r3 # #ccws*80-residual=#bytes read
223 ar %r2,%r0
224
225 br %r14 # r2 contains the total size
226
227.Lcont:
228 ahi %r2,0x640 # add 0x640 to total size
229 la %r6,.Lccws
230 la %r7,20
231.Lincr:
232 l %r0,4(%r6) # update CCW data addresses
233 ahi %r0,0x640
234 st %r0,4(%r6)
235 ahi %r6,8
236 bct 7,.Lincr
237
238 b .Lldlp
239.Llderr:
240 lpsw .Lcrash
241
242 .align 8
243.Lorb: .long 0x00000000,0x0080ff00,.Lccws
244.Lirb: .long 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
245.Lcr6: .long 0xff000000
246.Lloadp:.long 0,0
247 .align 8
248.Lcrash:.long 0x000a0000,0x00000000
249.Lnewpsw:
250 .long 0x00080000,0x80000000+.Lioint
251.Lwaitpsw:
252 .long 0x020a0000,0x80000000+.Lioint
253
254 .align 8
255.Lccws: .rept 19
256 .long 0x02600050,0x00000000
257 .endr
258 .long 0x02200050,0x00000000
259#endif /* CONFIG_IPL_VM */
260
261iplstart:
262 lh %r1,0xb8 # test if subchannel number
263 bct %r1,.Lnoload # is valid
264 l %r1,0xb8 # load ipl subchannel number
265 la %r2,IPL_BS # load start address
266 bas %r14,.Lloader # load rest of ipl image
267 larl %r12,_pstart # pointer to parameter area
268 st %r1,IPL_DEVICE+4-PARMAREA(%r12) # store ipl device number
269
270#
271# load parameter file from ipl device
272# 13#
273.Lagain1: 14# startup-code at 0x10000, running in absolute addressing mode
274 l %r2,INITRD_START+4-PARMAREA(%r12)# use ramdisk location as temp
275 bas %r14,.Lloader # load parameter file
276 ltr %r2,%r2 # got anything ?
277 bz .Lnopf
278 chi %r2,895
279 bnh .Lnotrunc
280 la %r2,895
281.Lnotrunc:
282 l %r4,INITRD_START+4-PARMAREA(%r12)
283 clc 0(3,%r4),.L_hdr # if it is HDRx
284 bz .Lagain1 # skip dataset header
285 clc 0(3,%r4),.L_eof # if it is EOFx
286 bz .Lagain1 # skip dateset trailer
287 la %r5,0(%r4,%r2)
288 lr %r3,%r2
289.Lidebc:
290 tm 0(%r5),0x80 # high order bit set ?
291 bo .Ldocv # yes -> convert from EBCDIC
292 ahi %r5,-1
293 bct %r3,.Lidebc
294 b .Lnocv
295.Ldocv:
296 l %r3,.Lcvtab
297 tr 0(256,%r4),0(%r3) # convert parameters to ascii
298 tr 256(256,%r4),0(%r3)
299 tr 512(256,%r4),0(%r3)
300 tr 768(122,%r4),0(%r3)
301.Lnocv: la %r3,COMMAND_LINE-PARMAREA(%r12) # load adr. of command line
302 mvc 0(256,%r3),0(%r4)
303 mvc 256(256,%r3),256(%r4)
304 mvc 512(256,%r3),512(%r4)
305 mvc 768(122,%r3),768(%r4)
306 slr %r0,%r0
307 b .Lcntlp
308.Ldelspc:
309 ic %r0,0(%r2,%r3)
310 chi %r0,0x20 # is it a space ?
311 be .Lcntlp
312 ahi %r2,1
313 b .Leolp
314.Lcntlp:
315 brct %r2,.Ldelspc
316.Leolp:
317 slr %r0,%r0
318 stc %r0,0(%r2,%r3) # terminate buffer
319.Lnopf:
320
321#
322# load ramdisk from ipl device
323#
324.Lagain2:
325 l %r2,INITRD_START+4-PARMAREA(%r12)# load adr. of ramdisk
326 bas %r14,.Lloader # load ramdisk
327 st %r2,INITRD_SIZE+4-PARMAREA(%r12) # store size of ramdisk
328 ltr %r2,%r2
329 bnz .Lrdcont
330 st %r2,INITRD_START+4-PARMAREA(%r12)# no ramdisk found, null it
331.Lrdcont:
332 l %r2,INITRD_START+4-PARMAREA(%r12)
333 clc 0(3,%r2),.L_hdr # skip HDRx and EOFx
334 bz .Lagain2
335 clc 0(3,%r2),.L_eof
336 bz .Lagain2
337
338#ifdef CONFIG_IPL_VM
339#
340# reset files in VM reader
341#
342 stidp __LC_CPUID # store cpuid
343 tm __LC_CPUID,0xff # running VM ?
344 bno .Lnoreset
345 la %r2,.Lreset
346 lhi %r3,26
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:
355 mvc 0x78(8),.Lrdrnewpsw # set up IO interrupt psw
356.Lwaitrdrirq:
357 lpsw .Lrdrwaitpsw
358.Lrdrint:
359 c %r1,0xb8 # compare subchannel number
360 bne .Lwaitrdrirq
361 la %r5,.Lirb
362 tsch 0(%r5)
363.Lnoreset:
364 b .Lnoload
365
366 .align 8
367.Lrdrnewpsw:
368 .long 0x00080000,0x80000000+.Lrdrint
369.Lrdrwaitpsw:
370 .long 0x020a0000,0x80000000+.Lrdrint
371#endif
372
373#
374# everything loaded, go for it
375#
376.Lnoload:
377 l %r1,.Lstartup
378 br %r1
379
380.Lstartup: .long startup
381.Lcvtab:.long _ebcasc # ebcdic to ascii table
382.Lreset:.byte 0xc3,0xc8,0xc1,0xd5,0xc7,0xc5,0x40,0xd9,0xc4,0xd9,0x40
383 .byte 0xc1,0xd3,0xd3,0x40,0xd2,0xc5,0xc5,0xd7,0x40,0xd5,0xd6
384 .byte 0xc8,0xd6,0xd3,0xc4 # "change rdr all keep nohold"
385.L_eof: .long 0xc5d6c600 /* C'EOF' */
386.L_hdr: .long 0xc8c4d900 /* C'HDR' */
387#endif /* CONFIG_IPL */
388
389#
390# SALIPL loader support. Based on a patch by Rob van der Heij.
391# This entry point is called directly from the SALIPL loader and
392# doesn't need a builtin ipl record.
393#
394 .org 0x800
395 .globl start
396start:
397 stm %r0,%r15,0x07b0 # store registers
398 basr %r12,%r0
399.base:
400 l %r11,.parm
401 l %r8,.cmd # pointer to command buffer
402
403 ltr %r9,%r9 # do we have SALIPL parameters?
404 bp .sk8x8
405
406 mvc 0(64,%r8),0x00b0 # copy saved registers
407 xc 64(240-64,%r8),0(%r8) # remainder of buffer
408 tr 0(64,%r8),.lowcase
409 b .gotr
410.sk8x8:
411 mvc 0(240,%r8),0(%r9) # copy iplparms into buffer
412.gotr:
413 l %r10,.tbl # EBCDIC to ASCII table
414 tr 0(240,%r8),0(%r10)
415 stidp __LC_CPUID # Are we running on VM maybe
416 cli __LC_CPUID,0xff
417 bnz .test
418 .long 0x83300060 # diag 3,0,x'0060' - storage size
419 b .done
420.test:
421 mvc 0x68(8),.pgmnw # set up pgm check handler
422 l %r2,.fourmeg
423 lr %r3,%r2
424 bctr %r3,%r0 # 4M-1
425.loop: iske %r0,%r3
426 ar %r3,%r2
427.pgmx:
428 sr %r3,%r2
429 la %r3,1(%r3)
430.done:
431 l %r1,.memsize
432 st %r3,4(%r1)
433 slr %r0,%r0
434 st %r0,INITRD_SIZE+4-PARMAREA(%r11)
435 st %r0,INITRD_START+4-PARMAREA(%r11)
436 j startup # continue with startup
437.tbl: .long _ebcasc # translate table
438.cmd: .long COMMAND_LINE # address of command line buffer
439.parm: .long PARMAREA
440.fourmeg: .long 0x00400000 # 4M
441.pgmnw: .long 0x00080000,.pgmx
442.memsize: .long memory_size
443.lowcase:
444 .byte 0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07
445 .byte 0x08,0x09,0x0a,0x0b,0x0c,0x0d,0x0e,0x0f
446 .byte 0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17
447 .byte 0x18,0x19,0x1a,0x1b,0x1c,0x1d,0x1e,0x1f
448 .byte 0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27
449 .byte 0x28,0x29,0x2a,0x2b,0x2c,0x2d,0x2e,0x2f
450 .byte 0x30,0x31,0x32,0x33,0x34,0x35,0x36,0x37
451 .byte 0x38,0x39,0x3a,0x3b,0x3c,0x3d,0x3e,0x3f
452 .byte 0x40,0x41,0x42,0x43,0x44,0x45,0x46,0x47
453 .byte 0x48,0x49,0x4a,0x4b,0x4c,0x4d,0x4e,0x4f
454 .byte 0x50,0x51,0x52,0x53,0x54,0x55,0x56,0x57
455 .byte 0x58,0x59,0x5a,0x5b,0x5c,0x5d,0x5e,0x5f
456 .byte 0x60,0x61,0x62,0x63,0x64,0x65,0x66,0x67
457 .byte 0x68,0x69,0x6a,0x6b,0x6c,0x6d,0x6e,0x6f
458 .byte 0x70,0x71,0x72,0x73,0x74,0x75,0x76,0x77
459 .byte 0x78,0x79,0x7a,0x7b,0x7c,0x7d,0x7e,0x7f
460
461 .byte 0x80,0x81,0x82,0x83,0x84,0x85,0x86,0x87
462 .byte 0x88,0x89,0x8a,0x8b,0x8c,0x8d,0x8e,0x8f
463 .byte 0x90,0x91,0x92,0x93,0x94,0x95,0x96,0x97
464 .byte 0x98,0x99,0x9a,0x9b,0x9c,0x9d,0x9e,0x9f
465 .byte 0xa0,0xa1,0xa2,0xa3,0xa4,0xa5,0xa6,0xa7
466 .byte 0xa8,0xa9,0xaa,0xab,0xac,0xad,0xae,0xaf
467 .byte 0xb0,0xb1,0xb2,0xb3,0xb4,0xb5,0xb6,0xb7
468 .byte 0xb8,0xb9,0xba,0xbb,0xbc,0xbd,0xbe,0xbf
469 .byte 0xc0,0x81,0x82,0x83,0x84,0x85,0x86,0x87 # .abcdefg
470 .byte 0x88,0x89,0xca,0xcb,0xcc,0xcd,0xce,0xcf # hi
471 .byte 0xd0,0x91,0x92,0x93,0x94,0x95,0x96,0x97 # .jklmnop
472 .byte 0x98,0x99,0xda,0xdb,0xdc,0xdd,0xde,0xdf # qr
473 .byte 0xe0,0xe1,0xa2,0xa3,0xa4,0xa5,0xa6,0xa7 # ..stuvwx
474 .byte 0xa8,0xa9,0xea,0xeb,0xec,0xed,0xee,0xef # yz
475 .byte 0xf0,0xf1,0xf2,0xf3,0xf4,0xf5,0xf6,0xf7
476 .byte 0xf8,0xf9,0xfa,0xfb,0xfc,0xfd,0xfe,0xff
477
478#
479# startup-code at 0x10000, running in real mode
480# this is called either by the ipl loader or directly by PSW restart 15# this is called either by the ipl loader or directly by PSW restart
481# or linload or SALIPL 16# or linload or SALIPL
482# 17#
@@ -530,7 +65,7 @@ startup:basr %r13,0 # get base
530 be .Lfchunk-.LPG1(%r13) # leave 65 be .Lfchunk-.LPG1(%r13) # leave
531 chi %r1,2 66 chi %r1,2
532 be .Lservicecall-.LPG1(%r13) 67 be .Lservicecall-.LPG1(%r13)
533 lpsw .Lwaitsclp-.LPG1(%r13) 68 lpswe .Lwaitsclp-.LPG1(%r13)
534.Lsclph: 69.Lsclph:
535 lh %r1,.Lsccbr-PARMAREA(%r4) 70 lh %r1,.Lsccbr-PARMAREA(%r4)
536 chi %r1,0x10 # 0x0010 is the sucess code 71 chi %r1,0x10 # 0x0010 is the sucess code
@@ -567,8 +102,7 @@ startup:basr %r13,0 # get base
567.Lcr: 102.Lcr:
568 .quad 0x00 # place holder for cr0 103 .quad 0x00 # place holder for cr0
569.Lwaitsclp: 104.Lwaitsclp:
570 .long 0x020A0000 105 .quad 0x0102000180000000,.Lsclph
571 .quad .Lsclph
572.Lrcp: 106.Lrcp:
573 .int 0x00120001 # Read SCP forced code 107 .int 0x00120001 # Read SCP forced code
574.Lrcp2: 108.Lrcp2:
@@ -751,62 +285,7 @@ _pstart:
751 .global _pend 285 .global _pend
752_pend: 286_pend:
753 287
754.Lget_ipl_device: 288 GET_IPL_DEVICE
755 basr %r12,0
756.LPG2: l %r1,0xb8 # get sid
757 sll %r1,15 # test if subchannel is enabled
758 srl %r1,31
759 ltr %r1,%r1
760 bz 0(%r14) # subchannel disabled
761 l %r1,0xb8
762 la %r5,.Lipl_schib-.LPG2(%r12)
763 stsch 0(%r5) # get schib of subchannel
764 bnz 0(%r14) # schib not available
765 tm 5(%r5),0x01 # devno valid?
766 bno 0(%r14)
767 la %r6,ipl_parameter_flags-.LPG2(%r12)
768 oi 3(%r6),0x01 # set flag
769 la %r2,ipl_devno-.LPG2(%r12)
770 mvc 0(2,%r2),6(%r5) # store devno
771 tm 4(%r5),0x80 # qdio capable device?
772 bno 0(%r14)
773 oi 3(%r6),0x02 # set flag
774
775 # copy ipl parameters
776
777 lhi %r0,4096
778 l %r2,20(%r0) # get address of parameter list
779 lhi %r3,IPL_PARMBLOCK_ORIGIN
780 st %r3,20(%r0)
781 lhi %r4,1
782 cr %r2,%r3 # start parameters < destination ?
783 jl 0f
784 lhi %r1,1 # copy direction is upwards
785 j 1f
7860: lhi %r1,-1 # copy direction is downwards
787 ar %r2,%r0
788 ar %r3,%r0
789 ar %r2,%r1
790 ar %r3,%r1
7911: mvc 0(1,%r3),0(%r2) # finally copy ipl parameters
792 ar %r3,%r1
793 ar %r2,%r1
794 sr %r0,%r4
795 jne 1b
796 b 0(%r14)
797
798 .align 4
799.Lipl_schib:
800 .rept 13
801 .long 0
802 .endr
803
804 .globl ipl_parameter_flags
805ipl_parameter_flags:
806 .long 0
807 .globl ipl_devno
808ipl_devno:
809 .word 0
810 289
811#ifdef CONFIG_SHARED_KERNEL 290#ifdef CONFIG_SHARED_KERNEL
812 .org 0x100000 291 .org 0x100000
diff --git a/arch/s390/kernel/process.c b/arch/s390/kernel/process.c
index 9f3dff6c0b72..78b64fe5e7c2 100644
--- a/arch/s390/kernel/process.c
+++ b/arch/s390/kernel/process.c
@@ -99,15 +99,15 @@ void default_idle(void)
99{ 99{
100 int cpu, rc; 100 int cpu, rc;
101 101
102 /* CPU is going idle. */
103 cpu = smp_processor_id();
104
102 local_irq_disable(); 105 local_irq_disable();
103 if (need_resched()) { 106 if (need_resched()) {
104 local_irq_enable(); 107 local_irq_enable();
105 schedule(); 108 return;
106 return; 109 }
107 }
108 110
109 /* CPU is going idle. */
110 cpu = smp_processor_id();
111 rc = notifier_call_chain(&idle_chain, CPU_IDLE, (void *)(long) cpu); 111 rc = notifier_call_chain(&idle_chain, CPU_IDLE, (void *)(long) cpu);
112 if (rc != NOTIFY_OK && rc != NOTIFY_DONE) 112 if (rc != NOTIFY_OK && rc != NOTIFY_DONE)
113 BUG(); 113 BUG();
@@ -120,7 +120,7 @@ void default_idle(void)
120 __ctl_set_bit(8, 15); 120 __ctl_set_bit(8, 15);
121 121
122#ifdef CONFIG_HOTPLUG_CPU 122#ifdef CONFIG_HOTPLUG_CPU
123 if (cpu_is_offline(smp_processor_id())) 123 if (cpu_is_offline(cpu))
124 cpu_die(); 124 cpu_die();
125#endif 125#endif
126 126
@@ -139,8 +139,14 @@ void default_idle(void)
139 139
140void cpu_idle(void) 140void cpu_idle(void)
141{ 141{
142 for (;;) 142 for (;;) {
143 default_idle(); 143 while (!need_resched())
144 default_idle();
145
146 preempt_enable_no_resched();
147 schedule();
148 preempt_disable();
149 }
144} 150}
145 151
146void show_regs(struct pt_regs *regs) 152void show_regs(struct pt_regs *regs)
diff --git a/arch/s390/kernel/smp.c b/arch/s390/kernel/smp.c
index e13c87b446b2..5856b3fda6bf 100644
--- a/arch/s390/kernel/smp.c
+++ b/arch/s390/kernel/smp.c
@@ -533,6 +533,7 @@ int __devinit start_secondary(void *cpuvoid)
533{ 533{
534 /* Setup the cpu */ 534 /* Setup the cpu */
535 cpu_init(); 535 cpu_init();
536 preempt_disable();
536 /* init per CPU timer */ 537 /* init per CPU timer */
537 init_cpu_timer(); 538 init_cpu_timer();
538#ifdef CONFIG_VIRT_TIMER 539#ifdef CONFIG_VIRT_TIMER
diff --git a/arch/s390/kernel/time.c b/arch/s390/kernel/time.c
index 9a1d95894f3d..c36353e8c140 100644
--- a/arch/s390/kernel/time.c
+++ b/arch/s390/kernel/time.c
@@ -237,6 +237,8 @@ int sysctl_hz_timer = 1;
237 */ 237 */
238static inline void stop_hz_timer(void) 238static inline void stop_hz_timer(void)
239{ 239{
240 unsigned long flags;
241 unsigned long seq, next;
240 __u64 timer, todval; 242 __u64 timer, todval;
241 243
242 if (sysctl_hz_timer != 0) 244 if (sysctl_hz_timer != 0)
@@ -257,7 +259,11 @@ static inline void stop_hz_timer(void)
257 * This cpu is going really idle. Set up the clock comparator 259 * This cpu is going really idle. Set up the clock comparator
258 * for the next event. 260 * for the next event.
259 */ 261 */
260 timer = (__u64) (next_timer_interrupt() - jiffies) + jiffies_64; 262 next = next_timer_interrupt();
263 do {
264 seq = read_seqbegin_irqsave(&xtime_lock, flags);
265 timer = (__u64)(next - jiffies) + jiffies_64;
266 } while (read_seqretry_irqrestore(&xtime_lock, seq, flags));
261 todval = -1ULL; 267 todval = -1ULL;
262 /* Be careful about overflows. */ 268 /* Be careful about overflows. */
263 if (timer < (-1ULL / CLK_TICKS_PER_JIFFY)) { 269 if (timer < (-1ULL / CLK_TICKS_PER_JIFFY)) {
diff --git a/arch/s390/kernel/traps.c b/arch/s390/kernel/traps.c
index 6b8703ec2ae6..c5bd36fae56b 100644
--- a/arch/s390/kernel/traps.c
+++ b/arch/s390/kernel/traps.c
@@ -57,7 +57,6 @@ int sysctl_userprocess_debug = 0;
57 57
58extern pgm_check_handler_t do_protection_exception; 58extern pgm_check_handler_t do_protection_exception;
59extern pgm_check_handler_t do_dat_exception; 59extern pgm_check_handler_t do_dat_exception;
60extern pgm_check_handler_t do_pseudo_page_fault;
61#ifdef CONFIG_PFAULT 60#ifdef CONFIG_PFAULT
62extern int pfault_init(void); 61extern int pfault_init(void);
63extern void pfault_fini(void); 62extern void pfault_fini(void);
@@ -676,20 +675,6 @@ asmlinkage void kernel_stack_overflow(struct pt_regs * regs)
676 panic("Corrupt kernel stack, can't continue."); 675 panic("Corrupt kernel stack, can't continue.");
677} 676}
678 677
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
692
693/* init is done in lowcore.S and head.S */ 678/* init is done in lowcore.S and head.S */
694 679
695void __init trap_init(void) 680void __init trap_init(void)
@@ -717,9 +702,7 @@ void __init trap_init(void)
717 pgm_check_table[0x11] = &do_dat_exception; 702 pgm_check_table[0x11] = &do_dat_exception;
718 pgm_check_table[0x12] = &translation_exception; 703 pgm_check_table[0x12] = &translation_exception;
719 pgm_check_table[0x13] = &special_op_exception; 704 pgm_check_table[0x13] = &special_op_exception;
720#ifndef CONFIG_ARCH_S390X 705#ifdef CONFIG_ARCH_S390X
721 pgm_check_table[0x14] = &do_pseudo_page_fault;
722#else /* CONFIG_ARCH_S390X */
723 pgm_check_table[0x38] = &do_dat_exception; 706 pgm_check_table[0x38] = &do_dat_exception;
724 pgm_check_table[0x39] = &do_dat_exception; 707 pgm_check_table[0x39] = &do_dat_exception;
725 pgm_check_table[0x3A] = &do_dat_exception; 708 pgm_check_table[0x3A] = &do_dat_exception;
@@ -731,12 +714,10 @@ void __init trap_init(void)
731 pgm_check_table[0x40] = &do_monitor_call; 714 pgm_check_table[0x40] = &do_monitor_call;
732 715
733 if (MACHINE_IS_VM) { 716 if (MACHINE_IS_VM) {
717#ifdef CONFIG_PFAULT
734 /* 718 /*
735 * First try to get pfault pseudo page faults going. 719 * Try to get pfault pseudo page faults going.
736 * If this isn't available turn on pagex page faults.
737 */ 720 */
738#ifdef CONFIG_PFAULT
739 /* request the 0x2603 external interrupt */
740 if (register_early_external_interrupt(0x2603, pfault_interrupt, 721 if (register_early_external_interrupt(0x2603, pfault_interrupt,
741 &ext_int_pfault) != 0) 722 &ext_int_pfault) != 0)
742 panic("Couldn't request external interrupt 0x2603"); 723 panic("Couldn't request external interrupt 0x2603");
@@ -748,9 +729,5 @@ void __init trap_init(void)
748 unregister_early_external_interrupt(0x2603, pfault_interrupt, 729 unregister_early_external_interrupt(0x2603, pfault_interrupt,
749 &ext_int_pfault); 730 &ext_int_pfault);
750#endif 731#endif
751#ifndef CONFIG_ARCH_S390X
752 register_reboot_notifier(&pagex_reboot_notifier);
753 cpcmd("SET PAGEX ON", NULL, 0, NULL);
754#endif
755 } 732 }
756} 733}
diff --git a/arch/s390/mm/extmem.c b/arch/s390/mm/extmem.c
index c5348108ca3c..506a33b51e4f 100644
--- a/arch/s390/mm/extmem.c
+++ b/arch/s390/mm/extmem.c
@@ -234,8 +234,8 @@ query_segment_type (struct dcss_segment *seg)
234 rc = 0; 234 rc = 0;
235 235
236 out_free: 236 out_free:
237 if (qin) kfree(qin); 237 kfree(qin);
238 if (qout) kfree(qout); 238 kfree(qout);
239 return rc; 239 return rc;
240} 240}
241 241
@@ -394,7 +394,7 @@ __segment_load (char *name, int do_nonshared, unsigned long *addr, unsigned long
394 segtype_string[seg->vm_segtype]); 394 segtype_string[seg->vm_segtype]);
395 goto out; 395 goto out;
396 out_free: 396 out_free:
397 kfree (seg); 397 kfree(seg);
398 out: 398 out:
399 return rc; 399 return rc;
400} 400}
@@ -505,7 +505,7 @@ segment_modify_shared (char *name, int do_nonshared)
505 list_del(&seg->list); 505 list_del(&seg->list);
506 dcss_diag(DCSS_PURGESEG, seg->dcss_name, 506 dcss_diag(DCSS_PURGESEG, seg->dcss_name,
507 &dummy, &dummy); 507 &dummy, &dummy);
508 kfree (seg); 508 kfree(seg);
509 out_unlock: 509 out_unlock:
510 spin_unlock(&dcss_lock); 510 spin_unlock(&dcss_lock);
511 return rc; 511 return rc;
diff --git a/arch/s390/mm/fault.c b/arch/s390/mm/fault.c
index 856a971759b1..fb2607c369ed 100644
--- a/arch/s390/mm/fault.c
+++ b/arch/s390/mm/fault.c
@@ -160,7 +160,7 @@ static void do_sigsegv(struct pt_regs *regs, unsigned long error_code,
160 * 11 Page translation -> Not present (nullification) 160 * 11 Page translation -> Not present (nullification)
161 * 3b Region third trans. -> Not present (nullification) 161 * 3b Region third trans. -> Not present (nullification)
162 */ 162 */
163extern inline void 163static inline void
164do_exception(struct pt_regs *regs, unsigned long error_code, int is_protection) 164do_exception(struct pt_regs *regs, unsigned long error_code, int is_protection)
165{ 165{
166 struct task_struct *tsk; 166 struct task_struct *tsk;
@@ -352,115 +352,6 @@ void do_dat_exception(struct pt_regs *regs, unsigned long error_code)
352 do_exception(regs, error_code & 0xff, 0); 352 do_exception(regs, error_code & 0xff, 0);
353} 353}
354 354
355#ifndef CONFIG_ARCH_S390X
356
357typedef struct _pseudo_wait_t {
358 struct _pseudo_wait_t *next;
359 wait_queue_head_t queue;
360 unsigned long address;
361 int resolved;
362} pseudo_wait_t;
363
364static pseudo_wait_t *pseudo_lock_queue = NULL;
365static spinlock_t pseudo_wait_spinlock; /* spinlock to protect lock queue */
366
367/*
368 * This routine handles 'pagex' pseudo page faults.
369 */
370asmlinkage void
371do_pseudo_page_fault(struct pt_regs *regs, unsigned long error_code)
372{
373 pseudo_wait_t wait_struct;
374 pseudo_wait_t *ptr, *last, *next;
375 unsigned long address;
376
377 /*
378 * get the failing address
379 * more specific the segment and page table portion of
380 * the address
381 */
382 address = S390_lowcore.trans_exc_code & 0xfffff000;
383
384 if (address & 0x80000000) {
385 /* high bit set -> a page has been swapped in by VM */
386 address &= 0x7fffffff;
387 spin_lock(&pseudo_wait_spinlock);
388 last = NULL;
389 ptr = pseudo_lock_queue;
390 while (ptr != NULL) {
391 next = ptr->next;
392 if (address == ptr->address) {
393 /*
394 * This is one of the processes waiting
395 * for the page. Unchain from the queue.
396 * There can be more than one process
397 * waiting for the same page. VM presents
398 * an initial and a completion interrupt for
399 * every process that tries to access a
400 * page swapped out by VM.
401 */
402 if (last == NULL)
403 pseudo_lock_queue = next;
404 else
405 last->next = next;
406 /* now wake up the process */
407 ptr->resolved = 1;
408 wake_up(&ptr->queue);
409 } else
410 last = ptr;
411 ptr = next;
412 }
413 spin_unlock(&pseudo_wait_spinlock);
414 } else {
415 /* Pseudo page faults in kernel mode is a bad idea */
416 if (!(regs->psw.mask & PSW_MASK_PSTATE)) {
417 /*
418 * VM presents pseudo page faults if the interrupted
419 * state was not disabled for interrupts. So we can
420 * get pseudo page fault interrupts while running
421 * in kernel mode. We simply access the page here
422 * while we are running disabled. VM will then swap
423 * in the page synchronously.
424 */
425 if (check_user_space(regs, error_code) == 0)
426 /* dereference a virtual kernel address */
427 __asm__ __volatile__ (
428 " ic 0,0(%0)"
429 : : "a" (address) : "0");
430 else
431 /* dereference a virtual user address */
432 __asm__ __volatile__ (
433 " la 2,0(%0)\n"
434 " sacf 512\n"
435 " ic 2,0(2)\n"
436 "0:sacf 0\n"
437 ".section __ex_table,\"a\"\n"
438 " .align 4\n"
439 " .long 0b,0b\n"
440 ".previous"
441 : : "a" (address) : "2" );
442
443 return;
444 }
445 /* initialize and add element to pseudo_lock_queue */
446 init_waitqueue_head (&wait_struct.queue);
447 wait_struct.address = address;
448 wait_struct.resolved = 0;
449 spin_lock(&pseudo_wait_spinlock);
450 wait_struct.next = pseudo_lock_queue;
451 pseudo_lock_queue = &wait_struct;
452 spin_unlock(&pseudo_wait_spinlock);
453 /*
454 * The instruction that caused the program check will
455 * be repeated. Don't signal single step via SIGTRAP.
456 */
457 clear_tsk_thread_flag(current, TIF_SINGLE_STEP);
458 /* go to sleep */
459 wait_event(wait_struct.queue, wait_struct.resolved);
460 }
461}
462#endif /* CONFIG_ARCH_S390X */
463
464#ifdef CONFIG_PFAULT 355#ifdef CONFIG_PFAULT
465/* 356/*
466 * 'pfault' pseudo page faults routines. 357 * 'pfault' pseudo page faults routines.
@@ -508,7 +399,7 @@ int pfault_init(void)
508 " .quad 0b,1b\n" 399 " .quad 0b,1b\n"
509#endif /* CONFIG_ARCH_S390X */ 400#endif /* CONFIG_ARCH_S390X */
510 ".previous" 401 ".previous"
511 : "=d" (rc) : "a" (&refbk) : "cc" ); 402 : "=d" (rc) : "a" (&refbk), "m" (refbk) : "cc" );
512 __ctl_set_bit(0, 9); 403 __ctl_set_bit(0, 9);
513 return rc; 404 return rc;
514} 405}
@@ -532,7 +423,7 @@ void pfault_fini(void)
532 " .quad 0b,0b\n" 423 " .quad 0b,0b\n"
533#endif /* CONFIG_ARCH_S390X */ 424#endif /* CONFIG_ARCH_S390X */
534 ".previous" 425 ".previous"
535 : : "a" (&refbk) : "cc" ); 426 : : "a" (&refbk), "m" (refbk) : "cc" );
536} 427}
537 428
538asmlinkage void 429asmlinkage void
diff --git a/arch/sh/Kconfig b/arch/sh/Kconfig
index 3e804c736e64..64f5ae0ff96d 100644
--- a/arch/sh/Kconfig
+++ b/arch/sh/Kconfig
@@ -490,16 +490,6 @@ config CPU_SUBTYPE_ST40
490 depends on CPU_SUBTYPE_ST40STB1 || CPU_SUBTYPE_ST40GX1 490 depends on CPU_SUBTYPE_ST40STB1 || CPU_SUBTYPE_ST40GX1
491 default y 491 default y
492 492
493config ARCH_DISCONTIGMEM_ENABLE
494 bool
495 depends on SH_HP690
496 default y
497 help
498 Say Y to upport efficient handling of discontiguous physical memory,
499 for architectures which are either NUMA (Non-Uniform Memory Access)
500 or have huge holes in the physical address space for other reasons.
501 See <file:Documentation/vm/numa> for more.
502
503source "mm/Kconfig" 493source "mm/Kconfig"
504 494
505config ZERO_PAGE_OFFSET 495config ZERO_PAGE_OFFSET
@@ -770,24 +760,6 @@ source "fs/Kconfig.binfmt"
770 760
771endmenu 761endmenu
772 762
773menu "SH initrd options"
774 depends on BLK_DEV_INITRD
775
776config EMBEDDED_RAMDISK
777 bool "Embed root filesystem ramdisk into the kernel"
778
779config EMBEDDED_RAMDISK_IMAGE
780 string "Filename of gziped ramdisk image"
781 depends on EMBEDDED_RAMDISK
782 default "ramdisk.gz"
783 help
784 This is the filename of the ramdisk image to be built into the
785 kernel. Relative pathnames are relative to arch/sh/ramdisk/.
786 The ramdisk image is not part of the kernel distribution; you must
787 provide one yourself.
788
789endmenu
790
791source "net/Kconfig" 763source "net/Kconfig"
792 764
793source "drivers/Kconfig" 765source "drivers/Kconfig"
diff --git a/arch/sh/Makefile b/arch/sh/Makefile
index 4a3049080b41..67192d6b00d8 100644
--- a/arch/sh/Makefile
+++ b/arch/sh/Makefile
@@ -60,14 +60,6 @@ LIBGCC := $(shell $(CC) $(CFLAGS) -print-libgcc-file-name)
60 60
61core-y += arch/sh/kernel/ arch/sh/mm/ 61core-y += arch/sh/kernel/ arch/sh/mm/
62 62
63#
64# ramdisk/initrd support
65# You need a compressed ramdisk image, named
66# CONFIG_EMBEDDED_RAMDISK_IMAGE. Relative pathnames
67# are relative to arch/sh/ramdisk/.
68#
69core-$(CONFIG_EMBEDDED_RAMDISK) += arch/sh/ramdisk/
70
71# Boards 63# Boards
72machdir-$(CONFIG_SH_SOLUTION_ENGINE) := se/770x 64machdir-$(CONFIG_SH_SOLUTION_ENGINE) := se/770x
73machdir-$(CONFIG_SH_7751_SOLUTION_ENGINE) := se/7751 65machdir-$(CONFIG_SH_7751_SOLUTION_ENGINE) := se/7751
diff --git a/arch/sh/drivers/Makefile b/arch/sh/drivers/Makefile
index bd6726cde398..338c3729d270 100644
--- a/arch/sh/drivers/Makefile
+++ b/arch/sh/drivers/Makefile
@@ -2,6 +2,7 @@
2# Makefile for the Linux SuperH-specific device drivers. 2# Makefile for the Linux SuperH-specific device drivers.
3# 3#
4 4
5obj-$(CONFIG_PCI) += pci/ 5obj-$(CONFIG_PCI) += pci/
6obj-$(CONFIG_SH_DMA) += dma/ 6obj-$(CONFIG_SH_DMA) += dma/
7obj-$(CONFIG_SUPERHYWAY) += superhyway/
7 8
diff --git a/arch/sh/drivers/superhyway/Makefile b/arch/sh/drivers/superhyway/Makefile
new file mode 100644
index 000000000000..5b8e0c7ca3a5
--- /dev/null
+++ b/arch/sh/drivers/superhyway/Makefile
@@ -0,0 +1,6 @@
1#
2# Makefile for the SuperHyway specific kernel interface routines under Linux.
3#
4
5obj-$(CONFIG_CPU_SUBTYPE_SH4_202) += ops-sh4-202.o
6
diff --git a/arch/sh/drivers/superhyway/ops-sh4-202.c b/arch/sh/drivers/superhyway/ops-sh4-202.c
new file mode 100644
index 000000000000..a55c98a9052b
--- /dev/null
+++ b/arch/sh/drivers/superhyway/ops-sh4-202.c
@@ -0,0 +1,171 @@
1/*
2 * arch/sh/drivers/superhyway/ops-sh4-202.c
3 *
4 * SuperHyway bus support for SH4-202
5 *
6 * Copyright (C) 2005 Paul Mundt
7 *
8 * This file is subject to the terms and conditions of the GNU
9 * General Public License. See the file "COPYING" in the main
10 * directory of this archive for more details.
11 */
12#include <linux/kernel.h>
13#include <linux/init.h>
14#include <linux/superhyway.h>
15#include <linux/string.h>
16#include <asm/addrspace.h>
17#include <asm/io.h>
18
19#define PHYS_EMI_CBLOCK P4SEGADDR(0x1ec00000)
20#define PHYS_EMI_DBLOCK P4SEGADDR(0x08000000)
21#define PHYS_FEMI_CBLOCK P4SEGADDR(0x1f800000)
22#define PHYS_FEMI_DBLOCK P4SEGADDR(0x00000000)
23
24#define PHYS_EPBR_BLOCK P4SEGADDR(0x1de00000)
25#define PHYS_DMAC_BLOCK P4SEGADDR(0x1fa00000)
26#define PHYS_PBR_BLOCK P4SEGADDR(0x1fc00000)
27
28static struct resource emi_resources[] = {
29 [0] = {
30 .start = PHYS_EMI_CBLOCK,
31 .end = PHYS_EMI_CBLOCK + 0x00300000 - 1,
32 .flags = IORESOURCE_MEM,
33 },
34 [1] = {
35 .start = PHYS_EMI_DBLOCK,
36 .end = PHYS_EMI_DBLOCK + 0x08000000 - 1,
37 .flags = IORESOURCE_MEM,
38 },
39};
40
41static struct superhyway_device emi_device = {
42 .name = "emi",
43 .num_resources = ARRAY_SIZE(emi_resources),
44 .resource = emi_resources,
45};
46
47static struct resource femi_resources[] = {
48 [0] = {
49 .start = PHYS_FEMI_CBLOCK,
50 .end = PHYS_FEMI_CBLOCK + 0x00100000 - 1,
51 .flags = IORESOURCE_MEM,
52 },
53 [1] = {
54 .start = PHYS_FEMI_DBLOCK,
55 .end = PHYS_FEMI_DBLOCK + 0x08000000 - 1,
56 .flags = IORESOURCE_MEM,
57 },
58};
59
60static struct superhyway_device femi_device = {
61 .name = "femi",
62 .num_resources = ARRAY_SIZE(femi_resources),
63 .resource = femi_resources,
64};
65
66static struct resource epbr_resources[] = {
67 [0] = {
68 .start = P4SEGADDR(0x1e7ffff8),
69 .end = P4SEGADDR(0x1e7ffff8 + (sizeof(u32) * 2) - 1),
70 .flags = IORESOURCE_MEM,
71 },
72 [1] = {
73 .start = PHYS_EPBR_BLOCK,
74 .end = PHYS_EPBR_BLOCK + 0x00a00000 - 1,
75 .flags = IORESOURCE_MEM,
76 },
77};
78
79static struct superhyway_device epbr_device = {
80 .name = "epbr",
81 .num_resources = ARRAY_SIZE(epbr_resources),
82 .resource = epbr_resources,
83};
84
85static struct resource dmac_resource = {
86 .start = PHYS_DMAC_BLOCK,
87 .end = PHYS_DMAC_BLOCK + 0x00100000 - 1,
88 .flags = IORESOURCE_MEM,
89};
90
91static struct superhyway_device dmac_device = {
92 .name = "dmac",
93 .num_resources = 1,
94 .resource = &dmac_resource,
95};
96
97static struct resource pbr_resources[] = {
98 [0] = {
99 .start = P4SEGADDR(0x1ffffff8),
100 .end = P4SEGADDR(0x1ffffff8 + (sizeof(u32) * 2) - 1),
101 .flags = IORESOURCE_MEM,
102 },
103 [1] = {
104 .start = PHYS_PBR_BLOCK,
105 .end = PHYS_PBR_BLOCK + 0x00400000 - (sizeof(u32) * 2) - 1,
106 .flags = IORESOURCE_MEM,
107 },
108};
109
110static struct superhyway_device pbr_device = {
111 .name = "pbr",
112 .num_resources = ARRAY_SIZE(pbr_resources),
113 .resource = pbr_resources,
114};
115
116static struct superhyway_device *sh4202_devices[] __initdata = {
117 &emi_device, &femi_device, &epbr_device, &dmac_device, &pbr_device,
118};
119
120static int sh4202_read_vcr(unsigned long base, struct superhyway_vcr_info *vcr)
121{
122 u32 vcrh, vcrl;
123 u64 tmp;
124
125 /*
126 * XXX: Even though the SH4-202 Evaluation Device documentation
127 * indicates that VCRL is mapped first with VCRH at a + 0x04
128 * offset, the opposite seems to be true.
129 *
130 * Some modules (PBR and ePBR for instance) also appear to have
131 * VCRL/VCRH flipped in the documentation, but on the SH4-202
132 * itself it appears that these are all consistently mapped with
133 * VCRH preceeding VCRL.
134 *
135 * Do not trust the documentation, for it is evil.
136 */
137 vcrh = ctrl_inl(base);
138 vcrl = ctrl_inl(base + sizeof(u32));
139
140 tmp = ((u64)vcrh << 32) | vcrl;
141 memcpy(vcr, &tmp, sizeof(u64));
142
143 return 0;
144}
145
146static int sh4202_write_vcr(unsigned long base, struct superhyway_vcr_info vcr)
147{
148 u64 tmp = *(u64 *)&vcr;
149
150 ctrl_outl((tmp >> 32) & 0xffffffff, base);
151 ctrl_outl(tmp & 0xffffffff, base + sizeof(u32));
152
153 return 0;
154}
155
156static struct superhyway_ops sh4202_superhyway_ops = {
157 .read_vcr = sh4202_read_vcr,
158 .write_vcr = sh4202_write_vcr,
159};
160
161struct superhyway_bus superhyway_channels[] = {
162 { &sh4202_superhyway_ops, },
163 { 0, },
164};
165
166int __init superhyway_scan_bus(struct superhyway_bus *bus)
167{
168 return superhyway_add_devices(bus, sh4202_devices,
169 ARRAY_SIZE(sh4202_devices));
170}
171
diff --git a/arch/sh/kernel/process.c b/arch/sh/kernel/process.c
index 6dce9d0b81f8..fd4f240b833d 100644
--- a/arch/sh/kernel/process.c
+++ b/arch/sh/kernel/process.c
@@ -51,28 +51,24 @@ void enable_hlt(void)
51 51
52EXPORT_SYMBOL(enable_hlt); 52EXPORT_SYMBOL(enable_hlt);
53 53
54void default_idle(void) 54void cpu_idle(void)
55{ 55{
56 /* endless idle loop with no priority at all */ 56 /* endless idle loop with no priority at all */
57 while (1) { 57 while (1) {
58 if (hlt_counter) { 58 if (hlt_counter) {
59 while (1) 59 while (!need_resched())
60 if (need_resched()) 60 cpu_relax();
61 break;
62 } else { 61 } else {
63 while (!need_resched()) 62 while (!need_resched())
64 cpu_sleep(); 63 cpu_sleep();
65 } 64 }
66 65
66 preempt_enable_no_resched();
67 schedule(); 67 schedule();
68 preempt_disable();
68 } 69 }
69} 70}
70 71
71void cpu_idle(void)
72{
73 default_idle();
74}
75
76void machine_restart(char * __unused) 72void machine_restart(char * __unused)
77{ 73{
78 /* SR.BL=1 and invoke address error to let CPU reset (manual reset) */ 74 /* SR.BL=1 and invoke address error to let CPU reset (manual reset) */
diff --git a/arch/sh/kernel/ptrace.c b/arch/sh/kernel/ptrace.c
index 1fbe5a428e31..1a8be06519ec 100644
--- a/arch/sh/kernel/ptrace.c
+++ b/arch/sh/kernel/ptrace.c
@@ -80,48 +80,11 @@ void ptrace_disable(struct task_struct *child)
80 /* nothing to do.. */ 80 /* nothing to do.. */
81} 81}
82 82
83asmlinkage long sys_ptrace(long request, long pid, long addr, long data) 83long arch_ptrace(struct task_struct *child, long request, long addr, long data)
84{ 84{
85 struct task_struct *child;
86 struct user * dummy = NULL; 85 struct user * dummy = NULL;
87 int ret; 86 int ret;
88 87
89 lock_kernel();
90 ret = -EPERM;
91 if (request == PTRACE_TRACEME) {
92 /* are we already being traced? */
93 if (current->ptrace & PT_PTRACED)
94 goto out;
95 ret = security_ptrace(current->parent, current);
96 if (ret)
97 goto out;
98 /* set the ptrace bit in the process flags. */
99 current->ptrace |= PT_PTRACED;
100 ret = 0;
101 goto out;
102 }
103 ret = -ESRCH;
104 read_lock(&tasklist_lock);
105 child = find_task_by_pid(pid);
106 if (child)
107 get_task_struct(child);
108 read_unlock(&tasklist_lock);
109 if (!child)
110 goto out;
111
112 ret = -EPERM;
113 if (pid == 1) /* you may not mess with init */
114 goto out_tsk;
115
116 if (request == PTRACE_ATTACH) {
117 ret = ptrace_attach(child);
118 goto out_tsk;
119 }
120
121 ret = ptrace_check_attach(child, request == PTRACE_KILL);
122 if (ret < 0)
123 goto out_tsk;
124
125 switch (request) { 88 switch (request) {
126 /* when I and D space are separate, these will need to be fixed. */ 89 /* when I and D space are separate, these will need to be fixed. */
127 case PTRACE_PEEKTEXT: /* read word at location addr. */ 90 case PTRACE_PEEKTEXT: /* read word at location addr. */
@@ -289,10 +252,7 @@ asmlinkage long sys_ptrace(long request, long pid, long addr, long data)
289 ret = ptrace_request(child, request, addr, data); 252 ret = ptrace_request(child, request, addr, data);
290 break; 253 break;
291 } 254 }
292out_tsk: 255
293 put_task_struct(child);
294out:
295 unlock_kernel();
296 return ret; 256 return ret;
297} 257}
298 258
diff --git a/arch/sh/kernel/setup.c b/arch/sh/kernel/setup.c
index 25b9d9ebe858..036050b377cd 100644
--- a/arch/sh/kernel/setup.c
+++ b/arch/sh/kernel/setup.c
@@ -83,9 +83,9 @@ static struct sh_machine_vector* __init get_mv_byname(const char* name);
83/* ... */ 83/* ... */
84#define COMMAND_LINE ((char *) (PARAM+0x100)) 84#define COMMAND_LINE ((char *) (PARAM+0x100))
85 85
86#define RAMDISK_IMAGE_START_MASK 0x07FF 86#define RAMDISK_IMAGE_START_MASK 0x07FF
87#define RAMDISK_PROMPT_FLAG 0x8000 87#define RAMDISK_PROMPT_FLAG 0x8000
88#define RAMDISK_LOAD_FLAG 0x4000 88#define RAMDISK_LOAD_FLAG 0x4000
89 89
90static char command_line[COMMAND_LINE_SIZE] = { 0, }; 90static char command_line[COMMAND_LINE_SIZE] = { 0, };
91 91
@@ -284,18 +284,6 @@ void __init setup_arch(char **cmdline_p)
284#define PFN_DOWN(x) ((x) >> PAGE_SHIFT) 284#define PFN_DOWN(x) ((x) >> PAGE_SHIFT)
285#define PFN_PHYS(x) ((x) << PAGE_SHIFT) 285#define PFN_PHYS(x) ((x) << PAGE_SHIFT)
286 286
287#ifdef CONFIG_DISCONTIGMEM
288 NODE_DATA(0)->bdata = &discontig_node_bdata[0];
289 NODE_DATA(1)->bdata = &discontig_node_bdata[1];
290
291 bootmap_size = init_bootmem_node(NODE_DATA(1),
292 PFN_UP(__MEMORY_START_2ND),
293 PFN_UP(__MEMORY_START_2ND),
294 PFN_DOWN(__MEMORY_START_2ND+__MEMORY_SIZE_2ND));
295 free_bootmem_node(NODE_DATA(1), __MEMORY_START_2ND, __MEMORY_SIZE_2ND);
296 reserve_bootmem_node(NODE_DATA(1), __MEMORY_START_2ND, bootmap_size);
297#endif
298
299 /* 287 /*
300 * Find the highest page frame number we have available 288 * Find the highest page frame number we have available
301 */ 289 */
@@ -306,10 +294,10 @@ void __init setup_arch(char **cmdline_p)
306 */ 294 */
307 max_low_pfn = max_pfn; 295 max_low_pfn = max_pfn;
308 296
309 /* 297 /*
310 * Partially used pages are not usable - thus 298 * Partially used pages are not usable - thus
311 * we are rounding upwards: 299 * we are rounding upwards:
312 */ 300 */
313 start_pfn = PFN_UP(__pa(_end)); 301 start_pfn = PFN_UP(__pa(_end));
314 302
315 /* 303 /*
@@ -360,12 +348,12 @@ void __init setup_arch(char **cmdline_p)
360 reserve_bootmem_node(NODE_DATA(0), __MEMORY_START, PAGE_SIZE); 348 reserve_bootmem_node(NODE_DATA(0), __MEMORY_START, PAGE_SIZE);
361 349
362#ifdef CONFIG_BLK_DEV_INITRD 350#ifdef CONFIG_BLK_DEV_INITRD
363 ROOT_DEV = MKDEV(RAMDISK_MAJOR, 0); 351 ROOT_DEV = MKDEV(RAMDISK_MAJOR, 0);
364 if (&__rd_start != &__rd_end) { 352 if (&__rd_start != &__rd_end) {
365 LOADER_TYPE = 1; 353 LOADER_TYPE = 1;
366 INITRD_START = PHYSADDR((unsigned long)&__rd_start) - __MEMORY_START; 354 INITRD_START = PHYSADDR((unsigned long)&__rd_start) - __MEMORY_START;
367 INITRD_SIZE = (unsigned long)&__rd_end - (unsigned long)&__rd_start; 355 INITRD_SIZE = (unsigned long)&__rd_end - (unsigned long)&__rd_start;
368 } 356 }
369 357
370 if (LOADER_TYPE && INITRD_START) { 358 if (LOADER_TYPE && INITRD_START) {
371 if (INITRD_START + INITRD_SIZE <= (max_low_pfn << PAGE_SHIFT)) { 359 if (INITRD_START + INITRD_SIZE <= (max_low_pfn << PAGE_SHIFT)) {
diff --git a/arch/sh/kernel/smp.c b/arch/sh/kernel/smp.c
index 5ecefc02896a..59e49b18252c 100644
--- a/arch/sh/kernel/smp.c
+++ b/arch/sh/kernel/smp.c
@@ -112,7 +112,9 @@ int __cpu_up(unsigned int cpu)
112 112
113int start_secondary(void *unused) 113int start_secondary(void *unused)
114{ 114{
115 unsigned int cpu = smp_processor_id(); 115 unsigned int cpu;
116
117 cpu = smp_processor_id();
116 118
117 atomic_inc(&init_mm.mm_count); 119 atomic_inc(&init_mm.mm_count);
118 current->active_mm = &init_mm; 120 current->active_mm = &init_mm;
@@ -120,6 +122,7 @@ int start_secondary(void *unused)
120 smp_store_cpu_info(cpu); 122 smp_store_cpu_info(cpu);
121 123
122 __smp_slave_init(cpu); 124 __smp_slave_init(cpu);
125 preempt_disable();
123 per_cpu_trap_init(); 126 per_cpu_trap_init();
124 127
125 atomic_inc(&cpus_booted); 128 atomic_inc(&cpus_booted);
diff --git a/arch/sh/mm/init.c b/arch/sh/mm/init.c
index 4e9c854845a4..e342565f75fb 100644
--- a/arch/sh/mm/init.c
+++ b/arch/sh/mm/init.c
@@ -51,11 +51,6 @@ unsigned long mmu_context_cache = NO_CONTEXT;
51#define MAX_LOW_PFN (NODE_DATA(0)->bdata->node_low_pfn) 51#define MAX_LOW_PFN (NODE_DATA(0)->bdata->node_low_pfn)
52#endif 52#endif
53 53
54#ifdef CONFIG_DISCONTIGMEM
55pg_data_t discontig_page_data[MAX_NUMNODES];
56bootmem_data_t discontig_node_bdata[MAX_NUMNODES];
57#endif
58
59void (*copy_page)(void *from, void *to); 54void (*copy_page)(void *from, void *to);
60void (*clear_page)(void *to); 55void (*clear_page)(void *to);
61 56
@@ -216,15 +211,6 @@ void __init paging_init(void)
216#endif 211#endif
217 NODE_DATA(0)->node_mem_map = NULL; 212 NODE_DATA(0)->node_mem_map = NULL;
218 free_area_init_node(0, NODE_DATA(0), zones_size, __MEMORY_START >> PAGE_SHIFT, 0); 213 free_area_init_node(0, NODE_DATA(0), zones_size, __MEMORY_START >> PAGE_SHIFT, 0);
219
220#ifdef CONFIG_DISCONTIGMEM
221 /*
222 * And for discontig, do some more fixups on the zone sizes..
223 */
224 zones_size[ZONE_DMA] = __MEMORY_SIZE_2ND >> PAGE_SHIFT;
225 zones_size[ZONE_NORMAL] = 0;
226 free_area_init_node(1, NODE_DATA(1), zones_size, __MEMORY_START_2ND >> PAGE_SHIFT, 0);
227#endif
228} 214}
229 215
230void __init mem_init(void) 216void __init mem_init(void)
@@ -248,7 +234,7 @@ void __init mem_init(void)
248 memset(empty_zero_page, 0, PAGE_SIZE); 234 memset(empty_zero_page, 0, PAGE_SIZE);
249 __flush_wback_region(empty_zero_page, PAGE_SIZE); 235 __flush_wback_region(empty_zero_page, PAGE_SIZE);
250 236
251 /* 237 /*
252 * Setup wrappers for copy/clear_page(), these will get overridden 238 * Setup wrappers for copy/clear_page(), these will get overridden
253 * later in the boot process if a better method is available. 239 * later in the boot process if a better method is available.
254 */ 240 */
@@ -257,9 +243,6 @@ void __init mem_init(void)
257 243
258 /* this will put all low memory onto the freelists */ 244 /* this will put all low memory onto the freelists */
259 totalram_pages += free_all_bootmem_node(NODE_DATA(0)); 245 totalram_pages += free_all_bootmem_node(NODE_DATA(0));
260#ifdef CONFIG_DISCONTIGMEM
261 totalram_pages += free_all_bootmem_node(NODE_DATA(1));
262#endif
263 reservedpages = 0; 246 reservedpages = 0;
264 for (tmp = 0; tmp < num_physpages; tmp++) 247 for (tmp = 0; tmp < num_physpages; tmp++)
265 /* 248 /*
@@ -286,7 +269,7 @@ void __init mem_init(void)
286void free_initmem(void) 269void free_initmem(void)
287{ 270{
288 unsigned long addr; 271 unsigned long addr;
289 272
290 addr = (unsigned long)(&__init_begin); 273 addr = (unsigned long)(&__init_begin);
291 for (; addr < (unsigned long)(&__init_end); addr += PAGE_SIZE) { 274 for (; addr < (unsigned long)(&__init_end); addr += PAGE_SIZE) {
292 ClearPageReserved(virt_to_page(addr)); 275 ClearPageReserved(virt_to_page(addr));
diff --git a/arch/sh/mm/tlb-sh3.c b/arch/sh/mm/tlb-sh3.c
index 7a0d5c10bf20..46b09e26e082 100644
--- a/arch/sh/mm/tlb-sh3.c
+++ b/arch/sh/mm/tlb-sh3.c
@@ -40,12 +40,17 @@ void update_mmu_cache(struct vm_area_struct * vma,
40 return; 40 return;
41 41
42#if defined(CONFIG_SH7705_CACHE_32KB) 42#if defined(CONFIG_SH7705_CACHE_32KB)
43 struct page *page; 43 {
44 page = pte_page(pte); 44 struct page *page = pte_page(pte);
45 if (VALID_PAGE(page) && !test_bit(PG_mapped, &page->flags)) { 45 unsigned long pfn = pte_pfn(pte);
46 unsigned long phys = pte_val(pte) & PTE_PHYS_MASK; 46
47 __flush_wback_region((void *)P1SEGADDR(phys), PAGE_SIZE); 47 if (pfn_valid(pfn) && !test_bit(PG_mapped, &page->flags)) {
48 __set_bit(PG_mapped, &page->flags); 48 unsigned long phys = pte_val(pte) & PTE_PHYS_MASK;
49
50 __flush_wback_region((void *)P1SEGADDR(phys),
51 PAGE_SIZE);
52 __set_bit(PG_mapped, &page->flags);
53 }
49 } 54 }
50#endif 55#endif
51 56
@@ -80,7 +85,7 @@ void __flush_tlb_page(unsigned long asid, unsigned long page)
80 */ 85 */
81 addr = MMU_TLB_ADDRESS_ARRAY | (page & 0x1F000); 86 addr = MMU_TLB_ADDRESS_ARRAY | (page & 0x1F000);
82 data = (page & 0xfffe0000) | asid; /* VALID bit is off */ 87 data = (page & 0xfffe0000) | asid; /* VALID bit is off */
83 88
84 if ((cpu_data->flags & CPU_HAS_MMU_PAGE_ASSOC)) { 89 if ((cpu_data->flags & CPU_HAS_MMU_PAGE_ASSOC)) {
85 addr |= MMU_PAGE_ASSOC_BIT; 90 addr |= MMU_PAGE_ASSOC_BIT;
86 ways = 1; /* we already know the way .. */ 91 ways = 1; /* we already know the way .. */
diff --git a/arch/sh/ramdisk/Makefile b/arch/sh/ramdisk/Makefile
deleted file mode 100644
index 99e1c68673cf..000000000000
--- a/arch/sh/ramdisk/Makefile
+++ /dev/null
@@ -1,20 +0,0 @@
1#
2# Makefile for a ramdisk image
3#
4
5obj-y += ramdisk.o
6
7
8O_FORMAT = $(shell $(OBJDUMP) -i | head -n 2 | grep elf32)
9img := $(subst ",,$(CONFIG_EMBEDDED_RAMDISK_IMAGE))
10# add $(src) when $(img) is relative
11img := $(subst $(src)//,/,$(src)/$(img))
12
13quiet_cmd_ramdisk = LD $@
14define cmd_ramdisk
15 $(LD) -T $(srctree)/$(src)/ld.script -b binary --oformat $(O_FORMAT) \
16 -o $@ $(img)
17endef
18
19$(obj)/ramdisk.o: $(img) $(srctree)/$(src)/ld.script
20 $(call cmd,ramdisk)
diff --git a/arch/sh/ramdisk/ld.script b/arch/sh/ramdisk/ld.script
deleted file mode 100644
index 94beee248c04..000000000000
--- a/arch/sh/ramdisk/ld.script
+++ /dev/null
@@ -1,9 +0,0 @@
1OUTPUT_ARCH(sh)
2SECTIONS
3{
4 .initrd :
5 {
6 *(.data)
7 }
8}
9
diff --git a/arch/sh64/kernel/process.c b/arch/sh64/kernel/process.c
index efde41c0cd66..b95d04141855 100644
--- a/arch/sh64/kernel/process.c
+++ b/arch/sh64/kernel/process.c
@@ -307,23 +307,19 @@ __setup("hlt", hlt_setup);
307 307
308static inline void hlt(void) 308static inline void hlt(void)
309{ 309{
310 if (hlt_counter)
311 return;
312
313 __asm__ __volatile__ ("sleep" : : : "memory"); 310 __asm__ __volatile__ ("sleep" : : : "memory");
314} 311}
315 312
316/* 313/*
317 * The idle loop on a uniprocessor SH.. 314 * The idle loop on a uniprocessor SH..
318 */ 315 */
319void default_idle(void) 316void cpu_idle(void)
320{ 317{
321 /* endless idle loop with no priority at all */ 318 /* endless idle loop with no priority at all */
322 while (1) { 319 while (1) {
323 if (hlt_counter) { 320 if (hlt_counter) {
324 while (1) 321 while (!need_resched())
325 if (need_resched()) 322 cpu_relax();
326 break;
327 } else { 323 } else {
328 local_irq_disable(); 324 local_irq_disable();
329 while (!need_resched()) { 325 while (!need_resched()) {
@@ -334,13 +330,11 @@ void default_idle(void)
334 } 330 }
335 local_irq_enable(); 331 local_irq_enable();
336 } 332 }
333 preempt_enable_no_resched();
337 schedule(); 334 schedule();
335 preempt_disable();
338 } 336 }
339}
340 337
341void cpu_idle(void)
342{
343 default_idle();
344} 338}
345 339
346void machine_restart(char * __unused) 340void machine_restart(char * __unused)
diff --git a/arch/sh64/kernel/ptrace.c b/arch/sh64/kernel/ptrace.c
index 71f2eec00b99..cd22e9471316 100644
--- a/arch/sh64/kernel/ptrace.c
+++ b/arch/sh64/kernel/ptrace.c
@@ -28,6 +28,7 @@
28#include <linux/ptrace.h> 28#include <linux/ptrace.h>
29#include <linux/user.h> 29#include <linux/user.h>
30#include <linux/signal.h> 30#include <linux/signal.h>
31#include <linux/syscalls.h>
31 32
32#include <asm/io.h> 33#include <asm/io.h>
33#include <asm/uaccess.h> 34#include <asm/uaccess.h>
@@ -121,61 +122,11 @@ put_fpu_long(struct task_struct *task, unsigned long addr, unsigned long data)
121 return 0; 122 return 0;
122} 123}
123 124
124asmlinkage long sys_ptrace(long request, long pid, long addr, long data) 125
126long arch_ptrace(struct task_struct *child, long request, long addr, long data)
125{ 127{
126 struct task_struct *child;
127 extern void poke_real_address_q(unsigned long long addr, unsigned long long data);
128#define WPC_DBRMODE 0x0d104008
129 static int first_call = 1;
130 int ret; 128 int ret;
131 129
132 lock_kernel();
133
134 if (first_call) {
135 /* Set WPC.DBRMODE to 0. This makes all debug events get
136 * delivered through RESVEC, i.e. into the handlers in entry.S.
137 * (If the kernel was downloaded using a remote gdb, WPC.DBRMODE
138 * would normally be left set to 1, which makes debug events get
139 * delivered through DBRVEC, i.e. into the remote gdb's
140 * handlers. This prevents ptrace getting them, and confuses
141 * the remote gdb.) */
142 printk("DBRMODE set to 0 to permit native debugging\n");
143 poke_real_address_q(WPC_DBRMODE, 0);
144 first_call = 0;
145 }
146
147 ret = -EPERM;
148 if (request == PTRACE_TRACEME) {
149 /* are we already being traced? */
150 if (current->ptrace & PT_PTRACED)
151 goto out;
152 /* set the ptrace bit in the process flags. */
153 current->ptrace |= PT_PTRACED;
154 ret = 0;
155 goto out;
156 }
157 ret = -ESRCH;
158 read_lock(&tasklist_lock);
159 child = find_task_by_pid(pid);
160 if (child)
161 get_task_struct(child);
162 read_unlock(&tasklist_lock);
163 if (!child)
164 goto out;
165
166 ret = -EPERM;
167 if (pid == 1) /* you may not mess with init */
168 goto out_tsk;
169
170 if (request == PTRACE_ATTACH) {
171 ret = ptrace_attach(child);
172 goto out_tsk;
173 }
174
175 ret = ptrace_check_attach(child, request == PTRACE_KILL);
176 if (ret < 0)
177 goto out_tsk;
178
179 switch (request) { 130 switch (request) {
180 /* when I and D space are separate, these will need to be fixed. */ 131 /* when I and D space are separate, these will need to be fixed. */
181 case PTRACE_PEEKTEXT: /* read word at location addr. */ 132 case PTRACE_PEEKTEXT: /* read word at location addr. */
@@ -313,13 +264,33 @@ asmlinkage long sys_ptrace(long request, long pid, long addr, long data)
313 ret = ptrace_request(child, request, addr, data); 264 ret = ptrace_request(child, request, addr, data);
314 break; 265 break;
315 } 266 }
316out_tsk:
317 put_task_struct(child);
318out:
319 unlock_kernel();
320 return ret; 267 return ret;
321} 268}
322 269
270asmlinkage int sh64_ptrace(long request, long pid, long addr, long data)
271{
272 extern void poke_real_address_q(unsigned long long addr, unsigned long long data);
273#define WPC_DBRMODE 0x0d104008
274 static int first_call = 1;
275
276 lock_kernel();
277 if (first_call) {
278 /* Set WPC.DBRMODE to 0. This makes all debug events get
279 * delivered through RESVEC, i.e. into the handlers in entry.S.
280 * (If the kernel was downloaded using a remote gdb, WPC.DBRMODE
281 * would normally be left set to 1, which makes debug events get
282 * delivered through DBRVEC, i.e. into the remote gdb's
283 * handlers. This prevents ptrace getting them, and confuses
284 * the remote gdb.) */
285 printk("DBRMODE set to 0 to permit native debugging\n");
286 poke_real_address_q(WPC_DBRMODE, 0);
287 first_call = 0;
288 }
289 unlock_kernel();
290
291 return sys_ptrace(request, pid, addr, data);
292}
293
323asmlinkage void syscall_trace(void) 294asmlinkage void syscall_trace(void)
324{ 295{
325 struct task_struct *tsk = current; 296 struct task_struct *tsk = current;
diff --git a/arch/sh64/kernel/syscalls.S b/arch/sh64/kernel/syscalls.S
index a3d037805f1c..c0079d54c850 100644
--- a/arch/sh64/kernel/syscalls.S
+++ b/arch/sh64/kernel/syscalls.S
@@ -46,7 +46,7 @@ sys_call_table:
46 .long sys_setuid16 46 .long sys_setuid16
47 .long sys_getuid16 47 .long sys_getuid16
48 .long sys_stime /* 25 */ 48 .long sys_stime /* 25 */
49 .long sys_ptrace 49 .long sh64_ptrace
50 .long sys_alarm 50 .long sys_alarm
51 .long sys_fstat 51 .long sys_fstat
52 .long sys_pause 52 .long sys_pause
diff --git a/arch/sparc/Kconfig b/arch/sparc/Kconfig
index 6537445dac0e..3cfb8be3ff6d 100644
--- a/arch/sparc/Kconfig
+++ b/arch/sparc/Kconfig
@@ -201,6 +201,14 @@ config SUN_OPENPROMFS
201 Only choose N if you know in advance that you will not need to modify 201 Only choose N if you know in advance that you will not need to modify
202 OpenPROM settings on the running system. 202 OpenPROM settings on the running system.
203 203
204config SPARC_LED
205 tristate "Sun4m LED driver"
206 help
207 This driver toggles the front-panel LED on sun4m systems
208 in a user-specifyable manner. It's state can be probed
209 by reading /proc/led and it's blinking mode can be changed
210 via writes to /proc/led
211
204source "fs/Kconfig.binfmt" 212source "fs/Kconfig.binfmt"
205 213
206config SUNOS_EMUL 214config SUNOS_EMUL
diff --git a/arch/sparc/kernel/Makefile b/arch/sparc/kernel/Makefile
index 3d22ba2af01c..1b83e21841b5 100644
--- a/arch/sparc/kernel/Makefile
+++ b/arch/sparc/kernel/Makefile
@@ -21,6 +21,7 @@ obj-$(CONFIG_SUN_AUXIO) += auxio.o
21obj-$(CONFIG_PCI) += ebus.o 21obj-$(CONFIG_PCI) += ebus.o
22obj-$(CONFIG_SUN_PM) += apc.o pmc.o 22obj-$(CONFIG_SUN_PM) += apc.o pmc.o
23obj-$(CONFIG_MODULES) += module.o sparc_ksyms.o 23obj-$(CONFIG_MODULES) += module.o sparc_ksyms.o
24obj-$(CONFIG_SPARC_LED) += led.o
24 25
25ifdef CONFIG_SUNOS_EMUL 26ifdef CONFIG_SUNOS_EMUL
26obj-y += sys_sunos.o sunos_ioctl.o 27obj-y += sys_sunos.o sunos_ioctl.o
diff --git a/arch/sparc/kernel/cpu.c b/arch/sparc/kernel/cpu.c
index 6a4ebc62193e..d7bfc61d2879 100644
--- a/arch/sparc/kernel/cpu.c
+++ b/arch/sparc/kernel/cpu.c
@@ -75,7 +75,7 @@ struct cpu_fp_info linux_sparc_fpu[] = {
75 { 9, 3, "Fujitsu or Weitek on-chip FPU"}, 75 { 9, 3, "Fujitsu or Weitek on-chip FPU"},
76}; 76};
77 77
78#define NSPARCFPU (sizeof(linux_sparc_fpu)/sizeof(struct cpu_fp_info)) 78#define NSPARCFPU ARRAY_SIZE(linux_sparc_fpu)
79 79
80struct cpu_iu_info linux_sparc_chips[] = { 80struct cpu_iu_info linux_sparc_chips[] = {
81 /* Sun4/100, 4/200, SLC */ 81 /* Sun4/100, 4/200, SLC */
@@ -120,7 +120,7 @@ struct cpu_iu_info linux_sparc_chips[] = {
120 { 0xf, 0, "UNKNOWN CPU-VENDOR/TYPE"}, 120 { 0xf, 0, "UNKNOWN CPU-VENDOR/TYPE"},
121}; 121};
122 122
123#define NSPARCCHIPS (sizeof(linux_sparc_chips)/sizeof(struct cpu_iu_info)) 123#define NSPARCCHIPS ARRAY_SIZE(linux_sparc_chips)
124 124
125char *sparc_cpu_type; 125char *sparc_cpu_type;
126char *sparc_fpu_type; 126char *sparc_fpu_type;
diff --git a/arch/sparc/kernel/led.c b/arch/sparc/kernel/led.c
new file mode 100644
index 000000000000..2a3afca453c9
--- /dev/null
+++ b/arch/sparc/kernel/led.c
@@ -0,0 +1,139 @@
1#include <linux/kernel.h>
2#include <linux/module.h>
3#include <linux/init.h>
4#include <linux/proc_fs.h>
5#include <linux/string.h>
6
7#include <asm/auxio.h>
8
9#define LED_MAX_LENGTH 8 /* maximum chars written to proc file */
10
11static inline void led_toggle(void)
12{
13 unsigned char val = get_auxio();
14 unsigned char on, off;
15
16 if (val & AUXIO_LED) {
17 on = 0;
18 off = AUXIO_LED;
19 } else {
20 on = AUXIO_LED;
21 off = 0;
22 }
23
24 set_auxio(on, off);
25}
26
27static struct timer_list led_blink_timer;
28
29static void led_blink(unsigned long timeout)
30{
31 led_toggle();
32
33 /* reschedule */
34 if (!timeout) { /* blink according to load */
35 led_blink_timer.expires = jiffies +
36 ((1 + (avenrun[0] >> FSHIFT)) * HZ);
37 led_blink_timer.data = 0;
38 } else { /* blink at user specified interval */
39 led_blink_timer.expires = jiffies + (timeout * HZ);
40 led_blink_timer.data = timeout;
41 }
42 add_timer(&led_blink_timer);
43}
44
45static int led_read_proc(char *buf, char **start, off_t offset, int count,
46 int *eof, void *data)
47{
48 int len = 0;
49
50 if (get_auxio() & AUXIO_LED)
51 len = sprintf(buf, "on\n");
52 else
53 len = sprintf(buf, "off\n");
54
55 return len;
56}
57
58static int led_write_proc(struct file *file, const char *buffer,
59 unsigned long count, void *data)
60{
61 char *buf = NULL;
62
63 if (count > LED_MAX_LENGTH)
64 count = LED_MAX_LENGTH;
65
66 buf = kmalloc(sizeof(char) * (count + 1), GFP_KERNEL);
67 if (!buf)
68 return -ENOMEM;
69
70 if (copy_from_user(buf, buffer, count)) {
71 kfree(buf);
72 return -EFAULT;
73 }
74
75 buf[count] = '\0';
76
77 /* work around \n when echo'ing into proc */
78 if (buf[count - 1] == '\n')
79 buf[count - 1] = '\0';
80
81 /* before we change anything we want to stop any running timers,
82 * otherwise calls such as on will have no persistent effect
83 */
84 del_timer_sync(&led_blink_timer);
85
86 if (!strcmp(buf, "on")) {
87 auxio_set_led(AUXIO_LED_ON);
88 } else if (!strcmp(buf, "toggle")) {
89 led_toggle();
90 } else if ((*buf > '0') && (*buf <= '9')) {
91 led_blink(simple_strtoul(buf, NULL, 10));
92 } else if (!strcmp(buf, "load")) {
93 led_blink(0);
94 } else {
95 auxio_set_led(AUXIO_LED_OFF);
96 }
97
98 kfree(buf);
99
100 return count;
101}
102
103static struct proc_dir_entry *led;
104
105#define LED_VERSION "0.1"
106
107static int __init led_init(void)
108{
109 init_timer(&led_blink_timer);
110 led_blink_timer.function = led_blink;
111
112 led = create_proc_entry("led", 0, NULL);
113 if (!led)
114 return -ENOMEM;
115
116 led->read_proc = led_read_proc; /* reader function */
117 led->write_proc = led_write_proc; /* writer function */
118 led->owner = THIS_MODULE;
119
120 printk(KERN_INFO
121 "led: version %s, Lars Kotthoff <metalhead@metalhead.ws>\n",
122 LED_VERSION);
123
124 return 0;
125}
126
127static void __exit led_exit(void)
128{
129 remove_proc_entry("led", NULL);
130 del_timer_sync(&led_blink_timer);
131}
132
133module_init(led_init);
134module_exit(led_exit);
135
136MODULE_AUTHOR("Lars Kotthoff <metalhead@metalhead.ws>");
137MODULE_DESCRIPTION("Provides control of the front LED on SPARC systems.");
138MODULE_LICENSE("GPL");
139MODULE_VERSION(LED_VERSION);
diff --git a/arch/sparc/kernel/pcic.c b/arch/sparc/kernel/pcic.c
index 25e31d5ec99b..cccfc12802ed 100644
--- a/arch/sparc/kernel/pcic.c
+++ b/arch/sparc/kernel/pcic.c
@@ -143,7 +143,7 @@ static struct pcic_ca2irq pcic_i_jk[] = {
143 * as several PROMs may be installed on the same physical board. 143 * as several PROMs may be installed on the same physical board.
144 */ 144 */
145#define SN2L_INIT(name, map) \ 145#define SN2L_INIT(name, map) \
146 { name, map, sizeof(map)/sizeof(struct pcic_ca2irq) } 146 { name, map, ARRAY_SIZE(map) }
147 147
148static struct pcic_sn2list pcic_known_sysnames[] = { 148static struct pcic_sn2list pcic_known_sysnames[] = {
149 SN2L_INIT("SUNW,JavaEngine1", pcic_i_je1a), /* JE1, PROM 2.32 */ 149 SN2L_INIT("SUNW,JavaEngine1", pcic_i_je1a), /* JE1, PROM 2.32 */
diff --git a/arch/sparc/kernel/process.c b/arch/sparc/kernel/process.c
index 29e72b57d4fd..ea8647411462 100644
--- a/arch/sparc/kernel/process.c
+++ b/arch/sparc/kernel/process.c
@@ -67,13 +67,6 @@ extern void fpsave(unsigned long *, unsigned long *, void *, unsigned long *);
67struct task_struct *last_task_used_math = NULL; 67struct task_struct *last_task_used_math = NULL;
68struct thread_info *current_set[NR_CPUS]; 68struct thread_info *current_set[NR_CPUS];
69 69
70/*
71 * default_idle is new in 2.5. XXX Review, currently stolen from sparc64.
72 */
73void default_idle(void)
74{
75}
76
77#ifndef CONFIG_SMP 70#ifndef CONFIG_SMP
78 71
79#define SUN4C_FAULT_HIGH 100 72#define SUN4C_FAULT_HIGH 100
@@ -92,12 +85,11 @@ void cpu_idle(void)
92 static unsigned long fps; 85 static unsigned long fps;
93 unsigned long now; 86 unsigned long now;
94 unsigned long faults; 87 unsigned long faults;
95 unsigned long flags;
96 88
97 extern unsigned long sun4c_kernel_faults; 89 extern unsigned long sun4c_kernel_faults;
98 extern void sun4c_grow_kernel_ring(void); 90 extern void sun4c_grow_kernel_ring(void);
99 91
100 local_irq_save(flags); 92 local_irq_disable();
101 now = jiffies; 93 now = jiffies;
102 count -= (now - last_jiffies); 94 count -= (now - last_jiffies);
103 last_jiffies = now; 95 last_jiffies = now;
@@ -113,14 +105,19 @@ void cpu_idle(void)
113 sun4c_grow_kernel_ring(); 105 sun4c_grow_kernel_ring();
114 } 106 }
115 } 107 }
116 local_irq_restore(flags); 108 local_irq_enable();
117 } 109 }
118 110
119 while((!need_resched()) && pm_idle) { 111 if (pm_idle) {
120 (*pm_idle)(); 112 while (!need_resched())
113 (*pm_idle)();
114 } else {
115 while (!need_resched())
116 cpu_relax();
121 } 117 }
122 118 preempt_enable_no_resched();
123 schedule(); 119 schedule();
120 preempt_disable();
124 check_pgt_cache(); 121 check_pgt_cache();
125 } 122 }
126} 123}
@@ -130,13 +127,15 @@ void cpu_idle(void)
130/* This is being executed in task 0 'user space'. */ 127/* This is being executed in task 0 'user space'. */
131void cpu_idle(void) 128void cpu_idle(void)
132{ 129{
130 set_thread_flag(TIF_POLLING_NRFLAG);
133 /* endless idle loop with no priority at all */ 131 /* endless idle loop with no priority at all */
134 while(1) { 132 while(1) {
135 if(need_resched()) { 133 while (!need_resched())
136 schedule(); 134 cpu_relax();
137 check_pgt_cache(); 135 preempt_enable_no_resched();
138 } 136 schedule();
139 barrier(); /* or else gcc optimizes... */ 137 preempt_disable();
138 check_pgt_cache();
140 } 139 }
141} 140}
142 141
diff --git a/arch/sparc/kernel/sunos_ioctl.c b/arch/sparc/kernel/sunos_ioctl.c
index df1c0b31a930..a6ba3d26222c 100644
--- a/arch/sparc/kernel/sunos_ioctl.c
+++ b/arch/sparc/kernel/sunos_ioctl.c
@@ -23,7 +23,6 @@
23#include <linux/smp_lock.h> 23#include <linux/smp_lock.h>
24#include <linux/syscalls.h> 24#include <linux/syscalls.h>
25#include <linux/file.h> 25#include <linux/file.h>
26#include <asm/kbio.h>
27 26
28#if 0 27#if 0
29extern char sunkbd_type; 28extern char sunkbd_type;
diff --git a/arch/sparc/mm/fault.c b/arch/sparc/mm/fault.c
index 2bbd53f3cafb..9eeed3347df3 100644
--- a/arch/sparc/mm/fault.c
+++ b/arch/sparc/mm/fault.c
@@ -33,8 +33,6 @@
33#include <asm/kdebug.h> 33#include <asm/kdebug.h>
34#include <asm/uaccess.h> 34#include <asm/uaccess.h>
35 35
36#define ELEMENTS(arr) (sizeof (arr)/sizeof (arr[0]))
37
38extern int prom_node_root; 36extern int prom_node_root;
39 37
40/* At boot time we determine these two values necessary for setting 38/* At boot time we determine these two values necessary for setting
diff --git a/arch/sparc64/Kconfig b/arch/sparc64/Kconfig
index 1e9d8638a28a..3fded69b1922 100644
--- a/arch/sparc64/Kconfig
+++ b/arch/sparc64/Kconfig
@@ -377,8 +377,21 @@ source "drivers/fc4/Kconfig"
377 377
378source "fs/Kconfig" 378source "fs/Kconfig"
379 379
380menu "Instrumentation Support"
381 depends on EXPERIMENTAL
382
380source "arch/sparc64/oprofile/Kconfig" 383source "arch/sparc64/oprofile/Kconfig"
381 384
385config KPROBES
386 bool "Kprobes (EXPERIMENTAL)"
387 help
388 Kprobes allows you to trap at almost any kernel address and
389 execute a callback function. register_kprobe() establishes
390 a probepoint and specifies the callback. Kprobes is useful
391 for kernel debugging, non-intrusive instrumentation and testing.
392 If in doubt, say "N".
393endmenu
394
382source "arch/sparc64/Kconfig.debug" 395source "arch/sparc64/Kconfig.debug"
383 396
384source "security/Kconfig" 397source "security/Kconfig"
diff --git a/arch/sparc64/Kconfig.debug b/arch/sparc64/Kconfig.debug
index fa06ea04837b..3e31be494e54 100644
--- a/arch/sparc64/Kconfig.debug
+++ b/arch/sparc64/Kconfig.debug
@@ -11,16 +11,6 @@ config DEBUG_STACK_USAGE
11 11
12 This option will slow down process creation somewhat. 12 This option will slow down process creation somewhat.
13 13
14config KPROBES
15 bool "Kprobes"
16 depends on DEBUG_KERNEL
17 help
18 Kprobes allows you to trap at almost any kernel address and
19 execute a callback function. register_kprobe() establishes
20 a probepoint and specifies the callback. Kprobes is useful
21 for kernel debugging, non-intrusive instrumentation and testing.
22 If in doubt, say "N".
23
24config DEBUG_DCFLUSH 14config DEBUG_DCFLUSH
25 bool "D-cache flush debugging" 15 bool "D-cache flush debugging"
26 depends on DEBUG_KERNEL 16 depends on DEBUG_KERNEL
diff --git a/arch/sparc64/kernel/cpu.c b/arch/sparc64/kernel/cpu.c
index 77ef5df4e5a7..00eed88ef2e8 100644
--- a/arch/sparc64/kernel/cpu.c
+++ b/arch/sparc64/kernel/cpu.c
@@ -43,7 +43,7 @@ struct cpu_fp_info linux_sparc_fpu[] = {
43 { 0x3e, 0x22, 0, "UltraSparc IIIi+ integrated FPU"}, 43 { 0x3e, 0x22, 0, "UltraSparc IIIi+ integrated FPU"},
44}; 44};
45 45
46#define NSPARCFPU (sizeof(linux_sparc_fpu)/sizeof(struct cpu_fp_info)) 46#define NSPARCFPU ARRAY_SIZE(linux_sparc_fpu)
47 47
48struct cpu_iu_info linux_sparc_chips[] = { 48struct cpu_iu_info linux_sparc_chips[] = {
49 { 0x17, 0x10, "TI UltraSparc I (SpitFire)"}, 49 { 0x17, 0x10, "TI UltraSparc I (SpitFire)"},
@@ -59,7 +59,7 @@ struct cpu_iu_info linux_sparc_chips[] = {
59 { 0x3e, 0x22, "TI UltraSparc IIIi+ (Serrano)"}, 59 { 0x3e, 0x22, "TI UltraSparc IIIi+ (Serrano)"},
60}; 60};
61 61
62#define NSPARCCHIPS (sizeof(linux_sparc_chips)/sizeof(struct cpu_iu_info)) 62#define NSPARCCHIPS ARRAY_SIZE(linux_sparc_chips)
63 63
64char *sparc_cpu_type = "cpu-oops"; 64char *sparc_cpu_type = "cpu-oops";
65char *sparc_fpu_type = "fpu-oops"; 65char *sparc_fpu_type = "fpu-oops";
diff --git a/arch/sparc64/kernel/ioctl32.c b/arch/sparc64/kernel/ioctl32.c
index e6a00325075a..e62214354bb5 100644
--- a/arch/sparc64/kernel/ioctl32.c
+++ b/arch/sparc64/kernel/ioctl32.c
@@ -11,33 +11,14 @@
11 11
12#define INCLUDES 12#define INCLUDES
13#include "compat_ioctl.c" 13#include "compat_ioctl.c"
14#include <linux/ncp_fs.h>
15#include <linux/syscalls.h> 14#include <linux/syscalls.h>
16#include <asm/fbio.h> 15#include <asm/fbio.h>
17#include <asm/kbio.h>
18#include <asm/vuid_event.h>
19#include <asm/envctrl.h>
20#include <asm/display7seg.h>
21#include <asm/openpromio.h>
22#include <asm/audioio.h>
23#include <asm/watchdog.h>
24 16
25/* Use this to get at 32-bit user passed pointers. 17/* Use this to get at 32-bit user passed pointers.
26 * See sys_sparc32.c for description about it. 18 * See sys_sparc32.c for description about it.
27 */ 19 */
28#define A(__x) compat_ptr(__x) 20#define A(__x) compat_ptr(__x)
29 21
30static __inline__ void *alloc_user_space(long len)
31{
32 struct pt_regs *regs = current_thread_info()->kregs;
33 unsigned long usp = regs->u_regs[UREG_I6];
34
35 if (!(test_thread_flag(TIF_32BIT)))
36 usp += STACK_BIAS;
37
38 return (void *) (usp - len);
39}
40
41#define CODE 22#define CODE
42#include "compat_ioctl.c" 23#include "compat_ioctl.c"
43 24
@@ -111,361 +92,8 @@ static int fbiogscursor(unsigned int fd, unsigned int cmd, unsigned long arg)
111 return sys_ioctl (fd, FBIOSCURSOR, (unsigned long)p); 92 return sys_ioctl (fd, FBIOSCURSOR, (unsigned long)p);
112} 93}
113 94
114#if defined(CONFIG_DRM) || defined(CONFIG_DRM_MODULE)
115/* This really belongs in include/linux/drm.h -DaveM */
116#include "../../../drivers/char/drm/drm.h"
117
118typedef struct drm32_version {
119 int version_major; /* Major version */
120 int version_minor; /* Minor version */
121 int version_patchlevel;/* Patch level */
122 int name_len; /* Length of name buffer */
123 u32 name; /* Name of driver */
124 int date_len; /* Length of date buffer */
125 u32 date; /* User-space buffer to hold date */
126 int desc_len; /* Length of desc buffer */
127 u32 desc; /* User-space buffer to hold desc */
128} drm32_version_t;
129#define DRM32_IOCTL_VERSION DRM_IOWR(0x00, drm32_version_t)
130
131static int drm32_version(unsigned int fd, unsigned int cmd, unsigned long arg)
132{
133 drm32_version_t __user *uversion = (drm32_version_t __user *)arg;
134 drm_version_t __user *p = compat_alloc_user_space(sizeof(*p));
135 compat_uptr_t addr;
136 int n;
137 int ret;
138
139 if (clear_user(p, 3 * sizeof(int)) ||
140 get_user(n, &uversion->name_len) ||
141 put_user(n, &p->name_len) ||
142 get_user(addr, &uversion->name) ||
143 put_user(compat_ptr(addr), &p->name) ||
144 get_user(n, &uversion->date_len) ||
145 put_user(n, &p->date_len) ||
146 get_user(addr, &uversion->date) ||
147 put_user(compat_ptr(addr), &p->date) ||
148 get_user(n, &uversion->desc_len) ||
149 put_user(n, &p->desc_len) ||
150 get_user(addr, &uversion->desc) ||
151 put_user(compat_ptr(addr), &p->desc))
152 return -EFAULT;
153
154 ret = sys_ioctl(fd, DRM_IOCTL_VERSION, (unsigned long)p);
155 if (ret)
156 return ret;
157
158 if (copy_in_user(uversion, p, 3 * sizeof(int)) ||
159 get_user(n, &p->name_len) ||
160 put_user(n, &uversion->name_len) ||
161 get_user(n, &p->date_len) ||
162 put_user(n, &uversion->date_len) ||
163 get_user(n, &p->desc_len) ||
164 put_user(n, &uversion->desc_len))
165 return -EFAULT;
166
167 return 0;
168}
169
170typedef struct drm32_unique {
171 int unique_len; /* Length of unique */
172 u32 unique; /* Unique name for driver instantiation */
173} drm32_unique_t;
174#define DRM32_IOCTL_GET_UNIQUE DRM_IOWR(0x01, drm32_unique_t)
175#define DRM32_IOCTL_SET_UNIQUE DRM_IOW( 0x10, drm32_unique_t)
176
177static int drm32_getsetunique(unsigned int fd, unsigned int cmd, unsigned long arg)
178{
179 drm32_unique_t __user *uarg = (drm32_unique_t __user *)arg;
180 drm_unique_t __user *p = compat_alloc_user_space(sizeof(*p));
181 compat_uptr_t addr;
182 int n;
183 int ret;
184
185 if (get_user(n, &uarg->unique_len) ||
186 put_user(n, &p->unique_len) ||
187 get_user(addr, &uarg->unique) ||
188 put_user(compat_ptr(addr), &p->unique))
189 return -EFAULT;
190
191 if (cmd == DRM32_IOCTL_GET_UNIQUE)
192 ret = sys_ioctl (fd, DRM_IOCTL_GET_UNIQUE, (unsigned long)p);
193 else
194 ret = sys_ioctl (fd, DRM_IOCTL_SET_UNIQUE, (unsigned long)p);
195
196 if (ret)
197 return ret;
198
199 if (get_user(n, &p->unique_len) || put_user(n, &uarg->unique_len))
200 return -EFAULT;
201
202 return 0;
203}
204
205typedef struct drm32_map {
206 u32 offset; /* Requested physical address (0 for SAREA)*/
207 u32 size; /* Requested physical size (bytes) */
208 drm_map_type_t type; /* Type of memory to map */
209 drm_map_flags_t flags; /* Flags */
210 u32 handle; /* User-space: "Handle" to pass to mmap */
211 /* Kernel-space: kernel-virtual address */
212 int mtrr; /* MTRR slot used */
213 /* Private data */
214} drm32_map_t;
215#define DRM32_IOCTL_ADD_MAP DRM_IOWR(0x15, drm32_map_t)
216
217static int drm32_addmap(unsigned int fd, unsigned int cmd, unsigned long arg)
218{
219 drm32_map_t __user *uarg = (drm32_map_t __user *) arg;
220 drm_map_t karg;
221 mm_segment_t old_fs;
222 u32 tmp;
223 int ret;
224
225 ret = get_user(karg.offset, &uarg->offset);
226 ret |= get_user(karg.size, &uarg->size);
227 ret |= get_user(karg.type, &uarg->type);
228 ret |= get_user(karg.flags, &uarg->flags);
229 ret |= get_user(tmp, &uarg->handle);
230 ret |= get_user(karg.mtrr, &uarg->mtrr);
231 if (ret)
232 return -EFAULT;
233
234 karg.handle = (void *) (unsigned long) tmp;
235
236 old_fs = get_fs();
237 set_fs(KERNEL_DS);
238 ret = sys_ioctl(fd, DRM_IOCTL_ADD_MAP, (unsigned long) &karg);
239 set_fs(old_fs);
240
241 if (!ret) {
242 ret = put_user(karg.offset, &uarg->offset);
243 ret |= put_user(karg.size, &uarg->size);
244 ret |= put_user(karg.type, &uarg->type);
245 ret |= put_user(karg.flags, &uarg->flags);
246 tmp = (u32) (long)karg.handle;
247 ret |= put_user(tmp, &uarg->handle);
248 ret |= put_user(karg.mtrr, &uarg->mtrr);
249 if (ret)
250 ret = -EFAULT;
251 }
252
253 return ret;
254}
255
256typedef struct drm32_buf_info {
257 int count; /* Entries in list */
258 u32 list; /* (drm_buf_desc_t *) */
259} drm32_buf_info_t;
260#define DRM32_IOCTL_INFO_BUFS DRM_IOWR(0x18, drm32_buf_info_t)
261
262static int drm32_info_bufs(unsigned int fd, unsigned int cmd, unsigned long arg)
263{
264 drm32_buf_info_t __user *uarg = (drm32_buf_info_t __user *)arg;
265 drm_buf_info_t __user *p = compat_alloc_user_space(sizeof(*p));
266 compat_uptr_t addr;
267 int n;
268 int ret;
269
270 if (get_user(n, &uarg->count) || put_user(n, &p->count) ||
271 get_user(addr, &uarg->list) || put_user(compat_ptr(addr), &p->list))
272 return -EFAULT;
273
274 ret = sys_ioctl(fd, DRM_IOCTL_INFO_BUFS, (unsigned long)p);
275 if (ret)
276 return ret;
277
278 if (get_user(n, &p->count) || put_user(n, &uarg->count))
279 return -EFAULT;
280
281 return 0;
282}
283
284typedef struct drm32_buf_free {
285 int count;
286 u32 list; /* (int *) */
287} drm32_buf_free_t;
288#define DRM32_IOCTL_FREE_BUFS DRM_IOW( 0x1a, drm32_buf_free_t)
289
290static int drm32_free_bufs(unsigned int fd, unsigned int cmd, unsigned long arg)
291{
292 drm32_buf_free_t __user *uarg = (drm32_buf_free_t __user *)arg;
293 drm_buf_free_t __user *p = compat_alloc_user_space(sizeof(*p));
294 compat_uptr_t addr;
295 int n;
296
297 if (get_user(n, &uarg->count) || put_user(n, &p->count) ||
298 get_user(addr, &uarg->list) || put_user(compat_ptr(addr), &p->list))
299 return -EFAULT;
300
301 return sys_ioctl(fd, DRM_IOCTL_FREE_BUFS, (unsigned long)p);
302}
303
304typedef struct drm32_buf_pub {
305 int idx; /* Index into master buflist */
306 int total; /* Buffer size */
307 int used; /* Amount of buffer in use (for DMA) */
308 u32 address; /* Address of buffer (void *) */
309} drm32_buf_pub_t;
310
311typedef struct drm32_buf_map {
312 int count; /* Length of buflist */
313 u32 virtual; /* Mmaped area in user-virtual (void *) */
314 u32 list; /* Buffer information (drm_buf_pub_t *) */
315} drm32_buf_map_t;
316#define DRM32_IOCTL_MAP_BUFS DRM_IOWR(0x19, drm32_buf_map_t)
317
318static int drm32_map_bufs(unsigned int fd, unsigned int cmd, unsigned long arg)
319{
320 drm32_buf_map_t __user *uarg = (drm32_buf_map_t __user *)arg;
321 drm32_buf_pub_t __user *ulist;
322 drm_buf_map_t __user *arg64;
323 drm_buf_pub_t __user *list;
324 int orig_count, ret, i;
325 int n;
326 compat_uptr_t addr;
327
328 if (get_user(orig_count, &uarg->count))
329 return -EFAULT;
330
331 arg64 = compat_alloc_user_space(sizeof(drm_buf_map_t) +
332 (size_t)orig_count * sizeof(drm_buf_pub_t));
333 list = (void __user *)(arg64 + 1);
334
335 if (put_user(orig_count, &arg64->count) ||
336 put_user(list, &arg64->list) ||
337 get_user(addr, &uarg->virtual) ||
338 put_user(compat_ptr(addr), &arg64->virtual) ||
339 get_user(addr, &uarg->list))
340 return -EFAULT;
341
342 ulist = compat_ptr(addr);
343
344 for (i = 0; i < orig_count; i++) {
345 if (get_user(n, &ulist[i].idx) ||
346 put_user(n, &list[i].idx) ||
347 get_user(n, &ulist[i].total) ||
348 put_user(n, &list[i].total) ||
349 get_user(n, &ulist[i].used) ||
350 put_user(n, &list[i].used) ||
351 get_user(addr, &ulist[i].address) ||
352 put_user(compat_ptr(addr), &list[i].address))
353 return -EFAULT;
354 }
355
356 ret = sys_ioctl(fd, DRM_IOCTL_MAP_BUFS, (unsigned long) arg64);
357 if (ret)
358 return ret;
359
360 for (i = 0; i < orig_count; i++) {
361 void __user *p;
362 if (get_user(n, &list[i].idx) ||
363 put_user(n, &ulist[i].idx) ||
364 get_user(n, &list[i].total) ||
365 put_user(n, &ulist[i].total) ||
366 get_user(n, &list[i].used) ||
367 put_user(n, &ulist[i].used) ||
368 get_user(p, &list[i].address) ||
369 put_user((unsigned long)p, &ulist[i].address))
370 return -EFAULT;
371 }
372
373 if (get_user(n, &arg64->count) || put_user(n, &uarg->count))
374 return -EFAULT;
375
376 return 0;
377}
378
379typedef struct drm32_dma {
380 /* Indices here refer to the offset into
381 buflist in drm_buf_get_t. */
382 int context; /* Context handle */
383 int send_count; /* Number of buffers to send */
384 u32 send_indices; /* List of handles to buffers (int *) */
385 u32 send_sizes; /* Lengths of data to send (int *) */
386 drm_dma_flags_t flags; /* Flags */
387 int request_count; /* Number of buffers requested */
388 int request_size; /* Desired size for buffers */
389 u32 request_indices; /* Buffer information (int *) */
390 u32 request_sizes; /* (int *) */
391 int granted_count; /* Number of buffers granted */
392} drm32_dma_t;
393#define DRM32_IOCTL_DMA DRM_IOWR(0x29, drm32_dma_t)
394
395/* RED PEN The DRM layer blindly dereferences the send/request
396 * index/size arrays even though they are userland
397 * pointers. -DaveM
398 */
399static int drm32_dma(unsigned int fd, unsigned int cmd, unsigned long arg)
400{
401 drm32_dma_t __user *uarg = (drm32_dma_t __user *) arg;
402 drm_dma_t __user *p = compat_alloc_user_space(sizeof(*p));
403 compat_uptr_t addr;
404 int ret;
405
406 if (copy_in_user(p, uarg, 2 * sizeof(int)) ||
407 get_user(addr, &uarg->send_indices) ||
408 put_user(compat_ptr(addr), &p->send_indices) ||
409 get_user(addr, &uarg->send_sizes) ||
410 put_user(compat_ptr(addr), &p->send_sizes) ||
411 copy_in_user(&p->flags, &uarg->flags, sizeof(drm_dma_flags_t)) ||
412 copy_in_user(&p->request_count, &uarg->request_count, sizeof(int))||
413 copy_in_user(&p->request_size, &uarg->request_size, sizeof(int)) ||
414 get_user(addr, &uarg->request_indices) ||
415 put_user(compat_ptr(addr), &p->request_indices) ||
416 get_user(addr, &uarg->request_sizes) ||
417 put_user(compat_ptr(addr), &p->request_sizes) ||
418 copy_in_user(&p->granted_count, &uarg->granted_count, sizeof(int)))
419 return -EFAULT;
420
421 ret = sys_ioctl(fd, DRM_IOCTL_DMA, (unsigned long)p);
422 if (ret)
423 return ret;
424
425 if (copy_in_user(uarg, p, 2 * sizeof(int)) ||
426 copy_in_user(&uarg->flags, &p->flags, sizeof(drm_dma_flags_t)) ||
427 copy_in_user(&uarg->request_count, &p->request_count, sizeof(int))||
428 copy_in_user(&uarg->request_size, &p->request_size, sizeof(int)) ||
429 copy_in_user(&uarg->granted_count, &p->granted_count, sizeof(int)))
430 return -EFAULT;
431
432 return 0;
433}
434
435typedef struct drm32_ctx_res {
436 int count;
437 u32 contexts; /* (drm_ctx_t *) */
438} drm32_ctx_res_t;
439#define DRM32_IOCTL_RES_CTX DRM_IOWR(0x26, drm32_ctx_res_t)
440
441static int drm32_res_ctx(unsigned int fd, unsigned int cmd, unsigned long arg)
442{
443 drm32_ctx_res_t __user *uarg = (drm32_ctx_res_t __user *) arg;
444 drm_ctx_res_t __user *p = compat_alloc_user_space(sizeof(*p));
445 compat_uptr_t addr;
446 int ret;
447
448 if (copy_in_user(p, uarg, sizeof(int)) ||
449 get_user(addr, &uarg->contexts) ||
450 put_user(compat_ptr(addr), &p->contexts))
451 return -EFAULT;
452
453 ret = sys_ioctl(fd, DRM_IOCTL_RES_CTX, (unsigned long)p);
454 if (ret)
455 return ret;
456
457 if (copy_in_user(uarg, p, sizeof(int)))
458 return -EFAULT;
459
460 return 0;
461}
462
463#endif
464
465typedef int (* ioctl32_handler_t)(unsigned int, unsigned int, unsigned long, struct file *);
466
467#define COMPATIBLE_IOCTL(cmd) HANDLE_IOCTL((cmd),sys_ioctl) 95#define COMPATIBLE_IOCTL(cmd) HANDLE_IOCTL((cmd),sys_ioctl)
468#define HANDLE_IOCTL(cmd,handler) { (cmd), (ioctl32_handler_t)(handler), NULL }, 96#define HANDLE_IOCTL(cmd,handler) { (cmd), (ioctl_trans_handler_t)(handler), NULL },
469#define IOCTL_TABLE_START \ 97#define IOCTL_TABLE_START \
470 struct ioctl_trans ioctl_start[] = { 98 struct ioctl_trans ioctl_start[] = {
471#define IOCTL_TABLE_END \ 99#define IOCTL_TABLE_END \
@@ -485,103 +113,12 @@ COMPATIBLE_IOCTL(FBIOSCURPOS)
485COMPATIBLE_IOCTL(FBIOGCURPOS) 113COMPATIBLE_IOCTL(FBIOGCURPOS)
486COMPATIBLE_IOCTL(FBIOGCURMAX) 114COMPATIBLE_IOCTL(FBIOGCURMAX)
487/* Little k */ 115/* Little k */
488COMPATIBLE_IOCTL(KIOCTYPE)
489COMPATIBLE_IOCTL(KIOCLAYOUT)
490COMPATIBLE_IOCTL(KIOCGTRANS)
491COMPATIBLE_IOCTL(KIOCTRANS)
492COMPATIBLE_IOCTL(KIOCCMD)
493COMPATIBLE_IOCTL(KIOCSDIRECT)
494COMPATIBLE_IOCTL(KIOCSLED)
495COMPATIBLE_IOCTL(KIOCGLED)
496COMPATIBLE_IOCTL(KIOCSRATE)
497COMPATIBLE_IOCTL(KIOCGRATE)
498COMPATIBLE_IOCTL(VUIDSFORMAT)
499COMPATIBLE_IOCTL(VUIDGFORMAT)
500/* Little v, the video4linux ioctls */ 116/* Little v, the video4linux ioctls */
501COMPATIBLE_IOCTL(_IOR('p', 20, int[7])) /* RTCGET */
502COMPATIBLE_IOCTL(_IOW('p', 21, int[7])) /* RTCSET */
503COMPATIBLE_IOCTL(ENVCTRL_RD_WARNING_TEMPERATURE)
504COMPATIBLE_IOCTL(ENVCTRL_RD_SHUTDOWN_TEMPERATURE)
505COMPATIBLE_IOCTL(ENVCTRL_RD_CPU_TEMPERATURE)
506COMPATIBLE_IOCTL(ENVCTRL_RD_FAN_STATUS)
507COMPATIBLE_IOCTL(ENVCTRL_RD_VOLTAGE_STATUS)
508COMPATIBLE_IOCTL(ENVCTRL_RD_SCSI_TEMPERATURE)
509COMPATIBLE_IOCTL(ENVCTRL_RD_ETHERNET_TEMPERATURE)
510COMPATIBLE_IOCTL(ENVCTRL_RD_MTHRBD_TEMPERATURE)
511COMPATIBLE_IOCTL(ENVCTRL_RD_CPU_VOLTAGE)
512COMPATIBLE_IOCTL(ENVCTRL_RD_GLOBALADDRESS)
513/* COMPATIBLE_IOCTL(D7SIOCRD) same value as ENVCTRL_RD_VOLTAGE_STATUS */
514COMPATIBLE_IOCTL(D7SIOCWR)
515COMPATIBLE_IOCTL(D7SIOCTM)
516/* OPENPROMIO, SunOS/Solaris only, the NetBSD one's have
517 * embedded pointers in the arg which we'd need to clean up...
518 */
519COMPATIBLE_IOCTL(OPROMGETOPT)
520COMPATIBLE_IOCTL(OPROMSETOPT)
521COMPATIBLE_IOCTL(OPROMNXTOPT)
522COMPATIBLE_IOCTL(OPROMSETOPT2)
523COMPATIBLE_IOCTL(OPROMNEXT)
524COMPATIBLE_IOCTL(OPROMCHILD)
525COMPATIBLE_IOCTL(OPROMGETPROP)
526COMPATIBLE_IOCTL(OPROMNXTPROP)
527COMPATIBLE_IOCTL(OPROMU2P)
528COMPATIBLE_IOCTL(OPROMGETCONS)
529COMPATIBLE_IOCTL(OPROMGETFBNAME)
530COMPATIBLE_IOCTL(OPROMGETBOOTARGS)
531COMPATIBLE_IOCTL(OPROMSETCUR)
532COMPATIBLE_IOCTL(OPROMPCI2NODE)
533COMPATIBLE_IOCTL(OPROMPATH2NODE)
534/* Big L */
535COMPATIBLE_IOCTL(LOOP_SET_STATUS64)
536COMPATIBLE_IOCTL(LOOP_GET_STATUS64)
537/* Big A */
538COMPATIBLE_IOCTL(AUDIO_GETINFO)
539COMPATIBLE_IOCTL(AUDIO_SETINFO)
540COMPATIBLE_IOCTL(AUDIO_DRAIN)
541COMPATIBLE_IOCTL(AUDIO_GETDEV)
542COMPATIBLE_IOCTL(AUDIO_GETDEV_SUNOS)
543COMPATIBLE_IOCTL(AUDIO_FLUSH)
544COMPATIBLE_IOCTL(AUTOFS_IOC_EXPIRE_MULTI)
545#if defined(CONFIG_DRM) || defined(CONFIG_DRM_MODULE)
546COMPATIBLE_IOCTL(DRM_IOCTL_GET_MAGIC)
547COMPATIBLE_IOCTL(DRM_IOCTL_IRQ_BUSID)
548COMPATIBLE_IOCTL(DRM_IOCTL_AUTH_MAGIC)
549COMPATIBLE_IOCTL(DRM_IOCTL_BLOCK)
550COMPATIBLE_IOCTL(DRM_IOCTL_UNBLOCK)
551COMPATIBLE_IOCTL(DRM_IOCTL_CONTROL)
552COMPATIBLE_IOCTL(DRM_IOCTL_ADD_BUFS)
553COMPATIBLE_IOCTL(DRM_IOCTL_MARK_BUFS)
554COMPATIBLE_IOCTL(DRM_IOCTL_ADD_CTX)
555COMPATIBLE_IOCTL(DRM_IOCTL_RM_CTX)
556COMPATIBLE_IOCTL(DRM_IOCTL_MOD_CTX)
557COMPATIBLE_IOCTL(DRM_IOCTL_GET_CTX)
558COMPATIBLE_IOCTL(DRM_IOCTL_SWITCH_CTX)
559COMPATIBLE_IOCTL(DRM_IOCTL_NEW_CTX)
560COMPATIBLE_IOCTL(DRM_IOCTL_ADD_DRAW)
561COMPATIBLE_IOCTL(DRM_IOCTL_RM_DRAW)
562COMPATIBLE_IOCTL(DRM_IOCTL_LOCK)
563COMPATIBLE_IOCTL(DRM_IOCTL_UNLOCK)
564COMPATIBLE_IOCTL(DRM_IOCTL_FINISH)
565#endif /* DRM */
566COMPATIBLE_IOCTL(WIOCSTART)
567COMPATIBLE_IOCTL(WIOCSTOP)
568COMPATIBLE_IOCTL(WIOCGSTAT)
569/* And these ioctls need translation */ 117/* And these ioctls need translation */
570/* Note SIOCRTMSG is no longer, so this is safe and * the user would have seen just an -EINVAL anyways. */ 118/* Note SIOCRTMSG is no longer, so this is safe and * the user would have seen just an -EINVAL anyways. */
571HANDLE_IOCTL(FBIOPUTCMAP32, fbiogetputcmap) 119HANDLE_IOCTL(FBIOPUTCMAP32, fbiogetputcmap)
572HANDLE_IOCTL(FBIOGETCMAP32, fbiogetputcmap) 120HANDLE_IOCTL(FBIOGETCMAP32, fbiogetputcmap)
573HANDLE_IOCTL(FBIOSCURSOR32, fbiogscursor) 121HANDLE_IOCTL(FBIOSCURSOR32, fbiogscursor)
574#if defined(CONFIG_DRM) || defined(CONFIG_DRM_MODULE)
575HANDLE_IOCTL(DRM32_IOCTL_VERSION, drm32_version)
576HANDLE_IOCTL(DRM32_IOCTL_GET_UNIQUE, drm32_getsetunique)
577HANDLE_IOCTL(DRM32_IOCTL_SET_UNIQUE, drm32_getsetunique)
578HANDLE_IOCTL(DRM32_IOCTL_ADD_MAP, drm32_addmap)
579HANDLE_IOCTL(DRM32_IOCTL_INFO_BUFS, drm32_info_bufs)
580HANDLE_IOCTL(DRM32_IOCTL_FREE_BUFS, drm32_free_bufs)
581HANDLE_IOCTL(DRM32_IOCTL_MAP_BUFS, drm32_map_bufs)
582HANDLE_IOCTL(DRM32_IOCTL_DMA, drm32_dma)
583HANDLE_IOCTL(DRM32_IOCTL_RES_CTX, drm32_res_ctx)
584#endif /* DRM */
585#if 0 122#if 0
586HANDLE_IOCTL(RTC32_IRQP_READ, do_rtc_ioctl) 123HANDLE_IOCTL(RTC32_IRQP_READ, do_rtc_ioctl)
587HANDLE_IOCTL(RTC32_IRQP_SET, do_rtc_ioctl) 124HANDLE_IOCTL(RTC32_IRQP_SET, do_rtc_ioctl)
diff --git a/arch/sparc64/kernel/kprobes.c b/arch/sparc64/kernel/kprobes.c
index 0d66d07c8c6e..96bd09b098f4 100644
--- a/arch/sparc64/kernel/kprobes.c
+++ b/arch/sparc64/kernel/kprobes.c
@@ -38,6 +38,9 @@
38 * - Mark that we are no longer actively in a kprobe. 38 * - Mark that we are no longer actively in a kprobe.
39 */ 39 */
40 40
41DEFINE_PER_CPU(struct kprobe *, current_kprobe) = NULL;
42DEFINE_PER_CPU(struct kprobe_ctlblk, kprobe_ctlblk);
43
41int __kprobes arch_prepare_kprobe(struct kprobe *p) 44int __kprobes arch_prepare_kprobe(struct kprobe *p)
42{ 45{
43 return 0; 46 return 0;
@@ -66,46 +69,39 @@ void __kprobes arch_remove_kprobe(struct kprobe *p)
66{ 69{
67} 70}
68 71
69static struct kprobe *current_kprobe; 72static inline void save_previous_kprobe(struct kprobe_ctlblk *kcb)
70static unsigned long current_kprobe_orig_tnpc;
71static unsigned long current_kprobe_orig_tstate_pil;
72static unsigned int kprobe_status;
73static struct kprobe *kprobe_prev;
74static unsigned long kprobe_orig_tnpc_prev;
75static unsigned long kprobe_orig_tstate_pil_prev;
76static unsigned int kprobe_status_prev;
77
78static inline void save_previous_kprobe(void)
79{ 73{
80 kprobe_status_prev = kprobe_status; 74 kcb->prev_kprobe.kp = kprobe_running();
81 kprobe_orig_tnpc_prev = current_kprobe_orig_tnpc; 75 kcb->prev_kprobe.status = kcb->kprobe_status;
82 kprobe_orig_tstate_pil_prev = current_kprobe_orig_tstate_pil; 76 kcb->prev_kprobe.orig_tnpc = kcb->kprobe_orig_tnpc;
83 kprobe_prev = current_kprobe; 77 kcb->prev_kprobe.orig_tstate_pil = kcb->kprobe_orig_tstate_pil;
84} 78}
85 79
86static inline void restore_previous_kprobe(void) 80static inline void restore_previous_kprobe(struct kprobe_ctlblk *kcb)
87{ 81{
88 kprobe_status = kprobe_status_prev; 82 __get_cpu_var(current_kprobe) = kcb->prev_kprobe.kp;
89 current_kprobe_orig_tnpc = kprobe_orig_tnpc_prev; 83 kcb->kprobe_status = kcb->prev_kprobe.status;
90 current_kprobe_orig_tstate_pil = kprobe_orig_tstate_pil_prev; 84 kcb->kprobe_orig_tnpc = kcb->prev_kprobe.orig_tnpc;
91 current_kprobe = kprobe_prev; 85 kcb->kprobe_orig_tstate_pil = kcb->prev_kprobe.orig_tstate_pil;
92} 86}
93 87
94static inline void set_current_kprobe(struct kprobe *p, struct pt_regs *regs) 88static inline void set_current_kprobe(struct kprobe *p, struct pt_regs *regs,
89 struct kprobe_ctlblk *kcb)
95{ 90{
96 current_kprobe_orig_tnpc = regs->tnpc; 91 __get_cpu_var(current_kprobe) = p;
97 current_kprobe_orig_tstate_pil = (regs->tstate & TSTATE_PIL); 92 kcb->kprobe_orig_tnpc = regs->tnpc;
98 current_kprobe = p; 93 kcb->kprobe_orig_tstate_pil = (regs->tstate & TSTATE_PIL);
99} 94}
100 95
101static inline void prepare_singlestep(struct kprobe *p, struct pt_regs *regs) 96static inline void prepare_singlestep(struct kprobe *p, struct pt_regs *regs,
97 struct kprobe_ctlblk *kcb)
102{ 98{
103 regs->tstate |= TSTATE_PIL; 99 regs->tstate |= TSTATE_PIL;
104 100
105 /*single step inline, if it a breakpoint instruction*/ 101 /*single step inline, if it a breakpoint instruction*/
106 if (p->opcode == BREAKPOINT_INSTRUCTION) { 102 if (p->opcode == BREAKPOINT_INSTRUCTION) {
107 regs->tpc = (unsigned long) p->addr; 103 regs->tpc = (unsigned long) p->addr;
108 regs->tnpc = current_kprobe_orig_tnpc; 104 regs->tnpc = kcb->kprobe_orig_tnpc;
109 } else { 105 } else {
110 regs->tpc = (unsigned long) &p->ainsn.insn[0]; 106 regs->tpc = (unsigned long) &p->ainsn.insn[0];
111 regs->tnpc = (unsigned long) &p->ainsn.insn[1]; 107 regs->tnpc = (unsigned long) &p->ainsn.insn[1];
@@ -117,19 +113,21 @@ static int __kprobes kprobe_handler(struct pt_regs *regs)
117 struct kprobe *p; 113 struct kprobe *p;
118 void *addr = (void *) regs->tpc; 114 void *addr = (void *) regs->tpc;
119 int ret = 0; 115 int ret = 0;
116 struct kprobe_ctlblk *kcb;
120 117
118 /*
119 * We don't want to be preempted for the entire
120 * duration of kprobe processing
121 */
121 preempt_disable(); 122 preempt_disable();
123 kcb = get_kprobe_ctlblk();
122 124
123 if (kprobe_running()) { 125 if (kprobe_running()) {
124 /* We *are* holding lock here, so this is safe.
125 * Disarm the probe we just hit, and ignore it.
126 */
127 p = get_kprobe(addr); 126 p = get_kprobe(addr);
128 if (p) { 127 if (p) {
129 if (kprobe_status == KPROBE_HIT_SS) { 128 if (kcb->kprobe_status == KPROBE_HIT_SS) {
130 regs->tstate = ((regs->tstate & ~TSTATE_PIL) | 129 regs->tstate = ((regs->tstate & ~TSTATE_PIL) |
131 current_kprobe_orig_tstate_pil); 130 kcb->kprobe_orig_tstate_pil);
132 unlock_kprobes();
133 goto no_kprobe; 131 goto no_kprobe;
134 } 132 }
135 /* We have reentered the kprobe_handler(), since 133 /* We have reentered the kprobe_handler(), since
@@ -138,25 +136,22 @@ static int __kprobes kprobe_handler(struct pt_regs *regs)
138 * just single step on the instruction of the new probe 136 * just single step on the instruction of the new probe
139 * without calling any user handlers. 137 * without calling any user handlers.
140 */ 138 */
141 save_previous_kprobe(); 139 save_previous_kprobe(kcb);
142 set_current_kprobe(p, regs); 140 set_current_kprobe(p, regs, kcb);
143 p->nmissed++; 141 p->nmissed++;
144 kprobe_status = KPROBE_REENTER; 142 kcb->kprobe_status = KPROBE_REENTER;
145 prepare_singlestep(p, regs); 143 prepare_singlestep(p, regs, kcb);
146 return 1; 144 return 1;
147 } else { 145 } else {
148 p = current_kprobe; 146 p = __get_cpu_var(current_kprobe);
149 if (p->break_handler && p->break_handler(p, regs)) 147 if (p->break_handler && p->break_handler(p, regs))
150 goto ss_probe; 148 goto ss_probe;
151 } 149 }
152 /* If it's not ours, can't be delete race, (we hold lock). */
153 goto no_kprobe; 150 goto no_kprobe;
154 } 151 }
155 152
156 lock_kprobes();
157 p = get_kprobe(addr); 153 p = get_kprobe(addr);
158 if (!p) { 154 if (!p) {
159 unlock_kprobes();
160 if (*(u32 *)addr != BREAKPOINT_INSTRUCTION) { 155 if (*(u32 *)addr != BREAKPOINT_INSTRUCTION) {
161 /* 156 /*
162 * The breakpoint instruction was removed right 157 * The breakpoint instruction was removed right
@@ -171,14 +166,14 @@ static int __kprobes kprobe_handler(struct pt_regs *regs)
171 goto no_kprobe; 166 goto no_kprobe;
172 } 167 }
173 168
174 set_current_kprobe(p, regs); 169 set_current_kprobe(p, regs, kcb);
175 kprobe_status = KPROBE_HIT_ACTIVE; 170 kcb->kprobe_status = KPROBE_HIT_ACTIVE;
176 if (p->pre_handler && p->pre_handler(p, regs)) 171 if (p->pre_handler && p->pre_handler(p, regs))
177 return 1; 172 return 1;
178 173
179ss_probe: 174ss_probe:
180 prepare_singlestep(p, regs); 175 prepare_singlestep(p, regs, kcb);
181 kprobe_status = KPROBE_HIT_SS; 176 kcb->kprobe_status = KPROBE_HIT_SS;
182 return 1; 177 return 1;
183 178
184no_kprobe: 179no_kprobe:
@@ -260,11 +255,12 @@ static void __kprobes retpc_fixup(struct pt_regs *regs, u32 insn,
260 * This function prepares to return from the post-single-step 255 * This function prepares to return from the post-single-step
261 * breakpoint trap. 256 * breakpoint trap.
262 */ 257 */
263static void __kprobes resume_execution(struct kprobe *p, struct pt_regs *regs) 258static void __kprobes resume_execution(struct kprobe *p,
259 struct pt_regs *regs, struct kprobe_ctlblk *kcb)
264{ 260{
265 u32 insn = p->ainsn.insn[0]; 261 u32 insn = p->ainsn.insn[0];
266 262
267 regs->tpc = current_kprobe_orig_tnpc; 263 regs->tpc = kcb->kprobe_orig_tnpc;
268 regs->tnpc = relbranch_fixup(insn, 264 regs->tnpc = relbranch_fixup(insn,
269 (unsigned long) p->addr, 265 (unsigned long) p->addr,
270 (unsigned long) &p->ainsn.insn[0], 266 (unsigned long) &p->ainsn.insn[0],
@@ -272,44 +268,48 @@ static void __kprobes resume_execution(struct kprobe *p, struct pt_regs *regs)
272 retpc_fixup(regs, insn, (unsigned long) p->addr); 268 retpc_fixup(regs, insn, (unsigned long) p->addr);
273 269
274 regs->tstate = ((regs->tstate & ~TSTATE_PIL) | 270 regs->tstate = ((regs->tstate & ~TSTATE_PIL) |
275 current_kprobe_orig_tstate_pil); 271 kcb->kprobe_orig_tstate_pil);
276} 272}
277 273
278static inline int post_kprobe_handler(struct pt_regs *regs) 274static inline int post_kprobe_handler(struct pt_regs *regs)
279{ 275{
280 if (!kprobe_running()) 276 struct kprobe *cur = kprobe_running();
277 struct kprobe_ctlblk *kcb = get_kprobe_ctlblk();
278
279 if (!cur)
281 return 0; 280 return 0;
282 281
283 if ((kprobe_status != KPROBE_REENTER) && current_kprobe->post_handler) { 282 if ((kcb->kprobe_status != KPROBE_REENTER) && cur->post_handler) {
284 kprobe_status = KPROBE_HIT_SSDONE; 283 kcb->kprobe_status = KPROBE_HIT_SSDONE;
285 current_kprobe->post_handler(current_kprobe, regs, 0); 284 cur->post_handler(cur, regs, 0);
286 } 285 }
287 286
288 resume_execution(current_kprobe, regs); 287 resume_execution(cur, regs, kcb);
289 288
290 /*Restore back the original saved kprobes variables and continue. */ 289 /*Restore back the original saved kprobes variables and continue. */
291 if (kprobe_status == KPROBE_REENTER) { 290 if (kcb->kprobe_status == KPROBE_REENTER) {
292 restore_previous_kprobe(); 291 restore_previous_kprobe(kcb);
293 goto out; 292 goto out;
294 } 293 }
295 unlock_kprobes(); 294 reset_current_kprobe();
296out: 295out:
297 preempt_enable_no_resched(); 296 preempt_enable_no_resched();
298 297
299 return 1; 298 return 1;
300} 299}
301 300
302/* Interrupts disabled, kprobe_lock held. */
303static inline int kprobe_fault_handler(struct pt_regs *regs, int trapnr) 301static inline int kprobe_fault_handler(struct pt_regs *regs, int trapnr)
304{ 302{
305 if (current_kprobe->fault_handler 303 struct kprobe *cur = kprobe_running();
306 && current_kprobe->fault_handler(current_kprobe, regs, trapnr)) 304 struct kprobe_ctlblk *kcb = get_kprobe_ctlblk();
305
306 if (cur->fault_handler && cur->fault_handler(cur, regs, trapnr))
307 return 1; 307 return 1;
308 308
309 if (kprobe_status & KPROBE_HIT_SS) { 309 if (kcb->kprobe_status & KPROBE_HIT_SS) {
310 resume_execution(current_kprobe, regs); 310 resume_execution(cur, regs, kcb);
311 311
312 unlock_kprobes(); 312 reset_current_kprobe();
313 preempt_enable_no_resched(); 313 preempt_enable_no_resched();
314 } 314 }
315 return 0; 315 return 0;
@@ -322,29 +322,30 @@ int __kprobes kprobe_exceptions_notify(struct notifier_block *self,
322 unsigned long val, void *data) 322 unsigned long val, void *data)
323{ 323{
324 struct die_args *args = (struct die_args *)data; 324 struct die_args *args = (struct die_args *)data;
325 int ret = NOTIFY_DONE;
326
325 switch (val) { 327 switch (val) {
326 case DIE_DEBUG: 328 case DIE_DEBUG:
327 if (kprobe_handler(args->regs)) 329 if (kprobe_handler(args->regs))
328 return NOTIFY_STOP; 330 ret = NOTIFY_STOP;
329 break; 331 break;
330 case DIE_DEBUG_2: 332 case DIE_DEBUG_2:
331 if (post_kprobe_handler(args->regs)) 333 if (post_kprobe_handler(args->regs))
332 return NOTIFY_STOP; 334 ret = NOTIFY_STOP;
333 break; 335 break;
334 case DIE_GPF: 336 case DIE_GPF:
335 if (kprobe_running() &&
336 kprobe_fault_handler(args->regs, args->trapnr))
337 return NOTIFY_STOP;
338 break;
339 case DIE_PAGE_FAULT: 337 case DIE_PAGE_FAULT:
338 /* kprobe_running() needs smp_processor_id() */
339 preempt_disable();
340 if (kprobe_running() && 340 if (kprobe_running() &&
341 kprobe_fault_handler(args->regs, args->trapnr)) 341 kprobe_fault_handler(args->regs, args->trapnr))
342 return NOTIFY_STOP; 342 ret = NOTIFY_STOP;
343 preempt_enable();
343 break; 344 break;
344 default: 345 default:
345 break; 346 break;
346 } 347 }
347 return NOTIFY_DONE; 348 return ret;
348} 349}
349 350
350asmlinkage void __kprobes kprobe_trap(unsigned long trap_level, 351asmlinkage void __kprobes kprobe_trap(unsigned long trap_level,
@@ -368,24 +369,21 @@ asmlinkage void __kprobes kprobe_trap(unsigned long trap_level,
368} 369}
369 370
370/* Jprobes support. */ 371/* Jprobes support. */
371static struct pt_regs jprobe_saved_regs;
372static struct pt_regs *jprobe_saved_regs_location;
373static struct sparc_stackf jprobe_saved_stack;
374
375int __kprobes setjmp_pre_handler(struct kprobe *p, struct pt_regs *regs) 372int __kprobes setjmp_pre_handler(struct kprobe *p, struct pt_regs *regs)
376{ 373{
377 struct jprobe *jp = container_of(p, struct jprobe, kp); 374 struct jprobe *jp = container_of(p, struct jprobe, kp);
375 struct kprobe_ctlblk *kcb = get_kprobe_ctlblk();
378 376
379 jprobe_saved_regs_location = regs; 377 kcb->jprobe_saved_regs_location = regs;
380 memcpy(&jprobe_saved_regs, regs, sizeof(*regs)); 378 memcpy(&(kcb->jprobe_saved_regs), regs, sizeof(*regs));
381 379
382 /* Save a whole stack frame, this gets arguments 380 /* Save a whole stack frame, this gets arguments
383 * pushed onto the stack after using up all the 381 * pushed onto the stack after using up all the
384 * arg registers. 382 * arg registers.
385 */ 383 */
386 memcpy(&jprobe_saved_stack, 384 memcpy(&(kcb->jprobe_saved_stack),
387 (char *) (regs->u_regs[UREG_FP] + STACK_BIAS), 385 (char *) (regs->u_regs[UREG_FP] + STACK_BIAS),
388 sizeof(jprobe_saved_stack)); 386 sizeof(kcb->jprobe_saved_stack));
389 387
390 regs->tpc = (unsigned long) jp->entry; 388 regs->tpc = (unsigned long) jp->entry;
391 regs->tnpc = ((unsigned long) jp->entry) + 0x4UL; 389 regs->tnpc = ((unsigned long) jp->entry) + 0x4UL;
@@ -396,7 +394,6 @@ int __kprobes setjmp_pre_handler(struct kprobe *p, struct pt_regs *regs)
396 394
397void __kprobes jprobe_return(void) 395void __kprobes jprobe_return(void)
398{ 396{
399 preempt_enable_no_resched();
400 __asm__ __volatile__( 397 __asm__ __volatile__(
401 ".globl jprobe_return_trap_instruction\n" 398 ".globl jprobe_return_trap_instruction\n"
402"jprobe_return_trap_instruction:\n\t" 399"jprobe_return_trap_instruction:\n\t"
@@ -410,14 +407,15 @@ extern void __show_regs(struct pt_regs * regs);
410int __kprobes longjmp_break_handler(struct kprobe *p, struct pt_regs *regs) 407int __kprobes longjmp_break_handler(struct kprobe *p, struct pt_regs *regs)
411{ 408{
412 u32 *addr = (u32 *) regs->tpc; 409 u32 *addr = (u32 *) regs->tpc;
410 struct kprobe_ctlblk *kcb = get_kprobe_ctlblk();
413 411
414 if (addr == (u32 *) jprobe_return_trap_instruction) { 412 if (addr == (u32 *) jprobe_return_trap_instruction) {
415 if (jprobe_saved_regs_location != regs) { 413 if (kcb->jprobe_saved_regs_location != regs) {
416 printk("JPROBE: Current regs (%p) does not match " 414 printk("JPROBE: Current regs (%p) does not match "
417 "saved regs (%p).\n", 415 "saved regs (%p).\n",
418 regs, jprobe_saved_regs_location); 416 regs, kcb->jprobe_saved_regs_location);
419 printk("JPROBE: Saved registers\n"); 417 printk("JPROBE: Saved registers\n");
420 __show_regs(jprobe_saved_regs_location); 418 __show_regs(kcb->jprobe_saved_regs_location);
421 printk("JPROBE: Current registers\n"); 419 printk("JPROBE: Current registers\n");
422 __show_regs(regs); 420 __show_regs(regs);
423 BUG(); 421 BUG();
@@ -426,12 +424,13 @@ int __kprobes longjmp_break_handler(struct kprobe *p, struct pt_regs *regs)
426 * first so that UREG_FP is the original one for 424 * first so that UREG_FP is the original one for
427 * the stack frame restore. 425 * the stack frame restore.
428 */ 426 */
429 memcpy(regs, &jprobe_saved_regs, sizeof(*regs)); 427 memcpy(regs, &(kcb->jprobe_saved_regs), sizeof(*regs));
430 428
431 memcpy((char *) (regs->u_regs[UREG_FP] + STACK_BIAS), 429 memcpy((char *) (regs->u_regs[UREG_FP] + STACK_BIAS),
432 &jprobe_saved_stack, 430 &(kcb->jprobe_saved_stack),
433 sizeof(jprobe_saved_stack)); 431 sizeof(kcb->jprobe_saved_stack));
434 432
433 preempt_enable_no_resched();
435 return 1; 434 return 1;
436 } 435 }
437 return 0; 436 return 0;
diff --git a/arch/sparc64/kernel/process.c b/arch/sparc64/kernel/process.c
index 7d10b0397091..02f9dec1d459 100644
--- a/arch/sparc64/kernel/process.c
+++ b/arch/sparc64/kernel/process.c
@@ -74,7 +74,9 @@ void cpu_idle(void)
74 while (!need_resched()) 74 while (!need_resched())
75 barrier(); 75 barrier();
76 76
77 preempt_enable_no_resched();
77 schedule(); 78 schedule();
79 preempt_disable();
78 check_pgt_cache(); 80 check_pgt_cache();
79 } 81 }
80} 82}
@@ -83,21 +85,31 @@ void cpu_idle(void)
83 85
84/* 86/*
85 * the idle loop on a UltraMultiPenguin... 87 * the idle loop on a UltraMultiPenguin...
88 *
89 * TIF_POLLING_NRFLAG is set because we do not sleep the cpu
90 * inside of the idler task, so an interrupt is not needed
91 * to get a clean fast response.
92 *
93 * XXX Reverify this assumption... -DaveM
94 *
95 * Addendum: We do want it to do something for the signal
96 * delivery case, we detect that by just seeing
97 * if we are trying to send this to an idler or not.
86 */ 98 */
87#define idle_me_harder() (cpu_data(smp_processor_id()).idle_volume += 1)
88#define unidle_me() (cpu_data(smp_processor_id()).idle_volume = 0)
89void cpu_idle(void) 99void cpu_idle(void)
90{ 100{
101 cpuinfo_sparc *cpuinfo = &local_cpu_data();
91 set_thread_flag(TIF_POLLING_NRFLAG); 102 set_thread_flag(TIF_POLLING_NRFLAG);
103
92 while(1) { 104 while(1) {
93 if (need_resched()) { 105 if (need_resched()) {
94 unidle_me(); 106 cpuinfo->idle_volume = 0;
95 clear_thread_flag(TIF_POLLING_NRFLAG); 107 preempt_enable_no_resched();
96 schedule(); 108 schedule();
97 set_thread_flag(TIF_POLLING_NRFLAG); 109 preempt_disable();
98 check_pgt_cache(); 110 check_pgt_cache();
99 } 111 }
100 idle_me_harder(); 112 cpuinfo->idle_volume++;
101 113
102 /* The store ordering is so that IRQ handlers on 114 /* The store ordering is so that IRQ handlers on
103 * other cpus see our increasing idleness for the buddy 115 * other cpus see our increasing idleness for the buddy
diff --git a/arch/sparc64/kernel/sbus.c b/arch/sparc64/kernel/sbus.c
index e09ddf927655..96b825055668 100644
--- a/arch/sparc64/kernel/sbus.c
+++ b/arch/sparc64/kernel/sbus.c
@@ -790,7 +790,7 @@ static unsigned long sysio_irq_offsets[] = {
790 790
791#undef bogon 791#undef bogon
792 792
793#define NUM_SYSIO_OFFSETS (sizeof(sysio_irq_offsets) / sizeof(sysio_irq_offsets[0])) 793#define NUM_SYSIO_OFFSETS ARRAY_SIZE(sysio_irq_offsets)
794 794
795/* Convert Interrupt Mapping register pointer to associated 795/* Convert Interrupt Mapping register pointer to associated
796 * Interrupt Clear register pointer, SYSIO specific version. 796 * Interrupt Clear register pointer, SYSIO specific version.
diff --git a/arch/sparc64/kernel/setup.c b/arch/sparc64/kernel/setup.c
index c1f34237cdf2..bf1849dd9c49 100644
--- a/arch/sparc64/kernel/setup.c
+++ b/arch/sparc64/kernel/setup.c
@@ -154,6 +154,7 @@ int prom_callback(long *args)
154 pud_t *pudp; 154 pud_t *pudp;
155 pmd_t *pmdp; 155 pmd_t *pmdp;
156 pte_t *ptep; 156 pte_t *ptep;
157 pte_t pte;
157 158
158 for_each_process(p) { 159 for_each_process(p) {
159 mm = p->mm; 160 mm = p->mm;
@@ -178,8 +179,9 @@ int prom_callback(long *args)
178 * being called from inside OBP. 179 * being called from inside OBP.
179 */ 180 */
180 ptep = pte_offset_map(pmdp, va); 181 ptep = pte_offset_map(pmdp, va);
181 if (pte_present(*ptep)) { 182 pte = *ptep;
182 tte = pte_val(*ptep); 183 if (pte_present(pte)) {
184 tte = pte_val(pte);
183 res = PROM_TRUE; 185 res = PROM_TRUE;
184 } 186 }
185 pte_unmap(ptep); 187 pte_unmap(ptep);
@@ -218,6 +220,7 @@ int prom_callback(long *args)
218 pud_t *pudp; 220 pud_t *pudp;
219 pmd_t *pmdp; 221 pmd_t *pmdp;
220 pte_t *ptep; 222 pte_t *ptep;
223 pte_t pte;
221 int error; 224 int error;
222 225
223 if ((va >= LOW_OBP_ADDRESS) && (va < HI_OBP_ADDRESS)) { 226 if ((va >= LOW_OBP_ADDRESS) && (va < HI_OBP_ADDRESS)) {
@@ -240,8 +243,9 @@ int prom_callback(long *args)
240 * being called from inside OBP. 243 * being called from inside OBP.
241 */ 244 */
242 ptep = pte_offset_kernel(pmdp, va); 245 ptep = pte_offset_kernel(pmdp, va);
243 if (pte_present(*ptep)) { 246 pte = *ptep;
244 tte = pte_val(*ptep); 247 if (pte_present(pte)) {
248 tte = pte_val(pte);
245 res = PROM_TRUE; 249 res = PROM_TRUE;
246 } 250 }
247 goto done; 251 goto done;
diff --git a/arch/sparc64/kernel/signal32.c b/arch/sparc64/kernel/signal32.c
index aecccd0df1d1..009a86e5ded4 100644
--- a/arch/sparc64/kernel/signal32.c
+++ b/arch/sparc64/kernel/signal32.c
@@ -863,6 +863,7 @@ static void new_setup_frame32(struct k_sigaction *ka, struct pt_regs *regs,
863 pud_t *pudp = pud_offset(pgdp, address); 863 pud_t *pudp = pud_offset(pgdp, address);
864 pmd_t *pmdp = pmd_offset(pudp, address); 864 pmd_t *pmdp = pmd_offset(pudp, address);
865 pte_t *ptep; 865 pte_t *ptep;
866 pte_t pte;
866 867
867 regs->u_regs[UREG_I7] = (unsigned long) (&(sf->insns[0]) - 2); 868 regs->u_regs[UREG_I7] = (unsigned long) (&(sf->insns[0]) - 2);
868 869
@@ -873,9 +874,10 @@ static void new_setup_frame32(struct k_sigaction *ka, struct pt_regs *regs,
873 874
874 preempt_disable(); 875 preempt_disable();
875 ptep = pte_offset_map(pmdp, address); 876 ptep = pte_offset_map(pmdp, address);
876 if (pte_present(*ptep)) { 877 pte = *ptep;
878 if (pte_present(pte)) {
877 unsigned long page = (unsigned long) 879 unsigned long page = (unsigned long)
878 page_address(pte_page(*ptep)); 880 page_address(pte_page(pte));
879 881
880 wmb(); 882 wmb();
881 __asm__ __volatile__("flush %0 + %1" 883 __asm__ __volatile__("flush %0 + %1"
diff --git a/arch/sparc64/kernel/smp.c b/arch/sparc64/kernel/smp.c
index b137fd63f5e1..797a65493fb8 100644
--- a/arch/sparc64/kernel/smp.c
+++ b/arch/sparc64/kernel/smp.c
@@ -168,6 +168,9 @@ void __init smp_callin(void)
168 rmb(); 168 rmb();
169 169
170 cpu_set(cpuid, cpu_online_map); 170 cpu_set(cpuid, cpu_online_map);
171
172 /* idle thread is expected to have preempt disabled */
173 preempt_disable();
171} 174}
172 175
173void cpu_panic(void) 176void cpu_panic(void)
@@ -839,43 +842,29 @@ void smp_flush_tlb_all(void)
839 * questionable (in theory the big win for threads is the massive sharing of 842 * questionable (in theory the big win for threads is the massive sharing of
840 * address space state across processors). 843 * address space state across processors).
841 */ 844 */
845
846/* This currently is only used by the hugetlb arch pre-fault
847 * hook on UltraSPARC-III+ and later when changing the pagesize
848 * bits of the context register for an address space.
849 */
842void smp_flush_tlb_mm(struct mm_struct *mm) 850void smp_flush_tlb_mm(struct mm_struct *mm)
843{ 851{
844 /* 852 u32 ctx = CTX_HWBITS(mm->context);
845 * This code is called from two places, dup_mmap and exit_mmap. In the 853 int cpu = get_cpu();
846 * former case, we really need a flush. In the later case, the callers
847 * are single threaded exec_mmap (really need a flush), multithreaded
848 * exec_mmap case (do not need to flush, since the caller gets a new
849 * context via activate_mm), and all other callers of mmput() whence
850 * the flush can be optimized since the associated threads are dead and
851 * the mm is being torn down (__exit_mm and other mmput callers) or the
852 * owning thread is dissociating itself from the mm. The
853 * (atomic_read(&mm->mm_users) == 0) check ensures real work is done
854 * for single thread exec and dup_mmap cases. An alternate check might
855 * have been (current->mm != mm).
856 * Kanoj Sarcar
857 */
858 if (atomic_read(&mm->mm_users) == 0)
859 return;
860
861 {
862 u32 ctx = CTX_HWBITS(mm->context);
863 int cpu = get_cpu();
864 854
865 if (atomic_read(&mm->mm_users) == 1) { 855 if (atomic_read(&mm->mm_users) == 1) {
866 mm->cpu_vm_mask = cpumask_of_cpu(cpu); 856 mm->cpu_vm_mask = cpumask_of_cpu(cpu);
867 goto local_flush_and_out; 857 goto local_flush_and_out;
868 } 858 }
869 859
870 smp_cross_call_masked(&xcall_flush_tlb_mm, 860 smp_cross_call_masked(&xcall_flush_tlb_mm,
871 ctx, 0, 0, 861 ctx, 0, 0,
872 mm->cpu_vm_mask); 862 mm->cpu_vm_mask);
873 863
874 local_flush_and_out: 864local_flush_and_out:
875 __flush_tlb_mm(ctx, SECONDARY_CONTEXT); 865 __flush_tlb_mm(ctx, SECONDARY_CONTEXT);
876 866
877 put_cpu(); 867 put_cpu();
878 }
879} 868}
880 869
881void smp_flush_tlb_pending(struct mm_struct *mm, unsigned long nr, unsigned long *vaddrs) 870void smp_flush_tlb_pending(struct mm_struct *mm, unsigned long nr, unsigned long *vaddrs)
@@ -883,34 +872,13 @@ void smp_flush_tlb_pending(struct mm_struct *mm, unsigned long nr, unsigned long
883 u32 ctx = CTX_HWBITS(mm->context); 872 u32 ctx = CTX_HWBITS(mm->context);
884 int cpu = get_cpu(); 873 int cpu = get_cpu();
885 874
886 if (mm == current->active_mm && atomic_read(&mm->mm_users) == 1) { 875 if (mm == current->active_mm && atomic_read(&mm->mm_users) == 1)
887 mm->cpu_vm_mask = cpumask_of_cpu(cpu); 876 mm->cpu_vm_mask = cpumask_of_cpu(cpu);
888 goto local_flush_and_out; 877 else
889 } else { 878 smp_cross_call_masked(&xcall_flush_tlb_pending,
890 /* This optimization is not valid. Normally 879 ctx, nr, (unsigned long) vaddrs,
891 * we will be holding the page_table_lock, but 880 mm->cpu_vm_mask);
892 * there is an exception which is copy_page_range()
893 * when forking. The lock is held during the individual
894 * page table updates in the parent, but not at the
895 * top level, which is where we are invoked.
896 */
897 if (0) {
898 cpumask_t this_cpu_mask = cpumask_of_cpu(cpu);
899
900 /* By virtue of running under the mm->page_table_lock,
901 * and mmu_context.h:switch_mm doing the same, the
902 * following operation is safe.
903 */
904 if (cpus_equal(mm->cpu_vm_mask, this_cpu_mask))
905 goto local_flush_and_out;
906 }
907 }
908
909 smp_cross_call_masked(&xcall_flush_tlb_pending,
910 ctx, nr, (unsigned long) vaddrs,
911 mm->cpu_vm_mask);
912 881
913local_flush_and_out:
914 __flush_tlb_pending(ctx, nr, vaddrs); 882 __flush_tlb_pending(ctx, nr, vaddrs);
915 883
916 put_cpu(); 884 put_cpu();
@@ -1184,20 +1152,9 @@ void __init smp_cpus_done(unsigned int max_cpus)
1184 (bogosum/(5000/HZ))%100); 1152 (bogosum/(5000/HZ))%100);
1185} 1153}
1186 1154
1187/* This needn't do anything as we do not sleep the cpu
1188 * inside of the idler task, so an interrupt is not needed
1189 * to get a clean fast response.
1190 *
1191 * XXX Reverify this assumption... -DaveM
1192 *
1193 * Addendum: We do want it to do something for the signal
1194 * delivery case, we detect that by just seeing
1195 * if we are trying to send this to an idler or not.
1196 */
1197void smp_send_reschedule(int cpu) 1155void smp_send_reschedule(int cpu)
1198{ 1156{
1199 if (cpu_data(cpu).idle_volume == 0) 1157 smp_receive_signal(cpu);
1200 smp_receive_signal(cpu);
1201} 1158}
1202 1159
1203/* This is a nop because we capture all other cpus 1160/* This is a nop because we capture all other cpus
diff --git a/arch/sparc64/kernel/sunos_ioctl32.c b/arch/sparc64/kernel/sunos_ioctl32.c
index 7654b8a7f03a..3f619ead22cc 100644
--- a/arch/sparc64/kernel/sunos_ioctl32.c
+++ b/arch/sparc64/kernel/sunos_ioctl32.c
@@ -24,7 +24,6 @@
24#include <linux/smp_lock.h> 24#include <linux/smp_lock.h>
25#include <linux/syscalls.h> 25#include <linux/syscalls.h>
26#include <linux/compat.h> 26#include <linux/compat.h>
27#include <asm/kbio.h>
28 27
29#define SUNOS_NR_OPEN 256 28#define SUNOS_NR_OPEN 256
30 29
diff --git a/arch/sparc64/kernel/time.c b/arch/sparc64/kernel/time.c
index 38c5525087a2..459c8fbe02b4 100644
--- a/arch/sparc64/kernel/time.c
+++ b/arch/sparc64/kernel/time.c
@@ -60,17 +60,6 @@ static void __iomem *mstk48t59_regs;
60 60
61static int set_rtc_mmss(unsigned long); 61static int set_rtc_mmss(unsigned long);
62 62
63static __init unsigned long dummy_get_tick(void)
64{
65 return 0;
66}
67
68static __initdata struct sparc64_tick_ops dummy_tick_ops = {
69 .get_tick = dummy_get_tick,
70};
71
72struct sparc64_tick_ops *tick_ops __read_mostly = &dummy_tick_ops;
73
74#define TICK_PRIV_BIT (1UL << 63) 63#define TICK_PRIV_BIT (1UL << 63)
75 64
76#ifdef CONFIG_SMP 65#ifdef CONFIG_SMP
@@ -200,6 +189,8 @@ static struct sparc64_tick_ops tick_operations __read_mostly = {
200 .softint_mask = 1UL << 0, 189 .softint_mask = 1UL << 0,
201}; 190};
202 191
192struct sparc64_tick_ops *tick_ops __read_mostly = &tick_operations;
193
203static void stick_init_tick(unsigned long offset) 194static void stick_init_tick(unsigned long offset)
204{ 195{
205 tick_disable_protection(); 196 tick_disable_protection();
diff --git a/arch/sparc64/kernel/us2e_cpufreq.c b/arch/sparc64/kernel/us2e_cpufreq.c
index 686e526bec04..b35dc8dc995a 100644
--- a/arch/sparc64/kernel/us2e_cpufreq.c
+++ b/arch/sparc64/kernel/us2e_cpufreq.c
@@ -388,10 +388,8 @@ err_out:
388 kfree(driver); 388 kfree(driver);
389 cpufreq_us2e_driver = NULL; 389 cpufreq_us2e_driver = NULL;
390 } 390 }
391 if (us2e_freq_table) { 391 kfree(us2e_freq_table);
392 kfree(us2e_freq_table); 392 us2e_freq_table = NULL;
393 us2e_freq_table = NULL;
394 }
395 return ret; 393 return ret;
396 } 394 }
397 395
@@ -402,7 +400,6 @@ static void __exit us2e_freq_exit(void)
402{ 400{
403 if (cpufreq_us2e_driver) { 401 if (cpufreq_us2e_driver) {
404 cpufreq_unregister_driver(cpufreq_us2e_driver); 402 cpufreq_unregister_driver(cpufreq_us2e_driver);
405
406 kfree(cpufreq_us2e_driver); 403 kfree(cpufreq_us2e_driver);
407 cpufreq_us2e_driver = NULL; 404 cpufreq_us2e_driver = NULL;
408 kfree(us2e_freq_table); 405 kfree(us2e_freq_table);
diff --git a/arch/sparc64/kernel/us3_cpufreq.c b/arch/sparc64/kernel/us3_cpufreq.c
index 0340041f6143..6d1f9a3c464f 100644
--- a/arch/sparc64/kernel/us3_cpufreq.c
+++ b/arch/sparc64/kernel/us3_cpufreq.c
@@ -249,10 +249,8 @@ err_out:
249 kfree(driver); 249 kfree(driver);
250 cpufreq_us3_driver = NULL; 250 cpufreq_us3_driver = NULL;
251 } 251 }
252 if (us3_freq_table) { 252 kfree(us3_freq_table);
253 kfree(us3_freq_table); 253 us3_freq_table = NULL;
254 us3_freq_table = NULL;
255 }
256 return ret; 254 return ret;
257 } 255 }
258 256
@@ -263,7 +261,6 @@ static void __exit us3_freq_exit(void)
263{ 261{
264 if (cpufreq_us3_driver) { 262 if (cpufreq_us3_driver) {
265 cpufreq_unregister_driver(cpufreq_us3_driver); 263 cpufreq_unregister_driver(cpufreq_us3_driver);
266
267 kfree(cpufreq_us3_driver); 264 kfree(cpufreq_us3_driver);
268 cpufreq_us3_driver = NULL; 265 cpufreq_us3_driver = NULL;
269 kfree(us3_freq_table); 266 kfree(us3_freq_table);
diff --git a/arch/sparc64/mm/fault.c b/arch/sparc64/mm/fault.c
index 31fbc67719a1..6f0539aa44d0 100644
--- a/arch/sparc64/mm/fault.c
+++ b/arch/sparc64/mm/fault.c
@@ -30,8 +30,6 @@
30#include <asm/sections.h> 30#include <asm/sections.h>
31#include <asm/kdebug.h> 31#include <asm/kdebug.h>
32 32
33#define ELEMENTS(arr) (sizeof (arr)/sizeof (arr[0]))
34
35/* 33/*
36 * To debug kernel to catch accesses to certain virtual/physical addresses. 34 * To debug kernel to catch accesses to certain virtual/physical addresses.
37 * Mode = 0 selects physical watchpoints, mode = 1 selects virtual watchpoints. 35 * Mode = 0 selects physical watchpoints, mode = 1 selects virtual watchpoints.
@@ -109,7 +107,7 @@ static void bad_kernel_pc(struct pt_regs *regs)
109 * this. Additionally, to prevent kswapd from ripping ptes from 107 * this. Additionally, to prevent kswapd from ripping ptes from
110 * under us, raise interrupts around the time that we look at the 108 * under us, raise interrupts around the time that we look at the
111 * pte, kswapd will have to wait to get his smp ipi response from 109 * pte, kswapd will have to wait to get his smp ipi response from
112 * us. This saves us having to get page_table_lock. 110 * us. vmtruncate likewise. This saves us having to get pte lock.
113 */ 111 */
114static unsigned int get_user_insn(unsigned long tpc) 112static unsigned int get_user_insn(unsigned long tpc)
115{ 113{
diff --git a/arch/sparc64/oprofile/Kconfig b/arch/sparc64/oprofile/Kconfig
index 5ade19801b97..d8a84088471a 100644
--- a/arch/sparc64/oprofile/Kconfig
+++ b/arch/sparc64/oprofile/Kconfig
@@ -1,7 +1,3 @@
1
2menu "Profiling support"
3 depends on EXPERIMENTAL
4
5config PROFILING 1config PROFILING
6 bool "Profiling support (EXPERIMENTAL)" 2 bool "Profiling support (EXPERIMENTAL)"
7 help 3 help
@@ -19,5 +15,3 @@ config OPROFILE
19 15
20 If unsure, say N. 16 If unsure, say N.
21 17
22endmenu
23
diff --git a/arch/um/Kconfig b/arch/um/Kconfig
index cd06ed7d842d..3b5f47c46907 100644
--- a/arch/um/Kconfig
+++ b/arch/um/Kconfig
@@ -65,6 +65,30 @@ config STATIC_LINK
65 chroot, and you disable CONFIG_MODE_TT, you probably want to say Y 65 chroot, and you disable CONFIG_MODE_TT, you probably want to say Y
66 here. 66 here.
67 67
68config HOST_2G_2G
69 bool "2G/2G host address space split"
70 default n
71 depends on MODE_TT
72 help
73 This is needed when the host on which you run has a 2G/2G memory
74 split, instead of the customary 3G/1G.
75
76 Note that to enable such a host
77 configuration, which makes sense only in some cases, you need special
78 host patches.
79
80 So, if you do not know what to do here, say 'N'.
81
82config KERNEL_HALF_GIGS
83 int "Kernel address space size (in .5G units)"
84 default "1"
85 depends on MODE_TT
86 help
87 This determines the amount of address space that UML will allocate for
88 its own, measured in half Gigabyte units. The default is 1.
89 Change this only if you need to boot UML with an unusually large amount
90 of physical memory.
91
68config MODE_SKAS 92config MODE_SKAS
69 bool "Separate Kernel Address Space support" 93 bool "Separate Kernel Address Space support"
70 default y 94 default y
@@ -182,19 +206,6 @@ config MAGIC_SYSRQ
182 The keys are documented in <file:Documentation/sysrq.txt>. Don't say Y 206 The keys are documented in <file:Documentation/sysrq.txt>. Don't say Y
183 unless you really know what this hack does. 207 unless you really know what this hack does.
184 208
185config HOST_2G_2G
186 bool "2G/2G host address space split"
187 default n
188 help
189 This is needed when the host on which you run has a 2G/2G memory
190 split, instead of the customary 3G/1G.
191
192 Note that to enable such a host
193 configuration, which makes sense only in some cases, you need special
194 host patches.
195
196 So, if you do not know what to do here, say 'N'.
197
198config SMP 209config SMP
199 bool "Symmetric multi-processing support (EXPERIMENTAL)" 210 bool "Symmetric multi-processing support (EXPERIMENTAL)"
200 default n 211 default n
@@ -241,15 +252,6 @@ config NEST_LEVEL
241 set to the host's CONFIG_NEST_LEVEL + CONFIG_KERNEL_HALF_GIGS. 252 set to the host's CONFIG_NEST_LEVEL + CONFIG_KERNEL_HALF_GIGS.
242 Only change this if you are running nested UMLs. 253 Only change this if you are running nested UMLs.
243 254
244config KERNEL_HALF_GIGS
245 int "Kernel address space size (in .5G units)"
246 default "1"
247 help
248 This determines the amount of address space that UML will allocate for
249 its own, measured in half Gigabyte units. The default is 1.
250 Change this only if you need to boot UML with an unusually large amount
251 of physical memory.
252
253config HIGHMEM 255config HIGHMEM
254 bool "Highmem support" 256 bool "Highmem support"
255 depends on !64BIT 257 depends on !64BIT
diff --git a/arch/um/Makefile b/arch/um/Makefile
index e1ffad224605..e55d32e903bc 100644
--- a/arch/um/Makefile
+++ b/arch/um/Makefile
@@ -60,7 +60,7 @@ AFLAGS += $(ARCH_INCLUDE)
60 60
61USER_CFLAGS := $(patsubst -I%,,$(CFLAGS)) 61USER_CFLAGS := $(patsubst -I%,,$(CFLAGS))
62USER_CFLAGS := $(patsubst -D__KERNEL__,,$(USER_CFLAGS)) $(ARCH_INCLUDE) \ 62USER_CFLAGS := $(patsubst -D__KERNEL__,,$(USER_CFLAGS)) $(ARCH_INCLUDE) \
63 $(MODE_INCLUDE) 63 $(MODE_INCLUDE) -D_FILE_OFFSET_BITS=64
64 64
65# -Derrno=kernel_errno - This turns all kernel references to errno into 65# -Derrno=kernel_errno - This turns all kernel references to errno into
66# 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
diff --git a/arch/um/Makefile-i386 b/arch/um/Makefile-i386
index aef7c50f8e13..1f7dcb064aee 100644
--- a/arch/um/Makefile-i386
+++ b/arch/um/Makefile-i386
@@ -17,8 +17,6 @@ ifeq ("$(origin SUBARCH)", "command line")
17ifneq ("$(shell uname -m | sed -e s/i.86/i386/)", "$(SUBARCH)") 17ifneq ("$(shell uname -m | sed -e s/i.86/i386/)", "$(SUBARCH)")
18CFLAGS += $(call cc-option,-m32) 18CFLAGS += $(call cc-option,-m32)
19USER_CFLAGS += $(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) 20AFLAGS += $(call cc-option,-m32)
23LINK-y += $(call cc-option,-m32) 21LINK-y += $(call cc-option,-m32)
24UML_OBJCOPYFLAGS += -F $(ELF_FORMAT) 22UML_OBJCOPYFLAGS += -F $(ELF_FORMAT)
diff --git a/arch/um/drivers/chan_user.c b/arch/um/drivers/chan_user.c
index de3bce71aeb3..1c55d5802489 100644
--- a/arch/um/drivers/chan_user.c
+++ b/arch/um/drivers/chan_user.c
@@ -16,7 +16,6 @@
16#include "user_util.h" 16#include "user_util.h"
17#include "chan_user.h" 17#include "chan_user.h"
18#include "user.h" 18#include "user.h"
19#include "helper.h"
20#include "os.h" 19#include "os.h"
21#include "choose-mode.h" 20#include "choose-mode.h"
22#include "mode.h" 21#include "mode.h"
diff --git a/arch/um/drivers/harddog_kern.c b/arch/um/drivers/harddog_kern.c
index 147ec19f6bb9..49acb2badf32 100644
--- a/arch/um/drivers/harddog_kern.c
+++ b/arch/um/drivers/harddog_kern.c
@@ -46,7 +46,6 @@
46#include <linux/smp_lock.h> 46#include <linux/smp_lock.h>
47#include <linux/init.h> 47#include <linux/init.h>
48#include <asm/uaccess.h> 48#include <asm/uaccess.h>
49#include "helper.h"
50#include "mconsole.h" 49#include "mconsole.h"
51 50
52MODULE_LICENSE("GPL"); 51MODULE_LICENSE("GPL");
diff --git a/arch/um/drivers/harddog_user.c b/arch/um/drivers/harddog_user.c
index d934181b8d4c..def013b5a3c7 100644
--- a/arch/um/drivers/harddog_user.c
+++ b/arch/um/drivers/harddog_user.c
@@ -8,7 +8,6 @@
8#include <errno.h> 8#include <errno.h>
9#include "user_util.h" 9#include "user_util.h"
10#include "user.h" 10#include "user.h"
11#include "helper.h"
12#include "mconsole.h" 11#include "mconsole.h"
13#include "os.h" 12#include "os.h"
14#include "choose-mode.h" 13#include "choose-mode.h"
diff --git a/arch/um/drivers/net_kern.c b/arch/um/drivers/net_kern.c
index 721e2601a75d..4cf31a2ae19c 100644
--- a/arch/um/drivers/net_kern.c
+++ b/arch/um/drivers/net_kern.c
@@ -96,7 +96,6 @@ irqreturn_t uml_net_interrupt(int irq, void *dev_id, struct pt_regs *regs)
96static int uml_net_open(struct net_device *dev) 96static int uml_net_open(struct net_device *dev)
97{ 97{
98 struct uml_net_private *lp = dev->priv; 98 struct uml_net_private *lp = dev->priv;
99 char addr[sizeof("255.255.255.255\0")];
100 int err; 99 int err;
101 100
102 spin_lock(&lp->lock); 101 spin_lock(&lp->lock);
@@ -107,7 +106,7 @@ static int uml_net_open(struct net_device *dev)
107 } 106 }
108 107
109 if(!lp->have_mac){ 108 if(!lp->have_mac){
110 dev_ip_addr(dev, addr, &lp->mac[2]); 109 dev_ip_addr(dev, &lp->mac[2]);
111 set_ether_mac(dev, lp->mac); 110 set_ether_mac(dev, lp->mac);
112 } 111 }
113 112
@@ -244,34 +243,18 @@ static int uml_net_change_mtu(struct net_device *dev, int new_mtu)
244 return err; 243 return err;
245} 244}
246 245
247static int uml_net_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd) 246static void uml_net_get_drvinfo(struct net_device *dev,
248{ 247 struct ethtool_drvinfo *info)
249 static const struct ethtool_drvinfo info = { 248{
250 .cmd = ETHTOOL_GDRVINFO, 249 strcpy(info->driver, DRIVER_NAME);
251 .driver = DRIVER_NAME, 250 strcpy(info->version, "42");
252 .version = "42",
253 };
254 void *useraddr;
255 u32 ethcmd;
256
257 switch (cmd) {
258 case SIOCETHTOOL:
259 useraddr = ifr->ifr_data;
260 if (copy_from_user(&ethcmd, useraddr, sizeof(ethcmd)))
261 return -EFAULT;
262 switch (ethcmd) {
263 case ETHTOOL_GDRVINFO:
264 if (copy_to_user(useraddr, &info, sizeof(info)))
265 return -EFAULT;
266 return 0;
267 default:
268 return -EOPNOTSUPP;
269 }
270 default:
271 return -EINVAL;
272 }
273} 251}
274 252
253static struct ethtool_ops uml_net_ethtool_ops = {
254 .get_drvinfo = uml_net_get_drvinfo,
255 .get_link = ethtool_op_get_link,
256};
257
275void uml_net_user_timer_expire(unsigned long _conn) 258void uml_net_user_timer_expire(unsigned long _conn)
276{ 259{
277#ifdef undef 260#ifdef undef
@@ -360,7 +343,7 @@ static int eth_configure(int n, void *init, char *mac,
360 dev->tx_timeout = uml_net_tx_timeout; 343 dev->tx_timeout = uml_net_tx_timeout;
361 dev->set_mac_address = uml_net_set_mac; 344 dev->set_mac_address = uml_net_set_mac;
362 dev->change_mtu = uml_net_change_mtu; 345 dev->change_mtu = uml_net_change_mtu;
363 dev->do_ioctl = uml_net_ioctl; 346 dev->ethtool_ops = &uml_net_ethtool_ops;
364 dev->watchdog_timeo = (HZ >> 1); 347 dev->watchdog_timeo = (HZ >> 1);
365 dev->irq = UM_ETH_IRQ; 348 dev->irq = UM_ETH_IRQ;
366 349
@@ -664,8 +647,6 @@ static int uml_inetaddr_event(struct notifier_block *this, unsigned long event,
664 void *ptr) 647 void *ptr)
665{ 648{
666 struct in_ifaddr *ifa = ptr; 649 struct in_ifaddr *ifa = ptr;
667 u32 addr = ifa->ifa_address;
668 u32 netmask = ifa->ifa_mask;
669 struct net_device *dev = ifa->ifa_dev->dev; 650 struct net_device *dev = ifa->ifa_dev->dev;
670 struct uml_net_private *lp; 651 struct uml_net_private *lp;
671 void (*proc)(unsigned char *, unsigned char *, void *); 652 void (*proc)(unsigned char *, unsigned char *, void *);
@@ -685,14 +666,8 @@ static int uml_inetaddr_event(struct notifier_block *this, unsigned long event,
685 break; 666 break;
686 } 667 }
687 if(proc != NULL){ 668 if(proc != NULL){
688 addr_buf[0] = addr & 0xff; 669 memcpy(addr_buf, &ifa->ifa_address, sizeof(addr_buf));
689 addr_buf[1] = (addr >> 8) & 0xff; 670 memcpy(netmask_buf, &ifa->ifa_mask, sizeof(netmask_buf));
690 addr_buf[2] = (addr >> 16) & 0xff;
691 addr_buf[3] = addr >> 24;
692 netmask_buf[0] = netmask & 0xff;
693 netmask_buf[1] = (netmask >> 8) & 0xff;
694 netmask_buf[2] = (netmask >> 16) & 0xff;
695 netmask_buf[3] = netmask >> 24;
696 (*proc)(addr_buf, netmask_buf, &lp->user); 671 (*proc)(addr_buf, netmask_buf, &lp->user);
697 } 672 }
698 return(NOTIFY_DONE); 673 return(NOTIFY_DONE);
@@ -774,27 +749,18 @@ int setup_etheraddr(char *str, unsigned char *addr)
774 return(1); 749 return(1);
775} 750}
776 751
777void dev_ip_addr(void *d, char *buf, char *bin_buf) 752void dev_ip_addr(void *d, unsigned char *bin_buf)
778{ 753{
779 struct net_device *dev = d; 754 struct net_device *dev = d;
780 struct in_device *ip = dev->ip_ptr; 755 struct in_device *ip = dev->ip_ptr;
781 struct in_ifaddr *in; 756 struct in_ifaddr *in;
782 u32 addr;
783 757
784 if((ip == NULL) || ((in = ip->ifa_list) == NULL)){ 758 if((ip == NULL) || ((in = ip->ifa_list) == NULL)){
785 printk(KERN_WARNING "dev_ip_addr - device not assigned an " 759 printk(KERN_WARNING "dev_ip_addr - device not assigned an "
786 "IP address\n"); 760 "IP address\n");
787 return; 761 return;
788 } 762 }
789 addr = in->ifa_address; 763 memcpy(bin_buf, &in->ifa_address, sizeof(in->ifa_address));
790 sprintf(buf, "%d.%d.%d.%d", addr & 0xff, (addr >> 8) & 0xff,
791 (addr >> 16) & 0xff, addr >> 24);
792 if(bin_buf){
793 bin_buf[0] = addr & 0xff;
794 bin_buf[1] = (addr >> 8) & 0xff;
795 bin_buf[2] = (addr >> 16) & 0xff;
796 bin_buf[3] = addr >> 24;
797 }
798} 764}
799 765
800void set_ether_mac(void *d, unsigned char *addr) 766void set_ether_mac(void *d, unsigned char *addr)
@@ -829,14 +795,8 @@ void iter_addresses(void *d, void (*cb)(unsigned char *, unsigned char *,
829 if(ip == NULL) return; 795 if(ip == NULL) return;
830 in = ip->ifa_list; 796 in = ip->ifa_list;
831 while(in != NULL){ 797 while(in != NULL){
832 address[0] = in->ifa_address & 0xff; 798 memcpy(address, &in->ifa_address, sizeof(address));
833 address[1] = (in->ifa_address >> 8) & 0xff; 799 memcpy(netmask, &in->ifa_mask, sizeof(netmask));
834 address[2] = (in->ifa_address >> 16) & 0xff;
835 address[3] = in->ifa_address >> 24;
836 netmask[0] = in->ifa_mask & 0xff;
837 netmask[1] = (in->ifa_mask >> 8) & 0xff;
838 netmask[2] = (in->ifa_mask >> 16) & 0xff;
839 netmask[3] = in->ifa_mask >> 24;
840 (*cb)(address, netmask, arg); 800 (*cb)(address, netmask, arg);
841 in = in->ifa_next; 801 in = in->ifa_next;
842 } 802 }
diff --git a/arch/um/drivers/net_user.c b/arch/um/drivers/net_user.c
index 3730d4f12713..098fa65981ab 100644
--- a/arch/um/drivers/net_user.c
+++ b/arch/um/drivers/net_user.c
@@ -16,7 +16,6 @@
16#include "user_util.h" 16#include "user_util.h"
17#include "kern_util.h" 17#include "kern_util.h"
18#include "net_user.h" 18#include "net_user.h"
19#include "helper.h"
20#include "os.h" 19#include "os.h"
21 20
22int tap_open_common(void *dev, char *gate_addr) 21int tap_open_common(void *dev, char *gate_addr)
diff --git a/arch/um/drivers/port_user.c b/arch/um/drivers/port_user.c
index 14dd2002d2da..ed4a1a6c5d83 100644
--- a/arch/um/drivers/port_user.c
+++ b/arch/um/drivers/port_user.c
@@ -18,7 +18,6 @@
18#include "user.h" 18#include "user.h"
19#include "chan_user.h" 19#include "chan_user.h"
20#include "port.h" 20#include "port.h"
21#include "helper.h"
22#include "os.h" 21#include "os.h"
23 22
24struct port_chan { 23struct port_chan {
diff --git a/arch/um/drivers/random.c b/arch/um/drivers/random.c
index f9e22198e011..ba471f5864a6 100644
--- a/arch/um/drivers/random.c
+++ b/arch/um/drivers/random.c
@@ -58,10 +58,8 @@ static ssize_t rng_dev_read (struct file *filp, char __user *buf, size_t size,
58 if (filp->f_flags & O_NONBLOCK) 58 if (filp->f_flags & O_NONBLOCK)
59 return ret ? : -EAGAIN; 59 return ret ? : -EAGAIN;
60 60
61 if(need_resched()){ 61 if(need_resched())
62 current->state = TASK_INTERRUPTIBLE; 62 schedule_timeout_interruptible(1);
63 schedule_timeout(1);
64 }
65 } 63 }
66 else return n; 64 else return n;
67 if (signal_pending (current)) 65 if (signal_pending (current))
diff --git a/arch/um/drivers/slip_user.c b/arch/um/drivers/slip_user.c
index 71af444e591f..89fbec185cc1 100644
--- a/arch/um/drivers/slip_user.c
+++ b/arch/um/drivers/slip_user.c
@@ -14,7 +14,6 @@
14#include "net_user.h" 14#include "net_user.h"
15#include "slip.h" 15#include "slip.h"
16#include "slip_common.h" 16#include "slip_common.h"
17#include "helper.h"
18#include "os.h" 17#include "os.h"
19 18
20void slip_user_init(void *data, void *dev) 19void slip_user_init(void *data, void *dev)
diff --git a/arch/um/drivers/slirp_user.c b/arch/um/drivers/slirp_user.c
index 8d91f663d82c..b94c66114bc8 100644
--- a/arch/um/drivers/slirp_user.c
+++ b/arch/um/drivers/slirp_user.c
@@ -13,7 +13,6 @@
13#include "net_user.h" 13#include "net_user.h"
14#include "slirp.h" 14#include "slirp.h"
15#include "slip_common.h" 15#include "slip_common.h"
16#include "helper.h"
17#include "os.h" 16#include "os.h"
18 17
19void slirp_user_init(void *data, void *dev) 18void slirp_user_init(void *data, void *dev)
diff --git a/arch/um/drivers/xterm.c b/arch/um/drivers/xterm.c
index 90e0e5ff451e..b530f1a6540d 100644
--- a/arch/um/drivers/xterm.c
+++ b/arch/um/drivers/xterm.c
@@ -14,7 +14,6 @@
14#include <sys/socket.h> 14#include <sys/socket.h>
15#include "kern_util.h" 15#include "kern_util.h"
16#include "chan_user.h" 16#include "chan_user.h"
17#include "helper.h"
18#include "user_util.h" 17#include "user_util.h"
19#include "user.h" 18#include "user.h"
20#include "os.h" 19#include "os.h"
diff --git a/arch/um/include/helper.h b/arch/um/include/helper.h
deleted file mode 100644
index 162ac31192fd..000000000000
--- a/arch/um/include/helper.h
+++ /dev/null
@@ -1,27 +0,0 @@
1/*
2 * Copyright (C) 2002 Jeff Dike (jdike@karaya.com)
3 * Licensed under the GPL
4 */
5
6#ifndef __HELPER_H__
7#define __HELPER_H__
8
9extern int run_helper(void (*pre_exec)(void *), void *pre_data, char **argv,
10 unsigned long *stack_out);
11extern int run_helper_thread(int (*proc)(void *), void *arg,
12 unsigned int flags, unsigned long *stack_out,
13 int stack_order);
14extern int helper_wait(int pid);
15
16#endif
17
18/*
19 * Overrides for Emacs so that we follow Linus's tabbing style.
20 * Emacs will notice this stuff at the end of the file and automatically
21 * adjust the settings for this buffer only. This must remain at the end
22 * of the file.
23 * ---------------------------------------------------------------------------
24 * Local variables:
25 * c-file-style: "linux"
26 * End:
27 */
diff --git a/arch/um/include/mem_user.h b/arch/um/include/mem_user.h
index 9fef4123a65a..a1064c5823bf 100644
--- a/arch/um/include/mem_user.h
+++ b/arch/um/include/mem_user.h
@@ -57,7 +57,7 @@ extern int init_maps(unsigned long physmem, unsigned long iomem,
57 unsigned long highmem); 57 unsigned long highmem);
58extern unsigned long get_vm(unsigned long len); 58extern unsigned long get_vm(unsigned long len);
59extern void setup_physmem(unsigned long start, unsigned long usable, 59extern void setup_physmem(unsigned long start, unsigned long usable,
60 unsigned long len, unsigned long highmem); 60 unsigned long len, unsigned long long highmem);
61extern void add_iomem(char *name, int fd, unsigned long size); 61extern void add_iomem(char *name, int fd, unsigned long size);
62extern unsigned long phys_offset(unsigned long phys); 62extern unsigned long phys_offset(unsigned long phys);
63extern void unmap_physmem(void); 63extern void unmap_physmem(void);
diff --git a/arch/um/include/net_user.h b/arch/um/include/net_user.h
index 89885a77a771..800c403920bc 100644
--- a/arch/um/include/net_user.h
+++ b/arch/um/include/net_user.h
@@ -25,7 +25,7 @@ struct net_user_info {
25}; 25};
26 26
27extern void ether_user_init(void *data, void *dev); 27extern void ether_user_init(void *data, void *dev);
28extern void dev_ip_addr(void *d, char *buf, char *bin_buf); 28extern void dev_ip_addr(void *d, unsigned char *bin_buf);
29extern void set_ether_mac(void *d, unsigned char *addr); 29extern void set_ether_mac(void *d, unsigned char *addr);
30extern void iter_addresses(void *d, void (*cb)(unsigned char *, 30extern void iter_addresses(void *d, void (*cb)(unsigned char *,
31 unsigned char *, void *), 31 unsigned char *, void *),
diff --git a/arch/um/include/os.h b/arch/um/include/os.h
index 2e58e304b8be..2cccfa5b8ab5 100644
--- a/arch/um/include/os.h
+++ b/arch/um/include/os.h
@@ -167,7 +167,7 @@ extern int can_do_skas(void);
167#endif 167#endif
168 168
169/* mem.c */ 169/* mem.c */
170extern int create_mem_file(unsigned long len); 170extern int create_mem_file(unsigned long long len);
171 171
172/* process.c */ 172/* process.c */
173extern unsigned long os_process_pc(int pid); 173extern unsigned long os_process_pc(int pid);
@@ -199,6 +199,20 @@ extern void forward_pending_sigio(int target);
199extern int start_fork_tramp(void *arg, unsigned long temp_stack, 199extern int start_fork_tramp(void *arg, unsigned long temp_stack,
200 int clone_flags, int (*tramp)(void *)); 200 int clone_flags, int (*tramp)(void *));
201 201
202/* uaccess.c */
203extern unsigned long __do_user_copy(void *to, const void *from, int n,
204 void **fault_addr, void **fault_catcher,
205 void (*op)(void *to, const void *from,
206 int n), int *faulted_out);
207
208/* helper.c */
209extern int run_helper(void (*pre_exec)(void *), void *pre_data, char **argv,
210 unsigned long *stack_out);
211extern int run_helper_thread(int (*proc)(void *), void *arg,
212 unsigned int flags, unsigned long *stack_out,
213 int stack_order);
214extern int helper_wait(int pid);
215
202#endif 216#endif
203 217
204/* 218/*
diff --git a/arch/um/include/sysdep-i386/stub.h b/arch/um/include/sysdep-i386/stub.h
index d3699fe1c613..a49ceb199ee5 100644
--- a/arch/um/include/sysdep-i386/stub.h
+++ b/arch/um/include/sysdep-i386/stub.h
@@ -16,45 +16,69 @@ extern void stub_clone_handler(void);
16#define STUB_MMAP_NR __NR_mmap2 16#define STUB_MMAP_NR __NR_mmap2
17#define MMAP_OFFSET(o) ((o) >> PAGE_SHIFT) 17#define MMAP_OFFSET(o) ((o) >> PAGE_SHIFT)
18 18
19static inline long stub_syscall1(long syscall, long arg1)
20{
21 long ret;
22
23 __asm__ volatile ("int $0x80" : "=a" (ret) : "0" (syscall), "b" (arg1));
24
25 return ret;
26}
27
19static inline long stub_syscall2(long syscall, long arg1, long arg2) 28static inline long stub_syscall2(long syscall, long arg1, long arg2)
20{ 29{
21 long ret; 30 long ret;
22 31
23 __asm__("movl %0, %%ecx; " : : "g" (arg2) : "%ecx"); 32 __asm__ volatile ("int $0x80" : "=a" (ret) : "0" (syscall), "b" (arg1),
24 __asm__("movl %0, %%ebx; " : : "g" (arg1) : "%ebx"); 33 "c" (arg2));
25 __asm__("movl %0, %%eax; " : : "g" (syscall) : "%eax"); 34
26 __asm__("int $0x80;" : : : "%eax"); 35 return ret;
27 __asm__ __volatile__("movl %%eax, %0; " : "=g" (ret) :);
28 return(ret);
29} 36}
30 37
31static inline long stub_syscall3(long syscall, long arg1, long arg2, long arg3) 38static inline long stub_syscall3(long syscall, long arg1, long arg2, long arg3)
32{ 39{
33 __asm__("movl %0, %%edx; " : : "g" (arg3) : "%edx"); 40 long ret;
34 return(stub_syscall2(syscall, arg1, arg2)); 41
42 __asm__ volatile ("int $0x80" : "=a" (ret) : "0" (syscall), "b" (arg1),
43 "c" (arg2), "d" (arg3));
44
45 return ret;
35} 46}
36 47
37static inline long stub_syscall4(long syscall, long arg1, long arg2, long arg3, 48static inline long stub_syscall4(long syscall, long arg1, long arg2, long arg3,
38 long arg4) 49 long arg4)
39{ 50{
40 __asm__("movl %0, %%esi; " : : "g" (arg4) : "%esi"); 51 long ret;
41 return(stub_syscall3(syscall, arg1, arg2, arg3)); 52
53 __asm__ volatile ("int $0x80" : "=a" (ret) : "0" (syscall), "b" (arg1),
54 "c" (arg2), "d" (arg3), "S" (arg4));
55
56 return ret;
57}
58
59static inline long stub_syscall5(long syscall, long arg1, long arg2, long arg3,
60 long arg4, long arg5)
61{
62 long ret;
63
64 __asm__ volatile ("int $0x80" : "=a" (ret) : "0" (syscall), "b" (arg1),
65 "c" (arg2), "d" (arg3), "S" (arg4), "D" (arg5));
66
67 return ret;
42} 68}
43 69
44static inline long stub_syscall6(long syscall, long arg1, long arg2, long arg3, 70static inline long stub_syscall6(long syscall, long arg1, long arg2, long arg3,
45 long arg4, long arg5, long arg6) 71 long arg4, long arg5, long arg6)
46{ 72{
47 long ret; 73 long ret;
48 __asm__("movl %0, %%eax; " : : "g" (syscall) : "%eax"); 74
49 __asm__("movl %0, %%ebx; " : : "g" (arg1) : "%ebx"); 75 __asm__ volatile ("push %%ebp ; movl %%eax,%%ebp ; movl %1,%%eax ; "
50 __asm__("movl %0, %%ecx; " : : "g" (arg2) : "%ecx"); 76 "int $0x80 ; pop %%ebp"
51 __asm__("movl %0, %%edx; " : : "g" (arg3) : "%edx"); 77 : "=a" (ret)
52 __asm__("movl %0, %%esi; " : : "g" (arg4) : "%esi"); 78 : "g" (syscall), "b" (arg1), "c" (arg2), "d" (arg3),
53 __asm__("movl %0, %%edi; " : : "g" (arg5) : "%edi"); 79 "S" (arg4), "D" (arg5), "0" (arg6));
54 __asm__ __volatile__("pushl %%ebp ; movl %1, %%ebp; " 80
55 "int $0x80; popl %%ebp ; " 81 return ret;
56 "movl %%eax, %0; " : "=g" (ret) : "g" (arg6) : "%eax");
57 return(ret);
58} 82}
59 83
60static inline void trap_myself(void) 84static inline void trap_myself(void)
diff --git a/arch/um/include/sysdep-x86_64/stub.h b/arch/um/include/sysdep-x86_64/stub.h
index f599058d8263..2bd6e7a97286 100644
--- a/arch/um/include/sysdep-x86_64/stub.h
+++ b/arch/um/include/sysdep-x86_64/stub.h
@@ -17,37 +17,72 @@ extern void stub_clone_handler(void);
17#define STUB_MMAP_NR __NR_mmap 17#define STUB_MMAP_NR __NR_mmap
18#define MMAP_OFFSET(o) (o) 18#define MMAP_OFFSET(o) (o)
19 19
20#define __syscall_clobber "r11","rcx","memory"
21#define __syscall "syscall"
22
20static inline long stub_syscall2(long syscall, long arg1, long arg2) 23static inline long stub_syscall2(long syscall, long arg1, long arg2)
21{ 24{
22 long ret; 25 long ret;
23 26
24 __asm__("movq %0, %%rsi; " : : "g" (arg2) : "%rsi"); 27 __asm__ volatile (__syscall
25 __asm__("movq %0, %%rdi; " : : "g" (arg1) : "%rdi"); 28 : "=a" (ret)
26 __asm__("movq %0, %%rax; " : : "g" (syscall) : "%rax"); 29 : "0" (syscall), "D" (arg1), "S" (arg2) : __syscall_clobber );
27 __asm__("syscall;" : : : "%rax", "%r11", "%rcx"); 30
28 __asm__ __volatile__("movq %%rax, %0; " : "=g" (ret) :); 31 return ret;
29 return(ret);
30} 32}
31 33
32static inline long stub_syscall3(long syscall, long arg1, long arg2, long arg3) 34static inline long stub_syscall3(long syscall, long arg1, long arg2, long arg3)
33{ 35{
34 __asm__("movq %0, %%rdx; " : : "g" (arg3) : "%rdx"); 36 long ret;
35 return(stub_syscall2(syscall, arg1, arg2)); 37
38 __asm__ volatile (__syscall
39 : "=a" (ret)
40 : "0" (syscall), "D" (arg1), "S" (arg2), "d" (arg3)
41 : __syscall_clobber );
42
43 return ret;
36} 44}
37 45
38static inline long stub_syscall4(long syscall, long arg1, long arg2, long arg3, 46static inline long stub_syscall4(long syscall, long arg1, long arg2, long arg3,
39 long arg4) 47 long arg4)
40{ 48{
41 __asm__("movq %0, %%r10; " : : "g" (arg4) : "%r10"); 49 long ret;
42 return(stub_syscall3(syscall, arg1, arg2, arg3)); 50
51 __asm__ volatile ("movq %5,%%r10 ; " __syscall
52 : "=a" (ret)
53 : "0" (syscall), "D" (arg1), "S" (arg2), "d" (arg3),
54 "g" (arg4)
55 : __syscall_clobber, "r10" );
56
57 return ret;
58}
59
60static inline long stub_syscall5(long syscall, long arg1, long arg2, long arg3,
61 long arg4, long arg5)
62{
63 long ret;
64
65 __asm__ volatile ("movq %5,%%r10 ; movq %6,%%r8 ; " __syscall
66 : "=a" (ret)
67 : "0" (syscall), "D" (arg1), "S" (arg2), "d" (arg3),
68 "g" (arg4), "g" (arg5)
69 : __syscall_clobber, "r10", "r8" );
70
71 return ret;
43} 72}
44 73
45static inline long stub_syscall6(long syscall, long arg1, long arg2, long arg3, 74static inline long stub_syscall6(long syscall, long arg1, long arg2, long arg3,
46 long arg4, long arg5, long arg6) 75 long arg4, long arg5, long arg6)
47{ 76{
48 __asm__("movq %0, %%r9; " : : "g" (arg6) : "%r9"); 77 long ret;
49 __asm__("movq %0, %%r8; " : : "g" (arg5) : "%r8"); 78
50 return(stub_syscall4(syscall, arg1, arg2, arg3, arg4)); 79 __asm__ volatile ("movq %5,%%r10 ; movq %6,%%r8 ; "
80 "movq %7, %%r9; " __syscall : "=a" (ret)
81 : "0" (syscall), "D" (arg1), "S" (arg2), "d" (arg3),
82 "g" (arg4), "g" (arg5), "g" (arg6)
83 : __syscall_clobber, "r10", "r8", "r9" );
84
85 return ret;
51} 86}
52 87
53static inline void trap_myself(void) 88static inline void trap_myself(void)
diff --git a/arch/um/include/uml_uaccess.h b/arch/um/include/uml_uaccess.h
index f77eb6428453..c0df11d06f5e 100644
--- a/arch/um/include/uml_uaccess.h
+++ b/arch/um/include/uml_uaccess.h
@@ -8,10 +8,6 @@
8 8
9extern int __do_copy_to_user(void *to, const void *from, int n, 9extern int __do_copy_to_user(void *to, const void *from, int n,
10 void **fault_addr, void **fault_catcher); 10 void **fault_addr, void **fault_catcher);
11extern unsigned long __do_user_copy(void *to, const void *from, int n,
12 void **fault_addr, void **fault_catcher,
13 void (*op)(void *to, const void *from,
14 int n), int *faulted_out);
15void __do_copy(void *to, const void *from, int n); 11void __do_copy(void *to, const void *from, int n);
16 12
17#endif 13#endif
diff --git a/arch/um/kernel/Makefile b/arch/um/kernel/Makefile
index 1a0001b3850c..3de9d21e36bf 100644
--- a/arch/um/kernel/Makefile
+++ b/arch/um/kernel/Makefile
@@ -7,10 +7,10 @@ extra-y := vmlinux.lds
7clean-files := 7clean-files :=
8 8
9obj-y = config.o exec_kern.o exitcode.o \ 9obj-y = config.o exec_kern.o exitcode.o \
10 helper.o init_task.o irq.o irq_user.o ksyms.o main.o mem.o physmem.o \ 10 init_task.o irq.o irq_user.o ksyms.o mem.o physmem.o \
11 process_kern.o ptrace.o reboot.o resource.o sigio_user.o sigio_kern.o \ 11 process_kern.o ptrace.o reboot.o resource.o sigio_user.o sigio_kern.o \
12 signal_kern.o signal_user.o smp.o syscall_kern.o sysrq.o time.o \ 12 signal_kern.o signal_user.o smp.o syscall_kern.o sysrq.o time.o \
13 time_kern.o tlb.o trap_kern.o trap_user.o uaccess_user.o um_arch.o \ 13 time_kern.o tlb.o trap_kern.o trap_user.o uaccess.o um_arch.o \
14 umid.o user_util.o 14 umid.o user_util.o
15 15
16obj-$(CONFIG_BLK_DEV_INITRD) += initrd.o 16obj-$(CONFIG_BLK_DEV_INITRD) += initrd.o
@@ -24,8 +24,7 @@ obj-$(CONFIG_MODE_SKAS) += skas/
24 24
25user-objs-$(CONFIG_TTY_LOG) += tty_log.o 25user-objs-$(CONFIG_TTY_LOG) += tty_log.o
26 26
27USER_OBJS := $(user-objs-y) config.o helper.o main.o time.o tty_log.o umid.o \ 27USER_OBJS := $(user-objs-y) config.o time.o tty_log.o umid.o user_util.o
28 user_util.o
29 28
30include arch/um/scripts/Makefile.rules 29include arch/um/scripts/Makefile.rules
31 30
diff --git a/arch/um/kernel/ksyms.c b/arch/um/kernel/ksyms.c
index a97a72e516aa..7713e7a6f476 100644
--- a/arch/um/kernel/ksyms.c
+++ b/arch/um/kernel/ksyms.c
@@ -20,7 +20,6 @@
20#include "user_util.h" 20#include "user_util.h"
21#include "mem_user.h" 21#include "mem_user.h"
22#include "os.h" 22#include "os.h"
23#include "helper.h"
24 23
25EXPORT_SYMBOL(stop); 24EXPORT_SYMBOL(stop);
26EXPORT_SYMBOL(uml_physmem); 25EXPORT_SYMBOL(uml_physmem);
diff --git a/arch/um/kernel/mem.c b/arch/um/kernel/mem.c
index 462cc9d65386..fa4f915be5c5 100644
--- a/arch/um/kernel/mem.c
+++ b/arch/um/kernel/mem.c
@@ -234,8 +234,8 @@ void paging_init(void)
234 empty_bad_page = (unsigned long *) alloc_bootmem_low_pages(PAGE_SIZE); 234 empty_bad_page = (unsigned long *) alloc_bootmem_low_pages(PAGE_SIZE);
235 for(i=0;i<sizeof(zones_size)/sizeof(zones_size[0]);i++) 235 for(i=0;i<sizeof(zones_size)/sizeof(zones_size[0]);i++)
236 zones_size[i] = 0; 236 zones_size[i] = 0;
237 zones_size[0] = (end_iomem >> PAGE_SHIFT) - (uml_physmem >> PAGE_SHIFT); 237 zones_size[ZONE_DMA] = (end_iomem >> PAGE_SHIFT) - (uml_physmem >> PAGE_SHIFT);
238 zones_size[2] = highmem >> PAGE_SHIFT; 238 zones_size[ZONE_HIGHMEM] = highmem >> PAGE_SHIFT;
239 free_area_init(zones_size); 239 free_area_init(zones_size);
240 240
241 /* 241 /*
diff --git a/arch/um/kernel/physmem.c b/arch/um/kernel/physmem.c
index ea670fcc8af5..f3b583a878a6 100644
--- a/arch/um/kernel/physmem.c
+++ b/arch/um/kernel/physmem.c
@@ -246,7 +246,7 @@ int is_remapped(void *virt)
246/* Changed during early boot */ 246/* Changed during early boot */
247unsigned long high_physmem; 247unsigned long high_physmem;
248 248
249extern unsigned long physmem_size; 249extern unsigned long long physmem_size;
250 250
251int init_maps(unsigned long physmem, unsigned long iomem, unsigned long highmem) 251int init_maps(unsigned long physmem, unsigned long iomem, unsigned long highmem)
252{ 252{
@@ -321,7 +321,7 @@ void map_memory(unsigned long virt, unsigned long phys, unsigned long len,
321extern int __syscall_stub_start, __binary_start; 321extern int __syscall_stub_start, __binary_start;
322 322
323void setup_physmem(unsigned long start, unsigned long reserve_end, 323void setup_physmem(unsigned long start, unsigned long reserve_end,
324 unsigned long len, unsigned long highmem) 324 unsigned long len, unsigned long long highmem)
325{ 325{
326 unsigned long reserve = reserve_end - start; 326 unsigned long reserve = reserve_end - start;
327 int pfn = PFN_UP(__pa(reserve_end)); 327 int pfn = PFN_UP(__pa(reserve_end));
diff --git a/arch/um/kernel/ptrace.c b/arch/um/kernel/ptrace.c
index 71af4d503899..98e09395c093 100644
--- a/arch/um/kernel/ptrace.c
+++ b/arch/um/kernel/ptrace.c
@@ -43,53 +43,10 @@ void ptrace_disable(struct task_struct *child)
43extern int peek_user(struct task_struct * child, long addr, long data); 43extern int peek_user(struct task_struct * child, long addr, long data);
44extern int poke_user(struct task_struct * child, long addr, long data); 44extern int poke_user(struct task_struct * child, long addr, long data);
45 45
46long sys_ptrace(long request, long pid, long addr, long data) 46long arch_ptrace(struct task_struct *child, long request, long addr, long data)
47{ 47{
48 struct task_struct *child;
49 int i, ret; 48 int i, ret;
50 49
51 lock_kernel();
52 ret = -EPERM;
53 if (request == PTRACE_TRACEME) {
54 /* are we already being traced? */
55 if (current->ptrace & PT_PTRACED)
56 goto out;
57
58 ret = security_ptrace(current->parent, current);
59 if (ret)
60 goto out;
61
62 /* set the ptrace bit in the process flags. */
63 current->ptrace |= PT_PTRACED;
64 ret = 0;
65 goto out;
66 }
67 ret = -ESRCH;
68 read_lock(&tasklist_lock);
69 child = find_task_by_pid(pid);
70 if (child)
71 get_task_struct(child);
72 read_unlock(&tasklist_lock);
73 if (!child)
74 goto out;
75
76 ret = -EPERM;
77 if (pid == 1) /* you may not mess with init */
78 goto out_tsk;
79
80 if (request == PTRACE_ATTACH) {
81 ret = ptrace_attach(child);
82 goto out_tsk;
83 }
84
85#ifdef SUBACH_PTRACE_SPECIAL
86 SUBARCH_PTRACE_SPECIAL(child,request,addr,data);
87#endif
88
89 ret = ptrace_check_attach(child, request == PTRACE_KILL);
90 if (ret < 0)
91 goto out_tsk;
92
93 switch (request) { 50 switch (request) {
94 /* when I and D space are separate, these will need to be fixed. */ 51 /* when I and D space are separate, these will need to be fixed. */
95 case PTRACE_PEEKTEXT: /* read word at location addr. */ 52 case PTRACE_PEEKTEXT: /* read word at location addr. */
@@ -282,10 +239,7 @@ long sys_ptrace(long request, long pid, long addr, long data)
282 ret = ptrace_request(child, request, addr, data); 239 ret = ptrace_request(child, request, addr, data);
283 break; 240 break;
284 } 241 }
285 out_tsk: 242
286 put_task_struct(child);
287 out:
288 unlock_kernel();
289 return ret; 243 return ret;
290} 244}
291 245
diff --git a/arch/um/kernel/sigio_user.c b/arch/um/kernel/sigio_user.c
index a52751108aa1..48b1f644b9a6 100644
--- a/arch/um/kernel/sigio_user.c
+++ b/arch/um/kernel/sigio_user.c
@@ -18,7 +18,6 @@
18#include "kern_util.h" 18#include "kern_util.h"
19#include "user_util.h" 19#include "user_util.h"
20#include "sigio.h" 20#include "sigio.h"
21#include "helper.h"
22#include "os.h" 21#include "os.h"
23 22
24/* Changed during early boot */ 23/* Changed during early boot */
@@ -225,7 +224,7 @@ static int need_poll(int n)
225 next_poll.used = n; 224 next_poll.used = n;
226 return(0); 225 return(0);
227 } 226 }
228 if(next_poll.poll != NULL) kfree(next_poll.poll); 227 kfree(next_poll.poll);
229 next_poll.poll = um_kmalloc_atomic(n * sizeof(struct pollfd)); 228 next_poll.poll = um_kmalloc_atomic(n * sizeof(struct pollfd));
230 if(next_poll.poll == NULL){ 229 if(next_poll.poll == NULL){
231 printk("need_poll : failed to allocate new pollfds\n"); 230 printk("need_poll : failed to allocate new pollfds\n");
diff --git a/arch/um/kernel/skas/include/mmu-skas.h b/arch/um/kernel/skas/include/mmu-skas.h
index 09536f81ee42..44110c521e49 100644
--- a/arch/um/kernel/skas/include/mmu-skas.h
+++ b/arch/um/kernel/skas/include/mmu-skas.h
@@ -8,6 +8,7 @@
8 8
9#include "linux/config.h" 9#include "linux/config.h"
10#include "mm_id.h" 10#include "mm_id.h"
11#include "asm/ldt.h"
11 12
12struct mmu_context_skas { 13struct mmu_context_skas {
13 struct mm_id id; 14 struct mm_id id;
@@ -15,6 +16,7 @@ struct mmu_context_skas {
15#ifdef CONFIG_3_LEVEL_PGTABLES 16#ifdef CONFIG_3_LEVEL_PGTABLES
16 unsigned long last_pmd; 17 unsigned long last_pmd;
17#endif 18#endif
19 uml_ldt_t ldt;
18}; 20};
19 21
20extern void switch_mm_skas(struct mm_id * mm_idp); 22extern 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 060934740f9f..daa2f85b684c 100644
--- a/arch/um/kernel/skas/include/skas.h
+++ b/arch/um/kernel/skas/include/skas.h
@@ -10,7 +10,8 @@
10#include "sysdep/ptrace.h" 10#include "sysdep/ptrace.h"
11 11
12extern int userspace_pid[]; 12extern int userspace_pid[];
13extern int proc_mm, ptrace_faultinfo; 13extern int proc_mm, ptrace_faultinfo, ptrace_ldt;
14extern int skas_needs_stub;
14 15
15extern void switch_threads(void *me, void *next); 16extern void switch_threads(void *me, void *next);
16extern void thread_wait(void *sw, void *fb); 17extern void thread_wait(void *sw, void *fb);
diff --git a/arch/um/kernel/skas/mem.c b/arch/um/kernel/skas/mem.c
index 147466d7ff4f..88ab96c609ce 100644
--- a/arch/um/kernel/skas/mem.c
+++ b/arch/um/kernel/skas/mem.c
@@ -20,7 +20,7 @@ unsigned long set_task_sizes_skas(int arg, unsigned long *host_size_out,
20 *task_size_out = CONFIG_HOST_TASK_SIZE; 20 *task_size_out = CONFIG_HOST_TASK_SIZE;
21#else 21#else
22 *host_size_out = top; 22 *host_size_out = top;
23 if (proc_mm && ptrace_faultinfo) 23 if (!skas_needs_stub)
24 *task_size_out = top; 24 *task_size_out = top;
25 else *task_size_out = CONFIG_STUB_START & PGDIR_MASK; 25 else *task_size_out = CONFIG_STUB_START & PGDIR_MASK;
26#endif 26#endif
diff --git a/arch/um/kernel/skas/mmu.c b/arch/um/kernel/skas/mmu.c
index 9e5e39cea821..677871f1b37c 100644
--- a/arch/um/kernel/skas/mmu.c
+++ b/arch/um/kernel/skas/mmu.c
@@ -15,6 +15,7 @@
15#include "asm/mmu.h" 15#include "asm/mmu.h"
16#include "asm/pgalloc.h" 16#include "asm/pgalloc.h"
17#include "asm/pgtable.h" 17#include "asm/pgtable.h"
18#include "asm/ldt.h"
18#include "os.h" 19#include "os.h"
19#include "skas.h" 20#include "skas.h"
20 21
@@ -74,13 +75,12 @@ static int init_stub_pte(struct mm_struct *mm, unsigned long proc,
74 75
75int init_new_context_skas(struct task_struct *task, struct mm_struct *mm) 76int init_new_context_skas(struct task_struct *task, struct mm_struct *mm)
76{ 77{
77 struct mm_struct *cur_mm = current->mm; 78 struct mmu_context_skas *from_mm = NULL;
78 struct mm_id *cur_mm_id = &cur_mm->context.skas.id; 79 struct mmu_context_skas *to_mm = &mm->context.skas;
79 struct mm_id *mm_id = &mm->context.skas.id;
80 unsigned long stack = 0; 80 unsigned long stack = 0;
81 int from, ret = -ENOMEM; 81 int from_fd, ret = -ENOMEM;
82 82
83 if(!proc_mm || !ptrace_faultinfo){ 83 if(skas_needs_stub){
84 stack = get_zeroed_page(GFP_KERNEL); 84 stack = get_zeroed_page(GFP_KERNEL);
85 if(stack == 0) 85 if(stack == 0)
86 goto out; 86 goto out;
@@ -102,33 +102,43 @@ int init_new_context_skas(struct task_struct *task, struct mm_struct *mm)
102 102
103 mm->nr_ptes--; 103 mm->nr_ptes--;
104 } 104 }
105 mm_id->stack = stack; 105
106 to_mm->id.stack = stack;
107 if(current->mm != NULL && current->mm != &init_mm)
108 from_mm = &current->mm->context.skas;
106 109
107 if(proc_mm){ 110 if(proc_mm){
108 if((cur_mm != NULL) && (cur_mm != &init_mm)) 111 if(from_mm)
109 from = cur_mm_id->u.mm_fd; 112 from_fd = from_mm->id.u.mm_fd;
110 else from = -1; 113 else from_fd = -1;
111 114
112 ret = new_mm(from, stack); 115 ret = new_mm(from_fd, stack);
113 if(ret < 0){ 116 if(ret < 0){
114 printk("init_new_context_skas - new_mm failed, " 117 printk("init_new_context_skas - new_mm failed, "
115 "errno = %d\n", ret); 118 "errno = %d\n", ret);
116 goto out_free; 119 goto out_free;
117 } 120 }
118 mm_id->u.mm_fd = ret; 121 to_mm->id.u.mm_fd = ret;
119 } 122 }
120 else { 123 else {
121 if((cur_mm != NULL) && (cur_mm != &init_mm)) 124 if(from_mm)
122 mm_id->u.pid = copy_context_skas0(stack, 125 to_mm->id.u.pid = copy_context_skas0(stack,
123 cur_mm_id->u.pid); 126 from_mm->id.u.pid);
124 else mm_id->u.pid = start_userspace(stack); 127 else to_mm->id.u.pid = start_userspace(stack);
128 }
129
130 ret = init_new_ldt(to_mm, from_mm);
131 if(ret < 0){
132 printk("init_new_context_skas - init_ldt"
133 " failed, errno = %d\n", ret);
134 goto out_free;
125 } 135 }
126 136
127 return 0; 137 return 0;
128 138
129 out_free: 139 out_free:
130 if(mm_id->stack != 0) 140 if(to_mm->id.stack != 0)
131 free_page(mm_id->stack); 141 free_page(to_mm->id.stack);
132 out: 142 out:
133 return ret; 143 return ret;
134} 144}
diff --git a/arch/um/kernel/skas/process.c b/arch/um/kernel/skas/process.c
index 5cd0e9929789..599d679bd4fc 100644
--- a/arch/um/kernel/skas/process.c
+++ b/arch/um/kernel/skas/process.c
@@ -69,6 +69,17 @@ void wait_stub_done(int pid, int sig, char * fname)
69 69
70 if((n < 0) || !WIFSTOPPED(status) || 70 if((n < 0) || !WIFSTOPPED(status) ||
71 (WSTOPSIG(status) != SIGUSR1 && WSTOPSIG(status) != SIGTRAP)){ 71 (WSTOPSIG(status) != SIGUSR1 && WSTOPSIG(status) != SIGTRAP)){
72 unsigned long regs[FRAME_SIZE];
73 if(ptrace(PTRACE_GETREGS, pid, 0, regs) < 0)
74 printk("Failed to get registers from stub, "
75 "errno = %d\n", errno);
76 else {
77 int i;
78
79 printk("Stub registers -\n");
80 for(i = 0; i < FRAME_SIZE; i++)
81 printk("\t%d - %lx\n", i, regs[i]);
82 }
72 panic("%s : failed to wait for SIGUSR1/SIGTRAP, " 83 panic("%s : failed to wait for SIGUSR1/SIGTRAP, "
73 "pid = %d, n = %d, errno = %d, status = 0x%x\n", 84 "pid = %d, n = %d, errno = %d, status = 0x%x\n",
74 fname, pid, n, errno, status); 85 fname, pid, n, errno, status);
@@ -370,9 +381,9 @@ int copy_context_skas0(unsigned long new_stack, int pid)
370} 381}
371 382
372/* 383/*
373 * This is used only, if proc_mm is available, while PTRACE_FAULTINFO 384 * This is used only, if stub pages are needed, while proc_mm is
374 * isn't. Opening /proc/mm creates a new mm_context, which lacks the stub-pages 385 * availabl. Opening /proc/mm creates a new mm_context, which lacks
375 * Thus, we map them using /proc/mm-fd 386 * the stub-pages. Thus, we map them using /proc/mm-fd
376 */ 387 */
377void map_stub_pages(int fd, unsigned long code, 388void map_stub_pages(int fd, unsigned long code,
378 unsigned long data, unsigned long stack) 389 unsigned long data, unsigned long stack)
diff --git a/arch/um/kernel/skas/process_kern.c b/arch/um/kernel/skas/process_kern.c
index efe92e8aa2a9..9c990253966c 100644
--- a/arch/um/kernel/skas/process_kern.c
+++ b/arch/um/kernel/skas/process_kern.c
@@ -145,7 +145,7 @@ int new_mm(int from, unsigned long stack)
145 "err = %d\n", -n); 145 "err = %d\n", -n);
146 } 146 }
147 147
148 if(!ptrace_faultinfo) 148 if(skas_needs_stub)
149 map_stub_pages(fd, CONFIG_STUB_CODE, CONFIG_STUB_DATA, stack); 149 map_stub_pages(fd, CONFIG_STUB_CODE, CONFIG_STUB_DATA, stack);
150 150
151 return(fd); 151 return(fd);
diff --git a/arch/um/kernel/tt/uaccess_user.c b/arch/um/kernel/tt/uaccess_user.c
index 8c220f054b61..6c92bbccb49c 100644
--- a/arch/um/kernel/tt/uaccess_user.c
+++ b/arch/um/kernel/tt/uaccess_user.c
@@ -10,6 +10,7 @@
10#include "uml_uaccess.h" 10#include "uml_uaccess.h"
11#include "task.h" 11#include "task.h"
12#include "kern_util.h" 12#include "kern_util.h"
13#include "os.h"
13 14
14int __do_copy_from_user(void *to, const void *from, int n, 15int __do_copy_from_user(void *to, const void *from, int n,
15 void **fault_addr, void **fault_catcher) 16 void **fault_addr, void **fault_catcher)
diff --git a/arch/um/kernel/uaccess.c b/arch/um/kernel/uaccess.c
new file mode 100644
index 000000000000..054e3de0784e
--- /dev/null
+++ b/arch/um/kernel/uaccess.c
@@ -0,0 +1,30 @@
1/*
2 * Copyright (C) 2001 Chris Emerson (cemerson@chiark.greenend.org.uk)
3 * Copyright (C) 2001, 2002 Jeff Dike (jdike@karaya.com)
4 * Licensed under the GPL
5 */
6
7/* These are here rather than tt/uaccess.c because skas mode needs them in
8 * order to do SIGBUS recovery when a tmpfs mount runs out of room.
9 */
10
11#include <linux/string.h>
12#include "os.h"
13
14void __do_copy(void *to, const void *from, int n)
15{
16 memcpy(to, from, n);
17}
18
19
20int __do_copy_to_user(void *to, const void *from, int n,
21 void **fault_addr, void **fault_catcher)
22{
23 unsigned long fault;
24 int faulted;
25
26 fault = __do_user_copy(to, from, n, fault_addr, fault_catcher,
27 __do_copy, &faulted);
28 if(!faulted) return(0);
29 else return(n - (fault - (unsigned long) to));
30}
diff --git a/arch/um/kernel/uaccess_user.c b/arch/um/kernel/uaccess_user.c
deleted file mode 100644
index d035257ed0af..000000000000
--- a/arch/um/kernel/uaccess_user.c
+++ /dev/null
@@ -1,64 +0,0 @@
1/*
2 * Copyright (C) 2001 Chris Emerson (cemerson@chiark.greenend.org.uk)
3 * Copyright (C) 2001, 2002 Jeff Dike (jdike@karaya.com)
4 * Licensed under the GPL
5 */
6
7#include <setjmp.h>
8#include <string.h>
9
10/* These are here rather than tt/uaccess.c because skas mode needs them in
11 * order to do SIGBUS recovery when a tmpfs mount runs out of room.
12 */
13
14unsigned long __do_user_copy(void *to, const void *from, int n,
15 void **fault_addr, void **fault_catcher,
16 void (*op)(void *to, const void *from,
17 int n), int *faulted_out)
18{
19 unsigned long *faddrp = (unsigned long *) fault_addr, ret;
20
21 sigjmp_buf jbuf;
22 *fault_catcher = &jbuf;
23 if(sigsetjmp(jbuf, 1) == 0){
24 (*op)(to, from, n);
25 ret = 0;
26 *faulted_out = 0;
27 }
28 else {
29 ret = *faddrp;
30 *faulted_out = 1;
31 }
32 *fault_addr = NULL;
33 *fault_catcher = NULL;
34 return ret;
35}
36
37void __do_copy(void *to, const void *from, int n)
38{
39 memcpy(to, from, n);
40}
41
42
43int __do_copy_to_user(void *to, const void *from, int n,
44 void **fault_addr, void **fault_catcher)
45{
46 unsigned long fault;
47 int faulted;
48
49 fault = __do_user_copy(to, from, n, fault_addr, fault_catcher,
50 __do_copy, &faulted);
51 if(!faulted) return(0);
52 else return(n - (fault - (unsigned long) to));
53}
54
55/*
56 * Overrides for Emacs so that we follow Linus's tabbing style.
57 * Emacs will notice this stuff at the end of the file and automatically
58 * adjust the settings for this buffer only. This must remain at the end
59 * of the file.
60 * ---------------------------------------------------------------------------
61 * Local variables:
62 * c-file-style: "linux"
63 * End:
64 */
diff --git a/arch/um/kernel/um_arch.c b/arch/um/kernel/um_arch.c
index 93dc782dc1cc..142a9493912b 100644
--- a/arch/um/kernel/um_arch.c
+++ b/arch/um/kernel/um_arch.c
@@ -137,7 +137,7 @@ static char *argv1_end = NULL;
137 137
138/* Set in early boot */ 138/* Set in early boot */
139static int have_root __initdata = 0; 139static int have_root __initdata = 0;
140long physmem_size = 32 * 1024 * 1024; 140long long physmem_size = 32 * 1024 * 1024;
141 141
142void set_cmdline(char *cmd) 142void set_cmdline(char *cmd)
143{ 143{
@@ -402,7 +402,7 @@ int linux_main(int argc, char **argv)
402#ifndef CONFIG_HIGHMEM 402#ifndef CONFIG_HIGHMEM
403 highmem = 0; 403 highmem = 0;
404 printf("CONFIG_HIGHMEM not enabled - physical memory shrunk " 404 printf("CONFIG_HIGHMEM not enabled - physical memory shrunk "
405 "to %ld bytes\n", physmem_size); 405 "to %lu bytes\n", physmem_size);
406#endif 406#endif
407 } 407 }
408 408
@@ -414,8 +414,8 @@ int linux_main(int argc, char **argv)
414 414
415 setup_physmem(uml_physmem, uml_reserved, physmem_size, highmem); 415 setup_physmem(uml_physmem, uml_reserved, physmem_size, highmem);
416 if(init_maps(physmem_size, iomem_size, highmem)){ 416 if(init_maps(physmem_size, iomem_size, highmem)){
417 printf("Failed to allocate mem_map for %ld bytes of physical " 417 printf("Failed to allocate mem_map for %lu bytes of physical "
418 "memory and %ld bytes of highmem\n", physmem_size, 418 "memory and %lu bytes of highmem\n", physmem_size,
419 highmem); 419 highmem);
420 exit(1); 420 exit(1);
421 } 421 }
@@ -426,7 +426,7 @@ int linux_main(int argc, char **argv)
426 end_vm = start_vm + virtmem_size; 426 end_vm = start_vm + virtmem_size;
427 427
428 if(virtmem_size < physmem_size) 428 if(virtmem_size < physmem_size)
429 printf("Kernel virtual memory size shrunk to %ld bytes\n", 429 printf("Kernel virtual memory size shrunk to %lu bytes\n",
430 virtmem_size); 430 virtmem_size);
431 431
432 uml_postsetup(); 432 uml_postsetup();
diff --git a/arch/um/kernel/user_util.c b/arch/um/kernel/user_util.c
index 41d17c71511c..4c231161f257 100644
--- a/arch/um/kernel/user_util.c
+++ b/arch/um/kernel/user_util.c
@@ -27,7 +27,6 @@
27#include "user.h" 27#include "user.h"
28#include "mem_user.h" 28#include "mem_user.h"
29#include "init.h" 29#include "init.h"
30#include "helper.h"
31#include "ptrace_user.h" 30#include "ptrace_user.h"
32#include "uml-config.h" 31#include "uml-config.h"
33 32
diff --git a/arch/um/os-Linux/Makefile b/arch/um/os-Linux/Makefile
index d15ec2af6a22..b83ac8e21c35 100644
--- a/arch/um/os-Linux/Makefile
+++ b/arch/um/os-Linux/Makefile
@@ -3,11 +3,12 @@
3# Licensed under the GPL 3# Licensed under the GPL
4# 4#
5 5
6obj-y = aio.o elf_aux.o file.o mem.o process.o signal.o start_up.o time.o \ 6obj-y = aio.o elf_aux.o file.o helper.o main.o mem.o process.o signal.o \
7 tt.o tty.o user_syms.o drivers/ sys-$(SUBARCH)/ 7 start_up.o time.o tt.o tty.o uaccess.o user_syms.o drivers/ \
8 sys-$(SUBARCH)/
8 9
9USER_OBJS := aio.o elf_aux.o file.o mem.o process.o signal.o start_up.o \ 10USER_OBJS := aio.o elf_aux.o file.o helper.o main.o mem.o process.o signal.o \
10 time.o tt.o tty.o 11 start_up.o time.o tt.o tty.o uaccess.o
11 12
12elf_aux.o: $(ARCH_DIR)/kernel-offsets.h 13elf_aux.o: $(ARCH_DIR)/kernel-offsets.h
13CFLAGS_elf_aux.o += -I$(objtree)/arch/um 14CFLAGS_elf_aux.o += -I$(objtree)/arch/um
diff --git a/arch/um/os-Linux/aio.c b/arch/um/os-Linux/aio.c
index 41cfb0944201..ffa759addd3c 100644
--- a/arch/um/os-Linux/aio.c
+++ b/arch/um/os-Linux/aio.c
@@ -10,7 +10,6 @@
10#include <sched.h> 10#include <sched.h>
11#include <sys/syscall.h> 11#include <sys/syscall.h>
12#include "os.h" 12#include "os.h"
13#include "helper.h"
14#include "aio.h" 13#include "aio.h"
15#include "init.h" 14#include "init.h"
16#include "user.h" 15#include "user.h"
diff --git a/arch/um/os-Linux/drivers/ethertap_user.c b/arch/um/os-Linux/drivers/ethertap_user.c
index cd4d6544da71..901b85e8a1c6 100644
--- a/arch/um/os-Linux/drivers/ethertap_user.c
+++ b/arch/um/os-Linux/drivers/ethertap_user.c
@@ -19,7 +19,6 @@
19#include "user_util.h" 19#include "user_util.h"
20#include "net_user.h" 20#include "net_user.h"
21#include "etap.h" 21#include "etap.h"
22#include "helper.h"
23#include "os.h" 22#include "os.h"
24 23
25#define MAX_PACKET ETH_MAX_PACKET 24#define MAX_PACKET ETH_MAX_PACKET
diff --git a/arch/um/os-Linux/drivers/tuntap_user.c b/arch/um/os-Linux/drivers/tuntap_user.c
index 4ba9b17adf13..52945338b64d 100644
--- a/arch/um/os-Linux/drivers/tuntap_user.c
+++ b/arch/um/os-Linux/drivers/tuntap_user.c
@@ -20,7 +20,6 @@
20#include "kern_util.h" 20#include "kern_util.h"
21#include "user_util.h" 21#include "user_util.h"
22#include "user.h" 22#include "user.h"
23#include "helper.h"
24#include "os.h" 23#include "os.h"
25 24
26#define MAX_PACKET ETH_MAX_PACKET 25#define MAX_PACKET ETH_MAX_PACKET
diff --git a/arch/um/kernel/helper.c b/arch/um/os-Linux/helper.c
index 33fb0bd3b11a..36cc8475bcda 100644
--- a/arch/um/kernel/helper.c
+++ b/arch/um/os-Linux/helper.c
@@ -1,4 +1,4 @@
1/* 1/*
2 * Copyright (C) 2002 Jeff Dike (jdike@karaya.com) 2 * Copyright (C) 2002 Jeff Dike (jdike@karaya.com)
3 * Licensed under the GPL 3 * Licensed under the GPL
4 */ 4 */
@@ -13,7 +13,6 @@
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"
17#include "os.h" 16#include "os.h"
18 17
19struct helper_data { 18struct helper_data {
@@ -46,7 +45,7 @@ static int helper_child(void *arg)
46 errval = errno; 45 errval = errno;
47 printk("execvp of '%s' failed - errno = %d\n", argv[0], errno); 46 printk("execvp of '%s' failed - errno = %d\n", argv[0], errno);
48 os_write_file(data->fd, &errval, sizeof(errval)); 47 os_write_file(data->fd, &errval, sizeof(errval));
49 os_kill_process(os_getpid(), 0); 48 kill(os_getpid(), SIGKILL);
50 return(0); 49 return(0);
51} 50}
52 51
@@ -90,7 +89,7 @@ int run_helper(void (*pre_exec)(void *), void *pre_data, char **argv,
90 goto out_close; 89 goto out_close;
91 } 90 }
92 91
93 os_close_file(fds[1]); 92 close(fds[1]);
94 fds[1] = -1; 93 fds[1] = -1;
95 94
96 /*Read the errno value from the child.*/ 95 /*Read the errno value from the child.*/
@@ -98,7 +97,8 @@ int run_helper(void (*pre_exec)(void *), void *pre_data, char **argv,
98 if(n < 0){ 97 if(n < 0){
99 printk("run_helper : read on pipe failed, ret = %d\n", -n); 98 printk("run_helper : read on pipe failed, ret = %d\n", -n);
100 ret = n; 99 ret = n;
101 os_kill_process(pid, 1); 100 kill(pid, SIGKILL);
101 CATCH_EINTR(waitpid(pid, NULL, 0));
102 } 102 }
103 else if(n != 0){ 103 else if(n != 0){
104 CATCH_EINTR(n = waitpid(pid, NULL, 0)); 104 CATCH_EINTR(n = waitpid(pid, NULL, 0));
@@ -109,8 +109,8 @@ int run_helper(void (*pre_exec)(void *), void *pre_data, char **argv,
109 109
110out_close: 110out_close:
111 if (fds[1] != -1) 111 if (fds[1] != -1)
112 os_close_file(fds[1]); 112 close(fds[1]);
113 os_close_file(fds[0]); 113 close(fds[0]);
114out_free: 114out_free:
115 if(stack_out == NULL) 115 if(stack_out == NULL)
116 free_stack(stack, 0); 116 free_stack(stack, 0);
@@ -118,7 +118,7 @@ out_free:
118 return(ret); 118 return(ret);
119} 119}
120 120
121int run_helper_thread(int (*proc)(void *), void *arg, unsigned int flags, 121int run_helper_thread(int (*proc)(void *), void *arg, unsigned int flags,
122 unsigned long *stack_out, int stack_order) 122 unsigned long *stack_out, int stack_order)
123{ 123{
124 unsigned long stack, sp; 124 unsigned long stack, sp;
@@ -131,7 +131,7 @@ int run_helper_thread(int (*proc)(void *), void *arg, unsigned int flags,
131 pid = clone(proc, (void *) sp, flags | SIGCHLD, arg); 131 pid = clone(proc, (void *) sp, flags | SIGCHLD, arg);
132 if(pid < 0){ 132 if(pid < 0){
133 err = -errno; 133 err = -errno;
134 printk("run_helper_thread : clone failed, errno = %d\n", 134 printk("run_helper_thread : clone failed, errno = %d\n",
135 errno); 135 errno);
136 return err; 136 return err;
137 } 137 }
diff --git a/arch/um/kernel/main.c b/arch/um/os-Linux/main.c
index d31027f0fe39..23da27d22569 100644
--- a/arch/um/kernel/main.c
+++ b/arch/um/os-Linux/main.c
@@ -157,25 +157,25 @@ int main(int argc, char **argv, char **envp)
157 */ 157 */
158 change_sig(SIGPROF, 0); 158 change_sig(SIGPROF, 0);
159 159
160 /* This signal stuff used to be in the reboot case. However, 160 /* This signal stuff used to be in the reboot case. However,
161 * sometimes a SIGVTALRM can come in when we're halting (reproducably 161 * sometimes a SIGVTALRM can come in when we're halting (reproducably
162 * when writing out gcov information, presumably because that takes 162 * when writing out gcov information, presumably because that takes
163 * some time) and cause a segfault. 163 * some time) and cause a segfault.
164 */ 164 */
165 165
166 /* stop timers and set SIG*ALRM to be ignored */ 166 /* stop timers and set SIG*ALRM to be ignored */
167 disable_timer(); 167 disable_timer();
168 168
169 /* disable SIGIO for the fds and set SIGIO to be ignored */ 169 /* disable SIGIO for the fds and set SIGIO to be ignored */
170 err = deactivate_all_fds(); 170 err = deactivate_all_fds();
171 if(err) 171 if(err)
172 printf("deactivate_all_fds failed, errno = %d\n", -err); 172 printf("deactivate_all_fds failed, errno = %d\n", -err);
173 173
174 /* Let any pending signals fire now. This ensures 174 /* Let any pending signals fire now. This ensures
175 * that they won't be delivered after the exec, when 175 * that they won't be delivered after the exec, when
176 * they are definitely not expected. 176 * they are definitely not expected.
177 */ 177 */
178 unblock_signals(); 178 unblock_signals();
179 179
180 /* Reboot */ 180 /* Reboot */
181 if(ret){ 181 if(ret){
@@ -257,14 +257,3 @@ void __wrap_free(void *ptr)
257 } 257 }
258 else __real_free(ptr); 258 else __real_free(ptr);
259} 259}
260
261/*
262 * Overrides for Emacs so that we follow Linus's tabbing style.
263 * Emacs will notice this stuff at the end of the file and automatically
264 * adjust the settings for this buffer only. This must remain at the end
265 * of the file.
266 * ---------------------------------------------------------------------------
267 * Local variables:
268 * c-file-style: "linux"
269 * End:
270 */
diff --git a/arch/um/os-Linux/mem.c b/arch/um/os-Linux/mem.c
index 8e71edaaf80b..9d7d69a523bb 100644
--- a/arch/um/os-Linux/mem.c
+++ b/arch/um/os-Linux/mem.c
@@ -88,7 +88,7 @@ int make_tempfile(const char *template, char **out_tempname, int do_unlink)
88 * This proc is used in start_up.c 88 * This proc is used in start_up.c
89 * So it isn't 'static'. 89 * So it isn't 'static'.
90 */ 90 */
91int create_tmp_file(unsigned long len) 91int create_tmp_file(unsigned long long len)
92{ 92{
93 int fd, err; 93 int fd, err;
94 char zero; 94 char zero;
@@ -121,7 +121,7 @@ int create_tmp_file(unsigned long len)
121 return(fd); 121 return(fd);
122} 122}
123 123
124static int create_anon_file(unsigned long len) 124static int create_anon_file(unsigned long long len)
125{ 125{
126 void *addr; 126 void *addr;
127 int fd; 127 int fd;
@@ -144,7 +144,7 @@ static int create_anon_file(unsigned long len)
144 144
145extern int have_devanon; 145extern int have_devanon;
146 146
147int create_mem_file(unsigned long len) 147int create_mem_file(unsigned long long len)
148{ 148{
149 int err, fd; 149 int err, fd;
150 150
diff --git a/arch/um/os-Linux/start_up.c b/arch/um/os-Linux/start_up.c
index b99ab414542f..37517d49c4ae 100644
--- a/arch/um/os-Linux/start_up.c
+++ b/arch/um/os-Linux/start_up.c
@@ -135,7 +135,9 @@ static int stop_ptraced_child(int pid, void *stack, int exitcode,
135} 135}
136 136
137int ptrace_faultinfo = 1; 137int ptrace_faultinfo = 1;
138int ptrace_ldt = 1;
138int proc_mm = 1; 139int proc_mm = 1;
140int skas_needs_stub = 0;
139 141
140static int __init skas0_cmd_param(char *str, int* add) 142static int __init skas0_cmd_param(char *str, int* add)
141{ 143{
@@ -294,7 +296,7 @@ static void __init check_ptrace(void)
294 check_sysemu(); 296 check_sysemu();
295} 297}
296 298
297extern int create_tmp_file(unsigned long len); 299extern int create_tmp_file(unsigned long long len);
298 300
299static void check_tmpexec(void) 301static void check_tmpexec(void)
300{ 302{
@@ -352,14 +354,26 @@ __uml_setup("noptracefaultinfo", noptracefaultinfo_cmd_param,
352" it. To support PTRACE_FAULTINFO, the host needs to be patched\n" 354" it. To support PTRACE_FAULTINFO, the host needs to be patched\n"
353" using the current skas3 patch.\n\n"); 355" using the current skas3 patch.\n\n");
354 356
357static int __init noptraceldt_cmd_param(char *str, int* add)
358{
359 ptrace_ldt = 0;
360 return 0;
361}
362
363__uml_setup("noptraceldt", noptraceldt_cmd_param,
364"noptraceldt\n"
365" Turns off usage of PTRACE_LDT, even if host supports it.\n"
366" To support PTRACE_LDT, the host needs to be patched using\n"
367" the current skas3 patch.\n\n");
368
355#ifdef UML_CONFIG_MODE_SKAS 369#ifdef UML_CONFIG_MODE_SKAS
356static inline void check_skas3_ptrace_support(void) 370static inline void check_skas3_ptrace_faultinfo(void)
357{ 371{
358 struct ptrace_faultinfo fi; 372 struct ptrace_faultinfo fi;
359 void *stack; 373 void *stack;
360 int pid, n; 374 int pid, n;
361 375
362 printf("Checking for the skas3 patch in the host..."); 376 printf(" - PTRACE_FAULTINFO...");
363 pid = start_ptraced_child(&stack); 377 pid = start_ptraced_child(&stack);
364 378
365 n = ptrace(PTRACE_FAULTINFO, pid, 0, &fi); 379 n = ptrace(PTRACE_FAULTINFO, pid, 0, &fi);
@@ -381,9 +395,49 @@ static inline void check_skas3_ptrace_support(void)
381 stop_ptraced_child(pid, stack, 1, 1); 395 stop_ptraced_child(pid, stack, 1, 1);
382} 396}
383 397
384int can_do_skas(void) 398static inline void check_skas3_ptrace_ldt(void)
399{
400#ifdef PTRACE_LDT
401 void *stack;
402 int pid, n;
403 unsigned char ldtbuf[40];
404 struct ptrace_ldt ldt_op = (struct ptrace_ldt) {
405 .func = 2, /* read default ldt */
406 .ptr = ldtbuf,
407 .bytecount = sizeof(ldtbuf)};
408
409 printf(" - PTRACE_LDT...");
410 pid = start_ptraced_child(&stack);
411
412 n = ptrace(PTRACE_LDT, pid, 0, (unsigned long) &ldt_op);
413 if (n < 0) {
414 if(errno == EIO)
415 printf("not found\n");
416 else {
417 perror("not found");
418 }
419 ptrace_ldt = 0;
420 }
421 else {
422 if(ptrace_ldt)
423 printf("found\n");
424 else
425 printf("found, but use is disabled\n");
426 }
427
428 stop_ptraced_child(pid, stack, 1, 1);
429#else
430 /* PTRACE_LDT might be disabled via cmdline option.
431 * We want to override this, else we might use the stub
432 * without real need
433 */
434 ptrace_ldt = 1;
435#endif
436}
437
438static inline void check_skas3_proc_mm(void)
385{ 439{
386 printf("Checking for /proc/mm..."); 440 printf(" - /proc/mm...");
387 if (os_access("/proc/mm", OS_ACC_W_OK) < 0) { 441 if (os_access("/proc/mm", OS_ACC_W_OK) < 0) {
388 proc_mm = 0; 442 proc_mm = 0;
389 printf("not found\n"); 443 printf("not found\n");
@@ -394,8 +448,19 @@ int can_do_skas(void)
394 else 448 else
395 printf("found\n"); 449 printf("found\n");
396 } 450 }
451}
452
453int can_do_skas(void)
454{
455 printf("Checking for the skas3 patch in the host:\n");
456
457 check_skas3_proc_mm();
458 check_skas3_ptrace_faultinfo();
459 check_skas3_ptrace_ldt();
460
461 if(!proc_mm || !ptrace_faultinfo || !ptrace_ldt)
462 skas_needs_stub = 1;
397 463
398 check_skas3_ptrace_support();
399 return 1; 464 return 1;
400} 465}
401#else 466#else
diff --git a/arch/um/os-Linux/uaccess.c b/arch/um/os-Linux/uaccess.c
new file mode 100644
index 000000000000..38d710158c3d
--- /dev/null
+++ b/arch/um/os-Linux/uaccess.c
@@ -0,0 +1,32 @@
1/*
2 * Copyright (C) 2001 Chris Emerson (cemerson@chiark.greenend.org.uk)
3 * Copyright (C) 2001, 2002 Jeff Dike (jdike@karaya.com)
4 * Licensed under the GPL
5 */
6
7#include <setjmp.h>
8#include <string.h>
9
10unsigned long __do_user_copy(void *to, const void *from, int n,
11 void **fault_addr, void **fault_catcher,
12 void (*op)(void *to, const void *from,
13 int n), int *faulted_out)
14{
15 unsigned long *faddrp = (unsigned long *) fault_addr, ret;
16
17 sigjmp_buf jbuf;
18 *fault_catcher = &jbuf;
19 if(sigsetjmp(jbuf, 1) == 0){
20 (*op)(to, from, n);
21 ret = 0;
22 *faulted_out = 0;
23 }
24 else {
25 ret = *faddrp;
26 *faulted_out = 1;
27 }
28 *fault_addr = NULL;
29 *fault_catcher = NULL;
30 return ret;
31}
32
diff --git a/arch/um/scripts/Makefile.rules b/arch/um/scripts/Makefile.rules
index 651d9d88b656..b3fbf125709b 100644
--- a/arch/um/scripts/Makefile.rules
+++ b/arch/um/scripts/Makefile.rules
@@ -26,8 +26,13 @@ define unprofile
26 $(patsubst -pg,,$(patsubst -fprofile-arcs -ftest-coverage,,$(1))) 26 $(patsubst -pg,,$(patsubst -fprofile-arcs -ftest-coverage,,$(1)))
27endef 27endef
28 28
29# cmd_make_link checks to see if the $(foo-dir) variable starts with a /. If
30# so, it's considered to be a path relative to $(srcdir) rather than
31# $(srcdir)/arch/$(SUBARCH). This is because x86_64 wants to get ldt.c from
32# arch/um/sys-i386 rather than arch/i386 like the other borrowed files. So,
33# it sets $(ldt.c-dir) to /arch/um/sys-i386.
29quiet_cmd_make_link = SYMLINK $@ 34quiet_cmd_make_link = SYMLINK $@
30cmd_make_link = ln -sf $(srctree)/arch/$(SUBARCH)/$($(notdir $@)-dir)/$(notdir $@) $@ 35cmd_make_link = rm -f $@; ln -sf $(srctree)$(if $(filter-out /%,$($(notdir $@)-dir)),/arch/$(SUBARCH))/$($(notdir $@)-dir)/$(notdir $@) $@
31 36
32# this needs to be before the foreach, because targets does not accept 37# this needs to be before the foreach, because targets does not accept
33# complete paths like $(obj)/$(f). To make sure this works, use a := assignment 38# complete paths like $(obj)/$(f). To make sure this works, use a := assignment
diff --git a/arch/um/sys-i386/ldt.c b/arch/um/sys-i386/ldt.c
index 36b5c2c13289..6360f1c958d0 100644
--- a/arch/um/sys-i386/ldt.c
+++ b/arch/um/sys-i386/ldt.c
@@ -3,53 +3,26 @@
3 * Licensed under the GPL 3 * Licensed under the GPL
4 */ 4 */
5 5
6#include "linux/stddef.h"
6#include "linux/config.h" 7#include "linux/config.h"
7#include "linux/sched.h" 8#include "linux/sched.h"
8#include "linux/slab.h" 9#include "linux/slab.h"
9#include "linux/types.h" 10#include "linux/types.h"
11#include "linux/errno.h"
10#include "asm/uaccess.h" 12#include "asm/uaccess.h"
11#include "asm/ptrace.h"
12#include "asm/smp.h" 13#include "asm/smp.h"
13#include "asm/ldt.h" 14#include "asm/ldt.h"
15#include "asm/unistd.h"
14#include "choose-mode.h" 16#include "choose-mode.h"
15#include "kern.h" 17#include "kern.h"
16#include "mode_kern.h" 18#include "mode_kern.h"
17 19
18#ifdef CONFIG_MODE_TT
19
20extern int modify_ldt(int func, void *ptr, unsigned long bytecount); 20extern int modify_ldt(int func, void *ptr, unsigned long bytecount);
21 21
22static int do_modify_ldt_tt(int func, void *ptr, unsigned long bytecount) 22#ifdef CONFIG_MODE_TT
23{
24 return modify_ldt(func, ptr, bytecount);
25}
26
27#endif
28
29#ifdef CONFIG_MODE_SKAS
30
31#include "skas.h"
32#include "skas_ptrace.h"
33
34static int do_modify_ldt_skas(int func, void *ptr, unsigned long bytecount)
35{
36 struct ptrace_ldt ldt;
37 u32 cpu;
38 int res;
39
40 ldt = ((struct ptrace_ldt) { .func = func,
41 .ptr = ptr,
42 .bytecount = bytecount });
43
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 23
52int sys_modify_ldt(int func, void __user *ptr, unsigned long bytecount) 24static long do_modify_ldt_tt(int func, void __user *ptr,
25 unsigned long bytecount)
53{ 26{
54 struct user_desc info; 27 struct user_desc info;
55 int res = 0; 28 int res = 0;
@@ -89,8 +62,7 @@ int sys_modify_ldt(int func, void __user *ptr, unsigned long bytecount)
89 goto out; 62 goto out;
90 } 63 }
91 64
92 res = CHOOSE_MODE_PROC(do_modify_ldt_tt, do_modify_ldt_skas, func, 65 res = modify_ldt(func, p, bytecount);
93 p, bytecount);
94 if(res < 0) 66 if(res < 0)
95 goto out; 67 goto out;
96 68
@@ -108,3 +80,467 @@ out:
108 kfree(buf); 80 kfree(buf);
109 return res; 81 return res;
110} 82}
83
84#endif
85
86#ifdef CONFIG_MODE_SKAS
87
88#include "skas.h"
89#include "skas_ptrace.h"
90#include "asm/mmu_context.h"
91
92long write_ldt_entry(struct mm_id * mm_idp, int func, struct user_desc * desc,
93 void **addr, int done)
94{
95 long res;
96
97 if(proc_mm){
98 /* This is a special handling for the case, that the mm to
99 * modify isn't current->active_mm.
100 * If this is called directly by modify_ldt,
101 * (current->active_mm->context.skas.u == mm_idp)
102 * will be true. So no call to switch_mm_skas(mm_idp) is done.
103 * If this is called in case of init_new_ldt or PTRACE_LDT,
104 * mm_idp won't belong to current->active_mm, but child->mm.
105 * So we need to switch child's mm into our userspace, then
106 * later switch back.
107 *
108 * Note: I'm unshure: should interrupts be disabled here?
109 */
110 if(!current->active_mm || current->active_mm == &init_mm ||
111 mm_idp != &current->active_mm->context.skas.id)
112 switch_mm_skas(mm_idp);
113 }
114
115 if(ptrace_ldt) {
116 struct ptrace_ldt ldt_op = (struct ptrace_ldt) {
117 .func = func,
118 .ptr = desc,
119 .bytecount = sizeof(*desc)};
120 u32 cpu;
121 int pid;
122
123 if(!proc_mm)
124 pid = mm_idp->u.pid;
125 else {
126 cpu = get_cpu();
127 pid = userspace_pid[cpu];
128 }
129
130 res = ptrace(PTRACE_LDT, pid, 0, (unsigned long) &ldt_op);
131 if(res)
132 res = errno;
133
134 if(proc_mm)
135 put_cpu();
136 }
137 else {
138 void *stub_addr;
139 res = syscall_stub_data(mm_idp, (unsigned long *)desc,
140 (sizeof(*desc) + sizeof(long) - 1) &
141 ~(sizeof(long) - 1),
142 addr, &stub_addr);
143 if(!res){
144 unsigned long args[] = { func,
145 (unsigned long)stub_addr,
146 sizeof(*desc),
147 0, 0, 0 };
148 res = run_syscall_stub(mm_idp, __NR_modify_ldt, args,
149 0, addr, done);
150 }
151 }
152
153 if(proc_mm){
154 /* This is the second part of special handling, that makes
155 * PTRACE_LDT possible to implement.
156 */
157 if(current->active_mm && current->active_mm != &init_mm &&
158 mm_idp != &current->active_mm->context.skas.id)
159 switch_mm_skas(&current->active_mm->context.skas.id);
160 }
161
162 return res;
163}
164
165static long read_ldt_from_host(void __user * ptr, unsigned long bytecount)
166{
167 int res, n;
168 struct ptrace_ldt ptrace_ldt = (struct ptrace_ldt) {
169 .func = 0,
170 .bytecount = bytecount,
171 .ptr = (void *)kmalloc(bytecount, GFP_KERNEL)};
172 u32 cpu;
173
174 if(ptrace_ldt.ptr == NULL)
175 return -ENOMEM;
176
177 /* This is called from sys_modify_ldt only, so userspace_pid gives
178 * us the right number
179 */
180
181 cpu = get_cpu();
182 res = ptrace(PTRACE_LDT, userspace_pid[cpu], 0,
183 (unsigned long) &ptrace_ldt);
184 put_cpu();
185 if(res < 0)
186 goto out;
187
188 n = copy_to_user(ptr, ptrace_ldt.ptr, res);
189 if(n != 0)
190 res = -EFAULT;
191
192 out:
193 kfree(ptrace_ldt.ptr);
194
195 return res;
196}
197
198/*
199 * In skas mode, we hold our own ldt data in UML.
200 * Thus, the code implementing sys_modify_ldt_skas
201 * is very similar to (and mostly stolen from) sys_modify_ldt
202 * for arch/i386/kernel/ldt.c
203 * The routines copied and modified in part are:
204 * - read_ldt
205 * - read_default_ldt
206 * - write_ldt
207 * - sys_modify_ldt_skas
208 */
209
210static int read_ldt(void __user * ptr, unsigned long bytecount)
211{
212 int i, err = 0;
213 unsigned long size;
214 uml_ldt_t * ldt = &current->mm->context.skas.ldt;
215
216 if(!ldt->entry_count)
217 goto out;
218 if(bytecount > LDT_ENTRY_SIZE*LDT_ENTRIES)
219 bytecount = LDT_ENTRY_SIZE*LDT_ENTRIES;
220 err = bytecount;
221
222 if(ptrace_ldt){
223 return read_ldt_from_host(ptr, bytecount);
224 }
225
226 down(&ldt->semaphore);
227 if(ldt->entry_count <= LDT_DIRECT_ENTRIES){
228 size = LDT_ENTRY_SIZE*LDT_DIRECT_ENTRIES;
229 if(size > bytecount)
230 size = bytecount;
231 if(copy_to_user(ptr, ldt->entries, size))
232 err = -EFAULT;
233 bytecount -= size;
234 ptr += size;
235 }
236 else {
237 for(i=0; i<ldt->entry_count/LDT_ENTRIES_PER_PAGE && bytecount;
238 i++){
239 size = PAGE_SIZE;
240 if(size > bytecount)
241 size = bytecount;
242 if(copy_to_user(ptr, ldt->pages[i], size)){
243 err = -EFAULT;
244 break;
245 }
246 bytecount -= size;
247 ptr += size;
248 }
249 }
250 up(&ldt->semaphore);
251
252 if(bytecount == 0 || err == -EFAULT)
253 goto out;
254
255 if(clear_user(ptr, bytecount))
256 err = -EFAULT;
257
258out:
259 return err;
260}
261
262static int read_default_ldt(void __user * ptr, unsigned long bytecount)
263{
264 int err;
265
266 if(bytecount > 5*LDT_ENTRY_SIZE)
267 bytecount = 5*LDT_ENTRY_SIZE;
268
269 err = bytecount;
270 /* UML doesn't support lcall7 and lcall27.
271 * So, we don't really have a default ldt, but emulate
272 * an empty ldt of common host default ldt size.
273 */
274 if(clear_user(ptr, bytecount))
275 err = -EFAULT;
276
277 return err;
278}
279
280static int write_ldt(void __user * ptr, unsigned long bytecount, int func)
281{
282 uml_ldt_t * ldt = &current->mm->context.skas.ldt;
283 struct mm_id * mm_idp = &current->mm->context.skas.id;
284 int i, err;
285 struct user_desc ldt_info;
286 struct ldt_entry entry0, *ldt_p;
287 void *addr = NULL;
288
289 err = -EINVAL;
290 if(bytecount != sizeof(ldt_info))
291 goto out;
292 err = -EFAULT;
293 if(copy_from_user(&ldt_info, ptr, sizeof(ldt_info)))
294 goto out;
295
296 err = -EINVAL;
297 if(ldt_info.entry_number >= LDT_ENTRIES)
298 goto out;
299 if(ldt_info.contents == 3){
300 if (func == 1)
301 goto out;
302 if (ldt_info.seg_not_present == 0)
303 goto out;
304 }
305
306 if(!ptrace_ldt)
307 down(&ldt->semaphore);
308
309 err = write_ldt_entry(mm_idp, func, &ldt_info, &addr, 1);
310 if(err)
311 goto out_unlock;
312 else if(ptrace_ldt) {
313 /* With PTRACE_LDT available, this is used as a flag only */
314 ldt->entry_count = 1;
315 goto out;
316 }
317
318 if(ldt_info.entry_number >= ldt->entry_count &&
319 ldt_info.entry_number >= LDT_DIRECT_ENTRIES){
320 for(i=ldt->entry_count/LDT_ENTRIES_PER_PAGE;
321 i*LDT_ENTRIES_PER_PAGE <= ldt_info.entry_number;
322 i++){
323 if(i == 0)
324 memcpy(&entry0, ldt->entries, sizeof(entry0));
325 ldt->pages[i] = (struct ldt_entry *)
326 __get_free_page(GFP_KERNEL|__GFP_ZERO);
327 if(!ldt->pages[i]){
328 err = -ENOMEM;
329 /* Undo the change in host */
330 memset(&ldt_info, 0, sizeof(ldt_info));
331 write_ldt_entry(mm_idp, 1, &ldt_info, &addr, 1);
332 goto out_unlock;
333 }
334 if(i == 0) {
335 memcpy(ldt->pages[0], &entry0, sizeof(entry0));
336 memcpy(ldt->pages[0]+1, ldt->entries+1,
337 sizeof(entry0)*(LDT_DIRECT_ENTRIES-1));
338 }
339 ldt->entry_count = (i + 1) * LDT_ENTRIES_PER_PAGE;
340 }
341 }
342 if(ldt->entry_count <= ldt_info.entry_number)
343 ldt->entry_count = ldt_info.entry_number + 1;
344
345 if(ldt->entry_count <= LDT_DIRECT_ENTRIES)
346 ldt_p = ldt->entries + ldt_info.entry_number;
347 else
348 ldt_p = ldt->pages[ldt_info.entry_number/LDT_ENTRIES_PER_PAGE] +
349 ldt_info.entry_number%LDT_ENTRIES_PER_PAGE;
350
351 if(ldt_info.base_addr == 0 && ldt_info.limit == 0 &&
352 (func == 1 || LDT_empty(&ldt_info))){
353 ldt_p->a = 0;
354 ldt_p->b = 0;
355 }
356 else{
357 if (func == 1)
358 ldt_info.useable = 0;
359 ldt_p->a = LDT_entry_a(&ldt_info);
360 ldt_p->b = LDT_entry_b(&ldt_info);
361 }
362 err = 0;
363
364out_unlock:
365 up(&ldt->semaphore);
366out:
367 return err;
368}
369
370static long do_modify_ldt_skas(int func, void __user *ptr,
371 unsigned long bytecount)
372{
373 int ret = -ENOSYS;
374
375 switch (func) {
376 case 0:
377 ret = read_ldt(ptr, bytecount);
378 break;
379 case 1:
380 case 0x11:
381 ret = write_ldt(ptr, bytecount, func);
382 break;
383 case 2:
384 ret = read_default_ldt(ptr, bytecount);
385 break;
386 }
387 return ret;
388}
389
390short dummy_list[9] = {0, -1};
391short * host_ldt_entries = NULL;
392
393void ldt_get_host_info(void)
394{
395 long ret;
396 struct ldt_entry * ldt;
397 int i, size, k, order;
398
399 host_ldt_entries = dummy_list+1;
400
401 for(i = LDT_PAGES_MAX-1, order=0; i; i>>=1, order++);
402
403 ldt = (struct ldt_entry *)
404 __get_free_pages(GFP_KERNEL|__GFP_ZERO, order);
405 if(ldt == NULL) {
406 printk("ldt_get_host_info: couldn't allocate buffer for host ldt\n");
407 return;
408 }
409
410 ret = modify_ldt(0, ldt, (1<<order)*PAGE_SIZE);
411 if(ret < 0) {
412 printk("ldt_get_host_info: couldn't read host ldt\n");
413 goto out_free;
414 }
415 if(ret == 0) {
416 /* default_ldt is active, simply write an empty entry 0 */
417 host_ldt_entries = dummy_list;
418 goto out_free;
419 }
420
421 for(i=0, size=0; i<ret/LDT_ENTRY_SIZE; i++){
422 if(ldt[i].a != 0 || ldt[i].b != 0)
423 size++;
424 }
425
426 if(size < sizeof(dummy_list)/sizeof(dummy_list[0])) {
427 host_ldt_entries = dummy_list;
428 }
429 else {
430 size = (size + 1) * sizeof(dummy_list[0]);
431 host_ldt_entries = (short *)kmalloc(size, GFP_KERNEL);
432 if(host_ldt_entries == NULL) {
433 printk("ldt_get_host_info: couldn't allocate host ldt list\n");
434 goto out_free;
435 }
436 }
437
438 for(i=0, k=0; i<ret/LDT_ENTRY_SIZE; i++){
439 if(ldt[i].a != 0 || ldt[i].b != 0) {
440 host_ldt_entries[k++] = i;
441 }
442 }
443 host_ldt_entries[k] = -1;
444
445out_free:
446 free_pages((unsigned long)ldt, order);
447}
448
449long init_new_ldt(struct mmu_context_skas * new_mm,
450 struct mmu_context_skas * from_mm)
451{
452 struct user_desc desc;
453 short * num_p;
454 int i;
455 long page, err=0;
456 void *addr = NULL;
457
458 memset(&desc, 0, sizeof(desc));
459
460 if(!ptrace_ldt)
461 init_MUTEX(&new_mm->ldt.semaphore);
462
463 if(!from_mm){
464 /*
465 * We have to initialize a clean ldt.
466 */
467 if(proc_mm) {
468 /*
469 * If the new mm was created using proc_mm, host's
470 * default-ldt currently is assigned, which normally
471 * contains the call-gates for lcall7 and lcall27.
472 * To remove these gates, we simply write an empty
473 * entry as number 0 to the host.
474 */
475 err = write_ldt_entry(&new_mm->id, 1, &desc,
476 &addr, 1);
477 }
478 else{
479 /*
480 * Now we try to retrieve info about the ldt, we
481 * inherited from the host. All ldt-entries found
482 * will be reset in the following loop
483 */
484 if(host_ldt_entries == NULL)
485 ldt_get_host_info();
486 for(num_p=host_ldt_entries; *num_p != -1; num_p++){
487 desc.entry_number = *num_p;
488 err = write_ldt_entry(&new_mm->id, 1, &desc,
489 &addr, *(num_p + 1) == -1);
490 if(err)
491 break;
492 }
493 }
494 new_mm->ldt.entry_count = 0;
495 }
496 else if (!ptrace_ldt) {
497 /* Our local LDT is used to supply the data for
498 * modify_ldt(READLDT), if PTRACE_LDT isn't available,
499 * i.e., we have to use the stub for modify_ldt, which
500 * can't handle the big read buffer of up to 64kB.
501 */
502 down(&from_mm->ldt.semaphore);
503 if(from_mm->ldt.entry_count <= LDT_DIRECT_ENTRIES){
504 memcpy(new_mm->ldt.entries, from_mm->ldt.entries,
505 sizeof(new_mm->ldt.entries));
506 }
507 else{
508 i = from_mm->ldt.entry_count / LDT_ENTRIES_PER_PAGE;
509 while(i-->0){
510 page = __get_free_page(GFP_KERNEL|__GFP_ZERO);
511 if (!page){
512 err = -ENOMEM;
513 break;
514 }
515 new_mm->ldt.pages[i] = (struct ldt_entry*)page;
516 memcpy(new_mm->ldt.pages[i],
517 from_mm->ldt.pages[i], PAGE_SIZE);
518 }
519 }
520 new_mm->ldt.entry_count = from_mm->ldt.entry_count;
521 up(&from_mm->ldt.semaphore);
522 }
523
524 return err;
525}
526
527
528void free_ldt(struct mmu_context_skas * mm)
529{
530 int i;
531
532 if(!ptrace_ldt && mm->ldt.entry_count > LDT_DIRECT_ENTRIES){
533 i = mm->ldt.entry_count / LDT_ENTRIES_PER_PAGE;
534 while(i-- > 0){
535 free_page((long )mm->ldt.pages[i]);
536 }
537 }
538 mm->ldt.entry_count = 0;
539}
540#endif
541
542int sys_modify_ldt(int func, void __user *ptr, unsigned long bytecount)
543{
544 return(CHOOSE_MODE_PROC(do_modify_ldt_tt, do_modify_ldt_skas, func,
545 ptr, bytecount));
546}
diff --git a/arch/um/sys-x86_64/Makefile b/arch/um/sys-x86_64/Makefile
index 06c3633457a2..ea977df395a1 100644
--- a/arch/um/sys-x86_64/Makefile
+++ b/arch/um/sys-x86_64/Makefile
@@ -5,7 +5,7 @@
5# 5#
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 ldt.o mem.o memcpy.o \
9 ptrace.o ptrace_user.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
@@ -14,7 +14,7 @@ obj-$(CONFIG_MODULES) += module.o um_module.o
14 14
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 ldt.c memcpy.S \
18 thunk.S module.c 18 thunk.S module.c
19 19
20include arch/um/scripts/Makefile.rules 20include arch/um/scripts/Makefile.rules
@@ -23,6 +23,7 @@ bitops.c-dir = lib
23csum-copy.S-dir = lib 23csum-copy.S-dir = lib
24csum-partial.c-dir = lib 24csum-partial.c-dir = lib
25csum-wrappers.c-dir = lib 25csum-wrappers.c-dir = lib
26ldt.c-dir = /arch/um/sys-i386
26memcpy.S-dir = lib 27memcpy.S-dir = lib
27thunk.S-dir = lib 28thunk.S-dir = lib
28module.c-dir = kernel 29module.c-dir = kernel
diff --git a/arch/um/sys-x86_64/syscalls.c b/arch/um/sys-x86_64/syscalls.c
index 3259a4db4534..6acee5c4ada6 100644
--- a/arch/um/sys-x86_64/syscalls.c
+++ b/arch/um/sys-x86_64/syscalls.c
@@ -29,81 +29,6 @@ asmlinkage long sys_uname64(struct new_utsname __user * name)
29} 29}
30 30
31#ifdef CONFIG_MODE_TT 31#ifdef CONFIG_MODE_TT
32extern int modify_ldt(int func, void *ptr, unsigned long bytecount);
33
34long sys_modify_ldt_tt(int func, void *ptr, unsigned long bytecount)
35{
36 /* XXX This should check VERIFY_WRITE depending on func, check this
37 * in i386 as well.
38 */
39 if (!access_ok(VERIFY_READ, ptr, bytecount))
40 return -EFAULT;
41 return(modify_ldt(func, ptr, bytecount));
42}
43#endif
44
45#ifdef CONFIG_MODE_SKAS
46extern int userspace_pid[];
47
48#include "skas_ptrace.h"
49
50long sys_modify_ldt_skas(int func, void *ptr, unsigned long bytecount)
51{
52 struct ptrace_ldt ldt;
53 void *buf;
54 int res, n;
55
56 buf = kmalloc(bytecount, GFP_KERNEL);
57 if(buf == NULL)
58 return(-ENOMEM);
59
60 res = 0;
61
62 switch(func){
63 case 1:
64 case 0x11:
65 res = copy_from_user(buf, ptr, bytecount);
66 break;
67 }
68
69 if(res != 0){
70 res = -EFAULT;
71 goto out;
72 }
73
74 ldt = ((struct ptrace_ldt) { .func = func,
75 .ptr = buf,
76 .bytecount = bytecount });
77#warning Need to look up userspace_pid by cpu
78 res = ptrace(PTRACE_LDT, userspace_pid[0], 0, (unsigned long) &ldt);
79 if(res < 0)
80 goto out;
81
82 switch(func){
83 case 0:
84 case 2:
85 n = res;
86 res = copy_to_user(ptr, buf, n);
87 if(res != 0)
88 res = -EFAULT;
89 else
90 res = n;
91 break;
92 }
93
94 out:
95 kfree(buf);
96 return(res);
97}
98#endif
99
100long sys_modify_ldt(int func, void *ptr, unsigned long bytecount)
101{
102 return(CHOOSE_MODE_PROC(sys_modify_ldt_tt, sys_modify_ldt_skas, func,
103 ptr, bytecount));
104}
105
106#ifdef CONFIG_MODE_TT
107extern long arch_prctl(int code, unsigned long addr); 32extern long arch_prctl(int code, unsigned long addr);
108 33
109static long arch_prctl_tt(int code, unsigned long addr) 34static long arch_prctl_tt(int code, unsigned long addr)
diff --git a/arch/v850/kernel/process.c b/arch/v850/kernel/process.c
index 9c708c32c1f0..39cf247cdae4 100644
--- a/arch/v850/kernel/process.c
+++ b/arch/v850/kernel/process.c
@@ -36,11 +36,8 @@ extern void ret_from_fork (void);
36/* The idle loop. */ 36/* The idle loop. */
37void default_idle (void) 37void default_idle (void)
38{ 38{
39 while (1) { 39 while (! need_resched ())
40 while (! need_resched ()) 40 asm ("halt; nop; nop; nop; nop; nop" ::: "cc");
41 asm ("halt; nop; nop; nop; nop; nop" ::: "cc");
42 schedule ();
43 }
44} 41}
45 42
46void (*idle)(void) = default_idle; 43void (*idle)(void) = default_idle;
@@ -54,7 +51,14 @@ void (*idle)(void) = default_idle;
54void cpu_idle (void) 51void cpu_idle (void)
55{ 52{
56 /* endless idle loop with no priority at all */ 53 /* endless idle loop with no priority at all */
57 (*idle) (); 54 while (1) {
55 while (!need_resched())
56 (*idle) ();
57
58 preempt_enable_no_resched();
59 schedule();
60 preempt_disable();
61 }
58} 62}
59 63
60/* 64/*
diff --git a/arch/v850/kernel/ptrace.c b/arch/v850/kernel/ptrace.c
index d6077ff47d22..18492d02aaf6 100644
--- a/arch/v850/kernel/ptrace.c
+++ b/arch/v850/kernel/ptrace.c
@@ -113,45 +113,10 @@ static int set_single_step (struct task_struct *t, int val)
113 return 1; 113 return 1;
114} 114}
115 115
116long sys_ptrace(long request, long pid, long addr, long data) 116long arch_ptrace(struct task_struct *child, long request, long addr, long data)
117{ 117{
118 struct task_struct *child;
119 int rval; 118 int rval;
120 119
121 lock_kernel();
122
123 if (request == PTRACE_TRACEME) {
124 /* are we already being traced? */
125 if (current->ptrace & PT_PTRACED) {
126 rval = -EPERM;
127 goto out;
128 }
129 /* set the ptrace bit in the process flags. */
130 current->ptrace |= PT_PTRACED;
131 rval = 0;
132 goto out;
133 }
134 rval = -ESRCH;
135 read_lock(&tasklist_lock);
136 child = find_task_by_pid(pid);
137 if (child)
138 get_task_struct(child);
139 read_unlock(&tasklist_lock);
140 if (!child)
141 goto out;
142
143 rval = -EPERM;
144 if (pid == 1) /* you may not mess with init */
145 goto out_tsk;
146
147 if (request == PTRACE_ATTACH) {
148 rval = ptrace_attach(child);
149 goto out_tsk;
150 }
151 rval = ptrace_check_attach(child, request == PTRACE_KILL);
152 if (rval < 0)
153 goto out_tsk;
154
155 switch (request) { 120 switch (request) {
156 unsigned long val, copied; 121 unsigned long val, copied;
157 122
@@ -248,11 +213,7 @@ long sys_ptrace(long request, long pid, long addr, long data)
248 rval = -EIO; 213 rval = -EIO;
249 goto out; 214 goto out;
250 } 215 }
251 216 out:
252out_tsk:
253 put_task_struct(child);
254out:
255 unlock_kernel();
256 return rval; 217 return rval;
257} 218}
258 219
diff --git a/arch/x86_64/Kconfig b/arch/x86_64/Kconfig
index 21afa69a086d..4cce2f6f170c 100644
--- a/arch/x86_64/Kconfig
+++ b/arch/x86_64/Kconfig
@@ -532,8 +532,21 @@ source "drivers/firmware/Kconfig"
532 532
533source fs/Kconfig 533source fs/Kconfig
534 534
535menu "Instrumentation Support"
536 depends on EXPERIMENTAL
537
535source "arch/x86_64/oprofile/Kconfig" 538source "arch/x86_64/oprofile/Kconfig"
536 539
540config KPROBES
541 bool "Kprobes (EXPERIMENTAL)"
542 help
543 Kprobes allows you to trap at almost any kernel address and
544 execute a callback function. register_kprobe() establishes
545 a probepoint and specifies the callback. Kprobes is useful
546 for kernel debugging, non-intrusive instrumentation and testing.
547 If in doubt, say "N".
548endmenu
549
537source "arch/x86_64/Kconfig.debug" 550source "arch/x86_64/Kconfig.debug"
538 551
539source "security/Kconfig" 552source "security/Kconfig"
diff --git a/arch/x86_64/Kconfig.debug b/arch/x86_64/Kconfig.debug
index 9cf1410d2f5a..d584ecc27ea1 100644
--- a/arch/x86_64/Kconfig.debug
+++ b/arch/x86_64/Kconfig.debug
@@ -33,16 +33,6 @@ config IOMMU_DEBUG
33 options. See Documentation/x86_64/boot-options.txt for more 33 options. See Documentation/x86_64/boot-options.txt for more
34 details. 34 details.
35 35
36config KPROBES
37 bool "Kprobes"
38 depends on DEBUG_KERNEL
39 help
40 Kprobes allows you to trap at almost any kernel address and
41 execute a callback function. register_kprobe() establishes
42 a probepoint and specifies the callback. Kprobes is useful
43 for kernel debugging, non-intrusive instrumentation and testing.
44 If in doubt, say "N".
45
46config IOMMU_LEAK 36config IOMMU_LEAK
47 bool "IOMMU leak tracing" 37 bool "IOMMU leak tracing"
48 depends on DEBUG_KERNEL 38 depends on DEBUG_KERNEL
diff --git a/arch/x86_64/ia32/ia32_ioctl.c b/arch/x86_64/ia32/ia32_ioctl.c
index 4ba0e293d5e5..e335bd0b637d 100644
--- a/arch/x86_64/ia32/ia32_ioctl.c
+++ b/arch/x86_64/ia32/ia32_ioctl.c
@@ -64,12 +64,6 @@ struct ioctl_trans ioctl_start[] = {
64#include <linux/compat_ioctl.h> 64#include <linux/compat_ioctl.h>
65#define DECLARES 65#define DECLARES
66#include "compat_ioctl.c" 66#include "compat_ioctl.c"
67COMPATIBLE_IOCTL(HDIO_SET_KEEPSETTINGS)
68COMPATIBLE_IOCTL(HDIO_SCAN_HWIF)
69COMPATIBLE_IOCTL(BLKRASET)
70COMPATIBLE_IOCTL(0x4B50) /* KDGHWCLK - not in the kernel, but don't complain */
71COMPATIBLE_IOCTL(0x4B51) /* KDSHWCLK - not in the kernel, but don't complain */
72COMPATIBLE_IOCTL(FIOQSIZE)
73 67
74/* And these ioctls need translation */ 68/* And these ioctls need translation */
75/* realtime device */ 69/* realtime device */
diff --git a/arch/x86_64/kernel/Makefile b/arch/x86_64/kernel/Makefile
index bcdd0a805fe7..14328cab5d3a 100644
--- a/arch/x86_64/kernel/Makefile
+++ b/arch/x86_64/kernel/Makefile
@@ -27,7 +27,6 @@ obj-$(CONFIG_CPU_FREQ) += cpufreq/
27obj-$(CONFIG_EARLY_PRINTK) += early_printk.o 27obj-$(CONFIG_EARLY_PRINTK) += early_printk.o
28obj-$(CONFIG_GART_IOMMU) += pci-gart.o aperture.o 28obj-$(CONFIG_GART_IOMMU) += pci-gart.o aperture.o
29obj-$(CONFIG_DUMMY_IOMMU) += pci-nommu.o pci-dma.o 29obj-$(CONFIG_DUMMY_IOMMU) += pci-nommu.o pci-dma.o
30obj-$(CONFIG_SWIOTLB) += swiotlb.o
31obj-$(CONFIG_KPROBES) += kprobes.o 30obj-$(CONFIG_KPROBES) += kprobes.o
32obj-$(CONFIG_X86_PM_TIMER) += pmtimer.o 31obj-$(CONFIG_X86_PM_TIMER) += pmtimer.o
33 32
@@ -41,7 +40,6 @@ CFLAGS_vsyscall.o := $(PROFILING) -g0
41bootflag-y += ../../i386/kernel/bootflag.o 40bootflag-y += ../../i386/kernel/bootflag.o
42cpuid-$(subst m,y,$(CONFIG_X86_CPUID)) += ../../i386/kernel/cpuid.o 41cpuid-$(subst m,y,$(CONFIG_X86_CPUID)) += ../../i386/kernel/cpuid.o
43topology-y += ../../i386/mach-default/topology.o 42topology-y += ../../i386/mach-default/topology.o
44swiotlb-$(CONFIG_SWIOTLB) += ../../ia64/lib/swiotlb.o
45microcode-$(subst m,y,$(CONFIG_MICROCODE)) += ../../i386/kernel/microcode.o 43microcode-$(subst m,y,$(CONFIG_MICROCODE)) += ../../i386/kernel/microcode.o
46intel_cacheinfo-y += ../../i386/kernel/cpu/intel_cacheinfo.o 44intel_cacheinfo-y += ../../i386/kernel/cpu/intel_cacheinfo.o
47quirks-y += ../../i386/kernel/quirks.o 45quirks-y += ../../i386/kernel/quirks.o
diff --git a/arch/x86_64/kernel/kprobes.c b/arch/x86_64/kernel/kprobes.c
index 76a28b007be9..dddeb678b440 100644
--- a/arch/x86_64/kernel/kprobes.c
+++ b/arch/x86_64/kernel/kprobes.c
@@ -34,7 +34,6 @@
34#include <linux/config.h> 34#include <linux/config.h>
35#include <linux/kprobes.h> 35#include <linux/kprobes.h>
36#include <linux/ptrace.h> 36#include <linux/ptrace.h>
37#include <linux/spinlock.h>
38#include <linux/string.h> 37#include <linux/string.h>
39#include <linux/slab.h> 38#include <linux/slab.h>
40#include <linux/preempt.h> 39#include <linux/preempt.h>
@@ -44,17 +43,10 @@
44#include <asm/kdebug.h> 43#include <asm/kdebug.h>
45 44
46static DECLARE_MUTEX(kprobe_mutex); 45static DECLARE_MUTEX(kprobe_mutex);
47
48static struct kprobe *current_kprobe;
49static unsigned long kprobe_status, kprobe_old_rflags, kprobe_saved_rflags;
50static struct kprobe *kprobe_prev;
51static unsigned long kprobe_status_prev, kprobe_old_rflags_prev, kprobe_saved_rflags_prev;
52static struct pt_regs jprobe_saved_regs;
53static long *jprobe_saved_rsp;
54void jprobe_return_end(void); 46void jprobe_return_end(void);
55 47
56/* copy of the kernel stack at the probe fire time */ 48DEFINE_PER_CPU(struct kprobe *, current_kprobe) = NULL;
57static kprobe_opcode_t jprobes_stack[MAX_STACK_SIZE]; 49DEFINE_PER_CPU(struct kprobe_ctlblk, kprobe_ctlblk);
58 50
59/* 51/*
60 * returns non-zero if opcode modifies the interrupt flag. 52 * returns non-zero if opcode modifies the interrupt flag.
@@ -236,29 +228,30 @@ void __kprobes arch_remove_kprobe(struct kprobe *p)
236 up(&kprobe_mutex); 228 up(&kprobe_mutex);
237} 229}
238 230
239static inline void save_previous_kprobe(void) 231static inline void save_previous_kprobe(struct kprobe_ctlblk *kcb)
240{ 232{
241 kprobe_prev = current_kprobe; 233 kcb->prev_kprobe.kp = kprobe_running();
242 kprobe_status_prev = kprobe_status; 234 kcb->prev_kprobe.status = kcb->kprobe_status;
243 kprobe_old_rflags_prev = kprobe_old_rflags; 235 kcb->prev_kprobe.old_rflags = kcb->kprobe_old_rflags;
244 kprobe_saved_rflags_prev = kprobe_saved_rflags; 236 kcb->prev_kprobe.saved_rflags = kcb->kprobe_saved_rflags;
245} 237}
246 238
247static inline void restore_previous_kprobe(void) 239static inline void restore_previous_kprobe(struct kprobe_ctlblk *kcb)
248{ 240{
249 current_kprobe = kprobe_prev; 241 __get_cpu_var(current_kprobe) = kcb->prev_kprobe.kp;
250 kprobe_status = kprobe_status_prev; 242 kcb->kprobe_status = kcb->prev_kprobe.status;
251 kprobe_old_rflags = kprobe_old_rflags_prev; 243 kcb->kprobe_old_rflags = kcb->prev_kprobe.old_rflags;
252 kprobe_saved_rflags = kprobe_saved_rflags_prev; 244 kcb->kprobe_saved_rflags = kcb->prev_kprobe.saved_rflags;
253} 245}
254 246
255static inline void set_current_kprobe(struct kprobe *p, struct pt_regs *regs) 247static inline void set_current_kprobe(struct kprobe *p, struct pt_regs *regs,
248 struct kprobe_ctlblk *kcb)
256{ 249{
257 current_kprobe = p; 250 __get_cpu_var(current_kprobe) = p;
258 kprobe_saved_rflags = kprobe_old_rflags 251 kcb->kprobe_saved_rflags = kcb->kprobe_old_rflags
259 = (regs->eflags & (TF_MASK | IF_MASK)); 252 = (regs->eflags & (TF_MASK | IF_MASK));
260 if (is_IF_modifier(p->ainsn.insn)) 253 if (is_IF_modifier(p->ainsn.insn))
261 kprobe_saved_rflags &= ~IF_MASK; 254 kcb->kprobe_saved_rflags &= ~IF_MASK;
262} 255}
263 256
264static void __kprobes prepare_singlestep(struct kprobe *p, struct pt_regs *regs) 257static void __kprobes prepare_singlestep(struct kprobe *p, struct pt_regs *regs)
@@ -272,6 +265,7 @@ static void __kprobes prepare_singlestep(struct kprobe *p, struct pt_regs *regs)
272 regs->rip = (unsigned long)p->ainsn.insn; 265 regs->rip = (unsigned long)p->ainsn.insn;
273} 266}
274 267
268/* Called with kretprobe_lock held */
275void __kprobes arch_prepare_kretprobe(struct kretprobe *rp, 269void __kprobes arch_prepare_kretprobe(struct kretprobe *rp,
276 struct pt_regs *regs) 270 struct pt_regs *regs)
277{ 271{
@@ -292,32 +286,30 @@ void __kprobes arch_prepare_kretprobe(struct kretprobe *rp,
292 } 286 }
293} 287}
294 288
295/*
296 * Interrupts are disabled on entry as trap3 is an interrupt gate and they
297 * remain disabled thorough out this function.
298 */
299int __kprobes kprobe_handler(struct pt_regs *regs) 289int __kprobes kprobe_handler(struct pt_regs *regs)
300{ 290{
301 struct kprobe *p; 291 struct kprobe *p;
302 int ret = 0; 292 int ret = 0;
303 kprobe_opcode_t *addr = (kprobe_opcode_t *)(regs->rip - sizeof(kprobe_opcode_t)); 293 kprobe_opcode_t *addr = (kprobe_opcode_t *)(regs->rip - sizeof(kprobe_opcode_t));
294 struct kprobe_ctlblk *kcb;
304 295
305 /* We're in an interrupt, but this is clear and BUG()-safe. */ 296 /*
297 * We don't want to be preempted for the entire
298 * duration of kprobe processing
299 */
306 preempt_disable(); 300 preempt_disable();
301 kcb = get_kprobe_ctlblk();
307 302
308 /* Check we're not actually recursing */ 303 /* Check we're not actually recursing */
309 if (kprobe_running()) { 304 if (kprobe_running()) {
310 /* We *are* holding lock here, so this is safe.
311 Disarm the probe we just hit, and ignore it. */
312 p = get_kprobe(addr); 305 p = get_kprobe(addr);
313 if (p) { 306 if (p) {
314 if (kprobe_status == KPROBE_HIT_SS && 307 if (kcb->kprobe_status == KPROBE_HIT_SS &&
315 *p->ainsn.insn == BREAKPOINT_INSTRUCTION) { 308 *p->ainsn.insn == BREAKPOINT_INSTRUCTION) {
316 regs->eflags &= ~TF_MASK; 309 regs->eflags &= ~TF_MASK;
317 regs->eflags |= kprobe_saved_rflags; 310 regs->eflags |= kcb->kprobe_saved_rflags;
318 unlock_kprobes();
319 goto no_kprobe; 311 goto no_kprobe;
320 } else if (kprobe_status == KPROBE_HIT_SSDONE) { 312 } else if (kcb->kprobe_status == KPROBE_HIT_SSDONE) {
321 /* TODO: Provide re-entrancy from 313 /* TODO: Provide re-entrancy from
322 * post_kprobes_handler() and avoid exception 314 * post_kprobes_handler() and avoid exception
323 * stack corruption while single-stepping on 315 * stack corruption while single-stepping on
@@ -325,6 +317,7 @@ int __kprobes kprobe_handler(struct pt_regs *regs)
325 */ 317 */
326 arch_disarm_kprobe(p); 318 arch_disarm_kprobe(p);
327 regs->rip = (unsigned long)p->addr; 319 regs->rip = (unsigned long)p->addr;
320 reset_current_kprobe();
328 ret = 1; 321 ret = 1;
329 } else { 322 } else {
330 /* We have reentered the kprobe_handler(), since 323 /* We have reentered the kprobe_handler(), since
@@ -334,27 +327,24 @@ int __kprobes kprobe_handler(struct pt_regs *regs)
334 * of the new probe without calling any user 327 * of the new probe without calling any user
335 * handlers. 328 * handlers.
336 */ 329 */
337 save_previous_kprobe(); 330 save_previous_kprobe(kcb);
338 set_current_kprobe(p, regs); 331 set_current_kprobe(p, regs, kcb);
339 p->nmissed++; 332 p->nmissed++;
340 prepare_singlestep(p, regs); 333 prepare_singlestep(p, regs);
341 kprobe_status = KPROBE_REENTER; 334 kcb->kprobe_status = KPROBE_REENTER;
342 return 1; 335 return 1;
343 } 336 }
344 } else { 337 } else {
345 p = current_kprobe; 338 p = __get_cpu_var(current_kprobe);
346 if (p->break_handler && p->break_handler(p, regs)) { 339 if (p->break_handler && p->break_handler(p, regs)) {
347 goto ss_probe; 340 goto ss_probe;
348 } 341 }
349 } 342 }
350 /* If it's not ours, can't be delete race, (we hold lock). */
351 goto no_kprobe; 343 goto no_kprobe;
352 } 344 }
353 345
354 lock_kprobes();
355 p = get_kprobe(addr); 346 p = get_kprobe(addr);
356 if (!p) { 347 if (!p) {
357 unlock_kprobes();
358 if (*addr != BREAKPOINT_INSTRUCTION) { 348 if (*addr != BREAKPOINT_INSTRUCTION) {
359 /* 349 /*
360 * The breakpoint instruction was removed right 350 * The breakpoint instruction was removed right
@@ -372,8 +362,8 @@ int __kprobes kprobe_handler(struct pt_regs *regs)
372 goto no_kprobe; 362 goto no_kprobe;
373 } 363 }
374 364
375 kprobe_status = KPROBE_HIT_ACTIVE; 365 set_current_kprobe(p, regs, kcb);
376 set_current_kprobe(p, regs); 366 kcb->kprobe_status = KPROBE_HIT_ACTIVE;
377 367
378 if (p->pre_handler && p->pre_handler(p, regs)) 368 if (p->pre_handler && p->pre_handler(p, regs))
379 /* handler has already set things up, so skip ss setup */ 369 /* handler has already set things up, so skip ss setup */
@@ -381,7 +371,7 @@ int __kprobes kprobe_handler(struct pt_regs *regs)
381 371
382ss_probe: 372ss_probe:
383 prepare_singlestep(p, regs); 373 prepare_singlestep(p, regs);
384 kprobe_status = KPROBE_HIT_SS; 374 kcb->kprobe_status = KPROBE_HIT_SS;
385 return 1; 375 return 1;
386 376
387no_kprobe: 377no_kprobe:
@@ -409,9 +399,10 @@ int __kprobes trampoline_probe_handler(struct kprobe *p, struct pt_regs *regs)
409 struct kretprobe_instance *ri = NULL; 399 struct kretprobe_instance *ri = NULL;
410 struct hlist_head *head; 400 struct hlist_head *head;
411 struct hlist_node *node, *tmp; 401 struct hlist_node *node, *tmp;
412 unsigned long orig_ret_address = 0; 402 unsigned long flags, orig_ret_address = 0;
413 unsigned long trampoline_address =(unsigned long)&kretprobe_trampoline; 403 unsigned long trampoline_address =(unsigned long)&kretprobe_trampoline;
414 404
405 spin_lock_irqsave(&kretprobe_lock, flags);
415 head = kretprobe_inst_table_head(current); 406 head = kretprobe_inst_table_head(current);
416 407
417 /* 408 /*
@@ -450,13 +441,14 @@ int __kprobes trampoline_probe_handler(struct kprobe *p, struct pt_regs *regs)
450 BUG_ON(!orig_ret_address || (orig_ret_address == trampoline_address)); 441 BUG_ON(!orig_ret_address || (orig_ret_address == trampoline_address));
451 regs->rip = orig_ret_address; 442 regs->rip = orig_ret_address;
452 443
453 unlock_kprobes(); 444 reset_current_kprobe();
445 spin_unlock_irqrestore(&kretprobe_lock, flags);
454 preempt_enable_no_resched(); 446 preempt_enable_no_resched();
455 447
456 /* 448 /*
457 * By returning a non-zero value, we are telling 449 * By returning a non-zero value, we are telling
458 * kprobe_handler() that we have handled unlocking 450 * kprobe_handler() that we don't want the post_handler
459 * and re-enabling preemption. 451 * to run (and have re-enabled preemption)
460 */ 452 */
461 return 1; 453 return 1;
462} 454}
@@ -483,7 +475,8 @@ int __kprobes trampoline_probe_handler(struct kprobe *p, struct pt_regs *regs)
483 * that is atop the stack is the address following the copied instruction. 475 * that is atop the stack is the address following the copied instruction.
484 * We need to make it the address following the original instruction. 476 * We need to make it the address following the original instruction.
485 */ 477 */
486static void __kprobes resume_execution(struct kprobe *p, struct pt_regs *regs) 478static void __kprobes resume_execution(struct kprobe *p,
479 struct pt_regs *regs, struct kprobe_ctlblk *kcb)
487{ 480{
488 unsigned long *tos = (unsigned long *)regs->rsp; 481 unsigned long *tos = (unsigned long *)regs->rsp;
489 unsigned long next_rip = 0; 482 unsigned long next_rip = 0;
@@ -498,7 +491,7 @@ static void __kprobes resume_execution(struct kprobe *p, struct pt_regs *regs)
498 switch (*insn) { 491 switch (*insn) {
499 case 0x9c: /* pushfl */ 492 case 0x9c: /* pushfl */
500 *tos &= ~(TF_MASK | IF_MASK); 493 *tos &= ~(TF_MASK | IF_MASK);
501 *tos |= kprobe_old_rflags; 494 *tos |= kcb->kprobe_old_rflags;
502 break; 495 break;
503 case 0xc3: /* ret/lret */ 496 case 0xc3: /* ret/lret */
504 case 0xcb: 497 case 0xcb:
@@ -537,30 +530,28 @@ static void __kprobes resume_execution(struct kprobe *p, struct pt_regs *regs)
537 } 530 }
538} 531}
539 532
540/*
541 * Interrupts are disabled on entry as trap1 is an interrupt gate and they
542 * remain disabled thoroughout this function. And we hold kprobe lock.
543 */
544int __kprobes post_kprobe_handler(struct pt_regs *regs) 533int __kprobes post_kprobe_handler(struct pt_regs *regs)
545{ 534{
546 if (!kprobe_running()) 535 struct kprobe *cur = kprobe_running();
536 struct kprobe_ctlblk *kcb = get_kprobe_ctlblk();
537
538 if (!cur)
547 return 0; 539 return 0;
548 540
549 if ((kprobe_status != KPROBE_REENTER) && current_kprobe->post_handler) { 541 if ((kcb->kprobe_status != KPROBE_REENTER) && cur->post_handler) {
550 kprobe_status = KPROBE_HIT_SSDONE; 542 kcb->kprobe_status = KPROBE_HIT_SSDONE;
551 current_kprobe->post_handler(current_kprobe, regs, 0); 543 cur->post_handler(cur, regs, 0);
552 } 544 }
553 545
554 resume_execution(current_kprobe, regs); 546 resume_execution(cur, regs, kcb);
555 regs->eflags |= kprobe_saved_rflags; 547 regs->eflags |= kcb->kprobe_saved_rflags;
556 548
557 /* Restore the original saved kprobes variables and continue. */ 549 /* Restore the original saved kprobes variables and continue. */
558 if (kprobe_status == KPROBE_REENTER) { 550 if (kcb->kprobe_status == KPROBE_REENTER) {
559 restore_previous_kprobe(); 551 restore_previous_kprobe(kcb);
560 goto out; 552 goto out;
561 } else {
562 unlock_kprobes();
563 } 553 }
554 reset_current_kprobe();
564out: 555out:
565 preempt_enable_no_resched(); 556 preempt_enable_no_resched();
566 557
@@ -575,18 +566,19 @@ out:
575 return 1; 566 return 1;
576} 567}
577 568
578/* Interrupts disabled, kprobe_lock held. */
579int __kprobes kprobe_fault_handler(struct pt_regs *regs, int trapnr) 569int __kprobes kprobe_fault_handler(struct pt_regs *regs, int trapnr)
580{ 570{
581 if (current_kprobe->fault_handler 571 struct kprobe *cur = kprobe_running();
582 && current_kprobe->fault_handler(current_kprobe, regs, trapnr)) 572 struct kprobe_ctlblk *kcb = get_kprobe_ctlblk();
573
574 if (cur->fault_handler && cur->fault_handler(cur, regs, trapnr))
583 return 1; 575 return 1;
584 576
585 if (kprobe_status & KPROBE_HIT_SS) { 577 if (kcb->kprobe_status & KPROBE_HIT_SS) {
586 resume_execution(current_kprobe, regs); 578 resume_execution(cur, regs, kcb);
587 regs->eflags |= kprobe_old_rflags; 579 regs->eflags |= kcb->kprobe_old_rflags;
588 580
589 unlock_kprobes(); 581 reset_current_kprobe();
590 preempt_enable_no_resched(); 582 preempt_enable_no_resched();
591 } 583 }
592 return 0; 584 return 0;
@@ -599,39 +591,41 @@ int __kprobes kprobe_exceptions_notify(struct notifier_block *self,
599 unsigned long val, void *data) 591 unsigned long val, void *data)
600{ 592{
601 struct die_args *args = (struct die_args *)data; 593 struct die_args *args = (struct die_args *)data;
594 int ret = NOTIFY_DONE;
595
602 switch (val) { 596 switch (val) {
603 case DIE_INT3: 597 case DIE_INT3:
604 if (kprobe_handler(args->regs)) 598 if (kprobe_handler(args->regs))
605 return NOTIFY_STOP; 599 ret = NOTIFY_STOP;
606 break; 600 break;
607 case DIE_DEBUG: 601 case DIE_DEBUG:
608 if (post_kprobe_handler(args->regs)) 602 if (post_kprobe_handler(args->regs))
609 return NOTIFY_STOP; 603 ret = NOTIFY_STOP;
610 break; 604 break;
611 case DIE_GPF: 605 case DIE_GPF:
612 if (kprobe_running() &&
613 kprobe_fault_handler(args->regs, args->trapnr))
614 return NOTIFY_STOP;
615 break;
616 case DIE_PAGE_FAULT: 606 case DIE_PAGE_FAULT:
607 /* kprobe_running() needs smp_processor_id() */
608 preempt_disable();
617 if (kprobe_running() && 609 if (kprobe_running() &&
618 kprobe_fault_handler(args->regs, args->trapnr)) 610 kprobe_fault_handler(args->regs, args->trapnr))
619 return NOTIFY_STOP; 611 ret = NOTIFY_STOP;
612 preempt_enable();
620 break; 613 break;
621 default: 614 default:
622 break; 615 break;
623 } 616 }
624 return NOTIFY_DONE; 617 return ret;
625} 618}
626 619
627int __kprobes setjmp_pre_handler(struct kprobe *p, struct pt_regs *regs) 620int __kprobes setjmp_pre_handler(struct kprobe *p, struct pt_regs *regs)
628{ 621{
629 struct jprobe *jp = container_of(p, struct jprobe, kp); 622 struct jprobe *jp = container_of(p, struct jprobe, kp);
630 unsigned long addr; 623 unsigned long addr;
624 struct kprobe_ctlblk *kcb = get_kprobe_ctlblk();
631 625
632 jprobe_saved_regs = *regs; 626 kcb->jprobe_saved_regs = *regs;
633 jprobe_saved_rsp = (long *) regs->rsp; 627 kcb->jprobe_saved_rsp = (long *) regs->rsp;
634 addr = (unsigned long)jprobe_saved_rsp; 628 addr = (unsigned long)(kcb->jprobe_saved_rsp);
635 /* 629 /*
636 * As Linus pointed out, gcc assumes that the callee 630 * As Linus pointed out, gcc assumes that the callee
637 * owns the argument space and could overwrite it, e.g. 631 * owns the argument space and could overwrite it, e.g.
@@ -639,7 +633,8 @@ int __kprobes setjmp_pre_handler(struct kprobe *p, struct pt_regs *regs)
639 * we also save and restore enough stack bytes to cover 633 * we also save and restore enough stack bytes to cover
640 * the argument area. 634 * the argument area.
641 */ 635 */
642 memcpy(jprobes_stack, (kprobe_opcode_t *) addr, MIN_STACK_SIZE(addr)); 636 memcpy(kcb->jprobes_stack, (kprobe_opcode_t *)addr,
637 MIN_STACK_SIZE(addr));
643 regs->eflags &= ~IF_MASK; 638 regs->eflags &= ~IF_MASK;
644 regs->rip = (unsigned long)(jp->entry); 639 regs->rip = (unsigned long)(jp->entry);
645 return 1; 640 return 1;
@@ -647,36 +642,40 @@ int __kprobes setjmp_pre_handler(struct kprobe *p, struct pt_regs *regs)
647 642
648void __kprobes jprobe_return(void) 643void __kprobes jprobe_return(void)
649{ 644{
650 preempt_enable_no_resched(); 645 struct kprobe_ctlblk *kcb = get_kprobe_ctlblk();
646
651 asm volatile (" xchg %%rbx,%%rsp \n" 647 asm volatile (" xchg %%rbx,%%rsp \n"
652 " int3 \n" 648 " int3 \n"
653 " .globl jprobe_return_end \n" 649 " .globl jprobe_return_end \n"
654 " jprobe_return_end: \n" 650 " jprobe_return_end: \n"
655 " nop \n"::"b" 651 " nop \n"::"b"
656 (jprobe_saved_rsp):"memory"); 652 (kcb->jprobe_saved_rsp):"memory");
657} 653}
658 654
659int __kprobes longjmp_break_handler(struct kprobe *p, struct pt_regs *regs) 655int __kprobes longjmp_break_handler(struct kprobe *p, struct pt_regs *regs)
660{ 656{
657 struct kprobe_ctlblk *kcb = get_kprobe_ctlblk();
661 u8 *addr = (u8 *) (regs->rip - 1); 658 u8 *addr = (u8 *) (regs->rip - 1);
662 unsigned long stack_addr = (unsigned long)jprobe_saved_rsp; 659 unsigned long stack_addr = (unsigned long)(kcb->jprobe_saved_rsp);
663 struct jprobe *jp = container_of(p, struct jprobe, kp); 660 struct jprobe *jp = container_of(p, struct jprobe, kp);
664 661
665 if ((addr > (u8 *) jprobe_return) && (addr < (u8 *) jprobe_return_end)) { 662 if ((addr > (u8 *) jprobe_return) && (addr < (u8 *) jprobe_return_end)) {
666 if ((long *)regs->rsp != jprobe_saved_rsp) { 663 if ((long *)regs->rsp != kcb->jprobe_saved_rsp) {
667 struct pt_regs *saved_regs = 664 struct pt_regs *saved_regs =
668 container_of(jprobe_saved_rsp, struct pt_regs, rsp); 665 container_of(kcb->jprobe_saved_rsp,
666 struct pt_regs, rsp);
669 printk("current rsp %p does not match saved rsp %p\n", 667 printk("current rsp %p does not match saved rsp %p\n",
670 (long *)regs->rsp, jprobe_saved_rsp); 668 (long *)regs->rsp, kcb->jprobe_saved_rsp);
671 printk("Saved registers for jprobe %p\n", jp); 669 printk("Saved registers for jprobe %p\n", jp);
672 show_registers(saved_regs); 670 show_registers(saved_regs);
673 printk("Current registers\n"); 671 printk("Current registers\n");
674 show_registers(regs); 672 show_registers(regs);
675 BUG(); 673 BUG();
676 } 674 }
677 *regs = jprobe_saved_regs; 675 *regs = kcb->jprobe_saved_regs;
678 memcpy((kprobe_opcode_t *) stack_addr, jprobes_stack, 676 memcpy((kprobe_opcode_t *) stack_addr, kcb->jprobes_stack,
679 MIN_STACK_SIZE(stack_addr)); 677 MIN_STACK_SIZE(stack_addr));
678 preempt_enable_no_resched();
680 return 1; 679 return 1;
681 } 680 }
682 return 0; 681 return 0;
diff --git a/arch/x86_64/kernel/process.c b/arch/x86_64/kernel/process.c
index b5a89c0bdf59..59be85d9a4bc 100644
--- a/arch/x86_64/kernel/process.c
+++ b/arch/x86_64/kernel/process.c
@@ -86,12 +86,22 @@ EXPORT_SYMBOL(enable_hlt);
86 */ 86 */
87void default_idle(void) 87void default_idle(void)
88{ 88{
89 local_irq_enable();
90
89 if (!atomic_read(&hlt_counter)) { 91 if (!atomic_read(&hlt_counter)) {
90 local_irq_disable(); 92 clear_thread_flag(TIF_POLLING_NRFLAG);
91 if (!need_resched()) 93 smp_mb__after_clear_bit();
92 safe_halt(); 94 while (!need_resched()) {
93 else 95 local_irq_disable();
94 local_irq_enable(); 96 if (!need_resched())
97 safe_halt();
98 else
99 local_irq_enable();
100 }
101 set_thread_flag(TIF_POLLING_NRFLAG);
102 } else {
103 while (!need_resched())
104 cpu_relax();
95 } 105 }
96} 106}
97 107
@@ -102,30 +112,16 @@ void default_idle(void)
102 */ 112 */
103static void poll_idle (void) 113static void poll_idle (void)
104{ 114{
105 int oldval;
106
107 local_irq_enable(); 115 local_irq_enable();
108 116
109 /* 117 asm volatile(
110 * Deal with another CPU just having chosen a thread to 118 "2:"
111 * run here: 119 "testl %0,%1;"
112 */ 120 "rep; nop;"
113 oldval = test_and_clear_thread_flag(TIF_NEED_RESCHED); 121 "je 2b;"
114 122 : :
115 if (!oldval) { 123 "i" (_TIF_NEED_RESCHED),
116 set_thread_flag(TIF_POLLING_NRFLAG); 124 "m" (current_thread_info()->flags));
117 asm volatile(
118 "2:"
119 "testl %0,%1;"
120 "rep; nop;"
121 "je 2b;"
122 : :
123 "i" (_TIF_NEED_RESCHED),
124 "m" (current_thread_info()->flags));
125 clear_thread_flag(TIF_POLLING_NRFLAG);
126 } else {
127 set_need_resched();
128 }
129} 125}
130 126
131void cpu_idle_wait(void) 127void cpu_idle_wait(void)
@@ -187,6 +183,8 @@ static inline void play_dead(void)
187 */ 183 */
188void cpu_idle (void) 184void cpu_idle (void)
189{ 185{
186 set_thread_flag(TIF_POLLING_NRFLAG);
187
190 /* endless idle loop with no priority at all */ 188 /* endless idle loop with no priority at all */
191 while (1) { 189 while (1) {
192 while (!need_resched()) { 190 while (!need_resched()) {
@@ -204,7 +202,9 @@ void cpu_idle (void)
204 idle(); 202 idle();
205 } 203 }
206 204
205 preempt_enable_no_resched();
207 schedule(); 206 schedule();
207 preempt_disable();
208 } 208 }
209} 209}
210 210
@@ -219,15 +219,12 @@ static void mwait_idle(void)
219{ 219{
220 local_irq_enable(); 220 local_irq_enable();
221 221
222 if (!need_resched()) { 222 while (!need_resched()) {
223 set_thread_flag(TIF_POLLING_NRFLAG); 223 __monitor((void *)&current_thread_info()->flags, 0, 0);
224 do { 224 smp_mb();
225 __monitor((void *)&current_thread_info()->flags, 0, 0); 225 if (need_resched())
226 if (need_resched()) 226 break;
227 break; 227 __mwait(0, 0);
228 __mwait(0, 0);
229 } while (!need_resched());
230 clear_thread_flag(TIF_POLLING_NRFLAG);
231 } 228 }
232} 229}
233 230
diff --git a/arch/x86_64/kernel/ptrace.c b/arch/x86_64/kernel/ptrace.c
index bbf64b59a21e..a87b6cebe80f 100644
--- a/arch/x86_64/kernel/ptrace.c
+++ b/arch/x86_64/kernel/ptrace.c
@@ -313,48 +313,11 @@ static unsigned long getreg(struct task_struct *child, unsigned long regno)
313 313
314} 314}
315 315
316asmlinkage long sys_ptrace(long request, long pid, unsigned long addr, long data) 316long arch_ptrace(struct task_struct *child, long request, long addr, long data)
317{ 317{
318 struct task_struct *child;
319 long i, ret; 318 long i, ret;
320 unsigned ui; 319 unsigned ui;
321 320
322 /* This lock_kernel fixes a subtle race with suid exec */
323 lock_kernel();
324 ret = -EPERM;
325 if (request == PTRACE_TRACEME) {
326 /* are we already being traced? */
327 if (current->ptrace & PT_PTRACED)
328 goto out;
329 ret = security_ptrace(current->parent, current);
330 if (ret)
331 goto out;
332 /* set the ptrace bit in the process flags. */
333 current->ptrace |= PT_PTRACED;
334 ret = 0;
335 goto out;
336 }
337 ret = -ESRCH;
338 read_lock(&tasklist_lock);
339 child = find_task_by_pid(pid);
340 if (child)
341 get_task_struct(child);
342 read_unlock(&tasklist_lock);
343 if (!child)
344 goto out;
345
346 ret = -EPERM;
347 if (pid == 1) /* you may not mess with init */
348 goto out_tsk;
349
350 if (request == PTRACE_ATTACH) {
351 ret = ptrace_attach(child);
352 goto out_tsk;
353 }
354 ret = ptrace_check_attach(child, request == PTRACE_KILL);
355 if (ret < 0)
356 goto out_tsk;
357
358 switch (request) { 321 switch (request) {
359 /* when I and D space are separate, these will need to be fixed. */ 322 /* when I and D space are separate, these will need to be fixed. */
360 case PTRACE_PEEKTEXT: /* read word at location addr. */ 323 case PTRACE_PEEKTEXT: /* read word at location addr. */
@@ -608,10 +571,6 @@ asmlinkage long sys_ptrace(long request, long pid, unsigned long addr, long data
608 ret = ptrace_request(child, request, addr, data); 571 ret = ptrace_request(child, request, addr, data);
609 break; 572 break;
610 } 573 }
611out_tsk:
612 put_task_struct(child);
613out:
614 unlock_kernel();
615 return ret; 574 return ret;
616} 575}
617 576
diff --git a/arch/x86_64/kernel/smpboot.c b/arch/x86_64/kernel/smpboot.c
index 658a81b33f3b..c4e59bbdc187 100644
--- a/arch/x86_64/kernel/smpboot.c
+++ b/arch/x86_64/kernel/smpboot.c
@@ -65,8 +65,6 @@ int smp_num_siblings = 1;
65/* Package ID of each logical CPU */ 65/* Package ID of each logical CPU */
66u8 phys_proc_id[NR_CPUS] __read_mostly = { [0 ... NR_CPUS-1] = BAD_APICID }; 66u8 phys_proc_id[NR_CPUS] __read_mostly = { [0 ... NR_CPUS-1] = BAD_APICID };
67u8 cpu_core_id[NR_CPUS] __read_mostly = { [0 ... NR_CPUS-1] = BAD_APICID }; 67u8 cpu_core_id[NR_CPUS] __read_mostly = { [0 ... NR_CPUS-1] = BAD_APICID };
68EXPORT_SYMBOL(phys_proc_id);
69EXPORT_SYMBOL(cpu_core_id);
70 68
71/* Bitmask of currently online CPUs */ 69/* Bitmask of currently online CPUs */
72cpumask_t cpu_online_map __read_mostly; 70cpumask_t cpu_online_map __read_mostly;
@@ -474,6 +472,7 @@ void __cpuinit start_secondary(void)
474 * things done here to the most necessary things. 472 * things done here to the most necessary things.
475 */ 473 */
476 cpu_init(); 474 cpu_init();
475 preempt_disable();
477 smp_callin(); 476 smp_callin();
478 477
479 /* otherwise gcc will move up the smp_processor_id before the cpu_init */ 478 /* otherwise gcc will move up the smp_processor_id before the cpu_init */
diff --git a/arch/x86_64/lib/bitops.c b/arch/x86_64/lib/bitops.c
index a29fb75b33ac..95b6d9639fba 100644
--- a/arch/x86_64/lib/bitops.c
+++ b/arch/x86_64/lib/bitops.c
@@ -5,19 +5,23 @@
5#undef find_first_bit 5#undef find_first_bit
6#undef find_next_bit 6#undef find_next_bit
7 7
8/** 8static inline long
9 * find_first_zero_bit - find the first zero bit in a memory region 9__find_first_zero_bit(const unsigned long * addr, unsigned long size)
10 * @addr: The address to start the search at
11 * @size: The maximum size to search
12 *
13 * Returns the bit-number of the first zero bit, not the number of the byte
14 * containing a bit.
15 */
16inline long find_first_zero_bit(const unsigned long * addr, unsigned long size)
17{ 10{
18 long d0, d1, d2; 11 long d0, d1, d2;
19 long res; 12 long res;
20 13
14 /*
15 * We must test the size in words, not in bits, because
16 * otherwise incoming sizes in the range -63..-1 will not run
17 * any scasq instructions, and then the flags used by the je
18 * instruction will have whatever random value was in place
19 * before. Nobody should call us like that, but
20 * find_next_zero_bit() does when offset and size are at the
21 * same word and it fails to find a zero itself.
22 */
23 size += 63;
24 size >>= 6;
21 if (!size) 25 if (!size)
22 return 0; 26 return 0;
23 asm volatile( 27 asm volatile(
@@ -30,12 +34,30 @@ inline long find_first_zero_bit(const unsigned long * addr, unsigned long size)
30 " shlq $3,%%rdi\n" 34 " shlq $3,%%rdi\n"
31 " addq %%rdi,%%rdx" 35 " addq %%rdi,%%rdx"
32 :"=d" (res), "=&c" (d0), "=&D" (d1), "=&a" (d2) 36 :"=d" (res), "=&c" (d0), "=&D" (d1), "=&a" (d2)
33 :"0" (0ULL), "1" ((size + 63) >> 6), "2" (addr), "3" (-1ULL), 37 :"0" (0ULL), "1" (size), "2" (addr), "3" (-1ULL),
34 [addr] "r" (addr) : "memory"); 38 [addr] "S" (addr) : "memory");
39 /*
40 * Any register would do for [addr] above, but GCC tends to
41 * prefer rbx over rsi, even though rsi is readily available
42 * and doesn't have to be saved.
43 */
35 return res; 44 return res;
36} 45}
37 46
38/** 47/**
48 * find_first_zero_bit - find the first zero bit in a memory region
49 * @addr: The address to start the search at
50 * @size: The maximum size to search
51 *
52 * Returns the bit-number of the first zero bit, not the number of the byte
53 * containing a bit.
54 */
55long find_first_zero_bit(const unsigned long * addr, unsigned long size)
56{
57 return __find_first_zero_bit (addr, size);
58}
59
60/**
39 * find_next_zero_bit - find the first zero bit in a memory region 61 * find_next_zero_bit - find the first zero bit in a memory region
40 * @addr: The address to base the search on 62 * @addr: The address to base the search on
41 * @offset: The bitnumber to start searching at 63 * @offset: The bitnumber to start searching at
@@ -43,7 +65,7 @@ inline long find_first_zero_bit(const unsigned long * addr, unsigned long size)
43 */ 65 */
44long find_next_zero_bit (const unsigned long * addr, long size, long offset) 66long find_next_zero_bit (const unsigned long * addr, long size, long offset)
45{ 67{
46 unsigned long * p = ((unsigned long *) addr) + (offset >> 6); 68 const unsigned long * p = addr + (offset >> 6);
47 unsigned long set = 0; 69 unsigned long set = 0;
48 unsigned long res, bit = offset&63; 70 unsigned long res, bit = offset&63;
49 71
@@ -63,8 +85,8 @@ long find_next_zero_bit (const unsigned long * addr, long size, long offset)
63 /* 85 /*
64 * No zero yet, search remaining full words for a zero 86 * No zero yet, search remaining full words for a zero
65 */ 87 */
66 res = find_first_zero_bit ((const unsigned long *)p, 88 res = __find_first_zero_bit (p, size - 64 * (p - addr));
67 size - 64 * (p - (unsigned long *) addr)); 89
68 return (offset + set + res); 90 return (offset + set + res);
69} 91}
70 92
@@ -74,6 +96,19 @@ __find_first_bit(const unsigned long * addr, unsigned long size)
74 long d0, d1; 96 long d0, d1;
75 long res; 97 long res;
76 98
99 /*
100 * We must test the size in words, not in bits, because
101 * otherwise incoming sizes in the range -63..-1 will not run
102 * any scasq instructions, and then the flags used by the jz
103 * instruction will have whatever random value was in place
104 * before. Nobody should call us like that, but
105 * find_next_bit() does when offset and size are at the same
106 * word and it fails to find a one itself.
107 */
108 size += 63;
109 size >>= 6;
110 if (!size)
111 return 0;
77 asm volatile( 112 asm volatile(
78 " repe; scasq\n" 113 " repe; scasq\n"
79 " jz 1f\n" 114 " jz 1f\n"
@@ -83,8 +118,7 @@ __find_first_bit(const unsigned long * addr, unsigned long size)
83 " shlq $3,%%rdi\n" 118 " shlq $3,%%rdi\n"
84 " addq %%rdi,%%rax" 119 " addq %%rdi,%%rax"
85 :"=a" (res), "=&c" (d0), "=&D" (d1) 120 :"=a" (res), "=&c" (d0), "=&D" (d1)
86 :"0" (0ULL), 121 :"0" (0ULL), "1" (size), "2" (addr),
87 "1" ((size + 63) >> 6), "2" (addr),
88 [addr] "r" (addr) : "memory"); 122 [addr] "r" (addr) : "memory");
89 return res; 123 return res;
90} 124}
diff --git a/arch/x86_64/oprofile/Kconfig b/arch/x86_64/oprofile/Kconfig
index 5ade19801b97..d8a84088471a 100644
--- a/arch/x86_64/oprofile/Kconfig
+++ b/arch/x86_64/oprofile/Kconfig
@@ -1,7 +1,3 @@
1
2menu "Profiling support"
3 depends on EXPERIMENTAL
4
5config PROFILING 1config PROFILING
6 bool "Profiling support (EXPERIMENTAL)" 2 bool "Profiling support (EXPERIMENTAL)"
7 help 3 help
@@ -19,5 +15,3 @@ config OPROFILE
19 15
20 If unsure, say N. 16 If unsure, say N.
21 17
22endmenu
23
diff --git a/arch/xtensa/kernel/process.c b/arch/xtensa/kernel/process.c
index 08ef6d82ee51..6a44b54ae817 100644
--- a/arch/xtensa/kernel/process.c
+++ b/arch/xtensa/kernel/process.c
@@ -96,8 +96,9 @@ void cpu_idle(void)
96 while (1) { 96 while (1) {
97 while (!need_resched()) 97 while (!need_resched())
98 platform_idle(); 98 platform_idle();
99 preempt_enable(); 99 preempt_enable_no_resched();
100 schedule(); 100 schedule();
101 preempt_disable();
101 } 102 }
102} 103}
103 104
diff --git a/arch/xtensa/kernel/ptrace.c b/arch/xtensa/kernel/ptrace.c
index 14460743de07..ab5c4c65b5c4 100644
--- a/arch/xtensa/kernel/ptrace.c
+++ b/arch/xtensa/kernel/ptrace.c
@@ -45,58 +45,10 @@ void ptrace_disable(struct task_struct *child)
45 /* Nothing to do.. */ 45 /* Nothing to do.. */
46} 46}
47 47
48long sys_ptrace(long request, long pid, long addr, long data) 48long arch_ptrace(struct task_struct *child, long request, long addr, long data)
49{ 49{
50 struct task_struct *child;
51 int ret = -EPERM; 50 int ret = -EPERM;
52 51
53 lock_kernel();
54
55#if 0
56 if ((int)request != 1)
57 printk("ptrace(r=%d,pid=%d,addr=%08lx,data=%08lx)\n",
58 (int) request, (int) pid, (unsigned long) addr,
59 (unsigned long) data);
60#endif
61
62 if (request == PTRACE_TRACEME) {
63
64 /* Are we already being traced? */
65
66 if (current->ptrace & PT_PTRACED)
67 goto out;
68
69 if ((ret = security_ptrace(current->parent, current)))
70 goto out;
71
72 /* Set the ptrace bit in the process flags. */
73
74 current->ptrace |= PT_PTRACED;
75 ret = 0;
76 goto out;
77 }
78
79 ret = -ESRCH;
80 read_lock(&tasklist_lock);
81 child = find_task_by_pid(pid);
82 if (child)
83 get_task_struct(child);
84 read_unlock(&tasklist_lock);
85 if (!child)
86 goto out;
87
88 ret = -EPERM;
89 if (pid == 1) /* you may not mess with init */
90 goto out;
91
92 if (request == PTRACE_ATTACH) {
93 ret = ptrace_attach(child);
94 goto out_tsk;
95 }
96
97 if ((ret = ptrace_check_attach(child, request == PTRACE_KILL)) < 0)
98 goto out_tsk;
99
100 switch (request) { 52 switch (request) {
101 case PTRACE_PEEKTEXT: /* read word at location addr. */ 53 case PTRACE_PEEKTEXT: /* read word at location addr. */
102 case PTRACE_PEEKDATA: 54 case PTRACE_PEEKDATA:
@@ -375,10 +327,7 @@ long sys_ptrace(long request, long pid, long addr, long data)
375 ret = ptrace_request(child, request, addr, data); 327 ret = ptrace_request(child, request, addr, data);
376 goto out; 328 goto out;
377 } 329 }
378out_tsk: 330 out:
379 put_task_struct(child);
380out:
381 unlock_kernel();
382 return ret; 331 return ret;
383} 332}
384 333
diff --git a/arch/xtensa/platform-iss/network.c b/arch/xtensa/platform-iss/network.c
index 0682ffd38175..96b9bb4a478d 100644
--- a/arch/xtensa/platform-iss/network.c
+++ b/arch/xtensa/platform-iss/network.c
@@ -611,38 +611,6 @@ static int iss_net_change_mtu(struct net_device *dev, int new_mtu)
611 return -EINVAL; 611 return -EINVAL;
612} 612}
613 613
614static int iss_net_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd)
615{
616#if 0
617 static const struct ethtool_drvinfo info = {
618 .cmd = ETHTOOL_GDRVINFO,
619 .driver = DRIVER_NAME,
620 .version = "42",
621 };
622 void *useraddr;
623 u32 ethcmd;
624
625 switch (cmd) {
626 case SIOCETHTOOL:
627 useraddr = ifr->ifr_data;
628 if (copy_from_user(&ethcmd, useraddr, sizeof(ethcmd)))
629 return -EFAULT;
630
631 switch (ethcmd) {
632 case ETHTOOL_GDRVINFO:
633 if (copy_to_user(useraddr, &info, sizeof(info)))
634 return -EFAULT;
635 return 0;
636 default:
637 return -EOPNOTSUPP;
638 }
639 default:
640 return -EINVAL;
641 }
642#endif
643 return -EINVAL;
644}
645
646void iss_net_user_timer_expire(unsigned long _conn) 614void iss_net_user_timer_expire(unsigned long _conn)
647{ 615{
648} 616}
@@ -730,7 +698,6 @@ static int iss_net_configure(int index, char *init)
730 dev->tx_timeout = iss_net_tx_timeout; 698 dev->tx_timeout = iss_net_tx_timeout;
731 dev->set_mac_address = iss_net_set_mac; 699 dev->set_mac_address = iss_net_set_mac;
732 dev->change_mtu = iss_net_change_mtu; 700 dev->change_mtu = iss_net_change_mtu;
733 dev->do_ioctl = iss_net_ioctl;
734 dev->watchdog_timeo = (HZ >> 1); 701 dev->watchdog_timeo = (HZ >> 1);
735 dev->irq = -1; 702 dev->irq = -1;
736 703