aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
Diffstat (limited to 'arch')
-rw-r--r--arch/arm/Kconfig3
-rw-r--r--arch/arm/Makefile3
-rw-r--r--arch/arm/boot/compressed/head.S3
-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/entry-armv.S15
-rw-r--r--arch/arm/kernel/ptrace.c49
-rw-r--r--arch/arm/kernel/setup.c10
-rw-r--r--arch/arm/lib/bitops.h2
-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.c46
-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-pxa/Kconfig9
-rw-r--r--arch/arm/mach-pxa/Makefile1
-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/tosa.c162
-rw-r--r--arch/arm/mm/Kconfig12
-rw-r--r--arch/arm/mm/mm-armv.c8
-rw-r--r--arch/arm26/kernel/ptrace.c49
-rw-r--r--arch/cris/arch-v10/README.mm6
-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/kernel/ptrace.c51
-rw-r--r--arch/cris/arch-v32/kernel/signal.c2
-rw-r--r--arch/cris/mm/ioremap.c2
-rw-r--r--arch/frv/kernel/ptrace.c43
-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.c5
-rw-r--r--arch/i386/kernel/cpu/common.c5
-rw-r--r--arch/i386/kernel/cpu/cpufreq/speedstep-centrino.c2
-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/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/smpboot.c4
-rw-r--r--arch/i386/oprofile/Kconfig6
-rw-r--r--arch/i386/power/cpu.c1
-rw-r--r--arch/ia64/Kconfig13
-rw-r--r--arch/ia64/Kconfig.debug11
-rw-r--r--arch/ia64/hp/sim/simserial.c6
-rw-r--r--arch/ia64/kernel/kprobes.c126
-rw-r--r--arch/ia64/kernel/perfmon.c2
-rw-r--r--arch/ia64/kernel/setup.c7
-rw-r--r--arch/ia64/oprofile/Kconfig6
-rw-r--r--arch/m68k/atari/time.c6
-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/kernel/ptrace.c55
-rw-r--r--arch/parisc/kernel/ptrace.c50
-rw-r--r--arch/powerpc/Kconfig52
-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_defconfig1392
-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/ppc32.h138
-rw-r--r--arch/powerpc/kernel/ppc_ksyms.c9
-rw-r--r--arch/powerpc/kernel/process.c28
-rw-r--r--arch/powerpc/kernel/prom.c78
-rw-r--r--arch/powerpc/kernel/prom_init.c2
-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.c19
-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.c123
-rw-r--r--arch/powerpc/kernel/setup_32.c2
-rw-r--r--arch/powerpc/kernel/setup_64.c199
-rw-r--r--arch/powerpc/kernel/signal_32.c2
-rw-r--r--arch/powerpc/kernel/signal_64.c (renamed from arch/ppc64/kernel/signal.c)0
-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)61
-rw-r--r--arch/powerpc/kernel/time.c5
-rw-r--r--arch/powerpc/kernel/traps.c12
-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.c2
-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.c534
-rw-r--r--arch/powerpc/mm/hugetlbpage.c140
-rw-r--r--arch/powerpc/mm/init_64.c18
-rw-r--r--arch/powerpc/mm/mem.c56
-rw-r--r--arch/powerpc/mm/pgtable_64.c22
-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/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.c6
-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.c4
-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.c73
-rw-r--r--arch/powerpc/platforms/iseries/smp.c2
-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/pic.c8
-rw-r--r--arch/powerpc/platforms/powermac/setup.c3
-rw-r--r--arch/powerpc/platforms/pseries/Kconfig9
-rw-r--r--arch/powerpc/platforms/pseries/Makefile2
-rw-r--r--arch/powerpc/platforms/pseries/iommu.c5
-rw-r--r--arch/powerpc/platforms/pseries/lpar.c128
-rw-r--r--arch/powerpc/platforms/pseries/plpar_wrappers.h120
-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.c21
-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/mmio_nvram.c (renamed from arch/ppc64/kernel/bpa_nvram.c)60
-rw-r--r--arch/powerpc/sysdev/u3_iommu.c5
-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/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/irq.c2
-rw-r--r--arch/ppc/kernel/machine_kexec.c2
-rw-r--r--arch/ppc/kernel/ppc_ksyms.c5
-rw-r--r--arch/ppc/kernel/rio.c52
-rw-r--r--arch/ppc/kernel/traps.c8
-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/85xx/mpc85xx_ads_common.c10
-rw-r--r--arch/ppc/platforms/85xx/stx_gp3.c14
-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/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.c6
-rw-r--r--arch/ppc64/Kconfig18
-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/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.c1
-rw-r--r--arch/ppc64/kernel/pacaData.c4
-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.c94
-rw-r--r--arch/ppc64/kernel/prom_init.c4
-rw-r--r--arch/ppc64/kernel/scanlog.c3
-rw-r--r--arch/ppc64/kernel/sysfs.c1
-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/kernel/Makefile4
-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/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.c113
-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/ptrace.c44
-rw-r--r--arch/sh/kernel/setup.c26
-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/ptrace.c83
-rw-r--r--arch/sh64/kernel/syscalls.S2
-rw-r--r--arch/sparc64/Kconfig13
-rw-r--r--arch/sparc64/Kconfig.debug10
-rw-r--r--arch/sparc64/kernel/kprobes.c165
-rw-r--r--arch/sparc64/kernel/us2e_cpufreq.c7
-rw-r--r--arch/sparc64/kernel/us3_cpufreq.c7
-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.c38
-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/ptrace.c43
-rw-r--r--arch/x86_64/Kconfig13
-rw-r--r--arch/x86_64/Kconfig.debug10
-rw-r--r--arch/x86_64/kernel/kprobes.c183
-rw-r--r--arch/x86_64/kernel/ptrace.c43
-rw-r--r--arch/x86_64/kernel/smpboot.c2
-rw-r--r--arch/x86_64/oprofile/Kconfig6
-rw-r--r--arch/xtensa/kernel/ptrace.c55
343 files changed, 15163 insertions, 5961 deletions
diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index 6b12d71978de..296bc03d1cf1 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -704,8 +704,7 @@ source "drivers/acorn/block/Kconfig"
704 704
705if PCMCIA || ARCH_CLPS7500 || ARCH_IOP3XX || ARCH_IXP4XX \ 705if PCMCIA || ARCH_CLPS7500 || ARCH_IOP3XX || ARCH_IXP4XX \
706 || ARCH_L7200 || ARCH_LH7A40X || ARCH_PXA || ARCH_RPC \ 706 || ARCH_L7200 || ARCH_LH7A40X || ARCH_PXA || ARCH_RPC \
707 || ARCH_S3C2410 || ARCH_SA1100 || ARCH_SHARK || FOOTBRIDGE \ 707 || ARCH_S3C2410 || ARCH_SA1100 || ARCH_SHARK || FOOTBRIDGE
708 || MACH_MP1000
709source "drivers/ide/Kconfig" 708source "drivers/ide/Kconfig"
710endif 709endif
711 710
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/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/entry-armv.S b/arch/arm/kernel/entry-armv.S
index be439cab92c6..a511ec5b11a3 100644
--- a/arch/arm/kernel/entry-armv.S
+++ b/arch/arm/kernel/entry-armv.S
@@ -785,7 +785,7 @@ __kuser_helper_end:
785 * SP points to a minimal amount of processor-private memory, the address 785 * 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. 786 * of which is copied into r0 for the mode specific abort handler.
787 */ 787 */
788 .macro vector_stub, name, correction=0 788 .macro vector_stub, name, mode, correction=0
789 .align 5 789 .align 5
790 790
791vector_\name: 791vector_\name:
@@ -805,15 +805,14 @@ vector_\name:
805 @ Prepare for SVC32 mode. IRQs remain disabled. 805 @ Prepare for SVC32 mode. IRQs remain disabled.
806 @ 806 @
807 mrs r0, cpsr 807 mrs r0, cpsr
808 bic r0, r0, #MODE_MASK 808 eor r0, r0, #(\mode ^ SVC_MODE)
809 orr r0, r0, #SVC_MODE
810 msr spsr_cxsf, r0 809 msr spsr_cxsf, r0
811 810
812 @ 811 @
813 @ the branch table must immediately follow this code 812 @ the branch table must immediately follow this code
814 @ 813 @
815 mov r0, sp
816 and lr, lr, #0x0f 814 and lr, lr, #0x0f
815 mov r0, sp
817 ldr lr, [pc, lr, lsl #2] 816 ldr lr, [pc, lr, lsl #2]
818 movs pc, lr @ branch to handler in SVC mode 817 movs pc, lr @ branch to handler in SVC mode
819 .endm 818 .endm
@@ -823,7 +822,7 @@ __stubs_start:
823/* 822/*
824 * Interrupt dispatcher 823 * Interrupt dispatcher
825 */ 824 */
826 vector_stub irq, 4 825 vector_stub irq, IRQ_MODE, 4
827 826
828 .long __irq_usr @ 0 (USR_26 / USR_32) 827 .long __irq_usr @ 0 (USR_26 / USR_32)
829 .long __irq_invalid @ 1 (FIQ_26 / FIQ_32) 828 .long __irq_invalid @ 1 (FIQ_26 / FIQ_32)
@@ -846,7 +845,7 @@ __stubs_start:
846 * Data abort dispatcher 845 * Data abort dispatcher
847 * Enter in ABT mode, spsr = USR CPSR, lr = USR PC 846 * Enter in ABT mode, spsr = USR CPSR, lr = USR PC
848 */ 847 */
849 vector_stub dabt, 8 848 vector_stub dabt, ABT_MODE, 8
850 849
851 .long __dabt_usr @ 0 (USR_26 / USR_32) 850 .long __dabt_usr @ 0 (USR_26 / USR_32)
852 .long __dabt_invalid @ 1 (FIQ_26 / FIQ_32) 851 .long __dabt_invalid @ 1 (FIQ_26 / FIQ_32)
@@ -869,7 +868,7 @@ __stubs_start:
869 * Prefetch abort dispatcher 868 * Prefetch abort dispatcher
870 * Enter in ABT mode, spsr = USR CPSR, lr = USR PC 869 * Enter in ABT mode, spsr = USR CPSR, lr = USR PC
871 */ 870 */
872 vector_stub pabt, 4 871 vector_stub pabt, ABT_MODE, 4
873 872
874 .long __pabt_usr @ 0 (USR_26 / USR_32) 873 .long __pabt_usr @ 0 (USR_26 / USR_32)
875 .long __pabt_invalid @ 1 (FIQ_26 / FIQ_32) 874 .long __pabt_invalid @ 1 (FIQ_26 / FIQ_32)
@@ -892,7 +891,7 @@ __stubs_start:
892 * Undef instr entry dispatcher 891 * Undef instr entry dispatcher
893 * Enter in UND mode, spsr = SVC/USR CPSR, lr = SVC/USR PC 892 * Enter in UND mode, spsr = SVC/USR CPSR, lr = SVC/USR PC
894 */ 893 */
895 vector_stub und 894 vector_stub und, UND_MODE
896 895
897 .long __und_usr @ 0 (USR_26 / USR_32) 896 .long __und_usr @ 0 (USR_26 / USR_32)
898 .long __und_invalid @ 1 (FIQ_26 / FIQ_32) 897 .long __und_invalid @ 1 (FIQ_26 / FIQ_32)
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/lib/bitops.h b/arch/arm/lib/bitops.h
index 64a988c1ad44..f35d91fbe117 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
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..df140962bb0f 100644
--- a/arch/arm/mach-ixp2000/core.c
+++ b/arch/arm/mach-ixp2000/core.c
@@ -402,6 +402,40 @@ static void ixp2000_pci_irq_unmask(unsigned int irq)
402 ixp2000_reg_write(IXP2000_PCI_XSCALE_INT_ENABLE, (temp | (1 << 27))); 402 ixp2000_reg_write(IXP2000_PCI_XSCALE_INT_ENABLE, (temp | (1 << 27)));
403} 403}
404 404
405/*
406 * Error interrupts. These are used extensively by the microengine drivers
407 */
408static void ixp2000_err_irq_handler(unsigned int irq, struct irqdesc *desc, struct pt_regs *regs)
409{
410 int i;
411 unsigned long status = *IXP2000_IRQ_ERR_STATUS;
412
413 for(i = 31; i >= 0; i--) {
414 if(status & (1 << i)) {
415 desc = irq_desc + IRQ_IXP2000_DRAM0_MIN_ERR + i;
416 desc->handle(IRQ_IXP2000_DRAM0_MIN_ERR + i, desc, regs);
417 }
418 }
419}
420
421static void ixp2000_err_irq_mask(unsigned int irq)
422{
423 ixp2000_reg_write(IXP2000_IRQ_ERR_ENABLE_CLR,
424 (1 << (irq - IRQ_IXP2000_DRAM0_MIN_ERR)));
425}
426
427static void ixp2000_err_irq_unmask(unsigned int irq)
428{
429 ixp2000_reg_write(IXP2000_IRQ_ERR_ENABLE_SET,
430 (1 << (irq - IRQ_IXP2000_DRAM0_MIN_ERR)));
431}
432
433static struct irqchip ixp2000_err_irq_chip = {
434 .ack = ixp2000_err_irq_mask,
435 .mask = ixp2000_err_irq_mask,
436 .unmask = ixp2000_err_irq_unmask
437};
438
405static struct irqchip ixp2000_pci_irq_chip = { 439static struct irqchip ixp2000_pci_irq_chip = {
406 .ack = ixp2000_pci_irq_mask, 440 .ack = ixp2000_pci_irq_mask,
407 .mask = ixp2000_pci_irq_mask, 441 .mask = ixp2000_pci_irq_mask,
@@ -459,6 +493,18 @@ void __init ixp2000_init_irq(void)
459 } else set_irq_flags(irq, 0); 493 } else set_irq_flags(irq, 0);
460 } 494 }
461 495
496 for (irq = IRQ_IXP2000_DRAM0_MIN_ERR; irq <= IRQ_IXP2000_SP_INT; irq++) {
497 if((1 << (irq - IRQ_IXP2000_DRAM0_MIN_ERR)) &
498 IXP2000_VALID_ERR_IRQ_MASK) {
499 set_irq_chip(irq, &ixp2000_err_irq_chip);
500 set_irq_handler(irq, do_level_IRQ);
501 set_irq_flags(irq, IRQF_VALID);
502 }
503 else
504 set_irq_flags(irq, 0);
505 }
506 set_irq_chained_handler(IRQ_IXP2000_ERRSUM, ixp2000_err_irq_handler);
507
462 /* 508 /*
463 * GPIO IRQs are invalid until someone sets the interrupt mode 509 * GPIO IRQs are invalid until someone sets the interrupt mode
464 * by calling set_irq_type(). 510 * 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-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_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/tosa.c b/arch/arm/mach-pxa/tosa.c
new file mode 100644
index 000000000000..400609f8b6a8
--- /dev/null
+++ b/arch/arm/mach-pxa/tosa.c
@@ -0,0 +1,162 @@
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
101static struct scoop_pcmcia_dev tosa_pcmcia_scoop[] = {
102{
103 .dev = &tosascoop_device.dev,
104 .irq = TOSA_IRQ_GPIO_CF_IRQ,
105 .cd_irq = TOSA_IRQ_GPIO_CF_CD,
106 .cd_irq_str = "PCMCIA0 CD",
107},{
108 .dev = &tosascoop_jc_device.dev,
109 .irq = TOSA_IRQ_GPIO_JC_CF_IRQ,
110 .cd_irq = -1,
111},
112};
113
114
115static struct platform_device *devices[] __initdata = {
116 &tosascoop_device,
117 &tosascoop_jc_device,
118};
119
120static void __init tosa_init(void)
121{
122 pxa_gpio_mode(TOSA_GPIO_ON_RESET | GPIO_IN);
123 pxa_gpio_mode(TOSA_GPIO_TC6393_INT | GPIO_IN);
124
125 /* setup sleep mode values */
126 PWER = 0x00000002;
127 PFER = 0x00000000;
128 PRER = 0x00000002;
129 PGSR0 = 0x00000000;
130 PGSR1 = 0x00FF0002;
131 PGSR2 = 0x00014000;
132 PCFR |= PCFR_OPDE;
133
134 // enable batt_fault
135 PMCR = 0x01;
136
137 platform_add_devices(devices, ARRAY_SIZE(devices));
138
139 scoop_num = 2;
140 scoop_devs = &tosa_pcmcia_scoop[0];
141}
142
143static void __init fixup_tosa(struct machine_desc *desc,
144 struct tag *tags, char **cmdline, struct meminfo *mi)
145{
146 sharpsl_save_param();
147 mi->nr_banks=1;
148 mi->bank[0].start = 0xa0000000;
149 mi->bank[0].node = 0;
150 mi->bank[0].size = (64*1024*1024);
151}
152
153MACHINE_START(TOSA, "SHARP Tosa")
154 .phys_ram = 0xa0000000,
155 .phys_io = 0x40000000,
156 .io_pg_offst = (io_p2v(0x40000000) >> 18) & 0xfffc,
157 .fixup = fixup_tosa,
158 .map_io = pxa_map_io,
159 .init_irq = pxa_init_irq,
160 .init_machine = tosa_init,
161 .timer = &pxa_timer,
162MACHINE_END
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/mm-armv.c b/arch/arm/mm/mm-armv.c
index 1221fdde1769..fb5b40289de2 100644
--- a/arch/arm/mm/mm-armv.c
+++ b/arch/arm/mm/mm-armv.c
@@ -469,14 +469,14 @@ void __init create_mapping(struct map_desc *md)
469 469
470 if (md->virtual != vectors_base() && md->virtual < TASK_SIZE) { 470 if (md->virtual != vectors_base() && md->virtual < TASK_SIZE) {
471 printk(KERN_WARNING "BUG: not creating mapping for " 471 printk(KERN_WARNING "BUG: not creating mapping for "
472 "0x%016llx at 0x%08lx in user region\n", 472 "0x%08llx at 0x%08lx in user region\n",
473 __pfn_to_phys((u64)md->pfn), md->virtual); 473 __pfn_to_phys((u64)md->pfn), md->virtual);
474 return; 474 return;
475 } 475 }
476 476
477 if ((md->type == MT_DEVICE || md->type == MT_ROM) && 477 if ((md->type == MT_DEVICE || md->type == MT_ROM) &&
478 md->virtual >= PAGE_OFFSET && md->virtual < VMALLOC_END) { 478 md->virtual >= PAGE_OFFSET && md->virtual < VMALLOC_END) {
479 printk(KERN_WARNING "BUG: mapping for 0x%016llx at 0x%08lx " 479 printk(KERN_WARNING "BUG: mapping for 0x%08llx at 0x%08lx "
480 "overlaps vmalloc space\n", 480 "overlaps vmalloc space\n",
481 __pfn_to_phys((u64)md->pfn), md->virtual); 481 __pfn_to_phys((u64)md->pfn), md->virtual);
482 } 482 }
@@ -492,14 +492,14 @@ void __init create_mapping(struct map_desc *md)
492 if(md->pfn >= 0x100000) { 492 if(md->pfn >= 0x100000) {
493 if(domain) { 493 if(domain) {
494 printk(KERN_ERR "MM: invalid domain in supersection " 494 printk(KERN_ERR "MM: invalid domain in supersection "
495 "mapping for 0x%016llx at 0x%08lx\n", 495 "mapping for 0x%08llx at 0x%08lx\n",
496 __pfn_to_phys((u64)md->pfn), md->virtual); 496 __pfn_to_phys((u64)md->pfn), md->virtual);
497 return; 497 return;
498 } 498 }
499 if((md->virtual | md->length | __pfn_to_phys(md->pfn)) 499 if((md->virtual | md->length | __pfn_to_phys(md->pfn))
500 & ~SUPERSECTION_MASK) { 500 & ~SUPERSECTION_MASK) {
501 printk(KERN_ERR "MM: cannot create mapping for " 501 printk(KERN_ERR "MM: cannot create mapping for "
502 "0x%016llx at 0x%08lx invalid alignment\n", 502 "0x%08llx at 0x%08lx invalid alignment\n",
503 __pfn_to_phys((u64)md->pfn), md->virtual); 503 __pfn_to_phys((u64)md->pfn), md->virtual);
504 return; 504 return;
505 } 505 }
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/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/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/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/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/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..86e80c551478 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
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/speedstep-centrino.c b/arch/i386/kernel/cpu/cpufreq/speedstep-centrino.c
index 1465974256c9..0ea010a7afb1 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{
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/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/smpboot.c b/arch/i386/kernel/smpboot.c
index 01b618e73ecd..47ec76794d02 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);
@@ -612,7 +610,7 @@ static inline void __inquire_remote_apic(int apicid)
612 610
613 printk("Inquiring remote APIC #%d...\n", apicid); 611 printk("Inquiring remote APIC #%d...\n", apicid);
614 612
615 for (i = 0; i < sizeof(regs) / sizeof(*regs); i++) { 613 for (i = 0; i < ARRAY_SIZE(regs); i++) {
616 printk("... APIC #%d %s: ", apicid, names[i]); 614 printk("... APIC #%d %s: ", apicid, names[i]);
617 615
618 /* 616 /*
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 eb784046130d..d4de8a4814be 100644
--- a/arch/ia64/Kconfig
+++ b/arch/ia64/Kconfig
@@ -427,8 +427,21 @@ config GENERIC_PENDING_IRQ
427 427
428source "arch/ia64/hp/sim/Kconfig" 428source "arch/ia64/hp/sim/Kconfig"
429 429
430menu "Instrumentation Support"
431 depends on EXPERIMENTAL
432
430source "arch/ia64/oprofile/Kconfig" 433source "arch/ia64/oprofile/Kconfig"
431 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
432source "arch/ia64/Kconfig.debug" 445source "arch/ia64/Kconfig.debug"
433 446
434source "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/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/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/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/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/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/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/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/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/powerpc/Kconfig b/arch/powerpc/Kconfig
index 967ecf92d6a7..6ffae2d2b3fa 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
@@ -582,6 +603,16 @@ config NODES_SPAN_OTHER_NODES
582 def_bool y 603 def_bool y
583 depends on NEED_MULTIPLE_NODES 604 depends on NEED_MULTIPLE_NODES
584 605
606config PPC_64K_PAGES
607 bool "64k page size"
608 depends on PPC64
609 help
610 This option changes the kernel logical page size to 64k. On machines
611 without processor support for 64k pages, the kernel will simulate
612 them by loading each individual 4k page on demand transparently,
613 while on hardware with such support, it will be used to map
614 normal application pages.
615
585config SCHED_SMT 616config SCHED_SMT
586 bool "SMT (Hyperthreading) scheduler support" 617 bool "SMT (Hyperthreading) scheduler support"
587 depends on PPC64 && SMP 618 depends on PPC64 && SMP
@@ -886,8 +917,21 @@ source "arch/powerpc/platforms/iseries/Kconfig"
886 917
887source "lib/Kconfig" 918source "lib/Kconfig"
888 919
920menu "Instrumentation Support"
921 depends on EXPERIMENTAL
922
889source "arch/powerpc/oprofile/Kconfig" 923source "arch/powerpc/oprofile/Kconfig"
890 924
925config KPROBES
926 bool "Kprobes (EXPERIMENTAL)"
927 help
928 Kprobes allows you to trap at almost any kernel address and
929 execute a callback function. register_kprobe() establishes
930 a probepoint and specifies the callback. Kprobes is useful
931 for kernel debugging, non-intrusive instrumentation and testing.
932 If in doubt, say "N".
933endmenu
934
891source "arch/powerpc/Kconfig.debug" 935source "arch/powerpc/Kconfig.debug"
892 936
893source "security/Kconfig" 937source "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..6323065fbf2c
--- /dev/null
+++ b/arch/powerpc/configs/g5_defconfig
@@ -0,0 +1,1392 @@
1#
2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.14-rc4
4# Thu Oct 20 08:30:23 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
36CONFIG_HOTPLUG=y
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
44# CONFIG_KALLSYMS_ALL is not set
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
79CONFIG_PPC_PMAC=y
80# CONFIG_PPC_MAPLE is not set
81CONFIG_PPC=y
82CONFIG_PPC64=y
83CONFIG_PPC_OF=y
84CONFIG_MPIC=y
85CONFIG_ALTIVEC=y
86CONFIG_KEXEC=y
87CONFIG_U3_DART=y
88CONFIG_PPC_PMAC64=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
117# CONFIG_HOTPLUG_CPU 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
152CONFIG_XFRM_USER=m
153CONFIG_NET_KEY=m
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
164CONFIG_INET_AH=m
165CONFIG_INET_ESP=m
166CONFIG_INET_IPCOMP=m
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
177# CONFIG_IPV6 is not set
178CONFIG_NETFILTER=y
179# CONFIG_NETFILTER_DEBUG is not set
180# CONFIG_NETFILTER_NETLINK is not set
181
182#
183# IP: Netfilter Configuration
184#
185CONFIG_IP_NF_CONNTRACK=m
186CONFIG_IP_NF_CT_ACCT=y
187CONFIG_IP_NF_CONNTRACK_MARK=y
188CONFIG_IP_NF_CONNTRACK_EVENTS=y
189CONFIG_IP_NF_CT_PROTO_SCTP=m
190CONFIG_IP_NF_FTP=m
191CONFIG_IP_NF_IRC=m
192# CONFIG_IP_NF_NETBIOS_NS is not set
193CONFIG_IP_NF_TFTP=m
194CONFIG_IP_NF_AMANDA=m
195# CONFIG_IP_NF_PPTP is not set
196CONFIG_IP_NF_QUEUE=m
197CONFIG_IP_NF_IPTABLES=m
198CONFIG_IP_NF_MATCH_LIMIT=m
199CONFIG_IP_NF_MATCH_IPRANGE=m
200CONFIG_IP_NF_MATCH_MAC=m
201CONFIG_IP_NF_MATCH_PKTTYPE=m
202CONFIG_IP_NF_MATCH_MARK=m
203CONFIG_IP_NF_MATCH_MULTIPORT=m
204CONFIG_IP_NF_MATCH_TOS=m
205CONFIG_IP_NF_MATCH_RECENT=m
206CONFIG_IP_NF_MATCH_ECN=m
207CONFIG_IP_NF_MATCH_DSCP=m
208CONFIG_IP_NF_MATCH_AH_ESP=m
209CONFIG_IP_NF_MATCH_LENGTH=m
210CONFIG_IP_NF_MATCH_TTL=m
211CONFIG_IP_NF_MATCH_TCPMSS=m
212CONFIG_IP_NF_MATCH_HELPER=m
213CONFIG_IP_NF_MATCH_STATE=m
214CONFIG_IP_NF_MATCH_CONNTRACK=m
215CONFIG_IP_NF_MATCH_OWNER=m
216CONFIG_IP_NF_MATCH_ADDRTYPE=m
217CONFIG_IP_NF_MATCH_REALM=m
218CONFIG_IP_NF_MATCH_SCTP=m
219# CONFIG_IP_NF_MATCH_DCCP is not set
220CONFIG_IP_NF_MATCH_COMMENT=m
221CONFIG_IP_NF_MATCH_CONNMARK=m
222CONFIG_IP_NF_MATCH_CONNBYTES=m
223CONFIG_IP_NF_MATCH_HASHLIMIT=m
224CONFIG_IP_NF_MATCH_STRING=m
225CONFIG_IP_NF_FILTER=m
226CONFIG_IP_NF_TARGET_REJECT=m
227CONFIG_IP_NF_TARGET_LOG=m
228CONFIG_IP_NF_TARGET_ULOG=m
229CONFIG_IP_NF_TARGET_TCPMSS=m
230CONFIG_IP_NF_TARGET_NFQUEUE=m
231CONFIG_IP_NF_NAT=m
232CONFIG_IP_NF_NAT_NEEDED=y
233CONFIG_IP_NF_TARGET_MASQUERADE=m
234CONFIG_IP_NF_TARGET_REDIRECT=m
235CONFIG_IP_NF_TARGET_NETMAP=m
236CONFIG_IP_NF_TARGET_SAME=m
237CONFIG_IP_NF_NAT_SNMP_BASIC=m
238CONFIG_IP_NF_NAT_IRC=m
239CONFIG_IP_NF_NAT_FTP=m
240CONFIG_IP_NF_NAT_TFTP=m
241CONFIG_IP_NF_NAT_AMANDA=m
242CONFIG_IP_NF_MANGLE=m
243CONFIG_IP_NF_TARGET_TOS=m
244CONFIG_IP_NF_TARGET_ECN=m
245CONFIG_IP_NF_TARGET_DSCP=m
246CONFIG_IP_NF_TARGET_MARK=m
247CONFIG_IP_NF_TARGET_CLASSIFY=m
248CONFIG_IP_NF_TARGET_TTL=m
249CONFIG_IP_NF_TARGET_CONNMARK=m
250CONFIG_IP_NF_TARGET_CLUSTERIP=m
251CONFIG_IP_NF_RAW=m
252CONFIG_IP_NF_TARGET_NOTRACK=m
253CONFIG_IP_NF_ARPTABLES=m
254CONFIG_IP_NF_ARPFILTER=m
255CONFIG_IP_NF_ARP_MANGLE=m
256
257#
258# DCCP Configuration (EXPERIMENTAL)
259#
260# CONFIG_IP_DCCP is not set
261
262#
263# SCTP Configuration (EXPERIMENTAL)
264#
265# CONFIG_IP_SCTP is not set
266# CONFIG_ATM is not set
267# CONFIG_BRIDGE is not set
268# CONFIG_VLAN_8021Q is not set
269# CONFIG_DECNET is not set
270CONFIG_LLC=y
271# CONFIG_LLC2 is not set
272# CONFIG_IPX is not set
273# CONFIG_ATALK is not set
274# CONFIG_X25 is not set
275# CONFIG_LAPB is not set
276# CONFIG_NET_DIVERT is not set
277# CONFIG_ECONET is not set
278# CONFIG_WAN_ROUTER is not set
279# CONFIG_NET_SCHED is not set
280CONFIG_NET_CLS_ROUTE=y
281
282#
283# Network testing
284#
285# CONFIG_NET_PKTGEN is not set
286# CONFIG_HAMRADIO is not set
287# CONFIG_IRDA is not set
288# CONFIG_BT is not set
289# CONFIG_IEEE80211 is not set
290
291#
292# Device Drivers
293#
294
295#
296# Generic Driver Options
297#
298CONFIG_STANDALONE=y
299CONFIG_PREVENT_FIRMWARE_BUILD=y
300CONFIG_FW_LOADER=y
301# CONFIG_DEBUG_DRIVER is not set
302
303#
304# Connector - unified userspace <-> kernelspace linker
305#
306# CONFIG_CONNECTOR is not set
307
308#
309# Memory Technology Devices (MTD)
310#
311# CONFIG_MTD is not set
312
313#
314# Parallel port support
315#
316# CONFIG_PARPORT is not set
317
318#
319# Plug and Play support
320#
321
322#
323# Block devices
324#
325# CONFIG_BLK_DEV_FD is not set
326# CONFIG_BLK_CPQ_DA is not set
327# CONFIG_BLK_CPQ_CISS_DA is not set
328# CONFIG_BLK_DEV_DAC960 is not set
329# CONFIG_BLK_DEV_UMEM is not set
330# CONFIG_BLK_DEV_COW_COMMON is not set
331CONFIG_BLK_DEV_LOOP=y
332# CONFIG_BLK_DEV_CRYPTOLOOP is not set
333CONFIG_BLK_DEV_NBD=m
334# CONFIG_BLK_DEV_SX8 is not set
335# CONFIG_BLK_DEV_UB is not set
336CONFIG_BLK_DEV_RAM=y
337CONFIG_BLK_DEV_RAM_COUNT=16
338CONFIG_BLK_DEV_RAM_SIZE=65536
339CONFIG_BLK_DEV_INITRD=y
340CONFIG_CDROM_PKTCDVD=m
341CONFIG_CDROM_PKTCDVD_BUFFERS=8
342# CONFIG_CDROM_PKTCDVD_WCACHE is not set
343
344#
345# IO Schedulers
346#
347CONFIG_IOSCHED_NOOP=y
348CONFIG_IOSCHED_AS=y
349CONFIG_IOSCHED_DEADLINE=y
350CONFIG_IOSCHED_CFQ=y
351# CONFIG_ATA_OVER_ETH is not set
352
353#
354# ATA/ATAPI/MFM/RLL support
355#
356CONFIG_IDE=y
357CONFIG_BLK_DEV_IDE=y
358
359#
360# Please see Documentation/ide.txt for help/info on IDE drives
361#
362# CONFIG_BLK_DEV_IDE_SATA is not set
363CONFIG_BLK_DEV_IDEDISK=y
364# CONFIG_IDEDISK_MULTI_MODE is not set
365CONFIG_BLK_DEV_IDECD=y
366# CONFIG_BLK_DEV_IDETAPE is not set
367# CONFIG_BLK_DEV_IDEFLOPPY is not set
368# CONFIG_BLK_DEV_IDESCSI is not set
369# CONFIG_IDE_TASK_IOCTL is not set
370
371#
372# IDE chipset support/bugfixes
373#
374CONFIG_IDE_GENERIC=y
375CONFIG_BLK_DEV_IDEPCI=y
376# CONFIG_IDEPCI_SHARE_IRQ is not set
377# CONFIG_BLK_DEV_OFFBOARD is not set
378# CONFIG_BLK_DEV_GENERIC is not set
379# CONFIG_BLK_DEV_OPTI621 is not set
380# CONFIG_BLK_DEV_SL82C105 is not set
381CONFIG_BLK_DEV_IDEDMA_PCI=y
382# CONFIG_BLK_DEV_IDEDMA_FORCED is not set
383CONFIG_IDEDMA_PCI_AUTO=y
384# CONFIG_IDEDMA_ONLYDISK is not set
385# CONFIG_BLK_DEV_AEC62XX is not set
386# CONFIG_BLK_DEV_ALI15X3 is not set
387# CONFIG_BLK_DEV_AMD74XX is not set
388# CONFIG_BLK_DEV_CMD64X is not set
389# CONFIG_BLK_DEV_TRIFLEX is not set
390# CONFIG_BLK_DEV_CY82C693 is not set
391# CONFIG_BLK_DEV_CS5520 is not set
392# CONFIG_BLK_DEV_CS5530 is not set
393# CONFIG_BLK_DEV_HPT34X is not set
394# CONFIG_BLK_DEV_HPT366 is not set
395# CONFIG_BLK_DEV_SC1200 is not set
396# CONFIG_BLK_DEV_PIIX is not set
397# CONFIG_BLK_DEV_IT821X is not set
398# CONFIG_BLK_DEV_NS87415 is not set
399# CONFIG_BLK_DEV_PDC202XX_OLD is not set
400# CONFIG_BLK_DEV_PDC202XX_NEW is not set
401# CONFIG_BLK_DEV_SVWKS is not set
402# CONFIG_BLK_DEV_SIIMAGE is not set
403# CONFIG_BLK_DEV_SLC90E66 is not set
404# CONFIG_BLK_DEV_TRM290 is not set
405# CONFIG_BLK_DEV_VIA82CXXX is not set
406CONFIG_BLK_DEV_IDE_PMAC=y
407CONFIG_BLK_DEV_IDE_PMAC_ATA100FIRST=y
408CONFIG_BLK_DEV_IDEDMA_PMAC=y
409# CONFIG_BLK_DEV_IDE_PMAC_BLINK 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
420CONFIG_SCSI=y
421CONFIG_SCSI_PROC_FS=y
422
423#
424# SCSI support type (disk, tape, CD-ROM)
425#
426CONFIG_BLK_DEV_SD=y
427CONFIG_CHR_DEV_ST=y
428# CONFIG_CHR_DEV_OSST is not set
429CONFIG_BLK_DEV_SR=y
430CONFIG_BLK_DEV_SR_VENDOR=y
431CONFIG_CHR_DEV_SG=y
432# CONFIG_CHR_DEV_SCH is not set
433
434#
435# Some SCSI devices (e.g. CD jukebox) support multiple LUNs
436#
437CONFIG_SCSI_MULTI_LUN=y
438CONFIG_SCSI_CONSTANTS=y
439# CONFIG_SCSI_LOGGING is not set
440
441#
442# SCSI Transport Attributes
443#
444CONFIG_SCSI_SPI_ATTRS=y
445# CONFIG_SCSI_FC_ATTRS is not set
446# CONFIG_SCSI_ISCSI_ATTRS is not set
447# CONFIG_SCSI_SAS_ATTRS is not set
448
449#
450# SCSI low-level drivers
451#
452# CONFIG_BLK_DEV_3W_XXXX_RAID is not set
453# CONFIG_SCSI_3W_9XXX is not set
454# CONFIG_SCSI_ACARD is not set
455# CONFIG_SCSI_AACRAID is not set
456# CONFIG_SCSI_AIC7XXX is not set
457# CONFIG_SCSI_AIC7XXX_OLD is not set
458# CONFIG_SCSI_AIC79XX is not set
459# CONFIG_MEGARAID_NEWGEN is not set
460# CONFIG_MEGARAID_LEGACY is not set
461# CONFIG_MEGARAID_SAS is not set
462CONFIG_SCSI_SATA=y
463# CONFIG_SCSI_SATA_AHCI is not set
464CONFIG_SCSI_SATA_SVW=y
465# CONFIG_SCSI_ATA_PIIX is not set
466# CONFIG_SCSI_SATA_MV is not set
467# CONFIG_SCSI_SATA_NV is not set
468# CONFIG_SCSI_SATA_PROMISE is not set
469# CONFIG_SCSI_SATA_QSTOR is not set
470# CONFIG_SCSI_SATA_SX4 is not set
471# CONFIG_SCSI_SATA_SIL is not set
472# CONFIG_SCSI_SATA_SIS is not set
473# CONFIG_SCSI_SATA_ULI is not set
474# CONFIG_SCSI_SATA_VIA is not set
475# CONFIG_SCSI_SATA_VITESSE is not set
476# CONFIG_SCSI_BUSLOGIC is not set
477# CONFIG_SCSI_DMX3191D is not set
478# CONFIG_SCSI_EATA is not set
479# CONFIG_SCSI_FUTURE_DOMAIN is not set
480# CONFIG_SCSI_GDTH is not set
481# CONFIG_SCSI_IPS is not set
482# CONFIG_SCSI_INITIO is not set
483# CONFIG_SCSI_INIA100 is not set
484# CONFIG_SCSI_SYM53C8XX_2 is not set
485# CONFIG_SCSI_IPR is not set
486# CONFIG_SCSI_QLOGIC_FC is not set
487# CONFIG_SCSI_QLOGIC_1280 is not set
488CONFIG_SCSI_QLA2XXX=y
489# CONFIG_SCSI_QLA21XX is not set
490# CONFIG_SCSI_QLA22XX is not set
491# CONFIG_SCSI_QLA2300 is not set
492# CONFIG_SCSI_QLA2322 is not set
493# CONFIG_SCSI_QLA6312 is not set
494# CONFIG_SCSI_QLA24XX is not set
495# CONFIG_SCSI_LPFC is not set
496# CONFIG_SCSI_DC395x is not set
497# CONFIG_SCSI_DC390T is not set
498# CONFIG_SCSI_DEBUG is not set
499
500#
501# Multi-device support (RAID and LVM)
502#
503CONFIG_MD=y
504CONFIG_BLK_DEV_MD=y
505CONFIG_MD_LINEAR=y
506CONFIG_MD_RAID0=y
507CONFIG_MD_RAID1=y
508CONFIG_MD_RAID10=m
509CONFIG_MD_RAID5=y
510CONFIG_MD_RAID6=m
511CONFIG_MD_MULTIPATH=m
512CONFIG_MD_FAULTY=m
513CONFIG_BLK_DEV_DM=y
514CONFIG_DM_CRYPT=m
515CONFIG_DM_SNAPSHOT=m
516CONFIG_DM_MIRROR=m
517CONFIG_DM_ZERO=m
518# CONFIG_DM_MULTIPATH is not set
519
520#
521# Fusion MPT device support
522#
523# CONFIG_FUSION is not set
524# CONFIG_FUSION_SPI is not set
525# CONFIG_FUSION_FC is not set
526# CONFIG_FUSION_SAS is not set
527
528#
529# IEEE 1394 (FireWire) support
530#
531CONFIG_IEEE1394=y
532
533#
534# Subsystem Options
535#
536# CONFIG_IEEE1394_VERBOSEDEBUG is not set
537CONFIG_IEEE1394_OUI_DB=y
538CONFIG_IEEE1394_EXTRA_CONFIG_ROMS=y
539CONFIG_IEEE1394_CONFIG_ROM_IP1394=y
540# CONFIG_IEEE1394_EXPORT_FULL_API is not set
541
542#
543# Device Drivers
544#
545# CONFIG_IEEE1394_PCILYNX is not set
546CONFIG_IEEE1394_OHCI1394=y
547
548#
549# Protocol Drivers
550#
551CONFIG_IEEE1394_VIDEO1394=m
552CONFIG_IEEE1394_SBP2=m
553# CONFIG_IEEE1394_SBP2_PHYS_DMA is not set
554CONFIG_IEEE1394_ETH1394=m
555CONFIG_IEEE1394_DV1394=m
556CONFIG_IEEE1394_RAWIO=y
557# CONFIG_IEEE1394_CMP is not set
558
559#
560# I2O device support
561#
562# CONFIG_I2O is not set
563
564#
565# Macintosh device drivers
566#
567CONFIG_ADB_PMU=y
568CONFIG_PMAC_SMU=y
569CONFIG_THERM_PM72=y
570
571#
572# Network device support
573#
574CONFIG_NETDEVICES=y
575CONFIG_DUMMY=m
576CONFIG_BONDING=m
577# CONFIG_EQUALIZER is not set
578CONFIG_TUN=m
579
580#
581# ARCnet devices
582#
583# CONFIG_ARCNET is not set
584
585#
586# PHY device support
587#
588# CONFIG_PHYLIB is not set
589
590#
591# Ethernet (10 or 100Mbit)
592#
593CONFIG_NET_ETHERNET=y
594CONFIG_MII=y
595# CONFIG_HAPPYMEAL is not set
596CONFIG_SUNGEM=y
597# CONFIG_CASSINI is not set
598# CONFIG_NET_VENDOR_3COM is not set
599
600#
601# Tulip family network device support
602#
603# CONFIG_NET_TULIP is not set
604# CONFIG_HP100 is not set
605# CONFIG_NET_PCI is not set
606
607#
608# Ethernet (1000 Mbit)
609#
610CONFIG_ACENIC=y
611CONFIG_ACENIC_OMIT_TIGON_I=y
612# CONFIG_DL2K is not set
613CONFIG_E1000=y
614# CONFIG_E1000_NAPI is not set
615# CONFIG_NS83820 is not set
616# CONFIG_HAMACHI is not set
617# CONFIG_YELLOWFIN is not set
618# CONFIG_R8169 is not set
619# CONFIG_SIS190 is not set
620# CONFIG_SKGE is not set
621# CONFIG_SK98LIN is not set
622CONFIG_TIGON3=m
623# CONFIG_BNX2 is not set
624# CONFIG_MV643XX_ETH is not set
625
626#
627# Ethernet (10000 Mbit)
628#
629# CONFIG_CHELSIO_T1 is not set
630# CONFIG_IXGB is not set
631# CONFIG_S2IO is not set
632
633#
634# Token Ring devices
635#
636CONFIG_TR=y
637CONFIG_IBMOL=y
638# CONFIG_3C359 is not set
639# CONFIG_TMS380TR is not set
640
641#
642# Wireless LAN (non-hamradio)
643#
644# CONFIG_NET_RADIO is not set
645
646#
647# Wan interfaces
648#
649# CONFIG_WAN is not set
650# CONFIG_FDDI is not set
651# CONFIG_HIPPI is not set
652CONFIG_PPP=m
653# CONFIG_PPP_MULTILINK is not set
654# CONFIG_PPP_FILTER is not set
655CONFIG_PPP_ASYNC=m
656CONFIG_PPP_SYNC_TTY=m
657CONFIG_PPP_DEFLATE=m
658CONFIG_PPP_BSDCOMP=m
659CONFIG_PPPOE=m
660# CONFIG_SLIP is not set
661# CONFIG_NET_FC is not set
662# CONFIG_SHAPER is not set
663# CONFIG_NETCONSOLE is not set
664# CONFIG_NETPOLL is not set
665# CONFIG_NET_POLL_CONTROLLER is not set
666
667#
668# ISDN subsystem
669#
670# CONFIG_ISDN is not set
671
672#
673# Telephony Support
674#
675# CONFIG_PHONE is not set
676
677#
678# Input device support
679#
680CONFIG_INPUT=y
681
682#
683# Userland interfaces
684#
685CONFIG_INPUT_MOUSEDEV=y
686# CONFIG_INPUT_MOUSEDEV_PSAUX is not set
687CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024
688CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768
689CONFIG_INPUT_JOYDEV=m
690# CONFIG_INPUT_TSDEV is not set
691CONFIG_INPUT_EVDEV=y
692# CONFIG_INPUT_EVBUG is not set
693
694#
695# Input Device Drivers
696#
697CONFIG_INPUT_KEYBOARD=y
698# CONFIG_KEYBOARD_ATKBD is not set
699# CONFIG_KEYBOARD_SUNKBD is not set
700# CONFIG_KEYBOARD_LKKBD is not set
701# CONFIG_KEYBOARD_XTKBD is not set
702# CONFIG_KEYBOARD_NEWTON is not set
703CONFIG_INPUT_MOUSE=y
704# CONFIG_MOUSE_PS2 is not set
705# CONFIG_MOUSE_SERIAL is not set
706# CONFIG_MOUSE_VSXXXAA is not set
707# CONFIG_INPUT_JOYSTICK is not set
708# CONFIG_INPUT_TOUCHSCREEN is not set
709# CONFIG_INPUT_MISC is not set
710
711#
712# Hardware I/O ports
713#
714CONFIG_SERIO=y
715# CONFIG_SERIO_I8042 is not set
716# CONFIG_SERIO_SERPORT is not set
717# CONFIG_SERIO_PCIPS2 is not set
718# CONFIG_SERIO_RAW is not set
719# CONFIG_GAMEPORT is not set
720
721#
722# Character devices
723#
724CONFIG_VT=y
725CONFIG_VT_CONSOLE=y
726CONFIG_HW_CONSOLE=y
727# CONFIG_SERIAL_NONSTANDARD is not set
728
729#
730# Serial drivers
731#
732# CONFIG_SERIAL_8250 is not set
733
734#
735# Non-8250 serial port support
736#
737# CONFIG_SERIAL_PMACZILOG is not set
738# CONFIG_SERIAL_JSM is not set
739CONFIG_UNIX98_PTYS=y
740CONFIG_LEGACY_PTYS=y
741CONFIG_LEGACY_PTY_COUNT=256
742
743#
744# IPMI
745#
746# CONFIG_IPMI_HANDLER is not set
747
748#
749# Watchdog Cards
750#
751# CONFIG_WATCHDOG is not set
752# CONFIG_RTC is not set
753# CONFIG_DTLK is not set
754# CONFIG_R3964 is not set
755# CONFIG_APPLICOM is not set
756
757#
758# Ftape, the floppy tape device driver
759#
760CONFIG_AGP=m
761CONFIG_AGP_UNINORTH=m
762# CONFIG_DRM is not set
763CONFIG_RAW_DRIVER=y
764CONFIG_MAX_RAW_DEVS=256
765# CONFIG_HANGCHECK_TIMER is not set
766
767#
768# TPM devices
769#
770# CONFIG_TCG_TPM is not set
771
772#
773# I2C support
774#
775CONFIG_I2C=y
776CONFIG_I2C_CHARDEV=y
777
778#
779# I2C Algorithms
780#
781CONFIG_I2C_ALGOBIT=y
782# CONFIG_I2C_ALGOPCF is not set
783# CONFIG_I2C_ALGOPCA is not set
784
785#
786# I2C Hardware Bus support
787#
788# CONFIG_I2C_ALI1535 is not set
789# CONFIG_I2C_ALI1563 is not set
790# CONFIG_I2C_ALI15X3 is not set
791# CONFIG_I2C_AMD756 is not set
792# CONFIG_I2C_AMD8111 is not set
793# CONFIG_I2C_I801 is not set
794# CONFIG_I2C_I810 is not set
795# CONFIG_I2C_PIIX4 is not set
796CONFIG_I2C_KEYWEST=y
797CONFIG_I2C_PMAC_SMU=y
798# CONFIG_I2C_NFORCE2 is not set
799# CONFIG_I2C_PARPORT_LIGHT is not set
800# CONFIG_I2C_PROSAVAGE is not set
801# CONFIG_I2C_SAVAGE4 is not set
802# CONFIG_SCx200_ACB is not set
803# CONFIG_I2C_SIS5595 is not set
804# CONFIG_I2C_SIS630 is not set
805# CONFIG_I2C_SIS96X is not set
806# CONFIG_I2C_STUB is not set
807# CONFIG_I2C_VIA is not set
808# CONFIG_I2C_VIAPRO is not set
809# CONFIG_I2C_VOODOO3 is not set
810# CONFIG_I2C_PCA_ISA is not set
811
812#
813# Miscellaneous I2C Chip support
814#
815# CONFIG_SENSORS_DS1337 is not set
816# CONFIG_SENSORS_DS1374 is not set
817# CONFIG_SENSORS_EEPROM is not set
818# CONFIG_SENSORS_PCF8574 is not set
819# CONFIG_SENSORS_PCA9539 is not set
820# CONFIG_SENSORS_PCF8591 is not set
821# CONFIG_SENSORS_RTC8564 is not set
822# CONFIG_SENSORS_MAX6875 is not set
823# CONFIG_I2C_DEBUG_CORE is not set
824# CONFIG_I2C_DEBUG_ALGO is not set
825# CONFIG_I2C_DEBUG_BUS is not set
826# CONFIG_I2C_DEBUG_CHIP is not set
827
828#
829# Dallas's 1-wire bus
830#
831# CONFIG_W1 is not set
832
833#
834# Hardware Monitoring support
835#
836# CONFIG_HWMON is not set
837# CONFIG_HWMON_VID is not set
838
839#
840# Misc devices
841#
842
843#
844# Multimedia Capabilities Port drivers
845#
846
847#
848# Multimedia devices
849#
850# CONFIG_VIDEO_DEV is not set
851
852#
853# Digital Video Broadcasting Devices
854#
855# CONFIG_DVB is not set
856
857#
858# Graphics support
859#
860CONFIG_FB=y
861CONFIG_FB_CFB_FILLRECT=y
862CONFIG_FB_CFB_COPYAREA=y
863CONFIG_FB_CFB_IMAGEBLIT=y
864CONFIG_FB_SOFT_CURSOR=y
865CONFIG_FB_MACMODES=y
866CONFIG_FB_MODE_HELPERS=y
867CONFIG_FB_TILEBLITTING=y
868# CONFIG_FB_CIRRUS is not set
869# CONFIG_FB_PM2 is not set
870# CONFIG_FB_CYBER2000 is not set
871CONFIG_FB_OF=y
872# CONFIG_FB_CONTROL is not set
873# CONFIG_FB_PLATINUM is not set
874# CONFIG_FB_VALKYRIE is not set
875# CONFIG_FB_CT65550 is not set
876# CONFIG_FB_ASILIANT is not set
877# CONFIG_FB_IMSTT is not set
878# CONFIG_FB_VGA16 is not set
879# CONFIG_FB_NVIDIA is not set
880CONFIG_FB_RIVA=y
881# CONFIG_FB_RIVA_I2C is not set
882# CONFIG_FB_RIVA_DEBUG is not set
883# CONFIG_FB_MATROX is not set
884# CONFIG_FB_RADEON_OLD is not set
885CONFIG_FB_RADEON=y
886CONFIG_FB_RADEON_I2C=y
887# CONFIG_FB_RADEON_DEBUG is not set
888# CONFIG_FB_ATY128 is not set
889# CONFIG_FB_ATY is not set
890# CONFIG_FB_SAVAGE is not set
891# CONFIG_FB_SIS is not set
892# CONFIG_FB_NEOMAGIC is not set
893# CONFIG_FB_KYRO is not set
894# CONFIG_FB_3DFX is not set
895# CONFIG_FB_VOODOO1 is not set
896# CONFIG_FB_CYBLA is not set
897# CONFIG_FB_TRIDENT is not set
898# CONFIG_FB_S1D13XXX is not set
899# CONFIG_FB_VIRTUAL is not set
900
901#
902# Console display driver support
903#
904# CONFIG_VGA_CONSOLE is not set
905CONFIG_DUMMY_CONSOLE=y
906CONFIG_FRAMEBUFFER_CONSOLE=y
907# CONFIG_FONTS is not set
908CONFIG_FONT_8x8=y
909CONFIG_FONT_8x16=y
910
911#
912# Logo configuration
913#
914CONFIG_LOGO=y
915CONFIG_LOGO_LINUX_MONO=y
916CONFIG_LOGO_LINUX_VGA16=y
917CONFIG_LOGO_LINUX_CLUT224=y
918CONFIG_BACKLIGHT_LCD_SUPPORT=y
919CONFIG_BACKLIGHT_CLASS_DEVICE=m
920CONFIG_BACKLIGHT_DEVICE=y
921CONFIG_LCD_CLASS_DEVICE=m
922CONFIG_LCD_DEVICE=y
923
924#
925# Sound
926#
927# CONFIG_SOUND is not set
928
929#
930# USB support
931#
932CONFIG_USB_ARCH_HAS_HCD=y
933CONFIG_USB_ARCH_HAS_OHCI=y
934CONFIG_USB=y
935# CONFIG_USB_DEBUG is not set
936
937#
938# Miscellaneous USB options
939#
940CONFIG_USB_DEVICEFS=y
941# CONFIG_USB_BANDWIDTH is not set
942# CONFIG_USB_DYNAMIC_MINORS is not set
943# CONFIG_USB_OTG is not set
944
945#
946# USB Host Controller Drivers
947#
948CONFIG_USB_EHCI_HCD=y
949# CONFIG_USB_EHCI_SPLIT_ISO is not set
950# CONFIG_USB_EHCI_ROOT_HUB_TT is not set
951# CONFIG_USB_ISP116X_HCD is not set
952CONFIG_USB_OHCI_HCD=y
953# CONFIG_USB_OHCI_BIG_ENDIAN is not set
954CONFIG_USB_OHCI_LITTLE_ENDIAN=y
955# CONFIG_USB_UHCI_HCD is not set
956# CONFIG_USB_SL811_HCD is not set
957
958#
959# USB Device Class drivers
960#
961# CONFIG_USB_BLUETOOTH_TTY is not set
962CONFIG_USB_ACM=m
963CONFIG_USB_PRINTER=y
964
965#
966# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support' may also be needed; see USB_STORAGE Help for more information
967#
968CONFIG_USB_STORAGE=y
969# CONFIG_USB_STORAGE_DEBUG is not set
970CONFIG_USB_STORAGE_DATAFAB=y
971CONFIG_USB_STORAGE_FREECOM=y
972CONFIG_USB_STORAGE_ISD200=y
973CONFIG_USB_STORAGE_DPCM=y
974# CONFIG_USB_STORAGE_USBAT is not set
975CONFIG_USB_STORAGE_SDDR09=y
976CONFIG_USB_STORAGE_SDDR55=y
977CONFIG_USB_STORAGE_JUMPSHOT=y
978# CONFIG_USB_STORAGE_ONETOUCH is not set
979
980#
981# USB Input Devices
982#
983CONFIG_USB_HID=y
984CONFIG_USB_HIDINPUT=y
985CONFIG_HID_FF=y
986CONFIG_HID_PID=y
987CONFIG_LOGITECH_FF=y
988CONFIG_THRUSTMASTER_FF=y
989CONFIG_USB_HIDDEV=y
990# CONFIG_USB_AIPTEK is not set
991# CONFIG_USB_WACOM is not set
992# CONFIG_USB_ACECAD is not set
993# CONFIG_USB_KBTAB is not set
994# CONFIG_USB_POWERMATE is not set
995# CONFIG_USB_MTOUCH is not set
996# CONFIG_USB_ITMTOUCH is not set
997# CONFIG_USB_EGALAX is not set
998# CONFIG_USB_YEALINK is not set
999# CONFIG_USB_XPAD is not set
1000# CONFIG_USB_ATI_REMOTE is not set
1001# CONFIG_USB_KEYSPAN_REMOTE is not set
1002# CONFIG_USB_APPLETOUCH is not set
1003
1004#
1005# USB Imaging devices
1006#
1007# CONFIG_USB_MDC800 is not set
1008# CONFIG_USB_MICROTEK is not set
1009
1010#
1011# USB Multimedia devices
1012#
1013# CONFIG_USB_DABUSB is not set
1014
1015#
1016# Video4Linux support is needed for USB Multimedia device support
1017#
1018
1019#
1020# USB Network Adapters
1021#
1022CONFIG_USB_CATC=m
1023CONFIG_USB_KAWETH=m
1024CONFIG_USB_PEGASUS=m
1025CONFIG_USB_RTL8150=m
1026CONFIG_USB_USBNET=m
1027# CONFIG_USB_NET_AX8817X is not set
1028CONFIG_USB_NET_CDCETHER=m
1029# CONFIG_USB_NET_GL620A is not set
1030# CONFIG_USB_NET_NET1080 is not set
1031# CONFIG_USB_NET_PLUSB is not set
1032# CONFIG_USB_NET_RNDIS_HOST is not set
1033# CONFIG_USB_NET_CDC_SUBSET is not set
1034# CONFIG_USB_NET_ZAURUS is not set
1035CONFIG_USB_MON=y
1036
1037#
1038# USB port drivers
1039#
1040
1041#
1042# USB Serial Converter support
1043#
1044CONFIG_USB_SERIAL=m
1045CONFIG_USB_SERIAL_GENERIC=y
1046# CONFIG_USB_SERIAL_AIRPRIME is not set
1047CONFIG_USB_SERIAL_BELKIN=m
1048CONFIG_USB_SERIAL_DIGI_ACCELEPORT=m
1049# CONFIG_USB_SERIAL_CP2101 is not set
1050CONFIG_USB_SERIAL_CYPRESS_M8=m
1051CONFIG_USB_SERIAL_EMPEG=m
1052CONFIG_USB_SERIAL_FTDI_SIO=m
1053CONFIG_USB_SERIAL_VISOR=m
1054CONFIG_USB_SERIAL_IPAQ=m
1055CONFIG_USB_SERIAL_IR=m
1056CONFIG_USB_SERIAL_EDGEPORT=m
1057CONFIG_USB_SERIAL_EDGEPORT_TI=m
1058CONFIG_USB_SERIAL_GARMIN=m
1059CONFIG_USB_SERIAL_IPW=m
1060CONFIG_USB_SERIAL_KEYSPAN_PDA=m
1061CONFIG_USB_SERIAL_KEYSPAN=m
1062CONFIG_USB_SERIAL_KEYSPAN_MPR=y
1063CONFIG_USB_SERIAL_KEYSPAN_USA28=y
1064CONFIG_USB_SERIAL_KEYSPAN_USA28X=y
1065CONFIG_USB_SERIAL_KEYSPAN_USA28XA=y
1066CONFIG_USB_SERIAL_KEYSPAN_USA28XB=y
1067CONFIG_USB_SERIAL_KEYSPAN_USA19=y
1068CONFIG_USB_SERIAL_KEYSPAN_USA18X=y
1069CONFIG_USB_SERIAL_KEYSPAN_USA19W=y
1070CONFIG_USB_SERIAL_KEYSPAN_USA19QW=y
1071CONFIG_USB_SERIAL_KEYSPAN_USA19QI=y
1072CONFIG_USB_SERIAL_KEYSPAN_USA49W=y
1073CONFIG_USB_SERIAL_KEYSPAN_USA49WLC=y
1074CONFIG_USB_SERIAL_KLSI=m
1075CONFIG_USB_SERIAL_KOBIL_SCT=m
1076CONFIG_USB_SERIAL_MCT_U232=m
1077CONFIG_USB_SERIAL_PL2303=m
1078# CONFIG_USB_SERIAL_HP4X is not set
1079CONFIG_USB_SERIAL_SAFE=m
1080CONFIG_USB_SERIAL_SAFE_PADDED=y
1081CONFIG_USB_SERIAL_TI=m
1082CONFIG_USB_SERIAL_CYBERJACK=m
1083CONFIG_USB_SERIAL_XIRCOM=m
1084CONFIG_USB_SERIAL_OMNINET=m
1085CONFIG_USB_EZUSB=y
1086
1087#
1088# USB Miscellaneous drivers
1089#
1090# CONFIG_USB_EMI62 is not set
1091# CONFIG_USB_EMI26 is not set
1092# CONFIG_USB_AUERSWALD is not set
1093# CONFIG_USB_RIO500 is not set
1094# CONFIG_USB_LEGOTOWER is not set
1095# CONFIG_USB_LCD is not set
1096# CONFIG_USB_LED is not set
1097# CONFIG_USB_CYTHERM is not set
1098# CONFIG_USB_PHIDGETKIT is not set
1099# CONFIG_USB_PHIDGETSERVO is not set
1100# CONFIG_USB_IDMOUSE is not set
1101# CONFIG_USB_SISUSBVGA is not set
1102# CONFIG_USB_LD is not set
1103# CONFIG_USB_TEST is not set
1104
1105#
1106# USB DSL modem support
1107#
1108
1109#
1110# USB Gadget Support
1111#
1112# CONFIG_USB_GADGET is not set
1113
1114#
1115# MMC/SD Card support
1116#
1117# CONFIG_MMC is not set
1118
1119#
1120# InfiniBand support
1121#
1122# CONFIG_INFINIBAND is not set
1123
1124#
1125# SN Devices
1126#
1127
1128#
1129# File systems
1130#
1131CONFIG_EXT2_FS=y
1132CONFIG_EXT2_FS_XATTR=y
1133CONFIG_EXT2_FS_POSIX_ACL=y
1134CONFIG_EXT2_FS_SECURITY=y
1135CONFIG_EXT2_FS_XIP=y
1136CONFIG_FS_XIP=y
1137CONFIG_EXT3_FS=y
1138CONFIG_EXT3_FS_XATTR=y
1139CONFIG_EXT3_FS_POSIX_ACL=y
1140CONFIG_EXT3_FS_SECURITY=y
1141CONFIG_JBD=y
1142# CONFIG_JBD_DEBUG is not set
1143CONFIG_FS_MBCACHE=y
1144CONFIG_REISERFS_FS=y
1145# CONFIG_REISERFS_CHECK is not set
1146# CONFIG_REISERFS_PROC_INFO is not set
1147CONFIG_REISERFS_FS_XATTR=y
1148CONFIG_REISERFS_FS_POSIX_ACL=y
1149CONFIG_REISERFS_FS_SECURITY=y
1150# CONFIG_JFS_FS is not set
1151CONFIG_FS_POSIX_ACL=y
1152CONFIG_XFS_FS=m
1153CONFIG_XFS_EXPORT=y
1154# CONFIG_XFS_QUOTA is not set
1155CONFIG_XFS_SECURITY=y
1156CONFIG_XFS_POSIX_ACL=y
1157# CONFIG_XFS_RT is not set
1158# CONFIG_MINIX_FS is not set
1159# CONFIG_ROMFS_FS is not set
1160CONFIG_INOTIFY=y
1161# CONFIG_QUOTA is not set
1162CONFIG_DNOTIFY=y
1163CONFIG_AUTOFS_FS=m
1164# CONFIG_AUTOFS4_FS is not set
1165# CONFIG_FUSE_FS is not set
1166
1167#
1168# CD-ROM/DVD Filesystems
1169#
1170CONFIG_ISO9660_FS=y
1171CONFIG_JOLIET=y
1172CONFIG_ZISOFS=y
1173CONFIG_ZISOFS_FS=y
1174CONFIG_UDF_FS=m
1175CONFIG_UDF_NLS=y
1176
1177#
1178# DOS/FAT/NT Filesystems
1179#
1180CONFIG_FAT_FS=y
1181CONFIG_MSDOS_FS=y
1182CONFIG_VFAT_FS=y
1183CONFIG_FAT_DEFAULT_CODEPAGE=437
1184CONFIG_FAT_DEFAULT_IOCHARSET="iso8859-1"
1185# CONFIG_NTFS_FS is not set
1186
1187#
1188# Pseudo filesystems
1189#
1190CONFIG_PROC_FS=y
1191CONFIG_PROC_KCORE=y
1192CONFIG_SYSFS=y
1193CONFIG_TMPFS=y
1194CONFIG_HUGETLBFS=y
1195CONFIG_HUGETLB_PAGE=y
1196CONFIG_RAMFS=y
1197# CONFIG_RELAYFS_FS is not set
1198
1199#
1200# Miscellaneous filesystems
1201#
1202# CONFIG_ADFS_FS is not set
1203# CONFIG_AFFS_FS is not set
1204CONFIG_HFS_FS=m
1205CONFIG_HFSPLUS_FS=m
1206# CONFIG_BEFS_FS is not set
1207# CONFIG_BFS_FS is not set
1208# CONFIG_EFS_FS is not set
1209CONFIG_CRAMFS=y
1210# CONFIG_VXFS_FS is not set
1211# CONFIG_HPFS_FS is not set
1212# CONFIG_QNX4FS_FS is not set
1213# CONFIG_SYSV_FS is not set
1214# CONFIG_UFS_FS is not set
1215
1216#
1217# Network File Systems
1218#
1219CONFIG_NFS_FS=y
1220CONFIG_NFS_V3=y
1221CONFIG_NFS_V3_ACL=y
1222CONFIG_NFS_V4=y
1223# CONFIG_NFS_DIRECTIO is not set
1224CONFIG_NFSD=y
1225CONFIG_NFSD_V2_ACL=y
1226CONFIG_NFSD_V3=y
1227CONFIG_NFSD_V3_ACL=y
1228CONFIG_NFSD_V4=y
1229CONFIG_NFSD_TCP=y
1230CONFIG_LOCKD=y
1231CONFIG_LOCKD_V4=y
1232CONFIG_EXPORTFS=y
1233CONFIG_NFS_ACL_SUPPORT=y
1234CONFIG_NFS_COMMON=y
1235CONFIG_SUNRPC=y
1236CONFIG_SUNRPC_GSS=y
1237CONFIG_RPCSEC_GSS_KRB5=y
1238# CONFIG_RPCSEC_GSS_SPKM3 is not set
1239# CONFIG_SMB_FS is not set
1240CONFIG_CIFS=m
1241# CONFIG_CIFS_STATS is not set
1242# CONFIG_CIFS_XATTR is not set
1243# CONFIG_CIFS_EXPERIMENTAL is not set
1244# CONFIG_NCP_FS is not set
1245# CONFIG_CODA_FS is not set
1246# CONFIG_AFS_FS is not set
1247# CONFIG_9P_FS is not set
1248
1249#
1250# Partition Types
1251#
1252CONFIG_PARTITION_ADVANCED=y
1253# CONFIG_ACORN_PARTITION is not set
1254# CONFIG_OSF_PARTITION is not set
1255# CONFIG_AMIGA_PARTITION is not set
1256# CONFIG_ATARI_PARTITION is not set
1257CONFIG_MAC_PARTITION=y
1258CONFIG_MSDOS_PARTITION=y
1259# CONFIG_BSD_DISKLABEL is not set
1260# CONFIG_MINIX_SUBPARTITION is not set
1261# CONFIG_SOLARIS_X86_PARTITION is not set
1262# CONFIG_UNIXWARE_DISKLABEL is not set
1263# CONFIG_LDM_PARTITION is not set
1264# CONFIG_SGI_PARTITION is not set
1265# CONFIG_ULTRIX_PARTITION is not set
1266# CONFIG_SUN_PARTITION is not set
1267# CONFIG_EFI_PARTITION is not set
1268
1269#
1270# Native Language Support
1271#
1272CONFIG_NLS=y
1273CONFIG_NLS_DEFAULT="iso8859-1"
1274CONFIG_NLS_CODEPAGE_437=y
1275# CONFIG_NLS_CODEPAGE_737 is not set
1276# CONFIG_NLS_CODEPAGE_775 is not set
1277# CONFIG_NLS_CODEPAGE_850 is not set
1278# CONFIG_NLS_CODEPAGE_852 is not set
1279# CONFIG_NLS_CODEPAGE_855 is not set
1280# CONFIG_NLS_CODEPAGE_857 is not set
1281# CONFIG_NLS_CODEPAGE_860 is not set
1282# CONFIG_NLS_CODEPAGE_861 is not set
1283# CONFIG_NLS_CODEPAGE_862 is not set
1284# CONFIG_NLS_CODEPAGE_863 is not set
1285# CONFIG_NLS_CODEPAGE_864 is not set
1286# CONFIG_NLS_CODEPAGE_865 is not set
1287# CONFIG_NLS_CODEPAGE_866 is not set
1288# CONFIG_NLS_CODEPAGE_869 is not set
1289# CONFIG_NLS_CODEPAGE_936 is not set
1290# CONFIG_NLS_CODEPAGE_950 is not set
1291# CONFIG_NLS_CODEPAGE_932 is not set
1292# CONFIG_NLS_CODEPAGE_949 is not set
1293# CONFIG_NLS_CODEPAGE_874 is not set
1294# CONFIG_NLS_ISO8859_8 is not set
1295CONFIG_NLS_CODEPAGE_1250=y
1296CONFIG_NLS_CODEPAGE_1251=y
1297CONFIG_NLS_ASCII=y
1298CONFIG_NLS_ISO8859_1=y
1299# CONFIG_NLS_ISO8859_2 is not set
1300# CONFIG_NLS_ISO8859_3 is not set
1301# CONFIG_NLS_ISO8859_4 is not set
1302# CONFIG_NLS_ISO8859_5 is not set
1303# CONFIG_NLS_ISO8859_6 is not set
1304# CONFIG_NLS_ISO8859_7 is not set
1305# CONFIG_NLS_ISO8859_9 is not set
1306# CONFIG_NLS_ISO8859_13 is not set
1307# CONFIG_NLS_ISO8859_14 is not set
1308CONFIG_NLS_ISO8859_15=y
1309# CONFIG_NLS_KOI8_R is not set
1310# CONFIG_NLS_KOI8_U is not set
1311CONFIG_NLS_UTF8=y
1312
1313#
1314# Profiling support
1315#
1316CONFIG_PROFILING=y
1317CONFIG_OPROFILE=y
1318
1319#
1320# Kernel hacking
1321#
1322# CONFIG_PRINTK_TIME is not set
1323CONFIG_DEBUG_KERNEL=y
1324CONFIG_MAGIC_SYSRQ=y
1325CONFIG_LOG_BUF_SHIFT=17
1326CONFIG_DETECT_SOFTLOCKUP=y
1327# CONFIG_SCHEDSTATS is not set
1328# CONFIG_DEBUG_SLAB is not set
1329# CONFIG_DEBUG_SPINLOCK is not set
1330# CONFIG_DEBUG_SPINLOCK_SLEEP is not set
1331# CONFIG_DEBUG_KOBJECT is not set
1332# CONFIG_DEBUG_INFO is not set
1333CONFIG_DEBUG_FS=y
1334# CONFIG_DEBUG_STACKOVERFLOW is not set
1335# CONFIG_KPROBES is not set
1336# CONFIG_DEBUG_STACK_USAGE is not set
1337# CONFIG_DEBUGGER is not set
1338# CONFIG_PPCDBG is not set
1339CONFIG_IRQSTACKS=y
1340
1341#
1342# Security options
1343#
1344# CONFIG_KEYS is not set
1345# CONFIG_SECURITY is not set
1346
1347#
1348# Cryptographic options
1349#
1350CONFIG_CRYPTO=y
1351CONFIG_CRYPTO_HMAC=y
1352CONFIG_CRYPTO_NULL=m
1353CONFIG_CRYPTO_MD4=m
1354CONFIG_CRYPTO_MD5=y
1355CONFIG_CRYPTO_SHA1=m
1356CONFIG_CRYPTO_SHA256=m
1357CONFIG_CRYPTO_SHA512=m
1358CONFIG_CRYPTO_WP512=m
1359# CONFIG_CRYPTO_TGR192 is not set
1360CONFIG_CRYPTO_DES=y
1361CONFIG_CRYPTO_BLOWFISH=m
1362CONFIG_CRYPTO_TWOFISH=m
1363CONFIG_CRYPTO_SERPENT=m
1364CONFIG_CRYPTO_AES=m
1365CONFIG_CRYPTO_CAST5=m
1366CONFIG_CRYPTO_CAST6=m
1367CONFIG_CRYPTO_TEA=m
1368CONFIG_CRYPTO_ARC4=m
1369CONFIG_CRYPTO_KHAZAD=m
1370CONFIG_CRYPTO_ANUBIS=m
1371CONFIG_CRYPTO_DEFLATE=m
1372CONFIG_CRYPTO_MICHAEL_MIC=m
1373CONFIG_CRYPTO_CRC32C=m
1374CONFIG_CRYPTO_TEST=m
1375
1376#
1377# Hardware crypto devices
1378#
1379
1380#
1381# Library routines
1382#
1383CONFIG_CRC_CCITT=m
1384# CONFIG_CRC16 is not set
1385CONFIG_CRC32=y
1386CONFIG_LIBCRC32C=m
1387CONFIG_ZLIB_INFLATE=y
1388CONFIG_ZLIB_DEFLATE=m
1389CONFIG_TEXTSEARCH=y
1390CONFIG_TEXTSEARCH_KMP=m
1391CONFIG_TEXTSEARCH_BM=m
1392CONFIG_TEXTSEARCH_FSM=m
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/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..7f64f0464d44 100644
--- a/arch/powerpc/kernel/process.c
+++ b/arch/powerpc/kernel/process.c
@@ -48,8 +48,8 @@
48#include <asm/prom.h> 48#include <asm/prom.h>
49#ifdef CONFIG_PPC64 49#ifdef CONFIG_PPC64
50#include <asm/firmware.h> 50#include <asm/firmware.h>
51#include <asm/plpar_wrappers.h>
52#include <asm/time.h> 51#include <asm/time.h>
52#include <asm/machdep.h>
53#endif 53#endif
54 54
55extern unsigned long _get_SP(void); 55extern unsigned long _get_SP(void);
@@ -201,27 +201,15 @@ 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;
212
213#ifdef CONFIG_PPC64 206#ifdef CONFIG_PPC64
214 if (firmware_has_feature(FW_FEATURE_XDABR)) { 207 if (ppc_md.set_dabr)
215 /* We want to catch accesses from kernel and userspace */ 208 return ppc_md.set_dabr(dabr);
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 209#endif
222 set_dabr_spr(dabr);
223 210
224 return ret; 211 mtspr(SPRN_DABR, dabr);
212 return 0;
225} 213}
226 214
227#ifdef CONFIG_PPC64 215#ifdef CONFIG_PPC64
@@ -566,12 +554,10 @@ int copy_thread(int nr, unsigned long clone_flags, unsigned long usp,
566#ifdef CONFIG_PPC64 554#ifdef CONFIG_PPC64
567 if (cpu_has_feature(CPU_FTR_SLB)) { 555 if (cpu_has_feature(CPU_FTR_SLB)) {
568 unsigned long sp_vsid = get_kernel_vsid(sp); 556 unsigned long sp_vsid = get_kernel_vsid(sp);
557 unsigned long llp = mmu_psize_defs[mmu_linear_psize].sllp;
569 558
570 sp_vsid <<= SLB_VSID_SHIFT; 559 sp_vsid <<= SLB_VSID_SHIFT;
571 sp_vsid |= SLB_VSID_KERNEL; 560 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; 561 p->thread.ksp_vsid = sp_vsid;
576 } 562 }
577 563
diff --git a/arch/powerpc/kernel/prom.c b/arch/powerpc/kernel/prom.c
index 2eccd0e159e3..3675ef4bac90 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}
diff --git a/arch/powerpc/kernel/prom_init.c b/arch/powerpc/kernel/prom_init.c
index 9750b3cd8ecd..c758b6624d7b 100644
--- a/arch/powerpc/kernel/prom_init.c
+++ b/arch/powerpc/kernel/prom_init.c
@@ -2000,7 +2000,7 @@ unsigned long __init prom_init(unsigned long r3, unsigned long r4,
2000#endif 2000#endif
2001 2001
2002 /* 2002 /*
2003 * On pSeries and BPA, copy the CPU hold code 2003 * Copy the CPU hold code
2004 */ 2004 */
2005 if (RELOC(of_platform) != PLATFORM_POWERMAC) 2005 if (RELOC(of_platform) != PLATFORM_POWERMAC)
2006 copy_and_flush(0, KERNELBASE + offset, 0x100, 0); 2006 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..b7fc2d884950 100644
--- a/arch/powerpc/kernel/rtas.c
+++ b/arch/powerpc/kernel/rtas.c
@@ -43,6 +43,13 @@ char rtas_data_buf[RTAS_DATA_BUF_SIZE] __cacheline_aligned;
43unsigned long rtas_rmo_buf; 43unsigned long rtas_rmo_buf;
44 44
45/* 45/*
46 * If non-NULL, this gets called when the kernel terminates.
47 * This is done like this so rtas_flash can be a module.
48 */
49void (*rtas_flash_term_hook)(int);
50EXPORT_SYMBOL(rtas_flash_term_hook);
51
52/*
46 * call_rtas_display_status and call_rtas_display_status_delay 53 * call_rtas_display_status and call_rtas_display_status_delay
47 * are designed only for very early low-level debugging, which 54 * are designed only for very early low-level debugging, which
48 * is why the token is hard-coded to 10. 55 * is why the token is hard-coded to 10.
@@ -206,6 +213,7 @@ void rtas_progress(char *s, unsigned short hex)
206 213
207 spin_unlock(&progress_lock); 214 spin_unlock(&progress_lock);
208} 215}
216EXPORT_SYMBOL(rtas_progress); /* needed by rtas_flash module */
209 217
210int rtas_token(const char *service) 218int rtas_token(const char *service)
211{ 219{
@@ -492,6 +500,8 @@ int rtas_set_indicator(int indicator, int index, int new_value)
492 500
493void rtas_restart(char *cmd) 501void rtas_restart(char *cmd)
494{ 502{
503 if (rtas_flash_term_hook)
504 rtas_flash_term_hook(SYS_RESTART);
495 printk("RTAS system-reboot returned %d\n", 505 printk("RTAS system-reboot returned %d\n",
496 rtas_call(rtas_token("system-reboot"), 0, 1, NULL)); 506 rtas_call(rtas_token("system-reboot"), 0, 1, NULL));
497 for (;;); 507 for (;;);
@@ -499,6 +509,8 @@ void rtas_restart(char *cmd)
499 509
500void rtas_power_off(void) 510void rtas_power_off(void)
501{ 511{
512 if (rtas_flash_term_hook)
513 rtas_flash_term_hook(SYS_POWER_OFF);
502 /* allow power on only with power button press */ 514 /* allow power on only with power button press */
503 printk("RTAS power-off returned %d\n", 515 printk("RTAS power-off returned %d\n",
504 rtas_call(rtas_token("power-off"), 2, 1, NULL, -1, -1)); 516 rtas_call(rtas_token("power-off"), 2, 1, NULL, -1, -1));
@@ -507,7 +519,12 @@ void rtas_power_off(void)
507 519
508void rtas_halt(void) 520void rtas_halt(void)
509{ 521{
510 rtas_power_off(); 522 if (rtas_flash_term_hook)
523 rtas_flash_term_hook(SYS_HALT);
524 /* allow power on only with power button press */
525 printk("RTAS power-off returned %d\n",
526 rtas_call(rtas_token("power-off"), 2, 1, NULL, -1, -1));
527 for (;;);
511} 528}
512 529
513/* Must be in the RMO region, so we place it here */ 530/* Must be in the RMO region, so we place it here */
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..d43fa8c0e5ac 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,118 @@ 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
408#ifdef CONFIG_SMP
409
410/**
411 * setup_cpu_maps - initialize the following cpu maps:
412 * cpu_possible_map
413 * cpu_present_map
414 * cpu_sibling_map
415 *
416 * Having the possible map set up early allows us to restrict allocations
417 * of things like irqstacks to num_possible_cpus() rather than NR_CPUS.
418 *
419 * We do not initialize the online map here; cpus set their own bits in
420 * cpu_online_map as they come up.
421 *
422 * This function is valid only for Open Firmware systems. finish_device_tree
423 * must be called before using this.
424 *
425 * While we're here, we may as well set the "physical" cpu ids in the paca.
426 */
427void __init smp_setup_cpu_maps(void)
428{
429 struct device_node *dn = NULL;
430 int cpu = 0;
431 int swap_cpuid = 0;
432
433 while ((dn = of_find_node_by_type(dn, "cpu")) && cpu < NR_CPUS) {
434 int *intserv;
435 int j, len = sizeof(u32), nthreads = 1;
436
437 intserv = (int *)get_property(dn, "ibm,ppc-interrupt-server#s",
438 &len);
439 if (intserv)
440 nthreads = len / sizeof(int);
441 else {
442 intserv = (int *) get_property(dn, "reg", NULL);
443 if (!intserv)
444 intserv = &cpu; /* assume logical == phys */
445 }
446
447 for (j = 0; j < nthreads && cpu < NR_CPUS; j++) {
448 cpu_set(cpu, cpu_present_map);
449 set_hard_smp_processor_id(cpu, intserv[j]);
450
451 if (intserv[j] == boot_cpuid_phys)
452 swap_cpuid = cpu;
453 cpu_set(cpu, cpu_possible_map);
454 cpu++;
455 }
456 }
457
458 /* Swap CPU id 0 with boot_cpuid_phys, so we can always assume that
459 * boot cpu is logical 0.
460 */
461 if (boot_cpuid_phys != get_hard_smp_processor_id(0)) {
462 u32 tmp;
463 tmp = get_hard_smp_processor_id(0);
464 set_hard_smp_processor_id(0, boot_cpuid_phys);
465 set_hard_smp_processor_id(swap_cpuid, tmp);
466 }
467
468#ifdef CONFIG_PPC64
469 /*
470 * On pSeries LPAR, we need to know how many cpus
471 * could possibly be added to this partition.
472 */
473 if (systemcfg->platform == PLATFORM_PSERIES_LPAR &&
474 (dn = of_find_node_by_path("/rtas"))) {
475 int num_addr_cell, num_size_cell, maxcpus;
476 unsigned int *ireg;
477
478 num_addr_cell = prom_n_addr_cells(dn);
479 num_size_cell = prom_n_size_cells(dn);
480
481 ireg = (unsigned int *)
482 get_property(dn, "ibm,lrdr-capacity", NULL);
483
484 if (!ireg)
485 goto out;
486
487 maxcpus = ireg[num_addr_cell + num_size_cell];
488
489 /* Double maxcpus for processors which have SMT capability */
490 if (cpu_has_feature(CPU_FTR_SMT))
491 maxcpus *= 2;
492
493 if (maxcpus > NR_CPUS) {
494 printk(KERN_WARNING
495 "Partition configured for %d cpus, "
496 "operating system maximum is %d.\n",
497 maxcpus, NR_CPUS);
498 maxcpus = NR_CPUS;
499 } else
500 printk(KERN_INFO "Partition configured for %d cpus.\n",
501 maxcpus);
502
503 for (cpu = 0; cpu < maxcpus; cpu++)
504 cpu_set(cpu, cpu_possible_map);
505 out:
506 of_node_put(dn);
507 }
508
509 /*
510 * Do the sibling map; assume only two threads per processor.
511 */
512 for_each_cpu(cpu) {
513 cpu_set(cpu, cpu_sibling_map[cpu]);
514 if (cpu_has_feature(CPU_FTR_SMT))
515 cpu_set(cpu ^ 0x1, cpu_sibling_map[cpu]);
516 }
517
518 systemcfg->processorCount = num_present_cpus();
519#endif /* CONFIG_PPC64 */
520}
521#endif /* CONFIG_SMP */
diff --git a/arch/powerpc/kernel/setup_32.c b/arch/powerpc/kernel/setup_32.c
index 9680ae99b084..b45eedbb4b3a 100644
--- a/arch/powerpc/kernel/setup_32.c
+++ b/arch/powerpc/kernel/setup_32.c
@@ -288,6 +288,8 @@ void __init setup_arch(char **cmdline_p)
288 unflatten_device_tree(); 288 unflatten_device_tree();
289 finish_device_tree(); 289 finish_device_tree();
290 290
291 smp_setup_cpu_maps();
292
291#ifdef CONFIG_BOOTX_TEXT 293#ifdef CONFIG_BOOTX_TEXT
292 init_boot_display(); 294 init_boot_display();
293#endif 295#endif
diff --git a/arch/powerpc/kernel/setup_64.c b/arch/powerpc/kernel/setup_64.c
index 40c48100bf1b..b0994050024f 100644
--- a/arch/powerpc/kernel/setup_64.c
+++ b/arch/powerpc/kernel/setup_64.c
@@ -56,7 +56,7 @@
56#include <asm/page.h> 56#include <asm/page.h>
57#include <asm/mmu.h> 57#include <asm/mmu.h>
58#include <asm/lmb.h> 58#include <asm/lmb.h>
59#include <asm/iSeries/ItLpNaca.h> 59#include <asm/iseries/it_lp_naca.h>
60#include <asm/firmware.h> 60#include <asm/firmware.h>
61#include <asm/systemcfg.h> 61#include <asm/systemcfg.h>
62#include <asm/xmon.h> 62#include <asm/xmon.h>
@@ -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,
@@ -385,21 +277,49 @@ void __init early_setup(unsigned long dt_ptr)
385 DBG("Found, Initializing memory management...\n"); 277 DBG("Found, Initializing memory management...\n");
386 278
387 /* 279 /*
388 * Initialize stab / SLB management 280 * Initialize the MMU Hash table and create the linear mapping
281 * of memory. Has to be done before stab/slb initialization as
282 * this is currently where the page size encoding is obtained
389 */ 283 */
390 if (!firmware_has_feature(FW_FEATURE_ISERIES)) 284 htab_initialize();
391 stab_initialize(lpaca->stab_real);
392 285
393 /* 286 /*
394 * Initialize the MMU Hash table and create the linear mapping 287 * Initialize stab / SLB management except on iSeries
395 * of memory
396 */ 288 */
397 htab_initialize(); 289 if (!firmware_has_feature(FW_FEATURE_ISERIES)) {
290 if (cpu_has_feature(CPU_FTR_SLB))
291 slb_initialize();
292 else
293 stab_initialize(lpaca->stab_real);
294 }
398 295
399 DBG(" <- early_setup()\n"); 296 DBG(" <- early_setup()\n");
400} 297}
401 298
402 299
300#if defined(CONFIG_SMP) || defined(CONFIG_KEXEC)
301void smp_release_cpus(void)
302{
303 extern unsigned long __secondary_hold_spinloop;
304
305 DBG(" -> smp_release_cpus()\n");
306
307 /* All secondary cpus are spinning on a common spinloop, release them
308 * all now so they can start to spin on their individual paca
309 * spinloops. For non SMP kernels, the secondary cpus never get out
310 * of the common spinloop.
311 * This is useless but harmless on iSeries, secondaries are already
312 * waiting on their paca spinloops. */
313
314 __secondary_hold_spinloop = 1;
315 mb();
316
317 DBG(" <- smp_release_cpus()\n");
318}
319#else
320#define smp_release_cpus()
321#endif /* CONFIG_SMP || CONFIG_KEXEC */
322
403/* 323/*
404 * Initialize some remaining members of the ppc64_caches and systemcfg structures 324 * 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 325 * (at least until we get rid of them completely). This is mostly some
@@ -589,17 +509,13 @@ void __init setup_system(void)
589 509
590 parse_early_param(); 510 parse_early_param();
591 511
592#ifdef CONFIG_SMP 512 check_smt_enabled();
593 /* 513 smp_setup_cpu_maps();
594 * iSeries has already initialized the cpu maps at this point.
595 */
596 setup_cpu_maps();
597 514
598 /* Release secondary cpus out of their spinloops at 0x60 now that 515 /* Release secondary cpus out of their spinloops at 0x60 now that
599 * we can map physical -> logical CPU ids 516 * we can map physical -> logical CPU ids
600 */ 517 */
601 smp_release_cpus(); 518 smp_release_cpus();
602#endif
603 519
604 printk("Starting Linux PPC64 %s\n", system_utsname.version); 520 printk("Starting Linux PPC64 %s\n", system_utsname.version);
605 521
@@ -631,23 +547,6 @@ static int ppc64_panic_event(struct notifier_block *this,
631 return NOTIFY_DONE; 547 return NOTIFY_DONE;
632} 548}
633 549
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 550#ifdef CONFIG_IRQSTACKS
652static void __init irqstack_early_init(void) 551static void __init irqstack_early_init(void)
653{ 552{
@@ -658,10 +557,12 @@ static void __init irqstack_early_init(void)
658 * SLB misses on them. 557 * SLB misses on them.
659 */ 558 */
660 for_each_cpu(i) { 559 for_each_cpu(i) {
661 softirq_ctx[i] = (struct thread_info *)__va(lmb_alloc_base(THREAD_SIZE, 560 softirq_ctx[i] = (struct thread_info *)
662 THREAD_SIZE, 0x10000000)); 561 __va(lmb_alloc_base(THREAD_SIZE,
663 hardirq_ctx[i] = (struct thread_info *)__va(lmb_alloc_base(THREAD_SIZE, 562 THREAD_SIZE, 0x10000000));
664 THREAD_SIZE, 0x10000000)); 563 hardirq_ctx[i] = (struct thread_info *)
564 __va(lmb_alloc_base(THREAD_SIZE,
565 THREAD_SIZE, 0x10000000));
665 } 566 }
666} 567}
667#else 568#else
@@ -689,8 +590,8 @@ static void __init emergency_stack_init(void)
689 limit = min(0x10000000UL, lmb.rmo_size); 590 limit = min(0x10000000UL, lmb.rmo_size);
690 591
691 for_each_cpu(i) 592 for_each_cpu(i)
692 paca[i].emergency_sp = __va(lmb_alloc_base(PAGE_SIZE, 128, 593 paca[i].emergency_sp =
693 limit)) + PAGE_SIZE; 594 __va(lmb_alloc_base(HW_PAGE_SIZE, 128, limit)) + HW_PAGE_SIZE;
694} 595}
695 596
696/* 597/*
diff --git a/arch/powerpc/kernel/signal_32.c b/arch/powerpc/kernel/signal_32.c
index 444c3e81884c..876c57c11365 100644
--- a/arch/powerpc/kernel/signal_32.c
+++ b/arch/powerpc/kernel/signal_32.c
@@ -43,7 +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> 47#include <asm/ppcdebug.h>
48#include <asm/unistd.h> 48#include <asm/unistd.h>
49#include <asm/vdso.h> 49#include <asm/vdso.h>
diff --git a/arch/ppc64/kernel/signal.c b/arch/powerpc/kernel/signal_64.c
index ec9d0984b6a0..ec9d0984b6a0 100644
--- a/arch/ppc64/kernel/signal.c
+++ b/arch/powerpc/kernel/signal_64.c
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..1794a694a928 100644
--- a/arch/ppc64/kernel/smp.c
+++ b/arch/powerpc/kernel/smp.c
@@ -39,13 +39,18 @@
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>
43#include <asm/xmon.h>
44#include <asm/machdep.h> 44#include <asm/machdep.h>
45#include <asm/cputable.h> 45#include <asm/cputable.h>
46#include <asm/system.h> 46#include <asm/system.h>
47#include <asm/abs_addr.h>
48#include <asm/mpic.h> 47#include <asm/mpic.h>
48#ifdef CONFIG_PPC64
49#include <asm/paca.h>
50#endif
51
52int smp_hw_index[NR_CPUS];
53struct thread_info *secondary_ti;
49 54
50#ifdef DEBUG 55#ifdef DEBUG
51#define DBG(fmt...) udbg_printf(fmt) 56#define DBG(fmt...) udbg_printf(fmt)
@@ -60,6 +65,7 @@ cpumask_t cpu_sibling_map[NR_CPUS] = { [0 ... NR_CPUS-1] = CPU_MASK_NONE };
60EXPORT_SYMBOL(cpu_online_map); 65EXPORT_SYMBOL(cpu_online_map);
61EXPORT_SYMBOL(cpu_possible_map); 66EXPORT_SYMBOL(cpu_possible_map);
62 67
68/* SMP operations for this machine */
63struct smp_ops_t *smp_ops; 69struct smp_ops_t *smp_ops;
64 70
65static volatile unsigned int cpu_callin_map[NR_CPUS]; 71static volatile unsigned int cpu_callin_map[NR_CPUS];
@@ -89,7 +95,9 @@ void __devinit smp_mpic_setup_cpu(int cpu)
89{ 95{
90 mpic_setup_this_cpu(); 96 mpic_setup_this_cpu();
91} 97}
98#endif /* CONFIG_MPIC */
92 99
100#ifdef CONFIG_PPC64
93void __devinit smp_generic_kick_cpu(int nr) 101void __devinit smp_generic_kick_cpu(int nr)
94{ 102{
95 BUG_ON(nr < 0 || nr >= NR_CPUS); 103 BUG_ON(nr < 0 || nr >= NR_CPUS);
@@ -102,8 +110,7 @@ void __devinit smp_generic_kick_cpu(int nr)
102 paca[nr].cpu_start = 1; 110 paca[nr].cpu_start = 1;
103 smp_mb(); 111 smp_mb();
104} 112}
105 113#endif
106#endif /* CONFIG_MPIC */
107 114
108void smp_message_recv(int msg, struct pt_regs *regs) 115void smp_message_recv(int msg, struct pt_regs *regs)
109{ 116{
@@ -111,15 +118,10 @@ void smp_message_recv(int msg, struct pt_regs *regs)
111 case PPC_MSG_CALL_FUNCTION: 118 case PPC_MSG_CALL_FUNCTION:
112 smp_call_function_interrupt(); 119 smp_call_function_interrupt();
113 break; 120 break;
114 case PPC_MSG_RESCHEDULE: 121 case PPC_MSG_RESCHEDULE:
115 /* XXX Do we have to do this? */ 122 /* XXX Do we have to do this? */
116 set_need_resched(); 123 set_need_resched();
117 break; 124 break;
118#if 0
119 case PPC_MSG_MIGRATE_TASK:
120 /* spare */
121 break;
122#endif
123#ifdef CONFIG_DEBUGGER 125#ifdef CONFIG_DEBUGGER
124 case PPC_MSG_DEBUGGER_BREAK: 126 case PPC_MSG_DEBUGGER_BREAK:
125 debugger_ipi(regs); 127 debugger_ipi(regs);
@@ -171,8 +173,8 @@ static struct call_data_struct {
171 int wait; 173 int wait;
172} *call_data; 174} *call_data;
173 175
174/* delay of at least 8 seconds on 1GHz cpu */ 176/* delay of at least 8 seconds */
175#define SMP_CALL_TIMEOUT (1UL << (30 + 3)) 177#define SMP_CALL_TIMEOUT 8
176 178
177/* 179/*
178 * This function sends a 'generic call function' IPI to all other CPUs 180 * This function sends a 'generic call function' IPI to all other CPUs
@@ -194,7 +196,7 @@ int smp_call_function (void (*func) (void *info), void *info, int nonatomic,
194{ 196{
195 struct call_data_struct data; 197 struct call_data_struct data;
196 int ret = -1, cpus; 198 int ret = -1, cpus;
197 unsigned long timeout; 199 u64 timeout;
198 200
199 /* Can deadlock when called with interrupts disabled */ 201 /* Can deadlock when called with interrupts disabled */
200 WARN_ON(irqs_disabled()); 202 WARN_ON(irqs_disabled());
@@ -220,11 +222,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 */ 222 /* 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); 223 smp_ops->message_pass(MSG_ALL_BUT_SELF, PPC_MSG_CALL_FUNCTION);
222 224
225 timeout = get_tb() + (u64) SMP_CALL_TIMEOUT * tb_ticks_per_sec;
226
223 /* Wait for response */ 227 /* Wait for response */
224 timeout = SMP_CALL_TIMEOUT;
225 while (atomic_read(&data.started) != cpus) { 228 while (atomic_read(&data.started) != cpus) {
226 HMT_low(); 229 HMT_low();
227 if (--timeout == 0) { 230 if (get_tb() >= timeout) {
228 printk("smp_call_function on cpu %d: other cpus not " 231 printk("smp_call_function on cpu %d: other cpus not "
229 "responding (%d)\n", smp_processor_id(), 232 "responding (%d)\n", smp_processor_id(),
230 atomic_read(&data.started)); 233 atomic_read(&data.started));
@@ -234,10 +237,9 @@ int smp_call_function (void (*func) (void *info), void *info, int nonatomic,
234 } 237 }
235 238
236 if (wait) { 239 if (wait) {
237 timeout = SMP_CALL_TIMEOUT;
238 while (atomic_read(&data.finished) != cpus) { 240 while (atomic_read(&data.finished) != cpus) {
239 HMT_low(); 241 HMT_low();
240 if (--timeout == 0) { 242 if (get_tb() >= timeout) {
241 printk("smp_call_function on cpu %d: other " 243 printk("smp_call_function on cpu %d: other "
242 "cpus not finishing (%d/%d)\n", 244 "cpus not finishing (%d/%d)\n",
243 smp_processor_id(), 245 smp_processor_id(),
@@ -251,7 +253,7 @@ int smp_call_function (void (*func) (void *info), void *info, int nonatomic,
251 253
252 ret = 0; 254 ret = 0;
253 255
254out: 256 out:
255 call_data = NULL; 257 call_data = NULL;
256 HMT_medium(); 258 HMT_medium();
257 spin_unlock(&call_lock); 259 spin_unlock(&call_lock);
@@ -313,8 +315,11 @@ static void __init smp_create_idle(unsigned int cpu)
313 p = fork_idle(cpu); 315 p = fork_idle(cpu);
314 if (IS_ERR(p)) 316 if (IS_ERR(p))
315 panic("failed fork for CPU %u: %li", cpu, PTR_ERR(p)); 317 panic("failed fork for CPU %u: %li", cpu, PTR_ERR(p));
318#ifdef CONFIG_PPC64
316 paca[cpu].__current = p; 319 paca[cpu].__current = p;
320#endif
317 current_set[cpu] = p->thread_info; 321 current_set[cpu] = p->thread_info;
322 p->thread_info->cpu = cpu;
318} 323}
319 324
320void __init smp_prepare_cpus(unsigned int max_cpus) 325void __init smp_prepare_cpus(unsigned int max_cpus)
@@ -333,18 +338,6 @@ void __init smp_prepare_cpus(unsigned int max_cpus)
333 smp_store_cpu_info(boot_cpuid); 338 smp_store_cpu_info(boot_cpuid);
334 cpu_callin_map[boot_cpuid] = 1; 339 cpu_callin_map[boot_cpuid] = 1;
335 340
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(); 341 max_cpus = smp_ops->probe();
349 342
350 smp_space_timers(max_cpus); 343 smp_space_timers(max_cpus);
@@ -359,8 +352,9 @@ void __devinit smp_prepare_boot_cpu(void)
359 BUG_ON(smp_processor_id() != boot_cpuid); 352 BUG_ON(smp_processor_id() != boot_cpuid);
360 353
361 cpu_set(boot_cpuid, cpu_online_map); 354 cpu_set(boot_cpuid, cpu_online_map);
362 355#ifdef CONFIG_PPC64
363 paca[boot_cpuid].__current = current; 356 paca[boot_cpuid].__current = current;
357#endif
364 current_set[boot_cpuid] = current->thread_info; 358 current_set[boot_cpuid] = current->thread_info;
365} 359}
366 360
@@ -444,13 +438,16 @@ int __devinit __cpu_up(unsigned int cpu)
444{ 438{
445 int c; 439 int c;
446 440
441 secondary_ti = current_set[cpu];
447 if (!cpu_enable(cpu)) 442 if (!cpu_enable(cpu))
448 return 0; 443 return 0;
449 444
450 if (smp_ops->cpu_bootable && !smp_ops->cpu_bootable(cpu)) 445 if (smp_ops->cpu_bootable && !smp_ops->cpu_bootable(cpu))
451 return -EINVAL; 446 return -EINVAL;
452 447
448#ifdef CONFIG_PPC64
453 paca[cpu].default_decr = tb_ticks_per_jiffy; 449 paca[cpu].default_decr = tb_ticks_per_jiffy;
450#endif
454 451
455 /* Make sure callin-map entry is 0 (can be leftover a CPU 452 /* Make sure callin-map entry is 0 (can be leftover a CPU
456 * hotplug 453 * hotplug
@@ -513,7 +510,7 @@ int __devinit start_secondary(void *unused)
513 current->active_mm = &init_mm; 510 current->active_mm = &init_mm;
514 511
515 smp_store_cpu_info(cpu); 512 smp_store_cpu_info(cpu);
516 set_dec(paca[cpu].default_decr); 513 set_dec(tb_ticks_per_jiffy);
517 cpu_callin_map[cpu] = 1; 514 cpu_callin_map[cpu] = 1;
518 515
519 smp_ops->setup_cpu(cpu); 516 smp_ops->setup_cpu(cpu);
diff --git a/arch/powerpc/kernel/time.c b/arch/powerpc/kernel/time.c
index 23436b6c1881..b1c89bc4bf90 100644
--- a/arch/powerpc/kernel/time.c
+++ b/arch/powerpc/kernel/time.c
@@ -66,9 +66,10 @@
66#include <asm/firmware.h> 66#include <asm/firmware.h>
67#endif 67#endif
68#ifdef CONFIG_PPC_ISERIES 68#ifdef CONFIG_PPC_ISERIES
69#include <asm/iSeries/ItLpQueue.h> 69#include <asm/iseries/it_lp_queue.h>
70#include <asm/iSeries/HvCallXm.h> 70#include <asm/iseries/hv_call_xm.h>
71#endif 71#endif
72#include <asm/smp.h>
72 73
73/* keep track of when we need to update the rtc */ 74/* keep track of when we need to update the rtc */
74time_t last_rtc_update; 75time_t last_rtc_update;
diff --git a/arch/powerpc/kernel/traps.c b/arch/powerpc/kernel/traps.c
index 5d638ecddbd0..07e5ee40b870 100644
--- a/arch/powerpc/kernel/traps.c
+++ b/arch/powerpc/kernel/traps.c
@@ -147,8 +147,8 @@ int die(const char *str, struct pt_regs *regs, long err)
147 printk("POWERMAC "); 147 printk("POWERMAC ");
148 nl = 1; 148 nl = 1;
149 break; 149 break;
150 case PLATFORM_BPA: 150 case PLATFORM_CELL:
151 printk("BPA "); 151 printk("CELL ");
152 nl = 1; 152 nl = 1;
153 break; 153 break;
154 } 154 }
@@ -749,22 +749,22 @@ static int check_bug_trap(struct pt_regs *regs)
749 if (bug->line & BUG_WARNING_TRAP) { 749 if (bug->line & BUG_WARNING_TRAP) {
750 /* this is a WARN_ON rather than BUG/BUG_ON */ 750 /* this is a WARN_ON rather than BUG/BUG_ON */
751#ifdef CONFIG_XMON 751#ifdef CONFIG_XMON
752 xmon_printf(KERN_ERR "Badness in %s at %s:%d\n", 752 xmon_printf(KERN_ERR "Badness in %s at %s:%ld\n",
753 bug->function, bug->file, 753 bug->function, bug->file,
754 bug->line & ~BUG_WARNING_TRAP); 754 bug->line & ~BUG_WARNING_TRAP);
755#endif /* CONFIG_XMON */ 755#endif /* CONFIG_XMON */
756 printk(KERN_ERR "Badness in %s at %s:%d\n", 756 printk(KERN_ERR "Badness in %s at %s:%ld\n",
757 bug->function, bug->file, 757 bug->function, bug->file,
758 bug->line & ~BUG_WARNING_TRAP); 758 bug->line & ~BUG_WARNING_TRAP);
759 dump_stack(); 759 dump_stack();
760 return 1; 760 return 1;
761 } 761 }
762#ifdef CONFIG_XMON 762#ifdef CONFIG_XMON
763 xmon_printf(KERN_CRIT "kernel BUG in %s at %s:%d!\n", 763 xmon_printf(KERN_CRIT "kernel BUG in %s at %s:%ld!\n",
764 bug->function, bug->file, bug->line); 764 bug->function, bug->file, bug->line);
765 xmon(regs); 765 xmon(regs);
766#endif /* CONFIG_XMON */ 766#endif /* CONFIG_XMON */
767 printk(KERN_CRIT "kernel BUG in %s at %s:%d!\n", 767 printk(KERN_CRIT "kernel BUG in %s at %s:%ld!\n",
768 bug->function, bug->file, bug->line); 768 bug->function, bug->file, bug->line);
769 769
770 return 0; 770 return 0;
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..2a912f411eb4 100644
--- a/arch/powerpc/lib/locks.c
+++ b/arch/powerpc/lib/locks.c
@@ -22,7 +22,7 @@
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 26
27void __spin_yield(raw_spinlock_t *lock) 27void __spin_yield(raw_spinlock_t *lock)
28{ 28{
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..f15dfb92dec0 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>
@@ -59,6 +60,15 @@
59#define DBG(fmt...) 60#define DBG(fmt...)
60#endif 61#endif
61 62
63#ifdef DEBUG_LOW
64#define DBG_LOW(fmt...) udbg_printf(fmt)
65#else
66#define DBG_LOW(fmt...)
67#endif
68
69#define KB (1024)
70#define MB (1024*KB)
71
62/* 72/*
63 * Note: pte --> Linux PTE 73 * Note: pte --> Linux PTE
64 * HPTE --> PowerPC Hashed Page Table Entry 74 * HPTE --> PowerPC Hashed Page Table Entry
@@ -77,91 +87,292 @@ extern unsigned long dart_tablebase;
77 87
78hpte_t *htab_address; 88hpte_t *htab_address;
79unsigned long htab_hash_mask; 89unsigned long htab_hash_mask;
80
81unsigned long _SDR1; 90unsigned long _SDR1;
91struct mmu_psize_def mmu_psize_defs[MMU_PAGE_COUNT];
92int mmu_linear_psize = MMU_PAGE_4K;
93int mmu_virtual_psize = MMU_PAGE_4K;
94#ifdef CONFIG_HUGETLB_PAGE
95int mmu_huge_psize = MMU_PAGE_16M;
96unsigned int HPAGE_SHIFT;
97#endif
82 98
83#define KB (1024) 99/* There are definitions of page sizes arrays to be used when none
84#define MB (1024*KB) 100 * is provided by the firmware.
85 101 */
86static inline void loop_forever(void)
87{
88 volatile unsigned long x = 1;
89 for(;x;x|=1)
90 ;
91}
92 102
93static inline void create_pte_mapping(unsigned long start, unsigned long end, 103/* Pre-POWER4 CPUs (4k pages only)
94 unsigned long mode, int large) 104 */
105struct mmu_psize_def mmu_psize_defaults_old[] = {
106 [MMU_PAGE_4K] = {
107 .shift = 12,
108 .sllp = 0,
109 .penc = 0,
110 .avpnm = 0,
111 .tlbiel = 0,
112 },
113};
114
115/* POWER4, GPUL, POWER5
116 *
117 * Support for 16Mb large pages
118 */
119struct mmu_psize_def mmu_psize_defaults_gp[] = {
120 [MMU_PAGE_4K] = {
121 .shift = 12,
122 .sllp = 0,
123 .penc = 0,
124 .avpnm = 0,
125 .tlbiel = 1,
126 },
127 [MMU_PAGE_16M] = {
128 .shift = 24,
129 .sllp = SLB_VSID_L,
130 .penc = 0,
131 .avpnm = 0x1UL,
132 .tlbiel = 0,
133 },
134};
135
136
137int htab_bolt_mapping(unsigned long vstart, unsigned long vend,
138 unsigned long pstart, unsigned long mode, int psize)
95{ 139{
96 unsigned long addr; 140 unsigned long vaddr, paddr;
97 unsigned int step; 141 unsigned int step, shift;
98 unsigned long tmp_mode; 142 unsigned long tmp_mode;
99 unsigned long vflags; 143 int ret = 0;
100 144
101 if (large) { 145 shift = mmu_psize_defs[psize].shift;
102 step = 16*MB; 146 step = 1 << shift;
103 vflags = HPTE_V_BOLTED | HPTE_V_LARGE;
104 } else {
105 step = 4*KB;
106 vflags = HPTE_V_BOLTED;
107 }
108 147
109 for (addr = start; addr < end; addr += step) { 148 for (vaddr = vstart, paddr = pstart; vaddr < vend;
149 vaddr += step, paddr += step) {
110 unsigned long vpn, hash, hpteg; 150 unsigned long vpn, hash, hpteg;
111 unsigned long vsid = get_kernel_vsid(addr); 151 unsigned long vsid = get_kernel_vsid(vaddr);
112 unsigned long va = (vsid << 28) | (addr & 0xfffffff); 152 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 153
154 vpn = va >> shift;
121 tmp_mode = mode; 155 tmp_mode = mode;
122 156
123 /* Make non-kernel text non-executable */ 157 /* Make non-kernel text non-executable */
124 if (!in_kernel_text(addr)) 158 if (!in_kernel_text(vaddr))
125 tmp_mode = mode | HW_NO_EXEC; 159 tmp_mode = mode | HPTE_R_N;
126
127 hash = hpt_hash(vpn, large);
128 160
161 hash = hpt_hash(va, shift);
129 hpteg = ((hash & htab_hash_mask) * HPTES_PER_GROUP); 162 hpteg = ((hash & htab_hash_mask) * HPTES_PER_GROUP);
130 163
164 /* The crap below can be cleaned once ppd_md.probe() can
165 * set up the hash callbacks, thus we can just used the
166 * normal insert callback here.
167 */
131#ifdef CONFIG_PPC_ISERIES 168#ifdef CONFIG_PPC_ISERIES
132 if (systemcfg->platform & PLATFORM_ISERIES_LPAR) 169 if (systemcfg->platform == PLATFORM_ISERIES_LPAR)
133 ret = iSeries_hpte_bolt_or_insert(hpteg, va, 170 ret = iSeries_hpte_insert(hpteg, va,
134 virt_to_abs(addr) >> PAGE_SHIFT, 171 virt_to_abs(paddr),
135 vflags, tmp_mode); 172 tmp_mode,
173 HPTE_V_BOLTED,
174 psize);
136 else 175 else
137#endif 176#endif
138#ifdef CONFIG_PPC_PSERIES 177#ifdef CONFIG_PPC_PSERIES
139 if (systemcfg->platform & PLATFORM_LPAR) 178 if (systemcfg->platform & PLATFORM_LPAR)
140 ret = pSeries_lpar_hpte_insert(hpteg, va, 179 ret = pSeries_lpar_hpte_insert(hpteg, va,
141 virt_to_abs(addr) >> PAGE_SHIFT, 180 virt_to_abs(paddr),
142 vflags, tmp_mode); 181 tmp_mode,
182 HPTE_V_BOLTED,
183 psize);
143 else 184 else
144#endif 185#endif
145#ifdef CONFIG_PPC_MULTIPLATFORM 186#ifdef CONFIG_PPC_MULTIPLATFORM
146 ret = native_hpte_insert(hpteg, va, 187 ret = native_hpte_insert(hpteg, va,
147 virt_to_abs(addr) >> PAGE_SHIFT, 188 virt_to_abs(paddr),
148 vflags, tmp_mode); 189 tmp_mode, HPTE_V_BOLTED,
190 psize);
149#endif 191#endif
192 if (ret < 0)
193 break;
194 }
195 return ret < 0 ? ret : 0;
196}
150 197
151 if (ret == -1) { 198static int __init htab_dt_scan_page_sizes(unsigned long node,
152 ppc64_terminate_msg(0x20, "create_pte_mapping"); 199 const char *uname, int depth,
153 loop_forever(); 200 void *data)
201{
202 char *type = of_get_flat_dt_prop(node, "device_type", NULL);
203 u32 *prop;
204 unsigned long size = 0;
205
206 /* We are scanning "cpu" nodes only */
207 if (type == NULL || strcmp(type, "cpu") != 0)
208 return 0;
209
210 prop = (u32 *)of_get_flat_dt_prop(node,
211 "ibm,segment-page-sizes", &size);
212 if (prop != NULL) {
213 DBG("Page sizes from device-tree:\n");
214 size /= 4;
215 cur_cpu_spec->cpu_features &= ~(CPU_FTR_16M_PAGE);
216 while(size > 0) {
217 unsigned int shift = prop[0];
218 unsigned int slbenc = prop[1];
219 unsigned int lpnum = prop[2];
220 unsigned int lpenc = 0;
221 struct mmu_psize_def *def;
222 int idx = -1;
223
224 size -= 3; prop += 3;
225 while(size > 0 && lpnum) {
226 if (prop[0] == shift)
227 lpenc = prop[1];
228 prop += 2; size -= 2;
229 lpnum--;
230 }
231 switch(shift) {
232 case 0xc:
233 idx = MMU_PAGE_4K;
234 break;
235 case 0x10:
236 idx = MMU_PAGE_64K;
237 break;
238 case 0x14:
239 idx = MMU_PAGE_1M;
240 break;
241 case 0x18:
242 idx = MMU_PAGE_16M;
243 cur_cpu_spec->cpu_features |= CPU_FTR_16M_PAGE;
244 break;
245 case 0x22:
246 idx = MMU_PAGE_16G;
247 break;
248 }
249 if (idx < 0)
250 continue;
251 def = &mmu_psize_defs[idx];
252 def->shift = shift;
253 if (shift <= 23)
254 def->avpnm = 0;
255 else
256 def->avpnm = (1 << (shift - 23)) - 1;
257 def->sllp = slbenc;
258 def->penc = lpenc;
259 /* We don't know for sure what's up with tlbiel, so
260 * for now we only set it for 4K and 64K pages
261 */
262 if (idx == MMU_PAGE_4K || idx == MMU_PAGE_64K)
263 def->tlbiel = 1;
264 else
265 def->tlbiel = 0;
266
267 DBG(" %d: shift=%02x, sllp=%04x, avpnm=%08x, "
268 "tlbiel=%d, penc=%d\n",
269 idx, shift, def->sllp, def->avpnm, def->tlbiel,
270 def->penc);
154 } 271 }
272 return 1;
273 }
274 return 0;
275}
276
277
278static void __init htab_init_page_sizes(void)
279{
280 int rc;
281
282 /* Default to 4K pages only */
283 memcpy(mmu_psize_defs, mmu_psize_defaults_old,
284 sizeof(mmu_psize_defaults_old));
285
286 /*
287 * Try to find the available page sizes in the device-tree
288 */
289 rc = of_scan_flat_dt(htab_dt_scan_page_sizes, NULL);
290 if (rc != 0) /* Found */
291 goto found;
292
293 /*
294 * Not in the device-tree, let's fallback on known size
295 * list for 16M capable GP & GR
296 */
297 if ((systemcfg->platform != PLATFORM_ISERIES_LPAR) &&
298 cpu_has_feature(CPU_FTR_16M_PAGE))
299 memcpy(mmu_psize_defs, mmu_psize_defaults_gp,
300 sizeof(mmu_psize_defaults_gp));
301 found:
302 /*
303 * Pick a size for the linear mapping. Currently, we only support
304 * 16M, 1M and 4K which is the default
305 */
306 if (mmu_psize_defs[MMU_PAGE_16M].shift)
307 mmu_linear_psize = MMU_PAGE_16M;
308 else if (mmu_psize_defs[MMU_PAGE_1M].shift)
309 mmu_linear_psize = MMU_PAGE_1M;
310
311 /*
312 * Pick a size for the ordinary pages. Default is 4K, we support
313 * 64K if cache inhibited large pages are supported by the
314 * processor
315 */
316#ifdef CONFIG_PPC_64K_PAGES
317 if (mmu_psize_defs[MMU_PAGE_64K].shift &&
318 cpu_has_feature(CPU_FTR_CI_LARGE_PAGE))
319 mmu_virtual_psize = MMU_PAGE_64K;
320#endif
321
322 printk(KERN_INFO "Page orders: linear mapping = %d, others = %d\n",
323 mmu_psize_defs[mmu_linear_psize].shift,
324 mmu_psize_defs[mmu_virtual_psize].shift);
325
326#ifdef CONFIG_HUGETLB_PAGE
327 /* Init large page size. Currently, we pick 16M or 1M depending
328 * on what is available
329 */
330 if (mmu_psize_defs[MMU_PAGE_16M].shift)
331 mmu_huge_psize = MMU_PAGE_16M;
332 /* With 4k/4level pagetables, we can't (for now) cope with a
333 * huge page size < PMD_SIZE */
334 else if (mmu_psize_defs[MMU_PAGE_1M].shift)
335 mmu_huge_psize = MMU_PAGE_1M;
336
337 /* Calculate HPAGE_SHIFT and sanity check it */
338 if (mmu_psize_defs[mmu_huge_psize].shift > MIN_HUGEPTE_SHIFT &&
339 mmu_psize_defs[mmu_huge_psize].shift < SID_SHIFT)
340 HPAGE_SHIFT = mmu_psize_defs[mmu_huge_psize].shift;
341 else
342 HPAGE_SHIFT = 0; /* No huge pages dude ! */
343#endif /* CONFIG_HUGETLB_PAGE */
344}
345
346static int __init htab_dt_scan_pftsize(unsigned long node,
347 const char *uname, int depth,
348 void *data)
349{
350 char *type = of_get_flat_dt_prop(node, "device_type", NULL);
351 u32 *prop;
352
353 /* We are scanning "cpu" nodes only */
354 if (type == NULL || strcmp(type, "cpu") != 0)
355 return 0;
356
357 prop = (u32 *)of_get_flat_dt_prop(node, "ibm,pft-size", NULL);
358 if (prop != NULL) {
359 /* pft_size[0] is the NUMA CEC cookie */
360 ppc64_pft_size = prop[1];
361 return 1;
155 } 362 }
363 return 0;
156} 364}
157 365
158static unsigned long get_hashtable_size(void) 366static unsigned long __init htab_get_table_size(void)
159{ 367{
160 unsigned long rnd_mem_size, pteg_count; 368 unsigned long rnd_mem_size, pteg_count;
161 369
162 /* If hash size wasn't obtained in prom.c, we calculate it now based on 370 /* If hash size isn't already provided by the platform, we try to
163 * the total RAM size 371 * retreive it from the device-tree. If it's not there neither, we
372 * calculate it now based on the total RAM size
164 */ 373 */
374 if (ppc64_pft_size == 0)
375 of_scan_flat_dt(htab_dt_scan_pftsize, NULL);
165 if (ppc64_pft_size) 376 if (ppc64_pft_size)
166 return 1UL << ppc64_pft_size; 377 return 1UL << ppc64_pft_size;
167 378
@@ -181,17 +392,21 @@ void __init htab_initialize(void)
181 unsigned long table, htab_size_bytes; 392 unsigned long table, htab_size_bytes;
182 unsigned long pteg_count; 393 unsigned long pteg_count;
183 unsigned long mode_rw; 394 unsigned long mode_rw;
184 int i, use_largepages = 0;
185 unsigned long base = 0, size = 0; 395 unsigned long base = 0, size = 0;
396 int i;
397
186 extern unsigned long tce_alloc_start, tce_alloc_end; 398 extern unsigned long tce_alloc_start, tce_alloc_end;
187 399
188 DBG(" -> htab_initialize()\n"); 400 DBG(" -> htab_initialize()\n");
189 401
402 /* Initialize page sizes */
403 htab_init_page_sizes();
404
190 /* 405 /*
191 * Calculate the required size of the htab. We want the number of 406 * Calculate the required size of the htab. We want the number of
192 * PTEGs to equal one half the number of real pages. 407 * PTEGs to equal one half the number of real pages.
193 */ 408 */
194 htab_size_bytes = get_hashtable_size(); 409 htab_size_bytes = htab_get_table_size();
195 pteg_count = htab_size_bytes >> 7; 410 pteg_count = htab_size_bytes >> 7;
196 411
197 /* For debug, make the HTAB 1/8 as big as it normally would be. */ 412 /* For debug, make the HTAB 1/8 as big as it normally would be. */
@@ -211,14 +426,11 @@ void __init htab_initialize(void)
211 * the absolute address space. 426 * the absolute address space.
212 */ 427 */
213 table = lmb_alloc(htab_size_bytes, htab_size_bytes); 428 table = lmb_alloc(htab_size_bytes, htab_size_bytes);
429 BUG_ON(table == 0);
214 430
215 DBG("Hash table allocated at %lx, size: %lx\n", table, 431 DBG("Hash table allocated at %lx, size: %lx\n", table,
216 htab_size_bytes); 432 htab_size_bytes);
217 433
218 if ( !table ) {
219 ppc64_terminate_msg(0x20, "hpt space");
220 loop_forever();
221 }
222 htab_address = abs_to_virt(table); 434 htab_address = abs_to_virt(table);
223 435
224 /* htab absolute addr + encoded htabsize */ 436 /* htab absolute addr + encoded htabsize */
@@ -234,8 +446,6 @@ void __init htab_initialize(void)
234 * _NOT_ map it to avoid cache paradoxes as it's remapped non 446 * _NOT_ map it to avoid cache paradoxes as it's remapped non
235 * cacheable later on 447 * cacheable later on
236 */ 448 */
237 if (cpu_has_feature(CPU_FTR_16M_PAGE))
238 use_largepages = 1;
239 449
240 /* create bolted the linear mapping in the hash table */ 450 /* create bolted the linear mapping in the hash table */
241 for (i=0; i < lmb.memory.cnt; i++) { 451 for (i=0; i < lmb.memory.cnt; i++) {
@@ -246,27 +456,32 @@ void __init htab_initialize(void)
246 456
247#ifdef CONFIG_U3_DART 457#ifdef CONFIG_U3_DART
248 /* Do not map the DART space. Fortunately, it will be aligned 458 /* 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 459 * in such a way that it will not cross two lmb regions and
250 * fit within a single 16Mb page. 460 * will fit within a single 16Mb page.
251 * The DART space is assumed to be a full 16Mb region even if we 461 * 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 462 * 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. 463 * for AGP GART. We have to use a full 16Mb large page.
254 */ 464 */
255 DBG("DART base: %lx\n", dart_tablebase); 465 DBG("DART base: %lx\n", dart_tablebase);
256 466
257 if (dart_tablebase != 0 && dart_tablebase >= base 467 if (dart_tablebase != 0 && dart_tablebase >= base
258 && dart_tablebase < (base + size)) { 468 && dart_tablebase < (base + size)) {
259 if (base != dart_tablebase) 469 if (base != dart_tablebase)
260 create_pte_mapping(base, dart_tablebase, mode_rw, 470 BUG_ON(htab_bolt_mapping(base, dart_tablebase,
261 use_largepages); 471 base, mode_rw,
472 mmu_linear_psize));
262 if ((base + size) > (dart_tablebase + 16*MB)) 473 if ((base + size) > (dart_tablebase + 16*MB))
263 create_pte_mapping(dart_tablebase + 16*MB, base + size, 474 BUG_ON(htab_bolt_mapping(dart_tablebase+16*MB,
264 mode_rw, use_largepages); 475 base + size,
476 dart_tablebase+16*MB,
477 mode_rw,
478 mmu_linear_psize));
265 continue; 479 continue;
266 } 480 }
267#endif /* CONFIG_U3_DART */ 481#endif /* CONFIG_U3_DART */
268 create_pte_mapping(base, base + size, mode_rw, use_largepages); 482 BUG_ON(htab_bolt_mapping(base, base + size, base,
269 } 483 mode_rw, mmu_linear_psize));
484 }
270 485
271 /* 486 /*
272 * If we have a memory_limit and we've allocated TCEs then we need to 487 * If we have a memory_limit and we've allocated TCEs then we need to
@@ -282,8 +497,9 @@ void __init htab_initialize(void)
282 if (base + size >= tce_alloc_start) 497 if (base + size >= tce_alloc_start)
283 tce_alloc_start = base + size + 1; 498 tce_alloc_start = base + size + 1;
284 499
285 create_pte_mapping(tce_alloc_start, tce_alloc_end, 500 BUG_ON(htab_bolt_mapping(tce_alloc_start, tce_alloc_end,
286 mode_rw, use_largepages); 501 tce_alloc_start, mode_rw,
502 mmu_linear_psize));
287 } 503 }
288 504
289 DBG(" <- htab_initialize()\n"); 505 DBG(" <- htab_initialize()\n");
@@ -298,9 +514,6 @@ unsigned int hash_page_do_lazy_icache(unsigned int pp, pte_t pte, int trap)
298{ 514{
299 struct page *page; 515 struct page *page;
300 516
301 if (!pfn_valid(pte_pfn(pte)))
302 return pp;
303
304 page = pte_page(pte); 517 page = pte_page(pte);
305 518
306 /* page is dirty */ 519 /* page is dirty */
@@ -309,7 +522,7 @@ unsigned int hash_page_do_lazy_icache(unsigned int pp, pte_t pte, int trap)
309 __flush_dcache_icache(page_address(page)); 522 __flush_dcache_icache(page_address(page));
310 set_bit(PG_arch_1, &page->flags); 523 set_bit(PG_arch_1, &page->flags);
311 } else 524 } else
312 pp |= HW_NO_EXEC; 525 pp |= HPTE_R_N;
313 } 526 }
314 return pp; 527 return pp;
315} 528}
@@ -325,94 +538,169 @@ int hash_page(unsigned long ea, unsigned long access, unsigned long trap)
325 unsigned long vsid; 538 unsigned long vsid;
326 struct mm_struct *mm; 539 struct mm_struct *mm;
327 pte_t *ptep; 540 pte_t *ptep;
328 int ret;
329 int user_region = 0;
330 int local = 0;
331 cpumask_t tmp; 541 cpumask_t tmp;
542 int rc, user_region = 0, local = 0;
332 543
333 if ((ea & ~REGION_MASK) >= PGTABLE_RANGE) 544 DBG_LOW("hash_page(ea=%016lx, access=%lx, trap=%lx\n",
334 return 1; 545 ea, access, trap);
335 546
547 if ((ea & ~REGION_MASK) >= PGTABLE_RANGE) {
548 DBG_LOW(" out of pgtable range !\n");
549 return 1;
550 }
551
552 /* Get region & vsid */
336 switch (REGION_ID(ea)) { 553 switch (REGION_ID(ea)) {
337 case USER_REGION_ID: 554 case USER_REGION_ID:
338 user_region = 1; 555 user_region = 1;
339 mm = current->mm; 556 mm = current->mm;
340 if (! mm) 557 if (! mm) {
558 DBG_LOW(" user region with no mm !\n");
341 return 1; 559 return 1;
342 560 }
343 vsid = get_vsid(mm->context.id, ea); 561 vsid = get_vsid(mm->context.id, ea);
344 break; 562 break;
345 case VMALLOC_REGION_ID: 563 case VMALLOC_REGION_ID:
346 mm = &init_mm; 564 mm = &init_mm;
347 vsid = get_kernel_vsid(ea); 565 vsid = get_kernel_vsid(ea);
348 break; 566 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: 567 default:
357 /* Not a valid range 568 /* Not a valid range
358 * Send the problem up to do_page_fault 569 * Send the problem up to do_page_fault
359 */ 570 */
360 return 1; 571 return 1;
361 break;
362 } 572 }
573 DBG_LOW(" mm=%p, mm->pgdir=%p, vsid=%016lx\n", mm, mm->pgd, vsid);
363 574
575 /* Get pgdir */
364 pgdir = mm->pgd; 576 pgdir = mm->pgd;
365
366 if (pgdir == NULL) 577 if (pgdir == NULL)
367 return 1; 578 return 1;
368 579
580 /* Check CPU locality */
369 tmp = cpumask_of_cpu(smp_processor_id()); 581 tmp = cpumask_of_cpu(smp_processor_id());
370 if (user_region && cpus_equal(mm->cpu_vm_mask, tmp)) 582 if (user_region && cpus_equal(mm->cpu_vm_mask, tmp))
371 local = 1; 583 local = 1;
372 584
373 /* Is this a huge page ? */ 585 /* Handle hugepage regions */
374 if (unlikely(in_hugepage_area(mm->context, ea))) 586 if (unlikely(in_hugepage_area(mm->context, ea))) {
375 ret = hash_huge_page(mm, access, ea, vsid, local); 587 DBG_LOW(" -> huge page !\n");
376 else { 588 return hash_huge_page(mm, access, ea, vsid, local);
377 ptep = find_linux_pte(pgdir, ea); 589 }
378 if (ptep == NULL) 590
379 return 1; 591 /* Get PTE and page size from page tables */
380 ret = __hash_page(ea, access, vsid, ptep, trap, local); 592 ptep = find_linux_pte(pgdir, ea);
593 if (ptep == NULL || !pte_present(*ptep)) {
594 DBG_LOW(" no PTE !\n");
595 return 1;
596 }
597
598#ifndef CONFIG_PPC_64K_PAGES
599 DBG_LOW(" i-pte: %016lx\n", pte_val(*ptep));
600#else
601 DBG_LOW(" i-pte: %016lx %016lx\n", pte_val(*ptep),
602 pte_val(*(ptep + PTRS_PER_PTE)));
603#endif
604 /* Pre-check access permissions (will be re-checked atomically
605 * in __hash_page_XX but this pre-check is a fast path
606 */
607 if (access & ~pte_val(*ptep)) {
608 DBG_LOW(" no access !\n");
609 return 1;
381 } 610 }
382 611
383 return ret; 612 /* Do actual hashing */
613#ifndef CONFIG_PPC_64K_PAGES
614 rc = __hash_page_4K(ea, access, vsid, ptep, trap, local);
615#else
616 if (mmu_virtual_psize == MMU_PAGE_64K)
617 rc = __hash_page_64K(ea, access, vsid, ptep, trap, local);
618 else
619 rc = __hash_page_4K(ea, access, vsid, ptep, trap, local);
620#endif /* CONFIG_PPC_64K_PAGES */
621
622#ifndef CONFIG_PPC_64K_PAGES
623 DBG_LOW(" o-pte: %016lx\n", pte_val(*ptep));
624#else
625 DBG_LOW(" o-pte: %016lx %016lx\n", pte_val(*ptep),
626 pte_val(*(ptep + PTRS_PER_PTE)));
627#endif
628 DBG_LOW(" -> rc=%d\n", rc);
629 return rc;
384} 630}
385 631
386void flush_hash_page(unsigned long va, pte_t pte, int local) 632void hash_preload(struct mm_struct *mm, unsigned long ea,
633 unsigned long access, unsigned long trap)
387{ 634{
388 unsigned long vpn, hash, secondary, slot; 635 unsigned long vsid;
389 unsigned long huge = pte_huge(pte); 636 void *pgdir;
637 pte_t *ptep;
638 cpumask_t mask;
639 unsigned long flags;
640 int local = 0;
641
642 /* We don't want huge pages prefaulted for now
643 */
644 if (unlikely(in_hugepage_area(mm->context, ea)))
645 return;
646
647 DBG_LOW("hash_preload(mm=%p, mm->pgdir=%p, ea=%016lx, access=%lx,"
648 " trap=%lx\n", mm, mm->pgd, ea, access, trap);
390 649
391 if (huge) 650 /* Get PTE, VSID, access mask */
392 vpn = va >> HPAGE_SHIFT; 651 pgdir = mm->pgd;
652 if (pgdir == NULL)
653 return;
654 ptep = find_linux_pte(pgdir, ea);
655 if (!ptep)
656 return;
657 vsid = get_vsid(mm->context.id, ea);
658
659 /* Hash it in */
660 local_irq_save(flags);
661 mask = cpumask_of_cpu(smp_processor_id());
662 if (cpus_equal(mm->cpu_vm_mask, mask))
663 local = 1;
664#ifndef CONFIG_PPC_64K_PAGES
665 __hash_page_4K(ea, access, vsid, ptep, trap, local);
666#else
667 if (mmu_virtual_psize == MMU_PAGE_64K)
668 __hash_page_64K(ea, access, vsid, ptep, trap, local);
393 else 669 else
394 vpn = va >> PAGE_SHIFT; 670 __hash_page_4K(ea, access, vsid, ptep, trap, local);
395 hash = hpt_hash(vpn, huge); 671#endif /* CONFIG_PPC_64K_PAGES */
396 secondary = (pte_val(pte) & _PAGE_SECONDARY) >> 15; 672 local_irq_restore(flags);
397 if (secondary) 673}
398 hash = ~hash; 674
399 slot = (hash & htab_hash_mask) * HPTES_PER_GROUP; 675void flush_hash_page(unsigned long va, real_pte_t pte, int psize, int local)
400 slot += (pte_val(pte) & _PAGE_GROUP_IX) >> 12; 676{
401 677 unsigned long hash, index, shift, hidx, slot;
402 ppc_md.hpte_invalidate(slot, va, huge, local); 678
679 DBG_LOW("flush_hash_page(va=%016x)\n", va);
680 pte_iterate_hashed_subpages(pte, psize, va, index, shift) {
681 hash = hpt_hash(va, shift);
682 hidx = __rpte_to_hidx(pte, index);
683 if (hidx & _PTEIDX_SECONDARY)
684 hash = ~hash;
685 slot = (hash & htab_hash_mask) * HPTES_PER_GROUP;
686 slot += hidx & _PTEIDX_GROUP_IX;
687 DBG_LOW(" sub %d: hash=%x, hidx=%x\n", index, slot, hidx);
688 ppc_md.hpte_invalidate(slot, va, psize, local);
689 } pte_iterate_hashed_end();
403} 690}
404 691
405void flush_hash_range(unsigned long number, int local) 692void flush_hash_range(unsigned long number, int local)
406{ 693{
407 if (ppc_md.flush_hash_range) { 694 if (ppc_md.flush_hash_range)
408 ppc_md.flush_hash_range(number, local); 695 ppc_md.flush_hash_range(number, local);
409 } else { 696 else {
410 int i; 697 int i;
411 struct ppc64_tlb_batch *batch = 698 struct ppc64_tlb_batch *batch =
412 &__get_cpu_var(ppc64_tlb_batch); 699 &__get_cpu_var(ppc64_tlb_batch);
413 700
414 for (i = 0; i < number; i++) 701 for (i = 0; i < number; i++)
415 flush_hash_page(batch->vaddr[i], batch->pte[i], local); 702 flush_hash_page(batch->vaddr[i], batch->pte[i],
703 batch->psize, local);
416 } 704 }
417} 705}
418 706
@@ -452,6 +740,18 @@ void __init htab_finish_init(void)
452 extern unsigned int *htab_call_hpte_remove; 740 extern unsigned int *htab_call_hpte_remove;
453 extern unsigned int *htab_call_hpte_updatepp; 741 extern unsigned int *htab_call_hpte_updatepp;
454 742
743#ifdef CONFIG_PPC_64K_PAGES
744 extern unsigned int *ht64_call_hpte_insert1;
745 extern unsigned int *ht64_call_hpte_insert2;
746 extern unsigned int *ht64_call_hpte_remove;
747 extern unsigned int *ht64_call_hpte_updatepp;
748
749 make_bl(ht64_call_hpte_insert1, ppc_md.hpte_insert);
750 make_bl(ht64_call_hpte_insert2, ppc_md.hpte_insert);
751 make_bl(ht64_call_hpte_remove, ppc_md.hpte_remove);
752 make_bl(ht64_call_hpte_updatepp, ppc_md.hpte_updatepp);
753#endif /* CONFIG_PPC_64K_PAGES */
754
455 make_bl(htab_call_hpte_insert1, ppc_md.hpte_insert); 755 make_bl(htab_call_hpte_insert1, ppc_md.hpte_insert);
456 make_bl(htab_call_hpte_insert2, ppc_md.hpte_insert); 756 make_bl(htab_call_hpte_insert2, ppc_md.hpte_insert);
457 make_bl(htab_call_hpte_remove, ppc_md.hpte_remove); 757 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..dfe7fa37b41a 100644
--- a/arch/powerpc/mm/init_64.c
+++ b/arch/powerpc/mm/init_64.c
@@ -188,12 +188,21 @@ static void zero_ctor(void *addr, kmem_cache_t *cache, unsigned long flags)
188 memset(addr, 0, kmem_cache_size(cache)); 188 memset(addr, 0, kmem_cache_size(cache));
189} 189}
190 190
191#ifdef CONFIG_PPC_64K_PAGES
192static const int pgtable_cache_size[2] = {
193 PTE_TABLE_SIZE, PGD_TABLE_SIZE
194};
195static const char *pgtable_cache_name[ARRAY_SIZE(pgtable_cache_size)] = {
196 "pte_pmd_cache", "pgd_cache",
197};
198#else
191static const int pgtable_cache_size[2] = { 199static const int pgtable_cache_size[2] = {
192 PTE_TABLE_SIZE, PMD_TABLE_SIZE 200 PTE_TABLE_SIZE, PMD_TABLE_SIZE
193}; 201};
194static const char *pgtable_cache_name[ARRAY_SIZE(pgtable_cache_size)] = { 202static const char *pgtable_cache_name[ARRAY_SIZE(pgtable_cache_size)] = {
195 "pgd_pte_cache", "pud_pmd_cache", 203 "pgd_pte_cache", "pud_pmd_cache",
196}; 204};
205#endif /* CONFIG_PPC_64K_PAGES */
197 206
198kmem_cache_t *pgtable_cache[ARRAY_SIZE(pgtable_cache_size)]; 207kmem_cache_t *pgtable_cache[ARRAY_SIZE(pgtable_cache_size)];
199 208
@@ -201,19 +210,14 @@ void pgtable_cache_init(void)
201{ 210{
202 int i; 211 int i;
203 212
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++) { 213 for (i = 0; i < ARRAY_SIZE(pgtable_cache_size); i++) {
210 int size = pgtable_cache_size[i]; 214 int size = pgtable_cache_size[i];
211 const char *name = pgtable_cache_name[i]; 215 const char *name = pgtable_cache_name[i];
212 216
213 pgtable_cache[i] = kmem_cache_create(name, 217 pgtable_cache[i] = kmem_cache_create(name,
214 size, size, 218 size, size,
215 SLAB_HWCACHE_ALIGN 219 SLAB_HWCACHE_ALIGN |
216 | SLAB_MUST_HWCACHE_ALIGN, 220 SLAB_MUST_HWCACHE_ALIGN,
217 zero_ctor, 221 zero_ctor,
218 NULL); 222 NULL);
219 if (! pgtable_cache[i]) 223 if (! pgtable_cache[i])
diff --git a/arch/powerpc/mm/mem.c b/arch/powerpc/mm/mem.c
index 117b00012e14..7faa46b71f21 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
@@ -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/pgtable_64.c b/arch/powerpc/mm/pgtable_64.c
index b79a78206135..51b786940971 100644
--- a/arch/powerpc/mm/pgtable_64.c
+++ b/arch/powerpc/mm/pgtable_64.c
@@ -101,7 +101,6 @@ static int map_io_page(unsigned long ea, unsigned long pa, int flags)
101 pud_t *pudp; 101 pud_t *pudp;
102 pmd_t *pmdp; 102 pmd_t *pmdp;
103 pte_t *ptep; 103 pte_t *ptep;
104 unsigned long vsid;
105 104
106 if (mem_init_done) { 105 if (mem_init_done) {
107 pgdp = pgd_offset_k(ea); 106 pgdp = pgd_offset_k(ea);
@@ -117,28 +116,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, 116 set_pte_at(&init_mm, ea, ptep, pfn_pte(pa >> PAGE_SHIFT,
118 __pgprot(flags))); 117 __pgprot(flags)));
119 } else { 118 } else {
120 unsigned long va, vpn, hash, hpteg;
121
122 /* 119 /*
123 * If the mm subsystem is not fully up, we cannot create a 120 * If the mm subsystem is not fully up, we cannot create a
124 * linux page table entry for this mapping. Simply bolt an 121 * linux page table entry for this mapping. Simply bolt an
125 * entry in the hardware page table. 122 * entry in the hardware page table.
123 *
126 */ 124 */
127 vsid = get_kernel_vsid(ea); 125 if (htab_bolt_mapping(ea, ea + PAGE_SIZE, pa, flags,
128 va = (vsid << 28) | (ea & 0xFFFFFFF); 126 mmu_virtual_psize))
129 vpn = va >> PAGE_SHIFT; 127 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 } 128 }
143 return 0; 129 return 0;
144} 130}
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/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..c1135912cc05 100644
--- a/arch/powerpc/platforms/iseries/irq.c
+++ b/arch/powerpc/platforms/iseries/irq.c
@@ -36,9 +36,9 @@
36#include <linux/spinlock.h> 36#include <linux/spinlock.h>
37 37
38#include <asm/ppcdebug.h> 38#include <asm/ppcdebug.h>
39#include <asm/iSeries/HvTypes.h> 39#include <asm/iseries/hv_types.h>
40#include <asm/iSeries/HvLpEvent.h> 40#include <asm/iseries/hv_lp_event.h>
41#include <asm/iSeries/HvCallXm.h> 41#include <asm/iseries/hv_call_xm.h>
42 42
43#include "irq.h" 43#include "irq.h"
44#include "call_pci.h" 44#include "call_pci.h"
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..7d7d5884343f 100644
--- a/arch/powerpc/platforms/iseries/pci.c
+++ b/arch/powerpc/platforms/iseries/pci.c
@@ -36,8 +36,8 @@
36#include <asm/iommu.h> 36#include <asm/iommu.h>
37#include <asm/abs_addr.h> 37#include <asm/abs_addr.h>
38 38
39#include <asm/iSeries/HvCallXm.h> 39#include <asm/iseries/hv_call_xm.h>
40#include <asm/iSeries/mf.h> 40#include <asm/iseries/mf.h>
41 41
42#include <asm/ppc-pci.h> 42#include <asm/ppc-pci.h>
43 43
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..c5207064977d 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"
@@ -94,6 +95,8 @@ extern unsigned long iSeries_recal_titan;
94 95
95static int mf_initialized; 96static int mf_initialized;
96 97
98static unsigned long cmd_mem_limit;
99
97struct MemoryBlock { 100struct MemoryBlock {
98 unsigned long absStart; 101 unsigned long absStart;
99 unsigned long absEnd; 102 unsigned long absEnd;
@@ -317,11 +320,11 @@ static void __init iSeries_init_early(void)
317 */ 320 */
318 if (naca.xRamDisk) { 321 if (naca.xRamDisk) {
319 initrd_start = (unsigned long)__va(naca.xRamDisk); 322 initrd_start = (unsigned long)__va(naca.xRamDisk);
320 initrd_end = initrd_start + naca.xRamDiskSize * PAGE_SIZE; 323 initrd_end = initrd_start + naca.xRamDiskSize * HW_PAGE_SIZE;
321 initrd_below_start_ok = 1; // ramdisk in kernel space 324 initrd_below_start_ok = 1; // ramdisk in kernel space
322 ROOT_DEV = Root_RAM0; 325 ROOT_DEV = Root_RAM0;
323 if (((rd_size * 1024) / PAGE_SIZE) < naca.xRamDiskSize) 326 if (((rd_size * 1024) / HW_PAGE_SIZE) < naca.xRamDiskSize)
324 rd_size = (naca.xRamDiskSize * PAGE_SIZE) / 1024; 327 rd_size = (naca.xRamDiskSize * HW_PAGE_SIZE) / 1024;
325 } else 328 } else
326#endif /* CONFIG_BLK_DEV_INITRD */ 329#endif /* CONFIG_BLK_DEV_INITRD */
327 { 330 {
@@ -341,23 +344,6 @@ static void __init iSeries_init_early(void)
341 */ 344 */
342 iommu_init_early_iSeries(); 345 iommu_init_early_iSeries();
343 346
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 */ 347 /* Initialize machine-dependency vectors */
362#ifdef CONFIG_SMP 348#ifdef CONFIG_SMP
363 smp_init_iSeries(); 349 smp_init_iSeries();
@@ -484,13 +470,14 @@ static void __init build_iSeries_Memory_Map(void)
484 */ 470 */
485 hptFirstChunk = (u32)addr_to_chunk(HvCallHpt_getHptAddress()); 471 hptFirstChunk = (u32)addr_to_chunk(HvCallHpt_getHptAddress());
486 hptSizePages = (u32)HvCallHpt_getHptPages(); 472 hptSizePages = (u32)HvCallHpt_getHptPages();
487 hptSizeChunks = hptSizePages >> (MSCHUNKS_CHUNK_SHIFT - PAGE_SHIFT); 473 hptSizeChunks = hptSizePages >>
474 (MSCHUNKS_CHUNK_SHIFT - HW_PAGE_SHIFT);
488 hptLastChunk = hptFirstChunk + hptSizeChunks - 1; 475 hptLastChunk = hptFirstChunk + hptSizeChunks - 1;
489 476
490 printk("HPT absolute addr = %016lx, size = %dK\n", 477 printk("HPT absolute addr = %016lx, size = %dK\n",
491 chunk_to_addr(hptFirstChunk), hptSizeChunks * 256); 478 chunk_to_addr(hptFirstChunk), hptSizeChunks * 256);
492 479
493 ppc64_pft_size = __ilog2(hptSizePages * PAGE_SIZE); 480 ppc64_pft_size = __ilog2(hptSizePages * HW_PAGE_SIZE);
494 481
495 /* 482 /*
496 * The actual hashed page table is in the hypervisor, 483 * The actual hashed page table is in the hypervisor,
@@ -643,7 +630,7 @@ static void __init iSeries_fixup_klimit(void)
643 */ 630 */
644 if (naca.xRamDisk) 631 if (naca.xRamDisk)
645 klimit = KERNELBASE + (u64)naca.xRamDisk + 632 klimit = KERNELBASE + (u64)naca.xRamDisk +
646 (naca.xRamDiskSize * PAGE_SIZE); 633 (naca.xRamDiskSize * HW_PAGE_SIZE);
647 else { 634 else {
648 /* 635 /*
649 * No ram disk was included - check and see if there 636 * No ram disk was included - check and see if there
@@ -971,6 +958,8 @@ void build_flat_dt(struct iseries_flat_dt *dt)
971 /* /chosen */ 958 /* /chosen */
972 dt_start_node(dt, "chosen"); 959 dt_start_node(dt, "chosen");
973 dt_prop_u32(dt, "linux,platform", PLATFORM_ISERIES_LPAR); 960 dt_prop_u32(dt, "linux,platform", PLATFORM_ISERIES_LPAR);
961 if (cmd_mem_limit)
962 dt_prop_u64(dt, "linux,memory-limit", cmd_mem_limit);
974 dt_end_node(dt); 963 dt_end_node(dt);
975 964
976 dt_cpus(dt); 965 dt_cpus(dt);
@@ -990,7 +979,27 @@ void * __init iSeries_early_setup(void)
990 */ 979 */
991 build_iSeries_Memory_Map(); 980 build_iSeries_Memory_Map();
992 981
982 iSeries_get_cmdline();
983
984 /* Save unparsed command line copy for /proc/cmdline */
985 strlcpy(saved_command_line, cmd_line, COMMAND_LINE_SIZE);
986
987 /* Parse early parameters, in particular mem=x */
988 parse_early_param();
989
993 build_flat_dt(&iseries_dt); 990 build_flat_dt(&iseries_dt);
994 991
995 return (void *) __pa(&iseries_dt); 992 return (void *) __pa(&iseries_dt);
996} 993}
994
995/*
996 * On iSeries we just parse the mem=X option from the command line.
997 * On pSeries it's a bit more complicated, see prom_init_mem()
998 */
999static int __init early_parsemem(char *p)
1000{
1001 if (p)
1002 cmd_mem_limit = ALIGN(memparse(p, &p), PAGE_SIZE);
1003 return 0;
1004}
1005early_param("mem", early_parsemem);
diff --git a/arch/powerpc/platforms/iseries/smp.c b/arch/powerpc/platforms/iseries/smp.c
index f720916682f6..3336bad67724 100644
--- a/arch/powerpc/platforms/iseries/smp.c
+++ b/arch/powerpc/platforms/iseries/smp.c
@@ -38,7 +38,7 @@
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> 43#include <asm/ppcdebug.h>
44#include <asm/machdep.h> 44#include <asm/machdep.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/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..80b58c1ec412 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
@@ -350,7 +351,7 @@ void __init pmac_setup_arch(void)
350 find_via_pmu(); 351 find_via_pmu();
351 smu_init(); 352 smu_init();
352 353
353#ifdef CONFIG_NVRAM 354#if defined(CONFIG_NVRAM) || defined(CONFIG_PPC64)
354 pmac_nvram_init(); 355 pmac_nvram_init();
355#endif 356#endif
356 357
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..513e27231493 100644
--- a/arch/powerpc/platforms/pseries/iommu.c
+++ b/arch/powerpc/platforms/pseries/iommu.c
@@ -42,13 +42,14 @@
42#include <asm/pci-bridge.h> 42#include <asm/pci-bridge.h>
43#include <asm/machdep.h> 43#include <asm/machdep.h>
44#include <asm/abs_addr.h> 44#include <asm/abs_addr.h>
45#include <asm/plpar_wrappers.h>
46#include <asm/pSeries_reconfig.h> 45#include <asm/pSeries_reconfig.h>
47#include <asm/systemcfg.h> 46#include <asm/systemcfg.h>
48#include <asm/firmware.h> 47#include <asm/firmware.h>
49#include <asm/tce.h> 48#include <asm/tce.h>
50#include <asm/ppc-pci.h> 49#include <asm/ppc-pci.h>
51 50
51#include "plpar_wrappers.h"
52
52#define DBG(fmt...) 53#define DBG(fmt...)
53 54
54extern int is_python(struct device_node *); 55extern int is_python(struct device_node *);
@@ -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..ab0c6dd6ec94 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>
@@ -38,12 +38,13 @@
38#include <asm/prom.h> 38#include <asm/prom.h>
39#include <asm/abs_addr.h> 39#include <asm/abs_addr.h>
40#include <asm/cputable.h> 40#include <asm/cputable.h>
41#include <asm/plpar_wrappers.h>
42 41
43#ifdef DEBUG 42#include "plpar_wrappers.h"
44#define DBG(fmt...) udbg_printf(fmt) 43
44#ifdef DEBUG_LOW
45#define DBG_LOW(fmt...) do { udbg_printf(fmt); } while(0)
45#else 46#else
46#define DBG(fmt...) 47#define DBG_LOW(fmt...) do { } while(0)
47#endif 48#endif
48 49
49/* in pSeries_hvCall.S */ 50/* in pSeries_hvCall.S */
@@ -260,27 +261,24 @@ out:
260void vpa_init(int cpu) 261void vpa_init(int cpu)
261{ 262{
262 int hwcpu = get_hard_smp_processor_id(cpu); 263 int hwcpu = get_hard_smp_processor_id(cpu);
263 unsigned long vpa = (unsigned long)&(paca[cpu].lppaca); 264 unsigned long vpa = __pa(&paca[cpu].lppaca);
264 long ret; 265 long ret;
265 unsigned long flags;
266
267 /* Register the Virtual Processor Area (VPA) */
268 flags = 1UL << (63 - 18);
269 266
270 if (cpu_has_feature(CPU_FTR_ALTIVEC)) 267 if (cpu_has_feature(CPU_FTR_ALTIVEC))
271 paca[cpu].lppaca.vmxregs_in_use = 1; 268 paca[cpu].lppaca.vmxregs_in_use = 1;
272 269
273 ret = register_vpa(flags, hwcpu, __pa(vpa)); 270 ret = register_vpa(hwcpu, vpa);
274 271
275 if (ret) 272 if (ret)
276 printk(KERN_ERR "WARNING: vpa_init: VPA registration for " 273 printk(KERN_ERR "WARNING: vpa_init: VPA registration for "
277 "cpu %d (hw %d) of area %lx returns %ld\n", 274 "cpu %d (hw %d) of area %lx returns %ld\n",
278 cpu, hwcpu, __pa(vpa), ret); 275 cpu, hwcpu, vpa, ret);
279} 276}
280 277
281long pSeries_lpar_hpte_insert(unsigned long hpte_group, 278long pSeries_lpar_hpte_insert(unsigned long hpte_group,
282 unsigned long va, unsigned long prpn, 279 unsigned long va, unsigned long pa,
283 unsigned long vflags, unsigned long rflags) 280 unsigned long rflags, unsigned long vflags,
281 int psize)
284{ 282{
285 unsigned long lpar_rc; 283 unsigned long lpar_rc;
286 unsigned long flags; 284 unsigned long flags;
@@ -288,11 +286,28 @@ long pSeries_lpar_hpte_insert(unsigned long hpte_group,
288 unsigned long hpte_v, hpte_r; 286 unsigned long hpte_v, hpte_r;
289 unsigned long dummy0, dummy1; 287 unsigned long dummy0, dummy1;
290 288
291 hpte_v = ((va >> 23) << HPTE_V_AVPN_SHIFT) | vflags | HPTE_V_VALID; 289 if (!(vflags & HPTE_V_BOLTED))
292 if (vflags & HPTE_V_LARGE) 290 DBG_LOW("hpte_insert(group=%lx, va=%016lx, pa=%016lx, "
293 hpte_v &= ~(1UL << HPTE_V_AVPN_SHIFT); 291 "rflags=%lx, vflags=%lx, psize=%d)\n",
294 292 hpte_group, va, pa, rflags, vflags, psize);
295 hpte_r = (prpn << HPTE_R_RPN_SHIFT) | rflags; 293
294 hpte_v = hpte_encode_v(va, psize) | vflags | HPTE_V_VALID;
295 hpte_r = hpte_encode_r(pa, psize) | rflags;
296
297 if (!(vflags & HPTE_V_BOLTED))
298 DBG_LOW(" hpte_v=%016lx, hpte_r=%016lx\n", hpte_v, hpte_r);
299
300#if 1
301 {
302 int i;
303 for (i=0;i<8;i++) {
304 unsigned long w0, w1;
305 plpar_pte_read(0, hpte_group, &w0, &w1);
306 BUG_ON (HPTE_V_COMPARE(hpte_v, w0)
307 && (w0 & HPTE_V_VALID));
308 }
309 }
310#endif
296 311
297 /* Now fill in the actual HPTE */ 312 /* Now fill in the actual HPTE */
298 /* Set CEC cookie to 0 */ 313 /* Set CEC cookie to 0 */
@@ -302,23 +317,30 @@ long pSeries_lpar_hpte_insert(unsigned long hpte_group,
302 /* Exact = 0 */ 317 /* Exact = 0 */
303 flags = 0; 318 flags = 0;
304 319
305 /* XXX why is this here? - Anton */ 320 /* Make pHyp happy */
306 if (rflags & (_PAGE_GUARDED|_PAGE_NO_CACHE)) 321 if (rflags & (_PAGE_GUARDED|_PAGE_NO_CACHE))
307 hpte_r &= ~_PAGE_COHERENT; 322 hpte_r &= ~_PAGE_COHERENT;
308 323
309 lpar_rc = plpar_hcall(H_ENTER, flags, hpte_group, hpte_v, 324 lpar_rc = plpar_hcall(H_ENTER, flags, hpte_group, hpte_v,
310 hpte_r, &slot, &dummy0, &dummy1); 325 hpte_r, &slot, &dummy0, &dummy1);
311 326 if (unlikely(lpar_rc == H_PTEG_Full)) {
312 if (unlikely(lpar_rc == H_PTEG_Full)) 327 if (!(vflags & HPTE_V_BOLTED))
328 DBG_LOW(" full\n");
313 return -1; 329 return -1;
330 }
314 331
315 /* 332 /*
316 * Since we try and ioremap PHBs we don't own, the pte insert 333 * 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 334 * will fail. However we must catch the failure in hash_page
318 * or we will loop forever, so return -2 in this case. 335 * or we will loop forever, so return -2 in this case.
319 */ 336 */
320 if (unlikely(lpar_rc != H_Success)) 337 if (unlikely(lpar_rc != H_Success)) {
338 if (!(vflags & HPTE_V_BOLTED))
339 DBG_LOW(" lpar err %d\n", lpar_rc);
321 return -2; 340 return -2;
341 }
342 if (!(vflags & HPTE_V_BOLTED))
343 DBG_LOW(" -> slot: %d\n", slot & 7);
322 344
323 /* Because of iSeries, we have to pass down the secondary 345 /* Because of iSeries, we have to pass down the secondary
324 * bucket bit here as well 346 * bucket bit here as well
@@ -343,10 +365,8 @@ static long pSeries_lpar_hpte_remove(unsigned long hpte_group)
343 /* don't remove a bolted entry */ 365 /* don't remove a bolted entry */
344 lpar_rc = plpar_pte_remove(H_ANDCOND, hpte_group + slot_offset, 366 lpar_rc = plpar_pte_remove(H_ANDCOND, hpte_group + slot_offset,
345 (0x1UL << 4), &dummy1, &dummy2); 367 (0x1UL << 4), &dummy1, &dummy2);
346
347 if (lpar_rc == H_Success) 368 if (lpar_rc == H_Success)
348 return i; 369 return i;
349
350 BUG_ON(lpar_rc != H_Not_Found); 370 BUG_ON(lpar_rc != H_Not_Found);
351 371
352 slot_offset++; 372 slot_offset++;
@@ -374,20 +394,28 @@ static void pSeries_lpar_hptab_clear(void)
374 * We can probably optimize here and assume the high bits of newpp are 394 * We can probably optimize here and assume the high bits of newpp are
375 * already zero. For now I am paranoid. 395 * already zero. For now I am paranoid.
376 */ 396 */
377static long pSeries_lpar_hpte_updatepp(unsigned long slot, unsigned long newpp, 397static long pSeries_lpar_hpte_updatepp(unsigned long slot,
378 unsigned long va, int large, int local) 398 unsigned long newpp,
399 unsigned long va,
400 int psize, int local)
379{ 401{
380 unsigned long lpar_rc; 402 unsigned long lpar_rc;
381 unsigned long flags = (newpp & 7) | H_AVPN; 403 unsigned long flags = (newpp & 7) | H_AVPN;
382 unsigned long avpn = va >> 23; 404 unsigned long want_v;
383 405
384 if (large) 406 want_v = hpte_encode_v(va, psize);
385 avpn &= ~0x1UL;
386 407
387 lpar_rc = plpar_pte_protect(flags, slot, (avpn << 7)); 408 DBG_LOW(" update: avpnv=%016lx, hash=%016lx, f=%x, psize: %d ... ",
409 want_v & HPTE_V_AVPN, slot, flags, psize);
388 410
389 if (lpar_rc == H_Not_Found) 411 lpar_rc = plpar_pte_protect(flags, slot, want_v & HPTE_V_AVPN);
412
413 if (lpar_rc == H_Not_Found) {
414 DBG_LOW("not found !\n");
390 return -1; 415 return -1;
416 }
417
418 DBG_LOW("ok\n");
391 419
392 BUG_ON(lpar_rc != H_Success); 420 BUG_ON(lpar_rc != H_Success);
393 421
@@ -413,21 +441,22 @@ static unsigned long pSeries_lpar_hpte_getword0(unsigned long slot)
413 return dword0; 441 return dword0;
414} 442}
415 443
416static long pSeries_lpar_hpte_find(unsigned long vpn) 444static long pSeries_lpar_hpte_find(unsigned long va, int psize)
417{ 445{
418 unsigned long hash; 446 unsigned long hash;
419 unsigned long i, j; 447 unsigned long i, j;
420 long slot; 448 long slot;
421 unsigned long hpte_v; 449 unsigned long want_v, hpte_v;
422 450
423 hash = hpt_hash(vpn, 0); 451 hash = hpt_hash(va, mmu_psize_defs[psize].shift);
452 want_v = hpte_encode_v(va, psize);
424 453
425 for (j = 0; j < 2; j++) { 454 for (j = 0; j < 2; j++) {
426 slot = (hash & htab_hash_mask) * HPTES_PER_GROUP; 455 slot = (hash & htab_hash_mask) * HPTES_PER_GROUP;
427 for (i = 0; i < HPTES_PER_GROUP; i++) { 456 for (i = 0; i < HPTES_PER_GROUP; i++) {
428 hpte_v = pSeries_lpar_hpte_getword0(slot); 457 hpte_v = pSeries_lpar_hpte_getword0(slot);
429 458
430 if ((HPTE_V_AVPN_VAL(hpte_v) == (vpn >> 11)) 459 if (HPTE_V_COMPARE(hpte_v, want_v)
431 && (hpte_v & HPTE_V_VALID) 460 && (hpte_v & HPTE_V_VALID)
432 && (!!(hpte_v & HPTE_V_SECONDARY) == j)) { 461 && (!!(hpte_v & HPTE_V_SECONDARY) == j)) {
433 /* HPTE matches */ 462 /* HPTE matches */
@@ -444,17 +473,15 @@ static long pSeries_lpar_hpte_find(unsigned long vpn)
444} 473}
445 474
446static void pSeries_lpar_hpte_updateboltedpp(unsigned long newpp, 475static void pSeries_lpar_hpte_updateboltedpp(unsigned long newpp,
447 unsigned long ea) 476 unsigned long ea,
477 int psize)
448{ 478{
449 unsigned long lpar_rc; 479 unsigned long lpar_rc, slot, vsid, va, flags;
450 unsigned long vsid, va, vpn, flags;
451 long slot;
452 480
453 vsid = get_kernel_vsid(ea); 481 vsid = get_kernel_vsid(ea);
454 va = (vsid << 28) | (ea & 0x0fffffff); 482 va = (vsid << 28) | (ea & 0x0fffffff);
455 vpn = va >> PAGE_SHIFT;
456 483
457 slot = pSeries_lpar_hpte_find(vpn); 484 slot = pSeries_lpar_hpte_find(va, psize);
458 BUG_ON(slot == -1); 485 BUG_ON(slot == -1);
459 486
460 flags = newpp & 7; 487 flags = newpp & 7;
@@ -464,18 +491,18 @@ static void pSeries_lpar_hpte_updateboltedpp(unsigned long newpp,
464} 491}
465 492
466static void pSeries_lpar_hpte_invalidate(unsigned long slot, unsigned long va, 493static void pSeries_lpar_hpte_invalidate(unsigned long slot, unsigned long va,
467 int large, int local) 494 int psize, int local)
468{ 495{
469 unsigned long avpn = va >> 23; 496 unsigned long want_v;
470 unsigned long lpar_rc; 497 unsigned long lpar_rc;
471 unsigned long dummy1, dummy2; 498 unsigned long dummy1, dummy2;
472 499
473 if (large) 500 DBG_LOW(" inval : slot=%lx, va=%016lx, psize: %d, local: %d",
474 avpn &= ~0x1UL; 501 slot, va, psize, local);
475
476 lpar_rc = plpar_pte_remove(H_AVPN, slot, (avpn << 7), &dummy1,
477 &dummy2);
478 502
503 want_v = hpte_encode_v(va, psize);
504 lpar_rc = plpar_pte_remove(H_AVPN, slot, want_v & HPTE_V_AVPN,
505 &dummy1, &dummy2);
479 if (lpar_rc == H_Not_Found) 506 if (lpar_rc == H_Not_Found)
480 return; 507 return;
481 508
@@ -497,7 +524,8 @@ void pSeries_lpar_flush_hash_range(unsigned long number, int local)
497 spin_lock_irqsave(&pSeries_lpar_tlbie_lock, flags); 524 spin_lock_irqsave(&pSeries_lpar_tlbie_lock, flags);
498 525
499 for (i = 0; i < number; i++) 526 for (i = 0; i < number; i++)
500 flush_hash_page(batch->vaddr[i], batch->pte[i], local); 527 flush_hash_page(batch->vaddr[i], batch->pte[i],
528 batch->psize, local);
501 529
502 if (lock_tlbie) 530 if (lock_tlbie)
503 spin_unlock_irqrestore(&pSeries_lpar_tlbie_lock, flags); 531 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..382f8c5b0e7c
--- /dev/null
+++ b/arch/powerpc/platforms/pseries/plpar_wrappers.h
@@ -0,0 +1,120 @@
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
110static inline long plpar_set_xdabr(unsigned long address, unsigned long flags)
111{
112 return plpar_hcall_norets(H_SET_XDABR, address, flags);
113}
114
115static inline long plpar_set_dabr(unsigned long val)
116{
117 return plpar_hcall_norets(H_SET_DABR, val);
118}
119
120#endif /* _PSERIES_PLPAR_WRAPPERS_H */
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..65bee939eecc 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>
@@ -67,7 +66,7 @@
67#include <asm/i8259.h> 66#include <asm/i8259.h>
68#include <asm/udbg.h> 67#include <asm/udbg.h>
69 68
70#include "rtas-fw.h" 69#include "plpar_wrappers.h"
71 70
72#ifdef DEBUG 71#ifdef DEBUG
73#define DBG(fmt...) udbg_printf(fmt) 72#define DBG(fmt...) udbg_printf(fmt)
@@ -352,6 +351,16 @@ static void pSeries_mach_cpu_die(void)
352 for(;;); 351 for(;;);
353} 352}
354 353
354static int pseries_set_dabr(unsigned long dabr)
355{
356 if (firmware_has_feature(FW_FEATURE_XDABR)) {
357 /* We want to catch accesses from kernel and userspace */
358 return plpar_set_xdabr(dabr, H_DABRX_KERNEL | H_DABRX_USER);
359 }
360
361 return plpar_set_dabr(dabr);
362}
363
355 364
356/* 365/*
357 * Early initialization. Relocation is on but do not reference unbolted pages 366 * Early initialization. Relocation is on but do not reference unbolted pages
@@ -387,6 +396,8 @@ static void __init pSeries_init_early(void)
387 DBG("Hello World !\n"); 396 DBG("Hello World !\n");
388 } 397 }
389 398
399 if (firmware_has_feature(FW_FEATURE_XDABR | FW_FEATURE_DABR))
400 ppc_md.set_dabr = pseries_set_dabr;
390 401
391 iommu_init_early_pSeries(); 402 iommu_init_early_pSeries();
392 403
@@ -591,9 +602,9 @@ struct machdep_calls __initdata pSeries_md = {
591 .pcibios_fixup = pSeries_final_fixup, 602 .pcibios_fixup = pSeries_final_fixup,
592 .pci_probe_mode = pSeries_pci_probe_mode, 603 .pci_probe_mode = pSeries_pci_probe_mode,
593 .irq_bus_setup = pSeries_irq_bus_setup, 604 .irq_bus_setup = pSeries_irq_bus_setup,
594 .restart = rtas_fw_restart, 605 .restart = rtas_restart,
595 .power_off = rtas_fw_power_off, 606 .power_off = rtas_power_off,
596 .halt = rtas_fw_halt, 607 .halt = rtas_halt,
597 .panic = rtas_os_term, 608 .panic = rtas_os_term,
598 .cpu_die = pSeries_mach_cpu_die, 609 .cpu_die = pSeries_mach_cpu_die,
599 .get_boot_time = rtas_get_boot_time, 610 .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/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..607722178c1a 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 *
@@ -44,9 +44,10 @@
44#include <asm/abs_addr.h> 44#include <asm/abs_addr.h>
45#include <asm/cacheflush.h> 45#include <asm/cacheflush.h>
46#include <asm/lmb.h> 46#include <asm/lmb.h>
47#include <asm/dart.h>
48#include <asm/ppc-pci.h> 47#include <asm/ppc-pci.h>
49 48
49#include "dart.h"
50
50extern int iommu_force_on; 51extern int iommu_force_on;
51 52
52/* Physical base address and size of the DART table */ 53/* 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/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/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/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/traps.c b/arch/ppc/kernel/traps.c
index f265b81e7008..16adde6b429d 100644
--- a/arch/ppc/kernel/traps.c
+++ b/arch/ppc/kernel/traps.c
@@ -606,22 +606,22 @@ int check_bug_trap(struct pt_regs *regs)
606 if (bug->line & BUG_WARNING_TRAP) { 606 if (bug->line & BUG_WARNING_TRAP) {
607 /* this is a WARN_ON rather than BUG/BUG_ON */ 607 /* this is a WARN_ON rather than BUG/BUG_ON */
608#ifdef CONFIG_XMON 608#ifdef CONFIG_XMON
609 xmon_printf(KERN_ERR "Badness in %s at %s:%d\n", 609 xmon_printf(KERN_ERR "Badness in %s at %s:%ld\n",
610 bug->function, bug->file, 610 bug->function, bug->file,
611 bug->line & ~BUG_WARNING_TRAP); 611 bug->line & ~BUG_WARNING_TRAP);
612#endif /* CONFIG_XMON */ 612#endif /* CONFIG_XMON */
613 printk(KERN_ERR "Badness in %s at %s:%d\n", 613 printk(KERN_ERR "Badness in %s at %s:%ld\n",
614 bug->function, bug->file, 614 bug->function, bug->file,
615 bug->line & ~BUG_WARNING_TRAP); 615 bug->line & ~BUG_WARNING_TRAP);
616 dump_stack(); 616 dump_stack();
617 return 1; 617 return 1;
618 } 618 }
619#ifdef CONFIG_XMON 619#ifdef CONFIG_XMON
620 xmon_printf(KERN_CRIT "kernel BUG in %s at %s:%d!\n", 620 xmon_printf(KERN_CRIT "kernel BUG in %s at %s:%ld!\n",
621 bug->function, bug->file, bug->line); 621 bug->function, bug->file, bug->line);
622 xmon(regs); 622 xmon(regs);
623#endif /* CONFIG_XMON */ 623#endif /* CONFIG_XMON */
624 printk(KERN_CRIT "kernel BUG in %s at %s:%d!\n", 624 printk(KERN_CRIT "kernel BUG in %s at %s:%ld!\n",
625 bug->function, bug->file, bug->line); 625 bug->function, bug->file, bug->line);
626 626
627 return 0; 627 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/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/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..5bd33baac243 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
@@ -32,6 +33,7 @@ obj-$(CONFIG_PPC4xx_DMA) += ppc4xx_dma.o
32obj-$(CONFIG_PPC4xx_EDMA) += ppc4xx_sgdma.o 33obj-$(CONFIG_PPC4xx_EDMA) += ppc4xx_sgdma.o
33ifeq ($(CONFIG_40x),y) 34ifeq ($(CONFIG_40x),y)
34obj-$(CONFIG_PCI) += pci_auto.o ppc405_pci.o 35obj-$(CONFIG_PCI) += pci_auto.o ppc405_pci.o
36obj-$(CONFIG_RAPIDIO) += ppc85xx_rio.o
35endif 37endif
36endif 38endif
37obj-$(CONFIG_8xx) += m8xx_setup.o ppc8xx_pic.o $(wdt-mpc8xx-y) \ 39obj-$(CONFIG_8xx) += m8xx_setup.o ppc8xx_pic.o $(wdt-mpc8xx-y) \
@@ -46,12 +48,14 @@ obj-$(CONFIG_BAMBOO) += pci_auto.o todc_time.o
46obj-$(CONFIG_CPCI690) += todc_time.o pci_auto.o 48obj-$(CONFIG_CPCI690) += todc_time.o pci_auto.o
47obj-$(CONFIG_EBONY) += pci_auto.o todc_time.o 49obj-$(CONFIG_EBONY) += pci_auto.o todc_time.o
48obj-$(CONFIG_EV64260) += todc_time.o pci_auto.o 50obj-$(CONFIG_EV64260) += todc_time.o pci_auto.o
51obj-$(CONFIG_EV64360) += todc_time.o
49obj-$(CONFIG_CHESTNUT) += mv64360_pic.o pci_auto.o 52obj-$(CONFIG_CHESTNUT) += mv64360_pic.o pci_auto.o
50obj-$(CONFIG_GEMINI) += open_pic.o 53obj-$(CONFIG_GEMINI) += open_pic.o
51obj-$(CONFIG_GT64260) += gt64260_pic.o 54obj-$(CONFIG_GT64260) += gt64260_pic.o
52obj-$(CONFIG_LOPEC) += pci_auto.o todc_time.o 55obj-$(CONFIG_LOPEC) += pci_auto.o todc_time.o
53obj-$(CONFIG_HDPU) += pci_auto.o 56obj-$(CONFIG_HDPU) += pci_auto.o
54obj-$(CONFIG_LUAN) += pci_auto.o todc_time.o 57obj-$(CONFIG_LUAN) += pci_auto.o todc_time.o
58obj-$(CONFIG_YUCCA) += pci_auto.o todc_time.o
55obj-$(CONFIG_KATANA) += pci_auto.o 59obj-$(CONFIG_KATANA) += pci_auto.o
56obj-$(CONFIG_MV64360) += mv64360_pic.o 60obj-$(CONFIG_MV64360) += mv64360_pic.o
57obj-$(CONFIG_MV64X60) += mv64x60.o mv64x60_win.o 61obj-$(CONFIG_MV64X60) += mv64x60.o mv64x60_win.o
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/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..1b9aa0d6a924 100644
--- a/arch/ppc/syslib/prom.c
+++ b/arch/ppc/syslib/prom.c
@@ -1335,10 +1335,8 @@ release_OF_resource(struct device_node* node, int index)
1335 if (!res) 1335 if (!res)
1336 return -ENODEV; 1336 return -ENODEV;
1337 1337
1338 if (res->name) { 1338 kfree(res->name);
1339 kfree(res->name); 1339 res->name = NULL;
1340 res->name = NULL;
1341 }
1342 release_resource(res); 1340 release_resource(res);
1343 kfree(res); 1341 kfree(res);
1344 1342
diff --git a/arch/ppc64/Kconfig b/arch/ppc64/Kconfig
index 42677cc96508..2130cc315957 100644
--- a/arch/ppc64/Kconfig
+++ b/arch/ppc64/Kconfig
@@ -47,6 +47,10 @@ 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
@@ -89,12 +93,14 @@ config PPC_PMAC
89 bool " Apple G5 based machines" 93 bool " Apple G5 based machines"
90 default y 94 default y
91 select U3_DART 95 select U3_DART
96 select GENERIC_TBSYNC
92 97
93config PPC_MAPLE 98config PPC_MAPLE
94 depends on PPC_MULTIPLATFORM 99 depends on PPC_MULTIPLATFORM
95 bool " Maple 970FX Evaluation Board" 100 bool " Maple 970FX Evaluation Board"
96 select U3_DART 101 select U3_DART
97 select MPIC_BROKEN_U3 102 select MPIC_BROKEN_U3
103 select GENERIC_TBSYNC
98 default n 104 default n
99 help 105 help
100 This option enables support for the Maple 970FX Evaluation Board. 106 This option enables support for the Maple 970FX Evaluation Board.
@@ -182,6 +188,9 @@ config MPIC_BROKEN_U3
182 depends on PPC_MAPLE 188 depends on PPC_MAPLE
183 default y 189 default y
184 190
191config GENERIC_TBSYNC
192 def_bool n
193
185config PPC_PMAC64 194config PPC_PMAC64
186 bool 195 bool
187 depends on PPC_PMAC 196 depends on PPC_PMAC
@@ -289,6 +298,15 @@ config NODES_SPAN_OTHER_NODES
289 def_bool y 298 def_bool y
290 depends on NEED_MULTIPLE_NODES 299 depends on NEED_MULTIPLE_NODES
291 300
301config PPC_64K_PAGES
302 bool "64k page size"
303 help
304 This option changes the kernel logical page size to 64k. On machines
305 without processor support for 64k pages, the kernel will simulate
306 them by loading each individual 4k page on demand transparently,
307 while on hardware with such support, it will be used to map
308 normal application pages.
309
292config SCHED_SMT 310config SCHED_SMT
293 bool "SMT (Hyperthreading) scheduler support" 311 bool "SMT (Hyperthreading) scheduler support"
294 depends on SMP 312 depends on SMP
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/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..ff8679f260f3 100644
--- a/arch/ppc64/kernel/machine_kexec.c
+++ b/arch/ppc64/kernel/machine_kexec.c
@@ -244,7 +244,6 @@ static void kexec_prepare_cpus(void)
244 244
245static void kexec_prepare_cpus(void) 245static void kexec_prepare_cpus(void)
246{ 246{
247 extern void smp_release_cpus(void);
248 /* 247 /*
249 * move the secondarys to us so that we can copy 248 * move the secondarys to us so that we can copy
250 * the new kernel 0-0x100 safely 249 * the new kernel 0-0x100 safely
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_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..dece31e58bc4 100644
--- a/arch/ppc64/kernel/prom.c
+++ b/arch/ppc64/kernel/prom.c
@@ -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
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 1247
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
diff --git a/arch/ppc64/kernel/prom_init.c b/arch/ppc64/kernel/prom_init.c
index 69924ba4d7d9..a4bbca6dbb8b 100644
--- a/arch/ppc64/kernel/prom_init.c
+++ b/arch/ppc64/kernel/prom_init.c
@@ -1939,9 +1939,9 @@ unsigned long __init prom_init(unsigned long r3, unsigned long r4, unsigned long
1939 prom_send_capabilities(); 1939 prom_send_capabilities();
1940 1940
1941 /* 1941 /*
1942 * On pSeries and BPA, copy the CPU hold code 1942 * On pSeries and Cell, copy the CPU hold code
1943 */ 1943 */
1944 if (RELOC(of_platform) & (PLATFORM_PSERIES | PLATFORM_BPA)) 1944 if (RELOC(of_platform) & (PLATFORM_PSERIES | PLATFORM_CELL))
1945 copy_and_flush(0, KERNELBASE - offset, 0x100, 0); 1945 copy_and_flush(0, KERNELBASE - offset, 0x100, 0);
1946 1946
1947 /* 1947 /*
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_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/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/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/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..64e32da77754 100644
--- a/arch/s390/mm/fault.c
+++ b/arch/s390/mm/fault.c
@@ -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/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/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/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/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/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/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/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..fe865d9a3721 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
@@ -664,8 +663,6 @@ static int uml_inetaddr_event(struct notifier_block *this, unsigned long event,
664 void *ptr) 663 void *ptr)
665{ 664{
666 struct in_ifaddr *ifa = ptr; 665 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; 666 struct net_device *dev = ifa->ifa_dev->dev;
670 struct uml_net_private *lp; 667 struct uml_net_private *lp;
671 void (*proc)(unsigned char *, unsigned char *, void *); 668 void (*proc)(unsigned char *, unsigned char *, void *);
@@ -685,14 +682,8 @@ static int uml_inetaddr_event(struct notifier_block *this, unsigned long event,
685 break; 682 break;
686 } 683 }
687 if(proc != NULL){ 684 if(proc != NULL){
688 addr_buf[0] = addr & 0xff; 685 memcpy(addr_buf, &ifa->ifa_address, sizeof(addr_buf));
689 addr_buf[1] = (addr >> 8) & 0xff; 686 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); 687 (*proc)(addr_buf, netmask_buf, &lp->user);
697 } 688 }
698 return(NOTIFY_DONE); 689 return(NOTIFY_DONE);
@@ -774,27 +765,18 @@ int setup_etheraddr(char *str, unsigned char *addr)
774 return(1); 765 return(1);
775} 766}
776 767
777void dev_ip_addr(void *d, char *buf, char *bin_buf) 768void dev_ip_addr(void *d, unsigned char *bin_buf)
778{ 769{
779 struct net_device *dev = d; 770 struct net_device *dev = d;
780 struct in_device *ip = dev->ip_ptr; 771 struct in_device *ip = dev->ip_ptr;
781 struct in_ifaddr *in; 772 struct in_ifaddr *in;
782 u32 addr;
783 773
784 if((ip == NULL) || ((in = ip->ifa_list) == NULL)){ 774 if((ip == NULL) || ((in = ip->ifa_list) == NULL)){
785 printk(KERN_WARNING "dev_ip_addr - device not assigned an " 775 printk(KERN_WARNING "dev_ip_addr - device not assigned an "
786 "IP address\n"); 776 "IP address\n");
787 return; 777 return;
788 } 778 }
789 addr = in->ifa_address; 779 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} 780}
799 781
800void set_ether_mac(void *d, unsigned char *addr) 782void set_ether_mac(void *d, unsigned char *addr)
@@ -829,14 +811,8 @@ void iter_addresses(void *d, void (*cb)(unsigned char *, unsigned char *,
829 if(ip == NULL) return; 811 if(ip == NULL) return;
830 in = ip->ifa_list; 812 in = ip->ifa_list;
831 while(in != NULL){ 813 while(in != NULL){
832 address[0] = in->ifa_address & 0xff; 814 memcpy(address, &in->ifa_address, sizeof(address));
833 address[1] = (in->ifa_address >> 8) & 0xff; 815 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); 816 (*cb)(address, netmask, arg);
841 in = in->ifa_next; 817 in = in->ifa_next;
842 } 818 }
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/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/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/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..4b5b088ec102 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;
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/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